Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.classpath34
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.options2
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.project28
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF67
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/about.html34
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/build.properties21
-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/elcl16/javaassist_co.gifbin344 -> 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.properties122
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/plugin.xml1457
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd106
-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.java357
-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.java196
-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.properties176
-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/actions/JSPNodeActionManager.java47
-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.java216
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java110
-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/ClassPatternRegistry.java127
-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.java239
-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.java263
-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.java309
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java145
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java243
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java71
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java1149
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java306
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java24
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java156
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java152
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java93
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java78
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java553
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java306
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPMethodCompletionProposal.java235
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java249
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java32
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java310
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java142
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java433
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java31
-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/JSPTemplatesCompletionProposalComputer.java151
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java126
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java31
-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/LibraryTagsCompletionProposalComputer.java528
-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.java115
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java189
-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/contentproperties/ui/TagContentSettingsPropertyPage.java68
-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.java61
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java110
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java36
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java68
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java264
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java126
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java441
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java113
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java74
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java178
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java218
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java83
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java291
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java274
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameParticipant.java56
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameRequestor.java44
-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.java73
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java63
-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/JSPMoveParticipant.java253
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java74
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java57
-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/JSPRenameChange.java300
-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/JSPRenameParticipant.java245
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java73
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java61
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java69
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java74
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java60
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java69
-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.java85
-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.java37
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java124
-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.java104
-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.java107
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java78
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java116
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java179
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java299
-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/JSPContentAssistPreferencePage.java175
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java112
-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.java877
-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.java108
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java284
-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.java227
-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.java71
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java137
-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/JavaCharacterPairInserter.java158
-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/JavaHeuristicScanner.java956
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java223
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java54
-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.java393
-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/views/contentoutline/TLDContentOutlineConfiguration.java349
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java280
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java522
-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.java521
-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.java63
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPImportDirectiveFilter.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties64
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml48
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/.cvsignore1
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/.project22
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/about.html96
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/about_files/CDDLv1.0.txt119
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/about_files/LICENSE.txt119
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/build.properties11
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_2.dtd292
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_3.dtd506
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_4.xsd267
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_5.xsd304
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd311
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_2.dtd197
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_3.dtd312
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_4.xsd315
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_5.xsd336
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd394
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/beans_1_0.xsd180
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_0.dtd557
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_5.xsd1036
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd1261
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_1_1.dtd894
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_0.dtd1671
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_1.xsd2208
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_0.xsd2706
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd3247
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd36
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_1_4.xsd1608
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd886
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_1_1.xsd491
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_client_1_1.xsd345
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_5.xsd2096
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd2422
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_2.xsd747
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd572
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_2.xsd578
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd737
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_0.xsd308
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_1.xsd343
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd389
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_1_0.xsd1562
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd1940
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_1_0.xsd307
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd357
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_2.dtd639
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_3.dtd1063
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_4.xsd1234
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_5.xsd1271
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd272
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd1575
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd515
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_0.dtd874
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_1.dtd895
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_2.xsd2071
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd2698
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd223
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd272
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_1.dtd265
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_2.dtd468
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_0.xsd1010
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_1.xsd1144
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd263
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/plugin.properties3
-rw-r--r--bundles/org.eclipse.jst.standard.schemas/plugin.xml245
-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.properties23
-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.xml2292
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css3.xml2566
-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.properties36
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/description.txt15
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.properties20
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.xml96
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java31
-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.properties14
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/IProductConstants.java16
-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.java106
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java212
-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.java285
-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.java1521
-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.java440
-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.java114
-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.java1075
-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.java266
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java627
-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.java1317
-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.java518
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java291
-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.java202
-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.java420
-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.java654
-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.java128
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java1021
-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.java129
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java108
-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.java357
-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.java421
-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.java264
-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.java106
-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.java59
-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.java104
-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.java42
-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.java302
-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.java1943
-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.java73
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java146
-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.java56
-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.java418
-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.java60
-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.java25
-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.MF51
-rw-r--r--bundles/org.eclipse.wst.css.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.css.ui/build.properties22
-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.properties82
-rw-r--r--bundles/org.eclipse.wst.css.ui/plugin.xml690
-rw-r--r--bundles/org.eclipse.wst.css.ui/schema/proposalInfo.exsd107
-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.java141
-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.properties130
-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.java611
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java113
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java258
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java467
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java339
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java202
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java232
-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.java169
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java372
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java159
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java164
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java41
-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/CSSTemplatesCompletionProposalComputer.java107
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CompletionProposal.java188
-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/contentassist/IProposalInfo.java25
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/ProposalInfoFactory.java66
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java641
-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/contentoutline/RefreshStructureJob.java355
-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.java399
-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/CSSSelectionConverterFactory.java153
-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.java54
-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/CSSCompletionProposalCategoriesConfiguration.java82
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java98
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java79
-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/CSSContentAssistPreferencePage.java126
-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.java321
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java922
-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/CSSFoldingStrategy.java88
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java61
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java356
-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.java40
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java228
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java135
-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/CSSCharacterPairInserter.java93
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java96
-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.java252
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java521
-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.java127
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java47
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java41
-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.MF42
-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.java782
-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.java29
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties15
-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.java375
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java71
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java117
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java164
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java428
-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.java79
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java74
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java91
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties123
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java687
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java329
-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.java204
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java332
-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.java108
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java28
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java111
-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.java38
-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.java50
-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.dtd.ui/.classpath12
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.options1
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.project26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF40
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/build.properties26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gifbin825 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gifbin336 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gifbin205 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gifbin164 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gifbin225 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gifbin320 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gifbin114 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gifbin234 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gifbin336 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gifbin205 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gifbin604 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gifbin360 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gifbin196 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gifbin124 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gifbin318 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gifbin177 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/any.gifbin136 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute_list.gifbin366 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/comment.gifbin196 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element_ref.gifbin585 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/emptycontent.gifbin156 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity.gifbin124 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity_reference.gifbin316 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_el.gifbin366 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_ent.gifbin339 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_not.gifbin341 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_unrec.gifbin382 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_attlist_obj.gifbin369 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_comments_obj.gifbin358 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/genhtmform_wiz.gifbin3357 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gifbin3294 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/notation.gifbin177 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/one.gifbin141 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onechoice.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormore.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormorechoice.gifbin139 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormoresequence.gifbin147 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onesequence.gifbin91 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optional.gifbin149 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalchoice.gifbin140 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalsequence.gifbin149 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gifbin347 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gifbin162 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/txtext.gifbin349 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/unrecognized_content.gifbin356 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gifbin358 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormore.gifbin140 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormorechoice.gifbin135 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormoresequence.gifbin146 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.pngbin4194 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/plugin.properties63
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/plugin.xml508
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java105
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java101
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties70
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java49
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java334
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java152
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java76
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java95
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java21
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java110
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java123
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java141
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java79
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java101
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java50
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java141
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java185
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java96
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java376
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java131
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java105
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java92
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java70
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java82
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java124
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties91
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java143
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java46
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java113
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java77
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java157
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java44
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java43
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java171
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java76
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java150
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDSyntaxColoringPage.java877
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java167
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java79
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java39
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java70
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java53
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java41
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java133
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java159
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java36
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java17
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java28
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java56
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.java44
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java52
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java35
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java39
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java34
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java49
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java67
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java70
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java44
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java130
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java42
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java513
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java304
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java37
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java287
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java268
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java98
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java396
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.properties13
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.xml16
-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.MF40
-rw-r--r--bundles/org.eclipse.wst.html.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.html.core/build.properties22
-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.java67
-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.properties47
-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.java91
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java763
-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.java37
-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.java1695
-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.java230
-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/CtdDatalist.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java50
-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/CtdFigure.java93
-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/CtdHeadingContainer.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java382
-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/CtdMediaElement.java58
-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.java72
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java94
-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.java889
-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/H5CMDocImpl.java84
-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/HTML5AttributeCollection.java1348
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java577
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java134
-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.java71
-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.java112
-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.java377
-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.java83
-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.java50
-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.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java51
-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/HedCOMMAND.java94
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java47
-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/HedDETAILS.java38
-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.java60
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java37
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java48
-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.java89
-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/HedHEADER.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java50
-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.java77
-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.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java61
-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/HedKEYGEN.java38
-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.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java48
-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.java87
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java45
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java74
-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/HedMath.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java95
-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.java59
-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/HedOUTPUT.java39
-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.java45
-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/HedPROGRESS.java65
-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/HedRP.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java60
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java86
-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.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java57
-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/HedSectioning.java36
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java67
-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/HedVIDEO.java65
-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/JCM21DocImpl.java20
-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.java495
-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/JSP21ElementCollection.java39
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java17
-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.java697
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java23
-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.java178
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java3193
-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.java219
-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.java114
-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.java93
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java69
-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.java266
-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.java20
-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.java172
-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.java365
-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.java859
-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/HTMLFormattingUtil.java90
-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.java418
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java140
-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.java273
-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.java455
-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.java170
-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.java124
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java159
-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.java133
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java291
-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/HTML50Namespace.java180
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java121
-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.java318
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java212
-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.java128
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java120
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java322
-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.java247
-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.java395
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java198
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java151
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java134
-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.java445
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java36
-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.MF52
-rw-r--r--bundles/org.eclipse.wst.html.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.html.ui/build.properties22
-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.properties85
-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.xml750
-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.java568
-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.java269
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java212
-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.properties183
-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.java369
-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.java511
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java134
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java107
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java339
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java161
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java146
-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.java115
-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.java76
-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.java412
-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.java333
-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.java148
-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.java154
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java525
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java81
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java129
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java170
-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/HTMLContentAssistPreferencePage.java248
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java114
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java518
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java895
-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.java130
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java334
-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.java80
-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/CharacterPairInserter.java118
-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.java84
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java107
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java248
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java521
-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.java48
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties54
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml48
-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.MF34
-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.properties23
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/plugin.xml137
-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.properties26
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSWebResourceEventManager.java257
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java48
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java220
-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/PathUtils.java146
-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.java211
-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/ConvertJob.java86
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java58
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java60
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java288
-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/ModuleCoreSupport.java198
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java151
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java60
-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/validation/JsValidator.java368
-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.java71
-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.java86
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java589
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java173
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java89
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java724
-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.java245
-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.java57
-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.java168
-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.java772
-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.support.jsp/.classpath7
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore4
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.project28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF25
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties7
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties14
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml74
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java70
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java76
-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.prefs28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF54
-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/icons/full/elcl16/javaassist_co.gifbin344 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties73
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml791
-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.java219
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java57
-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.java233
-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/contentassist/JSDTAutoActivationDelegate.java88
-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.java115
-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.java116
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java165
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java244
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java83
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java105
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java148
-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.java302
-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.java79
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java81
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java263
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java87
-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.java64
-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.java89
-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.java121
-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.java70
-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.java27
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java216
-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.java387
-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.java167
-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/JsCharacterPairInserter.java293
-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.java398
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java280
-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.java181
-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.java160
-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/.options19
-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.jFlex313
-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.jflex522
-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.java3838
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex2859
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java1937
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex1332
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh7
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse351
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml75
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/devTimeSupportInfo.txt15
-rw-r--r--bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF54
-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.properties100
-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.xml59
-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.exsd114
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd104
-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.java690
-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.java290
-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.java179
-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.java251
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java141
-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.java467
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java82
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/indexing/AbstractIndexManager.java1990
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java838
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java27
-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.java219
-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.java50
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java107
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties32
-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.java82
-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.java524
-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.java80
-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.java47
-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.java1517
-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.java2160
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java146
-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.java85
-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.java554
-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.java419
-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.java73
-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.java84
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java44
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java43
-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.java2979
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java622
-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.java249
-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.java1700
-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.java236
-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.java655
-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.java650
-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/AbstractMemoryListener.java205
-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.java208
-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.java394
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java152
-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.java54
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java79
-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.java83
-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.java751
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.classpath14
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.options73
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.project27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs91
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs25
-rw-r--r--bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF70
-rw-r--r--bundles/org.eclipse.wst.sse.ui/README.txt2
-rw-r--r--bundles/org.eclipse.wst.sse.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/build.properties30
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/maintopic.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/subtopic.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/toc.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gifbin370 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gifbin155 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gifbin221 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gifbin149 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gifbin243 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gifbin157 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/filter_ps.gifbin219 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gifbin233 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gifbin370 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gifbin121 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gifbin224 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gifbin344 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.sse.ui/plugin.properties122
-rw-r--r--bundles/org.eclipse.wst.sse.ui/plugin.xml877
-rw-r--r--bundles/org.eclipse.wst.sse.ui/reexport-info.txt4
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd131
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/commentingStrategy.exsd260
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd292
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd126
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd341
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd148
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd191
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/outlineFilters.exsd136
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/quickFixProcessor.exsd135
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd125
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java109
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java158
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java25
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java63
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java63
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java377
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java453
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java305
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java353
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java157
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java139
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java184
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java86
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension2.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredSourceViewerDecorationSupport.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java3689
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextInvocationContext.java53
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextMultiPassContentFormatter.java123
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java719
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java200
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/TextHoverInformationProvider.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java24
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java131
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java72
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java943
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java94
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java284
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CustomFilterPropertyTester.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java280
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java789
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java213
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java102
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java378
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java30
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java180
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java87
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java475
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java99
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties450
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java99
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java764
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java1332
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java129
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java118
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java49
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java81
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java114
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java971
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java667
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java67
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java400
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java286
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java248
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java104
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/BlockCommentingStrategy.java138
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategy.java355
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategyRegistry.java351
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/LineCommentingStrategy.java83
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java374
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java648
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java559
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java147
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java175
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java570
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java146
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java90
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java334
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java28
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java145
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java124
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java762
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java57
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java26
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java287
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java297
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java175
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQueryResult.java87
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CompoundQuickAssistProcessor.java211
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java77
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java137
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistryReader.java93
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java118
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java161
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java318
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java438
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java63
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java90
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java227
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java189
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java343
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java205
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java124
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java158
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java155
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java62
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java263
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java378
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java405
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java771
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java25
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java84
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java176
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineCustomFiltersDialog.java417
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java277
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.properties24
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineNamePatternFilter.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/StringMatcher.java384
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java91
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractCommentHandler.java96
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractStructuredSelectHandler.java106
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AddBlockCommentHandler.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/CustomFilterHandler.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java140
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java326
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/RemoveBlockCommentHandler.java84
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/StructuredSelectHistoryHandler.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/ToggleLineCommentHandler.java287
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java468
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java81
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java271
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java116
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java660
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java74
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java267
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java157
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java143
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java156
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java486
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java61
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java282
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java296
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java266
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractSyntaxColoringPage.java170
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractValidationSettingsPage.java421
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java230
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java100
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java132
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ScrolledPageContent.java49
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java202
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java461
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java905
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java453
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java130
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java82
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java522
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java207
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java89
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java45
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java69
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java210
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java405
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java128
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java904
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java59
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java157
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java934
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java435
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java70
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java543
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java847
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java442
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java193
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java310
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java75
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java258
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java57
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java111
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java398
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java139
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java241
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java363
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java86
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java154
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java116
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java207
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java168
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java121
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java83
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java172
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java156
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java127
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java117
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java110
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java124
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java83
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java415
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java771
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java1067
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java296
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java204
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java154
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java94
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java243
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java159
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java53
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java1235
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java120
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java238
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java175
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java156
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java77
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java392
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java891
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java82
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java119
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java148
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java338
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineFilterProcessor.java318
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java104
-rw-r--r--bundles/org.eclipse.wst.sse.ui/testToc.xml8
-rw-r--r--bundles/org.eclipse.wst.sse.ui/toc.xml13
-rw-r--r--bundles/org.eclipse.wst.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.html136
-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.properties26
-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.xml222
-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/soapenv.xsd117
-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.standard.schemas/xsd/xmlcatalog11.xsd266
-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/.options6
-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.MF327
-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.properties33
-rw-r--r--bundles/org.eclipse.wst.xml.core/component.xml21
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.properties28
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.xml209
-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/externalSchemaLocations.exsd102
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd102
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java795
-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.java174
-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.java321
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java69
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java367
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java68
-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.java96
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java41
-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.java255
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java97
-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/IDelegateCatalog.java72
-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-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java64
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java64
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/contentmodel/modelquery/IExternalSchemaLocationProvider.java34
-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.java102
-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/IExternalSchemaLocationProvider.java34
-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.java278
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java318
-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/ExternalSchemaLocationProviderRegistry.java56
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java121
-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.java846
-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.java485
-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.java636
-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.java414
-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.java257
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java494
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java656
-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.java176
-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.java205
-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/AnnotationMsg.java41
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java929
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java31
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java371
-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.java127
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java199
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java930
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java543
-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.java33
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java287
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java202
-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.java173
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java119
-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.properties34
-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.java63
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java86
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties47
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java128
-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.java114
-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.java780
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java148
-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/CharOperation.java91
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java356
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java100
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java204
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java43
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties17
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java981
-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.java1208
-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.java1552
-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.java57
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java534
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java1171
-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.java157
-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.java388
-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.java1192
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java56
-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.java2422
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java1704
-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.java1713
-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.java179
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java95
-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.java327
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java112
-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.java645
-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.java1913
-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.java82
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java298
-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.java29
-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.java53
-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.java120
-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.MF66
-rw-r--r--bundles/org.eclipse.wst.xml.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xml.ui/about.ini12
-rw-r--r--bundles/org.eclipse.wst.xml.ui/about.mappings6
-rw-r--r--bundles/org.eclipse.wst.xml.ui/about.properties24
-rw-r--r--bundles/org.eclipse.wst.xml.ui/build.properties32
-rw-r--r--bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zipbin13213 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.pngbin5616 -> 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/default.gifbin863 -> 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/error_obj.gifbin339 -> 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/sort.gifbin162 -> 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/view16/hierarchy.gifbin209 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/view16/synced.gifbin160 -> 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/full/xml_perspective.gifbin86 -> 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.properties161
-rw-r--r--bundles/org.eclipse.wst.xml.ui/plugin.xml1767
-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.java1816
-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.java322
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java194
-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.java163
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java235
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties142
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java303
-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/delegateCatalog.gifbin1783 -> 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/etool50/prefix.gifbin1237 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gifbin1230 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gifbin1226 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gifbin329 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gifbin596 -> 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/next_catalog.gifbin621 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gifbin323 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gifbin325 -> 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/DesignPageNavigationLocation.java394
-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.java513
-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.java57
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java210
-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.properties34
-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.java1164
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java321
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java384
-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.java485
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java174
-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.java95
-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.java329
-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.java524
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java967
-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.java101
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties102
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java226
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java237
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java74
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java18
-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/ProductProperties.java41
-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.java366
-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.properties377
-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.java690
-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.java521
-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.java220
-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.java301
-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.java48
-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.java304
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java2509
-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/AbstractXMLCompletionProposalComputer.java1112
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java1862
-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.java104
-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.java68
-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/DefaultXMLCompletionProposalComputer.java200
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java275
-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.java114
-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.java170
-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.java53
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java110
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java94
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java168
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java124
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java257
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java183
-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.java368
-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.java16
-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.java152
-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.java187
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java154
-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.java208
-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.java141
-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.java324
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java134
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java50
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java159
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java61
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/propertytester/XMLEditorTester.java46
-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/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/ContentModelSynchWithEditorHandler.java28
-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/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.java94
-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.java158
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java110
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java231
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java112
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java598
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java282
-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.java323
-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/perspective/XMLPerspectiveFactory.java88
-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.java361
-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/XMLCompletionProposalCategoriesConfiguration.java81
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java304
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java178
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java306
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java894
-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.java130
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java128
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java215
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java329
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java77
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java70
-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.java834
-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/quickoutline/XMLContentSelectionProvider.java46
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java43
-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/spelling/SpellcheckDelegateAdapterFactory.java103
-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.java184
-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/CharacterPairInserter.java118
-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.java675
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java59
-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.java1042
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/annotations/XMLAnnotationsView.java161
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/CMListWorkbenchAdapter.java193
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelAdapterFactory.java31
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelView.java89
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelWorkbenchAdapter.java49
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java342
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java24
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java30
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java416
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java23
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java286
-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.properties21
-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.java46
-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.java3141
-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.java115
-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.java36
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java32
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.classpath21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/build.properties27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/component.xml7
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gifbin361 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/blank.gifbin832 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gifbin825 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gifbin854 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gifbin364 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gifbin336 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dtool16/capturescreen.gifbin384 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dtool16/help_contents.gifbin253 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/capturescreen.gifbin613 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/help_contents.gifbin259 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gifbin577 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomminus.gifbin559 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomplus.gifbin559 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gifbin856 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/filter.gifbin219 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gifbin358 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gifbin365 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gifbin215 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gifbin327 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gifbin212 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gifbin209 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gifbin233 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gifbin164 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gifbin348 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gifbin345 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gifbin229 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gifbin349 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gifbin223 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gifbin327 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gifbin331 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gifbin215 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gifbin209 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gifbin210 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gifbin116 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gifbin73 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gifbin376 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gifbin369 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gifbin367 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gifbin130 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gifbin97 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gifbin336 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gifbin595 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gifbin292 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_tsk.gifbin353 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsn_obj.gifbin185 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsndis_obj.gifbin130 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gifbin372 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gifbin1109 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gifbin345 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gifbin120 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gifbin91 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gifbin149 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gifbin350 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gifbin224 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gifbin231 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gifbin213 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gifbin243 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gifbin230 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gifbin242 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gifbin117 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsn_ovr.gifbin111 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsndis_ovr.gifbin111 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.properties850
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.xml695
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/TypeVizEditorMode.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java119
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java188
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java66
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java360
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDAttributeAction.java248
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDBaseAction.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDElementAction.java173
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java292
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java175
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java153
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java111
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java285
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java101
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java238
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java236
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java280
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java566
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java339
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java120
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java260
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java340
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java295
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java537
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java131
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java268
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java247
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java188
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java237
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java441
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java259
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java311
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java128
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java248
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java275
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java148
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java230
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java67
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java473
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java164
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java160
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java74
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java378
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java334
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java239
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java169
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java89
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java189
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java121
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java221
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/IOpenInNewEditor.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewAttributeDialog.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewComponentDialog.java196
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java212
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java416
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java267
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java1468
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java155
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java128
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java140
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java192
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java464
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java389
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java143
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java134
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java151
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java301
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java269
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java156
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java227
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gifbin806 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gifbin605 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gifbin609 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gifbin860 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.pngbin4283 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gifbin54 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gifbin92 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gifbin558 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gifbin88 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gifbin594 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gifbin613 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gifbin384 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gifbin121 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gifbin235 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gifbin361 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gifbin350 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gifbin211 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gifbin155 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gifbin594 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gifbin368 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gifbin585 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gifbin101 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gifbin227 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gifbin361 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gifbin167 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gifbin351 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gifbin205 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gifbin899 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gifbin114 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gifbin324 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gifbin323 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gifbin558 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gifbin177 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gifbin115 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gifbin373 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gifbin136 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gifbin91 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gifbin210 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gifbin105 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gifbin347 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gifbin120 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gifbin141 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gifbin150 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gifbin150 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gifbin138 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gifbin210 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gifbin323 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gifbin583 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gifbin873 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gifbin825 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gifbin339 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gifbin874 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gifbin612 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gifbin225 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.pngbin4272 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gifbin365 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gifbin159 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gifbin598 -> 0 bytes
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties153
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDAttributeSearchListProvider.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java59
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java137
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java285
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java468
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java214
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java147
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java267
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java240
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java197
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java196
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ModelReconcileAdapter.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java404
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java246
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java477
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java369
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java111
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java335
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java135
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java947
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java421
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java147
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java129
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java371
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java132
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java263
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java117
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java74
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java449
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewerGraphicConstants.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java1488
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IKeyboardDrag.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ImageOverlayDescriptor.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java268
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/AttributeReferenceDirectEditManager.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java224
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java180
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java227
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BackToSchemaEditPart.java134
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java300
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java535
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CenteredConnectionAnchor.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java127
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CompartmentEditPart.java217
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java121
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java20
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IHolderEditPart.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java165
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootEditPart.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootHolderEditPart.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/SectionEditPart.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java249
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java135
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java105
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java24
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/RootHolder.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager2.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java153
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTFileStoreEditorInput.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java373
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTReadOnlyFileEditorInput.java135
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java942
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java124
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorMode.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorModeManager.java136
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IADTEditorInput.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java24
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java339
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java143
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java147
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyAttributeAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java128
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeGroupDefinitionAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDComplexTypeDefinitionAction.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java156
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupDefinitionAction.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java229
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSimpleTypeDefinitionAction.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java74
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java546
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddDocumentationCommand.java131
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensibilityElementCommand.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyAttributeCommand.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyElementCommand.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java238
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeGroupDefinitionCommand.java159
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDComplexTypeDefinitionCommand.java122
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java388
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDImportCommand.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDIncludeCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupCommand.java167
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupDefinitionCommand.java124
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDRedefineCommand.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSimpleTypeDefinitionCommand.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java200
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ChangeToLocalSimpleTypeCommand.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java221
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java214
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleRemoveExtensionNodeCommand.java94
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java36
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java36
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionNodeCommand.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetMultiplicityCommand.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetTypeCommand.java116
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceCommand.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateContentModelCommand.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java59
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceCommand.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNameCommand.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java298
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNumericBoundsFacetCommand.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateStringLengthFacetCommand.java230
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTextValueCommand.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceCommand.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDPatternFacetCommand.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDWhiteSpaceFacetCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/providers/XSDSectionLabelProvider.java172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java615
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java396
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java166
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java392
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/ExtensionsSection.java294
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java559
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java105
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java147
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java727
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java148
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java250
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java908
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java295
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java257
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java410
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java453
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java647
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java129
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java1021
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java264
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java360
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupSection.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java208
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java319
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java121
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java655
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddExtensionsComponentDialog.java785
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java370
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/CategoryProvider.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java211
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItem.java226
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java127
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java336
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java32
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemFilter.java28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionsSchemasRegistry.java330
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SpecificationForExtensionsSchema.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/XSDExtensionTreeContentProvider.java119
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeFilter.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java140
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java622
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java815
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java169
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties123
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java15
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java82
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java82
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java162
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java160
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties55
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java519
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java174
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java419
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java106
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java296
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java220
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java146
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java257
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties55
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java51
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java146
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java99
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java30
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java20
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java46
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/.classpath6
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/.project22
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf2
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties5
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/about.html34
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/build.properties6
-rw-r--r--bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml17
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/.project22
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf2
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties5
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/about.html34
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/build.properties5
-rw-r--r--bundles/org.eclipse.wtp.web.capabilities/plugin.xml52
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/.project22
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf2
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties5
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/about.html34
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/build.properties5
-rw-r--r--bundles/org.eclipse.wtp.xml.capabilities/plugin.xml55
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.cvsignore1
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.project22
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml74
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts2.xml83
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/JspWizContexts.xml19
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/about.html34
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/build.properties13
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties7
-rw-r--r--docs/org.eclipse.jst.jsp.ui.infopop/plugin.xml27
-rw-r--r--docs/org.eclipse.wst.doc.user/.cvsignore2
-rw-r--r--docs/org.eclipse.wst.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--docs/org.eclipse.wst.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.doc.user/book.css203
-rw-r--r--docs/org.eclipse.wst.doc.user/build.properties13
-rw-r--r--docs/org.eclipse.wst.doc.user/common.css1197
-rw-r--r--docs/org.eclipse.wst.doc.user/commonltr.css1306
-rw-r--r--docs/org.eclipse.wst.doc.user/commonrtl.css113
-rw-r--r--docs/org.eclipse.wst.doc.user/images/SelectExistingServer.jpgbin43906 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/SelectNewServer.jpgbin43236 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure1.jpgbin39687 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure2.jpgbin14815 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure3.jpgbin9277 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure4.jpgbin21628 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure5.jpgbin18294 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/image99L.jpgbin73786 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/imageEJ9.jpgbin50725 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/imageIAI.jpgbin53806 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/imageLKF.jpgbin72286 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/imageO78.jpgbin71949 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/imageU71.jpgbin47607 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/note.gifbin1014 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/selectRootElementDTD.pngbin14811 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/selectRootElementXSD.pngbin16425 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdl.gifbin563 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdl_main.gifbin158 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-backbutton.jpgbin436 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-binding.jpgbin22242 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-complex-type.jpgbin6899 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-finished-wsdl.jpgbin62972 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-new-operation.jpgbin7490 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-new-skeleton.jpgbin44414 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-new-wizard.jpgbin25784 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-setelement-dialog.jpgbin25350 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-settype-dialog.jpgbin22932 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/wsdleditor-smart-rename1.jpgbin17781 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-backbutton.jpgbin504 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure1.jpgbin80337 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure2.jpgbin25177 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure3.jpgbin14100 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure4.jpgbin4911 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure5.jpgbin24458 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure6.jpgbin15499 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure7.jpgbin17880 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure8.jpgbin12423 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/images/xsdeditor-figure9.jpgbin43743 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.doc.user/notices.html17
-rw-r--r--docs/org.eclipse.wst.doc.user/plugin.properties13
-rw-r--r--docs/org.eclipse.wst.doc.user/plugin.xml10
-rw-r--r--docs/org.eclipse.wst.doc.user/reference_toc.xml26
-rw-r--r--docs/org.eclipse.wst.doc.user/toc.xml49
-rw-r--r--docs/org.eclipse.wst.doc.user/topics/limitations.html57
-rw-r--r--docs/org.eclipse.wst.doc.user/topics/overview.html25
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.project22
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml80
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml25
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/about.html34
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/build.properties7
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties13
-rw-r--r--docs/org.eclipse.wst.dtd.ui.infopop/plugin.xml25
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.cvsignore3
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap32
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml26
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.ditamap23
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml12
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml66
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/build.properties14
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/dita.list12
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Comment.gifbin196 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Element.gifbin353 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity.gifbin124 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity_Reference.gifbin318 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Notation.gifbin177 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDChoice.gifbin145 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDSequence.gifbin91 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute.gifbin167 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute_list.gifbin247 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/nDTDFile.gifbin135 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/nany.gifbin136 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/nempty.gifbin121 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/organize_dtd_logically.gifbin347 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/images/sort.gifbin162 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfsbin14175 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/deletablebin4 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions3
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies4
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs11
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/index/segmentsbin27 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml24
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.user.maplist9
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml48
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties4
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml24
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita33
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html61
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.dita10
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html50
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita88
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html146
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita48
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html94
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita45
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html87
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita46
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html82
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita47
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html82
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita33
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html68
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita44
-rw-r--r--docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html66
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.project22
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts.xml95
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts2.xml23
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/HTMLWizContexts.xml21
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/about.html34
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/build.properties7
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/plugin.properties3
-rw-r--r--docs/org.eclipse.wst.html.ui.infopop/plugin.xml26
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.cvsignore4
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/DocBuild.xml64
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/build.properties15
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/ncontass.gifbin19680 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/njscdast.gifbin19047 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/nlinux.gifbin174 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/nmacscrp.gifbin1112 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/nquest.gifbin873 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/images/nwin.gifbin221 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/_p.cfsbin39759 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/deletablebin4 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions3
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies4
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/indexed_docs24
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/index/segmentsbin27 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/myplugin.xml30
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.user.maplist7
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.html242
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml165
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/plugin.properties3
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/plugin.xml30
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap57
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/sse_toc.xml35
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/cencoding.dita31
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html56
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.dita57
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html89
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita136
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html191
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita115
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html148
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita48
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html77
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.dita32
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html58
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.dita52
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html82
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita61
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html91
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita70
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html99
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.dita44
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html72
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.dita51
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html79
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.dita53
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html96
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita81
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html123
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.dita47
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html70
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.dita56
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html84
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.dita63
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html96
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.dita74
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html108
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita100
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html153
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.dita44
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html70
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.dita40
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html63
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita71
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html108
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita71
-rw-r--r--docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html108
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.project22
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml85
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml30
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/about.html34
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/build.properties7
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/plugin.properties3
-rw-r--r--docs/org.eclipse.wst.sse.ui.infopop/plugin.xml22
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/.cvsignore3
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml66
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/build.properties14
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/fixit.gifbin887 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/grptype.gifbin1032 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/menubutton.gifbin88 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nlinux.gifbin174 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nshowerr.gifbin167 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwarning.gifbin152 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwin.gifbin221 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkbrk.gifbin878 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkcss.gifbin924 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr-l.gifbin1017 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr.gifbin1017 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkind.gifbin927 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkmal.gifbin888 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnknum.gifbin882 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkotr.gifbin883 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnkque.gifbin871 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/nwlnktsk.gifbin895 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/skipit.gifbin874 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/images/viewlink.gifbin935 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/_10.cfsbin58078 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/deletablebin4 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions3
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies4
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs34
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/index/segmentsbin28 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/myplugin.xml24
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.user.maplist8
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml219
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/plugin.properties13
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/plugin.xml24
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap482
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml5
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.dita63
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html110
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita140
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html186
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita56
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html82
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.dita27
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html55
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita46
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html76
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita16
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html39
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.dita20
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html46
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita28
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html62
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.dita23
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html49
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita41
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html84
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita33
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html72
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita48
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html86
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita40
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html99
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita31
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html66
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita52
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html79
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.dita38
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html60
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.dita47
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html75
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.dita42
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html81
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.dita28
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html53
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita62
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html102
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita21
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html46
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.dita42
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html73
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita59
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html108
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita43
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html85
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.dita33
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html61
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.dita37
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html60
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita73
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html123
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita42
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html71
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita40
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html93
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.dita30
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html57
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita34
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html56
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita124
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html183
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita51
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html93
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap64
-rw-r--r--docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml49
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.project22
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml193
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml23
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml24
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml127
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml122
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml50
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/about.html34
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/build.properties12
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/plugin.properties13
-rw-r--r--docs/org.eclipse.wst.xml.ui.infopop/plugin.xml26
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.cvsignore5
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml66
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap85
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml73
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.ditamap136
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.xml55
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/build.properties15
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/cdatasection.gifbin359 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/collapse_all.gifbin155 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/comment_obj.gifbin196 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/doctype.gifbin594 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/expand_all.gifbin164 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/nattrib.gifbin167 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/nelem.gifbin159 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/nrstrval.gifbin155 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/proinst_obj.gifbin138 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/rldgrmr.gifbin368 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/images/suggestion.gifbin9962 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfsbin56242 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/deletablebin4 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions3
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies4
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs31
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/index/segmentsbin27 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml32
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist8
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml159
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties13
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml32
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.dita19
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html41
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html45
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkxml.dita22
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita55
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html115
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.dita119
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html195
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita134
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html273
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.dita38
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.html50
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.dita25
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html50
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.dita19
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html43
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.dita58
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html99
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita45
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html76
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita131
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html220
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.dita43
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html85
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita61
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html109
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita85
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html143
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.dita64
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html115
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita46
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html89
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.dita40
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html64
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.dita34
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html72
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.dita33
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html63
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita61
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html107
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.dita36
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html67
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.dita47
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html80
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita57
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html93
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita60
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html96
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.dita47
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html76
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita140
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html215
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.dita73
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html131
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.dita47
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html90
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita181
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html298
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.dita63
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html95
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.dita51
-rw-r--r--docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html82
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.cvsignore4
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.project22
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.pde.prefs15
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml66
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF7
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.ditamap158
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.xml68
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap83
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.xml68
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/about.html34
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/build.properties15
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/Browse.gifbin90 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/More.gifbin90 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAll.gifbin116 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAny.gifbin613 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAnyAttribute.gifbin384 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttribute.gifbin167 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroup.gifbin215 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroupRef.gifbin327 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeRef.gifbin350 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDChoice.gifbin130 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDComplexType.gifbin345 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElement.gifbin351 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElementRef.gifbin585 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalAttribute.gifbin167 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalElement.gifbin351 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroup.gifbin327 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroupRef.gifbin331 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDImport.gifbin114 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDInclude.gifbin324 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDRedefine.gifbin373 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSequence.gifbin120 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleEnum.gifbin105 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimplePattern.gifbin120 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleType.gifbin149 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfsbin55873 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/deletablebin4 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions3
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies4
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs30
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/index/segmentsbin27 -> 0 bytes
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml31
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.user.maplist9
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.html168
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml166
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties5
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml31
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.dita29
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html58
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita57
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html109
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.dita20
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html43
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita200
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html276
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita46
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html88
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.dita140
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html209
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita106
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html153
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita84
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html124
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita87
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html139
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita76
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html111
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita74
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html120
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita58
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html98
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita55
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html89
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita79
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html129
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita40
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html70
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita42
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html78
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita77
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html130
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita85
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html138
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.dita51
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.html52
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita75
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html127
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita58
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html99
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita125
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html183
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita33
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html69
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita32
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html63
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita46
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html73
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita58
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html91
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita52
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html102
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita41
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html82
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita98
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html168
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita63
-rw-r--r--docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html94
-rw-r--r--features/org.eclipse.wst.web_core.feature/.cvsignore2
-rw-r--r--features/org.eclipse.wst.web_core.feature/.project17
-rw-r--r--features/org.eclipse.wst.web_core.feature/build.properties3
-rw-r--r--features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_core.feature/feature.properties48
-rw-r--r--features/org.eclipse.wst.web_core.feature/feature.xml59
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.html27
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.ini31
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.properties26
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/build.properties2
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/plugin.properties12
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties14
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html27
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties2
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties12
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/.cvsignore4
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/.project17
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/build.properties6
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/feature.properties48
-rw-r--r--features/org.eclipse.wst.web_sdk.feature/feature.xml42
-rw-r--r--features/org.eclipse.wst.web_ui.feature/.cvsignore1
-rw-r--r--features/org.eclipse.wst.web_ui.feature/.project17
-rw-r--r--features/org.eclipse.wst.web_ui.feature/build.properties3
-rw-r--r--features/org.eclipse.wst.web_ui.feature/feature.properties48
-rw-r--r--features/org.eclipse.wst.web_ui.feature/feature.xml96
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.html27
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.ini31
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.properties26
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/build.properties3
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/plugin.properties12
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties17
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties49
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html27
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties3
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties12
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/.cvsignore3
-rw-r--r--features/org.eclipse.wst.xml_core.feature/.project17
-rw-r--r--features/org.eclipse.wst.xml_core.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--features/org.eclipse.wst.xml_core.feature/build.properties4
-rw-r--r--features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/feature.properties36
-rw-r--r--features/org.eclipse.wst.xml_core.feature/feature.xml85
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html27
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini31
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties26
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties2
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties12
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties14
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties37
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html27
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties2
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties12
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/.cvsignore4
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/.project17
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/build.properties4
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/feature.properties36
-rw-r--r--features/org.eclipse.wst.xml_sdk.feature/feature.xml34
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/.cvsignore1
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/.project17
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/build.properties3
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/feature.properties39
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/feature.xml88
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html27
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini31
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties26
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties3
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties12
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties16
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties37
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html27
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties3
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties12
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.gifbin1752 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.pngbin2672 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/.cvsignore1
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/.project17
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/build.properties3
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/feature.properties36
-rw-r--r--features/org.eclipse.wst.xml_userdoc.feature/feature.xml50
4503 files changed, 0 insertions, 651486 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 e13d33b9b1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,67 +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.602.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.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
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0]",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.2.401,1.3.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.jdt.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jdt.debug;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.core.filesystem;bundle-version="[1.3.0,2.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 a5bbc9e504..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/build.properties
+++ /dev/null
@@ -1,21 +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/**
-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/elcl16/javaassist_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif
deleted file mode 100644
index e9a6bd966a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.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 26b2626fe6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ /dev/null
@@ -1,122 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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 Web Tools Platform
-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_Content_Assist.name=Content Assist
-JSP_Templates.name=Templates
-JSP_Styles.name=Styles
-JSP_Syntax_Coloring=Syntax Coloring
-JSP_Source_target_name=JSP Editors
-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
-JSP_Property_tag_contentSettings=Tag Content
-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_Field_Rename_Participant_Extension_Element.name=JSP Field 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 File
-_UI_WIZARD_CREATE_NEW_FILE = Create a new JSP file
-_UI_WIZARD_TAG_NAME = JSP Tag
-_UI_WIZARD_TAG_CREATE_NEW_FILE = Create a new JSP 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.contentassist=jsp editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
-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
-
-##
-Java_Element_hyperlink=Java Element
-Taglib_hyperlink=Tag Library Descriptor
-
-##
-proposalCategory.jspTemplates=JSP Template Proposals
-proposalCategory.jsp=JSP Proposals
-proposalCategory.jspJava=JSP Java Proposals
-
-##
-HideImportDeclaration.label=Import Directives
-HideImportDeclaration.description=Hides Import Directives
-HideComments.label=Comments
-HideComments.description=Hides Comments
-
-classPatternProvider.name = Class Pattern Provider \ No newline at end of file
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 2244e3c6d0..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ /dev/null
@@ -1,1457 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="classPatternProvider" name="%classPatternProvider.name" schema="schema/classPatternProvider.exsd"/>
-
- <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" />
- <quickOutlineConfiguration
- class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
- 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="foldingstrategy"
- class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
- 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, org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
- 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.selection, org.eclipse.wst.sse.comments"
- target="org.eclipse.jst.jsp.core.jspsource" />
-
- <contentOutlineConfiguration
- class="org.eclipse.jst.jsp.ui.internal.views.contentoutline.TLDContentOutlineConfiguration"
- target="org.eclipse.jst.jsp.core.tldsource" />
- <documentationTextHover
- class="org.eclipse.jst.jsp.ui.internal.taginfo.XMLJavadocHoverProcessor"
- target="org.eclipse.wst.xml.XML_DEFAULT"/>
- </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>
- </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="total"
- class="org.eclipse.jst.jsp.ui.internal.validation.JSPActionSourceValidator"
- id="org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <!--======================================================================================-->
- <!-- 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_DECLARATION"/>
- <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>
-
- <!-- for .tagx files -->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- id="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML">
- <contentTypeIdentifier id="org.eclipse.jst.jsp.core.tagxsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
- <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
- category="org.eclipse.wst.sse.ui.preferences.jsp.source"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPContentAssistPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
- name="%JSP_Content_Assist.name">
- <keywordReference
- id="org.eclipse.jst.jsp.ui.contentassist">
- </keywordReference>
- </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.contentassist"
- id="org.eclipse.jst.jsp.ui.contentassist"/>
- <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>
- <renameParticipant
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPFieldRenameParticipant"
- id="org.eclipse.jst.jsp.ui.java.refactoring.JSFieldRenameParticipant"
- name="%JSP_Field_Rename_Participant_Extension_Element.name">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.jdt.core.javanature">
- </equals>
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IField">
- </instanceof>
- </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>
-
- <extension point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension targetID="org.eclipse.wst.web.ui.webDevPerspective">
- <newWizardShortcut id="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"/>
- </perspectiveExtension>
- </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>
- <page
- name="%JSP_Property_tag_contentSettings"
- class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.TagContentSettingsPropertyPage"
- id="org.eclipse.jst.jsp.ui.propertyPage.project.tag.content.settings"
- category="org.eclipse.ui.propertypages.info.file">
- <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.tagsource" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- </page>
- </extension>
- <!-- jsp-for-css editor configurations -->
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <propertySheetConfiguration
- class="org.eclipse.jst.jsp.css.ui.internal.views.properties.JSPedCSSPropertySheetConfiguration"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <provisionalConfiguration
- type="foldingstrategy"
- class="org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy"
- 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="%Java_Element_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>
- <hyperlinkDetector
- class="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
- id="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
- name="%Java_Element_hyperlink"
- targetId="org.eclipse.core.runtime.xml">
- </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>
- <menuContribution
- locationURI="popup:refactorPopupMenuId">
- <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.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.jsp.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource"
- partitions="org.eclipse.jst.jsp.JSP_DIRECTIVE,org.eclipse.wst.html.HTML_DEFAULT,org.eclipse.wst.html.HTML_DECLARATION">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.jst.jsp.ui.internal.text.JavaCharacterPairInserter" id="org.eclipse.wst.jsp.java.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource"
- partitions="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.jst.jsp.css.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource"
- partitions="org.eclipse.wst.css.STYLE">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.commentingStrategy">
- <blockCommentingStrategy
- prefix="&lt;!--"
- suffix="--&gt;">
- <contentType
- associatedCommentPartitionTypeID="org.eclipse.wst.html.HTML_COMMENT"
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.HTML_DECLARATION">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.xml.XML_PI">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- <blockCommentingStrategy
- prefix="&lt;%--"
- suffix="--%&gt;">
- <contentType
- associatedCommentPartitionTypeID="org.eclipse.jst.jsp.JSP_COMMENT"
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.DELIMITER">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JSP_EL">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="true">
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- <blockCommentingStrategy
- prefix="/*"
- suffix="*/">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- <lineCommentingStrategy
- prefix="//">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- </lineCommentingStrategy>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalCategory
- icon="icons/full/obj16/tag-template.gif"
- id="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
- name="%proposalCategory.jspTemplates">
- </proposalCategory>
- <proposalCategory
- icon="icons/full/obj16/tag-jsp.gif"
- id="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- name="%proposalCategory.jsp">
- </proposalCategory>
- <proposalCategory
- icon="icons/full/elcl16/javaassist_co.gif"
- id="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
- name="%proposalCategory.jspJava">
- </proposalCategory>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.HTML_COMMENT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.sse.ST_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_COMMENT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.HTML_COMMENT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.sse.ST_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_COMMENT">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.xml.ui.proposalComputer.xmlTags">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.xml.XML_DEFAULT">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.xml.XML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTemplatesCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspTemplates">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jsp">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.LibraryTagsCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.libraryTags">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.HTML_COMMENT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.sse.ST_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_COMMENT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspJava">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.xml.XML_CDATA">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.DELIMITER">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPELCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspEL">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JSP_EL">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPImportCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspImport">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPPropertyCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspProperty">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPUseBeanCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspUseBean">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
- class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTaglibCompletionProposalComputer"
- id="org.eclipse.jst.jsp.ui.proposalComputer.jspTaglib">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- </proposalComputer>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.css.ui.proposalComputer.css">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
- <categoriesConfiguration
- class="org.eclipse.jst.jsp.ui.internal.preferences.JSPCompletionProposalCategoriesConfiguration"
- contentTypeID="org.eclipse.jst.jsp.core.jspsource">
- </categoriesConfiguration>
- </extension>
-<extension
- point="org.eclipse.wst.sse.ui.outlineFilters">
- <filter
- targetId="org.eclipse.jst.jsp.ui.OutlinePage"
- name="%HideImportDeclaration.label"
- enabled="false"
- description="%HideImportDeclaration.description"
- class="org.eclipse.jst.jsp.ui.views.contentoutline.JSPImportDirectiveFilter"
- id="org.eclipse.jst.jsp.ui.views.contentoutline.JSPImportDirectiveFilter">
- </filter>
- <filter
- targetId="org.eclipse.jst.jsp.ui.OutlinePage"
- name="%HideComments.label"
- enabled="false"
- description="%HideComments.description"
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLCommentFilter"
- id="org.eclipse.jst.jsp.ui.views.contentoutline.XMLCommentFilter">
- </filter>
-</extension>
-</plugin>
diff --git a/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd b/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd
deleted file mode 100644
index 92e6106b49..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsp.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsp.ui" id="classPatternProvider" name="Class Pattern Provider"/>
- </appInfo>
- <documentation>
- Provides a way for adding additional class patterns to the JavaStratumBreakpointProvider
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element internal="true" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="classPatternProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="classPatternProvider">
- <complexType>
- <attribute name="contentType" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pattern" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
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 e739cd6954..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.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.autoedit.StructuredAutoEditStrategyJSPJava;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPStructuredContentAssistProcessor;
-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.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.Attr;
-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);
-
- // add the scritplet autoedit strategy first
- allStrategies.add(new StructuredAutoEditStrategyJSPJava());
-
- 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;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
- * org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- protected IContentAssistProcessor[] getContentAssistProcessors(
- ISourceViewer sourceViewer, String partitionType) {
-
- IContentAssistProcessor processor = new JSPStructuredContentAssistProcessor(
- this.getContentAssistant(), partitionType, sourceViewer);
- return new IContentAssistProcessor[]{processor};
- }
-
- 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 || partitionType == ICSSPartitions.COMMENT) {
- 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;
-
- StringBuffer s = new StringBuffer();
- Node node = (Node) element;
- while (node != null) {
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, super.getText(node));
- }
-
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- node = ((Attr) node).getOwnerElement();
- else
- 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 fb6aadd975..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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 - 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 BasicRefactorSearchRequestor_7;
- 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 NewJSPTemplatesWizardPage_7;
- 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 NewTagTemplatesWizardPage_7;
- 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 TagPropertyPage_desc;
- 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 JSPTyping_Complete_Comments;
- public static String JSPTyping_Java_Code;
- public static String JSPTyping_Close_Strings;
- public static String JSPTyping_Close_Brackets;
- 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_EL_FUNCTION_UNDEFINED;
-
- 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_UNEXPECTED_RTEXPRVALUE;
- 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;
-
- public static String Open;
- public static String TLDHyperlink_hyperlinkText;
- public static String CustomTagHyperlink_hyperlinkText;
- public static String TLDContentOutlineConfiguration_0;
-
- public static String JSPFilesPreferencePage_Search_group;
- public static String JSPFilesPreferencePage_Supply_JSP_search_to_Java_search;
-
- public static String JSPCodeAssist_Insertion;
- public static String JSPCodeAssist_Auto_Import;
- public static String Cycling_UI;
-}
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 3bf8c93a2a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ /dev/null
@@ -1,176 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-## 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
-BasicRefactorSearchRequestor_7=Rename Field ''{0}'' to ''{1}''
-#
-_UI_WIZARD_NEW_TITLE = New JSP File
-_UI_WIZARD_NEW_HEADING = JSP
-_UI_WIZARD_NEW_DESCRIPTION = Create a new JSP file.
-_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.
-NewJSPTemplatesWizardPage_7=&Templates:
-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.
-NewTagTemplatesWizardPage_7=&Templates:
-# 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=S&yntax 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
-JSPTyping_Complete_Comments=&JSP comments
-JSPTyping_Java_Code=Java
-JSPTyping_Close_Strings=Automatically close "s&trings"
-JSPTyping_Close_Brackets=Automatically close (parentheses), [square] and <angle> brac&kets
-# 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>Errors/Warnings</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_EL_FUNCTION_UNDEFINED=Function is undefined:
-
-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_UNEXPECTED_RTEXPRVALUE=Attribute does not support runtime expressions:
-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:
-
-Open=Open ''{0}''
-TLDHyperlink_hyperlinkText=Open Descriptor
-CustomTagHyperlink_hyperlinkText=Open Declaration
-TLDContentOutlineConfiguration_0=Show Content Values
-TagPropertyPage_desc=Specify the surrounding language used in this tag file:
-
-JSPFilesPreferencePage_Search_group=Search
-JSPFilesPreferencePage_Supply_JSP_search_to_Java_search=&Include JSP matches in Java searches
-
-JSPCodeAssist_Insertion=Insertion
-JSPCodeAssist_Auto_Import=Add import instead of &qualified name
-Cycling_UI=Cycling \ No newline at end of file
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/actions/JSPNodeActionManager.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
deleted file mode 100644
index e4a48ac4d2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
+++ /dev/null
@@ -1,47 +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.actions;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-public class JSPNodeActionManager extends HTMLNodeActionManager {
-
- public JSPNodeActionManager(IStructuredModel model, Viewer viewer) {
- super(model, viewer);
- }
-
- protected boolean canContributeChildActions(Node node){
- String nodeName = node.getNodeName().toLowerCase();
- return !(nodeName.equals(JSP11Namespace.ElementName.SCRIPTLET) || nodeName.equals(JSP11Namespace.ElementName.DECLARATION) || nodeName.equals(JSP11Namespace.ElementName.EXPRESSION));
- }
-
- protected void updateCase() {
- if (fModel != null) {
- String modelContentTypeId = fModel.getContentTypeIdentifier();
- if (modelContentTypeId != null) {
- if (modelContentTypeId.equals(ContentTypeIdForJSP.ContentTypeID_JSP)) {
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
- fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- }
- }
- }
- }
-
-}
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 b748a2a1ff..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-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.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-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) {
- smartInsertForEndTag(command, document, model);
- smartRemoveEndTag(command, document, model);
- if (command.text.equals("%") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS)) { //$NON-NLS-1$
- // scriptlet - add end %>
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if (node != null && 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 (node != null && (prefixedWith(document, command.offset, "$") || prefixedWith(document, command.offset, "#")) && //$NON-NLS-1$ //$NON-NLS-2$
- !node.getSource().endsWith("}")) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " }"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 1;
- command.doit = false;
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- 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;
- }
- }
-
- private boolean isCommentNode(IDOMNode node) {
- return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
- }
-
- private boolean isDocumentNode(IDOMNode node) {
- return ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE));
- }
-
- private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("/") && (document.getLength() >= 1) && document.get(command.offset - 1, 1).equals("<") && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
- if (isCommentNode(parentNode)) {
- // loop and find non comment node parent
- while ((parentNode != null) && isCommentNode(parentNode)) {
- parentNode = (IDOMNode) parentNode.getParentNode();
- }
- }
-
- if (!isDocumentNode(parentNode)) {
- // only add end tag if one does not already exist or if
- // add '/' does not create one already
- IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
- IDOMNode ancestor = parentNode;
- boolean smartInsertForEnd = false;
- if(endTagStructuredDocumentRegion != null) {
- // Look for ancestors by the same name that are missing end tags
- while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
- if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
- smartInsertForEnd = true;
- break;
- }
- }
- }
- if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
- StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
- if (toAdd.length() > 0) {
- toAdd.append(">"); //$NON-NLS-1$
- String suffix = toAdd.toString();
- if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
- command.text += suffix;
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * Attempts to clean up an end-tag if a start-tag is converted into an empty-element
- * tag (e.g., <node />) and the original element was empty.
- *
- * @param command the document command describing the change
- * @param document the document that will be changed
- * @param model the model based on the document
- */
- private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- // An opening tag is now a self-terminated end-tag
- if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if (node != null && !node.hasChildNodes()) {
- IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
- if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
-
- /* if the region before the command offset is a an attribute value region
- * check to see if it has both and opening and closing quote
- */
- ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
- boolean inUnclosedAttValueRegion = false;
- if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- //get the text of the attribute value region
- String prevText = region.getText(prevTextRegion);
- inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
- (prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
- }
-
- //if command offset is in an unclosed attribute value region then done remove the end tag
- if(!inUnclosedAttValueRegion) {
- region = node.getEndStructuredDocumentRegion();
- if (region != null && region.isEnded()) {
- document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
deleted file mode 100644
index 72ef7d158a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.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.core.internal.provisional.JSP11Namespace;
-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.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-public class StructuredAutoEditStrategyJSPJava 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 {
- // Auto edit for JSP Comments
- if ("-".equals(command.text) && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$
- if (prefixedWith(document, command.offset, "<%-")) { //$NON-NLS-1$
-
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- IDOMNode parent = (node != null) ? (IDOMNode) node.getParentNode() : null;
- // Parent is the scriptlet tag
- if (parent != null && JSP11Namespace.ElementName.SCRIPTLET.equals(parent.getNodeName()) && !parent.getSource().endsWith("--%>")) { //$NON-NLS-1$
- IStructuredDocumentRegion end = parent.getEndStructuredDocumentRegion();
- if (end != null) {
- try {
- document.replace(end.getStartOffset(), 0, "--"); //$NON-NLS-1$
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- }
- }
- }
- }
- }
- 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/ClassPatternRegistry.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/ClassPatternRegistry.java
deleted file mode 100644
index 2c53099771..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/ClassPatternRegistry.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.RegistryFactory;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * This registry provides all additional class patterns to be associated with a specific content type
- *
- */
-public class ClassPatternRegistry {
-
- private static ClassPatternRegistry fInstance = null;
-
- private Map fPatterns = null;
-
- private ClassPatternRegistry() {
- IExtensionRegistry registry = RegistryFactory.getRegistry();
- if (registry != null) {
- IConfigurationElement[] elements = RegistryFactory.getRegistry().getConfigurationElementsFor(JSPUIPlugin.ID, "classPatternProvider"); //$NON-NLS-1$
- fPatterns = new HashMap(elements.length);
- for (int i = 0; i < elements.length; i++) {
- final IConfigurationElement element = elements[i];
- final String contentType = element.getAttribute("contentType"); //$NON-NLS-1$
- final String pattern = element.getAttribute("pattern"); //$NON-NLS-1$
- if (pattern != null && contentType != null) {
- final StringTokenizer tokenizer = new StringTokenizer(pattern, ","); //$NON-NLS-1$
- Set patterns = (Set) fPatterns.get(contentType);
- if (patterns == null) {
- patterns = new HashSet(0);
- fPatterns.put(contentType, patterns);
- }
-
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- token = token.trim();
- if (token.length() > 0) {
- patterns.add(token);
- }
- }
- }
-
- }
- }
- }
-
- /**
- * Returns the additional class patterns to be associated with the provided content type id.
- * @param contentType the content type id to find patterns for
- * @return an String for the additional class patterns
- */
- public String getClassPattern(String contentType) {
- if (fPatterns == null)
- return null;
- final Set patterns = (Set) fPatterns.get(contentType);
- if (patterns != null) {
- final Iterator it = patterns.iterator();
- final StringBuffer buffer = new StringBuffer();
- while (it.hasNext()) {
- if (buffer.length() > 0)
- buffer.append(',');
- buffer.append(it.next());
- }
- return buffer.toString();
- }
- return null;
- }
-
- public Iterator getClassPatternSegments(String contentType) {
- Iterator result = EMPTY;
- if (fPatterns != null) {
- Set patterns = (Set) fPatterns.get(contentType);
- if (patterns != null)
- result = patterns.iterator();
- }
- return result;
- }
-
- private static final Iterator EMPTY = new Iterator() {
-
- /* (non-Javadoc)
- * @see java.util.Iterator#hasNext()
- */
- public boolean hasNext() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#next()
- */
- public Object next() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#remove()
- */
- public void remove() {}
-
- };
-
- public static synchronized ClassPatternRegistry getInstance() {
- if (fInstance == null) {
- fInstance = new ClassPatternRegistry();
- }
- return fInstance;
- }
-}
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 b97f332a76..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-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);
- final Set contributions = new HashSet(0);
- for (int i = 0; i < types.length; i++) {
- final String id = types[i].getId();
- Object pattern = ((Map) fData).get(id);
- if (pattern != null) {
- patternBuffer.append(","); //$NON-NLS-1$
- patternBuffer.append(pattern);
- }
- // Append contributions
-
- final Iterator it = ClassPatternRegistry.getInstance().getClassPatternSegments(id);
- while (it.hasNext()) {
- contributions.add(it.next());
- }
- }
- if (contributions.size() > 0) {
- final Iterator it = contributions.iterator();
- while (it.hasNext()) {
- patternBuffer.append(',');
- patternBuffer.append(it.next());
- }
- }
- 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 ||
- type == IJSPPartitions.JSP_DEFAULT_EL || type == IJSPPartitions.JSP_DEFAULT_EL2) {
- 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 07256dd759..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * 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.jdt.core.IImportContainer;
-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.contentmodel.tld.provisional.JSP20TLDNames;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-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.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AutoImportProposal extends JSPCompletionProposal {
-
- // the import string, no quotes or colons
- String fImportDeclaration;
- IImportContainer fImportContainer;
-
- 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 AutoImportProposal(String importDeclaration, IImportContainer importContainer ,String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
- this(importDeclaration, replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
- fImportContainer = importContainer;
- }
-
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- super.apply(viewer, trigger, stateMask, offset);
- // if the import doesn't exist, add it
- String importDecl = getImportDeclaration().replaceAll(";", ""); //$NON-NLS-1$//$NON-NLS-2$
- if (fImportContainer == null || !(fImportContainer.getImport(importDecl).exists() || isImportPageDirective(viewer, offset)))
- addImportDeclaration(viewer);
- }
-
- private boolean isImportPageDirective(ITextViewer viewer, int offset){
- Node node = (Node) ContentAssistUtils.getNodeAt(viewer, offset);
-
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- if (node.getNodeName().equalsIgnoreCase(JSP11Namespace.ElementName.DIRECTIVE_PAGE)){
- NamedNodeMap nodeMap = node.getAttributes();
- if (nodeMap != null)
- return nodeMap.getNamedItem(JSP20TLDNames.IMPORT) != null;
- }
-
- return false ;
- }
- /**
- * 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());
- }
-
- private Node getInsertNode(IDOMDocument documentNode) {
- NodeList childNodes = documentNode.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- if (childNodes.item(i).getNodeType() == Node.ELEMENT_NODE)
- return childNodes.item(i);
- }
- return documentNode.getFirstChild();
- }
-
- /**
- *
- * @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();
- /*
- * document element must be sole Element child of Document
- * to remain valid
- */
- Node targetElement = null;
- if (isXml) {
- targetElement = documentNode.getDocumentElement();
- }
- if (targetElement == null)
- targetElement = getInsertNode(documentNode);
- if (targetElement != null) {
- IStructuredDocumentRegion sdRegion = ((IDOMNode) targetElement).getFirstStructuredDocumentRegion();
- if (isXml) {
- /*
- * document Element must be sole Element child of
- * Document to remain valid, so insert after
- */
- pos = sdRegion.getEndOffset();
- try {
- while (pos < doc.getLength() && (doc.getChar(pos) == '\r' || doc.getChar(pos) == '\n')) {
- pos++;
- }
- }
- catch (BadLocationException e) {
- // not important, use pos as determined earlier
- }
- }
- else {
- // insert before target element
- pos = sdRegion.getStartOffset();
- }
- }
- else {
- pos = 0;
- }
- }
- }
- }
- 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 opening + getImportDeclaration() + closing + delim;
- }
-
- 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 eded388c5a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.jdt.core.WorkingCopyOwner;
-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
- * @deprecated This class is no longer used locally and will be removed in the future
- */
-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;
- // translation adapter may be stale, check the model id
- private String fModelId = 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) {
- return computeCompletionProposals(viewer, pos, 0);
- }
-
- /**
- * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
- * java position is offset by the given extra offset.
- *
- * @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
- * @param javaPositionExtraOffset
- * the extra offset for the java position
- * @return an array of completion proposals or <code>null</code> if no
- * proposals are possible
- */
- protected ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos, int javaPositionExtraOffset) {
- 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 || xmlModel.getId() != fModelId) {
- fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- fModelId = xmlModel.getId();
- }
- if (fTranslationAdapter != null) {
-
- JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
- fJavaPosition = translation.getJavaOffset(getDocumentPosition())+javaPositionExtraOffset;
-
- 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, (WorkingCopyOwner) 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 c4a60367b0..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ /dev/null
@@ -1,145 +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.IDocument;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
-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, ICompletionProposalExtension3, ICompletionProposalExtension5 {
-
- private static final char[] TRIGGERS = new char[] { '.', '[' };
- /*
- * 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) {
- if (trigger != (char) 0 ) {
- setReplacementString(getReplacementString() + trigger);
- setCursorPosition(getCursorPosition() + 1);
- }
- super.apply(viewer, trigger, stateMask, offset);
- //move the caret to the end of the change
- int endOffsetOfChanges = getReplacementString().length() + getReplacementOffset();
- viewer.getTextWidget().setCaretOffset(endOffsetOfChanges);
- }
-
- 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;
- }
-
- /**
- * use the java proposals image if there is one for this proposals image
- */
- public Image getImage() {
- if(this.fJavaCompletionProposal != null) {
- return this.fJavaCompletionProposal.getImage();
- } else {
- return super.getImage();
- }
- }
-
- /*
- * @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;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator()
- */
- public IInformationControlCreator getInformationControlCreator() {
- // [277530] Use the java proposal's information control creator
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- IInformationControlCreator informationControlCreator = null;
-
- if (javaProposal instanceof ICompletionProposalExtension3)
- informationControlCreator = ((ICompletionProposalExtension3) javaProposal).getInformationControlCreator();
-
- return informationControlCreator;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionStart(org.eclipse.jface.text.IDocument, int)
- */
- public int getPrefixCompletionStart(IDocument document, int completionOffset) {
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if (javaProposal instanceof ICompletionProposalExtension3)
- return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionStart(document, completionOffset);
-
- return getReplacementOffset();
- }
-
- public char[] getTriggerCharacters() {
- return TRIGGERS;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionText(org.eclipse.jface.text.IDocument, int)
- */
- public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if (javaProposal instanceof ICompletionProposalExtension3)
- return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionText(document, completionOffset);
-
- return getReplacementString();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
deleted file mode 100644
index 2d022bde2b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
+++ /dev/null
@@ -1,243 +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.contentassist;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-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.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-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.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
-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.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * <p>Computes JSP specific proposals</p>
- *
- * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor
- */
-public class JSPCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
- /**
- * <p>Create the computer</p>
- */
- public JSPCompletionProposalComputer() {
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(java.lang.String, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
- IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
-
- //be sure to get the super proposals
- ContentAssistRequest request = super.computeCompletionProposals(matchString, completionRegion, treeNode, xmlnode, context);
-
- //calculate JSP specific proposals
- int documentPosition = context.getInvocationOffset();
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(
- context.getViewer(), 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$
-
- ITextRegion prevTextRegion = null;
- try {
- int offset = sdRegion.getStartOffset(completionRegion);
- if(offset > 0) {
- offset--;
- }
- ITypedRegion prevRegion = context.getDocument().getPartition(offset);
- prevTextRegion = sdRegion.getRegionAtCharacterOffset(prevRegion.getOffset());
- } catch(BadLocationException e) {
- //this should never happen
- Logger.logException(e);
- }
-
- // suggest JSP Expression inside of XML comments
- if (completionRegion.getType() == DOMRegionContext.XML_COMMENT_TEXT && !isXMLFormat(doc)) {
- if (request == null) {
- request = new ContentAssistRequest(treeNode, xmlnode, sdRegion,
- completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- }
- request.addProposal(new CustomCompletionProposal("<%= %>",//$NON-NLS-1$
- documentPosition, 0, 4,
- JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
- "jsp:expression", null, "&lt;%= %&gt;", XMLRelevanceConstants.R_JSP)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /* handle proposals in and around JSP_DIRECTIVE_OPEN,
- * JSP_DIRECTIVE_CLOSE (preceded by 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)) ||
- (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
- prevTextRegion != null &&
- prevTextRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN &&
- documentPosition <= sdRegion.getTextEndOffset(completionRegion))) {
-
- if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN ||
- completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) {
-
- if (request == null) {
- request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
- completionRegion, documentPosition, 0, matchString);
- }
-
- //determine if there is any part of a directive name already existing
- 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$
- }
-
- /* Suggest the directive names that have been determined to be
- * appropriate based on existing content
- */
- 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_JSP),
- directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
- }
- }
- }
- // by default, JSP_DIRECTIVE_NAME
- else {
- if (request == null) {
- request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion),
- completionRegion.getTextLength(), matchString);
- }
- //add each of the directive names as a proposal
- 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_JSP),
- 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(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- }
- // no name?: <%@ %>
- else if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
- documentPosition <= sdRegion.getStartOffset(completionRegion)) {
- if (request != null) {
- request = computeAttributeProposals(matchString, completionRegion, treeNode,
- xmlnode, context);
- }
- 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_JSP),
- directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
- }
- }
- }
-
- return request;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- //nothing to suggest here
- }
-
- /**
- * @param doc determine if this doc is XML format
- * @return <code>true</code> if the given doc is of XML format, <code>false</code> otherwise.
- */
- private boolean isXMLFormat(Document doc) {
- if (doc == null)
- return false;
- Element docElement = doc.getDocumentElement();
- return docElement != null && ((docElement.getNodeName().equals("jsp:root")) || //$NON-NLS-1$
- ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
- ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))) ||
- declaresNameSpacesInRoot(docElement);
- }
-
- private boolean declaresNameSpacesInRoot(Element docElement) {
- if (docElement.hasAttribute("xmlns:jsp"))
- return true;
- NamedNodeMap attributes = docElement.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
- String prefix = attr.getPrefix();
- if (prefix != null && "xmlns".equals(prefix)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
deleted file mode 100644
index 1bbb4c4abe..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
+++ /dev/null
@@ -1,71 +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.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.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * <p>Helpful utility methods for JSP content assist</p>
- */
-public class JSPContentAssistHelper {
- /**
- * Returns project request is in
- *
- * @param request
- * @return {@link IResource} representing the project the given request was made in
- */
- public static 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/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
deleted file mode 100644
index 892f559087..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
+++ /dev/null
@@ -1,1149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.contentassist;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-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.ITextViewerExtension5;
-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.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.JSPCMDocument;
-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.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.modelquery.ModelQuery;
-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.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.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.XMLContentModelGenerator;
-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
- *
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see JSPStructuredContentAssistProcessor
- */
-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;
- }
-
- // on an empty value, add all the JSP and taglib tags
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- if (nameRegion != null && elementDecl != null) {
- String attributeName = open.getText(nameRegion);
- if (attributeName != null) {
- String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
-
- if(currentValue == null || currentValue.length() == 0) { //$NON-NLS-1$
- List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (i = 0; i < additionalElements.size(); i++) {
- Object additionalElement = additionalElements.get(i);
- if(additionalElement instanceof CMElementDeclaration) {
- CMElementDeclaration ed = (CMElementDeclaration) additionalElement;
-
- String tagname = getContentGenerator().getRequiredName(node, ed);
- StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
- getContentGenerator().generateTag(node, ed, contents);
- contents.append('"'); //$NON-NLS-1$
- 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$
- }
- }
-
-
- }
-
- /**
- * 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 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(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(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(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(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);
- }
-
- //merge the embedded results
- if (useEmbeddedResults && embeddedResults != null && embeddedResults.length > 0) {
- jspResults = merge(jspResults, embeddedResults);
- }
- 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;
- if (newReplacementLength >= 0)
- importProposal.setReplacementLength(newReplacementLength);
-
- int newCursorPosition = importProposal.getCursorPosition() - 1;
- importProposal.setCursorPosition(newCursorPosition);
-
- return importProposal;
- }
-
- /**
- * Adds 2 arrays of {@link ICompletionProposal}s to a {@link TreeSet}
- * eliminating duplicates and sorting with a {@link ProposalComparator}
- * then returning the new merged, filtered, sorted, array of {@link ICompletionProposal}s.
- *
- * @param proposalsOne
- * @param proposalsTwo
- * @return a new merged, filtered, sorted array of {@link ICompletionProposal}s created from
- * the two given arrays of {@link ICompletionProposal}s.
- */
- private ICompletionProposal[] merge(ICompletionProposal[] proposalsOne, ICompletionProposal[] proposalsTwo) {
- Set results = new TreeSet(new ProposalComparator());
-
- if (proposalsOne != null) {
- for (int i = 0; i < proposalsOne.length; i++)
- results.add(proposalsOne[i]);
- }
- if (proposalsTwo != null) {
- for (int i = 0; i < proposalsTwo.length; i++)
- results.add(proposalsTwo[i]);
- }
-
- 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(ITextViewer viewer, int documentPosition) {
- String partitionType = null;
- try {
- if (viewer instanceof ITextViewerExtension5)
- partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
- else
- partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, 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);
- //don't need to call super here because otherwise we duplicate what the HTMLCOntentAssistProcessor that is running is already doing
- }
-
- /**
- * Use the embedded content assist processor to determine the content generator
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor#getContentGenerator()
- */
- public XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- fGenerator = ((AbstractContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT)).getContentGenerator();
- }
- return fGenerator;
- }
-}
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 2b14ecee0d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.DefaultXMLCompletionProposalComputer;
-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
- *
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see DefaultXMLCompletionProposalComputer
- */
-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 fc32b3c2dc..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- */
-public class JSPELCompletionProcessor extends JSPCompletionProcessor {
- protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- return new JSPELProposalCollector(cu, translation);
- }
-
- /**
- * The java position offset needs to be shifted 3 for the "get" in the java
- * proposal mapped to a given JSP EL proposal
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
- //3 for the "get" at the beginning of the java proposal
- return computeCompletionProposals(viewer, pos, 3);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
deleted file mode 100644
index 709baa04c1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
+++ /dev/null
@@ -1,156 +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.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.text.ITextViewer;
-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.JSPTranslation;
-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.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.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-
-/**
- * <p>Compute JSP EL completion proposals</p>
- */
-public class JSPELCompletionProposalComputer extends
- JSPJavaCompletionProposalComputer {
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- ITextViewer viewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
-
- // get results from JSP completion processor
- //3 for the "get" at the beginning of the java proposal
- List results = new ArrayList(computeJavaCompletionProposals(viewer, documentPosition, 3));
-
- //get the function proposals for syntax like: ${ fn:| }
- IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
- if (flat != null) {
- ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
- String elText;
- int startOffset;
- //if container then need to get inner region
- //else can use flat region
- if (cursorRegion instanceof ITextRegionContainer) {
- ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
- cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
- elText = container.getText(cursorRegion);
- startOffset = container.getStartOffset(cursorRegion);
- } else {
- elText = flat.getText(cursorRegion);
- startOffset = flat.getStartOffset(cursorRegion);
- }
-
- //sanity check that we are actually in EL region
- if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
- String prefix = getPrefix(documentPosition - startOffset, elText);
- if (null != prefix) {
- List proposals = getFunctionProposals(prefix, viewer, documentPosition);
- results.addAll(proposals);
- }
- }
- }
-
- return results;
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#getProposalCollector(
- * org.eclipse.jdt.core.ICompilationUnit, org.eclipse.jst.jsp.core.internal.java.JSPTranslation)
- */
- protected JSPProposalCollector getProposalCollector(ICompilationUnit cu,
- JSPTranslation translation) {
-
- return new JSPELProposalCollector(cu, translation);
- }
-
- /**
- * <p>Gets the EL prefix from the relative position and the given EL text</p>
- *
- * @param relativePosition
- * @param elText
- * @return
- */
- private 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;
- }
-
- /**
- * <p>Get the EL function proposals, ex: ${fn:| }</p>
- * @param prefix
- * @param viewer
- * @param offset
- * @return
- */
- private List getFunctionProposals(String prefix, ITextViewer 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/JSPELContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
deleted file mode 100644
index dbc6c5527d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- */
-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 5c7a0398b1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ /dev/null
@@ -1,93 +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.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();
-
- // replacement length
- //-3 for "get" pre text on the java proposal
- int length = proposal.getReplaceEnd() - offset - 3;
-
- // 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/JSPImportCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
deleted file mode 100644
index c0bfb7f2b2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
+++ /dev/null
@@ -1,78 +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.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-
-/**
- * <p>Generates JSP import completion proposals</p>
- */
-public class JSPImportCompletionProposalComputer extends
- JSPJavaCompletionProposalComputer {
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- List proposals = computeJavaCompletionProposals(context.getViewer(), context.getInvocationOffset(), 0);
- List importProposals = new ArrayList(proposals.size());
- for (int i = 0; i < proposals.size(); i++) {
- if (proposals.get(i) instanceof JSPCompletionProposal) {
-
- ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals.get(i));
- importProposals.add(importProposal);
- }
- }
- return importProposals;
-
- }
-
- /**
- * <p>JSP import proposals need to be adjusted, this does that</p>
- *
- * @param importProposal {@link JSPCompletionProposal} to adjust
- * @return adjusted {@link ICompletionProposal}
- */
- private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
- // just need to remove the ";"
- // and adjust offsets for the change
- String newReplace;
- if (importProposal instanceof AutoImportProposal){
- newReplace =((AutoImportProposal)importProposal).getImportDeclaration() .replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else{
- 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;
- if (newReplacementLength >= 0) {
- importProposal.setReplacementLength(newReplacementLength);
- }
-
- int newCursorPosition = importProposal.getCursorPosition() - 1;
- importProposal.setCursorPosition(newCursorPosition);
-
- return importProposal;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
deleted file mode 100644
index a395fdbd7f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,553 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.WorkingCopyOwner;
-import org.eclipse.jface.text.BadLocationException;
-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.ITextViewerExtension5;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-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.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-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.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.ui.contentassist.CompletionProposalInvocationContext;
-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.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-/**
- * <p>Generates Java proposals for JSP documents</p>
- *
- * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor
- */
-public class JSPJavaCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
-
- /** The translation adapter used to create the Java proposals */
- private JSPTranslationAdapter fTranslationAdapter = null;
-
- /** translation adapter may be stale, check the model id */
- private String fModelId = null;
-
- /**
- * Create the computer
- */
- public JSPJavaCompletionProposalComputer() {
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- fTranslationAdapter = null;
- }
-
- /**
- * <p>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.</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- List results = new ArrayList(0);
- if(isValidContext(context)) {
- ITextViewer viewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
-
- // get results from JSP completion processor
- results = computeJavaCompletionProposals(viewer, documentPosition, 0);
-
- 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);
- results.add(cdataProposal);
- }
- }
-
- return results;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- ITextViewer viewer = context.getViewer();
- int documentOffset = context.getInvocationOffset();
-
- 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...
- List proposals = computeCompletionProposals(context,monitor);
- for (int i = 0; i < proposals.size(); i++) {
- IContextInformation ci = ((ICompletionProposal)proposals.get(i)).getContextInformation();
- if (ci != null)
- results.add(ci);
- }
- }
- }
- return results;
- }
-
- /**
- * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
- * java position is offset by the given extra offset.
- *
- * @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
- * @param javaPositionExtraOffset
- * the extra offset for the java position
- * @return an array of completion proposals or <code>null</code> if no
- * proposals are possible
- */
- protected List computeJavaCompletionProposals(ITextViewer viewer,
- int pos, int javaPositionExtraOffset) {
-
- JSPProposalCollector collector = null;
-
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
-
- IDOMDocument xmlDoc = xmlModel.getDocument();
- if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
- fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- fModelId = xmlModel.getId();
- }
- if (fTranslationAdapter != null) {
-
- JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
- int javaPosition = translation.getJavaOffset(pos) + javaPositionExtraOffset;
-
- try {
-
- ICompilationUnit cu = translation.getCompilationUnit();
-
- // can't get java proposals w/out a compilation unit
- // or without a valid position
- if (cu == null || -1 == javaPosition)
- return new ArrayList(0);
-
- collector = getProposalCollector(cu, translation);
- synchronized (cu) {
- cu.codeComplete(javaPosition, collector, (WorkingCopyOwner) 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)
- this.setErrorMessage(JSPUIMessages.Java_Content_Assist_is_not_UI_);
- }
-
- return Arrays.asList(results);
- }
-
- protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- return new JSPProposalCollector(cu, translation);
- }
-
- 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;
- }
-
- /**
- * @param viewer
- * @param documentPosition
- * @return String
- */
- private String getPartitionType(ITextViewer viewer, int documentPosition) {
- String partitionType = null;
- try {
- if (viewer instanceof ITextViewerExtension5)
- partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
- else
- partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, documentPosition, false);
- }
- catch (BadLocationException e) {
- partitionType = IDocument.DEFAULT_CONTENT_TYPE;
- }
- return partitionType;
- }
-
- /**
- * <p>Determines if the context is a valid one for JSP Java proposals.
- * The default result is <code>true</code></p>
- *
- * @param context check this context to see if it is valid for JSP
- * Java proposals
- * @return <code>true</code> if the given context is a valid one for
- * JSP Java proposals, <code>false</code> otherwise. <code>true</code>
- * is the default response if a specific case for <code>false</code> is
- * not found.
- */
- private boolean isValidContext(CompletionProposalInvocationContext context) {
- ITextViewer viewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
-
- String partitionType = getPartitionType(viewer, documentPosition);
- if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA)
- return true;
- IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
- IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(viewer, 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() &&
- xmlOpenOrClose.getType() != DOMRegionContext.XML_END_TAG_OPEN &&
- documentPosition <= possibleXMLJSP.getStartOffset()) {
-
- // 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 true;
- }
- }
- }
- }
-
- // ////////////////////////////////////////////////////////////////////////////
- // ** 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 true;
- }
- }
- else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
- if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
- return false;
- }
- 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 true;
- }
- else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
- return true;
- }
- }
- 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(viewer, documentPosition - 1);
- break;
- }
- }
- else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
- // JSP content assist
- return true;
- }
- }
- }
- }
- // }
- }
-
- // 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(viewer, documentPosition - 1);
- if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
- // check is failing for XML-JSP (region is not javascript...)
- return true;
- }
- partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
- }
- }
- else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
- // anything else inbetween
- return true;
- }
- }
- 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(viewer, documentPosition - 1);
- if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
- return true;
- }
- 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.getEndOffset()) {
- // it's at the EOF <%|
- return true;
- }
- }
- }
- }
-
- // 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 true;
- }
- }
- }
- }
- }
- }
- }
-
- // 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 delimiter
- 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 false;
- }
- else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
- if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
- return false;
- }
- }
- // TODO: handle non-Java code such as nested tags
- if (testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)) {
- return true;
- }
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * ** 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();
- }
-}
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 91ff80371c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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
- * @deprecated This class is no longer used locally and will be removed in the future
- */
-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/JSPMethodCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPMethodCompletionProposal.java
deleted file mode 100644
index 4cd2280855..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPMethodCompletionProposal.java
+++ /dev/null
@@ -1,235 +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.contentassist;
-
-import org.eclipse.jdt.core.CompletionProposal;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
-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.Position;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.link.ILinkedModeListener;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI;
-import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
-import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
-import org.eclipse.jface.text.link.LinkedPosition;
-import org.eclipse.jface.text.link.LinkedPositionGroup;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
-
-public class JSPMethodCompletionProposal extends JSPCompletionProposal {
-
- private CompletionProposal fProposal;
- private IJavaProject fProject;
- private FormatterPrefs fFormatterPrefs;
-
- private static final String LPAREN = "("; //$NON-NLS-1$
- private static final String RPAREN = ")"; //$NON-NLS-1$
- private static final String COMMA = ","; //$NON-NLS-1$
- private static final String SPACE = " "; //$NON-NLS-1$
-
- private IRegion fSelectedRegion;
-
- public JSPMethodCompletionProposal(CompletionProposal proposal, IJavaProject project, 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);
- fProposal = proposal;
- fProject = project;
- }
-
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- Position[] positions = null;
- FormatterPrefs formatterPrefs = getFormatterPrefs();
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(fProposal.getName());
-
- if (formatterPrefs.beforeOpeningParen)
- buffer.append(SPACE);
-
- buffer.append(LPAREN);
-
- if (formatterPrefs.afterOpeningParen)
- buffer.append(SPACE);
-
- if (Signature.getParameterCount(fProposal.getSignature()) > 0) {
- char[][] parameters = fProposal.findParameterNames(null);
- if (parameters != null) {
- positions = new Position[parameters.length];
-
- int base = getReplacementOffset();
- for (int i = 0; i < parameters.length; i++) {
- if (i != 0) {
- if (formatterPrefs.beforeComma)
- buffer.append(SPACE);
-
- buffer.append(COMMA);
-
- if (formatterPrefs.afterComma)
- buffer.append(SPACE);
- }
- Position position = new Position(0,0);
- position.setOffset(base + buffer.length());
- position.setLength(parameters[i].length);
- positions[i] = position;
- buffer.append(parameters[i]);
- }
- }
- }
-
- if (formatterPrefs.beforeClosingParen)
- buffer.append(SPACE);
-
- buffer.append(RPAREN);
- setReplacementString(buffer.toString());
-
- super.apply(viewer, trigger, stateMask, offset);
-
- try {
- if (positions != null) {
- LinkedModeModel model = new LinkedModeModel();
-
- for (int i = 0; i < positions.length; i++) {
- LinkedPositionGroup group = new LinkedPositionGroup();
- Position position = positions[i];
- group.addPosition(new LinkedPosition(viewer.getDocument(), position.getOffset(), position.getLength(), i));
- model.addGroup(group);
- }
- model.forceInstall();
-
- LinkedModeUI ui = new EditorLinkedModeUI(model, viewer);
- ui.setExitPosition(viewer, getReplacementOffset() + getReplacementString().length(), 0, Integer.MAX_VALUE);
- ui.setExitPolicy(new ExitPolicy(')', viewer.getDocument()));
- ui.setCyclingMode(LinkedModeUI.CYCLE_WHEN_NO_PARENT);
- ui.setDoContextInfo(true);
- ui.enter();
- fSelectedRegion = ui.getSelectedRegion();
- }
- }
- catch (BadLocationException e) {
-
- }
- }
-
- protected final FormatterPrefs getFormatterPrefs() {
- if (fFormatterPrefs == null)
- fFormatterPrefs= new FormatterPrefs(fProject);
- return fFormatterPrefs;
- }
-
- /* Copied from org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.ExitPolicy */
- protected static final class ExitPolicy implements IExitPolicy {
-
- final char fExitCharacter;
- private final IDocument fDocument;
-
- public ExitPolicy(char exitCharacter, IDocument document) {
- fExitCharacter= exitCharacter;
- fDocument= document;
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int)
- */
- public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
-
- if (event.character == fExitCharacter) {
- if (environment.anyPositionContains(offset))
- return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
- else
- return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
- }
-
- switch (event.character) {
- case ';':
- return new ExitFlags(ILinkedModeListener.NONE, true);
- case SWT.CR:
- // when entering an anonymous class as a parameter, we don't want
- // to jump after the parenthesis when return is pressed
- if (offset > 0) {
- try {
- if (fDocument.getChar(offset - 1) == '{')
- return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
- } catch (BadLocationException e) {
- }
- }
- return null;
- default:
- return null;
- }
- }
-
- }
-
- /* Copied from org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.FormatterPrefs */
- protected static final class FormatterPrefs {
- /* Methods & constructors */
- public final boolean beforeOpeningParen;
- public final boolean afterOpeningParen;
- public final boolean beforeComma;
- public final boolean afterComma;
- public final boolean beforeClosingParen;
- public final boolean inEmptyList;
-
- /* type parameters */
- public final boolean beforeOpeningBracket;
- public final boolean afterOpeningBracket;
- public final boolean beforeTypeArgumentComma;
- public final boolean afterTypeArgumentComma;
- public final boolean beforeClosingBracket;
-
- FormatterPrefs(IJavaProject project) {
- beforeOpeningParen = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, false);
- afterOpeningParen = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, false);
- beforeComma = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, false);
- afterComma = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, true);
- beforeClosingParen = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, false);
- inEmptyList = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, false);
-
- beforeOpeningBracket = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, false);
- afterOpeningBracket = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, false);
- beforeTypeArgumentComma = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, false);
- afterTypeArgumentComma = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, true);
- beforeClosingBracket = getCoreOption(project, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, false);
- }
-
- protected final boolean getCoreOption(IJavaProject project, String key, boolean def) {
- String option = getCoreOption(project, key);
- if (JavaCore.INSERT.equals(option))
- return true;
- if (JavaCore.DO_NOT_INSERT.equals(option))
- return false;
- return def;
- }
-
- protected final String getCoreOption(IJavaProject project, String key) {
- if (project == null)
- return JavaCore.getOption(key);
- return project.getOption(key, true);
- }
- }
-
- public Point getSelection(IDocument document) {
- if (fSelectedRegion != null) {
- return new Point(fSelectedRegion.getOffset(), fSelectedRegion.getLength());
- }
- return super.getSelection(document);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
deleted file mode 100644
index 1018f8e4bb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
+++ /dev/null
@@ -1,249 +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.contentassist;
-
-import org.eclipse.core.resources.IResource;
-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.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.contentassist.CompletionProposalInvocationContext;
-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.DefaultXMLCompletionProposalComputer;
-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;
-
-/**
- * <p>This class computes attribute value completion proposals
- * for <code>&lt;jsp:[gs]etProperty&gt;</code> tags.</p>
- */
-public class JSPPropertyCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- //only add attribute value proposals for specific elements
- if(node.getNodeName().equals(JSP11Namespace.ElementName.SETPROPERTY) ||
- node.getNodeName().equals(JSP11Namespace.ElementName.GETPROPERTY)) {
-
- // 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("'")) && //$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());
- }
- // 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);
- }
- }
- }
- }
-
- /**
- * <p>Add bean property proposals to the given {@link ContentAssistRequest}</p>
- *
- * @param contentAssistRequest
- * @param node
- * @param isGetProperty
- * @param matchString
- */
- private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest,
- IDOMNode node, boolean isGetProperty, String matchString) {
-
- if (((Element) node).hasAttribute(JSP11Namespace.ATTR_NAME_NAME)) {
- // 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.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 (useBeanName.equals(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID))) {
- typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
- if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS) || typeName.length() < 1) {
- typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
- }
- if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE) || 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 = JSPContentAssistHelper.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);
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * <p>Add bean name propoasals to the given {@link ContentAssistRequest}</p>
- *
- * @param contentAssistRequest
- * @param node
- * @param matchString
- */
- 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() &&
- useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID)) {
-
- id = useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID) ?
- StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID)) : null;
- displayString = null;
- classOrType = null;
- imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
- // set the Image based on whether the class, type, or beanName attribute is present
- if (useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS))
- classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
- if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE)) {
- classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
- imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
- }
- if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
- 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);
- }
- }
- }
- }
- }
- }
-}
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 c8b5dcc655..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.contentassist;
-
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * This class computes attribute value completion proposals for &lt;jsp:[gs]etProperty&gt; tags.
- *
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see JSPPropertyCompletionProposalComputer
- */
-public class JSPPropertyContentAssistProcessor extends JSPDummyContentAssistProcessor {
- private JSPPropertyCompletionProposalComputer fComputer;
-
- public JSPPropertyContentAssistProcessor() {
- super();
- fComputer = new JSPPropertyCompletionProposalComputer();
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- fComputer.addAttributeValueProposals(contentAssistRequest, null);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
deleted file mode 100644
index e73d4657df..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.IImportContainer;
-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.jface.text.contentassist.IContextInformationExtension;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-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;
- private IImportContainer fImportContainer;
-
- public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- super(cu);
-
- if(translation == null)
- throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
-
- fTranslation = translation;
- fImportContainer = cu.getImportContainer();
- }
-
- /**
- * 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()) {
- int kind = proposal.getKind();
- if(proposal.getKind() == CompletionProposal.TYPE_REF && JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(JSPUIPreferenceNames.AUTO_IMPORT_INSERT)) {
- String signature = String.valueOf(proposal.getDeclarationSignature());
- String completion = String.valueOf(proposal.getCompletion());
- if(completion.indexOf(signature + ".") != -1) { //$NON-NLS-1$
- jspProposal = createAutoImportProposal(proposal);
- }
- }
- else if (kind == CompletionProposal.METHOD_REF) {
- jspProposal = createMethodProposal(proposal);
- }
-
- // default behavior
- if(jspProposal == null)
- jspProposal = createJspProposal(proposal);
- }
- return jspProposal;
- }
-
- /**
- * Retrieves the type name from the string <code>fullName</code>
- * @param fullName the fully qualified Java name
- * @return the type name
- */
- private String getTypeName(String fullName) {
- int index = fullName.lastIndexOf('.');
- return (index != -1) ? fullName.substring(index + 1) : fullName;
- }
-
- private JSPCompletionProposal createAutoImportProposal(CompletionProposal proposal) {
-
- JSPCompletionProposal jspProposal = null;
-
- String completion = new String(proposal.getCompletion());
-
- // it's fully qualified so we should
- // add an import statement
- // create an autoimport proposal
- String newCompletion = getTypeName(completion);
-
- // 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, fImportContainer, 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();
-
- /* the context information is calculated with respect to the java document
- * thus it needs to be updated in respect of the JSP document.
- */
- if(contextInformation instanceof IContextInformationExtension) {
- contextInformation = new JavaContextInformationWrapper(contextInformation);
- }
-
- 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;
- }
-
- private class JavaContextInformationWrapper implements IContextInformation, IContextInformationExtension {
- private IContextInformation contextInformation;
-
- public JavaContextInformationWrapper(IContextInformation contextInformation) {
- this.contextInformation = contextInformation;
- }
-
- public String getContextDisplayString() {
- return contextInformation.getContextDisplayString();
- }
-
- public Image getImage() {
- return contextInformation.getImage();
- }
-
- public String getInformationDisplayString() {
- return contextInformation.getInformationDisplayString();
- }
-
- public int getContextInformationPosition() {
- return fTranslation.getJspOffset(((IContextInformationExtension) contextInformation).getContextInformationPosition());
- }
-
- }
-
- private JSPCompletionProposal createMethodProposal(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();
-
- /* the context information is calculated with respect to the java document
- * thus it needs to be updated in respect of the JSP document.
- */
- if(contextInformation instanceof IContextInformationExtension) {
- contextInformation = new JavaContextInformationWrapper(contextInformation);
- }
-
- int relevance = javaProposal.getRelevance();
-
- boolean updateLengthOnValidate = true;
-
- jspProposal = new JSPMethodCompletionProposal(proposal, fTranslation.getJavaProject(), 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/JSPStructuredContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
deleted file mode 100644
index 4a94d89a2e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
-
-/**
- * <p>Implementation of {@link StructuredContentAssistProcessor} for JSP documents</p>
- *
- * <p>Currently this implementation still uses the HTML preferences for auto
- * activation characters, but in the future this should probably change</p>
- */
-public class JSPStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
-
- /** auto activation characters */
- private char[] fCompletionProposalAutoActivationCharacters;
-
- /** property key for determining if auto activation is enabled */
- private String fAutoActivationEnabledPropertyKey;
-
- /** property key for determining what the auto activation characters are */
- private String fAutoActivationCharactersPropertyKey;
-
- /** property key for determining what the auto activation delay is*/
- private String fAutoActivationDelayKey;
-
- /** the context information validator for this processor */
- private IContextInformationValidator fContextInformationValidator;
-
- /**
- * <p>Constructor</p>
- *
- * @param assistant {@link ContentAssistant} to use
- * @param partitionTypeID the partition type this processor is for
- * @param viewer {@link ITextViewer} this processor is acting in
- */
- public JSPStructuredContentAssistProcessor(ContentAssistant assistant,
- String partitionTypeID, ITextViewer viewer) {
-
- super(assistant, partitionTypeID, viewer, isJavaPartitionType(partitionTypeID) ?
- PreferenceConstants.getPreferenceStore() : HTMLUIPlugin.getDefault().getPreferenceStore());
-
- //determine which property keys to used based on weather this processor is for Java or HTML syntax
- if(isJavaPartitionType(partitionTypeID)) {
- fAutoActivationEnabledPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION;
- fAutoActivationCharactersPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA;
- } else {
- fAutoActivationEnabledPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE;
- fAutoActivationCharactersPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- }
- fAutoActivationDelayKey = HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY;
-
- //get the current user preference
- getAutoActivationCharacterPreferences();
- updateAutoActivationDelay();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- if (this.fContextInformationValidator == null) {
- this.fContextInformationValidator = new AttributeContextInformationPresenter();
- }
- return this.fContextInformationValidator;
- }
-
- /**
- * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return super.getCompletionProposalAutoActivationCharacters() != null ? super.getCompletionProposalAutoActivationCharacters() : this.fCompletionProposalAutoActivationCharacters;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
- * org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if(property.equals(fAutoActivationEnabledPropertyKey) ||
- property.equals(fAutoActivationCharactersPropertyKey)) {
- getAutoActivationCharacterPreferences();
- }else if (property.equals(fAutoActivationDelayKey)) {
- updateAutoActivationDelay();
- }
- }
-
- /**
- * <p>Sets the auto activation delay in Content Assist</p>
- */
- private void updateAutoActivationDelay() {
- IPreferenceStore store = getPreferenceStore();
- boolean doAuto = store.getBoolean(fAutoActivationEnabledPropertyKey);
- if (doAuto) {
- setAutoActivationDelay(store.getInt(fAutoActivationDelayKey));
- }
-
- }
-
- /**
- * <p>Gets the auto activation character user preferences for Java and stores them for later use</p>
- */
- private void getAutoActivationCharacterPreferences() {
- IPreferenceStore store = getPreferenceStore();
-
- boolean doAuto = store.getBoolean(fAutoActivationEnabledPropertyKey);
- if (doAuto) {
- fCompletionProposalAutoActivationCharacters =
- store.getString(fAutoActivationCharactersPropertyKey).toCharArray();
- } else {
- fCompletionProposalAutoActivationCharacters = null;
- }
- }
-
- /**
- * @param partitionTypeID check to see if this partition type ID is for a Java partition type
- * @return <code>true</code> if the given partiton type is a Java partition type,
- * <code>false</code> otherwise
- */
- private static boolean isJavaPartitionType(String partitionTypeID) {
- return IJSPPartitions.JSP_CONTENT_JAVA.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL2.equals(partitionTypeID);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
deleted file mode 100644
index 0f3797ebfe..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.contentassist.CompletionProposalInvocationContext;
-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.contentassist.DefaultXMLCompletionProposalComputer;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * <p>Compute JSP taglib completion proposals</p>
- */
-public class JSPTaglibCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IPath basePath = getBasePath(contentAssistRequest);
- if (basePath != null) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- //only add attribute value proposals for specific elements
- if(node.getNodeName().equals(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB)) {
- // 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 : {
- uri = descriptor.getURI();
- if (uri == null || uri.trim().length() == 0) {
- IPath path = ((ITLDRecord) taglibRecord).getPath();
- IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
- if (localContextRoot.isPrefixOf(path)) {
- uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
- }
- 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.getDisplayName() + "<br/>" + //$NON-NLS-1$
- descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
- 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, //$NON-NLS-1$ //$NON-NLS-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();
- IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
- 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();
- 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(); //$NON-NLS-1$
- 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, //$NON-NLS-1$ //$NON-NLS-2$
- 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 (isTaglibForURI(uri, basePath, availableTaglibRecords[taglibrecordNumber])) {
- 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, //$NON-NLS-1$ //$NON-NLS-2$
- 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, //$NON-NLS-1$ //$NON-NLS-2$
- image, shortName, null, descriptor.getDescription(),
- IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- if (dir.startsWith("/WEB-INF/")) { //$NON-NLS-1$
- dir = dir.substring(9);
- }
- String prefix = StringUtils.replace(dir, "/", "-"); //$NON-NLS-1$ //$NON-NLS-2$
-
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- "\"" + prefix + "\"", start, length, prefix.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
- image, prefix, null, null, IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- private boolean isTaglibForURI(String uri, IPath basePath, ITaglibRecord record) {
- final ITaglibDescriptor descriptor = record.getDescriptor();
- boolean matches = false;
- if (descriptor != null) {
- if (record.getRecordType() == ITaglibRecord.TLD && (descriptor.getURI() == null || "".equals(descriptor.getURI().trim()))) {
- matches = ((ITLDRecord) record).getPath().equals(FacetModuleCoreSupport.resolve(basePath, uri));
- }
- else {
- matches = descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US));
- }
- }
- return matches;
- }
-
- private 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 = "platform:/resource/" + //$NON-NLS-1$
- FacetModuleCoreSupport.resolve(file.getFullPath(),
- record.getDescriptor().getSmallIcon());
- }
- }
- 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;
- }
-
- /**
- * 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/JSPTaglibDirectiveContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
deleted file mode 100644
index 9374f8f380..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.contentassist;
-
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see JSPTaglibCompletionProposalComputer
- */
-public class JSPTaglibDirectiveContentAssistProcessor extends JSPDummyContentAssistProcessor {
-
- private JSPTaglibCompletionProposalComputer fComputer;
-
- public JSPTaglibDirectiveContentAssistProcessor() {
- super();
- fComputer = new JSPTaglibCompletionProposalComputer();
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- fComputer.addAttributeValueProposals(contentAssistRequest, null);
- }
-}
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 d2655a6bf8..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, 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.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;
-import org.eclipse.wst.xml.ui.internal.contentassist.ReplaceNameTemplateContext;
-
-/**
- * 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) {
- return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
- }
-
- 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/JSPTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
deleted file mode 100644
index beb058905c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
+++ /dev/null
@@ -1,151 +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.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
-
-/**
- * <p>Computes JSP template completion proposals</p>
- */
-public class JSPTemplatesCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /** Template completion processor used to create template proposals */
- private JSPTemplateCompletionProcessor fTemplateProcessor = null;
-
- /**
- * Create the computer
- */
- public JSPTemplatesCompletionProposalComputer() {
- this.fTemplateProcessor = new JSPTemplateCompletionProcessor();
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- //get the templates specific to the context
- List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
-
- //get templates not specific to the context
- proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsJSP.ALL, context));
-
- return proposals;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(
- ((IDOMNode) contentAssistRequest.getNode()).getModel().getContentTypeIdentifier())) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW_TAG, context);
- } else {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW, context);
- }
- }
-
- /**
- * <p>Get the template proposals from the template processor</p>
- *
- * @param templateContext
- * @param context
- * @return
- */
- private List getTemplateProposals(String templateContext,
- CompletionProposalInvocationContext context) {
-
- List templateProposals = new ArrayList();
-
- if (fTemplateProcessor != null) {
- fTemplateProcessor.setContextType(templateContext);
- ICompletionProposal[] proposals =
- fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
-
- templateProposals.addAll(Arrays.asList(proposals));
- }
-
- return templateProposals;
- }
-
- /**
- * <p>Adds templates to the list of proposals</p>
- *
- * @param contentAssistRequest
- * @param templateContext
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
- CompletionProposalInvocationContext context) {
-
- if (contentAssistRequest != null) {
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
- List proposals = this.getTemplateProposals(templateContext, context);
-
- for (int i = 0; i < proposals.size(); ++i) {
- if (useProposalList) {
- contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
- }
- else {
- contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
deleted file mode 100644
index a6033592e1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
+++ /dev/null
@@ -1,126 +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.contentassist;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-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.contentassist.CompletionProposalInvocationContext;
-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.DefaultXMLCompletionProposalComputer;
-
-/**
- * <p>Compute JSP use bean completion proposals</p>
- */
-public class JSPUseBeanCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- //only add attribute value proposals for specific elements
- if(node.getNodeName().equals(JSP11Namespace.ElementName.USEBEAN)) {
- // 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 = JSPContentAssistHelper.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 = JSPContentAssistHelper.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 = JSPContentAssistHelper.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);
- }
- }
- }
- }
- }
- }
- }
-}
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 3ab7f8f80e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.contentassist;
-
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see JSPUseBeanCompletionProposalComputer
- */
-public class JSPUseBeanContentAssistProcessor extends JSPDummyContentAssistProcessor {
-
- private JSPUseBeanCompletionProposalComputer fComputer;
-
- public JSPUseBeanContentAssistProcessor() {
- super();
- fComputer = new JSPUseBeanCompletionProposalComputer();
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- fComputer.addAttributeValueProposals(contentAssistRequest, null);
- }
-}
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/LibraryTagsCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
deleted file mode 100644
index 99abe9bacb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-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.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
-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.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-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.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-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.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * <p>Computes tags provided by tag libraries completion proposals.</p>
- *
- * <p>Extends the {@link HTMLTagsCompletionProposalComputer} to benefit from
- * its work for determining the correct {@link XMLContentModelGenerator} to use</p>
- */
-public class LibraryTagsCompletionProposalComputer extends
- HTMLTagsCompletionProposalComputer {
-
- private int fDepthCount;
-
- /**
- * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
- */
- protected boolean validModelQueryNode(CMNode node) {
- boolean isValid = false;
-
- //unwrap
- if(node instanceof CMNodeWrapper) {
- node = ((CMNodeWrapper)node).getOriginNode();
- }
-
- //determine if is valid
- if(node instanceof HTMLPropertyDeclaration) {
- HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
- isValid = propDec.isJSP();
- } else if(node.supports(TLDElementDeclaration.IS_LIBRARY_TAG)){
- Boolean isLibraryTag = (Boolean)node.getProperty(TLDElementDeclaration.IS_LIBRARY_TAG);
- isValid = isLibraryTag != null && isLibraryTag.booleanValue();
- }
-
- return isValid;
- }
-
- /**
- * <p>JSP has none. This overrides the default behavior to add in doctype proposals which
- * should really be contributed by the HTML tag computer</p>
- *
- * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addStartDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //jsp has none
- }
-
- /**
- * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //jsp has none
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
- //do nothing, html computer will take care of adding the > and /> suggestions
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- if(!this.isXHTML) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- 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;
- }
- }
-
- // on an empty value, add all the JSP and taglib tags
- CMElementDeclaration elementDecl =
- AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(node);
- if (nameRegion != null && elementDecl != null) {
- String attributeName = open.getText(nameRegion);
- if (attributeName != null) {
- Node parent = contentAssistRequest.getParent();
-
- //ignore start quote in match string
- String matchString = contentAssistRequest.getMatchString().trim();
- if(matchString.startsWith("'") || matchString.startsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
- matchString = matchString.substring(1);
- }
-
- //get all the proposals
- List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent(
- (Element) node, elementDecl, ModelQuery.INCLUDE_ALL);
- Iterator nodeIterator = additionalElements.iterator();
-
- //check each suggestion
- while (nodeIterator.hasNext()) {
- CMNode additionalElementDecl = (CMNode) nodeIterator.next();
- if (additionalElementDecl != null && additionalElementDecl instanceof CMElementDeclaration &&
- validModelQueryNode(additionalElementDecl)) {
- CMElementDeclaration ed = (CMElementDeclaration) additionalElementDecl;
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
- StringBuffer sb = new StringBuffer();
- getContentGenerator().generateTag(parent, ed, sb);
-
- String proposedText = sb.toString();
-
- //filter out any proposals that dont match matchString
- if (beginsWith(proposedText, matchString)) {
- //wrap with ' because JSP attributes are warped with "
- proposedText = "'" + proposedText; //$NON-NLS-1$
-
- //if its a container its possible the closing quote is already there
- //don't want to risk injecting an extra
- if(!(contentAssistRequest.getRegion() instanceof ITextRegionContainer)) {
- proposedText += "'"; //$NON-NLS-1$
- }
-
- //get the image
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- image = this.getGenericTagImage();
- }
-
- //create the proposal
- int cursorAdjustment = getCursorPositionForProposedText(proposedText);
- String proposedInfo = AbstractXMLModelQueryCompletionProposalComputer.getAdditionalInfo(
- AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(parent), elementDecl);
- String tagname = getContentGenerator().getRequiredName(node, ed);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), cursorAdjustment, image, tagname, null, proposedInfo,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#setErrorMessage(java.lang.String)
- */
- public void setErrorMessage(String errorMessage) {
- if (fDepthCount == 0) {
- super.setErrorMessage(errorMessage);
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getGenericTagImage()
- */
- protected Image getGenericTagImage() {
- return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getDeemphasizedTagImage()
- */
- protected Image getDeemphasizedTagImage() {
- return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getEmphasizedTagImage()
- */
- protected Image getEmphasizedTagImage() {
- return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
- }
-
- //----------------------BELOW HERE SHOULD BE REMOVED ONCE BUG 211961 IS FIXED ---------------------
-
- /**
- * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- //get the default proposals
- super.addTagInsertionProposals(contentAssistRequest, childPosition, context);
-
- /**
- * TODO: REMOVE THIS HACK - Bug 311961
- */
- if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
- this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
- contentAssistRequest, childPosition);
- }
- }
-
- /**
- * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagNameProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- //get the default proposals
- super.addTagNameProposals(contentAssistRequest, childPosition, context);
-
- /**
- * TODO: REMOVE THIS HACK - Bug 311961
- */
- if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
- this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
- contentAssistRequest, childPosition);
- }
- }
-
- /**
- * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
- * <p>This is bad because it does not use the ModelQuery framework</p>
- *
- * @param document
- * @param contentAssistRequest
- * @param childPosition
- */
- private void forciblyAddTagLibAndJSPPropsoals(Document document, ContentAssistRequest contentAssistRequest, int childPosition) {
- if (!isXMLFormat(document)) {
- List additionalElements = forciblyGetTagLibAndJSPElements(new ArrayList(), document, childPosition);
-
- //convert CMElementDeclartions to proposals
- for (int i = 0; i < additionalElements.size(); i++) {
- CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
- if (ed != null) {
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = this.getGenericTagImage();
- }
- String proposedText = getRequiredText(document, ed);
- final IDOMNode targetNode = (IDOMNode) contentAssistRequest.getNode();
- if (targetNode != null) {
- final IStructuredDocumentRegion region = targetNode.getFirstStructuredDocumentRegion();
- if (region != null && region.getFirstRegion() != null && region.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN) && proposedText.length() > 0) {
- //in order to differentiate between content assist on
- //completely empty document and the one with xml open tag
- proposedText = proposedText.substring(1);
- }
- }
- if (!beginsWith(proposedText, contentAssistRequest.getMatchString())) {
- return;
- }
- String tagname = getRequiredName(document, ed);
- // account for the &lt; and &gt;
- int markupAdjustment = getCursorPositionForProposedText(proposedText);
- String proposedInfo = getAdditionalInfo(null, ed);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), markupAdjustment, image,
- tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
-
- /**
- * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
- * <p>This is bad because it does not use the ModelQuery framework, it
- * access the TLDCMDocumentManager directly</p>
- * <p>This is essentially a combination of the {@link TaglibModelQueryExtension} and
- * the {@link JSPModelQueryExtension} but it means any other extensions get left
- * out when creating content assist suggestion at the document root level</p>
- *
- * @param elementDecls
- * @param node
- * @param childIndex
- * @return
- */
- private List forciblyGetTagLibAndJSPElements(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;
- }
-
- /**
- * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
- *
- * 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.
- */
- private 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;
- }
-
- private 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$
- }
-} \ No newline at end of file
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 ca15fd2e6a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.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;
-import org.eclipse.jface.text.templates.TemplateVariable;
-
-/**
- * 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)
- *
- * @deprecated No longer used
- */
-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
- int prefixSize = prefix.length();
- TemplateVariable[] newTemplateVar = buffer.getVariables();
- for (int i =0; i < newTemplateVar.length; i++ ){
- int[] offsets = newTemplateVar[i].getOffsets();
- for (int j=0; j<offsets.length ;j++){
- offsets[j] += prefixSize;
- }
- }
- buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
- }
- }
- }
- 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 3ae07984d7..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,189 +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.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.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 Combo fLanguageCombo;
- private Combo fContentTypeCombo;
-
- 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);
-
- initializeValues();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
- Dialog.applyDialogFont(parent);
- return propertyPage;
- }
-
- /**
- * 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);
- }
-
- 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);
-
- 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);
- }
- 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/contentproperties/ui/TagContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
deleted file mode 100644
index b637ba2342..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.ComboFieldEditor;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.modelquery.TagModelQuery;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-public class TagContentSettingsPropertyPage extends PropertyPage implements IWorkbenchPropertyPage {
- private static final String[] fDisplayTypes = {"HTML", "XML"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static final String[] fValues = {"text/html", "text/xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private ComboFieldEditor fComboFieldEditor;
-
- public TagContentSettingsPropertyPage() {
- super();
- noDefaultAndApplyButton();
- setDescription(JSPUIMessages.TagPropertyPage_desc);
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayoutData(GridDataFactory.fillDefaults());
- composite.setLayout(new GridLayout(2, true));
-
- Object adapter = getElement().getAdapter(IFile.class);
- if (adapter == null) {
- adapter = getElement().getAdapter(IResource.class);
- }
- if (adapter != null && adapter instanceof IResource) {
- String preferenceKey = TagModelQuery.createPreferenceKey(((IResource) adapter).getFullPath());
- new DefaultScope().getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName()).put(preferenceKey, fValues[0]);
- ScopedPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(((IResource) adapter).getProject()), JSPCorePlugin.getDefault().getBundle().getSymbolicName());
-
- String[][] entryNamesAndValues = new String[][]{{fDisplayTypes[0], fValues[0]}, {fDisplayTypes[1], fValues[1]}};
- fComboFieldEditor = new ComboFieldEditor(preferenceKey, JSPUIMessages.JSPFContentSettingsPropertyPage_2, entryNamesAndValues, composite);
- fComboFieldEditor.fillIntoGrid(composite, 2);
- fComboFieldEditor.setPreferenceStore(store);
- fComboFieldEditor.load();
-
- // let the page save for us if needed
- setPreferenceStore(store);
- }
- return composite;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- if (fComboFieldEditor != null) {
- fComboFieldEditor.store();
- }
- return super.performOk();
- }
-}
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 db268436c9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
+++ /dev/null
@@ -1,61 +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.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);
- // last one to declare a language wins
- if (pageDirective.hasAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE))
- language = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
- }
- }
- }
- // 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 309b910297..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.format;
-
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.ToolFactory;
-import org.eclipse.jdt.core.formatter.CodeFormatter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedPosition;
-import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
-import org.eclipse.jface.text.formatter.FormattingContextProperties;
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationUtil;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-
-public class FormattingStrategyJSPJava extends ContextBasedFormattingStrategy {
-
- /** Documents to be formatted by this strategy */
- private final LinkedList fDocuments = new LinkedList();
- /** Partitions to be formatted by this strategy */
- private final LinkedList fPartitions = new LinkedList();
- JSPTranslation translation = null;
-
- /**
- * Creates a new java formatting strategy.
- */
- public FormattingStrategyJSPJava() {
- super();
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
- */
- public void format() {
- super.format();
-
- final IDocument document = (IDocument) fDocuments.removeFirst();
- final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
-
- if (document != null && partition != null) {
- try {
-
- JSPTranslationUtil translationUtil = new JSPTranslationUtil(document);
- ICompilationUnit cu = translationUtil.getCompilationUnit();
- if (cu != null) {
- String cuSource = cu.getSource();
- TextEdit textEdit = formatString(CodeFormatter.K_COMPILATION_UNIT, cuSource, 0, TextUtilities.getDefaultLineDelimiter(document), getPreferences());
-
- TextEdit jspEdit = translationUtil.getTranslation().getJspEdit(textEdit);
- if (jspEdit != null && jspEdit.hasChildren())
- jspEdit.apply(document);
- }
-
- }
- catch (MalformedTreeException exception) {
- Logger.logException(exception);
- }
- catch (BadLocationException exception) {
- // Can only happen on concurrent document modification - log
- // and bail out
- Logger.logException(exception);
- }
- catch (JavaModelException exception) {
- Logger.logException(exception);
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
- */
- public void formatterStarts(final IFormattingContext context) {
- super.formatterStarts(context);
-
- fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
- fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM));
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
- */
- public void formatterStops() {
- super.formatterStops();
-
- fPartitions.clear();
- fDocuments.clear();
- }
-
- public TextEdit formatString(int kind, String string, int indentationLevel, String lineSeparator, Map options) {
- return ToolFactory.createCodeFormatter(options).format(kind, string, 0, string.length(), indentationLevel, lineSeparator);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/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 207266c866..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
+++ /dev/null
@@ -1,36 +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.jst.jsp.ui.internal.java.search.JSPFindOccurrencesProcessor;
-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);
- 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/ExternalFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index 15ff247909..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-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.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Hyperlink for external files.
- */
-class ExternalFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fHyperlinkRegion;
- private File fHyperlinkFile;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public String getHyperlinkText() {
- String path = fHyperlinkFile.getPath();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- return NLS.bind(JSPUIMessages.Open, path);
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
- IDE.openEditorOnFileStore(page, store) ;
- }
- 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 aaeaeae3b7..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.ui.JavaElementLabels;
-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.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-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 null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return NLS.bind(JSPUIMessages.Open, JavaElementLabels.getElementLabel(fElement, JavaElementLabels.ALL_POST_QUALIFIED));
- }
-
- /*
- * (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 7b2ba67aa8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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...
- boolean isInTranslationCU = false;
- 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();
- Object cu = ((ILocalVariable) element).getAncestor(IJavaElement.COMPILATION_UNIT);
- if (cu != null && cu.equals(jspTranslation.getCompilationUnit()))
- isInTranslationCU = true;
- }
- // 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();
- isInTranslationCU = true;
- }
- }
- // 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();
- isInTranslationCU = true;
- }
- }
- }
-
- 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 && !isInTranslationCU) { // Don't try to open the translation CU
- 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 012b0f5bf0..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
+++ /dev/null
@@ -1,126 +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.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-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 NLS.bind(JSPUIMessages.Open, 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 66d7b430a7..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ /dev/null
@@ -1,441 +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.JSPUIMessages;
-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) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
- // check if jsp taglib directive
- Node currentNode = getCurrentNode(sModel, 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);
- }
- }
- }
- }
- }
- }
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
- }
- 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);// ||
- }
-
- 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)) {
- public String getHyperlinkText() {
- return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
- }
- };
- }
- 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) {
- public String getHyperlinkText() {
- return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
- }
- };
- }
- 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;
- }
-
- private Node getCurrentNode(IStructuredModel model, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- if (model != null) {
- inode = model.getIndexedRegion(offset);
- if (inode == null) {
- inode = model.getIndexedRegion(offset - 1);
- }
- }
-
- 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 3652adcf77..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
+++ /dev/null
@@ -1,113 +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.JSPUIMessages;
-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 JSPUIMessages.TLDHyperlink_hyperlinkText;
- }
-
- 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 ff4072eff4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
+++ /dev/null
@@ -1,74 +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;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-/**
- * 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() {
- return JSPUIMessages.TLDHyperlink_hyperlinkText;
- }
-
- 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 df8d5a9cc3..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ /dev/null
@@ -1,178 +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.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-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;
-import org.eclipse.wst.sse.core.internal.util.JarUtilities;
-
-/**
- * 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 = JarUtilities.getInputStream(fURL);
- }
- 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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String path = fURL.getPath();
- if (path.length() > 0)
- return NLS.bind(JSPUIMessages.Open, new Path(path).lastSegment());
- return NLS.bind(JSPUIMessages.TLDHyperlink_hyperlinkText, 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 2b383c917d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
+++ /dev/null
@@ -1,218 +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.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return NLS.bind(JSPUIMessages.Open, 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(), true);
- 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 20b2579ce2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,83 +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.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String path = fFile.getFullPath().toString();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- return NLS.bind(JSPUIMessages.Open, path);
- }
-
- public void open() {
- if (fFile != null && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if (fHighlightRange != null && editor instanceof ITextEditor) {
- ((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
- }
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
deleted file mode 100644
index 52b85dc4e8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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 org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaElementLabels;
-import org.eclipse.jdt.ui.JavaUI;
-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.Logger;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Detects hyper-links in Tag Library Descriptors
- */
-public class XMLJavaHyperlinkDetector extends AbstractHyperlinkDetector {
-
- private static final String JAR_FILE_PROTOCOL = "jar:file:"; //$NON-NLS-1$
-
- /**
- * Based on org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlink
- */
- static class JavaElementHyperlink implements IHyperlink {
-
- private final IJavaElement fElement;
- private final IRegion fRegion;
-
-
- /**
- * Creates a new Java element hyperlink.
- *
- * @param region
- * the region of the link
- * @param element
- * the java element to open
- * @param qualify
- * <code>true</code> if the hyper-link text should show a
- * qualified name for element.
- */
- JavaElementHyperlink(IRegion region, IJavaElement element) {
- fRegion = region;
- fElement = element;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- public String getHyperlinkText() {
- String elementLabel = JavaElementLabels.getElementLabel(fElement, JavaElementLabels.ALL_POST_QUALIFIED);
- return NLS.bind(JSPUIMessages.Open, elementLabel);
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public void open() {
- try {
- JavaUI.openInEditor(fElement);
- }
- catch (PartInitException e) {
- }
- catch (JavaModelException e) {
- }
- }
- }
-
-
- private IHyperlink createHyperlink(String elementName, IRegion region, IDocument document) {
- // try file buffers
- ITextFileBuffer textFileBuffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(document);
- if (textFileBuffer != null) {
- IPath basePath = textFileBuffer.getLocation();
- if (basePath != null && !basePath.isEmpty()) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
- if (basePath.segmentCount() > 1 && project.isAccessible()) {
- return createJavaElementHyperlink(JavaCore.create(project), elementName, region);
- }
- }
- }
- // fallback to SSE-specific knowledge
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- String baseLocation = model.getBaseLocation();
- // URL fixup from the taglib index record
- if (baseLocation.startsWith("jar:/file:")) { //$NON-NLS-1$
- baseLocation = StringUtils.replace(baseLocation, "jar:/", "jar:"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /*
- * Handle opened TLD files from JARs on the Java Build Path by
- * finding a package fragment root for the same .jar file and
- * opening the class from there. Note that this might be from
- * a different Java project's build path than the TLD.
- */
- if (baseLocation.startsWith(JAR_FILE_PROTOCOL) && baseLocation.indexOf('!') > JAR_FILE_PROTOCOL.length()) {
- String baseFile = baseLocation.substring(JAR_FILE_PROTOCOL.length(), baseLocation.indexOf('!'));
- IPath basePath = new Path(baseFile);
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- try {
- if (projects[i].isAccessible() && projects[i].hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = JavaCore.create(projects[i]);
- if (javaProject.exists()) {
- IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);
- if (root != null) {
- return createJavaElementHyperlink(javaProject, elementName, region);
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
- else {
- IPath basePath = new Path(baseLocation);
- if (basePath.segmentCount() > 1) {
- return createJavaElementHyperlink(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0))), elementName, region);
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return null;
- }
-
- private boolean isJspJavaContent(IDocument document, IRegion region) {
- JSPTranslation translation = null;
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- IDOMModel xmlModel = null;
- if (model instanceof IDOMModel) {
- xmlModel = (IDOMModel) model;
- if (xmlModel != null) {
- final IDOMDocument xmlDoc = xmlModel.getDocument();
- final JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (adapter != null) {
- translation = adapter.getJSPTranslation();
- if (translation!=null) {
- int javaOffset = translation.getJavaOffset(region.getOffset());
- if (javaOffset > -1) {
- return true;
- }
- }
- }
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
-
- return false;
- }
-
- private IHyperlink createJavaElementHyperlink(IJavaProject javaProject, String elementName, IRegion region) {
- if (javaProject != null && javaProject.exists()) {
- try {
- IJavaElement element = javaProject.findType(elementName);
- if (element != null && element.exists()) {
- return new JavaElementHyperlink(region, element);
- }
- }
- catch (JavaModelException e) {
- // bad name, no link
- }
- }
- return null;
- }
-
- /*
- * (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) {
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
- // find hyperlink range for Java element
- IRegion hyperlinkRegion = region.getLength() > 0 ? region : selectQualifiedName(document, region.getOffset());
- if (isJspJavaContent(document, hyperlinkRegion)) { // Handled by JSPJavaHyperlinkDetector
- return null;
- }
- String name = null;
- try {
- name = document.get(hyperlinkRegion.getOffset(), hyperlinkRegion.getLength()).trim();
- }
- catch (BadLocationException e) {
- }
- if (name != null) {
- IHyperlink link = createHyperlink(name, hyperlinkRegion, document);
- if (link != null)
- return new IHyperlink[]{link};
- }
- }
-
- return null;
- }
-
- /**
- * Java always selects word when defining region
- *
- * @param document
- * @param anchor
- * @return IRegion
- */
- private IRegion selectQualifiedName(IDocument document, int anchor) {
-
- try {
- int offset = anchor;
- char c;
-
- while (offset >= 0) {
- c = document.getChar(offset);
- if (!Character.isJavaIdentifierPart(c) && c != '.')
- break;
- --offset;
- }
-
- int start = offset;
-
- offset = anchor;
- int length = document.getLength();
-
- while (offset < length) {
- c = document.getChar(offset);
- if (!Character.isJavaIdentifierPart(c) && 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/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 a057ed573d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.java.refactoring;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-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.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.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-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.text.edits.TextEditGroup;
-
-/**
- * <p>After a search is run with this {@link SearchRequestor} {@link #getChanges(RefactoringParticipant)}
- * can be called to get any new {@link Change}s that need to be created as a result of the search. If
- * {@link Change}s are already existing for the documents found then new {@link Change}s will not be
- * created for them, but the needed {@link TextEdit}s will be added to the existing {@link Change}s.</p>
- */
-public class BasicRefactorSearchRequestor extends SearchRequestor {
- /** 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);
-
- //if rename text is null then don't create an edit for it
- if(renameText != null) {
- // add it for the correct document
- addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
- }
- }
- }
-
- /**
- * @param searchDoc
- * @return the rename text or <code>null</code> if no edit should be created for the given match.
- * Such a case would be a match where nothing needs to be edited.
- */
- 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);
- }
- }
-
- /**
- * <p>This function is not safe because it does not check for existing {@link Change}s that
- * new {@link Change}s created by this method may conflict with. These conflicts can
- * cause indeterminate results when applied to documents. Long story short, don't
- * use this method any more.</p>
- *
- * @return all JSP changes for the search matches for the given Type, they may conflict
- * with already existing {@link Change}s
- *
- * @see #getChanges(RefactoringParticipant)
- *
- * @deprecated
- */
- 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()]);
- }
-
- /**
- * Gets new {@link Change}s created as a result of this {@link SearchRequestor}.
- * Any existing {@link TextChange}s that had new edits added to them will not be
- * returned.
- *
- * @param participant {@link RefactoringParticipant} to determine if there are already existing
- * {@link TextChange}s for the documents that this {@link SearchRequestor} found.
- * If existing
- * {@link TextChange}s are found then they will be used for any new edits, else new {@link TextChange}s
- * will be created.
- *
- * @return Any new {@link TextChange}s created by this {@link SearchRequestor}. If edits were
- * added to existing {@link TextChange}s then those existing {@link TextChange}s will not be
- * returned in this array.
- */
- public Change[] getChanges(RefactoringParticipant participant) {
-
- 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;
- Change change = createChange(javaDelegate, javaDelegate.getJspTranslation().getJspEdit(javaEdit), participant);
- changes.add(change);
- }
- }
- return (Change[])changes.toArray(new Change[changes.size()]);
- }
-
- /**
- * <p>This method is not safe because it does not take into consideration already existing
- * {@link Change}s and thus conflicts could occur that when applied create indeterminate
- * results in the target documents</p>
- *
- * @see #createChange(JavaSearchDocumentDelegate, TextEdit, RefactoringParticipant)
- *
- * @deprecated
- */
- 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 JSPRenameChange(searchDoc.getFile(), doc, edit, description);
- }
-
- /**
- * </p>If a {@link TextChange} does not already exist for the given {@link JavaSearchDocumentDelegate}
- * then a new one will be created with the given {@link TextEdit}. Otherwise the given {@link TextEdit}
- * will be added to a new group and added to the existing change and <code>null</code> will be returned.</p>
- *
- * @param searchDoc the {@link JavaSearchDocumentDelegate} that the <code>edit</code> will be applied to
- * @param edit the {@link TextEdit} that needs to be added to a new {@link TextChange} or appended to an
- * existing one
- * @param participant the {@link RefactoringParticipant} that knows about the existing {@link TextChange}s
- * @return a new {@link Change} if there was not one already existing for the document in question,
- * else <code>null</code>
- */
- private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit, RefactoringParticipant participant) {
- IDocument doc = searchDoc.getJspTranslation().getJspDocument();
- String description = getDescription();
-
- TextChange existingChange = participant.getTextChange(searchDoc.getFile());
- TextChange change = null;
- if(existingChange != null) {
- try {
- existingChange.addEdit(edit);
- }catch (MalformedTreeException e) {
- Logger.logException("MalformedTreeException while adding edit " + //$NON-NLS-1$
- edit + " to existing change " + change, e); //$NON-NLS-1$
- }
-
- TextEditGroup group = new TextEditGroup(description, edit);
- existingChange.addTextEditGroup(group);
- } else {
- change = new JSPRenameChange(searchDoc.getFile(), doc, edit, searchDoc.getFile().getName());
- TextEditGroup group = new TextEditGroup(description, edit);
- change.addTextEditGroup(group);
- }
-
- return change;
- }
-
- // 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/JSPFieldRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameParticipant.java
deleted file mode 100644
index bd9111e6bc..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameParticipant.java
+++ /dev/null
@@ -1,56 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaElement;
-
-/**
- * <p>Participant for renaming Java fields in JSP documents</p>
- *
- */
-public class JSPFieldRenameParticipant extends JSPRenameParticipant {
-
- /**
- * <p>Initializes the name of this participant to the name of the {@link IField}</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- boolean success = false;
- if(element instanceof IField) {
- super.fName = ((IField)element).getElementName();
- success = true;
- }
- return success;
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
- */
- protected boolean isLegalElementType(IJavaElement element) {
- return (element instanceof IField);
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
- */
- protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
- BasicRefactorSearchRequestor searchRequestor = null;
-
- if(isLegalElementType(element)) {
- searchRequestor = new JSPFieldRenameRequestor(element, newName);
- }
-
- return searchRequestor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameRequestor.java
deleted file mode 100644
index 9ccdaf64de..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPFieldRenameRequestor.java
+++ /dev/null
@@ -1,44 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * <p>Reactor search requestor to rename Java fields in JSP documents</p>
- *
- */
-public class JSPFieldRenameRequestor extends BasicRefactorSearchRequestor {
-
- /**
- * <p>Constructor</p>
- *
- * @param element the old field name
- * @param newName the new field name
- */
- public JSPFieldRenameRequestor(IJavaElement element, String newName) {
- super(element, newName);
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
- protected String getDescription() {
- String fieldName = getElement().getElementName();
- String newName = getNewName();
- String description = NLS.bind(JSPUIMessages.BasicRefactorSearchRequestor_7, (new String[]{fieldName, newName})); //$NON-NLS-1$
- return description;
- }
-
-}
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 a9a7097522..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ /dev/null
@@ -1,73 +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.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;
-
-/**
- * <p><b>Note:</b> This class is not used internally any longer and will
- * be removed at some point.</p>
- *
- * @deprecated
- */
-public class JSPMethodRenameChange extends Change {
-
- /**
- * @deprecated
- */
- 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 f422113e4e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ /dev/null
@@ -1,63 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-
-/**
- * {@link JSPRenameParticipant} used to update JSP documents when a Java method is renamed
- */
-public class JSPMethodRenameParticipant extends JSPRenameParticipant {
- /**
- * Initializes the name of this participant to the source of the given {@link IMethod}
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- boolean success = false;
- try {
- if(element instanceof IMethod) {
- super.fName = ((IMethod) element).getSource();
- success = true;
- }
- } catch (JavaModelException e) {
- Logger.logException(e);
- }
- return success;
- }
-
- /**
- * @return a {@link JSPMethodRenameRequestor}
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
- */
- protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
- BasicRefactorSearchRequestor searchRequestor = null;
-
- if(isLegalElementType(element)) {
- searchRequestor = new JSPMethodRenameRequestor(element, newName);
- }
-
- return searchRequestor;
- }
-
- /**
- * <p>Legal types are:
- * <ul><li>{@link IMethod}</li></ul></p>
- *
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
- */
- protected boolean isLegalElementType(IJavaElement element) {
- return (element instanceof IMethod);
- }
-}
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/JSPMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
deleted file mode 100644
index 8763bf3600..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
+++ /dev/null
@@ -1,253 +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.java.refactoring;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.search.SearchRequestor;
-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.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
-import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
-import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * Abstract {@link ISharableParticipant} {@link MoveParticipant} for editing JSP documents
- */
-public abstract class JSPMoveParticipant extends MoveParticipant implements ISharableParticipant {
-
- /**
- * The name of this participant.
- * Should be initialized by implementers in {@link #initialize(Object)}
- */
- protected String fName;
-
- /**
- * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
- * and their associated {@link MoveArguments} that have been added to
- * this {@link ISharableParticipant}.
- *
- * key: {@link String} - Element name<br/>
- * value: {@link ElementAndArgumentsPair}
- */
- private Map fElementAndArgumentPairs;
-
- /**
- * When new changes are being safely created {@link #getTextChange(Object)}
- * is called first to check for existing {@link TextChange}s, but those
- * results do not usually include the changes that have been created thus far
- * locally by this {@link MoveParticipant}. This is to keep track of those
- * changes so the overridden version of {@link #getTextChange(Object)}s will take
- * these local {@link TextChange}s into account.
- */
- private Map fLocalTextChanges;
-
- /**
- * Groups an {@link IJavaElement} with its associated {@link MoveArguments}
- * that have been added to this {@link ISharableParticipant}
- */
- private class ElementAndArgumentsPair {
- protected IJavaElement fElement;
- protected MoveArguments fArgs;
-
- public ElementAndArgumentsPair(IJavaElement element, MoveArguments args) {
- this.fElement = element;
- this.fArgs = args;
- }
- }
-
- /**
- * <p>Do local initialization. This is done here instead of in an implementation of
- * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
- * of this class are not expected to have to call super when they implement
- * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
- * org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
- * org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
- */
- public boolean initialize(RefactoringProcessor processor, Object element,
- RefactoringArguments arguments) {
-
- this.fElementAndArgumentPairs = new HashMap();
- this.addElement(element, arguments);
- this.fLocalTextChanges = new HashMap();
- this.fName = ""; //$NON-NLS-1$
-
- return super.initialize(processor, element, arguments);
- }
-
- /**
- * <p>When an element is added to this {@link ISharableParticipant} it must be
- * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
- * and the given arguments must be {@link MoveArguments}. Also the new <code>element</code>
- * will not be added if and {@link IJavaElement} of that name has already been added to
- * this {@link ISharableParticipant}. This protects against elements being added more
- * then once.</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
- * org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
- */
- public void addElement(Object element, RefactoringArguments arguments) {
- if(element instanceof IJavaElement &&
- isLegalElementType((IJavaElement)element) &&
- arguments instanceof MoveArguments) {
-
- //don't add elements that have already been added
- String elementName = ((IJavaElement)element).getElementName();
- if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
- this.fElementAndArgumentPairs.put(elementName,
- new ElementAndArgumentsPair((IJavaElement)element, (MoveArguments)arguments));
- }
- }
- }
-
- /**
- * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
- *
- * @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) {
- return new RefactoringStatus();
- }
-
- /**
- *
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
- this.getTextChange(""); //$NON-NLS-1$
-
- //create one multi change to contain all new created changes
- CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
-
- //for each element get the changes for it and add it to the multi change
- Iterator iter = fElementAndArgumentPairs.values().iterator();
- while(iter.hasNext()) {
- ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
-
- Object dest = elemArgsPair.fArgs.getDestination();
-
- if(dest instanceof IPackageFragment) {
- Change[] changes = createChangesFor(elemArgsPair.fElement, ((IPackageFragment)dest).getElementName(), pm);
-
- /* add all new text changes to the local list of text changes so that
- * future iterations through the while loop will be aware of already
- * existing changes
- */
- for(int i = 0; i < changes.length; ++i) {
- if(changes[i] instanceof TextChange) {
- fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
- }
- }
-
- if(changes.length > 0) {
- multiChange.addAll(changes);
- }
- }
- }
-
- //unless there are actually new changes return null
- Change result = null;
- if(multiChange.getChildren().length > 0) {
- result = multiChange;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- return fName;
- }
-
- /**
- * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
- * {@link #createChange(IProgressMonitor)}.</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
- */
- public TextChange getTextChange(Object element) {
- TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
- if(existingChange == null) {
- existingChange = super.getTextChange(element);
- }
-
- return existingChange;
- }
-
- /**
- * Using a {@link SearchRequestor} create new changes.
- *
- * @param element the {@link IJavaElement} to create new changes for
- * @param newName the new name of the given {@link IJavaElement}
- *
- * @return any newly created {@link Change}s. It is important to note
- * that while no NEW {@link Change}s maybe returned it is possible that
- * new {@link TextEdit}s will still added to existing {@link Change}s.
- */
- protected Change[] createChangesFor(IJavaElement element, String newName, IProgressMonitor monitor) {
- Change[] changes;
- BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
- if(requestor != null) {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
- support.searchRunnable(element, new JSPSearchScope(), requestor, monitor);
- changes = requestor.getChanges(this);
- } else {
- changes = new Change[0];
- }
-
- return changes;
- }
-
- /**
- * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
- * with the implementers {@link JSPMoveParticipant}.</p>
- *
- * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
- * @param newName the new name of the {@link IJavaElement} to use when
- * creating the {@link BasicRefactorSearchRequestor}
- *
- * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
- */
- protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
-
- /**
- * @param element check that this {@link IJavaElement} is of the type the
- * implementers {@link JSPMoveParticipant} is configured to deal with.
- *
- * @return <code>true</code> if the given {@link IJavaElement} is of a type
- * the implementers {@link JSPMoveParticipant} is configured to deal with,
- * <code>false</code> otherwise.
- */
- protected abstract boolean isLegalElementType(IJavaElement element);
-}
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 bd96a25b0e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ /dev/null
@@ -1,74 +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.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;
-
-/**
- * <p><b>Note:</b> This class is not used internally any longer and will
- * be removed at some point.</p>
- *
- * @deprecated
- */
-public class JSPPackageRenameChange extends Change {
-
- /**
- * @deprecated
- */
- 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 e322ba4cc1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ /dev/null
@@ -1,57 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-
-/**
- * {@link JSPRenameParticipant} used to update JSP documents when a Java package is renamed
- */
-public class JSPPackageRenameParticipant extends JSPRenameParticipant {
- /**
- * Initializes the name of this participant to the name of the {@link IPackageFragment}
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- boolean success = false;
- if(element instanceof IPackageFragment) {
- super.fName = ((IPackageFragment)element).getElementName();
- success = true;
- }
- return success;
- }
-
- /**
- * @return a {@link JSPPackageRenameRequestor}
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
- */
- protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
- BasicRefactorSearchRequestor searchRequestor = null;
-
- if(isLegalElementType(element)) {
- searchRequestor = new JSPPackageRenameRequestor(element, newName);
- }
-
- return searchRequestor;
- }
-
- /**
- * <p>Legal types are:
- * <ul><li>{@link IPackageFragment}</li></ul></p>
- *
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(java.lang.Object)
- */
- protected boolean isLegalElementType(IJavaElement element) {
- return (element instanceof IPackageFragment);
- }
-}
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/JSPRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
deleted file mode 100644
index bdbbb45971..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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 org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-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.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.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-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;
-
-/**
- * {@link DocumentChange} implementation for JSP Documents
- */
-public class JSPRenameChange extends DocumentChange {
-
- /**
- * The JSP file this {@link Change} will change
- */
- protected IFile fJSPFile = null;
-
- /**
- * The description of this change
- */
- private String fDescription;
-
- /**
- * Create a new {@link JSPRenameChange}
- *
- * @param jspFile
- * @param jspDoc
- * @param edit
- * @param description
- */
- public JSPRenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
- super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
- MultiTextEdit parentEdit = new MultiTextEdit();
- parentEdit.addChild(edit);
- super.setEdit(parentEdit);
- this.fJSPFile = jspFile;
- this.fDescription = description;
- }
-
- /**
- * Create a new {@link JSPRenameChange} by shallow copying the given
- * original {@link JSPRenameChange}.
- *
- * @param originalChange the {@link JSPRenameChange} to shallow copy to create
- * a new {@link JSPRenameChange}
- */
- public JSPRenameChange(JSPRenameChange originalChange) {
- super(JSPUIMessages.BasicRefactorSearchRequestor_6, originalChange.getJSPDoc());
- super.setEdit(originalChange.getEdit());
- this.fJSPFile = originalChange.fJSPFile;
- this.fDescription = originalChange.fDescription;
- }
-
- /**
- * <p>Currently will always be {@link RefactoringStatus#OK}</p>
- *
- * @see org.eclipse.ltk.core.refactoring.DocumentChange#isValid(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
- return new RefactoringStatus();
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.TextChange#getPreviewDocument(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
- IDocument copyDoc = new Document(this.getJSPDoc().get());
- try {
- super.getEdit().apply(copyDoc);
- }
- catch (MalformedTreeException e) {
- // ignore
- }
- catch (BadLocationException e) {
- // ignore
- }
- return copyDoc;
- }
-
- /**
- * Performs this change and returns a {@link JSPRenameUndoChange} to undo the change.
- *
- * @return a {@link JSPRenameUndoChange} to undo this performed {@link Change}
- * @see org.eclipse.ltk.core.refactoring.TextChange#perform(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change perform(IProgressMonitor pm) throws CoreException {
- Change undoChange = null;
- try {
- //apply edit
- undoChange = super.perform(pm);
- undoChange = new JSPRenameUndoChange(this, undoChange);
-
- //save the model
- saveJSPFile(this.fJSPFile, this.getJSPDoc());
-
- } catch (MalformedTreeException e) {
- Logger.logException(e);
- }
- return undoChange;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.TextEditBasedChange#getName()
- */
- public String getName() {
- return this.fDescription;
- }
-
- /**
- * <p>The modified element is the JSP {@link IFile} that this {@link Change}
- * changes.</p>
- *
- * @see org.eclipse.ltk.core.refactoring.DocumentChange#getModifiedElement()
- */
- public Object getModifiedElement() {
- return this.fJSPFile;
- }
-
- /**
- * <p>Convenience method to get the JSP {@link IDocument} that this {@link Change}
- * edits.</p>
- *
- * @return the JSP {@link IDocument} that this {@link Change} edits
- */
- protected IDocument getJSPDoc() {
- IDocument doc = null;
- try {
- doc = this.acquireDocument(null);
- } catch(CoreException e) {
- //ignore, DocumentChange.acquireDocument will never throw it
- }
-
- return doc;
- }
-
- /**
- * <p>Saves a JSP file. If the file is not open in an editor then modifies the file directly, else
- * if the file is open an editor then run the save method on the open editor.</p>
- *
- * @param jspFile the {@link IFile} to save
- * @param jspDoc the {@link IDocument} with the new content for the given {@link IFile}
- */
- protected static void saveJSPFile(IFile jspFile, IDocument jspDoc) {
- //if not open then save model
- final ITextEditor editor = findOpenEditor(jspDoc);
- try {
- /* if no open editor then save the document to the file
- * else save the open editor
- */
- if(editor == null) {
- SaveJspFileOp op = new SaveJspFileOp(jspFile, jspDoc);
- op.run(JSPSearchSupport.getInstance().getProgressMonitor());
- } else {
- //editor save must be done on UI thread
- IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InterruptedException {
- editor.doSave(pm);
- }
- };
- PlatformUI.getWorkbench().getProgressService().runInUI(editor.getSite().getWorkbenchWindow(), runnable, null);
- }
- } catch (InvocationTargetException e) {
- Logger.logException(e);
- } catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * <p>Checks if a document is open in an editor and returns it if it is</p>
- *
- * @param jspDoc check to see if this {@link IDocument} is currently open in an editor
- * @return the open {@link ITextEditor} associated with the given {@link IDocument} or
- * <code>null</code> if none can be found.
- */
- private static ITextEditor findOpenEditor(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(false);
- if (editor != null) { // editor might not be instantiated
- // 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 (ITextEditor) o;
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Workspace operation to perform save on model for updated documents.
- * Should only be done on models not open in an editor.
- */
- private static 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
- }
- }
- }
- }
-} \ No newline at end of file
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/JSPRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
deleted file mode 100644
index 5bbf86f500..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-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.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * Abstract {@link ISharableParticipant} {@link RenameParticipant} for editing JSP documents
- */
-public abstract class JSPRenameParticipant extends RenameParticipant implements ISharableParticipant {
- /**
- * The name of this participant.
- * Should be initialized by implementers in {@link #initialize(Object)}
- */
- protected String fName;
-
- /**
- * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
- * and their associated {@link RenameArguments} that have been added to
- * this {@link ISharableParticipant}.
- *
- * key: {@link String} - Element name<br/>
- * value: {@link ElementAndArgumentsPair}
- */
- private Map fElementAndArgumentPairs;
-
- /**
- * When new changes are being safely created {@link #getTextChange(Object)}
- * is called first to check for existing {@link TextChange}s, but those
- * results do not usually include the changes that have been created thus far
- * locally by this {@link RenameParticipant}. This is to keep track of those
- * changes so the overridden version of {@link #getTextChange(Object)}s will take
- * these local {@link TextChange}s into account.
- */
- private Map fLocalTextChanges;
-
- /**
- * Groups an {@link IJavaElement} with its associated {@link RenameArguments}
- * that have been added to this {@link ISharableParticipant}
- */
- private class ElementAndArgumentsPair {
- protected IJavaElement fElement;
- protected RenameArguments fArgs;
-
- public ElementAndArgumentsPair(IJavaElement element, RenameArguments args) {
- this.fElement = element;
- this.fArgs = args;
- }
- }
-
- /**
- * <p>Do local initialization. This is done here instead of in an implementation of
- * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
- * of this class are not expected to have to call super when they implement
- * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
- *
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
- * org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
- * org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
- */
- public boolean initialize(RefactoringProcessor processor, Object element,
- RefactoringArguments arguments) {
-
- this.fElementAndArgumentPairs = new HashMap();
- this.addElement(element, arguments);
- this.fLocalTextChanges = new HashMap();
- this.fName = ""; //$NON-NLS-1$
-
- return super.initialize(processor, element, arguments);
- }
-
- /**
- * <p>When an element is added to this {@link ISharableParticipant} it must be
- * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
- * and the given arguments must be {@link RenameArguments}. Also the new <code>element</code>
- * will not be added if and {@link IJavaElement} of that name has already been added to
- * this {@link ISharableParticipant}. This protects against elements being added more
- * then once.</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
- * org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
- */
- public void addElement(Object element, RefactoringArguments arguments) {
- if(element instanceof IJavaElement &&
- isLegalElementType((IJavaElement)element) &&
- arguments instanceof RenameArguments) {
-
- //don't add elements that have already been added
- String elementName = ((IJavaElement)element).getElementName();
- if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
- this.fElementAndArgumentPairs.put(elementName,
- new ElementAndArgumentsPair((IJavaElement)element, (RenameArguments)arguments));
- }
- }
- }
-
- /**
- * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
- *
- * @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) {
- return new RefactoringStatus();
- }
-
- /**
- *
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
- this.getTextChange(""); //$NON-NLS-1$
-
- //create one multi change to contain all new created changes
- CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
-
- //for each element get the changes for it and add it to the multi change
- Iterator iter = fElementAndArgumentPairs.values().iterator();
- while(iter.hasNext()) {
- ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
- Change[] changes = createChangesFor(elemArgsPair.fElement, elemArgsPair.fArgs.getNewName(), pm);
-
- /* add all new text changes to the local list of text changes so that
- * future iterations through the while loop will be aware of already
- * existing changes
- */
- for(int i = 0; i < changes.length; ++i) {
- if(changes[i] instanceof TextChange) {
- fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
- }
- }
-
- if(changes.length > 0) {
- multiChange.addAll(changes);
- }
- }
-
- //unless there are actually new changes return null
- Change result = null;
- if(multiChange.getChildren().length > 0) {
- result = multiChange;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- return fName;
- }
-
- /**
- * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
- * {@link #createChange(IProgressMonitor)}.</p>
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
- */
- public TextChange getTextChange(Object element) {
- TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
- if(existingChange == null) {
- existingChange = super.getTextChange(element);
- }
-
- return existingChange;
- }
-
- /**
- *
- * @param element the {@link IJavaElement} to create new changes for
- * @param newName the new name of the given {@link IJavaElement}
- *
- * @return any newly created {@link Change}s. It is important to note
- * that while no NEW {@link Change}s maybe returned it is possible that
- * new {@link TextEdit}s will still added to existing {@link Change}s.
- */
- protected Change[] createChangesFor(IJavaElement element, String newName, IProgressMonitor monitor) {
- Change[] changes;
- BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
- if(requestor != null) {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
- support.searchRunnable(element, new JSPSearchScope(), requestor, monitor);
- changes = requestor.getChanges(this);
- } else {
- changes = new Change[0];
- }
-
- return changes;
- }
-
- /**
- * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
- * with the implementers {@link JSPRenameParticipantParticipant}.</p>
- *
- * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
- * @param newName the new name of the {@link IJavaElement} to use when
- * creating the {@link BasicRefactorSearchRequestor}
- *
- * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
- */
- protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
-
- /**
- * @param element check that this {@link IJavaElement} is of the type the
- * implementers {@link JSPRenameParticipant} is configured to deal with.
- *
- * @return <code>true</code> if the given {@link IJavaElement} is of a type
- * the implementers {@link JSPRenameParticipant} is configured to deal with,
- * <code>false</code> otherwise.
- */
- protected abstract boolean isLegalElementType(IJavaElement element);
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
deleted file mode 100644
index a34e67d85c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
+++ /dev/null
@@ -1,73 +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.java.refactoring;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * <p>When undoing {@link JSPRenameChange}s need to be sure not only to perform
- * the UndoDocumentChange but to also save the JSP file otherwise one of two
- * unwanted things could happen:
- * <ul><li>an open editor with the file could be marked dirty</li>
- * <li>or if the changed file is not open in an editor then the changes will
- * not be saved to the file and thus not persist.</li></ul></p>
- *
- * <p>Therefore a {@link JSPRenameUndoChange} wraps another {@link Change} which
- * is considered the "undo change". When a perform is called on {@link JSPRenameUndoChange}
- * the perform is called on the wrapped "undo change", another {@link JSPRenameUndoChange}
- * is created as the "redo change" from the return of the perform on the "undo change"
- * and then most importantly the updated {@link IDocument} is saved to the {@link IFile}
- * if the JSP file is not open in an editor, or a save is called on the open {@link ITextEditor}
- * that is editing the changed JSP file.</p>
- */
-public class JSPRenameUndoChange extends JSPRenameChange {
- /**
- * The "undo change" being wrapped
- */
- private Change fUndoChange;
-
- /**
- * <p>Create the {@link JSPRenameUndoChange} from the {@link JSPRenameChange}
- * that created the undo change and the undo change itself.</p>
- *
- * @param originalChange the {@link JSPRenameChange} that created the <code>undoChange</code>
- * @param undoChange the undo change to be wrapped by this {@link JSPRenameUndoChange}
- */
- public JSPRenameUndoChange(JSPRenameChange originalChange, Change undoChange) {
- super(originalChange);
- fUndoChange = undoChange;
- }
-
- /**
- * <p>See {@link JSPRenameUndoChange} class description for more details.</p>
- *
- * @return a {@link JSPRenameUndoChange} wrapping the "redo change" returned by the
- * call to {@link Change#perform(IProgressMonitor)} on the wrapped "undo change".
- *
- * @see JSPRenameUndoChange
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameChange#perform(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change perform(IProgressMonitor pm) throws CoreException {
- //apply edit
- Change redoChange = fUndoChange.perform(pm);
- redoChange = new JSPRenameUndoChange(this, redoChange);
-
- //save the file
- saveJSPFile(this.fJSPFile, this.getJSPDoc());
-
- return redoChange;
- }
-}
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 b60baadad4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
+++ /dev/null
@@ -1,72 +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.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;
-
-/**
- * <p><b>Note:</b> This class is not used internally any longer and will
- * be removed at some point.</p>
- *
- * @deprecated
- */
-public class JSPTypeMoveChange extends Change {
-
- /**
- * @deprecated
- */
- 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 4ac0bb05c5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ /dev/null
@@ -1,61 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IType;
-
-/**
- * {@link JSPMoveParticipant} used to update JSP documents when a Java type is moved.
- */
-public class JSPTypeMoveParticipant extends JSPMoveParticipant {
-
- /**
- * Initializes the name of this participant to the name of the {@link IType}
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- boolean success = false;
- if(element instanceof IType) {
- super.fName =((IType)element).getElementName();
- success = true;
- }
- return success;
- }
-
- /**
- * @return a {@link JSPTypeMoveRequestor}
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMoveParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
- */
- protected BasicRefactorSearchRequestor getSearchRequestor(
- IJavaElement element, String newName) {
-
- BasicRefactorSearchRequestor searchRequestor = null;
-
- if(isLegalElementType(element)) {
- searchRequestor = new JSPTypeMoveRequestor(element, newName);
- }
-
- return searchRequestor;
- }
-
- /**
- * <p>Legal types are:
- * <ul><li>{@link IType}</li></ul></p>
- *
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
- */
- protected boolean isLegalElementType(IJavaElement element) {
- return (element instanceof IType);
- }
-
-}
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 bd9c8c07f9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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);
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getRenameText(org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate, org.eclipse.jdt.core.search.SearchMatch)
- */
- 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$
- }
-
- //if the rename text is the same as the match text then, don't want to bother renaming anything
- if(renameText.equals(matchText)) {
- renameText = null;
- }
-
- 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 e5ea96c03c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ /dev/null
@@ -1,74 +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.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;
-
-/**
- * <p><b>Note:</b> This class is not used internally any longer and will
- * be removed at some point.</p>
- *
- * @deprecated
- */
-public class JSPTypeRenameChange extends Change {
-
- /**
- * @deprecated
- */
- 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 db2e95b504..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ /dev/null
@@ -1,60 +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.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IType;
-
-/**
- * {@link JSPRenameParticipant} used to update JSP documents when a Java type is renamed
- */
-public class JSPTypeRenameParticipant extends JSPRenameParticipant {
-
-
- /**
- * Initializes the name of this participant to the name of the {@link IType}
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- boolean success = false;
- if(element instanceof IType) {
- super.fName = ((IType)element).getElementName();
- success = true;
- }
- return success;
- }
-
- /**
- * @return a {@link JSPTypeRenameRequestor}
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
- */
- protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
-
- BasicRefactorSearchRequestor searchRequestor = null;
-
- if(isLegalElementType(element)) {
- searchRequestor = new JSPTypeRenameRequestor((IType)element, newName);
- }
-
- return searchRequestor;
- }
-
- /**
- * <p>Legal types are:
- * <ul><li>{@link IType}</li></ul></p>
-
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
- */
- protected boolean isLegalElementType(IJavaElement element) {
- return (element instanceof IType);
- }
-}
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 a3417538ad..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.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 java.text.MessageFormat;
-
-import org.eclipse.jdt.core.IJavaElement;
-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();
- IJavaElement parent = getType().getParent();
- String parentName = (parent != null) ? parent.getElementName() : null;
- 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
- // else if starts with parent name such as "MyClass.Enum" then need to add the parent name as well
- if(trans.isImport(javaMatch.getOffset()) || isFullyQualified(matchText)) {
- if(!pkg.equals("")) //$NON-NLS-1$
- renameText = pkg + "." + renameText; //$NON-NLS-1$
- } else if(parentName != null && matchText.startsWith(parentName)) {
- renameText = parentName + "." + 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 20399f96b4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.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.IField;
-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;
- case IJavaElement.FIELD:
- renameSupport = RenameSupport.create((IField)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 != null) {
- ITextEditor editor = (ITextEditor) ((fEditor instanceof ITextEditor) ? fEditor : fEditor.getAdapter(ITextEditor.class));
- if (editor != null) {
- IJavaElement[] elements = JSPJavaSelectionProvider.getSelection(editor);
- 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 8897deb294..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,37 +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);
- 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 50fff8f4d8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,124 +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.search.ui.NewSearchUI;
-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.sse.core.internal.provisional.text.ITextRegion;
-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 {
-
- public boolean findOccurrences(IDocument document, ITextSelection textSelection, IFile file) {
- boolean findOccurrences = false;
-
- // determine if action should be enabled or not
- if (document instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) document;
- IStructuredDocumentRegion sdRegion = structuredDocument.getRegionAtCharacterOffset(textSelection.getOffset());
- if (sdRegion != null) {
- ITextRegion r = sdRegion.getRegionAtCharacterOffset(textSelection.getOffset());
- if (r != null) {
- String type = r.getType();
- if (enabledForRegionType(type)) {
- String matchText = sdRegion.getText(r);
-
- if (matchText != null && type != null) {
- JSPSearchQuery searchQuery = (JSPSearchQuery) getSearchQuery(file, structuredDocument, matchText, type, textSelection);
- findOccurrences = true;
- if (searchQuery != null) {
- if(searchQuery.getSearchText() == null || searchQuery.getSearchText().length() == 0)
- findOccurrences = false;
- else
- {
- // first of all activate the view
- NewSearchUI.activateSearchResultView();
-
- if (searchQuery.canRunInBackground())
- NewSearchUI.runQueryInBackground(searchQuery);
- else
- NewSearchUI.runQueryInForeground(null, searchQuery);
- }
- }
- }
- }
- }
- }
- }
- return findOccurrences;
- }
-
- 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 e39e4beae8..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 super.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 76399eb11a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.text.MessageFormat;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.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);
- super.setResult(new JSPOccurrencesSearchResult(this));
- this.fElement = element;
- }
-
- public IJavaElement getJavaElement() {
- return this.fElement;
- }
-
- // for access by inner class
- public JSPSearchQuery getInstance() {
- return this;
- }
-
- protected IStatus doQuery(IProgressMonitor monitor) {
- 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()), monitor);
- }
- 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 label = JSPUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
- String[] args = {getSearchText(), "" + super.getMatchCount(), getFilename()};
- return MessageFormat.format(label, args);
- }
-
- private String getFilename() {
- String filename = JSPUIMessages.OccurrencesSearchQuery_2;
- if(getFile() != null)
- filename = getFile().getName();
- return filename;
- }
-
- protected String getSearchText() {
- if(fElement != null)
- return fElement.getElementName();
- return "";
- }
-
- public boolean canRerun() {
-
- return false;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
- */
- public boolean canRunInBackground() {
- return true;
- }
-}
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 1cd9d31a43..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.java.search.JSPSearchRequestor;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-
-/**
- * @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 {
-
- if(shouldSupplyJSPSearchResultsToJavaSearch()) {
- //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, monitor);
-
- }
- 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,
- monitor);
- }
- }
- }
-
- /**
- * @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();
- }
-
- private boolean shouldSupplyJSPSearchResultsToJavaSearch() {
- return JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
deleted file mode 100644
index 24b57c4dea..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.preferences;
-/*******************************************************************************
- * 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
- *******************************************************************************/
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
-
-/**
- * <p>The readable and writable completion proposal categories configuration
- * for the JSP content type</p>
- */
-public class JSPCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
-
- /** the ID of the preference page where users can change the preferences */
- private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.jsp.contentassist"; //$NON-NLS-1$
-
- /**
- * <p>Creates the configuration</p>
- */
- public JSPCompletionProposalCategoriesConfiguration() {
- //nothing to do.
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
- */
- public boolean hasAssociatedPropertiesPage() {
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
- */
- public String getPropertiesPageID() {
- return PREFERENCES_PAGE_ID;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
- */
- protected String getShouldNotDisplayOnDefaultPagePrefKey() {
- return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
- */
- protected String getShouldNotDisplayOnOwnPagePrefKey() {
- return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
- }
-
- protected String getPageSortOrderPrefKey() {
- return JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
- */
- protected String getDefaultPageSortOrderPrefKey() {
- return JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
- }
-}
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 8ae90cca48..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ColorRegistry;
-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 different language)
- */
- store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
-
- // set default new jsp tag file template to use in new tag file wizard
- store.setDefault(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.simpletag"); //$NON-NLS-1$
-
- store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, true);
- store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, true);
- store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
- store.setDefault(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH, true);
- store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
- store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
-
- // Defaults for Content Assist preference page
- store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
- store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
- store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
- "org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
- "org.eclipse.wst.css.ui.proposalCategory.css\0" +
- "org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
- "org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
- "org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
- "org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
- store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
- "org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
- "org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
- "org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
- "org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
- "org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
- "org.eclipse.wst.css.ui.proposalCategory.css");
- store.setDefault(JSPUIPreferenceNames.AUTO_IMPORT_INSERT, 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 e6176c25fa..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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 initial template ID to be used in the new JSP file wizard. In the absence
- * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
- */
- public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
-
- /**
- * The key to store the last template name used in new JSP Tag 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_TAG_FILE_TEMPLATE_NAME = "newTagFileTemplateName"; //$NON-NLS-1$
-
- /**
- * The initial template ID to be used in the new JSP file wizard. In the absence
- * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
- */
- public static final String NEW_TAG_FILE_TEMPLATE_ID = "newTagFileTemplateId"; //$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$
-
- /**
- * The key to store the option for auto-completing JSP comments after entering
- * <code>&lt;%--</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_COMMENTS = "typingCompleteComments"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing strings (" and ') while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing brackets ([ and () while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
-
- public static final String SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH = "supplyJSPSearchResultsToJavaSearch"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), ordered is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "jsp_content_assist_display_on_default_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), order is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "jsp_content_assist_display_on_own_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "jsp_content_assist_own_page_sort_order"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "jsp_content_assist_default_page_sort_order"; //$NON-NLS-1$
-
- /**
- * <p>preference key to store the option for auto insertion of page imports</p>
- *
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String AUTO_IMPORT_INSERT = "autoImportinsertion"; //$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 3d9615bfce..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * 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.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);
- 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 " + getProjectSettingsKey() + " (" + 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 " + getProjectSettingsKey() + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- 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/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/JSPContentAssistPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
deleted file mode 100644
index 66c2de9f44..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
+++ /dev/null
@@ -1,175 +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.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.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-
-/**
- * <p>Defines the preference page for allowing the user to change the content
- * assist preferences</p>
- */
-public class JSPContentAssistPreferencePage extends AbstractPreferencePage implements
- IWorkbenchPreferencePage {
-
- private static final String JSP_CONTENT_TYPE_ID = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
-
- /* Checkbox to store Auto Insertion preference */
- private Button fAutoImport;
-
- /** configuration block for changing preference having to do with the content assist categories */
- private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
-
- createContentsForAutoInsertionGroup(composite);
- createContentsForCyclingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
- */
- protected void performDefaults() {
- performDefaultsForAutoInsertionGroup();
- performDefaultsForCyclingGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- initializeValuesForAutoInsertionGroup();
- initializeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- storeValuesForAutoInsertionGroup();
- storeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * <p>Create the contents for the content assist Auto Insertion preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForAutoInsertionGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(JSPUIMessages.JSPCodeAssist_Insertion);
-
- fAutoImport = createCheckBox(group, JSPUIMessages.JSPCodeAssist_Auto_Import);
- ((GridData) fAutoImport.getLayoutData()).horizontalSpan = 2;
-
-
- }
-
- /**
- * <p>Create the contents for the content assist cycling preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForCyclingGroup(Composite parent) {
- ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(JSP_CONTENT_TYPE_ID);
-
- if(configurationWriter != null) {
- fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(JSP_CONTENT_TYPE_ID, configurationWriter);
- fConfigurationBlock.createContents(parent, JSPUIMessages.Cycling_UI);
- } else {
- Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
- " specified for the JSP content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
- " preference block for editing proposal categories preferences."); //$NON-NLS-1$
- }
- }
-
-
- /**
- * <p>Store the values for the auto insertion group</p>
- */
- private void storeValuesForAutoInsertionGroup() {
- getPreferenceStore().setValue(JSPUIPreferenceNames.AUTO_IMPORT_INSERT, (fAutoImport != null) ? fAutoImport.getSelection() : false);
- }
-
- /**
- * <p>Store the values for the cycling group</p>
- */
- private void storeValuesForCyclingGroup() {
- if (fConfigurationBlock != null) {
- fConfigurationBlock.storeValues();
- }
- }
-
- /**
- * <p>Initialize the values for the auto insertion group</p>
- */
- private void initializeValuesForAutoInsertionGroup() {
- initCheckbox(fAutoImport, JSPUIPreferenceNames.AUTO_IMPORT_INSERT);
- }
-
- /**
- * <p>Initialize the values for the cycling group</p>
- */
- private void initializeValuesForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.initializeValues();
- }
- }
-
- /**
- * <p>Load the defaults for the auto activation group</p>
- */
- private void performDefaultsForAutoInsertionGroup() {
- defaultCheckbox(fAutoImport, JSPUIPreferenceNames.AUTO_IMPORT_INSERT);
- }
-
- /**
- * <p>Load the defaults of the cycling group</p>
- */
- private void performDefaultsForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.performDefaults();
- }
- }
-}
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 1dd04258f4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ /dev/null
@@ -1,112 +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.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.preferences.JSPUIPreferenceNames;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class JSPFilesPreferencePage extends XMLFilesPreferencePage {
- private Button fJSPSearchToJavaSearchButton;
-
- /**
- * <p><b>NOTE: </b>originally copied from {@link XMLFilesPreferencePage#createControl(Composite)}</p>
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite scrolledComposite = createScrolledComposite(parent);
- createContentsForCreatingGroup(scrolledComposite);
- createContentsForSearchGroup(scrolledComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
-
- return scrolledComposite;
- }
-
- /**
- * @param parent
- */
- private void createContentsForSearchGroup(Composite parent) {
- Group group = createGroup(parent, 1);
- group.setText(JSPUIMessages.JSPFilesPreferencePage_Search_group);
- fJSPSearchToJavaSearchButton = createCheckBox(group, JSPUIMessages.JSPFilesPreferencePage_Supply_JSP_search_to_Java_search);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- super.initializeValues();
- initCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- defaultCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#storeValues()
- */
- protected void storeValues() {
- super.storeValues();
- getPreferenceStore().setValue(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH,
- (fJSPSearchToJavaSearchButton != null) ? fJSPSearchToJavaSearchButton.getSelection() : false);
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getContentType()
- */
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#doSavePreferenceStore()
- */
- protected void doSavePreferenceStore() {
- JSPCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return JSPCorePlugin.getDefault().getPluginPreferences();
- }
-}
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 8ea7515cd9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
+++ /dev/null
@@ -1,877 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.AbstractSyntaxColoringPage;
-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 AbstractSyntaxColoringPage 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;
- private ISourceViewer fPreviewViewer;
-
-
- // 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);
- fForegroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Foreground_Color_Selector_Button;
- }
- });
-
- 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);
- fBackgroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Background_Color_Selector_Button;
- }
- });
-
- 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:"
- fPreviewViewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = fPreviewViewer.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());
- initializeSourcePreviewColors(fPreviewViewer);
- fPreviewViewer.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;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSyntaxColoringPage#getSourcePreviewViewer()
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return fPreviewViewer;
- }
-
- 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_EQUALS);
- 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_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- 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_EQUALS, XMLUIMessages.Attribute_Equals_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 e5537ee31e..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);
- 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 4605944e16..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
+++ /dev/null
@@ -1,108 +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;
- private Button fCloseComments;
- private Button fCloseStrings;
- private Button fCloseBrackets;
-
- protected Control createContents(Composite parent) {
- Composite composite = super.createComposite(parent, 1);
-
- createAutoComplete(composite);
- createJavaGroup(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;
-
- fCloseComments = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Comments);
- ((GridData) fCloseComments.getLayoutData()).horizontalSpan = 2;
-
- fCloseScriptlets = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Scriptlets);
- ((GridData) fCloseScriptlets.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createJavaGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(JSPUIMessages.JSPTyping_Java_Code);
-
- fCloseStrings = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Strings);
- ((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
-
- fCloseBrackets = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Brackets);
- ((GridData) fCloseBrackets.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);
- initCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- initCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
- initCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- protected void performDefaults() {
- defaultCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
- defaultCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
- defaultCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- defaultCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
- defaultCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- 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);
- getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComments != null) ? fCloseComments.getSelection() : false);
- getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
- getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.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 39d4fb643f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.HashMap;
-import java.util.Map;
-
-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.jface.layout.PixelConverter;
-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.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-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.AbstractValidationSettingsPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-
-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_UNEXPECTED_RTEXPRVALUE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, 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 {
- final Map data = new HashMap();
- data.put(DATA_NO_LINK, Boolean.TRUE);
- Link link= new Link(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT);
- link.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
- link.setText(JSPUIMessages.VALIDATION_JAVA_NOTICE);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)getContainer();
- container.openPage(JAVA_SEVERITY_PROPERTY_PAGE, data);
- }
- });
- //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);
- addComboBox(section, JSPUIMessages.VALIDATION_EL_FUNCTION_UNDEFINED, JSPCorePreferenceNames.VALIDATION_EL_FUNCTION_UNDEFINED, 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();
- }
-
- 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/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 d3c52adaf8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
+++ /dev/null
@@ -1,227 +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);
- else if (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE||type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- }
- }
- // 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 117ade2457..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;
-
- protected 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 2acc57949e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.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.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) {
- return findWord(document, offset, false);
- }
- public static IRegion findWord(IDocument document, int offset, boolean searchQualified) {
-
- int start= -1;
- int end= -1;
-
-
- try {
-
- int pos= offset;
- char c;
-
- while (pos >= 0) {
- c= document.getChar(pos);
- if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !Character.isJavaIdentifierPart(c))
- break;
- --pos;
- }
-
- start= pos;
-
- pos= offset;
- int length= document.getLength();
-
- while (pos < length) {
- c= document.getChar(pos);
- if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !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/taginfo/XMLJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
deleted file mode 100644
index 75d6212117..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-
-
-/**
- * Provides hover help documentation for xml tags
- *
- * @see org.eclipse.jface.text.ITextHover
- */
-public class XMLJavadocHoverProcessor extends JSPJavaJavadocHoverProcessor {
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor
- * #getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
- String elementName = null;
- try {
- elementName = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
- }
- catch (BadLocationException e) {
- return null;
- }
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
- if (model != null) {
- String baseLocation = model.getBaseLocation();
- // URL fixup from the taglib index record
- if (baseLocation.startsWith("jar:/file:")) {
- baseLocation = StringUtils.replace(baseLocation, "jar:/", "jar:");
- }
- /*
- * Handle opened TLD files from JARs on the Java Build Path by
- * finding a package fragment root for the same .jar file and
- * opening the class from there. Note that this might be from
- * a different Java project's build path than the TLD.
- */
- if (baseLocation.startsWith("jar:file:") && baseLocation.indexOf('!') > 9) {
- String baseFile = baseLocation.substring(9, baseLocation.indexOf('!'));
- IPath basePath = new Path(baseFile);
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- try {
- if (projects[i].isAccessible() && projects[i].hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = JavaCore.create(projects[i]);
- if (javaProject.exists()) {
- IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);
- if (root != null) {
- // TLDs don't reference method names
- IType type = javaProject.findType(elementName);
- if (type != null) {
- return getHoverInfo(new IJavaElement[]{type});
- }
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
- else {
- IPath basePath = new Path(baseLocation);
- if (basePath.segmentCount() > 1) {
- IJavaProject javaProject = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0)));
- if (javaProject.exists()) {
- try {
- // TLDs don't reference method names
- IType type = javaProject.findType(elementName);
- if (type != null) {
- return getHoverInfo(new IJavaElement[]{type});
- }
- }
- catch (JavaModelException e) {
- Logger.logException(e);
- }
- }
- }
- }
- }
-
- }
- finally {
- if (model != null)
- model.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, true);
- }
-}
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 275af275b8..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, 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.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/JavaCharacterPairInserter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
deleted file mode 100644
index 0ce823ebdb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
+++ /dev/null
@@ -1,158 +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.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
-
-public class JavaCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {
-
- private boolean fCloseBrackets = true;
- private boolean fCloseStrings = true;
-
- protected boolean shouldPair(ISourceViewer viewer, char c) {
- IDocument document = viewer.getDocument();
- final Point selection = viewer.getSelectedRange();
- final int offset = selection.x;
- final int length = selection.y;
-
- try {
- IRegion startLine= document.getLineInformationOfOffset(offset);
- IRegion endLine= document.getLineInformationOfOffset(offset + length);
-
- JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);
- int nextToken = scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());
- String next = nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();
- int prevToken = scanner.previousToken(offset - 1, startLine.getOffset());
- int prevTokenOffset = scanner.getPosition() + 1;
- String previous = prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
-
- switch (c) {
- case '(':
- if (!fCloseBrackets || nextToken == Symbols.TokenLPAREN || nextToken == Symbols.TokenIDENT || next != null && next.length() > 1)
- return false;
- break;
-
- case '<':
- if (!fCloseBrackets || nextToken == Symbols.TokenLESSTHAN
- || prevToken != Symbols.TokenLBRACE
- && prevToken != Symbols.TokenRBRACE
- && prevToken != Symbols.TokenSEMICOLON
- && prevToken != Symbols.TokenSYNCHRONIZED
- && prevToken != Symbols.TokenSTATIC
- && (prevToken != Symbols.TokenIDENT || !isAngularIntroducer(previous))
- && prevToken != Symbols.TokenEOF)
- return false;
- break;
-
- case '[':
- if (!fCloseBrackets || nextToken == Symbols.TokenIDENT || next != null && next.length() > 1)
- return false;
- break;
-
- case '\'':
- case '"':
- if (!fCloseStrings || nextToken == Symbols.TokenIDENT
- || prevToken == Symbols.TokenIDENT
- || prevToken == Symbols.TokenSQUOTE
- || nextToken == Symbols.TokenSQUOTE
- || prevToken == Symbols.TokenDQUOTE
- || nextToken == Symbols.TokenDQUOTE
- || next != null && next.length() > 1
- || previous != null && previous.length() > 1)
- return false;
- break;
-
- default:
- return false;
- }
- } catch (BadLocationException e) {
- return false;
- }
- return true;
- }
-
- private boolean isAngularIntroducer(String identifier) {
- return identifier.length() > 0
- && (Character.isUpperCase(identifier.charAt(0))
- || identifier.startsWith("final") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("protected") //$NON-NLS-1$
- || identifier.startsWith("private")); //$NON-NLS-1$
- }
-
- protected char getPair(char c) {
- switch (c) {
- case '\'':
- case '"':
- return c;
- case '(':
- return ')';
- case '[':
- return ']';
- case '<':
- return '>';
- default:
- throw new IllegalArgumentException();
- }
- }
-
- protected char getEscapeChar(char c) {
- switch (c) {
- case '\'':
- case '"':
- return '\\';
- default:
- return 0;
- }
- }
-
- public boolean hasPair(char c) {
- switch (c) {
- case '"':
- case '\'':
- case '[':
- case '(':
- case '<':
- return true;
- default:
- return false;
- }
- }
-
- public void initialize() {
- IPreferenceStore store = JSPUIPlugin.getInstance().getPreferenceStore();
- fCloseStrings = store.getBoolean(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
- fCloseBrackets = store.getBoolean(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- store.addPropertyChangeListener(this);
- }
-
- public void dispose() {
- JSPUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))
- fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
- else if (JSPUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))
- fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
- }
-}
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/JavaHeuristicScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
deleted file mode 100644
index e113c38744..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
+++ /dev/null
@@ -1,956 +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.text;
-
-//taken from package org.eclipse.jdt.internal.ui.text;
-
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-
-class JavaHeuristicScanner implements Symbols {
- /**
- * Returned by all methods when the requested position could not be found, or if a
- * {@link BadLocationException} was thrown while scanning.
- */
- public static final int NOT_FOUND= -1;
-
- /**
- * Special bound parameter that means either -1 (backward scanning) or
- * <code>fDocument.getLength()</code> (forward scanning).
- */
- public static final int UNBOUND= -2;
-
-
- /* character constants */
- private static final char LBRACE= '{';
- private static final char RBRACE= '}';
- private static final char LPAREN= '(';
- private static final char RPAREN= ')';
- private static final char SEMICOLON= ';';
- private static final char COLON= ':';
- private static final char COMMA= ',';
- private static final char LBRACKET= '[';
- private static final char RBRACKET= ']';
- private static final char QUESTIONMARK= '?';
- private static final char EQUAL= '=';
- private static final char LANGLE= '<';
- private static final char RANGLE= '>';
- private static final char SQUOTE = '\'';
- private static final char DQUOTE = '"';
-
- /**
- * Specifies the stop condition, upon which the <code>scanXXX</code> methods will decide whether
- * to keep scanning or not. This interface may implemented by clients.
- */
- private static abstract class StopCondition {
- /**
- * Instructs the scanner to return the current position.
- *
- * @param ch the char at the current position
- * @param position the current position
- * @param forward the iteration direction
- * @return <code>true</code> if the stop condition is met.
- */
- public abstract boolean stop(char ch, int position, boolean forward);
-
- /**
- * Asks the condition to return the next position to query. The default
- * is to return the next/previous position.
- *
- * @param position the position
- * @param forward <code>true</code> if next position should be returned
- * @return the next position to scan
- */
- public int nextPosition(int position, boolean forward) {
- return forward ? position + 1 : position - 1;
- }
- }
-
- /**
- * Stops upon a non-whitespace (as defined by {@link Character#isWhitespace(char)}) character.
- */
- private static class NonWhitespace extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isWhitespace(ch);
- }
- }
-
- /**
- * Stops upon a non-whitespace character in the default partition.
- *
- * @see JavaHeuristicScanner.NonWhitespace
- */
- private final class NonWhitespaceDefaultPartition extends NonWhitespace {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition= getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end= partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- } else {
- int offset= partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a non-java identifier (as defined by {@link Character#isJavaIdentifierPart(char)}) character.
- */
- private static class NonJavaIdentifierPart extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isJavaIdentifierPart(ch);
- }
- }
-
- /**
- * Stops upon a non-java identifier character in the default partition.
- *
- * @see JavaHeuristicScanner.NonJavaIdentifierPart
- */
- private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) || !isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition= getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end= partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- } else {
- int offset= partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a character in the default partition that matches the given character list.
- */
- private final class CharacterMatch extends StopCondition {
- private final char[] fChars;
-
- /**
- * Creates a new instance.
- * @param ch the single character to match
- */
- public CharacterMatch(char ch) {
- this(new char[] {ch});
- }
-
- /**
- * Creates a new instance.
- * @param chars the chars to match.
- */
- public CharacterMatch(char[] chars) {
- Assert.isNotNull(chars);
- Assert.isTrue(chars.length > 0);
- fChars= chars;
- Arrays.sort(chars);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char, int)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition= getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end= partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- } else {
- int offset= partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /** The document being scanned. */
- private final IDocument fDocument;
- /** The partitioning being used for scanning. */
- private final String fPartitioning;
- /** The partition to scan in. */
- private final String fPartition;
-
- /* internal scan state */
-
- /** the most recently read character. */
- private char fChar;
- /** the most recently read position. */
- private int fPos;
- /**
- * The most recently used partition.
- * @since 3.2
- */
- private ITypedRegion fCachedPartition= new TypedRegion(-1, 0, "__no_partition_at_all"); //$NON-NLS-1$
-
- /* preset stop conditions */
- private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();
- private final static StopCondition fNonWS= new NonWhitespace();
- private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();
-
- /**
- * Creates a new instance.
- *
- * @param document the document to scan
- * @param partitioning the partitioning to use for scanning
- * @param partition the partition to scan in
- */
- public JavaHeuristicScanner(IDocument document, String partitioning, String partition) {
- Assert.isLegal(document != null);
- Assert.isLegal(partitioning != null);
- Assert.isLegal(partition != null);
- fDocument= document;
- fPartitioning= partitioning;
- fPartition= partition;
- }
-
- /**
- * Calls <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
- *
- * @param document the document to scan.
- */
- public JavaHeuristicScanner(IDocument document) {
- this(document, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, IJSPPartitions.JSP_CONTENT_JAVA);
- }
-
- /**
- * Returns the most recent internal scan position.
- *
- * @return the most recent internal scan position.
- */
- public int getPosition() {
- return fPos;
- }
-
- /**
- * Returns the next token in forward direction, starting at <code>start</code>, and not extending
- * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
- * After a call, {@link #getPosition()} will return the position just after the scanned token
- * (i.e. the next position that will be scanned).
- *
- * @param start the first character position in the document to consider
- * @param bound the first position not to consider any more
- * @return a constant from {@link Symbols} describing the next token
- */
- public int nextToken(int start, int bound) {
- int pos= scanForward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos++;
-
- switch (fChar) {
- case LBRACE:
- return TokenLBRACE;
- case RBRACE:
- return TokenRBRACE;
- case LBRACKET:
- return TokenLBRACKET;
- case RBRACKET:
- return TokenRBRACKET;
- case LPAREN:
- return TokenLPAREN;
- case RPAREN:
- return TokenRPAREN;
- case SEMICOLON:
- return TokenSEMICOLON;
- case COMMA:
- return TokenCOMMA;
- case QUESTIONMARK:
- return TokenQUESTIONMARK;
- case EQUAL:
- return TokenEQUAL;
- case LANGLE:
- return TokenLESSTHAN;
- case RANGLE:
- return TokenGREATERTHAN;
- case SQUOTE:
- return TokenSQUOTE;
- case DQUOTE:
- return TokenDQUOTE;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an identifier or keyword
- int from= pos, to;
- pos= scanForward(pos + 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- to= bound == UNBOUND ? fDocument.getLength() : bound;
- else
- to= pos;
-
- String identOrKeyword;
- try {
- identOrKeyword= fDocument.get(from, to - from);
- } catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- } else {
- // operators, number literals etc
- return TokenOTHER;
- }
- }
-
- /**
- * Returns the next token in backward direction, starting at <code>start</code>, and not extending
- * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
- * After a call, {@link #getPosition()} will return the position just before the scanned token
- * starts (i.e. the next position that will be scanned).
- *
- * @param start the first character position in the document to consider
- * @param bound the first position not to consider any more
- * @return a constant from {@link Symbols} describing the previous token
- */
- public int previousToken(int start, int bound) {
- int pos= scanBackward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos--;
-
- switch (fChar) {
- case LBRACE:
- return TokenLBRACE;
- case RBRACE:
- return TokenRBRACE;
- case LBRACKET:
- return TokenLBRACKET;
- case RBRACKET:
- return TokenRBRACKET;
- case LPAREN:
- return TokenLPAREN;
- case RPAREN:
- return TokenRPAREN;
- case SEMICOLON:
- return TokenSEMICOLON;
- case COLON:
- return TokenCOLON;
- case COMMA:
- return TokenCOMMA;
- case QUESTIONMARK:
- return TokenQUESTIONMARK;
- case EQUAL:
- return TokenEQUAL;
- case LANGLE:
- return TokenLESSTHAN;
- case RANGLE:
- return TokenGREATERTHAN;
- case SQUOTE:
- return TokenSQUOTE;
- case DQUOTE:
- return TokenDQUOTE;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an ident or keyword
- int from, to= pos + 1;
- pos= scanBackward(pos - 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- from= bound == UNBOUND ? 0 : bound + 1;
- else
- from= pos + 1;
-
- String identOrKeyword;
- try {
- identOrKeyword= fDocument.get(from, to - from);
- } catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- } else {
- // operators, number literals etc
- return TokenOTHER;
- }
-
- }
-
- /**
- * Returns one of the keyword constants or <code>TokenIDENT</code> for a scanned identifier.
- *
- * @param s a scanned identifier
- * @return one of the constants defined in {@link Symbols}
- */
- private int getToken(String s) {
- Assert.isNotNull(s);
-
- switch (s.length()) {
- case 2:
- if ("if".equals(s)) //$NON-NLS-1$
- return TokenIF;
- if ("do".equals(s)) //$NON-NLS-1$
- return TokenDO;
- break;
- case 3:
- if ("for".equals(s)) //$NON-NLS-1$
- return TokenFOR;
- if ("try".equals(s)) //$NON-NLS-1$
- return TokenTRY;
- if ("new".equals(s)) //$NON-NLS-1$
- return TokenNEW;
- break;
- case 4:
- if ("case".equals(s)) //$NON-NLS-1$
- return TokenCASE;
- if ("else".equals(s)) //$NON-NLS-1$
- return TokenELSE;
- if ("enum".equals(s)) //$NON-NLS-1$
- return TokenENUM;
- if ("goto".equals(s)) //$NON-NLS-1$
- return TokenGOTO;
- break;
- case 5:
- if ("break".equals(s)) //$NON-NLS-1$
- return TokenBREAK;
- if ("catch".equals(s)) //$NON-NLS-1$
- return TokenCATCH;
- if ("class".equals(s)) //$NON-NLS-1$
- return TokenCLASS;
- if ("while".equals(s)) //$NON-NLS-1$
- return TokenWHILE;
- break;
- case 6:
- if ("return".equals(s)) //$NON-NLS-1$
- return TokenRETURN;
- if ("static".equals(s)) //$NON-NLS-1$
- return TokenSTATIC;
- if ("switch".equals(s)) //$NON-NLS-1$
- return TokenSWITCH;
- break;
- case 7:
- if ("default".equals(s)) //$NON-NLS-1$
- return TokenDEFAULT;
- if ("finally".equals(s)) //$NON-NLS-1$
- return TokenFINALLY;
- break;
- case 9:
- if ("interface".equals(s)) //$NON-NLS-1$
- return TokenINTERFACE;
- break;
- case 12:
- if ("synchronized".equals(s)) //$NON-NLS-1$
- return TokenSYNCHRONIZED;
- break;
- }
- return TokenIDENT;
- }
-
- /**
- * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
- * are skipped. All peers accounted for must reside in the default partition.
- *
- * <p>Note that <code>start</code> must not point to the opening peer, but to the first
- * character being searched.</p>
- *
- * @param start the start position
- * @param openingPeer the opening peer character (e.g. '{')
- * @param closingPeer the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
- return findClosingPeer(start, UNBOUND, openingPeer, closingPeer);
- }
-
- /**
- * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
- * are skipped. All peers accounted for must reside in the default partition.
- *
- * <p>Note that <code>start</code> must not point to the opening peer, but to the first
- * character being searched.</p>
- *
- * @param start the start position
- * @param bound the bound
- * @param openingPeer the opening peer character (e.g. '{')
- * @param closingPeer the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findClosingPeer(int start, int bound, final char openingPeer, final char closingPeer) {
- Assert.isLegal(start >= 0);
-
- try {
- CharacterMatch match= new CharacterMatch(new char[] {openingPeer, closingPeer});
- int depth= 1;
- start -= 1;
- while (true) {
- start= scanForward(start + 1, bound, match);
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == openingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- } catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers
- * are skipped. All peers accounted for must reside in the default partition.
- *
- * <p>Note that <code>start</code> must not point to the closing peer, but to the first
- * character being searched.</p>
- *
- * @param start the start position
- * @param openingPeer the opening peer character (e.g. '{')
- * @param closingPeer the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
- return findOpeningPeer(start, UNBOUND, openingPeer, closingPeer);
- }
-
- /**
- * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers
- * are skipped. All peers accounted for must reside in the default partition.
- *
- * <p>Note that <code>start</code> must not point to the closing peer, but to the first
- * character being searched.</p>
- *
- * @param start the start position
- * @param bound the bound
- * @param openingPeer the opening peer character (e.g. '{')
- * @param closingPeer the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findOpeningPeer(int start, int bound, char openingPeer, char closingPeer) {
- Assert.isLegal(start < fDocument.getLength());
-
- try {
- final CharacterMatch match= new CharacterMatch(new char[] {openingPeer, closingPeer});
- int depth= 1;
- start += 1;
- while (true) {
- start= scanBackward(start - 1, bound, match);
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == closingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- } catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Computes the surrounding block around <code>offset</code>. The search is started at the
- * beginning of <code>offset</code>, i.e. an opening brace at <code>offset</code> will not be
- * part of the surrounding block, but a closing brace will.
- *
- * @param offset the offset for which the surrounding block is computed
- * @return a region describing the surrounding block, or <code>null</code> if none can be found
- */
- public IRegion findSurroundingBlock(int offset) {
- if (offset < 1 || offset >= fDocument.getLength())
- return null;
-
- int begin= findOpeningPeer(offset - 1, LBRACE, RBRACE);
- int end= findClosingPeer(offset, LBRACE, RBRACE);
- if (begin == NOT_FOUND || end == NOT_FOUND)
- return null;
- return new Region(begin, end + 1 - begin);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
- * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
- * and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceForward(int position, int bound) {
- return scanForward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
- * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>), or <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
- return scanForward(position, bound, fNonWS);
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
- * and &gt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
- * and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
- * @return the highest position of a non-whitespace character in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceBackward(int position, int bound) {
- return scanBackward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the lowest position <code>p</code> in <code>fDocument</code> such that <code>start</code> &lt;= p &lt;
- * <code>bound</code> and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
- *
- * @param start the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>start</code>, or <code>UNBOUND</code>
- * @param condition the <code>StopCondition</code> to check
- * @return the lowest position in [<code>start</code>, <code>bound</code>) for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int start, int bound, StopCondition condition) {
- Assert.isLegal(start >= 0);
-
- if (bound == UNBOUND)
- bound= fDocument.getLength();
-
- Assert.isLegal(bound <= fDocument.getLength());
-
- try {
- fPos= start;
- while (fPos < bound) {
-
- fChar= fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, true))
- return fPos;
-
- fPos= condition.nextPosition(fPos, true);
- }
- } catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
- * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code>
- * and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
- * @param ch the <code>char</code> to search for
- * @return the lowest position of <code>ch</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char ch) {
- return scanForward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
- * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
- * ch in <code>chars</code> and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
- * @param chars an array of <code>char</code> to search for
- * @return the lowest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char[] chars) {
- return scanForward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Finds the highest position <code>p</code> in <code>fDocument</code> such that <code>bound</code> &lt; <code>p</code> &lt;= <code>start</code>
- * and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
- *
- * @param start the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
- * @param condition the <code>StopCondition</code> to check
- * @return the highest position in (<code>bound</code>, <code>start</code> for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int start, int bound, StopCondition condition) {
- if (bound == UNBOUND)
- bound= -1;
-
- Assert.isLegal(bound >= -1);
- Assert.isLegal(start < fDocument.getLength() );
-
- try {
- fPos= start;
- while (fPos > bound) {
-
- fChar= fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, false))
- return fPos;
-
- fPos= condition.nextPosition(fPos, false);
- }
- } catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
- * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
- * ch in <code>chars</code> and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
- * @param ch the <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char ch) {
- return scanBackward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
- * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
- * ch in <code>chars</code> and the position is in the default partition.
- *
- * @param position the first character position in <code>fDocument</code> to be considered
- * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
- * @param chars an array of <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a Java partition, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char[] chars) {
- return scanBackward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>.
- *
- * @param position the position to be checked
- * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise
- */
- public boolean isDefaultPartition(int position) {
- return fPartition.equals(getPartition(position).getType());
- }
-
- /**
- * Returns the partition at <code>position</code>.
- *
- * @param position the position to get the partition for
- * @return the partition at <code>position</code> or a dummy zero-length
- * partition if accessing the document fails
- */
- private ITypedRegion getPartition(int position) {
- if (!contains(fCachedPartition, position)) {
- Assert.isTrue(position >= 0);
- Assert.isTrue(position <= fDocument.getLength());
-
- try {
- fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, position, false);
- } catch (BadLocationException e) {
- fCachedPartition= new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
- }
- }
-
- return fCachedPartition;
- }
-
- /**
- * Returns <code>true</code> if <code>region</code> contains <code>position</code>.
- *
- * @param region a region
- * @param position an offset
- * @return <code>true</code> if <code>region</code> contains <code>position</code>
- * @since 3.2
- */
- private boolean contains(IRegion region, int position) {
- int offset= region.getOffset();
- return offset <= position && position < offset + region.getLength();
- }
-
- /**
- * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while,
- * or for statement with just one following statement, see example below).
- *
- * <pre>
- * if (condition)
- * doStuff();
- * </pre>
- *
- * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),
- * for( expression), do, else, and there is no statement after that </p>
- *
- * @param position the insert position of the new character
- * @param bound the lowest position to consider
- * @return <code>true</code> if the code is a conditional statement or loop without a block, <code>false</code> otherwise
- */
- public boolean isBracelessBlockStart(int position, int bound) {
- if (position < 1)
- return false;
-
- switch (previousToken(position, bound)) {
- case TokenDO:
- case TokenELSE:
- return true;
- case TokenRPAREN:
- position= findOpeningPeer(fPos, LPAREN, RPAREN);
- if (position > 0) {
- switch (previousToken(position - 1, bound)) {
- case TokenIF:
- case TokenFOR:
- case TokenWHILE:
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Returns <code>true</code> if the document, when scanned backwards from <code>start</code>
- * appears to contain a class instance creation, i.e. a possibly qualified name preceded by a
- * <code>new</code> keyword. The <code>start</code> must be at the end of the type name, and
- * before any generic signature or constructor parameter list. The heuristic will return
- * <code>true</code> if <code>start</code> is at the following positions (|):
- *
- * <pre>
- * new java.util. ArrayList|&lt;String&gt;(10)
- * new ArrayList |(10)
- * new / * comment * / ArrayList |(10)
- * </pre>
- *
- * but not the following:
- *
- * <pre>
- * new java.util. ArrayList&lt;String&gt;(10)|
- * new java.util. ArrayList&lt;String&gt;|(10)
- * new ArrayList (10)|
- * ArrayList |(10)
- * </pre>
- *
- * @param start the position where the type name of the class instance creation supposedly ends
- * @param bound the first position in <code>fDocument</code> to not consider any more, with
- * <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
- * @return <code>true</code> if the current position looks like after the type name of a class
- * instance creation
- * @since 3.2
- */
- public boolean looksLikeClassInstanceCreationBackward(int start, int bound) {
- int token= previousToken(start - 1, bound);
- if (token == Symbols.TokenIDENT) { // type name
- token= previousToken(getPosition(), bound);
- while (token == Symbols.TokenOTHER) { // dot of qualification
- token= previousToken(getPosition(), bound);
- if (token != Symbols.TokenIDENT) // qualification name
- return false;
- token= previousToken(getPosition(), bound);
- }
- return token == Symbols.TokenNEW;
- }
- return false;
- }
-
- /**
- * Returns <code>true</code> if <code>identifier</code> is probably a
- * type variable or type name, <code>false</code> if it is rather not.
- * This is a heuristic.
- *
- * @param identifier the identifier to check
- * @return <code>true</code> if <code>identifier</code> is probably a
- * type variable or type name, <code>false</code> if not
- * @since 3.2
- */
- public static boolean isGenericStarter(CharSequence identifier) {
- /* This heuristic allows any identifiers if they start with an upper
- * case. This will fail when a comparison is made with constants:
- *
- * if (MAX > foo)
- *
- * will try to find the matching '<' which will never come
- *
- * Also, it will fail on lower case types and type variables
- */
- int length= identifier.length();
- if (length > 0 && Character.isUpperCase(identifier.charAt(0))) {
- for (int i= 0; i < length; i++) {
- if (identifier.charAt(i) == '_')
- return false;
- }
- return true;
- }
- return false;
- }
-}
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 66a0e66677..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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 match for previous character fails , look for next character now.
- * This is required for cases like <abc|>, cursor placed at |.
- */
- if (fEndPos == -1 && fStartPos == -1) {
- char nextChar = fDocument.getChar(Math.max(fOffset, 0));
- for (i = 0; i < fPairs.length; i = i + 2) {
- if (nextChar == fPairs[i]) {
- fStartPos = fOffset;
- pairIndex1 = i;
- }
- }
-
- for (i = 1; i < fPairs.length; i = i + 2) {
- 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(), false, 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, false, 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/text/Symbols.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
deleted file mode 100644
index 171e99c724..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
+++ /dev/null
@@ -1,54 +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.text;
-
-//taken from package org.eclipse.jdt.internal.ui.text;
-
-interface Symbols {
- int TokenEOF = -1;
- int TokenLBRACE = 1;
- int TokenRBRACE = 2;
- int TokenLBRACKET = 3;
- int TokenRBRACKET = 4;
- int TokenLPAREN = 5;
- int TokenRPAREN = 6;
- int TokenSEMICOLON = 7;
- int TokenOTHER = 8;
- int TokenCOLON = 9;
- int TokenQUESTIONMARK = 10;
- int TokenCOMMA = 11;
- int TokenEQUAL = 12;
- int TokenLESSTHAN = 13;
- int TokenGREATERTHAN = 14;
- int TokenSQUOTE = 15;
- int TokenDQUOTE = 16;
- int TokenIF = 109;
- int TokenDO = 1010;
- int TokenFOR = 1011;
- int TokenTRY = 1012;
- int TokenCASE = 1013;
- int TokenELSE = 1014;
- int TokenBREAK = 1015;
- int TokenCATCH = 1016;
- int TokenWHILE = 1017;
- int TokenRETURN = 1018;
- int TokenSTATIC = 1019;
- int TokenSWITCH = 1020;
- int TokenFINALLY = 1021;
- int TokenSYNCHRONIZED = 1022;
- int TokenGOTO = 1023;
- int TokenDEFAULT = 1024;
- int TokenNEW = 1025;
- int TokenCLASS = 1026;
- int TokenINTERFACE = 1027;
- int TokenENUM = 1028;
- int TokenIDENT = 2000;
-}
diff --git a/bundles/org.eclipse.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 bfbd890f5c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java
+++ /dev/null
@@ -1,393 +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;
- }
-
- /**
- * 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/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/views/contentoutline/TLDContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
deleted file mode 100644
index 4444f59509..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
+++ /dev/null
@@ -1,349 +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.views.contentoutline;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class TLDContentOutlineConfiguration extends XMLContentOutlineConfiguration {
-
- private class ContentLabelProvider implements ILabelProvider {
- ILabelProvider fParentProvider = null;
-
- ContentLabelProvider(ILabelProvider parent) {
- super();
- fParentProvider = parent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse
- * .jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- fParentProvider.addListener(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- fParentProvider.dispose();
- }
-
- private String firstLineOf(String text) {
- if (text == null || text.length() < 1 || (text.indexOf('\r') < 0 && text.indexOf('\n') < 0)) {
- return text;
- }
-
- int start = 0;
- int maxLength = text.length();
- while (start < maxLength && text.charAt(start) == '\r' || text.charAt(start) == '\n')
- start++;
- int endN = text.indexOf('\n', start);
- int endR = text.indexOf('\r', start);
- // no more line delimiters
- if (endN < 0 && endR < 0) {
- if (start == 0) {
- // no leading line delimiters, return as-is
- return text;
- }
- else {
- // cut leading line delimiters
- return text.substring(start);
- }
- }
- if (endN < 0) {
- /* no \r cut leading line delimiters up to first \r */
- return text.substring(start, endR);
- }
- if (endR < 0) {
- /* no \r cut leading line delimiters up to first \n */
- return text.substring(start, endN);
- }
-
- /*
- * Both \n and \r, cut leading line delimiters up to whichever is
- * first
- */
- return text.substring(start, Math.min(endN, endR));
- }
-
- private String getContainedText(Node parent) {
- NodeList children = parent.getChildNodes();
- if (children.getLength() == 1) {
- return getValue(children.item(0));
- }
- 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(getValue(child));
- }
- child = child.getNextSibling();
- }
- return s.toString().trim();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return fParentProvider.getImage(element);
- }
-
- /**
- * @param domElement
- * @return
- */
- private String getNameValue(Element domElement) {
- NodeList names = domElement.getElementsByTagName(JSP11TLDNames.NAME);
- String name = null;
- for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
- name = getContainedText(names.item(i));
- }
- return name;
- }
-
- /**
- * @param domElement
- * @return
- */
- private String getShortNameValue(Element domElement) {
- NodeList names = domElement.getElementsByTagName(JSP12TLDNames.SHORT_NAME);
- String name = null;
- for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
- name = getContainedText(names.item(i));
- }
- names = domElement.getElementsByTagName(JSP11TLDNames.SHORTNAME);
- for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
- name = getContainedText(names.item(i));
- }
- return name;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (fShowContentValues && element instanceof Element) {
- Element domElement = (Element) element;
- String name = domElement.getNodeName();
- boolean showName = JSP11TLDNames.TAG.equals(name);
- showName = showName || JSP11TLDNames.ATTRIBUTE.equals(name);
- if (showName) {
- String value = getNameValue(domElement);
- if (value != null && value.length() > 0) {
- /**
- * Currently not externalized since it's analagous to
- * a decorator.
- */
- return fParentProvider.getText(domElement) + " [" + firstLineOf(value) + "]"; //$NON-NLS-1$
- }
- }
-
- boolean showContents = JSP11TLDNames.NAME.equals(name);
- showContents = showContents || JSP11TLDNames.BODYCONTENT.equals(name);
- showContents = showContents || JSP12TLDNames.BODY_CONTENT.equals(name);
- showContents = showContents || JSP11TLDNames.TAGCLASS.equals(name);
- showContents = showContents || JSP12TLDNames.TAG_CLASS.equals(name);
- showContents = showContents || JSP11TLDNames.TEICLASS.equals(name);
- showContents = showContents || JSP12TLDNames.TEI_CLASS.equals(name);
- showContents = showContents || JSP11TLDNames.REQUIRED.equals(name);
- showContents = showContents || JSP11TLDNames.RTEXPRVALUE.equals(name);
- showContents = showContents || JSP11TLDNames.URI.equals(name);
- showContents = showContents || JSP11TLDNames.SHORTNAME.equals(name);
- showContents = showContents || JSP12TLDNames.SHORT_NAME.equals(name);
- showContents = showContents || JSP12TLDNames.DISPLAY_NAME.equals(name);
- showContents = showContents || JSP11TLDNames.JSPVERSION.equals(name);
- showContents = showContents || JSP12TLDNames.JSP_VERSION.equals(name);
- showContents = showContents || JSP11TLDNames.TLIBVERSION.equals(name);
- showContents = showContents || JSP12TLDNames.TLIB_VERSION.equals(name);
- showContents = showContents || JSP12TLDNames.LISTENER_CLASS.equals(name);
- showContents = showContents || JSP12TLDNames.VARIABLE_SCOPE.equals(name);
- showContents = showContents || JSP12TLDNames.VARIABLE_CLASS.equals(name);
- showContents = showContents || JSP12TLDNames.VARIABLE_DECLARE.equals(name);
- showContents = showContents || JSP12TLDNames.VARIABLE_NAME_FROM_ATTRIBUTE.equals(name);
- showContents = showContents || JSP12TLDNames.VARIABLE_NAME_GIVEN.equals(name);
- showContents = showContents || JSP12TLDNames.VALIDATOR_CLASS.equals(name);
- showContents = showContents || JSP12TLDNames.SMALL_ICON.equals(name);
- showContents = showContents || JSP12TLDNames.LARGE_ICON.equals(name);
-
- if (showContents) {
- return fParentProvider.getText(domElement) + ": " + getContainedText(domElement); //$NON-NLS-1$
- }
-
- if (JSP11TLDNames.TAGLIB.equals(name)) {
- String value = getShortNameValue(domElement);
- if (value != null && value.length() > 0) {
- /**
- * Currently not externalized since it's analagous to
- * a decorator.
- */
- return fParentProvider.getText(domElement) + " [" + value + "]"; //$NON-NLS-1$
- }
- }
- }
- return fParentProvider.getText(element);
- }
-
- private String getValue(Node n) {
- if (n == null)
- return ""; //$NON-NLS-1$
- String value = n.getNodeValue();
- if (value == null)
- return ""; //$NON-NLS-1$
- return value.trim();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java
- * .lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return fParentProvider.isLabelProperty(element, property);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org
- * .eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- fParentProvider.removeListener(listener);
- }
- }
-
- /**
- * Toggle action for whether or not to display element's first attribute
- */
- private class ToggleShowValueAction extends PropertyChangeUpdateAction {
- private TreeViewer fTreeViewer;
-
- public ToggleShowValueAction(IPreferenceStore store, String preference, TreeViewer treeViewer) {
- super(JSPUIMessages.TLDContentOutlineConfiguration_0, store, preference, true);
- setToolTipText(getText());
- // TODO: image needed
- setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS));
- fTreeViewer = treeViewer;
- update();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- super.update();
- fShowContentValues = isChecked();
-
- // refresh the outline view
- fTreeViewer.refresh(true);
- }
- }
-
- /*
- * Preference key for Show Attributes
- */
- private final String OUTLINE_SHOW_VALUE_PREF = "outline-show-value"; //$NON-NLS-1$
-
- boolean fShowContentValues = true;
- ILabelProvider fLabelProvider = null;
-
- public TLDContentOutlineConfiguration() {
- super();
- }
-
- protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
- IContributionItem[] items;
- IContributionItem showValueItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowValueAction(getPreferenceStore(), OUTLINE_SHOW_VALUE_PREF, viewer));
-
- items = super.createMenuContributions(viewer);
- if (items == null) {
- items = new IContributionItem[]{showValueItem};
- }
- else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
- System.arraycopy(items, 0, combinedItems, 0, items.length);
- combinedItems[items.length] = showValueItem;
- items = combinedItems;
- }
- return items;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration
- * #getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null) {
- fLabelProvider = new ContentLabelProvider(super.getLabelProvider(viewer));
- }
- return fLabelProvider;
- }
-
- /*
- * (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/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 f660996e89..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-class NewJSPFileWizardPage extends WizardNewFileCreationPage {
-
- private static final String defaultName = "NewFile"; //$NON-NLS-1$
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewJSPFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName, selection);
- }
-
- public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- setFileName(computeDefaultFileName());
- setPageComplete(validatePage());
- }
-
- protected String computeDefaultFileName() {
- int count = 0;
- String fileName = addDefaultExtension(defaultName);
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null) {
- while (true) {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path)) {
- count++;
- fileName = addDefaultExtension(defaultName + count);
- }
- else {
- break;
- }
- }
- }
- return fileName;
- }
-
- /**
- * This method is overridden 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[] webContentPaths = FacetModuleCoreSupport.getAcceptableRootPaths(project);
- for (int i = 0; webContentPaths != null && i < webContentPaths.length; i++) {
- if (!webContentPaths[i].isPrefixOf(fullPath)) {
- setContainerFullPath(webContentPaths[i]);
- break;
- }
- }
- }
-
- /**
- * 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 inside web project, check if inside webContent folder
- if (project != null) {
- if (!isJavaProject(project)) {
- setMessage(JSPUIMessages._WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT, WARNING);
- }
- if (isDynamicWebProject(project)) {
- // check that the path is inside the webContent folder
- IPath[] webContentPaths = FacetModuleCoreSupport.getAcceptableRootPaths(project);
- boolean isPrefix = false;
- for (int i = 0; !isPrefix && i < webContentPaths.length; i++) {
- isPrefix |= webContentPaths[i].isPrefixOf(fullPath);
- }
- if (!isPrefix) {
- setMessage(HTMLUIMessages._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;
- }
-}
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 e1b5b83054..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(JSPUIMessages.NewJSPTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // 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);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
-
- 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);
- 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);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- 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() {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- boolean setSelection = false;
- String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
- if (templateName != null && templateName.length() > 0) {
- Template template = fTemplateStore.findTemplateById(templateName);
- if (template != null) {
- fLastSelectedTemplateName = template.getName();
- setSelection = true;
- }
- }
- }
- else {
- fLastSelectedTemplateName = templateName;
- setSelection = true;
- }
- fUseTemplateButton.setSelection(setSelection);
- 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 f4a929aef4..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 Display fDisplay;
-
- private boolean fShouldOpenEditorOnFinish = true;
-
- public void createPageControls(Composite pageContainer) {
- fDisplay = pageContainer.getDisplay();
- super.createPageControls(pageContainer);
- }
-
- // 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 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 f5d01c891d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(JSPUIMessages.NewTagTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // 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);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(JSPUIMessages.NewTagTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- 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);
- 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);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- 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_TAG);
- 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 tag", 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() {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- boolean setSelection = false;
- String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID);
- if (templateName != null && templateName.length() > 0) {
- Template template = fTemplateStore.findTemplateById(templateName);
- if (template != null) {
- fLastSelectedTemplateName = template.getName();
- setSelection = true;
- }
- }
- }
- else {
- fLastSelectedTemplateName = templateName;
- setSelection = true;
- }
- fUseTemplateButton.setSelection(setSelection);
- 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_TAG_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_TAG);
- }
-
- // 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 2318b727e1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.jface.viewers.TreeViewer;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.actions.JSPNodeActionManager;
-import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-
-/**
- * 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;
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.jst.jsp.ui.OutlinePage"; //$NON-NLS-1$
- /**
- * 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();
- }
-
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new JSPNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
- }
-
- public String getOutlineFilterTarget(){
- return OUTLINE_FILTER_PREF ;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPImportDirectiveFilter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPImportDirectiveFilter.java
deleted file mode 100644
index e4d11f311f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPImportDirectiveFilter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP20TLDNames;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class JSPImportDirectiveFilter extends ViewerFilter {
-
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof Node){
- Node node = (Node)element;
- if (node.getNodeName().equalsIgnoreCase(JSP11Namespace.ElementName.DIRECTIVE_PAGE)){
- final NamedNodeMap nodeMap = node.getAttributes();
- for (int i=0;i <nodeMap.getLength();i++){
- final Node attr = nodeMap.item(i);
- if (attr != null && JSP20TLDNames.IMPORT.equalsIgnoreCase(attr.getNodeName()))
- return false;
- }
- }
- }
- return true;
- }
-}
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 58d9de8237..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
+++ /dev/null
@@ -1,64 +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.jsp20xhtmlxml.name=New JSP File (xhtml, xml syntax, JSP 2.0)
-Templates.jsp20xhtmlxml.desc=JSP with JSP 2.0 specific tags, xhtml markup and xml style syntax
-Templates.jsp20xhtmlxml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">\n\t<jsp:directive.page contentType="text/html; charset=${encoding}" \n\t\tpageEncoding="${encoding}" session="false"/>\n\t<jsp:output doctype-root-element="html"\n\t\tdoctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"\n\t\tdoctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"\n\t\tomit-xml-declaration="true" />\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\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 c95a802276..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
+++ /dev/null
@@ -1,48 +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.jsp20xhtmlxml.name" description="%Templates.jsp20xhtmlxml.desc" id="org.eclipse.jst.jsp.ui.templates.jsp20xhtmlxml" context="jsp_new" enabled="true">%Templates.jsp20xhtmlxml.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.jst.standard.schemas/.cvsignore b/bundles/org.eclipse.jst.standard.schemas/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/bundles/org.eclipse.jst.standard.schemas/.project b/bundles/org.eclipse.jst.standard.schemas/.project
deleted file mode 100644
index 07974e92bb..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.standard.schemas</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 7b5c092cf8..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue Feb 09 17:53:02 EST 2010
-encoding/<project>=ISO-8859-1
-eclipse.preferences.version=1
-encoding//dtdsAndSchemas/web-facelettaglibrary_2_0.xsd=UTF8
diff --git a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index d4ac9ad702..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sat Apr 28 09:28:31 EDT 2007
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.missing-packages=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF
deleted file mode 100644
index 84a8845d50..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.standard.schemas;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.standard.schemas/about.html b/bundles/org.eclipse.jst.standard.schemas/about.html
deleted file mode 100644
index bd6b3085d3..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/about.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>About</title>
-</head>
-
-<body>
-<p>January, 2010</p>
-<h3>License</h3>
-<p>The Eclipse Foundation makes available all content in this
-plug-in (&quot;Content&quot;). Unless otherwise indicated below, the
-Content is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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
-(&quot;Redistributor&quot;) 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>
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third
-parties as set out below. If you did not receive this Content directly
-from the Eclipse Foundation, the following is provided for informational
-purposes only, and you should look to the Redistributor's license for
-terms and conditions of use.</p>
-<h4>Appserv Commons schemas and DTDs v2_b33 (Subset)</h4>
-<p>Your use of the Appserv Commons schemas and DTDs is subject to
-the terms and conditions of the Common Development and Distribution
-License v1.0. A copy of the license is contained in the file <a
- href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
-at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
-</p>
-<p>The source for the schemas and DTDs is available on the Glassfish
-community website at <a
- href="https://glassfish.dev.java.net/public/downloadsindex.html">https://glassfish.dev.java.net/</a>.
-</p>
-
-<h4>Java Server Faces 1.2 Schema and DTDs (Subset)</h4>
-<p>Your use of the Java Server Faces schemas and DTDs is subject to
-the terms and conditions of the Common Development and Distribution
-License v1.0. A copy of the license is contained in the file <a
- href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
-at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
-</p>
-<p>The source for the schemas and DTDs is available on the Java
-Server Faces project page on the Glassfish community website at <a
- href="https://javaserverfaces.dev.java.net">https://javaserverfaces.dev.java.net/</a>.
-</p>
-
-<h4>Java Persistence API XML Schemas</h4>
-<p>Your use of the Java Persistence API XML Schemas (orm_1_0.xsd,
-persistence_1_0.xsd) is subject to the terms and conditions of the
-Common Development and Distribution License v1.0. A copy of the license
-is contained in the file <a href="about_files/CDDLv1.0.txt">LICENSE.txt</a>
-and is also available at <a
- href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
-</p>
-<p>The original source for the schemas is available on <a
- href="http://java.sun.com/xml/ns/persistence/">http://java.sun.com/xml/ns/persistence/</a>.
-</p>
-
-<h4>Java EE 6 XML Schemas</h4>
-<p>Your use of the Java EE 6 XML Schemas (application_6.xsd,
-application-client-6.xsd, connector_1_6.xsd, ejb-jar_3_1.xsd,
-javaee_6.xsd, javaee_web_services_1_3.xsd,
-javaee_web_services_client_1_3.xsd, jsp_2_2.xsd, web-app_3_0.xsd,
-web-common_3_0.xsd, web-fragment_3_0.xsd) is subject to the terms and
-conditions of the Common Development and Distribution License v1.0. A
-copy of the license is contained in the file <a
- href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
-at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
-</p>
-<p>The original source for the schemas is available on <a
- href="http://java.sun.com/xml/ns/javaee/">http://java.sun.com/xml/ns/javaee/</a>.
-</p>
-
-<h4>Java Server Faces 2.0 Schema</h4>
-<p>Your use of the Java Server Faces 2.0 schemas is subject to the
-terms and conditions of the Common Development and Distribution License
-v1.0. A copy of the license is contained in the file <a
- href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
-at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
-</p>
-<p>The source for the schema is available on the Java Server Faces
-project page on the Glassfish community website at <a
- href="https://javaserverfaces.dev.java.net">https://javaserverfaces.dev.java.net/</a>.
-</p>
-
-</body>
-</html>
diff --git a/bundles/org.eclipse.jst.standard.schemas/about_files/CDDLv1.0.txt b/bundles/org.eclipse.jst.standard.schemas/about_files/CDDLv1.0.txt
deleted file mode 100644
index 1154e0aeec..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/about_files/CDDLv1.0.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-1. Definitions.
-
-1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications.
-
-1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
-
-1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
-
-1.4. Executable means the Covered Software in any form other than Source Code.
-
-1.5. Initial Developer means the individual or entity that first makes Original Software available under this License.
-
-1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
-
-1.7. License means this document.
-
-1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
-
-1.9. Modifications means the Source Code and Executable form of any of the following:
-
-A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
-
-B. Any new file that contains any part of the Original Software or previous Modification; or
-
-C. Any new file that is contributed or otherwise made available under the terms of this License.
-
-1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License.
-
-1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
-
-1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
-
-1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
-
-2. License Grants.
-
-2.1. The Initial Developer Grant.
-Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
-(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
-(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
-(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
-(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices.
-
-2.2. Contributor Grant.
-Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
-(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
-(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
-(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
-(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
-
-3. Distribution Obligations.
-
-3.1. Availability of Source Code.
-
-Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
-
-3.2. Modifications.
-
-The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
-
-3.3. Required Notices.
-You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
-
-3.4. Application of Additional Terms.
-You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
-
-3.5. Distribution of Executable Versions.
-You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
-
-3.6. Larger Works.
-You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
-
-4. Versions of the License.
-
-4.1. New Versions.
-Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
-
-4.2. Effect of New Versions.
-
-You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
-4.3. Modified Versions.
-
-When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License.
-
-5. DISCLAIMER OF WARRANTY.
-
-COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-6. TERMINATION.
-
-6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
-
-6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
-
-6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
-
-7. LIMITATION OF LIABILITY.
-
-UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-8. U.S. GOVERNMENT END USERS.
-
-The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
-
-9. MISCELLANEOUS.
-
-This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
-
-10. RESPONSIBILITY FOR CLAIMS.
-
-As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
-
-NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
-The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
-
-
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/about_files/LICENSE.txt b/bundles/org.eclipse.jst.standard.schemas/about_files/LICENSE.txt
deleted file mode 100644
index 1154e0aeec..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/about_files/LICENSE.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-1. Definitions.
-
-1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications.
-
-1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
-
-1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
-
-1.4. Executable means the Covered Software in any form other than Source Code.
-
-1.5. Initial Developer means the individual or entity that first makes Original Software available under this License.
-
-1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
-
-1.7. License means this document.
-
-1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
-
-1.9. Modifications means the Source Code and Executable form of any of the following:
-
-A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
-
-B. Any new file that contains any part of the Original Software or previous Modification; or
-
-C. Any new file that is contributed or otherwise made available under the terms of this License.
-
-1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License.
-
-1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
-
-1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
-
-1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
-
-2. License Grants.
-
-2.1. The Initial Developer Grant.
-Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
-(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
-(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
-(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
-(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices.
-
-2.2. Contributor Grant.
-Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
-(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
-(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
-(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
-(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
-
-3. Distribution Obligations.
-
-3.1. Availability of Source Code.
-
-Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
-
-3.2. Modifications.
-
-The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
-
-3.3. Required Notices.
-You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
-
-3.4. Application of Additional Terms.
-You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
-
-3.5. Distribution of Executable Versions.
-You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
-
-3.6. Larger Works.
-You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
-
-4. Versions of the License.
-
-4.1. New Versions.
-Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
-
-4.2. Effect of New Versions.
-
-You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
-4.3. Modified Versions.
-
-When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License.
-
-5. DISCLAIMER OF WARRANTY.
-
-COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-6. TERMINATION.
-
-6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
-
-6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
-
-6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
-
-7. LIMITATION OF LIABILITY.
-
-UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-8. U.S. GOVERNMENT END USERS.
-
-The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
-
-9. MISCELLANEOUS.
-
-This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
-
-10. RESPONSIBILITY FOR CLAIMS.
-
-As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
-
-NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
-The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
-
-
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/build.properties b/bundles/org.eclipse.jst.standard.schemas/build.properties
deleted file mode 100644
index bb81a90e7f..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- dtdsAndSchemas/,\
- plugin.properties,\
- about.html,\
- about_files/
-src.includes = dtdsAndSchemas/,\
- about.html,\
- about_files/
-generateSourceBundle=false
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_2.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_2.dtd
deleted file mode 100644
index 6c58cc9363..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_2.dtd
+++ /dev/null
@@ -1,292 +0,0 @@
-<!--
-Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-Copyright 1999 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-The application-client element is the root element of an application client
-deployment descriptor.
-The application client deployment descriptor describes the EJB components and
-external resources referenced by the application client.
--->
-<!ELEMENT application-client (icon?, display-name, description?, env-entry*,
-ejb-ref*, resource-ref*)>
-
-<!--
-The description element is used to provide text describing the parent element.
-The description element should include any information that the
-application-client file producer wants to provide to the consumer of the
-application-client file (i.e., to the Deployer). Typically, the tools used by
-the application-client file consumer will display the description when
-processing the parent element that contains the description.
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be displayed
-by tools.
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb-link element is used in the ejb-ref element to specify that an EJB
-reference is linked to an enterprise bean in the encompassing J2EE Application
-package. The value of the ejb-link element must be the ejb-name of an enterprise
-bean in the same J2EE Application package. Used in: ejb-ref
-Example: <ejb-link>EmployeeRecord</ejb-link>
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to an enterprise
-bean's home. The declaration consists of an optional description; the EJB
-reference name used in the code of the referencing application client; the
-expected type of the referenced enterprise bean; the expected home and remote
-interfaces of the referenced enterprise bean; and an optional ejb-link
-information. The optional ejb-link element is used to specify the referenced
-enterprise bean.
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote,
-ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The EJB
-reference is an entry in the application client's environment. It is recommended
-that name is prefixed with "ejb/". Used in: ejb-ref
-Example: <ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the referenced enterprise
-bean. The ejb-ref-type element must be one of the following:
-<ejb-ref-type>Entity</ejb-ref-type>
-<ejb-ref-type>Session</ejb-ref-type>
-Used in: ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of an application client's
-environment entries. The declaration consists of an optional description, the
-name of the environment entry, and an optional value.
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-type,
-env-entry-value?)>
-
-<!--
-The env-entry-name element contains the name of an application client's
-environment entry. Used in: env-entry
-Example: <env-entry-name>EmployeeAppDB</env-entry-name>
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of the
-environment entry value that is expected by the application client's code. The
-following are the legal values of env-entry-type: java.lang.Boolean,
-java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Byte,
-java.lang.Short, java.lang.Long, and java.lang.Float.
-
-Used in: env-entry
-
-Example:
-<env-entry-type>java.lang.Boolean</env-entry-type>
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an application client's
-environment entry. The value must be a String that is valid for the constructor
-of the specified type that takes a single String parameter.
-
-Used in: env-entry
-
-Example:
-<env-entry-value>/datasources/MyDatabase</env-entry-value>
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise bean's home
-interface.
-Used in: ejb-ref
-Example: <home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The icon element contains a small-icon and large-icon element which specify the
-URIs for a small and a large GIF or JPEG icon image used to represent the
-application client in a GUI tool.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The large-icon element contains the name of a file containing a large (32 x 32)
-icon image. The file name is a relative path within the application-client jar
-file. The image must be either in the JPEG or GIF format, and the file name must
-end with the suffix ".jpg" or ".gif" respectively. The icon can be used by
-tools.
-Example:
-<large-icon>lib/images/employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise bean's
-remote interface.
-Used in: ejb-ref
-Example:
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the enterprise bean code signs on
-programmatically to the resource manager, or whether the Container will sign on
-to the resource manager on behalf of the bean. In the latter case, the Container
-uses information that is supplied by the Deployer.
-The value of this element must be one of the two following:
-<res-auth>Application</res-auth>
-<res-auth>Container</res-auth>
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of the resource factory reference
-name. The resource factory reference name is the name of the application
-client's environment entry whose value contains the JNDI name of the data
-source.
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type is
-specified by the Java interface (or class) expected to be implemented by the
-data source.
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of application clients's
-reference to an external resource. It consists of an optional description, the
-resource factory reference name, the indication of the resource factory type
-expected by the application client's code, and the type of authentication (bean
-or container).
-
-Example:
-<resource-ref>
-<res-ref-name>EmployeeAppDB</res-ref-name>
-<res-type>javax.sql.DataSource</res-type>
-<res-auth>Container</res-auth>
-</resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)>
-<!--
-The small-icon element contains the name of a file containing a small (16 x 16)
-icon image. The file name is a relative path within the application-client jar
-file. The image must be either in the JPEG or GIF format, and the file name must
-end with the suffix ".jpg" or ".gif" respectively. The icon can be used by
-tools.
-Example:
-<small-icon>lib/images/employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools to easily make tool-specific references to
-the elements of the deployment descriptor.
- -->
-<!ATTLIST application-client id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_3.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_3.dtd
deleted file mode 100644
index f9d456d504..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_3.dtd
+++ /dev/null
@@ -1,506 +0,0 @@
-<!--
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, U.S.A.
-All rights reserved.
-
-Sun Microsystems, Inc. has intellectual property rights relating to
-technology embodied in the product that is described in this document.
-In particular, and without limitation, these intellectual property
-rights may include one or more of the U.S. patents listed at
-http://www.sun.com/patents and one or more additional patents or
-pending patent applications in the U.S. and in other countries.
-
-This document and the product to which it pertains are distributed
-under licenses restricting their use, copying, distribution, and
-decompilation. This document may be reproduced and distributed but may
-not be changed without prior written authorization of Sun and its
-licensors, if any.
-
-Third-party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and and
-Enterprise JavaBeans are trademarks or registered trademarks of Sun
-Microsystems, Inc. in the U.S. and other countries.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
-WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
-NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
-DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
-
-
-_________________________________________________________________________
-
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, E'tats-Unis.
-Tous droits re'serve's.
-
-Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
-relatants a` la technologie incorpore'e dans le produit qui est de'crit
-dans ce document. En particulier, et sans la limitation, ces droits de
-proprie'te' intellectuels peuvent inclure un ou plus des brevets
-ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
-brevets plus supple'mentaires ou les applications de brevet en attente
-dans les E'tats-Unis et dans les autres pays.
-
-Ce produit ou document est prote'ge' par un copyright et distribue'
-avec des licences qui en restreignent l'utilisation, la copie, la
-distribution, et la de'compilation. Ce documention associe n peut
-e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
-l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
-licence, le cas e'che'ant.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright et
-licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail et and
-Enterprise JavaBeans sont des marques de fabrique ou des marques
-de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
-pays.
-
-LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
-EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
-NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
-L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
-CONTREFAC,ON.
--->
-
-<!--
-This is the XML DTD for the J2EE 1.3 application client deployment
-descriptor. All J2EE 1.3 application client deployment descriptors
-must include a DOCTYPE of the following form:
-
- <!DOCTYPE application-client PUBLIC
- "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"
- "http://java.sun.com/dtd/application-client_1_3.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The application-client element is the root element of an application
-client deployment descriptor. The application client deployment
-descriptor describes the EJB components and external resources
-referenced by the application client.
--->
-<!ELEMENT application-client (icon?, display-name, description?,
- env-entry*, ejb-ref*, resource-ref*, resource-env-ref*,
- callback-handler?)>
-
-<!--
-The callback-handler element names a class provided by the
-application. The class must have a no args constructor and must
-implement the javax.security.auth.callback.CallbackHandler interface.
-The class will be instantiated by the application client container and
-used by the container to collect authentication information from the
-user.
-
-Used in: application-client
--->
-<!ELEMENT callback-handler (#PCDATA)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the application client jar file producer wants to provide to the consumer of
-the application client jar file (i.e., to the Deployer). Typically, the tools
-used by the application client jar file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: application-client, ejb-ref, env-entry, resource-env-ref,
-resource-ref
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: application-client
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb-link element is used in the ejb-ref element
-to specify that an EJB reference is linked to an
-enterprise bean.
-
-The name in the ejb-link element is composed of a
-path name specifying the ejb-jar containing the referenced enterprise
-bean with the ejb-name of the target bean appended and separated from
-the path name by "#". The path name is relative to the jar file
-containing the application client that is referencing the enterprise bean.
-This allows multiple enterprise beans with the same ejb-name to be
-uniquely identified.
-
-Used in: ejb-ref
-
-Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-an enterprise bean's home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the application client that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected home and remote interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: application-client
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
- home, remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The
-EJB reference is an entry in the application client's environment and is
-relative to the java:comp/env context. The name must be unique
-within the application client.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-ref
-
-Example:
-
-<ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the
-referenced enterprise bean.
-
-The ejb-ref-type element must be one of the following:
-
- <ejb-ref-type>Entity</ejb-ref-type>
- <ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of an application client's
-environment entry. The declaration consists of an optional
-description, the name of the environment entry, and an optional
-value. If a value is not specified, one must be supplied
-during deployment.
-
-Used in: application-client
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-type,
- env-entry-value?)>
-
-<!--
-The env-entry-name element contains the name of an application client's
-environment entry. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within an application client.
-
-Used in: env-entry
-
-Example:
-
-<env-entry-name>minAmount</env-entry-name>
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the application client's
-code.
-
-The following are the legal values of env-entry-type:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
-
-Used in: env-entry
-
-Example:
-
-<env-entry-type>java.lang.Boolean</env-entry-type>
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an application client's
-environment entry. The value must be a String that is valid for the
-constructor of the specified type that takes a single String
-parameter, or for java.lang.Character, a single character.
-
-Used in: env-entry
-
-Example:
-
-<env-entry-value>100.00</env-entry-value>
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref
-
-Example:
-
-<home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: application-client
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the application client's
-jar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref
-
-Example:
-
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the application client code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the application client. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
-
- <res-auth>Application</res-auth>
- <res-auth>Container</res-auth>
-
-Used in: resource-ref
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within an application client.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-sharing-scope element specifies whether connections obtained
-through the given resource manager connection factory reference can be
-shared. The value of this element, if specified, must be one of the
-two following:
-
- <res-sharing-scope>Shareable</res-sharing-scope>
- <res-sharing-scope>Unshareable</res-sharing-scope>
-
-The default value is Shareable.
-
-Used in: resource-ref
--->
-<!ELEMENT res-sharing-scope (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type
-is specified by the fully qualified Java language class or interface
-expected to be implemented by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-env-ref element contains a declaration of an application client's
-reference to an administered object associated with a resource
-in the application client's environment. It consists of an optional
-description, the resource environment reference name, and an
-indication of the resource environment reference type expected by
-the application client code.
-
-Used in: application-client
-
-Example:
-
-<resource-env-ref>
- <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
-</resource-env-ref>
--->
-<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
- resource-env-ref-type)>
-
-<!--
-The resource-env-ref-name element specifies the name of a resource
-environment reference; its value is the environment entry name used in
-the application client code. The name is a JNDI name relative to the
-java:comp/env context and must be unique within an application client.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!--
-The resource-env-ref-type element specifies the type of a resource
-environment reference. It is the fully qualified name of a Java
-language class or interface.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of an application client's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type
-expected by the application client code, the type of authentication
-(Application or Container), and an optional specification of the
-shareability of connections obtained from the resource (Shareable or
-Unshareable).
-
-Used in: application-client
-
-Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
- res-sharing-scope?)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the application client's
-jar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST application-client id ID #IMPLIED>
-<!ATTLIST callback-handler id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-sharing-scope id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-env-ref id ID #IMPLIED>
-<!ATTLIST resource-env-ref-name id ID #IMPLIED>
-<!ATTLIST resource-env-ref-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_4.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_4.xsd
deleted file mode 100644
index ec889717a5..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_1_4.xsd
+++ /dev/null
@@ -1,267 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.4">
- <xsd:annotation>
- <xsd:documentation>
- @(#)application-client_1_4.xsds 1.17 02/11/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2002 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the application client 1.4
- deployment descriptor. The deployment descriptor must
- be named "META-INF/application-client.xml" in the
- application client's jar file. All application client
- deployment descriptors must indicate the application
- client schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application-client xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"
- version="1.4">
- ...
- </application-client>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for J2EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="application-client" type="j2ee:application-clientType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application-client element is the root element of an
- application client deployment descriptor. The application
- client deployment descriptor describes the EJB components
- and external resources referenced by the application
- client.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of an
- application client's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name must
- be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:env-entry"/>
- <xsd:field xpath="j2ee:env-entry-name"/>
- </xsd:unique>
-
- <xsd:unique name="ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the application
- client's environment and is relative to the
- java:comp/env context. The name must be unique within the
- application client.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-ref"/>
- <xsd:field xpath="j2ee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the application client
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-env-ref"/>
- <xsd:field xpath="j2ee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the
- name of a message destination reference; its value is
- the message destination reference name used in the
- application client code. The name is a JNDI name
- relative to the java:comp/env context and must be unique
- within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:message-destination-ref"/>
- <xsd:field xpath="j2ee:message-destination-ref-name"/>
- </xsd:unique>
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="application-clientType">
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="env-entry"
- type="j2ee:env-entryType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="j2ee:ejb-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:group ref="j2ee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="j2ee:resource-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="j2ee:resource-env-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="j2ee:message-destination-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="callback-handler"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The callback-handler element names a class provided by
- the application. The class must have a no args
- constructor and must implement the
- javax.security.auth.callback.CallbackHandler
- interface. The class will be instantiated by the
- application client container and used by the container
- to collect authentication information from the user.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination"
- type="j2ee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="1.4"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.4.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_5.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_5.xsd
deleted file mode 100644
index e740827b74..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_5.xsd
+++ /dev/null
@@ -1,304 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="5">
- <xsd:annotation>
- <xsd:documentation>
- @(#)application-client_5.xsds 1.26 02/17/06
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the application client 5
- deployment descriptor. The deployment descriptor must
- be named "META-INF/application-client.xml" in the
- application client's jar file. All application client
- deployment descriptors must indicate the application
- client schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application-client xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/application-client_5.xsd"
- version="5">
- ...
- </application-client>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/application-client_5.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="application-client" type="javaee:application-clientType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application-client element is the root element of an
- application client deployment descriptor. The application
- client deployment descriptor describes the EJB components
- and external resources referenced by the application
- client.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of an
- application client's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name must
- be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
-
- <xsd:unique name="ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the application
- client's environment and is relative to the
- java:comp/env context. The name must be unique within the
- application client.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the application client
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the
- name of a message destination reference; its value is
- the message destination reference name used in the
- application client code. The name is a JNDI name
- relative to the java:comp/env context and must be unique
- within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="application-clientType">
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="env-entry"
- type="javaee:env-entryType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="javaee:ejb-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:group ref="javaee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="javaee:resource-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="javaee:resource-env-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="javaee:message-destination-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref"
- type="javaee:persistence-unit-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="post-construct"
- type="javaee:lifecycle-callbackType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="pre-destroy"
- type="javaee:lifecycle-callbackType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="callback-handler"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The callback-handler element names a class provided by
- the application. The class must have a no args
- constructor and must implement the
- javax.security.auth.callback.CallbackHandler
- interface. The class will be instantiated by the
- application client container and used by the container
- to collect authentication information from the user.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="5"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 5.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
-
- <xsd:attribute name="metadata-complete" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd
deleted file mode 100644
index 4a8e5e9e3b..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd
+++ /dev/null
@@ -1,311 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="6">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the application client 6
- deployment descriptor. The deployment descriptor must
- be named "META-INF/application-client.xml" in the
- application client's jar file. All application client
- deployment descriptors must indicate the application
- client schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application-client xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/application-client_6.xsd"
- version="6">
- ...
- </application-client>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/application-client_6.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="application-client"
- type="javaee:application-clientType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application-client element is the root element of an
- application client deployment descriptor. The application
- client deployment descriptor describes the EJB components
- and external resources referenced by the application
- client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of an
- application client's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name must
- be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- <xsd:unique name="ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the application
- client's environment and is relative to the
- java:comp/env context. The name must be unique within the
- application client.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the application client
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the
- name of a message destination reference; its value is
- the message destination reference name used in the
- application client code. The name is a JNDI name
- relative to the java:comp/env context and must be unique
- within an application client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="application-clientType">
- <xsd:sequence>
- <xsd:element name="module-name"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="env-entry"
- type="javaee:env-entryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="javaee:ejb-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="javaee:resource-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="javaee:resource-env-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="javaee:message-destination-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref"
- type="javaee:persistence-unit-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="post-construct"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-destroy"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="callback-handler"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The callback-handler element names a class provided by
- the application. The class must have a no args
- constructor and must implement the
- javax.security.auth.callback.CallbackHandler
- interface. The class will be instantiated by the
- application client container and used by the container
- to collect authentication information from the user.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="data-source"
- type="javaee:data-sourceType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="6"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 6.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="metadata-complete"
- type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_2.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_2.dtd
deleted file mode 100644
index 67573627b2..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_2.dtd
+++ /dev/null
@@ -1,197 +0,0 @@
-<!--
-Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-Copyright 1999 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-The alt-dd element specifies an optional URI to the post-assembly version of the
-deployment descriptor file for a particular J2EE module. The URI must specify
-the full pathname of the deployment descriptor file relative to the
-application's root directory. If alt-dd is not specified, the deployer must read
-the deployment descriptor from the default location and file name required by
-the respective component specification.
--->
-<!ELEMENT alt-dd (#PCDATA)>
-
-<!--
-The application element is the root element of a J2EE application deployment
-descriptor.
--->
-<!ELEMENT application (icon?, display-name, description?, module+,
-security-role*)>
-
-<!--
-The context-root element specifies the context root of a web application
--->
-<!ELEMENT context-root (#PCDATA)>
-
-<!--
-The description element provides a human readable description of the
-application. The description element should include any information that the
-application assembler wants to provide the deployer.
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element specifies an application name.
-The application name is assigned to the application by the application assembler
-and is used to identify the application to the deployer at deployment time.
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb element specifies the URI of a ejb-jar, relative to the top level of the
-application package.
--->
-<!ELEMENT ejb (#PCDATA)>
-
-<!--
-The icon element contains a small-icon and large-icon element which specify the
-URIs for a small and a large GIF or JPEG icon image to represent the application
-in a GUI.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The java element specifies the URI of a java application client module, relative
-to the top level of the application package.
--->
-<!ELEMENT java (#PCDATA)>
-
-<!--
-The large-icon element specifies the URI for a large GIF or JPEG icon image to
-represent the application in a GUI.
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The module element represents a single J2EE module and contains an ejb, java, or
-web element, which indicates the module type and contains a path to the module
-file, and an optional alt-dd element, which specifies an optional URI to the
-post-assembly version of the deployment descriptor.
-The application deployment descriptor must have one module element for each J2EE
-module in the application package.
--->
-<!ELEMENT module ((ejb | java | web), alt-dd?)>
-
-<!--
-The role-name element contains the name of a security role.
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The security-role element contains the definition of a security role which is
-global to the application. The definition consists of a description of the
-security role, and the security role name. The descriptions at this level
-override those in the component level security-role definitions and must be the
-descriptions tool display to the deployer.
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The small-icon element specifies the URI for a small GIF or JPEG icon image to
-represent the application in a GUI.
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The web element contains the web-uri and context-root of a web application
-module.
--->
-<!ELEMENT web (web-uri, context-root)>
-
-<!--
-The web-uri element specifies the URI of a web application file, relative to the
-top level of the application package.
--->
-<!ELEMENT web-uri (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools to easily make tool-specific references to
-the elements of the deployment descriptor.
- -->
-<!ATTLIST alt-dd id ID #IMPLIED>
-<!ATTLIST application id ID #IMPLIED>
-<!ATTLIST context-root id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST java id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST module id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST web id ID #IMPLIED>
-<!ATTLIST web-uri id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_3.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_3.dtd
deleted file mode 100644
index 22a49aca1e..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_3.dtd
+++ /dev/null
@@ -1,312 +0,0 @@
-<!--
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, U.S.A.
-All rights reserved.
-
-Sun Microsystems, Inc. has intellectual property rights relating to
-technology embodied in the product that is described in this document.
-In particular, and without limitation, these intellectual property
-rights may include one or more of the U.S. patents listed at
-http://www.sun.com/patents and one or more additional patents or
-pending patent applications in the U.S. and in other countries.
-
-This document and the product to which it pertains are distributed
-under licenses restricting their use, copying, distribution, and
-decompilation. This document may be reproduced and distributed but may
-not be changed without prior written authorization of Sun and its
-licensors, if any.
-
-Third-party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and and
-Enterprise JavaBeans are trademarks or registered trademarks of Sun
-Microsystems, Inc. in the U.S. and other countries.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
-WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
-NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
-DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
-
-
-_________________________________________________________________________
-
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, E'tats-Unis.
-Tous droits re'serve's.
-
-Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
-relatants a` la technologie incorpore'e dans le produit qui est de'crit
-dans ce document. En particulier, et sans la limitation, ces droits de
-proprie'te' intellectuels peuvent inclure un ou plus des brevets
-ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
-brevets plus supple'mentaires ou les applications de brevet en attente
-dans les E'tats-Unis et dans les autres pays.
-
-Ce produit ou document est prote'ge' par un copyright et distribue'
-avec des licences qui en restreignent l'utilisation, la copie, la
-distribution, et la de'compilation. Ce documention associe n peut
-e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
-l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
-licence, le cas e'che'ant.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright et
-licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail et and
-Enterprise JavaBeans sont des marques de fabrique ou des marques
-de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
-pays.
-
-LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
-EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
-NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
-L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
-CONTREFAC,ON.
--->
-
-<!--
-This is the XML DTD for the J2EE 1.3 application deployment
-descriptor. All J2EE 1.3 application deployment descriptors
-must include a DOCTYPE of the following form:
-
- <!DOCTYPE application PUBLIC
- "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
- "http://java.sun.com/dtd/application_1_3.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The application element is the root element of a J2EE application
-deployment descriptor.
--->
-<!ELEMENT application (icon?, display-name, description?, module+,
- security-role*)>
-
-<!--
-The alt-dd element specifies an optional URI to the post-assembly
-version of the deployment descriptor file for a particular J2EE module.
-The URI must specify the full pathname of the deployment descriptor
-file relative to the application's root directory. If alt-dd is not
-specified, the deployer must read the deployment descriptor from the
-default location and file name required by the respective component
-specification.
-
-Used in: module
--->
-<!ELEMENT alt-dd (#PCDATA)>
-
-<!--
-The connector element specifies the URI of a resource adapter archive
-file, relative to the top level of the application package.
-
-Used in: module
--->
-<!ELEMENT connector (#PCDATA)>
-
-<!--
-The context-root element specifies the context root of a web
-application.
-
-Used in: web
--->
-<!ELEMENT context-root (#PCDATA)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the application ear file producer wants to provide to the consumer of
-the application ear file (i.e., to the Deployer). Typically, the tools
-used by the application ear file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: application, security-role
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: application
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb element specifies the URI of an ejb-jar, relative to the top
-level of the application package.
-
-Used in: module
--->
-<!ELEMENT ejb (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: application
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The java element specifies the URI of a java application client module,
-relative to the top level of the application package.
-
-Used in: module
--->
-<!ELEMENT java (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the application's
-ear file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The module element represents a single J2EE module and contains a
-connector, ejb, java, or web element, which indicates the module type
-and contains a path to the module file, and an optional alt-dd element,
-which specifies an optional URI to the post-assembly version of the
-deployment descriptor.
-
-The application deployment descriptor must have one module element for
-each J2EE module in the application package.
-
-Used in: application
--->
-<!ELEMENT module ((connector | ejb | java | web), alt-dd?)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: security-role
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The security-role element contains the definition of a security
-role. The definition consists of an optional description of the
-security role, and the security role name.
-
-Used in: application
-
-Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the application's
-ear file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The web element contains the web-uri and context-root of a web
-application module.
-
-Used in: module
--->
-<!ELEMENT web (web-uri, context-root)>
-
-<!--
-The web-uri element specifies the URI of a web application file,
-relative to the top level of the application package.
-
-Used in: web
--->
-<!ELEMENT web-uri (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST alt-dd id ID #IMPLIED>
-<!ATTLIST application id ID #IMPLIED>
-<!ATTLIST connector id ID #IMPLIED>
-<!ATTLIST context-root id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST java id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST module id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST web id ID #IMPLIED>
-<!ATTLIST web-uri id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_4.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_4.xsd
deleted file mode 100644
index c458cfd5dd..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_1_4.xsd
+++ /dev/null
@@ -1,315 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.4">
- <xsd:annotation>
- <xsd:documentation>
- @(#)application_1_4.xsds 1.13 02/11/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the application 1.4 deployment
- descriptor. The deployment descriptor must be named
- "META-INF/application.xml" in the application's ear file.
- All application deployment descriptors must indicate
- the application schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
- version="1.4">
- ...
- </application>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for J2EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/application_1_4.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="application" type="j2ee:applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application element is the root element of a J2EE
- application deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="context-root-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element content must be unique
- in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:module/j2ee:web"/>
- <xsd:field xpath="j2ee:context-root"/>
- </xsd:unique>
-
- <xsd:unique name="security-role-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-name element content
- must be unique in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:security-role"/>
- <xsd:field xpath="j2ee:role-name"/>
- </xsd:unique>
-
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The applicationType defines the structure of the
- application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="module"
- type="j2ee:moduleType"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The application deployment descriptor must have one
- module element for each J2EE module in the
- application package. A module element is defined
- by moduleType definition.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="security-role"
- type="j2ee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="1.4"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.4.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="moduleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The moduleType defines a single J2EE module and contains a
- connector, ejb, java, or web element, which indicates the
- module type and contains a path to the module file, and an
- optional alt-dd element, which specifies an optional URI to
- the post-assembly version of the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="connector"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connector element specifies the URI of a
- resource adapter archive file, relative to the
- top level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb element specifies the URI of an ejb-jar,
- relative to the top level of the application
- package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="java"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java element specifies the URI of a java
- application client module, relative to the top
- level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="web"
- type="j2ee:webType"/>
- </xsd:choice>
- <xsd:element name="alt-dd"
- type="j2ee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The alt-dd element specifies an optional URI to the
- post-assembly version of the deployment descriptor
- file for a particular J2EE module. The URI must
- specify the full pathname of the deployment
- descriptor file relative to the application's root
- directory. If alt-dd is not specified, the deployer
- must read the deployment descriptor from the default
- location and file name required by the respective
- component specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webType defines the web-uri and context-root of
- a web application module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="web-uri"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-uri element specifies the URI of a web
- application file, relative to the top level of the
- application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="context-root"
- type="j2ee:string">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element specifies the context root
- of a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_5.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_5.xsd
deleted file mode 100644
index 4509662086..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_5.xsd
+++ /dev/null
@@ -1,336 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="5">
- <xsd:annotation>
- <xsd:documentation>
- @(#)application_5.xsds 1.17 08/05/05
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the application 5 deployment
- descriptor. The deployment descriptor must be named
- "META-INF/application.xml" in the application's ear file.
- All application deployment descriptors must indicate
- the application schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/application_5.xsd"
- version="5">
- ...
- </application>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/application_5.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="application" type="javaee:applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application element is the root element of a Java EE
- application deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="context-root-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element content must be unique
- in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:module/javaee:web"/>
- <xsd:field xpath="javaee:context-root"/>
- </xsd:unique>
-
- <xsd:unique name="security-role-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-name element content
- must be unique in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:unique>
-
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The applicationType defines the structure of the
- application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="module"
- type="javaee:moduleType"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The application deployment descriptor must have one
- module element for each Java EE module in the
- application package. A module element is defined
- by moduleType definition.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="security-role"
- type="javaee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="library-directory"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The library-directory element specifies the pathname
- of a directory within the application package, relative
- to the top level of the application package. All files
- named "*.jar" in this directory must be made available
- in the class path of all components included in this
- application package. If this element isn't specified,
- the directory named "lib" is searched. An empty element
- may be used to disable searching.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="5"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 5.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="moduleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The moduleType defines a single Java EE module and contains a
- connector, ejb, java, or web element, which indicates the
- module type and contains a path to the module file, and an
- optional alt-dd element, which specifies an optional URI to
- the post-assembly version of the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="connector"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connector element specifies the URI of a
- resource adapter archive file, relative to the
- top level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb element specifies the URI of an ejb-jar,
- relative to the top level of the application
- package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="java"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java element specifies the URI of a java
- application client module, relative to the top
- level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="web"
- type="javaee:webType"/>
- </xsd:choice>
- <xsd:element name="alt-dd"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The alt-dd element specifies an optional URI to the
- post-assembly version of the deployment descriptor
- file for a particular Java EE module. The URI must
- specify the full pathname of the deployment
- descriptor file relative to the application's root
- directory. If alt-dd is not specified, the deployer
- must read the deployment descriptor from the default
- location and file name required by the respective
- component specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webType defines the web-uri and context-root of
- a web application module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="web-uri"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-uri element specifies the URI of a web
- application file, relative to the top level of the
- application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="context-root"
- type="javaee:string">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element specifies the context root
- of a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd
deleted file mode 100644
index 26111c6acf..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd
+++ /dev/null
@@ -1,394 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="6">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the application 6 deployment
- descriptor. The deployment descriptor must be named
- "META-INF/application.xml" in the application's ear file.
- All application deployment descriptors must indicate
- the application schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <application xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/application_6.xsd"
- version="6">
- ...
- </application>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/application_6.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="application"
- type="javaee:applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application element is the root element of a Java EE
- application deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="context-root-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element content must be unique
- in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:module/javaee:web"/>
- <xsd:field xpath="javaee:context-root"/>
- </xsd:unique>
- <xsd:unique name="security-role-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-name element content
- must be unique in the ear.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:unique>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The applicationType defines the structure of the
- application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="application-name"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="initialize-in-order"
- type="javaee:generic-booleanType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- If initialize-in-order is true, modules must be initialized
- in the order they're listed in this deployment descriptor,
- with the exception of application client modules, which can
- be initialized in any order.
- If initialize-in-order is not set or set to false, the order
- of initialization is unspecified and may be product-dependent.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="module"
- type="javaee:moduleType"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The application deployment descriptor must have one
- module element for each Java EE module in the
- application package. A module element is defined
- by moduleType definition.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="security-role"
- type="javaee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="library-directory"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The library-directory element specifies the pathname
- of a directory within the application package, relative
- to the top level of the application package. All files
- named "*.jar" in this directory must be made available
- in the class path of all components included in this
- application package. If this element isn't specified,
- the directory named "lib" is searched. An empty element
- may be used to disable searching.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="env-entry"
- type="javaee:env-entryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="javaee:ejb-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-local-ref"
- type="javaee:ejb-local-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="javaee:resource-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="javaee:resource-env-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="javaee:message-destination-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-context-ref"
- type="javaee:persistence-context-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref"
- type="javaee:persistence-unit-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="data-source"
- type="javaee:data-sourceType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="6"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 6.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="moduleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The moduleType defines a single Java EE module and contains a
- connector, ejb, java, or web element, which indicates the
- module type and contains a path to the module file, and an
- optional alt-dd element, which specifies an optional URI to
- the post-assembly version of the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="connector"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connector element specifies the URI of a
- resource adapter archive file, relative to the
- top level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb element specifies the URI of an ejb-jar,
- relative to the top level of the application
- package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="java"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java element specifies the URI of a java
- application client module, relative to the top
- level of the application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="web"
- type="javaee:webType"/>
- </xsd:choice>
- <xsd:element name="alt-dd"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The alt-dd element specifies an optional URI to the
- post-assembly version of the deployment descriptor
- file for a particular Java EE module. The URI must
- specify the full pathname of the deployment
- descriptor file relative to the application's root
- directory. If alt-dd is not specified, the deployer
- must read the deployment descriptor from the default
- location and file name required by the respective
- component specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webType defines the web-uri and context-root of
- a web application module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="web-uri"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-uri element specifies the URI of a web
- application file, relative to the top level of the
- application package.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="context-root"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The context-root element specifies the context root
- of a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/beans_1_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/beans_1_0.xsd
deleted file mode 100644
index 16109adf91..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/beans_1_0.xsd
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
- <!--
- JBoss, Home of Professional Open Source Copyright 2008, Red Hat
- Middleware LLC, and individual contributors by the @authors tag.
- See the copyright.txt in the distribution for a full listing of
- individual contributors. Licensed under the Apache License,
- Version 2.0 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License
- at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee" version="1.0">
-
- <xs:annotation>
- <xs:documentation>
- Contexts and Dependency Injection (CDI) defines
- a set of complementary services that help improve the structure
- of application code. beans.xml is used to enable CDI services
- for the current bean archive as well as to enable named
- interceptors, decorators and alternatives for the current bean
- archive.
- </xs:documentation>
- </xs:annotation>
-
- <xs:element name="beans">
- <xs:annotation>
- <xs:documentation>
- Bean classes of enabled beans must be
- deployed in bean archives. A library jar, EJB jar,
- application client jar or rar archive is a bean archive if
- it has a file named beans.xml in the META-INF directory. The
- WEB-INF/classes directory of a war is a bean archive if
- there is a file named beans.xml in the WEB-INF directory of
- the war. A directory in the JVM classpath is a bean archive
- if it has a file named beans.xml in the META-INF directory.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:all>
- <xs:element ref="javaee:interceptors" minOccurs="0" />
- <xs:element ref="javaee:decorators" minOccurs="0" />
- <xs:element ref="javaee:alternatives" minOccurs="0" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="interceptors">
- <xs:annotation>
- <xs:documentation>
- By default, a bean archive has no enabled
- interceptors bound via interceptor bindings. An interceptor
- must be explicitly enabled by listing its class under the
- &lt;interceptors&gt; element of the beans.xml file of the
- bean archive. The order of the interceptor declarations
- determines the interceptor ordering. Interceptors which
- occur earlier in the list are called first. If the same
- class is listed twice under the &lt;interceptors&gt;
- element, the container automatically detects the problem and
- treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child &lt;class&gt; element
- must specify the name of an interceptor class. If
- there is no class with the specified name, or if
- the class with the specified name is not an
- interceptor class, the container automatically
- detects the problem and treats it as a deployment
- problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="decorators">
- <xs:annotation>
- <xs:documentation>
- By default, a bean archive has no enabled
- decorators. A decorator must be explicitly enabled by
- listing its bean class under the &lt;decorators&gt; element
- of the beans.xml file of the bean archive. The order of the
- decorator declarations determines the decorator ordering.
- Decorators which occur earlier in the list are called first.
- If the same class is listed twice under the
- &lt;decorators&gt; element, the container automatically
- detects the problem and treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child &lt;class&gt; element
- must specify the name of a decorator class. If
- there is no class with the specified name, or if
- the class with the specified name is not a
- decorator class, the container automatically
- detects the problem and treats it as a deployment
- problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="alternatives">
- <xs:annotation>
- <xs:documentation>
- An alternative is a bean that must be
- explicitly declared in the beans.xml file if it should be
- available for lookup, injection or EL resolution. By
- default, a bean archive has no selected alternatives. An
- alternative must be explicitly declared using the
- &lt;alternatives&gt; element of the beans.xml file of the
- bean archive. The &lt;alternatives&gt; element contains a
- list of bean classes and stereotypes. An alternative is
- selected for the bean archive if either: the alternative is
- a managed bean or session bean and the bean class of the
- bean is listed, or the alternative is a producer method,
- field or resource, and the bean class that declares the
- method or field is listed, or any @Alternative stereotype of
- the alternative is listed.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="class" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child &lt;class&gt; element
- must specify the name of an alternative bean class.
- If there is no class with the specified name, or if
- the class with the specified name is not an
- alternative bean class, the container automatically
- detects the problem and treats it as a deployment
- problem. If the same class is listed twice under
- the &lt;alternatives&gt; element, the container
- automatically detects the problem and treats it as
- a deployment problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="stereotype" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Each child &lt;stereotype&gt;
- element must specify the name of an @Alternative
- stereotype annotation. If there is no annotation
- with the specified name, or the annotation is not
- an @Alternative stereotype, the container
- automatically detects the problem and treats it as
- a deployment problem. If the same stereotype is
- listed twice under the &lt;alternatives&gt;
- element, the container automatically detects the
- problem and treats it as a deployment problem.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_0.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_0.dtd
deleted file mode 100644
index 1ab3b55a0d..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_0.dtd
+++ /dev/null
@@ -1,557 +0,0 @@
-<!--
-Copyright 2000-2001 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-
-Copyright 2000-2001 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-This is the XML DTD for the Connector 1.0 deployment descriptor.
-All Connector 1.0 deployment descriptors must include a DOCTYPE
-of the following form:
-
- <!DOCTYPE connector PUBLIC
- "-//Sun Microsystems, Inc.//DTD Connector 1.0//EN"
- "http://java.sun.com/dtd/connector_1_0.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The connector element is the root element of the deployment descriptor
-for the resource adapter. This element includes general information - vendor
-name, version, specification version supported, icon - about the
-resource adapter module. It also includes information specific to the
-implementation of the resource adapter library as specified through
-the element resourceadapter.
--->
-<!ELEMENT connector (display-name?, description?, icon?, vendor-name,
-spec-version, eis-type, version, license?, resourceadapter)>
-
-<!--
-The element authentication-mechanism specifies an authentication mechanism
-supported by the resource adapter. Note that this support is for
-the resource adapter and not for the underlying EIS instance. The
-optional description specifies any resource adapter specific requirement
-for the support of security contract and authentication mechanism.
-
-Note that BasicPassword mechanism type should support the
-javax.resource.spi.security.PasswordCredential interface.
-The Kerbv5 mechanism type should support the
-javax.resource.spi.security.GenericCredential interface.
-
-Used in: resourceadapter
--->
-<!ELEMENT authentication-mechanism (
-description?, authentication-mechanism-type, credential-interface)>
-
-<!--
-The element authentication-mechanism-type specifies type of an authentication
-mechanism.
-
-The example values are:
- <authentication-mechanism-type>BasicPassword
- </authentication-mechanism-type>
- <authentication-mechanism-type>Kerbv5
- </authentication-mechanism-type>
-
-Any additional security mechanisms are outside the scope of the
-Connector architecture specification.
-
-Used in: authentication-mechanism
--->
-<!ELEMENT authentication-mechanism-type (#PCDATA)>
-
-<!--
-The element config-property contains a declaration of a single
-configuration property for a ManagedConnectionFactory instance.
-
-Each ManagedConnectionFactory instance creates connections to a
-specific EIS instance based on the properties configured on the
-ManagedConnectionFactory instance. The configurable properties are
-specified only once in the deployment descriptor, even though a
-resource adapter can be used to configure multiple ManagedConnnection-
-Factory instances (that create connections to different instances of
-the same EIS).
-
-The declaration consists of an optional description, name, type
-and an optional value of the configuration property. If the resource
-adapter provider does not specify a value than the deployer is
-responsible for providing a valid value for a configuration property.
-
-Any bounds or well-defined values of properties should be described
-in the description element.
-
-Used in: resourceadapter
--->
-<!ELEMENT config-property (description?, config-property-name,
-config-property-type, config-property-value?)>
-
-<!--
-The element config-property-name contains the name of a configuration
-property.
-
-The connector architecture defines a set of well-defined properties
-all of type java.lang.String. These are as follows:
- <config-property-name>ServerName</config-property-name>
- <config-property-name>PortNumber</config-property-name>
- <config-property-name>UserName</config-property-name>
- <config-property-name>Password</config-property-name>
- <config-property-name>ConnectionURL</config-property-name>
-
-A resource adapter provider can extend this property set to include
-properties specific to the resource adapter and its underlying EIS.
-
-Used in: config-property
-
-Example: <config-property-name>ServerName</config-property-name>
--->
-<!ELEMENT config-property-name (#PCDATA)>
-
-<!--
-The element config-property-type contains the fully qualified Java
-type of a configuration property as required by ManagedConnection-
-Factory instance.
-
-The following are the legal values of config-property-type:
- java.lang.Boolean, java.lang.String, java.lang.Integer,
- java.lang.Double, java.lang.Byte, java.lang.Short,
- java.lang.Long, java.lang.Float, java.lang.Character
-
-Used in: config-property
-
-Example: <config-property-type>java.lang.String</config-property-type>
--->
-<!ELEMENT config-property-type (#PCDATA)>
-
-<!--
-The element config-property-value contains the value of a configuration
-entry.
-
-Used in: config-property
-
-Example: <config-property-value>WombatServer</config-property-value>
--->
-<!ELEMENT config-property-value (#PCDATA)>
-
-<!--
-The element connection-impl-class specifies the fully-qualified
-name of the Connection class that implements resource adapter
-specific Connection interface.
-
-Used in: resourceadapter
-
-Example: <connection-impl-class>com.wombat.ConnectionImpl
- </connection-impl-class>
--->
-<!ELEMENT connection-impl-class (#PCDATA)>
-
-<!--
-The element connection-interface specifies the fully-qualified
-name of the Connection interface supported by the resource
-adapter.
-
-Used in: resourceadapter
-
-Example: <connection-interface>javax.resource.cci.Connection
- </connection-interface>
--->
-<!ELEMENT connection-interface (#PCDATA)>
-
-<!--
-The element connectionfactory-impl-class specifies the fully-qualified
-name of the ConnectionFactory class that implements resource adapter
-specific ConnectionFactory interface.
-
-Used in: resourceadapter
-
-Example: <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
- </connectionfactory-impl-class>
--->
-<!ELEMENT connectionfactory-impl-class (#PCDATA)>
-
-<!--
-The element connectionfactory-interface specifies the fully-qualified
-name of the ConnectionFactory interface supported by the resource
-adapter.
-
-Used in: resourceadapter
-
-Example: <connectionfactory-interface>com.wombat.ConnectionFactory
- </connectionfactory-interface>
-OR
-<connectionfactory-interface>javax.resource.cci.ConnectionFactory
- </connectionfactory-interface>
--->
-<!ELEMENT connectionfactory-interface (#PCDATA)>
-
-<!--
-The element credential-interface specifies the interface that the
-resource adapter implementation supports for the representation
-of the credentials. This element should be used by application server
-to find out the Credential interface it should use as part of the
-security contract.
-
-The possible values are:
- <credential-interface>javax.resource.spi.security.PasswordCredential
- </credential-interface>
- <credential-interface>javax.resource.spi.security.GenericCredential
- </credential-interface>
-
-Used in: authentication-mechanism
--->
-<!ELEMENT credential-interface (#PCDATA)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the resource adapter rar file producer wants to provide to the consumer of
-the resource adapter rar file (i.e., to the Deployer). Typically, the tools
-used by the resource adapter rar file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: authentication-mechanism, config-property, connector, license,
-security-permission
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: connector
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The element eis-type contains information about the type of the
-EIS. For example, the type of an EIS can be product name of EIS
-independent of any version info.
-
-This helps in identifying EIS instances that can be used with
-this resource adapter.
-
-Used in: connector
--->
-<!ELEMENT eis-type (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: connector
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the resource adapter's
-rar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The element license specifies licensing requirements for the resource
-adapter module. This element specifies whether a license is required
-to deploy and use this resource adapter, and an optional description
-of the licensing terms (examples: duration of license, number of
-connection restrictions).
-
-Used in: connector
--->
-<!ELEMENT license (description?, license-required)>
-
-<!--
-The element license-required specifies whether a license is required
-to deploy and use the resource adapter. This element must be one of
-the following:
-
- <license-required>true</license-required>
- <license-required>false</license-required>
-
-Used in: license
--->
-<!ELEMENT license-required (#PCDATA)>
-
-<!--
-The element managedconnectionfactory-class specifies the fully qualified
-name of the Java class that implements the javax.resource.spi.Managed-
-ConnectionFactory interface. This Java class is provided as part of
-resource adapter's implementation of connector architecture specified
-contracts.
-
-Used in: resourceadapter
-
-Example:
- <managedconnectionfactory-class>com.wombat.ManagedConnectionFactoryImpl
- </managedconnectionfactory-class>
--->
-<!ELEMENT managedconnectionfactory-class (#PCDATA)>
-
-<!--
-The element reauthentication-support specifies whether the resource
-adapter implementation supports re-authentication of existing Managed-
-Connection instance. Note that this information is for the resource
-adapter implementation and not for the underlying EIS instance.
-
-This element must be one of the following:
- <reauthentication-support>true</reauthentication-support>
- <reauthentication-support>false</reauthentication-support>
-Used in: resourceadapter
--->
-<!ELEMENT reauthentication-support (#PCDATA)>
-
-<!--
-The element resourceadapter specifies information about the resource
-adapter. The information includes fully-qualified names of
-class/interfaces required as part of the connector architecture
-specified contracts, level of transaction support provided,
-configurable properties for ManagedConnectionFactory instances,
-one or more authentication mechanisms supported and additional
-required security permissions.
-
-If there is no authentication-mechanism specified as part of
-resource adapter element then the resource adapter does not
-support any standard security authentication mechanisms as part
-of security contract. The application server ignores the security
-part of the system contracts in this case.
-
-Used in: connector
--->
-<!ELEMENT resourceadapter (
-managedconnectionfactory-class, connectionfactory-interface,
-connectionfactory-impl-class, connection-interface,
-connection-impl-class, transaction-support, config-property*,
-authentication-mechanism*, reauthentication-support, security-permission*
-)>
-
-<!--
-The element security permission specifies a security permission that
-is required by the resource adapter code.
-
-The security permission listed in the deployment descriptor are ones
-that are different from those required by the default permission set
-as specified in the connector specification. The optional description
-can mention specific reason that resource adapter requires a given
-security permission.
-
-Used in: resourceadapter
--->
-<!ELEMENT security-permission (description?, security-permission-spec)>
-
-<!--
-The element permission-spec specifies a security permission based
-on the Security policy file syntax. Refer to the following URL for
-Sun's implementation of the security permission specification:
-
-http:
-
-Used in: security-permission
--->
-<!ELEMENT security-permission-spec (#PCDATA)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the resource adapter's
-rar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The element spec-version specifies the version of the connector
-architecture specification that is supported by this resource
-adapter. This information enables deployer to configure the resource
-adapter to support deployment and runtime requirements of the
-corresponding connector architecture specification.
-
-Used in: connector
-
-Example:
- <spec-version>1.0</spec-version>
--->
-<!ELEMENT spec-version (#PCDATA)>
-
-<!--
-The transaction-support element specifies the level of transaction
-support provided by the resource adapter.
-The value of transaction-support must be one of the following:
- <transaction-support>NoTransaction</transaction-support>
- <transaction-support>LocalTransaction</transaction-support>
- <transaction-support>XATransaction</transaction-support>
-
-Used in: resourceadapter
--->
-<!ELEMENT transaction-support (#PCDATA)>
-
-<!--
-The element vendor-name specifies the name of resource adapter provider
-vendor.
-
-Used in: connector
-
-Example:
- <vendor-name>Wombat Corp.</vendor-name>
--->
-<!ELEMENT vendor-name (#PCDATA)>
-
-<!--
-The element version specifies a string-based version of the
-resource adapter from the resource adapter provider.
-
-Used in: connector
-
-Example:
- <version>1.0</version>
--->
-<!ELEMENT version (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST authentication-mechanism id ID #IMPLIED>
-<!ATTLIST authentication-mechanism-type id ID #IMPLIED>
-<!ATTLIST config-property id ID #IMPLIED>
-<!ATTLIST config-property-name id ID #IMPLIED>
-<!ATTLIST config-property-type id ID #IMPLIED>
-<!ATTLIST config-property-value id ID #IMPLIED>
-<!ATTLIST connection-impl-class id ID #IMPLIED>
-<!ATTLIST connection-interface id ID #IMPLIED>
-<!ATTLIST connectionfactory-impl-class id ID #IMPLIED>
-<!ATTLIST connectionfactory-interface id ID #IMPLIED>
-<!ATTLIST connector id ID #IMPLIED>
-<!ATTLIST credential-interface id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST eis-type id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST license id ID #IMPLIED>
-<!ATTLIST license-required id ID #IMPLIED>
-<!ATTLIST managedconnectionfactory-class id ID #IMPLIED>
-<!ATTLIST reauthentication-support id ID #IMPLIED>
-<!ATTLIST resourceadapter id ID #IMPLIED>
-<!ATTLIST security-permission id ID #IMPLIED>
-<!ATTLIST security-permission-spec id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST spec-version id ID #IMPLIED>
-<!ATTLIST transaction-support id ID #IMPLIED>
-<!ATTLIST vendor-name id ID #IMPLIED>
-<!ATTLIST version id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_5.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_5.xsd
deleted file mode 100644
index 26d19129c4..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_5.xsd
+++ /dev/null
@@ -1,1036 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.5">
- <xsd:annotation>
- <xsd:documentation>
- @(#)connector_1_5.xsds 1.27 06/17/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the Connector 1.5 deployment
- descriptor. The deployment descriptor must be named
- "META-INF/ra.xml" in the connector's rar file. All Connector
- deployment descriptors must indicate the connector resource
- adapter schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <connector xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
- version="1.5">
- ...
- </connector>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for J2EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="connector" type="j2ee:connectorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connector element is the root element of the deployment
- descriptor for the resource adapter. This element includes
- general information - vendor name, resource adapter version,
- icon - about the resource adapter module. It also includes
- information specific to the implementation of the resource
- adapter library as specified through the element
- resourceadapter.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activationspecType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activationspecType specifies an activation
- specification. The information includes fully qualified
- Java class name of an activation specification and a set of
- required configuration property names.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="activationspec-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element activationspec-class specifies the fully
- qualified Java class name of the activation
- specification class. This class must implement the
- javax.resource.spi.ActivationSpec interface. The
- implementation of this class is required to be a
- JavaBean.
-
- Example:
- <activationspec-class>com.wombat.ActivationSpecImpl
- </activationspec-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="required-config-property"
- type="j2ee:required-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="adminobjectType">
- <xsd:annotation>
- <xsd:documentation>
-
- The adminobjectType specifies information about an
- administered object. Administered objects are specific to a
- messaging style or message provider. This contains
- information on the Java type of the interface implemented by
- an administered object, its Java class name and its
- configuration properties.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="adminobject-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element adminobject-interface specifies the
- fully qualified name of the Java type of the
- interface implemented by an administered object.
-
- Example:
- <adminobject-interface>javax.jms.Destination
- </adminobject-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="adminobject-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element adminobject-class specifies the fully
- qualified Java class name of an administered object.
-
- Example:
- <adminobject-class>com.wombat.DestinationImpl
- </adminobject-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="config-property"
- type="j2ee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="authentication-mechanismType">
- <xsd:annotation>
- <xsd:documentation>
-
- The authentication-mechanismType specifies an authentication
- mechanism supported by the resource adapter. Note that this
- support is for the resource adapter and not for the
- underlying EIS instance. The optional description specifies
- any resource adapter specific requirement for the support of
- security contract and authentication mechanism.
-
- Note that BasicPassword mechanism type should support the
- javax.resource.spi.security.PasswordCredential interface.
- The Kerbv5 mechanism type should support the
- org.ietf.jgss.GSSCredential interface or the deprecated
- javax.resource.spi.security.GenericCredential interface.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="authentication-mechanism-type"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element authentication-mechanism-type specifies
- type of an authentication mechanism.
-
- The example values are:
-
- <authentication-mechanism-type>BasicPassword
- </authentication-mechanism-type>
-
- <authentication-mechanism-type>Kerbv5
- </authentication-mechanism-type>
-
- Any additional security mechanisms are outside the
- scope of the Connector architecture specification.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="credential-interface"
- type="j2ee:credential-interfaceType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-property-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The config-property-nameType contains the name of a
- configuration property.
-
- The connector architecture defines a set of well-defined
- properties all of type java.lang.String. These are as
- follows.
-
- ServerName
- PortNumber
- UserName
- Password
- ConnectionURL
-
- A resource adapter provider can extend this property set to
- include properties specific to the resource adapter and its
- underlying EIS.
-
- Possible values include
- ServerName
- PortNumber
- UserName
- Password
- ConnectionURL
-
- Example: <config-property-name>ServerName</config-property-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-property-typeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The config-property-typeType contains the fully
- qualified Java type of a configuration property.
-
- The following are the legal values:
- java.lang.Boolean, java.lang.String, java.lang.Integer,
- java.lang.Double, java.lang.Byte, java.lang.Short,
- java.lang.Long, java.lang.Float, java.lang.Character
-
- Used in: config-property
-
- Example:
- <config-property-type>java.lang.String</config-property-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="java.lang.Boolean"/>
- <xsd:enumeration value="java.lang.String"/>
- <xsd:enumeration value="java.lang.Integer"/>
- <xsd:enumeration value="java.lang.Double"/>
- <xsd:enumeration value="java.lang.Byte"/>
- <xsd:enumeration value="java.lang.Short"/>
- <xsd:enumeration value="java.lang.Long"/>
- <xsd:enumeration value="java.lang.Float"/>
- <xsd:enumeration value="java.lang.Character"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The config-propertyType contains a declaration of a single
- configuration property that may be used for providing
- configuration information.
-
- The declaration consists of an optional description, name,
- type and an optional value of the configuration property. If
- the resource adapter provider does not specify a value than
- the deployer is responsible for providing a valid value for
- a configuration property.
-
- Any bounds or well-defined values of properties should be
- described in the description element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="config-property-name"
- type="j2ee:config-property-nameType"/>
- <xsd:element name="config-property-type"
- type="j2ee:config-property-typeType"/>
- <xsd:element name="config-property-value"
- type="j2ee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element config-property-value contains the value
- of a configuration entry. Note, it is possible for a
- resource adapter deployer to override this
- configuration information during deployment.
-
- Example:
- <config-property-value>WombatServer</config-property-value>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="connection-definitionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connection-definitionType defines a set of connection
- interfaces and classes pertaining to a particular connection
- type. This also includes configurable properties for
- ManagedConnectionFactory instances that may be produced out
- of this set.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="managedconnectionfactory-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element managedconnectionfactory-class specifies
- the fully qualified name of the Java class that
- implements the
- javax.resource.spi.ManagedConnectionFactory interface.
- This Java class is provided as part of resource
- adapter's implementation of connector architecture
- specified contracts. The implementation of this
- class is required to be a JavaBean.
-
- Example:
- <managedconnectionfactory-class>
- com.wombat.ManagedConnectionFactoryImpl
- </managedconnectionfactory-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property"
- type="j2ee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="connectionfactory-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element connectionfactory-interface specifies
- the fully qualified name of the ConnectionFactory
- interface supported by the resource adapter.
-
- Example:
- <connectionfactory-interface>com.wombat.ConnectionFactory
- </connectionfactory-interface>
-
- OR
-
- <connectionfactory-interface>javax.resource.cci.ConnectionFactory
- </connectionfactory-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="connectionfactory-impl-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element connectionfactory-impl-class specifies
- the fully qualified name of the ConnectionFactory
- class that implements resource adapter
- specific ConnectionFactory interface.
-
- Example:
-
- <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
- </connectionfactory-impl-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The connection-interface element specifies the fully
- qualified name of the Connection interface supported
- by the resource adapter.
-
- Example:
-
- <connection-interface>javax.resource.cci.Connection
- </connection-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-impl-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The connection-impl-classType specifies the fully
- qualified name of the Connection class that
- implements resource adapter specific Connection
- interface. It is used by the connection-impl-class
- elements.
-
- Example:
-
- <connection-impl-class>com.wombat.ConnectionImpl
- </connection-impl-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="connectorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connectorType defines a resource adapter.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="vendor-name"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element vendor-name specifies the name of
- resource adapter provider vendor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="eis-type"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element eis-type contains information about the
- type of the EIS. For example, the type of an EIS can
- be product name of EIS independent of any version
- info.
-
- This helps in identifying EIS instances that can be
- used with this resource adapter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="resourceadapter-version"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element resourceadapter-version specifies a string-based version
- of the resource adapter from the resource adapter
- provider.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="license"
- type="j2ee:licenseType"
- minOccurs="0"/>
- <xsd:element name="resourceadapter"
- type="j2ee:resourceadapterType"/>
-
- </xsd:sequence>
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="1.5"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The version specifies the version of the
- connector architecture specification that is
- supported by this resource adapter. This information
- enables deployer to configure the resource adapter to
- support deployment and runtime requirements of the
- corresponding connector architecture specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="credential-interfaceType">
- <xsd:annotation>
- <xsd:documentation>
-
- The credential-interfaceType specifies the
- interface that the resource adapter implementation
- supports for the representation of the
- credentials. This element(s) that use this type,
- i.e. credential-interface, should be used by
- application server to find out the Credential
- interface it should use as part of the security
- contract.
-
- The possible values are:
-
- javax.resource.spi.security.PasswordCredential
- org.ietf.jgss.GSSCredential
- javax.resource.spi.security.GenericCredential
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType">
- <xsd:enumeration
- value="javax.resource.spi.security.PasswordCredential"/>
- <xsd:enumeration
- value="org.ietf.jgss.GSSCredential"/>
- <xsd:enumeration
- value="javax.resource.spi.security.GenericCredential"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="inbound-resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The inbound-resourceadapterType specifies information
- about an inbound resource adapter. This contains information
- specific to the implementation of the resource adapter
- library as specified through the messageadapter element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="messageadapter"
- type="j2ee:messageadapterType"
- minOccurs="0">
- <xsd:unique name="messagelistener-type-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The messagelistener-type element content must be
- unique in the messageadapter. Several messagelisteners
- can not use the same messagelistener-type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:messagelistener"/>
- <xsd:field xpath="j2ee:messagelistener-type"/>
- </xsd:unique>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="licenseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The licenseType specifies licensing requirements for the
- resource adapter module. This type specifies whether a
- license is required to deploy and use this resource adapter,
- and an optional description of the licensing terms
- (examples: duration of license, number of connection
- restrictions). It is used by the license element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="license-required"
- type="j2ee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element license-required specifies whether a
- license is required to deploy and use the
- resource adapter. This element must be one of
- the following, "true" or "false".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="messageadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The messageadapterType specifies information about the
- messaging capabilities of the resource adapter. This
- contains information specific to the implementation of the
- resource adapter library as specified through the
- messagelistener element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="messagelistener"
- type="j2ee:messagelistenerType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="messagelistenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The messagelistenerType specifies information about a
- specific message listener supported by the messaging
- resource adapter. It contains information on the Java type
- of the message listener interface and an activation
- specification.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="messagelistener-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element messagelistener-type specifies the fully
- qualified name of the Java type of a message
- listener interface.
-
- Example:
-
- <messagelistener-type>javax.jms.MessageListener
- </messagelistener-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="activationspec"
- type="j2ee:activationspecType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="outbound-resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The outbound-resourceadapterType specifies information about
- an outbound resource adapter. The information includes fully
- qualified names of classes/interfaces required as part of
- the connector architecture specified contracts for
- connection management, level of transaction support
- provided, one or more authentication mechanisms supported
- and additional required security permissions.
-
- If there is no authentication-mechanism specified as part of
- resource adapter element then the resource adapter does not
- support any standard security authentication mechanisms as
- part of security contract. The application server ignores
- the security part of the system contracts in this case.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="connection-definition"
- type="j2ee:connection-definitionType"
- maxOccurs="unbounded"/>
- <xsd:element name="transaction-support"
- type="j2ee:transaction-supportType"/>
- <xsd:element name="authentication-mechanism"
- type="j2ee:authentication-mechanismType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="reauthentication-support"
- type="j2ee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element reauthentication-support specifies
- whether the resource adapter implementation supports
- re-authentication of existing Managed- Connection
- instance. Note that this information is for the
- resource adapter implementation and not for the
- underlying EIS instance. This element must have
- either a "true" or "false" value.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="required-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The required-config-propertyType contains a declaration
- of a single configuration property used for specifying a
- required configuration property name. It is used
- by required-config-property elements.
-
- Example:
-
- <required-config-property>Destination</required-config-property>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="config-property-name"
- type="j2ee:config-property-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resourceadapterType specifies information about the
- resource adapter. The information includes fully qualified
- resource adapter Java class name, configuration properties,
- information specific to the implementation of the resource
- adapter library as specified through the
- outbound-resourceadapter and inbound-resourceadapter
- elements, and an optional set of administered objects.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="resourceadapter-class"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element resourceadapter-class specifies the
- fully qualified name of a Java class that implements
- the javax.resource.spi.ResourceAdapter
- interface. This Java class is provided as part of
- resource adapter's implementation of connector
- architecture specified contracts. The implementation
- of this class is required to be a JavaBean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="config-property"
- type="j2ee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="outbound-resourceadapter"
- type="j2ee:outbound-resourceadapterType"
- minOccurs="0">
- <xsd:unique name="connectionfactory-interface-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The connectionfactory-interface element content
- must be unique in the outbound-resourceadapter.
- Multiple connection-definitions can not use the
- same connectionfactory-type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:connection-definition"/>
- <xsd:field xpath="j2ee:connectionfactory-interface"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="inbound-resourceadapter"
- type="j2ee:inbound-resourceadapterType"
- minOccurs="0"/>
- <xsd:element name="adminobject"
- type="j2ee:adminobjectType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-permission"
- type="j2ee:security-permissionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-permissionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-permissionType specifies a security
- permission that is required by the resource adapter code.
-
- The security permission listed in the deployment descriptor
- are ones that are different from those required by the
- default permission set as specified in the connector
- specification. The optional description can mention specific
- reason that resource adapter requires a given security
- permission.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-permission-spec"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element security-permission-spec specifies a security
- permission based on the Security policy file
- syntax. Refer to the following URL for Sun's
- implementation of the security permission
- specification:
-
- http://java.sun.com/products/jdk/1.4/docs/guide/security/PolicyFiles.html#FileSyntax
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transaction-supportType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transaction-supportType specifies the level of
- transaction support provided by the resource adapter. It is
- used by transaction-support elements.
-
- The value must be one of the following:
-
- NoTransaction
- LocalTransaction
- XATransaction
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="NoTransaction"/>
- <xsd:enumeration value="LocalTransaction"/>
- <xsd:enumeration value="XATransaction"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd
deleted file mode 100644
index 45d875c486..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd
+++ /dev/null
@@ -1,1261 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.6">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the Connector 1.6 deployment
- descriptor. The deployment descriptor must be named
- "META-INF/ra.xml" in the connector's rar file. All Connector
- deployment descriptors must indicate the connector resource
- adapter schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <connector xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/connector_1_6.xsd"
- version="1.6">
- ...
- </connector>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/connector_1_6.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="connector"
- type="javaee:connectorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connector element is the root element of the deployment
- descriptor for the resource adapter. This element includes
- general information - vendor name, resource adapter version,
- icon - about the resource adapter module. It also includes
- information specific to the implementation of the resource
- adapter library as specified through the element
- resourceadapter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activationspecType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activationspecType specifies an activation
- specification. The information includes fully qualified
- Java class name of an activation specification and a set of
- required configuration property names.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="activationspec-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element activationspec-class specifies the fully
- qualified Java class name of the activation
- specification class. This class must implement the
- javax.resource.spi.ActivationSpec interface. The
- implementation of this class is required to be a
- JavaBean.
-
- Example:
- <activationspec-class>com.wombat.ActivationSpecImpl
- </activationspec-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="required-config-property"
- type="javaee:required-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The required-config-property element is deprecated since
- Connectors 1.6 specification. The resource adapter
- implementation is recommended to use the @NotNull
- Bean Validation annotation or its XML validation
- descriptor equivalent to indicate that a configuration
- property is required to be specified by the deployer.
- See the Connectors specification for more information.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property"
- type="javaee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="adminobjectType">
- <xsd:annotation>
- <xsd:documentation>
-
- The adminobjectType specifies information about an
- administered object. Administered objects are specific to a
- messaging style or message provider. This contains
- information on the Java type of the interface implemented by
- an administered object, its Java class name and its
- configuration properties.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="adminobject-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element adminobject-interface specifies the
- fully qualified name of the Java type of the
- interface implemented by an administered object.
-
- Example:
- <adminobject-interface>javax.jms.Destination
- </adminobject-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="adminobject-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element adminobject-class specifies the fully
- qualified Java class name of an administered object.
-
- Example:
- <adminobject-class>com.wombat.DestinationImpl
- </adminobject-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property"
- type="javaee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="authentication-mechanismType">
- <xsd:annotation>
- <xsd:documentation>
-
- The authentication-mechanismType specifies an authentication
- mechanism supported by the resource adapter. Note that this
- support is for the resource adapter and not for the
- underlying EIS instance. The optional description specifies
- any resource adapter specific requirement for the support of
- security contract and authentication mechanism.
-
- Note that BasicPassword mechanism type should support the
- javax.resource.spi.security.PasswordCredential interface.
- The Kerbv5 mechanism type should support the
- org.ietf.jgss.GSSCredential interface or the deprecated
- javax.resource.spi.security.GenericCredential interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="authentication-mechanism-type"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element authentication-mechanism-type specifies
- type of an authentication mechanism.
-
- The example values are:
-
- <authentication-mechanism-type>BasicPassword
- </authentication-mechanism-type>
-
- <authentication-mechanism-type>Kerbv5
- </authentication-mechanism-type>
-
- Any additional security mechanisms are outside the
- scope of the Connector architecture specification.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="credential-interface"
- type="javaee:credential-interfaceType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-property-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The config-property-nameType contains the name of a
- configuration property.
-
- The connector architecture defines a set of well-defined
- properties all of type java.lang.String. These are as
- follows.
-
- ServerName
- PortNumber
- UserName
- Password
- ConnectionURL
-
- A resource adapter provider can extend this property set to
- include properties specific to the resource adapter and its
- underlying EIS.
-
- Possible values include
- ServerName
- PortNumber
- UserName
- Password
- ConnectionURL
-
- Example: <config-property-name>ServerName</config-property-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-property-typeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The config-property-typeType contains the fully
- qualified Java type of a configuration property.
-
- The following are the legal values:
- java.lang.Boolean, java.lang.String, java.lang.Integer,
- java.lang.Double, java.lang.Byte, java.lang.Short,
- java.lang.Long, java.lang.Float, java.lang.Character
-
- Used in: config-property
-
- Example:
- <config-property-type>java.lang.String</config-property-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="java.lang.Boolean"/>
- <xsd:enumeration value="java.lang.String"/>
- <xsd:enumeration value="java.lang.Integer"/>
- <xsd:enumeration value="java.lang.Double"/>
- <xsd:enumeration value="java.lang.Byte"/>
- <xsd:enumeration value="java.lang.Short"/>
- <xsd:enumeration value="java.lang.Long"/>
- <xsd:enumeration value="java.lang.Float"/>
- <xsd:enumeration value="java.lang.Character"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The config-propertyType contains a declaration of a single
- configuration property that may be used for providing
- configuration information.
-
- The declaration consists of an optional description, name,
- type and an optional value of the configuration property. If
- the resource adapter provider does not specify a value than
- the deployer is responsible for providing a valid value for
- a configuration property.
-
- Any bounds or well-defined values of properties should be
- described in the description element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="config-property-name"
- type="javaee:config-property-nameType"/>
- <xsd:element name="config-property-type"
- type="javaee:config-property-typeType"/>
- <xsd:element name="config-property-value"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element config-property-value contains the value
- of a configuration entry. Note, it is possible for a
- resource adapter deployer to override this
- configuration information during deployment.
-
- Example:
- <config-property-value>WombatServer</config-property-value>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property-ignore"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The element config-property-ignore is used to specify
- whether the configuration tools must ignore considering the
- configuration property during auto-discovery of
- Configuration properties. See the Connector specification for
- more details. If unspecified, the container must not ignore
- the configuration property during auto-discovery.
- This element must be one of the following, "true" or "false".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property-supports-dynamic-updates"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The element config-property-supports-dynamic-updates is used to specify
- whether the configuration property allows its value to be updated, by
- application server's configuration tools, during the lifetime of
- the JavaBean instance. See the Connector specification for
- more details. If unspecified, the container must not dynamically
- reconfigure the property.
- This element must be one of the following, "true" or "false".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property-confidential"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The element config-property-confidential is used to specify
- whether the configuration property is confidential and
- recommends application server's configuration tools to use special
- visual aids for editing them. See the Connector specification for
- more details. If unspecified, the container must not treat the
- property as confidential.
- This element must be one of the following, "true" or "false".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="connection-definitionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connection-definitionType defines a set of connection
- interfaces and classes pertaining to a particular connection
- type. This also includes configurable properties for
- ManagedConnectionFactory instances that may be produced out
- of this set.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="managedconnectionfactory-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element managedconnectionfactory-class specifies
- the fully qualified name of the Java class that
- implements the
- javax.resource.spi.ManagedConnectionFactory interface.
- This Java class is provided as part of resource
- adapter's implementation of connector architecture
- specified contracts. The implementation of this
- class is required to be a JavaBean.
-
- Example:
- <managedconnectionfactory-class>
- com.wombat.ManagedConnectionFactoryImpl
- </managedconnectionfactory-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property"
- type="javaee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="connectionfactory-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element connectionfactory-interface specifies
- the fully qualified name of the ConnectionFactory
- interface supported by the resource adapter.
-
- Example:
- <connectionfactory-interface>com.wombat.ConnectionFactory
- </connectionfactory-interface>
-
- OR
-
- <connectionfactory-interface>javax.resource.cci.ConnectionFactory
- </connectionfactory-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connectionfactory-impl-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element connectionfactory-impl-class specifies
- the fully qualified name of the ConnectionFactory
- class that implements resource adapter
- specific ConnectionFactory interface.
-
- Example:
-
- <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
- </connectionfactory-impl-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The connection-interface element specifies the fully
- qualified name of the Connection interface supported
- by the resource adapter.
-
- Example:
-
- <connection-interface>javax.resource.cci.Connection
- </connection-interface>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-impl-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The connection-impl-classType specifies the fully
- qualified name of the Connection class that
- implements resource adapter specific Connection
- interface. It is used by the connection-impl-class
- elements.
-
- Example:
-
- <connection-impl-class>com.wombat.ConnectionImpl
- </connection-impl-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="connectorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The connectorType defines a resource adapter.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="module-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element module-name specifies the name of the
- resource adapter.
-
- If there is no module-name specified, the module-name
- is determined as defined in Section EE.8.1.1 and EE.8.1.2
- of the Java Platform, Enterprise Edition (Java EE)
- Specification, version 6.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="vendor-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element vendor-name specifies the name of
- resource adapter provider vendor.
-
- If there is no vendor-name specified, the application
- server must consider the default "" (empty string) as
- the name of the resource adapter provider vendor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="eis-type"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element eis-type contains information about the
- type of the EIS. For example, the type of an EIS can
- be product name of EIS independent of any version
- info.
-
- This helps in identifying EIS instances that can be
- used with this resource adapter.
-
- If there is no eis-type specified, the application
- server must consider the default "" (empty string) as
- the type of the EIS.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="resourceadapter-version"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element resourceadapter-version specifies a string-based version
- of the resource adapter from the resource adapter
- provider.
-
- If there is no resourceadapter-version specified, the application
- server must consider the default "" (empty string) as
- the version of the resource adapter.
-
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="license"
- type="javaee:licenseType"
- minOccurs="0"/>
- <xsd:element name="resourceadapter"
- type="javaee:resourceadapterType"/>
- <xsd:element name="required-work-context"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The element required-work-context specifies a fully qualified class
- name that implements WorkContext interface, that the resource adapter
- requires the application server to support.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="1.6"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The version indicates the version of the schema to be used by the
- deployment tool. This element doesn't have a default, and the resource adapter
- developer/deployer is required to specify it. The element allows the deployment
- tool to choose which schema to validate the descriptor against.
-
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="metadata-complete"
- type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether the deployment
- descriptor for the resource adapter module is complete, or whether
- the class files available to the module and packaged with the resource
- adapter should be examined for annotations that specify deployment
- information.
-
- If metadata-complete is set to "true", the deployment tool of the
- application server must ignore any annotations that specify deployment
- information, which might be present in the class files of the
- application.If metadata-complete is not specified or is set to "false",
- the deployment tool must examine the class files of the application for
- annotations, as specified by this specification. If the
- deployment descriptor is not included or is included but not marked
- metadata-complete, the deployment tool will process annotations.
-
- Application servers must assume that metadata-complete is true for
- resource adapter modules with deployment descriptor version
- lower than 1.6.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="credential-interfaceType">
- <xsd:annotation>
- <xsd:documentation>
-
- The credential-interfaceType specifies the
- interface that the resource adapter implementation
- supports for the representation of the
- credentials. This element(s) that use this type,
- i.e. credential-interface, should be used by
- application server to find out the Credential
- interface it should use as part of the security
- contract.
-
- The possible values are:
-
- javax.resource.spi.security.PasswordCredential
- org.ietf.jgss.GSSCredential
- javax.resource.spi.security.GenericCredential
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType">
- <xsd:enumeration value="javax.resource.spi.security.PasswordCredential"/>
- <xsd:enumeration value="org.ietf.jgss.GSSCredential"/>
- <xsd:enumeration value="javax.resource.spi.security.GenericCredential"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="inbound-resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The inbound-resourceadapterType specifies information
- about an inbound resource adapter. This contains information
- specific to the implementation of the resource adapter
- library as specified through the messageadapter element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="messageadapter"
- type="javaee:messageadapterType"
- minOccurs="0">
- <xsd:unique name="messagelistener-type-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The messagelistener-type element content must be
- unique in the messageadapter. Several messagelisteners
- can not use the same messagelistener-type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:messagelistener"/>
- <xsd:field xpath="javaee:messagelistener-type"/>
- </xsd:unique>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="licenseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The licenseType specifies licensing requirements for the
- resource adapter module. This type specifies whether a
- license is required to deploy and use this resource adapter,
- and an optional description of the licensing terms
- (examples: duration of license, number of connection
- restrictions). It is used by the license element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="license-required"
- type="javaee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element license-required specifies whether a
- license is required to deploy and use the
- resource adapter. This element must be one of
- the following, "true" or "false".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="messageadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The messageadapterType specifies information about the
- messaging capabilities of the resource adapter. This
- contains information specific to the implementation of the
- resource adapter library as specified through the
- messagelistener element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="messagelistener"
- type="javaee:messagelistenerType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="messagelistenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The messagelistenerType specifies information about a
- specific message listener supported by the messaging
- resource adapter. It contains information on the Java type
- of the message listener interface and an activation
- specification.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="messagelistener-type"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The element messagelistener-type specifies the fully
- qualified name of the Java type of a message
- listener interface.
-
- Example:
-
- <messagelistener-type>javax.jms.MessageListener
- </messagelistener-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="activationspec"
- type="javaee:activationspecType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="outbound-resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The outbound-resourceadapterType specifies information about
- an outbound resource adapter. The information includes fully
- qualified names of classes/interfaces required as part of
- the connector architecture specified contracts for
- connection management, level of transaction support
- provided, one or more authentication mechanisms supported
- and additional required security permissions.
-
- If any of the outbound resource adapter elements (transaction-support,
- authentication-mechanism, reauthentication-support) is specified through
- this element or metadata annotations, and no connection-definition is
- specified as part of this element or through annotations, the
- application server must consider this an error and fail deployment.
-
- If there is no authentication-mechanism specified as part of
- this element or metadata annotations, then the resource adapter does
- not support any standard security authentication mechanisms as
- part of security contract. The application server ignores the security
- part of the system contracts in this case.
-
- If there is no transaction-support specified as part of this element
- or metadata annotation, then the application server must consider that
- the resource adapter does not support either the resource manager local
- or JTA transactions and must consider the transaction support as
- NoTransaction. Note that resource adapters may specify the level of
- transaction support to be used at runtime for a ManagedConnectionFactory
- through the TransactionSupport interface.
-
- If there is no reauthentication-support specified as part of
- this element or metadata annotation, then the application server must consider
- that the resource adapter does not support re-authentication of
- ManagedConnections.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-definition"
- type="javaee:connection-definitionType"
- maxOccurs="unbounded"
- minOccurs="0"/>
- <xsd:element name="transaction-support"
- type="javaee:transaction-supportType"
- minOccurs="0"/>
- <xsd:element name="authentication-mechanism"
- type="javaee:authentication-mechanismType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="reauthentication-support"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element reauthentication-support specifies
- whether the resource adapter implementation supports
- re-authentication of existing Managed- Connection
- instance. Note that this information is for the
- resource adapter implementation and not for the
- underlying EIS instance. This element must have
- either a "true" or "false" value.
-
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="required-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The required-config-propertyType contains a declaration
- of a single configuration property used for specifying a
- required configuration property name. It is used
- by required-config-property elements.
-
- Usage of this type is deprecated from Connectors 1.6 specification.
- Refer to required-config-property element for more information.
-
- Example:
-
- <required-config-property>
- <config-property-name>Destination</config-property-name>
- </required-config-property>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="config-property-name"
- type="javaee:config-property-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resourceadapterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resourceadapterType specifies information about the
- resource adapter. The information includes fully qualified
- resource adapter Java class name, configuration properties,
- information specific to the implementation of the resource
- adapter library as specified through the
- outbound-resourceadapter and inbound-resourceadapter
- elements, and an optional set of administered objects.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="resourceadapter-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element resourceadapter-class specifies the
- fully qualified name of a Java class that implements
- the javax.resource.spi.ResourceAdapter
- interface. This Java class is provided as part of
- resource adapter's implementation of connector
- architecture specified contracts. The implementation
- of this class is required to be a JavaBean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="config-property"
- type="javaee:config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="outbound-resourceadapter"
- type="javaee:outbound-resourceadapterType"
- minOccurs="0">
- <xsd:unique name="connectionfactory-interface-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The connectionfactory-interface element content
- must be unique in the outbound-resourceadapter.
- Multiple connection-definitions can not use the
- same connectionfactory-type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:connection-definition"/>
- <xsd:field xpath="javaee:connectionfactory-interface"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="inbound-resourceadapter"
- type="javaee:inbound-resourceadapterType"
- minOccurs="0"/>
- <xsd:element name="adminobject"
- type="javaee:adminobjectType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:unique name="adminobject-type-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The adminobject-interface and adminobject-class element content must be
- unique in the resourceadapterType. Several admin objects
- can not use the same adminobject-interface and adminobject-class.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:adminobject"/>
- <xsd:field xpath="javaee:adminobject-interface"/>
- <xsd:field xpath="javaee:adminobject-class"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="security-permission"
- type="javaee:security-permissionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-permissionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-permissionType specifies a security
- permission that is required by the resource adapter code.
-
- The security permission listed in the deployment descriptor
- are ones that are different from those required by the
- default permission set as specified in the connector
- specification. The optional description can mention specific
- reason that resource adapter requires a given security
- permission.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-permission-spec"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element security-permission-spec specifies a security
- permission based on the Security policy file
- syntax. Refer to the following URL for Sun's
- implementation of the security permission
- specification:
-
- http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transaction-supportType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transaction-supportType specifies the level of
- transaction support provided by the resource adapter. It is
- used by transaction-support elements.
-
- The value must be one of the following:
-
- NoTransaction
- LocalTransaction
- XATransaction
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NoTransaction"/>
- <xsd:enumeration value="LocalTransaction"/>
- <xsd:enumeration value="XATransaction"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_1_1.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_1_1.dtd
deleted file mode 100644
index efd838ee0b..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_1_1.dtd
+++ /dev/null
@@ -1,894 +0,0 @@
-<!--
-Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-Copyright 1999 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-
-<!--
-This is the XML DTD for the EJB 1.1 deployment descriptor.
--->
-
-
-<!--
-The assembly-descriptor element contains application-assembly information.
-
-The application-assembly information consists of the following parts:
-the definition of security roles, the definition of method permissions,
-and the definition of transaction attributes for enterprise beans with
-container-managed transaction demarcation.
-
-All the parts are optional in the sense that they are omitted if the
-lists represented by them are empty.
-
-Providing an assembly-descriptor in the deployment descriptor is
-optional for the ejb-jar file producer.
-
-Used in: ejb-jar
--->
-<!ELEMENT assembly-descriptor (security-role*, method-permission*,
- container-transaction*)>
-
-<!--
-The cmp-field element describes a container-managed field. The field
-element includes an optional description of the field, and the name of
-the field.
-
-Used in: entity
--->
-<!ELEMENT cmp-field (description?, field-name)>
-
-<!--
-The container-transaction element specifies how the container must
-manage transaction scopes for the enterprise bean's method invocations.
-The element consists of an optional description, a list of method
-elements, and a transaction attribute.The transaction attribute is to
-be applied to all the specified methods.
-
-Used in: assembly-descriptor
--->
-<!ELEMENT container-transaction (description?, method+,
- trans-attribute)>
-
-<!--
-The description element is used by the ejb-jar file producer to provide
-text describing the parent element.
-
-The description element should include any information that the ejb-jar
-file producer wants to provide to the consumer of the ejb-jar file
-(i.e. to the Deployer). Typically, the tools used by the ejb-jar file
-consumer will display the description when processing the parent
-element.
-
-Used in: cmp-field, container-transaction, ejb-jar, entity, env-entry,
-ejb-ref, method, method-permission, resource-ref, security-role,
-security-role-ref, and session.
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-display by tools.
-
-Used in: ejb-jar, session, and entity
-
-Example:
- <display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb-class element contains the fully-qualified name of the
-enterprise bean's class.
-
-Used in: entity and session
-
-Example:
- <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
--->
-<!ELEMENT ejb-class (#PCDATA)>
-
-<!--
-The optional ejb-client-jar element specifies a JAR file that contains
-the class files necessary for a client program to access the enterprise
-beans in the ejb-jar file. The Deployer should make the ejb-client JAR
-file accessible to the client's class-loader.
-
-Used in: ejb-jar
-
-Example:
- <ejb-client-jar>employee_service_client.jar</ejb-client-jar>
--->
-<!ELEMENT ejb-client-jar (#PCDATA)>
-
-<!--
-The ejb-jar element is the root element of the EJB deployment
-descriptor. It contains an optional description of the ejb-jar file,
-optional display name, optional small icon file name, optional large
-icon file name, mandatory structural information about all included
-enterprise beans, optional application-assembly descriptor, and an
-optional name of an ejb-client-jar file for the ejb-jar.
--->
-<!ELEMENT ejb-jar (description?, display-name?, small-icon?,
- large-icon?, enterprise-beans, assembly-descriptor?,
- ejb-client-jar?)>
-
-<!--
-The ejb-link element is used in the ejb-ref element to specify that an
-EJB reference is linked to another enterprise bean in the ejb-jar
-file.
-
-The value of the ejb-link element must be the ejb-name of an enterprise
-bean in the same ejb-jar file, or in another ejb-jar file in the same
-J2EE application unit.
-
-Used in: ejb-ref
-
-Example:
- <ejb-link>EmployeeRecord</ejb-link>
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-name element specifies an enterprise bean's name. This name is
-assigned by the ejb-jar file producer to name the enterprise bean in
-the ejb-jar file's deployment descriptor. The name must be unique among
-the names of the enterprise beans in the same ejb-jar file.
-
-The enterprise bean code does not depend on the name; therefore the
-name can be changed during the application-assembly process without
-breaking the enterprise bean's function.
-
-There is no architected relationship between the ejb-name in the
-deployment descriptor and the JNDI name that the Deployer will assign
-to the enterprise bean's home.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: entity, method, and session
-
-Example:
- <ejb-name>EmployeeService</ejb-name>
--->
-<!ELEMENT ejb-name (#PCDATA)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-another enterprise bean's home. The declaration consists of an optional
-description; the EJB reference name used in the code of the referencing
-enterprise bean; the expected type of the referenced enterprise bean;
-the expected home and remote interfaces of the referenced enterprise
-bean; and an optional ejb-link information.
-
-The optional ejb-link element is used to specify the referenced
-enterprise bean. It is used typically in ejb-jar files that contain an
-assembled application.
-
-Used in: entity and session
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home,
- remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The EJB
-reference is an entry in the enterprise bean's environment.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-ref
-
-Example:
- <ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the referenced
-enterprise bean.
-
-The ejb-ref-type element must be one of the following:
- <ejb-ref-type>Entity</ejb-ref-type>
- <ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The enterprise-beans element contains the declarations of one or more
-enterprise beans.
--->
-<!ELEMENT enterprise-beans (session | entity)+>
-
-<!--
-The entity element declares an entity bean. The declaration consists
-of: an optional description; optional display name; optional small icon
-file name; optional large icon file name; a name assigned to the
-enterprise bean in the deployment descriptor; the names of the entity
-bean's home and remote interfaces; the entity bean's implementation
-class; the entity bean's persistence management type; the entity bean's
-primary key class name; an indication of the entity bean's reentrancy;
-an optional list of container-managed fields; an optional specification
-of the primary key field; an optional declaration of the bean's
-environment entries; an optional declaration of the bean's EJB
-references; an optional declaration of the security role references;
-and an optional declaration of the bean's resource manager connection
-factory references.
-
-The optional primkey-field may be present in the descriptor if the
-entity's persistency-type is Container.
-
-The other elements that are optional are "optional" in the sense that
-they are omitted if the lists represented by them are empty.
-
-At least one cmp-field element must be present in the descriptor if the
-entity's persistency-type is Container, and none must not be present if
-the entity's persistence-type is Bean.
-
-Used in: enterprise-beans
--->
-<!ELEMENT entity (description?, display-name?, small-icon?,
- large-icon?, ejb-name, home, remote, ejb-class,
- persistence-type, prim-key-class, reentrant,
- cmp-field*, primkey-field?, env-entry*,
- ejb-ref*, security-role-ref*, resource-ref*)>
-
-<!--
-The env-entry element contains the declaration of an enterprise bean's
-environment entries. The declaration consists of an optional
-description, the name of the environment entry, and an optional value.
-
-Used in: entity and session
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-type,
- env-entry-value?)>
-
-<!--
-The env-entry-name element contains the name of an enterprise bean's
-environment entry.
-
-Used in: env-entry
-
-Example:
- <env-entry-name>minAmount</env-entry-name>
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the enterprise bean's
-code.
-
-The following are the legal values of env-entry-type:
-java.lang.Boolean, java.lang.String, java.lang.Integer,
-java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Long, and
-java.lang.Float.
-
-Used in: env-entry
-
-Example:
- <env-entry-type>java.lang.Boolean</env-entry-type>
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an enterprise bean's
-environment entry.
-
-Used in: env-entry
-
-Example:
- <env-entry-value>100.00</env-entry-value>
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The field-name element specifies the name of a container managed field.
-The name must be a public field of the enterprise bean class or one of
-its superclasses.
-
-Used in: cmp-field
-
-Example:
- <field-name>firstName</field-Name>
--->
-<!ELEMENT field-name (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref, entity, and session
-
-Example:
- <home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file containing a large
-(32 x 32) icon image. The file name is relative path within the ejb-jar
-file.
-
-The image must be either in the JPEG or GIF format, and the file name
-must end with the suffix ".jpg" or ".gif" respectively. The icon can
-be used by tools.
-
-Example:
- <large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The method element is used to denote a method of an enterprise bean's
-home or remote interface, or a set of methods. The ejb-name element
-must be the name of one of the enterprise beans in declared in the
-deployment descriptor; the optional method-intf element allows to
-distinguish between a method with the same signature that is defined in
-both the home and remote interface; the method-name element specifies
-the method name; and the optional method-params elements identify a
-single method among multiple methods with an overloaded method name.
-
-There are three possible styles of the method element syntax:
-
-1. <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>*</method-name>
- </method>
-
- This style is used to refer to all the methods of the specified
- enterprise bean's home and remote interfaces.
-
-2. <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- </method>>
-
- This style is used to refer to the specified method of the
- specified enterprise bean. If there are multiple methods with
- the same overloaded name, the element of this style refers to
- all the methods with the overloaded name.
-
-
-
-
-
-3. <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-n</method-param>
- </method-params>
- <method>
-
- This style is used to refer to a single method within a set of
- methods with an overloaded name. PARAM-1 through PARAM-n are the
- fully-qualified Java types of the method's input parameters (if
- the method has no input arguments, the method-params element
- contains no method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of square
- brackets (e.g. int[][]).
-
-
-Used in: method-permission and container-transaction
-
-Examples:
-
- Style 1: The following method element refers to all the methods of
- the EmployeeService bean's home and remote interfaces:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>*</method-name>
- </method>
-
- Style 2: The following method element refers to all the create
- methods of the EmployeeService bean's home interface:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- </method>
-
- Style 3: The following method element refers to the
- create(String firstName, String LastName) method of the
- EmployeeService bean's home interface.
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
-
- The following example illustrates a Style 3 element with
- more complex parameter types. The method
- foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
- mypackage.MyClass[][] myclaar)
- would be specified as:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>foobar</method-name>
- <method-params>
- <method-param>char</method-param>
- <method-param>int</method-param>
- <method-param>int[]</method-param>
- <method-param>mypackage.MyClass</method-param>
- <method-param>mypackage.MyClass[][]</method-param>
- </method-params>
- </method>
-
- The optional method-intf element can be used when it becomes
- necessary to differentiate between a method defined in the home
- interface and a method with the same name and signature that is
- defined in the remote interface.
-
- For example, the method element
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Remote</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- can be used to differentiate the create(String, String) method
- defined in the remote interface from the create(String, String)
- method defined in the home interface, which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
--->
-<!ELEMENT method (description?, ejb-name, method-intf?, method-name,
- method-params?)>
-
-<!--
-The method-intf element allows a method element to differentiate
-between the methods with the same name and signature that are defined
-in both the remote and home interfaces.
-
-The method-intf element must be one of the following:
- <method-intf>Home</method-intf>
- <method-intf>Remote</method-intf>
-
-Used in: method
--->
-<!ELEMENT method-intf (#PCDATA)>
-
-<!--
-The method-name element contains a name of an enterprise bean method,
-or the asterisk (*) character. The asterisk is used when the element
-denotes all the methods of an enterprise bean's remote and home
-interfaces.
-
-Used in: method
--->
-<!ELEMENT method-name (#PCDATA)>
-
-<!--
-The method-param element contains the fully-qualified Java type name of
-a method parameter.
-
-Used in: method-params
--->
-<!ELEMENT method-param (#PCDATA)>
-
-<!--
-The method-params element contains a list of the fully-qualified Java
-type names of the method parameters.
-
-Used in: method
--->
-<!ELEMENT method-params (method-param*)>
-
-<!--
-The method-permission element specifies that one or more security roles
-are allowed to invoke one or more enterprise bean methods. The
-method-permission element consists of an optional description, a list
-of security role names, and a list of method elements.
-
-The security roles used in the method-permission element must be
-defined in the security-role element of the deployment descriptor, and
-the methods must be methods defined in the enterprise bean's remote
-and/or home interfaces.
-
-Used in: assembly-descriptor
--->
-<!ELEMENT method-permission (description?, role-name+, method+)>
-
-<!--
-The persistence-type element specifies an entity bean's persistence
-management type.
-
-The persistence-type element must be one of the two following:
- <persistence-type>Bean</persistence-type>
- <persistence-type>Container</persistence-type>
-
-Used in: entity
--->
-<!ELEMENT persistence-type (#PCDATA)>
-
-<!--
-The prim-key-class element contains the fully-qualified name of an
-entity bean's primary key class.
-
-If the definition of the primary key class is deferred to deployment
-time, the prim-key-class element should specify java.lang.Object.
-
-Used in: entity
-
-Examples:
- <prim-key-class>java.lang.String</prim-key-class>
- <prim-key-class>com.wombat.empl.EmployeeID</prim-key-class>
- <prim-key-class>java.lang.Object</prim-key-class>
-
--->
-<!ELEMENT prim-key-class (#PCDATA)>
-
-<!--
-The primkey-field element is used to specify the name of the primary
-key field for an entity with container-managed persistence.
-
-The primkey-field must be one of the fields declared in the cmp-field
-element, and the type of the field must be the same as the primary key
-type.
-
-The primkey-field element is not used if the primary key maps to
-multiple container-managed fields (i.e. the key is a compound key). In
-this case, the fields of the primary key class must be public, and
-their names must correspond to the field names of the entity bean class
-that comprise the key.
-
-Used in: entity
-
-Example:
- <primkey-field>EmployeeId</primkey-field>
--->
-<!ELEMENT primkey-field (#PCDATA)>
-
-<!--
-The reentrant element specifies whether an entity bean is reentrant or not.
-
-The reentrant element must be one of the two following:
- <reentrant>True</reentrant>
- <reentrant>False</reentrant>
-
-Used in: entity
--->
-<!ELEMENT reentrant (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref, entity, and session
-
-Example:
- <remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the enterprise bean code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the bean. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
- <res-auth>Application</res-auth>
- <res-auth>Container</res-auth>
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type is
-specified by the Java interface (or class) expected to be implemented
-by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of enterprise bean's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type expected
-by the enterprise bean code, and the type of authentication (bean or
-container).
-
-Used in: entity and session
-
-Example:
- <resource-ref>
- <res-ref-name>EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type,
- res-auth)>
-
-<!--
-The role-link element is used to link a security role reference to a
-defined security role. The role-link element must contain the name of
-one of the security roles defined in the security-role elements.
-
-Used in: security-role-ref
--->
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: method-permission, security-role, and security-role-ref
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The security-role element contains the definition of a security role.
-The definition consists of an optional description of the security
-role, and the security role name.
-
-Used in: assembly-descriptor
-
-Example:
- <security-role>
- <description>
- This role includes all employees who
- are authorized to access the employee
- service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The security-role-ref element contains the declaration of a security
-role reference in the enterprise bean's code. The declaration consists
-of an optional description, the security role name used in the code,
-and an optional link to a defined security role.
-
-The value of the role-name element must be the String used as the
-parameter to the EJBContext.isCallerInRole(String roleName) method.
-
-The value of the role-link element must be the name of one of the
-security roles defined in the security-role elements.
-
-Used in: entity and session
-
--->
-<!ELEMENT security-role-ref (description?, role-name, role-link?)>
-
-<!--
-The session-type element describes whether the session bean is a
-stateful session, or stateless session.
-
-The session-type element must be one of the two following:
- <session-type>Stateful</session-type>
- <session-type>Stateless</session-type>
--->
-<!ELEMENT session-type (#PCDATA)>
-
-<!--
-The session element declares an session bean. The declaration consists
-of: an optional description; optional display name; optional small icon
-file name; optional large icon file name; a name assigned to the
-enterprise bean in the deployment description; the names of the session
-bean's home and remote interfaces; the session bean's implementation
-class; the session bean's state management type; the session bean's
-transaction management type; an optional declaration of the bean's
-environment entries; an optional declaration of the bean's EJB
-references; an optional declaration of the security role references;
-and an optional declaration of the bean's resource manager connection
-factory references.
-
-The elements that are optional are "optional" in the sense that they
-are omitted when if lists represented by them are empty.
-
-Used in: enterprise-beans
--->
-<!ELEMENT session (description?, display-name?, small-icon?,
- large-icon?, ejb-name, home, remote, ejb-class,
- session-type, transaction-type, env-entry*,
- ejb-ref*, security-role-ref*, resource-ref*)>
-
-<!--
-The small-icon element contains the name of a file containing a small
-(16 x 16) icon image. The file name is relative path within the ejb-jar
-file.
-
-The image must be either in the JPEG or GIF format, and the file name
-must end with the suffix ".jpg" or ".gif" respectively.
-
-The icon can be used by tools.
-
-Example:
- <small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The transaction-type element specifies an enterprise bean's transaction
-management type.
-
-The transaction-type element must be one of the two following:
- <transaction-type>Bean</transaction-type>
- <transaction-type>Container</transaction-type>
-
-Used in: session
--->
-<!ELEMENT transaction-type (#PCDATA)>
-
-<!--
-The trans-attribute element specifies how the container must manage the
-transaction boundaries when delegating a method invocation to an
-enterprise bean's business method.
-
-The value of trans-attribute must be one of the following:
- <trans-attribute>NotSupported</trans-attribute>
- <trans-attribute>Supports</trans-attribute>
- <trans-attribute>Required</trans-attribute>
- <trans-attribute>RequiresNew</trans-attribute>
- <trans-attribute>Mandatory</trans-attribute>
- <trans-attribute>Never</trans-attribute>
-
-Used in: container-transaction
--->
-<!ELEMENT trans-attribute (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e information beyond the standard EJB deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tools-specific files to the
-information in the standard deployment descriptor.
-
-The EJB architecture does not allow the tools to add the non-standard
-information into the EJB deployment descriptor.
--->
-<!ATTLIST assembly-descriptor id ID #IMPLIED>
-<!ATTLIST cmp-field id ID #IMPLIED>
-<!ATTLIST container-transaction id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb-class id ID #IMPLIED>
-<!ATTLIST ejb-client-jar id ID #IMPLIED>
-<!ATTLIST ejb-jar id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-name id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST enterprise-beans id ID #IMPLIED>
-<!ATTLIST entity id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST field-name id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST method id ID #IMPLIED>
-<!ATTLIST method-intf id ID #IMPLIED>
-<!ATTLIST method-name id ID #IMPLIED>
-<!ATTLIST method-param id ID #IMPLIED>
-<!ATTLIST method-params id ID #IMPLIED>
-<!ATTLIST method-permission id ID #IMPLIED>
-<!ATTLIST persistence-type id ID #IMPLIED>
-<!ATTLIST prim-key-class id ID #IMPLIED>
-<!ATTLIST primkey-field id ID #IMPLIED>
-<!ATTLIST reentrant id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST session-type id ID #IMPLIED>
-<!ATTLIST session id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST transaction-type id ID #IMPLIED>
-<!ATTLIST trans-attribute id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_0.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_0.dtd
deleted file mode 100644
index 9a2cc7ce76..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_0.dtd
+++ /dev/null
@@ -1,1671 +0,0 @@
-<!--
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, U.S.A.
-All rights reserved.
-
-Sun Microsystems, Inc. has intellectual property rights relating to
-technology embodied in the product that is described in this document.
-In particular, and without limitation, these intellectual property
-rights may include one or more of the U.S. patents listed at
-http://www.sun.com/patents and one or more additional patents or
-pending patent applications in the U.S. and in other countries.
-
-This document and the product to which it pertains are distributed
-under licenses restricting their use, copying, distribution, and
-decompilation. This document may be reproduced and distributed but may
-not be changed without prior written authorization of Sun and its
-licensors, if any.
-
-Third-party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and and
-Enterprise JavaBeans are trademarks or registered trademarks of Sun
-Microsystems, Inc. in the U.S. and other countries.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
-WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
-NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
-DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
-
-
-_________________________________________________________________________
-
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, E'tats-Unis.
-Tous droits re'serve's.
-
-Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
-relatants a` la technologie incorpore'e dans le produit qui est de'crit
-dans ce document. En particulier, et sans la limitation, ces droits de
-proprie'te' intellectuels peuvent inclure un ou plus des brevets
-ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
-brevets plus supple'mentaires ou les applications de brevet en attente
-dans les E'tats-Unis et dans les autres pays.
-
-Ce produit ou document est prote'ge' par un copyright et distribue'
-avec des licences qui en restreignent l'utilisation, la copie, la
-distribution, et la de'compilation. Ce documention associe n peut
-e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
-l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
-licence, le cas e'che'ant.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright et
-licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail et and
-Enterprise JavaBeans sont des marques de fabrique ou des marques
-de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
-pays.
-
-LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
-EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
-NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
-L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
-CONTREFAC,ON.
--->
-
-<!--
-This is the XML DTD for the EJB 2.0 deployment descriptor.
-All EJB 2.0 deployment descriptors must include a DOCTYPE
-of the following form:
-
- <!DOCTYPE ejb-jar PUBLIC
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
- "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The ejb-jar element is the root element of the EJB deployment
-descriptor. It contains
-
- - an optional description of the ejb-jar file
- - an optional display name
- - an optional small icon file name
- - an optional large icon file name
- - mandatory structural information about all included
- enterprise beans
- - a descriptor for container managed relationships, if any
- - an optional application-assembly descriptor
- - an optional name of an ejb-client-jar file for the ejb-jar.
--->
-<!ELEMENT ejb-jar (description?, display-name?, small-icon?,
-large-icon?, enterprise-beans, relationships?, assembly-descriptor?,
-ejb-client-jar?)>
-
-<!--
-The abstract-schema-name element specifies the name of the abstract
-schema type of an entity bean with cmp-version 2.x. It is used in EJB
-QL queries.
-
-For example, the abstract-schema-name for an entity bean whose local
-interface is com.acme.commerce.Order might be Order.
-
-Used in: entity
--->
-<!ELEMENT abstract-schema-name (#PCDATA)>
-
-<!--
-
-The acknowledge-mode element specifies whether JMS AUTO_ACKNOWLEDGE or
-DUPS_OK_ACKNOWLEDGE message acknowledgment semantics should be used
-for the onMessage message of a message-driven bean that uses bean
-managed transaction demarcation.
-
-The acknowledge-mode element must be one of the two following:
-
- <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
- <acknowledge-mode>Dups-ok-acknowledge</acknowledgemode>
-
-Used in: message-driven
--->
-<!ELEMENT acknowledge-mode (#PCDATA)>
-
-<!--
-The assembly-descriptor element contains application-assembly information.
-
-The application-assembly information consists of the following parts:
-the definition of security roles, the definition of method
-permissions, the definition of transaction attributes for
-enterprise beans with container-managed transaction demarcation and
-a list of methods to be excluded from being invoked.
-
-All the parts are optional in the sense that they are omitted if the
-lists represented by them are empty.
-
-Providing an assembly-descriptor in the deployment descriptor is
-optional for the ejb-jar file producer.
-
-Used in: ejb-jar
--->
-<!ELEMENT assembly-descriptor (security-role*, method-permission*,
-container-transaction*, exclude-list?)>
-
-<!--
-The cascade-delete element specifies that, within a particular
-relationship, the lifetime of one or more entity beans is dependent
-upon the lifetime of another entity bean. The cascade-delete element
-can only be specified for an ejb-relationship-role element contained
-in an ejb-relation element in which the other ejb-relationship-role
-element specifies a multiplicity of One.
-
-Used in: ejb-relationship-role
--->
-<!ELEMENT cascade-delete EMPTY>
-
-<!--
-The cmp-field element describes a container-managed field. The
-field element includes an optional description of the field, and the
-name of the field.
-
-Used in: entity
--->
-<!ELEMENT cmp-field (description?, field-name)>
-
-<!--
-The cmp-version element specifies the version of an entity bean
-with container-managed persistence.
-
-The cmp-version element must be one of the two following:
-
- <cmp-version>1.x</cmp-version>
- <cmp-version>2.x</cmp-version>
-
-The default value of the cmp-version element is 2.x.
-
-Used in: entity
--->
-<!ELEMENT cmp-version (#PCDATA)>
-
-<!--
-
-The cmr-field element describes the bean provider's view of a
-relationship. It consists of an optional description, and the name and
-the class type of a field in the source of a role of a
-relationship. The cmr-field-name element corresponds to the name used
-for the get and set accessor methods for the relationship. The
-cmr-field-type element is used only for collection-valued
-cmr-fields. It specifies the type of the collection that is used.
-
-Used in: ejb-relationship-role
--->
-<!ELEMENT cmr-field (description?, cmr-field-name, cmr-field-type?)>
-
-<!--
-The cmr-field-name element specifies the name of a logical
-relationship field in the entity bean class. The name of the cmr-field
-must begin with a lowercase letter. This field is accessed by methods
-whose names consist of the name of the field specified by
-cmr-field-name in which the first letter is uppercased, prefixed by
-"get" or "set".
-
-Used in: cmr-field
--->
-<!ELEMENT cmr-field-name (#PCDATA)>
-
-<!--
-The cmr-field-type element specifies the class of a
-collection-valued logical relationship field in the entity bean
-class. The value of the cmr-field-type element must be either:
-java.util.Collection or java.util.Set.
-
-Used in: cmr-field
--->
-<!ELEMENT cmr-field-type (#PCDATA)>
-
-<!--
-The container-transaction element specifies how the container
-must manage transaction scopes for the enterprise bean's method
-invocations. The element consists of an optional description, a list
-of method elements, and a transaction attribute. The transaction
-attribute is to be applied to all the specified methods.
-
-Used in: assembly-descriptor
--->
-<!ELEMENT container-transaction (description?, method+, trans-attribute)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the enterprise bean ejb-jar file producer wants to provide to the consumer of
-the enterprise bean ejb-jar file (i.e., to the Deployer). Typically, the tools
-used by the enterprise bean ejb-jar file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: cmp-field, cmr-field, container-transaction, ejb-jar,
-ejb-local-ref, ejb-ref, ejb-relation, ejb-relationship-role, entity,
-env-entry, exclude-list, message-driven, method, method-permission,
-query, relationship-role-source, relationships, resource-env-ref,
-resource-ref, run-as, security-identity, security-role,
-security-role-ref, session
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The destination-type element specifies the type of the JMS
-destination. The type is specified by the Java interface expected to
-be implemented by the destination.
-
-The destination-type element must be one of the two following:
-
-<destination-type>javax.jms.Queue</destination-type>
-<destination-type>javax.jms.Topic</destination-type>
-
-Used in: message-driven-destination
--->
-<!ELEMENT destination-type (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: ejb-jar, entity, message-driven, session
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The ejb-class element contains the fully-qualified name of the
-enterprise bean's class.
-
-Used in: entity, message-driven, session
-
-Example:
-
-<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
--->
-<!ELEMENT ejb-class (#PCDATA)>
-
-<!--
-The optional ejb-client-jar element specifies a JAR file that contains
-the class files necessary for a client program to access the
-enterprise beans in the ejb-jar file.
-
-Used in: ejb-jar
-
-Example:
-
-<ejb-client-jar>employee_service_client.jar</ejb-client-jar>
--->
-<!ELEMENT ejb-client-jar (#PCDATA)>
-
-<!--
-The ejb-link element is used in the ejb-ref or ejb-local-ref
-elements to specify that an EJB reference is linked to an
-enterprise bean.
-
-The value of the ejb-link element must be the ejb-name of an
-enterprise bean in the same ejb-jar file or in another ejb-jar
-file in the same J2EE application unit.
-
-Alternatively, the name in the ejb-link element may be composed of a
-path name specifying the ejb-jar containing the referenced enterprise
-bean with the ejb-name of the target bean appended and separated from
-the path name by "#". The path name is relative to the ejb-jar file
-containing the enterprise bean that is referencing the enterprise bean.
-This allows multiple enterprise beans with the same ejb-name to be
-uniquely identified.
-
-Used in: ejb-local-ref, ejb-ref
-
-Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-local-ref element is used for the declaration of a reference to
-an enterprise bean's local home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the enterprise bean
- that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected local home and local interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: entity, message-driven, session
--->
-<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
- local-home, local, ejb-link?)>
-
-<!--
-The ejb-name element specifies an enterprise bean's name. This name is
-assigned by the ejb-jar file producer to name the enterprise bean in
-the ejb-jar file's deployment descriptor. The name must be unique
-among the names of the enterprise beans in the same ejb-jar file.
-
-There is no architected relationship between the ejb-name in the
-deployment descriptor and the JNDI name that the Deployer will assign
-to the enterprise bean's home.
-
-The name for an entity bean with cmp-version 2.x must conform to the
-lexical rules for an NMTOKEN. The name for an entity bean with
-cmp-version 2.x must not be a reserved literal in EJB QL.
-
-Used in: entity, message-driven, method, relationship-role-source,
-session
-
-Example:
-
-<ejb-name>EmployeeService</ejb-name>
--->
-<!ELEMENT ejb-name (#PCDATA)>
-
-<!--
-The ejb-ql element contains the EJB QL query string that defines
-a finder or select query. This element is defined within the scope of
-a query element whose contents specify the finder or the select method
-that uses the query. The content must be a valid EJB QL query string
-for the entity bean for which the query is specified.
-
-The ejb-ql element must be specified for all queries that are
-expressible in EJB QL.
-
-Used in: query
-
-Example:
-<query>
- <query-method>
- <method-name>ejbSelectPendingLineitems</method-name>
- <method-params/>
- </query-method>
- <ejb-ql>SELECT OBJECT(l) FROM LineItems l WHERE l.shipped <> TRUE
- </ejb-ql>
-</query>
-
--->
-<!ELEMENT ejb-ql (#PCDATA)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-an enterprise bean's home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the enterprise bean that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected home and remote interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: entity, message-driven, session
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
- home, remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The
-EJB reference is an entry in the enterprise bean's environment and is
-relative to the java:comp/env context. The name must be unique
-within the enterprise bean.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-local-ref, ejb-ref
-
-Example:
-
-<ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the
-referenced enterprise bean.
-
-The ejb-ref-type element must be one of the following:
-
- <ejb-ref-type>Entity</ejb-ref-type>
- <ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-local-ref, ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-
-The ejb-relation element describes a relationship between two
-entity beans with container-managed persistence. An ejb-relation
-element contains a description; an optional ejb-relation-name element;
-and exactly two relationship role declarations, defined by the
-ejb-relationship-role elements. The name of the relationship, if
-specified, is unique within the ejb-jar file.
-
-Used in: relationships
--->
-<!ELEMENT ejb-relation (description?, ejb-relation-name?, ejb-relationship-role,
-ejb-relationship-role)>
-
-<!--
-The ejb-relation-name element provides a unique name for a relationship.
-
-Used in: ejb-relation
--->
-<!ELEMENT ejb-relation-name (#PCDATA)>
-
-<!--
-The ejb-relationship-role element describes a role within a
-relationship. There are two roles in each relationship.
-
-The ejb-relationship-role element contains an optional description; an
-optional name for the relationship role; a specification of the
-multiplicity of the role; an optional specification of cascade-delete
-functionality for the role; the role source; and a declaration of the
-cmr-field, if any, by means of which the other side of the
-relationship is accessed from the perspective of the role source.
-
-The multiplicity and role-source element are mandatory.
-
-The relationship-role-source element designates an entity bean by
-means of an ejb-name element. For bidirectional relationships, both
-roles of a relationship must declare a relationship-role-source
-element that specifies a cmr-field in terms of which the relationship
-is accessed. The lack of a cmr-field element in an
-ejb-relationship-role specifies that the relationship is
-unidirectional in navigability and the entity bean that participates
-in the relationship is "not aware" of the relationship.
-
-Used in: ejb-relation
-
-Example:
-
-<ejb-relation>
- <ejb-relation-name>Product-LineItem</ejb-relation-name>
- <ejb-relationship-role>
- <ejb-relationship-role-name>product-has-lineitems
- </ejb-relationship-role-name>
- <multiplicity>One</multiplicity>
- <relationship-role-source>
- <ejb-name>ProductEJB</ejb-name>
- </relationship-role-source>
- </ejb-relationship-role>
-
--->
-<!ELEMENT ejb-relationship-role (description?, ejb-relationship-role-name?,
-multiplicity, cascade-delete?, relationship-role-source, cmr-field?)>
-
-<!--
-The ejb-relationship-role-name element defines a name for a role that
-is unique within an ejb-relation. Different relationships can use the
-same name for a role.
-
-Used in: ejb-relationship-role
--->
-<!ELEMENT ejb-relationship-role-name (#PCDATA)>
-
-<!--
-The enterprise-beans element contains the declarations of one or more
-enterprise beans.
--->
-<!ELEMENT enterprise-beans (session | entity | message-driven)+>
-
-<!--
-The entity element declares an entity bean. The declaration
-consists of:
-
- - an optional description
- - an optional display name
- - an optional small icon file name
- - an optional large icon file name
- - a unique name assigned to the enterprise bean
- in the deployment descriptor
- - the names of the entity bean's remote home and remote
- interfaces, if any
- - the names of the entity bean's local home and local
- interfaces, if any
- - the entity bean's implementation class
- - the entity bean's persistence management type
- - the entity bean's primary key class name
- - an indication of the entity bean's reentrancy
- - an optional specification of the entity bean's cmp-version
- - an optional specification of the entity bean's abstract
- schema name
- - an optional list of container-managed fields
- - an optional specification of the primary key field
- - an optional declaration of the bean's environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB references
- - an optional declaration of the security role references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's resource manager
- connection factory references
- - an optional declaration of the bean's
- resource environment references
- - an optional set of query declarations
- for finder and select methods for an entity
- bean with cmp-version 2.x.
-
-The optional abstract-schema-name element must be specified for an
-entity bean with container-managed persistence and cmp-version 2.x.
-
-The optional primkey-field may be present in the descriptor if the
-entity's persistence-type is Container.
-
-The optional cmp-version element may be present in the descriptor if
-the entity's persistence-type is Container. If the persistence-type is
-Container and the cmp-version element is not specified, its value
-defaults to 2.x.
-
-The optional home and remote elements must be specified if the entity
-bean cmp-version is 1.x.
-
-The optional home and remote elements must be specified if the entity
-bean has a remote home and remote interface.
-
-The optional local-home and local elements must be specified if the
-entity bean has a local home and local interface.
-
-Either both the local-home and the local elements or both the
-home and the remote elements must be specified.
-
-The optional query elements must be present if the persistence-type is
-Container and the cmp-version is 2.x and query methods other than
-findByPrimaryKey have been defined for the entity bean.
-
-The other elements that are optional are "optional" in the sense that
-they are omitted if the lists represented by them are empty.
-
-At least one cmp-field element must be present in the descriptor if
-the entity's persistence-type is Container and the cmp-version is 1.x,
-and none must not be present if the entity's persistence-type is Bean.
-
-Used in: enterprise-beans
-
--->
-<!ELEMENT entity (description?, display-name?, small-icon?,
- large-icon?, ejb-name, home?, remote?, local-home?,
- local?, ejb-class, persistence-type, prim-key-class,
- reentrant, cmp-version?, abstract-schema-name?,
- cmp-field*, primkey-field?, env-entry*, ejb-ref*,
- ejb-local-ref*, security-role-ref*, security-identity?,
- resource-ref*, resource-env-ref*, query*)>
-
-<!--
-The env-entry element contains the declaration of an enterprise bean's
-environment entry. The declaration consists of an optional
-description, the name of the environment entry, and an optional
-value. If a value is not specified, one must be supplied
-during deployment.
-
-Used in: entity, message-driven, session
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-type,
- env-entry-value?)>
-
-<!--
-The env-entry-name element contains the name of an enterprise bean's
-environment entry. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within an enterprise bean.
-
-Used in: env-entry
-
-Example:
-
-<env-entry-name>minAmount</env-entry-name>
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the enterprise bean's
-code.
-
-The following are the legal values of env-entry-type:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
-
-Used in: env-entry
-
-Example:
-
-<env-entry-type>java.lang.Boolean</env-entry-type>
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an enterprise bean's
-environment entry. The value must be a String that is valid for the
-constructor of the specified type that takes a single String
-parameter, or for java.lang.Character, a single character.
-
-Used in: env-entry
-
-Example:
-
-<env-entry-value>100.00</env-entry-value>
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The exclude list element specifies one or more methods which the
-Assembler marks to be uncallable.
-
-If the method permission relation contains methods that are in the
-exclude list, the Deployer should consider those methods to be
-uncallable.
-
-Used in: assembly-descriptor
--->
-<!ELEMENT exclude-list (description?, method+)>
-
-<!--
-The field-name element specifies the name of a container managed
-field.
-
-The name of the cmp-field of an entity bean with cmp-version 2.x must
-begin with a lowercase letter. This field is accessed by methods whose
-names consists of the name of the field specified by field-name in
-which the first letter is uppercased, prefixed by "get" or "set".
-
-The name of the cmp-field of an entity bean with cmp-version 1.x must
-denote a public field of the enterprise bean class or one of its
-superclasses.
-
-Used in: cmp-field
-
-Example:
-
-
- <field-name>firstName</field-Name>
-
--->
-<!ELEMENT field-name (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref, entity, session
-
-Example:
-
-<home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the enterprise bean's
-ejb-jar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: ejb-jar, entity, message-driven, session
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-
-The local element contains the fully-qualified name of the
-enterprise bean's local interface.
-
-Used in: ejb-local-ref, entity, session
-
--->
-<!ELEMENT local (#PCDATA)>
-
-<!--
-
-The local-home element contains the fully-qualified name of the
-enterprise bean's local home interface.
-
-Used in: ejb-local-ref, entity, session
--->
-<!ELEMENT local-home (#PCDATA)>
-
-<!--
-
-The message-driven element declares a message-driven bean. The
-declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional small icon file name
- - an optional large icon file name
- - a name assigned to the enterprise bean in
- the deployment descriptor
- - the message-driven bean's implementation class
- - the message-driven bean's transaction management type
- - an optional declaration of the message-driven bean's
- message selector
- - an optional declaration of the
- acknowledgment mode for the message-driven bean
- if bean-managed transaction demarcation is used
- - an optional declaration of the
- intended destination type of the message-driven bean
- - an optional declaration of the bean's environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB references
- - an optional declaration of the security
- identity to be used for the execution of the bean's methods
- - an optional declaration of the bean's resource manager
- connection factory references
- - an optional declaration of the bean's resource
- environment references.
-
-Used in: enterprise-beans
--->
-<!ELEMENT message-driven (description?, display-name?, small-icon?,
- large-icon?, ejb-name, ejb-class, transaction-type,
- message-selector?, acknowledge-mode?,
- message-driven-destination?, env-entry*, ejb-ref*,
- ejb-local-ref*, security-identity?, resource-ref*,
- resource-env-ref*)>
-
-<!--
-The message-driven-destination element provides advice to the Deployer
-as to whether a message-driven bean is intended for a Queue or a
-Topic. The declaration consists of: the type of the message-driven
-bean's intended destination and an optional declaration of whether a
-durable or non-durable subscription should be used if the
-destination-type is javax.jms.Topic.
-
-Used in: message-driven
--->
-<!ELEMENT message-driven-destination (destination-type,
-subscription-durability?)>
-
-<!--
-The message-selector element is used to specify the JMS message
-selector to be used in determining which messages a message-driven
-bean is to receive.
-
-Example:
-<message-selector>JMSType = `car' AND color = `blue' AND weight &gt; 2500
-</message-selector>
-
-Used in: message-driven
--->
-<!ELEMENT message-selector (#PCDATA)>
-
-<!--
-
-The method element is used to denote a method of an enterprise
-bean's home or component interface, or, in the case of a message-driven
-bean, the bean's onMessage method, or a set of methods. The ejb-name
-element must be the name of one of the enterprise beans declared in
-the deployment descriptor; the optional method-intf element allows to
-distinguish between a method with the same signature that is multiply
-defined across in both the home and component interfaces; the
-method-name element specifies the method name; and the optional
-method-params elements identify a single method among multiple methods
-with an overloaded method name.
-
-There are three possible styles of the method element syntax:
-
-1.
-<method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>*</method-name>
-</method>
-
- This style is used to refer to all the methods of the specified
- enterprise bean's home and component interfaces.
-
-2.
-<method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
-</method>>
-
- This style is used to refer to the specified method of the
- specified enterprise bean. If there are multiple methods with
- the same overloaded name, the element of this style refers to
- all the methods with the overloaded name.
-
-
-3.
-<method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-n</method-param>
- </method-params>
-<method>
-
-
- This style is used to refer to a single method within a set of
- methods with an overloaded name. PARAM-1 through PARAM-n are the
- fully-qualified Java types of the method's input parameters (if
- the method has no input arguments, the method-params element
- contains no method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of square
- brackets (e.g. int[][]). If there are multiple methods with the
- same overloaded name, this style refers to all of the overloaded
- methods.
-
-
-Used in: container-transaction, exclude-list, method-permission
-
-Examples:
-
-Style 1: The following method element refers to all the methods of
-the EmployeeService bean's home and component interfaces:
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>*</method-name>
-</method>
-
-Style 2: The following method element refers to all the create
-methods of the EmployeeService bean's home interface(s).
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
-</method>
-
-
-Style 3: The following method element refers to the
-create(String firstName, String LastName) method of the
-EmployeeService bean's home interface(s).
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
-</method>
-
-
-The following example illustrates a Style 3 element with
-more complex parameter types. The method
-foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
-mypackage.MyClass[][] myclaar) would be specified as:
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>foobar</method-name>
- <method-params>
- <method-param>char</method-param>
- <method-param>int</method-param>
- <method-param>int[]</method-param>
- <method-param>mypackage.MyClass</method-param>
- <method-param>mypackage.MyClass[][]</method-param>
- </method-params>
-</method>
-
-
-The optional method-intf element can be used when it becomes necessary
-to differentiate between a method that is multiply defined across the
-enterprise bean's home and component interfaces with the same name and
-signature.
-
-
-For example, the method element
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Remote</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
-</method>
-
-
-can be used to differentiate the create(String, String) method defined
-in the remote interface from the create(String, String) method defined
-in the remote home interface, which would be defined as
-
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
-</method>
-
-and the create method that is defined in the local home interface
-which would be defined as
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>LocalHome</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
-</method>
-
-
-The method-intf element can be used with all three Styles of the
-method element usage. For example, the following method element
-example could be used to refer to all the methods of the
-EmployeeService bean's remote home interface.
-
-
-<method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>*</method-name>
-</method>
-
--->
-<!ELEMENT method (description?, ejb-name, method-intf?, method-name,
-method-params?)>
-
-<!--
-
-The method-intf element allows a method element to differentiate
-between the methods with the same name and signature that are multiply
-defined across the component and home interfaces (e.g, in both an
-enterprise bean's remote and local interfaces; in both an enterprise bean's
-home and remote interfaces, etc.)
-
-The method-intf element must be one of the following:
-
- <method-intf>Home</method-intf>
- <method-intf>Remote</method-intf>
- <method-intf>LocalHome</method-intf>
- <method-intf>Local</method-intf>
-
-Used in: method
--->
-<!ELEMENT method-intf (#PCDATA)>
-
-<!--
-The method-name element contains a name of an enterprise bean method
-or the asterisk (*) character. The asterisk is used when the element
-denotes all the methods of an enterprise bean's component and home
-interfaces.
-
-Used in: method, query-method
--->
-<!ELEMENT method-name (#PCDATA)>
-
-<!--
-The method-param element contains the fully-qualified Java type name
-of a method parameter.
-
-Used in: method-params
--->
-<!ELEMENT method-param (#PCDATA)>
-
-<!--
-The method-params element contains a list of the fully-qualified Java
-type names of the method parameters.
-
-Used in: method, query-method
--->
-<!ELEMENT method-params (method-param*)>
-
-<!--
-
-The method-permission element specifies that one or more security
-roles are allowed to invoke one or more enterprise bean methods. The
-method-permission element consists of an optional description, a list
-of security role names or an indicator to state that the method is
-unchecked for authorization, and a list of method elements.
-
-The security roles used in the method-permission element must be
-defined in the security-role elements of the deployment descriptor,
-and the methods must be methods defined in the enterprise bean's
-component and/or home interfaces.
-
-
-Used in: assembly-descriptor
--->
-<!ELEMENT method-permission (description?, (role-name+|unchecked), method+)>
-
-<!--
-The multiplicity element describes the multiplicity of the role that
-participates in a relation.
-
-The multiplicity element must be one of the two following:
-
- <multiplicity>One</multiplicity>
- <multiplicity>Many</multiplicity>
-
-Used in: ejb-relationship-role
--->
-<!ELEMENT multiplicity (#PCDATA)>
-
-<!--
-The persistence-type element specifies an entity bean's persistence
-management type.
-
-The persistence-type element must be one of the two following:
-
- <persistence-type>Bean</persistence-type>
- <persistence-type>Container</persistence-type>
-
-Used in: entity
--->
-<!ELEMENT persistence-type (#PCDATA)>
-
-<!--
-The prim-key-class element contains the fully-qualified name of an
-entity bean's primary key class.
-
-If the definition of the primary key class is deferred to deployment
-time, the prim-key-class element should specify java.lang.Object.
-
-Used in: entity
-
-Examples:
-
- <prim-key-class>java.lang.String</prim-key-class>
-
- <prim-key-class>com.wombat.empl.EmployeeID</prim-key-class>
-
- <prim-key-class>java.lang.Object</prim-key-class>
-
--->
-<!ELEMENT prim-key-class (#PCDATA)>
-
-<!--
-The primkey-field element is used to specify the name of the primary
-key field for an entity with container-managed persistence.
-
-The primkey-field must be one of the fields declared in the cmp-field
-element, and the type of the field must be the same as the primary key
-type.
-
-The primkey-field element is not used if the primary key maps to
-multiple container-managed fields (i.e. the key is a compound key). In
-this case, the fields of the primary key class must be public, and
-their names must correspond to the field names of the entity bean
-class that comprise the key.
-
-Used in: entity
-
-Example:
-
- <primkey-field>EmployeeId</primkey-field>
-
--->
-<!ELEMENT primkey-field (#PCDATA)>
-
-<!--
-The query element is used to specify a finder or select query. It
-contains
- - an optional description of the query
- - the specification of the finder or select
- method it is used by
- - an optional specification of the result type mapping, if
- the query is for a select method and entity objects are
- returned.
- - the EJB QL query string that defines the query.
-
-Queries that are expressible in EJB QL must use the ejb-ql element to
-specify the query. If a query is not expressible in EJB QL, the
-description element should be used to describe the semantics of the
-query and the ejb-ql element should be empty.
-
-The result-type-mapping is an optional element. It can only be present
-if the query-method specifies a select method that returns entity
-objects. The default value for the result-type-mapping element is
-"Local".
-
-
-Used in: entity
--->
-<!ELEMENT query (description?, query-method, result-type-mapping?, ejb-ql)>
-
-<!--
-The query-method element is used to specify the method for a finder or
-select query.
-
-The method-name element specifies the name of a finder or select
-method in the entity bean's implementation class.
-
-Each method-param must be defined for a query-method using the
-method-params element.
-
-Used in: query
-
-Example:
-
-<query>
- <description>Method finds large orders</description>
- <query-method>
- <method-name>findLargeOrders</method-name>
- <method-params></method-params>
- </query-method>
- <ejb-ql>SELECT OBJECT(o) FROM Order o WHERE o.amount &gt; 1000</ejb-ql>
-</query>
-
--->
-<!ELEMENT query-method (method-name, method-params)>
-
-<!--
-The reentrant element specifies whether an entity bean is reentrant or
-not.
-
-The reentrant element must be one of the two following:
-
- <reentrant>True</reentrant>
- <reentrant>False</reentrant>
-
-Used in: entity
--->
-<!ELEMENT reentrant (#PCDATA)>
-
-<!--
-
-The relationship-role-source element designates the source of a role
-that participates in a relationship. A relationship-role-source
-element uniquely identifies an entity bean.
-
-Used in: ejb-relationship-role
--->
-<!ELEMENT relationship-role-source (description?, ejb-name)>
-
-<!--
-The relationships element describes the relationships in which
-entity beans with container-managed persistence participate. The
-relationships element contains an optional description; and a list of
-ejb-relation elements, which specify the container managed
-relationships.
-
-
-Used in: ejb-jar
--->
-<!ELEMENT relationships (description?, ejb-relation+)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref, entity, session
-
-Example:
-
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the enterprise bean code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the enterprise bean. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
-
- <res-auth>Application</res-auth>
- <res-auth>Container</res-auth>
-
-Used in: resource-ref
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within an enterprise bean.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-sharing-scope element specifies whether connections obtained
-through the given resource manager connection factory reference can be
-shared. The value of this element, if specified, must be one of the
-two following:
-
- <res-sharing-scope>Shareable</res-sharing-scope>
- <res-sharing-scope>Unshareable</res-sharing-scope>
-
-The default value is Shareable.
-
-Used in: resource-ref
--->
-<!ELEMENT res-sharing-scope (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type
-is specified by the fully qualified Java language class or interface
-expected to be implemented by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-env-ref element contains a declaration of an enterprise bean's
-reference to an administered object associated with a resource
-in the enterprise bean's environment. It consists of an optional
-description, the resource environment reference name, and an
-indication of the resource environment reference type expected by
-the enterprise bean code.
-
-Used in: entity, message-driven, session
-
-Example:
-
-<resource-env-ref>
- <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
-</resource-env-ref>
--->
-<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
- resource-env-ref-type)>
-
-<!--
-The resource-env-ref-name element specifies the name of a resource
-environment reference; its value is the environment entry name used in
-the enterprise bean code. The name is a JNDI name relative to the
-java:comp/env context and must be unique within an enterprise bean.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!--
-The resource-env-ref-type element specifies the type of a resource
-environment reference. It is the fully qualified name of a Java
-language class or interface.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of an enterprise bean's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type
-expected by the enterprise bean code, the type of authentication
-(Application or Container), and an optional specification of the
-shareability of connections obtained from the resource (Shareable or
-Unshareable).
-
-Used in: entity, message-driven, session
-
-Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
- res-sharing-scope?)>
-
-<!--
-
-The result-type-mapping element is used in the query element to specify
-whether an abstract schema type returned by a query for a select method
-is to be mapped to an EJBLocalObject or EJBObject type.
-
-The result-type-mapping element must be one of the following:
-
- <result-type-mapping>Local</result-type-mapping>
- <result-type-mapping>Remote</result-type-mapping>
-
-Used in: query
--->
-<!ELEMENT result-type-mapping (#PCDATA)>
-
-<!--
-The role-link element is a reference to a defined security role. The
-role-link element must contain the name of one of the security roles
-defined in the security-role elements.
-
-Used in: security-role-ref
--->
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: method-permission, run-as, security-role, security-role-ref
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The run-as element specifies the run-as identity to be used for the
-execution of the enterprise bean. It contains an optional description, and
-the name of a security role.
-
-Used in: security-identity
--->
-<!ELEMENT run-as (description?, role-name)>
-
-<!--
-
-The security-identity element specifies whether the caller's
-security identity is to be used for the execution of the methods of
-the enterprise bean or whether a specific run-as identity is to be
-used. It contains an optional description and a specification of the
-security identity to be used.
-
-Used in: entity, message-driven, session
--->
-<!ELEMENT security-identity (description?, (use-caller-identity|run-as))>
-
-<!--
-The security-role element contains the definition of a security
-role. The definition consists of an optional description of the
-security role, and the security role name.
-
-Used in: assembly-descriptor
-
-Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The security-role-ref element contains the declaration of a security
-role reference in the enterprise bean's code. The declaration consists
-of an optional description, the security role name used in the code,
-and an optional link to a security role. If the security role is not
-specified, the Deployer must choose an appropriate security role.
-
-The value of the role-name element must be the String used as the
-parameter to the EJBContext.isCallerInRole(String roleName) method
-or the HttpServletRequest.isUserInRole(String role) method.
-
-Used in: entity, session
-
--->
-<!ELEMENT security-role-ref (description?, role-name, role-link?)>
-
-<!--
-The session element declares an session bean. The declaration consists
-of:
- - an optional description
- - an optional display name
- - an optional small icon file name
- - an optional large icon file name
- - a name assigned to the enterprise bean
- in the deployment description
- - the names of the session bean's remote home and
- remote interfaces, if any
- - the names of the session bean's local home and
- local interfaces, if any
- - the session bean's implementation class
- - the session bean's state management type
- - the session bean's transaction management type
- - an optional declaration of the bean's environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB references
- - an optional declaration of the security role references
- - an optional declaration of the security identity to be
- used for the execution of the bean's methods
- - an optional declaration of the bean's resource manager
- connection factory references
- - an optional declaration of the bean's resource environment
- references.
-
-The elements that are optional are "optional" in the sense that they
-are omitted when if lists represented by them are empty.
-
-Either both the local-home and the local elements or both the
-home and the remote elements must be specified for the session bean.
-
-Used in: enterprise-beans
--->
-<!ELEMENT session (description?, display-name?, small-icon?,
-large-icon?, ejb-name, home?, remote?, local-home?, local?,
-ejb-class, session-type, transaction-type, env-entry*, ejb-ref*,
-ejb-local-ref*, security-role-ref*, security-identity?, resource-ref*,
-resource-env-ref*)>
-
-<!--
-The session-type element describes whether the session bean is a
-stateful session or stateless session.
-
-The session-type element must be one of the two following:
-
- <session-type>Stateful</session-type>
- <session-type>Stateless</session-type>
--->
-<!ELEMENT session-type (#PCDATA)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the enterprise bean's
-ejb-jar file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: ejb-jar, entity, message-driven, session
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The subscription-durability element specifies whether a JMS topic
-subscription is intended to be durable or nondurable.
-
-The subscription-durability element must be one of the two following:
-
- <subscription-durability>Durable</subscription-durability>
- <subscription-durability>NonDurable</subscription-durability>
-
-Used in: message-driven-destination
--->
-<!ELEMENT subscription-durability (#PCDATA)>
-
-<!--
-The trans-attribute element specifies how the container must manage
-the transaction boundaries when delegating a method invocation to an
-enterprise bean's business method.
-
-The value of trans-attribute must be one of the following:
-
-
- <trans-attribute>NotSupported</trans-attribute>
- <trans-attribute>Supports</trans-attribute>
- <trans-attribute>Required</trans-attribute>
- <trans-attribute>RequiresNew</trans-attribute>
- <trans-attribute>Mandatory</trans-attribute>
- <trans-attribute>Never</trans-attribute>
-
-Used in: container-transaction
--->
-<!ELEMENT trans-attribute (#PCDATA)>
-
-<!--
-The transaction-type element specifies an enterprise bean's
-transaction management type.
-
-The transaction-type element must be one of the two following:
-
- <transaction-type>Bean</transaction-type>
- <transaction-type>Container</transaction-type>
-
-Used in: message-driven, session
--->
-<!ELEMENT transaction-type (#PCDATA)>
-
-<!--
-The unchecked element specifies that a method is not checked for authorization
-by the container prior to invocation of the method.
-
-Used in: method-permission
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-
-The use-caller-identity element specifies that the caller's security
-identity be used as the security identity for the execution of the
-enterprise bean's methods.
-
-Used in: security-identity
--->
-<!ELEMENT use-caller-identity EMPTY>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST abstract-schema-name id ID #IMPLIED>
-<!ATTLIST acknowledge-mode id ID #IMPLIED>
-<!ATTLIST assembly-descriptor id ID #IMPLIED>
-<!ATTLIST cascade-delete id ID #IMPLIED>
-<!ATTLIST cmp-field id ID #IMPLIED>
-<!ATTLIST cmp-version id ID #IMPLIED>
-<!ATTLIST cmr-field id ID #IMPLIED>
-<!ATTLIST cmr-field-name id ID #IMPLIED>
-<!ATTLIST cmr-field-type id ID #IMPLIED>
-<!ATTLIST container-transaction id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST destination-type id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST ejb-class id ID #IMPLIED>
-<!ATTLIST ejb-client-jar id ID #IMPLIED>
-<!ATTLIST ejb-jar id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-local-ref id ID #IMPLIED>
-<!ATTLIST ejb-name id ID #IMPLIED>
-<!ATTLIST ejb-ql id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST ejb-relation id ID #IMPLIED>
-<!ATTLIST ejb-relation-name id ID #IMPLIED>
-<!ATTLIST ejb-relationship-role id ID #IMPLIED>
-<!ATTLIST ejb-relationship-role-name id ID #IMPLIED>
-<!ATTLIST enterprise-beans id ID #IMPLIED>
-<!ATTLIST entity id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST exclude-list id ID #IMPLIED>
-<!ATTLIST field-name id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST local id ID #IMPLIED>
-<!ATTLIST local-home id ID #IMPLIED>
-<!ATTLIST message-driven id ID #IMPLIED>
-<!ATTLIST message-driven-destination id ID #IMPLIED>
-<!ATTLIST message-selector id ID #IMPLIED>
-<!ATTLIST method id ID #IMPLIED>
-<!ATTLIST method-intf id ID #IMPLIED>
-<!ATTLIST method-name id ID #IMPLIED>
-<!ATTLIST method-param id ID #IMPLIED>
-<!ATTLIST method-params id ID #IMPLIED>
-<!ATTLIST method-permission id ID #IMPLIED>
-<!ATTLIST multiplicity id ID #IMPLIED>
-<!ATTLIST persistence-type id ID #IMPLIED>
-<!ATTLIST prim-key-class id ID #IMPLIED>
-<!ATTLIST primkey-field id ID #IMPLIED>
-<!ATTLIST query id ID #IMPLIED>
-<!ATTLIST query-method id ID #IMPLIED>
-<!ATTLIST reentrant id ID #IMPLIED>
-<!ATTLIST relationship-role-source id ID #IMPLIED>
-<!ATTLIST relationships id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-sharing-scope id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-env-ref id ID #IMPLIED>
-<!ATTLIST resource-env-ref-name id ID #IMPLIED>
-<!ATTLIST resource-env-ref-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST result-type-mapping id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST run-as id ID #IMPLIED>
-<!ATTLIST security-identity id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST session id ID #IMPLIED>
-<!ATTLIST session-type id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST subscription-durability id ID #IMPLIED>
-<!ATTLIST trans-attribute id ID #IMPLIED>
-<!ATTLIST transaction-type id ID #IMPLIED>
-<!ATTLIST unchecked id ID #IMPLIED>
-<!ATTLIST use-caller-identity id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_1.xsd
deleted file mode 100644
index 419426b7ad..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_2_1.xsd
+++ /dev/null
@@ -1,2208 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)ejb-jar_2_1.xsds 1.23 08/01/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the EJB 2.1 deployment descriptor.
- The deployment descriptor must be named "META-INF/ejb-jar.xml" in
- the EJB's jar file. All EJB deployment descriptors must indicate
- the ejb-jar schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
- version="2.1">
- ...
- </ejb-jar>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for the
- J2EE namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="ejb-jar" type="j2ee:ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is the root of the ejb-jar deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:key name="ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-name element contains the name of an enterprise
- bean. The name must be unique within the ejb-jar file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:enterprise-beans/*"/>
- <xsd:field xpath="j2ee:ejb-name"/>
- </xsd:key>
-
- <xsd:keyref name="ejb-name-references"
- refer="j2ee:ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- relationship-role-source must be to a specific ejb-name
- defined within the scope of enterprise-beans element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector
- xpath=".//j2ee:ejb-relationship-role/j2ee:relationship-role-source"/>
- <xsd:field
- xpath="j2ee:ejb-name"/>
- </xsd:keyref>
-
- <xsd:key name="role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:assembly-descriptor/j2ee:security-role"/>
- <xsd:field xpath="j2ee:role-name"/>
- </xsd:key>
-
- <xsd:keyref name="role-name-references"
- refer="j2ee:role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:enterprise-beans/*/j2ee:security-role-ref"/>
- <xsd:field xpath="j2ee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-propertyType contains a name/value
- configuration property pair for a message-driven bean.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="activation-config-property-name"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-name element contains
- the name for an activation configuration property of
- a message-driven bean.
-
- For JMS message-driven beans, the following property
- names are recognized: acknowledgeMode,
- messageSelector, destinationType, subscriptionDurability
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="activation-config-property-value"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-value element
- contains the value for an activation configuration
- property of a message-driven bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-configType defines information about the
- expected configuration properties of the message-driven bean
- in its operational environment. This may include information
- about message acknowledgement, message selector, expected
- destination type, etc.
-
- The configuration information is expressed in terms of
- name/value configuration properties.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="activation-config-property"
- type="j2ee:activation-config-propertyType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="assembly-descriptorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The assembly-descriptorType defines
- application-assembly information.
-
- The application-assembly information consists of the
- following parts: the definition of security roles, the
- definition of method permissions, the definition of
- transaction attributes for enterprise beans with
- container-managed transaction demarcation and a list of
- methods to be excluded from being invoked.
-
- All the parts are optional in the sense that they are
- omitted if the lists represented by them are empty.
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar file producer.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="security-role"
- type="j2ee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method-permission"
- type="j2ee:method-permissionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="container-transaction"
- type="j2ee:container-transactionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination"
- type="j2ee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="exclude-list"
- type="j2ee:exclude-listType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-fieldType describes a container-managed field. The
- cmp-fieldType contains an optional description of the field,
- and the name of the field.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="field-name"
- type="j2ee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The field-name element specifies the name of a
- container managed field.
-
- The name of the cmp-field of an entity bean with
- cmp-version 2.x must begin with a lowercase
- letter. This field is accessed by methods whose
- names consists of the name of the field specified by
- field-name in which the first letter is uppercased,
- prefixed by "get" or "set".
-
- The name of the cmp-field of an entity bean with
- cmp-version 1.x must denote a public field of the
- enterprise bean class or one of its superclasses.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-versionType specifies the version of an entity bean
- with container-managed persistence. It is used by
- cmp-version elements.
-
- The value must be one of the two following:
-
- 1.x
- 2.x
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="1.x"/>
- <xsd:enumeration value="2.x"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-field-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-type element specifies the class of a
- collection-valued logical relationship field in the entity
- bean class. The value of an element using cmr-field-typeType
- must be either: java.util.Collection or java.util.Set.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="java.util.Collection"/>
- <xsd:enumeration value="java.util.Set"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-fieldType describes the bean provider's view of
- a relationship. It consists of an optional description, and
- the name and the class type of a field in the source of a
- role of a relationship. The cmr-field-name element
- corresponds to the name used for the get and set accessor
- methods for the relationship. The cmr-field-type element is
- used only for collection-valued cmr-fields. It specifies the
- type of the collection that is used.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="cmr-field-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-name element specifies the name of a
- logical relationship field in the entity bean
- class. The name of the cmr-field must begin with a
- lowercase letter. This field is accessed by methods
- whose names consist of the name of the field
- specified by cmr-field-name in which the first
- letter is uppercased, prefixed by "get" or "set".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmr-field-type"
- type="j2ee:cmr-field-typeType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="container-transactionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-transactionType specifies how the container
- must manage transaction scopes for the enterprise bean's
- method invocations. It defines an optional description, a
- list of method elements, and a transaction attribute. The
- transaction attribute is to be applied to all the specified
- methods.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="j2ee:methodType"
- maxOccurs="unbounded"/>
- <xsd:element name="trans-attribute"
- type="j2ee:trans-attributeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-classType contains the fully-qualified name of the
- enterprise bean's class. It is used by ejb-class elements.
-
- Example:
-
- <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-jarType defines the root element of the EJB
- deployment descriptor. It contains
-
- - an optional description of the ejb-jar file
- - an optional display name
- - an optional icon that contains a small and a large
- icon file name
- - mandatory structural information about all included
- enterprise beans
- - a descriptor for container managed relationships,
- if any
- - an optional application-assembly descriptor
- - an optional name of an ejb-client-jar file for the
- ejb-jar.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="enterprise-beans"
- type="j2ee:enterprise-beansType"/>
- <xsd:element name="relationships"
- type="j2ee:relationshipsType"
- minOccurs="0">
- <xsd:unique name="relationship-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name contains the name of a
- relation. The name must be unique within
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-relation"/>
- <xsd:field xpath="j2ee:ejb-relation-name"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="assembly-descriptor"
- type="j2ee:assembly-descriptorType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar file
- producer.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-client-jar"
- type="j2ee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The optional ejb-client-jar element specifies a JAR
- file that contains the class files necessary for a
- client program to access the
- enterprise beans in the ejb-jar file.
-
- Example:
-
- <ejb-client-jar>employee_service_client.jar
- </ejb-client-jar>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="2.1"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The version specifies the version of the
- EJB specification that the instance document must
- comply with. This information enables deployment tools
- to validate a particular EJB Deployment
- Descriptor with respect to a specific version of the EJB
- schema.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-nameType specifies an enterprise bean's name. It is
- used by ejb-name elements. This name is assigned by the
- ejb-jar file producer to name the enterprise bean in the
- ejb-jar file's deployment descriptor. The name must be
- unique among the names of the enterprise beans in the same
- ejb-jar file.
-
- There is no architected relationship between the used
- ejb-name in the deployment descriptor and the JNDI name that
- the Deployer will assign to the enterprise bean's home.
-
- The name for an entity bean must conform to the lexical
- rules for an NMTOKEN.
-
- Example:
-
- <ejb-name>EmployeeService</ejb-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdNMTOKENType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationType describes a relationship between two
- entity beans with container-managed persistence. It is used
- by ejb-relation elements. It contains a description; an
- optional ejb-relation-name element; and exactly two
- relationship role declarations, defined by the
- ejb-relationship-role elements. The name of the
- relationship, if specified, is unique within the ejb-jar
- file.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation-name"
- type="j2ee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name element provides a unique name
- within the ejb-jar file for a relationship.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-relationship-role"
- type="j2ee:ejb-relationship-roleType"/>
- <xsd:element name="ejb-relationship-role"
- type="j2ee:ejb-relationship-roleType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationship-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-relationship-roleType describes a role within a
- relationship. There are two roles in each relationship.
-
- The ejb-relationship-roleType contains an optional
- description; an optional name for the relationship role; a
- specification of the multiplicity of the role; an optional
- specification of cascade-delete functionality for the role;
- the role source; and a declaration of the cmr-field, if any,
- by means of which the other side of the relationship is
- accessed from the perspective of the role source.
-
- The multiplicity and role-source element are mandatory.
-
- The relationship-role-source element designates an entity
- bean by means of an ejb-name element. For bidirectional
- relationships, both roles of a relationship must declare a
- relationship-role-source element that specifies a cmr-field
- in terms of which the relationship is accessed. The lack of
- a cmr-field element in an ejb-relationship-role specifies
- that the relationship is unidirectional in navigability and
- the entity bean that participates in the relationship is
- "not aware" of the relationship.
-
- Example:
-
- <ejb-relation>
- <ejb-relation-name>Product-LineItem</ejb-relation-name>
- <ejb-relationship-role>
- <ejb-relationship-role-name>product-has-lineitems
- </ejb-relationship-role-name>
- <multiplicity>One</multiplicity>
- <relationship-role-source>
- <ejb-name>ProductEJB</ejb-name>
- </relationship-role-source>
- </ejb-relationship-role>
- </ejb-relation>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relationship-role-name"
- type="j2ee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name element defines a
- name for a role that is unique within an
- ejb-relation. Different relationships can use the
- same name for a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="multiplicity"
- type="j2ee:multiplicityType"/>
- <xsd:element name="cascade-delete"
- type="j2ee:emptyType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The cascade-delete element specifies that, within a
- particular relationship, the lifetime of one or more
- entity beans is dependent upon the lifetime of
- another entity bean. The cascade-delete element can
- only be specified for an ejb-relationship-role
- element contained in an ejb-relation element in
- which the other ejb-relationship-role
- element specifies a multiplicity of One.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="relationship-role-source"
- type="j2ee:relationship-role-sourceType"/>
- <xsd:element name="cmr-field"
- type="j2ee:cmr-fieldType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="enterprise-beansType">
- <xsd:annotation>
- <xsd:documentation>
-
- The enterprise-beansType declares one or more enterprise
- beans. Each bean can be a session, entity or message-driven
- bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="session"
- type="j2ee:session-beanType">
- <xsd:unique name="session-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-local-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-env-ref"/>
- <xsd:field xpath="j2ee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:message-destination-ref"/>
- <xsd:field xpath="j2ee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-ref"/>
- <xsd:field xpath="j2ee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:env-entry"/>
- <xsd:field xpath="j2ee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- <xsd:element name="entity"
- type="j2ee:entity-beanType">
- <xsd:unique name="entity-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-local-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-env-ref"/>
- <xsd:field xpath="j2ee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:message-destination-ref"/>
- <xsd:field xpath="j2ee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-ref"/>
- <xsd:field xpath="j2ee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:env-entry"/>
- <xsd:field xpath="j2ee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- <xsd:element name="message-driven"
- type="j2ee:message-driven-beanType">
- <xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-local-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-env-ref"/>
- <xsd:field xpath="j2ee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:message-destination-ref"/>
- <xsd:field xpath="j2ee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-ref"/>
- <xsd:field xpath="j2ee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:env-entry"/>
- <xsd:field xpath="j2ee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- </xsd:choice>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-beanType declares an entity bean. The declaration
- consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a unique name assigned to the enterprise bean
- in the deployment descriptor
- - the names of the entity bean's remote home
- and remote interfaces, if any
- - the names of the entity bean's local home and local
- interfaces, if any
- - the entity bean's implementation class
- - the entity bean's persistence management type
- - the entity bean's primary key class name
- - an indication of the entity bean's reentrancy
- - an optional specification of the
- entity bean's cmp-version
- - an optional specification of the entity bean's
- abstract schema name
- - an optional list of container-managed fields
- - an optional specification of the primary key
- field
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB
- references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's
- resource manager connection factory references
- - an optional declaration of the bean's
- resource environment references
- - an optional declaration of the bean's message
- destination references
- - an optional set of query declarations
- for finder and select methods for an entity
- bean with cmp-version 2.x.
-
- The optional abstract-schema-name element must be specified
- for an entity bean with container-managed persistence and
- cmp-version 2.x.
-
- The optional primkey-field may be present in the descriptor
- if the entity's persistence-type is Container.
-
- The optional cmp-version element may be present in the
- descriptor if the entity's persistence-type is Container. If
- the persistence-type is Container and the cmp-version
- element is not specified, its value defaults to 2.x.
-
- The optional home and remote elements must be specified if
- the entity bean cmp-version is 1.x.
-
- The optional home and remote elements must be specified if
- the entity bean has a remote home and remote interface.
-
- The optional local-home and local elements must be specified
- if the entity bean has a local home and local interface.
-
- Either both the local-home and the local elements or both
- the home and the remote elements must be specified.
-
- The optional query elements must be present if the
- persistence-type is Container and the cmp-version is 2.x and
- query methods other than findByPrimaryKey have been defined
- for the entity bean.
-
- The other elements that are optional are "optional" in the
- sense that they are omitted if the lists represented by them
- are empty.
-
- At least one cmp-field element must be present in the
- descriptor if the entity's persistence-type is Container and
- the cmp-version is 1.x, and none must not be present if the
- entity's persistence-type is Bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="j2ee:ejb-nameType"/>
- <xsd:element name="home"
- type="j2ee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="j2ee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="j2ee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="j2ee:localType"
- minOccurs="0"/>
- <xsd:element name="ejb-class"
- type="j2ee:ejb-classType"/>
- <xsd:element name="persistence-type"
- type="j2ee:persistence-typeType"/>
- <xsd:element name="prim-key-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The prim-key-class element contains the
- fully-qualified name of an
- entity bean's primary key class.
-
- If the definition of the primary key class is
- deferred to deployment time, the prim-key-class
- element should specify java.lang.Object.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reentrant"
- type="j2ee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The reentrant element specifies whether an entity
- bean is reentrant or not.
-
- The reentrant element must be one of the two
- following: true or false
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-version"
- type="j2ee:cmp-versionType"
- minOccurs="0"/>
- <xsd:element name="abstract-schema-name"
- type="j2ee:java-identifierType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The abstract-schema-name element specifies the name
- of the abstract schema type of an entity bean with
- cmp-version 2.x. It is used in EJB QL queries.
-
- For example, the abstract-schema-name for an entity
- bean whose local interface is
- com.acme.commerce.Order might be Order.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-field"
- type="j2ee:cmp-fieldType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="primkey-field"
- type="j2ee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The primkey-field element is used to specify the
- name of the primary key field for an entity with
- container-managed persistence.
-
- The primkey-field must be one of the fields declared
- in the cmp-field element, and the type of the field
- must be the same as the primary key type.
-
- The primkey-field element is not used if the primary
- key maps to multiple container-managed fields
- (i.e. the key is a compound key). In this case, the
- fields of the primary key class must be public, and
- their names must correspond to the field names of
- the entity bean class that comprise the key.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-role-ref"
- type="j2ee:security-role-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="security-identity"
- type="j2ee:security-identityType"
- minOccurs="0"/>
- <xsd:element name="query"
- type="j2ee:queryType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="exclude-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exclude-listType specifies one or more methods which
- the Assembler marks to be uncallable.
-
- If the method permission relation contains methods that are
- in the exclude list, the Deployer should consider those
- methods to be uncallable.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="j2ee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-driven-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-driven element declares a message-driven
- bean. The declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name.
- - a name assigned to the enterprise bean in
- the deployment descriptor
- - the message-driven bean's implementation class
- - an optional declaration of the bean's messaging
- type
- - the message-driven bean's transaction management type
- - an optional declaration of the bean's
- message-destination-type
- - an optional declaration of the bean's
- message-destination-link
- - an optional declaration of the message-driven bean's
- activation configuration properties
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB
- references
- - an optional declaration of the bean's web service
- references
- - an optional declaration of the security
- identity to be used for the execution of the bean's
- methods
- - an optional declaration of the bean's
- resource manager connection factory
- references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="j2ee:ejb-nameType"/>
- <xsd:element name="ejb-class"
- type="j2ee:ejb-classType"/>
- <xsd:element name="messaging-type"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The messaging-type element specifies the message
- listener interface of the message-driven bean. If
- the messaging-type element is not specified, it is
- assumed to be javax.jms.MessageListener.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="transaction-type"
- type="j2ee:transaction-typeType"/>
- <xsd:element name="message-destination-type"
- type="j2ee:message-destination-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-link"
- type="j2ee:message-destination-linkType"
- minOccurs="0"/>
- <xsd:element name="activation-config"
- type="j2ee:activation-configType"
- minOccurs="0"/>
- <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-identity"
- type="j2ee:security-identityType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-intfType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The method-intf element allows a method element to
- differentiate between the methods with the same name and
- signature that are multiply defined across the home and
- component interfaces (e.g, in both an enterprise bean's
- remote and local interfaces or in both an enterprise bean's
- home and remote interfaces, etc.); the component and web
- service endpoint interfaces, and so on.
-
- The method-intf element must be one of the following:
-
- Home
- Remote
- LocalHome
- Local
- ServiceEndpoint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Home"/>
- <xsd:enumeration value="Remote"/>
- <xsd:enumeration value="LocalHome"/>
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="ServiceEndpoint"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-nameType contains a name of an enterprise
- bean method or the asterisk (*) character. The asterisk is
- used when the element denotes all the methods of an
- enterprise bean's client view interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-paramsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-paramsType defines a list of the
- fully-qualified Java type names of the method parameters.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="method-param"
- type="j2ee:java-typeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-param element contains a primitive
- or a fully-qualified Java type name of a method
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-permissionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-permissionType specifies that one or more
- security roles are allowed to invoke one or more enterprise
- bean methods. The method-permissionType consists of an
- optional description, a list of security role names or an
- indicator to state that the method is unchecked for
- authorization, and a list of method elements.
-
- The security roles used in the method-permissionType
- must be defined in the security-role elements of the
- deployment descriptor, and the methods must be methods
- defined in the enterprise bean's home, component and/or web
- service endpoint interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="role-name"
- type="j2ee:role-nameType"
- maxOccurs="unbounded"/>
- <xsd:element name="unchecked"
- type="j2ee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The unchecked element specifies that a method is
- not checked for authorization by the container
- prior to invocation of the method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="method"
- type="j2ee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The methodType is used to denote a method of an enterprise
- bean's home, component, and/or web service endpoint
- interface, or, in the case of a message-driven bean, the
- bean's message listener method, or a set of such
- methods. The ejb-name element must be the name of one of the
- enterprise beans declared in the deployment descriptor; the
- optional method-intf element allows to distinguish between a
- method with the same signature that is multiply defined
- across the home, component, and/or web service endpoint
- interfaces; the method-name element specifies the method
- name; and the optional method-params elements identify a
- single method among multiple methods with an overloaded
- method name.
-
- There are three possible styles of using methodType element
- within a method element:
-
- 1.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>*</method-name>
- </method>
-
- This style is used to refer to all the methods of the
- specified enterprise bean's home, component, and/or web
- service endpoint interfaces.
-
- 2.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- </method>
-
- This style is used to refer to the specified method of
- the specified enterprise bean. If there are multiple
- methods with the same overloaded name, the element of
- this style refers to all the methods with the overloaded
- name.
-
- 3.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-n</method-param>
- </method-params>
- </method>
-
- This style is used to refer to a single method within a
- set of methods with an overloaded name. PARAM-1 through
- PARAM-n are the fully-qualified Java types of the
- method's input parameters (if the method has no input
- arguments, the method-params element contains no
- method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of
- square brackets (e.g. int[][]). If there are multiple
- methods with the same overloaded name, this style refers
- to all of the overloaded methods.
-
- Examples:
-
- Style 1: The following method element refers to all the
- methods of the EmployeeService bean's home, component,
- and/or web service endpoint interfaces:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>*</method-name>
- </method>
-
- Style 2: The following method element refers to all the
- create methods of the EmployeeService bean's home
- interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- </method>
-
- Style 3: The following method element refers to the
- create(String firstName, String LastName) method of the
- EmployeeService bean's home interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The following example illustrates a Style 3 element with
- more complex parameter types. The method
- foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
- mypackage.MyClass[][] myclaar) would be specified as:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>foobar</method-name>
- <method-params>
- <method-param>char</method-param>
- <method-param>int</method-param>
- <method-param>int[]</method-param>
- <method-param>mypackage.MyClass</method-param>
- <method-param>mypackage.MyClass[][]</method-param>
- </method-params>
- </method>
-
- The optional method-intf element can be used when it becomes
- necessary to differentiate between a method that is multiply
- defined across the enterprise bean's home, component, and/or
- web service endpoint interfaces with the same name and
- signature.
-
- For example, the method element
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Remote</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- can be used to differentiate the create(String, String)
- method defined in the remote interface from the
- create(String, String) method defined in the remote home
- interface, which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- and the create method that is defined in the local home
- interface which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>LocalHome</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The method-intf element can be used with all th ree Styles
- of the method element usage. For example, the following
- method element example could be used to refer to all the
- methods of the EmployeeService bean's remote home interface.
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>*</method-name>
- </method>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="j2ee:ejb-nameType"/>
- <xsd:element name="method-intf"
- type="j2ee:method-intfType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="method-name"
- type="j2ee:method-nameType"/>
- <xsd:element name="method-params"
- type="j2ee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="multiplicityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The multiplicityType describes the multiplicity of the
- role that participates in a relation.
-
- The value must be one of the two following:
-
- One
- Many
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="One"/>
- <xsd:enumeration value="Many"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-typeType specifies an entity bean's persistence
- management type.
-
- The persistence-type element must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The query-method specifies the method for a finder or select
- query.
-
- The method-name element specifies the name of a finder or select
- method in the entity bean's implementation class.
-
- Each method-param must be defined for a query-method using the
- method-params element.
-
- It is used by the query-method element.
-
- Example:
-
- <query>
- <description>Method finds large orders</description>
- <query-method>
- <method-name>findLargeOrders</method-name>
- <method-params></method-params>
- </query-method>
- <ejb-ql>
- SELECT OBJECT(o) FROM Order o
- WHERE o.amount &gt; 1000
- </ejb-ql>
- </query>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="method-name"
- type="j2ee:method-nameType"/>
- <xsd:element name="method-params"
- type="j2ee:method-paramsType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="queryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The queryType defines a finder or select
- query. It contains
- - an optional description of the query
- - the specification of the finder or select
- method it is used by
- - an optional specification of the result type
- mapping, if the query is for a select method
- and entity objects are returned.
- - the EJB QL query string that defines the query.
-
- Queries that are expressible in EJB QL must use the ejb-ql
- element to specify the query. If a query is not expressible
- in EJB QL, the description element should be used to
- describe the semantics of the query and the ejb-ql element
- should be empty.
-
- The result-type-mapping is an optional element. It can only
- be present if the query-method specifies a select method
- that returns entity objects. The default value for the
- result-type-mapping element is "Local".
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType" minOccurs="0"/>
- <xsd:element name="query-method"
- type="j2ee:query-methodType"/>
- <xsd:element name="result-type-mapping"
- type="j2ee:result-type-mappingType"
- minOccurs="0"/>
- <xsd:element name="ejb-ql"
- type="j2ee:xsdStringType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationship-role-sourceType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationship-role-sourceType designates the source of a
- role that participates in a relationship. A
- relationship-role-sourceType is used by
- relationship-role-source elements to uniquely identify an
- entity bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="j2ee:ejb-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationshipsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationshipsType describes the relationships in
- which entity beans with container-managed persistence
- participate. The relationshipsType contains an optional
- description; and a list of ejb-relation elements, which
- specify the container managed relationships.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation"
- type="j2ee:ejb-relationType"
- maxOccurs="unbounded">
-
- <xsd:unique name="role-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name contains the name of a
- relationship role. The name must be unique within
- a relationship, but can be reused in different
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector
- xpath=".//j2ee:ejb-relationship-role-name"/>
- <xsd:field
- xpath="."/>
- </xsd:unique>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="result-type-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The result-type-mappingType is used in the query element to
- specify whether an abstract schema type returned by a query
- for a select method is to be mapped to an EJBLocalObject or
- EJBObject type.
-
- The value must be one of the following:
-
- Local
- Remote
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="Remote"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-identityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-identityType specifies whether the caller's
- security identity is to be used for the execution of the
- methods of the enterprise bean or whether a specific run-as
- identity is to be used. It contains an optional description
- and a specification of the security identity to be used.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="use-caller-identity"
- type="j2ee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The use-caller-identity element specifies that
- the caller's security identity be used as the
- security identity for the execution of the
- enterprise bean's methods.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="run-as"
- type="j2ee:run-asType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-beanType declares an session bean. The
- declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a name assigned to the enterprise bean
- in the deployment description
- - the names of the session bean's remote home and
- remote interfaces, if any
- - the names of the session bean's local home and
- local interfaces, if any
- - the name of the session bean's web service endpoint
- interface, if any
- - the session bean's implementation class
- - the session bean's state management type
- - the session bean's transaction management type
- - an optional declaration of the bean's
- environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's resource
- manager connection factory references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- The elements that are optional are "optional" in the sense
- that they are omitted when if lists represented by them are
- empty.
-
- Either both the local-home and the local elements or both
- the home and the remote elements must be specified for the
- session bean.
-
- The service-endpoint element may only be specified if the
- bean is a stateless session bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="j2ee:ejb-nameType"/>
- <xsd:element name="home"
- type="j2ee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="j2ee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="j2ee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="j2ee:localType"
- minOccurs="0"/>
- <xsd:element name="service-endpoint"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint element contains the
- fully-qualified name of the enterprise bean's web
- service endpoint interface. The service-endpoint
- element may only be specified for a stateless
- session bean. The specified interface must be a
- valid JAX-RPC service endpoint interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-class"
- type="j2ee:ejb-classType"/>
- <xsd:element name="session-type"
- type="j2ee:session-typeType"/>
- <xsd:element name="transaction-type"
- type="j2ee:transaction-typeType"/>
- <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-role-ref"
- type="j2ee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-identity"
- type="j2ee:security-identityType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-typeType describes whether the session bean is a
- stateful session or stateless session. It is used by
- session-type elements.
-
- The value must be one of the two following:
-
- Stateful
- Stateless
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Stateful"/>
- <xsd:enumeration value="Stateless"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="trans-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The trans-attributeType specifies how the container must
- manage the transaction boundaries when delegating a method
- invocation to an enterprise bean's business method.
-
- The value must be one of the following:
-
- NotSupported
- Supports
- Required
- RequiresNew
- Mandatory
- Never
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="NotSupported"/>
- <xsd:enumeration value="Supports"/>
- <xsd:enumeration value="Required"/>
- <xsd:enumeration value="RequiresNew"/>
- <xsd:enumeration value="Mandatory"/>
- <xsd:enumeration value="Never"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transaction-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transaction-typeType specifies an enterprise bean's
- transaction management type.
-
- The transaction-type must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_0.xsd
deleted file mode 100644
index 48282913a4..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_0.xsd
+++ /dev/null
@@ -1,2706 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="3.0">
- <xsd:annotation>
- <xsd:documentation>
- @(#)ejb-jar_3_0.xsds 1.51 02/23/06
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2006 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the EJB 3.0 deployment descriptor.
- The deployment descriptor must be named "META-INF/ejb-jar.xml" in
- the EJB's jar file. All EJB deployment descriptors must indicate
- the ejb-jar schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
- version="3.0">
- ...
- </ejb-jar>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for the
- Java EE namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="ejb-jar" type="javaee:ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is the root of the ejb-jar deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:key name="ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-name element contains the name of an enterprise
- bean. The name must be unique within the ejb-jar file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:enterprise-beans/*"/>
- <xsd:field xpath="javaee:ejb-name"/>
- </xsd:key>
-
- <xsd:keyref name="ejb-name-references"
- refer="javaee:ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- relationship-role-source must be to a specific ejb-name
- defined within the scope of enterprise-beans element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector
-xpath=".//javaee:ejb-relationship-role/javaee:relationship-role-source"/>
- <xsd:field
- xpath="javaee:ejb-name"/>
- </xsd:keyref>
-
- <xsd:key name="role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:assembly-descriptor/javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:key>
-
- <xsd:keyref name="role-name-references"
- refer="javaee:role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:enterprise-beans/*/javaee:security-role-ref"/>
- <xsd:field xpath="javaee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-propertyType contains a name/value
- configuration property pair for a message-driven bean.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="activation-config-property-name"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-name element contains
- the name for an activation configuration property of
- a message-driven bean.
-
- For JMS message-driven beans, the following property
- names are recognized: acknowledgeMode,
- messageSelector, destinationType, subscriptionDurability
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="activation-config-property-value"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-value element
- contains the value for an activation configuration
- property of a message-driven bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-configType defines information about the
- expected configuration properties of the message-driven bean
- in its operational environment. This may include information
- about message acknowledgement, message selector, expected
- destination type, etc.
-
- The configuration information is expressed in terms of
- name/value configuration properties.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="activation-config-property"
- type="javaee:activation-config-propertyType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="application-exceptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application-exceptionType declares an application
- exception. The declaration consists of:
-
- - the exception class. When the container receives
- an exception of this type, it is required to
- forward this exception as an applcation exception
- to the client regardless of whether it is a checked
- or unchecked exception.
- - an optional rollback element. If this element is
- set to true, the container must rollback the current
- transaction before forwarding the exception to the
- client. If not specified, it defaults to false.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exception-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="rollback"
- type="javaee:true-falseType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="around-invokeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The around-invoke type specifies a method on a
- class to be called during the around invoke portion of an
- ejb invocation. Note that each class may have only one
- around invoke method and that the method may not be
- overloaded.
-
- If the class element is missing then
- the class defining the callback is assumed to be the
- interceptor class or component class in scope at the
- location in the descriptor in which the around invoke
- definition appears.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"/>
- <xsd:element name="method-name"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="assembly-descriptorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The assembly-descriptorType defines
- application-assembly information.
-
- The application-assembly information consists of the
- following parts: the definition of security roles, the
- definition of method permissions, the definition of
- transaction attributes for enterprise beans with
- container-managed transaction demarcation, the definition
- of interceptor bindings, a list of
- methods to be excluded from being invoked, and a list of
- exception types that should be treated as application exceptions.
-
- All the parts are optional in the sense that they are
- omitted if the lists represented by them are empty.
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar file producer.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="security-role"
- type="javaee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method-permission"
- type="javaee:method-permissionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="container-transaction"
- type="javaee:container-transactionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-binding"
- type="javaee:interceptor-bindingType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="exclude-list"
- type="javaee:exclude-listType"
- minOccurs="0"/>
- <xsd:element name="application-exception"
- type="javaee:application-exceptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-fieldType describes a container-managed field. The
- cmp-fieldType contains an optional description of the field,
- and the name of the field.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="field-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The field-name element specifies the name of a
- container managed field.
-
- The name of the cmp-field of an entity bean with
- cmp-version 2.x must begin with a lowercase
- letter. This field is accessed by methods whose
- names consists of the name of the field specified by
- field-name in which the first letter is uppercased,
- prefixed by "get" or "set".
-
- The name of the cmp-field of an entity bean with
- cmp-version 1.x must denote a public field of the
- enterprise bean class or one of its superclasses.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-versionType specifies the version of an entity bean
- with container-managed persistence. It is used by
- cmp-version elements.
-
- The value must be one of the two following:
-
- 1.x
- 2.x
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="1.x"/>
- <xsd:enumeration value="2.x"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-field-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-type element specifies the class of a
- collection-valued logical relationship field in the entity
- bean class. The value of an element using cmr-field-typeType
- must be either: java.util.Collection or java.util.Set.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="java.util.Collection"/>
- <xsd:enumeration value="java.util.Set"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-fieldType describes the bean provider's view of
- a relationship. It consists of an optional description, and
- the name and the class type of a field in the source of a
- role of a relationship. The cmr-field-name element
- corresponds to the name used for the get and set accessor
- methods for the relationship. The cmr-field-type element is
- used only for collection-valued cmr-fields. It specifies the
- type of the collection that is used.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="cmr-field-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-name element specifies the name of a
- logical relationship field in the entity bean
- class. The name of the cmr-field must begin with a
- lowercase letter. This field is accessed by methods
- whose names consist of the name of the field
- specified by cmr-field-name in which the first
- letter is uppercased, prefixed by "get" or "set".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmr-field-type"
- type="javaee:cmr-field-typeType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="container-transactionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-transactionType specifies how the container
- must manage transaction scopes for the enterprise bean's
- method invocations. It defines an optional description, a
- list of method elements, and a transaction attribute. The
- transaction attribute is to be applied to all the specified
- methods.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- <xsd:element name="trans-attribute"
- type="javaee:trans-attributeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-classType contains the fully-qualified name of the
- enterprise bean's class. It is used by ejb-class elements.
-
- Example:
-
- <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-jarType defines the root element of the EJB
- deployment descriptor. It contains
-
- - an optional description of the ejb-jar file
- - an optional display name
- - an optional icon that contains a small and a large
- icon file name
- - structural information about all included
- enterprise beans that is not specified through
- annotations
- - structural information about interceptor classes
- - a descriptor for container managed relationships,
- if any.
- - an optional application-assembly descriptor
- - an optional name of an ejb-client-jar file for the
- ejb-jar.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="enterprise-beans"
- type="javaee:enterprise-beansType"
- minOccurs="0"/>
- <xsd:element name="interceptors"
- type="javaee:interceptorsType"
- minOccurs="0"/>
- <xsd:element name="relationships"
- type="javaee:relationshipsType"
- minOccurs="0">
- <xsd:unique name="relationship-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name contains the name of a
- relation. The name must be unique within
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-relation"/>
- <xsd:field xpath="javaee:ejb-relation-name"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="assembly-descriptor"
- type="javaee:assembly-descriptorType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar file
- producer.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-client-jar"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The optional ejb-client-jar element specifies a JAR
- file that contains the class files necessary for a
- client program to access the
- enterprise beans in the ejb-jar file.
-
- Example:
-
- <ejb-client-jar>employee_service_client.jar
- </ejb-client-jar>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="3.0"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The version specifies the version of the
- EJB specification that the instance document must
- comply with. This information enables deployment tools
- to validate a particular EJB Deployment
- Descriptor with respect to a specific version of the EJB
- schema.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="metadata-complete" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-nameType specifies an enterprise bean's name. It is
- used by ejb-name elements. This name is assigned by the
- ejb-jar file producer to name the enterprise bean in the
- ejb-jar file's deployment descriptor. The name must be
- unique among the names of the enterprise beans in the same
- ejb-jar file.
-
- There is no architected relationship between the used
- ejb-name in the deployment descriptor and the JNDI name that
- the Deployer will assign to the enterprise bean's home.
-
- The name for an entity bean must conform to the lexical
- rules for an NMTOKEN.
-
- Example:
-
- <ejb-name>EmployeeService</ejb-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdNMTOKENType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationType describes a relationship between two
- entity beans with container-managed persistence. It is used
- by ejb-relation elements. It contains a description; an
- optional ejb-relation-name element; and exactly two
- relationship role declarations, defined by the
- ejb-relationship-role elements. The name of the
- relationship, if specified, is unique within the ejb-jar
- file.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name element provides a unique name
- within the ejb-jar file for a relationship.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-relationship-role"
- type="javaee:ejb-relationship-roleType"/>
- <xsd:element name="ejb-relationship-role"
- type="javaee:ejb-relationship-roleType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationship-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-relationship-roleType describes a role within a
- relationship. There are two roles in each relationship.
-
- The ejb-relationship-roleType contains an optional
- description; an optional name for the relationship role; a
- specification of the multiplicity of the role; an optional
- specification of cascade-delete functionality for the role;
- the role source; and a declaration of the cmr-field, if any,
- by means of which the other side of the relationship is
- accessed from the perspective of the role source.
-
- The multiplicity and role-source element are mandatory.
-
- The relationship-role-source element designates an entity
- bean by means of an ejb-name element. For bidirectional
- relationships, both roles of a relationship must declare a
- relationship-role-source element that specifies a cmr-field
- in terms of which the relationship is accessed. The lack of
- a cmr-field element in an ejb-relationship-role specifies
- that the relationship is unidirectional in navigability and
- the entity bean that participates in the relationship is
- "not aware" of the relationship.
-
- Example:
-
- <ejb-relation>
- <ejb-relation-name>Product-LineItem</ejb-relation-name>
- <ejb-relationship-role>
- <ejb-relationship-role-name>product-has-lineitems
- </ejb-relationship-role-name>
- <multiplicity>One</multiplicity>
- <relationship-role-source>
- <ejb-name>ProductEJB</ejb-name>
- </relationship-role-source>
- </ejb-relationship-role>
- </ejb-relation>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relationship-role-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name element defines a
- name for a role that is unique within an
- ejb-relation. Different relationships can use the
- same name for a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="multiplicity"
- type="javaee:multiplicityType"/>
- <xsd:element name="cascade-delete"
- type="javaee:emptyType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The cascade-delete element specifies that, within a
- particular relationship, the lifetime of one or more
- entity beans is dependent upon the lifetime of
- another entity bean. The cascade-delete element can
- only be specified for an ejb-relationship-role
- element contained in an ejb-relation element in
- which the other ejb-relationship-role
- element specifies a multiplicity of One.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="relationship-role-source"
- type="javaee:relationship-role-sourceType"/>
- <xsd:element name="cmr-field"
- type="javaee:cmr-fieldType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="enterprise-beansType">
- <xsd:annotation>
- <xsd:documentation>
-
- The enterprise-beansType declares one or more enterprise
- beans. Each bean can be a session, entity or message-driven
- bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="session"
- type="javaee:session-beanType">
- <xsd:unique name="session-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="session-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- <xsd:element name="entity"
- type="javaee:entity-beanType">
- <xsd:unique name="entity-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="entity-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- <xsd:element name="message-driven"
- type="javaee:message-driven-beanType">
- <xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="messaged-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
-
- </xsd:choice>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-beanType declares an entity bean. The declaration
- consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a unique name assigned to the enterprise bean
- in the deployment descriptor
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of the entity bean's remote home interface. This
- element is not required to be supported by all implementations.
- Any use of this element is non-portable.
- - the names of the entity bean's remote home
- and remote interfaces, if any
- - the names of the entity bean's local home and local
- interfaces, if any
- - the entity bean's implementation class
- - the optional entity bean's persistence management type. If
- this element is not specified it is defaulted to Container.
- - the entity bean's primary key class name
- - an indication of the entity bean's reentrancy
- - an optional specification of the
- entity bean's cmp-version
- - an optional specification of the entity bean's
- abstract schema name
- - an optional list of container-managed fields
- - an optional specification of the primary key
- field
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB
- references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's
- resource manager connection factory references
- - an optional declaration of the bean's
- resource environment references
- - an optional declaration of the bean's message
- destination references
- - an optional set of query declarations
- for finder and select methods for an entity
- bean with cmp-version 2.x.
-
- The optional abstract-schema-name element must be specified
- for an entity bean with container-managed persistence and
- cmp-version 2.x.
-
- The optional primkey-field may be present in the descriptor
- if the entity's persistence-type is Container.
-
- The optional cmp-version element may be present in the
- descriptor if the entity's persistence-type is Container. If
- the persistence-type is Container and the cmp-version
- element is not specified, its value defaults to 2.x.
-
- The optional home and remote elements must be specified if
- the entity bean cmp-version is 1.x.
-
- The optional home and remote elements must be specified if
- the entity bean has a remote home and remote interface.
-
- The optional local-home and local elements must be specified
- if the entity bean has a local home and local interface.
-
- Either both the local-home and the local elements or both
- the home and the remote elements must be specified.
-
- The optional query elements must be present if the
- persistence-type is Container and the cmp-version is 2.x and
- query methods other than findByPrimaryKey have been defined
- for the entity bean.
-
- The other elements that are optional are "optional" in the
- sense that they are omitted if the lists represented by them
- are empty.
-
- At least one cmp-field element must be present in the
- descriptor if the entity's persistence-type is Container and
- the cmp-version is 1.x, and none must not be present if the
- entity's persistence-type is Bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"/>
- <xsd:element name="persistence-type"
- type="javaee:persistence-typeType"/>
- <xsd:element name="prim-key-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The prim-key-class element contains the
- fully-qualified name of an
- entity bean's primary key class.
-
- If the definition of the primary key class is
- deferred to deployment time, the prim-key-class
- element should specify java.lang.Object.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reentrant"
- type="javaee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The reentrant element specifies whether an entity
- bean is reentrant or not.
-
- The reentrant element must be one of the two
- following: true or false
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-version"
- type="javaee:cmp-versionType"
- minOccurs="0"/>
- <xsd:element name="abstract-schema-name"
- type="javaee:java-identifierType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The abstract-schema-name element specifies the name
- of the abstract schema type of an entity bean with
- cmp-version 2.x. It is used in EJB QL queries.
-
- For example, the abstract-schema-name for an entity
- bean whose local interface is
- com.acme.commerce.Order might be Order.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-field"
- type="javaee:cmp-fieldType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="primkey-field"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The primkey-field element is used to specify the
- name of the primary key field for an entity with
- container-managed persistence.
-
- The primkey-field must be one of the fields declared
- in the cmp-field element, and the type of the field
- must be the same as the primary key type.
-
- The primkey-field element is not used if the primary
- key maps to multiple container-managed fields
- (i.e. the key is a compound key). In this case, the
- fields of the primary key class must be public, and
- their names must correspond to the field names of
- the entity bean class that comprise the key.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0"/>
- <xsd:element name="query"
- type="javaee:queryType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="exclude-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exclude-listType specifies one or more methods which
- the Assembler marks to be uncallable.
-
- If the method permission relation contains methods that are
- in the exclude list, the Deployer should consider those
- methods to be uncallable.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="init-methodType">
- <xsd:sequence>
- <xsd:element name="create-method"
- type="javaee:named-methodType"/>
- <xsd:element name="bean-method"
- type="javaee:named-methodType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptor-bindingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptor-bindingType element describes the binding of
- interceptor classes to beans within the ejb-jar.
- It consists of :
-
- - An optional description.
- - The name of an ejb within the ejb-jar or the wildcard value "*",
- which is used to define interceptors that are bound to all
- beans in the ejb-jar.
- - A list of interceptor classes that are bound to the contents of
- the ejb-name element or a specification of the total ordering
- over the interceptors defined for the given level and above.
- - An optional exclude-default-interceptors element. If set to true,
- specifies that default interceptors are not to be applied to
- a bean-class and/or business method.
- - An optional exclude-class-interceptors element. If set to true,
- specifies that class interceptors are not to be applied to
- a business method.
- - An optional set of method elements for describing the name/params
- of a method-level interceptor.
-
- Interceptors bound to all classes using the wildcard syntax
- "*" are default interceptors for the components in the ejb-jar.
- In addition, interceptors may be bound at the level of the bean
- class (class-level interceptors) or business methods (method-level
- interceptors ).
-
- The binding of interceptors to classes is additive. If interceptors
- are bound at the class-level and/or default-level as well as the
- method-level, both class-level and/or default-level as well as
- method-level will apply.
-
- There are four possible styles of the interceptor element syntax :
-
- 1.
- <interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- </interceptor-binding>
-
- Specifying the ejb-name as the wildcard value "*" designates
- default interceptors (interceptors that apply to all session and
- message-driven beans contained in the ejb-jar).
-
- 2.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- </interceptor-binding>
-
- This style is used to refer to interceptors associated with the
- specified enterprise bean(class-level interceptors).
-
- 3.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- <method>
- <method-name>METHOD</method-name>
- </method>
- </interceptor-binding>
-
- This style is used to associate a method-level interceptor with
- the specified enterprise bean. If there are multiple methods
- with the same overloaded name, the element of this style refers
- to all the methods with the overloaded name. Method-level
- interceptors can only be associated with business methods of the
- bean class. Note that the wildcard value "*" cannot be used
- to specify method-level interceptors.
-
- 4.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- <method>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-N</method-param>
- </method-params>
- </method>
- </interceptor-binding>
-
- This style is used to associate a method-level interceptor with
- the specified method of the specified enterprise bean. This
- style is used to refer to a single method within a set of methods
- with an overloaded name. The values PARAM-1 through PARAM-N
- are the fully-qualified Java types of the method's input parameters
- (if the method has no input arguments, the method-params element
- contains no method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of square
- brackets (e.g. int[][]).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:string"/>
- <xsd:choice>
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-order"
- type="javaee:interceptor-orderType"
- minOccurs="1"/>
- </xsd:choice>
- <xsd:element name="exclude-default-interceptors"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="exclude-class-interceptors"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptor-orderType">
- <xsd:annotation>
- <xsd:documentation>
- The interceptor-orderType element describes a total ordering
- of interceptor classes.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"
- minOccurs="1"
- maxOccurs="unbounded"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptorType element declares information about a single
- interceptor class. It consists of :
-
- - An optional description.
- - The fully-qualified name of the interceptor class.
- - An optional list of around invoke methods declared on the
- interceptor class and/or its super-classes.
- - An optional list environment dependencies for the interceptor
- class and/or its super-classes.
- - An optional list of post-activate methods declared on the
- interceptor class and/or its super-classes.
- - An optional list of pre-passivate methods declared on the
- interceptor class and/or its super-classes.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="post-activate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-passivate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptorsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptorsType element declares one or more interceptor
- classes used by components within this ejb-jar. The declaration
- consists of :
-
- - An optional description.
- - One or more interceptor elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor"
- type="javaee:interceptorType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-driven-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-driven element declares a message-driven
- bean. The declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name.
- - a name assigned to the enterprise bean in
- the deployment descriptor
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of destination from which this message-driven bean
- should consume. This element is not required to be supported
- by all implementations. Any use of this element is non-portable.
- - the message-driven bean's implementation class
- - an optional declaration of the bean's messaging
- type
- - an optional declaration of the bean's timeout method.
- - the optional message-driven bean's transaction management
- type. If it is not defined, it is defaulted to Container.
- - an optional declaration of the bean's
- message-destination-type
- - an optional declaration of the bean's
- message-destination-link
- - an optional declaration of the message-driven bean's
- activation configuration properties
- - an optional list of the message-driven bean class and/or
- superclass around-invoke methods.
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB
- references
- - an optional declaration of the bean's web service
- references
- - an optional declaration of the security
- identity to be used for the execution of the bean's
- methods
- - an optional declaration of the bean's
- resource manager connection factory
- references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-class element specifies the fully qualified name
- of the bean class for this ejb. It is required unless
- there is a component-defining annotation for the same
- ejb-name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="messaging-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The messaging-type element specifies the message
- listener interface of the message-driven bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="timeout-method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- <xsd:element name="transaction-type"
- type="javaee:transaction-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-type"
- type="javaee:message-destination-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-link"
- type="javaee:message-destination-linkType"
- minOccurs="0"/>
- <xsd:element name="activation-config"
- type="javaee:activation-configType"
- minOccurs="0"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-intfType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The method-intf element allows a method element to
- differentiate between the methods with the same name and
- signature that are multiply defined across the home and
- component interfaces (e.g, in both an enterprise bean's
- remote and local interfaces or in both an enterprise bean's
- home and remote interfaces, etc.); the component and web
- service endpoint interfaces, and so on. The Local applies to
- both local component interface and local business interface.
- Similarly, Remote applies to both remote component interface
- and the remote business interface.
-
- The method-intf element must be one of the following:
-
- Home
- Remote
- LocalHome
- Local
- ServiceEndpoint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Home"/>
- <xsd:enumeration value="Remote"/>
- <xsd:enumeration value="LocalHome"/>
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="ServiceEndpoint"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-nameType contains a name of an enterprise
- bean method or the asterisk (*) character. The asterisk is
- used when the element denotes all the methods of an
- enterprise bean's client view interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-paramsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-paramsType defines a list of the
- fully-qualified Java type names of the method parameters.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="method-param"
- type="javaee:java-typeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-param element contains a primitive
- or a fully-qualified Java type name of a method
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-permissionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-permissionType specifies that one or more
- security roles are allowed to invoke one or more enterprise
- bean methods. The method-permissionType consists of an
- optional description, a list of security role names or an
- indicator to state that the method is unchecked for
- authorization, and a list of method elements.
-
- The security roles used in the method-permissionType
- must be defined in the security-role elements of the
- deployment descriptor, and the methods must be methods
- defined in the enterprise bean's business, home, component
- and/or web service endpoint interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="role-name"
- type="javaee:role-nameType"
- maxOccurs="unbounded"/>
- <xsd:element name="unchecked"
- type="javaee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The unchecked element specifies that a method is
- not checked for authorization by the container
- prior to invocation of the method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The methodType is used to denote a method of an enterprise
- bean's business, home, component, and/or web service endpoint
- interface, or, in the case of a message-driven bean, the
- bean's message listener method, or a set of such
- methods. The ejb-name element must be the name of one of the
- enterprise beans declared in the deployment descriptor; the
- optional method-intf element allows to distinguish between a
- method with the same signature that is multiply defined
- across the business, home, component, and/or web service
- endpoint nterfaces; the method-name element specifies the
- method name; and the optional method-params elements identify
- a single method among multiple methods with an overloaded
- method name.
-
- There are three possible styles of using methodType element
- within a method element:
-
- 1.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>*</method-name>
- </method>
-
- This style is used to refer to all the methods of the
- specified enterprise bean's business, home, component,
- and/or web service endpoint interfaces.
-
- 2.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- </method>
-
- This style is used to refer to the specified method of
- the specified enterprise bean. If there are multiple
- methods with the same overloaded name, the element of
- this style refers to all the methods with the overloaded
- name.
-
- 3.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-n</method-param>
- </method-params>
- </method>
-
- This style is used to refer to a single method within a
- set of methods with an overloaded name. PARAM-1 through
- PARAM-n are the fully-qualified Java types of the
- method's input parameters (if the method has no input
- arguments, the method-params element contains no
- method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of
- square brackets (e.g. int[][]). If there are multiple
- methods with the same overloaded name, this style refers
- to all of the overloaded methods.
-
- Examples:
-
- Style 1: The following method element refers to all the
- methods of the EmployeeService bean's business, home,
- component, and/or web service endpoint interfaces:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>*</method-name>
- </method>
-
- Style 2: The following method element refers to all the
- create methods of the EmployeeService bean's home
- interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- </method>
-
- Style 3: The following method element refers to the
- create(String firstName, String LastName) method of the
- EmployeeService bean's home interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The following example illustrates a Style 3 element with
- more complex parameter types. The method
- foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
- mypackage.MyClass[][] myclaar) would be specified as:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>foobar</method-name>
- <method-params>
- <method-param>char</method-param>
- <method-param>int</method-param>
- <method-param>int[]</method-param>
- <method-param>mypackage.MyClass</method-param>
- <method-param>mypackage.MyClass[][]</method-param>
- </method-params>
- </method>
-
- The optional method-intf element can be used when it becomes
- necessary to differentiate between a method that is multiply
- defined across the enterprise bean's business, home, component,
- and/or web service endpoint interfaces with the same name and
- signature. However, if the same method is a method of both the
- local business interface, and the local component interface,
- the same attribute applies to the method for both interfaces.
- Likewise, if the same method is a method of both the remote
- business interface and the remote component interface, the same
- attribute applies to the method for both interfaces.
-
- For example, the method element
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Remote</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- can be used to differentiate the create(String, String)
- method defined in the remote interface from the
- create(String, String) method defined in the remote home
- interface, which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- and the create method that is defined in the local home
- interface which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>LocalHome</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The method-intf element can be used with all three Styles
- of the method element usage. For example, the following
- method element example could be used to refer to all the
- methods of the EmployeeService bean's remote home interface
- and the remote business interface.
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>*</method-name>
- </method>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="method-intf"
- type="javaee:method-intfType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="method-name"
- type="javaee:method-nameType"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="multiplicityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The multiplicityType describes the multiplicity of the
- role that participates in a relation.
-
- The value must be one of the two following:
-
- One
- Many
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="One"/>
- <xsd:enumeration value="Many"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-methodType">
- <xsd:sequence>
- <xsd:element name="method-name"
- type="javaee:string"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-typeType specifies an entity bean's persistence
- management type.
-
- The persistence-type element must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The query-method specifies the method for a finder or select
- query.
-
- The method-name element specifies the name of a finder or select
- method in the entity bean's implementation class.
-
- Each method-param must be defined for a query-method using the
- method-params element.
-
- It is used by the query-method element.
-
- Example:
-
- <query>
- <description>Method finds large orders</description>
- <query-method>
- <method-name>findLargeOrders</method-name>
- <method-params></method-params>
- </query-method>
- <ejb-ql>
- SELECT OBJECT(o) FROM Order o
- WHERE o.amount &gt; 1000
- </ejb-ql>
- </query>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="method-name"
- type="javaee:method-nameType"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="queryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The queryType defines a finder or select
- query. It contains
- - an optional description of the query
- - the specification of the finder or select
- method it is used by
- - an optional specification of the result type
- mapping, if the query is for a select method
- and entity objects are returned.
- - the EJB QL query string that defines the query.
-
- Queries that are expressible in EJB QL must use the ejb-ql
- element to specify the query. If a query is not expressible
- in EJB QL, the description element should be used to
- describe the semantics of the query and the ejb-ql element
- should be empty.
-
- The result-type-mapping is an optional element. It can only
- be present if the query-method specifies a select method
- that returns entity objects. The default value for the
- result-type-mapping element is "Local".
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType" minOccurs="0"/>
- <xsd:element name="query-method"
- type="javaee:query-methodType"/>
- <xsd:element name="result-type-mapping"
- type="javaee:result-type-mappingType"
- minOccurs="0"/>
- <xsd:element name="ejb-ql"
- type="javaee:xsdStringType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationship-role-sourceType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationship-role-sourceType designates the source of a
- role that participates in a relationship. A
- relationship-role-sourceType is used by
- relationship-role-source elements to uniquely identify an
- entity bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationshipsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationshipsType describes the relationships in
- which entity beans with container-managed persistence
- participate. The relationshipsType contains an optional
- description; and a list of ejb-relation elements, which
- specify the container managed relationships.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation"
- type="javaee:ejb-relationType"
- maxOccurs="unbounded">
-
- <xsd:unique name="role-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name contains the name of a
- relationship role. The name must be unique within
- a relationship, but can be reused in different
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector
- xpath=".//javaee:ejb-relationship-role-name"/>
- <xsd:field
- xpath="."/>
- </xsd:unique>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="remove-methodType">
- <xsd:sequence>
- <xsd:element name="bean-method"
- type="javaee:named-methodType"/>
- <xsd:element name="retain-if-exception"
- type="javaee:true-falseType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="result-type-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The result-type-mappingType is used in the query element to
- specify whether an abstract schema type returned by a query
- for a select method is to be mapped to an EJBLocalObject or
- EJBObject type.
-
- The value must be one of the following:
-
- Local
- Remote
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="Remote"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-identityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-identityType specifies whether the caller's
- security identity is to be used for the execution of the
- methods of the enterprise bean or whether a specific run-as
- identity is to be used. It contains an optional description
- and a specification of the security identity to be used.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="use-caller-identity"
- type="javaee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The use-caller-identity element specifies that
- the caller's security identity be used as the
- security identity for the execution of the
- enterprise bean's methods.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="run-as"
- type="javaee:run-asType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-beanType declares an session bean. The
- declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a name assigned to the enterprise bean
- in the deployment description
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of the session bean's remote home/business interface.
- This element is not required to be supported by all
- implementations. Any use of this element is non-portable.
- - the names of all the remote or local business interfaces,
- if any
- - the names of the session bean's remote home and
- remote interfaces, if any
- - the names of the session bean's local home and
- local interfaces, if any
- - the name of the session bean's web service endpoint
- interface, if any
- - the session bean's implementation class
- - the session bean's state management type
- - an optional declaration of the session bean's timeout method.
- - the optional session bean's transaction management type.
- If it is not present, it is defaulted to Container.
- - an optional list of the session bean class and/or
- superclass around-invoke methods.
- - an optional declaration of the bean's
- environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's resource
- manager connection factory references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- The elements that are optional are "optional" in the sense
- that they are omitted when if lists represented by them are
- empty.
-
- Either both the local-home and the local elements or both
- the home and the remote elements must be specified for the
- session bean.
-
- The service-endpoint element may only be specified if the
- bean is a stateless session bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="business-local"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="business-remote"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="service-endpoint"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint element contains the
- fully-qualified name of the enterprise bean's web
- service endpoint interface. The service-endpoint
- element may only be specified for a stateless
- session bean. The specified interface must be a
- valid JAX-RPC service endpoint interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-class element specifies the fully qualified name
- of the bean class for this ejb. It is required unless
- there is a component-defining annotation for the same
- ejb-name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-type"
- type="javaee:session-typeType"
- minOccurs="0"/>
- <xsd:element name="timeout-method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- <xsd:element name="init-method"
- type="javaee:init-methodType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-method element specifies the mappings for
- EJB 2.x style create methods for an EJB 3.0 bean.
- This element can only be specified for stateful
- session beans.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="remove-method"
- type="javaee:remove-methodType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The remove-method element specifies the mappings for
- EJB 2.x style remove methods for an EJB 3.0 bean.
- This element can only be specified for stateful
- session beans.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="transaction-type"
- type="javaee:transaction-typeType"
- minOccurs="0"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="post-activate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-passivate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-typeType describes whether the session bean is a
- stateful session or stateless session. It is used by
- session-type elements.
-
- The value must be one of the two following:
-
- Stateful
- Stateless
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Stateful"/>
- <xsd:enumeration value="Stateless"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="trans-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The trans-attributeType specifies how the container must
- manage the transaction boundaries when delegating a method
- invocation to an enterprise bean's business method.
-
- The value must be one of the following:
-
- NotSupported
- Supports
- Required
- RequiresNew
- Mandatory
- Never
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NotSupported"/>
- <xsd:enumeration value="Supports"/>
- <xsd:enumeration value="Required"/>
- <xsd:enumeration value="RequiresNew"/>
- <xsd:enumeration value="Mandatory"/>
- <xsd:enumeration value="Never"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transaction-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transaction-typeType specifies an enterprise bean's
- transaction management type.
-
- The transaction-type must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd
deleted file mode 100644
index 8c097627a9..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd
+++ /dev/null
@@ -1,3247 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="3.1">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the EJB 3.1 deployment descriptor.
-
- All EJB deployment descriptors must indicate
- the schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
- version="3.1">
- ...
- </ejb-jar>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for the
- Java EE namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="ejb-jar"
- type="javaee:ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is the root of the ejb-jar deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:key name="ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-name element contains the name of an enterprise
- bean. The name must be unique within the ejb-jar or
- .war file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:enterprise-beans/*"/>
- <xsd:field xpath="javaee:ejb-name"/>
- </xsd:key>
- <xsd:keyref name="ejb-name-references"
- refer="javaee:ejb-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- relationship-role-source must be to a specific ejb-name
- defined within the scope of enterprise-beans element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath=".//javaee:ejb-relationship-role/javaee:relationship-role-source"/>
- <xsd:field xpath="javaee:ejb-name"/>
- </xsd:keyref>
- <xsd:key name="role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:assembly-descriptor/javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:key>
- <xsd:keyref name="role-name-references"
- refer="javaee:role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:enterprise-beans/*/javaee:security-role-ref"/>
- <xsd:field xpath="javaee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="access-timeoutType">
- <xsd:annotation>
- <xsd:documentation>
-
- The access-timeoutType represents the maximum amount of
- time (in a given time unit) that the container should wait for
- a concurrency lock before throwing a timeout exception to the
- client.
-
- A timeout value of 0 means concurrent access is not permitted.
-
- A timeout value of -1 means wait indefinitely to acquire a lock.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="timeout"
- type="javaee:xsdIntegerType"/>
- <xsd:element name="unit"
- type="javaee:time-unit-typeType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="async-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- The async-methodType element specifies that a session
- bean method has asynchronous invocation semantics.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="method-name"
- type="javaee:string"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-configType defines information about the
- expected configuration properties of the message-driven bean
- in its operational environment. This may include information
- about message acknowledgement, message selector, expected
- destination type, etc.
-
- The configuration information is expressed in terms of
- name/value configuration properties.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="activation-config-property"
- type="javaee:activation-config-propertyType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="activation-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-propertyType contains a name/value
- configuration property pair for a message-driven bean.
-
- The properties that are recognized for a particular
- message-driven bean are determined by the messaging type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="activation-config-property-name"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-name element contains
- the name for an activation configuration property of
- a message-driven bean.
-
- For JMS message-driven beans, the following property
- names are recognized: acknowledgeMode,
- messageSelector, destinationType, subscriptionDurability
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="activation-config-property-value"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The activation-config-property-value element
- contains the value for an activation configuration
- property of a message-driven bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="around-invokeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The around-invoke type specifies a method on a
- class to be called during the around invoke portion of an
- ejb invocation. Note that each class may have only one
- around invoke method and that the method may not be
- overloaded.
-
- If the class element is missing then
- the class defining the callback is assumed to be the
- interceptor class or component class in scope at the
- location in the descriptor in which the around invoke
- definition appears.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"/>
- <xsd:element name="method-name"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="around-timeoutType">
- <xsd:annotation>
- <xsd:documentation>
-
- The around-timeout type specifies a method on a
- class to be called during the around-timeout portion of
- a timer timeout callback. Note that each class may have
- only one around-timeout method and that the method may not
- be overloaded.
-
- If the class element is missing then
- the class defining the callback is assumed to be the
- interceptor class or component class in scope at the
- location in the descriptor in which the around-timeout
- definition appears.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"/>
- <xsd:element name="method-name"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="assembly-descriptorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The assembly-descriptorType defines
- application-assembly information.
-
- The application-assembly information consists of the
- following parts: the definition of security roles, the
- definition of method permissions, the definition of
- transaction attributes for enterprise beans with
- container-managed transaction demarcation, the definition
- of interceptor bindings, a list of
- methods to be excluded from being invoked, and a list of
- exception types that should be treated as application exceptions.
-
- All the parts are optional in the sense that they are
- omitted if the lists represented by them are empty.
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar or .war file producer.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="security-role"
- type="javaee:security-roleType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method-permission"
- type="javaee:method-permissionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="container-transaction"
- type="javaee:container-transactionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-binding"
- type="javaee:interceptor-bindingType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="exclude-list"
- type="javaee:exclude-listType"
- minOccurs="0"/>
- <xsd:element name="application-exception"
- type="javaee:application-exceptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-fieldType describes a container-managed field. The
- cmp-fieldType contains an optional description of the field,
- and the name of the field.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="field-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The field-name element specifies the name of a
- container managed field.
-
- The name of the cmp-field of an entity bean with
- cmp-version 2.x must begin with a lowercase
- letter. This field is accessed by methods whose
- names consists of the name of the field specified by
- field-name in which the first letter is uppercased,
- prefixed by "get" or "set".
-
- The name of the cmp-field of an entity bean with
- cmp-version 1.x must denote a public field of the
- enterprise bean class or one of its superclasses.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmp-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmp-versionType specifies the version of an entity bean
- with container-managed persistence. It is used by
- cmp-version elements.
-
- The value must be one of the two following:
-
- 1.x
- 2.x
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="1.x"/>
- <xsd:enumeration value="2.x"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-fieldType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-fieldType describes the bean provider's view of
- a relationship. It consists of an optional description, and
- the name and the class type of a field in the source of a
- role of a relationship. The cmr-field-name element
- corresponds to the name used for the get and set accessor
- methods for the relationship. The cmr-field-type element is
- used only for collection-valued cmr-fields. It specifies the
- type of the collection that is used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="cmr-field-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-name element specifies the name of a
- logical relationship field in the entity bean
- class. The name of the cmr-field must begin with a
- lowercase letter. This field is accessed by methods
- whose names consist of the name of the field
- specified by cmr-field-name in which the first
- letter is uppercased, prefixed by "get" or "set".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmr-field-type"
- type="javaee:cmr-field-typeType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cmr-field-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cmr-field-type element specifies the class of a
- collection-valued logical relationship field in the entity
- bean class. The value of an element using cmr-field-typeType
- must be either: java.util.Collection or java.util.Set.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="java.util.Collection"/>
- <xsd:enumeration value="java.util.Set"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="concurrency-management-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The concurrency-management-typeType specifies the way concurrency
- is managed for a singleton or stateful session bean.
-
- The concurrency management type must be one of the following:
-
- Bean
- Container
-
- Bean managed concurrency can only be specified for a singleton bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="concurrent-lock-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The concurrent-lock-typeType specifies how the container must
- manage concurrent access to a method of a Singleton bean
- with container-managed concurrency.
-
- The container managed concurrency lock type must be one
- of the following :
-
- Read
- Write
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Read"/>
- <xsd:enumeration value="Write"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="concurrent-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- The concurrent-methodType specifies information about a method
- of a bean with container managed concurrency.
-
- The optional lock element specifies the kind of concurrency
- lock asssociated with the method.
-
- The optional access-timeout element specifies the amount of
- time (in a given time unit) the container should wait for a
- concurrency lock before throwing an exception to the client.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="method"
- type="javaee:named-methodType"/>
- <xsd:element name="lock"
- type="javaee:concurrent-lock-typeType"
- minOccurs="0"/>
- <xsd:element name="access-timeout"
- type="javaee:access-timeoutType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="container-transactionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-transactionType specifies how the container
- must manage transaction scopes for the enterprise bean's
- method invocations. It defines an optional description, a
- list of method elements, and a transaction attribute. The
- transaction attribute is to be applied to all the specified
- methods.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- <xsd:element name="trans-attribute"
- type="javaee:trans-attributeType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="depends-onType">
- <xsd:annotation>
- <xsd:documentation>
-
- The depends-onType is used to express initialization
- ordering dependencies between Singleton components.
- The depends-onType specifies the names of one or more
- Singleton beans in the same application as the referring
- Singleton, each of which must be initialized before
- the referring bean.
-
- Each dependent bean is expressed using ejb-link syntax.
- The order in which dependent beans are initialized at
- runtime is not guaranteed to match the order in which
- they are listed.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="ejb-name"
- type="javaee:ejb-linkType"
- minOccurs="1"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The ejb-classType contains the fully-qualified name of the
- enterprise bean's class. It is used by ejb-class elements.
-
- Example:
-
- <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-jarType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-jarType defines the root element of the EJB
- deployment descriptor. It contains
-
- - an optional description of the ejb-jar file
- - an optional display name
- - an optional icon that contains a small and a large
- icon file name
- - an optional module name. Only applicable to
- stand-alone ejb-jars or ejb-jars packaged in an ear.
- Ignored if specified for an ejb-jar.xml within a .war.
- In that case, standard .war module-name rules apply.
- - structural information about all included
- enterprise beans that is not specified through
- annotations
- - structural information about interceptor classes
- - a descriptor for container managed relationships,
- if any.
- - an optional application-assembly descriptor
- - an optional name of an ejb-client-jar file for the
- ejb-jar.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="module-name"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="enterprise-beans"
- type="javaee:enterprise-beansType"
- minOccurs="0"/>
- <xsd:element name="interceptors"
- type="javaee:interceptorsType"
- minOccurs="0"/>
- <xsd:element name="relationships"
- type="javaee:relationshipsType"
- minOccurs="0">
- <xsd:unique name="relationship-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name contains the name of a
- relation. The name must be unique within
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-relation"/>
- <xsd:field xpath="javaee:ejb-relation-name"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="assembly-descriptor"
- type="javaee:assembly-descriptorType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Providing an assembly-descriptor in the deployment
- descriptor is optional for the ejb-jar or .war file
- producer.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-client-jar"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The optional ejb-client-jar element specifies a JAR
- file that contains the class files necessary for a
- client program to access the
- enterprise beans in the ejb-jar file.
-
- Example:
-
- <ejb-client-jar>employee_service_client.jar
- </ejb-client-jar>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="3.1"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The version specifies the version of the
- EJB specification that the instance document must
- comply with. This information enables deployment tools
- to validate a particular EJB Deployment
- Descriptor with respect to a specific version of the EJB
- schema.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="metadata-complete"
- type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The ejb-nameType specifies an enterprise bean's name. It is
- used by ejb-name elements. This name is assigned by the
- file producer to name the enterprise bean in the
- ejb-jar or .war file's deployment descriptor. The name must be
- unique among the names of the enterprise beans in the same
- ejb-jar or .war file.
-
- There is no architected relationship between the used
- ejb-name in the deployment descriptor and the JNDI name that
- the Deployer will assign to the enterprise bean's home.
-
- The name for an entity bean must conform to the lexical
- rules for an NMTOKEN.
-
- Example:
-
- <ejb-name>EmployeeService</ejb-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdNMTOKENType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationType describes a relationship between two
- entity beans with container-managed persistence. It is used
- by ejb-relation elements. It contains a description; an
- optional ejb-relation-name element; and exactly two
- relationship role declarations, defined by the
- ejb-relationship-role elements. The name of the
- relationship, if specified, is unique within the ejb-jar
- file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relation-name element provides a unique name
- within the ejb-jar file for a relationship.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-relationship-role"
- type="javaee:ejb-relationship-roleType"/>
- <xsd:element name="ejb-relationship-role"
- type="javaee:ejb-relationship-roleType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-relationship-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The ejb-relationship-roleType describes a role within a
- relationship. There are two roles in each relationship.
-
- The ejb-relationship-roleType contains an optional
- description; an optional name for the relationship role; a
- specification of the multiplicity of the role; an optional
- specification of cascade-delete functionality for the role;
- the role source; and a declaration of the cmr-field, if any,
- by means of which the other side of the relationship is
- accessed from the perspective of the role source.
-
- The multiplicity and role-source element are mandatory.
-
- The relationship-role-source element designates an entity
- bean by means of an ejb-name element. For bidirectional
- relationships, both roles of a relationship must declare a
- relationship-role-source element that specifies a cmr-field
- in terms of which the relationship is accessed. The lack of
- a cmr-field element in an ejb-relationship-role specifies
- that the relationship is unidirectional in navigability and
- the entity bean that participates in the relationship is
- "not aware" of the relationship.
-
- Example:
-
- <ejb-relation>
- <ejb-relation-name>Product-LineItem</ejb-relation-name>
- <ejb-relationship-role>
- <ejb-relationship-role-name>product-has-lineitems
- </ejb-relationship-role-name>
- <multiplicity>One</multiplicity>
- <relationship-role-source>
- <ejb-name>ProductEJB</ejb-name>
- </relationship-role-source>
- </ejb-relationship-role>
- </ejb-relation>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relationship-role-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name element defines a
- name for a role that is unique within an
- ejb-relation. Different relationships can use the
- same name for a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="multiplicity"
- type="javaee:multiplicityType"/>
- <xsd:element name="cascade-delete"
- type="javaee:emptyType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The cascade-delete element specifies that, within a
- particular relationship, the lifetime of one or more
- entity beans is dependent upon the lifetime of
- another entity bean. The cascade-delete element can
- only be specified for an ejb-relationship-role
- element contained in an ejb-relation element in
- which the other ejb-relationship-role
- element specifies a multiplicity of One.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="relationship-role-source"
- type="javaee:relationship-role-sourceType"/>
- <xsd:element name="cmr-field"
- type="javaee:cmr-fieldType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="enterprise-beansType">
- <xsd:annotation>
- <xsd:documentation>
-
- The enterprise-beansType declares one or more enterprise
- beans. Each bean can be a session, entity or message-driven
- bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="session"
- type="javaee:session-beanType">
- <xsd:unique name="session-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="session-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="session-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="session-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- <xsd:unique name="session-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="session-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="entity"
- type="javaee:entity-beanType">
- <xsd:unique name="entity-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="entity-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="entity-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="entity-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- <xsd:unique name="entity-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="entity-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
- <xsd:element name="message-driven"
- type="javaee:message-driven-beanType">
- <xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of
- an EJB reference. The EJB reference is an entry in
- the component's environment and is relative to the
- java:comp/env context. The name must be unique within
- the component.
-
- It is recommended that name be prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="messaged-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- component's environment and is relative to the
- java:comp/env context. The name must be unique
- within the component.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="messaged-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="messaged-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name
- of a message destination reference; its value is
- the message destination reference name used in the component
- code. The name is a JNDI name relative to the
- java:comp/env context and must be unique within an
- component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- <xsd:unique name="messaged-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="messaged-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a
- component's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The
- name must be unique within an component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- </xsd:element>
- </xsd:choice>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-beanType declares an entity bean. The declaration
- consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a unique name assigned to the enterprise bean
- in the deployment descriptor
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of the entity bean's remote home interface. This
- element is not required to be supported by all implementations.
- Any use of this element is non-portable.
- - the names of the entity bean's remote home
- and remote interfaces, if any
- - the names of the entity bean's local home and local
- interfaces, if any
- - the entity bean's implementation class
- - the optional entity bean's persistence management type. If
- this element is not specified it is defaulted to Container.
- - the entity bean's primary key class name
- - an indication of the entity bean's reentrancy
- - an optional specification of the
- entity bean's cmp-version
- - an optional specification of the entity bean's
- abstract schema name
- - an optional list of container-managed fields
- - an optional specification of the primary key
- field
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB
- references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's
- resource manager connection factory references
- - an optional declaration of the bean's
- resource environment references
- - an optional declaration of the bean's message
- destination references
- - an optional set of query declarations
- for finder and select methods for an entity
- bean with cmp-version 2.x.
-
- The optional abstract-schema-name element must be specified
- for an entity bean with container-managed persistence and
- cmp-version 2.x.
-
- The optional primkey-field may be present in the descriptor
- if the entity's persistence-type is Container.
-
- The optional cmp-version element may be present in the
- descriptor if the entity's persistence-type is Container. If
- the persistence-type is Container and the cmp-version
- element is not specified, its value defaults to 2.x.
-
- The optional home and remote elements must be specified if
- the entity bean cmp-version is 1.x.
-
- The optional home and remote elements must be specified if
- the entity bean has a remote home and remote interface.
-
- The optional local-home and local elements must be specified
- if the entity bean has a local home and local interface.
-
- Either both the local-home and the local elements or both
- the home and the remote elements must be specified.
-
- The optional query elements must be present if the
- persistence-type is Container and the cmp-version is 2.x and
- query methods other than findByPrimaryKey have been defined
- for the entity bean.
-
- The other elements that are optional are "optional" in the
- sense that they are omitted if the lists represented by them
- are empty.
-
- At least one cmp-field element must be present in the
- descriptor if the entity's persistence-type is Container and
- the cmp-version is 1.x, and none must not be present if the
- entity's persistence-type is Bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"/>
- <xsd:element name="persistence-type"
- type="javaee:persistence-typeType"/>
- <xsd:element name="prim-key-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The prim-key-class element contains the
- fully-qualified name of an
- entity bean's primary key class.
-
- If the definition of the primary key class is
- deferred to deployment time, the prim-key-class
- element should specify java.lang.Object.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reentrant"
- type="javaee:true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The reentrant element specifies whether an entity
- bean is reentrant or not.
-
- The reentrant element must be one of the two
- following: true or false
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-version"
- type="javaee:cmp-versionType"
- minOccurs="0"/>
- <xsd:element name="abstract-schema-name"
- type="javaee:java-identifierType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The abstract-schema-name element specifies the name
- of the abstract schema type of an entity bean with
- cmp-version 2.x. It is used in EJB QL queries.
-
- For example, the abstract-schema-name for an entity
- bean whose local interface is
- com.acme.commerce.Order might be Order.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cmp-field"
- type="javaee:cmp-fieldType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="primkey-field"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The primkey-field element is used to specify the
- name of the primary key field for an entity with
- container-managed persistence.
-
- The primkey-field must be one of the fields declared
- in the cmp-field element, and the type of the field
- must be the same as the primary key type.
-
- The primkey-field element is not used if the primary
- key maps to multiple container-managed fields
- (i.e. the key is a compound key). In this case, the
- fields of the primary key class must be public, and
- their names must correspond to the field names of
- the entity bean class that comprise the key.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0"/>
- <xsd:element name="query"
- type="javaee:queryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="exclude-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exclude-listType specifies one or more methods which
- the Assembler marks to be uncallable.
-
- If the method permission relation contains methods that are
- in the exclude list, the Deployer should consider those
- methods to be uncallable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="application-exceptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The application-exceptionType declares an application
- exception. The declaration consists of:
-
- - the exception class. When the container receives
- an exception of this type, it is required to
- forward this exception as an applcation exception
- to the client regardless of whether it is a checked
- or unchecked exception.
- - an optional rollback element. If this element is
- set to true, the container must rollback the current
- transaction before forwarding the exception to the
- client. If not specified, it defaults to false.
- - an optional inherited element. If this element is
- set to true, subclasses of the exception class type
- are also automatically considered application
- exceptions (unless overriden at a lower level).
- If set to false, only the exception class type is
- considered an application-exception, not its
- exception subclasses. If not specified, this
- value defaults to true.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exception-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="rollback"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="inherited"
- type="javaee:true-falseType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptorsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptorsType element declares one or more interceptor
- classes used by components within this ejb-jar or .war. The declaration
- consists of :
-
- - An optional description.
- - One or more interceptor elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor"
- type="javaee:interceptorType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptorType element declares information about a single
- interceptor class. It consists of :
-
- - An optional description.
- - The fully-qualified name of the interceptor class.
- - An optional list of around invoke methods declared on the
- interceptor class and/or its super-classes.
- - An optional list of around timeout methods declared on the
- interceptor class and/or its super-classes.
- - An optional list environment dependencies for the interceptor
- class and/or its super-classes.
- - An optional list of post-activate methods declared on the
- interceptor class and/or its super-classes.
- - An optional list of pre-passivate methods declared on the
- interceptor class and/or its super-classes.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="around-timeout"
- type="javaee:around-timeoutType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="post-activate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-passivate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptor-bindingType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The interceptor-bindingType element describes the binding of
- interceptor classes to beans within the ejb-jar or .war.
- It consists of :
-
- - An optional description.
- - The name of an ejb within the module or the wildcard value "*",
- which is used to define interceptors that are bound to all
- beans in the ejb-jar or .war.
- - A list of interceptor classes that are bound to the contents of
- the ejb-name element or a specification of the total ordering
- over the interceptors defined for the given level and above.
- - An optional exclude-default-interceptors element. If set to true,
- specifies that default interceptors are not to be applied to
- a bean-class and/or business method.
- - An optional exclude-class-interceptors element. If set to true,
- specifies that class interceptors are not to be applied to
- a business method.
- - An optional set of method elements for describing the name/params
- of a method-level interceptor.
-
- Interceptors bound to all classes using the wildcard syntax
- "*" are default interceptors for the components in the ejb-jar or .war.
- In addition, interceptors may be bound at the level of the bean
- class (class-level interceptors) or business methods (method-level
- interceptors ).
-
- The binding of interceptors to classes is additive. If interceptors
- are bound at the class-level and/or default-level as well as the
- method-level, both class-level and/or default-level as well as
- method-level will apply.
-
- There are four possible styles of the interceptor element syntax :
-
- 1.
- <interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- </interceptor-binding>
-
- Specifying the ejb-name as the wildcard value "*" designates
- default interceptors (interceptors that apply to all session and
- message-driven beans contained in the ejb-jar or .war).
-
- 2.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- </interceptor-binding>
-
- This style is used to refer to interceptors associated with the
- specified enterprise bean(class-level interceptors).
-
- 3.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- <method>
- <method-name>METHOD</method-name>
- </method>
- </interceptor-binding>
-
- This style is used to associate a method-level interceptor with
- the specified enterprise bean. If there are multiple methods
- with the same overloaded name, the element of this style refers
- to all the methods with the overloaded name. Method-level
- interceptors can only be associated with business methods of the
- bean class. Note that the wildcard value "*" cannot be used
- to specify method-level interceptors.
-
- 4.
- <interceptor-binding>
- <ejb-name>EJBNAME</ejb-name>
- <interceptor-class>INTERCEPTOR</interceptor-class>
- <method>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-N</method-param>
- </method-params>
- </method>
- </interceptor-binding>
-
- This style is used to associate a method-level interceptor with
- the specified method of the specified enterprise bean. This
- style is used to refer to a single method within a set of methods
- with an overloaded name. The values PARAM-1 through PARAM-N
- are the fully-qualified Java types of the method's input parameters
- (if the method has no input arguments, the method-params element
- contains no method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of square
- brackets (e.g. int[][]).
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:string"/>
- <xsd:choice>
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="interceptor-order"
- type="javaee:interceptor-orderType"
- minOccurs="1"/>
- </xsd:choice>
- <xsd:element name="exclude-default-interceptors"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="exclude-class-interceptors"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="interceptor-orderType">
- <xsd:annotation>
- <xsd:documentation>
-
- The interceptor-orderType element describes a total ordering
- of interceptor classes.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="interceptor-class"
- type="javaee:fully-qualified-classType"
- minOccurs="1"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-methodType">
- <xsd:sequence>
- <xsd:element name="method-name"
- type="javaee:string"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="init-methodType">
- <xsd:sequence>
- <xsd:element name="create-method"
- type="javaee:named-methodType"/>
- <xsd:element name="bean-method"
- type="javaee:named-methodType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="remove-methodType">
- <xsd:sequence>
- <xsd:element name="bean-method"
- type="javaee:named-methodType"/>
- <xsd:element name="retain-if-exception"
- type="javaee:true-falseType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-driven-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-driven element declares a message-driven
- bean. The declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name.
- - a name assigned to the enterprise bean in
- the deployment descriptor
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of destination from which this message-driven bean
- should consume. This element is not required to be supported
- by all implementations. Any use of this element is non-portable.
- - the message-driven bean's implementation class
- - an optional declaration of the bean's messaging
- type
- - an optional declaration of the bean's timeout method for
- handling programmatically created timers
- - an optional declaration of timers to be automatically created at
- deployment time
- - the optional message-driven bean's transaction management
- type. If it is not defined, it is defaulted to Container.
- - an optional declaration of the bean's
- message-destination-type
- - an optional declaration of the bean's
- message-destination-link
- - an optional declaration of the message-driven bean's
- activation configuration properties
- - an optional list of the message-driven bean class and/or
- superclass around-invoke methods.
- - an optional list of the message-driven bean class and/or
- superclass around-timeout methods.
- - an optional declaration of the bean's environment
- entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local EJB
- references
- - an optional declaration of the bean's web service
- references
- - an optional declaration of the security role
- references
- - an optional declaration of the security
- identity to be used for the execution of the bean's
- methods
- - an optional declaration of the bean's
- resource manager connection factory
- references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-class element specifies the fully qualified name
- of the bean class for this ejb. It is required unless
- there is a component-defining annotation for the same
- ejb-name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="messaging-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The messaging-type element specifies the message
- listener interface of the message-driven bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="timeout-method"
- type="javaee:named-methodType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The timeout-method element specifies the method that
- will receive callbacks for programmatically
- created timers.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="timer"
- type="javaee:timerType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="transaction-type"
- type="javaee:transaction-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-type"
- type="javaee:message-destination-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-link"
- type="javaee:message-destination-linkType"
- minOccurs="0"/>
- <xsd:element name="activation-config"
- type="javaee:activation-configType"
- minOccurs="0"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="around-timeout"
- type="javaee:around-timeoutType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The methodType is used to denote a method of an enterprise
- bean's business, home, component, and/or web service endpoint
- interface, or, in the case of a message-driven bean, the
- bean's message listener method, or a set of such
- methods. The ejb-name element must be the name of one of the
- enterprise beans declared in the deployment descriptor; the
- optional method-intf element allows to distinguish between a
- method with the same signature that is multiply defined
- across the business, home, component, and/or web service
- endpoint nterfaces; the method-name element specifies the
- method name; and the optional method-params elements identify
- a single method among multiple methods with an overloaded
- method name.
-
- There are three possible styles of using methodType element
- within a method element:
-
- 1.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>*</method-name>
- </method>
-
- This style is used to refer to all the methods of the
- specified enterprise bean's business, home, component,
- and/or web service endpoint interfaces.
-
- 2.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- </method>
-
- This style is used to refer to the specified method of
- the specified enterprise bean. If there are multiple
- methods with the same overloaded name, the element of
- this style refers to all the methods with the overloaded
- name.
-
- 3.
- <method>
- <ejb-name>EJBNAME</ejb-name>
- <method-name>METHOD</method-name>
- <method-params>
- <method-param>PARAM-1</method-param>
- <method-param>PARAM-2</method-param>
- ...
- <method-param>PARAM-n</method-param>
- </method-params>
- </method>
-
- This style is used to refer to a single method within a
- set of methods with an overloaded name. PARAM-1 through
- PARAM-n are the fully-qualified Java types of the
- method's input parameters (if the method has no input
- arguments, the method-params element contains no
- method-param elements). Arrays are specified by the
- array element's type, followed by one or more pair of
- square brackets (e.g. int[][]). If there are multiple
- methods with the same overloaded name, this style refers
- to all of the overloaded methods.
-
- Examples:
-
- Style 1: The following method element refers to all the
- methods of the EmployeeService bean's business, home,
- component, and/or web service endpoint interfaces:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>*</method-name>
- </method>
-
- Style 2: The following method element refers to all the
- create methods of the EmployeeService bean's home
- interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- </method>
-
- Style 3: The following method element refers to the
- create(String firstName, String LastName) method of the
- EmployeeService bean's home interface(s).
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The following example illustrates a Style 3 element with
- more complex parameter types. The method
- foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
- mypackage.MyClass[][] myclaar) would be specified as:
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-name>foobar</method-name>
- <method-params>
- <method-param>char</method-param>
- <method-param>int</method-param>
- <method-param>int[]</method-param>
- <method-param>mypackage.MyClass</method-param>
- <method-param>mypackage.MyClass[][]</method-param>
- </method-params>
- </method>
-
- The optional method-intf element can be used when it becomes
- necessary to differentiate between a method that is multiply
- defined across the enterprise bean's business, home, component,
- and/or web service endpoint interfaces with the same name and
- signature. However, if the same method is a method of both the
- local business interface, and the local component interface,
- the same attribute applies to the method for both interfaces.
- Likewise, if the same method is a method of both the remote
- business interface and the remote component interface, the same
- attribute applies to the method for both interfaces.
-
- For example, the method element
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Remote</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- can be used to differentiate the create(String, String)
- method defined in the remote interface from the
- create(String, String) method defined in the remote home
- interface, which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- and the create method that is defined in the local home
- interface which would be defined as
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>LocalHome</method-intf>
- <method-name>create</method-name>
- <method-params>
- <method-param>java.lang.String</method-param>
- <method-param>java.lang.String</method-param>
- </method-params>
- </method>
-
- The method-intf element can be used with all three Styles
- of the method element usage. For example, the following
- method element example could be used to refer to all the
- methods of the EmployeeService bean's remote home interface
- and the remote business interface.
-
- <method>
- <ejb-name>EmployeeService</ejb-name>
- <method-intf>Home</method-intf>
- <method-name>*</method-name>
- </method>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="method-intf"
- type="javaee:method-intfType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="method-name"
- type="javaee:method-nameType"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-intfType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-intf element allows a method element to
- differentiate between the methods with the same name and
- signature that are multiply defined across the home and
- component interfaces (e.g, in both an enterprise bean's
- remote and local interfaces or in both an enterprise bean's
- home and remote interfaces, etc.); the component and web
- service endpoint interfaces, and so on.
-
- Local applies to the local component interface, local business
- interfaces, and the no-interface view.
-
- Remote applies to both remote component interface and the remote
- business interfaces.
-
- ServiceEndpoint refers to methods exposed through a web service
- endpoint.
-
- Timer refers to the bean's timeout callback methods.
-
- MessageEndpoint refers to the methods of a message-driven bean's
- message-listener interface.
-
- The method-intf element must be one of the following:
-
- Home
- Remote
- LocalHome
- Local
- ServiceEndpoint
- Timer
- MessageEndpoint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Home"/>
- <xsd:enumeration value="Remote"/>
- <xsd:enumeration value="LocalHome"/>
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="ServiceEndpoint"/>
- <xsd:enumeration value="Timer"/>
- <xsd:enumeration value="MessageEndpoint"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-nameType contains a name of an enterprise
- bean method or the asterisk (*) character. The asterisk is
- used when the element denotes all the methods of an
- enterprise bean's client view interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-paramsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-paramsType defines a list of the
- fully-qualified Java type names of the method parameters.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="method-param"
- type="javaee:java-typeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-param element contains a primitive
- or a fully-qualified Java type name of a method
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-permissionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-permissionType specifies that one or more
- security roles are allowed to invoke one or more enterprise
- bean methods. The method-permissionType consists of an
- optional description, a list of security role names or an
- indicator to state that the method is unchecked for
- authorization, and a list of method elements.
-
- The security roles used in the method-permissionType
- must be defined in the security-role elements of the
- deployment descriptor, and the methods must be methods
- defined in the enterprise bean's business, home, component
- and/or web service endpoint interfaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="role-name"
- type="javaee:role-nameType"
- maxOccurs="unbounded"/>
- <xsd:element name="unchecked"
- type="javaee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The unchecked element specifies that a method is
- not checked for authorization by the container
- prior to invocation of the method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="method"
- type="javaee:methodType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="multiplicityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The multiplicityType describes the multiplicity of the
- role that participates in a relation.
-
- The value must be one of the two following:
-
- One
- Many
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="One"/>
- <xsd:enumeration value="Many"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-typeType specifies an entity bean's persistence
- management type.
-
- The persistence-type element must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="queryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The queryType defines a finder or select
- query. It contains
- - an optional description of the query
- - the specification of the finder or select
- method it is used by
- - an optional specification of the result type
- mapping, if the query is for a select method
- and entity objects are returned.
- - the EJB QL query string that defines the query.
-
- Queries that are expressible in EJB QL must use the ejb-ql
- element to specify the query. If a query is not expressible
- in EJB QL, the description element should be used to
- describe the semantics of the query and the ejb-ql element
- should be empty.
-
- The result-type-mapping is an optional element. It can only
- be present if the query-method specifies a select method
- that returns entity objects. The default value for the
- result-type-mapping element is "Local".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"/>
- <xsd:element name="query-method"
- type="javaee:query-methodType"/>
- <xsd:element name="result-type-mapping"
- type="javaee:result-type-mappingType"
- minOccurs="0"/>
- <xsd:element name="ejb-ql"
- type="javaee:xsdStringType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-methodType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The query-method specifies the method for a finder or select
- query.
-
- The method-name element specifies the name of a finder or select
- method in the entity bean's implementation class.
-
- Each method-param must be defined for a query-method using the
- method-params element.
-
- It is used by the query-method element.
-
- Example:
-
- <query>
- <description>Method finds large orders</description>
- <query-method>
- <method-name>findLargeOrders</method-name>
- <method-params></method-params>
- </query-method>
- <ejb-ql>
- SELECT OBJECT(o) FROM Order o
- WHERE o.amount &gt; 1000
- </ejb-ql>
- </query>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="method-name"
- type="javaee:method-nameType"/>
- <xsd:element name="method-params"
- type="javaee:method-paramsType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationship-role-sourceType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationship-role-sourceType designates the source of a
- role that participates in a relationship. A
- relationship-role-sourceType is used by
- relationship-role-source elements to uniquely identify an
- entity bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="relationshipsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The relationshipsType describes the relationships in
- which entity beans with container-managed persistence
- participate. The relationshipsType contains an optional
- description; and a list of ejb-relation elements, which
- specify the container managed relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-relation"
- type="javaee:ejb-relationType"
- maxOccurs="unbounded">
- <xsd:unique name="role-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-relationship-role-name contains the name of a
- relationship role. The name must be unique within
- a relationship, but can be reused in different
- relationships.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath=".//javaee:ejb-relationship-role-name"/>
- <xsd:field xpath="."/>
- </xsd:unique>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="result-type-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The result-type-mappingType is used in the query element to
- specify whether an abstract schema type returned by a query
- for a select method is to be mapped to an EJBLocalObject or
- EJBObject type.
-
- The value must be one of the following:
-
- Local
- Remote
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Local"/>
- <xsd:enumeration value="Remote"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-identityType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-identityType specifies whether the caller's
- security identity is to be used for the execution of the
- methods of the enterprise bean or whether a specific run-as
- identity is to be used. It contains an optional description
- and a specification of the security identity to be used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="use-caller-identity"
- type="javaee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The use-caller-identity element specifies that
- the caller's security identity be used as the
- security identity for the execution of the
- enterprise bean's methods.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="run-as"
- type="javaee:run-asType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-beanType declares an session bean. The
- declaration consists of:
-
- - an optional description
- - an optional display name
- - an optional icon element that contains a small and a large
- icon file name
- - a name assigned to the enterprise bean
- in the deployment description
- - an optional mapped-name element that can be used to provide
- vendor-specific deployment information such as the physical
- jndi-name of the session bean's remote home/business interface.
- This element is not required to be supported by all
- implementations. Any use of this element is non-portable.
- - the names of all the remote or local business interfaces,
- if any
- - the names of the session bean's remote home and
- remote interfaces, if any
- - the names of the session bean's local home and
- local interfaces, if any
- - an optional declaration that this bean exposes a
- no-interface view
- - the name of the session bean's web service endpoint
- interface, if any
- - the session bean's implementation class
- - the session bean's state management type
- - an optional declaration of a stateful session bean's timeout value
- - an optional declaration of the session bean's timeout method for
- handling programmatically created timers
- - an optional declaration of timers to be automatically created at
- deployment time
- - an optional declaration that a Singleton bean has eager
- initialization
- - an optional declaration of a Singleton/Stateful bean's concurrency
- management type
- - an optional declaration of the method locking metadata
- for a Singleton with container managed concurrency
- - an optional declaration of the other Singleton beans in the
- application that must be initialized before this bean
- - an optional declaration of the session bean's asynchronous
- methods
- - the optional session bean's transaction management type.
- If it is not present, it is defaulted to Container.
- - an optional declaration of a stateful session bean's
- afterBegin, beforeCompletion, and/or afterCompletion methods
- - an optional list of the session bean class and/or
- superclass around-invoke methods.
- - an optional list of the session bean class and/or
- superclass around-timeout methods.
- - an optional declaration of the bean's
- environment entries
- - an optional declaration of the bean's EJB references
- - an optional declaration of the bean's local
- EJB references
- - an optional declaration of the bean's web
- service references
- - an optional declaration of the security role
- references
- - an optional declaration of the security identity
- to be used for the execution of the bean's methods
- - an optional declaration of the bean's resource
- manager connection factory references
- - an optional declaration of the bean's resource
- environment references.
- - an optional declaration of the bean's message
- destination references
-
- The elements that are optional are "optional" in the sense
- that they are omitted when if lists represented by them are
- empty.
-
- The service-endpoint element may only be specified if the
- bean is a stateless session bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="ejb-name"
- type="javaee:ejb-nameType"/>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="business-local"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="business-remote"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="local-bean"
- type="javaee:emptyType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The local-bean element declares that this
- session bean exposes a no-interface Local client view.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-endpoint"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint element contains the
- fully-qualified name of the enterprise bean's web
- service endpoint interface. The service-endpoint
- element may only be specified for a stateless
- session bean. The specified interface must be a
- valid JAX-RPC service endpoint interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ejb-class"
- type="javaee:ejb-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-class element specifies the fully qualified name
- of the bean class for this ejb. It is required unless
- there is a component-defining annotation for the same
- ejb-name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-type"
- type="javaee:session-typeType"
- minOccurs="0"/>
- <xsd:element name="stateful-timeout"
- type="javaee:stateful-timeoutType"
- minOccurs="0"/>
- <xsd:element name="timeout-method"
- type="javaee:named-methodType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The timeout-method element specifies the method that
- will receive callbacks for programmatically
- created timers.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="timer"
- type="javaee:timerType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="init-on-startup"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-on-startup element specifies that a Singleton
- bean has eager initialization.
- This element can only be specified for singleton session
- beans.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="concurrency-management-type"
- type="javaee:concurrency-management-typeType"
- minOccurs="0"/>
- <xsd:element name="concurrent-method"
- type="javaee:concurrent-methodType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="depends-on"
- type="javaee:depends-onType"
- minOccurs="0"/>
- <xsd:element name="init-method"
- type="javaee:init-methodType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-method element specifies the mappings for
- EJB 2.x style create methods for an EJB 3.x bean.
- This element can only be specified for stateful
- session beans.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="remove-method"
- type="javaee:remove-methodType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The remove-method element specifies the mappings for
- EJB 2.x style remove methods for an EJB 3.x bean.
- This element can only be specified for stateful
- session beans.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="async-method"
- type="javaee:async-methodType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="transaction-type"
- type="javaee:transaction-typeType"
- minOccurs="0"/>
- <xsd:element name="after-begin-method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- <xsd:element name="before-completion-method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- <xsd:element name="after-completion-method"
- type="javaee:named-methodType"
- minOccurs="0"/>
- <xsd:element name="around-invoke"
- type="javaee:around-invokeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="around-timeout"
- type="javaee:around-timeoutType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="post-activate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-passivate"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="security-identity"
- type="javaee:security-identityType"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-typeType describes whether the session bean is a
- singleton, stateful or stateless session. It is used by
- session-type elements.
-
- The value must be one of the three following:
-
- Singleton
- Stateful
- Stateless
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Singleton"/>
- <xsd:enumeration value="Stateful"/>
- <xsd:enumeration value="Stateless"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="stateful-timeoutType">
- <xsd:annotation>
- <xsd:documentation>
-
- The stateful-timeoutType represents the amount of time
- a stateful session bean can be idle(not receive any client
- invocations) before it is eligible for removal by the container.
-
- A timeout value of 0 means the bean is immediately eligible for removal.
-
- A timeout value of -1 means the bean will never be removed due to timeout.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="timeout"
- type="javaee:xsdIntegerType"/>
- <xsd:element name="unit"
- type="javaee:time-unit-typeType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="time-unit-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The time-unit-typeType represents a time duration at a given
- unit of granularity.
-
- The time unit type must be one of the following :
-
- Days
- Hours
- Minutes
- Seconds
- Milliseconds
- Microseconds
- Nanoseconds
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Days"/>
- <xsd:enumeration value="Hours"/>
- <xsd:enumeration value="Minutes"/>
- <xsd:enumeration value="Seconds"/>
- <xsd:enumeration value="Milliseconds"/>
- <xsd:enumeration value="Microseconds"/>
- <xsd:enumeration value="Nanoseconds"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="timer-scheduleType">
- <xsd:sequence>
- <xsd:element name="second"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="minute"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="hour"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="day-of-month"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="month"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="day-of-week"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="year"
- type="javaee:string"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="timerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The timerType specifies an enterprise bean timer. Each
- timer is automatically created by the container upon
- deployment. Timer callbacks occur based on the
- schedule attributes. All callbacks are made to the
- timeout-method associated with the timer.
-
- A timer can have an optional start and/or end date. If
- a start date is specified, it takes precedence over the
- associated timer schedule such that any matching
- expirations prior to the start time will not occur.
- Likewise, no matching expirations will occur after any
- end date. Start/End dates are specified using the
- XML Schema dateTime type, which follows the ISO-8601
- standard for date(and optional time-within-the-day)
- representation.
-
- An optional flag can be used to control whether
- this timer has persistent(true) delivery semantics or
- non-persistent(false) delivery semantics. If not specified,
- the value defaults to persistent(true).
-
- A time zone can optionally be associated with a timer.
- If specified, the timer's schedule is evaluated in the context
- of that time zone, regardless of the default time zone in which
- the container is executing. Time zones are specified as an
- ID string. The set of required time zone IDs is defined by
- the Zone Name(TZ) column of the public domain zoneinfo database.
-
- An optional info string can be assigned to the timer and
- retrieved at runtime through the Timer.getInfo() method.
-
- The timerType can only be specified on stateless session
- beans, singleton session beans, and message-driven beans.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="schedule"
- type="javaee:timer-scheduleType"/>
- <xsd:element name="start"
- type="xsd:dateTime"
- minOccurs="0"/>
- <xsd:element name="end"
- type="xsd:dateTime"
- minOccurs="0"/>
- <xsd:element name="timeout-method"
- type="javaee:named-methodType"/>
- <xsd:element name="persistent"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="timezone"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:element name="info"
- type="javaee:string"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="trans-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The trans-attributeType specifies how the container must
- manage the transaction boundaries when delegating a method
- invocation to an enterprise bean's business method.
-
- The value must be one of the following:
-
- NotSupported
- Supports
- Required
- RequiresNew
- Mandatory
- Never
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NotSupported"/>
- <xsd:enumeration value="Supports"/>
- <xsd:enumeration value="Required"/>
- <xsd:enumeration value="RequiresNew"/>
- <xsd:enumeration value="Mandatory"/>
- <xsd:enumeration value="Never"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transaction-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transaction-typeType specifies an enterprise bean's
- transaction management type.
-
- The transaction-type must be one of the two following:
-
- Bean
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Bean"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd
deleted file mode 100644
index e036d0ee70..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
- Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- Licensed under the Common Development and Distribution License,
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.sun.com/cddl/
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied. See the License for the specific language governing
- permissions and limitations under the License.
-
- $Id: facelet-taglib_1_0.dtd,v 1.1 2010/02/10 02:14:51 david_williams Exp $
--->
-
-<!ELEMENT facelet-taglib (library-class|(namespace,(tag|function)+))>
-<!ATTLIST facelet-taglib xmlns CDATA #FIXED "http://java.sun.com/JSF/Facelet">
-<!ELEMENT namespace (#PCDATA)>
-<!ELEMENT library-class (#PCDATA)>
-<!ELEMENT tag (tag-name,(handler-class|component|converter|validator|source))>
-<!ELEMENT tag-name (#PCDATA)>
-<!ELEMENT handler-class (#PCDATA)>
-<!ELEMENT component (component-type,renderer-type?,handler-class?)>
-<!ELEMENT component-type (#PCDATA)>
-<!ELEMENT renderer-type (#PCDATA)>
-<!ELEMENT converter (converter-id, handler-class?)>
-<!ELEMENT converter-id (#PCDATA)>
-<!ELEMENT validator (validator-id, handler-class?)>
-<!ELEMENT validator-id (#PCDATA)>
-<!ELEMENT source (#PCDATA)>
-<!ELEMENT function (function-name,function-class,function-signature)>
-<!ELEMENT function-name (#PCDATA)>
-<!ELEMENT function-class (#PCDATA)>
-<!ELEMENT function-signature (#PCDATA)>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_1_4.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_1_4.xsd
deleted file mode 100644
index 9b2334c2e3..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_1_4.xsd
+++ /dev/null
@@ -1,1608 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.4">
- <xsd:annotation>
- <xsd:documentation>
- @(#)j2ee_1_4.xsds 1.43 03/09/16
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
-<xsd:annotation>
-<xsd:documentation>
-
-The following definitions that appear in the common
-shareable schema(s) of J2EE deployment descriptors should be
-interpreted with respect to the context they are included:
-
-Deployment Component may indicate one of the following:
- j2ee application;
- application client;
- web application;
- enterprise bean;
- resource adapter;
-
-Deployment File may indicate one of the following:
- ear file;
- war file;
- jar file;
- rar file;
-
-</xsd:documentation>
-</xsd:annotation>
-
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-
- <xsd:include schemaLocation=
- "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:group name="descriptionGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained description related
- elements consistent across J2EE deployment descriptors.
-
- All elements may occur multiple times with different languages,
- to support localization of the content.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="display-name"
- type="j2ee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="icon"
- type="j2ee:iconType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The description type is used by a description element to
- provide text describing the parent element. The elements
- that use this type should include any information that the
- Deployment Component's Deployment File file producer wants
- to provide to the consumer of the Deployment Component's
- Deployment File (i.e., to the Deployer). Typically, the
- tools used by such a Deployment File consumer will display
- the description when processing the parent element that
- contains the description.
-
- The lang attribute defines the language that the
- description is provided in. The default value is "en" (English).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="j2ee:xsdStringType">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="dewey-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines a dewey decimal which is used
- to describe versions of documents.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:decimal">
- <xsd:whiteSpace value="collapse"/>
- </xsd:restriction>
-
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="display-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The display-name type contains a short name that is intended
- to be displayed by tools. It is used by display-name
- elements. The display name need not be unique.
-
- Example:
-
- ...
- <display-name xml:lang="en">Employee Self Service</display-name>
-
- The value of the xml:lang attribute is "en" (English) by default.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="j2ee:string">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-linkType is used by ejb-link
- elements in the ejb-ref or ejb-local-ref elements to specify
- that an EJB reference is linked to enterprise bean.
-
- The value of the ejb-link element must be the ejb-name of an
- enterprise bean in the same ejb-jar file or in another ejb-jar
- file in the same J2EE application unit.
-
- Alternatively, the name in the ejb-link element may be
- composed of a path name specifying the ejb-jar containing the
- referenced enterprise bean with the ejb-name of the target
- bean appended and separated from the path name by "#". The
- path name is relative to the Deployment File containing
- Deployment Component that is referencing the enterprise
- bean. This allows multiple enterprise beans with the same
- ejb-name to be uniquely identified.
-
- Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-local-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-refType is used by ejb-local-ref elements for
- the declaration of a reference to an enterprise bean's local
- home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the Deployment
- Component that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected local home and local interfaces of the
- referenced enterprise bean
- - optional ejb-link information, used to specify the
- referenced enterprise bean
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="j2ee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="j2ee:ejb-ref-typeType"/>
- <xsd:element name="local-home"
- type="j2ee:local-homeType"/>
- <xsd:element name="local"
- type="j2ee:localType"/>
- <xsd:element name="ejb-link"
- type="j2ee:ejb-linkType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- Deployment Component's environment and is relative to the
- java:comp/env context. The name must be unique within the
- Deployment Component.
-
- It is recommended that name is prefixed with "ejb/".
-
- Example:
-
- <ejb-ref-name>ejb/Payroll</ejb-ref-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:jndi-nameType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-typeType contains the expected type of the
- referenced enterprise bean.
-
- The ejb-ref-type designates a value
- that must be one of the following:
-
- Entity
- Session
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Entity"/>
- <xsd:enumeration value="Session"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-refType is used by ejb-ref elements for the
- declaration of a reference to an enterprise bean's home. The
- declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the Deployment Component that's referencing the enterprise
- bean
- - the expected type of the referenced enterprise bean
- - the expected home and remote interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the
- referenced enterprise bean
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="j2ee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="j2ee:ejb-ref-typeType"/>
-
- <xsd:element name="home"
- type="j2ee:homeType"/>
- <xsd:element name="remote"
- type="j2ee:remoteType"/>
- <xsd:element name="ejb-link"
- type="j2ee:ejb-linkType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is used to designate an empty
- element when used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entry-type-valuesType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This type contains the fully-qualified Java type of the
- environment entry value that is expected by the
- application's code.
-
- The following are the legal values of env-entry-type-valuesType:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
- Example:
-
- <env-entry-type>java.lang.Boolean</env-entry-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="java.lang.Boolean"/>
- <xsd:enumeration value="java.lang.Byte"/>
- <xsd:enumeration value="java.lang.Character"/>
- <xsd:enumeration value="java.lang.String"/>
- <xsd:enumeration value="java.lang.Short"/>
- <xsd:enumeration value="java.lang.Integer"/>
- <xsd:enumeration value="java.lang.Long"/>
- <xsd:enumeration value="java.lang.Float"/>
- <xsd:enumeration value="java.lang.Double"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entryType is used to declare an application's
- environment entry. The declaration consists of an optional
- description, the name of the environment entry, and an
- optional value. If a value is not specified, one must be
- supplied during deployment.
-
- It is used by env-entry elements.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="env-entry-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The env-entry-name element contains the name of a
- Deployment Component's environment entry. The name
- is a JNDI name relative to the java:comp/env
- context. The name must be unique within a
- Deployment Component. The uniqueness
- constraints must be defined within the declared
- context.
-
- Example:
-
- <env-entry-name>minAmount</env-entry-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="env-entry-type"
- type="j2ee:env-entry-type-valuesType"/>
-
- <xsd:element name="env-entry-value"
- type="j2ee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The env-entry-value designates the value of a
- Deployment Component's environment entry. The value
- must be a String that is valid for the
- constructor of the specified type that takes a
- single String parameter, or for java.lang.Character,
- a single character.
-
- Example:
-
- <env-entry-value>100.00</env-entry-value>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate the name of a
- Java class or interface. The name is in the form of a
- "binary name", as defined in the JLS. This is the form
- of name used in Class.forName(). Tools that need the
- canonical name (the name used in source code) will need
- to convert this binary name to the canonical name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generic-booleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines four different values which can designate
- boolean values. This includes values yes and no which are
- not designated by xsd:boolean
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="true"/>
- <xsd:enumeration value="false"/>
- <xsd:enumeration value="yes"/>
- <xsd:enumeration value="no"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="homeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The homeType defines the fully-qualified name of
- an enterprise bean's home interface.
-
- Example:
-
- <home>com.aardvark.payroll.PayrollHome</home>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="iconType">
- <xsd:annotation>
- <xsd:documentation>
-
- The icon type contains small-icon and large-icon elements
- that specify the file names for small and large GIF or
- JPEG icon images used to represent the parent element in a
- GUI tool.
-
- The xml:lang attribute defines the language that the
- icon file names are provided in. Its value is "en" (English)
- by default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="small-icon" type="j2ee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The small-icon element contains the name of a file
- containing a small (16 x 16) icon image. The file
- name is a relative path within the Deployment
- Component's Deployment File.
-
- The image may be either in the JPEG or GIF format.
- The icon can be used by tools.
-
- Example:
-
- <small-icon>employee-service-icon16x16.jpg</small-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="large-icon" type="j2ee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The large-icon element contains the name of a file
- containing a large
- (32 x 32) icon image. The file name is a relative
- path within the Deployment Component's Deployment
- File.
-
- The image may be either in the JPEG or GIF format.
- The icon can be used by tools.
-
- Example:
-
- <large-icon>employee-service-icon32x32.jpg</large-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
-
- <xsd:attribute ref="xml:lang"/>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-identifierType defines a Java identifier.
- The users of this type should further verify that
- the content does not contain Java reserved keywords.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a generic type that designates a Java primitive
- type or a fully qualified name of a Java interface/type,
- or an array of such types.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:pattern value="[^\p{Z}]*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jndi-nameType type designates a JNDI name in the
- Deployment Component's environment and is relative to the
- java:comp/env context. A JNDI name must be unique within the
- Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="jndiEnvironmentRefsGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained JNDI environment
- reference elements consistent across J2EE deployment descriptors.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="env-entry"
- type="j2ee:env-entryType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="j2ee:ejb-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-local-ref"
- type="j2ee:ejb-local-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:group ref="j2ee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="j2ee:resource-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="j2ee:resource-env-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="j2ee:message-destination-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="listenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listenerType indicates the deployment properties for a web
- application listener bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="listener-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listener-class element declares a class in the
- application must be registered as a web
- application listener bean. The value is the fully
- qualified classname of the listener class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="local-homeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The local-homeType defines the fully-qualified
- name of an enterprise bean's local home interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="localType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localType defines the fully-qualified name of an
- enterprise bean's local interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-linkType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-linkType is used to link a message
- destination reference or message-driven bean to a message
- destination.
-
- The Assembler sets the value to reflect the flow of messages
- between producers and consumers in the application.
-
- The value must be the message-destination-name of a message
- destination in the same Deployment File or in another
- Deployment File in the same J2EE application unit.
-
- Alternatively, the value may be composed of a path name
- specifying a Deployment File containing the referenced
- message destination with the message-destination-name of the
- destination appended and separated from the path name by
- "#". The path name is relative to the Deployment File
- containing Deployment Component that is referencing the
- message destination. This allows multiple message
- destinations with the same name to be uniquely identified.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destination-ref element contains a declaration
- of Deployment Component's reference to a message destination
- associated with a resource in Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the message destination reference name
- - the message destination type
- - a specification as to whether the
- destination is used for
- consuming or producing messages, or both
- - a link to the message destination
-
- Examples:
-
- <message-destination-ref>
- <message-destination-ref-name>jms/StockQueue
- </message-destination-ref-name>
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
- <message-destination-usage>Consumes
- </message-destination-usage>
- <message-destination-link>CorporateStocks
- </message-destination-link>
- </message-destination-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies
- the name of a message destination reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context and must be
- unique within an ejb-jar (for enterprise beans) or a
- Deployment File (for others).
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination-type"
- type="j2ee:message-destination-typeType"/>
- <xsd:element name="message-destination-usage"
- type="j2ee:message-destination-usageType"/>
- <xsd:element name="message-destination-link"
- type="j2ee:message-destination-linkType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-typeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destination-typeType specifies the type of
- the destination. The type is specified by the Java interface
- expected to be implemented by the destination.
-
- Example:
-
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-usageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-usageType specifies the use of the
- message destination indicated by the reference. The value
- indicates whether messages are consumed from the message
- destination, produced for the destination, or both. The
- Assembler makes use of this information in linking producers
- of a destination with its consumers.
-
- The value of the message-destination-usage element must be
- one of the following:
- Consumes
- Produces
- ConsumesProduces
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Consumes"/>
- <xsd:enumeration value="Produces"/>
- <xsd:enumeration value="ConsumesProduces"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destinationType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destinationType specifies a message
- destination. The logical destination described by this
- element is mapped to a physical destination by the Deployer.
-
- The message destination element contains:
-
- - an optional description
- - an optional display-name
- - an optional icon
- - a message destination name which must be unique
- among message destination names within the same
- Deployment File.
-
- Example:
-
- <message-destination>
- <message-destination-name>CorporateStocks
- </message-destination-name>
- </message-destination>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="message-destination-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-name element specifies a
- name for a message destination. This name must be
- unique among the names of message destinations
- within the Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="param-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is a general type that can be used to declare
- parameter/value lists.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="param-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-name element contains the name of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="param-value"
- type="j2ee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-value element contains the value of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate either a relative
- path or an absolute path starting with a "/".
-
- In elements that specify a pathname to a file within the
- same Deployment File, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the Deployment File's namespace. Absolute filenames (i.e.,
- those starting with "/") also specify names in the root of
- the Deployment File's namespace. In general, relative names
- are preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="remoteType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The remote element contains the fully-qualified name
- of the enterprise bean's remote interface.
-
- Example:
-
- <remote>com.wombat.empl.EmployeeService</remote>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-authType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-authType specifies whether the Deployment Component
- code signs on programmatically to the resource manager, or
- whether the Container will sign on to the resource manager
- on behalf of the Deployment Component. In the latter case,
- the Container uses information that is supplied by the
- Deployer.
-
- The value must be one of the two following:
-
- Application
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Application"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-sharing-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-sharing-scope type specifies whether connections
- obtained through the given resource manager connection
- factory reference can be shared. The value, if specified,
- must be one of the two following:
-
- Shareable
- Unshareable
-
- The default value is Shareable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="Shareable"/>
- <xsd:enumeration value="Unshareable"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-env-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The resource-env-refType is used to define
- resource-env-type elements. It contains a declaration of a
- Deployment Component's reference to an administered object
- associated with a resource in the Deployment Component's
- environment. It consists of an optional description, the
- resource environment reference name, and an indication of
- the resource environment reference type expected by the
- Deployment Component code.
-
- Example:
-
- <resource-env-ref>
- <resource-env-ref-name>jms/StockQueue
- </resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue
- </resource-env-ref-type>
- </resource-env-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in
- the Deployment Component code. The name is a JNDI
- name relative to the java:comp/env context and must
- be unique within a Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="resource-env-ref-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-type element specifies the type
- of a resource environment reference. It is the
- fully qualified name of a Java language class or
- interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The resource-refType contains a declaration of a
- Deployment Component's reference to an external resource. It
- consists of an optional description, the resource manager
- connection factory reference name, the indication of the
- resource manager connection factory type expected by the
- Deployment Component code, the type of authentication
- (Application or Container), and an optional specification of
- the shareability of connections obtained from the resource
- (Shareable or Unshareable).
-
- Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="res-ref-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.
- The name is a JNDI name relative to the
- java:comp/env context.
- The name must be unique within a Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="res-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-type element specifies the type of the data
- source. The type is specified by the fully qualified
- Java language class or interface
- expected to be implemented by the data source.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="res-auth"
- type="j2ee:res-authType"/>
-
- <xsd:element name="res-sharing-scope"
- type="j2ee:res-sharing-scopeType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-nameType designates the name of a security role.
-
- The name must conform to the lexical rules for a token.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="run-asType">
- <xsd:annotation>
- <xsd:documentation>
-
- The run-asType specifies the run-as identity to be
- used for the execution of a component. It contains an
- optional description, and the name of a security role.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="j2ee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-role-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-refType contains the declaration of a
- security role reference in a component's or a
- Deployment Component's code. The declaration consists of an
- optional description, the security role name used in the
- code, and an optional link to a security role. If the
- security role is not specified, the Deployer must choose an
- appropriate security role.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="j2ee:role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The value of the role-name element must be the String used
- as the parameter to the
- EJBContext.isCallerInRole(String roleName) method or the
- HttpServletRequest.isUserInRole(String role) method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="role-link"
- type="j2ee:role-nameType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-link element is a reference to a defined
- security role. The role-link element must contain
- the name of one of the security roles defined in the
- security-role elements.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The security-roleType contains the definition of a security
- role. The definition consists of an optional description of the
- security role, and the security role name.
-
- Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="j2ee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="string">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a special string datatype that is defined by J2EE as
- a base type for defining collapsed strings. When schemas
- require trailing/leading space elimination as well as
- collapsing the existing whitespace, this base type may be
- used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:token">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- This simple type designates a boolean with only two
- permissible values
-
- - true
- - false
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdBooleanType">
- <xsd:pattern value="(true|false)"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="url-patternType">
- <xsd:annotation>
- <xsd:documentation>
-
- The url-patternType contains the url pattern of the mapping.
- It must follow the rules specified in Section 11.2 of the
- Servlet API Specification. This pattern is assumed to be in
- URL-decoded form and must not contain CR(#xD) or LF(#xA).
- If it contains those characters, the container must inform
- the developer with a descriptive error message.
- The container must preserve all characters including whitespaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdAnyURIType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:anyURI.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:anyURI">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdBooleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:boolean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:boolean">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:integer.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:integer">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNMTOKENType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:NMTOKEN.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:NMTOKEN">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNonNegativeIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:nonNegativeInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdPositiveIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:positiveInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:positiveInteger">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:QName.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:QName">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:string.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd
deleted file mode 100644
index 852191c298..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd
+++ /dev/null
@@ -1,886 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)j2ee_jaxrpc_mapping_1_1.xsds 1.11 09/03/03
-
- Based on j2ee_jaxrpc_mapping_1_0.dtd, Last updated: 09/19/2002 10:26
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The element describes the Java mapping to a known WSDL document.
-
- It contains the mapping between package names and XML namespaces,
- WSDL root types and Java artifacts, and the set of mappings for
- services.
-
- All java-wsdl-mapping deployment descriptors must indicate the
- schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by using the
- version element as shown below:
-
- <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"
- version="1.1">
- ...
- </java-wsdl-mapping>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for J2EE
- namespace with the following location:
-
- http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="java-wsdl-mapping" type="j2ee:java-wsdl-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is the root of the java-wsdl-mapping deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="constructor-parameter-orderType">
- <xsd:annotation>
- <xsd:documentation>
-
- The constructor-parameter-order element defines the order
- that complexType element values are applied to a Java
- exception constructor. Element names are specified for each
- parameter of the constructor, including element names of
- inherited types if necessary.
-
- Used in: exception-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="element-name"
- type="j2ee:string"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The element-name element defines the name of a complexType
- element name attribute value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="exception-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exception-mapping element defines the mapping between the
- service specific exception types and wsdl faults and
- SOAP headerfaults.
-
- This element should be interpreted with respect to the
- mapping between a method and an operation which provides the
- mapping context.
-
- Used in: service-endpoint-method-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exception-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exception-type element defines Java type of the exception.
- It may be a service specific exception.
-
- It must be a fully qualified class name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-message"
- type="j2ee:wsdl-messageType"/>
- <xsd:element name="wsdl-message-part-name"
- type="j2ee:wsdl-message-part-nameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-message-part-name element is required only
- when the message referenced by the wsdl-message element
- has more than one part.
-
- This only occurs when multiple headerfaults use the
- same message.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="constructor-parameter-order"
- type="j2ee:constructor-parameter-orderType"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-wsdl-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The element describes the Java mapping to a known WSDL document.
-
- It contains the mapping between package names and XML namespaces,
- WSDL root types and Java artifacts, and the set of mappings for
- services.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="package-mapping"
- type="j2ee:package-mappingType"
- minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="java-xml-type-mapping"
- type="j2ee:java-xml-type-mappingType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exception-mapping"
- type="j2ee:exception-mappingType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="service-interface-mapping"
- type="j2ee:service-interface-mappingType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="service-endpoint-interface-mapping"
- type="j2ee:service-endpoint-interface-mappingType"
- minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:sequence>
-
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="1.1"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.1.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-xml-type-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-xml-type-mapping element contains a java-type that is the
- fully qualified name of the Java class, primitive type, or array
- type, QName of the XML root type or anonymous type, the WSDL type
- scope the QName applies to and the set of variable mappings for
- each public variable within the Java class.
-
- Used in: java-wsdl-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="java-type"
- type="j2ee:java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-type element is the fully qualified class name of
- a Java class, primitive, or array type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <choice>
- <xsd:element name="root-type-qname"
- type="j2ee:xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The root-type-qname identifies the WSDL QName of an XML type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="anonymous-type-qname"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The anonymous-type-qname identifies the WSDL QName of an
- anonymous XML type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </choice>
- <xsd:element name="qname-scope"
- type="j2ee:qname-scopeType"/>
- <xsd:element name="variable-mapping"
- type="j2ee:variable-mappingType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="method-param-parts-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-param-parts-mapping element defines the mapping between a
- Java method parameters and a wsdl-message.
-
- Used in: service-endpoint-method-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="param-position"
- type="j2ee:xsdNonNegativeIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-position element defines the position of a
- parameter within a Java method. It must be an integer
- starting from 0.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="param-type"
- type="j2ee:java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-type element defines the fully qualified
- class name of a Java class, primitive, or array type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-message-mapping"
- type="j2ee:wsdl-message-mappingType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="package-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The package-mapping indicates the mapping between java-package-name
- and XML namespace in the WSDL document.
-
- Used in: java-wsdl-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="package-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The package-type indicates the Java package name. It must be a fully
- qualified package name, even though the XML schema type is
- fully-qualified-classType.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="namespaceURI"
- type="j2ee:xsdAnyURIType">
- <xsd:annotation>
- <xsd:documentation>
-
- The namespaceURI element indicates a URI.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="parameter-modeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The parameter-mode element defines the mode of the parameter.
- It can have only three values, IN, OUT, INOUT.
-
- Used in: java-xml-type-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="INOUT"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-mapping defines the mapping of the WSDL port name attribute
- to the Java name used to generate the Generated Service Interface
- method get{java-name}.
-
- Used in: service-interface-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="port-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-mapping defines the mapping of the WSDL port name
- attribute to the Java name used to generate the Generated
- Service Interface method get{java-name}.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="java-port-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-port-name element is the string to use as the port
- name in Java. It is used in generating the Generated
- Service Interface method get{java-port-name}.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="qname-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The qname-scope elements scopes the reference of a QName to the WSDL
- element type it applies to. The value of qname-scope may be
- simpleType, complexType, or element.
-
- Used in: java-xml-type-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="simpleType"/>
- <xsd:enumeration value="complexType"/>
- <xsd:enumeration value="element"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-endpoint-interface-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface-mapping defines a tuple
- to specify Service Endpoint Interfaces to
- WSDL port types and WSDL bindings.
-
- An interface may be mapped to a port-type and binding multiple
- times. This happens rarely.
-
- Used in: java-wsdl-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="service-endpoint-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface element defines the Java
- type for the endpoint interface. The name must be a fully
- qualified class name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-port-type"
- type="j2ee:xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-port-type element defines the wsdl port type
- by a QNAME which uniquely identifies the port type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-binding"
- type="j2ee:xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-binding element defines the wsdl binding
- by a QNAME which uniquely identifies the binding.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-endpoint-method-mapping"
- type="j2ee:service-endpoint-method-mappingType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-endpoint-method-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-method-mapping element defines the mapping of
- Java methods to operations (which are not uniquely qualified by
- qnames).
-
- The wsdl-operation should be interpreted with respect to the
- portType and binding in which this definition is embedded within.
- See the definitions for service-endpoint-interface-mapping and
- service-interface-mapping to acquire the proper context. The
- wrapped-element indicator should only be specified when a WSDL
- message wraps an element type. The wsdl-return-value-mapping is
- not specified for one-way operations.
-
- Used in: service-endpoint-interface-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="java-method-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-method-name element defines the name of a Java method
- within an interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-operation"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-operation element defines an operation within a WSDL
- document. It must be interpreted with respect to a port type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wrapped-element"
- type="j2ee:emptyType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wrapped-element element is defined when a WSDL message
- with a single part is used to wrap an element type and the
- element's name matches the operation name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="method-param-parts-mapping"
- type="j2ee:method-param-parts-mappingType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="wsdl-return-value-mapping"
- type="j2ee:wsdl-return-value-mappingType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-interface-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface-mapping element defines how a Java type for
- the service interface maps to a WSDL service.
-
- Used in: java-wsdl-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="service-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface element defines the Java type for the service.
- For static services, it is javax.xml.rpc.Service interface. For
- generated service, it would be the generated interface name.
-
- The name must be a fully qualified class name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-service-name"
- type="j2ee:xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-service-name element defines the wsdl service name
- by a QNAME which uniquely identifies the service.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-mapping"
- type="j2ee:port-mappingType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variable-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The variable-mapping element defines the correlation between a
- Java class data member or JavaBeans property to an XML element
- or attribute name of an XML root type. If the data-member
- element is present, the Java variable name is a public data
- member. If data-member is not present, the Java variable name
- is a JavaBeans property.
-
- Used in: java-xml-type-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="java-variable-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-variable-name defines the name of a public data member or
- JavaBeans property within a Java class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-member"
- type="j2ee:emptyType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The data-member element is a boolean indicator that a Java
- variable is a public data member and not a JavaBeans property.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="xml-attribute-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The xml-attribute-name element defines name attribute value
- of a WSDL attribute element within a root type. The value
- of an xml-attribute-name element must match the value of
- the ref attribute if mapping an attribute reference.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="xml-element-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The xml-element-name element defines name attribute value of
- a WSDL element within a root type. The value of an
- xml-element-name element must match the value of the ref
- attribute if mapping an element reference.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="xml-wildcard"
- type="j2ee:emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The xml-wildcard element associates the variable-mapping with
- an xsd:any element within a root type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="wsdl-message-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-message-mapping element defines the mapping to a
- specific message and its part. Together they define uniquely
- the mapping for a specific parameter. Parts within a message
- context are uniquely identified with their names.
-
- The parameter-mode is defined by the mapping to indicate
- whether the mapping will be IN, OUT, or INOUT.. The presence
- of the soap-header element indicates that the parameter is
- mapped to a soap header only. When absent, it means that the
- wsdl-message is mapped to a Java parameter. The soap headers
- are interpreted in the order they are provided in the mapping.
-
- Used in: method-param-parts-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="wsdl-message"
- type="j2ee:wsdl-messageType"/>
- <xsd:element name="wsdl-message-part-name"
- type="j2ee:wsdl-message-part-nameType"/>
- <xsd:element name="parameter-mode"
- type="j2ee:parameter-modeType"/>
- <xsd:element name="soap-header"
- type="j2ee:emptyType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-header element is a boolean element indicating that
- a parameter is mapped to a SOAP header.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="wsdl-message-part-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- Interpretation of the wsdl-message-part-name element depends on
- whether or not wrapped-element has been defined in the
- service-endpoint-method-mapping. If wrapped-element is not
- specified, wsdl-message-part-name defines a WSDL message part. It
- should always be interpreted with respect to a wsdl-message
- element. If wrapped-element is specified, wsdl-message-part-name
- refers to an element name of the element type.
-
- Used in: wsdl-message-mapping, wsdl-return-value-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="wsdl-messageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-message element defines a WSDL message by a QNAME.
-
- Used in: wsdl-message-mapping, wsdl-return-value-mapping,
- exception-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdQNameType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="wsdl-return-value-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-return-value-mapping element defines the mapping for the
- method's return value. It defines the mapping to a specific message
- and its part. Together they define uniquely the mapping for a
- specific parameter. Parts within a message context are uniquely
- identified with their names. The wsdl-message-part-name is not
- specified if there is no return value or OUT parameters.
-
- Used in: service-endpoint-method-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="method-return-value"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The method-return-value element defines a fully qualified
- class name or void type for the method's return value
- type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-message"
- type="j2ee:wsdl-messageType"/>
- <xsd:element name="wsdl-message-part-name"
- type="j2ee:wsdl-message-part-nameType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_1_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_1_1.xsd
deleted file mode 100644
index 7e2a7980a2..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_1_1.xsd
+++ /dev/null
@@ -1,491 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)j2ee_web_services_1_1.xsds 1.11 02/11/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the J2EE Application
- Server and the dependencies they have on container resources and
- services. The deployment descriptor must be named
- "META-INF/webservices.xml" in the web services' jar file.
-
- Used in: webservices.xml
-
- All webservices deployment descriptors must indicate the
- webservices schema by using the J2EE namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by using the version
- element as shown below:
-
- <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
- version="1.1">
- ...
- </webservices>
-
- The instance documents may indicate the published version of the
- schema using the xsi:schemaLocation attribute for the J2EE
- namespace with the following location:
-
- http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="webservices" type="j2ee:webservicesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the J2EE Application Server
- and the dependencies they have on container resources and services.
-
- Used in: webservices.xml
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:key name="webservice-description-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC mapping. The
- name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:webservice-description"/>
- <xsd:field xpath="j2ee:webservice-description-name"/>
- </xsd:key>
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-componentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component element associates a WSDL port with a web service
- interface and implementation. It defines the name of the port as a
- component, optional description, optional display name, optional iconic
- representations, WSDL port QName, Service Endpoint Interface, Service
- Implementation Bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="display-name"
- type="j2ee:display-nameType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="icon"
- type="j2ee:iconType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="port-component-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The port-component-name element specifies a port component's
- name. This name is assigned by the module producer to name
- the service implementation bean in the module's deployment
- descriptor. The name must be unique among the port component
- names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-port"
- type="j2ee:xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name space and local name part of the WSDL port QName.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-endpoint-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The service-endpoint-interface element contains the
- fully-qualified name of the port component's Service Endpoint
- Interface.
-
- Used in: port-component
-
- Example:
- <remote>com.wombat.empl.EmployeeService</remote>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-impl-bean"
- type="j2ee:service-impl-beanType"/>
-
- <xsd:element name="handler"
- type="j2ee:port-component_handlerType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component_handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can access the
- init-param name/value pairs using the HandlerInfo interface.
-
- Used in: port-component
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique within the
- module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element name="soap-header"
- type="j2ee:xsdQNameType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed by the
- handler.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="soap-role"
- type="j2ee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that the
- Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-impl-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-impl-bean element defines the web service implementation.
- A service implementation can be an EJB bean class or JAX-RPC web
- component. Existing EJB implementations are exposed as a web service
- using an ejb-link.
-
- Used in: port-component
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="ejb-link"
- type="j2ee:ejb-linkType"/>
- <xsd:element name="servlet-link"
- type="j2ee:servlet-linkType"/>
- </xsd:choice>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The servlet-link element is used in the service-impl-bean element
- to specify that a Service Implementation Bean is defined as a
- JAX-RPC Service Endpoint.
-
- The value of the servlet-link element must be the servlet-name of
- a JAX-RPC Service Endpoint in the same WAR file.
-
- Used in: service-impl-bean
-
- Example:
- <servlet-link>StockQuoteService</servlet-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservice-descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description element defines a WSDL document file
- and the set of Port components associated with the WSDL ports
- defined in the WSDL document. There may be multiple
- webservice-descriptions defined within a module.
-
- All WSDL file ports must have a corresponding port-component element
- defined.
-
- Used in: webservices
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="display-name"
- type="j2ee:display-nameType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="icon"
- type="j2ee:iconType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="webservice-description-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC
- mapping. The name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-file"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the name of a WSDL file in the
- module. The file name is a relative path within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jaxrpc-mapping-file"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-component"
- type="j2ee:port-componentType"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:key name="port-component_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:handler"/>
- <xsd:field xpath="j2ee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservicesType">
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="webservice-description"
- type="j2ee:webservice-descriptionType"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:key name="port-component-name-key">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The port-component-name element specifies a port
- component's name. This name is assigned by the module
- producer to name the service implementation bean in the
- module's deployment descriptor. The name must be unique
- among the port component names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:port-component"/>
- <xsd:field xpath="j2ee:port-component-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="1.1"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.1.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_client_1_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_client_1_1.xsd
deleted file mode 100644
index 454a554528..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/j2ee_web_services_client_1_1.xsd
+++ /dev/null
@@ -1,345 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)j2ee_web_services_client_1_1.xsds 1.10 02/11/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="service-endpoint-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface element defines a fully qualified
- Java class that represents the Service Endpoint Interface of a
- WSDL port.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-link"
- type="j2ee:string"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-link element links a port-component-ref
- to a specific port-component required to be made available
- by a service reference.
-
- The value of a port-component-link must be the
- port-component-name of a port-component in the same module
- or another module in the same application unit. The syntax
- for specification follows the syntax defined for ejb-link
- in the EJB 2.0 specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="service-refGroup">
- <xsd:sequence>
- <xsd:element name="service-ref"
- type="j2ee:service-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:key name="service-ref_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:handler"/>
- <xsd:field xpath="j2ee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref element declares a reference to a Web
- service. It contains optional description, display name and
- icons, a declaration of the required Service interface,
- an optional WSDL document location, an optional set
- of JAX-RPC mappings, an optional QName for the service element,
- an optional set of Service Endpoint Interfaces to be resolved
- by the container to a WSDL port, and an optional set of handlers.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="service-ref-name"
- type="j2ee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-name element declares logical name that the
- components in the module use to look up the Web service. It
- is recommended that all service reference names start with
- "service/".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-interface"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface element declares the fully qualified class
- name of the JAX-RPC Service interface the client depends on.
- In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
- generated Service Interface class may also be specified.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="wsdl-file"
- type="j2ee:xsdAnyURIType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the URI location of a WSDL
- file. The location is relative to the root of the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="jaxrpc-mapping-file"
- type="j2ee:pathType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module file.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-qname"
- type="j2ee:xsdQNameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-qname element declares the specific WSDL service
- element that is being refered to. It is not specified if no
- wsdl-file is declared.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-ref"
- type="j2ee:port-component-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="handler"
- type="j2ee:service-ref_handlerType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can
- access the init-param name/value pairs using the
- HandlerInfo interface. If port-name is not specified, the
- handler is assumed to be associated with all ports of the
- service.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-ref_handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can access the
- init-param name/value pairs using the HandlerInfo interface. If
- port-name is not specified, the handler is assumed to be associated
- with all ports of the service.
-
- Used in: service-ref
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler
- implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element name="soap-header"
- type="j2ee:xsdQNameType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed
- by the handler.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="soap-role"
- type="j2ee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that
- the Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-name"
- type="j2ee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-name element defines the WSDL port-name that a
- handler should be associated with.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_5.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_5.xsd
deleted file mode 100644
index db1018188e..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_5.xsd
+++ /dev/null
@@ -1,2096 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="5">
- <xsd:annotation>
- <xsd:documentation>
- @(#)javaee_5.xsds 1.65 06/02/17
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
-<xsd:annotation>
-<xsd:documentation>
-
-The following definitions that appear in the common
-shareable schema(s) of J2EE deployment descriptors should be
-interpreted with respect to the context they are included:
-
-Deployment Component may indicate one of the following:
- j2ee application;
- application client;
- web application;
- enterprise bean;
- resource adapter;
-
-Deployment File may indicate one of the following:
- ear file;
- war file;
- jar file;
- rar file;
-
-</xsd:documentation>
-</xsd:annotation>
-
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-
- <xsd:include schemaLocation="javaee_web_services_client_1_2.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:group name="descriptionGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained description related
- elements consistent across Java EE deployment descriptors.
-
- All elements may occur multiple times with different languages,
- to support localization of the content.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The description type is used by a description element to
- provide text describing the parent element. The elements
- that use this type should include any information that the
- Deployment Component's Deployment File file producer wants
- to provide to the consumer of the Deployment Component's
- Deployment File (i.e., to the Deployer). Typically, the
- tools used by such a Deployment File consumer will display
- the description when processing the parent element that
- contains the description.
-
- The lang attribute defines the language that the
- description is provided in. The default value is "en" (English).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:xsdStringType">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="dewey-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines a dewey decimal that is used
- to describe versions of documents.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="display-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The display-name type contains a short name that is intended
- to be displayed by tools. It is used by display-name
- elements. The display name need not be unique.
-
- Example:
-
- ...
- <display-name xml:lang="en">
- Employee Self Service
- </display-name>
-
- The value of the xml:lang attribute is "en" (English) by default.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:string">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-linkType is used by ejb-link
- elements in the ejb-ref or ejb-local-ref elements to specify
- that an EJB reference is linked to enterprise bean.
-
- The value of the ejb-link element must be the ejb-name of an
- enterprise bean in the same ejb-jar file or in another ejb-jar
- file in the same Java EE application unit.
-
- Alternatively, the name in the ejb-link element may be
- composed of a path name specifying the ejb-jar containing the
- referenced enterprise bean with the ejb-name of the target
- bean appended and separated from the path name by "#". The
- path name is relative to the Deployment File containing
- Deployment Component that is referencing the enterprise
- bean. This allows multiple enterprise beans with the same
- ejb-name to be uniquely identified.
-
- Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-local-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-refType is used by ejb-local-ref elements for
- the declaration of a reference to an enterprise bean's local
- home or to the local business interface of a 3.0 bean.
- The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the Deployment
- Component that's referencing the enterprise bean.
- - the optional expected type of the referenced enterprise bean
- - the optional expected local interface of the referenced
- enterprise bean or the local business interface of the
- referenced enterprise bean.
- - the optional expected local home interface of the referenced
- enterprise bean. Not applicable if this ejb-local-ref refers
- to the local business interface of a 3.0 bean.
- - optional ejb-link information, used to specify the
- referenced enterprise bean
- - optional elements to define injection of the named enterprise
- bean into a component field or property.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="javaee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="javaee:ejb-ref-typeType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- Deployment Component's environment and is relative to the
- java:comp/env context. The name must be unique within the
- Deployment Component.
-
- It is recommended that name is prefixed with "ejb/".
-
- Example:
-
- <ejb-ref-name>ejb/Payroll</ejb-ref-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:jndi-nameType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-typeType contains the expected type of the
- referenced enterprise bean.
-
- The ejb-ref-type designates a value
- that must be one of the following:
-
- Entity
- Session
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Entity"/>
- <xsd:enumeration value="Session"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-refType is used by ejb-ref elements for the
- declaration of a reference to an enterprise bean's home or
- to the remote business interface of a 3.0 bean.
- The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the Deployment Component that's referencing the enterprise
- bean.
- - the optional expected type of the referenced enterprise bean
- - the optional remote interface of the referenced enterprise bean
- or the remote business interface of the referenced enterprise
- bean
- - the optional expected home interface of the referenced
- enterprise bean. Not applicable if this ejb-ref
- refers to the remote business interface of a 3.0 bean.
- - optional ejb-link information, used to specify the
- referenced enterprise bean
- - optional elements to define injection of the named enterprise
- bean into a component field or property
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="javaee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="javaee:ejb-ref-typeType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is used to designate an empty
- element when used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entry-type-valuesType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This type contains the fully-qualified Java type of the
- environment entry value that is expected by the
- application's code.
-
- The following are the legal values of env-entry-type-valuesType:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
- Example:
-
- <env-entry-type>java.lang.Boolean</env-entry-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="java.lang.Boolean"/>
- <xsd:enumeration value="java.lang.Byte"/>
- <xsd:enumeration value="java.lang.Character"/>
- <xsd:enumeration value="java.lang.String"/>
- <xsd:enumeration value="java.lang.Short"/>
- <xsd:enumeration value="java.lang.Integer"/>
- <xsd:enumeration value="java.lang.Long"/>
- <xsd:enumeration value="java.lang.Float"/>
- <xsd:enumeration value="java.lang.Double"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entryType is used to declare an application's
- environment entry. The declaration consists of an optional
- description, the name of the environment entry, a type
- (optional if the value is injected, otherwise required), and
- an optional value.
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- If a value is not specified and injection is requested,
- no injection will occur and no entry of the specified name
- will be created. This allows an initial value to be
- specified in the source code without being incorrectly
- changed when no override has been specified.
-
- If a value is not specified and no injection is requested,
- a value must be supplied during deployment.
-
- This type is used by env-entry elements.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="env-entry-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The env-entry-name element contains the name of a
- Deployment Component's environment entry. The name
- is a JNDI name relative to the java:comp/env
- context. The name must be unique within a
- Deployment Component. The uniqueness
- constraints must be defined within the declared
- context.
-
- Example:
-
- <env-entry-name>minAmount</env-entry-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="env-entry-type"
- type="javaee:env-entry-type-valuesType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The env-entry-type element contains the Java language
- type of the environment entry. If an injection target
- is specified for the environment entry, the type may
- be omitted, or must match the type of the injection
- target. If no injection target is specified, the type
- is required.
-
- Example:
-
- <env-entry-type>java.lang.Integer</env-entry-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="env-entry-value"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The env-entry-value designates the value of a
- Deployment Component's environment entry. The value
- must be a String that is valid for the
- constructor of the specified type that takes a
- single String parameter, or for java.lang.Character,
- a single character.
-
- Example:
-
- <env-entry-value>100.00</env-entry-value>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate the name of a
- Java class or interface. The name is in the form of a
- "binary name", as defined in the JLS. This is the form
- of name used in Class.forName(). Tools that need the
- canonical name (the name used in source code) will need
- to convert this binary name to the canonical name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generic-booleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines four different values which can designate
- boolean values. This includes values yes and no which are
- not designated by xsd:boolean
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="true"/>
- <xsd:enumeration value="false"/>
- <xsd:enumeration value="yes"/>
- <xsd:enumeration value="no"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="homeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The homeType defines the fully-qualified name of
- an enterprise bean's home interface.
-
- Example:
-
- <home>com.aardvark.payroll.PayrollHome</home>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="iconType">
- <xsd:annotation>
- <xsd:documentation>
-
- The icon type contains small-icon and large-icon elements
- that specify the file names for small and large GIF, JPEG,
- or PNG icon images used to represent the parent element in a
- GUI tool.
-
- The xml:lang attribute defines the language that the
- icon file names are provided in. Its value is "en" (English)
- by default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="small-icon" type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The small-icon element contains the name of a file
- containing a small (16 x 16) icon image. The file
- name is a relative path within the Deployment
- Component's Deployment File.
-
- The image may be in the GIF, JPEG, or PNG format.
- The icon can be used by tools.
-
- Example:
-
- <small-icon>employee-service-icon16x16.jpg</small-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="large-icon" type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The large-icon element contains the name of a file
- containing a large
- (32 x 32) icon image. The file name is a relative
- path within the Deployment Component's Deployment
- File.
-
- The image may be in the GIF, JPEG, or PNG format.
- The icon can be used by tools.
-
- Example:
-
- <large-icon>employee-service-icon32x32.jpg</large-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
-
- <xsd:attribute ref="xml:lang"/>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="injection-targetType">
- <xsd:annotation>
- <xsd:documentation>
-
- An injection target specifies a class and a name within
- that class into which a resource should be injected.
-
- The injection target class specifies the fully qualified
- class name that is the target of the injection. The
- Java EE specifications describe which classes can be an
- injection target.
-
- The injection target name specifies the target within
- the specified class. The target is first looked for as a
- JavaBeans property name. If not found, the target is
- looked for as a field name.
-
- The specified resource will be injected into the target
- during initialization of the class by either calling the
- set method for the target property or by setting a value
- into the named field.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="injection-target-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="injection-target-name"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-identifierType defines a Java identifier.
- The users of this type should further verify that
- the content does not contain Java reserved keywords.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a generic type that designates a Java primitive
- type or a fully qualified name of a Java interface/type,
- or an array of such types.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="[^\p{Z}]*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jndi-nameType type designates a JNDI name in the
- Deployment Component's environment and is relative to the
- java:comp/env context. A JNDI name must be unique within the
- Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="jndiEnvironmentRefsGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained JNDI environment
- reference elements consistent across Java EE deployment descriptors.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="env-entry"
- type="javaee:env-entryType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="javaee:ejb-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="ejb-local-ref"
- type="javaee:ejb-local-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:group ref="javaee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="javaee:resource-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="javaee:resource-env-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="javaee:message-destination-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="persistence-context-ref"
- type="javaee:persistence-context-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref"
- type="javaee:persistence-unit-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="post-construct"
- type="javaee:lifecycle-callbackType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="pre-destroy"
- type="javaee:lifecycle-callbackType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="lifecycle-callbackType">
- <xsd:annotation>
- <xsd:documentation>
-
- The lifecycle-callback type specifies a method on a
- class to be called when a lifecycle event occurs.
- Note that each class may have only one lifecycle callback
- method for any given event and that the method may not
- be overloaded.
-
- If the lifefycle-callback-class element is missing then
- the class defining the callback is assumed to be the
- component class in scope at the place in the descriptor
- in which the callback definition appears.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="lifecycle-callback-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"/>
- <xsd:element name="lifecycle-callback-method"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="listenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listenerType indicates the deployment properties for a web
- application listener bean.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="listener-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listener-class element declares a class in the
- application must be registered as a web
- application listener bean. The value is the fully
- qualified classname of the listener class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="local-homeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The local-homeType defines the fully-qualified
- name of an enterprise bean's local home interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="localType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localType defines the fully-qualified name of an
- enterprise bean's local interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-linkType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-linkType is used to link a message
- destination reference or message-driven bean to a message
- destination.
-
- The Assembler sets the value to reflect the flow of messages
- between producers and consumers in the application.
-
- The value must be the message-destination-name of a message
- destination in the same Deployment File or in another
- Deployment File in the same Java EE application unit.
-
- Alternatively, the value may be composed of a path name
- specifying a Deployment File containing the referenced
- message destination with the message-destination-name of the
- destination appended and separated from the path name by
- "#". The path name is relative to the Deployment File
- containing Deployment Component that is referencing the
- message destination. This allows multiple message
- destinations with the same name to be uniquely identified.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destination-ref element contains a declaration
- of Deployment Component's reference to a message destination
- associated with a resource in Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the message destination reference name
- - an optional message destination type
- - an optional specification as to whether
- the destination is used for
- consuming or producing messages, or both.
- if not specified, "both" is assumed.
- - an optional link to the message destination
- - optional injection targets
-
- The message destination type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Examples:
-
- <message-destination-ref>
- <message-destination-ref-name>jms/StockQueue
- </message-destination-ref-name>
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
- <message-destination-usage>Consumes
- </message-destination-usage>
- <message-destination-link>CorporateStocks
- </message-destination-link>
- </message-destination-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies
- the name of a message destination reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context and must be
- unique within an ejb-jar (for enterprise beans) or a
- Deployment File (for others).
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination-type"
- type="javaee:message-destination-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-usage"
- type="javaee:message-destination-usageType"
- minOccurs="0"/>
- <xsd:element name="message-destination-link"
- type="javaee:message-destination-linkType"
- minOccurs="0"/>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-typeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destination-typeType specifies the type of
- the destination. The type is specified by the Java interface
- expected to be implemented by the destination.
-
- Example:
-
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-usageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-usageType specifies the use of the
- message destination indicated by the reference. The value
- indicates whether messages are consumed from the message
- destination, produced for the destination, or both. The
- Assembler makes use of this information in linking producers
- of a destination with its consumers.
-
- The value of the message-destination-usage element must be
- one of the following:
- Consumes
- Produces
- ConsumesProduces
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Consumes"/>
- <xsd:enumeration value="Produces"/>
- <xsd:enumeration value="ConsumesProduces"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destinationType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The message-destinationType specifies a message
- destination. The logical destination described by this
- element is mapped to a physical destination by the Deployer.
-
- The message destination element contains:
-
- - an optional description
- - an optional display-name
- - an optional icon
- - a message destination name which must be unique
- among message destination names within the same
- Deployment File.
- - an optional mapped name
-
- Example:
-
- <message-destination>
- <message-destination-name>CorporateStocks
- </message-destination-name>
- </message-destination>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="message-destination-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-name element specifies a
- name for a message destination. This name must be
- unique among the names of message destinations
- within the Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- A product specific name that this message destination
- should be mapped to. Each message-destination-ref
- element that references this message destination will
- define a name in the namespace of the referencing
- component. (It's a name in the JNDI java:comp/env
- namespace.) Many application servers provide a way to
- map these local names to names of resources known to the
- application server. This mapped name is often a global
- JNDI name, but may be a name of any form. Each of the
- local names should be mapped to this same global name.
-
- Application servers are not required to support any
- particular form or type of mapped name, nor the ability
- to use mapped names. The mapped name is
- product-dependent and often installation-dependent. No
- use of a mapped name is portable.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="param-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is a general type that can be used to declare
- parameter/value lists.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="param-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-name element contains the name of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="param-value"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-value element contains the value of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate either a relative
- path or an absolute path starting with a "/".
-
- In elements that specify a pathname to a file within the
- same Deployment File, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the Deployment File's namespace. Absolute filenames (i.e.,
- those starting with "/") also specify names in the root of
- the Deployment File's namespace. In general, relative names
- are preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-context-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The persistence-context-ref element contains a declaration
- of Deployment Component's reference to a persistence context
- associated within a Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the persistence context reference name
- - an optional persistence unit name. If not specified,
- the default persistence unit is assumed.
- - an optional specification as to whether
- the persistence context type is Transaction or
- Extended. If not specified, Transaction is assumed.
- - an optional list of persistence properties
- - optional injection targets
-
- Examples:
-
- <persistence-context-ref>
- <persistence-context-ref-name>myPersistenceContext
- </persistence-context-ref-name>
- </persistence-context-ref>
-
- <persistence-context-ref>
- <persistence-context-ref-name>myPersistenceContext
- </persistence-context-ref-name>
- <persistence-unit-name>PersistenceUnit1
- </persistence-unit-name>
- <persistence-context-type>Extended</persistence-context-type>
- </persistence-context-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-context-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-context-ref-name element specifies
- the name of a persistence context reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="persistence-unit-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The Application Assembler(or BeanProvider) may use the
- following syntax to avoid the need to rename persistence
- units to have unique names within a Java EE application.
-
- The Application Assembler specifies the pathname of the
- root of the persistence.xml file for the referenced
- persistence unit and appends the name of the persistence
- unit separated from the pathname by #. The pathname is
- relative to the referencing application component jar file.
- In this manner, multiple persistence units with the same
- persistence unit name may be uniquely identified when the
- Application Assembler cannot change persistence unit names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="persistence-context-type"
- type="javaee:persistence-context-typeType"
- minOccurs="0"/>
-
- <xsd:element name="persistence-property"
- type="javaee:propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to specify properties for the container or persistence
- provider. Vendor-specific properties may be included in
- the set of properties. Properties that are not recognized
- by a vendor must be ignored. Entries that make use of the
- namespace javax.persistence and its subnamespaces must not
- be used for vendor-specific properties. The namespace
- javax.persistence is reserved for use by the specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-context-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-context-typeType specifies the transactional
- nature of a persistence context reference.
-
- The value of the persistence-context-type element must be
- one of the following:
- Transaction
- Extended
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Transaction"/>
- <xsd:enumeration value="Extended"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The persistence-unit-ref element contains a declaration
- of Deployment Component's reference to a persistence unit
- associated within a Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the persistence unit reference name
- - an optional persistence unit name. If not specified,
- the default persistence unit is assumed.
- - optional injection targets
-
- Examples:
-
- <persistence-unit-ref>
- <persistence-unit-ref-name>myPersistenceUnit
- </persistence-unit-ref-name>
- </persistence-unit-ref>
-
- <persistence-unit-ref>
- <persistence-unit-ref-name>myPersistenceUnit
- </persistence-unit-ref-name>
- <persistence-unit-name>PersistenceUnit1
- </persistence-unit-name>
- </persistence-unit-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-unit-ref-name element specifies
- the name of a persistence unit reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="persistence-unit-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The Application Assembler(or BeanProvider) may use the
- following syntax to avoid the need to rename persistence
- units to have unique names within a Java EE application.
-
- The Application Assembler specifies the pathname of the
- root of the persistence.xml file for the referenced
- persistence unit and appends the name of the persistence
- unit separated from the pathname by #. The pathname is
- relative to the referencing application component jar file.
- In this manner, multiple persistence units with the same
- persistence unit name may be uniquely identified when the
- Application Assembler cannot change persistence unit names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies a name/value pair.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="name"
- type="javaee:xsdStringType">
- </xsd:element>
- <xsd:element name="value"
- type="javaee:xsdStringType">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="remoteType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The remote element contains the fully-qualified name
- of the enterprise bean's remote interface.
-
- Example:
-
- <remote>com.wombat.empl.EmployeeService</remote>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-authType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-authType specifies whether the Deployment Component
- code signs on programmatically to the resource manager, or
- whether the Container will sign on to the resource manager
- on behalf of the Deployment Component. In the latter case,
- the Container uses information that is supplied by the
- Deployer.
-
- The value must be one of the two following:
-
- Application
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Application"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-sharing-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-sharing-scope type specifies whether connections
- obtained through the given resource manager connection
- factory reference can be shared. The value, if specified,
- must be one of the two following:
-
- Shareable
- Unshareable
-
- The default value is Shareable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Shareable"/>
- <xsd:enumeration value="Unshareable"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-env-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The resource-env-refType is used to define
- resource-env-type elements. It contains a declaration of a
- Deployment Component's reference to an administered object
- associated with a resource in the Deployment Component's
- environment. It consists of an optional description, the
- resource environment reference name, and an optional
- indication of the resource environment reference type
- expected by the Deployment Component code.
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- The resource environment type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Example:
-
- <resource-env-ref>
- <resource-env-ref-name>jms/StockQueue
- </resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue
- </resource-env-ref-type>
- </resource-env-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in
- the Deployment Component code. The name is a JNDI
- name relative to the java:comp/env context and must
- be unique within a Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="resource-env-ref-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-type element specifies the type
- of a resource environment reference. It is the
- fully qualified name of a Java language class or
- interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The resource-refType contains a declaration of a
- Deployment Component's reference to an external resource. It
- consists of an optional description, the resource manager
- connection factory reference name, an optional indication of
- the resource manager connection factory type expected by the
- Deployment Component code, an optional type of authentication
- (Application or Container), and an optional specification of
- the shareability of connections obtained from the resource
- (Shareable or Unshareable).
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- The connection factory type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="res-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.
- The name is a JNDI name relative to the
- java:comp/env context.
- The name must be unique within a Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="res-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-type element specifies the type of the data
- source. The type is specified by the fully qualified
- Java language class or interface
- expected to be implemented by the data source.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="res-auth"
- type="javaee:res-authType"
- minOccurs="0"/>
-
- <xsd:element name="res-sharing-scope"
- type="javaee:res-sharing-scopeType"
- minOccurs="0"/>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="resourceGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group collects elements that are common to all the
- JNDI resource elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- A product specific name that this resource should be
- mapped to. The name of this resource, as defined by the
- resource's name element or defaulted, is a name that is
- local to the application component using the resource.
- (It's a name in the JNDI java:comp/env namespace.) Many
- application servers provide a way to map these local
- names to names of resources known to the application
- server. This mapped name is often a global JNDI name,
- but may be a name of any form.
-
- Application servers are not required to support any
- particular form or type of mapped name, nor the ability
- to use mapped names. The mapped name is
- product-dependent and often installation-dependent. No
- use of a mapped name is portable.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="injection-target"
- type="javaee:injection-targetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-nameType designates the name of a security role.
-
- The name must conform to the lexical rules for a token.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="run-asType">
- <xsd:annotation>
- <xsd:documentation>
-
- The run-asType specifies the run-as identity to be
- used for the execution of a component. It contains an
- optional description, and the name of a security role.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-role-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-refType contains the declaration of a
- security role reference in a component's or a
- Deployment Component's code. The declaration consists of an
- optional description, the security role name used in the
- code, and an optional link to a security role. If the
- security role is not specified, the Deployer must choose an
- appropriate security role.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The value of the role-name element must be the String used
- as the parameter to the
- EJBContext.isCallerInRole(String roleName) method or the
- HttpServletRequest.isUserInRole(String role) method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="role-link"
- type="javaee:role-nameType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-link element is a reference to a defined
- security role. The role-link element must contain
- the name of one of the security roles defined in the
- security-role elements.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The security-roleType contains the definition of a security
- role. The definition consists of an optional description of
- the security role, and the security role name.
-
- Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="string">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a special string datatype that is defined by Java EE as
- a base type for defining collapsed strings. When schemas
- require trailing/leading space elimination as well as
- collapsing the existing whitespace, this base type may be
- used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:token">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- This simple type designates a boolean with only two
- permissible values
-
- - true
- - false
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdBooleanType">
- <xsd:pattern value="(true|false)"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="url-patternType">
- <xsd:annotation>
- <xsd:documentation>
-
- The url-patternType contains the url pattern of the mapping.
- It must follow the rules specified in Section 11.2 of the
- Servlet API Specification. This pattern is assumed to be in
- URL-decoded form and must not contain CR(#xD) or LF(#xA).
- If it contains those characters, the container must inform
- the developer with a descriptive error message.
- The container must preserve all characters including whitespaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdAnyURIType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:anyURI.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:anyURI">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdBooleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:boolean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:boolean">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:integer.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:integer">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNMTOKENType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:NMTOKEN.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:NMTOKEN">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNonNegativeIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:nonNegativeInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdPositiveIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:positiveInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:positiveInteger">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:QName.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:QName">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:string.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd
deleted file mode 100644
index f165d1822d..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd
+++ /dev/null
@@ -1,2422 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="6">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following definitions that appear in the common
- shareable schema(s) of Java EE deployment descriptors should be
- interpreted with respect to the context they are included:
-
- Deployment Component may indicate one of the following:
- java ee application;
- application client;
- web application;
- enterprise bean;
- resource adapter;
-
- Deployment File may indicate one of the following:
- ear file;
- war file;
- jar file;
- rar file;
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-
- <xsd:include schemaLocation="javaee_web_services_client_1_3.xsd"/>
-
- <xsd:group name="descriptionGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained description related
- elements consistent across Java EE deployment descriptors.
-
- All elements may occur multiple times with different languages,
- to support localization of the content.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:group name="jndiEnvironmentRefsGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group keeps the usage of the contained JNDI environment
- reference elements consistent across Java EE deployment descriptors.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="env-entry"
- type="javaee:env-entryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref"
- type="javaee:ejb-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-local-ref"
- type="javaee:ejb-local-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:group ref="javaee:service-refGroup"/>
- <xsd:element name="resource-ref"
- type="javaee:resource-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref"
- type="javaee:resource-env-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref"
- type="javaee:message-destination-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-context-ref"
- type="javaee:persistence-context-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref"
- type="javaee:persistence-unit-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="post-construct"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="pre-destroy"
- type="javaee:lifecycle-callbackType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="data-source"
- type="javaee:data-sourceType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:group name="resourceGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group collects elements that are common to most
- JNDI resource elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:resourceBaseGroup"/>
- <xsd:element name="lookup-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The JNDI name to be looked up to resolve a resource reference.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:group name="resourceBaseGroup">
- <xsd:annotation>
- <xsd:documentation>
-
- This group collects elements that are common to all the
- JNDI resource elements. It does not include the lookup-name
- element, that is only applicable to some resource elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- A product specific name that this resource should be
- mapped to. The name of this resource, as defined by the
- resource's name element or defaulted, is a name that is
- local to the application component using the resource.
- (It's a name in the JNDI java:comp/env namespace.) Many
- application servers provide a way to map these local
- names to names of resources known to the application
- server. This mapped name is often a global JNDI name,
- but may be a name of any form.
-
- Application servers are not required to support any
- particular form or type of mapped name, nor the ability
- to use mapped names. The mapped name is
- product-dependent and often installation-dependent. No
- use of a mapped name is portable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="injection-target"
- type="javaee:injection-targetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="data-sourceType">
- <xsd:annotation>
- <xsd:documentation>
-
- Configuration of a DataSource.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Description of this DataSource.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name element specifies the JNDI name of the
- data source being defined.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-name"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- DataSource, XADataSource or ConnectionPoolDataSource
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Database server name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-number"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Port number where a server is listening for requests.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="database-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Name of a database on a server.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="url"
- type="javaee:jdbc-urlType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- A JDBC URL. If the <code>url</code> property is specified
- along with other standard <code>DataSource</code> properties
- such as <code>serverName</code>, <code>databaseName</code>
- and <code>portNumber</code>, the more specific properties will
- take precedence and <code>url</code> will be ignored.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- User name to use for connection authentication.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Password to use for connection authentication.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property"
- type="javaee:propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- JDBC DataSource property. This may be a vendor-specific
- property or a less commonly used DataSource property.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login-timeout"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Sets the maximum time in seconds that this data source
- will wait while attempting to connect to a database.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="transactional"
- type="javaee:xsdBooleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Set to false if connections should not participate in
- transactions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="isolation-level"
- type="javaee:isolation-levelType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Isolation level for connections.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="initial-pool-size"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Number of connections that should be created when a
- connection pool is initialized.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-pool-size"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Maximum number of connections that should be concurrently
- allocated for a connection pool.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-pool-size"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Minimum number of connections that should be concurrently
- allocated for a connection pool.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-idle-time"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The number of seconds that a physical connection should
- remain unused in the pool before the connection is
- closed for a connection pool.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-statements"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The total number of statements that a connection pool
- should keep open.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The description type is used by a description element to
- provide text describing the parent element. The elements
- that use this type should include any information that the
- Deployment Component's Deployment File file producer wants
- to provide to the consumer of the Deployment Component's
- Deployment File (i.e., to the Deployer). Typically, the
- tools used by such a Deployment File consumer will display
- the description when processing the parent element that
- contains the description.
-
- The lang attribute defines the language that the
- description is provided in. The default value is "en" (English).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:xsdStringType">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="dewey-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines a dewey decimal that is used
- to describe versions of documents.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="display-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The display-name type contains a short name that is intended
- to be displayed by tools. It is used by display-name
- elements. The display name need not be unique.
-
- Example:
-
- ...
- <display-name xml:lang="en">
- Employee Self Service
- </display-name>
-
- The value of the xml:lang attribute is "en" (English) by default.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:string">
- <xsd:attribute ref="xml:lang"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The ejb-linkType is used by ejb-link
- elements in the ejb-ref or ejb-local-ref elements to specify
- that an EJB reference is linked to enterprise bean.
-
- The value of the ejb-link element must be the ejb-name of an
- enterprise bean in the same ejb-jar file or in another ejb-jar
- file in the same Java EE application unit.
-
- Alternatively, the name in the ejb-link element may be
- composed of a path name specifying the ejb-jar containing the
- referenced enterprise bean with the ejb-name of the target
- bean appended and separated from the path name by "#". The
- path name is relative to the Deployment File containing
- Deployment Component that is referencing the enterprise
- bean. This allows multiple enterprise beans with the same
- ejb-name to be uniquely identified.
-
- Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-local-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-refType is used by ejb-local-ref elements for
- the declaration of a reference to an enterprise bean's local
- home or to the local business interface of a 3.0 bean.
- The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the Deployment
- Component that's referencing the enterprise bean.
- - the optional expected type of the referenced enterprise bean
- - the optional expected local interface of the referenced
- enterprise bean or the local business interface of the
- referenced enterprise bean.
- - the optional expected local home interface of the referenced
- enterprise bean. Not applicable if this ejb-local-ref refers
- to the local business interface of a 3.0 bean.
- - optional ejb-link information, used to specify the
- referenced enterprise bean
- - optional elements to define injection of the named enterprise
- bean into a component field or property.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="javaee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="javaee:ejb-ref-typeType"
- minOccurs="0"/>
- <xsd:element name="local-home"
- type="javaee:local-homeType"
- minOccurs="0"/>
- <xsd:element name="local"
- type="javaee:localType"
- minOccurs="0"/>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the
- Deployment Component's environment and is relative to the
- java:comp/env context. The name must be unique within the
- Deployment Component.
-
- It is recommended that name is prefixed with "ejb/".
-
- Example:
-
- <ejb-ref-name>ejb/Payroll</ejb-ref-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:jndi-nameType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-refType is used by ejb-ref elements for the
- declaration of a reference to an enterprise bean's home or
- to the remote business interface of a 3.0 bean.
- The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the Deployment Component that's referencing the enterprise
- bean.
- - the optional expected type of the referenced enterprise bean
- - the optional remote interface of the referenced enterprise bean
- or the remote business interface of the referenced enterprise
- bean
- - the optional expected home interface of the referenced
- enterprise bean. Not applicable if this ejb-ref
- refers to the remote business interface of a 3.0 bean.
- - optional ejb-link information, used to specify the
- referenced enterprise bean
- - optional elements to define injection of the named enterprise
- bean into a component field or property
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="ejb-ref-name"
- type="javaee:ejb-ref-nameType"/>
- <xsd:element name="ejb-ref-type"
- type="javaee:ejb-ref-typeType"
- minOccurs="0"/>
- <xsd:element name="home"
- type="javaee:homeType"
- minOccurs="0"/>
- <xsd:element name="remote"
- type="javaee:remoteType"
- minOccurs="0"/>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ejb-ref-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-typeType contains the expected type of the
- referenced enterprise bean.
-
- The ejb-ref-type designates a value
- that must be one of the following:
-
- Entity
- Session
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Entity"/>
- <xsd:enumeration value="Session"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="emptyType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is used to designate an empty
- element when used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entryType is used to declare an application's
- environment entry. The declaration consists of an optional
- description, the name of the environment entry, a type
- (optional if the value is injected, otherwise required), and
- an optional value.
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- If a value is not specified and injection is requested,
- no injection will occur and no entry of the specified name
- will be created. This allows an initial value to be
- specified in the source code without being incorrectly
- changed when no override has been specified.
-
- If a value is not specified and no injection is requested,
- a value must be supplied during deployment.
-
- This type is used by env-entry elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="env-entry-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The env-entry-name element contains the name of a
- Deployment Component's environment entry. The name
- is a JNDI name relative to the java:comp/env
- context. The name must be unique within a
- Deployment Component. The uniqueness
- constraints must be defined within the declared
- context.
-
- Example:
-
- <env-entry-name>minAmount</env-entry-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="env-entry-type"
- type="javaee:env-entry-type-valuesType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The env-entry-type element contains the Java language
- type of the environment entry. If an injection target
- is specified for the environment entry, the type may
- be omitted, or must match the type of the injection
- target. If no injection target is specified, the type
- is required.
-
- Example:
-
- <env-entry-type>java.lang.Integer</env-entry-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="env-entry-value"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The env-entry-value designates the value of a
- Deployment Component's environment entry. The value
- must be a String that is valid for the
- constructor of the specified type that takes a
- single String parameter, or for java.lang.Character,
- a single character.
-
- Example:
-
- <env-entry-value>100.00</env-entry-value>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="env-entry-type-valuesType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This type contains the fully-qualified Java type of the
- environment entry value that is expected by the
- application's code.
-
- The following are the legal values of env-entry-type-valuesType:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
- java.lang.Class
- any enumeration type (i.e. a subclass of java.lang.Enum)
-
- Examples:
-
- <env-entry-type>java.lang.Boolean</env-entry-type>
- <env-entry-type>java.lang.Class</env-entry-type>
- <env-entry-type>com.example.Color</env-entry-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate the name of a
- Java class or interface. The name is in the form of a
- "binary name", as defined in the JLS. This is the form
- of name used in Class.forName(). Tools that need the
- canonical name (the name used in source code) will need
- to convert this binary name to the canonical name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generic-booleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines four different values which can designate
- boolean values. This includes values yes and no which are
- not designated by xsd:boolean
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="true"/>
- <xsd:enumeration value="false"/>
- <xsd:enumeration value="yes"/>
- <xsd:enumeration value="no"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="iconType">
- <xsd:annotation>
- <xsd:documentation>
-
- The icon type contains small-icon and large-icon elements
- that specify the file names for small and large GIF, JPEG,
- or PNG icon images used to represent the parent element in a
- GUI tool.
-
- The xml:lang attribute defines the language that the
- icon file names are provided in. Its value is "en" (English)
- by default.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="small-icon"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The small-icon element contains the name of a file
- containing a small (16 x 16) icon image. The file
- name is a relative path within the Deployment
- Component's Deployment File.
-
- The image may be in the GIF, JPEG, or PNG format.
- The icon can be used by tools.
-
- Example:
-
- <small-icon>employee-service-icon16x16.jpg</small-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="large-icon"
- type="javaee:pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The large-icon element contains the name of a file
- containing a large
- (32 x 32) icon image. The file name is a relative
- path within the Deployment Component's Deployment
- File.
-
- The image may be in the GIF, JPEG, or PNG format.
- The icon can be used by tools.
-
- Example:
-
- <large-icon>employee-service-icon32x32.jpg</large-icon>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute ref="xml:lang"/>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="injection-targetType">
- <xsd:annotation>
- <xsd:documentation>
-
- An injection target specifies a class and a name within
- that class into which a resource should be injected.
-
- The injection target class specifies the fully qualified
- class name that is the target of the injection. The
- Java EE specifications describe which classes can be an
- injection target.
-
- The injection target name specifies the target within
- the specified class. The target is first looked for as a
- JavaBeans property name. If not found, the target is
- looked for as a field name.
-
- The specified resource will be injected into the target
- during initialization of the class by either calling the
- set method for the target property or by setting a value
- into the named field.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="injection-target-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="injection-target-name"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name="isolation-levelType">
- <xsd:annotation>
- <xsd:documentation>
-
- The following transaction isolation levels are allowed
- (see documentation for the java.sql.Connection interface):
- TRANSACTION_READ_UNCOMMITTED
- TRANSACTION_READ_COMMITTED
- TRANSACTION_REPEATABLE_READ
- TRANSACTION_SERIALIZABLE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="TRANSACTION_READ_UNCOMMITTED"/>
- <xsd:enumeration value="TRANSACTION_READ_COMMITTED"/>
- <xsd:enumeration value="TRANSACTION_REPEATABLE_READ"/>
- <xsd:enumeration value="TRANSACTION_SERIALIZABLE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The java-identifierType defines a Java identifier.
- The users of this type should further verify that
- the content does not contain Java reserved keywords.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a generic type that designates a Java primitive
- type or a fully qualified name of a Java interface/type,
- or an array of such types.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="[^\p{Z}]*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jdbc-urlType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The jdbc-urlType contains the url pattern of the mapping.
- It must follow the rules specified in Section 9.3 of the
- JDBC Specification where the format is:
-
- jdbc:<subprotocol>:<subname>
-
- Example:
-
- <url>jdbc:mysql://localhost:3307/testdb</url>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="jdbc:(.*):(.*)"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jndi-nameType type designates a JNDI name in the
- Deployment Component's environment and is relative to the
- java:comp/env context. A JNDI name must be unique within the
- Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="homeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The homeType defines the fully-qualified name of
- an enterprise bean's home interface.
-
- Example:
-
- <home>com.aardvark.payroll.PayrollHome</home>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="lifecycle-callbackType">
- <xsd:annotation>
- <xsd:documentation>
-
- The lifecycle-callback type specifies a method on a
- class to be called when a lifecycle event occurs.
- Note that each class may have only one lifecycle callback
- method for any given event and that the method may not
- be overloaded.
-
- If the lifefycle-callback-class element is missing then
- the class defining the callback is assumed to be the
- component class in scope at the place in the descriptor
- in which the callback definition appears.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="lifecycle-callback-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"/>
- <xsd:element name="lifecycle-callback-method"
- type="javaee:java-identifierType"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="listenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listenerType indicates the deployment properties for a web
- application listener bean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="listener-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The listener-class element declares a class in the
- application must be registered as a web
- application listener bean. The value is the fully
- qualified classname of the listener class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="localType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localType defines the fully-qualified name of an
- enterprise bean's local interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="local-homeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The local-homeType defines the fully-qualified
- name of an enterprise bean's local home interface.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="param-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type is a general type that can be used to declare
- parameter/value lists.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="param-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-name element contains the name of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="param-value"
- type="javaee:xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- The param-value element contains the value of a
- parameter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate either a relative
- path or an absolute path starting with a "/".
-
- In elements that specify a pathname to a file within the
- same Deployment File, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the Deployment File's namespace. Absolute filenames (i.e.,
- those starting with "/") also specify names in the root of
- the Deployment File's namespace. In general, relative names
- are preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-context-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The persistence-context-ref element contains a declaration
- of Deployment Component's reference to a persistence context
- associated within a Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the persistence context reference name
- - an optional persistence unit name. If not specified,
- the default persistence unit is assumed.
- - an optional specification as to whether
- the persistence context type is Transaction or
- Extended. If not specified, Transaction is assumed.
- - an optional list of persistence properties
- - optional injection targets
-
- Examples:
-
- <persistence-context-ref>
- <persistence-context-ref-name>myPersistenceContext
- </persistence-context-ref-name>
- </persistence-context-ref>
-
- <persistence-context-ref>
- <persistence-context-ref-name>myPersistenceContext
- </persistence-context-ref-name>
- <persistence-unit-name>PersistenceUnit1
- </persistence-unit-name>
- <persistence-context-type>Extended</persistence-context-type>
- </persistence-context-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-context-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-context-ref-name element specifies
- the name of a persistence context reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="persistence-unit-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The Application Assembler(or BeanProvider) may use the
- following syntax to avoid the need to rename persistence
- units to have unique names within a Java EE application.
-
- The Application Assembler specifies the pathname of the
- root of the persistence.xml file for the referenced
- persistence unit and appends the name of the persistence
- unit separated from the pathname by #. The pathname is
- relative to the referencing application component jar file.
- In this manner, multiple persistence units with the same
- persistence unit name may be uniquely identified when the
- Application Assembler cannot change persistence unit names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="persistence-context-type"
- type="javaee:persistence-context-typeType"
- minOccurs="0"/>
- <xsd:element name="persistence-property"
- type="javaee:propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to specify properties for the container or persistence
- provider. Vendor-specific properties may be included in
- the set of properties. Properties that are not recognized
- by a vendor must be ignored. Entries that make use of the
- namespace javax.persistence and its subnamespaces must not
- be used for vendor-specific properties. The namespace
- javax.persistence is reserved for use by the specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:resourceBaseGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-context-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-context-typeType specifies the transactional
- nature of a persistence context reference.
-
- The value of the persistence-context-type element must be
- one of the following:
- Transaction
- Extended
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Transaction"/>
- <xsd:enumeration value="Extended"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies a name/value pair.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name"
- type="javaee:xsdStringType">
- </xsd:element>
- <xsd:element name="value"
- type="javaee:xsdStringType">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The persistence-unit-ref element contains a declaration
- of Deployment Component's reference to a persistence unit
- associated within a Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the persistence unit reference name
- - an optional persistence unit name. If not specified,
- the default persistence unit is assumed.
- - optional injection targets
-
- Examples:
-
- <persistence-unit-ref>
- <persistence-unit-ref-name>myPersistenceUnit
- </persistence-unit-ref-name>
- </persistence-unit-ref>
-
- <persistence-unit-ref>
- <persistence-unit-ref-name>myPersistenceUnit
- </persistence-unit-ref-name>
- <persistence-unit-name>PersistenceUnit1
- </persistence-unit-name>
- </persistence-unit-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="persistence-unit-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The persistence-unit-ref-name element specifies
- the name of a persistence unit reference; its
- value is the environment entry name used in
- Deployment Component code. The name is a JNDI name
- relative to the java:comp/env context.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="persistence-unit-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The Application Assembler(or BeanProvider) may use the
- following syntax to avoid the need to rename persistence
- units to have unique names within a Java EE application.
-
- The Application Assembler specifies the pathname of the
- root of the persistence.xml file for the referenced
- persistence unit and appends the name of the persistence
- unit separated from the pathname by #. The pathname is
- relative to the referencing application component jar file.
- In this manner, multiple persistence units with the same
- persistence unit name may be uniquely identified when the
- Application Assembler cannot change persistence unit names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:resourceBaseGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="remoteType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The remote element contains the fully-qualified name
- of the enterprise bean's remote interface.
-
- Example:
-
- <remote>com.wombat.empl.EmployeeService</remote>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-env-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The resource-env-refType is used to define
- resource-env-ref elements. It contains a declaration of a
- Deployment Component's reference to an administered object
- associated with a resource in the Deployment Component's
- environment. It consists of an optional description, the
- resource environment reference name, and an optional
- indication of the resource environment reference type
- expected by the Deployment Component code.
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- The resource environment type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Example:
-
- <resource-env-ref>
- <resource-env-ref-name>jms/StockQueue
- </resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue
- </resource-env-ref-type>
- </resource-env-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="resource-env-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name
- of a resource environment reference; its value is
- the environment entry name used in
- the Deployment Component code. The name is a JNDI
- name relative to the java:comp/env context and must
- be unique within a Deployment Component.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="resource-env-ref-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-type element specifies the type
- of a resource environment reference. It is the
- fully qualified name of a Java language class or
- interface.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="resource-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The resource-refType contains a declaration of a
- Deployment Component's reference to an external resource. It
- consists of an optional description, the resource manager
- connection factory reference name, an optional indication of
- the resource manager connection factory type expected by the
- Deployment Component code, an optional type of authentication
- (Application or Container), and an optional specification of
- the shareability of connections obtained from the resource
- (Shareable or Unshareable).
-
- It also includes optional elements to define injection of
- the named resource into fields or JavaBeans properties.
-
- The connection factory type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="res-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference.
- The name is a JNDI name relative to the
- java:comp/env context.
- The name must be unique within a Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="res-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-type element specifies the type of the data
- source. The type is specified by the fully qualified
- Java language class or interface
- expected to be implemented by the data source.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="res-auth"
- type="javaee:res-authType"
- minOccurs="0"/>
- <xsd:element name="res-sharing-scope"
- type="javaee:res-sharing-scopeType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-authType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-authType specifies whether the Deployment Component
- code signs on programmatically to the resource manager, or
- whether the Container will sign on to the resource manager
- on behalf of the Deployment Component. In the latter case,
- the Container uses information that is supplied by the
- Deployer.
-
- The value must be one of the two following:
-
- Application
- Container
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Application"/>
- <xsd:enumeration value="Container"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="res-sharing-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-sharing-scope type specifies whether connections
- obtained through the given resource manager connection
- factory reference can be shared. The value, if specified,
- must be one of the two following:
-
- Shareable
- Unshareable
-
- The default value is Shareable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Shareable"/>
- <xsd:enumeration value="Unshareable"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="run-asType">
- <xsd:annotation>
- <xsd:documentation>
-
- The run-asType specifies the run-as identity to be
- used for the execution of a component. It contains an
- optional description, and the name of a security role.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-nameType designates the name of a security role.
-
- The name must conform to the lexical rules for a token.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-roleType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The security-roleType contains the definition of a security
- role. The definition consists of an optional description of
- the security role, and the security role name.
-
- Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-role-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-role-refType contains the declaration of a
- security role reference in a component's or a
- Deployment Component's code. The declaration consists of an
- optional description, the security role name used in the
- code, and an optional link to a security role. If the
- security role is not specified, the Deployer must choose an
- appropriate security role.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The value of the role-name element must be the String used
- as the parameter to the
- EJBContext.isCallerInRole(String roleName) method or the
- HttpServletRequest.isUserInRole(String role) method.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="role-link"
- type="javaee:role-nameType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The role-link element is a reference to a defined
- security role. The role-link element must contain
- the name of one of the security roles defined in the
- security-role elements.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdQNameType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:QName.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:QName">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdBooleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:boolean.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:boolean">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNMTOKENType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:NMTOKEN.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:NMTOKEN">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdAnyURIType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:anyURI.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:anyURI">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:integer.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:integer">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdPositiveIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:positiveInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:positiveInteger">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdNonNegativeIntegerType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:nonNegativeInteger.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="xsdStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type adds an "id" attribute to xsd:string.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="string">
- <xsd:annotation>
- <xsd:documentation>
-
- This is a special string datatype that is defined by Java EE as
- a base type for defining collapsed strings. When schemas
- require trailing/leading space elimination as well as
- collapsing the existing whitespace, this base type may be
- used.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:token">
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="true-falseType">
- <xsd:annotation>
- <xsd:documentation>
-
- This simple type designates a boolean with only two
- permissible values
-
- - true
- - false
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdBooleanType">
- <xsd:pattern value="(true|false)"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="url-patternType">
- <xsd:annotation>
- <xsd:documentation>
-
- The url-patternType contains the url pattern of the mapping.
- It must follow the rules specified in Section 11.2 of the
- Servlet API Specification. This pattern is assumed to be in
- URL-decoded form and must not contain CR(#xD) or LF(#xA).
- If it contains those characters, the container must inform
- the developer with a descriptive error message.
- The container must preserve all characters including whitespaces.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destinationType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The message-destinationType specifies a message
- destination. The logical destination described by this
- element is mapped to a physical destination by the Deployer.
-
- The message destination element contains:
-
- - an optional description
- - an optional display-name
- - an optional icon
- - a message destination name which must be unique
- among message destination names within the same
- Deployment File.
- - an optional mapped name
- - an optional lookup name
-
- Example:
-
- <message-destination>
- <message-destination-name>CorporateStocks
- </message-destination-name>
- </message-destination>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="message-destination-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-name element specifies a
- name for a message destination. This name must be
- unique among the names of message destinations
- within the Deployment File.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="mapped-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- A product specific name that this message destination
- should be mapped to. Each message-destination-ref
- element that references this message destination will
- define a name in the namespace of the referencing
- component or in one of the other predefined namespaces.
- Many application servers provide a way to map these
- local names to names of resources known to the
- application server. This mapped name is often a global
- JNDI name, but may be a name of any form. Each of the
- local names should be mapped to this same global name.
-
- Application servers are not required to support any
- particular form or type of mapped name, nor the ability
- to use mapped names. The mapped name is
- product-dependent and often installation-dependent. No
- use of a mapped name is portable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lookup-name"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The JNDI name to be looked up to resolve the message destination.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-refType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The message-destination-ref element contains a declaration
- of Deployment Component's reference to a message destination
- associated with a resource in Deployment Component's
- environment. It consists of:
-
- - an optional description
- - the message destination reference name
- - an optional message destination type
- - an optional specification as to whether
- the destination is used for
- consuming or producing messages, or both.
- if not specified, "both" is assumed.
- - an optional link to the message destination
- - optional injection targets
-
- The message destination type must be supplied unless an
- injection target is specified, in which case the type
- of the target is used. If both are specified, the type
- must be assignment compatible with the type of the injection
- target.
-
- Examples:
-
- <message-destination-ref>
- <message-destination-ref-name>jms/StockQueue
- </message-destination-ref-name>
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
- <message-destination-usage>Consumes
- </message-destination-usage>
- <message-destination-link>CorporateStocks
- </message-destination-link>
- </message-destination-ref>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="message-destination-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies
- the name of a message destination reference; its
- value is the environment entry name used in
- Deployment Component code.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-destination-type"
- type="javaee:message-destination-typeType"
- minOccurs="0"/>
- <xsd:element name="message-destination-usage"
- type="javaee:message-destination-usageType"
- minOccurs="0"/>
- <xsd:element name="message-destination-link"
- type="javaee:message-destination-linkType"
- minOccurs="0"/>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-usageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-usageType specifies the use of the
- message destination indicated by the reference. The value
- indicates whether messages are consumed from the message
- destination, produced for the destination, or both. The
- Assembler makes use of this information in linking producers
- of a destination with its consumers.
-
- The value of the message-destination-usage element must be
- one of the following:
- Consumes
- Produces
- ConsumesProduces
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="Consumes"/>
- <xsd:enumeration value="Produces"/>
- <xsd:enumeration value="ConsumesProduces"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-typeType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The message-destination-typeType specifies the type of
- the destination. The type is specified by the Java interface
- expected to be implemented by the destination.
-
- Example:
-
- <message-destination-type>javax.jms.Queue
- </message-destination-type>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="message-destination-linkType">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-linkType is used to link a message
- destination reference or message-driven bean to a message
- destination.
-
- The Assembler sets the value to reflect the flow of messages
- between producers and consumers in the application.
-
- The value must be the message-destination-name of a message
- destination in the same Deployment File or in another
- Deployment File in the same Java EE application unit.
-
- Alternatively, the value may be composed of a path name
- specifying a Deployment File containing the referenced
- message destination with the message-destination-name of the
- destination appended and separated from the path name by
- "#". The path name is relative to the Deployment File
- containing Deployment Component that is referencing the
- message destination. This allows multiple message
- destinations with the same name to be uniquely identified.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_2.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_2.xsd
deleted file mode 100644
index e28cb1cefb..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_2.xsd
+++ /dev/null
@@ -1,747 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.2">
- <xsd:annotation>
- <xsd:documentation>
- @(#)javaee_web_services_1_2.xsds 1.18 02/13/06
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the Java EE Application
- Server and the dependencies they have on container resources and
- services. The deployment descriptor must be named
- "META-INF/webservices.xml" in the web services' jar file.
-
- Used in: webservices.xml
-
- All webservices deployment descriptors must indicate the
- webservices schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by using the version
- element as shown below:
-
- <webservices xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"
- version="1.2">
- ...
- </webservices>
-
- The instance documents may indicate the published version of the
- schema using the xsi:schemaLocation attribute for the Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="webservices" type="javaee:webservicesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the Java EE Application Server
- and the dependencies they have on container resources and services.
-
- Used in: webservices.xml
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:key name="webservice-description-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC mapping. The
- name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:webservice-description"/>
- <xsd:field xpath="javaee:webservice-description-name"/>
- </xsd:key>
- </xsd:element>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="handler-chainType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chain element defines the handlerchain.
- Handlerchain can be defined such that the handlers in the
- handlerchain operate,all ports of a service, on a specific
- port or on a list of protocol-bindings. The choice of elements
- service-name-pattern, port-name-pattern and protocol-bindings
- are used to specify whether the handlers in handler-chain are
- for a service, port or protocol binding. If none of these
- choices are specified with the handler-chain element then the
- handlers specified in the handler-chain will be applied on
- everything.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="service-name-pattern"
- type="javaee:qname-pattern" />
- <xsd:element name="port-name-pattern"
- type="javaee:qname-pattern" />
- <xsd:element name="protocol-bindings"
- type="javaee:protocol-bindingListType"/>
- </xsd:choice>
-
- <xsd:element name="handler"
- type="javaee:port-component_handlerType"
- minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="handler-chainsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chains element defines the handlerchains associated
- with this service or service endpoint.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="handler-chain"
- type="javaee:handler-chainType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-componentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component element associates a WSDL port with a web service
- interface and implementation. It defines the name of the port as a
- component, optional description, optional display name, optional iconic
- representations, WSDL port QName, Service Endpoint Interface, Service
- Implementation Bean.
-
- This element also associates a WSDL service with a JAX-WS Provider
- implementation.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="port-component-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The port-component-name element specifies a port component's
- name. This name is assigned by the module producer to name
- the service implementation bean in the module's deployment
- descriptor. The name must be unique among the port component
- names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-service"
- type="javaee:xsdQNameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name space and local name part of the WSDL
- service QName. This is required to be specified for
- port components that are JAX-WS Provider implementations.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-port"
- type="javaee:xsdQNameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name space and local name part of the WSDL
- port QName. This is not required to be specified for port
- components that are JAX-WS Provider implementations
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-mtom"
- type="javaee:true-falseType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to enable or disable SOAP MTOM/XOP mechanism for an
- endpoint implementation.
-
- Not to be specified for JAX-RPC runtime
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="protocol-binding"
- type="javaee:protocol-bindingType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to specify the protocol binding used by the port-component.
- If this element is not specified, then the default binding is
- used (SOAP 1.1 over HTTP)
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-endpoint-interface"
- type="javaee:fully-qualified-classType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The service-endpoint-interface element contains the
- fully-qualified name of the port component's Service Endpoint
- Interface.
-
- Used in: port-component
-
- Example:
- <remote>com.wombat.empl.EmployeeService</remote>
-
- This may not be specified in case there is no Service
- Enpoint Interface as is the case with directly using an
- implementation class with the @WebService annotation.
-
- When the port component is a Provider implementation
- this is not specified.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-impl-bean"
- type="javaee:service-impl-beanType"/>
-
- <xsd:choice>
- <xsd:element name="handler"
- type="javaee:port-component_handlerType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- To be used with JAX-RPC based runtime only.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-chains"
- type="javaee:handler-chainsType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
- To be used with JAX-WS based runtime only.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component_handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can access the
- init-param name/value pairs using the HandlerInfo interface.
-
- Used in: port-component
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique within the
- module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element name="soap-header"
- type="javaee:xsdQNameType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed by the
- handler.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="soap-role"
- type="javaee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that the
- Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="protocol-URIAliasType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type that is used for specifying tokens that
- start with ## which are used to alias existing standard
- protocol bindings and support aliases for new standard
- binding URIs that are introduced in future specifications.
-
- The following tokens alias the standard protocol binding
- URIs:
-
- ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
- ##SOAP11_HTTP_MTOM =
- "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
- ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
- ##SOAP12_HTTP_MTOM =
- "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
- ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="##.+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="protocol-bindingListType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type used for specifying a list of
- protocol-bindingType(s). For e.g.
-
- ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:list itemType="javaee:protocol-bindingType"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="protocol-bindingType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type used for specifying the URI for the
- protocol binding used by the port-component. For
- portability one could use one of the following tokens that
- alias the standard binding types:
-
- ##SOAP11_HTTP
- ##SOAP11_HTTP_MTOM
- ##SOAP12_HTTP
- ##SOAP12_HTTP_MTOM
- ##XML_HTTP
-
- Other specifications could define tokens that start with ##
- to alias new standard binding URIs that are introduced.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:union memberTypes="xsd:anyURI javaee:protocol-URIAliasType"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="qname-pattern">
- <xsd:annotation>
- <xsd:documentation>
- This is used to specify the QName pattern in the
- attribute service-name-pattern and port-name-pattern in
- the handler-chain element
-
- For example, the various forms acceptable here for
- service-name-pattern attribute in handler-chain element
- are :
-
- Exact Name: service-name-pattern="ns1:EchoService"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports with
- this exact service name. The namespace prefix must
- have been declared in a namespace declaration
- attribute in either the start-tag of the element
- where the prefix is used or in an an ancestor
- element (i.e. an element in whose content the
- prefixed markup occurs)
-
- Pattern : service-name-pattern="ns1:EchoService*"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports whose
- Service names are like EchoService1, EchoServiceFoo
- etc. The namespace prefix must have been declared in
- a namespace declaration attribute in either the
- start-tag of the element where the prefix is used or
- in an an ancestor element (i.e. an element in whose
- content the prefixed markup occurs)
-
- Wild Card : service-name-pattern="*"
-
- In this case, handlers specified in this handler-chain
- element will apply to ports of all service names.
-
- The same can be applied to port-name attribute in
- handler-chain element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
- </xsd:restriction>
-
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-impl-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-impl-bean element defines the web service implementation.
- A service implementation can be an EJB bean class or JAX-RPC web
- component. Existing EJB implementations are exposed as a web service
- using an ejb-link.
-
- Used in: port-component
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"/>
- <xsd:element name="servlet-link"
- type="javaee:servlet-linkType"/>
- </xsd:choice>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The servlet-link element is used in the service-impl-bean element
- to specify that a Service Implementation Bean is defined as a
- JAX-RPC Service Endpoint.
-
- The value of the servlet-link element must be the servlet-name of
- a JAX-RPC Service Endpoint in the same WAR file.
-
- Used in: service-impl-bean
-
- Example:
- <servlet-link>StockQuoteService</servlet-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservice-descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description element defines a WSDL document file
- and the set of Port components associated with the WSDL ports
- defined in the WSDL document. There may be multiple
- webservice-descriptions defined within a module.
-
- All WSDL file ports must have a corresponding port-component element
- defined.
-
- Used in: webservices
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="webservice-description-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC
- mapping. The name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-file"
- type="javaee:pathType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the name of a WSDL file in the
- module. The file name is a relative path within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jaxrpc-mapping-file"
- type="javaee:pathType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module.
-
- This is not required when JAX-WS based runtime is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-component"
- type="javaee:port-componentType"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:key name="port-component_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:handler"/>
- <xsd:field xpath="javaee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservicesType">
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="webservice-description"
- type="javaee:webservice-descriptionType"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:key name="port-component-name-key">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The port-component-name element specifies a port
- component's name. This name is assigned by the module
- producer to name the service implementation bean in the
- module's deployment descriptor. The name must be unique
- among the port component names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:port-component"/>
- <xsd:field xpath="javaee:port-component-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="1.2"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.2.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd
deleted file mode 100644
index 7daf23e34a..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd
+++ /dev/null
@@ -1,572 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.3">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the Java EE Application
- Server and the dependencies they have on container resources and
- services. The deployment descriptor must be named
- "META-INF/webservices.xml" in the web services' jar file.
-
- Used in: webservices.xml
-
- All webservices deployment descriptors must indicate the
- webservices schema by using the Java EE namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by using the version
- element as shown below:
-
- <webservices xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd"
- version="1.3">
- ...
- </webservices>
-
- The instance documents may indicate the published version of the
- schema using the xsi:schemaLocation attribute for the Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="webservices"
- type="javaee:webservicesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservices element is the root element for the web services
- deployment descriptor. It specifies the set of web service
- descriptions that are to be deployed into the Java EE Application Server
- and the dependencies they have on container resources and services.
-
- Used in: webservices.xml
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:key name="webservice-description-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC mapping. The
- name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:webservice-description"/>
- <xsd:field xpath="javaee:webservice-description-name"/>
- </xsd:key>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-componentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component element associates a WSDL port with a web service
- interface and implementation. It defines the name of the port as a
- component, optional description, optional display name, optional iconic
- representations, WSDL port QName, Service Endpoint Interface, Service
- Implementation Bean.
-
- This element also associates a WSDL service with a JAX-WS Provider
- implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="port-component-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The port-component-name element specifies a port component's
- name. This name is assigned by the module producer to name
- the service implementation bean in the module's deployment
- descriptor. The name must be unique among the port component
- names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-service"
- type="javaee:xsdQNameType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name space and local name part of the WSDL
- service QName. This is required to be specified for
- port components that are JAX-WS Provider implementations.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-port"
- type="javaee:xsdQNameType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name space and local name part of the WSDL
- port QName. This is not required to be specified for port
- components that are JAX-WS Provider implementations
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-mtom"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to enable or disable SOAP MTOM/XOP mechanism for an
- endpoint implementation.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="mtom-threshold"
- type="javaee:xsdNonNegativeIntegerType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- When MTOM is enabled, binary data above this size in bytes
- will be XOP encoded or sent as attachment. Default value is 0.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="addressing"
- type="javaee:addressingType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- This specifies the WS-Addressing requirements for a JAX-WS
- web service. It corresponds to javax.xml.ws.soap.Addressing
- annotation or its feature javax.xml.ws.soap.AddressingFeature.
-
- See the addressingType for more information.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="respect-binding"
- type="javaee:respect-bindingType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Corresponds to the javax.xml.ws.RespectBinding annotation
- or its corresponding javax.xml.ws.RespectBindingFeature web
- service feature. This is used to control whether a JAX-WS
- implementation must respect/honor the contents of the
- wsdl:binding in the WSDL that is associated with the service.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="protocol-binding"
- type="javaee:protocol-bindingType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to specify the protocol binding used by the port-component.
- If this element is not specified, then the default binding is
- used (SOAP 1.1 over HTTP)
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-endpoint-interface"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The service-endpoint-interface element contains the
- fully-qualified name of the port component's Service Endpoint
- Interface.
-
- Used in: port-component
-
- Example:
- <remote>com.wombat.empl.EmployeeService</remote>
-
- This may not be specified in case there is no Service
- Enpoint Interface as is the case with directly using an
- implementation class with the @WebService annotation.
-
- When the port component is a Provider implementation
- this is not specified.
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-impl-bean"
- type="javaee:service-impl-beanType"/>
- <xsd:choice>
- <xsd:element name="handler"
- type="javaee:handlerType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- To be used with JAX-RPC based runtime only.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-chains"
- type="javaee:handler-chainsType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- To be used with JAX-WS based runtime only.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-impl-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-impl-bean element defines the web service implementation.
- A service implementation can be an EJB bean class or JAX-RPC web
- component. Existing EJB implementations are exposed as a web service
- using an ejb-link.
-
- Used in: port-component
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="ejb-link"
- type="javaee:ejb-linkType"/>
- <xsd:element name="servlet-link"
- type="javaee:servlet-linkType"/>
- </xsd:choice>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-linkType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The servlet-link element is used in the service-impl-bean element
- to specify that a Service Implementation Bean is defined as a
- JAX-RPC Service Endpoint.
-
- The value of the servlet-link element must be the servlet-name of
- a JAX-RPC Service Endpoint in the same WAR file.
-
- Used in: service-impl-bean
-
- Example:
- <servlet-link>StockQuoteService</servlet-link>
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservice-descriptionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description element defines a WSDL document file
- and the set of Port components associated with the WSDL ports
- defined in the WSDL document. There may be multiple
- webservice-descriptions defined within a module.
-
- All WSDL file ports must have a corresponding port-component element
- defined.
-
- Used in: webservices
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="icon"
- type="javaee:iconType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="webservice-description-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The webservice-description-name identifies the collection of
- port-components associated with a WSDL file and JAX-RPC
- mapping. The name must be unique within the deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-file"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the name of a WSDL file in the
- module. The file name is a relative path within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jaxrpc-mapping-file"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module.
-
- This is not required when JAX-WS based runtime is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-component"
- type="javaee:port-componentType"
- minOccurs="1"
- maxOccurs="unbounded">
- <xsd:key name="port-component_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:handler"/>
- <xsd:field xpath="javaee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="webservicesType">
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="webservice-description"
- type="javaee:webservice-descriptionType"
- minOccurs="1"
- maxOccurs="unbounded">
- <xsd:key name="port-component-name-key">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- The port-component-name element specifies a port
- component's name. This name is assigned by the module
- producer to name the service implementation bean in the
- module's deployment descriptor. The name must be unique
- among the port component names defined in the same module.
-
- Used in: port-component
-
- Example:
- <port-component-name>EmployeeService
- </port-component-name>
-
-
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:port-component"/>
- <xsd:field xpath="javaee:port-component-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="1.3"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- The required value for the version is 1.3.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_2.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_2.xsd
deleted file mode 100644
index 3df0dd6279..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_2.xsd
+++ /dev/null
@@ -1,578 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.2">
- <xsd:annotation>
- <xsd:documentation>
- @(#)javaee_web_services_client_1_2.xsds 1.19 02/13/06
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="service-endpoint-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface element defines a fully qualified
- Java class that represents the Service Endpoint Interface of a
- WSDL port.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="enable-mtom"
- type="javaee:true-falseType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to enable or disable SOAP MTOM/XOP mechanism on the client
- side for a port-component.
-
- Not to be specified for JAX-RPC runtime
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-link"
- type="javaee:string"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-link element links a port-component-ref
- to a specific port-component required to be made available
- by a service reference.
-
- The value of a port-component-link must be the
- port-component-name of a port-component in the same module
- or another module in the same application unit. The syntax
- for specification follows the syntax defined for ejb-link
- in the EJB 2.0 specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="service-refGroup">
- <xsd:sequence>
- <xsd:element name="service-ref"
- type="javaee:service-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:key name="service-ref_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:handler"/>
- <xsd:field xpath="javaee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- </xsd:group>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref element declares a reference to a Web
- service. It contains optional description, display name and
- icons, a declaration of the required Service interface,
- an optional WSDL document location, an optional set
- of JAX-RPC mappings, an optional QName for the service element,
- an optional set of Service Endpoint Interfaces to be resolved
- by the container to a WSDL port, and an optional set of handlers.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="service-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-name element declares logical name that the
- components in the module use to look up the Web service. It
- is recommended that all service reference names start with
- "service/".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface element declares the fully qualified class
- name of the JAX-RPC Service interface the client depends on.
- In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
- generated Service Interface class may also be specified.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-ref-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-type element declares the type of the service-ref
- element that is injected or returned when a JNDI lookup is done.
- This must be either a fully qualified name of Service class or
- the fully qualified name of service endpoint interface class.
- This is only used with JAX-WS runtime where the corresponding
- @WebServiceRef annotation can be used to denote both a Service
- or a Port.
-
- If this is not specified, then the type of service-ref element
- that is injected or returned when a JNDI lookup is done is
- always a Service interface/class.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="wsdl-file"
- type="javaee:xsdAnyURIType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the URI location of a WSDL
- file. The location is relative to the root of the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="jaxrpc-mapping-file"
- type="javaee:pathType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module file.
-
- This is not required when JAX-WS based runtime is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="service-qname"
- type="javaee:xsdQNameType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-qname element declares the specific WSDL service
- element that is being refered to. It is not specified if no
- wsdl-file is declared.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-component-ref"
- type="javaee:port-component-refType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:choice>
- <xsd:element name="handler"
- type="javaee:service-ref_handlerType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can
- access the init-param name/value pairs using the
- HandlerInfo interface. If port-name is not specified, the
- handler is assumed to be associated with all ports of the
- service.
-
- To be used with JAX-RPC based runtime only.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-chains"
- type="javaee:service-ref_handler-chainsType"
- minOccurs="0" maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
- To be used with JAX-WS based runtime only.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- <xsd:group ref="javaee:resourceGroup"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-ref_handler-chainType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chain element defines the handlerchain.
- Handlerchain can be defined such that the handlers in the
- handlerchain operate,all ports of a service, on a specific
- port or on a list of protocol-bindings. The choice of elements
- service-name-pattern, port-name-pattern and protocol-bindings
- are used to specify whether the handlers in handler-chain are
- for a service, port or protocol binding. If none of these
- choices are specified with the handler-chain element then the
- handlers specified in the handler-chain will be applied on
- everything.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="service-name-pattern"
- type="javaee:service-ref_qname-pattern" />
- <xsd:element name="port-name-pattern"
- type="javaee:service-ref_qname-pattern" />
- <xsd:element name="protocol-bindings"
- type="javaee:service-ref_protocol-bindingListType"/>
- </xsd:choice>
-
- <xsd:element name="handler"
- type="javaee:service-ref_handlerType"
- minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-ref_handler-chainsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chains element defines the handlerchains associated with this
- service or service endpoint.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="handler-chain"
- type="javaee:service-ref_handler-chainType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-ref_handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can access the
- init-param name/value pairs using the HandlerInfo interface. If
- port-name is not specified, the handler is assumed to be associated
- with all ports of the service.
-
- Used in: service-ref
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler
- implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element name="soap-header"
- type="javaee:xsdQNameType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed
- by the handler.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="soap-role"
- type="javaee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that
- the Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="port-name"
- type="javaee:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-name element defines the WSDL port-name that a
- handler should be associated with.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="service-ref_protocol-URIAliasType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type that is used for specifying tokens that
- start with ## which are used to alias existing standard
- protocol bindings and support aliases for new standard
- binding URIs that are introduced in future specifications.
-
- The following tokens alias the standard protocol binding
- URIs:
-
- ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
- ##SOAP11_HTTP_MTOM =
- "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
- ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
- ##SOAP12_HTTP_MTOM =
- "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
- ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="##.+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="service-ref_protocol-bindingListType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type used for specifying a list of
- protocol-bindingType(s). For e.g.
-
- ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:list itemType="javaee:service-ref_protocol-bindingType"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="service-ref_protocol-bindingType">
- <xsd:annotation>
- <xsd:documentation>
- Defines the type used for specifying the URI for the
- protocol binding used by the port-component. For
- portability one could use one of the following tokens that
- alias the standard binding types:
-
- ##SOAP11_HTTP
- ##SOAP11_HTTP_MTOM
- ##SOAP12_HTTP
- ##SOAP12_HTTP_MTOM
- ##XML_HTTP
-
- Other specifications could define tokens that start with ##
- to alias new standard binding URIs that are introduced.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:union memberTypes="xsd:anyURI javaee:service-ref_protocol-URIAliasType"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="service-ref_qname-pattern">
- <xsd:annotation>
- <xsd:documentation>
- This is used to specify the QName pattern in the
- attribute service-name-pattern and port-name-pattern in
- the handler-chain element
-
- For example, the various forms acceptable here for
- service-name-pattern attribute in handler-chain element
- are :
-
- Exact Name: service-name-pattern="ns1:EchoService"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports with
- this exact service name. The namespace prefix must
- have been declared in a namespace declaration
- attribute in either the start-tag of the element
- where the prefix is used or in an an ancestor
- element (i.e. an element in whose content the
- prefixed markup occurs)
-
- Pattern : service-name-pattern="ns1:EchoService*"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports whose
- Service names are like EchoService1, EchoServiceFoo
- etc. The namespace prefix must have been declared in
- a namespace declaration attribute in either the
- start-tag of the element where the prefix is used or
- in an an ancestor element (i.e. an element in whose
- content the prefixed markup occurs)
-
- Wild Card : service-name-pattern="*"
-
- In this case, handlers specified in this handler-chain
- element will apply to ports of all service names.
-
- The same can be applied to port-name attribute in
- handler-chain element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
- </xsd:restriction>
-
- </xsd:simpleType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd
deleted file mode 100644
index 5c673ae915..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd
+++ /dev/null
@@ -1,737 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.3">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- (C) Copyright International Business Machines Corporation 2002
-
- </xsd:documentation>
- </xsd:annotation>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="service-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref element declares a reference to a Web
- service. It contains optional description, display name and
- icons, a declaration of the required Service interface,
- an optional WSDL document location, an optional set
- of JAX-RPC mappings, an optional QName for the service element,
- an optional set of Service Endpoint Interfaces to be resolved
- by the container to a WSDL port, and an optional set of handlers.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="service-ref-name"
- type="javaee:jndi-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-name element declares logical name that the
- components in the module use to look up the Web service. It
- is recommended that all service reference names start with
- "service/".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-interface element declares the fully qualified class
- name of the JAX-RPC Service interface the client depends on.
- In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
- generated Service Interface class may also be specified.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-ref-type"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-ref-type element declares the type of the service-ref
- element that is injected or returned when a JNDI lookup is done.
- This must be either a fully qualified name of Service class or
- the fully qualified name of service endpoint interface class.
- This is only used with JAX-WS runtime where the corresponding
- @WebServiceRef annotation can be used to denote both a Service
- or a Port.
-
- If this is not specified, then the type of service-ref element
- that is injected or returned when a JNDI lookup is done is
- always a Service interface/class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="wsdl-file"
- type="javaee:xsdAnyURIType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The wsdl-file element contains the URI location of a WSDL
- file. The location is relative to the root of the module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jaxrpc-mapping-file"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The jaxrpc-mapping-file element contains the name of a file that
- describes the JAX-RPC mapping between the Java interaces used by
- the application and the WSDL description in the wsdl-file. The
- file name is a relative path within the module file.
-
- This is not required when JAX-WS based runtime is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="service-qname"
- type="javaee:xsdQNameType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-qname element declares the specific WSDL service
- element that is being refered to. It is not specified if no
- wsdl-file is declared.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-component-ref"
- type="javaee:port-component-refType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="handler"
- type="javaee:handlerType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component. Handlers can
- access the init-param name/value pairs using the
- HandlerInfo interface. If port-name is not specified, the
- handler is assumed to be associated with all ports of the
- service.
-
- To be used with JAX-RPC based runtime only.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-chains"
- type="javaee:handler-chainsType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- To be used with JAX-WS based runtime only.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:group ref="javaee:resourceGroup"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="port-component-refType">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-ref element declares a client dependency
- on the container for resolving a Service Endpoint Interface
- to a WSDL port. It optionally associates the Service Endpoint
- Interface with a particular port-component. This is only used
- by the container for a Service.getPort(Class) method call.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="service-endpoint-interface"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The service-endpoint-interface element defines a fully qualified
- Java class that represents the Service Endpoint Interface of a
- WSDL port.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-mtom"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Used to enable or disable SOAP MTOM/XOP mechanism on the client
- side for a port-component.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="mtom-threshold"
- type="javaee:xsdNonNegativeIntegerType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- When MTOM is enabled, binary data above this size in bytes
- should be XOP encoded or sent as attachment. Default value is 0.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="addressing"
- type="javaee:addressingType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- This specifies the WS-Addressing requirements for a JAX-WS
- web service. It corresponds to javax.xml.ws.soap.Addressing
- annotation or its feature javax.xml.ws.soap.AddressingFeature.
-
- See the addressingType for more information.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="respect-binding"
- type="javaee:respect-bindingType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- Corresponds to the javax.xml.ws.RespectBinding annotation
- or its corresponding javax.xml.ws.RespectBindingFeature web
- service feature. This is used to control whether a JAX-WS
- implementation must respect/honor the contents of the
- wsdl:binding in the WSDL that is associated with the service.
-
- Not to be specified for JAX-RPC runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-component-link"
- type="javaee:string"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-component-link element links a port-component-ref
- to a specific port-component required to be made available
- by a service reference.
-
- The value of a port-component-link must be the
- port-component-name of a port-component in the same module
- or another module in the same application unit. The syntax
- for specification follows the syntax defined for ejb-link
- in the EJB 2.0 specification.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="handler-chainsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chains element defines the handlerchains associated with this
- service or service endpoint.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="handler-chain"
- type="javaee:handler-chainType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="handler-chainType">
- <xsd:annotation>
- <xsd:documentation>
-
- The handler-chain element defines the handlerchain.
- Handlerchain can be defined such that the handlers in the
- handlerchain operate,all ports of a service, on a specific
- port or on a list of protocol-bindings. The choice of elements
- service-name-pattern, port-name-pattern and protocol-bindings
- are used to specify whether the handlers in handler-chain are
- for a service, port or protocol binding. If none of these
- choices are specified with the handler-chain element then the
- handlers specified in the handler-chain will be applied on
- everything.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice minOccurs="0"
- maxOccurs="1">
- <xsd:element name="service-name-pattern"
- type="javaee:qname-pattern"/>
- <xsd:element name="port-name-pattern"
- type="javaee:qname-pattern"/>
- <xsd:element name="protocol-bindings"
- type="javaee:protocol-bindingListType"/>
- </xsd:choice>
- <xsd:element name="handler"
- type="javaee:handlerType"
- minOccurs="1"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:simpleType name="protocol-bindingListType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the type used for specifying a list of
- protocol-bindingType(s). For e.g.
-
- ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:list itemType="javaee:protocol-bindingType"/>
- </xsd:simpleType>
-
- <xsd:simpleType name="protocol-bindingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the type used for specifying the URI for the
- protocol binding used by the port-component. For
- portability one could use one of the following tokens that
- alias the standard binding types:
-
- ##SOAP11_HTTP
- ##SOAP11_HTTP_MTOM
- ##SOAP12_HTTP
- ##SOAP12_HTTP_MTOM
- ##XML_HTTP
-
- Other specifications could define tokens that start with ##
- to alias new standard binding URIs that are introduced.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:union memberTypes="xsd:anyURI javaee:protocol-URIAliasType"/>
- </xsd:simpleType>
-
- <xsd:simpleType name="protocol-URIAliasType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the type that is used for specifying tokens that
- start with ## which are used to alias existing standard
- protocol bindings and support aliases for new standard
- binding URIs that are introduced in future specifications.
-
- The following tokens alias the standard protocol binding
- URIs:
-
- ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
- ##SOAP11_HTTP_MTOM =
- "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
- ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
- ##SOAP12_HTTP_MTOM =
- "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
- ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="##.+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="qname-pattern">
- <xsd:annotation>
- <xsd:documentation>
-
- This is used to specify the QName pattern in the
- attribute service-name-pattern and port-name-pattern in
- the handler-chain element
-
- For example, the various forms acceptable here for
- service-name-pattern attribute in handler-chain element
- are :
-
- Exact Name: service-name-pattern="ns1:EchoService"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports with
- this exact service name. The namespace prefix must
- have been declared in a namespace declaration
- attribute in either the start-tag of the element
- where the prefix is used or in an an ancestor
- element (i.e. an element in whose content the
- prefixed markup occurs)
-
-
- Pattern : service-name-pattern="ns1:EchoService*"
-
- In this case, handlers specified in this
- handler-chain element will apply to all ports whose
- Service names are like EchoService1, EchoServiceFoo
- etc. The namespace prefix must have been declared in
- a namespace declaration attribute in either the
- start-tag of the element where the prefix is used or
- in an an ancestor element (i.e. an element in whose
- content the prefixed markup occurs)
-
- Wild Card : service-name-pattern="*"
-
- In this case, handlers specified in this handler-chain
- element will apply to ports of all service names.
-
- The same can be applied to port-name attribute in
- handler-chain element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="addressingType">
- <xsd:annotation>
- <xsd:documentation>
-
- This specifies the WS-Addressing requirements for a JAX-WS web service.
- It corresponds to javax.xml.ws.soap.Addressing annotation or its
- feature javax.xml.ws.soap.AddressingFeature.
-
- If the "enabled" element is "true", WS-Addressing is enabled.
- It means that the endpoint supports WS-Addressing but does not require
- its use. The default value for "enabled" is "true".
-
- If the WS-Addressing is enabled and the "required" element is "true",
- it means that the endpoint requires WS-Addressing. The default value
- for "required" is "false".
-
- If WS-Addressing is enabled, the "responses" element determines
- if an endpoint requires the use of only anonymous responses,
- or only non-anonymous responses, or all. The value of the "responses"
- element must be one of the following:
-
- ANONYMOUS
- NON_ANONYMOUS
- ALL
-
- The default value for the "responses" is ALL.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enabled"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="required"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="responses"
- type="javaee:addressing-responsesType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="addressing-responsesType">
- <xsd:annotation>
- <xsd:documentation>
-
- If WS-Addressing is enabled, this type determines if an endpoint
- requires the use of only anonymous responses, or only non-anonymous
- responses, or all.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="ANONYMOUS"/>
- <xsd:enumeration value="NON_ANONYMOUS"/>
- <xsd:enumeration value="ALL"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="respect-bindingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Corresponds to the javax.xml.ws.RespectBinding annotation
- or its corresponding javax.xml.ws.RespectBindingFeature web
- service feature. This is used to control whether a JAX-WS
- implementation must respect/honor the contents of the
- wsdl:binding in the WSDL that is associated with the service.
-
- If the "enabled" element is "true", wsdl:binding in the
- associated WSDL, if any, must be respected/honored.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enabled"
- type="javaee:true-falseType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="handlerType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declares the handler for a port-component, service-ref. Handlers can
- access the init-param name/value pairs using the HandlerInfo interface.
-
- Used in: port-component, service-ref
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="handler-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique within the
- module.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="handler-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a fully qualified class name for the handler implementation.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Not to be specified for JAX-WS runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="soap-header"
- type="javaee:xsdQNameType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the QName of a SOAP header that will be processed by the
- handler.
-
- Not to be specified for JAX-WS runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="soap-role"
- type="javaee:string"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The soap-role element contains a SOAP actor definition that the
- Handler will play as a role.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="port-name"
- type="javaee:string"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The port-name element defines the WSDL port-name that a
- handler should be associated with. If port-name is not
- specified, the handler is assumed to be associated with
- all ports of the service.
-
- Not to be specified for JAX-WS runtime
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:group name="service-refGroup">
- <xsd:sequence>
- <xsd:element name="service-ref"
- type="javaee:service-refType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:key name="service-ref_handler-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the name of the handler. The name must be unique
- within the module.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:handler"/>
- <xsd:field xpath="javaee:handler-name"/>
- </xsd:key>
- </xsd:element>
- </xsd:sequence>
- </xsd:group>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_0.xsd
deleted file mode 100644
index 970a76d7df..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_0.xsd
+++ /dev/null
@@ -1,308 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
- <xsd:annotation>
- <xsd:documentation>
- @(#)jsp_2_0.xsds 1.17 03/18/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- This is the XML Schema for the JSP 2.0 deployment descriptor
- types. The JSP 2.0 schema contains all the special
- structures and datatypes that are necessary to use JSP files
- from a web application.
-
- The contents of this schema is used by the web-app_2_4.xsd
- file to define JSP specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-configType is used to provide global configuration
- information for the JSP files in a web application. It has
- two subelements, taglib and jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="taglib"
- type="j2ee:taglibType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="jsp-property-group"
- type="j2ee:jsp-property-groupType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-fileType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-file element contains the full path to a JSP file
- within the web application beginning with a `/'.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:pathType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-property-groupType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-property-groupType is used to group a number of
- files so they can be given global property information.
- All files so described are deemed to be JSP files. The
- following additional properties can be described:
-
- - Control whether EL is ignored
- - Control whether scripting elements are invalid
- - Indicate pageEncoding information.
- - Indicate that a resource is a JSP document (XML)
- - Prelude and Coda automatic includes.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="url-pattern"
- type="j2ee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:element name="el-ignored"
- type="j2ee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily set the isELIgnored
- property of a group of JSP pages. By default, the
- EL evaluation is enabled for Web Applications using
- a Servlet 2.4 or greater web.xml, and disabled
- otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="page-encoding"
- type="j2ee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The valid values of page-encoding are those of the
- pageEncoding page directive. It is a
- translation-time error to name different encodings
- in the pageEncoding attribute of the page directive
- of a JSP page and in a JSP configuration element
- matching the page. It is also a translation-time
- error to name different encodings in the prolog
- or text declaration of a document in XML syntax and
- in a JSP configuration element matching the document.
- It is legal to name the same encoding through
- mulitple mechanisms.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="scripting-invalid"
- type="j2ee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily disable scripting in a
- group of JSP pages. By default, scripting is
- enabled.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="is-xml"
- type="j2ee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- If true, denotes that the group of resources
- that match the URL pattern are JSP documents,
- and thus must be interpreted as XML documents.
- If false, the resources are assumed to not
- be JSP documents, unless there is another
- property group that indicates otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-prelude"
- type="j2ee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-prelude element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the beginning of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-coda"
- type="j2ee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-coda element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the end of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="taglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglibType defines the syntax for declaring in
- the deployment descriptor that a tag library is
- available to the application. This can be done
- to override implicit map entries from TLD files and
- from the container.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="taglib-uri"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- A taglib-uri element describes a URI identifying a
- tag library used in the web application. The body
- of the taglib-uri element may be either an
- absolute URI specification, or a relative URI.
- There should be no entries in web.xml with the
- same taglib-uri value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="taglib-location"
- type="j2ee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- the taglib-location element contains the location
- (as a resource relative to the root of the web
- application) where to find the Tag Library
- Description file for the tag library.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_1.xsd
deleted file mode 100644
index ab633886d9..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_1.xsd
+++ /dev/null
@@ -1,343 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.1">
- <xsd:annotation>
- <xsd:documentation>
- @(#)jsp_2_1.xsds 1.5 08/11/05
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- This is the XML Schema for the JSP 2.1 deployment descriptor
- types. The JSP 2.1 schema contains all the special
- structures and datatypes that are necessary to use JSP files
- from a web application.
-
- The contents of this schema is used by the web-app_2_5.xsd
- file to define JSP specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-configType is used to provide global configuration
- information for the JSP files in a web application. It has
- two subelements, taglib and jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="taglib"
- type="javaee:taglibType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="jsp-property-group"
- type="javaee:jsp-property-groupType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-fileType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-file element contains the full path to a JSP file
- within the web application beginning with a `/'.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:pathType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-property-groupType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-property-groupType is used to group a number of
- files so they can be given global property information.
- All files so described are deemed to be JSP files. The
- following additional properties can be described:
-
- - Control whether EL is ignored.
- - Control whether scripting elements are invalid.
- - Indicate pageEncoding information.
- - Indicate that a resource is a JSP document (XML).
- - Prelude and Coda automatic includes.
- - Control whether the character sequence #{ is allowed
- when used as a String literal.
- - Control whether template text containing only
- whitespaces must be removed from the response output.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:element name="el-ignored"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily set the isELIgnored
- property of a group of JSP pages. By default, the
- EL evaluation is enabled for Web Applications using
- a Servlet 2.4 or greater web.xml, and disabled
- otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="page-encoding"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The valid values of page-encoding are those of the
- pageEncoding page directive. It is a
- translation-time error to name different encodings
- in the pageEncoding attribute of the page directive
- of a JSP page and in a JSP configuration element
- matching the page. It is also a translation-time
- error to name different encodings in the prolog
- or text declaration of a document in XML syntax and
- in a JSP configuration element matching the document.
- It is legal to name the same encoding through
- mulitple mechanisms.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="scripting-invalid"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily disable scripting in a
- group of JSP pages. By default, scripting is
- enabled.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="is-xml"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- If true, denotes that the group of resources
- that match the URL pattern are JSP documents,
- and thus must be interpreted as XML documents.
- If false, the resources are assumed to not
- be JSP documents, unless there is another
- property group that indicates otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-prelude"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-prelude element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the beginning of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-coda"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-coda element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the end of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="deferred-syntax-allowed-as-literal"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The character sequence #{ is reserved for EL expressions.
- Consequently, a translation error occurs if the #{
- character sequence is used as a String literal, unless
- this element is enabled (true). Disabled (false) by
- default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-directive-whitespaces"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Indicates that template text containing only whitespaces
- must be removed from the response output. It has no
- effect on JSP documents (XML syntax). Disabled (false)
- by default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="taglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglibType defines the syntax for declaring in
- the deployment descriptor that a tag library is
- available to the application. This can be done
- to override implicit map entries from TLD files and
- from the container.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="taglib-uri"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- A taglib-uri element describes a URI identifying a
- tag library used in the web application. The body
- of the taglib-uri element may be either an
- absolute URI specification, or a relative URI.
- There should be no entries in web.xml with the
- same taglib-uri value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="taglib-location"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- the taglib-location element contains the location
- (as a resource relative to the root of the web
- application) where to find the Tag Library
- Description file for the tag library.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd
deleted file mode 100644
index fa41e4266f..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd
+++ /dev/null
@@ -1,389 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.2">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- This is the XML Schema for the JSP 2.2 deployment descriptor
- types. The JSP 2.2 schema contains all the special
- structures and datatypes that are necessary to use JSP files
- from a web application.
-
- The contents of this schema is used by the web-common_3_0.xsd
- file to define JSP specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-configType is used to provide global configuration
- information for the JSP files in a web application. It has
- two subelements, taglib and jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="taglib"
- type="javaee:taglibType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="jsp-property-group"
- type="javaee:jsp-property-groupType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-fileType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-file element contains the full path to a JSP file
- within the web application beginning with a `/'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:pathType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="jsp-property-groupType">
- <xsd:annotation>
- <xsd:documentation>
-
- The jsp-property-groupType is used to group a number of
- files so they can be given global property information.
- All files so described are deemed to be JSP files. The
- following additional properties can be described:
-
- - Control whether EL is ignored.
- - Control whether scripting elements are invalid.
- - Indicate pageEncoding information.
- - Indicate that a resource is a JSP document (XML).
- - Prelude and Coda automatic includes.
- - Control whether the character sequence #{ is allowed
- when used as a String literal.
- - Control whether template text containing only
- whitespaces must be removed from the response output.
- - Indicate the default contentType information.
- - Indicate the default buffering model for JspWriter
- - Control whether error should be raised for the use of
- undeclared namespaces in a JSP page.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:element name="el-ignored"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily set the isELIgnored
- property of a group of JSP pages. By default, the
- EL evaluation is enabled for Web Applications using
- a Servlet 2.4 or greater web.xml, and disabled
- otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="page-encoding"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The valid values of page-encoding are those of the
- pageEncoding page directive. It is a
- translation-time error to name different encodings
- in the pageEncoding attribute of the page directive
- of a JSP page and in a JSP configuration element
- matching the page. It is also a translation-time
- error to name different encodings in the prolog
- or text declaration of a document in XML syntax and
- in a JSP configuration element matching the document.
- It is legal to name the same encoding through
- mulitple mechanisms.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="scripting-invalid"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Can be used to easily disable scripting in a
- group of JSP pages. By default, scripting is
- enabled.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="is-xml"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- If true, denotes that the group of resources
- that match the URL pattern are JSP documents,
- and thus must be interpreted as XML documents.
- If false, the resources are assumed to not
- be JSP documents, unless there is another
- property group that indicates otherwise.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-prelude"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-prelude element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the beginning of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="include-coda"
- type="javaee:pathType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The include-coda element is a context-relative
- path that must correspond to an element in the
- Web Application. When the element is present,
- the given path will be automatically included (as
- in an include directive) at the end of each
- JSP page in this jsp-property-group.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="deferred-syntax-allowed-as-literal"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The character sequence #{ is reserved for EL expressions.
- Consequently, a translation error occurs if the #{
- character sequence is used as a String literal, unless
- this element is enabled (true). Disabled (false) by
- default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-directive-whitespaces"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Indicates that template text containing only whitespaces
- must be removed from the response output. It has no
- effect on JSP documents (XML syntax). Disabled (false)
- by default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-content-type"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The valid values of default-content-type are those of the
- contentType page directive. It specifies the default
- response contentType if the page directive does not include
- a contentType attribute.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="buffer"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The valid values of buffer are those of the
- buffer page directive. It specifies if buffering should be
- used for the output to response, and if so, the size of the
- buffer to use.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="error-on-undeclared-namespace"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The default behavior when a tag with unknown namespace is used
- in a JSP page (regular syntax) is to silently ignore it. If
- set to true, then an error must be raised during the translation
- time when an undeclared tag is used in a JSP page. Disabled
- (false) by default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="taglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglibType defines the syntax for declaring in
- the deployment descriptor that a tag library is
- available to the application. This can be done
- to override implicit map entries from TLD files and
- from the container.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="taglib-uri"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- A taglib-uri element describes a URI identifying a
- tag library used in the web application. The body
- of the taglib-uri element may be either an
- absolute URI specification, or a relative URI.
- There should be no entries in web.xml with the
- same taglib-uri value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="taglib-location"
- type="javaee:pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- the taglib-location element contains the location
- (as a resource relative to the root of the web
- application) where to find the Tag Library
- Description file for the tag library.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_1_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_1_0.xsd
deleted file mode 100644
index bfd9c7540d..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_1_0.xsd
+++ /dev/null
@@ -1,1562 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)orm_1_0.xsd 1.0 Feb 14 2006
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2005-2007 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the persistence object-relational
- mapping file.
- The file may be named "META-INF/orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:complexType name="emptyType"/>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of an mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query or named-native-query
- of the same name in the same or different mapping files in a
- persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="1.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified then
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables or secondary tables
- that apply to the persistence unit
- catalog - Used as the catalog for all tables or secondary tables
- that apply to the persistence unit
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="table" type="orm:table"
- minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value"
- minOccurs="0"/>
- <xsd:element name="discriminator-column"
- type="orm:discriminator-column"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"
- minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value"
- minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="attributes" type="orm:embeddable-attributes"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable-attributes">
- <xsd:sequence>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd
deleted file mode 100644
index 8fb6b37831..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd
+++ /dev/null
@@ -1,1940 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Java Persistence API object/relational mapping file schema -->
-<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)orm_2_0.xsd 2.0 October 1 2009
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
- Specification available from http://jcp.org/en/jsr/detail?id=317
-
- This copy of orm_2_0.xsd was originally copied from the Eclipse Runtime
- EclipseLink Project and is included here without modification.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the persistence object/relational
- mapping file.
- The file may be named "META-INF/orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
-
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://java.sun.com/xml/ns/persistence
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
- http://java.sun.com/xml/ns/persistence/orm/orm_2_0.xsd"
- version="2.0">
- ...
- </entity-mappings>
-
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:complexType name="emptyType"/>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of a mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="2.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- delimited-identifiers - Used to treat database identifiers as
- delimited identifiers.
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="table" type="orm:table"
- minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value"
- minOccurs="0"/>
- <xsd:element name="discriminator-column"
- type="orm:discriminator-column"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-detach" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column"
- type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="lob"
- type="orm:lob"
- minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="attributes" type="orm:embeddable-attributes"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embeddable-attributes">
- <xsd:sequence>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"
- minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value"
- minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- LockModeType lockMode() default NONE;
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_1_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_1_0.xsd
deleted file mode 100644
index a3a157d96e..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_1_0.xsd
+++ /dev/null
@@ -1,307 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- persistence.xml schema -->
-<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:persistence="http://java.sun.com/xml/ns/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)persistence_1_0.xsd 1.0 Feb 9 2006
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2005-2007 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the persistence configuration file.
- The file must be named "META-INF/persistence.xml" in the
- persistence archive.
- Persistence configuration files must indicate
- the persistence schema by using the persistence namespace:
-
- http://java.sun.com/xml/ns/persistence
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
- ...
- </persistence>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="persistence">
- <xsd:complexType>
- <xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:element name="persistence-unit"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- Configuration of a persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:element name="description" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Textual description of this persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="provider" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Provider class that supplies EntityManagers for this
- persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="jta-data-source" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-specific name of the JTA datasource to use.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="non-jta-data-source" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-specific name of a non-JTA datasource to use.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="mapping-file" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- File containing mapping information. Loaded as a resource
- by the persistence provider.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="jar-file" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Jar file that should be scanned for entities.
- Not applicable to Java SE persistence units.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Class to scan for annotations. It should be annotated
- with either @Entity, @Embeddable or @MappedSuperclass.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="exclude-unlisted-classes" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- When set to true then only listed classes and jars will
- be scanned for persistent classes, otherwise the enclosing
- jar or directory will also be scanned. Not applicable to
- Java SE persistence units.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="properties" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- A list of vendor-specific properties.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="property"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- A name-value pair.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required"/>
- <xsd:attribute name="value" type="xsd:string"
- use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:attribute name="name" type="xsd:string" use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- Name used in code to reference this persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- <!-- **************************************************** -->
-
- <xsd:attribute name="transaction-type"
- type="persistence:persistence-unit-transaction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- Type of transactions used by EntityManagers from this
- persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version" type="persistence:versionType"
- fixed="1.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="persistence-unit-transaction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TransactionType { JTA, RESOURCE_LOCAL };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="JTA"/>
- <xsd:enumeration value="RESOURCE_LOCAL"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd
deleted file mode 100644
index 8b13a02be4..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd
+++ /dev/null
@@ -1,357 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- persistence.xml schema -->
-<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:persistence="http://java.sun.com/xml/ns/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)persistence_2_0.xsd 1.0 October 1 2009
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
- Specification available from http://jcp.org/en/jsr/detail?id=317
-
- This copy of persistence_2_0.xsd was originally copied from the Eclipse Runtime
- EclipseLink Project and is included here without modification.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the persistence configuration file.
- The file must be named "META-INF/persistence.xml" in the
- persistence archive.
-
- Persistence configuration files must indicate
- the persistence schema by using the persistence namespace:
-
- http://java.sun.com/xml/ns/persistence
-
- and indicate the version of the schema by
- using the version element as shown below:
-
- <persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
- version="2.0">
- ...
- </persistence>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="persistence">
- <xsd:complexType>
- <xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:element name="persistence-unit"
- minOccurs="1" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- Configuration of a persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:element name="description" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Description of this persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="provider" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Provider class that supplies EntityManagers for this
- persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="jta-data-source" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-specific name of the JTA datasource to use.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="non-jta-data-source" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The container-specific name of a non-JTA datasource to use.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="mapping-file" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- File containing mapping information. Loaded as a resource
- by the persistence provider.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="jar-file" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Jar file that is to be scanned for managed classes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Managed class to be included in the persistence unit and
- to scan for annotations. It should be annotated
- with either @Entity, @Embeddable or @MappedSuperclass.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="exclude-unlisted-classes" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- When set to true then only listed classes and jars will
- be scanned for persistent classes, otherwise the
- enclosing jar or directory will also be scanned.
- Not applicable to Java SE persistence units.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="shared-cache-mode"
- type="persistence:persistence-unit-caching-type"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines whether caching is enabled for the
- persistence unit if caching is supported by the
- persistence provider. When set to ALL, all entities
- will be cached. When set to NONE, no entities will
- be cached. When set to ENABLE_SELECTIVE, only entities
- specified as cacheable will be cached. When set to
- DISABLE_SELECTIVE, entities specified as not cacheable
- will not be cached. When not specified or when set to
- UNSPECIFIED, provider defaults may apply.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:element name="validation-mode"
- type="persistence:persistence-unit-validation-mode-type"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The validation mode to be used for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
-
- <!-- **************************************************** -->
-
- <xsd:element name="properties" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- A list of standard and vendor-specific properties
- and hints.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="property"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- A name-value pair.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required"/>
- <xsd:attribute name="value" type="xsd:string"
- use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
-
- <!-- **************************************************** -->
-
- <xsd:attribute name="name" type="xsd:string" use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- Name used in code to reference this persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- <!-- **************************************************** -->
-
- <xsd:attribute name="transaction-type"
- type="persistence:persistence-unit-transaction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- Type of transactions used by EntityManagers from this
- persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version" type="persistence:versionType"
- fixed="2.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="persistence-unit-transaction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="JTA"/>
- <xsd:enumeration value="RESOURCE_LOCAL"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="persistence-unit-caching-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL"/>
- <xsd:enumeration value="NONE"/>
- <xsd:enumeration value="ENABLE_SELECTIVE"/>
- <xsd:enumeration value="DISABLE_SELECTIVE"/>
- <xsd:enumeration value="UNSPECIFIED"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="persistence-unit-validation-mode-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum ValidationMode { AUTO, CALLBACK, NONE};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="AUTO"/>
- <xsd:enumeration value="CALLBACK"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_2.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_2.dtd
deleted file mode 100644
index 5f439f42cd..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_2.dtd
+++ /dev/null
@@ -1,639 +0,0 @@
-<!--
-Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-Copyright 1999 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-The web-app element is the root of the deployment descriptor for
-a web application
--->
-
-<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
-context-param*, servlet*, servlet-mapping*, session-config?,
-mime-mapping*, welcome-file-list?, error-page*, taglib*,
-resource-ref*, security-constraint*, login-config?, security-role*,
-env-entry*, ejb-ref*)>
-
-<!--
-The icon element contains a small-icon and a large-icon element
-which specify the location within the web application for a small and
-large image used to represent the web application in a GUI tool. At a
-minimum, tools must accept GIF and JPEG format images.
--->
-
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The small-icon element contains the location within the web
-application of a file containing a small (16x16 pixel) icon image.
--->
-
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The large-icon element contains the location within the web
-application of a file containing a large (32x32 pixel) icon image.
--->
-
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended
-to be displayed by GUI tools
--->
-
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The description element is used to provide descriptive text about
-the parent element.
--->
-
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The distributable element, by its presence in a web application
-deployment descriptor, indicates that this web application is
-programmed appropriately to be deployed into a distributed servlet
-container
--->
-
-<!ELEMENT distributable EMPTY>
-
-<!--
-The context-param element contains the declaration of a web
-application's servlet context initialization parameters.
--->
-
-<!ELEMENT context-param (param-name, param-value, description?)>
-
-<!--
-The param-name element contains the name of a parameter.
--->
-
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-The param-value element contains the value of a parameter.
--->
-
-<!ELEMENT param-value (#PCDATA)>
-
-<!--
-The servlet element contains the declarative data of a
-servlet. If a jsp-file is specified and the load-on-startup element is
-present, then the JSP should be precompiled and loaded.
--->
-
-<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
-(servlet-class|jsp-file), init-param*, load-on-startup?, security-role-ref*)>
-
-<!--
-The servlet-name element contains the canonical name of the
-servlet.
--->
-
-<!ELEMENT servlet-name (#PCDATA)>
-
-<!--
-The servlet-class element contains the fully qualified class name
-of the servlet.
--->
-
-<!ELEMENT servlet-class (#PCDATA)>
-
-<!--
-The jsp-file element contains the full path to a JSP file within
-the web application.
--->
-
-<!ELEMENT jsp-file (#PCDATA)>
-
-<!--
-The init-param element contains a name/value pair as an
-initialization param of the servlet
--->
-
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-The load-on-startup element indicates that this servlet should be
-loaded on the startup of the web application. The optional contents of
-these element must be a positive integer indicating the order in which
-the servlet should be loaded. Lower integers are loaded before higher
-integers. If no value is specified, or if the value specified is not a
-positive integer, the container is free to load it at any time in the
-startup sequence.
--->
-
-<!ELEMENT load-on-startup (#PCDATA)>
-
-<!--
-The servlet-mapping element defines a mapping between a servlet
-and a url pattern
--->
-
-<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
-
-<!--
-The url-pattern element contains the url pattern of the
-mapping. Must follow the rules specified in Section 10 of the Servlet
-API Specification.
--->
-
-<!ELEMENT url-pattern (#PCDATA)>
-
-<!--
-The session-config element defines the session parameters for
-this web application.
--->
-
-<!ELEMENT session-config (session-timeout?)>
-
-<!--
-The session-timeout element defines the default session timeout
-interval for all sessions created in this web application. The
-specified timeout must be expressed in a whole number of minutes.
--->
-
-<!ELEMENT session-timeout (#PCDATA)>
-
-<!--
-The mime-mapping element defines a mapping between an extension
-and a mime type.
--->
-
-<!ELEMENT mime-mapping (extension, mime-type)>
-
-<!--
-The extension element contains a string describing an
-extension. example: "txt"
--->
-
-<!ELEMENT extension (#PCDATA)>
-
-<!--
-The mime-type element contains a defined mime type. example:
-"text/plain"
--->
-
-<!ELEMENT mime-type (#PCDATA)>
-
-<!--
-The welcome-file-list contains an ordered list of welcome files
-elements.
--->
-
-<!ELEMENT welcome-file-list (welcome-file+)>
-
-<!--
-The welcome-file element contains file name to use as a default
-welcome file, such as index.html
--->
-
-<!ELEMENT welcome-file (#PCDATA)>
-
-<!--
-The taglib element is used to describe a JSP tag library.
--->
-
-<!ELEMENT taglib (taglib-uri, taglib-location)>
-
-<!--
-The taglib-uri element describes a URI, relative to the location
-of the web.xml document, identifying a Tag Library used in the Web
-Application.
--->
-
-<!ELEMENT taglib-uri (#PCDATA)>
-
-<!--
-the taglib-location element contains the location (as a resource
-relative to the root of the web application) where to find the Tag
-Libary Description file for the tag library.
--->
-
-<!ELEMENT taglib-location (#PCDATA)>
-
-<!--
-The error-page element contains a mapping between an error code
-or exception type to the path of a resource in the web application
--->
-
-<!ELEMENT error-page ((error-code | exception-type), location)>
-
-<!--
-The error-code contains an HTTP error code, ex: 404
--->
-
-<!ELEMENT error-code (#PCDATA)>
-
-<!--
-The exception type contains a fully qualified class name of a
-Java exception type.
--->
-
-<!ELEMENT exception-type (#PCDATA)>
-
-<!--
-The location element contains the location of the resource in the
-web application
--->
-
-<!ELEMENT location (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of a Web
-Application's reference to an external resource.
--->
-
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)>
-
-<!--
-The res-ref-name element specifies the name of the resource
-factory reference name.
--->
-
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-type element specifies the (Java class) type of the data
-source.
--->
-
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The res-auth element indicates whether the application component
-code performs resource signon programmatically or whether the
-container signs onto the resource based on the principle mapping
-information supplied by the deployer. Must be CONTAINER or SERVLET
--->
-
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The security-constraint element is used to associate security
-constraints with one or more web resource collections
--->
-
-<!ELEMENT security-constraint (web-resource-collection+,
-auth-constraint?, user-data-constraint?)>
-
-<!--
-The web-resource-collection element is used to identify a subset
-of the resources and HTTP methods on those resources within a web
-application to which a security constraint applies. If no HTTP methods
-are specified, then the security constraint applies to all HTTP
-methods.
--->
-
-<!ELEMENT web-resource-collection (web-resource-name, description?,
-url-pattern*, http-method*)>
-
-<!--
-The web-resource-name contains the name of this web resource
-collection
--->
-
-<!ELEMENT web-resource-name (#PCDATA)>
-
-<!--
-The http-method contains an HTTP method (GET | POST |...)
--->
-
-<!ELEMENT http-method (#PCDATA)>
-
-<!--
-The user-data-constraint element is used to indicate how data
-communicated between the client and container should be protected
--->
-
-<!ELEMENT user-data-constraint (description?, transport-guarantee)>
-
-<!--
-The transport-guarantee element specifies that the communication
-between client and server should be NONE, INTEGRAL, or
-CONFIDENTIAL. NONE means that the application does not require any
-transport guarantees. A value of INTEGRAL means that the application
-requires that the data sent between the client and server be sent in
-such a way that it can't be changed in transit. CONFIDENTIAL means
-that the application requires that the data be transmitted in a
-fashion that prevents other entities from observing the contents of
-the transmission. In most cases, the presence of the INTEGRAL or
-CONFIDENTIAL flag will indicate that the use of SSL is required.
--->
-
-<!ELEMENT transport-guarantee (#PCDATA)>
-
-<!--
-The auth-constraint element indicates the user roles that should
-be permitted access to this resource collection. The role used here
-must appear in a security-role-ref element.
--->
-
-<!ELEMENT auth-constraint (description?, role-name*)>
-
-<!--
-The role-name element contains the name of a security role.
--->
-
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The login-config element is used to configure the authentication
-method that should be used, the realm name that should be used for
-this application, and the attributes that are needed by the form login
-mechanism.
--->
-
-<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
-
-<!--
-The realm name element specifies the realm name to use in HTTP
-Basic authorization
--->
-
-<!ELEMENT realm-name (#PCDATA)>
-
-<!--
-The form-login-config element specifies the login and error pages
-that should be used in form based login. If form based authentication
-is not used, these elements are ignored.
--->
-
-<!ELEMENT form-login-config (form-login-page, form-error-page)>
-
-<!--
-The form-login-page element defines the location in the web app
-where the page that can be used for login can be found
--->
-
-<!ELEMENT form-login-page (#PCDATA)>
-
-<!--
-The form-error-page element defines the location in the web app
-where the error page that is displayed when login is not successful
-can be found
--->
-
-<!ELEMENT form-error-page (#PCDATA)>
-
-<!--
-The auth-method element is used to configure the authentication
-mechanism for the web application. As a prerequisite to gaining access
-to any web resources which are protected by an authorization
-constraint, a user must have authenticated using the configured
-mechanism. Legal values for this element are "BASIC", "DIGEST",
-"FORM", or "CLIENT-CERT".
--->
-
-<!ELEMENT auth-method (#PCDATA)>
-
-<!--
-The security-role element contains the declaration of a security
-role which is used in the security-constraints placed on the web
-application.
--->
-
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The role-name element contains the name of a role. This element
-must contain a non-empty string.
--->
-
-<!ELEMENT security-role-ref (description?, role-name, role-link)>
-
-<!--
-The role-link element is used to link a security role reference
-to a defined security role. The role-link element must contain the
-name of one of the security roles defined in the security-role
-elements.
--->
-
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of an
-application's environment entry. This element is required to be
-honored on in J2EE compliant servlet containers.
--->
-
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
-env-entry-type)>
-
-<!--
-The env-entry-name contains the name of an application's
-environment entry
--->
-
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an
-application's environment entry
--->
-
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully qualified Java type
-of the environment entry value that is expected by the application
-code. The following are the legal values of env-entry-type:
-java.lang.Boolean, java.lang.String, java.lang.Integer,
-java.lang.Double, java.lang.Float.
--->
-
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The ejb-ref element is used to declare a reference to an
-enterprise bean.
--->
-
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote,
-ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB
-reference. This is the JNDI name that the servlet code uses to get a
-reference to the enterprise bean.
--->
-
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected java class type of
-the referenced EJB.
--->
-
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The ejb-home element contains the fully qualified name of the
-EJB's home interface
--->
-
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The ejb-remote element contains the fully qualified name of the
-EJB's remote interface
--->
-
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The ejb-link element is used in the ejb-ref element to specify
-that an EJB reference is linked to an EJB in an encompassing Java2
-Enterprise Edition (J2EE) application package. The value of the
-ejb-link element must be the ejb-name of and EJB in the J2EE
-application package.
--->
-
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools to easily make tool-specific
-references to the elements of the deployment descriptor. This allows
-tools that produce additional deployment information (i.e information
-beyond the standard deployment descriptor information) to store the
-non-standard information in a separate file, and easily refer from
-these tools-specific files to the information in the standard web-app
-deployment descriptor.
--->
-
-<!ATTLIST web-app id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST distributable id ID #IMPLIED>
-<!ATTLIST context-param id ID #IMPLIED>
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST servlet id ID #IMPLIED>
-<!ATTLIST servlet-name id ID #IMPLIED>
-<!ATTLIST servlet-class id ID #IMPLIED>
-<!ATTLIST jsp-file id ID #IMPLIED>
-<!ATTLIST init-param id ID #IMPLIED>
-<!ATTLIST load-on-startup id ID #IMPLIED>
-<!ATTLIST servlet-mapping id ID #IMPLIED>
-<!ATTLIST url-pattern id ID #IMPLIED>
-<!ATTLIST session-config id ID #IMPLIED>
-<!ATTLIST session-timeout id ID #IMPLIED>
-<!ATTLIST mime-mapping id ID #IMPLIED>
-<!ATTLIST extension id ID #IMPLIED>
-<!ATTLIST mime-type id ID #IMPLIED>
-<!ATTLIST welcome-file-list id ID #IMPLIED>
-<!ATTLIST welcome-file id ID #IMPLIED>
-<!ATTLIST taglib id ID #IMPLIED>
-<!ATTLIST taglib-uri id ID #IMPLIED>
-<!ATTLIST taglib-location id ID #IMPLIED>
-<!ATTLIST error-page id ID #IMPLIED>
-<!ATTLIST error-code id ID #IMPLIED>
-<!ATTLIST exception-type id ID #IMPLIED>
-<!ATTLIST location id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST security-constraint id ID #IMPLIED>
-<!ATTLIST web-resource-collection id ID #IMPLIED>
-<!ATTLIST web-resource-name id ID #IMPLIED>
-<!ATTLIST http-method id ID #IMPLIED>
-<!ATTLIST user-data-constraint id ID #IMPLIED>
-<!ATTLIST transport-guarantee id ID #IMPLIED>
-<!ATTLIST auth-constraint id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST login-config id ID #IMPLIED>
-<!ATTLIST realm-name id ID #IMPLIED>
-<!ATTLIST form-login-config id ID #IMPLIED>
-<!ATTLIST form-login-page id ID #IMPLIED>
-<!ATTLIST form-error-page id ID #IMPLIED>
-<!ATTLIST auth-method id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_3.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_3.dtd
deleted file mode 100644
index 5e3ab01c0f..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_3.dtd
+++ /dev/null
@@ -1,1063 +0,0 @@
-<!--
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, U.S.A.
-All rights reserved.
-
-Sun Microsystems, Inc. has intellectual property rights relating to
-technology embodied in the product that is described in this document.
-In particular, and without limitation, these intellectual property
-rights may include one or more of the U.S. patents listed at
-http://www.sun.com/patents and one or more additional patents or
-pending patent applications in the U.S. and in other countries.
-
-This document and the product to which it pertains are distributed
-under licenses restricting their use, copying, distribution, and
-decompilation. This document may be reproduced and distributed but may
-not be changed without prior written authorization of Sun and its
-licensors, if any.
-
-Third-party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and and
-Enterprise JavaBeans are trademarks or registered trademarks of Sun
-Microsystems, Inc. in the U.S. and other countries.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
-WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR
-NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
-DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
-
-
-_________________________________________________________________________
-
-Copyright (c) 2000 Sun Microsystems, Inc.,
-901 San Antonio Road,
-Palo Alto, California 94303, E'tats-Unis.
-Tous droits re'serve's.
-
-Sun Microsystems, Inc. a les droits de proprie'te' intellectuels
-relatants a` la technologie incorpore'e dans le produit qui est de'crit
-dans ce document. En particulier, et sans la limitation, ces droits de
-proprie'te' intellectuels peuvent inclure un ou plus des brevets
-ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les
-brevets plus supple'mentaires ou les applications de brevet en attente
-dans les E'tats-Unis et dans les autres pays.
-
-Ce produit ou document est prote'ge' par un copyright et distribue'
-avec des licences qui en restreignent l'utilisation, la copie, la
-distribution, et la de'compilation. Ce documention associe n peut
-e^tre reproduite et distribuer, par quelque moyen que ce soit, sans
-l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de
-licence, le cas e'che'ant.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright et
-licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail et and
-Enterprise JavaBeans sont des marques de fabrique ou des marques
-de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres
-pays.
-
-LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT
-EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS
-NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A
-L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE
-CONTREFAC,ON.
--->
-
-<!--
-This is the XML DTD for the Servlet 2.3 deployment descriptor.
-All Servlet 2.3 deployment descriptors must include a DOCTYPE
-of the following form:
-
- <!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The web-app element is the root of the deployment descriptor for
-a web application.
--->
-<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
-context-param*, filter*, filter-mapping*, listener*, servlet*,
-servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
-error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
-login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
-
-<!--
-The auth-constraint element indicates the user roles that should
-be permitted access to this resource collection. The role-name
-used here must either correspond to the role-name of one of the
-security-role elements defined for this web application, or be
-the specially reserved role-name "*" that is a compact syntax for
-indicating all roles in the web application. If both "*" and
-rolenames appear, the container interprets this as all roles.
-If no roles are defined, no user is allowed access to the portion of
-the web application described by the containing security-constraint.
-The container matches role names case sensitively when determining
-access.
-
-
-Used in: security-constraint
--->
-<!ELEMENT auth-constraint (description?, role-name*)>
-
-<!--
-The auth-method element is used to configure the authentication
-mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
-constraint, a user must have authenticated using the configured
-mechanism. Legal values for this element are "BASIC", "DIGEST",
-"FORM", or "CLIENT-CERT".
-
-Used in: login-config
--->
-<!ELEMENT auth-method (#PCDATA)>
-
-<!--
-The context-param element contains the declaration of a web
-application's servlet context initialization parameters.
-
-Used in: web-app
--->
-<!ELEMENT context-param (param-name, param-value, description?)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the web application war file producer wants to provide to the consumer of
-the web application war file (i.e., to the Deployer). Typically, the tools
-used by the web application war file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
-env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
-security-role, security-role-ref, servlet, user-data-constraint,
-web-app, web-resource-collection
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: filter, security-constraint, servlet, web-app
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The distributable element, by its presence in a web application
-deployment descriptor, indicates that this web application is
-programmed appropriately to be deployed into a distributed servlet
-container
-
-Used in: web-app
--->
-<!ELEMENT distributable EMPTY>
-
-<!--
-The ejb-link element is used in the ejb-ref or ejb-local-ref
-elements to specify that an EJB reference is linked to an
-enterprise bean.
-
-The name in the ejb-link element is composed of a
-path name specifying the ejb-jar containing the referenced enterprise
-bean with the ejb-name of the target bean appended and separated from
-the path name by "#". The path name is relative to the war file
-containing the web application that is referencing the enterprise bean.
-This allows multiple enterprise beans with the same ejb-name to be
-uniquely identified.
-
-Used in: ejb-local-ref, ejb-ref
-
-Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-local-ref element is used for the declaration of a reference to
-an enterprise bean's local home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the web application
- that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected local home and local interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
- local-home, local, ejb-link?)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-an enterprise bean's home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the web application that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected home and remote interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
- home, remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The
-EJB reference is an entry in the web application's environment and is
-relative to the java:comp/env context. The name must be unique
-within the web application.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-local-ref, ejb-ref
-
-Example:
-
-<ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the
-referenced enterprise bean.
-
-The ejb-ref-type element must be one of the following:
-
- <ejb-ref-type>Entity</ejb-ref-type>
- <ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-local-ref, ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of a web application's
-environment entry. The declaration consists of an optional
-description, the name of the environment entry, and an optional
-value. If a value is not specified, one must be supplied
-during deployment.
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
-env-entry-type)>
-
-<!--
-The env-entry-name element contains the name of a web applications's
-environment entry. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within a web application.
-
-Example:
-
-<env-entry-name>minAmount</env-entry-name>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the web application's
-code.
-
-The following are the legal values of env-entry-type:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of a web application's
-environment entry. The value must be a String that is valid for the
-constructor of the specified type that takes a single String
-parameter, or for java.lang.Character, a single character.
-
-Example:
-
-<env-entry-value>100.00</env-entry-value>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The error-code contains an HTTP error code, ex: 404
-
-Used in: error-page
--->
-<!ELEMENT error-code (#PCDATA)>
-
-<!--
-The error-page element contains a mapping between an error code
-or exception type to the path of a resource in the web application
-
-Used in: web-app
--->
-<!ELEMENT error-page ((error-code | exception-type), location)>
-
-<!--
-The exception type contains a fully qualified class name of a
-Java exception type.
-
-Used in: error-page
--->
-<!ELEMENT exception-type (#PCDATA)>
-
-<!--
-The extension element contains a string describing an
-extension. example: "txt"
-
-Used in: mime-mapping
--->
-<!ELEMENT extension (#PCDATA)>
-
-<!--
-Declares a filter in the web application. The filter is mapped to
-either a servlet or a URL pattern in the filter-mapping element, using
-the filter-name value to reference. Filters can access the
-initialization parameters declared in the deployment descriptor at
-runtime via the FilterConfig interface.
-
-Used in: web-app
--->
-<!ELEMENT filter (icon?, filter-name, display-name?, description?,
-filter-class, init-param*)>
-
-<!--
-The fully qualified classname of the filter.
-
-Used in: filter
--->
-<!ELEMENT filter-class (#PCDATA)>
-
-<!--
-Declaration of the filter mappings in this web application. The
-container uses the filter-mapping declarations to decide which filters
-to apply to a request, and in what order. The container matches the
-request URI to a Servlet in the normal way. To determine which filters
-to apply it matches filter-mapping declarations either on servlet-name,
-or on url-pattern for each filter-mapping element, depending on which
-style is used. The order in which filters are invoked is the order in
-which filter-mapping declarations that match a request URI for a
-servlet appear in the list of filter-mapping elements.The filter-name
-value must be the value of the <filter-name> sub-elements of one of the
-<filter> declarations in the deployment descriptor.
-
-Used in: web-app
--->
-<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
-
-<!--
-The logical name of the filter. This name is used to map the filter.
-Each filter name is unique within the web application.
-
-Used in: filter, filter-mapping
--->
-<!ELEMENT filter-name (#PCDATA)>
-
-<!--
-The form-error-page element defines the location in the web app
-where the error page that is displayed when login is not successful
-can be found. The path begins with a leading / and is interpreted
-relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-error-page (#PCDATA)>
-
-<!--
-The form-login-config element specifies the login and error pages
-that should be used in form based login. If form based authentication
-is not used, these elements are ignored.
-
-Used in: login-config
--->
-<!ELEMENT form-login-config (form-login-page, form-error-page)>
-
-<!--
-The form-login-page element defines the location in the web app
-where the page that can be used for login can be found. The path
-begins with a leading / and is interpreted relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-login-page (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref
-
-Example:
-
-<home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The http-method contains an HTTP method (GET | POST |...).
-
-Used in: web-resource-collection
--->
-<!ELEMENT http-method (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: filter, servlet, web-app
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The init-param element contains a name/value pair as an
-initialization param of the servlet
-
-Used in: filter, servlet
--->
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-The jsp-file element contains the full path to a JSP file within
-the web application beginning with a `/'.
-
-Used in: servlet
--->
-<!ELEMENT jsp-file (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The listener element indicates the deployment properties for a web
-application listener bean.
-
-Used in: web-app
--->
-<!ELEMENT listener (listener-class)>
-
-<!--
-The listener-class element declares a class in the application must be
-registered as a web application listener bean. The value is the fully qualified classname of the listener class.
-
-
-Used in: listener
--->
-<!ELEMENT listener-class (#PCDATA)>
-
-<!--
-The load-on-startup element indicates that this servlet should be
-loaded (instantiated and have its init() called) on the startup
-of the web application. The optional contents of
-these element must be an integer indicating the order in which
-the servlet should be loaded. If the value is a negative integer,
-or the element is not present, the container is free to load the
-servlet whenever it chooses. If the value is a positive integer
-or 0, the container must load and initialize the servlet as the
-application is deployed. The container must guarantee that
-servlets marked with lower integers are loaded before servlets
-marked with higher integers. The container may choose the order
-of loading of servlets with the same load-on-start-up value.
-
-Used in: servlet
--->
-<!ELEMENT load-on-startup (#PCDATA)>
-
-<!--
-
-The local element contains the fully-qualified name of the
-enterprise bean's local interface.
-
-Used in: ejb-local-ref
-
--->
-<!ELEMENT local (#PCDATA)>
-
-<!--
-
-The local-home element contains the fully-qualified name of the
-enterprise bean's local home interface.
-
-Used in: ejb-local-ref
--->
-<!ELEMENT local-home (#PCDATA)>
-
-<!--
-The location element contains the location of the resource in the web
-application relative to the root of the web application. The value of
-the location must have a leading `/'.
-
-Used in: error-page
--->
-<!ELEMENT location (#PCDATA)>
-
-<!--
-The login-config element is used to configure the authentication
-method that should be used, the realm name that should be used for
-this application, and the attributes that are needed by the form login
-mechanism.
-
-Used in: web-app
--->
-<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
-
-<!--
-The mime-mapping element defines a mapping between an extension
-and a mime type.
-
-Used in: web-app
--->
-<!ELEMENT mime-mapping (extension, mime-type)>
-
-<!--
-The mime-type element contains a defined mime type. example:
-"text/plain"
-
-Used in: mime-mapping
--->
-<!ELEMENT mime-type (#PCDATA)>
-
-<!--
-The param-name element contains the name of a parameter. Each parameter
-name must be unique in the web application.
-
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-The param-value element contains the value of a parameter.
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-value (#PCDATA)>
-
-<!--
-The realm name element specifies the realm name to use in HTTP
-Basic authorization.
-
-Used in: login-config
--->
-<!ELEMENT realm-name (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref
-
-Example:
-
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the web application code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the web application. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
-
- <res-auth>Application</res-auth>
- <res-auth>Container</res-auth>
-
-Used in: resource-ref
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within a web application.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-sharing-scope element specifies whether connections obtained
-through the given resource manager connection factory reference can be
-shared. The value of this element, if specified, must be one of the
-two following:
-
- <res-sharing-scope>Shareable</res-sharing-scope>
- <res-sharing-scope>Unshareable</res-sharing-scope>
-
-The default value is Shareable.
-
-Used in: resource-ref
--->
-<!ELEMENT res-sharing-scope (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type
-is specified by the fully qualified Java language class or interface
-expected to be implemented by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-env-ref element contains a declaration of a web application's
-reference to an administered object associated with a resource
-in the web application's environment. It consists of an optional
-description, the resource environment reference name, and an
-indication of the resource environment reference type expected by
-the web application code.
-
-Used in: web-app
-
-Example:
-
-<resource-env-ref>
- <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
-</resource-env-ref>
--->
-<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
- resource-env-ref-type)>
-
-<!--
-The resource-env-ref-name element specifies the name of a resource
-environment reference; its value is the environment entry name used in
-the web application code. The name is a JNDI name relative to the
-java:comp/env context and must be unique within a web application.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!--
-The resource-env-ref-type element specifies the type of a resource
-environment reference. It is the fully qualified name of a Java
-language class or interface.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of a web application's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type
-expected by the web application code, the type of authentication
-(Application or Container), and an optional specification of the
-shareability of connections obtained from the resource (Shareable or
-Unshareable).
-
-Used in: web-app
-
-Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
- res-sharing-scope?)>
-
-<!--
-The role-link element is a reference to a defined security role. The
-role-link element must contain the name of one of the security roles
-defined in the security-role elements.
-
-Used in: security-role-ref
--->
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: auth-constraint, run-as, security-role, security-role-ref
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The run-as element specifies the run-as identity to be used for the
-execution of the web application. It contains an optional description, and
-the name of a security role.
-
-Used in: servlet
--->
-<!ELEMENT run-as (description?, role-name)>
-
-<!--
-The security-constraint element is used to associate security
-constraints with one or more web resource collections
-
-Used in: web-app
--->
-<!ELEMENT security-constraint (display-name?, web-resource-collection+,
-auth-constraint?, user-data-constraint?)>
-
-<!--
-The security-role element contains the definition of a security
-role. The definition consists of an optional description of the
-security role, and the security role name.
-
-Used in: web-app
-
-Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The security-role-ref element contains the declaration of a security
-role reference in the web application's code. The declaration consists
-of an optional description, the security role name used in the code,
-and an optional link to a security role. If the security role is not
-specified, the Deployer must choose an appropriate security role.
-
-The value of the role-name element must be the String used as the
-parameter to the EJBContext.isCallerInRole(String roleName) method
-or the HttpServletRequest.isUserInRole(String role) method.
-
-Used in: servlet
-
--->
-<!ELEMENT security-role-ref (description?, role-name, role-link?)>
-
-<!--
-The servlet element contains the declarative data of a
-servlet. If a jsp-file is specified and the load-on-startup element is
-present, then the JSP should be precompiled and loaded.
-
-Used in: web-app
--->
-<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
-(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
-
-<!--
-The servlet-class element contains the fully qualified class name
-of the servlet.
-
-Used in: servlet
--->
-<!ELEMENT servlet-class (#PCDATA)>
-
-<!--
-The servlet-mapping element defines a mapping between a servlet
-and a url pattern
-
-Used in: web-app
--->
-<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
-
-<!--
-The servlet-name element contains the canonical name of the
-servlet. Each servlet name is unique within the web application.
-
-Used in: filter-mapping, servlet, servlet-mapping
--->
-<!ELEMENT servlet-name (#PCDATA)>
-
-<!--
-The session-config element defines the session parameters for
-this web application.
-
-Used in: web-app
--->
-<!ELEMENT session-config (session-timeout?)>
-
-<!--
-The session-timeout element defines the default session timeout
-interval for all sessions created in this web application. The
-specified timeout must be expressed in a whole number of minutes.
-If the timeout is 0 or less, the container ensures the default
-behaviour of sessions is never to time out.
-
-Used in: session-config
--->
-<!ELEMENT session-timeout (#PCDATA)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The taglib element is used to describe a JSP tag library.
-
-Used in: web-app
--->
-<!ELEMENT taglib (taglib-uri, taglib-location)>
-
-<!--
-the taglib-location element contains the location (as a resource
-relative to the root of the web application) where to find the Tag
-Libary Description file for the tag library.
-
-Used in: taglib
--->
-<!ELEMENT taglib-location (#PCDATA)>
-
-<!--
-The taglib-uri element describes a URI, relative to the location
-of the web.xml document, identifying a Tag Library used in the Web
-Application.
-
-Used in: taglib
--->
-<!ELEMENT taglib-uri (#PCDATA)>
-
-<!--
-The transport-guarantee element specifies that the communication
-between client and server should be NONE, INTEGRAL, or
-CONFIDENTIAL. NONE means that the application does not require any
-transport guarantees. A value of INTEGRAL means that the application
-requires that the data sent between the client and server be sent in
-such a way that it can't be changed in transit. CONFIDENTIAL means
-that the application requires that the data be transmitted in a
-fashion that prevents other entities from observing the contents of
-the transmission. In most cases, the presence of the INTEGRAL or
-CONFIDENTIAL flag will indicate that the use of SSL is required.
-
-Used in: user-data-constraint
--->
-<!ELEMENT transport-guarantee (#PCDATA)>
-
-<!--
-The url-pattern element contains the url pattern of the mapping. Must
-follow the rules specified in Section 11.2 of the Servlet API
-Specification.
-
-Used in: filter-mapping, servlet-mapping, web-resource-collection
--->
-<!ELEMENT url-pattern (#PCDATA)>
-
-<!--
-The user-data-constraint element is used to indicate how data
-communicated between the client and container should be protected.
-
-Used in: security-constraint
--->
-<!ELEMENT user-data-constraint (description?, transport-guarantee)>
-
-<!--
-The web-resource-collection element is used to identify a subset
-of the resources and HTTP methods on those resources within a web
-application to which a security constraint applies. If no HTTP methods
-are specified, then the security constraint applies to all HTTP
-methods.
-
-Used in: security-constraint
--->
-<!ELEMENT web-resource-collection (web-resource-name, description?,
-url-pattern*, http-method*)>
-
-<!--
-The web-resource-name contains the name of this web resource
-collection.
-
-Used in: web-resource-collection
--->
-<!ELEMENT web-resource-name (#PCDATA)>
-
-<!--
-The welcome-file element contains file name to use as a default
-welcome file, such as index.html
-
-Used in: welcome-file-list
--->
-<!ELEMENT welcome-file (#PCDATA)>
-
-<!--
-The welcome-file-list contains an ordered list of welcome files
-elements.
-
-Used in: web-app
--->
-<!ELEMENT welcome-file-list (welcome-file+)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST auth-constraint id ID #IMPLIED>
-<!ATTLIST auth-method id ID #IMPLIED>
-<!ATTLIST context-param id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST distributable id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-local-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST error-code id ID #IMPLIED>
-<!ATTLIST error-page id ID #IMPLIED>
-<!ATTLIST exception-type id ID #IMPLIED>
-<!ATTLIST extension id ID #IMPLIED>
-<!ATTLIST filter id ID #IMPLIED>
-<!ATTLIST filter-class id ID #IMPLIED>
-<!ATTLIST filter-mapping id ID #IMPLIED>
-<!ATTLIST filter-name id ID #IMPLIED>
-<!ATTLIST form-error-page id ID #IMPLIED>
-<!ATTLIST form-login-config id ID #IMPLIED>
-<!ATTLIST form-login-page id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST http-method id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST init-param id ID #IMPLIED>
-<!ATTLIST jsp-file id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST listener id ID #IMPLIED>
-<!ATTLIST listener-class id ID #IMPLIED>
-<!ATTLIST load-on-startup id ID #IMPLIED>
-<!ATTLIST local id ID #IMPLIED>
-<!ATTLIST local-home id ID #IMPLIED>
-<!ATTLIST location id ID #IMPLIED>
-<!ATTLIST login-config id ID #IMPLIED>
-<!ATTLIST mime-mapping id ID #IMPLIED>
-<!ATTLIST mime-type id ID #IMPLIED>
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST realm-name id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-sharing-scope id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-env-ref id ID #IMPLIED>
-<!ATTLIST resource-env-ref-name id ID #IMPLIED>
-<!ATTLIST resource-env-ref-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST run-as id ID #IMPLIED>
-<!ATTLIST security-constraint id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST servlet id ID #IMPLIED>
-<!ATTLIST servlet-class id ID #IMPLIED>
-<!ATTLIST servlet-mapping id ID #IMPLIED>
-<!ATTLIST servlet-name id ID #IMPLIED>
-<!ATTLIST session-config id ID #IMPLIED>
-<!ATTLIST session-timeout id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST taglib id ID #IMPLIED>
-<!ATTLIST taglib-location id ID #IMPLIED>
-<!ATTLIST taglib-uri id ID #IMPLIED>
-<!ATTLIST transport-guarantee id ID #IMPLIED>
-<!ATTLIST url-pattern id ID #IMPLIED>
-<!ATTLIST user-data-constraint id ID #IMPLIED>
-<!ATTLIST web-app id ID #IMPLIED>
-<!ATTLIST web-resource-collection id ID #IMPLIED>
-<!ATTLIST web-resource-name id ID #IMPLIED>
-<!ATTLIST welcome-file id ID #IMPLIED>
-<!ATTLIST welcome-file-list id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_4.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_4.xsd
deleted file mode 100644
index 79a25138e4..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_4.xsd
+++ /dev/null
@@ -1,1234 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.4">
- <xsd:annotation>
- <xsd:documentation>
- @(#)web-app_2_4.xsds 1.60 03/08/26
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2004 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the Servlet 2.4 deployment descriptor.
- The deployment descriptor must be named "WEB-INF/web.xml" in the
- web application's war file. All Servlet deployment descriptors
- must indicate the web application schema by using the J2EE
- namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="2.4">
- ...
- </web-app>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for J2EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all J2EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
- <xsd:include schemaLocation="jsp_2_0.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="web-app" type="j2ee:web-appType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-app element is the root of the deployment
- descriptor for a web application. Note that the sub-elements
- of this element can be in the arbitrary order. Because of
- that, the multiplicity of the elements of distributable,
- session-config, welcome-file-list, jsp-config, login-config,
- and locale-encoding-mapping-list was changed from "?" to "*"
- in this schema. However, the deployment descriptor instance
- file must not contain multiple elements of session-config,
- jsp-config, and login-config. When there are multiple elements of
- welcome-file-list or locale-encoding-mapping-list, the container
- must concatinate the element contents. The multiple occurance
- of the element distributable is redundant and the container
- treats that case exactly in the same way when there is only
- one distributable.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="web-app-servlet-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet element contains the name of a servlet.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:servlet"/>
- <xsd:field xpath="j2ee:servlet-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-filter-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The filter element contains the name of a filter.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:filter"/>
- <xsd:field xpath="j2ee:filter-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-local-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:ejb-ref"/>
- <xsd:field xpath="j2ee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-env-ref"/>
- <xsd:field xpath="j2ee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name of
- a message destination reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:message-destination-ref"/>
- <xsd:field xpath="j2ee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:resource-ref"/>
- <xsd:field xpath="j2ee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a web
- application's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name
- must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="j2ee:env-entry"/>
- <xsd:field xpath="j2ee:env-entry-name"/>
- </xsd:unique>
-
- <xsd:key name="web-app-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:security-role"/>
- <xsd:field xpath="j2ee:role-name"/>
- </xsd:key>
-
- <xsd:keyref name="web-app-role-name-references"
- refer="j2ee:web-app-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:servlet/j2ee:security-role-ref"/>
- <xsd:field xpath="j2ee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-constraintType indicates the user roles that
- should be permitted access to this resource
- collection. The role-name used here must either correspond
- to the role-name of one of the security-role elements
- defined for this web application, or be the specially
- reserved role-name "*" that is a compact syntax for
- indicating all roles in the web application. If both "*"
- and rolenames appear, the container interprets this as all
- roles. If no roles are defined, no user is allowed access
- to the portion of the web application described by the
- containing security-constraint. The container matches
- role names case sensitively when determining access.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="j2ee:role-nameType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-methodType is used to configure the authentication
- mechanism for the web application. As a prerequisite to
- gaining access to any web resources which are protected by
- an authorization constraint, a user must have authenticated
- using the configured mechanism. Legal values are "BASIC",
- "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
- authentication scheme.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="dispatcherType">
- <xsd:annotation>
- <xsd:documentation>
-
- The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
- and ERROR. A value of FORWARD means the Filter will be applied
- under RequestDispatcher.forward() calls. A value of REQUEST
- means the Filter will be applied under ordinary client calls to
- the path or servlet. A value of INCLUDE means the Filter will be
- applied under RequestDispatcher.include() calls. A value of
- ERROR means the Filter will be applied under the error page
- mechanism. The absence of any dispatcher elements in a
- filter-mapping indicates a default of applying filters only under
- ordinary client calls to the path or servlet.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="FORWARD"/>
- <xsd:enumeration value="INCLUDE"/>
- <xsd:enumeration value="REQUEST"/>
- <xsd:enumeration value="ERROR"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="encodingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The encodingType defines IANA character sets.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[^\s]+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-codeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-code contains an HTTP error code, ex: 404
-
- Used in: error-page
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdPositiveIntegerType">
- <xsd:pattern value="\d{3}"/>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-pageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-pageType contains a mapping between an error code
- or exception type to the path of a resource in the web
- application.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="error-code"
- type="j2ee:error-codeType"/>
-
- <xsd:element name="exception-type"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exception-type contains a fully qualified class
- name of a Java exception type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- <xsd:element name="location"
- type="j2ee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The location element contains the location of the
- resource in the web application relative to the root of
- the web application. The value of the location must have
- a leading `/'.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declaration of the filter mappings in this web
- application is done by using filter-mappingType.
- The container uses the filter-mapping
- declarations to decide which filters to apply to a request,
- and in what order. The container matches the request URI to
- a Servlet in the normal way. To determine which filters to
- apply it matches filter-mapping declarations either on
- servlet-name, or on url-pattern for each filter-mapping
- element, depending on which style is used. The order in
- which filters are invoked is the order in which
- filter-mapping declarations that match a request URI for a
- servlet appear in the list of filter-mapping elements.The
- filter-name value must be the value of the filter-name
- sub-elements of one of the filter declarations in the
- deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="filter-name"
- type="j2ee:filter-nameType"/>
- <xsd:choice>
- <xsd:element name="url-pattern"
- type="j2ee:url-patternType"/>
- <xsd:element name="servlet-name"
- type="j2ee:servlet-nameType"/>
- </xsd:choice>
- <xsd:element name="dispatcher"
- type="j2ee:dispatcherType"
- minOccurs="0" maxOccurs="4"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The logical name of the filter is declare
- by using filter-nameType. This name is used to map the
- filter. Each filter name is unique within the web
- application.
-
- Used in: filter, filter-mapping
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:extension base="j2ee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The filterType is used to declare a filter in the web
- application. The filter is mapped to either a servlet or a
- URL pattern in the filter-mapping element, using the
- filter-name value to reference. Filters can access the
- initialization parameters declared in the deployment
- descriptor at runtime via the FilterConfig interface.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="filter-name"
- type="j2ee:filter-nameType"/>
- <xsd:element name="filter-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully qualified classname of the filter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-param element contains a name/value pair as
- an initialization param of a servlet filter
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="form-login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-configType specifies the login and error
- pages that should be used in form based login. If form based
- authentication is not used, these elements are ignored.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:element name="form-login-page"
- type="j2ee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-page element defines the location in the web
- app where the page that can be used for login can be
- found. The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="form-error-page"
- type="j2ee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-error-page element defines the location in
- the web app where the error page that is displayed
- when login is not successful can be found.
- The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="http-methodType">
- <xsd:annotation>
-
- <xsd:documentation>
-
- The http-method contains an HTTP method recognized by the
- web-app, for example GET, POST, ...
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="GET"/>
- <xsd:enumeration value="POST"/>
- <xsd:enumeration value="PUT"/>
- <xsd:enumeration value="DELETE"/>
- <xsd:enumeration value="HEAD"/>
- <xsd:enumeration value="OPTIONS"/>
- <xsd:enumeration value="TRACE"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mapping-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping-list contains one or more
- locale-encoding-mapping(s).
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="locale-encoding-mapping"
- type="j2ee:locale-encoding-mappingType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping contains locale name and
- encoding name. The locale name must be either "Language-code",
- such as "ja", defined by ISO-639 or "Language-code_Country-code",
- such as "ja_JP". "Country code" is defined by ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="locale"
- type="j2ee:localeType"/>
- <xsd:element name="encoding"
- type="j2ee:encodingType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localeType defines valid locale defined by ISO-639-1
- and ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The login-configType is used to configure the authentication
- method that should be used, the realm name that should be
- used for this application, and the attributes that are
- needed by the form login mechanism.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="auth-method"
- type="j2ee:auth-methodType"
- minOccurs="0"/>
- <xsd:element name="realm-name"
- type="j2ee:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The realm name element specifies the realm name to
- use in HTTP Basic authorization.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="form-login-config"
- type="j2ee:form-login-configType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-mappingType defines a mapping between an extension
- and a mime type.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:annotation>
- <xsd:documentation>
-
- The extension element contains a string describing an
- extension. example: "txt"
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="extension"
- type="j2ee:string"/>
- <xsd:element name="mime-type"
- type="j2ee:mime-typeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-typeType is used to indicate a defined mime type.
-
- Example:
- "text/plain"
-
- Used in: mime-mapping
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="nonEmptyStringType">
- <xsd:annotation>
- <xsd:documentation>
- This type defines a string which contains at least one
- character.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:minLength value="1"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-constraintType is used to associate
- security constraints with one or more web resource
- collections
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="display-name"
- type="j2ee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="web-resource-collection"
- type="j2ee:web-resource-collectionType"
- maxOccurs="unbounded"/>
- <xsd:element name="auth-constraint"
- type="j2ee:auth-constraintType"
- minOccurs="0"/>
- <xsd:element name="user-data-constraint"
- type="j2ee:user-data-constraintType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-mappingType defines a mapping between a
- servlet and a url pattern.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="servlet-name"
- type="j2ee:servlet-nameType"/>
- <xsd:element name="url-pattern"
- type="j2ee:url-patternType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-name element contains the canonical name of the
- servlet. Each servlet name is unique within the web
- application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:extension base="j2ee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servletType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servletType is used to declare a servlet.
- It contains the declarative data of a
- servlet. If a jsp-file is specified and the load-on-startup
- element is present, then the JSP should be precompiled and
- loaded.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="servlet-name"
- type="j2ee:servlet-nameType"/>
- <xsd:choice>
- <xsd:element name="servlet-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-class element contains the fully
- qualified class name of the servlet.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="jsp-file"
- type="j2ee:jsp-fileType"/>
-
- </xsd:choice>
-
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="load-on-startup"
- type="j2ee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The load-on-startup element indicates that this
- servlet should be loaded (instantiated and have
- its init() called) on the startup of the web
- application. The optional contents of these
- element must be an integer indicating the order in
- which the servlet should be loaded. If the value
- is a negative integer, or the element is not
- present, the container is free to load the servlet
- whenever it chooses. If the value is a positive
- integer or 0, the container must load and
- initialize the servlet as the application is
- deployed. The container must guarantee that
- servlets marked with lower integers are loaded
- before servlets marked with higher integers. The
- container may choose the order of loading of
- servlets with the same load-on-start-up value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="run-as"
- type="j2ee:run-asType"
- minOccurs="0"/>
- <xsd:element name="security-role-ref"
- type="j2ee:security-role-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-configType defines the session parameters
- for this web application.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="session-timeout"
- type="j2ee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-timeout element defines the default
- session timeout interval for all sessions created
- in this web application. The specified timeout
- must be expressed in a whole number of minutes.
- If the timeout is 0 or less, the container ensures
- the default behaviour of sessions is never to time
- out. If this element is not specified, the container
- must set its default timeout period.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transport-guaranteeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transport-guaranteeType specifies that the communication
- between client and server should be NONE, INTEGRAL, or
- CONFIDENTIAL. NONE means that the application does not
- require any transport guarantees. A value of INTEGRAL means
- that the application requires that the data sent between the
- client and server be sent in such a way that it can't be
- changed in transit. CONFIDENTIAL means that the application
- requires that the data be transmitted in a fashion that
- prevents other entities from observing the contents of the
- transmission. In most cases, the presence of the INTEGRAL or
- CONFIDENTIAL flag will indicate that the use of SSL is
- required.
-
- Used in: user-data-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="NONE"/>
- <xsd:enumeration value="INTEGRAL"/>
- <xsd:enumeration value="CONFIDENTIAL"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="user-data-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The user-data-constraintType is used to indicate how
- data communicated between the client and container should be
- protected.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="transport-guarantee"
- type="j2ee:transport-guaranteeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate a path starting
- with a "/" and interpreted relative to the root of a WAR
- file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:pattern value="/.*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="web-app-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type contains the recognized versions of
- web-application supported. It is used to designate the
- version of the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="2.4"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-appType">
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="distributable"
- type="j2ee:emptyType"/>
- <xsd:element name="context-param"
- type="j2ee:param-valueType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The context-param element contains the declaration
- of a web application's servlet context
- initialization parameters.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="filter"
- type="j2ee:filterType"/>
- <xsd:element name="filter-mapping"
- type="j2ee:filter-mappingType"/>
- <xsd:element name="listener"
- type="j2ee:listenerType"/>
- <xsd:element name="servlet"
- type="j2ee:servletType"/>
- <xsd:element name="servlet-mapping"
- type="j2ee:servlet-mappingType"/>
- <xsd:element name="session-config"
- type="j2ee:session-configType"/>
- <xsd:element name="mime-mapping"
- type="j2ee:mime-mappingType"/>
- <xsd:element name="welcome-file-list"
- type="j2ee:welcome-file-listType"/>
- <xsd:element name="error-page"
- type="j2ee:error-pageType"/>
- <xsd:element name="jsp-config"
- type="j2ee:jsp-configType"/>
- <xsd:element name="security-constraint"
- type="j2ee:security-constraintType"/>
- <xsd:element name="login-config"
- type="j2ee:login-configType"/>
- <xsd:element name="security-role"
- type="j2ee:security-roleType"/>
- <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="message-destination"
- type="j2ee:message-destinationType"/>
- <xsd:element name="locale-encoding-mapping-list"
- type="j2ee:locale-encoding-mapping-listType"/>
- </xsd:choice>
-
- <xsd:attribute name="version"
- type="j2ee:web-app-versionType"
- use="required"/>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-resource-collectionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-collectionType is used to identify a subset
- of the resources and HTTP methods on those resources within
- a web application to which a security constraint applies. If
- no HTTP methods are specified, then the security constraint
- applies to all HTTP methods.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="web-resource-name"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-name contains the name of this web
- resource collection.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="url-pattern"
- type="j2ee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:element name="http-method"
- type="j2ee:http-methodType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="welcome-file-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file-list contains an ordered list of welcome
- files elements.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="welcome-file"
- type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file element contains file name to use
- as a default welcome file, such as index.html
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_5.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_5.xsd
deleted file mode 100644
index 8c0902e129..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_2_5.xsd
+++ /dev/null
@@ -1,1271 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.5">
- <xsd:annotation>
- <xsd:documentation>
- @(#)web-app_2_5.xsds 1.62 05/08/06
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the Servlet 2.5 deployment descriptor.
- The deployment descriptor must be named "WEB-INF/web.xml" in the
- web application's war file. All Servlet deployment descriptors
- must indicate the web application schema by using the Java EE
- namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="2.5">
- ...
- </web-app>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
- <xsd:include schemaLocation="jsp_2_1.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="web-app" type="javaee:web-appType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-app element is the root of the deployment
- descriptor for a web application. Note that the sub-elements
- of this element can be in the arbitrary order. Because of
- that, the multiplicity of the elements of distributable,
- session-config, welcome-file-list, jsp-config, login-config,
- and locale-encoding-mapping-list was changed from "?" to "*"
- in this schema. However, the deployment descriptor instance
- file must not contain multiple elements of session-config,
- jsp-config, and login-config. When there are multiple elements of
- welcome-file-list or locale-encoding-mapping-list, the container
- must concatenate the element contents. The multiple occurence
- of the element distributable is redundant and the container
- treats that case exactly in the same way when there is only
- one distributable.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="web-app-servlet-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet element contains the name of a servlet.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet"/>
- <xsd:field xpath="javaee:servlet-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-filter-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The filter element contains the name of a filter.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:filter"/>
- <xsd:field xpath="javaee:filter-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name of
- a message destination reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
-
- <xsd:unique name="web-app-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a web
- application's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name
- must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
-
- <xsd:key name="web-app-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:key>
-
- <xsd:keyref name="web-app-role-name-references"
- refer="javaee:web-app-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
- <xsd:field xpath="javaee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-constraintType indicates the user roles that
- should be permitted access to this resource
- collection. The role-name used here must either correspond
- to the role-name of one of the security-role elements
- defined for this web application, or be the specially
- reserved role-name "*" that is a compact syntax for
- indicating all roles in the web application. If both "*"
- and rolenames appear, the container interprets this as all
- roles. If no roles are defined, no user is allowed access
- to the portion of the web application described by the
- containing security-constraint. The container matches
- role names case sensitively when determining access.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-methodType is used to configure the authentication
- mechanism for the web application. As a prerequisite to
- gaining access to any web resources which are protected by
- an authorization constraint, a user must have authenticated
- using the configured mechanism. Legal values are "BASIC",
- "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
- authentication scheme.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="dispatcherType">
- <xsd:annotation>
- <xsd:documentation>
-
- The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
- and ERROR. A value of FORWARD means the Filter will be applied
- under RequestDispatcher.forward() calls. A value of REQUEST
- means the Filter will be applied under ordinary client calls to
- the path or servlet. A value of INCLUDE means the Filter will be
- applied under RequestDispatcher.include() calls. A value of
- ERROR means the Filter will be applied under the error page
- mechanism. The absence of any dispatcher elements in a
- filter-mapping indicates a default of applying filters only under
- ordinary client calls to the path or servlet.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="FORWARD"/>
- <xsd:enumeration value="INCLUDE"/>
- <xsd:enumeration value="REQUEST"/>
- <xsd:enumeration value="ERROR"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="encodingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The encodingType defines IANA character sets.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[^\s]+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-codeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-code contains an HTTP error code, ex: 404
-
- Used in: error-page
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdPositiveIntegerType">
- <xsd:pattern value="\d{3}"/>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-pageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-pageType contains a mapping between an error code
- or exception type to the path of a resource in the web
- application.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="error-code"
- type="javaee:error-codeType"/>
-
- <xsd:element name="exception-type"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exception-type contains a fully qualified class
- name of a Java exception type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- <xsd:element name="location"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The location element contains the location of the
- resource in the web application relative to the root of
- the web application. The value of the location must have
- a leading `/'.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declaration of the filter mappings in this web
- application is done by using filter-mappingType.
- The container uses the filter-mapping
- declarations to decide which filters to apply to a request,
- and in what order. The container matches the request URI to
- a Servlet in the normal way. To determine which filters to
- apply it matches filter-mapping declarations either on
- servlet-name, or on url-pattern for each filter-mapping
- element, depending on which style is used. The order in
- which filters are invoked is the order in which
- filter-mapping declarations that match a request URI for a
- servlet appear in the list of filter-mapping elements.The
- filter-name value must be the value of the filter-name
- sub-elements of one of the filter declarations in the
- deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="filter-name"
- type="javaee:filter-nameType"/>
- <xsd:choice minOccurs="1" maxOccurs="unbounded">
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"/>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- </xsd:choice>
- <xsd:element name="dispatcher"
- type="javaee:dispatcherType"
- minOccurs="0" maxOccurs="4"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The logical name of the filter is declare
- by using filter-nameType. This name is used to map the
- filter. Each filter name is unique within the web
- application.
-
- Used in: filter, filter-mapping
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The filterType is used to declare a filter in the web
- application. The filter is mapped to either a servlet or a
- URL pattern in the filter-mapping element, using the
- filter-name value to reference. Filters can access the
- initialization parameters declared in the deployment
- descriptor at runtime via the FilterConfig interface.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="filter-name"
- type="javaee:filter-nameType"/>
- <xsd:element name="filter-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully qualified classname of the filter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-param element contains a name/value pair as
- an initialization param of a servlet filter
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="form-login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-configType specifies the login and error
- pages that should be used in form based login. If form based
- authentication is not used, these elements are ignored.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:element name="form-login-page"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-page element defines the location in the web
- app where the page that can be used for login can be
- found. The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="form-error-page"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-error-page element defines the location in
- the web app where the error page that is displayed
- when login is not successful can be found.
- The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="http-methodType">
- <xsd:annotation>
-
- <xsd:documentation>
-
- A HTTP method type as defined in HTTP 1.1 section 2.2.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[&#33;-&#126;-[\(\)&#60;&#62;@,;:&#34;/\[\]?=\{\}\\\p{Z}]]+"/>
- </xsd:restriction>
-
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="load-on-startupType">
- <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mapping-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping-list contains one or more
- locale-encoding-mapping(s).
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="locale-encoding-mapping"
- type="javaee:locale-encoding-mappingType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping contains locale name and
- encoding name. The locale name must be either "Language-code",
- such as "ja", defined by ISO-639 or "Language-code_Country-code",
- such as "ja_JP". "Country code" is defined by ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="locale"
- type="javaee:localeType"/>
- <xsd:element name="encoding"
- type="javaee:encodingType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localeType defines valid locale defined by ISO-639-1
- and ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The login-configType is used to configure the authentication
- method that should be used, the realm name that should be
- used for this application, and the attributes that are
- needed by the form login mechanism.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="auth-method"
- type="javaee:auth-methodType"
- minOccurs="0"/>
- <xsd:element name="realm-name"
- type="javaee:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The realm name element specifies the realm name to
- use in HTTP Basic authorization.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="form-login-config"
- type="javaee:form-login-configType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-mappingType defines a mapping between an extension
- and a mime type.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:annotation>
- <xsd:documentation>
-
- The extension element contains a string describing an
- extension. example: "txt"
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="extension"
- type="javaee:string"/>
- <xsd:element name="mime-type"
- type="javaee:mime-typeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-typeType is used to indicate a defined mime type.
-
- Example:
- "text/plain"
-
- Used in: mime-mapping
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="nonEmptyStringType">
- <xsd:annotation>
- <xsd:documentation>
- This type defines a string which contains at least one
- character.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:minLength value="1"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="null-charType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value=""/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-constraintType is used to associate
- security constraints with one or more web resource
- collections
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="web-resource-collection"
- type="javaee:web-resource-collectionType"
- maxOccurs="unbounded"/>
- <xsd:element name="auth-constraint"
- type="javaee:auth-constraintType"
- minOccurs="0"/>
- <xsd:element name="user-data-constraint"
- type="javaee:user-data-constraintType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-mappingType defines a mapping between a
- servlet and a url pattern.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-name element contains the canonical name of the
- servlet. Each servlet name is unique within the web
- application.
- The special servlet name of "*" may be used to reference all
- servlets.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servletType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servletType is used to declare a servlet.
- It contains the declarative data of a
- servlet. If a jsp-file is specified and the load-on-startup
- element is present, then the JSP should be precompiled and
- loaded.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- <xsd:choice>
- <xsd:element name="servlet-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-class element contains the fully
- qualified class name of the servlet.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="jsp-file"
- type="javaee:jsp-fileType"/>
-
- </xsd:choice>
-
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="load-on-startup"
- type="javaee:load-on-startupType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The load-on-startup element indicates that this
- servlet should be loaded (instantiated and have
- its init() called) on the startup of the web
- application. The optional contents of these
- element must be an integer indicating the order in
- which the servlet should be loaded. If the value
- is a negative integer, or the element is not
- present, the container is free to load the servlet
- whenever it chooses. If the value is a positive
- integer or 0, the container must load and
- initialize the servlet as the application is
- deployed. The container must guarantee that
- servlets marked with lower integers are loaded
- before servlets marked with higher integers. The
- container may choose the order of loading of
- servlets with the same load-on-start-up value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="run-as"
- type="javaee:run-asType"
- minOccurs="0"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-configType defines the session parameters
- for this web application.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="session-timeout"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-timeout element defines the default
- session timeout interval for all sessions created
- in this web application. The specified timeout
- must be expressed in a whole number of minutes.
- If the timeout is 0 or less, the container ensures
- the default behaviour of sessions is never to time
- out. If this element is not specified, the container
- must set its default timeout period.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transport-guaranteeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transport-guaranteeType specifies that the communication
- between client and server should be NONE, INTEGRAL, or
- CONFIDENTIAL. NONE means that the application does not
- require any transport guarantees. A value of INTEGRAL means
- that the application requires that the data sent between the
- client and server be sent in such a way that it can't be
- changed in transit. CONFIDENTIAL means that the application
- requires that the data be transmitted in a fashion that
- prevents other entities from observing the contents of the
- transmission. In most cases, the presence of the INTEGRAL or
- CONFIDENTIAL flag will indicate that the use of SSL is
- required.
-
- Used in: user-data-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NONE"/>
- <xsd:enumeration value="INTEGRAL"/>
- <xsd:enumeration value="CONFIDENTIAL"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="user-data-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The user-data-constraintType is used to indicate how
- data communicated between the client and container should be
- protected.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="transport-guarantee"
- type="javaee:transport-guaranteeType"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate a path starting
- with a "/" and interpreted relative to the root of a WAR
- file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="/.*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="web-app-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type contains the recognized versions of
- web-application supported. It is used to designate the
- version of the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="2.5"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-appType">
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="distributable"
- type="javaee:emptyType"/>
- <xsd:element name="context-param"
- type="javaee:param-valueType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The context-param element contains the declaration
- of a web application's servlet context
- initialization parameters.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="filter"
- type="javaee:filterType"/>
- <xsd:element name="filter-mapping"
- type="javaee:filter-mappingType"/>
- <xsd:element name="listener"
- type="javaee:listenerType"/>
- <xsd:element name="servlet"
- type="javaee:servletType"/>
- <xsd:element name="servlet-mapping"
- type="javaee:servlet-mappingType"/>
- <xsd:element name="session-config"
- type="javaee:session-configType"/>
- <xsd:element name="mime-mapping"
- type="javaee:mime-mappingType"/>
- <xsd:element name="welcome-file-list"
- type="javaee:welcome-file-listType"/>
- <xsd:element name="error-page"
- type="javaee:error-pageType"/>
- <xsd:element name="jsp-config"
- type="javaee:jsp-configType"/>
- <xsd:element name="security-constraint"
- type="javaee:security-constraintType"/>
- <xsd:element name="login-config"
- type="javaee:login-configType"/>
- <xsd:element name="security-role"
- type="javaee:security-roleType"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"/>
- <xsd:element name="locale-encoding-mapping-list"
- type="javaee:locale-encoding-mapping-listType"/>
- </xsd:choice>
-
- <xsd:attribute name="version"
- type="javaee:web-app-versionType"
- use="required"/>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- <xsd:attribute name="metadata-complete" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-resource-collectionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-collectionType is used to identify a subset
- of the resources and HTTP methods on those resources within
- a web application to which a security constraint applies. If
- no HTTP methods are specified, then the security constraint
- applies to all HTTP methods.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="web-resource-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-name contains the name of this web
- resource collection.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:element name="http-method"
- type="javaee:http-methodType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="welcome-file-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file-list contains an ordered list of welcome
- files elements.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="welcome-file"
- type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file element contains file name to use
- as a default welcome file, such as index.html
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd
deleted file mode 100644
index bbcdf43cd3..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd
+++ /dev/null
@@ -1,272 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="3.0">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the Servlet 3.0 deployment descriptor.
- The deployment descriptor must be named "WEB-INF/web.xml" in the
- web application's war file. All Servlet deployment descriptors
- must indicate the web application schema by using the Java EE
- namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="3.0">
- ...
- </web-app>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="web-common_3_0.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="web-app"
- type="javaee:web-appType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-app element is the root of the deployment
- descriptor for a web application. Note that the sub-elements
- of this element can be in the arbitrary order. Because of
- that, the multiplicity of the elements of distributable,
- session-config, welcome-file-list, jsp-config, login-config,
- and locale-encoding-mapping-list was changed from "?" to "*"
- in this schema. However, the deployment descriptor instance
- file must not contain multiple elements of session-config,
- jsp-config, and login-config. When there are multiple elements of
- welcome-file-list or locale-encoding-mapping-list, the container
- must concatenate the element contents. The multiple occurence
- of the element distributable is redundant and the container
- treats that case exactly in the same way when there is only
- one distributable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="web-common-servlet-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet element contains the name of a servlet.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet"/>
- <xsd:field xpath="javaee:servlet-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-filter-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The filter element contains the name of a filter.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:filter"/>
- <xsd:field xpath="javaee:filter-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name of
- a message destination reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a web
- application's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name
- must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- <xsd:key name="web-common-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:key>
- <xsd:keyref name="web-common-role-name-references"
- refer="javaee:web-common-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
- <xsd:field xpath="javaee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd
deleted file mode 100644
index f994bc2c65..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd
+++ /dev/null
@@ -1,1575 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="3.0">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the common XML Schema for the Servlet 3.0 deployment descriptor.
- This file is in turn used by web.xml and web-fragment.xml
- web application's war file. All Servlet deployment descriptors
- must indicate the web common schema by using the Java EE
- namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="3.0">
- ...
- </web-app>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_6.xsd"/>
-
- <xsd:include schemaLocation="jsp_2_2.xsd"/>
-
- <xsd:group name="web-commonType">
- <xsd:choice>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="distributable"
- type="javaee:emptyType"/>
- <xsd:element name="context-param"
- type="javaee:param-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The context-param element contains the declaration
- of a web application's servlet context
- initialization parameters.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="filter"
- type="javaee:filterType"/>
- <xsd:element name="filter-mapping"
- type="javaee:filter-mappingType"/>
- <xsd:element name="listener"
- type="javaee:listenerType"/>
- <xsd:element name="servlet"
- type="javaee:servletType"/>
- <xsd:element name="servlet-mapping"
- type="javaee:servlet-mappingType"/>
- <xsd:element name="session-config"
- type="javaee:session-configType"/>
- <xsd:element name="mime-mapping"
- type="javaee:mime-mappingType"/>
- <xsd:element name="welcome-file-list"
- type="javaee:welcome-file-listType"/>
- <xsd:element name="error-page"
- type="javaee:error-pageType"/>
- <xsd:element name="jsp-config"
- type="javaee:jsp-configType"/>
- <xsd:element name="security-constraint"
- type="javaee:security-constraintType"/>
- <xsd:element name="login-config"
- type="javaee:login-configType"/>
- <xsd:element name="security-role"
- type="javaee:security-roleType"/>
- <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
- <xsd:element name="message-destination"
- type="javaee:message-destinationType"/>
- <xsd:element name="locale-encoding-mapping-list"
- type="javaee:locale-encoding-mapping-listType"/>
- </xsd:choice>
- </xsd:group>
-
- <xsd:attributeGroup name="web-common-attributes">
- <xsd:attribute name="version"
- type="javaee:web-app-versionType"
- use="required"/>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- <xsd:attribute name="metadata-complete"
- type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- deployment descriptor and other related deployment
- descriptors for this module (e.g., web service
- descriptors) are complete, or whether the class
- files available to this module and packaged with
- this application should be examined for annotations
- that specify deployment information.
-
- If metadata-complete is set to "true", the deployment
- tool must ignore any annotations that specify deployment
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the deployment tool must examine the class
- files of the application for annotations, as
- specified by the specifications.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:attributeGroup>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-appType">
- <xsd:choice minOccurs="0"
- maxOccurs="unbounded">
- <xsd:element name="module-name"
- type="javaee:string"
- minOccurs="0"/>
- <xsd:group ref="javaee:web-commonType"/>
- <xsd:element name="absolute-ordering"
- type="javaee:absoluteOrderingType"/>
- </xsd:choice>
- <xsd:attributeGroup ref="javaee:web-common-attributes"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-fragmentType">
- <xsd:choice minOccurs="0"
- maxOccurs="unbounded">
- <xsd:element name="name"
- type="javaee:java-identifierType"/>
- <xsd:group ref="javaee:web-commonType"/>
- <xsd:element name="ordering"
- type="javaee:orderingType"/>
- </xsd:choice>
- <xsd:attributeGroup ref="javaee:web-common-attributes"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-constraintType indicates the user roles that
- should be permitted access to this resource
- collection. The role-name used here must either correspond
- to the role-name of one of the security-role elements
- defined for this web application, or be the specially
- reserved role-name "*" that is a compact syntax for
- indicating all roles in the web application. If both "*"
- and rolenames appear, the container interprets this as all
- roles. If no roles are defined, no user is allowed access
- to the portion of the web application described by the
- containing security-constraint. The container matches
- role names case sensitively when determining access.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="role-name"
- type="javaee:role-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="auth-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- The auth-methodType is used to configure the authentication
- mechanism for the web application. As a prerequisite to
- gaining access to any web resources which are protected by
- an authorization constraint, a user must have authenticated
- using the configured mechanism. Legal values are "BASIC",
- "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
- authentication scheme.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="dispatcherType">
- <xsd:annotation>
- <xsd:documentation>
-
- The dispatcher has five legal values: FORWARD, REQUEST,
- INCLUDE, ASYNC, and ERROR.
-
- A value of FORWARD means the Filter will be applied under
- RequestDispatcher.forward() calls.
- A value of REQUEST means the Filter will be applied under
- ordinary client calls to the path or servlet.
- A value of INCLUDE means the Filter will be applied under
- RequestDispatcher.include() calls.
- A value of ASYNC means the Filter will be applied under
- calls dispatched from an AsyncContext.
- A value of ERROR means the Filter will be applied under the
- error page mechanism.
-
- The absence of any dispatcher elements in a filter-mapping
- indicates a default of applying filters only under ordinary
- client calls to the path or servlet.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="FORWARD"/>
- <xsd:enumeration value="INCLUDE"/>
- <xsd:enumeration value="REQUEST"/>
- <xsd:enumeration value="ASYNC"/>
- <xsd:enumeration value="ERROR"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-codeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-code contains an HTTP error code, ex: 404
-
- Used in: error-page
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdPositiveIntegerType">
- <xsd:pattern value="\d{3}"/>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="error-pageType">
- <xsd:annotation>
- <xsd:documentation>
-
- The error-pageType contains a mapping between an error code
- or exception type to the path of a resource in the web
- application.
-
- Error-page declarations using the exception-type element in
- the deployment descriptor must be unique up to the class name of
- the exception-type. Similarly, error-page declarations using the
- status-code element must be unique in the deployment descriptor
- up to the status code.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice minOccurs="0"
- maxOccurs="1">
- <xsd:element name="error-code"
- type="javaee:error-codeType"/>
- <xsd:element name="exception-type"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The exception-type contains a fully qualified class
- name of a Java exception type.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="location"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The location element contains the location of the
- resource in the web application relative to the root of
- the web application. The value of the location must have
- a leading `/'.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The filterType is used to declare a filter in the web
- application. The filter is mapped to either a servlet or a
- URL pattern in the filter-mapping element, using the
- filter-name value to reference. Filters can access the
- initialization parameters declared in the deployment
- descriptor at runtime via the FilterConfig interface.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="filter-name"
- type="javaee:filter-nameType"/>
- <xsd:element name="filter-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully qualified classname of the filter.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="async-supported"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-param element contains a name/value pair as
- an initialization param of a servlet filter
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Declaration of the filter mappings in this web
- application is done by using filter-mappingType.
- The container uses the filter-mapping
- declarations to decide which filters to apply to a request,
- and in what order. The container matches the request URI to
- a Servlet in the normal way. To determine which filters to
- apply it matches filter-mapping declarations either on
- servlet-name, or on url-pattern for each filter-mapping
- element, depending on which style is used. The order in
- which filters are invoked is the order in which
- filter-mapping declarations that match a request URI for a
- servlet appear in the list of filter-mapping elements.The
- filter-name value must be the value of the filter-name
- sub-elements of one of the filter declarations in the
- deployment descriptor.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="filter-name"
- type="javaee:filter-nameType"/>
- <xsd:choice minOccurs="1"
- maxOccurs="unbounded">
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"/>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- </xsd:choice>
- <xsd:element name="dispatcher"
- type="javaee:dispatcherType"
- minOccurs="0"
- maxOccurs="5"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="nonEmptyStringType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines a string which contains at least one
- character.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:minLength value="1"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="filter-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The logical name of the filter is declare
- by using filter-nameType. This name is used to map the
- filter. Each filter name is unique within the web
- application.
-
- Used in: filter, filter-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="form-login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-configType specifies the login and error
- pages that should be used in form based login. If form based
- authentication is not used, these elements are ignored.
-
- Used in: login-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="form-login-page"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-login-page element defines the location in the web
- app where the page that can be used for login can be
- found. The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="form-error-page"
- type="javaee:war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The form-error-page element defines the location in
- the web app where the error page that is displayed
- when login is not successful can be found.
- The path begins with a leading / and is interpreted
- relative to the root of the WAR.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:simpleType name="http-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- A HTTP method type as defined in HTTP 1.1 section 2.2.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[!-~-[\(\)&#60;&#62;@,;:&#34;/\[\]?=\{\}\\\p{Z}]]+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="load-on-startupType">
- <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
- </xsd:simpleType>
-
- <xsd:simpleType name="null-charType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value=""/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="login-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The login-configType is used to configure the authentication
- method that should be used, the realm name that should be
- used for this application, and the attributes that are
- needed by the form login mechanism.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="auth-method"
- type="javaee:auth-methodType"
- minOccurs="0"/>
- <xsd:element name="realm-name"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The realm name element specifies the realm name to
- use in HTTP Basic authorization.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="form-login-config"
- type="javaee:form-login-configType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-mappingType defines a mapping between an extension
- and a mime type.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:annotation>
- <xsd:documentation>
-
- The extension element contains a string describing an
- extension. example: "txt"
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:element name="extension"
- type="javaee:string"/>
- <xsd:element name="mime-type"
- type="javaee:mime-typeType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mime-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The mime-typeType is used to indicate a defined mime type.
-
- Example:
- "text/plain"
-
- Used in: mime-mapping
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="security-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The security-constraintType is used to associate
- security constraints with one or more web resource
- collections
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="display-name"
- type="javaee:display-nameType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="web-resource-collection"
- type="javaee:web-resource-collectionType"
- maxOccurs="unbounded"/>
- <xsd:element name="auth-constraint"
- type="javaee:auth-constraintType"
- minOccurs="0"/>
- <xsd:element name="user-data-constraint"
- type="javaee:user-data-constraintType"
- minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servletType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servletType is used to declare a servlet.
- It contains the declarative data of a
- servlet. If a jsp-file is specified and the load-on-startup
- element is present, then the JSP should be precompiled and
- loaded.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- <xsd:choice minOccurs="0"
- maxOccurs="1">
- <xsd:element name="servlet-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-class element contains the fully
- qualified class name of the servlet.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jsp-file"
- type="javaee:jsp-fileType"/>
- </xsd:choice>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="load-on-startup"
- type="javaee:load-on-startupType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The load-on-startup element indicates that this
- servlet should be loaded (instantiated and have
- its init() called) on the startup of the web
- application. The optional contents of these
- element must be an integer indicating the order in
- which the servlet should be loaded. If the value
- is a negative integer, or the element is not
- present, the container is free to load the servlet
- whenever it chooses. If the value is a positive
- integer or 0, the container must load and
- initialize the servlet as the application is
- deployed. The container must guarantee that
- servlets marked with lower integers are loaded
- before servlets marked with higher integers. The
- container may choose the order of loading of
- servlets with the same load-on-start-up value.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enabled"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="async-supported"
- type="javaee:true-falseType"
- minOccurs="0"/>
- <xsd:element name="run-as"
- type="javaee:run-asType"
- minOccurs="0"/>
- <xsd:element name="security-role-ref"
- type="javaee:security-role-refType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="multipart-config"
- type="javaee:multipart-configType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-mappingType defines a mapping between a
- servlet and a url pattern.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="servlet-name"
- type="javaee:servlet-nameType"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- minOccurs="1"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="servlet-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet-name element contains the canonical name of the
- servlet. Each servlet name is unique within the web
- application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="session-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-configType defines the session parameters
- for this web application.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="session-timeout"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The session-timeout element defines the default
- session timeout interval for all sessions created
- in this web application. The specified timeout
- must be expressed in a whole number of minutes.
- If the timeout is 0 or less, the container ensures
- the default behaviour of sessions is never to time
- out. If this element is not specified, the container
- must set its default timeout period.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cookie-config"
- type="javaee:cookie-configType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The cookie-config element defines the configuration of the
- session tracking cookies created by this web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="tracking-mode"
- type="javaee:tracking-modeType"
- minOccurs="0"
- maxOccurs="3">
- <xsd:annotation>
- <xsd:documentation>
-
- The tracking-mode element defines the tracking modes
- for sessions created by this web application
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cookie-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The cookie-configType defines the configuration for the
- session tracking cookies of this web application.
-
- Used in: session-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name"
- type="javaee:cookie-nameType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The name that will be assigned to any session tracking
- cookies created by this web application.
- The default is JSESSIONID
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="domain"
- type="javaee:cookie-domainType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The domain name that will be assigned to any session tracking
- cookies created by this web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="path"
- type="javaee:cookie-pathType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The path that will be assigned to any session tracking
- cookies created by this web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="comment"
- type="javaee:cookie-commentType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The comment that will be assigned to any session tracking
- cookies created by this web application.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="http-only"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies whether any session tracking cookies created
- by this web application will be marked as HttpOnly
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="secure"
- type="javaee:true-falseType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies whether any session tracking cookies created
- by this web application will be marked as secure
- even if the request that initiated the corresponding session
- is using plain HTTP instead of HTTPS
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-age"
- type="javaee:xsdIntegerType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The lifetime (in seconds) that will be assigned to any
- session tracking cookies created by this web application.
- Default is -1
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cookie-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name that will be assigned to any session tracking
- cookies created by this web application.
- The default is JSESSIONID
-
- Used in: cookie-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cookie-domainType">
- <xsd:annotation>
- <xsd:documentation>
-
- The domain name that will be assigned to any session tracking
- cookies created by this web application.
-
- Used in: cookie-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cookie-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The path that will be assigned to any session tracking
- cookies created by this web application.
-
- Used in: cookie-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="cookie-commentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The comment that will be assigned to any session tracking
- cookies created by this web application.
-
- Used in: cookie-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:nonEmptyStringType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tracking-modeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The tracking modes for sessions created by this web
- application
-
- Used in: session-config
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="COOKIE"/>
- <xsd:enumeration value="URL"/>
- <xsd:enumeration value="SSL"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transport-guaranteeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The transport-guaranteeType specifies that the communication
- between client and server should be NONE, INTEGRAL, or
- CONFIDENTIAL. NONE means that the application does not
- require any transport guarantees. A value of INTEGRAL means
- that the application requires that the data sent between the
- client and server be sent in such a way that it can't be
- changed in transit. CONFIDENTIAL means that the application
- requires that the data be transmitted in a fashion that
- prevents other entities from observing the contents of the
- transmission. In most cases, the presence of the INTEGRAL or
- CONFIDENTIAL flag will indicate that the use of SSL is
- required.
-
- Used in: user-data-constraint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NONE"/>
- <xsd:enumeration value="INTEGRAL"/>
- <xsd:enumeration value="CONFIDENTIAL"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="user-data-constraintType">
- <xsd:annotation>
- <xsd:documentation>
-
- The user-data-constraintType is used to indicate how
- data communicated between the client and container should be
- protected.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="transport-guarantee"
- type="javaee:transport-guaranteeType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="war-pathType">
- <xsd:annotation>
- <xsd:documentation>
-
- The elements that use this type designate a path starting
- with a "/" and interpreted relative to the root of a WAR
- file.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="/.*"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="web-app-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type contains the recognized versions of
- web-application supported. It is used to designate the
- version of the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="3.0"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="web-resource-collectionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-collectionType is used to identify the
- resources and HTTP methods on those resources to which a
- security constraint applies. If no HTTP methods are specified,
- then the security constraint applies to all HTTP methods.
- If HTTP methods are specified by http-method-omission
- elements, the security constraint applies to all methods
- except those identified in the collection.
- http-method-omission and http-method elements are never
- mixed in the same collection.
-
- Used in: security-constraint
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="web-resource-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-resource-name contains the name of this web
- resource collection.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="url-pattern"
- type="javaee:url-patternType"
- maxOccurs="unbounded"/>
- <xsd:choice minOccurs="0"
- maxOccurs="1">
- <xsd:element name="http-method"
- type="javaee:http-methodType"
- minOccurs="1"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Each http-method names an HTTP method to which the
- constraint applies.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="http-method-omission"
- type="javaee:http-methodType"
- minOccurs="1"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Each http-method-omission names an HTTP method to
- which the constraint does not apply.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="welcome-file-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file-list contains an ordered list of welcome
- files elements.
-
- Used in: web-app
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="welcome-file"
- type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The welcome-file element contains file name to use
- as a default welcome file, such as index.html
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:simpleType name="localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localeType defines valid locale defined by ISO-639-1
- and ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="encodingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The encodingType defines IANA character sets.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[^\s]+"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mapping-listType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping-list contains one or more
- locale-encoding-mapping(s).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="locale-encoding-mapping"
- type="javaee:locale-encoding-mappingType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="locale-encoding-mappingType">
- <xsd:annotation>
- <xsd:documentation>
-
- The locale-encoding-mapping contains locale name and
- encoding name. The locale name must be either "Language-code",
- such as "ja", defined by ISO-639 or "Language-code_Country-code",
- such as "ja_JP". "Country code" is defined by ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="locale"
- type="javaee:localeType"/>
- <xsd:element name="encoding"
- type="javaee:encodingType"/>
- </xsd:sequence>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ordering-othersType">
- <xsd:annotation>
- <xsd:documentation>
-
- This element indicates that the ordering sub-element in which
- it was placed should take special action regarding the ordering
- of this application resource relative to other application
- configuration resources.
- See section 8.2.2 of the specification for details.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id"
- type="xsd:ID"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="absoluteOrderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Please see section 8.2.2 of the specification for details.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0"
- maxOccurs="unbounded">
- <xsd:element name="name"
- type="javaee:java-identifierType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="others"
- type="javaee:ordering-othersType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:choice>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="orderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Please see section 8.2.2 of the specification for details.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="after"
- type="javaee:ordering-orderingType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="before"
- type="javaee:ordering-orderingType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="ordering-orderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains a sequence of "name" elements, each of
- which
- refers to an application configuration resource by the "name"
- declared on its web.xml fragment. This element can also contain
- a single "others" element which specifies that this document
- comes
- before or after other documents within the application.
- See section 8.2.2 of the specification for details.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name"
- type="javaee:java-identifierType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="others"
- type="javaee:ordering-othersType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="multipart-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- This element specifies configuration information related to the
- handling of multipart/form-data requests.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="location"
- type="javaee:string"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The directory location where uploaded files will be stored
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-file-size"
- type="xsd:long"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The maximum size limit of uploaded files
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-request-size"
- type="xsd:long"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The maximum size limit of multipart/form-data requests
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="file-size-threshold"
- type="xsd:integer"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The size threshold after which an uploaded file will be
- written to disk
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd
deleted file mode 100644
index 01b933c52d..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd
+++ /dev/null
@@ -1,515 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
-<xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
-
- The XML Schema for the Tag Libraries in the JavaServer Faces
- Standard Facelets View Declaration Language (Facelets VDL)
- (Version 2.0).
-
- JSF 2.0 Facelet Tag Libraries that wish to conform to this
- schema must declare it in the following manner.
-
- <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd"
- version="2.0">
-
- ...
-
- </facelet-taglib>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for javaee namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
-
-
- <xsd:element name="facelet-taglib" type="javaee:facelet-taglibType">
- <xsd:unique name="facelet-taglib-tagname-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- tag-names must be unique within a document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:tag"/>
- <xsd:field xpath="javaee:tag-name"/>
- </xsd:unique>
- <xsd:unique name="faces-config-behavior-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Behavior IDs must be unique within a document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:behavior"/>
- <xsd:field xpath="javaee:behavior-id"/>
- </xsd:unique>
- <xsd:unique name="faces-config-converter-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Converter IDs must be unique within a document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:converter"/>
- <xsd:field xpath="javaee:converter-id"/>
- </xsd:unique>
- <xsd:unique name="faces-config-validator-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Validator IDs must be unique within a document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:validator"/>
- <xsd:field xpath="javaee:validator-id"/>
- </xsd:unique>
- </xsd:element>
- <xsd:complexType name="facelet-taglibType">
- <xsd:annotation>
- <xsd:documentation>
- The top level XML element in a facelet tag library XML file.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:choice>
- <xsd:element name="library-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:sequence>
- <xsd:element name="namespace" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="composite-library-name"
- type="javaee:fully-qualified-classType"/>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="tag"
- type="javaee:facelet-taglib-tagType"/>
- <xsd:element name="function"
- type="javaee:facelet-taglib-functionType"/>
-
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:element name="taglib-extension"
- type="javaee:facelet-taglib-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- <xsd:attribute name="version"
- type="javaee:facelet-taglib-versionType"
- use="required"/>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for facelet-taglib. It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="facelet-taglib-tagType">
- <xsd:annotation>
- <xsd:documentation>
- If the tag library XML file contains individual tag
- declarations rather than pointing to a library-class or a
- declaring a composite-library name, the individual tags are
- enclosed in tag elements.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="tag-name"
- type="javaee:facelet-taglib-canonical-nameType"/>
- <xsd:choice>
- <xsd:element name="handler-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="behavior"
- type="javaee:facelet-taglib-tag-behaviorType"/>
- <xsd:element name="component"
- type="javaee:facelet-taglib-tag-componentType"/>
- <xsd:element name="converter"
- type="javaee:facelet-taglib-tag-converterType"/>
- <xsd:element name="validator"
- type="javaee:facelet-taglib-tag-validatorType"/>
- <xsd:element name="source" type="javaee:string"/>
- </xsd:choice>
- <xsd:element name="attribute"
- type="javaee:facelet-taglib-tag-attributeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="tag-extension"
- type="javaee:facelet-taglib-tag-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="facelet-taglib-tag-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The attribute element defines an attribute for the nesting
- tag. The attribute element may have several subelements
- defining:
-
- description a description of the attribute
-
- name the name of the attribute
-
- required whether the attribute is required or
- optional
-
- type the type of the attribute
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="name"
- type="javaee:xsdNMTOKENType"/>
- <xsd:element name="required"
- type="javaee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines if the nesting attribute is required or
- optional.
-
- If not present then the default is "false", i.e
- the attribute is optional.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the Java type of the attributes
- value. If this element is omitted, the
- expected type is assumed to be
- "java.lang.Object".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="method-signature"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the method signature for a MethodExpression-
- enabled attribute.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <xsd:complexType name="facelet-taglib-tag-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for tag It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="facelet-taglib-functionType">
- <xsd:annotation>
- <xsd:documentation>
- If the tag library XML file contains individual function
- declarations rather than pointing to a library-class or a
- declaring a composite-library name, the individual functions are
- enclosed in function elements.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="function-name" type="javaee:string"/>
- <xsd:element name="function-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="function-signature" type="javaee:string"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-behaviorType">
- <xsd:annotation>
- <xsd:documentation>
- Within a tag element, the behavior element encapsulates
- information specific to a JSF Behavior.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element minOccurs="1" maxOccurs="1"
- name="behavior-id" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="handler-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="behavior-extension"
- type="javaee:facelet-taglib-tag-behavior-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-behavior-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for behavior. It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-componentType">
- <xsd:annotation>
- <xsd:documentation>
- Within a tag element, the component element encapsulates
- information specific to a JSF UIComponent.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="component-type" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="renderer-type" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="handler-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="component-extension"
- type="javaee:facelet-taglib-tag-component-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
-
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-component-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for component It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="facelet-taglib-tag-converterType">
- <xsd:annotation>
- <xsd:documentation>
- Within a tag element, the converter element encapsulates
- information specific to a JSF Converter.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element minOccurs="1" maxOccurs="1"
- name="converter-id" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="handler-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="converter-extension"
- type="javaee:facelet-taglib-tag-converter-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-converter-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for converter It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="facelet-taglib-tag-validatorType">
- <xsd:annotation>
- <xsd:documentation>
- Within a tag element, the validator element encapsulates
- information specific to a JSF Validator.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element minOccurs="1" maxOccurs="1"
- name="validator-id" type="javaee:string"/>
- <xsd:element minOccurs="0" maxOccurs="1"
- name="handler-class"
- type="javaee:fully-qualified-classType"/>
- <xsd:element name="validator-extension"
- type="javaee:facelet-taglib-tag-validator-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="facelet-taglib-tag-validator-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for validator It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
- <xsd:simpleType name="facelet-taglib-versionType">
- <xsd:annotation>
- <xsd:documentation>
- This type contains the recognized versions of
- facelet-taglib supported.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="2.0"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="facelet-taglib-canonical-nameType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the canonical name of a tag or attribute being
- defined.
-
- The name must conform to the lexical rules for an NCName
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:extension base="xsd:NCName">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_0.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_0.dtd
deleted file mode 100644
index 3e1c998e6c..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_0.dtd
+++ /dev/null
@@ -1,874 +0,0 @@
-<!--
- DTD for the JavaServer Faces Application Configuration File (Version 1.0)
-
- To support validation of your configuration file(s), include the following
- DOCTYPE element at the beginning (after the "xml" declaration):
-
- <!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
-
- $Id: web-facesconfig_1_0.dtd,v 1.1 2007/05/25 21:12:49 david_williams Exp $
-
--->
-
-
-<!-- ==================== Defined Types =================================== -->
-
-
-<!--
- An "Action" is a String that represents a method binding
- expression that points at a method with no arguments that returns a
- String. It must be bracketed with "#{}", for example,
- "#{cardemo.buyCar}".
--->
-<!ENTITY % Action "CDATA">
-
-
-<!--
- A "ClassName" is the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element.
--->
-<!ENTITY % ClassName "CDATA">
-
-
-<!--
- An "Identifier" is a string of characters that conforms to the variable
- naming conventions of the Java programming language (JLS Section ?.?.?).
--->
-<!ENTITY % Identifier "CDATA">
-
-
-<!--
- A "JavaType" is either the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element, or
- the name of a Java primitive type (such as int or char). The class name
- or primitive type may optionally be followed by "[]" to indicate that
- the underlying data must be an array, rather than a scalar variable.
--->
-<!ENTITY % JavaType "CDATA">
-
-
-<!--
- A "Language" is a lower case two-letter code for a language as defined
- by ISL-639.
--->
-<!ENTITY % Language "CDATA">
-
-
-<!--
- A "ResourcePath" is the relative or absolute path to a resource file
- (such as a logo image).
--->
-<!ENTITY % ResourcePath "CDATA">
-
-
-<!--
- A "Scope" is the well-known name of a scope in which managed beans may
- optionally be defined to be created in.
--->
-<!ENTITY % Scope "(request|session|application)">
-
-
-
-<!--
- A "ScopeOrNone" element defines the legal values for the
- <managed-bean-scope> element's body content, which includes
- all of the scopes respresented by the "Scope" type, plus the
- "none" value indicating that a created bean should not be
- stored into any scope.
--->
-<!ENTITY % ScopeOrNone "(request|session|application|none)">
-
-
-<!--
- A "ViewIdPattern" is a pattern for matching view identifiers in
- order to determine whether a particular navigation rule should be
- fired. It must contain one of the following values:
-
- - The exact match for a view identifier that is recognized
- by the the ViewHandler implementation being used (such as
- "/index.jsp" if you are using the default ViewHandler).
-
- - A proper prefix of a view identifier, plus a trailing "*"
- character. This pattern indicates that all view identifiers that
- match the portion of the pattern up to the asterisk will match the
- surrounding rule. When more than one match exists, the match with
- the longest pattern is selected.
-
- - An "*" character, which means that this pattern applies to all
- view identifiers.
--->
-<!ENTITY % ViewIdPattern "CDATA">
-
-
-<!-- ==================== Top Level Elements ============================== -->
-
-
-<!--
- The "faces-config" element is the root of the configuration information
- hierarchy, and contains nested elements for all of the other configuration
- settings.
--->
-<!ELEMENT faces-config ((application|factory|component|converter|managed-bean|navigation-rule|referenced-bean|render-kit|lifecycle|validator)*)>
-<!ATTLIST faces-config
- xmlns CDATA #FIXED "http://java.sun.com/JSF/Configuration">
-
-
-
-<!-- ==================== Definition Elements ============================= -->
-
-
-<!--
- The "application" element provides a mechanism to define the various
- per-application-singleton implementation artifacts for a particular web
- application that is utilizing JavaServer Faces. For nested elements
- that are not specified, the JSF implementation must provide a suitable
- default.
--->
-<!ELEMENT application ((action-listener|default-render-kit-id|message-bundle|navigation-handler|view-handler|state-manager|property-resolver|variable-resolver|locale-config)*)>
-
-
-<!--
- The "factory" element provides a mechanism to define the various
- Factories that comprise parts of the implementation of JavaServer
- Faces. For nested elements that are not specified, the JSF
- implementation must provide a suitable default.
--->
-<!ELEMENT factory ((application-factory|faces-context-factory|lifecycle-factory|render-kit-factory)*)>
-
-
-<!--
- The "attribute" element represents a named, typed, value associated with
- the parent UIComponent via the generic attributes mechanism.
-
- Attribute names must be unique within the scope of the parent (or related)
- component.
--->
-<!ELEMENT attribute (description*, display-name*, icon*, attribute-name, attribute-class, default-value?, suggested-value?, attribute-extension*)>
-
-<!--
- Extension element for attribute. May contain implementation
- specific content.
--->
-<!ELEMENT attribute-extension ANY>
-
-
-<!--
- The "component" element represents a concrete UIComponent implementation
- class that should be registered under the specified type identifier,
- along with its associated properties and attributes. Component types must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that are recognized
- by the implementation logic of this component. Nested "property" elements
- identify JavaBeans properties of the component class that may be exposed
- for manipulation via tools.
--->
-<!ELEMENT component (description*, display-name*, icon*, component-type, component-class, attribute*, property*, component-extension*)>
-
-<!--
- Extension element for component. May contain implementation
- specific content.
--->
-<!ELEMENT component-extension ANY>
-
-
-
-<!--
- The "converter" element represents a concrete Converter implementation
- class that should be registered under the specified converter identifier.
- Converter identifiers must be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that may be
- configured on the corresponding UIComponent in order to affect the
- operation of the Converter. Nested "property" elements identify JavaBeans
- properties of the Converter implementation class that may be configured
- to affect the operation of the Converter.
--->
-<!ELEMENT converter (description*, display-name*, icon*, (converter-id | converter-for-class), converter-class, attribute*, property*)>
-
-
-<!--
- The "icon" element contains "small-icon" and "large-icon" elements that
- specify the resoruce paths for small and large GIF or JPG icon images
- used to represent the parent element in a GUI tool.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-<!ATTLIST icon xml:lang %Language; #IMPLIED>
-
-<!--
- The "lifecycle" element provides a mechanism to specify
- modifications to the behaviour of the default Lifecycle
- implementation for this web application.
--->
-<!ELEMENT lifecycle (phase-listener*)>
-
-<!--
- The "locale-config" element allows the app developer to declare the
- supported locales for this application.
--->
-<!ELEMENT locale-config (default-locale?, supported-locale*)>
-
-<!--
- The "managed-bean" element represents a JavaBean, of a particular class,
- that will be dynamically instantiated at runtime (by the default
- VariableResolver implementation) if it is referenced as the first element
- of a value binding expression, and no corresponding bean can be
- identified in any scope. In addition to the creation of the managed bean,
- and the optional storing of it into the specified scope, the nested
- managed-property elements can be used to initialize the contents of
- settable JavaBeans properties of the created instance.
--->
-<!ELEMENT managed-bean (description*, display-name*, icon*, managed-bean-name, managed-bean-class, managed-bean-scope, (managed-property* | map-entries | list-entries))>
-
-
-<!--
- The "managed-property" element represents an individual property of a
- managed bean that will be configured to the specified value (or value set)
- if the corresponding managed bean is automatically created.
--->
-<!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|list-entries))>
-
-
-<!--
- The "map-entry" element reprsents a single key-entry pair that
- will be added to the computed value of a managed property of type
- java.util.Map.
--->
-<!ELEMENT map-entry (key, (null-value|value))>
-
-
-<!--
- The "map-entries' element represents a set of key-entry pairs that
- will be added to the computed value of a managed property of type
- java.util.Map. In addition, the Java class types of the key and entry
- values may be optionally declared.
--->
-<!ELEMENT map-entries (key-class?, value-class?, map-entry*)>
-
-
-<!--
- The base name of a resource bundle representing the message resources
- for this application. See the JavaDocs for the "java.util.ResourceBundle"
- class for more information on the syntax of resource bundle names.
--->
-
-<!ELEMENT message-bundle (#PCDATA)>
-
-
-<!--
- The "navigation-case" element describes a particular combination of
- conditions that must match for this case to be executed, and the
- view id of the component tree that should be selected next.
--->
-<!ELEMENT navigation-case (description*, display-name*, icon*, from-action?, from-outcome?, to-view-id, redirect?)>
-
-
-<!--
- The "navigation-rule" element represents an individual decision rule
- that will be utilized by the default NavigationHandler
- implementation to make decisions on what view should be displayed
- next, based on the view id being processed.
--->
-<!ELEMENT navigation-rule (description*, display-name*, icon*, from-view-id?, navigation-case*)>
-
-
-<!--
- The "property" element represents a JavaBean property of the Java class
- represented by our parent element.
-
- Property names must be unique within the scope of the Java class
- that is represented by the parent element, and must correspond to
- property names that will be recognized when performing introspection
- against that class via java.beans.Introspector.
--->
-<!ELEMENT property (description*, display-name*, icon*, property-name, property-class, default-value?, suggested-value?, property-extension*)>
-
-<!--
- Extension element for property. May contain implementation
- specific content.
--->
-<!ELEMENT property-extension ANY>
-
-<!--
- The "referenced-bean" element represents at design time the promise
- that a Java object of the specified type will exist at runtime in some
- scope, under the specified key. This can be used by design time tools
- to construct user interface dialogs based on the properties of the
- specified class. The presence or absence of a referenced bean
- element has no impact on the JavaServer Faces runtime environment
- inside a web application.
--->
-<!ELEMENT referenced-bean (description*, display-name*, icon*, referenced-bean-name, referenced-bean-class)>
-
-
-<!--
- The "render-kit" element represents a concrete RenderKit implementation
- that should be registered under the specified render-kit-id. If no
- render-kit-id is specified, the identifier of the default RenderKit
- (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
--->
-<!ELEMENT render-kit (description*, display-name*, icon*, render-kit-id?, render-kit-class?, renderer*)>
-
-
-<!--
- The "renderer" element represents a concrete Renderer implementation
- class that should be registered under the specified component family
- and renderer type identifiers, in the RenderKit associated with the
- parent "render-kit" element. Combinations of component family and renderer
- type must be unique within the RenderKit associated with the parent
- "render-kit" element.
-
- Nested "attribute" elements identify generic component attributes that
- are recognized by this renderer.
--->
-<!ELEMENT renderer (description*, display-name*, icon*, component-family, renderer-type, renderer-class, attribute*, renderer-extension*)>
-
-<!--
- Extension element for renderer. May contain implementation
- specific content.
--->
-<!ELEMENT renderer-extension ANY>
-
-<!--
- The "validator" element represents a concrete Validator implementation
- class that should be registered under the specified validator identifier.
- Validator identifiers must be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that may be
- configured on the corresponding UIComponent in order to affect the
- operation of the Validator. Nested "property" elements identify JavaBeans
- properties of the Validator implementation class that may be configured
- to affect the operation of the Validator.
--->
-<!ELEMENT validator (description*, display-name*, icon*, validator-id, validator-class, attribute*, property*)>
-
-
-<!--
- The "list-entries" element represents a set of initialization
- elements for a managed property that is a java.util.List or an
- array. In the former case, the "value-class" element can optionally
- be used to declare the Java type to which each value should be
- converted before adding it to the Collection.
--->
-<!ELEMENT list-entries (value-class?, (null-value|value)*)>
-
-
-<!-- ==================== Subordinate Elements ============================ -->
-
-
-<!--
- The "action-listener" element contains the fully qualified class name
- of the concrete ActionListener implementation class that will be called
- during the Invoke Application phase of the request processing lifecycle.
- It must be of type "ClassName".
--->
-<!ELEMENT action-listener (#PCDATA)>
-
-<!--
- The "application-factory" element contains the fully qualified class
- name of the concrete ApplicationFactory implementation class that
- will be called when FactoryFinder.getFactory(APPLICATION_FACTORY) is
- called. It must be of type "ClassName".
--->
-<!ELEMENT application-factory (#PCDATA)>
-
-<!--
- The "attribute-class" element represents the Java type of the value
- associated with this attribute name. It must be of type "ClassName".
--->
-<!ELEMENT attribute-class (#PCDATA)>
-
-
-<!--
- The "attribute-name" element represents the name under which the
- corresponding value will be stored, in the generic attributes of the
- UIComponent we are related to.
--->
-<!ELEMENT attribute-name (#PCDATA)>
-
-
-<!--
- The "component-class" element represents the fully qualified class name
- of a concrete UIComponent implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT component-class (#PCDATA)>
-
-
-<!--
- The "component-family" element represents the component family for
- which the Renderer represented by the parent "renderer" element will be
- used.
--->
-<!ELEMENT component-family (#PCDATA)>
-
-<!--
- The "component-type" element represents the name under which the
- corresponding UIComponent class should be registered.
--->
-<!ELEMENT component-type (#PCDATA)>
-
-
-<!--
- The "converter-class" element represents the fully qualified class name
- of a concrete Converter implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT converter-class (#PCDATA)>
-
-
-<!--
- The "converter-for-class" element represents the fully qualified class name
- for which a Converter class will be registered. It must be of
- type "ClassName".
--->
-<!ELEMENT converter-for-class (#PCDATA)>
-
-
-<!--
- The "converter-id" element represents the identifier under which the
- corresponding Converter class should be registered.
--->
-<!ELEMENT converter-id (#PCDATA)>
-
-<!--
- The "default-render-kit-id" element allows the application to define
- a renderkit to be used other than the standard one.
--->
-<!ELEMENT default-render-kit-id (#PCDATA)>
-
-<!--
- The "default-locale" element declares the default locale for this
- application instance. It must be specified as
- :language:[_:country:[_:variant:]] without the colons, for example
- "ja_JP_SJIS". The separators between the segments may be '-' or
- '_'.
--->
-<!ELEMENT default-locale (#PCDATA)>
-
-<!--
- The "default-value" contains the value for the property or attribute
- in which this element resides. This value differs from the
- "suggested-value" in that the property or attribute must take the
- value, whereas in "suggested-value" taking the value is optional.
--->
-<!ELEMENT default-value (#PCDATA)>
-
-<!--
- The "description" element contains a textual description of the element
- it is nested in, optionally flagged with a language code using the
- "xml:lang" attribute.
--->
-<!ELEMENT description ANY>
-<!ATTLIST description xml:lang %Language; #IMPLIED>
-
-
-<!--
- The "display-name" element is a short descriptive name describing the
- entity associated with the element it is nested in, intended to be
- displayed by tools, and optionally flagged with a language code using
- the "xml:lang" attribute.
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name xml:lang %Language; #IMPLIED>
-
-<!--
- The "faces-context-factory" element contains the fully qualified
- class name of the concrete FacesContextFactory implementation class
- that will be called when
- FactoryFinder.getFactory(FACES_CONTEXT_FACTORY) is called. It must
- be of type "ClassName".
--->
-<!ELEMENT faces-context-factory (#PCDATA)>
-
-<!--
- The "from-action" element contains an action reference expression
- that must have been executed (by the default ActionListener for handling
- application level events) in order to select this navigation rule. If
- not specified, this rule will be relevant no matter which action reference
- was executed (or if no action reference was executed).
-
- This value must be of type "Action".
--->
-<!ELEMENT from-action (#PCDATA)>
-
-
-<!--
- The "from-outcome" element contains a logical outcome string returned
- by the execution of an application action method selected via an
- "actionRef" property (or a literal value specified by an "action"
- property) of a UICommand component. If specified, this rule will be
- relevant only if the outcome value matches this element's value. If
- not specified, this rule will be relevant no matter what the outcome
- value was.
--->
-<!ELEMENT from-outcome (#PCDATA)>
-
-
-<!--
- The "from-view-id" element contains the view identifier of the view
- for which the containing navigation rule is relevant. If no
- "from-view" element is specified, this rule applies to navigation
- decisions on all views. If this element is not specified, a value
- of "*" is assumed, meaning that this navigation rule applies to all
- views.
-
- This value must be of type "ViewIdPattern".
--->
-<!ELEMENT from-view-id (#PCDATA)>
-
-
-<!--
- The "key" element is the String representation of a map key that
- will be stored in a managed property of type java.util.Map.
--->
-<!ELEMENT key (#PCDATA)>
-
-
-<!--
- The "key-class" element defines the Java type to which each "key"
- element in a set of "map-entry" elements will be converted to. It
- must be of type "ClassName". If omitted, "java.lang.String"
- is assumed.
--->
-<!ELEMENT key-class (#PCDATA)>
-
-
-<!--
- The "large-icon" element contains the resource path to a large (32x32)
- icon image. The image may be in either GIF or JPG format.
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
- The "lifecycle-factory" element contains the fully qualified class name
- of the concrete LifecycleFactory implementation class that will be called
- when FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called. It must be
- of type "ClassName".
--->
-<!ELEMENT lifecycle-factory (#PCDATA)>
-
-<!--
- The "managed-bean-class" element represents the fully qualified class
- name of the Java class that will be used to instantiate a new instance
- if creation of the specified managed bean is requested. It must be of
- type "ClassName".
-
- The specified class must conform to standard JavaBeans conventions.
- In particular, it must have a public zero-arguments constructor, and
- zero or more public property setters.
--->
-<!ELEMENT managed-bean-class (#PCDATA)>
-
-
-<!--
- The "managed-bean-name" element represents the attribute name under
- which a managed bean will be searched for, as well as stored (unless
- the "managed-bean-scope" value is "none"). It must be of type
- "Identifier".
--->
-<!ELEMENT managed-bean-name (#PCDATA)>
-
-
-<!--
- The "managed-bean-scope" element represents the scope into which a newly
- created instance of the specified managed bean will be stored (unless
- the value is "none"). It must be of type "ScopeOrNone".
--->
-<!ELEMENT managed-bean-scope (#PCDATA)>
-
-<!--
- The "navigation-handler" element contains the fully qualified class name
- of the concrete NavigationHandler implementation class that will be called
- during the Invoke Application phase of the request processing lifecycle,
- if the default ActionListener (provided by the JSF implementation) is used.
- It must be of type "ClassName".
--->
-<!ELEMENT navigation-handler (#PCDATA)>
-
-<!--
-The "phase-listener" element contains the fully qualified class
-name of the concrete PhaseListener implementation class that will be
-registered on the Lifecycle. It must be of type "ClassName".
--->
-<!ELEMENT phase-listener (#PCDATA)>
-
-<!--
- The "redirect" element indicates that navigation to the specified
- "to-view-id" should be accomplished by performing an HTTP redirect
- rather than the usual ViewHandler mechanisms.
--->
-<!ELEMENT redirect EMPTY>
-
-<!--
- The "suggested-value" contains the value for the property or
- attribute in which this element resides. This value is advisory
- only and is intended for tools to use when populating pallettes.
--->
-<!ELEMENT suggested-value (#PCDATA)>
-
-
-<!--
-
- The "view-handler" element contains the fully qualified class name
- of the concrete ViewHandler implementation class that will be called
- during the Restore View and Render Response phases of the request
- processing lifecycle. The faces implementation must provide a
- default implementation of this class
--->
-<!ELEMENT view-handler (#PCDATA)>
-
-<!--
-
- The "state-manager" element contains the fully qualified class name
- of the concrete StateManager implementation class that will be called
- during the Restore View and Render Response phases of the request
- processing lifecycle. The faces implementation must provide a
- default implementation of this class
--->
-<!ELEMENT state-manager (#PCDATA)>
-
-<!--
- The "null-value" element indicates that the managed property in which we
- are nested will be explicitly set to null if our managed bean is
- automatically created. This is different from omitting the managed
- property element entirely, which will cause no property setter to be
- called for this property.
-
- The "null-value" element can only be used when the associated
- "property-class" identifies a Java class, not a Java primitive.
--->
-<!ELEMENT null-value EMPTY>
-
-
-<!--
- The "property-class" element represents the Java type of the value
- associated with this property name. It must be of type "JavaType".
- If not specified, it can be inferred from existing classes; however,
- this element should be specified if the configuration file is going
- to be the source for generating the corresponding classes.
--->
-<!ELEMENT property-class (#PCDATA)>
-
-
-<!--
- The "property-name" element represents the JavaBeans property name
- under which the corresponding value may be stored.
--->
-<!ELEMENT property-name (#PCDATA)>
-
-
-<!--
- The "property-resolver" element contains the fully qualified class name
- of the concrete PropertyResolver implementation class that will be used
- during the processing of value binding expressions.
- It must be of type "ClassName".
--->
-<!ELEMENT property-resolver (#PCDATA)>
-
-
-<!--
- The "referenced-bean-class" element represents the fully qualified class
- name of the Java class (either abstract or concrete) or Java interface
- implemented by the corresponding referenced bean. It must be of type
- "ClassName".
--->
-<!ELEMENT referenced-bean-class (#PCDATA)>
-
-
-<!--
- The "referenced-bean-name" element represents the attribute name under
- which the corresponding referenced bean may be assumed to be stored,
- in one of the scopes defined by the "Scope" type. It must be of type
- "Identifier".
--->
-<!ELEMENT referenced-bean-name (#PCDATA)>
-
-
-<!--
- The "render-kit-id" element represents an identifier for the
- RenderKit represented by the parent "render-kit" element.
--->
-<!ELEMENT render-kit-id (#PCDATA)>
-
-
-<!--
- The "render-kit-class" element represents the fully qualified class name
- of a concrete RenderKit implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT render-kit-class (#PCDATA)>
-
-
-<!--
- The "renderer-class" element represents the fully qualified class name
- of a concrete Renderer implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT renderer-class (#PCDATA)>
-
-<!--
- The "render-kit-factory" element contains the fully qualified class name
- of the concrete RenderKitFactory implementation class that will be called
- when FactoryFinder.getFactory(RENDER_KIT_FACTORY) is called. It must be
- of type "ClassName".
--->
-<!ELEMENT render-kit-factory (#PCDATA)>
-
-<!--
- The "renderer-type" element represents a renderer type identifier for the
- Renderer represented by the parent "renderer" element.
--->
-<!ELEMENT renderer-type (#PCDATA)>
-
-<!--
- The "small-icon" element contains the resource path to a large (16x16)
- icon image. The image may be in either GIF or JPG format.
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
- The "supported-locale" element allows authors to declare which
- locales are supported in this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]] without
- the colons, for example "ja_JP_SJIS". The separators between the
- segments may be '-' or '_'.
--->
-<!ELEMENT supported-locale (#PCDATA)>
-
-<!--
- The "to-view" element contains the view identifier of the next view
- that should be displayed if this navigation rule is matched. It
- must be of type "ViewId".
--->
-<!ELEMENT to-view-id (#PCDATA)>
-
-
-<!--
- The "validator-class" element represents the fully qualified class name
- of a concrete Validator implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT validator-class (#PCDATA)>
-
-
-<!--
- The "validator-id" element represents the identifier under which the
- corresponding Validator class should be registered.
--->
-<!ELEMENT validator-id (#PCDATA)>
-
-
-<!--
- The "value" element is the String representation of a literal
- value to which a scalar managed property will be set, or a value
- binding expression ("#{...}") that will be used to calculate the
- required value. It will be converted as specified for the actual
- property type.
--->
-<!ELEMENT value (#PCDATA)>
-
-
-<!--
- The "value-class" element defines the Java type to which each
- "value" element's value will be converted to, prior to adding it to
- the "list-entries" list for a managed property that is a
- java.util.List, or a "map-entries" map for a managed property that
- is a java.util.Map. It must be of type "ClassName". If omitted,
- "java.lang.String" is assumed.
--->
-<!ELEMENT value-class (#PCDATA)>
-
-<!--
- The "variable-resolver" element contains the fully qualified class name
- of the concrete VariableResolver implementation class that will be used
- during the processing of value binding expressions.
- It must be of type "ClassName".
--->
-<!ELEMENT variable-resolver (#PCDATA)>
-
-
-<!-- ============================ Identifier Attributes ==================== -->
-
-
-<!ATTLIST action-listener id ID #IMPLIED>
-<!ATTLIST application id ID #IMPLIED>
-<!ATTLIST application-factory id ID #IMPLIED>
-<!ATTLIST attribute id ID #IMPLIED>
-<!ATTLIST attribute-class id ID #IMPLIED>
-<!ATTLIST attribute-extension id ID #IMPLIED>
-<!ATTLIST attribute-name id ID #IMPLIED>
-<!ATTLIST component id ID #IMPLIED>
-<!ATTLIST component-class id ID #IMPLIED>
-<!ATTLIST component-extension id ID #IMPLIED>
-<!ATTLIST component-family id ID #IMPLIED>
-<!ATTLIST component-type id ID #IMPLIED>
-<!ATTLIST converter id ID #IMPLIED>
-<!ATTLIST converter-class id ID #IMPLIED>
-<!ATTLIST converter-for-class id ID #IMPLIED>
-<!ATTLIST converter-id id ID #IMPLIED>
-<!ATTLIST default-locale id ID #IMPLIED>
-<!ATTLIST default-render-kit-id id ID #IMPLIED>
-<!ATTLIST default-value id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST faces-config id ID #IMPLIED>
-<!ATTLIST faces-context-factory id ID #IMPLIED>
-<!ATTLIST factory id ID #IMPLIED>
-<!ATTLIST from-action id ID #IMPLIED>
-<!ATTLIST from-outcome id ID #IMPLIED>
-<!ATTLIST from-view-id id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST key id ID #IMPLIED>
-<!ATTLIST key-class id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST lifecycle id ID #IMPLIED>
-<!ATTLIST lifecycle-factory id ID #IMPLIED>
-<!ATTLIST list-entries id ID #IMPLIED>
-<!ATTLIST locale-config id ID #IMPLIED>
-<!ATTLIST managed-bean id ID #IMPLIED>
-<!ATTLIST managed-bean-class id ID #IMPLIED>
-<!ATTLIST managed-bean-name id ID #IMPLIED>
-<!ATTLIST managed-bean-scope id ID #IMPLIED>
-<!ATTLIST managed-property id ID #IMPLIED>
-<!ATTLIST map-entries id ID #IMPLIED>
-<!ATTLIST map-entry id ID #IMPLIED>
-<!ATTLIST message-bundle id ID #IMPLIED>
-<!ATTLIST navigation-case id ID #IMPLIED>
-<!ATTLIST navigation-handler id ID #IMPLIED>
-<!ATTLIST navigation-rule id ID #IMPLIED>
-<!ATTLIST null-value id ID #IMPLIED>
-<!ATTLIST phase-listener id ID #IMPLIED>
-<!ATTLIST property id ID #IMPLIED>
-<!ATTLIST property-class id ID #IMPLIED>
-<!ATTLIST property-extension id ID #IMPLIED>
-<!ATTLIST property-name id ID #IMPLIED>
-<!ATTLIST property-resolver id ID #IMPLIED>
-<!ATTLIST redirect id ID #IMPLIED>
-<!ATTLIST referenced-bean id ID #IMPLIED>
-<!ATTLIST referenced-bean-class id ID #IMPLIED>
-<!ATTLIST referenced-bean-name id ID #IMPLIED>
-<!ATTLIST render-kit id ID #IMPLIED>
-<!ATTLIST render-kit-class id ID #IMPLIED>
-<!ATTLIST render-kit-factory id ID #IMPLIED>
-<!ATTLIST render-kit-id id ID #IMPLIED>
-<!ATTLIST renderer id ID #IMPLIED>
-<!ATTLIST renderer-class id ID #IMPLIED>
-<!ATTLIST renderer-extension id ID #IMPLIED>
-<!ATTLIST renderer-type id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST state-manager id ID #IMPLIED>
-<!ATTLIST suggested-value id ID #IMPLIED>
-<!ATTLIST supported-locale id ID #IMPLIED>
-<!ATTLIST to-view-id id ID #IMPLIED>
-<!ATTLIST validator id ID #IMPLIED>
-<!ATTLIST validator-class id ID #IMPLIED>
-<!ATTLIST validator-id id ID #IMPLIED>
-<!ATTLIST value id ID #IMPLIED>
-<!ATTLIST value-class id ID #IMPLIED>
-<!ATTLIST variable-resolver id ID #IMPLIED>
-<!ATTLIST view-handler id ID #IMPLIED>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_1.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_1.dtd
deleted file mode 100644
index 03dad8e2e6..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_1.dtd
+++ /dev/null
@@ -1,895 +0,0 @@
-<!--
- DTD for the JavaServer Faces Application Configuration File (Version 1.1)
-
- To support validation of your configuration file(s), include the following
- DOCTYPE element at the beginning (after the "xml" declaration):
-
- <!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
- $Id: web-facesconfig_1_1.dtd,v 1.1 2007/05/25 21:12:48 david_williams Exp $
-
--->
-
-
-<!-- ==================== Defined Types =================================== -->
-
-
-<!--
- An "Action" is a String that represents a method binding
- expression that points at a method with no arguments that returns a
- String. It must be bracketed with "#{}", for example,
- "#{cardemo.buyCar}".
--->
-<!ENTITY % Action "CDATA">
-
-
-<!--
- A "ClassName" is the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element.
--->
-<!ENTITY % ClassName "CDATA">
-
-
-<!--
- An "Identifier" is a string of characters that conforms to the variable
- naming conventions of the Java programming language (JLS Section ?.?.?).
--->
-<!ENTITY % Identifier "CDATA">
-
-
-<!--
- A "JavaType" is either the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element, or
- the name of a Java primitive type (such as int or char). The class name
- or primitive type may optionally be followed by "[]" to indicate that
- the underlying data must be an array, rather than a scalar variable.
--->
-<!ENTITY % JavaType "CDATA">
-
-
-<!--
- A "Language" is a lower case two-letter code for a language as defined
- by ISL-639.
--->
-<!ENTITY % Language "CDATA">
-
-
-<!--
- A "ResourcePath" is the relative or absolute path to a resource file
- (such as a logo image).
--->
-<!ENTITY % ResourcePath "CDATA">
-
-
-<!--
- A "Scope" is the well-known name of a scope in which managed beans may
- optionally be defined to be created in.
--->
-<!ENTITY % Scope "(request|session|application)">
-
-
-
-<!--
- A "ScopeOrNone" element defines the legal values for the
- <managed-bean-scope> element's body content, which includes
- all of the scopes respresented by the "Scope" type, plus the
- "none" value indicating that a created bean should not be
- stored into any scope.
--->
-<!ENTITY % ScopeOrNone "(request|session|application|none)">
-
-
-<!--
- A "ViewIdPattern" is a pattern for matching view identifiers in
- order to determine whether a particular navigation rule should be
- fired. It must contain one of the following values:
-
- - The exact match for a view identifier that is recognized
- by the the ViewHandler implementation being used (such as
- "/index.jsp" if you are using the default ViewHandler).
-
- - A proper prefix of a view identifier, plus a trailing "*"
- character. This pattern indicates that all view identifiers that
- match the portion of the pattern up to the asterisk will match the
- surrounding rule. When more than one match exists, the match with
- the longest pattern is selected.
-
- - An "*" character, which means that this pattern applies to all
- view identifiers.
--->
-<!ENTITY % ViewIdPattern "CDATA">
-
-
-<!-- ==================== Top Level Elements ============================== -->
-
-
-<!--
- The "faces-config" element is the root of the configuration information
- hierarchy, and contains nested elements for all of the other configuration
- settings.
--->
-<!ELEMENT faces-config ((application|factory|component|converter|managed-bean|navigation-rule|referenced-bean|render-kit|lifecycle|validator)*)>
-<!ATTLIST faces-config
- xmlns CDATA #FIXED "http://java.sun.com/JSF/Configuration">
-
-
-
-<!-- ==================== Definition Elements ============================= -->
-
-
-<!--
- The "application" element provides a mechanism to define the various
- per-application-singleton implementation artifacts for a particular web
- application that is utilizing JavaServer Faces. For nested elements
- that are not specified, the JSF implementation must provide a suitable
- default.
--->
-<!ELEMENT application ((action-listener|default-render-kit-id|message-bundle|navigation-handler|view-handler|state-manager|property-resolver|variable-resolver|locale-config)*)>
-
-
-<!--
- The "factory" element provides a mechanism to define the various
- Factories that comprise parts of the implementation of JavaServer
- Faces. For nested elements that are not specified, the JSF
- implementation must provide a suitable default.
--->
-<!ELEMENT factory ((application-factory|faces-context-factory|lifecycle-factory|render-kit-factory)*)>
-
-
-<!--
- The "attribute" element represents a named, typed, value associated with
- the parent UIComponent via the generic attributes mechanism.
-
- Attribute names must be unique within the scope of the parent (or related)
- component.
--->
-<!ELEMENT attribute (description*, display-name*, icon*, attribute-name, attribute-class, default-value?, suggested-value?, attribute-extension*)>
-
-<!--
- Extension element for attribute. May contain implementation
- specific content.
--->
-<!ELEMENT attribute-extension ANY>
-
-
-<!--
- The "component" element represents a concrete UIComponent implementation
- class that should be registered under the specified type identifier,
- along with its associated properties and attributes. Component types must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that are recognized
- by the implementation logic of this component. Nested "property" elements
- identify JavaBeans properties of the component class that may be exposed
- for manipulation via tools.
--->
-<!ELEMENT component (description*, display-name*, icon*, component-type, component-class, facet*, attribute*, property*, component-extension*)>
-
-<!--
- Extension element for component. May contain implementation
- specific content.
--->
-<!ELEMENT component-extension ANY>
-
-<!--
- Define the name and other design-time information for a facet that is
- associated with a renderer or a component.
--->
-
-<!ELEMENT facet (description*, display-name*, icon*, facet-name, facet-extension*)>
-
-<!--
- Extension element for facet. May contain implementation
- specific content.
--->
-<!ELEMENT facet-extension ANY>
-
-<!--
- The "facet-name" element represents the facet name under which a
- UIComponent will be added to its parent. It must be of type
- "Identifier".
--->
-<!ELEMENT facet-name (#PCDATA)>
-
-<!--
- The "converter" element represents a concrete Converter implementation
- class that should be registered under the specified converter identifier.
- Converter identifiers must be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that may be
- configured on the corresponding UIComponent in order to affect the
- operation of the Converter. Nested "property" elements identify JavaBeans
- properties of the Converter implementation class that may be configured
- to affect the operation of the Converter.
--->
-<!ELEMENT converter (description*, display-name*, icon*, (converter-id | converter-for-class), converter-class, attribute*, property*)>
-
-
-<!--
- The "icon" element contains "small-icon" and "large-icon" elements that
- specify the resoruce paths for small and large GIF or JPG icon images
- used to represent the parent element in a GUI tool.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-<!ATTLIST icon xml:lang %Language; #IMPLIED>
-
-<!--
- The "lifecycle" element provides a mechanism to specify
- modifications to the behaviour of the default Lifecycle
- implementation for this web application.
--->
-<!ELEMENT lifecycle (phase-listener*)>
-
-<!--
- The "locale-config" element allows the app developer to declare the
- supported locales for this application.
--->
-<!ELEMENT locale-config (default-locale?, supported-locale*)>
-
-<!--
- The "managed-bean" element represents a JavaBean, of a particular class,
- that will be dynamically instantiated at runtime (by the default
- VariableResolver implementation) if it is referenced as the first element
- of a value binding expression, and no corresponding bean can be
- identified in any scope. In addition to the creation of the managed bean,
- and the optional storing of it into the specified scope, the nested
- managed-property elements can be used to initialize the contents of
- settable JavaBeans properties of the created instance.
--->
-<!ELEMENT managed-bean (description*, display-name*, icon*, managed-bean-name, managed-bean-class, managed-bean-scope, (managed-property* | map-entries | list-entries))>
-
-
-<!--
- The "managed-property" element represents an individual property of a
- managed bean that will be configured to the specified value (or value set)
- if the corresponding managed bean is automatically created.
--->
-<!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|list-entries))>
-
-
-<!--
- The "map-entry" element reprsents a single key-entry pair that
- will be added to the computed value of a managed property of type
- java.util.Map.
--->
-<!ELEMENT map-entry (key, (null-value|value))>
-
-
-<!--
- The "map-entries' element represents a set of key-entry pairs that
- will be added to the computed value of a managed property of type
- java.util.Map. In addition, the Java class types of the key and entry
- values may be optionally declared.
--->
-<!ELEMENT map-entries (key-class?, value-class?, map-entry*)>
-
-
-<!--
- The base name of a resource bundle representing the message resources
- for this application. See the JavaDocs for the "java.util.ResourceBundle"
- class for more information on the syntax of resource bundle names.
--->
-
-<!ELEMENT message-bundle (#PCDATA)>
-
-
-<!--
- The "navigation-case" element describes a particular combination of
- conditions that must match for this case to be executed, and the
- view id of the component tree that should be selected next.
--->
-<!ELEMENT navigation-case (description*, display-name*, icon*, from-action?, from-outcome?, to-view-id, redirect?)>
-
-
-<!--
- The "navigation-rule" element represents an individual decision rule
- that will be utilized by the default NavigationHandler
- implementation to make decisions on what view should be displayed
- next, based on the view id being processed.
--->
-<!ELEMENT navigation-rule (description*, display-name*, icon*, from-view-id?, navigation-case*)>
-
-
-<!--
- The "property" element represents a JavaBean property of the Java class
- represented by our parent element.
-
- Property names must be unique within the scope of the Java class
- that is represented by the parent element, and must correspond to
- property names that will be recognized when performing introspection
- against that class via java.beans.Introspector.
--->
-<!ELEMENT property (description*, display-name*, icon*, property-name, property-class, default-value?, suggested-value?, property-extension*)>
-
-<!--
- Extension element for property. May contain implementation
- specific content.
--->
-<!ELEMENT property-extension ANY>
-
-<!--
- The "referenced-bean" element represents at design time the promise
- that a Java object of the specified type will exist at runtime in some
- scope, under the specified key. This can be used by design time tools
- to construct user interface dialogs based on the properties of the
- specified class. The presence or absence of a referenced bean
- element has no impact on the JavaServer Faces runtime environment
- inside a web application.
--->
-<!ELEMENT referenced-bean (description*, display-name*, icon*, referenced-bean-name, referenced-bean-class)>
-
-
-<!--
- The "render-kit" element represents a concrete RenderKit implementation
- that should be registered under the specified render-kit-id. If no
- render-kit-id is specified, the identifier of the default RenderKit
- (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
--->
-<!ELEMENT render-kit (description*, display-name*, icon*, render-kit-id?, render-kit-class?, renderer*)>
-
-
-<!--
- The "renderer" element represents a concrete Renderer implementation
- class that should be registered under the specified component family
- and renderer type identifiers, in the RenderKit associated with the
- parent "render-kit" element. Combinations of component family and renderer
- type must be unique within the RenderKit associated with the parent
- "render-kit" element.
-
- Nested "attribute" elements identify generic component attributes that
- are recognized by this renderer.
--->
-<!ELEMENT renderer (description*, display-name*, icon*, component-family, renderer-type, renderer-class, facet*, attribute*, renderer-extension*)>
-
-<!--
- Extension element for renderer. May contain implementation
- specific content.
--->
-<!ELEMENT renderer-extension ANY>
-
-<!--
- The "validator" element represents a concrete Validator implementation
- class that should be registered under the specified validator identifier.
- Validator identifiers must be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that may be
- configured on the corresponding UIComponent in order to affect the
- operation of the Validator. Nested "property" elements identify JavaBeans
- properties of the Validator implementation class that may be configured
- to affect the operation of the Validator.
--->
-<!ELEMENT validator (description*, display-name*, icon*, validator-id, validator-class, attribute*, property*)>
-
-
-<!--
- The "list-entries" element represents a set of initialization
- elements for a managed property that is a java.util.List or an
- array. In the former case, the "value-class" element can optionally
- be used to declare the Java type to which each value should be
- converted before adding it to the Collection.
--->
-<!ELEMENT list-entries (value-class?, (null-value|value)*)>
-
-
-<!-- ==================== Subordinate Elements ============================ -->
-
-
-<!--
- The "action-listener" element contains the fully qualified class name
- of the concrete ActionListener implementation class that will be called
- during the Invoke Application phase of the request processing lifecycle.
- It must be of type "ClassName".
--->
-<!ELEMENT action-listener (#PCDATA)>
-
-<!--
- The "application-factory" element contains the fully qualified class
- name of the concrete ApplicationFactory implementation class that
- will be called when FactoryFinder.getFactory(APPLICATION_FACTORY) is
- called. It must be of type "ClassName".
--->
-<!ELEMENT application-factory (#PCDATA)>
-
-<!--
- The "attribute-class" element represents the Java type of the value
- associated with this attribute name. It must be of type "ClassName".
--->
-<!ELEMENT attribute-class (#PCDATA)>
-
-
-<!--
- The "attribute-name" element represents the name under which the
- corresponding value will be stored, in the generic attributes of the
- UIComponent we are related to.
--->
-<!ELEMENT attribute-name (#PCDATA)>
-
-
-<!--
- The "component-class" element represents the fully qualified class name
- of a concrete UIComponent implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT component-class (#PCDATA)>
-
-
-<!--
- The "component-family" element represents the component family for
- which the Renderer represented by the parent "renderer" element will be
- used.
--->
-<!ELEMENT component-family (#PCDATA)>
-
-<!--
- The "component-type" element represents the name under which the
- corresponding UIComponent class should be registered.
--->
-<!ELEMENT component-type (#PCDATA)>
-
-
-<!--
- The "converter-class" element represents the fully qualified class name
- of a concrete Converter implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT converter-class (#PCDATA)>
-
-
-<!--
- The "converter-for-class" element represents the fully qualified class name
- for which a Converter class will be registered. It must be of
- type "ClassName".
--->
-<!ELEMENT converter-for-class (#PCDATA)>
-
-
-<!--
- The "converter-id" element represents the identifier under which the
- corresponding Converter class should be registered.
--->
-<!ELEMENT converter-id (#PCDATA)>
-
-<!--
- The "default-render-kit-id" element allows the application to define
- a renderkit to be used other than the standard one.
--->
-<!ELEMENT default-render-kit-id (#PCDATA)>
-
-<!--
- The "default-locale" element declares the default locale for this
- application instance. It must be specified as
- :language:[_:country:[_:variant:]] without the colons, for example
- "ja_JP_SJIS". The separators between the segments may be '-' or
- '_'.
--->
-<!ELEMENT default-locale (#PCDATA)>
-
-<!--
- The "default-value" contains the value for the property or attribute
- in which this element resides. This value differs from the
- "suggested-value" in that the property or attribute must take the
- value, whereas in "suggested-value" taking the value is optional.
--->
-<!ELEMENT default-value (#PCDATA)>
-
-<!--
- The "description" element contains a textual description of the element
- it is nested in, optionally flagged with a language code using the
- "xml:lang" attribute.
--->
-<!ELEMENT description ANY>
-<!ATTLIST description xml:lang %Language; #IMPLIED>
-
-
-<!--
- The "display-name" element is a short descriptive name describing the
- entity associated with the element it is nested in, intended to be
- displayed by tools, and optionally flagged with a language code using
- the "xml:lang" attribute.
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name xml:lang %Language; #IMPLIED>
-
-<!--
- The "faces-context-factory" element contains the fully qualified
- class name of the concrete FacesContextFactory implementation class
- that will be called when
- FactoryFinder.getFactory(FACES_CONTEXT_FACTORY) is called. It must
- be of type "ClassName".
--->
-<!ELEMENT faces-context-factory (#PCDATA)>
-
-<!--
- The "from-action" element contains an action reference expression
- that must have been executed (by the default ActionListener for handling
- application level events) in order to select this navigation rule. If
- not specified, this rule will be relevant no matter which action reference
- was executed (or if no action reference was executed).
-
- This value must be of type "Action".
--->
-<!ELEMENT from-action (#PCDATA)>
-
-
-<!--
- The "from-outcome" element contains a logical outcome string returned
- by the execution of an application action method selected via an
- "actionRef" property (or a literal value specified by an "action"
- property) of a UICommand component. If specified, this rule will be
- relevant only if the outcome value matches this element's value. If
- not specified, this rule will be relevant no matter what the outcome
- value was.
--->
-<!ELEMENT from-outcome (#PCDATA)>
-
-
-<!--
- The "from-view-id" element contains the view identifier of the view
- for which the containing navigation rule is relevant. If no
- "from-view" element is specified, this rule applies to navigation
- decisions on all views. If this element is not specified, a value
- of "*" is assumed, meaning that this navigation rule applies to all
- views.
-
- This value must be of type "ViewIdPattern".
--->
-<!ELEMENT from-view-id (#PCDATA)>
-
-
-<!--
- The "key" element is the String representation of a map key that
- will be stored in a managed property of type java.util.Map.
--->
-<!ELEMENT key (#PCDATA)>
-
-
-<!--
- The "key-class" element defines the Java type to which each "key"
- element in a set of "map-entry" elements will be converted to. It
- must be of type "ClassName". If omitted, "java.lang.String"
- is assumed.
--->
-<!ELEMENT key-class (#PCDATA)>
-
-
-<!--
- The "large-icon" element contains the resource path to a large (32x32)
- icon image. The image may be in either GIF or JPG format.
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
- The "lifecycle-factory" element contains the fully qualified class name
- of the concrete LifecycleFactory implementation class that will be called
- when FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called. It must be
- of type "ClassName".
--->
-<!ELEMENT lifecycle-factory (#PCDATA)>
-
-<!--
- The "managed-bean-class" element represents the fully qualified class
- name of the Java class that will be used to instantiate a new instance
- if creation of the specified managed bean is requested. It must be of
- type "ClassName".
-
- The specified class must conform to standard JavaBeans conventions.
- In particular, it must have a public zero-arguments constructor, and
- zero or more public property setters.
--->
-<!ELEMENT managed-bean-class (#PCDATA)>
-
-
-<!--
- The "managed-bean-name" element represents the attribute name under
- which a managed bean will be searched for, as well as stored (unless
- the "managed-bean-scope" value is "none"). It must be of type
- "Identifier".
--->
-<!ELEMENT managed-bean-name (#PCDATA)>
-
-
-<!--
- The "managed-bean-scope" element represents the scope into which a newly
- created instance of the specified managed bean will be stored (unless
- the value is "none"). It must be of type "ScopeOrNone".
--->
-<!ELEMENT managed-bean-scope (#PCDATA)>
-
-<!--
- The "navigation-handler" element contains the fully qualified class name
- of the concrete NavigationHandler implementation class that will be called
- during the Invoke Application phase of the request processing lifecycle,
- if the default ActionListener (provided by the JSF implementation) is used.
- It must be of type "ClassName".
--->
-<!ELEMENT navigation-handler (#PCDATA)>
-
-<!--
-The "phase-listener" element contains the fully qualified class
-name of the concrete PhaseListener implementation class that will be
-registered on the Lifecycle. It must be of type "ClassName".
--->
-<!ELEMENT phase-listener (#PCDATA)>
-
-<!--
- The "redirect" element indicates that navigation to the specified
- "to-view-id" should be accomplished by performing an HTTP redirect
- rather than the usual ViewHandler mechanisms.
--->
-<!ELEMENT redirect EMPTY>
-
-<!--
- The "suggested-value" contains the value for the property or
- attribute in which this element resides. This value is advisory
- only and is intended for tools to use when populating pallettes.
--->
-<!ELEMENT suggested-value (#PCDATA)>
-
-
-<!--
-
- The "view-handler" element contains the fully qualified class name
- of the concrete ViewHandler implementation class that will be called
- during the Restore View and Render Response phases of the request
- processing lifecycle. The faces implementation must provide a
- default implementation of this class
--->
-<!ELEMENT view-handler (#PCDATA)>
-
-<!--
-
- The "state-manager" element contains the fully qualified class name
- of the concrete StateManager implementation class that will be called
- during the Restore View and Render Response phases of the request
- processing lifecycle. The faces implementation must provide a
- default implementation of this class
--->
-<!ELEMENT state-manager (#PCDATA)>
-
-<!--
- The "null-value" element indicates that the managed property in which we
- are nested will be explicitly set to null if our managed bean is
- automatically created. This is different from omitting the managed
- property element entirely, which will cause no property setter to be
- called for this property.
-
- The "null-value" element can only be used when the associated
- "property-class" identifies a Java class, not a Java primitive.
--->
-<!ELEMENT null-value EMPTY>
-
-
-<!--
- The "property-class" element represents the Java type of the value
- associated with this property name. It must be of type "JavaType".
- If not specified, it can be inferred from existing classes; however,
- this element should be specified if the configuration file is going
- to be the source for generating the corresponding classes.
--->
-<!ELEMENT property-class (#PCDATA)>
-
-
-<!--
- The "property-name" element represents the JavaBeans property name
- under which the corresponding value may be stored.
--->
-<!ELEMENT property-name (#PCDATA)>
-
-
-<!--
- The "property-resolver" element contains the fully qualified class name
- of the concrete PropertyResolver implementation class that will be used
- during the processing of value binding expressions.
- It must be of type "ClassName".
--->
-<!ELEMENT property-resolver (#PCDATA)>
-
-
-<!--
- The "referenced-bean-class" element represents the fully qualified class
- name of the Java class (either abstract or concrete) or Java interface
- implemented by the corresponding referenced bean. It must be of type
- "ClassName".
--->
-<!ELEMENT referenced-bean-class (#PCDATA)>
-
-
-<!--
- The "referenced-bean-name" element represents the attribute name under
- which the corresponding referenced bean may be assumed to be stored,
- in one of the scopes defined by the "Scope" type. It must be of type
- "Identifier".
--->
-<!ELEMENT referenced-bean-name (#PCDATA)>
-
-
-<!--
- The "render-kit-id" element represents an identifier for the
- RenderKit represented by the parent "render-kit" element.
--->
-<!ELEMENT render-kit-id (#PCDATA)>
-
-
-<!--
- The "render-kit-class" element represents the fully qualified class name
- of a concrete RenderKit implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT render-kit-class (#PCDATA)>
-
-
-<!--
- The "renderer-class" element represents the fully qualified class name
- of a concrete Renderer implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT renderer-class (#PCDATA)>
-
-<!--
- The "render-kit-factory" element contains the fully qualified class name
- of the concrete RenderKitFactory implementation class that will be called
- when FactoryFinder.getFactory(RENDER_KIT_FACTORY) is called. It must be
- of type "ClassName".
--->
-<!ELEMENT render-kit-factory (#PCDATA)>
-
-<!--
- The "renderer-type" element represents a renderer type identifier for the
- Renderer represented by the parent "renderer" element.
--->
-<!ELEMENT renderer-type (#PCDATA)>
-
-<!--
- The "small-icon" element contains the resource path to a large (16x16)
- icon image. The image may be in either GIF or JPG format.
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
- The "supported-locale" element allows authors to declare which
- locales are supported in this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]] without
- the colons, for example "ja_JP_SJIS". The separators between the
- segments may be '-' or '_'.
--->
-<!ELEMENT supported-locale (#PCDATA)>
-
-<!--
- The "to-view" element contains the view identifier of the next view
- that should be displayed if this navigation rule is matched. It
- must be of type "ViewId".
--->
-<!ELEMENT to-view-id (#PCDATA)>
-
-
-<!--
- The "validator-class" element represents the fully qualified class name
- of a concrete Validator implementation class. It must be of
- type "ClassName".
--->
-<!ELEMENT validator-class (#PCDATA)>
-
-
-<!--
- The "validator-id" element represents the identifier under which the
- corresponding Validator class should be registered.
--->
-<!ELEMENT validator-id (#PCDATA)>
-
-
-<!--
- The "value" element is the String representation of a literal
- value to which a scalar managed property will be set, or a value
- binding expression ("#{...}") that will be used to calculate the
- required value. It will be converted as specified for the actual
- property type.
--->
-<!ELEMENT value (#PCDATA)>
-
-
-<!--
- The "value-class" element defines the Java type to which each
- "value" element's value will be converted to, prior to adding it to
- the "list-entries" list for a managed property that is a
- java.util.List, or a "map-entries" map for a managed property that
- is a java.util.Map. It must be of type "ClassName". If omitted,
- "java.lang.String" is assumed.
--->
-<!ELEMENT value-class (#PCDATA)>
-
-<!--
- The "variable-resolver" element contains the fully qualified class name
- of the concrete VariableResolver implementation class that will be used
- during the processing of value binding expressions.
- It must be of type "ClassName".
--->
-<!ELEMENT variable-resolver (#PCDATA)>
-
-
-<!-- ============================ Identifier Attributes ==================== -->
-
-
-<!ATTLIST action-listener id ID #IMPLIED>
-<!ATTLIST application id ID #IMPLIED>
-<!ATTLIST application-factory id ID #IMPLIED>
-<!ATTLIST attribute id ID #IMPLIED>
-<!ATTLIST attribute-class id ID #IMPLIED>
-<!ATTLIST attribute-extension id ID #IMPLIED>
-<!ATTLIST attribute-name id ID #IMPLIED>
-<!ATTLIST component id ID #IMPLIED>
-<!ATTLIST component-class id ID #IMPLIED>
-<!ATTLIST component-extension id ID #IMPLIED>
-<!ATTLIST component-family id ID #IMPLIED>
-<!ATTLIST component-type id ID #IMPLIED>
-<!ATTLIST converter id ID #IMPLIED>
-<!ATTLIST converter-class id ID #IMPLIED>
-<!ATTLIST converter-for-class id ID #IMPLIED>
-<!ATTLIST converter-id id ID #IMPLIED>
-<!ATTLIST default-locale id ID #IMPLIED>
-<!ATTLIST default-render-kit-id id ID #IMPLIED>
-<!ATTLIST default-value id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST faces-config id ID #IMPLIED>
-<!ATTLIST faces-context-factory id ID #IMPLIED>
-<!ATTLIST facet id ID #IMPLIED>
-<!ATTLIST facet-extension id ID #IMPLIED>
-<!ATTLIST facet-name id ID #IMPLIED>
-<!ATTLIST factory id ID #IMPLIED>
-<!ATTLIST from-action id ID #IMPLIED>
-<!ATTLIST from-outcome id ID #IMPLIED>
-<!ATTLIST from-view-id id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST key id ID #IMPLIED>
-<!ATTLIST key-class id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST lifecycle id ID #IMPLIED>
-<!ATTLIST lifecycle-factory id ID #IMPLIED>
-<!ATTLIST list-entries id ID #IMPLIED>
-<!ATTLIST locale-config id ID #IMPLIED>
-<!ATTLIST managed-bean id ID #IMPLIED>
-<!ATTLIST managed-bean-class id ID #IMPLIED>
-<!ATTLIST managed-bean-name id ID #IMPLIED>
-<!ATTLIST managed-bean-scope id ID #IMPLIED>
-<!ATTLIST managed-property id ID #IMPLIED>
-<!ATTLIST map-entries id ID #IMPLIED>
-<!ATTLIST map-entry id ID #IMPLIED>
-<!ATTLIST message-bundle id ID #IMPLIED>
-<!ATTLIST navigation-case id ID #IMPLIED>
-<!ATTLIST navigation-handler id ID #IMPLIED>
-<!ATTLIST navigation-rule id ID #IMPLIED>
-<!ATTLIST null-value id ID #IMPLIED>
-<!ATTLIST phase-listener id ID #IMPLIED>
-<!ATTLIST property id ID #IMPLIED>
-<!ATTLIST property-class id ID #IMPLIED>
-<!ATTLIST property-extension id ID #IMPLIED>
-<!ATTLIST property-name id ID #IMPLIED>
-<!ATTLIST property-resolver id ID #IMPLIED>
-<!ATTLIST redirect id ID #IMPLIED>
-<!ATTLIST referenced-bean id ID #IMPLIED>
-<!ATTLIST referenced-bean-class id ID #IMPLIED>
-<!ATTLIST referenced-bean-name id ID #IMPLIED>
-<!ATTLIST render-kit id ID #IMPLIED>
-<!ATTLIST render-kit-class id ID #IMPLIED>
-<!ATTLIST render-kit-factory id ID #IMPLIED>
-<!ATTLIST render-kit-id id ID #IMPLIED>
-<!ATTLIST renderer id ID #IMPLIED>
-<!ATTLIST renderer-class id ID #IMPLIED>
-<!ATTLIST renderer-extension id ID #IMPLIED>
-<!ATTLIST renderer-type id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST state-manager id ID #IMPLIED>
-<!ATTLIST suggested-value id ID #IMPLIED>
-<!ATTLIST supported-locale id ID #IMPLIED>
-<!ATTLIST to-view-id id ID #IMPLIED>
-<!ATTLIST validator id ID #IMPLIED>
-<!ATTLIST validator-class id ID #IMPLIED>
-<!ATTLIST validator-id id ID #IMPLIED>
-<!ATTLIST value id ID #IMPLIED>
-<!ATTLIST value-class id ID #IMPLIED>
-<!ATTLIST variable-resolver id ID #IMPLIED>
-<!ATTLIST view-handler id ID #IMPLIED>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_2.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_2.xsd
deleted file mode 100644
index de857f0f0c..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_1_2.xsd
+++ /dev/null
@@ -1,2071 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.2">
-
- <xsd:annotation>
- <xsd:documentation>
- $Id: web-facesconfig_1_2.xsd,v 1.1 2007/05/25 21:12:49 david_williams Exp $
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2005 Sun Microsystems, Inc.,
- 901 San Antonio Road,
- Palo Alto, California 94303, U.S.A.
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property
- rights relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, Java EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
-
- The XML Schema for the JavaServer Faces Application
- Configuration File (Version 1.2).
-
- All JavaServer Faces configuration files must indicate
- the JavaServer Faces schema by indicating the JavaServer
- Faces namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="1.2">
- ...
- </faces-config>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for javaee namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
- <!-- **************************************************** -->
-
- <xsd:element name = "faces-config" type="javaee:faces-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-config" element is the root of the configuration
- information hierarchy, and contains nested elements for all
- of the other configuration settings.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="faces-config-converter-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Converter IDs must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:converter"/>
- <xsd:field xpath="javaee:converter-id"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-converter-for-class-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- 'converter-for-class' element values must be unique
- within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:converter"/>
- <xsd:field xpath="javaee:converter-for-class"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-validator-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Validator IDs must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:validator"/>
- <xsd:field xpath="javaee:validator-id"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-managed-bean-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Managed bean names must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:managed-bean"/>
- <xsd:field xpath="javaee:managed-bean-name"/>
- </xsd:unique>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-config" element is the root of the configuration
- information hierarchy, and contains nested elements for all
- of the other configuration settings.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="application"
- type="javaee:faces-config-applicationType"/>
- <xsd:element name="factory"
- type="javaee:faces-config-factoryType"/>
- <xsd:element name="component"
- type="javaee:faces-config-componentType"/>
- <xsd:element name="converter"
- type="javaee:faces-config-converterType"/>
- <xsd:element name="managed-bean"
- type="javaee:faces-config-managed-beanType"/>
- <xsd:element name="navigation-rule"
- type="javaee:faces-config-navigation-ruleType"/>
- <xsd:element name="referenced-bean"
- type="javaee:faces-config-referenced-beanType"/>
- <xsd:element name="render-kit"
- type="javaee:faces-config-render-kitType"/>
- <xsd:element name="lifecycle"
- type="javaee:faces-config-lifecycleType"/>
- <xsd:element name="validator"
- type="javaee:faces-config-validatorType"/>
- <xsd:element name="faces-config-extension"
- type="javaee:faces-config-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- <xsd:attribute name="version"
- type="javaee:faces-config-versionType"
- use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for faces-config. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "application" element provides a mechanism to define the
- various per-application-singleton implementation artifacts for
- a particular web application that is utilizing
- JavaServer Faces. For nested elements that are not specified,
- the JSF implementation must provide a suitable default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="action-listener"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "action-listener" element contains the fully
- qualified class name of the concrete
- ActionListener implementation class that will be
- called during the Invoke Application phase of the
- request processing lifecycle.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-render-kit-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-render-kit-id" element allows the
- application to define a renderkit to be used other
- than the standard one.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-bundle"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The base name of a resource bundle representing
- the message resources for this application. See
- the JavaDocs for the "java.util.ResourceBundle"
- class for more information on the syntax of
- resource bundle names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="navigation-handler"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-handler" element contains the
- fully qualified class name of the concrete
- NavigationHandler implementation class that will
- be called during the Invoke Application phase
- of the request processing lifecycle, if the
- default ActionListener (provided by the JSF
- implementation) is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="view-handler"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "view-handler" element contains the fully
- qualified class name of the concrete ViewHandler
- implementation class that will be called during
- the Restore View and Render Response phases of the
- request processing lifecycle. The faces
- implementation must provide a default
- implementation of this class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="state-manager"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "state-manager" element contains the fully
- qualified class name of the concrete StateManager
- implementation class that will be called during
- the Restore View and Render Response phases of the
- request processing lifecycle. The faces
- implementation must provide a default
- implementation of this class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="el-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "el-resolver" element contains the fully
- qualified class name of the concrete
- javax.el.ELResolver implementation class
- that will be used during the processing of
- EL expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-resolver" element contains the fully
- qualified class name of the concrete
- PropertyResolver implementation class that will
- be used during the processing of value binding
- expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="variable-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "variable-resolver" element contains the fully
- qualified class name of the concrete
- VariableResolver implementation class that will
- be used during the processing of value binding
- expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="locale-config"
- type="javaee:faces-config-locale-configType"/>
- <xsd:element
- name="resource-bundle"
- type="javaee:faces-config-application-resource-bundleType"/>
- <xsd:element name="application-extension"
- type="javaee:faces-config-application-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="faces-config-application-resource-bundleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-bundle element inside the application element
- references a java.util.ResourceBundle instance by name
- using the var element. ResourceBundles referenced in this
- manner may be returned by a call to
- Application.getResourceBundle() passing the current
- FacesContext for this request and the value of the var
- element below.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="base-name"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully qualified class name of the
- java.util.ResourceBundle instance.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="var"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The name by which this ResourceBundle instance
- is retrieved by a call to
- Application.getResourceBundle().
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-application-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for application. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-factoryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "factory" element provides a mechanism to define the
- various Factories that comprise parts of the implementation
- of JavaServer Faces. For nested elements that are not
- specified, the JSF implementation must provide a suitable
- default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="application-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "application-factory" element contains the
- fully qualified class name of the concrete
- ApplicationFactory implementation class that will
- be called when
- FactoryFinder.getFactory(APPLICATION_FACTORY) is
- called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="faces-context-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-context-factory" element contains the
- fully qualified class name of the concrete
- FacesContextFactory implementation class that will
- be called when
- FactoryFinder.getFactory(FACES_CONTEXT_FACTORY)
- is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lifecycle-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "lifecycle-factory" element contains the fully
- qualified class name of the concrete LifecycleFactory
- implementation class that will be called when
- FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="render-kit-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-factory" element contains the fully
- qualified class name of the concrete RenderKitFactory
- implementation class that will be called when
- FactoryFinder.getFactory(RENDER_KIT_FACTORY) is
- called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="factory-extension"
- type="javaee:faces-config-factory-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-factory-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for factory. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute" element represents a named, typed, value
- associated with the parent UIComponent via the generic
- attributes mechanism.
-
- Attribute names must be unique within the scope of the parent
- (or related) component.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="attribute-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute-name" element represents the name under
- which the corresponding value will be stored, in the
- generic attributes of the UIComponent we are related
- to.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute-class" element represents the Java type
- of the value associated with this attribute name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-value"
- type="javaee:faces-config-default-valueType"
- minOccurs="0"/>
- <xsd:element name="suggested-value"
- type="javaee:faces-config-suggested-valueType"
- minOccurs="0"/>
- <xsd:element name="attribute-extension"
- type="javaee:faces-config-attribute-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-attribute-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for attribute. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-componentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component" element represents a concrete UIComponent
- implementation class that should be registered under the
- specified type identifier, along with its associated
- properties and attributes. Component types must be unique
- within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- are recognized by the implementation logic of this component.
- Nested "property" elements identify JavaBeans properties of
- the component class that may be exposed for manipulation
- via tools.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="component-type"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-type" element represents the name under
- which the corresponding UIComponent class should be
- registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="component-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-class" element represents the fully
- qualified class name of a concrete UIComponent
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet"
- type="javaee:faces-config-facetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="component-extension"
- type="javaee:faces-config-component-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-component-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for component. It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-default-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-locale" element declares the default locale
- for this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]]
- without the colons, for example "ja_JP_SJIS". The
- separators between the segments may be '-' or '_'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-localeType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-
- <xsd:complexType name="faces-config-default-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-value" contains the value for the property or
- attribute in which this element resides. This value differs
- from the "suggested-value" in that the property or attribute
- must take the value, whereas in "suggested-value" taking the
- value is optional.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-el-expressionType">
- <xsd:annotation>
- <xsd:documentation>
-
- EL expressions present within a faces config file
- must start with the character sequence of '#{' and
- end with '}'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="#\{.*\}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-facetType">
- <xsd:annotation>
- <xsd:documentation>
-
- Define the name and other design-time information for a facet
- that is associated with a renderer or a component.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="facet-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "facet-name" element represents the facet name
- under which a UIComponent will be added to its parent.
- It must be of type "Identifier".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet-extension"
- type="javaee:faces-config-facet-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-facet-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for facet. It may contain implementation
- specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-from-view-idType">
- <xsd:annotation>
- <xsd:documentation>
-
- The value of from-view-id must contain one of the following
- values:
-
- - The exact match for a view identifier that is recognized
- by the the ViewHandler implementation being used (such as
- "/index.jsp" if you are using the default ViewHandler).
-
- - A proper prefix of a view identifier, plus a trailing
- "*" character. This pattern indicates that all view
- identifiers that match the portion of the pattern up to
- the asterisk will match the surrounding rule. When more
- than one match exists, the match with the longest pattern
- is selected.
-
- - An "*" character, which means that this pattern applies
- to all view identifiers.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-from-actionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "from-action" element contains an action reference
- expression that must have been executed (by the default
- ActionListener for handling application level events)
- in order to select the navigation rule. If not specified,
- this rule will be relevant no matter which action reference
- was executed (or if no action reference was executed).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-el-expressionType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-converterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter" element represents a concrete Converter
- implementation class that should be registered under the
- specified converter identifier. Converter identifiers must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- may be configured on the corresponding UIComponent in order
- to affect the operation of the Converter. Nested "property"
- elements identify JavaBeans properties of the Converter
- implementation class that may be configured to affect the
- operation of the Converter. "attribute" and "property"
- elements are intended to allow component developers to
- more completely describe their components to tools and users.
- These elements have no required runtime semantics.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:choice>
- <xsd:element name="converter-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-id" element represents the
- identifier under which the corresponding
- Converter class should be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="converter-for-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-for-class" element represents the
- fully qualified class name for which a Converter
- class will be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- <xsd:element name="converter-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-class" element represents the fully
- qualified class name of a concrete Converter
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "attribute" elements identify generic
- attributes that may be configured on the
- corresponding UIComponent in order to affect the
- operation of the Converter. This attribute is
- primarily for design-time tools and is not
- specified to have any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "property" elements identify JavaBeans
- properties of the Converter implementation class
- that may be configured to affect the operation of
- the Converter. This attribute is primarily for
- design-time tools and is not specified to have
- any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter-extension"
- type="javaee:faces-config-converter-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-converter-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for converter. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-lifecycleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "lifecycle" element provides a mechanism to specify
- modifications to the behaviour of the default Lifecycle
- implementation for this web application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="phase-listener"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The "phase-listener" element contains the fully
- qualified class name of the concrete PhaseListener
- implementation class that will be registered on
- the Lifecycle.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lifecycle-extension"
- type="javaee:faces-config-lifecycle-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-lifecycle-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for lifecycle. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localeType defines valid locale defined by ISO-639-1
- and ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-locale-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "locale-config" element allows the app developer to
- declare the supported locales for this application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="default-locale"
- type="javaee:faces-config-default-localeType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="supported-locale"
- type="javaee:faces-config-supported-localeType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean" element represents a JavaBean, of a
- particular class, that will be dynamically instantiated
- at runtime (by the default VariableResolver implementation)
- if it is referenced as the first element of a value binding
- expression, and no corresponding bean can be identified in
- any scope. In addition to the creation of the managed bean,
- and the optional storing of it into the specified scope,
- the nested managed-property elements can be used to
- initialize the contents of settable JavaBeans properties of
- the created instance.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="managed-bean-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-name" element represents the
- attribute name under which a managed bean will
- be searched for, as well as stored (unless the
- "managed-bean-scope" value is "none").
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="managed-bean-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-class" element represents the fully
- qualified class name of the Java class that will be
- used`to instantiate a new instance if creation of the
- specified`managed bean is requested.
-
- The specified class must conform to standard JavaBeans
- conventions. In particular, it must have a public
- zero-arguments constructor, and zero or more public
- property setters.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="managed-bean-scope"
- type="javaee:faces-config-managed-bean-scopeOrNoneType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-scope" element represents the scope
- into which a newly created instance of the specified
- managed bean will be stored (unless the value is
- "none").
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="managed-property"
- type="javaee:faces-config-managed-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="map-entries"
- type="javaee:faces-config-map-entriesType"/>
- <xsd:element name="list-entries"
- type="javaee:faces-config-list-entriesType"/>
- </xsd:choice>
- <xsd:element name="managed-bean-extension"
- type="javaee:faces-config-managed-bean-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-managed-bean-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for managed-bean. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-bean-scopeOrNoneType">
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
- Defines the legal values for the <managed-bean-scope>
- element's body content, which includes all of the scopes
- normally used in a web application, plus the "none" value
- indicating that a created bean should not be stored into
- any scope.
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="request"/>
- <xsd:enumeration value="session"/>
- <xsd:enumeration value="application"/>
- <xsd:enumeration value="none"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-property" element represents an individual
- property of a managed bean that will be configured to the
- specified value (or value set) if the corresponding
- managed bean is automatically created.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="property-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-name" element represents the JavaBeans
- property name under which the corresponding value may
- be stored.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-class"
- type="javaee:java-typeType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-class" element represents the Java type
- of the value associated with this property name.
- If not specified, it can be inferred from existing
- classes; however, this element should be specified
- if the configuration file is going to be the source
- for generating the corresponding classes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="map-entries"
- type="javaee:faces-config-map-entriesType"/>
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType">
- </xsd:element>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- <xsd:element name="list-entries"
- type="javaee:faces-config-list-entriesType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-map-entryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "map-entry" element reprsents a single key-entry pair
- that will be added to the computed value of a managed
- property of type java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "key" element is the String representation of a
- map key that will be stored in a managed property of
- type java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType"/>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-map-entriesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "map-entries' element represents a set of key-entry pairs
- that will be added to the computed value of a managed property
- of type java.util.Map. In addition, the Java class types
- of the key and entry values may be optionally declared.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="key-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "key-class" element defines the Java type to which
- each "key" element in a set of "map-entry" elements
- will be converted to. If omitted, "java.lang.String"
- is assumed.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="value-class"
- type="javaee:faces-config-value-classType"
- minOccurs="0"/>
- <xsd:element name="map-entry"
- type="javaee:faces-config-map-entryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-navigation-caseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-case" element describes a particular
- combination of conditions that must match for this case to
- be executed, and the view id of the component tree that
- should be selected next.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="from-action"
- type="javaee:faces-config-from-actionType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="from-outcome"
- type="javaee:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "from-outcome" element contains a logical outcome
- string returned by the execution of an application
- action method selected via an "actionRef" property
- (or a literal value specified by an "action" property)
- of a UICommand component. If specified, this rule
- will be relevant only if the outcome value matches
- this element's value. If not specified, this rule
- will be relevant no matter what the outcome value was.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="to-view-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "to-view-id" element contains the view identifier
- of the next view that should be displayed if this
- navigation rule is matched.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="redirect"
- type="javaee:faces-config-redirectType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-navigation-ruleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-rule" element represents an individual
- decision rule that will be utilized by the default
- NavigationHandler implementation to make decisions on
- what view should be displayed next, based on the
- view id being processed.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="from-view-id"
- type="javaee:faces-config-from-view-idType"
- minOccurs="0"/>
- <xsd:element name="navigation-case"
- type="javaee:faces-config-navigation-caseType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element
- name="navigation-rule-extension"
- type="javaee:faces-config-navigation-rule-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-navigation-rule-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for navigation-rule. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-null-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "null-value" element indicates that the managed
- property in which we are nested will be explicitly
- set to null if our managed bean is automatically
- created. This is different from omitting the managed
- property element entirely, which will cause no
- property setter to be called for this property.
-
- The "null-value" element can only be used when the
- associated "property-class" identifies a Java class,
- not a Java primitive.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property" element represents a JavaBean property of the
- Java class represented by our parent element.
-
- Property names must be unique within the scope of the Java
- class that is represented by the parent element, and must
- correspond to property names that will be recognized when
- performing introspection against that class via
- java.beans.Introspector.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="property-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-name" element represents the JavaBeans
- property name under which the corresponding value
- may be stored.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-class"
- type="javaee:java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-class" element represents the Java type
- of the value associated with this property name.
- If not specified, it can be inferred from existing
- classes; however, this element should be specified if
- the configuration file is going to be the source for
- generating the corresponding classes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-value"
- type="javaee:faces-config-default-valueType"
- minOccurs="0"/>
- <xsd:element name="suggested-value"
- type="javaee:faces-config-suggested-valueType"
- minOccurs="0"/>
- <xsd:element name="property-extension"
- type="javaee:faces-config-property-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-property-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for property. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-redirectType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "redirect" element indicates that navigation to the
- specified "to-view-id" should be accomplished by
- performing an HTTP redirect rather than the usual
- ViewHandler mechanisms.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-referenced-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean" element represents at design time the
- promise that a Java object of the specified type will exist at
- runtime in some scope, under the specified key. This can be
- used by design time tools to construct user interface dialogs
- based on the properties of the specified class. The presence
- or absence of a referenced bean element has no impact on the
- JavaServer Faces runtime environment inside a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="referenced-bean-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean-name" element represents the
- attribute name under which the corresponding
- referenced bean may be assumed to be stored, in one
- of 'request', 'session', or 'application' scopes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="referenced-bean-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean-class" element represents the
- fully qualified class name of the Java class
- (either abstract or concrete) or Java interface
- implemented by the corresponding referenced bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-render-kitType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit" element represents a concrete RenderKit
- implementation that should be registered under the specified
- render-kit-id. If no render-kit-id is specified, the
- identifier of the default RenderKit
- (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="render-kit-id"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-id" element represents an identifier
- for the RenderKit represented by the parent
- "render-kit" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="render-kit-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-class" element represents the fully
- qualified class name of a concrete RenderKit
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer"
- type="javaee:faces-config-rendererType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="render-kit-extension"
- type="javaee:faces-config-render-kit-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-rendererType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer" element represents a concrete Renderer
- implementation class that should be registered under the
- specified component family and renderer type identifiers,
- in the RenderKit associated with the parent "render-kit"
- element. Combinations of component family and
- renderer type must be unique within the RenderKit
- associated with the parent "render-kit" element.
-
- Nested "attribute" elements identify generic component
- attributes that are recognized by this renderer.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="component-family"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-family" element represents the
- component family for which the Renderer represented
- by the parent "renderer" element will be used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer-type"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer-type" element represents a renderer type
- identifier for the Renderer represented by the parent
- "renderer" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer-class" element represents the fully
- qualified class name of a concrete Renderer
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet"
- type="javaee:faces-config-facetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="renderer-extension"
- type="javaee:faces-config-renderer-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-renderer-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for renderer. It may contain implementation
- specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-render-kit-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for render-kit. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-suggested-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "suggested-value" contains the value for the property or
- attribute in which this element resides. This value is
- advisory only and is intended for tools to use when
- populating pallettes.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-supported-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "supported-locale" element allows authors to declare
- which locales are supported in this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]]
- without the colons, for example "ja_JP_SJIS". The
- separators between the segments may be '-' or '_'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-localeType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-validatorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator" element represents a concrete Validator
- implementation class that should be registered under the
- specified validator identifier. Validator identifiers must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- may be configured on the corresponding UIComponent in order
- to affect the operation of the Validator. Nested "property"
- elements identify JavaBeans properties of the Validator
- implementation class that may be configured to affect the
- operation of the Validator. "attribute" and "property"
- elements are intended to allow component developers to
- more completely describe their components to tools and users.
- These elements have no required runtime semantics.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="validator-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator-id" element represents the identifier
- under which the corresponding Validator class should
- be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="validator-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator-class" element represents the fully
- qualified class name of a concrete Validator
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "attribute" elements identify generic
- attributes that may be configured on the
- corresponding UIComponent in order to affect the
- operation of the Validator. This attribute is
- primarily for design-time tools and is not
- specified to have any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "property" elements identify JavaBeans
- properties of the Validator implementation class
- that may be configured to affect the operation of
- the Validator. This attribute is primarily for
- design-time tools and is not specified to have
- any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="validator-extension"
- type="javaee:faces-config-validator-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-validator-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for validator. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "value" element is the String representation of
- a literal value to which a scalar managed property
- will be set, or a value binding expression ("#{...}")
- that will be used to calculate the required value.
- It will be converted as specified for the actual
- property type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:union
- memberTypes="javaee:faces-config-el-expressionType xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-value-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "value-class" element defines the Java type to which each
- "value" element's value will be converted to, prior to adding
- it to the "list-entries" list for a managed property that is
- a java.util.List, or a "map-entries" map for a managed
- property that is a java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-list-entriesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "list-entries" element represents a set of initialization
- elements for a managed property that is a java.util.List or an
- array. In the former case, the "value-class" element can
- optionally be used to declare the Java type to which each
- value should be converted before adding it to the Collection.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-class"
- type="javaee:faces-config-value-classType"
- minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType"/>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type contains the recognized versions of
- faces-config supported.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="1.2"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd
deleted file mode 100644
index 92e80f913c..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd
+++ /dev/null
@@ -1,2698 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
-
- The XML Schema for the JavaServer Faces Application
- Configuration File (Version 2.0).
-
- All JavaServer Faces configuration files must indicate
- the JavaServer Faces schema by indicating the JavaServer
- Faces namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="2.0">
- ...
- </faces-config>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for javaee namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
- <!-- **************************************************** -->
-
- <xsd:element name = "faces-config" type="javaee:faces-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-config" element is the root of the configuration
- information hierarchy, and contains nested elements for all
- of the other configuration settings.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:unique name="faces-config-behavior-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Behavior IDs must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:behavior"/>
- <xsd:field xpath="javaee:behavior-id"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-converter-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Converter IDs must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:converter"/>
- <xsd:field xpath="javaee:converter-id"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-converter-for-class-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- 'converter-for-class' element values must be unique
- within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:converter"/>
- <xsd:field xpath="javaee:converter-for-class"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-validator-ID-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Validator IDs must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:validator"/>
- <xsd:field xpath="javaee:validator-id"/>
- </xsd:unique>
-
- <xsd:unique name="faces-config-managed-bean-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- Managed bean names must be unique within a document.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:selector xpath="javaee:managed-bean"/>
- <xsd:field xpath="javaee:managed-bean-name"/>
- </xsd:unique>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-config" element is the root of the configuration
- information hierarchy, and contains nested elements for all
- of the other configuration settings.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="application"
- type="javaee:faces-config-applicationType"/>
- <xsd:element name="ordering"
- type="javaee:faces-config-orderingType"/>
- <xsd:element name="absolute-ordering"
- type="javaee:faces-config-absoluteOrderingType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="factory"
- type="javaee:faces-config-factoryType"/>
- <xsd:element name="component"
- type="javaee:faces-config-componentType"/>
- <xsd:element name="converter"
- type="javaee:faces-config-converterType"/>
- <xsd:element name="managed-bean"
- type="javaee:faces-config-managed-beanType"/>
- <xsd:element name="name"
- type="javaee:java-identifierType"
- minOccurs="0"
- maxOccurs="1">
- <xsd:annotation>
- <xsd:documentation>
-
- The "name" element within the top level "faces-config"
- element declares the name of this application
- configuration resource. Such names are used
- in the document ordering scheme specified in section
- JSF.11.4.6.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="navigation-rule"
- type="javaee:faces-config-navigation-ruleType"/>
- <xsd:element name="referenced-bean"
- type="javaee:faces-config-referenced-beanType"/>
- <xsd:element name="render-kit"
- type="javaee:faces-config-render-kitType"/>
- <xsd:element name="lifecycle"
- type="javaee:faces-config-lifecycleType"/>
- <xsd:element name="validator"
- type="javaee:faces-config-validatorType"/>
- <xsd:element name="behavior"
- type="javaee:faces-config-behaviorType"/>
- <xsd:element name="faces-config-extension"
- type="javaee:faces-config-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name="metadata-complete"
- type="xsd:boolean"
- use="optional">
- <xsd:annotation>
- <xsd:documentation>
-
- The metadata-complete attribute defines whether this
- JavaServer Faces application is complete, or whether
- the class files available to this module and packaged with
- this application should be examined for annotations
- that specify configuration information.
-
- This attribute is only inspected on the application
- configuration resource file located at "WEB-INF/faces-config.xml".
- The presence of this attribute on any application configuration
- resource other than the one located at "WEB-INF/faces-config.xml",
- including any files named using the javax.faces.CONFIG_FILES
- attribute, must be ignored.
-
- If metadata-complete is set to "true", the JavaServer Faces
- runtime must ignore any annotations that specify configuration
- information, which might be present in the class files
- of the application.
-
- If metadata-complete is not specified or is set to
- "false", the JavaServer Faces runtime must examine the class
- files of the application for annotations, as specified by
- the specification.
-
- If "WEB-INF/faces-config.xml" is not present, the JavaServer
- Faces runtime will assume metadata-complete to be "false".
-
- The value of this attribute will have no impact on
- runtime annotations such as @ResourceDependency or
- @ListenerFor.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID" />
- <xsd:attribute name="version"
- type="javaee:faces-config-versionType"
- use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for faces-config. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
-
- <xsd:complexType name="faces-config-orderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Please see section JSF.11.4.6 for the specification of this element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="after"
- type="javaee:faces-config-ordering-orderingType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="before"
- type="javaee:faces-config-ordering-orderingType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="faces-config-ordering-orderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains a sequence of "id" elements, each of which
- refers to an application configuration resource by the "id"
- declared on its faces-config element. This element can also contain
- a single "others" element which specifies that this document comes
- before or after other documents within the application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="faces-config-ordering-othersType">
- <xsd:annotation>
- <xsd:documentation>
-
- This element indicates that the ordering sub-element in which
- it was placed should take special action regarding the ordering
- of this application resource relative to other
- application configuration resources. See section JSF.11.4.6
- for the complete specification.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
-
- <xsd:complexType name="faces-config-absoluteOrderingType">
- <xsd:annotation>
- <xsd:documentation>
-
- Only relevant if this is placed within the /WEB-INF/faces-config.xml.
- Please see section JSF.11.4.6 for the specification for details.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
- </xsd:choice>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
-
- <xsd:complexType name="faces-config-applicationType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "application" element provides a mechanism to define the
- various per-application-singleton implementation artifacts for
- a particular web application that is utilizing
- JavaServer Faces. For nested elements that are not specified,
- the JSF implementation must provide a suitable default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="action-listener"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "action-listener" element contains the fully
- qualified class name of the concrete
- ActionListener implementation class that will be
- called during the Invoke Application phase of the
- request processing lifecycle.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-render-kit-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-render-kit-id" element allows the
- application to define a renderkit to be used other
- than the standard one.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="message-bundle"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The base name of a resource bundle representing
- the message resources for this application. See
- the JavaDocs for the "java.util.ResourceBundle"
- class for more information on the syntax of
- resource bundle names.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="navigation-handler"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-handler" element contains the
- fully qualified class name of the concrete
- NavigationHandler implementation class that will
- be called during the Invoke Application phase
- of the request processing lifecycle, if the
- default ActionListener (provided by the JSF
- implementation) is used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="view-handler"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "view-handler" element contains the fully
- qualified class name of the concrete ViewHandler
- implementation class that will be called during
- the Restore View and Render Response phases of the
- request processing lifecycle. The faces
- implementation must provide a default
- implementation of this class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="state-manager"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "state-manager" element contains the fully
- qualified class name of the concrete StateManager
- implementation class that will be called during
- the Restore View and Render Response phases of the
- request processing lifecycle. The faces
- implementation must provide a default
- implementation of this class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="el-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "el-resolver" element contains the fully
- qualified class name of the concrete
- javax.el.ELResolver implementation class
- that will be used during the processing of
- EL expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-resolver" element contains the fully
- qualified class name of the concrete
- PropertyResolver implementation class that will
- be used during the processing of value binding
- expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="variable-resolver"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "variable-resolver" element contains the fully
- qualified class name of the concrete
- VariableResolver implementation class that will
- be used during the processing of value binding
- expressions.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="resource-handler"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- The "resource-handler" element contains the
- fully qualified class name of the concrete
- ResourceHandler implementation class that
- will be used during rendering and decoding
- of resource requests The standard
- constructor based decorator pattern used for
- other application singletons will be
- honored.
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="system-event-listener"
- type="javaee:faces-config-system-event-listenerType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- <xsd:element
- name="locale-config"
- type="javaee:faces-config-locale-configType"/>
- <xsd:element
- name="resource-bundle"
- type="javaee:faces-config-application-resource-bundleType"/>
- <xsd:element name="application-extension"
- type="javaee:faces-config-application-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element
- name="default-validators"
- type="javaee:faces-config-default-validatorsType"/>
- </xsd:choice>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <xsd:complexType name="faces-config-application-resource-bundleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-bundle element inside the application element
- references a java.util.ResourceBundle instance by name
- using the var element. ResourceBundles referenced in this
- manner may be returned by a call to
- Application.getResourceBundle() passing the current
- FacesContext for this request and the value of the var
- element below.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="base-name"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully qualified class name of the
- java.util.ResourceBundle instance.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="var"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The name by which this ResourceBundle instance
- is retrieved by a call to
- Application.getResourceBundle().
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-application-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for application. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-factoryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "factory" element provides a mechanism to define the
- various Factories that comprise parts of the implementation
- of JavaServer Faces. For nested elements that are not
- specified, the JSF implementation must provide a suitable
- default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="application-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "application-factory" element contains the
- fully qualified class name of the concrete
- ApplicationFactory implementation class that will
- be called when
- FactoryFinder.getFactory(APPLICATION_FACTORY) is
- called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="exception-handler-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "exception-handler-factory" element contains the
- fully qualified class name of the concrete
- ExceptionHandlerFactory implementation class that will
- be called when
- FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY)
- is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-context-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "external-context-factory" element contains the
- fully qualified class name of the concrete
- ExternalContextFactory implementation class that will
- be called when
- FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY)
- is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="faces-context-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "faces-context-factory" element contains the
- fully qualified class name of the concrete
- FacesContextFactory implementation class that will
- be called when
- FactoryFinder.getFactory(FACES_CONTEXT_FACTORY)
- is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="partial-view-context-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "partial-view-context-factory" element contains the
- fully qualified class name of the concrete
- PartialViewContextFactory implementation class that will
- be called when FactoryFinder.getFactory
- (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="lifecycle-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "lifecycle-factory" element contains the fully
- qualified class name of the concrete LifecycleFactory
- implementation class that will be called when
- FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="view-declaration-language-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "view-declaration-language-factory" element contains
- the fully qualified class name of the concrete
- ViewDeclarationLanguageFactory
- implementation class that will be called when
- FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="tag-handler-delegate-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "tag-handler-delegate-factory" element contains
- the fully qualified class name of the concrete
- ViewDeclarationLanguageFactory
- implementation class that will be called when
- FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="render-kit-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-factory" element contains the fully
- qualified class name of the concrete RenderKitFactory
- implementation class that will be called when
- FactoryFinder.getFactory(RENDER_KIT_FACTORY) is
- called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="visit-context-factory"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "visit-context-factory" element contains the fully
- qualified class name of the concrete VisitContextFactory
- implementation class that will be called when
- FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is
- called.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="factory-extension"
- type="javaee:faces-config-factory-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-factory-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for factory. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute" element represents a named, typed, value
- associated with the parent UIComponent via the generic
- attributes mechanism.
-
- Attribute names must be unique within the scope of the parent
- (or related) component.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="attribute-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute-name" element represents the name under
- which the corresponding value will be stored, in the
- generic attributes of the UIComponent we are related
- to.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute-class" element represents the Java type
- of the value associated with this attribute name.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-value"
- type="javaee:faces-config-default-valueType"
- minOccurs="0"/>
- <xsd:element name="suggested-value"
- type="javaee:faces-config-suggested-valueType"
- minOccurs="0"/>
- <xsd:element name="attribute-extension"
- type="javaee:faces-config-attribute-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name = "id" type = "xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-attribute-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for attribute. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-componentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component" element represents a concrete UIComponent
- implementation class that should be registered under the
- specified type identifier, along with its associated
- properties and attributes. Component types must be unique
- within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- are recognized by the implementation logic of this component.
- Nested "property" elements identify JavaBeans properties of
- the component class that may be exposed for manipulation
- via tools.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="component-type"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-type" element represents the name under
- which the corresponding UIComponent class should be
- registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="component-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-class" element represents the fully
- qualified class name of a concrete UIComponent
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet"
- type="javaee:faces-config-facetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="component-extension"
- type="javaee:faces-config-component-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-component-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for component. It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-default-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-locale" element declares the default locale
- for this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]]
- without the colons, for example "ja_JP_SJIS". The
- separators between the segments may be '-' or '_'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-localeType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-
- <xsd:complexType name="faces-config-default-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-value" contains the value for the property or
- attribute in which this element resides. This value differs
- from the "suggested-value" in that the property or attribute
- must take the value, whereas in "suggested-value" taking the
- value is optional.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-el-expressionType">
- <xsd:annotation>
- <xsd:documentation>
-
- EL expressions present within a faces config file
- must start with the character sequence of '#{' and
- end with '}'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="#\{.*\}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-facetType">
- <xsd:annotation>
- <xsd:documentation>
-
- Define the name and other design-time information for a facet
- that is associated with a renderer or a component.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="facet-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "facet-name" element represents the facet name
- under which a UIComponent will be added to its parent.
- It must be of type "Identifier".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet-extension"
- type="javaee:faces-config-facet-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-facet-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for facet. It may contain implementation
- specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-from-view-idType">
- <xsd:annotation>
- <xsd:documentation>
-
- The value of from-view-id must contain one of the following
- values:
-
- - The exact match for a view identifier that is recognized
- by the the ViewHandler implementation being used (such as
- "/index.jsp" if you are using the default ViewHandler).
-
- - A proper prefix of a view identifier, plus a trailing
- "*" character. This pattern indicates that all view
- identifiers that match the portion of the pattern up to
- the asterisk will match the surrounding rule. When more
- than one match exists, the match with the longest pattern
- is selected.
-
- - An "*" character, which means that this pattern applies
- to all view identifiers.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-from-actionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "from-action" element contains an action reference
- expression that must have been executed (by the default
- ActionListener for handling application level events)
- in order to select the navigation rule. If not specified,
- this rule will be relevant no matter which action reference
- was executed (or if no action reference was executed).
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-el-expressionType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-ifType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "if" element defines a condition that must resolve
- to true in order for the navigation case on which it is
- defined to be matched, with the existing match criteria
- (action method and outcome) as a prerequiste, if present.
- The condition is defined declaratively using a value
- expression in the body of this element. The expression is
- evaluated at the time the navigation case is being matched.
- If the "from-outcome" is omitted and this element is
- present, the navigation handler will match a null outcome
- and use the condition return value to determine if the
- case should be considered a match.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-el-expressionType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-converterType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter" element represents a concrete Converter
- implementation class that should be registered under the
- specified converter identifier. Converter identifiers must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- may be configured on the corresponding UIComponent in order
- to affect the operation of the Converter. Nested "property"
- elements identify JavaBeans properties of the Converter
- implementation class that may be configured to affect the
- operation of the Converter. "attribute" and "property"
- elements are intended to allow component developers to
- more completely describe their components to tools and users.
- These elements have no required runtime semantics.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:choice>
- <xsd:element name="converter-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-id" element represents the
- identifier under which the corresponding
- Converter class should be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="converter-for-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-for-class" element represents the
- fully qualified class name for which a Converter
- class will be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
-
- <xsd:element name="converter-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "converter-class" element represents the fully
- qualified class name of a concrete Converter
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "attribute" elements identify generic
- attributes that may be configured on the
- corresponding UIComponent in order to affect the
- operation of the Converter. This attribute is
- primarily for design-time tools and is not
- specified to have any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "property" elements identify JavaBeans
- properties of the Converter implementation class
- that may be configured to affect the operation of
- the Converter. This attribute is primarily for
- design-time tools and is not specified to have
- any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter-extension"
- type="javaee:faces-config-converter-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-converter-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for converter. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-lifecycleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "lifecycle" element provides a mechanism to specify
- modifications to the behaviour of the default Lifecycle
- implementation for this web application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="phase-listener"
- type="javaee:fully-qualified-classType"
- minOccurs="0"
- maxOccurs="unbounded">
-
- <xsd:annotation>
- <xsd:documentation>
-
- The "phase-listener" element contains the fully
- qualified class name of the concrete PhaseListener
- implementation class that will be registered on
- the Lifecycle.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lifecycle-extension"
- type="javaee:faces-config-lifecycle-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-lifecycle-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for lifecycle. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The localeType defines valid locale defined by ISO-639-1
- and ISO-3166.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="([a-z]{2})[_|\-]?([\p{L}]{2})?[_|\-]?(\w+)?"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-locale-configType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "locale-config" element allows the app developer to
- declare the supported locales for this application.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="default-locale"
- type="javaee:faces-config-default-localeType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="supported-locale"
- type="javaee:faces-config-supported-localeType"
- minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-default-validatorsType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "default-validators" element allows the app developer to
- register a set of validators, referenced by identifier, that
- are automatically assigned to any EditableValueHolder component
- in the application, unless overridden or disabled locally.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="validator-id"
- type="javaee:string"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator-id" element represents the identifier
- of a registered validator.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean" element represents a JavaBean, of a
- particular class, that will be dynamically instantiated
- at runtime (by the default VariableResolver implementation)
- if it is referenced as the first element of a value binding
- expression, and no corresponding bean can be identified in
- any scope. In addition to the creation of the managed bean,
- and the optional storing of it into the specified scope,
- the nested managed-property elements can be used to
- initialize the contents of settable JavaBeans properties of
- the created instance.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="managed-bean-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-name" element represents the
- attribute name under which a managed bean will
- be searched for, as well as stored (unless the
- "managed-bean-scope" value is "none").
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="managed-bean-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-class" element represents the fully
- qualified class name of the Java class that will be
- used`to instantiate a new instance if creation of the
- specified`managed bean is requested.
-
- The specified class must conform to standard JavaBeans
- conventions. In particular, it must have a public
- zero-arguments constructor, and zero or more public
- property setters.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="managed-bean-scope"
- type="javaee:faces-config-managed-bean-scopeOrNoneType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-bean-scope" element represents the scope
- into which a newly created instance of the specified
- managed bean will be stored (unless the value is
- "none").
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="managed-property"
- type="javaee:faces-config-managed-propertyType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="map-entries"
- type="javaee:faces-config-map-entriesType"/>
- <xsd:element name="list-entries"
- type="javaee:faces-config-list-entriesType"/>
- </xsd:choice>
- <xsd:element name="managed-bean-extension"
- type="javaee:faces-config-managed-bean-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="eager"
- type="xsd:boolean"
- use="optional">
- <xsd:annotation>
- <xsd:documentation>
-
- This attribute is only considered when associated with
- an application-scoped managed bean. If the value of the eager
- attribute is true the runtime must instantiate this class
- and store the instance within the application scope when the
- application starts.
-
- If eager is unspecified or is false, the default "lazy"
- instantiation and scoped storage of the managed bean
- will occur.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-managed-bean-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for managed-bean. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-bean-scopeOrNoneType">
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
- Defines the legal values for the <managed-bean-scope>
- element's body content, which includes all of the scopes
- normally used in a web application, plus the "none" value
- indicating that a created bean should not be stored into
- any scope. Alternatively, an EL expression may be used
- as the value of this element. The result of evaluating this
- expression must by of type java.util.Map.
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:pattern value="view|request|session|application|none|#\{.*\}"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-managed-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "managed-property" element represents an individual
- property of a managed bean that will be configured to the
- specified value (or value set) if the corresponding
- managed bean is automatically created.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="property-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-name" element represents the JavaBeans
- property name under which the corresponding value may
- be stored.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-class"
- type="javaee:java-typeType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-class" element represents the Java type
- of the value associated with this property name.
- If not specified, it can be inferred from existing
- classes; however, this element should be specified
- if the configuration file is going to be the source
- for generating the corresponding classes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="map-entries"
- type="javaee:faces-config-map-entriesType"/>
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType">
- </xsd:element>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- <xsd:element name="list-entries"
- type="javaee:faces-config-list-entriesType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-map-entryType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "map-entry" element reprsents a single key-entry pair
- that will be added to the computed value of a managed
- property of type java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "key" element is the String representation of a
- map key that will be stored in a managed property of
- type java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType"/>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-map-entriesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "map-entries' element represents a set of key-entry pairs
- that will be added to the computed value of a managed property
- of type java.util.Map. In addition, the Java class types
- of the key and entry values may be optionally declared.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="key-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "key-class" element defines the Java type to which
- each "key" element in a set of "map-entry" elements
- will be converted to. If omitted, "java.lang.String"
- is assumed.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="value-class"
- type="javaee:faces-config-value-classType"
- minOccurs="0"/>
- <xsd:element name="map-entry"
- type="javaee:faces-config-map-entryType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-navigation-caseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-case" element describes a particular
- combination of conditions that must match for this case to
- be executed, and the view id of the component tree that
- should be selected next.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="from-action"
- type="javaee:faces-config-from-actionType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="from-outcome"
- type="javaee:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "from-outcome" element contains a logical outcome
- string returned by the execution of an application
- action method selected via an "actionRef" property
- (or a literal value specified by an "action" property)
- of a UICommand component. If specified, this rule
- will be relevant only if the outcome value matches
- this element's value. If not specified, this rule
- will be relevant if the outcome value is non-null
- or, if the "if" element is present, will be relevant
- for any outcome value, with the assumption that the
- condition specified in the "if" element ultimately
- determines if this rule is a match.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="if"
- type="javaee:faces-config-ifType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Please see section JSF.7.4.2 for the specification of this element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="to-view-id"
- type="javaee:faces-config-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "to-view-id" element contains the view identifier
- of the next view that should be displayed if this
- navigation rule is matched. If the contents is a
- value expression, it should be resolved by the
- navigation handler to obtain the view identifier.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="redirect"
- type="javaee:faces-config-redirectType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-navigation-ruleType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "navigation-rule" element represents an individual
- decision rule that will be utilized by the default
- NavigationHandler implementation to make decisions on
- what view should be displayed next, based on the
- view id being processed.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="from-view-id"
- type="javaee:faces-config-from-view-idType"
- minOccurs="0"/>
- <xsd:element name="navigation-case"
- type="javaee:faces-config-navigation-caseType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element
- name="navigation-rule-extension"
- type="javaee:faces-config-navigation-rule-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-navigation-rule-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for navigation-rule. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-null-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "null-value" element indicates that the managed
- property in which we are nested will be explicitly
- set to null if our managed bean is automatically
- created. This is different from omitting the managed
- property element entirely, which will cause no
- property setter to be called for this property.
-
- The "null-value" element can only be used when the
- associated "property-class" identifies a Java class,
- not a Java primitive.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-propertyType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property" element represents a JavaBean property of the
- Java class represented by our parent element.
-
- Property names must be unique within the scope of the Java
- class that is represented by the parent element, and must
- correspond to property names that will be recognized when
- performing introspection against that class via
- java.beans.Introspector.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="property-name"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-name" element represents the JavaBeans
- property name under which the corresponding value
- may be stored.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property-class"
- type="javaee:java-typeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "property-class" element represents the Java type
- of the value associated with this property name.
- If not specified, it can be inferred from existing
- classes; however, this element should be specified if
- the configuration file is going to be the source for
- generating the corresponding classes.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="default-value"
- type="javaee:faces-config-default-valueType"
- minOccurs="0"/>
- <xsd:element name="suggested-value"
- type="javaee:faces-config-suggested-valueType"
- minOccurs="0"/>
- <xsd:element name="property-extension"
- type="javaee:faces-config-property-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-property-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for property. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-redirectType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "redirect" element indicates that navigation to the
- specified "to-view-id" should be accomplished by
- performing an HTTP redirect rather than the usual
- ViewHandler mechanisms.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="view-param"
- type="javaee:faces-config-redirect-viewParamType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- <xsd:attribute name="include-view-params" type="xsd:boolean" use="optional"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-redirect-viewParamType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "view-param" element, only valid within
- a "redirect" element, contains child "name"
- and "value" elements that must be included in the
- redirect url when the redirect is performed.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name"
- type="javaee:string"
- minOccurs="1" maxOccurs="1"/>
- <xsd:element name="value"
- type="javaee:string"
- minOccurs="1" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-referenced-beanType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean" element represents at design time the
- promise that a Java object of the specified type will exist at
- runtime in some scope, under the specified key. This can be
- used by design time tools to construct user interface dialogs
- based on the properties of the specified class. The presence
- or absence of a referenced bean element has no impact on the
- JavaServer Faces runtime environment inside a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="referenced-bean-name"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean-name" element represents the
- attribute name under which the corresponding
- referenced bean may be assumed to be stored, in one
- of 'request', 'session', 'view', 'application'
- or a custom scope.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="referenced-bean-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "referenced-bean-class" element represents the
- fully qualified class name of the Java class
- (either abstract or concrete) or Java interface
- implemented by the corresponding referenced bean.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-render-kitType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit" element represents a concrete RenderKit
- implementation that should be registered under the specified
- render-kit-id. If no render-kit-id is specified, the
- identifier of the default RenderKit
- (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="render-kit-id"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-id" element represents an identifier
- for the RenderKit represented by the parent
- "render-kit" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="render-kit-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The "render-kit-class" element represents the fully
- qualified class name of a concrete RenderKit
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer"
- type="javaee:faces-config-rendererType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="client-behavior-renderer"
- type="javaee:faces-config-client-behavior-rendererType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="render-kit-extension"
- type="javaee:faces-config-render-kit-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-client-behavior-rendererType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "client-behavior-renderer" element represents a concrete
- ClientBehaviorRenderer implementation class that should be
- registered under the specified behavior renderer type identifier,
- in the RenderKit associated with the parent "render-kit"
- element. Client Behavior renderer type must be unique within the RenderKit
- associated with the parent "render-kit" element.
-
- Nested "attribute" elements identify generic component
- attributes that are recognized by this renderer.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="client-behavior-renderer-type"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "client-behavior-renderer-type" element represents a renderer type
- identifier for the Client Behavior Renderer represented by the parent
- "client-behavior-renderer" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="client-behavior-renderer-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "client-behavior-renderer-class" element represents the fully
- qualified class name of a concrete Client Behavior Renderer
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="faces-config-rendererType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer" element represents a concrete Renderer
- implementation class that should be registered under the
- specified component family and renderer type identifiers,
- in the RenderKit associated with the parent "render-kit"
- element. Combinations of component family and
- renderer type must be unique within the RenderKit
- associated with the parent "render-kit" element.
-
- Nested "attribute" elements identify generic component
- attributes that are recognized by this renderer.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="component-family"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "component-family" element represents the
- component family for which the Renderer represented
- by the parent "renderer" element will be used.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer-type"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer-type" element represents a renderer type
- identifier for the Renderer represented by the parent
- "renderer" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="renderer-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "renderer-class" element represents the fully
- qualified class name of a concrete Renderer
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="facet"
- type="javaee:faces-config-facetType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="renderer-extension"
- type="javaee:faces-config-renderer-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-renderer-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for renderer. It may contain implementation
- specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-render-kit-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for render-kit. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-suggested-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "suggested-value" contains the value for the property or
- attribute in which this element resides. This value is
- advisory only and is intended for tools to use when
- populating pallettes.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-supported-localeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "supported-locale" element allows authors to declare
- which locales are supported in this application instance.
-
- It must be specified as :language:[_:country:[_:variant:]]
- without the colons, for example "ja_JP_SJIS". The
- separators between the segments may be '-' or '_'.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="javaee:faces-config-localeType">
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-behaviorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "behavior" element represents a concrete Behavior
- implementation class that should be registered under the
- specified behavior identifier. Behavior identifiers must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- may be configured on the corresponding UIComponent in order
- to affect the operation of the Behavior. Nested "property"
- elements identify JavaBeans properties of the Behavior
- implementation class that may be configured to affect the
- operation of the Behavior. "attribute" and "property"
- elements are intended to allow component developers to
- more completely describe their components to tools and users.
- These elements have no required runtime semantics.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="behavior-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "behavior-id" element represents the identifier
- under which the corresponding Behavior class should
- be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="behavior-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "behavior-class" element represents the fully
- qualified class name of a concrete Behavior
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "attribute" elements identify generic
- attributes that may be configured on the
- corresponding UIComponent in order to affect the
- operation of the Behavior. This attribute is
- primarily for design-time tools and is not
- specified to have any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "property" elements identify JavaBeans
- properties of the Behavior implementation class
- that may be configured to affect the operation of
- the Behavior. This attribute is primarily for
- design-time tools and is not specified to have
- any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="behavior-extension"
- type="javaee:faces-config-behavior-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-behavior-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for behavior. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-validatorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator" element represents a concrete Validator
- implementation class that should be registered under the
- specified validator identifier. Validator identifiers must
- be unique within the entire web application.
-
- Nested "attribute" elements identify generic attributes that
- may be configured on the corresponding UIComponent in order
- to affect the operation of the Validator. Nested "property"
- elements identify JavaBeans properties of the Validator
- implementation class that may be configured to affect the
- operation of the Validator. "attribute" and "property"
- elements are intended to allow component developers to
- more completely describe their components to tools and users.
- These elements have no required runtime semantics.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="validator-id"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator-id" element represents the identifier
- under which the corresponding Validator class should
- be registered.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="validator-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "validator-class" element represents the fully
- qualified class name of a concrete Validator
- implementation class.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute"
- type="javaee:faces-config-attributeType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "attribute" elements identify generic
- attributes that may be configured on the
- corresponding UIComponent in order to affect the
- operation of the Validator. This attribute is
- primarily for design-time tools and is not
- specified to have any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="property"
- type="javaee:faces-config-propertyType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Nested "property" elements identify JavaBeans
- properties of the Validator implementation class
- that may be configured to affect the operation of
- the Validator. This attribute is primarily for
- design-time tools and is not specified to have
- any meaning at runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="validator-extension"
- type="javaee:faces-config-validator-extensionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name = "faces-config-validator-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Extension element for validator. It may contain
- implementation specific content.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "value" element is the String representation of
- a literal value to which a scalar managed property
- will be set, or a value binding expression ("#{...}")
- that will be used to calculate the required value.
- It will be converted as specified for the actual
- property type.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:union
- memberTypes="javaee:faces-config-el-expressionType xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-value-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "value-class" element defines the Java type to which each
- "value" element's value will be converted to, prior to adding
- it to the "list-entries" list for a managed property that is
- a java.util.List, or a "map-entries" map for a managed
- property that is a java.util.Map.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:restriction base="javaee:fully-qualified-classType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-list-entriesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "list-entries" element represents a set of initialization
- elements for a managed property that is a java.util.List or an
- array. In the former case, the "value-class" element can
- optionally be used to declare the Java type to which each
- value should be converted before adding it to the Collection.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-class"
- type="javaee:faces-config-value-classType"
- minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="null-value"
- type="javaee:faces-config-null-valueType"/>
- <xsd:element name="value"
- type="javaee:faces-config-valueType"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="faces-config-system-event-listenerType">
- <xsd:annotation>
- <xsd:documentation>
-
- The presence of this element within the "application" element in
- an application configuration resource file indicates the
- developer wants to add an SystemEventListener to this
- application instance. Elements nested within this element allow
- selecting the kinds of events that will be delivered to the
- listener instance, and allow selecting the kinds of classes that
- can be the source of events that are delivered to the listener
- instance.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="system-event-listener-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "system-event-listener-class" element contains
- the fully qualified class name of the concrete
- SystemEventListener implementation class that will be
- called when events of the type specified by the
- "system-event-class" are sent by the runtime.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="system-event-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "system-event-class" element contains the fully
- qualified class name of the SystemEvent subclass for
- which events will be delivered to the class whose fully
- qualified class name is given by the
- "system-event-listener-class" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-class" minOccurs="0"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "source-class" element, if present, contains the
- fully qualified class name of the class that will be the
- source for the event to be delivered to the class whose
- fully qualified class name is given by the
- "system-event-listener-class" element.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="faces-config-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type contains the recognized versions of
- faces-config supported.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="2.0"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd
deleted file mode 100644
index 2800606a68..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-
-
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
-
- The XML Schema for a JavaServer Faces UIComponent (Version 2.0).
-
- The elements in this schema may be used in an XHTML page for
- a composite component, by pulling in the composite namespace:
-
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:composite="http://java.sun.com/jsf/composite">
-
- <composite:interface>
- <composite:attribute name="foo" default="bar" />
- </composite:/interface>
- <!-- the rest omitted -->
-</html>
-
- The elements in this schema may also be used in a facelet taglibrary
- file in the same manner:
-
-<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:composite="http://java.sun.com/jsf/composite"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd"
- version="2.0">
- <namespace>http://domain.com/test_schema</namespace>
- <tag>
- <tag-name>testSchema</tag-name>
- <component>
- <component-type>javax.faces.Input</component-type>
- <renderer-type>javax.faces.Text</renderer-type>
- <handler-class>com.sun.faces.facelets.tag.jsf.ComponentHandler</handler-class>
- <component-extension>
-
- <composite:attribute name="foo" default="bar" />
-
- </component-extension>
- </component>
- </tag>
-</facelet-taglib>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for javaee namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
- <!-- **************************************************** -->
-
- <xsd:element name = "attribute" type="javaee:uicomponent-attributeType">
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="uicomponent-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attribute" element declares an attribute of this
- ui component.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="attribute"
- type="javaee:uicomponent-attributeType"/>
- </xsd:choice>
-
- <xsd:attribute name="name"
- type="xsd:string"
- use="required"/>
-
- <xsd:attribute name="displayName"
- type="xsd:string"
- use="optional"/>
-
- <xsd:attribute name="shortDescription"
- type="xsd:string"
- use="optional"/>
-
- <xsd:attribute name="default"
- type="xsd:string"
- use="optional"/>
-
- <xsd:attribute name="method-signature"
- type="xsd:string"
- use="optional">
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- Provides the signature of the Java method. The syntax of
- the method-signature element is as follows (taken from
- function-signature in web-jsptaglibrary_2_1.xsd):
-
- MethodSignature ::= ReturnType S MethodName S?
- '(' S? Parameters? S? ')'
-
- ReturnType ::= Type
-
- MethodName ::= Identifier
-
- Parameters ::= Parameter
- | ( Parameter S? ',' S? Parameters )
-
- Parameter ::= Type
-
- Where:
-
- * Type is a basic type or a fully qualified
- Java class name (including package name),
- as per the 'Type' production in the Java
- Language Specification, Second Edition,
- Chapter 18.
-
- * Identifier is a Java identifier, as per
- the 'Identifier' production in the Java
- Language Specification, Second
- Edition, Chapter 18.
-
- Example:
-
- java.lang.String nickName( java.lang.String, int )
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
-
- <xsd:attribute name="applyTo"
- type="xsd:string"
- use="optional"/>
-
- <xsd:attribute name="required"
- type="xsd:boolean"
- use="optional"/>
-
- <xsd:attribute name="preferred"
- type="xsd:boolean"
- use="optional"/>
-
- <xsd:attribute name="expert"
- type="xsd:boolean"
- use="optional"/>
-
-
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd
deleted file mode 100644
index fdd422d776..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd
+++ /dev/null
@@ -1,272 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="3.0">
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[[
- This is the XML Schema for the Servlet 3.0 deployment descriptor.
- The deployment descriptor must be named "META-INF/web-fragment.xml"
- in the web fragment's jar file. All Servlet deployment descriptors
- must indicate the web application schema by using the Java EE
- namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="3.0">
- ...
- </web-fragment>
-
- The instance documents may indicate the published version of
- the schema using the xsi:schemaLocation attribute for Java EE
- namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- The following conventions apply to all Java EE
- deployment descriptor elements unless indicated otherwise.
-
- - In elements that specify a pathname to a file within the
- same JAR file, relative filenames (i.e., those not
- starting with "/") are considered relative to the root of
- the JAR file's namespace. Absolute filenames (i.e., those
- starting with "/") also specify names in the root of the
- JAR file's namespace. In general, relative names are
- preferred. The exception is .war files where absolute
- names are preferred for consistency with the Servlet API.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="web-common_3_0.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="web-fragment"
- type="javaee:web-fragmentType">
- <xsd:annotation>
- <xsd:documentation>
-
- The web-fragment element is the root of the deployment
- descriptor for a web fragment. Note that the sub-elements
- of this element can be in the arbitrary order. Because of
- that, the multiplicity of the elements of distributable,
- session-config, welcome-file-list, jsp-config, login-config,
- and locale-encoding-mapping-list was changed from "?" to "*"
- in this schema. However, the deployment descriptor instance
- file must not contain multiple elements of session-config,
- jsp-config, and login-config. When there are multiple elements of
- welcome-file-list or locale-encoding-mapping-list, the container
- must concatenate the element contents. The multiple occurence
- of the element distributable is redundant and the container
- treats that case exactly in the same way when there is only
- one distributable.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="web-common-servlet-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The servlet element contains the name of a servlet.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet"/>
- <xsd:field xpath="javaee:servlet-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-filter-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The filter element contains the name of a filter.
- The name must be unique within the web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:filter"/>
- <xsd:field xpath="javaee:filter-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-local-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-local-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-ejb-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The ejb-ref-name element contains the name of an EJB
- reference. The EJB reference is an entry in the web
- application's environment and is relative to the
- java:comp/env context. The name must be unique within
- the web application.
-
- It is recommended that name is prefixed with "ejb/".
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:ejb-ref"/>
- <xsd:field xpath="javaee:ejb-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-resource-env-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The resource-env-ref-name element specifies the name of
- a resource environment reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-env-ref"/>
- <xsd:field xpath="javaee:resource-env-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-message-destination-ref-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The message-destination-ref-name element specifies the name of
- a message destination reference; its value is the
- environment entry name used in the web application code.
- The name is a JNDI name relative to the java:comp/env
- context and must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:message-destination-ref"/>
- <xsd:field xpath="javaee:message-destination-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-res-ref-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The res-ref-name element specifies the name of a
- resource manager connection factory reference. The name
- is a JNDI name relative to the java:comp/env context.
- The name must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:resource-ref"/>
- <xsd:field xpath="javaee:res-ref-name"/>
- </xsd:unique>
- <xsd:unique name="web-common-env-entry-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The env-entry-name element contains the name of a web
- application's environment entry. The name is a JNDI
- name relative to the java:comp/env context. The name
- must be unique within a web application.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:env-entry"/>
- <xsd:field xpath="javaee:env-entry-name"/>
- </xsd:unique>
- <xsd:key name="web-common-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- A role-name-key is specified to allow the references
- from the security-role-refs.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:security-role"/>
- <xsd:field xpath="javaee:role-name"/>
- </xsd:key>
- <xsd:keyref name="web-common-role-name-references"
- refer="javaee:web-common-role-name-key">
- <xsd:annotation>
- <xsd:documentation>
-
- The keyref indicates the references from
- security-role-ref to a specified role-name.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
- <xsd:field xpath="javaee:role-link"/>
- </xsd:keyref>
- </xsd:element>
-
-</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_1.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_1.dtd
deleted file mode 100644
index 25c8e87396..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_1.dtd
+++ /dev/null
@@ -1,265 +0,0 @@
-<!--
-Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-Copyright 1999 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-
- This is the DTD defining the JavaServer Pages 1.1 Tag Library
- descriptor (.tld) (XML) file format/syntax.
-
- A Tag Library is a JAR file containing a valid instance of a Tag Library
- Descriptor (taglib.tld) file in the META-INF subdirectory, along with the
- appropriate implementing classes, and other resources required to
- implement the tags defined therein.
-
- -->
-
-<!--
-The taglib tag is the document root, it defines:
-
-tlibversion the version of the tag library implementation
-jspversion the version of JSP the tag library depends upon
-
-shortname a simple default short name that could be used by
- a JSP authoring tool to create names with a mnemonic
- value; for example, the it may be used as the prefered
- prefix value in taglib directives
-uri a uri uniquely identifying this taglib
-info a simple string describing the "use" of this taglib,
- should be user discernable
--->
-
-<!ELEMENT taglib (tlibversion, jspversion?, shortname, uri?, info?, tag+) >
-<!ATTLIST taglib id ID #IMPLIED
- xmlns CDATA #FIXED
- "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
->
-
-<!--
-Describes this version (number) of the taglibrary (dewey decimal)
-
-#PCDATA ::= [0-9]*{ "."[0-9] }0..3
--->
-
-<!ELEMENT tlibversion (#PCDATA) >
-
-<!--
-Describes the JSP version (number) this taglibrary requires in
-order to function (dewey decimal)
-
-The default is 1.1
-
-#PCDATA ::= [0-9]*{ "."[0-9] }0..3
--->
-
-<!ELEMENT jspversion (#PCDATA) >
-
-<!--
-Defines a short (default) shortname to be used for tags and
-variable names used/created by this tag library. Do not use
-white space, and do not start with digits or underscore.
-
-#PCDATA ::= NMTOKEN
--->
-
-<!ELEMENT shortname (#PCDATA) >
-
-<!--
-Defines a public URI that uniquely identifies this version of
-the taglibrary Leave it empty if it does not apply.
--->
-
-<!ELEMENT uri (#PCDATA) >
-
-<!--
-Defines an arbitrary text string descirbing the tag library
--->
-
-<!ELEMENT info (#PCDATA) >
-
-<!--
-The tag defines a unique tag in this tag library, defining:
-
-- the unique tag/element name
-- the subclass of javax.servlet.jsp.tagext.Tag implementation class
-- an optional subclass of javax.servlet.jsp.tagext.TagExtraInfo
-- the body content type (hint)
-- optional tag-specific information
-- any attributes
--->
-
-<!ELEMENT tag (name, tagclass, teiclass?, bodycontent?, info?, attribute*) >
-
-<!--
-Defines the subclass of javax.serlvet.jsp.tagext.Tag that implements
-the request time semantics for this tag. (required)
-
-#PCDATA ::= fully qualified Java class name
--->
-
-<!ELEMENT tagclass (#PCDATA) >
-
-<!--
-Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for
-this tag. (optional)
-
-If this is not given, the class is not consulted at translation time.
-
-#PCDATA ::= fully qualified Java class name
--->
-
-<!ELEMENT teiclass (#PCDATA) >
-
-<!--
-Provides a hint as to the content of the body of this tag. Primarily
-intended for use by page composition tools.
-
-There are currently three values specified:
-
-tagdependent The body of the tag is interpreted by the tag
- implementation itself, and is most likely in a
- different "langage", e.g embedded SQL statements.
-
-JSP The body of the tag contains nested JSP syntax
-
-empty The body must be empty
-
-The default (if not defined) is JSP
-
-#PCDATA ::= tagdependent | JSP | empty
-
--->
-
-<!ELEMENT bodycontent (#PCDATA) >
-
-<!--
-The attribute tag defines an attribute for the nesting tag
-
-An attribute definition is composed of:
-
-- the attributes name (required)
-- if the attribute is required or optional (optional)
-- if the attributes value may be dynamically calculated at runtime
- by a scriptlet expression (optional)
-
--->
-
-<!ELEMENT attribute (name, required? , rtexprvalue?) >
-
-<!--
-Defines the canonical name of a tag or attribute being defined
-
-#PCDATA ::= NMTOKEN
--->
-
-<!ELEMENT name (#PCDATA) >
-
-<!--
-Defines if the nesting attribute is required or optional.
-
-#PCDATA ::= true | false | yes | no
-
-If not present then the default is "false", i.e the attribute
-is optional.
--->
-
-<!ELEMENT required (#PCDATA) >
-
-<!--
-Defines if the nesting attribute can have scriptlet expressions as
-a value, i.e the value of the attribute may be dynamically calculated
-at request time, as opposed to a static value determined at translation
-time.
-
-#PCDATA ::= true | false | yes | no
-
-If not present then the default is "false", i.e the attribute
-has a static value
--->
-
-<!ELEMENT rtexprvalue (#PCDATA) >
-
-<!ATTLIST tlibversion id ID #IMPLIED>
-<!ATTLIST jspversion id ID #IMPLIED>
-<!ATTLIST shortname id ID #IMPLIED>
-<!ATTLIST uri id ID #IMPLIED>
-<!ATTLIST info id ID #IMPLIED>
-<!ATTLIST tag id ID #IMPLIED>
-<!ATTLIST tagclass id ID #IMPLIED>
-<!ATTLIST teiclass id ID #IMPLIED>
-<!ATTLIST bodycontent id ID #IMPLIED>
-<!ATTLIST attribute id ID #IMPLIED>
-<!ATTLIST name id ID #IMPLIED>
-<!ATTLIST required id ID #IMPLIED>
-<!ATTLIST rtexprvalue id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_2.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_2.dtd
deleted file mode 100644
index 602eb5c98e..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_1_2.dtd
+++ /dev/null
@@ -1,468 +0,0 @@
-
-<!--
- Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- Use is subject to license terms.
- -->
-
-<!--
-
- This is the DTD defining the JavaServer Pages 1.2 Tag Library
- descriptor (.tld) (XML) file format/syntax.
-
- A Tag Library is a JAR file containing a valid instance of a Tag Library
- Descriptor (taglib.tld) file in the META-INF subdirectory, along with the
- appropriate implementing classes, and other resources required to
- implement the tags defined therein.
-
- Use is subject to license terms.
- -->
-
-<!NOTATION WEB-JSPTAGLIB.1_2 PUBLIC
- "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN">
-
-<!--
-This is the XML DTD for the JSP 1.2 Tag Library Descriptor.
-All JSP 1.2 tag library descriptors must include a DOCTYPE
-of the following form:
-
- <!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-
--->
-
-<!--
-The taglib tag is the document root, it defines:
-
-tlib-version the version of the tag library implementation
-
-jsp-version the version of JSP the tag library depends upon
-
-short-name a simple default short name that could be used by
- a JSP authoring tool to create names with a mnemonic
- value; for example, the it may be used as the prefered
- prefix value in taglib directives
-
-uri a uri uniquely identifying this taglib
-
-display-name the display-name element contains a short name that
- is intended to be displayed by tools
-small-icon optional small-icon that can be used by tools
-
-large-icon optional large-icon that can be used by tools
-
-description a simple string describing the "use" of this taglib,
- should be user discernable
-
-validator optional TagLibraryValidator information
-
-listener optional event listener specification
-
-
--->
-
-<!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?,
- display-name?, small-icon?, large-icon?, description?,
- validator?, listener*, tag+) >
-
-<!ATTLIST taglib id ID #IMPLIED
- xmlns CDATA #FIXED
- "http://java.sun.com/JSP/TagLibraryDescriptor"
->
-
-<!--
-Describes this version (number) of the taglibrary (dewey decimal)
-
-#PCDATA ::= [0-9]*{ "."[0-9] }0..3
--->
-
-<!ELEMENT tlib-version (#PCDATA) >
-
-<!--
-Describes the JSP version (number) this taglibrary requires in
-order to function (dewey decimal)
-
-The default is 1.2
-
-#PCDATA ::= [0-9]*{ "."[0-9] }0..3
--->
-
-<!ELEMENT jsp-version (#PCDATA) >
-
-<!--
-Defines a short (default) short-name to be used for tags and
-variable names used/created by this tag library. Do not use
-white space, and do not start with digits or underscore.
-
-#PCDATA ::= NMTOKEN
--->
-
-<!ELEMENT short-name (#PCDATA) >
-
-<!--
-Defines a public URI that uniquely identifies this version of
-the taglibrary. Leave it empty if it does not apply.
--->
-
-<!ELEMENT uri (#PCDATA) >
-
-<!--
-Defines an arbitrary text string descirbing the tag library
--->
-
-<!ELEMENT description (#PCDATA) >
-
-<!--
-
-Defines an optional validator that can be used to
-validate the conformance of a JSP page to using this tag library.
--->
-
-<!ELEMENT validator (validator-class, init-param*, description?) >
-
-
-<!--
-
-Defines the TagLibraryValidator class that can be used to
-validate the conformance of a JSP page to using this tag library.
--->
-
-<!ELEMENT validator-class (#PCDATA) >
-
-
-<!--
-
-The init-param element contains a name/value pair as an
-initialization param
--->
-
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-
-The param-name element contains the name of a parameter.
--->
-
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-
-The param-value element contains the value of a parameter.
--->
-
-<!ELEMENT param-value (#PCDATA)>
-
-
-<!--
-
-Defines an optional event listener object to be instantiated and
-registered automatically.
--->
-
-<!ELEMENT listener (listener-class) >
-
-<!--
-
-The listener-class element declares a class in the application that
-must be registered as a web application listener bean. See the
-Servlet 2.3 specification for details.
--->
-
-<!ELEMENT listener-class (#PCDATA) >
-
-
-<!--
-The tag defines a unique tag in this tag library. It has one
-attribute, id.
-
-The tag element may have several subelements defining:
-
-name The unique action name
-
-tag-class The tag handler class implementing
- javax.servlet.jsp.tagext.Tag
-
-tei-class An optional subclass of
- javax.servlet.jsp.tagext.TagExtraInfo
-
-body-content The body content type
-
-display-name A short name that is intended to be displayed
- by tools
-
-small-icon Optional small-icon that can be used by tools
-
-large-icon Optional large-icon that can be used by tools
-
-description Optional tag-specific information
-
-variable Optional scripting variable information
-
-attribute All attributes of this action
-
-example Optional informal description of an example of a
- use of this tag
-
--->
-
-<!ELEMENT tag (name, tag-class, tei-class?, body-content?, display-name?,
- small-icon?, large-icon?, description?, variable*, attribute*,
- example?) >
-
-<!--
-Defines the subclass of javax.serlvet.jsp.tagext.Tag that implements
-the request time semantics for this tag. (required)
-
-#PCDATA ::= fully qualified Java class name
--->
-
-<!ELEMENT tag-class (#PCDATA) >
-
-<!--
-Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for
-this tag. (optional)
-
-If this is not given, the class is not consulted at translation time.
-
-#PCDATA ::= fully qualified Java class name
--->
-
-<!ELEMENT tei-class (#PCDATA) >
-
-<!--
-Provides a hint as to the content of the body of this tag. Primarily
-intended for use by page composition tools.
-
-There are currently three values specified:
-
-tagdependent The body of the tag is interpreted by the tag
- implementation itself, and is most likely in a
- different "langage", e.g embedded SQL statements.
-
-JSP The body of the tag contains nested JSP syntax
-
-empty The body must be empty
-
-The default (if not defined) is JSP
-
-#PCDATA ::= tagdependent | JSP | empty
-
--->
-
-<!ELEMENT body-content (#PCDATA) >
-
-<!--
-
-The display-name element contains a short name that is intended
-to be displayed by tools.
--->
-
-<!ELEMENT display-name (#PCDATA) >
-
-
-<!--
-
-The large-icon element contains the name of a file containing a large
-(32 x 32) icon image. The file name is a relative path within the
-tag library. The image must be either in the JPEG or GIF format, and
-the file name must end with the suffix ".jpg" or ".gif" respectively.
-The icon can be used by tools.
--->
-
-<!ELEMENT large-icon (#PCDATA) >
-
-<!--
-
-The small-icon element contains the name of a file containing a large
-(32 x 32) icon image. The file name is a relative path within the
-tag library. The image must be either in the JPEG or GIF format, and
-the file name must end with the suffix ".jpg" or ".gif" respectively.
-The icon can be used by tools.
--->
-
-<!ELEMENT small-icon (#PCDATA) >
-
-<!--
-
-The example element contains an informal description of an example
-of the use of a tag.
--->
-
-<!ELEMENT example (#PCDATA) >
-
-<!--
-
-The variable tag provides information on the scripting variables
-defined by this tag. It is a (translation time) error for a tag
-that has one or more variable subelements to have a TagExtraInfo
-class that returns a non-null object.
-
-The subelements of variable are of the form:
-
-name-given The variable name as a constant
-
-name-from-attribute The name of an attribute whose (translation
- time) value will give the name of the
- variable. One of name-given or
- name-from-attribute is required.
-
-variable-class Name of the class of the variable.
- java.lang.String is default.
-
-declare Whether the variable is declared or not.
- True is the default.
-
-scope The scope of the scripting varaible
- defined. NESTED is default.
-
-description Optional description of this variable
-
--->
-
-<!ELEMENT variable ( (name-given | name-from-attribute), variable-class?,
- declare?, scope?, description?) >
-
-<!--
-
-The name for the scripting variable. One of name-given or
-name-from-attribute is required.
--->
-
-<!ELEMENT name-given (#PCDATA) >
-
-<!--
-
-The name of an attribute whose (translation-time) value will give
-the name of the variable. One of name-given or name-from-attribute
-is required.
--->
-
-<!ELEMENT name-from-attribute (#PCDATA) >
-
-<!--
-
-The optional name of the class for the scripting variable. The
-default is java.lang.String.
--->
-
-<!ELEMENT variable-class (#PCDATA) >
-
-<!--
-
-Whether the scripting variable is to be defined or not. See
-TagExtraInfo for details. This element is optional and "true"
-is the default.
--->
-
-<!ELEMENT declare (#PCDATA) >
-
-<!--
-
-The scope of the scripting variable. See TagExtraInfo for details.
-The element is optional and "NESTED" is the default. Other legal
-values are "AT_BEGIN" and "AT_END".
--->
-
-<!ELEMENT scope (#PCDATA) >
-
-<!--
-
-The attribute tag defines an attribute for the nesting tag
-
-An attribute definition is composed of:
-
-- the attributes name (required)
-- if the attribute is required or optional (optional)
-- if the attributes value may be dynamically calculated at runtime
- by a scriptlet expression (optional)
-- the type of the attributes value (optional)
-- an informal description of the meaning of the attribute (optional)
-
--->
-
-
-<!--
-The attribute tag defines an attribute for the nesting tag
-
-An attribute definition is composed of:
-
-- the attributes name (required)
-
-- if the attribute is required or optional (optional)
-
-- if the attributes value may be dynamically calculated at runtime
- by a scriptlet expression (optional)
-
-- the type of the attributes value (optional)
-
-- an informal description of the meaning of the attribute (optional)
--->
-
-<!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) >
-
-<!--
-Defines the canonical name of a tag or attribute being defined
-
-#PCDATA ::= NMTOKEN
--->
-
-<!ELEMENT name (#PCDATA) >
-
-<!--
-Defines if the nesting attribute is required or optional.
-
-#PCDATA ::= true | false | yes | no
-
-If not present then the default is "false", i.e the attribute
-is optional.
--->
-
-<!ELEMENT required (#PCDATA) >
-
-<!--
-Defines if the nesting attribute can have scriptlet expressions as
-a value, i.e the value of the attribute may be dynamically calculated
-at request time, as opposed to a static value determined at translation
-time.
-
-#PCDATA ::= true | false | yes | no
-
-If not present then the default is "false", i.e the attribute
-has a static value
--->
-
-<!ELEMENT rtexprvalue (#PCDATA) >
-
-
-<!--
-
-Defines the Java type of the attributes value. For static values
-(those determined at translation time) the type is always
-java.lang.String.
--->
-
-<!ELEMENT type (#PCDATA) >
-
-
-<!-- ID attributes -->
-
-<!ATTLIST tlib-version id ID #IMPLIED>
-<!ATTLIST jsp-version id ID #IMPLIED>
-<!ATTLIST short-name id ID #IMPLIED>
-<!ATTLIST uri id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST example id ID #IMPLIED>
-<!ATTLIST tag id ID #IMPLIED>
-<!ATTLIST tag-class id ID #IMPLIED>
-<!ATTLIST tei-class id ID #IMPLIED>
-<!ATTLIST body-content id ID #IMPLIED>
-<!ATTLIST attribute id ID #IMPLIED>
-<!ATTLIST name id ID #IMPLIED>
-<!ATTLIST required id ID #IMPLIED>
-<!ATTLIST rtexprvalue id ID #IMPLIED>
-
-
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST listener id ID #IMPLIED>
-<!ATTLIST listener-class id ID #IMPLIED>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_0.xsd
deleted file mode 100644
index eb5864190f..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_0.xsd
+++ /dev/null
@@ -1,1010 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/j2ee"
- xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)web-jsptaglibrary_2_0.xsds 1.36 08/18/03
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
- Road, Palo Alto, California 94303, U.S.A. All rights
- reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the JSP Taglibrary
- descriptor. All Taglibrary descriptors must
- indicate the tag library schema by using the Taglibrary
- namespace:
-
- http://java.sun.com/xml/ns/j2ee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="2.0">
- ...
- </taglib>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for J2EE namespace with the following location:
-
- http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="j2ee_1_4.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
- <xsd:element name="taglib" type="j2ee:tldTaglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib tag is the document root.
- The definition of taglib is provided
- by the tldTaglibType.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="tag-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib element contains, among other things, tag and
- tag-file elements.
- The name subelements of these elements must each be unique.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:tag|j2ee:tag-file"/>
- <xsd:field xpath="j2ee:name"/>
- </xsd:unique>
-
- <xsd:unique name="function-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib element contains function elements.
- The name subelements of these elements must each be unique.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="j2ee:function"/>
- <xsd:field xpath="j2ee:name"/>
- </xsd:unique>
-
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="body-contentType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies the type of body that is valid for a tag.
- This value is used by the JSP container to validate
- that a tag invocation has the correct body syntax and
- by page composition tools to assist the page author
- in providing a valid tag body.
-
- There are currently four values specified:
-
- tagdependent The body of the tag is interpreted by the tag
- implementation itself, and is most likely
- in a different "language", e.g embedded SQL
- statements.
-
- JSP The body of the tag contains nested JSP
- syntax.
-
- empty The body must be empty
-
- scriptless The body accepts only template text, EL
- Expressions, and JSP action elements. No
- scripting elements are allowed.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="tagdependent"/>
- <xsd:enumeration value="JSP"/>
- <xsd:enumeration value="empty"/>
- <xsd:enumeration value="scriptless"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="extensibleType" abstract="true">
- <xsd:annotation>
- <xsd:documentation>
-
- The extensibleType is an abstract base type that is used to
- define the type of extension-elements. Instance documents
- must substitute a known type to define the extension by
- using xsi:type attribute to define the actual type of
- extension-elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="functionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The function element is used to provide information on each
- function in the tag library that is to be exposed to the EL.
-
- The function element may have several subelements defining:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name A unique name for this function
-
- function-class Provides the name of the Java class that
- implements the function
-
- function-signature Provides the signature, as in the Java
- Language Specification, of the Java
- method that is to be used to implement
- the function.
-
- example Optional informal description of an
- example of a use of this function
-
- function-extension Zero or more extensions that provide extra
- information about this function, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="name"
- type="j2ee:tld-canonical-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- A unique name for this function.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="function-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Provides the fully-qualified class name of the Java
- class containing the static method that implements
- the function.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="function-signature"
- type="j2ee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Provides the signature, of the static Java method that is
- to be used to implement the function. The syntax of the
- function-signature element is as follows:
-
- FunctionSignature ::= ReturnType S MethodName S?
- '(' S? Parameters? S? ')'
-
- ReturnType ::= Type
-
- MethodName ::= Identifier
-
- Parameters ::= Parameter
- | ( Parameter S? ',' S? Parameters )
-
- Parameter ::= Type
-
- Where:
-
- * Type is a basic type or a fully qualified Java class name
- (including package name), as per the 'Type' production
- in the Java Language Specification, Second Edition,
- Chapter 18.
-
- * Identifier is a Java identifier, as per the 'Identifier'
- production in the Java Language Specification, Second
- Edition, Chapter 18.
-
- Example:
-
- java.lang.String nickName( java.lang.String, int )
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="example"
- type="j2ee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of this function.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="function-extension"
- type="j2ee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Function extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tagFileType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an action in this tag library that is implemented
- as a .tag file.
-
- The tag-file element has two required subelements:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name The unique action name
-
- path Where to find the .tag file implementing this
- action, relative to the root of the web
- application or the root of the JAR file for a
- tag library packaged in a JAR. This must
- begin with /WEB-INF/tags if the .tag file
- resides in the WAR, or /META-INF/tags if the
- .tag file resides in a JAR.
-
- example Optional informal description of an
- example of a use of this tag
-
- tag-extension Zero or more extensions that provide extra
- information about this tag, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="name"
- type="j2ee:tld-canonical-nameType"/>
- <xsd:element name="path"
- type="j2ee:pathType"/>
- <xsd:element name="example"
- type="j2ee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of a tag.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tag-extension"
- type="j2ee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Tag extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tagType">
- <xsd:annotation>
- <xsd:documentation>
-
- The tag defines a unique tag in this tag library. It has one
- attribute, id.
-
- The tag element may have several subelements defining:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name The unique action name
-
- tag-class The tag handler class implementing
- javax.servlet.jsp.tagext.JspTag
-
- tei-class An optional subclass of
- javax.servlet.jsp.tagext.TagExtraInfo
-
- body-content The body content type
-
- variable Optional scripting variable information
-
- attribute All attributes of this action that are
- evaluated prior to invocation.
-
- dynamic-attributes Whether this tag supports additional
- attributes with dynamic names. If
- true, the tag-class must implement the
- javax.servlet.jsp.tagext.DynamicAttributes
- interface. Defaults to false.
-
- example Optional informal description of an
- example of a use of this tag
-
- tag-extension Zero or more extensions that provide extra
- information about this tag, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="name"
- type="j2ee:tld-canonical-nameType"/>
- <xsd:element name="tag-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the subclass of javax.serlvet.jsp.tagext.JspTag
- that implements the request time semantics for
- this tag. (required)
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tei-class"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo
- for this tag. (optional)
-
- If this is not given, the class is not consulted at
- translation time.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="body-content"
- type="j2ee:body-contentType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies the format for the body of this tag.
- The default in JSP 1.2 was "JSP" but because this
- is an invalid setting for simple tag handlers, there
- is no longer a default in JSP 2.0. A reasonable
- default for simple tag handlers is "scriptless" if
- the tag can have a body.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="variable"
- type="j2ee:variableType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="j2ee:tld-attributeType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="dynamic-attributes"
- type="j2ee:generic-booleanType"
- minOccurs="0"/>
- <xsd:element name="example"
- type="j2ee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of a tag.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tag-extension"
- type="j2ee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Tag extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The attribute element defines an attribute for the nesting
- tag. The attributre element may have several subelements
- defining:
-
- description a description of the attribute
-
- name the name of the attribute
-
- required whether the attribute is required or
- optional
-
- rtexprvalue whether the attribute is a runtime attribute
-
- type the type of the attributes
-
- fragment whether this attribute is a fragment
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="name"
- type="j2ee:java-identifierType"/>
- <xsd:element name="required"
- type="j2ee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines if the nesting attribute is required or
- optional.
-
- If not present then the default is "false", i.e
- the attribute is optional.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="rtexprvalue"
- type="j2ee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines if the nesting attribute can have scriptlet
- expressions as a value, i.e the value of the
- attribute may be dynamically calculated at request
- time, as opposed to a static value determined at
- translation time.
-
- If not present then the default is "false", i.e the
- attribute has a static value
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="type"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the Java type of the attributes value. For
- static values (those determined at translation time)
- the type is always java.lang.String.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="fragment"
- type="j2ee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- "true" if this attribute is of type
- javax.jsp.tagext.JspFragment, representing dynamic
- content that can be re-evaluated as many times
- as needed by the tag handler. If omitted or "false",
- the default is still type="java.lang.String"
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-canonical-nameType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the canonical name of a tag or attribute being
- defined.
-
- The name must conform to the lexical rules for an NMTOKEN.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:xsdNMTOKENType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The tld-extensionType is used to indicate
- extensions to a specific TLD element.
-
- It is used by elements to designate an extension block
- that is targeted to a specific extension designated by
- a set of extension elements that are declared by a
- namespace. The namespace identifies the extension to
- the tool that processes the extension.
-
- The type of the extension-element is abstract. Therefore,
- a concrete type must be specified by the TLD using
- xsi:type attribute for each extension-element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="extension-element"
- type="j2ee:extensibleType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="namespace"
- use="required"
- type="xsd:anyURI"/>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tldTaglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib tag is the document root, it defines:
-
- description a simple string describing the "use" of this taglib,
- should be user discernable
-
- display-name the display-name element contains a
- short name that is intended to be displayed
- by tools
-
- icon optional icon that can be used by tools
-
- tlib-version the version of the tag library implementation
-
- short-name a simple default short name that could be
- used by a JSP authoring tool to create
- names with a mnemonic value; for example,
- the it may be used as the prefered prefix
- value in taglib directives
-
- uri a uri uniquely identifying this taglib
-
- validator optional TagLibraryValidator information
-
- listener optional event listener specification
-
- tag tags in this tag library
-
- tag-file tag files in this tag library
-
- function zero or more EL functions defined in this
- tag library
-
- taglib-extension zero or more extensions that provide extra
- information about this taglib, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="j2ee:descriptionGroup"/>
- <xsd:element name="tlib-version"
- type="j2ee:dewey-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Describes this version (number) of the taglibrary.
- It is described as a dewey decimal.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- <xsd:element name="short-name"
- type="j2ee:tld-canonical-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a simple default name that could be used by
- a JSP authoring tool to create names with a
- mnemonicvalue; for example, it may be used as the
- preferred prefix value in taglib directives. Do
- not use white space, and do not start with digits
- or underscore.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="uri"
- type="j2ee:xsdAnyURIType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a public URI that uniquely identifies this
- version of the taglibrary. Leave it empty if it
- does not apply.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="validator"
- type="j2ee:validatorType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="listener"
- type="j2ee:listenerType"
- minOccurs="0" maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="tag"
- type="j2ee:tagType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="tag-file"
- type="j2ee:tagFileType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="function"
- type="j2ee:functionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="taglib-extension"
- type="j2ee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Taglib extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="j2ee:dewey-versionType"
- fixed="2.0"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- Describes the JSP version (number) this taglibrary
- requires in order to function (dewey decimal)
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="validatorType">
- <xsd:annotation>
- <xsd:documentation>
-
- A validator that can be used to validate
- the conformance of a JSP page to using this tag library is
- defined by a validatorType.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="validator-class"
- type="j2ee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the TagLibraryValidator class that can be used
- to validate the conformance of a JSP page to using this
- tag library.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="j2ee:param-valueType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-param element contains a name/value pair as an
- initialization param.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variable-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines scope of the scripting variable. See
- TagExtraInfo for details. The allowed values are,
- "NESTED", "AT_BEGIN" and "AT_END".
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="j2ee:string">
- <xsd:enumeration value="NESTED"/>
- <xsd:enumeration value="AT_BEGIN"/>
- <xsd:enumeration value="AT_END"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variableType">
- <xsd:annotation>
- <xsd:documentation>
-
- The variableType provides information on the scripting
- variables defined by using this tag. It is a (translation
- time) error for a tag that has one or more variable
- subelements to have a TagExtraInfo class that returns a
- non-null value from a call to getVariableInfo().
-
- The subelements of variableType are of the form:
-
- description Optional description of this
- variable
-
- name-given The variable name as a constant
-
- name-from-attribute The name of an attribute whose
- (translation time) value will
- give the name of the
- variable. One of name-given or
- name-from-attribute is required.
-
- variable-class Name of the class of the variable.
- java.lang.String is default.
-
- declare Whether the variable is declared
- or not. True is the default.
-
- scope The scope of the scripting varaible
- defined. NESTED is default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="j2ee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="name-given"
- type="j2ee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name for the scripting variable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="name-from-attribute"
- type="j2ee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name of an attribute whose
- (translation-time) value will give the name of
- the variable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="variable-class"
- type="j2ee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The optional name of the class for the scripting
- variable. The default is java.lang.String.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- <xsd:element name="declare"
- type="j2ee:generic-booleanType"
- minOccurs="0">
-
- <xsd:annotation>
- <xsd:documentation>
-
- Whether the scripting variable is to be defined
- or not. See TagExtraInfo for details. This
- element is optional and "true" is the default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="scope"
- type="j2ee:variable-scopeType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element is optional and "NESTED" is the default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_1.xsd
deleted file mode 100644
index bea8e9b1c9..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-jsptaglibrary_2_1.xsd
+++ /dev/null
@@ -1,1144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.1">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)web-jsptaglibrary_2_1.xsds 1.1
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- Copyright 2003-2005 Sun Microsystems, Inc.
- 4150 Network Circle
- Santa Clara, California 95054
- U.S.A
- All rights reserved.
-
- Sun Microsystems, Inc. has intellectual property rights
- relating to technology described in this document. In
- particular, and without limitation, these intellectual
- property rights may include one or more of the U.S. patents
- listed at http://www.sun.com/patents and one or more
- additional patents or pending patent applications in the
- U.S. and other countries.
-
- This document and the technology which it describes are
- distributed under licenses restricting their use, copying,
- distribution, and decompilation. No part of this document
- may be reproduced in any form by any means without prior
- written authorization of Sun and its licensors, if any.
-
- Third-party software, including font technology, is
- copyrighted and licensed from Sun suppliers.
-
- Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
- JavaServer Pages, Enterprise JavaBeans and the Java Coffee
- Cup logo are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.
-
- Federal Acquisitions: Commercial Software - Government Users
- Subject to Standard License Terms and Conditions.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
-
- This is the XML Schema for the JSP Taglibrary
- descriptor. All Taglibrary descriptors must
- indicate the tag library schema by using the Taglibrary
- namespace:
-
- http://java.sun.com/xml/ns/javaee
-
- and by indicating the version of the schema by
- using the version element as shown below:
-
- <taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="..."
- version="2.1">
- ...
- </taglib>
-
- The instance documents may indicate the published
- version of the schema using xsi:schemaLocation attribute
- for Java EE namespace with the following location:
-
- http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd
-
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
-
-<!-- **************************************************** -->
-
- <xsd:element name="taglib" type="javaee:tldTaglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib tag is the document root.
- The definition of taglib is provided
- by the tldTaglibType.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:unique name="tag-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib element contains, among other things, tag and
- tag-file elements.
- The name subelements of these elements must each be unique.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:tag|javaee:tag-file"/>
- <xsd:field xpath="javaee:name"/>
- </xsd:unique>
-
- <xsd:unique name="function-name-uniqueness">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib element contains function elements.
- The name subelements of these elements must each be unique.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:selector xpath="javaee:function"/>
- <xsd:field xpath="javaee:name"/>
- </xsd:unique>
-
- </xsd:element>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="body-contentType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies the type of body that is valid for a tag.
- This value is used by the JSP container to validate
- that a tag invocation has the correct body syntax and
- by page composition tools to assist the page author
- in providing a valid tag body.
-
- There are currently four values specified:
-
- tagdependent The body of the tag is interpreted by the tag
- implementation itself, and is most likely
- in a different "language", e.g embedded SQL
- statements.
-
- JSP The body of the tag contains nested JSP
- syntax.
-
- empty The body must be empty
-
- scriptless The body accepts only template text, EL
- Expressions, and JSP action elements. No
- scripting elements are allowed.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="tagdependent"/>
- <xsd:enumeration value="JSP"/>
- <xsd:enumeration value="empty"/>
- <xsd:enumeration value="scriptless"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="extensibleType" abstract="true">
- <xsd:annotation>
- <xsd:documentation>
-
- The extensibleType is an abstract base type that is used to
- define the type of extension-elements. Instance documents
- must substitute a known type to define the extension by
- using xsi:type attribute to define the actual type of
- extension-elements.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="functionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The function element is used to provide information on each
- function in the tag library that is to be exposed to the EL.
-
- The function element may have several subelements defining:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name A unique name for this function
-
- function-class Provides the name of the Java class that
- implements the function
-
- function-signature Provides the signature, as in the Java
- Language Specification, of the Java
- method that is to be used to implement
- the function.
-
- example Optional informal description of an
- example of a use of this function
-
- function-extension Zero or more extensions that provide extra
- information about this function, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="name"
- type="javaee:tld-canonical-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- A unique name for this function.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="function-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Provides the fully-qualified class name of the Java
- class containing the static method that implements
- the function.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="function-signature"
- type="javaee:string">
- <xsd:annotation>
- <xsd:documentation>
-
- Provides the signature, of the static Java method that is
- to be used to implement the function. The syntax of the
- function-signature element is as follows:
-
- FunctionSignature ::= ReturnType S MethodName S?
- '(' S? Parameters? S? ')'
-
- ReturnType ::= Type
-
- MethodName ::= Identifier
-
- Parameters ::= Parameter
- | ( Parameter S? ',' S? Parameters )
-
- Parameter ::= Type
-
- Where:
-
- * Type is a basic type or a fully qualified
- Java class name (including package name),
- as per the 'Type' production in the Java
- Language Specification, Second Edition,
- Chapter 18.
-
- * Identifier is a Java identifier, as per
- the 'Identifier' production in the Java
- Language Specification, Second
- Edition, Chapter 18.
-
- Example:
-
- java.lang.String nickName( java.lang.String, int )
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="example"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of this function.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="function-extension"
- type="javaee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Function extensions are for tool use only and must not
- affect the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tagFileType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an action in this tag library that is implemented
- as a .tag file.
-
- The tag-file element has two required subelements:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name The unique action name
-
- path Where to find the .tag file implementing this
- action, relative to the root of the web
- application or the root of the JAR file for a
- tag library packaged in a JAR. This must
- begin with /WEB-INF/tags if the .tag file
- resides in the WAR, or /META-INF/tags if the
- .tag file resides in a JAR.
-
- example Optional informal description of an
- example of a use of this tag
-
- tag-extension Zero or more extensions that provide extra
- information about this tag, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="name"
- type="javaee:tld-canonical-nameType"/>
- <xsd:element name="path"
- type="javaee:pathType"/>
- <xsd:element name="example"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of a tag.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tag-extension"
- type="javaee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Tag extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tagType">
- <xsd:annotation>
- <xsd:documentation>
-
- The tag defines a unique tag in this tag library. It has one
- attribute, id.
-
- The tag element may have several subelements defining:
-
- description Optional tag-specific information
-
- display-name A short name that is intended to be
- displayed by tools
-
- icon Optional icon element that can be used
- by tools
-
- name The unique action name
-
- tag-class The tag handler class implementing
- javax.servlet.jsp.tagext.JspTag
-
- tei-class An optional subclass of
- javax.servlet.jsp.tagext.TagExtraInfo
-
- body-content The body content type
-
- variable Optional scripting variable information
-
- attribute All attributes of this action that are
- evaluated prior to invocation.
-
- dynamic-attributes Whether this tag supports additional
- attributes with dynamic names. If
- true, the tag-class must implement the
- javax.servlet.jsp.tagext.DynamicAttributes
- interface. Defaults to false.
-
- example Optional informal description of an
- example of a use of this tag
-
- tag-extension Zero or more extensions that provide extra
- information about this tag, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="name"
- type="javaee:tld-canonical-nameType"/>
- <xsd:element name="tag-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the subclass of javax.serlvet.jsp.tagext.JspTag
- that implements the request time semantics for
- this tag. (required)
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tei-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo
- for this tag. (optional)
-
- If this is not given, the class is not consulted at
- translation time.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="body-content"
- type="javaee:body-contentType">
- <xsd:annotation>
- <xsd:documentation>
-
- Specifies the format for the body of this tag.
- The default in JSP 1.2 was "JSP" but because this
- is an invalid setting for simple tag handlers, there
- is no longer a default in JSP 2.0. A reasonable
- default for simple tag handlers is "scriptless" if
- the tag can have a body.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="variable"
- type="javaee:variableType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute"
- type="javaee:tld-attributeType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="dynamic-attributes"
- type="javaee:generic-booleanType"
- minOccurs="0"/>
- <xsd:element name="example"
- type="javaee:xsdStringType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The example element contains an informal description
- of an example of the use of a tag.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="tag-extension"
- type="javaee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Tag extensions are for tool use only and must not affect
- the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-attributeType">
- <xsd:annotation>
- <xsd:documentation>
-
- The attribute element defines an attribute for the nesting
- tag. The attribute element may have several subelements
- defining:
-
- description a description of the attribute
-
- name the name of the attribute
-
- required whether the attribute is required or
- optional
-
- rtexprvalue whether the attribute is a runtime attribute
-
- type the type of the attributes
-
- fragment whether this attribute is a fragment
-
- deferred-value present if this attribute is to be parsed as a
- javax.el.ValueExpression
-
- deferred-method present if this attribute is to be parsed as a
- javax.el.MethodExpression
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="name"
- type="javaee:java-identifierType"/>
- <xsd:element name="required"
- type="javaee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines if the nesting attribute is required or
- optional.
-
- If not present then the default is "false", i.e
- the attribute is optional.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:sequence>
- <xsd:sequence minOccurs="0">
- <xsd:element name="rtexprvalue"
- type="javaee:generic-booleanType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines if the nesting attribute can have scriptlet
- expressions as a value, i.e the value of the
- attribute may be dynamically calculated at request
- time, as opposed to a static value determined at
- translation time.
- If not present then the default is "false", i.e the
- attribute has a static value
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the Java type of the attributes value.
- If this element is omitted, the expected type is
- assumed to be "java.lang.Object".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:choice>
- <xsd:element name="deferred-value"
- type="javaee:tld-deferred-valueType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Present if the value for this attribute is to be
- passed to the tag handler as a
- javax.el.ValueExpression. This allows for deferred
- evaluation of EL expressions. An optional subelement
- will contain the expected type that the value will
- be coerced to after evaluation of the expression.
- The type defaults to Object if one is not provided.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="deferred-method"
- type="javaee:tld-deferred-methodType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Present if the value for this attribute is to be
- passed to the tag handler as a
- javax.el.MethodExpression. This allows for deferred
- evaluation of an EL expression that identifies a
- method to be invoked on an Object. An optional
- subelement will contain the expected method
- signature. The signature defaults to "void method()"
- if one is not provided.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
-
- <xsd:element name="fragment"
- type="javaee:generic-booleanType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- "true" if this attribute is of type
- javax.jsp.tagext.JspFragment, representing dynamic
- content that can be re-evaluated as many times
- as needed by the tag handler. If omitted or "false",
- the default is still type="java.lang.String"
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-canonical-nameType">
-
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the canonical name of a tag or attribute being
- defined.
-
- The name must conform to the lexical rules for an NMTOKEN.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:xsdNMTOKENType"/>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-deferred-methodType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines information about how to provide the value for a
- tag handler attribute that accepts a javax.el.MethodExpression.
-
- The deferred-method element has one optional subelement:
-
- method-signature Provides the signature, as in the Java
- Language Specifies, that is expected for
- the method being identified by the
- expression.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="method-signature"
- type="javaee:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Provides the expected signature of the method identified
- by the javax.el.MethodExpression.
-
- This disambiguates overloaded methods and ensures that
- the return value is of the expected type.
-
- The syntax of the method-signature element is identical
- to that of the function-signature element. See the
- documentation for function-signature for more details.
-
- The name of the method is for documentation purposes only
- and is ignored by the JSP container.
-
- Example:
-
- boolean validate(java.lang.String)
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-deferred-valueType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines information about how to provide the value for a
- tag handler attribute that accepts a javax.el.ValueExpression.
-
- The deferred-value element has one optional subelement:
-
- type the expected type of the attribute
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="type"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The fully-qualified name of the Java type that is the
- expected type for this deferred expression. If this
- element is omitted, the expected type is assumed to be
- "java.lang.Object".
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tld-extensionType">
- <xsd:annotation>
- <xsd:documentation>
-
- The tld-extensionType is used to indicate
- extensions to a specific TLD element.
-
- It is used by elements to designate an extension block
- that is targeted to a specific extension designated by
- a set of extension elements that are declared by a
- namespace. The namespace identifies the extension to
- the tool that processes the extension.
-
- The type of the extension-element is abstract. Therefore,
- a concrete type must be specified by the TLD using
- xsi:type attribute for each extension-element.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="extension-element"
- type="javaee:extensibleType"
- maxOccurs="unbounded"/>
- </xsd:sequence>
-
- <xsd:attribute name="namespace"
- use="required"
- type="xsd:anyURI"/>
- <xsd:attribute name="id" type="xsd:ID"/>
-
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="tldTaglibType">
- <xsd:annotation>
- <xsd:documentation>
-
- The taglib tag is the document root, it defines:
-
- description a simple string describing the "use" of this
- taglib, should be user discernable
-
- display-name the display-name element contains a
- short name that is intended to be displayed
- by tools
-
- icon optional icon that can be used by tools
-
- tlib-version the version of the tag library implementation
-
- short-name a simple default short name that could be
- used by a JSP authoring tool to create
- names with a mnemonic value; for example,
- the it may be used as the prefered prefix
- value in taglib directives
-
- uri a uri uniquely identifying this taglib
-
- validator optional TagLibraryValidator information
-
- listener optional event listener specification
-
- tag tags in this tag library
-
- tag-file tag files in this tag library
-
- function zero or more EL functions defined in this
- tag library
-
- taglib-extension zero or more extensions that provide extra
- information about this taglib, for tool
- consumption
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:group ref="javaee:descriptionGroup"/>
- <xsd:element name="tlib-version"
- type="javaee:dewey-versionType">
- <xsd:annotation>
- <xsd:documentation>
-
- Describes this version (number) of the taglibrary.
- It is described as a dewey decimal.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- <xsd:element name="short-name"
- type="javaee:tld-canonical-nameType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a simple default name that could be used by
- a JSP authoring tool to create names with a
- mnemonicvalue; for example, it may be used as the
- preferred prefix value in taglib directives. Do
- not use white space, and do not start with digits
- or underscore.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="uri"
- type="javaee:xsdAnyURIType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines a public URI that uniquely identifies this
- version of the taglibrary. Leave it empty if it
- does not apply.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
- <xsd:element name="validator"
- type="javaee:validatorType"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="listener"
- type="javaee:listenerType"
- minOccurs="0" maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="tag"
- type="javaee:tagType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="tag-file"
- type="javaee:tagFileType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="function"
- type="javaee:functionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="taglib-extension"
- type="javaee:tld-extensionType"
- minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- Taglib extensions are for tool use only and must not
- affect the behavior of a container.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version"
- type="javaee:dewey-versionType"
- fixed="2.1"
- use="required">
- <xsd:annotation>
- <xsd:documentation>
-
- Describes the JSP version (number) this taglibrary
- requires in order to function (dewey decimal)
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:attribute>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="validatorType">
- <xsd:annotation>
- <xsd:documentation>
-
- A validator that can be used to validate
- the conformance of a JSP page to using this tag library is
- defined by a validatorType.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="validator-class"
- type="javaee:fully-qualified-classType">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the TagLibraryValidator class that can be used
- to validate the conformance of a JSP page to using this
- tag library.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="init-param"
- type="javaee:param-valueType"
- minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
-
- The init-param element contains a name/value pair as an
- initialization param.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variable-scopeType">
- <xsd:annotation>
- <xsd:documentation>
-
- This type defines scope of the scripting variable. See
- TagExtraInfo for details. The allowed values are,
- "NESTED", "AT_BEGIN" and "AT_END".
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:simpleContent>
- <xsd:restriction base="javaee:string">
- <xsd:enumeration value="NESTED"/>
- <xsd:enumeration value="AT_BEGIN"/>
- <xsd:enumeration value="AT_END"/>
- </xsd:restriction>
- </xsd:simpleContent>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variableType">
- <xsd:annotation>
- <xsd:documentation>
-
- The variableType provides information on the scripting
- variables defined by using this tag. It is a (translation
- time) error for a tag that has one or more variable
- subelements to have a TagExtraInfo class that returns a
- non-null value from a call to getVariableInfo().
-
- The subelements of variableType are of the form:
-
- description Optional description of this
- variable
-
- name-given The variable name as a constant
-
- name-from-attribute The name of an attribute whose
- (translation time) value will
- give the name of the
- variable. One of name-given or
- name-from-attribute is required.
-
- variable-class Name of the class of the variable.
- java.lang.String is default.
-
- declare Whether the variable is declared
- or not. True is the default.
-
- scope The scope of the scripting varaible
- defined. NESTED is default.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:element name="description"
- type="javaee:descriptionType"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:choice>
- <xsd:element name="name-given"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name for the scripting variable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="name-from-attribute"
- type="javaee:java-identifierType">
- <xsd:annotation>
- <xsd:documentation>
-
- The name of an attribute whose
- (translation-time) value will give the name of
- the variable.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="variable-class"
- type="javaee:fully-qualified-classType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The optional name of the class for the scripting
- variable. The default is java.lang.String.
-
- </xsd:documentation>
- </xsd:annotation>
-
- </xsd:element>
-
- <xsd:element name="declare"
- type="javaee:generic-booleanType"
- minOccurs="0">
-
- <xsd:annotation>
- <xsd:documentation>
-
- Whether the scripting variable is to be defined
- or not. See TagExtraInfo for details. This
- element is optional and "true" is the default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="scope"
- type="javaee:variable-scopeType"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
-
- The element is optional and "NESTED" is the default.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd
deleted file mode 100644
index 09249bd38b..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd
+++ /dev/null
@@ -1,263 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-
-
-<xsd:schema
- targetNamespace="http://java.sun.com/xml/ns/javaee"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the
- GNU General Public License Version 2 only ("GPL") or the Common
- Development and Distribution License("CDDL") (collectively, the
- "License"). You may not use this file except in compliance with
- the License. You can obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL.html or
- glassfish/bootstrap/legal/LICENSE.txt. See the License for the
- specific language governing permissions and limitations under the
- License.
-
- When distributing the software, include this License Header
- Notice in each file and include the License file at
- glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
- particular file as subject to the "Classpath" exception as
- provided by Sun in the GPL Version 2 section of the License file
- that accompanied this code. If applicable, add the following
- below the License Header, with the fields enclosed by brackets []
- replaced by your own identifying information:
- "Portions Copyrighted [year] [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the
- CDDL or only the GPL Version 2, indicate your decision by adding
- "[Contributor] elects to include this software in this
- distribution under the [CDDL or GPL Version 2] license." If you
- don't indicate a single choice of license, a recipient has the
- option to distribute your version of this file under either the
- CDDL, the GPL Version 2 or to extend the choice of license to its
- licensees as provided above. However, if you add GPL Version 2
- code and therefore, elected the GPL Version 2 license, then the
- option applies only if the new code is made subject to such
- option by the copyright holder.
-
- The Eclipse Foundation elects to include this software in this
- distribution under the CDDL license.
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation>
-
- <![CDATA[
-
- The XML Schema for the JavaServer Faces (Version 2.0)
- Partial Response used in JSF Ajax frameworks.
-
- ]]>
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:include schemaLocation="javaee_5.xsd"/>
-
- <!-- **************************************************** -->
-
- <xsd:element name = "partial-response" type="javaee:partial-responseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "partial-response" element is the root of the partial
- response information hierarchy, and contains nested elements for all
- possible elements that can exist in the response.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="partial-responseType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "partial-response" element is the root of thei partial
- response information hierarchy, and contains nested elements for all
- possible elements that can exist in the response.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="changes"
- type="javaee:partial-response-changesType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="redirect"
- type="javaee:partial-response-redirectType"
- minOccurs="0"
- maxOccurs="1"/>
- <xsd:element name="error"
- type="javaee:partial-response-errorType"
- minOccurs="0"
- maxOccurs="1"/>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-changesType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="update"
- type="javaee:partial-response-updateType"/>
- <xsd:element name="insert"
- type="javaee:partial-response-insertType"/>
- <xsd:element name="delete"
- type="javaee:partial-response-deleteType"/>
- <xsd:element name="attributes"
- type="javaee:partial-response-attributesType"/>
- <xsd:element name="eval" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
-
- The "eval" element enables this element's contents to be executed as JavaScript.
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="extension"
- type="javaee:partial-response-extensionType"/>
- </xsd:choice>
- </xsd:complexType>
-
-
- <xsd:complexType name="partial-response-updateType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "update" element enables DOM elements matching the "id"
- attribute to be updated with the contents of this element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-insertType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "insert" element enables content to be inserted into the DOM
- before or after an existing DOM element as specified by the
- nested "before" or "after" elements. The elements "before" and
- "after" are mutually exclusive - one of them must be specified.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="before">
- <xsd:complexType>
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="after">
- <xsd:complexType>
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-deleteType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "delete" element enables DOM elements matching the "id"
- attribute to be removed.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-attributesType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "attributes" element enables attributes of DOM elements matching the "id"
- attribute to be updated. If this element is used, then it must contain at
- least one "attribute" element.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute" minOccurs="1" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-redirectType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "redirect" element enables a redirect to the location as specified by the
- "url" attribute.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="url" type="xsd:anyURI" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-errorType">
- <xsd:annotation>
- <xsd:documentation>
-
- The "error" element contains error information from the server.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="error-name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <xsd:element name="error-message" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="partial-response-extensionType">
- <xsd:annotation>
- <xsd:documentation>
- Extension element for partial response. It may contain
- implementation specific content.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
- <xsd:any namespace="##any"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID"/>
- </xsd:complexType>
-
-</xsd:schema>
-
-
-
-
diff --git a/bundles/org.eclipse.jst.standard.schemas/plugin.properties b/bundles/org.eclipse.jst.standard.schemas/plugin.properties
deleted file mode 100644
index 1497b9f1cb..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.jst.standard.schemas
-Bundle-Name.0 = Java EE Related Schemas
-Bundle-Vendor.0 = Eclipse Web Tools Platform \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.standard.schemas/plugin.xml b/bundles/org.eclipse.jst.standard.schemas/plugin.xml
deleted file mode 100644
index c38c4dceb7..0000000000
--- a/bundles/org.eclipse.jst.standard.schemas/plugin.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
- <!--==========================================-->
- <!-- Catalog Contributions -->
- <!-- Register well known Web DTDs and XSDs -->
- <!--==========================================-->
-
- <extension point="org.eclipse.wst.xml.core.catalogContributions">
- <catalogContribution id="default">
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN"
- uri="dtdsAndSchemas/application_1_2.dtd"
- webURL="http://java.sun.com/j2ee/dtds/application_1_2.dtd" />
- <public
- publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
- uri="dtdsAndSchemas/application_1_3.dtd"
- webURL="http://java.sun.com/dtd/application_1_3.dtd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
- uri="dtdsAndSchemas/application_1_4.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/application_5.xsd"
- uri="dtdsAndSchemas/application_5.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/application_6.xsd"
- uri="dtdsAndSchemas/application_6.xsd" />
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN"
- uri="dtdsAndSchemas/application-client_1_2.dtd"
- webURL="http://java.sun.com/j2ee/dtds/application-client_1_2.dtd" />
- <public
- publicId="-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"
- uri="dtdsAndSchemas/application-client_1_3.dtd"
- webURL="http://java.sun.com/dtd/application-client_1_3.dtd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"
- uri="dtdsAndSchemas/application-client_1_4.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/application-client_5.xsd"
- uri="dtdsAndSchemas/application-client_5.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/application-client_6.xsd"
- uri="dtdsAndSchemas/application-client_6.xsd" />
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Connector 1.0//EN"
- uri="dtdsAndSchemas/connector_1_0.dtd"
- webURL="http://java.sun.com/dtd/connector_1_0.dtd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
- uri="dtdsAndSchemas/connector_1_5.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/connector_1_6.xsd"
- uri="dtdsAndSchemas/connector_1_6.xsd" />
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
- uri="dtdsAndSchemas/ejb-jar_1_1.dtd"
- webURL="http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd" />
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
- uri="dtdsAndSchemas/ejb-jar_2_0.dtd"
- webURL="http://java.sun.com/dtd/ejb-jar_2_0.dtd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
- uri="dtdsAndSchemas/ejb-jar_2_1.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
- uri="dtdsAndSchemas/ejb-jar_3_0.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
- uri="dtdsAndSchemas/ejb-jar_3_1.xsd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/j2ee/"
- uri="dtdsAndSchemas/j2ee_1_4.xsd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/j2ee/j2ee_jaxrpc_mapping_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/j2ee_web_services_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_web_services_1_1.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/j2ee_web_services_client_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_web_services_client_1_1.xsd" />
-
- <uri
- name="http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_jaxrpc_mapping_1_1.xsd" />
- <uri
- name="http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_web_services_1_1.xsd" />
- <uri
- name="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"
- uri="dtdsAndSchemas/j2ee_web_services_client_1_1.xsd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_5.xsd"
- uri="dtdsAndSchemas/javaee_5.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_6.xsd"
- uri="dtdsAndSchemas/javaee_6.xsd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"
- uri="dtdsAndSchemas/javaee_web_services_1_2.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd"
- uri="dtdsAndSchemas/javaee_web_services_1_3.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd"
- uri="dtdsAndSchemas/javaee_web_services_client_1_2.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd"
- uri="dtdsAndSchemas/javaee_web_services_client_1_3.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd"
- uri="dtdsAndSchemas/jsp_2_0.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/jsp_2_1.xsd"
- uri="dtdsAndSchemas/jsp_2_1.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/jsp_2_2.xsd"
- uri="dtdsAndSchemas/jsp_2_2.xsd" />
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
- uri="dtdsAndSchemas/web-app_2_2.dtd"
- webURL="http://java.sun.com/j2ee/dtds/web-app_2.2.dtd" />
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- uri="dtdsAndSchemas/web-app_2_3.dtd"
- webURL="http://java.sun.com/dtd/web-app_2_3.dtd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- uri="dtdsAndSchemas/web-app_2_4.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- uri="dtdsAndSchemas/web-app_2_5.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
- uri="dtdsAndSchemas/web-app_3_0.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd"
- uri="dtdsAndSchemas/web-common_3_0.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
- uri="dtdsAndSchemas/web-fragment_3_0.xsd" />
-
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
- uri="dtdsAndSchemas/web-jsptaglibrary_1_1.dtd"
- webURL="http://java.sun.com/dtd/web-jsptaglibrary_1_1.dtd" />
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- uri="dtdsAndSchemas/web-jsptaglibrary_1_2.dtd"
- webURL="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd" />
- <uri
- name="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- uri="dtdsAndSchemas/web-jsptaglibrary_2_0.xsd" />
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
- uri="dtdsAndSchemas/web-jsptaglibrary_2_1.xsd" />
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- uri="dtdsAndSchemas/web-facesconfig_1_0.dtd"
- webURL="http://java.sun.com/dtd/web-facesconfig_1_0.dtd" />
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- uri="dtdsAndSchemas/web-facesconfig_1_1.dtd"
- webURL="http://java.sun.com/dtd/web-facesconfig_1_1.dtd" />
-
-
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- uri="dtdsAndSchemas/web-facesconfig_1_2.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- uri="dtdsAndSchemas/orm_1_0.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- uri="dtdsAndSchemas/persistence_1_0.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
- uri="dtdsAndSchemas/orm_2_0.xsd" />
-
- <uri
- name="http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
- uri="dtdsAndSchemas/persistence_2_0.xsd" />
-
- <public
- publicId="-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
- uri="dtdsAndSchemas/facelet-taglib_1_0.dtd"/>
-
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
- uri="dtdsAndSchemas/web-facelettaglibrary_2_0.xsd"/>
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- uri="dtdsAndSchemas/web-facesconfig_2_0.xsd"/>
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd"
- uri="dtdsAndSchemas/web-facesuicomponent_2_0.xsd"/>
- <uri
- name="http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd"
- uri="dtdsAndSchemas/web-partialresponse_2_0.xsd"/>
- <uri
- name="http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"
- uri="dtdsAndSchemas/beans_1_0.xsd">
- </uri>
-
-
-
- </catalogContribution>
-
- </extension>
-
-
-</plugin>
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 d090e0dba4..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.501.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
-Import-Package: com.ibm.icu.util; version="3.8"
-Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,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 60e22fdfc1..0000000000
--- a/bundles/org.eclipse.wst.css.core/build.properties
+++ /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
-###############################################################################
-bin.includes = plugin.xml,\
- cssprofile/,\
- .options,\
- plugin.properties,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = component.xml
-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 3031984c0a..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
+++ /dev/null
@@ -1,2292 +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="none"/>
- <keyword name="normal"/>
- <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="progress"/>
- <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="inline-block"/>
- <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="pre-line"/>
- <keyword name="pre-wrap"/>
- <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="orange"/>
- <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-block">
- <keyword-value>inline-block</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="orange">
- <keyword-value>orange</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="pre-line">
- <keyword-value>pre-line</keyword-value>
- </keyword-def>
- <keyword-def name="pre-wrap">
- <keyword-value>pre-wrap</keyword-value>
- </keyword-def>
- <keyword-def name="progress">
- <keyword-value>progress</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-css3.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css3.xml
deleted file mode 100644
index 1b49b8ff70..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css3.xml
+++ /dev/null
@@ -1,2566 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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>%css3.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-element name="selection"/>
- <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="empty"/>
- <pseudo-class name="enabled"/>
- <pseudo-class name="disabled"/>
- <pseudo-class name="checked"/>
- <pseudo-class name="first-of-type"/>
- <pseudo-class name="last-child"/>
- <pseudo-class name="last-of-type"/>
- <pseudo-class name="not()"/>
- <pseudo-class name="nth-child()"/>
- <pseudo-class name="nth-last-child()"/>
- <pseudo-class name="nth-last-of-type()"/>
- <pseudo-class name="nth-of-type()"/>
- <pseudo-class name="only-child"/>
- <pseudo-class name="only-of-type"/>
- <pseudo-class name="root"/>
- <pseudo-class name="target"/>
- <property name="azimuth"/>
- <property name="background"/>
- <property name="background-attachment"/>
- <property name="background-clip"/>
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-origin"/>
- <property name="background-position"/>
- <property name="background-repeat"/>
- <property name="background-size"/>
- <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="border-top-left-radius"/>
- <property name="border-top-right-radius"/>
- <property name="border-bottom-left-radius"/>
- <property name="border-bottom-right-radius"/>
- <property name="border-radius"/>
- <property name="bottom"/>
- <property name="box-shadow"/>
- <property name="box-sizing"/>
- <property name="caption-side"/>
- <property name="clear"/>
- <property name="clip"/>
- <property name="color"/>
- <property name="content"/>
- <property name="columns"/>
- <property name="column-count"/>
- <property name="column-width"/>
- <property name="column-gap"/>
- <property name="column-rule-color"/>
- <property name="column-rule-style"/>
- <property name="column-rule-width"/>
- <property name="column-rule"/>
- <property name="column-span"/>
- <property name="column-fill"/>
- <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="opacity"/>
- <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="resize"/>
- <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-overflow"/>
- <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="checked" version="3">
- <selector-value>checked</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="disabled" version="3">
- <selector-value>disabled</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="empty" version="3">
- <selector-value>empty</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="enabled" version="3">
- <selector-value>enabled</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="first-of-type" version="3">
- <selector-value>first-of-type</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="last-child" version="3">
- <selector-value>last-child</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="last-of-type" version="3">
- <selector-value>last-of-type</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="not()" version="3">
- <selector-value>not()</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="nth-child()" version="3">
- <selector-value>nth-child()</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="nth-last-child()" version="3">
- <selector-value>nth-last-child()</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="nth-last-of-type()" version="3">
- <selector-value>nth-last-of-type()</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="nth-of-type()" version="3">
- <selector-value>nth-of-type()</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="only-child" version="3">
- <selector-value>only-child</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="only-of-type" version="3">
- <selector-value>only-of-type</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="root" version="3">
- <selector-value>root</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="target" version="3">
- <selector-value>target</selector-value>
- </pseudo-class-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>
- <pseudo-element-def name="selection" version="3">
- <selector-value>selection</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="local"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-clip"
- inherited="no" mediagroup="visual" category="colorandbackground" version="3">
- <keyword name="border-box"/>
- <keyword name="content-box"/>
- <keyword name="padding-box"/>
- <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-origin"
- inherited="no" mediagroup="visual" category="colorandbackground" version="3">
- <keyword name="padding-box"/>
- <keyword name="border-box"/>
- <keyword name="content-box"/>
- <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="space"/>
- <keyword name="round"/>
- <keyword name="no-repeat"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-size"
- inherited="no" mediagroup="visual" category="colorandbackground" version="3">
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="contain"/>
- <keyword name="cover"/>
- <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-top-left-radius"
- inherited="no" mediagroup="visual" category="box" version="3">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-right-radius"
- inherited="no" mediagroup="visual" category="box" version="3">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-right-radius"
- inherited="no" mediagroup="visual" category="box" version="3">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-left-radius"
- inherited="no" mediagroup="visual" category="box" version="3">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-radius"
- inherited="no" mediagroup="visual" category="box" version="3">
- <number name="length"/>
- <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="box-shadow"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <number name="length"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="box-sizing"
- inherited="no" mediagroup="visual" category="box" version="3">
- <keyword name="border-box"/>
- <keyword name="content-box"/>
- <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="columns"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <property name="column-width"/>
- <property name="column-count"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-width"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <number name="length"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-count"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <number name="integer"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-fill"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <keyword name="auto"/>
- <keyword name="balance"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-gap"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <number name="length"/>
- <keyword name="normal"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-rule"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <property name="column-rule-width"/>
- <property name="column-rule-style"/>
- <property name="column-rule-color"/>
- </property-def>
- <property-def name="column-rule-color"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-rule-style"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-rule-width"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="column-span"
- inherited="no" mediagroup="visual" category="visual" version="3">
- <keyword name="all"/>
- <keyword name="1"/>
- <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="none"/>
- <keyword name="normal"/>
- <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="progress"/>
- <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="inline-block"/>
- <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="opacity"
- inherited="yes" mediagroup="visual" category="visual" version="3">
- <number name="number"/>
- <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="resize"
- inherited="yes" mediagroup="visual" category="visual" version="3">
- <keyword name="both"/>
- <keyword name="horizontal"/>
- <keyword name="none"/>
- <keyword name="vertical"/>
- <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-overflow"
- inherited="no" mediagroup="visual" category="text" version="3">
- <keyword name="clip"/>
- <keyword name="ellipsis"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-shadow"
- inherited="no" mediagroup="visual" category="text" version="3">
- <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="pre-line"/>
- <keyword name="pre-wrap"/>
- <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="orange"/>
- <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"/>
- <function name="rgba"/>
- <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="rgba" version="3">
- <function-value>rgba</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="1" version="3">
- <keyword-value>1</keyword-value>
- </keyword-def>
- <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="balance" version="3">
- <keyword-value>balance</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="border-box" version="3">
- <keyword-value>border-box</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="clip" version="3">
- <keyword-value>clip</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="collapse">
- <keyword-value>collapse</keyword-value>
- </keyword-def>
- <keyword-def name="compact">
- <keyword-value>compact</keyword-value>
- </keyword-def>
- <keyword-def name="condensed">
- <keyword-value>condensed</keyword-value>
- </keyword-def>
- <keyword-def name="contain" version="3">
- <keyword-value>contain</keyword-value>
- </keyword-def>
- <keyword-def name="content-box" version="3">
- <keyword-value>content-box</keyword-value>
- </keyword-def>
- <keyword-def name="continuous">
- <keyword-value>continuous</keyword-value>
- </keyword-def>
- <keyword-def name="cover" version="3">
- <keyword-value>cover</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="ellipsis" version="3">
- <keyword-value>ellipsis</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="horizontal" version="3">
- <keyword-value>horizontal</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-block">
- <keyword-value>inline-block</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="local" version="3">
- <keyword-value>local</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="orange">
- <keyword-value>orange</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="padding-box" version="3">
- <keyword-value>padding-box</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="pre-line">
- <keyword-value>pre-line</keyword-value>
- </keyword-def>
- <keyword-def name="pre-wrap">
- <keyword-value>pre-wrap</keyword-value>
- </keyword-def>
- <keyword-def name="progress">
- <keyword-value>progress</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="round" version="3">
- <keyword-value>round</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="space" version="3">
- <keyword-value>space</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="vertical" version="3">
- <keyword-value>vertical</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 323030bd0b..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# 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-css3.xml
-css3.stylesheet-def.description=Cascading Style Sheets, level 3
-# 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 cc1c1cbb48..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source CSS Model
-cssprofile_css3.name=CSS3: Cascading Style Sheets, level 3
-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
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 fc6ad46dbc..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ /dev/null
@@ -1,96 +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_css3.name"
- uri="cssprofile/cssprofile-css3.xml"
- id="org.eclipse.wst.css.core.cssprofile.css3">
- </profile>
- <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.contenttype.contentTypes">
- <content-type
- file-extensions="css"
- priority="high"
- name="%CSS_Content_Type_Extension_Element.name"
- id="org.eclipse.wst.css.core.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 b967a902b1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
+++ /dev/null
@@ -1,31 +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 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 e18d1fdd2b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ /dev/null
@@ -1,14 +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()
-#
-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/IProductConstants.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/IProductConstants.java
deleted file mode 100644
index f3a62358b9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/IProductConstants.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-public interface IProductConstants {
- /** Default profile to be used in the CSS metamodel */
- String DEFAULT_PROFILE = "wst.css.default_profile"; //$NON-NLS-1$
-}
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 d1551ce1f4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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();
-
- short getClassSelectorCase();
-
- short getIdSelectorCase();
-
- /**
- *
- * @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);
-
- void setClassSelectorCase(short classSelectorCase);
-
- void setIdSelectorCase(short idSelectorCase);
-}
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 9c01902ed2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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;
- protected short fClassCase = ASIS;
- protected short fIdCase = ASIS;
-
- /**
- * 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));
- fIdCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_ID_SELECTOR));
- fClassCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_CLASS_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.CLEANUP_CASE_ID_SELECTOR, fIdCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_CLASS_SELECTOR, fClassCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.QUOTE_ATTR_VALUES, fQuoteValues);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.FORMAT_SOURCE, fFormatSource);
- CSSCorePlugin.getDefault().savePluginPreferences();
- }
-
- public short getClassSelectorCase() {
- return fClassCase;
- }
-
- public short getIdSelectorCase() {
- return fIdCase;
- }
-
- public void setClassSelectorCase(short classSelectorCase) {
- fClassCase = classSelectorCase;
- }
-
- public void setIdSelectorCase(short idSelectorCase) {
- fIdCase = idSelectorCase;
- }
-}
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 113e855904..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.core.internal.contentmodel;
-
-
-
-/**
- *
- */
-public interface IValID {
-
- public final static String V_1 = "1";//$NON-NLS-1$
- 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_BALANCE = "balance";//$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_BORDER_BOX = "border-box"; //$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_CLIP = "clip"; //$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_CONTAIN = "contain"; //$NON-NLS-1$
- public final static String V_CONTENT_BOX = "content-box"; //$NON-NLS-1$
- public final static String V_CONTINUOUS = "continuous"; //$NON-NLS-1$
- public final static String V_COVER = "cover"; //$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_ELLIPSIS = "ellipsis"; //$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_HORIZONTAL = "horizontal"; //$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_BLOCK = "inline-block"; //$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_LOCAL = "local"; //$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_ORANGE = "orange"; //$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_PADDING_BOX = "padding-box"; //$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_PRE_LINE = "pre-line"; //$NON-NLS-1$
- public final static String V_PRE_WRAP = "pre-wrap"; //$NON-NLS-1$
- public final static String V_PROGRESS = "progress"; //$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_ROUND = "round"; //$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_SPACE = "space"; //$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_VERTICAL = "vertical";//$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 476ead2d36..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
+++ /dev/null
@@ -1,1521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.appendChild(IValID.V_LOCAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-clip
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_CLIP);
- prop.appendChild(IValID.V_BORDER_BOX);
- prop.appendChild(IValID.V_CONTENT_BOX);
- prop.appendChild(IValID.V_PADDING_BOX);
- 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-origin
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ORIGIN);
- prop.appendChild(IValID.V_PADDING_BOX);
- prop.appendChild(IValID.V_BORDER_BOX);
- prop.appendChild(IValID.V_CONTENT_BOX);
- 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_SPACE);
- prop.appendChild(IValID.V_ROUND);
- prop.appendChild(IValID.V_NO_REPEAT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-size
- prop = PropCMSubProperty.getInstanceOf(PropCMProperty.P_BG_SIZE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_CONTAIN);
- prop.appendChild(IValID.V_COVER);
- 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);
-
- // border-top-left-radius
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_LEFT_RADIUS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-right-radius
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_RIGHT_RADIUS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-left-radius
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_LEFT_RADIUS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-right-radius
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_RIGHT_RADIUS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RADIUS);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_LEFT_RADIUS));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_RIGHT_RADIUS));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_LEFT_RADIUS));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_RIGHT_RADIUS));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.setMaxValueCount(4);
-
- // 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);
-
- // box-shadow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BOX_SHADOW);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // box-shadow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BOX_SIZING);
- prop.appendChild(IValID.V_BORDER_BOX);
- prop.appendChild(IValID.V_CONTENT_BOX);
- 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);
-
- // columns
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMNS);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_COUNT));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-count
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_COUNT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-fill
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_FILL);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_BALANCE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-gap
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_GAP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-rule
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-rule-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-rule-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-rule-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_RULE_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // column-span
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLUMN_SPAN);
- prop.appendChild(IValID.V_1);
- prop.appendChild(IValID.V_ALL);
- 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.appendChild(IValID.V_NONE);
- prop.appendChild(IValID.V_NORMAL);
- 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_PROGRESS);
- 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_INLINE_BLOCK);
- 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);
-
- // opacity
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OPACITY);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- 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);
-
- // resize
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RESIZE);
- prop.appendChild(IValID.V_BOTH);
- prop.appendChild(IValID.V_HORIZONTAL);
- prop.appendChild(IValID.V_NONE);
- prop.appendChild(IValID.V_VERTICAL);
- 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-overflow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_OVERFLOW);
- prop.appendChild(IValID.V_CLIP);
- prop.appendChild(IValID.V_ELLIPSIS);
- 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_PRE_LINE);
- prop.appendChild(IValID.V_PRE_WRAP);
- 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_ORANGE);
- 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 54cd4fb173..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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_CLIP = "background-clip"; //$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_ORIGIN = "background-origin"; //$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_BG_SIZE = "background-size"; //$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_BORDER_RADIUS = "border-radius"; //$NON-NLS-1$
- public final static String P_BORDER_TOP_LEFT_RADIUS = "border-top-left-radius"; //$NON-NLS-1$
- public final static String P_BORDER_TOP_RIGHT_RADIUS = "border-top-right-radius"; //$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_LEFT_RADIUS = "border-bottom-left-radius"; //$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_RIGHT_RADIUS = "border-bottom-right-radius"; //$NON-NLS-1$
- public final static String P_BOTTOM = "bottom";//$NON-NLS-1$
- public final static String P_BOX_SHADOW = "box-shadow"; //$NON-NLS-1$
- public final static String P_BOX_SIZING = "box-sizing"; //$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_COLUMNS = "columns";//$NON-NLS-1$
- public final static String P_COLUMN_COUNT = "column-count";//$NON-NLS-1$
- public final static String P_COLUMN_FILL = "column-fill";//$NON-NLS-1$
- public final static String P_COLUMN_GAP = "column-gap";//$NON-NLS-1$
- public final static String P_COLUMN_RULE = "column-rule";//$NON-NLS-1$
- public final static String P_COLUMN_RULE_COLOR = "column-rule-color";//$NON-NLS-1$
- public final static String P_COLUMN_RULE_STYLE = "column-rule-styler";//$NON-NLS-1$
- public final static String P_COLUMN_RULE_WIDTH = "column-rule-width";//$NON-NLS-1$
- public final static String P_COLUMN_SPAN = "column-span";//$NON-NLS-1$
- public final static String P_COLUMN_WIDTH = "column-width";//$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_OPACITY = "opacity"; //$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_RESIZE = "resize"; //$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_OVERFLOW = "text-overflow"; //$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 12aff7975f..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 f2830b946a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,114 +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 size;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
- for (int i = 0; i < size; i++) {
- s.append(list[i]);
- if(i < size - 1) {
- s.append(", ");
- }
- }
- s.append("]");
- return s.toString();
- }
-}
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 4e450416c6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ /dev/null
@@ -1,1075 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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 {
- // [274945] Multiple regions should have the spaces between collapsed
- String text = i.hasNext() ? getCollapsedText(region) : getText(region);
- buf.append(text);
- 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);
- }
-
-
- /**
- *
- */
- 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);
- // 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 getCollapsedText(ITextRegion region) {
- if (fParentRegion == null)
- return ""; //$NON-NLS-1$
- StringBuffer text = new StringBuffer(fParentRegion.getFullText(region));
- if (region.getLength() > region.getTextLength())
- text.replace(region.getTextLength(), region.getLength(), " "); //$NON-NLS-1$
- return text.toString();
- }
-
- 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 5858bec7ee..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
+++ /dev/null
@@ -1,266 +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.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-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 ICSSNode fRootNode = null;
- private int fRemovedRangeBegin = -1;
- private int fRemovedRangeEnd = -1;
- private CSSNodeListImpl fNodesToBeRemoved = new CSSNodeListImpl();
- private Set fOldRegionsList;
-
- /**
- * 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) {
- return fOldRegionsList.contains(flatNode);
- }
-
- /**
- *
- */
- 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;
-
- fOldRegionsList = new HashSet();
- final Enumeration elements = oldStructuredDocumentRegions.elements();
- while (elements.hasMoreElements()) {
- fOldRegionsList.add(elements.nextElement());
- }
- // 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 c8e7b5d941..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.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);
- if (structuredDocumentEvent.isEntireDocumentReplaced())
- parser.replaceDocument(newStructuredDocumentRegions);
- else
- 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 a9e971e221..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
+++ /dev/null
@@ -1,1317 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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 replaceDocument(IStructuredDocumentRegionList newStructuredDocumentRegions) {
- if (fDocument == null || fCreationContext == null)
- return;
- ((CSSDocumentImpl) fDocument).removeChildNodes();
-
- if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
- setupCreationContext(newStructuredDocumentRegions.item(0));
- insertStructuredDocumentRegions(newStructuredDocumentRegions);
- }
-
- IStructuredDocument structuredDocument = fStructuredDocumentWalker.getStructuredDocument();
- ((CSSStructuredDocumentRegionContainer)fDocument).setRangeStructuredDocumentRegion(structuredDocument.getFirstStructuredDocumentRegion(), structuredDocument.getLastStructuredDocumentRegion());
- }
-
- /**
- *
- */
- 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()) {
- /* when removing old nodes the creation context should be set up based on them
- * else creation context is that of the new nodes
- */
- if( oldStructuredDocumentRegions != null && oldStructuredDocumentRegions.getLength() < 0) {
- setupCreationContext(oldStructuredDocumentRegions.item(0));
- } else {
- 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 5bb8a8b453..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-
-
-/**
- *
- */
-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
- insertText(region.start, region.end - region.start, text);
-
- fParser.cleanupUpdateContext();
- }
-
- /**
- * @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
- insertText(region.start, region.end - region.start, text);
-
- fParser.cleanupUpdateContext();
- }
-
- /**
- *
- */
- 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);
-
- defaultInserted(parentNode, node);
-
- fParser.cleanupUpdateContext();
- }
-
- /**
- *
- */
- 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);
- if (source.length() > 0) {
- insertText(insertPos, endPos - insertPos, source);
- }
- else {
- removeText(insertPos, endPos - insertPos);
- }
-
- fParser.cleanupUpdateContext();
- }
-
- /**
- *
- */
- 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);
-
- insertText(start, oldLength, newValue);
-
- fParser.cleanupUpdateContext();
- }
-}
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 d87b011eb8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
+++ /dev/null
@@ -1,291 +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.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(nodeText + "first flat node is null."); //$NON-NLS-1$
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(nodeText + "first flat node is not in model."); //$NON-NLS-1$
- }
- }
- flatNode = node.getLastStructuredDocumentRegion();
- if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
- errors.add(nodeText + "last flat node is null."); //$NON-NLS-1$
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(nodeText + "last flat node is not in model."); //$NON-NLS-1$
- }
- }
- }
- 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(nodeText + "first region is null."); //$NON-NLS-1$
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(nodeText + "first region is not in model."); //$NON-NLS-1$
- }
- }
- region = node.getLastRegion();
- if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
- errors.add(nodeText + "last region is null."); //$NON-NLS-1$
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(nodeText + "last region is not in model."); //$NON-NLS-1$
- }
- }
- }
-
- 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(nodeText + "first region is null."); //$NON-NLS-1$
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(nodeText + "first region is not in model."); //$NON-NLS-1$
- }
- }
- region = node.getLastRegion();
- if (region == null && 0 < attr.getValue().length()) {
- errors.add(nodeText + "last region is null."); //$NON-NLS-1$
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(nodeText + "last region is not in model."); //$NON-NLS-1$
- }
- }
- }
-
- 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 0d190e0ee3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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;
-
-/**
- *
- */
-public 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.getFullText(current));
- if (current == fLastRegion)
- break;
- }
- else {
- if (current == fFirstRegion) {
- bIn = true;
- source.append(fParentRegion.getFullText(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;
- }
-
- public 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 2ae7e8d41c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-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;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-/**
- *
- */
-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) {
- Node node = element.getParentNode();
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
- return (Element) node;
- }
- return null;
-
- }
-
- /**
- * @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;
- if (!element.hasAttribute("id") || (key = element.getAttribute("id")).length() == 0)//$NON-NLS-1$ //$NON-NLS-2$
- return false;
- if (!selector.getID(0).equals(key))
- return false;
- }
-
- // check class
- i = selector.getNumOfClasses();
- if (i > 0) {
- if (!element.hasAttribute("class") || (key = element.getAttribute("class")).length() == 0) //$NON-NLS-1$ //$NON-NLS-2$
- 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 attrName = tokenizer.nextToken();
- String attrValue = null;
- if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
- 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 1f2d8c9106..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, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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) && attrBuf != null) {
- 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 2e66af5d66..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
+++ /dev/null
@@ -1,654 +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 java.util.List;
-import java.util.Stack;
-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.CSSStyleSheet;
-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;
- }
-
- public CSSRuleList getCssRules(boolean shouldImport) {
- if (!shouldImport)
- return getCssRules();
-
- CSSRuleListImpl list = new CSSRuleListImpl();
- Stack refs = new Stack();
- getRules(list, this, refs);
- return list;
- }
-
- private void getRules(CSSRuleListImpl list, ICSSStyleSheet sheet, Stack refs) {
- String href = sheet.getHref();
- if (href != null) {
- // Avoid circular @imports
- if (refs.contains(href))
- return;
- refs.push(href);
- }
- boolean acceptImports = true;
- for (ICSSNode node = sheet.getFirstChild(); node != null; node = node.getNextSibling()) {
- // Import the stylesheet into the list
- // @import rules must precede all other rules, according to the spec
- if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE && acceptImports) {
- CSSStyleSheet importSheet = ((ICSSImportRule) node).getStyleSheet();
- if (importSheet instanceof ICSSStyleSheet)
- getRules(list, (ICSSStyleSheet) importSheet, refs);
- else
- list.appendNode(node);
- }
- // Add the rule to the list
- else if (node instanceof CSSRule) {
- list.appendNode(node);
- if (node.getNodeType() != ICSSNode.CHARSETRULE_NODE)
- acceptImports = false;
- }
- }
- if (href != null)
- refs.pop();
- }
-
- /**
- * <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).hasAttribute("TITLE") ? ((Element) node).getAttribute("TITLE") : null;//$NON-NLS-1$ //$NON-NLS-2$
- }
- 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).hasAttribute("TYPE") ? ((Element) node).getAttribute("TYPE") : null;//$NON-NLS-1$ //$NON-NLS-2$
- }
- 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 ba8fb15566..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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.jface.text.Region;
-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.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-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();
- IStructuredDocumentRegion startRegion =
- structuredModel.getStructuredDocument().getRegionAtCharacterOffset(start);
- IStructuredDocumentRegion endRegion =
- structuredModel.getStructuredDocument().getRegionAtCharacterOffset(start + length);
- start = startRegion.getStart();
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
- StringBuffer buf = formatter.format(doc, new Region(start, (endRegion.getEnd() - start)));
- if (buf != null) {
- formatUtil.replaceSource(doc.getModel(), start, endRegion.getEnd() - start, 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 8ceb1387a3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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();
- int[] result = null;
- if (prev == null || (prev.getType() == CSSRegionContexts.CSS_S && (result = TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0))[0] >= 0)) {
- // Collapse to one empty line if there's more than one.
- int offset = result[0] + DefaultLineTracker.DELIMITERS[result[1]].length();
- if (offset < it.getStructuredDocumentRegion().getText(prev).length() ) {
- if (TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), offset)[0] >= 0) {
- source.append(delim);
- }
- }
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- else if (prev.getType() == CSSRegionContexts.CSS_COMMENT) {
- String fullText = toAppend.getDocumentRegion().getFullText(prev);
- String trimmedText = toAppend.getDocumentRegion().getText(prev);
- String whiteSpaces = "";//$NON-NLS-1$
- if (fullText != null && trimmedText != null)
- whiteSpaces = fullText.substring(trimmedText.length());
- int[] delimiterFound = TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, whiteSpaces, 0);
- if (delimiterFound[0] != -1) {
- source.append(delim);
- }
- else {
- appendSpaceBefore(node, toAppend.getText(), source);
-
- /*If two comments can't be adjusted in one line(combined length exceeds line width),
- * a tab is also appended along with next line delimiter , we need to remove that.
- */
- if (source.toString().endsWith(getIndentString())) {
- source.delete((source.length() - getIndentString().length()), source.length());
- }
- }
- }
- 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);
- // no delimiter case
- while (n-- > 0)
- source.append(" ");//$NON-NLS-1$
- }
- else if (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 || CSSRegionContexts.CSS_DECLARATION_DELIMITER == 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 d8b4e2a531..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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();
- short selCase = -1;
- if (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE || type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- selCase = stgy.getSelectorTagCase();
- }
- else if (type == CSSRegionContexts.CSS_SELECTOR_CLASS) {
- selCase = stgy.getClassSelectorCase();
- }
- else if (type == CSSRegionContexts.CSS_SELECTOR_ID) {
- selCase = stgy.getIdSelectorCase();
- }
-
- 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();
- }
- else if (selCase == org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy.ASIS) {
- 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 2b27800177..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
+++ /dev/null
@@ -1,108 +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.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-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 (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 e546892c9a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
+++ /dev/null
@@ -1,357 +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.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;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-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 && ((MediaList) child).getLength() > 0) { // 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 && ((MediaList) child).getLength() > 0) { // between
- // "@media" and mediatype
- appendSpaceBefore(node, toAppend, source);
- } else if (prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE && ((MediaList) prev).getLength() > 0) { // 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);
- ICSSNode child = node.getFirstChild();
- if (child != null && (child instanceof MediaList) && ((MediaList) child).getLength() == 0) {
- if (child.getNextSibling() != null)
- end = ((IndexedRegion) child.getNextSibling()).getStartOffset();
- else
- end = -1;
- }
-
- 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);
- }
-
- if (child != null && (child instanceof MediaList) && ((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 28eb99b605..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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.document.CSSRegionContainer;
-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) {
- boolean append = true;
- if (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$
- ICSSNode prevSibling = child.getPreviousSibling();
- if (prevSibling instanceof ICSSPrimitiveValue) {
- if (((ICSSPrimitiveValue)prevSibling).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
- append = false;
- if (prevSibling instanceof CSSRegionContainer) {
- // If the previous region was unknown, don't append whitespace
- final ITextRegion region = ((CSSRegionContainer) prevSibling).getFirstRegion();
- if (region != null && CSSRegionContexts.CSS_UNKNOWN.equals(region.getType()))
- append = false;
- }
- }
- }
- if (child instanceof CSSRegionContainer) {
- final ITextRegion region = ((CSSRegionContainer) child).getFirstRegion();
- // If the current region is unknown, don't append whitespace
- if (region != null && CSSRegionContexts.CSS_UNKNOWN.equals(region.getType()))
- append = false;
- }
- if (toAppend != null && !toAppend.equals(",") && !toAppend.equals("/") && append) {//$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 (node.getFirstChild() != null && (!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 9db95c4306..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java
+++ /dev/null
@@ -1,264 +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) {
- if (regions.length > 0 && !regions[0].getType().equals(CSSRegionContexts.CSS_COMMENT))
- appendDelimBefore(node, regions[0], source);
- else if (regions.length == 0) {
- appendDelimBefore(node, 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 4f261cbdf9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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.text.Collator;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.IProductConstants;
-import org.eclipse.wst.css.core.internal.metamodelimpl.RegistryReader;
-
-public class CSSProfileRegistry {
-
- CSSProfile fDefault = null;
-
- public synchronized static CSSProfileRegistry getInstance() {
- if (fInstance == null) {
- fInstance = new CSSProfileRegistry();
- }
- return fInstance;
- }
-
- static class ProfileNameComparator implements Comparator {
- static Collator delegate = Collator.getInstance();
-
- public int compare(Object o1, Object o2) {
- if (o1 instanceof CSSProfile && o2 instanceof CSSProfile) {
- if (((CSSProfile) o1).getProfileName() != null && ((CSSProfile) o2).getProfileName() != null) {
- return delegate.compare(((CSSProfile) o1).getProfileName(), ((CSSProfile) o2).getProfileName());
- }
- }
- return 0;
- }
- }
-
- public Iterator getProfiles() {
- List values = new ArrayList(fProfiles.values());
- Collections.sort(values, new ProfileNameComparator());
- return Collections.unmodifiableCollection(values).iterator();
- }
-
- public CSSProfile getProfile(String profileID) {
- return (CSSProfile) fProfiles.get(profileID);
- }
-
- public CSSProfile getDefaultProfile() {
- if (fDefault != null) {
- return fDefault;
- }
-
- String id = Platform.getProduct().getProperty(IProductConstants.DEFAULT_PROFILE);
-
- Iterator i = getProfiles();
- CSSProfile firstDefault = null;
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- if (profile.isDefault()) {
- if (id == null) { // Original scenario
- fDefault = profile;
- return profile;
- }
- else if (firstDefault == null) { // extension point used, flag the first default in case the id doesn't end up matching
- firstDefault = profile;
- }
- }
- if (id != null && id.equals(profile.getProfileID())) { // Found the profile for the extension
- fDefault = profile;
- return profile;
- }
- }
- return firstDefault;
- }
-
- /**
- * 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 2c8859f0e6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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;
-import org.w3c.dom.Node;
-
-
-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();
-
- }
-
- /**
- * Finds the meta model for the node that contains the css model
- */
- public CSSMetaModel findMetaModelFor(Node node) {
- return CSSProfileFinder.getInstance().findProfileFor(node).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 886bc89016..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is 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;
-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;
-
-
-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(Node node) {
- String baseLocation = null;
- if (node instanceof IDOMNode) {
- IDOMModel model = ((IDOMNode) node).getModel();
- 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 51adb83e45..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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) {
- String version = getAttribute("version"); //$NON-NLS-1$
- long v = 0;
- if (version != null) {
- try {
- v = Long.parseLong(version);
- }
- catch (Exception e) {}
- }
- // Pseudo Elements added since CSS3 are prefixed by two colons
- fValue = ((v >= 3) ? "::" : ":") + value; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
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 1f1710506a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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 {
-
- private StringBuffer fCharacters = null;
-
- 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 {
-
- TagNode tagNode = (TagNode) fNodeStack.peek();
- CSSMMNodeImpl node = tagNode.node;
- String tagName = tagNode.tag;
- if (fCharacters != null && (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))) {
- String value = getResourceString(fCharacters.toString().trim());
- 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);
- }
- }
- }
- fNodeStack.pop();
- fCharacters = null;
- }
-
- 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)) {
- if (fCharacters == null) {
- fCharacters = new StringBuffer(length);
- }
- fCharacters.append(ch, start, length);
- }
- }
-
- 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 413cc3aed0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
+++ /dev/null
@@ -1,1943 +0,0 @@
-/* The following code was generated by JFlex 1.4.2 on 10/3/11 9:59 AM */
-
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 10/3/11 9:59 AM from the specification file
- * <tt>/Users/dev/workspaces/indigo/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/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\72\1\73\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\71\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\66\1\24\1\52\1\65\1\54\1\53\1\66\1\23\1\44\1\47"+
- "\1\22\5\66\1\67\1\3\1\70\1\72\1\2\1\16\1\42\1\7"+
- "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\66\1\24\1\52"+
- "\1\65\1\54\1\53\1\66\1\23\1\44\1\47\1\22\5\66\1\60"+
- "\1\72\1\33\1\72\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\3\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\0\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\5\0\2\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\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\1\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\1\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\1\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\5\0\1\32\1\51"+
- "\4\0\1\62\3\0\1\51\3\0\1\63\12\0";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[426];
- 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\74\0\170\0\264\0\360\0\u012c\0\u0168\0\u01a4"+
- "\0\u01e0\0\u021c\0\u0258\0\u0294\0\u02d0\0\u030c\0\u0348\0\u0384"+
- "\0\u03c0\0\u03fc\0\u0438\0\u0474\0\u04b0\0\u04ec\0\u0528\0\u0564"+
- "\0\u05a0\0\u05dc\0\u0618\0\u0474\0\u0654\0\u0474\0\u0690\0\u06cc"+
- "\0\u0474\0\u0708\0\u0744\0\u0780\0\u0474\0\u07bc\0\u07f8\0\u0834"+
- "\0\u0870\0\u08ac\0\u08e8\0\u0474\0\u0924\0\u0960\0\u099c\0\u0474"+
- "\0\u0474\0\u09d8\0\u0a14\0\u0a50\0\u0474\0\u0a8c\0\u0ac8\0\u0474"+
- "\0\u0474\0\u0b04\0\u0b40\0\u0b7c\0\u0474\0\u0bb8\0\u0474\0\u0bf4"+
- "\0\u0c30\0\u0c6c\0\u0ca8\0\u0ce4\0\u0d20\0\u0d5c\0\u0d98\0\u0dd4"+
- "\0\u0474\0\u0474\0\u0e10\0\u0e4c\0\u0e88\0\u0ec4\0\u0f00\0\u0f3c"+
- "\0\u0474\0\u0f78\0\u0fb4\0\u0ff0\0\u102c\0\u1068\0\u0654\0\u0474"+
- "\0\u10a4\0\u04ec\0\u10e0\0\u111c\0\u05a0\0\u1158\0\u05dc\0\u1194"+
- "\0\u11d0\0\u120c\0\u1248\0\u1284\0\u12c0\0\u12fc\0\u1338\0\u1374"+
- "\0\u13b0\0\u13ec\0\u0708\0\u1428\0\u0474\0\u0780\0\u1464\0\u07bc"+
- "\0\u14a0\0\u0474\0\u07f8\0\u14dc\0\u1518\0\u08ac\0\u1554\0\u0960"+
- "\0\u1590\0\u0a14\0\u15cc\0\u1608\0\u0474\0\u0b40\0\u1644\0\u0c30"+
- "\0\u1680\0\u0c6c\0\u16bc\0\u0474\0\u0ce4\0\u16f8\0\u0d5c\0\u1734"+
- "\0\u1770\0\u17ac\0\u17e8\0\u1824\0\u0f78\0\u0474\0\u0e88\0\u1860"+
- "\0\u0474\0\u189c\0\u0ec4\0\u18d8\0\u0474\0\u0f3c\0\u1914\0\u1950"+
- "\0\u0ff0\0\u198c\0\u19c8\0\u1a04\0\u1068\0\u1a40\0\u0474\0\u1a7c"+
- "\0\u0474\0\u1ab8\0\u1af4\0\u1b30\0\u1b6c\0\u1ba8\0\u1be4\0\u1c20"+
- "\0\u1c5c\0\u1c98\0\u1cd4\0\u1d10\0\u1d4c\0\u0708\0\u1d88\0\u1dc4"+
- "\0\u0780\0\u1e00\0\u1e3c\0\u07bc\0\u1e78\0\u1eb4\0\u07f8\0\u1ef0"+
- "\0\u1f2c\0\u1f68\0\u1fa4\0\u1fe0\0\u201c\0\u2058\0\u2094\0\u0c6c"+
- "\0\u20d0\0\u210c\0\u0ce4\0\u2148\0\u2184\0\u21c0\0\u21fc\0\u2238"+
- "\0\u2274\0\u22b0\0\u0ec4\0\u22ec\0\u2328\0\u0f3c\0\u2364\0\u23a0"+
- "\0\u23dc\0\u2418\0\u2454\0\u2490\0\u24cc\0\u2508\0\u0474\0\u0474"+
- "\0\u2544\0\u2580\0\u25bc\0\u25f8\0\u2634\0\u0474\0\u2670\0\u26ac"+
- "\0\u26e8\0\u2724\0\u2760\0\u279c\0\u27d8\0\u2814\0\u2850\0\u288c"+
- "\0\u28c8\0\u2904\0\u2940\0\u297c\0\u29b8\0\u29f4\0\u2a30\0\u2a6c"+
- "\0\u2aa8\0\u2ae4\0\u2b20\0\u2b5c\0\u2b98\0\u2bd4\0\u2c10\0\u2c4c"+
- "\0\u2c88\0\u2cc4\0\u2d00\0\u2d3c\0\u0474\0\u2d78\0\u2db4\0\u2df0"+
- "\0\u2e2c\0\u2e68\0\u2ea4\0\u2ee0\0\u2f1c\0\u2f58\0\u2f94\0\u0474"+
- "\0\u2fd0\0\u300c\0\u3048\0\u3084\0\u30c0\0\u30fc\0\u3138\0\u3174"+
- "\0\u31b0\0\u31ec\0\u3228\0\u3264\0\u32a0\0\u32dc\0\u3318\0\u3354"+
- "\0\u3390\0\u33cc\0\u2b98\0\u3408\0\u3444\0\u0474\0\u3480\0\u34bc"+
- "\0\u34f8\0\u3534\0\u3570\0\u35ac\0\u0474\0\u35e8\0\u3624\0\u3660"+
- "\0\u369c\0\u36d8\0\u3714\0\u3750\0\u378c\0\u2ee0\0\u37c8\0\u3804"+
- "\0\u3840\0\u387c\0\u38b8\0\u38f4\0\u3930\0\u396c\0\u39a8\0\u39e4"+
- "\0\u3a20\0\u3a5c\0\u3a98\0\u3ad4\0\u3b10\0\u3b4c\0\u3b88\0\u3bc4"+
- "\0\u3c00\0\u3c3c\0\u3390\0\u3c78\0\u3cb4\0\u3cf0\0\u3d2c\0\u3d68"+
- "\0\u3da4\0\u3de0\0\u0474\0\u3e1c\0\u3e58\0\u3e94\0\u3ed0\0\u3f0c"+
- "\0\u3f48\0\u3f84\0\u3fc0\0\u3ffc\0\u4038\0\u4074\0\u40b0\0\u40ec"+
- "\0\u4128\0\u4164\0\u41a0\0\u41dc\0\u4218\0\u4254\0\u4290\0\u42cc"+
- "\0\u4308\0\u4344\0\u4380\0\u43bc\0\u43f8\0\u4434\0\u4470\0\u44ac"+
- "\0\u44e8\0\u4524\0\u4560\0\u459c\0\u45d8\0\u4614\0\u4650\0\u468c"+
- "\0\u46c8\0\u4704\0\u0474\0\u4740\0\u477c\0\u47b8\0\u47f4\0\u4830"+
- "\0\u486c\0\u48a8\0\u48e4\0\u2f58\0\u4920\0\u2f94\0\u495c\0\u4998"+
- "\0\u49d4\0\u4a10\0\u4a4c\0\u4a88\0\u4ac4\0\u4b00\0\u4b3c\0\u4b78"+
- "\0\u4bb4\0\u3408\0\u4bf0\0\u3444\0\u4c2c\0\u4c68\0\u4ca4\0\u4ce0"+
- "\0\u4d1c\0\u4d58\0\u4d94\0\u4dd0\0\u4e0c\0\u4e48\0\u4e84\0\u0474"+
- "\0\u4ec0\0\u4efc\0\u4f38\0\u0474\0\u4f74\0\u4fb0\0\u4fec\0\u0474"+
- "\0\u5028\0\u5064\0\u50a0\0\u50dc\0\u5118\0\u5154\0\u5190\0\u51cc"+
- "\0\u5208\0\u5244";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[426];
- 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\4\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\41\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\27\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\25\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\4\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\20\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\60\1\55\1\24"+
- "\4\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\61\2\24\1\60\15\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\4\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\17\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\4\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\4\72\1\24"+
- "\1\75\7\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\76\1\37\31\24\1\75\1\77\1\76\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\4\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\31\24"+
- "\1\75\5\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\110\1\37"+
- "\11\105\1\111\4\105\1\24\2\105\1\24\1\105\1\24"+
- "\4\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\111\11\24\1\112\12\24\1\113"+
- "\1\114\1\115\1\27\1\116\1\27\1\114\1\117\1\120"+
- "\1\27\1\121\1\122\1\123\1\24\2\27\1\124\1\125"+
- "\2\114\1\24\1\114\1\24\1\33\1\126\1\24\1\34"+
- "\1\127\1\24\1\37\11\114\1\111\4\114\1\130\2\114"+
- "\1\24\1\114\1\24\4\114\6\24\1\113\1\114\1\115"+
- "\1\131\1\116\1\131\1\114\1\117\1\120\1\131\1\121"+
- "\1\122\1\123\1\24\2\131\1\124\1\125\2\114\1\24"+
- "\1\114\1\24\1\33\1\126\1\24\1\34\1\127\1\24"+
- "\1\37\11\114\1\111\4\114\1\130\2\114\1\24\1\114"+
- "\1\24\4\114\5\24\75\0\2\25\1\132\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\4\25\6\0\1\133"+
- "\2\25\1\0\2\25\1\133\2\25\1\0\4\25\2\0"+
- "\16\25\1\133\2\25\1\133\2\25\1\133\10\25\1\133"+
- "\4\25\1\133\10\25\4\0\1\27\1\0\1\27\3\0"+
- "\1\27\4\0\2\27\55\0\1\25\1\132\3\0\1\25"+
- "\1\134\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\4\25\6\0"+
- "\2\135\1\136\3\0\2\135\11\0\3\135\1\0\1\135"+
- "\10\0\11\135\1\0\4\135\1\0\2\135\1\0\1\135"+
- "\1\0\4\135\6\0\2\137\1\140\3\0\2\137\11\0"+
- "\3\137\1\0\1\137\10\0\11\137\1\0\4\137\1\0"+
- "\2\137\1\0\1\137\1\0\4\137\36\0\1\141\77\0"+
- "\1\142\75\0\2\143\10\0\1\144\1\145\1\146\7\0"+
- "\2\147\11\0\1\150\1\151\3\0\1\150\1\152\11\0"+
- "\3\150\1\0\1\150\10\0\11\150\1\0\4\150\1\0"+
- "\2\150\1\0\1\150\1\0\4\150\6\0\2\153\1\154"+
- "\1\0\1\155\11\153\2\0\53\153\10\0\1\134\64\0"+
- "\2\156\1\157\1\0\4\156\1\155\5\156\2\0\53\156"+
- "\1\0\2\160\1\161\1\0\1\162\11\160\2\0\53\160"+
- "\1\0\2\163\1\164\1\0\4\163\1\162\5\163\2\0"+
- "\53\163\23\0\1\165\51\0\2\51\1\166\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\4\51\6\0\1\167"+
- "\2\51\1\0\2\51\1\167\2\51\1\0\4\51\2\0"+
- "\16\51\1\167\2\51\1\167\2\51\1\167\10\51\1\167"+
- "\4\51\1\167\10\51\2\0\1\51\1\166\3\0\1\51"+
- "\1\134\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\4\51\6\0"+
- "\2\55\1\170\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\4\55\6\0\1\171\2\55\1\0\2\55\1\171"+
- "\2\55\1\0\4\55\2\0\16\55\1\171\2\55\1\171"+
- "\2\55\1\171\10\55\1\171\4\55\1\171\10\55\2\0"+
- "\1\55\1\170\3\0\1\55\1\134\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\4\55\6\0\2\62\1\172\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\4\62\6\0\1\173"+
- "\2\62\1\0\2\62\1\173\2\62\1\0\4\62\2\0"+
- "\16\62\1\173\2\62\1\173\2\62\1\173\10\62\1\173"+
- "\4\62\1\173\10\62\2\0\1\62\1\172\3\0\1\62"+
- "\1\134\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\4\62\7\0"+
- "\1\62\1\172\3\0\1\62\1\174\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\4\62\5\0\4\175\1\67\1\175\1\67"+
- "\3\175\1\67\2\175\1\0\1\175\2\67\11\175\1\0"+
- "\1\175\1\0\20\175\1\0\2\175\1\0\13\175\1\0"+
- "\2\72\1\176\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\4\72\6\0\1\177\2\72\1\0\2\72\1\177"+
- "\2\72\1\0\4\72\2\0\16\72\1\177\2\72\1\177"+
- "\2\72\1\177\10\72\1\177\4\72\1\177\10\72\2\0"+
- "\1\72\1\176\3\0\1\72\1\134\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\4\72\76\0\1\77\3\0\2\100\1\200"+
- "\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\4\100"+
- "\6\0\1\201\2\100\1\0\2\100\1\201\2\100\1\0"+
- "\4\100\2\0\16\100\1\201\2\100\1\201\2\100\1\201"+
- "\10\100\1\201\4\100\1\201\10\100\1\0\2\202\1\203"+
- "\1\0\1\204\11\202\2\0\53\202\2\0\1\100\1\200"+
- "\3\0\1\100\1\134\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"+
- "\4\100\6\0\2\205\1\206\1\0\4\205\1\204\5\205"+
- "\2\0\53\205\1\0\2\105\1\207\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\4\105\6\0\1\210\2\105"+
- "\1\0\2\105\1\210\2\105\1\0\4\105\2\0\16\105"+
- "\1\210\2\105\1\210\2\105\1\210\10\105\1\210\4\105"+
- "\1\210\10\105\2\0\1\105\1\207\3\0\1\105\1\134"+
- "\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\4\105\7\0\1\105"+
- "\1\207\3\0\1\105\1\211\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\4\105\6\0\1\113\1\212\1\213\3\0\1\212"+
- "\1\214\3\0\1\215\5\0\3\212\1\0\1\212\10\0"+
- "\11\212\1\0\4\212\1\0\2\212\1\0\1\212\1\0"+
- "\4\212\4\0\1\216\1\0\2\114\1\217\3\0\2\114"+
- "\3\0\1\220\5\0\3\114\1\221\1\114\10\0\11\114"+
- "\1\0\4\114\1\0\2\114\1\0\1\114\1\0\4\114"+
- "\6\0\1\222\2\114\1\0\2\114\1\222\2\114\1\0"+
- "\4\114\2\0\16\114\1\222\2\114\1\222\2\114\1\222"+
- "\10\114\1\222\4\114\1\222\10\114\1\0\2\223\1\224"+
- "\1\0\1\225\11\223\2\0\53\223\1\0\1\113\1\114"+
- "\1\217\3\0\1\114\1\134\3\0\1\215\5\0\3\114"+
- "\1\0\1\114\10\0\11\114\1\0\4\114\1\0\2\114"+
- "\1\0\1\114\1\0\4\114\6\0\2\226\1\227\1\0"+
- "\4\226\1\225\5\226\2\0\53\226\1\0\1\230\73\0"+
- "\1\113\12\0\1\215\60\0\2\231\1\232\3\0\2\231"+
- "\11\0\3\231\1\0\1\231\10\0\11\231\1\0\4\231"+
- "\1\0\2\231\1\0\1\231\1\0\4\231\6\0\2\114"+
- "\1\217\3\0\2\114\3\0\1\220\1\233\4\0\1\114"+
- "\1\234\1\114\1\221\1\114\10\0\11\114\1\0\4\114"+
- "\1\0\2\114\1\0\1\114\1\0\4\114\11\0\1\235"+
- "\1\0\1\235\3\0\1\235\4\0\2\235\30\0\1\236"+
- "\22\0\4\237\1\131\1\237\1\131\3\237\1\131\4\237"+
- "\2\131\12\237\1\0\14\237\1\0\23\237\1\0\1\240"+
- "\1\25\1\132\1\25\1\0\1\25\1\240\1\25\1\0"+
- "\1\25\4\0\2\25\1\0\3\25\1\0\1\25\10\0"+
- "\1\240\2\25\1\240\2\25\1\240\2\25\1\0\4\25"+
- "\1\0\1\240\1\25\1\0\1\25\1\0\1\240\3\25"+
- "\37\0\1\241\42\0\1\242\2\135\1\0\2\135\1\242"+
- "\2\135\1\0\4\135\2\0\16\135\1\242\2\135\1\242"+
- "\2\135\1\242\10\135\1\242\4\135\1\242\10\135\1\0"+
- "\1\243\2\137\1\0\2\137\1\243\2\137\1\0\4\137"+
- "\2\0\16\137\1\243\2\137\1\243\2\137\1\243\10\137"+
- "\1\243\4\137\1\243\10\137\10\0\1\244\63\0\35\142"+
- "\1\245\36\142\41\0\1\246\104\0\1\247\66\0\2\250"+
- "\67\0\2\251\104\0\1\252\20\0\2\150\1\151\3\0"+
- "\2\150\11\0\3\150\1\253\1\150\10\0\11\150\1\0"+
- "\4\150\1\0\2\150\1\0\1\150\1\0\4\150\6\0"+
- "\1\254\2\150\1\0\2\150\1\254\2\150\1\0\4\150"+
- "\2\0\16\150\1\254\2\150\1\254\2\150\1\254\10\150"+
- "\1\254\4\150\1\254\10\150\2\0\1\150\1\151\3\0"+
- "\1\150\12\0\3\150\1\0\1\150\10\0\11\150\1\0"+
- "\4\150\1\0\2\150\1\0\1\150\1\0\4\150\6\0"+
- "\1\255\1\153\1\154\1\153\1\256\1\153\1\255\10\153"+
- "\1\257\16\153\1\255\2\153\1\255\2\153\1\255\10\153"+
- "\1\255\4\153\1\255\10\153\1\0\1\260\1\156\1\157"+
- "\3\156\1\260\1\156\1\261\6\156\1\262\16\156\1\260"+
- "\2\156\1\260\2\156\1\260\10\156\1\260\4\156\1\260"+
- "\10\156\1\0\1\263\1\160\1\161\1\160\1\264\1\160"+
- "\1\263\10\160\1\265\16\160\1\263\2\160\1\263\2\160"+
- "\1\263\10\160\1\263\4\160\1\263\10\160\1\0\1\266"+
- "\1\163\1\164\3\163\1\266\1\163\1\267\6\163\1\270"+
- "\16\163\1\266\2\163\1\266\2\163\1\266\10\163\1\266"+
- "\4\163\1\266\10\163\24\0\1\271\50\0\1\272\1\51"+
- "\1\166\1\51\1\0\1\51\1\272\1\51\1\0\1\51"+
- "\4\0\2\51\1\0\3\51\1\0\1\51\10\0\1\272"+
- "\2\51\1\272\2\51\1\272\2\51\1\0\4\51\1\0"+
- "\1\272\1\51\1\0\1\51\1\0\1\272\3\51\6\0"+
- "\1\273\1\55\1\170\1\55\1\0\1\55\1\273\1\55"+
- "\1\0\1\55\4\0\2\55\1\0\3\55\1\0\1\55"+
- "\10\0\1\273\2\55\1\273\2\55\1\273\2\55\1\0"+
- "\4\55\1\0\1\273\1\55\1\0\1\55\1\0\1\273"+
- "\3\55\6\0\1\274\1\62\1\172\1\62\1\0\1\62"+
- "\1\274\1\62\1\0\1\62\4\0\2\62\1\0\3\62"+
- "\1\0\1\62\10\0\1\274\2\62\1\274\2\62\1\274"+
- "\2\62\1\0\4\62\1\0\1\274\1\62\1\0\1\62"+
- "\1\0\1\274\3\62\7\0\1\62\1\172\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\4\62\6\0\1\275"+
- "\1\72\1\176\1\72\1\0\1\72\1\275\1\72\1\0"+
- "\1\72\4\0\2\72\1\0\3\72\1\0\1\72\10\0"+
- "\1\275\2\72\1\275\2\72\1\275\2\72\1\0\4\72"+
- "\1\0\1\275\1\72\1\0\1\72\1\0\1\275\3\72"+
- "\6\0\1\276\1\100\1\200\1\100\1\0\1\100\1\276"+
- "\1\100\1\0\1\100\4\0\2\100\1\0\3\100\1\0"+
- "\1\100\10\0\1\276\2\100\1\276\2\100\1\276\2\100"+
- "\1\0\4\100\1\0\1\276\1\100\1\0\1\100\1\0"+
- "\1\276\3\100\6\0\1\277\1\202\1\203\1\202\1\300"+
- "\1\202\1\277\10\202\1\301\16\202\1\277\2\202\1\277"+
- "\2\202\1\277\10\202\1\277\4\202\1\277\10\202\1\0"+
- "\1\302\1\205\1\206\3\205\1\302\1\205\1\303\6\205"+
- "\1\304\16\205\1\302\2\205\1\302\2\205\1\302\10\205"+
- "\1\302\4\205\1\302\10\205\1\0\1\305\1\105\1\207"+
- "\1\105\1\0\1\105\1\305\1\105\1\0\1\105\4\0"+
- "\2\105\1\0\3\105\1\0\1\105\10\0\1\305\2\105"+
- "\1\305\2\105\1\305\2\105\1\0\4\105\1\0\1\305"+
- "\1\105\1\0\1\105\1\0\1\305\3\105\7\0\1\105"+
- "\1\207\3\0\1\105\12\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"+
- "\4\105\6\0\2\212\1\213\3\0\2\212\11\0\3\212"+
- "\1\0\1\212\10\0\11\212\1\0\4\212\1\0\2\212"+
- "\1\0\1\212\1\0\4\212\6\0\1\306\2\212\1\0"+
- "\2\212\1\306\2\212\1\0\4\212\2\0\16\212\1\306"+
- "\2\212\1\306\2\212\1\306\10\212\1\306\4\212\1\306"+
- "\10\212\2\0\1\212\1\213\3\0\1\212\12\0\3\212"+
- "\1\0\1\212\10\0\11\212\1\0\4\212\1\0\2\212"+
- "\1\0\1\212\1\0\4\212\6\0\2\307\1\310\3\0"+
- "\2\307\11\0\3\307\1\0\1\307\10\0\11\307\1\0"+
- "\4\307\1\0\2\307\1\0\1\307\1\0\4\307\6\0"+
- "\1\311\1\114\1\217\1\114\1\0\1\114\1\311\1\114"+
- "\1\0\1\114\1\0\1\220\2\0\2\114\1\0\3\114"+
- "\1\221\1\114\10\0\1\311\2\114\1\311\2\114\1\311"+
- "\2\114\1\0\4\114\1\0\1\311\1\114\1\0\1\114"+
- "\1\0\1\311\3\114\6\0\1\312\1\223\1\224\1\223"+
- "\1\313\1\223\1\312\10\223\1\314\16\223\1\312\2\223"+
- "\1\312\2\223\1\312\10\223\1\312\4\223\1\312\10\223"+
- "\1\0\1\315\1\226\1\227\3\226\1\315\1\226\1\316"+
- "\6\226\1\317\16\226\1\315\2\226\1\315\2\226\1\315"+
- "\10\226\1\315\4\226\1\315\10\226\1\0\1\230\1\212"+
- "\1\213\3\0\1\212\1\214\11\0\3\212\1\0\1\212"+
- "\10\0\11\212\1\0\4\212\1\0\2\212\1\0\1\212"+
- "\1\0\4\212\4\0\1\216\1\0\1\320\2\231\1\0"+
- "\2\231\1\320\2\231\1\0\4\231\2\0\16\231\1\320"+
- "\2\231\1\320\2\231\1\320\10\231\1\320\4\231\1\320"+
- "\10\231\1\0\1\321\5\0\1\321\16\0\2\321\7\0"+
- "\2\321\1\0\2\321\1\0\2\321\7\0\2\321\3\0"+
- "\2\321\10\0\2\114\1\217\3\0\2\114\3\0\1\220"+
- "\5\0\2\114\1\322\1\221\1\114\10\0\11\114\1\0"+
- "\4\114\1\0\2\114\1\0\1\114\1\0\4\114\57\0"+
- "\1\323\22\0\1\324\1\25\1\132\1\25\1\0\1\25"+
- "\1\324\1\25\1\0\1\25\4\0\2\25\1\0\3\25"+
- "\1\0\1\25\10\0\1\324\2\25\1\324\2\25\1\324"+
- "\2\25\1\0\4\25\1\0\1\324\1\25\1\0\1\25"+
- "\1\0\1\324\3\25\6\0\1\325\1\135\1\136\1\135"+
- "\1\0\1\135\1\325\1\135\1\0\1\135\4\0\2\135"+
- "\1\0\3\135\1\0\1\135\10\0\1\325\2\135\1\325"+
- "\2\135\1\325\2\135\1\0\4\135\1\0\1\325\1\135"+
- "\1\0\1\135\1\0\1\325\3\135\6\0\1\326\1\137"+
- "\1\140\1\137\1\0\1\137\1\326\1\137\1\0\1\137"+
- "\4\0\2\137\1\0\3\137\1\0\1\137\10\0\1\326"+
- "\2\137\1\326\2\137\1\326\2\137\1\0\4\137\1\0"+
- "\1\326\1\137\1\0\1\137\1\0\1\326\3\137\15\0"+
- "\1\327\63\0\34\142\1\330\1\245\36\142\42\0\2\331"+
- "\103\0\1\332\76\0\2\333\75\0\1\334\77\0\1\335"+
- "\7\0\1\253\2\0\1\253\1\0\3\253\1\0\1\253"+
- "\1\336\1\0\1\253\1\0\2\253\1\0\3\253\1\0"+
- "\1\253\10\0\11\253\1\0\4\253\1\0\2\253\1\0"+
- "\1\253\1\0\4\253\6\0\1\337\1\150\1\151\1\150"+
- "\1\0\1\150\1\337\1\150\1\0\1\150\4\0\2\150"+
- "\1\0\3\150\1\253\1\150\10\0\1\337\2\150\1\337"+
- "\2\150\1\337\2\150\1\0\4\150\1\0\1\337\1\150"+
- "\1\0\1\150\1\0\1\337\3\150\6\0\1\340\1\153"+
- "\1\154\1\153\1\155\1\153\1\340\27\153\1\340\2\153"+
- "\1\340\2\153\1\340\10\153\1\340\4\153\1\340\10\153"+
- "\1\0\2\153\1\154\1\0\1\155\12\153\1\0\53\153"+
- "\1\0\1\341\1\156\1\157\3\156\1\341\1\156\1\155"+
- "\25\156\1\341\2\156\1\341\2\156\1\341\10\156\1\341"+
- "\4\156\1\341\10\156\1\0\2\156\1\157\1\0\4\156"+
- "\1\155\6\156\1\0\53\156\1\0\1\342\1\160\1\161"+
- "\1\160\1\162\1\160\1\342\27\160\1\342\2\160\1\342"+
- "\2\160\1\342\10\160\1\342\4\160\1\342\10\160\1\0"+
- "\2\160\1\161\1\0\1\162\12\160\1\0\53\160\1\0"+
- "\1\343\1\163\1\164\3\163\1\343\1\163\1\162\25\163"+
- "\1\343\2\163\1\343\2\163\1\343\10\163\1\343\4\163"+
- "\1\343\10\163\1\0\2\163\1\164\1\0\4\163\1\162"+
- "\6\163\1\0\53\163\25\0\1\344\47\0\1\345\1\51"+
- "\1\166\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\3\51\6\0"+
- "\1\346\1\55\1\170\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"+
- "\3\55\6\0\1\347\1\62\1\172\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\3\62\6\0\1\350\1\72\1\176\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\3\72\6\0\1\351\1\100"+
- "\1\200\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\3\100\6\0"+
- "\1\352\1\202\1\203\1\202\1\204\1\202\1\352\27\202"+
- "\1\352\2\202\1\352\2\202\1\352\10\202\1\352\4\202"+
- "\1\352\10\202\1\0\2\202\1\203\1\0\1\204\12\202"+
- "\1\0\53\202\1\0\1\353\1\205\1\206\3\205\1\353"+
- "\1\205\1\204\25\205\1\353\2\205\1\353\2\205\1\353"+
- "\10\205\1\353\4\205\1\353\10\205\1\0\2\205\1\206"+
- "\1\0\4\205\1\204\6\205\1\0\53\205\1\0\1\354"+
- "\1\105\1\207\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\3\105"+
- "\6\0\1\355\1\212\1\213\1\212\1\0\1\212\1\355"+
- "\1\212\1\0\1\212\4\0\2\212\1\0\3\212\1\0"+
- "\1\212\10\0\1\355\2\212\1\355\2\212\1\355\2\212"+
- "\1\0\4\212\1\0\1\355\1\212\1\0\1\212\1\0"+
- "\1\355\3\212\6\0\2\307\1\310\3\0\2\307\3\0"+
- "\1\220\5\0\3\307\1\0\1\307\10\0\11\307\1\0"+
- "\4\307\1\0\2\307\1\0\1\307\1\0\4\307\6\0"+
- "\1\356\2\307\1\0\2\307\1\356\2\307\1\0\4\307"+
- "\2\0\16\307\1\356\2\307\1\356\2\307\1\356\10\307"+
- "\1\356\4\307\1\356\10\307\1\0\1\357\1\114\1\217"+
- "\1\114\1\0\1\114\1\357\1\114\1\0\1\114\1\0"+
- "\1\220\2\0\2\114\1\0\3\114\1\221\1\114\10\0"+
- "\1\357\2\114\1\357\2\114\1\357\2\114\1\0\4\114"+
- "\1\0\1\357\1\114\1\0\1\114\1\0\1\357\3\114"+
- "\6\0\1\360\1\223\1\224\1\223\1\225\1\223\1\360"+
- "\27\223\1\360\2\223\1\360\2\223\1\360\10\223\1\360"+
- "\4\223\1\360\10\223\1\0\2\223\1\224\1\0\1\225"+
- "\12\223\1\0\53\223\1\0\1\361\1\226\1\227\3\226"+
- "\1\361\1\226\1\225\25\226\1\361\2\226\1\361\2\226"+
- "\1\361\10\226\1\361\4\226\1\361\10\226\1\0\2\226"+
- "\1\227\1\0\4\226\1\225\6\226\1\0\53\226\1\0"+
- "\1\362\1\231\1\232\1\231\1\0\1\231\1\362\1\231"+
- "\1\0\1\231\4\0\2\231\1\0\3\231\1\0\1\231"+
- "\10\0\1\362\2\231\1\362\2\231\1\362\2\231\1\0"+
- "\4\231\1\0\1\362\1\231\1\0\1\231\1\0\1\362"+
- "\3\231\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\10\0\2\114\1\217\3\0\2\114\3\0"+
- "\1\220\5\0\3\114\1\365\1\114\10\0\11\114\1\0"+
- "\4\114\1\0\2\114\1\0\1\114\1\0\4\114\60\0"+
- "\1\366\21\0\1\367\1\25\1\132\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\3\25\6\0\1\370\1\135\1\136\1\135"+
- "\1\0\1\135\1\370\1\135\1\0\1\135\4\0\2\135"+
- "\1\0\3\135\1\0\1\135\10\0\1\370\2\135\1\370"+
- "\2\135\1\370\2\135\1\0\4\135\1\0\1\370\1\135"+
- "\1\0\1\135\1\0\1\370\3\135\6\0\1\371\1\137"+
- "\1\140\1\137\1\0\1\137\1\371\1\137\1\0\1\137"+
- "\4\0\2\137\1\0\3\137\1\0\1\137\10\0\1\371"+
- "\2\137\1\371\2\137\1\371\2\137\1\0\4\137\1\0"+
- "\1\371\1\137\1\0\1\137\1\0\1\371\3\137\30\0"+
- "\1\372\124\0\1\373\70\0\1\374\67\0\2\375\74\0"+
- "\1\376\25\0\1\377\1\150\1\151\1\150\1\0\1\150"+
- "\1\377\1\150\1\0\1\150\4\0\2\150\1\0\3\150"+
- "\1\253\1\150\10\0\1\377\2\150\1\377\2\150\1\377"+
- "\2\150\1\0\4\150\1\0\1\377\1\150\1\0\1\150"+
- "\1\0\1\377\3\150\6\0\1\u0100\1\153\1\154\1\153"+
- "\1\155\1\153\1\u0100\27\153\1\u0100\2\153\1\u0100\2\153"+
- "\1\u0100\10\153\1\u0100\4\153\1\u0100\10\153\1\0\1\u0101"+
- "\1\156\1\157\3\156\1\u0101\1\156\1\155\25\156\1\u0101"+
- "\2\156\1\u0101\2\156\1\u0101\10\156\1\u0101\4\156\1\u0101"+
- "\10\156\1\0\1\u0102\1\160\1\161\1\160\1\162\1\160"+
- "\1\u0102\27\160\1\u0102\2\160\1\u0102\2\160\1\u0102\10\160"+
- "\1\u0102\4\160\1\u0102\10\160\1\0\1\u0103\1\163\1\164"+
- "\3\163\1\u0103\1\163\1\162\25\163\1\u0103\2\163\1\u0103"+
- "\2\163\1\u0103\10\163\1\u0103\4\163\1\u0103\10\163\1\0"+
- "\2\u0104\1\u0105\1\344\1\u0106\1\344\2\u0104\1\u0107\1\344"+
- "\1\u0108\3\u0104\2\344\4\u0104\1\0\46\u0104\1\0\1\u0109"+
- "\1\51\1\166\1\51\1\0\1\51\1\u0109\1\51\1\0"+
- "\1\51\4\0\2\51\1\0\3\51\1\0\1\51\10\0"+
- "\1\u0109\2\51\1\u0109\2\51\1\u0109\2\51\1\0\4\51"+
- "\1\0\1\u0109\1\51\1\0\1\51\1\0\1\u0109\3\51"+
- "\6\0\1\u010a\1\55\1\170\1\55\1\0\1\55\1\u010a"+
- "\1\55\1\0\1\55\4\0\2\55\1\0\3\55\1\0"+
- "\1\55\10\0\1\u010a\2\55\1\u010a\2\55\1\u010a\2\55"+
- "\1\0\4\55\1\0\1\u010a\1\55\1\0\1\55\1\0"+
- "\1\u010a\3\55\6\0\1\u010b\1\62\1\172\1\62\1\0"+
- "\1\62\1\u010b\1\62\1\0\1\62\4\0\2\62\1\0"+
- "\3\62\1\0\1\62\10\0\1\u010b\2\62\1\u010b\2\62"+
- "\1\u010b\2\62\1\0\4\62\1\0\1\u010b\1\62\1\0"+
- "\1\62\1\0\1\u010b\3\62\6\0\1\u010c\1\72\1\176"+
- "\1\72\1\0\1\72\1\u010c\1\72\1\0\1\72\4\0"+
- "\2\72\1\0\3\72\1\0\1\72\10\0\1\u010c\2\72"+
- "\1\u010c\2\72\1\u010c\2\72\1\0\4\72\1\0\1\u010c"+
- "\1\72\1\0\1\72\1\0\1\u010c\3\72\6\0\1\u010d"+
- "\1\100\1\200\1\100\1\0\1\100\1\u010d\1\100\1\0"+
- "\1\100\4\0\2\100\1\0\3\100\1\0\1\100\10\0"+
- "\1\u010d\2\100\1\u010d\2\100\1\u010d\2\100\1\0\4\100"+
- "\1\0\1\u010d\1\100\1\0\1\100\1\0\1\u010d\3\100"+
- "\6\0\1\u010e\1\202\1\203\1\202\1\204\1\202\1\u010e"+
- "\27\202\1\u010e\2\202\1\u010e\2\202\1\u010e\10\202\1\u010e"+
- "\4\202\1\u010e\10\202\1\0\1\u010f\1\205\1\206\3\205"+
- "\1\u010f\1\205\1\204\25\205\1\u010f\2\205\1\u010f\2\205"+
- "\1\u010f\10\205\1\u010f\4\205\1\u010f\10\205\1\0\1\u0110"+
- "\1\105\1\207\1\105\1\0\1\105\1\u0110\1\105\1\0"+
- "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0"+
- "\1\u0110\2\105\1\u0110\2\105\1\u0110\2\105\1\0\4\105"+
- "\1\0\1\u0110\1\105\1\0\1\105\1\0\1\u0110\3\105"+
- "\6\0\1\u0111\1\212\1\213\1\212\1\0\1\212\1\u0111"+
- "\1\212\1\0\1\212\4\0\2\212\1\0\3\212\1\0"+
- "\1\212\10\0\1\u0111\2\212\1\u0111\2\212\1\u0111\2\212"+
- "\1\0\4\212\1\0\1\u0111\1\212\1\0\1\212\1\0"+
- "\1\u0111\3\212\6\0\1\u0112\1\307\1\310\1\307\1\0"+
- "\1\307\1\u0112\1\307\1\0\1\307\1\0\1\220\2\0"+
- "\2\307\1\0\3\307\1\0\1\307\10\0\1\u0112\2\307"+
- "\1\u0112\2\307\1\u0112\2\307\1\0\4\307\1\0\1\u0112"+
- "\1\307\1\0\1\307\1\0\1\u0112\3\307\6\0\1\u0113"+
- "\1\114\1\217\1\114\1\0\1\114\1\u0113\1\114\1\0"+
- "\1\114\1\0\1\220\2\0\2\114\1\0\3\114\1\221"+
- "\1\114\10\0\1\u0113\2\114\1\u0113\2\114\1\u0113\2\114"+
- "\1\0\4\114\1\0\1\u0113\1\114\1\0\1\114\1\0"+
- "\1\u0113\3\114\6\0\1\u0114\1\223\1\224\1\223\1\225"+
- "\1\223\1\u0114\27\223\1\u0114\2\223\1\u0114\2\223\1\u0114"+
- "\10\223\1\u0114\4\223\1\u0114\10\223\1\0\1\u0115\1\226"+
- "\1\227\3\226\1\u0115\1\226\1\225\25\226\1\u0115\2\226"+
- "\1\u0115\2\226\1\u0115\10\226\1\u0115\4\226\1\u0115\10\226"+
- "\1\0\1\u0116\1\231\1\232\1\231\1\0\1\231\1\u0116"+
- "\1\231\1\0\1\231\4\0\2\231\1\0\3\231\1\0"+
- "\1\231\10\0\1\u0116\2\231\1\u0116\2\231\1\u0116\2\231"+
- "\1\0\4\231\1\0\1\u0116\1\231\1\0\1\231\1\0"+
- "\1\u0116\3\231\6\0\1\u0117\5\0\1\u0117\1\364\15\0"+
- "\2\u0117\7\0\2\u0117\1\0\2\u0117\1\0\2\u0117\7\0"+
- "\2\u0117\3\0\2\u0117\10\0\1\u0118\5\0\1\u0118\16\0"+
- "\2\u0118\7\0\2\u0118\1\0\2\u0118\1\0\2\u0118\7\0"+
- "\2\u0118\3\0\2\u0118\10\0\2\u0119\1\u011a\1\u011b\1\u011c"+
- "\1\u011b\2\u0119\1\u011d\1\u011b\1\u011e\3\u0119\2\u011b\4\u0119"+
- "\1\0\46\u0119\54\0\1\u011f\20\0\1\u0120\1\25\1\132"+
- "\1\25\1\0\1\25\1\u0120\1\25\1\0\1\25\4\0"+
- "\2\25\1\0\3\25\1\0\1\25\10\0\1\u0120\2\25"+
- "\1\u0120\2\25\1\u0120\2\25\1\0\4\25\1\0\1\u0120"+
- "\1\25\1\0\1\25\1\0\1\u0120\3\25\6\0\1\u0121"+
- "\1\135\1\136\1\135\1\0\1\135\1\u0121\1\135\1\0"+
- "\1\135\4\0\2\135\1\0\3\135\1\0\1\135\10\0"+
- "\1\u0121\2\135\1\u0121\2\135\1\u0121\2\135\1\0\4\135"+
- "\1\0\1\u0121\1\135\1\0\1\135\1\0\1\u0121\3\135"+
- "\6\0\1\u0122\1\137\1\140\1\137\1\0\1\137\1\u0122"+
- "\1\137\1\0\1\137\4\0\2\137\1\0\3\137\1\0"+
- "\1\137\10\0\1\u0122\2\137\1\u0122\2\137\1\u0122\2\137"+
- "\1\0\4\137\1\0\1\u0122\1\137\1\0\1\137\1\0"+
- "\1\u0122\3\137\51\0\1\u0123\52\0\1\u0124\112\0\2\u0125"+
- "\40\0\1\u0126\64\0\1\u0127\1\150\1\151\1\150\1\0"+
- "\1\150\1\u0127\1\150\1\0\1\150\4\0\2\150\1\0"+
- "\3\150\1\253\1\150\10\0\1\u0127\2\150\1\u0127\2\150"+
- "\1\u0127\2\150\1\0\4\150\1\0\1\u0127\1\150\1\0"+
- "\1\150\1\0\1\u0127\3\150\6\0\1\u0128\1\153\1\154"+
- "\1\153\1\155\1\153\1\u0128\27\153\1\u0128\2\153\1\u0128"+
- "\2\153\1\u0128\10\153\1\u0128\4\153\1\u0128\10\153\1\0"+
- "\1\u0129\1\156\1\157\3\156\1\u0129\1\156\1\155\25\156"+
- "\1\u0129\2\156\1\u0129\2\156\1\u0129\10\156\1\u0129\4\156"+
- "\1\u0129\10\156\1\0\1\u012a\1\160\1\161\1\160\1\162"+
- "\1\160\1\u012a\27\160\1\u012a\2\160\1\u012a\2\160\1\u012a"+
- "\10\160\1\u012a\4\160\1\u012a\10\160\1\0\1\u012b\1\163"+
- "\1\164\3\163\1\u012b\1\163\1\162\25\163\1\u012b\2\163"+
- "\1\u012b\2\163\1\u012b\10\163\1\u012b\4\163\1\u012b\10\163"+
- "\1\0\2\u0104\1\u0105\1\u012c\1\0\3\u0104\1\0\1\u012c"+
- "\1\u0108\3\u0104\2\u012c\4\u0104\1\0\46\u0104\1\0\1\u012d"+
- "\1\u0104\1\u0105\1\u012c\2\u0104\1\u012d\2\u0104\1\u012c\1\u012e"+
- "\3\u0104\2\u012c\16\u0104\1\u012d\2\u0104\1\u012d\2\u0104\1\u012d"+
- "\10\u0104\1\u012d\4\u0104\1\u012d\10\u0104\1\0\2\u0106\1\u012f"+
- "\1\0\1\u012c\11\u0106\2\0\53\u0106\1\0\2\u0107\1\u0130"+
- "\1\0\4\u0107\1\u012c\5\u0107\2\0\53\u0107\1\0\1\u0131"+
- "\1\51\1\166\1\51\1\0\1\51\1\u0131\1\51\1\0"+
- "\1\51\4\0\2\51\1\0\3\51\1\0\1\51\10\0"+
- "\1\u0131\2\51\1\u0131\2\51\1\u0131\2\51\1\0\4\51"+
- "\1\0\1\u0131\1\51\1\0\1\51\1\0\1\u0131\3\51"+
- "\6\0\1\u0132\1\55\1\170\1\55\1\0\1\55\1\u0132"+
- "\1\55\1\0\1\55\4\0\2\55\1\0\3\55\1\0"+
- "\1\55\10\0\1\u0132\2\55\1\u0132\2\55\1\u0132\2\55"+
- "\1\0\4\55\1\0\1\u0132\1\55\1\0\1\55\1\0"+
- "\1\u0132\3\55\6\0\1\u0133\1\62\1\172\1\62\1\0"+
- "\1\62\1\u0133\1\62\1\0\1\62\4\0\2\62\1\0"+
- "\3\62\1\0\1\62\10\0\1\u0133\2\62\1\u0133\2\62"+
- "\1\u0133\2\62\1\0\4\62\1\0\1\u0133\1\62\1\0"+
- "\1\62\1\0\1\u0133\3\62\6\0\1\u0134\1\72\1\176"+
- "\1\72\1\0\1\72\1\u0134\1\72\1\0\1\72\4\0"+
- "\2\72\1\0\3\72\1\0\1\72\10\0\1\u0134\2\72"+
- "\1\u0134\2\72\1\u0134\2\72\1\0\4\72\1\0\1\u0134"+
- "\1\72\1\0\1\72\1\0\1\u0134\3\72\6\0\1\u0135"+
- "\1\100\1\200\1\100\1\0\1\100\1\u0135\1\100\1\0"+
- "\1\100\4\0\2\100\1\0\3\100\1\0\1\100\10\0"+
- "\1\u0135\2\100\1\u0135\2\100\1\u0135\2\100\1\0\4\100"+
- "\1\0\1\u0135\1\100\1\0\1\100\1\0\1\u0135\3\100"+
- "\6\0\1\u0136\1\202\1\203\1\202\1\204\1\202\1\u0136"+
- "\27\202\1\u0136\2\202\1\u0136\2\202\1\u0136\10\202\1\u0136"+
- "\4\202\1\u0136\10\202\1\0\1\u0137\1\205\1\206\3\205"+
- "\1\u0137\1\205\1\204\25\205\1\u0137\2\205\1\u0137\2\205"+
- "\1\u0137\10\205\1\u0137\4\205\1\u0137\10\205\1\0\1\u0138"+
- "\1\105\1\207\1\105\1\0\1\105\1\u0138\1\105\1\0"+
- "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0"+
- "\1\u0138\2\105\1\u0138\2\105\1\u0138\2\105\1\0\4\105"+
- "\1\0\1\u0138\1\105\1\0\1\105\1\0\1\u0138\3\105"+
- "\6\0\1\u0139\1\212\1\213\1\212\1\0\1\212\1\u0139"+
- "\1\212\1\0\1\212\4\0\2\212\1\0\3\212\1\0"+
- "\1\212\10\0\1\u0139\2\212\1\u0139\2\212\1\u0139\2\212"+
- "\1\0\4\212\1\0\1\u0139\1\212\1\0\1\212\1\0"+
- "\1\u0139\3\212\6\0\1\u013a\1\307\1\310\1\307\1\0"+
- "\1\307\1\u013a\1\307\1\0\1\307\1\0\1\220\2\0"+
- "\2\307\1\0\3\307\1\0\1\307\10\0\1\u013a\2\307"+
- "\1\u013a\2\307\1\u013a\2\307\1\0\4\307\1\0\1\u013a"+
- "\1\307\1\0\1\307\1\0\1\u013a\3\307\6\0\1\u013b"+
- "\1\114\1\217\1\114\1\0\1\114\1\u013b\1\114\1\0"+
- "\1\114\1\0\1\220\2\0\2\114\1\0\3\114\1\221"+
- "\1\114\10\0\1\u013b\2\114\1\u013b\2\114\1\u013b\2\114"+
- "\1\0\4\114\1\0\1\u013b\1\114\1\0\1\114\1\0"+
- "\1\u013b\3\114\6\0\1\u013c\1\223\1\224\1\223\1\225"+
- "\1\223\1\u013c\27\223\1\u013c\2\223\1\u013c\2\223\1\u013c"+
- "\10\223\1\u013c\4\223\1\u013c\10\223\1\0\1\u013d\1\226"+
- "\1\227\3\226\1\u013d\1\226\1\225\25\226\1\u013d\2\226"+
- "\1\u013d\2\226\1\u013d\10\226\1\u013d\4\226\1\u013d\10\226"+
- "\1\0\1\u013e\1\231\1\232\1\231\1\0\1\231\1\u013e"+
- "\1\231\1\0\1\231\4\0\2\231\1\0\3\231\1\0"+
- "\1\231\10\0\1\u013e\2\231\1\u013e\2\231\1\u013e\2\231"+
- "\1\0\4\231\1\0\1\u013e\1\231\1\0\1\231\1\0"+
- "\1\u013e\3\231\6\0\1\u013f\5\0\1\u013f\1\364\15\0"+
- "\2\u013f\7\0\2\u013f\1\0\2\u013f\1\0\2\u013f\7\0"+
- "\2\u013f\3\0\2\u013f\10\0\1\u0140\5\0\1\u0140\16\0"+
- "\2\u0140\7\0\2\u0140\1\0\2\u0140\1\0\2\u0140\7\0"+
- "\2\u0140\3\0\2\u0140\10\0\2\u0119\1\u011a\1\u0141\1\0"+
- "\3\u0119\1\0\1\u0141\1\u011e\3\u0119\2\u0141\4\u0119\1\0"+
- "\46\u0119\1\0\1\u0142\1\u0119\1\u011a\1\u0141\2\u0119\1\u0142"+
- "\2\u0119\1\u0141\1\u0143\3\u0119\2\u0141\16\u0119\1\u0142\2\u0119"+
- "\1\u0142\2\u0119\1\u0142\10\u0119\1\u0142\4\u0119\1\u0142\10\u0119"+
- "\1\0\2\u011c\1\u0144\1\0\1\u0141\11\u011c\2\0\53\u011c"+
- "\1\0\2\u011d\1\u0145\1\0\4\u011d\1\u0141\5\u011d\2\0"+
- "\53\u011d\23\0\1\u0146\51\0\1\u0147\1\25\1\132\1\25"+
- "\1\0\1\25\1\u0147\1\25\1\0\1\25\4\0\2\25"+
- "\1\0\3\25\1\0\1\25\10\0\1\u0147\2\25\1\u0147"+
- "\2\25\1\u0147\2\25\1\0\4\25\1\0\1\u0147\1\25"+
- "\1\0\1\25\1\0\1\u0147\3\25\6\0\1\u0148\1\135"+
- "\1\136\1\135\1\0\1\135\1\u0148\1\135\1\0\1\135"+
- "\4\0\2\135\1\0\3\135\1\0\1\135\10\0\1\u0148"+
- "\2\135\1\u0148\2\135\1\u0148\2\135\1\0\4\135\1\0"+
- "\1\u0148\1\135\1\0\1\135\1\0\1\u0148\3\135\6\0"+
- "\1\u0149\1\137\1\140\1\137\1\0\1\137\1\u0149\1\137"+
- "\1\0\1\137\4\0\2\137\1\0\3\137\1\0\1\137"+
- "\10\0\1\u0149\2\137\1\u0149\2\137\1\u0149\2\137\1\0"+
- "\4\137\1\0\1\u0149\1\137\1\0\1\137\1\0\1\u0149"+
- "\3\137\52\0\2\u014a\74\0\1\u014b\107\0\2\u014c\10\0"+
- "\1\u014d\1\150\1\151\1\150\1\0\1\150\1\u014d\1\150"+
- "\1\0\1\150\4\0\2\150\1\0\3\150\1\253\1\150"+
- "\10\0\1\u014d\2\150\1\u014d\2\150\1\u014d\2\150\1\0"+
- "\4\150\1\0\1\u014d\1\150\1\0\1\150\1\0\1\u014d"+
- "\3\150\6\0\1\u014e\1\153\1\154\1\153\1\155\1\153"+
- "\1\u014e\27\153\1\u014e\2\153\1\u014e\2\153\1\u014e\10\153"+
- "\1\u014e\4\153\1\u014e\10\153\1\0\1\u014f\1\156\1\157"+
- "\3\156\1\u014f\1\156\1\155\25\156\1\u014f\2\156\1\u014f"+
- "\2\156\1\u014f\10\156\1\u014f\4\156\1\u014f\10\156\1\0"+
- "\1\u0150\1\160\1\161\1\160\1\162\1\160\1\u0150\27\160"+
- "\1\u0150\2\160\1\u0150\2\160\1\u0150\10\160\1\u0150\4\160"+
- "\1\u0150\10\160\1\0\1\u0151\1\163\1\164\3\163\1\u0151"+
- "\1\163\1\162\25\163\1\u0151\2\163\1\u0151\2\163\1\u0151"+
- "\10\163\1\u0151\4\163\1\u0151\10\163\4\0\1\u012c\1\0"+
- "\1\u012c\3\0\1\u012c\1\u0108\3\0\2\u012c\54\0\1\u0152"+
- "\1\u0104\1\u0105\1\u0104\1\0\1\u0104\1\u0152\1\u0104\1\0"+
- "\1\u0104\1\u0108\11\u0104\1\0\11\u0104\1\u0152\2\u0104\1\u0152"+
- "\2\u0104\1\u0152\10\u0104\1\u0152\4\u0104\1\u0152\10\u0104\1\0"+
- "\1\u0153\1\u0106\1\u012f\1\u0106\1\u0154\1\u0106\1\u0153\10\u0106"+
- "\1\u0155\16\u0106\1\u0153\2\u0106\1\u0153\2\u0106\1\u0153\10\u0106"+
- "\1\u0153\4\u0106\1\u0153\10\u0106\1\0\1\u0156\1\u0107\1\u0130"+
- "\3\u0107\1\u0156\1\u0107\1\u0157\6\u0107\1\u0158\16\u0107\1\u0156"+
- "\2\u0107\1\u0156\2\u0107\1\u0156\10\u0107\1\u0156\4\u0107\1\u0156"+
- "\10\u0107\1\0\1\u0159\1\51\1\166\1\51\1\0\1\51"+
- "\1\u0159\1\51\1\0\1\51\4\0\2\51\1\0\3\51"+
- "\1\0\1\51\10\0\1\u0159\2\51\1\u0159\2\51\1\u0159"+
- "\2\51\1\0\4\51\1\0\1\u0159\1\51\1\0\1\51"+
- "\1\0\1\u0159\3\51\6\0\1\u015a\1\55\1\170\1\55"+
- "\1\0\1\55\1\u015a\1\55\1\0\1\55\4\0\2\55"+
- "\1\0\3\55\1\0\1\55\10\0\1\u015a\2\55\1\u015a"+
- "\2\55\1\u015a\2\55\1\0\4\55\1\0\1\u015a\1\55"+
- "\1\0\1\55\1\0\1\u015a\3\55\6\0\1\u015b\1\62"+
- "\1\172\1\62\1\0\1\62\1\u015b\1\62\1\0\1\62"+
- "\4\0\2\62\1\0\3\62\1\0\1\62\10\0\1\u015b"+
- "\2\62\1\u015b\2\62\1\u015b\2\62\1\0\4\62\1\0"+
- "\1\u015b\1\62\1\0\1\62\1\0\1\u015b\3\62\6\0"+
- "\1\u015c\1\72\1\176\1\72\1\0\1\72\1\u015c\1\72"+
- "\1\0\1\72\4\0\2\72\1\0\3\72\1\0\1\72"+
- "\10\0\1\u015c\2\72\1\u015c\2\72\1\u015c\2\72\1\0"+
- "\4\72\1\0\1\u015c\1\72\1\0\1\72\1\0\1\u015c"+
- "\3\72\6\0\1\u015d\1\100\1\200\1\100\1\0\1\100"+
- "\1\u015d\1\100\1\0\1\100\4\0\2\100\1\0\3\100"+
- "\1\0\1\100\10\0\1\u015d\2\100\1\u015d\2\100\1\u015d"+
- "\2\100\1\0\4\100\1\0\1\u015d\1\100\1\0\1\100"+
- "\1\0\1\u015d\3\100\6\0\1\u015e\1\202\1\203\1\202"+
- "\1\204\1\202\1\u015e\27\202\1\u015e\2\202\1\u015e\2\202"+
- "\1\u015e\10\202\1\u015e\4\202\1\u015e\10\202\1\0\1\u015f"+
- "\1\205\1\206\3\205\1\u015f\1\205\1\204\25\205\1\u015f"+
- "\2\205\1\u015f\2\205\1\u015f\10\205\1\u015f\4\205\1\u015f"+
- "\10\205\1\0\1\u0160\1\105\1\207\1\105\1\0\1\105"+
- "\1\u0160\1\105\1\0\1\105\4\0\2\105\1\0\3\105"+
- "\1\0\1\105\10\0\1\u0160\2\105\1\u0160\2\105\1\u0160"+
- "\2\105\1\0\4\105\1\0\1\u0160\1\105\1\0\1\105"+
- "\1\0\1\u0160\3\105\6\0\1\u0161\1\212\1\213\1\212"+
- "\1\0\1\212\1\u0161\1\212\1\0\1\212\4\0\2\212"+
- "\1\0\3\212\1\0\1\212\10\0\1\u0161\2\212\1\u0161"+
- "\2\212\1\u0161\2\212\1\0\4\212\1\0\1\u0161\1\212"+
- "\1\0\1\212\1\0\1\u0161\3\212\6\0\1\u0162\1\307"+
- "\1\310\1\307\1\0\1\307\1\u0162\1\307\1\0\1\307"+
- "\1\0\1\220\2\0\2\307\1\0\3\307\1\0\1\307"+
- "\10\0\1\u0162\2\307\1\u0162\2\307\1\u0162\2\307\1\0"+
- "\4\307\1\0\1\u0162\1\307\1\0\1\307\1\0\1\u0162"+
- "\3\307\6\0\1\u0163\1\114\1\217\1\114\1\0\1\114"+
- "\1\u0163\1\114\1\0\1\114\1\0\1\220\2\0\2\114"+
- "\1\0\3\114\1\221\1\114\10\0\1\u0163\2\114\1\u0163"+
- "\2\114\1\u0163\2\114\1\0\4\114\1\0\1\u0163\1\114"+
- "\1\0\1\114\1\0\1\u0163\3\114\6\0\1\u0164\1\223"+
- "\1\224\1\223\1\225\1\223\1\u0164\27\223\1\u0164\2\223"+
- "\1\u0164\2\223\1\u0164\10\223\1\u0164\4\223\1\u0164\10\223"+
- "\1\0\1\u0165\1\226\1\227\3\226\1\u0165\1\226\1\225"+
- "\25\226\1\u0165\2\226\1\u0165\2\226\1\u0165\10\226\1\u0165"+
- "\4\226\1\u0165\10\226\1\0\1\u0166\1\231\1\232\1\231"+
- "\1\0\1\231\1\u0166\1\231\1\0\1\231\4\0\2\231"+
- "\1\0\3\231\1\0\1\231\10\0\1\u0166\2\231\1\u0166"+
- "\2\231\1\u0166\2\231\1\0\4\231\1\0\1\u0166\1\231"+
- "\1\0\1\231\1\0\1\u0166\3\231\6\0\1\u0167\5\0"+
- "\1\u0167\1\364\15\0\2\u0167\7\0\2\u0167\1\0\2\u0167"+
- "\1\0\2\u0167\7\0\2\u0167\3\0\2\u0167\10\0\1\u0168"+
- "\5\0\1\u0168\16\0\2\u0168\7\0\2\u0168\1\0\2\u0168"+
- "\1\0\2\u0168\7\0\2\u0168\3\0\2\u0168\13\0\1\u0141"+
- "\1\0\1\u0141\3\0\1\u0141\1\u011e\3\0\2\u0141\54\0"+
- "\1\u0169\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u0169\1\u0119"+
- "\1\0\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u0169\2\u0119"+
- "\1\u0169\2\u0119\1\u0169\10\u0119\1\u0169\4\u0119\1\u0169\10\u0119"+
- "\1\0\1\u016a\1\u011c\1\u0144\1\u011c\1\u016b\1\u011c\1\u016a"+
- "\10\u011c\1\u016c\16\u011c\1\u016a\2\u011c\1\u016a\2\u011c\1\u016a"+
- "\10\u011c\1\u016a\4\u011c\1\u016a\10\u011c\1\0\1\u016d\1\u011d"+
- "\1\u0145\3\u011d\1\u016d\1\u011d\1\u016e\6\u011d\1\u016f\16\u011d"+
- "\1\u016d\2\u011d\1\u016d\2\u011d\1\u016d\10\u011d\1\u016d\4\u011d"+
- "\1\u016d\10\u011d\47\0\1\u0170\25\0\2\25\1\132\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\4\25\6\0\1\u0171\1\135\1\136"+
- "\1\135\1\0\1\135\1\u0171\1\135\1\0\1\135\4\0"+
- "\2\135\1\0\3\135\1\0\1\135\10\0\1\u0171\2\135"+
- "\1\u0171\2\135\1\u0171\2\135\1\0\4\135\1\0\1\u0171"+
- "\1\135\1\0\1\135\1\0\1\u0171\3\135\6\0\1\u0172"+
- "\1\137\1\140\1\137\1\0\1\137\1\u0172\1\137\1\0"+
- "\1\137\4\0\2\137\1\0\3\137\1\0\1\137\10\0"+
- "\1\u0172\2\137\1\u0172\2\137\1\u0172\2\137\1\0\4\137"+
- "\1\0\1\u0172\1\137\1\0\1\137\1\0\1\u0172\3\137"+
- "\54\0\1\u0173\66\0\2\u0174\31\0\1\u0175\1\150\1\151"+
- "\1\150\1\0\1\150\1\u0175\1\150\1\0\1\150\4\0"+
- "\2\150\1\0\3\150\1\253\1\150\10\0\1\u0175\2\150"+
- "\1\u0175\2\150\1\u0175\2\150\1\0\4\150\1\0\1\u0175"+
- "\1\150\1\0\1\150\1\0\1\u0175\3\150\6\0\1\u0176"+
- "\1\153\1\154\1\153\1\155\1\153\1\u0176\27\153\1\u0176"+
- "\2\153\1\u0176\2\153\1\u0176\10\153\1\u0176\4\153\1\u0176"+
- "\10\153\1\0\1\u0177\1\156\1\157\3\156\1\u0177\1\156"+
- "\1\155\25\156\1\u0177\2\156\1\u0177\2\156\1\u0177\10\156"+
- "\1\u0177\4\156\1\u0177\10\156\1\0\1\u0178\1\160\1\161"+
- "\1\160\1\162\1\160\1\u0178\27\160\1\u0178\2\160\1\u0178"+
- "\2\160\1\u0178\10\160\1\u0178\4\160\1\u0178\10\160\1\0"+
- "\1\u0179\1\163\1\164\3\163\1\u0179\1\163\1\162\25\163"+
- "\1\u0179\2\163\1\u0179\2\163\1\u0179\10\163\1\u0179\4\163"+
- "\1\u0179\10\163\1\0\1\u017a\1\u0104\1\u0105\1\u0104\1\0"+
- "\1\u0104\1\u017a\1\u0104\1\0\1\u0104\1\u0108\11\u0104\1\0"+
- "\11\u0104\1\u017a\2\u0104\1\u017a\2\u0104\1\u017a\10\u0104\1\u017a"+
- "\4\u0104\1\u017a\10\u0104\1\0\1\u017b\1\u0106\1\u012f\1\u0106"+
- "\1\u012c\1\u0106\1\u017b\27\u0106\1\u017b\2\u0106\1\u017b\2\u0106"+
- "\1\u017b\10\u0106\1\u017b\4\u0106\1\u017b\10\u0106\1\0\2\u0106"+
- "\1\u012f\2\u012c\1\u0154\3\u0106\1\u0154\1\u017c\3\u0106\2\u012c"+
- "\53\u0106\1\0\2\u0106\1\u012f\1\0\1\u012c\12\u0106\1\0"+
- "\53\u0106\1\0\1\u017d\1\u0107\1\u0130\3\u0107\1\u017d\1\u0107"+
- "\1\u012c\25\u0107\1\u017d\2\u0107\1\u017d\2\u0107\1\u017d\10\u0107"+
- "\1\u017d\4\u0107\1\u017d\10\u0107\1\0\2\u0107\1\u0130\1\u012c"+
- "\1\u0107\1\u0157\2\u0107\1\u012c\1\u0157\1\u017e\3\u0107\2\u012c"+
- "\53\u0107\1\0\2\u0107\1\u0130\1\0\4\u0107\1\u012c\6\u0107"+
- "\1\0\53\u0107\1\0\2\51\1\166\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\4\51\6\0\2\55\1\170\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\4\55\6\0\2\62\1\172\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\4\62\6\0\2\72\1\176\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\4\72\6\0\2\100\1\200\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\4\100\6\0\1\u017f\1\202\1\203\1\202\1\204"+
- "\1\202\1\u017f\27\202\1\u017f\2\202\1\u017f\2\202\1\u017f"+
- "\10\202\1\u017f\4\202\1\u017f\10\202\1\0\1\u0180\1\205"+
- "\1\206\3\205\1\u0180\1\205\1\204\25\205\1\u0180\2\205"+
- "\1\u0180\2\205\1\u0180\10\205\1\u0180\4\205\1\u0180\10\205"+
- "\1\0\2\105\1\207\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\4\105"+
- "\6\0\1\u0181\1\212\1\213\1\212\1\0\1\212\1\u0181"+
- "\1\212\1\0\1\212\4\0\2\212\1\0\3\212\1\0"+
- "\1\212\10\0\1\u0181\2\212\1\u0181\2\212\1\u0181\2\212"+
- "\1\0\4\212\1\0\1\u0181\1\212\1\0\1\212\1\0"+
- "\1\u0181\3\212\6\0\1\u0182\1\307\1\310\1\307\1\0"+
- "\1\307\1\u0182\1\307\1\0\1\307\1\0\1\220\2\0"+
- "\2\307\1\0\3\307\1\0\1\307\10\0\1\u0182\2\307"+
- "\1\u0182\2\307\1\u0182\2\307\1\0\4\307\1\0\1\u0182"+
- "\1\307\1\0\1\307\1\0\1\u0182\3\307\6\0\2\114"+
- "\1\217\1\114\1\0\3\114\1\0\1\114\1\0\1\220"+
- "\2\0\2\114\1\0\3\114\1\221\1\114\10\0\11\114"+
- "\1\0\4\114\1\0\2\114\1\0\1\114\1\0\4\114"+
- "\6\0\1\u0183\1\223\1\224\1\223\1\225\1\223\1\u0183"+
- "\27\223\1\u0183\2\223\1\u0183\2\223\1\u0183\10\223\1\u0183"+
- "\4\223\1\u0183\10\223\1\0\1\u0184\1\226\1\227\3\226"+
- "\1\u0184\1\226\1\225\25\226\1\u0184\2\226\1\u0184\2\226"+
- "\1\u0184\10\226\1\u0184\4\226\1\u0184\10\226\1\0\1\u0185"+
- "\1\231\1\232\1\231\1\0\1\231\1\u0185\1\231\1\0"+
- "\1\231\4\0\2\231\1\0\3\231\1\0\1\231\10\0"+
- "\1\u0185\2\231\1\u0185\2\231\1\u0185\2\231\1\0\4\231"+
- "\1\0\1\u0185\1\231\1\0\1\231\1\0\1\u0185\3\231"+
- "\6\0\1\u0186\5\0\1\u0186\1\364\15\0\2\u0186\7\0"+
- "\2\u0186\1\0\2\u0186\1\0\2\u0186\7\0\2\u0186\3\0"+
- "\2\u0186\10\0\1\u0187\5\0\1\u0187\16\0\2\u0187\7\0"+
- "\2\u0187\1\0\2\u0187\1\0\2\u0187\7\0\2\u0187\3\0"+
- "\2\u0187\10\0\1\u0188\1\u0119\1\u011a\1\u0119\1\0\1\u0119"+
- "\1\u0188\1\u0119\1\0\1\u0119\1\u011e\11\u0119\1\0\11\u0119"+
- "\1\u0188\2\u0119\1\u0188\2\u0119\1\u0188\10\u0119\1\u0188\4\u0119"+
- "\1\u0188\10\u0119\1\0\1\u0189\1\u011c\1\u0144\1\u011c\1\u0141"+
- "\1\u011c\1\u0189\27\u011c\1\u0189\2\u011c\1\u0189\2\u011c\1\u0189"+
- "\10\u011c\1\u0189\4\u011c\1\u0189\10\u011c\1\0\2\u011c\1\u0144"+
- "\2\u0141\1\u016b\3\u011c\1\u016b\1\u018a\3\u011c\2\u0141\53\u011c"+
- "\1\0\2\u011c\1\u0144\1\0\1\u0141\12\u011c\1\0\53\u011c"+
- "\1\0\1\u018b\1\u011d\1\u0145\3\u011d\1\u018b\1\u011d\1\u0141"+
- "\25\u011d\1\u018b\2\u011d\1\u018b\2\u011d\1\u018b\10\u011d\1\u018b"+
- "\4\u011d\1\u018b\10\u011d\1\0\2\u011d\1\u0145\1\u0141\1\u011d"+
- "\1\u016e\2\u011d\1\u0141\1\u016e\1\u018c\3\u011d\2\u0141\53\u011d"+
- "\1\0\2\u011d\1\u0145\1\0\4\u011d\1\u0141\6\u011d\1\0"+
- "\53\u011d\42\0\2\u018d\31\0\2\135\1\136\1\135\1\0"+
- "\3\135\1\0\1\135\4\0\2\135\1\0\3\135\1\0"+
- "\1\135\10\0\11\135\1\0\4\135\1\0\2\135\1\0"+
- "\1\135\1\0\4\135\6\0\2\137\1\140\1\137\1\0"+
- "\3\137\1\0\1\137\4\0\2\137\1\0\3\137\1\0"+
- "\1\137\10\0\11\137\1\0\4\137\1\0\2\137\1\0"+
- "\1\137\1\0\4\137\44\0\2\u018e\34\0\2\150\1\151"+
- "\1\150\1\0\3\150\1\0\1\150\4\0\2\150\1\0"+
- "\3\150\1\253\1\150\10\0\11\150\1\0\4\150\1\0"+
- "\2\150\1\0\1\150\1\0\4\150\6\0\2\153\1\154"+
- "\1\153\1\155\66\153\1\0\2\156\1\157\5\156\1\155"+
- "\62\156\1\0\2\160\1\161\1\160\1\162\66\160\1\0"+
- "\2\163\1\164\5\163\1\162\62\163\1\0\1\u018f\1\u0104"+
- "\1\u0105\1\u0104\1\0\1\u0104\1\u018f\1\u0104\1\0\1\u0104"+
- "\1\u0108\11\u0104\1\0\11\u0104\1\u018f\2\u0104\1\u018f\2\u0104"+
- "\1\u018f\10\u0104\1\u018f\4\u0104\1\u018f\10\u0104\1\0\1\u0190"+
- "\1\u0106\1\u012f\1\u0106\1\u012c\1\u0106\1\u0190\27\u0106\1\u0190"+
- "\2\u0106\1\u0190\2\u0106\1\u0190\10\u0106\1\u0190\4\u0106\1\u0190"+
- "\10\u0106\1\0\1\u0191\1\u0107\1\u0130\3\u0107\1\u0191\1\u0107"+
- "\1\u012c\25\u0107\1\u0191\2\u0107\1\u0191\2\u0107\1\u0191\10\u0107"+
- "\1\u0191\4\u0107\1\u0191\10\u0107\1\0\2\202\1\203\1\202"+
- "\1\204\66\202\1\0\2\205\1\206\5\205\1\204\62\205"+
- "\1\0\2\212\1\213\1\212\1\0\3\212\1\0\1\212"+
- "\4\0\2\212\1\0\3\212\1\0\1\212\10\0\11\212"+
- "\1\0\4\212\1\0\2\212\1\0\1\212\1\0\4\212"+
- "\6\0\1\u0192\1\307\1\310\1\307\1\0\1\307\1\u0192"+
- "\1\307\1\0\1\307\1\0\1\220\2\0\2\307\1\0"+
- "\3\307\1\0\1\307\10\0\1\u0192\2\307\1\u0192\2\307"+
- "\1\u0192\2\307\1\0\4\307\1\0\1\u0192\1\307\1\0"+
- "\1\307\1\0\1\u0192\3\307\6\0\2\223\1\224\1\223"+
- "\1\225\66\223\1\0\2\226\1\227\5\226\1\225\62\226"+
- "\1\0\2\231\1\232\1\231\1\0\3\231\1\0\1\231"+
- "\4\0\2\231\1\0\3\231\1\0\1\231\10\0\11\231"+
- "\1\0\4\231\1\0\2\231\1\0\1\231\1\0\4\231"+
- "\15\0\1\364\64\0\1\u0193\5\0\1\u0193\16\0\2\u0193"+
- "\7\0\2\u0193\1\0\2\u0193\1\0\2\u0193\7\0\2\u0193"+
- "\3\0\2\u0193\10\0\1\u0194\1\u0119\1\u011a\1\u0119\1\0"+
- "\1\u0119\1\u0194\1\u0119\1\0\1\u0119\1\u011e\11\u0119\1\0"+
- "\11\u0119\1\u0194\2\u0119\1\u0194\2\u0119\1\u0194\10\u0119\1\u0194"+
- "\4\u0119\1\u0194\10\u0119\1\0\1\u0195\1\u011c\1\u0144\1\u011c"+
- "\1\u0141\1\u011c\1\u0195\27\u011c\1\u0195\2\u011c\1\u0195\2\u011c"+
- "\1\u0195\10\u011c\1\u0195\4\u011c\1\u0195\10\u011c\1\0\1\u0196"+
- "\1\u011d\1\u0145\3\u011d\1\u0196\1\u011d\1\u0141\25\u011d\1\u0196"+
- "\2\u011d\1\u0196\2\u011d\1\u0196\10\u011d\1\u0196\4\u011d\1\u0196"+
- "\10\u011d\65\0\1\u0197\53\0\2\u0198\26\0\1\u0199\1\u0104"+
- "\1\u0105\1\u0104\1\0\1\u0104\1\u0199\1\u0104\1\0\1\u0104"+
- "\1\u0108\11\u0104\1\0\11\u0104\1\u0199\2\u0104\1\u0199\2\u0104"+
- "\1\u0199\10\u0104\1\u0199\4\u0104\1\u0199\10\u0104\1\0\1\u019a"+
- "\1\u0106\1\u012f\1\u0106\1\u012c\1\u0106\1\u019a\27\u0106\1\u019a"+
- "\2\u0106\1\u019a\2\u0106\1\u019a\10\u0106\1\u019a\4\u0106\1\u019a"+
- "\10\u0106\1\0\1\u019b\1\u0107\1\u0130\3\u0107\1\u019b\1\u0107"+
- "\1\u012c\25\u0107\1\u019b\2\u0107\1\u019b\2\u0107\1\u019b\10\u0107"+
- "\1\u019b\4\u0107\1\u019b\10\u0107\1\0\2\307\1\310\1\307"+
- "\1\0\3\307\1\0\1\307\1\0\1\220\2\0\2\307"+
- "\1\0\3\307\1\0\1\307\10\0\11\307\1\0\4\307"+
- "\1\0\2\307\1\0\1\307\1\0\4\307\6\0\1\u019c"+
- "\5\0\1\u019c\16\0\2\u019c\7\0\2\u019c\1\0\2\u019c"+
- "\1\0\2\u019c\7\0\2\u019c\3\0\2\u019c\10\0\1\u019d"+
- "\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u019d\1\u0119\1\0"+
- "\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u019d\2\u0119\1\u019d"+
- "\2\u0119\1\u019d\10\u0119\1\u019d\4\u0119\1\u019d\10\u0119\1\0"+
- "\1\u019e\1\u011c\1\u0144\1\u011c\1\u0141\1\u011c\1\u019e\27\u011c"+
- "\1\u019e\2\u011c\1\u019e\2\u011c\1\u019e\10\u011c\1\u019e\4\u011c"+
- "\1\u019e\10\u011c\1\0\1\u019f\1\u011d\1\u0145\3\u011d\1\u019f"+
- "\1\u011d\1\u0141\25\u011d\1\u019f\2\u011d\1\u019f\2\u011d\1\u019f"+
- "\10\u011d\1\u019f\4\u011d\1\u019f\10\u011d\47\0\1\u01a0\25\0"+
- "\1\u01a1\1\u0104\1\u0105\1\u0104\1\0\1\u0104\1\u01a1\1\u0104"+
- "\1\0\1\u0104\1\u0108\11\u0104\1\0\11\u0104\1\u01a1\2\u0104"+
- "\1\u01a1\2\u0104\1\u01a1\10\u0104\1\u01a1\4\u0104\1\u01a1\10\u0104"+
- "\1\0\1\u01a2\1\u0106\1\u012f\1\u0106\1\u012c\1\u0106\1\u01a2"+
- "\27\u0106\1\u01a2\2\u0106\1\u01a2\2\u0106\1\u01a2\10\u0106\1\u01a2"+
- "\4\u0106\1\u01a2\10\u0106\1\0\1\u01a3\1\u0107\1\u0130\3\u0107"+
- "\1\u01a3\1\u0107\1\u012c\25\u0107\1\u01a3\2\u0107\1\u01a3\2\u0107"+
- "\1\u01a3\10\u0107\1\u01a3\4\u0107\1\u01a3\10\u0107\1\0\1\u01a4"+
- "\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u01a4\1\u0119\1\0"+
- "\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u01a4\2\u0119\1\u01a4"+
- "\2\u0119\1\u01a4\10\u0119\1\u01a4\4\u0119\1\u01a4\10\u0119\1\0"+
- "\1\u01a5\1\u011c\1\u0144\1\u011c\1\u0141\1\u011c\1\u01a5\27\u011c"+
- "\1\u01a5\2\u011c\1\u01a5\2\u011c\1\u01a5\10\u011c\1\u01a5\4\u011c"+
- "\1\u01a5\10\u011c\1\0\1\u01a6\1\u011d\1\u0145\3\u011d\1\u01a6"+
- "\1\u011d\1\u0141\25\u011d\1\u01a6\2\u011d\1\u01a6\2\u011d\1\u01a6"+
- "\10\u011d\1\u01a6\4\u011d\1\u01a6\10\u011d\1\0\2\u0104\1\u0105"+
- "\1\u0104\1\0\3\u0104\1\0\1\u0104\1\u0108\11\u0104\1\0"+
- "\46\u0104\1\0\1\u01a7\1\u0106\1\u012f\1\u0106\1\u012c\1\u0106"+
- "\1\u01a7\27\u0106\1\u01a7\2\u0106\1\u01a7\2\u0106\1\u01a7\10\u0106"+
- "\1\u01a7\4\u0106\1\u01a7\10\u0106\1\0\1\u01a8\1\u0107\1\u0130"+
- "\3\u0107\1\u01a8\1\u0107\1\u012c\25\u0107\1\u01a8\2\u0107\1\u01a8"+
- "\2\u0107\1\u01a8\10\u0107\1\u01a8\4\u0107\1\u01a8\10\u0107\1\0"+
- "\2\u0119\1\u011a\1\u0119\1\0\3\u0119\1\0\1\u0119\1\u011e"+
- "\11\u0119\1\0\46\u0119\1\0\1\u01a9\1\u011c\1\u0144\1\u011c"+
- "\1\u0141\1\u011c\1\u01a9\27\u011c\1\u01a9\2\u011c\1\u01a9\2\u011c"+
- "\1\u01a9\10\u011c\1\u01a9\4\u011c\1\u01a9\10\u011c\1\0\1\u01aa"+
- "\1\u011d\1\u0145\3\u011d\1\u01aa\1\u011d\1\u0141\25\u011d\1\u01aa"+
- "\2\u011d\1\u01aa\2\u011d\1\u01aa\10\u011d\1\u01aa\4\u011d\1\u01aa"+
- "\10\u011d\1\0\2\u0106\1\u012f\1\u0106\1\u012c\66\u0106\1\0"+
- "\2\u0107\1\u0130\5\u0107\1\u012c\62\u0107\1\0\2\u011c\1\u0144"+
- "\1\u011c\1\u0141\66\u011c\1\0\2\u011d\1\u0145\5\u011d\1\u0141"+
- "\62\u011d";
-
- private static int [] zzUnpackTrans() {
- int [] result = new int[21120];
- 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\11\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"+
- "\1\1\1\0\1\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\5\0\1\11\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"+
- "\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\1\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\1\0"+
- "\1\1\13\0\5\1\2\0\4\1\2\0\3\1\10\0"+
- "\2\1\1\11\1\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"+
- "\5\0\2\1\4\0\1\11\3\0\1\11\3\0\1\11"+
- "\12\0";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[426];
- 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 && (context != CSS_COMMENT)) {
- // 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 19:
- { 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 12:
- { 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 20:
- { 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 13:
- { 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 b624d1681d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
+++ /dev/null
@@ -1,73 +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.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_SELECTOR, CSSCorePreferenceNames.LOWER);
- 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 bce17d8250..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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_SELECTOR = "selectorCase"; //$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$
- public static final String CLEANUP_CASE_ID_SELECTOR = "cleanupIdSelectorCase"; //$NON-NLS-1$
- public static final String CLEANUP_CASE_CLASS_SELECTOR = "cleanupClassSelectorCase"; //$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 51a82bb7b0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
+++ /dev/null
@@ -1,56 +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.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();
-
- /**
- * The list of all CSS rules contained within the stylesheet and, if requested, the rules
- * from imported stylesheets are merged into the rule list.
- * @param shouldImport indicates if rules from imported stylesheets should be returned
- * @return the list of all of the rules in the stylesheet, and if requested,
- * any rules from imported stylesheets
- */
- CSSRuleList getCssRules(boolean shouldImport);
-}
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 260374f4b2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.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, '\"', '\"'));
- range.expand(getUpdateRangeForPair(start, end, '\'', '\''));
-
- 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, '[', ']'));
- range.expand(getUpdateRangeForPair(start, end, '(', ')'));
- range.expand(getUpdateRangeForPair(start, end, '{', '}'));
-
- 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;
- }
- }
-
- private int findChar(char c, int start, boolean forward) throws BadLocationException {
- int stop = forward ? fStructuredDocument.getLength() : 0;
- if (forward) {
- for (; start < stop; start++) {
- if (fStructuredDocument.getChar(start) == c)
- return start;
- }
- }
- else {
- for (; start >= stop; start--) {
- if (fStructuredDocument.getChar(start) == c)
- return start;
- }
- }
- return -1;
- }
-
- ReparseRange getUpdateRangeForPair(int start, int end, char opener, char closer) {
- StringBuffer deletionBuf = new StringBuffer();
- StringBuffer insertionBuf = new StringBuffer();
- 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 = -1, e = -1;
- try {
- if (start <= fStructuredDocument.getLength()) {
- s = findChar(opener, start - 1, false);
- }
- if (end < fStructuredDocument.getLength() - 1) {
- e = findChar(closer, end + 1, true);
- }
- }
- 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 43cfc3e160..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, 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.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 f78ac0a1e6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
+++ /dev/null
@@ -1,60 +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.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-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, ICSSPartitions.COMMENT, IStructuredPartitions.DEFAULT_PARTITION};
-
- public StructuredTextPartitionerForCSS() {
- super();
- }
-
- public String getDefaultPartitionType() {
- return ICSSPartitions.STYLE;
- }
-
- public String[] getLegalContentTypes() {
- return legalTypes;
- }
-
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitionerForCSS();
- }
-
- /**
- * <p>This partitioner breaks CSS into only two types of partitions depending on the region type:<br />
- * <code>COMMENT</code><br />
- * <code>STYLE</code></p>
- *
- * @see org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner#getPartitionType(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, int)
- */
- public String getPartitionType(ITextRegion region, int offset) {
- String partitionType;
-
- String regionType = region.getType();
-
- if(regionType == CSSRegionContexts.CSS_COMMENT) {
- partitionType = ICSSPartitions.COMMENT;
- } else {
- partitionType = super.getPartitionType(region, offset);
- }
-
- return partitionType;
- }
-}
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)
- return width;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java
deleted file mode 100644
index 7198eb1dd1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.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-width' property 'border-width' will be expanded to
- * 'border-top-width', 'border-right-width', 'border-bottom-width',
- * 'border-left-width',
- */
-public class BorderWidthShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderWidthShorthandAdapter() {
- 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 (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_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_WIDTH, dests[0]);
- dest.set(PropCMProperty.P_BORDER_RIGHT_WIDTH, dests[1]);
- dest.set(PropCMProperty.P_BORDER_BOTTOM_WIDTH, dests[2]);
- dest.set(PropCMProperty.P_BORDER_LEFT_WIDTH, 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 (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_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_WIDTH || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
- return idents[0];
- else
- return idents[1];
- }
- else if (j == 3) {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_WIDTH)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
- return idents[2];
- else
- return idents[1];
- }
- else {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_WIDTH)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_WIDTH)
- return idents[1];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
- return idents[2];
- else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_WIDTH)
- return idents[3];
- else
- return null;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java
deleted file mode 100644
index 1b83a8fa76..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java
+++ /dev/null
@@ -1,2997 +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.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-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.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-public class CSSPropertyContext implements ICSS2Properties {
-
- protected Hashtable fProperties = new Hashtable();
- HashSet fModified = null;
- private static java.util.Hashtable subPropertyAdapters;
- private static java.util.Hashtable shorthandAdapters;
-
- /**
- *
- */
- public CSSPropertyContext() {
- super();
- initShorthandAdapters();
- initSubPropertyAdapters();
- }
-
- /**
- *
- */
- public CSSPropertyContext(ICSSStyleDeclaration decl) {
- super();
- initShorthandAdapters();
- initSubPropertyAdapters();
- initialize(decl);
- }
-
- /**
- * This function exports all property/value pairs to 'decl' declaration
- */
- public void applyFull(ICSSStyleDeclaration decl) {
- if (decl == null)
- return;
- Enumeration keys = fProperties.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- Object val = fProperties.get(key);
- String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : val.toString();
-
- if (value == null || value.length() <= 0)
- decl.removeProperty(key.toString());
- else
- decl.setProperty(key.toString(), value.trim(), (val instanceof ValueData && ((ValueData) val).important) ? "!important" : "");//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-
- /**
- * This function exports modified property/value pairs to 'decl'
- * declaration
- */
- public void applyModified(ICSSStyleDeclaration decl) {
- if (decl == null || fModified == null)
- return;
- Iterator it = fModified.iterator();
- while (it.hasNext()) {
- Object key = it.next();
- Object val = fProperties.get(key);
- String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : ((val != null) ? val.toString() : null);
-
- if (value == null || value.length() <= 0)
- decl.removeProperty(key.toString());
- else
- decl.setProperty(key.toString(), value.trim(), (val instanceof ValueData && ((ValueData) val).important) ? "!important" : "");//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-
- /**
- * create clone of this context
- */
- public Object clone() {
- CSSPropertyContext clone = new CSSPropertyContext();
- if (this.fModified != null)
- clone.fModified = (HashSet) this.fModified.clone();
- else
- clone.fModified = null;
- clone.fProperties = (Hashtable) this.fProperties.clone();
- return clone;
- }
-
- /**
- * This function expands a short-hand property's value to each leaf
- * property's value and set them to 'foreign'
- *
- * For example, given [prop=border-top, value="solid 1px yellow"] will be
- * expanded to [border-top-color=yellow, border-top-style=solid,
- * border-top-width=1px] and they are stored to 'foreign' context.
- *
- * Note that recursively shorthanded property like 'border' will be
- * expanded to all descendant leaf properties like
- * 'border-[top/right/bottom/left]-[color/style/width]'
- *
- * @param prop
- * org.eclipse.wst.css.core.contentmodel.PropCMProperty
- * @param value
- * java.lang.String
- * @param foreign
- * org.eclipse.wst.css.core.util.declaration.CSSPropertyContext
- */
- protected static void expandToLeaf(PropCMProperty prop, String value, CSSPropertyContext foreign) {
- // expand shorthand property
- if (value != null && value.trim().length() > 0) {
- IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(prop);
- if (adapter != null) {
- adapter.expand(value, foreign);
- foreign.set(prop.getName(), "");//$NON-NLS-1$
- for (int i = 0; i < prop.getNumChild(); i++) {
- Object obj = prop.getChildAt(i);
- if (obj instanceof PropCMProperty && !(obj instanceof PropCMSubProperty)) {
- PropCMProperty expandedProp = (PropCMProperty) obj;
- value = foreign.get(expandedProp.getName());
- expandToLeaf(expandedProp, value, foreign);
- }
- }
- }
- else if (!value.equals(foreign.get(prop.getName()))) {
- foreign.set(prop.getName(), value);
- }
- }
- }
-
- /**
- * This function returns value of 'prop'. Querying value mechanism checks
- * short-hand properties.
- *
- * For example, given "background=fixed white" is set in this insatnce and
- * param "prop=background-color", the return value will be "white".
- *
- */
- public java.lang.String get(org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty prop) {
- if (prop instanceof PropCMSubProperty) {
- ISubPropertyAdapter adapter = (ISubPropertyAdapter) subPropertyAdapters.get(prop.getName());
- if (adapter != null)
- return adapter.get(this);
- }
- String str = get(prop.getName());
- if ((str == null || str.length() == 0) && prop.getShorthandContainerCount() > 0) {
- // get expanded property
- for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
- PropCMProperty propParent = prop.shorthandContainerAt(i);
- String strParent = get(propParent);
- if (strParent != null && strParent.trim().length() > 0) {
- IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(propParent);
- if (adapter != null) {
- String extractedValue = adapter.extract(strParent, prop);
- return (extractedValue != null) ? extractedValue : "";//$NON-NLS-1$
- }
- }
- }
- }
- return str;
- }
-
- /**
- * This function returns value of 'prop'. Querying value mechanism does
- * not care shorthand properties.
- */
- protected String get(String propName) {
- String str = null;
- Object obj = fProperties.get(propName);
- if (obj != null) {
- if (obj instanceof ICSSValue)
- str = ((ICSSValue) obj).getCSSValueText();
- else
- str = obj.toString();
- }
- return (str != null) ? str : "";//$NON-NLS-1$
- }
-
- /**
- * See the azimuth property definition in CSS2.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getAzimuth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH));
- }
-
- /**
- * See the background property definition in CSS2.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackground() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG));
- }
-
- /**
- * See the background-attachment property definition in CSS2.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackgroundAttachment() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT));
- }
-
- /**
- * See the background-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackgroundColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR));
- }
-
- /**
- * See the background-image property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackgroundImage() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE));
- }
-
- /**
- * See the background-position property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackgroundPosition() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
- }
-
- /**
- *
- */
- public java.lang.String getBackgroundPositionX() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X));
- /*
- * String str = null; Object obj =
- * fProperties.get(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(); } else str = obj.toString(); }
- * return (str != null) ? str : "";
- */
- }
-
- /**
- *
- */
- public java.lang.String getBackgroundPositionY() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y));
- /*
- * String str = null; Object obj =
- * fProperties.get(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) { // do nothing --- value is null } else str =
- * obj.toString(); } return (str != null) ? str : "";
- */
- }
-
- /**
- * See the background-repeat property definition in CSS2.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBackgroundRepeat() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT));
- }
-
- /**
- * See the border property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorder() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER));
- }
-
- /**
- * See the border-bottom property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderBottom() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM));
- }
-
- /**
- * See the border-bottom-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderBottomColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
- }
-
- /**
- * See the border-bottom-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderBottomStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
- }
-
- /**
- * See the border-bottom-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderBottomWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
- }
-
- /**
- * See the border-collapse property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderCollapse() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE));
- }
-
- /**
- * See the border-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR));
- }
-
- /**
- * See the border-left property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderLeft() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT));
- }
-
- /**
- * See the border-left-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderLeftColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
- }
-
- /**
- * See the border-left-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderLeftStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
- }
-
- /**
- * See the border-left-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderLeftWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
- }
-
- /**
- * See the border-right property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderRight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT));
- }
-
- /**
- * See the border-right-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderRightColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
- }
-
- /**
- * See the border-right-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderRightStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
- }
-
- /**
- * See the border-right-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderRightWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
- }
-
- /**
- * See the border-spacing property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderSpacing() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING));
- }
-
- /**
- * See the border-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE));
- }
-
- /**
- * See the border-top property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderTop() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP));
- }
-
- /**
- * See the border-top-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderTopColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
- }
-
- /**
- * See the border-top-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderTopStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
- }
-
- /**
- * See the border-top-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderTopWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
- }
-
- /**
- * See the border-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBorderWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH));
- }
-
- /**
- * See the bottom property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getBottom() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM));
- }
-
- /**
- * See the caption-side property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCaptionSide() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE));
- }
-
- /**
- * See the clear property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getClear() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR));
- }
-
- /**
- * See the clip property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getClip() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- }
-
- /**
- *
- */
- public String getClipBottom() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
- }
-
- /**
- *
- */
- public String getClipLeft() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
- }
-
- /**
- *
- */
- public String getClipRight() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
- }
-
- /**
- *
- */
- public String getClipTop() {
- return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
- }
-
- /**
- * See the color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR));
- }
-
- /**
- * See the content property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getContent() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT));
- }
-
- /**
- * See the counter-increment property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCounterIncrement() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT));
- }
-
- /**
- * See the counter-reset property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCounterReset() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET));
- }
-
- /**
- * See the float property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCssFloat() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT));
- }
-
- /**
- * See the cue property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCue() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE));
- }
-
- /**
- * See the cue-after property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCueAfter() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER));
- }
-
- /**
- * See the cue-before property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCueBefore() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE));
- }
-
- /**
- * See the cursor property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getCursor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR));
- }
-
- /**
- * See the direction property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getDirection() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION));
- }
-
- /**
- * See the display property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getDisplay() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY));
- }
-
- /**
- * See the elevation property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getElevation() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION));
- }
-
- /**
- * See the empty-cells property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getEmptyCells() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS));
- }
-
- /**
- * See the font property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFont() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT));
- }
-
- /**
- * See the font-family property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontFamily() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY));
- }
-
- /**
- * See the font-size property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontSize() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE));
- }
-
- /**
- * See the font-size-adjust property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontSizeAdjust() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST));
- }
-
- /**
- * See the font-stretch property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontStretch() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH));
- }
-
- /**
- * See the font-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE));
- }
-
- /**
- * See the font-variant property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontVariant() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT));
- }
-
- /**
- * See the font-weight property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getFontWeight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT));
- }
-
- /**
- * See the height property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getHeight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT));
- }
-
- /**
- * See the left property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getLeft() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT));
- }
-
- /**
- * See the letter-spacing property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getLetterSpacing() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING));
- }
-
- /**
- * See the line-height property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getLineHeight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT));
- }
-
- /**
- * See the list-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getListStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE));
- }
-
- /**
- * See the list-style-image property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getListStyleImage() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE));
- }
-
- /**
- * See the list-style-position property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getListStylePosition() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION));
- }
-
- /**
- * See the list-style-type property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getListStyleType() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE));
- }
-
- /**
- * See the margin property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMargin() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN));
- }
-
- /**
- * See the margin-bottom property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarginBottom() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM));
- }
-
- /**
- * See the margin-left property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarginLeft() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT));
- }
-
- /**
- * See the margin-right property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarginRight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT));
- }
-
- /**
- * See the margin-top property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarginTop() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP));
- }
-
- /**
- * See the marker-offset property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarkerOffset() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET));
- }
-
- /**
- * See the marks property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMarks() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS));
- }
-
- /**
- * See the max-height property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMaxHeight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT));
- }
-
- /**
- * See the max-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMaxWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH));
- }
-
- /**
- * See the min-height property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMinHeight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT));
- }
-
- /**
- * See the min-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getMinWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH));
- }
-
- /**
- * See the orphans property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOrphans() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS));
- }
-
- /**
- * See the outline property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOutline() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE));
- }
-
- /**
- * See the outline-color property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOutlineColor() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR));
- }
-
- /**
- * See the outline-style property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOutlineStyle() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE));
- }
-
- /**
- * See the outline-width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOutlineWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH));
- }
-
- /**
- * See the overflow property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getOverflow() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW));
- }
-
- /**
- * See the padding property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPadding() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING));
- }
-
- /**
- * See the padding-bottom property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPaddingBottom() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM));
- }
-
- /**
- * See the padding-left property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPaddingLeft() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT));
- }
-
- /**
- * See the padding-right property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPaddingRight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT));
- }
-
- /**
- * See the padding-top property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPaddingTop() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP));
- }
-
- /**
- * See the page property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPage() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE));
- }
-
- /**
- * See the page-break-after property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPageBreakAfter() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER));
- }
-
- /**
- * See the page-break-before property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPageBreakBefore() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE));
- }
-
- /**
- * See the page-break-inside property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPageBreakInside() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE));
- }
-
- /**
- * See the pause property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPause() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE));
- }
-
- /**
- * See the pause-after property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPauseAfter() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER));
- }
-
- /**
- * See the pause-before property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPauseBefore() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE));
- }
-
- /**
- * See the pitch property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPitch() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH));
- }
-
- /**
- * See the pitch-range property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPitchRange() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE));
- }
-
- /**
- * See the play-during property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPlayDuring() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING));
- }
-
- /**
- * See the position property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getPosition() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION));
- }
-
- /**
- * See the quotes property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getQuotes() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES));
- }
-
- /**
- * See the richness property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getRichness() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS));
- }
-
- /**
- * See the right property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getRight() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT));
- }
-
- /**
- * @return org.eclipse.wst.css.core.util.declaration.IShorthandAdapter
- * @param org.eclipse.wst.css.core.contentmodel.PropCMProperty
- */
- public static IShorthandAdapter getShorthandAdapter(PropCMProperty prop) {
- return (IShorthandAdapter) shorthandAdapters.get(prop);
- }
-
- /**
- * See the size property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSize() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE));
- }
-
- /**
- * See the speak property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSpeak() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK));
- }
-
- /**
- * See the speak-header property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSpeakHeader() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER));
- }
-
- /**
- * See the speak-numeral property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSpeakNumeral() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL));
- }
-
- /**
- * See the speak-punctuation property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSpeakPunctuation() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION));
- }
-
- /**
- * See the speech-rate property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getSpeechRate() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE));
- }
-
- /**
- * See the stress property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getStress() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS));
- }
-
- /**
- * See the table-layout property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTableLayout() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT));
- }
-
- /**
- * See the text-align property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTextAlign() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN));
- }
-
- /**
- * See the text-decoration property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTextDecoration() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION));
- }
-
- /**
- * See the text-indent property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTextIndent() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT));
- }
-
- /**
- * See the text-shadow property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTextShadow() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW));
- }
-
- /**
- * See the text-transform property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTextTransform() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM));
- }
-
- /**
- * See the top property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getTop() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TOP));
- }
-
- /**
- * See the unicode-bidi property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getUnicodeBidi() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI));
- }
-
- /**
- * See the vertical-align property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getVerticalAlign() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN));
- }
-
- /**
- * See the visibility property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getVisibility() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY));
- }
-
- /**
- * See the voice-family property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getVoiceFamily() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY));
- }
-
- /**
- * See the volume property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getVolume() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME));
- }
-
- /**
- * See the white-space property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getWhiteSpace() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE));
- }
-
- /**
- * See the widows property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getWidows() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS));
- }
-
- /**
- * See the width property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getWidth() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH));
- }
-
- /**
- * See the word-spacing property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getWordSpacing() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING));
- }
-
- /**
- * See the z-index property definition in CSS2.
- *
- * @exceptionorg.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error
- * and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public String getZIndex() {
- return get(PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX));
- }
-
- /**
- *
- */
- public void initialize(ICSSStyleDeclaration decl) {
- fProperties.clear();
- if (fModified != null)
- fModified.clear();
- if (decl == null)
- return;
-
- int nProperties = decl.getLength();
- for (int i = 0; i < nProperties; i++) {
- String propName = decl.item(i);
- if (propName != null) {
- String propN = propName.trim().toLowerCase();
- if (propN.length() != 0) {
- CSSValue val = decl.getPropertyCSSValue(propName);
- if (val != null)
- fProperties.put(propN, val);
- }
- }
- }
- }
-
- /**
- *
- */
- static void initShorthandAdapters() {
- if (shorthandAdapters == null) {
- shorthandAdapters = new Hashtable();
- // register
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BG), new BackgroundShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER), new BorderShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR), new BorderColorShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE), new BorderStyleShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH), new BorderWidthShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP), new BorderTopShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT), new BorderRightShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM), new BorderBottomShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT), new BorderLeftShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT), new FontShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE), new ListStyleShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN), new MarginShorthandAdapter());
- shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING), new PaddingShorthandAdapter());
-
- }
- }
-
- /**
- *
- */
- static void initSubPropertyAdapters() {
- if (subPropertyAdapters == null) {
- subPropertyAdapters = new Hashtable();
-
- // register
- subPropertyAdapters.put(PropCMSubProperty.PSUB_BG_POSITION_X, new BackgroundPositionXSubStyleAdapter());
- subPropertyAdapters.put(PropCMSubProperty.PSUB_BG_POSITION_Y, new BackgroundPositionYSubStyleAdapter());
- subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_TOP, new ClipTopSubStyleAdapter());
- subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_RIGHT, new ClipRightSubStyleAdapter());
- subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_BOTTOM, new ClipBottomSubStyleAdapter());
- subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_LEFT, new ClipLeftSubStyleAdapter());
- }
- }
-
- /**
- *
- */
- public boolean isModified() {
- return (fModified != null && fModified.size() != 0);
- }
-
- /**
- *
- */
- public Enumeration properties() {
- return fProperties.keys();
- }
-
- /**
- *
- */
- public Iterator propertiesModified() {
- if (fModified != null) {
- return ((Collection) fModified.clone()).iterator();
- }
- else
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
-
- /**
- * This function expands the value of shorthand 'prop' to 'foreign'
- * context. Note that if this has parent shorthand properties of 'prop',
- * they are all expanded to 'foreign' context.
- */
- protected void recursiveExtract(PropCMProperty prop, CSSPropertyContext foreign) {
- // expand shorthand property
- for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
- recursiveExtract(prop.shorthandContainerAt(i), foreign);
- }
- String str = get(prop.getName());
- if (str == null || str.trim().length() == 0)
- str = foreign.get(prop.getName());
- if (str != null && str.trim().length() > 0) {
- IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(prop);
- if (adapter != null) {
- adapter.expand(str, foreign);
- foreign.set(prop.getName(), "");//$NON-NLS-1$
- }
- }
- }
-
- /**
- *
- */
- protected void removeDescendants(PropCMProperty prop) {
- if (prop.isShorthand()) {
- // remove properties
- int n = prop.getNumChild();
- for (int i = 0; i < n; i++) {
- Object obj = prop.getChildAt(i);
- if (obj instanceof PropCMProperty) {
- removeDescendants((PropCMProperty) obj);
-
- String str = get(obj.toString());
- if (str != null && str.length() > 0)
- set(obj.toString(), "");//$NON-NLS-1$
- }
- }
- }
- }
-
- /**
- *
- */
- public void resetModified() {
- if (fModified != null)
- fModified.clear();
- }
-
- /**
- * This function sets the pair of 'prop'/'value'. If shorthand properties
- * related to 'prop' are already defined, they will be expanded to avoid
- * property confliction. If descendant properties of 'prop' are already
- * defined, they will be removed to avoid property confliction.
- *
- */
- public void set(org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty prop, java.lang.String value) throws org.w3c.dom.DOMException {
- if (prop instanceof PropCMSubProperty) {
- ISubPropertyAdapter adapter = (ISubPropertyAdapter) subPropertyAdapters.get(prop.getName());
- if (adapter != null) {
- adapter.set(this, value);
- return;
- }
- }
- if (prop.getShorthandContainerCount() > 0) {
- // expand shorthand property
- CSSPropertyContext context = new CSSPropertyContext();
- for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
- recursiveExtract(prop.shorthandContainerAt(i), context);
- }
- Enumeration properties = context.properties();
- while (properties.hasMoreElements()) {
- String propForeign = properties.nextElement().toString();
- set(propForeign, context.get(propForeign));
- }
- }
-
- removeDescendants(prop);
-
- set(prop.getName(), value);
- }
-
- /**
- * This function sets the pair of 'propName'/'value' regardless of its
- * shorthand properties.
- */
- protected void set(String propName, String value) throws org.w3c.dom.DOMException {
- String key = propName;
- if (value == null)
- fProperties.remove(key);
- else
- fProperties.put(key, value);
- if (fModified == null)
- fModified = new HashSet();
- fModified.add(key);
- }
-
- /**
- *
- */
- public void setAzimuth(String azimuth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH), azimuth);
- }
-
- /**
- *
- */
- public void setBackground(String background) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG), background);
- }
-
- /**
- *
- */
- public void setBackgroundAttachment(String backgroundAttachment) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT), backgroundAttachment);
- }
-
- /**
- *
- */
- public void setBackgroundColor(String backgroundColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR), backgroundColor);
- }
-
- /**
- *
- */
- public void setBackgroundImage(String backgroundImage) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE), backgroundImage);
- }
-
- /**
- *
- */
- public void setBackgroundPosition(String backgroundPosition) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION), backgroundPosition);
- }
-
- /**
- *
- */
- public void setBackgroundPositionX(java.lang.String backgroundPositionX) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X), backgroundPositionX);
- /*
- * String newValue = null; String valH = backgroundPositionX; String
- * valV = 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) newValue = "0% " + valV; }
- * else newValue = valH + " " + valV; setBackgroundPosition(newValue);
- */
- }
-
- /**
- *
- */
- public void setBackgroundPositionY(java.lang.String backgroundPositionY) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y), backgroundPositionY);
- /*
- * String newValue = null; String valH = getBackgroundPositionX();
- * String valV = backgroundPositionY; 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) newValue = "0% " + valV; }
- * else newValue = valH + " " + valV; setBackgroundPosition(newValue);
- */
- }
-
- /**
- *
- */
- public void setBackgroundRepeat(String backgroundRepeat) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT), backgroundRepeat);
- }
-
- /**
- *
- */
- public void setBorder(String border) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER), border);
- }
-
- /**
- *
- */
- public void setBorderBottom(String borderBottom) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM), borderBottom);
- }
-
- /**
- *
- */
- public void setBorderBottomColor(String borderBottomColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR), borderBottomColor);
- }
-
- /**
- *
- */
- public void setBorderBottomStyle(String borderBottomStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE), borderBottomStyle);
- }
-
- /**
- *
- */
- public void setBorderBottomWidth(String borderBottomWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH), borderBottomWidth);
- }
-
- /**
- *
- */
- public void setBorderCollapse(String borderCollapse) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE), borderCollapse);
- }
-
- /**
- *
- */
- public void setBorderColor(String borderColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR), borderColor);
- }
-
- /**
- *
- */
- public void setBorderLeft(String borderLeft) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT), borderLeft);
- }
-
- /**
- *
- */
- public void setBorderLeftColor(String borderLeftColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR), borderLeftColor);
- }
-
- /**
- *
- */
- public void setBorderLeftStyle(String borderLeftStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE), borderLeftStyle);
- }
-
- /**
- *
- */
- public void setBorderLeftWidth(String borderLeftWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH), borderLeftWidth);
- }
-
- /**
- *
- */
- public void setBorderRight(String borderRight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT), borderRight);
- }
-
- /**
- *
- */
- public void setBorderRightColor(String borderRightColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR), borderRightColor);
- }
-
- /**
- *
- */
- public void setBorderRightStyle(String borderRightStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE), borderRightStyle);
- }
-
- /**
- *
- */
- public void setBorderRightWidth(String borderRightWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH), borderRightWidth);
- }
-
- /**
- *
- */
- public void setBorderSpacing(String borderSpacing) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING), borderSpacing);
- }
-
- /**
- *
- */
- public void setBorderStyle(String borderStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE), borderStyle);
- }
-
- /**
- *
- */
- public void setBorderTop(String borderTop) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP), borderTop);
- }
-
- /**
- *
- */
- public void setBorderTopColor(String borderTopColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR), borderTopColor);
- }
-
- /**
- *
- */
- public void setBorderTopStyle(String borderTopStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE), borderTopStyle);
- }
-
- /**
- *
- */
- public void setBorderTopWidth(String borderTopWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH), borderTopWidth);
- }
-
- /**
- *
- */
- public void setBorderWidth(String borderWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH), borderWidth);
- }
-
- /**
- *
- */
- public void setBottom(String bottom) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM), bottom);
- }
-
- /**
- *
- */
- public void setCaptionSide(String captionSide) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE), captionSide);
- }
-
- /**
- *
- */
- public void setClear(String clear) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR), clear);
- }
-
- /**
- *
- */
- public void setClip(String clip) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), clip);
- }
-
- /**
- *
- */
- public void setClipBottom(java.lang.String clip) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM), clip);
- }
-
- /**
- *
- */
- public void setClipLeft(java.lang.String clip) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT), clip);
- }
-
- /**
- *
- */
- public void setClipRight(java.lang.String clip) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT), clip);
- }
-
- /**
- *
- */
- public void setClipTop(java.lang.String clip) throws org.w3c.dom.DOMException {
- set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP), clip);
- }
-
- /**
- *
- */
- public void setColor(String color) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR), color);
- }
-
- /**
- *
- */
- public void setContent(String content) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT), content);
- }
-
- /**
- *
- */
- public void setCounterIncrement(String counterIncrement) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT), counterIncrement);
- }
-
- /**
- *
- */
- public void setCounterReset(String counterReset) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET), counterReset);
- }
-
- /**
- *
- */
- public void setCssFloat(String cssFloat) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT), cssFloat);
- }
-
- /**
- *
- */
- public void setCue(String cue) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE), cue);
- }
-
- /**
- *
- */
- public void setCueAfter(String cueAfter) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER), cueAfter);
- }
-
- /**
- *
- */
- public void setCueBefore(String cueBefore) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE), cueBefore);
- }
-
- /**
- *
- */
- public void setCursor(String cursor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR), cursor);
- }
-
- /**
- *
- */
- public void setDirection(String direction) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION), direction);
- }
-
- /**
- *
- */
- public void setDisplay(String display) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY), display);
- }
-
- /**
- *
- */
- public void setElevation(String elevation) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION), elevation);
- }
-
- /**
- *
- */
- public void setEmptyCells(String emptyCells) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS), emptyCells);
- }
-
- /**
- *
- */
- public void setFont(String font) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT), font);
- }
-
- /**
- *
- */
- public void setFontFamily(String fontFamily) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY), fontFamily);
- }
-
- /**
- *
- */
- public void setFontSize(String fontSize) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE), fontSize);
- }
-
- /**
- *
- */
- public void setFontSizeAdjust(String fontSizeAdjust) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST), fontSizeAdjust);
- }
-
- /**
- *
- */
- public void setFontStretch(String fontStretch) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH), fontStretch);
- }
-
- /**
- *
- */
- public void setFontStyle(String fontStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE), fontStyle);
- }
-
- /**
- *
- */
- public void setFontVariant(String fontVariant) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT), fontVariant);
- }
-
- /**
- *
- */
- public void setFontWeight(String fontWeight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT), fontWeight);
- }
-
- /**
- *
- */
- public void setHeight(String height) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT), height);
- }
-
- /**
- *
- */
- public void setLeft(String left) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT), left);
- }
-
- /**
- *
- */
- public void setLetterSpacing(String letterSpacing) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING), letterSpacing);
- }
-
- /**
- *
- */
- public void setLineHeight(String lineHeight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT), lineHeight);
- }
-
- /**
- *
- */
- public void setListStyle(String listStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE), listStyle);
- }
-
- /**
- *
- */
- public void setListStyleImage(String listStyleImage) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE), listStyleImage);
- }
-
- /**
- *
- */
- public void setListStylePosition(String listStylePosition) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION), listStylePosition);
- }
-
- /**
- *
- */
- public void setListStyleType(String listStyleType) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE), listStyleType);
- }
-
- /**
- *
- */
- public void setMargin(String margin) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN), margin);
- }
-
- /**
- *
- */
- public void setMarginBottom(String marginBottom) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM), marginBottom);
- }
-
- /**
- *
- */
- public void setMarginLeft(String marginLeft) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT), marginLeft);
- }
-
- /**
- *
- */
- public void setMarginRight(String marginRight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT), marginRight);
- }
-
- /**
- *
- */
- public void setMarginTop(String marginTop) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP), marginTop);
- }
-
- /**
- *
- */
- public void setMarkerOffset(String markerOffset) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET), markerOffset);
- }
-
- /**
- *
- */
- public void setMarks(String marks) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS), marks);
- }
-
- /**
- *
- */
- public void setMaxHeight(String maxHeight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT), maxHeight);
- }
-
- /**
- *
- */
- public void setMaxWidth(String maxWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH), maxWidth);
- }
-
- /**
- *
- */
- public void setMinHeight(String minHeight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT), minHeight);
- }
-
- /**
- *
- */
- public void setMinWidth(String minWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH), minWidth);
- }
-
- /**
- *
- */
- public void setOrphans(String orphans) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS), orphans);
- }
-
- /**
- *
- */
- public void setOutline(String outline) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE), outline);
- }
-
- /**
- *
- */
- public void setOutlineColor(String outlineColor) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR), outlineColor);
- }
-
- /**
- *
- */
- public void setOutlineStyle(String outlineStyle) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE), outlineStyle);
- }
-
- /**
- *
- */
- public void setOutlineWidth(String outlineWidth) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH), outlineWidth);
- }
-
- /**
- *
- */
- public void setOverflow(String overflow) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW), overflow);
- }
-
- /**
- *
- */
- public void setPadding(String padding) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING), padding);
- }
-
- /**
- *
- */
- public void setPaddingBottom(String paddingBottom) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM), paddingBottom);
- }
-
- /**
- *
- */
- public void setPaddingLeft(String paddingLeft) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT), paddingLeft);
- }
-
- /**
- *
- */
- public void setPaddingRight(String paddingRight) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT), paddingRight);
- }
-
- /**
- *
- */
- public void setPaddingTop(String paddingTop) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP), paddingTop);
- }
-
- /**
- *
- */
- public void setPage(String page) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE), page);
- }
-
- /**
- *
- */
- public void setPageBreakAfter(String pageBreakAfter) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER), pageBreakAfter);
- }
-
- /**
- *
- */
- public void setPageBreakBefore(String pageBreakBefore) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE), pageBreakBefore);
- }
-
- /**
- *
- */
- public void setPageBreakInside(String pageBreakInside) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE), pageBreakInside);
- }
-
- /**
- *
- */
- public void setPause(String pause) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE), pause);
- }
-
- /**
- *
- */
- public void setPauseAfter(String pauseAfter) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER), pauseAfter);
- }
-
- /**
- *
- */
- public void setPauseBefore(String pauseBefore) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE), pauseBefore);
- }
-
- /**
- *
- */
- public void setPitch(String pitch) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH), pitch);
- }
-
- /**
- *
- */
- public void setPitchRange(String pitchRange) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE), pitchRange);
- }
-
- /**
- *
- */
- public void setPlayDuring(String playDuring) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING), playDuring);
- }
-
- /**
- *
- */
- public void setPosition(String position) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION), position);
- }
-
- /**
- *
- */
- public void setQuotes(String quotes) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES), quotes);
- }
-
- /**
- *
- */
- public void setRichness(String richness) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS), richness);
- }
-
- /**
- *
- */
- public void setRight(String right) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT), right);
- }
-
- /**
- *
- */
- public void setSize(String size) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE), size);
- }
-
- /**
- *
- */
- public void setSpeak(String speak) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK), speak);
- }
-
- /**
- *
- */
- public void setSpeakHeader(String speakHeader) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER), speakHeader);
- }
-
- /**
- *
- */
- public void setSpeakNumeral(String speakNumeral) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL), speakNumeral);
- }
-
- /**
- *
- */
- public void setSpeakPunctuation(String speakPunctuation) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION), speakPunctuation);
- }
-
- /**
- *
- */
- public void setSpeechRate(String speechRate) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE), speechRate);
- }
-
- /**
- *
- */
- public void setStress(String stress) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS), stress);
- }
-
- /**
- *
- */
- public void setTableLayout(String tableLayout) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT), tableLayout);
- }
-
- /**
- *
- */
- public void setTextAlign(String textAlign) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN), textAlign);
- }
-
- /**
- *
- */
- public void setTextDecoration(String textDecoration) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION), textDecoration);
- }
-
- /**
- *
- */
- public void setTextIndent(String textIndent) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT), textIndent);
- }
-
- /**
- *
- */
- public void setTextShadow(String textShadow) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW), textShadow);
- }
-
- /**
- *
- */
- public void setTextTransform(String textTransform) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM), textTransform);
- }
-
- /**
- *
- */
- public void setTop(String top) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_TOP), top);
- }
-
- /**
- *
- */
- public void setUnicodeBidi(String unicodeBidi) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI), unicodeBidi);
- }
-
- /**
- *
- */
- public void setVerticalAlign(String verticalAlign) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN), verticalAlign);
- }
-
- /**
- *
- */
- public void setVisibility(String visibility) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY), visibility);
- }
-
- /**
- *
- */
- public void setVoiceFamily(String voiceFamily) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY), voiceFamily);
- }
-
- /**
- *
- */
- public void setVolume(String volume) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME), volume);
- }
-
- /**
- *
- */
- public void setWhiteSpace(String whiteSpace) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE), whiteSpace);
- }
-
- /**
- *
- */
- public void setWidows(String widows) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS), widows);
- }
-
- /**
- *
- */
- public void setWidth(String width) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH), width);
- }
-
- /**
- *
- */
- public void setWordSpacing(String wordSpacing) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING), wordSpacing);
- }
-
- /**
- *
- */
- public void setZIndex(String zIndex) throws org.w3c.dom.DOMException {
- set(PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX), zIndex);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java
deleted file mode 100644
index 930dae1b77..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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.PropCMSubProperty;
-
-/**
- * For bottom value of 'clip' property's rect() function
- */
-public class ClipBottomSubStyleAdapter extends ClipSubStyleAdapter {
-
- /**
- *
- */
- public ClipBottomSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- String get(org.w3c.dom.css.Rect rect) {
- return rect.getBottom().getCssText();
- }
-
- /**
- *
- */
- int index() {
- return 2;
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
- String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
- String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
- set(properties, top, right, value, left, value == null || value.length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java
deleted file mode 100644
index 982b994216..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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.PropCMSubProperty;
-
-/**
- * For left value of 'clip' property's rect() function
- */
-public class ClipLeftSubStyleAdapter extends ClipSubStyleAdapter {
-
- /**
- *
- */
- public ClipLeftSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- String get(org.w3c.dom.css.Rect rect) {
- return rect.getLeft().getCssText();
- }
-
- /**
- *
- */
- int index() {
- return 3;
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
- String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
- String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
-
- set(properties, top, right, bottom, value, value == null || value.length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java
deleted file mode 100644
index cfd1e2379a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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.PropCMSubProperty;
-
-/**
- * For right value of 'clip' property's rect() function
- */
-public class ClipRightSubStyleAdapter extends ClipSubStyleAdapter {
-
- /**
- *
- */
- public ClipRightSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- String get(org.w3c.dom.css.Rect rect) {
- return rect.getRight().getCssText();
- }
-
- /**
- *
- */
- int index() {
- return 1;
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
- String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
- String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
- set(properties, top, value, bottom, left, value == null || value.length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java
deleted file mode 100644
index 92e96bd8af..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java
+++ /dev/null
@@ -1,132 +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.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.w3c.dom.css.Rect;
-
-
-/**
- * Abstract class for clip sub-properties
- */
-abstract public class ClipSubStyleAdapter implements ISubPropertyAdapter {
-
- /**
- *
- */
- public ClipSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- public String get(ICSS2Properties properties) {
- String str = null;
- Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- if (obj != null) {
- if (obj instanceof org.w3c.dom.css.Rect) {
- str = get((org.w3c.dom.css.Rect) obj);
- }
- else {
- if (obj instanceof ICSSValue) {
- str = ((ICSSValue) obj).getCSSValueText();
- }
- else {
- str = obj.toString();
- }
- str = str.trim().toLowerCase();
- int pos = str.indexOf("rect(");//$NON-NLS-1$
- if (pos >= 0) {
- String subStr = null;
- pos += 5;
- int i = 0;
- do {
- int posEnd = str.indexOf(",", pos);//$NON-NLS-1$
- if (posEnd < 0)
- posEnd = str.indexOf(")", pos);//$NON-NLS-1$
- if (posEnd < 0 && pos < str.length())
- posEnd = str.length();
- if (posEnd >= pos) {
- subStr = str.substring(pos, posEnd);
- pos = posEnd + 1;
- }
- else
- pos = -1;
- }
- while (i++ < index() && pos > 0);
-
- if (pos > 0)
- str = subStr.trim();
- else
- str = null;
- }
- else
- str = null;
- }
- }
- return (str != null) ? str : "";//$NON-NLS-1$
- }
-
- /**
- *
- */
- abstract String get(Rect rect);
-
- /**
- *
- */
- abstract int index();
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/10/04
- * 19:25:46)
- *
- * @param properties
- * org.eclipse.wst.css.core.util.declaration.ICSS2Properties
- * @param top
- * java.lang.String
- * @param right
- * java.lang.String
- * @param bottom
- * java.lang.String
- * @param left
- * java.lang.String
- * @param removeCheck
- * boolean
- */
- void set(ICSS2Properties properties, String top, String right, String bottom, String left, boolean removeCheck) {
- if (top == null || top.length() == 0)
- top = IValID.V_AUTO;
- if (right == null || right.length() == 0)
- right = IValID.V_AUTO;
- if (bottom == null || bottom.length() == 0)
- bottom = IValID.V_AUTO;
- if (left == null || left.length() == 0)
- left = IValID.V_AUTO;
-
- if (removeCheck && top.trim().equalsIgnoreCase(IValID.V_AUTO) && right.trim().equalsIgnoreCase(IValID.V_AUTO) && bottom.trim().equalsIgnoreCase(IValID.V_AUTO) && left.trim().equalsIgnoreCase(IValID.V_AUTO)) {
- properties.set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), null);
- }
- else
- properties.set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), "rect(" + top + ", " + right + ", " + bottom + ", " + left + ")");//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java
deleted file mode 100644
index 915c107f64..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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.PropCMSubProperty;
-
-/**
- * For top value of 'clip' property's rect() function
- */
-public class ClipTopSubStyleAdapter extends ClipSubStyleAdapter {
-
- /**
- *
- */
- public ClipTopSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- String get(org.w3c.dom.css.Rect rect) {
- return rect.getTop().getCssText();
- }
-
- /**
- *
- */
- int index() {
- return 0;
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
- String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
- String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
- set(properties, value, right, bottom, left, value == null || value.length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java
deleted file mode 100644
index 4e848e34da..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java
+++ /dev/null
@@ -1,240 +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.IValID;
-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 'font' property 'font' will be expanded to 'font-family', 'font-size',
- * 'font-style', 'font-variant', 'font-weight', 'line-height',
- */
-public class FontShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public FontShorthandAdapter() {
- 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 style = null, variant = null, weight = null, size = null, height = null, family = null;
- PropCMProperty propFont = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
- PropCMProperty propVariant = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
- PropCMProperty propWeight = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
- PropCMProperty propSize = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
- boolean bNormalSpecified = false;
-
- int i = 0;
- for (; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- // first of all, check font idents
- if (i == 0) {
- for (int j = 0; j < propFont.getNumChild(); j++) {
- Object obj = propFont.getChildAt(i);
- if (obj instanceof String && tokens[i].image.compareToIgnoreCase(obj.toString()) == 0)
- return false;
- }
- }
- // value "normal" is shared !!
- if (tokens[i].image.equalsIgnoreCase(IValID.V_NORMAL)) {
- bNormalSpecified = true;
- }
- else {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propVariant.canHave(tokens[i].image))
- variant = tokens[i].image;
- else if (propWeight.canHave(tokens[i].image))
- weight = tokens[i].image;
- else if (propSize.canHave(tokens[i].image)) {
- size = tokens[i].image;
- break; // if size found, break loop
- }
- }
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER && weight == null && propWeight.canHave(tokens[i].image)) {
- weight = tokens[i].image;
- }
- 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) {
- size = tokens[i].image;
- break; // if size found, break loop
- }
- }
-
- if (bNormalSpecified) {
- if (style == null)
- style = IValID.V_NORMAL;
- if (variant == null)
- variant = IValID.V_NORMAL;
- if (weight == null)
- weight = IValID.V_NORMAL;
- }
-
- // skip whitespace
- for (i++; i < tokens.length; i++) {
- if (tokens[i].kind != CSSRegionContexts.CSS_S || tokens[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S)
- break;
- }
-
- // line-height ?
- if (i < tokens.length && tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && tokens[i].image.equals("/")) { //$NON-NLS-1$
- for (i++; i < tokens.length; i++) {
- if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- height = tokens[i++].image;
- break;
- }
- }
- }
-
- // font-family
- StringBuffer buf = new StringBuffer();
- for (; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT)
- buf.append(" ");//$NON-NLS-1$
- else
- buf.append(tokens[i].image);
- }
- family = buf.toString().trim();
-
- dest.set(PropCMProperty.P_FONT_STYLE, style);
- dest.set(PropCMProperty.P_FONT_VARIANT, variant);
- dest.set(PropCMProperty.P_FONT_WEIGHT, weight);
- dest.set(PropCMProperty.P_FONT_SIZE, size);
- dest.set(PropCMProperty.P_LINE_HEIGHT, height);
- dest.set(PropCMProperty.P_FONT_FAMILY, family);
-
- 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 style = null, variant = null, weight = null, size = null, height = null, family = null;
- PropCMProperty propFont = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
- PropCMProperty propVariant = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
- PropCMProperty propWeight = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
- PropCMProperty propSize = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
- PropCMProperty propHeight = PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT);
- PropCMProperty propFamily = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY);
- boolean bNormalSpecified = false;
-
- int i = 0;
- for (; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- // first of all, check font idents
- if (i == 0) {
- for (int j = 0; j < propFont.getNumChild(); j++) {
- Object obj = propFont.getChildAt(i);
- if (obj instanceof String && tokens[i].image.compareToIgnoreCase(obj.toString()) == 0)
- return null;
- }
- }
- // value "normal" is shared !!
- if (tokens[i].image.equalsIgnoreCase(IValID.V_NORMAL)) {
- bNormalSpecified = true;
- }
- else {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propVariant.canHave(tokens[i].image))
- variant = tokens[i].image;
- else if (propWeight.canHave(tokens[i].image))
- weight = tokens[i].image;
- else if (propSize.canHave(tokens[i].image)) {
- size = tokens[i].image;
- break; // if size found, break loop
- }
- }
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER && weight == null && propWeight.canHave(tokens[i].image)) {
- weight = tokens[i].image;
- }
- 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) {
- size = tokens[i].image;
- break; // if size found, break loop
- }
- }
-
- if (bNormalSpecified) {
- if (style == null)
- style = IValID.V_NORMAL;
- if (variant == null)
- variant = IValID.V_NORMAL;
- if (weight == null)
- weight = IValID.V_NORMAL;
- }
-
- // skip whitespace
- for (i++; i < tokens.length; i++) {
- if (tokens[i].kind != CSSRegionContexts.CSS_S || tokens[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S)
- break;
- }
-
- // line-height ?
- if (i < tokens.length && tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && tokens[i].image.equals("/")) { //$NON-NLS-1$
- for (i++; i < tokens.length; i++) {
- if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- height = tokens[i++].image;
- break;
- }
- }
- }
-
- // font-family
- StringBuffer buf = new StringBuffer();
- for (; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT)
- buf.append(" ");//$NON-NLS-1$
- else
- buf.append(tokens[i].image);
- }
- family = buf.toString().trim();
-
- if (propStyle == propDest)
- return style;
- else if (propVariant == propDest)
- return variant;
- else if (propWeight == propDest)
- return weight;
- else if (propSize == propDest)
- return size;
- else if (propHeight == propDest)
- return height;
- else if (propFamily == propDest)
- return family;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java
deleted file mode 100644
index 0bf6432f6d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java
+++ /dev/null
@@ -1,127 +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.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.w3c.dom.css.CSS2Properties;
-
-
-/**
- *
- */
-public interface ICSS2Properties extends CSS2Properties {
-
- /**
- *
- */
- void applyFull(ICSSStyleDeclaration decl);
-
- /**
- *
- */
- void applyModified(ICSSStyleDeclaration decl);
-
- /**
- *
- */
- String get(PropCMProperty prop);
-
- /**
- *
- */
- String getBackgroundPositionX();
-
- /**
- *
- */
- String getBackgroundPositionY();
-
- /**
- *
- */
- String getClipBottom();
-
- /**
- *
- */
- String getClipLeft();
-
- /**
- *
- */
- String getClipRight();
-
- /**
- *
- */
- String getClipTop();
-
- /**
- *
- */
- boolean isModified();
-
- /**
- *
- */
- Enumeration properties();
-
- /**
- *
- */
- Iterator propertiesModified();
-
- /**
- *
- */
- void resetModified();
-
- /**
- *
- */
- void set(PropCMProperty prop, String value) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setBackgroundPositionX(String backgroundPosition) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setBackgroundPositionY(String backgroundPosition) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setClipBottom(String backgroundPosition) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setClipLeft(String backgroundPosition) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setClipRight(String backgroundPosition) throws org.w3c.dom.DOMException;
-
- /**
- *
- */
- void setClipTop(String backgroundPosition) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java
deleted file mode 100644
index a1d405c97e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.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.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-
-/**
- *
- */
-public interface IShorthandAdapter {
-
- /**
- *
- */
- boolean expand(String source, CSSPropertyContext dest);
-
- /**
- *
- */
- String extract(String source, PropCMProperty propDest);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java
deleted file mode 100644
index e169f0dd9c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.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.util.declaration;
-
-
-
-/**
- *
- */
-public interface ISubPropertyAdapter {
-
- /**
- *
- */
- String get(ICSS2Properties properties);
-
- /**
- *
- */
- void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java
deleted file mode 100644
index 97132742f5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java
+++ /dev/null
@@ -1,110 +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 'list-style' property 'list-style' will be expanded to
- * 'list-style-image', 'list-style-position', 'list-style-type',
- */
-public class ListStyleShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public ListStyleShorthandAdapter() {
- 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 image = "", pos = "", type = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
- PropCMProperty propType = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
- PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propPos.canHave(tokens[i].image))
- pos = tokens[i].image;
- else { // value="none" is shared !!
- if (propType.canHave(tokens[i].image))
- type = tokens[i].image;
- if (propImage.canHave(tokens[i].image))
- image = tokens[i].image;
- }
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- image = tokens[i].image;
- }
- }
-
- dest.set(propPos.getName(), pos);
- dest.set(propType.getName(), type);
- dest.set(propImage.getName(), image);
-
- 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 image = null, pos = null, type = null;
- PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
- PropCMProperty propType = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
- PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propPos.canHave(tokens[i].image))
- pos = tokens[i].image;
- else { // value="none" is shared !!
- if (propType.canHave(tokens[i].image))
- type = tokens[i].image;
- if (propImage.canHave(tokens[i].image))
- image = tokens[i].image;
- }
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- image = tokens[i].image;
- }
- }
-
- if (propPos == propDest)
- return pos;
- else if (propType == propDest)
- return type;
- else if (propImage == propDest)
- return image;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java
deleted file mode 100644
index d3cf1e7ccb..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java
+++ /dev/null
@@ -1,129 +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 'margin' property 'margin' will be expanded to 'margin-top',
- * 'margin-right', 'margin-bottom', 'margin-left',
- */
-public class MarginShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public MarginShorthandAdapter() {
- 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 (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_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
- 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_MARGIN_TOP, dests[0]);
- dest.set(PropCMProperty.P_MARGIN_RIGHT, dests[1]);
- dest.set(PropCMProperty.P_MARGIN_BOTTOM, dests[2]);
- dest.set(PropCMProperty.P_MARGIN_LEFT, 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 (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_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
- 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_MARGIN_TOP || propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
- return idents[0];
- else
- return idents[1];
- }
- else if (j == 3) {
- if (propDest.getName() == PropCMProperty.P_MARGIN_TOP)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
- return idents[2];
- else
- return idents[1];
- }
- else {
- if (propDest.getName() == PropCMProperty.P_MARGIN_TOP)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_MARGIN_RIGHT)
- return idents[1];
- else if (propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
- return idents[2];
- else if (propDest.getName() == PropCMProperty.P_MARGIN_LEFT)
- return idents[3];
- else
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java
deleted file mode 100644
index ce2436d561..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java
+++ /dev/null
@@ -1,129 +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 'padding' property 'padding' will be expanded to 'padding-top',
- * 'padding-right', 'padding-bottom', 'padding-left',
- */
-public class PaddingShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public PaddingShorthandAdapter() {
- 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 (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)
- 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_PADDING_TOP, dests[0]);
- dest.set(PropCMProperty.P_PADDING_RIGHT, dests[1]);
- dest.set(PropCMProperty.P_PADDING_BOTTOM, dests[2]);
- dest.set(PropCMProperty.P_PADDING_LEFT, 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 (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)
- 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_PADDING_TOP || propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
- return idents[0];
- else
- return idents[1];
- }
- else if (j == 3) {
- if (propDest.getName() == PropCMProperty.P_PADDING_TOP)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
- return idents[2];
- else
- return idents[1];
- }
- else {
- if (propDest.getName() == PropCMProperty.P_PADDING_TOP)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_PADDING_RIGHT)
- return idents[1];
- else if (propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
- return idents[2];
- else if (propDest.getName() == PropCMProperty.P_PADDING_LEFT)
- return idents[3];
- else
- return null;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java
deleted file mode 100644
index c5282f80ac..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.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.util.declaration;
-
-
-
-/**
- *
- */
-public class ValueData {
-
- public String value;
- public boolean important = false;
-
- /**
- *
- */
- public ValueData() {
- super();
- }
-
- /**
- *
- */
- public ValueData(String val, boolean imp) {
- super();
- value = val;
- important = imp;
- }
-
- /**
- *
- */
- public String toString() {
- return value;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
deleted file mode 100644
index ea73d73cdf..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
+++ /dev/null
@@ -1,25 +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.wst.css.core.text;
-
-
-/**
- * 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.
- *
- * @since 1.1
- */
-public interface ICSSPartitions {
-
- String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$
- String COMMENT = "org.eclipse.wst.css.COMMENT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/.classpath b/bundles/org.eclipse.wst.css.ui/.classpath
deleted file mode 100644
index 8c862926a0..0000000000
--- a/bundles/org.eclipse.wst.css.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.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/css/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/xml/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/html/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/sse/internal/contentproperties/IContentSettings" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/componentcore/internal/util/IModuleConstants" />
- <accessrule kind="accessible"
- pattern="org/eclipse/jem/internal/util/emf/workbench/nls/EMFWorkbenchResourceHandler" />
- </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.ui/.cvsignore b/bundles/org.eclipse.wst.css.ui/.cvsignore
deleted file mode 100644
index 1037f8b270..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-csseditor.jar
-temp.folder
-build.xml
-dev.properties
-bin
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.css.ui/.options b/bundles/org.eclipse.wst.css.ui/.options
deleted file mode 100644
index 1af0b5868b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.css.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.css.ui/.project b/bundles/org.eclipse.wst.css.ui/.project
deleted file mode 100644
index d42035fc37..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.css.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.css.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.wst.css.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4174c191d2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Wed Mar 28 03:20:41 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.wst.css.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.css.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.wst.css.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.css.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.wst.css.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 982c3be8bf..0000000000
--- a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,51 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.css.ui; singleton:=true
-Bundle-Version: 1.0.600.qualifier
-Bundle-Activator: org.eclipse.wst.css.ui.internal.CSSUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.css.ui,
- org.eclipse.wst.css.ui.internal;x-internal:=true,
- org.eclipse.wst.css.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentoutline;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.css.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.edit.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.css.ui.internal.handlers;x-internal:=true,
- org.eclipse.wst.css.ui.internal.image;x-internal:=true,
- org.eclipse.wst.css.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.css.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.css.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.css.ui.internal.properties;x-internal:=true,
- org.eclipse.wst.css.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.css.ui.internal.selection;x-internal:=true,
- org.eclipse.wst.css.ui.internal.style;x-internal:=true,
- org.eclipse.wst.css.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.css.ui.internal.text;x-internal:=true,
- org.eclipse.wst.css.ui.internal.wizard;x-internal:=true,
- org.eclipse.wst.css.ui.views.contentoutline,
- org.eclipse.wst.css.ui.views.properties
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.css.ui/about.html b/bundles/org.eclipse.wst.css.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.css.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.wst.css.ui/build.properties b/bundles/org.eclipse.wst.css.ui/build.properties
deleted file mode 100644
index 73f9b411a7..0000000000
--- a/bundles/org.eclipse.wst.css.ui/build.properties
+++ /dev/null
@@ -1,22 +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
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- META-INF/,\
- .,\
- .options,\
- templates/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = src/
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif b/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif
deleted file mode 100644
index d94f752f10..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif b/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif
deleted file mode 100644
index ab287a5d2b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
deleted file mode 100644
index df1704e435..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
deleted file mode 100644
index 7c050f5090..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
deleted file mode 100644
index 0e93844d92..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
deleted file mode 100644
index f924d7a684..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
deleted file mode 100644
index 5ca230b289..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
deleted file mode 100644
index 2133ded0bd..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
deleted file mode 100644
index ede58abb89..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
deleted file mode 100644
index 6cd12dada0..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
deleted file mode 100644
index 2adbdd83b2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
deleted file mode 100644
index 308a3ae841..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
deleted file mode 100644
index aca5f8920b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
deleted file mode 100644
index 71f59e8b7a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
deleted file mode 100644
index f0857d284f..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
deleted file mode 100644
index 94d89cd59e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
deleted file mode 100644
index d85b78f29d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
deleted file mode 100644
index 3391f19bee..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
deleted file mode 100644
index 920c228d4a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
deleted file mode 100644
index 525f64bc57..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
deleted file mode 100644
index 6b635b03d8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
deleted file mode 100644
index 1b6a6dc6aa..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
deleted file mode 100644
index 3176ff8c5c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
deleted file mode 100644
index d8fde00545..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
deleted file mode 100644
index bcc76cd635..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif
deleted file mode 100644
index 5d1f81b6d4..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
deleted file mode 100644
index 69850faf9a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
deleted file mode 100644
index abf63f8568..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
deleted file mode 100644
index 99a8b96f98..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
deleted file mode 100644
index 857e4e50ee..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
deleted file mode 100644
index c1a8b34ed8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.png b/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.png
deleted file mode 100644
index c88e63fd29..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.properties b/bundles/org.eclipse.wst.css.ui/plugin.properties
deleted file mode 100644
index e1551c89b8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.properties
+++ /dev/null
@@ -1,82 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=SSE CSS Source Editor
-CSS_Source_Page_Editor.name=CSS Editor
-CSS_Files.name=CSS Files
-CSS_Source.name=Editor
-CSS_Content_Assist.name=Content Assist
-CSS_Styles.name=Styles
-CSS_Templates.name=Templates
-CSS_Syntax_Coloring=Syntax Coloring
-WebContentSettings.name=Web Content Settings
-###############################################################################
-# The following property keys maybe unused. Commented out on 12/7/2004. Uncomment if needed.
-#CSS_Annotations.name=CSS Annotations
-
-
-#org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = CSS File
-_UI_WIZARD_CREATE_NEW_FILE = Create a new CSS file
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-##
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-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
-##
-All_CSS_context_type_Extension_Element.name=All CSS
-CSS_New_context_type_Extension_Element.name=New CSS
-##
-preferenceKeywords.files=editor css creating saving files suffix specified encoding iana
-preferenceKeywords.source=editor css source formatting line width insert break properties wrapping style attribute html indent tabs spaces size capitalization identifier property name value uppercase lowercase
-preferenceKeywords.contentassist=editor css content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
-preferenceKeywords.templates=editor css templates snippet macros
-preferenceKeywords.styles=editor css style customize syntax highlighting type text content foreground background bold color
-preferenceKeywords.webcontent=editor css web content settings profile style
-
-scope.structured.text.editor.css.name=Editing CSS Source
-scope.structured.text.editor.css.description=Editing CSS Source
-
-Colors.atmarkRule=At Mark Rule
-Colors.selector=Selector
-Colors.media=Media
-Colors.comment=Comment
-Colors.propertyName=Property Name
-Colors.propertyValue=Property Value
-Colors.uri=URI
-Colors.string=String
-Colors.error=Error
-Colors.combinator=Combinator
-Colors.pseudo=Pseudo-class
-Colors.attrValue=Attribute Value
-Colors.attrOp=Attribute Operator
-Colors.attrName=Attribute Name
-Colors.attrDelim=Attribute Delimiter
-Colors.universal=Universal Selector
-Colors.class=Class selector
-Colors.id=ID Selector
-
-proposalCategory.css=CSS Proposals
-proposalCategory.cssTemplates=CSS Template Proposals
-
-proposalInfo.name=Additional Proposal Information
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.xml b/bundles/org.eclipse.wst.css.ui/plugin.xml
deleted file mode 100644
index a18de713b0..0000000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.xml
+++ /dev/null
@@ -1,690 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="proposalInfo" name="%proposalInfo.name" schema="schema/proposalInfo.exsd"/>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%CSS_Source_Page_Editor.name"
- icon="$nl$/icons/full/obj16/sourceEditor.gif"
- contributorClass="org.eclipse.wst.css.ui.internal.ActionContributorCSS"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.css.core.csssource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.css.core.csssource" />
- </editor>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
- target="org.eclipse.wst.css.core.csssource" />
- <quickOutlineConfiguration
- class="org.eclipse.wst.css.ui.views.contentoutline.CSSQuickOutlineConfiguration"
- target="org.eclipse.wst.css.core.csssource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
- target="org.eclipse.wst.css.core.csssource" />
- <propertySheetConfiguration
- class="org.eclipse.wst.css.ui.views.properties.CSSPropertySheetConfiguration"
- target="org.eclipse.wst.css.core.csssource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.css.core.csssource" />
- <provisionalConfiguration
- type="foldingstrategy"
- class="org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy"
- target="org.eclipse.wst.css.core.csssource" />
- <provisionalConfiguration
- type="autoeditstrategy"
- class="org.eclipse.wst.css.ui.internal.autoedit.StructuredAutoEditStrategyCSS"
- target="org.eclipse.wst.css.STYLE" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.css.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, org.eclipse.wst.sse.ui.preferences.css.contentassist"
- target="org.eclipse.wst.css.core.csssource" />
- <provisionalDefinition
- type="spellingregions"
- value="COMMENT"
- target="org.eclipse.wst.css.core.csssource" />
- <provisionalDefinition
- type="activecontexts"
- value="org.eclipse.wst.css.core.csssource, org.eclipse.wst.sse.comments"
- target="org.eclipse.wst.css.core.csssource" />
- </extension>
-
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structured.text.editor.css.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.css.description"
- id="org.eclipse.wst.css.core.csssource">
- </context>
- </extension>
-
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.css.ui.internal.registry.AdapterFactoryProviderCSS">
- <contentType id="org.eclipse.wst.css.core.csssource" />
- </adapterFactoryDescription>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.css.core.csssource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="%CSS_Files.name"
- category="org.eclipse.wst.html.ui.preferences.web"
- class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSFilesPreferencePage"
- id="org.eclipse.wst.css.ui.preferences.css">
- <keywordReference id="org.eclipse.wst.css.ui.files"/>
- </page>
- <page
- name="%CSS_Source.name"
- category="org.eclipse.wst.css.ui.preferences.css"
- class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSSourcePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.css.source">
- <keywordReference id="org.eclipse.wst.css.ui.source"/>
- </page>
- <page
- category="org.eclipse.wst.sse.ui.preferences.css.source"
- class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSContentAssistPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.css.contentassist"
- name="%CSS_Content_Assist.name">
- <keywordReference
- id="org.eclipse.wst.css.ui.contentassist">
- </keywordReference>
- </page>
- <page
- name="%CSS_Templates.name"
- category="org.eclipse.wst.sse.ui.preferences.css.source"
- class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSTemplatePreferencePage"
- id="org.eclipse.wst.css.ui.preferences.templates">
- <keywordReference id="org.eclipse.wst.css.ui.templates"/>
- </page>
- <page
- name="%CSS_Syntax_Coloring"
- category="org.eclipse.wst.sse.ui.preferences.css.source"
- class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSSyntaxColoringPage"
- id="org.eclipse.wst.sse.ui.preferences.css.styles">
- <keywordReference id="org.eclipse.wst.css.ui.styles"/>
- </page>
- </extension>
-
- <!-- CSS Content Settings Property Page -->
- <extension point="org.eclipse.ui.propertyPages">
- <page
- name="%WebContentSettings.name"
- class="org.eclipse.wst.css.ui.internal.contentproperties.ui.CSSWebContentSettingsPropertyPage"
- id="org.eclipse.wst.css.ui.internal.contentproperties.CSSWebContentSettingsPropertyPage.css">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IFile">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.wst.css.core.csssource" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- <keywordReference id="org.eclipse.wst.css.ui.webcontent"/>
- </page>
- </extension>
-
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.files"
- id="org.eclipse.wst.css.ui.files"/>
- <keyword
- label="%preferenceKeywords.source"
- id="org.eclipse.wst.css.ui.source"/>
- <keyword
- label="%preferenceKeywords.templates"
- id="org.eclipse.wst.css.ui.templates"/>
- <keyword
- label="%preferenceKeywords.styles"
- id="org.eclipse.wst.css.ui.styles"/>
- <keyword
- label="%preferenceKeywords.webcontent"
- id="org.eclipse.wst.css.ui.webcontent"/>
- <keyword
- id="org.eclipse.wst.css.ui.contentassist"
- label="%preferenceKeywords.contentassist">
- </keyword>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.wst.css.core.csssource.source"></part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.css.core.csssource.source"></part>
- </actionSetPartAssociation>
- </extension>
-
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.wst.css.core.internal.provisional.document.ICSSModel"
- class="org.eclipse.wst.css.ui.internal.editor.CSSSelectionConverterFactory">
- <adapter
- type="org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor"/>
- </factory>
- </extension>
-
- <!-- initialize css ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.css.ui.internal.preferences.CSSUIPreferenceInitializer" />
- </extension>
-
- <!-- New CSS wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <wizard
- id="org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard"
- name="%_UI_WIZARD_NAME"
- class="org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard"
- category="org.eclipse.wst.web.ui"
- icon="$nl$/icons/full/etool16/newcss_wiz.gif">
- <description>%_UI_WIZARD_CREATE_NEW_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="menu:edit?after=additions">
- <command commandId="org.eclipse.ui.edit.text.contentAssist.proposals" id="CSSContentAssist" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.css.core.csssource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
-
- <!-- Templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%All_CSS_context_type_Extension_Element.name"
- class="org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeCSS"
- id="css_all">
- </contextType>
- <contextType
- name="%CSS_New_context_type_Extension_Element.name"
- class="org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeCSS"
- id="css_new">
- </contextType>
- <include
- file="templates/cssdefault-templates.xml"
- translations="$nl$/templates/cssdefault-templates.properties">
- </include>
- </extension>
-
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.css.ui.internal.handlers.CleanupDocumentHandler"
- commandId="org.eclipse.wst.sse.ui.cleanup.document">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.css.ui.internal.handlers.StructuredSelectEnclosingHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.enclosing">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.css.ui.internal.handlers.StructuredSelectNextHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.next">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.css.ui.internal.handlers.StructuredSelectPreviousHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.previous">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </enabledWhen>
- </handler>
- <!-- TODO Use the handler from SSE or XML's declaration -->
- <handler
- class="org.eclipse.wst.sse.ui.internal.handlers.StructuredSelectHistoryHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.last">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
- </enabledWhen>
- </handler>
- </extension>
-
- <!-- CSS editor actions -->
- <extension point="org.eclipse.ui.editorActions">
- <!--<editorContribution
- id="org.eclipse.wst.css.core.csssource.source.editorActions"
- targetID="org.eclipse.wst.css.core.csssource.source">
- <action
- id="CleanupDocument"
- label="%CleanupDocument_label"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- tooltip="%CleanupDocument_tooltip"
- class="org.eclipse.wst.css.ui.internal.edit.ui.CleanupActionCSSDelegate"
- actionID="CleanupDocument">
- </action>
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.css.ui.internal.selection.StructuredSelectEnclosingCSSActionDelegate"
- 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.css.ui.internal.selection.StructuredSelectNextCSSActionDelegate"
- 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.css.ui.internal.selection.StructuredSelectPreviousCSSActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>-->
- <editorContribution
- targetID="org.eclipse.wst.css.core.csssource.source"
- id="org.eclipse.wst.css.core.csssource.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.core.expressions.definitions">
- <definition id="org.eclipse.wst.css.ui.cssSourceContributions.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.css.core.csssource"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <!-- Define theme -->
- <extension
- point="org.eclipse.ui.themes">
- <theme
- id="org.eclipse.ui.ide.systemDefault">
- <colorOverride
- id="ATMARK_RULE"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="SELECTOR"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="MEDIA"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="COMMENT"
- value="COLOR_LIST_SELECTION">
- </colorOverride>
- <colorOverride
- id="PROPERTY_NAME"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="PROPERTY_VALUE"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="URI"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="STRING"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ERROR"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="UNIVERSAL"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ID"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="CLASS"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ATTRIBUTE_DELIM"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ATTRIBUTE_NAME"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ATTRIBUTE_OPERATOR"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="ATTRIBUTE_VALUE"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="PSEUDO"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="COMBINATOR"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- </theme>
- <colorDefinition
- id="ATMARK_RULE"
- isEditable="false"
- label="%Colors.atmarkRule"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="SELECTOR"
- isEditable="false"
- label="%Colors.selector"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="MEDIA"
- isEditable="false"
- label="%Colors.media"
- value="42, 0, 225">
- </colorDefinition>
- <colorDefinition
- id="COMMENT"
- isEditable="false"
- label="%Colors.comment"
- value="63, 95, 191">
- </colorDefinition>
- <colorDefinition
- id="PROPERTY_NAME"
- isEditable="false"
- label="%Colors.propertyName"
- value="127, 0, 127">
- </colorDefinition>
- <colorDefinition
- id="PROPERTY_VALUE"
- isEditable="false"
- label="%Colors.propertyValue"
- value="42, 0, 225">
- </colorDefinition>
- <colorDefinition
- id="URI"
- isEditable="false"
- label="%Colors.uri"
- value="42, 0, 225">
- </colorDefinition>
- <colorDefinition
- id="STRING"
- isEditable="false"
- label="%Colors.string"
- value="42, 0, 225">
- </colorDefinition>
- <colorDefinition
- id="ERROR"
- isEditable="false"
- label="%Colors.error"
- value="191, 63, 63">
- </colorDefinition>
- <colorDefinition
- id="UNIVERSAL"
- isEditable="false"
- label="%Colors.universal"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="ID"
- isEditable="false"
- label="%Colors.id"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="CLASS"
- isEditable="false"
- label="%Colors.class"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="ATTRIBUTE_DELIM"
- isEditable="false"
- label="%Colors.attrDelim"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="ATTRIBUTE_NAME"
- isEditable="false"
- label="%Colors.attrName"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="ATTRIBUTE_OPERATOR"
- isEditable="false"
- label="%Colors.attrOp"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="ATTRIBUTE_VALUE"
- isEditable="false"
- label="%Colors.attrValue"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="PSEUDO"
- isEditable="false"
- label="%Colors.pseudo"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="COMBINATOR"
- isEditable="false"
- label="%Colors.combinator"
- value="63, 127, 127">
- </colorDefinition>
- </extension>
-
- <!-- Enable the FormatHandler for CSS 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.css.ui.cssContentType.definition"></reference>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.css.ui.cssContentType.definition"></reference>
- </enabledWhen>
- </handler>
- </extension>
-
- <!-- Set up a definition for CSS Content Types -->
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.css.ui.cssContentType.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.wst.css.core.csssource" forcePluginActivation="true"/>
- </adapt>
- </iterate>
- </definition>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.wst.html.css.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource"
- partitions="org.eclipse.wst.css.STYLE">
- </contentTypeIdentifier>
- </inserter>
- <inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.wst.css.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.wst.css.core.csssource"
- partitions="org.eclipse.wst.css.STYLE">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.commentingStrategy">
- <blockCommentingStrategy
- prefix="/*"
- suffix="*/">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </requiredPartitionTypes>
- </contentType>
- <contentType
- associatedCommentPartitionTypeID="org.eclipse.wst.css.COMMENT"
- id="org.eclipse.wst.css.core.csssource">
- <allowablePartitionTypes
- anyPartitionType="true">
- </allowablePartitionTypes>
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </requiredPartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalCategory
- icon="icons/full/obj16/tag_selector.gif"
- id="org.eclipse.wst.css.ui.proposalCategory.css"
- name="%proposalCategory.css">
- </proposalCategory>
- <proposalCategory
- icon="icons/full/obj16/tag-template.gif"
- id="org.eclipse.wst.css.ui.proposalCategory.cssTemplates"
- name="%proposalCategory.cssTemplates">
- </proposalCategory>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.css.ui.proposalCategory.css"
- class="org.eclipse.wst.css.ui.internal.contentassist.CSSCompletionProposalComputer"
- id="org.eclipse.wst.css.ui.proposalComputer.css">
- <contentType
- id="org.eclipse.wst.css.core.csssource">
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.css.ui.proposalCategory.cssTemplates"
- class="org.eclipse.wst.css.ui.internal.contentassist.CSSTemplatesCompletionProposalComputer"
- id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
- <contentType
- id="org.eclipse.wst.css.core.csssource">
- </contentType>
- </proposalComputer>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
- <categoriesConfiguration
- class="org.eclipse.wst.css.ui.internal.preferences.CSSCompletionProposalCategoriesConfiguration"
- contentTypeID="org.eclipse.wst.css.core.csssource">
- </categoriesConfiguration>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.ui/schema/proposalInfo.exsd b/bundles/org.eclipse.wst.css.ui/schema/proposalInfo.exsd
deleted file mode 100644
index 6f7066ea3a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/schema/proposalInfo.exsd
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.css.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.css.ui" id="proposalInfo" name="CSS Proposal Information"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element internal="true" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="proposalInfo"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="proposalInfo">
- <annotation>
- <documentation>
- Additional proposal information for CSS content assist proposals.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Class that implements IProposalInfo that will server as additional proposal information for CSS content assist proposals. The implementation must provide a zero-argument constructor.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
deleted file mode 100644
index 2afea5f847..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSStructuredContentAssistProcessor;
-import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForCSS;
-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;
-
-/**
- * Configuration for a source viewer which shows CSS.
- * <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 StructuredTextViewerConfigurationCSS 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 fLineStyleProviderForCSS;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationCSS
- */
- public StructuredTextViewerConfigurationCSS() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[0]);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- fConfiguredContentTypes = new String[]{ICSSPartitions.STYLE, ICSSPartitions.COMMENT, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
- }
- return fConfiguredContentTypes;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
- * org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor processor = new CSSStructuredContentAssistProcessor(
- this.getContentAssistant(), partitionType, sourceViewer);
- return new IContentAssistProcessor[]{processor};
- }
-
- 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), ICSSPartitions.STYLE);
-
- ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS()));
-
- return formatter;
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- Vector vector = new Vector();
-
- // prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
- String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
- boolean useSpaces = CSSCorePreferenceNames.SPACE.equals(indentCharPref);
-
- for (int i = 0; i <= indentationWidth; i++) {
- StringBuffer prefix = new StringBuffer();
- boolean appendTab = false;
-
- if (useSpaces) {
- for (int j = 0; j + i < indentationWidth; j++)
- prefix.append(' ');
-
- if (i != 0)
- appendTab = true;
- }
- else {
- for (int j = 0; j < i; j++)
- prefix.append(' ');
-
- if (i != indentationWidth)
- appendTab = true;
- }
-
- if (appendTab) {
- prefix.append('\t');
- vector.add(prefix.toString());
- // remove the tab so that indentation - tab is also an indent
- // prefix
- prefix.deleteCharAt(prefix.length() - 1);
- }
- vector.add(prefix.toString());
- }
-
- vector.add(""); //$NON-NLS-1$
-
- return (String[]) vector.toArray(new String[vector.size()]);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
-
- if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
- providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
- }
-
- return providers;
- }
-
- private LineStyleProvider getLineStyleProviderForCSS() {
- if (fLineStyleProviderForCSS == null) {
- fLineStyleProviderForCSS = new LineStyleProviderForCSS();
- }
- return fLineStyleProviderForCSS;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java
deleted file mode 100644
index d7b45af582..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java
+++ /dev/null
@@ -1,121 +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.ui.internal;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-
-/**
- * ActionContributorCSS
- *
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- *
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorCSS extends ActionContributor {
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.css.core.csssource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- protected RetargetTextEditorAction fContentAssist = null;
- protected RetargetTextEditorAction fCleanupDocument = null;
- protected RetargetTextEditorAction fFormatDocument = null;
- protected RetargetTextEditorAction fFormatActiveElements = null;
-
- public ActionContributorCSS() {
- super();
-
- ResourceBundle resourceBundle = CSSUIMessages.getResourceBundle();
-
- // edit commands
- fContentAssist = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-
- // source commands
- fCleanupDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fCleanupDocument.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
-
- fFormatDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatDocument.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-
- fFormatActiveElements = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatActiveElements.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
- }
-
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
- protected void addToMenu(IMenuManager menu) {
- // edit commands
- IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(fCommandsSeparator);
- editMenu.add(fToggleInsertModeAction);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fExpandSelectionToMenu);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fContentAssist);
- editMenu.add(fMenuAdditionsGroupMarker);
- }
-
- // source commands
- String sourceMenuLabel = CSSUIMessages.SourceMenu_label;
- String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
- IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
- if (sourceMenu != null) {
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fShiftRight);
- sourceMenu.add(fShiftLeft);
- sourceMenu.add(fCleanupDocument);
- sourceMenu.add(fFormatDocument);
- sourceMenu.add(fFormatActiveElements);
- sourceMenu.add(fCommandsSeparator);
- }
- IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
- if (navigateMenu != null) {
- IMenuManager gotoGroup = navigateMenu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
- if (gotoGroup != null) {
- gotoGroup.add(fGotoMatchingBracketAction);
- }
- }
- }
-
- public void setActiveEditor(IEditorPart activeEditor) {
- super.setActiveEditor(activeEditor);
-
- ITextEditor textEditor = getTextEditor(activeEditor);
-
- fContentAssist.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS));
-
- fCleanupDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT));
- fFormatDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT));
- fFormatActiveElements.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS));
- fCleanupDocument.setEnabled(textEditor != null && textEditor.isEditable());
- fFormatDocument.setEnabled(textEditor != null && textEditor.isEditable());
- fFormatActiveElements.setEnabled(textEditor != null && textEditor.isEditable());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
deleted file mode 100644
index 692fed188e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
+++ /dev/null
@@ -1,141 +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 - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class CSSUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.css.ui.internal.CSSUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, CSSUIMessages.class);
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- public static String ID_Selector_Case__UI_;
- public static String INFO_Not_Categorized_1;
- public static String PrefsLabel_WrappingWithoutAttr;
- public static String PrefsLabel_WrappingInsertLineBreak;
- public static String PrefsLabel_CaseGroup;
- public static String PrefsLabel_CaseIdent;
- public static String PrefsLabel_CasePropName;
- public static String PrefsLabel_CasePropValue;
- public static String PrefsLabel_CaseIdentUpper;
- public static String PrefsLabel_CaseIdentLower;
- public static String PrefsLabel_SelectorTagName;
- public static String PrefsLabel_CasePropNameUpper;
- public static String PrefsLabel_CasePropNameLower;
- public static String PrefsLabel_CasePropValueUpper;
- public static String PrefsLabel_CasePropValueLower;
- public static String PrefsLabel_SelectorTagNameUpper;
- public static String PrefsLabel_SelectorTagNameLower;
- public static String PrefsLabel_ColorSample;
- public static String PrefsLabel_ColorNormal;
- public static String PrefsLabel_ColorAtmarkRule;
- public static String PrefsLabel_ColorSelector;
- public static String PrefsLabel_ColorCombinator;
- public static String PrefsLabel_ColorUniversal;
- public static String PrefsLabel_ColorId;
- public static String PrefsLabel_ColorPseudoClass;
- public static String PrefsLabel_ColorClass;
- public static String PrefsLabel_ColorMedia;
- public static String PrefsLabel_ColorComment;
- public static String PrefsLabel_ColorPropertyName;
- public static String PrefsLabel_ColorPropertyValue;
- public static String PrefsLabel_ColorUri;
- public static String PrefsLabel_ColorString;
- public static String PrefsLabel_ColorColon;
- public static String PrefsLabel_ColorSemiColon;
- public static String PrefsLabel_ColorCurlyBrace;
- public static String PrefsLabel_ColorError;
- public static String PrefsLabel_ColorAttrDelimiter;
- public static String PrefsLabel_ColorAttrName;
- public static String PrefsLabel_ColorAttrValue;
- public static String PrefsLabel_ColorAttrOperator;
- public static String SortAction_0;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _ERROR_FILENAME_MUST_END_CSS;
- public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
- public static String Title_InvalidValue;
- public static String Message_InvalidValue;
- public static String FormatMenu_label;
- public static String Class_Selector_Case__UI_;
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String CleanupDocument_description; // resource bundle
- public static String UI_none;
- public static String Cleanup_UI_;
- public static String CSS_Cleanup_UI_;
- public static String ToggleComment_tooltip;
- public static String AddBlockComment_tooltip;
- public static String RemoveBlockComment_tooltip;
- public static String Identifier_case__UI_;
- public static String Property_name_case__UI_;
- public static String Property_value_case__UI_;
- public static String Selector_tag_name_case__UI_;
- public static String Quote_values_UI_;
- public static String Format_source_UI_;
- public static String As_is_UI_;
- public static String Lower_UI_;
- public static String Upper_UI_;
- public static String SourceMenu_label;
- public static String Formatting_UI_;
- public static String Line_width__UI_;
- public static String Indent_using_tabs_;
- public static String Indent_using_spaces;
- public static String Indentation_size;
- public static String Indentation_size_tip;
- public static String StructureSelectEnclosing_label;
- public static String StructureSelectEnclosing_tooltip;
- public static String StructureSelectEnclosing_description;
- public static String StructureSelectNext_label;
- public static String StructureSelectNext_tooltip;
- public static String StructureSelectNext_description;
- public static String StructureSelectPrevious_label;
- public static String StructureSelectPrevious_tooltip;
- public static String StructureSelectPrevious_description;
- public static String Creating_files_encoding;
- public static String ResourceGroup_nameExists;
- public static String NewCSSTemplatesWizardPage_0;
- public static String NewCSSTemplatesWizardPage_1;
- public static String NewCSSTemplatesWizardPage_2;
- public static String NewCSSTemplatesWizardPage_3;
- public static String NewCSSTemplatesWizardPage_4;
- public static String NewCSSTemplatesWizardPage_5;
- public static String NewCSSTemplatesWizardPage_6;
- public static String NewCSSTemplatesWizardPage_7;
- public static String CSSContentSettingsPropertyPage_0;
- public static String CSSContentSettingsPropertyPage_1;
- 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;
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java
deleted file mode 100644
index 1fcef9170a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java
+++ /dev/null
@@ -1,99 +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.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.internal.preferences.CSSUIPreferenceNames;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.css.ui"; //$NON-NLS-1$
- //The shared instance.
- private static CSSUIPlugin plugin;
-
- /**
- * The template store for the css ui.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for css ui.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- /**
- * The constructor.
- */
- public CSSUIPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static CSSUIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the template store for the css editor templates.
- *
- * @return the template store for the css editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), CSSUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the css plugin.
- *
- * @return the template context type registry for the css plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsCSS.ALL);
- registry.addContextType(TemplateContextTypeIdsCSS.NEW);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
deleted file mode 100644
index a47c80764e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
+++ /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
-###############################################################################
-
-ID_Selector_Case__UI_=ID Selector case:
-INFO_Not_Categorized_1=Not Categorized
-
-## CSS Preferences -- source ##
-PrefsLabel_WrappingWithoutAttr=Disable wrapping in style &attribute of HTML
-PrefsLabel_WrappingInsertLineBreak=Insert &line break between properties
-
-PrefsLabel_CaseGroup=Capitalization style
-PrefsLabel_CaseIdent=Identifier:
-PrefsLabel_CasePropName=Property name:
-PrefsLabel_CasePropValue=Property value:
-PrefsLabel_SelectorTagName=Type selector:
-
-PrefsLabel_CaseIdentUpper=&Uppercase
-PrefsLabel_CaseIdentLower=L&owercase
-PrefsLabel_CasePropNameUpper=U&ppercase
-PrefsLabel_CasePropNameLower=Lo&wercase
-PrefsLabel_CasePropValueUpper=Upp&ercase
-PrefsLabel_CasePropValueLower=Lowe&rcase
-PrefsLabel_SelectorTagNameUpper=Upper&case
-PrefsLabel_SelectorTagNameLower=Lowerca&se
-
-## CSS Preferences -- color ##
-
-## The following line is a sample CSS document. Please translate only the following parts:
-## Sample Styles
-PrefsLabel_ColorSample=@import url("../sample2.css");\n\n/* Sample Styles */\n\nBODY {\n\tcolor : black;\n\tbackground-color : rgb(181, 253, 211);\n\ttext-align : center;\n\tfont-family : "Heisei Mincho W3", serif\n}\n\n#content > div *.links a[href~="http://"]:hover {\n\ttext-decoration : underline;\n}\n\n@page :left { margin-left : 4cm }\n\n@media aural {\n\tP.heidi {\n\t\tazimuth : center-left;\n\t\televation : 12.3deg;\n\t\tpause : 30ms 1.6s\n\t}\n}\n
-
-PrefsLabel_ColorNormal=Default
-PrefsLabel_ColorAtmarkRule=At-Rule
-PrefsLabel_ColorSelector=Type Selector
-PrefsLabel_ColorCombinator=Combinator
-PrefsLabel_ColorUniversal=Universal Selector
-PrefsLabel_ColorId=Id Selector
-PrefsLabel_ColorPseudoClass=Pseudo-class
-PrefsLabel_ColorClass=Class Selector
-PrefsLabel_ColorMedia=Media Name
-PrefsLabel_ColorComment=Comment
-PrefsLabel_ColorPropertyName=Property Name
-PrefsLabel_ColorPropertyValue=Property Value
-PrefsLabel_ColorUri=URI
-PrefsLabel_ColorString=Quoted String
-PrefsLabel_ColorColon=Property Delimiter
-PrefsLabel_ColorSemiColon=Semicolon
-PrefsLabel_ColorCurlyBrace=Curly Brace
-PrefsLabel_ColorError=Error
-PrefsLabel_ColorAttrDelimiter=Attribute Selector Delimiter
-PrefsLabel_ColorAttrName=Attribute Name
-PrefsLabel_ColorAttrValue=Attribute Value
-PrefsLabel_ColorAttrOperator=Attribute Selector Operator
-#
-SortAction_0=Sort
-#
-_UI_WIZARD_NEW_TITLE = New CSS File
-_UI_WIZARD_NEW_HEADING = CSS
-_UI_WIZARD_NEW_DESCRIPTION = Create a new CSS file.
-_ERROR_FILENAME_MUST_END_CSS = The file name must end in one of the following extensions {0}.
-_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application.
-#
-Title_InvalidValue=Invalid Value
-Message_InvalidValue=Invalid property value.
-# Copied from sse.ui
-FormatMenu_label=F&ormat
-Class_Selector_Case__UI_=Class Selector case:
-CleanupDocument_label=C&leanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-UI_none=none
-Cleanup_UI_=Cleanup
-CSS_Cleanup_UI_=CSS Cleanup
-AddBlockComment_tooltip=Add Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-ToggleComment_tooltip=Toggle Comment
-Identifier_case__UI_=Identifier case:
-Property_name_case__UI_=Property name case:
-Property_value_case__UI_=Property value case:
-Selector_tag_name_case__UI_=Selector tag name case:
-Quote_values_UI_=Quote values
-Format_source_UI_=&Format source
-As_is_UI_=As-is
-Lower_UI_=Lower
-Upper_UI_=Upper
-SourceMenu_label=&Source
-Formatting_UI_=Formatting
-Line_width__UI_=Line &width:
-Indent_using_tabs_=&Indent using tabs
-Indent_using_spaces=I&ndent using spaces
-Indentation_size=In&dentation size:
-Indentation_size_tip=Indentation size
-StructureSelectEnclosing_label=&Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=&Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=&Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-##
-Creating_files_encoding=Creating files encoding preference
-ResourceGroup_nameExists = The same name already exists.
-NewCSSTemplatesWizardPage_0=Select CSS Template
-NewCSSTemplatesWizardPage_1=Select a template as initial content in the CSS page.
-NewCSSTemplatesWizardPage_2=Name
-NewCSSTemplatesWizardPage_3=Description
-NewCSSTemplatesWizardPage_4=&Use CSS Template
-NewCSSTemplatesWizardPage_5=&Preview:
-NewCSSTemplatesWizardPage_6=Templates are 'New CSS' templates found in the <a>CSS Templates</a> preference page.
-NewCSSTemplatesWizardPage_7=&Templates:
-# CSS Content Settings
-CSSContentSettingsPropertyPage_0=The type of CSS to use. The project setting is used if you specify "none."
-CSSContentSettingsPropertyPage_1=CSS Profile:
-SyntaxColoringPage_0=S&yntax Element:
-SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=&Bold
-SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strikethrough
-SyntaxColoringPage_6=&Underline
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=CSS editing preferences. Note that some preferences may be set on the <a>{0}</a> preference page.
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java
deleted file mode 100644
index 73eba5e3f3..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/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.ui.internal;
-
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.css.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.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
deleted file mode 100644
index 12cd749fbf..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-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.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-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.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.Logger;
-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 StructuredAutoEditStrategyCSS implements IAutoEditStrategy {
- protected IStructuredDocument structuredDocument = null;
-
- class CompoundRegion {
-
- /* textRegion can be null if the offset is at the end of the document */
- CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
- super();
- this.documentRegion = documentRegion;
- this.textRegion = textRegion;
- }
-
- IStructuredDocumentRegion getDocumentRegion() {
- return documentRegion;
- }
-
- ITextRegion getTextRegion() {
- return textRegion;
- }
-
- int getStart() {
- return (textRegion != null) ? textRegion.getStart() : documentRegion.getStart();
- }
-
- int getEnd() {
- return (textRegion != null) ? textRegion.getEnd() : documentRegion.getEnd();
- }
-
- String getType() {
- return (textRegion != null) ? textRegion.getType() : CSSRegionContexts.CSS_UNKNOWN;
- }
-
- String getText() {
- return (textRegion != null) ? documentRegion.getText(textRegion) : ""; //$NON-NLS-1$
- }
-
- int getStartOffset() {
- return (textRegion != null) ? documentRegion.getStartOffset(textRegion) : documentRegion.getStartOffset();
- }
-
- int getEndOffset() {
- return (textRegion != null) ? documentRegion.getEndOffset(textRegion) : documentRegion.getEndOffset();
- }
-
- private IStructuredDocumentRegion documentRegion;
- private ITextRegion textRegion;
-
- }
-
- /**
- */
- protected void autoIndentAfterClose(DocumentCommand command, String regionType) {
- if (!setRangeForClose(command))
- return;
-
- int position = command.offset + command.length;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- // get open brace region
- CompoundRegion region = prevCorrespondence(position, regionType);
-
- // get indentation
- String str = getIndentFor(region, false);
-
- // append to input
- if (str != null)
- command.text = str + command.text;
- }
-
- /**
- * Copies the indentation of the previous line.
- */
- protected void autoIndentAfterNewLine(DocumentCommand command) {
- // select nearest white spaces to replace with new-line
- setRangeForNewLine(command);
-
- // get position
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- IStructuredDocumentRegion prev = getPreviousRegion(position);
- if (prev == null || !CSSRegionContexts.CSS_LBRACE.equals(prev.getType()))
- return;
-
- IStructuredDocumentRegion next = prev.getNext();
-
- // create text to replace
- StringBuffer buf = new StringBuffer(command.text);
- try {
- IRegion line = structuredDocument.getLineInformationOfOffset(position);
- int contentStart = findEndOfWhiteSpace(structuredDocument, position, line.getOffset() + line.getLength());
- command.length = Math.max(contentStart - position, 0);
- buf.append(getIndentString());
- if (next != null && CSSRegionContexts.CSS_RBRACE.equals(next.getType()) && !isOneLine(prev)) {
- command.shiftsCaret = false;
- command.caretOffset = contentStart + buf.length();
- buf.append(TextUtilities.getDefaultLineDelimiter(structuredDocument));
- }
- command.text = buf.toString();
- }
- catch (BadLocationException e) {
- }
-
- }
-
- private boolean isOneLine(IStructuredDocumentRegion prev) {
- return endsWith(structuredDocument.getLegalLineDelimiters(), prev.getFullText()) != -1;
- }
-
- private IStructuredDocumentRegion getPreviousRegion(int offset) {
- IStructuredDocumentRegion prev = null;
- if (offset > 0)
- prev = structuredDocument.getRegionAtCharacterOffset(offset - 1);
- return prev;
- }
-
- /**
- */
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
- return;
-
- // return;
- // /*
- structuredDocument = (IStructuredDocument) document;
-
- if (command.length == 0 && command.text != null) {
- if (endsWith(document.getLegalLineDelimiters(), command.text) != -1) {
- autoIndentAfterNewLine(command);
- } else if (command.text.equals("}")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_RBRACE);
- } else if (command.text.equals("]")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
- } else if (command.text.equals(")")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE);
- }
- }
- // */
-
- // spaces for tab character
- if (command.text != null && command.text.length() > 0 && command.text.charAt(0) == '\t')
- smartInsertForTab(command, document);
- }
-
- /**
- */
- protected String getIndentFor(CompoundRegion region, boolean indentForNextRegion) {
- if (region == null)
- return null;
- IStructuredDocumentRegion flatNode = region.getDocumentRegion();
- if (flatNode == null)
- return null;
-
- try {
- if (region.getType() == CSSRegionContexts.CSS_LBRACE || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // get meanful flat node
- RegionIterator it = new RegionIterator(flatNode, region.getTextRegion());
- it.prev();
- while (it.hasPrev()) {
- ITextRegion r = it.prev();
- region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
- if (region.getType() != CSSRegionContexts.CSS_S)
- break;
- }
- flatNode = region.getDocumentRegion();
- // get indent string
- int position = flatNode.getStart();
- int line = structuredDocument.getLineOfOffset(position);
- int start = structuredDocument.getLineOffset(line);
- int end = findEndOfWhiteSpace(structuredDocument, start, position);
- return structuredDocument.get(start, end - start);
- } else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
- // region.getType() == CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION || region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- int position = flatNode.getStart() + region.getStart();
- int line = structuredDocument.getLineOfOffset(position);
- int start = structuredDocument.getLineOffset(line);
- int end = findEndOfWhiteSpace(structuredDocument, start, position);
- StringBuffer buf = new StringBuffer(structuredDocument.get(start, end - start));
- position += region.getText().length();
- if (indentForNextRegion) {
- int tokenStart = findEndOfWhiteSpace(structuredDocument, position, structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1);
- if (tokenStart < structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1) {
- position = tokenStart;
- }
- }
- while (position - end > 0) {
- buf.append(" ");//$NON-NLS-1$
- end++;
- }
- return buf.toString();
- } else
- return "";//$NON-NLS-1$
- } catch (BadLocationException excp) {
- Logger.logException(excp);
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion getPrevKeyRegion(int position, CompoundRegion currentRegion) {
- if (currentRegion == null) {
- if (structuredDocument.getLastStructuredDocumentRegion() == null)
- return null;
- }
-
- if (currentRegion != null && (currentRegion.getType() == CSSRegionContexts.CSS_RBRACE || currentRegion.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || currentRegion.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)) {
- return prevCorrespondence(currentRegion);
- }
-
- RegionIterator it = new RegionIterator(structuredDocument, position - 1);
- while (it.hasPrev()) {
- ITextRegion r = it.prev();
- CompoundRegion region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
- if (region.getType() == CSSRegionContexts.CSS_LBRACE ||
- // region.getType() == CSSRegionContexts.CSS_RBRACE ||
- region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
- // region.getType() ==
- // CSSRegionContexts.CSS_BRACKET_CLOSE ||
- // // region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- // region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_CLOSE ||
- region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER ||
- // region.getType() == CSSRegionContexts.CSS_COLON ||
- // region.getType() == CSSRegionContexts.CSS_COMMENT
- // ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- return region;
- } else if (region.getType() == CSSRegionContexts.CSS_RBRACE || region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- // skip to LBRACE
- CompoundRegion pc = prevCorrespondence(region);
- // guard for NPE
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
- if (pc == null) break;
- it.reset(pc.getDocumentRegion(), pc.getTextRegion());
- it.prev();
- } else if (region.getType() == CSSRegionContexts.CSS_STRING) {
- RegionIterator itTmp = new RegionIterator(structuredDocument, position);
- if (region == itTmp.prev())
- return region; // position is inside of string
- } else if (region.getType() == CSSRegionContexts.CSS_COMMENT) {
- RegionIterator itTmp = new RegionIterator(structuredDocument, position);
- if (region == itTmp.prev())
- return region; // position is inside of comment
- } else if (region.getType() == CSSRegionContexts.CSS_UNKNOWN) {
- String str = region.getText();
- if (str.charAt(str.length() - 1) == '\\')
- return region;
- } else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- RegionIterator itPrev = new RegionIterator(region.getDocumentRegion(), region.getTextRegion());
- while (itPrev.hasPrev()) {
- ITextRegion regionPrev = itPrev.prev();
- if (regionPrev.getType() == CSSRegionContexts.CSS_RBRACE) {
- break;
- } else if (regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- return region;
- } else if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE) {
- while (itPrev.hasPrev()) {
- regionPrev = itPrev.prev();
- if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
- break;
- if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE || regionPrev.getType() == CSSRegionContexts.CSS_RBRACE || regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- return region;
- }
- if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
- break;
- else
- return region;
- }
- }
- }
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion getRegion(int position) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
- if (flatNode != null)
- return new CompoundRegion(flatNode, flatNode.getRegionAtCharacterOffset(position));
- return null;
- }
-
- /**
- */
- protected int needShift(CompoundRegion region, int position) {
- int shift = 0;
- if (region == null || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER || region.getType() == CSSRegionContexts.CSS_LBRACE) {
- // get non space region
- CompoundRegion cr = getRegion(position - 1);
- RegionIterator it = new RegionIterator(cr.getDocumentRegion(), cr.getTextRegion());
- ITextRegion nearestRegion = null;
- while (it.hasPrev()) {
- nearestRegion = it.prev();
- if (nearestRegion.getType() != CSSRegionContexts.CSS_S && nearestRegion.getType() != CSSRegionContexts.CSS_COMMENT)
- break;
- }
- if (nearestRegion != null && (nearestRegion.getType() == CSSRegionContexts.CSS_LBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_RBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_DELIMITER || nearestRegion.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER))
- shift--;
- else if (region == null)
- shift--;
- shift++;
- }
- if (region != null && region.getType() == CSSRegionContexts.CSS_LBRACE) {
- RegionIterator it = new RegionIterator(structuredDocument, position);
- if (!it.hasPrev() || it.prev().getType() != CSSRegionContexts.CSS_RBRACE)
- shift++;
- else
- shift = 0;
- }
- return shift;
- }
-
- /**
- */
- protected CompoundRegion prevCorrespondence(int position, String regionType) {
- RegionIterator it = new RegionIterator(structuredDocument, position - 1);
- ITextRegion region = null;
- int nest = 1;
- if (regionType == CSSRegionContexts.CSS_RBRACE) {
- // skip to LBRACE
- while (it.hasPrev()) {
- region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_LBRACE)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_RBRACE)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- if (regionType == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END) {
- // skip to BRACKET_OPEN
- while (it.hasPrev()) {
- region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- if (regionType == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- // skip to PARENTHESIS_OPEN
- while (it.hasPrev()) {
- region = it.prev();
- if (// region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion prevCorrespondence(CompoundRegion region) {
- if (region == null)
- return null;
-
- IStructuredDocumentRegion flatNode = region.getDocumentRegion();
- int position = flatNode.getStart() + region.getStart();
- return prevCorrespondence(position, region.getType());
- }
-
- /**
- * Insert the method's description here.
- *
- * @return boolean
- * @param command
- * org.eclipse.jface.text.DocumentCommand
- */
- protected boolean setRangeForClose(DocumentCommand command) {
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return false;
- }
-
- try {
- // find start of line
- int p = (position == structuredDocument.getLength() ? position - 1 : position);
-
- int line = structuredDocument.getLineOfOffset(p);
- int start = structuredDocument.getLineOffset(line);
- RegionIterator it = new RegionIterator(structuredDocument, start);
- boolean allWhiteSpace = false;
- // check whether the text from lStart to position is white space
- // or not
- while (it.hasNext()) {
- ITextRegion region = it.next();
- if (region.getType() != CSSRegionContexts.CSS_S)
- break;
- if (it.getStructuredDocumentRegion().getEndOffset(region) > p) {
- allWhiteSpace = true;
- break;
- }
- }
- if (allWhiteSpace) {
- command.length = command.length - (start - command.offset);
- command.offset = start;
- return true;
- }
- } catch (BadLocationException excp) {
- Logger.logException(excp);
- }
- return false;
- }
-
- /**
- */
- protected void setRangeForNewLine(DocumentCommand command) {
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- try {
- // add pre-nearest white spaces to replace target
- if (position > 0) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position - 1);
- if (flatNode != null) {
- ITextRegion region = flatNode.getRegionAtCharacterOffset(position - 1);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- int end = command.offset + command.length;
- int nLine = structuredDocument.getLineOfOffset(position);
- int nStartPos = structuredDocument.getLineOffset(nLine);
- if (nStartPos < flatNode.getStartOffset(region))
- nStartPos = flatNode.getStartOffset(region);
- command.offset = nStartPos;
- command.length = end - command.offset;
- }
- }
- }
-
- // add post-nearest white spaces to replace target
- if (position < structuredDocument.getLength()) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
- if (flatNode != null) {
- ITextRegion region = flatNode.getRegionAtCharacterOffset(position);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- int nLine = structuredDocument.getLineOfOffset(position);
- String currentLineDelim = structuredDocument.getLineDelimiter(nLine);
- int nEndPos = structuredDocument.getLineOffset(nLine) + structuredDocument.getLineLength(nLine) - ((currentLineDelim != null) ? currentLineDelim.length() : 0);
- if (nEndPos > flatNode.getEndOffset(region))
- nEndPos = flatNode.getEndOffset(region);
- command.length = nEndPos - command.offset;
- }
- }
- }
- } catch (BadLocationException e) {
- // do not customize command
- }
-
- }
-
- private static int endsWith(String[] searchStrings, String text) {
- for (int i = 0; i < searchStrings.length; i++) {
- if (text.endsWith(searchStrings[i]))
- return i;
- }
- return -1;
- }
-
- private static int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
- while (offset < end) {
- char c = document.getChar(offset);
- if (c != ' ' && c != '\t') {
- return offset;
- }
- offset++;
- }
- return end;
- }
-
-
- 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();
- }
-
- /**
- * 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;
- }
-
- /**
- * 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
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (CSSCorePreferenceNames.SPACE.equals(preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
- int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- if (indentationWidth != 0) {
- int indentSize = indentationWidth;
- try {
- IRegion firstLine = document.getLineInformationOfOffset(command.offset);
- int offsetInLine = command.offset - firstLine.getOffset();
- int remainder = offsetInLine % indentationWidth;
-
- indentSize = indentationWidth - remainder;
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- for (int i = 0; i < indentSize; i++)
- indent.append(' ');
- }
-
- // replace \t characters with spaces
- command.text = indent.toString();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java
deleted file mode 100644
index 89d80181c0..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-
-class CSSCACandidate {
-
- private String fReplacementString = null;
- private int fCursorPosition = 0;
- private String fDisplayString = null;
- private CSSImageType fImageType = null;
- private CSSMMNode fNode = null;
- /**
- * CSSCACandidate constructor comment.
- */
- CSSCACandidate() {
- super();
- }
-
- /**
- *
- */
- int getCursorPosition() {
- return fCursorPosition;
- }
-
- /**
- *
- */
- String getDisplayString() {
- return fDisplayString;
- }
-
- /**
- *
- */
- CSSImageType getImageType() {
- return fImageType;
- }
-
- /**
- *
- */
- String getReplacementString() {
- return fReplacementString;
- }
-
- CSSMMNode getMMNode() {
- return fNode;
- }
-
- /**
- *
- */
- void setCursorPosition(int cursorPosition) {
- fCursorPosition = cursorPosition;
- }
-
- /**
- *
- */
- void setDisplayString(String displayString) {
- fDisplayString = displayString;
- }
-
- /**
- *
- */
- void setImageType(CSSImageType imageType) {
- fImageType = imageType;
- }
-
- /**
- *
- */
- void setReplacementString(String replacementString) {
- fReplacementString = replacementString;
- }
-
- void setMMNode(CSSMMNode node) {
- fNode = node;
- }
-
- /**
- * Returns a String that represents the value of this object.
- *
- * @return a string representation of the receiver
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(getReplacementString());
- buf.append("\"");//$NON-NLS-1$
- buf.append(getDisplayString());
- buf.append("\"");//$NON-NLS-1$
- buf.append("(");//$NON-NLS-1$
- buf.append(getCursorPosition());
- buf.append(")");//$NON-NLS-1$
-
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java
deleted file mode 100644
index 81f6817354..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java
+++ /dev/null
@@ -1,258 +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.wst.css.ui.internal.contentassist;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-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.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-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.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-/**
- * <p>Completion computer for CSS</p>
- */
-public class CSSCompletionProposalComputer implements ICompletionProposalComputer {
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
- ITextViewer viewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
-
- IndexedRegion indexedNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
- IDOMNode xNode = null;
- IDOMNode parent = null;
- CSSProposalArranger arranger = null;
-
- // If there is a selected region, we'll need to replace the text
- ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
-
- // bail if we couldn't get an indexed node
- // if(indexedNode == null) return new ICompletionProposal[0];
- if (indexedNode instanceof IDOMNode) {
- xNode = (IDOMNode) indexedNode;
- parent = (IDOMNode) xNode.getParentNode();
- }
- // need to get in here if there in the no 0 region <style>|</style>
- // case
- if ((xNode != null) && xNode.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag w/out region
- IStructuredModel cssModel = getCSSModel(xNode);
- if (cssModel != null) {
- // adjust offsets for embedded style
- int offset = documentPosition;
- int pos = 0;
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, selection.getLength(), (char) 0);
- }
- } else if ((parent != null) && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag with a region
- // use the parent because that will be the <style> tag
- IStructuredModel cssModel = getCSSModel(parent);
- if (cssModel != null) {
- // adjust offsets for embedded style
- int offset = indexedNode.getStartOffset();
- int pos = documentPosition - offset;
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, selection.getLength(), (char) 0);
- }
- } else if (indexedNode instanceof IDOMNode) {
- IDOMNode domNode = ((IDOMNode)indexedNode);
- // get model for node w/ style attribute
- IStructuredModel cssModel = getCSSModel(domNode);
- if (cssModel != null) {
- // adjust offsets for embedded style
- int textRegionStartOffset = getTextRegionStartOffset(domNode, documentPosition);
- int pos = documentPosition - textRegionStartOffset;
-
- char quote = (char) 0;
- try {
- quote = context.getDocument().get(textRegionStartOffset, 1).charAt(0);
- } catch (BadLocationException e) {
- Logger.logException("error getting quote character", e);
- }
-
- //get css indexed region
- IndexedRegion cssIndexedNode = cssModel.getIndexedRegion(pos);
- if (cssIndexedNode == null) {
- cssIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (cssIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(pos, (ICSSNode) cssIndexedNode, textRegionStartOffset, selection.getLength(), quote);
- }
- }
- } else if (indexedNode instanceof ICSSNode) {
- // when editing external CSS using CSS Designer, ICSSNode is passed.
- ICSSDocument cssdoc = ((ICSSNode) indexedNode).getOwnerDocument();
- if (cssdoc != null) {
- IStructuredModel cssModel = cssdoc.getModel();
- if (cssModel != null) {
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (keyIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, 0, selection.getLength(), (char)0);
- }
- }
- }
- } else if ((indexedNode == null) && ContentAssistUtils.isViewerEmpty(viewer)) {
- // the top of empty CSS Document
- IStructuredModel cssModel = null;
- try {
- cssModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
- if (cssModel instanceof ICSSModel) {
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (keyIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, 0, (char)0);
- }
- }
- } finally {
- if (cssModel != null)
- cssModel.releaseFromRead();
- }
- }
-
- ICompletionProposal[] proposals = new ICompletionProposal[0];
- if (arranger != null) {
- proposals = arranger.getProposals();
-
- ICompletionProposal[] newfileproposals = new ICompletionProposal[0];
- ICompletionProposal[] anyproposals = new ICompletionProposal[0];
-
- // add end tag if parent is not closed
- ICompletionProposal endTag = XMLContentAssistUtilities.computeXMLEndTagProposal(viewer, documentPosition, indexedNode, HTML40Namespace.ElementName.STYLE, SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC);
-
- // add the additional proposals
- int additionalLength = newfileproposals.length + anyproposals.length;
- additionalLength = (endTag != null) ? ++additionalLength : additionalLength;
- if (additionalLength > 0) {
- ICompletionProposal[] plusOnes = new ICompletionProposal[proposals.length + additionalLength];
- int appendPos = proposals.length;
- // add end tag proposal
- if (endTag != null) {
- System.arraycopy(proposals, 0, plusOnes, 1, proposals.length);
- plusOnes[0] = endTag;
- ++appendPos;
- } else {
- System.arraycopy(proposals, 0, plusOnes, 0, proposals.length);
- }
- // add items in newfileproposals
- for (int i = 0; i < newfileproposals.length; ++i) {
- plusOnes[appendPos + i] = newfileproposals[i];
- }
- // add items in anyproposals
- appendPos = appendPos + newfileproposals.length;
- for (int i = 0; i < anyproposals.length; ++i) {
- plusOnes[appendPos + i] = anyproposals[i];
- }
- proposals = plusOnes;
- }
- }
- return Arrays.asList(proposals);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
- */
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
- */
- public void sessionStarted() {
- //default is to do nothing
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- //default is to do nothing
- }
-
- /**
- * Returns the CSSmodel for a given XML node.
- *
- * @param element
- * @return IStructuredModel
- */
- private static IStructuredModel getCSSModel(IDOMNode element) {
- if (element == null) {
- return null;
- }
- INodeAdapter adapter = StyleAdapterFactory.getInstance().adapt(element);
- if ((adapter == null) || !(adapter instanceof ICSSModelAdapter)) {
- return null;
- }
- ICSSModelAdapter modelAdapter = (ICSSModelAdapter) adapter;
- return modelAdapter.getModel();
- }
-
- /**
- * <p>Get the start offset of the text region containing the given document position</p>
- *
- * @param domNode {@link IDOMNode} containing the document position
- * @param documentPosition the document relative position to get the start
- * offset of the containing {@link ITextRegion} for
- * @return start offset of the {@link ITextRegion} containing the given document position
- */
- private static int getTextRegionStartOffset(IDOMNode domNode, int documentPosition) {
- IStructuredDocumentRegion structRegion = domNode.getFirstStructuredDocumentRegion();
- return structRegion.getStartOffset(structRegion.getRegionAtCharacterOffset(documentPosition));
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
deleted file mode 100644
index 250d95242d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelFinder;
-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.ICSSModel;
-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;
-
-class CSSContentAssistContext {
-
- private int fReplaceBegin = -1;
- private String fTextToReplace = null;
- private String fTextToCompare = null;
- private int fTargetPos = -1;
- private ICSSNode fTargetNode = null;
- private int fCursorPos = -1;
- private int fLength = -1;
- private IStructuredDocument fStructuredDocument = null;
- private int fDocumentOffset = 0;
- private char fQuote = 0;
- private ICSSModel fModel = null;
- private boolean fSelected = false;
-
- /**
- *
- */
- private CSSContentAssistContext() {
- super();
- }
-
- /**
- *
- */
- CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, char quote) {
- this();
- fCursorPos = documentPosition;
- fDocumentOffset = documentOffset;
- fQuote = quote;
- initialize(node.getOwnerDocument());
- }
-
- CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, int length, char quote) {
- this();
- fCursorPos = documentPosition;
- fDocumentOffset = documentOffset;
- fQuote = quote;
- fLength = length;
- initialize(node.getOwnerDocument());
- }
-
- CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, char quote, boolean selected) {
- this();
- fCursorPos = documentPosition;
- fDocumentOffset = documentOffset;
- fQuote = quote;
- fSelected = selected;
- initialize(node.getOwnerDocument());
- }
-
- /**
- * @return int
- */
- int getCursorPos() {
- return fCursorPos;
- }
-
- /**
- * @return int
- */
- int getDocumentOffset() {
- return fDocumentOffset;
- }
-
- IStructuredDocument getStructuredDocument() {
- return fStructuredDocument;
- }
-
- ICSSModel getModel() {
- return fModel;
- }
-
- private ICSSNode getNodeAt(int offset) {
- return (ICSSNode) ((fModel != null) ? fModel.getIndexedRegion(offset) : null);
- }
-
- /**
- *
- * @return char
- */
- char getQuoteOfStyleAttribute() {
- return fQuote;
- }
-
- ITextRegion getRegionByOffset(int offset) {
- ITextRegion region = null;
- if (fStructuredDocument != null) {
- IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (flatNode != null) {
- //if its a quoted region and at the beginning of a node then get the node before it
- if(offset == flatNode.getStartOffset() && fQuote != 0) {
- flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset-1);
- }
-
- //if its the end offset of the node then to get the region need to step back one
- if(offset == flatNode.getEndOffset()) {
- region = flatNode.getRegionAtCharacterOffset(offset-1);
- } else {
- region = flatNode.getRegionAtCharacterOffset(offset);
- }
- }
- }
- return region;
- }
-
- /**
- *
- */
- // String getRegionText() {
- // ITextRegion targetRegion = getTargetRegion();
- // if (targetRegion != null) {
- // return targetRegion.getText();
- // } else {
- // return ""; //$NON-NLS-1$
- // }
- // }
- /**
- *
- */
- int getReplaceBegin() {
- return fReplaceBegin;
- }
-
- ICSSNode getTargetNode() {
- return fTargetNode;
- }
-
- private int getTargetPos() {
- return fTargetPos;
- }
-
- ITextRegion getTargetRegion() {
- return getRegionByOffset(getTargetPos());
- }
-
- private IStructuredDocumentRegion getTargetDocumentRegion() {
- return getDocumentRegionByOffset(getTargetPos());
- }
-
- private IStructuredDocumentRegion getDocumentRegionByOffset(int offset) {
- return (fStructuredDocument != null) ? fStructuredDocument.getRegionAtCharacterOffset(offset) : null;
- }
-
- ITextRegion getTargetRegionPrevious() {
- ITextRegion previousRegion = null;
- ITextRegion targetRegion = getTargetRegion();
- RegionIterator iterator = null;
- if (targetRegion == null) {
- if (0 < fCursorPos) {
- iterator = new RegionIterator(fStructuredDocument, fCursorPos - 1);
- }
- } else {
- iterator = getRegionIterator();
- if (iterator.hasPrev()) {
- iterator.prev();
- } else {
- iterator = null;
- }
- }
- if (iterator != null) {
- while (iterator.hasPrev()) {
- ITextRegion region = iterator.prev();
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
- previousRegion = region;
- break;
- }
- }
- }
-
- return previousRegion;
- }
-
- /**
- * @return java.lang.String
- */
- String getTextToCompare() {
- return fTextToCompare;
- }
-
- /**
- *
- */
- String getTextToReplace() {
- return fTextToReplace;
- }
-
- /**
- *
- */
- private void initialize(ICSSDocument doc) {
- if (doc == null) {
- return;
- }
- ICSSModel model = doc.getModel();
- fModel = model;
- fStructuredDocument = model.getStructuredDocument();
-
- initializeTargetPos();
- initializeTargetText();
- initializeTargetNode();
- }
-
- /**
- *
- */
- private void initializeTargetNode() {
- if (fCursorPos == 0) {
- fTargetNode = fModel.getDocument();
- return;
- }
-
- // find edge of tree node
- ICSSNode cursorNode = getNodeAt(fCursorPos);
- if (cursorNode == null) { // end of document
- cursorNode = fModel.getDocument();
- }
- ICSSNode node = null;
- IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(fCursorPos - 1);
- while (flatNode != null && (node = getNodeAt(flatNode.getStartOffset())) == cursorNode && ((IndexedRegion) node).getStartOffset() != flatNode.getStartOffset()) {
- flatNode = flatNode.getPrevious();
- }
- if (flatNode == null) { // top of document
- fTargetNode = (node == null) ? fModel.getDocument() : node;
- return;
- }
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- if (cursorNode != null) {
- for (ICSSNode parent = cursorNode.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent == cursorNode) {
- fTargetNode = cursorNode;
- return;
- }
- }
- }
- // v<--|
- // AAA
- // BBBBBBBBBB cursorNode:B , node:A -> depend on A's node type
- short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLEDECLITEM_NODE || nodeType == ICSSNode.CHARSETRULE_NODE || nodeType == ICSSNode.IMPORTRULE_NODE) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- fTargetNode = node.getParentNode();
- } else {
- fTargetNode = node;
- }
- // fTargetNode = (bOverSemiColon) ? node.getParentNode() : node;
- } else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
- fTargetNode = node.getParentNode();
- } else {
- fTargetNode = node;
- }
-
- return;
- }
-
- /**
- *
- */
- private void initializeTargetPos() {
- if (fCursorPos == 0 || isSpecialDelimiterRegion(fCursorPos - 1)) {
- fTargetPos = fCursorPos;
- } else {
- fTargetPos = fCursorPos - 1;
- }
-
- //deal with the leading quote
- if(fQuote != 0) {
- fTargetPos--;
- }
- }
-
- /**
- *
- */
- private void initializeTargetText() {
- ITextRegion targetRegion = getTargetRegion();
- IStructuredDocumentRegion documentRegion = getTargetDocumentRegion();
- if (targetRegion == null) {
- fReplaceBegin = fCursorPos;
- fTextToReplace = ""; //$NON-NLS-1$
- fTextToCompare = ""; //$NON-NLS-1$
- } else {
- String regionText = documentRegion.getText(targetRegion);
- int regionStart = documentRegion.getStartOffset(targetRegion);
- if (!fSelected && (regionStart == fCursorPos || regionText.trim().length() == 0 || regionStart + regionText.length() - 1 < this.fTargetPos)) {
- // to insertion
- fReplaceBegin = fCursorPos;
- fTextToReplace = ""; //$NON-NLS-1$
- fTextToCompare = ""; //$NON-NLS-1$
- try {
- if (fLength > 0)
- fTextToReplace = fStructuredDocument.get(fReplaceBegin, fLength);
- }
- catch (BadLocationException e) {
- }
- } else {
- // to replace
- fReplaceBegin = regionStart;
- fTextToReplace = regionText;
-
- //math to deal with leading quote
- int matchLength = fCursorPos - fReplaceBegin;
- if(fQuote != 0) {
- matchLength--;
- fReplaceBegin++;
- }
-
- if(fCursorPos >= fReplaceBegin && regionText.trim().length() >= (matchLength))
- fTextToCompare = regionText.substring(0, matchLength);
- else
- fTextToCompare = ""; //$NON-NLS-1$
- }
- }
- }
-
- /**
- *
- */
- private boolean isSpecialDelimiterRegion(int pos) {
- ITextRegion region = getRegionByOffset(pos);
- String type = null;
- if(region != null) {
- type = region.getType();
- }
- return (type != null) &&((type == CSSRegionContexts.CSS_LBRACE ||
- type == CSSRegionContexts.CSS_RBRACE ||
- type == CSSRegionContexts.CSS_DELIMITER ||
- type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR ||
- type == CSSRegionContexts.CSS_DECLARATION_DELIMITER ||
- type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR ||
- type == CSSRegionContexts.CSS_S));
- }
- /**
- *
- */
- boolean isTargetPosAfterOf(String regionType) {
- int start = ((IndexedRegion) fTargetNode).getStartOffset();
- if (start < 0 || ((IndexedRegion) fTargetNode).getEndOffset() <= 0) {
- return false;
- }
-
- RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
- while (iRegion.hasNext()) {
- ITextRegion region = iRegion.next();
- if (fTargetPos < iRegion.getStructuredDocumentRegion().getTextEndOffset(region)) {
- break;
- }
- if (region.getType() == regionType) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- boolean isTargetPosBeforeOf(String regionType) {
- return !isTargetPosAfterOf(regionType);
- }
-
- /**
- * @return boolean
- * @param regionType
- * java.lang.String
- */
- boolean targetFollows(String regionType) {
- RegionIterator iRegion;
- ITextRegion region = null;
- if (fStructuredDocument.getLength() <= fTargetPos) {
- iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
- } else {
- iRegion = new RegionIterator(fStructuredDocument, fTargetPos);
- try {
- if (!Character.isWhitespace(fStructuredDocument.getChar(fTargetPos)) && iRegion.hasPrev()) {
- region = iRegion.prev();
- }
- } catch (BadLocationException e) {
- iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
- }
- }
- while (iRegion.hasPrev()) {
- region = iRegion.prev();
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- } else {
- break;
- }
- }
- if (region != null && region.getType() == regionType) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- *
- */
- boolean targetHas(String regionType) {
- int end = ((IndexedRegion) fTargetNode).getEndOffset();
- if (getTargetPos() < 0 || end <= 0) {
- return false;
- }
- RegionIterator iRegion = new RegionIterator(fStructuredDocument, getTargetPos());
- while (iRegion.hasNext()) {
- ITextRegion region = iRegion.next();
- if (end <= iRegion.getStructuredDocumentRegion().getStartOffset(region)) {
- break;
- }
- if (region.getType() == regionType) {
- return true;
- }
- }
- return false;
- }
-
- RegionIterator getRegionIterator() {
- return new RegionIterator(getStructuredDocument(), getTargetPos());
- }
-
- /**
- *
- */
- CSSMetaModel getMetaModel() {
- CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
- ICSSModel model = getModel();
- if (model.getOwnerDOMNode() != null) {
- return finder.findMetaModelFor(model.getOwnerDOMNode());
- }
- return finder.findMetaModelFor(getModel());
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
deleted file mode 100644
index b4af3d0a49..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-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.ui.internal.templates.TemplateContextTypeIdsCSS;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-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.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see CSSStructuredContentAssistProcessor
- */
-public class CSSContentAssistProcessor implements IContentAssistProcessor {
-
- private int fDocumentOffset = 0;
- private char fQuote = 0;
- private CSSTemplateCompletionProcessor fTemplateProcessor = null;
-
- /**
- * Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.
- *
- * @param documentPosition
- * a location within the document
- * @return an array of code-assist items
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
-
- IndexedRegion indexedNode = ContentAssistUtils.getNodeAt(viewer, documentPosition + fDocumentOffset);
- IDOMNode xNode = null;
- IDOMNode parent = null;
- CSSProposalArranger arranger = null;
- boolean isEmptyDocument = false;
- // If there is a selected region, we'll need to replace the text
- ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
- boolean selected = (selection != null && selection.getText() != null && selection.getText().trim().length() > 0);
-
- // bail if we couldn't get an indexed node
- // if(indexedNode == null) return new ICompletionProposal[0];
- if (indexedNode instanceof IDOMNode) {
- xNode = (IDOMNode) indexedNode;
- parent = (IDOMNode) xNode.getParentNode();
- }
- // need to get in here if there in the no 0 region <style>|</style>
- // case
- if ((xNode != null) && xNode.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag w/out region
- IStructuredModel cssModel = getCSSModel(xNode);
- if (cssModel != null) {
- // adjust offsets for embedded style
- int offset = documentPosition + fDocumentOffset;
- int pos = 0;
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0, selected);
- }
- } else if ((parent != null) && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag with a region
- // use the parent because that will be the <style> tag
- IStructuredModel cssModel = getCSSModel(parent);
- if (cssModel != null) {
- // adjust offsets for embedded style
- int offset = indexedNode.getStartOffset();
- int pos = documentPosition - offset;
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0, selected);
- }
- } else if (indexedNode instanceof IDOMNode) {
- // get model for node w/ style attribute
- IStructuredModel cssModel = getCSSModel((IDOMNode) indexedNode);
- if (cssModel != null) {
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (keyIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote, selected);
- }
- }
- } else if (indexedNode instanceof ICSSNode) {
- // when editing external CSS using CSS Designer, ICSSNode is
- // passed.
- ICSSDocument cssdoc = ((ICSSNode) indexedNode).getOwnerDocument();
- if (cssdoc != null) {
- IStructuredModel cssModel = cssdoc.getModel();
- if (cssModel != null) {
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (keyIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote, selected);
- }
- }
- }
- } else if ((indexedNode == null) && isViewerEmpty(viewer)) {
- isEmptyDocument = true;
- // the top of empty CSS Document
- IStructuredModel cssModel = null;
- try {
- cssModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
- if (cssModel instanceof ICSSModel) {
- IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- if (keyIndexedNode instanceof ICSSNode) {
- // inline style for a tag, not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
- }
- }
- } finally {
- if (cssModel != null)
- cssModel.releaseFromRead();
- }
- }
-
- ICompletionProposal[] proposals = new ICompletionProposal[0];
- if (arranger != null) {
- fDocumentOffset = 0;
- proposals = arranger.getProposals();
-
- ICompletionProposal[] newfileproposals = new ICompletionProposal[0];
- ICompletionProposal[] anyproposals = new ICompletionProposal[0];
- // add template proposals
- if (getTemplateCompletionProcessor() != null) {
- if (isEmptyDocument) {
- getTemplateCompletionProcessor().setContextType(TemplateContextTypeIdsCSS.NEW);
- newfileproposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
- }
- getTemplateCompletionProcessor().setContextType(TemplateContextTypeIdsCSS.ALL);
- anyproposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
- }
-
- // add end tag if parent is not closed
- ICompletionProposal endTag = XMLContentAssistUtilities.computeXMLEndTagProposal(viewer, documentPosition, indexedNode, HTML40Namespace.ElementName.STYLE, SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC);
-
- // add the additional proposals
- int additionalLength = newfileproposals.length + anyproposals.length;
- additionalLength = (endTag != null) ? ++additionalLength : additionalLength;
- if (additionalLength > 0) {
- ICompletionProposal[] plusOnes = new ICompletionProposal[proposals.length + additionalLength];
- int appendPos = proposals.length;
- // add end tag proposal
- if (endTag != null) {
- System.arraycopy(proposals, 0, plusOnes, 1, proposals.length);
- plusOnes[0] = endTag;
- ++appendPos;
- } else {
- System.arraycopy(proposals, 0, plusOnes, 0, proposals.length);
- }
- // add items in newfileproposals
- for (int i = 0; i < newfileproposals.length; ++i) {
- plusOnes[appendPos + i] = newfileproposals[i];
- }
- // add items in anyproposals
- appendPos = appendPos + newfileproposals.length;
- for (int i = 0; i < anyproposals.length; ++i) {
- plusOnes[appendPos + i] = anyproposals[i];
- }
- proposals = plusOnes;
- }
- }
- return proposals;
- }
-
- /**
- * Returns true if there is no text or it's all white space, otherwise
- * returns false
- *
- * @param treeNode
- * @param textViewer
- * @return boolean
- */
- private boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if ((text == null) || ((text != null) && text.trim().equals(""))) //$NON-NLS-1$
- isEmpty = true;
- return isEmpty;
- }
-
- /**
- * Get CSSModel for an indexed node
- *
- * @param indexedNode
- * @return IStructuredModel
- */
- // private IStructuredModel getCSSModel(IndexedRegion indexedNode) {
- // if (indexedNode == null) return null;
- // Node node = (Node)indexedNode;
- // INodeNotifier notifier = (INodeNotifier)node.getParentNode();
- // if (notifier == null) return null;
- // INodeAdapter adapter =
- // StyleAdapterFactory.getInstance().adapt(notifier);
- // if (adapter == null || !(adapter instanceof CSSModelAdapter)) return
- // null;
- // CSSModelAdapter modelAdapter = (CSSModelAdapter)adapter;
- // return modelAdapter.getModel();
- // }
- /**
- * Returns the CSSmodel for a given XML node.
- *
- * @param element
- * @return IStructuredModel
- */
- private IStructuredModel getCSSModel(IDOMNode element) {
- if (element == null)
- return null;
- INodeAdapter adapter = StyleAdapterFactory.getInstance().adapt(element);
- if ((adapter == null) || !(adapter instanceof ICSSModelAdapter))
- return null;
- ICSSModelAdapter modelAdapter = (ICSSModelAdapter) adapter;
- return modelAdapter.getModel();
- }
-
- /**
- * Returns information about possible contexts based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text viewer.
- *
- * @param viewer
- * the viewer whose document is used to compute the possible
- * contexts
- * @param documentPosition
- * an offset within the document for which context information
- * should be computed
- * @return an array of context information objects or <code>null</code>
- * if no context could be found
- */
- public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int documentOffset) {
- return null;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of possible completions.
- *
- * @return the auto activation characters for completion proposal or
- * <code>null</code> if no auto activation is desired
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of context information.
- *
- * @return the auto activation characters for presenting context
- * information or <code>null</code> if no auto activation is
- * desired
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /**
- * Returns a validator used to determine when displayed context
- * information should be dismissed. May only return <code>null</code> if
- * the processor is incapable of computing context information.
- *
- * @return a context information validator, or <code>null</code> if the
- * processor is incapable of computing context information
- */
- public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /**
- * Return the reason why computeProposals was not able to find any
- * completions.
- *
- * @return an error message or null if no error occurred
- */
- public String getErrorMessage() {
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/05/22
- * 10:37:05)
- *
- * @param offset
- * int
- */
- public void setDocumentOffset(int offset) {
- fDocumentOffset = offset;
- }
-
- /**
- *
- * @param quote
- * char
- */
- public void setQuoteCharOfStyleAttribute(char quote) {
- fQuote = quote;
- }
-
- private CSSTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new CSSTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
deleted file mode 100644
index cd7b4409e6..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-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.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.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalArranger {
-
- private List fProposals = new ArrayList();
- private CSSContentAssistContext fContext = null;
-
- /**
- * CSSProposalArranger constructor comment.
- */
- private CSSProposalArranger() {
- super();
- }
-
- /**
- * CSSProposalArranger constructor comment.
- */
- CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, char quote) {
- this();
- fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote);
- }
-
- CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, int length, char quote) {
- this();
- fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, length, quote);
- }
-
- CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, char quote, boolean selected) {
- this();
- fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote, selected);
- }
-
- /**
- *
- */
- void buildProposals() {
- fProposals.clear();
-
- /*
- * String text; ICompletionProposal item; text = "---- Test
- * Information ----"; item = new CompletionProposal("",
- * fContext.getReplaceBegin(), 0, 0, null, text, null, null);
- * fProposals.add(item);
- *
- * text = "Target: \"" + fContext.getRegionText() + "\"";
- *
- * item = new CompletionProposal("", fContext.getReplaceBegin(), 0, 0,
- * null, text, null, null); fProposals.add(item);
- *
- * text = fContext.getTargetNode().getClass().toString(); int
- * lastPeriodPos = text.lastIndexOf('.'); text = "Node: " +
- * text.substring(lastPeriodPos + 1); item = new
- * CompletionProposal("", fContext.getReplaceBegin(), 0, 0, null,
- * text, null, null); fProposals.add(item);
- */
-
- ICSSNode targetNode = fContext.getTargetNode();
- //int targetPos = fContext.getTargetPos();
- if (targetNode instanceof ICSSStyleSheet) {
- buildProposalsForAnyRule();
- } else if ((targetNode instanceof ICSSMediaRule && fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_LBRACE)) || (targetNode instanceof ICSSStyleRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForAnyRule();
- // buildProposalsForStyleRule();
- } else if ((targetNode instanceof ICSSPageRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForPageRulePseudoClass();
- } else if ((targetNode instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule || targetNode instanceof ICSSPageRule || targetNode instanceof ICSSStyleDeclaration) && (targetNode.getOwnerDocument() instanceof ICSSStyleDeclaration || fContext.targetFollows(CSSRegionContexts.CSS_DECLARATION_DELIMITER) || fContext.targetFollows(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForDeclarationName();
- } else if (targetNode instanceof ICSSStyleDeclItem) {
- if (fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
- buildProposalsForDeclarationValue();
- } else {
- buildProposalsForDeclarationName();
- }
- } else if (targetNode instanceof ICSSPrimitiveValue) {
- buildProposalsForDeclarationValue();
- }
- /*
- * else if (targetNode instanceof ICSSPrimitiveValue || ((targetNode
- * instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule ||
- * targetNode instanceof ICSSStyleDeclaration || targetNode instanceof
- * ICSSStyleDeclItem) &&
- * fContext.isTargetPosAfterOf(CSSRegionContexts.COLON))) {
- * buildProposalsForDeclarationValue(); }
- */
-
- // for Test
- }
-
- /**
- *
- */
- void buildProposalsForAnyRule() {
- CSSProposalGenerator generator;
- if (isFirstRegion()){
- generator = new CSSProposalGeneratorForAtmarkRule(fContext);
- fProposals.addAll(generator.getProposals());
- }
- generator = new CSSProposalGeneratorForHTMLTag(fContext);
- fProposals.addAll(generator.getProposals());
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- private boolean isFirstRegion(){
- if (fContext.getCursorPos() == 0)
- return true;
-
- ITextRegion region = fContext.getTargetRegion();
- ITextRegion currRegion = fContext.getRegionByOffset(fContext.getCursorPos());
- String type = null;
- String crType = null;
- if(region != null) {
- type = region.getType();
- }
- if(currRegion != null) {
- crType = currRegion.getType();
- }
- if (type == null || crType == null || (crType == type))
- return true;
- else
- return false;
- }
- /**
- *
- */
- void buildProposalsForDeclarationName() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForDeclarationName(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForDeclarationValue() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForDeclarationValue(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForPageRulePseudoClass() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForStyleRule() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForHTMLTag(fContext);
- fProposals.addAll(generator.getProposals());
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- ICompletionProposal[] getProposals() {
- buildProposals();
- ICompletionProposal[] proposalArray = new ICompletionProposal[fProposals.size()];
- Iterator iItem = fProposals.iterator();
- for (int i = 0; iItem.hasNext(); i++) {
- proposalArray[i] = (ICompletionProposal) iItem.next();
- }
- return proposalArray;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
deleted file mode 100644
index d199902aec..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-abstract class CSSProposalGenerator {
-
-
- protected class StringAndOffset {
- StringAndOffset(String string, int offset) {
- this.fString = string;
- this.fOffset = offset;
- }
-
- String fString;
- int fOffset;
- }
-
- protected CSSContentAssistContext fContext = null;
-
- /**
- * CSSProposalGenerator constructor comment.
- */
- private CSSProposalGenerator() {
- super();
- }
-
- CSSProposalGenerator(CSSContentAssistContext context) {
- this();
- fContext = context;
- }
-
- /**
- *
- */
- protected boolean checkLeadingColon() {
- boolean hasLeadingColon = false;
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion == null && 0 < fContext.getCursorPos()) {
- targetRegion = fContext.getRegionByOffset(fContext.getCursorPos() - 1);
- if (targetRegion != null && targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- hasLeadingColon = true;
- }
- }
- else if (targetRegion != null) {
- // BUG 92848 - Changed how pseudo-selectors are defined in the
- // tokenizer
- // The target region should be the CSS_SELECTOR_PSEUDO now
- if (targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- hasLeadingColon = true;
- }
- }
- return hasLeadingColon;
- }
-
- /**
- *
- */
- protected StringAndOffset generateBraces() {
- StringBuffer buf = new StringBuffer();
- String lineDelimiter = fContext.getStructuredDocument().getLineDelimiter();
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- String indentStr = getIndentString();
- if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {
- buf.append(lineDelimiter);
- }
- buf.append("{");//$NON-NLS-1$
- if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE)) {
- buf.append(lineDelimiter);
- buf.append(indentStr);
- } else {
- buf.append(" ");//$NON-NLS-1$
- }
- int offset = buf.length();
- if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE)) {
- buf.append(lineDelimiter);
- } else {
- buf.append(" ");//$NON-NLS-1$
- }
- buf.append("}");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateParenthesis() {
- StringBuffer buf = new StringBuffer();
- int offset;
- buf.append("(");//$NON-NLS-1$
- offset = 1;
- buf.append(")");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateQuotes() {
- StringBuffer buf = new StringBuffer();
- char quoteChar = getQuoteChar();
- buf.append(quoteChar);
- buf.append(quoteChar);
- return new StringAndOffset(buf.toString(), 1);
- }
-
- /**
- *
- */
- protected StringAndOffset generateSemicolon() {
- StringBuffer buf = new StringBuffer();
- int offset;
- buf.append(";");//$NON-NLS-1$
- offset = 0;
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateURI() {
- StringBuffer buf = new StringBuffer();
-
- boolean isQuoteInURI = CSSCorePlugin.getDefault().getPluginPreferences().getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI);
- char quoteChar = getQuoteChar();
- buf.append("url(");//$NON-NLS-1$
- if (isQuoteInURI) {
- buf.append(quoteChar);
- }
- int offset = buf.length();
- if (isQuoteInURI) {
- buf.append(quoteChar);
- }
- buf.append(")");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- abstract protected Iterator getCandidates();
-
- List getProposals() {
- List proposals = new ArrayList();
-
- CSSImageHelper imageHelper = CSSImageHelper.getInstance();
- Iterator i = getCandidates();
- while (i.hasNext()) {
- CSSCACandidate candidate = (CSSCACandidate) i.next();
- Image image = imageHelper.getImage(candidate.getImageType());
- ICompletionProposal item = new CompletionProposal(candidate.getReplacementString(), fContext.getReplaceBegin() + fContext.getDocumentOffset(), fContext.getTextToReplace().length(), candidate.getCursorPosition(), image, candidate.getDisplayString(), null, candidate.getDisplayString(), candidate.getMMNode());
- proposals.add(item);
- }
-
- return proposals;
- }
-
- /**
- *
- * @return char
- */
- private char getQuoteChar() {
-
- String quoteStr = CSSCorePlugin.getDefault().getPluginPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- char quoteChar = (quoteStr != null && 0 < quoteStr.length()) ? quoteStr.charAt(0) : '"';
- char attrQuote = fContext.getQuoteOfStyleAttribute();
- if (attrQuote != 0) {
- if (attrQuote == '"' && quoteChar == '"') {
- quoteChar = '\'';
- } else if (attrQuote == '\'' && quoteChar == '\'') {
- quoteChar = '"';
- }
- }
- return quoteChar;
- }
-
- /**
- *
- */
- protected boolean isMatch(String text) {
- String textToCompare = fContext.getTextToCompare();
- if (textToCompare.length() == 0) {
- return true;
- } else {
- return (text.toUpperCase().indexOf(textToCompare.toUpperCase()) == 0);
- }
- /*
- * String textToReplace = fContext.getTextToReplace(); if
- * (textToReplace.length() == 0) { return true; } else { return
- * (text.toUpperCase().indexOf(textToReplace.toUpperCase()) == 0); }
- */
- }
-
-
- 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.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java
deleted file mode 100644
index 87ba013219..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java
+++ /dev/null
@@ -1,294 +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.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-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.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.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.SelectionCollector;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-class CSSProposalGeneratorForAtmarkRule extends CSSProposalGenerator {
-
- private boolean fUseUpperCase = false;
- private static final String CHARSET = "@charset";//$NON-NLS-1$
- private static final String FONT_FACE = "@font-face";//$NON-NLS-1$
- private static final String IMPORT = "@import";//$NON-NLS-1$
- private static final String MEDIA = "@media";//$NON-NLS-1$
- private static final String PAGE = "@page";//$NON-NLS-1$
-
- /**
- * CSSAtmarkRuleProposalGenerator constructor comment.
- *
- */
- CSSProposalGeneratorForAtmarkRule(CSSContentAssistContext context) {
- super(context);
- fUseUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateCharsetRule() {
- // check content model
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_CHARSET_RULE).hasNext()) {
- return null;
- }
-
- // check if embedded or not
- if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- return null;
- }
-
- // check if caret precede all other rules.
- int offset = fContext.getCursorPos();
- if (0 < offset) {
- SelectionCollector trav = new SelectionCollector();
- trav.setRegion(0, offset - 1);
- trav.apply(fContext.getModel().getDocument());
- Iterator i = trav.getSelectedNodes().iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument)) {
- return null;
- }
- }
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? CHARSET.toUpperCase() : CHARSET.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateQuotes();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- sao = generateSemicolon();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_CHARSET);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateFontFaceRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_FONT_FACE_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? FONT_FACE.toUpperCase() : FONT_FACE.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_FONTFACE);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateImportRule() {
- // check content model
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_IMPORT_RULE).hasNext()) {
- return null;
- }
-
- // charset and import can precede import rule.
- int offset = fContext.getCursorPos();
- if (0 < offset) {
- SelectionCollector trav = new SelectionCollector();
- trav.setRegion(0, offset - 1);
- trav.apply(fContext.getModel().getDocument());
- Iterator i = trav.getSelectedNodes().iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument || obj instanceof ICSSCharsetRule || obj instanceof ICSSImportRule)) {
- return null;
- }
- }
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? IMPORT.toUpperCase() : IMPORT.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateURI();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- sao = generateSemicolon();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_IMPORT);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateMediaRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_MEDIA_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? MEDIA.toUpperCase() : MEDIA.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length() - 1;
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_MEDIA);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidatePageRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_PAGE_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? PAGE.toUpperCase() : PAGE.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_PAGE);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- ITextRegion region = fContext.getTargetRegionPrevious();
- // ITextRegion region = fContext.getSignificantTargetRegion();
- if (region != null) {
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_RBRACE && type != CSSRegionContexts.CSS_DELIMITER) {
- return candidates.iterator();
- }
- }
-
- CSSCACandidate item;
- if ((item = getCandidateImportRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateCharsetRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateMediaRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidatePageRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateFontFaceRule()) != null) {
- candidates.add(item);
- }
- return candidates.iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
deleted file mode 100644
index 3deb7779ce..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-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.ICSSStyleDeclItem;
-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.ui.internal.image.CSSImageType;
-
-class CSSProposalGeneratorForDeclarationName extends CSSProposalGenerator {
-
- /**
- * CSSProposalGeneratorForDeclaration constructor comment.
- *
- */
- CSSProposalGeneratorForDeclarationName(CSSContentAssistContext context) {
- super(context);
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- String preDelim = "";//$NON-NLS-1$
- for (int i = 0; i < preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM); i++) {
- preDelim += ' ';//$NON-NLS-1$
- }
- String postDelim = "";//$NON-NLS-1$
- for (int i = 0; i < preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM); i++) {
- postDelim += ' ';//$NON-NLS-1$
- }
-
- ICSSNode targetNode = fContext.getTargetNode();
- boolean bFontRule = false;
- for (ICSSNode node = targetNode; node != null; node = node.getParentNode()) {
- if (node instanceof org.w3c.dom.css.CSSFontFaceRule) {
- bFontRule = true;
- break;
- }
- }
-
- List names = new ArrayList();
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- Iterator iNames = util.collectNodesByType((bFontRule) ? CSSMMNode.TYPE_DESCRIPTOR : CSSMMNode.TYPE_PROPERTY);
- while (iNames.hasNext()) {
- CSSMMNode node = (CSSMMNode) iNames.next();
- names.add(node);
- }
- sortNames(names);
- // Collections.sort(names);
-
- boolean bAddColon = true;
- if ((targetNode instanceof ICSSStyleRule || targetNode instanceof ICSSStyleDeclItem || targetNode instanceof ICSSStyleDeclaration) && fContext.targetHas(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
- bAddColon = false;
- }
-
- Iterator i = names.iterator();
- while (i.hasNext()) {
- CSSMMNode node = (CSSMMNode) i.next();
- String text = node.getName();
- text = (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER) ? text.toUpperCase() : text.toLowerCase();
- if (!isMatch(text)) {
- continue;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- buf.append(text);
- buf.append(preDelim);
- cursorPos = buf.length();
- if (bAddColon) {
- buf.append(':');//$NON-NLS-1$
- buf.append(postDelim);
- cursorPos += 1 + postDelim.length();
- }
- // if (! (targetNode instanceof ICSSStyleDeclItem)) {
- // buf.append(';');//$NON-NLS-1$
- // }
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setMMNode(node);
- item.setImageType(getCategoryImageType(node));
- candidates.add(item);
- }
-
- return candidates.iterator();
- }
-
- void sortNames(List names) {
- Collections.sort(names, new Comparator() {
- public int compare(Object o1, Object o2) {
- CSSMMNode node1 = (CSSMMNode) o1;
- CSSMMNode node2 = (CSSMMNode) o2;
- if (node1 == null) {
- return 1;
- } else if (node2 == null) {
- return -1;
- }
- int diff = 0;
- String category1 = node1.getAttribute("category"); //$NON-NLS-1$
- String category2 = node2.getAttribute("category"); //$NON-NLS-1$
- if (category1 == null) {
- if (category2 == null) {
- diff = 0;
- } else {
- return 1;
- }
- } else if (category2 == null) {
- return -1;
- } else {
- diff = category1.compareTo(category2);
- }
- if (diff == 0) {
- String name = node1.getName();
- if (name == null) {
- return 1;
- } else {
- return name.compareTo(node2.getName());
- }
- } else {
- return diff;
- }
- }
- });
- }
-
- /*
- * retrieve default category icon name TODO: if node has "icon"(?), use
- * it.
- */
- CSSImageType getCategoryImageType(CSSMMNode node) {
- CSSImageType imageType = null;
- if (node != null) {
- String category = node.getAttribute("category"); //$NON-NLS-1$
- if (category != null) {
- imageType = CSSImageType.getImageType(category);
- }
- }
- return (imageType == null) ? CSSImageType.CATEGORY_DEFAULT : imageType;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java
deleted file mode 100644
index b32e881cdc..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFunction;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNumber;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMUnit;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSFunctionID;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-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.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-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.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalGeneratorForDeclarationValue extends CSSProposalGenerator {
-
- private static final String IMPORTANT = "!important"; //$NON-NLS-1$
- private boolean fUseUpperCase;
- private boolean fAppendSemiColon;
-
- /**
- * CSSProposalGeneratorForDeclarationValue constructor comment.
- *
- */
- CSSProposalGeneratorForDeclarationValue(CSSContentAssistContext context) {
- super(context);
- fUseUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER;
- }
-
- /**
- *
- */
- private void addFunction(List candidates, CSSMMFunction prop) {
- String text = prop.toString();
- if (!isMatch(text)) {
- return;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- if (prop.getName().equals(CSSFunctionID.F_URI)) {
- StringAndOffset sao = generateURI();
- buf.append(sao.fString);
- cursorPos = sao.fOffset;
- } else {
- buf.append(prop.toString());
- cursorPos = buf.length();
- StringAndOffset sao = generateParenthesis();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
-
- text = buf.toString();
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setMMNode(prop);
- item.setImageType(CSSImageType.VALUE_FUNCTION);
- appendSemiColon(item);
- candidates.add(item);
- }
-
- /**
- *
- */
- private void addNumber(List candidates, CSSMMNumber prop) {
- String fullText = fContext.getTextToReplace();
- // skip number
- int unitIndex = -1;
- for (int i = 0; i < fullText.length(); i++) {
- if (Character.isDigit(fullText.charAt(i))) {
- unitIndex = i + 1;
- } else {
- break;
- }
- }
-
- String unitSubText = ""; //$NON-NLS-1$
- String numSubText = ""; //$NON-NLS-1$
- if (0 <= unitIndex) {
- numSubText = fullText.substring(0, unitIndex);
- if (unitIndex < fullText.length()) {
- unitSubText = fullText.substring(unitIndex);
- }
- } else {
- unitSubText = fullText;
- }
-
- Iterator i = prop.getDescendants();
- while (i.hasNext()) {
- CSSMMUnit unit = (CSSMMUnit) i.next();
- String unitString = unit.getUnitString();
- if ((0 < unitSubText.length() && unitString.indexOf(unitSubText) != 0) || (0 < numSubText.length() && unitString.equals("#"))) { //$NON-NLS-1$
- continue;
- }
-
- String text = numSubText + unitString;
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- if (0 < numSubText.length() || text.equals("#")) { //$NON-NLS-1$
- item.setCursorPosition(text.length());
- } else {
- item.setCursorPosition(0);
- }
- item.setDisplayString(text);
- item.setImageType(CSSImageType.VALUE_NUMBER);
- appendSemiColon(item);
- candidates.add(item);
- }
- }
-
- /**
- *
- */
- private void checkSemiColon() {
- fAppendSemiColon = false;
-
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // find trailing ":" or ";"
- // if ":" before ";" is found, add ";"
- RegionIterator iterator = fContext.getRegionIterator();
- IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
- while (iterator.hasNext()) {
- ITextRegion region = iterator.next();
- if (iterator.getStructuredDocumentRegion() != container) {
- break;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- fAppendSemiColon = true;
- break;
- }
- }
- if (!fAppendSemiColon) {
- // second chance:
- // leading IStructuredDocumentRegion is not ";"
- IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
- if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- fAppendSemiColon = true;
- }
- }
- }
- }
-
- /**
- *
- */
- private void appendSemiColon(CSSCACandidate item) {
- if (fAppendSemiColon) {
- String replacementString = item.getReplacementString();
- item.setReplacementString(replacementString + ";"); //$NON-NLS-1$
- int cursorPosition = item.getCursorPosition();
- if (replacementString.length() <= cursorPosition) {
- // cursorpos is tail of string
- cursorPosition++;
- item.setCursorPosition(cursorPosition);
- }
- }
- }
-
- /**
- *
- */
- private void addSemiColon(List candidates) {
- ICSSNode targetNode = fContext.getTargetNode();
- if (targetNode instanceof ICSSStyleDeclItem) {
- ICSSNode firstChild = targetNode.getFirstChild();
- if (firstChild == null) {
- return;
- }
- if (firstChild instanceof IndexedRegion) {
- int startOffset = ((IndexedRegion) firstChild).getStartOffset();
- if (fContext.getCursorPos() <= startOffset) {
- return;
- }
- }
- }
-
- boolean bAddCloser = false;
-
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // find trailing ":" or ";"
- // if ":" before ";" is found, add ";"
- RegionIterator iterator = fContext.getRegionIterator();
- IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
- while (iterator.hasNext()) {
- ITextRegion region = iterator.next();
- if (iterator.getStructuredDocumentRegion() != container) {
- break;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- bAddCloser = true;
- break;
- }
- }
- if (!bAddCloser) {
- // second chance:
- // leading IStructuredDocumentRegion is not ";"
- IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
- if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- bAddCloser = true;
- }
- }
- }
-
- if (bAddCloser) {
- CSSCACandidate item = new CSSCACandidate();
- String text = fContext.getTextToReplace() + ";";//$NON-NLS-1$
- item.setReplacementString(text);
- item.setCursorPosition(text.length());
- item.setDisplayString(";");//$NON-NLS-1$
- item.setImageType(null);
- candidates.add(item);
- }
- }
-
- /**
- *
- */
- private void addString(List candidates, String text) {
- if (!isMatch(text)) {
- return;
- }
-
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(text.length());
- item.setDisplayString(text);
- item.setImageType(CSSImageType.VALUE_STRING);
- appendSemiColon(item);
- candidates.add(item);
- }
-
- private void addImportant(List candidates) {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (!(targetNode instanceof ICSSStyleDeclItem)) {
- return;
- }
- // 1. has no priority region
- // 2. cursor position is after of last child
- // 3. normal isMatch method
- String priority = ((ICSSStyleDeclItem) targetNode).getPriority();
- if (priority == null || priority.length() == 0) {
- ICSSNode lastChild = targetNode.getLastChild();
- if (lastChild instanceof IndexedRegion) {
- int startOffset = ((IndexedRegion) lastChild).getStartOffset();
- // int endOffset = ((IndexedRegion)lastChild).getEndOffset();
- if (startOffset < fContext.getCursorPos() && isMatch(IMPORTANT)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(IMPORTANT);
- item.setCursorPosition(IMPORTANT.length());
- item.setDisplayString(IMPORTANT);
- item.setImageType(CSSImageType.VALUE_STRING);
- appendSemiColon(item);
- candidates.add(item);
- }
- }
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- checkSemiColon(); // check should add semi-colon or not
-
- String name = getPropertyName();
- if (name != null) {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- Iterator i = Collections.EMPTY_LIST.iterator();
- if (isFontFaceRule()) {
- CSSMMDescriptor desc = util.getDescriptor(name);
- if (desc != null) {
- i = desc.getValues();
- }
- } else {
- CSSMMProperty prop = util.getProperty(name);
- if (prop != null) {
- i = prop.getValues();
- }
- }
- while (i.hasNext()) {
- CSSMMNode val = (CSSMMNode) i.next();
- String valueType = val.getType();
- if (valueType == CSSMMNode.TYPE_KEYWORD) {
- addString(candidates, val.toString());
- } else if (valueType == CSSMMNode.TYPE_NUMBER) {
- addNumber(candidates, (CSSMMNumber) val);
- } else if (valueType == CSSMMNode.TYPE_FUNCTION) {
- addFunction(candidates, (CSSMMFunction) val);
- }
- }
- }
-
- addImportant(candidates);
- addSemiColon(candidates);
-
- return candidates.iterator();
- }
-
- /**
- * @return java.lang.String
- */
- private String getPropertyName() {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (targetNode instanceof ICSSStyleDeclItem) {
- return ((ICSSStyleDeclItem) targetNode).getPropertyName();
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private boolean isFontFaceRule() {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (targetNode instanceof ICSSStyleDeclItem) {
- targetNode = targetNode.getParentNode(); // get Declaration
- if (targetNode != null) {
- // inline style has no rule node
- targetNode = targetNode.getParentNode(); // get rule
- }
- }
- return (targetNode instanceof CSSFontFaceRule);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
deleted file mode 100644
index 6302cb15bb..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
+++ /dev/null
@@ -1,159 +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.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-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.ICSSStyleRule;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-class CSSProposalGeneratorForHTMLTag extends CSSProposalGenerator {
-
- /**
- * CSSStyleRuleProposalGenerator constructor comment.
- *
- */
- CSSProposalGeneratorForHTMLTag(CSSContentAssistContext context) {
- super(context);
-
- if (fHTMLTags == null) {
- fHTMLTags = setupHTMLTags();
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- if (checkLeadingColon()) {
- return candidates.iterator();
- }
-
- boolean bLowerCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER;
- // XHTML requires lower case
- if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- Node domNode = fContext.getModel().getOwnerDOMNode();
- if (domNode != null && !(domNode instanceof Document)) {
- domNode = domNode.getOwnerDocument();
- if (domNode instanceof IDOMDocument) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) domNode).getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null)
- bLowerCase = (adapter.getTagNameCase() == DocumentTypeAdapter.LOWER_CASE);
- }
- }
- }
-
-
- int length = fHTMLTags.length;
- for (int i = 0; i < length; i++) {
- String tagText = fHTMLTags[i];
- if (bLowerCase) {
- tagText = tagText.toLowerCase();
- }
- if (!isMatch(tagText)) {
- continue;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- buf.append(tagText);
- cursorPos += tagText.length();
- boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule);
- if (!inRule || fContext.getTextToReplace().length() == 0) {
- buf.append(" ");//$NON-NLS-1$
- cursorPos += 1;
- }
- if (!inRule) {
- StringAndOffset sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(tagText);
- item.setImageType(CSSImageType.SELECTOR_TAG);
- candidates.add(item);
- }
-
- return candidates.iterator();
- }
-
- /**
- *
- */
- private static String[] setupHTMLTags() {
- CMDocument cmdoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- CMNamedNodeMap elements = cmdoc.getElements();
- Vector names = new Vector();
- int nElements = elements.getLength();
- for (int i = 0; i < nElements; i++) {
- CMElementDeclaration edec = (CMElementDeclaration) elements.item(i);
- if (isAttrDefined(edec, HTML40Namespace.ATTR_NAME_STYLE)) {
- names.add(edec.getElementName());
- }
- }
- Collections.sort(names);
- String[] tags = new String[names.size()];
- Iterator iNames = names.iterator();
- for (int i = 0; iNames.hasNext(); i++) {
- tags[i] = (String) iNames.next();
- }
- return tags;
- }
-
- /**
- *
- */
- private static boolean isAttrDefined(CMElementDeclaration edec, String attrName) {
- if (edec == null) {
- return false;
- }
- CMNamedNodeMap attrs = edec.getAttributes();
- if (attrs == null) {
- return false;
- }
- for (int i = 0; i < attrs.getLength(); i++) {
- CMAttributeDeclaration attr = (CMAttributeDeclaration) attrs.item(i);
- if (attr == null) {
- continue;
- }
- if (attr.getAttrName().equalsIgnoreCase(attrName)) {
- return true;
- }
- }
- return false;
- }
-
- private static String[] fHTMLTags = null;
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
deleted file mode 100644
index ad49fa8efc..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-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.util.CSSMMTypeCollector;
-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.preferences.CSSCorePreferenceNames;
-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.ICSSStyleRule;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-/**
- *
- */
-class CSSProposalGeneratorForPseudoSelector extends CSSProposalGenerator {
-
- /**
- * CSSProposalGeneratorForPseudoSelector constructor comment.
- *
- */
- CSSProposalGeneratorForPseudoSelector(CSSContentAssistContext context) {
- super(context);
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- boolean hasLeadingColon = checkLeadingColon();
- String textToReplace = fContext.getTextToReplace();
- if (!hasLeadingColon && 0 < textToReplace.length() && !textToReplace.equals(fContext.getTextToCompare())) {
- // cursor placed midpoint of the region
- return candidates.iterator();
- }
- ITextRegion region = fContext.getTargetRegion();
- if (region != null) {
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_S && !CSSRegionUtil.isSelectorBegginingType(type)) {
- return candidates.iterator();
- }
- }
-
- boolean useUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
-
- List tags = getSelectorTags();
- Collections.sort(tags, new Comparator() {
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- return clean(((CSSMMSelector) o1).getName()).compareTo(clean(((CSSMMSelector) o2).getName()));
- }
-
- private String clean(String str) {
- int length = str.length();
- for (int i = 0; i < length; i++) {
- if (str.charAt(i) != ':') {
- return str.substring(i);
- }
- }
- return str;
- }
- });
-
- Iterator i = tags.iterator();
- while (i.hasNext()) {
- CSSMMSelector selector = (CSSMMSelector) i.next();
- String text = selector.getSelectorString();
- if (hasLeadingColon && !isMatch(text)) {
- continue;
- }
- text = (useUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
-
- if (!hasLeadingColon)
- buf.append(textToReplace);
-
- buf.append(text);
- cursorPos += buf.length();
-
- if (0 < buf.length()) {
- // Pseudoclass/element takes arguments
- if (buf.charAt(buf.length() - 1) == ')') {
- --cursorPos;
- }
- boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule || fContext.getTargetNode() instanceof ICSSPageRule);
- if (!inRule || (textToReplace.length() == 0 && !hasLeadingColon)) {
- buf.append(" ");//$NON-NLS-1$
- cursorPos += 1;
- }
- if (!inRule) {
- StringAndOffset sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setImageType(CSSImageType.SELECTOR_PSEUDO);
- item.setMMNode(selector);
- candidates.add(item);
- }
- }
-
- return candidates.iterator();
- }
-
- /**
- *
- */
- List getSelectorTags() {
- List tagList = new ArrayList();
- ICSSNode targetNode = fContext.getTargetNode();
- String rootType = (targetNode instanceof ICSSPageRule) ? CSSMMNode.TYPE_PAGE_RULE : CSSMMNode.TYPE_STYLE_RULE;
-
- CSSMMTypeCollector collector = new CSSMMTypeCollector();
- collector.collectNestedType(false);
- collector.apply(fContext.getMetaModel(), rootType);
- Iterator i;
- i = collector.getNodes();
- if (!i.hasNext()) {
- return tagList;
- }
- CSSMMNode node = (CSSMMNode) i.next();
- i = node.getChildNodes();
- while (i.hasNext()) {
- CSSMMNode child = (CSSMMNode) i.next();
- if (child.getType() == CSSMMNode.TYPE_SELECTOR) {
- String selType = ((CSSMMSelector) child).getSelectorType();
- if (selType == CSSMMSelector.TYPE_PSEUDO_CLASS || selType == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
- tagList.add(child);
- }
- }
- }
- return tagList;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java
deleted file mode 100644
index 0d37ed74f1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java
+++ /dev/null
@@ -1,41 +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.wst.css.ui.internal.contentassist;
-
-
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-
-/**
- * <p>Implementation of {@link StructuredContentAssistProcessor} for CSS documents</p>
- *
- * <p>Currently the CSS content assist processor does not do anything different then
- * the {@link StructuredContentAssistProcessor} but at some point it may have to
- * react to user preference changes</p>
- *
- * @see StructuredContentAssistProcessor
- */
-public class CSSStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
- /**
- * <p>Constructor</p>
- *
- * @param assistant {@link ContentAssistant} to use
- * @param partitionTypeID the partition type this processor is for
- * @param viewer {@link ITextViewer} this processor is acting in
- */
- public CSSStructuredContentAssistProcessor(ContentAssistant assistant,
- String partitionTypeID, ITextViewer viewer) {
-
- super(assistant, partitionTypeID, viewer, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java
deleted file mode 100644
index 6605bdbb09..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,72 +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.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-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.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-
-
-/**
- * Completion processor for CSS Templates. Most of the work is already done
- * by the CSS Content Assist processor, so by the time the
- * CSSTemplateCompletionProcessor is asked for content assist proposals, the
- * CSS content assist processor has already set the context type for
- * templates.
- */
-class CSSTemplateCompletionProcessor extends TemplateCompletionProcessor {
- private String fContextTypeId = null;
-
- 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 CSSImageHelper.getInstance().getImage(CSSEditorPluginImages.IMG_OBJ_TEMPLATE);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return CSSUIPlugin.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 CSSUIPlugin.getDefault().getTemplateStore();
- }
-
- void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java
deleted file mode 100644
index 2b58dc6be9..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java
+++ /dev/null
@@ -1,107 +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.wst.css.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-
-/**
- * <p>Completion computer for CSS templates</p>
- */
-public class CSSTemplatesCompletionProposalComputer implements ICompletionProposalComputer {
- /** <p>The template processor used to create the proposals</p> */
- private CSSTemplateCompletionProcessor fTemplateProcessor = null;
-
- /**
- * <p>Create the computer</p>
- */
- public CSSTemplatesCompletionProposalComputer() {
- fTemplateProcessor = new CSSTemplateCompletionProcessor();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- List proposals = new ArrayList();
-
- boolean isEmptyDocument =
- ContentAssistUtils.isViewerEmpty(context.getViewer());
- if (isEmptyDocument) {
- proposals.addAll(getTemplates(TemplateContextTypeIdsCSS.NEW, context));
- }
- proposals.addAll(getTemplates(TemplateContextTypeIdsCSS.ALL, context));
-
-
- return proposals;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
- */
- public String getErrorMessage() {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
- */
- public void sessionStarted() {
- //default is to do nothing
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- //default is to do nothing
- }
-
-
- /**
- * <p>Gets template proposals for the given template and proposal contexts</p>
- *
- * @param templateContext the template context
- * @param context the proposal context
- * @return {@link List} of template proposals for the given contexts
- */
- private List getTemplates(String templateContext,
- CompletionProposalInvocationContext context) {
-
- fTemplateProcessor.setContextType(templateContext);
- ICompletionProposal[] proposals = fTemplateProcessor.computeCompletionProposals(
- context.getViewer(), context.getInvocationOffset());
-
- return Arrays.asList(proposals);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CompletionProposal.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CompletionProposal.java
deleted file mode 100644
index ccccf08cda..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CompletionProposal.java
+++ /dev/null
@@ -1,188 +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.wst.css.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.internal.text.html.BrowserInformationControl;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-public class CompletionProposal implements ICompletionProposal, ICompletionProposalExtension3, ICompletionProposalExtension5 {
-
- /** The string to be displayed in the completion proposal popup. */
- private String fDisplayString;
- /** The replacement string. */
- private String fReplacementString;
- /** The replacement offset. */
- private int fReplacementOffset;
- /** The replacement length. */
- private int fReplacementLength;
- /** The cursor position after this proposal has been applied. */
- private int fCursorPosition;
- /** The image to be displayed in the completion proposal popup. */
- private Image fImage;
- /** The context information of this proposal. */
- private IContextInformation fContextInformation;
- /** The additional info of this proposal. */
- private String fAdditionalProposalInfo;
- private CSSMMNode fNode;
- /** The information control creator */
- private IInformationControlCreator fCreator;
-
- /**
- * Creates a new completion proposal based on the provided information. The replacement string is
- * considered being the display string too. All remaining fields are set to <code>null</code>.
- *
- * @param replacementString the actual string to be inserted into the document
- * @param replacementOffset the offset of the text to be replaced
- * @param replacementLength the length of the text to be replaced
- * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
- */
- public CompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition) {
- this(replacementString, replacementOffset, replacementLength, cursorPosition, null, null, null, null);
- }
-
- /**
- * Creates a new completion proposal. All fields are initialized based on the provided information.
- *
- * @param replacementString the actual string to be inserted into the document
- * @param replacementOffset the offset of the text to be replaced
- * @param replacementLength the length of the text to be replaced
- * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
- * @param image the image to display for this proposal
- * @param displayString the string to be displayed for the proposal
- * @param contextInformation the context information associated with this proposal
- * @param additionalProposalInfo the additional information associated with this proposal
- */
- public CompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo) {
- this(replacementString, replacementOffset, replacementLength, cursorPosition, null, null, null, null, null);
- }
-
- public CompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, CSSMMNode node) {
- Assert.isNotNull(replacementString);
- Assert.isTrue(replacementOffset >= 0);
- Assert.isTrue(replacementLength >= 0);
- Assert.isTrue(cursorPosition >= 0);
-
- fReplacementString= replacementString;
- fReplacementOffset= replacementOffset;
- fReplacementLength= replacementLength;
- fCursorPosition= cursorPosition;
- fImage= image;
- fDisplayString= displayString;
- fContextInformation= contextInformation;
- fAdditionalProposalInfo= additionalProposalInfo;
- fNode = node;
- }
- /*
- * @see ICompletionProposal#apply(IDocument)
- */
- public void apply(IDocument document) {
- try {
- document.replace(fReplacementOffset, fReplacementLength, fReplacementString);
- } catch (BadLocationException x) {
- // ignore
- }
- }
-
- /*
- * @see ICompletionProposal#getSelection(IDocument)
- */
- public Point getSelection(IDocument document) {
- return new Point(fReplacementOffset + fCursorPosition, 0);
- }
-
- /*
- * @see ICompletionProposal#getContextInformation()
- */
- public IContextInformation getContextInformation() {
- return fContextInformation;
- }
-
- /*
- * @see ICompletionProposal#getImage()
- */
- public Image getImage() {
- return fImage;
- }
-
- /*
- * @see ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- if (fDisplayString != null)
- return fDisplayString;
- return fReplacementString;
- }
-
- /*
- * @see ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return fAdditionalProposalInfo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
- return ProposalInfoFactory.getProposalInfo(fNode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator()
- */
- public IInformationControlCreator getInformationControlCreator() {
- if (fCreator == null) {
- fCreator = new AbstractReusableInformationControlCreator() {
-
- protected IInformationControl doCreateInformationControl(Shell parent) {
- if (BrowserInformationControl.isAvailable(parent)) {
- BrowserInformationControl control = new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false);
- return control;
- } else {
- return new DefaultInformationControl(parent, true);
- }
- }
- };
- }
- return fCreator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionText(org.eclipse.jface.text.IDocument, int)
- */
- public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionStart(org.eclipse.jface.text.IDocument, int)
- */
- public int getPrefixCompletionStart(IDocument document, int completionOffset) {
- return 0;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java
deleted file mode 100644
index c8c0e30948..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java
+++ /dev/null
@@ -1,890 +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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface HTML40Namespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = "A"; //$NON-NLS-1$
- public static final String ABBR = "ABBR"; //$NON-NLS-1$
- public static final String ACRONYM = "ACRONYM"; //$NON-NLS-1$
- public static final String ADDRESS = "ADDRESS"; //$NON-NLS-1$
- public static final String APPLET = "APPLET"; //$NON-NLS-1$
- public static final String AREA = "AREA"; //$NON-NLS-1$
- public static final String B = "B"; //$NON-NLS-1$
- public static final String BASE = "BASE"; //$NON-NLS-1$
- public static final String BASEFONT = "BASEFONT"; //$NON-NLS-1$
- public static final String BDO = "BDO"; //$NON-NLS-1$
- public static final String BGSOUND = "BGSOUND"; // D205513
- // //$NON-NLS-1$
- public static final String BIG = "BIG"; //$NON-NLS-1$
- public static final String BLINK = "BLINK"; //$NON-NLS-1$
- public static final String BLOCKQUOTE = "BLOCKQUOTE"; //$NON-NLS-1$
- public static final String BODY = "BODY"; //$NON-NLS-1$
- public static final String BR = "BR"; //$NON-NLS-1$
- public static final String BUTTON = "BUTTON"; //$NON-NLS-1$
- public static final String CAPTION = "CAPTION"; //$NON-NLS-1$
- public static final String CENTER = "CENTER"; //$NON-NLS-1$
- public static final String CITE = "CITE"; //$NON-NLS-1$
- public static final String CODE = "CODE"; //$NON-NLS-1$
- public static final String COL = "COL"; //$NON-NLS-1$
- public static final String COLGROUP = "COLGROUP"; //$NON-NLS-1$
- public static final String DD = "DD"; //$NON-NLS-1$
- public static final String DEL = "DEL"; //$NON-NLS-1$
- public static final String DFN = "DFN"; //$NON-NLS-1$
- public static final String DIR = "DIR"; //$NON-NLS-1$
- public static final String DIV = "DIV"; //$NON-NLS-1$
- public static final String DL = "DL"; //$NON-NLS-1$
- public static final String DT = "DT"; //$NON-NLS-1$
- public static final String EM = "EM"; //$NON-NLS-1$
- public static final String EMBED = "EMBED"; //$NON-NLS-1$
- public static final String FIELDSET = "FIELDSET"; //$NON-NLS-1$
- public static final String FONT = "FONT"; //$NON-NLS-1$
- public static final String FORM = "FORM"; //$NON-NLS-1$
- public static final String FRAME = "FRAME"; //$NON-NLS-1$
- public static final String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public static final String H1 = "H1"; //$NON-NLS-1$
- public static final String H2 = "H2"; //$NON-NLS-1$
- public static final String H3 = "H3"; //$NON-NLS-1$
- public static final String H4 = "H4"; //$NON-NLS-1$
- public static final String H5 = "H5"; //$NON-NLS-1$
- public static final String H6 = "H6"; //$NON-NLS-1$
- public static final String HEAD = "HEAD"; //$NON-NLS-1$
- public static final String HR = "HR"; //$NON-NLS-1$
- public static final String HTML = "HTML"; //$NON-NLS-1$
- public static final String I = "I"; //$NON-NLS-1$
- public static final String IFRAME = "IFRAME"; //$NON-NLS-1$
- public static final String IMG = "IMG"; //$NON-NLS-1$
- public static final String INPUT = "INPUT"; //$NON-NLS-1$
- public static final String INS = "INS"; //$NON-NLS-1$
- public static final String ISINDEX = "ISINDEX"; //$NON-NLS-1$
- public static final String KBD = "KBD"; //$NON-NLS-1$
- public static final String LABEL = "LABEL"; //$NON-NLS-1$
- public static final String LEGEND = "LEGEND"; //$NON-NLS-1$
- public static final String LI = "LI"; //$NON-NLS-1$
- public static final String LINK = "LINK"; //$NON-NLS-1$
- public static final String MAP = "MAP"; //$NON-NLS-1$
- public static final String MENU = "MENU"; //$NON-NLS-1$
- public static final String META = "META"; //$NON-NLS-1$
- public static final String NOBR = "NOBR"; // D205513 //$NON-NLS-1$
- public static final String NOEMBED = "NOEMBED"; //$NON-NLS-1$
- public static final String NOFRAMES = "NOFRAMES"; //$NON-NLS-1$
- public static final String NOSCRIPT = "NOSCRIPT"; //$NON-NLS-1$
- public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
- public static final String OL = "OL"; //$NON-NLS-1$
- public static final String OPTGROUP = "OPTGROUP"; //$NON-NLS-1$
- public static final String OPTION = "OPTION"; //$NON-NLS-1$
- public static final String P = "P"; //$NON-NLS-1$
- public static final String PARAM = "PARAM"; //$NON-NLS-1$
- public static final String PRE = "PRE"; //$NON-NLS-1$
- public static final String Q = "Q"; //$NON-NLS-1$
- public static final String S = "S"; //$NON-NLS-1$
- public static final String SAMP = "SAMP"; //$NON-NLS-1$
- public static final String SCRIPT = "SCRIPT"; //$NON-NLS-1$
- public static final String SELECT = "SELECT"; //$NON-NLS-1$
- public static final String SMALL = "SMALL"; //$NON-NLS-1$
- public static final String SPAN = "SPAN"; //$NON-NLS-1$
- public static final String STRIKE = "STRIKE"; //$NON-NLS-1$
- public static final String STRONG = "STRONG"; //$NON-NLS-1$
- public static final String STYLE = "STYLE"; //$NON-NLS-1$
- public static final String SUB = "SUB"; //$NON-NLS-1$
- public static final String SUP = "SUP"; //$NON-NLS-1$
- public static final String TABLE = "TABLE"; //$NON-NLS-1$
- public static final String TBODY = "TBODY"; //$NON-NLS-1$
- public static final String TD = "TD"; //$NON-NLS-1$
- public static final String TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
- public static final String TFOOT = "TFOOT"; //$NON-NLS-1$
- public static final String TH = "TH"; //$NON-NLS-1$
- public static final String THEAD = "THEAD"; //$NON-NLS-1$
- public static final String TITLE = "TITLE"; //$NON-NLS-1$
- public static final String TR = "TR"; //$NON-NLS-1$
- public static final String TT = "TT"; //$NON-NLS-1$
- public static final String U = "U"; //$NON-NLS-1$
- public static final String UL = "UL"; //$NON-NLS-1$
- public static final String VAR = "VAR"; //$NON-NLS-1$
- public static final String WBR = "WBR"; // D205513 //$NON-NLS-1$
- public static final String MARQUEE = "MARQUEE"; //$NON-NLS-1$
- public static final String SSI_CONFIG = "SSI:CONFIG"; // D210393
- // //$NON-NLS-1$
- public static final String SSI_ECHO = "SSI:ECHO"; //$NON-NLS-1$
- public static final String SSI_EXEC = "SSI:EXEC"; //$NON-NLS-1$
- public static final String SSI_FSIZE = "SSI:FSIZE"; //$NON-NLS-1$
- public static final String SSI_FLASTMOD = "SSI:FLASTMOD"; //$NON-NLS-1$
- public static final String SSI_INCLUDE = "SSI:INCLUDE"; //$NON-NLS-1$
- public static final String SSI_PRINTENV = "SSI:PRINTENV"; //$NON-NLS-1$
- public static final String SSI_SET = "SSI:SET"; //$NON-NLS-1$
- public static final String WML_WML = "wml"; //$NON-NLS-1$
- public static final String WML_CARD = "card"; //$NON-NLS-1$
- public static final String WML_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String WML_ACCESS = "access"; //$NON-NLS-1$
- public static final String WML_DO = "do"; //$NON-NLS-1$
- public static final String WML_ONEVENT = "onevent"; //$NON-NLS-1$
- public static final String WML_TIMER = "timer"; //$NON-NLS-1$
- public static final String WML_ANCHOR = "anchor"; //$NON-NLS-1$
- public static final String WML_PREV = "prev"; //$NON-NLS-1$
- public static final String WML_REFRESH = "refresh"; //$NON-NLS-1$
- public static final String WML_GO = "go"; //$NON-NLS-1$
- public static final String WML_NOOP = "noop"; //$NON-NLS-1$
- public static final String WML_SETVAR = "setvar"; //$NON-NLS-1$
- public static final String WML_POSTFIELD = "postfield"; //$NON-NLS-1$
- }
-
- // Character Entities
- public static interface EntityName {
- public static final String AACUTE_U = "Aacute"; //$NON-NLS-1$
- public static final String AACUTE_L = "aacute"; //$NON-NLS-1$
- public static final String ACIRC_U = "Acirc"; //$NON-NLS-1$
- public static final String ACIRC_L = "acirc"; //$NON-NLS-1$
- public static final String ACUTE = "acute"; //$NON-NLS-1$
- public static final String AELIG_U = "AElig"; //$NON-NLS-1$
- public static final String AELIG_L = "aelig"; //$NON-NLS-1$
- public static final String AGRAVE_U = "Agrave"; //$NON-NLS-1$
- public static final String AGRAVE_L = "agrave"; //$NON-NLS-1$
- public static final String ALEFSYM = "alefsym"; //$NON-NLS-1$
- public static final String ALPHA_U = "Alpha"; //$NON-NLS-1$
- public static final String ALPHA_L = "alpha"; //$NON-NLS-1$
- public static final String AMP = "amp"; //$NON-NLS-1$
- public static final String AND = "and"; //$NON-NLS-1$
- public static final String ANG = "ang"; //$NON-NLS-1$
- public static final String ARING_U = "Aring"; //$NON-NLS-1$
- public static final String ARING_L = "aring"; //$NON-NLS-1$
- public static final String ASYMP = "asymp"; //$NON-NLS-1$
- public static final String ATILDE_U = "Atilde"; //$NON-NLS-1$
- public static final String ATILDE_L = "atilde"; //$NON-NLS-1$
- public static final String AUML_U = "Auml"; //$NON-NLS-1$
- public static final String AUML_L = "auml"; //$NON-NLS-1$
- public static final String BDQUO = "bdquo"; //$NON-NLS-1$
- public static final String BETA_U = "Beta"; //$NON-NLS-1$
- public static final String BETA_L = "beta"; //$NON-NLS-1$
- public static final String BRVBAR = "brvbar"; //$NON-NLS-1$
- public static final String BULL = "bull"; //$NON-NLS-1$
- public static final String CAP = "cap"; //$NON-NLS-1$
- public static final String CCEDIL_U = "Ccedil"; //$NON-NLS-1$
- public static final String CCEDIL_L = "ccedil"; //$NON-NLS-1$
- public static final String CEDIL = "cedil"; //$NON-NLS-1$
- public static final String CENT = "cent"; //$NON-NLS-1$
- public static final String CHI_U = "Chi"; //$NON-NLS-1$
- public static final String CHI_L = "chi"; //$NON-NLS-1$
- public static final String CIRC = "circ"; //$NON-NLS-1$
- public static final String CLUBS = "clubs"; //$NON-NLS-1$
- public static final String CONG = "cong"; //$NON-NLS-1$
- public static final String COPY = "copy"; //$NON-NLS-1$
- public static final String CRARR = "crarr"; //$NON-NLS-1$
- public static final String CUP = "cup"; //$NON-NLS-1$
- public static final String CURREN = "curren"; //$NON-NLS-1$
- public static final String DAGGER_U = "Dagger"; //$NON-NLS-1$
- public static final String DAGGER_L = "dagger"; //$NON-NLS-1$
- public static final String DARR_U = "dArr"; //$NON-NLS-1$
- public static final String DARR_L = "darr"; //$NON-NLS-1$
- public static final String DEG = "deg"; //$NON-NLS-1$
- public static final String DELTA_U = "Delta"; //$NON-NLS-1$
- public static final String DELTA_L = "delta"; //$NON-NLS-1$
- public static final String DIAMS = "diams"; //$NON-NLS-1$
- public static final String DIVIDE = "divide"; //$NON-NLS-1$
- public static final String EACUTE_U = "Eacute"; //$NON-NLS-1$
- public static final String EACUTE_L = "eacute"; //$NON-NLS-1$
- public static final String ECIRC_U = "Ecirc"; //$NON-NLS-1$
- public static final String ECIRC_L = "ecirc"; //$NON-NLS-1$
- public static final String EGRAVE_U = "Egrave"; //$NON-NLS-1$
- public static final String EGRAVE_L = "egrave"; //$NON-NLS-1$
- public static final String EMPTY = "empty"; //$NON-NLS-1$
- public static final String EMSP = "emsp"; //$NON-NLS-1$
- public static final String ENSP = "ensp"; //$NON-NLS-1$
- public static final String EPSILON_U = "Epsilon"; //$NON-NLS-1$
- public static final String EPSILON_L = "epsilon"; //$NON-NLS-1$
- public static final String EQUIV = "equiv"; //$NON-NLS-1$
- public static final String ETA_U = "Eta"; //$NON-NLS-1$
- public static final String ETA_L = "eta"; //$NON-NLS-1$
- public static final String ETH_U = "ETH"; //$NON-NLS-1$
- public static final String ETH_L = "eth"; //$NON-NLS-1$
- public static final String EUML_U = "Euml"; //$NON-NLS-1$
- public static final String EUML_L = "euml"; //$NON-NLS-1$
- public static final String EURO = "euro"; //$NON-NLS-1$
- public static final String EXIST = "exist"; //$NON-NLS-1$
- public static final String FNOF = "fnof"; //$NON-NLS-1$
- public static final String FORALL = "forall"; //$NON-NLS-1$
- public static final String FRAC12 = "frac12"; //$NON-NLS-1$
- public static final String FRAC14 = "frac14"; //$NON-NLS-1$
- public static final String FRAC34 = "frac34"; //$NON-NLS-1$
- public static final String FRASL = "frasl"; //$NON-NLS-1$
- public static final String GAMMA_U = "Gamma"; //$NON-NLS-1$
- public static final String GAMMA_L = "gamma"; //$NON-NLS-1$
- public static final String GE = "ge"; //$NON-NLS-1$
- public static final String GT = "gt"; //$NON-NLS-1$
- public static final String HARR_U = "hArr"; //$NON-NLS-1$
- public static final String HARR_L = "harr"; //$NON-NLS-1$
- public static final String HEARTS = "hearts"; //$NON-NLS-1$
- public static final String HELLIP = "hellip"; //$NON-NLS-1$
- public static final String IACUTE_U = "Iacute"; //$NON-NLS-1$
- public static final String IACUTE_L = "iacute"; //$NON-NLS-1$
- public static final String ICIRC_U = "Icirc"; //$NON-NLS-1$
- public static final String ICIRC_L = "icirc"; //$NON-NLS-1$
- public static final String IEXCL = "iexcl"; //$NON-NLS-1$
- public static final String IGRAVE_U = "Igrave"; //$NON-NLS-1$
- public static final String IGRAVE_L = "igrave"; //$NON-NLS-1$
- public static final String IMAGE = "image"; //$NON-NLS-1$
- public static final String INFIN = "infin"; //$NON-NLS-1$
- public static final String INT = "int"; //$NON-NLS-1$
- public static final String IOTA_U = "Iota"; //$NON-NLS-1$
- public static final String IOTA_L = "iota"; //$NON-NLS-1$
- public static final String IQUEST = "iquest"; //$NON-NLS-1$
- public static final String ISIN = "isin"; //$NON-NLS-1$
- public static final String IUML_U = "Iuml"; //$NON-NLS-1$
- public static final String IUML_L = "iuml"; //$NON-NLS-1$
- public static final String KAPPA_U = "Kappa"; //$NON-NLS-1$
- public static final String KAPPA_L = "kappa"; //$NON-NLS-1$
- public static final String LAMBDA_U = "Lambda"; //$NON-NLS-1$
- public static final String LAMBDA_L = "lambda"; //$NON-NLS-1$
- public static final String LANG = "lang"; //$NON-NLS-1$
- public static final String LAQUO = "laquo"; //$NON-NLS-1$
- public static final String LARR_U = "lArr"; //$NON-NLS-1$
- public static final String LARR_L = "larr"; //$NON-NLS-1$
- public static final String LCEIL = "lceil"; //$NON-NLS-1$
- public static final String LDQUO = "ldquo"; //$NON-NLS-1$
- public static final String LE = "le"; //$NON-NLS-1$
- public static final String LFLOOR = "lfloor"; //$NON-NLS-1$
- public static final String LOWAST = "lowast"; //$NON-NLS-1$
- public static final String LOZ = "loz"; //$NON-NLS-1$
- public static final String LRM = "lrm"; //$NON-NLS-1$
- public static final String LSAQUO = "lsaquo"; //$NON-NLS-1$
- public static final String LSQUO = "lsquo"; //$NON-NLS-1$
- public static final String LT = "lt"; //$NON-NLS-1$
- public static final String MACR = "macr"; //$NON-NLS-1$
- public static final String MDASH = "mdash"; //$NON-NLS-1$
- public static final String MICRO = "micro"; //$NON-NLS-1$
- public static final String MIDDOT = "middot"; //$NON-NLS-1$
- public static final String MINUS = "minus"; //$NON-NLS-1$
- public static final String MU_U = "Mu"; //$NON-NLS-1$
- public static final String MU_L = "mu"; //$NON-NLS-1$
- public static final String NABLA = "nabla"; //$NON-NLS-1$
- public static final String NBSP = "nbsp"; //$NON-NLS-1$
- public static final String NDASH = "ndash"; //$NON-NLS-1$
- public static final String NE = "ne"; //$NON-NLS-1$
- public static final String NI = "ni"; //$NON-NLS-1$
- public static final String NOT = "not"; //$NON-NLS-1$
- public static final String NOTIN = "notin"; //$NON-NLS-1$
- public static final String NSUB = "nsub"; //$NON-NLS-1$
- public static final String NTILDE_U = "Ntilde"; //$NON-NLS-1$
- public static final String NTILDE_L = "ntilde"; //$NON-NLS-1$
- public static final String NU_U = "Nu"; //$NON-NLS-1$
- public static final String NU_L = "nu"; //$NON-NLS-1$
- public static final String OACUTE_U = "Oacute"; //$NON-NLS-1$
- public static final String OACUTE_L = "oacute"; //$NON-NLS-1$
- public static final String OCIRC_U = "Ocirc"; //$NON-NLS-1$
- public static final String OCIRC_L = "ocirc"; //$NON-NLS-1$
- public static final String OELIG_U = "OElig"; //$NON-NLS-1$
- public static final String OELIG_L = "oelig"; //$NON-NLS-1$
- public static final String OGRAVE_U = "Ograve"; //$NON-NLS-1$
- public static final String OGRAVE_L = "ograve"; //$NON-NLS-1$
- public static final String OLINE = "oline"; //$NON-NLS-1$
- public static final String OMEGA_U = "Omega"; //$NON-NLS-1$
- public static final String OMEGA_L = "omega"; //$NON-NLS-1$
- public static final String OMICRON_U = "Omicron"; //$NON-NLS-1$
- public static final String OMICRON_L = "omicron"; //$NON-NLS-1$
- public static final String OPLUS = "oplus"; //$NON-NLS-1$
- public static final String OR = "or"; //$NON-NLS-1$
- public static final String ORDF = "ordf"; //$NON-NLS-1$
- public static final String ORDM = "ordm"; //$NON-NLS-1$
- public static final String OSLASH_U = "Oslash"; //$NON-NLS-1$
- public static final String OSLASH_L = "oslash"; //$NON-NLS-1$
- public static final String OTILDE_U = "Otilde"; //$NON-NLS-1$
- public static final String OTILDE_L = "otilde"; //$NON-NLS-1$
- public static final String OTIMES = "otimes"; //$NON-NLS-1$
- public static final String OUML_U = "Ouml"; //$NON-NLS-1$
- public static final String OUML_L = "ouml"; //$NON-NLS-1$
- public static final String PARA = "para"; //$NON-NLS-1$
- public static final String PART = "part"; //$NON-NLS-1$
- public static final String PERMIL = "permil"; //$NON-NLS-1$
- public static final String PERP = "perp"; //$NON-NLS-1$
- public static final String PHI_U = "Phi"; //$NON-NLS-1$
- public static final String PHI_L = "phi"; //$NON-NLS-1$
- public static final String PI_U = "Pi"; //$NON-NLS-1$
- public static final String PI_L = "pi"; //$NON-NLS-1$
- public static final String PIV = "piv"; //$NON-NLS-1$
- public static final String PLUSMN = "plusmn"; //$NON-NLS-1$
- public static final String POUND = "pound"; //$NON-NLS-1$
- public static final String PRIME_U = "Prime"; //$NON-NLS-1$
- public static final String PRIME_L = "prime"; //$NON-NLS-1$
- public static final String PROD = "prod"; //$NON-NLS-1$
- public static final String PROP = "prop"; //$NON-NLS-1$
- public static final String PSI_U = "Psi"; //$NON-NLS-1$
- public static final String PSI_L = "psi"; //$NON-NLS-1$
- public static final String QUOT = "quot"; //$NON-NLS-1$
- public static final String RADIC = "radic"; //$NON-NLS-1$
- public static final String RANG = "rang"; //$NON-NLS-1$
- public static final String RAQUO = "raquo"; //$NON-NLS-1$
- public static final String RARR_U = "rArr"; //$NON-NLS-1$
- public static final String RARR_L = "rarr"; //$NON-NLS-1$
- public static final String RCEIL = "rceil"; //$NON-NLS-1$
- public static final String RDQUO = "rdquo"; //$NON-NLS-1$
- public static final String REAL = "real"; //$NON-NLS-1$
- public static final String REG = "reg"; //$NON-NLS-1$
- public static final String RFLOOR = "rfloor"; //$NON-NLS-1$
- public static final String RHO_U = "Rho"; //$NON-NLS-1$
- public static final String RHO_L = "rho"; //$NON-NLS-1$
- public static final String RLM = "rlm"; //$NON-NLS-1$
- public static final String RSAQUO = "rsaquo"; //$NON-NLS-1$
- public static final String RSQUO = "rsquo"; //$NON-NLS-1$
- public static final String SBQUO = "sbquo"; //$NON-NLS-1$
- public static final String SCARON_U = "Scaron"; //$NON-NLS-1$
- public static final String SCARON_L = "scaron"; //$NON-NLS-1$
- public static final String SDOT = "sdot"; //$NON-NLS-1$
- public static final String SECT = "sect"; //$NON-NLS-1$
- public static final String SHY = "shy"; //$NON-NLS-1$
- public static final String SIGMA_U = "Sigma"; //$NON-NLS-1$
- public static final String SIGMA_L = "sigma"; //$NON-NLS-1$
- public static final String SIGMAF = "sigmaf"; //$NON-NLS-1$
- public static final String SIM = "sim"; //$NON-NLS-1$
- public static final String SPADES = "spades"; //$NON-NLS-1$
- public static final String SUB = "sub"; //$NON-NLS-1$
- public static final String SUBE = "sube"; //$NON-NLS-1$
- public static final String SUM = "sum"; //$NON-NLS-1$
- public static final String SUP = "sup"; //$NON-NLS-1$
- public static final String SUP1 = "sup1"; //$NON-NLS-1$
- public static final String SUP2 = "sup2"; //$NON-NLS-1$
- public static final String SUP3 = "sup3"; //$NON-NLS-1$
- public static final String SUPE = "supe"; //$NON-NLS-1$
- public static final String SZLIG = "szlig"; //$NON-NLS-1$
- public static final String TAU_U = "Tau"; //$NON-NLS-1$
- public static final String TAU_L = "tau"; //$NON-NLS-1$
- public static final String THERE4 = "there4"; //$NON-NLS-1$
- public static final String THETA_U = "Theta"; //$NON-NLS-1$
- public static final String THETA_L = "theta"; //$NON-NLS-1$
- public static final String THETASYM = "thetasym"; //$NON-NLS-1$
- public static final String THINSP = "thinsp"; //$NON-NLS-1$
- public static final String THORN_U = "THORN"; //$NON-NLS-1$
- public static final String THORN_L = "thorn"; //$NON-NLS-1$
- public static final String TILDE = "tilde"; //$NON-NLS-1$
- public static final String TIMES = "times"; //$NON-NLS-1$
- public static final String TRADE = "trade"; //$NON-NLS-1$
- public static final String UACUTE_U = "Uacute"; //$NON-NLS-1$
- public static final String UACUTE_L = "uacute"; //$NON-NLS-1$
- public static final String UARR_U = "uArr"; //$NON-NLS-1$
- public static final String UARR_L = "uarr"; //$NON-NLS-1$
- public static final String UCIRC_U = "Ucirc"; //$NON-NLS-1$
- public static final String UCIRC_L = "ucirc"; //$NON-NLS-1$
- public static final String UGRAVE_U = "Ugrave"; //$NON-NLS-1$
- public static final String UGRAVE_L = "ugrave"; //$NON-NLS-1$
- public static final String UML = "uml"; //$NON-NLS-1$
- public static final String UPSIH = "upsih"; //$NON-NLS-1$
- public static final String UPSILON_U = "Upsilon"; //$NON-NLS-1$
- public static final String UPSILON_L = "upsilon"; //$NON-NLS-1$
- public static final String UUML_U = "Uuml"; //$NON-NLS-1$
- public static final String UUML_L = "uuml"; //$NON-NLS-1$
- public static final String WEIERP = "weierp"; //$NON-NLS-1$
- public static final String XI_U = "Xi"; //$NON-NLS-1$
- public static final String XI_L = "xi"; //$NON-NLS-1$
- public static final String YACUTE_U = "Yacute"; //$NON-NLS-1$
- public static final String YACUTE_L = "yacute"; //$NON-NLS-1$
- public static final String YEN = "yen"; //$NON-NLS-1$
- public static final String YUML_U = "Yuml"; //$NON-NLS-1$
- public static final String YUML_L = "yuml"; //$NON-NLS-1$
- public static final String ZETA_U = "Zeta"; //$NON-NLS-1$
- public static final String ZETA_L = "zeta"; //$NON-NLS-1$
- public static final String ZWJ = "zwj"; //$NON-NLS-1$
- public static final String ZWNJ = "zwnj"; //$NON-NLS-1$
- }
-
- public static final String HTML40_URI = "http://www.w3.org/TR/REC-html40/frameset.dtd"; //$NON-NLS-1$
- public static final String HTML40_TAG_PREFIX = ""; //$NON-NLS-1$
- // global attribute names
- public static final String ATTR_NAME_ID = "id"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_STYLE = "style"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TITLE = "title"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LANG = "lang"; // %i18n;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIR = "dir"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_ONCLICK = "onclick"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONDBLCLICK = "ondblclick"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEDOWN = "onmousedown"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEUP = "onmouseup"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOVER = "onmouseover"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEMOVE = "onmousemove"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOUT = "onmouseout"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYPRESS = "onkeypress"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYDOWN = "onkeydown"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYUP = "onkeyup"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONHELP = "onhelp"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BGCOLOR = "bgcolor"; // %bodycolor;,
- // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TEXT = "text"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LINK = "link"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VLINK = "vlink"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ALINK = "alink"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; // HTML
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PROFILE = "profile"; // HEAD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONLOAD = "onload"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONUNLOAD = "onunload"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BACKGROUND = "background"; // BODY,
- // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SRC = "src"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALT = "alt"; // IMG,AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LONGDESC = "longdesc"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NAME = "name"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; // IMG, TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; // IMG, TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_USEMAP = "usemap"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ISMAP = "ismap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; // IMG, TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BORDER = "border"; // IMG, TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAPFILE = "mapfile"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SUMMARY = "summary"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FRAME = "frame"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_RULES = "rules"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CELLSPACING = "cellspacing"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CELLPADDING = "cellpadding"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DATAPAGESIZE = "datapagesize"; // TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLOR = "color"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FACE = "face"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SIZE = "size"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLEAR = "clear"; // BR //$NON-NLS-1$
- public static final String ATTR_NAME_SHAPE = "shape"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COORDS = "coords"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HREF = "href"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TARGET = "target"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOHREF = "nohref"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TABINDEX = "tabindex"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCESSKEY = "accesskey"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONFOCUS = "onfocus"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONBLUR = "onblur"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHARSET = "charset"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HREFLANG = "hreflang"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REL = "rel"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REV = "rev"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_MEDIA = "media"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; // PARAM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALUETYPE = "valuetype"; // PARAM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOSHADE = "noshade"; // HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHECKED = "checked"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DISABLED = "disabled"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_READONLY = "readonly"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAXLENGTH = "maxlength"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONSELECT = "onselect"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONCHANGE = "onchange"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT = "accept"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ISTYLE = "istyle"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHAR = "char"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_CHAROFF = "charoff"; // COL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALIGN = "valign"; // COL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SPAN = "span"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_FRAMEBORDER = "frameborder"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINWIDTH = "marginwidth"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINHEIGHT = "marginheight"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NORESIZE = "noresize"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLING = "scrolling"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PROMPT = "prompt"; // ISINDEX
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HTTP_EQUIV = "http-equiv"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT = "content"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCHEME = "scheme"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ERRMSG = "errmsg"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SIZEFMT = "sizefmt"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TIMEFMT = "timefmt"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VAR = "var"; // ssi:echo
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CGI = "cgi"; // ssi:exec
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CMD = "cmd"; // ssi:exec
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FILE = "file"; // ssi:fsize
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VIRTUAL = "virtual"; // ssi:fsize
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SELECTED = "selected"; // OPTION
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LABEL = "label"; // OPTION
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ROWS = "rows"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLS = "cols"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LANGUAGE = "language"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DEFER = "defer"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_EVENT = "event"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FOR = "for"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_COMPACT = "compact"; // OL/UL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_START = "start"; // OL/UL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTKEY = "directkey"; // A
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODE = "code"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_OBJECT = "object"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAYSCRIPT = "mayscript"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CITE = "cite"; // BLOCKQUOTE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MACRO = "macro"; // D2W //$NON-NLS-1$
- public static final String ATTR_NAME_DATETIME = "datetime"; // INS/DEL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LOOP = "loop"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_HIDDEN = "hidden"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VOLUME = "volume"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSTART = "autostart"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOPLAY = "autoplay"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSIZE = "autosize"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CONTROLLER = "controller";// EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCALE = "scale"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SHOWCONTROLS = "showcontrols";// EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PLAYCOUNT = "playcount"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_REPEAT = "repeat"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PANEL = "panel"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PALETTE = "palette"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TEXTFOCUS = "textfocus"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACTION = "action"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_METHOD = "method"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ENCTYPE = "enctype"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONSUBMIT = "onsubmit"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONRESET = "onreset"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT_CHARSET = "accept-charset";// FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BEHAVIOR = "behavior"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTION = "direction"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLAMOUNT = "scrollamount";// MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLDELAY = "scrolldelay";// MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TRUESPEED = "truespeed"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DECLARE = "declare"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLASSID = "classid"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DATA = "data"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODETYPE = "codetype"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_STANDBY = "standby"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MULTIPLE = "multiple"; // SELECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ABBR = "abbr"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_AXIS = "axis"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_HEADERS = "headers"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ROWSPAN = "rowspan"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLSPAN = "colspan"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOWRAP = "nowrap"; // TH/TD
- // //$NON-NLS-1$
- // <<D205514
- public static final String ATTR_NAME_TOPMARGIN = "topmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BOTTOMMARGIN = "bottommargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LEFTMARGIN = "leftmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_RIGHTMARGIN = "rightmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BORDERCOLOR = "bordercolor"; // TABLE/TR/TH/TD/FRAMESET/FRAME
- // //$NON-NLS-1$
- // for WML
- public static final String WML_ATTR_NAME_TITLE = "title"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_DOMAIN = "domain"; // access
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_PATH = "path"; // access
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERFORWARD = "onenterforward"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERBACKWARD = "onenterbackward"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONPICK = "onpick"; // option
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONTIMER = "ontimer"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_NEWCONTEXT = "newcontext"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ORDERED = "ordered"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_OPTIONAL = "optional"; // do
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_CACHE_CONTROL = "cache-control"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_SENDREFERER = "sendreferer"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_METHOD = "method"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ENCTYPE = "enctype"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ACCEPT_CHARSET = "accept-charset"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_COLUMNS = "columns"; // table
- // //$NON-NLS-1$
- // D205514
- //<<D215684
- public static final String ATTR_NAME_FRAMESPACING = "framespacing"; // FRAMESET
- // //$NON-NLS-1$
- //D215684
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD HTML 4.01 Transitional//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_VERSION_FRAMESET = "-//W3C//DTD HTML 4.01 Frameset//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LTR = "ltr"; // dir //$NON-NLS-1$
- public static final String ATTR_VALUE_RTL = "rtl"; // dir //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = "top"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CENTER = "center"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_JUSTIFY = "justify"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CHAR = "char"; // align
- // //$NON-NLS-1$
- // for valign (baseline)
- public static final String ATTR_VALUE_BASELINE = "baseline"; // valign
- // //$NON-NLS-1$
- // for clear (left|all|right|none): left and right are already defined
- // above.
- public static final String ATTR_VALUE_ALL = "all"; // clear //$NON-NLS-1$
- public static final String ATTR_VALUE_NONE = "none"; // clear
- // //$NON-NLS-1$
- // for shape (rect|circle|poly|default)
- public static final String ATTR_VALUE_RECT = "rect"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CIRCLE = "circle"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_POLY = "poly"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_DEFAULT = "default"; // shape
- // //$NON-NLS-1$
- // for valuetype (data|ref|object)
- public static final String ATTR_VALUE_DATA = "data"; // valuetype
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_REF = "ref"; // valuetype
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_OBJECT = "object"; // valuetype
- // //$NON-NLS-1$
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = "text"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_PASSWORD = "password"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CHECKBOX = "checkbox"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RADIO = "radio"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SUBMIT = "submit"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RESET = "reset"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_FILE = "file"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_HIDDEN = "hidden"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_IMAGE = "image"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BUTTON = "button"; // INPUT:type
- // //$NON-NLS-1$
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = "1"; // span //$NON-NLS-1$
- // for frameborder
- public static final String ATTR_VALUE_0 = "0"; // FRAME //$NON-NLS-1$
- // for scrolling
- public static final String ATTR_VALUE_YES = "yes"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_NO = "no"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_AUTO = "auto"; // FRAME
- // //$NON-NLS-1$
- // for UL
- public static final String ATTR_VALUE_DISC = "disc"; // UL:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SQUARE = "square"; // UL:type
- // //$NON-NLS-1$
- // for frame of TABLE
- public static final String ATTR_VALUE_VOID = "void"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ABOVE = "above"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BELOW = "below"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_HSIDES = "hsides"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_LHS = "lhs"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RHS = "rhs"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_VSIDES = "vsides"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BOX = "box"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BORDER = "border"; // TABLE:frame
- // //$NON-NLS-1$
- // for rules of TABLE
- public static final String ATTR_VALUE_GROUPS = "groups"; // TABLE:rules
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWS = "rows"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COLS = "cols"; // TEXTAREA
- // //$NON-NLS-1$
- // for method of FORM
- public static final String ATTR_VALUE_GET = "get"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_POST = "post"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
- // for scope of (TH | TD)
- public static final String ATTR_VALUE_ROW = "row"; // (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COL = "col"; // (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWGROUP = "rowgroup";// (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COLGROUP = "colgroup";// (TH|TD):scope
- // //$NON-NLS-1$
- // for auto?? of EMBED
- public static final String ATTR_VALUE_TRUE = "true"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; // EMBED
- // //$NON-NLS-1$
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = "scroll"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SLIDE = "slide"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ALTERNATE = "alternate"; // MARQUEE
- // //$NON-NLS-1$
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = "up"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_DOWN = "down"; // MARQUEE
- // //$NON-NLS-1$
- // for type of LI (D19924)
- public static final String ATTR_VALUE_NUMBER = "1"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ALPHA = "a"; // LI
- // //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/IProposalInfo.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/IProposalInfo.java
deleted file mode 100644
index 1b4b8a9af9..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/IProposalInfo.java
+++ /dev/null
@@ -1,25 +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.wst.css.ui.internal.contentassist;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-/**
- * Interface for additional proposal information for CSS Content Assist
- *
- */
-public interface IProposalInfo {
- /**
- * Sets the element for additional proposal information
- * @param node the element for additional proposal information
- */
- void setInputElement(CSSMMNode node);
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/ProposalInfoFactory.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/ProposalInfoFactory.java
deleted file mode 100644
index 373f3ddddb..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/ProposalInfoFactory.java
+++ /dev/null
@@ -1,66 +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.wst.css.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.Logger;
-
-/**
- * Generates proposal information for {@link CSSMMNode}s. If the Proposal Information instance
- * implements {@link IProposalInfo} the node will be set as the input element.
- *
- */
-class ProposalInfoFactory {
-
- private static IConfigurationElement fElement = null;
- private static boolean fIsInitialized = false;
-
- private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
- private ProposalInfoFactory() {
- }
-
- /**
- * Returns additional proposal information for <code>node</code>
- * @param node the CSS metamodel node
- * @return additional proposal information about <code>node></code>
- */
- public static synchronized Object getProposalInfo(CSSMMNode node) {
- Object info = null;
- if (!fIsInitialized) {
- // Only attempt to initialize this once. If there are no proposal information providers, we'll always return null
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(CSSUIPlugin.ID, "proposalInfo"); //$NON-NLS-1$
- if (elements.length > 0) {
- // Get the first proposal info that's declared
- fElement = elements[0];
- }
-
- fIsInitialized = true;
- }
-
- if (fElement != null) {
- try {
- info = fElement.createExecutableExtension(ATTR_CLASS); //$NON-NLS-1$
- if (info instanceof IProposalInfo) {
- ((IProposalInfo) info).setInputElement(node);
- }
- } catch (CoreException e) {
- Logger.log(Logger.ERROR, "Could not create instance for proposalInfo [" + fElement.getAttribute("class") + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- return info;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
deleted file mode 100644
index 1898c59509..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.wst.css.core.internal.document.CSSStructuredDocumentRegionContainer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-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.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.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * Adapts the CSS DOM node to a JFace viewer.
- */
-class CSSNodeAdapter implements IJFaceNodeAdapter, INodeAdapter, Runnable {
- /**
- * debug .option
- */
- private static final boolean DEBUG = getDebugValue();
-
- private static boolean getDebugValue() {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
- boolean result = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- return result;
- }
-
- class NotifyContext {
- NotifyContext(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- this.notifier = notifier;
- this.eventType = eventType;
- this.changedFeature = changedFeature;
- this.oldValue = oldValue;
- this.newValue = newValue;
- this.pos = pos;
- }
-
- void fire() {
- internalNotifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
-
- INodeNotifier notifier;
- int eventType;
- Object changedFeature;
- Object oldValue;
- Object newValue;
- int pos;
- }
-
- class StyleViewUpdater implements Runnable {
- public void run() {
- if (lastUpdater == this) {
- internalActionPerformed();
- lastUpdater = null;
- }
- }
- }
-
- protected INodeAdapterFactory adapterFactory;
- private Vector notifyQueue;
- StyleViewUpdater lastUpdater;
- protected int delayMSecs = 500;
- RefreshStructureJob fRefreshJob = null;
- final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
-
- public CSSNodeAdapter(INodeAdapterFactory adapterFactory) {
- super();
- this.adapterFactory = adapterFactory;
- }
-
- private synchronized RefreshStructureJob getRefreshJob() {
- if (fRefreshJob == null) {
- fRefreshJob = new RefreshStructureJob();
- }
- return fRefreshJob;
- }
-
- /**
- * Insert the method's description here.
- */
- protected void internalActionPerformed() {
- if (notifyQueue == null) {
- return;
- }
- boolean refresh_all = false;
- boolean refresh_rule = false;
- int pos_all = 0;
- List targets = new ArrayList();
- for (int i = 0; i < notifyQueue.size(); i++) {
- NotifyContext context = (NotifyContext) notifyQueue.get(i);
- if (context.notifier instanceof ICSSStyleSheet) {
- refresh_all = true;
- pos_all = i;
- }
- if (context.notifier instanceof ICSSStyleDeclaration) {
- refresh_rule = true;
- targets.add(context);
- // pos_rule = i;
- }
- // ((NotifyContext) notifyQueue.get(i)).fire();
- }
- if (refresh_all) {
- ((NotifyContext) notifyQueue.get(pos_all)).fire();
- }
- else if (refresh_rule) {
- Iterator i = targets.iterator();
- while (i.hasNext()) {
- ((NotifyContext) i.next()).fire();
- }
- // else if (refresh_rule) internalRefreshAll();
- }
- else {
- for (int i = 0; i < notifyQueue.size(); i++) {
- ((NotifyContext) notifyQueue.get(i)).fire();
- }
- }
- notifyQueue.clear();
- }
-
- /**
- * Called by the object being adapter (the notifier) when something has
- * changed.
- */
- public void internalNotifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- Iterator iterator = ((IJFaceNodeAdapterFactory) adapterFactory).getListeners().iterator();
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- if (listener instanceof StructuredViewer) {
- notifyChangedForStructuredViewer((StructuredViewer) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
- else if (listener instanceof PropertySheetPage) {
- notifyChangedForPropertySheetPage((PropertySheetPage) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
- }
- }
-
- private void notifyChangedForPropertySheetPage(PropertySheetPage page, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (page.getControl() == null || page.getControl().isDisposed()) {
- return;
- }
- if (eventType == INodeNotifier.CHANGE || eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) {
- page.refresh();
- }
- }
-
- private void notifyChangedForStructuredViewer(StructuredViewer viewer, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (viewer.getControl() == null || viewer.getControl().isDisposed()) {
- return;
- }
- if (eventType == INodeNotifier.CHANGE) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- }
- else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- if (temp == null || temp instanceof ICSSStyleSheet) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- }
- else {
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || temp instanceof ICSSStyleSheet) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- }
- if (eventType == INodeNotifier.ADD) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- }
- else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- else {
- if (newValue != null && (newValue instanceof ICSSStyleDeclItem)) {
- viewer.refresh(((ICSSNode) newValue).getParentNode());
- }
- else {
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- }
- }
- else if (eventType == INodeNotifier.REMOVE) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- }
- else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- }
- else {
- // viewer.refresh(notifier);
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- }
- else {
- viewer.refresh(temp);
- }
- }
- }
- // }
- }
-
- /**
- *
- */
- public void internalRefreshAll() {
- Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
- Iterator iterator = listeners.iterator();
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- if (listener instanceof StructuredViewer) {
- StructuredViewer viewer = (StructuredViewer) listener;
- if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- viewer.refresh();
- }
- }
- else if (listener instanceof PropertySheetPage) {
- PropertySheetPage page = (PropertySheetPage) listener;
- if (page.getControl() != null && !page.getControl().isDisposed()) {
- page.refresh();
- }
- }
- }
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(ADAPTER_KEY);
- }
-
- /**
- * Called by the object being adapter (the notifier) when something has
- * changed.
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifyQueue == null)
- notifyQueue = new Vector();
-// notifyQueue.add(new NotifyContext(notifier, eventType, changedFeature, oldValue, newValue, pos));
- // TODO-future: there's probably a better way than relying on async
- // exec
- if (notifier instanceof ICSSNode) {
- Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
- Iterator iterator = listeners.iterator();
-
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
- // if (notifier instanceof Node && (listener instanceof
- // StructuredViewer) && (eventType ==
- // INodeNotifier.STRUCTURE_CHANGED || (eventType ==
- // INodeNotifier.CHANGE && changedFeature == null))) {
- if ((listener instanceof StructuredViewer) && ((eventType == INodeNotifier.STRUCTURE_CHANGED) || (eventType == INodeNotifier.CONTENT_CHANGED) || (eventType == INodeNotifier.CHANGE || (eventType == INodeNotifier.ADD) || (eventType == INodeNotifier.REMOVE)))) {
- if (DEBUG) {
- System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
- }
-
- // refresh on structural and "unknown" changes
- StructuredViewer structuredViewer = (StructuredViewer) listener;
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
- if (structuredViewer.getControl() != null) {
- getRefreshJob().refresh(structuredViewer, (ICSSNode) notifier);
- }
- }
- }
- }
- }
-
- Display getDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * this method is intended only for timerExec()
- */
- public void run() {
- lastUpdater = new StyleViewUpdater();
- getDisplay().asyncExec(lastUpdater);
- }
-
- /**
- * Returns an enumeration containing all child nodes of the given element,
- * which represents a node in a tree. The difference to
- * <code>IStructuredContentProvider.getElements(Object)</code> is as
- * follows: <code>getElements</code> is called to obtain the tree
- * viewer's root elements. Method <code>getChildren</code> is used to
- * obtain the children of a given node in the tree, which can can be a
- * root node, too.
- */
- public Object[] getChildren(Object object) {
- if (object instanceof ICSSNode) {
- ICSSNode node = (ICSSNode) object;
-
- short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLERULE_NODE || nodeType == ICSSNode.PAGERULE_NODE || nodeType == ICSSNode.FONTFACERULE_NODE) {
- for (node = node.getFirstChild(); node != null && !(node instanceof ICSSStyleDeclaration); node.getNextSibling()) {
- // nop
- }
- }
- List children = new ArrayList();
- ICSSNode child = (node != null) ? node.getFirstChild() : null;
- while (child != null) {
- if (!(child instanceof ICSSPrimitiveValue) && !(child instanceof MediaList)) {
- children.add(child);
- }
- /*
- * Required to correctly connect the refreshing behavior to
- * the tree
- */
- if (child instanceof INodeNotifier) {
- ((INodeNotifier) child).getAdapterFor(IJFaceNodeAdapter.class);
- }
- child = child.getNextSibling();
- }
- return children.toArray();
- }
- return new Object[0];
- }
-
- /**
- * Returns an enumeration with the elements belonging to the passed
- * element. These elements can be presented as rows in a table, items in a
- * list etc.
- */
- public Object[] getElements(Object object) {
- // The root is usually an instance of an XMLStructuredModel in
- // which case we want to extract the document.
-
- if (object instanceof ICSSModel) {
- ArrayList v = new ArrayList();
- // internalGetElements(object, v);
- addElements(object, v);
- Object[] elements = v.toArray();
-
- for (int i = 0; i < elements.length; i++) {
- /*
- * Required to correctly connect the refreshing behavior to
- * the tree
- */
- if (elements[i] instanceof INodeNotifier) {
- ((INodeNotifier) elements[i]).getAdapterFor(IJFaceNodeAdapter.class);
- }
- }
-
- return elements;
- }
- return new Object[0];
-
- }
-
- /**
- * Returns the image for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label image. Element
- * can be <code>null</code> indicating no input object is set
- * to the viewer.
- */
- public Image getLabelImage(Object element) {
- if (element instanceof ICSSNode) {
- CSSImageHelper helper = CSSImageHelper.getInstance();
- return helper.getImage(CSSImageType.getImageType((ICSSNode) element));
- // Image image = getCSSNodeImage(element);
- // return image;
- // return getAdapter(element).getLabelImage((ICSSNode) element);
- }
- return null;
- }
-
- /**
- * Returns the text for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label text. Element can
- * be <code>null</code> indicating no input object is set to
- * the viewer.
- */
- public String getLabelText(Object element) {
- // This was returning null, on occasion ... probably should not be,
- // but
- // took the quick and easy way out for now. (dmw 3/8/01)
-
- String result = "";//$NON-NLS-1$
- String mediaText;
- if (element instanceof ICSSNode) {
- switch (((ICSSNode) element).getNodeType()) {
- case ICSSNode.STYLERULE_NODE :
- result = ((ICSSStyleRule) element).getSelectors().getString();
- break;
- case ICSSNode.FONTFACERULE_NODE :
- result = "@font-face";//$NON-NLS-1$
- break;
- case ICSSNode.IMPORTRULE_NODE :
- result = ((CSSImportRule) element).getHref();
- mediaText = getMediaText((CSSImportRule) element);
- if (mediaText != null && 0 < mediaText.length()) {
- result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- case ICSSNode.PAGERULE_NODE :
- result = "@page";//$NON-NLS-1$
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- result = "properties";//$NON-NLS-1$
- break;
- case ICSSNode.STYLEDECLITEM_NODE :
- result = ((ICSSStyleDeclItem) element).getPropertyName();
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- result = ((ICSSPrimitiveValue) element).getStringValue();
- break;
- case ICSSNode.MEDIARULE_NODE :
- result = "@media";//$NON-NLS-1$
- mediaText = getMediaText((ICSSMediaRule) element);
- if (mediaText != null && 0 < mediaText.length()) {
- result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- case ICSSNode.CHARSETRULE_NODE :
- result = "@charset";//$NON-NLS-1$
- break;
- case ICSSNode.MEDIALIST_NODE :
- result = ((MediaList) element).getMediaText();
- break;
- default :
- break;
- }
- }
-
- // if (element instanceof ICSSNode) {
- // ICSSNode node = ((ICSSNode)element);
- // result = getAdapter(element).getLabelText((ICSSNode) element);
- // }
- return result;
- }
-
- /**
- * Returns the parent for the given element. This method can return
- * <code>null</code> indicating that the parent can't be computed. In
- * this case the tree viewer can't expand a given node correctly if
- * requested.
- */
- public Object getParent(Object object) {
- if (object instanceof ICSSNode) {
- ICSSNode node = ((ICSSNode) object).getParentNode();
- if (node != null && node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- /*
- * Required to also correctly connect style declaration to the
- * refreshing behavior in the tree
- */
- if (node instanceof INodeNotifier) {
- ((INodeNotifier) node).getAdapterFor(IJFaceNodeAdapter.class);
- }
- node = node.getParentNode();
- }
- return node;
- }
- return null;
- }
-
- /**
- * Returns <code>true</code> if the given element has children.
- * Otherwise <code>false</code> is returned.
- */
- public boolean hasChildren(Object object) {
- // return getAdapter(object).hasChildren((ICSSNode) object);
- if (object instanceof ICSSNode) {
- /*
- * Required to correctly connect the refreshing behavior to the
- * tree
- */
- if (object instanceof INodeNotifier) {
- ((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
- }
-
- if (object instanceof ICSSStyleDeclItem)
- return false;
- else {
- if(((ICSSNode) object).hasChildNodes()) {
- ICSSNode child = ((ICSSNode) object).getFirstChild();
-
- while(child != null) {
- if(child instanceof CSSStructuredDocumentRegionContainer) {
- String childText = ((CSSStructuredDocumentRegionContainer) child).getCssText();
- if(childText != null && childText.length() > 0)
- return true;
- }
- child = child.getNextSibling();
- }
- }
- }
- }
- return false;
- }
-
- private void addElements(Object element, ArrayList v) {
-
- ICSSNode node;
-
- if (element instanceof ICSSModel) {
- ICSSModel model = (ICSSModel) element;
- ICSSDocument doc = model.getDocument();
- node = doc.getFirstChild();
- }
- else if (element instanceof ICSSNode) {
- node = ((ICSSNode) element).getFirstChild();
- }
- else
- return;
-
- while (node != null) {
- if (node instanceof CSSRule) {
- v.add(node);
- }
-
- node = node.getNextSibling();
- }
-
- }
-
- private String getMediaText(CSSRule rule) {
- String result = ""; //$NON-NLS-1$
- ICSSNode child = (rule != null) ? ((ICSSNode) rule).getFirstChild() : null;
- while (child != null) {
- if (child.getNodeType() == ICSSNode.MEDIALIST_NODE) {
- result = ((MediaList) child).getMediaText();
- break;
- }
- child = child.getNextSibling();
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java
deleted file mode 100644
index d87e8ee4ea..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.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.ui.internal.contentoutline;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-
-public class JFaceNodeAdapterFactoryCSS extends JFaceNodeAdapterFactory {
- public JFaceNodeAdapterFactoryCSS() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryCSS(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new CSSNodeAdapter(this);
- }
- return singletonAdapter;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java
deleted file mode 100644
index 11114cec93..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java
+++ /dev/null
@@ -1,355 +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.wst.css.ui.internal.contentoutline;
-
-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.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class RefreshStructureJob extends Job {
- /** debug flag */
- static final boolean DEBUG;
- private static final long UPDATE_DELAY = 300;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/refreshStructure"); //$NON-NLS-1$
- DEBUG = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- /** List of refresh requests (Nodes) */
- private final List fRefreshes;
- /** List of update requests (Nodes) */
- private final List fUpdates;
- /** List of update requests (Nodes) */
- private final List fUpdateProperties;
- /** the structured viewers */
- Set fRefreshViewers = new HashSet(3);
- Set fUpdateViewers = new HashSet(3);
-
- public RefreshStructureJob() {
- super(XMLUIMessages.refreshoutline_0);
- setPriority(Job.LONG);
- setSystem(true);
- fRefreshes = new ArrayList(5);
- fUpdates = new ArrayList(5);
- fUpdateProperties = new ArrayList(5);
- }
-
- private synchronized void addUpdateRequest(ICSSNode newNodeRequest, String[] updateProperties) {
- /*
- * If we get to here, either from existing request list being zero
- * length, or no exisitng requests "matched" new request, then add the
- * new request.
- */
- fUpdates.add(newNodeRequest);
- fUpdateProperties.add(updateProperties);
- }
-
- private synchronized void addUpdateViewer(StructuredViewer viewer) {
- fUpdateViewers.add(viewer);
- }
-
- private synchronized void addRefreshRequest(ICSSNode newNodeRequest) {
- /*
- * note: the caller must NOT pass in null node request (which, since
- * private method, we do not need to gaurd against here, as long as we
- * gaurd against it in calling method.
- */
- int size = fRefreshes.size();
- for (int i = 0; i < size; i++) {
- ICSSNode existingNodeRequest = (ICSSNode) fRefreshes.get(i);
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=157427 If we
- * already have a request which equals the new request, discard
- * the new request
- */
- if (existingNodeRequest.equals(newNodeRequest)) {
- return;
- }
- /*
- * If we already have a request which contains the new request,
- * discard the new request
- */
- if (contains(existingNodeRequest, newNodeRequest)) {
- return;
- }
- /*
- * If new request contains any existing requests, replace it with
- * new request. ISSUE: technically, we should replace ALL
- * contained, existing requests (such as if many siblings already
- * que'd up when their common parent is then requested, but, I'm
- * not sure if that occurs much, in practice, or if there's an
- * algorithm to quickly find them all. Actually, I guess we could
- * just go through the _rest_ of the list (i+1 to size) and remove
- * any that are contained by new request ... in future :) .
- */
- if (contains(newNodeRequest, existingNodeRequest)) {
- fRefreshes.set(i, newNodeRequest);
- return;
- }
- }
- /*
- * If we get to here, either from existing request list being zero
- * length, or no exisitng requests "matched" new request, then add the
- * new request.
- */
- fRefreshes.add(newNodeRequest);
- }
-
- private synchronized void addRefreshViewer(StructuredViewer viewer) {
- fRefreshViewers.add(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#canceling()
- */
- protected void canceling() {
- fUpdates.clear();
- fUpdateViewers.clear();
- super.canceling();
- }
-
- /**
- * Simple hierarchical containment relationship. Note, this method returns
- * "false" if the two nodes are equal!
- *
- * @param root
- * @param possible
- * @return if the root is parent of possible, return true, otherwise
- * return false
- */
- private boolean contains(ICSSNode root, ICSSNode possible) {
- if (DEBUG) {
- System.out.println("=============================================================================================================="); //$NON-NLS-1$
- System.out.println("recursive call w/ root: " + root + " and possible: " + possible); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("--------------------------------------------------------------------------------------------------------------"); //$NON-NLS-1$
- }
-
- // the following checks are important
- // #document node will break the algorithm otherwise
-
- // can't contain the child if it's null
- if (root == null) {
- if (DEBUG) {
- System.out.println("returning false: root is null"); //$NON-NLS-1$
- }
- return false;
- }
- // nothing can be parent of Document node
- if (possible instanceof ICSSDocument) {
- if (DEBUG) {
- System.out.println("returning false: possible is Document node"); //$NON-NLS-1$
- }
- return false;
- }
- // document contains everything
- if (root instanceof ICSSDocument) {
- if (DEBUG) {
- System.out.println("returning true: root is Document node"); //$NON-NLS-1$
- }
- return true;
- }
-
- // check parentage
- ICSSNode current = possible;
- // loop parents
- while ((current != null) && (current.getNodeType() != ICSSNode.STYLESHEET_NODE || current.getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- // found it
- if (root.equals(current)) {
- if (DEBUG) {
- System.out.println(" !!! found: " + possible + " in subelement of: " + root); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return true;
- }
- current = current.getParentNode();
- }
- // never found it
- return false;
- }
-
- /**
- * Refresh must be on UI thread because it's on a SWT widget.
- *
- * @param node
- */
- private void doRefresh(final ICSSNode node, final StructuredViewer[] viewers) {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (DEBUG) {
- System.out.println("refresh on: [" + node + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- for (int i = 0; i < viewers.length; i++) {
- if (!viewers[i].getControl().isDisposed()) {
- if (node.getNodeType() == ICSSNode.STYLESHEET_NODE || node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- viewers[i].refresh(false);
- }
- else {
- viewers[i].refresh(node, false);
- }
- }
- else {
- if (DEBUG) {
- System.out.println(" !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
- }
- }
- }
- }
- });
- }
-
- /**
- * Update must be on UI thread because it's on a SWT widget.
- *
- * @param node
- */
- private void doUpdate(final StructuredViewer[] viewers, final ICSSNode node, final String[] properties) {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (DEBUG) {
- System.out.println("refresh on: [" + node + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- for (int i = 0; i < viewers.length; i++) {
- if (!viewers[i].getControl().isDisposed()) {
- viewers[i].update(node, properties);
- }
- else {
- if (DEBUG) {
- System.out.println(" !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
- }
- }
- }
- }
- });
- }
-
- /**
- * This method also synchronized because it accesses the fRefreshes queue
- * and fRefreshViewers list
- *
- * @return an array containing and array of the currently requested Nodes
- * to refresh and the viewers in which to refresh them
- */
- private synchronized Object[] getRefreshRequests() {
- ICSSNode[] toRefresh = (ICSSNode[]) fRefreshes.toArray(new ICSSNode[fRefreshes.size()]);
- fRefreshes.clear();
-
- StructuredViewer[] viewers = (StructuredViewer[]) fRefreshViewers.toArray(new StructuredViewer[fRefreshViewers.size()]);
- fRefreshViewers.clear();
-
- return new Object[]{toRefresh, viewers};
- }
-
- /**
- * This method also synchronized because it accesses the fUpdates queue
- * and fUpdateViewers list
- *
- * @return an array containing and array of the currently requested Nodes
- * to refresh and the viewers in which to refresh them
- */
- private synchronized Object[] getUpdateRequests() {
- ICSSNode[] toUpdate = (ICSSNode[]) fUpdates.toArray(new ICSSNode[fUpdates.size()]);
- fUpdates.clear();
-
- StructuredViewer[] viewers = (StructuredViewer[]) fUpdateViewers.toArray(new StructuredViewer[fUpdateViewers.size()]);
- fUpdateViewers.clear();
-
- String[][] properties = (String[][]) fUpdateProperties.toArray(new String[fUpdateProperties.size()][]);
- fUpdateProperties.clear();
-
- return new Object[]{toUpdate, viewers, properties};
- }
-
- /**
- * Invoke a refresh on the viewer on the given node.
- *
- * @param node
- */
- public void refresh(StructuredViewer viewer, ICSSNode node) {
- if (node == null) {
- return;
- }
-
- addRefreshViewer(viewer);
- addRefreshRequest(node);
- schedule(UPDATE_DELAY);
- }
-
- /**
- * Invoke a refresh on the viewer on the given node.
- *
- * @param node
- */
- public void update(StructuredViewer viewer, ICSSNode node, String[] properties) {
- if (node == null) {
- return;
- }
-
- addUpdateViewer(viewer);
- addUpdateRequest(node, properties);
- schedule(UPDATE_DELAY);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- performUpdates();
-
- performRefreshes(monitor);
- }
- finally {
- monitor.done();
- }
- return status;
- }
-
- private void performRefreshes(IProgressMonitor monitor) {
- // Retrieve BOTH viewers and Nodes on one block
- Object[] requests = getRefreshRequests();
- ICSSNode[] nodes = (ICSSNode[]) requests[0];
- StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
-
- for (int i = 0; i < nodes.length; i++) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- doRefresh(nodes[i], viewers);
- }
- }
-
- private void performUpdates() {
- // Retrieve BOTH viewers and Nodes on one block
- Object[] requests = getUpdateRequests();
- ICSSNode[] nodes = (ICSSNode[]) requests[0];
- StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
- String[][] properties = (String[][]) requests[2];
-
- for (int i = 0; i < nodes.length; i++) {
- doUpdate(viewers, nodes[i], properties[i]);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
deleted file mode 100644
index 87155f00aa..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,40 +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.ui.internal.contentproperties;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
-
-/**
- * @deprecated This class only contains helper methods that you should
- * actually implement yourself.
- */
-public final class ContentSettingsRegistry {
- private static final String NONE = CSSUIMessages.UI_none;
-
- public static void setCSSMetaModelRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- combo.add(name, id);
- }
- combo.sortByKey(1);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
deleted file mode 100644
index 47f0f07cb5..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,106 +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.ui.internal.contentproperties.ui;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.contentproperties.ContentSettingsRegistry;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
-
-/**
- * @deprecated Use CSSWebContentSettingsPropertyPage instead
- */
-public final class CSSContentSettingsPropertyPage extends ContentSettingsPropertyPage {
-
- private final int N_CSS_PROFILE = 0;
-
-
-
- public CSSContentSettingsPropertyPage() {
- super();
- numberOfCombo = 1;
- numCols = 2;
- numRows = 1;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createSettingsPageGUI() {
-
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.FILE :
- //composite = createComposite(propertyPage,numCols,numRows);
- createCSSComboBox();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "CSSContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
- break;
- }
-
- }
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
-
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java
deleted file mode 100644
index 7e1dff427e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentproperties.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-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.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-
-public final class CSSWebContentSettingsPropertyPage extends PropertyPage {
- private static final String SELECT_NONE = CSSUIMessages.UI_none;
-
- private Combo fProfileCombo;
- private List fProfileIds;
-
- public CSSWebContentSettingsPropertyPage() {
- super();
- setDescription(CSSUIMessages.CSSContentSettingsPropertyPage_0);
- }
-
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite propertyPage = createComposite(parent, 2);
-
- // CSS Profile control
- Text languageLabel = new Text(propertyPage, SWT.READ_ONLY);
- languageLabel.setText(CSSUIMessages.CSSContentSettingsPropertyPage_1);
- fProfileCombo = new Combo(propertyPage, SWT.READ_ONLY);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fProfileCombo.setLayoutData(data);
-
- populateValues();
- initializeValues();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID);
- Dialog.applyDialogFont(parent);
- return propertyPage;
- }
-
- /**
- * Get the resource this properties page is for
- *
- * @return IResource for this properties page or null if there is no
- * IResource
- */
- private IResource getResource() {
- IResource resource = null;
- if (getElement() instanceof IResource) {
- resource = (IResource) getElement();
- }
- return resource;
- }
-
- private void initializeValues() {
- int index = 0;
- String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
- if (profile != null && profile.length() > 0) {
- /*
- * If item is already part of combo, select it. Otherwise, select
- * none.
- */
- index = fProfileIds.indexOf(profile);
- }
- index = index >= 0 ? index : 0;
- fProfileCombo.select(index);
- }
-
- private void populateValues() {
- fProfileIds = new ArrayList();
- // add none first
- fProfileCombo.add(SELECT_NONE);
- fProfileIds.add(null);
-
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- fProfileCombo.add(name);
- fProfileIds.add(id);
- }
- }
-
- protected void performDefaults() {
- int index = fProfileCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fProfileCombo.select(index);
-
- super.performDefaults();
- }
-
- public boolean performOk() {
- int index = fProfileCombo.getSelectionIndex();
- if (index > -1) {
- String id = (String) fProfileIds.get(index);
- if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- id = null;
- }
- try {
- CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving
- // file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- return super.performOk();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
deleted file mode 100644
index 1f2d6d07da..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
+++ /dev/null
@@ -1,134 +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.ui.internal.edit.ui;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.css.core.internal.cleanup.CleanupProcessorCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * Cleanup action delegate for CSS editor
- */
-public class CleanupActionCSSDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- fCleanupProcessor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(CSSUIMessages.CleanupDocument_label);
- action.setToolTipText(CSSUIMessages.CleanupDocument_tooltip);
- action.setDescription(CSSUIMessages.CleanupDocument_description);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- final ITextEditor editor = (ITextEditor) fEditor;
- Dialog cleanupDialog = new CleanupDialogCSS(editor.getSite().getShell());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null)
- cleanupProcessor.cleanupModel(model);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(fEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new CleanupProcessorCSS();
-
- return fCleanupProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
deleted file mode 100644
index 1bab4fd98a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.edit.ui;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-
-public class CleanupDialogCSS extends Dialog implements SelectionListener{
-
- private boolean embeddedCSS;
- protected Button fRadioButtonIdentCaseAsis;
- protected Button fRadioButtonIdentCaseLower;
- protected Button fRadioButtonIdentCaseUpper;
- protected Button fRadioButtonPropNameCaseAsis;
- protected Button fRadioButtonPropNameCaseLower;
- protected Button fRadioButtonPropNameCaseUpper;
- protected Button fRadioButtonPropValueCaseAsis;
- protected Button fRadioButtonPropValueCaseLower;
- protected Button fRadioButtonPropValueCaseUpper;
- protected Button fRadioButtonSelectorTagCaseAsis;
- protected Button fRadioButtonSelectorTagCaseLower;
- protected Button fRadioButtonSelectorTagCaseUpper;
- protected Button fRadioButtonSelectorIdCaseAsis;
- protected Button fRadioButtonSelectorIdCaseLower;
- protected Button fRadioButtonSelectorIdCaseUpper;
- protected Button fRadioButtonSelectorClassCaseAsis;
- protected Button fRadioButtonSelectorClassCaseLower;
- protected Button fRadioButtonSelectorClassCaseUpper;
- protected Button fCheckBoxQuoteValues;
- protected Button fCheckBoxFormatSource;
-
- /**
- * CSSCleanupDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- */
- public CleanupDialogCSS(Shell parentShell) {
- super(parentShell);
- }
-
- /**
- *
- * @return org.eclipse.swt.widgets.Control
- * @param parent
- * org.eclipse.swt.widgets.Composite
- */
- public Control createDialogArea(Composite parent) {
- if (isEmbeddedCSS())
- getShell().setText(CSSUIMessages.CSS_Cleanup_UI_);
- else
- getShell().setText(CSSUIMessages.Cleanup_UI_);
-
- Composite panel = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- panel.setLayout(layout);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(panel, IHelpContextIds.CSS_CLEANUP_HELPID);
-
- // Convert ident case
- // ACC: Group radio buttons together so associated label is read
- // Label identCaseLabel = new Label(panel, SWT.NULL);
- // identCaseLabel.setText(ResourceHandler.getString("Identifier_case__UI_"));
- // //$NON-NLS-1$ = "Identifier case:"
- // Canvas identCase = new Canvas(panel, SWT.NULL);
- Group identCase = new Group(panel, SWT.NULL);
- identCase.setText(CSSUIMessages.Identifier_case__UI_);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- identCase.setLayout(hLayout);
- fRadioButtonIdentCaseAsis = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonIdentCaseAsis.addSelectionListener(this);
- fRadioButtonIdentCaseLower = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonIdentCaseLower.addSelectionListener(this);
- fRadioButtonIdentCaseUpper = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonIdentCaseUpper.addSelectionListener(this);
-
- // Convert property name case
- // ACC: Group radio buttons together so associated label is read
- // Label propNameCaseLabel = new Label(panel, SWT.NULL);
- // propNameCaseLabel.setText(ResourceHandler.getString("Property_name_case__UI_"));
- // //$NON-NLS-1$ = "Property name case:"
- // Canvas propNameCase = new Canvas(panel, SWT.NULL);
- Group propNameCase = new Group(panel, SWT.NULL);
- propNameCase.setText(CSSUIMessages.Property_name_case__UI_);
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- propNameCase.setLayout(hLayout);
- fRadioButtonPropNameCaseAsis = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonPropNameCaseAsis.addSelectionListener(this);
- fRadioButtonPropNameCaseLower = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonPropNameCaseLower.addSelectionListener(this);
- fRadioButtonPropNameCaseUpper = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonPropNameCaseUpper.addSelectionListener(this);
-
- // Convert property Value case
- // ACC: Group radio buttons together so associated label is read
- // Label propValueCaseLabel = new Label(panel, SWT.NULL);
- // propValueCaseLabel.setText(ResourceHandler.getString("Property_value_case__UI_"));
- // //$NON-NLS-1$ = "Property value case:"
- // Canvas propValueCase = new Canvas(panel, SWT.NULL);
- Group propValueCase = new Group(panel, SWT.NULL);
- propValueCase.setText(CSSUIMessages.Property_value_case__UI_);
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- propValueCase.setLayout(hLayout);
- fRadioButtonPropValueCaseAsis = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonPropValueCaseAsis.addSelectionListener(this);
- fRadioButtonPropValueCaseLower = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonPropValueCaseLower.addSelectionListener(this);
- fRadioButtonPropValueCaseUpper = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonPropValueCaseUpper.addSelectionListener(this);
-
- if (!isEmbeddedCSS()) {
- // Convert selector tag case
- // ACC: Group radio buttons together so associated label is read
- // Label selectorTagCaseLabel = new Label(panel, SWT.NULL);
- // selectorTagCaseLabel.setText(ResourceHandler.getString("Selector_tag_name_case__UI_"));
- // //$NON-NLS-1$ = "Selector tag name case:"
- // Canvas selectorTagCase = new Canvas(panel, SWT.NULL);
- Group selectorTagCase = new Group(panel, SWT.NULL);
- selectorTagCase.setText(CSSUIMessages.Selector_tag_name_case__UI_);
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- selectorTagCase.setLayout(hLayout);
- fRadioButtonSelectorTagCaseAsis = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonSelectorTagCaseAsis.addSelectionListener(this);
- fRadioButtonSelectorTagCaseLower = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonSelectorTagCaseLower.addSelectionListener(this);
- fRadioButtonSelectorTagCaseUpper = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonSelectorTagCaseUpper.addSelectionListener(this);
-
- Group selectorIdCase = new Group(panel, SWT.NULL);
- selectorIdCase.setText(CSSUIMessages.ID_Selector_Case__UI_);
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- selectorIdCase.setLayout(hLayout);
- fRadioButtonSelectorIdCaseAsis = new Button(selectorIdCase, SWT.RADIO);
- fRadioButtonSelectorIdCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonSelectorIdCaseAsis.addSelectionListener(this);
- fRadioButtonSelectorIdCaseLower = new Button(selectorIdCase, SWT.RADIO);
- fRadioButtonSelectorIdCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonSelectorIdCaseLower.addSelectionListener(this);
- fRadioButtonSelectorIdCaseUpper = new Button(selectorIdCase, SWT.RADIO);
- fRadioButtonSelectorIdCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonSelectorIdCaseUpper.addSelectionListener(this);
-
- Group selectorClassCase = new Group(panel, SWT.NULL);
- selectorClassCase.setText(CSSUIMessages.Class_Selector_Case__UI_);
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- selectorClassCase.setLayout(hLayout);
- fRadioButtonSelectorClassCaseAsis = new Button(selectorClassCase, SWT.RADIO);
- fRadioButtonSelectorClassCaseAsis.setText(CSSUIMessages.As_is_UI_);
- fRadioButtonSelectorClassCaseAsis.addSelectionListener(this);
- fRadioButtonSelectorClassCaseLower = new Button(selectorClassCase, SWT.RADIO);
- fRadioButtonSelectorClassCaseLower.setText(CSSUIMessages.Lower_UI_);
- fRadioButtonSelectorClassCaseLower.addSelectionListener(this);
- fRadioButtonSelectorClassCaseUpper = new Button(selectorClassCase, SWT.RADIO);
- fRadioButtonSelectorClassCaseUpper.setText(CSSUIMessages.Upper_UI_);
- fRadioButtonSelectorClassCaseUpper.addSelectionListener(this);
- }
-
- // Quote attribute values
- fCheckBoxQuoteValues = new Button(panel, SWT.CHECK);
- fCheckBoxQuoteValues.setText(CSSUIMessages.Quote_values_UI_);
- fCheckBoxQuoteValues.addSelectionListener(this);
-
- if (!isEmbeddedCSS()) {
- // Format source
- fCheckBoxFormatSource = new Button(panel, SWT.CHECK);
- fCheckBoxFormatSource.setText(CSSUIMessages.Format_source_UI_);
- fCheckBoxFormatSource.addSelectionListener(this);
- }
-
- setCleanupOptions();
-
- return panel;
- }
-
- /**
- * Insert the method's description here.
- *
- * @return boolean
- */
- public boolean isEmbeddedCSS() {
- return embeddedCSS;
- }
-
- /**
- *
- */
- protected void okPressed() {
- updateCleanupOptions();
- super.okPressed();
- }
-
- /**
- *
- */
- protected void setCleanupOptions() {
- CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
- if (fRadioButtonIdentCaseAsis != null) {
- if (stgy.getIdentCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonIdentCaseUpper.setSelection(true);
- else if (stgy.getIdentCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonIdentCaseLower.setSelection(true);
- else
- fRadioButtonIdentCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonPropNameCaseAsis != null) {
- if (stgy.getPropNameCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonPropNameCaseUpper.setSelection(true);
- else if (stgy.getPropNameCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonPropNameCaseLower.setSelection(true);
- else
- fRadioButtonPropNameCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonPropValueCaseAsis != null) {
- if (stgy.getPropValueCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonPropValueCaseUpper.setSelection(true);
- else if (stgy.getPropValueCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonPropValueCaseLower.setSelection(true);
- else
- fRadioButtonPropValueCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonSelectorTagCaseAsis != null) {
- if (stgy.getSelectorTagCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonSelectorTagCaseUpper.setSelection(true);
- else if (stgy.getSelectorTagCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonSelectorTagCaseLower.setSelection(true);
- else
- fRadioButtonSelectorTagCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonSelectorIdCaseAsis != null) {
- if (stgy.getIdSelectorCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonSelectorIdCaseUpper.setSelection(true);
- else if (stgy.getIdSelectorCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonSelectorIdCaseLower.setSelection(true);
- else
- fRadioButtonSelectorIdCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonSelectorClassCaseAsis != null) {
- if (stgy.getClassSelectorCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonSelectorClassCaseUpper.setSelection(true);
- else if (stgy.getClassSelectorCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonSelectorClassCaseLower.setSelection(true);
- else
- fRadioButtonSelectorClassCaseAsis.setSelection(true);
- }
-
- if (fCheckBoxQuoteValues != null)
- fCheckBoxQuoteValues.setSelection(stgy.isQuoteValues());
-
- if (fCheckBoxFormatSource != null)
- fCheckBoxFormatSource.setSelection(stgy.isFormatSource());
-
- }
-
- /**
- * Insert the method's description here.
- *
- * @param newEmbeddedCSS
- * boolean
- */
- public void setEmbeddedCSS(boolean newEmbeddedCSS) {
- embeddedCSS = newEmbeddedCSS;
- }
-
- /**
- *
- */
- protected void updateCleanupOptions() {
- CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
- if (fRadioButtonIdentCaseAsis != null) {
- if (fRadioButtonIdentCaseUpper.getSelection())
- stgy.setIdentCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonIdentCaseLower.getSelection())
- stgy.setIdentCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setIdentCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonPropNameCaseAsis != null) {
- if (fRadioButtonPropNameCaseUpper.getSelection())
- stgy.setPropNameCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonPropNameCaseLower.getSelection())
- stgy.setPropNameCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setPropNameCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonPropValueCaseAsis != null) {
- if (fRadioButtonPropValueCaseUpper.getSelection())
- stgy.setPropValueCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonPropValueCaseLower.getSelection())
- stgy.setPropValueCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setPropValueCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonSelectorTagCaseAsis != null) {
- if (fRadioButtonSelectorTagCaseUpper.getSelection())
- stgy.setSelectorTagCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonSelectorTagCaseLower.getSelection())
- stgy.setSelectorTagCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setSelectorTagCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonSelectorIdCaseAsis != null) {
- if (fRadioButtonSelectorIdCaseUpper.getSelection())
- stgy.setIdSelectorCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonSelectorIdCaseLower.getSelection())
- stgy.setIdSelectorCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setIdSelectorCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonSelectorClassCaseAsis != null) {
- if (fRadioButtonSelectorClassCaseUpper.getSelection())
- stgy.setClassSelectorCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonSelectorClassCaseLower.getSelection())
- stgy.setClassSelectorCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setClassSelectorCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fCheckBoxQuoteValues != null)
- stgy.setQuoteValues(fCheckBoxQuoteValues.getSelection());
-
- if (fCheckBoxFormatSource != null)
- stgy.setFormatSource(fCheckBoxFormatSource.getSelection());
-
- // save these values to preferences
- ((CSSCleanupStrategyImpl) stgy).saveOptions();
- }
-
- public void widgetSelected(SelectionEvent e) {
- boolean okEnabled = fCheckBoxFormatSource.getSelection()
- || fCheckBoxQuoteValues.getSelection()
- || ((fRadioButtonIdentCaseLower != null && fRadioButtonIdentCaseLower.getSelection()) || (fRadioButtonIdentCaseUpper != null && fRadioButtonIdentCaseUpper.getSelection()))
- || ((fRadioButtonPropNameCaseLower != null && fRadioButtonPropNameCaseLower.getSelection()) || (fRadioButtonPropNameCaseUpper != null && fRadioButtonPropNameCaseUpper.getSelection()))
- || ((fRadioButtonPropValueCaseLower != null && fRadioButtonPropValueCaseLower.getSelection()) || (fRadioButtonPropValueCaseUpper != null && fRadioButtonPropValueCaseUpper.getSelection()))
- || ((fRadioButtonSelectorTagCaseLower != null && fRadioButtonSelectorTagCaseLower.getSelection()) || (fRadioButtonSelectorTagCaseUpper != null && fRadioButtonSelectorTagCaseUpper.getSelection()))
- || ((fRadioButtonSelectorIdCaseLower != null && fRadioButtonSelectorIdCaseLower.getSelection()) || (fRadioButtonSelectorIdCaseUpper != null && fRadioButtonSelectorIdCaseUpper.getSelection()))
- || ((fRadioButtonSelectorClassCaseLower != null && fRadioButtonSelectorClassCaseLower.getSelection()) || (fRadioButtonSelectorClassCaseUpper != null && fRadioButtonSelectorClassCaseUpper.getSelection()))
- ;
- getButton(OK).setEnabled(okEnabled);
-
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
deleted file mode 100644
index 7559e982b8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
+++ /dev/null
@@ -1,54 +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.ui.internal.editor;
-
-
-/**
- * Bundle of most images used by the CSS Source Editor plug-in.
- */
-public class CSSEditorPluginImages {
- public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_STYLESHEET = "icons/full/obj16/stylesheet.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_CHARSET = "icons/full/obj16/charset_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_FONTFACE = "icons/full/obj16/fontface_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_IMPORT = "icons/full/obj16/link_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_MEDIA = "icons/full/obj16/media_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_PAGE = "icons/full/obj16/page_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_STYLE = "icons/full/obj16/style_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_UNKNOWN = "icons/full/obj16/unknown_rule.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_SELECTOR_CLASS = "icons/full/obj16/class_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_ID = "icons/full/obj16/id_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_PSEUDO = "icons/full/obj16/pseudo.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_TAG = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_LINK = "icons/full/obj16/link_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_DEFAULT = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_VALUE_FUNCTION = "icons/full/obj16/css_propertyvalue_function.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALUE_NUMBER = "icons/full/obj16/css_propertyvalue_unit.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALUE_STRING = "icons/full/obj16/css_propertyvalue_identifier.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_CATEGORY_AURAL = "icons/full/obj16/aural_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_BOX = "icons/full/obj16/boxmodel_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_COLORANDBACKGROUND = "icons/full/obj16/colback_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_CONTENT = "icons/full/obj16/content_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_FONT = "icons/full/obj16/font_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_PAGE = "icons/full/obj16/pagedmedia_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_TABLES = "icons/full/obj16/table_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_TEXT = "icons/full/obj16/text_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_UI = "icons/full/obj16/ui_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_VISUAL = "icons/full/obj16/visual_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_DEFAULT = "icons/full/obj16/other_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TEMPLATE = "icons/full/obj16/tag-template.gif"; //$NON-NLS-1$
-
- public static final String IMG_WIZBAN_NEWCSSFILE = "icons/full/wizban/newcssfile_wiz.png"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java
deleted file mode 100644
index 38fa53c3cb..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.editor;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.css.core.internal.document.CSSNodeImpl;
-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.ui.internal.Logger;
-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.editor.SelectionConvertor;
-
-/**
- * <p>Factory to adapt from {@link ICSSModel} to {@link SelectionConvertor}</p>
- */
-public class CSSSelectionConverterFactory implements IAdapterFactory {
-
- /** the list of classes this factory can adapt to */
- private static final Class[] ADAPTER_LIST = new Class[]{SelectionConvertor.class};
-
- /** the adapted class */
- private static final Object selectionConvertor = new CSSSelectionConverter();
-
- /**
- * <p>Default constructor</p>
- */
- public CSSSelectionConverterFactory() {
- }
-
- /**
- * <p>Adapts {@link ICSSModel} to {@link SelectionConvertor}</p>
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- Object adapter = null;
- if (adaptableObject instanceof ICSSModel && SelectionConvertor.class.equals(adapterType)) {
- adapter = selectionConvertor;
- }
- return adapter;
- }
-
- /**
- * <p>Adapts to {@link SelectionConvertor}</p>
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- /**
- * <p>{@link SelectionConvertor} specific to CSS</p>
- */
- private static class CSSSelectionConverter extends SelectionConvertor {
- /**
- * <p>Default constructor</p>
- */
- public CSSSelectionConverter() {
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor#getElements(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)
- */
- public Object[] getElements(IStructuredModel model, int start, int end) {
- Object[] localSelectedStructures = null;
- if (model != null) {
- IndexedRegion region = model.getIndexedRegion(start);
-
- /* in CSS docs whitespace is owned by the style sheet
- * this is to find the first none whitespace region
- */
- if(region instanceof ICSSStyleSheet) {
- try {
- String selection = model.getStructuredDocument().get(start, end);
- int whitespaceLength = beginingWhitespaceLength(selection);
- region = model.getIndexedRegion(start+whitespaceLength+1);
- } catch(BadLocationException e) {
- //should never be able to happen
- Logger.logException("Bad location on selection, this should never happen", e);
- }
- }
-
- if (region != null) {
- // if single selection spans selected region
- // else multiple selection
- if (end <= region.getEndOffset()) {
- // single selection
- localSelectedStructures = new Object[1];
- localSelectedStructures[0] = region;
- }
- else {
- int maxLength = model.getStructuredDocument().getLength();
- Set structures = new HashSet();
- while (region != null && region.getEndOffset() <= end && region.getEndOffset() <= maxLength && !structures.contains(region)) {
- structures.add(region);
-
- //use the CSS model to find the next sibling
- boolean foundNextSibling = false;
- if(region instanceof CSSNodeImpl ) {
- ICSSNode node = ((ICSSNode)region).getNextSibling();
- if(node instanceof IndexedRegion) {
- region = (IndexedRegion)node;
- foundNextSibling = true;
- }
- }
-
- if(!foundNextSibling) {
- region = model.getIndexedRegion(region.getEndOffset() + 1);
- }
- }
- localSelectedStructures = structures.toArray();
- }
- }
- }
- if (localSelectedStructures == null) {
- localSelectedStructures = new Object[0];
- }
- return localSelectedStructures;
- }
-
- }
-
- /**
- * @param s find the length of the whitespace preceding this {@link String}
- * @return the length of the whitespace preceding the given {@link String}
- */
- private static int beginingWhitespaceLength(String s) {
- int length = 0;
-
- for (int i = 0; i < s.length() && length == 0; ++i) {
- if (!Character.isWhitespace(s.charAt(i))) {
- length = i;
- }
- }
-
- return length;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index ddc622b3b2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.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.ui.internal.editor;
-
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-
-/**
- * Help context ids for the CSS Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.css.ui.
- public static final String PREFIX = CSSUIPlugin.ID + "."; //$NON-NLS-1$
-
- // // figured out on the fly
- // // CSS Source page editor
- // public static final String CSS_SOURCEVIEW_HELPID =
- // ContentTypeIdForCSS.ContentTypeID_CSS +"_source_HelpId"; //$NON-NLS-1$
-
- // CSS Files Preference page
- public static final String CSS_PREFWEBX_FILES_HELPID = PREFIX + "webx0010"; //$NON-NLS-1$
- // CSS Source Preference page
- public static final String CSS_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0011"; //$NON-NLS-1$
- // CSS Styles Preference page
- public static final String CSS_PREFWEBX_STYLES_HELPID = PREFIX + "webx0012"; //$NON-NLS-1$
- // CSS Template Preference page
- public static final String CSS_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0013"; //$NON-NLS-1$
-
- // CSS Cleanup dialog
- public static final String CSS_CLEANUP_HELPID = PREFIX + "xmlm1300"; //$NON-NLS-1$
-
- // CSS Content Settings
- public static final String CSS_CONTENT_SETTINGS_HELPID = PREFIX + "misc0180"; //$NON-NLS-1$
-
- // CSS New File Wizard - Template Page
- public static final String CSS_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "cssw0010"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/CleanupDocumentHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/CleanupDocumentHandler.java
deleted file mode 100644
index a623b3ee18..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/CleanupDocumentHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.css.core.internal.cleanup.CleanupProcessorCSS;
-import org.eclipse.wst.css.ui.internal.edit.ui.CleanupDialogCSS;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public class CleanupDocumentHandler extends AbstractHandler implements IHandler {
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void dispose() {
- // nulling out just in case
- fCleanupProcessor = null;
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editorPart instanceof ITextEditor)
- textEditor = (ITextEditor) editorPart;
- else {
- Object o = editorPart.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
-
- if (textEditor != null) {
- final ITextEditor editor = textEditor;
- Dialog cleanupDialog = new CleanupDialogCSS(editor.getSite().getShell());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null)
- cleanupProcessor.cleanupModel(model);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(editor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- return null;
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new CleanupProcessorCSS();
-
- return fCleanupProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
deleted file mode 100644
index efd4711595..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-public class StructuredSelectEnclosingHandler extends AbstractStructuredSelectHandler {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getParentNode();
- if(newNode instanceof CSSStyleDeclaration) {
- newNode = newNode.getParentNode();
- }
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectNextHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectNextHandler.java
deleted file mode 100644
index bfccb26a81..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectNextHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-
-public class StructuredSelectNextHandler extends AbstractStructuredSelectHandler {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- int offset = textSelection.getOffset() + textSelection.getLength() - 1;
- if (offset < 0)
- offset = 0;
-
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, offset);
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
-
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getNextSibling();
- if (newNode == null) {
- newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(currentOffset, newIndexedRegion.getEndOffset() - currentOffset);
- }
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectPreviousHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectPreviousHandler.java
deleted file mode 100644
index 5827a4f664..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectPreviousHandler.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-
-public class StructuredSelectPreviousHandler extends AbstractStructuredSelectHandler {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getPreviousSibling();
- if (newNode == null) {
- newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), currentEndOffset - newIndexedRegion.getStartOffset());
- }
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java
deleted file mode 100644
index 702be85760..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java
+++ /dev/null
@@ -1,183 +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.ui.internal.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-
-
-public class CSSImageHelper {
- private static CSSImageHelper fInstance = null;
-
- /**
- * singleton
- */
- public synchronized static CSSImageHelper getInstance() {
- if (fInstance == null) {
- fInstance = new CSSImageHelper();
- }
- return fInstance;
- }
-
- private HashMap fImageDescRegistry = null; // save a descriptor for each image
- private Map fTypeMap = null;
-
- /**
- *
- */
- private CSSImageHelper() {
- super();
- }
-
- /**
- *
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSUIPlugin.ID, resource);
- Image image = null;
-
- if (desc == null) {
- desc = ImageDescriptor.getMissingImageDescriptor();
- image = desc.createImage();
- } else {
- image = desc.createImage();
- 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(CSSUIPlugin.ID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- } else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * by type
- */
- public Image getImage(CSSImageType type) {
- if (fTypeMap == null) {
- fTypeMap = new HashMap();
- fTypeMap.put(CSSImageType.STYLESHEET, CSSEditorPluginImages.IMG_OBJ_STYLESHEET);
-
- fTypeMap.put(CSSImageType.RULE_CHARSET, CSSEditorPluginImages.IMG_OBJ_RULE_CHARSET);
- fTypeMap.put(CSSImageType.RULE_FONTFACE, CSSEditorPluginImages.IMG_OBJ_RULE_FONTFACE);
- fTypeMap.put(CSSImageType.RULE_IMPORT, CSSEditorPluginImages.IMG_OBJ_RULE_IMPORT);
- fTypeMap.put(CSSImageType.RULE_MEDIA, CSSEditorPluginImages.IMG_OBJ_RULE_MEDIA);
- fTypeMap.put(CSSImageType.RULE_PAGE, CSSEditorPluginImages.IMG_OBJ_RULE_PAGE);
- fTypeMap.put(CSSImageType.RULE_STYLE, CSSEditorPluginImages.IMG_OBJ_RULE_STYLE);
- fTypeMap.put(CSSImageType.RULE_UNKNOWN, CSSEditorPluginImages.IMG_OBJ_RULE_UNKNOWN);
-
- fTypeMap.put(CSSImageType.SELECTOR_CLASS, CSSEditorPluginImages.IMG_OBJ_SELECTOR_CLASS);
- fTypeMap.put(CSSImageType.SELECTOR_ID, CSSEditorPluginImages.IMG_OBJ_SELECTOR_ID);
- fTypeMap.put(CSSImageType.SELECTOR_PSEUDO, CSSEditorPluginImages.IMG_OBJ_SELECTOR_PSEUDO);
- fTypeMap.put(CSSImageType.SELECTOR_TAG, CSSEditorPluginImages.IMG_OBJ_SELECTOR_TAG);
- fTypeMap.put(CSSImageType.SELECTOR_LINK, CSSEditorPluginImages.IMG_OBJ_SELECTOR_LINK);
- fTypeMap.put(CSSImageType.SELECTOR_DEFAULT, CSSEditorPluginImages.IMG_OBJ_SELECTOR_DEFAULT);
-
- fTypeMap.put(CSSImageType.VALUE_FUNCTION, CSSEditorPluginImages.IMG_OBJ_VALUE_FUNCTION);
- fTypeMap.put(CSSImageType.VALUE_NUMBER, CSSEditorPluginImages.IMG_OBJ_VALUE_NUMBER);
- fTypeMap.put(CSSImageType.VALUE_STRING, CSSEditorPluginImages.IMG_OBJ_VALUE_STRING);
-
- fTypeMap.put(CSSImageType.CATEGORY_AURAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_AURAL);
- fTypeMap.put(CSSImageType.CATEGORY_BOX, CSSEditorPluginImages.IMG_OBJ_CATEGORY_BOX);
- fTypeMap.put(CSSImageType.CATEGORY_COLORANDBACKGROUND, CSSEditorPluginImages.IMG_OBJ_CATEGORY_COLORANDBACKGROUND);
- fTypeMap.put(CSSImageType.CATEGORY_CONTENT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_CONTENT);
- fTypeMap.put(CSSImageType.CATEGORY_FONT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_FONT);
- fTypeMap.put(CSSImageType.CATEGORY_PAGE, CSSEditorPluginImages.IMG_OBJ_CATEGORY_PAGE);
- fTypeMap.put(CSSImageType.CATEGORY_TABLES, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TABLES);
- fTypeMap.put(CSSImageType.CATEGORY_TEXT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TEXT);
- fTypeMap.put(CSSImageType.CATEGORY_UI, CSSEditorPluginImages.IMG_OBJ_CATEGORY_UI);
- fTypeMap.put(CSSImageType.CATEGORY_VISUAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_VISUAL);
- fTypeMap.put(CSSImageType.CATEGORY_DEFAULT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_DEFAULT);
- }
- return getImage((String) fTypeMap.get(type));
- }
-
- /**
- * by relative path(from here)
- */
- public Image getImage(String resource) {
- if (resource == null) {
- return null;
- }
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * 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;
- }
-
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java
deleted file mode 100644
index 6f2bf91fac..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java
+++ /dev/null
@@ -1,235 +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.ui.internal.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-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.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-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.ICSSPrimitiveValue;
-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.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.css.CSSCharsetRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSMediaRule;
-import org.w3c.dom.css.CSSPageRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSValue;
-
-/**
- */
-public class CSSImageType {
-
- private final String fName;
-
- private CSSImageType(String name) {
- this.fName = name;
- }
-
- public String toString() {
- return fName;
- }
-
- public static final CSSImageType STYLESHEET = new CSSImageType("STYLESHEET"); //$NON-NLS-1$
-
- public static final CSSImageType RULE_CHARSET = new CSSImageType("RULE_CHARSET"); //$NON-NLS-1$
- public static final CSSImageType RULE_FONTFACE = new CSSImageType("RULE_FONTFACE"); //$NON-NLS-1$
- public static final CSSImageType RULE_IMPORT = new CSSImageType("RULE_IMPORT"); //$NON-NLS-1$
- public static final CSSImageType RULE_MEDIA = new CSSImageType("RULE_MEDIA"); //$NON-NLS-1$
- public static final CSSImageType RULE_PAGE = new CSSImageType("RULE_PAGE"); //$NON-NLS-1$
- public static final CSSImageType RULE_STYLE = new CSSImageType("RULE_STYLE"); //$NON-NLS-1$
- public static final CSSImageType RULE_UNKNOWN = new CSSImageType("RULE_UNKNOWN"); //$NON-NLS-1$
-
- public static final CSSImageType SELECTOR_CLASS = new CSSImageType("SELECTOR_CLASS"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_ID = new CSSImageType("SELECTOR_ID"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_DEFAULT = new CSSImageType("SELECTOR_DEFAULT"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_PSEUDO = new CSSImageType("SELECTOR_PSEUDO"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_TAG = new CSSImageType("SELECTOR_TAG"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_LINK = new CSSImageType("SELECTOR_LINK"); //$NON-NLS-1$
-
- public static final CSSImageType VALUE_FUNCTION = new CSSImageType("VALUE_FUNCTION"); //$NON-NLS-1$
- public static final CSSImageType VALUE_NUMBER = new CSSImageType("VALUE_NUMBER"); //$NON-NLS-1$
- public static final CSSImageType VALUE_STRING = new CSSImageType("VALUE_STRING"); //$NON-NLS-1$
-
- public static final CSSImageType CATEGORY_AURAL = new CSSImageType("CATEGORY_AURAL"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_BOX = new CSSImageType("CATEGORY_BOX"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_COLORANDBACKGROUND = new CSSImageType("CATEGORY_COLORANDBACKGROUND"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_CONTENT = new CSSImageType("CATEGORY_CONTENT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_FONT = new CSSImageType("CATEGORY_FONT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_PAGE = new CSSImageType("CATEGORY_PAGE"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_TABLES = new CSSImageType("CATEGORY_TABLES"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_TEXT = new CSSImageType("CATEGORY_TEXT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_UI = new CSSImageType("CATEGORY_UI"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_VISUAL = new CSSImageType("CATEGORY_VISUAL"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_DEFAULT = new CSSImageType("CATEGORY_DEFAULT"); //$NON-NLS-1$
-
- /**
- * by node
- */
- public static CSSImageType getImageType(ICSSNode node) {
- CSSImageType imageType = null;
- if (node instanceof CSSCharsetRule) {
- imageType = RULE_CHARSET;
- } else if (node instanceof CSSFontFaceRule) {
- imageType = RULE_FONTFACE;
- } else if (node instanceof CSSImportRule) {
- imageType = RULE_IMPORT;
- } else if (node instanceof CSSMediaRule) {
- imageType = RULE_MEDIA;
- } else if (node instanceof CSSPageRule) {
- imageType = RULE_PAGE;
- } else if (node instanceof CSSStyleRule) {
- imageType = getImageType(((ICSSStyleRule) node).getSelectors());
- } else if (node instanceof CSSStyleDeclaration) {
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- return getImageType(parent);
- }
- } else if (node instanceof ICSSStyleDeclItem) {
- String name = ((ICSSStyleDeclItem) node).getPropertyName();
- ICSSDocument doc = node.getOwnerDocument();
- ICSSModel model = (doc != null) ? doc.getModel() : null;
- CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
- CSSMetaModel metaModel = finder.findMetaModelFor(model);
- // is font-face rule ?
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- parent = parent.getParentNode();
- if (parent instanceof CSSFontFaceRule) {
- imageType = CSSImageType.CATEGORY_FONT;
- }
- }
- if (imageType == null) {
- CSSMMProperty prop = new CSSMetaModelUtil(metaModel).getProperty(name);
- if (prop != null) {
- String category = prop.getAttribute("category"); //$NON-NLS-1$
- imageType = getImageType(category);
- }
- if (imageType == null) {
- imageType = CSSImageType.CATEGORY_DEFAULT;
- }
- }
- } else if (node instanceof CSSValue) {
- switch (((CSSValue) node).getCssValueType()) {
- case CSSPrimitiveValue.CSS_NUMBER :
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- case CSSPrimitiveValue.CSS_EMS :
- case CSSPrimitiveValue.CSS_EXS :
- case CSSPrimitiveValue.CSS_PX :
- case CSSPrimitiveValue.CSS_CM :
- case CSSPrimitiveValue.CSS_MM :
- case CSSPrimitiveValue.CSS_IN :
- case CSSPrimitiveValue.CSS_PT :
- case CSSPrimitiveValue.CSS_PC :
- case CSSPrimitiveValue.CSS_DEG :
- case CSSPrimitiveValue.CSS_RAD :
- case CSSPrimitiveValue.CSS_GRAD :
- case CSSPrimitiveValue.CSS_MS :
- case CSSPrimitiveValue.CSS_S :
- case CSSPrimitiveValue.CSS_HZ :
- case CSSPrimitiveValue.CSS_KHZ :
- case CSSPrimitiveValue.CSS_DIMENSION :
- case ICSSPrimitiveValue.CSS_INTEGER :
- case ICSSPrimitiveValue.CSS_HASH :
- imageType = VALUE_NUMBER;
- break;
- case CSSPrimitiveValue.CSS_ATTR :
- case CSSPrimitiveValue.CSS_COUNTER :
- case CSSPrimitiveValue.CSS_RECT :
- case CSSPrimitiveValue.CSS_RGBCOLOR :
- case CSSPrimitiveValue.CSS_URI :
- case ICSSPrimitiveValue.CSS_FORMAT :
- case ICSSPrimitiveValue.CSS_LOCAL :
- imageType = VALUE_FUNCTION;
- break;
- default :
- imageType = VALUE_STRING;
- break;
- }
- }
- return imageType;
- }
-
- public static CSSImageType getImageType(ICSSSelectorList selectorList) {
- if (selectorList == null || selectorList.getLength() == 0) {
- return SELECTOR_DEFAULT;
- }
- CSSImageType imageType = null;
- int nSelectors = selectorList.getLength();
- for (int i = 0; i < nSelectors; i++) {
- CSSImageType candidate = getImageType(selectorList.getSelector(i));
- if (imageType == null) {
- imageType = candidate;
- } else if (imageType != candidate) {
- imageType = null;
- break;
- }
- }
-
- return (imageType == null) ? SELECTOR_DEFAULT : imageType;
- }
-
- public static CSSImageType getImageType(ICSSSelector selector) {
- CSSImageType imageType = SELECTOR_DEFAULT;
- if (selector == null || selector.getLength() == 0) {
- return imageType;
- }
- ICSSSelectorItem item = selector.getItem(selector.getLength() - 1);
- if (item.getItemType() == ICSSSelectorItem.SIMPLE) {
- ICSSSimpleSelector ss = (ICSSSimpleSelector) item;
- if (0 < ss.getNumOfIDs()) {
- imageType = SELECTOR_ID;
- } else if (0 < ss.getNumOfClasses()) {
- imageType = SELECTOR_CLASS;
- } else if (0 < ss.getNumOfPseudoNames()) {
- imageType = SELECTOR_PSEUDO;
- } else {
- imageType = SELECTOR_TAG;
- }
- }
- return imageType;
- }
-
- public static CSSImageType getImageType(String category) {
- if (fCategoryMap == null) {
- fCategoryMap = new HashMap();
- fCategoryMap.put("aural", CATEGORY_AURAL); //$NON-NLS-1$
- fCategoryMap.put("box", CATEGORY_BOX); //$NON-NLS-1$
- fCategoryMap.put("colorandbackground", CATEGORY_COLORANDBACKGROUND); //$NON-NLS-1$
- fCategoryMap.put("content", CATEGORY_CONTENT); //$NON-NLS-1$
- fCategoryMap.put("font", CATEGORY_FONT); //$NON-NLS-1$
- fCategoryMap.put("page", CATEGORY_PAGE); //$NON-NLS-1$
- fCategoryMap.put("tables", CATEGORY_TABLES); //$NON-NLS-1$
- fCategoryMap.put("text", CATEGORY_TEXT); //$NON-NLS-1$
- fCategoryMap.put("ui", CATEGORY_UI); //$NON-NLS-1$
- fCategoryMap.put("visual", CATEGORY_VISUAL); //$NON-NLS-1$
- }
- CSSImageType imageType = (CSSImageType) fCategoryMap.get(category);
- return (imageType == null) ? CATEGORY_DEFAULT : imageType;
- }
-
- private static Map fCategoryMap = null;
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java
deleted file mode 100644
index 3691c7aa18..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java
+++ /dev/null
@@ -1,82 +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.wst.css.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
-
-/**
- * <p>The readable and writable completion proposal categories configuration
- * for the CSS content type</p>
- */
-public class CSSCompletionProposalCategoriesConfiguration extends
- AbstractCompletionProposalCategoriesConfiguration {
-
- /** the ID of the preference page where users can change the preferences */
- private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.css.ui.preferences.contentassist"; //$NON-NLS-1$
-
- /**
- * <p>Creates the configuration</p>
- */
- public CSSCompletionProposalCategoriesConfiguration() {
- //nothing to do.
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
- */
- public boolean hasAssociatedPropertiesPage() {
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
- */
- public String getPropertiesPageID() {
- return PREFERENCES_PAGE_ID;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
- */
- protected String getShouldNotDisplayOnDefaultPagePrefKey() {
- return CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
- */
- protected String getShouldNotDisplayOnOwnPagePrefKey() {
- return CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
- */
- protected String getPageSortOrderPrefKey() {
- return CSSUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
- */
- protected String getDefaultPageSortOrderPrefKey() {
- return CSSUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
deleted file mode 100644
index b5ab212567..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.wst.css.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.ui.PlatformUI;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-
-/**
- * Sets default values for CSS UI preferences
- */
-public class CSSUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = CSSUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- // CSS Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
- String JUSTBOLD = " | null | true";
- String styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsCSS.NORMAL, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATMARK_RULE, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ATMARK_RULE, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.SELECTOR, 63, 127, 127) + JUSTBOLD;
- store.setDefault(IStyleConstantsCSS.SELECTOR, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.UNIVERSAL, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.UNIVERSAL, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.COMBINATOR, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.COMBINATOR, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.SELECTOR_CLASS, 63, 127, 127) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.SELECTOR_CLASS, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ID, 63, 127, 127) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.ID, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PSEUDO, 63, 127, 127) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.PSEUDO, styleValue);
-
- /* Attribute selector */
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_DELIM, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ATTRIBUTE_DELIM, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ATTRIBUTE_NAME, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_OPERATOR, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ATTRIBUTE_OPERATOR, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_VALUE, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ATTRIBUTE_VALUE, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.MEDIA, 42, 0, 225) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.MEDIA, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.COMMENT, 63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.COMMENT, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PROPERTY_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.PROPERTY_NAME, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PROPERTY_VALUE, 42, 0, 225) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.PROPERTY_VALUE, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.URI, 42, 0, 225) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.URI, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.STRING, 42, 0, 225) + JUSTITALIC;
- store.setDefault(IStyleConstantsCSS.STRING, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsCSS.COLON, styleValue);
- store.setDefault(IStyleConstantsCSS.SEMI_COLON, styleValue);
- store.setDefault(IStyleConstantsCSS.CURLY_BRACE, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ERROR, 191, 63, 63) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsCSS.ERROR, styleValue);
-
- // set default new css file template to use in new file wizard
- /*
- * Need to find template name that goes with default template id (name
- * may change for different language)
- */
- store.setDefault(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.css.ui.internal.templates.newcss"); //$NON-NLS-1$
-
- // Defaults for Content Assist preference page
- store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
- store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
- store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
- "org.eclipse.wst.css.ui.proposalCategory.css\0" +
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
- store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0"+
- "org.eclipse.wst.css.ui.proposalCategory.css");
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
deleted file mode 100644
index 1dc5129c57..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.css.ui.internal.preferences;
-
-/**
- * Preference keys for CSS UI
- */
-public class CSSUIPreferenceNames {
- private CSSUIPreferenceNames() {
- // cannot create instance
- }
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
-
- /**
- * The key to store the last template name used in new CSS 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 initial template ID to be used in the new CSS file wizard. In the absence
- * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
- */
- public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), ordered is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "css_content_assist_display_on_default_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), order is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "css_content_assist_display_on_own_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "css_content_assist_own_page_sort_order"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "css_content_assist_default_page_sort_order"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
deleted file mode 100644
index ab63bf1ab3..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
+++ /dev/null
@@ -1,221 +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.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-
-/**
- * @deprecated
- */
-public class CSSColorPage extends AbstractColorPage {
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String) i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- protected Control createContents(Composite parent) {
- Composite pageComponent = createComposite(parent, 1);
- ((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
- super.createContents(pageComponent);
-
- // assigning one help for whole group
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.CSS_PREFWEBX_STYLES_HELPID);
-
- return pageComponent;
- }
-
- protected Composite createColoringComposite(Composite parent) {
- Composite coloringComposite = super.createColoringComposite(parent);
-
- // assigning one help for whole group
- return coloringComposite;
- }
-
- /**
- * getSampleText method comment.
- */
- public String getSampleText() {
- return CSSUIMessages.PrefsLabel_ColorSample; //$NON-NLS-1$
- }
-
- /**
- *
- * @param contextStyleMap
- * java.util.Dictionary
- */
- protected void initContextStyleMap(Dictionary contextStyleMap) {
- contextStyleMap.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
- contextStyleMap.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
- contextStyleMap.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
- contextStyleMap.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
- contextStyleMap.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
- contextStyleMap.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
- contextStyleMap.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
- contextStyleMap.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
- contextStyleMap.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
-
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
-
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
- contextStyleMap.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.ERROR);
- }
-
- /**
- *
- * @param descriptions
- * java.util.Dictionary
- */
- protected void initDescriptions(Dictionary descriptions) {
- // create descriptions for hilighting types
- descriptions.put(IStyleConstantsCSS.NORMAL, CSSUIMessages.PrefsLabel_ColorNormal);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.ATMARK_RULE, CSSUIMessages.PrefsLabel_ColorAtmarkRule);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.SELECTOR, CSSUIMessages.PrefsLabel_ColorSelector);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.MEDIA, CSSUIMessages.PrefsLabel_ColorMedia);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.COMMENT, CSSUIMessages.PrefsLabel_ColorComment);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.PROPERTY_NAME, CSSUIMessages.PrefsLabel_ColorPropertyName);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.PROPERTY_VALUE, CSSUIMessages.PrefsLabel_ColorPropertyValue);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.URI, CSSUIMessages.PrefsLabel_ColorUri);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.STRING, CSSUIMessages.PrefsLabel_ColorString);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.COLON, CSSUIMessages.PrefsLabel_ColorColon);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.SEMI_COLON, CSSUIMessages.PrefsLabel_ColorSemiColon);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.CURLY_BRACE, CSSUIMessages.PrefsLabel_ColorCurlyBrace);//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.ERROR, CSSUIMessages.PrefsLabel_ColorError);//$NON-NLS-1$
- }
-
- /**
- *
- * @param list
- * java.util.ArrayList
- */
- protected void initStyleList(ArrayList list) {
- list.add(IStyleConstantsCSS.NORMAL);
- list.add(IStyleConstantsCSS.ATMARK_RULE);
- list.add(IStyleConstantsCSS.SELECTOR);
- list.add(IStyleConstantsCSS.MEDIA);
- list.add(IStyleConstantsCSS.COMMENT);
- list.add(IStyleConstantsCSS.PROPERTY_NAME);
- list.add(IStyleConstantsCSS.PROPERTY_VALUE);
- list.add(IStyleConstantsCSS.URI);
- list.add(IStyleConstantsCSS.STRING);
- list.add(IStyleConstantsCSS.COLON);
- list.add(IStyleConstantsCSS.SEMI_COLON);
- list.add(IStyleConstantsCSS.CURLY_BRACE);
- list.add(IStyleConstantsCSS.ERROR);
- }
-
- /**
- * setupPicker method comment.
- */
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForCSS.ContentTypeID_CSS).getParser());
-
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- CSSUIPlugin.getDefault().savePluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java
deleted file mode 100644
index 0bf18afbc4..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java
+++ /dev/null
@@ -1,126 +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.wst.css.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-
-/**
- * <p>Defines the preference page for allowing the user to change the content
- * assist preferences</p>
- */
-public class CSSContentAssistPreferencePage extends AbstractPreferencePage implements
- IWorkbenchPreferencePage {
-
- private static final String CSS_CONTENT_TYPE_ID = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
-
- /** configuration block for changing preference having to do with the content assist categories */
- private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
-
- createContentsForCyclingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
- */
- protected void performDefaults() {
- performDefaultsForCyclingGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- initializeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- storeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * <p>Create the contents for the content assist cycling preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForCyclingGroup(Composite parent) {
- ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(CSS_CONTENT_TYPE_ID);
-
- if(configurationWriter != null) {
- fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(CSS_CONTENT_TYPE_ID, configurationWriter);
- fConfigurationBlock.createContents(parent, null); //$NON-NLS-1$
- } else {
- Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
- " specified for the CSS content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
- " preference block for editing proposal categories preferences."); //$NON-NLS-1$
- }
- }
-
- /**
- * <p>Store the values for the cycling group</p>
- */
- private void storeValuesForCyclingGroup() {
- if (fConfigurationBlock != null) {
- fConfigurationBlock.storeValues();
- }
- }
-
- /**
- * <p>Initialize the values for the cycling group</p>
- */
- private void initializeValuesForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.initializeValues();
- }
- }
-
- /**
- * <p>Load the defaults of the cycling group</p>
- */
- private void performDefaultsForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.performDefaults();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
deleted file mode 100644
index 77cbe7f532..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
+++ /dev/null
@@ -1,67 +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.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class CSSFilesPreferencePage extends XMLFilesPreferencePage {
- protected IPreferenceStore doGetPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- CSSCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected Preferences getModelPreferences() {
- return CSSCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected Control createContents(Composite parent) {
- Composite scrolledComposite = createScrolledComposite(parent);
- createContentsForCreatingGroup(scrolledComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.CSS_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
- return scrolledComposite;
- }
-
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
- }
-
- protected void initializeValues() {
- initializeValuesForCreatingGroup();
- }
-
- protected void performDefaults() {
- performDefaultsForCreatingGroup();
-
- updateApplyButton();
- }
-
- protected void storeValues() {
- storeValuesForCreatingGroup();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
deleted file mode 100644
index e632934053..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.IPreferenceStore;
-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.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-
-/**
- */
-public class CSSSourcePreferencePage extends AbstractPreferencePage {
- // Content Assist
- protected Button fAutoPropose;
- protected Label fAutoProposeLabel;
-
- protected Text fAutoProposeText;
- protected Button fClearAllBlankLines;
- protected Button fIdentLower;
- // case of output character
- // case of identifier
- protected Button fIdentUpper;
- private Spinner fIndentationSize;
- private Button fIndentUsingSpaces;
-
- private Button fIndentUsingTabs;
- // Formatting
- protected Label fLineWidthLabel;
-
- protected Text fLineWidthText;
- // prohibit wrapping if style attribute
- protected Button fNowrapAttr;
- // one property per one line
- protected Button fPropertyPerLine;
- protected Button fPropNameLower;
-
- // case of property name
- protected Button fPropNameUpper;
- protected Button fPropValueLower;
- // case of property value
- protected Button fPropValueUpper;
-
- // Selector case
- protected Button fSelectorUpper;
- protected Button fSelectorLower;
-
- protected Button fSplitMultiAttrs;
- private final int MAX_INDENTATION_SIZE = 16;
- private final int MIN_INDENTATION_SIZE = 0;
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CSS_PREFWEBX_SOURCE_HELPID);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", CSSUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- createContentsForFormattingGroup(composite);
- createContentsForContentAssistGroup(composite);
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private void createContentsForContentAssistGroup(Composite parent) {
- // not content assist, but preferred case
- Group caseGroup = createGroup(parent, 4);
- caseGroup.setText(CSSUIMessages.PrefsLabel_CaseGroup);
-
- // use group for radio buttons so that associated label is read
- Group identGroup = createGroup(caseGroup, 1);
- identGroup.setText(CSSUIMessages.PrefsLabel_CaseIdent);
- fIdentUpper = createRadioButton(identGroup, CSSUIMessages.PrefsLabel_CaseIdentUpper);
- fIdentLower = createRadioButton(identGroup, CSSUIMessages.PrefsLabel_CaseIdentLower);
-
- // use group for radio buttons so that associated label is read
- Group selectorGroup = createGroup(caseGroup, 1);
- selectorGroup.setText(CSSUIMessages.PrefsLabel_SelectorTagName);
- fSelectorUpper = createRadioButton(selectorGroup, CSSUIMessages.PrefsLabel_SelectorTagNameUpper);
- fSelectorLower = createRadioButton(selectorGroup, CSSUIMessages.PrefsLabel_SelectorTagNameLower);
-
- // use group for radio buttons so that associated label is read
- Group propNameGroup = createGroup(caseGroup, 1);
- propNameGroup.setText(CSSUIMessages.PrefsLabel_CasePropName);
- fPropNameUpper = createRadioButton(propNameGroup, CSSUIMessages.PrefsLabel_CasePropNameUpper);
- fPropNameLower = createRadioButton(propNameGroup, CSSUIMessages.PrefsLabel_CasePropNameLower);
-
- // use group for radio buttons so that associated label is read
- Group propValueGroup = createGroup(caseGroup, 1);
- propValueGroup.setText(CSSUIMessages.PrefsLabel_CasePropValue);
- fPropValueUpper = createRadioButton(propValueGroup, CSSUIMessages.PrefsLabel_CasePropValueUpper);
- fPropValueLower = createRadioButton(propValueGroup, CSSUIMessages.PrefsLabel_CasePropValueLower);
- }
-
- private void createContentsForFormattingGroup(Composite parent) {
- Group formattingGroup = createGroup(parent, 2);
- formattingGroup.setText(CSSUIMessages.Formatting_UI_);
-
- fLineWidthLabel = createLabel(formattingGroup, CSSUIMessages.Line_width__UI_);
- fLineWidthText = new Text(formattingGroup, SWT.SINGLE | SWT.BORDER);
- GridData gData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.BEGINNING);
- gData.widthHint = 25;
- fLineWidthText.setLayoutData(gData);
- fLineWidthText.addModifyListener(this);
-
- fPropertyPerLine = createCheckBox(formattingGroup, CSSUIMessages.PrefsLabel_WrappingInsertLineBreak);
- ((GridData) fPropertyPerLine.getLayoutData()).horizontalSpan = 2;
-
- fNowrapAttr = createCheckBox(formattingGroup, CSSUIMessages.PrefsLabel_WrappingWithoutAttr);
- ((GridData) fNowrapAttr.getLayoutData()).horizontalSpan = 2;
-
- // [269224] - Place the indent controls in their own composite for proper tab ordering
- Composite indentComposite = createComposite(formattingGroup, 1);
- ((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
- ((GridLayout) indentComposite.getLayout()).marginWidth = 0;
- ((GridLayout) indentComposite.getLayout()).marginHeight = 0;
-
- fIndentUsingTabs = createRadioButton(indentComposite, CSSUIMessages.Indent_using_tabs_);
- ((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
- fIndentUsingSpaces = createRadioButton(indentComposite, CSSUIMessages.Indent_using_spaces);
- ((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
-
- createLabel(formattingGroup, CSSUIMessages.Indentation_size);
- fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- fIndentationSize.setLayoutData(gd);
- fIndentationSize.setToolTipText(CSSUIMessages.Indentation_size_tip);
- fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
- fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
- fIndentationSize.setIncrement(1);
- fIndentationSize.setPageIncrement(4);
- fIndentationSize.addModifyListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-
- private void doSavePreferenceStore() {
- CSSUIPlugin.getDefault().savePluginPreferences();
- CSSCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected Preferences getModelPreferences() {
- return CSSCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void initializeValues() {
- initializeValuesForFormattingGroup();
- initializeValuesForContentAssistGroup();
- }
-
- private void initializeValuesForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- fIdentUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
- fIdentLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
- fSelectorUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.UPPER);
- fSelectorLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER);
- fPropNameUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
- fPropNameLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
- fPropValueUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
- fPropValueLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.LOWER);
- }
-
- private void initializeValuesForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- fLineWidthText.setText(prefs.getString(CSSCorePreferenceNames.LINE_WIDTH));
- fPropertyPerLine.setSelection(prefs.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE));
- fNowrapAttr.setSelection(prefs.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
-
- if (CSSCorePreferenceNames.TAB.equals(getModelPreferences().getString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- } else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
-
- fIndentationSize.setSelection(getModelPreferences().getInt(CSSCorePreferenceNames.INDENTATION_SIZE));
- }
-
- protected void performDefaults() {
- performDefaultsForFormattingGroup();
- performDefaultsForContentAssistGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- private void performDefaultsForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- fIdentUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
- fIdentLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
- fSelectorUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.UPPER);
- fSelectorLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER);
- fPropNameUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
- fPropNameLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
- fPropValueUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
- fPropValueLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.LOWER);
- }
-
- private void performDefaultsForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- fLineWidthText.setText(prefs.getDefaultString(CSSCorePreferenceNames.LINE_WIDTH));
- fPropertyPerLine.setSelection(prefs.getDefaultBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE));
- fNowrapAttr.setSelection(prefs.getDefaultBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
-
- if (CSSCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- } else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
- fIndentationSize.setSelection(getModelPreferences().getDefaultInt(CSSCorePreferenceNames.INDENTATION_SIZE));
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- protected void storeValues() {
- storeValuesForFormattingGroup();
- storeValuesForContentAssistGroup();
- }
-
- private void storeValuesForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- prefs.setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, (fIdentUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
- prefs.setValue(CSSCorePreferenceNames.CASE_SELECTOR, (fSelectorUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
- prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, (fPropNameUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
- prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, (fPropValueUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
- }
- private void storeValuesForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- prefs.setValue(CSSCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
- prefs.setValue(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, fPropertyPerLine.getSelection());
- prefs.setValue(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, fNowrapAttr.getSelection());
-
- if (fIndentUsingTabs.getSelection()) {
- getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
- } else {
- getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.SPACE);
- }
- getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
- }
-
- protected void validateValues() {
- boolean isError = false;
- String widthText = null;
-
- if (fLineWidthText != null) {
- try {
- widthText = fLineWidthText.getText();
- int formattingLineWidth = Integer.parseInt(widthText);
- if ((formattingLineWidth < WIDTH_VALIDATION_LOWER_LIMIT) || (formattingLineWidth > WIDTH_VALIDATION_UPPER_LIMIT)) {
- throw new NumberFormatException();
- }
- }
- catch (NumberFormatException nfexc) {
- setInvalidInputMessage(widthText);
- setValid(false);
- isError = true;
- }
- }
-
- if (!isError) {
- setErrorMessage(null);
- setValid(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java
deleted file mode 100644
index 3afc6880d1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java
+++ /dev/null
@@ -1,922 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.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.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.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.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-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.AbstractSyntaxColoringPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-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 CSSSyntaxColoringPage extends AbstractSyntaxColoringPage 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;
- private ISourceViewer fPreviewViewer;
-
- // 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);
- fBold.setEnabled(true);
- fItalic.setEnabled(true);
- fStrike.setEnabled(true);
- fUnderline.setEnabled(true);
- fForegroundLabel.setEnabled(true);
- fBackgroundLabel.setEnabled(true);
- fForegroundColorEditor.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.CSS_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, CSSUIMessages.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, "");
- Button enabler = createCheckbox(editingComposite, CSSUIMessages.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);
- fForegroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Foreground_Color_Selector_Button;
- }
- });
-
- 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);
- fBackgroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Background_Color_Selector_Button;
- }
- });
-
- fBold = createCheckbox(editControls, CSSUIMessages.SyntaxColoringPage_3);
- fBold.setEnabled(false);
- ((GridData) fBold.getLayoutData()).horizontalSpan = 2;
- fItalic = createCheckbox(editControls, CSSUIMessages.SyntaxColoringPage_4);
- fItalic.setEnabled(false);
- ((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
- fStrike = createCheckbox(editControls, CSSUIMessages.SyntaxColoringPage_5);
- fStrike.setEnabled(false);
- ((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
- fUnderline = createCheckbox(editControls, CSSUIMessages.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:"
- fPreviewViewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = fPreviewViewer.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"));
- fText.addKeyListener(getTextKeyListener());
- fText.addSelectionListener(getTextSelectionListener());
- fText.addMouseListener(getTextMouseListener());
- fText.addTraverseListener(getTraverseListener());
- setAccessible(fText, SSEUIMessages.Sample_text__UI_);
- fDocument = StructuredModelManager.getModelManager().createStructuredDocumentFor(ContentTypeIdForCSS.ContentTypeID_CSS);
- fDocument.set(getExampleText());
- initializeSourcePreviewColors(fPreviewViewer);
- fPreviewViewer.setDocument(fDocument);
-
- top.setWeights(new int[]{1, 1});
- editor.setWeights(new int[]{1, 1});
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.CSS_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;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSyntaxColoringPage#getSourcePreviewViewer()
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return fPreviewViewer;
- }
-
- 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 CSSUIPlugin.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 CSSUIMessages.PrefsLabel_ColorSample;
- }
-
- 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(IStyleConstantsCSS.NORMAL);
- styles.add(IStyleConstantsCSS.ATMARK_RULE);
- styles.add(IStyleConstantsCSS.SELECTOR);
- styles.add(IStyleConstantsCSS.UNIVERSAL);
- styles.add(IStyleConstantsCSS.COMBINATOR);
- styles.add(IStyleConstantsCSS.SELECTOR_CLASS);
- styles.add(IStyleConstantsCSS.ID);
- styles.add(IStyleConstantsCSS.PSEUDO);
- styles.add(IStyleConstantsCSS.ATTRIBUTE_DELIM);
- styles.add(IStyleConstantsCSS.ATTRIBUTE_NAME);
- styles.add(IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
- styles.add(IStyleConstantsCSS.ATTRIBUTE_VALUE);
- styles.add(IStyleConstantsCSS.MEDIA);
- styles.add(IStyleConstantsCSS.COMMENT);
- styles.add(IStyleConstantsCSS.PROPERTY_NAME);
- styles.add(IStyleConstantsCSS.PROPERTY_VALUE);
- styles.add(IStyleConstantsCSS.URI);
- styles.add(IStyleConstantsCSS.STRING);
- styles.add(IStyleConstantsCSS.COLON);
- styles.add(IStyleConstantsCSS.SEMI_COLON);
- styles.add(IStyleConstantsCSS.CURLY_BRACE);
- styles.add(IStyleConstantsCSS.ERROR);
- 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(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
- fContextToStyleMap.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
- fContextToStyleMap.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
- fContextToStyleMap.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
- fContextToStyleMap.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
- fContextToStyleMap.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
- fContextToStyleMap.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
- fContextToStyleMap.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.UNIVERSAL);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.PSEUDO);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR_CLASS);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.ID);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.COMBINATOR);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-
- /* Attribute selector */
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.ATTRIBUTE_DELIM);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.ATTRIBUTE_DELIM);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.ATTRIBUTE_NAME);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.ATTRIBUTE_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
- fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
- fContextToStyleMap.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.ERROR);
- }
-
- private void initStyleToDescriptionMap() {
- fStyleToDescriptionMap.put(IStyleConstantsCSS.NORMAL, CSSUIMessages.PrefsLabel_ColorNormal);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ATMARK_RULE, CSSUIMessages.PrefsLabel_ColorAtmarkRule);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.SELECTOR, CSSUIMessages.PrefsLabel_ColorSelector);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.COMBINATOR, CSSUIMessages.PrefsLabel_ColorCombinator);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.UNIVERSAL, CSSUIMessages.PrefsLabel_ColorUniversal);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ID, CSSUIMessages.PrefsLabel_ColorId);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.PSEUDO, CSSUIMessages.PrefsLabel_ColorPseudoClass);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.SELECTOR_CLASS, CSSUIMessages.PrefsLabel_ColorClass);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_DELIM, CSSUIMessages.PrefsLabel_ColorAttrDelimiter);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_NAME, CSSUIMessages.PrefsLabel_ColorAttrName);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_OPERATOR, CSSUIMessages.PrefsLabel_ColorAttrOperator);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_VALUE, CSSUIMessages.PrefsLabel_ColorAttrValue);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.MEDIA, CSSUIMessages.PrefsLabel_ColorMedia);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.COMMENT, CSSUIMessages.PrefsLabel_ColorComment);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.PROPERTY_NAME, CSSUIMessages.PrefsLabel_ColorPropertyName);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.PROPERTY_VALUE, CSSUIMessages.PrefsLabel_ColorPropertyValue);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.URI, CSSUIMessages.PrefsLabel_ColorUri);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.STRING, CSSUIMessages.PrefsLabel_ColorString);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.COLON, CSSUIMessages.PrefsLabel_ColorColon);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.SEMI_COLON, CSSUIMessages.PrefsLabel_ColorSemiColon);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.CURLY_BRACE, CSSUIMessages.PrefsLabel_ColorCurlyBrace);//$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsCSS.ERROR, CSSUIMessages.PrefsLabel_ColorError);//$NON-NLS-1$
- }
-
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- fText.redraw();
- }
-
- public boolean performOk() {
- getOverlayStore().propagate();
-
- CSSUIPlugin.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.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
deleted file mode 100644
index baf7fd66c3..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.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.wst.css.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.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.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-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 CSS templates
- */
-public class CSSTemplatePreferencePage extends TemplatePreferencePage {
-
- class CSSEditTemplateDialog extends EditTemplateDialog {
- public CSSEditTemplateDialog(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 StructuredTextViewerConfigurationCSS();
-
- 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 CSSTemplatePreferencePage() {
- CSSUIPlugin cssUIPlugin = CSSUIPlugin.getDefault();
-
- setPreferenceStore(cssUIPlugin.getPreferenceStore());
- setTemplateStore(cssUIPlugin.getTemplateStore());
- setContextTypeRegistry(cssUIPlugin.getTemplateContextRegistry());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- CSSUIPlugin.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.CSS_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 StructuredTextViewerConfigurationCSS();
-
- 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 = ContentTypeIdForCSS.ContentTypeID_CSS;
- viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- 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 CSSEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
- if (dialog.open() == Window.OK) {
- return dialog.getTemplate();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java
deleted file mode 100644
index 03037e0771..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.css.ui.internal.projection;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-
-/**
- * A folding strategy for CSS structured documents.
- * See AbstractStructuredFoldingStrategy for more details.
- */
-public class CSSFoldingStrategy extends AbstractStructuredFoldingStrategy {
-
- /**
- * Create an instance of the folding strategy.
- * Be sure to set the viewer and document after creation.
- */
- public CSSFoldingStrategy() {
- super();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
- Position newPos = null;
-
- //only want to fold regions with a valid range
- if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
- newPos = new CSSRuleFoldingPosition(indexedRegion);
- }
- return newPos;
- }
-
- /**
- * The same as the AbstractFoldingStrategy implementation except for the new position is
- * calculated on the given IndexRegion and not the annotations stored IndexedRegion because
- * of the way CSS regions are replaced when they are updated.
- *
- * (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy#updateAnnotations(java.util.Iterator, org.eclipse.wst.sse.core.internal.provisional.IndexedRegion, java.util.List, java.util.List)
- */
- protected void updateAnnotations(Iterator existingAnnotationsIter, IndexedRegion dirtyRegion,
- List modifications, List deletions) {
-
- while(existingAnnotationsIter.hasNext()) {
- Object obj = existingAnnotationsIter.next();
- if(obj instanceof FoldingAnnotation) {
- FoldingAnnotation annotation = (FoldingAnnotation)obj;
-
- //NOTE can not use the annotations stored region because the CSSStructuredDocument
- // replaces the old region with a new one when it is modified
- Position newPos = calcNewFoldPosition(annotation.getRegion());
- if(newPos != null) {
- Position oldPos = fProjectionAnnotationModel.getPosition(annotation);
- if(!newPos.equals(oldPos)) {
- oldPos.setOffset(newPos.offset);
- oldPos.setLength(newPos.length);
- modifications.add(annotation);
- }
- } else {
- deletions.add(annotation);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
- return (indexedRegion instanceof ICSSStyleRule);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java
deleted file mode 100644
index dfc0984437..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java
+++ /dev/null
@@ -1,61 +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.wst.css.ui.internal.projection;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition;
-import org.w3c.dom.css.CSSStyleRule;
-
-/**
- * An {@link AbstractStructuredFoldingPosition} used to cover CSS regions
- */
-public class CSSRuleFoldingPosition extends AbstractStructuredFoldingPosition {
-
- /**
- * the region that will be folded
- */
- private IndexedRegion fRegion;
-
- /**
- * Creates a folding position that covers {@link IndexedRegion}s
- * in a CSS document
- *
- * @param region the {@link IndexedRegion} that this folding position covers
- */
- public CSSRuleFoldingPosition(IndexedRegion region) {
- super(region.getStartOffset(), region.getLength());
- this.fRegion = region;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getStartOffset()
- */
- protected int getStartOffset() {
- int startOffset = fRegion.getStartOffset();
-
- //so that multi-line CSS selector text does not get folded
- if(this.fRegion instanceof CSSStyleRule) {
- CSSStyleRule rule = (CSSStyleRule)this.fRegion;
- startOffset += rule.getSelectorText().length();
- }
-
- return startOffset;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getEndOffset()
- */
- protected int getEndOffset() {
- return fRegion.getEndOffset();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
deleted file mode 100644
index 7bcb2fb64f..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCategory;
-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.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-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.ICSSStyleDeclItem;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * A IPropertySource implementation for a JFace viewer used to display
- * properties of CSS nodes.
- */
-public class CSSPropertySource implements IPropertySource, IPropertySourceExtension {
- protected ICSSNode fNode = null;
- // for performance...
- final static Class ADAPTER_KEY = IPropertySource.class;
- final boolean PERF_GETDESCRIPTORS = false;
- private long time0;
-
- public CSSPropertySource(ICSSNode target) {
- super();
- fNode = target;
- }
-
- protected IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
- // the displayName MUST be set
- IPropertyDescriptor descriptor = new CSSTextPropertyDescriptor(attributeName, attributeName, fNode);
- // IPropertyDescriptor descriptor = new
- // TextPropertyDescriptor(attributeName, attributeName);
- return descriptor;
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(CSSMMNode node, String category) {
- return createPropertyDescriptor(node.getName(), category);
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(String name, String category) {
- IPropertyDescriptor descriptor = null;
- if (name != null && 0 < name.length()) {
- name = name.toLowerCase();
- if (category == null) {
- category = CSSUIMessages.INFO_Not_Categorized_1; //$NON-NLS-1$
- }
- descriptor = new CSSTextPropertyDescriptor(name, name, fNode, category);
- // if (category == null) {
- // descriptor = new CSSTextPropertyDescriptor(name, name, fNode);
- // } else {
- // descriptor = new CSSTextPropertyDescriptor(name, name, fNode,
- // category);
- // }
- }
- return descriptor;
- }
-
- /**
- * Returns a value for this object that can be editted in a property
- * sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue() {
- return null;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return a vector containing all descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- time0 = System.currentTimeMillis();
-
- CSSMetaModel metamodel = CSSMetaModelFinder.getInstance().findMetaModelFor(fNode);
- Iterator iProperties = Collections.EMPTY_LIST.iterator();
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- case ICSSNode.STYLEDECLARATION_NODE :
- CSSMMNode mmParent = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
- if (mmParent != null) {
- iProperties = mmParent.getChildNodes();
- }
- break;
- case ICSSNode.STYLEDECLITEM_NODE :
- CSSMMNode mmNode = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
- if (mmNode != null) {
- iProperties = Collections.singletonList(mmNode).iterator();
- }
- break;
- default :
- break;
- }
-
- // setup categories
- Map categories = new HashMap();
- Iterator iCategories = metamodel.getCategories();
- while (iCategories.hasNext()) {
- CSSMMCategory category = (CSSMMCategory) iCategories.next();
- categories.put(category.getName(), category.getCaption());
- }
-
- // collect property names
- Set declaredProperties = new HashSet();
- if (iProperties.hasNext()) {
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- ICSSNodeList nodeList = ((ICSSNode) declaration).getChildNodes();
- int nProps = (nodeList != null) ? nodeList.getLength() : 0;
- for (int i = 0; i < nProps; i++) {
- ICSSNode node = nodeList.item(i);
- if (node instanceof ICSSStyleDeclItem) {
- String name = ((ICSSStyleDeclItem) node).getPropertyName();
- if (name != null && 0 < name.length()) {
- declaredProperties.add(name.toLowerCase());
- }
- }
- }
- }
- }
-
- List descriptors = new ArrayList();
-
- // first: properties from content model
- while (iProperties.hasNext()) {
- CSSMMNode node = (CSSMMNode) iProperties.next();
- if (node.getType() == CSSMMNode.TYPE_PROPERTY || node.getType() == CSSMMNode.TYPE_DESCRIPTOR) {
- String category = (String) categories.get(node.getAttribute("category")); //$NON-NLS-1$
- String name = node.getName().toLowerCase();
- if (declaredProperties.contains(name)) {
- declaredProperties.remove(name);
- }
- IPropertyDescriptor descriptor = createPropertyDescriptor(name, category);
- if (descriptor != null) {
- descriptors.add(descriptor);
- }
- }
- }
-
- // second: existing properties but not in content model
- Iterator iRemains = declaredProperties.iterator();
- while (iRemains.hasNext()) {
- IPropertyDescriptor descriptor = createPropertyDescriptor((String) iRemains.next(), null);
- if (descriptor != null) {
- descriptors.add(descriptor);
- }
- }
-
- IPropertyDescriptor[] resultArray = new IPropertyDescriptor[descriptors.size()];
- if (PERF_GETDESCRIPTORS) {
- System.out.println(getClass().getName() + ".getPropertyDescriptors: " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return (IPropertyDescriptor[]) descriptors.toArray(resultArray);
- }
-
- /**
- * Returns the current value for the named property.
- *
- * @param name
- * the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object getPropertyValue(Object name) {
- if (name == null) {
- return ""; //$NON-NLS-1$
- }
-
- String valueString = null;
- String nameString = name.toString();
-
- CSSStyleDeclaration declaration = null;
-
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLEDECLITEM_NODE :
- valueString = ((ICSSStyleDeclItem) fNode).getCSSValueText();
- break;
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- declaration = (CSSStyleDeclaration) fNode.getFirstChild();
- if (declaration != null) {
- valueString = declaration.getPropertyValue(nameString);
- }
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- valueString = ((CSSStyleDeclaration) fNode).getPropertyValue(nameString);
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- ICSSNode parent = fNode;
- while (parent != null && !(parent instanceof ICSSStyleDeclItem)) {
- parent = parent.getParentNode();
- }
- if (parent != null) {
- valueString = ((ICSSStyleDeclItem) parent).getCSSValueText();
- }
- break;
- default :
- break;
- }
-
- if (valueString == null) {
- valueString = ""; //$NON-NLS-1$
- }
-
- return valueString;
- }
-
- /**
- * Returns whether the property value has changed from the default.
- *
- * @return <code>true</code> if the value of the specified property has
- * changed from its original default value; <code>false</code>
- * otherwise.
- */
- public boolean isPropertySet(Object property) {
- if (property == null) {
- return false;
- }
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- String value = declaration.getPropertyValue(property.toString());
- if (value != null && 0 < value.length()) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Resets the specified property's value to its default value.
- *
- * @param property
- * the property to reset
- */
- public void resetPropertyValue(Object str) {
- if (str == null) {
- return;
- }
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- declaration.removeProperty(str.toString());
- }
- }
-
- /**
- * Sets the named property to the given value.
- *
- * @param name
- * the name of the property being set
- * @param value
- * the new value for the property
- */
- public void setPropertyValue(Object name, Object value) {
- if (name == null) {
- return;
- }
- String valueString = (value != null) ? value.toString() : null;
- String nameString = name.toString();
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- try {
- if (valueString == null || valueString.length() <= 0) {
- declaration.removeProperty(nameString);
- }
- else {
- String priority = declaration.getPropertyPriority(nameString);
- declaration.setProperty(nameString, valueString, (priority == null || priority.length() == 0) ? "" : " " + priority); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- catch (Exception e) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- String title = CSSUIMessages.Title_InvalidValue; //$NON-NLS-1$
- String message = CSSUIMessages.Message_InvalidValue; //$NON-NLS-1$
- MessageDialog.openWarning(window.getShell(), title, message);
- }
- }
- }
-
- private CSSStyleDeclaration getDeclarationNode() {
- CSSStyleDeclaration declaration = null;
-
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLEDECLITEM_NODE :
- declaration = (CSSStyleDeclaration) fNode.getParentNode();
- break;
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- declaration = (CSSStyleDeclaration) fNode.getFirstChild();
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- declaration = (CSSStyleDeclaration) fNode;
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- ICSSNode parent = fNode;
- while (parent != null && !(parent instanceof CSSStyleDeclaration)) {
- parent = parent.getParentNode();
- }
- if (parent != null) {
- declaration = (CSSStyleDeclaration) parent;
- }
- break;
- default :
- break;
- }
-
- return declaration;
- }
-
- // Bug 130039 - Implement IPropertySourceExtension
-
- public boolean isPropertyRemovable(Object name) {
- return true;
- }
-
- public void removeProperty(Object name) {
- if(name == null)
- return;
-
- CSSStyleDeclaration declaration = getDeclarationNode();
-
- if(declaration != null)
- declaration.removeProperty(name.toString());
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
deleted file mode 100644
index 77c27a98f8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
+++ /dev/null
@@ -1,112 +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.ui.internal.properties;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSPathService;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- */
-public class CSSTextPropertyDescriptor extends TextPropertyDescriptor {
- private final ICSSNode fNode;
-
- /**
- * CSSTextPropertyDescriptor constructor comment.
- *
- * @param id
- * java.lang.String
- * @param displayName
- * java.lang.String
- */
- public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node) {
- super(id, displayName);
- this.fNode = node;
- }
-
- public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node, String category) {
- super(id, displayName);
- this.fNode = node;
- setCategory(category);
- }
-
- /**
- * @return org.eclipse.jface.viewers.CellEditor
- * @param parent
- * org.eclipse.swt.widgets.Composite
- */
- public CellEditor createPropertyEditor(Composite parent) {
- ICSSModel model = fNode.getOwnerDocument().getModel();
- if (model == null)
- return null;
- if (model.getStyleSheetType() == ICSSModel.EXTERNAL && findEditor(model) == null)
- return null;
- // check whether IFile is readonly to prohibit editing before
- // validateEdit()
- IStructuredModel structuredModel = model;
- if (model.getStyleSheetType() != ICSSModel.EXTERNAL) {
- structuredModel = ((IDOMNode) model.getOwnerDOMNode()).getModel();
- if (structuredModel == null)
- return null;
- }
- IFile file = CSSPathService.location2File(structuredModel.getBaseLocation());
- if (file == null || file.isReadOnly())
- return null;
-
- return super.createPropertyEditor(parent);
- }
-
- private static IEditorPart findEditor(ICSSModel model) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- IWorkbenchPage[] pages = windows[i].getPages();
- for (int j = 0; j < pages.length; j++) {
- IEditorReference[] editors = pages[j].getEditorReferences();
- for (int k = 0; k < editors.length; k++) {
- IEditorPart editPart = editors[k].getEditor(false);
- if (editPart != null) {
- IEditorInput editorInput = editPart.getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) editorInput).getFile();
- if (file != null) {
- //TODO Urgent needs to be fixed
- // I think we need 'equals' (or 'equivalent'
- // on model) for cases like this
- if (StructuredModelManager.getModelManager().calculateId(file).equals(model.getId())) {
- return editPart;
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java
deleted file mode 100644
index 717dcb529a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.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.ui.internal.registry;
-
-import org.eclipse.wst.css.core.internal.modelhandler.ModelHandlerForCSS;
-import org.eclipse.wst.css.ui.internal.contentoutline.JFaceNodeAdapterFactoryCSS;
-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;
-
-public class AdapterFactoryProviderCSS implements AdapterFactoryProvider {
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForCSS);
- }
-
- public void addAdapterFactories(IStructuredModel structuredModel) {
- // add the normal content based factories to model's registry
- addContentBasedFactories(structuredModel);
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
- 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 JFaceNodeAdapterFactoryCSS(IJFaceNodeAdapter.class, true);
- factoryRegistry.addFactory(factory);
- }
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java
deleted file mode 100644
index fa1a72016d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects enclosing CSS element
- */
-public class StructuredSelectEnclosingCSSActionDelegate extends StructuredSelectActionDelegate {
- public void init(IAction action) {
- if (action != null) {
- action.setText(CSSUIMessages.StructureSelectEnclosing_label);
- action.setToolTipText(CSSUIMessages.StructureSelectEnclosing_tooltip);
- action.setDescription(CSSUIMessages.StructureSelectEnclosing_description);
- }
- }
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java
deleted file mode 100644
index de122ab198..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects next CSS element
- */
-public class StructuredSelectNextCSSActionDelegate extends StructuredSelectActionDelegate {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- int offset = textSelection.getOffset() + textSelection.getLength() - 1;
- if (offset < 0)
- offset = 0;
-
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, offset);
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
-
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getNextSibling();
- if (newNode == null) {
- newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(currentOffset, newIndexedRegion.getEndOffset() - currentOffset);
- }
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(CSSUIMessages.StructureSelectNext_label);
- action.setToolTipText(CSSUIMessages.StructureSelectNext_tooltip);
- action.setDescription(CSSUIMessages.StructureSelectNext_description);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java
deleted file mode 100644
index 78289a25f7..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects previous CSS element
- */
-public class StructuredSelectPreviousCSSActionDelegate extends StructuredSelectActionDelegate {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
- ICSSNode newNode = cursorNode.getPreviousSibling();
- if (newNode == null) {
- newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), currentEndOffset - newIndexedRegion.getStartOffset());
- }
- }
- }
- else
- newRegion = cursorNodeRegion;
- }
- return newRegion;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(CSSUIMessages.StructureSelectPrevious_label);
- action.setToolTipText(CSSUIMessages.StructureSelectPrevious_tooltip);
- action.setDescription(CSSUIMessages.StructureSelectPrevious_description);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
deleted file mode 100644
index 2287a63275..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
+++ /dev/null
@@ -1,40 +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.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsCSS {
- public static final String NORMAL = "NORMAL"; //$NON-NLS-1$
- public static final String ATMARK_RULE = "ATMARK_RULE"; //$NON-NLS-1$
- public static final String SELECTOR = "SELECTOR"; //$NON-NLS-1$
- public static final String UNIVERSAL = "UNIVERSAL"; //$NON-NLS-1$
- public static final String PSEUDO = "PSEUDO"; //$NON-NLS-1$
- public static final String SELECTOR_CLASS = "CLASS"; //$NON-NLS-1$
- public static final String ID = "ID"; //$NON-NLS-1$
- public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
- public static final String COMMENT = "COMMENT"; //$NON-NLS-1$
- public static final String PROPERTY_NAME = "PROPERTY_NAME"; //$NON-NLS-1$
- public static final String PROPERTY_VALUE = "PROPERTY_VALUE"; //$NON-NLS-1$
- public static final String URI = "URI"; //$NON-NLS-1$
- public static final String STRING = "STRING"; //$NON-NLS-1$
- public static final String COLON = "COLON"; //$NON-NLS-1$
- public static final String SEMI_COLON = "SEMI_COLON"; //$NON-NLS-1$
- public static final String CURLY_BRACE = "CURLY_BRACE"; //$NON-NLS-1$
- public static final String ATTRIBUTE_DELIM = "ATTRIBUTE_DELIM"; //$NON-NLS-1$
- public static final String ATTRIBUTE_NAME = "ATTRIBUTE_NAME"; //$NON-NLS-1$
- public static final String ATTRIBUTE_OPERATOR = "ATTRIBUTE_OPERATOR"; //$NON-NLS-1$
- public static final String ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
- public static final String COMBINATOR = "COMBINATOR"; //$NON-NLS-1$
- public static final String ERROR = "ERROR"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
deleted file mode 100644
index 8cffa99058..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
+++ /dev/null
@@ -1,228 +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.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-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;
-
-/**
- */
-public class LineStyleProviderForCSS extends AbstractLineStyleProvider implements LineStyleProvider {
- /** Contains region to style mapping */
- private Map fColorTypes;
-
- /**
- * LineStyleProviderForEmbeddedCSS constructor comment.
- */
- public LineStyleProviderForCSS() {
- super();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- if (region != null) {
- String type = region.getType();
- if (type != null) {
- return getAttributeFor(type);
- }
- }
- return (TextAttribute) getTextAttributes().get(IStyleConstantsCSS.NORMAL);
- }
-
- /**
- * Look up the TextAttribute for the given region context. Might return
- * null for unusual text.
- *
- * @param type
- * @return
- */
- protected TextAttribute getAttributeFor(String type) {
- return (TextAttribute) getTextAttributes().get(fColorTypes.get(type));
- }
-
- private void initAttributes() {
- if (fColorTypes == null) {
- fColorTypes = new HashMap();
- }
- fColorTypes.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
- fColorTypes.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
- fColorTypes.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
- fColorTypes.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
- fColorTypes.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
- fColorTypes.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
- fColorTypes.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
- fColorTypes.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
- fColorTypes.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.UNIVERSAL);
-
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.PSEUDO);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR_CLASS);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.ID);
-
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.COMBINATOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-
- /* Attribute selector */
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.ATTRIBUTE_DELIM);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.ATTRIBUTE_DELIM);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.ATTRIBUTE_NAME);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.ATTRIBUTE_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
-
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
- fColorTypes.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.NORMAL);
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsCSS.ATMARK_RULE.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATMARK_RULE;
- } else if (IStyleConstantsCSS.COLON.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.COLON;
- } else if (IStyleConstantsCSS.COMMENT.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.COMMENT;
- } else if (IStyleConstantsCSS.CURLY_BRACE.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.CURLY_BRACE;
- } else if (IStyleConstantsCSS.ERROR.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ERROR;
- } else if (IStyleConstantsCSS.MEDIA.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.MEDIA;
- } else if (IStyleConstantsCSS.NORMAL.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.NORMAL;
- } else if (IStyleConstantsCSS.ATTRIBUTE_DELIM.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATTRIBUTE_DELIM;
- } else if (IStyleConstantsCSS.ATTRIBUTE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATTRIBUTE_NAME;
- } else if (IStyleConstantsCSS.ATTRIBUTE_OPERATOR.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATTRIBUTE_OPERATOR;
- } else if (IStyleConstantsCSS.ATTRIBUTE_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATTRIBUTE_VALUE;
- } else if (IStyleConstantsCSS.COMBINATOR.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.COMBINATOR;
- } else if (IStyleConstantsCSS.PROPERTY_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.PROPERTY_NAME;
- } else if (IStyleConstantsCSS.PROPERTY_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.PROPERTY_VALUE;
- } else if (IStyleConstantsCSS.SELECTOR.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.SELECTOR;
- } else if (IStyleConstantsCSS.UNIVERSAL.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.UNIVERSAL;
- } else if (IStyleConstantsCSS.ID.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ID;
- } else if (IStyleConstantsCSS.PSEUDO.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.PSEUDO;
- } else if (IStyleConstantsCSS.SELECTOR_CLASS.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.SELECTOR_CLASS;
- } else if (IStyleConstantsCSS.SEMI_COLON.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.SEMI_COLON;
- } else if (IStyleConstantsCSS.STRING.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.STRING;
- } else if (IStyleConstantsCSS.URI.equals(prefKey)) {
- styleKey = IStyleConstantsCSS.URI;
- }
- } else {
- // this is around for old deprecated preferencesChanged() method
- // TODO remove when preferencesChanged() is removed
- loadColors();
- super.handlePropertyChange(event);
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- public void release() {
- if (fColorTypes != null) {
- fColorTypes.clear();
- fColorTypes = null;
- }
- super.release();
- }
-
- public void loadColors() {
- initAttributes();
-
- addTextAttribute(IStyleConstantsCSS.ATMARK_RULE);
- addTextAttribute(IStyleConstantsCSS.COLON);
- addTextAttribute(IStyleConstantsCSS.COMMENT);
- addTextAttribute(IStyleConstantsCSS.CURLY_BRACE);
- addTextAttribute(IStyleConstantsCSS.ERROR);
- addTextAttribute(IStyleConstantsCSS.MEDIA);
- addTextAttribute(IStyleConstantsCSS.NORMAL);
- addTextAttribute(IStyleConstantsCSS.PROPERTY_NAME);
- addTextAttribute(IStyleConstantsCSS.PROPERTY_VALUE);
- addTextAttribute(IStyleConstantsCSS.SELECTOR);
- addTextAttribute(IStyleConstantsCSS.UNIVERSAL);
- addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_DELIM);
- addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_NAME);
- addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
- addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_VALUE);
- addTextAttribute(IStyleConstantsCSS.COMBINATOR);
- addTextAttribute(IStyleConstantsCSS.ID);
- addTextAttribute(IStyleConstantsCSS.SELECTOR_CLASS);
- addTextAttribute(IStyleConstantsCSS.PSEUDO);
- addTextAttribute(IStyleConstantsCSS.SEMI_COLON);
- addTextAttribute(IStyleConstantsCSS.STRING);
- addTextAttribute(IStyleConstantsCSS.URI);
- }
-
- protected IPreferenceStore getColorPreferences() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
deleted file mode 100644
index 1428f6da35..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.style;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.ui.internal.Logger;
-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.regions.DOMRegionContext;
-
-public class LineStyleProviderForEmbeddedCSS extends LineStyleProviderForCSS {
-
- public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
- int regionStart = typedRegion.getOffset();
- int regionEnd = regionStart + typedRegion.getLength();
- IStructuredDocumentRegion wholeRegion = getDocument().getRegionAtCharacterOffset(regionStart);
-
- if (wholeRegion == null)
- return false;
-
- List tokens = null;
- int offset = typedRegion.getOffset();
-
- List cache = getCachedParsingResult(wholeRegion);
- if (cache == null) {
- try {
- String content = getDocument().get(typedRegion.getOffset(), typedRegion.getLength());
-
- //if region is an XML tag then in CSS style attribute, else in style tag
- int mode;
- if(wholeRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
- mode = CSSTextParser.MODE_DECLARATION;
- } else {
- mode = CSSTextParser.MODE_STYLESHEET;
- }
-
- CSSTextParser parser = new CSSTextParser(mode, content);
- tokens = parser.getTokenList();
- cacheParsingResult(wholeRegion, tokens);
- } catch (BadLocationException e) {
- Logger.logException("Given a bad ITypedRegion: " + typedRegion, e);
- }
- }
- else {
- tokens = cache;
- }
-
- boolean result = false;
-
- if (tokens != null && 0 < tokens.size()) {
- int start = offset;
- int end = start;
- Iterator i = tokens.iterator();
- while (i.hasNext()) {
- CSSTextToken token = (CSSTextToken) i.next();
- end = start + token.length;
- int styleLength = token.length;
- /* The token starts in the region */
- if (regionStart <= start && start < regionEnd) {
- /* [239415] The region may not span the total length of the token -
- * Adjust the length so that it doesn't overlap with other style ranges */
- if (regionEnd < end)
- styleLength = regionEnd - start;
- addStyleRange(holdResults, getAttributeFor(token.kind), start, styleLength);
- }
- /* The region starts in the token */
- else if (start <= regionStart && regionStart < end ) {
- /* The token may not span the total length of the region */
- if (end < regionEnd)
- styleLength = end - regionStart;
- else /* Bugzilla 282218 */
- styleLength = regionEnd - regionStart;
- addStyleRange(holdResults, getAttributeFor(token.kind), regionStart, styleLength);
- }
- start += token.length;
- }
- result = true;
- }
-
- return result;
- }
-
- private void addStyleRange(Collection holdResults, TextAttribute attribute, int start, int end) {
- if (attribute != null)
- holdResults.add(new StyleRange(start, end, attribute.getForeground(), attribute.getBackground(), attribute.getStyle()));
- else
- holdResults.add(new StyleRange(start, end, null, null));
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- return null;
- }
-
- private void cleanupCache() {
- fCacheKey = -1;
- fCacheResult = null;
- }
-
- private List getCachedParsingResult(IStructuredDocumentRegion region) {
- if (fCacheKey == region.getText().hashCode()) {
- return fCacheResult;
- }
- return null;
- }
-
- private void cacheParsingResult(IStructuredDocumentRegion region, List result) {
- fCacheKey = region.getText().hashCode();
- fCacheResult = result;
- }
-
- public void release() {
- super.release();
- cleanupCache();
- }
-
- int fCacheKey = -1;
- List fCacheResult = null;
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java
deleted file mode 100644
index 757da6ca70..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverCSS extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverCSS() {
- super(ENCODING_TYPE, CSSUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return CSSCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java
deleted file mode 100644
index 7e981c86ea..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for CSS template context types. Templates of this context type
- * apply to any place within CSS content type.
- */
-public class TemplateContextTypeCSS extends TemplateContextType {
-
- public TemplateContextTypeCSS() {
- 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 EncodingTemplateVariableResolverCSS());
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java
deleted file mode 100644
index d0a134f1d2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsCSS {
-
- public static final String ALL = "css_all"; //$NON-NLS-1$
-
- public static final String NEW = "css_new"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java
deleted file mode 100644
index 8b75c7eb4b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.css.ui.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.link.ILinkedModeListener;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
-import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
-
-public class CSSCharacterPairInserter extends AbstractCharacterPairInserter {
-
- public boolean hasPair(char c) {
- switch (c) {
- case '"':
- case '\'':
- case '[':
- case '(':
- case '{':
- return true;
- default:
- return false;
- }
- }
-
- protected char getPair(char c) {
- switch (c) {
- case '\'':
- case '"':
- return c;
- case '(':
- return ')';
- case '[':
- return ']';
- case '{':
- return '}';
- default:
- throw new IllegalArgumentException();
- }
- }
-
- class ExitPolicy implements IExitPolicy {
-
- private char fExit;
- private char fEscape;
- private IDocument fDocument;
-
- public ExitPolicy(char exit, char escape, IDocument document) {
- fExit = exit;
- fEscape = escape;
- fDocument = document;
- }
-
- public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
- if(!isMasked(offset)) {
- if (event.character == fExit)
- return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
- if (event.character == '\r' || event.character == '\n' && offset > 0) {
- try {
- if (fDocument.getChar(offset - 1) == '{') {
- return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
- }
- } catch (BadLocationException e) {
- }
- }
- }
- return null;
- }
-
- private boolean isMasked(int offset) {
- try {
- return fEscape == fDocument.getChar(offset - 1);
- } catch (BadLocationException e) {
- }
- return false;
- }
- }
-
- protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
- return new ExitPolicy(exit, escape, document);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java
deleted file mode 100644
index aa1037d1d3..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.css.ui.internal.text;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public class CSSDocumentRegionEdgeMatcher implements ICharacterPairMatcher {
-
- private int fAnchor = ICharacterPairMatcher.LEFT;
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public CSSDocumentRegionEdgeMatcher() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- return fAnchor;
- }
-
- public IRegion match(IDocument document, int offset) {
- short braceCount = 1;
- if (document instanceof IStructuredDocument) {
- IStructuredDocumentRegion r = ((IStructuredDocument) document).getRegionAtCharacterOffset(offset);
- if (r != null) {
- if (r.getPrevious() != null && r.getStartOffset() == offset && r.getPrevious().getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- r = r.getPrevious();
- }
- if (r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- while (r != null && (braceCount != 0)) {
- r = r.getPrevious();
- if (r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- braceCount++;
- }
- else if (r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
- braceCount--;
- }
- }
- if (r != null) {
- return new Region(r.getStartOffset(), 1);
- }
- } else if (r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
- while (r != null && (braceCount != 0)) {
- r = r.getNext();
- if (r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
- braceCount++;
- }
- else if (r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- braceCount--;
- }
- }
- if (r != null) {
- return new Region(r.getEndOffset() - 1, 1);
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java
deleted file mode 100644
index 636c6931aa..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java
+++ /dev/null
@@ -1,67 +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.wst.css.ui.internal.wizard;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * This class encapsulates any used Module Core and Facets APIs along with
- * fallbacks for use on non-compliant projects and when those services are not
- * available at runtime.
- *
- * Because ModuleCore API calls can result in locks needing to be acquired,
- * none of these methods should be called while other thread locks have
- * already been acquired.
- */
-final class FacetModuleCoreSupport {
- static final boolean _dump_NCDFE = false;
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- public static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- IPath path = null;
- try {
- path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return path;
- }
-
- /**
- * @param project
- * @return
- * @throws org.eclipse.core.runtime.CoreException
- */
- public static boolean isWebProject(IProject project) {
- if (project == null)
- return false;
-
- try {
- return FacetModuleCoreSupportDelegate.isWebProject(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return true;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
deleted file mode 100644
index 1af190f6a6..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
+++ /dev/null
@@ -1,84 +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 License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.wizard;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.css.ui.internal.Logger;
-
-/**
- * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
- * bundles are not available, this class will not load, or if it does, its
- * methods will cause NoClassDefFoundErrors. This allows us to
- * compartmentalize the dependencies.
- *
- */
-final class FacetModuleCoreSupportDelegate {
- /**
- * Copied to avoid unneeded extra dependency (plus it's unclear why the
- * value is in that plug-in).
- *
- * @see org.eclipse.wst.common.componentcore.internal.util.IModuleConstants.JST_WEB_MODULE
- */
- private final static String JST_WEB_MODULE = "jst.web"; //$NON-NLS-1$
-
- private final static String WST_WEB_MODULE = "wst.web"; //$NON-NLS-1$
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- static IPath getWebContentRootPath(IProject project) {
- if (!ModuleCoreNature.isFlexibleProject(project))
- return project.getFullPath();
-
- IPath path = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null && component.exists()) {
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
- else {
- path = project.getFullPath();
- }
- return path;
- }
-
- /**
- * @param project
- * @return
- * @throws CoreException
- */
- static boolean isWebProject(IProject project) {
- boolean is = false;
- try {
- IFacetedProject faceted = ProjectFacetsManager.create(project);
- if (ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(JST_WEB_MODULE);
- is = is || (faceted != null && faceted.hasProjectFacet(facet));
- }
- if (ProjectFacetsManager.isProjectFacetDefined(WST_WEB_MODULE)) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(WST_WEB_MODULE);
- is = is || (faceted != null && faceted.hasProjectFacet(facet));
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- return is;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSFileWizardPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSFileWizardPage.java
deleted file mode 100644
index 5596c3d200..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSFileWizardPage.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.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.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-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.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-
-class NewCSSFileWizardPage extends WizardNewFileCreationPage {
-
- private static final String defaultName = "NewFile"; //$NON-NLS-1$
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewCSSFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName, selection);
- }
-
- public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- setFileName(computeDefaultFileName());
- setPageComplete(validatePage());
- }
-
- protected String computeDefaultFileName() {
- int count = 0;
- String fileName = addDefaultExtension(defaultName);
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null) {
- while (true) {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path)) {
- count++;
- fileName = addDefaultExtension(defaultName + count);
- }
- else {
- break;
- }
- }
- }
- return fileName;
- }
- /**
- * 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
- * css 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(CSSUIMessages._ERROR_FILENAME_MUST_END_CSS, 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(CSSUIMessages.ResourceGroup_nameExists);
- return false;
- }
- }
-
- // get the IProject for the selection path
- IProject project = getProjectFromPath(fullPath);
- // if inside web project, check if inside webContent folder
- if (project != null && isWebProject(project)) {
- // check that the path is inside the webContent folder
- IPath webContentPath = getWebContentPath(project);
- if (!webContentPath.isPrefixOf(fullPath)) {
- setMessage(CSSUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
- }
- }
- }
-
- return true;
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType() {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
- return fContentType;
- }
-
- /**
- * Get list of valid extensions for CSS Content type
- *
- * @return
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /**
- * Verifies if fileName is valid name for content type. Takes base content
- * type into consideration.
- *
- * @param fileName
- * @return true if extension is valid for this content type
- */
- private boolean extensionValidForContentType(String fileName) {
- boolean valid = false;
-
- IContentType type = getContentType();
- // there is currently an extension
- if (fileName.lastIndexOf('.') != -1) {
- // check what content types are associated with current extension
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
- int i = 0;
- while (i < types.length && !valid) {
- valid = types[i].isKindOf(type);
- ++i;
- }
- }
- else
- valid = true; // no extension so valid
- return valid;
- }
-
- /**
- * Adds default extension to the filename
- *
- * @param filename
- * @return
- */
- String addDefaultExtension(String filename) {
- StringBuffer newFileName = new StringBuffer(filename);
-
- Preferences preference = CSSCorePlugin.getDefault().getPluginPreferences();
- String ext = preference.getString(CSSCorePreferenceNames.DEFAULT_EXTENSION);
-
- newFileName.append("."); //$NON-NLS-1$
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Returns the project that contains the specified path
- *
- * @param path the path which project is needed
- * @return IProject object. If path is <code>null</code> the return value
- * is also <code>null</code>.
- */
- private IProject getProjectFromPath(IPath path) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = null;
-
- if (path != null) {
- if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
- project = workspace.getRoot().getProject(path.toString());
- } else {
- project = workspace.getRoot().getFile(path).getProject();
- }
- }
-
- return project;
- }
-
- /**
- * Checks if the specified project is a web project.
- *
- * @param project project to be checked
- * @return true if the project is web project, otherwise false
- */
- private boolean isWebProject(IProject project) {
- return FacetModuleCoreSupport.isWebProject(project);
- }
-
- /**
- * 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) {
- return FacetModuleCoreSupport.getWebContentRootPath(project);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
deleted file mode 100644
index 220afa40dd..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.css.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.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.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.preferences.CSSUIPreferenceNames;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-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 NewCSSTemplatesWizardPage 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(TemplateContextTypeIdsCSS.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 NewCSSTemplatesWizardPage() {
- super("NewCSSTemplatesWizardPage", CSSUIMessages.NewCSSTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(CSSUIMessages.NewCSSTemplatesWizardPage_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 CSS Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(CSSUIMessages.NewCSSTemplatesWizardPage_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);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(CSSUIMessages.NewCSSTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // 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(CSSUIMessages.NewCSSTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(CSSUIMessages.NewCSSTemplatesWizardPage_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 = CSSUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(CSSUIMessages.NewCSSTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.CSS_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 StructuredTextViewerConfigurationCSS();
-
- 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);
- viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForCSS.ContentTypeID_CSS);
- 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(CSSUIMessages.NewCSSTemplatesWizardPage_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);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- 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.css.ui.preferences.templates"; //$NON-NLS-1$
- }
-
- /**
- * Get the currently selected template.
- *
- * @return
- */
- private Template getSelectedTemplate() {
- Template template = null;
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
-
- if (selection.size() == 1) {
- template = (Template) selection.getFirstElement();
- }
- return template;
- }
-
- /**
- * Returns template string to insert.
- *
- * @return String to insert or null if none is to be inserted
- */
- String getTemplateString() {
- String templateString = null;
-
- Template template = getSelectedTemplate();
- if (template != null) {
- TemplateContextType contextType = CSSUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsCSS.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 css", 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 CSS File wizard.
- */
- private void loadLastSavedPreferences() {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- boolean setSelection = false;
- String templateName = CSSUIPlugin.getDefault().getPreferenceStore().getString(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- templateName = CSSUIPlugin.getDefault().getPreferenceStore().getString(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
- if (templateName != null && templateName.length() > 0) {
- Template template = fTemplateStore.findTemplateById(templateName);
- if (template != null) {
- fLastSelectedTemplateName = template.getName();
- setSelection = true;
- }
- }
- }
- else {
- fLastSelectedTemplateName = templateName;
- setSelection = true;
- }
- fUseTemplateButton.setSelection(setSelection);
- enableTemplates();
- }
-
- /**
- * Save template name used for next call to New CSS File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- CSSUIPlugin.getDefault().getPreferenceStore().setValue(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- CSSUIPlugin.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, TemplateContextTypeIdsCSS.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
deleted file mode 100644
index 62b456d0c2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
+++ /dev/null
@@ -1,145 +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.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.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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class NewCSSWizard extends Wizard implements INewWizard {
- private NewCSSFileWizardPage fNewFilePage;
- private NewCSSTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- public void addPages() {
- fNewFilePage = new NewCSSFileWizardPage("CSSWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle(CSSUIMessages._UI_WIZARD_NEW_HEADING); //$NON-NLS-1$
- fNewFilePage.setDescription(CSSUIMessages._UI_WIZARD_NEW_DESCRIPTION); //$NON-NLS-1$
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewCSSTemplatesWizardPage();
- 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(CSSUIMessages._UI_WIZARD_NEW_TITLE); //$NON-NLS-1$
- ImageDescriptor descriptor = CSSImageHelper.getInstance().getImageDescriptor(CSSEditorPluginImages.IMG_WIZBAN_NEWCSSFILE);
- 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 = CSSCorePlugin.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 CSS file", e); //$NON-NLS-1$
- }
- }
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
deleted file mode 100644
index ee802ed53f..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.wst.css.ui.views.contentoutline;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-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.ICSSValue;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows CSS content.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class CSSContentOutlineConfiguration extends ContentOutlineConfiguration {
- private IContentProvider fContentProvider = null;
- private ILabelProvider fLabelProvider = null;
- private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.css.ui.OutlinePage"; //$NON-NLS-1$
-
-
- /**
- * Create new instance of CSSContentOutlineConfiguration
- */
- public CSSContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
- IContributionItem[] items = super.createToolbarContributions(viewer);
-
- SortAction sortAction = new SortAction(viewer, CSSUIPlugin.getDefault().getPreferenceStore(), OUTLINE_SORT_PREF);
- IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
-
- if (items == null) {
- items = new IContributionItem[1];
- items[0] = sortItem;
- }
- else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
- combinedItems[0] = sortItem;
- System.arraycopy(items, 0, combinedItems, 1, items.length);
- items = combinedItems;
- }
- return items;
- }
-
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null)
- fContentProvider = new JFaceNodeContentProviderCSS();
- return fContentProvider;
- }
-
- private Object getFilteredNode(Object o) {
- ICSSNode node = null;
- if (o instanceof ICSSNode) {
- node = (ICSSNode) o;
- short nodeType = node.getNodeType();
- if (node instanceof ICSSValue) {
- while (node != null && !(node instanceof ICSSStyleDeclItem)) {
- node = node.getParentNode();
- }
- }
- else if (nodeType == ICSSNode.STYLEDECLARATION_NODE) {
- node = node.getParentNode();
- }
- else if (nodeType == ICSSNode.MEDIALIST_NODE) {
- node = node.getParentNode();
- }
- }
- return node;
- }
-
- private Object[] getFilteredNodes(Object[] objects) {
- Object[] filtered = new Object[objects.length];
- for (int i = 0; i < filtered.length; i++) {
- filtered[i] = getFilteredNode(objects[i]);
- }
- return filtered;
- }
-
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null)
- fLabelProvider = new JFaceNodeLabelProviderCSS();
- return fLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.StructuredContentOutlineConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return CSSUIPlugin.getDefault().getPreferenceStore();
- }
-
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- ISelection filteredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
- filteredSelection = new StructuredSelection(filteredNodes);
- }
- return filteredSelection;
- }
-
- protected String getOutlineFilterTarget(){
- return OUTLINE_FILTER_PREF ;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java
deleted file mode 100644
index d7f0be7204..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java
+++ /dev/null
@@ -1,47 +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.wst.css.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-
-class CSSContentSelectionProvider implements IContentSelectionProvider {
-
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- ISelection filteredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
- filteredSelection = new StructuredSelection(filteredNodes);
- }
- return filteredSelection;
- }
-
- private Object[] getFilteredNodes(Object[] filteredNodes) {
- for (int i = 0; i < filteredNodes.length; i++) {
- filteredNodes[i] = getFilteredNode(filteredNodes[i]);
- }
- return filteredNodes;
- }
-
- private Object getFilteredNode(Object object) {
- // If the selection is a primitive value, get the property that contains it */
- if (object instanceof ICSSPrimitiveValue) {
- ICSSPrimitiveValue value = (ICSSPrimitiveValue) object;
- object = value.getParentNode();
- }
- return object;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java
deleted file mode 100644
index d226166bf9..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java
+++ /dev/null
@@ -1,41 +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.wst.css.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
-
-public class CSSQuickOutlineConfiguration extends AbstractQuickOutlineConfiguration {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getContentProvider()
- */
- public ITreeContentProvider getContentProvider() {
- return new JFaceNodeContentProviderCSS();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getContentSelectionProvider()
- */
- public IContentSelectionProvider getContentSelectionProvider() {
- return new CSSContentSelectionProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getLabelProvider()
- */
- public ILabelProvider getLabelProvider() {
- return new JFaceNodeLabelProviderCSS();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
deleted file mode 100644
index fdf353a891..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
+++ /dev/null
@@ -1,176 +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.ui.views.contentoutline;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-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.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-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.contentoutline.IJFaceNodeAdapterFactory;
-import org.w3c.dom.css.CSSRule;
-
-/**
- * A Content provider for a JFace viewer used to display CSS nodes. This
- * content provider does not use adapters.
- */
-class JFaceNodeContentProviderCSS implements ITreeContentProvider {
-
- public JFaceNodeContentProviderCSS() {
- super();
- }
-
- /**
- * @deprecated
- */
- protected void addElements(Object element, ArrayList v) {
-
- ICSSNode node;
-
- if (element instanceof ICSSModel) {
- ICSSModel model = (ICSSModel) element;
- ICSSDocument doc = model.getDocument();
- node = doc.getFirstChild();
- }
- else if (element instanceof ICSSNode) {
- node = ((ICSSNode) element).getFirstChild();
- }
- else
- return;
-
- while (node != null) {
- if (node instanceof CSSRule) {
- v.add(node);
- }
-
- node = node.getNextSibling();
- }
-
- }
-
- /**
- * The visual part that is using this content provider is about to be
- * disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- }
-
- /**
- * Returns an enumeration containing all child nodes of the given element,
- * which represents a node in a tree. The difference to
- * <code>IStructuredContentProvider.getElements(Object)</code> is as
- * follows: <code>getElements</code> is called to obtain the tree
- * viewer's root elements. Method <code>getChildren</code> is used to
- * obtain the children of a given node in the tree, which can can be a
- * root node, too.
- */
- public Object[] getChildren(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
- if (adapter != null)
- return adapter.getChildren(object);
-
- return new Object[0];
- }
-
- /**
- * Returns an enumeration with the elements belonging to the passed
- * element. These elements can be presented as rows in a table, items in a
- * list etc.
- */
- public Object[] getElements(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
- if (adapter != null)
- return adapter.getElements(object);
-
- return new Object[0];
- }
-
- /**
- * Returns the parent for the given element. This method can return
- * <code>null</code> indicating that the parent can't be computed. In
- * this case the tree viewer can't expand a given node correctly if
- * requested.
- */
- public Object getParent(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
- if (adapter != null)
- return adapter.getParent(object);
-
- return null;
- }
-
- /**
- * Returns <code>true</code> if the given element has children.
- * Otherwise <code>false</code> is returned.
- */
- public boolean hasChildren(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
- if (adapter != null)
- return adapter.hasChildren(object);
-
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (oldInput != null && oldInput instanceof IStructuredModel) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) oldInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.removeListener(viewer);
- }
- }
- if (newInput != null && newInput instanceof IStructuredModel) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) newInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.addListener(viewer);
- }
- }
- }
-
- /**
- * Checks whether the given element is deleted or not.
- *
- * @deprecated
- */
- public boolean isDeleted(Object element) {
- return false;
- }
-
- /**
- * Returns the JFace adapter for the specified object.
- *
- * @param adaptable
- * java.lang.Object The object to get the adapter for
- */
- private IJFaceNodeAdapter getAdapter(Object adaptable) {
- IJFaceNodeAdapter adapter = null;
- if (adaptable instanceof ICSSModel) {
- adaptable = ((ICSSModel) adaptable).getDocument();
- }
- if (adaptable instanceof ICSSNode && adaptable instanceof INodeNotifier) {
- INodeAdapter nodeAdapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
- if (nodeAdapter instanceof IJFaceNodeAdapter)
- adapter = (IJFaceNodeAdapter) nodeAdapter;
- }
- return adapter;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
deleted file mode 100644
index 964de2fabf..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
+++ /dev/null
@@ -1,115 +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.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-
-class JFaceNodeLabelProviderCSS extends LabelProvider {
-
- /**
- * JFaceNodeLabelProvider constructor comment.
- */
- public JFaceNodeLabelProviderCSS() {
- super();
- }
-
- /**
- * Returns the JFace adapter for the specified object.
- *
- * @param adaptable
- * java.lang.Object The object to get the adapter for
- */
- private IJFaceNodeAdapter getAdapter(Object adaptable) {
- IJFaceNodeAdapter adapter = null;
- if (adaptable instanceof ICSSModel) {
- adaptable = ((ICSSModel) adaptable).getDocument();
- }
- if (adaptable instanceof INodeNotifier) {
- INodeAdapter nodeAdapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
- if (nodeAdapter instanceof IJFaceNodeAdapter)
- adapter = (IJFaceNodeAdapter) nodeAdapter;
- }
- return adapter;
- }
-
- /**
- * Returns the image for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label image. Element
- * can be <code>null</code> indicating no input object is set
- * to the viewer.
- */
- public Image getImage(Object element) {
- Image image = null;
- IJFaceNodeAdapter adapter = getAdapter(element);
- if (adapter != null)
- image = adapter.getLabelImage(element);
- return image;
- }
-
- /**
- * Returns the text for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label text. Element can
- * be <code>null</code> indicating no input object is set to
- * the viewer.
- */
- public String getText(Object element) {
- String text = null;
- IJFaceNodeAdapter adapter = getAdapter(element);
- if (adapter != null) {
- text = adapter.getLabelText(element);
- }
- return text;
- }
-
- /**
- * Checks whether this label provider is affected by the given domain
- * event.
- *
- * @deprecated
- */
- public boolean isAffected(Object dummy) {// DomainEvent event) {
- // return event.isModifier(DomainEvent.NON_STRUCTURE_CHANGE);
- return true;
-
- }
-
- /**
- * Returns whether the label would be affected by a change to the given
- * property of the given element. This can be used to optimize a
- * non-structural viewer update. If the property mentioned in the update
- * does not affect the label, then the viewer need not update the label.
- *
- * @param element
- * the element
- * @param property
- * the property
- * @return <code>true</code> if the label would be affected, and
- * <code>false</code> if it would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index 370dbff1da..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,55 +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.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-/*
- * Based on DTDContentOutlinePage#SortAction
- */
-class SortAction extends PropertyChangeUpdateAction {
- private TreeViewer treeViewer;
-
- public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
- super(CSSUIMessages.SortAction_0, store, preferenceKey, false); //$NON-NLS-1$
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSUIPlugin.ID, CSSEditorPluginImages.IMG_OBJ_SORT);
- setImageDescriptor(desc);
- setToolTipText(getText());
- treeViewer = viewer;
- if (isChecked()) {
- treeViewer.setComparator(new ViewerComparator());
- }
- }
-
- public void update() {
- super.update();
- treeViewer.getControl().setRedraw(false);
- Object[] expandedElements = treeViewer.getExpandedElements();
- if (isChecked()) {
- treeViewer.setComparator(new ViewerComparator());
- }
- else {
- treeViewer.setComparator(null);
- }
- treeViewer.setInput(treeViewer.getInput());
- treeViewer.setExpandedElements(expandedElements);
- treeViewer.getControl().setRedraw(true);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
deleted file mode 100644
index b8c1fa4c05..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
+++ /dev/null
@@ -1,193 +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.ui.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.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.css.ui.internal.properties.CSSPropertySource;
-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;
-
-/**
- * Configuration for property sheet page which shows CSS content.
- *
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- * @since 1.0
- */
-public class CSSPropertySheetConfiguration 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 CSSPropertySource(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 CSSPropertySheetConfiguration() {
- // 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;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties b/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties
deleted file mode 100644
index bf282ec7ab..0000000000
--- a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-Templates.newcss.name=New CSS File
-Templates.newcss.desc=new css file
diff --git a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml b/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml
deleted file mode 100644
index e6e0f0dd80..0000000000
--- a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * 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
- *******************************************************************************/
- -->
-<templates>
-<template name="%Templates.newcss.name" description="%Templates.newcss.desc" id="org.eclipse.wst.css.ui.internal.templates.newcss" context="css_new" enabled="true">@CHARSET "${encoding}";</template>
-</templates>
diff --git a/bundles/org.eclipse.wst.dtd.core/.classpath b/bundles/org.eclipse.wst.dtd.core/.classpath
deleted file mode 100644
index 9355ebac3a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="contentmodel/"/>
- <classpathentry kind="src" path="emfmodel/"/>
- <classpathentry kind="src" path="saxparser/"/>
- <classpathentry kind="src" path="src-validation"/>
- <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"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.dtd.core/.cvsignore b/bundles/org.eclipse.wst.dtd.core/.cvsignore
deleted file mode 100644
index 06a13979a3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-runtime
-dtdcore.jar
-*.zip
-build.xml
-temp.folder
-@dot
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.dtd.core/.project b/bundles/org.eclipse.wst.dtd.core/.project
deleted file mode 100644
index 76249e5f71..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtd.core</name>
- <comment></comment>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.dtd.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.dtd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7bf9b39137..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:16:32 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=ignore
-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.wst.dtd.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 6c80926d79..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Nov 15 02:08:45 EST 2006
-eclipse.preferences.version=1
-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.dtd.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.dtd.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 26198819ab..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Wed Nov 15 02:08:45 EST 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=1
-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.dtd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
deleted file mode 100644
index a8b1c0706d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,42 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtd.core; singleton:=true
-Bundle-Version: 1.1.501.qualifier
-Bundle-Activator: org.eclipse.wst.dtd.core.internal.DTDCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.dtd.core.internal;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.content;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.contentmodel;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf.impl;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.emf.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.encoding;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.event;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.preferences;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.contenttype;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.provisional.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.saxparser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.tokenizer;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.validation;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.dtd.core.internal.validation.eclipse;x-internal:=true,
- org.eclipse.wst.dtd.core.text
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)"
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.dtd.core.internal.content"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.dtd.core/about.html b/bundles/org.eclipse.wst.dtd.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.dtd.core/build.properties b/bundles/org.eclipse.wst.dtd.core/build.properties
deleted file mode 100644
index af332a6105..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/build.properties
+++ /dev/null
@@ -1,27 +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
-#
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = component.xml
-source.. = src/,\
- contentmodel/,\
- emfmodel/,\
- saxparser/,\
- src-validation/
diff --git a/bundles/org.eclipse.wst.dtd.core/component.xml b/bundles/org.eclipse.wst.dtd.core/component.xml
deleted file mode 100644
index e4dc12c306..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/component.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.dtd">
- <component-depends unrestricted="true" />
- <plugin id="org.eclipse.wst.dtdeditor.doc.user" fragment="false" />
- <plugin id="org.eclipse.wst.dtd.core" fragment="false" />
- <plugin id="org.eclipse.wst.dtd.ui" fragment="false" />
- <description url="http://eclipse.org/webtools/wst/components/dtd/overview.html" />
- <package name="org.eclipse.wst.dtd.ui" api="false">
- <type name="StructuredTextViewerConfigurationDTD" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.dtd.ui.views.contentoutline" api="false">
- <type name="DTDContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.dtd.ui.infopop" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java
deleted file mode 100644
index bfe64b3b10..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.contentmodel;
-
-import org.eclipse.wst.dtd.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-
-/**
- * This builder handles building .dtd grammar files
- */
-public class CMDocumentFactoryDTD implements CMDocumentFactory {
- public CMDocumentFactoryDTD() {
- }
-
-
- public CMDocument createCMDocument(String uri) {
- // work around a bug in our parsers
- // todo... revisit this
- //
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
-// String fileProtocol = "file:"; //$NON-NLS-1$
-// if (uri.startsWith(fileProtocol)) {
-// uri = uri.substring(fileProtocol.length());
-// }
-
- CMDocument result = null;
- try {
- result = DTDImpl.buildCMDocument(uri);
- }
- catch (Exception e) {
- Logger.logException("could not create content model for URI: " + uri, e); //$NON-NLS-1$
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java
deleted file mode 100644
index 1be7c53e9a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java
+++ /dev/null
@@ -1,36 +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.dtd.core.internal.contentmodel;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public abstract class CMNodeImpl extends AdapterImpl implements CMNode {
- protected static final String PROPERTY_DOCUMENTATION = "documentation"; //$NON-NLS-1$
- protected static final String PROPERTY_DOCUMENTATION_SOURCE = "documentationSource"; //$NON-NLS-1$
- protected static final String PROPERTY_DOCUMENTATION_LANGUAGE = "documentationLanguage"; //$NON-NLS-1$
- protected static final String PROPERTY_MOF_NOTIFIER = "key"; //$NON-NLS-1$
- protected static final String PROPERTY_DEFINITION_INFO = "http://org.eclipse.wst/cm/properties/definitionInfo"; //$NON-NLS-1$
- protected static final String PROPERTY_DEFINITION = "http://org.eclipse.wst/cm/properties/definition"; //$NON-NLS-1$
-
- public abstract Object getKey();
-
- public boolean supports(String propertyName) {
- return propertyName.equals(PROPERTY_MOF_NOTIFIER);
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public void setProperty(String propertyName, Object object) {
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
deleted file mode 100644
index 94705acd0f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
+++ /dev/null
@@ -1,782 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.dtd.core.internal.contentmodel;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDBasicTypeImpl;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDMetrics;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDUtil;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDataTypeImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMEntityDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-
-
-public class DTDImpl {
- static {
- // Call init on the DTD package to avoid strange initialization bugs
- //
- DTDPackageImpl.init();
- }
-
- protected static DTDAdapterFactoryImpl dtdAdapterFactoryImpl = new DTDAdapterFactoryImpl();
- protected static CMDataTypeInfoTable cmDataTypeInfoTable = new CMDataTypeInfoTable();
-
- public static CMDocument buildCMDocument(String uri) {
- DTDFile dtdFile = buildDTDModel(uri);
- CMDocument cmDocument = (CMDocument) getAdapter(dtdFile);
-
- return cmDocument;
- }
-
- public static DTDFile buildDTDModel(String uri) {
- DTDUtil dtdUtil = new DTDUtil();
- dtdUtil.setexpandEntityReferences(true);
- dtdUtil.parse(new ResourceSetImpl(), uri);
- return dtdUtil.getDTDFile();
- }
-
- public static CMDocument buildCMDocument(DTDFile dtdFile) {
- return (CMDocument) getAdapter(dtdFile);
- }
-
- public static CMNode getAdapter(Notifier o) {
- return (CMNode) dtdAdapterFactoryImpl.adapt(o);
- }
-
- public static int getMinOccurHelper(DTDRepeatableContent content) {
- int occurence = content.getOccurrence().getValue();
- boolean isOptional = (occurence == DTDOccurrenceType.OPTIONAL || occurence == DTDOccurrenceType.ZERO_OR_MORE);
- return isOptional ? 0 : 1;
- }
-
- public static int getMaxOccurHelper(DTDRepeatableContent content) {
- int occurence = content.getOccurrence().getValue();
- boolean isMulti = (occurence == DTDOccurrenceType.ONE_OR_MORE || occurence == DTDOccurrenceType.ZERO_OR_MORE);
- return isMulti ? -1 : 1;
- }
-
- public static class DTDAdapterFactoryImpl extends AdapterFactoryImpl {
- public Adapter createAdapter(Notifier target) {
- Adapter result = null;
- if (target != null) {
- if (target instanceof DTDAttribute) {
- result = new DTDAttributeAdapter((DTDAttribute) target);
- }
- else if (target instanceof DTDElement) {
- result = new DTDElementAdapter((DTDElement) target);
- }
- else if (target instanceof DTDElementReferenceContent) {
- result = new DTDElementReferenceContentAdapter((DTDElementReferenceContent) target);
- }
- else if (target instanceof DTDFile) {
- result = new DTDFileAdapter((DTDFile) target);
- }
- else if (target instanceof DTDGroupContent) {
- result = new DTDGroupContentAdapter((DTDGroupContent) target);
- }
- else if (target instanceof DTDEntity) {
- result = new DTDEntityAdapter((DTDEntity) target);
- }
- }
- return result;
- }
-
- public synchronized Adapter adapt(Notifier target) {
- return adapt(target, this);
- }
- }
-
- /**
- * DTDBaseAdapter
- */
- public static abstract class DTDBaseAdapter extends CMNodeImpl {
- public String getNodeName() {
- return ""; //$NON-NLS-1$
- }
-
- public boolean isAdapterForType(Object type) {
- return type == dtdAdapterFactoryImpl;
- }
-
- public Object getProperty(String propertyName) {
- Object result = null;
- if (propertyName.equals("CMDocument")) { //$NON-NLS-1$
- result = getCMDocument();
- }
- else if (propertyName.equals(PROPERTY_DOCUMENTATION)) {
- result = getDocumentation();
- }
- else if (propertyName.equals(PROPERTY_DEFINITION_INFO)) {
- result = getDefinitionInfo();
- }
- else if (propertyName.equals(PROPERTY_DEFINITION)) {
- result = getDefinition();
- }
- else if (propertyName.equals(PROPERTY_MOF_NOTIFIER)) {
- result = getKey();
- }
- else if (propertyName.equals("spec")) { //$NON-NLS-1$
- result = getSpec();
- }
- else {
- result = super.getProperty(propertyName);
- if (result == null) {
- CMDocument cmDocument = getCMDocument();
- if (cmDocument instanceof DTDFileAdapter) {
- AnnotationMap map = ((DTDFileAdapter) cmDocument).annotationMap;
- if (map != null) {
- String spec = getSpec();
- if (spec != null) {
- result = map.getProperty(getSpec(), propertyName);
- }
- }
- if (result == null) {
- Map globalPropertyMap = ((DTDFileAdapter) cmDocument).globalPropertyMap;
- result = globalPropertyMap.get(propertyName);
- }
- }
- }
- }
- return result;
- }
-
- public CMDocument getCMDocument() {
- return null;
- }
-
- protected CMNodeList getDocumentation() {
- return new CMNodeListImpl();
- }
-
- public String getDefinitionInfo() {
- return null;
- }
-
- public CMNode getDefinition() {
- return null;
- }
-
- public String getSpec() {
- return getNodeName();
- }
- }
-
- /**
- * DTDAttributeAdapter
- */
- public static class DTDAttributeAdapter extends DTDBaseAdapter implements CMAttributeDeclaration {
- protected DTDAttribute attribute;
- protected CMDataType dataType;
-
- public DTDAttributeAdapter(DTDAttribute attribute) {
- this.attribute = attribute;
- dataType = new DataTypeImpl();
- }
-
- public Object getKey() {
- return attribute;
- }
-
- public String getSpec() {
- return attribute.getDTDElement().getName() + "/@" + attribute.getName(); //$NON-NLS-1$
- }
-
- public int getNodeType() {
- return ATTRIBUTE_DECLARATION;
- }
-
- public String getNodeName() {
- return attribute.getName();
- }
-
- public String getAttrName() {
- return attribute.getName();
- }
-
- public CMDataType getAttrType() {
- return dataType;
- }
-
- public String getDefaultValue() {
- return attribute.getDefaultValueString();
- }
-
- public Enumeration getEnumAttr() {
- return Collections.enumeration(attribute.getEnumeratedValues());
- }
-
- public int getUsage() {
- int usage = OPTIONAL;
- switch (attribute.getDefaultKind().getValue()) {
- case DTDDefaultKind.REQUIRED : {
- usage = REQUIRED;
- break;
- }
- case DTDDefaultKind.FIXED : {
- usage = FIXED;
- break;
- }
- }
- return usage;
- }
-
- public CMDocument getCMDocument() {
- DTDFile dtdFile = attribute.getDTDElement().getDTDFile();
- return dtdFile != null ? (CMDocument) getAdapter(dtdFile) : null;
- }
-
- public class DataTypeImpl implements CMDataType {
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- public String getNodeName() {
- return getDataTypeName();
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
-
- public Object getProperty(String propertyName) {
- Object result = null;
- if (propertyName.equals("isValidEmptyValue")) { //$NON-NLS-1$
- String dataTypeName = getDataTypeName();
- result = (dataTypeName == null || dataTypeName.equals(CMDataType.CDATA)) ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return result;
- }
-
- public String getDataTypeName() {
- return cmDataTypeInfoTable.getDataTypeName(attribute.getDTDType());
- }
-
- public String generateInstanceValue() {
- return cmDataTypeInfoTable.getInstanceValue(attribute.getDTDType());
- }
-
- public int getImpliedValueKind() {
- int result = IMPLIED_VALUE_NONE;
- int defaultValueKind = attribute.getDefaultKind().getValue();
- if (defaultValueKind == DTDDefaultKind.NOFIXED) {
- result = IMPLIED_VALUE_DEFAULT;
- }
- else if (defaultValueKind == DTDDefaultKind.FIXED) {
- result = IMPLIED_VALUE_FIXED;
- }
- return result;
- }
-
- public String getImpliedValue() {
- return attribute.getDefaultValueString();
- }
-
- public String[] getEnumeratedValues() {
- Object[] objectList = attribute.getEnumeratedValues().toArray();
- String[] result = new String[objectList.length];
- for (int i = 0; i < objectList.length; i++) {
- result[i] = objectList[i].toString();
- }
- return result;
- }
- }
- }
-
-
- /**
- * DTDElementBaseAdapter
- */
- public static abstract class DTDElementBaseAdapter extends DTDBaseAdapter implements CMElementDeclaration {
- protected CMDataType dataType;
-
- protected abstract DTDElement getDTDElement();
-
- protected CMDocumentation documentation = null;
-
- public int getNodeType() {
- return ELEMENT_DECLARATION;
- }
-
- public String getNodeName() {
- return getDTDElement().getName();
- }
-
- public CMNamedNodeMap getAttributes() {
- CMNamedNodeMapImpl result = new CMNamedNodeMapImpl();
- List attributeList = getDTDElement().getDTDAttribute();
- for (Iterator i = attributeList.iterator(); i.hasNext();) {
- DTDAttribute attribute = (DTDAttribute) i.next();
- result.getHashtable().put(attribute.getName(), getAdapter(attribute));
- }
- return result;
- }
-
- public CMContent getContent() {
- return (CMContent) getAdapter(getDTDElement().getContent());
- }
-
- public int getContentType() {
- // todo
- int result = ELEMENT;
- DTDElementContent dtdElementContent = getDTDElement().getContent();
- if (dtdElementContent instanceof DTDPCDataContent) {
- result = PCDATA;
- }
- else if (dtdElementContent instanceof DTDGroupContent) {
- DTDGroupContent groupContent = (DTDGroupContent) dtdElementContent;
- int groupKind = groupContent.getGroupKind().getValue();
- if (groupKind == DTDGroupKind.CHOICE) {
- List list = groupContent.getContent();
- if (list.size() > 0 && list.get(0) instanceof DTDPCDataContent) {
- result = MIXED;
- }
- }
- }
- else if (dtdElementContent instanceof DTDAnyContent) {
- result = ANY;
- }
- else if (dtdElementContent instanceof DTDEmptyContent) {
- result = EMPTY;
- }
-
- return result;
- }
-
- public String getElementName() {
- return getDTDElement().getName();
- }
-
- public CMDataType getDataType() {
- int contentType = getContentType();
- boolean hasDataType = contentType == PCDATA || contentType == MIXED;
- return hasDataType ? dataType : null;
- }
-
- public CMNamedNodeMap getLocalElements() {
- return CMNamedNodeMapImpl.EMPTY_NAMED_NODE_MAP;
- }
-
- public CMDocument getCMDocument() {
- DTDFile dtdFile = getDTDElement().getDTDFile();
- return dtdFile != null ? (CMDocument) getAdapter(dtdFile) : null;
- }
-
- protected CMNodeList getDocumentation() {
- CMNodeListImpl nodeList = new CMNodeListImpl();
- if (documentation == null) {
- String comment = getDTDElement().getComment();
- if (comment != null) {
- String value = ""; //$NON-NLS-1$
- StringTokenizer st = new StringTokenizer(comment, "\n"); //$NON-NLS-1$
- while (st.hasMoreTokens()) {
- value += st.nextToken().trim() + "\n"; //$NON-NLS-1$
- }
- documentation = new CMDocumentationImpl(value);
- }
- }
- if (documentation != null) {
- nodeList.getList().add(documentation);
- }
- return nodeList;
- }
- }
-
-
- public static class CMDocumentationImpl implements CMDocumentation {
- protected String value;
-
- public CMDocumentationImpl(String value) {
- this.value = value;
- }
-
- public String getNodeName() {
- return ""; //$NON-NLS-1$
- }
-
- public int getNodeType() {
- return DOCUMENTATION;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public String getValue() {
- return value;
- }
-
- public String getLanguage() {
- return null;
- }
-
- public String getSource() {
- return null;
- }
- }
-
-
- /**
- * DTDElementAdapter
- */
- public static class DTDElementAdapter extends DTDElementBaseAdapter {
- protected DTDElement element;
-
- public DTDElementAdapter(DTDElement element) {
- this.element = element;
- dataType = new CMDataTypeImpl("#PCDATA", getDTDElement().getName()); //$NON-NLS-1$
- }
-
- public Object getKey() {
- return element;
- }
-
- protected DTDElement getDTDElement() {
- return element;
- }
-
- public int getMinOccur() {
- if(element.getContent() instanceof DTDRepeatableContent){
- return getMinOccurHelper((DTDRepeatableContent) element.getContent());
- }
- return 1;
- }
-
- public int getMaxOccur() {
- if(element.getContent() instanceof DTDRepeatableContent){
- return getMaxOccurHelper((DTDRepeatableContent) element.getContent());
- }
- return 1;
- }
-
- public String getDefinitionInfo() {
- return "global"; //$NON-NLS-1$
- }
-
- public CMNode getDefinition() {
- return this;
- }
- }
-
-
- /**
- * DTDElementReferenceContentAdapter
- */
- public static class DTDElementReferenceContentAdapter extends DTDElementBaseAdapter {
- protected DTDElementReferenceContent content;
-
- public DTDElementReferenceContentAdapter(DTDElementReferenceContent content) {
- this.content = content;
- dataType = new CMDataTypeImpl("#PCDATA", getDTDElement().getName()); //$NON-NLS-1$
- }
-
- public Object getKey() {
- return content;
- }
-
- protected DTDElement getDTDElement() {
- return content.getReferencedElement();
- }
-
- public int getMinOccur() {
- return getMinOccurHelper(content);
- }
-
- public int getMaxOccur() {
- return getMaxOccurHelper(content);
- }
-
-
- public CMNode getDefinition() {
- return getAdapter(getDTDElement());
- }
- }
-
-
- /**
- * DTDEntityAdapter
- */
- public static class DTDEntityAdapter extends DTDBaseAdapter implements CMEntityDeclaration {
- protected DTDEntity dtdEntity;
-
- public DTDEntityAdapter(DTDEntity dtdEntity) {
- this.dtdEntity = dtdEntity;
- }
-
- public int getNodeType() {
- return ENTITY_DECLARATION;
- }
-
- public Object getKey() {
- return dtdEntity;
- }
-
- public String getName() {
- return dtdEntity.getName();
- }
-
- public String getValue() {
- String value = ""; //$NON-NLS-1$
- if (dtdEntity.getContent() instanceof DTDInternalEntity) {
- DTDInternalEntity content = (DTDInternalEntity) dtdEntity.getContent();
- value = content.getValue();
- }
- return value;
- }
- }
-
-
- /**
- * DTDGroupContentAdapter
- */
- public static class DTDGroupContentAdapter extends DTDBaseAdapter implements CMGroup {
- protected DTDGroupContent content;
-
- public DTDGroupContentAdapter(DTDGroupContent content) {
- this.content = content;
- }
-
- public Object getKey() {
- return content;
- }
-
- public int getNodeType() {
- return GROUP;
- }
-
- public String getNodeName() {
- CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
- return descriptionBuilder.buildDescription(this);
- }
-
- public CMNodeList getChildNodes() {
- List list = content.getContent();
- CMNodeListImpl result = new CMNodeListImpl();
- for (Iterator i = list.iterator(); i.hasNext();) {
- CMNode node = getAdapter((Notifier) i.next());
- if (node != null) {
- result.getList().add(node);
- }
- }
- return result;
- }
-
-
- public int getMaxOccur() {
- return getMaxOccurHelper(content);
- }
-
- public int getMinOccur() {
- return getMinOccurHelper(content);
- }
-
- public int getOperator() {
- // todo... handle ALONE case by checkig if child count == 1
- int groupKind = content.getGroupKind().getValue();
- return (groupKind == DTDGroupKind.CHOICE) ? CHOICE : SEQUENCE;
- }
- }
-
- /**
- * DTDFileAdapter
- */
- public static class DTDFileAdapter extends DTDBaseAdapter implements CMDocument {
- protected final String DEFAULT_ROOT_NAME = "http://org.eclipse.wst/cm/properties/defaultRootName"; //$NON-NLS-1$
-
- protected DTDFile dtdFile;
- protected CMNamedNodeMapImpl namedNodeMap;
- protected CMNamedNodeMapImpl entityNodeMap;
-
- protected AnnotationMap annotationMap = new AnnotationMap();
- protected Map globalPropertyMap = new HashMap();
-
- public DTDFileAdapter(DTDFile dtdFile) {
- this.dtdFile = dtdFile;
- }
-
- public Object getKey() {
- return dtdFile;
- }
-
- public AnnotationMap getAnnotationMap() {
- return annotationMap;
- }
-
- public CMNamedNodeMap getElements() {
- if (namedNodeMap == null) {
- namedNodeMap = new CMNamedNodeMapImpl();
- for (Iterator iterator = dtdFile.listDTDElement().iterator(); iterator.hasNext();) {
- DTDElement dtdElement = (DTDElement) iterator.next();
- namedNodeMap.getHashtable().put(dtdElement.getName(), getAdapter(dtdElement));
- }
- }
- return namedNodeMap;
- }
-
- public CMNamedNodeMap getEntities() {
- if (entityNodeMap == null) {
- entityNodeMap = new CMNamedNodeMapImpl();
-
- // add the built in entity declarations
- //
- entityNodeMap.getHashtable().put("amp", new CMEntityDeclarationImpl("amp", "&")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- entityNodeMap.getHashtable().put("lt", new CMEntityDeclarationImpl("lt", "<")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- entityNodeMap.getHashtable().put("gt", new CMEntityDeclarationImpl("gt", ">")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- entityNodeMap.getHashtable().put("quot", new CMEntityDeclarationImpl("quot", "\"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- entityNodeMap.getHashtable().put("apos", new CMEntityDeclarationImpl("apos", "'")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- for (Iterator i = dtdFile.listDTDEntity().iterator(); i.hasNext();) {
- DTDEntity dtdEntity = (DTDEntity) i.next();
- if (!dtdEntity.isParameterEntity() && dtdEntity.getName() != null) {
- // for now... just handle DTDInternalEntity
- //
- if (dtdEntity.getContent() instanceof DTDInternalEntity) {
- entityNodeMap.getHashtable().put(dtdEntity.getName(), getAdapter(dtdEntity));
- }
- }
- }
- }
- return entityNodeMap;
- }
-
- public CMNamespace getNamespace() {
- return null;
- }
-
- public int getNodeType() {
- return DOCUMENT;
- }
-
- public String getNodeName() {
- return dtdFile.getName() + ".dtd"; //$NON-NLS-1$
- }
-
- public Object getProperty(String propertyName) {
- Object result = null;
- if (propertyName.equals(DEFAULT_ROOT_NAME)) {
- DTDMetrics metrics = new DTDMetrics(dtdFile);
- DTDElement dtdElement = metrics.getLeastReferencedElement();
- if (dtdElement != null) {
- result = dtdElement.getName();
- }
- }
- else if (propertyName.equals("annotationMap")) { //$NON-NLS-1$
- result = annotationMap;
- }
- else if (propertyName.equals("globalPropertyMap")) { //$NON-NLS-1$
- result = globalPropertyMap;
- }
- else {
- result = super.getProperty(propertyName);
- }
- return result;
- }
- }
-
-
- public static class CMDataTypeInfoTable {
- protected String[] instanceValueTable;
- protected String[] dataTypeNameTable;
-
- public CMDataTypeInfoTable() {
- // hashtable.put(DTDType.CDATA, null));
- instanceValueTable = new String[DTDBasicTypeImpl.basicTypeKinds.length];
- instanceValueTable[DTDBasicTypeKind.ENTITY] = "entity"; //$NON-NLS-1$
- instanceValueTable[DTDBasicTypeKind.ENTITIES] = "entities"; //$NON-NLS-1$
- instanceValueTable[DTDBasicTypeKind.NMTOKEN] = "nmtoken"; //$NON-NLS-1$
- instanceValueTable[DTDBasicTypeKind.NMTOKENS] = "nmtokens"; //$NON-NLS-1$
-
- dataTypeNameTable = new String[DTDBasicTypeImpl.basicTypeKinds.length];
- dataTypeNameTable[DTDBasicTypeKind.CDATA] = CMDataType.CDATA;
- dataTypeNameTable[DTDBasicTypeKind.ID] = CMDataType.ID;
- dataTypeNameTable[DTDBasicTypeKind.IDREF] = CMDataType.IDREF;
- dataTypeNameTable[DTDBasicTypeKind.IDREFS] = CMDataType.IDREFS;
- dataTypeNameTable[DTDBasicTypeKind.ENTITY] = CMDataType.ENTITY;
- dataTypeNameTable[DTDBasicTypeKind.ENTITIES] = CMDataType.ENTITIES;
- dataTypeNameTable[DTDBasicTypeKind.NMTOKEN] = CMDataType.NMTOKEN;
- dataTypeNameTable[DTDBasicTypeKind.NMTOKENS] = CMDataType.NMTOKENS;
- }
-
- public String getInstanceValue(DTDType dtdType) {
- String result = null;
- if (dtdType instanceof DTDBasicType) {
- int kind = ((DTDBasicType) dtdType).getKind().getValue();
- if (kind >= 0 && kind < DTDBasicTypeImpl.basicTypeDescriptions.length) {
- result = instanceValueTable[kind];
- }
- }
- return result;
- }
-
- public String getDataTypeName(DTDType dtdType) {
- String result = null;
- if (dtdType instanceof DTDBasicType) {
- int kind = ((DTDBasicType) dtdType).getKind().getValue();
- if (kind >= 0 && kind < DTDBasicTypeImpl.basicTypeDescriptions.length) {
- result = dataTypeNameTable[kind];
- }
- }
- else if (dtdType instanceof DTDEnumerationType) {
- result = CMDataType.ENUM;
- }
- return result;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java
deleted file mode 100644
index 5e13bf8ca9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java
+++ /dev/null
@@ -1,26 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Any Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAnyContent()
- * @model
- * @generated
- */
-public interface DTDAnyContent extends DTDElementContent {
-} // DTDAnyContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java
deleted file mode 100644
index ba9841f51b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java
+++ /dev/null
@@ -1,240 +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.dtd.core.internal.emf;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EAttribute;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Attribute</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute()
- * @model
- * @generated
- */
-public interface DTDAttribute extends EAttribute, DTDObject, DTDSourceOffset {
- // NON-GEN interfaces DTDObject, DTDSourceOffset
-
- public DTDType getDTDType();
-
- public void setDTDType(DTDType type);
-
- public void setDTDBasicType(int value);
-
- public DTDEnumerationType createDTDEnumeration(String[] enumValues, int enumKind);
-
- public Collection getEnumeratedValues();
-
- public String unparse();
-
- /**
- * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Comment</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Comment</em>' attribute.
- * @see #setComment(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_Comment()
- * @model
- * @generated
- */
- String getComment();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Comment</em>' attribute.
- * @see #getComment()
- * @generated
- */
- void setComment(String value);
-
- /**
- * Returns the value of the '<em><b>Default Kind</b></em>' attribute.
- * The literals are from the enumeration
- * {@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind}. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Kind</em>' attribute isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Default Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
- * @see #setDefaultKind(DTDDefaultKind)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DefaultKind()
- * @model
- * @generated
- */
- DTDDefaultKind getDefaultKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Default Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
- * @see #getDefaultKind()
- * @generated
- */
- void setDefaultKind(DTDDefaultKind value);
-
- /**
- * Returns the value of the '<em><b>Default Value String</b></em>'
- * attribute. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Value String</em>' attribute
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Default Value String</em>' attribute.
- * @see #setDefaultValueString(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DefaultValueString()
- * @model
- * @generated
- */
- String getDefaultValueString();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Default Value String</em>'
- * attribute.
- * @see #getDefaultValueString()
- * @generated
- */
- void setDefaultValueString(String value);
-
- /**
- * Returns the value of the '<em><b>Attribute Name Referenced Entity</b></em>'
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Name Referenced Entity</em>'
- * reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Attribute Name Referenced Entity</em>'
- * reference.
- * @see #setAttributeNameReferencedEntity(DTDEntity)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_AttributeNameReferencedEntity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference
- * @model opposite="attributeNameReference"
- * @generated
- */
- DTDEntity getAttributeNameReferencedEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Attribute Name Referenced Entity</em>'
- * reference.
- * @see #getAttributeNameReferencedEntity()
- * @generated
- */
- void setAttributeNameReferencedEntity(DTDEntity value);
-
- /**
- * Returns the value of the '<em><b>Attribute Type Referenced Entity</b></em>'
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type Referenced Entity</em>'
- * reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Attribute Type Referenced Entity</em>'
- * reference.
- * @see #setAttributeTypeReferencedEntity(DTDEntity)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_AttributeTypeReferencedEntity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference
- * @model opposite="attributeTypeReference"
- * @generated
- */
- DTDEntity getAttributeTypeReferencedEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Attribute Type Referenced Entity</em>'
- * reference.
- * @see #getAttributeTypeReferencedEntity()
- * @generated
- */
- void setAttributeTypeReferencedEntity(DTDEntity value);
-
- /**
- * Returns the value of the '<em><b>DTD Element</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD Element</em>' container reference
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD Element</em>' container
- * reference.
- * @see #setDTDElement(DTDElement)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DTDElement()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute
- * @model opposite="DTDAttribute"
- * @generated
- */
- DTDElement getDTDElement();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>DTD Element</em>' container
- * reference.
- * @see #getDTDElement()
- * @generated
- */
- void setDTDElement(DTDElement value);
-
-} // DTDAttribute
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java
deleted file mode 100644
index e0032804a0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java
+++ /dev/null
@@ -1,66 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Basic Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicType()
- * @model
- * @generated
- */
-public interface DTDBasicType extends EClass, DTDType {
- // NON-GEN interfaces DTDType
-
- public String getTypeDescription();
-
- /**
- * Returns the value of the '<em><b>Kind</b></em>' attribute. The
- * literals are from the enumeration
- * {@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind}. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Kind</em>' attribute isn't clear, there
- * really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
- * @see #setKind(DTDBasicTypeKind)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicType_Kind()
- * @model
- * @generated
- */
- DTDBasicTypeKind getKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
- * @see #getKind()
- * @generated
- */
- void setKind(DTDBasicTypeKind value);
-} // DTDBasicType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java
deleted file mode 100644
index c8fe9cd769..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java
+++ /dev/null
@@ -1,332 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Basic Type Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicTypeKind()
- * @model
- * @generated
- */
-public final class DTDBasicTypeKind extends AbstractEnumerator {
- /**
- * The '<em><b>NONE</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #NONE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE = 0;
-
- /**
- * The '<em><b>CDATA</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #CDATA_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int CDATA = 1;
-
- /**
- * The '<em><b>ID</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #ID_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ID = 2;
-
- /**
- * The '<em><b>IDREF</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #IDREF_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int IDREF = 3;
-
- /**
- * The '<em><b>IDREFS</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #IDREFS_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int IDREFS = 4;
-
- /**
- * The '<em><b>ENTITY</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #ENTITY_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ENTITY = 5;
-
- /**
- * The '<em><b>ENTITIES</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #ENTITIES_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ENTITIES = 6;
-
- /**
- * The '<em><b>NMTOKEN</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #NMTOKEN_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NMTOKEN = 7;
-
- /**
- * The '<em><b>NMTOKENS</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #NMTOKENS_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NMTOKENS = 8;
-
- /**
- * The '<em><b>NONE</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NONE
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind NONE_LITERAL = new DTDBasicTypeKind(NONE, "NONE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>CDATA</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>CDATA</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #CDATA
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind CDATA_LITERAL = new DTDBasicTypeKind(CDATA, "CDATA"); //$NON-NLS-1$
-
- /**
- * The '<em><b>ID</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ID</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ID
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind ID_LITERAL = new DTDBasicTypeKind(ID, "ID"); //$NON-NLS-1$
-
- /**
- * The '<em><b>IDREF</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>IDREF</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #IDREF
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind IDREF_LITERAL = new DTDBasicTypeKind(IDREF, "IDREF"); //$NON-NLS-1$
-
- /**
- * The '<em><b>IDREFS</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>IDREFS</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #IDREFS
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind IDREFS_LITERAL = new DTDBasicTypeKind(IDREFS, "IDREFS"); //$NON-NLS-1$
-
- /**
- * The '<em><b>ENTITY</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>ENTITY</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ENTITY
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind ENTITY_LITERAL = new DTDBasicTypeKind(ENTITY, "ENTITY"); //$NON-NLS-1$
-
- /**
- * The '<em><b>ENTITIES</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>ENTITIES</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ENTITIES
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind ENTITIES_LITERAL = new DTDBasicTypeKind(ENTITIES, "ENTITIES"); //$NON-NLS-1$
-
- /**
- * The '<em><b>NMTOKEN</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>NMTOKEN</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NMTOKEN
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind NMTOKEN_LITERAL = new DTDBasicTypeKind(NMTOKEN, "NMTOKEN"); //$NON-NLS-1$
-
- /**
- * The '<em><b>NMTOKENS</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>NMTOKENS</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NMTOKENS
- * @generated
- * @ordered
- */
- public static final DTDBasicTypeKind NMTOKENS_LITERAL = new DTDBasicTypeKind(NMTOKENS, "NMTOKENS"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>Basic Type Kind</b></em>' enumerators.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final DTDBasicTypeKind[] VALUES_ARRAY = new DTDBasicTypeKind[]{NONE_LITERAL, CDATA_LITERAL, ID_LITERAL, IDREF_LITERAL, IDREFS_LITERAL, ENTITY_LITERAL, ENTITIES_LITERAL, NMTOKEN_LITERAL, NMTOKENS_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>Basic Type Kind</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Basic Type Kind</b></em>' literal with the
- * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDBasicTypeKind get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- DTDBasicTypeKind result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Basic Type Kind</b></em>' literal with the
- * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDBasicTypeKind get(int value) {
- switch (value) {
- case NONE :
- return NONE_LITERAL;
- case CDATA :
- return CDATA_LITERAL;
- case ID :
- return ID_LITERAL;
- case IDREF :
- return IDREF_LITERAL;
- case IDREFS :
- return IDREFS_LITERAL;
- case ENTITY :
- return ENTITY_LITERAL;
- case ENTITIES :
- return ENTITIES_LITERAL;
- case NMTOKEN :
- return NMTOKEN_LITERAL;
- case NMTOKENS :
- return NMTOKENS_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private DTDBasicTypeKind(int value, String name) {
- super(value, name);
- }
-
-} // DTDBasicTypeKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java
deleted file mode 100644
index ef3fb79e3d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java
+++ /dev/null
@@ -1,21 +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.dtd.core.internal.emf;
-
-public class DTDConstants {
- public static String DTD_ERROR_LINE_PREFIX = "<!--ERROR "; //$NON-NLS-1$
- public static String DTD_ERROR_LINE_SUFFIX = " -->"; //$NON-NLS-1$
- public static final String DTD_EXTENSION = "dtd"; //$NON-NLS-1$
- public static final String XML_EXTENSION = "xml"; //$NON-NLS-1$
- public static final String XMI_EXTENSION = "xmi"; //$NON-NLS-1$
- public static final String DTD_XMI_EXTENSION = "dtd.xmi"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java
deleted file mode 100644
index f0667581ed..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java
+++ /dev/null
@@ -1,63 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDContent extends EObject {
- /**
- * Returns the value of the '<em><b>DTD File</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD File</em>' container reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD File</em>' container reference.
- * @see #setDTDFile(DTDFile)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDContent_DTDFile()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent
- * @model opposite="DTDContent"
- * @generated
- */
- DTDFile getDTDFile();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>DTD File</em>' container
- * reference.
- * @see #getDTDFile()
- * @generated
- */
- void setDTDFile(DTDFile value);
-
-} // DTDContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java
deleted file mode 100644
index 9e57c5a37f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java
+++ /dev/null
@@ -1,194 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Default Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDDefaultKind()
- * @model
- * @generated
- */
-public final class DTDDefaultKind extends AbstractEnumerator {
- /**
- * The '<em><b>IMPLIED</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #IMPLIED_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int IMPLIED = 1;
-
- /**
- * The '<em><b>REQUIRED</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #REQUIRED_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int REQUIRED = 2;
-
- /**
- * The '<em><b>FIXED</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #FIXED_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int FIXED = 3;
-
- /**
- * The '<em><b>NOFIXED</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #NOFIXED_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NOFIXED = 4;
-
- /**
- * The '<em><b>IMPLIED</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>IMPLIED</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #IMPLIED
- * @generated
- * @ordered
- */
- public static final DTDDefaultKind IMPLIED_LITERAL = new DTDDefaultKind(IMPLIED, "IMPLIED"); //$NON-NLS-1$
-
- /**
- * The '<em><b>REQUIRED</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>REQUIRED</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #REQUIRED
- * @generated
- * @ordered
- */
- public static final DTDDefaultKind REQUIRED_LITERAL = new DTDDefaultKind(REQUIRED, "REQUIRED"); //$NON-NLS-1$
-
- /**
- * The '<em><b>FIXED</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>FIXED</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #FIXED
- * @generated
- * @ordered
- */
- public static final DTDDefaultKind FIXED_LITERAL = new DTDDefaultKind(FIXED, "FIXED"); //$NON-NLS-1$
-
- /**
- * The '<em><b>NOFIXED</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>NOFIXED</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NOFIXED
- * @generated
- * @ordered
- */
- public static final DTDDefaultKind NOFIXED_LITERAL = new DTDDefaultKind(NOFIXED, "NOFIXED"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>Default Kind</b></em>' enumerators.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final DTDDefaultKind[] VALUES_ARRAY = new DTDDefaultKind[]{IMPLIED_LITERAL, REQUIRED_LITERAL, FIXED_LITERAL, NOFIXED_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>Default Kind</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Default Kind</b></em>' literal with the
- * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDDefaultKind get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- DTDDefaultKind result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Default Kind</b></em>' literal with the
- * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDDefaultKind get(int value) {
- switch (value) {
- case IMPLIED :
- return IMPLIED_LITERAL;
- case REQUIRED :
- return REQUIRED_LITERAL;
- case FIXED :
- return FIXED_LITERAL;
- case NOFIXED :
- return NOFIXED_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private DTDDefaultKind(int value, String name) {
- super(value, name);
- }
-
-} // DTDDefaultKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java
deleted file mode 100644
index d81097cca5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java
+++ /dev/null
@@ -1,126 +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.dtd.core.internal.emf;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement()
- * @model
- * @generated
- */
-public interface DTDElement extends EClass, DTDContent, DTDObject, DTDSourceOffset {
-
- public void addDTDAttribute(DTDAttribute attribute);
-
- // returns all references in the same DTDFile that reference this element
- public Collection getReferences();
-
- // return a brief string listing the attributes
- public String getAttributeDetail();
-
- /**
- * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Comment</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Comment</em>' attribute.
- * @see #setComment(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_Comment()
- * @model
- * @generated
- */
- String getComment();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Comment</em>' attribute.
- * @see #getComment()
- * @generated
- */
- void setComment(String value);
-
- /**
- * Returns the value of the '<em><b>Content</b></em>' containment
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Content</em>' containment reference
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Content</em>' containment reference.
- * @see #setContent(DTDElementContent)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_Content()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement
- * @model opposite="element" containment="true" required="true"
- * @generated
- */
- DTDElementContent getContent();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'
- * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Content</em>' containment
- * reference.
- * @see #getContent()
- * @generated
- */
- void setContent(DTDElementContent value);
-
- /**
- * Returns the value of the '<em><b>DTD Attribute</b></em>'
- * containment reference list. The list contents are of type
- * {@link DTDAttribute}. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD Attribute</em>' containment
- * reference list isn't clear, there really should be more of a
- * description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD Attribute</em>' containment
- * reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_DTDAttribute()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement
- * @model type="DTDAttribute" opposite="DTDElement" containment="true"
- * @generated
- */
- EList getDTDAttribute();
-
-} // DTDElement
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java
deleted file mode 100644
index 1736ab2316..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java
+++ /dev/null
@@ -1,112 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDElementContent extends EObject, DTDObject, DTDSourceOffset {
-
- // for showing names to be used in the tree
- public String getContentName();
-
- // for showing items in the table
- public String getContentDetail();
-
- public DTDElement getDTDElement();
-
- // get the most outer DTDGroupContent
- public DTDGroupContent getDTDGroupContent();
-
- // returns true if this element content is the first
- // in the element
- // eg <!ELEMENT blah firstElement>
- // <!ELEMENT blah ((firstElement, secondElement) | lastElement)
- public boolean isFirstElementContent();
-
- /**
- * Returns the value of the '<em><b>Group</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Group</em>' container reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Group</em>' container reference.
- * @see #setGroup(DTDGroupContent)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent_Group()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent
- * @model opposite="content"
- * @generated
- */
- DTDGroupContent getGroup();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Group</em>' container
- * reference.
- * @see #getGroup()
- * @generated
- */
- void setGroup(DTDGroupContent value);
-
- /**
- * Returns the value of the '<em><b>Element</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Element</em>' container reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Element</em>' container reference.
- * @see #setElement(DTDElement)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent_Element()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent
- * @model opposite="content"
- * @generated
- */
- DTDElement getElement();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Element</em>' container
- * reference.
- * @see #getElement()
- * @generated
- */
- void setElement(DTDElement value);
-
-} // DTDElementContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java
deleted file mode 100644
index 44e1bbe51b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java
+++ /dev/null
@@ -1,59 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element Reference Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementReferenceContent()
- * @model
- * @generated
- */
-public interface DTDElementReferenceContent extends DTDRepeatableContent {
- /**
- * Returns the value of the '<em><b>Referenced Element</b></em>'
- * reference. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Element</em>' reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Referenced Element</em>' reference.
- * @see #setReferencedElement(DTDElement)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementReferenceContent_ReferencedElement()
- * @model required="true"
- * @generated
- */
- DTDElement getReferencedElement();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Referenced Element</em>'
- * reference.
- * @see #getReferencedElement()
- * @generated
- */
- void setReferencedElement(DTDElement value);
-
-} // DTDElementReferenceContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java
deleted file mode 100644
index 5626827cf4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java
+++ /dev/null
@@ -1,26 +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.dtd.core.internal.emf;
-
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Empty Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEmptyContent()
- * @model
- * @generated
- */
-public interface DTDEmptyContent extends DTDElementContent {
-} // DTDEmptyContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java
deleted file mode 100644
index bd4b4547f5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java
+++ /dev/null
@@ -1,220 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity()
- * @model
- * @generated
- */
-public interface DTDEntity extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
- /**
- * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Comment</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Comment</em>' attribute.
- * @see #setComment(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_Comment()
- * @model
- * @generated
- */
- String getComment();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Comment</em>' attribute.
- * @see #getComment()
- * @generated
- */
- void setComment(String value);
-
- /**
- * Returns the value of the '<em><b>Parameter Entity</b></em>'
- * attribute. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parameter Entity</em>' attribute isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Parameter Entity</em>' attribute.
- * @see #setParameterEntity(boolean)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_ParameterEntity()
- * @model
- * @generated
- */
- boolean isParameterEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Parameter Entity</em>'
- * attribute.
- * @see #isParameterEntity()
- * @generated
- */
- void setParameterEntity(boolean value);
-
- /**
- * Returns the value of the '<em><b>Content</b></em>' containment
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Content</em>' containment reference
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Content</em>' containment reference.
- * @see #setContent(DTDEntityContent)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_Content()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity
- * @model opposite="DTDEntity" containment="true" required="true"
- * @generated
- */
- DTDEntityContent getContent();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'
- * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Content</em>' containment
- * reference.
- * @see #getContent()
- * @generated
- */
- void setContent(DTDEntityContent value);
-
- /**
- * Returns the value of the '<em><b>Parm Entity Ref</b></em>'
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parm Entity Ref</em>' reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Parm Entity Ref</em>' reference.
- * @see #setParmEntityRef(DTDParameterEntityReference)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_ParmEntityRef()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity
- * @model opposite="entity" required="true"
- * @generated
- */
- DTDParameterEntityReference getParmEntityRef();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Parm Entity Ref</em>'
- * reference.
- * @see #getParmEntityRef()
- * @generated
- */
- void setParmEntityRef(DTDParameterEntityReference value);
-
- /**
- * Returns the value of the '<em><b>Entity Reference</b></em>'
- * reference list. The list contents are of type
- * {@link DTDEntityReferenceContent}. It is bidirectional and its
- * opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Reference</em>' reference list
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Entity Reference</em>' reference
- * list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_EntityReference()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity
- * @model type="DTDEntityReferenceContent"
- * opposite="elementReferencedEntity"
- * @generated
- */
- EList getEntityReference();
-
- /**
- * Returns the value of the '<em><b>Attribute Name Reference</b></em>'
- * reference list. The list contents are of type {@link DTDAttribute}. It
- * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Name Reference</em>' reference
- * list isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Attribute Name Reference</em>'
- * reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_AttributeNameReference()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity
- * @model type="DTDAttribute" opposite="attributeNameReferencedEntity"
- * @generated
- */
- EList getAttributeNameReference();
-
- /**
- * Returns the value of the '<em><b>Attribute Type Reference</b></em>'
- * reference list. The list contents are of type {@link DTDAttribute}. It
- * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type Reference</em>' reference
- * list isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Attribute Type Reference</em>'
- * reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_AttributeTypeReference()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity
- * @model type="DTDAttribute" opposite="attributeTypeReferencedEntity"
- * @generated
- */
- EList getAttributeTypeReference();
-
-} // DTDEntity
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java
deleted file mode 100644
index 90626c6161..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java
+++ /dev/null
@@ -1,65 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDEntityContent extends EObject, DTDObject {
-
- public String unparse();
-
- /**
- * Returns the value of the '<em><b>DTD Entity</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD Entity</em>' container reference
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD Entity</em>' container reference.
- * @see #setDTDEntity(DTDEntity)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityContent_DTDEntity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent
- * @model opposite="content"
- * @generated
- */
- DTDEntity getDTDEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>DTD Entity</em>' container
- * reference.
- * @see #getDTDEntity()
- * @generated
- */
- void setDTDEntity(DTDEntity value);
-
-} // DTDEntityContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java
deleted file mode 100644
index 55b97f7b28..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java
+++ /dev/null
@@ -1,64 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity Reference Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityReferenceContent()
- * @model
- * @generated
- */
-public interface DTDEntityReferenceContent extends DTDRepeatableContent {
-
- /**
- * Returns the value of the '<em><b>Element Referenced Entity</b></em>'
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Element Referenced Entity</em>'
- * reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Element Referenced Entity</em>'
- * reference.
- * @see #setElementReferencedEntity(DTDEntity)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityReferenceContent_ElementReferencedEntity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference
- * @model opposite="entityReference" required="true"
- * @generated
- */
- DTDEntity getElementReferencedEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Element Referenced Entity</em>'
- * reference.
- * @see #getElementReferencedEntity()
- * @generated
- */
- void setElementReferencedEntity(DTDEntity value);
-
-} // DTDEntityReferenceContent
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java
deleted file mode 100644
index 1003dc1cc8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java
+++ /dev/null
@@ -1,139 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Enum Group Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumGroupKind()
- * @model
- * @generated
- */
-public final class DTDEnumGroupKind extends AbstractEnumerator {
- /**
- * The '<em><b>NAME TOKEN GROUP</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #NAME_TOKEN_GROUP_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NAME_TOKEN_GROUP = 1;
-
- /**
- * The '<em><b>NOTATION GROUP</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #NOTATION_GROUP_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NOTATION_GROUP = 2;
-
- /**
- * The '<em><b>NAME TOKEN GROUP</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NAME TOKEN GROUP</b></em>' literal
- * object isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NAME_TOKEN_GROUP
- * @generated
- * @ordered
- */
- public static final DTDEnumGroupKind NAME_TOKEN_GROUP_LITERAL = new DTDEnumGroupKind(NAME_TOKEN_GROUP, "NAME_TOKEN_GROUP"); //$NON-NLS-1$
-
- /**
- * The '<em><b>NOTATION GROUP</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NOTATION GROUP</b></em>' literal object
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NOTATION_GROUP
- * @generated
- * @ordered
- */
- public static final DTDEnumGroupKind NOTATION_GROUP_LITERAL = new DTDEnumGroupKind(NOTATION_GROUP, "NOTATION_GROUP"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>Enum Group Kind</b></em>' enumerators.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final DTDEnumGroupKind[] VALUES_ARRAY = new DTDEnumGroupKind[]{NAME_TOKEN_GROUP_LITERAL, NOTATION_GROUP_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>Enum Group Kind</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Enum Group Kind</b></em>' literal with the
- * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDEnumGroupKind get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- DTDEnumGroupKind result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Enum Group Kind</b></em>' literal with the
- * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDEnumGroupKind get(int value) {
- switch (value) {
- case NAME_TOKEN_GROUP :
- return NAME_TOKEN_GROUP_LITERAL;
- case NOTATION_GROUP :
- return NOTATION_GROUP_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private DTDEnumGroupKind(int value, String name) {
- super(value, name);
- }
-
-} // DTDEnumGroupKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java
deleted file mode 100644
index 4901b2b18b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java
+++ /dev/null
@@ -1,101 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EEnum;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Enumeration Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType()
- * @model
- * @generated
- */
-public interface DTDEnumerationType extends EEnum, DTDType {
-
- public EList getEnumLiterals();
-
- public String getEnumerationTypeDescription();
-
- /**
- * Returns the value of the '<em><b>Kind</b></em>' attribute. The
- * literals are from the enumeration
- * {@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind}. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Kind</em>' attribute isn't clear, there
- * really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
- * @see #setKind(DTDEnumGroupKind)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType_Kind()
- * @model
- * @generated
- */
- DTDEnumGroupKind getKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
- * @see #getKind()
- * @generated
- */
- void setKind(DTDEnumGroupKind value);
-
- /**
- * Returns the value of the '<em><b>DTD File</b></em>' container
- * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD File</em>' container reference isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD File</em>' container reference.
- * @see #setDTDFile(DTDFile)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType_DTDFile()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType
- * @model opposite="DTDEnumerationType"
- * @generated
- */
- DTDFile getDTDFile();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'
- * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>DTD File</em>' container
- * reference.
- * @see #getDTDFile()
- * @generated
- */
- void setDTDFile(DTDFile value);
-
-} // DTDEnumerationType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java
deleted file mode 100644
index 613e9c5574..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java
+++ /dev/null
@@ -1,49 +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.dtd.core.internal.emf;
-
-public class DTDErrorMessage {
- public String errorKey;
- public String errorMessage;
- public String lineNo;
- public String charOffSet;
- public String declarationType;
- public String declarationName;
- public String sourceLine;
-
-
- public DTDErrorMessage(String declarationType, String declarationName, String lineNo, String charOffSet, String errorKey, String errorMessage) {
- this(declarationType, declarationName, lineNo, charOffSet, errorKey, errorMessage, null);
- }
-
- public DTDErrorMessage(String declarationType, String declarationName, String lineNo, String charOffSet, String errorKey, String errorMessage, String srcLine) {
- this.declarationType = declarationType;
- this.declarationName = declarationName;
- this.lineNo = lineNo;
- this.charOffSet = charOffSet;
- this.errorKey = errorKey;
- this.errorMessage = errorMessage;
- this.sourceLine = srcLine;
- }
-
- public String toString() {
- return "(" + declarationType + ":" + declarationName + ") " + lineNo + ":" + charOffSet + " " + errorMessage; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
-
- /**
- * @generated
- */
- protected String toStringGen() {
-
- return "(" + declarationType + ":" + declarationName + ") " + lineNo + ":" + charOffSet + " " + errorMessage; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java
deleted file mode 100644
index 59de3608a2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java
+++ /dev/null
@@ -1,19 +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.dtd.core.internal.emf;
-
-/**
- * This interface can be implemented by an IDomainModel to augment
- * getElementProperty for any DTD object.
- */
-public interface DTDExtender {
- public Object getElementProperty(DTDObject dtdObject, Object object);
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java
deleted file mode 100644
index 2f8b34f8ea..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java
+++ /dev/null
@@ -1,151 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>External Entity</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity()
- * @model
- * @generated
- */
-public interface DTDExternalEntity extends DTDEntityContent {
-
- /**
- * Returns the value of the '<em><b>System ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>System ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>System ID</em>' attribute.
- * @see #setSystemID(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_SystemID()
- * @model
- * @generated
- */
- String getSystemID();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>System ID</em>' attribute.
- * @see #getSystemID()
- * @generated
- */
- void setSystemID(String value);
-
- /**
- * Returns the value of the '<em><b>Public ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Public ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Public ID</em>' attribute.
- * @see #setPublicID(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_PublicID()
- * @model
- * @generated
- */
- String getPublicID();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Public ID</em>' attribute.
- * @see #getPublicID()
- * @generated
- */
- void setPublicID(String value);
-
- /**
- * Returns the value of the '<em><b>Notation</b></em>' reference. It
- * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Notation</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Notation</em>' reference.
- * @see #setNotation(DTDNotation)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_Notation()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity
- * @model opposite="entity"
- * @generated
- */
- DTDNotation getNotation();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Notation</em>' reference.
- * @see #getNotation()
- * @generated
- */
- void setNotation(DTDNotation value);
-
- /**
- * Returns the value of the '<em><b>Entity Referenced From Another File</b></em>'
- * reference. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Referenced From Another File</em>'
- * reference isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Entity Referenced From Another File</em>'
- * reference.
- * @see #setEntityReferencedFromAnotherFile(DTDFile)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_EntityReferencedFromAnotherFile()
- * @model
- * @generated
- */
- DTDFile getEntityReferencedFromAnotherFile();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Entity Referenced From Another File</em>'
- * reference.
- * @see #getEntityReferencedFromAnotherFile()
- * @generated
- */
- void setEntityReferencedFromAnotherFile(DTDFile value);
-
-} // DTDExternalEntity
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java
deleted file mode 100644
index 282777a02c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java
+++ /dev/null
@@ -1,186 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a
- * create method for each non-abstract class of the model. <!-- end-user-doc
- * -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage
- * @generated
- */
-public interface DTDFactory extends EFactory {
-
- /**
- * The singleton instance of the factory. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- DTDFactory eINSTANCE = new org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl();
-
- /**
- * Returns a new object of class '<em>Group Content</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Group Content</em>'.
- * @generated
- */
- DTDGroupContent createDTDGroupContent();
-
- /**
- * Returns a new object of class '<em>Attribute</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Attribute</em>'.
- * @generated
- */
- DTDAttribute createDTDAttribute();
-
- /**
- * Returns a new object of class '<em>Element</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Element</em>'.
- * @generated
- */
- DTDElement createDTDElement();
-
- /**
- * Returns a new object of class '<em>Empty Content</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Empty Content</em>'.
- * @generated
- */
- DTDEmptyContent createDTDEmptyContent();
-
- /**
- * Returns a new object of class '<em>Any Content</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Any Content</em>'.
- * @generated
- */
- DTDAnyContent createDTDAnyContent();
-
- /**
- * Returns a new object of class '<em>PC Data Content</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>PC Data Content</em>'.
- * @generated
- */
- DTDPCDataContent createDTDPCDataContent();
-
- /**
- * Returns a new object of class '<em>Element Reference Content</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Element Reference Content</em>'.
- * @generated
- */
- DTDElementReferenceContent createDTDElementReferenceContent();
-
- /**
- * Returns a new object of class '<em>File</em>'. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>File</em>'.
- * @generated
- */
- DTDFile createDTDFile();
-
- /**
- * Returns a new object of class '<em>Basic Type</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Basic Type</em>'.
- * @generated
- */
- DTDBasicType createDTDBasicType();
-
- /**
- * Returns a new object of class '<em>Enumeration Type</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Enumeration Type</em>'.
- * @generated
- */
- DTDEnumerationType createDTDEnumerationType();
-
- /**
- * Returns a new object of class '<em>Notation</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Notation</em>'.
- * @generated
- */
- DTDNotation createDTDNotation();
-
- /**
- * Returns a new object of class '<em>Entity</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Entity</em>'.
- * @generated
- */
- DTDEntity createDTDEntity();
-
- /**
- * Returns a new object of class '<em>External Entity</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>External Entity</em>'.
- * @generated
- */
- DTDExternalEntity createDTDExternalEntity();
-
- /**
- * Returns a new object of class '<em>Internal Entity</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Internal Entity</em>'.
- * @generated
- */
- DTDInternalEntity createDTDInternalEntity();
-
- /**
- * Returns a new object of class '<em>Parameter Entity Reference</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Parameter Entity Reference</em>'.
- * @generated
- */
- DTDParameterEntityReference createDTDParameterEntityReference();
-
- /**
- * Returns a new object of class '<em>Entity Reference Content</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Entity Reference Content</em>'.
- * @generated
- */
- DTDEntityReferenceContent createDTDEntityReferenceContent();
-
- /**
- * Returns the package supported by this factory. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the package supported by this factory.
- * @generated
- */
- DTDPackage getDTDPackage();
-
-} // DTDFactory
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java
deleted file mode 100644
index 52ae28a8b0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java
+++ /dev/null
@@ -1,157 +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.dtd.core.internal.emf;
-
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>File</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile()
- * @model
- * @generated
- */
-public interface DTDFile extends ENamedElement, DTDObject {
-
- public EList getDTDObject();
-
- public List listDTDElement();
-
- public List listDTDNotation();
-
- public List listDTDEntity();
-
- public List listDTDParameterEntityReference();
-
- public List listDTDElementAndDTDParameterEntityReference();
-
- public DTDElement findElement(String name);
-
- public DTDEntity findEntity(String name);
-
- public DTDNotation findNotation(String name);
-
- public DTDParameterEntityReference findParameterEntityReference(String name);
-
- public String unparse(boolean includeError);
-
- /**
- * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Comment</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Comment</em>' attribute.
- * @see #setComment(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_Comment()
- * @model
- * @generated
- */
- String getComment();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Comment</em>' attribute.
- * @see #getComment()
- * @generated
- */
- void setComment(String value);
-
- /**
- * Returns the value of the '<em><b>Parse Error</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parse Error</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Parse Error</em>' attribute.
- * @see #setParseError(boolean)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_ParseError()
- * @model
- * @generated
- */
- boolean isParseError();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Parse Error</em>' attribute.
- * @see #isParseError()
- * @generated
- */
- void setParseError(boolean value);
-
- /**
- * Returns the value of the '<em><b>DTD Content</b></em>' containment
- * reference list. The list contents are of type {@link DTDContent}. It
- * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD Content</em>' containment reference
- * list isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD Content</em>' containment
- * reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_DTDContent()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile
- * @model type="DTDContent" opposite="DTDFile" containment="true"
- * @generated
- */
- EList getDTDContent();
-
- /**
- * Returns the value of the '<em><b>DTD Enumeration Type</b></em>'
- * containment reference list. The list contents are of type
- * {@link DTDEnumerationType}. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>DTD Enumeration Type</em>' containment
- * reference list isn't clear, there really should be more of a
- * description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>DTD Enumeration Type</em>'
- * containment reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_DTDEnumerationType()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile
- * @model type="DTDEnumerationType" opposite="DTDFile" containment="true"
- * @generated
- */
- EList getDTDEnumerationType();
-
-} // DTDFile
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java
deleted file mode 100644
index f72720506c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java
+++ /dev/null
@@ -1,88 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Group Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent()
- * @model
- * @generated
- */
-public interface DTDGroupContent extends DTDRepeatableContent {
-
- public int getContentPosition(DTDElementContent content);
-
- /**
- * Returns the value of the '<em><b>Group Kind</b></em>' attribute.
- * The literals are from the enumeration
- * {@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind}. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of the '<em>Group Kind</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Group Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
- * @see #setGroupKind(DTDGroupKind)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent_GroupKind()
- * @model
- * @generated
- */
- DTDGroupKind getGroupKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Group Kind</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
- * @see #getGroupKind()
- * @generated
- */
- void setGroupKind(DTDGroupKind value);
-
- /**
- * Returns the value of the '<em><b>Content</b></em>' containment
- * reference list. The list contents are of type {@link DTDElementContent}.
- * It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Content</em>' containment reference list
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Content</em>' containment reference
- * list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent_Content()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup
- * @model type="DTDElementContent" opposite="group" containment="true"
- * required="true"
- * @generated
- */
- EList getContent();
-
-} // DTDGroupContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java
deleted file mode 100644
index 4dd8b107f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java
+++ /dev/null
@@ -1,139 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Group Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupKind()
- * @model
- * @generated
- */
-public final class DTDGroupKind extends AbstractEnumerator {
- /**
- * The '<em><b>SEQUENCE</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #SEQUENCE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int SEQUENCE = 1;
-
- /**
- * The '<em><b>CHOICE</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #CHOICE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int CHOICE = 2;
-
- /**
- * The '<em><b>SEQUENCE</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>SEQUENCE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #SEQUENCE
- * @generated
- * @ordered
- */
- public static final DTDGroupKind SEQUENCE_LITERAL = new DTDGroupKind(SEQUENCE, "SEQUENCE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>CHOICE</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>CHOICE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #CHOICE
- * @generated
- * @ordered
- */
- public static final DTDGroupKind CHOICE_LITERAL = new DTDGroupKind(CHOICE, "CHOICE"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>Group Kind</b></em>' enumerators. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final DTDGroupKind[] VALUES_ARRAY = new DTDGroupKind[]{SEQUENCE_LITERAL, CHOICE_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>Group Kind</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Group Kind</b></em>' literal with the
- * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDGroupKind get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- DTDGroupKind result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Group Kind</b></em>' literal with the
- * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDGroupKind get(int value) {
- switch (value) {
- case SEQUENCE :
- return SEQUENCE_LITERAL;
- case CHOICE :
- return CHOICE_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private DTDGroupKind(int value, String name) {
- super(value, name);
- }
-
-} // DTDGroupKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java
deleted file mode 100644
index 0b28725ec5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java
+++ /dev/null
@@ -1,57 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Internal Entity</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDInternalEntity()
- * @model
- * @generated
- */
-public interface DTDInternalEntity extends DTDEntityContent {
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear, there
- * really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDInternalEntity_Value()
- * @model
- * @generated
- */
- String getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
-
-} // DTDInternalEntity
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.java
deleted file mode 100644
index 997997fa7d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public class DTDLexicalInfo implements DTDSourceOffset {
- // Begin User Defined Methods
- int startOffset;
- int endOffset;
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return startOffset;
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- this.startOffset = v;
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return endOffset;
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
-
- this.endOffset = v;
- }
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- protected int getStartOffsetGen() {
-
- return startOffset;
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- protected void setStartOffsetGen(int v) {
-
- this.startOffset = v;
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- protected int getEndOffsetGen() {
-
- return endOffset;
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- protected void setEndOffsetGen(int v) {
-
-
- this.endOffset = v;
- }
-}// DTDSourceOffset
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java
deleted file mode 100644
index 446bb7a203..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java
+++ /dev/null
@@ -1,140 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Notation</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation()
- * @model
- * @generated
- */
-public interface DTDNotation extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
-
- /**
- * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Comment</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Comment</em>' attribute.
- * @see #setComment(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_Comment()
- * @model
- * @generated
- */
- String getComment();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Comment</em>' attribute.
- * @see #getComment()
- * @generated
- */
- void setComment(String value);
-
- /**
- * Returns the value of the '<em><b>System ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>System ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>System ID</em>' attribute.
- * @see #setSystemID(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_SystemID()
- * @model
- * @generated
- */
- String getSystemID();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>System ID</em>' attribute.
- * @see #getSystemID()
- * @generated
- */
- void setSystemID(String value);
-
- /**
- * Returns the value of the '<em><b>Public ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Public ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Public ID</em>' attribute.
- * @see #setPublicID(String)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_PublicID()
- * @model
- * @generated
- */
- String getPublicID();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Public ID</em>' attribute.
- * @see #getPublicID()
- * @generated
- */
- void setPublicID(String value);
-
- /**
- * Returns the value of the '<em><b>Entity</b></em>' reference list.
- * The list contents are of type {@link DTDExternalEntity}. It is
- * bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity</em>' reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Entity</em>' reference list.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_Entity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation
- * @model type="DTDExternalEntity" opposite="notation"
- * @generated
- */
- EList getEntity();
-
-} // DTDNotation
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java
deleted file mode 100644
index 603db71c0f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java
+++ /dev/null
@@ -1,21 +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.dtd.core.internal.emf;
-
-// Ref package
-import org.eclipse.emf.ecore.EObject;
-
-public interface DTDObject extends EObject {
- public String getPathname();
-
- public DTDObject findObject(String relativePath);
-
-} // DTDObject
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java
deleted file mode 100644
index f38fb43ddd..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java
+++ /dev/null
@@ -1,193 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Occurrence Type</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDOccurrenceType()
- * @model
- * @generated
- */
-public final class DTDOccurrenceType extends AbstractEnumerator {
- /**
- * The '<em><b>ONE</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #ONE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ONE = 49;
-
- /**
- * The '<em><b>OPTIONAL</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #OPTIONAL_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int OPTIONAL = 63;
-
- /**
- * The '<em><b>ONE OR MORE</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #ONE_OR_MORE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ONE_OR_MORE = 43;
-
- /**
- * The '<em><b>ZERO OR MORE</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #ZERO_OR_MORE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ZERO_OR_MORE = 42;
-
- /**
- * The '<em><b>ONE</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ONE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ONE
- * @generated
- * @ordered
- */
- public static final DTDOccurrenceType ONE_LITERAL = new DTDOccurrenceType(ONE, "ONE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>OPTIONAL</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>OPTIONAL</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #OPTIONAL
- * @generated
- * @ordered
- */
- public static final DTDOccurrenceType OPTIONAL_LITERAL = new DTDOccurrenceType(OPTIONAL, "OPTIONAL"); //$NON-NLS-1$
-
- /**
- * The '<em><b>ONE OR MORE</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ONE OR MORE</b></em>' literal object
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ONE_OR_MORE
- * @generated
- * @ordered
- */
- public static final DTDOccurrenceType ONE_OR_MORE_LITERAL = new DTDOccurrenceType(ONE_OR_MORE, "ONE_OR_MORE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>ZERO OR MORE</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ZERO OR MORE</b></em>' literal object
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #ZERO_OR_MORE
- * @generated
- * @ordered
- */
- public static final DTDOccurrenceType ZERO_OR_MORE_LITERAL = new DTDOccurrenceType(ZERO_OR_MORE, "ZERO_OR_MORE"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>Occurrence Type</b></em>' enumerators.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final DTDOccurrenceType[] VALUES_ARRAY = new DTDOccurrenceType[]{ONE_LITERAL, OPTIONAL_LITERAL, ONE_OR_MORE_LITERAL, ZERO_OR_MORE_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>Occurrence Type</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Occurrence Type</b></em>' literal with the
- * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDOccurrenceType get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- DTDOccurrenceType result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Occurrence Type</b></em>' literal with the
- * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDOccurrenceType get(int value) {
- switch (value) {
- case ONE :
- return ONE_LITERAL;
- case OPTIONAL :
- return OPTIONAL_LITERAL;
- case ONE_OR_MORE :
- return ONE_OR_MORE_LITERAL;
- case ZERO_OR_MORE :
- return ZERO_OR_MORE_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private DTDOccurrenceType(int value, String name) {
- super(value, name);
- }
-
-} // DTDOccurrenceType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java
deleted file mode 100644
index 23af5dd41e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java
+++ /dev/null
@@ -1,25 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>PC Data Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDPCDataContent()
- * @model
- * @generated
- */
-public interface DTDPCDataContent extends DTDElementContent {
-} // DTDPCDataContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java
deleted file mode 100644
index c8e84c1f79..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java
+++ /dev/null
@@ -1,2392 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-
-/**
- * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains
- * accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFactory
- * @generated
- */
-public interface DTDPackage extends EPackage {
-
- /**
- * The package name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNAME = "dtd"; //$NON-NLS-1$
-
- /**
- * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- */
- String eNS_URI = "http:///com/ibm/etools/dtd.ecore"; //$NON-NLS-1$
-
- /**
- * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- */
- String eNS_PREFIX = "org.eclipse.wst.dtd.core.internal.emf"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the package. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- DTDPackage eINSTANCE = org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl <em>Element Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElementContent()
- * @generated
- */
- int DTD_ELEMENT_CONTENT = 0;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_CONTENT__GROUP = 0;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_CONTENT__ELEMENT = 1;
-
- /**
- * The number of structural features of the the '<em>Element Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_CONTENT_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDRepeatableContentImpl <em>Repeatable Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDRepeatableContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDRepeatableContent()
- * @generated
- */
- int DTD_REPEATABLE_CONTENT = 8;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_REPEATABLE_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_REPEATABLE_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Occurrence</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_REPEATABLE_CONTENT__OCCURRENCE = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Repeatable Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_REPEATABLE_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDGroupContentImpl <em>Group Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDGroupContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDGroupContent()
- * @generated
- */
- int DTD_GROUP_CONTENT = 1;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Occurrence</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
- /**
- * The feature id for the '<em><b>Group Kind</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT__GROUP_KIND = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Content</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT__CONTENT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the the '<em>Group Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_GROUP_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl <em>Attribute</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDAttribute()
- * @generated
- */
- int DTD_ATTRIBUTE = 2;
-
- /**
- * The feature id for the '<em><b>EAnnotations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__EANNOTATIONS = EcorePackage.EATTRIBUTE__EANNOTATIONS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__NAME = EcorePackage.EATTRIBUTE__NAME;
-
- /**
- * The feature id for the '<em><b>EType</b></em>' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__ETYPE = EcorePackage.EATTRIBUTE__ETYPE;
-
- /**
- * The feature id for the '<em><b>Changeable</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__CHANGEABLE = EcorePackage.EATTRIBUTE__CHANGEABLE;
-
- /**
- * The feature id for the '<em><b>Volatile</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__VOLATILE = EcorePackage.EATTRIBUTE__VOLATILE;
-
- /**
- * The feature id for the '<em><b>Transient</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__TRANSIENT = EcorePackage.EATTRIBUTE__TRANSIENT;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__UNIQUE = EcorePackage.EATTRIBUTE__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Default Value Literal</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL = EcorePackage.EATTRIBUTE__DEFAULT_VALUE_LITERAL;
-
- /**
- * The feature id for the '<em><b>Default Value</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__DEFAULT_VALUE = EcorePackage.EATTRIBUTE__DEFAULT_VALUE;
-
- /**
- * The feature id for the '<em><b>Lower Bound</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__LOWER_BOUND = EcorePackage.EATTRIBUTE__LOWER_BOUND;
-
- /**
- * The feature id for the '<em><b>Upper Bound</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__UPPER_BOUND = EcorePackage.EATTRIBUTE__UPPER_BOUND;
-
- /**
- * The feature id for the '<em><b>Many</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__MANY = EcorePackage.EATTRIBUTE__MANY;
-
- /**
- * The feature id for the '<em><b>Required</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__REQUIRED = EcorePackage.EATTRIBUTE__REQUIRED;
-
- /**
- * The feature id for the '<em><b>EContaining Class</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__ECONTAINING_CLASS = EcorePackage.EATTRIBUTE__ECONTAINING_CLASS;
-
- /**
- * The feature id for the '<em><b>Unsettable</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__UNSETTABLE = EcorePackage.EATTRIBUTE__UNSETTABLE;
-
- /**
- * The feature id for the '<em><b>ID</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__ID = EcorePackage.EATTRIBUTE__ID;
-
- /**
- * The feature id for the '<em><b>EAttribute Type</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__EATTRIBUTE_TYPE = EcorePackage.EATTRIBUTE__EATTRIBUTE_TYPE;
-
- /**
- * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__COMMENT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Default Kind</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__DEFAULT_KIND = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Default Value String</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__DEFAULT_VALUE_STRING = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Attribute Name Referenced Entity</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Attribute Type Referenced Entity</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>DTD Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE__DTD_ELEMENT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the the '<em>Attribute</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ATTRIBUTE_FEATURE_COUNT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementImpl <em>Element</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElement()
- * @generated
- */
- int DTD_ELEMENT = 3;
-
- /**
- * The feature id for the '<em><b>EAnnotations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__NAME = EcorePackage.ECLASS__NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class Name</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS;
-
- /**
- * The feature id for the '<em><b>Default Value</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE;
-
- /**
- * The feature id for the '<em><b>EPackage</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EPACKAGE = EcorePackage.ECLASS__EPACKAGE;
-
- /**
- * The feature id for the '<em><b>Abstract</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__ABSTRACT = EcorePackage.ECLASS__ABSTRACT;
-
- /**
- * The feature id for the '<em><b>Interface</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__INTERFACE = EcorePackage.ECLASS__INTERFACE;
-
- /**
- * The feature id for the '<em><b>ESuper Types</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES;
-
- /**
- * The feature id for the '<em><b>EOperations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS;
-
- /**
- * The feature id for the '<em><b>EAll Attributes</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>EAll References</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES;
-
- /**
- * The feature id for the '<em><b>EReferences</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EREFERENCES = EcorePackage.ECLASS__EREFERENCES;
-
- /**
- * The feature id for the '<em><b>EAttributes</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>EAll Containments</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS;
-
- /**
- * The feature id for the '<em><b>EAll Operations</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS;
-
- /**
- * The feature id for the '<em><b>EAll Structural Features</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES;
-
- /**
- * The feature id for the '<em><b>EAll Super Types</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES;
-
- /**
- * The feature id for the '<em><b>EID Attribute</b></em>' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__DTD_FILE = EcorePackage.ECLASS_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__COMMENT = EcorePackage.ECLASS_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Content</b></em>' containment
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__CONTENT = EcorePackage.ECLASS_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>DTD Attribute</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT__DTD_ATTRIBUTE = EcorePackage.ECLASS_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the the '<em>Element</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEmptyContentImpl <em>Empty Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEmptyContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEmptyContent()
- * @generated
- */
- int DTD_EMPTY_CONTENT = 4;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EMPTY_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EMPTY_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
- /**
- * The number of structural features of the the '<em>Empty Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EMPTY_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAnyContentImpl <em>Any Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAnyContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDAnyContent()
- * @generated
- */
- int DTD_ANY_CONTENT = 5;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ANY_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ANY_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
- /**
- * The number of structural features of the the '<em>Any Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ANY_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPCDataContentImpl <em>PC Data Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPCDataContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDPCDataContent()
- * @generated
- */
- int DTD_PC_DATA_CONTENT = 6;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PC_DATA_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PC_DATA_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
- /**
- * The number of structural features of the the '<em>PC Data Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PC_DATA_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementReferenceContentImpl <em>Element Reference Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementReferenceContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElementReferenceContent()
- * @generated
- */
- int DTD_ELEMENT_REFERENCE_CONTENT = 7;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_REFERENCE_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Occurrence</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
- /**
- * The feature id for the '<em><b>Referenced Element</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Element Reference Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ELEMENT_REFERENCE_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl <em>File</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDFile()
- * @generated
- */
- int DTD_FILE = 9;
-
- /**
- * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_FILE__COMMENT = 0;
-
- /**
- * The feature id for the '<em><b>Parse Error</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_FILE__PARSE_ERROR = 1;
-
- /**
- * The feature id for the '<em><b>DTD Content</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_FILE__DTD_CONTENT = 2;
-
- /**
- * The feature id for the '<em><b>DTD Enumeration Type</b></em>'
- * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- * @ordered
- */
- int DTD_FILE__DTD_ENUMERATION_TYPE = 3;
-
- /**
- * The number of structural features of the the '<em>File</em>' class.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_FILE_FEATURE_COUNT = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl <em>Basic Type</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDBasicType()
- * @generated
- */
- int DTD_BASIC_TYPE = 10;
-
- /**
- * The feature id for the '<em><b>EAnnotations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__NAME = EcorePackage.ECLASS__NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class Name</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS;
-
- /**
- * The feature id for the '<em><b>Default Value</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE;
-
- /**
- * The feature id for the '<em><b>EPackage</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EPACKAGE = EcorePackage.ECLASS__EPACKAGE;
-
- /**
- * The feature id for the '<em><b>Abstract</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__ABSTRACT = EcorePackage.ECLASS__ABSTRACT;
-
- /**
- * The feature id for the '<em><b>Interface</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__INTERFACE = EcorePackage.ECLASS__INTERFACE;
-
- /**
- * The feature id for the '<em><b>ESuper Types</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES;
-
- /**
- * The feature id for the '<em><b>EOperations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS;
-
- /**
- * The feature id for the '<em><b>EAll Attributes</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>EAll References</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES;
-
- /**
- * The feature id for the '<em><b>EReferences</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EREFERENCES = EcorePackage.ECLASS__EREFERENCES;
-
- /**
- * The feature id for the '<em><b>EAttributes</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>EAll Containments</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS;
-
- /**
- * The feature id for the '<em><b>EAll Operations</b></em>' reference
- * list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS;
-
- /**
- * The feature id for the '<em><b>EAll Structural Features</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES;
-
- /**
- * The feature id for the '<em><b>EAll Super Types</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES;
-
- /**
- * The feature id for the '<em><b>EID Attribute</b></em>' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE__KIND = EcorePackage.ECLASS_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Basic Type</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_BASIC_TYPE_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEnumerationTypeImpl <em>Enumeration Type</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEnumerationTypeImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEnumerationType()
- * @generated
- */
- int DTD_ENUMERATION_TYPE = 11;
-
- /**
- * The feature id for the '<em><b>EAnnotations</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__EANNOTATIONS = EcorePackage.EENUM__EANNOTATIONS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__NAME = EcorePackage.EENUM__NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class Name</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME = EcorePackage.EENUM__INSTANCE_CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Instance Class</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__INSTANCE_CLASS = EcorePackage.EENUM__INSTANCE_CLASS;
-
- /**
- * The feature id for the '<em><b>Default Value</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__DEFAULT_VALUE = EcorePackage.EENUM__DEFAULT_VALUE;
-
- /**
- * The feature id for the '<em><b>EPackage</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__EPACKAGE = EcorePackage.EENUM__EPACKAGE;
-
- /**
- * The feature id for the '<em><b>Serializable</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__SERIALIZABLE = EcorePackage.EENUM__SERIALIZABLE;
-
- /**
- * The feature id for the '<em><b>ELiterals</b></em>' containment
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__ELITERALS = EcorePackage.EENUM__ELITERALS;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__KIND = EcorePackage.EENUM_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE__DTD_FILE = EcorePackage.EENUM_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the the '<em>Enumeration Type</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENUMERATION_TYPE_FEATURE_COUNT = EcorePackage.EENUM_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDContentImpl <em>Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDContent()
- * @generated
- */
- int DTD_CONTENT = 19;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_CONTENT__DTD_FILE = 0;
-
- /**
- * The number of structural features of the the '<em>Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_CONTENT_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl <em>Notation</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDNotation()
- * @generated
- */
- int DTD_NOTATION = 12;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
- /**
- * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION__COMMENT = DTD_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>System ID</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION__SYSTEM_ID = DTD_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Public ID</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION__PUBLIC_ID = DTD_CONTENT_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Entity</b></em>' reference list.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION__ENTITY = DTD_CONTENT_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the the '<em>Notation</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_NOTATION_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl <em>Entity</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntity()
- * @generated
- */
- int DTD_ENTITY = 13;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
- /**
- * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__COMMENT = DTD_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Parameter Entity</b></em>'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__PARAMETER_ENTITY = DTD_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Content</b></em>' containment
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__CONTENT = DTD_CONTENT_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Parm Entity Ref</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__PARM_ENTITY_REF = DTD_CONTENT_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Entity Reference</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__ENTITY_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Attribute Name Reference</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Attribute Type Reference</b></em>'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the the '<em>Entity</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityContentImpl <em>Entity Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntityContent()
- * @generated
- */
- int DTD_ENTITY_CONTENT = 14;
-
- /**
- * The feature id for the '<em><b>DTD Entity</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_CONTENT__DTD_ENTITY = 0;
-
- /**
- * The number of structural features of the the '<em>Entity Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_CONTENT_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDExternalEntityImpl <em>External Entity</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDExternalEntityImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDExternalEntity()
- * @generated
- */
- int DTD_EXTERNAL_ENTITY = 15;
-
- /**
- * The feature id for the '<em><b>DTD Entity</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY__DTD_ENTITY = DTD_ENTITY_CONTENT__DTD_ENTITY;
-
- /**
- * The feature id for the '<em><b>System ID</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY__SYSTEM_ID = DTD_ENTITY_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Public ID</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY__PUBLIC_ID = DTD_ENTITY_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Notation</b></em>' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY__NOTATION = DTD_ENTITY_CONTENT_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Entity Referenced From Another File</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE = DTD_ENTITY_CONTENT_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the the '<em>External Entity</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_EXTERNAL_ENTITY_FEATURE_COUNT = DTD_ENTITY_CONTENT_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDInternalEntityImpl <em>Internal Entity</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDInternalEntityImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDInternalEntity()
- * @generated
- */
- int DTD_INTERNAL_ENTITY = 16;
-
- /**
- * The feature id for the '<em><b>DTD Entity</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_INTERNAL_ENTITY__DTD_ENTITY = DTD_ENTITY_CONTENT__DTD_ENTITY;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_INTERNAL_ENTITY__VALUE = DTD_ENTITY_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Internal Entity</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_INTERNAL_ENTITY_FEATURE_COUNT = DTD_ENTITY_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl <em>Parameter Entity Reference</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDParameterEntityReference()
- * @generated
- */
- int DTD_PARAMETER_ENTITY_REFERENCE = 17;
-
- /**
- * The feature id for the '<em><b>DTD File</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
- /**
- * The feature id for the '<em><b>Entity</b></em>' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PARAMETER_ENTITY_REFERENCE__ENTITY = DTD_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Parameter Entity Reference</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_PARAMETER_ENTITY_REFERENCE_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityReferenceContentImpl <em>Entity Reference Content</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityReferenceContentImpl
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntityReferenceContent()
- * @generated
- */
- int DTD_ENTITY_REFERENCE_CONTENT = 18;
-
- /**
- * The feature id for the '<em><b>Group</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_REFERENCE_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' container
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_REFERENCE_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Occurrence</b></em>' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
- /**
- * The feature id for the '<em><b>Element Referenced Entity</b></em>'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Entity Reference Content</em>'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DTD_ENTITY_REFERENCE_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType <em>Occurrence Type</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDOccurrenceType()
- * @generated
- */
- int DTD_OCCURRENCE_TYPE = 20;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind <em>Default Kind</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDDefaultKind()
- * @generated
- */
- int DTD_DEFAULT_KIND = 21;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind <em>Basic Type Kind</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDBasicTypeKind()
- * @generated
- */
- int DTD_BASIC_TYPE_KIND = 22;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind <em>Enum Group Kind</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEnumGroupKind()
- * @generated
- */
- int DTD_ENUM_GROUP_KIND = 23;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind <em>Group Kind</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDGroupKind()
- * @generated
- */
- int DTD_GROUP_KIND = 24;
-
- /**
- * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType <em>XML Schema Defined Type</em>}'
- * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType
- * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getXMLSchemaDefinedType()
- * @generated
- */
- int XML_SCHEMA_DEFINED_TYPE = 25;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent <em>Element Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Element Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent
- * @generated
- */
- EClass getDTDElementContent();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>Group</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup()
- * @see #getDTDElementContent()
- * @generated
- */
- EReference getDTDElementContent_Group();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>Element</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement()
- * @see #getDTDElementContent()
- * @generated
- */
- EReference getDTDElementContent_Element();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent <em>Group Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Group Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent
- * @generated
- */
- EClass getDTDGroupContent();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Group Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind()
- * @see #getDTDGroupContent()
- * @generated
- */
- EAttribute getDTDGroupContent_GroupKind();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent()
- * @see #getDTDGroupContent()
- * @generated
- */
- EReference getDTDGroupContent_Content();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute <em>Attribute</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Attribute</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute
- * @generated
- */
- EClass getDTDAttribute();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Comment</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment()
- * @see #getDTDAttribute()
- * @generated
- */
- EAttribute getDTDAttribute_Comment();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Default Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind()
- * @see #getDTDAttribute()
- * @generated
- */
- EAttribute getDTDAttribute_DefaultKind();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Default Value String</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString()
- * @see #getDTDAttribute()
- * @generated
- */
- EAttribute getDTDAttribute_DefaultValueString();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Attribute Name Referenced Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity()
- * @see #getDTDAttribute()
- * @generated
- */
- EReference getDTDAttribute_AttributeNameReferencedEntity();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Attribute Type Referenced Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity()
- * @see #getDTDAttribute()
- * @generated
- */
- EReference getDTDAttribute_AttributeTypeReferencedEntity();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>DTD Element</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement()
- * @see #getDTDAttribute()
- * @generated
- */
- EReference getDTDAttribute_DTDElement();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement <em>Element</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Element</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement
- * @generated
- */
- EClass getDTDElement();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Comment</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment()
- * @see #getDTDElement()
- * @generated
- */
- EAttribute getDTDElement_Comment();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference '<em>Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent()
- * @see #getDTDElement()
- * @generated
- */
- EReference getDTDElement_Content();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>DTD Attribute</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute()
- * @see #getDTDElement()
- * @generated
- */
- EReference getDTDElement_DTDAttribute();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent <em>Empty Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Empty Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent
- * @generated
- */
- EClass getDTDEmptyContent();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent <em>Any Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Any Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent
- * @generated
- */
- EClass getDTDAnyContent();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent <em>PC Data Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>PC Data Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent
- * @generated
- */
- EClass getDTDPCDataContent();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent <em>Element Reference Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Element Reference Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent
- * @generated
- */
- EClass getDTDElementReferenceContent();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Referenced Element</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement()
- * @see #getDTDElementReferenceContent()
- * @generated
- */
- EReference getDTDElementReferenceContent_ReferencedElement();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent <em>Repeatable Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Repeatable Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent
- * @generated
- */
- EClass getDTDRepeatableContent();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Occurrence</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence()
- * @see #getDTDRepeatableContent()
- * @generated
- */
- EAttribute getDTDRepeatableContent_Occurrence();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile <em>File</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>File</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile
- * @generated
- */
- EClass getDTDFile();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Comment</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment()
- * @see #getDTDFile()
- * @generated
- */
- EAttribute getDTDFile_Comment();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Parse Error</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError()
- * @see #getDTDFile()
- * @generated
- */
- EAttribute getDTDFile_ParseError();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>DTD Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent()
- * @see #getDTDFile()
- * @generated
- */
- EReference getDTDFile_DTDContent();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>DTD Enumeration Type</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType()
- * @see #getDTDFile()
- * @generated
- */
- EReference getDTDFile_DTDEnumerationType();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType <em>Basic Type</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Basic Type</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicType
- * @generated
- */
- EClass getDTDBasicType();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind()
- * @see #getDTDBasicType()
- * @generated
- */
- EAttribute getDTDBasicType_Kind();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType <em>Enumeration Type</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Enumeration Type</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType
- * @generated
- */
- EClass getDTDEnumerationType();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind()
- * @see #getDTDEnumerationType()
- * @generated
- */
- EAttribute getDTDEnumerationType_Kind();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>DTD File</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile()
- * @see #getDTDEnumerationType()
- * @generated
- */
- EReference getDTDEnumerationType_DTDFile();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation <em>Notation</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Notation</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation
- * @generated
- */
- EClass getDTDNotation();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Comment</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment()
- * @see #getDTDNotation()
- * @generated
- */
- EAttribute getDTDNotation_Comment();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>System ID</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID()
- * @see #getDTDNotation()
- * @generated
- */
- EAttribute getDTDNotation_SystemID();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Public ID</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID()
- * @see #getDTDNotation()
- * @generated
- */
- EAttribute getDTDNotation_PublicID();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity()
- * @see #getDTDNotation()
- * @generated
- */
- EReference getDTDNotation_Entity();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity <em>Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity
- * @generated
- */
- EClass getDTDEntity();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Comment</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment()
- * @see #getDTDEntity()
- * @generated
- */
- EAttribute getDTDEntity_Comment();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Parameter Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity()
- * @see #getDTDEntity()
- * @generated
- */
- EAttribute getDTDEntity_ParameterEntity();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference '<em>Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent()
- * @see #getDTDEntity()
- * @generated
- */
- EReference getDTDEntity_Content();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Parm Entity Ref</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef()
- * @see #getDTDEntity()
- * @generated
- */
- EReference getDTDEntity_ParmEntityRef();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>Entity Reference</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference()
- * @see #getDTDEntity()
- * @generated
- */
- EReference getDTDEntity_EntityReference();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>Attribute Name Reference</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference()
- * @see #getDTDEntity()
- * @generated
- */
- EReference getDTDEntity_AttributeNameReference();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>Attribute Type Reference</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference()
- * @see #getDTDEntity()
- * @generated
- */
- EReference getDTDEntity_AttributeTypeReference();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent <em>Entity Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Entity Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent
- * @generated
- */
- EClass getDTDEntityContent();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>DTD Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity()
- * @see #getDTDEntityContent()
- * @generated
- */
- EReference getDTDEntityContent_DTDEntity();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity <em>External Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>External Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity
- * @generated
- */
- EClass getDTDExternalEntity();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>System ID</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID()
- * @see #getDTDExternalEntity()
- * @generated
- */
- EAttribute getDTDExternalEntity_SystemID();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Public ID</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID()
- * @see #getDTDExternalEntity()
- * @generated
- */
- EAttribute getDTDExternalEntity_PublicID();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Notation</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation()
- * @see #getDTDExternalEntity()
- * @generated
- */
- EReference getDTDExternalEntity_Notation();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Entity Referenced From Another File</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile()
- * @see #getDTDExternalEntity()
- * @generated
- */
- EReference getDTDExternalEntity_EntityReferencedFromAnotherFile();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity <em>Internal Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Internal Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity
- * @generated
- */
- EClass getDTDInternalEntity();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue()
- * @see #getDTDInternalEntity()
- * @generated
- */
- EAttribute getDTDInternalEntity_Value();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference <em>Parameter Entity Reference</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Parameter Entity Reference</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference
- * @generated
- */
- EClass getDTDParameterEntityReference();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity()
- * @see #getDTDParameterEntityReference()
- * @generated
- */
- EReference getDTDParameterEntityReference_Entity();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent <em>Entity Reference Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Entity Reference Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent
- * @generated
- */
- EClass getDTDEntityReferenceContent();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Element Referenced Entity</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity()
- * @see #getDTDEntityReferenceContent()
- * @generated
- */
- EReference getDTDEntityReferenceContent_ElementReferencedEntity();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent <em>Content</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Content</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent
- * @generated
- */
- EClass getDTDContent();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the container reference '<em>DTD File</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile()
- * @see #getDTDContent()
- * @generated
- */
- EReference getDTDContent_DTDFile();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType <em>Occurrence Type</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Occurrence Type</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
- * @generated
- */
- EEnum getDTDOccurrenceType();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind <em>Default Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Default Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
- * @generated
- */
- EEnum getDTDDefaultKind();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind <em>Basic Type Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Basic Type Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
- * @generated
- */
- EEnum getDTDBasicTypeKind();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind <em>Enum Group Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Enum Group Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
- * @generated
- */
- EEnum getDTDEnumGroupKind();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind <em>Group Kind</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Group Kind</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
- * @generated
- */
- EEnum getDTDGroupKind();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType <em>XML Schema Defined Type</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>XML Schema Defined Type</em>'.
- * @see org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType
- * @generated
- */
- EEnum getXMLSchemaDefinedType();
-
- /**
- * Returns the factory that creates the instances of the model. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the factory that creates the instances of the model.
- * @generated
- */
- DTDFactory getDTDFactory();
-
-} // DTDPackage
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java
deleted file mode 100644
index 1f4f918855..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java
+++ /dev/null
@@ -1,61 +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.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Parameter Entity Reference</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDParameterEntityReference()
- * @model
- * @generated
- */
-public interface DTDParameterEntityReference extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
- /**
- * Returns the value of the '<em><b>Entity</b></em>' reference. It is
- * bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Entity</em>' reference.
- * @see #setEntity(DTDEntity)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDParameterEntityReference_Entity()
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef
- * @model opposite="parmEntityRef" required="true"
- * @generated
- */
- DTDEntity getEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Entity</em>' reference.
- * @see #getEntity()
- * @generated
- */
- void setEntity(DTDEntity value);
-
-} // DTDParameterEntityReference
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java
deleted file mode 100644
index b9b5123dff..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java
+++ /dev/null
@@ -1,65 +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.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Repeatable Content</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDRepeatableContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDRepeatableContent extends DTDElementContent {
-
- public abstract String unparseRepeatableContent();
-
- /**
- * Returns the value of the '<em><b>Occurrence</b></em>' attribute.
- * The literals are from the enumeration
- * {@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType}. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Occurrence</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Occurrence</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
- * @see #setOccurrence(DTDOccurrenceType)
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDRepeatableContent_Occurrence()
- * @model
- * @generated
- */
- DTDOccurrenceType getOccurrence();
-
- /**
- * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Occurrence</em>' attribute.
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
- * @see #getOccurrence()
- * @generated
- */
- void setOccurrence(DTDOccurrenceType value);
-
-} // DTDRepeatableContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java
deleted file mode 100644
index 21dd1feebc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java
+++ /dev/null
@@ -1,45 +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.dtd.core.internal.emf;
-
-
-public interface DTDResource {
- // Enumeration Constants
- public static final String ANYICON = "icons/any.gif"; //$NON-NLS-1$
- public static final String ELEMENTICON = "icons/element.gif"; //$NON-NLS-1$
- public static final String ENTITYICON = "icons/entity.gif"; //$NON-NLS-1$
- public static final String ATTRIBUTEICON = "icons/attribute.gif"; //$NON-NLS-1$
- public static final String NOTATIONICON = "icons/notation.gif"; //$NON-NLS-1$
- public static final String EMPTYICON = "icons/emptycontent.gif"; //$NON-NLS-1$
- public static final String PCDATAICON = "icons/one.gif"; //$NON-NLS-1$
- public static final String ENTITYREFERENCEICON = "icons/entity_reference.gif"; //$NON-NLS-1$
-
- public static final String ONEICON = "icons/one.gif"; //$NON-NLS-1$
- public static final String OPTIONALICON = "icons/optional.gif"; //$NON-NLS-1$
- public static final String ONEORMOREICON = "icons/oneormore.gif"; //$NON-NLS-1$
- public static final String ZEROORMOREICON = "icons/zeroormore.gif"; //$NON-NLS-1$
-
- public static final String ONESEQUENCEICON = "icons/onesequence.gif"; //$NON-NLS-1$
- public static final String OPTIONALSEQUENCEICON = "icons/optionalsequence.gif"; //$NON-NLS-1$
- public static final String ONEORMORESEQUENCEICON = "icons/oneormoresequence.gif"; //$NON-NLS-1$
- public static final String ZEROORMORESEQUENCEICON = "icons/zeroormoresequence.gif"; //$NON-NLS-1$
-
- public static final String ONECHOICEICON = "icons/onechoice.gif"; //$NON-NLS-1$
- public static final String OPTIONALCHOICEICON = "icons/optionalchoice.gif"; //$NON-NLS-1$
- public static final String ONEORMORECHOICEICON = "icons/oneormorechoice.gif"; //$NON-NLS-1$
- public static final String ZEROORMORECHOICEICON = "icons/zeroormorechoice.gif"; //$NON-NLS-1$
-
- public static final String DTDFILEICON = "icons/DTDFile.gif"; //$NON-NLS-1$
-
- public static final String NEWDTD = "icons/newdtd_wiz.gif"; //$NON-NLS-1$
- public static final String NEWHTMLFORM = "icons/genhtmform_wiz.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java
deleted file mode 100644
index c63628869b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java
+++ /dev/null
@@ -1,45 +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.dtd.core.internal.emf;
-
-public interface DTDSourceOffset {
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset();
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v);
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset();
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v);
-
-}// DTDSourceOffset
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java
deleted file mode 100644
index 7774623fb3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java
+++ /dev/null
@@ -1,31 +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.dtd.core.internal.emf;
-
-public interface DTDType extends DTDObject {
- // constant strings for dtd attribute types
- public static final String NONE = "None"; //$NON-NLS-1$
-
- public static final String CDATA = "Character Data (CDATA)"; //$NON-NLS-1$
- public static final String ID = "Identifier (ID)"; //$NON-NLS-1$
- public static final String IDREF = "ID Reference (IDREF)"; //$NON-NLS-1$
- public static final String IDREFS = "ID References (IDREFS)"; //$NON-NLS-1$
- public static final String ENTITY = "Entity Name (ENTITY)"; //$NON-NLS-1$
- public static final String ENTITIES = "Entity Names (ENTITIES)"; //$NON-NLS-1$
- public static final String NMTOKEN = "Name Token (NMTOKEN)"; //$NON-NLS-1$
- public static final String NMTOKENS = "Name Tokens (NMTOKENS)"; //$NON-NLS-1$
- public static final String ENUM_NAME_TOKEN_GROUP = "Enumerated Name Tokens"; //$NON-NLS-1$
- public static final String ENUM_NOTATION_GROUP = "Enumerated NOTATION"; //$NON-NLS-1$
-
- public String toString();
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java
deleted file mode 100644
index b0c68abbdc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java
+++ /dev/null
@@ -1,471 +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.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>XML Schema Defined Type</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- *
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getXMLSchemaDefinedType()
- * @model
- * @generated
- */
-public final class XMLSchemaDefinedType extends AbstractEnumerator {
- /**
- * The '<em><b>NONE</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #NONE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE = -1;
-
- /**
- * The '<em><b>STRING</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #STRING_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int STRING = 1;
-
- /**
- * The '<em><b>BOOLEAN</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #BOOLEAN_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int BOOLEAN = 2;
-
- /**
- * The '<em><b>FLOAT</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #FLOAT_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int FLOAT = 3;
-
- /**
- * The '<em><b>DOUBLE</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #DOUBLE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int DOUBLE = 4;
-
- /**
- * The '<em><b>DECIMAL</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #DECIMAL_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int DECIMAL = 5;
-
- /**
- * The '<em><b>TIMEINSTANT</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #TIMEINSTANT_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int TIMEINSTANT = 6;
-
- /**
- * The '<em><b>TIMEDURATION</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #TIMEDURATION_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int TIMEDURATION = 7;
-
- /**
- * The '<em><b>RECURRINGINSTANT</b></em>' literal value. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #RECURRINGINSTANT_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int RECURRINGINSTANT = 8;
-
- /**
- * The '<em><b>BINARY</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #BINARY_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int BINARY = 9;
-
- /**
- * The '<em><b>URI</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #URI_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int URI = 10;
-
- /**
- * The '<em><b>INTEGER</b></em>' literal value. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @see #INTEGER_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int INTEGER = 11;
-
- /**
- * The '<em><b>DATE</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #DATE_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int DATE = 12;
-
- /**
- * The '<em><b>TIME</b></em>' literal value. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #TIME_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int TIME = 13;
-
- /**
- * The '<em><b>NONE</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #NONE
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType NONE_LITERAL = new XMLSchemaDefinedType(NONE, "NONE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>STRING</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>STRING</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #STRING
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType STRING_LITERAL = new XMLSchemaDefinedType(STRING, "STRING"); //$NON-NLS-1$
-
- /**
- * The '<em><b>BOOLEAN</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>BOOLEAN</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #BOOLEAN
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType BOOLEAN_LITERAL = new XMLSchemaDefinedType(BOOLEAN, "BOOLEAN"); //$NON-NLS-1$
-
- /**
- * The '<em><b>FLOAT</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>FLOAT</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #FLOAT
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType FLOAT_LITERAL = new XMLSchemaDefinedType(FLOAT, "FLOAT"); //$NON-NLS-1$
-
- /**
- * The '<em><b>DOUBLE</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>DOUBLE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #DOUBLE
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType DOUBLE_LITERAL = new XMLSchemaDefinedType(DOUBLE, "DOUBLE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>DECIMAL</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>DECIMAL</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #DECIMAL
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType DECIMAL_LITERAL = new XMLSchemaDefinedType(DECIMAL, "DECIMAL"); //$NON-NLS-1$
-
- /**
- * The '<em><b>TIMEINSTANT</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIMEINSTANT</b></em>' literal object
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #TIMEINSTANT
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType TIMEINSTANT_LITERAL = new XMLSchemaDefinedType(TIMEINSTANT, "TIMEINSTANT"); //$NON-NLS-1$
-
- /**
- * The '<em><b>TIMEDURATION</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIMEDURATION</b></em>' literal object
- * isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #TIMEDURATION
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType TIMEDURATION_LITERAL = new XMLSchemaDefinedType(TIMEDURATION, "TIMEDURATION"); //$NON-NLS-1$
-
- /**
- * The '<em><b>RECURRINGINSTANT</b></em>' literal object. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>RECURRINGINSTANT</b></em>' literal
- * object isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #RECURRINGINSTANT
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType RECURRINGINSTANT_LITERAL = new XMLSchemaDefinedType(RECURRINGINSTANT, "RECURRINGINSTANT"); //$NON-NLS-1$
-
- /**
- * The '<em><b>BINARY</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>BINARY</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #BINARY
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType BINARY_LITERAL = new XMLSchemaDefinedType(BINARY, "BINARY"); //$NON-NLS-1$
-
- /**
- * The '<em><b>URI</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>URI</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #URI
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType URI_LITERAL = new XMLSchemaDefinedType(URI, "URI"); //$NON-NLS-1$
-
- /**
- * The '<em><b>INTEGER</b></em>' literal object. <!-- begin-user-doc
- * -->
- * <p>
- * If the meaning of '<em><b>INTEGER</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #INTEGER
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType INTEGER_LITERAL = new XMLSchemaDefinedType(INTEGER, "INTEGER"); //$NON-NLS-1$
-
- /**
- * The '<em><b>DATE</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DATE</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #DATE
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType DATE_LITERAL = new XMLSchemaDefinedType(DATE, "DATE"); //$NON-NLS-1$
-
- /**
- * The '<em><b>TIME</b></em>' literal object. <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIME</b></em>' literal object isn't
- * clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #TIME
- * @generated
- * @ordered
- */
- public static final XMLSchemaDefinedType TIME_LITERAL = new XMLSchemaDefinedType(TIME, "TIME"); //$NON-NLS-1$
-
- /**
- * An array of all the '<em><b>XML Schema Defined Type</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static final XMLSchemaDefinedType[] VALUES_ARRAY = new XMLSchemaDefinedType[]{NONE_LITERAL, STRING_LITERAL, BOOLEAN_LITERAL, FLOAT_LITERAL, DOUBLE_LITERAL, DECIMAL_LITERAL, TIMEINSTANT_LITERAL, TIMEDURATION_LITERAL, RECURRINGINSTANT_LITERAL, BINARY_LITERAL, URI_LITERAL, INTEGER_LITERAL, DATE_LITERAL, TIME_LITERAL,};
-
- /**
- * A public read-only list of all the '<em><b>XML Schema Defined Type</b></em>'
- * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>XML Schema Defined Type</b></em>' literal with
- * the specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static XMLSchemaDefinedType get(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- XMLSchemaDefinedType result = VALUES_ARRAY[i];
- if (result.toString().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>XML Schema Defined Type</b></em>' literal with
- * the specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static XMLSchemaDefinedType get(int value) {
- switch (value) {
- case NONE :
- return NONE_LITERAL;
- case STRING :
- return STRING_LITERAL;
- case BOOLEAN :
- return BOOLEAN_LITERAL;
- case FLOAT :
- return FLOAT_LITERAL;
- case DOUBLE :
- return DOUBLE_LITERAL;
- case DECIMAL :
- return DECIMAL_LITERAL;
- case TIMEINSTANT :
- return TIMEINSTANT_LITERAL;
- case TIMEDURATION :
- return TIMEDURATION_LITERAL;
- case RECURRINGINSTANT :
- return RECURRINGINSTANT_LITERAL;
- case BINARY :
- return BINARY_LITERAL;
- case URI :
- return URI_LITERAL;
- case INTEGER :
- return INTEGER_LITERAL;
- case DATE :
- return DATE_LITERAL;
- case TIME :
- return TIME_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private XMLSchemaDefinedType(int value, String name) {
- super(value, name);
- }
-
-} // XMLSchemaDefinedType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
deleted file mode 100644
index 3aaeb98de9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Any Content</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * </p>
- *
- * @generated
- */
-public class DTDAnyContentImpl extends DTDElementContentImpl implements DTDAnyContent {
- public String getContentName() {
- return "ANY"; //$NON-NLS-1$
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDAnyContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDAnyContent();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ANY_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ANY_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_ANY_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_ANY_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- return getElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ANY_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
- return getElement() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
deleted file mode 100644
index 89de8836c2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
+++ /dev/null
@@ -1,980 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EAttributeImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Attribute</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDefaultKind <em>Default Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDefaultValueString <em>Default Value String</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDTDElement <em>DTD Element</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDAttributeImpl extends EAttributeImpl implements DTDAttribute {
-
- public DTDAttributeImpl() {
- super();
- }
-
- public DTDType getDTDType() {
- return (DTDType) getEType();
- }
-
-
- public void setDTDType(DTDType type) {
- setEType((EClassifier) type);
- }
-
- public void setDTDBasicType(int value) {
- DTDFactoryImpl factory = (DTDFactoryImpl) DTDFactoryImpl.instance();
- // set attribute type
- switch (value) {
- case 0 :
- setDTDType(factory.getDTDBasicType_NONE());
- break;
- case 1 :
- setDTDType(factory.getDTDBasicType_CDATA());
- break;
- case 2 :
- setDTDType(factory.getDTDBasicType_ID());
- break;
- case 3 :
- setDTDType(factory.getDTDBasicType_IDREF());
- break;
- case 4 :
- setDTDType(factory.getDTDBasicType_IDREFS());
- break;
- case 5 :
- setDTDType(factory.getDTDBasicType_ENTITY());
- break;
- case 6 :
- setDTDType(factory.getDTDBasicType_ENTITIES());
- break;
- case 7 :
- setDTDType(factory.getDTDBasicType_NMTOKEN());
- break;
- case 8 :
- setDTDType(factory.getDTDBasicType_NMTOKENS());
- break;
- }
- }
-
- public String unparse() {
- StringBuffer result = new StringBuffer(128);
-
-
- result.append(getName());
-
-
- StringBuffer value = new StringBuffer();
- switch (getDefaultKind().getValue()) {
- case DTDDefaultKind.IMPLIED :
- value.append("#IMPLIED"); //$NON-NLS-1$
- break;
- case DTDDefaultKind.REQUIRED :
- value.append("#REQUIRED"); //$NON-NLS-1$
- break;
- case DTDDefaultKind.FIXED :
- String type = getDTDType().toString();
- if (!(type.equals(DTDType.ID) || type.equals(DTDType.IDREF) || type.equals(DTDType.ENUM_NAME_TOKEN_GROUP) || type.equals(DTDType.IDREFS))) {
- value.append("#FIXED \"").append(getDefaultValueString()).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- case DTDDefaultKind.NOFIXED :
- String defaultValue = getDefaultValueString();
- if (defaultValue != null)
- value.append("\"").append(defaultValue).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
-
-
- // Get the attribute type
- DTDEntity typeEnt = getAttributeTypeReferencedEntity();
- if (typeEnt != null) {
- result.append(" %" + typeEnt.getName() + "; ").append(value); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- DTDType dtdType = getDTDType();
- if (dtdType instanceof DTDBasicType) {
- switch (((DTDBasicType) dtdType).getKind().getValue()) {
- case DTDBasicTypeKind.CDATA :
- result.append(" CDATA ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.ID :
- result.append(" ID ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.IDREF :
- result.append(" IDREF ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.IDREFS :
- result.append(" IDREFS ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.ENTITY :
- result.append(" ENTITY ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.ENTITIES :
- result.append(" ENTITIES ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.NMTOKEN :
- result.append(" NMTOKEN ").append(value); //$NON-NLS-1$
- break;
- case DTDBasicTypeKind.NMTOKENS :
- result.append(" NMTOKENS ").append(value); //$NON-NLS-1$
- break;
- }
- }
- else if (dtdType instanceof DTDEnumerationType) {
- result.append(" ").append(buildEnumString((DTDEnumerationType) dtdType)).append(value); //$NON-NLS-1$
- }
- }
-
-
- return result.toString();
- }
-
-
- private String buildEnumString(DTDEnumerationType enumType) {
- String result = ""; //$NON-NLS-1$
-
-
- if (enumType.getKind().getValue() == DTDEnumGroupKind.NOTATION_GROUP)
- result += "NOTATION "; //$NON-NLS-1$
-
-
- Iterator i = enumType.getEnumLiterals().iterator();
- if (i.hasNext()) {
- result += "(" + ((EEnumLiteral) i.next()).toString(); //$NON-NLS-1$
- while (i.hasNext()) {
- result += " | " + ((EEnumLiteral) i.next()).toString(); //$NON-NLS-1$
- }
- result += ") "; //$NON-NLS-1$
- }
-
-
- return result;
- }
-
- public DTDEnumerationType createDTDEnumeration(String[] enumValues, int enumKind) {
- DTDEnumerationType enumeration = DTDFactoryImpl.instance().createDTDEnumerationType();
- // enum.setID("Enum_" + ((DTDElement)getMOFDomain()).getName() + "_" +
- // getName());
- DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
- enumeration.setKind(groupKind);
- // Enumeration values
- if (enumValues != null) {
- for (int i = 0; i < enumValues.length; i++) {
- EcorePackage ePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
- EEnumLiteral enumLiteral = ((EcoreFactory) ePackage.getEFactoryInstance()).createEEnumLiteral();
- // MOF2EMF Port
- // enumLiteral.refSetLiteral(enumValues[i]);
- enumLiteral.setName(enumValues[i]);
- // MOF2EMF Port
- // enumLiteral.refSetLiteral(i);
- enumLiteral.setValue(i);
-
- enumeration.getEnumLiterals().add(enumLiteral);
- }
- }
- getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
- return enumeration;
- }
-
- public String getPathname() {
- return null;
- // TODO: finish port
- // return DTDPathnameUtil.makePath(getDTDElement().getPathname(),
- // "Attr", getName(), -1);
- }
-
-
- public DTDObject findObject(String relativePath) {
- return null;
- // TODO: finish port
- /*
- * Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
- *
- *
- * String type = (String)result[0];
- *
- *
- * if (type == null) return null;
- *
- *
- * DTDObject obj = null; if (type.equals("Type")) { obj =
- * getDataType(); } else { return null; }
- *
- *
- * String restPath = (String)result[3];
- *
- * if ((restPath == null) || (obj == null)) { return obj; } else {
- * return obj.findObject(restPath); }
- */
- }
-
- public Collection getEnumeratedValues() {
- Collection result = new ArrayList();
-
-
- DTDType type = getDTDType();
- if (type instanceof DTDEnumerationType) {
- DTDEnumerationType enumType = (DTDEnumerationType) type;
- Iterator i = enumType.getEnumLiterals().iterator();
- while (i.hasNext()) {
- result.add(((EEnumLiteral) i.next()).toString());
- }
- }
- return result;
- }
-
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
-
- /**
- * The default value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected static final String COMMENT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected String comment = COMMENT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDefaultKind() <em>Default Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getDefaultKind()
- * @generated
- * @ordered
- */
- protected static final DTDDefaultKind DEFAULT_KIND_EDEFAULT = DTDDefaultKind.IMPLIED_LITERAL;
-
- /**
- * The cached value of the '{@link #getDefaultKind() <em>Default Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getDefaultKind()
- * @generated
- * @ordered
- */
- protected DTDDefaultKind defaultKind = DEFAULT_KIND_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDefaultValueString() <em>Default Value String</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getDefaultValueString()
- * @generated
- * @ordered
- */
- protected static final String DEFAULT_VALUE_STRING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDefaultValueString() <em>Default Value String</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getDefaultValueString()
- * @generated
- * @ordered
- */
- protected String defaultValueString = DEFAULT_VALUE_STRING_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributeNameReferencedEntity() <em>Attribute Name Referenced Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getAttributeNameReferencedEntity()
- * @generated
- * @ordered
- */
- protected DTDEntity attributeNameReferencedEntity = null;
-
- /**
- * The cached value of the '{@link #getAttributeTypeReferencedEntity() <em>Attribute Type Referenced Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getAttributeTypeReferencedEntity()
- * @generated
- * @ordered
- */
- protected DTDEntity attributeTypeReferencedEntity = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDAttribute();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setComment(String newComment) {
- String oldComment = comment;
- comment = newComment;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__COMMENT, oldComment, comment));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDDefaultKind getDefaultKind() {
- return defaultKind;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDefaultKind(DTDDefaultKind newDefaultKind) {
- DTDDefaultKind oldDefaultKind = defaultKind;
- defaultKind = newDefaultKind == null ? DEFAULT_KIND_EDEFAULT : newDefaultKind;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND, oldDefaultKind, defaultKind));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getDefaultValueString() {
- return defaultValueString;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDefaultValueString(String newDefaultValueString) {
- String oldDefaultValueString = defaultValueString;
- defaultValueString = newDefaultValueString;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING, oldDefaultValueString, defaultValueString));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity getAttributeNameReferencedEntity() {
- if (attributeNameReferencedEntity != null && attributeNameReferencedEntity.eIsProxy()) {
- DTDEntity oldAttributeNameReferencedEntity = attributeNameReferencedEntity;
- attributeNameReferencedEntity = (DTDEntity) EcoreUtil.resolve(attributeNameReferencedEntity, this);
- if (attributeNameReferencedEntity != oldAttributeNameReferencedEntity) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, oldAttributeNameReferencedEntity, attributeNameReferencedEntity));
- }
- }
- return attributeNameReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity basicGetAttributeNameReferencedEntity() {
- return attributeNameReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetAttributeNameReferencedEntity(DTDEntity newAttributeNameReferencedEntity, NotificationChain msgs) {
- DTDEntity oldAttributeNameReferencedEntity = attributeNameReferencedEntity;
- attributeNameReferencedEntity = newAttributeNameReferencedEntity;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, oldAttributeNameReferencedEntity, newAttributeNameReferencedEntity));
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setAttributeNameReferencedEntity(DTDEntity newAttributeNameReferencedEntity) {
- if (newAttributeNameReferencedEntity != attributeNameReferencedEntity) {
- NotificationChain msgs = null;
- if (attributeNameReferencedEntity != null)
- msgs = ((InternalEObject) attributeNameReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
- if (newAttributeNameReferencedEntity != null)
- msgs = ((InternalEObject) newAttributeNameReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
- msgs = basicSetAttributeNameReferencedEntity(newAttributeNameReferencedEntity, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, newAttributeNameReferencedEntity, newAttributeNameReferencedEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity getAttributeTypeReferencedEntity() {
- if (attributeTypeReferencedEntity != null && attributeTypeReferencedEntity.eIsProxy()) {
- DTDEntity oldAttributeTypeReferencedEntity = attributeTypeReferencedEntity;
- attributeTypeReferencedEntity = (DTDEntity) EcoreUtil.resolve(attributeTypeReferencedEntity, this);
- if (attributeTypeReferencedEntity != oldAttributeTypeReferencedEntity) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, oldAttributeTypeReferencedEntity, attributeTypeReferencedEntity));
- }
- }
- return attributeTypeReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity basicGetAttributeTypeReferencedEntity() {
- return attributeTypeReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetAttributeTypeReferencedEntity(DTDEntity newAttributeTypeReferencedEntity, NotificationChain msgs) {
- DTDEntity oldAttributeTypeReferencedEntity = attributeTypeReferencedEntity;
- attributeTypeReferencedEntity = newAttributeTypeReferencedEntity;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, oldAttributeTypeReferencedEntity, newAttributeTypeReferencedEntity));
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setAttributeTypeReferencedEntity(DTDEntity newAttributeTypeReferencedEntity) {
- if (newAttributeTypeReferencedEntity != attributeTypeReferencedEntity) {
- NotificationChain msgs = null;
- if (attributeTypeReferencedEntity != null)
- msgs = ((InternalEObject) attributeTypeReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
- if (newAttributeTypeReferencedEntity != null)
- msgs = ((InternalEObject) newAttributeTypeReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
- msgs = basicSetAttributeTypeReferencedEntity(newAttributeTypeReferencedEntity, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, newAttributeTypeReferencedEntity, newAttributeTypeReferencedEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDElement getDTDElement() {
- if (eContainerFeatureID() != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT)
- return null;
- return (DTDElement) eContainer;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDTDElement(DTDElement newDTDElement) {
- if (newDTDElement != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT && newDTDElement != null)) {
- if (EcoreUtil.isAncestor(this, newDTDElement))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newDTDElement != null)
- msgs = ((InternalEObject) newDTDElement).eInverseAdd(this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDElement.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newDTDElement, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, newDTDElement, newDTDElement));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- if (attributeNameReferencedEntity != null)
- msgs = ((InternalEObject) attributeNameReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
- return basicSetAttributeNameReferencedEntity((DTDEntity) otherEnd, msgs);
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- if (attributeTypeReferencedEntity != null)
- msgs = ((InternalEObject) attributeTypeReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
- return basicSetAttributeTypeReferencedEntity((DTDEntity) otherEnd, msgs);
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- return basicSetAttributeNameReferencedEntity(null, msgs);
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- return basicSetAttributeTypeReferencedEntity(null, msgs);
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- return getEAnnotations();
- case DTDPackage.DTD_ATTRIBUTE__NAME :
- return getName();
- case DTDPackage.DTD_ATTRIBUTE__ETYPE :
- if (resolve)
- return getEType();
- return basicGetEType();
- case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
- return isChangeable() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
- return isVolatile() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
- return isTransient() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
- return isUnique() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
- return getDefaultValueLiteral();
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE :
- return getDefaultValue();
- case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
- return new Integer(getLowerBound());
- case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
- return new Integer(getUpperBound());
- case DTDPackage.DTD_ATTRIBUTE__MANY :
- return isMany() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__REQUIRED :
- return isRequired() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__ECONTAINING_CLASS :
- return getEContainingClass();
- case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
- return isUnsettable() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__ID :
- return isID() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ATTRIBUTE__EATTRIBUTE_TYPE :
- if (resolve)
- return getEAttributeType();
- return basicGetEAttributeType();
- case DTDPackage.DTD_ATTRIBUTE__COMMENT :
- return getComment();
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
- return getDefaultKind();
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
- return getDefaultValueString();
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- if (resolve)
- return getAttributeNameReferencedEntity();
- return basicGetAttributeNameReferencedEntity();
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- if (resolve)
- return getAttributeTypeReferencedEntity();
- return basicGetAttributeTypeReferencedEntity();
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- return getDTDElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- getEAnnotations().clear();
- getEAnnotations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__NAME :
- setName((String) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ETYPE :
- setEType((EClassifier) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
- setChangeable(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
- setVolatile(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
- setTransient(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
- setUnique(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
- setDefaultValueLiteral((String) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
- setLowerBound(((Integer) newValue).intValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
- setUpperBound(((Integer) newValue).intValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
- setUnsettable(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__ID :
- setID(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ATTRIBUTE__COMMENT :
- setComment((String) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
- setDefaultKind((DTDDefaultKind) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
- setDefaultValueString((String) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- setAttributeNameReferencedEntity((DTDEntity) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- setAttributeTypeReferencedEntity((DTDEntity) newValue);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- setDTDElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- getEAnnotations().clear();
- return;
- case DTDPackage.DTD_ATTRIBUTE__NAME :
- setName(NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ETYPE :
- setEType((EClassifier) null);
- return;
- case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
- setChangeable(CHANGEABLE_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
- setVolatile(VOLATILE_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
- setTransient(TRANSIENT_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
- setUnique(UNIQUE_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
- setDefaultValueLiteral(DEFAULT_VALUE_LITERAL_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
- setLowerBound(LOWER_BOUND_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
- setUpperBound(UPPER_BOUND_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
- setUnsettable(UNSETTABLE_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ID :
- setID(ID_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__COMMENT :
- setComment(COMMENT_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
- setDefaultKind(DEFAULT_KIND_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
- setDefaultValueString(DEFAULT_VALUE_STRING_EDEFAULT);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- setAttributeNameReferencedEntity((DTDEntity) null);
- return;
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- setAttributeTypeReferencedEntity((DTDEntity) null);
- return;
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- setDTDElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
- return eAnnotations != null && !getEAnnotations().isEmpty();
- case DTDPackage.DTD_ATTRIBUTE__NAME :
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DTDPackage.DTD_ATTRIBUTE__ETYPE :
- return eType != null;
- case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
- return ((eFlags & CHANGEABLE_EFLAG) != 0) != CHANGEABLE_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
- return ((eFlags & VOLATILE_EFLAG) != 0) != VOLATILE_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
- return ((eFlags & TRANSIENT_EFLAG) != 0) != TRANSIENT_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
- return ((eFlags & UNIQUE_EFLAG) != 0) != UNIQUE_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
- return DEFAULT_VALUE_LITERAL_EDEFAULT == null ? defaultValueLiteral != null : !DEFAULT_VALUE_LITERAL_EDEFAULT.equals(defaultValueLiteral);
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE :
- return getDefaultValue() != null;
- case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
- return lowerBound != LOWER_BOUND_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
- return upperBound != UPPER_BOUND_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__MANY :
- return isMany() != false;
- case DTDPackage.DTD_ATTRIBUTE__REQUIRED :
- return isRequired() != false;
- case DTDPackage.DTD_ATTRIBUTE__ECONTAINING_CLASS :
- return getEContainingClass() != null;
- case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
- return ((eFlags & UNSETTABLE_EFLAG) != 0) != UNSETTABLE_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__ID :
- return ((eFlags & ID_EFLAG) != 0) != ID_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__EATTRIBUTE_TYPE :
- return basicGetEAttributeType() != null;
- case DTDPackage.DTD_ATTRIBUTE__COMMENT :
- return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
- return defaultKind != DEFAULT_KIND_EDEFAULT;
- case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
- return DEFAULT_VALUE_STRING_EDEFAULT == null ? defaultValueString != null : !DEFAULT_VALUE_STRING_EDEFAULT.equals(defaultValueString);
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
- return attributeNameReferencedEntity != null;
- case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
- return attributeTypeReferencedEntity != null;
- case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
- return getDTDElement() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (comment: "); //$NON-NLS-1$
- result.append(comment);
- result.append(", defaultKind: "); //$NON-NLS-1$
- result.append(defaultKind);
- result.append(", defaultValueString: "); //$NON-NLS-1$
- result.append(defaultValueString);
- result.append(')');
- return result.toString();
- }
-
-} // DTDAttributeImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
deleted file mode 100644
index ce289b5fc4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EClassImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Basic Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl#getKind <em>Kind</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDBasicTypeImpl extends EClassImpl implements DTDBasicType, EClass {
-
- public final static String basicTypeStrings[] = {DTDType.NONE, DTDType.CDATA, DTDType.ID, DTDType.IDREF, DTDType.IDREFS, DTDType.ENTITY, DTDType.ENTITIES, DTDType.NMTOKEN, DTDType.NMTOKENS};
-
- public final static String basicTypeDescriptions[] = {DTDCoreMessages._UI_NONE_DESC, DTDCoreMessages._UI_CHARACTER_DATA_DESC, DTDCoreMessages._UI_IDENTIFIER_DESC, DTDCoreMessages._UI_ID_REFERENCE_DESC, DTDCoreMessages._UI_ID_REFERENCES_DESC, DTDCoreMessages._UI_ENTITY_NAME_DESC, DTDCoreMessages._UI_ENTITY_NAMES_DESC, DTDCoreMessages._UI_NAME_TOKEN_DESC, DTDCoreMessages._UI_NAME_TOKENS_DESC}; //$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$
-
- public final static int basicTypeKinds[] = {DTDBasicTypeKind.NONE, DTDBasicTypeKind.CDATA, DTDBasicTypeKind.ID, DTDBasicTypeKind.IDREF, DTDBasicTypeKind.IDREFS, DTDBasicTypeKind.ENTITY, DTDBasicTypeKind.ENTITIES, DTDBasicTypeKind.NMTOKEN, DTDBasicTypeKind.NMTOKENS};
-
- public String unparse() {
- return getTypeString();
- }
-
- public String getTypeString() {
- int kind = getKind().getValue();
- if (kind >= 0 && kind < basicTypeStrings.length) {
- return basicTypeStrings[kind];
- } // end of if ()
-
- return null;
- }
-
-
- public String getTypeDescription() {
- return getTypeDescription(getKind().getValue());
- }
-
-
- public static String getTypeDescription(int typeKind) {
- if (typeKind >= 0 && typeKind < basicTypeDescriptions.length) {
- return basicTypeDescriptions[typeKind];
- }
- return null;
- }
-
- public String getPathname() {
- // TBD
- return ""; //$NON-NLS-1$
- }
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
-
-
- /**
- * The default value of the '{@link #getKind() <em>Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getKind()
- * @generated
- * @ordered
- */
- protected static final DTDBasicTypeKind KIND_EDEFAULT = DTDBasicTypeKind.NONE_LITERAL;
-
- /**
- * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getKind()
- * @generated
- * @ordered
- */
- protected DTDBasicTypeKind kind = KIND_EDEFAULT;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDBasicTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDBasicType();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDBasicTypeKind getKind() {
- return kind;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setKind(DTDBasicTypeKind newKind) {
- DTDBasicTypeKind oldKind = kind;
- kind = newKind == null ? KIND_EDEFAULT : newKind;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_BASIC_TYPE__KIND, oldKind, kind));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_BASIC_TYPE__EPACKAGE, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- return ((InternalEList) getEOperations()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
- return eBasicSetContainer(null, DTDPackage.DTD_BASIC_TYPE__EPACKAGE, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- return ((InternalEList) getEOperations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
- return ((InternalEList) getEReferences()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
- return ((InternalEList) getEAttributes()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
- return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- return getEAnnotations();
- case DTDPackage.DTD_BASIC_TYPE__NAME :
- return getName();
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
- return getInstanceClassName();
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
- return getInstanceClass();
- case DTDPackage.DTD_BASIC_TYPE__DEFAULT_VALUE :
- return getDefaultValue();
- case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
- return getEPackage();
- case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
- return isAbstract() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
- return isInterface() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
- return getESuperTypes();
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- return getEOperations();
- case DTDPackage.DTD_BASIC_TYPE__EALL_ATTRIBUTES :
- return getEAllAttributes();
- case DTDPackage.DTD_BASIC_TYPE__EALL_REFERENCES :
- return getEAllReferences();
- case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
- return getEReferences();
- case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
- return getEAttributes();
- case DTDPackage.DTD_BASIC_TYPE__EALL_CONTAINMENTS :
- return getEAllContainments();
- case DTDPackage.DTD_BASIC_TYPE__EALL_OPERATIONS :
- return getEAllOperations();
- case DTDPackage.DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES :
- return getEAllStructuralFeatures();
- case DTDPackage.DTD_BASIC_TYPE__EALL_SUPER_TYPES :
- return getEAllSuperTypes();
- case DTDPackage.DTD_BASIC_TYPE__EID_ATTRIBUTE :
- return getEIDAttribute();
- case DTDPackage.DTD_BASIC_TYPE__KIND :
- return getKind();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- getEAnnotations().clear();
- getEAnnotations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__NAME :
- setName((String) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
- setInstanceClassName((String) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
- setInstanceClass((Class) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
- setAbstract(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
- setInterface(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
- getESuperTypes().clear();
- getESuperTypes().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- getEOperations().clear();
- getEOperations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
- getEReferences().clear();
- getEReferences().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
- getEAttributes().clear();
- getEAttributes().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_BASIC_TYPE__KIND :
- setKind((DTDBasicTypeKind) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- getEAnnotations().clear();
- return;
- case DTDPackage.DTD_BASIC_TYPE__NAME :
- setName(NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
- setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
- setInstanceClass(INSTANCE_CLASS_EDEFAULT);
- return;
- case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
- setAbstract(ABSTRACT_EDEFAULT);
- return;
- case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
- setInterface(INTERFACE_EDEFAULT);
- return;
- case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
- getESuperTypes().clear();
- return;
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- getEOperations().clear();
- return;
- case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
- getEReferences().clear();
- return;
- case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
- getEAttributes().clear();
- return;
- case DTDPackage.DTD_BASIC_TYPE__KIND :
- setKind(KIND_EDEFAULT);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
- return eAnnotations != null && !getEAnnotations().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__NAME :
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
- return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
- case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
- return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
- case DTDPackage.DTD_BASIC_TYPE__DEFAULT_VALUE :
- return getDefaultValue() != null;
- case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
- return getEPackage() != null;
- case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
- return ((eFlags & ABSTRACT_EFLAG) != 0) != ABSTRACT_EDEFAULT;
- case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
- return ((eFlags & INTERFACE_EFLAG) != 0) != INTERFACE_EDEFAULT;
- case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
- return eSuperTypes != null && !getESuperTypes().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
- return eOperations != null && !getEOperations().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_ATTRIBUTES :
- return !getEAllAttributes().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_REFERENCES :
- return !getEAllReferences().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
- return eReferences != null && !getEReferences().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
- return eAttributes != null && !getEAttributes().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_CONTAINMENTS :
- return !getEAllContainments().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_OPERATIONS :
- return !getEAllOperations().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES :
- return !getEAllStructuralFeatures().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EALL_SUPER_TYPES :
- return !getEAllSuperTypes().isEmpty();
- case DTDPackage.DTD_BASIC_TYPE__EID_ATTRIBUTE :
- return getEIDAttribute() != null;
- case DTDPackage.DTD_BASIC_TYPE__KIND :
- return kind != KIND_EDEFAULT;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (kind: "); //$NON-NLS-1$
- result.append(kind);
- result.append(')');
- return result.toString();
- }
-
-} // DTDBasicTypeImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
deleted file mode 100644
index cb185d06a3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENamedElementImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-public class DTDContentImpl extends ENamedElementImpl implements DTDContent, EObject {
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDContent();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDFile getDTDFile() {
- if (eContainerFeatureID() != DTDPackage.DTD_CONTENT__DTD_FILE)
- return null;
- return (DTDFile) eContainer;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDTDFile(DTDFile newDTDFile) {
- if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_CONTENT__DTD_FILE && newDTDFile != null)) {
- if (EcoreUtil.isAncestor(this, newDTDFile))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newDTDFile != null)
- msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_CONTENT__DTD_FILE, newDTDFile, newDTDFile));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- return getDTDFile();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- return getDTDFile() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
-} // DTDContentImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
deleted file mode 100644
index b5e767cebb..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Element Content</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl#getGroup <em>Group</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl#getElement <em>Element</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public abstract class DTDElementContentImpl extends EObjectImpl implements DTDElementContent {
-
- public DTDElementContentImpl() {
- super();
- }
-
- public DTDElement getDTDElement() {
- DTDElementContent c = getDTDGroupContent();
- if (c != null)
- return c.getElement();
- else
- return getElement();
- }
-
- // get the most outer DTDGroupContent
- public DTDGroupContent getDTDGroupContent() {
- DTDElementContent c = this;
- while (c.getGroup() != null) {
- c = c.getGroup();
- }
- return ((c instanceof DTDGroupContent) ? (DTDGroupContent) c : null);
- }
-
- public String getPathname() {
- int cnt = 0;
- DTDObject parent = getGroup();
- if (parent == null) {
- parent = getElement();
- }
- else {
- DTDGroupContent group = (DTDGroupContent) parent;
- Iterator i = group.getContent().iterator();
- while (i.hasNext()) {
- DTDElementContent content = (DTDElementContent) i.next();
- if (content == this) {
- break;
- }
- if ((content instanceof DTDElementReferenceContent) || (content instanceof DTDEntityReferenceContent)) {
- continue;
- }
- cnt++;
- }
- }
- return DTDPathnameUtil.makePath(((parent == null) ? "NULL_PARENT" : parent.getPathname()), "Content", null, cnt); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
- public boolean isFirstElementContent() {
- DTDElement element = getElement();
-
- if (element != null) {
- // This means this is the only element content in the element
- return true;
- } // end of if ()
-
- DTDGroupContent group = getGroup();
- int pos = group.getContentPosition(this);
- if (pos == 0) {
- // now recurse and ensure this group is the first group
- return group.isFirstElementContent();
- } // end of if ()
- else {
- return false;
- }
- }
-
- public String getContentDetail() {
- // most times, content name is fine. However for groups,
- // we didn't want a long name to show up in the tree,
- // so we created a get contentdetail to get to the long
- // name (getContentName will get the short one.
- return getContentName();
- }
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
- /*
- * @see DTDElementContent#getContentName()
- */
- public String getContentName() {
- return null;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDElementContent();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDGroupContent getGroup() {
- if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__GROUP)
- return null;
- return (DTDGroupContent) eContainer;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setGroup(DTDGroupContent newGroup) {
- if (newGroup != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__GROUP && newGroup != null)) {
- if (EcoreUtil.isAncestor(this, newGroup))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newGroup != null)
- msgs = ((InternalEObject) newGroup).eInverseAdd(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newGroup, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, newGroup, newGroup));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDElement getElement() {
- if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT)
- return null;
- return (DTDElement) eContainer;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setElement(DTDElement newElement) {
- if (newElement != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT && newElement != null)) {
- if (EcoreUtil.isAncestor(this, newElement))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newElement != null)
- msgs = ((InternalEObject) newElement).eInverseAdd(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newElement, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, newElement, newElement));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- return getElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
- return getElement() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
-} // DTDElementContentImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
deleted file mode 100644
index adf0b93680..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
+++ /dev/null
@@ -1,654 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EClassImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDVisitor;
-
-
-/**
- * @generated
- */
-public class DTDElementImpl extends EClassImpl implements DTDElement {
- /**
- * The default value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected static final String COMMENT_EDEFAULT = null;
-
- public DTDElementImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDElement();
- }
-
- public void addDTDAttribute(DTDAttribute attribute) {
- getDTDAttribute().add(attribute);
- }
-
- public String getPathname() {
- return DTDPathnameUtil.makePath(null, "Elem", getName(), -1); //$NON-NLS-1$
- }
-
- public DTDObject findObject(String relativePath) {
- Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
- String type = (String) result[0];
-
- if (type == null)
- return null;
-
- DTDObject obj = null;
- if (type.equals("Attr")) { //$NON-NLS-1$
- // TODO: fix port
- // obj = findAttribute(name);
- }
- else if ((type.equals("Content")) || (type.equals("ElemRef")) || (type.equals("EntRef"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- obj = getContent();
- }
- else {
- return null;
- }
-
- String restPath = (String) result[3];
-
- if ((restPath == null) || (obj == null)) {
- return obj;
- }
- else {
- return obj.findObject(restPath);
- }
- }
-
- // returns all references in the same DTDFile that reference this element
- public Collection getReferences() {
- DTDFile file = getDTDFile();
- final Collection result = new ArrayList();
-
- DTDVisitor visitRefs = new DTDVisitor() {
- public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
- if (elementReferenceContent.getReferencedElement() == DTDElementImpl.this) {
- result.add(elementReferenceContent);
- } // end of if ()
- }
- };
- visitRefs.visitDTDFile(file);
- return result;
- }
-
- public String getAttributeDetail() {
- String attributeString = ""; //$NON-NLS-1$
- Collection attributes = getDTDAttribute();
- if (attributes != null) {
- boolean seenOne = false;
- for (java.util.Iterator i = attributes.iterator(); i.hasNext();) {
- if (seenOne) {
- attributeString = attributeString + ", "; //$NON-NLS-1$
- }
- else {
- seenOne = true;
- } // end of else
-
- attributeString = attributeString + ((DTDAttribute) i.next()).getName();
- }
- } // end of if ()
- return attributeString;
- }
-
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String comment = COMMENT_EDEFAULT;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDElementContent content = null;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList dtdAttribute = null;
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setComment(String newComment) {
- String oldComment = comment;
- comment = newComment;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__COMMENT, oldComment, comment));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDElementContent getContent() {
- return content;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetContent(DTDElementContent newContent, NotificationChain msgs) {
- DTDElementContent oldContent = content;
- content = newContent;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__CONTENT, oldContent, newContent));
- }
- return msgs;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setContent(DTDElementContent newContent) {
- if (newContent != content) {
- NotificationChain msgs = null;
- if (content != null)
- msgs = ((InternalEObject) content).eInverseRemove(this, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, DTDElementContent.class, msgs);
- if (newContent != null)
- msgs = ((InternalEObject) newContent).eInverseAdd(this, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, DTDElementContent.class, msgs);
- msgs = basicSetContent(newContent, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__CONTENT, newContent, newContent));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getDTDAttribute() {
- if (dtdAttribute == null) {
- dtdAttribute = new EObjectContainmentWithInverseEList(DTDAttribute.class, this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT);
- }
- return dtdAttribute;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__EPACKAGE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT__EPACKAGE, msgs);
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- return ((InternalEList) getEOperations()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
- case DTDPackage.DTD_ELEMENT__CONTENT :
- if (content != null)
- msgs = ((InternalEObject) content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTDPackage.DTD_ELEMENT__CONTENT, null, msgs);
- return basicSetContent((DTDElementContent) otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- return ((InternalEList) getDTDAttribute()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__EPACKAGE :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT__EPACKAGE, msgs);
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- return ((InternalEList) getEOperations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__EREFERENCES :
- return ((InternalEList) getEReferences()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
- return ((InternalEList) getEAttributes()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
- case DTDPackage.DTD_ELEMENT__CONTENT :
- return basicSetContent(null, msgs);
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- return ((InternalEList) getDTDAttribute()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ELEMENT__EPACKAGE :
- return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- return getEAnnotations();
- case DTDPackage.DTD_ELEMENT__NAME :
- return getName();
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
- return getInstanceClassName();
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
- return getInstanceClass();
- case DTDPackage.DTD_ELEMENT__DEFAULT_VALUE :
- return getDefaultValue();
- case DTDPackage.DTD_ELEMENT__EPACKAGE :
- return getEPackage();
- case DTDPackage.DTD_ELEMENT__ABSTRACT :
- return isAbstract() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ELEMENT__INTERFACE :
- return isInterface() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
- return getESuperTypes();
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- return getEOperations();
- case DTDPackage.DTD_ELEMENT__EALL_ATTRIBUTES :
- return getEAllAttributes();
- case DTDPackage.DTD_ELEMENT__EALL_REFERENCES :
- return getEAllReferences();
- case DTDPackage.DTD_ELEMENT__EREFERENCES :
- return getEReferences();
- case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
- return getEAttributes();
- case DTDPackage.DTD_ELEMENT__EALL_CONTAINMENTS :
- return getEAllContainments();
- case DTDPackage.DTD_ELEMENT__EALL_OPERATIONS :
- return getEAllOperations();
- case DTDPackage.DTD_ELEMENT__EALL_STRUCTURAL_FEATURES :
- return getEAllStructuralFeatures();
- case DTDPackage.DTD_ELEMENT__EALL_SUPER_TYPES :
- return getEAllSuperTypes();
- case DTDPackage.DTD_ELEMENT__EID_ATTRIBUTE :
- return getEIDAttribute();
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- return getDTDFile();
- case DTDPackage.DTD_ELEMENT__COMMENT :
- return getComment();
- case DTDPackage.DTD_ELEMENT__CONTENT :
- return getContent();
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- return getDTDAttribute();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- return eAnnotations != null && !getEAnnotations().isEmpty();
- case DTDPackage.DTD_ELEMENT__NAME :
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
- return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
- return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
- case DTDPackage.DTD_ELEMENT__DEFAULT_VALUE :
- return getDefaultValue() != null;
- case DTDPackage.DTD_ELEMENT__EPACKAGE :
- return getEPackage() != null;
- case DTDPackage.DTD_ELEMENT__ABSTRACT :
- return ((eFlags & ABSTRACT_EFLAG) != 0) != ABSTRACT_EDEFAULT;
- case DTDPackage.DTD_ELEMENT__INTERFACE :
- return ((eFlags & INTERFACE_EFLAG) != 0) != INTERFACE_EDEFAULT;
- case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
- return eSuperTypes != null && !getESuperTypes().isEmpty();
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- return eOperations != null && !getEOperations().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_ATTRIBUTES :
- return !getEAllAttributes().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_REFERENCES :
- return !getEAllReferences().isEmpty();
- case DTDPackage.DTD_ELEMENT__EREFERENCES :
- return eReferences != null && !getEReferences().isEmpty();
- case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
- return eAttributes != null && !getEAttributes().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_CONTAINMENTS :
- return !getEAllContainments().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_OPERATIONS :
- return !getEAllOperations().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_STRUCTURAL_FEATURES :
- return !getEAllStructuralFeatures().isEmpty();
- case DTDPackage.DTD_ELEMENT__EALL_SUPER_TYPES :
- return !getEAllSuperTypes().isEmpty();
- case DTDPackage.DTD_ELEMENT__EID_ATTRIBUTE :
- return getEIDAttribute() != null;
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- return getDTDFile() != null;
- case DTDPackage.DTD_ELEMENT__COMMENT :
- return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
- case DTDPackage.DTD_ELEMENT__CONTENT :
- return content != null;
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- return dtdAttribute != null && !getDTDAttribute().isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) {
- if (baseClass == DTDContent.class) {
- switch (derivedFeatureID) {
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- return DTDPackage.DTD_CONTENT__DTD_FILE;
- default :
- return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) {
- if (baseClass == DTDContent.class) {
- switch (baseFeatureID) {
- case DTDPackage.DTD_CONTENT__DTD_FILE :
- return DTDPackage.DTD_ELEMENT__DTD_FILE;
- default :
- return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (comment: "); //$NON-NLS-1$
- result.append(comment);
- result.append(')');
- return result.toString();
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- getEAnnotations().clear();
- getEAnnotations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__NAME :
- setName((String) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
- setInstanceClassName((String) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
- setInstanceClass((Class) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__ABSTRACT :
- setAbstract(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ELEMENT__INTERFACE :
- setInterface(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
- getESuperTypes().clear();
- getESuperTypes().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- getEOperations().clear();
- getEOperations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__EREFERENCES :
- getEReferences().clear();
- getEReferences().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
- getEAttributes().clear();
- getEAttributes().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__COMMENT :
- setComment((String) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__CONTENT :
- setContent((DTDElementContent) newValue);
- return;
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- getDTDAttribute().clear();
- getDTDAttribute().addAll((Collection) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
- getEAnnotations().clear();
- return;
- case DTDPackage.DTD_ELEMENT__NAME :
- setName(NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
- setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
- setInstanceClass(INSTANCE_CLASS_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__ABSTRACT :
- setAbstract(ABSTRACT_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__INTERFACE :
- setInterface(INTERFACE_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
- getESuperTypes().clear();
- return;
- case DTDPackage.DTD_ELEMENT__EOPERATIONS :
- getEOperations().clear();
- return;
- case DTDPackage.DTD_ELEMENT__EREFERENCES :
- getEReferences().clear();
- return;
- case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
- getEAttributes().clear();
- return;
- case DTDPackage.DTD_ELEMENT__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- case DTDPackage.DTD_ELEMENT__COMMENT :
- setComment(COMMENT_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT__CONTENT :
- setContent((DTDElementContent) null);
- return;
- case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
- getDTDAttribute().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public DTDFile getDTDFile() {
- if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT__DTD_FILE)
- return null;
- return (DTDFile) eContainer;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDTDFile(DTDFile newDTDFile) {
- if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT__DTD_FILE && newDTDFile != null)) {
- if (EcoreUtil.isAncestor(this, newDTDFile))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newDTDFile != null)
- msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__DTD_FILE, newDTDFile, newDTDFile));
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
deleted file mode 100644
index b81f4c4394..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDElementReferenceContentImpl extends DTDRepeatableContentImpl implements DTDElementReferenceContent {
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDElement referencedElement = null;
-
- public DTDElementReferenceContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDElementReferenceContent();
- }
-
- public String unparseRepeatableContent() {
- return getContentName();
- }
-
- public String getContentName() {
- DTDElement e = getReferencedElement();
- if (e == null)
- return ""; //$NON-NLS-1$
- return e.getName();
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDElement getReferencedElement() {
- if (referencedElement != null && referencedElement.eIsProxy()) {
- DTDElement oldReferencedElement = referencedElement;
- referencedElement = (DTDElement) EcoreUtil.resolve(referencedElement, this);
- if (referencedElement != oldReferencedElement) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT, oldReferencedElement, referencedElement));
- }
- }
- return referencedElement;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDElement basicGetReferencedElement() {
- return referencedElement;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setReferencedElement(DTDElement newReferencedElement) {
- DTDElement oldReferencedElement = referencedElement;
- referencedElement = newReferencedElement;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT, oldReferencedElement, referencedElement));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- return getElement();
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
- return getOccurrence();
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
- if (resolve)
- return getReferencedElement();
- return basicGetReferencedElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- return getElement() != null;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
- return occurrence != OCCURRENCE_EDEFAULT;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
- return referencedElement != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
- setOccurrence((DTDOccurrenceType) newValue);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
- setReferencedElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
- setOccurrence(OCCURRENCE_EDEFAULT);
- return;
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
- setReferencedElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
deleted file mode 100644
index d87ef09dd3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-/**
- * @generated
- */
-public class DTDEmptyContentImpl extends DTDElementContentImpl implements DTDEmptyContent {
-
- public DTDEmptyContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDEmptyContent();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_EMPTY_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_EMPTY_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_EMPTY_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_EMPTY_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- return getElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
- return getElement() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- public String getContentName() {
- return "EMPTY"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
deleted file mode 100644
index 2bf7ee02ac..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-/**
- * @generated
- */
-public abstract class DTDEntityContentImpl extends EObjectImpl implements DTDEntityContent {
-
- public DTDEntityContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDEntityContent();
- }
-
- public String getPathname() {
- return DTDPathnameUtil.makePath(getDTDEntity().getPathname(), "Content", null, -1); //$NON-NLS-1$
- }
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDEntity getDTDEntity() {
- if (eContainerFeatureID() != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY)
- return null;
- return (DTDEntity) eContainer;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDTDEntity(DTDEntity newDTDEntity) {
- if (newDTDEntity != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY && newDTDEntity != null)) {
- if (EcoreUtil.isAncestor(this, newDTDEntity))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newDTDEntity != null)
- msgs = ((InternalEObject) newDTDEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newDTDEntity, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, newDTDEntity, newDTDEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- return getDTDEntity();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- return getDTDEntity() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- setDTDEntity((DTDEntity) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
- setDTDEntity((DTDEntity) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /*
- * @see DTDEntityContent#unparse()
- */
- public String unparse() {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
deleted file mode 100644
index 11d0742387..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Entity</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#isParameterEntity <em>Parameter Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getParmEntityRef <em>Parm Entity Ref</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getEntityReference <em>Entity Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getAttributeNameReference <em>Attribute Name Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getAttributeTypeReference <em>Attribute Type Reference</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDEntityImpl extends DTDContentImpl implements DTDEntity, ENamedElement, DTDContent {
-
- public String getPathname() {
- return DTDPathnameUtil.makePath(null, "Ent", getName(), -1); //$NON-NLS-1$
- }
-
-
- public DTDObject findObject(String relativePath) {
- Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
-
- String type = (String) result[0];
-
-
- if (type == null)
- return null;
-
-
- DTDObject obj = null;
- if (type.equals("Content")) { //$NON-NLS-1$
- obj = getContent();
- }
- else {
- return null;
- }
-
-
- String restPath = (String) result[3];
-
- if ((restPath == null) || (obj == null)) {
- return obj;
- }
- else {
- return obj.findObject(restPath);
- }
- }
-
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
-
-
- /**
- * The default value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected static final String COMMENT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected String comment = COMMENT_EDEFAULT;
-
- /**
- * The default value of the '{@link #isParameterEntity() <em>Parameter Entity</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #isParameterEntity()
- * @generated
- * @ordered
- */
- protected static final boolean PARAMETER_ENTITY_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isParameterEntity() <em>Parameter Entity</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #isParameterEntity()
- * @generated
- * @ordered
- */
- protected boolean parameterEntity = PARAMETER_ENTITY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getContent() <em>Content</em>}'
- * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getContent()
- * @generated
- * @ordered
- */
- protected DTDEntityContent content = null;
-
- /**
- * The cached value of the '{@link #getParmEntityRef() <em>Parm Entity Ref</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getParmEntityRef()
- * @generated
- * @ordered
- */
- protected DTDParameterEntityReference parmEntityRef = null;
-
- /**
- * The cached value of the '{@link #getEntityReference() <em>Entity Reference</em>}'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getEntityReference()
- * @generated
- * @ordered
- */
- protected EList entityReference = null;
-
- /**
- * The cached value of the '{@link #getAttributeNameReference() <em>Attribute Name Reference</em>}'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getAttributeNameReference()
- * @generated
- * @ordered
- */
- protected EList attributeNameReference = null;
-
- /**
- * The cached value of the '{@link #getAttributeTypeReference() <em>Attribute Type Reference</em>}'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getAttributeTypeReference()
- * @generated
- * @ordered
- */
- protected EList attributeTypeReference = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDEntityImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDEntity();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setComment(String newComment) {
- String oldComment = comment;
- comment = newComment;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__COMMENT, oldComment, comment));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean isParameterEntity() {
- return parameterEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setParameterEntity(boolean newParameterEntity) {
- boolean oldParameterEntity = parameterEntity;
- parameterEntity = newParameterEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARAMETER_ENTITY, oldParameterEntity, parameterEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntityContent getContent() {
- return content;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetContent(DTDEntityContent newContent, NotificationChain msgs) {
- DTDEntityContent oldContent = content;
- content = newContent;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__CONTENT, oldContent, newContent));
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setContent(DTDEntityContent newContent) {
- if (newContent != content) {
- NotificationChain msgs = null;
- if (content != null)
- msgs = ((InternalEObject) content).eInverseRemove(this, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, DTDEntityContent.class, msgs);
- if (newContent != null)
- msgs = ((InternalEObject) newContent).eInverseAdd(this, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, DTDEntityContent.class, msgs);
- msgs = basicSetContent(newContent, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__CONTENT, newContent, newContent));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDParameterEntityReference getParmEntityRef() {
- if (parmEntityRef != null && parmEntityRef.eIsProxy()) {
- DTDParameterEntityReference oldParmEntityRef = parmEntityRef;
- parmEntityRef = (DTDParameterEntityReference) EcoreUtil.resolve(parmEntityRef, this);
- if (parmEntityRef != oldParmEntityRef) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, oldParmEntityRef, parmEntityRef));
- }
- }
- return parmEntityRef;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDParameterEntityReference basicGetParmEntityRef() {
- return parmEntityRef;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetParmEntityRef(DTDParameterEntityReference newParmEntityRef, NotificationChain msgs) {
- DTDParameterEntityReference oldParmEntityRef = parmEntityRef;
- parmEntityRef = newParmEntityRef;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, oldParmEntityRef, newParmEntityRef));
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setParmEntityRef(DTDParameterEntityReference newParmEntityRef) {
- if (newParmEntityRef != parmEntityRef) {
- NotificationChain msgs = null;
- if (parmEntityRef != null)
- msgs = ((InternalEObject) parmEntityRef).eInverseRemove(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
- if (newParmEntityRef != null)
- msgs = ((InternalEObject) newParmEntityRef).eInverseAdd(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
- msgs = basicSetParmEntityRef(newParmEntityRef, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, newParmEntityRef, newParmEntityRef));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getEntityReference() {
- if (entityReference == null) {
- entityReference = new EObjectWithInverseResolvingEList(DTDEntityReferenceContent.class, this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY);
- }
- return entityReference;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getAttributeNameReference() {
- if (attributeNameReference == null) {
- attributeNameReference = new EObjectWithInverseResolvingEList(DTDAttribute.class, this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY);
- }
- return attributeNameReference;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getAttributeTypeReference() {
- if (attributeTypeReference == null) {
- attributeTypeReference = new EObjectWithInverseResolvingEList(DTDAttribute.class, this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY);
- }
- return attributeTypeReference;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY__DTD_FILE, msgs);
- case DTDPackage.DTD_ENTITY__CONTENT :
- if (content != null)
- msgs = ((InternalEObject) content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTDPackage.DTD_ENTITY__CONTENT, null, msgs);
- return basicSetContent((DTDEntityContent) otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- if (parmEntityRef != null)
- msgs = ((InternalEObject) parmEntityRef).eInverseRemove(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
- return basicSetParmEntityRef((DTDParameterEntityReference) otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- return ((InternalEList) getEntityReference()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- return ((InternalEList) getAttributeNameReference()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- return ((InternalEList) getAttributeTypeReference()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_ENTITY__DTD_FILE, msgs);
- case DTDPackage.DTD_ENTITY__CONTENT :
- return basicSetContent(null, msgs);
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- return basicSetParmEntityRef(null, msgs);
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- return ((InternalEList) getEntityReference()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- return ((InternalEList) getAttributeNameReference()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- return ((InternalEList) getAttributeTypeReference()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- return getDTDFile();
- case DTDPackage.DTD_ENTITY__COMMENT :
- return getComment();
- case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
- return isParameterEntity() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ENTITY__CONTENT :
- return getContent();
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- if (resolve)
- return getParmEntityRef();
- return basicGetParmEntityRef();
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- return getEntityReference();
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- return getAttributeNameReference();
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- return getAttributeTypeReference();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- case DTDPackage.DTD_ENTITY__COMMENT :
- setComment((String) newValue);
- return;
- case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
- setParameterEntity(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ENTITY__CONTENT :
- setContent((DTDEntityContent) newValue);
- return;
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- setParmEntityRef((DTDParameterEntityReference) newValue);
- return;
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- getEntityReference().clear();
- getEntityReference().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- getAttributeNameReference().clear();
- getAttributeNameReference().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- getAttributeTypeReference().clear();
- getAttributeTypeReference().addAll((Collection) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- case DTDPackage.DTD_ENTITY__COMMENT :
- setComment(COMMENT_EDEFAULT);
- return;
- case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
- setParameterEntity(PARAMETER_ENTITY_EDEFAULT);
- return;
- case DTDPackage.DTD_ENTITY__CONTENT :
- setContent((DTDEntityContent) null);
- return;
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- setParmEntityRef((DTDParameterEntityReference) null);
- return;
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- getEntityReference().clear();
- return;
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- getAttributeNameReference().clear();
- return;
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- getAttributeTypeReference().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY__DTD_FILE :
- return getDTDFile() != null;
- case DTDPackage.DTD_ENTITY__COMMENT :
- return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
- case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
- return parameterEntity != PARAMETER_ENTITY_EDEFAULT;
- case DTDPackage.DTD_ENTITY__CONTENT :
- return content != null;
- case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
- return parmEntityRef != null;
- case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
- return entityReference != null && !getEntityReference().isEmpty();
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
- return attributeNameReference != null && !getAttributeNameReference().isEmpty();
- case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
- return attributeTypeReference != null && !getAttributeTypeReference().isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (comment: "); //$NON-NLS-1$
- result.append(comment);
- result.append(", parameterEntity: "); //$NON-NLS-1$
- result.append(parameterEntity);
- result.append(')');
- return result.toString();
- }
-
-} // DTDEntityImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDEntityImpl extends ENamespaceImpl implements DTDEntity,
-// ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected Boolean parameterEntity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDEntityContent content = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDParameterEntityReference parmEntityRef = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList entityReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList attributeNameReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList attributeTypeReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParameterEntity = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setContent = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParmEntityRef = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDEntity());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDEntity() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDEntity();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDEntity_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDEntity_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDEntity_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public Boolean getParameterEntity() {
-// if (this.setParameterEntity) return this.parameterEntity;
-// else return
-// (Boolean)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public boolean isParameterEntity() {
-// Boolean result = getParameterEntity();
-// return result != null ? result.booleanValue() : false;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParameterEntity(Boolean value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),this.parameterEntity,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParameterEntity(boolean value) {
-// setParameterEntity(value?Boolean.TRUE:Boolean.FALSE);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParameterEntity() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParameterEntity() {
-// return setParameterEntity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDEntityContent getContent() {
-// try {
-// if (this.content == null) return null;
-// this.content = (DTDEntityContent)
-// ((InternalEObject)this.content).resolve(this);
-// if (this.content==null) this.setContent = false;
-// return this.content;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setContent(DTDEntityContent l) {
-// refSetValueForRefObjectSF(DTDPackage.eINSTANCE.getDTDEntity_Content(),this.content,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetContent() {
-// refUnsetValueForRefObjectSF(DTDPackage.eINSTANCE.getDTDEntity_Content(),this.content);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetContent() {
-// return setContent;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDParameterEntityReference getParmEntityRef() {
-// try {
-// if (this.parmEntityRef == null) return null;
-// this.parmEntityRef = (DTDParameterEntityReference)
-// ((InternalEObject)this.parmEntityRef).resolve(this,
-// DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef());
-// if (this.parmEntityRef==null) this.setParmEntityRef = false;
-// return this.parmEntityRef;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParmEntityRef(DTDParameterEntityReference l) {
-// refSetValueForSVReference(DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),this.parmEntityRef,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParmEntityRef() {
-// refUnsetValueForSVReference(DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),this.parmEntityRef);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParmEntityRef() {
-// return setParmEntityRef;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getEntityReference() {
-// if (this.entityReference==null) {
-// this.entityReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_EntityReference(),
-// true);
-// }
-// return this.entityReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getAttributeNameReference() {
-// if (this.attributeNameReference==null) {
-// this.attributeNameReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_AttributeNameReference(),
-// true);
-// }
-// return this.attributeNameReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getAttributeTypeReference() {
-// if (this.attributeTypeReference==null) {
-// this.attributeTypeReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_AttributeTypeReference(),
-// true);
-// }
-// return this.attributeTypeReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: return getComment();
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: return getParameterEntity();
-// case DTDPackage.DTD_ENTITY__CONTENT: return getContent();
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: return getParmEntityRef();
-// case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE: return getEntityReference();
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE: return
-// getAttributeNameReference();
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE: return
-// getAttributeTypeReference();
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return getDTDFile();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY:
-// return this.setParameterEntity? this.parameterEntity : null;
-// case DTDPackage.DTD_ENTITY__CONTENT:
-// if (!this.setContent||this.content==null) return null;
-// if (((InternalEObject)this.content).refIsDeleted()) {this.content=null;
-// this.setContent=false;}
-// return this.content;
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF:
-// if (!this.setParmEntityRef||this.parmEntityRef==null) return null;
-// if (((InternalEObject)this.parmEntityRef).refIsDeleted())
-// {this.parmEntityRef=null; this.setParmEntityRef=false;}
-// return this.parmEntityRef;
-// case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE:
-// return this.entityReference;
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE:
-// return this.attributeNameReference;
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE:
-// return this.attributeTypeReference;
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: return isSetComment();
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: return
-// isSetParameterEntity();
-// case DTDPackage.DTD_ENTITY__CONTENT: return isSetContent();
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: return isSetParmEntityRef();
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return isSetDTDFile();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// setParameterEntity((newValue instanceof
-// String)?Boolean.valueOf((String)newValue):(Boolean)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// setContent((DTDEntityContent)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// setParmEntityRef((DTDParameterEntityReference)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// Object oldValue = this.parameterEntity;
-// this.parameterEntity = (Boolean)newValue;
-// this.setParameterEntity = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// Object oldValue = this.content;
-// this.content = (DTDEntityContent)newValue;
-// this.setContent = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Content(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// Object oldValue = this.parmEntityRef;
-// this.parmEntityRef = (DTDParameterEntityReference)newValue;
-// this.setParmEntityRef = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// unsetParameterEntity();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// unsetContent();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// unsetParmEntityRef();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// Object oldValue = this.parameterEntity;
-// this.parameterEntity = null;
-// this.setParameterEntity = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),oldValue,getParameterEntity());
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// Object oldValue = this.content;
-// this.content = null;
-// this.setContent = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Content(),oldValue,null);
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// Object oldValue = this.parmEntityRef;
-// this.parmEntityRef = null;
-// this.setParmEntityRef = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),oldValue,null);
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
deleted file mode 100644
index 51fde41059..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDEntityReferenceContentImpl extends DTDRepeatableContentImpl implements DTDEntityReferenceContent {
-
- public DTDEntityReferenceContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDEntityReferenceContent();
- }
-
- public String getContentName() {
- DTDEntity e = getElementReferencedEntity();
- if (e == null)
- return ""; //$NON-NLS-1$
- return e.getName();
- }
-
- public String unparseRepeatableContent() {
- DTDEntity entityRef = getElementReferencedEntity();
- if (entityRef.isParameterEntity()) {
- return "%" + getContentName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- return "&" + getContentName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDEntity elementReferencedEntity = null;
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDEntity getElementReferencedEntity() {
- if (elementReferencedEntity != null && elementReferencedEntity.eIsProxy()) {
- DTDEntity oldElementReferencedEntity = elementReferencedEntity;
- elementReferencedEntity = (DTDEntity) EcoreUtil.resolve(elementReferencedEntity, this);
- if (elementReferencedEntity != oldElementReferencedEntity) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, oldElementReferencedEntity, elementReferencedEntity));
- }
- }
- return elementReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity basicGetElementReferencedEntity() {
- return elementReferencedEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetElementReferencedEntity(DTDEntity newElementReferencedEntity, NotificationChain msgs) {
- DTDEntity oldElementReferencedEntity = elementReferencedEntity;
- elementReferencedEntity = newElementReferencedEntity;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, oldElementReferencedEntity, newElementReferencedEntity));
- }
- return msgs;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setElementReferencedEntity(DTDEntity newElementReferencedEntity) {
- if (newElementReferencedEntity != elementReferencedEntity) {
- NotificationChain msgs = null;
- if (elementReferencedEntity != null)
- msgs = ((InternalEObject) elementReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
- if (newElementReferencedEntity != null)
- msgs = ((InternalEObject) newElementReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
- msgs = basicSetElementReferencedEntity(newElementReferencedEntity, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, newElementReferencedEntity, newElementReferencedEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT, msgs);
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- if (elementReferencedEntity != null)
- msgs = ((InternalEObject) elementReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
- return basicSetElementReferencedEntity((DTDEntity) otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT, msgs);
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- return basicSetElementReferencedEntity(null, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- return getElement();
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
- return getOccurrence();
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- if (resolve)
- return getElementReferencedEntity();
- return basicGetElementReferencedEntity();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- return getElement() != null;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
- return occurrence != OCCURRENCE_EDEFAULT;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- return elementReferencedEntity != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
- setOccurrence((DTDOccurrenceType) newValue);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- setElementReferencedEntity((DTDEntity) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
- setOccurrence(OCCURRENCE_EDEFAULT);
- return;
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
- setElementReferencedEntity((DTDEntity) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
deleted file mode 100644
index 8e604b988d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EEnumImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDEnumerationTypeImpl extends EEnumImpl implements DTDEnumerationType {
- /**
- * The default value of the '{@link #getKind() <em>Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getKind()
- * @generated
- * @ordered
- */
- protected static final DTDEnumGroupKind KIND_EDEFAULT = DTDEnumGroupKind.NAME_TOKEN_GROUP_LITERAL;
-
- public final static String enumerationTypeDescriptions[] = {DTDCoreMessages._UI_ENUM_NAME_TOKENS_DESC, DTDCoreMessages._UI_ENUM_NOTATION_DESC}; //$NON-NLS-1$ //$NON-NLS-2$
-
- public final static int enumerationTypeKinds[] = {DTDEnumGroupKind.NAME_TOKEN_GROUP, DTDEnumGroupKind.NOTATION_GROUP};
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDEnumGroupKind kind = KIND_EDEFAULT;
-
- public DTDEnumerationTypeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDEnumerationType();
- }
-
- public EList getEnumLiterals() {
- return getELiterals();
- }
-
- public String getEnumerationTypeDescription() {
- return getEnumerationTypeDescription(getKind().getValue());
- }
-
- public static String getEnumerationTypeDescription(int kind) {
- // it can only be 1 or 2, but maybe later...
- if (kind >= 1 && kind <= 2) {
- // we subtract 1 since the kind is 1 - based not zero based
- return enumerationTypeDescriptions[kind - 1];
- }
- return null;
- }
-
- public String getPathname() {
- // TBD
- return ""; //$NON-NLS-1$
- }
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDEnumGroupKind getKind() {
- return kind;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setKind(DTDEnumGroupKind newKind) {
- DTDEnumGroupKind oldKind = kind;
- kind = newKind == null ? KIND_EDEFAULT : newKind;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENUMERATION_TYPE__KIND, oldKind, kind));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDFile getDTDFile() {
- if (eContainerFeatureID() != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE)
- return null;
- return (DTDFile) eContainer;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDTDFile(DTDFile newDTDFile) {
- if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE && newDTDFile != null)) {
- if (EcoreUtil.isAncestor(this, newDTDFile))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newDTDFile != null)
- msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDFile.class, msgs);
- msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, newDTDFile, newDTDFile));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- return ((InternalEList) getELiterals()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
- return eBasicSetContainer(null, DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- return ((InternalEList) getELiterals()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
- return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- return getEAnnotations();
- case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
- return getName();
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
- return getInstanceClassName();
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
- return getInstanceClass();
- case DTDPackage.DTD_ENUMERATION_TYPE__DEFAULT_VALUE :
- return getDefaultValue();
- case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
- return getEPackage();
- case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
- return isSerializable() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- return getELiterals();
- case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
- return getKind();
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- return getDTDFile();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- return eAnnotations != null && !getEAnnotations().isEmpty();
- case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
- return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
- return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
- case DTDPackage.DTD_ENUMERATION_TYPE__DEFAULT_VALUE :
- return getDefaultValue() != null;
- case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
- return getEPackage() != null;
- case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
- return ((eFlags & SERIALIZABLE_EFLAG) != 0) != SERIALIZABLE_EDEFAULT;
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- return eLiterals != null && !getELiterals().isEmpty();
- case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
- return kind != KIND_EDEFAULT;
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- return getDTDFile() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- getEAnnotations().clear();
- getEAnnotations().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
- setName((String) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
- setInstanceClassName((String) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
- setInstanceClass((Class) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
- setSerializable(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- getELiterals().clear();
- getELiterals().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
- setKind((DTDEnumGroupKind) newValue);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
- getEAnnotations().clear();
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
- setName(NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
- setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
- setInstanceClass(INSTANCE_CLASS_EDEFAULT);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
- setSerializable(SERIALIZABLE_EDEFAULT);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
- getELiterals().clear();
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
- setKind(KIND_EDEFAULT);
- return;
- case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (kind: "); //$NON-NLS-1$
- result.append(kind);
- result.append(')');
- return result.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
deleted file mode 100644
index 69bd4c49bc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDExternalEntityImpl extends DTDEntityContentImpl implements DTDExternalEntity {
- /**
- * The default value of the '{@link #getSystemID() <em>System ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getSystemID()
- * @generated
- * @ordered
- */
- protected static final String SYSTEM_ID_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String systemID = SYSTEM_ID_EDEFAULT;
- /**
- * The default value of the '{@link #getPublicID() <em>Public ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getPublicID()
- * @generated
- * @ordered
- */
- protected static final String PUBLIC_ID_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String publicID = PUBLIC_ID_EDEFAULT;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDNotation notation = null;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDFile entityReferencedFromAnotherFile = null;
-
- public DTDExternalEntityImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDExternalEntity();
- }
-
- public String unparse() {
- StringBuffer text = new StringBuffer(100);
- if (getPublicID() == null || getPublicID().equals("")) { //$NON-NLS-1$
- text.append("SYSTEM "); //$NON-NLS-1$
- }
- else {
- text.append("PUBLIC \"").append(getPublicID()).append("\" "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String systemId = getSystemID();
-
- text.append("\"").append(systemId).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-
- DTDNotation notation = getNotation();
- if (notation != null)
- text.append(" NDATA ").append(notation.getName()); //$NON-NLS-1$
-
- return text.toString();
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getSystemID() {
- return systemID;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setSystemID(String newSystemID) {
- String oldSystemID = systemID;
- systemID = newSystemID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID, oldSystemID, systemID));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getPublicID() {
- return publicID;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setPublicID(String newPublicID) {
- String oldPublicID = publicID;
- publicID = newPublicID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID, oldPublicID, publicID));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDNotation getNotation() {
- if (notation != null && notation.eIsProxy()) {
- DTDNotation oldNotation = notation;
- notation = (DTDNotation) EcoreUtil.resolve(notation, this);
- if (notation != oldNotation) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, oldNotation, notation));
- }
- }
- return notation;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDNotation basicGetNotation() {
- return notation;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetNotation(DTDNotation newNotation, NotificationChain msgs) {
- DTDNotation oldNotation = notation;
- notation = newNotation;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, oldNotation, newNotation));
- }
- return msgs;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setNotation(DTDNotation newNotation) {
- if (newNotation != notation) {
- NotificationChain msgs = null;
- if (notation != null)
- msgs = ((InternalEObject) notation).eInverseRemove(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
- if (newNotation != null)
- msgs = ((InternalEObject) newNotation).eInverseAdd(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
- msgs = basicSetNotation(newNotation, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, newNotation, newNotation));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDFile getEntityReferencedFromAnotherFile() {
- if (entityReferencedFromAnotherFile != null && entityReferencedFromAnotherFile.eIsProxy()) {
- DTDFile oldEntityReferencedFromAnotherFile = entityReferencedFromAnotherFile;
- entityReferencedFromAnotherFile = (DTDFile) EcoreUtil.resolve(entityReferencedFromAnotherFile, this);
- if (entityReferencedFromAnotherFile != oldEntityReferencedFromAnotherFile) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE, oldEntityReferencedFromAnotherFile, entityReferencedFromAnotherFile));
- }
- }
- return entityReferencedFromAnotherFile;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDFile basicGetEntityReferencedFromAnotherFile() {
- return entityReferencedFromAnotherFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setEntityReferencedFromAnotherFile(DTDFile newEntityReferencedFromAnotherFile) {
- DTDFile oldEntityReferencedFromAnotherFile = entityReferencedFromAnotherFile;
- entityReferencedFromAnotherFile = newEntityReferencedFromAnotherFile;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE, oldEntityReferencedFromAnotherFile, entityReferencedFromAnotherFile));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY, msgs);
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- if (notation != null)
- msgs = ((InternalEObject) notation).eInverseRemove(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
- return basicSetNotation((DTDNotation) otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- return eBasicSetContainer(null, DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY, msgs);
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- return basicSetNotation(null, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- return getDTDEntity();
- case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
- return getSystemID();
- case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
- return getPublicID();
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- if (resolve)
- return getNotation();
- return basicGetNotation();
- case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
- if (resolve)
- return getEntityReferencedFromAnotherFile();
- return basicGetEntityReferencedFromAnotherFile();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- return getDTDEntity() != null;
- case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
- return SYSTEM_ID_EDEFAULT == null ? systemID != null : !SYSTEM_ID_EDEFAULT.equals(systemID);
- case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
- return PUBLIC_ID_EDEFAULT == null ? publicID != null : !PUBLIC_ID_EDEFAULT.equals(publicID);
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- return notation != null;
- case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
- return entityReferencedFromAnotherFile != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- setDTDEntity((DTDEntity) newValue);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
- setSystemID((String) newValue);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
- setPublicID((String) newValue);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- setNotation((DTDNotation) newValue);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
- setEntityReferencedFromAnotherFile((DTDFile) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
- setDTDEntity((DTDEntity) null);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
- setSystemID(SYSTEM_ID_EDEFAULT);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
- setPublicID(PUBLIC_ID_EDEFAULT);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
- setNotation((DTDNotation) null);
- return;
- case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
- setEntityReferencedFromAnotherFile((DTDFile) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (systemID: "); //$NON-NLS-1$
- result.append(systemID);
- result.append(", publicID: "); //$NON-NLS-1$
- result.append(publicID);
- result.append(')');
- return result.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java
deleted file mode 100644
index a2defc4d33..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java
+++ /dev/null
@@ -1,448 +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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType;
-
-/**
- * @generated
- */
-public class DTDFactoryImpl extends EFactoryImpl implements DTDFactory {
- protected DTDBasicType dtdBasicType_NONE;
- protected DTDBasicType dtdBasicType_CDATA;
- protected DTDBasicType dtdBasicType_ID;
- protected DTDBasicType dtdBasicType_IDREF;
- protected DTDBasicType dtdBasicType_IDREFS;
- protected DTDBasicType dtdBasicType_ENTITY;
- protected DTDBasicType dtdBasicType_ENTITIES;
- protected DTDBasicType dtdBasicType_NMTOKEN;
- protected DTDBasicType dtdBasicType_NMTOKENS;
-
-
-
- public static DTDFactory instance() {
- return (DTDFactory) getPackage().getEFactoryInstance();
- }
-
- /**
- * Gets the dtdBasicType_NONE.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_NONE() {
- if (dtdBasicType_NONE == null) {
- (dtdBasicType_NONE = createDTDBasicType()).setKind(DTDBasicTypeKind.CDATA_LITERAL);
- }
- return dtdBasicType_NONE;
- }
-
- /**
- * Gets the dtdBasicType_CDATA.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_CDATA() {
- if (dtdBasicType_CDATA == null) {
- (dtdBasicType_CDATA = createDTDBasicType()).setKind(DTDBasicTypeKind.CDATA_LITERAL);
- }
- return dtdBasicType_CDATA;
- }
-
- /**
- * Gets the dtdBasicType_ID.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_ID() {
- if (dtdBasicType_ID == null) {
- (dtdBasicType_ID = createDTDBasicType()).setKind(DTDBasicTypeKind.ID_LITERAL);
- }
- return dtdBasicType_ID;
- }
-
- /**
- * Gets the dtdBasicType_IDREF.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_IDREF() {
- if (dtdBasicType_IDREF == null) {
- (dtdBasicType_IDREF = createDTDBasicType()).setKind(DTDBasicTypeKind.IDREF_LITERAL);
- }
- return dtdBasicType_IDREF;
- }
-
- /**
- * Gets the dtdBasicType_IDREFS.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_IDREFS() {
- if (dtdBasicType_IDREFS == null) {
- (dtdBasicType_IDREFS = createDTDBasicType()).setKind(DTDBasicTypeKind.IDREFS_LITERAL);
- }
- return dtdBasicType_IDREFS;
- }
-
- /**
- * Gets the dtdBasicType_ENTITY.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_ENTITY() {
- if (dtdBasicType_ENTITY == null) {
- (dtdBasicType_ENTITY = createDTDBasicType()).setKind(DTDBasicTypeKind.ENTITY_LITERAL);
- }
- return dtdBasicType_ENTITY;
- }
-
- /**
- * Gets the dtdBasicType_ENTITIES.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_ENTITIES() {
- if (dtdBasicType_ENTITIES == null) {
- (dtdBasicType_ENTITIES = createDTDBasicType()).setKind(DTDBasicTypeKind.ENTITIES_LITERAL);
- }
- return dtdBasicType_ENTITIES;
- }
-
- /**
- * Gets the dtdBasicType_NMTOKEN.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_NMTOKEN() {
- if (dtdBasicType_NMTOKEN == null) {
- (dtdBasicType_NMTOKEN = createDTDBasicType()).setKind(DTDBasicTypeKind.NMTOKEN_LITERAL);
- }
- return dtdBasicType_NMTOKEN;
- }
-
- /**
- * Gets the dtdBasicType_NMTOKENS.
- *
- * @return Returns a DTDType
- */
- public DTDType getDTDBasicType_NMTOKENS() {
- if (dtdBasicType_NMTOKENS == null) {
- (dtdBasicType_NMTOKENS = createDTDBasicType()).setKind(DTDBasicTypeKind.NMTOKENS_LITERAL);
- }
- return dtdBasicType_NMTOKENS;
- }
-
- /**
- * Creates and instance of the factory. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- public DTDFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case DTDPackage.DTD_GROUP_CONTENT :
- return createDTDGroupContent();
- case DTDPackage.DTD_ATTRIBUTE :
- return createDTDAttribute();
- case DTDPackage.DTD_ELEMENT :
- return createDTDElement();
- case DTDPackage.DTD_EMPTY_CONTENT :
- return createDTDEmptyContent();
- case DTDPackage.DTD_ANY_CONTENT :
- return createDTDAnyContent();
- case DTDPackage.DTD_PC_DATA_CONTENT :
- return createDTDPCDataContent();
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT :
- return createDTDElementReferenceContent();
- case DTDPackage.DTD_FILE :
- return createDTDFile();
- case DTDPackage.DTD_BASIC_TYPE :
- return createDTDBasicType();
- case DTDPackage.DTD_ENUMERATION_TYPE :
- return createDTDEnumerationType();
- case DTDPackage.DTD_NOTATION :
- return createDTDNotation();
- case DTDPackage.DTD_ENTITY :
- return createDTDEntity();
- case DTDPackage.DTD_EXTERNAL_ENTITY :
- return createDTDExternalEntity();
- case DTDPackage.DTD_INTERNAL_ENTITY :
- return createDTDInternalEntity();
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE :
- return createDTDParameterEntityReference();
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT :
- return createDTDEntityReferenceContent();
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case DTDPackage.DTD_OCCURRENCE_TYPE :
- return DTDOccurrenceType.get(initialValue);
- case DTDPackage.DTD_DEFAULT_KIND :
- return DTDDefaultKind.get(initialValue);
- case DTDPackage.DTD_BASIC_TYPE_KIND :
- return DTDBasicTypeKind.get(initialValue);
- case DTDPackage.DTD_ENUM_GROUP_KIND :
- return DTDEnumGroupKind.get(initialValue);
- case DTDPackage.DTD_GROUP_KIND :
- return DTDGroupKind.get(initialValue);
- case DTDPackage.XML_SCHEMA_DEFINED_TYPE :
- return XMLSchemaDefinedType.get(initialValue);
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case DTDPackage.DTD_OCCURRENCE_TYPE :
- return instanceValue == null ? null : instanceValue.toString();
- case DTDPackage.DTD_DEFAULT_KIND :
- return instanceValue == null ? null : instanceValue.toString();
- case DTDPackage.DTD_BASIC_TYPE_KIND :
- return instanceValue == null ? null : instanceValue.toString();
- case DTDPackage.DTD_ENUM_GROUP_KIND :
- return instanceValue == null ? null : instanceValue.toString();
- case DTDPackage.DTD_GROUP_KIND :
- return instanceValue == null ? null : instanceValue.toString();
- case DTDPackage.XML_SCHEMA_DEFINED_TYPE :
- return instanceValue == null ? null : instanceValue.toString();
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDGroupContent createDTDGroupContent() {
- DTDGroupContentImpl dtdGroupContent = new DTDGroupContentImpl();
- return dtdGroupContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDAttribute createDTDAttribute() {
- DTDAttributeImpl dtdAttribute = new DTDAttributeImpl();
- return dtdAttribute;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDElement createDTDElement() {
- DTDElementImpl dtdElement = new DTDElementImpl();
- return dtdElement;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEmptyContent createDTDEmptyContent() {
- DTDEmptyContentImpl dtdEmptyContent = new DTDEmptyContentImpl();
- return dtdEmptyContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDAnyContent createDTDAnyContent() {
- DTDAnyContentImpl dtdAnyContent = new DTDAnyContentImpl();
- return dtdAnyContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDPCDataContent createDTDPCDataContent() {
- DTDPCDataContentImpl dtdpcDataContent = new DTDPCDataContentImpl();
- return dtdpcDataContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDElementReferenceContent createDTDElementReferenceContent() {
- DTDElementReferenceContentImpl dtdElementReferenceContent = new DTDElementReferenceContentImpl();
- return dtdElementReferenceContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDFile createDTDFile() {
- DTDFileImpl dtdFile = new DTDFileImpl();
- return dtdFile;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDBasicType createDTDBasicType() {
- DTDBasicTypeImpl dtdBasicType = new DTDBasicTypeImpl();
- return dtdBasicType;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEnumerationType createDTDEnumerationType() {
- DTDEnumerationTypeImpl dtdEnumerationType = new DTDEnumerationTypeImpl();
- return dtdEnumerationType;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDNotation createDTDNotation() {
- DTDNotationImpl dtdNotation = new DTDNotationImpl();
- return dtdNotation;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity createDTDEntity() {
- DTDEntityImpl dtdEntity = new DTDEntityImpl();
- return dtdEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDExternalEntity createDTDExternalEntity() {
- DTDExternalEntityImpl dtdExternalEntity = new DTDExternalEntityImpl();
- return dtdExternalEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDInternalEntity createDTDInternalEntity() {
- DTDInternalEntityImpl dtdInternalEntity = new DTDInternalEntityImpl();
- return dtdInternalEntity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDParameterEntityReference createDTDParameterEntityReference() {
- DTDParameterEntityReferenceImpl dtdParameterEntityReference = new DTDParameterEntityReferenceImpl();
- return dtdParameterEntityReference;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntityReferenceContent createDTDEntityReferenceContent() {
- DTDEntityReferenceContentImpl dtdEntityReferenceContent = new DTDEntityReferenceContentImpl();
- return dtdEntityReferenceContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDPackage getDTDPackage() {
- return (DTDPackage) getEPackage();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DTDPackage getPackage() {
- return DTDPackage.eINSTANCE;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java
deleted file mode 100644
index 0c846dc606..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java
+++ /dev/null
@@ -1,821 +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.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENamedElementImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPrinter;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>File</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#isParseError <em>Parse Error</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getDTDContent <em>DTD Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getDTDEnumerationType <em>DTD Enumeration Type</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDFileImpl extends ENamedElementImpl implements DTDFile, ENamedElement {
-
- public EList getDTDObject() {
- return getDTDContent();
- }
-
-
- public List listDTDElement() {
- return getContentListOf(DTDElement.class, null);
- }
-
-
- public List listDTDNotation() {
- return getContentListOf(DTDNotation.class, null);
- }
-
- public List listDTDEntity() {
- return getContentListOf(DTDEntity.class, null);
- }
-
- public List listDTDParameterEntityReference() {
- return getContentListOf(DTDParameterEntityReference.class, null);
- }
-
- public List listDTDElementAndDTDParameterEntityReference() {
- return getContentListOf(DTDElement.class, DTDParameterEntityReference.class);
- }
-
- private List getContentListOf(Class class1, Class class2) {
- List v = new ArrayList();
- Iterator i = getDTDContent().iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (class1.isInstance(obj)) {
- v.add(obj);
- }
- else if ((class2 != null) && (class2.isInstance(obj))) {
- v.add(obj);
- }
- }
- return v;
- }
-
- public DTDElement findElement(String name) {
- for (Iterator i = listDTDElement().iterator(); i.hasNext();) {
- DTDElement e = (DTDElement) i.next();
- if (e.getName().equals(name)) {
- return e;
- }
- }
- return null;
- }
-
- public DTDEntity findEntity(String name) {
- for (Iterator i = listDTDEntity().iterator(); i.hasNext();) {
- DTDEntity e = (DTDEntity) i.next();
- if (e.getName().equals(name)) {
- return e;
- }
- }
- return null;
- }
-
- public DTDNotation findNotation(String name) {
- for (Iterator i = listDTDNotation().iterator(); i.hasNext();) {
- DTDNotation e = (DTDNotation) i.next();
- if (e.getName().equals(name)) {
- return e;
- }
- }
- return null;
- }
-
- public DTDParameterEntityReference findParameterEntityReference(String name) {
- for (Iterator i = listDTDParameterEntityReference().iterator(); i.hasNext();) {
- DTDParameterEntityReference e = (DTDParameterEntityReference) i.next();
- if (e.getName().equals(name)) {
- return e;
- }
- }
- return null;
- }
-
- public String unparse(boolean include) {
- DTDPrinter printer = new DTDPrinter(true);
- printer.visitDTDFile(this);
- return printer.getBuffer().toString();
- }
-
-
- public String getPathname() {
- return ""; //$NON-NLS-1$
- }
-
-
- public DTDObject findObject(String relativePath) {
- Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
-
- String type = (String) result[0];
-
-
- if (type == null)
- return null;
-
-
- String name = (String) result[1];
-
- DTDObject obj = null;
- if (type.equals("Elem")) { //$NON-NLS-1$
- obj = findElement(name);
- }
- else if (type.equals("Ent")) { //$NON-NLS-1$
- obj = findEntity(name);
- }
- else if (type.equals("PEnt")) { //$NON-NLS-1$
- obj = findParameterEntityReference(name);
- }
- else if (type.equals("Nota")) { //$NON-NLS-1$
- obj = findNotation(name);
- }
- else {
- return null;
- }
-
-
- String restPath = (String) result[3];
-
- if ((restPath == null) || (obj == null)) {
- return obj;
- }
- else {
- return obj.findObject(restPath);
- }
- }
-
-
-
- /**
- * The default value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected static final String COMMENT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected String comment = COMMENT_EDEFAULT;
-
- /**
- * The default value of the '{@link #isParseError() <em>Parse Error</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #isParseError()
- * @generated
- * @ordered
- */
- protected static final boolean PARSE_ERROR_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isParseError() <em>Parse Error</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #isParseError()
- * @generated
- * @ordered
- */
- protected boolean parseError = PARSE_ERROR_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getDTDContent() <em>DTD Content</em>}'
- * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @see #getDTDContent()
- * @generated
- * @ordered
- */
- protected EList dtdContent = null;
-
- /**
- * The cached value of the '{@link #getDTDEnumerationType() <em>DTD Enumeration Type</em>}'
- * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @see #getDTDEnumerationType()
- * @generated
- * @ordered
- */
- protected EList dtdEnumerationType = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDFile();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setComment(String newComment) {
- String oldComment = comment;
- comment = newComment;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_FILE__COMMENT, oldComment, comment));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean isParseError() {
- return parseError;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setParseError(boolean newParseError) {
- boolean oldParseError = parseError;
- parseError = newParseError;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_FILE__PARSE_ERROR, oldParseError, parseError));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getDTDContent() {
- if (dtdContent == null) {
- dtdContent = new EObjectContainmentWithInverseEList(DTDContent.class, this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDPackage.DTD_CONTENT__DTD_FILE);
- }
- return dtdContent;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getDTDEnumerationType() {
- if (dtdEnumerationType == null) {
- dtdEnumerationType = new EObjectContainmentWithInverseEList(DTDEnumerationType.class, this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE);
- }
- return dtdEnumerationType;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- return ((InternalEList) getDTDContent()).basicAdd(otherEnd, msgs);
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- return ((InternalEList) getDTDEnumerationType()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- return ((InternalEList) getDTDContent()).basicRemove(otherEnd, msgs);
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- return ((InternalEList) getDTDEnumerationType()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_FILE__COMMENT :
- return getComment();
- case DTDPackage.DTD_FILE__PARSE_ERROR :
- return isParseError() ? Boolean.TRUE : Boolean.FALSE;
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- return getDTDContent();
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- return getDTDEnumerationType();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_FILE__COMMENT :
- setComment((String) newValue);
- return;
- case DTDPackage.DTD_FILE__PARSE_ERROR :
- setParseError(((Boolean) newValue).booleanValue());
- return;
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- getDTDContent().clear();
- getDTDContent().addAll((Collection) newValue);
- return;
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- getDTDEnumerationType().clear();
- getDTDEnumerationType().addAll((Collection) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_FILE__COMMENT :
- setComment(COMMENT_EDEFAULT);
- return;
- case DTDPackage.DTD_FILE__PARSE_ERROR :
- setParseError(PARSE_ERROR_EDEFAULT);
- return;
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- getDTDContent().clear();
- return;
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- getDTDEnumerationType().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_FILE__COMMENT :
- return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
- case DTDPackage.DTD_FILE__PARSE_ERROR :
- return parseError != PARSE_ERROR_EDEFAULT;
- case DTDPackage.DTD_FILE__DTD_CONTENT :
- return dtdContent != null && !getDTDContent().isEmpty();
- case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
- return dtdEnumerationType != null && !getDTDEnumerationType().isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (comment: "); //$NON-NLS-1$
- result.append(comment);
- result.append(", parseError: "); //$NON-NLS-1$
- result.append(parseError);
- result.append(')');
- return result.toString();
- }
-
-} // DTDFileImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDFileImpl extends ENamespaceImpl implements DTDFile,
-// ENamespace{
-// -------------------GENERICRULES.JSED-------------------
-
-// public static final String copyright = "(c) Copyright IBM Corporation
-// 2002.";
-//
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected Boolean parseError = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList dtdContent = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList dtdEnumerationType = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParseError = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDFile());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDFile() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDFile_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDFile_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDFile_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public Boolean getParseError() {
-// if (this.setParseError) return this.parseError;
-// else return
-// (Boolean)DTDPackage.eINSTANCE.getDTDFile_ParseError().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public boolean isParseError() {
-// Boolean result = getParseError();
-// return result != null ? result.booleanValue() : false;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParseError(Boolean value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDFile_ParseError(),this.parseError,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParseError(boolean value) {
-// setParseError(value?Boolean.TRUE:Boolean.FALSE);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParseError() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDFile_ParseError()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParseError() {
-// return setParseError;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getDTDContent() {
-// if (this.dtdContent==null) {
-// this.dtdContent=newCollection(this,DTDPackage.eINSTANCE.getDTDFile_DTDContent(),
-// true);
-// }
-// return this.dtdContent;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getDTDEnumerationType() {
-// if (this.dtdEnumerationType==null) {
-// this.dtdEnumerationType=newCollection(this,DTDPackage.eINSTANCE.getDTDFile_DTDEnumerationType(),
-// true);
-// }
-// return this.dtdEnumerationType;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: return getComment();
-// case DTDPackage.DTD_FILE__PARSE_ERROR: return getParseError();
-// case DTDPackage.DTD_FILE__DTD_CONTENT: return getDTDContent();
-// case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE: return
-// getDTDEnumerationType();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_FILE__PARSE_ERROR:
-// return this.setParseError? this.parseError : null;
-// case DTDPackage.DTD_FILE__DTD_CONTENT:
-// return this.dtdContent;
-// case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE:
-// return this.dtdEnumerationType;
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: return isSetComment();
-// case DTDPackage.DTD_FILE__PARSE_ERROR: return isSetParseError();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// setParseError((newValue instanceof
-// String)?Boolean.valueOf((String)newValue):(Boolean)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// Object oldValue = this.parseError;
-// this.parseError = (Boolean)newValue;
-// this.setParseError = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_ParseError(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// unsetParseError();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// Object oldValue = this.parseError;
-// this.parseError = null;
-// this.setParseError = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_ParseError(),oldValue,getParseError());
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public String toString() {
-// String out="("; //$NON-NLS-2$//$NON-NLS-1$
-// boolean first=true;
-// boolean emptyList=true;
-// if(isSetComment()) {
-// if(!emptyList) out+=", "; //$NON-NLS-2$//$NON-NLS-1$
-// out+="comment: "+this.comment; //$NON-NLS-2$//$NON-NLS-1$
-// first=false;
-// emptyList=false;
-// }
-// if(isSetParseError()) {
-// if(!emptyList) out+=", "; //$NON-NLS-2$//$NON-NLS-1$
-// out+="parseError: "+this.parseError; //$NON-NLS-2$//$NON-NLS-1$
-// first=false;
-// emptyList=false;
-// }
-// out+=")";
-// if (!first) return super.toString() + " " +out; //$NON-NLS-2$//$NON-NLS-1$
-// return super.toString();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
deleted file mode 100644
index b2a823693d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPrinter;
-
-
-/**
- * @generated
- */
-public class DTDGroupContentImpl extends DTDRepeatableContentImpl implements DTDGroupContent {
- /**
- * The default value of the '{@link #getGroupKind() <em>Group Kind</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getGroupKind()
- * @generated
- * @ordered
- */
- protected static final DTDGroupKind GROUP_KIND_EDEFAULT = DTDGroupKind.SEQUENCE_LITERAL;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDGroupKind groupKind = GROUP_KIND_EDEFAULT;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList content = null;
-
- public DTDGroupContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDGroupContent();
- }
-
- public int getContentPosition(DTDElementContent content) {
- EList list = getContent();
- return list.indexOf(content);
- }
-
- public String getContentName() {
- return ""; //$NON-NLS-1$
- }
-
- public String getContentDetail() {
- DTDPrinter printer = new DTDPrinter(false);
- printer.visitDTDGroupContent(this);
-
- return printer.getBuffer().toString();
- }
-
- public String unparseRepeatableContent() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public DTDGroupKind getGroupKind() {
- return groupKind;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setGroupKind(DTDGroupKind newGroupKind) {
- DTDGroupKind oldGroupKind = groupKind;
- groupKind = newGroupKind == null ? GROUP_KIND_EDEFAULT : newGroupKind;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND, oldGroupKind, groupKind));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getContent() {
- if (content == null) {
- content = new EObjectContainmentWithInverseEList(DTDElementContent.class, this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDPackage.DTD_ELEMENT_CONTENT__GROUP);
- }
- return content;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_GROUP_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_GROUP_CONTENT__ELEMENT, msgs);
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- return ((InternalEList) getContent()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_GROUP_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_GROUP_CONTENT__ELEMENT, msgs);
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- return ((InternalEList) getContent()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- return getElement();
- case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
- return getOccurrence();
- case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
- return getGroupKind();
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- return getContent();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- return getElement() != null;
- case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
- return occurrence != OCCURRENCE_EDEFAULT;
- case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
- return groupKind != GROUP_KIND_EDEFAULT;
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- return content != null && !getContent().isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
- setOccurrence((DTDOccurrenceType) newValue);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
- setGroupKind((DTDGroupKind) newValue);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- getContent().clear();
- getContent().addAll((Collection) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_GROUP_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
- setOccurrence(OCCURRENCE_EDEFAULT);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
- setGroupKind(GROUP_KIND_EDEFAULT);
- return;
- case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
- getContent().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (groupKind: "); //$NON-NLS-1$
- result.append(groupKind);
- result.append(')');
- return result.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java
deleted file mode 100644
index 4ddeeb03e6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java
+++ /dev/null
@@ -1,88 +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.dtd.core.internal.emf.impl;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-
-public class DTDIdHelper {
- public DTDIdHelper() {
- }
-
- public String computeContentId(DTDElementContent content) {
- String id = ""; //$NON-NLS-1$
- if (content instanceof DTDEmptyContent) {
- id = "#EMPTY"; //$NON-NLS-1$
- }
- else if (content instanceof DTDPCDataContent) {
- id = "#PCDATA"; //$NON-NLS-1$
- }
- else if (content instanceof DTDEmptyContent) {
- id = "#EMPTY"; //$NON-NLS-1$
- }
- else if (content instanceof DTDElementReferenceContent) {
- id = "#" + ((DTDElementReferenceContent) content).getReferencedElement().getName(); //$NON-NLS-1$
- }
- else if (content instanceof DTDEntityReferenceContent) {
- id = "#" + ((DTDEntityReferenceContent) content).getElementReferencedEntity().getName(); //$NON-NLS-1$
- }
- else if (content instanceof DTDGroupContent) {
- id = computeGroupId((DTDGroupContent) content);
- }
- return id;
- }
-
- public String computeGroupId(DTDGroupContent grp) {
- String groupId = "_"; //$NON-NLS-1$
- return groupId;
- }
-
- /**
- * @generated
- */
- protected String computeContentIdGen(DTDElementContent content) {
-
- String id = ""; //$NON-NLS-1$
- if (content instanceof DTDEmptyContent) {
- id = "#EMPTY"; //$NON-NLS-1$
- }
- else if (content instanceof DTDPCDataContent) {
- id = "#PCDATA"; //$NON-NLS-1$
- }
- else if (content instanceof DTDEmptyContent) {
- id = "#EMPTY"; //$NON-NLS-1$
- }
- else if (content instanceof DTDElementReferenceContent) {
- id = "#" + ((DTDElementReferenceContent) content).getReferencedElement().getName(); //$NON-NLS-1$
- }
- else if (content instanceof DTDEntityReferenceContent) {
- id = "#" + ((DTDEntityReferenceContent) content).getElementReferencedEntity().getName(); //$NON-NLS-1$
- }
- else if (content instanceof DTDGroupContent) {
- id = computeGroupId((DTDGroupContent) content);
- }
- return id;
- }
-
- /**
- * @generated
- */
- protected String computeGroupIdGen(DTDGroupContent grp) {
-
- String groupId = "_"; //$NON-NLS-1$
- return groupId;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
deleted file mode 100644
index 1e36173073..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDInternalEntityImpl extends DTDEntityContentImpl implements DTDInternalEntity {
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String value = VALUE_EDEFAULT;
-
- public DTDInternalEntityImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDInternalEntity();
- }
-
- public String unparse() {
- StringBuffer sb = new StringBuffer(64);
- if (getValue() == null)
- sb.append("\"\""); //$NON-NLS-1$
- else {
- sb.append("\"").append(replaceDoubleQuotes(getValue())).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return sb.toString();
- }
-
- // this method replaces any occurrence of ' " ' with the equivalent value
- // of &#34;
- private String replaceDoubleQuotes(String input) {
- StringBuffer newValue = new StringBuffer();
-
- StringCharacterIterator characters = new StringCharacterIterator(input);
-
- while (characters.current() != CharacterIterator.DONE) {
- char current = characters.current();
-
- if (current == '"') {
- newValue.append("&#34;"); //$NON-NLS-1$
- }
- else {
- newValue.append(current);
- }
- characters.next();
- }
-
- return newValue.toString();
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_INTERNAL_ENTITY__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- return eBasicSetContainer(null, DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- return getDTDEntity();
- case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
- return getValue();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- return getDTDEntity() != null;
- case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- setDTDEntity((DTDEntity) newValue);
- return;
- case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
- setValue((String) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
- setDTDEntity((DTDEntity) null);
- return;
- case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
- setValue(VALUE_EDEFAULT);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: "); //$NON-NLS-1$
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
deleted file mode 100644
index b4374cc611..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
+++ /dev/null
@@ -1,904 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Notation</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDNotationImpl extends DTDContentImpl implements DTDNotation, DTDContent {
-
- public String getPathname() {
- return DTDPathnameUtil.makePath(null, "Nota", getName(), -1); //$NON-NLS-1$
- }
-
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
- /**
- * The default value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected static final String COMMENT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComment() <em>Comment</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getComment()
- * @generated
- * @ordered
- */
- protected String comment = COMMENT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSystemID() <em>System ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getSystemID()
- * @generated
- * @ordered
- */
- protected static final String SYSTEM_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSystemID() <em>System ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getSystemID()
- * @generated
- * @ordered
- */
- protected String systemID = SYSTEM_ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPublicID() <em>Public ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getPublicID()
- * @generated
- * @ordered
- */
- protected static final String PUBLIC_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPublicID() <em>Public ID</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getPublicID()
- * @generated
- * @ordered
- */
- protected String publicID = PUBLIC_ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntity() <em>Entity</em>}'
- * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getEntity()
- * @generated
- * @ordered
- */
- protected EList entity = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDNotationImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDNotation();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setComment(String newComment) {
- String oldComment = comment;
- comment = newComment;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__COMMENT, oldComment, comment));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getSystemID() {
- return systemID;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setSystemID(String newSystemID) {
- String oldSystemID = systemID;
- systemID = newSystemID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__SYSTEM_ID, oldSystemID, systemID));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getPublicID() {
- return publicID;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setPublicID(String newPublicID) {
- String oldPublicID = publicID;
- publicID = newPublicID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__PUBLIC_ID, oldPublicID, publicID));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList getEntity() {
- if (entity == null) {
- entity = new EObjectWithInverseResolvingEList(DTDExternalEntity.class, this, DTDPackage.DTD_NOTATION__ENTITY, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION);
- }
- return entity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_NOTATION__DTD_FILE, msgs);
- case DTDPackage.DTD_NOTATION__ENTITY :
- return ((InternalEList) getEntity()).basicAdd(otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_NOTATION__DTD_FILE, msgs);
- case DTDPackage.DTD_NOTATION__ENTITY :
- return ((InternalEList) getEntity()).basicRemove(otherEnd, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- return getDTDFile();
- case DTDPackage.DTD_NOTATION__COMMENT :
- return getComment();
- case DTDPackage.DTD_NOTATION__SYSTEM_ID :
- return getSystemID();
- case DTDPackage.DTD_NOTATION__PUBLIC_ID :
- return getPublicID();
- case DTDPackage.DTD_NOTATION__ENTITY :
- return getEntity();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- case DTDPackage.DTD_NOTATION__COMMENT :
- setComment((String) newValue);
- return;
- case DTDPackage.DTD_NOTATION__SYSTEM_ID :
- setSystemID((String) newValue);
- return;
- case DTDPackage.DTD_NOTATION__PUBLIC_ID :
- setPublicID((String) newValue);
- return;
- case DTDPackage.DTD_NOTATION__ENTITY :
- getEntity().clear();
- getEntity().addAll((Collection) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- case DTDPackage.DTD_NOTATION__COMMENT :
- setComment(COMMENT_EDEFAULT);
- return;
- case DTDPackage.DTD_NOTATION__SYSTEM_ID :
- setSystemID(SYSTEM_ID_EDEFAULT);
- return;
- case DTDPackage.DTD_NOTATION__PUBLIC_ID :
- setPublicID(PUBLIC_ID_EDEFAULT);
- return;
- case DTDPackage.DTD_NOTATION__ENTITY :
- getEntity().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_NOTATION__DTD_FILE :
- return getDTDFile() != null;
- case DTDPackage.DTD_NOTATION__COMMENT :
- return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
- case DTDPackage.DTD_NOTATION__SYSTEM_ID :
- return SYSTEM_ID_EDEFAULT == null ? systemID != null : !SYSTEM_ID_EDEFAULT.equals(systemID);
- case DTDPackage.DTD_NOTATION__PUBLIC_ID :
- return PUBLIC_ID_EDEFAULT == null ? publicID != null : !PUBLIC_ID_EDEFAULT.equals(publicID);
- case DTDPackage.DTD_NOTATION__ENTITY :
- return entity != null && !getEntity().isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (comment: "); //$NON-NLS-1$
- result.append(comment);
- result.append(", systemID: "); //$NON-NLS-1$
- result.append(systemID);
- result.append(", publicID: "); //$NON-NLS-1$
- result.append(publicID);
- result.append(')');
- return result.toString();
- }
-
-} // DTDNotationImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDNotationImpl extends ENamespaceImpl implements
-// DTDNotation, ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// public static final String copyright = "(c) Copyright IBM Corporation
-// 2002.";
-//
-// public DTDNotationImpl()
-// {
-// super();
-// }
-// public String getPathname()
-// {
-// return DTDPathnameUtil.makePath(null, "Nota", getName(), -1);
-// }
-//
-// public DTDObject findObject(String relativePath)
-// {
-// return null;
-// }
-//
-// // ugly hack for now since we don't have multiple inheritance.
-// // Would rather have all this stuff in a base class but these
-// // classes are inheriting from sometimes different mof classes
-// DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String systemID = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String publicID = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList entity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setSystemID = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setPublicID = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-// /**
-// * Get the value of startOffset.
-// * @return value of startOffset.
-// */
-// public int getStartOffset()
-// {
-// return lexInfo.getStartOffset();
-// }
-//
-// /**
-// * Set the value of startOffset.
-// * @param v Value to assign to startOffset.
-// */
-// public void setStartOffset(int v)
-// {
-// lexInfo.setStartOffset(v);
-// }
-//
-// /**
-// * Get the value of endOffset.
-// * @return value of endOffset.
-// */
-// public int getEndOffset()
-// {
-// return lexInfo.getEndOffset();
-// }
-//
-// /**
-// * Set the value of endOffset.
-// * @param v Value to assign to endOffset.
-// */
-// public void setEndOffset(int v)
-// {
-// lexInfo.setEndOffset(v);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDNotation());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDNotation() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDNotation();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getSystemID() {
-// if (this.setSystemID) return this.systemID;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_SystemID().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setSystemID(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_SystemID(),this.systemID,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetSystemID() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_SystemID()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetSystemID() {
-// return setSystemID;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getPublicID() {
-// if (this.setPublicID) return this.publicID;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_PublicID().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setPublicID(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_PublicID(),this.publicID,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetPublicID() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_PublicID()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetPublicID() {
-// return setPublicID;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getEntity() {
-// if (this.entity==null) {
-// this.entity=newCollection(this,DTDPackage.eINSTANCE.getDTDNotation_Entity(),
-// true);
-// }
-// return this.entity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: return getComment();
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: return getSystemID();
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: return getPublicID();
-// case DTDPackage.DTD_NOTATION__ENTITY: return getEntity();
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return getDTDFile();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID:
-// return this.setSystemID? this.systemID : null;
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID:
-// return this.setPublicID? this.publicID : null;
-// case DTDPackage.DTD_NOTATION__ENTITY:
-// return this.entity;
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: return isSetComment();
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: return isSetSystemID();
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: return isSetPublicID();
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return isSetDTDFile();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// setSystemID((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// setPublicID((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// Object oldValue = this.systemID;
-// this.systemID = (String)newValue;
-// this.setSystemID = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_SystemID(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// Object oldValue = this.publicID;
-// this.publicID = (String)newValue;
-// this.setPublicID = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_PublicID(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// unsetSystemID();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// unsetPublicID();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// Object oldValue = this.systemID;
-// this.systemID = null;
-// this.setSystemID = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_SystemID(),oldValue,getSystemID());
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// Object oldValue = this.publicID;
-// this.publicID = null;
-// this.setPublicID = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_PublicID(),oldValue,getPublicID());
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
deleted file mode 100644
index 16aedaf85a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-/**
- * @generated
- */
-public class DTDPCDataContentImpl extends DTDElementContentImpl implements DTDPCDataContent {
-
- public DTDPCDataContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDPCDataContent();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_PC_DATA_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_PC_DATA_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- return getElement();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
- return getElement() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- public String getContentName() {
- return "#PCDATA"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java
deleted file mode 100644
index 5ab1d2b0fa..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java
+++ /dev/null
@@ -1,1215 +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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.impl.EcorePackageImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType;
-
-
-/**
- * @lastgen class DTDPackageImpl extends EPackageImpl implements DTDPackage,
- * EPackage {}
- */
-public class DTDPackageImpl extends EPackageImpl implements DTDPackage {
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdElementContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdGroupContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdAttributeEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdElementEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdEmptyContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdAnyContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdpcDataContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdElementReferenceContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdRepeatableContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdBasicTypeEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdEnumerationTypeEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdNotationEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdEntityEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdEntityContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdExternalEntityEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdInternalEntityEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdParameterEntityReferenceEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdEntityReferenceContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass dtdContentEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum dtdOccurrenceTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum dtdDefaultKindEEnum = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum dtdBasicTypeKindEEnum = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum dtdEnumGroupKindEEnum = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum dtdGroupKindEEnum = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum xmlSchemaDefinedTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by
- * the package package URI value.
- * <p>
- * Note: the correct way to create the package is via the static factory
- * method {@link #init init()}, which also performs initialization of the
- * package, or returns the registered package, if one already exists. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private DTDPackageImpl() {
- super(eNS_URI, DTDFactory.eINSTANCE);
- }
-
- // public DTDPackageImpl()
- // {
- // super(eNS_URI);
- // initializePackage(null);
- // }
-
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model,
- * and for any others upon which it depends. Simple dependencies are
- * satisfied by calling this method on all dependent packages before doing
- * anything else. This method drives initialization for interdependent
- * packages directly, in parallel with this package, itself.
- * <p>
- * Of this package and its interdependencies, all packages which have not
- * yet been registered by their URI values are first created and
- * registered. The packages are then initialized in two steps: meta-model
- * objects for all of the packages are created before any are initialized,
- * since one package's meta-model objects may refer to those of another.
- * <p>
- * Invocation of this method will not affect any packages that have
- * already been initialized. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static DTDPackage init() {
- // Obtain or create and register package and interdependencies
- DTDPackageImpl theDTDPackage = (DTDPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DTDPackageImpl());
- EcorePackageImpl theEcorePackage = (EcorePackageImpl) (EPackage.Registry.INSTANCE.get(EcorePackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(EcorePackage.eNS_URI) : EcorePackage.eINSTANCE);
-
- // Step 1: create meta-model objects
- theDTDPackage.createPackageContents();
- theEcorePackage.createPackageContents();
-
- // Step 2: complete initialization
- theDTDPackage.initializePackageContents();
- theEcorePackage.initializePackageContents();
-
- return theDTDPackage;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDElementContent() {
- return dtdElementContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDElementContent_Group() {
- return (EReference) dtdElementContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDElementContent_Element() {
- return (EReference) dtdElementContentEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDGroupContent() {
- return dtdGroupContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDGroupContent_GroupKind() {
- return (EAttribute) dtdGroupContentEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDGroupContent_Content() {
- return (EReference) dtdGroupContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDAttribute() {
- return dtdAttributeEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDAttribute_Comment() {
- return (EAttribute) dtdAttributeEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDAttribute_DefaultKind() {
- return (EAttribute) dtdAttributeEClass.getEAttributes().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDAttribute_DefaultValueString() {
- return (EAttribute) dtdAttributeEClass.getEAttributes().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDAttribute_AttributeNameReferencedEntity() {
- return (EReference) dtdAttributeEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDAttribute_AttributeTypeReferencedEntity() {
- return (EReference) dtdAttributeEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDAttribute_DTDElement() {
- return (EReference) dtdAttributeEClass.getEReferences().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDElement() {
- return dtdElementEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDElement_Comment() {
- return (EAttribute) dtdElementEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDElement_Content() {
- return (EReference) dtdElementEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDElement_DTDAttribute() {
- return (EReference) dtdElementEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDEmptyContent() {
- return dtdEmptyContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDAnyContent() {
- return dtdAnyContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDPCDataContent() {
- return dtdpcDataContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDElementReferenceContent() {
- return dtdElementReferenceContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDElementReferenceContent_ReferencedElement() {
- return (EReference) dtdElementReferenceContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDRepeatableContent() {
- return dtdRepeatableContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDRepeatableContent_Occurrence() {
- return (EAttribute) dtdRepeatableContentEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDFile() {
- return dtdFileEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDFile_Comment() {
- return (EAttribute) dtdFileEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDFile_ParseError() {
- return (EAttribute) dtdFileEClass.getEAttributes().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDFile_DTDContent() {
- return (EReference) dtdFileEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDFile_DTDEnumerationType() {
- return (EReference) dtdFileEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDBasicType() {
- return dtdBasicTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDBasicType_Kind() {
- return (EAttribute) dtdBasicTypeEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDEnumerationType() {
- return dtdEnumerationTypeEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDEnumerationType_Kind() {
- return (EAttribute) dtdEnumerationTypeEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEnumerationType_DTDFile() {
- return (EReference) dtdEnumerationTypeEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDNotation() {
- return dtdNotationEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDNotation_Comment() {
- return (EAttribute) dtdNotationEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDNotation_SystemID() {
- return (EAttribute) dtdNotationEClass.getEAttributes().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDNotation_PublicID() {
- return (EAttribute) dtdNotationEClass.getEAttributes().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDNotation_Entity() {
- return (EReference) dtdNotationEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDEntity() {
- return dtdEntityEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDEntity_Comment() {
- return (EAttribute) dtdEntityEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDEntity_ParameterEntity() {
- return (EAttribute) dtdEntityEClass.getEAttributes().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntity_Content() {
- return (EReference) dtdEntityEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntity_ParmEntityRef() {
- return (EReference) dtdEntityEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntity_EntityReference() {
- return (EReference) dtdEntityEClass.getEReferences().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntity_AttributeNameReference() {
- return (EReference) dtdEntityEClass.getEReferences().get(3);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntity_AttributeTypeReference() {
- return (EReference) dtdEntityEClass.getEReferences().get(4);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDEntityContent() {
- return dtdEntityContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntityContent_DTDEntity() {
- return (EReference) dtdEntityContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDExternalEntity() {
- return dtdExternalEntityEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDExternalEntity_SystemID() {
- return (EAttribute) dtdExternalEntityEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDExternalEntity_PublicID() {
- return (EAttribute) dtdExternalEntityEClass.getEAttributes().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDExternalEntity_Notation() {
- return (EReference) dtdExternalEntityEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDExternalEntity_EntityReferencedFromAnotherFile() {
- return (EReference) dtdExternalEntityEClass.getEReferences().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDInternalEntity() {
- return dtdInternalEntityEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDTDInternalEntity_Value() {
- return (EAttribute) dtdInternalEntityEClass.getEAttributes().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDParameterEntityReference() {
- return dtdParameterEntityReferenceEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDParameterEntityReference_Entity() {
- return (EReference) dtdParameterEntityReferenceEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDEntityReferenceContent() {
- return dtdEntityReferenceContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDEntityReferenceContent_ElementReferencedEntity() {
- return (EReference) dtdEntityReferenceContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDTDContent() {
- return dtdContentEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDTDContent_DTDFile() {
- return (EReference) dtdContentEClass.getEReferences().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getDTDOccurrenceType() {
- return dtdOccurrenceTypeEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getDTDDefaultKind() {
- return dtdDefaultKindEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getDTDBasicTypeKind() {
- return dtdBasicTypeKindEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getDTDEnumGroupKind() {
- return dtdEnumGroupKindEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getDTDGroupKind() {
- return dtdGroupKindEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getXMLSchemaDefinedType() {
- return xmlSchemaDefinedTypeEEnum;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDFactory getDTDFactory() {
- return (DTDFactory) getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is guarded
- * to have no affect on any invocation but its first. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void createPackageContents() {
- if (isCreated)
- return;
- isCreated = true;
-
- // Create classes and their features
- dtdElementContentEClass = createEClass(DTD_ELEMENT_CONTENT);
- createEReference(dtdElementContentEClass, DTD_ELEMENT_CONTENT__GROUP);
- createEReference(dtdElementContentEClass, DTD_ELEMENT_CONTENT__ELEMENT);
-
- dtdGroupContentEClass = createEClass(DTD_GROUP_CONTENT);
- createEAttribute(dtdGroupContentEClass, DTD_GROUP_CONTENT__GROUP_KIND);
- createEReference(dtdGroupContentEClass, DTD_GROUP_CONTENT__CONTENT);
-
- dtdAttributeEClass = createEClass(DTD_ATTRIBUTE);
- createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__COMMENT);
- createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__DEFAULT_KIND);
- createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__DEFAULT_VALUE_STRING);
- createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY);
- createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY);
- createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__DTD_ELEMENT);
-
- dtdElementEClass = createEClass(DTD_ELEMENT);
- createEAttribute(dtdElementEClass, DTD_ELEMENT__COMMENT);
- createEReference(dtdElementEClass, DTD_ELEMENT__CONTENT);
- createEReference(dtdElementEClass, DTD_ELEMENT__DTD_ATTRIBUTE);
-
- dtdEmptyContentEClass = createEClass(DTD_EMPTY_CONTENT);
-
- dtdAnyContentEClass = createEClass(DTD_ANY_CONTENT);
-
- dtdpcDataContentEClass = createEClass(DTD_PC_DATA_CONTENT);
-
- dtdElementReferenceContentEClass = createEClass(DTD_ELEMENT_REFERENCE_CONTENT);
- createEReference(dtdElementReferenceContentEClass, DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT);
-
- dtdRepeatableContentEClass = createEClass(DTD_REPEATABLE_CONTENT);
- createEAttribute(dtdRepeatableContentEClass, DTD_REPEATABLE_CONTENT__OCCURRENCE);
-
- dtdFileEClass = createEClass(DTD_FILE);
- createEAttribute(dtdFileEClass, DTD_FILE__COMMENT);
- createEAttribute(dtdFileEClass, DTD_FILE__PARSE_ERROR);
- createEReference(dtdFileEClass, DTD_FILE__DTD_CONTENT);
- createEReference(dtdFileEClass, DTD_FILE__DTD_ENUMERATION_TYPE);
-
- dtdBasicTypeEClass = createEClass(DTD_BASIC_TYPE);
- createEAttribute(dtdBasicTypeEClass, DTD_BASIC_TYPE__KIND);
-
- dtdEnumerationTypeEClass = createEClass(DTD_ENUMERATION_TYPE);
- createEAttribute(dtdEnumerationTypeEClass, DTD_ENUMERATION_TYPE__KIND);
- createEReference(dtdEnumerationTypeEClass, DTD_ENUMERATION_TYPE__DTD_FILE);
-
- dtdNotationEClass = createEClass(DTD_NOTATION);
- createEAttribute(dtdNotationEClass, DTD_NOTATION__COMMENT);
- createEAttribute(dtdNotationEClass, DTD_NOTATION__SYSTEM_ID);
- createEAttribute(dtdNotationEClass, DTD_NOTATION__PUBLIC_ID);
- createEReference(dtdNotationEClass, DTD_NOTATION__ENTITY);
-
- dtdEntityEClass = createEClass(DTD_ENTITY);
- createEAttribute(dtdEntityEClass, DTD_ENTITY__COMMENT);
- createEAttribute(dtdEntityEClass, DTD_ENTITY__PARAMETER_ENTITY);
- createEReference(dtdEntityEClass, DTD_ENTITY__CONTENT);
- createEReference(dtdEntityEClass, DTD_ENTITY__PARM_ENTITY_REF);
- createEReference(dtdEntityEClass, DTD_ENTITY__ENTITY_REFERENCE);
- createEReference(dtdEntityEClass, DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE);
- createEReference(dtdEntityEClass, DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE);
-
- dtdEntityContentEClass = createEClass(DTD_ENTITY_CONTENT);
- createEReference(dtdEntityContentEClass, DTD_ENTITY_CONTENT__DTD_ENTITY);
-
- dtdExternalEntityEClass = createEClass(DTD_EXTERNAL_ENTITY);
- createEAttribute(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__SYSTEM_ID);
- createEAttribute(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__PUBLIC_ID);
- createEReference(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__NOTATION);
- createEReference(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE);
-
- dtdInternalEntityEClass = createEClass(DTD_INTERNAL_ENTITY);
- createEAttribute(dtdInternalEntityEClass, DTD_INTERNAL_ENTITY__VALUE);
-
- dtdParameterEntityReferenceEClass = createEClass(DTD_PARAMETER_ENTITY_REFERENCE);
- createEReference(dtdParameterEntityReferenceEClass, DTD_PARAMETER_ENTITY_REFERENCE__ENTITY);
-
- dtdEntityReferenceContentEClass = createEClass(DTD_ENTITY_REFERENCE_CONTENT);
- createEReference(dtdEntityReferenceContentEClass, DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY);
-
- dtdContentEClass = createEClass(DTD_CONTENT);
- createEReference(dtdContentEClass, DTD_CONTENT__DTD_FILE);
-
- // Create enums
- dtdOccurrenceTypeEEnum = createEEnum(DTD_OCCURRENCE_TYPE);
- dtdDefaultKindEEnum = createEEnum(DTD_DEFAULT_KIND);
- dtdBasicTypeKindEEnum = createEEnum(DTD_BASIC_TYPE_KIND);
- dtdEnumGroupKindEEnum = createEEnum(DTD_ENUM_GROUP_KIND);
- dtdGroupKindEEnum = createEEnum(DTD_GROUP_KIND);
- xmlSchemaDefinedTypeEEnum = createEEnum(XML_SCHEMA_DEFINED_TYPE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized)
- return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EcorePackageImpl theEcorePackage = (EcorePackageImpl) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-
- // Add supertypes to classes
- dtdGroupContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
- dtdAttributeEClass.getESuperTypes().add(theEcorePackage.getEAttribute());
- dtdElementEClass.getESuperTypes().add(theEcorePackage.getEClass());
- dtdElementEClass.getESuperTypes().add(this.getDTDContent());
- dtdEmptyContentEClass.getESuperTypes().add(this.getDTDElementContent());
- dtdAnyContentEClass.getESuperTypes().add(this.getDTDElementContent());
- dtdpcDataContentEClass.getESuperTypes().add(this.getDTDElementContent());
- dtdElementReferenceContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
- dtdRepeatableContentEClass.getESuperTypes().add(this.getDTDElementContent());
- dtdBasicTypeEClass.getESuperTypes().add(theEcorePackage.getEClass());
- dtdEnumerationTypeEClass.getESuperTypes().add(theEcorePackage.getEEnum());
- dtdNotationEClass.getESuperTypes().add(this.getDTDContent());
- dtdEntityEClass.getESuperTypes().add(this.getDTDContent());
- dtdExternalEntityEClass.getESuperTypes().add(this.getDTDEntityContent());
- dtdInternalEntityEClass.getESuperTypes().add(this.getDTDEntityContent());
- dtdParameterEntityReferenceEClass.getESuperTypes().add(this.getDTDContent());
- dtdEntityReferenceContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
-
- // Initialize classes and features; add operations and parameters
- initEClass(dtdElementContentEClass, DTDElementContent.class, "DTDElementContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDElementContent_Group(), this.getDTDGroupContent(), this.getDTDGroupContent_Content(), "group", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDElementContent_Element(), this.getDTDElement(), this.getDTDElement_Content(), "element", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdGroupContentEClass, DTDGroupContent.class, "DTDGroupContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDGroupContent_GroupKind(), this.getDTDGroupKind(), "groupKind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDGroupContent_Content(), this.getDTDElementContent(), this.getDTDElementContent_Group(), "content", null, 1, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdAttributeEClass, DTDAttribute.class, "DTDAttribute", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDAttribute_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDAttribute_DefaultKind(), this.getDTDDefaultKind(), "defaultKind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDAttribute_DefaultValueString(), ecorePackage.getEString(), "defaultValueString", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDAttribute_AttributeNameReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_AttributeNameReference(), "attributeNameReferencedEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDAttribute_AttributeTypeReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_AttributeTypeReference(), "attributeTypeReferencedEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDAttribute_DTDElement(), this.getDTDElement(), this.getDTDElement_DTDAttribute(), "DTDElement", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdElementEClass, DTDElement.class, "DTDElement", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDElement_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDElement_Content(), this.getDTDElementContent(), this.getDTDElementContent_Element(), "content", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDElement_DTDAttribute(), this.getDTDAttribute(), this.getDTDAttribute_DTDElement(), "DTDAttribute", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdEmptyContentEClass, DTDEmptyContent.class, "DTDEmptyContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
- initEClass(dtdAnyContentEClass, DTDAnyContent.class, "DTDAnyContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
- initEClass(dtdpcDataContentEClass, DTDPCDataContent.class, "DTDPCDataContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
- initEClass(dtdElementReferenceContentEClass, DTDElementReferenceContent.class, "DTDElementReferenceContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDElementReferenceContent_ReferencedElement(), this.getDTDElement(), null, "referencedElement", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdRepeatableContentEClass, DTDRepeatableContent.class, "DTDRepeatableContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDRepeatableContent_Occurrence(), this.getDTDOccurrenceType(), "occurrence", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
- initEClass(dtdFileEClass, DTDFile.class, "DTDFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDFile_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDFile_ParseError(), ecorePackage.getEBoolean(), "parseError", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDFile_DTDContent(), this.getDTDContent(), this.getDTDContent_DTDFile(), "DTDContent", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDFile_DTDEnumerationType(), this.getDTDEnumerationType(), this.getDTDEnumerationType_DTDFile(), "DTDEnumerationType", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdBasicTypeEClass, DTDBasicType.class, "DTDBasicType", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDBasicType_Kind(), this.getDTDBasicTypeKind(), "kind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
- initEClass(dtdEnumerationTypeEClass, DTDEnumerationType.class, "DTDEnumerationType", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDEnumerationType_Kind(), this.getDTDEnumGroupKind(), "kind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDEnumerationType_DTDFile(), this.getDTDFile(), this.getDTDFile_DTDEnumerationType(), "DTDFile", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdNotationEClass, DTDNotation.class, "DTDNotation", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDNotation_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDNotation_SystemID(), ecorePackage.getEString(), "systemID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDNotation_PublicID(), ecorePackage.getEString(), "publicID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDNotation_Entity(), this.getDTDExternalEntity(), this.getDTDExternalEntity_Notation(), "entity", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdEntityEClass, DTDEntity.class, "DTDEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDEntity_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDEntity_ParameterEntity(), ecorePackage.getEBoolean(), "parameterEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDEntity_Content(), this.getDTDEntityContent(), this.getDTDEntityContent_DTDEntity(), "content", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDEntity_ParmEntityRef(), this.getDTDParameterEntityReference(), this.getDTDParameterEntityReference_Entity(), "parmEntityRef", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDEntity_EntityReference(), this.getDTDEntityReferenceContent(), this.getDTDEntityReferenceContent_ElementReferencedEntity(), "entityReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDEntity_AttributeNameReference(), this.getDTDAttribute(), this.getDTDAttribute_AttributeNameReferencedEntity(), "attributeNameReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDEntity_AttributeTypeReference(), this.getDTDAttribute(), this.getDTDAttribute_AttributeTypeReferencedEntity(), "attributeTypeReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdEntityContentEClass, DTDEntityContent.class, "DTDEntityContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDEntityContent_DTDEntity(), this.getDTDEntity(), this.getDTDEntity_Content(), "DTDEntity", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdExternalEntityEClass, DTDExternalEntity.class, "DTDExternalEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDExternalEntity_SystemID(), ecorePackage.getEString(), "systemID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEAttribute(getDTDExternalEntity_PublicID(), ecorePackage.getEString(), "publicID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
- initEReference(getDTDExternalEntity_Notation(), this.getDTDNotation(), this.getDTDNotation_Entity(), "notation", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
- initEReference(getDTDExternalEntity_EntityReferencedFromAnotherFile(), this.getDTDFile(), null, "entityReferencedFromAnotherFile", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdInternalEntityEClass, DTDInternalEntity.class, "DTDInternalEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEAttribute(getDTDInternalEntity_Value(), ecorePackage.getEString(), "value", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
- initEClass(dtdParameterEntityReferenceEClass, DTDParameterEntityReference.class, "DTDParameterEntityReference", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDParameterEntityReference_Entity(), this.getDTDEntity(), this.getDTDEntity_ParmEntityRef(), "entity", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdEntityReferenceContentEClass, DTDEntityReferenceContent.class, "DTDEntityReferenceContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDEntityReferenceContent_ElementReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_EntityReference(), "elementReferencedEntity", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- initEClass(dtdContentEClass, DTDContent.class, "DTDContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
- initEReference(getDTDContent_DTDFile(), this.getDTDFile(), this.getDTDFile_DTDContent(), "DTDFile", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
- // Initialize enums and add enum literals
- initEEnum(dtdOccurrenceTypeEEnum, DTDOccurrenceType.class, "DTDOccurrenceType"); //$NON-NLS-1$
- addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ONE_LITERAL);
- addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.OPTIONAL_LITERAL);
- addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ONE_OR_MORE_LITERAL);
- addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ZERO_OR_MORE_LITERAL);
-
- initEEnum(dtdDefaultKindEEnum, DTDDefaultKind.class, "DTDDefaultKind"); //$NON-NLS-1$
- addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.IMPLIED_LITERAL);
- addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.REQUIRED_LITERAL);
- addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.FIXED_LITERAL);
- addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.NOFIXED_LITERAL);
-
- initEEnum(dtdBasicTypeKindEEnum, DTDBasicTypeKind.class, "DTDBasicTypeKind"); //$NON-NLS-1$
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NONE_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.CDATA_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ID_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.IDREF_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.IDREFS_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ENTITY_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ENTITIES_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NMTOKEN_LITERAL);
- addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NMTOKENS_LITERAL);
-
- initEEnum(dtdEnumGroupKindEEnum, DTDEnumGroupKind.class, "DTDEnumGroupKind"); //$NON-NLS-1$
- addEEnumLiteral(dtdEnumGroupKindEEnum, DTDEnumGroupKind.NAME_TOKEN_GROUP_LITERAL);
- addEEnumLiteral(dtdEnumGroupKindEEnum, DTDEnumGroupKind.NOTATION_GROUP_LITERAL);
-
- initEEnum(dtdGroupKindEEnum, DTDGroupKind.class, "DTDGroupKind"); //$NON-NLS-1$
- addEEnumLiteral(dtdGroupKindEEnum, DTDGroupKind.SEQUENCE_LITERAL);
- addEEnumLiteral(dtdGroupKindEEnum, DTDGroupKind.CHOICE_LITERAL);
-
- initEEnum(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.class, "XMLSchemaDefinedType"); //$NON-NLS-1$
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.NONE_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.STRING_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.BOOLEAN_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.FLOAT_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DOUBLE_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DECIMAL_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIMEINSTANT_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIMEDURATION_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.RECURRINGINSTANT_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.BINARY_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.URI_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.INTEGER_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DATE_LITERAL);
- addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIME_LITERAL);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-
-} // DTDPackageImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
deleted file mode 100644
index 58fd1c4d64..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Parameter Entity Reference</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTDParameterEntityReferenceImpl extends DTDContentImpl implements DTDParameterEntityReference, ENamedElement, DTDContent {
-
- public String getName() {
- DTDEntity entity = getEntity();
- if (entity != null) {
- return getEntity().getName();
- } // end of if ()
- return ""; //$NON-NLS-1$
- }
-
- public String getPathname() {
- return DTDPathnameUtil.makePath(null, "PEnt", getName(), -1); //$NON-NLS-1$
- }
-
- public DTDObject findObject(String relativePath) {
- return null;
- }
-
- // ugly hack for now since we don't have multiple inheritance.
- // Would rather have all this stuff in a base class but these
- // classes are inheriting from sometimes different mof classes
- DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
- /**
- * Get the value of startOffset.
- *
- * @return value of startOffset.
- */
- public int getStartOffset() {
- return lexInfo.getStartOffset();
- }
-
- /**
- * Set the value of startOffset.
- *
- * @param v
- * Value to assign to startOffset.
- */
- public void setStartOffset(int v) {
- lexInfo.setStartOffset(v);
- }
-
- /**
- * Get the value of endOffset.
- *
- * @return value of endOffset.
- */
- public int getEndOffset() {
- return lexInfo.getEndOffset();
- }
-
- /**
- * Set the value of endOffset.
- *
- * @param v
- * Value to assign to endOffset.
- */
- public void setEndOffset(int v) {
- lexInfo.setEndOffset(v);
- }
-
-
- /**
- * The cached value of the '{@link #getEntity() <em>Entity</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getEntity()
- * @generated
- * @ordered
- */
- protected DTDEntity entity = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDParameterEntityReferenceImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDParameterEntityReference();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity getEntity() {
- if (entity != null && entity.eIsProxy()) {
- DTDEntity oldEntity = entity;
- entity = (DTDEntity) EcoreUtil.resolve(entity, this);
- if (entity != oldEntity) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, oldEntity, entity));
- }
- }
- return entity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DTDEntity basicGetEntity() {
- return entity;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain basicSetEntity(DTDEntity newEntity, NotificationChain msgs) {
- DTDEntity oldEntity = entity;
- entity = newEntity;
- if (eNotificationRequired()) {
- if (msgs == null)
- msgs = new NotificationChainImpl(4);
- msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, oldEntity, newEntity));
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setEntity(DTDEntity newEntity) {
- if (newEntity != entity) {
- NotificationChain msgs = null;
- if (entity != null)
- msgs = ((InternalEObject) entity).eInverseRemove(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
- if (newEntity != null)
- msgs = ((InternalEObject) newEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
- msgs = basicSetEntity(newEntity, msgs);
- if (msgs != null)
- msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, newEntity, newEntity));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE, msgs);
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- if (entity != null)
- msgs = ((InternalEObject) entity).eInverseRemove(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
- return basicSetEntity((DTDEntity) otherEnd, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- return eBasicSetContainer(null, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE, msgs);
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- return basicSetEntity(null, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- return getDTDFile();
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- if (resolve)
- return getEntity();
- return basicGetEntity();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- setDTDFile((DTDFile) newValue);
- return;
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- setEntity((DTDEntity) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- setDTDFile((DTDFile) null);
- return;
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- setEntity((DTDEntity) null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
- return getDTDFile() != null;
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
- return entity != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
-} // DTDParameterEntityReferenceImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDParameterEntityReferenceImpl extends ENamespaceImpl
-// implements DTDParameterEntityReference, ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDEntity entity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setEntity = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDParameterEntityReference());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDParameterEntityReference() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDParameterEntityReference();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDEntity getEntity() {
-// try {
-// if (this.entity == null) return null;
-// this.entity = (DTDEntity) ((InternalEObject)this.entity).resolve(this,
-// DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity());
-// if (this.entity==null) this.setEntity = false;
-// return this.entity;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setEntity(DTDEntity l) {
-// refSetValueForSVReference(DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),this.entity,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetEntity() {
-// refUnsetValueForSVReference(DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),this.entity);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetEntity() {
-// return setEntity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: return getEntity();
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// getDTDFile();
-//
-
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY:
-// if (!this.setEntity||this.entity==null) return null;
-// if (((InternalEObject)this.entity).refIsDeleted()) {this.entity=null;
-// this.setEntity=false;}
-// return this.entity;
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: return
-// isSetEntity();
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// isSetDTDFile();
-//
-
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// setEntity((DTDEntity)newValue);
-// return;
-// }
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// Object oldValue = this.entity;
-// this.entity = (DTDEntity)newValue;
-// this.setEntity = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),oldValue,newValue);
-// }
-//
-
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// unsetEntity();
-// return;
-// }
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// Object oldValue = this.entity;
-// this.entity = null;
-// this.setEntity = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),oldValue,null);
-// }
-//
-
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
deleted file mode 100644
index 4ed8dbcb85..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-/**
- * @generated
- */
-public abstract class DTDRepeatableContentImpl extends DTDElementContentImpl implements DTDRepeatableContent {
- /**
- * The default value of the '{@link #getOccurrence() <em>Occurrence</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getOccurrence()
- * @generated
- * @ordered
- */
- protected static final DTDOccurrenceType OCCURRENCE_EDEFAULT = DTDOccurrenceType.ONE_LITERAL;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected DTDOccurrenceType occurrence = OCCURRENCE_EDEFAULT;
-
- public DTDRepeatableContentImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EClass eStaticClass() {
- return DTDPackage.eINSTANCE.getDTDRepeatableContent();
- }
-
- public String unparse() {
- StringBuffer sb = new StringBuffer(128);
- if (getOccurrence().getValue() != DTDOccurrenceType.ONE) {
- if (this instanceof DTDEntityReferenceContent) {
- sb.append("(").append(unparseRepeatableContent()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- sb.append(unparseRepeatableContent());
- }
-
- // MOF2EMF Port
- // EEnumLiteral lit = getOccurrence();
- DTDOccurrenceType lit = getOccurrence();
- if (lit != null) {
- sb.append((char) lit.getValue());
- }
- }
- else {
- sb.append(unparseRepeatableContent());
- }
-
- return sb.toString();
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- * JUST_ONE= -1 ONE_OR_MORE=43 OPTIONAL=63 ZERO_OR_MORE=42
- */
- public DTDOccurrenceType getOccurrence() {
- return occurrence;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setOccurrence(DTDOccurrenceType newOccurrence) {
- DTDOccurrenceType oldOccurrence = occurrence;
- occurrence = newOccurrence == null ? OCCURRENCE_EDEFAULT : newOccurrence;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE, oldOccurrence, occurrence));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_REPEATABLE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- return eBasicSetContainer(null, DTDPackage.DTD_REPEATABLE_CONTENT__GROUP, msgs);
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- return eBasicSetContainer(null, DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT, msgs);
- default :
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID() >= 0) {
- switch (eContainerFeatureID()) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
- default :
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- return getGroup();
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- return getElement();
- case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
- return getOccurrence();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- return getGroup() != null;
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- return getElement() != null;
- case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
- return occurrence != OCCURRENCE_EDEFAULT;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- setGroup((DTDGroupContent) newValue);
- return;
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- setElement((DTDElement) newValue);
- return;
- case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
- setOccurrence((DTDOccurrenceType) newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
- case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
- setGroup((DTDGroupContent) null);
- return;
- case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
- setElement((DTDElement) null);
- return;
- case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
- setOccurrence(OCCURRENCE_EDEFAULT);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public String toString() {
- if (eIsProxy())
- return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (occurrence: "); //$NON-NLS-1$
- result.append(occurrence);
- result.append(')');
- return result.toString();
- }
-
- /*
- * @see DTDRepeatableContent#unparseRepeatableContent()
- */
- public String unparseRepeatableContent() {
- return null;
- }
-
- /*
- * @see DTDElementContent#getContentName()
- */
- public String getContentName() {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java
deleted file mode 100644
index 3dab6b526d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java
+++ /dev/null
@@ -1,440 +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.dtd.core.internal.emf.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDAdapterFactory extends AdapterFactoryImpl {
- /**
- * @generated This field/method will be replaced during code generation.
- */
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected static DTDPackage modelPackage;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public DTDAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = DTDPackage.eINSTANCE;
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject) object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DTDSwitch modelSwitch = new DTDSwitch() {
- public Object caseDTDElementContent(DTDElementContent object) {
- return createDTDElementContentAdapter();
- }
-
- public Object caseDTDGroupContent(DTDGroupContent object) {
- return createDTDGroupContentAdapter();
- }
-
- public Object caseDTDAttribute(DTDAttribute object) {
- return createDTDAttributeAdapter();
- }
-
- public Object caseDTDElement(DTDElement object) {
- return createDTDElementAdapter();
- }
-
- public Object caseDTDEmptyContent(DTDEmptyContent object) {
- return createDTDEmptyContentAdapter();
- }
-
- public Object caseDTDAnyContent(DTDAnyContent object) {
- return createDTDAnyContentAdapter();
- }
-
- public Object caseDTDPCDataContent(DTDPCDataContent object) {
- return createDTDPCDataContentAdapter();
- }
-
- public Object caseDTDElementReferenceContent(DTDElementReferenceContent object) {
- return createDTDElementReferenceContentAdapter();
- }
-
- public Object caseDTDRepeatableContent(DTDRepeatableContent object) {
- return createDTDRepeatableContentAdapter();
- }
-
- public Object caseDTDFile(DTDFile object) {
- return createDTDFileAdapter();
- }
-
- public Object caseDTDBasicType(DTDBasicType object) {
- return createDTDBasicTypeAdapter();
- }
-
- public Object caseDTDEnumerationType(DTDEnumerationType object) {
- return createDTDEnumerationTypeAdapter();
- }
-
- public Object caseDTDNotation(DTDNotation object) {
- return createDTDNotationAdapter();
- }
-
- public Object caseDTDEntity(DTDEntity object) {
- return createDTDEntityAdapter();
- }
-
- public Object caseDTDEntityContent(DTDEntityContent object) {
- return createDTDEntityContentAdapter();
- }
-
- public Object caseDTDExternalEntity(DTDExternalEntity object) {
- return createDTDExternalEntityAdapter();
- }
-
- public Object caseDTDInternalEntity(DTDInternalEntity object) {
- return createDTDInternalEntityAdapter();
- }
-
- public Object caseDTDParameterEntityReference(DTDParameterEntityReference object) {
- return createDTDParameterEntityReferenceAdapter();
- }
-
- public Object caseDTDEntityReferenceContent(DTDEntityReferenceContent object) {
- return createDTDEntityReferenceContentAdapter();
- }
-
- public Object caseDTDContent(DTDContent object) {
- return createDTDContentAdapter();
- }
-
- public Object caseEModelElement(EModelElement object) {
- return createEModelElementAdapter();
- }
-
- public Object caseENamedElement(ENamedElement object) {
- return createENamedElementAdapter();
- }
-
- public Object caseETypedElement(ETypedElement object) {
- return createETypedElementAdapter();
- }
-
- public Object caseEStructuralFeature(EStructuralFeature object) {
- return createEStructuralFeatureAdapter();
- }
-
- public Object caseEAttribute(EAttribute object) {
- return createEAttributeAdapter();
- }
-
- public Object caseEClassifier(EClassifier object) {
- return createEClassifierAdapter();
- }
-
- public Object caseEClass(EClass object) {
- return createEClassAdapter();
- }
-
- public Object caseEDataType(EDataType object) {
- return createEDataTypeAdapter();
- }
-
- public Object caseEEnum(EEnum object) {
- return createEEnumAdapter();
- }
-
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter) modelSwitch.doSwitch((EObject) target);
- }
-
-
- /**
- * By default create methods return null so that we can easily ignore
- * cases. It's useful to ignore a case when inheritance will catch all the
- * cases anyway.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDFileAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDNotationAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDEntityAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDEntityContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDExternalEntityAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDInternalEntityAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDParameterEntityReferenceAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDEntityReferenceContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDRepeatableContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDElementReferenceContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDElementAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDElementContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDEmptyContentAdapter() {
- return null;
- }
-
- /**
- * By default create methods return null so that we can easily ignore
- * cases. It's useful to ignore a case when inheritance will catch all the
- * cases anyway.
- */
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDAnyContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDPCDataContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDGroupContentAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDAttributeAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDEnumerationTypeAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createDTDBasicTypeAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEClassAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEAttributeAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEEnumAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEModelElementAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createENamedElementAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEStructuralFeatureAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEDataTypeAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createETypedElementAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEClassifierAdapter() {
- return null;
- }
-
-} // DTDAdapterFactory
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java
deleted file mode 100644
index 31188de37f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java
+++ /dev/null
@@ -1,125 +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.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-
-
-public class DTDMetrics {
- protected DTDFile dtdFile;
- protected Hashtable elementReferenceMap;
-
- public DTDMetrics(DTDFile dtdFile) {
- this.dtdFile = dtdFile;
- }
-
- public Hashtable getElementReferences() {
- if (elementReferenceMap == null) {
- elementReferenceMap = new Hashtable();
- new DTDVisitor() {
-
- public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
- DTDElement dtdElement = elementReferenceContent.getReferencedElement();
- Object visitation = elementReferenceMap.get(dtdElement);
- if (visitation == null) {
- elementReferenceMap.put(dtdElement, visitation = new Vector());
- }
- ((Vector) visitation).addElement(elementReferenceContent);
- }
- }.visitDTDFile(dtdFile);
- }
-
- return elementReferenceMap;
- }
-
- public int getElementReferenceCount(DTDElement dtdElement) {
- Object elementReferences = getElementReferences().get(dtdElement);
- return elementReferences == null ? 0 : ((Vector) elementReferences).size();
- }
-
- public DTDElement getLeastReferencedElement() {
- DTDElement result = null;
- int lowestReferenceCount = Integer.MAX_VALUE;
-
- Collection elements = dtdFile.listDTDElement();
- for (Iterator i = elements.iterator(); i.hasNext();) {
- DTDElement element = (DTDElement) i.next();
- int count = getElementReferenceCount(element);
- if (count < lowestReferenceCount) {
- result = element;
- lowestReferenceCount = count;
- }
- }
-
- return result;
- }
-
- /**
- * @generated
- */
- protected Hashtable getElementReferencesGen() {
-
- if (elementReferenceMap == null) {
- elementReferenceMap = new Hashtable();
- new DTDVisitor() {
-
- public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
- DTDElement dtdElement = elementReferenceContent.getReferencedElement();
- Object visitation = elementReferenceMap.get(dtdElement);
- if (visitation == null) {
- elementReferenceMap.put(dtdElement, visitation = new Vector());
- }
- ((Vector) visitation).addElement(elementReferenceContent);
- }
- }.visitDTDFile(dtdFile);
- }
-
- return elementReferenceMap;
- }
-
- /**
- * @generated
- */
- protected int getElementReferenceCountGen(DTDElement dtdElement) {
-
- Object elementReferences = getElementReferences().get(dtdElement);
- return elementReferences == null ? 0 : ((Vector) elementReferences).size();
- }
-
- /**
- * @generated
- */
- protected DTDElement getLeastReferencedElementGen() {
-
- DTDElement result = null;
- int lowestReferenceCount = Integer.MAX_VALUE;
-
- Collection elements = dtdFile.listDTDElement();
- for (Iterator i = elements.iterator(); i.hasNext();) {
- DTDElement element = (DTDElement) i.next();
- int count = getElementReferenceCount(element);
- if (count < lowestReferenceCount) {
- result = element;
- lowestReferenceCount = count;
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java
deleted file mode 100644
index 6e7e923806..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java
+++ /dev/null
@@ -1,1844 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.dtd.core.internal.emf.util;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.saxparser.AttNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.Attlist;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMNodeType;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMReferenceNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMRepeatableNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTD;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTDSaxArtifactVisitor;
-import org.eclipse.wst.dtd.core.internal.saxparser.ElementDecl;
-import org.eclipse.wst.dtd.core.internal.saxparser.EntityDecl;
-import org.eclipse.wst.dtd.core.internal.saxparser.ErrorMessage;
-import org.eclipse.wst.dtd.core.internal.saxparser.NotationDecl;
-
-public class DTDModelBuilder extends DTDSaxArtifactVisitor {
- DTD dtd;
- DTDUtil dtdUtil;
- DTDFile dtdFile;
- ResourceSet resources;
-
- public DTDModelBuilder(ResourceSet resources, DTDUtil dtdUtil, DTD dtd, DTDFile dtdFile) {
- this.resources = resources;
- this.dtdUtil = dtdUtil;
- this.dtd = dtd;
- this.dtdFile = dtdFile;
- }
-
- public DTDFactoryImpl getFactory() {
- return (DTDFactoryImpl) dtdUtil.getFactory();
- }
-
- public DTDFile getDTDFile() {
- return dtdFile;
- }
-
- public void visitDTD(DTD dtd) {
- super.visitDTD(dtd);
-
- // - 2nd pass -
- // do final processing for Attlists and adding contentModel
- addAttlistAndContentModel(dtd, dtdFile);
- }
-
- public void visitElementDecl(ElementDecl element) {
- // Element might have been added earlier because it is referenced
- String declName = element.getNodeName();
- // System.out.println("process ElementDecl:" + declName );
- DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(declName);
- if (dtdelement == null) {
- // System.out.println("process ElementDecl - not found - create"
- // );
- dtdelement = getFactory().createDTDElement();
- dtdelement.setName(declName);
- dtdFile.getDTDObject().add(dtdelement);
- dtdUtil.getElementPool().put(declName, dtdelement);
- }
-
- super.visitElementDecl(element);
- }
-
- public void visitNotationDecl(NotationDecl notation) {
- // Notation might have been added earlier because it is referenced
- // by an entity
- DTDNotation dtdnot = dtdFile.findNotation(notation.getNodeName());
- if (dtdnot == null) {
- dtdnot = getFactory().createDTDNotation();
- dtdFile.getDTDObject().add(dtdnot);
- }
- dtdnot.setName(notation.getNodeName());
-
- if (notation.getSystemId() != null)
- dtdnot.setSystemID(notation.getSystemId());
- if (notation.getPublicId() != null)
- dtdnot.setPublicID(notation.getPublicId());
-
- if (notation.getComment() != null)
- dtdnot.setComment(notation.getComment());
- if (notation.getErrorMessage() != null) {
- addErrorMessage(notation.getErrorMessage(), dtdnot);
- }
-
- super.visitNotationDecl(notation);
- }
-
- public void visitParameterEntityReferenceDecl(EntityDecl entity) {
- // This is a parameter entity reference.
- // Add the link to the real entity that it references
- DTDParameterEntityReference parmEntRef = getFactory().createDTDParameterEntityReference();
- dtdFile.getDTDObject().add(parmEntRef);
-
- String entityName = entity.getNodeName();
-
- // Add the reference to the DTDEntity
- DTDEntity dtdentity = getDTDFile().findEntity(entityName);
- if (dtdentity != null) {
- parmEntRef.setEntity(dtdentity);
- }
- if (entity.getErrorMessage() != null) {
- addErrorMessage(entity.getErrorMessage(), dtdentity);
- }
- // System.out.println("adding PE reference: " + declName);
-
- super.visitParameterEntityReferenceDecl(entity);
- }
-
- public void visitExternalEntityDecl(EntityDecl entity) {
- DTDEntity dtdEntity = createDTDEntity(entity);
- // System.out.println("adding entity: " + declName);
- DTDExternalEntity extEntity = getFactory().createDTDExternalEntity();
- dtdEntity.setContent(extEntity);
-
- finishExternalEntity(extEntity, entity);
- // System.out.println(" ext entity toMof: " );
- if (dtdEntity.isParameterEntity()) {
-
- dtdUtil.getPEPool().put("%" + entity.getNodeName() + ";", dtdEntity); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- super.visitExternalEntityDecl(entity);
- }
-
- public void visitInternalEntityDecl(EntityDecl entity) {
- DTDEntity dtdEntity = createDTDEntity(entity);
-
- DTDInternalEntity intEntity = getFactory().createDTDInternalEntity();
- dtdEntity.setContent(intEntity);
- intEntity.setValue(entity.getValue());
- // System.out.println(" int entity toMof: " );
- if (dtdEntity.isParameterEntity()) {
- dtdUtil.getPEPool().put("%" + entity.getNodeName() + ";", dtdEntity); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- super.visitInternalEntityDecl(entity);
- }
-
- private void addAttlistAndContentModel(DTD dtd, DTDFile dFile) {
- // System.out.println("addAttListAndCotentModel - dtd:" +
- // dtd.getName());
- Enumeration en = dtd.externalElements();
- while (en.hasMoreElements()) {
- Object e = en.nextElement();
- if (e instanceof ElementDecl) {
- DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(((ElementDecl) e).getNodeName());
- if (dtdelement == null) {
- dtdelement = getFactory().createDTDElement();
- dtdFile.getDTDObject().add(dtdelement);
- }
- finishElementDecl(dtdelement, (ElementDecl) e);
- }
- else if (e instanceof Attlist) {
- processAttList((Attlist) e);
- }
- }
- }
-
-
- private void processAttList(Attlist attList) {
- DTDElement e = (DTDElement) dtdUtil.getElementPool().get(attList.getNodeName());
- if (e != null) {
- // Element has been added. Add the attributes
- // System.out.println(" processAttlist - adding Attlist:" +
- // attList.getNodeName());
- createAttributes(e, attList);
- }
- else {
- // System.out.println("!!!!!!!!! element is null ");
- }
- }
-
- // /////////////////////////////////////////////////////////////
- //
- // Methods for finishing the import of a DTDExternalEntity
- //
- // /////////////////////////////////////////////////////////////
- void finishExternalEntity(DTDExternalEntity extEntity, EntityDecl entityDecl) {
- updateSystemID(extEntity, entityDecl);
- extEntity.setPublicID(entityDecl.getPublicId());
-
- String notationName = entityDecl.getNotationName();
- if (notationName != null) {
- DTDNotation dtdNotation = createOrFindNotation(extEntity, notationName, true);
- extEntity.setNotation(dtdNotation);
- }
- }
-
- public DTDNotation createOrFindNotation(DTDExternalEntity extEntity, String name, boolean create) {
- DTDNotation aNotation = extEntity.getDTDEntity().getDTDFile().findNotation(name);
- if (aNotation != null) {
- return aNotation;
- }
-
- //
- // Create a notation for the reference
- //
- if (create) {
- aNotation = getFactory().createDTDNotation();
- dtdFile.getDTDObject().add(aNotation);
- aNotation.setName(name);
- }
- return aNotation;
- }
-
- /**
- * The SystemID attribute is set to whatever the user enters e.g.
- * com/ibm/b2b/xmimodels/xxx.dtd.xmi
- *
- * In the unparse() method, parse out the DTD file name from the classpath
- * name. e.g. returns xxx.dtd
- */
- private void updateSystemID(DTDExternalEntity extEntity, EntityDecl entityDecl) {
- String systemId = entityDecl.getSystemId();
- String publicId = entityDecl.getPublicId();
- if (systemId != null) {
- URIResolver idResolver = URIResolverPlugin.createResolver();
- String uri = idResolver.resolve(dtd.getName(), publicId, systemId);
- ExternalDTDModel ed = dtdUtil.getExternalDTDModel(resources, uri);
- if (ed != null) {
- DTDFile referenceDtdFile = ed.getExternalDTDFile();
- extEntity.setEntityReferencedFromAnotherFile(referenceDtdFile);
- extEntity.setSystemID(systemId);
- }
- else {
- if (entityDecl.getErrorMessage() == null) {
- ErrorMessage dtdError = new ErrorMessage();
- dtdError.setErrorMessage(DTDCoreMessages._ERROR_INCL_FILE_LOAD_FAILURE + " '" + systemId + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addErrorMessage(dtdError, extEntity.getDTDEntity());
- }
-
- if (systemId != null) {
- extEntity.setSystemID(systemId);
- }
- else {
- extEntity.setSystemID(""); //$NON-NLS-1$
- }
- }
- } // end of if ()
- else {
- // set the system id to be ""
- extEntity.setSystemID(""); //$NON-NLS-1$
- }
- }
-
- public DTDEntity createDTDEntity(EntityDecl entity) {
- // create and do what we can to fill in some basic things
- DTDEntity dtdEntity = getFactory().createDTDEntity();
- dtdFile.getDTDObject().add(dtdEntity);
-
- dtdEntity.setName(entity.getNodeName());
- dtdEntity.setParameterEntity(entity.isParameter());
- if (entity.getComment() != null) {
- dtdEntity.setComment(entity.getComment());
- }
- if (entity.getErrorMessage() != null) {
- addErrorMessage(entity.getErrorMessage(), dtdEntity);
- }
-
- return dtdEntity;
- }
-
-
- // /////////////////////////////////////////////////////////////
- //
- // Methods for finishing the import of a DTDElement
- //
- // /////////////////////////////////////////////////////////////
- public void finishElementDecl(DTDElement dtdElement, ElementDecl ed) {
- dtdElement.setName(ed.getNodeName());
-
- CMNode cmNode = ed.getContentModelNode();
-
- if (ed.getComment() != null) {
- dtdElement.setComment(ed.getComment());
- }
- if (ed.getErrorMessage() != null) {
- addErrorMessage(ed.getErrorMessage(), dtdElement);
- }
-
- if (cmNode instanceof CMBasicNode) {
- CMBasicNode bn = (CMBasicNode) cmNode;
- switch (bn.getType()) {
- case CMNodeType.EMPTY :
- DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- dtdElement.setContent(emptyContent);
- break;
-
- case CMNodeType.ANY :
- DTDAnyContent anyContent = getFactory().createDTDAnyContent();
- dtdElement.setContent(anyContent);
- break;
-
- case CMNodeType.PCDATA :
- DTDPCDataContent pcData = getFactory().createDTDPCDataContent();
- dtdElement.setContent(pcData);
- }
-
- }
- else if (cmNode instanceof CMReferenceNode) {
- CMReferenceNode rn = (CMReferenceNode) cmNode;
- if (rn.getType() == CMNodeType.ENTITY_REFERENCE) {
- String entityName = rn.getName().trim();
-
- DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
- if (anEntity != null) {
- //
- // Create an DTDEntityReference and set its referenced
- // element
- //
- DTDEntityReferenceContent enRef = getFactory().createDTDEntityReferenceContent();
- enRef.setElementReferencedEntity(anEntity);
-
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
- enRef.setOccurrence(occurrenceType);
-
- dtdElement.setContent(enRef);
- }
- else { // create default content
- DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- dtdElement.setContent(emptyContent);
- }
- }
- else {
- //
- // Find the real element for this element references
- // If the real element does not yet exist, create it
- //
- DTDElement anElement = createOrFindElement(rn.getName(), dtdElement);
-
- //
- // Create an DTDElementReference and set its referenced
- // element
- //
- DTDElementReferenceContent elemRef = getFactory().createDTDElementReferenceContent();
- elemRef.setReferencedElement(anElement);
-
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
- elemRef.setOccurrence(occurrenceType);
-
- // setContent to DTDElementReference
- dtdElement.setContent(elemRef);
-
- }
- }
- else if (cmNode instanceof CMGroupNode) {
- CMGroupNode grpNode = (CMGroupNode) cmNode;
- DTDGroupContent groupContent = getFactory().createDTDGroupContent();
- DTDGroupKind groupKind = DTDGroupKind.get(computeMofGroupKind(grpNode.getGroupKind()));
- groupContent.setGroupKind(groupKind);
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(grpNode));
- groupContent.setOccurrence(occurrenceType);
-
- // just use the locator for the element as the closest guess
- processGroupContent(groupContent, grpNode);
- dtdElement.setContent(groupContent);
- }
- else if (cmNode == null) {
- // bad thing happened here, just create a pcdata
- DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- dtdElement.setContent(emptyContent);
- }
-
-
- }
-
-
- /**
- * Add a new group to the current group
- *
- * @param parent -
- * the parent node for this group element
- * @param op1Node -
- * the group e.g. (a,b)
- * @param op2Node -
- * set only if called by processCM1op e.g. (a,b)+
- */
- void processGroupContent(DTDGroupContent parent, CMGroupNode grpNode) {
- Enumeration children = grpNode.getChildren().elements();
- DTDFactory factory = getFactory();
- while (children.hasMoreElements()) {
- CMNode cnode = (CMNode) children.nextElement();
-
- if (cnode instanceof CMGroupNode) {
- CMGroupNode gNode = (CMGroupNode) cnode;
- DTDGroupContent groupContent = factory.createDTDGroupContent();
- DTDGroupKind groupKind = DTDGroupKind.get(computeMofGroupKind(gNode.getGroupKind()));
- groupContent.setGroupKind(groupKind);
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(gNode));
- groupContent.setOccurrence(occurrenceType);
-
- parent.getContent().add(groupContent);
- processGroupContent(groupContent, gNode);
- }
- else if (cnode instanceof CMBasicNode) {
- CMBasicNode n = (CMBasicNode) cnode;
- if (n.getType() == CMNodeType.PCDATA) {
- // Create a DTDPCDataContent for a leaf PCData node
- //
- DTDPCDataContent pcData = factory.createDTDPCDataContent();
- // Add #PCDATA to the Group, i.e Mixed content model
- parent.getContent().add(pcData);
- }
- }
- else if (cnode instanceof CMReferenceNode) {
- CMReferenceNode rn = (CMReferenceNode) cnode;
- if (rn.getType() == CMNodeType.ELEMENT_REFERENCE) {
- // System.out.println("CM Element Ref name: " +
- // rn.getName());
- //
- // Create an DTDElementReference and set its referenced
- // element
- //
- DTDElementReferenceContent elemRef = factory.createDTDElementReferenceContent();
-
- //
- // Find the real element for this element references
- // If the real element does not yet exist, create it
- //
- DTDElement anElement = createOrFindElement(rn.getName(), elemRef);
-
- elemRef.setReferencedElement(anElement);
-
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
- elemRef.setOccurrence(occurrenceType);
-
- // Add DTDElementReference to the Group
- parent.getContent().add(elemRef);
- }
- else // PE Reference
- {
- String entityName = rn.getName().trim();
-
- // System.out.println("CM PE Ref name: " + entityName);
- DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
- if (anEntity != null) {
- //
- // Create an DTDEntityReference and set its referenced
- // element
- //
- DTDEntityReferenceContent enRef = factory.createDTDEntityReferenceContent();
- enRef.setElementReferencedEntity(anEntity);
-
- DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
- enRef.setOccurrence(occurrenceType);
-
- // Add DTDEntityReference to the Group
- parent.getContent().add(enRef);
-
- }
- }
- }
- }
- }
-
- /**
- * Find the real element that is referenced by the current element
- */
- private DTDElement createOrFindElement(String name, Object obj) {
- // DTDElement aElement = getDTDFile().findElement(name);
-
- DTDElement aElement = (DTDElement) dtdUtil.getElementPool().get(name);
-
- if (aElement != null) {
- return aElement;
- }
-
- String errorMsg = DTDCoreMessages._ERROR_UNDECLARED_ELEMENT_1; //$NON-NLS-1$
- errorMsg += "\"" + name + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- errorMsg += DTDCoreMessages._UI_ERRORPART_UNDECLARED_ELEMENT_2; //$NON-NLS-1$
-
- ErrorMessage dtdError = new ErrorMessage();
-
- dtdError.setErrorMessage(errorMsg);
- addErrorMessage(dtdError, obj);
- // System.out.println(errorMsg);
- // setDTDErrorMessage(errorMsg);
- getDTDFile().setParseError(true);
-
- //
- // Create an empty element for the reference to make it valid
- //
-
- DTDFactory factory = getFactory();
- DTDElement dtdelement = factory.createDTDElement();
- dtdelement.setName(name);
-
- DTDEmptyContent emptyContent = factory.createDTDEmptyContent();
- dtdelement.setContent(emptyContent);
-
- getDTDFile().getDTDObject().add(dtdelement);
- dtdUtil.getElementPool().put(name, dtdelement);
- return dtdelement;
- }
-
-
- /**
- * Compute the MOF occurrence from the xml4j occurrence
- */
- private int computeMofOccurrence(CMRepeatableNode rnode) {
- int occurrence = rnode.getOccurrence();
- int mofoccur = DTDOccurrenceType.ONE;
-
- if (occurrence == CMNodeType.ZERO_OR_MORE) {
- mofoccur = DTDOccurrenceType.ZERO_OR_MORE;
- }
- else if (occurrence == CMNodeType.ONE_OR_MORE) {
- mofoccur = DTDOccurrenceType.ONE_OR_MORE;
- }
- else if (occurrence == CMNodeType.OPTIONAL) {
- mofoccur = DTDOccurrenceType.OPTIONAL;
- }
- return mofoccur;
- }
-
- /**
- * Compute the MOF model group from the xml4j model group
- */
- private int computeMofGroupKind(int type) {
- if (type == CMNodeType.GROUP_CHOICE) {
- return DTDGroupKind.CHOICE;
- }
- else {
- return DTDGroupKind.SEQUENCE;
- }
- }
-
-
- // /////////////////////////////////////////////////////////////
- //
- // Methods for creating the attributes of a DTDElement
- //
- // /////////////////////////////////////////////////////////////
- public void createAttributes(DTDElement element, Attlist attList) {
- if (attList.getErrorMessage() != null) {
- addErrorMessage(attList.getErrorMessage(), element);
- }
-
- for (int i = 0; i < attList.size(); i++) {
- AttNode ad = attList.elementAt(i);
- // DTDAttributeElement dtdAtt=
- // getDTDAttributeElement(a.getName());
-
- // only add the AttDef if it is not added yet
- // ignore the dup AttDef as documented in the XML 1.0 specs
- // if( dtdAtt==null)
- addAttribute(element, ad);
- }
-
- }
-
- /**
- * Create a DTDAttribute from the xml4j attribute
- */
- public void addAttribute(DTDElement dtdelement, AttNode ad) {
- DTDAttribute dtdattr = getFactory().createDTDAttribute();
- dtdelement.getDTDAttribute().add(dtdattr);
- finishAttribute(dtdattr, ad);
- }
-
- // Stuff for populating attribute
- public void finishAttribute(DTDAttribute dtdattr, AttNode attdef) {
- boolean parseError = false;
-
- if (attdef.name.startsWith("%")) { //$NON-NLS-1$
- String peName = attdef.name.trim();
- DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
- if (en != null) {
- dtdattr.setAttributeNameReferencedEntity(en);
- }
- }
-
- dtdattr.setName(attdef.name);
-
- int attrType = attdef.getDeclaredType();
-
- if (attrType == AttNode.PEREFERENCE && attdef.type != null) {
- String peName = attdef.type.trim();
- DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
- if (en != null) {
- dtdattr.setAttributeTypeReferencedEntity(en);
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA()); // hack,
- // so
- // we
- // can
- // get
- // back
- // the
- // default
- // value
- }
- else
- // set default type
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
-
- }
- else {
- switch (attrType) {
- case AttNode.CDATA :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
- break;
-
- case AttNode.ENTITIES :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITIES());
- break;
-
- case AttNode.ENTITY :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITY());
- break;
-
- case AttNode.ID :
- // check for duplicate ID attribute
- if (hasIDAttribute(dtdattr)) {
- /*String errMsg = DTDCoreMessages._ERROR_DUP_ID_ATTRIBUTE_1; //$NON-NLS-1$
- errMsg += attdef.name + DTDCoreMessages._UI_ERRORPART_DUP_ID_ATTRIBUTE_2; //$NON-NLS-1$*/
- // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
- // dtdattr.getDTDElement().getDTDFile().setParseError(true);
- parseError = true;
- }
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ID());
- break;
-
- case AttNode.IDREF :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREF());
- break;
-
- case AttNode.IDREFS :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREFS());
- break;
-
- case AttNode.ENUMERATION :
- setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef, DTDEnumGroupKind.NAME_TOKEN_GROUP));
- break;
-
- case AttNode.NOTATION :
- setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef, DTDEnumGroupKind.NOTATION_GROUP));
- break;
-
- case AttNode.NMTOKEN :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKEN());
- break;
-
- case AttNode.NMTOKENS :
- setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKENS());
- break;
-
- default :
- // System.out.println("DTDATTR '" +attdef.name + "'Unknown
- // type..." + attrType);
- }
- }
-
- int attrDefault = attdef.getDefaultType();
- int defaultKind = DTDDefaultKind.IMPLIED;
- switch (attrDefault) {
- case AttNode.FIXED :
- defaultKind = DTDDefaultKind.FIXED;
- break;
-
- case AttNode.IMPLIED :
- defaultKind = DTDDefaultKind.IMPLIED;
- break;
-
- case AttNode.REQUIRED :
- defaultKind = DTDDefaultKind.REQUIRED;
- break;
-
- case AttNode.NOFIXED :
- defaultKind = DTDDefaultKind.NOFIXED;
- break;
-
- default :
- // System.out.println("DTDATTR '" +attdef.name + "' Unknown default
- // type... " + attrDefault);
- }
-
- DTDDefaultKind defaultKindObj = DTDDefaultKind.get(defaultKind);
- dtdattr.setDefaultKind(defaultKindObj);
-
- if (parseError) {
- return;
- }
-
- String defaultValue = attdef.defaultValue;
- if (defaultValue != null) {
- if (attrType == AttNode.ENUMERATION || attrType == AttNode.NOTATION) {
- if (!isDefaultEnumValueValid(attdef, defaultValue)) {
- /*String typeString = (attrType == AttNode.ENUMERATION ? "enumeration" : "notation"); //$NON-NLS-1$ //$NON-NLS-2$
- String errMsg = DTDCoreMessages._ERROR_INVALID_DEFAULT_ATTR_VALUE_1; //$NON-NLS-1$
- errMsg += typeString + DTDCoreMessages._UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2; //$NON-NLS-1$
- errMsg += attdef.name + "'"; //$NON-NLS-1$*/
-
- // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
- // dtdattr.getDTDElement().getDTDFile().setParseError(true);
- return;
- }
- }
- dtdattr.setDefaultValueString(defaultValue);
- }
- // System.out.println("DTDAttr - toMof getDefaultValueString " +
- // getDefaultValueString());
- // System.out.println("DTDAttr - toMof getDefaultValue: " +
- // getDefaultValue());
- }
-
- public boolean hasIDAttribute(DTDAttribute dtdattr) {
- boolean hasID = false;
-
- DTDElement element = dtdattr.getDTDElement();
- EList attrs = element.getDTDAttribute();
-
- Iterator i = attrs.iterator();
- while (i.hasNext()) {
- DTDAttribute attr = (DTDAttribute) i.next();
- DTDType dType = attr.getDTDType();
- if (dType instanceof DTDBasicType) {
- if (((DTDBasicType) dType).getKind().getValue() == DTDBasicTypeKind.ID) {
- hasID = true;
- break;
- }
- }
- }
- return hasID;
- }
-
- public DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, String[] enumValues, int enumKind) {
- DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
- DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
- enumeration.setKind(groupKind);
- // Enumeration values
- if (enumValues != null) {
- for (int i = 0; i < enumValues.length; i++) {
- EEnumLiteral enumLiteral = createEEnumLiteral();
- // enumVal.setXMIDocument(dtdattr.getXMIDocument());
- // MOF2EMF Port
- // enumLiteral.refSetLiteral(enumValues[i]);
- enumLiteral.setName(enumValues[i]);
-
- // enumLiteral.setNumber(i);
- enumeration.getEnumLiterals().add(enumLiteral);
- }
- }
- dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
- return enumeration;
- }
-
- private EEnumLiteral createEEnumLiteral() {
- EcorePackage ePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
- // MOF2EMF Port
- // return ((EcoreFactory)ePackage.getFactory()).createEEnumLiteral();
- return ePackage.getEcoreFactory().createEEnumLiteral();
- }
-
- private DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, AttNode attdef, int enumKind) {
- DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
- DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
- enumeration.setKind(groupKind);
- dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
-
- // Enumeration values
- Enumeration tokenIter = attdef.elements();
- if (tokenIter != null) {
- while (tokenIter.hasMoreElements()) {
- String val = (String) tokenIter.nextElement();
- EEnumLiteral enumLiteral = createEEnumLiteral();
- // enumLiteral.setXMIDocument(dtdattr.getXMIDocument());
- // MOF2EMF Port
- // enumLiteral.refSetLiteral(val);
- enumLiteral.setName(val);
-
-
- // enumLiteral.setNumber(i++);
- enumeration.getEnumLiterals().add(enumLiteral);
- }
- }
-
- return enumeration;
- }
-
- private boolean isDefaultEnumValueValid(AttNode attdef, String defaultValue) {
- boolean valid = false;
- boolean containsPercent = false;
-
- // Enumeration values
- Enumeration enumValues = attdef.elements();
- while (enumValues.hasMoreElements()) {
- String val = (String) enumValues.nextElement();
- if (val.equals(defaultValue)) {
- valid = true;
- break;
- }
- if (val.indexOf('%') >= 0) {
- containsPercent = true;
- }
- }
- return valid || containsPercent;
- }
-
- public void setAttrDTDType(DTDAttribute dtdattr, DTDType type) {
- dtdattr.setDTDType(type);
- }
-
- protected void addErrorMessage(ErrorMessage errMsg, Object obj) {
- errMsg.setObject(obj);
- dtdUtil.addErrorMessage(errMsg);
- }
-
- // /**
- // * @generated
- // */
- // protected DTDFactoryImpl getFactoryGen() {
- //
- // return (DTDFactoryImpl)dtdUtil.getFactory();
- // }
- // /**
- // * @generated
- // */
- // protected DTDFile getDTDFileGen() {
- //
- // return dtdFile;
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDGen(DTD dtd) {
- //
- // super.visitDTD(dtd);
- //
- //
- // // - 2nd pass -
- // // do final processing for Attlists and adding contentModel
- // addAttlistAndContentModel(dtd,dtdFile);
- // }
- // /**
- // * @generated
- // */
- // protected void visitElementDeclGen(ElementDecl element) {
- //
- // // Element might have been added earlier because it is referenced
- // String declName = element.getNodeName() ;
- // // System.out.println("process ElementDecl:" + declName );
- // DTDElement dtdelement = (DTDElement)
- // dtdUtil.getElementPool().get(declName);
- // if (dtdelement == null)
- // {
- // // System.out.println("process ElementDecl - not found - create" );
- // dtdelement = getFactory().createDTDElement();
- // dtdelement.setName(declName);
- // dtdFile.getDTDObject().add(dtdelement);
- // dtdUtil.getElementPool().put(declName,dtdelement);
- // }
- //
- //
- // super.visitElementDecl(element);
- // }
- // /**
- // * @generated
- // */
- // protected void visitNotationDeclGen(NotationDecl notation) {
- //
- // // Notation might have been added earlier because it is referenced
- // // by an entity
- // DTDNotation dtdnot = dtdFile.findNotation( notation.getNodeName() );
- // if (dtdnot == null)
- // {
- // dtdnot = getFactory().createDTDNotation();
- // dtdFile.getDTDObject().add(dtdnot);
- // }
- // dtdnot.setName(notation.getNodeName());
- //
- //
- // if (notation.getSystemId()!= null )
- // dtdnot.setSystemID(notation.getSystemId());
- // if (notation.getPublicId()!= null )
- // dtdnot.setPublicID(notation.getPublicId());
- //
- //
- // if (notation.getComment()!=null)
- // dtdnot.setComment(notation.getComment());
- // if (notation.getErrorMessage()!=null)
- // {
- // addErrorMessage(notation.getErrorMessage(), dtdnot);
- // }
- //
- //
- // super.visitNotationDecl(notation);
- // }
- // /**
- // * @generated
- // */
- // protected void visitParameterEntityReferenceDeclGen(EntityDecl entity)
- // {
- //
- // // This is a parameter entity reference.
- // // Add the link to the real entity that it references
- // DTDParameterEntityReference parmEntRef =
- // getFactory().createDTDParameterEntityReference();
- // dtdFile.getDTDObject().add(parmEntRef);
- //
- //
- // String entityName = entity.getNodeName();
- //
- //
- // // Add the reference to the DTDEntity
- // DTDEntity dtdentity = getDTDFile().findEntity(entityName);
- // if (dtdentity != null)
- // {
- // parmEntRef.setEntity(dtdentity);
- // }
- // if (entity.getErrorMessage()!=null)
- // {
- // addErrorMessage(entity.getErrorMessage(), dtdentity);
- // }
- // // System.out.println("adding PE reference: " + declName);
- //
- //
- // super.visitParameterEntityReferenceDecl(entity);
- // }
- // /**
- // * @generated
- // */
- // protected void visitExternalEntityDeclGen(EntityDecl entity) {
- //
- // DTDEntity dtdEntity = createDTDEntity(entity);
- // // System.out.println("adding entity: " + declName);
- // DTDExternalEntity extEntity = getFactory().createDTDExternalEntity();
- // dtdEntity.setContent(extEntity);
- //
- //
- // finishExternalEntity(extEntity, entity);
- // // System.out.println(" ext entity toMof: " );
- // if (dtdEntity.isParameterEntity())
- // {
- //
- //
- // dtdUtil.getPEPool().put("%"+entity.getNodeName()+";", dtdEntity);
- // }
- //
- //
- // super.visitExternalEntityDecl(entity);
- // }
- // /**
- // * @generated
- // */
- // protected void visitInternalEntityDeclGen(EntityDecl entity) {
- //
- // DTDEntity dtdEntity = createDTDEntity(entity);
- //
- //
- // DTDInternalEntity intEntity = getFactory().createDTDInternalEntity();
- // dtdEntity.setContent(intEntity);
- // intEntity.setValue(entity.getValue());
- // // System.out.println(" int entity toMof: " );
- // if (dtdEntity.isParameterEntity())
- // {
- // dtdUtil.getPEPool().put("%"+entity.getNodeName()+";", dtdEntity);
- // }
- //
- //
- // super.visitInternalEntityDecl(entity);
- // }
- // /**
- // * @generated
- // */
- // protected void addAttlistAndContentModelGen(DTD dtd, DTDFile dFile) {
- //
- // //System.out.println("addAttListAndCotentModel - dtd:" +
- // dtd.getName());
- // Enumeration en = dtd.externalElements();
- // while (en.hasMoreElements())
- // {
- // Object e = en.nextElement();
- // if ( e instanceof ElementDecl )
- // {
- // DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(
- // ((ElementDecl)e).getNodeName() );
- // if (dtdelement == null)
- // {
- // dtdelement = getFactory().createDTDElement();
- // dtdFile.getDTDObject().add(dtdelement);
- // }
- // finishElementDecl(dtdelement, (ElementDecl) e);
- // }
- // else if ( e instanceof Attlist )
- // {
- // processAttList((Attlist) e);
- // }
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void processAttListGen(Attlist attList) {
- //
- // DTDElement e = (DTDElement)
- // dtdUtil.getElementPool().get(attList.getNodeName());
- // if ( e != null )
- // {
- // // Element has been added. Add the attributes
- // //System.out.println(" processAttlist - adding Attlist:" +
- // attList.getNodeName());
- // createAttributes(e, attList);
- // }
- // else
- // {
- // //System.out.println("!!!!!!!!! element is null ");
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void finishExternalEntityGen(DTDExternalEntity extEntity,
- // EntityDecl entityDecl) {
- //
- // updateSystemID(extEntity, entityDecl);
- // extEntity.setPublicID(entityDecl.getPublicId());
- //
- //
- // String notationName = entityDecl.getNotationName();
- // if (notationName != null)
- // {
- // DTDNotation dtdNotation = createOrFindNotation(extEntity,
- // notationName,true);
- // extEntity.setNotation(dtdNotation);
- // }
- // }
- // /**
- // * @generated
- // */
- // protected DTDNotation createOrFindNotationGen(DTDExternalEntity
- // extEntity, String name, boolean create) {
- //
- // DTDNotation aNotation =
- // extEntity.getDTDEntity().getDTDFile().findNotation(name);
- // if (aNotation != null)
- // {
- // return aNotation;
- // }
- //
- //
- // //
- // // Create a notation for the reference
- // //
- // if (create)
- // {
- // aNotation = getFactory().createDTDNotation();
- // dtdFile.getDTDObject().add(aNotation);
- // aNotation.setName(name);
- // }
- // return aNotation;
- // }
- // /**
- // * The SystemID attribute is set to whatever the user enters
- // * e.g. com/ibm/b2b/xmimodels/xxx.dtd.xmi
- // *
- // * In the unparse() method, parse out the DTD file name from
- // * the classpath name.
- // * e.g. returns xxx.dtd
- // */
- // protected void updateSystemIDGen(DTDExternalEntity extEntity,
- // EntityDecl entityDecl) {
- //
- // String systemId = entityDecl.getSystemId();
- // String publicId = entityDecl.getPublicId();
- // if (systemId != null)
- // {
- // IdResolver idResolver = new IdResolverImpl(dtd.getName());
- // String uri = idResolver.resolveId(publicId, systemId);
- // ExternalDTDModel ed = dtdUtil.getExternalDTDModel(resources, uri);
- // if (ed != null)
- // {
- // DTDFile referenceDtdFile = ed.getExternalDTDFile();
- // extEntity.setEntityReferencedFromAnotherFile(referenceDtdFile);
- // extEntity.setSystemID(systemId);
- // }
- // else
- // {
- // if (entityDecl.getErrorMessage() == null)
- // {
- // ErrorMessage dtdError = new ErrorMessage();
- // dtdError.setErrorMessage(DTDCoreMessages.getString("_ERROR_INCL_FILE_LOAD_FAILURE")
- // + " '" + systemId + "'");
- // addErrorMessage(dtdError, extEntity.getDTDEntity());
- // }
- //
- // if (systemId != null)
- // {
- // extEntity.setSystemID(systemId);
- // }
- // else
- // {
- // extEntity.setSystemID("");
- // }
- // }
- // } // end of if ()
- // else
- // {
- // // set the system id to be ""
- // extEntity.setSystemID("");
- // }
- // }
- // /**
- // * @generated
- // */
- // protected DTDEntity createDTDEntityGen(EntityDecl entity) {
- //
- // // create and do what we can to fill in some basic things
- // DTDEntity dtdEntity = getFactory().createDTDEntity();
- // dtdFile.getDTDObject().add(dtdEntity);
- //
- //
- // dtdEntity.setName(entity.getNodeName());
- // dtdEntity.setParameterEntity(entity.isParameter());
- // if (entity.getComment()!=null)
- // {
- // dtdEntity.setComment(entity.getComment());
- // }
- // if (entity.getErrorMessage()!=null)
- // {
- // addErrorMessage(entity.getErrorMessage(), dtdEntity);
- // }
- //
- //
- // return dtdEntity;
- // }
- // /**
- // * @generated
- // */
- // protected void finishElementDeclGen(DTDElement dtdElement, ElementDecl
- // ed) {
- //
- // dtdElement.setName(ed.getNodeName());
- //
- //
- // CMNode cmNode = ed.getContentModelNode();
- //
- //
- // if (ed.getComment()!=null)
- // {
- // dtdElement.setComment(ed.getComment());
- // }
- // if (ed.getErrorMessage()!=null)
- // {
- // addErrorMessage(ed.getErrorMessage(), dtdElement);
- // }
- //
- //
- // if (cmNode instanceof CMBasicNode)
- // {
- // CMBasicNode bn = (CMBasicNode)cmNode;
- // switch (bn.getType())
- // {
- // case CMNodeType.EMPTY :
- // DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- // dtdElement.setContent(emptyContent);
- // break;
- //
- //
- // case CMNodeType.ANY :
- // DTDAnyContent anyContent = getFactory().createDTDAnyContent();
- // dtdElement.setContent(anyContent);
- // break;
- //
- //
- // case CMNodeType.PCDATA:
- // DTDPCDataContent pcData = getFactory().createDTDPCDataContent();
- // dtdElement.setContent(pcData);
- // }
- //
- //
- // }
- // else if (cmNode instanceof CMReferenceNode)
- // {
- // CMReferenceNode rn = (CMReferenceNode) cmNode;
- // if (rn.getType() == CMNodeType.ENTITY_REFERENCE)
- // {
- // String entityName = rn.getName().trim();
- //
- //
- // DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
- // if (anEntity!=null)
- // {
- // //
- // // Create an DTDEntityReference and set its referenced element
- // //
- // DTDEntityReferenceContent enRef =
- // getFactory().createDTDEntityReferenceContent();
- // enRef.setElementReferencedEntity(anEntity);
- //
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(rn));
- // enRef.setOccurrence(occurrenceType);
- //
- // dtdElement.setContent(enRef);
- // }
- // else
- // { // create default content
- // DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- // dtdElement.setContent(emptyContent);
- // }
- // }
- // else
- // {
- // //
- // // Find the real element for this element references
- // // If the real element does not yet exist, create it
- // //
- // DTDElement anElement = createOrFindElement(rn.getName(), dtdElement);
- //
- //
- // //
- // // Create an DTDElementReference and set its referenced element
- // //
- // DTDElementReferenceContent elemRef =
- // getFactory().createDTDElementReferenceContent();
- // elemRef.setReferencedElement(anElement);
- //
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(rn));
- // elemRef.setOccurrence(occurrenceType);
- //
- // // setContent to DTDElementReference
- // dtdElement.setContent(elemRef);
- //
- //
- // }
- // }
- // else if (cmNode instanceof CMGroupNode)
- // {
- // CMGroupNode grpNode = (CMGroupNode)cmNode;
- // DTDGroupContent groupContent = getFactory().createDTDGroupContent();
- // DTDGroupKind groupKind =
- // DTDGroupKind.get(computeMofGroupKind(grpNode.getGroupKind()));
- // groupContent.setGroupKind(groupKind);
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(grpNode));
- // groupContent.setOccurrence(occurrenceType);
- //
- // // just use the locator for the element as the closest guess
- // processGroupContent(groupContent, grpNode);
- // dtdElement.setContent(groupContent);
- // }
- // else if (cmNode == null)
- // {
- // // bad thing happened here, just create a pcdata
- // DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
- // dtdElement.setContent(emptyContent);
- // }
- // }
- // /**
- // * Add a new group to the current group
- // * @param parent - the parent node for this group element
- // * @param op1Node - the group
- // * e.g. (a,b)
- // * @param op2Node - set only if called by processCM1op
- // * e.g. (a,b)+
- // */
- // protected void processGroupContentGen(DTDGroupContent parent,
- // CMGroupNode grpNode) {
- //
- // Enumeration children = grpNode.getChildren().elements();
- // DTDFactory factory = getFactory();
- // while (children.hasMoreElements())
- // {
- // CMNode cnode = (CMNode) children.nextElement();
- //
- //
- // if (cnode instanceof CMGroupNode)
- // {
- // CMGroupNode gNode = (CMGroupNode)cnode;
- // DTDGroupContent groupContent = factory.createDTDGroupContent();
- // DTDGroupKind groupKind =
- // DTDGroupKind.get(computeMofGroupKind(gNode.getGroupKind()));
- // groupContent.setGroupKind(groupKind);
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(gNode));
- // groupContent.setOccurrence(occurrenceType);
- //
- // parent.getContent().add(groupContent);
- // processGroupContent(groupContent,gNode);
- // }
- // else if (cnode instanceof CMBasicNode)
- // {
- // CMBasicNode n = (CMBasicNode)cnode;
- // if (n.getType() == CMNodeType.PCDATA)
- // {
- // // Create a DTDPCDataContent for a leaf PCData node
- // //
- // DTDPCDataContent pcData = factory.createDTDPCDataContent();
- // // Add #PCDATA to the Group, i.e Mixed content model
- // parent.getContent().add(pcData);
- // }
- // }
- // else if (cnode instanceof CMReferenceNode)
- // {
- // CMReferenceNode rn = (CMReferenceNode)cnode;
- // if (rn.getType()==CMNodeType.ELEMENT_REFERENCE)
- // {
- // // System.out.println("CM Element Ref name: " + rn.getName());
- // //
- // // Create an DTDElementReference and set its referenced element
- // //
- // DTDElementReferenceContent elemRef =
- // factory.createDTDElementReferenceContent();
- //
- //
- // //
- // // Find the real element for this element references
- // // If the real element does not yet exist, create it
- // //
- // DTDElement anElement = createOrFindElement(rn.getName(), elemRef);
- //
- //
- // elemRef.setReferencedElement(anElement);
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(rn));
- // elemRef.setOccurrence(occurrenceType);
- //
- // // Add DTDElementReference to the Group
- // parent.getContent().add(elemRef);
- // }
- // else // PE Reference
- // {
- // String entityName = rn.getName().trim();
- //
- //
- // // System.out.println("CM PE Ref name: " + entityName);
- // DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
- // if (anEntity!=null)
- // {
- // //
- // // Create an DTDEntityReference and set its referenced element
- // //
- // DTDEntityReferenceContent enRef =
- // factory.createDTDEntityReferenceContent();
- // enRef.setElementReferencedEntity(anEntity);
- //
- // DTDOccurrenceType occurrenceType =
- // DTDOccurrenceType.get(computeMofOccurrence(rn));
- // enRef.setOccurrence(occurrenceType);
- //
- //
- // // Add DTDEntityReference to the Group
- // parent.getContent().add(enRef);
- //
- //
- // }
- // }
- // }
- // }
- // }
- // /**
- // * Find the real element that is referenced by the current element
- // */
- // protected DTDElement createOrFindElementGen(String name, Object obj) {
- //
- // // DTDElement aElement = getDTDFile().findElement(name);
- //
- //
- // DTDElement aElement = (DTDElement) dtdUtil.getElementPool().get(name);
- //
- //
- // if (aElement != null)
- // {
- // return aElement;
- // }
- //
- //
- // String errorMsg =
- // DTDCoreMessages.getString("_ERROR_UNDECLARED_ELEMENT_1");
- // errorMsg += "\"" + name + "\"";
- // errorMsg +=
- // DTDCoreMessages.getString("_UI_ERRORPART_UNDECLARED_ELEMENT_2");
- //
- //
- // ErrorMessage dtdError = new ErrorMessage();
- //
- // dtdError.setErrorMessage(errorMsg);
- // addErrorMessage(dtdError, obj);
- // // System.out.println(errorMsg);
- // // setDTDErrorMessage(errorMsg);
- // getDTDFile().setParseError(true);
- //
- //
- // //
- // // Create an empty element for the reference to make it valid
- // //
- //
- //
- // DTDFactory factory = getFactory();
- // DTDElement dtdelement = factory.createDTDElement();
- // dtdelement.setName(name);
- //
- //
- // DTDEmptyContent emptyContent = factory.createDTDEmptyContent();
- // dtdelement.setContent(emptyContent);
- //
- //
- // getDTDFile().getDTDObject().add(dtdelement);
- // dtdUtil.getElementPool().put(name,dtdelement);
- // return dtdelement;
- // }
- // /**
- // * Compute the MOF occurrence from the xml4j occurrence
- // */
- // protected int computeMofOccurrenceGen(CMRepeatableNode rnode) {
- //
- // int occurrence = rnode.getOccurrence();
- // int mofoccur = DTDOccurrenceType.ONE;
- //
- //
- // if (occurrence == CMNodeType.ZERO_OR_MORE)
- // {
- // mofoccur = DTDOccurrenceType.ZERO_OR_MORE;
- // }
- // else if (occurrence == CMNodeType.ONE_OR_MORE)
- // {
- // mofoccur = DTDOccurrenceType.ONE_OR_MORE;
- // }
- // else if (occurrence == CMNodeType.OPTIONAL)
- // {
- // mofoccur = DTDOccurrenceType.OPTIONAL;
- // }
- // return mofoccur;
- // }
- // /**
- // * Compute the MOF model group from the xml4j model group
- // */
- // protected int computeMofGroupKindGen(int type) {
- //
- // if (type == CMNodeType.GROUP_CHOICE)
- // {
- // return DTDGroupKind.CHOICE;
- // }
- // else
- // {
- // return DTDGroupKind.SEQUENCE;
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void createAttributesGen(DTDElement element, Attlist attList)
- // {
- //
- // if (attList.getErrorMessage()!=null)
- // {
- // addErrorMessage(attList.getErrorMessage(), element);
- // }
- //
- //
- // for (int i=0;i<attList.size();i++)
- // {
- // AttNode ad = (AttNode) attList.elementAt(i);
- // // DTDAttributeElement dtdAtt= getDTDAttributeElement(a.getName());
- //
- //
- // // only add the AttDef if it is not added yet
- // // ignore the dup AttDef as documented in the XML 1.0 specs
- // //if( dtdAtt==null)
- // addAttribute(element, ad);
- // }
- // }
- // /**
- // * Create a DTDAttribute from the xml4j attribute
- // */
- // protected void addAttributeGen(DTDElement dtdelement, AttNode ad) {
- //
- // DTDAttribute dtdattr = getFactory().createDTDAttribute();
- // dtdelement.getDTDAttribute().add(dtdattr);
- // finishAttribute(dtdattr, ad);
- // }
- // /**
- // * @generated
- // */
- // protected void finishAttributeGen(DTDAttribute dtdattr, AttNode attdef)
- // {
- //
- // boolean parseError = false;
- //
- //
- // if (attdef.name.startsWith("%"))
- // {
- // String peName = attdef.name.trim();
- // DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
- // if (en!=null)
- // {
- // dtdattr.setAttributeNameReferencedEntity(en);
- // }
- // }
- //
- //
- // dtdattr.setName(attdef.name);
- //
- //
- // int attrType = attdef.getDeclaredType();
- //
- //
- // if (attrType==AttNode.PEREFERENCE && attdef.type!=null)
- // {
- // String peName = attdef.type.trim();
- // DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
- // if (en!=null)
- // {
- // dtdattr.setAttributeTypeReferencedEntity(en);
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA()); // hack,
- // so we can get back the default value
- // }
- // else //set default type
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
- //
- //
- // }
- // else
- // {
- // switch (attrType)
- // {
- // case AttNode.CDATA:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
- // break;
- //
- //
- // case AttNode.ENTITIES:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITIES());
- // break;
- //
- //
- // case AttNode.ENTITY:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITY());
- // break;
- //
- //
- // case AttNode.ID:
- // // check for duplicate ID attribute
- // if (hasIDAttribute(dtdattr))
- // {
- // String errMsg = DTDCoreMessages.getString("_ERROR_DUP_ID_ATTRIBUTE_1");
- // errMsg += attdef.name +
- // DTDCoreMessages.getString("_UI_ERRORPART_DUP_ID_ATTRIBUTE_2");
- // // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
- // // dtdattr.getDTDElement().getDTDFile().setParseError(true);
- // parseError = true;
- // }
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ID());
- // break;
- //
- //
- // case AttNode.IDREF:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREF());
- // break;
- //
- //
- // case AttNode.IDREFS:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREFS());
- // break;
- //
- //
- // case AttNode.ENUMERATION:
- // setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef,
- // DTDEnumGroupKind.NAME_TOKEN_GROUP));
- // break;
- //
- //
- // case AttNode.NOTATION:
- // setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef,
- // DTDEnumGroupKind.NOTATION_GROUP));
- // break;
- //
- //
- // case AttNode.NMTOKEN:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKEN());
- // break;
- //
- //
- // case AttNode.NMTOKENS:
- // setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKENS());
- // break;
- //
- //
- // default:
- // // System.out.println("DTDATTR '" +attdef.name + "'Unknown type..." +
- // attrType);
- // }
- // }
- //
- //
- // int attrDefault = attdef.getDefaultType();
- // int defaultKind = DTDDefaultKind.IMPLIED;
- // switch (attrDefault)
- // {
- // case AttNode.FIXED:
- // defaultKind = DTDDefaultKind.FIXED;
- // break;
- //
- //
- // case AttNode.IMPLIED:
- // defaultKind = DTDDefaultKind.IMPLIED;
- // break;
- //
- //
- // case AttNode.REQUIRED:
- // defaultKind = DTDDefaultKind.REQUIRED;
- // break;
- //
- //
- // case AttNode.NOFIXED:
- // defaultKind = DTDDefaultKind.NOFIXED;
- // break;
- //
- //
- // default:
- // // System.out.println("DTDATTR '" +attdef.name + "' Unknown default
- // type... " + attrDefault);
- // }
- //
- // DTDDefaultKind defaultKindObj = DTDDefaultKind.get(defaultKind);
- // dtdattr.setDefaultKind(defaultKindObj);
- //
- // if (parseError)
- // {
- // return;
- // }
- //
- //
- // String defaultValue = attdef.defaultValue;
- // if (defaultValue != null)
- // {
- // if (attrType == AttNode.ENUMERATION || attrType == AttNode.NOTATION)
- // {
- // if (! isDefaultEnumValueValid(attdef,defaultValue))
- // {
- // String typeString =
- // (attrType==AttNode.ENUMERATION?"enumeration":"notation");
- // String errMsg =
- // DTDCoreMessages.getString("_ERROR_INVALID_DEFAULT_ATTR_VALUE_1");
- // errMsg += typeString +
- // DTDCoreMessages.getString("_UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2");
- // errMsg += attdef.name + "'";
- //
- //
- // // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
- // // dtdattr.getDTDElement().getDTDFile().setParseError(true);
- // return;
- // }
- // }
- // dtdattr.setDefaultValueString(defaultValue);
- // }
- // // System.out.println("DTDAttr - toMof getDefaultValueString " +
- // getDefaultValueString());
- // // System.out.println("DTDAttr - toMof getDefaultValue: " +
- // getDefaultValue());
- // }
- // /**
- // * @generated
- // */
- // protected boolean hasIDAttributeGen(DTDAttribute dtdattr) {
- //
- // boolean hasID = false;
- //
- //
- // DTDElement element = dtdattr.getDTDElement();
- // EList attrs = element.getDTDAttribute();
- //
- //
- // Iterator i = attrs.iterator();
- // while (i.hasNext())
- // {
- // DTDAttribute attr = (DTDAttribute) i.next();
- // DTDType dType = attr.getDTDType();
- // if (dType instanceof DTDBasicType)
- // {
- // if ( ((DTDBasicType)dType).getKind().getValue() == DTDBasicTypeKind.ID)
- // {
- // hasID = true;
- // break;
- // }
- // }
- // }
- // return hasID;
- // }
- // /**
- // * @generated
- // */
- // protected DTDEnumerationType createDTDEnumerationGen(DTDAttribute
- // dtdattr, String[] enumValues, int enumKind) {
- //
- // DTDEnumerationType enum = getFactory().createDTDEnumerationType();
- // // This is gross, but this is what was done before.
- // DTDAttributeImpl dtdattrimpl = (DTDAttributeImpl) dtdattr;
- // // enum.setID("Enum_" +
- // ((DTDElement)dtdattrimpl.getMOFDomain()).getName() + "_" +
- // dtdattr.getName());
- // DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
- // enum.setKind(groupKind);
- // // Enumeration values
- // if (enumValues!=null)
- // {
- // for(int i=0;i<enumValues.length;i++)
- // {
- // EEnumLiteral enumLiteral = createEEnumLiteral();
- // // enumVal.setXMIDocument(dtdattr.getXMIDocument());
- // enumLiteral.refSetLiteral(enumValues[i]);
- // // enumLiteral.setNumber(i);
- // enum.getEnumLiterals().add(enumLiteral);
- // }
- // }
- // dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enum);
- // return enum;
- // }
- // /**
- // * @generated
- // */
- // protected EEnumLiteral createEEnumLiteralGen() {
- //
- // EcorePackage ePackage =
- // (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
- // return ((EcoreFactory)ePackage.getFactory()).createEEnumLiteral();
- // }
- // /**
- // * @generated
- // */
- // protected DTDEnumerationType createDTDEnumerationGen(DTDAttribute
- // dtdattr, AttNode attdef, int enumKind) {
- //
- // DTDEnumerationType enum = getFactory().createDTDEnumerationType();
- // // This is gross, but this is what was done before.
- // DTDAttributeImpl dtdattrimpl = (DTDAttributeImpl) dtdattr;
- // // enum.setID("Enum_" +
- // ((DTDElement)dtdattrimpl.getMOFDomain()).getName() + "_" +
- // dtdattr.getName());
- // DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
- // enum.setKind(groupKind);
- // dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enum);
- //
- //
- // // Enumeration values
- // Enumeration tokenIter = attdef.elements();
- // if (tokenIter != null) {
- // int i=0;
- // while (tokenIter.hasMoreElements())
- // {
- // String val = (String)tokenIter.nextElement();
- // EEnumLiteral enumLiteral = createEEnumLiteral();
- // // enumLiteral.setXMIDocument(dtdattr.getXMIDocument());
- //
- //
- // enumLiteral.refSetLiteral(val);
- // // enumLiteral.setNumber(i++);
- // enum.getEnumLiterals().add(enumLiteral);
- // }
- // }
- //
- //
- // return enum;
- // }
- // /**
- // * @generated
- // */
- // protected boolean isDefaultEnumValueValidGen(AttNode attdef, String
- // defaultValue) {
- //
- // boolean valid = false;
- // boolean containsPercent = false;
- //
- //
- // // Enumeration values
- // Enumeration enumValues = attdef.elements();
- // while (enumValues.hasMoreElements())
- // {
- // String val = (String)enumValues.nextElement();
- // if (val.equals(defaultValue))
- // {
- // valid = true;
- // break;
- // }
- // if (val.indexOf('%') >= 0)
- // {
- // containsPercent = true;
- // }
- // }
- // return valid || containsPercent;
- // }
- // /**
- // * @generated
- // */
- // protected void setAttrDTDTypeGen(DTDAttribute dtdattr, DTDType type) {
- //
- // dtdattr.setDTDType(type);
- // }
- // /**
- // * @generated
- // */
- // protected void addErrorMessageGen(ErrorMessage errMsg, Object obj) {
- //
- // errMsg.setObject(obj);
- // dtdUtil.addErrorMessage(errMsg);
- // }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java
deleted file mode 100644
index 0f4a31943b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDSourceOffset;
-
-public class DTDObjectFinder extends DTDVisitor {
- public class SourceOffset {
- // Convenience class to find containment of object
- private int start, end;
-
- public SourceOffset(int start, int end) {
- this.start = start;
- this.end = end;
- }
-
- public boolean contains(SourceOffset other) {
- if (this.start <= other.start && other.start <= this.end) {
- return true;
- } // end of if ()
- return false;
- }
-
- }
-
- SourceOffset searchLocation;
-
- private SourceOffset offsetObjectFor(DTDSourceOffset s) {
- return new SourceOffset(s.getStartOffset(), s.getEndOffset());
- }
-
- private void checkContainment(DTDObject o) {
- if (offsetObjectFor((DTDSourceOffset) o).contains(searchLocation)) {
- closestObject = o;
- } // end of if ()
- }
-
- public DTDObjectFinder(int startOffset, int endOffset) {
- searchLocation = new SourceOffset(startOffset, endOffset);
- }
-
- public void visitDTDNotation(DTDNotation notation) {
- checkContainment(notation);
- super.visitDTDNotation(notation);
- }
-
- public void visitDTDEntity(DTDEntity entity) {
- checkContainment(entity);
- super.visitDTDEntity(entity);
- }
-
- public void visitDTDElement(DTDElement element) {
- checkContainment(element);
- super.visitDTDElement(element);
- }
-
- public void visitDTDAttribute(DTDAttribute attribute) {
- checkContainment(attribute);
- super.visitDTDAttribute(attribute);
- }
-
- public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
- checkContainment(parmEntity);
- super.visitDTDParameterEntityReference(parmEntity);
- }
-
- public void visitDTDElementContent(DTDElementContent content) {
- checkContainment(content);
- super.visitDTDElementContent(content);
- }
-
- private DTDObject closestObject = null;
-
- public DTDObject getClosestObject() {
- return closestObject;
- }
-
- /**
- * @generated
- */
- protected SourceOffset offsetObjectForGen(DTDSourceOffset s) {
-
- return new SourceOffset(s.getStartOffset(), s.getEndOffset());
- }
-
- /**
- * @generated
- */
- protected void checkContainmentGen(DTDObject o) {
-
- if (offsetObjectFor((DTDSourceOffset) o).contains(searchLocation)) {
- closestObject = o;
- } // end of if ()
- }
-
- /**
- * @generated
- */
- protected void visitDTDNotationGen(DTDNotation notation) {
-
- checkContainment(notation);
- super.visitDTDNotation(notation);
- }
-
- /**
- * @generated
- */
- protected void visitDTDEntityGen(DTDEntity entity) {
-
- checkContainment(entity);
- super.visitDTDEntity(entity);
- }
-
- /**
- * @generated
- */
- protected void visitDTDElementGen(DTDElement element) {
-
- checkContainment(element);
- super.visitDTDElement(element);
- }
-
- /**
- * @generated
- */
- protected void visitDTDAttributeGen(DTDAttribute attribute) {
-
- checkContainment(attribute);
- super.visitDTDAttribute(attribute);
- }
-
- /**
- * @generated
- */
- protected void visitDTDParameterEntityReferenceGen(DTDParameterEntityReference parmEntity) {
-
- checkContainment(parmEntity);
- super.visitDTDParameterEntityReference(parmEntity);
- }
-
- /**
- * @generated
- */
- protected void visitDTDElementContentGen(DTDElementContent content) {
-
- checkContainment(content);
- super.visitDTDElementContent(content);
- }
-
- /**
- * @generated
- */
- protected DTDObject getClosestObjectGen() {
-
- return closestObject;
- }
-}// DTDObjectFinder
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java
deleted file mode 100644
index 72063c4811..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java
+++ /dev/null
@@ -1,352 +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.dtd.core.internal.emf.util;
-
-
-
-public class DTDPathnameUtil {
- static public String makePath(String parentPath, String type, String name, int cnt) {
- String pn = null;
- name = encode(name);
- if ((name == null) && (cnt <= 0)) {
- pn = type;
- }
- else if (cnt <= 0) {
- pn = type + ":" + ((name == null) ? "" : name); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- pn = type + ":" + ((name == null) ? "" : name) + ":" + cnt; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- if (parentPath != null) {
- return parentPath + "." + pn; //$NON-NLS-1$
- }
- else {
- return pn;
- }
- }
-
- static public Object[] parsePathComponent(String path) {
- /*
- * This routine parse the first component of the path and returns the
- * result in an arrray of Strings. result[0] = type (String) result[1] =
- * name (String) result[2] = count (Integer) result[3] = the rest of
- * the path (String)
- *
- * E.g. PathComponent result[0] result[1] result[2] result[3]
- * ------------------------------------------------------------- type
- * type <null> <null> <null> type.rest type <null> <null> rest
- * type:name type name <null> <null> type:name.rest type name <null>
- * rest type::n type <null> n <null> type::n.rest type <null> n rest
- * type:name:n type name n <null> type:name:n.rest type name n rest
- */
-
- Object[] result = new Object[4];
- if (path == null)
- return result;
-
- int i = path.indexOf('.');
- int length = path.length();
-
- if (i < 0) {
- i = length;
- }
-
- String type = null;
- String name = null;
- Integer n = null;
- String rest = null;
-
- // get the type
- int j = path.indexOf(':');
- if (j > i)
- j = -1;
- if (j < 0) {
- type = path.substring(0, i);
- }
- else {
- type = path.substring(0, j);
-
- // get the name
- int k = path.indexOf(':', j + 1);
- if (k > i)
- k = -1;
- if (k < 0) {
- name = path.substring(j + 1, i);
- }
- else {
- name = path.substring(j + 1, k);
-
- // get the count
- try {
- n = new Integer(path.substring(k + 1, i));
- }
- catch (Exception exc) {
- }
- if ((n != null) && (n.intValue() < 0)) {
- n = null;
- }
- }
- }
-
- if ((name != null) && (name.length() == 0)) {
- name = null;
- }
-
- if (i < length) {
- rest = path.substring(i + 1);
- }
-
- result[0] = type;
- result[1] = decode(name);
- result[2] = n;
- result[3] = rest;
- return result;
- }
-
- static private String encode(String s) {
- if (s == null)
- return null;
- StringBuffer o = new StringBuffer(s.length());
- int len = s.length();
- for (int i = 0; i < len; i++) {
- char c = s.charAt(i);
- if (Character.isLetterOrDigit(c) || (c == '-')) {
- o.append(c);
- }
- else { // if ((c == '.') || (c == ':') || (c == '_') || ...)
- // convert the character to a 4 digit hex code prefixed by "_"
- String hex = Integer.toHexString(c);
- int l = hex.length();
- if (l == 1) {
- o.append("_000"); //$NON-NLS-1$
- o.append(hex);
- }
- else if (l == 2) {
- o.append("_00"); //$NON-NLS-1$
- o.append(hex);
- }
- else if (l == 3) {
- o.append("_0"); //$NON-NLS-1$
- o.append(hex);
- }
- else {
- o.append('_');
- o.append(hex);
- }
- }
- } // for
- return o.toString();
- }
-
- static private String decode(String s) {
- if (s == null)
- return null;
- StringBuffer o = new StringBuffer(s.length());
- int len = s.length();
- for (int i = 0; i < len; i++) {
- char c = s.charAt(i);
- if (c != '_') {
- o.append(c);
- }
- else { // next 4 characters are the hex code
- String hex;
- if (len > i + 4) {
- hex = s.substring(i + 1, i + 5);
- i += 4;
- }
- else {
- hex = s.substring(i + 1);
- i = len - 1;
- }
- o.append((char) Integer.parseInt(hex, 16));
- }
- } // for
- return o.toString();
- }
-
- /**
- * @generated
- */
- protected static String makePathGen(String parentPath, String type, String name, int cnt) {
-
- String pn = null;
- name = encode(name);
- if ((name == null) && (cnt <= 0)) {
- pn = type;
- }
- else if (cnt <= 0) {
- pn = type + ":" + ((name == null) ? "" : name); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- pn = type + ":" + ((name == null) ? "" : name) + ":" + cnt; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- if (parentPath != null) {
- return parentPath + "." + pn; //$NON-NLS-1$
- }
- else {
- return pn;
- }
- }
-
- /**
- * @generated
- */
- protected static Object[] parsePathComponentGen(String path) {
-
- /*
- * This routine parse the first component of the path and returns the
- * result in an arrray of Strings. result[0] = type (String) result[1] =
- * name (String) result[2] = count (Integer) result[3] = the rest of
- * the path (String)
- *
- * E.g. PathComponent result[0] result[1] result[2] result[3]
- * ------------------------------------------------------------- type
- * type <null> <null> <null> type.rest type <null> <null> rest
- * type:name type name <null> <null> type:name.rest type name <null>
- * rest type::n type <null> n <null> type::n.rest type <null> n rest
- * type:name:n type name n <null> type:name:n.rest type name n rest
- */
-
- Object[] result = new Object[4];
- if (path == null)
- return result;
-
- int i = path.indexOf('.');
- int length = path.length();
-
- if (i < 0) {
- i = length;
- }
-
- String type = null;
- String name = null;
- Integer n = null;
- String rest = null;
-
- // get the type
- int j = path.indexOf(':');
- if (j > i)
- j = -1;
- if (j < 0) {
- type = path.substring(0, i);
- }
- else {
- type = path.substring(0, j);
-
- // get the name
- int k = path.indexOf(':', j + 1);
- if (k > i)
- k = -1;
- if (k < 0) {
- name = path.substring(j + 1, i);
- }
- else {
- name = path.substring(j + 1, k);
-
- // get the count
- try {
- n = new Integer(path.substring(k + 1, i));
- }
- catch (Exception exc) {
- }
- if ((n != null) && (n.intValue() < 0)) {
- n = null;
- }
- }
- }
-
- if ((name != null) && (name.length() == 0)) {
- name = null;
- }
-
- if (i < length) {
- rest = path.substring(i + 1);
- }
-
- result[0] = type;
- result[1] = decode(name);
- result[2] = n;
- result[3] = rest;
- return result;
- }
-
- /**
- * @generated
- */
- protected static String encodeGen(String s) {
-
- if (s == null)
- return null;
- StringBuffer o = new StringBuffer(s.length());
- int len = s.length();
- for (int i = 0; i < len; i++) {
- char c = s.charAt(i);
- if (Character.isLetterOrDigit(c) || (c == '-')) {
- o.append(c);
- }
- else { // if ((c == '.') || (c == ':') || (c == '_') || ...)
- // convert the character to a 4 digit hex code prefixed by "_"
- String hex = Integer.toHexString(c);
- int l = hex.length();
- if (l == 1) {
- o.append("_000"); //$NON-NLS-1$
- o.append(hex);
- }
- else if (l == 2) {
- o.append("_00"); //$NON-NLS-1$
- o.append(hex);
- }
- else if (l == 3) {
- o.append("_0"); //$NON-NLS-1$
- o.append(hex);
- }
- else {
- o.append('_');
- o.append(hex);
- }
- }
- } // for
- return o.toString();
- }
-
- /**
- * @generated
- */
- protected static String decodeGen(String s) {
-
- if (s == null)
- return null;
- StringBuffer o = new StringBuffer(s.length());
- int len = s.length();
- for (int i = 0; i < len; i++) {
- char c = s.charAt(i);
- if (c != '_') {
- o.append(c);
- }
- else { // next 4 characters are the hex code
- String hex;
- if (len > i + 4) {
- hex = s.substring(i + 1, i + 5);
- i += 4;
- }
- else {
- hex = s.substring(i + 1);
- i = len - 1;
- }
- o.append((char) Integer.parseInt(hex, 16));
- }
- } // for
- return o.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java
deleted file mode 100644
index 544f8567a4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java
+++ /dev/null
@@ -1,525 +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.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDSourceOffset;
-
-
-public class DTDPrinter extends DTDVisitor {
- StringBuffer sb = new StringBuffer();
- boolean updateOffset = true;
-
- public DTDPrinter(boolean updateOffset) {
- this.updateOffset = updateOffset;
- }
-
- public StringBuffer getBuffer() {
- return sb;
- }
-
- public void visitDTDFile(DTDFile file) {
- super.visitDTDFile(file);
- }
-
- public void visitDTDNotation(DTDNotation notation) {
- generateComment(notation);
- updateStartOffset(notation, sb.length());
- sb.append("<!NOTATION "); //$NON-NLS-1$
- sb.append(notation.getName()).append(" "); //$NON-NLS-1$
-
- String publicID = notation.getPublicID();
- String systemID = notation.getSystemID();
- if (publicID == null || publicID.equals("")) { //$NON-NLS-1$
- sb.append("SYSTEM "); //$NON-NLS-1$
- }
- else {
- sb.append("PUBLIC \"").append(publicID).append("\" "); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (systemID == null) {
- sb.append("\"\""); //$NON-NLS-1$
- }
- else {
- sb.append("\"").append(systemID).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- endTag();
- updateEndOffset(notation, sb.length() - 1); // -1 for the newline char
- super.visitDTDNotation(notation);
- }
-
- public void visitDTDEntity(DTDEntity entity) {
- generateComment(entity);
- updateStartOffset(entity, sb.length());
- sb.append("<!ENTITY "); //$NON-NLS-1$
-
- if (entity.isParameterEntity())
- sb.append("% "); //$NON-NLS-1$
-
- sb.append(entity.getName()).append(" "); //$NON-NLS-1$
- sb.append(entity.getContent().unparse());
-
- endTag();
- updateEndOffset(entity, sb.length() - 1); // -1 for the newline char
- super.visitDTDEntity(entity);
- }
-
- public void visitDTDElement(DTDElement element) {
- generateComment(element);
- updateStartOffset(element, sb.length());
- sb.append("<!ELEMENT " + element.getName()); //$NON-NLS-1$
- DTDElementContent content = element.getContent();
- if (content instanceof DTDPCDataContent || content instanceof DTDElementReferenceContent) {
- sb.append(" ("); //$NON-NLS-1$
- super.visitDTDElement(element);
- sb.append(")"); //$NON-NLS-1$
- } // end of if ()
- else {
- sb.append(" "); //$NON-NLS-1$
- super.visitDTDElement(element);
- } // end of else
- endTag();
- updateEndOffset(element, sb.length() - 1); // -1 for the newline char
- visitAttributes(element);
- }
-
- public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
- generateComment(parmEntity);
- updateStartOffset(parmEntity, sb.length());
- sb.append("%" + parmEntity.getName() + ";\n"); //$NON-NLS-1$ //$NON-NLS-2$
- updateEndOffset(parmEntity, sb.length() - 1); // -1 for the newline
- // char
- }
-
- public void visitDTDElementContent(DTDElementContent content) {
- updateStartOffset(content, sb.length());
- String trailingChars = ""; //$NON-NLS-1$
- if (content instanceof DTDRepeatableContent) {
- DTDRepeatableContent repeatContent = (DTDRepeatableContent) content;
- DTDOccurrenceType occurrenceType = repeatContent.getOccurrence();
- // Integer occurrence = repeatContent.getOccurrence();
- if (occurrenceType != null) {
- int occurType = occurrenceType.getValue();
- if (occurType != DTDOccurrenceType.ONE) {
- if (repeatContent instanceof DTDEntityReferenceContent) {
- sb.append("("); //$NON-NLS-1$
- trailingChars = ")"; //$NON-NLS-1$
- }
- trailingChars += (char) occurType;
- }
- } // end of if ()
- } // end of if ()
-
- if (content instanceof DTDGroupContent) {
- super.visitDTDElementContent(content);
- } // end of if ()
- else if (content instanceof DTDElementReferenceContent || content instanceof DTDEntityReferenceContent) {
- sb.append(((DTDRepeatableContent) content).unparseRepeatableContent());
- } // end of if ()
- else {
- // handle DTDPCDataContent, DTDAnyContent and DTDEmptyContent here
- sb.append(content.getContentName());
- } // end of else
- sb.append(trailingChars);
- updateEndOffset(content, sb.length());
- }
-
- public void visitDTDGroupContent(DTDGroupContent group) {
- sb.append("("); //$NON-NLS-1$
- DTDGroupKind kind = group.getGroupKind();
- // MOF2EMF Port
- // Integer groupKind = group.getGroupKind();
- if (kind == null) {
- group.setGroupKind(DTDGroupKind.get(DTDGroupKind.SEQUENCE));
- } // end of if ()
-
- String con = group.getGroupKind().getValue() == DTDGroupKind.CHOICE ? " | " : ", "; //$NON-NLS-1$ //$NON-NLS-2$
-
- // Loop thru the children of the current group
- Collection content = group.getContent();
- if (content != null) {
- boolean firstContent = true;
- for (Iterator i = content.iterator(); i.hasNext();) {
- if (!firstContent) {
- sb.append(con);
- } // end of if ()
- else {
- firstContent = false;
- } // end of else
- visitDTDElementContent((DTDElementContent) i.next());
- }
- }
-
- sb.append(")"); //$NON-NLS-1$
- }
-
- private void visitAttributes(DTDElement elem) {
- Collection attrs = elem.getDTDAttribute();
- Iterator i = attrs.iterator();
- if (attrs != null && i.hasNext()) {
- DTDAttribute attrib = (DTDAttribute) i.next();
- String comment = attrib.getComment();
- if (comment != null && comment.length() > 0)
- sb.append("<!--\n ").append(comment).append("\n-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("<!ATTLIST " + elem.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append(" "); //$NON-NLS-1$
- updateStartOffset(attrib, sb.length());
- sb.append(attrib.unparse());
- updateEndOffset(attrib, sb.length());
- sb.append("\n"); //$NON-NLS-1$
- for (; i.hasNext();) {
- attrib = (DTDAttribute) i.next();
- comment = attrib.getComment();
- if (comment != null && comment.length() > 0) {
- sb.append(">\n"); //$NON-NLS-1$
- if (comment != null && comment.length() > 0)
- sb.append("<!--\n ").append(comment).append("\n-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("<!ATTLIST " + elem.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- sb.append(" "); //$NON-NLS-1$
- updateStartOffset(attrib, sb.length());
- sb.append(attrib.unparse());
- updateEndOffset(attrib, sb.length());
- sb.append("\n"); //$NON-NLS-1$
- }
- sb.append(">\n"); //$NON-NLS-1$
- }
- }
-
- private void endTag() {
- sb.append(">\n"); //$NON-NLS-1$
- }
-
- private void updateStartOffset(DTDSourceOffset o, int offset) {
- if (updateOffset) {
- o.setStartOffset(offset);
- } // end of if ()
- }
-
- private void updateEndOffset(DTDSourceOffset o, int offset) {
- if (updateOffset) {
- o.setEndOffset(offset);
- } // end of if ()
- }
-
- private void generateComment(DTDObject dtdObject) {
- String commentString = null;
-
- if (dtdObject instanceof DTDElement)
- commentString = ((DTDElement) dtdObject).getComment();
- else if (dtdObject instanceof DTDEntity)
- commentString = ((DTDEntity) dtdObject).getComment();
- else if (dtdObject instanceof DTDNotation)
- commentString = ((DTDNotation) dtdObject).getComment();
-
- if (commentString != null && commentString.length() > 0) {
- sb.append("<!--").append(commentString).append("-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-
- // /**
- // * @generated
- // */
- // protected StringBuffer getBufferGen() {
- //
- // return sb;
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDFileGen(DTDFile file) {
- //
- // super.visitDTDFile(file);
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDNotationGen(DTDNotation notation) {
- //
- // generateComment(notation);
- // updateStartOffset(notation, sb.length());
- // sb.append("<!NOTATION ");
- // sb.append(notation.getName()).append(" ");
- //
- //
- // String publicID = notation.getPublicID();
- // String systemID = notation.getSystemID();
- // if (publicID == null || publicID.equals(""))
- // {
- // sb.append("SYSTEM ");
- // }
- // else
- // {
- // sb.append("PUBLIC \"").append(publicID).append("\" ");
- // }
- //
- //
- // if (systemID==null)
- // {
- // sb.append("\"\"");
- // }
- // else
- // {
- // sb.append("\"").append(systemID).append("\"");
- // }
- // endTag();
- // updateEndOffset(notation, sb.length() - 1); // -1 for the newline char
- // super.visitDTDNotation(notation);
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDEntityGen(DTDEntity entity) {
- //
- // generateComment(entity);
- // updateStartOffset(entity, sb.length());
- // sb.append("<!ENTITY ");
- //
- //
- // if (entity.isParameterEntity())
- // sb.append("% ");
- //
- //
- // sb.append(entity.getName()).append(" ");
- // sb.append(entity.getContent().unparse());
- //
- //
- // endTag();
- // updateEndOffset(entity, sb.length() - 1); // -1 for the newline char
- // super.visitDTDEntity(entity);
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDElementGen(DTDElement element) {
- //
- // generateComment(element);
- // updateStartOffset(element, sb.length());
- // sb.append("<!ELEMENT " + element.getName());
- // DTDElementContent content = element.getContent();
- // if (content instanceof DTDPCDataContent ||
- // content instanceof DTDElementReferenceContent)
- // {
- // sb.append(" (");
- // super.visitDTDElement(element);
- // sb.append(")");
- // } // end of if ()
- // else
- // {
- // sb.append(" ");
- // super.visitDTDElement(element);
- // } // end of else
- // endTag();
- // updateEndOffset(element, sb.length() - 1); // -1 for the newline char
- // visitAttributes(element);
- // }
- // /**
- // * @generated
- // */
- // protected void
- // visitDTDParameterEntityReferenceGen(DTDParameterEntityReference
- // parmEntity) {
- //
- // generateComment(parmEntity);
- // updateStartOffset(parmEntity, sb.length());
- // sb.append("%" + parmEntity.getName() + ";\n");
- // updateEndOffset(parmEntity, sb.length() - 1); // -1 for the newline
- // char
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDElementContentGen(DTDElementContent content) {
- //
- // updateStartOffset(content, sb.length());
- // String trailingChars = "";
- // if (content instanceof DTDRepeatableContent )
- // {
- // DTDRepeatableContent repeatContent = (DTDRepeatableContent) content;
- // Integer occurrence = repeatContent.getOccurrence();
- // if (occurrence != null)
- // {
- // int occurType = occurrence.intValue();
- // if (occurType != DTDOccurrenceType.ONE)
- // {
- // if (repeatContent instanceof DTDEntityReferenceContent)
- // {
- // sb.append("(");
- // trailingChars = ")";
- // }
- // trailingChars += (char) occurType;
- // }
- // } // end of if ()
- // } // end of if ()
- //
- // if (content instanceof DTDGroupContent)
- // {
- // super.visitDTDElementContent(content);
- // } // end of if ()
- // else if (content instanceof DTDElementReferenceContent ||
- // content instanceof DTDEntityReferenceContent)
- // {
- // sb.append(((DTDRepeatableContent)content).unparseRepeatableContent());
- // } // end of if ()
- // else
- // {
- // // handle DTDPCDataContent, DTDAnyContent and DTDEmptyContent here
- // sb.append(content.getContentName());
- // } // end of else
- // sb.append(trailingChars);
- // updateEndOffset(content, sb.length());
- // }
- // /**
- // * @generated
- // */
- // protected void visitDTDGroupContentGen(DTDGroupContent group) {
- //
- // sb.append("(");
- //
- // Integer groupKind = group.getGroupKind();
- // if (groupKind == null)
- // {
- // group.setGroupKind(DTDGroupKind.SEQUENCE);
- // } // end of if ()
- //
- // String con = group.getGroupKind().intValue() == DTDGroupKind.CHOICE ? "
- // | " : ", ";
- //
- //
- // // Loop thru the children of the current group
- // Collection content = group.getContent();
- // if (content != null)
- // {
- // boolean firstContent = true;
- // for (Iterator i = content.iterator(); i.hasNext(); )
- // {
- // if (!firstContent)
- // {
- // sb.append(con);
- // } // end of if ()
- // else
- // {
- // firstContent = false;
- // } // end of else
- // visitDTDElementContent((DTDElementContent) i.next());
- // }
- // }
- //
- //
- // sb.append(")");
- // }
- // /**
- // * @generated
- // */
- // protected void visitAttributesGen(DTDElement elem) {
- //
- // Collection attrs = elem.getDTDAttribute();
- // Iterator i = attrs.iterator();
- // if (attrs != null && i.hasNext())
- // {
- // DTDAttribute attrib = (DTDAttribute) i.next();
- // String comment = attrib.getComment();
- // if (comment!=null && comment.length()>0)
- // sb.append("<!--\n ").append(comment).append("\n-->\n");
- // sb.append("<!ATTLIST " + elem.getName() + "\n");
- // sb.append(" ");
- // updateStartOffset(attrib, sb.length());
- // sb.append(attrib.unparse());
- // updateEndOffset(attrib, sb.length());
- // sb.append("\n");
- // for (; i.hasNext(); )
- // {
- // attrib = (DTDAttribute) i.next();
- // comment = attrib.getComment();
- // if (comment!=null && comment.length()>0)
- // {
- // sb.append(">\n");
- // if (comment!=null && comment.length()>0)
- // sb.append("<!--\n ").append(comment).append("\n-->\n");
- // sb.append("<!ATTLIST " + elem.getName() + "\n");
- // }
- // sb.append(" ");
- // updateStartOffset(attrib, sb.length());
- // sb.append(attrib.unparse());
- // updateEndOffset(attrib, sb.length());
- // sb.append("\n");
- // }
- // sb.append(">\n");
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void endTagGen() {
- //
- // sb.append(">\n");
- // }
- // /**
- // * @generated
- // */
- // protected void updateStartOffsetGen(DTDSourceOffset o, int offset) {
- //
- // if (updateOffset)
- // {
- // o.setStartOffset(offset);
- // } // end of if ()
- // }
- // /**
- // * @generated
- // */
- // protected void updateEndOffsetGen(DTDSourceOffset o, int offset) {
- //
- // if (updateOffset)
- // {
- // o.setEndOffset(offset);
- // } // end of if ()
- // }
- // /**
- // * @generated
- // */
- // protected void generateCommentGen(DTDObject dtdObject) {
- //
- // String commentString = null;
- //
- //
- // if (dtdObject instanceof DTDElement)
- // commentString = ((DTDElement)dtdObject).getComment();
- // else if (dtdObject instanceof DTDEntity)
- // commentString = ((DTDEntity)dtdObject).getComment();
- // else if (dtdObject instanceof DTDNotation)
- // commentString = ((DTDNotation)dtdObject).getComment();
- //
- //
- // if ( commentString!=null && commentString.length()>0)
- // {
- // sb.append("<!--").append(commentString).append("-->\n");
- // }
- // }
-}// DTDPrinter
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java
deleted file mode 100644
index 5986c3e42c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java
+++ /dev/null
@@ -1,79 +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.dtd.core.internal.emf.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-
-public class DTDResourceFactoryImpl extends ResourceFactoryImpl {
- public DTDResourceFactoryImpl() {
- super();
- }
-
- public Resource createResource(String filename) {
- return new DTDResourceImpl(filename);
- }
-
- public Resource createResource(URI uri) {
- return new DTDResourceImpl(uri);
- }
-
- public Resource createResource(ResourceSet resources, URI uri) {
- Resource resource = new DTDResourceImpl(uri);
- resources.getResources().add(resource);
- return resource;
- }
-
- public Resource createResource(ResourceSet resources, String uri) {
- Resource resource = new DTDResourceImpl(uri);
- resources.getResources().add(resource);
- return resource;
- }
-
- public Resource load(String uri) throws Exception {
- Resource resource = createResource(uri);
- resource.load(new HashMap());
- return resource;
- }
-
- public Resource load(URI uri) throws Exception {
- Resource resource = createResource(uri);
- resource.load(new HashMap());
- return resource;
- }
-
- public Resource load(ResourceSet resources, String uri) throws Exception {
- return load(resources, uri, new HashMap());
- }
-
- public Resource load(ResourceSet resources, URI uri) throws Exception {
- return load(resources, uri, new HashMap());
- }
-
- public Resource load(ResourceSet resources, String uri, Map options) throws Exception {
- Resource resource = createResource(resources, uri);
- resource.load(options);
- return resource;
- }
-
- public Resource load(ResourceSet resources, URI uri, Map options) throws Exception {
- Resource resource = createResource(resources, uri);
- resource.load(options);
- return resource;
- }
-} // DTDResourceFactoryImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java
deleted file mode 100644
index 9d085be4d6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java
+++ /dev/null
@@ -1,166 +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.dtd.core.internal.emf.util;
-
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-
-
-public class DTDResourceImpl extends ResourceImpl {
-
- public DTDResourceImpl() {
- super();
- }
-
- public DTDResourceImpl(String filename) {
- super(URI.createURI(filename));
- // System.out.println(">>>> DTDResourceImpl ctor 1");
- }
-
- public DTDResourceImpl(URI uri) {
- super(uri);
- // System.out.println(">>>> DTDResourceImpl ctor 2");
- }
-
- /**
- * Returns the resolved object for the given URI
- * {@link URI#fragment fragment}.
- * <p>
- * The fragment encoding will typically be that produced by
- * {@link #getURIFragment getURIFragment}.
- * </p>
- *
- * @param uriFragment
- * the fragment to resolve.
- * @return the resolved object for the given fragment.
- * @see #getURIFragment(EObject)
- * @see org.eclipse.emf.ecore.resource.ResourceSet#getEObject(URI, boolean)
- * @see org.eclipse.emf.ecore.util.EcoreUtil#resolve(EObject, org.eclipse.emf.ecore.resource.ResourceSet)
- * @see org.eclipse.emf.ecore.InternalEObject#eObjectForURIFragmentSegment(String)
- * @throws org.eclipse.emf.common.util.WrappedException
- * if a problem occurs navigating the fragment.
- */
- public EObject getEObject(java.lang.String uriFragment) {
- EList contents = getContents();
- if (contents != null) {
- Iterator i = contents.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof DTDFile) {
- // there should only be one DTDFile in a DTD extent
- EObject result = ((DTDFile) obj).findObject(uriFragment);
- return result;
- }
- }
- }
- System.out.println(">>> DTDKey Error: cannot find object " + uriFragment); //$NON-NLS-1$
- return super.getEObject(uriFragment);
- }
-
- /**
- * Returns the URI {@link URI#fragment fragment} that, when passed to
- * {@link #getEObject getEObject} will return the given object.
- * <p>
- * In other words, the following is <code>true</code> for any object
- * contained by a resource:
- *
- * <pre>
- *
- * Resource resource = eObject.eResource();
- * eObject == resource.getEObject(resource.getURIFragment(eObject))
- *
- * </pre>
- *
- * An implementation may choose to use IDs or to use structured URI
- * fragments, as supported by
- * {@link org.eclipse.emf.ecore.InternalEObject#eURIFragmentSegment eURIFragmentSegment}.
- * </p>
- *
- * @param eObject
- * the object to identify.
- * @return the URI {@link URI#fragment fragment} for the object.
- * @see #getEObject(String)
- * @see org.eclipse.emf.ecore.InternalEObject#eURIFragmentSegment(org.eclipse.emf.core.EStructuralFeature,
- * EObject)
- */
- public java.lang.String getURIFragment(EObject eObject) {
- if (eObject instanceof DTDObject) {
- return ((DTDObject) eObject).getPathname();
- }
- return super.getURIFragment(eObject);
- }
-
- private DTDUtil dtdUtil;
-
- public DTDUtil getDTDUtil() {
- return dtdUtil;
- }
-
- public void setDTDUtil(DTDUtil dtdUtil) {
- this.dtdUtil = dtdUtil;
- }
-
- public void load(Map options) {
-
- String uriString = getURI().toString();
- try {
- DTDUtil dtdUtil = new DTDUtil();
- dtdUtil.parse(getResourceSet(), uriString);
- dtdUtil.setResource(this);
- setDTDUtil(dtdUtil);
- getContents().add(dtdUtil.getDTDFile());
-
- // Reset the dirty flag after the resource is loaded
- setModified(false);
- }
- catch (Exception exc) {
- exc.printStackTrace();
- }
- }
-
- public void save(OutputStream os, Object options) throws Exception {
- if (contents != null) {
- Iterator i = contents.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof DTDFile) {
- try {
- DTDPrinter printer = new DTDPrinter(true);
- printer.visitDTDFile((DTDFile) obj);
-
- String s = printer.getBuffer().toString();
- os.write(s.getBytes());
- // Reset the dirty flag after the resource is saved
- setModified(false);
- }
- catch (Exception e) {
- }
- break;
- }
- }
- }
- }
-
- public void save(ZipOutputStream zos, String entry, String metaModelName) throws Exception {
- throw new Exception(DTDCoreMessages._EXC_OPERATION_NOT_SUPPORTED); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java
deleted file mode 100644
index d903b643e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java
+++ /dev/null
@@ -1,489 +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.dtd.core.internal.emf.util;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDSwitch {
- /**
- * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected static DTDPackage modelPackage;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public DTDSwitch() {
- if (modelPackage == null) {
- modelPackage = DTDPackage.eINSTANCE;
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object doSwitch(EObject theEObject) {
- EClass theEClass = theEObject.eClass();
- if (theEClass.eContainer() == modelPackage) {
- switch (theEClass.getClassifierID()) {
- case DTDPackage.DTD_GROUP_CONTENT : {
- DTDGroupContent dtdGroupContent = (DTDGroupContent) theEObject;
- Object result = caseDTDGroupContent(dtdGroupContent);
- if (result == null)
- result = caseDTDRepeatableContent(dtdGroupContent);
- if (result == null)
- result = caseDTDElementContent(dtdGroupContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ATTRIBUTE : {
- DTDAttribute dtdAttribute = (DTDAttribute) theEObject;
- Object result = caseDTDAttribute(dtdAttribute);
- if (result == null)
- result = caseEAttribute(dtdAttribute);
- if (result == null)
- result = caseEStructuralFeature(dtdAttribute);
- if (result == null)
- result = caseETypedElement(dtdAttribute);
- if (result == null)
- result = caseENamedElement(dtdAttribute);
- if (result == null)
- result = caseEModelElement(dtdAttribute);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ELEMENT : {
- DTDElement dtdElement = (DTDElement) theEObject;
- Object result = caseDTDElement(dtdElement);
- if (result == null)
- result = caseEClass(dtdElement);
- if (result == null)
- result = caseDTDContent(dtdElement);
- if (result == null)
- result = caseEClassifier(dtdElement);
- if (result == null)
- result = caseENamedElement(dtdElement);
- if (result == null)
- result = caseEModelElement(dtdElement);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_EMPTY_CONTENT : {
- DTDEmptyContent dtdEmptyContent = (DTDEmptyContent) theEObject;
- Object result = caseDTDEmptyContent(dtdEmptyContent);
- if (result == null)
- result = caseDTDElementContent(dtdEmptyContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ANY_CONTENT : {
- DTDAnyContent dtdAnyContent = (DTDAnyContent) theEObject;
- Object result = caseDTDAnyContent(dtdAnyContent);
- if (result == null)
- result = caseDTDElementContent(dtdAnyContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_PC_DATA_CONTENT : {
- DTDPCDataContent dtdpcDataContent = (DTDPCDataContent) theEObject;
- Object result = caseDTDPCDataContent(dtdpcDataContent);
- if (result == null)
- result = caseDTDElementContent(dtdpcDataContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT : {
- DTDElementReferenceContent dtdElementReferenceContent = (DTDElementReferenceContent) theEObject;
- Object result = caseDTDElementReferenceContent(dtdElementReferenceContent);
- if (result == null)
- result = caseDTDRepeatableContent(dtdElementReferenceContent);
- if (result == null)
- result = caseDTDElementContent(dtdElementReferenceContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_FILE : {
- DTDFile dtdFile = (DTDFile) theEObject;
- Object result = caseDTDFile(dtdFile);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_BASIC_TYPE : {
- DTDBasicType dtdBasicType = (DTDBasicType) theEObject;
- Object result = caseDTDBasicType(dtdBasicType);
- if (result == null)
- result = caseEClass(dtdBasicType);
- if (result == null)
- result = caseEClassifier(dtdBasicType);
- if (result == null)
- result = caseENamedElement(dtdBasicType);
- if (result == null)
- result = caseEModelElement(dtdBasicType);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ENUMERATION_TYPE : {
- DTDEnumerationType dtdEnumerationType = (DTDEnumerationType) theEObject;
- Object result = caseDTDEnumerationType(dtdEnumerationType);
- if (result == null)
- result = caseEEnum(dtdEnumerationType);
- if (result == null)
- result = caseEDataType(dtdEnumerationType);
- if (result == null)
- result = caseEClassifier(dtdEnumerationType);
- if (result == null)
- result = caseENamedElement(dtdEnumerationType);
- if (result == null)
- result = caseEModelElement(dtdEnumerationType);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_NOTATION : {
- DTDNotation dtdNotation = (DTDNotation) theEObject;
- Object result = caseDTDNotation(dtdNotation);
- if (result == null)
- result = caseDTDContent(dtdNotation);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ENTITY : {
- DTDEntity dtdEntity = (DTDEntity) theEObject;
- Object result = caseDTDEntity(dtdEntity);
- if (result == null)
- result = caseDTDContent(dtdEntity);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_EXTERNAL_ENTITY : {
- DTDExternalEntity dtdExternalEntity = (DTDExternalEntity) theEObject;
- Object result = caseDTDExternalEntity(dtdExternalEntity);
- if (result == null)
- result = caseDTDEntityContent(dtdExternalEntity);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_INTERNAL_ENTITY : {
- DTDInternalEntity dtdInternalEntity = (DTDInternalEntity) theEObject;
- Object result = caseDTDInternalEntity(dtdInternalEntity);
- if (result == null)
- result = caseDTDEntityContent(dtdInternalEntity);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE : {
- DTDParameterEntityReference dtdParameterEntityReference = (DTDParameterEntityReference) theEObject;
- Object result = caseDTDParameterEntityReference(dtdParameterEntityReference);
- if (result == null)
- result = caseDTDContent(dtdParameterEntityReference);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT : {
- DTDEntityReferenceContent dtdEntityReferenceContent = (DTDEntityReferenceContent) theEObject;
- Object result = caseDTDEntityReferenceContent(dtdEntityReferenceContent);
- if (result == null)
- result = caseDTDRepeatableContent(dtdEntityReferenceContent);
- if (result == null)
- result = caseDTDElementContent(dtdEntityReferenceContent);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- default :
- return defaultCase(theEObject);
- }
- }
- return defaultCase(theEObject);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDFile(DTDFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDNotation(DTDNotation object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDContent(DTDContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDEntity(DTDEntity object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDEntityContent(DTDEntityContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDExternalEntity(DTDExternalEntity object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDInternalEntity(DTDInternalEntity object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDParameterEntityReference(DTDParameterEntityReference object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDEntityReferenceContent(DTDEntityReferenceContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDRepeatableContent(DTDRepeatableContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDElementReferenceContent(DTDElementReferenceContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDElement(DTDElement object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDElementContent(DTDElementContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDEmptyContent(DTDEmptyContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDAnyContent(DTDAnyContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDPCDataContent(DTDPCDataContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDGroupContent(DTDGroupContent object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDAttribute(DTDAttribute object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDEnumerationType(DTDEnumerationType object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseDTDBasicType(DTDBasicType object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- // +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
- //
- // +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
- // // public Object caseENamespace(ENamespace object) {
- // -------------------GENERICRULES.JSED-------------------
- // return null;
- // }
- // -------------------GENERICRULES.JSED-------------------
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEClass(EClass object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEAttribute(EAttribute object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEEnum(EEnum object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEModelElement(EModelElement object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseENamedElement(ENamedElement object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEStructuralFeature(EStructuralFeature object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEDataType(EDataType object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseETypedElement(ETypedElement object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEClassifier(EClassifier object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- // +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
- //
- // +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
- // // public Object caseInternalEClassifier(InternalEClassifier object) {
- // -------------------GENERICRULES.JSED-------------------
- // return null;
- // }
- // -------------------GENERICRULES.JSED-------------------
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} // DTDSwitch
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java
deleted file mode 100644
index 2b8ff3eb83..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java
+++ /dev/null
@@ -1,174 +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.dtd.core.internal.emf.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-
-
-
-public class DTDUniqueNameHelper {
- public DTDUniqueNameHelper() {
-
- }
-
- static public String getUniqueElementName(DTDFile dtdFile) {
- List elements = dtdFile.listDTDElement();
- return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
- }
-
- static public String getUniqueEntityName(DTDFile dtdFile) {
- List entities = dtdFile.listDTDEntity();
- return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
- }
-
- static public String getUniqueNotationName(DTDFile dtdFile) {
- List notations = dtdFile.listDTDNotation();
- return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
- }
-
- static public String getUniqueAttributeName(DTDElement element) {
- List attrs = element.getDTDAttribute();
- return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
- }
-
- static public String getUniqueName(List objs, String token) {
- int counter = 1;
-
- boolean uniqueName = false;
- while (!uniqueName) {
- String newName = token + new Integer(counter++);
- uniqueName = true;
- Iterator iter = objs.iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- String objName = getName(obj);
- if (objName.equals(newName)) {
- uniqueName = false;
- break;
- }
- }
- if (uniqueName) {
- return newName;
- }
- }
- // we shouldn't get here
- return "No Name found"; //$NON-NLS-1$
- }
-
- static public String getName(Object obj) {
- if (obj instanceof DTDElement) {
- return ((DTDElement) obj).getName();
- }
- else if (obj instanceof DTDEntity) {
- return ((DTDEntity) obj).getName();
- }
- else if (obj instanceof DTDNotation) {
- return ((DTDNotation) obj).getName();
- }
- else if (obj instanceof DTDAttribute) {
- return ((DTDAttribute) obj).getName();
- }
- return ""; //$NON-NLS-1$
- }
-
-
- /**
- * @generated
- */
- protected static String getUniqueElementNameGen(DTDFile dtdFile) {
-
- List elements = dtdFile.listDTDElement();
- return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected static String getUniqueEntityNameGen(DTDFile dtdFile) {
-
- List entities = dtdFile.listDTDEntity();
- return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected static String getUniqueNotationNameGen(DTDFile dtdFile) {
-
- List notations = dtdFile.listDTDNotation();
- return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected static String getUniqueAttributeNameGen(DTDElement element) {
-
- List attrs = element.getDTDAttribute();
- return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected static String getUniqueNameGen(List objs, String token) {
-
- int counter = 1;
-
- boolean uniqueName = false;
- while (!uniqueName) {
- String newName = token + new Integer(counter++);
- uniqueName = true;
- Iterator iter = objs.iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- String objName = getName(obj);
- if (objName.equals(newName)) {
- uniqueName = false;
- break;
- }
- }
- if (uniqueName) {
- return newName;
- }
- }
- // we shouldn't get here
- return "No Name found"; //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected static String getNameGen(Object obj) {
-
- if (obj instanceof DTDElement) {
- return ((DTDElement) obj).getName();
- }
- else if (obj instanceof DTDEntity) {
- return ((DTDEntity) obj).getName();
- }
- else if (obj instanceof DTDNotation) {
- return ((DTDNotation) obj).getName();
- }
- else if (obj instanceof DTDAttribute) {
- return ((DTDAttribute) obj).getName();
- }
- return ""; //$NON-NLS-1$
- }
-}// DTDUniqueNameHelper
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java
deleted file mode 100644
index 8f9a7df7b0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java
+++ /dev/null
@@ -1,1217 +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.dtd.core.internal.emf.util;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDConstants;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTD;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTDParser;
-import org.eclipse.wst.dtd.core.internal.saxparser.ErrorMessage;
-
-/**
- * Create MOF objects from the parsed DTD If no DTD file is specifed, create
- * the root MOF object
- */
-public class DTDUtil {
- DTDFactory factory;
- EList extent;
- Resource resource;
- DTDFile dtdFile;
- String dtdModelFile;
- boolean expandEntityReferences;
-
- private Hashtable externalDTDModels = new Hashtable();
- private Hashtable pePool = new Hashtable();
- private Hashtable elementPool = new Hashtable();
-
- private DTDParser parser;
-
- private Vector errorMsgs = new Vector();
-
- private static Hashtable utilCache = new Hashtable();
-
- static public DTDUtil getDTDUtilFor(String filename) {
- DTDUtil util = (DTDUtil) utilCache.get(filename);
- if (util == null) {
- util = new DTDUtil();
- utilCache.put(filename, util);
- }
-
- return util;
- }
-
-
- public void parse(String uri) {
- parse(new ResourceSetImpl(), uri);
- }
-
- /**
- * Invoke parse to parse a .dtd file into a MOF object model This is
- * invoked by the RegisteredDTDParser that registers this parser for MOF
- * to use against the .dtd type
- *
- * @param filename -
- * the fully qualifed name of a .dtd file
- */
- public void parse(ResourceSet resources, String filename) {
- // Get the dtd name from the file name
- Path path = new Path(filename);
- IPath iPath = path.removeFileExtension();
- String dtdName = iPath.toFile().getName();
-
- try {
- parser = new DTDParser(false);
- if (expandEntityReferences) {
- parser.setExpandEntityReferences(expandEntityReferences);
- }
- parser.parse(filename);
- }
- catch (IOException ex) {
- ex.printStackTrace(System.err);
- }
-
- dtdModelFile = filename;
-
- factory = DTDFactoryImpl.instance();
-
- extent = new BasicEList();
-
- dtdFile = factory.createDTDFile();
- extent.add(dtdFile);
-
- dtdFile.setName(dtdName);
-
- populateDTD(resources, expandEntityReferences);
- }
-
- public DTDFactory getFactory() {
- return factory;
- }
-
- public DTDFile getDTDFile() {
- return dtdFile;
- }
-
- public Hashtable getPEPool() {
- return pePool;
- }
-
- public Hashtable getElementPool() {
- return elementPool;
- }
-
- public EList getContents() {
- return extent;
- }
-
- public void setResource(Resource resource) {
- this.resource = resource;
- }
-
- public Resource getResource(Resource resource) {
- return resource;
- }
-
- public void setexpandEntityReferences(boolean expandEntityReferences) {
- this.expandEntityReferences = expandEntityReferences;
- }
-
- public boolean getExpandEntityReferences() {
- return expandEntityReferences;
- }
-
- /**
- * Return true if the model has been modified
- */
- public boolean isModelDirty() {
- if (resource != null) {
- return resource.isModified();
- }
- return false;
- }
-
- /**
- * Save the .dtd file
- */
- public boolean save() {
- try {
- Map options = new HashMap();
- resource.save(options);
- return true;
- }
- catch (Exception ex) {
- System.out.println("Save model exception " + ex); //$NON-NLS-1$
- ex.printStackTrace();
- return false;
- }
- }
-
- public boolean saveAs(String newFilename) {
- resource.setURI(URI.createURI(newFilename));
- boolean ok = save();
-
- if (ok) {
- Path path = new Path(newFilename);
- IPath iPath = path.removeFileExtension();
- String dtdName = iPath.toFile().getName();
-
- dtdFile.setName(dtdName);
- }
- return ok;
- }
-
- public boolean saveDTDFile(String filename) {
- boolean result = true;
- try {
- PrintWriter pw = new PrintWriter(new FileWriter(filename), true);
- DTDPrinter printer = new DTDPrinter(true);
- printer.visitDTDFile(dtdFile);
-
- String s = printer.getBuffer().toString();
- pw.println(s);
- pw.close();
- }
-
- catch (Exception e) {
- result = false;
- }
- return result;
- }
-
- public String getDTDSource(boolean includeError) {
- return dtdFile.unparse(includeError); // true = include error lines
- }
-
- /**
- * Create MOF objects from DTD
- */
- private void populateDTD(ResourceSet resources, boolean expandEntityReferences) {
- Vector dtdList = parser.getDTDList();
-
- // create XMIModel for the included DTDs
- if (dtdList.size() > 0) {
- if (!expandEntityReferences) {
- for (int i = dtdList.size() - 1; i > 0; i--) {
- DTD dtd = (DTD) dtdList.elementAt(i);
- loadIncludedDTD(resources, dtd);
- }
-
- DTD dtd = (DTD) dtdList.elementAt(0);
- populateDTD(resources, dtd, dtdFile); // populate the main
- // DTD
- // validateWithModel(dtd);
- }
- else {
- for (int i = dtdList.size() - 1; i >= 0; i--) {
- DTD dtd = (DTD) dtdList.elementAt(i);
- populateDTD(resources, dtd, dtdFile);
- // validateWithModel(dtd);
- }
- }
- }
- }
-
- // return the instance unique to this DTDUtil file that represents an
- // externally loaded dtd (will create if one doesn't exist yet)
- public ExternalDTDModel getExternalDTDModel(ResourceSet resources, String uri) {
- if (expandEntityReferences) {
- return null;
- }
-
- // DefaultMsgLogger.write("External DTD name: " + uri);
-
- if (externalDTDModels.containsKey(uri)) {
- return (ExternalDTDModel) externalDTDModels.get(uri);
- }
- else {
- ExternalDTDModel extModel = new ExternalDTDModel();
- if (extModel.loadModel(resources, uri)) {
- externalDTDModels.put(uri, extModel);
- return extModel;
- }
- }
- return null;
- }
-
- // load xmiModels for included DTDs
- private void loadIncludedDTD(ResourceSet resources, DTD dtd) {
- ExternalDTDModel extModel = getExternalDTDModel(resources, dtd.getName());
- if (extModel != null) {
- // now fill our hash tables for elements and parameter entities
- // so that we know what can be referenced by our main dtd
- DTDFile file = extModel.getExternalDTDFile();
- Collection elementList = file.listDTDElement();
- Collection entityList = file.listDTDEntity();
-
- Iterator i = elementList.iterator();
- while (i.hasNext()) {
- DTDObject object = (DTDObject) i.next();
- elementPool.put(getBaseName(object), object);
- }
-
- i = entityList.iterator();
- while (i.hasNext()) {
- DTDEntity entity = (DTDEntity) i.next();
- if (entity.isParameterEntity()) {
- pePool.put(getBaseName(entity), entity);
- }
- }
- }
- }
-
- /**
- * Create MOF objects from DTD
- *
- * 1) will create the corresponding DTD Mof object for EntityDecl,
- * NotationDecl and ElementDecl declarations during the 1st pass 2) During
- * the 2nd pass, it will add the contentModel and Attlist to all
- * ElementDecl.
- *
- */
- private void populateDTD(ResourceSet resources, DTD dtd, DTDFile dFile) {
- DTDModelBuilder modelBuilder = new DTDModelBuilder(resources, this, dtd, dFile);
-
- modelBuilder.visitDTD(dtd);
- }
-
-
- public void emptyErrorMessages() {
- errorMsgs.removeAllElements();
- }
-
- public void addErrorMessage(ErrorMessage error) {
- int vectorSize = errorMsgs.size();
- boolean add = true;
-
- if (vectorSize != 0) {
- int index = 0;
-
- while (add == true && index < vectorSize) {
- if (((ErrorMessage) errorMsgs.elementAt(index)).equals(error)) {
- add = false;
- }
- else {
- index++;
- }
- }
- }
-
- if (add) {
- errorMsgs.addElement(error);
- }
- }
-
- public Vector getErrors() {
- return errorMsgs;
- }
-
- // This gets the name without any pseudo namespace prefix
- public static String getBaseName(DTDObject obj) {
- return getName(obj, null);
- }
-
- // This gets the name with pseudo namespace prefixes if dtdFile is not
- // null
- public static String getName(DTDObject obj, DTDFile dtdFile) {
- String name = ""; //$NON-NLS-1$
- if (obj instanceof DTDEntity) {
- DTDEntity entity = (DTDEntity) obj;
- if (dtdFile != null && !entity.getDTDFile().equals(dtdFile)) {
- name = new Path(entity.getDTDFile().getName()).lastSegment() + ": "; //$NON-NLS-1$
- }
- name += "%" + ((DTDEntity) obj).getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (obj instanceof DTDElement) {
- DTDElement element = (DTDElement) obj;
- if (dtdFile != null && !element.getDTDFile().equals(dtdFile)) {
- name = new Path(element.getDTDFile().getName()).lastSegment() + ": "; //$NON-NLS-1$
- }
- name += ((DTDElement) obj).getName();
- }
- else if (obj instanceof DTDElementContent) {
- return ((DTDElementContent) obj).getContentName();
- }
- return name;
- }
-
- public static String getGroupType(int groupKind, int occurrence) {
- String type = null;
-
- switch (groupKind) {
- case DTDGroupKind.SEQUENCE :
- type = "DTDSequence"; //$NON-NLS-1$
- break;
- case DTDGroupKind.CHOICE :
- type = "DTDChoice"; //$NON-NLS-1$
- break;
- }
-
- type += getRepeatableTypeSuffix(occurrence);
- return type;
- }
-
- public static String getReferenceType(int occurrence) {
- String type = "DTDReference"; //$NON-NLS-1$
- type += getRepeatableTypeSuffix(occurrence);
- return type;
- }
-
- private static String getRepeatableTypeSuffix(int occurrence) {
- return "(" + (char) occurrence + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public static void main(String args[]) {
- System.out.println("\nStarting ..."); //$NON-NLS-1$
-
- if (args.length != 1)
- System.out.println("usage: DtdUtil inputfile.dtd"); //$NON-NLS-1$
-
- java.io.File inputFile = new File(args[0]);
-
- String dtdFileName = ""; //$NON-NLS-1$
- try {
- dtdFileName = inputFile.getCanonicalPath();
- }
- catch (IOException ex) {
- }
-
- String dtdModelName = dtdFileName;
-
- if (DTDConstants.DTD_EXTENSION.equals(new Path(dtdFileName).getFileExtension())) {
- dtdModelName = new Path(dtdFileName).removeFileExtension().lastSegment();
- }
- DTDUtil d2m = new DTDUtil();
- // TODO: fix port
- // d2m.parse(dtdFileName);
- try {
- d2m.saveAs(dtdModelName + "." + DTDConstants.DTD_XMI_EXTENSION); //$NON-NLS-1$
- }
- catch (Exception e) {
- System.out.println("Exception thrown during model save: " + e); //$NON-NLS-1$
- }
- System.out.println("Done."); //$NON-NLS-1$
- }
-
- public org.eclipse.core.runtime.IPath getPath() {
- Path currentDTDPath = new Path(dtdModelFile);
- if (currentDTDPath.segmentCount() > 1) {
- return currentDTDPath.removeLastSegments(1).addTrailingSeparator();
- }
-
- return new Path(""); //$NON-NLS-1$
- }
-
- // /**
- // * @generated
- // */
- // protected static DTDUtil getDTDUtilForGen(String filename) {
- //
- // DTDUtil util = (DTDUtil) utilCache.get(filename);
- // if (util == null)
- // {
- // util = new DTDUtil();
- // utilCache.put(filename, util);
- // }
- //
- // return util;
- // }
- // /**
- // * @generated
- // */
- // protected void parseGen(String uri) {
- //
- // parse(new ResourceSetImpl(), uri);
- // }
- // /**
- // * Invoke parse to parse a .dtd file into a MOF object model
- // * This is invoked by the RegisteredDTDParser that registers this parser
- // for MOF to use
- // * against the .dtd type
- // * @param filename - the fully qualifed name of a .dtd file
- // */
- // protected void parseGen(ResourceSet resources, String filename) {
- //
- // // Get the dtd name from the file name
- // Path path = new Path(filename);
- // IPath iPath = path.removeFileExtension();
- // String dtdName = iPath.toFile().getName();
- //
- //
- // try
- // {
- // parser = new DTDParser(false);
- // if (expandEntityReferences)
- // {
- // parser.setExpandEntityReferences(expandEntityReferences);
- // }
- // parser.parse(filename);
- // }
- // catch(IOException ex)
- // {
- // ex.printStackTrace(System.err);
- // }
- //
- //
- // dtdModelFile = filename;
- //
- //
- // factory = DTDFactoryImpl.instance();
- //
- //
- // extent = new BasicEList();
- //
- //
- // dtdFile = factory.createDTDFile();
- // extent.add(dtdFile);
- //
- //
- // dtdFile.setName(dtdName);
- //
- //
- // populateDTD(resources, expandEntityReferences);
- // }
- // /**
- // * @generated
- // */
- // protected DTDFactory getFactoryGen() {
- //
- // return factory;
- // }
- // /**
- // * @generated
- // */
- // protected DTDFile getDTDFileGen() {
- //
- // return dtdFile;
- // }
- // /**
- // * @generated
- // */
- // protected Hashtable getPEPoolGen() {
- //
- // return pePool;
- // }
- // /**
- // * @generated
- // */
- // protected Hashtable getElementPoolGen() {
- //
- // return elementPool;
- // }
- // /**
- // * @generated
- // */
- // protected EList getExtentGen() {
- //
- // return extent;
- // }
- // /**
- // * @generated
- // */
- // protected void setResourceGen(Resource resource) {
- //
- // this.resource = resource;
- // }
- // /**
- // * @generated
- // */
- // protected Resource getResourceGen(Resource resource) {
- //
- // return resource;
- // }
- // /**
- // * @generated
- // */
- // protected void setexpandEntityReferencesGen(boolean
- // expandEntityReferences) {
- //
- // this.expandEntityReferences = expandEntityReferences;
- // }
- // /**
- // * @generated
- // */
- // protected boolean getExpandEntityReferencesGen() {
- //
- // return expandEntityReferences;
- // }
- // /**
- // * Return true if the model has been modified
- // */
- // protected boolean isModelDirtyGen() {
- //
- // if (resource != null)
- // {
- // return resource.isModified();
- // }
- // return false;
- // }
- // /**
- // * Save the .dtd file
- // */
- // protected boolean saveGen() {
- //
- // try
- // {
- // resource.save();
- // return true;
- // }
- // catch (Exception ex)
- // {
- // System.out.println("Save model exception " + ex);
- // ex.printStackTrace();
- // return false;
- // }
- // }
- // /**
- // * @generated
- // */
- // protected boolean saveAsGen(String newFilename) {
- //
- // resource.setURI(newFilename);
- // boolean ok = save();
- //
- //
- // if (ok)
- // {
- // Path path = new Path(newFilename);
- // IPath iPath = path.removeFileExtension();
- // String dtdName = iPath.toFile().getName();
- //
- //
- // dtdFile.setName(dtdName);
- // }
- // return ok;
- // }
- // /**
- // * @generated
- // */
- // protected boolean saveDTDFileGen(String filename) {
- //
- // boolean result=true;
- // try
- // {
- // PrintWriter pw = new PrintWriter(new FileWriter(filename),true);
- // DTDPrinter printer = new DTDPrinter(true);
- // printer.visitDTDFile(dtdFile);
- //
- //
- // String s = printer.getBuffer().getName().toString();
- // pw.println(s);
- // pw.close();
- // }
- //
- //
- // catch (Exception e)
- // {
- // result = false;
- // }
- // return result;
- // }
- // /**
- // * @generated
- // */
- // protected String getDTDSourceGen(boolean includeError) {
- //
- // return dtdFile.unparse(includeError); // true = include error lines
- // }
- // /**
- // * Create MOF objects from DTD
- // */
- // protected void populateDTDGen(ResourceSet resources, boolean
- // expandEntityReferences) {
- //
- // Vector dtdList = parser.getDTDList();
- //
- //
- // // create XMIModel for the included DTDs
- // if ( dtdList.size() > 0)
- // {
- // if (!expandEntityReferences)
- // {
- // for (int i=dtdList.size() - 1; i > 0; i--)
- // {
- // DTD dtd = (DTD) dtdList.elementAt(i);
- // loadIncludedDTD(resources, dtd);
- // }
- //
- //
- // DTD dtd = (DTD) dtdList.elementAt(0);
- // populateDTD(resources, dtd, dtdFile); // populate the main DTD
- // // validateWithModel(dtd);
- // }
- // else
- // {
- // for (int i = dtdList.size() - 1; i >= 0; i--)
- // {
- // DTD dtd = (DTD) dtdList.elementAt(i);
- // populateDTD(resources, dtd, dtdFile);
- // // validateWithModel(dtd);
- // }
- // }
- // }
- // }
- // /**
- // * @generated
- // */
- // protected ExternalDTDModel getExternalDTDModelGen(ResourceSet
- // resources, String uri) {
- //
- // if (expandEntityReferences)
- // {
- // return null;
- // }
- //
- // DefaultMsgLogger.write("External DTD name: " + uri);
- //
- //
- // if (externalDTDModels.containsKey(uri))
- // {
- // return (ExternalDTDModel) externalDTDModels.get(uri);
- // }
- // else
- // {
- // ExternalDTDModel extModel = new ExternalDTDModel();
- // if (extModel.loadModel(resources, uri))
- // {
- // externalDTDModels.put(uri, extModel);
- // return extModel;
- // }
- // }
- // return null;
- // }
- // /**
- // * @generated
- // */
- // protected void loadIncludedDTDGen(ResourceSet resources, DTD dtd) {
- //
- // ExternalDTDModel extModel = getExternalDTDModel(resources,
- // dtd.getName());
- // if (extModel != null)
- // {
- // // now fill our hash tables for elements and parameter entities
- // // so that we know what can be referenced by our main dtd
- // DTDFile file = extModel.getExternalDTDFile();
- // Collection elementList = file.listDTDElement();
- // Collection entityList = file.listDTDEntity();
- //
- //
- // Iterator i = elementList.iterator();
- // while (i.hasNext())
- // {
- // DTDObject object = (DTDObject) i.next();
- // elementPool.put(getBaseName(object), object);
- // }
- //
- // i = entityList.iterator();
- // while (i.hasNext())
- // {
- // DTDEntity entity = (DTDEntity) i.next();
- // if (entity.isParameterEntity())
- // {
- // pePool.put(getBaseName(entity), entity);
- // }
- // }
- // }
- // }
- // /**
- // * Create MOF objects from DTD
- // *
- // * 1) will create the corresponding DTD Mof object for EntityDecl,
- // NotationDecl
- // * and ElementDecl declarations during the 1st pass
- // * 2) During the 2nd pass, it will add the contentModel and Attlist to
- // all
- // * ElementDecl.
- // *
- // */
- // protected void populateDTDGen(ResourceSet resources, DTD dtd, DTDFile
- // dFile) {
- //
- // DTDModelBuilder modelBuilder = new DTDModelBuilder(resources, this,
- // dtd, dFile);
- //
- //
- // modelBuilder.visitDTD(dtd);
- // }
- // /**
- // * @generated
- // */
- // protected void emptyErrorMessagesGen() {
- //
- // errorMsgs.removeAllElements();
- // }
- // /**
- // * @generated
- // */
- // protected void addErrorMessageGen(ErrorMessage error) {
- //
- // int vectorSize = errorMsgs.size();
- // boolean add = true;
- //
- //
- // if (vectorSize != 0)
- // {
- // int index = 0;
- //
- //
- // while (add == true && index < vectorSize)
- // {
- // if (((ErrorMessage) errorMsgs.elementAt(index)).equals(error))
- // {
- // add =false;
- // }
- // else
- // {
- // index++;
- // }
- // }
- // }
- //
- //
- // if (add)
- // {
- // errorMsgs.addElement(error);
- // }
- // }
- // /**
- // * @generated
- // */
- // protected Vector getErrorsGen() {
- //
- // return errorMsgs;
- // }
- // /**
- // * @generated
- // */
- // protected boolean validateDTDGen() {
- //
- // String tempDTDFile=getPath().toOSString()+"tempValidatingFileName.dtd";
- // try
- // {
- // saveDTDFile(tempDTDFile);
- //
- //
- // parser = new DTDParser(false);
- // if (FileUtility.fileExists(tempDTDFile))
- // {
- // parser.parse(tempDTDFile);
- // }
- // Vector dtdList = parser.getDTDList();
- // if ( dtdList.size() > 0)
- // {
- // // reset the errors and update what we have in the element pool
- // emptyErrorMessages();
- // updateElementHashtable();
- //
- //
- // // TODO: do we just validate the current one?
- // validateWithModel((DTD)dtdList.elementAt(0));
- // }
- // }
- // catch(IOException ex)
- // {
- // ex.printStackTrace(System.err);
- // FileUtility.delete(tempDTDFile);
- // }
- // FileUtility.delete(tempDTDFile);
- //
- //
- // return dtdFile.isParseError();
- // }
- // /**
- // * @generated
- // */
- // protected void validateWithModelGen(DTD dtd) {
- //
- // Enumeration en = dtd.externalElements();
- // while (en.hasMoreElements())
- // {
- // Object e = en.nextElement();
- //
- //
- // if ( e instanceof EntityDecl )
- // {
- // EntityDecl entity = (EntityDecl) e;
- // ErrorMessage errMsg = entity.getErrorMessage();
- // if ( errMsg!= null)
- // {
- // addErrorMessage(errMsg);
- // // dtdFile.setParseError(true);
- // }
- // }
- // else if ( e instanceof ElementDecl )
- // {
- // ElementDecl elem = (ElementDecl) e;
- // ErrorMessage errMsg = elem.getErrorMessage();
- // DTDElement dtdelement = (DTDElement)
- // getElementPool().get(elem.getNodeName());
- //
- //
- // if ( errMsg!= null)
- // {
- // addErrorMessage(errMsg);
- // }
- // checkForMissingElementReferences(dtdelement);
- // }
- // else if ( e instanceof NotationDecl )
- // {
- // NotationDecl notation = (NotationDecl) e;
- // ErrorMessage errMsg = notation.getErrorMessage();
- // if ( errMsg!= null)
- // {
- // addErrorMessage(errMsg);
- // }
- // }
- // else if ( e instanceof Attlist )
- // {
- // Attlist attList = (Attlist) e;
- // ErrorMessage errMsg = attList.getErrorMessage();
- // if ( errMsg!= null)
- // {
- // addErrorMessage(errMsg);
- // }
- // }
- // }
- //
- //
- // checkForDuplicateIDAttribute();
- // }
- // /**
- // * @generated
- // */
- // protected void updateElementHashtableGen() {
- //
- // elementPool.clear();
- // CreateListItems itemsHelper = new CreateListItems(dtdFile);
- //
- //
- // Vector allElements = itemsHelper.getElements();
- // // go through all the dtdFiles and list the elements
- // int numElements = allElements.size();
- //
- //
- // for (int i = 0; i < numElements; i++)
- // {
- // DTDElement element = (DTDElement) allElements.elementAt(i);
- // elementPool.put(getBaseName(element), element);
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void updateEntityHashtableGen() {
- //
- // updateHashTable(pePool, dtdFile.listDTDEntity());
- // }
- // /**
- // * @generated
- // */
- // protected void updateHashTableGen(Hashtable h, Collection dtdObjects) {
- //
- // h.clear();
- // Iterator i = dtdObjects.iterator();
- // while (i.hasNext())
- // {
- // String name = "";
- // DTDObject o = (DTDObject) i.next();
- // name = getBaseName(o);
- // h.put(name,o);
- // }
- // }
- // /**
- // * @generated
- // */
- // protected static String getBaseNameGen(DTDObject obj) {
- //
- // return getName(obj, null);
- // }
- // /**
- // * @generated
- // */
- // protected static String getNameGen(DTDObject obj, DTDFile dtdFile) {
- //
- // String name = "";
- // if (obj instanceof DTDEntity)
- // {
- // DTDEntity entity = (DTDEntity) obj;
- // if (dtdFile != null &&
- // !entity.getDTDFile().equals(dtdFile))
- // {
- // name = new Path(entity.getDTDFile().getName()).lastSegment() + ": ";
- // }
- // name += "%" + ((DTDEntity)obj).getName() + ";";
- // }
- // else if (obj instanceof DTDElement)
- // {
- // DTDElement element = (DTDElement) obj;
- // if (dtdFile != null &&
- // !element.getDTDFile().equals(dtdFile))
- // {
- // name = new Path(element.getDTDFile().getName()).lastSegment() + ": ";
- // }
- // name += ((DTDElement)obj).getName();
- // }
- // else if (obj instanceof DTDElementContent)
- // {
- // return ((DTDElementContent) obj).getContentName();
- // }
- // return name;
- // }
- // /**
- // * @generated
- // */
- // protected void checkForMissingElementReferencesGen(DTDElement element)
- // {
- //
- // String dtdString = null;
- // if ( element == null )
- // return;
- //
- //
- // Vector elementRefs = new Vector();
- // findElementReferences(element.getContent(),elementRefs);
- //
- //
- // Enumeration en = elementRefs.elements();
- // while (en.hasMoreElements())
- // {
- // String elementRefName = "";
- // DTDObject dtdObject = (DTDObject) en.nextElement();
- //
- //
- // if ( dtdObject instanceof DTDElement)
- // {
- // elementRefName = ((DTDElement)dtdObject).getName();
- // if ( getElementPool().get(elementRefName) == null)
- // {
- // if (dtdString == null)
- // {
- // dtdString = getDTDSource(false);
- // }
- // String errorMsg = "Element \"" + element.getName() + "\", refers to
- // undeclared element "
- // + "\"" + elementRefName + "\", in content model.\n";
- // ErrorMessage dtdError = new ErrorMessage();
- // dtdError.setErrorMessage(errorMsg);
- // SourceLocationHelper.LineColumn lineColumn =
- // SourceLocationHelper.offsetToLineColumn(dtdString,
- // element.getStartOffset());
- // dtdError.setErrorLine(lineColumn.getLine());
- // dtdError.setErrorColumn(lineColumn.getColumn());
- // addErrorMessage(dtdError);
- // }
- // }
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void findElementReferencesGen(DTDElementContent content,
- // Vector result) {
- //
- //
- // if (content instanceof DTDElementReferenceContent)
- // {
- // result.addElement(((DTDElementReferenceContent)content).getReferencedElement());
- // }
- // else if (content instanceof DTDEntityReferenceContent)
- // {
- // result.addElement(((DTDEntityReferenceContent)content).getElementReferencedEntity());
- // }
- // else if (content instanceof DTDGroupContent)
- // {
- // DTDGroupContent group = (DTDGroupContent)content;
- // EList contents = group.getContent();
- // Iterator i = contents.iterator();
- // while (i.hasNext())
- // {
- // findElementReferences((DTDElementContent) i.next(), result);
- // }
- // }
- // }
- // /**
- // * @generated
- // */
- // protected void checkForDuplicateIDAttributeGen() {
- //
- // String dtdString = null;
- // Collection elements = dtdFile.listDTDElement();
- // Iterator i = elements.iterator();
- // while (i.hasNext())
- // {
- // DTDElement element = (DTDElement) i.next();
- // Iterator k = element.getDTDAttribute().iterator();
- // boolean saw1stID = false;
- // while (k.hasNext())
- // {
- // DTDAttribute attr = (DTDAttribute) k.next();
- // DTDType dType = attr.getDTDType();
- // if (dType instanceof DTDBasicType)
- // {
- // if ( ((DTDBasicType)dType).getKind().intValue() == DTDBasicTypeKind.ID)
- // {
- // if (saw1stID)
- // {
- // if (dtdString == null)
- // {
- // dtdString = getDTDSource(false);
- // }
- // String errMsg = DTDPlugin.getDTDString("_ERROR_DUP_ID_ATTRIBUTE_1");
- // errMsg += attr.getName() +
- // DTDPlugin.getDTDString("_UI_ERRORPART_DUP_ID_ATTRIBUTE_2");
- //
- // ErrorMessage dtdError = new ErrorMessage();
- // dtdError.setErrorMessage(errMsg);
- // SourceLocationHelper.LineColumn lineColumn =
- // SourceLocationHelper.offsetToLineColumn(dtdString,
- // attr.getStartOffset());
- // dtdError.setErrorLine(lineColumn.getLine());
- // dtdError.setErrorColumn(lineColumn.getColumn());
- // dtdError.setObject(attr);
- // addErrorMessage(dtdError);
- // // dtdFile.setParseError(true);
- // break;
- // }
- // else
- // {
- // saw1stID = true;
- // }
- // }
- // }
- // }
- // }
- // }
- // /**
- // * @generated
- // */
- // protected static String getGroupTypeGen(int groupKind, int occurrence)
- // {
- //
- // String type = null;
- //
- //
- // switch (groupKind)
- // {
- // case DTDGroupKind.SEQUENCE:
- // type = "DTDSequence";
- // break;
- // case DTDGroupKind.CHOICE:
- // type = "DTDChoice";
- // break;
- // }
- //
- //
- // type += getRepeatableTypeSuffix(occurrence);
- // return type;
- // }
- // /**
- // * @generated
- // */
- // protected static String getReferenceTypeGen(int occurrence) {
- //
- // String type = "DTDReference";
- // type += getRepeatableTypeSuffix(occurrence);
- // return type;
- // }
- // /**
- // * @generated
- // */
- // protected static String getRepeatableTypeSuffixGen(int occurrence) {
- //
- // return "(" + (char)occurrence + ")";
- // }
- // /**
- // * @generated
- // */
- // protected static void mainGen(String[] args) {
- //
- // System.out.println("\nStarting ...");
- //
- //
- // if (args.length != 1)
- // System.out.println("usage: DtdUtil inputfile.dtd");
- //
- //
- // java.io.File inputFile = new File(args[0]);
- //
- //
- // String dtdFileName = "";
- // try
- // {
- // dtdFileName = inputFile.getCanonicalPath();
- // }
- // catch(IOException ex)
- // {}
- //
- //
- // String dtdModelName = dtdFileName;
- //
- //
- // if (DTDConstants.DTD_EXTENSION.equals(new
- // Path(dtdFileName).getFileExtension()))
- // {
- // dtdModelName= new
- // Path(dtdFileName).removeFileExtension().lastSegment();
- // }
- // DTDUtil d2m = new DTDUtil();
- // // TODO: fix port
- // // d2m.parse(dtdFileName);
- // try
- // {
- // d2m.saveAs(dtdModelName + "." + DTDConstants.DTD_XMI_EXTENSION);
- // }
- // catch (Exception e)
- // {
- // System.out.println("Exception thrown during model save: " + e);
- // }
- // System.out.println("Done.");
- // }
- // /**
- // * @generated
- // */
- // protected org.eclipse.core.runtime.IPath getPathGen() {
- //
- // Path currentDTDPath = new Path(dtdModelFile);
- // if (currentDTDPath.segmentCount() > 1)
- // {
- // return currentDTDPath.removeLastSegments(1).addTrailingSeparator();
- // }
- //
- // return new Path("");
- // }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java
deleted file mode 100644
index 655657ea65..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java
+++ /dev/null
@@ -1,315 +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.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDVisitor {
-
- public DTDVisitor() {
- }
-
- public void visitDTDFile(DTDFile file) {
- Collection notations = file.listDTDNotation();
- for (Iterator i = notations.iterator(); i.hasNext();) {
- visitDTDNotation((DTDNotation) i.next());
- }
-
- Collection entities = file.listDTDEntity();
- for (Iterator i = entities.iterator(); i.hasNext();) {
- visitDTDEntity((DTDEntity) i.next());
- }
-
- Collection objects = file.listDTDElementAndDTDParameterEntityReference();
- for (Iterator i = objects.iterator(); i.hasNext();) {
- DTDObject object = (DTDObject) i.next();
- if (object instanceof DTDElement) {
- visitDTDElement((DTDElement) object);
- } // end of if ()
- else {
- visitDTDParameterEntityReference((DTDParameterEntityReference) object);
- } // end of if ()
- }
-
- }
-
- public void visitDTDNotation(DTDNotation notation) {
- }
-
- public void visitDTDEntity(DTDEntity entity) {
- }
-
- public void visitDTDElement(DTDElement element) {
- visitDTDElementContent(element.getContent());
- visitDTDAttributeList(element.getDTDAttribute());
- }
-
- public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
-
- }
-
- public void visitDTDElementContent(DTDElementContent content) {
- // System.out.println("visitDTDElementContent : " + content);
- if (content instanceof DTDEmptyContent) {
- visitDTDEmptyContent((DTDEmptyContent) content);
- }
- else if (content instanceof DTDAnyContent) {
- visitDTDAnyContent((DTDAnyContent) content);
- }
- else if (content instanceof DTDPCDataContent) {
- visitDTDPCDataContent((DTDPCDataContent) content);
- }
- if (content instanceof DTDRepeatableContent) {
- if (content instanceof DTDGroupContent) {
- visitDTDGroupContent((DTDGroupContent) content);
- }
- else if (content instanceof DTDElementReferenceContent) {
- visitDTDElementReferenceContent((DTDElementReferenceContent) content);
- }
- else {
- visitDTDEntityReferenceContent((DTDEntityReferenceContent) content);
- } // end of else
-
- // System.out.println("occurrence: " +
- // (char)((DTDRepeatableContent)content).getOccurrence());
- }
- }
-
- public void visitDTDEmptyContent(DTDEmptyContent dtdEmptyContent) {
- // System.out.println("content: EMPTY");
- }
-
- public void visitDTDAnyContent(DTDAnyContent dtdAnyContent) {
- // System.out.println("content: ANY");
- }
-
- public void visitDTDPCDataContent(DTDPCDataContent pcDataContent) {
- // System.out.println("content: PCDATA");
- }
-
- public void visitDTDGroupContent(DTDGroupContent groupContent) {
- if (groupContent.getGroupKind().getValue() == DTDGroupKind.SEQUENCE) {
- // System.out.println("content: Sequence");
- }
- else // if (contentgetGroupKind() == DTDGroupKind.CHOICE)
- {
- // System.out.println("content: Choice");
- }
-
- Collection groupContents = groupContent.getContent();
- for (Iterator i = groupContents.iterator(); i.hasNext();) {
- visitDTDElementContent((DTDElementContent) i.next());
- }
- }
-
- public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
- }
-
- public void visitDTDEntityReferenceContent(DTDEntityReferenceContent entityReferenceContent) {
- }
-
- public void visitDTDAttributeList(List attrs) {
- Iterator iter = attrs.iterator();
-
- while (iter.hasNext()) {
- visitDTDAttribute((DTDAttribute) iter.next());
- } // end of while ()
- }
-
- public void visitDTDAttribute(DTDAttribute attribute) {
- }
-
- /**
- * @generated
- */
- protected void visitDTDFileGen(DTDFile file) {
-
- Collection notations = file.listDTDNotation();
- for (Iterator i = notations.iterator(); i.hasNext();) {
- visitDTDNotation((DTDNotation) i.next());
- }
-
- Collection entities = file.listDTDEntity();
- for (Iterator i = entities.iterator(); i.hasNext();) {
- visitDTDEntity((DTDEntity) i.next());
- }
-
- Collection objects = file.listDTDElementAndDTDParameterEntityReference();
- for (Iterator i = objects.iterator(); i.hasNext();) {
- DTDObject object = (DTDObject) i.next();
- if (object instanceof DTDElement) {
- visitDTDElement((DTDElement) object);
- } // end of if ()
- else {
- visitDTDParameterEntityReference((DTDParameterEntityReference) object);
- } // end of if ()
- }
- }
-
- /**
- * @generated
- */
- protected void visitDTDNotationGen(DTDNotation notation) {
-
- }
-
- /**
- * @generated
- */
- protected void visitDTDEntityGen(DTDEntity entity) {
-
- }
-
- /**
- * @generated
- */
- protected void visitDTDElementGen(DTDElement element) {
-
- visitDTDElementContent(element.getContent());
- visitDTDAttributeList(element.getDTDAttribute());
- }
-
- /**
- * @generated
- */
- protected void visitDTDParameterEntityReferenceGen(DTDParameterEntityReference parmEntity) {
-
- }
-
- /**
- * @generated
- */
- protected void visitDTDElementContentGen(DTDElementContent content) {
-
- // System.out.println("visitDTDElementContent : " + content);
- if (content instanceof DTDEmptyContent) {
- visitDTDEmptyContent((DTDEmptyContent) content);
- }
- else if (content instanceof DTDAnyContent) {
- visitDTDAnyContent((DTDAnyContent) content);
- }
- else if (content instanceof DTDPCDataContent) {
- visitDTDPCDataContent((DTDPCDataContent) content);
- }
- if (content instanceof DTDRepeatableContent) {
- if (content instanceof DTDGroupContent) {
- visitDTDGroupContent((DTDGroupContent) content);
- }
- else if (content instanceof DTDElementReferenceContent) {
- visitDTDElementReferenceContent((DTDElementReferenceContent) content);
- }
- else {
- visitDTDEntityReferenceContent((DTDEntityReferenceContent) content);
- } // end of else
-
- // System.out.println("occurrence: " +
- // (char)((DTDRepeatableContent)content).getOccurrence());
- }
- }
-
- /**
- * @generated
- */
- protected void visitDTDEmptyContentGen(DTDEmptyContent dtdEmptyContent) {
-
- // System.out.println("content: EMPTY");
- }
-
- /**
- * @generated
- */
- protected void visitDTDAnyContentGen(DTDAnyContent dtdAnyContent) {
-
- // System.out.println("content: ANY");
- }
-
- /**
- * @generated
- */
- protected void visitDTDPCDataContentGen(DTDPCDataContent pcDataContent) {
-
- // System.out.println("content: PCDATA");
- }
-
- /**
- * @generated
- */
- protected void visitDTDGroupContentGen(DTDGroupContent groupContent) {
-
- if (groupContent.getGroupKind().getValue() == DTDGroupKind.SEQUENCE) {
- // System.out.println("content: Sequence");
- }
- else // if (contentgetGroupKind() == DTDGroupKind.CHOICE)
- {
- // System.out.println("content: Choice");
- }
-
- Collection groupContents = groupContent.getContent();
- for (Iterator i = groupContents.iterator(); i.hasNext();) {
- visitDTDElementContent((DTDElementContent) i.next());
- }
- }
-
- /**
- * @generated
- */
- protected void visitDTDElementReferenceContentGen(DTDElementReferenceContent elementReferenceContent) {
-
- }
-
- /**
- * @generated
- */
- protected void visitDTDEntityReferenceContentGen(DTDEntityReferenceContent entityReferenceContent) {
-
- }
-
- /**
- * @generated
- */
- protected void visitDTDAttributeListGen(List attrs) {
-
- Iterator iter = attrs.iterator();
-
- while (iter.hasNext()) {
- visitDTDAttribute((DTDAttribute) iter.next());
- } // end of while ()
- }
-
- /**
- * @generated
- */
- protected void visitDTDAttributeGen(DTDAttribute attribute) {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java
deleted file mode 100644
index 2b0536cafb..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java
+++ /dev/null
@@ -1,85 +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.dtd.core.internal.emf.util;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-
-
-/**
- * Load another DTD model - use when there is external entity references from
- * another model
- */
-public class ExternalDTDModel {
- DTDFile dtdFile = null;
-
- public ExternalDTDModel() {
- }
-
- public DTDFile getExternalDTDFile() {
- return dtdFile;
- }
-
- /**
- * Load the DTD model specified by the uri e.g.
- * file:C:/eclipse/examples/purchaseorder.dtd
- */
- public boolean loadModel(ResourceSet resources, String uri) {
- boolean rc = true;
-
- if (uri == null || uri.equals("")) { //$NON-NLS-1$
- return false;
- }
-
- try {
- // todo... Investigate why we can not create a new DTDUtil to load
- // the external
- // without breaking the bvt test bucket on the oagis cases.
- // Are depending on mof's built in caching via
- // resources.load(uri)?
- //
- URI uriObj = URI.createURI(uri);
- Resource r = resources.createResource(uriObj);
- Map options = new HashMap();
- r.load(options);
-
- for (Iterator i = resources.getResources().iterator(); i.hasNext();) {
- DTDFile currentFile = (DTDFile) ((Resource) i.next()).getContents().get(0);
- String currentURI = currentFile.eResource().getURI().toString();
- // note : mof stores a slightly different uri than the one we
- // passed in to resources.load(uri)
- // In the 'file:' protocol case, the call
- // resource.load("file:D:\x.dtd") will store a resource with
- // uri "D:\x.dtd".
- // This is why we use 'endswith()' instead of 'equals()' to
- // compare.
- if (uri.endsWith(currentURI)) {
- dtdFile = currentFile;
- break;
- }
- }
- if (dtdFile == null) {
- rc = false;
- }
- }
- catch (Exception ex) {
- rc = false;
- }
- return rc;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat b/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat
deleted file mode 100644
index 4097274f7b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat
+++ /dev/null
@@ -1,3812 +0,0 @@
-
-(object Petal
- version 45
- _written "Rose 7.5.0103.1920"
- charSet 0)
-
-(object Class_Category "dtd"
- is_unit TRUE
- is_loaded TRUE
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935d5730-850b-11e1-0000-005cf4691c4c:1"))
- (object Attribute
- tool "Ecore"
- name "packageName"
- value (value Text "dtd"))
- (object Attribute
- tool "Ecore"
- name "basePackage"
- value (value Text "org.eclipse.wst.dtd"))
- (object Attribute
- tool "Ecore"
- name "prefix"
- value (value Text "DTD")))
- quid "3857B1C00293"
- exportControl "Public"
- logical_models (list unit_reference_list
- (object Class "DTDElementContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935d5730-850b-11e1-0001-005cf4691c4c:1")))
- quid "37CBEACF0213"
- abstract TRUE)
- (object Class "DTDGroupContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0000-005cf4691c4c:1")))
- quid "37CBEAEF0232"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0001-005cf4691c4c:1")))
- quid "37D9AD920363"
- supplier "Logical View::dtd::DTDRepeatableContent"
- quidu "37D9AD4C01D1"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "groupKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0002-005cf4691c4c:1")))
- quid "37EFC9EC0189"
- type "DTDGroupKind"
- quidu "37EFCA550216"
- exportControl "Public")))
- (object Class "DTDAttribute"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0003-005cf4691c4c:1")))
- quid "37CC187900EA"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0004-005cf4691c4c:1")))
- quid "39B7F15901DA"
- supplier "Logical View::ecore::EAttribute"
- quidu "39238472039D"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "comment"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0005-005cf4691c4c:1")))
- quid "3839DC9A013B"
- type "String"
- exportControl "Public")
- (object ClassAttribute "defaultKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0006-005cf4691c4c:1")))
- quid "37E144BF0261"
- type "DTDDefaultKind"
- quidu "37E144DC03AD"
- exportControl "Public")
- (object ClassAttribute "defaultValueString"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0007-005cf4691c4c:1")))
- quid "396B9BBF006B"
- type "String"
- exportControl "Public")))
- (object Class "DTDOccurrenceType"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0008-005cf4691c4c:1")))
- quid "37CC19AF007D"
- documentation
-|ONE=49
-|OPTIONAL=63 ONE_OR_MORE=43 ZERO_OR_MORE=42
-
- stereotype "enumeration")
- (object Class "DTDElement"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0009-005cf4691c4c:1")))
- quid "37D9AAF70071"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000a-005cf4691c4c:1")))
- quid "39B7F0AF02A8"
- supplier "Logical View::ecore::EClass"
- quidu "3903D5BF000A")
- (object Inheritance_Relationship
- quid "39FE2B83029B"
- supplier "Logical View::dtd::DTDContent"
- quidu "39FE2B5E02DE"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "comment"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000b-005cf4691c4c:1")))
- quid "3839DC810062"
- type "String"
- exportControl "Public")))
- (object Class "DTDEmptyContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000c-005cf4691c4c:1")))
- quid "37D9AB47037A"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000d-005cf4691c4c:1")))
- quid "37D9ABF30327"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213")))
- (object Class "DTDAnyContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000e-005cf4691c4c:1")))
- quid "37D9AB500304"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-000f-005cf4691c4c:1")))
- quid "37D9ABEE0207"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213")))
- (object Class "DTDPCDataContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0010-005cf4691c4c:1")))
- quid "37D9AB5C0135"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0011-005cf4691c4c:1")))
- quid "37D9ABE90278"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213")))
- (object Class "DTDElementReferenceContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0012-005cf4691c4c:1")))
- quid "37D9AB7D0010"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0013-005cf4691c4c:1")))
- quid "37D9AD8C03AA"
- supplier "Logical View::dtd::DTDRepeatableContent"
- quidu "37D9AD4C01D1")))
- (object Class "DTDRepeatableContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0014-005cf4691c4c:1")))
- quid "37D9AD4C01D1"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0015-005cf4691c4c:1")))
- quid "37D9ADB703C0"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "occurrence"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0016-005cf4691c4c:1")))
- quid "37CC18A90148"
- documentation "JUST_ONE= -1 ONE_OR_MORE=43 OPTIONAL=63 ZERO_OR_MORE=42"
- type "DTDOccurrenceType"
- quidu "37CC19AF007D"
- exportControl "Public"))
- abstract TRUE)
- (object Class "DTDFile"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0017-005cf4691c4c:1")))
- quid "37D9B08E018F"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0018-005cf4691c4c:1")))
- quid "39B7F07F0118"
- supplier "Logical View::ecore::eNamedElement"
- quidu "3903D4EE0014"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "comment"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-0019-005cf4691c4c:1")))
- quid "3839DBEF012B"
- type "String"
- exportControl "Public")
- (object ClassAttribute "parseError"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:935eddd0-850b-11e1-001a-005cf4691c4c:1")))
- quid "388C995F025B"
- type "boolean"
- exportControl "Public")))
- (object Class "DTDDefaultKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0000-005cf4691c4c:1")))
- quid "37E144DC03AD"
- documentation "IMPLIED=1 REQUIRED=2 FIXED=3 NOFIXED=4"
- stereotype "enumeration")
- (object Class "DTDBasicType"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0001-005cf4691c4c:1")))
- quid "37E1464F00DA"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0002-005cf4691c4c:1")))
- quid "39B7F2800315"
- supplier "Logical View::ecore::EClass"
- quidu "3903D5BF000A"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "kind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0003-005cf4691c4c:1")))
- quid "37E1468A0016"
- type "DTDBasicTypeKind"
- quidu "37E14905022C"
- exportControl "Public")))
- (object Class "DTDEnumerationType"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0004-005cf4691c4c:1")))
- quid "37E146680306"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0005-005cf4691c4c:1")))
- quid "39B7F2810302"
- supplier "Logical View::ecore::EEnum"
- quidu "39A473E901D4"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "kind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0006-005cf4691c4c:1")))
- quid "37E146AC03B8"
- type "DTDEnumGroupKind"
- quidu "37E149B201AD"
- exportControl "Public")))
- (object Class "DTDBasicTypeKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0007-005cf4691c4c:1")))
- quid "37E14905022C"
- documentation "NONE=0 CDATA=1 ID=2 IDREF=3 IDREFS=4 ENTITY=5 ENTITIES=6 NMTOKEN=7 NMTOKENS=8"
- stereotype "enumeration")
- (object Class "DTDEnumGroupKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0008-005cf4691c4c:1")))
- quid "37E149B201AD"
- documentation "NAME_TOKEN_GROUP=1 NOTATION_GROUP=2"
- stereotype "enumeration")
- (object Class "DTDGroupKind"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0009-005cf4691c4c:1")))
- quid "37EFCA550216"
- documentation "SEQUENCE=1 CHOICE=2"
- stereotype "enumeration")
- (object Class "DTDNotation"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000a-005cf4691c4c:1")))
- quid "37EFD0EF00C9"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000b-005cf4691c4c:1")))
- quid "39B7F0E30234"
- supplier "Logical View::ecore::eNamedElement"
- quidu "3903D4EE0014")
- (object Inheritance_Relationship
- quid "39FE2B850118"
- supplier "Logical View::dtd::DTDContent"
- quidu "39FE2B5E02DE"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "comment"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000c-005cf4691c4c:1")))
- quid "3839DC0A024C"
- type "String"
- exportControl "Public")
- (object ClassAttribute "systemID"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000d-005cf4691c4c:1")))
- quid "37EFD1020397"
- type "string"
- exportControl "Public")
- (object ClassAttribute "publicID"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000e-005cf4691c4c:1")))
- quid "37EFD10E018C"
- type "string"
- exportControl "Public")))
- (object Class "DTDEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-000f-005cf4691c4c:1")))
- quid "37EFD12B03C8"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0010-005cf4691c4c:1")))
- quid "39B7F0E701EA"
- supplier "Logical View::ecore::eNamedElement"
- quidu "3903D4EE0014")
- (object Inheritance_Relationship
- quid "39FE2B860304"
- supplier "Logical View::dtd::DTDContent"
- quidu "39FE2B5E02DE"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "comment"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0011-005cf4691c4c:1")))
- quid "3839DC37008E"
- type "String"
- exportControl "Public")
- (object ClassAttribute "parameterEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0012-005cf4691c4c:1")))
- quid "37EFD13C017E"
- type "boolean"
- exportControl "Public")))
- (object Class "DTDEntityContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0013-005cf4691c4c:1")))
- quid "37EFD19D0083"
- abstract TRUE)
- (object Class "DTDExternalEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0014-005cf4691c4c:1")))
- quid "37EFD1F803E1"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:9361eb10-850b-11e1-0015-005cf4691c4c:1")))
- quid "37EFD32400F3"
- supplier "Logical View::dtd::DTDEntityContent"
- quidu "37EFD19D0083"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "systemID"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0000-005cf4691c4c:1")))
- quid "37EFD2E50161"
- type "string"
- exportControl "Public")
- (object ClassAttribute "publicID"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0001-005cf4691c4c:1")))
- quid "37EFD2EC01F7"
- type "string"
- exportControl "Public")))
- (object Class "DTDInternalEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0002-005cf4691c4c:1")))
- quid "37EFD2BA026E"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0003-005cf4691c4c:1")))
- quid "37EFD32B032E"
- supplier "Logical View::dtd::DTDEntityContent"
- quidu "37EFD19D0083"))
- class_attributes (list class_attribute_list
- (object ClassAttribute "value"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0004-005cf4691c4c:1")))
- quid "37EFD2CB0268"
- type "string"
- exportControl "Public")))
- (object Class "DTDParameterEntityReference"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0005-005cf4691c4c:1")))
- quid "385287CA0163"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0006-005cf4691c4c:1")))
- quid "39B7F0D10076"
- supplier "Logical View::ecore::eNamedElement"
- quidu "3903D4EE0014")
- (object Inheritance_Relationship
- quid "39FE2B8A0287"
- supplier "Logical View::dtd::DTDContent"
- quidu "39FE2B5E02DE")))
- (object Class "DTDEntityReferenceContent"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0007-005cf4691c4c:1")))
- quid "3852900E0127"
- superclasses (list inheritance_relationship_list
- (object Inheritance_Relationship
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0008-005cf4691c4c:1")))
- quid "38529044011B"
- supplier "Logical View::dtd::DTDRepeatableContent"
- quidu "37D9AD4C01D1")))
- (object Class "XMLSchemaDefinedType"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0009-005cf4691c4c:1")))
- quid "389F0C6D010E"
- documentation
-|NONE=-1
-|STRING=1
-|BOOLEAN=2
-|FLOAT=3
-|DOUBLE=4
-|DECIMAL=5
-|TIMEINSTANT=6
-|TIMEDURATION=7
-|RECURRINGINSTANT=8
-|BINARY=9
-|URI=10
-|INTEGER=11
-|DATE=12
-|TIME=13
-
- stereotype "enumeration")
- (object Class "DTDContent"
- quid "39FE2B5E02DE"
- abstract TRUE)
- (object Association "$UNNAMED$0"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000a-005cf4691c4c:1")))
- quid "37CBEB6F005D"
- roles (list role_list
- (object Role "content"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000b-005cf4691c4c:1")))
- quid "37CBEB70006D"
- label "content"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213"
- client_cardinality (value cardinality "1..n")
- Constraints "ordered"
- Containment "By Value"
- is_navigable TRUE)
- (object Role "group"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000c-005cf4691c4c:1")))
- quid "37CBEB7000AB"
- label "group"
- supplier "Logical View::dtd::DTDGroupContent"
- quidu "37CBEAEF0232"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE
- is_aggregate TRUE)))
- (object Association "$UNNAMED$1"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000d-005cf4691c4c:1")))
- quid "37D9AC0E00CD"
- roles (list role_list
- (object Role "element"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000e-005cf4691c4c:1")))
- quid "37D9AC0F039F"
- label "element"
- supplier "Logical View::dtd::DTDElement"
- quidu "37D9AAF70071"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "content"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-000f-005cf4691c4c:1")))
- quid "37D9AC0F03A9"
- label "content"
- supplier "Logical View::dtd::DTDElementContent"
- quidu "37CBEACF0213"
- client_cardinality (value cardinality "1")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$2"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0010-005cf4691c4c:1")))
- quid "37D9AF11001A"
- roles (list role_list
- (object Role "elementReference"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0011-005cf4691c4c:1")))
- quid "37D9AF1B0209"
- label "elementReference"
- supplier "Logical View::dtd::DTDElementReferenceContent"
- quidu "37D9AB7D0010"
- client_cardinality (value cardinality "0..n"))
- (object Role "referencedElement"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0012-005cf4691c4c:1")))
- quid "37D9AF1B020A"
- label "referencedElement"
- supplier "Logical View::dtd::DTDElement"
- quidu "37D9AAF70071"
- client_cardinality (value cardinality "1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$3"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0013-005cf4691c4c:1")))
- quid "37EFD1C902DF"
- roles (list role_list
- (object Role "$UNNAMED$4"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0014-005cf4691c4c:1")))
- quid "37EFD1CA031D"
- supplier "Logical View::dtd::DTDEntity"
- quidu "37EFD12B03C8"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "content"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0015-005cf4691c4c:1")))
- quid "37EFD1CA0327"
- label "content"
- supplier "Logical View::dtd::DTDEntityContent"
- quidu "37EFD19D0083"
- client_cardinality (value cardinality "1")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$5"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0016-005cf4691c4c:1")))
- quid "37EFD34400E5"
- roles (list role_list
- (object Role "notation"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0017-005cf4691c4c:1"))
- (object Attribute
- tool "eCore"
- name "isTransient"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value TRUE))
- quid "37EFD3450209"
- label "notation"
- supplier "Logical View::dtd::DTDNotation"
- quidu "37EFD0EF00C9"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE)
- (object Role "entity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0018-005cf4691c4c:1")))
- quid "37EFD3450213"
- label "entity"
- supplier "Logical View::dtd::DTDExternalEntity"
- quidu "37EFD1F803E1"
- client_cardinality (value cardinality "0..n")
- is_navigable TRUE)))
- (object Association "$UNNAMED$6"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0019-005cf4691c4c:1")))
- quid "38528979005F"
- roles (list role_list
- (object Role "parmEntityRef"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001a-005cf4691c4c:1")))
- quid "3852897C0352"
- label "parmEntityRef"
- supplier "Logical View::dtd::DTDParameterEntityReference"
- quidu "385287CA0163"
- client_cardinality (value cardinality "1")
- is_navigable TRUE)
- (object Role "entity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001b-005cf4691c4c:1")))
- quid "3852897C0353"
- label "entity"
- supplier "Logical View::dtd::DTDEntity"
- quidu "37EFD12B03C8"
- client_cardinality (value cardinality "1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$7"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001c-005cf4691c4c:1")))
- quid "385294EB0243"
- roles (list role_list
- (object Role "entityReference"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001d-005cf4691c4c:1"))
- (object Attribute
- tool "eCore"
- name "isTransient"
- value TRUE))
- quid "385294EF03BB"
- label "entityReference"
- supplier "Logical View::dtd::DTDEntityReferenceContent"
- quidu "3852900E0127"
- client_cardinality (value cardinality "0..n")
- is_navigable TRUE)
- (object Role "elementReferencedEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001e-005cf4691c4c:1")))
- quid "385294EF03BC"
- label "elementReferencedEntity"
- supplier "Logical View::dtd::DTDEntity"
- quidu "37EFD12B03C8"
- client_cardinality (value cardinality "1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$8"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-001f-005cf4691c4c:1")))
- quid "3852972D02CB"
- roles (list role_list
- (object Role "attributeNameReference"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0020-005cf4691c4c:1"))
- (object Attribute
- tool "eCore"
- name "isTransient"
- value TRUE))
- quid "385297360291"
- label "attributeNameReference"
- supplier "Logical View::dtd::DTDAttribute"
- quidu "37CC187900EA"
- client_cardinality (value cardinality "0..n")
- is_navigable TRUE)
- (object Role "attributeNameReferencedEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0021-005cf4691c4c:1")))
- quid "38529736029B"
- label "attributeNameReferencedEntity"
- supplier "Logical View::dtd::DTDEntity"
- quidu "37EFD12B03C8"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$9"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0022-005cf4691c4c:1")))
- quid "38B68A7302B8"
- roles (list role_list
- (object Role "$UNNAMED$10"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0023-005cf4691c4c:1")))
- quid "38B68A780084"
- supplier "Logical View::dtd::DTDExternalEntity"
- quidu "37EFD1F803E1")
- (object Role "entityReferencedFromAnotherFile"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0024-005cf4691c4c:1")))
- quid "38B68A78008E"
- label "entityReferencedFromAnotherFile"
- supplier "Logical View::dtd::DTDFile"
- quidu "37D9B08E018F"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$11"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0025-005cf4691c4c:1")))
- quid "38BD4908013D"
- roles (list role_list
- (object Role "attributeTypeReference"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0026-005cf4691c4c:1"))
- (object Attribute
- tool "eCore"
- name "isTransient"
- value TRUE))
- quid "38BD49140130"
- label "attributeTypeReference"
- supplier "Logical View::dtd::DTDAttribute"
- quidu "37CC187900EA"
- client_cardinality (value cardinality "0..n")
- is_navigable TRUE)
- (object Role "attributeTypeReferencedEntity"
- attributes (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "uuid"
- value (value Text "DCE:936371b0-850b-11e1-0027-005cf4691c4c:1")))
- quid "38BD4914014E"
- label "attributeTypeReferencedEntity"
- supplier "Logical View::dtd::DTDEntity"
- quidu "37EFD12B03C8"
- client_cardinality (value cardinality "0..1")
- is_navigable TRUE)))
- (object Association "$UNNAMED$12"
- quid "39FE2A9500CC"
- roles (list role_list
- (object Role "$UNNAMED$13"
- quid "39FE2A950311"
- supplier "Logical View::dtd::DTDElement"
- quidu "37D9AAF70071"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$14"
- quid "39FE2A95031B"
- supplier "Logical View::dtd::DTDAttribute"
- quidu "37CC187900EA"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$15"
- quid "39FE2BBE02DC"
- roles (list role_list
- (object Role "$UNNAMED$16"
- quid "39FE2BBF01B1"
- supplier "Logical View::dtd::DTDFile"
- quidu "37D9B08E018F"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$17"
- quid "39FE2BBF01BB"
- supplier "Logical View::dtd::DTDContent"
- quidu "39FE2B5E02DE"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$18"
- quid "39FE30D8033E"
- roles (list role_list
- (object Role "$UNNAMED$19"
- quid "39FE30D90105"
- supplier "Logical View::dtd::DTDFile"
- quidu "37D9B08E018F"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$20"
- quid "39FE30D90137"
- supplier "Logical View::dtd::DTDEnumerationType"
- quidu "37E146680306"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE))))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "37CAB0E60177"
- title "Main"
- zoom 98
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object NoteView @1
- location (3264, 240)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @1
- location (2910, 65)
- fill_color 13434879
- nlines 7
- max_width 673
- label
-|DTDElement's,
-|DTDParameterEntityReference's, DTDEntity's, and DTDNotation's are added to DTDFile's using the
-|ownedElement relationship
-|between MOFNamespace
-|and MOFObject
- )
- line_color 3342489
- fill_color 13434879
- width 733
- height 363)
- (object ClassView "Class" "Logical View::dtd::DTDInternalEntity" @2
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1824, 1872)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @2
- location (1647, 1817)
- fill_color 13434879
- nlines 1
- max_width 354
- justify 0
- label "DTDInternalEntity")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD2BA026E"
- width 372
- height 134
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDElement" @3
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (592, 1200)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @3
- location (417, 1145)
- fill_color 13434879
- nlines 1
- max_width 350
- justify 0
- label "DTDElement")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AAF70071"
- compartment (object Compartment
- Parent_View @3
- location (417, 1204)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- icon_style "Icon"
- fill_color 16777215
- anchor 2
- nlines 1
- max_width 371)
- width 368
- height 134
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDEntityContent" @4
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1520, 1488)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @4
- location (1341, 1438)
- fill_color 13434879
- nlines 1
- max_width 358
- justify 0
- label "DTDEntityContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD19D0083"
- width 376
- height 124
- annotation 8
- autoResize TRUE)
- (object InheritTreeView "" @5
- location (1520, 1640)
- line_color 3342489
- fill_color 13434879
- supplier @4
- vertices (list Points
- (1520, 1640)
- (1520, 1550)))
- (object ClassView "Class" "Logical View::dtd::DTDParameterEntityReference" @6
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (2480, 1216)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @6
- location (2186, 1166)
- fill_color 13434879
- nlines 1
- max_width 588
- justify 0
- label "DTDParameterEntityReference")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "385287CA0163"
- width 606
- height 124
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDEntity" @7
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1520, 1216)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @7
- location (1270, 1137)
- fill_color 13434879
- nlines 1
- max_width 500
- justify 0
- label "DTDEntity")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD12B03C8"
- compartment (object Compartment
- Parent_View @7
- location (1270, 1196)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- icon_style "Icon"
- fill_color 16777215
- anchor 2
- nlines 2
- max_width 525)
- width 518
- height 182
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$3" @8
- location (1546, 1366)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD1C902DF"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$4" @9
- Parent_View @8
- location (-54, 246)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD1CA031D"
- client @8
- supplier @7
- line_style 3
- origin_attachment (1546, 1366)
- terminal_attachment (1546, 1307))
- (object RoleView "content" @10
- Parent_View @8
- location (-54, 246)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @11
- Parent_View @10
- location (1443, 1407)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 191
- justify 0
- label "+content"
- pctDist 0.699248
- height 104
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD1CA0327"
- client @8
- supplier @4
- line_style 3
- origin_attachment (1546, 1366)
- terminal_attachment (1546, 1426)
- label (object SegLabel @12
- Parent_View @10
- location (1568, 1408)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.721804
- height 22
- orientation 0))))
- (object AssociationViewNew "$UNNAMED$6" @13
- location (1978, 1256)
- stereotype TRUE
- line_color 3342489
- quidu "38528979005F"
- roleview_list (list RoleViews
- (object RoleView "parmEntityRef" @14
- Parent_View @13
- location (602, 488)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @15
- Parent_View @14
- location (2038, 1299)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 328
- justify 0
- label "+parmEntityRef"
- pctDist 0.305419
- height 43
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "3852897C0352"
- client @13
- supplier @6
- line_style 3
- origin_attachment (1978, 1256)
- terminal_attachment (2177, 1256)
- label (object SegLabel @16
- Parent_View @14
- location (2141, 1228)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.826484
- height 29
- orientation 0))
- (object RoleView "entity" @17
- Parent_View @13
- location (602, 488)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @18
- Parent_View @17
- location (1862, 1217)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 150
- justify 0
- label "+entity"
- pctDist 0.589109
- height 40
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "3852897C0353"
- client @13
- supplier @7
- line_style 3
- origin_attachment (1978, 1256)
- terminal_attachment (1779, 1256)
- label (object SegLabel @19
- Parent_View @17
- location (1823, 1309)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.776923
- height 53
- orientation 0))))
- (object ClassView "Class" "Logical View::ecore::eNamedElement" @20
- ShowCompartmentStereotypes TRUE
- location (1488, 176)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @20
- location (1352, 131)
- fill_color 13434879
- nlines 1
- max_width 272
- justify 0
- label "eNamedElement")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "3903D4EE0014"
- width 290
- height 115
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::ecore::EClass" @21
- ShowCompartmentStereotypes TRUE
- location (576, 960)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @21
- location (492, 863)
- fill_color 13434879
- nlines 2
- max_width 168
- justify 0
- label "EClass")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "3903D5BF000A"
- width 186
- height 218
- annotation 8
- autoResize TRUE)
- (object InheritView "" @22
- stereotype TRUE
- line_color 12615680
- quidu "39B7F0AF02A8"
- client @3
- supplier @21
- line_style 3
- origin_attachment (571, 1132)
- terminal_attachment (571, 1069))
- (object ClassView "Class" "Logical View::ecore::eNamedElement" @23
- ShowCompartmentStereotypes TRUE
- location (2560, 864)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @23
- location (2424, 819)
- fill_color 13434879
- nlines 1
- max_width 272
- justify 0
- label "eNamedElement")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "3903D4EE0014"
- width 290
- height 115
- annotation 8
- autoResize TRUE)
- (object InheritTreeView "" @24
- location (2560, 1036)
- line_color 12615680
- fill_color 13434879
- supplier @23
- vertices (list Points
- (2560, 1036)
- (2560, 921)))
- (object InheritView "" @25
- stereotype TRUE
- line_color 12615680
- quidu "39B7F0E701EA"
- client @7
- supplier @23
- line_style 3
- origin_attachment (1669, 1125)
- terminal_attachment (1669, 1036)
- drawSupplier @24)
- (object InheritView "" @26
- stereotype TRUE
- line_color 12615680
- quidu "39B7F0D10076"
- client @6
- supplier @23
- line_style 3
- origin_attachment (2618, 1153)
- terminal_attachment (2618, 1036)
- drawSupplier @24)
- (object ClassView "Class" "Logical View::dtd::DTDNotation" @27
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (992, 1232)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @27
- location (817, 1129)
- fill_color 13434879
- nlines 1
- max_width 350
- justify 0
- label "DTDNotation")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD0EF00C9"
- compartment (object Compartment
- Parent_View @27
- location (817, 1188)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- icon_style "Icon"
- fill_color 16777215
- anchor 2
- nlines 3
- max_width 371)
- width 368
- height 230
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDExternalEntity" @28
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1344, 1872)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @28
- location (1158, 1793)
- fill_color 13434879
- nlines 1
- max_width 372
- justify 0
- label "DTDExternalEntity")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD1F803E1"
- width 390
- height 182
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$5" @29
- location (969, 1677)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD34400E5"
- roleview_list (list RoleViews
- (object RoleView "notation" @30
- Parent_View @29
- location (-247, 205)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @31
- Parent_View @30
- location (834, 1390)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 203
- justify 0
- label "+notation"
- pctDist 0.870734
- height 136
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD3450209"
- client @29
- supplier @27
- line_style 3
- origin_attachment (969, 1677)
- terminal_attachment (969, 1347)
- label (object SegLabel @32
- Parent_View @30
- location (1040, 1388)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 72
- justify 0
- label "0..1"
- pctDist 0.877934
- height 71
- orientation 1))
- (object RoleView "entity" @33
- Parent_View @29
- location (-247, 205)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @34
- Parent_View @33
- location (1082, 1786)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 150
- justify 0
- label "+entity"
- pctDist 0.800000
- height 42
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "37EFD3450213"
- client @29
- supplier @28
- vertices (list Points
- (969, 1677)
- (969, 1827)
- (1149, 1827))
- line_style 3
- origin_attachment (969, 1677)
- terminal_attachment (1149, 1827)
- label (object SegLabel @35
- Parent_View @33
- location (1104, 1853)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..n"
- pctDist 0.863501
- height 26
- orientation 1))))
- (object InheritView "" @36
- stereotype TRUE
- line_color 3342489
- quidu "37EFD32400F3"
- client @28
- supplier @4
- line_style 3
- origin_attachment (1274, 1781)
- terminal_attachment (1274, 1640)
- drawSupplier @5)
- (object ClassView "Class" "Logical View::dtd::DTDContent" @37
- ShowCompartmentStereotypes TRUE
- location (1472, 800)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @37
- location (1344, 750)
- fill_color 13434879
- nlines 1
- max_width 256
- justify 0
- label "DTDContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "39FE2B5E02DE"
- width 274
- height 124
- annotation 8
- autoResize TRUE)
- (object InheritTreeView "" @38
- location (1472, 990)
- line_color 3342489
- fill_color 13434879
- supplier @37
- vertices (list Points
- (1472, 990)
- (1472, 862)))
- (object InheritView "" @39
- stereotype TRUE
- line_color 3342489
- quidu "39FE2B83029B"
- client @3
- supplier @37
- line_style 3
- origin_attachment (719, 1132)
- terminal_attachment (719, 990)
- drawSupplier @38)
- (object InheritView "" @40
- stereotype TRUE
- line_color 3342489
- quidu "39FE2B860304"
- client @7
- supplier @37
- line_style 3
- origin_attachment (1452, 1124)
- terminal_attachment (1452, 990)
- drawSupplier @38)
- (object InheritView "" @41
- stereotype TRUE
- line_color 3342489
- quidu "39FE2B8A0287"
- client @6
- supplier @37
- line_style 3
- origin_attachment (2347, 1154)
- terminal_attachment (2347, 990)
- drawSupplier @38)
- (object ClassView "Class" "Logical View::dtd::DTDFile" @42
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1488, 448)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @42
- location (1281, 369)
- fill_color 13434879
- nlines 1
- max_width 414
- justify 0
- label "DTDFile")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9B08E018F"
- compartment (object Compartment
- Parent_View @42
- location (1281, 428)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- icon_style "Icon"
- fill_color 16777215
- anchor 2
- nlines 2
- max_width 425)
- width 432
- height 182
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$9" @43
- location (354, 1049)
- stereotype TRUE
- line_color 3342489
- quidu "38B68A7302B8"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$10" @44
- Parent_View @43
- location (-109, 207)
- stereotype TRUE
- line_color 3342489
- quidu "38B68A780084"
- client @43
- supplier @28
- vertices (list Points
- (354, 1049)
- (354, 1781)
- (1149, 1781))
- line_style 3
- origin_attachment (354, 1049)
- terminal_attachment (1149, 1781))
- (object RoleView "entityReferencedFromAnotherFile" @45
- Parent_View @43
- location (-109, 207)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @46
- Parent_View @45
- location (296, 4537)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 732
- justify 0
- label "+entityReferencedFromAnotherFile"
- pctDist -2.283333
- height 59
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "38B68A78008E"
- client @43
- supplier @42
- vertices (list Points
- (354, 1049)
- (354, 439)
- (1272, 439))
- line_style 3
- origin_attachment (354, 1049)
- terminal_attachment (1272, 439)
- label (object SegLabel @47
- Parent_View @45
- location (1206, 500)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.957129
- height 61
- orientation 1))))
- (object InheritView "" @48
- stereotype TRUE
- line_color 12615680
- quidu "39B7F07F0118"
- client @42
- supplier @20
- line_style 3
- origin_attachment (1488, 357)
- terminal_attachment (1488, 233))
- (object AssociationViewNew "$UNNAMED$15" @49
- location (1472, 638)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2BBE02DC"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$16" @50
- Parent_View @49
- location (0, -162)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2BBF01B1"
- client @49
- supplier @42
- line_style 3
- origin_attachment (1472, 638)
- terminal_attachment (1472, 539))
- (object RoleView "$UNNAMED$17" @51
- Parent_View @49
- location (0, -162)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2BBF01BB"
- client @49
- supplier @37
- line_style 3
- origin_attachment (1472, 638)
- terminal_attachment (1472, 738)
- label (object SegLabel @52
- Parent_View @51
- location (1526, 712)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..n"
- pctDist 0.736248
- height 54
- orientation 0))))
- (object ClassView "Class" "Logical View::dtd::DTDEnumerationType" @53
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- location (2448, 464)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @53
- location (2184, 385)
- fill_color 13434879
- nlines 1
- max_width 528
- justify 0
- label "DTDEnumerationType")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37E146680306"
- compartment (object Compartment
- Parent_View @53
- location (2184, 444)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- icon_style "Icon"
- fill_color 16777215
- anchor 2
- nlines 2
- max_width 546)
- width 546
- height 182
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$18" @54
- location (1939, 449)
- stereotype TRUE
- line_color 3342489
- quidu "39FE30D8033E"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$19" @55
- Parent_View @54
- location (-461, -31)
- stereotype TRUE
- line_color 3342489
- quidu "39FE30D90105"
- client @54
- supplier @42
- line_style 3
- origin_attachment (1939, 449)
- terminal_attachment (1704, 449))
- (object RoleView "$UNNAMED$20" @56
- Parent_View @54
- location (-461, -31)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "39FE30D90137"
- client @54
- supplier @53
- line_style 3
- origin_attachment (1939, 449)
- terminal_attachment (2175, 449)
- label (object SegLabel @57
- Parent_View @56
- location (2120, 486)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..n"
- pctDist 0.767837
- height 37
- orientation 1))))
- (object InheritView "" @58
- stereotype TRUE
- line_color 12615680
- quidu "39B7F0E30234"
- client @27
- supplier @23
- line_style 3
- origin_attachment (1064, 1116)
- terminal_attachment (1064, 1036)
- drawSupplier @24)
- (object InheritView "" @59
- stereotype TRUE
- line_color 3342489
- quidu "39FE2B850118"
- client @27
- supplier @37
- line_style 3
- origin_attachment (941, 1117)
- terminal_attachment (941, 990)
- drawSupplier @38)
- (object InheritView "" @60
- stereotype TRUE
- line_color 3342489
- quidu "37EFD32B032E"
- client @2
- supplier @4
- line_style 3
- origin_attachment (1782, 1805)
- terminal_attachment (1782, 1640)
- drawSupplier @5)))
- (object ClassDiagram "ElementDefinition"
- quid "37E14330032F"
- title "ElementDefinition"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 426
- items (list diagram_item_list
- (object ClassView "Class" "Logical View::dtd::DTDEmptyContent" @61
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (467, 1448)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @61
- location (281, 1403)
- fill_color 13434879
- nlines 1
- max_width 372
- justify 0
- label "DTDEmptyContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AB47037A"
- width 390
- height 114
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDAnyContent" @62
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (886, 1445)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @62
- location (728, 1400)
- fill_color 13434879
- nlines 1
- max_width 316
- justify 0
- label "DTDAnyContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AB500304"
- width 334
- height 114
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDPCDataContent" @63
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1298, 1451)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @63
- location (1099, 1406)
- fill_color 13434879
- nlines 1
- max_width 398
- justify 0
- label "DTDPCDataContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AB5C0135"
- width 416
- height 114
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDRepeatableContent" @64
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1888, 1456)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @64
- location (1572, 1404)
- fill_color 13434879
- nlines 1
- max_width 632
- justify 0
- label "DTDRepeatableContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AD4C01D1"
- width 650
- height 128
- annotation 8
- autoResize TRUE)
- (object InheritTreeView "" @65
- location (1878, 1618)
- line_color 3342489
- fill_color 13434879
- supplier @64
- vertices (list Points
- (1878, 1618)
- (1878, 1520)))
- (object ClassView "Class" "Logical View::ecore::EAttribute" @66
- ShowCompartmentStereotypes TRUE
- location (1936, 400)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @66
- location (1855, 325)
- fill_color 13434879
- nlines 2
- max_width 162
- justify 0
- label "EAttribute")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "39238472039D"
- height 174
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::ecore::EClass" @67
- ShowCompartmentStereotypes TRUE
- location (928, 384)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @67
- location (847, 309)
- fill_color 13434879
- nlines 2
- max_width 162
- justify 0
- label "EClass")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "3903D5BF000A"
- height 174
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDGroupContent" @68
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (2192, 1776)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @68
- location (1931, 1727)
- fill_color 13434879
- nlines 1
- max_width 522
- justify 0
- label "DTDGroupContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37CBEAEF0232"
- width 540
- height 122
- annotation 8
- autoResize TRUE)
- (object InheritView "" @69
- stereotype TRUE
- line_color 3342489
- quidu "37D9AD920363"
- client @68
- supplier @64
- line_style 3
- origin_attachment (2221, 1714)
- terminal_attachment (2221, 1618)
- drawSupplier @65)
- (object ClassView "Class" "Logical View::dtd::DTDEntityReferenceContent" @70
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1488, 1760)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @70
- location (1223, 1715)
- fill_color 13434879
- nlines 1
- max_width 530
- justify 0
- label "DTDEntityReferenceContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "3852900E0127"
- width 548
- height 114
- annotation 8
- autoResize TRUE)
- (object InheritView "" @71
- stereotype TRUE
- line_color 3342489
- quidu "38529044011B"
- client @70
- supplier @64
- line_style 3
- origin_attachment (1474, 1702)
- terminal_attachment (1474, 1618)
- drawSupplier @65)
- (object ClassView "Class" "Logical View::dtd::DTDElementContent" @72
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (912, 1056)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics TRUE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @72
- location (704, 1008)
- fill_color 13434879
- nlines 1
- max_width 416
- justify 0
- label "DTDElementContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37CBEACF0213"
- width 434
- height 120
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$0" @73
- location (2289, 1048)
- stereotype TRUE
- line_color 3342489
- quidu "37CBEB6F005D"
- roleview_list (list RoleViews
- (object RoleView "content" @74
- Parent_View @73
- location (1025, 8)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @75
- Parent_View @74
- location (1223, 1001)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 168
- justify 0
- label "+content"
- pctDist 0.919424
- height 48
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "37CBEB70006D"
- client @73
- supplier @72
- line_style 3
- origin_attachment (2289, 1048)
- terminal_attachment (1129, 1048)
- label (object SegLabel @76
- Parent_View @74
- location (1186, 1083)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 72
- justify 0
- label "1..*"
- pctDist 0.951381
- height 35
- orientation 0)
- label (object SegLabel @77
- Parent_View @74
- location (1246, 941)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 3
- anchor_loc 1
- nlines 1
- max_width 159
- justify 0
- label "{ordered}"
- pctDist 0.900000
- height 108
- orientation 1))
- (object RoleView "group" @78
- Parent_View @73
- location (1025, 8)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @79
- Parent_View @78
- location (2535, 1745)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 144
- justify 0
- label "+group"
- pctDist 0.937744
- height 41
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "37CBEB7000AB"
- client @73
- supplier @68
- vertices (list Points
- (2289, 1048)
- (2587, 1048)
- (2587, 1785)
- (2462, 1785))
- line_style 3
- origin_attachment (2289, 1048)
- terminal_attachment (2462, 1785)
- label (object SegLabel @80
- Parent_View @78
- location (2526, 1827)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.945085
- height 42
- orientation 0))))
- (object InheritTreeView "" @81
- location (910, 1291)
- line_color 3342489
- fill_color 13434879
- supplier @72
- vertices (list Points
- (910, 1291)
- (910, 1116)))
- (object InheritView "" @82
- stereotype TRUE
- line_color 3342489
- quidu "37D9ABE90278"
- client @63
- supplier @72
- line_style 3
- origin_attachment (1297, 1394)
- terminal_attachment (1297, 1291)
- drawSupplier @81)
- (object InheritView "" @83
- stereotype TRUE
- line_color 3342489
- quidu "37D9ABF30327"
- client @61
- supplier @72
- line_style 3
- origin_attachment (466, 1391)
- terminal_attachment (466, 1291)
- drawSupplier @81)
- (object InheritView "" @84
- stereotype TRUE
- line_color 3342489
- quidu "37D9ABEE0207"
- client @62
- supplier @72
- line_style 3
- origin_attachment (881, 1388)
- terminal_attachment (881, 1291)
- drawSupplier @81)
- (object InheritView "" @85
- stereotype TRUE
- line_color 3342489
- quidu "37D9ADB703C0"
- client @64
- supplier @72
- line_style 3
- origin_attachment (1903, 1392)
- terminal_attachment (1903, 1291)
- drawSupplier @81)
- (object ClassView "Class" "Logical View::dtd::DTDElementReferenceContent" @86
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (784, 1760)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @86
- location (492, 1715)
- fill_color 13434879
- nlines 1
- max_width 584
- justify 0
- label "DTDElementReferenceContent")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AB7D0010"
- width 602
- height 114
- annotation 8
- autoResize TRUE)
- (object InheritView "" @87
- stereotype TRUE
- line_color 3342489
- quidu "37D9AD8C03AA"
- client @86
- supplier @64
- line_style 3
- origin_attachment (650, 1703)
- terminal_attachment (650, 1618)
- drawSupplier @65)
- (object ClassView "Class" "Logical View::dtd::DTDEntity" @88
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1488, 2064)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @88
- location (1244, 1992)
- fill_color 13434879
- nlines 1
- max_width 488
- justify 0
- label "DTDEntity")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37EFD12B03C8"
- width 506
- height 168
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$7" @89
- location (1480, 1898)
- stereotype TRUE
- line_color 3342489
- quidu "385294EB0243"
- roleview_list (list RoleViews
- (object RoleView "entityReference" @90
- Parent_View @89
- location (312, -70)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @91
- Parent_View @90
- location (1280, 1842)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 312
- justify 0
- label "+entityReference"
- pctDist 0.693750
- height 201
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "385294EF03BB"
- client @89
- supplier @70
- line_style 3
- origin_attachment (1480, 1898)
- terminal_attachment (1480, 1817)
- label (object SegLabel @92
- Parent_View @90
- location (1534, 1842)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.693750
- height 54
- orientation 1))
- (object RoleView "elementReferencedEntity" @93
- Parent_View @89
- location (312, -70)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @94
- Parent_View @93
- location (1220, 1954)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 480
- justify 0
- label "+elementReferencedEntity"
- pctDist 0.685315
- height 261
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "385294EF03BC"
- client @89
- supplier @88
- line_style 3
- origin_attachment (1480, 1898)
- terminal_attachment (1480, 1980)
- label (object SegLabel @95
- Parent_View @93
- location (1524, 1958)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.734234
- height 44
- orientation 0))))
- (object ClassView "Class" "Logical View::dtd::DTDElement" @96
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (912, 752)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @96
- location (744, 702)
- fill_color 13434879
- nlines 1
- max_width 336
- justify 0
- label "DTDElement")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37D9AAF70071"
- width 354
- height 124
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$1" @97
- location (912, 904)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AC0E00CD"
- roleview_list (list RoleViews
- (object RoleView "element" @98
- Parent_View @97
- location (-25, 96)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @99
- Parent_View @98
- location (1014, 865)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 168
- justify 0
- label "+element"
- pctDist 0.428571
- height 102
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AC0F039F"
- client @97
- supplier @96
- line_style 0
- label (object SegLabel @100
- Parent_View @98
- location (857, 850)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.598214
- height 56
- orientation 0))
- (object RoleView "content" @101
- Parent_View @97
- location (-25, 96)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @102
- Parent_View @101
- location (1014, 964)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 168
- justify 0
- label "+content"
- pctDist 0.664063
- height 102
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AC0F03A9"
- client @97
- supplier @72
- line_style 0
- label (object SegLabel @103
- Parent_View @101
- location (871, 962)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.640625
- height 42
- orientation 1))))
- (object AssociationViewNew "$UNNAMED$2" @104
- location (123, 1122)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AF11001A"
- roleview_list (list RoleViews
- (object RoleView "elementReference" @105
- Parent_View @104
- location (-981, 642)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @106
- Parent_View @105
- location (321, 1825)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 348
- justify 0
- label "+elementReference"
- pctDist 0.840035
- height 56
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AF1B0209"
- client @104
- supplier @86
- vertices (list Points
- (123, 1122)
- (123, 1769)
- (483, 1769))
- line_style 3
- origin_attachment (123, 1122)
- terminal_attachment (483, 1769)
- label (object SegLabel @107
- Parent_View @105
- location (422, 1726)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.940559
- height 44
- orientation 0))
- (object RoleView "referencedElement" @108
- Parent_View @104
- location (-981, 642)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @109
- Parent_View @108
- location (532, 686)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 360
- justify 0
- label "+referencedElement"
- pctDist 0.799650
- height 43
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "37D9AF1B020A"
- client @104
- supplier @96
- vertices (list Points
- (123, 1122)
- (123, 728)
- (735, 728))
- line_style 3
- origin_attachment (123, 1122)
- terminal_attachment (735, 728)
- label (object SegLabel @110
- Parent_View @108
- location (701, 773)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "1"
- pctDist 0.966965
- height 45
- orientation 1))))
- (object InheritView "" @111
- stereotype TRUE
- line_color 12615680
- quidu "39B7F0AF02A8"
- client @96
- supplier @67
- line_style 3
- origin_attachment (923, 690)
- terminal_attachment (923, 470))
- (object ClassView "Class" "Logical View::dtd::DTDAttribute" @112
- ShowCompartmentStereotypes TRUE
- SuppressOperation TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1888, 752)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @112
- location (1612, 657)
- fill_color 13434879
- nlines 1
- max_width 552
- justify 0
- label "DTDAttribute")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37CC187900EA"
- width 570
- height 214
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$8" @113
- location (2775, 1628)
- stereotype TRUE
- line_color 3342489
- quidu "3852972D02CB"
- roleview_list (list RoleViews
- (object RoleView "attributeNameReference" @114
- Parent_View @113
- location (1591, -564)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @115
- Parent_View @114
- location (2422, 808)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 468
- justify 0
- label "+attributeNameReference"
- pctDist 0.829630
- height 39
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "385297360291"
- client @113
- supplier @112
- vertices (list Points
- (2775, 1628)
- (2775, 768)
- (2173, 768))
- line_style 3
- origin_attachment (2775, 1628)
- terminal_attachment (2173, 768)
- label (object SegLabel @116
- Parent_View @114
- location (2222, 871)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.966649
- height 102
- orientation 0))
- (object RoleView "attributeNameReferencedEntity" @117
- Parent_View @113
- location (1591, -564)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @118
- Parent_View @117
- location (2076, 2090)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 588
- justify 0
- label "+attributeNameReferencedEntity"
- pctDist 0.771469
- height 35
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "38529736029B"
- client @113
- supplier @88
- vertices (list Points
- (2775, 1628)
- (2775, 2055)
- (1741, 2055))
- line_style 3
- origin_attachment (2775, 1628)
- terminal_attachment (1741, 2055)
- label (object SegLabel @119
- Parent_View @117
- location (1813, 2018)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.951442
- height 38
- orientation 1))))
- (object AssociationViewNew "$UNNAMED$11" @120
- location (2945, 1891)
- stereotype TRUE
- line_color 3342489
- quidu "38BD4908013D"
- roleview_list (list RoleViews
- (object RoleView "attributeTypeReference" @121
- Parent_View @120
- location (1489, -676)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @122
- Parent_View @121
- location (2435, 656)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 444
- justify 0
- label "+attributeTypeReference"
- pctDist 0.866026
- height 54
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "38BD49140130"
- client @120
- supplier @112
- vertices (list Points
- (2945, 1891)
- (2945, 708)
- (2173, 708))
- line_style 3
- origin_attachment (2945, 1891)
- terminal_attachment (2173, 708)
- label (object SegLabel @123
- Parent_View @121
- location (2345, 603)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.912538
- height 107
- orientation 1))
- (object RoleView "attributeTypeReferencedEntity" @124
- Parent_View @120
- location (1489, -676)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object SegLabel @125
- Parent_View @124
- location (1679, 2299)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 576
- justify 0
- label "+attributeTypeReferencedEntity"
- pctDist 0.828601
- height 56
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "38BD4914014E"
- client @120
- supplier @88
- vertices (list Points
- (2945, 1891)
- (2945, 2243)
- (1438, 2243)
- (1438, 2148))
- line_style 3
- origin_attachment (2945, 1891)
- terminal_attachment (1438, 2148)
- label (object SegLabel @126
- Parent_View @124
- location (1365, 2178)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.984774
- height 74
- orientation 0))))
- (object InheritView "" @127
- stereotype TRUE
- line_color 12615680
- quidu "39B7F15901DA"
- client @112
- supplier @66
- line_style 3
- origin_attachment (1950, 645)
- terminal_attachment (1950, 486))
- (object AssociationViewNew "$UNNAMED$12" @128
- location (1346, 752)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2A9500CC"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$13" @129
- Parent_View @128
- location (-542, -16)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2A950311"
- client @128
- supplier @96
- line_style 3
- origin_attachment (1346, 752)
- terminal_attachment (1089, 752))
- (object RoleView "$UNNAMED$14" @130
- Parent_View @128
- location (-542, -16)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- stereotype TRUE
- line_color 3342489
- quidu "39FE2A95031B"
- client @128
- supplier @112
- line_style 3
- origin_attachment (1346, 752)
- terminal_attachment (1603, 752)
- label (object SegLabel @131
- Parent_View @130
- location (1544, 791)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.773390
- height 39
- orientation 1))))))
- (object ClassDiagram "AttributeDefinition"
- quid "37E144570257"
- title "AttributeDefinition"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object ClassView "Class" "Logical View::dtd::DTDAttribute" @132
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (512, 656)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @132
- location (236, 539)
- fill_color 13434879
- nlines 1
- max_width 552
- justify 0
- label "DTDAttribute")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37CC187900EA"
- width 570
- height 258
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDBasicType" @133
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1264, 656)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @133
- location (1017, 584)
- fill_color 13434879
- nlines 1
- max_width 494
- justify 0
- label "DTDBasicType")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37E1464F00DA"
- width 512
- height 168
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::dtd::DTDEnumerationType" @134
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1904, 656)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @134
- location (1646, 584)
- fill_color 13434879
- nlines 1
- max_width 516
- justify 0
- label "DTDEnumerationType")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "37E146680306"
- width 534
- height 168
- annotation 8
- autoResize TRUE)
- (object NoteView @135
- location (912, 1120)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @135
- location (492, 926)
- nlines 9
- max_width 805
- label
-|A DTD attribute's type and initial
-|value are represented using the eType and default value stored in eAttribute. The eType will always be either DTDBasicType (subclass of eClass) or DTDEnumerationType (subclass of eEnum).
- )
- fill_color 16777215
- width 865
- height 400)
- (object AttachView "" @136
- stereotype TRUE
- client @132
- supplier @135
- line_style 0)
- (object ClassView "Class" "Logical View::ecore::EClass" @137
- ShowCompartmentStereotypes TRUE
- location (1264, 272)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @137
- location (1183, 197)
- fill_color 13434879
- nlines 2
- max_width 162
- justify 0
- label "EClass")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "3903D5BF000A"
- height 174
- annotation 8
- autoResize TRUE)
- (object ClassView "Class" "Logical View::ecore::EEnum" @138
- ShowCompartmentStereotypes TRUE
- location (1904, 272)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @138
- location (1823, 197)
- fill_color 13434879
- nlines 2
- max_width 162
- justify 0
- label "EEnum")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "39A473E901D4"
- height 174
- annotation 8
- autoResize TRUE)
- (object InheritView "" @139
- stereotype TRUE
- line_color 12615680
- quidu "39B7F2800315"
- client @133
- supplier @137
- line_style 3
- origin_attachment (1260, 572)
- terminal_attachment (1260, 359))
- (object InheritView "" @140
- stereotype TRUE
- line_color 12615680
- quidu "39B7F2810302"
- client @134
- supplier @138
- line_style 3
- origin_attachment (1903, 572)
- terminal_attachment (1903, 359))
- (object ClassView "Class" "Logical View::ecore::EAttribute" @141
- ShowCompartmentStereotypes TRUE
- location (528, 272)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @141
- location (447, 197)
- fill_color 13434879
- nlines 2
- max_width 162
- justify 0
- label "EAttribute")
- icon_style "Icon"
- line_color 12615680
- fill_color 16777175
- quidu "39238472039D"
- height 174
- annotation 8
- autoResize TRUE)
- (object InheritView "" @142
- stereotype TRUE
- line_color 12615680
- quidu "39B7F15901DA"
- client @132
- supplier @141
- line_style 3
- origin_attachment (520, 527)
- terminal_attachment (520, 359))))))
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl b/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl
deleted file mode 100644
index ce5627af41..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl
+++ /dev/null
@@ -1,7526 +0,0 @@
-
-(object Petal
- version 45
- _written "Rose 7.5.0103.1920"
- charSet 0)
-
-(object Design "Logical View"
- is_unit TRUE
- is_loaded TRUE
- attributes (list Attribute_Set
- (object Attribute
- tool "Java"
- name "IDE"
- value "Internal Editor"))
- quid "3E36BEB60133"
- defaults (object defaults
- rightMargin 0.250000
- leftMargin 0.250000
- topMargin 0.250000
- bottomMargin 0.500000
- pageOverlap 0.250000
- clipIconLabels TRUE
- autoResize TRUE
- snapToGrid TRUE
- gridX 16
- gridY 16
- defaultFont (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- showMessageNum 1
- showClassOfObject TRUE
- notation "Unified")
- root_usecase_package (object Class_Category "Use Case View"
- quid "3A0C75F401F7"
- exportControl "Public"
- global TRUE
- logical_models (list unit_reference_list)
- logical_presentations (list unit_reference_list
- (object UseCaseDiagram "Main"
- quid "3A0C75F4020B"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- root_category (object Class_Category "Logical View"
- quid "3A0C75F401F6"
- exportControl "Public"
- global TRUE
- subsystem "Component View"
- quidu "3A0C75F401F8"
- logical_models (list unit_reference_list
- (object Class_Category "ecore"
- is_unit TRUE
- is_loaded FALSE
- file_name "$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore\\src\\model\\org.eclipse.emf.ECore.cat"
- quid "39A5ED04004E")
- (object Class_Category "dtd"
- is_unit TRUE
- is_loaded FALSE
- file_name "$VABASE_PLUGINS_PATH\\org.eclipse.wst.dtd\\src\\rose\\DTD.cat"
- quid "3857B1C00293"))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "3A0C75F401FF"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object CategoryView "Logical View::ecore" @1
- location (960, 304)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @1
- location (816, 220)
- fill_color 13434879
- nlines 2
- max_width 288
- justify 0
- label "ecore")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "39A5ED04004E"
- width 300
- height 180)
- (object CategoryView "Logical View::dtd" @2
- location (368, 256)
- font (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- label (object ItemLabel
- Parent_View @2
- location (224, 172)
- fill_color 13434879
- nlines 2
- max_width 288
- justify 0
- label "dtd")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "3857B1C00293"
- width 300
- height 180)))))
- root_subsystem (object SubSystem "Component View"
- quid "3A0C75F401F8"
- physical_models (list unit_reference_list)
- physical_presentations (list unit_reference_list
- (object Module_Diagram "Main"
- quid "3A0C75F4020A"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- process_structure (object Processes
- quid "3A0C75F401F9"
- ProcsNDevs (list
- (object Process_Diagram "Deployment View"
- quid "3A0C75F401FB"
- title "Deployment View"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- properties (object Properties
- attributes (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "DDL"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "DDL"
- name "DataBase"
- value ("DataBaseSet" 800))
- (object Attribute
- tool "DDL"
- name "DataBaseSet"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "ANSI"
- value 800)
- (object Attribute
- tool "DDL"
- name "Oracle"
- value 801)
- (object Attribute
- tool "DDL"
- name "SQLServer"
- value 802)
- (object Attribute
- tool "DDL"
- name "Sybase"
- value 803)
- (object Attribute
- tool "DDL"
- name "Watcom"
- value 804)))
- (object Attribute
- tool "DDL"
- name "PrimaryKeyColumnName"
- value "Id")
- (object Attribute
- tool "DDL"
- name "PrimaryKeyColumnType"
- value "NUMBER(5)")
- (object Attribute
- tool "DDL"
- name "ViewName"
- value "V_")
- (object Attribute
- tool "DDL"
- name "TableName"
- value "T_")
- (object Attribute
- tool "DDL"
- name "InheritSuffix"
- value "_V")
- (object Attribute
- tool "DDL"
- name "DropClause"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "BaseViews"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "DDLScriptFilename"
- value "DDL1.SQL")))
- (object Attribute
- tool "DDL"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "ColumnType"
- value "VARCHAR")
- (object Attribute
- tool "DDL"
- name "Length"
- value "")
- (object Attribute
- tool "DDL"
- name "NullsOK"
- value TRUE)
- (object Attribute
- tool "DDL"
- name "PrimaryKey"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "Unique"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "CompositeUnique"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "CheckConstraint"
- value "")))
- (object Attribute
- tool "DDL"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "IDL"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "GeneratePreserveRegions"
- value TRUE)))
- (object Attribute
- tool "IDL"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "IDL"
- name "ConstValue"
- value "")
- (object Attribute
- tool "IDL"
- name "GenerateDefaultSpecifier"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "DefaultSpecifier"
- value "")
- (object Attribute
- tool "IDL"
- name "IDLElement"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "IDLSpecificationType"
- value ("IDLSpecSet" 22))
- (object Attribute
- tool "IDL"
- name "IDLSpecSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Interface"
- value 22)
- (object Attribute
- tool "IDL"
- name "Typedef"
- value 54)
- (object Attribute
- tool "IDL"
- name "Enumeration"
- value 8)
- (object Attribute
- tool "IDL"
- name "Const"
- value 71)
- (object Attribute
- tool "IDL"
- name "Exception"
- value 61)
- (object Attribute
- tool "IDL"
- name "Struct"
- value 51)
- (object Attribute
- tool "IDL"
- name "Union"
- value 81)))))
- (object Attribute
- tool "IDL"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "IDL"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "GenerateIDLModule"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "IncludeBySimpleName"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "IDL"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "IncludeBySimpleName"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "OperationIsOneWay"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "Context"
- value "")
- (object Attribute
- tool "IDL"
- name "Raises"
- value "")))
- (object Attribute
- tool "IDL"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsConst"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "ConstValue"
- value "")))
- (object Attribute
- tool "IDL"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "BoundedHasRelType"
- value ("HasRelTypeSet" 47))
- (object Attribute
- tool "IDL"
- name "HasRelTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Array"
- value 24)
- (object Attribute
- tool "IDL"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "IDL"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "BoundedRoleType"
- value ("AssocTypeSet" 47))
- (object Attribute
- tool "IDL"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Array"
- value 24)
- (object Attribute
- tool "IDL"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "IDL"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "IDL"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "SCC"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "eCore"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "eCore"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "eCore"
- name "Codegen Name"
- value "")))
- (object Attribute
- tool "eCore"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "eCore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "eCore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "eCore"
- name "isChangeable"
- value TRUE)))
- (object Attribute
- tool "eCore"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "eCore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "eCore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "eCore"
- name "isChangeable"
- value TRUE)))
- (object Attribute
- tool "Cplusplus"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Cplusplus"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "Const"
- value FALSE)
- (object Attribute
- tool "Cplusplus"
- name "InitialValue"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)))
- (object Attribute
- tool "Cplusplus"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "Copyright"
- value (value Text ""))
- (object Attribute
- tool "Cplusplus"
- name "RootPackage"
- value "C++ Reverse Engineered")
- (object Attribute
- tool "Cplusplus"
- name "InitialHeaderIncludes"
- value (value Text ""))
- (object Attribute
- tool "Cplusplus"
- name "InitialBodyIncludes"
- value (value Text ""))))
- (object Attribute
- tool "Cplusplus"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "InitialCodeBody"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "Inline"
- value FALSE)))
- (object Attribute
- tool "Cplusplus"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "Synchronize"
- value TRUE)
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "HeaderSourceFile"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "BodySourceFile"
- value "")))
- (object Attribute
- tool "Cplusplus"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Cplusplus"
- name "CodeName"
- value "")
- (object Attribute
- tool "Cplusplus"
- name "IsNamespace"
- value FALSE)))
- (object Attribute
- tool "Cplusplus"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ANSI C++ Event Watcher"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ANSIConvert"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "propertyId"
- value "838326200")
- (object Attribute
- tool "Ada83"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "SpecFileExtension"
- value "1.ada")
- (object Attribute
- tool "Ada83"
- name "SpecFileBackupExtension"
- value "1.ad~")
- (object Attribute
- tool "Ada83"
- name "SpecFileTemporaryExtension"
- value "1.ad#")
- (object Attribute
- tool "Ada83"
- name "BodyFileExtension"
- value "2.ada")
- (object Attribute
- tool "Ada83"
- name "BodyFileBackupExtension"
- value "2.ad~")
- (object Attribute
- tool "Ada83"
- name "BodyFileTemporaryExtension"
- value "2.ad#")
- (object Attribute
- tool "Ada83"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateBodies"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "DefaultCodeBody"
- value "[statement]")
- (object Attribute
- tool "Ada83"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "Ada83"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "Ada83"
- name "UseFileName"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "Directory"
- value "$ROSEADA83_SOURCE")))
- (object Attribute
- tool "Ada83"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ClassName"
- value "Object")
- (object Attribute
- tool "Ada83"
- name "ClassAccess"
- value ("ImplementationSet" 43))
- (object Attribute
- tool "Ada83"
- name "ImplementationType"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "IsSubtype"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "PolymorphicUnit"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "HandleName"
- value "Handle")
- (object Attribute
- tool "Ada83"
- name "HandleAccess"
- value ("ImplementationSet" 45))
- (object Attribute
- tool "Ada83"
- name "Discriminant"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "EnumerationLiteralPrefix"
- value "A_")
- (object Attribute
- tool "Ada83"
- name "RecordFieldPrefix"
- value "The_")
- (object Attribute
- tool "Ada83"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "ClassParameterName"
- value "This")
- (object Attribute
- tool "Ada83"
- name "DefaultConstructorKind"
- value ("ConstructorKindSet" 199))
- (object Attribute
- tool "Ada83"
- name "DefaultConstructorName"
- value "Create")
- (object Attribute
- tool "Ada83"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "CopyConstructorKind"
- value ("ConstructorKindSet" 199))
- (object Attribute
- tool "Ada83"
- name "CopyConstructorName"
- value "Copy")
- (object Attribute
- tool "Ada83"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "DestructorName"
- value "Free")
- (object Attribute
- tool "Ada83"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ClassEqualityOperation"
- value "")
- (object Attribute
- tool "Ada83"
- name "HandleEqualityOperation"
- value "")
- (object Attribute
- tool "Ada83"
- name "InlineEquality"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "IsTask"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "ImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Public"
- value 45)
- (object Attribute
- tool "Ada83"
- name "Private"
- value 43)
- (object Attribute
- tool "Ada83"
- name "LimitedPrivate"
- value 200)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada83"
- name "ConstructorKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada83"
- name "GenericFormalParameters"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "AdditionalWiths"
- value (value Text ""))))
- (object Attribute
- tool "Ada83"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada83"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada83"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "IsSubunit"
- value FALSE)))
- (object Attribute
- tool "Ada83"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SubprogramImplementation"
- value ("SubprogramImplementationSet" 2))
- (object Attribute
- tool "Ada83"
- name "Renames"
- value "")
- (object Attribute
- tool "Ada83"
- name "ClassParameterMode"
- value ("ParameterModeSet" 203))
- (object Attribute
- tool "Ada83"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "InitialCodeBody"
- value "${default}")
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SubprogramImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Spec"
- value 224)
- (object Attribute
- tool "Ada83"
- name "Body"
- value 2)
- (object Attribute
- tool "Ada83"
- name "Renaming"
- value 222)
- (object Attribute
- tool "Ada83"
- name "Separate"
- value 223)))
- (object Attribute
- tool "Ada83"
- name "ParameterModeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "In"
- value 204)
- (object Attribute
- tool "Ada83"
- name "Out"
- value 205)
- (object Attribute
- tool "Ada83"
- name "InOut"
- value 203)
- (object Attribute
- tool "Ada83"
- name "FunctionReturn"
- value 206)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${supplier}")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${relationship}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${relationship}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${relationship}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada83"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SelectorType"
- value "")))
- (object Attribute
- tool "Ada83"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${attribute}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${attribute}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${attribute}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "Variant"
- value "")
- (object Attribute
- tool "Ada83"
- name "Representation"
- value (value Text ""))))
- (object Attribute
- tool "Ada83"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${association}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${association}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "GenerateAssociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada83"
- name "AssociateName"
- value "Associate")
- (object Attribute
- tool "Ada83"
- name "InlineAssociate"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "GenerateDissociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada83"
- name "DissociateName"
- value "Dissociate")
- (object Attribute
- tool "Ada83"
- name "InlineDissociate"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada83"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada83"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada83"
- name "DataMemberName"
- value "${target}")
- (object Attribute
- tool "Ada83"
- name "GetName"
- value "Get_${target}")
- (object Attribute
- tool "Ada83"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "SetName"
- value "Set_${target}")
- (object Attribute
- tool "Ada83"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada83"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada83"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada83"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada83"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada83"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada83"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada83"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada83"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "Ada83"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "Ada83"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "propertyId"
- value "838326200")
- (object Attribute
- tool "Ada95"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "SpecFileExtension"
- value "1.ada")
- (object Attribute
- tool "Ada95"
- name "SpecFileBackupExtension"
- value "1.ad~")
- (object Attribute
- tool "Ada95"
- name "SpecFileTemporaryExtension"
- value "1.ad#")
- (object Attribute
- tool "Ada95"
- name "BodyFileExtension"
- value "2.ada")
- (object Attribute
- tool "Ada95"
- name "BodyFileBackupExtension"
- value "2.ad~")
- (object Attribute
- tool "Ada95"
- name "BodyFileTemporaryExtension"
- value "2.ad#")
- (object Attribute
- tool "Ada95"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "UseColonNotation"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateBodies"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "DefaultCodeBody"
- value "[statement]")
- (object Attribute
- tool "Ada95"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "Ada95"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "Ada95"
- name "UseFileName"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Directory"
- value "$ROSEADA95_SOURCE")))
- (object Attribute
- tool "Ada95"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "TypeName"
- value "Object")
- (object Attribute
- tool "Ada95"
- name "TypeVisibility"
- value ("TypeVisibilitySet" 43))
- (object Attribute
- tool "Ada95"
- name "TypeImplementation"
- value ("TypeImplementationSet" 208))
- (object Attribute
- tool "Ada95"
- name "TypeControl"
- value ("TypeControlSet" 225))
- (object Attribute
- tool "Ada95"
- name "TypeControlName"
- value "Controlled_${type}")
- (object Attribute
- tool "Ada95"
- name "TypeDefinition"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "RecordImplementation"
- value ("RecordImplementationSet" 209))
- (object Attribute
- tool "Ada95"
- name "RecordKindPackageName"
- value "${class}_Record_Kinds")
- (object Attribute
- tool "Ada95"
- name "IsLimited"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsSubtype"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessType"
- value ("GenerateAccessTypeSet" 230))
- (object Attribute
- tool "Ada95"
- name "AccessTypeName"
- value "Handle")
- (object Attribute
- tool "Ada95"
- name "AccessTypeVisibility"
- value ("TypeVisibilitySet" 45))
- (object Attribute
- tool "Ada95"
- name "AccessTypeDefinition"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "AccessClassWide"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "MaybeAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ParameterizedImplementation"
- value ("ParameterizedImplementationSet" 11))
- (object Attribute
- tool "Ada95"
- name "ParentClassName"
- value "Superclass")
- (object Attribute
- tool "Ada95"
- name "EnumerationLiteralPrefix"
- value "A_")
- (object Attribute
- tool "Ada95"
- name "RecordFieldPrefix"
- value "The_")
- (object Attribute
- tool "Ada95"
- name "ArrayOfTypeName"
- value "Array_Of_${type}")
- (object Attribute
- tool "Ada95"
- name "AccessArrayOfTypeName"
- value "Access_Array_Of_${type}")
- (object Attribute
- tool "Ada95"
- name "ArrayOfAccessTypeName"
- value "Array_Of_${access_type}")
- (object Attribute
- tool "Ada95"
- name "AccessArrayOfAccessTypeName"
- value "Access_Array_Of_${access_type}")
- (object Attribute
- tool "Ada95"
- name "ArrayIndexDefinition"
- value "Positive range <>")
- (object Attribute
- tool "Ada95"
- name "GenerateAccessorOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateStandardOperations"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameter"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterName"
- value "This")
- (object Attribute
- tool "Ada95"
- name "GenerateDefaultConstructor"
- value ("SubprogramKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "DefaultConstructorName"
- value "Create")
- (object Attribute
- tool "Ada95"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateCopyConstructor"
- value ("SubprogramKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "CopyConstructorName"
- value "Copy")
- (object Attribute
- tool "Ada95"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateDestructor"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "DestructorName"
- value "Free")
- (object Attribute
- tool "Ada95"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateTypeEquality"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "TypeEqualityName"
- value "${quote}=${quote}")
- (object Attribute
- tool "Ada95"
- name "InlineEquality"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "TypeImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Tagged"
- value 208)
- (object Attribute
- tool "Ada95"
- name "Record"
- value 210)
- (object Attribute
- tool "Ada95"
- name "Mixin"
- value 211)
- (object Attribute
- tool "Ada95"
- name "Protected"
- value 44)
- (object Attribute
- tool "Ada95"
- name "Task"
- value 212)))
- (object Attribute
- tool "Ada95"
- name "RecordImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "SingleType"
- value 209)
- (object Attribute
- tool "Ada95"
- name "MultipleTypes"
- value 213)))
- (object Attribute
- tool "Ada95"
- name "ParameterizedImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)
- (object Attribute
- tool "Ada95"
- name "Unconstrained"
- value 214)))
- (object Attribute
- tool "Ada95"
- name "TypeVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Public"
- value 45)
- (object Attribute
- tool "Ada95"
- name "Private"
- value 43)))
- (object Attribute
- tool "Ada95"
- name "SubprogramKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "TypeControlSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "None"
- value 225)
- (object Attribute
- tool "Ada95"
- name "InitializationOnly"
- value 226)
- (object Attribute
- tool "Ada95"
- name "AssignmentFinalizationOnly"
- value 227)
- (object Attribute
- tool "Ada95"
- name "All"
- value 228)))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Always"
- value 229)
- (object Attribute
- tool "Ada95"
- name "Auto"
- value 230)))))
- (object Attribute
- tool "Ada95"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada95"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada95"
- name "GenericFormalParameters"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "IsPrivate"
- value FALSE)))
- (object Attribute
- tool "Ada95"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "FileName"
- value "")
- (object Attribute
- tool "Ada95"
- name "ReturnType"
- value "")
- (object Attribute
- tool "Ada95"
- name "AdditionalWiths"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "IsSubunit"
- value FALSE)))
- (object Attribute
- tool "Ada95"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SubprogramImplementation"
- value ("SubprogramImplementationSet" 2))
- (object Attribute
- tool "Ada95"
- name "Renames"
- value "")
- (object Attribute
- tool "Ada95"
- name "GenerateOverriding"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterMode"
- value ("ParameterModeSet" 203))
- (object Attribute
- tool "Ada95"
- name "ImplicitParameterClassWide"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAccessOperation"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "InitialCodeBody"
- value "${default}")
- (object Attribute
- tool "Ada95"
- name "EntryBarrierCondition"
- value "True")
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SubprogramImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Spec"
- value 224)
- (object Attribute
- tool "Ada95"
- name "Body"
- value 2)
- (object Attribute
- tool "Ada95"
- name "Abstract"
- value 221)
- (object Attribute
- tool "Ada95"
- name "Renaming"
- value 222)
- (object Attribute
- tool "Ada95"
- name "RenamingAsBody"
- value 231)
- (object Attribute
- tool "Ada95"
- name "Separate"
- value 223)))
- (object Attribute
- tool "Ada95"
- name "ParameterModeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "In"
- value 204)
- (object Attribute
- tool "Ada95"
- name "Out"
- value 205)
- (object Attribute
- tool "Ada95"
- name "InOut"
- value 203)
- (object Attribute
- tool "Ada95"
- name "Access"
- value 220)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${supplier}")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${relationship}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${relationship}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${relationship}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerImplementation"
- value ("ContainerImplementationSet" 217))
- (object Attribute
- tool "Ada95"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada95"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ContainerImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Array"
- value 217)
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${attribute}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${attribute}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${attribute}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "Representation"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${association}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${association}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateAssociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "AssociateName"
- value "Associate")
- (object Attribute
- tool "Ada95"
- name "InlineAssociate"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "GenerateDissociate"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "DissociateName"
- value "Dissociate")
- (object Attribute
- tool "Ada95"
- name "InlineDissociate"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "CodeName"
- value "")
- (object Attribute
- tool "Ada95"
- name "NameIfUnlabeled"
- value "The_${targetClass}")
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementation"
- value ("RecordFieldImplementationSet" 216))
- (object Attribute
- tool "Ada95"
- name "RecordFieldName"
- value "${target}")
- (object Attribute
- tool "Ada95"
- name "GenerateGet"
- value ("FunctionKindSet" 199))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessGet"
- value ("FunctionKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "GetName"
- value "Get_${target}")
- (object Attribute
- tool "Ada95"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "GenerateSet"
- value ("ProcedureKindSet" 202))
- (object Attribute
- tool "Ada95"
- name "GenerateAccessSet"
- value ("ProcedureKindSet" 201))
- (object Attribute
- tool "Ada95"
- name "SetName"
- value "Set_${target}")
- (object Attribute
- tool "Ada95"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "Ada95"
- name "IsAliased"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "IsConstant"
- value FALSE)
- (object Attribute
- tool "Ada95"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerImplementation"
- value ("ContainerImplementationSet" 217))
- (object Attribute
- tool "Ada95"
- name "ContainerGeneric"
- value "List")
- (object Attribute
- tool "Ada95"
- name "ContainerType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ContainerDeclarations"
- value (value Text ""))
- (object Attribute
- tool "Ada95"
- name "SelectorName"
- value "")
- (object Attribute
- tool "Ada95"
- name "SelectorType"
- value "")
- (object Attribute
- tool "Ada95"
- name "ProcedureKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Procedure"
- value 202)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))
- (object Attribute
- tool "Ada95"
- name "RecordFieldImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Component"
- value 216)
- (object Attribute
- tool "Ada95"
- name "Discriminant"
- value 218)
- (object Attribute
- tool "Ada95"
- name "AccessDiscriminant"
- value 219)))
- (object Attribute
- tool "Ada95"
- name "ContainerImplementationSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Array"
- value 217)
- (object Attribute
- tool "Ada95"
- name "Generic"
- value 11)))
- (object Attribute
- tool "Ada95"
- name "FunctionKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Function"
- value 199)
- (object Attribute
- tool "Ada95"
- name "DoNotCreate"
- value 201)))))
- (object Attribute
- tool "Ada95"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "Ada95"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "Ada95"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "CORBA"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "CORBA"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "CORBA"
- name "IncludePath"
- value "")
- (object Attribute
- tool "CORBA"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "CORBA"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "CORBA"
- name "WindowsShell"
- value 101)))
- (object Attribute
- tool "CORBA"
- name "PathSeparator"
- value "")))
- (object Attribute
- tool "CORBA"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "ConstValue"
- value "")
- (object Attribute
- tool "CORBA"
- name "ImplementationType"
- value "")))
- (object Attribute
- tool "CORBA"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "CORBA"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")))
- (object Attribute
- tool "CORBA"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "CORBA"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "CORBA"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")))
- (object Attribute
- tool "CORBA"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "Context"
- value "")
- (object Attribute
- tool "CORBA"
- name "OperationIsOneWay"
- value FALSE)))
- (object Attribute
- tool "CORBA"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "CORBA"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "Order"
- value "")))
- (object Attribute
- tool "CORBA"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "ArrayDimensions"
- value "")
- (object Attribute
- tool "CORBA"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "CORBA"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "CORBA"
- name "Order"
- value "")
- (object Attribute
- tool "CORBA"
- name "BoundedRoleType"
- value ("AssocTypeSet" 47))
- (object Attribute
- tool "CORBA"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "Array"
- value 24)
- (object Attribute
- tool "CORBA"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "CORBA"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "CORBA"
- name "GenerateForwardReference"
- value FALSE)))
- (object Attribute
- tool "CORBA"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Data Modeler"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "project"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TableCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ViewCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "DomainCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "SPPackageCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "TriggerCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "IndexCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ConstraintCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "StoreProcedureCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "PrimaryKeyCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ForeignKeyCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "JoinCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "TableSpaceCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "cONTAINERCounter"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "TablePrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ViewPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DomainPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TriggerPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IndexPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ConstraintPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "StoreProcedurePrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "PrimaryKeyPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForeignKeyPrefix"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TableSpacePrefix"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsDatabase"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "TargetDatabase"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Location"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsTableSpace"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "TableSpaceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsDeault"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "BufferPool"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ExtentSize"
- value 1)
- (object Attribute
- tool "Data Modeler"
- name "PrefetchSize"
- value 1)
- (object Attribute
- tool "Data Modeler"
- name "PageSize"
- value 4)
- (object Attribute
- tool "Data Modeler"
- name "ManagedBy"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ContainerList"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "dmSchema"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "dmDomainPackage"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsSchema"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDomainPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsRootSchema"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsRootDomainPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsSchemaPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DatabaseID"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DBMS"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsTable"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsView"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDomain"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsSPPackage"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Synonymns"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TableSpaceID"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "CorrelationName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SelectClause"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsUpdateable"
- value TRUE)
- (object Attribute
- tool "Data Modeler"
- name "CheckOption"
- value "None")
- (object Attribute
- tool "Data Modeler"
- name "IsSnapShot"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDistinct"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "PersistToServer"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsPackage"
- value FALSE)))
- (object Attribute
- tool "Data Modeler"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Ordinal"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "IsIdentity"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "NullsAllowed"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "ColumnType"
- value "Native")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "OID"
- value FALSE)))
- (object Attribute
- tool "Data Modeler"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsRelationship"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "SourceId"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "SourceType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RIMethod"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentUpdateRule"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentUpdateRuleName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentDeleteRule"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ParentDeleteRuleName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ChildInsertRestrict"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ChildInsertRestrictName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ChildMultiplicity"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ChildMultiplicityName"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ConstraintName"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsConstraint"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ConstraintType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsIndex"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsTrigger"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsStoredProcedure"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsCluster"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "TableSpace"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "FillFactor"
- value 0)
- (object Attribute
- tool "Data Modeler"
- name "KeyList"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "CheckPredicate"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DeferalMode"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "InitialCheckTime"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "TriggerType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsInsertEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsUpdateEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "IsDeleteEvent"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "RefOldTable"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefNewTable"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefOldRow"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "RefNewRow"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsRow"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "WhenClause"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Language"
- value "SQL")
- (object Attribute
- tool "Data Modeler"
- name "ProcType"
- value "Procedure")
- (object Attribute
- tool "Data Modeler"
- name "IsDeterministic"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ParameterStyle"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ReturnedNull"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "ExternalName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "default__Parameter"
- value (list Attribute_Set
- (object Attribute
- tool "Data Modeler"
- name "dmItem"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DMName"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "IsInParameter"
- value TRUE)
- (object Attribute
- tool "Data Modeler"
- name "IsOutParameter"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "Ordinal"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Length"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "Scale"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "ForBitData"
- value FALSE)
- (object Attribute
- tool "Data Modeler"
- name "DefaultValueType"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "DefaultValue"
- value "")
- (object Attribute
- tool "Data Modeler"
- name "OperationID"
- value "")))
- (object Attribute
- tool "Data Modeler"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Data Modeler Communicator"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "framework"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Java"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Java"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "RootDir"
- value "")
- (object Attribute
- tool "Java"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Java"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Java"
- name "UsePrefixes"
- value FALSE)
- (object Attribute
- tool "Java"
- name "AutoSync"
- value FALSE)
- (object Attribute
- tool "Java"
- name "NotShowRoseIDDlg"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ShowCodegenDlg"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateRoseID"
- value TRUE)
- (object Attribute
- tool "Java"
- name "GenerateDefaultReturnLine"
- value TRUE)
- (object Attribute
- tool "Java"
- name "JavadocDefaultAuthor"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocDefaultVersion"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocDefaultSince"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagName1"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagApply1"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagText1"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagName2"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagApply2"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagText2"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagName3"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagApply3"
- value "")
- (object Attribute
- tool "Java"
- name "UserDefineTagText3"
- value "")
- (object Attribute
- tool "Java"
- name "JavadocNumAsterisks"
- value 0)
- (object Attribute
- tool "Java"
- name "MaxNumChars"
- value 80)
- (object Attribute
- tool "Java"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "Java"
- name "VM"
- value ("VMType" 200))
- (object Attribute
- tool "Java"
- name "ClassPath"
- value ".;C:\\IBM\\SQLLIB\\java\\db2java.zip;C:\\IBM\\SQLLIB\\java\\db2jcc.jar;C:\\IBM\\SQLLIB\\java\\sqlj.zip;C:\\IBM\\SQLLIB\\bin;C:\\IBM\\SQLLIB\\java\\common.jar")
- (object Attribute
- tool "Java"
- name "ReferenceClasspath"
- value "")
- (object Attribute
- tool "Java"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "Java"
- name "WindowsShell"
- value 101)))
- (object Attribute
- tool "Java"
- name "VMType"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Sun"
- value 200)))
- (object Attribute
- tool "Java"
- name "VAJavaWorkingFolder"
- value "")
- (object Attribute
- tool "Java"
- name "InstanceVariablePrefix"
- value "")
- (object Attribute
- tool "Java"
- name "ClassVariablePrefix"
- value "")
- (object Attribute
- tool "Java"
- name "DefaultAttributeDataType"
- value "int")
- (object Attribute
- tool "Java"
- name "DefaultOperationReturnType"
- value "void")
- (object Attribute
- tool "Java"
- name "NoClassCustomDlg"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GlobalImports"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "OpenBraceClassStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "OpenBraceMethodStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "UseTabs"
- value FALSE)
- (object Attribute
- tool "Java"
- name "UseSpaces"
- value TRUE)
- (object Attribute
- tool "Java"
- name "SpacingItems"
- value 3)
- (object Attribute
- tool "Java"
- name "RoseDefaultCommentStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "AsteriskCommentStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "JavaCommentStyle"
- value TRUE)
- (object Attribute
- tool "Java"
- name "JavadocAuthor"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocSince"
- value FALSE)
- (object Attribute
- tool "Java"
- name "JavadocVersion"
- value FALSE)
- (object Attribute
- tool "Java"
- name "BeanPrefix"
- value "")
- (object Attribute
- tool "Java"
- name "BeanSuffix"
- value "")
- (object Attribute
- tool "Java"
- name "RemotePrefix"
- value "")
- (object Attribute
- tool "Java"
- name "RemoteSuffix"
- value "")
- (object Attribute
- tool "Java"
- name "HomePrefix"
- value "")
- (object Attribute
- tool "Java"
- name "HomeSuffix"
- value "")
- (object Attribute
- tool "Java"
- name "PrimaryKeyPrefix"
- value "")
- (object Attribute
- tool "Java"
- name "PrimaryKeySuffix"
- value "")
- (object Attribute
- tool "Java"
- name "EJBDTDLocation"
- value "")
- (object Attribute
- tool "Java"
- name "ServletDTDLocation"
- value "")
- (object Attribute
- tool "Java"
- name "DefaultEJBVersion"
- value "")
- (object Attribute
- tool "Java"
- name "DefaultServletVersion"
- value "")))
- (object Attribute
- tool "Java"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Static"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateDefaultConstructor"
- value TRUE)
- (object Attribute
- tool "Java"
- name "ConstructorIs"
- value ("Ctor_Set" 62))
- (object Attribute
- tool "Java"
- name "Ctor_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "public"
- value 62)
- (object Attribute
- tool "Java"
- name "protected"
- value 63)
- (object Attribute
- tool "Java"
- name "private"
- value 64)
- (object Attribute
- tool "Java"
- name "package"
- value 65)))
- (object Attribute
- tool "Java"
- name "GenerateFinalizer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateStaticInitializer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateInstanceInitializer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateCode"
- value TRUE)
- (object Attribute
- tool "Java"
- name "DisableAutoSync"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ReadOnly"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "Default_Servlet__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ServletName"
- value "")
- (object Attribute
- tool "Java"
- name "ServletContextRef"
- value FALSE)
- (object Attribute
- tool "Java"
- name "IsSingleThread"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletInitParameter"
- value "")
- (object Attribute
- tool "Java"
- name "ServletInitParameterNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletIsSecure"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletRequestDispatcher"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletRequestDispatcherPath"
- value "")
- (object Attribute
- tool "Java"
- name "DispatcherInclude"
- value FALSE)
- (object Attribute
- tool "Java"
- name "DispatcherForward"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletSecurityRoles"
- value "")
- (object Attribute
- tool "Java"
- name "ServletgetInfo"
- value "")
- (object Attribute
- tool "Java"
- name "ServletXMLFilePath"
- value "")))
- (object Attribute
- tool "Java"
- name "Http_Servlet__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ServletRequestAttribute"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestAttributesNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForRequestAttributes"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestParameter"
- value "")
- (object Attribute
- tool "Java"
- name "ServletRequestParameterNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForRequestParameters"
- value "")
- (object Attribute
- tool "Java"
- name "ServletHeader"
- value "")
- (object Attribute
- tool "Java"
- name "ServletHeaderNames"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForHeaders"
- value "")
- (object Attribute
- tool "Java"
- name "ServletIntHeader"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletDateHeader"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ServletCookie"
- value FALSE)
- (object Attribute
- tool "Java"
- name "MethodForCookie"
- value "")
- (object Attribute
- tool "Java"
- name "ServletContentType"
- value "")
- (object Attribute
- tool "Java"
- name "GenerateHTML"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "Default_EJB__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Generate_XML_DD"
- value TRUE)
- (object Attribute
- tool "Java"
- name "EJBCmpField"
- value "")
- (object Attribute
- tool "Java"
- name "EJBEnvironmentProperties"
- value "")
- (object Attribute
- tool "Java"
- name "EJBCnxFactory"
- value "")
- (object Attribute
- tool "Java"
- name "EJBReferences"
- value "")
- (object Attribute
- tool "Java"
- name "EJBSecurityRoles"
- value "")
- (object Attribute
- tool "Java"
- name "EJBNameInJAR"
- value "")
- (object Attribute
- tool "Java"
- name "EJBSessionType"
- value ("EJBSessionType_Set" 200))
- (object Attribute
- tool "Java"
- name "EJBSessionType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name ""
- value 200)
- (object Attribute
- tool "Java"
- name "Stateless"
- value 201)
- (object Attribute
- tool "Java"
- name "Stateful"
- value 202)))
- (object Attribute
- tool "Java"
- name "EJBTransactionType"
- value ("EJBTransactionType_Set" 211))
- (object Attribute
- tool "Java"
- name "EJBTransactionType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Container"
- value 211)
- (object Attribute
- tool "Java"
- name "Bean"
- value 212)))
- (object Attribute
- tool "Java"
- name "EJBPersistenceType"
- value ("EJBPersistenceType_Set" 220))
- (object Attribute
- tool "Java"
- name "EJBPersistenceType_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name ""
- value 220)
- (object Attribute
- tool "Java"
- name "Bean"
- value 221)
- (object Attribute
- tool "Java"
- name "Container"
- value 222)))
- (object Attribute
- tool "Java"
- name "EJBReentrant"
- value FALSE)
- (object Attribute
- tool "Java"
- name "EJBSessionSync"
- value FALSE)
- (object Attribute
- tool "Java"
- name "EJBVersion"
- value ("EJBVersion_Set" 230))
- (object Attribute
- tool "Java"
- name "EJBVersion_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "2.0"
- value 230)
- (object Attribute
- tool "Java"
- name "1.x"
- value 231)))
- (object Attribute
- tool "Java"
- name "EJBXMLFilePath"
- value "")))
- (object Attribute
- tool "Java"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Abstract"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Static"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Native"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Synchronized"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateFullyQualifiedReturn"
- value FALSE)
- (object Attribute
- tool "Java"
- name "ReplaceExistingCode"
- value TRUE)))
- (object Attribute
- tool "Java"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)
- (object Attribute
- tool "Java"
- name "PropertyType"
- value ("BeanProperty_Set" 71))
- (object Attribute
- tool "Java"
- name "BeanProperty_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Not A Property"
- value 71)
- (object Attribute
- tool "Java"
- name "Simple"
- value 72)
- (object Attribute
- tool "Java"
- name "Bound"
- value 73)
- (object Attribute
- tool "Java"
- name "Constrained"
- value 74)))
- (object Attribute
- tool "Java"
- name "IndividualChangeMgt"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Read/Write"
- value ("Read/Write_Set" 81))
- (object Attribute
- tool "Java"
- name "Read/Write_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Read & Write"
- value 81)
- (object Attribute
- tool "Java"
- name "Read Only"
- value 82)
- (object Attribute
- tool "Java"
- name "Write Only"
- value 83)))
- (object Attribute
- tool "Java"
- name "GenerateFullyQualifiedTypes"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "Java"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)
- (object Attribute
- tool "Java"
- name "PropertyType"
- value ("BeanProperty_Set" 71))
- (object Attribute
- tool "Java"
- name "BeanProperty_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Not A Property"
- value 71)
- (object Attribute
- tool "Java"
- name "Simple"
- value 72)
- (object Attribute
- tool "Java"
- name "Bound"
- value 73)
- (object Attribute
- tool "Java"
- name "Constrained"
- value 74)))
- (object Attribute
- tool "Java"
- name "IndividualChangeMgt"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Read/Write"
- value ("Read/Write_Set" 81))
- (object Attribute
- tool "Java"
- name "Read/Write_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Read & Write"
- value 81)
- (object Attribute
- tool "Java"
- name "Read Only"
- value 82)
- (object Attribute
- tool "Java"
- name "Write Only"
- value 83)))
- (object Attribute
- tool "Java"
- name "GenerateFullyQualifiedTypes"
- value FALSE)
- (object Attribute
- tool "Java"
- name "IsNavigable"
- value TRUE)))
- (object Attribute
- tool "Java"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "propertyId"
- value "360000002")
- (object Attribute
- tool "Oracle8"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "DDLScriptFilename"
- value "DDL1.SQL")
- (object Attribute
- tool "Oracle8"
- name "DropClause"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnName"
- value "_ID")
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnType"
- value "NUMBER(5,0)")
- (object Attribute
- tool "Oracle8"
- name "SchemaNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "SchemaNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNameSuffix"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "IsSchema"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "WhereClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeLength"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypePrecision"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeScale"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionOfREFS"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MethodKind"
- value ("MethodKindSet" 1903))
- (object Attribute
- tool "Oracle8"
- name "OverloadID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsReadNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsReadNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsSelfish"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "TriggerType"
- value ("TriggerTypeSet" 1801))
- (object Attribute
- tool "Oracle8"
- name "TriggerEvent"
- value ("TriggerEventSet" 1601))
- (object Attribute
- tool "Oracle8"
- name "TriggerText"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerReferencingNames"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerForEach"
- value ("TriggerForEachSet" 1701))
- (object Attribute
- tool "Oracle8"
- name "TriggerWhenClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "MethodKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MapMethod"
- value 1901)
- (object Attribute
- tool "Oracle8"
- name "OrderMethod"
- value 1902)
- (object Attribute
- tool "Oracle8"
- name "Function"
- value 1903)
- (object Attribute
- tool "Oracle8"
- name "Procedure"
- value 1904)
- (object Attribute
- tool "Oracle8"
- name "Operator"
- value 1905)
- (object Attribute
- tool "Oracle8"
- name "Constructor"
- value 1906)
- (object Attribute
- tool "Oracle8"
- name "Destructor"
- value 1907)
- (object Attribute
- tool "Oracle8"
- name "Trigger"
- value 1908)
- (object Attribute
- tool "Oracle8"
- name "Calculated"
- value 1909)))
- (object Attribute
- tool "Oracle8"
- name "TriggerTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "AFTER"
- value 1801)
- (object Attribute
- tool "Oracle8"
- name "BEFORE"
- value 1802)
- (object Attribute
- tool "Oracle8"
- name "INSTEAD OF"
- value 1803)))
- (object Attribute
- tool "Oracle8"
- name "TriggerForEachSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "ROW"
- value 1701)
- (object Attribute
- tool "Oracle8"
- name "STATEMENT"
- value 1702)))
- (object Attribute
- tool "Oracle8"
- name "TriggerEventSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "INSERT"
- value 1601)
- (object Attribute
- tool "Oracle8"
- name "UPDATE"
- value 1602)
- (object Attribute
- tool "Oracle8"
- name "DELETE"
- value 1603)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE"
- value 1604)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR DELETE"
- value 1605)
- (object Attribute
- tool "Oracle8"
- name "UPDATE OR DELETE"
- value 1606)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE OR DELETE"
- value 1607)))))
- (object Attribute
- tool "Oracle8"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "NullsAllowed"
- value TRUE)
- (object Attribute
- tool "Oracle8"
- name "Length"
- value "")
- (object Attribute
- tool "Oracle8"
- name "Precision"
- value "2")
- (object Attribute
- tool "Oracle8"
- name "Scale"
- value "6")
- (object Attribute
- tool "Oracle8"
- name "IsIndex"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsPrimaryKey"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CompositeUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "ComponentTest"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "cg"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "cg"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "UseMSVC"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "compiler2.1__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value FALSE)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue(sizeof($targetClass),$limit)")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue(sizeof($targetClass),$limit)")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference($limit)")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference($limit)")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue(sizeof($targetClass))")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference(sizeof($qualtype), sizeof($qualcont))")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "compiler3.0__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerAnnotations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowGenerateOverNewerVersion"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value TRUE)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "AlwaysKeepOrphanedCode"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "cg"
- name "ClassKey"
- value "class")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "PutBodiesInSpec"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDefaultConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "DefaultConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateCopyConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "CopyConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDestructor"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DestructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DestructorKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateAssignmentOperation"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "AssignmentVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "AssignmentKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineAssignmentOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateEqualityOperations"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "EqualityVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "EqualityKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineEqualityOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "RelationalVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "RelationalKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StorageMgmtVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "SubscriptVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "SubscriptKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "SubscriptResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DereferenceVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DereferenceKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "DereferenceResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IndirectionVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "IndirectionKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "IndirectionResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StreamVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ThreeKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)))
- (object Attribute
- tool "cg"
- name "KindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)))
- (object Attribute
- tool "cg"
- name "FriendKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GenerateSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "DeclareAndDefine"
- value 199)
- (object Attribute
- tool "cg"
- name "DeclareOnly"
- value 205)
- (object Attribute
- tool "cg"
- name "DoNotDeclare"
- value 206)))
- (object Attribute
- tool "cg"
- name "VisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)))))
- (object Attribute
- tool "cg"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value TRUE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "OperationKind"
- value ("OperationKindSet" 200))
- (object Attribute
- tool "cg"
- name "OperationKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GenerateAbstractBody"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateFriendBody"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateFriendDecl"
- value FALSE)
- (object Attribute
- tool "cg"
- name "SpecialDeclReturnType"
- value "")
- (object Attribute
- tool "cg"
- name "OperationIsConst"
- value FALSE)
- (object Attribute
- tool "cg"
- name "OperationIsExplicit"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "cg"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "CCRegion"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "BodyAnnotations"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "Ordered"
- value TRUE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$relationship")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$relationship")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorName"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorType"
- value "")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HasRelTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")))
- (object Attribute
- tool "cg"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InstanceArguments"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "ContainerGet"
- value "$data.get($keys)")
- (object Attribute
- tool "cg"
- name "ContainerSet"
- value "$data.set($keys,$value)")
- (object Attribute
- tool "cg"
- name "QualifiedContainer"
- value "")
- (object Attribute
- tool "cg"
- name "AssocClassContainer"
- value "$supplier *")
- (object Attribute
- tool "cg"
- name "AssocClassInitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReference"
- value ("QualifiedGetSetByReferenceSet" 2))
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReferenceSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_GetSetByReference"
- value 2)))
- (object Attribute
- tool "cg"
- name "GenerateQualifiedGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "QualifiedGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineQualifiedGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateQualifiedSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "QualifiedSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineQualifiedSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AssocClassGetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GenerateAssocClassGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "AssocClassGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineAssocClassGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "AssocClassSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineAssocClassSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassForwardReferenceOnly"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$attribute")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtAttributeVisibility"
- value 211)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$attribute")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$attribute")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CCRegion"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "BodyReferenceOnly"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "DirectoryIsOnSearchList"
- value FALSE)
- (object Attribute
- tool "cg"
- name "PrecompiledHeader"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "IsNamespace"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Indent"
- value 2)
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))))
- (object Attribute
- tool "MSVC"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "MSVC"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Version"
- value "5.0")))
- (object Attribute
- tool "MSVC"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCClassTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCClassTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Interface_Part"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Connection_Part"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Class_Factory"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionality"
- value ("CObjectFunctionalitySet" 0))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionalitySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Dynamic"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Dyncreate"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Serial"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "GenerateOverrideGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateDataGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DATA_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateFieldGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_FIELD_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMessageGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateMessageMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "OLEFactory"
- value ("OLEFactorySet" 0))
- (object Attribute
- tool "MSVC"
- name "OLEFactorySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Built_in"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Simple"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Licensed"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "OLEName"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLEClassID"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLECtlType"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLECtlType"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLETypeLib"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLETypeLibID"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMajor"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMinor"
- value "")
- (object Attribute
- tool "MSVC"
- name "GeneratePropPageIDs"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLEPropPageIDs"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateDispatchMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockProperties"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockFunctions"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DispatchDefValue"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateDispIdEnum"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISP_ID_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInterfaceMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "INTERFACE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "InitInterface"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateEventMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockEvents"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateEventSinkMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "PropNotifySinks"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ConnectionPointIID"
- value "")
- (object Attribute
- tool "MSVC"
- name "InheritanceType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLECommands"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCDeclares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCImplements"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ATL_Declares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateCOMMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "COM_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionPointMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_POINT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMsgMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GeneratePropertyMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "PROPERTY_MAP_Entries"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCOperationTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCOperationTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Virtual_Override"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Message_Handler"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dispatch_Handler"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Event_Firing_Function"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Event_Sink_Handler"
- value 5)
- (object Attribute
- tool "MSVC"
- name "Std_OLE_Method"
- value 6)
- (object Attribute
- tool "MSVC"
- name "Command_Parser"
- value 7)
- (object Attribute
- tool "MSVC"
- name "Property_Get_Function"
- value 8)
- (object Attribute
- tool "MSVC"
- name "Property_Set_Function"
- value 9)
- (object Attribute
- tool "MSVC"
- name "Property_Notify_Function"
- value 10)
- (object Attribute
- tool "MSVC"
- name "Macro_Generated_Function"
- value 11)))
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "BodyImage"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "MSVC"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Rose Model Integrator"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Rose Web Publisher"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "TopLink"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "COM"
- name "propertyId"
- value "783606378")
- (object Attribute
- tool "COM"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "TypeKinds"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "enum"
- value 100)
- (object Attribute
- tool "COM"
- name "record"
- value 101)
- (object Attribute
- tool "COM"
- name "module"
- value 102)
- (object Attribute
- tool "COM"
- name "interface"
- value 103)
- (object Attribute
- tool "COM"
- name "dispinterface"
- value 104)
- (object Attribute
- tool "COM"
- name "coclass"
- value 105)
- (object Attribute
- tool "COM"
- name "alias"
- value 106)
- (object Attribute
- tool "COM"
- name "union"
- value 107)
- (object Attribute
- tool "COM"
- name "max"
- value 108)
- (object Attribute
- tool "COM"
- name "(none)"
- value 109)))
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "kind"
- value ("TypeKinds" 109))
- (object Attribute
- tool "COM"
- name "uuid"
- value "")
- (object Attribute
- tool "COM"
- name "version"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "helpcontext"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")
- (object Attribute
- tool "COM"
- name "dllname"
- value "")
- (object Attribute
- tool "COM"
- name "alias"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "id"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "id"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "COM"
- name "filename"
- value "")
- (object Attribute
- tool "COM"
- name "library"
- value "")
- (object Attribute
- tool "COM"
- name "uuid"
- value "")
- (object Attribute
- tool "COM"
- name "version"
- value "")
- (object Attribute
- tool "COM"
- name "helpstring"
- value "")
- (object Attribute
- tool "COM"
- name "helpfile"
- value "")
- (object Attribute
- tool "COM"
- name "helpcontext"
- value "")
- (object Attribute
- tool "COM"
- name "lcid"
- value "")
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "COM"
- name "attributes"
- value "")))
- (object Attribute
- tool "COM"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Version Control"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "propertyId"
- value "783606378")
- (object Attribute
- tool "Visual Basic"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "UpdateModel"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "InstancingSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "Private"
- value 221)
- (object Attribute
- tool "Visual Basic"
- name "PublicNotCreatable"
- value 213)
- (object Attribute
- tool "Visual Basic"
- name "SingleUse"
- value 214)
- (object Attribute
- tool "Visual Basic"
- name "GlobalSingleUse"
- value 215)
- (object Attribute
- tool "Visual Basic"
- name "MultiUse"
- value 219)
- (object Attribute
- tool "Visual Basic"
- name "GlobalMultiUse"
- value 220)))
- (object Attribute
- tool "Visual Basic"
- name "BaseSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "(none)"
- value 222)
- (object Attribute
- tool "Visual Basic"
- name "0"
- value 223)
- (object Attribute
- tool "Visual Basic"
- name "1"
- value 224)))
- (object Attribute
- tool "Visual Basic"
- name "OptionBase"
- value ("BaseSet" 222))
- (object Attribute
- tool "Visual Basic"
- name "OptionExplicit"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "OptionCompare"
- value ("CompareSet" 202))
- (object Attribute
- tool "Visual Basic"
- name "Instancing"
- value ("InstancingSet" 219))
- (object Attribute
- tool "Visual Basic"
- name "CompareSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "(none)"
- value 202)
- (object Attribute
- tool "Visual Basic"
- name "Binary"
- value 203)
- (object Attribute
- tool "Visual Basic"
- name "Text"
- value 204)))))
- (object Attribute
- tool "Visual Basic"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "LibraryName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "AliasName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "IsStatic"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "ReplaceExistingBody"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "DefaultBody"
- value (value Text ""))))
- (object Attribute
- tool "Visual Basic"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "PropertyName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")))
- (object Attribute
- tool "Visual Basic"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "FullName"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ProcedureID"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "PropertyName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")))
- (object Attribute
- tool "Visual Basic"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ImplementsDelegation"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "FullName"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Param"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ByVal"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ByRef"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "Optional"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "ParamArray"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ProjectFile"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "UpdateCode"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "UpdateModel"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "ImportReferences"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "QuickImport"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "ImportBinary"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "VisualStudio"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Web Modeler"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "XML_DTD"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "XML_DTD"
- name "Editor"
- value ("EditorType" 100))
- (object Attribute
- tool "XML_DTD"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "XML_DTD"
- name "EditorType"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "BuiltIn"
- value 100)
- (object Attribute
- tool "XML_DTD"
- name "WindowsShell"
- value 101)))))
- (object Attribute
- tool "XML_DTD"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "Entity_SystemID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "Entity_PublicID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "NotationValue"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "InternalValue"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "ParameterEntity"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "ExternalEntity"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "Notation_SystemID"
- value "")
- (object Attribute
- tool "XML_DTD"
- name "Notation_PublicID"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "DefaultDeclType"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "XML_DTD"
- name "Assign All"
- value FALSE)
- (object Attribute
- tool "XML_DTD"
- name "ComponentPath"
- value "")))
- (object Attribute
- tool "XML_DTD"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "packageName"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsPrefix"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsURI"
- value "")
- (object Attribute
- tool "Ecore"
- name "basePackage"
- value "")
- (object Attribute
- tool "Ecore"
- name "prefix"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "classifierName"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "operationName"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "attributeName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isUnique"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isID"
- value FALSE)))
- (object Attribute
- tool "Ecore"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "referenceName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isResolveProxies"
- value TRUE))))
- quid "3A0C75F401FA"))
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
deleted file mode 100644
index 64ee536107..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
deleted file mode 100644
index 7017d91b91..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
deleted file mode 100644
index 795eb5e9f4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
deleted file mode 100644
index 28c2ccb1e7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
deleted file mode 100644
index bc8e66c20f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
deleted file mode 100644
index 6a91888855..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index d30b26b97a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
deleted file mode 100644
index 801c13388d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
deleted file mode 100644
index 2fb2ca7a92..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
deleted file mode 100644
index 59096688cc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
deleted file mode 100644
index 6fd82e60e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
deleted file mode 100644
index f849c75d58..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
deleted file mode 100644
index c9f09459e6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
deleted file mode 100644
index 5f54702ffc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
deleted file mode 100644
index ce9df985b8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
deleted file mode 100644
index 694c26f273..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
deleted file mode 100644
index d13ba2e5b0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
deleted file mode 100644
index 8b2b357f48..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
deleted file mode 100644
index 96398c0ce1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
deleted file mode 100644
index 041db277d1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
deleted file mode 100644
index 5f9658e5b3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
deleted file mode 100644
index e7422d7738..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
deleted file mode 100644
index fb4f9bd29e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
deleted file mode 100644
index f8d5289f11..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
deleted file mode 100644
index 358997d294..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
deleted file mode 100644
index daf514dccd..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
deleted file mode 100644
index a1ac131e67..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
deleted file mode 100644
index 8ed4cb7374..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.properties b/bundles/org.eclipse.wst.dtd.core/plugin.properties
deleted file mode 100644
index 2c8c78b0ed..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source DTD Core
-#
-Structured_DTD_Document_Factory_Extension.name=Structured DTD Document Factory Extension
-DTD_Content_Type_Extension_Element.name=DTD
-_DTD_VALIDATOR_NAME = DTD Validator
-_validationMarker.name=DTD Problem
-_taskMarker.name=DTD Task
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.xml b/bundles/org.eclipse.wst.dtd.core/plugin.xml
deleted file mode 100644
index 812c1462f0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- class="org.eclipse.wst.dtd.core.internal.modelhandler.ModelHandlerForDTD"
- associatedContentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- id="org.eclipse.wst.dtd.core.internal.modelhandler">
- </modelHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.taskscanner">
- <scanner
- id="org.eclipse.wst.dtd.core.internal.tasks.DTDFileTaskScanner"
- class="org.eclipse.wst.dtd.core.internal.tasks.DTDFileTaskScanner:org.eclipse.wst.dtd.core.taskMarker"
- contentTypeIds="org.eclipse.wst.dtd.core.dtdsource" />
- </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
- id="validationMarker"
- name="%_validationMarker.name"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <persistent value="true"/>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.dtd.core.documentfactories"
- name="%Structured_DTD_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
-
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="dtd" />
- <fileTypes
- type="text"
- extension="mod" />
- <fileTypes
- type="text"
- extension="ent" />
- </extension>
-
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- file-extensions="dtd,mod,ent"
- priority="normal"
- name="%DTD_Content_Type_Extension_Element.name"
- id="org.eclipse.wst.dtd.core.dtdsource"
- base-type="org.eclipse.core.runtime.text"
- default-charset="UTF-8">
- <describer
- class="org.eclipse.wst.dtd.core.internal.content.ContentDescriberForDTD" />
- </content-type>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="dtd"
- class="org.eclipse.wst.dtd.core.internal.emf.util.DTDResourceFactoryImpl">
- </parser>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="ent"
- class="org.eclipse.wst.dtd.core.internal.emf.util.DTDResourceFactoryImpl">
- </parser>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="DTD.xmi"
- class="org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl">
- </package>
- </extension>
-
- <extension point="org.eclipse.wst.xml.core.documentFactories">
- <factory
- type="dtd, ent, mod, xml"
- class="org.eclipse.wst.dtd.core.internal.contentmodel.CMDocumentFactoryDTD">
- </factory>
- </extension>
-
- <!-- initialize dtd core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceInitializer" />
- </extension>
-
- <!-- ====================================================== -->
- <!-- Register the DTD validator with the (new) validation -->
- <!-- framework. -->
- <!-- ====================================================== -->
- <extension id="dtdDTDValidator" name="%_DTD_VALIDATOR_NAME" point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
- manual="true"
- sourceid="org.eclipse.wst.dtd.dtdsourcevalidator"
- version="1"
- markerId="org.eclipse.wst.dtd.core.validationMarker">
- <include>
- <rules>
- <contentType id="org.eclipse.wst.dtd.core.dtdsource"/>
- <fileext caseSensitive="false" ext="dtd"/>
- <fileext caseSensitive="false" ext="ent"/>
- <fileext caseSensitive="false" ext="mod"/>
- </rules>
- </include>
- </validator>
- </extension>
-
- <!-- ====================================================== -->
- <!-- DTD as you type validation -->
- <!-- ====================================================== -->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
- id="org.eclipse.wst.dtd.dtdsourcevalidator">
- <contentTypeIdentifier
- id="org.eclipse.wst.dtd.core.dtdsource">
- <partitionType id="org.eclipse.wst.dtd.DEFAULT">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java
deleted file mode 100644
index 2b75366c27..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java
+++ /dev/null
@@ -1,95 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public final class AttNode {
- //
- // attType
- //
- public static final int CDATA = 0, ID = 1, IDREF = 2, IDREFS = 3, ENTITY = 4, ENTITIES = 5, NMTOKEN = 6, NMTOKENS = 7, NOTATION = 8, ENUMERATION = 9, PEREFERENCE = 10;
-
- //
- // Keep this array in-sync with the ATTTYPE definitions
- //
- private static final String[] fgAttTypeString = {"CDATA", // 0 //$NON-NLS-1$
- "ID", // 1 //$NON-NLS-1$
- "IDREF", // 2 //$NON-NLS-1$
- "IDREFS", // 3 //$NON-NLS-1$
- "ENTITY", // 4 //$NON-NLS-1$
- "ENTITIES", // 5 //$NON-NLS-1$
- "NMTOKEN", // 6 //$NON-NLS-1$
- "NMTOKENS", // 7 //$NON-NLS-1$
- "NOTATION", // 8 //$NON-NLS-1$
- "ENUMERATION", // 9 (replaced with "NMTOKEN" by SAX //$NON-NLS-1$
- // AttributeList handler)
- "%ENTITYREFERENCE;"}; //$NON-NLS-1$
-
- //
- // attDefaultType
- //
- public static final int NOFIXED = 1, // AttValue
- REQUIRED = 2, // #REQUIRED
- IMPLIED = 3, // #IMPLIED
- FIXED = 4; // #FIXED AttValue
-
- public String name = null;
- public String type = null;
- public String defaultType = null;
- public String defaultValue = null;
- public Vector enumList = null; // list of Notations or Enum values
-
- public int getDeclaredType() {
- int t = -1;
- if (type == null)
- return t;
-
- if (type.startsWith("%") && type.endsWith(";")) //$NON-NLS-1$ //$NON-NLS-2$
- return PEREFERENCE;
-
- for (int i = 0; i < fgAttTypeString.length; i++) {
- if (type.equals(fgAttTypeString[i])) {
- t = i;
- break;
- }
- }
- return t;
- }
-
- public Enumeration elements() {
- if (enumList == null)
- enumList = new Vector();
- return enumList.elements();
- }
-
- public int getDefaultType() {
- if (defaultType == null)
- return -1;
-
- if (defaultType.startsWith("%") && defaultType.endsWith(";")) //$NON-NLS-1$ //$NON-NLS-2$
- return PEREFERENCE;
- else if (defaultType.equals("#REQUIRED")) //$NON-NLS-1$
- return REQUIRED;
- else if (defaultType.equals("#IMPLIED")) //$NON-NLS-1$
- return IMPLIED;
- else if (defaultType.equals("#FIXED")) //$NON-NLS-1$
- return FIXED;
- else
- return NOFIXED;
- }
-
- public String toString() {
- return "Att Name: " + name + " Type: " + type + " defaultType: " + defaultType + " defaultValue: " + defaultValue; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java
deleted file mode 100644
index fb77a18b78..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java
+++ /dev/null
@@ -1,146 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class Attlist extends BaseNode {
- Vector attDefs = new Vector();
-
- /**
- * Constructor.
- *
- * @param name
- * This attribute list's name; this value is also known as the
- * Element type.
- */
- public Attlist(String name, String ownerDTD) {
- this(name, ownerDTD, null, null);
- }
-
- public Attlist(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
- super(name, ownerDTD, comment, errorMessage);
- }
-
-
- /**
- * Adds the specified attribute definition to the end of this attribute
- * list .
- *
- * @param attDef
- * Attribute definition to add to this atribute list.
- * @return =true if the attribute definition does not already exist in
- * this attribute list; otherwise, =false.
- * @see #elementAt
- * @see #getAttDef
- * @see #contains
- * @see #size
- */
- public boolean addElement(AttNode attDef) {
- if (contains(attDef.name))
- return false;
- this.attDefs.addElement(attDef);
- return true;
- }
-
- /**
- * Returns the attribute definition at the specified <var>index</var> in
- * this attribute list
- *
- * @param index
- * Index into this list of attribute definitions.
- * @return Attribute definition at the specified index, or <var>null</var>
- * if an invalid index.
- * @see #addElement
- * @see #getAttDef
- * @see #contains
- * @see #size
- */
- public AttNode elementAt(int index) {
- return (AttNode) this.attDefs.elementAt(index);
- }
-
- /**
- * Returns the attribute definition that matches the specified attribute
- * definition name in this attribute list.
- *
- * @param attDefName
- * Attribute definition name to match in this attribute list.
- * @return The matching attribute definition, or <var>null</var> if the
- * attribute is not currently defined.
- * @see #addElement
- * @see #elementAt
- * @see #contains
- * @see #size
- * @see #elements
- */
- public AttNode getAttDef(String attDefName) {
- for (int i = 0; i < size(); i++) {
- AttNode ad = elementAt(i);
- if (attDefName.equals(ad.name))
- return ad;
- }
- return null;
- }
-
- /**
- * Returns whether the specified attribute definition name is currently
- * defined in this attribute list.
- *
- * @param attDefName
- * Attribute definition name to match in this attribute list.
- * @return =true if <var>attDefName</var> is defined; otherwise, =false.
- * @see #addElement
- * @see #elementAt
- * @see #getAttDef
- * @see #size
- * @see #elements
- */
- public boolean contains(String attDefName) {
- return null != getAttDef(attDefName);
- }
-
- /**
- * Returns the number of attribute definitions in this attribute list.
- *
- * @return Number of attribute list definitions, or <var>null</var> if no
- * definitions defined.
- * @see #addElement
- * @see #elementAt
- * @see #getAttDef
- * @see #contains
- */
- public int size() {
- return this.attDefs.size();
- }
-
- /**
- * Returns an enumeration of all attribute definitions in this attribute
- * list.
- *
- * @return An enumeration of all attribute definitions, or <var>null</var>
- * if none specified.
- * @see #addElement
- * @see #elementAt
- * @see #getAttDef
- * @see #contains
- * @see #size
- */
- public Enumeration elements() {
- return this.attDefs.elements();
- }
-
- void setAttDefs(Vector attrs) {
- attDefs = attrs;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java
deleted file mode 100644
index 39b39bc528..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java
+++ /dev/null
@@ -1,66 +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.dtd.core.internal.saxparser;
-
-
-public abstract class BaseNode {
- protected String name = null;
- protected ErrorMessage errorMessage = null;
- // protected String errorMessage = null;
- protected String comment = null;
- protected String ownerDTD = null;
-
- /** Default constructor. */
- public BaseNode(String name, String ownerDTD) {
- this(name, ownerDTD, null, null);
- }
-
- public BaseNode(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
- this.name = name;
- this.ownerDTD = ownerDTD;
- this.comment = comment;
- this.errorMessage = errorMessage;
- }
-
- public String getNodeName() {
- return name;
- }
-
- public void setNodeName(String name) {
- this.name = name;
- }
-
- public String getOwnerDTD() {
- return ownerDTD;
- }
-
- public void setOwnerDTD(String owner) {
- ownerDTD = owner;
- }
-
- public String getComment() {
- return comment;
- }
-
- public void setComment(String comment) {
- this.comment = comment;
- }
-
- public ErrorMessage getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(ErrorMessage message) {
- errorMessage = message;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java
deleted file mode 100644
index 15c0fc13d0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java
+++ /dev/null
@@ -1,42 +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.dtd.core.internal.saxparser;
-
-public class CMBasicNode extends CMNode {
- private int type = CMNodeType.EMPTY; // possible types :
-
- // CMNodeType.EMPTY
- // CMNodeType.ANY
- // CMNodeType.PCDATA
-
- /** Default constructor. */
- public CMBasicNode(String refName) {
- super(refName);
- }
-
- public CMBasicNode(String refName, int type) {
- super(refName);
- this.type = type;
- }
-
- public int getType() {
- return type;
- }
-
- public void setType(int type) {
- this.type = type;
- }
-
- public String toString() {
- return " BasicNodeName: " + getName() + " Type: " + getType() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java
deleted file mode 100644
index 7be202bb43..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java
+++ /dev/null
@@ -1,62 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class CMGroupNode extends CMRepeatableNode {
- private int type = CMNodeType.GROUP;
- private int groupKind = CMNodeType.GROUP_SEQUENCE;
- private Vector children = new Vector();
-
- public CMGroupNode() {
- super("GROUP"); //$NON-NLS-1$
- }
-
- public int getType() {
- return type;
- }
-
- // implement super class
- public void setType(int type) {
- // can't change - only one type allows
- }
-
- public int getGroupKind() {
- return groupKind;
- }
-
- public void setGroupKind(int kind) {
- groupKind = kind;
- }
-
- public Vector getChildren() {
- return children;
- }
-
- public void addChild(CMNode child) {
- children.addElement(child);
- }
-
- public String toString() {
- String result = "Group ( - kind: " + getGroupKind() + " OccType: " + getOccurrence() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- Enumeration en = children.elements();
- while (en.hasMoreElements()) {
- result += " " + en.nextElement(); //$NON-NLS-1$
- }
-
- result += "Group )"; //$NON-NLS-1$
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java
deleted file mode 100644
index 831bca5cdb..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java
+++ /dev/null
@@ -1,30 +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.dtd.core.internal.saxparser;
-
-public abstract class CMNode {
- private String refName;
-
- /** Default constructor. */
- public CMNode(String refName) {
- this.refName = refName;
- }
-
- public String getName() {
- return refName;
- }
-
- public abstract int getType();
-
- public abstract void setType(int type);
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java
deleted file mode 100644
index 12a8d8608b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java
+++ /dev/null
@@ -1,30 +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.dtd.core.internal.saxparser;
-
-public interface CMNodeType {
- static public int EMPTY = 1;
- static public int ANY = 2;
- static public int PCDATA = 3;
- static public int ELEMENT_REFERENCE = 4;
- static public int ENTITY_REFERENCE = 5;
- static public int GROUP = 6;
-
- static public int ONE = 7;
- static public int OPTIONAL = 8;
- static public int ONE_OR_MORE = 9;
- static public int ZERO_OR_MORE = 10;
-
- static public int GROUP_CHOICE = 11;
- static public int GROUP_SEQUENCE = 12;
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java
deleted file mode 100644
index 52788f9bd6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java
+++ /dev/null
@@ -1,38 +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.dtd.core.internal.saxparser;
-
-public class CMReferenceNode extends CMRepeatableNode {
- private int type = CMNodeType.ELEMENT_REFERENCE;
-
- public CMReferenceNode(String refName) {
- this(refName, CMNodeType.ELEMENT_REFERENCE);
- }
-
- public CMReferenceNode(String refName, int type) {
- super(refName);
- this.type = type;
- }
-
-
- public int getType() {
- return type;
- }
-
- public void setType(int type) {
- this.type = type;
- }
-
- public String toString() {
- return " RefName: " + getName() + " Type: " + getType() + " OccType: " + getOccurrence() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java
deleted file mode 100644
index 056d962b63..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java
+++ /dev/null
@@ -1,34 +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.dtd.core.internal.saxparser;
-
-public abstract class CMRepeatableNode extends CMNode {
- private int occType = CMNodeType.ONE;
-
- public CMRepeatableNode(String refName) {
- super(refName);
- }
-
- public CMRepeatableNode(String refName, int occType) {
- super(refName);
- this.occType = occType;
- }
-
- public int getOccurrence() {
- return occType;
- }
-
- public void setOccurrence(int occType) {
- this.occType = occType;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java
deleted file mode 100644
index e1509b3bf4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java
+++ /dev/null
@@ -1,89 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class DTD {
- //
- // Constants
- //
-
- Vector externalElements = new Vector();
- String name = null;
-
- boolean isExceptionDuringParse = false;
-
- //
- // Constructors
- //
-
- /**
- * Constructor.
- */
-
- /**
- * Constructor.
- *
- * @param name
- * The file name of this DTD.
- * @see #getName
- * @see #setName
- */
- public DTD(String name) {
- this.name = name;
- }
-
- /**
- * Returns this DTD's file name.
- *
- * @return This DTD's file name, or <var>null</var> if no name.
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets this DTD's file name.
- *
- * @param name
- * This DTD's name.
- * @see #getName
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Returns an Enumeration instance of all external subset children of this
- * DTD.
- *
- * @return An enumeration of all external subset children of this DTD.
- */
- public Enumeration externalElements() {
- return externalElements.elements();
- }
-
- public void addDecl(BaseNode decl) {
- externalElements.addElement(decl);
- }
-
- public void setIsExceptionDuringParse(boolean on) {
- isExceptionDuringParse = on;
- }
-
- public boolean getIsExceptionDuringParse() {
- return isExceptionDuringParse;
- }
-
-} // class DTD
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java
deleted file mode 100644
index 35bb54f3a7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java
+++ /dev/null
@@ -1,768 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.dtd.core.internal.saxparser;
-
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Stack;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class DTDParser extends DefaultHandler implements ContentHandler, DTDHandler, ErrorHandler, DeclHandler, LexicalHandler {
- private String contentString = ""; //$NON-NLS-1$
- //private String declString = ""; //$NON-NLS-1$
-
- /* Canonical output. */
- protected boolean canonical;
-
- protected XMLReader reader;
- int entityDepth;
-
- // dmw 11/15 private field never read locally
- // private Vector declElements;
- private String comment = null;
- private ErrorMessage errorMessage = null;
- private List errorMessages = new ArrayList();
- private DeclNode previousDeclNode = null;
- private DeclNode currentDeclNode = null;
- private BaseNode lastBaseNode = null;
-
- private boolean entityEnd = false;
- private int lineNumber;
-
- private DTD currentDTD = null;
- private Vector dtdList = new Vector();
-
- private Stack dtdStack = new Stack();
- private Stack peRefStack = new Stack();
- private Stack parsingPERefStack = new Stack();
-
- private EntityPool entityPool = new EntityPool();
- private String expandedEntityValue = null;
- private Hashtable elementPool = new Hashtable();
-
- boolean parsingExternalPEReference = false;
- protected boolean expandEntityReferences = true;
-
- private Locator locator = null;
-
- private Locator getLocator() {
- return locator;
- }
-
- public void setDocumentLocator(Locator locator) {
- this.locator = locator;
- }
-
- public DTDParser(boolean canonical) throws UnsupportedEncodingException {
- this(null, canonical);
- }
-
- protected DTDParser(String encoding, boolean canonical) throws UnsupportedEncodingException {
-
- if (encoding == null)
- encoding = "UTF-8"; //$NON-NLS-1$
-
- this.canonical = canonical;
- try {
- SAXParser sparser = SAXParserFactory.newInstance().newSAXParser();
- reader = sparser.getXMLReader();
- reader.setProperty("http://xml.org/sax/properties/declaration-handler", this); //$NON-NLS-1$
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", this); //$NON-NLS-1$
- reader.setContentHandler(this);
- reader.setDTDHandler(this);
- reader.setErrorHandler(this);
- reader.setEntityResolver(this);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- /* Prints the output from the SAX callbacks. */
- public void parse(String logicalURI) {
- try {
- // CS ensure that the physical URI is considered where streams are required
- // and the logicalURI is used as the DTD's baseLocation
- String physicalURI = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", logicalURI); //$NON-NLS-1$ //$NON-NLS-2$
- boolean isReadable = URIHelper.isReadableURI(physicalURI, true);
- if (!isReadable) {
- throw new Exception("DTD parse error. Can not read the specified URI : " + logicalURI); //$NON-NLS-1$
- }
- String document = "<!DOCTYPE root SYSTEM \"" + logicalURI + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
- entityDepth = 0;
- currentDTD = new DTD(logicalURI);
- InputSource inputSource = new InputSource(new StringReader(document));
- inputSource.setSystemId(logicalURI + ".xml"); //$NON-NLS-1$
- reader.parse(inputSource);
- }
- catch (SAXParseException se) {
- if (currentDTD != null)
- currentDTD.setIsExceptionDuringParse(true);
- }
- catch (Exception e) {
- if (currentDTD != null)
- currentDTD.setIsExceptionDuringParse(true);
- }
-
- }
-
- /*
- * @deprecated Entity references are always expanded.
- */
- public void setExpandEntityReferences(boolean expandEntityReferences) {
- this.expandEntityReferences = true;
- }
-
- /*
- * @deprecated Entity references are always expanded.
- */
- public boolean getExpandEntityReferences() {
- return expandEntityReferences;
- }
-
- public Vector getDTDList() {
- return dtdList;
- }
-
- public Hashtable getElementPool() {
- return elementPool;
- }
-
- public EntityPool getEntityPool() {
- return entityPool;
- }
-
- public List getErrorMessages() {
- return errorMessages;
- }
-
- //
- // DocumentHandler methods
- //
-
- public void startDocument() {
- }
-
- public void endDocument() {
- }
-
- public void processingInstruction(String target, String data) {
- }
-
- //
- // DTDHandler methods
- //
-
- public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException {
- }
-
- public void notationDecl(String name, String publicId, String systemId) throws SAXException {
- startDeclaration(DeclNode.NOTATION);
- //declString = "<!NOTATION"; //$NON-NLS-1$
- if (entityDepth == 1 || parsingExternalPEReference) {
- String xs = " "; //$NON-NLS-1$
- xs += name;
- if (publicId == null)
- xs += " SYSTEM " + "\"" + systemId + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else
- xs += " PUBLIC " + "\"" + publicId + "\" " + "\"" + systemId + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- contentString += xs;
- parseCurrentDeclaration();
- }
- }
-
- //
- // DeclHandler methods
- //
-
- public void elementDecl(String name, String model) throws SAXException {
- startDeclaration(DeclNode.ELEMENT);
- //declString = "<!ELEMENT"; //$NON-NLS-1$
-
- // KB: With early versions of Xerces 2.x, startEntity("[dtd]") used to
- // be called before this method
- // so entityDepth was 1. Using JAXP changed that and startEntity() is
- // not called back anymore.
- // Because of this, we need to handle the case where entityDepth == 0
- // as well.
- if (entityDepth == 0 || entityDepth == 1 || parsingExternalPEReference)
- parseCurrentDeclarationHelper(name + " " + model); //$NON-NLS-1$
- }
-
- protected String attributeString = ""; //$NON-NLS-1$
-
- public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException {
- startDeclaration(DeclNode.ATTLIST);
- //declString = "<!ATTLIST"; //$NON-NLS-1$
-
- attributeString += " " + aName; //$NON-NLS-1$
- if (type != null)
- attributeString += " " + type; //$NON-NLS-1$
- if (valueDefault != null)
- attributeString += " " + valueDefault; //$NON-NLS-1$
- if (value != null)
- attributeString += " '" + value + "'"; //$NON-NLS-1$ //$NON-NLS-2$
-
- attributeString = eName + " " + attributeString + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- parseCurrentDeclarationHelper(attributeString);
- attributeString = ""; //$NON-NLS-1$
- }
-
- public void internalEntityDecl(String name, String value) throws SAXException {
- startDeclaration(DeclNode.INTERNAL_ENTITY);
- //declString = "<!ENTITY"; //$NON-NLS-1$
-
- if (entityDepth == 1 || parsingExternalPEReference) {
- // build up a string: e.g. " % STRDOM "(#PCDATA)">"
- String xs = " "; //$NON-NLS-1$
- if (name.startsWith("%")) { //$NON-NLS-1$
- xs += "% "; //$NON-NLS-1$
- xs += name.substring(1);
- }
- else
- xs += name;
-
- xs += " \"" + value + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
-
- contentString += xs;
- // save expanded entity value
- expandedEntityValue = value;
- parseCurrentDeclaration();
-
- }
- }
-
- public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
- startDeclaration(DeclNode.EXTERNAL_ENTITY);
- //declString = "<!ENTITY"; //$NON-NLS-1$
-
- if (entityDepth == 1 || parsingExternalPEReference) {
- // build up a string:
- // ex1) " % FIELD SYSTEM "oagis_fields.dtd">"
- // ex2) " % FIELD PUBLIC "FOO">"
- String xs = " "; //$NON-NLS-1$
- if (name.startsWith("%")) { //$NON-NLS-1$
- xs += "% "; //$NON-NLS-1$
- xs += name.substring(1);
- }
- else
- xs += name;
-
- if (systemId != null)
- xs += " SYSTEM \"" + systemId + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
- else if (publicId != null)
- xs += " PUBLIC \"" + publicId + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
-
- contentString += xs;
- parseCurrentDeclaration();
- }
- }
-
- //
- // LexicalHandler methods
- //
-
- public void startCDATA() throws SAXException {
- }
-
- public void endCDATA() throws SAXException {
- }
-
- public void startDTD(String name, String publicId, String systemId) throws SAXException {
- dtdList.removeAllElements();
- dtdList.addElement(currentDTD);
- }
-
- /**
- * Report the end of DTD declarations.
- *
- * @exception SAXException
- * The application may raise an exception.
- * @see #startDTD
- */
- public void endDTD() throws SAXException {
- startDeclaration(DeclNode.END_DTD);
- }
-
- /**
- * Report the beginning of an entity.
- *
- * The start and end of the document entity are not reported. The start
- * and end of the external DTD subset are reported using the pseudo-name
- * "[dtd]". All other events must be properly nested within start/end
- * entity events.
- *
- * @param name
- * The name of the entity. If it is a parameter entity, the
- * name will begin with '%'.
- * @exception SAXException
- * The application may raise an exception.
- * @see #endEntity
- */
-
- public void startEntity(String name) throws SAXException {
- if (name.equals("[dtd]")) { //$NON-NLS-1$
- startDeclaration(DeclNode.START_ENTITY_DTD);
- }
- else if (currentDeclNode == null) {
- // PE reference in markupdecl section
- if (name.startsWith("%")) { //$NON-NLS-1$
- String peName = name.substring(1);
- EntityDecl en = entityPool.referPara(peName);
-
- peRefStack.push(name);
- parsingPERefStack.push(new Boolean(parsingExternalPEReference));
-
- String systemId = en.getSystemId();
- String publicId = en.getPublicId();
- if (systemId == null) {
- parsingExternalPEReference = false;
- }
- else {
- URIResolver idResolver = URIResolverPlugin.createResolver();
- String uri = idResolver.resolve(currentDTD.getName(), publicId, systemId);
- if (!isDTDLoaded(uri)) {
- // not loaded
- // out.println(" DTD not loaded .. create new DTD: "
- // );
- dtdStack.push(currentDTD);
- DTD newDTD = new DTD(uri);
- dtdList.addElement(newDTD);
- currentDTD = newDTD;
- parsingExternalPEReference = true;
- }
- else {
- // out.println(" DTD already loaded .. " );
- parsingExternalPEReference = false;
- }
- }
- }
- }
- else if (entityDepth == 1 || parsingExternalPEReference) {
- String xs = (String) reader.getProperty("http://xml.org/sax/properties/xml-string"); //$NON-NLS-1$
- contentString += xs;
- }
- entityDepth++;
- }
-
- /**
- * Report the end of an entity.
- *
- * @param name
- * The name of the entity that is ending.
- * @exception SAXException
- * The application may raise an exception.
- * @see #startEntity
- */
- public void endEntity(String name) throws SAXException {
- if (name.equals("[dtd]")) { //$NON-NLS-1$
- startDeclaration(DeclNode.END_ENTITY_DTD);
- }
- else if (!peRefStack.empty()) {
- parseExternalPEReference(name);
- }
- else if (entityDepth == 1 || parsingExternalPEReference) {
- if (!contentString.endsWith(name + ";")) { //$NON-NLS-1$
- String xs = (String) reader.getProperty("http://xml.org/sax/properties/xml-string"); //$NON-NLS-1$
- contentString += xs;
- }
- }
- entityDepth--;
- entityEnd = true;
- }
-
- protected boolean parseExternalPEReference(String name) {
- if (!peRefStack.empty()) {
- if (((String) peRefStack.peek()).equals(name)) {
- peRefStack.pop();
- if (parsingExternalPEReference) {
- currentDTD = (DTD) dtdStack.pop();
- addPEReferenceNode(name);
- }
- parsingExternalPEReference = ((Boolean) parsingPERefStack.pop()).booleanValue();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * This callback will be used for comments inside or outside the document
- * element, including comments in the external DTD subset (if read).
- *
- * @param ch
- * An array holding the characters in the comment.
- * @param start
- * The starting position in the array.
- * @param length
- * The number of characters to use from the array.
- * @exception SAXException
- * The application may raise an exception.
- */
- public void comment(char ch[], int start, int length) throws SAXException {
- startDeclaration(DeclNode.COMMENT);
-
- if (comment == null)
- comment = new String(ch, start, length);
- else
- comment += "\n" + new String(ch, start, length); // append all comments. //$NON-NLS-1$
- // The comment will get reset after
- // it has been attached to the following
- // declaration.
- }
-
- //
- // ErrorHandler methods
- //
-
- /* Warning. */
- public void warning(SAXParseException ex) {
- /*String error = "[Source Line] " + declString + contentString + "\n"; //$NON-NLS-1$//$NON-NLS-2$
- error += "[Warning ] " + getLocationString(ex) + ": " + ex.getMessage(); //$NON-NLS-1$//$NON-NLS-2$*/
- setErrorInformation(ex, "warning"); //$NON-NLS-1$
-
- parseCurrentDeclaration();
- }
-
- /* Error. */
- public void error(SAXParseException ex) {
- /*String error = "[Source Line] " + declString + contentString + "\n"; //$NON-NLS-1$//$NON-NLS-2$
- error += "[Error ] " + getLocationString(ex) + ": " + ex.getMessage(); //$NON-NLS-1$//$NON-NLS-2$*/
- setErrorInformation(ex, "error"); //$NON-NLS-1$
-
- parseCurrentDeclaration();
- }
-
- /* Fatal error. */
- public void fatalError(SAXParseException ex) throws SAXException {
- /*String error = "[Source Line] " + declString + contentString + "\n"; //$NON-NLS-1$//$NON-NLS-2$
- error += "[Fatal Error] " + getLocationString(ex) + ": " + ex.getMessage(); //$NON-NLS-1$//$NON-NLS-2$*/
- setErrorInformation(ex, "fatal"); //$NON-NLS-1$
-
- parseCurrentDeclaration();
- }
-
- /* Returns a string of the location. */
- /*private String getLocationString(SAXParseException ex) {
- StringBuffer str = new StringBuffer();
-
- String systemId = ex.getSystemId();
- if (systemId != null) {
- int index = systemId.lastIndexOf('/');
- if (index != -1)
- systemId = systemId.substring(index + 1);
- str.append(systemId);
- }
- str.append(':');
- str.append(ex.getLineNumber());
- str.append(':');
- str.append(ex.getColumnNumber());
-
- return str.toString();
-
- }*/
-
- private void startDeclaration(int type) {
- if (type == DeclNode.END_DTD || type == DeclNode.END_ENTITY_DTD || type == DeclNode.COMMENT || type == DeclNode.ERROR) {
- previousDeclNode = currentDeclNode;
- currentDeclNode = null;
- }
- else {
- currentDeclNode = new DeclNode(type);
- contentString = ""; //$NON-NLS-1$
- //declString = ""; //$NON-NLS-1$
- expandedEntityValue = null;
- }
- }
-
- private void parseCurrentDeclaration() {
- parseCurrentDeclarationHelper(contentString);
- contentString = ""; //$NON-NLS-1$
- }
-
- private void parseCurrentDeclarationHelper(String declarationString) {
- DTDScanner scanner;
- String name;
-
- if (currentDeclNode == null && previousDeclNode != null && entityEnd) {
- currentDeclNode = previousDeclNode;
- }
-
- // save the previous declNode
- if (currentDeclNode != null) {
- BaseNode baseNode = null;
- // strip out the ending markup symbol ">"
- if (declarationString.endsWith(">")) //$NON-NLS-1$
- declarationString = declarationString.substring(0, declarationString.length() - 1);
-
- int sIndex;
- String cString;
- int type = currentDeclNode.getType();
- switch (type) {
- case DeclNode.ELEMENT : {
- name = TString.word(declarationString, 1);
-
- // strip out the name
- sIndex = declarationString.indexOf(name) + name.length();
- cString = declarationString.substring(sIndex);
-
- baseNode = new ElementDecl(name, currentDTD.getName());
- scanner = new DTDScanner(currentDTD.getName(), cString);
- CMNode contentModel = scanner.scanContentModel();
- if (contentModel == null && errorMessage == null) {
- createErrorMessage("Expecting '(' in content model", "error"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- ((ElementDecl) baseNode).setContentModelNode(contentModel);
- elementPool.put(name, baseNode);
- break;
- }
- case DeclNode.INTERNAL_ENTITY :
- case DeclNode.EXTERNAL_ENTITY : {
- if (!parseExternalPEReference(declarationString)) {
- scanner = new DTDScanner(currentDTD.getName(), declarationString);
- baseNode = scanner.scanEntityDecl();
- // System.out.println("----baseNode (" +
- // declarationString + ")" + baseNode);
- if (type == DeclNode.INTERNAL_ENTITY && expandedEntityValue != null) {
- ((EntityDecl) baseNode).expandedValue = expandedEntityValue;
- }
- if (baseNode != null) {
- entityPool.add((EntityDecl) baseNode);
- }
- }
-
- break;
- }
- case DeclNode.NOTATION : {
- scanner = new DTDScanner(currentDTD.getName(), declarationString);
- baseNode = scanner.scanNotationDecl();
- break;
- }
- case DeclNode.ATTLIST : {
- name = TString.word(declarationString, 1);
-
- // strip out the name
- sIndex = declarationString.indexOf(name) + name.length();
- cString = declarationString.substring(sIndex);
-
- baseNode = new Attlist(name, currentDTD.getName());
- scanner = new DTDScanner(currentDTD.getName(), cString.trim());
- Vector attrs = scanner.scanAttlistDecl(entityPool);
- String errorString = scanner.getErrorString();
-
- if (attrs.size() > 0) {
- ((Attlist) baseNode).setAttDefs(attrs);
- }
- if (errorString != null) {
- createErrorMessage(errorString, "error"); //$NON-NLS-1$
- }
- break;
- }
- default : {
- currentDeclNode = null;
- }
- }
-
- if (baseNode != null) {
- if (comment != null) {
- baseNode.setComment(comment);
- comment = null;
- }
-
- if (errorMessage != null) {
- baseNode.setErrorMessage(errorMessage);
- errorMessage = null;
- }
-
- if (currentDeclNode != null) {
- currentDTD.addDecl(baseNode);
- }
- lastBaseNode = baseNode;
- }
-
- currentDeclNode = null;
- }
- else {
- if (lastBaseNode != null && errorMessage != null && lastBaseNode.getErrorMessage() == null) {
- lastBaseNode.setErrorMessage(errorMessage);
- errorMessage = null;
- }
- }
- }
-
- private void addPEReferenceNode(String name) {
- if (name.startsWith("%")) { //$NON-NLS-1$
- name = name.substring(1); // strip out the % from entity name
- }
- EntityDecl e = new EntityDecl(name, currentDTD.getName(), null, true);
- e.setEntityReferenced(true);
- e.setErrorMessage(errorMessage);
- errorMessage = null;
- currentDTD.addDecl(e);
- }
-
- private boolean isDTDLoaded(String uri) {
- boolean loaded = false;
- //String list = ""; //$NON-NLS-1$
- if (dtdList != null) {
- Enumeration en = dtdList.elements();
- while (en.hasMoreElements()) {
- DTD dtd = (DTD) en.nextElement();
- //list += dtd.getName();
- //list += ","; //$NON-NLS-1$
- if (dtd.getName().equals(uri)) {
- loaded = true;
- break;
- }
- }
- }
- return loaded;
- }
-
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
- InputSource result = null;
- URIResolver idResolver = URIResolverPlugin.createResolver();
- String logicalURI = idResolver.resolve(currentDTD.getName(), publicId, systemId);
- // bug 113537, ensure physical resolution gets done here
- // right before we attempt to open a stream
- String physicalURI = idResolver.resolvePhysicalLocation(currentDTD.getName(), publicId, logicalURI);
- result = new InputSource(logicalURI);
- if(!(physicalURI == null || physicalURI.equals("") || URIHelper.hasProtocol(physicalURI))) //$NON-NLS-1$
- {
- physicalURI = "file:///" + physicalURI; //$NON-NLS-1$
- }
- result.setByteStream(new LazyURLInputStream(physicalURI));
- return result;
- }
-
- //
- // Main
- //
-
- /** Main program entry point. */
- public static void main(String argv[]) {
-
- // is there anything to do?
- if (argv.length == 0) {
- printUsage();
- System.exit(1);
- }
-
- // vars
- boolean canonical = false;
- boolean expandEntityReferences = false;
- DTDParser parser;
-
- // check parameters
- for (int i = 0; i < argv.length; i++) {
- String arg = argv[i];
-
- // options
- if (arg.startsWith("-")) { //$NON-NLS-1$
-
- if (arg.equals("-c")) { //$NON-NLS-1$
- canonical = true;
- continue;
- }
-
- if (arg.equals("-x")) { //$NON-NLS-1$
- expandEntityReferences = true;
- continue;
- }
-
- if (arg.equals("-h")) { //$NON-NLS-1$
- printUsage();
- System.exit(1);
- }
- }
- try {
- parser = new DTDParser(canonical);
- parser.setExpandEntityReferences(expandEntityReferences);
- parser.parse(arg);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- } // main(String[])
-
- /** Prints the usage. */
- private static void printUsage() {
-
- System.err.println("usage: java sax.DTDParser (options) uri ..."); //$NON-NLS-1$
- System.err.println();
- System.err.println("options:"); //$NON-NLS-1$
- System.err.println(" -c Canonical XML output."); //$NON-NLS-1$
- System.err.println(" -x Expand entity references."); //$NON-NLS-1$
- System.err.println(" -h This help screen."); //$NON-NLS-1$
-
- } // printUsage()
-
- private void setErrorInformation(SAXParseException ex, String severity) {
- errorMessage = new ErrorMessage();
-
- if (ex.getLineNumber() == -1) {
- errorMessage.setErrorLine(lineNumber);
- }
- else {
- errorMessage.setErrorLine(ex.getLineNumber());
- }
-
-
- errorMessage.setErrorMessage(ex.getMessage());
- errorMessage.setErrorColumn(ex.getColumnNumber());
- errorMessage.setSeverity(severity);
- errorMessages.add(errorMessage);
- }
-
- private void createErrorMessage(String message, String severity) {
- errorMessage = new ErrorMessage();
-
- Locator locator = getLocator();
-
- errorMessage.setErrorLine(locator.getLineNumber());
- errorMessage.setErrorColumn(locator.getColumnNumber());
-
- errorMessage.setErrorMessage(message);
- errorMessage.setSeverity(severity);
-
- errorMessages.add(errorMessage);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java
deleted file mode 100644
index 829063cede..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java
+++ /dev/null
@@ -1,64 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-
-
-
-public class DTDSaxArtifactVisitor {
- public void visitDTD(DTD dtd) {
- Enumeration en = dtd.externalElements();
-
- while (en.hasMoreElements()) {
- Object e = en.nextElement();
- if (e instanceof EntityDecl) {
- visitEntityDecl((EntityDecl) e);
- }
- else if (e instanceof ElementDecl) {
- visitElementDecl((ElementDecl) e);
- }
- else if (e instanceof NotationDecl) {
- visitNotationDecl((NotationDecl) e);
- }
- }
- }
-
- public void visitNotationDecl(NotationDecl notation) {
- }
-
- public void visitElementDecl(ElementDecl element) {
- }
-
- public void visitEntityDecl(EntityDecl entity) {
- if (entity.isEntityReferenced()) {
- visitParameterEntityReferenceDecl(entity);
- }
- else {
- if (entity.isExternal()) {
- visitExternalEntityDecl(entity);
- }
- else {
- visitInternalEntityDecl(entity);
- }
- }
- }
-
- public void visitParameterEntityReferenceDecl(EntityDecl entity) {
- }
-
- public void visitExternalEntityDecl(EntityDecl entity) {
- }
-
- public void visitInternalEntityDecl(EntityDecl entity) {
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java
deleted file mode 100644
index 865cef1903..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java
+++ /dev/null
@@ -1,1128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Vector;
-
-/**
- * Scanning / parsing the content string from the Decl statement
- *
- * @version
- */
-public class DTDScanner {
- // element content model strings
- private static final char[] empty_string = {'E', 'M', 'P', 'T', 'Y'};
- private static final char[] any_string = {'A', 'N', 'Y'};
- private static final char[] pcdata_string = {'#', 'P', 'C', 'D', 'A', 'T', 'A'};
-
- // attribute type and default type strings
- private static final char[] cdata_string = {'C', 'D', 'A', 'T', 'A'};
- private static final char[] id_string = {'I', 'D'};
- private static final char[] ref_string = {'R', 'E', 'F'};
- private static final char[] entit_string = {'E', 'N', 'T', 'I', 'T'};
- private static final char[] ies_string = {'I', 'E', 'S'};
- private static final char[] nmtoken_string = {'N', 'M', 'T', 'O', 'K', 'E', 'N'};
- private static final char[] notation_string = {'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N'};
- private static final char[] required_string = {'#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D'};
- private static final char[] implied_string = {'#', 'I', 'M', 'P', 'L', 'I', 'E', 'D'};
- private static final char[] fixed_string = {'#', 'F', 'I', 'X', 'E', 'D'};
-
- private static final char[] system_string = {'S', 'Y', 'S', 'T', 'E', 'M'};
- private static final char[] public_string = {'P', 'U', 'B', 'L', 'I', 'C'};
- private static final char[] ndata_string = {'N', 'D', 'A', 'T', 'A'};
-
- private int[] fOpStack = null;
- private CMGroupNode[] fGrpStack = null;
-
- private EntityPool entityPool;
-
- /* Attribute Def scanner state */
- static final int Att_Scanner_State_Name = 1, Att_Scanner_State_Type = 2, Att_Scanner_State_DefaultType = 3, Att_Scanner_State_DefaultValue = 4;
-
- private StringParser contentString;
- private String cData;
- private int prevNodeOffset = 0;
- private int nodeOffset = 1;
- private String ownerDTD;
-
- private String errorString;
-
- public DTDScanner(String ownerDTD, String cm) {
- // System.out.println("Cm: " + cm);
- contentString = new StringParser(cm);
- cData = cm;
- this.ownerDTD = ownerDTD;
- }
-
- //
- // [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
- //
- // Specific to VisualDTD : also allows %PEReference;
- //
- public CMNode scanContentModel() {
- CMNode cmNode = null;
- contentString.skipPastSpaces();
- if (contentString.skippedString(empty_string)) {
- cmNode = new CMBasicNode("EMPTY", CMNodeType.EMPTY); //$NON-NLS-1$
- }
- else if (contentString.skippedString(any_string)) {
- cmNode = new CMBasicNode("ANY", CMNodeType.ANY); //$NON-NLS-1$
- }
- else if (contentString.lookingAtChar('%', true)) {
- cmNode = new CMReferenceNode(contentString.getData(), CMNodeType.ENTITY_REFERENCE);
- }
- else if (!contentString.lookingAtChar('(', true)) {
- // This means that the contentmodel string is bad...
- // System.out.println("!!! exception - no (");
- return cmNode;
- }
- else {
- // System.out.println("Remaining String = " +
- // contentString.getRemainingString());
-
- contentString.skipPastSpaces();
- boolean skippedPCDATA = contentString.skippedString(pcdata_string);
- if (skippedPCDATA) {
- cmNode = scanMixed();
- }
- else {
- cmNode = scanChildren();
- }
-
- }
- return cmNode;
- }
-
- //
- // [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S?
- // '#PCDATA' S? ')'
- //
- // Called after scanning past '(' S? '#PCDATA'
- //
- private CMNode scanMixed() {
- // System.out.println("ScanMixed...");
- CMGroupNode cmNode = new CMGroupNode();
- cmNode.setGroupKind(CMNodeType.GROUP_CHOICE);
- cmNode.addChild(new CMBasicNode("#PCDATA", CMNodeType.PCDATA)); //$NON-NLS-1$
-
- // int prevNodeIndex = -1;
- boolean starRequired = false;
-
-
- while (true) {
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
- prevNodeOffset = contentString.getCurrentOffset();
-
- if (!contentString.lookingAtChar('|', true)) {
- if (!contentString.lookingAtChar(')', true)) {
- break;
- }
- if (contentString.lookingAtChar('*', true)) {
- cmNode.setOccurrence(CMNodeType.ZERO_OR_MORE);
- }
- else if (starRequired) {
- // System.out.println(" * is required ... ");
- }
- break;
- }
-
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
-
- nodeOffset = contentString.getCurrentOffset();
- if (nodeOffset != -1) {
- // skip pass "|"
- prevNodeOffset = nodeOffset;
- }
-
- starRequired = true;
- contentString.skipPastNameAndPEReference(')');
- nodeOffset = contentString.getCurrentOffset();
-
- if (nodeOffset == -1)
- break;
-
- // add leave node
- int len = nodeOffset - prevNodeOffset;
- String refName = contentString.getString(prevNodeOffset, len);
- prevNodeOffset = nodeOffset;
- if (refName.startsWith("%")) //$NON-NLS-1$
- cmNode.addChild(new CMReferenceNode(refName, CMNodeType.ENTITY_REFERENCE));
- else
- cmNode.addChild(new CMReferenceNode(refName, CMNodeType.ELEMENT_REFERENCE));
-
- } // end while
-
-
- if (cmNode.getChildren().size() == 1) {
- // simplify the contentModel if the CMGroupNode only has one child
- // node.
- return (CMBasicNode) cmNode.getChildren().elementAt(0);
- }
-
- return cmNode;
- }
-
- //
- // [47] children ::= (choice | seq) ('?' | '*' | '+')?
- // [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
- // [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
- // [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
- //
- // Called after scanning past '('
-
- private CMNode scanChildren() {
-
- // System.out.println("scanChildren...");
-
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
-
- prevNodeOffset = contentString.getCurrentOffset();
- nodeOffset = contentString.getCurrentOffset();
- int depth = 1;
- initializeContentModelStack(depth);
- int len;
-
- String nodeName;
- CMGroupNode cmNode = new CMGroupNode();
- fGrpStack[depth] = cmNode;
-
- while (true) {
-
- // System.out.println(" Begin outter while loop ..." );
- if (contentString.lookingAtChar('(', true)) {
- if (contentString.lookingAtSpace(true)) {
- // skip past any white spaces after the '('
- contentString.skipPastSpaces();
- }
-
- depth++;
- initializeContentModelStack(depth);
- fGrpStack[depth] = new CMGroupNode();
- fGrpStack[depth - 1].addChild(fGrpStack[depth]);
- continue;
- }
-
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipPastNameAndPEReference(')');
- nodeOffset = contentString.getCurrentOffset();
-
- /*
- * System.out.println(" prevNodeOFfset " + prevNodeOffset);
- * System.out.println(" currentNodeOFfset " + nodeOffset);
- */
-
- len = nodeOffset - prevNodeOffset;
-
- if (nodeOffset == -1 || len < 1) {
- break;
- }
-
- nodeName = contentString.getString(prevNodeOffset, len);
-
- CMRepeatableNode rn;
- if (nodeName.startsWith("%")) { //$NON-NLS-1$
- rn = new CMReferenceNode(nodeName, CMNodeType.ENTITY_REFERENCE);
- }
- else {
- rn = new CMReferenceNode(nodeName, CMNodeType.ELEMENT_REFERENCE);
- }
-
- fGrpStack[depth].addChild(rn);
-
- prevNodeOffset = nodeOffset;
-
- if (contentString.lookingAtChar('?', true)) {
- rn.setOccurrence(CMNodeType.OPTIONAL);
- }
- else if (contentString.lookingAtChar('*', true)) {
- rn.setOccurrence(CMNodeType.ZERO_OR_MORE);
- }
- else if (contentString.lookingAtChar('+', true)) {
- rn.setOccurrence(CMNodeType.ONE_OR_MORE);
- }
-
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
-
- prevNodeOffset = contentString.getCurrentOffset();
-
- while (true) {
- // System.out.println(" Begin inner while loop ... depth " +
- // depth );
- if (fOpStack[depth] != CMNodeType.GROUP_SEQUENCE && contentString.lookingAtChar('|', true)) {
- fOpStack[depth] = CMNodeType.GROUP_CHOICE;
- fGrpStack[depth].setGroupKind(CMNodeType.GROUP_CHOICE);
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
- break;
- }
- else if (fOpStack[depth] != CMNodeType.GROUP_CHOICE && contentString.lookingAtChar(',', true)) {
- fOpStack[depth] = CMNodeType.GROUP_SEQUENCE;
- fGrpStack[depth].setGroupKind(CMNodeType.GROUP_SEQUENCE);
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
- break;
- }
- else {
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
- if (!contentString.lookingAtChar(')', true)) {
- // System.out.println(" error ) not found");
- }
- // end of the curent group node
- if (contentString.lookingAtChar('?', true)) {
- fGrpStack[depth].setOccurrence(CMNodeType.OPTIONAL);
- }
- else if (contentString.lookingAtChar('*', true)) {
- fGrpStack[depth].setOccurrence(CMNodeType.ZERO_OR_MORE);
- }
- else if (contentString.lookingAtChar('+', true)) {
- fGrpStack[depth].setOccurrence(CMNodeType.ONE_OR_MORE);
- }
- depth--;
- if (depth == 0) {
- break;
- }
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
-
- // System.out.println(" End end inner while loop ... depth
- // " + depth );
-
- }
- } // inner while
-
- if (depth == 0) {
- break;
- }
- } // outer while
-
- if (cmNode.getChildren().size() == 1) {
- // simplify the contentModel if the CMGroupNode only has one child
- // node and that node is an element ref.
- CMRepeatableNode rn = (CMRepeatableNode) cmNode.getChildren().elementAt(0);
- if (rn instanceof CMReferenceNode) {
- CMReferenceNode ref = (CMReferenceNode) rn;
- if (ref.getType() == CMNodeType.ELEMENT_REFERENCE) {
- if (ref.getOccurrence() == CMNodeType.ONE) {
- ref.setOccurrence(cmNode.getOccurrence());
- return ref;
- }
- else if (cmNode.getOccurrence() == CMNodeType.ONE) {
- return ref;
- }
- } // end of if ()
- }
- }
-
- return cmNode;
- }
-
- //
- // [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
- // [53] AttDef ::= S Name S AttType S DefaultDecl
- // [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)?
- // AttValue)
- //
-
- public Vector scanAttlistDecl(EntityPool entityPool) {
- Vector attList = new Vector();
- this.entityPool = entityPool;
-
- int scannerState = Att_Scanner_State_Name;
-
- AttNode attNode;
-
- while (true) {
- attNode = new AttNode();
-
- // System.out.println(" scanner state: " + scannerState);
-
- // scanning att name
- if (scannerState == Att_Scanner_State_Name) {
- // System.out.println("scan att Name...");
- scannerState = checkForAttributeWithPEReference(attNode, scannerState);
- if (scannerState == -1) {
- return attList;
- }
- }
-
- // scanning att type
- if (scannerState == Att_Scanner_State_Type) {
- // System.out.println("scan att type...");
-
- if (contentString.skippedString(cdata_string)) {
- attNode.type = new String(cdata_string);
- scannerState = Att_Scanner_State_DefaultType;
- }
- else if (contentString.skippedString(id_string)) {
- if (!contentString.skippedString(ref_string)) {
- attNode.type = new String(id_string);
- }
- else if (!contentString.lookingAtChar('S', true)) {
- attNode.type = "IDREF"; //$NON-NLS-1$
- }
- else {
- attNode.type = "IDREFS"; //$NON-NLS-1$
- }
- scannerState = Att_Scanner_State_DefaultType;
- }
- else if (contentString.skippedString(entit_string)) {
- if (contentString.lookingAtChar('Y', true)) {
- attNode.type = "ENTITY"; //$NON-NLS-1$
- }
- else if (contentString.skippedString(ies_string)) {
- attNode.type = "ENTITIES"; //$NON-NLS-1$
- }
- scannerState = Att_Scanner_State_DefaultType;
- }
- else if (contentString.skippedString(nmtoken_string)) {
- if (contentString.lookingAtChar('S', true)) {
- attNode.type = "NMTOKENS"; //$NON-NLS-1$
- }
- else {
- attNode.type = "NMTOKEN"; //$NON-NLS-1$
- }
- scannerState = Att_Scanner_State_DefaultType;
- }
- else if (contentString.skippedString(notation_string)) {
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- }
- if (!contentString.lookingAtChar('(', true)) {
- System.out.println(" missing ( in notation "); //$NON-NLS-1$
- }
- attNode.type = "NOTATION"; //$NON-NLS-1$
- attNode.enumList = scanEnumeration(contentString, true);
- scannerState = Att_Scanner_State_DefaultType;
- }
- else if (contentString.lookingAtChar('(', true)) {
- attNode.type = "ENUMERATION"; //$NON-NLS-1$
- attNode.enumList = scanEnumeration(contentString, false);
- scannerState = Att_Scanner_State_DefaultType;
- }
- else {
- scannerState = checkForAttributeWithPEReference(attNode, scannerState);
- if (scannerState == Att_Scanner_State_Type) {
- setErrorString("Failed to find type for attribute '" + attNode.name + "'. Please refer to the original DTD file."); //$NON-NLS-1$ //$NON-NLS-2$
- // we failed to find a type for this attribute
- return attList;
- }
- }
- }
-
- if (scannerState == Att_Scanner_State_DefaultType) {
- contentString.skipPastSpaces();
- // System.out.println("scan default type...");
- if (contentString.skippedString(required_string)) {
- attNode.defaultType = new String(required_string);
- }
- else if (contentString.skippedString(implied_string)) {
- attNode.defaultType = new String(implied_string);
- }
- else {
- if (contentString.skippedString(fixed_string)) {
- contentString.skipPastSpaces();
- attNode.defaultType = new String(fixed_string);
- }
- else
- // "default"
- attNode.defaultType = "NOFIXED"; //$NON-NLS-1$
-
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
- attNode.defaultValue = scanDefaultAttValue(contentString);
- }
- scannerState = Att_Scanner_State_Name; // next
- }
-
-
- attList.addElement(attNode);
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
- nodeOffset = contentString.getCurrentOffset();
-
- if (nodeOffset >= cData.length())
- return attList;
-
- prevNodeOffset = contentString.getCurrentOffset();
-
- }// end while loop
- }
-
- //
- // content model stack
- //
- private void initializeContentModelStack(int depth) {
- if (fOpStack == null) {
- fOpStack = new int[8];
- fGrpStack = new CMGroupNode[8];
- }
- else if (depth == fOpStack.length) {
- int[] newStack = new int[depth * 2];
- System.arraycopy(fOpStack, 0, newStack, 0, depth);
- fOpStack = newStack;
-
- CMGroupNode[] newGrpStack = new CMGroupNode[depth * 2];
- System.arraycopy(fGrpStack, 0, newGrpStack, 0, depth);
- fGrpStack = newGrpStack;
- }
- fOpStack[depth] = -1;
- fGrpStack[depth] = null;
- }
-
- //
- private int checkForAttributeWithPEReference(AttNode attNode, int scannerState) {
- int state = -1;
- int len;
- String rawText;
- EntityDecl pEntity;
-
- // System.out.println(" checkforATTPERReference- start scannerState: "
- // + scannerState);
- if (scannerState == Att_Scanner_State_Name) {
- contentString.skipPastNameAndPEReference(' ');
- nodeOffset = contentString.getCurrentOffset();
- len = nodeOffset - prevNodeOffset;
-
- rawText = contentString.getString(prevNodeOffset, len);
- attNode.name = rawText;
-
- // System.out.println("State_name : " + rawText);
-
- if (rawText.startsWith("%") && rawText.endsWith(";")) { //$NON-NLS-1$ //$NON-NLS-2$
- String pe = rawText.substring(1, rawText.length() - 1);
-
- pEntity = entityPool.referPara(pe);
- if (pEntity != null) {
- // System.out.println(" name :" + rawText +" expandTo:" +
- // pEntity.expandedValue);
- state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
- // System.out.println("checkForAttrwithPER - nextstate: "
- // + state);
- }
- else
- state = Att_Scanner_State_Type;
- }
- else
- state = Att_Scanner_State_Type;
-
- }
- else if (scannerState == Att_Scanner_State_Type) {
- if (contentString.lookingAtChar('%', true)) {
- rawText = getPEName();
- attNode.type = "%" + rawText; //$NON-NLS-1$
- String peName = rawText.substring(0, rawText.length() - 1);
- // System.out.println("State_type : pe- " + peName);
- pEntity = entityPool.referPara(peName);
- if (pEntity != null) {
- state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
- }
- else
- state = Att_Scanner_State_DefaultType;
- }
- else
- state = Att_Scanner_State_Type;
- }
- else if (scannerState == Att_Scanner_State_DefaultType) {
- if (contentString.lookingAtChar('%', true)) {
- rawText = getPEName();
- attNode.defaultType = rawText;
- // System.out.println("State_defaultType : " + rawText);
- pEntity = entityPool.referPara(rawText.substring(1, rawText.length() - 1));
- if (pEntity != null) {
- state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
- }
- else
- state = Att_Scanner_State_DefaultValue;
- }
- else
- state = Att_Scanner_State_DefaultType;
- }
- else if (scannerState == Att_Scanner_State_DefaultValue) {
- if (contentString.lookingAtChar('%', true)) {
- rawText = getPEName();
- attNode.defaultValue = rawText;
- // System.out.println("State_defaultValue : " + rawText);
-
- pEntity = entityPool.referPara(rawText.substring(1, rawText.length() - 1));
- if (pEntity != null) {
- state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
- }
- else
- state = Att_Scanner_State_DefaultValue;
- }
- else
- state = Att_Scanner_State_DefaultValue;
- }
-
- if (contentString.lookingAtSpace(true))
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
- return state;
- }
-
- private String getPEName() {
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipToChar(';', true);
- nodeOffset = contentString.getCurrentOffset();
- int len = nodeOffset - prevNodeOffset;
- return contentString.getString(prevNodeOffset, len);
- }
-
- private int whatIsTheNextAttributeScanningState(String attrContentString, int currentState) {
- StringParser sp = new StringParser(attrContentString.trim());
-
-
- int nextState = currentState;
- int nOffset = 0;
-
- /*
- * System.out.println("WhatistheNext AttContentStringt : " +
- * attrContentString); System.out.println("WhatistheNext
- * AttContentStringL : " + attrContentString.length());
- * System.out.println("WhatistheNext currentstate : " + currentState);
- */
-
- while (true) {
- // System.out.println("WhatistheNext inside whil nextstate : " +
- // nextState);
- if (nextState == Att_Scanner_State_Name) { // the current
- // scanning state is
- // Attr Name, is the
- // next part Attr Type
- // ?
- if (isAttrName(sp)) {
- nextState = Att_Scanner_State_Type;
- }
- }
- else if (nextState == Att_Scanner_State_Type) { // the current
- // scanning state
- // is Attr Type,
- // is the next
- // part Default
- // Attr Type ?
-
- if (isAttrType(sp)) {
- nextState = Att_Scanner_State_DefaultType;
- }
- else
- System.out.println("WhatistheNext Attr Part - is not an Attr Type"); //$NON-NLS-1$
-
- }
-
- if (nextState == Att_Scanner_State_DefaultType) {
-
- int dType = isAttrDefaultType(sp);
- // System.out.println("WhatistheNext inside dType : " +
- // dType);
- if (dType == 1) // #REQUIRED or #IMPLIED
- {
- nextState = Att_Scanner_State_Name;
- }
- else {
- if (dType == 2) // #FIXED
- {
- // need to look at this again
- nextState = Att_Scanner_State_DefaultType;
- }
-
- if (scanDefaultAttValue(sp) != null) {
- nextState = Att_Scanner_State_Name;
-
- }
- }
- }
-
- sp.skipPastSpaces();
-
- if (nOffset == sp.getCurrentOffset())
- break;
-
- nOffset = sp.getCurrentOffset();
-
- if (nOffset >= attrContentString.length() || nOffset == -1)
- break;
-
- } // end while
-
- return nextState;
- }
-
-
- private boolean isAttrName(StringParser sp) {
- // System.out.println("isAttrName - sp:" + sp.fData);
- // System.out.println("isAttrName - currentOffset:" +
- // sp.getCurrentOffset());
- boolean isAttrName = false;
- int prev = sp.getCurrentOffset();
- sp.skipPastName(' ');
- if ((sp.getCurrentOffset() - prev) > 0)
- isAttrName = true;
- return isAttrName;
-
- }
-
- private boolean isAttrType(StringParser sp) {
- // System.out.println("isAttrType - sp:" + sp.fData);
- // System.out.println("isAttrType - currentOffset:" +
- // sp.getCurrentOffset());
- boolean isAttrType = false;
- if (sp.skippedString(cdata_string)) {
- isAttrType = true;
- }
- else if (sp.skippedString(id_string)) {
- if (!sp.skippedString(ref_string)) {
- isAttrType = true; // ID
- }
- else if (!sp.lookingAtChar('S', true)) {
- isAttrType = true; // IDREFS
- }
- else {
- isAttrType = true; // IDREF
- }
- }
- else if (sp.skippedString(entit_string)) {
- if (sp.lookingAtChar('Y', true)) {
- isAttrType = true; // ENTITY
- }
- else if (sp.skippedString(ies_string)) {
- isAttrType = true; // ENTITITES
- }
- }
- else if (sp.skippedString(nmtoken_string)) {
- if (sp.lookingAtChar('S', true)) {
- isAttrType = true; // NMTOKENS
- }
- else {
- isAttrType = true; // NMTOKEN
- }
- }
- else if (sp.skippedString(notation_string)) {
- if (!sp.lookingAtChar('(', true)) {
- // System.out.println(" missing ( in notation ");
- }
- Vector enumList = scanEnumeration(sp, true);
- if (enumList == null || enumList.size() == 0)
- isAttrType = false;
- else
- isAttrType = true;
- }
- else if (sp.lookingAtChar('(', true)) {
- // "ENUMERATION";
- Vector enumList = scanEnumeration(sp, false);
- if (enumList == null || enumList.size() == 0)
- isAttrType = false;
- else
- isAttrType = true;
- }
-
- return isAttrType;
-
- }
-
- /*
- * return 0 - not default type 1 - #REQUIRED or #IMPLIED 2 - #FIXED
- */
-
- private int isAttrDefaultType(StringParser sp) {
- // System.out.println("isAttrDefaultType - sp:" + sp.fData);
- int result = 0;
- if (sp.skippedString(required_string)) {
- result = 1;
- }
- else if (sp.skippedString(implied_string)) {
- result = 1;
- }
- else if (sp.skippedString(fixed_string)) {
- result = 2;
- }
- return result;
- }
-
- //
- // [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
- // [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
- //
- // Called after scanning '('
- //
- private Vector scanEnumeration(StringParser sp, boolean isNotationType) {
- // System.out.println(" scanEnum ...");
- Vector enumList = null;
- int len;
-
- if (sp.lookingAtSpace(true))
- sp.skipPastSpaces();
-
- int prevNodeOffset = sp.getCurrentOffset();
- int nodeOffset;
-
- String nodeName;
-
- while (true) {
-
- if (isNotationType)
- sp.skipPastNameAndPEReference(')');
- else
- sp.skipPastNmtokenAndPEReference(')');
-
- nodeOffset = sp.getCurrentOffset();
-
- if (nodeOffset == -1) {
- return enumList;
- }
-
- len = nodeOffset - prevNodeOffset;
- nodeName = sp.getString(prevNodeOffset, len);
-
- if (enumList == null)
- enumList = new Vector();
-
- enumList.addElement(nodeName);
-
- if (sp.lookingAtSpace(true))
- sp.skipPastSpaces();
-
- if (!sp.lookingAtChar('|', true)) {
- if (!sp.lookingAtChar(')', true)) {
- System.out.println("scanning enum values - error missing ')'"); //$NON-NLS-1$
- break;
- }
- break;
- }
-
- if (sp.lookingAtSpace(true))
- sp.skipPastSpaces();
-
- prevNodeOffset = sp.getCurrentOffset();
- }
- return enumList;
- }
-
- //
- // [10] AttValue ::= '"' ([^<&"] | Reference)* '"'
- // | "'" ([^<&'] | Reference)* "'"
- //
- /**
- * Scan the default value in an attribute declaration
- *
- * @param elementType
- * handle to the element that owns the attribute
- * @param attrName
- * handle in the string pool for the attribute name
- * @return handle in the string pool for the default attribute value
- * @exception java.lang.Exception
- */
- public String scanDefaultAttValue(StringParser sp) {
- String value = null;
- // System.out.println("scan default ATT Value... sp:" + sp.fData);
-
- sp.skipPastSpaces();
-
- boolean single;
- if (!(single = sp.lookingAtChar('\'', true)) && !sp.lookingAtChar('\"', true)) {
- return value;
- }
-
- char qchar = single ? '\'' : '\"';
- int sOffset = sp.getCurrentOffset();
- //BUG 203494 - Skip to the last occurrence of the qchar that way
- // all characters between are obtained
- sp.skipToLastOfChar(qchar, true);
- int len = sp.getCurrentOffset() - sOffset - 1;
- if (len == 0)
- value = ""; //$NON-NLS-1$
- else
- value = sp.getString(sOffset, len);
-
- return value;
- }
-
- //
- // [70] EntityDecl ::= GEDecl | PEDecl
- // [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
- // [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
- // [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
- // [74] PEDef ::= EntityValue | ExternalID
- // [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- // | 'PUBLIC' S PubidLiteral S SystemLiteral
- // [76] NDataDecl ::= S 'NDATA' S Name
- // [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
- // | "'" ([^%&'] | PEReference | Reference)* "'"
- //
- // Called after scanning 'ENTITY'
- //
- public EntityDecl scanEntityDecl() {
- prevNodeOffset = 1;
- nodeOffset = 1;
- int len;
- boolean isPEDecl = false;
- EntityDecl entityDecl = null;
-
- String name = null;
- String ndata = null;
-
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- if (!contentString.lookingAtChar('%', true)) {
- isPEDecl = false; // <!ENTITY x "x">
- }
- else if (contentString.lookingAtSpace(true)) {
- isPEDecl = true; // <!ENTITY % x "x">
- }
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipPastName(' ');
- nodeOffset = contentString.getCurrentOffset();
- len = nodeOffset - prevNodeOffset;
- if (len > 0) {
- name = contentString.getString(prevNodeOffset, len);
- prevNodeOffset = nodeOffset;
- }
- }
-
- if (name == null)
- return null;
-
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
-
- boolean single;
- if ((single = contentString.lookingAtChar('\'', true)) || contentString.lookingAtChar('\"', true)) {
- String value = scanEntityValue(single);
- entityDecl = new EntityDecl(name, ownerDTD, value, isPEDecl);
- }
- else {
- // external entity
- ExternalID xID = scanExternalID();
- if (xID != null) {
- if (!isPEDecl) // general entity
- {
- boolean unparsed = false;
- contentString.skipPastSpaces();
- unparsed = contentString.skippedString(ndata_string);
- if (unparsed) {
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipPastName(' ');
- nodeOffset = contentString.getCurrentOffset();
- len = nodeOffset - prevNodeOffset;
- ndata = contentString.getString(prevNodeOffset, len);
- }
- }
- entityDecl = new EntityDecl(name, ownerDTD, xID, isPEDecl, ndata);
- }
- }
- return entityDecl;
- }
-
-
- //
- // [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S?
- // '>'
- // [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- // | 'PUBLIC' S PubidLiteral S SystemLiteral
- // [83] PublicID ::= 'PUBLIC' S PubidLiteral
- //
- // Called after scanning 'NOTATION'
- //
- public NotationDecl scanNotationDecl() {
- prevNodeOffset = 1;
- nodeOffset = 1;
- int len;
- NotationDecl notationDecl = null;
-
- String name = null;
-
- if (contentString.lookingAtSpace(true)) {
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipPastName(' ');
- nodeOffset = contentString.getCurrentOffset();
- len = nodeOffset - prevNodeOffset;
- if (len > 0) {
- name = contentString.getString(prevNodeOffset, len);
- prevNodeOffset = nodeOffset;
- }
- }
-
- if (name == null)
- return null;
-
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
-
- notationDecl = new NotationDecl(name, ownerDTD);
-
- ExternalID xID = scanExternalID();
- if (xID != null) {
- if (xID.getSystemLiteral() != null) {
- notationDecl.setSystemId(xID.getSystemLiteral());
- }
- if (xID.getPubIdLiteral() != null) {
- notationDecl.setPublicId(xID.getPubIdLiteral());
- }
- }
-
- return notationDecl;
- }
-
-
- private String scanEntityValue(boolean single) {
- char qchar = single ? '\'' : '\"';
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipToChar(qchar, false);
- int len = contentString.getCurrentOffset() - prevNodeOffset;
- String value = contentString.getString(prevNodeOffset, len);
- return value;
- }
-
- //
- // [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- // | 'PUBLIC' S PubidLiteral S SystemLiteral
- private ExternalID scanExternalID() {
- ExternalID xID = null;
- char qchar = '\"';
- if (contentString.skippedString(system_string)) {
- if (!contentString.lookingAtSpace(true)) {
- return null;
- }
- contentString.skipPastSpaces();
-
- if (contentString.lookingAtChar('\'', true))
- qchar = '\'';
- else if (contentString.lookingAtChar('\"', true))
- qchar = '\"';
-
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipToChar(qchar, true);
- int len = contentString.getCurrentOffset() - prevNodeOffset - 1;
- String systemId = contentString.getString(prevNodeOffset, len);
- // System.out.println("systemid..." + systemId);
- xID = new ExternalID(systemId);
- }
- else if (contentString.skippedString(public_string)) {
- if (!contentString.lookingAtSpace(true)) {
- return null;
- }
-
- contentString.skipPastSpaces();
- if (contentString.lookingAtChar('\'', true))
- qchar = '\'';
- else if (contentString.lookingAtChar('\"', true))
- qchar = '\"';
-
- // publicLiteral
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipToChar(qchar, true);
- int len = contentString.getCurrentOffset() - prevNodeOffset - 1;
- String publicId = contentString.getString(prevNodeOffset, len);
-
- // systemLiteral
- contentString.skipPastSpaces();
- if (contentString.lookingAtChar('\'', true))
- qchar = '\'';
- else if (contentString.lookingAtChar('\"', true))
- qchar = '\"';
- prevNodeOffset = contentString.getCurrentOffset();
- contentString.skipToChar(qchar, true);
- len = contentString.getCurrentOffset() - prevNodeOffset - 1;
-
- if (len > 0) {
- String systemId = contentString.getString(prevNodeOffset, len);
- xID = new ExternalID(publicId, systemId);
- }
- else {
- xID = new ExternalID(publicId, null);
- }
- }
- return xID;
- }
-
- //
- // [83] PublicID ::= 'PUBLIC' S PubidLiteral
- //
-
- // dmw 11/15 private method never read locally
- // TODO: change to private if used, otherwise should be removed
- String scanPublicID() {
- String pID = null;
- if (contentString.skippedString(public_string)) {
- if (!contentString.lookingAtSpace(true)) {
- return pID;
- }
- contentString.skipPastSpaces();
- prevNodeOffset = contentString.getCurrentOffset();
-
- contentString.skipToChar(' ', true);
- int len = contentString.getCurrentOffset() - prevNodeOffset;
- pID = contentString.getString(prevNodeOffset, len);
- }
-
- return pID;
- }
-
- //
- // Main
- //
-
- /** Main program entry point. */
- public static void main(String argv[]) {
-
- // is there anything to do?
- if (argv.length == 0) {
- System.exit(1);
- }
-
- // DTDScanner sc = new DTDScanner(argv[0]);
- DTDScanner sc = new DTDScanner("hello.dtd", " gif SYSTEM \"GIF File\" "); //$NON-NLS-1$ //$NON-NLS-2$
-
- NotationDecl n = sc.scanNotationDecl();
- System.out.println("Noation Name: " + n.getNodeName()); //$NON-NLS-1$
- System.out.println("SystemId: " + n.getSystemId()); //$NON-NLS-1$
-
-
- // Attributes
- // Vector lists = sc.scanAttlistDecl();
- // sc.printAttList(lists);
-
- // System.out.println("CM: " + sc.scanContentModel());
-
- } // main(String[])
-
- /**
- * Gets the errorString
- *
- * @return Returns a String
- */
- public String getErrorString() {
- return errorString;
- }
-
- /**
- * Sets the errorString
- *
- * @param errorString
- * The errorString to set
- */
- public void setErrorString(String errorString) {
- this.errorString = errorString;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java
deleted file mode 100644
index bb2306ae8e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java
+++ /dev/null
@@ -1,103 +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.dtd.core.internal.saxparser;
-
-public class DeclNode {
- static public final int INVALID = -1;
- static public final int ELEMENT = 1;
- static public final int ATTLIST = 2;
- static public final int ENTITY = 3;
- static public final int INTERNAL_ENTITY = 4;
- static public final int EXTERNAL_ENTITY = 5;
- static public final int INTERNAL_GENERAL_ENTITY = 6;
- static public final int INTERNAL_PARAMETER_ENTITY = 7;
- static public final int EXTERNAL_GENERAL_ENTITY = 8;
- static public final int EXTERNAL_PARAMETER_ENTITY = 9;
- static public final int PARAMETER_ENTITY_REFERENCE = 10;
- static public final int NOTATION = 11;
- static public final int COMMENT = 12;
-
- static public final int START_DTD = 21;
- static public final int END_DTD = 22;
- static public final int START_ENTITY_DTD = 23;
- static public final int END_ENTITY_DTD = 24;
- static public final int ERROR = 25;
-
- public int type = INVALID;
- private String declName = null;
- private String contentString = null;
- private String errorMessage = null;
- private String comment = null;
-
- //
- // Constants
- //
-
- /** Default constructor. */
- public DeclNode(int type) {
- this(null, type, null);
- }
-
- public DeclNode(String name, int type, String contentString) {
- this.declName = name;
- this.type = type;
- this.contentString = contentString;
- }
-
- public String getDeclName() {
- return declName;
- }
-
- public void setDeclName(String name) {
- declName = name;
- }
-
- public int getType() {
- return type;
- }
-
- public void setType(int type) {
- this.type = type;
- }
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String message) {
- errorMessage = message;
- }
-
- public String getContentString() {
- return contentString;
- }
-
- public void setContentString(String content) {
- this.contentString = content;
- }
-
- public String getComment() {
- return comment;
- }
-
- public void setComment(String comment) {
- this.comment = comment;
- }
-
- public String toString()
-
- {
- return "Node Name: " + declName + " Type: " + type + " ContentString: " + contentString; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java
deleted file mode 100644
index 1e5c77a66d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java
+++ /dev/null
@@ -1,33 +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.dtd.core.internal.saxparser;
-
-public class ElementDecl extends BaseNode {
- CMNode contentModelNode = null;
-
- public ElementDecl(String name, String ownerDTD) {
- this(name, ownerDTD, null, null);
- }
-
- public ElementDecl(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
- super(name, ownerDTD, comment, errorMessage);
- }
-
- public CMNode getContentModelNode() {
- return contentModelNode;
- }
-
- public void setContentModelNode(CMNode cmnode) {
- contentModelNode = cmnode;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java
deleted file mode 100644
index 668877daed..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java
+++ /dev/null
@@ -1,242 +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.dtd.core.internal.saxparser;
-
-public class EntityDecl extends BaseNode {
- boolean isParameter = false;
- String expandedValue = null; // Always <var>null</var> for external
- // Entities
- String value = null; // Always <var>null</var> for external Entities
- ExternalID externalID = null; // Always <var>null</var> for internal
- // Entities
- String ndata = null; // Always <var>null</var> for internal Entities
-
- boolean parsed = false;
- DTDParser dtd = null; // Always null, except when it has been parsed.
-
- boolean entityReferenced = false;
-
- /**
- * Constructor for internal Entities.
- *
- * @param name
- * Name of this Entity.
- * @param value
- * The XML-encoded value that was directly assigned to the
- * Entity.
- * @param isParameter
- * =true if a parameter Entity; otherwise =false.
- */
- public EntityDecl(String name, String ownerDTD, String value, boolean isParameter) {
- super(name, ownerDTD, null, null);
- this.value = value;
- this.isParameter = isParameter;
- }
-
- /**
- * Constructor for external Entities.
- *
- * @param name
- * Name of the Entity.
- * @param externalID
- * The reference(s) to the external entity to retrieve.
- * @param isParameter
- * =true if a parameter Entity; otherwise =false.
- * @param ndata
- * The notation associated with the binary Entity, or <var>null</var>
- * if the Entity is a text Entity.
- * @see sax.ExternalID
- */
- public EntityDecl(String name, String ownerDTD, ExternalID externalID, boolean isParameter, String ndata) {
- super(name, ownerDTD, null, null);
- this.externalID = externalID;
- this.isParameter = isParameter;
- this.ndata = ndata;
- }
-
- /**
- * Returns whether this Entity is a parameter Entity.
- *
- * @return =true if an internal parameter Entity; otherwise =false.
- */
- public boolean isParameter() {
- return this.isParameter;
- }
-
- /**
- * Returns the value of this Entity.
- *
- * @return The XML-encoded value that was directly assigned to the
- * internal Entity; otherwise, <var>null</var>.
- */
- public String getValue() {
- return this.value;
- }
-
- public boolean isEntityReferenced() {
- return entityReferenced;
- }
-
- public void setEntityReferenced(boolean reference) {
- entityReferenced = reference;
- }
-
-
- /**
- * Returns the system identifier of the Notation. A system identifier is a
- * URI, which may be used to retrieve an external entity's content.
- * <p>
- * This method is defined by DOM.
- *
- * @return The system identifier, or <var>null</var> if the identifier is
- * not defined.
- * @see org.eclipcse.wst.dtd.parser.ExternalID#getSystemLiteral
- */
- public String getSystemId() {
- if (externalID == null)
- return null;
- else
- return this.externalID.getSystemLiteral();
- }
-
- /**
- * Sets the system identifier of the Notation. A system identifier is a
- * URI, which may be used to retrieve an external entity's content.
- * <p>
- * This method is defined by DOM.
- *
- * @param systemIdentifier
- * The system identifier.
- * @see org.eclipcse.wst.dtd.parser.ExternalID
- */
- public void setSystemId(String systemIdentifier) {
- // System.out.println("setSYstemId - externalId: " + externalID);
- this.externalID = new ExternalID(this.externalID.getPubIdLiteral(), systemIdentifier);
- }
-
- /**
- * Returns the public identifier of the Notation. This value is only valid
- * if the identifier is defined as <var>public</var> (as opposed to
- * <var>system</var>). Public identifiers may be used to try to generate
- * an alternative URI in order to retrieve the an external entities
- * content. If retrieval fails using the public identifier, an attempt
- * must be made to retrieve content using the system identifier.
- * <p>
- * This method is defined by DOM.
- *
- * @return The public identifier, or <var>null</var> if the identifier is
- * not defined.
- * @see org.eclipcse.wst.dtd.parser.ExternalID
- */
- public String getPublicId() {
- if (externalID == null)
- return null;
- else
- return this.externalID.getPubIdLiteral();
- }
-
- /**
- * Sets the public identifier of the Notation. This value is only valid if
- * the identifier is defined as <var>public</var> (as opposed to
- * <var>system</var>). Public identifiers may be used to try to generate
- * an alternative URI in order to retrieve the an external entities
- * content. If retrieval fails using the public identifier, an attempt
- * must be made to retrieve content using the system identifier.
- * <p>
- * This method is defined by DOM.
- *
- * @param publicIdentifier
- * The public identifier.
- * @see #getPublicId
- * @see org.eclipcse.wst.dtd.parser.ExternalID
- */
- public void setPublicId(String publicIdentifier) {
- this.externalID = new ExternalID(publicIdentifier, this.externalID.getSystemLiteral());
- }
-
- /**
- * Returns the external ID of this Entity.
- *
- * @return The reference(s) to the external entity to retrieve; otherwise,
- * <var>null</var>.
- * @see org.eclipcse.wst.dtd.parser.ExternalID
- */
- public ExternalID getExternalID() {
- return this.externalID;
- }
-
- /**
- * Returns whether this entity value is external.
- *
- * @return =true if entity is external; otherwise, =false.
- * @see org.eclipcse.wst.dtd.parser.ExternalID
- */
- public boolean isExternal() {
- return this.externalID != null;
- }
-
- /**
- * Returns the notation associated with this Entity.
- *
- * @return The notation associated with the external binary Entity,
- * otherwise, <var>null</var>.
- */
- public String getNotation() {
- return this.ndata;
- }
-
- public void setNotation(String ndata) {
- this.ndata = ndata;
- }
-
- /**
- * Returns the notation associated with this Entity.
- * <p>
- * This method is defined by DOM.
- *
- * @return The notation associated with the external binary Entity,
- * otherwise, <var>null</var>.
- */
- public String getNotationName() {
- return this.ndata;
- }
-
- /**
- * <p>
- * This method is defined by DOM.
- *
- * public void setNotationName(String arg) { this.ndata = arg; }
- */
-
- /**
- * Returns whether there is a notation associated with this entity value.
- *
- * @return =true if the external binary entity contains a notation;
- * otherwise, =false.
- */
- public boolean isNotation() {
- return this.ndata != null;
- }
-
- public void setValue(String s) {
- this.value = s;
- }
-
- public void setParsed(boolean p) {
- this.parsed = p;
- }
-
- public boolean getParsed() {
- return this.parsed;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java
deleted file mode 100644
index 76bd1fef21..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java
+++ /dev/null
@@ -1,72 +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.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-public class EntityPool {
- private Hashtable m_entity = new Hashtable();
- private Hashtable m_para = new Hashtable(); // parameter references
-
- public EntityPool() {
- }
-
- public boolean add(EntityDecl entity) {
- String name = entity.getNodeName();
- if (entity.isParameter()) {
- if (m_para.containsKey(name))
- return false;
- m_para.put(name, entity);
- }
- else {
- if (m_entity.containsKey(name))
- return false;
- m_entity.put(name, entity);
- }
- return true;
- }
-
- public EntityDecl refer(String name) {
- return (EntityDecl) m_entity.get(name);
- }
-
- public EntityDecl referPara(String name) {
- return (EntityDecl) m_para.get(name);
- }
-
- /**
- * Return an <CODE>Enumeration</CODE> of <CODE>EntityDecl</CODE>.
- *
- * @see org.eclipcse.wst.dtd.parser.EntityDecl
- */
- public Enumeration elements() {
- return m_entity.elements();
- }
-
- /**
- * Return an <CODE>Enumeration</CODE> of <CODE>EntityDecl</CODE> for
- * parameter entities.
- *
- * @see org.eclipcse.wst.dtd.parser.EntityDecl
- */
- public Enumeration parameterEntityElements() {
- return m_para.elements();
- }
-
- /**
- * For DTD#getEntities();
- */
- Hashtable getEntityHash() {
- return this.m_entity;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java
deleted file mode 100644
index 60123400ca..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java
+++ /dev/null
@@ -1,114 +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.dtd.core.internal.saxparser;
-
-
-
-public class ErrorMessage {
- private int errorLine, errorColumn, severity;
- private String errorString;
-
-
- public ErrorMessage() {
- }
-
- public void setErrorMessage(String error) {
- errorString = error;
- }
-
- public void setSeverity(int severity) {
- this.severity = severity;
- }
-
- public void setSeverity(String severity) {
- if (severity == "warning") { //$NON-NLS-1$
- this.severity = 0;
- }
- else if (severity == "error") { //$NON-NLS-1$
- this.severity = 1;
- }
- else if (severity == "fatal") { //$NON-NLS-1$
- this.severity = 2;
- }
- }
-
- public void setErrorLine(int line) {
- errorLine = line;
- }
-
- public void setErrorColumn(int column) {
- errorColumn = column;
- }
-
- public String getErrorMessage() {
- return errorString;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- public int getErrorLine() {
- return errorLine;
- }
-
- public int getErrorColumn() {
- return errorColumn;
- }
-
- private int startOffset = -1;
-
- public void setErrorStartOffset(int start) {
- startOffset = start;
- }
-
- public int getErrorStartOffset() {
- return startOffset;
- }
-
- private int endOffset = -1;
-
- public void setErrorEndOffset(int end) {
- endOffset = end;
- }
-
- public int getErrorEndOffset() {
- return endOffset;
- }
-
-
- Object object;
-
- /**
- * Get the value of the closest object to the error.
- *
- * @return value of object.
- */
- public Object getObject() {
- return object;
- }
-
- /**
- * Set the value of closest object to the error.
- *
- * @param v
- * Value to assign to object.
- */
- public void setObject(Object v) {
- this.object = v;
- }
-
-
- public void addNewErrorMessageLine(String newLine) {
- errorString += "\n" + newLine; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java
deleted file mode 100644
index 1eb009d3a4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java
+++ /dev/null
@@ -1,154 +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.dtd.core.internal.saxparser;
-
-public class ExternalID {
- private static final int T_SYSTEM = 0;
- private static final int T_PUBLIC = 1;
-
- int type = T_PUBLIC;
- String publicID = null;
- String systemID = null;
-
- /**
- * Constructor for system IDs.
- *
- * @param systemID
- * URI, which may be used to retrieve an external entity's
- * content.
- */
- public ExternalID(String systemID) {
- this.type = T_SYSTEM;
- this.publicID = null;
- this.systemID = systemID;
- }
-
- /**
- * Constructor for public and system IDs.
- *
- * @param publicID
- * Identifier to be used to try to generate an alternative URI
- * in order to retrieve the external entity's content, or
- * <var>null</var> if a system identitier is to be
- * constructed.
- * @param systemID
- * URI, which may be used to retrieve an external entity's
- * content.
- */
- public ExternalID(String publicID, String systemID) {
- this.type = T_PUBLIC;
- this.publicID = publicID;
- this.systemID = systemID;
- if (null == this.publicID)
- this.type = T_SYSTEM;
- }
-
- /**
- * Returns if this external ID is a system ID (or public ID).
- *
- * @return System ID=true, Public ID=false.
- * @see #isPublic
- */
- public boolean isSystem() {
- return this.type == T_SYSTEM;
- }
-
- /**
- * Returns if this external ID is a public ID (or system ID).
- *
- * @return Public ID=true, System ID=false.
- * @see #isSystem
- */
- public boolean isPublic() {
- return this.type == T_PUBLIC;
- }
-
- /**
- * Returns the system identifier of this external ID. A system identifier
- * is a URI, which may be used to retrieve an external entity's content.
- *
- * @return The system identifier, or <var>null</var> if the identifier is
- * not defined.
- * @see #getPubidLiteral
- */
- public String getSystemLiteral() {
- return this.systemID;
- }
-
- /**
- * Returns the public identifier of this external ID. This value is only
- * valid if the identifier is defined as <var>public</var> (as opposed to
- * <var>system</var>). Public identifiers may be used to try to generate
- * an alternative URI in order to retrieve an external entity's content.
- * If retrieval fails using the public identifier, an attempt must be made
- * to retrieve content using the system identifier.
- *
- * @return The public identifier, or <var>null</var> if the identifier is
- * not defined.
- * @see #getSystemLiteral
- */
- public String getPubIdLiteral() {
- return this.publicID;
- }
-
- /**
- * Returns this external ID in the format it was declared: <CODE>SYSTEM
- * &quot;<VAR>systemID</VAR>&quot;</CODE> or <CODE>PUBLIC &quot;<VAR>publicID</VAR>&quot;
- * &quot;<VAR>systemID</VAR>&quot;</CODE>.
- *
- * @return XML string representing the content of the external ID (never
- * <var>null</var>).
- */
- public String toString() {
- String ret;
- if (isSystem()) {
- ret = "SYSTEM \"" + getSystemLiteral() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (null != getSystemLiteral()) {
- ret = "PUBLIC \"" + getPubIdLiteral() + "\" \"" + getSystemLiteral() + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- else {
- ret = "PUBLIC \"" + getPubIdLiteral() + "\""; // for NOTATION //$NON-NLS-1$ //$NON-NLS-2$
- }
- return ret;
- }
-
- /**
- *
- */
- public boolean equals(Object obj) {
- if (obj == null)
- return false;
- if (!(obj instanceof ExternalID))
- return false;
- ExternalID eid = (ExternalID) obj;
- if (!((eid.publicID == null && this.publicID == null) || eid.publicID != null && eid.publicID.equals(this.publicID)))
- return false;
- if (!((eid.systemID == null && this.systemID == null) || eid.systemID != null && eid.systemID.equals(this.systemID)))
- return false;
- return true;
- }
-
-
- /**
- *
- */
- public int hashCode() {
- int retval = 0;
- if (publicID != null)
- retval = publicID.hashCode();
- if (systemID != null)
- retval += systemID.hashCode();
- return retval;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java
deleted file mode 100644
index d915801b48..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java
+++ /dev/null
@@ -1,77 +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.dtd.core.internal.saxparser;
-
-/**
- * Notations are how the Document Type Description (DTD) records hints about
- * the format of an XML "unparsed entity" -- in other words, non-XML data
- * bound to this document type, which some applications may wish to consult
- * when manipulating the document. A Notation represents a name-value pair,
- * with its nodeName being set to the declared name of the notation.
- */
-public class NotationDecl extends BaseNode {
- /** Public identifier. */
- protected String publicId = null;
-
- /** System identifier. */
- protected String systemId = null;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public NotationDecl(String name, String ownerDTD) {
- super(name, ownerDTD);
- }
-
- //
- // Notation methods
- //
-
- /**
- * The Public Identifier for this Notation. If no public identifier was
- * specified, this will be null.
- */
- public String getPublicId() {
- return publicId;
- } // getPublicId():String
-
- /**
- * The System Identifier for this Notation. If no system identifier was
- * specified, this will be null.
- */
- public String getSystemId() {
- return systemId;
- } // getSystemId():String
-
- //
- // Public methods
- //
-
- /**
- * NON-DOM: The Public Identifier for this Notation. If no public
- * identifier was specified, this will be null.
- */
- public void setPublicId(String id) {
- publicId = id;
- } // setPublicId(String)
-
- /**
- * NON-DOM: The System Identifier for this Notation. If no system
- * identifier was specified, this will be null.
- */
- public void setSystemId(String id) {
- systemId = id;
- } // setSystemId(String)
-
-} // class NotationImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java
deleted file mode 100644
index 799b74beb8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-/**
- * Reader for processing/parsing xml string
- *
- * @version
- */
-public class StringParser {
- String fData = null;
- int fEndOffset;
- int fMostRecentChar;
- int fCurrentOffset;
- boolean fCalledCharPropInit = false;
-
- public StringParser(String data) {
- fData = data;
- fCurrentOffset = 0;
- fEndOffset = fData.length();
- fMostRecentChar = fEndOffset == 0 ? -1 : fData.charAt(0);
- }
-
- public String getString(int offset, int length) {
- if (length == 0)
- return ""; //$NON-NLS-1$
- return fData.substring(offset, offset + length);
- }
-
- public String getData() {
- return fData;
- }
-
- public String getRemainingString() {
- return fData.substring(getCurrentOffset());
- }
-
- public int getCurrentOffset() {
- return fCurrentOffset;
- }
-
- //
- //
- public int loadNextChar() {
- if (++fCurrentOffset >= fEndOffset) {
- fMostRecentChar = -1;
- }
- else {
- fMostRecentChar = fData.charAt(fCurrentOffset);
- }
- return fMostRecentChar;
- }
-
- public int loadPreviousChar() {
- if (--fCurrentOffset < 0)
- fMostRecentChar = -1;
- else
- fMostRecentChar = fData.charAt(fCurrentOffset);
- return fMostRecentChar;
- }
-
- //
- //
- public boolean lookingAtChar(char chr, boolean skipPastChar) {
- int ch = fMostRecentChar;
- if (ch != chr) {
- return false;
- }
- if (skipPastChar) {
- if (++fCurrentOffset >= fEndOffset) {
- fMostRecentChar = -1;
- }
- else {
- fMostRecentChar = fData.charAt(fCurrentOffset);
- }
- }
- return true;
- }
-
- //
- //
- //
- public boolean lookingAtValidChar(boolean skipPastChar) {
- int ch = fMostRecentChar;
- if (ch < 0xD800) {
- if (ch < 0x20 && ch != 0x09 && ch != 0x0A && ch != 0x0D) {
- return false;
- }
- if (skipPastChar) {
- if (++fCurrentOffset >= fEndOffset) {
- fMostRecentChar = -1;
- }
- else {
- fMostRecentChar = fData.charAt(fCurrentOffset);
- }
- }
- return true;
- }
- if (ch > 0xFFFD) {
- return false;
- }
- if (ch < 0xDC00) {
- if (fCurrentOffset + 1 >= fEndOffset) {
- return false;
- }
- ch = fData.charAt(fCurrentOffset + 1);
- if (ch < 0xDC00 || ch >= 0xE000) {
- return false;
- }
- else if (!skipPastChar) {
- return true;
- }
- else {
- fCurrentOffset++;
- }
- }
- else if (ch < 0xE000) {
- return false;
- }
- if (skipPastChar) {
- if (++fCurrentOffset >= fEndOffset) {
- fMostRecentChar = -1;
- }
- else {
- fMostRecentChar = fData.charAt(fCurrentOffset);
- }
- }
- return true;
- }
-
- //
- //
- //
- public boolean lookingAtSpace(boolean skipPastChar) {
- int ch = fMostRecentChar;
- if (ch > 0x20)
- return false;
- if (ch == 0x20 || ch == 0x0A || ch == 0x0D || ch == 0x09) {
- if (skipPastChar) {
- loadNextChar();
- }
- return true;
- }
- return false;
- }
-
- //
- //
- //
- public void skipToChar(char chr, boolean skipPastChar) {
- //
- // REVISIT - this will skip invalid characters without reporting them.
- //
- int ch = fMostRecentChar;
- while (true) {
- if (ch == chr) {
- if (skipPastChar) {
- loadNextChar();
- }
- return;
- }
- if (ch == -1) {
- return;
- }
- ch = loadNextChar();
- }
- }
-
- /**
- * skips to the last occurrence of the specified character.
- * if <code>skipPastChar</code> is true, the parser is
- * incremented past the last occurrence of the character.
- * This method starts at the end of the character data, and
- * moves backwards to find the last occurrence of the character
- */
- public void skipToLastOfChar(char chr, boolean skipPastChar) {
- int ch = -1;
-
- // Move the cursor to the end offset to scan backwards.
- fCurrentOffset = fEndOffset;
-
- do {
- ch = loadPreviousChar();
-
- if(ch == -1)
- return;
-
- if (ch == chr) {
- if(skipPastChar)
- loadNextChar();
- return;
- }
-
- } while(true);
- }
-
- //
- //
- //
- public void skipPastSpaces() {
- int ch = fMostRecentChar;
- if (ch == -1) {
- // changeReaders().skipPastSpaces();
- return;
- }
- while (true) {
- if (ch > 0x20 || (ch != 0x20 && ch != 0x0A && ch != 0x09 && ch != 0x0D)) {
- fMostRecentChar = ch;
- return;
- }
- if (++fCurrentOffset >= fEndOffset) {
- return;
- }
- ch = fData.charAt(fCurrentOffset);
- }
- }
-
- //
- //
- //
-
- public void skipPastNameAndPEReference(char fastcheck) {
- int ch = fMostRecentChar;
-
- if (ch != '%') {
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
- return;
- }
- }
- while (true) {
- ch = loadNextChar();
- if (fastcheck == ch)
- return;
- if (ch == '%' || ch == ';') {
- continue;
- }
-
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
- return;
- }
- }
- }
-
- public void skipPastName(char fastcheck) {
- int ch = fMostRecentChar;
- // System.out.println("skippastName ch: " +ch);
-
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
- return;
- }
-
- while (true) {
- ch = loadNextChar();
- if (fastcheck == ch)
- return;
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
- return;
- }
- }
- }
-
- //
- //
- //
-
- public void skipPastNmtoken(char fastcheck) {
- int ch = fMostRecentChar;
- while (true) {
- if (fastcheck == ch)
- return;
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
- return;
- }
- ch = loadNextChar();
- }
- }
-
- public void skipPastNmtokenAndPEReference(char fastcheck) {
- int ch = fMostRecentChar;
- while (true) {
- if (fastcheck == ch)
- return;
- if (ch == '%' || ch == ';') {
- ch = loadNextChar();
- continue;
- }
- if (ch < 0x80) {
- if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
- return;
- }
- else {
- if (!fCalledCharPropInit) {
- XMLCharacterProperties.initCharFlags();
- fCalledCharPropInit = true;
- }
- if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
- return;
- }
- ch = loadNextChar();
- }
- }
-
- //
- //
- //
- public boolean skippedString(char[] s) {
- int ch = fMostRecentChar;
- if (ch != s[0]) {
- return false;
- }
- if (fCurrentOffset + s.length > fEndOffset)
- return false;
- for (int i = 1; i < s.length; i++) {
- if (fData.charAt(fCurrentOffset + i) != s[i])
- return false;
- }
- fCurrentOffset += (s.length - 1);
- loadNextChar();
- return true;
- }
-
- //
- //
- //
- public int scanInvalidChar() throws Exception {
- int ch = fMostRecentChar;
- loadNextChar();
- return ch;
- }
-
- //
- //
- //
- /*
- * public int scanCharRef(boolean hex) throws Exception { int ch =
- * fMostRecentChar; if (ch == -1) // return
- * changeReaders().scanCharRef(hex); return ch; int num = 0; if (hex) { if
- * (ch > 'f' || XMLCharacterProperties.fgAsciiXDigitChar[ch] == 0) return
- * XMLEntityHandler.CHARREF_RESULT_INVALID_CHAR; num = ch - (ch < 'A' ?
- * '0' : (ch < 'a' ? 'A' : 'a') - 10); } else { if (ch < '0' || ch > '9')
- * return XMLEntityHandler.CHARREF_RESULT_INVALID_CHAR; num = ch - '0'; }
- * boolean toobig = false; while (true) { ch = loadNextChar(); if (ch ==
- * -1) return XMLEntityHandler.CHARREF_RESULT_SEMICOLON_REQUIRED; if (hex) {
- * if (ch > 'f' || XMLCharacterProperties.fgAsciiXDigitChar[ch] == 0)
- * break; } else { if (ch < '0' || ch > '9') break; } if (hex) { int dig =
- * ch - (ch < 'A' ? '0' : (ch < 'a' ? 'A' : 'a') - 10); num = (num << 4) +
- * dig; } else { int dig = ch - '0'; num = (num * 10) + dig; } if (num >
- * 0x10FFFF) { toobig = true; num = 0; } } if (ch != ';') return
- * XMLEntityHandler.CHARREF_RESULT_SEMICOLON_REQUIRED; loadNextChar(); if
- * (toobig) return XMLEntityHandler.CHARREF_RESULT_OUT_OF_RANGE; return
- * num; }
- */
- //
- //
- //
- /*
- * public int scanStringLiteral() throws Exception { boolean single; if
- * (!(single = lookingAtChar('\'', true)) && !lookingAtChar('\"', true)) {
- * return XMLEntityHandler.STRINGLIT_RESULT_QUOTE_REQUIRED; } int offset =
- * fCurrentOffset; char qchar = single ? '\'' : '\"'; while
- * (!lookingAtChar(qchar, false)) { if (!lookingAtValidChar(true)) {
- * return XMLEntityHandler.STRINGLIT_RESULT_INVALID_CHAR; } } // int
- * stringIndex = addString(offset, fCurrentOffset - offset); int
- * stringIndex = addString(offset, fCurrentOffset - offset);
- * lookingAtChar(qchar, true); // move past qchar return stringIndex; }
- */
-
- //
- //
- public boolean scanAttValue(char qchar) {
- boolean result = true;
- while (true) {
- if (lookingAtChar(qchar, false)) {
- break;
- }
- if (lookingAtChar(' ', true)) {
- continue;
- }
- if (!lookingAtValidChar(true)) {
- result = false;
- }
- }
- lookingAtChar(qchar, true);
- return result;
- }
-
- //
- // [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
- // | "'" ([^%&'] | PEReference | Reference)* "'"
- //
- // The values in the following table are defined as:
- //
- // 0 - not special
- // 1 - quote character
- // 2 - reference
- // 3 - peref
- // 4 - invalid
- //
- public static final byte fgAsciiEntityValueChar[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 1, 0, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, // '\"',
- // '%',
- // '&',
- // '\''
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- /*
- * public int scanEntityValue(int qchar, boolean createString) throws
- * Exception { int offset = fCurrentOffset; int ch = fMostRecentChar;
- * while (true) { if (ch == -1) { changeReaders(); // do not call next
- * reader, our caller may need to change the parameters return
- * XMLEntityHandler.ENTITYVALUE_RESULT_END_OF_INPUT; } if (ch < 0x80) {
- * switch (fgAsciiEntityValueChar[ch]) { case 1: // quote char if (ch ==
- * qchar) { if (!createString) return
- * XMLEntityHandler.ENTITYVALUE_RESULT_FINISHED; int length =
- * fCurrentOffset - offset; int result = length == 0 ?
- * StringPool.EMPTY_STRING : addString(offset, length); loadNextChar();
- * return result; } // the other quote character is not special // fall
- * through case 0: // non-special char if (++fCurrentOffset >= fEndOffset) {
- * if (oweTrailingSpace) { oweTrailingSpace = false; ch = fMostRecentChar = ' '; }
- * else { ch = fMostRecentChar = -1; } } else { ch = fMostRecentChar =
- * fData.charAt(fCurrentOffset); } continue; case 2: // reference return
- * XMLEntityHandler.ENTITYVALUE_RESULT_REFERENCE; case 3: // peref return
- * XMLEntityHandler.ENTITYVALUE_RESULT_PEREF; case 4: // invalid return
- * XMLEntityHandler.ENTITYVALUE_RESULT_INVALID_CHAR; } } else if (ch <
- * 0xD800) { ch = loadNextChar(); } else if (ch >= 0xE000 && (ch <= 0xFFFD ||
- * (ch >= 0x10000 && ch <= 0x10FFFF))) { // // REVISIT - needs more code
- * to check surrogates. // ch = loadNextChar(); } else { return
- * XMLEntityHandler.ENTITYVALUE_RESULT_INVALID_CHAR; } } }
- */
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java
deleted file mode 100644
index 4b12e8981d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java
+++ /dev/null
@@ -1,350 +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.dtd.core.internal.saxparser;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * This class provides static methods for some of the very used IString
- * operations
- */
-
-public class TString {
- private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$
- private static final String ALPHANUMERIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //$NON-NLS-1$
- private static final String NUMERIC = "0123456789"; //$NON-NLS-1$
-
- // change all occurrences of oldPat to newPat
- public static String change(String in, String oldPat, String newPat) {
- if (oldPat.length() == 0)
- return in;
- if (oldPat.length() == 1 && newPat.length() == 1)
- return in.replace(oldPat.charAt(0), newPat.charAt(0));
-
- int lastIndex = 0;
- int newIndex = 0;
- StringBuffer newString = new StringBuffer();
- for (;;) {
- newIndex = in.indexOf(oldPat, lastIndex);
- if (newIndex != -1) {
- newString.append(in.substring(lastIndex, newIndex) + newPat);
- lastIndex = newIndex + oldPat.length();
- }
- else {
- newString.append(in.substring(lastIndex));
- break;
- }
- }
- return newString.toString();
- }
-
- // change the occurrences of oldPat to newPat starting at startPosition
- // for number of numChanges
- // Note: the 1st char in the string has position of 0
-
- public static String change(String in, String oldPat, String newPat, int startPos, int numChanges) {
- if (oldPat.length() == 0)
- return in;
- if (oldPat.length() == 1 && newPat.length() == 1)
- return in.replace(oldPat.charAt(0), newPat.charAt(0));
-
- int inLen = in.length();
-
- if (startPos >= inLen)
- return in;
-
- int lastIndex = startPos;
- int newIndex = 0;
- int countChanges = 0;
-
-
- StringBuffer newString = new StringBuffer();
-
- for (;;) {
- newIndex = in.indexOf(oldPat, lastIndex);
- if (newIndex != -1) {
- newString.append(in.substring(lastIndex, newIndex) + newPat);
- lastIndex = newIndex + oldPat.length();
- countChanges++;
- }
- else {
- newString.append(in.substring(lastIndex));
- break;
- }
-
- if (countChanges == numChanges) {
- newString.append(in.substring(lastIndex));
- break;
- }
- }
-
- return newString.toString();
- }
-
- public static String word(String in, int i) {
- StringTokenizer st = new StringTokenizer(in);
- if (i <= 0 || i > st.countTokens())
- return ""; //$NON-NLS-1$
- else {
- String ret = new String();
- while (st.hasMoreTokens()) {
- ret = st.nextToken();
- if (--i == 0)
- return ret;
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- public static String words(String in, int i) {
- StringTokenizer st = new StringTokenizer(in);
- if (i <= 0 || i > st.countTokens())
- return ""; //$NON-NLS-1$
- else {
- while (st.hasMoreTokens()) {
- if (--i == 0)
- break;
- st.nextToken();
- }
- if (st.hasMoreTokens())
- return st.nextToken(""); //$NON-NLS-1$
- else
- return ""; //$NON-NLS-1$
- }
- }
-
- public static String appendSpaces(String in, int len) {
- if (len < 1)
- return in;
-
- StringBuffer sb = new StringBuffer(in);
- for (int i = 0; i < len; i++) {
- sb.append(" "); //$NON-NLS-1$
- }
- return sb.toString();
- }
-
- public static int numWords(String in) {
- StringTokenizer st = new StringTokenizer(in);
- return st.countTokens();
- }
-
- // return the first index within srcString that is not in the validString
- // example:
- // srcString = "abcdefg"
- // validString = "bcfg"
- // return = 0 (i.e. char a is not in "bcfg") - 1st index = 0
-
- public static int indexOfAnyBut(String srcString, String validString) {
- int result = -1;
- int srcLen = srcString.length();
-
- // walk backward to find if a char within srcString is in validString
- for (int i = 0; i < srcLen; i++) {
- // not found, stop it
- if (validString.indexOf(srcString.charAt(i)) == -1) {
- result = i;
- break;
- }
-
- }
-
- return result;
- }
-
- // return the last index within srcString that is not in the validString
- // example:
- // srcString = "abcdefg"
- // validString = "bcfg"
- // return = 4 (i.e. char e is not in "bcfg") - 1st index = 0
-
- public static int lastIndexOfAnyBut(String srcString, String validString) {
- int result = -1;
- int srcLen = srcString.length();
-
- // walk backward to find if a char within srcString is in validString
- for (int i = srcLen - 1; i >= 0; i--) {
- // not found, stop it
- if (validString.indexOf(srcString.charAt(i)) == -1) {
- result = i;
- break;
- }
-
- }
-
- return result;
- }
-
- // return number of occurrences of searchChar within srcString
- // example:
- // srcString = "::f::f::g"
- // seachrChar = ':'
- // return = 6
-
- public static int occurrenceOf(String srcString, char searchChar) {
- int result = 0;
- // walk backward to find if a char within srcString is in validString
- if (srcString.length() > 0) {
-
- for (int i = 0; i < srcString.length(); i++) {
- // found, increment the count
- if (searchChar == srcString.charAt(i))
- result++;
- }
- }
-
- return result;
- }
-
- // strip the leading pString in the srcString
- // example:
- // srcString = "::f::f::g"
- // pString "::"
- // return = "f::f::g"
-
- public static String stripLeading(String srcString, String pString) {
- String result;
-
- if (srcString.startsWith(pString)) // leading patString found
- result = srcString.substring(pString.length(), srcString.length());
- else
- // not found
- result = srcString;
-
- return result;
- }
-
- // strip the trailing pString in the srcString
- // example:
- // srcString = "f::f::g::"
- // pString "::"
- // return = "f::f::g"
-
- public static String stripTrailing(String srcString, String pString) {
- String result;
-
- if (srcString.endsWith(pString)) // leading patString found
- result = srcString.substring(0, srcString.lastIndexOf(pString));
- else
- // not found
- result = srcString;
-
- return result;
- }
-
- /**
- * strip the trailing blanks in the src
- */
- public static String stripTrailingBlanks(String src) {
-
- if (src != null) {
- while (src.length() > 0) {
- if (src.endsWith(" ")) //$NON-NLS-1$
- src = src.substring(0, src.length() - 1);
- else
- break;
- }
- }
-
- return src;
- }
-
-
-
- // return a string that contains number of copies of srcString
- // example:
- // srcString = "abc"
- // numberOfCopies = 2
- // return string = "abcabc"
-
- public static String copy(String srcString, int numberOfCopies) {
- StringBuffer result = new StringBuffer();
-
- if (numberOfCopies > 0) {
- for (int i = 1; i <= numberOfCopies; i++)
- result.append(srcString);
- }
- else
- result = new StringBuffer(srcString);
-
- return result.toString();
- }
-
- //
- // return true if all chars in srcString are in {a...z} or {A...Z}
-
- public static boolean isAlphabetic(String srcString) {
- return (lastIndexOfAnyBut(srcString, ALPHABET) == -1);
- }
-
- //
- // return true if all chars in srcString are in {a...z,} or {A...Z}
- // {0...9}
-
- public static boolean isAlphanumeric(String srcString) {
- return (lastIndexOfAnyBut(srcString, ALPHANUMERIC) == -1);
- }
-
-
- //
- // return true if all chars are in '0' - '9'
-
- public static boolean isDigits(String srcString) {
- return (lastIndexOfAnyBut(srcString, NUMERIC) == -1);
- }
-
-
- public static boolean isEmptyOrNull(String string) {
- return string == null || string.length() == 0;
- }
-
-
- //
- // return the string after the matching token is removed
- public static String match(String in, String token) throws Exception {
- if (in == null)
- return null;
-
- in = in.trim();
- if (in.startsWith(token))
- return in.substring(token.length(), in.length());
- else
- throw new Exception("Expected: " + token + " but got:" + word(in, 1)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public static long getLong(String str) {
- try {
- return Long.parseLong(str);
- }
- catch (Exception m) {
- return 0;
- }
- }
-
- // return true if the " " appears within srcString
- // example:
- // srcString = "a m"
- // return = true
-
- public static boolean containsDoubleBlanks(String srcString) {
- String bb = " "; //$NON-NLS-1$
- char b = bb.charAt(0);
-
- if (srcString.length() > 0) {
- for (int i = 0; i < (srcString.length() - 1); i++) {
- if ((b == srcString.charAt(i)) & (b == srcString.charAt(i + 1)))
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java
deleted file mode 100644
index 1c38034081..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java
+++ /dev/null
@@ -1,448 +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.dtd.core.internal.saxparser;
-
-/**
- * A class representing properties of characters according to various W3C
- * recommendations
- *
- * XMLCharacterProperties provides convenience methods for commonly used
- * character tests.
- *
- * For performance reasons, the tables used by the convenience methods are
- * also public, and are directly accessed by performance critical routines.
- *
- */
-
-public final class XMLCharacterProperties {
- /*
- * [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
- *
- * Note: This is the same as the ascii portion of the NameChar definition.
- */
- /**
- * Check to see if a string is a valid version string according to [26] in
- * the XML 1.0 Recommendation
- *
- * @param version
- * string to check
- * @return true if version is a valid version string
- */
- public static boolean validVersionNum(String version) {
- if (version.length() == 0)
- return false;
- for (int i = 0; i < version.length(); i++) {
- char ch = version.charAt(i);
- if (ch > 'z' || fgAsciiNameChar[ch] == 0)
- return false;
- }
- return true;
- }
-
- /*
- * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- */
- /**
- * Check to see if a string is a valid encoding name according to [81] in
- * the XML 1.0 Recommendation
- *
- * @param encoding
- * string to check
- * @return true if encoding is a valid encoding name
- */
- public static boolean validEncName(String encoding) {
- if (encoding.length() == 0)
- return false;
- char ch = encoding.charAt(0);
- if (ch > 'z' || fgAsciiAlphaChar[ch] == 0)
- return false;
- for (int i = 1; i < encoding.length(); i++) {
- ch = encoding.charAt(i);
- if (ch > 'z' || fgAsciiEncNameChar[ch] == 0)
- return false;
- }
- return true;
- }
-
- /*
- * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] |
- * [-'()+,./:=?;!*#@$_%]
- */
- /**
- * Check to see if a string is a valid public identifier according to [13]
- * in the XML 1.0 Recommendation
- *
- * @param publicId
- * string to check
- * @return true if publicId is a valid public identifier
- */
- public static int validPublicId(String publicId) {
- if (publicId.length() == 0)
- return -1;
- for (int i = 0; i < publicId.length(); i++) {
- char ch = publicId.charAt(i);
- if (ch > 'z' || fgAsciiPubidChar[ch] == 0)
- return i;
- }
- return -1;
- }
-
- /*
- * [5] Name ::= (Letter | '_' | ':') (NameChar)*
- */
- /**
- * Check to see if a string is a valid Name according to [5] in the XML
- * 1.0 Recommendation
- *
- * @param name
- * string to check
- * @return true if name is a valid Name
- */
- public static boolean validName(String name) {
- XMLCharacterProperties.initCharFlags();
- if (name.length() == 0)
- return false;
- char ch = name.charAt(0);
- if (ch > 'z') {
- if ((fgCharFlags[ch] & E_InitialNameCharFlag) == 0)
- return false;
- }
- else if (fgAsciiInitialNameChar[ch] == 0)
- return false;
- for (int i = 1; i < name.length(); i++) {
- ch = name.charAt(i);
- if (ch > 'z') {
- if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
- return false;
- }
- else if (fgAsciiNameChar[ch] == 0)
- return false;
- }
- return true;
- }
-
- /*
- * from the namespace rec [5] NCName ::= (Letter | '_' | ':')
- * (NameNCChar)*
- */
- /**
- * Check to see if a string is a valid NCName according to [5] from the
- * XML Namespaces 1.0 Recommendation
- *
- * @param name
- * string to check
- * @return true if name is a valid NCName
- */
- public static boolean validNCName(String name) {
- XMLCharacterProperties.initCharFlags();
- if (name.length() == 0)
- return false;
- char ch = name.charAt(0);
- if (ch > 'z') {
- if ((fgCharFlags[ch] & E_InitialNameCharFlag) == 0)
- return false;
- }
- else if (fgAsciiInitialNCNameChar[ch] == 0)
- return false;
- for (int i = 1; i < name.length(); i++) {
- ch = name.charAt(i);
- if (ch > 'z') {
- if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
- return false;
- }
- else if (fgAsciiNCNameChar[ch] == 0)
- return false;
- }
- return true;
- }
-
-
- /*
- * [7] Nmtoken ::= (NameChar)+
- */
- /**
- * Check to see if a string is a valid Nmtoken according to [7] in the XML
- * 1.0 Recommendation
- *
- * @param nmtoken
- * string to checj
- * @return true if nmtoken is a valid Nmtoken
- */
- public static boolean validNmtoken(String nmtoken) {
- XMLCharacterProperties.initCharFlags();
- if (nmtoken.length() == 0)
- return false;
- for (int i = 0; i < nmtoken.length(); i++) {
- char ch = nmtoken.charAt(i);
- if (ch > 'z') {
- if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
- return false;
- }
- else if (fgAsciiNameChar[ch] == 0) {
- return false;
- }
- }
- return true;
- }
-
- /*
- * Here are tables used to build character properties.
- */
- public static final byte fgAsciiXDigitChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0'
- // -
- // '9'
- 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 'A' - 'F'
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 'a'
- // -
- // 'f'
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final byte fgAsciiAlphaChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A'
- // -
- // 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // 'P' - 'Z'
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiEncNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
- // is
- // 0x2D
- // and
- // '.'
- // is
- // 0x2E
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0' - '9'
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiPubidChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // ' ',
- // '!',
- // '#',
- // '$',
- // '%',
- // '\'', '(', ')', '*', '+', ',', '-', '.', '/'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, // '0' - '9',
- // ':', ';',
- // '=', '?'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // '@', 'A' -
- // 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiInitialNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, // ':'
- // is
- // 0x3A
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
- // is
- // 0x2D
- // and
- // '.'
- // is
- // 0x2E
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // '0' - '9'
- // and ':' is
- // 0x3A
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiInitialNCNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ':'
- // is
- // 0x3A
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiNCNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
- // is
- // 0x2D
- // and
- // '.'
- // is
- // 0x2E
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0' - '9'
- // and ':' is
- // 0x3A
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
- // and '_' is
- // 0x5F
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
- };
- public static final byte fgAsciiCharData[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, // tab
- // is
- // 0x09
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, // '&'
- // is
- // 0x26
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, // '<' is 0x3C
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, // ']'
- // is
- // 0x5D
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final byte fgAsciiWSCharData[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 4, 4, // tab
- // is
- // 0x09,
- // LF
- // is
- // 0x0A,
- // CR
- // is
- // 0x0D
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ' '
- // is
- // 0x20,
- // '&'
- // is
- // 0x26
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, // '<' is 0x3C
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, // ']'
- // is
- // 0x5D
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final byte E_CharDataFlag = 1 << 0;
- public static final byte E_InitialNameCharFlag = 1 << 1;
- public static final byte E_NameCharFlag = 1 << 2;
- public static byte[] fgCharFlags = null;
-
- public static synchronized void initCharFlags() {
- if (fgCharFlags == null) {
- fgCharFlags = new byte[0x10000];
- setFlagForRange(fgCharDataRanges, E_CharDataFlag);
- setFlagForRange(fgInitialNameCharRanges, (byte) (E_InitialNameCharFlag | E_NameCharFlag));
- setFlagForRange(fgNameCharRanges, E_NameCharFlag);
- }
- }
-
- private static void setFlagForRange(char[] ranges, byte flag) {
- int i;
- int ch;
- for (i = 0; (ch = ranges[i]) != 0; i += 2) {
- int endch = ranges[i + 1];
- while (ch <= endch)
- fgCharFlags[ch++] |= flag;
- }
- for (i++; (ch = ranges[i]) != 0; i++)
- fgCharFlags[ch] |= flag;
- }
-
- /*
- * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] // any Unicode character,
- * excluding the | [#xE000-#xFFFD] | [#x10000-#x10FFFF] // surrogate
- * blocks, FFFE, and FFFF. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
- *
- * We will use Char - ( [^<&] | ']' | #xA | #xD ) and handle the special
- * cases inline.
- */
- private static final char fgCharDataRanges[] = {0x0020, 0x0025, // '&' is
- // 0x0026
- 0x0027, 0x003B, // '<' is 0x003C
- 0x003D, 0x005C, // ']' is 0x005D
- 0x005E, 0xD7FF, 0xE000, 0xFFFD, 0x0000, 0x0009, // tab
- 0x0000};
- /*
- * [5] Name ::= (Letter | '_' | ':') (NameChar)* [4] NameChar ::= Letter |
- * Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [84] Letter
- * ::= BaseChar | Ideographic [85] BaseChar ::= <see standard> [86]
- * Ideographic ::= <see standard> [87] CombiningChar ::= <see standard>
- * [88] Digit ::= <see standard> [89] Extender ::= <see standard>
- */
- private static final char fgInitialNameCharRanges[] = {
- //
- // Ranges:
- //
- // BaseChar ranges
- //
- 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6, 0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E, 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217, 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1, 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C, 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4, 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5, 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA, 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7, 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6, 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990, 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD, 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10, 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36, 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B, 0x0A8F, 0x0A91,
- 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3, 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28, 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D, 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95, 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA, 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10, 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61, 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3, 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10, 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E, 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88, 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB, 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47, 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103, 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155, 0x115F, 0x1161, 0x116D, 0x116E,
- 0x1172, 0x1173, 0x11AE, 0x11AF, 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9, 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D, 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC, 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB, 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B, 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C, 0xAC00, 0xD7A3,
- //
- // Ideographic ranges
- //
- 0x3021, 0x3029, 0x4E00, 0x9FA5,
- //
- // Ranges end marker
- //
- 0x0000,
- //
- // Single char values
- //
- 0x003A, // ':'
- 0x005F, // '_'
- //
- // BaseChar singles
- //
- 0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5, 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C, 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0, 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E, 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E, 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B, 0x1F5D, 0x1FBE, 0x2126, 0x212E,
- //
- // Ideographic singles
- //
- 0x3007,
- //
- // Singles end marker
- //
- 0x0000};
- private static final char fgNameCharRanges[] = {
- //
- // Ranges:
- //
- 0x002D, 0x002E, // '-' and '.'
- //
- // CombiningChar ranges
- //
- 0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1, 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652, 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C, 0x0951, 0x0954, 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4, 0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42, 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83, 0x0ABE, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03, 0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57, 0x0B82, 0x0B83, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56, 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD, 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43, 0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB4, 0x0EB9, 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F71, 0x0F84, 0x0F86, 0x0F8B,
- 0x0F90, 0x0F95, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7, 0x20D0, 0x20DC, 0x302A, 0x302F,
- //
- // Digit ranges
- //
- 0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F, 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F, 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F, 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29,
- //
- // Extender ranges
- //
- 0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
- //
- // Ranges end marker
- //
- 0x0000,
- //
- // Single char values
- //
- // CombiningChar singles
- //
- 0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF, 0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7, 0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F, 0x0F97, 0x0FB9, 0x20E1, 0x3099, 0x309A,
- //
- // Extender singles
- //
- 0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
- //
- // Singles end marker
- //
- 0x0000};
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
deleted file mode 100644
index 8b7fafe715..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
+++ /dev/null
@@ -1,29 +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.dtd.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD Validation
- *
- * @plannedfor 1.0
- */
-public class DTDValidationMessages extends NLS {
- public static String _ERROR_REF_ELEMENT_UNDEFINED;
-
- private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.core.internal.validation.DTDValidationResources";//$NON-NLS-1$
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DTDValidationMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
deleted file mode 100644
index 131e64ccd4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
+++ /dev/null
@@ -1,15 +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
-###############################################################################
-
-!
-! Referenced Element Validation
-!
-_ERROR_REF_ELEMENT_UNDEFINED = The element {0} has not been declared. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java
deleted file mode 100644
index c2ab0c1fe4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java
+++ /dev/null
@@ -1,449 +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.dtd.core.internal.validation;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * DTD validation.
- */
-public class DTDValidator {
- /**
- * An entity resolver that wraps a URI resolver.
- */
- class DTDEntityResolver implements EntityResolver {
- private String fBaseLocation = null;
- private URIResolver fURIResolver = null;
-
- /**
- * Constructor.
- *
- * @param idresolver
- * The idresolver this entity resolver wraps.
- * @param baselocation
- * The base location to resolve with.
- */
- public DTDEntityResolver(URIResolver uriresolver, String baselocation) {
- this.fURIResolver = uriresolver;
-
- // TODO cs: we never seem to set a URIResolver
- // I create one here up front just incase
- //
- if (fURIResolver == null)
- {
- fURIResolver = URIResolverPlugin.createResolver();
- }
- this.fBaseLocation = baselocation;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
- * java.lang.String)
- */
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
- String location = null;
-
-
- if (fBaseLocation.equals(systemId)) {
- location = systemId;
- }
- else {
- location = fURIResolver.resolve(fBaseLocation, publicId, systemId);
- }
- InputSource is = null;
- if (location != null && !location.equals("")) //$NON-NLS-1$
- {
- // CS : while working on bug 113537 I noticed we're not using the LazyURLInputStream
- // so fixed this to avoid leaking file handles
- //
- String physical = fURIResolver.resolvePhysicalLocation(fBaseLocation, publicId, location);
- is = new InputSource(location);
- is.setByteStream(new LazyURLInputStream(physical));
- }
- return is;
- }
- }
-
- /**
- * An error handler for DTD validation.
- *
- * @author Lawrence Mandel, IBM
- */
- class DTDErrorHandler implements ErrorHandler {
-
- private final int ERROR = 0;
- private final ValidationInfo fValidationInfo;
-
- private final int WARNING = 1;
-
- /**
- * Constructor.
- *
- * @param valinfo
- * The validation info object to use to register validation
- * messages.
- */
- public DTDErrorHandler(ValidationInfo valinfo) {
- this.fValidationInfo = valinfo;
- }
-
- /**
- * Add a validation message with the given severity.
- *
- * @param exception
- * The exception that contains the information about the
- * message.
- * @param severity
- * The severity of the validation message.
- */
- protected void addValidationMessage(SAXParseException exception, int severity) {
- if (exception.getSystemId() != null) {
- if (severity == WARNING) {
- fValidationInfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
- }
- else {
- fValidationInfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException exception) throws SAXException {
- addValidationMessage(exception, ERROR);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException exception) throws SAXException {
- addValidationMessage(exception, ERROR);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException exception) throws SAXException {
- addValidationMessage(exception, WARNING);
- }
- }
-
- class MultiHandler extends DefaultHandler implements org.xml.sax.DTDHandler, ContentHandler, LexicalHandler, DeclHandler {
- private static final String ELEMENT_MODIFIERS = "*+?"; //$NON-NLS-1$
-
- private static final String MODEL_DELIMITERS = ",()| "; //$NON-NLS-1$
-
- private List fElemDecls = new ArrayList();
-
- private Hashtable fElemRefs = new Hashtable();
-
- private List fIgnoreElemModel = new ArrayList();
-
- private List fIgnoreElemRefs = new ArrayList();
-
- private Locator fLocator = null;
-
- public MultiHandler() {
- fIgnoreElemRefs.add("#PCDATA"); //$NON-NLS-1$
- fIgnoreElemModel.add("ANY"); //$NON-NLS-1$
- fIgnoreElemModel.add("EMPTY"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String,
- * java.lang.String, java.lang.String, java.lang.String,
- * java.lang.String)
- */
- public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
- */
- public void comment(char[] arg0, int arg1, int arg2) throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String,
- * java.lang.String)
- */
- public void elementDecl(String name, String model) throws SAXException {
- // Add this element to the list of declared elements.
- fElemDecls.add(name);
-
- // Return if the element model should be ignored. The model should
- // be
- // ignored in such cases as when it is equal to EMPTY or ANY.
- if (fIgnoreElemModel.contains(model)) {
- return;
- }
- // Add each referenced element to the list of referenced elements
- int line = fLocator.getLineNumber();
- int column = fLocator.getColumnNumber();
- String uri = fLocator.getSystemId();
-
- StringTokenizer strtok = new StringTokenizer(model, MODEL_DELIMITERS);
- while (strtok.hasMoreTokens()) {
- String token = strtok.nextToken();
- int tokenlength = token.length();
- if (ELEMENT_MODIFIERS.indexOf(token.charAt(tokenlength - 1)) != -1) {
- token = token.substring(0, tokenlength - 1);
- // If the token is now empty (it was only ?,* or +) then
- // continue.
- if (token.length() == 0) {
- continue;
- }
- }
- if (fIgnoreElemRefs.contains(token)) {
- continue;
- }
- ElementRefLocation elemLoc = (ElementRefLocation) fElemRefs.get(token);
- ElementRefLocation tokenLoc = new ElementRefLocation(line, column, uri, elemLoc);
- fElemRefs.put(token, tokenLoc);
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
- */
- public void endEntity(String arg0) throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String,
- * java.lang.String, java.lang.String)
- */
- public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
- // No method impl.
- }
-
- /**
- * Get the list of element declarations.
- *
- * @return The list of element declarations.
- */
- public List getElementDeclarations() {
- return fElemDecls;
- }
-
- /**
- * Get the element references hashtable.
- *
- * @return The element references hashtable.
- */
- public Hashtable getElementReferences() {
- return fElemRefs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String,
- * java.lang.String)
- */
- public void internalEntityDecl(String name, String value) throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- super.setDocumentLocator(locator);
- this.fLocator = locator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#startCDATA()
- */
- public void startCDATA() throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String,
- * java.lang.String, java.lang.String)
- */
- public void startDTD(String name, String publicId, String systemId) throws SAXException {
- // No method impl.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
- */
- public void startEntity(String name) throws SAXException {
- // No method impl.
- }
- }
-
-
-
- private URIResolver fResolver = null;
-
- public DTDValidator() {
- super();
- }
-
- /**
- * Set the URI resolver to use with XSD validation.
- *
- * @param uriresolver
- * The URI resolver to use.
- */
- public void setURIResolver(URIResolver uriresolver) {
- this.fResolver = uriresolver;
- }
-
- /**
- * Validate the DTD file located at the URI.
- *
- * @param uri
- * The URI of the file to validate.
- * @return A validation report for the validation.
- */
- public ValidationReport validate(String uri) {
- ValidationInfo valinfo = new ValidationInfo(uri);
- try {
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- XMLReader reader = parser.getXMLReader();
- MultiHandler dtdHandler = new MultiHandler();
- reader.setProperty("http://xml.org/sax/properties/declaration-handler", dtdHandler); //$NON-NLS-1$
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtdHandler); //$NON-NLS-1$
- reader.setContentHandler(dtdHandler);
- reader.setDTDHandler(dtdHandler);
- reader.setErrorHandler(new DTDErrorHandler(valinfo));
- reader.setEntityResolver(new DTDEntityResolver(fResolver, uri));
- String document = "<!DOCTYPE root SYSTEM \"" + uri + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
-
- reader.parse(new InputSource(new StringReader(document)));
-
- List elemDecls = dtdHandler.getElementDeclarations();
- Hashtable elemRefs = dtdHandler.getElementReferences();
- validateElementReferences(elemDecls, elemRefs, valinfo);
- }
- catch (ParserConfigurationException e) {
-
- }
- catch (IOException e) {
-
- }
- catch (SAXException e) {
-
- }
- return valinfo;
- }
-
- /**
- * Validate the element references in the DTD. An element reference is
- * <!ELEMENT elem (elementReference)>
- *
- * @param elemDecls
- * A list of valid element declarations.
- * @param elemRefs
- * A hashtable containing element references as keys and
- * locations in the document as values.
- * @param valinfo
- * The validation info object to store validation information.
- */
- private void validateElementReferences(List elemDecls, Hashtable elemRefs, ValidationInfo valinfo) {
- Enumeration keys = elemRefs.keys();
- while (keys.hasMoreElements()) {
- String elemRef = (String) keys.nextElement();
- // If the element hasn't been declared create an error.
- if (!elemDecls.contains(elemRef)) {
- ElementRefLocation elemLoc = (ElementRefLocation) elemRefs.get(elemRef);
- do {
- valinfo.addError(NLS.bind(DTDValidationMessages._ERROR_REF_ELEMENT_UNDEFINED, "'" + elemRef + "'"), elemLoc.getLine(), elemLoc.getColumn(), elemLoc.getURI()); //$NON-NLS-1$ //$NON-NLS-2$
- elemLoc = elemLoc.getNext();
- }
- while (elemLoc != null);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java
deleted file mode 100644
index b1ff07ae2c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java
+++ /dev/null
@@ -1,86 +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.dtd.core.internal.validation;
-
-/**
- * An element references location holds the location of an element reference.
- * An element reference is declared in a DTD element declaration such as
- * <!ELEMENT myelem (elementref)> An element reference may be part of a linked
- * list and can contain a reference to the next element reference in the list.
- *
- * @author Lawrence Mandel, IBM
- */
-class ElementRefLocation {
- private int column = -1;
-
- private int line = -1;
-
- private ElementRefLocation next = null;
-
- private String uri;
-
- /**
- * Constructor.
- *
- * @param line
- * The line location of the element reference.
- * @param column
- * The column location of the element reference.
- * @param uri
- * The URI of the file containing the element reference.
- * @param next
- * The next element reference in the list.
- */
- public ElementRefLocation(int line, int column, String uri, ElementRefLocation next) {
- this.line = line;
- this.column = column;
- this.uri = uri;
- this.next = next;
- }
-
- /**
- * Get the column location of the element reference.
- *
- * @return The column location of the element reference.
- */
- public int getColumn() {
- return column;
- }
-
- /**
- * Get the line location of the element reference.
- *
- * @return The line location of the element reference.
- */
- public int getLine() {
- return line;
- }
-
- /**
- * Get the next element reference in the linked list.
- *
- * @return The next element reference in the linked list.
- */
- public ElementRefLocation getNext() {
- return next;
- }
-
- /**
- * Get the URI of the file that contains the element reference.
- *
- * @return The URI of the file that contains the element reference.
- */
- public String getURI() {
- return uri;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java
deleted file mode 100644
index 9c44a6491a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java
+++ /dev/null
@@ -1,50 +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.dtd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-/**
- * An DTD validator specific to Eclipse. This validator will wrap the internal
- * DTD validator to provide automatic URI resolution support.
- * Using this class is equivalent to using the internal DTD validator and registering
- * the URI resolver from the URI resolution framework.
- */
-public class DTDValidator extends
- org.eclipse.wst.dtd.core.internal.validation.DTDValidator
-{
- private static DTDValidator _instance = null;
-
- /**
- * Constructor. Registers URI resolution framework with the DTD validator.
- */
- protected DTDValidator()
- {
- super();
- setURIResolver(URIResolverPlugin.createResolver());
- }
-
- /**
- * Get the one and only instance of the Eclipse specific DTD validator.
- *
- * @return
- * The one and only instance of the Eclipse specific DTD validator.
- */
- public static DTDValidator getInstance()
- {
- if (_instance == null)
- {
- _instance = new DTDValidator();
- }
- return _instance;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index cb3940df9c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,38 +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.dtd.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-/**
- * DTD validator that is contributed to the validation framework.
- */
-public class Validator extends AbstractNestedValidator
-{
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
- {
- DTDValidator validator = DTDValidator.getInstance();
-
- ValidationReport valreport = null;
- valreport = validator.validate(uri);
-
- return valreport;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java
deleted file mode 100644
index 9388699aad..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// base class for an Element's contentmodel
-public class Attribute extends DTDNode {
-
- public static final String CDATA = DTDCoreMessages._UI_CHARACTER_DATA_DESC; //$NON-NLS-1$
- public static final String ENTITIES = DTDCoreMessages._UI_ENTITY_NAMES_DESC; //$NON-NLS-1$
- public static final String ENTITY = DTDCoreMessages._UI_ENTITY_NAME_DESC; //$NON-NLS-1$
- public static final String ENUMERATED_NAME = DTDCoreMessages._UI_ENUM_NAME_TOKENS_DESC; //$NON-NLS-1$
- public static final String ENUMERATED_NOTATION = DTDCoreMessages._UI_ENUM_NOTATION_DESC; //$NON-NLS-1$
- public static final String FIXED = "#FIXED"; //$NON-NLS-1$
- public static final String ID = DTDCoreMessages._UI_IDENTIFIER_DESC; //$NON-NLS-1$
- public static final String IDREF = DTDCoreMessages._UI_ID_REFERENCE_DESC; //$NON-NLS-1$
- public static final String IDREFS = DTDCoreMessages._UI_ID_REFERENCES_DESC; //$NON-NLS-1$
-
- public static final String IMPLIED = "#IMPLIED"; //$NON-NLS-1$
- public static final String NMTOKEN = DTDCoreMessages._UI_NAME_TOKEN_DESC; //$NON-NLS-1$
- public static final String NMTOKENS = DTDCoreMessages._UI_NAME_TOKENS_DESC; //$NON-NLS-1$
- public static final String REQUIRED = "#REQUIRED"; //$NON-NLS-1$
-
- protected static Hashtable typeHash = new Hashtable();
-
- public static final String[] types = {CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS, ENUMERATED_NAME, ENUMERATED_NOTATION};
-
- {
- typeHash.put(DTDRegionTypes.CDATA_KEYWORD, CDATA);
- typeHash.put(DTDRegionTypes.ID_KEYWORD, ID);
- typeHash.put(DTDRegionTypes.IDREF_KEYWORD, IDREF);
- typeHash.put(DTDRegionTypes.IDREFS_KEYWORD, IDREFS);
- typeHash.put(DTDRegionTypes.ENTITY_KEYWORD, ENTITY);
- typeHash.put(DTDRegionTypes.ENTITIES_KEYWORD, ENTITIES);
- typeHash.put(DTDRegionTypes.NMTOKEN_KEYWORD, NMTOKEN);
- typeHash.put(DTDRegionTypes.NMTOKENS_KEYWORD, NMTOKENS);
- typeHash.put(DTDRegionTypes.NOTATION_KEYWORD, ENUMERATED_NOTATION);
- // this one's a special case since there is no keyword for
- // enumerated name tokens
- typeHash.put("()", ENUMERATED_NAME); //$NON-NLS-1$
-
- // now put the reverse in place. This gives us a 2 way lookup
- // for when we want to retrieve the value and when we want to set it
- typeHash.put(CDATA, "CDATA"); //$NON-NLS-1$
- typeHash.put(ID, "ID"); //$NON-NLS-1$
- typeHash.put(IDREF, "IDREF"); //$NON-NLS-1$
- typeHash.put(IDREFS, "IDREFS"); //$NON-NLS-1$
- typeHash.put(ENTITY, "ENTITY"); //$NON-NLS-1$
- typeHash.put(ENTITIES, "ENTITIES"); //$NON-NLS-1$
- typeHash.put(NMTOKEN, "NMTOKEN"); //$NON-NLS-1$
- typeHash.put(NMTOKENS, "NMTOKENS"); //$NON-NLS-1$
- typeHash.put(ENUMERATED_NAME, ""); //$NON-NLS-1$
- typeHash.put(ENUMERATED_NOTATION, "NOTATION"); //$NON-NLS-1$
- }
-
- private AttributeEnumList enumList = null;
-
- // public static final String IMPLIED = "IMPLIED";
-
- public Attribute(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getDefaultKind() {
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- if (defaultKindRegion != null) {
- return getStructuredDTDDocumentRegion().getText(defaultKindRegion);
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getDefaultKindRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.IMPLIED_KEYWORD || region.getType() == DTDRegionTypes.REQUIRED_KEYWORD || region.getType() == DTDRegionTypes.FIXED_KEYWORD) {
- return region;
- }
- }
- return null;
- }
-
- public String getDefaultValue() {
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
- if (defaultValue != null) {
- return getValueFromQuotedRegion(defaultValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public AttributeEnumList getEnumList() {
- return enumList;
- }
-
- public String getImagePath() {
- return DTDResource.ATTRIBUTEICON;
- }
-
- public ITextRegion getNameRegion() {
- return getNextRegion(iterator(), DTDRegionTypes.ATTRIBUTE_NAME);
- }
-
- public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- return region;
- }
- }
- return null;
- }
-
- protected int getOffsetAfterType() {
- ITextRegion typeRegion = getTypeRegion();
-
- String type = getType();
- boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
- if (isEnumeration) {
- // now check if maybe this is an enumeration
- if (getEnumList() != null) {
- return getEnumList().getEndOffset();
- }
- }
- if (typeRegion != null) {
- return getStructuredDTDDocumentRegion().getEndOffset(typeRegion);
- }
- else {
- ITextRegion nameRegion = getNameRegion();
- return getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- // // create one
- // typeRegion =
- // findOrCreateTypeRegion((String)typeHash.get(CDATA));
- }
- }
-
- public String getType() {
- ITextRegion region = getTypeRegion();
- if (region != null) {
- String type = (String) typeHash.get(region.getType());
- if (type == null) {
- // just return the text of the type region since this may be
- // an entity representing the type;
- return getStructuredDTDDocumentRegion().getText(region);
- }
- return type;
- }
- else if (getEnumList() != null) {
- // enumerated name tokens don't have a type keyword. just
- // the existence of the left paren is enough
- return (String) typeHash.get("()"); //$NON-NLS-1$
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getTypeRegion() {
- RegionIterator iter = iterator();
-
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.CDATA_KEYWORD || region.getType() == DTDRegionTypes.ID_KEYWORD || region.getType() == DTDRegionTypes.IDREF_KEYWORD || region.getType() == DTDRegionTypes.IDREFS_KEYWORD || region.getType() == DTDRegionTypes.ENTITY_KEYWORD || region.getType() == DTDRegionTypes.ENTITIES_KEYWORD || region.getType() == DTDRegionTypes.NMTOKEN_KEYWORD || region.getType() == DTDRegionTypes.NMTOKENS_KEYWORD || region.getType() == DTDRegionTypes.NOTATION_KEYWORD || region.getType() == DTDRegionTypes.PARM_ENTITY_TYPE) {
- return region;
- }
- }
- return null;
- }
-
- public String getValueFromQuotedRegion(ITextRegion region) {
- String type = region.getType();
- if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDTDDocumentRegion().getText(region);
- return text.substring(1, text.length() - 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- public void resolveRegions() {
- removeChildNodes();
- RegionIterator iter = iterator();
-
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- enumList = new AttributeEnumList(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- if (enumList != null) {
- enumList.addRegion(currentRegion);
- if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
- return;
- }
- }
- }
-
- }
-
- public void setDefaultKind(Object requestor, String kind) {
-
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- String oldDefaultKind = defaultKindRegion == null ? "" : getStructuredDTDDocumentRegion().getText(defaultKindRegion); //$NON-NLS-1$
- if (!kind.equals(oldDefaultKind)) {
- String newText = kind;
- int startOffset = 0;
- int length = 0;
- if (defaultKindRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
- length = getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) - startOffset;
- }
- else {
- startOffset = getOffsetAfterType();
- newText = " " + newText; //$NON-NLS-1$
- }
-
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
-
- if (kind.equals(Attribute.FIXED) || kind.equals("")) { //$NON-NLS-1$
- if (defaultValue == null) {
- // we are changing to fixed and wehave no quoted region.
- // put in an empty value
- newText += " \"\""; //$NON-NLS-1$
- }
- }
- else {
- if (defaultValue != null) {
- length = getStructuredDTDDocumentRegion().getEndOffset(defaultValue) - startOffset;
- }
- }
- replaceText(requestor, startOffset, length, newText);
- // do something if there is no "kind" region
- }
- }
-
- public void setDefaultKind(String kind) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_DEFAULT_KIND); //$NON-NLS-1$
- setDefaultKind(this, kind);
- endRecording(this);
- }
-
- public void setDefaultValue(Object requestor, String value, boolean fixed) {
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
- String quoteChar = value.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- int startOffset = 0;
- int endOffset = 0;
- String newText = ""; //$NON-NLS-1$
-
- String oldValue = getDefaultValue();
- boolean oldKindIsFixed = getDefaultKind().equals(Attribute.FIXED);
- if (oldValue.equals(value) && fixed == oldKindIsFixed) {
- // nothing to do
- return;
- }
-
- if (defaultValue != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultValue);
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(defaultValue);
- }
-
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- if (defaultKindRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
- endOffset = endOffset == 0 ? getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) : endOffset;
- }
- else {
- if (startOffset == 0) {
- endOffset = startOffset = getOffsetAfterType();
- newText += " "; //$NON-NLS-1$
- }
- ITextRegion typeRegion = getTypeRegion();
- if (typeRegion == null && getEnumList() == null) {
- // tack on a default type
- // newText += "CDATA ";
- }
- }
- if (fixed) {
- newText += "#FIXED "; //$NON-NLS-1$
- }
- else {
- if (getDefaultKind().equals("") && value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
- // if not fixed and value is "" then reset the default kind to
- // implied
- newText += "#IMPLIED"; //$NON-NLS-1$
- }
- }
-
- if (!getType().equals("") && !value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
- newText += quoteChar + value + quoteChar;
- }
- replaceText(requestor, startOffset, endOffset - startOffset, newText);
- }
-
- public void setDefaultValue(String value, boolean fixed) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_DEFAULT_VAL); //$NON-NLS-1$
- setDefaultValue(this, value, fixed);
- endRecording(this);
- }
-
- public void setType(Object requestor, String type) {
- String oldType = getType();
- if (!type.equals(oldType)) {
- boolean wasEnumeration = oldType.equals(ENUMERATED_NAME) || oldType.equals(ENUMERATED_NOTATION);
- boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
- String newText = ""; //$NON-NLS-1$
- int startOffset = 0;
- int endOffset = 0;
-
- if (wasEnumeration && !isEnumeration) {
- // get rid of the old enumlist
- AttributeEnumList enumList = getEnumList();
- if (enumList != null) {
- startOffset = enumList.getStartOffset();
- endOffset = enumList.getEndOffset();
- }
- }
-
- ITextRegion region = getTypeRegion();
- if (region != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
- if (endOffset == 0) {
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
- }
- }
- else if (startOffset == 0) {
- ITextRegion nameRegion = getNameRegion();
- newText += " "; //$NON-NLS-1$
- endOffset = startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- }
-
- String newTypeWord = (String) typeHash.get(type);
- if (newTypeWord == null) {
- // then this must be a parm entity being used in the type
- // use the type text directly
- newTypeWord = type;
- }
-
- newText += newTypeWord;
-
- if (isEnumeration && !wasEnumeration) {
- // put in a new numlist
- boolean isSpaceNeeded = !type.equals(ENUMERATED_NAME);
- newText += isSpaceNeeded ? " " : ""; //$NON-NLS-1$ //$NON-NLS-2$
- newText += "()"; //$NON-NLS-1$
- }
- replaceText(requestor, startOffset, endOffset - startOffset, newText);
- if (newTypeWord.equals("") && !type.equals(ENUMERATED_NAME)) { //$NON-NLS-1$
- // the set the defaultkind to ""
- // setDefaultKind(requestor, "");
- setDefaultValue(requestor, "", false); //$NON-NLS-1$
- }
-
- }
- }
-
- public void setType(String type) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_TYPE); //$NON-NLS-1$
- setType(this, type);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java
deleted file mode 100644
index 666efdf131..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class AttributeEnumList extends DTDNode {
-
- private ArrayList list = new ArrayList();
-
- public AttributeEnumList(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getImagePath() {
- // never exposed in tree
- return null;
- }
-
- // return the items that are in this enumerated list
- public List getItems() {
- list.clear();
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion name = getNextRegion(iter, DTDRegionTypes.NAME);
- if (name != null) {
- list.add(getStructuredDTDDocumentRegion().getText(name));
- }
- }
- return list;
- }
-
- public void setItems(Object requestor, String[] items) {
- if (items != null) {
- String text = "("; //$NON-NLS-1$
- for (int i = 0; i < items.length; i++) {
- if (i > 0) {
- text += " | " + items[i]; //$NON-NLS-1$
- }
- else {
- text += items[i];
- }
- }
- text += ")"; //$NON-NLS-1$
- replaceText(requestor, getStartOffset(), getNodeLength(), text);
- }
- }
-
- public void setItems(String[] items) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_ENUM_ITEMS); //$NON-NLS-1$
- setItems(this, items);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java
deleted file mode 100644
index c8c78b1929..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class AttributeList extends NamedTopLevelNode {
- public AttributeList(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.ATTLIST_TAG);
- }
-
- public void addAttribute(String name) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_LIST_ADD); //$NON-NLS-1$
-
- DTDNode lastAttribute = (DTDNode) getLastChild();
- if (lastAttribute != null) {
- replaceText(this, lastAttribute.getEndOffset(), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- replaceText(this, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- }
-
- endRecording(this);
- }
-
- public String getImagePath() {
- return DTDResource.ATTRIBUTELISTICON;
- }
-
- public void insertIntoModel(Object requestor, Attribute reference, Attribute node, boolean isAfter) {
- int offset = 0;
- String newText = ""; //$NON-NLS-1$
- String nodeText = node.getFullNodeText();
- if (!isAfter) {
- offset = reference.getStartOffset();
- }
- else {
- // try and get next child
- Attribute attr = (Attribute) reference.getNextSibling();
- if (attr != null) {
- offset = attr.getStartOffset();
- }
- else {
- // just use the end offset
- offset = reference.getWhitespaceEndOffset();
- }
- }
- newText += nodeText;// + (isLastChild ? "\n" : "\n\t");
- if (!node.hasTrailingWhitespace()) {
- newText += "\n\t"; //$NON-NLS-1$
- }
- replaceText(requestor, offset, 0, newText);
- }
-
- public void resolveRegions() {
- removeChildNodes();
- RegionIterator iter = iterator();
-
- if (getNameRegion() != null) {
- // we skip past the name token is our name
- skipPastName(iter);
- }
-
- ArrayList children = new ArrayList();
- Attribute attribute = null;
- boolean trailingWhitespace = false;
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.ATTRIBUTE_NAME)) {
- attribute = new Attribute(getDTDFile(), getStructuredDTDDocumentRegion());
- children.add(attribute);
- appendChild(attribute);
- trailingWhitespace = false;
- }
- if (attribute != null && currentRegion.getType() != DTDRegionTypes.END_TAG) {
- if (!trailingWhitespace) {
- attribute.addRegion(currentRegion);
- }
- else {
- if (currentRegion.getType() == DTDRegionTypes.WHITESPACE) {
- attribute.addWhitespaceRegion(currentRegion);
- }
- }
-
- // the following prevents extra whitespace from being picked
- // up by the attribute
- if (currentRegion.getType() == DTDRegionTypes.REQUIRED_KEYWORD || currentRegion.getType() == DTDRegionTypes.IMPLIED_KEYWORD || currentRegion.getType() == DTDRegionTypes.SINGLEQUOTED_LITERAL || currentRegion.getType() == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
- trailingWhitespace = true;
- }
- }
- }
- int numKids = children.size();
- for (int i = 0; i < numKids; i++) {
- ((Attribute) children.get(i)).resolveRegions();
- } // end of for ()
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java
deleted file mode 100644
index e74334dbb0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-/*
- * CMBasicNode combines all the different content types into one. The idea
- * behind this is to allow arbitrary name changes to not require a tree
- * update.
- */
-public class CMBasicNode extends CMRepeatableNode {
-
- // static final int EMPTY = 0;
- // static final int ANY = 1;
- // static final int PCDATA = 2;
-
- public CMBasicNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getImagePath() {
- final String name = getName();
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return DTDResource.PCDATAICON;
- }
-
- if (isRootElementContent()) {
- if (name.equals(EMPTY)) {
- return DTDResource.EMPTYICON;
- }
- else if (name.equals(ANY)) {
- return DTDResource.ANYICON;
- }
- }
-
- // Otherwise this is just an element reference node. Just return
- // what CMRepeatableNode would give us
- return super.getImagePath();
- }
-
- public ITextRegion getNameRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.NAME || region.getType() == DTDRegionTypes.CONTENT_PCDATA) {
- return region;
- }
- }
- return null;
- }
-
- // returns the occurrencetoken, or the token where the occurrence token
- // should appear after
- public ITextRegion getOccurrenceRegion() {
- RegionIterator iter = iterator();
- skipPastName(iter);
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return region;
- }
- }
- return getNameRegion();
- }
-
- public String getType() {
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return PCDATA;
- }
-
- if (isRootElementContent()) {
- final String name = getName();
- if (isRootElementContent()) {
- if (name.equals(EMPTY)) {
- return EMPTY;
- }
- else if (name.equals(ANY)) {
- return ANY;
- }
- else {
- // otherwise just return it's name as the type
- return name;
- }
-
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- public boolean isEmptyAnyOrPCData() {
- if (isPCData()) {
- return true;
- }
-
-
- final String name = getName();
- if (isRootElementContent()) {
- if (name.equals(EMPTY) || name.equals(ANY)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isPCData() {
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return true;
- }
- return false;
- }
-
- // public Node insertRegion(Region token)
- // {
- // if (!tokenStream.containsToken(token) && token.getType() ==
- // Token.OCCUR_TYPE)
- // {
- // // then add it so that our range contains it
- // insertIntoTokenStream(token);
- // }
- // return this;
- // }
-
- public boolean isReference() {
- return !isEmptyAnyOrPCData();
- }
-
- public void setName(Object requestor, String name) {
- // beginRecording(requestor, "Name Change");
-
- super.setName(requestor, name);
- if (!isReference()) {
- // if it is no longer a reference node, remove the occurrence
- // token
- setOccurrence(requestor, CMRepeatableNode.ONCE);
- }
-
- // endRecording(requestor);
- }
-
- /*
- * public static String getName(int type) { switch (type) { case EMPTY:
- * return emptyString; case ANY: return anyString; case PCDATA: return
- * pcdataString; default: break; } // end of switch () return ""; }
- */
-
-}// CMBasicNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java
deleted file mode 100644
index a5401da794..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.internal.util.DTDUniqueNameHelper;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class CMGroupNode extends CMRepeatableNode {
-
- public static final char CHOICE = '|';
- public static final char SEQUENCE = ',';
-
- protected char connector = SEQUENCE;
-
- // protected ArrayList children = new ArrayList();
-
- public CMGroupNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public void addChild() {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_ADD_CHILD); //$NON-NLS-1$
- DTDNode lastNode = (DTDNode) getLastChild();
- String elementName = DTDUniqueNameHelper.getUniqueName(getChildrenList(), "ChildNode"); //$NON-NLS-1$
- if (lastNode != null) {
- replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + elementName); //$NON-NLS-1$
- }
- else {
- replaceText(this, getStartOffset() + 1, 0, elementName); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
-
- public void addGroup() {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_ADD_GRP); //$NON-NLS-1$
- DTDNode lastNode = (DTDNode) getLastChild();
- if (lastNode != null) {
- replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + " ()"); //$NON-NLS-1$
- }
- else {
- replaceText(this, getStartOffset() + 1, 0, "()"); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
-
- public void delete(Object requestor, DTDNode child) {
- Object[] children = getChildren();
-
- if (children.length == 1 && getFirstChild() == child) {
- replaceText(requestor, child.getStartOffset(), child.getNodeLength(), null);
- return;
- }
-
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- boolean childADeleted = childA == child;
- boolean childBDeleted = childB == child;
- if (childADeleted || childBDeleted) {
- // we found the child
- int startOffset = childADeleted ? childA.getStartOffset() : childA.getEndOffset();
- int endOffset = childADeleted ? childB.getStartOffset() : childB.getEndOffset();
- replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- removeChild(child);
- break;
- }
- }
- }
-
- /**
- * Get the value of connector.
- *
- * @return value of connector.
- */
- public char getConnector() {
- Object[] children = getChildren();
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- // create a stream between the two siblings and walk it
- // note that this stream includes the last region of the first
- // sibling and the first region of the next sibling.
- // both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
- // stream.setFirstRegion(childA.getLastRegion());
- // stream.setLastRegion(childB.getFirstRegion());
- // Iterator iter = stream.iterator();
- // skip the first region which is the last region of childA
- // do we need this now ?
- // iter.next();
- ITextRegion currentRegion = null;
- while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
- connector = getStructuredDTDDocumentRegion().getText(currentRegion).charAt(0);
- return connector;
- }
- }
- }
- return connector;
- }
-
- public String getImagePath() {
- switch (getConnector()) {
- case SEQUENCE :
- return DTDResource.ONESEQUENCEICON;
- /*
- * switch (getOccurrence()) { case ONCE : return
- * resourcePlugin.getImage(DTDResource.ONESEQUENCEICON); case
- * OPTIONAL : return
- * resourcePlugin.getImage(DTDResource.OPTIONALSEQUENCEICON); case
- * ONE_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ONEORMORESEQUENCEICON);
- * case ZERO_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ZEROORMORESEQUENCEICON); }
- */
- case CHOICE :
- return DTDResource.ONECHOICEICON;
- /*
- * switch (getOccurrence()) { case ONCE : return
- * resourcePlugin.getImage(DTDResource.ONECHOICEICON); case OPTIONAL :
- * return resourcePlugin.getImage(DTDResource.OPTIONALCHOICEICON);
- * case ONE_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ONEORMORECHOICEICON); case
- * ZERO_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ZEROORMORECHOICEICON); }
- */
- }
- return null;
- }
-
- public String getName() {
- return ""; //$NON-NLS-1$
- }
-
- // returns the occurrenceregion, or the last region where the occurrence
- // region should appear after
- public ITextRegion getOccurrenceRegion() {
- int nesting = 0;
-
- // we skip past the first left paren we see since that is the
- // beginning of our own node
- RegionIterator iter = iterator();
- // we assume the first region is the '('
- iter.next();
- ITextRegion currentRegion = null;
- while (iter.hasNext() && nesting >= 0) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.LEFT_PAREN) {
- nesting++;
- }
- if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
- nesting--;
- }
- }
- if (nesting < 0) {
- // This means we have passed over the right paren that marks the
- // end of our grouping.
- // Look for an occurrence region
- while (iter.hasNext()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return currentRegion;
- }
- }
- }
- // if we're here, this means that there is no occur region. return the
- // last region
- return iter.previous();
- }
-
- public String getType() {
- if (isRootElementContent()) {
- if (getFirstChild() != null) {
- CMNode node = (CMNode) getFirstChild();
- if (node.getType().equals(PCDATA)) {
- return MIXED;
- }
- else {
- return CHILDREN;
- }
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- public void insertChildNode(Object requestor, String nodeText, int position) {
- Object[] children = getChildren();
-
- int startOffset = 0;
- String newText = ""; //$NON-NLS-1$
- if (position < children.length) {
- DTDNode reference = (DTDNode) children[position];
- startOffset = reference.getStartOffset();
- newText = nodeText + " " + String.valueOf(getConnector()) + " "; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (position == children.length) {
- // add to end
- DTDNode reference = (DTDNode) children[position - 1];
- startOffset = reference.getEndOffset();
- newText = " " + String.valueOf(getConnector()) + " " + nodeText; //$NON-NLS-1$ //$NON-NLS-2$
- }
- replaceText(requestor, startOffset, 0, newText);
- }
-
- public void insertChildNode(String nodeText, int position) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT); //$NON-NLS-1$
- insertChildNode(this, nodeText, position);
- endRecording(this);
- }
-
- public void insertIntoModel(Object requestor, CMNode reference, CMNode node, boolean isAfter) {
- String nodeText = node.getNodeText();
- List children = getChildrenList();
-
- int index = children.indexOf(reference);
- if (index == -1) {
- // no reference node, add it to the end??
- index = children.size();
- }
- else {
- // got an index. if we want to add after, increase by 1
- index = isAfter ? index + 1 : index;
- }
- insertChildNode(requestor, nodeText, index);
- }
-
- public void resolveRegions() {
- int nesting = 0;
- // children.clear();
- removeChildNodes();
- DTDNode currentGroupNode = null;
- CMBasicNode currentReferenceNode = null;
- RegionIterator iter = iterator();
- // we assume the first region is the '('
- iter.next();
- while (iter.hasNext() && nesting >= 0) {
- ITextRegion currentRegion = iter.next();
- if (nesting == 0) {
- if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
- currentGroupNode = currentReferenceNode = null;
- DTDNode pcData = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- pcData.addRegion(currentRegion);
- appendChild(pcData);
- // children.add(pcData);
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
- // we have hit a new reference node. Make sure we reset
- // the groupnode var so it doesn't collect more regions
- currentGroupNode = null;
- currentReferenceNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- currentReferenceNode.addRegion(currentRegion);
- appendChild(currentReferenceNode);
- // children.add(currentReferenceNode);
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- // we could potentially flag an error here if we hit an
- // occurrence type and currentRefNode and currentGroupNode
- // are null
- if (currentReferenceNode != null) {
- // currentReferenceNode.setOccurrence(currentRegion.getText().toCharArray()[0]);
- currentReferenceNode.addRegion(currentRegion);
- currentReferenceNode = null;
- }
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.CONNECTOR)) {
- // note that if connector is already set and it is
- // different from the current connector region, then we
- // have an error!
- // setConnector(currentRegion.getText().toCharArray()[0]);
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- if (currentGroupNode == null) {
- // we have hit a new group. Make sure we reset the
- // referencenode var so it doesn't collect any more
- // regions
- currentReferenceNode = null;
- currentGroupNode = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
- appendChild(currentGroupNode);
- // children.add(currentGroupNode);
- }
- }
- }
-
- if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- nesting++;
- }
- if (currentRegion.getType().equals(DTDRegionTypes.RIGHT_PAREN)) {
- nesting--;
- if (nesting == 0 && currentGroupNode != null) {
- currentGroupNode.addRegion(currentRegion);
- // peek at next region to see if it is an occur region. if
- // so, add it to the groupnode
- if (iter.hasNext()) {
- ITextRegion nextRegion = iter.next();
- if (nextRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- currentGroupNode.addRegion(nextRegion);
- }
- else {
- // Otherwise, push it back as the next item to be
- // retrieved by a future next() call
- iter.previous();
- }
- }
- currentGroupNode = null;
- }
- }
- if (currentGroupNode != null) {
- currentGroupNode.addRegion(currentRegion);
- }
- }
-
- if (nesting < 0) {
- // This means we have passed over the right paren that marks the
- // end of our grouping.
- // Look for an occurrence region
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- // setOccurrence(currentRegion.getText().toCharArray()[0]);
- }
- } // end of while ()
- }
-
- // for (org.w3c.dom.Node child = getFirstChild(); child != null; child
- // = child.getNextSibling())
- // {
- // System.out.println("child found = " + child);
- // }
-
- Object[] children = getChildren();
- // System.out.println("children legnth = " + children.length);
-
- for (int i = 0; i < children.length; i++) {
- DTDNode currentNode = (DTDNode) children[i];
- currentNode.resolveRegions();
- } // end of while ()
-
- }
-
- /**
- * Set the value of connector.
- *
- * @param v
- * Value to assign to connector.
- */
- public void setConnector(char v) {
- if (connector != v) {
- connector = v;
- // walk through our kids and see if there is a connector between
- // each sibling. if not, create one and set the connector. if
- // there is
- // then just change the text of the connector
- Object[] children = getChildren();
- if (children.length <= 1) {
- // there won't be any connector existing between the children
- // just notify a change in the node and return;
- getDTDFile().notifyNodeChanged(this);
- return;
- }
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_CONNECTOR); //$NON-NLS-1$
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- // create a stream between the two siblings and walk it
- // note that this stream includes the last region of the first
- // sibling and the first region of the next sibling.
- // both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
- // skip the first region which is the last region of childA
-
- // do we still need this
- // iter.next();
- ITextRegion currentRegion = null;
- boolean foundConnector = false;
- while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
- foundConnector = true;
- // Region oldRegion = currentRegion.createCopy();
- // found a connector! on to the next sibling pair
- // currentRegion.updateText(String.valueOf(v));
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(currentRegion), 1, String.valueOf(connector));
- // changeStructuredDocument(oldRegion, currentRegion);
- break;
- }
- }
-
- if (!foundConnector) {
- // if we're here, that means we need to insert a new
- // connector region after childA
- replaceText(this, childA.getEndOffset(), 0, String.valueOf(connector));
- // DTDRegion connectorRegion = new
- // DTDRegion(DTDRegionTypes.CONNECTOR,
- // childA.getEndOffset(), 1);
- // insertIntoStructuredDocument(connectorRegion);
- }
- }
- endRecording(this);
- }
- }
-
- // public Object[] getChildren()
- // {
- // return children.toArray();
- // }
-}// CMGroupNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java
deleted file mode 100644
index 3bb678a05d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-// base class for an Element's contentmodel
-public abstract class CMNode extends DTDNode {
- public static final String ANY = DTDCoreMessages._UI_LABEL_CM_NODE_ANY; //$NON-NLS-1$
- public static final String CHILDREN = DTDCoreMessages._UI_LABEL_CM_NODE_CHILD_CONTENT; //$NON-NLS-1$
-
- public static final String EMPTY = DTDCoreMessages._UI_LABEL_CM_NODE_EMPTY; //$NON-NLS-1$
- public static final String MIXED = DTDCoreMessages._UI_LABEL_CM_NODE_MIX_CONTENT; //$NON-NLS-1$
- public static final String PCDATA = DTDCoreMessages._UI_LABEL_CM_NODE_PCDATA; //$NON-NLS-1$
-
-
- boolean rootElementContent;
-
- public CMNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- // this is only valid to ask if the content is a root element content
- abstract public String getType();
-
- /**
- * Get the value of rootElementContent. This tells us whether this element
- * content's parent is a direct decendent of the containing element
- *
- * @return value of rootElementContent.
- */
- public boolean isRootElementContent() {
- return rootElementContent;
- }
-
- // if this is a root element, change the content to children
- // ie . (child1)
- public void setChildrenContent(String newChild) {
- if (isRootElementContent()) {
- if (!newChild.equals("")) { //$NON-NLS-1$
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_CHILD_CONTENT); //$NON-NLS-1$
- replaceText(this, getStartOffset(), getNodeLength(), "(" + newChild + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- endRecording(this);
- return;
- }
-
- if (!getType().equals(CHILDREN)) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_CHILD_CONTENT); //$NON-NLS-1$
- if (this instanceof CMBasicNode) {
- replaceText(this, getStartOffset(), getNodeLength(), "(newChild)"); //$NON-NLS-1$
- }
- else {
- // now must convert from mixed content to this one. must
- // preserve the remaining children
- CMGroupNode group = (CMGroupNode) this;
- CMNode firstChild = (CMNode) group.getFirstChild();
- if (firstChild != null && PCDATA.equals(firstChild.getType())) {
- group.delete(firstChild);
- }
- }
-
- endRecording(this);
- }
- }
- }
-
- public void setContent(String content) {
- if (isRootElementContent()) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET + " " + content + " " + DTDCoreMessages._UI_LABEL_CM_NODE_CONTENT); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- replaceText(this, getStartOffset(), getNodeLength(), content);
- endRecording(this);
- }
- }
-
- // if this is a root element, change the content to mixed
- // ie . (#PCDATA, child1)
- public void setMixedContent() {
- if (isRootElementContent()) {
- if (!getType().equals(MIXED)) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_MIX_CONTENT); //$NON-NLS-1$
- if (this instanceof CMBasicNode) {
- replaceText(this, getStartOffset(), getNodeLength(), "(#PCDATA | newChild)*"); //$NON-NLS-1$
- }
- else {
- // now must convert from children content to this one.
- // must
- // preserve the children
- CMGroupNode group = (CMGroupNode) this;
- group.setConnector(CMGroupNode.CHOICE);
- group.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
- CMNode firstChild = (CMNode) group.getFirstChild();
- if (!firstChild.getType().equals(PCDATA)) {
- group.insertChildNode("#PCDATA", 0); //$NON-NLS-1$
- }
- }
- endRecording(this);
- }
- }
- }
-
- /**
- * Set the value of rootElementContent.
- *
- * @param v
- * Value to assign to rootElementContent.
- */
- public void setRootElementContent(boolean v) {
- this.rootElementContent = v;
- }
-
- // public void delete()
- // {
- // if (isRootElementContent())
- // {
- // // then the superclasses delete will be fine
- // super.delete();
- // return;
- // }
-
- // CMGroupNode parent = (CMGroupNode) getParentNode();
- // parent.removeChildNode(this);
- // }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java
deleted file mode 100644
index df41c637ec..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public abstract class CMRepeatableNode extends CMNode {
-
- public static final char ONCE = '1';
- public static final char ONE_OR_MORE = '+';
- public static final char OPTIONAL = '?';
- public static final char ZERO_OR_MORE = '*';
-
-
- public CMRepeatableNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getImagePath() {
- return DTDResource.ELEMENTREFICON;
- }
-
- public char getOccurrence() {
- ITextRegion occurRegion = getOccurrenceRegion();
- if (occurRegion != null && occurRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return getStructuredDTDDocumentRegion().getText(occurRegion).charAt(0);
- }
- return CMRepeatableNode.ONCE;
- }
-
- // returns the occurrenceregion, or the last region where the occurrence
- // region should appear after
- abstract public ITextRegion getOccurrenceRegion();
-
- public void setOccurrence(char occurrence) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_CM_REP_NODE_CHG_OCCUR); //$NON-NLS-1$
- setOccurrence(this, occurrence);
- endRecording(this);
- }
-
- public void setOccurrence(Object requestor, char occurrence) {
- if (getOccurrence() != occurrence) {
- ITextRegion region = getOccurrenceRegion();
- if (region != null) {
- if (region.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- if (occurrence == CMRepeatableNode.ONCE) {
- // we need to remove the occur region from the flat
- // model;
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, ""); //$NON-NLS-1$
- }
- else {
- // Region oldOccur = region.createCopy();
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, String.valueOf(occurrence));
- // changeStructuredDocument(oldOccur, region);
- }
- }
- else if (occurrence != CMRepeatableNode.ONCE) {
- // System.out.println(getString());
- // we need to create an occurrenceRegion
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(region), 0, String.valueOf(occurrence));
- }
- }
- }
- }
-
-}// CMRepeatableNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java
deleted file mode 100644
index d132b32bdd..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class Comment extends NamedTopLevelNode {
-
- public class StartEndPair {
- public int startOffset, endOffset;
- }
-
- public Comment(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.COMMENT_START);
- }
-
- public String getImagePath() {
- return DTDResource.COMMENTICON;
- }
-
- public String getName() {
- String text = getText();
- if (text.length() <= 30) {
- return text;
- }
- else {
- return text.substring(0, 29) + "..."; //$NON-NLS-1$
- }
- }
-
- private void getStartAndEndOffsetForText(StartEndPair pair) {
- RegionIterator iter = iterator();
- ITextRegion commentStartTag = getStartTag(iter);
- ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
- if (commentStartTag != null) {
- pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
- }
- if (endCommentTag != null) {
- pair.endOffset = getStructuredDTDDocumentRegion().getStartOffset(endCommentTag);
- }
- }
-
- public String getText() {
- String text = getStructuredDTDDocumentRegion().getText();
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
- }
-
- public void setText(String newText) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_COMMENT_CHG); //$NON-NLS-1$
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java
deleted file mode 100644
index eb95c85a3b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD Core
- *
- * @plannedfor 1.0
- */
-public class DTDCoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.core.internal.DTDCorePluginResources";//$NON-NLS-1$
-
- public static String _UI_NONE_DESC;
- public static String _UI_CHARACTER_DATA_DESC;
- public static String _UI_IDENTIFIER_DESC;
- public static String _UI_ID_REFERENCE_DESC;
- public static String _UI_ID_REFERENCES_DESC;
- public static String _UI_ENTITY_NAME_DESC;
- public static String _UI_ENTITY_NAMES_DESC;
- public static String _UI_NAME_TOKEN_DESC;
- public static String _UI_NAME_TOKENS_DESC;
- public static String _UI_ENUM_NAME_TOKENS_DESC;
- public static String _UI_ENUM_NOTATION_DESC;
- public static String _UI_LABEL_ATTR_DEFAULT_VAL;
- public static String _UI_LABEL_ATTR_DEFAULT_KIND;
- public static String _UI_LABEL_ATTR_TYPE;
- public static String _UI_LABEL_ATTR_ENUM_ITEMS;
- public static String _UI_LABEL_ATTR_LIST_ADD;
- public static String _UI_LABEL_CM_GRP_NODE_CONNECTOR;
- public static String _UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT;
- public static String _UI_LABEL_CM_GRP_NODE_ADD_GRP;
- public static String _UI_LABEL_CM_GRP_NODE_ADD_CHILD;
- public static String _UI_LABEL_CM_NODE_MIX_CONTENT;
- public static String _UI_LABEL_CM_NODE_CHILD_CONTENT;
- public static String _UI_LABEL_CM_NODE_SET_MIX_CONTENT;
- public static String _UI_LABEL_CM_NODE_SET_CHILD_CONTENT;
- public static String _UI_LABEL_CM_NODE_SET;
- public static String _UI_LABEL_CM_NODE_CONTENT;
- public static String _UI_LABEL_CM_NODE_PCDATA;
- public static String _UI_LABEL_CM_NODE_ANY;
- public static String _UI_LABEL_CM_NODE_EMPTY;
- public static String _UI_LABEL_CM_REP_NODE_CHG_OCCUR;
- public static String _UI_LABEL_COMMENT_CHG;
- public static String _UI_LABEL_DTD_FILE_ADD_ELEMENT;
- public static String _UI_LABEL_DTD_FILE_ADD_ENTITY;
- public static String _UI_LABEL_DTD_FILE_ADD_COMMENT;
- public static String _UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF;
- public static String _UI_LABEL_DTD_FILE_ADD_NOTATION;
- public static String _UI_LABEL_DTD_FILE_ADD_ATTR_LIST;
- public static String _UI_LABEL_DTD_FILE_DELETE;
- public static String _UI_LABEL_DTD_NODE_NAME_CHG;
- public static String _UI_LABEL_DTD_NODE_DELETE;
- public static String _UI_LABEL_ELEMENT_ADD_ATTR;
- public static String _UI_LABEL_ELEMENT_ADD_GRP;
- public static String _UI_LABEL_ELEMENT_ADD_CHILD;
- public static String _UI_LABEL_ENTITY_SET_PARM_ENTITY;
- public static String _UI_LABEL_ENTITY_SET_GENERAL_ENTITY;
- public static String _UI_LABEL_ENTITY_SET_EXT_ENTITY;
- public static String _UI_LABEL_ENTITY_SET_INT_ENTITY;
- public static String _UI_LABEL_ENTITY_VALUE_CHG;
- public static String _UI_LABEL_ENTITY_NDATA_CHANGE;
- public static String _UI_LABEL_EXT_NODE_PUBLIC_ID_CHG;
- public static String _UI_LABEL_EXT_NODE_SYSTEM_ID_CHG;
- public static String _UI_LABEL_NODE_LIST_ELEMENTS;
- public static String _UI_LABEL_NODE_LIST_ENTITIES;
- public static String _UI_LABEL_NODE_LIST_NOTATIONS;
- public static String _UI_LABEL_NODE_LIST_COMMENTS;
- public static String _UI_LABEL_NODE_LIST_OTHER;
- public static String _UI_LABEL_NODE_LIST_ATTRIBUTES;
- public static String _UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF;
- public static String _UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG;
- public static String _UI_LABEL_TOP_LEVEL_NODE_DELETE;
- public static String _ERROR_INCL_FILE_LOAD_FAILURE;
- public static String _ERROR_UNDECLARED_ELEMENT_1;
- public static String _UI_ERRORPART_UNDECLARED_ELEMENT_2;
- public static String _EXC_OPERATION_NOT_SUPPORTED;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DTDCoreMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java
deleted file mode 100644
index 13d705268d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-
-public class DTDCorePlugin extends Plugin {
- private static DTDCorePlugin instance;
-
- public synchronized static DTDCorePlugin getInstance() {
- return instance;
- }
-
- public static DTDCorePlugin getPlugin() {
- return instance;
- }
-
- public DTDCorePlugin() {
- super();
- instance = this;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties
deleted file mode 100644
index de49c425d4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties
+++ /dev/null
@@ -1,123 +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
-###############################################################################
-! Strings for DTDBasicTypeImpl type descriptions
-_UI_NONE_DESC=None
-
-!! NOTE TO TRANSLATOR: Do not translate following text in parentheses on following 10 lines i.e.(CDATA)
-_UI_CHARACTER_DATA_DESC=Character Data (CDATA)
-_UI_IDENTIFIER_DESC=Identifier (ID)
-_UI_ID_REFERENCE_DESC=ID Reference (IDREF)
-_UI_ID_REFERENCES_DESC=ID References (IDREFS)
-_UI_ENTITY_NAME_DESC=Entity Name (ENTITY)
-_UI_ENTITY_NAMES_DESC=Entity Names (ENTITIES)
-_UI_NAME_TOKEN_DESC=Name Token (NMTOKEN)
-_UI_NAME_TOKENS_DESC=Name Tokens (NMTOKENS)
-_UI_ENUM_NAME_TOKENS_DESC=Enumerated Name Tokens
-_UI_ENUM_NOTATION_DESC=Enumerated NOTATION
-
-! Strings from sed/model
-
-! Attribute.java
-_UI_LABEL_ATTR_DEFAULT_VAL=Attribute Default Change Value
-_UI_LABEL_ATTR_DEFAULT_KIND=Change Attribute Default Value
-_UI_LABEL_ATTR_TYPE=Change Attribute Type
-
-! AttributeEnumList
-_UI_LABEL_ATTR_ENUM_ITEMS=Change Attribute Enumeration Value
-
-! AttributeList
-_UI_LABEL_ATTR_LIST_ADD=Add Attribute
-
-! CMGroupNode
-_UI_LABEL_CM_GRP_NODE_CONNECTOR=Change Connector
-_UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT=Insert Element
-_UI_LABEL_CM_GRP_NODE_ADD_GRP=Add Group
-_UI_LABEL_CM_GRP_NODE_ADD_CHILD=Add Child Element
-
-! CMNode
-_UI_LABEL_CM_NODE_MIX_CONTENT=Mixed Content
-_UI_LABEL_CM_NODE_CHILD_CONTENT=Children Content
-_UI_LABEL_CM_NODE_SET_MIX_CONTENT=Set Mixed Content
-_UI_LABEL_CM_NODE_SET_CHILD_CONTENT=Set Children Content
-
-!! NOTE TO TRANSLATOR - USAGE: "Set <variable content> Content"
-_UI_LABEL_CM_NODE_SET=Set
-_UI_LABEL_CM_NODE_CONTENT=Content
-
-!! NOTE TO TRANSLATOR - DO NOT TRANSLATE FOLLOWING 3 LINES
-_UI_LABEL_CM_NODE_PCDATA=(#PCDATA)
-_UI_LABEL_CM_NODE_ANY=ANY
-_UI_LABEL_CM_NODE_EMPTY=EMPTY
-
-! CMRepeatableNode
-_UI_LABEL_CM_REP_NODE_CHG_OCCUR=Change Occurrence
-
-! Comment
-_UI_LABEL_COMMENT_CHG=Comment Change
-
-! DTDFile
-_UI_LABEL_DTD_FILE_ADD_ELEMENT=Add Element
-_UI_LABEL_DTD_FILE_ADD_ENTITY=Add Entity
-_UI_LABEL_DTD_FILE_ADD_COMMENT=Add Comment
-_UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF=Add Parameter Entity Reference
-_UI_LABEL_DTD_FILE_ADD_NOTATION=Add Notation
-_UI_LABEL_DTD_FILE_ADD_ATTR_LIST=Add Attribute List
-_UI_LABEL_DTD_FILE_DELETE=Delete
-
-! DTDNode
-_UI_LABEL_DTD_NODE_NAME_CHG=Name Change
-_UI_LABEL_DTD_NODE_DELETE=Delete
-
-! Element
-_UI_LABEL_ELEMENT_ADD_ATTR=Add Attribute
-_UI_LABEL_ELEMENT_ADD_GRP=Add Group
-_UI_LABEL_ELEMENT_ADD_CHILD=Add Child Element
-
-! Entity
-_UI_LABEL_ENTITY_SET_PARM_ENTITY=Set Parameter Entity
-_UI_LABEL_ENTITY_SET_GENERAL_ENTITY=Set General Entity
-_UI_LABEL_ENTITY_SET_EXT_ENTITY=Set External Entity
-_UI_LABEL_ENTITY_SET_INT_ENTITY=Set Internal Entity
-_UI_LABEL_ENTITY_VALUE_CHG=Entity Value Change
-
-!! NOTE TO TRANSLATOR - USAGE: "NDATA Change"
-_UI_LABEL_ENTITY_NDATA_CHANGE=Change
-
-! ExternalNode
-_UI_LABEL_EXT_NODE_PUBLIC_ID_CHG=Public ID Change
-_UI_LABEL_EXT_NODE_SYSTEM_ID_CHG=System ID Change
-
-! NodeList
-_UI_LABEL_NODE_LIST_ELEMENTS=Elements
-_UI_LABEL_NODE_LIST_ENTITIES=Entities
-_UI_LABEL_NODE_LIST_NOTATIONS=Notations
-_UI_LABEL_NODE_LIST_COMMENTS=Comments
-_UI_LABEL_NODE_LIST_OTHER=Other
-_UI_LABEL_NODE_LIST_ATTRIBUTES=Attributes
-
-! ParameterEntityReference
-_UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF=Change Entity Reference
-_UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG=Comment Change
-
-! TopLevelNode
-_UI_LABEL_TOP_LEVEL_NODE_DELETE=Delete
-
-_ERROR_INCL_FILE_LOAD_FAILURE = Failed to load included file
-
-! usage: _ERROR_UNDECLARED_ELEMENT_1 + <elementName> + _PARTERROR_UNDECLARED_ELEMENT_2
-_ERROR_UNDECLARED_ELEMENT_1 = Reference to undeclared element '
-_UI_ERRORPART_UNDECLARED_ELEMENT_2 =' in content model.
-
-! usage: _ERROR_DUP_ID_ATTRIBUTE_1 + <attributeName> + _PARTERROR_DUP_ID_ATTRIBUTE_2
-
-! usage:_ERROR_INVALID_DEFAULT_ATTR_VALUE_1 + <typeString> + _PARTERROR_INVALID_DEFAULT_ATTR_VALUE_2 + <attributeName>
-
-_EXC_OPERATION_NOT_SUPPORTED = Operation not supported
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
deleted file mode 100644
index 3ee60a6ee5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
+++ /dev/null
@@ -1,687 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * Hajime Katayama - bug 245216 - correction to get the best node when the ending
- * and starting offsets are equal, and they both
- * contain the offset range.
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.util.DTDExternalReferenceRemover;
-import org.eclipse.wst.dtd.core.internal.util.DTDModelUpdater;
-import org.eclipse.wst.dtd.core.internal.util.DTDNotationReferenceRemover;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-public class DTDFile implements IndexedRegion {
- private NodeList attlistList = new NodeList(this, DTDRegionTypes.ATTLIST_TAG);
- private NodeList commentList = new NodeList(this, DTDRegionTypes.COMMENT_START);
-
- boolean creatingNewModel = false;
- private DTDModelImpl fDTDModel;
-
- private NodeList elementList = new NodeList(this, DTDRegionTypes.ELEMENT_TAG);
- private NodeList entityList = new NodeList(this, DTDRegionTypes.ENTITY_TAG);
-
- private List folderList = null;
-
- private boolean isMovingNode = false;
-
- private List modelListeners = new ArrayList();
-
- private List nodeList = new ArrayList();
- private NodeList notationList = new NodeList(this, DTDRegionTypes.NOTATION_TAG);
- private NodeList unrecognizedList = new NodeList(this, DTDRegionTypes.UNKNOWN_CONTENT);
-
- public DTDFile(DTDModelImpl dtdModel) {
- this.fDTDModel = dtdModel;
- }
-
- public void addDTDFileListener(IDTDFileListener listener) {
- modelListeners.add(listener);
- }
-
- protected void addNode(DTDNode node) {
- addNode(nodeList.size(), node);
- }
-
- protected void addNode(int index, DTDNode node) {
- nodeList.add(index, node);
- /*
- * if (index < nodeList.size()) { insertBefore(node, (DTDNode)
- * nodeList.get(index)); } else { appendChild(node); }
- */
- }
-
- public DTDNode buildNode(IStructuredDocumentRegion flatNode) {
- // ITextRegionList regions = flatNode.getRegions();
- DTDNode node = null;
- if (isElement(flatNode)) {
- // then this is an element
- node = new Element(this, flatNode);
- }
- else if (isEntity(flatNode)) {
- node = new Entity(this, flatNode);
- }
- else if (isNotation(flatNode)) {
- node = new Notation(this, flatNode);
- }
- else if (isAttributeList(flatNode)) {
- node = new AttributeList(this, flatNode);
- }
- else if (isComment(flatNode)) {
- node = new Comment(this, flatNode);
- }
- else if (isParameterEntityReference(flatNode)) {
- node = new ParameterEntityReference(this, flatNode);
- }
- else if (!flatNode.getText().trim().equals("")) { //$NON-NLS-1$
- node = new Unrecognized(this, flatNode);
- }
- if (node != null) {
- insertNode(node);
- node.resolveRegions();
- }
- return node;
- }
-
- public void buildNodes(IStructuredDocumentRegionList list) {
- NodesEvent addedDTDNodes = new NodesEvent();
-
- TopLevelNode previousNode = null;
- for (int i = 0; i < list.getLength(); i++) {
- IStructuredDocumentRegion flatNode = list.item(i);
- TopLevelNode node = (TopLevelNode) buildNode(flatNode);
- // if we don't create a node, then we assume that the flat
- // node was whitespace. Tack it on to a previous toplevel
- // node
- if (node != null) {
- previousNode = node;
- addedDTDNodes.add(node);
- }
- else {
- if (previousNode != null) {
- previousNode.addWhitespaceStructuredDocumentRegion(flatNode);
- }
- }
- }
-
- if (addedDTDNodes.getNodes().size() > 0)// &&
- // creatingNewModel == false)
- {
- // now tell people about the additions
- notifyNodesAdded(addedDTDNodes);
- }
- }
-
- // Implements IndexedRegion
-
- public boolean contains(int testPosition) {
- return getStartOffset() <= testPosition && testPosition <= getEndOffset();
- }
-
- public void createAttributeList(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ATTR_LIST); //$NON-NLS-1$
- String newStream = "<!ATTLIST " + name + ">\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createComment(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_COMMENT); //$NON-NLS-1$
- String newStream = "<!-- " + name + " -->\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createElement(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ELEMENT); //$NON-NLS-1$
- String newStream = "<!ELEMENT " + name + " EMPTY>\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createEntity(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ENTITY); //$NON-NLS-1$
- String newStream = "<!ENTITY " + name + " \"\">\n"; //$NON-NLS-1$//$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createNotation(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_NOTATION); //$NON-NLS-1$
- String newStream = "<!NOTATION " + name + " SYSTEM \"\">\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createParameterEntityReference(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF); //$NON-NLS-1$
- String newStream = name + "\n"; //$NON-NLS-1$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void deleteNode(DTDNode node) {
- getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_DELETE); //$NON-NLS-1$
- deleteNode(this, node);
- getDTDModel().endRecording(this);
- }
-
- public void deleteNode(Object requestor, DTDNode node) {
- DTDNode parent = (DTDNode) node.getParentNode();
- if (parent != null) {
- parent.delete(requestor, node);
- }
- else {
- if (!isMovingNode) {
- DTDModelUpdater updater = new DTDModelUpdater();
- updater.objectAboutToBeDeleted(requestor, node);
- if (node instanceof ParameterEntityReference) {
- Entity referencedEntity = ((ParameterEntityReference) node).getEntityObject();
- if (referencedEntity != null) {
- // remove references to all elements and parm entities
- // contained in our current model
- DTDExternalReferenceRemover remover = new DTDExternalReferenceRemover();
- remover.externalReferenceAboutToChange(requestor, referencedEntity);
- }
- }
- else if (node instanceof Notation) {
- Notation notation = ((Notation) node);
- DTDNotationReferenceRemover remover = new DTDNotationReferenceRemover();
- remover.notationAboutToBeDeleted(requestor, notation);
- }
- }
-
- // no parent? then delete up until the start of the next node
- // if it is a top level node
- int startOffset = node.getStartOffset();
- int endOffset = node.getWhitespaceEndOffset();
- if (node instanceof TopLevelNode) {
- endOffset = getInsertOffset(node, true);
- }
- getStructuredDocument().replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- }
- }
-
- public NodeList getComments() {
- return commentList;
- }
-
- public DTDModelImpl getDTDModel() {
- return fDTDModel;
- }
-
- public NodeList getElementsAndParameterEntityReferences() {
- return elementList;
- }
-
- public int getEndOffset() {
- int result = -1;
- IStructuredDocumentRegion region = getStructuredDocument().getLastStructuredDocumentRegion();
- if (region != null) {
- result = region.getEndOffset();
- }
- return result;
- }
-
- 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;
- }
-
- public NodeList getEntities() {
- return entityList;
- }
-
-
-
- public int getInsertOffset(DTDNode node, boolean isAfter) {
- int offset = 0;
- if (node != null) {
- if (isAfter) {
- // then get the next node and use it's start offset
- int index = getNodes().indexOf(getNode(node.getStructuredDTDDocumentRegion()));
-
- DTDNode afterNode = null;
- if (index + 1 < getNodes().size()) {
- afterNode = (DTDNode) getNodes().get(index + 1);
- }
- if (afterNode != null) {
- offset = afterNode.getStructuredDTDDocumentRegion().getStartOffset();
- }
- else {
- // add to end
- if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
- offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
- }
- }
- }
- else {
- offset = node.getStructuredDTDDocumentRegion().getStartOffset();
- }
- }
- else {
- // add to end
- if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
- offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
- }
- }
- return offset;
- }
-
- public String getName() {
- org.eclipse.core.runtime.Path path = new org.eclipse.core.runtime.Path(getDTDModel().getId().toString());
- return path.lastSegment();
- }
-
- public DTDNode getNode(IStructuredDocumentRegion flatNode) {
- for (int i = 0; i < nodeList.size(); i++) {
- DTDNode node = (DTDNode) nodeList.get(i);
- if (node.getStructuredDTDDocumentRegion() == flatNode) {
- return node;
- }
- }
- return null;
- }
-
- public IndexedRegion getNodeAt(int offset) {
- DTDNode node = getTopLevelNodeAt(offset);
- if (node != null) {
- return node.getDeepestNode(offset);
- }
- return null;
- }
-
- public IndexedRegion getNodeAt(int startOffset, int endOffset) {
- DTDNode node = getTopLevelNodeAt(startOffset);
- if (node != null) {
- return node.getDeepestNode(startOffset, endOffset);
- }
- return null;
- }
-
- public List getNodeLists() {
- if (folderList == null) {
- folderList = new ArrayList();
- folderList.add(notationList);
- folderList.add(entityList);
- folderList.add(elementList);
- folderList.add(attlistList);
- folderList.add(commentList);
- folderList.add(unrecognizedList);
- }
- return folderList;
- }
-
- public List getNodes() {
- return nodeList;
- }
-
- public NodeList getNotations() {
- return notationList;
- }
-
- public int getStartOffset() {
- int result = -1;
- IStructuredDocumentRegion region = getStructuredDocument().getFirstStructuredDocumentRegion();
- if (region != null) {
- result = region.getStartOffset();
- }
- return result;
- }
-
- public IStructuredDocument getStructuredDocument() {
- return fDTDModel.getStructuredDocument();
- }
-
- public DTDNode getTopLevelNodeAt(int offset) {
- DTDNode bestNode = null;
- for (int i = 0; i < nodeList.size(); i++) {
- DTDNode node = (DTDNode) nodeList.get(i);
- if (node.contains(offset)) {
- if(bestNode == null) {
- bestNode = node;
- } else {
- if(node.getStartOffset() > bestNode.getStartOffset()) {
- bestNode = node;
- }
- }
- }
- }
- return bestNode;
- }
-
- public NodeList getUnrecognized() {
- return unrecognizedList;
- }
-
- public void insertIntoModel(Object requestor, DTDNode reference, DTDNode node, boolean isAfter) {
- String nodeText = ""; //$NON-NLS-1$
- if (node instanceof TopLevelNode) {
- nodeText = ((TopLevelNode) node).getFullText();
- }
- else {
- nodeText = node.getNodeText();
- }
- int offset = getInsertOffset(reference, isAfter);
- getStructuredDocument().replaceText(requestor, offset, 0, nodeText);
- }
-
-
- public void insertNode(DTDNode node) {
- int startOffset = node.getStartOffset();
- int insertIndex = -1;
- // System.out.println("startoffset = " + startOffset);
- for (int i = 0; i < getNodes().size(); i++) {
- DTDNode currentNode = (DTDNode) getNodes().get(i);
- // System.out.println("currentNode endOffset = "
- // +currentNode.getEndOffset());
-
- if (currentNode.getEndOffset() > startOffset) {
- // System.out.println("endoffset " +
- // currentNode.getEndOffset() + " > " + startOffset);
- insertIndex = i;
- break;
- }
- }
- if (insertIndex == -1) {
- insertIndex = getNodes().size();
- }
-
-
- // System.out.println("insert index = " + insertIndex);
-
- addNode(insertIndex, node);
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isAttributeList(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ATTLIST_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isComment(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 2) {
- ITextRegion region = flatNode.getRegions().get(1);
- if (region.getType().equals(DTDRegionTypes.COMMENT_START)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isElement(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ELEMENT_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isEntity(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ENTITY_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isNotation(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.NOTATION_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isParameterEntityReference(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() == 1) {
- ITextRegion region = flatNode.getRegions().get(0);
- if (region.getType().equals(DTDRegionTypes.ENTITY_PARM)) {
- return true;
- }
- }
- return false;
- }
-
- boolean isSameTopLevelType(DTDNode affectedNode) {
- IStructuredDocumentRegion flatNode = affectedNode.getStructuredDTDDocumentRegion();
- // return true if the flatnode still matches what the affectedNode
- // is representing
- if (affectedNode instanceof Element && isElement(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Entity && isEntity(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Comment && isComment(flatNode)) {
- return true;
- }
- if (affectedNode instanceof AttributeList && isAttributeList(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Notation && isNotation(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Unrecognized && isUnrecognized(flatNode)) {
- return true;
- }
- return false;
- }
-
- public boolean isUnrecognized(IStructuredDocumentRegion flatNode) {
- return !isElement(flatNode) && !isEntity(flatNode) && !isNotation(flatNode) && !isParameterEntityReference(flatNode) && !isAttributeList(flatNode) && !isComment(flatNode);
- }
-
- public void moveNode(Object requestor, DTDNode referenceNode, DTDNode nodeToMove, boolean isAfter) {
- isMovingNode = true;
-
- deleteNode(requestor, nodeToMove);
- insertIntoModel(requestor, referenceNode, nodeToMove, isAfter);
- isMovingNode = false;
- }
-
- public void newModel(NewDocumentEvent event) {
- creatingNewModel = true;
- nodeList.clear();
- NodesEvent removeEvent = new NodesEvent();
- removeEvent.getNodes().addAll(nodeList);
- notifyNodesRemoved(removeEvent);
- /* removeChildNodes(); */
-
- if (event.getStructuredDocument() != null && event.getStructuredDocument().getRegionList() != null) {
- buildNodes(event.getStructuredDocument().getRegionList());
- }
- creatingNewModel = false;
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- IStructuredDocumentRegionList oldNodes = event.getOldStructuredDocumentRegions();
- NodesEvent removedDTDNodes = new NodesEvent();
- for (int i = 0; i < oldNodes.getLength(); i++) {
- IStructuredDocumentRegion flatNode = oldNodes.item(i);
-
- for (Iterator iter = getNodes().iterator(); iter.hasNext();) {
- DTDNode node = (DTDNode) iter.next();
- if (node.getStructuredDTDDocumentRegion() == flatNode) {
- removedDTDNodes.add(node);
- }
- }
- }
-
- buildNodes(event.getNewStructuredDocumentRegions());
-
- if (removedDTDNodes.getNodes().size() > 0) {
- notifyNodesRemoved(removedDTDNodes);
- removeNodes(removedDTDNodes.getNodes());
- }
- }
-
- public void notifyNodeChanged(DTDNode node) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodeChanged(node);
- }
- }
-
- public void notifyNodesAdded(NodesEvent addedNodes) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodesAdded(addedNodes);
- }
- }
-
- protected void notifyNodesRemoved(NodesEvent event) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodesRemoved(event);
- }
- }
-
- public void rebuildNodes(List nodes) {
- // remove the old nodes
- removeNodes(nodes);
-
- // now rebuild them
- NodesEvent addedDTDNodes = new NodesEvent();
- Iterator dtdNodes = nodes.iterator();
- while (dtdNodes.hasNext()) {
- DTDNode dtdNode = (DTDNode) dtdNodes.next();
- // System.out.println("rebuilding " +
- // dtdNode.getStructuredDocumentRegion().getText());
-
- DTDNode node = buildNode(dtdNode.getStructuredDTDDocumentRegion());
- if (node != null) {
- addedDTDNodes.add(node);
- }
- }
- if (addedDTDNodes.getNodes().size() > 0) {
- // now tell people about the additions
- notifyNodesAdded(addedDTDNodes);
- }
- }
-
- public void regionChanged(RegionChangedEvent event) {
- ITextRegion changedRegion = event.getRegion();
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- DTDNode affectedNode = (DTDNode) getNodeAt(flatNode.getStartOffset(changedRegion), flatNode.getEndOffset(changedRegion));
- if (affectedNode != null) {
- // no need to resolve regions as it is just a change
- // affectedNode.resolveRegions();
- notifyNodeChanged(affectedNode);
- }
- }
-
- public void regionsReplaced(RegionsReplacedEvent event) {
- List nodesToRebuild = new ArrayList();
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- DTDNode affectedNode = getNode(flatNode);
-
- if (!isSameTopLevelType(affectedNode)) {
- // Bug 111100 - Fire off a node removal event
- // to remove the node from the tree viewer
- NodesEvent removedDTDNodes = new NodesEvent();
- removedDTDNodes.add(affectedNode);
- notifyNodesRemoved(removedDTDNodes);
- nodesToRebuild.add(affectedNode);
- rebuildNodes(nodesToRebuild);
- }
- else {
- affectedNode.resolveRegions();
- notifyNodeChanged(affectedNode);
- // now try and determine which ones were added
- NodesEvent addedDTDNodes = new NodesEvent();
- ITextRegionList newRegions = event.getNewRegions();
- int size = newRegions.size();
- for (int i = 0; i < size; i++) {
- ITextRegion region = newRegions.get(i);
- DTDNode deepestNode = affectedNode.getDeepestNode(flatNode.getStartOffset(region), flatNode.getEndOffset(region));
- // Bug 111100 - We do not need to fire a node added event
- // for the affectedNode because that is already handled by
- // the node changed event above
- if (deepestNode != affectedNode && !addedDTDNodes.getNodes().contains(deepestNode)) {
- addedDTDNodes.add(deepestNode);
- }
- }
- if (addedDTDNodes.getNodes().size() > 0) {
- notifyNodesAdded(addedDTDNodes);
- }
- }
- }
-
- public void removeDTDFileListener(IDTDFileListener listener) {
- modelListeners.remove(listener);
- }
-
- protected void removeNodes(List nodes) {
- getNodes().removeAll(nodes);
- /*
- * for (int i = 0; i < nodes.size(); i++) {
- * removeChild((DTDNode)nodes.get(i)); } // end of for ()
- */
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java
deleted file mode 100644
index 0bc28389b8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.text.TextRegionListImpl;
-import org.eclipse.wst.xml.core.internal.document.NodeContainer;
-import org.w3c.dom.Node;
-
-
-public abstract class DTDNode extends NodeContainer implements IndexedRegion {
-
- // these are characteroffsets
- protected DTDFile dtdFile;
-
- // flat node that contains this node
- protected IStructuredDocumentRegion flatNode;
-
- protected TextRegionListImpl regions = new TextRegionListImpl();
-
- protected TextRegionListImpl whitespace = new TextRegionListImpl();
-
- public DTDNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- this.dtdFile = dtdFile;
- this.flatNode = flatNode;
- }
-
- public void addRegion(ITextRegion region) {
- /*
- * if (startRegion == null) { startRegion = region; } endRegion =
- * region;
- */
- regions.add(region);
- }
-
- public void addWhitespaceRegion(ITextRegion region) {
- whitespace.add(region);
- }
-
- public void beginRecording(Object requestor, String label) {
- getDTDFile().getDTDModel().beginRecording(requestor, label);
- }
-
- public Node cloneNode(boolean deepest) {
- return null;
- }
-
- public boolean contains(int testPosition) {
- return containsRange(testPosition, testPosition);
- }
-
- public boolean containsRange(int start, int end) {
- return getStartOffset() <= start && end <= getEndOffset();
- }
-
- public void delete(DTDNode child) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_NODE_DELETE); //$NON-NLS-1$
- delete(this, child);
- endRecording(this);
- }
-
- public void delete(Object requestor, DTDNode child) {
- replaceText(requestor, child.getStartOffset(), child.getFullNodeLength(), ""); //$NON-NLS-1$
- }
-
- public void endRecording(Object requestor) {
- getDTDFile().getDTDModel().endRecording(requestor);
- }
-
- public Object[] getChildren() {
- return getChildrenList().toArray();
- }
-
- public List getChildrenList() {
- Node child = getFirstChild();
- if (child != null) {
- List children = new ArrayList();
- for (; child != null; child = child.getNextSibling()) {
- children.add(child);
- }
- return children;
- }
- else {
- return Collections.EMPTY_LIST;
- }
- }
-
- public DTDNode getDeepestNode(int offset) {
- if (contains(offset)) {
- // now see if a child contains this offset
- Object[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- DTDNode child = (DTDNode) children[i];
- DTDNode deepest = child.getDeepestNode(offset);
- if (deepest != null) {
- return deepest;
- }
- } // end of for ()
- return this;
- }
- return null;
- }
-
- public DTDNode getDeepestNode(int start, int end) {
- if (containsRange(start, end)) {
- // now see if a child contains this offset
- Object[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- DTDNode child = (DTDNode) children[i];
- DTDNode deepest = child.getDeepestNode(start, end);
- if (deepest != null) {
- return deepest;
- }
- } // end of for ()
- return this;
- }
- return null;
- }
-
- public DTDFile getDTDFile() {
- return dtdFile;
- }
-
- public int getEndOffset() {
- return getStructuredDTDDocumentRegion().getEndOffset(getEndRegion());
- }
-
- public ITextRegion getEndRegion() {
- return regions.get(regions.size() - 1);// endRegion;
- }
-
- /**
- */
- public FactoryRegistry getFactoryRegistry() {
- DTDModelImpl model = dtdFile.getDTDModel();
- if (model != null) {
- FactoryRegistry reg = model.getFactoryRegistry();
- if (reg != null)
- return reg;
- }
- return null;
- }
-
- public int getFullNodeLength() {
- return getWhitespaceEndOffset() - getStartOffset();
- }
-
- public String getFullNodeText() {
- String text = getNodeText();
- if (whitespace.size() > 0) {
- RegionIterator iter = new RegionIterator(whitespace);
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- text += getStructuredDTDDocumentRegion().getText(region);
- }
- }
- return text;
- }
-
- abstract public String getImagePath();
-
- public String getName() {
- ITextRegion region = getNameRegion();
- if (region != null) {
- return getStructuredDTDDocumentRegion().getText(region);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getNameRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.NAME) {
- return region;
- }
- }
- return null;
- }
-
- // return the first token containing the specified token type
- public ITextRegion getNextRegion(RegionIterator iter, String type) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(type)) {
- return region;
- }
- }
- return null;
- }
-
- public int getNodeLength() {
- return getEndOffset() - getStartOffset();
- }
-
- public String getNodeName() {
- return getName();
- }
-
- public String getNodeText() {
- StringBuffer sb = new StringBuffer();
-
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- sb.append(getStructuredDTDDocumentRegion().getText(region));
- }
- return sb.toString();
- }
-
- public short getNodeType() {
- return -1;
- }
-
- public int getStartOffset() {
- return getStructuredDTDDocumentRegion().getStartOffset(getStartRegion());
- }
-
- // private Region startRegion,endRegion;
- public ITextRegion getStartRegion() {
- return regions.get(0);
- // return startRegion;
- }
-
- /**
- * Get the value of flatNode.
- *
- * @return value of flatNode.
- *
- * ISSUE:named changed not to be confused with default access protected
- * super class method, but should re-think if this is correct technique.
- * Perhaps getFirstRegion?
- */
- public IStructuredDocumentRegion getStructuredDTDDocumentRegion() {
- return flatNode;
- }
-
- // return end offset including whitespace
- // or just the end offset if there is no whitespace
- public int getWhitespaceEndOffset() {
- if (whitespace.size() > 0) {
- ITextRegion region = whitespace.get(whitespace.size() - 1);
- return getStructuredDTDDocumentRegion().getEndOffset(region);
- }
-
- return getEndOffset();
- }
-
- public boolean hasTrailingWhitespace() {
- return whitespace.size() > 0;
- }
-
- public RegionIterator iterator() {
- // System.out.println("create region iter " + this.getClass() + " with
- // start , end = " + getStartOffset() + ", " +getEndOffset());
- return new RegionIterator(regions);
- }
-
- public void replaceText(Object requestor, int start, int length, String newText) {
- getDTDFile().getStructuredDocument().replaceText(requestor, start, length, newText);
- }
-
- public void resolveRegions() {
- }
-
- public void setName(Object requestor, String name) {
- if (!getName().equals(name)) {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- // nameToken.updateText(name);
- getDTDFile().getDTDModel().getReferenceUpdater().nameAboutToChange(requestor, this, name);
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(nameRegion), nameRegion.getLength(), name);
- }
- }
- }
-
- public void setName(String name) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_NODE_NAME_CHG); //$NON-NLS-1$
- setName(this, name);
- endRecording(this);
- }
-
- /**
- * Set the value of flatNode.
- *
- * @param v
- * Value to assign to flatNode. ISSUE:named changed not to be
- * confused with default access protected super class method,
- * but should re-think if this is correct technique
- */
- void setStructuredDTDDocumentRegion(IStructuredDocumentRegion v) {
- this.flatNode = v;
- }
-
- // skips past next name token in the iterator
- protected void skipPastName(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.NAME) {
- break;
- }
- }
- }
-
- public boolean supports(java.lang.String feature, java.lang.String version) {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java
deleted file mode 100644
index 9c6db9ba53..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java
+++ /dev/null
@@ -1,56 +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.dtd.core.internal;
-
-
-public interface DTDResource {
- // Enumeration Constants
- public static final String ANYICON = "icons/full/obj16/any.gif"; //$NON-NLS-1$
- public static final String ATTRIBUTEICON = "icons/full/obj16/attribute.gif"; //$NON-NLS-1$
- public static final String ATTRIBUTELISTICON = "icons/full/obj16/attribute_list.gif"; //$NON-NLS-1$
- public static final String COMMENTICON = "icons/full/obj16/comment.gif"; //$NON-NLS-1$
-
- public static final String DTDFILEICON = "icons/full/obj16/DTDFile.gif"; //$NON-NLS-1$
- public static final String ELEMENTICON = "icons/full/obj16/element.gif"; //$NON-NLS-1$
- public static final String ELEMENTREFICON = "icons/full/obj16/element_ref.gif"; //$NON-NLS-1$
- public static final String EMPTYICON = "icons/full/obj16/emptycontent.gif"; //$NON-NLS-1$
- public static final String ENTITYICON = "icons/full/obj16/entity.gif"; //$NON-NLS-1$
- public static final String ENTITYREFERENCEICON = "icons/full/obj16/entity_reference.gif"; //$NON-NLS-1$
- public static final String FLDR_ATTLIST = "icons/full/obj16/folder_attlist_obj.gif"; //$NON-NLS-1$
- public static final String FLDR_COMM = "icons/full/obj16/folder_comments_obj.gif"; //$NON-NLS-1$
-
- public static final String FLDR_EL = "icons/full/obj16/fldr_el.gif"; //$NON-NLS-1$
- public static final String FLDR_ENT = "icons/full/obj16/fldr_ent.gif"; //$NON-NLS-1$
- public static final String FLDR_NOT = "icons/full/obj16/fldr_not.gif"; //$NON-NLS-1$
- public static final String FLDR_UNREC = "icons/full/obj16/fldr_unrec.gif"; //$NON-NLS-1$
-
- public static final String NEWHTMLFORM = "icons/full/obj16/genhtmform_wiz.gif"; //$NON-NLS-1$
- public static final String NOTATIONICON = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
-
- public static final String ONECHOICEICON = "icons/full/obj16/onechoice.gif"; //$NON-NLS-1$
-
- public static final String ONEICON = "icons/full/obj16/one.gif"; //$NON-NLS-1$
- public static final String ONEORMORECHOICEICON = "icons/full/obj16/oneormorechoice.gif"; //$NON-NLS-1$
- public static final String ONEORMOREICON = "icons/full/obj16/oneormore.gif"; //$NON-NLS-1$
- public static final String ONEORMORESEQUENCEICON = "icons/full/obj16/oneormoresequence.gif"; //$NON-NLS-1$
-
- public static final String ONESEQUENCEICON = "icons/full/obj16/onesequence.gif"; //$NON-NLS-1$
- public static final String OPTIONALCHOICEICON = "icons/full/obj16/optionalchoice.gif"; //$NON-NLS-1$
- public static final String OPTIONALICON = "icons/full/obj16/optional.gif"; //$NON-NLS-1$
- public static final String OPTIONALSEQUENCEICON = "icons/full/obj16/optionalsequence.gif"; //$NON-NLS-1$
- public static final String PCDATAICON = "icons/full/obj16/txtext.gif"; //$NON-NLS-1$
- public static final String UNRECOGNIZEDICON = "icons/full/obj16/unrecognized_content.gif"; //$NON-NLS-1$
- public static final String ZEROORMORECHOICEICON = "icons/full/obj16/zeroormorechoice.gif"; //$NON-NLS-1$
- public static final String ZEROORMOREICON = "icons/full/obj16/zeroormore.gif"; //$NON-NLS-1$
- public static final String ZEROORMORESEQUENCEICON = "icons/full/obj16/zeroormoresequence.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java
deleted file mode 100644
index eca244feb7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.Node;
-
-
-public class Element extends NamedTopLevelNode {
-
- List attListList = new ArrayList();
-
- List attributes = new ArrayList();
-
- protected CMNode fContentModel;
-
- public Element(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- super(dtdFile, flatNode, DTDRegionTypes.ELEMENT_TAG);
- }
-
- public void addAttribute(String name) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_ATTR); //$NON-NLS-1$
- List attLists = getAttributeLists();
- if (attLists.size() == 0) {
- getDTDFile().createAttributeList(this, getName(), true);
- attLists = getAttributeLists();
- }
- if (attLists.size() > 0) {
- AttributeList attList = (AttributeList) attLists.get(attLists.size() - 1);
- attList.addAttribute(name);
- }
- endRecording(this);
- }
-
- public void addChild() {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_CHILD); //$NON-NLS-1$
- addContent(this, " EMPTY"); //$NON-NLS-1$
- endRecording(this);
- }
-
- protected void addContent(Object requestor, String content) {
- ITextRegion whitespace = getWhitespaceAfterName();
- int startOffset = 0;
- int length = 0;
- if (whitespace != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(whitespace);
- length = whitespace.getLength() >= 2 ? 1 : 0;
- }
- else {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- }
- else {
- ITextRegion elementTag = getNextRegion(iterator(), DTDRegionTypes.ELEMENT_TAG);
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(elementTag);
- }
- }
- replaceText(requestor, startOffset, length, content);
- }
-
- public void addGroup() {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_GRP); //$NON-NLS-1$
- addContent(this, " ()"); //$NON-NLS-1$
- endRecording(this);
- }
-
- public Node cloneNode(boolean deep) {
- return new Element(dtdFile, flatNode);
- }
-
- public List getAttributeLists() {
- attListList.clear();
- String elementName = getName();
- Iterator iter = dtdFile.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof AttributeList && node.getName().equals(elementName)) {
- attListList.add(node);
- }
- }
- return attListList;
- }
-
-
-
- public CMNode getContentModel() {
- // Object[] children = getChildren()
- return (CMNode) getFirstChild();// contentModel;
- }
-
- public List getElementAttributes() {
- attributes.clear();
- Iterator attLists = getAttributeLists().iterator();
- while (attLists.hasNext()) {
- AttributeList attList = (AttributeList) attLists.next();
-
- Object[] children = attList.getChildren();
- for (int i = 0; i < children.length; i++) {
- attributes.add(children[i]);
- }
- }
- return attributes;
- }
-
- public String getImagePath() {
- return DTDResource.ELEMENTICON;
- }
-
- public short getNodeType() {
- return Node.ELEMENT_NODE;
- }
-
- public void replaceContentModel(Object requestor, CMNode node) {
- replaceContentModel(requestor, node.getNodeText());
- }
-
- public void replaceContentModel(Object requestor, String nodeText) {
- int offset = 0;
- int length = 0;
- CMNode contentModel = getContentModel();
- if (contentModel != null) {
- offset = contentModel.getStartOffset();
- length = contentModel.getWhitespaceEndOffset() - offset;
- replaceText(requestor, offset, length, nodeText);
- }
- else {
- addContent(requestor, nodeText);
- }
- }
-
- public void resolveRegions() {
- // System.out.println("element node stream = " +
- // tokenStream.getString());
- fContentModel = null;
- removeChildNodes();
- RegionIterator iter = iterator();
-
- if (getNameRegion() != null) {
- // we skip past the name token is our name
- skipPastName(iter);
- }
-
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
-
- if (fContentModel == null) {
- if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
- fContentModel = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
- fContentModel = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- fContentModel = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- }
-
- if (fContentModel != null) {
- if (!currentRegion.getType().equals(DTDRegionTypes.END_TAG)) {
- // content model gets all regions except for the '>'
- fContentModel.addRegion(currentRegion);
- }
- else {
- // if it is equal to the end tag, then don't add anymore
- // regions
- // for the content model
- break;
- }
-
- }
-
- }
- if (fContentModel != null) {
- appendChild(fContentModel);
- // this is the root element content so set it true
- fContentModel.setRootElementContent(true);
- // now tell the content model to resolve it's regions
- fContentModel.resolveRegions();
-
- }
- }
-
- public void setContentModel(CMNode contentModel) {
- this.fContentModel = contentModel;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java
deleted file mode 100644
index dae8da47c5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// external node contains code to help set and get public ids
-public class Entity extends ExternalNode {
-
- private static String setExternalEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_EXT_ENTITY; //$NON-NLS-1$
- private static String setGeneralEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_GENERAL_ENTITY; //$NON-NLS-1$
- private static String setInternalEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_INT_ENTITY; //$NON-NLS-1$
-
- private static String setParameterEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_PARM_ENTITY; //$NON-NLS-1$
-
- public Entity(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.ENTITY_TAG);
- }
-
- public String getImagePath() {
- return DTDResource.ENTITYICON;
- }
-
-
- /**
- * Get the value of notationName.
- *
- * @return value of notationName.
- */
- public String getNotationName() {
- ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (ndataRegion != null) {
- return getStructuredDTDDocumentRegion().getText(ndataRegion);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getPercentRegion() {
- return getNextRegion(iterator(), DTDRegionTypes.PERCENT);
- }
-
- /**
- * Get the value of value.
- *
- * @return value of value.
- */
- public String getValue() {
- if (!isExternalEntity()) {
- ITextRegion valueRegion = getNextQuotedLiteral(iterator());
- if (valueRegion != null) {
- return getValueFromQuotedRegion(valueRegion);
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Get the value of externalEntity.
- *
- * @return value of externalEntity.
- */
- public boolean isExternalEntity() {
- return getPublicKeywordRegion(iterator()) != null || getSystemKeywordRegion(iterator()) != null;
- }
-
- /**
- * Get the value of isParameterEntity.
- *
- * @return value of isParameterEntity.
- */
- public boolean isParameterEntity() {
- return getPercentRegion() != null;
- }
-
- private void removeNData(Object requestor) {
- ITextRegion ndataRegion = null;
-
- // see if we have an NDATA keyword
- ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_KEYWORD);
- int startOffset = 0, endOffset = 0;
- if (ndataRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(ndataRegion);
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataRegion);
- }
- ITextRegion value = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (value != null) {
- if (startOffset == 0) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(value);
- }
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(value);
- }
- replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- }
-
- /**
- * Set the value of externalEntity.
- *
- * @param v
- * Value to assign to externalEntity.
- */
- public void setExternalEntity(boolean isExternalEntity) {
- if (isExternalEntity() != isExternalEntity) {
- // externalEntity = v;
- beginRecording(this, isExternalEntity ? setExternalEntity : setInternalEntity);
- if (isExternalEntity) {
- // we need to get rid of the value literal
- ITextRegion quote = getNextRegion(iterator(), DTDRegionTypes.SINGLEQUOTED_LITERAL);
- if (quote == null) {
- quote = getNextRegion(iterator(), DTDRegionTypes.DOUBLEQUOTED_LITERAL);
- }
- if (quote != null) {
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(quote), quote.getLength(), ""); //$NON-NLS-1$
- }
- setSystemID(""); //$NON-NLS-1$
- }
- else {
- // we need to get rid of text between end of name region and
- // the last double quoted literal
- RegionIterator iter = iterator();
- ITextRegion keyword = getSystemKeywordRegion(iter);
- int startOffset = 0;
- int length = 0;
- if (keyword == null) {
- // reset the iterator
- iter = iterator();
- keyword = getPublicKeywordRegion(iter);
- }
- if (keyword != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(keyword);
- // start with a length just equal to the keyword for now
- length = keyword.getLength();
- }
- else {
- // reset the iterator since we didn't find the keyword
- iter = iterator();
- // just go from after the name
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(getNameRegion());
- }
-
- // now that we have the start, look for the end
- ITextRegion lastRegion = null;
-
- if (lastRegion == null) {
- // then look for last quoted literal
- while (iter.hasNext()) {
- ITextRegion literal = getNextQuotedLiteral(iter);
- if (literal != null) {
- lastRegion = literal;
- }
- }
- }
-
- if (lastRegion != null) {
- length = getStructuredDTDDocumentRegion().getEndOffset(lastRegion) - startOffset;
- }
- replaceText(this, startOffset, length, "\"\""); //$NON-NLS-1$
- removeNData(this);
- }
- endRecording(this);
- }
- }
-
- public void setNotationName(Object requestor, String newNotation) {
- if (!getNotationName().equals(newNotation)) {
- if (!newNotation.equals("")) { //$NON-NLS-1$
- //
- ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (ndataRegion != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(ndataRegion), ndataRegion.getLength(), newNotation);
- }
- else {
- // time to create one
- int startOffset = 0;
- String string = ""; //$NON-NLS-1$
- RegionIterator iter = iterator();
- ITextRegion ndataKeyword = getNextRegion(iter, DTDRegionTypes.NDATA_KEYWORD);
- if (ndataKeyword == null) {
- // we'll need to create one after the last quoted
- // literal
- // Reset iterator
- string += " NDATA "; //$NON-NLS-1$
- iter = iterator();
- ITextRegion lastQuotedLiteral = null;
- while (iter.hasNext()) {
- ITextRegion literal = getNextQuotedLiteral(iter);
- if (literal != null) {
- lastQuotedLiteral = literal;
- }
- }
- if (lastQuotedLiteral != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(lastQuotedLiteral);
- }
- else {
- // created after the system or public keyword
- ITextRegion keyword = getPublicKeywordRegion(iterator());
- if (keyword == null) {
- keyword = getSystemKeywordRegion(iterator());
- }
- // we shouldn't be null here since we check if we
- // were external already
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(keyword);
- }
-
- }
- else {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataKeyword);
- }
- replaceText(requestor, startOffset, 0, string + newNotation);
- }
- }
- else {
- // need to remove the ndata stuff
- removeNData(requestor);
- }
- }
- }
-
- /**
- * Set the value of notationName.
- *
- * @param newNotation
- * Value to assign to notationName.
- */
- public void setNotationName(String newNotation) {
- beginRecording(this, "NDATA " + DTDCoreMessages._UI_LABEL_ENTITY_NDATA_CHANGE); //$NON-NLS-1$ //$NON-NLS-2$
- setNotationName(this, newNotation);
- endRecording(this);
- }
-
- /**
- * Set the value of isParameterEntity.
- *
- * @param v
- * Value to assign to isParameterEntity.
- */
- public void setParameterEntity(boolean v) {
- if (isParameterEntity() != v) {
- beginRecording(this, v ? setParameterEntity : setGeneralEntity);
- if (v) {
- RegionIterator iter = iterator();
- ITextRegion startTag = getNextRegion(iter, DTDRegionTypes.ENTITY_TAG);
- int startOffset = 0, length = 0;
-
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
- if (region.getType() == DTDRegionTypes.WHITESPACE && region.getLength() > 1) {
- length = 1;
- }
- }
- else {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(startTag);
- }
- replaceText(this, startOffset, length, " %"); //$NON-NLS-1$
- // now get rid of any NData since it is only allowed if the
- // entity is a general entity and not a parameter entity
- removeNData(this);
- }
- else {
- // get rid of percent region
- ITextRegion percentRegion = getPercentRegion();
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(percentRegion), percentRegion.getLength(), ""); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
- }
-
- /**
- * Set the value of value.
- *
- * @param v
- * Value to assign to value.
- */
- public void setValue(Object requestor, String v) {
- if (!isExternalEntity()) {
- if (!getValue().equals(v)) {
- // then it makes sense to change the value
- ITextRegion valueRegion = getNextQuotedLiteral(iterator());
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (valueRegion != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(valueRegion), valueRegion.getLength(), quoteChar + v + quoteChar);
- }
- else {
- int startOffset = 0;
- RegionIterator iter = iterator();
- ITextRegion region = getNextRegion(iter, DTDRegionTypes.NAME);
- if (region == null) {
- // create it after the percent if there is one
- region = getPercentRegion();
- }
- if (region == null) {
- // if still null, then create it after the element tag
- region = getStartTag(iterator());
- }
-
- if (region != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
- replaceText(requestor, startOffset, 0, quoteChar + v + quoteChar);
- }
- }
- }
- }
- }
-
- /**
- * Set the value of value.
- *
- * @param v
- * Value to assign to value.
- */
- public void setValue(String v) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_ENTITY_VALUE_CHG); //$NON-NLS-1$
- setValue(this, v);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java
deleted file mode 100644
index 4e3cea7b42..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java
+++ /dev/null
@@ -1,250 +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.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// base class for nodes that can contain external content
-public abstract class ExternalNode extends NamedTopLevelNode {
-
- String publicID;
-
- String systemID;
-
- public ExternalNode(DTDFile file, IStructuredDocumentRegion flatNode, String tagType) {
- super(file, flatNode, tagType);
- }
-
- public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- return region;
- }
- }
- return null;
- }
-
- /**
- * Get the value of publicID.
- *
- * @return value of publicID.
- */
- public String getPublicID() {
- ITextRegion publicValue = getPublicValueRegion();
- if (publicValue != null) {
- return getValueFromQuotedRegion(publicValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getPublicKeywordRegion(RegionIterator iter) {
- return getNextRegion(iter, DTDRegionTypes.PUBLIC_KEYWORD);
- }
-
- public ITextRegion getPublicValueRegion() {
- RegionIterator iter = iterator();
-
- ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
- if (publicKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- return quotedLiteral;
- }
- }
- return null;
- }
-
- /**
- * Get the value of systemID.
- *
- * @return value of systemID.
- */
- public String getSystemID() {
- ITextRegion systemValue = getSystemValueRegion();
- if (systemValue != null) {
- return getValueFromQuotedRegion(systemValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getSystemKeywordRegion(RegionIterator iter) {
- return getNextRegion(iter, DTDRegionTypes.SYSTEM_KEYWORD);
- }
-
- public ITextRegion getSystemValueRegion() {
- RegionIterator iter = iterator();
-
- ITextRegion systemKeyword = getSystemKeywordRegion(iter);
- if (systemKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- return quotedLiteral;
- }
- }
- else {
- // try and see if there is a second quoted literal after a public
- // keyword
- iter = iterator();
- ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
- if (publicKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null && iter.hasNext()) {
- // now get the second quoted literal
- quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- // got it!
- return quotedLiteral;
- }
- }
- }
- }
- return null;
- }
-
- public String getValueFromQuotedRegion(ITextRegion region) {
- String type = region.getType();
- if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDTDDocumentRegion().getText(region);
- return text.substring(1, text.length() - 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Set the value of publicID.
- *
- * @param v
- * Value to assign to publicID.
- */
- public void setPublicID(Object requestor, String v) {
- if (!v.equals(publicID)) {
- publicID = v;
- ITextRegion publicValue = getPublicValueRegion();
- ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
- ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
- ITextRegion systemValue = getSystemValueRegion();
-
- if (v.equals("")) { //$NON-NLS-1$
- if (publicKeyword != null) {
- // time to get rid of the public keyword and value
- // and replace it with the system one
- int startOffset = getStructuredDTDDocumentRegion().getStartOffset(publicKeyword);
- String newString = "SYSTEM"; //$NON-NLS-1$
- if (systemValue == null) {
- newString += " \"\""; //$NON-NLS-1$
- }
- replaceText(requestor, startOffset, getStructuredDTDDocumentRegion().getEndOffset(publicValue) - startOffset, newString);
- }
- }
- else {
- // here were setting a non empty value
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (publicValue != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(publicValue), publicValue.getLength(), quoteChar + publicID + quoteChar);
- }
- else {
- // time to create stuff
- if (publicKeyword != null) {
- // then just put our new value after the keyword
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- else {
- // we need the public keyword as well
- if (systemKeyword != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemKeyword), systemKeyword.getLength(), "PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- else {
- ITextRegion nameRegion = getNameRegion();
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
-
-
- /**
- * Set the value of publicID.
- *
- * @param v
- * Value to assign to publicID.
- */
- public void setPublicID(String v) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_EXT_NODE_PUBLIC_ID_CHG); //$NON-NLS-1$
- setPublicID(this, v);
- endRecording(this);
- }
-
- /**
- * Set the value of systemID.
- *
- * @param v
- * Value to assign to systemID.
- */
- public void setSystemID(Object requestor, String v) {
- if (!v.equals(systemID) || (getPublicKeywordRegion(iterator()) == null && getSystemKeywordRegion(iterator()) == null)) {
- systemID = v;
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITextRegion systemValue = getSystemValueRegion();
- if (systemValue != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemValue), systemValue.getLength(), quoteChar + systemID + quoteChar);
- }
- else {
- ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
-
- // time to create stuff
- if (systemKeyword != null) {
- // then just put our new value after the keyword
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(systemKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- else {
- // see if we have a public keyword
- ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
- if (publicKeyword == null) {
- ITextRegion nameRegion = getNameRegion();
-
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " SYSTEM " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- else {
- // put it after the public value region
- ITextRegion publicValueRegion = getPublicValueRegion();
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicValueRegion), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
-
- }
- }
-
- }
- }
-
-
- /**
- * Set the value of systemID.
- *
- * @param v
- * Value to assign to systemID.
- */
- public void setSystemID(String v) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_EXT_NODE_SYSTEM_ID_CHG); //$NON-NLS-1$
- setSystemID(this, v);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java
deleted file mode 100644
index 158f48523e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java
+++ /dev/null
@@ -1,143 +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.dtd.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.dtd.core"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- 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 (!isDebugging())
- return;
-
- 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)) {
- 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;
- }
- }
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java
deleted file mode 100644
index 9f7f51f9f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java
+++ /dev/null
@@ -1,135 +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.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class NamedTopLevelNode extends TopLevelNode {
-
- private String tagStartType;
-
- public NamedTopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode, String type) {
- super(dtdFile, flatNode);
- tagStartType = type;
- }
-
- public ITextRegion getNameRegion() {
- // name region is located after the whitespace (which is after
- // the elementtag
- RegionIterator iter = iterator();
- getNextRegion(iter, tagStartType);
-
- if (!iter.hasNext()) {
- return null;
- }
-
- ITextRegion region = iter.next();
- if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- return null;
- }
-
- if (!iter.hasNext()) {
- return null;
- }
-
- region = iter.next();
- if (region.getType().equals(DTDRegionTypes.NAME)) {
- return region;
- }
-
- // we normally stop here, but for entities, we have to see if we are
- // at a '%'. if so, we skip that and find the name after the
- // whitespace again
- if (tagStartType == DTDRegionTypes.ENTITY_TAG && region.getType().equals(DTDRegionTypes.PERCENT) && iter.hasNext()) {
- region = iter.next();
-
- if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- return null;
- }
-
- if (!iter.hasNext()) {
- return null;
- }
-
- region = iter.next();
- if (region.getType().equals(DTDRegionTypes.NAME)) {
- return region;
- }
- }
-
- return null;
- }
-
- public ITextRegion getStartTag(RegionIterator iter) {
- return getNextRegion(iter, tagStartType);
- }
-
- public ITextRegion getWhitespaceAfterName() {
- ITextRegion nameRegion = getNameRegion();
- RegionIterator iter = iterator();
- // skip past the element tag region
- getNextRegion(iter, tagStartType);
- boolean foundName = false;
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (!foundName && nameRegion != null && region == nameRegion) {
- foundName = true;
- }
-
- if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- // there is no name region or we have already passed it
- if (nameRegion == null || foundName) {
- return region;
- }
- }
- }
- return null;
- }
-
- public void setName(Object requestor, String name) {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- super.setName(requestor, name);
- }
- else {
- RegionIterator iter = iterator();
- ITextRegion elementTagRegion = getNextRegion(iter, tagStartType);
- int replaceLength = 0;
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- if (region.getLength() >= 2) {
- // there are 2 spaces between 'ELEMENT' and the
- // content
- // Change replace length to 1 so that the new name and
- // the content are separated by a single space
- replaceLength = 1;
- }
- }
- }
-
- // beginRecording(requestor, "Name Change");
- String newText = " " + name; //$NON-NLS-1$
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(elementTagRegion), replaceLength, newText);
- // endRecording(requestor);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java
deleted file mode 100644
index b0026d79e6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-
-public class NodeList {
- protected DTDFile dtdFile;
-
- ArrayList listNodes = new ArrayList();
-
- protected String listType;
-
- public NodeList(DTDFile dtdFile, String tokenType) {
- listType = tokenType;
- this.dtdFile = dtdFile;
- }
-
- public String getImagePath() {
- if (listType == DTDRegionTypes.ELEMENT_TAG) {
- return DTDResource.FLDR_EL;
- }
- else if (listType == DTDRegionTypes.ENTITY_TAG) {
- return DTDResource.FLDR_ENT;
- }
- else if (listType == DTDRegionTypes.NOTATION_TAG) {
- return DTDResource.FLDR_NOT;
- }
- else if (listType == DTDRegionTypes.COMMENT_START) {
- return DTDResource.FLDR_COMM;
- }
- else if (listType == DTDRegionTypes.ATTLIST_TAG) {
- return DTDResource.FLDR_ATTLIST;
- }
- else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
- return DTDResource.FLDR_UNREC;
- }
- else
- return null;
- }
-
- public String getListType() {
- return listType;
- }
-
- public String getName() {
- if (listType == DTDRegionTypes.ELEMENT_TAG) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_ELEMENTS; //$NON-NLS-1$
- }
- else if (listType == DTDRegionTypes.ENTITY_TAG) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_ENTITIES; //$NON-NLS-1$
- }
- else if (listType == DTDRegionTypes.NOTATION_TAG) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_NOTATIONS; //$NON-NLS-1$
- }
- else if (listType == DTDRegionTypes.COMMENT_START) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_COMMENTS; //$NON-NLS-1$
- }
- else if (listType == DTDRegionTypes.ATTLIST_TAG) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_ATTRIBUTES; //$NON-NLS-1$
- }
- else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
- return DTDCoreMessages._UI_LABEL_NODE_LIST_OTHER; //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
-
- public ArrayList getNodes() {
- listNodes.clear();
- Iterator iter = dtdFile.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (listType == DTDRegionTypes.ELEMENT_TAG && (node instanceof Element || node instanceof ParameterEntityReference)) {
- listNodes.add(node);
- }
- else if (listType == DTDRegionTypes.ATTLIST_TAG && node instanceof AttributeList) {
- listNodes.add(node);
- }
- else if (listType == DTDRegionTypes.ENTITY_TAG && node instanceof Entity) {
- listNodes.add(node);
- }
- else if (listType == DTDRegionTypes.NOTATION_TAG && node instanceof Notation) {
- listNodes.add(node);
- }
- else if (listType == DTDRegionTypes.COMMENT_START && node instanceof Comment) {
- listNodes.add(node);
- }
- else if (listType == DTDRegionTypes.UNKNOWN_CONTENT && node instanceof Unrecognized) {
- listNodes.add(node);
- }
- }
- return listNodes;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java
deleted file mode 100644
index 0410b7c645..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public class Notation extends ExternalNode {
-
- public Notation(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.NOTATION_TAG);
- }
-
- public String getImagePath() {
- return DTDResource.NOTATIONICON;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java
deleted file mode 100644
index 73bbbdcb06..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class ParameterEntityReference extends NamedTopLevelNode {
-
-
-
- public class StartEndPair {
- public int startOffset, endOffset;
- }
-
- private Entity cachedEntity = null;
-
- public ParameterEntityReference(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.COMMENT_START);
- }
-
- public Entity getEntityObject() {
- if (cachedEntity != null && !cachedEntity.getName().equals(getReferencedEntity())) {
- // if we have a cached entity, but the name doesnt match,
- // null it now, so we perform a lookup
- cachedEntity = null;
- }
-
- if (cachedEntity == null) {
- List nodes = getDTDFile().getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode node = (DTDNode) nodes.get(i);
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.getName().equals(getReferencedEntity())) {
- cachedEntity = entity;
- }
- }
- }
- }
- return cachedEntity;
- }
-
- public String getImagePath() {
- return DTDResource.ENTITYREFERENCEICON;
- }
-
- public String getName() {
- return getStructuredDTDDocumentRegion().getText();
- }
-
- public String getReferencedEntity() {
- String text = getName();
- return getName().substring(1, text.length() - 1);
- }
-
- private void getStartAndEndOffsetForText(StartEndPair pair) {
- RegionIterator iter = iterator();
- ITextRegion commentStartTag = getStartTag(iter);
- ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
- if (commentStartTag != null) {
- pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
- }
- if (endCommentTag != null) {
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset(endCommentTag);
- }
- }
-
- public String getText() {
- String text = getStructuredDTDDocumentRegion().getText();
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
- }
-
- public void setReferencedEntity(Object requestor, String name) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(), getStructuredDTDDocumentRegion().getLength(), "%" + name + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void setReferencedEntity(String name) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF); //$NON-NLS-1$
- setReferencedEntity(this, name);
- endRecording(this);
- }
-
- public void setText(String newText) {
- beginRecording(this, DTDCoreMessages._UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG); //$NON-NLS-1$
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java
deleted file mode 100644
index 88c27c6f02..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java
+++ /dev/null
@@ -1,84 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class TopLevelNode extends DTDNode {
-
- private ArrayList flatNodes = new ArrayList();
-
- public TopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- super(dtdFile, flatNode);
- flatNodes.add(flatNode);
- }
-
- public void addWhitespaceStructuredDocumentRegion(IStructuredDocumentRegion node) {
- flatNodes.add(node);
- }
-
- // specialize this so we delete the objects flat node range
- // AND any whitespace
- public void delete() {
- beginRecording(getDTDFile(), DTDCoreMessages._UI_LABEL_TOP_LEVEL_NODE_DELETE); //$NON-NLS-1$
- IStructuredDocumentRegion first = (IStructuredDocumentRegion) flatNodes.get(0);
- IStructuredDocumentRegion last = (IStructuredDocumentRegion) flatNodes.get(flatNodes.size() - 1);
- int startOffset = first.getStartOffset();
- int endOffset = last.getEndOffset();
-
- replaceText(getDTDFile(), startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- endRecording(getDTDFile());
- }
-
- public ITextRegion getEndRegion() {
- int size = flatNode.getRegions().size();
- if (size > 0) {
- return flatNode.getRegions().get(size - 1);
- }
- return null;
- }
-
- // includes what gettext gives us plus any whitespace
- // trailing it
- public String getFullText() {
- StringBuffer sb = new StringBuffer();
- Iterator iter = flatNodes.iterator();
- while (iter.hasNext()) {
- IStructuredDocumentRegion fNode = (IStructuredDocumentRegion) iter.next();
- sb.append(fNode.getText());
- }
- return sb.toString();
- }
-
- public ITextRegion getStartRegion() {
- if (flatNode.getRegions().size() > 0) {
- return flatNode.getRegions().get(0);
- }
- return null;
- }
-
- public RegionIterator iterator() {
- // System.out.println("create region iter " + this.getClass() + " with
- // start , end = " + getStartOffset() + ", " +getEndOffset());
- return new RegionIterator(flatNode, getStartOffset(), getEndOffset());
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java
deleted file mode 100644
index a7e8f3a7e2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public class Unrecognized extends TopLevelNode {
-
- public Unrecognized(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getImagePath() {
- return DTDResource.UNRECOGNIZEDICON;
- }
-
- public String getName() {
- String text = getStructuredDTDDocumentRegion().getText();
- if (text.length() <= 30) {
- return text;
- }
- else {
- return text.substring(0, 29) + "..."; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java
deleted file mode 100644
index 44f110d19b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java
+++ /dev/null
@@ -1,206 +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.dtd.core.internal.content;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLResourceEncodingDetector;
-
-
-
-public final class ContentDescriberForDTD 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;
- }
-
- // same rules as for XML
- private IResourceCharsetDetector getDetector() {
- return new XMLResourceEncodingDetector();
- }
-
- /**
- * @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 = ((XMLResourceEncodingDetector) 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) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java
deleted file mode 100644
index 727329abfd..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java
+++ /dev/null
@@ -1,273 +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.dtd.core.internal.document;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.dtd.core.internal.provisional.document.DTDModel;
-import org.eclipse.wst.dtd.core.internal.util.DTDReferenceUpdater;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-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.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;
-
-
-public final class DTDModelImpl extends AbstractStructuredModel implements IStructuredDocumentListener, DTDModel {
-
- public static boolean deleteFile(String fileName) {
- boolean result = false;
-
- // create the temp File object
- File file = new File(fileName);
- if (file.exists())
- result = file.delete();
- return result;
- }
-
- private DTDFile document;
-
- // private List errorMessages = new ArrayList();
-
- // entity reference names found in the conditional IGNORE sections
- private Vector ignoredEntityRefs;
-
- private boolean refreshRequired = false;
-
- protected DTDReferenceUpdater refUpdater = new DTDReferenceUpdater();
-
- public DTDModelImpl() {
- super();
- document = new DTDFile(this);
- document.addDTDFileListener(new IDTDFileListener() {
-
- public void nodeChanged(DTDNode node) {
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.isExternalEntity()) {
- // just say they have changed for now
- setReferencedModelsChanged();
- }
- }
- }
-
- public void nodesAdded(NodesEvent event) {
- checkIfExternalReferencesChanged(event);
- }
-
- public void nodesRemoved(NodesEvent event) {
- checkIfExternalReferencesChanged(event);
- }
- });
- }
-
- public void beginRecording(Object requester, String label) {
- super.beginRecording(requester, label);
- // clear reference updater cache
- getReferenceUpdater().clearCache();
- }
-
- void checkIfExternalReferencesChanged(NodesEvent event) {
- Iterator iter = event.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.isExternalEntity()) {
- // just say they have changed for now
- setReferencedModelsChanged();
- }
- }
- }
- }
-
- //
- // The following function helps determine the list of things that
- // can be used in a parameter entity reference content
- // Optional parameter is to allow the currently used DTDEntity to
- // be included in the combobox.
- //
- public LabelValuePair[] createParmEntityContentItems(Entity entity) {
- NodeList entities = getDTDFile().getEntities();
-
- Vector items = new Vector();
-
- if (entity != null) {
- String name = "%" + entity.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- items.addElement(new LabelValuePair(name, name));
- }
-
- for (Iterator i = entities.getNodes().iterator(); i.hasNext();) {
- Entity entityAt = (Entity) i.next();
- if (entityAt.isParameterEntity() && entityAt.isExternalEntity()) {
- String name = "%" + entityAt.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- items.addElement(new LabelValuePair(name, name));
- }
- }
- LabelValuePair[] comboArray = new LabelValuePair[items.size()];
- items.copyInto(comboArray);
- return comboArray;
- }
-
- public void endRecording(Object requester) {
- super.endRecording(requester);
- // clear reference updater cache
- getReferenceUpdater().clearCache();
- }
-
-
- public DTDFile getDTDFile() {
- return document;
- }
-
- // Returns entity reference names that are in
- // the conditional IGNORE sections.
- public Vector getIgnoredEntityRefs() {
- if (ignoredEntityRefs == null)
- ignoredEntityRefs = new Vector();
- return ignoredEntityRefs;
- }
-
- public IndexedRegion getIndexedRegion(int offset) {
- if (this.document == null)
- return null;
- // System.out.println("getNode at " + offset + " returning = " +
- // this.document.getNodeAt(offset));
-
- return this.document.getNodeAt(offset);
- }
-
- public DTDReferenceUpdater getReferenceUpdater() {
- return refUpdater;
- }
-
- public boolean isReferencedModelsChanged() {
- return refreshRequired;
- }
-
- public boolean isRefreshRequired() {
- return refreshRequired;
- }
-
- public void newModel(NewDocumentEvent flatModelEvent) {
- document.newModel(flatModelEvent);
- // System.out.println("\nnewmodel");
- outputStructuredDocument(flatModelEvent);
- }
-
- public void noChange(NoChangeEvent flatModelEvent) {
- // System.out.println("\nnochange");
- outputStructuredDocument(flatModelEvent);
-
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent flatModelEvent) {
- // System.out.println("\nnodesreplaced");
- document.nodesReplaced(flatModelEvent);
- outputStructuredDocument(flatModelEvent);
-
- }
-
- public void outputStructuredDocument(StructuredDocumentEvent flatModelEvent) {
- // System.out.println("structuredDocument source = '" +
- // flatModelEvent.getStructuredDocument().getText() + "'");
- // System.out.println("new String = '" +
- // flatModelEvent.getOriginalChanges() +"'");
- // System.out.println("deleted String = '" +
- // flatModelEvent.getDeletedText() +"'");
- // Enumeration e =
- // flatModelEvent.getStructuredDocument().getNodes().elements();
- // int i = 0;
- // for (; e.hasMoreElements(); i++)
- // {
- // BasicStructuredDocumentRegion node =
- // (BasicStructuredDocumentRegion) e.nextElement();
- // outputStructuredDocumentRegion(node);
- // System.out.println(" " + i +". " + node.hashCode() + " '"
- // +node.getText() + "'");
- // }
- }
-
- public void outputStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- // int size = flatNode.getNumberOfRegions();
- // for (int i = 0; i < size; i++)
- // {
- // Region region = (Region) flatNode.getRegions().get(i);
- // System.out.println(i + ". " + region.getType());
-
- // } // end of for ()
-
- }
-
- public void regionChanged(RegionChangedEvent flatModelEvent) {
- // System.out.println("\nregion changed");
- document.regionChanged(flatModelEvent);
- // System.out.println("= " +
- // flatModelEvent.getStructuredDocumentRegion().getText());
- // System.out.println("region changed " +
- // flatModelEvent.getRegion().hashCode() + " = " +
- // flatModelEvent.getRegion());
-
- outputStructuredDocument(flatModelEvent);
- }
-
- public void regionsReplaced(RegionsReplacedEvent flatModelEvent) {
- // System.out.println("\nregion replaced");
- document.regionsReplaced(flatModelEvent);
- outputStructuredDocument(flatModelEvent);
- }
-
- public void setReferencedModelsChanged() {
- refreshRequired = true;
- }
-
- public void setRefreshRequired(boolean value) {
- refreshRequired = value;
- }
-
-
- /**
- * @param newStructuredDocument
- * org.eclipse.wst.sse.core.text.IStructuredDocument
- */
- public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
- IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
- if (newStructuredDocument == oldStructuredDocument)
- return; // noting to do
-
- if (oldStructuredDocument != null)
- oldStructuredDocument.removeDocumentChangingListener(this);
- super.setStructuredDocument(newStructuredDocument);
- if (newStructuredDocument != null) {
- if (newStructuredDocument.getLength() > 0) {
- newModel(new NewDocumentEvent(newStructuredDocument, this));
- }
- newStructuredDocument.addDocumentChangingListener(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
deleted file mode 100644
index fc34977838..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,261 +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.dtd.core.internal.encoding;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- }
- catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- // createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
deleted file mode 100644
index 55c9bdf7a5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
+++ /dev/null
@@ -1,109 +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.dtd.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- *
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
-
- public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
- protected byte[] fBuffer;
-
- protected InputStream fInputStream;
-
- protected ByteReader() {
- super();
- }
-
- public ByteReader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE);
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- }
-
- public ByteReader(InputStream inputStream, int size) {
- this.fInputStream = inputStream;
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- this.fBuffer = new byte[size];
-
- }
-
- public void close() throws IOException {
- this.fInputStream.close();
- }
-
- public void mark(int readAheadLimit) {
- this.fInputStream.mark(readAheadLimit);
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public int read() throws IOException {
- int b0 = this.fInputStream.read();
- return (b0 & 0x00FF);
- }
-
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > this.fBuffer.length) {
- length = this.fBuffer.length;
- }
-
- int count = this.fInputStream.read(this.fBuffer, 0, length);
-
- for (int i = 0; i < count; i++) {
- int b0 = this.fBuffer[i];
- // the 0x00FF is to "lose" the negative bits filled in the byte to
- // int conversion
- // (and which would be there if cast directly from byte to char).
- char c0 = (char) (b0 & 0x00FF);
- ch[offset + i] = c0;
- }
- return count;
- }
-
- public boolean ready() throws IOException {
- return this.fInputStream.available() > 0;
- }
-
- public void reset() throws IOException {
- this.fInputStream.reset();
- }
-
- public long skip(long n) throws IOException {
- return this.fInputStream.skip(n);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java
deleted file mode 100644
index 552b5a36b1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java
+++ /dev/null
@@ -1,61 +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
- *
- *******************************************************************************/
-/*
- * Created on 28-Aug-03
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.wst.dtd.core.internal.encoding;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLResourceEncodingDetector;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentCharsetDetector;
-
-
-/**
- * @author kboo
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public final class DTDDocumentCharsetDetector extends AbstractResourceEncodingDetector implements IDocumentCharsetDetector {
-
- public String getSpecDefaultEncoding() {
- // by default, UTF-8 as per XML spec
- final String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- /**
- *
- */
-
- protected void parseInput() throws IOException {
- IDocumentCharsetDetector documentEncodingDetector = new XMLDocumentCharsetDetector();
- documentEncodingDetector.set(fReader);
- fEncodingMemento = ((XMLResourceEncodingDetector)documentEncodingDetector).getEncodingMemento();
-
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java
deleted file mode 100644
index 668f08b847..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java
+++ /dev/null
@@ -1,74 +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.dtd.core.internal.encoding;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionParser;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentReParser;
-import org.eclipse.wst.dtd.core.internal.text.StructuredTextPartitionerForDTD;
-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.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 final class DTDDocumentLoader extends AbstractDocumentLoader {
-
- public DTDDocumentLoader() {
- super();
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForDTD();
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new DTDDocumentCharsetDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- public RegionParser getParser() {
- return new DTDRegionParser();
- }
-
- protected String getPreferredNewLineDelimiter(IFile file) {
- String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForDTD.ContentTypeID_DTD);
- if (delimiter == null)
- delimiter = super.getPreferredNewLineDelimiter(file);
- return delimiter;
- }
-
- protected String getSpecDefaultEncoding() {
- String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- DTDStructuredDocumentReParser reParser = new DTDStructuredDocumentReParser();
- reParser.setStructuredDocument(document);
- if (document instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument) document).setReParser(reParser);
- }
- return document;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java
deleted file mode 100644
index 80603772b6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java
+++ /dev/null
@@ -1,36 +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.dtd.core.internal.encoding;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java
deleted file mode 100644
index 2490968d23..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java
+++ /dev/null
@@ -1,24 +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.dtd.core.internal.event;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-public interface IDTDFileListener {
-
- public void nodeChanged(DTDNode node);
-
- public void nodesAdded(NodesEvent event);
-
- public void nodesRemoved(NodesEvent event);
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java
deleted file mode 100644
index 23972c0f2f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java
+++ /dev/null
@@ -1,32 +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.dtd.core.internal.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-
-public final class NodesEvent {
- private ArrayList changedNodes = new ArrayList();
-
- public void add(DTDNode changedNode) {
- changedNodes.add(changedNode);
- }
-
- public List getNodes() {
- return changedNodes;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java
deleted file mode 100644
index 5b51acb744..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.modelhandler;
-
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentLoader;
-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 final class DTDModelLoader extends AbstractModelLoader {
- public DTDModelLoader() {
- super();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new DTDDocumentLoader();
- }
- return documentLoaderInstance;
- }
-
- public IModelLoader newInstance() {
- return new DTDModelLoader();
- }
-
- public IStructuredModel newModel() {
- IStructuredModel model = new DTDModelImpl();
- // now done in create
- // model.setStructuredDocument(createNewStructuredDocument());
- // model.setFactoryRegistry(defaultFactoryRegistry());
- return model;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java
deleted file mode 100644
index e90e10c996..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.modelhandler;
-
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentCharsetDetector;
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentLoader;
-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 final class ModelHandlerForDTD extends AbstractModelHandler implements IModelHandler {
- private static String AssociatedContentTypeId = "org.eclipse.wst.dtd.core.dtdsource"; //$NON-NLS-1$
- private static String ModelHandlerID = "org.eclipse.wst.dtd.core.internal.modelhandler"; //$NON-NLS-1$
-
- public ModelHandlerForDTD() {
- super();
- setId(ModelHandlerID);
- setAssociatedContentTypeId(AssociatedContentTypeId);
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new DTDDocumentLoader();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new DTDDocumentCharsetDetector();
- }
-
- public IModelLoader getModelLoader() {
- return new DTDModelLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java
deleted file mode 100644
index 3c9cb8a697..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java
+++ /dev/null
@@ -1,28 +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.dtd.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class DTDRegionFactory {
- public static ITextRegion createRegion(String tokenKind, int start, int length) {
- ITextRegion region = null;
- if (tokenKind != null) {
- // ISSUE: DTD regions don't distinguish text from white space
- region = new ContextRegion(tokenKind, start, length, length);
- }
- return region;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java
deleted file mode 100644
index 9be6f189f3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java
+++ /dev/null
@@ -1,271 +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.dtd.core.internal.parser;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentRegionFactory;
-import org.eclipse.wst.dtd.core.internal.tokenizer.DTDTokenizer;
-import org.eclipse.wst.dtd.core.internal.tokenizer.Token;
-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;
-
-
-public class DTDRegionParser implements RegionParser {
- private Vector cachedRegions = null;
- private DTDTokenizer tokenizer = null;
- private IStructuredDocumentRegion cachedNode = null; // top of node
- // chain
-
- public RegionParser newInstance() {
- return new DTDRegionParser();
- }
-
- private IStructuredDocumentRegion addNewNodes(IStructuredDocumentRegion lastNode, Vector regions) {
- IStructuredDocumentRegion leadingSpaceNode = null;
- IStructuredDocumentRegion contentNode = null;
- IStructuredDocumentRegion trailingSpaceNode = null;
- LinkedList nodeSeeds = new LinkedList();
- int nRegions = regions.size();
- int leadingSpaceEnd = -1;
- int trailingSpaceBegin = nRegions;
-
- // find leading space
- nodeSeeds.clear();
- for (int i = 0; i < nRegions; i++) {
- ITextRegion region = (ITextRegion) regions.get(i);
- String type = region.getType();
- if (isBlankRegion(type)) {
- leadingSpaceEnd = i;
- nodeSeeds.addLast(region);
- }
- else {
- break;
- }
- }
- if (!nodeSeeds.isEmpty()) {
- leadingSpaceNode = createNode(nodeSeeds);
- if (lastNode != null) {
- lastNode.setNext(leadingSpaceNode);
- leadingSpaceNode.setPrevious(lastNode);
- }
- lastNode = leadingSpaceNode;
- }
-
- // find trailing space
- if (leadingSpaceEnd < nRegions - 1) {
- nodeSeeds.clear();
- for (int i = nRegions - 1; 0 <= i; i--) {
- ITextRegion region = (ITextRegion) regions.get(i);
- String type = ((ITextRegion) regions.get(i)).getType();
- if (isBlankRegion(type)) {
- trailingSpaceBegin = i;
- nodeSeeds.addFirst(region);
- }
- else {
- break;
- }
- }
- if (!nodeSeeds.isEmpty()) {
- trailingSpaceNode = createNode(nodeSeeds);
- }
-
- nodeSeeds.clear();
- for (int i = leadingSpaceEnd + 1; i < trailingSpaceBegin; i++) {
- nodeSeeds.addLast(regions.get(i));
- }
- if (!nodeSeeds.isEmpty()) {
- contentNode = createNode(nodeSeeds);
- if (lastNode != null) {
- lastNode.setNext(contentNode);
- contentNode.setPrevious(lastNode);
- }
- lastNode = contentNode;
- }
- if (trailingSpaceNode != null) {
- lastNode.setNext(trailingSpaceNode);
- trailingSpaceNode.setPrevious(lastNode);
- lastNode = trailingSpaceNode;
- }
- }
-
- return lastNode;
- }
-
- private IStructuredDocumentRegion createNode(LinkedList regions) {
- if (regions.size() == 0) {
- return null;
- }
-
- IStructuredDocumentRegion node = DTDStructuredDocumentRegionFactory.createStructuredDocumentRegion(DTDStructuredDocumentRegionFactory.DTD_GENERIC);
- int start = ((ITextRegion) regions.getFirst()).getStart();
- int length = ((ITextRegion) regions.getLast()).getEnd() - start;
- node.setStart(start);
- node.setLength(length);
- for (ListIterator i = regions.listIterator(0); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- node.addRegion(region);
- region.adjustStart(-start);
- }
- node.setEnded(true);
-
- return node;
- }
-
- private IStructuredDocumentRegion createNodeChain(List regions) {
- IStructuredDocumentRegion headNode = null;
- IStructuredDocumentRegion lastNode = null;
- Vector nodeSeeds = new Vector();
-
- for (Iterator e = regions.iterator(); e.hasNext();) {
- ITextRegion region = (ITextRegion) e.next();
- String type = region.getType();
- // If the following regions appear,
- // a previous node is closed in front of it.
- if (!nodeSeeds.isEmpty() && isBeginningRegion(type)) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- nodeSeeds.clear();
- }
- nodeSeeds.addElement(region);
-
- // The following regions close the current node.
- if (!nodeSeeds.isEmpty() && isEndingRegion(type)) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- nodeSeeds.clear();
- }
-
- if (headNode == null && lastNode != null) {
- headNode = findFirstNode(lastNode);
- }
- }
-
- // close current node forcibly.
- if (!nodeSeeds.isEmpty()) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- if (headNode == null && lastNode != null) {
- headNode = findFirstNode(lastNode);
- }
- }
- return headNode;
- }
-
- private IStructuredDocumentRegion findFirstNode(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion firstNode = node;
- IStructuredDocumentRegion prevNode = null;
- while ((prevNode = firstNode.getPrevious()) != null) {
- firstNode = prevNode;
- }
- return firstNode;
- }
-
- public IStructuredDocumentRegion getDocumentRegions() {
- if (cachedNode != null) {
- return cachedNode;
- }
-
- List regions = getRegions();
- IStructuredDocumentRegion headNode = createNodeChain(regions);
- cachedNode = headNode;
-
- return headNode;
- }
-
- public List getRegions() {
- if (cachedRegions != null) {
- return cachedRegions;
- }
-
- Vector regions = new Vector();
- Token currentToken = null;
- do {
- try {
- currentToken = (Token) tokenizer.yylex();
- if (currentToken != null) {
- ITextRegion region = DTDRegionFactory.createRegion(currentToken.getType(), currentToken.getStartOffset(), currentToken.getLength());
- regions.add(region);
- }
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found"); //$NON-NLS-1$
- }
- catch (java.io.IOException e) {
- System.out.println("Error opening file"); //$NON-NLS-1$
- }
- }
- while (currentToken != null);
-
- cachedRegions = regions;
- return regions;
- }
-
- public void reset(Reader reader) {
- if (tokenizer == null) {
- try {
- tokenizer = new DTDTokenizer(reader);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java DTDTokenizer <inputfile>"); //$NON-NLS-1$
- }
- }
- else {
- try {
- tokenizer.yyreset(reader);
- }
- catch (java.io.IOException e) {
- System.out.println("Error opening file"); //$NON-NLS-1$
- }
- }
-
- cachedNode = null;
- cachedRegions = null;
- }
-
- /**
- * An additional offset for use with any position-dependant parsing rules
- */
- public void reset(Reader reader, int offset) {
- reset(reader);
- }
-
- public void reset(String input) {
- reset(new StringReader(input));
- }
-
- public void reset(String input, int offset) {
- reset(input);
- }
-
- // never used
- DTDTokenizer getTokenizer() {
- return tokenizer;
- }
-
- private boolean isBeginningRegion(String type) {
- return (type == DTDRegionTypes.START_TAG) || (type == DTDRegionTypes.ENTITY_PARM);
- }
-
- private boolean isBlankRegion(String type) {
- return (type == DTDRegionTypes.WHITESPACE);
- }
-
- private boolean isEndingRegion(String type) {
- return (type == DTDRegionTypes.END_TAG) || (type == DTDRegionTypes.ENTITY_PARM) || (type == DTDRegionTypes.COMMENT_END);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java
deleted file mode 100644
index 114b661d03..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java
+++ /dev/null
@@ -1,76 +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.dtd.core.internal.parser;
-
-public interface DTDRegionTypes {
- public static final String regionPrefix = "org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes."; //$NON-NLS-1$
-
- public static final String NAME = regionPrefix + "NAME"; //$NON-NLS-1$
- public static final String START_TAG = regionPrefix + "START_TAG"; //$NON-NLS-1$
- public static final String END_TAG = regionPrefix + "END_TAG"; //$NON-NLS-1$
- public static final String LEFT_PAREN = regionPrefix + "LEFT_PAREN"; //$NON-NLS-1$
- public static final String RIGHT_PAREN = regionPrefix + "RIGHT_PAREN"; //$NON-NLS-1$
- public static final String WHITESPACE = regionPrefix + "WHITESPACE"; //$NON-NLS-1$
- public static final String CONNECTOR = regionPrefix + "CONNECTOR"; //$NON-NLS-1$
-
- public static final String OCCUR_TYPE = regionPrefix + "OCCUR_TYPE"; //$NON-NLS-1$
- public static final String EXCLAMATION = regionPrefix + "EXCLAMATION"; //$NON-NLS-1$
- public static final String PERCENT = regionPrefix + "PERCENT"; //$NON-NLS-1$
- public static final String SEMICOLON = regionPrefix + "SEMICOLON"; //$NON-NLS-1$
- public static final String COMMENT_START = regionPrefix + "COMMENT"; //$NON-NLS-1$
- public static final String COMMENT_CONTENT = regionPrefix + "COMMENT_CONTENT"; //$NON-NLS-1$
- public static final String COMMENT_END = regionPrefix + "COMMENT_END"; //$NON-NLS-1$
-
- public static final String NOTATION_TAG = regionPrefix + "NOTATION_TAG"; //$NON-NLS-1$
- public static final String NOTATION_CONTENT = regionPrefix + "NOTATION_CONTENT"; //$NON-NLS-1$
-
- public static final String ENTITY_TAG = regionPrefix + "ENTITY_TAG"; //$NON-NLS-1$
- public static final String ENTITY_PARM = regionPrefix + "ENTITY_PARM"; //$NON-NLS-1$
- public static final String ENTITY_CONTENT = regionPrefix + "ENTITY_CONTENT"; //$NON-NLS-1$
- public static final String NDATA_VALUE = regionPrefix + "NDATA_VALUE"; //$NON-NLS-1$
-
- public static final String ELEMENT_TAG = regionPrefix + "ELEMENT_TAG"; //$NON-NLS-1$
- public static final String ELEMENT_CONTENT = regionPrefix + "ELEMENT_CONTENT"; //$NON-NLS-1$
- public static final String CONTENT_EMPTY = regionPrefix + "CONTENT_EMPTY"; //$NON-NLS-1$
- public static final String CONTENT_ANY = regionPrefix + "CONTENT_ANY"; //$NON-NLS-1$
- public static final String CONTENT_PCDATA = regionPrefix + "CONTENT_PCDATA"; //$NON-NLS-1$
-
- public static final String ATTLIST_TAG = regionPrefix + "ATTLIST_TAG"; //$NON-NLS-1$
-
- public static final String SYSTEM_KEYWORD = regionPrefix + "SYSTEM_KEYWORD"; //$NON-NLS-1$
- public static final String PUBLIC_KEYWORD = regionPrefix + "PUBLIC_KEYWORD"; //$NON-NLS-1$
- public static final String NDATA_KEYWORD = regionPrefix + "NDATA_KEYWORD"; //$NON-NLS-1$
- public static final String SINGLEQUOTED_LITERAL = regionPrefix + "SINGLEQUOTED_LITERAL"; //$NON-NLS-1$
- public static final String DOUBLEQUOTED_LITERAL = regionPrefix + "DOUBLEQUOTED_LITERAL"; //$NON-NLS-1$
- public static final String UNKNOWN_CONTENT = regionPrefix + "UNKNOWN_CONTENT"; //$NON-NLS-1$
-
- public static final String ATTRIBUTE_NAME = regionPrefix + "ATTRIBUTE_NAME"; //$NON-NLS-1$
-
- // attribute type keywords
- public static final String CDATA_KEYWORD = regionPrefix + "CDATA_KEYWORD"; //$NON-NLS-1$
- public static final String ID_KEYWORD = regionPrefix + "ID_KEYWORD"; //$NON-NLS-1$
- public static final String IDREF_KEYWORD = regionPrefix + "IDREF_KEYWORD"; //$NON-NLS-1$
- public static final String IDREFS_KEYWORD = regionPrefix + "IDREFS_KEYWORD"; //$NON-NLS-1$
- public static final String ENTITY_KEYWORD = regionPrefix + "ENTITY_KEYWORD"; //$NON-NLS-1$
- public static final String ENTITIES_KEYWORD = regionPrefix + "ENTITIES_KEYWORD"; //$NON-NLS-1$
- public static final String NMTOKEN_KEYWORD = regionPrefix + "NMTOKEN_KEYWORD"; //$NON-NLS-1$
- public static final String NMTOKENS_KEYWORD = regionPrefix + "NMTOKENS_KEYWORD"; //$NON-NLS-1$
- public static final String NOTATION_KEYWORD = regionPrefix + "NOTATION_KEYWORD"; //$NON-NLS-1$
- public static final String ENUM_CHOICE = regionPrefix + "ENUM_CHOICE"; //$NON-NLS-1$
- public static final String PARM_ENTITY_TYPE = regionPrefix + "PARM_ENTITY_TYPE"; //$NON-NLS-1$
-
- // attribute defaults keywords
- public static final String REQUIRED_KEYWORD = regionPrefix + "REQUIRED_KEYWORD"; //$NON-NLS-1$
- public static final String IMPLIED_KEYWORD = regionPrefix + "IMPLIED_KEYWORD"; //$NON-NLS-1$
- public static final String FIXED_KEYWORD = regionPrefix + "FIXED_KEYWORD"; //$NON-NLS-1$
-}// DTDRegionTypes
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java
deleted file mode 100644
index c3fb65ad01..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java
+++ /dev/null
@@ -1,35 +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.dtd.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.dtd.core.internal.DTDCorePlugin;
-
-/**
- * Sets default values for DTD Core preferences
- */
-public class DTDCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(DTDCorePlugin.getInstance().getBundle().getSymbolicName());
-
- // this could be made smarter by actually looking up the content
- // type's valid extensions
- node.put(DTDCorePreferenceNames.DEFAULT_EXTENSION, "dtd"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java
deleted file mode 100644
index d348e0fb0d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java
+++ /dev/null
@@ -1,32 +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.dtd.core.internal.preferences;
-
-/**
- * Common preference keys used by DTD core
- *
- * @plannedfor 1.0
- */
-public class DTDCorePreferenceNames {
- private DTDCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * The default extension to use when none is specified in the New File
- * Wizard.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java
deleted file mode 100644
index 23758eb6e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.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.dtd.core.internal.provisional.contenttype;
-
-/**
- * <p>
- * This class, with its one field, is a convenience to provide compile-time
- * safety when referring to the DTD contentType ID.
- * </p>
- *
- * <p>
- * This class is not meant to be instantiated or subclassed.
- * </p>
- */
-
-public final class ContentTypeIdForDTD {
- /**
- * The value of the ContentTypeID_DTD id field will match what is
- * specified in org.eclipse.wst.dtd.core/plugin.xml for the DTD content
- * type.
- *
- * This value is intentionally set through a default protected method so
- * that it will not be inlined.
- */
- public final static String ContentTypeID_DTD = getConstantString();
-
- private ContentTypeIdForDTD() {
- super();
- }
-
- /**
- * @return the DTD Content Type Identifier ID as a String
- */
- static String getConstantString() {
- return "org.eclipse.wst.dtd.core.dtdsource"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java
deleted file mode 100644
index f5c701f214..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java
+++ /dev/null
@@ -1,27 +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.dtd.core.internal.provisional.document;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * <p>
- * An interface implemented by the SSE-based DTD model.
- * </p>
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface DTDModel extends IStructuredModel{
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
deleted file mode 100644
index ac35f739d2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
+++ /dev/null
@@ -1,24 +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.dtd.core.internal.provisional.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types DTD.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @deprecated use org.eclipse.wst.dtd.core.text.IDTDPartitions
- */
-public interface IDTDPartitionTypes {
-
- String DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java
deleted file mode 100644
index 837e27e321..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java
+++ /dev/null
@@ -1,28 +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.dtd.core.internal.tasks;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-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 DTDFileTaskScanner extends StructuredFileTaskScanner {
- public DTDFileTaskScanner() {
- super();
- }
-
- protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
- return textRegion.getType().equals(DTDRegionTypes.COMMENT_CONTENT);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java
deleted file mode 100644
index 87e1a188ba..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.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.text.StructuredDocumentReParser;
-
-
-public class DTDStructuredDocumentReParser extends StructuredDocumentReParser {
-
- public StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
- IStructuredDocumentRegion startNode = fStructuredDocument.getRegionAtCharacterOffset(fStart);
- IStructuredDocumentRegion endNode = fStructuredDocument.getRegionAtCharacterOffset(fStart + fLengthToReplace - 1);
- return reparse(startNode.getStart(), endNode.getEnd());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser#newInstance()
- */
- public IStructuredTextReParser newInstance() {
- return new DTDStructuredDocumentReParser();
- }
-
- protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
- return super.reparse(dirtyStart, dirtyEnd);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
deleted file mode 100644
index e3d2c2e321..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-
-public class DTDStructuredDocumentRegionFactory {
- public static final int DTD_GENERIC = 5;
-
- public static IStructuredDocumentRegion createStructuredDocumentRegion(int type) {
- IStructuredDocumentRegion instance = null;
- switch (type) {
- case DTD_GENERIC :
- instance = new BasicStructuredDocumentRegion();
- break;
- default :
- break;
- }
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
deleted file mode 100644
index a191b2e966..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.text;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public class RegionIterator {
-
- private int currentIndex;
-
- // private IStructuredDocumentRegion flatNode;
- private ITextRegionList regions;
- // private int startOffset, endOffset;
- private ITextRegion startRegion, endRegion;
-
- public RegionIterator(IStructuredDocumentRegion node) {
- this(node, node.getStart(), node.getEnd());
- }
-
- public RegionIterator(IStructuredDocumentRegion node, int startOffset, int endOffset) {
- regions = node.getRegions();
- startRegion = node.getRegionAtCharacterOffset(startOffset);
- endRegion = node.getRegionAtCharacterOffset(endOffset - 1);
-
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (startRegion == region) {
- currentIndex = i;
- break;
- }
- }
- }
-
- public RegionIterator(ITextRegionList regions) {
- this.regions = regions;
- startRegion = regions.get(0);
- endRegion = regions.get(regions.size() - 1);
- currentIndex = 0;
- // this(node, node.getStart(), node.getEnd());
- }
-
- public boolean hasNext() {
- if (currentIndex < regions.size()) {
- return currentIndex <= regions.indexOf(endRegion);
- }
- return false;
- }
-
- public boolean hasPrevious() {
- if (currentIndex >= 0) {
- return currentIndex >= regions.indexOf(startRegion);
- }
- return false;
- }
-
- public ITextRegion next() {
- if (hasNext()) {
- return regions.get(currentIndex++);
- }
- throw new NoSuchElementException();
- }
-
- public ITextRegion previous() {
- if (hasPrevious()) {
- return regions.get(--currentIndex);
- }
- throw new NoSuchElementException();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
deleted file mode 100644
index 142bd4f67d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
+++ /dev/null
@@ -1,50 +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.dtd.core.internal.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-
-public class StructuredTextPartitionerForDTD extends StructuredTextPartitioner {
-
- public StructuredTextPartitionerForDTD() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#getDefault()
- */
- public String getDefaultPartitionType() {
- return IDTDPartitions.DTD_DEFAULT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#initLegalContentTypes()
- */
- protected void initLegalContentTypes() {
- fSupportedTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.UNKNOWN_PARTITION};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner#newInstance()
- */
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitionerForDTD();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java
deleted file mode 100644
index 7ecc2d52ec..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java
+++ /dev/null
@@ -1,1090 +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
- *
- *******************************************************************************/
-/* The following code was generated by JFlex 1.3.5 on 3/14/05 9:37 PM */
-/*nlsXXX*/
-package org.eclipse.wst.dtd.core.internal.tokenizer;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-/**
- * Generate with "dtdskeleton".
- *
- * It removes some unused fields and avoids some compiler warnings
- */
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.3.5
- * on 3/14/05 9:37 PM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex</tt>
- */
-public class DTDTokenizer {
-
- /** This character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- final private static int YY_BUFFERSIZE = 16384;
-
- /** lexical states */
- final public static int ATTRIBUTE_ENUMERATION = 13;
- final public static int NOTATION_NAME = 6;
- final public static int ELEMENT_CHILD = 1;
- final public static int ENTITY_CONTENT = 4;
- final public static int COMMENT_CONTENT = 8;
- final public static int ATTLIST_NAME = 9;
- final public static int EXTERNALID_CONTENT = 7;
- final public static int ELEMENT_CONTENT = 1;
- final public static int ELEMENT_MIXED = 1;
- final public static int ELEMENT_MIXED_OR_CHILD = 1;
- final public static int ATTRIBUTE_CONTENT = 11;
- final public static int ENTITY_NAME = 3;
- final public static int ATTRIBUTE_DEFAULT = 12;
- final public static int ELEMENT_NAME = 2;
- final public static int YYINITIAL = 0;
- final public static int NDATA_CONTENT = 5;
- final public static int ATTLIST_CONTENT = 10;
- final public static int NODE = 1;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\10\0\1\0\1\5\1\3\1\0\1\0\1\2\22\0\1\5\1\6"+
- "\1\1\1\37\1\0\1\23\1\0\1\46\1\42\1\43\1\4\1\7"+
- "\1\45\1\12\1\0\1\0\12\0\1\0\1\10\1\11\1\0\1\13"+
- "\1\4\1\0\1\25\1\31\1\32\1\33\1\14\1\35\2\0\1\21"+
- "\1\0\1\36\1\15\1\16\1\17\1\24\1\27\1\40\1\34\1\26"+
- "\1\20\1\30\2\0\1\41\1\22\1\0\1\0\1\0\2\0\1\0"+
- "\1\0\32\0\1\0\1\44\uff83\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
- /**
- * Translates a state to a row index in the transition table
- */
- final private static int yy_rowMap [] = {
- 0, 39, 78, 117, 156, 195, 234, 273, 312, 351,
- 390, 429, 468, 507, 546, 585, 624, 39, 39, 39,
- 663, 702, 741, 780, 819, 39, 39, 858, 897, 39,
- 39, 936, 936, 975, 1014, 1053, 1092, 1131, 1170, 1209,
- 1248, 1287, 1326, 1365, 1404, 1443, 39, 1482, 1521, 1560,
- 1599, 1638, 39, 1677, 1716, 1755, 1794, 1833, 1872, 39,
- 39, 1911, 1950, 1989, 2028, 2067, 2106, 39, 39, 39,
- 2145, 2184, 2223, 2262, 2301, 2340, 2379, 897, 2418, 975,
- 2457, 2496, 2535, 2574, 975, 2613, 2652, 2691, 2730, 1560,
- 2769, 2808, 2847, 2886, 2925, 2964, 3003, 3042, 3081, 3120,
- 1950, 3159, 3198, 3237, 3276, 3315, 1950, 39, 3354, 3393,
- 3432, 39, 3471, 3510, 3549, 39, 3588, 3627, 39, 3666,
- 3705, 3744, 39, 39, 3783, 3822, 3861, 3900, 3939, 3978,
- 4017, 4056, 39, 4095, 4134, 4173, 39, 4212, 4251, 4290,
- 4329, 4368, 4407, 4446, 4485, 4524, 4563, 4602, 4641, 4680,
- 4719, 4758, 4797, 4836, 4875, 4914, 4953, 4992, 5031, 5070,
- 5109, 5148, 5187, 5226, 5265, 5304, 5343, 975, 5382, 5421,
- 5460, 5499, 5538, 5577, 1560, 5616, 5655, 5694, 5733, 5772,
- 5811, 5850, 546, 5889, 5928, 5967, 6006, 975, 975, 975,
- 6045, 1560, 6084, 6123, 1560, 6162, 6201, 6240, 1950, 546,
- 6279, 546, 819, 6318, 6357, 6396, 6435, 6474, 6513, 546,
- 6552, 1560, 1560, 1560, 1950, 6591, 39, 1950
- };
-
- /**
- * The packed transition table of the DFA (part 0)
- */
- final private static String yy_packed0 =
- "\2\17\2\20\1\17\1\20\1\21\1\17\1\22\1\23"+
- "\1\17\1\24\1\25\2\17\1\26\3\17\1\27\1\17"+
- "\1\30\21\17\47\0\2\31\2\20\1\32\1\20\1\0"+
- "\1\32\1\31\1\33\1\31\1\33\23\31\1\34\2\31"+
- "\1\35\1\36\2\37\1\31\2\40\2\20\1\0\1\20"+
- "\3\40\1\33\1\40\1\33\7\40\1\41\16\40\4\0"+
- "\1\40\1\42\1\43\2\20\1\42\1\20\3\42\1\33"+
- "\1\42\1\33\12\42\1\44\1\45\16\42\1\46\2\47"+
- "\2\20\1\47\1\20\3\47\1\33\1\47\1\33\33\47"+
- "\2\50\2\20\1\0\1\20\2\0\1\50\1\33\1\50"+
- "\1\33\26\50\4\0\1\50\1\42\1\43\2\20\1\42"+
- "\1\20\3\42\1\33\1\42\1\33\3\42\1\51\6\42"+
- "\1\52\1\53\16\42\1\46\2\54\2\55\1\54\1\55"+
- "\4\54\1\56\1\57\33\54\2\60\2\20\1\42\1\20"+
- "\2\42\1\60\1\33\1\60\1\33\26\60\4\42\1\60"+
- "\2\61\2\20\1\42\1\20\2\42\1\61\1\33\1\61"+
- "\1\33\26\61\4\42\1\61\1\62\1\63\1\64\1\65"+
- "\1\62\1\66\3\62\1\33\1\62\1\33\1\67\2\62"+
- "\1\70\1\62\1\71\10\62\1\72\4\62\1\73\2\62"+
- "\1\74\2\75\1\62\1\76\1\77\1\100\2\20\1\77"+
- "\1\20\3\77\1\33\1\77\1\33\23\77\1\101\6\77"+
- "\1\102\2\103\2\20\1\103\1\20\3\103\1\33\1\103"+
- "\1\33\26\103\1\104\1\105\1\106\2\103\2\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
- "\23\17\2\0\2\20\1\0\1\20\53\0\1\107\34\0"+
- "\2\17\2\0\1\17\2\0\1\17\2\0\1\17\1\0"+
- "\1\17\1\110\1\17\1\111\3\17\1\0\25\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
- "\1\112\22\17\2\113\2\0\1\113\2\0\1\113\2\0"+
- "\1\113\1\0\7\113\1\0\23\113\2\17\2\0\1\17"+
- "\2\0\1\17\2\0\1\17\1\0\4\17\1\114\2\17"+
- "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0"+
- "\26\31\4\0\3\31\6\0\1\31\1\0\1\31\1\0"+
- "\13\31\1\115\12\31\4\0\1\31\2\0\2\116\1\0"+
- "\1\116\31\0\1\117\7\0\2\40\4\0\3\40\1\0"+
- "\1\40\1\0\26\40\4\0\1\40\2\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\33\42\1\43\1\120"+
- "\2\121\1\43\1\121\3\43\1\121\1\43\1\121\33\43"+
- "\2\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0"+
- "\6\42\1\122\26\42\2\0\1\42\1\0\3\42\1\0"+
- "\1\42\1\0\14\42\1\123\16\42\2\46\2\124\1\46"+
- "\1\124\3\46\1\124\1\46\1\124\32\46\1\125\2\47"+
- "\2\0\1\47\1\0\3\47\1\0\1\47\1\0\33\47"+
- "\2\50\6\0\1\50\1\0\1\50\1\0\26\50\4\0"+
- "\1\50\2\42\2\0\1\42\1\0\3\42\1\0\1\42"+
- "\1\0\17\42\1\126\15\42\2\0\1\42\1\0\3\42"+
- "\1\0\1\42\1\0\6\42\1\127\26\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\14\42\1\130\16\42"+
- "\12\54\2\0\35\54\2\55\1\54\1\55\4\54\2\0"+
- "\33\54\12\0\1\131\34\0\2\60\2\0\1\42\1\0"+
- "\2\42\1\60\1\0\1\60\1\0\26\60\4\42\1\60"+
- "\2\61\2\0\1\42\1\0\2\42\1\61\1\0\1\61"+
- "\1\0\26\61\4\42\1\61\2\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\26\62\3\0\2\62\1\63"+
- "\1\132\2\133\1\63\1\133\3\63\1\133\1\63\1\133"+
- "\26\63\3\133\2\63\3\0\1\65\50\0\1\66\41\0"+
- "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
- "\3\62\1\134\22\62\3\0\4\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\2\62\1\135\5\62\1\136"+
- "\15\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\17\62\1\137\6\62\3\0\4\62\2\0"+
- "\1\62\1\0\3\62\1\0\1\62\1\0\17\62\1\140"+
- "\6\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\5\62\1\141\12\62\1\142\1\143\4\62"+
- "\3\0\2\62\2\76\2\144\1\76\1\144\3\76\1\144"+
- "\1\76\1\144\26\76\3\144\1\76\1\132\2\77\2\0"+
- "\1\77\1\0\3\77\1\0\1\77\1\0\33\77\1\100"+
- "\1\145\2\146\1\100\1\146\3\100\1\146\1\100\1\146"+
- "\33\100\2\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\5\77\1\147\12\77\1\150\1\151\11\77\2\102"+
- "\2\152\1\102\1\152\3\102\1\152\1\102\1\152\32\102"+
- "\1\153\2\103\2\0\1\103\1\0\3\103\1\0\1\103"+
- "\1\0\26\103\3\0\2\103\12\0\1\154\34\0\2\17"+
- "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\1\155"+
- "\6\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
- "\1\17\1\0\4\17\1\156\2\17\1\0\25\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\157"+
- "\2\17\1\0\23\17\2\113\2\0\1\113\2\0\1\113"+
- "\1\160\1\0\1\113\1\0\7\113\1\0\23\113\2\17"+
- "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\4\17"+
- "\1\161\2\17\1\0\23\17\2\31\6\0\1\31\1\0"+
- "\1\31\1\0\16\31\1\162\7\31\4\0\1\31\27\0"+
- "\1\163\17\0\1\121\1\164\45\121\2\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\12\42\1\165\22\42"+
- "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\15\42"+
- "\1\166\15\42\46\124\1\167\2\42\2\0\1\42\1\0"+
- "\3\42\1\0\1\42\1\0\11\42\1\170\23\42\2\0"+
- "\1\42\1\0\3\42\1\0\1\42\1\0\12\42\1\171"+
- "\22\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0"+
- "\15\42\1\172\15\42\13\0\1\173\33\0\1\133\1\174"+
- "\45\133\2\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\4\62\1\175\21\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\4\62\1\176\21\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\4\62\1\177\21\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\20\62\1\200\5\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\11\62\1\201\14\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\2\62\1\202\23\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\1\203\25\62\3\0\4\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\5\62\1\204\20\62\3\0"+
- "\2\62\46\144\1\174\1\146\1\205\45\146\2\77\2\0"+
- "\1\77\1\0\3\77\1\0\1\77\1\0\2\77\1\206"+
- "\32\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0"+
- "\1\207\34\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\5\77\1\210\25\77\46\152\1\211\2\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\2\17\1\212"+
- "\4\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
- "\1\17\1\0\5\17\1\213\1\17\1\0\25\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
- "\1\17\1\214\23\17\2\0\1\17\2\0\1\17\2\0"+
- "\1\17\1\0\1\17\1\215\5\17\1\0\23\17\2\31"+
- "\6\0\1\31\1\0\1\31\1\0\17\31\1\216\6\31"+
- "\4\0\1\31\32\0\1\217\14\0\2\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\4\42\1\220\30\42"+
- "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\1\42"+
- "\1\221\33\42\2\0\1\42\1\0\3\42\1\0\1\42"+
- "\1\0\4\42\1\222\30\42\2\0\1\42\1\0\3\42"+
- "\1\0\1\42\1\0\4\42\1\223\30\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\1\42\1\224\31\42"+
- "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
- "\5\62\1\225\20\62\3\0\4\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\10\62\1\226\15\62\3\0"+
- "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
- "\11\62\1\227\14\62\3\0\4\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\1\230\25\62\3\0\4\62"+
- "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\4\62"+
- "\1\231\21\62\3\0\4\62\2\0\1\62\1\0\3\62"+
- "\1\0\1\62\1\0\13\62\1\232\12\62\3\0\4\62"+
- "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\24\62"+
- "\1\233\1\62\3\0\4\62\2\0\1\62\1\0\3\62"+
- "\1\0\1\62\1\0\25\62\1\234\3\0\2\62\2\77"+
- "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\13\77"+
- "\1\235\21\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\24\77\1\236\10\77\2\0\1\77\1\0\3\77"+
- "\1\0\1\77\1\0\25\77\1\237\5\77\2\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\1\240\6\17"+
- "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17"+
- "\1\0\4\17\1\241\2\17\1\0\25\17\2\0\1\17"+
- "\2\0\1\17\2\0\1\17\1\0\4\17\1\242\2\17"+
- "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17"+
- "\1\0\5\17\1\243\1\17\1\0\23\17\2\31\6\0"+
- "\1\31\1\0\1\31\1\0\11\31\1\244\14\31\4\0"+
- "\1\31\33\0\1\245\13\0\2\42\2\0\1\42\1\0"+
- "\3\42\1\0\1\42\1\0\1\246\34\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\5\42\1\247\27\42"+
- "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\11\42"+
- "\1\250\23\42\2\0\1\42\1\0\3\42\1\0\1\42"+
- "\1\0\1\251\34\42\2\0\1\42\1\0\3\42\1\0"+
- "\1\42\1\0\5\42\1\252\25\42\2\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\4\62\1\253\21\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\22\62\1\254\3\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\4\62\1\255\21\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\21\62\1\256\4\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\11\62\1\257\14\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\1\62\1\260\24\62\3\0\4\62\2\0\1\62"+
- "\1\0\3\62\1\0\1\62\1\0\14\62\1\261\11\62"+
- "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
- "\1\0\1\262\25\62\3\0\2\62\2\77\2\0\1\77"+
- "\1\0\3\77\1\0\1\77\1\0\1\77\1\263\33\77"+
- "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\14\77"+
- "\1\264\20\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\1\265\32\77\2\17\2\0\1\17\2\0\1\17"+
- "\2\0\1\17\1\0\3\17\1\266\3\17\1\0\25\17"+
- "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\6\17"+
- "\1\267\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
- "\1\17\1\0\5\17\1\270\1\17\1\0\25\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
- "\2\17\1\271\20\17\2\31\6\0\1\31\1\0\1\31"+
- "\1\0\4\31\1\272\21\31\4\0\1\31\25\0\1\273"+
- "\21\0\2\42\2\0\1\42\1\0\3\42\1\0\1\42"+
- "\1\0\2\42\1\274\32\42\2\0\1\42\1\0\3\42"+
- "\1\0\1\42\1\0\16\42\1\274\16\42\2\0\1\42"+
- "\1\0\3\42\1\0\1\42\1\0\2\42\1\275\32\42"+
- "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\16\42"+
- "\1\276\14\42\2\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\5\62\1\277\1\300\17\62\3\0\4\62"+
- "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\1\301"+
- "\25\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\5\62\1\302\20\62\3\0\4\62\2\0"+
- "\1\62\1\0\3\62\1\0\1\62\1\0\12\62\1\303"+
- "\13\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\5\62\1\234\20\62\3\0\4\62\2\0"+
- "\1\62\1\0\3\62\1\0\1\62\1\0\5\62\1\304"+
- "\20\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
- "\1\62\1\0\17\62\1\132\6\62\3\0\2\62\2\77"+
- "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\5\77"+
- "\1\305\27\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\5\77\1\306\27\77\2\0\1\77\1\0\3\77"+
- "\1\0\1\77\1\0\17\77\1\307\13\77\2\17\2\0"+
- "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\310"+
- "\2\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
- "\1\17\1\0\7\17\1\0\1\311\24\17\2\0\1\17"+
- "\2\0\1\17\2\0\1\17\1\0\4\17\1\312\2\17"+
- "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0"+
- "\11\31\1\313\14\31\4\0\1\31\20\0\1\314\26\0"+
- "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
- "\1\315\25\62\3\0\4\62\2\0\1\62\1\0\3\62"+
- "\1\0\1\62\1\0\3\62\1\316\22\62\3\0\4\62"+
- "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\10\62"+
- "\1\317\15\62\3\0\4\62\2\0\1\62\1\0\3\62"+
- "\1\0\1\62\1\0\20\62\1\234\5\62\3\0\2\62"+
- "\2\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0"+
- "\1\320\34\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\20\77\1\321\12\77\2\17\2\0\1\17\2\0"+
- "\1\17\2\0\1\17\1\0\3\17\1\322\3\17\1\0"+
- "\23\17\25\0\1\323\21\0\2\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\12\62\1\324\13\62\3\0"+
- "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
- "\12\62\1\325\13\62\3\0\4\62\2\0\1\62\1\0"+
- "\3\62\1\0\1\62\1\0\3\62\1\326\22\62\3\0"+
- "\2\62\2\77\2\0\1\77\1\0\3\77\1\0\1\77"+
- "\1\0\17\77\1\327\15\77\2\0\1\77\1\0\3\77"+
- "\1\0\1\77\1\0\1\330\32\77\2\0\2\323\1\0"+
- "\1\323\35\0\1\331\3\0\2\77\2\0\1\77\1\0"+
- "\3\77\1\0\1\77\1\0\17\77\1\332\13\77";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans [] = yy_unpack();
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {
- 0, 8, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 9, 9, 9, 1, 1, 1, 1, 1, 9, 9, 1, 1, 9, 9, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1,
- 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1,
- 1, 1, 1, 9, 9, 9, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1,
- 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 9, 1, 1, 1, 9,
- 1, 1, 0, 9, 1, 1, 9, 1, 1, 1, 9, 9, 1, 1, 1, 1,
- 1, 1, 1, 1, 9, 1, 1, 1, 9, 1, 1, 1, 1, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
- 1, 1, 0, 1, 1, 1, 1, 1, 9, 1
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[YY_BUFFERSIZE];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- //private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- int yycolumn;
-
- /** yy_atEOF == true <=> the scanner is at the EOF */
- private boolean yy_atEOF;
-
- /* user code: */
- int node_count = 0;
- String currentString;
-
- private Token createToken(String type) {
- return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
- }
-
- private int startOffset = 0;
- public void setStartOffset(int offset) {
- this.startOffset = offset;
- }
-
- public void setLine(int line) {
- this.yyline = line;
- }
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public DTDTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public DTDTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the split, compressed DFA transition table.
- *
- * @return the unpacked transition table
- */
- private static int [] yy_unpack() {
- int [] trans = new int[6630];
- int offset = 0;
- offset = yy_unpack(yy_packed0, offset, trans);
- return trans;
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed the packed transition table
- * @return the index of the last entry
- */
- private static int yy_unpack(String packed, int offset, int [] trans) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do trans[j++] = value; while (--count > 0);
- }
- return j;
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 130) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Refills the input buffer.
- *
- * @return <code>false</code>, iff there was new input.
- *
- * @exception java.io.IOException if any I/O-Error occurs
- */
- private boolean yy_refill() throws java.io.IOException {
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- //yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if (numRead < 0) {
- return true;
- }
- else {
- yy_endRead+= numRead;
- return false;
- }
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
-
- if (yy_reader != null)
- yy_reader.close();
- }
-
-
- /**
- * Closes the current stream, and resets the
- * scanner to read from a new input stream.
- *
- * All internal variables are reset, the old input stream
- * <b>cannot</b> be reused (internal buffer is discarded and lost).
- * Lexical state is set to <tt>YY_INITIAL</tt>.
- *
- * @param reader the new input stream
- */
- final public void yyreset(java.io.Reader reader) throws java.io.IOException {
- yyclose();
- yy_reader = reader;
- yy_atEOF = false;
- yy_endRead = yy_startRead = 0;
- yy_currentPos = yy_markedPos = 0;//yy_pushbackPos = 0;
- yyline = yychar = yycolumn = 0;
- yy_lexical_state = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
-
- /**
- * Returns the character at position <tt>pos</tt> from the
- * matched text.
- *
- * It is equivalent to yytext().charAt(pos), but faster
- *
- * @param pos the position of the character to fetch.
- * A value from 0 to yylength()-1.
- *
- * @return the character at position pos
- */
- final public char yycharat(int pos) {
- return yy_buffer[yy_startRead+pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * In a wellformed scanner (no or only correct usage of
- * yypushback(int) and a match-all fallback rule) this method
- * will only be called with things that "Can't Possibly Happen".
- * If this method is called, something is seriously wrong
- * (e.g. a JFlex bug producing a faulty scanner etc.).
- *
- * Usual syntax/scanner level error handling should be done
- * in error fallback rules.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- String message;
- try {
- message = YY_ERROR_MSG[errorCode];
- }
- catch (ArrayIndexOutOfBoundsException e) {
- message = YY_ERROR_MSG[YY_UNKNOWN_ERROR];
- }
-
- throw new Error(message);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception java.io.IOException if any I/O-Error occurs
- */
- public Yytoken yylex() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
- // cached fields:
- int yy_currentPos_l;
- int yy_markedPos_l;
- int yy_endRead_l = yy_endRead;
- char [] yy_buffer_l = yy_buffer;
- char [] yycmap_l = yycmap;
-
- int [] yytrans_l = yytrans;
- int [] yy_rowMap_l = yy_rowMap;
- byte [] yy_attr_l = YY_ATTRIBUTE;
-
- while (true) {
- yy_markedPos_l = yy_markedPos;
-
- yychar+= yy_markedPos_l-yy_startRead;
-
- yy_action = -1;
-
- yy_currentPos_l = yy_currentPos =
- yy_startRead = yy_markedPos_l;
-
- yy_state = yy_lexical_state;
-
-
- yy_forAction: {
- while (true) {
-
- if (yy_currentPos_l < yy_endRead_l)
- yy_input = yy_buffer_l[yy_currentPos_l++];
- else if (yy_atEOF) {
- yy_input = YYEOF;
- break yy_forAction;
- }
- else {
- // store back cached positions
- yy_currentPos = yy_currentPos_l;
- yy_markedPos = yy_markedPos_l;
- boolean eof = yy_refill();
- // get translated positions and possibly new buffer
- yy_currentPos_l = yy_currentPos;
- yy_markedPos_l = yy_markedPos;
- yy_buffer_l = yy_buffer;
- yy_endRead_l = yy_endRead;
- if (eof) {
- yy_input = YYEOF;
- break yy_forAction;
- }
- else {
- yy_input = yy_buffer_l[yy_currentPos_l++];
- }
- }
- int yy_next = yytrans_l[ yy_rowMap_l[yy_state] + yycmap_l[yy_input] ];
- if (yy_next == -1) break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = yy_attr_l[yy_state];
- if ( (yy_attributes & 1) == 1 ) {
- yy_action = yy_state;
- yy_markedPos_l = yy_currentPos_l;
- if ( (yy_attributes & 8) == 8 ) break yy_forAction;
- }
-
- }
- }
-
- // store back cached position
- yy_markedPos = yy_markedPos_l;
-
- switch (yy_action) {
-
- case 26:
- { yypushback(yylength()); yybegin(YYINITIAL); }
- case 219: break;
- case 89:
- case 123:
- { yypushback(yylength()); yybegin(ATTRIBUTE_DEFAULT); }
- case 220: break;
- case 12:
- case 62:
- case 63:
- case 64:
- case 65:
- case 102:
- case 103:
- case 104:
- case 133:
- case 134:
- case 135:
- case 156:
- case 157:
- case 158:
- case 178:
- case 179:
- case 180:
- case 196:
- case 197:
- case 207:
- case 208:
- case 215:
- { yypushback(yylength()); yybegin(ATTLIST_CONTENT); }
- case 221: break;
- case 51:
- case 52:
- { yypushback(yylength()); yybegin(ATTLIST_CONTENT); }
- case 222: break;
- case 205:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKEN_KEYWORD); }
- case 223: break;
- case 194:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREFS_KEYWORD); }
- case 224: break;
- case 191:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITY_KEYWORD); }
- case 225: break;
- case 107:
- { yybegin(COMMENT_CONTENT); return createToken(DTDRegionTypes.COMMENT_START); }
- case 226: break;
- case 48:
- { yybegin(ATTRIBUTE_CONTENT); return createToken(DTDRegionTypes.ATTRIBUTE_NAME); }
- case 227: break;
- case 39:
- { yybegin(EXTERNALID_CONTENT); return createToken(DTDRegionTypes.NAME); }
- case 228: break;
- case 106:
- case 136:
- { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- case 229: break;
- case 100:
- case 132:
- { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- case 230: break;
- case 202:
- case 216:
- { return createToken(DTDRegionTypes.CONTENT_PCDATA); }
- case 231: break;
- case 189:
- { return createToken(DTDRegionTypes.PUBLIC_KEYWORD); }
- case 232: break;
- case 188:
- { return createToken(DTDRegionTypes.SYSTEM_KEYWORD); }
- case 233: break;
- case 14:
- case 20:
- case 21:
- case 23:
- case 71:
- case 72:
- case 73:
- case 75:
- case 108:
- case 109:
- case 110:
- case 112:
- case 137:
- case 138:
- case 139:
- case 140:
- case 159:
- case 160:
- case 161:
- case 162:
- case 181:
- case 183:
- case 184:
- case 200:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 234: break;
- case 4:
- case 33:
- case 34:
- case 35:
- case 36:
- case 37:
- case 81:
- case 82:
- case 116:
- case 117:
- case 143:
- case 144:
- case 165:
- case 166:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 235: break;
- case 7:
- case 40:
- case 41:
- case 42:
- case 85:
- case 86:
- case 87:
- case 119:
- case 120:
- case 121:
- case 145:
- case 146:
- case 147:
- case 168:
- case 169:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 236: break;
- case 9:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 237: break;
- case 10:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 238: break;
- case 43:
- case 45:
- case 46:
- { return createToken(DTDRegionTypes.COMMENT_CONTENT); }
- case 239: break;
- case 60:
- { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- case 240: break;
- case 198:
- { return createToken(DTDRegionTypes.FIXED_KEYWORD); }
- case 241: break;
- case 214:
- { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.IMPLIED_KEYWORD); }
- case 242: break;
- case 212:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKENS_KEYWORD); }
- case 243: break;
- case 211:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITIES_KEYWORD); }
- case 244: break;
- case 209:
- { yybegin(NOTATION_NAME); return createToken(DTDRegionTypes.NOTATION_TAG); }
- case 245: break;
- case 201:
- { yybegin(ATTLIST_NAME); return createToken(DTDRegionTypes.ATTLIST_TAG); }
- case 246: break;
- case 199:
- { yybegin(ELEMENT_NAME); return createToken(DTDRegionTypes.ELEMENT_TAG); }
- case 247: break;
- case 182:
- { yybegin(ENTITY_NAME); return createToken(DTDRegionTypes.ENTITY_TAG); }
- case 248: break;
- case 167:
- { yybegin(NDATA_CONTENT); return createToken(DTDRegionTypes.NDATA_KEYWORD); }
- case 249: break;
- case 111:
- { return createToken(DTDRegionTypes.ENTITY_PARM); }
- case 250: break;
- case 94:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ID_KEYWORD); }
- case 251: break;
- case 25:
- { return createToken(DTDRegionTypes.OCCUR_TYPE); }
- case 252: break;
- case 16:
- { return createToken(DTDRegionTypes.EXCLAMATION); }
- case 253: break;
- case 15:
- { return createToken(DTDRegionTypes.WHITESPACE); }
- case 254: break;
- case 11:
- case 49:
- case 50:
- case 54:
- case 55:
- case 56:
- case 57:
- case 58:
- case 61:
- case 91:
- case 92:
- case 93:
- case 95:
- case 96:
- case 97:
- case 98:
- case 124:
- case 125:
- case 126:
- case 127:
- case 128:
- case 129:
- case 130:
- case 131:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153:
- case 154:
- case 155:
- case 170:
- case 171:
- case 172:
- case 175:
- case 176:
- case 177:
- case 190:
- case 192:
- case 193:
- case 195:
- case 204:
- case 206:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.PARM_ENTITY_TYPE); }
- case 255: break;
- case 28:
- { return createToken(DTDRegionTypes.LEFT_PAREN); }
- case 256: break;
- case 29:
- { return createToken(DTDRegionTypes.RIGHT_PAREN); }
- case 257: break;
- case 44:
- { return createToken(DTDRegionTypes.WHITESPACE); }
- case 258: break;
- case 53:
- { return createToken(DTDRegionTypes.WHITESPACE); }
- case 259: break;
- case 59:
- { yypushback(yylength()); yybegin(ATTRIBUTE_ENUMERATION); }
- case 260: break;
- case 67:
- { return createToken(DTDRegionTypes.LEFT_PAREN); }
- case 261: break;
- case 68:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.RIGHT_PAREN); }
- case 262: break;
- case 69:
- { return createToken(DTDRegionTypes.ENUM_CHOICE); }
- case 263: break;
- case 31:
- { yybegin(ENTITY_CONTENT); return createToken(DTDRegionTypes.NAME); }
- case 264: break;
- case 47:
- { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.NAME); }
- case 265: break;
- case 187:
- { yypushback(yylength()); yybegin(EXTERNALID_CONTENT); }
- case 266: break;
- case 213:
- { yybegin(ATTRIBUTE_ENUMERATION); return createToken(DTDRegionTypes.NOTATION_KEYWORD); }
- case 267: break;
- case 174:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.CDATA_KEYWORD); }
- case 268: break;
- case 173:
- { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREF_KEYWORD); }
- case 269: break;
- case 217:
- { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.REQUIRED_KEYWORD); }
- case 270: break;
- case 122:
- { yybegin(YYINITIAL); return createToken(DTDRegionTypes.COMMENT_END); }
- case 271: break;
- case 84:
- case 118:
- { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- case 272: break;
- case 79:
- case 115:
- { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- case 273: break;
- case 24:
- case 27:
- case 76:
- case 113:
- case 141:
- case 163:
- case 185:
- { return createToken(DTDRegionTypes.NAME); }
- case 274: break;
- case 5:
- case 38:
- { yybegin(YYINITIAL); return createToken(DTDRegionTypes.NDATA_VALUE); }
- case 275: break;
- case 13:
- case 66:
- { return createToken(DTDRegionTypes.NAME); }
- case 276: break;
- case 18:
- { return createToken(DTDRegionTypes.START_TAG); }
- case 277: break;
- case 17:
- { return createToken(DTDRegionTypes.SEMICOLON); }
- case 278: break;
- case 30:
- { return createToken(DTDRegionTypes.CONNECTOR); }
- case 279: break;
- case 22:
- { return createToken(DTDRegionTypes.PERCENT); }
- case 280: break;
- case 19:
- { return createToken(DTDRegionTypes.END_TAG); }
- case 281: break;
- case 32:
- { return createToken(DTDRegionTypes.PERCENT); }
- case 282: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- return null;
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java
deleted file mode 100644
index c1afe7e624..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java
+++ /dev/null
@@ -1,61 +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.dtd.core.internal.tokenizer;
-
-public class Token extends Yytoken {
- public static final int COMMENT_START = 9;
- public static final int CONNECTOR = 6;
- public static final int CONTENT_ANY = 43;
- public static final int CONTENT_EMPTY = 42;
- public static final int CONTENT_PCDATA = 44;
- public static final int ELEMENT_CONTENT = 41;
-
- public static final int ELEMENT_TAG = 40;
- public static final int END_TAG = 2;
- public static final int ENTITY_CONTENT = 32;
- public static final int ENTITY_PARM = 31;
-
- public static final int ENTITY_TAG = 30;
- public static final int EXCLAMATION = 8;
- public static final int LEFT_PAREN = 3;
- public static final int NAME = 0;
- public static final int NOTATION_CONTENT = 21;
-
-
- public static final int NOTATION_TAG = 20;
-
- // public static final int CONNECT_CHOICE = 5;
- // public static final int CONNECT_SEQUENCE = 6;
- // public static final int OCCUR_OPTIONAL = 7;
- // public static final int OCCUR_ONE_OR_MORE = 8;
- // public static final int OCCUR_ZERO_OR_MORE = 9;
- public static final int OCCUR_TYPE = 7;
- public static final int RIGHT_PAREN = 4;
- public static final int START_TAG = 1;
- public static final int WHITESPACE = 5;
-
-
- public Token(String type) {
- super(type);
- }
-
- public Token(String type, String text, int line, int charBegin, int length) {
- super(type, text, line, charBegin, length);
- }
-
- public Token createCopy() {
- Token copy = new Token(getType(), getText(), getStartLine(), getStartOffset(), getLength());
- return copy;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java
deleted file mode 100644
index ab47990af6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java
+++ /dev/null
@@ -1,89 +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.dtd.core.internal.tokenizer;
-
-class Yytoken {
- public int m_charBegin;
- public int m_length;
- public int m_line;
- public String m_text;
- public String m_type;
-
- Yytoken(String type) {
- m_type = type;
- }
-
- Yytoken(String type, String text, int line, int charBegin, int length) {
- m_type = type;
- m_text = new String(text);
- m_line = line;
- m_charBegin = charBegin;
- m_length = length;
- }
-
- public void delete(int start, int length) {
- int stringStart = start - m_charBegin;
- String oldString = m_text;
- m_text = oldString.substring(0, stringStart);
- m_text += oldString.substring(stringStart + length);
-
- m_length = m_text.length();
- System.out.println("new string = " + m_text); //$NON-NLS-1$
-
- }
-
- public boolean equals(Yytoken other) {
- return m_type == other.getType() && m_text.equals(other.getText()) && m_line == other.getStartLine() && m_charBegin == other.getStartOffset() && m_length == other.getLength();
- }
-
- public int getEndOffset() {
- return m_charBegin + m_length;
- }
-
- public int getLength() {
- return m_length;
- }
-
- public int getStartLine() {
- return m_line;
- }
-
- public int getStartOffset() {
- return m_charBegin;
- }
-
- public String getText() {
- return m_text;
- }
-
- public String getType() {
- return m_type;
- }
-
- public void setStartOffset(int startOffset) {
- m_charBegin = startOffset;
- }
-
- public String toString() {
- return "Text : " + m_text + "\ntype : " + m_type + "\nline : " + m_line + "\ncBeg. : " + m_charBegin + "\ncEnd. : " + getEndOffset() + "\ncLength. : " + m_length; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
-
- public void updateOffset(int delta) {
- m_charBegin += delta;
- }
-
- public void updateText(String newText) {
- m_text = newText;
- m_length = newText.length();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex
deleted file mode 100644
index e3a14aa15f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.tokenizer;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-/**
- * Generate with "dtdskeleton".
- *
- * It removes some unused fields and avoids some compiler warnings
- */
-
-%%
-
-%{
- int node_count = 0;
- String currentString;
-
- private Token createToken(String type) {
- return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
- }
-
- private int startOffset = 0;
- public void setStartOffset(int offset) {
- this.startOffset = offset;
- }
-
- public void setLine(int line) {
- this.yyline = line;
- }
-%}
-
-%class DTDTokenizer
-%public
-%unicode
-%char
-
-%state NODE
-%state ELEMENT_NAME
-%state ELEMENT_CONTENT
-%state ELEMENT_MIXED_OR_CHILD
-%state ELEMENT_MIXED
-%state ELEMENT_CHILD
-%state ENTITY_NAME
-%state ENTITY_CONTENT
-%state NDATA_CONTENT
-
-%state NOTATION_NAME
-%state EXTERNALID_CONTENT
-
-%state COMMENT_CONTENT
-%state ATTLIST_NAME
-%state ATTLIST_CONTENT
-%state ATTRIBUTE_CONTENT
-%state ATTRIBUTE_DEFAULT
-%state ATTRIBUTE_ENUMERATION
-
-
-ALPHA=[A-Za-z]
-DIGIT=[0-9]
-NONNEWLINE_WHITE_SPACE_CHAR=[\ \t\b\012]
-STRING_TEXT=(\\\"|[^\n\r\"]|\\{WHITE_SPACE_CHAR}+\\)*
-COMMENT_TEXT=([^*/\n]|[^*\n]"/"[^*\n]|[^/\n]"*"[^/\n]|"*"[^/\n]|"/"[^*\n])*
-Ident = {ALPHA}({ALPHA}|{DIGIT}|_)*
-InputCharacter = [^\r\n]
-
-LineTerminator = \r|\n|\r\n
-
-/* 3 - White Space */
-S = (\x20 | \x09 | \x0D | \x0A)+
-NonLineTerminatorWhitespace = (\x20 | \x09)+
-
-WhiteSpace = {LineTerminator} | [ \t\f]
-
-/* 84 */
-/*Letter = {BaseChar} | {Ideographic}
-
-/* 85 */
-BaseChar = [\u0041-\u005A] | [\u0061-\u007A] | [\u00C0-\u00D6] | [\u00D8-\u00F6] | [\u00F8-\u00FF] | [\u0100-\u0131] | [\u0134-\u013E] | [\u0141-\u0148] | [\u014A-\u017E] | [\u0180-\u01C3] | [\u01CD-\u01F0] | [\u01F4-\u01F5] | [\u01FA-\u0217] | [\u0250-\u02A8] | [\u02BB-\u02C1] | \u0386 | [\u0388-\u038A] | \u038C | [\u038E-\u03A1] | [\u03A3-\u03CE] | [\u03D0-\u03D6] | \u03DA | \u03DC | \u03DE | \u03E0 | [\u03E2-\u03F3] | [\u0401-\u040C] | [\u040E-\u044F] | [\u0451-\u045C] | [\u045E-\u0481] | [\u0490-\u04C4] | [\u04C7-\u04C8] | [\u04CB-\u04CC] | [\u04D0-\u04EB] | [\u04EE-\u04F5] | [\u04F8-\u04F9] | [\u0531-\u0556] | \u0559 | [\u0561-\u0586] | [\u05D0-\u05EA] | [\u05F0-\u05F2] | [\u0621-\u063A] | [\u0641-\u064A] | [\u0671-\u06B7] | [\u06BA-\u06BE] | [\u06C0-\u06CE] | [\u06D0-\u06D3] | \u06D5 | [\u06E5-\u06E6] | [\u0905-\u0939] | \u093D | [\u0958-\u0961] | [\u0985-\u098C] | [\u098F-\u0990] | [\u0993-\u09A8] | [\u09AA-\u09B0] | \u09B2 | [\u09B6-\u09B9] | [\u09DC-\u09DD] | [\u09DF-\u09E1] | [\u09F0-\u09F1] | [\u0A05-\u0A0A] | [\u0A0F-\u0A10] | [\u0A13-\u0A28] | [\u0A2A-\u0A30] | [\u0A32-\u0A33] | [\u0A35-\u0A36] | [\u0A38-\u0A39] | [\u0A59-\u0A5C] | \u0A5E | [\u0A72-\u0A74] | [\u0A85-\u0A8B] | \u0A8D | [\u0A8F-\u0A91] | [\u0A93-\u0AA8] | [\u0AAA-\u0AB0] | [\u0AB2-\u0AB3] | [\u0AB5-\u0AB9] | \u0ABD | \u0AE0 | [\u0B05-\u0B0C] | [\u0B0F-\u0B10] | [\u0B13-\u0B28] | [\u0B2A-\u0B30] | [\u0B32-\u0B33] | [\u0B36-\u0B39] | \u0B3D | [\u0B5C-\u0B5D] | [\u0B5F-\u0B61] | [\u0B85-\u0B8A] | [\u0B8E-\u0B90] | [\u0B92-\u0B95] | [\u0B99-\u0B9A] | \u0B9C | [\u0B9E-\u0B9F] | [\u0BA3-\u0BA4] | [\u0BA8-\u0BAA] | [\u0BAE-\u0BB5] | [\u0BB7-\u0BB9] | [\u0C05-\u0C0C] | [\u0C0E-\u0C10] | [\u0C12-\u0C28] | [\u0C2A-\u0C33] | [\u0C35-\u0C39] | [\u0C60-\u0C61] | [\u0C85-\u0C8C] | [\u0C8E-\u0C90] | [\u0C92-\u0CA8] | [\u0CAA-\u0CB3] | [\u0CB5-\u0CB9] | \u0CDE | [\u0CE0-\u0CE1] | [\u0D05-\u0D0C] | [\u0D0E-\u0D10] | [\u0D12-\u0D28] | [\u0D2A-\u0D39] | [\u0D60-\u0D61] | [\u0E01-\u0E2E] | \u0E30 | [\u0E32-\u0E33] | [\u0E40-\u0E45] | [\u0E81-\u0E82] | \u0E84 | [\u0E87-\u0E88] | \u0E8A | \u0E8D | [\u0E94-\u0E97] | [\u0E99-\u0E9F] | [\u0EA1-\u0EA3] | \u0EA5 | \u0EA7 | [\u0EAA-\u0EAB] | [\u0EAD-\u0EAE] | \u0EB0 | [\u0EB2-\u0EB3] | \u0EBD | [\u0EC0-\u0EC4] | [\u0F40-\u0F47] | [\u0F49-\u0F69] | [\u10A0-\u10C5] | [\u10D0-\u10F6] | \u1100 | [\u1102-\u1103] | [\u1105-\u1107] | \u1109 | [\u110B-\u110C] | [\u110E-\u1112] | \u113C | \u113E | \u1140 | \u114C | \u114E | \u1150 | [\u1154-\u1155] | \u1159 | [\u115F-\u1161] | \u1163 | \u1165 | \u1167 | \u1169 | [\u116D-\u116E] | [\u1172-\u1173] | \u1175 | \u119E | \u11A8 | \u11AB | [\u11AE-\u11AF] | [\u11B7-\u11B8] | \u11BA | [\u11BC-\u11C2] | \u11EB | \u11F0 | \u11F9 | [\u1E00-\u1E9B] | [\u1EA0-\u1EF9] | [\u1F00-\u1F15] | [\u1F18-\u1F1D] | [\u1F20-\u1F45] | [\u1F48-\u1F4D] | [\u1F50-\u1F57] | \u1F59 | \u1F5B | \u1F5D | [\u1F5F-\u1F7D] | [\u1F80-\u1FB4] | [\u1FB6-\u1FBC] | \u1FBE | [\u1FC2-\u1FC4] | [\u1FC6-\u1FCC] | [\u1FD0-\u1FD3] | [\u1FD6-\u1FDB] | [\u1FE0-\u1FEC] | [\u1FF2-\u1FF4] | [\u1FF6-\u1FFC] | \u2126 | [\u212A-\u212B] | \u212E | [\u2180-\u2182] | [\u3041-\u3094] | [\u30A1-\u30FA] | [\u3105-\u312C] | [\uAC00-\uD7A3]
-
-/* 86 */
-Ideographic = [\u4E00-\u9FA5] | \u3007 | [\u3021-\u3029]
-
-/* 4 */ /* is '.' to be escaped?? */
-NameChar = {Letter} | {Digit} | . | - | _ | : | {CombiningChar} | {Extender}
-
-/* 5 */
-Name = ({Letter} | _ | :) {NameChar}*
-
-/* 87 */
-CombiningChar = [\u0300-\u0345] | [\u0360-\u0361] | [\u0483-\u0486] | [\u0591-\u05A1] | [\u05A3-\u05B9] | [\u05BB-\u05BD] | \u05BF | [\u05C1-\u05C2] | \u05C4 | [\u064B-\u0652] | \u0670 | [\u06D6-\u06DC] | [\u06DD-\u06DF] | [\u06E0-\u06E4] | [\u06E7-\u06E8] | [\u06EA-\u06ED] | [\u0901-\u0903] | \u093C | [\u093E-\u094C] | \u094D | [\u0951-\u0954] | [\u0962-\u0963] | [\u0981-\u0983] | \u09BC | \u09BE | \u09BF | [\u09C0-\u09C4] | [\u09C7-\u09C8] | [\u09CB-\u09CD] | \u09D7 | [\u09E2-\u09E3] | \u0A02 | \u0A3C | \u0A3E | \u0A3F | [\u0A40-\u0A42] | [\u0A47-\u0A48] | [\u0A4B-\u0A4D] | [\u0A70-\u0A71] | [\u0A81-\u0A83] | \u0ABC | [\u0ABE-\u0AC5] | [\u0AC7-\u0AC9] | [\u0ACB-\u0ACD] | [\u0B01-\u0B03] | \u0B3C | [\u0B3E-\u0B43] | [\u0B47-\u0B48] | [\u0B4B-\u0B4D] | [\u0B56-\u0B57] | [\u0B82-\u0B83] | [\u0BBE-\u0BC2] | [\u0BC6-\u0BC8] | [\u0BCA-\u0BCD] | \u0BD7 | [\u0C01-\u0C03] | [\u0C3E-\u0C44] | [\u0C46-\u0C48] | [\u0C4A-\u0C4D] | [\u0C55-\u0C56] | [\u0C82-\u0C83] | [\u0CBE-\u0CC4] | [\u0CC6-\u0CC8] | [\u0CCA-\u0CCD] | [\u0CD5-\u0CD6] | [\u0D02-\u0D03] | [\u0D3E-\u0D43] | [\u0D46-\u0D48] | [\u0D4A-\u0D4D] | \u0D57 | \u0E31 | [\u0E34-\u0E3A] | [\u0E47-\u0E4E] | \u0EB1 | [\u0EB4-\u0EB9] | [\u0EBB-\u0EBC] | [\u0EC8-\u0ECD] | [\u0F18-\u0F19] | \u0F35 | \u0F37 | \u0F39 | \u0F3E | \u0F3F | [\u0F71-\u0F84] | [\u0F86-\u0F8B] | [\u0F90-\u0F95] | \u0F97 | [\u0F99-\u0FAD] | [\u0FB1-\u0FB7] | \u0FB9 | [\u20D0-\u20DC] | \u20E1 | [\u302A-\u302F] | \u3099 | \u309A
-
-/* 88 */
-Digit = [\u0030-\u0039] | [\u0660-\u0669] | [\u06F0-\u06F9] | [\u0966-\u096F] | [\u09E6-\u09EF] | [\u0A66-\u0A6F] | [\u0AE6-\u0AEF] | [\u0B66-\u0B6F] | [\u0BE7-\u0BEF] | [\u0C66-\u0C6F] | [\u0CE6-\u0CEF] | [\u0D66-\u0D6F] | [\u0E50-\u0E59] | [\u0ED0-\u0ED9] | [\u0F20-\u0F29]
-
-/* 89 */
-Extender = \u00B7 | \u02D0 | \u02D1 | \u0387 | \u0640 | \u0E46 | \u0EC6 | \u3005 | [\u3031-\u3035] | [\u309D-\u309E] | [\u30FC-\u30FE]
-*/
-
-Letter = [a-zA-Z]
-NameChar = {Letter} | [0-9]
-//Name = ({Letter} | _ | :) {NameChar}*
-//Name = [^\x20\x09\x0D\x0A]+
-Name = [^\x20\x09\x0D\x0A\|,\!\?\+\*\(\)<>]+
-ElementRefName = [^\x20\x09\x0D\x0A\|,\?\+\*\(\)<>]+
-EntityName = [^\x20\x09\x0D\x0A\|,\?\*\(\)<>]+
-ParmEntityName = [^\x20\x09\x0D\x0A\!%;<>]+
-
-CommentStart = \!--
-CommentContent = [^->]+
-CommentEnd = -->
-ElementStart = ELEMENT
-ElementContent = [^<>]*
-
-EntityStart = ENTITY
-Entity_Parm = %{S}
-EntityContent = {S}[^<>]*
-
-NotationStart = NOTATION
-NotationContent = {S}[^<>]*
-AttList = ATTLIST
-ExternalParmEntityRef = %{ParmEntityName};
-EndTag = >
-StartTag = <
-System = SYSTEM
-Public = PUBLIC
-NData = NDATA
-
-// these are attribute type keywords
-// we reuse NOTATION from NotationStart
-// we reuse ENTITY from EntityStart
-CData = CDATA
-ID = ID
-IDRef = IDREF
-IDRefs = IDREFS
-Entities = ENTITIES
-NMToken = NMTOKEN
-NMTokens = NMTOKENS
-
-// these are attribute defaults keywords
-Required = #REQUIRED
-Implied = #IMPLIED
-Fixed = #FIXED
-
-
-Empty = EMPTY
-Any = ANY
-PcData = #PCDATA
-LeftParen = \(
-RightParen = \)
-
-Percent = %
-Semicolon = ;
-Plus = \+
-Choice = \|
-Sequence = ,
-Connector = {Choice}|{Sequence}
-OccurOptional = \?
-OccurOneOrMore = \+
-OccurZeroOrMore = \*
-OccurType = {OccurOptional}|{OccurOneOrMore}|{OccurZeroOrMore}
-Exclamation = \!
-SingleQuotedLiteral = '[^']*'
-DoubleQuotedLiteral = \"[^\"]*\"
-NonTagContent = [^\x20\x09\x0D\x0A<>]*
-NonEnumContent = [^\x20\x09\x0D\x0A<>\(\)\|]*
-
-%%
-
-<YYINITIAL> {
- {StartTag} { return createToken(DTDRegionTypes.START_TAG); }
- {EndTag} { return createToken(DTDRegionTypes.END_TAG); }
- {Exclamation} { return createToken(DTDRegionTypes.EXCLAMATION); }
- {Percent} { return createToken(DTDRegionTypes.PERCENT); }
- {Semicolon} { return createToken(DTDRegionTypes.SEMICOLON); }
-
- {ElementStart} { yybegin(ELEMENT_NAME); return createToken(DTDRegionTypes.ELEMENT_TAG); }
- {CommentStart} { yybegin(COMMENT_CONTENT); return createToken(DTDRegionTypes.COMMENT_START); }
- {EntityStart} { yybegin(ENTITY_NAME); return createToken(DTDRegionTypes.ENTITY_TAG); }
- {NotationStart} { yybegin(NOTATION_NAME); return createToken(DTDRegionTypes.NOTATION_TAG); }
- {AttList} { yybegin(ATTLIST_NAME); return createToken(DTDRegionTypes.ATTLIST_TAG); }
-
- {ExternalParmEntityRef} { return createToken(DTDRegionTypes.ENTITY_PARM); }
-// just a parmentityname by itself is no good. we use this
-// to capture garbage content at the top level
- {ParmEntityName} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
-}
-
-<ELEMENT_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {PcData}|\({S}*{PcData}{S}*\) { return createToken(DTDRegionTypes.CONTENT_PCDATA); }
- {Name} { return createToken(DTDRegionTypes.NAME); }
-
- {LeftParen} { return createToken(DTDRegionTypes.LEFT_PAREN); }
- {Connector} { return createToken(DTDRegionTypes.CONNECTOR); }
- {OccurType} { return createToken(DTDRegionTypes.OCCUR_TYPE); }
- {RightParen} { return createToken(DTDRegionTypes.RIGHT_PAREN); }
-
- {StartTag} { yypushback(yylength()); yybegin(YYINITIAL); }
- {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-// ******** <!ATTLIST...>
-<ATTLIST_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTLIST_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(ATTRIBUTE_CONTENT); return createToken(DTDRegionTypes.ATTRIBUTE_NAME); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_CONTENT> {
- {LineTerminator} { yypushback(yylength()); yybegin(ATTLIST_CONTENT); }
- {NonLineTerminatorWhitespace}
- { return createToken(DTDRegionTypes.WHITESPACE); }
- {CData} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.CDATA_KEYWORD); }
-
- {ID} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ID_KEYWORD); }
- {IDRef} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREF_KEYWORD); }
- {IDRefs} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREFS_KEYWORD); }
- {EntityStart} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITY_KEYWORD); }
- {Entities} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITIES_KEYWORD); }
- {NMToken} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKEN_KEYWORD); }
- {NMTokens} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKENS_KEYWORD); }
- {NotationStart} { yybegin(ATTRIBUTE_ENUMERATION); return createToken(DTDRegionTypes.NOTATION_KEYWORD); }
-
- {Required} | {Implied} | {Fixed} | {SingleQuotedLiteral} | { DoubleQuotedLiteral}
- { yypushback(yylength()); yybegin(ATTRIBUTE_DEFAULT); }
-
- {LeftParen} { yypushback(yylength()); yybegin(ATTRIBUTE_ENUMERATION); }
- {NonEnumContent} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.PARM_ENTITY_TYPE); }
- {NonEnumContent}|{RightParen}|{Choice} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_DEFAULT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Required} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.REQUIRED_KEYWORD); }
- {Implied} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.IMPLIED_KEYWORD); }
- {Fixed} { return createToken(DTDRegionTypes.FIXED_KEYWORD); }
- {SingleQuotedLiteral} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NonTagContent} { yypushback(yylength()); yybegin(ATTLIST_CONTENT); } //return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_ENUMERATION> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {LeftParen} { return createToken(DTDRegionTypes.LEFT_PAREN); }
- {Choice} { return createToken(DTDRegionTypes.ENUM_CHOICE); }
- {RightParen} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.RIGHT_PAREN); }
- {NonEnumContent} { return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!ENTITY...>
-<ENTITY_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Percent} { return createToken(DTDRegionTypes.PERCENT); }
- {EntityName} { yybegin(ENTITY_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ENTITY_CONTENT> {
-// {EntityContent} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.ENTITY_CONTENT); }
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {System} | {Public} { yypushback(yylength()); yybegin(EXTERNALID_CONTENT); }
- {SingleQuotedLiteral} { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!NOTATION...>
-<NOTATION_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(EXTERNALID_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<EXTERNALID_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {System} { return createToken(DTDRegionTypes.SYSTEM_KEYWORD); }
- {Public} { return createToken(DTDRegionTypes.PUBLIC_KEYWORD); }
- {SingleQuotedLiteral} { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NData} { yybegin(NDATA_CONTENT); return createToken(DTDRegionTypes.NDATA_KEYWORD); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<NDATA_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {NonTagContent} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.NDATA_VALUE); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!-- ...>
-<COMMENT_CONTENT> {
- {CommentEnd} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.COMMENT_END); }
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {CommentContent} | "-" | ">" { return createToken(DTDRegionTypes.COMMENT_CONTENT); }
-}
-
-
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton
deleted file mode 100644
index f686e8b4b7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton
+++ /dev/null
@@ -1,317 +0,0 @@
-
- /** This character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
---- final private static int YY_BUFFERSIZE = ...;
-
- /** lexical states */
---- lexical states, charmap
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
---- isFinal list
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[YY_BUFFERSIZE];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- //private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- int yycolumn;
-
- /** yy_atEOF == true <=> the scanner is at the EOF */
- private boolean yy_atEOF;
-
---- user class code
-
- /**
- * 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.
- */
---- constructor declaration
-
-
- /**
- * Refills the input buffer.
- *
- * @return <code>false</code>, iff there was new input.
- *
- * @exception java.io.IOException if any I/O-Error occurs
- */
- private boolean yy_refill() throws java.io.IOException {
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if (numRead < 0) {
- return true;
- }
- else {
- yy_endRead+= numRead;
- return false;
- }
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
-
- if (yy_reader != null)
- yy_reader.close();
- }
-
-
- /**
- * Closes the current stream, and resets the
- * scanner to read from a new input stream.
- *
- * All internal variables are reset, the old input stream
- * <b>cannot</b> be reused (internal buffer is discarded and lost).
- * Lexical state is set to <tt>YY_INITIAL</tt>.
- *
- * @param reader the new input stream
- */
- final public void yyreset(java.io.Reader reader) throws java.io.IOException {
- yyclose();
- yy_reader = reader;
- yy_atEOF = false;
- yy_endRead = yy_startRead = 0;
- yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
- yyline = yychar = yycolumn = 0;
- yy_lexical_state = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
-
- /**
- * Returns the character at position <tt>pos</tt> from the
- * matched text.
- *
- * It is equivalent to yytext().charAt(pos), but faster
- *
- * @param pos the position of the character to fetch.
- * A value from 0 to yylength()-1.
- *
- * @return the character at position pos
- */
- final public char yycharat(int pos) {
- return yy_buffer[yy_startRead+pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * In a wellformed scanner (no or only correct usage of
- * yypushback(int) and a match-all fallback rule) this method
- * will only be called with things that "Can't Possibly Happen".
- * If this method is called, something is seriously wrong
- * (e.g. a JFlex bug producing a faulty scanner etc.).
- *
- * Usual syntax/scanner level error handling should be done
- * in error fallback rules.
- *
- * @param errorCode the code of the errormessage to display
- */
---- yy_ScanError declaration
- String message;
- try {
- message = YY_ERROR_MSG[errorCode];
- }
- catch (ArrayIndexOutOfBoundsException e) {
- message = YY_ERROR_MSG[YY_UNKNOWN_ERROR];
- }
-
---- throws clause
- }
-
-
- /**
- * 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()!
- */
---- yypushback decl (contains yy_ScanError exception)
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
---- yy_doEof
- /**
- * 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
- */
---- yylex declaration
- int yy_input;
- int yy_action;
-
- // cached fields:
- int yy_currentPos_l;
- int yy_markedPos_l;
- int yy_endRead_l = yy_endRead;
- char [] yy_buffer_l = yy_buffer;
- char [] yycmap_l = yycmap;
-
---- local declarations
-
- while (true) {
- yy_markedPos_l = yy_markedPos;
-
---- start admin (line, char, col count)
- yy_action = -1;
-
- yy_currentPos_l = yy_currentPos =
- yy_startRead = yy_markedPos_l;
-
---- start admin (lexstate etc)
-
- yy_forAction: {
- while (true) {
-
---- next input, line, col, char count, next transition, isFinal action
- yy_action = yy_state;
- yy_markedPos_l = yy_currentPos_l;
---- line count update
- }
-
- }
- }
-
- // store back cached position
- yy_markedPos = yy_markedPos_l;
---- char count update
-
- switch (yy_action) {
-
---- actions
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
---- eofvalue
- }
- else {
---- no match
- }
- }
- }
- }
-
---- main
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java
deleted file mode 100644
index 1a514efdbf..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java
+++ /dev/null
@@ -1,57 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-
-public class DTDBatchNodeDelete {
- protected DTDFile dtdFile;
-
- protected List nodes = new ArrayList();
-
- public DTDBatchNodeDelete(DTDFile dtdFile) {
- this.dtdFile = dtdFile;
- }
-
- public void addNode(DTDNode node) {
- // first check if the node is contained by anyone
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
-
- if (currentNode.containsRange(node.getStartOffset(), node.getEndOffset())) {
- // then no need to add the node to the list to be deleted
- return;
- }
-
- if (node.getStartOffset() < currentNode.getStartOffset() && node.getEndOffset() <= currentNode.getStartOffset()) {
- nodes.add(i, node);
- return;
- }
- }
- // if we get here, then add it to the end
- nodes.add(node);
- }
-
- public void deleteNodes(Object requestor) {
- for (int i = nodes.size() - 1; i >= 0; i--) {
- DTDNode node = (DTDNode) nodes.get(i);
- dtdFile.deleteNode(requestor, node);
- }
- nodes.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java
deleted file mode 100644
index be853bbbb9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java
+++ /dev/null
@@ -1,134 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-
-/*
- * This class is responsible for updating the model when items are deleted or
- * so that items referenced by it are cleaned up note that top level nodes are
- * queued up for deletion so that iteration over the list of nodes from the
- * dtdfile is not messed up. Note that when an external parmeter entity
- * changes, the client of the model (e.g. editor) must be a DTDFileListener
- * implementing the listener's interface to keep the model's referential
- * integrity (See DTDModelImpl for example).
- */
-
-public class DTDExternalReferenceRemover extends DTDVisitor {
-
- protected DTDBatchNodeDelete batchDelete;
- protected List externalElementsAndParmEntities = new ArrayList();
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
- protected DTDNode nodeToDelete;
- protected String oldRefName = ""; //$NON-NLS-1$
- protected Object requestor;
-
- public DTDExternalReferenceRemover() {
-
- }
-
- public synchronized void externalReferenceAboutToChange(Object requestor, Entity entity) {
- if (isUpdating) {
- return;
- }
- if (!entity.isParameterEntity() || !entity.isExternalEntity()) {
- // if it is not an external parameter entity, ignore as well
- return;
- }
-
- isUpdating = true;
- this.requestor = requestor;
-
- DTDFile dtdFile = entity.getDTDFile();
- if (batchDelete == null) {
- batchDelete = new DTDBatchNodeDelete(dtdFile);
- }
-
- // See the comment at the head of this file regarding
- // external parameter entities.
- // externalElementsAndParmEntities =
- // dtdFile.getDTDModel().getExternalModels().getElementContentNames(entity.getPublicID(),
- // dtdFile.getDTDModel().resolveID(entity.getPublicID(),
- // entity.getSystemID()));
-
- visit(dtdFile);
-
- batchDelete.deleteNodes(requestor);
-
- isUpdating = false;
- }
-
- public boolean isMatchingName(String name) {
- return externalElementsAndParmEntities.contains(name);
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- String attrName = attr.getName();
- String attrType = attr.getType();
-
- if (isParameterEntityRef(attrName)) {
- if (isMatchingName(attrName)) {
- attr.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- if (isParameterEntityRef(attrType)) {
- if (isMatchingName(attrType)) {
- attr.setType(requestor, Attribute.CDATA);
- }
- }
- }
-
- public void visitAttributeList(AttributeList attList) {
- super.visitAttributeList(attList);
- String attListName = attList.getName();
- if (isParameterEntityRef(attListName)) {
- if (isMatchingName(attListName)) {
- attList.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- }
-
- public void visitElement(Element element) {
- String elementName = element.getName();
- if (isParameterEntityRef(elementName)) {
- if (isMatchingName(elementName)) {
- element.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- super.visitElement(element);
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
- String refName = node.getName();
- if (isMatchingName(refName)) {
- batchDelete.addNode(node);
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java
deleted file mode 100644
index 4b9cdfac7f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java
+++ /dev/null
@@ -1,135 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-// this class is responsible for updating the model when items
-// are deleted or a external parm entity changes so that
-// items referenced by it are cleaned up
-// note that top level nodes are queued up for deletion so that
-// iteration over the list of nodes from the dtdfile is not messed up
-public class DTDModelUpdater extends DTDVisitor {
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
-
- protected List nodesToDelete = new ArrayList();
- protected DTDNode nodeToDelete;
- protected String oldRefName = ""; //$NON-NLS-1$
- protected Object requestor;
-
- public DTDModelUpdater() {
-
- }
-
- public synchronized void objectAboutToBeDeleted(Object requestor, DTDNode node) {
- if (isUpdating) {
- return;
- }
- if (!(node instanceof Entity || node instanceof Element)) {
- // just ignore if it is not one of these
- return;
- }
- if (node instanceof Entity && !((Entity) node).isParameterEntity()) {
- // if it is not a parameter entity, ignore as well
- return;
- }
-
-
- isUpdating = true;
- this.requestor = requestor;
- this.nodeToDelete = node;
- oldRefName = node.getName();
- isParmEntity = false;
- nodesToDelete.clear();
-
- if (node instanceof Entity) {
- isParmEntity = true;
- oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- DTDFile dtdFile = node.getDTDFile();
- visit(dtdFile);
-
- for (int i = 0; i < nodesToDelete.size(); i++) {
- dtdFile.deleteNode(requestor, (DTDNode) nodesToDelete.get(i));
- }
-
- isUpdating = false;
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- if (isParmEntity) {
- if (attr.getName().equals(oldRefName)) {
- attr.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- if (attr.getType().equals(oldRefName)) {
- attr.setType(requestor, Attribute.CDATA);
- }
- }
- // check the attr name and the attr type to see if it
- // needs updating
- }
-
- public void visitAttributeList(AttributeList attList) {
- super.visitAttributeList(attList);
- if (attList.getName().equals(oldRefName)) {
- if (isParmEntity) {
- attList.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- else {
- // save up for later deletion
- nodesToDelete.add(attList);
- }
- }
- }
-
- public void visitElement(Element element) {
- if (isParmEntity) {
- if (element.getName().equals(oldRefName)) {
- element.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- super.visitElement(element);
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- super.visitExternalParameterEntityReference(parmEntityRef);
- if (isParmEntity && parmEntityRef.getName().equals(oldRefName)) {
- nodesToDelete.add(parmEntityRef);
- }
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
-
- if (node.getName().equals(oldRefName)) {
- DTDNode parent = (DTDNode) node.getParentNode();
- parent.delete(requestor, node);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java
deleted file mode 100644
index 10b9e4445f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java
+++ /dev/null
@@ -1,93 +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.dtd.core.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeEnumList;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-
-public class DTDNotationReferenceRemover {
- protected Notation notation;
- protected String notationName;
-
- protected Object requestor;
-
- public DTDNotationReferenceRemover() {
-
- }
-
- public void notationAboutToBeDeleted(Object requestor, Notation notation) {
- this.requestor = requestor;
- this.notation = notation;
- notationName = notation.getName();
-
- visit(notation.getDTDFile());
- }
-
- public void visit(DTDFile file) {
- List nodes = file.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
- if (currentNode instanceof Entity) {
- visitEntity((Entity) currentNode);
- }
- else if (currentNode instanceof AttributeList) {
- visitAttributeList((AttributeList) currentNode);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- if (attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
- AttributeEnumList enumList = attr.getEnumList();
- List notationNames = enumList.getItems();
- Iterator iter = notationNames.iterator();
- boolean updateRequired = false;
- while (iter.hasNext()) {
- String notation = (String) iter.next();
- if (notation.equals(notationName)) {
- updateRequired = true;
- iter.remove();
- }
- }
- if (updateRequired) {
- String[] newItems = new String[notationNames.size()];
- notationNames.toArray(newItems);
- enumList.setItems(requestor, newItems);
- }
- }
- }
-
- public void visitAttributeList(AttributeList attList) {
- Attribute attr = (Attribute) attList.getFirstChild();
- while (attr != null) {
- visitAttribute(attr);
- attr = (Attribute) attr.getNextSibling();
- }
- }
-
- public void visitEntity(Entity entity) {
- if (entity.getNotationName().equals(notationName)) {
- entity.setNotationName(requestor, ""); //$NON-NLS-1$
- }
- }
-
-}// DTDNotationRemover
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java
deleted file mode 100644
index fa9297f1e2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java
+++ /dev/null
@@ -1,196 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeEnumList;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-// this class is responsible for updating any dtd node in
-// response to a change in the node that they reference
-public class DTDReferenceUpdater extends DTDVisitor {
- protected boolean isNotation = false;
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
- protected String newName = ""; //$NON-NLS-1$
- protected String oldRefName = "", newRefName = ""; //$NON-NLS-1$ //$NON-NLS-2$
- protected DTDNode referencedNode = null;
-
- // the references List is a cache of the DTDNodes that are changed
- // as a result of a call to nameAboutToChange(). The idea is that
- // if a subsequent call comes in that changes the name of the same
- // object for which this cache exists for, then we optimize the
- // path by just walking the cache
- private List references = new ArrayList();
- protected Object requestor;
-
- public DTDReferenceUpdater() {
-
- }
-
- public void clearCache() {
- referencedNode = null;
- references.clear();
- }
-
- public synchronized void nameAboutToChange(Object requestor, DTDNode referencedNode, String newName) {
- if (isUpdating) {
- return;
- }
- if (!(referencedNode instanceof Entity || referencedNode instanceof Element || referencedNode instanceof Notation)) {
- // just ignore if it is not one of these
- return;
- }
- if (referencedNode instanceof Entity && !((Entity) referencedNode).isParameterEntity()) {
- // if it is not a parameter entity, ignore as well
- return;
- }
-
- isUpdating = true;
- this.requestor = requestor;
- oldRefName = referencedNode.getName();
- this.newName = newRefName = newName;
- isParmEntity = false;
- isNotation = referencedNode instanceof Notation;
-
- if (referencedNode instanceof Entity) {
- isParmEntity = true;
- oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- newRefName = "%" + newRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (this.referencedNode != null) {
- // check if the previous referenced node that was changed
- // is the same as the one that is coming in. if so, just
- // change the previous regions
- if (this.referencedNode == referencedNode) {
- quickUpdate();
- isUpdating = false;
- return;
- }
- }
-
- // clear the cache if we get here
- this.referencedNode = referencedNode;
- references.clear();
- DTDFile dtdFile = referencedNode.getDTDFile();
- visit(dtdFile);
- isUpdating = false;
- }
-
- protected void quickUpdate() {
- for (int i = 0; i < references.size(); i++) {
- DTDNode node = (DTDNode) references.get(i);
- if (node instanceof Element) {
- visitElement((Element) node);
- }
- else if (node instanceof AttributeList) {
- visitAttributeList((AttributeList) node);
- }
- else if (node instanceof Attribute) {
- visitAttribute((Attribute) node);
- }
- else if (node instanceof CMBasicNode) {
- visitReference((CMBasicNode) node);
- }
- else if (node instanceof ParameterEntityReference) {
- visitExternalParameterEntityReference((ParameterEntityReference) node);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- if (isParmEntity) {
- // check the attr name and the attr type to see if it
- // needs updating
- if (attr.getName().equals(oldRefName)) {
- attr.setName(requestor, newRefName);
- references.add(attr);
- }
- if (attr.getType().equals(oldRefName)) {
- attr.setType(requestor, newRefName);
- references.add(attr);
- }
- }
- else if (isNotation && attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
- AttributeEnumList enumList = attr.getEnumList();
- List items = enumList.getItems();
- boolean updateNeeded = false;
- for (int i = 0; i < items.size(); i++) {
- String notationName = (String) items.get(i);
- if (notationName.equals(oldRefName)) {
- updateNeeded = true;
- items.set(i, newName);
- }
- }
- if (updateNeeded) {
- String[] newItems = new String[items.size()];
-
- enumList.setItems((String[]) items.toArray(newItems));
- }
- }
-
- }
-
- public void visitAttributeList(AttributeList attList) {
- if (!isNotation && attList.getName().equals(oldRefName)) {
- attList.setName(requestor, newRefName);
- references.add(attList);
- }
- super.visitAttributeList(attList);
- }
-
- public void visitElement(Element element) {
- if (isParmEntity) {
- if (element.getName().equals(oldRefName)) {
- element.setName(requestor, newRefName);
- references.add(element);
- }
- }
- super.visitElement(element);
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- super.visitExternalParameterEntityReference(parmEntityRef);
- if (parmEntityRef.getName().equals(oldRefName)) {
- parmEntityRef.setReferencedEntity(requestor, newName);
- references.add(parmEntityRef);
- }
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
- if (isParameterEntityRef(oldRefName) && !isParmEntity) {
- return;
- }
-
- if (node.getName().equals(oldRefName)) {
- node.setName(requestor, newRefName);
- references.add(node);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java
deleted file mode 100644
index e94215daf5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java
+++ /dev/null
@@ -1,95 +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.dtd.core.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-
-public class DTDUniqueNameHelper {
-
- static public String getName(Object obj) {
- if (obj instanceof Element) {
- return ((Element) obj).getName();
- }
- else if (obj instanceof Entity) {
- return ((Entity) obj).getName();
- }
- else if (obj instanceof Notation) {
- return ((Notation) obj).getName();
- }
- else if (obj instanceof Attribute) {
- return ((Attribute) obj).getName();
- }
- else if (obj instanceof CMBasicNode) // Model Group Content
- {
- return ((CMBasicNode) obj).getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- static public String getUniqueAttributeName(Element element) {
- List attrs = element.getElementAttributes();
- return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
- }
-
- static public String getUniqueElementName(DTDFile dtdFile) {
- List elements = dtdFile.getElementsAndParameterEntityReferences().getNodes();
- return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
- }
-
- static public String getUniqueEntityName(DTDFile dtdFile) {
- List entities = dtdFile.getEntities().getNodes();
- return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
- }
-
- static public String getUniqueName(List objs, String token) {
- int counter = 1;
-
- boolean uniqueName = false;
- while (!uniqueName) {
- String newName = token + new Integer(counter++);
- uniqueName = true;
- Iterator iter = objs.iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- String objName = getName(obj);
- if (objName.equals(newName)) {
- uniqueName = false;
- break;
- }
- }
- if (uniqueName) {
- return newName;
- }
- }
- // we shouldn't get here
- return "No Name found"; //$NON-NLS-1$
- }
-
- static public String getUniqueNotationName(DTDFile dtdFile) {
- List notations = dtdFile.getNotations().getNodes();
- return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
- }
-
- public DTDUniqueNameHelper() {
- }
-
-} // DTDUniqueNameHelper
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
deleted file mode 100644
index 8b7b7c34d6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
+++ /dev/null
@@ -1,108 +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.dtd.core.internal.util;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-public class DTDVisitor {
-
- public DTDVisitor() {
-
- }
-
- // utility method
- public boolean isParameterEntityRef(String reference) {
- if (reference.length() > 0) {
- return reference.charAt(0) == '%' && reference.charAt(reference.length() - 1) == ';';
- }
- return false;
- }
-
- public void visit(DTDFile file) {
- List nodes = file.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
- if (currentNode instanceof Element) {
- visitElement((Element) currentNode);
- }
- else if (currentNode instanceof AttributeList) {
- visitAttributeList((AttributeList) currentNode);
- }
- else if (currentNode instanceof ParameterEntityReference) {
- visitExternalParameterEntityReference((ParameterEntityReference) currentNode);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- }
-
- public void visitAttributeList(AttributeList attList) {
- // note that we don't visit attributes here because we
- // want the element to visit them with it's consolidated list
- // that it creates by gathering all attribute lists together
- }
-
- public void visitAttributes(List attributes) {
- int size = attributes.size();
- for (int i = 0; i < size; i++) {
- Attribute attr = (Attribute) attributes.get(i);
- visitAttribute(attr);
- }
- }
-
- public void visitContentNode(CMNode content) {
- if (content instanceof CMBasicNode) {
- CMBasicNode basicNode = (CMBasicNode) content;
- if (basicNode.isReference()) {
- visitReference(basicNode);
- }
- }
- else if (content instanceof CMGroupNode) {
- visitGroupNode((CMGroupNode) content);
- }
- }
-
- public void visitElement(Element element) {
- CMNode content = element.getContentModel();
- visitContentNode(content);
- visitAttributes(element.getElementAttributes());
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- }
-
- public void visitGroupNode(CMGroupNode group) {
- List children = group.getChildrenList();
- int size = children.size();
- for (int i = 0; i < size; i++) {
- visitContentNode((CMNode) children.get(i));
- }
- }
-
- public void visitReference(CMBasicNode node) {
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java
deleted file mode 100644
index d347afae17..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-
-public class LabelValuePair {
-
- public String fLabel;
- public Object fValue;
-
- /**
- * Creates a new name/value item
- */
- public LabelValuePair(String label, Object value) {
- Assert.isTrue(label != null);
- fLabel = label;
- fValue = value;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java
deleted file mode 100644
index 85b629ebe9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java
+++ /dev/null
@@ -1,24 +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.dtd.core.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types DTD.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @since 1.1
- */
-public interface IDTDPartitions {
-
- String DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/.classpath b/bundles/org.eclipse.wst.dtd.ui/.classpath
deleted file mode 100644
index 95e5f5e6c3..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-properties"/>
- <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/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.dtd.ui/.cvsignore b/bundles/org.eclipse.wst.dtd.ui/.cvsignore
deleted file mode 100644
index 4d45660218..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-runtime
-dtdui.jar
-*.zip
-build.xml
-temp.folder
-@dot
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.dtd.ui/.options b/bundles/org.eclipse.wst.dtd.ui/.options
deleted file mode 100644
index 35173eb372..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.dtd.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.dtd.ui/.project b/bundles/org.eclipse.wst.dtd.ui/.project
deleted file mode 100644
index 16b209c4e8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtd.ui</name>
- <comment></comment>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4792166435..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:57:35 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.wst.dtd.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.wst.dtd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.wst.dtd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index f0c9217859..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtd.ui; singleton:=true
-Bundle-Version: 1.0.600.qualifier
-Bundle-Activator: org.eclipse.wst.dtd.ui.internal.DTDUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.dtd.ui,
- org.eclipse.wst.dtd.ui.internal;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.dnd;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.properties.section;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.style;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.text;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.views.properties;x-internal:=true,
- org.eclipse.wst.dtd.ui.internal.wizard;x-internal:=true,
- org.eclipse.wst.dtd.ui.views.contentoutline
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.dtd.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.2.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.dtd.ui/about.html b/bundles/org.eclipse.wst.dtd.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.wst.dtd.ui/build.properties b/bundles/org.eclipse.wst.dtd.ui/build.properties
deleted file mode 100644
index 8f38fb6478..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/build.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-# David Carver, STAR - add new dtd file templates, bug 162321
-#
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- templates/,\
- META-INF/,\
- .options,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = src/,\
- src-properties/
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif b/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
deleted file mode 100644
index 64ee536107..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif b/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif
deleted file mode 100644
index 13dae59bea..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b8d7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb34f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
deleted file mode 100644
index a7fb780c77..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
deleted file mode 100644
index 3755e5e42e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a58e11192..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
deleted file mode 100644
index d525a21e73..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif
deleted file mode 100644
index 33f634f274..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b8d7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb34f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif
deleted file mode 100644
index 0fd5dd8913..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/generate_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif
deleted file mode 100644
index 10b1a77cda..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
deleted file mode 100644
index 39611d6c63..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
deleted file mode 100644
index cb415064e0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
deleted file mode 100644
index 5efa9b905e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
deleted file mode 100644
index 57ad089a69..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif
deleted file mode 100644
index 64ee536107..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/any.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/any.gif
deleted file mode 100644
index 7017d91b91..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/any.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute_list.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute_list.gif
deleted file mode 100644
index 795eb5e9f4..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/attribute_list.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/comment.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/comment.gif
deleted file mode 100644
index 28c2ccb1e7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element_ref.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element_ref.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/element_ref.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/emptycontent.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/emptycontent.gif
deleted file mode 100644
index bc8e66c20f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/emptycontent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity.gif
deleted file mode 100644
index 6a91888855..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index d30b26b97a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_el.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_el.gif
deleted file mode 100644
index 801c13388d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_ent.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_ent.gif
deleted file mode 100644
index 2fb2ca7a92..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_ent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_not.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_not.gif
deleted file mode 100644
index 59096688cc..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_not.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_unrec.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_unrec.gif
deleted file mode 100644
index 6fd82e60e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/fldr_unrec.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_attlist_obj.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_attlist_obj.gif
deleted file mode 100644
index f849c75d58..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_attlist_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_comments_obj.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_comments_obj.gif
deleted file mode 100644
index c9f09459e6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/folder_comments_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/genhtmform_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/genhtmform_wiz.gif
deleted file mode 100644
index 5f54702ffc..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/genhtmform_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif
deleted file mode 100644
index 2c115ff961..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/notation.gif
deleted file mode 100644
index ce9df985b8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/one.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/one.gif
deleted file mode 100644
index 694c26f273..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/one.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onechoice.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onechoice.gif
deleted file mode 100644
index d13ba2e5b0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormore.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormore.gif
deleted file mode 100644
index 8b2b357f48..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormorechoice.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormorechoice.gif
deleted file mode 100644
index 96398c0ce1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormoresequence.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormoresequence.gif
deleted file mode 100644
index 041db277d1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/oneormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onesequence.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onesequence.gif
deleted file mode 100644
index 5f9658e5b3..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/onesequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optional.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optional.gif
deleted file mode 100644
index e7422d7738..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optional.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalchoice.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalchoice.gif
deleted file mode 100644
index fb4f9bd29e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalchoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalsequence.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalsequence.gif
deleted file mode 100644
index f8d5289f11..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/optionalsequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
deleted file mode 100644
index 093c6bad04..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/txtext.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/unrecognized_content.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/unrecognized_content.gif
deleted file mode 100644
index 358997d294..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/unrecognized_content.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
deleted file mode 100644
index 86196e996f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormore.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormore.gif
deleted file mode 100644
index daf514dccd..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormorechoice.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormorechoice.gif
deleted file mode 100644
index a1ac131e67..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormoresequence.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormoresequence.gif
deleted file mode 100644
index 8ed4cb7374..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/zeroormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.png b/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.png
deleted file mode 100644
index 636d79261f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.properties b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
deleted file mode 100644
index b06dedc3c0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-! Properties file for component: XMDTD - XML Tools DTD Editor
-! Packaged for translation in: xml.zip
-
-providerName=Eclipse Web Tools Platform
-pluginName=SSE DTD Source Editor
-
-DTD_Source_Page_Editor.name=DTD Editor
-_UI_LABEL_DTD_FILES=DTD Files
-DTD_Templates.name=Templates
-_UI_LABEL_DTD_STYLES=Styles
-DTD_Syntax_Coloring=Syntax Coloring
-_UI_WIZARD_NEW_DTD=DTD File
-_UI_CREATE_NEW_DTD_FILE=Create a new DTD file
-##
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectHistory_label=Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-##
-_UI_MENU_VALIDATE_DTD = &Validate DTD File
-
-DTD_New_context_type_Extension_Element.name=New DTD
-DTD_New_File.tooltip=New DTD File
-_UI_LABEL_GENERAL=General
-_UI_LABEL_OTHER=Other
-_UI_LABEL_ATTRIBUTES=Attributes
-_UI_LABEL_DOCUMENTATION=Documentation
-##
-preferenceKeywords.files=editor dtd creating files suffix specified
-preferenceKeywords.templates=editor dtd templates snippet macros
-preferenceKeywords.styles=editor dtd style customize syntax highlighting type text content foreground background bold color
-
-Colors.dtdDefault=DTD Default
-Colors.dtdTag=DTD Tag
-Colors.dtdTagName=DTD Tag Name
-Colors.dtdComment=DTD Comment
-Colors.dtdKeyword=DTD Keyword
-Colors.dtdString=DTD String
-Colors.dtdData=DTD Data
-Colors.dtdSymbol=DTD Symbol
-Editor.name=Editor
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.xml b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
deleted file mode 100644
index 59fecff738..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.xml
+++ /dev/null
@@ -1,508 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.ui.editors">
- <!-- class="org.eclipse.wst.sse.ui.StructuredTextEditor" -->
- <editor
- name="%DTD_Source_Page_Editor.name"
- icon="$nl$/icons/full/obj16/DTDFile.gif"
- contributorClass="org.eclipse.wst.dtd.ui.internal.editor.ActionContributorDTD"
- class="org.eclipse.wst.dtd.ui.internal.DTDEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.dtd.core.dtdsource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.dtd.core.dtdsource" />
- </editor>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.wst.dtd.ui.views.contentoutline.DTDContentOutlineConfiguration"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.dtd.ui.internal.text.DTDDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- <provisionalConfiguration
- type="foldingstrategy"
- class="org.eclipse.wst.dtd.ui.internal.projection.DTDFoldingStrategy"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.dtd.ui.preferences.dtd, org.eclipse.wst.sse.ui.preferences.dtd.templates, org.eclipse.wst.sse.ui.preferences.dtd.styles"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- <!-- provide syntax highlighting for DTD subset within XML -->
- <provisionalConfiguration
- type="linestyleprovider"
- class="org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTDSubSet"
- target="org.eclipse.wst.xml.dtd.internal_subset" />
- <provisionalDefinition
- type="spellingregions"
- value="org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.COMMENT_CONTENT"
- target="org.eclipse.wst.dtd.core.dtdsource" />
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.wst.dtd.core.dtdsource.source.editorActions"
- targetID="org.eclipse.wst.dtd.core.dtdsource.source">
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- actionID="StructureSelectEnclosing">
- </action>
- <action
- id="StructureSelectNext"
- label="%StructureSelectNext_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- tooltip="%StructureSelectNext_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- actionID="StructureSelectNext">
- </action>
- <action
- id="StructureSelectPrevious"
- label="%StructureSelectPrevious_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- tooltip="%StructureSelectPrevious_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.wst.dtd.core.dtdsource.source"
- id="org.eclipse.wst.dtd.core.dtdsource.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>
-
- <!-- use a specific annotation model with FileBuffers -->
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
-
- <!-- Register the UI adapter factory provider -->
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.dtd.ui.internal.registry.AdapterFactoryProviderForDTD">
- <contentType id="org.eclipse.wst.dtd.core.dtdsource" />
- </adapterFactoryDescription>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.wst.dtd.core.dtdsource.source" />
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.dtd.core.dtdsource.source" />
- </actionSetPartAssociation>
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="%_UI_LABEL_DTD_FILES"
- category="org.eclipse.wst.xml.ui.preferences.xml"
- class="org.eclipse.wst.dtd.ui.internal.preferences.DTDFilesPreferencePage"
- id="org.eclipse.wst.dtd.ui.preferences.dtd">
- <keywordReference id="org.eclipse.wst.dtd.ui.files"/>
- </page>
- <page
- name="%DTD_Templates.name"
- category="org.eclipse.wst.dtd.ui.preferences.dtd"
- class="org.eclipse.wst.dtd.ui.internal.preferences.DTDTemplatePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.dtd.templates">
- <keywordReference id="org.eclipse.wst.dtd.ui.templates"/>
- </page>
- <page
- name="%DTD_Syntax_Coloring"
- category="org.eclipse.wst.dtd.ui.preferences.dtd"
- class="org.eclipse.wst.dtd.ui.internal.preferences.DTDSyntaxColoringPage"
- id="org.eclipse.wst.sse.ui.preferences.dtd.styles">
- <keywordReference id="org.eclipse.wst.dtd.ui.styles"/>
- </page>
- <page
- name="%Editor.name"
- category="org.eclipse.wst.dtd.ui.preferences.dtd"
- class="org.eclipse.wst.dtd.ui.internal.preferences.DTDEditorPreferencePage"
- id="org.eclipse.wst.dtd.ui.preferences.editor">
- </page>
- </extension>
-
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.files"
- id="org.eclipse.wst.dtd.ui.files"/>
- <keyword
- label="%preferenceKeywords.templates"
- id="org.eclipse.wst.dtd.ui.templates"/>
- <keyword
- label="%preferenceKeywords.styles"
- id="org.eclipse.wst.dtd.ui.styles"/>
- </extension>
-
- <!-- New DTD wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <wizard
- id="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"
- name="%_UI_WIZARD_NEW_DTD"
- class="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"
- category="org.eclipse.wst.XMLCategory"
- icon="$nl$/icons/full/etool16/newdtd_wiz.gif">
- <description>%_UI_CREATE_NEW_DTD_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <!-- initialize DTD ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceInitializer" />
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.dtd.core.dtdsource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
-
- <!-- Templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%DTD_New_context_type_Extension_Element.name"
- class="org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeDTD"
- id="dtd_new">
- </contextType>
- <include
- file="templates/dtddefault-templates.xml"
- translations="$nl$/templates/dtddefault-templates.properties">
- </include>
- </extension>
-
- <extension
- id="org.eclipse.wst.dtd.ui.propertyContributor"
- point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.eclipse.wst.dtd.core.dtdsource.source"
- labelProvider="org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider"
- typeMapper="org.eclipse.wst.dtd.ui.internal.properties.section.DTDTypeMapper">
- <propertyCategory
- category="dtd.ui.general"/>
- <propertyCategory
- category="dtd.ui.other"/>
- <propertyCategory
- category="dtd.ui.attributes"/>
- <propertyCategory
- category="dtd.ui.documentation"/>
- </propertyContributor>
- </extension>
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
- contributorId="org.eclipse.wst.dtd.core.dtdsource.source">
- <propertyTab
- label="%_UI_LABEL_GENERAL"
- category="dtd.ui.general"
- id="org.eclipse.wst.dtd.ui.general"/>
- <propertyTab
- afterTab="org.eclipse.wst.dtd.ui.general"
- category="dtd.ui.attributes"
- id="org.eclipse.wst.dtd.ui.attributes"
- label="%_UI_LABEL_ATTRIBUTES"/>
- <propertyTab
- afterTab="org.eclipse.wst.dtd.ui.attributes"
- category="dtd.ui.other"
- id="org.eclipse.wst.dtd.ui.other"
- label="%_UI_LABEL_OTHER"/>
- <propertyTab
- afterTab="org.eclipse.wst.dtd.ui.attributes"
- category="dtd.ui.documentation"
- id="org.eclipse.wst.dtd.ui.documentation"
- label="%_UI_LABEL_DOCUMENTATION"/>
- </propertyTabs>
- </extension>
-
-<extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections contributorId="org.eclipse.wst.dtd.core.dtdsource.source">
- <propertySection
- class="org.eclipse.wst.dtd.ui.internal.properties.section.NameSection"
- enablesFor="1"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.NameSection"
- tab="org.eclipse.wst.dtd.ui.general">
- <input type="org.eclipse.wst.dtd.core.internal.Element"/>
- <input type="org.eclipse.wst.dtd.core.internal.Attribute"/>
- <input type="org.eclipse.wst.dtd.core.internal.AttributeList"/>
- <input type="org.eclipse.wst.dtd.core.internal.Notation"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.AttributeDefaultSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.AttributeDefaultSection">
- <input type="org.eclipse.wst.dtd.core.internal.Attribute"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.CommentSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.CommentSection">
- <input type="org.eclipse.wst.dtd.core.internal.Comment"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection">
- <input type="org.eclipse.wst.dtd.core.internal.CMGroupNode"/>
- </propertySection>
-
- <propertySection
- class="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection"
- filter="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameFilter"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection"
- enablesFor="1"
- tab="org.eclipse.wst.dtd.ui.general">
- <input type="org.eclipse.wst.dtd.core.internal.CMBasicNode"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.other"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection">
- <input type="org.eclipse.wst.dtd.core.internal.CMBasicNode"/>
- <input type="org.eclipse.wst.dtd.core.internal.CMGroupNode"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.documentation"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.DocumentSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.DocumentSection">
- <input type="org.eclipse.wst.dtd.core.internal.Element"/>
- <input type="org.eclipse.wst.dtd.core.internal.Entity"/>
- <input type="org.eclipse.wst.dtd.core.internal.AttributeList"/>
- <input type="org.eclipse.wst.dtd.core.internal.Notation"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.EmptySection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.EmptySection">
- <input type="org.eclipse.wst.dtd.core.internal.ParameterEntityReference"/>
- <input type="org.eclipse.wst.sse.core.internal.provisional.IndexedRegion"/>
- </propertySection>
-
- <!--
- <propertySection tab="org.eclipse.wst.dtd.ui.other"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection">
- <input type="org.eclipse.wst.dtd.core.internal.Entity"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.attributes"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection">
- <input type="org.eclipse.wst.dtd.core.internal.Entity"/>
- </propertySection>
- -->
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection">
- <input type="org.eclipse.wst.dtd.core.internal.DTDFile"/>
- <input type="org.eclipse.wst.dtd.core.internal.Entity"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.general"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.NotationSection"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.NotationSection">
- <input type="org.eclipse.wst.dtd.core.internal.Notation"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.attributes"
- enablesFor="1"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection"
- filter="org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceFilter"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection">
- <input type="org.eclipse.wst.dtd.core.internal.CMBasicNode"/>
- <input type="org.eclipse.wst.dtd.core.internal.CMRepeatableNode"/>
- </propertySection>
-
- <propertySection tab="org.eclipse.wst.dtd.ui.attributes"
- class="org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection"
- enablesFor="1"
- id="org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection">
- <input type="org.eclipse.wst.dtd.core.internal.Attribute"/>
- </propertySection>
- </propertySections>
-</extension>
-
- <!-- Define theme -->
- <extension
- point="org.eclipse.ui.themes">
- <theme
- id="org.eclipse.ui.ide.systemDefault">
- <colorOverride
- id="dtdDefault"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdTag"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdTagName"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdComment"
- value="COLOR_LIST_SELECTION">
- </colorOverride>
- <colorOverride
- id="dtdKeyword"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdString"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdData"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="dtdSymbol"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- </theme>
- <colorDefinition
- id="dtdDefault"
- isEditable="false"
- label="%Colors.dtdDefault"
- value="0, 0, 0">
- </colorDefinition>
- <colorDefinition
- id="dtdTag"
- isEditable="false"
- label="%Colors.dtdTag"
- value="63, 63, 191">
- </colorDefinition>
- <colorDefinition
- id="dtdTagName"
- isEditable="false"
- label="%Colors.dtdTagName"
- value="63, 63, 191">
- </colorDefinition>
- <colorDefinition
- id="dtdComment"
- isEditable="false"
- label="%Colors.dtdComment"
- value="127, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="dtdKeyword"
- isEditable="false"
- label="%Colors.dtdKeyword"
- value="128, 0, 0">
- </colorDefinition>
- <colorDefinition
- id="dtdString"
- isEditable="false"
- label="%Colors.dtdString"
- value="63, 159, 95">
- </colorDefinition>
- <colorDefinition
- id="dtdData"
- isEditable="false"
- label="%Colors.dtdData"
- value="191, 95, 95">
- </colorDefinition>
- <colorDefinition
- id="dtdSymbol"
- isEditable="false"
- label="%Colors.dtdSymbol"
- value="128, 0, 0">
- </colorDefinition>
- </extension>
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="toolbar:org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="icons/full/etool16/newdtd_wiz.gif"
- id="org.eclipse.wst.dtd.ui.newDTDFile"
- style="push"
- tooltip="%DTD_New_File.tooltip">
- <parameter name="newWizardId" value="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"/>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard type="new" wizardId="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
- <enablement>
- <instanceof value="org.eclipse.core.resources.IResource"/>
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </enablement>
- </commonWizard>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
deleted file mode 100644
index 41a770701d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.dtd.ui.internal;
-
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceNames;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * A DTD Editor subclass StructuredTextEditor, required to supply a complete
- * replacement for the property sheet page. When a better solution is found,
- * this class will be removed.
- */
-public class DTDEditor extends StructuredTextEditor {
- class DTDPropertySheetPageContributor implements ITabbedPropertySheetPageContributor {
- DTDPropertySheetPageContributor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
- */
- public String getContributorId() {
- return getEditorSite().getId();
- }
- }
-
- TabbedPropertySheetPage fPropertySheetPage;
-
- public DTDEditor() {
- super();
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class required) {
- if (IPropertySheetPage.class.equals(required)) {
- if (fPropertySheetPage == null) {
- fPropertySheetPage = new DTDTabbedPropertySheetPage(new DTDPropertySheetPageContributor());
- /*
- * Add the property sheet page as a direct post selection
- * listener so standard cursor navigation triggers a selection
- * notification. The default tabbed property sheet does not
- * listen to post selection.
- */
- ((IPostSelectionProvider) getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (fPropertySheetPage != null && !fPropertySheetPage.getControl().isDisposed()) {
- fPropertySheetPage.selectionChanged(DTDEditor.this, getSelectionProvider().getSelection());
- }
- }
- });
- }
- return fPropertySheetPage;
- }
- return super.getAdapter(required);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
- super.init(site, editorInput);
-
- if (DTDUIPlugin.getDefault().getPreferenceStore().getBoolean(DTDUIPreferenceNames.ACTIVATE_PROPERTIES)) {
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = dw.getActivePage();
- try {
- if (page != null) {
- page.showView(IPageLayout.ID_PROP_SHEET);
- }
- }
- catch (PartInitException e) {
- Logger.logException(e);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
deleted file mode 100644
index 1a7dff71ac..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
+++ /dev/null
@@ -1,101 +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.dtd.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DTDPropertiesMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages"; //$NON-NLS-1$
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
- public static String _UI_ONCE;
- public static String _UI_ONE_OR_MORE;
- public static String _UI_OPTIONAL;
- public static String _UI_ZERO_OR_MORE;
- public static String _UI_LABEL_OCCURRENCE;
- // org.eclipse.wst.dtd.ui.internal.properties.section.AttribueDefaultSection.java
- public static String _UI_DEFAULT;
- public static String _UI_LABEL_USAGE;
- public static String _UI_LABEL_DEFAULT_VALUE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
- public static String _UI_SEQUENCE;
- public static String _UI_CHOICE;
- public static String _UI_LABEL_MODEL_GROUP;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
- public static String _UI_LABEL_CONTENT_MODEL;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
- public static String _UI_LABEL_CONTENT_TYPE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
- public static String _UI_LABEL_NAME;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
- public static String _UI_LABEL_TYPE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
- public static String _UI_LABEL_ENTITY_TYPE;
- public static String _UI_LABEL_EXTERNAL_ENTITY;
- public static String _UI_LABEL_PARAMETER_ENTITY;
- public static String _UI_LABEL_GENERAL_ENTITY;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
- public static String _UI_LABEL_ENTITY_VALUE;
- public static String _UI_LABEL_PUBLIC_ID;
- public static String _UI_LABEL_SYSTEM_ID;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
- public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
- public static String _UI_FILEDIALOG_SELECT_DTD;
- public static String _UI_FILEDIALOG_SELECT_DTD_DESC;
-
- // New property tabs
- public static String DTDSectionLabelProvider_0;
- public static String DTDSectionLabelProvider_1;
- public static String DTDSectionLabelProvider_10;
- public static String DTDSectionLabelProvider_11;
- public static String DTDSectionLabelProvider_6;
- public static String DTDSectionLabelProvider_7;
- public static String DTDSectionLabelProvider_8;
- public static String DTDSectionLabelProvider_9;
-
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DTDPropertiesMessages.class);
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- private DTDPropertiesMessages() {
- super();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
deleted file mode 100644
index 180253a1f0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
+++ /dev/null
@@ -1,70 +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
-###############################################################################
-! Properties file for component: XML tools DTD Editor
-! Packaged for translation in: xml.zip
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
-_UI_ONCE = Just once (1)
-_UI_ONE_OR_MORE = One or more (+)
-_UI_OPTIONAL = Optional (?)
-_UI_ZERO_OR_MORE = Zero or more (*)
-_UI_LABEL_OCCURRENCE = Occurrence
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.AttributeDefaultSection.java
-_UI_DEFAULT = Default
-_UI_LABEL_USAGE = Usage
-_UI_LABEL_DEFAULT_VALUE = Default Value
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
-_UI_SEQUENCE = Sequence (,)
-_UI_CHOICE = Choice (|)
-_UI_LABEL_MODEL_GROUP = Model Group
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
-_UI_LABEL_CONTENT_MODEL = Content Model
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
-_UI_LABEL_CONTENT_TYPE = Content Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
-_UI_LABEL_NAME = Name
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
-_UI_LABEL_TYPE = Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
-_UI_LABEL_ENTITY_TYPE = Entity Type
-_UI_LABEL_EXTERNAL_ENTITY = External
-_UI_LABEL_PARAMETER_ENTITY = Parameter
-_UI_LABEL_GENERAL_ENTITY = General
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
-_UI_LABEL_ENTITY_VALUE = Entity Value
-_UI_LABEL_PUBLIC_ID = Public ID
-_UI_LABEL_SYSTEM_ID = System ID
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
-_UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF = element reference
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
-_UI_FILEDIALOG_SELECT_DTD = Select DTD file
-_UI_FILEDIALOG_SELECT_DTD_DESC = Select a DTD file from the Workbench projects
-
-! New property tabs
-! end
-DTDSectionLabelProvider_0=choice
-DTDSectionLabelProvider_1=sequence
-DTDSectionLabelProvider_6=element
-DTDSectionLabelProvider_7=attribute
-DTDSectionLabelProvider_8=attribute list
-DTDSectionLabelProvider_9=comment
-DTDSectionLabelProvider_10=entity
-DTDSectionLabelProvider_11=notation
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java
deleted file mode 100644
index 10ca85e64c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,49 +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.dtd.ui.internal;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-class DTDTabbedPropertySheetPage extends TabbedPropertySheetPage {
-
- private ISelection oldSelection = null;
-
- public DTDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) {
- super(tabbedPropertySheetPageContributor);
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
- if (workbenchWindow != null) {
- IWorkbenchPage activePage = workbenchWindow.getActivePage();
- if (activePage != null) {
- IEditorPart activeEditor = activePage.getActiveEditor();
- if (activeEditor != null) {
- // make sure the correct editor is active
- if (activeEditor.getAdapter(IPropertySheetPage.class) == DTDTabbedPropertySheetPage.this) {
- if (oldSelection == null || !oldSelection.equals(selection)) {
- oldSelection = selection;
- super.selectionChanged(part, selection);
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
deleted file mode 100644
index 26747413e9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
+++ /dev/null
@@ -1,334 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.w3c.dom.Element;
-
-public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener {
- private TabbedPropertySheetWidgetFactory factory;
- protected IWorkbenchPart fWorkbenchPart;
- protected ISelection fSelection;
- protected Object fInput;
- protected int rightMarginSpace;
-
- public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
- createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory) {
- this.factory = aFactory;
- GC gc = new GC(parent);
- Point extent = gc.textExtent(" ... "); //$NON-NLS-1$
- rightMarginSpace = extent.x;
- gc.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection sel) {
- Assert.isTrue(sel instanceof IStructuredSelection, "selection " + sel.getClass() + "is not structured"); //$NON-NLS-1$ //$NON-NLS-2$
- this.fWorkbenchPart = part;
- this.fSelection = sel;
- this.fInput = ((IStructuredSelection) fSelection).getFirstElement();
- /*
- * if (fInput instanceof XSDConcreteComponent) { xsdSchema =
- * ((XSDConcreteComponent)fInput).getSchema(); }
- */
-
- // refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
- */
- public void aboutToBeShown() {
- refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
- */
- public void aboutToBeHidden() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
- */
- public void dispose() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
- */
- public int getMinimumHeight() {
- return SWT.DEFAULT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
- */
- public void refresh() {
- // TODO Auto-generated method stub
- }
-
- public Object getInput() {
- if (fInput instanceof Element) {
- // fInput = xsdSchema.getCorrespondingComponent((Element)fInput);
- }
- return fInput;
- }
-
- /**
- * Get the widget factory.
- *
- * @return the widget factory.
- */
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return factory;
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- refresh();
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e) {
- }
-
- public void doWidgetSelected(SelectionEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
- isInDoHandle = true;
- doWidgetDefaultSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
- isInDoHandle = true;
- doWidgetSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- boolean listenerEnabled = true;
-
- /**
- * Get the value of listenerEnabled.
- *
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled() {
- return listenerEnabled;
- }
-
- /**
- * Set the value of listenerEnabled.
- *
- * @param v
- * Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v) {
- this.listenerEnabled = v;
- }
-
- public void handleEvent(Event event) {
- if (isListenerEnabled() && !isInDoHandle) {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- } // end of if ()
- }
-
- public void doHandleEvent(Event event) {
-
- }
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(Event e) {
- if (delayedTask == null || delayedTask.getEvent() == null) {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- else {
- Event delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget && e.type == delayedEvent.type) {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable {
- protected Event event;
-
- /*
- * @see Runnable#run()
- */
- public void run() {
- if (event != null) {
- isInDoHandle = true;
- doHandleEvent(event);
- isInDoHandle = false;
- event = null;
- }
- }
-
- /**
- * Gets the event.
- *
- * @return Returns a Event
- */
- public Event getEvent() {
- return event;
- }
-
- /**
- * Sets the event.
- *
- * @param event
- * The event to set
- */
- public void setEvent(Event e) {
- this.event = e;
- }
-
- }
-
- boolean isInDoHandle;
-
- /**
- * Get the value of isInDoHandle.
- *
- * @return value of isInDoHandle.
- */
- public boolean isInDoHandle() {
- return isInDoHandle;
- }
-
- static protected IEditorPart getActiveEditor() {
- IWorkbench workbench = DTDUIPlugin.getDefault().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
- return editorPart;
- }
-
- static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart) {
- IStatusLineManager result = null;
- try {
- EditorActionBarContributor contributor = (EditorActionBarContributor) editorPart.getEditorSite().getActionBarContributor();
- result = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e) {
- }
- return result;
- }
-
- DocumentImpl getDocument(Element element) {
- return (DocumentImpl) element.getOwnerDocument();
- }
-
- public void beginRecording(String description, Element element) {
- DocumentImpl doc = getDocument(element);
- doc.getModel().beginRecording(this, description);
- }
-
- public void endRecording(Element element) {
- DocumentImpl doc = getDocument(element);
-
- doc.getModel().endRecording(this);
- }
-
- protected boolean validateName(String name) {
- return true;
- }
-
- protected boolean validateLanguage(String lang) {
- return true;
- }
-
- protected boolean validatePrefix(String prefix) {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
deleted file mode 100644
index 224b1856f8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
+++ /dev/null
@@ -1,152 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class AttributeDefaultSection extends AbstractSection {
-
- private final String IMPLIED = Attribute.IMPLIED;
- private final String REQUIRED = Attribute.REQUIRED;
- private final String FIXED = Attribute.FIXED;
-
- private CCombo usageCombo;
- private String[] usageComboValues = {IMPLIED, REQUIRED, FIXED, DTDPropertiesMessages._UI_DEFAULT};
- private Text defaultValueText;
- private CLabel defaultValueLabel;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel usageLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_USAGE);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- usageLabel.setLayoutData(data);
-
- usageCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(usageLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(usageLabel, 0, SWT.CENTER);
- usageCombo.setLayoutData(data);
- usageCombo.addSelectionListener(this);
- usageCombo.setItems(usageComboValues);
-
- // Create label first then attach other control to it
- defaultValueLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_DEFAULT_VALUE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = defaultValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(usageLabel, +ITabbedPropertyConstants.VSPACE);
- defaultValueLabel.setLayoutData(data);
-
- defaultValueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(defaultValueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(defaultValueLabel, 0, SWT.CENTER);
- defaultValueText.setLayoutData(data);
- defaultValueText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input != null) {
- if (input instanceof Attribute) {
- String kind = ((Attribute) input).getDefaultKind();
- if ("".equals(kind)) //$NON-NLS-1$
- usageCombo.setText(DTDPropertiesMessages._UI_DEFAULT);
- else
- usageCombo.setText(kind);
-
- if ("".equals(kind) || FIXED.equals(kind)) { //$NON-NLS-1$
- defaultValueLabel.setVisible(true);
- defaultValueText.setVisible(true);
- defaultValueText.setEnabled(true);
- defaultValueText.setText(((Attribute) input).getDefaultValue());
- }
- else {
- defaultValueText.setText(""); //$NON-NLS-1$
- defaultValueLabel.setVisible(false);
- defaultValueText.setVisible(false);
- defaultValueText.setEnabled(false);
- }
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == usageCombo) {
- Object input = getInput();
- if (input instanceof Attribute) {
- String usage = usageCombo.getText();
- Attribute attribute = (Attribute) input;
- if (usage.equals(DTDPropertiesMessages._UI_DEFAULT))
- attribute.setDefaultKind(""); //$NON-NLS-1$
- else
- attribute.setDefaultKind(usage);
-
- if (DTDPropertiesMessages._UI_DEFAULT.equals(usage) || FIXED.equals(usage)) {
- defaultValueLabel.setVisible(true);
- defaultValueText.setVisible(true);
- defaultValueText.setEnabled(true);
- }
- else {
- defaultValueLabel.setVisible(false);
- defaultValueText.setVisible(false);
- defaultValueText.setEnabled(false);
- }
- }
- }
- }
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input instanceof Attribute) {
- if (event.widget == defaultValueText) {
- String newValue = defaultValueText.getText();
- ((Attribute) input).setDefaultValue(newValue, usageCombo.getText().equals(FIXED));
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
deleted file mode 100644
index 1c9f2dff2a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
+++ /dev/null
@@ -1,76 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-
-public class CommentSection extends AbstractSection {
- private Text commentText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
-
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE); //$NON-NLS-1$
- commentText.addListener(SWT.Modify, CommentSection.this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- commentText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- commentText.setEnabled(true);
- Object input = getInput();
- commentText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof Comment)
- commentText.setText(((Comment) input).getText());
- }
- setListenerEnabled(true);
- }
-
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input != null) {
- String newValue = commentText.getText();
- if (newValue.length() > 0 && input instanceof Comment) {
- Comment comment = (Comment) input;
- comment.setText(newValue);
- }
- }
-
- }
-
- public boolean shouldUseExtraSpace() {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
deleted file mode 100644
index 575185a093..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
+++ /dev/null
@@ -1,95 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelGroupSection extends AbstractSection {
- private final String SEQUENCE = DTDPropertiesMessages._UI_SEQUENCE;
- private final String CHOICE = DTDPropertiesMessages._UI_CHOICE;
- private final String MODEL_GROUP = DTDPropertiesMessages._UI_LABEL_MODEL_GROUP;
-
- private CCombo modelGroupCombo;
- private String[] modelGroupComboValues = {SEQUENCE, CHOICE};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, MODEL_GROUP);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- modelGroupCombo.setLayoutData(data);
- modelGroupCombo.addSelectionListener(this);
- modelGroupCombo.setItems(modelGroupComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input != null) {
- if (input instanceof CMGroupNode) {
- CMGroupNode node = (CMGroupNode) input;
- char modelType = node.getConnector();
- if (CMGroupNode.CHOICE == modelType)
- modelGroupCombo.setText(CHOICE);
- else if (CMGroupNode.SEQUENCE == modelType)
- modelGroupCombo.setText(SEQUENCE);
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == modelGroupCombo) {
- Object input = getInput();
- if (input instanceof CMGroupNode) {
- CMGroupNode node = (CMGroupNode) input;
- if (CHOICE.equals(modelGroupCombo.getText()))
- node.setConnector(CMGroupNode.CHOICE);
- else if (SEQUENCE.equals(modelGroupCombo.getText()))
- node.setConnector(CMGroupNode.SEQUENCE);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java
deleted file mode 100644
index 7150bff71c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java
+++ /dev/null
@@ -1,21 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-
-public class ContentModelNameFilter implements IFilter {
- public boolean select(Object toTest) {
- return toTest instanceof CMBasicNode && !((CMBasicNode) toTest).isRootElementContent();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
deleted file mode 100644
index dfb1ecf3ef..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
+++ /dev/null
@@ -1,110 +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.wst.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelNameSection extends AbstractSection {
- private final String CONTENT_MODEL = DTDPropertiesMessages._UI_LABEL_CONTENT_MODEL;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {CMNode.PCDATA};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_MODEL);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT | SWT.READ_ONLY);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof CMBasicNode) {
- typeCombo.removeAll();
- typeCombo.add(CMNode.PCDATA);
- // NodeList list =
- // ((CMBasicNode)fInput).getDTDFile().getElementsAndParameterEntityReferences();
- Iterator iterator = ((CMBasicNode) input).getDTDFile().getNodes().iterator();
- boolean isForRootContent = ((CMBasicNode) input).isRootElementContent();
- while (iterator.hasNext()) {
- DTDNode node = (DTDNode) iterator.next();
- if (!isForRootContent && node instanceof Element)
- typeCombo.add(node.getName());
- if (node instanceof Entity && ((Entity) node).isParameterEntity())
- typeCombo.add("%" + node.getName() + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- typeCombo.setText(((CMBasicNode) input).getName());
- }
- }
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof CMBasicNode) {
- CMBasicNode node = (CMBasicNode) input;
- String selected = typeCombo.getText();
- // if (CMNode.PCDATA.equals(selected))
- node.setName(selected);
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java
deleted file mode 100644
index 3fdac83095..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java
+++ /dev/null
@@ -1,26 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-
-public class ContentModelTypeFilter implements IFilter {
- public boolean select(Object toTest) {
- if (toTest instanceof CMBasicNode && !((CMBasicNode) toTest).isRootElementContent())
- return true;
- if (toTest instanceof CMGroupNode && ((CMGroupNode) toTest).isRootElementContent())
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
deleted file mode 100644
index e64a895e02..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
+++ /dev/null
@@ -1,123 +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.wst.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelTypeSection extends AbstractSection {
- private final String CONTENT_TYPE = DTDPropertiesMessages._UI_LABEL_CONTENT_TYPE;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {CMNode.ANY, CMNode.EMPTY, CMNode.PCDATA, CMNode.CHILDREN, CMNode.MIXED};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof CMNode) {
- typeCombo.removeAll();
- typeCombo.add(CMNode.ANY);
- typeCombo.add(CMNode.EMPTY);
- typeCombo.add(CMNode.PCDATA);
- typeCombo.add(CMNode.CHILDREN);
- typeCombo.add(CMNode.MIXED);
-
- Iterator iterator = ((CMNode) input).getDTDFile().getNodes().iterator();
- String nodeName = null;
- while (iterator.hasNext()) {
- DTDNode node = (DTDNode) iterator.next();
- nodeName = node.getName();
- if (node instanceof Element && typeCombo.indexOf(nodeName) == -1)
- typeCombo.add(nodeName);
- else if (node instanceof Entity && ((Entity) node).isParameterEntity() && typeCombo.indexOf(nodeName) == -1)
- typeCombo.add("%" + nodeName + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (input instanceof CMGroupNode)
- typeCombo.setText(((CMGroupNode) input).getType());
- else if (input instanceof CMBasicNode)
- typeCombo.setText(((CMBasicNode) input).getType());
- }
- } // end if (fInput != null)
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof CMGroupNode || input instanceof CMBasicNode) {
- CMNode node = (CMNode) input;
- String selected = typeCombo.getText();
- if (CMNode.MIXED.equals(selected))
- node.setMixedContent();
- else if (CMNode.CHILDREN.equals(selected))
- node.setChildrenContent(""); //$NON-NLS-1$
- else if (CMNode.EMPTY.equals(selected) || CMNode.ANY.equals(selected) || CMNode.PCDATA.equals(selected))
- node.setContent(selected);
- else
- node.setChildrenContent(selected);
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
deleted file mode 100644
index c8ac9842ed..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-public class DTDSectionLabelProvider extends LabelProvider {
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
-
- Image result = null;
-
- Object selected = object;
- if (object instanceof IStructuredSelection) {
- selected = ((IStructuredSelection) object).getFirstElement();
- }
- if (selected instanceof DTDFile) {
- return null; // ((DTDFile) selected).getImage();
- }
- else if (selected instanceof DTDNode) {
- if (selected instanceof ParameterEntityReference)
- return null;
- final String imgPath = ((DTDNode) selected).getImagePath();
- return imgPath != null ? DTDUIPlugin.getDefault().getImage(imgPath) : null;
- }
- else if (selected instanceof org.w3c.dom.Element) {
- return null;
- }
- return result;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
-
- Object selected = object;
- if (object instanceof IStructuredSelection) {
- selected = ((IStructuredSelection) object).getFirstElement();
- }
-
- if (selected instanceof DTDFile) {
- return ((DTDFile) selected).getName();
- }
- else if (selected instanceof CMBasicNode) {
- if (((CMBasicNode) selected).isReference())
- return DTDPropertiesMessages._UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
- else
- return ((CMBasicNode) selected).getName();
- }
- else if (selected instanceof CMRepeatableNode) {
- CMRepeatableNode node = (CMRepeatableNode) selected;
- String name = node.getName();
- if (node instanceof CMGroupNode) {
- if (((CMGroupNode) node).getConnector() == CMGroupNode.CHOICE)
- name = DTDPropertiesMessages.DTDSectionLabelProvider_0;
- else
- name = DTDPropertiesMessages.DTDSectionLabelProvider_1;
- }
- char occurrence = node.getOccurrence();
- switch (occurrence) {
- case CMRepeatableNode.ONCE :
- name += " [1..1]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.OPTIONAL :
- name += " [0..1]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.ONE_OR_MORE :
- name += " [1..*]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.ZERO_OR_MORE :
- name += " [0..*]"; //$NON-NLS-1$
- break;
- }
- return name;
- }
- else if (selected instanceof DTDNode) {
- if (selected instanceof Element)
- return DTDPropertiesMessages.DTDSectionLabelProvider_6;
- else if (selected instanceof Attribute)
- return DTDPropertiesMessages.DTDSectionLabelProvider_7;
- else if (selected instanceof AttributeList)
- return DTDPropertiesMessages.DTDSectionLabelProvider_8;
- else if (selected instanceof Comment)
- return DTDPropertiesMessages.DTDSectionLabelProvider_9;
- else if (selected instanceof Entity)
- return DTDPropertiesMessages.DTDSectionLabelProvider_10;
- else if (selected instanceof Notation)
- return DTDPropertiesMessages.DTDSectionLabelProvider_11;
- else if (selected instanceof ParameterEntityReference)
- // return "parameter entity reference";
- return null;
- else
- return ((DTDNode) selected).getName();
- }
- else if (selected instanceof org.w3c.dom.Element) {
- return ((org.w3c.dom.Element) selected).getLocalName();
- }
- else if (object instanceof ITextSelection) {
- return ""; //$NON-NLS-1$
- }
- else
- return object.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
deleted file mode 100644
index 59d97bcbb9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-
-/**
- * Extend the base wizard to select a file from the project or outside the
- * workbench and add error handling
- */
-class DTDSelectIncludeFileWizard extends Wizard implements INewWizard {
- DTDSelectSingleFilePage filePage;
-
- IFile resultFile;
-
- public DTDSelectIncludeFileWizard(String title, String desc, ViewerFilter filter, IStructuredSelection selection) {
- super();
- setWindowTitle(title);
- setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), DTDEditorPluginImages.IMG_WIZBAN_NEWDTDFILE));
-
- // Select File Page
- filePage = new DTDSelectSingleFilePage(PlatformUI.getWorkbench(), selection, true);
- filePage.setTitle(title);
- filePage.setDescription(desc);
- filePage.addFilter(filter);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- }
-
- public void addPages() {
- addPage(filePage);
- }
-
- public boolean canFinish() {
- return filePage.isPageComplete();
- }
-
- public boolean performFinish() {
- resultFile = filePage.getFile();
- return true;
- }
-
- public IFile getResultFile() {
- return resultFile;
- }
-
- /**
- * Select DTD File
- */
- class DTDSelectSingleFilePage extends SelectSingleFilePage {
- public DTDSelectSingleFilePage(IWorkbench w, IStructuredSelection selection, boolean isFileMandatory) {
- super(w, selection, isFileMandatory);
- }
-
- public boolean isPageComplete() {
- return super.isPageComplete();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java
deleted file mode 100644
index 04e35d8500..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java
+++ /dev/null
@@ -1,24 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.ui.views.properties.tabbed.ITypeMapper;
-
-public class DTDTypeMapper implements ITypeMapper {
- public DTDTypeMapper() {
- super();
- }
-
- public Class mapType(Object object) {
- return object.getClass();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
deleted file mode 100644
index 4f720eb49e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
+++ /dev/null
@@ -1,101 +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.dtd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-public class DocumentSection extends AbstractSection {
- private Text commentText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
-
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE); //$NON-NLS-1$
- commentText.addListener(SWT.Modify, this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- commentText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- commentText.setEnabled(true);
- Object input = getInput();
- commentText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof DTDNode) {
- Comment comment = getCommentNode((DTDNode) input);
- if (comment != null)
- commentText.setText(comment.getText());
- }
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input != null) {
- String newValue = commentText.getText();
- if (input instanceof DTDNode) {
- Comment comment = getCommentNode((DTDNode) input);
- if (comment != null)
- comment.setText(newValue);
- else {
- // Create a new comment node.
- ((DTDNode) input).getDTDFile().createComment((DTDNode) input, newValue, false);
- }
- }
- }
-
- }
-
- private Comment getCommentNode(DTDNode node) {
- Iterator iterator = node.getDTDFile().getNodes().iterator();
- DTDNode currentNode = null;
- DTDNode prevNode = null;
- while (iterator.hasNext()) {
- currentNode = (DTDNode) iterator.next();
- if (node == currentNode && prevNode != null && prevNode instanceof Comment)
- return (Comment) prevNode;
- else
- prevNode = currentNode;
- }
- return null;
- }
-
- public boolean shouldUseExtraSpace() {
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
deleted file mode 100644
index 78f42939ca..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
+++ /dev/null
@@ -1,50 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmptySection extends AbstractSection {
- public void doHandleEvent(Event event) {
- super.doHandleEvent(event);
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- super.refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- public int getMinimumHeight() {
- return 0;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
deleted file mode 100644
index 3f634baf4a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
+++ /dev/null
@@ -1,141 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class EntityTypeSection extends AbstractSection {
- private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
- private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
- private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
- private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {PARAMETER, GENERAL};
- private Button checkBox;
-
- public static boolean isExternalEntity = false;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, ENTITY_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
-
- checkBox = getWidgetFactory().createButton(composite, EXTERNAL_ENTITY, SWT.CHECK);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = checkBox.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(95, 0);
- data.top = new FormAttachment(cLabel, +ITabbedPropertyConstants.VSPACE);
- checkBox.setLayoutData(data);
- checkBox.addSelectionListener(this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- if (entity.isParameterEntity())
- typeCombo.setText(PARAMETER);
- else
- typeCombo.setText(GENERAL);
-
- if (entity.isExternalEntity()) {
- checkBox.setSelection(true);
- isExternalEntity = true;
- }
- else {
- checkBox.setSelection(false);
- isExternalEntity = false;
- }
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- String selected = typeCombo.getText();
- if (PARAMETER.equals(selected))
- node.setParameterEntity(true);
- else
- node.setParameterEntity(false);
- }
- }
- else if (e.widget == checkBox) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- boolean selected = checkBox.getSelection();
- if (selected) {
- node.setExternalEntity(true);
- isExternalEntity = true;
- }
- else {
- node.setExternalEntity(false);
- isExternalEntity = false;
- }
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
deleted file mode 100644
index abf35698d1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
+++ /dev/null
@@ -1,185 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class EntityValueSection extends AbstractSection {
- private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text valueText;
- private Text publicIdText;
- private Text systemIdText;
-
- private CLabel valueLabel;
- private CLabel publicIdLabel;
- private CLabel systemIdLabel;
-
- public void doHandleEvent(Event event) {
- if (event.widget == valueText) {
- Object input = getInput();
- String newValue = valueText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setValue(newValue);
- }
- }
- else if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setSystemID(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- valueLabel = getWidgetFactory().createCLabel(composite, VALUE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = valueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- valueLabel.setLayoutData(data);
-
- // Entity Value
- valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(valueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(valueLabel, 0, SWT.CENTER);
- valueText.setLayoutData(data);
- valueText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(valueLabel, +ITabbedPropertyConstants.VSPACE);
- publicIdLabel.setLayoutData(data);
-
- // Public ID
- publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // System ID
- systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (isExternalEntity()) {
- valueLabel.setVisible(false);
- valueText.setVisible(false);
- publicIdLabel.setVisible(true);
- publicIdText.setVisible(true);
- systemIdLabel.setVisible(true);
- systemIdText.setVisible(true);
-
- publicIdText.setText(""); //$NON-NLS-1$
- systemIdText.setText(""); //$NON-NLS-1$
- if (input != null && input instanceof Entity) {
- Entity entity = (Entity) input;
- publicIdText.setText((entity).getPublicID());
- systemIdText.setText((entity).getSystemID());
- }
- }
- else {
- valueLabel.setVisible(true);
- valueText.setVisible(true);
- publicIdLabel.setVisible(false);
- publicIdText.setVisible(false);
- systemIdLabel.setVisible(false);
- systemIdText.setVisible(false);
-
- valueText.setText(""); //$NON-NLS-1$
- if (input != null && input instanceof Entity)
- valueText.setText(((Entity) input).getValue());
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- private boolean isExternalEntity() {
- return EntityTypeSection.isExternalEntity;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
deleted file mode 100644
index 0014c6779f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
+++ /dev/null
@@ -1,96 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class NameSection extends AbstractSection {
- private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
- private Text nameText;
-
- public void doHandleEvent(Event event) {
- if (event.widget == nameText) {
- Object input = getInput();
- String newValue = nameText.getText();
- if (newValue.length() > 0 && input instanceof DTDNode) {
- DTDNode dtdNode = (DTDNode) input;
- dtdNode.setName(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, NAME);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- nameLabel.setLayoutData(data);
-
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(nameLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(nameLabel, 0, SWT.CENTER);
- nameText.setLayoutData(data);
- nameText.addListener(SWT.Modify, this);
-
- // listener.startListeningForEnter(nameText);
- // listener.startListeningTo(nameText);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- nameText.setEnabled(true);
- Object input = getInput();
- nameText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof DTDNode)
- nameText.setText(((DTDNode) input).getName());
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
deleted file mode 100644
index 64492227e7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
+++ /dev/null
@@ -1,376 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-public class NewEntitySection extends AbstractSection {
- private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
- private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
- private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
- private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
- private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
- private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text systemIdText;
- private Text publicIdText;
- private Text nameText;
- private Button wizardButton;
-
- private Text entityValueText;
- private Button checkBox;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {PARAMETER, GENERAL};
- private PageBook pageBook;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- createEntityCommonComposite(composite);
-
- pageBook = new PageBook(composite, SWT.FLAT);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, 0);
- data.bottom = new FormAttachment(100, 0);
- pageBook.setLayoutData(data);
-
- createExternalEntityComposite(pageBook);
- createInternalEntityComposite(pageBook);
-
- pageBook.showPage(externalEntityComposite);
- }
-
- private Composite entityCommonComposite;
-
- private Composite createEntityCommonComposite(Composite parent) {
- entityCommonComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- entityCommonComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel nameLabel = getWidgetFactory().createCLabel(entityCommonComposite, NAME); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- nameLabel.setLayoutData(data);
-
- nameText = getWidgetFactory().createText(entityCommonComposite, "", SWT.NONE); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(nameLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(nameLabel, 0, SWT.CENTER);
- nameText.setLayoutData(data);
- nameText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(entityCommonComposite, ENTITY_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(nameLabel, +ITabbedPropertyConstants.VSPACE);
- cLabel.setLayoutData(data);
-
- // Create Checkbox
- checkBox = getWidgetFactory().createButton(entityCommonComposite, EXTERNAL_ENTITY, SWT.CHECK); //$NON-NLS-1$
- data = new FormData();
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- checkBox.setLayoutData(data);
- checkBox.addSelectionListener(this);
-
- // Create CCombo
- typeCombo = getWidgetFactory().createCCombo(entityCommonComposite, SWT.FLAT | SWT.READ_ONLY);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE - 2);
- data.right = new FormAttachment(checkBox, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- typeCombo.setText(PARAMETER);
-
- return entityCommonComposite;
- }
-
- private Composite internalEntityComposite;
-
- private Composite createInternalEntityComposite(Composite parent) {
- internalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, -ITabbedPropertyConstants.VSPACE);
- internalEntityComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel entityValueLabel = getWidgetFactory().createCLabel(internalEntityComposite, VALUE); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = entityValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- entityValueLabel.setLayoutData(data);
-
- entityValueText = getWidgetFactory().createText(internalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(entityValueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityValueLabel, 0, SWT.CENTER);
- entityValueText.setLayoutData(data);
- entityValueText.setEditable(true);
- entityValueText.addListener(SWT.Modify, this);
-
- return internalEntityComposite;
- }
-
- private Composite externalEntityComposite;
-
- private Composite createExternalEntityComposite(Composite parent) {
- externalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, -ITabbedPropertyConstants.VSPACE);
- externalEntityComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel publicIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, PUBLIC_ID); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- publicIdLabel.setLayoutData(data);
-
- publicIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- publicIdText.setEditable(true);
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- // Create System ID Label
- CLabel systemIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, SYSTEM_ID); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // Create Wizard Button
- wizardButton = getWidgetFactory().createButton(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- wizardButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), "icons/browsebutton.gif").createImage()); //$NON-NLS-1$
- data = new FormData();
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- wizardButton.setLayoutData(data);
- wizardButton.addSelectionListener(this);
-
- // Create System ID Text
- systemIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- // systemIdText.setEditable(false);
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(wizardButton, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
-
- return externalEntityComposite;
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- String selected = typeCombo.getText();
- if (PARAMETER.equals(selected))
- node.setParameterEntity(true);
- else
- node.setParameterEntity(false);
- }
- }
- else if (e.widget == checkBox) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- boolean selected = checkBox.getSelection();
- if (selected) {
- node.setExternalEntity(true);
- pageBook.showPage(externalEntityComposite);
- }
- else {
- node.setExternalEntity(false);
- pageBook.showPage(internalEntityComposite);
- }
- }
- }
- else if (e.widget == wizardButton) {
- Shell shell = Display.getCurrent().getActiveShell();
- IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
- ViewerFilter filter = new ResourceFilter(new String[]{".dtd"}, new IFile[]{currentIFile}, null); //$NON-NLS-1$
-
- DTDSelectIncludeFileWizard fileSelectWizard = new DTDSelectIncludeFileWizard(DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD, DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD_DESC, filter, (IStructuredSelection) fSelection);
-
- WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
- wizardDialog.create();
- wizardDialog.setBlockOnOpen(true);
- int result = wizardDialog.open();
- if (result == Window.OK) {
- String value = systemIdText.getText();
- IFile selectedIFile = fileSelectWizard.getResultFile();
- String dtdFileString = value;
- if (selectedIFile != null) {
- dtdFileString = URIHelper.getRelativeURI(selectedIFile.getFullPath(), currentIFile.getFullPath());
- }
- systemIdText.setText(dtdFileString);
- }
- }
-
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- nameText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- nameText.setText(entity.getName());
-
- if (entity.isParameterEntity())
- typeCombo.setText(PARAMETER);
- else
- typeCombo.setText(GENERAL);
-
- if (entity.isExternalEntity()) {
- checkBox.setSelection(true);
- pageBook.showPage(externalEntityComposite);
- publicIdText.setText(entity.getPublicID());
- systemIdText.setText(entity.getSystemID());
- }
- else {
- checkBox.setSelection(false);
- pageBook.showPage(internalEntityComposite);
- entityValueText.setText(entity.getValue());
- }
- }
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return true;
- }
-
- public void doHandleEvent(Event event) {
- if (event.widget == nameText) {
- Object input = getInput();
- String newValue = nameText.getText();
- if (newValue.length() > 0 && input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setName(newValue);
- }
- }
- else if (event.widget == entityValueText) {
- Object input = getInput();
- String newValue = entityValueText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setValue(newValue);
- }
- }
- else if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setSystemID(newValue);
- }
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
deleted file mode 100644
index 2e960e77fc..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
+++ /dev/null
@@ -1,131 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class NotationSection extends AbstractSection {
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text publicIdText;
- private Text systemIdText;
-
- private CLabel publicIdLabel;
- private CLabel systemIdLabel;
-
- public void doHandleEvent(Event event) {
- if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Notation) {
- Notation notation = (Notation) input;
- notation.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Notation) {
- Notation notation = (Notation) input;
- notation.setSystemID(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- publicIdLabel.setLayoutData(data);
-
- // Public ID
- publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // System ID
- systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- publicIdText.setText(""); //$NON-NLS-1$
- systemIdText.setText(""); //$NON-NLS-1$
-
- if (input != null && input instanceof Notation) {
- Notation notation = (Notation) input;
- publicIdText.setText((notation).getPublicID());
- systemIdText.setText((notation).getSystemID());
- }
-
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java
deleted file mode 100644
index eb57e01655..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java
+++ /dev/null
@@ -1,26 +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.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-
-public class OccurrenceFilter implements IFilter {
- public boolean select(Object toTest) {
- if (toTest instanceof CMBasicNode && ((CMBasicNode) toTest).isEmptyAnyOrPCData())
- return false;
- else if (toTest instanceof CMRepeatableNode)
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
deleted file mode 100644
index 90f5ffa5a5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
+++ /dev/null
@@ -1,105 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class OccurrenceSection extends AbstractSection {
- private final String ONCE = DTDPropertiesMessages._UI_ONCE;
- private final String ONE_OR_MORE = DTDPropertiesMessages._UI_ONE_OR_MORE;
- private final String OPTIONAL = DTDPropertiesMessages._UI_OPTIONAL;
- private final String ZERO_OR_MORE = DTDPropertiesMessages._UI_ZERO_OR_MORE;
- private final String OCCURENCE = DTDPropertiesMessages._UI_LABEL_OCCURRENCE;
-
- private CCombo occurrenceCombo;
- private String[] occurrenceComboValues = {ONCE, ONE_OR_MORE, OPTIONAL, ZERO_OR_MORE};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel usageLabel = getWidgetFactory().createCLabel(composite, OCCURENCE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- usageLabel.setLayoutData(data);
-
- occurrenceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(usageLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(usageLabel, 0, SWT.CENTER);
- occurrenceCombo.setLayoutData(data);
- occurrenceCombo.addSelectionListener(this);
- occurrenceCombo.setItems(occurrenceComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input instanceof CMRepeatableNode) {
- char occurence = ((CMRepeatableNode) input).getOccurrence();
- if (CMRepeatableNode.ONCE == occurence)
- occurrenceCombo.setText(ONCE);
- else if (CMRepeatableNode.ONE_OR_MORE == occurence)
- occurrenceCombo.setText(ONE_OR_MORE);
- else if (CMRepeatableNode.OPTIONAL == occurence)
- occurrenceCombo.setText(OPTIONAL);
- else if (CMRepeatableNode.ZERO_OR_MORE == occurence)
- occurrenceCombo.setText(ZERO_OR_MORE);
- else
- occurrenceCombo.setText(ONCE);
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- Object input = getInput();
- if (input instanceof CMRepeatableNode) {
- setListenerEnabled(false);
- CMRepeatableNode node = (CMRepeatableNode) input;
- String occurrence = occurrenceCombo.getText();
- if (ONCE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ONCE);
- else if (ONE_OR_MORE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ONE_OR_MORE);
- else if (OPTIONAL.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.OPTIONAL);
- else if (ZERO_OR_MORE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
- setListenerEnabled(true);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
deleted file mode 100644
index d18795c46a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
+++ /dev/null
@@ -1,92 +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.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class TypeSection extends AbstractSection {
- private final String TYPE = DTDPropertiesMessages._UI_LABEL_TYPE;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {Attribute.CDATA, Attribute.ID, Attribute.IDREF, Attribute.IDREFS, Attribute.ENTITY, Attribute.ENTITIES, Attribute.NMTOKEN, Attribute.NMTOKENS, Attribute.ENUMERATED_NAME, Attribute.ENUMERATED_NOTATION};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof Attribute)
- typeCombo.setText(((Attribute) input).getType());
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Attribute) {
- Attribute attribute = (Attribute) input;
- attribute.setType(typeCombo.getText());
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
deleted file mode 100644
index 80a5dd1f2d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
+++ /dev/null
@@ -1,70 +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.dtd.ui;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
-import org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTD;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-
-
-/**
- * Configuration for a source viewer which shows DTD 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 StructuredTextViewerConfigurationDTD 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[] fLineStyleProviders;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationDTD
- */
- public StructuredTextViewerConfigurationDTD() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- fConfiguredContentTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
- }
- return fConfiguredContentTypes;
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- if (fLineStyleProviders == null) {
- fLineStyleProviders = new LineStyleProvider[]{createLineStyleProviderForDTD()};
- }
- return fLineStyleProviders;
- }
-
- private LineStyleProvider createLineStyleProviderForDTD() {
- return new LineStyleProviderForDTD();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
deleted file mode 100644
index c07421038b..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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 - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD UI
- *
- * @plannedfor 1.0
- */
-public class DTDUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDUIPluginResources";//$NON-NLS-1$
-
- public static String _UI_ACTION_ADD_ATTRIBUTELIST;
- public static String _UI_ACTION_ADD_DTD_NOTATION;
- public static String _UI_ACTION_ADD_DTD_ENTITY;
- public static String _UI_ACTION_ADD_DTD_ELEMENT;
- public static String _UI_ACTION_ADD_DTD_COMMENT;
- public static String _UI_ACTION_DTD_DELETE;
- public static String _UI_ACTION_ADD_ATTRIBUTE;
- public static String _UI_ACTION_GROUP_ADD_GROUP;
- public static String _UI_ACTION_ADD_ELEMENT;
- public static String _UI_BUTTON_GROUP_ITEMS_LOGICALLY;
- public static String _UI_BUTTON_SORT_ITEMS;
- public static String _UI_ACTION_ADD_PARAM_ENTITY_REF;
- public static String _UI_MOVE_ATTRIBUTE;
- public static String _UI_MOVE_CONTENT;
- public static String _UI_MOVE_NODE;
- public static String _UI_MOVE_NODES;
- public static String _ERROR_FILENAME_MUST_END_DTD;
- public static String Creating_files;
- public static String DTDFilesPreferencePage_ExtensionLabel;
- public static String DTDFilesPreferencePage_ExtensionError;
- public static String DTDColorPage_0;
- public static String DTDColorPage_1;
- public static String DTDColorPage_2;
- public static String DTDColorPage_3;
- public static String DTDColorPage_4;
- public static String DTDColorPage_5;
- public static String DTDColorPage_6;
- public static String DTDColorPage_7;
- public static String DTDColorPage_8;
- public static String DTDPropertySourceAdapter_0;
- public static String DTDPropertySourceAdapter_1;
- public static String DTDPropertySourceAdapter_2;
- public static String SourceMenu_label;
- public static String _UI_CREATE_NEW_DTD_FILE;
- public static String _UI_WIZARD_NEW_DTD_TITLE;
- public static String _UI_WIZARD_NEW_DTD_EXPL;
- public static String _UI_LABEL_DTD_FILE_DELETE;
- public static String ResourceGroup_nameExists;
- public static String NewDTDTemplatesWizardPage_0;
- public static String NewDTDTemplatesWizardPage_1;
- public static String NewDTDTemplatesWizardPage_2;
- public static String NewDTDTemplatesWizardPage_3;
- public static String NewDTDTemplatesWizardPage_4;
- public static String NewDTDTemplatesWizardPage_5;
- public static String NewDTDTemplatesWizardPage_6;
- public static String NewDTDTemplatesWizardPage_7;
- 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 ShowProperties;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DTDUIMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java
deleted file mode 100644
index 0041cd7570..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java
+++ /dev/null
@@ -1,124 +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.dtd.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-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.dtd.ui.internal.preferences.DTDUIPreferenceNames;
-import org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeIdsDTD;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class DTDUIPlugin extends AbstractUIPlugin {
- // The shared instance.
- private static DTDUIPlugin plugin;
-
- /**
- * The template store for the dtd ui.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for dtd ui.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- /**
- * Returns the shared instance.
- */
- public static DTDUIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * The constructor.
- */
- public DTDUIPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the template store for the dtd editor templates.
- *
- * @return the template store for the dtd editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), DTDUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the dtd plugin.
- *
- * @return the template context type registry for the dtd plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsDTD.NEW);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-
- public Image getImage(String iconName) {
- ImageRegistry imageRegistry = getImageRegistry();
- Image image = imageRegistry.get(iconName);
-
- if (image == null) {
- String thisID = getDefault().getBundle().getSymbolicName();
- imageRegistry.put(iconName, imageDescriptorFromPlugin(thisID, iconName));
- image = imageRegistry.get(iconName);
- }
-
- return image;
- }
-
- public static Image getDTDImage(String iconName) {
- return getDefault().getImage(iconName);
- }
-
- public static ImageDescriptor getDTDImageDescriptor(String iconName) {
- String thisID = getDefault().getBundle().getSymbolicName();
- return AbstractUIPlugin.imageDescriptorFromPlugin(thisID, iconName);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
deleted file mode 100644
index 44a4572129..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
+++ /dev/null
@@ -1,91 +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
-###############################################################################
-
-_UI_ACTION_ADD_ATTRIBUTELIST=Add Attribute &List
-
-!DTDOutliner
-_UI_ACTION_ADD_DTD_NOTATION=Add &Notation
-_UI_ACTION_ADD_DTD_ENTITY=Add &Entity
-_UI_ACTION_ADD_DTD_ELEMENT=Add Ele&ment
-_UI_ACTION_ADD_DTD_COMMENT=Add &Comment
-_UI_ACTION_DTD_DELETE=&Delete
-_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
-_UI_ACTION_GROUP_ADD_GROUP=Add Group to Con&tent Model
-_UI_ACTION_ADD_ELEMENT=Add Element to C&ontent Model
-
-!DTDContentOutlinePage
-_UI_BUTTON_GROUP_ITEMS_LOGICALLY=Group items logically.
-_UI_BUTTON_SORT_ITEMS=Sort items alphabetically.
-
-!DTDContextContributer
-_UI_ACTION_ADD_PARAM_ENTITY_REF=Add &Parameter Entity Reference
-
-!DragAttributeCommand
-_UI_MOVE_ATTRIBUTE=Move Attribute
-
-!DragContentModelCommand
-_UI_MOVE_CONTENT=Move Content
-
-!DragTopLevelNodesCommand
-_UI_MOVE_NODE=Move Node
-_UI_MOVE_NODES=Move Nodes
-
-_ERROR_FILENAME_MUST_END_DTD=The file name must end in one of the following extensions {0}.
-
-#DTD File page
-Creating_files=Creating files
-DTDFilesPreferencePage_ExtensionLabel=Add this suffix (if not specified):
-DTDFilesPreferencePage_ExtensionError=Suffix must be one of the following {0}.
-
-#DTD Style page
-DTDColorPage_0=<!ELEMENT Main (One,Two+)>\r\n<!ELEMENT One (Three,Four)>\r\n<!ATTLIST One\r\n oneone CDATA #REQUIRED\r\n>\r\n<!-- You need this -->\r\n<!ELEMENT Two (moremore*)>\r\n<!ATTLIST Two\r\n twotwo CDATA #REQUIRED\r\n twothree (aaa | bbb) "aaa"\r\n>\r\n
-DTDColorPage_1=Comments
-DTDColorPage_2=Data
-DTDColorPage_3=Default
-DTDColorPage_4=Keywords
-DTDColorPage_5=Strings
-DTDColorPage_6=Symbols
-DTDColorPage_7=Tag Delimiters
-DTDColorPage_8=Tag Names
-DTDPropertySourceAdapter_0=Name
-DTDPropertySourceAdapter_1=Contents
-DTDPropertySourceAdapter_2=Attributes
-
-! NewDTDWizard.java
-_UI_CREATE_NEW_DTD_FILE = Create a new DTD file.
-_UI_WIZARD_NEW_DTD_TITLE = Create DTD
-_UI_WIZARD_NEW_DTD_EXPL = Create a new DTD file. Specify the folder and name for the file.
-
-# copied from dtd core
-_UI_LABEL_DTD_FILE_DELETE=Delete
-##
-ResourceGroup_nameExists = The same name already exists.
-NewDTDTemplatesWizardPage_0=Select DTD Template
-NewDTDTemplatesWizardPage_1=Select a template as initial content in the DTD page.
-NewDTDTemplatesWizardPage_2=Name
-NewDTDTemplatesWizardPage_3=Description
-NewDTDTemplatesWizardPage_4=&Use DTD Template
-NewDTDTemplatesWizardPage_5=&Preview:
-NewDTDTemplatesWizardPage_6=Templates are 'New DTD' templates found in the <a>DTD Templates</a> preference page.
-NewDTDTemplatesWizardPage_7=&Templates:
-
-SourceMenu_label=Source
-
-SyntaxColoringPage_0=S&yntax Element:
-SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=&Bold
-SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strikethrough
-SyntaxColoringPage_6=&Underline
-
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=DTD editor preferences. Note that some preferences may be set on the <a>{0}</a> preference page.
-
-ShowProperties=Automatically show the Properties view
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java
deleted file mode 100644
index d224ef26f2..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java
+++ /dev/null
@@ -1,143 +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.dtd.ui.internal;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.dtd.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- 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 (!isDebugging())
- return;
-
- 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)) {
- 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;
- }
- }
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java
deleted file mode 100644
index a95050d6a7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-
-public class DTDDragAndDropManager implements DragAndDropManager {
-
- public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
- if (target instanceof DTDNode) {
- DTDNode node = (DTDNode) target;
-
- if (node instanceof TopLevelNode) {
- return new DragTopLevelNodesCommand(target, location, operations, operation, source);
- }
- if (node instanceof Attribute) {
- return new DragAttributeCommand(target, location, operations, operation, source);
- }
- if (node instanceof CMNode) {
- return new DragContentModelCommand(target, location, operations, operation, source);
- }
-
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java
deleted file mode 100644
index 45511c1cf3..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java
+++ /dev/null
@@ -1,61 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-
-public class DragAttributeCommand extends DefaultDragAndDropCommand {
-
- public DragAttributeCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof Attribute)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
- DTDFile dtdFile = referenceNode.getDTDFile();
- if (referenceNode instanceof Attribute) {
- dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_ATTRIBUTE); //$NON-NLS-1$
- AttributeList attList = (AttributeList) referenceNode.getParentNode();
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof Attribute) {
- attList.insertIntoModel(this, (Attribute) referenceNode, (Attribute) node, isAfter());
- dtdFile.deleteNode(this, node);
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java
deleted file mode 100644
index 51cdb8735f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java
+++ /dev/null
@@ -1,113 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-public class DragContentModelCommand extends DefaultDragAndDropCommand {
-
- public DragContentModelCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- if (!(target instanceof CMNode)) {
- return false;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof CMNode)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
-
- if (referenceNode instanceof CMNode) {
- DTDFile dtdFile = referenceNode.getDTDFile();
-
- DTDNode parent = (DTDNode) referenceNode.getParentNode();
- dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_CONTENT); //$NON-NLS-1$
- boolean parentIsElement = false;
- Element element = null;
- CMGroupNode group = null;
- if (parent instanceof Element) {
- parentIsElement = true;
- element = (Element) parent;
- }
- else {
- group = (CMGroupNode) parent;
- }
-
- if (element == null && group == null) {
- // no parent to add to
- return;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof CMNode) {
- if (parentIsElement) {
- if (element.getContentModel() == node) {
- continue;
- }
- element.replaceContentModel(this, (CMNode) node);
- }
- else {
- if (referenceNode == node || (isAfter() && referenceNode.getNextSibling() == node) || (!isAfter() && node.getNextSibling() == referenceNode)) {
- continue;
- }
-
- group.insertIntoModel(this, (CMNode) referenceNode, (CMNode) node, isAfter());
-
- }
- DTDNode nodeParent = (DTDNode) node.getParentNode();
- nodeParent.delete(this, node);
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
- }
-
- public int getFeedback() {
- DTDNode referenceNode = (DTDNode) target;
- if (referenceNode instanceof CMNode) {
- CMNode cmNode = (CMNode) referenceNode;
- if (cmNode.isRootElementContent() && cmNode instanceof CMBasicNode) {
- return DND.FEEDBACK_SELECT;
- }
- }
-
- return super.getFeedback();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java
deleted file mode 100644
index 59b872eff9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java
+++ /dev/null
@@ -1,64 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-public class DragTopLevelNodesCommand extends DefaultDragAndDropCommand {
-
- static private final String moveNode = DTDUIMessages._UI_MOVE_NODE; //$NON-NLS-1$
- static private final String moveNodes = DTDUIMessages._UI_MOVE_NODES; //$NON-NLS-1$
-
- public DragTopLevelNodesCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- if (!(target instanceof TopLevelNode)) {
- return false;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof TopLevelNode)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
-
- DTDFile dtdFile = referenceNode.getDTDFile();
- dtdFile.getDTDModel().beginRecording(this, sources.size() > 1 ? moveNodes : moveNode);
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof TopLevelNode) {
- dtdFile.moveNode(this, referenceNode, node, isAfter());
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java
deleted file mode 100644
index a624936ea5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java
+++ /dev/null
@@ -1,77 +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.wst.dtd.ui.internal.editor;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-
-/**
- * XMLEditorActionContributor
- *
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- *
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorDTD extends ActionContributor {
- protected static final String[] EDITOR_IDS = {"org.eclipse.wst.dtd.core.dtdsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.edit.util.ActionContributor#getExtensionIDs()
- */
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
- protected void addToMenu(IMenuManager menu) {
- // edit commands
- IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(fCommandsSeparator);
- editMenu.add(fToggleInsertModeAction);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fExpandSelectionToMenu);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fMenuAdditionsGroupMarker);
- }
-
- // source commands
- String sourceMenuLabel = DTDUIMessages.SourceMenu_label;
- String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
- IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
- if (sourceMenu != null) {
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fShiftRight);
- sourceMenu.add(fShiftLeft);
- sourceMenu.add(fCommandsSeparator);
- }
- IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
- if (navigateMenu != null) {
- IMenuManager gotoGroup = navigateMenu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
- if (gotoGroup != null) {
- gotoGroup.add(fGotoMatchingBracketAction);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
deleted file mode 100644
index 70d949d4cb..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
+++ /dev/null
@@ -1,157 +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.dtd.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author amywu
- */
-public class DTDEditorPluginImageHelper {
- private static DTDEditorPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a DTDEditorPluginImageHelper
- */
- public synchronized static DTDEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new DTDEditorPluginImageHelper();
- return instance;
- }
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
- private final String PLUGINID = DTDUIPlugin.getDefault().getBundle().getSymbolicName();
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
- getImageRegistry().put(resource, image);
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java
deleted file mode 100644
index bb2befbabb..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java
+++ /dev/null
@@ -1,44 +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.dtd.ui.internal.editor;
-
-/**
- * Bundle of most images used by the DTD Source Editor plug-in.
- */
-public class DTDEditorPluginImages {
- public static final String IMG_CTOOL_ADD_ATTRIBUTE = "icons/full/ctool16/ADD_Attribute.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_ELEMENT = "icons/full/ctool16/ADD_Element.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/ctool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_GROUPTOCONMODEL = "icons/full/ctool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ATTRIBUTE = "icons/full/dtool16/ADD_Attribute.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ELEMENT = "icons/full/dtool16/ADD_Element.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/dtool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_GROUPTOCONMODEL = "icons/full/dtool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ATTRIBUTE = "icons/full/etool16/ADD_Attribute.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ELEMENT = "icons/full/etool16/ADD_Element.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ELEMENTTOCONMODEL = "icons/full/etool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_GROUPTOCONMODEL = "icons/full/etool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_ADD_COMMENT = "icons/full/obj16/ADD_Comment.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_ENTITY = "icons/full/obj16/ADD_Entity.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_ENTITY_REFERENCE = "icons/full/obj16/ADD_Entity_Reference.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_NOTATION = "icons/full/obj16/ADD_Notation.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ORGANIZE_DTD_LOGICALLY = "icons/full/obj16/organize_dtd_logically.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALIDATE = "icons/full/obj16/validate.gif"; //$NON-NLS-1$
-
- public static final String IMG_WIZBAN_NEWDTDFILE = "icons/full/wizban/newdtdfile_wiz.png"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index e0ce21090d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,43 +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.dtd.ui.internal.editor;
-
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-/**
- * Help context ids for the DTD Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
-
- // org.eclipse.wst.dtd.ui.
- public static final String PREFIX = DTDUIPlugin.getDefault().getBundle().getSymbolicName() + "."; //$NON-NLS-1$
- // DTD Files Preference page
- public static final String DTD_PREFWEBX_FILES_HELPID = PREFIX + "webx0020"; //$NON-NLS-1$
- // DTD Styles Preference page
- public static final String DTD_PREFWEBX_STYLES_HELPID = PREFIX + "webx0021"; //$NON-NLS-1$
- // DTD Template Preference page (no id for this yet)
- public static final String DTD_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0022"; //$NON-NLS-1$
-
- // // figured out on the fly
- // // DTD Source page editor
- // public static final String DTD_SOURCEVIEW_HELPID =
- // ContentTypeIdForDTD.ContentTypeID_DTD + "_source_HelpId"; //$NON-NLS-1$
-
- // DTD New File Wizard - Template Page
- public static final String DTD_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "dtdw0010"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
deleted file mode 100644
index ed1855d55d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-
-/**
- * @deprecated
- */
-public class DTDColorPage extends AbstractColorPage {
-
- protected Control createContents(Composite parent) {
- Composite pageComponent = createComposite(parent, 1);
- ((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
- super.createContents(pageComponent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.DTD_PREFWEBX_STYLES_HELPID);
-
- return pageComponent;
- }
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String) i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return DTDUIPlugin.getDefault().getPreferenceStore();
- }
-
- public String getSampleText() {
- return DTDUIMessages.DTDColorPage_0; //$NON-NLS-1$
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
- contextStyleMap.put(DTDRegionTypes.CONTENT_EMPTY, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.CONTENT_ANY, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.CONTENT_PCDATA, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.NDATA_VALUE, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.NAME, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.ENTITY_PARM, IStyleConstantsDTD.DTD_DATA);
-
- contextStyleMap.put(DTDRegionTypes.ELEMENT_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.ENTITY_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.ATTLIST_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.NOTATION_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-
- contextStyleMap.put(DTDRegionTypes.CONNECTOR, IStyleConstantsDTD.DTD_SYMBOL);
- contextStyleMap.put(DTDRegionTypes.OCCUR_TYPE, IStyleConstantsDTD.DTD_SYMBOL);
-
- contextStyleMap.put(DTDRegionTypes.START_TAG, IStyleConstantsDTD.DTD_TAG);
- contextStyleMap.put(DTDRegionTypes.END_TAG, IStyleConstantsDTD.DTD_TAG);
- contextStyleMap.put(DTDRegionTypes.EXCLAMATION, IStyleConstantsDTD.DTD_TAG);
-
- contextStyleMap.put(DTDRegionTypes.COMMENT_START, IStyleConstantsDTD.DTD_COMMENT);
- contextStyleMap.put(DTDRegionTypes.COMMENT_CONTENT, IStyleConstantsDTD.DTD_COMMENT);
- contextStyleMap.put(DTDRegionTypes.COMMENT_END, IStyleConstantsDTD.DTD_COMMENT);
-
- contextStyleMap.put(DTDRegionTypes.SINGLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
- contextStyleMap.put(DTDRegionTypes.DOUBLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
-
- contextStyleMap.put(DTDRegionTypes.SYSTEM_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.PUBLIC_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.CDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ID_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IDREF_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IDREFS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ENTITY_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ENTITIES_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NMTOKEN_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NMTOKENS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NOTATION_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.REQUIRED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IMPLIED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.FIXED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
- descriptions.put(IStyleConstantsDTD.DTD_COMMENT, DTDUIMessages.DTDColorPage_1); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_DATA, DTDUIMessages.DTDColorPage_2); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_DEFAULT, DTDUIMessages.DTDColorPage_3); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_KEYWORD, DTDUIMessages.DTDColorPage_4); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_STRING, DTDUIMessages.DTDColorPage_5); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_SYMBOL, DTDUIMessages.DTDColorPage_6); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_TAG, DTDUIMessages.DTDColorPage_7); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_TAGNAME, DTDUIMessages.DTDColorPage_8); //$NON-NLS-1$
- }
-
- protected void initStyleList(ArrayList list) {
- list.add(IStyleConstantsDTD.DTD_COMMENT);
- list.add(IStyleConstantsDTD.DTD_DATA);
- list.add(IStyleConstantsDTD.DTD_DEFAULT);
- list.add(IStyleConstantsDTD.DTD_KEYWORD);
- list.add(IStyleConstantsDTD.DTD_STRING);
- list.add(IStyleConstantsDTD.DTD_SYMBOL);
- list.add(IStyleConstantsDTD.DTD_TAG);
- list.add(IStyleConstantsDTD.DTD_TAGNAME);
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForDTD.ContentTypeID_DTD).getParser());
-
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- DTDUIPlugin.getDefault().savePluginPreferences();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java
deleted file mode 100644
index ac3eb60385..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDEditorPreferencePage.java
+++ /dev/null
@@ -1,76 +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.wst.dtd.ui.internal.preferences;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-public class DTDEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- public DTDEditorPreferencePage() {
- super();
- }
-
-
- public DTDEditorPreferencePage(int style) {
- super(style);
- }
-
-
- public DTDEditorPreferencePage(String title, ImageDescriptor image, int style) {
- super(title, image, style);
- }
-
-
- public DTDEditorPreferencePage(String title, int style) {
- super(title, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
- * ()
- */
- protected void createFieldEditors() {
- addField(new BooleanFieldEditor(DTDUIPreferenceNames.ACTIVATE_PROPERTIES, DTDUIMessages.ShowProperties, getFieldEditorParent()));
- }
-
- protected Control createContents(Composite parent) {
- setPreferenceStore(DTDUIPlugin.getDefault().getPreferenceStore());
- new PreferenceLinkArea(parent, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", DTDUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).grab(true, false).create());//$NON-NLS-1$
- new Label(parent, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
- return super.createContents(parent);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
deleted file mode 100644
index 8603cfb387..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-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.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceNames;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-
-
-public class DTDFilesPreferencePage extends AbstractPreferencePage {
- private Combo fDefaultSuffix = null;
- private List fValidExtensions = null;
-
- protected Control createContents(final Composite parent) {
- Composite composite = super.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.DTD_PREFWEBX_FILES_HELPID);
-
- Group creatingGroup = createGroup(composite, 2);
- creatingGroup.setText(DTDUIMessages.Creating_files);
-
- // Default extension for New file Wizard
- createLabel(creatingGroup, DTDUIMessages.DTDFilesPreferencePage_ExtensionLabel);
- fDefaultSuffix = createDropDownBox(creatingGroup);
- String[] validExtensions = (String[]) getValidExtensions().toArray(new String[0]);
- Arrays.sort(validExtensions);
- fDefaultSuffix.setItems(validExtensions);
- fDefaultSuffix.addSelectionListener(this);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- public void dispose() {
- fDefaultSuffix.removeModifyListener(this);
- super.dispose();
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return DTDUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- DTDCorePlugin.getInstance().savePluginPreferences(); // model
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
- }
-
- /**
- * Get list of valid extensions
- *
- * @return List
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return DTDCorePlugin.getInstance().getPluginPreferences();
- }
-
- protected void initializeValues() {
- String suffix = getModelPreferences().getString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
- fDefaultSuffix.setText(suffix);
- }
-
- protected void performDefaults() {
- String suffix = getModelPreferences().getDefaultString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
- fDefaultSuffix.setText(suffix);
-
- super.performDefaults();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- protected void storeValues() {
- String suffix = fDefaultSuffix.getText();
- getModelPreferences().setValue(DTDCorePreferenceNames.DEFAULT_EXTENSION, suffix);
- }
-
- protected void validateValues() {
- boolean isValid = false;
- Iterator i = getValidExtensions().iterator();
- while (i.hasNext() && !isValid) {
- String extension = (String) i.next();
- isValid = extension.equalsIgnoreCase(fDefaultSuffix.getText());
- }
-
- if (!isValid) {
- setErrorMessage(NLS.bind(DTDUIMessages.DTDFilesPreferencePage_ExtensionError, getValidExtensions().toString()));
- setValid(false);
- }
- else {
- setErrorMessage(null);
- setValid(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDSyntaxColoringPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDSyntaxColoringPage.java
deleted file mode 100644
index 6af8698f61..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDSyntaxColoringPage.java
+++ /dev/null
@@ -1,877 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.preferences;
-
-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.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.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.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-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.AbstractSyntaxColoringPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-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 DTDSyntaxColoringPage extends AbstractSyntaxColoringPage 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;
- private ISourceViewer fPreviewViewer;
-
- // 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);
- fBold.setEnabled(true);
- fItalic.setEnabled(true);
- fStrike.setEnabled(true);
- fUnderline.setEnabled(true);
- fForegroundLabel.setEnabled(true);
- fBackgroundLabel.setEnabled(true);
- fForegroundColorEditor.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.DTD_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, DTDUIMessages.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, DTDUIMessages.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);
- fForegroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Foreground_Color_Selector_Button;
- }
- });
-
-
- 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);
- fBackgroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Background_Color_Selector_Button;
- }
- });
-
-
- fBold = createCheckbox(editControls, DTDUIMessages.SyntaxColoringPage_3);
- fBold.setEnabled(false);
- ((GridData) fBold.getLayoutData()).horizontalSpan = 2;
- fItalic = createCheckbox(editControls, DTDUIMessages.SyntaxColoringPage_4);
- fItalic.setEnabled(false);
- ((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
- fStrike = createCheckbox(editControls, DTDUIMessages.SyntaxColoringPage_5);
- fStrike.setEnabled(false);
- ((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
- fUnderline = createCheckbox(editControls, DTDUIMessages.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:"
- fPreviewViewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = fPreviewViewer.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(ContentTypeIdForDTD.ContentTypeID_DTD);
- fDocument.set(getExampleText());
- initializeSourcePreviewColors(fPreviewViewer);
- fPreviewViewer.setDocument(fDocument);
-
- top.setWeights(new int[]{1, 1});
- editor.setWeights(new int[]{1, 1});
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.DTD_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;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSyntaxColoringPage#getSourcePreviewViewer()
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return fPreviewViewer;
- }
-
- 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 DTDUIPlugin.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 DTDUIMessages.DTDColorPage_0;
- }
-
- 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(IStyleConstantsDTD.DTD_COMMENT); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_DATA); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_DEFAULT); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_KEYWORD); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_STRING); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_SYMBOL); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_TAG); //$NON-NLS-1$
- styles.add(IStyleConstantsDTD.DTD_TAGNAME); //$NON-NLS-1$
- 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(DTDRegionTypes.CONTENT_EMPTY, IStyleConstantsDTD.DTD_DATA);
- fContextToStyleMap.put(DTDRegionTypes.CONTENT_ANY, IStyleConstantsDTD.DTD_DATA);
- fContextToStyleMap.put(DTDRegionTypes.CONTENT_PCDATA, IStyleConstantsDTD.DTD_DATA);
- fContextToStyleMap.put(DTDRegionTypes.NDATA_VALUE, IStyleConstantsDTD.DTD_DATA);
- fContextToStyleMap.put(DTDRegionTypes.NAME, IStyleConstantsDTD.DTD_DATA);
- fContextToStyleMap.put(DTDRegionTypes.ENTITY_PARM, IStyleConstantsDTD.DTD_DATA);
-
- fContextToStyleMap.put(DTDRegionTypes.ELEMENT_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- fContextToStyleMap.put(DTDRegionTypes.ENTITY_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- fContextToStyleMap.put(DTDRegionTypes.ATTLIST_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- fContextToStyleMap.put(DTDRegionTypes.NOTATION_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-
- fContextToStyleMap.put(DTDRegionTypes.CONNECTOR, IStyleConstantsDTD.DTD_SYMBOL);
- fContextToStyleMap.put(DTDRegionTypes.OCCUR_TYPE, IStyleConstantsDTD.DTD_SYMBOL);
-
- fContextToStyleMap.put(DTDRegionTypes.START_TAG, IStyleConstantsDTD.DTD_TAG);
- fContextToStyleMap.put(DTDRegionTypes.END_TAG, IStyleConstantsDTD.DTD_TAG);
- fContextToStyleMap.put(DTDRegionTypes.EXCLAMATION, IStyleConstantsDTD.DTD_TAG);
-
- fContextToStyleMap.put(DTDRegionTypes.COMMENT_START, IStyleConstantsDTD.DTD_COMMENT);
- fContextToStyleMap.put(DTDRegionTypes.COMMENT_CONTENT, IStyleConstantsDTD.DTD_COMMENT);
- fContextToStyleMap.put(DTDRegionTypes.COMMENT_END, IStyleConstantsDTD.DTD_COMMENT);
-
- fContextToStyleMap.put(DTDRegionTypes.SINGLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
- fContextToStyleMap.put(DTDRegionTypes.DOUBLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
-
- fContextToStyleMap.put(DTDRegionTypes.SYSTEM_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.PUBLIC_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.NDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.CDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.ID_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.IDREF_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.IDREFS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.ENTITY_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.ENTITIES_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.NMTOKEN_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.NMTOKENS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.NOTATION_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.REQUIRED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.IMPLIED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- fContextToStyleMap.put(DTDRegionTypes.FIXED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- }
-
- private void initStyleToDescriptionMap() {
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_COMMENT, DTDUIMessages.DTDColorPage_1); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_DATA, DTDUIMessages.DTDColorPage_2); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_DEFAULT, DTDUIMessages.DTDColorPage_3); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_KEYWORD, DTDUIMessages.DTDColorPage_4); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_STRING, DTDUIMessages.DTDColorPage_5); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_SYMBOL, DTDUIMessages.DTDColorPage_6); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_TAG, DTDUIMessages.DTDColorPage_7); //$NON-NLS-1$
- fStyleToDescriptionMap.put(IStyleConstantsDTD.DTD_TAGNAME, DTDUIMessages.DTDColorPage_8); //$NON-NLS-1$
- }
-
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- fText.redraw();
- }
-
- public boolean performOk() {
- getOverlayStore().propagate();
-
- DTDUIPlugin.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.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
deleted file mode 100644
index 29ffd779dd..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
+++ /dev/null
@@ -1,167 +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.wst.dtd.ui.internal.preferences;
-
-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.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.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-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 DTD templates
- */
-public class DTDTemplatePreferencePage extends TemplatePreferencePage {
-
- class DTDEditTemplateDialog extends EditTemplateDialog {
- public DTDEditTemplateDialog(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 StructuredTextViewerConfigurationDTD();
-
- 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 DTDTemplatePreferencePage() {
- DTDUIPlugin dtdUIPlugin = DTDUIPlugin.getDefault();
-
- setPreferenceStore(dtdUIPlugin.getPreferenceStore());
- setTemplateStore(dtdUIPlugin.getTemplateStore());
- setContextTypeRegistry(dtdUIPlugin.getTemplateContextRegistry());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- DTDUIPlugin.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.DTD_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 StructuredTextViewerConfigurationDTD();
-
- 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 = ContentTypeIdForDTD.ContentTypeID_DTD;
- viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- 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 DTDEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
- if (dialog.open() == Window.OK) {
- return dialog.getTemplate();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
deleted file mode 100644
index c80d99065f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.dtd.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.ui.PlatformUI;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-
-/**
- * Sets default values for DTD UI preferences
- */
-public class DTDUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = DTDUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- // DTD Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
- String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_DEFAULT, 0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_DEFAULT, styleValue); // black
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_TAG, 63, 63, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_TAG, styleValue); // blue
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_TAGNAME, 63, 63, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_TAGNAME, styleValue); // blue
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_COMMENT, 127, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_COMMENT, styleValue); // grey
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_KEYWORD, 128, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_KEYWORD, styleValue); // dark
- // red
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_STRING, 63, 159, 95) + JUSTITALIC;
- store.setDefault(IStyleConstantsDTD.DTD_STRING, styleValue); // green
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_DATA, 191, 95, 95) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_DATA, styleValue); // light
- // red
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_SYMBOL, 128, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsDTD.DTD_SYMBOL, styleValue); // dark
- // red
-
- // set default new xml 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 = DTDUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.dtd.ui.internal.templates.xmldeclaration"); //$NON-NLS-1$
- if (template != null)
- templateName = template.getName();
- store.setDefault(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-
- store.setDefault(DTDUIPreferenceNames.ACTIVATE_PROPERTIES, true);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java
deleted file mode 100644
index 64d5ec6494..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.dtd.ui.internal.preferences;
-
-/**
- * Preference keys for DTD UI
- */
-public class DTDUIPreferenceNames {
- private DTDUIPreferenceNames() {
- // cannot create instance
- }
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
-
- /**
- * The key to store the last template name used in new DTD 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$
-
- public static final String ACTIVATE_PROPERTIES = "activateProperties"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java
deleted file mode 100644
index adc0739a00..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.dtd.ui.internal.projection;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Unrecognized;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.xml.ui.internal.projection.XMLCommentFoldingPosition;
-import org.eclipse.wst.xml.ui.internal.projection.XMLElementFoldingPosition;
-
-
-/**
- * A folding strategy for DTD structured documents.
- * See AbstractStructuredFoldingStrategy for more details.
- *
- * This strategy is rather lame because the DTD parser does not
- * create regions for syntax such as <[ ]> so folding on it
- * can not currently occur.
- */
-public class DTDFoldingStrategy extends AbstractStructuredFoldingStrategy {
-
- /**
- * Create an instance of the folding strategy.
- * Be sure to set the viewer and document after creation.
- */
- public DTDFoldingStrategy() {
- super();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
- Position newPos = null;
-
- //only want to fold regions with a valid range
- if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
- IStructuredDocumentRegion structRegion = ((DTDNode) indexedRegion).getStructuredDTDDocumentRegion();
- //if Comment then use comment folding position
- //else use element folding position
- if(indexedRegion instanceof Comment) {
- newPos = new XMLCommentFoldingPosition(structRegion);
- } else {
- newPos = new XMLElementFoldingPosition(structRegion);
- }
- }
- return newPos;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
- //can only fold DTDNodes
- return (indexedRegion instanceof DTDNode && !(indexedRegion instanceof Unrecognized));
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java
deleted file mode 100644
index 61a22f19c7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java
+++ /dev/null
@@ -1,53 +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.dtd.ui.internal.registry;
-
-import org.eclipse.wst.dtd.core.internal.modelhandler.ModelHandlerForDTD;
-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.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * @author nitin
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class AdapterFactoryProviderForDTD implements AdapterFactoryProvider {
-
- /**
- *
- */
- public AdapterFactoryProviderForDTD() {
- super();
- }
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- }
-
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForDTD);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java
deleted file mode 100644
index 68bdb5e870..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java
+++ /dev/null
@@ -1,41 +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.dtd.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsDTD {
-
- public static final String DTD_COMMENT = "dtdComment"; //$NON-NLS-1$
-
- // Data are variables
- public static final String DTD_DATA = "dtdData"; //$NON-NLS-1$
- public static final String DTD_DEFAULT = "dtdDefault"; //$NON-NLS-1$
-
- // keywords are constants like IMPLIED or PCDATA
- public static final String DTD_KEYWORD = "dtdKeyword"; //$NON-NLS-1$
-
- // strings are anything in quotes
- public static final String DTD_STRING = "dtdString"; //$NON-NLS-1$
-
- // All the remaining symbols
- public static final String DTD_SYMBOL = "dtdSymbol"; //$NON-NLS-1$
-
- // tags are '<', '!', or '>'
- public static final String DTD_TAG = "dtdTag"; //$NON-NLS-1$
-
- // tagnames are like ELEMENT, ATTLIST, etc.
- public static final String DTD_TAGNAME = "dtdTagName"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java
deleted file mode 100644
index 443a940ae1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java
+++ /dev/null
@@ -1,133 +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.dtd.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-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;
-
-public class LineStyleProviderForDTD extends AbstractLineStyleProvider implements LineStyleProvider {
- public LineStyleProviderForDTD() {
- super();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DEFAULT);
- }
- String type = region.getType();
- if (type == DTDRegionTypes.CONTENT_EMPTY || type == DTDRegionTypes.CONTENT_ANY || type == DTDRegionTypes.CONTENT_PCDATA) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- }
- else if (type == DTDRegionTypes.ELEMENT_TAG || type == DTDRegionTypes.ENTITY_TAG || type == DTDRegionTypes.ATTLIST_TAG || type == DTDRegionTypes.NOTATION_TAG) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAGNAME);
- }
- else if (type == DTDRegionTypes.CONNECTOR || type == DTDRegionTypes.OCCUR_TYPE) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_SYMBOL);
- }
- else if (type == DTDRegionTypes.NDATA_VALUE) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- }
- else if (type == DTDRegionTypes.START_TAG || type == DTDRegionTypes.END_TAG || type == DTDRegionTypes.EXCLAMATION) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAG);
- }
- else if (type == DTDRegionTypes.COMMENT_START || type == DTDRegionTypes.COMMENT_CONTENT || type == DTDRegionTypes.COMMENT_END) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_COMMENT);
- }
- else if (type == DTDRegionTypes.SINGLEQUOTED_LITERAL || type == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_STRING);
- }
- else if (type == DTDRegionTypes.SYSTEM_KEYWORD || type == DTDRegionTypes.PUBLIC_KEYWORD || type == DTDRegionTypes.NDATA_KEYWORD || type == DTDRegionTypes.CDATA_KEYWORD || type == DTDRegionTypes.ID_KEYWORD || type == DTDRegionTypes.IDREF_KEYWORD || type == DTDRegionTypes.IDREFS_KEYWORD || type == DTDRegionTypes.ENTITY_KEYWORD || type == DTDRegionTypes.ENTITIES_KEYWORD || type == DTDRegionTypes.NMTOKEN_KEYWORD || type == DTDRegionTypes.NMTOKENS_KEYWORD || type == DTDRegionTypes.NOTATION_KEYWORD || type == DTDRegionTypes.REQUIRED_KEYWORD || type == DTDRegionTypes.IMPLIED_KEYWORD || type == DTDRegionTypes.FIXED_KEYWORD) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_KEYWORD);
- }
- else if (type == DTDRegionTypes.NAME || type == DTDRegionTypes.ENTITY_PARM) {
- // if (region instanceof DTDRegion) {
- // DTDRegion dtdRegion = (DTDRegion) region;
- // IStructuredDocumentRegion flatNode = dtdRegion.getParent();
- // String regionText = flatNode.getText(dtdRegion);
- // if (regionText.equals("ANY") || regionText.equals("EMPTY")) {
- // return new TextAttribute(DTDColors.DTD_KEYWORD);
- // }
- // }
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- }
-
- // default, return null to signal "not handled"
- // in which case, other factories should be tried
- return null;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return DTDUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsDTD.DTD_DEFAULT.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_DEFAULT;
- }
- else if (IStyleConstantsDTD.DTD_TAG.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_TAG;
- }
- else if (IStyleConstantsDTD.DTD_TAGNAME.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_TAGNAME;
- }
- else if (IStyleConstantsDTD.DTD_COMMENT.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_COMMENT;
- }
- else if (IStyleConstantsDTD.DTD_KEYWORD.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_KEYWORD;
- }
- else if (IStyleConstantsDTD.DTD_STRING.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_STRING;
- }
- else if (IStyleConstantsDTD.DTD_DATA.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_DATA;
- }
- else if (IStyleConstantsDTD.DTD_SYMBOL.equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_SYMBOL;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- protected void loadColors() {
- addTextAttribute(IStyleConstantsDTD.DTD_DEFAULT);
- addTextAttribute(IStyleConstantsDTD.DTD_TAG);
- addTextAttribute(IStyleConstantsDTD.DTD_TAGNAME);
- addTextAttribute(IStyleConstantsDTD.DTD_COMMENT);
- addTextAttribute(IStyleConstantsDTD.DTD_KEYWORD);
- addTextAttribute(IStyleConstantsDTD.DTD_STRING);
- addTextAttribute(IStyleConstantsDTD.DTD_DATA);
- addTextAttribute(IStyleConstantsDTD.DTD_SYMBOL);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
deleted file mode 100644
index 0f25b7e633..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
+++ /dev/null
@@ -1,159 +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.wst.dtd.ui.internal.style;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.core.text.IDTDPartitions;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-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.sse.core.internal.provisional.text.IStructuredPartitioning;
-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;
-
-public class LineStyleProviderForDTDSubSet extends AbstractLineStyleProvider implements LineStyleProvider {
- private IStructuredModel fInternalModel = null;
- private LineStyleProviderForDTD fInternalProvider = null;
- private StyleRange[] fInternalRanges;
- private String fPartitioning = null;
-
- public LineStyleProviderForDTDSubSet() {
- super();
- fInternalProvider = new LineStyleProviderForDTD();
- fInternalRanges = new StyleRange[0];
- fPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
- }
-
-
- /**
- * @param lineRequestStart
- * @param lineRequestLength
- * @param holdResults
- */
- private void addStyleRanges(int lineRequestStart, int lineRequestLength, Collection holdResults, int adjustment) {
- int lineRequestEnd = lineRequestStart + lineRequestLength;
- for (int i = 0; i < fInternalRanges.length; i++) {
- int adjustedStyleRangeStart = adjustment + fInternalRanges[i].start;
- int adjustedStyleRangeEnd = adjustedStyleRangeStart + fInternalRanges[i].length;
- if (adjustedStyleRangeEnd < lineRequestStart || lineRequestEnd < adjustedStyleRangeStart)
- continue;
- int end = Math.min(adjustedStyleRangeEnd, lineRequestEnd);
- StyleRange range = new StyleRange();
- range.start = Math.max(adjustedStyleRangeStart, lineRequestStart);
- range.length = end - range.start;
- range.fontStyle = fInternalRanges[i].fontStyle;
- range.foreground = fInternalRanges[i].foreground;
- range.background = fInternalRanges[i].background;
- holdResults.add(range);
- }
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- TextAttribute ta = null;
-
- String prefString = getColorPreferences().getString(IStyleConstantsDTD.DTD_DEFAULT);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- ta = createTextAttribute(foreground, background, bold);
- }
- return ta;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return DTDUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @return
- */
- private IStructuredDocument getInternalDocument() {
- if (fInternalModel == null) {
- fInternalModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForDTD.ContentTypeID_DTD);
- }
- return fInternalModel.getStructuredDocument();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.structured.style.AbstractLineStyleProvider#prepareRegions(org.eclipse.jface.text.ITypedRegion,
- * int, int, java.util.Collection)
- */
- public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
- if (!IDTDPartitions.DTD_DEFAULT.equals(typedRegion.getType())) {
- // compute an internal DTD model and return linestyles for it
- ITextRegion dtdContentRegion = null;
- IStructuredDocumentRegion doctype = fDocument.getRegionAtCharacterOffset(typedRegion.getOffset());
- if (doctype != null)
- dtdContentRegion = doctype.getRegionAtCharacterOffset(typedRegion.getOffset());
- String contents = dtdContentRegion != null ? doctype.getFullText(dtdContentRegion) : null;
- IStructuredDocument document = getInternalDocument();
- if (document == null)
- return false;
-
- updateStyleRanges(document, contents);
-
- addStyleRanges(lineRequestStart, lineRequestLength, holdResults, doctype.getStartOffset(dtdContentRegion));
- return true;
- }
- return false;
- }
-
- public void release() {
- super.release();
- if (fInternalProvider != null) {
- fInternalProvider.release();
- }
- }
-
- private void updateStyleRanges(IStructuredDocument document, String contents) {
- if (!document.get().equals(contents)) {
- document.set(contents);
- try {
- ITypedRegion regions[] = TextUtilities.computePartitioning(getInternalDocument(), fPartitioning, 0, document.getLength(), false);
- List ranges = new ArrayList();
- fInternalProvider.init(getInternalDocument(), fRecHighlighter);
- for (int i = 0; i < regions.length; i++) {
- fInternalProvider.prepareRegions(regions[i], regions[i].getOffset(), regions[i].getLength(), ranges);
- }
- fInternalRanges = (StyleRange[]) ranges.toArray(new StyleRange[0]);
- }
- catch (BadLocationException e) {
- fInternalRanges = new StyleRange[0];
- }
- }
- }
-
-
- protected void loadColors() {
- fInternalProvider.loadColors();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java
deleted file mode 100644
index c63d5933ce..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java
+++ /dev/null
@@ -1,36 +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
- * David Carver, STAR - added Encoding Content Resolver, bug 162321
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.wst.xml.ui.internal.templates.EncodingTemplateVariableResolverXML;
-
-/**
- * Base class for DTD template context types. Templates of this context type
- * apply to any place within DTD content type.
- */
-public class TemplateContextTypeDTD extends TemplateContextType {
-
- public TemplateContextTypeDTD() {
- 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 EncodingTemplateVariableResolverXML());
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java
deleted file mode 100644
index 0aa4ee0ee5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsDTD {
- public static final String NEW = "dtd_new"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 5cf9a66050..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,28 +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.dtd.ui.internal.text;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-
-
-public class DTDDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public DTDDocumentRegionEdgeMatcher() {
- super(new String[]{DTDRegionTypes.START_TAG, DTDRegionTypes.COMMENT_START}, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java
deleted file mode 100644
index ed94bc9f58..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java
+++ /dev/null
@@ -1,56 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddAttributeAction extends BaseAction {
-
- public AddAttributeAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- String newName = "NewAttribute"; //$NON-NLS-1$
- if (selectedNode instanceof AttributeList) {
- ((AttributeList) selectedNode).addAttribute(newName);
- }
- else if (selectedNode instanceof Element) {
- ((Element) selectedNode).addAttribute(newName);
- }
- }
-
- protected boolean updateSelection(IStructuredSelection selection) {
- boolean rc = super.updateSelection(selection);
- DTDNode node = getFirstNodeSelected(selection);
- if (node instanceof Element) {
- // System.out.println("attribute set to true");
- setEnabled(true);
- }
- else {
- // System.out.println("attribute set to false");
- setEnabled(false);
- }
-
- return rc;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.java
deleted file mode 100644
index 1bcc5a1c75..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddAttributeListAction extends BaseAction {
-
- public AddAttributeListAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- DTDFile dtdFile = getModel().getDTDFile();
- String attListName = "NewAttList"; //$NON-NLS-1$
- if (selectedNode != null) {
- DTDNode topLevelNode = dtdFile.getTopLevelNodeAt(selectedNode.getStartOffset());
- if (topLevelNode instanceof Element) {
- attListName = ((Element) topLevelNode).getName();
- }
- }
-
- getModel().getDTDFile().createAttributeList(selectedNode, attListName, true);
- // newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java
deleted file mode 100644
index bdd9630ce5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java
+++ /dev/null
@@ -1,32 +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.dtd.ui.internal.views.contentoutline.actions;
-
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddCommentAction extends BaseAction {
-
- public AddCommentAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- getModel().getDTDFile().createComment(selectedNode, "NewComment", true); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java
deleted file mode 100644
index 6b00a259ac..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java
+++ /dev/null
@@ -1,33 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.util.DTDUniqueNameHelper;
-
-
-public class AddElementAction extends BaseAction {
-
- public AddElementAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- DTDFile dtdFile = getModel().getDTDFile();
- String elementName = DTDUniqueNameHelper.getUniqueElementName(dtdFile);
- dtdFile.createElement(selectedNode, elementName, true); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java
deleted file mode 100644
index c398cf9fb2..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java
+++ /dev/null
@@ -1,52 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddElementToContentModelAction extends BaseAction {
-
- public AddElementToContentModelAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode node = getFirstNodeSelected();
-
- if (node instanceof CMGroupNode) {
- ((CMGroupNode) node).addChild();
- }
- else if (node instanceof Element) {
- ((Element) node).addChild();
- }
- }
-
- protected boolean updateSelection(IStructuredSelection selection) {
- boolean rc = super.updateSelection(selection);
- DTDNode node = getFirstNodeSelected(selection);
- if (node instanceof CMGroupNode) {
- setEnabled(true);
- }
- else {
- setEnabled(false);
- }
- return rc;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java
deleted file mode 100644
index c51669ec2e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java
+++ /dev/null
@@ -1,35 +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.dtd.ui.internal.views.contentoutline.actions;
-
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddEntityAction extends BaseAction {
-
- public AddEntityAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
-
- getModel().getDTDFile().createEntity(selectedNode, "NewEntity", true); //$NON-NLS-1$
- // newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java
deleted file mode 100644
index 866e1c9168..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java
+++ /dev/null
@@ -1,39 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddGroupToContentModelAction extends BaseAction {
-
- public AddGroupToContentModelAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode node = getFirstNodeSelected();
-
- if (node instanceof CMGroupNode) {
- ((CMGroupNode) node).addGroup();
- }
- else if (node instanceof Element) {
- ((Element) node).addGroup();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java
deleted file mode 100644
index b11f82df70..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java
+++ /dev/null
@@ -1,34 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddNotationAction extends BaseAction {
-
- public AddNotationAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
-
- getModel().getDTDFile().createNotation(selectedNode, "NewNotation", true); //$NON-NLS-1$
-
- // newNotation.setName(DTDUniqueNameHelper.getUniqueNotationName(dtdFile));
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java
deleted file mode 100644
index 05ebced519..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java
+++ /dev/null
@@ -1,49 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-
-
-public class AddParameterEntityReferenceAction extends BaseAction {
- public AddParameterEntityReferenceAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public String getFirstExternalParameterEntity(DTDFile dtdFile) {
- LabelValuePair[] freeExternalEntities = dtdFile.getDTDModel().createParmEntityContentItems(null);
-
- if (freeExternalEntities.length > 0) {
- return (String) freeExternalEntities[0].fValue;
- // return (Entity) freeExternalEntities[0].fValue;
- }
- return null;
- }
-
- public void run() {
- DTDFile dtdFile = getModel().getDTDFile();
- String extEntity = getFirstExternalParameterEntity(dtdFile);
- DTDNode selectedNode = getFirstNodeSelected();
- if (extEntity != null) {
- dtdFile.createParameterEntityReference(selectedNode, extEntity, true);
- }
- else {
- dtdFile.createParameterEntityReference(selectedNode, "%NewEntityReference;", true); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java
deleted file mode 100644
index 411e9c3e91..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java
+++ /dev/null
@@ -1,67 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-abstract public class BaseAction extends SelectionListenerAction {
-
- protected IEditorActionBarContributor contextContributor;
- private IStructuredModel fModel;
-
- public BaseAction(IStructuredModel model, String text) {
- this(model, text, null);
- }
-
- public BaseAction(IStructuredModel model, String text, ImageDescriptor imageDesc) {
- super(text);
- fModel = model;
- setImageDescriptor(imageDesc);
- }
-
- protected DTDNode getFirstNodeSelected() {
- return getFirstNodeSelected(getStructuredSelection());
- }
-
- protected DTDNode getFirstNodeSelected(IStructuredSelection selection) {
- Iterator iter = selection.iterator();
- // DTDNode referencePoint = null;
- while (iter.hasNext()) {
- Object element = iter.next();
- if (element instanceof DTDNode) {
- return (DTDNode) element;
- }
- }
- return null;
- }
-
- protected DTDModelImpl getModel() {
- return (DTDModelImpl) fModel;
- }
-
- public void setContextContributor(IEditorActionBarContributor contributor) {
- contextContributor = contributor;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java
deleted file mode 100644
index 679c1dce9b..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java
+++ /dev/null
@@ -1,70 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.util.DTDBatchNodeDelete;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-public class DeleteAction extends SelectionListenerAction {
-
- public DeleteAction(String label) {
- super(label);
- }
-
- public void run() {
- IStructuredSelection selection = getStructuredSelection();
-
- Iterator iter = selection.iterator();
- DTDBatchNodeDelete batchDelete = null;
- DTDFile dtdFile = null;
- while (iter.hasNext()) {
- Object element = iter.next();
- if (element instanceof DTDNode) {
- DTDNode node = (DTDNode) element;
- dtdFile = node.getDTDFile();
- if (batchDelete == null) {
- batchDelete = new DTDBatchNodeDelete(dtdFile);
- }
- batchDelete.addNode((DTDNode) element);
- }
- }
- dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_LABEL_DTD_FILE_DELETE); //$NON-NLS-1$
- batchDelete.deleteNodes(this);
- dtdFile.getDTDModel().endRecording(this);
- }
-
- public boolean updateSelection(IStructuredSelection sel) {
- if (!super.updateSelection(sel))
- return false;
-
- Object selectedObject = sel.getFirstElement();
- if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
- setEnabled(true);
- return true; // enable delete menu item
- }
- else {
- setEnabled(false);
- return false; // disable it - grey out
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java
deleted file mode 100644
index 5523965513..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-public class ReplaceEmptyContentModelWithGroupAction extends BaseAction {
-
- public ReplaceEmptyContentModelWithGroupAction(DTDModelImpl model, String label) {
- super(model, label);
- }
-
- public void run() {
- DTDNode node = getFirstNodeSelected();
- if (node instanceof Element) {
- CMNode contentModel = ((Element) node).getContentModel();
- if (CMNode.EMPTY.equals(contentModel.getType())) {
- getModel().beginRecording(this, getText());
- ((Element) node).replaceContentModel(this, "()"); //$NON-NLS-1$
- getModel().endRecording(this);
- }
- }
- }
-
- protected boolean updateSelection(IStructuredSelection selection) {
- boolean rc = super.updateSelection(selection);
- DTDNode node = getFirstNodeSelected(selection);
- setEnabled(node instanceof Element);
- return rc;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java
deleted file mode 100644
index cc90289ae0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java
+++ /dev/null
@@ -1,130 +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.dtd.ui.internal.views.properties;
-
-import java.util.Stack;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.properties.CustomPropertyDescriptor;
-
-
-/**
- * An IPropertySource implementation for a JFace viewer used to display
- * properties of DOM nodes. Requires an adapter factory to create JFace
- * adapters for the nodes in the tree.
- */
-public class DTDPropertySourceAdapter implements INodeAdapter, IPropertySource {
- protected final static String CATEGORY_ATTRIBUTES = "Attributes"; //$NON-NLS-1$
-
- private static final String ID_NAME = DTDUIMessages.DTDPropertySourceAdapter_0; //$NON-NLS-1$
- private static final String ID_TEXT = DTDUIMessages.DTDPropertySourceAdapter_1; //$NON-NLS-1$
-
- protected IPropertyDescriptor[] fDescriptors = null;
- protected INodeNotifier fNode = null;
-
- protected Stack fValuesBeingSet = new Stack();
-
- public DTDPropertySourceAdapter(INodeNotifier target) {
- super();
- fNode = target;
- }
-
- /**
- * @return
- */
- private IPropertyDescriptor[] createPropertyDescriptors() {
- CustomPropertyDescriptor nameDescriptor = new CustomPropertyDescriptor(ID_NAME, ID_NAME, null);
- nameDescriptor.setCategory(DTDUIMessages.DTDPropertySourceAdapter_2); //$NON-NLS-1$
- // CustomPropertyDescriptor contentDescriptor = new
- // CustomPropertyDescriptor(ID_TEXT, ID_TEXT, null);
- // contentDescriptor.setCategory("Attributes");
- return new IPropertyDescriptor[]{nameDescriptor};
- }
-
- /**
- * Returns a value for this Node that can be editted in a property sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue() {
- return null;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return all valid descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (fDescriptors == null || fDescriptors.length == 0) {
- fDescriptors = createPropertyDescriptors();
- }
- else {
- updatePropertyDescriptors();
- }
- return fDescriptors;
- }
-
- /**
- * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
- */
- public Object getPropertyValue(Object id) {
- Object value = null;
- if (id.equals(ID_NAME) && fNode instanceof DTDNode) {
- value = ((DTDNode) fNode).getName();
- }
- if (id.equals(ID_TEXT) && fNode instanceof DTDNode) {
- value = ((DTDNode) fNode).getFullNodeText();
- }
- return value;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type == IPropertySource.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
- */
- public boolean isPropertySet(Object id) {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
- */
- public void resetPropertyValue(Object id) {
- }
-
- public void setPropertyValue(Object nameObject, Object value) {
- }
-
- protected void updatePropertyDescriptors() {
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java
deleted file mode 100644
index 59606bbb6f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java
+++ /dev/null
@@ -1,42 +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.dtd.ui.internal.views.properties;
-
-
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-public class DTDPropertySourceAdapterFactory extends AbstractAdapterFactory {
-
- public DTDPropertySourceAdapterFactory() {
- super(IPropertySource.class, true);
- }
-
- public DTDPropertySourceAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public INodeAdapterFactory copy() {
- return new DTDPropertySourceAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- // at the moment, only one implementation exists
- return new DTDPropertySourceAdapter(target);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
deleted file mode 100644
index a66906ecb5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
+++ /dev/null
@@ -1,513 +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.wst.dtd.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.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.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.Logger;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceNames;
-import org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeIdsDTD;
-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 NewDTDTemplatesWizardPage 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(TemplateContextTypeIdsDTD.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 NewDTDTemplatesWizardPage() {
- super("NewDTDTemplatesWizardPage", DTDUIMessages.NewDTDTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(DTDUIMessages.NewDTDTemplatesWizardPage_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 DTD Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(DTDUIMessages.NewDTDTemplatesWizardPage_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);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(DTDUIMessages.NewDTDTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // 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(DTDUIMessages.NewDTDTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(DTDUIMessages.NewDTDTemplatesWizardPage_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 = DTDUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(DTDUIMessages.NewDTDTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.DTD_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 StructuredTextViewerConfigurationDTD();
-
- 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);
- viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForDTD.ContentTypeID_DTD);
- 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(DTDUIMessages.NewDTDTemplatesWizardPage_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);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- 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.dtd.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 = DTDUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsDTD.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 dtd", 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 DTD File wizard.
- */
- private void loadLastSavedPreferences() {
- String templateName = DTDUIPlugin.getDefault().getPreferenceStore().getString(DTDUIPreferenceNames.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 DTD File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- DTDUIPlugin.getDefault().getPreferenceStore().setValue(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- DTDUIPlugin.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, TemplateContextTypeIdsDTD.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
deleted file mode 100644
index 637811c529..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-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.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.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.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-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.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.core.internal.preferences.DTDCorePreferenceNames;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.Logger;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
-public class NewDTDWizard extends Wizard implements INewWizard {
- private WizardNewFileCreationPage fNewFilePage;
- private NewDTDTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
- private static final String defaultName = "NewFile"; //$NON-NLS-1$
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- /**
- * Adds default extension to the filename
- *
- * @param filename
- * @return
- */
- String addDefaultExtension(String filename) {
- StringBuffer newFileName = new StringBuffer(filename);
-
- Preferences preference = DTDCorePlugin.getInstance().getPluginPreferences();
- String ext = preference.getString(DTDCorePreferenceNames.DEFAULT_EXTENSION);
-
- newFileName.append("."); //$NON-NLS-1$
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- IContentType getContentType() {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
- return fContentType;
- }
-
- /**
- * Get list of valid extensions for DTD Content type
- *
- * @return
- */
- List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- 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;
- }
-
- /**
- * 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
- */
- 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;
- }
-
- public void addPages() {
- fNewFilePage = new WizardNewFileCreationPage("DTDWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
- public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- setFileName(computeDefaultFileName());
- setPageComplete(validatePage());
- }
- protected String computeDefaultFileName() {
- int count = 0;
- String fileName = addDefaultExtension(defaultName);
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null) {
- while (true) {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path)) {
- count++;
- fileName = addDefaultExtension(defaultName + count);
- }
- else {
- break;
- }
- }
- }
- return fileName;
- }
- protected boolean validatePage() {
- 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(DTDUIMessages._ERROR_FILENAME_MUST_END_DTD, 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(DTDUIMessages.ResourceGroup_nameExists);
- return false;
- }
- }
- }
- setErrorMessage(null);
- return super.validatePage();
- }
- };
- fNewFilePage.setTitle(DTDUIMessages._UI_CREATE_NEW_DTD_FILE);
- fNewFilePage.setDescription(DTDUIMessages._UI_WIZARD_NEW_DTD_EXPL);
-
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewDTDTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- fSelection = aSelection;
- setWindowTitle(DTDUIMessages._UI_WIZARD_NEW_DTD_TITLE); //$NON-NLS-1$
-
- ImageDescriptor descriptor = DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_WIZBAN_NEWDTDFILE);
- 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 = 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
- String charSet = getAppropriateCharset();
-
- 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 DTD file", e); //$NON-NLS-1$
- }
- }
-
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-
- /**
- * If the DTD preference identifies a charset, use that. If not, revert to the XML
- * charset preference
- *
- * @return charset based on DTD preferences if defined, if not, from the XML preferences
- */
- private String getAppropriateCharset() {
- String charset = DTDCorePlugin.getInstance().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if(charset == null || charset.trim().equals(""))
- charset = XMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- return charset;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java
deleted file mode 100644
index e6aca53126..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java
+++ /dev/null
@@ -1,37 +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.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-
-/**
- * Comparator for the outline. Allows sorting of regular DTD elements, but not
- * their content models since the ordering there is important.
- */
-class DTDContentOutlineComparator extends ViewerComparator {
-
- public DTDContentOutlineComparator() {
- super();
- }
-
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof CMNode && e2 instanceof CMNode)
- return 0;
- return super.compare(viewer, e1, e2);
- }
-
- public boolean isSorterProperty(Object element, String property) {
- return super.isSorterProperty(element, property);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
deleted file mode 100644
index a09b4d5688..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.dnd.DTDDragAndDropManager;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows DTD content.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class DTDContentOutlineConfiguration extends ContentOutlineConfiguration {
- private IContentProvider fContentProvider = null;
- private ILabelProvider fLabelProvider = null;
-
- private DTDContextMenuHelper fMenuHelper;
- private TransferDragSourceListener[] fTransferDragSourceListeners;
- private TransferDropTargetListener[] fTransferDropTargetListeners;
- private Map fViewerContributions;
- private final String OUTLINE_ORDER_PREF = "outline-order"; //$NON-NLS-1$
- private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.dtd.ui.OutlinePage"; //$NON-NLS-1$
-
- /**
- * Default constructor for DTDContentOutlineConfiguration.
- */
- public DTDContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- fViewerContributions = new HashMap(2);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#createToolbarContributions(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
- Assert.isTrue(getContentProvider(viewer) instanceof DTDTreeContentProvider, "invalid content provider on viewer"); //$NON-NLS-1$
- IContributionItem[] items = super.createToolbarContributions(viewer);
-
- SortAction sortAction = new SortAction(viewer, DTDUIPlugin.getDefault().getPreferenceStore(), OUTLINE_SORT_PREF);
- OrderAction orderAction = new OrderAction(viewer, (DTDTreeContentProvider) getContentProvider(viewer), DTDUIPlugin.getDefault().getPreferenceStore(), OUTLINE_ORDER_PREF);
- IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
- IContributionItem orderItem = new PropertyChangeUpdateActionContributionItem(orderAction);
-
- if (items == null) {
- items = new IContributionItem[2];
- items[0] = sortItem;
- items[1] = orderItem;
- }
- else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 2];
- combinedItems[0] = sortItem;
- combinedItems[1] = orderItem;
- System.arraycopy(items, 0, combinedItems, 2, items.length);
- items = combinedItems;
- }
- return items;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null) {
- fContentProvider = new DTDTreeContentProvider();
- }
- // return super.getContentProvider(viewer);
- return fContentProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null) {
- fLabelProvider = new DTDLabelProvider();
- }
- // return super.getLabelProvider(viewer);
- return fLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
- */
- public IMenuListener getMenuListener(TreeViewer viewer) {
- IMenuListener listener = null;
- if (fMenuHelper == null && viewer.getInput() instanceof DTDModelImpl) {
- fMenuHelper = new DTDContextMenuHelper((DTDModelImpl) viewer.getInput());
- fMenuHelper.createMenuListenersFor(viewer);
- }
- if (fMenuHelper != null) {
- listener = fMenuHelper.getMenuListener();
- }
- return listener;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return DTDUIPlugin.getDefault().getPreferenceStore();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDragSourceListener[] getTransferDragSourceListeners(final TreeViewer treeViewer) {
- if (fTransferDragSourceListeners == null) {
- fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
- public void dragFinished(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(null);
- }
-
- public void dragSetData(DragSourceEvent event) {
- }
-
- public void dragStart(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection());
- }
-
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getTransfer();
- }
- }};
- }
-
- return fTransferDragSourceListeners;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDropTargetListener[] getTransferDropTargetListeners(final TreeViewer treeViewer) {
- if (fTransferDropTargetListeners == null) {
- fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
- public void dragEnter(DropTargetEvent event) {
- }
-
- public void dragLeave(DropTargetEvent event) {
- }
-
- public void dragOperationChanged(DropTargetEvent event) {
- }
-
- public void dragOver(DropTargetEvent event) {
- event.feedback = DND.FEEDBACK_SELECT;
- float feedbackFloat = getHeightInItem(event);
- if (feedbackFloat > 0.75) {
- event.feedback = DND.FEEDBACK_INSERT_AFTER;
- }
- else if (feedbackFloat < 0.25) {
- event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- }
- event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
- }
-
- public void drop(DropTargetEvent event) {
- if (event.operations != DND.DROP_NONE && LocalSelectionTransfer.getTransfer().getSelection() instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- if (selection != null && !selection.isEmpty() && event.item != null && event.item.getData() != null) {
- /*
- * the command uses these numbers instead of the
- * feedback constants (even though it converts in
- * the other direction as well)
- */
- float feedbackFloat = getHeightInItem(event);
-
- final DragAndDropCommand command = new DTDDragAndDropManager().createCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList());
- if (command != null && command.canExecute()) {
- SafeRunnable.run(new SafeRunnable() {
- public void run() throws Exception {
- command.execute();
- }
- });
- }
- }
- }
- }
-
- public void dropAccept(DropTargetEvent event) {
- }
-
- private float getHeightInItem(DropTargetEvent event) {
- if(event.item == null) return .5f;
- if (event.item instanceof TreeItem) {
- TreeItem treeItem = (TreeItem) event.item;
- Control control = treeItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = treeItem.getBounds();
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else if (event.item instanceof TableItem) {
- TableItem tableItem = (TableItem) event.item;
- Control control = tableItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = tableItem.getBounds(0);
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else {
- return 0.0F;
- }
- }
-
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getTransfer();
- }
-
- public boolean isEnabled(DropTargetEvent event) {
- return getTransfer().isSupportedType(event.currentDataType);
- }
- }};
- }
- return fTransferDropTargetListeners;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
- */
- public void unconfigure(TreeViewer viewer) {
- super.unconfigure(viewer);
- fViewerContributions.remove(viewer);
- if (fMenuHelper != null) {
- fMenuHelper.removeMenuListenersFor(viewer);
- fMenuHelper = null;
- }
- }
-
- protected String getOutlineFilterTarget(){
- return OUTLINE_FILTER_PREF ;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
deleted file mode 100644
index f99a07f91c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Naoki Akiyama (Fujitsu) - bug 187172 - fix attribute grouping
- *
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddAttributeAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddAttributeListAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddCommentAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddElementAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddElementToContentModelAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddEntityAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddGroupToContentModelAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddNotationAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddParameterEntityReferenceAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.DeleteAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.ReplaceEmptyContentModelWithGroupAction;
-
-/**
- * Menu helper for Content Outline page. This should not be used elsewhere.
- */
-class DTDContextMenuHelper {
- class DTDMenuListener implements IMenuListener {
- public void menuAboutToShow(IMenuManager manager) {
- // update the action selection now
- addNotationAction.selectionChanged(fViewerSelection);
- addEntityAction.selectionChanged(fViewerSelection);
- addElementAction.selectionChanged(fViewerSelection);
- addCommentAction.selectionChanged(fViewerSelection);
- addParameterEntityReferenceAction.selectionChanged(fViewerSelection);
- deleteAction.selectionChanged(fViewerSelection);
- addAttributeAction.selectionChanged(fViewerSelection);
- addAttributeListAction.selectionChanged(fViewerSelection);
- addGroupToContentModelAction.selectionChanged(fViewerSelection);
- addElementToContentModelAction.selectionChanged(fViewerSelection);
- replaceEmptyContentModelWithGroupAction.selectionChanged(fViewerSelection);
-
-
- if (!fViewerSelection.isEmpty()) {
- addActionItemsForSelection(fViewerSelection.getFirstElement(), manager);
- }
- }
- }
-
- class ViewerSelectionChangeListener implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- _selectionChanged(event);
- }
- }
-
- AddAttributeAction addAttributeAction;
-
- AddAttributeListAction addAttributeListAction;
- AddCommentAction addCommentAction;
- AddElementAction addElementAction;
- AddElementToContentModelAction addElementToContentModelAction;
- AddEntityAction addEntityAction;
- AddGroupToContentModelAction addGroupToContentModelAction;
- AddNotationAction addNotationAction;
- AddParameterEntityReferenceAction addParameterEntityReferenceAction;
- DeleteAction deleteAction;
- private ISelectionChangedListener fInternalSelectionChangedListener = new ViewerSelectionChangeListener();
-
- private IMenuListener fMenuListener;
- private DTDModelImpl fModel;
- private List fViewerList;
-
- IStructuredSelection fViewerSelection = StructuredSelection.EMPTY;
-
- ReplaceEmptyContentModelWithGroupAction replaceEmptyContentModelWithGroupAction;
-
- public DTDContextMenuHelper(DTDModelImpl model) {
- fModel = model;
- fViewerList = new ArrayList(1);
- fMenuListener = new DTDMenuListener();
-
- addNotationAction = new AddNotationAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_NOTATION); //$NON-NLS-1$
- addEntityAction = new AddEntityAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_ENTITY); //$NON-NLS-1$
- addElementAction = new AddElementAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_ELEMENT); //$NON-NLS-1$
- addCommentAction = new AddCommentAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_COMMENT); //$NON-NLS-1$
-
- addParameterEntityReferenceAction = new AddParameterEntityReferenceAction(model, DTDUIMessages._UI_ACTION_ADD_PARAM_ENTITY_REF); //$NON-NLS-1$
- deleteAction = new DeleteAction(DTDUIMessages._UI_ACTION_DTD_DELETE); //$NON-NLS-1$
- addAttributeAction = new AddAttributeAction(model, DTDUIMessages._UI_ACTION_ADD_ATTRIBUTE); //$NON-NLS-1$
- addAttributeListAction = new AddAttributeListAction(model, DTDUIMessages._UI_ACTION_ADD_ATTRIBUTELIST); //$NON-NLS-1$
-
- addGroupToContentModelAction = new AddGroupToContentModelAction(model, DTDUIMessages._UI_ACTION_GROUP_ADD_GROUP); //$NON-NLS-1$
- addElementToContentModelAction = new AddElementToContentModelAction(model, DTDUIMessages._UI_ACTION_ADD_ELEMENT); //$NON-NLS-1$
-
- replaceEmptyContentModelWithGroupAction = new ReplaceEmptyContentModelWithGroupAction(model, DTDUIMessages._UI_ACTION_GROUP_ADD_GROUP); //$NON-NLS-1$
-
- addNotationAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_NOTATION));
- addEntityAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY));
- addCommentAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_COMMENT));
- addParameterEntityReferenceAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY_REFERENCE));
-
- // Tri-state images
- addElementAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENT));
- addElementAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENT));
- addElementAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENT));
-
- addAttributeAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
- addAttributeAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
- addAttributeAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
- addAttributeListAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
- addAttributeListAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
- addAttributeListAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
- addGroupToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_GROUPTOCONMODEL));
- addGroupToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_GROUPTOCONMODEL));
- addGroupToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_GROUPTOCONMODEL));
-
- addElementToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENTTOCONMODEL));
- addElementToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENTTOCONMODEL));
- addElementToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENTTOCONMODEL));
-
- // use the same images as addGroupToContentModelAction
- replaceEmptyContentModelWithGroupAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_GROUPTOCONMODEL));
- replaceEmptyContentModelWithGroupAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_GROUPTOCONMODEL));
- replaceEmptyContentModelWithGroupAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_GROUPTOCONMODEL));
- }
-
- void _selectionChanged(SelectionChangedEvent event) {
- /*
- * Save the selection so we only notify the actions when the menu is
- * shown
- */
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- fViewerSelection = (IStructuredSelection) selection;
- }
- else {
- fViewerSelection = StructuredSelection.EMPTY;
- }
- }
-
- void addActionItemsForSelection(Object selectedObject, IMenuManager menu) {
- if (selectedObject instanceof NodeList) {
- // add appropriate menu to logical view
- NodeList folder = (NodeList) selectedObject;
- if (folder.getListType().equals(DTDRegionTypes.NOTATION_TAG)) {
- menu.add(addNotationAction);
- }
- else if (folder.getListType().equals(DTDRegionTypes.ENTITY_TAG)) {
- menu.add(addEntityAction);
- }
- else if (folder.getListType().equals(DTDRegionTypes.ELEMENT_TAG)) {
- LabelValuePair[] availableEntities = fModel.createParmEntityContentItems(null);
- addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
- menu.add(addElementAction);
- menu.add(addParameterEntityReferenceAction);
- }
- else if (folder.getListType().equals(DTDRegionTypes.ATTLIST_TAG)) {
- menu.add(addAttributeListAction);
- }
- }
- if (selectedObject instanceof DTDFile || selectedObject == null) {
- LabelValuePair[] availableEntities = fModel.createParmEntityContentItems(null);
- addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
- menu.add(addElementAction);
- menu.add(addEntityAction);
- menu.add(addNotationAction);
- menu.add(addParameterEntityReferenceAction);
- menu.add(addCommentAction);
- menu.add(addAttributeListAction);
- menu.add(new Separator());
- }
-
- if (selectedObject instanceof Element) {
- Element dtdElement = (Element) selectedObject;
-
- CMNode contentModel = dtdElement.getContentModel();
- if (contentModel == null) {
- menu.add(addGroupToContentModelAction);
- menu.add(addElementToContentModelAction);
- }
- else if (contentModel != null && CMNode.EMPTY.equals(contentModel.getType())) {
- menu.add(replaceEmptyContentModelWithGroupAction);
- }
- menu.add(addAttributeAction);
- }
- else if (selectedObject instanceof CMGroupNode) {
- menu.add(addElementToContentModelAction);
- menu.add(addGroupToContentModelAction);
- }
- else if (selectedObject instanceof AttributeList) {
- menu.add(addAttributeAction);
- }
-
- menu.add(new Separator());
- addEditActions(menu);
- menu.add(new Separator());
-
- if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
- menu.add(deleteAction);
- deleteAction.setEnabled(true);
- }
- }
-
- void addEditActions(IMenuManager menu) {
- // menu.add(undoAction);
- // menu.add(redoAction);
- // menu.add(new Separator());
- // menu.add(cutAction);
- // menu.add(copyAction);
- // menu.add(pasteAction);
- }
-
- public void createMenuListenersFor(Viewer viewer) {
- viewer.addSelectionChangedListener(fInternalSelectionChangedListener);
- ISelection selection = viewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- fViewerSelection = (IStructuredSelection) selection;
- }
- else {
- fViewerSelection = StructuredSelection.EMPTY;
- }
-
- fViewerList.add(viewer);
- }
-
- public IMenuListener getMenuListener() {
- return fMenuListener;
- }
-
- public void removeMenuListenersFor(Viewer viewer) {
- viewer.removeSelectionChangedListener(fInternalSelectionChangedListener);
- fViewerList.remove(viewer);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
deleted file mode 100644
index f3b6135425..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.DTDResource;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-class DTDLabelProvider extends LabelProvider {
-
- public DTDLabelProvider() {
- super();
- }
-
- /**
- * Returns the image for the label of the given element.
- *
- * @param element
- * the element for which to provide the label image
- * @return the image used to label the element, or <code>null</code> if
- * these is no image for the given object
- */
- public Image getImage(Object element) {
- Image image = null;
- if (element instanceof DTDNode) {
- final String imgPath = ((DTDNode) element).getImagePath();
- image = imgPath != null ? DTDUIPlugin.getDefault().getImage(imgPath) : null;
- }
- else if (element instanceof NodeList) {
- final String imgPath = ((NodeList) element).getImagePath();
- image = imgPath != null ? DTDUIPlugin.getDefault().getImage(imgPath) : null;
- }
- else if (element instanceof DTDFile) {
- image = DTDUIPlugin.getDefault().getImage(DTDResource.DTDFILEICON);
- }
- else {
- image = super.getImage(element);
- }
- return image;
- }
-
- /**
- * Returns the text for the label of the given element.
- *
- * @param element
- * the element for which to provide the label text
- * @return the text string used to label the element, or <code>null</code>
- * if these is no text label for the given object
- */
- public String getText(Object element) {
- if (element instanceof DTDNode) {
- String name = ((DTDNode) element).getName();
-
- // strip leading whitespace (useful for multi-line comments)
- int firstSignificantCharacter = 0;
- int lastVisibleCharacter = name.length() - 1;
- for (firstSignificantCharacter = 0; firstSignificantCharacter < name.length(); firstSignificantCharacter++) {
- if (!Character.isWhitespace(name.charAt(firstSignificantCharacter)))
- break;
- }
- // keep only the first line of text in a multi-line name
- if (firstSignificantCharacter < lastVisibleCharacter) {
- for (lastVisibleCharacter = firstSignificantCharacter + 1; lastVisibleCharacter < name.length(); lastVisibleCharacter++) {
- char character = name.charAt(lastVisibleCharacter);
- if (character == '\r' || character == '\n')
- break;
- }
- }
- if (firstSignificantCharacter > 0 && firstSignificantCharacter < name.length() - 1) {
- name = name.substring(firstSignificantCharacter, lastVisibleCharacter);
- }
-
- return name;
- }
- else if (element instanceof NodeList) {
- // return ((NodeList) element).getListType();
- return ((NodeList) element).getName();
- }
- else if (element instanceof DTDFile) {
- return ((DTDFile) element).getName();
- }
- return super.getText(element);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
deleted file mode 100644
index fdd1531001..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-
-class DTDTreeContentProvider implements ITreeContentProvider, IDTDFileListener {
-
- private Object fInputObject;
- protected Viewer fViewer;
-
- // A cached set of IndexedNodeLists, required for getParent to return the
- // correct instances mapping to TreeItems
- protected Object[] logicalNodeLists = null;
-
- private boolean showLogicalOrder = false;
-
- public DTDTreeContentProvider() {
- super();
- }
-
- public void dispose() {
- fViewer = null;
- }
-
- private void expandToNode(DTDNode node) {
- DTDFile dtdFile = node.getDTDFile();
- // first expand the root
- AbstractTreeViewer viewer = (AbstractTreeViewer) fViewer;
- viewer.expandToLevel(dtdFile, 1);
- NodeList listToExpand = null;
- if (node instanceof Element || node instanceof ParameterEntityReference) {
- listToExpand = dtdFile.getElementsAndParameterEntityReferences();
- }
- else if (node instanceof Notation) {
- listToExpand = dtdFile.getNotations();
- }
- else if (node instanceof Entity) {
- listToExpand = dtdFile.getEntities();
- }
- else if (node instanceof Comment) {
- listToExpand = dtdFile.getComments();
- }
- if (listToExpand != null) {
- viewer.expandToLevel(listToExpand, 1);
- }
- viewer.expandToLevel(node, 0);
- }
-
- public Object[] getChildren(Object parentElement) {
- // return the lists of nodes when in logical order mode, all the Nodes
- // otherwise
- if (parentElement instanceof DTDFile) {
- if (isShowLogicalOrder()) {
- // return the visible node lists
- if (logicalNodeLists == null) {
- Iterator nodeLists = ((DTDFile) parentElement).getNodeLists().iterator();
- List visibleLists = new ArrayList(7);
- while (nodeLists.hasNext()) {
- NodeList list = (NodeList) nodeLists.next();
- if (isVisibleNodeList(list)) {
- visibleLists.add(list);
- }
- }
- logicalNodeLists = visibleLists.toArray();
- }
- return logicalNodeLists;
- }
- else {
- // return the visible nodes
- List allNodes = ((DTDFile) parentElement).getNodes();
- List visibleNodes = new ArrayList(allNodes.size());
- for (int i = 0; i < allNodes.size(); i++) {
- Object o = allNodes.get(i);
- if (isVisibleNode(o)) {
- visibleNodes.add(o);
- }
- }
- return visibleNodes.toArray();
- }
- }
- else if (parentElement instanceof NodeList) {
- return ((NodeList) parentElement).getNodes().toArray();
- }
- else if (parentElement instanceof Element) {
- // always group the attributes directly under the element
- Object[] children = ((DTDNode) parentElement).getChildren();
- List attributes = ((Element) parentElement).getElementAttributes();
- Object[] logicalChildren = new Object[children.length + attributes.size()];
- int index = 0;
- for (index = 0; index < children.length; index++) {
- logicalChildren[index] = children[index];
- }
- for (Iterator iter = attributes.iterator(); iter.hasNext();) {
- logicalChildren[index++] = iter.next();
- }
- return logicalChildren;
- }
- else if (parentElement instanceof DTDNode) {
- return ((DTDNode) parentElement).getChildren();
- }
- return Collections.EMPTY_LIST.toArray();
- }
-
- public Object[] getElements(java.lang.Object inputElement) {
- Object[] elements = null;
- // Always show the DTDFile "node"
- if (inputElement instanceof DTDModelImpl) {
- elements = new Object[]{((DTDModelImpl) inputElement).getDTDFile()};
- }
- if (elements == null) {
- elements = new Object[0];
- }
- return elements;
- }
-
- public Object getParent(Object element) {
- List parents = getParents(element);
- Object parent = null;
- if(parents.size() > 0) {
- parent = parents.get(0);
- }
- return parent;
- }
-
- public boolean hasChildren(Object element) {
- Object[] children = getChildren(element);
- return children.length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer = viewer;
-
- if (fInputObject instanceof DTDModelImpl) {
- ((DTDModelImpl) fInputObject).getDTDFile().removeDTDFileListener(this);
- }
- fInputObject = newInput;
- if (fInputObject instanceof DTDModelImpl) {
- ((DTDModelImpl) fInputObject).getDTDFile().addDTDFileListener(this);
- }
- }
-
- /**
- * Get the value of showLogicalOrder.
- *
- * @return value of showLogicalOrder.
- */
- public boolean isShowLogicalOrder() {
- return showLogicalOrder;
- }
-
- private boolean isVisibleNode(Object o) {
- if (o instanceof AttributeList) {
- return false;
- }
- return true;
- }
-
- private boolean isVisibleNodeList(NodeList nodeList) {
- /*
- * All NodesLists should be visible because you can momentarily have
- * an ATTLIST (for example) without a corresponding ELEMENT
- * declaration
- */
- return true;// !nodeList.getListType().equals(DTDRegionTypes.ATTLIST_TAG);
- }
-
- /**
- * <p>If a node changed then refresh the tree for that node</p>
- *
- * @see org.eclipse.wst.dtd.core.internal.event.IDTDFileListener#nodeChanged(org.eclipse.wst.dtd.core.internal.DTDNode)
- */
- public void nodeChanged(final DTDNode node) {
- refreshTree(node);
- }
-
- public void nodesAdded(NodesEvent event) {
- if (fViewer instanceof AbstractTreeViewer) {
- StructuredViewer viewer = (StructuredViewer) fViewer;
- ISelection selection = viewer.getSelection();
-
- Object firstObj = (!selection.isEmpty() && selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- DTDNode oldSelectedNode = null;
- if (firstObj instanceof DTDNode) {
- oldSelectedNode = (DTDNode) firstObj;
- }
-
- //update the tree
- refreshTree(event);
-
- final List nodes = event.getNodes();
- if (!nodes.isEmpty()) {
- final DTDNode node = (DTDNode) nodes.get(0);
- if (oldSelectedNode == null || node.getStructuredDTDDocumentRegion() != oldSelectedNode.getStructuredDTDDocumentRegion() || node.getStartOffset() != oldSelectedNode.getStartOffset() || node.getEndOffset() != oldSelectedNode.getEndOffset()) {
- expandToNode(node);
- viewer.setSelection(new StructuredSelection(node));
- }
- }
- }
- }
-
- public void nodesRemoved(NodesEvent event) {
- if (fViewer instanceof AbstractTreeViewer) {
- AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
- for (Iterator iter = event.getNodes().iterator(); iter.hasNext();) {
- abstractTreeViewer.remove(iter.next());
- }
- }
-
- //update the tree
- refreshTree(event);
- }
-
- /**
- * Set the value of showLogicalOrder.
- *
- * @param value
- * Value to assign to showLogicalOrder.
- */
- public void setShowLogicalOrder(boolean value) {
- this.showLogicalOrder = value;
- if (!value) {
- // if not using logical order, lose the cached lists
- logicalNodeLists = null;
- }
- }
-
- /**
- * <p>Used to update the tree after a node event such as a node added or removed.</p>
- * @param event the {@link NodesEvent} that caused the tree to need updating
- */
- private void refreshTree(NodesEvent event) {
- for (Iterator it = event.getNodes().iterator(); it.hasNext();) {
- Object node = it.next();
- this.refreshTree(node);
-
- }
- }
-
- /**
- * <p>Refreshes the tree from the parents of the given node.</p>
- * @param node refresh the tree from the parents of this node
- */
- private void refreshTree(Object node) {
- List parents = getParents(node);
- if(parents.size() > 0) {
- for(int p = 0; p < parents.size(); ++p) {
- final Object parent = parents.get(p);
-
- // Bug 111100 - If it is a top level node (ie. parent is a
- // DTDFile),
- // insert the node directly to improve performance
- if (parent instanceof DTDFile) {
- Object[] objs = getChildren(parent);
- for (int i = 0; i < objs.length; i++) {
- if (objs[i] == node) {
- ((AbstractTreeViewer) fViewer).insert(parent, node, i);
- break;
- }
- }
- }
-
- this.refreshTreeNode(parent, true);
- }
- }
- }
-
- /**
- * @param element get the tree parents of this element
- * @return {@link List} of parents of the given element
- */
- private List getParents(Object element) {
- List parents = new ArrayList();
-
- Object parent = null;
- if (element instanceof DTDNode) {
- DTDNode node = (DTDNode) element;
- if (element instanceof Attribute) {
- parent = node.getParentNode();
- if (parent != null && parent instanceof AttributeList) {
- parents.addAll(getElementParentsOfAttributeList((AttributeList)parent));
- }
- } else if(element instanceof AttributeList) {
- parents.addAll(getElementParentsOfAttributeList((AttributeList)element));
- }
-
- // if showing in the logical order, return the IndexedNodeList
- // acting as a parent in the tree
- if (isShowLogicalOrder()) {
- Object[] indexedNodeLists = getChildren(((DTDModelImpl) fInputObject).getDTDFile());
- for (int i = 0; i < indexedNodeLists.length && parent == null; i++) {
- if (indexedNodeLists[i] instanceof NodeList) {
- if (((NodeList) indexedNodeLists[i]).getNodes().contains(element)) {
- parents.add(indexedNodeLists[i]);
- }
- }
- }
- }
-
- //try and get the simple parent
- parent = ((DTDNode) element).getParentNode();
- if(parent != null) {
- parents.add(parent);
- }
-
- //if no parents found must be new nodes so refresh from root
- if(parents.size() == 0) {
- parents.add(((DTDModelImpl) fInputObject).getDTDFile());
- }
- }else if (element instanceof NodeList && fInputObject instanceof DTDModelImpl) {
- parents.add(((DTDModelImpl) fInputObject).getDTDFile());
- }
-
- return parents;
- }
-
- /**
- * @param attList get the element parents of the given {@link AttributeList}
- * @return the element parents of the given {@link AttributeList}, if no parents
- * can be found the list contains the DTD file element
- */
- private List getElementParentsOfAttributeList(AttributeList attList) {
- List parents = new ArrayList();
- Iterator iterAttList = attList.getDTDFile().getNodes().iterator();
- while (iterAttList.hasNext()) {
- DTDNode currentNode = (DTDNode) iterAttList.next();
- if (currentNode instanceof Element &&
- currentNode.getName().equals(attList.getName())) {
-
- parents.add(currentNode);
- }
- }
-
- if(parents.size() == 0) {
- parents.add(((DTDModelImpl) fInputObject).getDTDFile());
- }
-
- return parents;
- }
-
- /**
- * <p>Executes a refresh on the {@link AbstractTreeViewer} for the given
- * node</p>
- *
- * @param node refresh the tree for this node
- * @param updateLabels <code>true</code> to update the labels on the tree,
- * <code>false</code> otherwise.
- */
- private void refreshTreeNode(final Object node, final boolean updateLabels) {
- fViewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (!fViewer.getControl().isDisposed()) {
- if(node != null) {
- ((AbstractTreeViewer) fViewer).refresh(node, updateLabels);
- } else {
- ((AbstractTreeViewer) fViewer).refresh(updateLabels);
- }
- }
- }
- });
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
deleted file mode 100644
index 227bc77269..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
+++ /dev/null
@@ -1,57 +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
- *
- *******************************************************************************/
-/*
- * Created on Jan 22, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-class OrderAction extends PropertyChangeUpdateAction {
- private DTDTreeContentProvider contentProvider;
- private TreeViewer treeViewer;
-
- public OrderAction(TreeViewer viewer, DTDTreeContentProvider provider, IPreferenceStore store, String preferenceKey) {
- super(DTDUIMessages._UI_BUTTON_GROUP_ITEMS_LOGICALLY, store, preferenceKey, false); //$NON-NLS-1$
- setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ORGANIZE_DTD_LOGICALLY));
- treeViewer = viewer;
- contentProvider = provider;
- setToolTipText(getText());
- contentProvider.setShowLogicalOrder(isChecked());
- }
-
- public void update() {
- super.update();
- treeViewer.getControl().setRedraw(false);
- setChecked(getPreferenceStore().getBoolean(getPreferenceKey()));
- Object[] expandedElements = treeViewer.getExpandedElements();
- ISelection selection = treeViewer.getSelection();
- contentProvider.setShowLogicalOrder(isChecked());
-
- // treeViewer.setInput(treeViewer.getInput());
- treeViewer.refresh(treeViewer.getInput());
-
- treeViewer.setExpandedElements(expandedElements);
- treeViewer.getControl().setRedraw(true);
- treeViewer.setSelection(selection);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index dc73f47389..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-class SortAction extends PropertyChangeUpdateAction {
- private TreeViewer treeViewer;
- private ViewerComparator fComparator;
-
- public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
- super(DTDUIMessages._UI_BUTTON_SORT_ITEMS, store, preferenceKey, false); //$NON-NLS-1$
- setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_SORT));
- setToolTipText(getText());
- fComparator = new DTDContentOutlineComparator();
- treeViewer = viewer;
- if (isChecked()) {
- treeViewer.setComparator(fComparator);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- super.update();
- treeViewer.getControl().setRedraw(false);
- Object[] expandedElements = treeViewer.getExpandedElements();
- if (isChecked()) {
- treeViewer.setComparator(fComparator);
- }
- else {
- treeViewer.setComparator(null);
- }
- treeViewer.setInput(treeViewer.getInput());
- treeViewer.setExpandedElements(expandedElements);
- treeViewer.getControl().setRedraw(true);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.properties b/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.properties
deleted file mode 100644
index 89682b9d95..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 STAR Standards for Technology in Automotive Retail
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# David Carver, STAR - initial API and implementation, bug 162321
-#
-###############################################################################
-Templates.xmldeclaration.name=xml declaration
-Templates.xmldeclaration.desc=xml declaration
diff --git a/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.xml b/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.xml
deleted file mode 100644
index b2c642283c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/templates/dtddefault-templates.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * Copyright (c) 2007 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - initial contribution, bug 162321
- *******************************************************************************/
- -->
-<templates>
- <template name="%Templates.xmldeclaration.name" description="%Templates.xmldeclaration.desc" id="org.eclipse.wst.dtd.ui.internal.templates.xmldeclaration" context="dtd_new" enabled="true">&lt;?xml version="1.0" encoding="${encoding}"?&gt;</template>
-</templates>
diff --git a/bundles/org.eclipse.wst.html.core/.classpath b/bundles/org.eclipse.wst.html.core/.classpath
deleted file mode 100644
index 2c6f8c1f34..0000000000
--- a/bundles/org.eclipse.wst.html.core/.classpath
+++ /dev/null
@@ -1,12 +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/**"/>
- </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.html.core/.cvsignore b/bundles/org.eclipse.wst.html.core/.cvsignore
deleted file mode 100644
index 02ca6cb2c7..0000000000
--- a/bundles/org.eclipse.wst.html.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-htmlmodel.jar
-temp.folder
-dev.properties
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.html.core/.options b/bundles/org.eclipse.wst.html.core/.options
deleted file mode 100644
index e66a59f041..0000000000
--- a/bundles/org.eclipse.wst.html.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.html.core/debug=true
-org.eclipse.wst.html.core/debug/tracefilter= \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/.project b/bundles/org.eclipse.wst.html.core/.project
deleted file mode 100644
index 13a9facdf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.html.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 17 01:48:39 EDT 2006
-eclipse.preferences.version=1
-line.separator=\r\n
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0667e35a52..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Wed Mar 28 03:23:07 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.wst.html.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Apr 17 01:48:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 061cd53dd0..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Mon Apr 17 02:01:33 EDT 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 8de08fc53d..0000000000
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.1.502.qualifier
-Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.core.internal;x-internal:=true,
- org.eclipse.wst.html.core.internal.cleanup;x-internal:=true,
- org.eclipse.wst.html.core.internal.commentelement.handlers;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.chtml;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.ssi;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.html.core.internal.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.document;x-internal:=true,
- org.eclipse.wst.html.core.internal.encoding;x-internal:=true,
- org.eclipse.wst.html.core.internal.format;x-internal:=true,
- org.eclipse.wst.html.core.internal.htmlcss;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelquery;x-internal:=true,
- org.eclipse.wst.html.core.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.validate;x-internal:=true,
- org.eclipse.wst.html.core.text
-Import-Package: com.ibm.icu.util; version="3.8"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.html.core.internal.contenttype,org.eclipse.wst.html.core.internal.provisional.contenttype"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.html.core/about.html b/bundles/org.eclipse.wst.html.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.html.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>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.html.core/build.properties b/bundles/org.eclipse.wst.html.core/build.properties
deleted file mode 100644
index 5c655fd4aa..0000000000
--- a/bundles/org.eclipse.wst.html.core/build.properties
+++ /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
-###############################################################################
-bin.includes = plugin.xml,\
- .options,\
- data/,\
- plugin.properties,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = component.xml
-source.. = src/
diff --git a/bundles/org.eclipse.wst.html.core/component.xml b/bundles/org.eclipse.wst.html.core/component.xml
deleted file mode 100644
index 8565aecd93..0000000000
--- a/bundles/org.eclipse.wst.html.core/component.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.html">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.html.core" fragment="false" />
- <plugin id="org.eclipse.wst.html.standard.dtds" fragment="false" />
- <plugin id="org.eclipse.wst.html.ui" fragment="false" />
- <description url="http://eclipse.org/webtools/wst/components/html/overview.html" />
- <package name="org.eclipse.wst.html.ui" api="false">
- <type name="StructuredTextViewerConfigurationHTML" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.html.ui.views.contentoutline" api="false">
- <type name="HTMLContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.html.ui.infopop" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.properties b/bundles/org.eclipse.wst.html.core/data/htmref.properties
deleted file mode 100644
index 9cd460d81e..0000000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.properties
+++ /dev/null
@@ -1,108 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ATagInfo=A link if the href attribute is present, and the target for a link if the name attribute is present
-ABBRTagInfo=An abbreviation (for example, WWW, HTTP)
-ACRONYMTagInfo=An acronym (for example, SCUBA)
-ADDRESSTagInfo=Address information for the author of the page
-APPLETTagInfo=A Java applet
-AREATagInfo=Defines a client-side image map area
-BTagInfo=Displays contained text as bold
-BASETagInfo=The base URI for the page, to be used when calculating relative paths
-BASEFONTTagInfo=The base font size for the page
-BDOTagInfo=Overrides default bidirectional display. For use with bidirectional languages.
-BIGTagInfo=Displays contained text as large
-BGSOUNDTagInfo=Defines a sound file for the page. Not supported by W3C HTML 4.01.
-BLINKTagInfo=Displays text as blinking. Not supported by W3C HTML 4.01.
-BLOCKQUOTETagInfo=A long quotation
-BODYTagInfo=The document body. Contains all the content for the page.
-BRTagInfo=Forces a line break
-BUTTONTagInfo=Defines a push button
-CAPTIONTagInfo=Defines a table caption
-CENTERTagInfo=Displays contained text centered. Equivalent to DIV with align=center.
-CITETagInfo=A citation
-CODETagInfo=A computer code fragment
-COLTagInfo=A table column
-COLGROUPTagInfo=A group of table columns
-DDTagInfo=A definition or description in a definition or description list
-DELTagInfo=Displays text as deleted
-DFNTagInfo=A definition
-DIRTagInfo=A directory listing
-DIVTagInfo=A generic container, which can be used for defining language or style for the contents
-DLTagInfo=A definition or description list
-DTTagInfo=A term or subject in a definition or description list
-EMTagInfo=Displays text emphasized (generally italicized)
-EMBEDTagInfo=Defines an embedded plug-in. Not supported by W3C HTML 4.01.
-FIELDSETTagInfo=Defines a form control group
-FONTTagInfo=Displays text in the given font
-FORMTagInfo=Defines an interactive form
-FRAMETagInfo=Defines a frame within the current window
-FRAMESETTagInfo=Defines a frameset that divides the window into frames
-H1TagInfo=A top-level heading
-H2TagInfo=A second-level heading
-H3TagInfo=A third-level heading
-H4TagInfo=A fourth-level heading
-H5TagInfo=A fifth-level heading
-H6TagInfo=A sixth-level heading
-HEADTagInfo=Contains metadata and window title information for the document
-HRTagInfo=A horizontal rule
-HTMLTagInfo=The root element for the document.
-ITagInfo=Displays text as italic
-IFRAMETagInfo=Defines an inline subwindow
-IMGTagInfo=Displays the referenced image as embedded content
-INPUTTagInfo=Defines a form control for user input
-INSTagInfo=Defines inserted text
-ISINDEXTagInfo=Defines a single line prompt
-KBDTagInfo=Defines text to be entered by the user
-LABELTagInfo=Defines the label for a form field
-LEGENDTagInfo=Defines the label for a set of form fields
-LITagInfo=Defines a list item within a list
-LINKTagInfo=A media-independent link
-MAPTagInfo=Defines a client-side image map
-MARQUEETagInfo=Displays text as scrolling. Not supported by W3C HTML 4.01.
-MENUTagInfo=Defines a menu list
-METATagInfo=Defines metadata information for the document
-NOBRTagInfo=Overrides and prevents line breaks. Not supported by W3C HTML 4.01.
-NOFRAMESTagInfo=Provides information to display if the current browser does not support frames
-NOSCRIPTTagInfo=Provides information to display if the current browser does not support scripting
-OBJECTTagInfo=Defines a generic embedded object
-OLTagInfo=An ordered list
-OPTGROUPTagInfo=An option group
-OPTIONTagInfo=A selectable choice
-PTagInfo=A paragraph
-PARAMTagInfo=A named property value
-PRETagInfo=Preformatted text
-QTagInfo=A short inline quotation
-STagInfo=Display text in strike-through style
-SAMPTagInfo=Sample program output, scripts, etc. Displays in monospace font.
-SCRIPTTagInfo=Script statements
-SELECTTagInfo=An option selector
-SMALLTagInfo=Displays text as small
-SPANTagInfo=A generic container, which can be used for defining language or style for the contents
-STRIKETagInfo=Display text in strike-through style
-STRONGTagInfo=Displays text as strongly emphasized (generally bold)
-STYLETagInfo=Defines a style for the contained information
-SUBTagInfo=Display as subscript
-SUPTagInfo=Display as superscript
-TABLETagInfo=Defines a table
-TBODYTagInfo=The body of the table
-TDTagInfo=A cell within a table
-TEXTAREATagInfo=A multi-line text field
-TFOOTTagInfo=A table footer
-THTagInfo=A table header cell
-THEADTagInfo=A table header
-TITLETagInfo=The document title, displayed in the browser's title bar
-TRTagInfo=A table row
-TTTagInfo=Displays text in teletype or monospaced text style
-UTagInfo=Displays text as underlined
-ULTagInfo=An unordered list
-VARTagInfo=An instance of a variable or program argument
-WBRTagInfo=Allows a line break within <B>&lt;NOBR&gt;</B> tag. Not supported by W3C HTML 4.01.
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.xml b/bundles/org.eclipse.wst.html.core/data/htmref.xml
deleted file mode 100644
index c7bcd64385..0000000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.xml
+++ /dev/null
@@ -1,306 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
- -->
-<abstractGrammarAnnotations propertiesLocation="htmref" caseSensitive="false">
- <annotation spec="A">
- <property name="tagInfo">%ATagInfo</property>
- </annotation>
- <annotation spec="ABBR">
- <property name="tagInfo">%ABBRTagInfo</property>
- </annotation>
- <annotation spec="ACRONYM">
- <property name="tagInfo">%ACRONYMTagInfo</property>
- </annotation>
- <annotation spec="ADDRESS">
- <property name="tagInfo">%ADDRESSTagInfo</property>
- </annotation>
- <annotation spec="APPLET">
- <property name="tagInfo">%APPLETTagInfo</property>
- </annotation>
- <annotation spec="AREA">
- <property name="tagInfo">%AREATagInfo</property>
- </annotation>
- <annotation spec="B">
- <property name="tagInfo">%BTagInfo</property>
- </annotation>
- <annotation spec="BASE">
- <property name="tagInfo">%BASETagInfo</property>
- </annotation>
- <annotation spec="BASEFONT">
- <property name="tagInfo">%BASEFONTTagInfo</property>
- </annotation>
- <annotation spec="BDO">
- <property name="tagInfo">%BDOTagInfo</property>
- </annotation>
- <annotation spec="BGSOUND">
- <property name="tagInfo">%BGSOUNDTagInfo</property>
- </annotation>
- <annotation spec="BIG">
- <property name="tagInfo">%BIGTagInfo</property>
- </annotation>
- <annotation spec="BLINK">
- <property name="tagInfo">%BLINKTagInfo</property>
- </annotation>
- <annotation spec="BLOCKQUOTE">
- <property name="tagInfo">%BLOCKQUOTETagInfo</property>
- </annotation>
- <annotation spec="BODY">
- <property name="tagInfo">%BODYTagInfo</property>
- </annotation>
- <annotation spec="BR">
- <property name="tagInfo">%BRTagInfo</property>
- </annotation>
- <annotation spec="BUTTON">
- <property name="tagInfo">%BUTTONTagInfo</property>
- </annotation>
- <annotation spec="CAPTION">
- <property name="tagInfo">%CAPTIONTagInfo</property>
- </annotation>
- <annotation spec="CENTER">
- <property name="tagInfo">%CENTERTagInfo</property>
- </annotation>
- <annotation spec="CITE">
- <property name="tagInfo">%CITETagInfo</property>
- </annotation>
- <annotation spec="CODE">
- <property name="tagInfo">%CODETagInfo</property>
- </annotation>
- <annotation spec="COL">
- <property name="tagInfo">%COLTagInfo</property>
- </annotation>
- <annotation spec="COLGROUP">
- <property name="tagInfo">%COLGROUPTagInfo</property>
- </annotation>
- <annotation spec="DD">
- <property name="tagInfo">%DDTagInfo</property>
- </annotation>
- <annotation spec="DEL">
- <property name="tagInfo">%DELTagInfo</property>
- </annotation>
- <annotation spec="DFN">
- <property name="tagInfo">%DFNTagInfo</property>
- </annotation>
- <annotation spec="DIR">
- <property name="tagInfo">%DIRTagInfo</property>
- </annotation>
- <annotation spec="DIV">
- <property name="tagInfo">%DIVTagInfo</property>
- </annotation>
- <annotation spec="DL">
- <property name="tagInfo">%DLTagInfo</property>
- </annotation>
- <annotation spec="DT">
- <property name="tagInfo">%DTTagInfo</property>
- </annotation>
- <annotation spec="EM">
- <property name="tagInfo">%EMTagInfo</property>
- </annotation>
- <annotation spec="EMBED">
- <property name="tagInfo">%EMBEDTagInfo</property>
- </annotation>
- <annotation spec="FIELDSET">
- <property name="tagInfo">%FIELDSETTagInfo</property>
- </annotation>
- <annotation spec="FONT">
- <property name="tagInfo">%FONTTagInfo</property>
- </annotation>
- <annotation spec="FORM">
- <property name="tagInfo">%FORMTagInfo</property>
- </annotation>
- <annotation spec="FRAME">
- <property name="tagInfo">%FRAMETagInfo</property>
- </annotation>
- <annotation spec="FRAMESET">
- <property name="tagInfo">%FRAMESETTagInfo</property>
- </annotation>
- <annotation spec="H1">
- <property name="tagInfo">%H1TagInfo</property>
- </annotation>
- <annotation spec="H2">
- <property name="tagInfo">%H2TagInfo</property>
- </annotation>
- <annotation spec="H3">
- <property name="tagInfo">%H3TagInfo</property>
- </annotation>
- <annotation spec="H4">
- <property name="tagInfo">%H4TagInfo</property>
- </annotation>
- <annotation spec="H5">
- <property name="tagInfo">%H5TagInfo</property>
- </annotation>
- <annotation spec="H6">
- <property name="tagInfo">%H6TagInfo</property>
- </annotation>
- <annotation spec="HEAD">
- <property name="tagInfo">%HEADTagInfo</property>
- </annotation>
- <annotation spec="HR">
- <property name="tagInfo">%HRTagInfo</property>
- </annotation>
- <annotation spec="HTML">
- <property name="tagInfo">%HTMLTagInfo</property>
- </annotation>
- <annotation spec="I">
- <property name="tagInfo">%ITagInfo</property>
- </annotation>
- <annotation spec="IFRAME">
- <property name="tagInfo">%IFRAMETagInfo</property>
- </annotation>
- <annotation spec="IMG">
- <property name="tagInfo">%IMGTagInfo</property>
- </annotation>
- <annotation spec="INPUT">
- <property name="tagInfo">%INPUTTagInfo</property>
- </annotation>
- <annotation spec="INS">
- <property name="tagInfo">%INSTagInfo</property>
- </annotation>
- <annotation spec="ISINDEX">
- <property name="tagInfo">%ISINDEXTagInfo</property>
- </annotation>
- <annotation spec="KBD">
- <property name="tagInfo">%KBDTagInfo</property>
- </annotation>
- <annotation spec="LABEL">
- <property name="tagInfo">%LABELTagInfo</property>
- </annotation>
- <annotation spec="LEGEND">
- <property name="tagInfo">%LEGENDTagInfo</property>
- </annotation>
- <annotation spec="LI">
- <property name="tagInfo">%LITagInfo</property>
- </annotation>
- <annotation spec="LINK">
- <property name="tagInfo">%LINKTagInfo</property>
- </annotation>
- <annotation spec="MAP">
- <property name="tagInfo">%MAPTagInfo</property>
- </annotation>
- <annotation spec="MARQUEE">
- <property name="tagInfo">%MARQUEETagInfo</property>
- </annotation>
- <annotation spec="MENU">
- <property name="tagInfo">%MENUTagInfo</property>
- </annotation>
- <annotation spec="META">
- <property name="tagInfo">%METATagInfo</property>
- </annotation>
- <annotation spec="NOBR">
- <property name="tagInfo">%NOBRTagInfo</property>
- </annotation>
- <annotation spec="NOFRAMES">
- <property name="tagInfo">%NOFRAMESTagInfo</property>
- </annotation>
- <annotation spec="NOSCRIPT">
- <property name="tagInfo">%NOSCRIPTTagInfo</property>
- </annotation>
- <annotation spec="OBJECT">
- <property name="tagInfo">%OBJECTTagInfo</property>
- </annotation>
- <annotation spec="OL">
- <property name="tagInfo">%OLTagInfo</property>
- </annotation>
- <annotation spec="OPTGROUP">
- <property name="tagInfo">%OPTGROUPTagInfo</property>
- </annotation>
- <annotation spec="OPTION">
- <property name="tagInfo">%OPTIONTagInfo</property>
- </annotation>
- <annotation spec="P">
- <property name="tagInfo">%PTagInfo</property>
- </annotation>
- <annotation spec="PARAM">
- <property name="tagInfo">%PARAMTagInfo</property>
- </annotation>
- <annotation spec="PRE">
- <property name="tagInfo">%PRETagInfo</property>
- </annotation>
- <annotation spec="Q">
- <property name="tagInfo">%QTagInfo</property>
- </annotation>
- <annotation spec="S">
- <property name="tagInfo">%STagInfo</property>
- </annotation>
- <annotation spec="SAMP">
- <property name="tagInfo">%SAMPTagInfo</property>
- </annotation>
- <annotation spec="SCRIPT">
- <property name="tagInfo">%SCRIPTTagInfo</property>
- </annotation>
- <annotation spec="SELECT">
- <property name="tagInfo">%SELECTTagInfo</property>
- </annotation>
- <annotation spec="SMALL">
- <property name="tagInfo">%SMALLTagInfo</property>
- </annotation>
- <annotation spec="SPAN">
- <property name="tagInfo">%SPANTagInfo</property>
- </annotation>
- <annotation spec="STRIKE">
- <property name="tagInfo">%STRIKETagInfo</property>
- </annotation>
- <annotation spec="STRONG">
- <property name="tagInfo">%STRONGTagInfo</property>
- </annotation>
- <annotation spec="STYLE">
- <property name="tagInfo">%STYLETagInfo</property>
- </annotation>
- <annotation spec="SUB">
- <property name="tagInfo">%SUBTagInfo</property>
- </annotation>
- <annotation spec="SUP">
- <property name="tagInfo">%SUPTagInfo</property>
- </annotation>
- <annotation spec="TABLE">
- <property name="tagInfo">%TABLETagInfo</property>
- </annotation>
- <annotation spec="TBODY">
- <property name="tagInfo">%TBODYTagInfo</property>
- </annotation>
- <annotation spec="TD">
- <property name="tagInfo">%TDTagInfo</property>
- </annotation>
- <annotation spec="TEXTAREA">
- <property name="tagInfo">%TEXTAREATagInfo</property>
- </annotation>
- <annotation spec="TFOOT">
- <property name="tagInfo">%TFOOTTagInfo</property>
- </annotation>
- <annotation spec="TH">
- <property name="tagInfo">%THTagInfo</property>
- </annotation>
- <annotation spec="THEAD">
- <property name="tagInfo">%THEADTagInfo</property>
- </annotation>
- <annotation spec="TITLE">
- <property name="tagInfo">%TITLETagInfo</property>
- </annotation>
- <annotation spec="TR">
- <property name="tagInfo">%TRTagInfo</property>
- </annotation>
- <annotation spec="TT">
- <property name="tagInfo">%TTTagInfo</property>
- </annotation>
- <annotation spec="U">
- <property name="tagInfo">%UTagInfo</property>
- </annotation>
- <annotation spec="UL">
- <property name="tagInfo">%ULTagInfo</property>
- </annotation>
- <annotation spec="VAR">
- <property name="tagInfo">%VARTagInfo</property>
- </annotation>
- <annotation spec="WBR">
- <property name="tagInfo">%WBRTagInfo</property>
- </annotation>
-</abstractGrammarAnnotations> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
deleted file mode 100644
index 14b6fdc807..0000000000
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source HTML Model
-Structured_HTML_Document_Factory_Extension.name=Structured HTML Document Factory Extension
-HTML_Content_Type_Extension_Element.name=HTML
-_taskMarker.name=HTML Task
-_validationMarker.name=HTML Problem
diff --git a/bundles/org.eclipse.wst.html.core/plugin.xml b/bundles/org.eclipse.wst.html.core/plugin.xml
deleted file mode 100644
index 36c08f80af..0000000000
--- a/bundles/org.eclipse.wst.html.core/plugin.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- default="no"
- class="org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML"
- associatedContentTypeId="org.eclipse.wst.html.core.htmlsource"
- id="org.eclipse.wst.html.core.internal.modelhandler">
- </modelHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.embeddedTypeHandler">
- <embeddedTypeHandler
- class="org.eclipse.wst.html.core.internal.modelhandler.EmbeddedHTML">
- </embeddedTypeHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.taskscanner">
- <scanner
- id="org.eclipse.wst.html.core.internal.tasks.HTMLFileTaskScanner"
- class="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner:org.eclipse.wst.html.core.taskMarker"
- contentTypeIds="org.eclipse.wst.html.core.htmlsource" />
- </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
- id="validationMarker"
- name="%_validationMarker.name"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <persistent value="true"/>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.html.core.documentfactories"
- name="%Structured_HTML_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.commentElementHandler">
- <handler-custom
- commenttype="xml"
- class="org.eclipse.wst.html.core.internal.commentelement.handlers.CommentElementHandlerForSSI">
- <startwith prefix="#"></startwith>
- </handler-custom>
- </extension>
-
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="html">
- </fileTypes>
- <fileTypes
- type="text"
- extension="htm">
- </fileTypes>
- <fileTypes
- type="text"
- extension="xhtml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="htpl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="wml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="shtml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="shtm">
- </fileTypes>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl"
- contentTypeId="org.eclipse.wst.html.core.htmlsource">
- </processor>
- </extension>
-
- <!-- Extension point for taghelp documentation -->
- <extension point="org.eclipse.wst.xml.core.annotationFiles">
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Strict//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Transitional//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Frameset//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML Basic 1.0//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.1//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//WAPFORUM//DTD XHTML Mobile 1.0//EN">
- </annotationFile>
- </extension>
-
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- file-extensions="html,htm,xhtml,htpl,wml,shtml,shtm"
- priority="high"
- name="%HTML_Content_Type_Extension_Element.name"
- id="org.eclipse.wst.html.core.htmlsource"
- base-type="org.eclipse.core.runtime.text">
- <!-- note: no default-charset for HTML, should use 'platform' -->
- <describer
- class="org.eclipse.wst.html.core.internal.contenttype.ContentDescriberForHTML" />
- </content-type>
- </extension>
-
-<!-- moved to where the dtd's are contributed
-
- <extension point="org.eclipse.wst.sse.core.documentTypes">
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Strict"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Strict//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Transitional"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Transitional//EN"
- defaultXHTML="true"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Frameset"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="true"
- publicID="-//W3C//DTD XHTML 1.0 Frameset//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML Basic 1.0"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML Basic 1.0//EN"
- systemID="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.1"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.1//EN"
- systemID="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML MP 1.0"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- systemID="http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
- </documentType>
- <documentType
- elementName="wml"
- displayName="WML 1.3"
- namespaceURI=""
- isWML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD WML 1.3//EN"
- defaultWML="true"
- systemID="http://www.wapforum.org/DTD/wml13.dtd">
- </documentType>
- </extension>
--->
- <!-- initialize html core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceInitializer" />
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java
deleted file mode 100644
index ce33f1d6c0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class HTMLContentBuilder extends DOMContentBuilderImpl {
-
- private int fTagCase;
- private int fAttrCase;
-
- /**
- * DOMContentBuilder constructor comment.
- * @param document org.w3c.dom.Document
- */
- public HTMLContentBuilder(Document document) {
- super(document);
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
- fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- // Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
- // fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
- // fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
- }
-
- public String computeName(CMNode cmnode, Node parent) {
- String name = super.computeName(cmnode, parent);
- // don't change the case unless we're certain it is meaningless
- // if (cmnode instanceof HTMLCMNode && ((HTMLCMNode) cmnode).shouldIgnoreCase()) {
- if (shouldIgnoreCase(cmnode)) {
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (fTagCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fTagCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fAttrCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- }
- return name;
-
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
deleted file mode 100644
index b1a868a788..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML Core
- *
- * @plannedfor 1.0
- */
-public class HTMLCoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.html.core.internal.HTMLCorePluginResources";//$NON-NLS-1$
-
- public static String No_error__UI_;
- public static String Undefined_attribute_name___ERROR_;
- public static String Undefined_attribute_value__ERROR_;
- public static String Multiple_values_specified__ERROR_;
- public static String Attribute_name___0___uses__ERROR_;
- public static String Invalid_attribute_name___0_ERROR_;
- public static String Invalid_attribute___0____ERROR_;
- public static String Invalid_location_of_tag____ERROR_;
- public static String Duplicate_tag___0____ERROR_;
- public static String No_start_tag____0_____ERROR_;
- public static String No_end_tag_____0_____ERROR_;
- public static String End_tag_____0____not_neede_ERROR_;
- public static String Unknown_tag___0____ERROR_;
- public static String Tag_name___0___uses_wrong__ERROR_;
- public static String Invalid_tag_name___0____ERROR_;
- public static String Invalid_JSP_directive___0__ERROR_;
- public static String Invalid_text_string___0____ERROR_;
- public static String Invalid_character_used_in__ERROR_;
- public static String Unknown_error__ERROR_;
- public static String Start_tag____0____not_clos_ERROR_;
- public static String End_tag_____0____not_close_ERROR_;
- public static String Attribute_value___0___uses_ERROR_;
- public static String Comment_not_closed__ERROR_;
- public static String DOCTYPE_declaration_not_cl_ERROR_;
- public static String Processing_instruction_not_ERROR_;
- public static String CDATA_section_not_closed__ERROR_;
- public static String _ERROR_Tag___0___should_be_an_empty_element_tag_1;
- public static String _ERROR_Attribute_value___0___not_closed__1;
- public static String HTMLContentPropertiesManager_Updating;
- public static String HTMLContentPropertiesManager_Problems_Updating;
- public static String _ERROR_Resource_not_found_0;
- public static String Obsolete_attribute_name___ERROR_;
- public static String Obsolete_tag___ERROR_;
- public static String Invalid_text_in_tag__ERROR_;
- public static String Missing_attribute_value_equals_ERROR_;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, HTMLCoreMessages.class);
- }
-
- private HTMLCoreMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
deleted file mode 100644
index d1a486b526..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentPropertiesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLCorePlugin extends Plugin {
- // The shared instance.
- private static HTMLCorePlugin plugin;
-
- /**
- * The constructor.
- */
- public HTMLCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static HTMLCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- // listen for resource changes to update content properties keys
- HTMLContentPropertiesManager.startup();
- }
-
- public void stop(BundleContext context) throws Exception {
- // stop listenning for resource changes to update content properties
- // keys
- HTMLContentPropertiesManager.shutdown();
-
- super.stop(context);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
deleted file mode 100644
index b6b3ebfe5a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-No_error__UI_=No error.
-Undefined_attribute_name___ERROR_=Undefined attribute name ({0}).
-Undefined_attribute_value__ERROR_=Undefined attribute value ({0}).
-Multiple_values_specified__ERROR_=Multiple values specified for an attribute ({0}).
-Attribute_name___0___uses__ERROR_=Attribute name ({0}) uses wrong case character.
-Invalid_attribute_name___0_ERROR_=Invalid attribute name ({0}).
-Invalid_attribute___0____ERROR_=Invalid attribute ({0}).
-Invalid_location_of_tag____ERROR_=Invalid location of tag ({0}).
-Duplicate_tag___0____ERROR_=Duplicate tag ({0}).
-No_start_tag____0_____ERROR_=No start tag (<{0}>).
-No_end_tag_____0_____ERROR_=No end tag (</{0}>).
-End_tag_____0____not_neede_ERROR_=End tag (</{0}>) not needed.
-Unknown_tag___0____ERROR_=Unknown tag ({0}).
-Tag_name___0___uses_wrong__ERROR_=Tag name ({0}) uses wrong case character.
-Invalid_tag_name___0____ERROR_=Invalid tag name ({0}).
-Invalid_JSP_directive___0__ERROR_=Invalid JSP directive ({0}).
-Invalid_text_string___0____ERROR_=Invalid text string ({0}).
-Invalid_character_used_in__ERROR_=Invalid character used in text string ({0}).
-Unknown_error__ERROR_=Unknown error.
-Start_tag____0____not_clos_ERROR_=Start tag (<{0}>) not closed properly, expected '>'.
-End_tag_____0____not_close_ERROR_=End tag (</{0}>) not closed properly, expected '>'.
-Attribute_value___0___uses_ERROR_=Attribute value ({0}) uses wrong case character.
-Comment_not_closed__ERROR_=Comment not closed.
-DOCTYPE_declaration_not_cl_ERROR_=DOCTYPE declaration not closed.
-Processing_instruction_not_ERROR_=Processing instruction not closed.
-CDATA_section_not_closed__ERROR_=CDATA section not closed.
-Invalid_text_in_tag__ERROR_=Invalid location of text ({0}) in tag (<{1}>).
-# From here, the new messages are added for V5
-_ERROR_Tag___0___should_be_an_empty_element_tag_1=Tag ({0}) should be an empty-element tag.
-_ERROR_Attribute_value___0___not_closed__1=Attribute value ({0}) not closed.
-#
-HTMLContentPropertiesManager_Updating=Updating Web Content Settings
-HTMLContentPropertiesManager_Problems_Updating=Problem saving Web Content Settings for {0}
-_ERROR_Resource_not_found_0=Resource not found: {0}
-Obsolete_attribute_name___ERROR_=Attribute ({0}) is obsolete. Its use is discouraged in HTML5 documents.
-Obsolete_tag___ERROR_=Element ({0}) is obsolete. Its use is discouraged in HTML5 documents.
-Missing_attribute_value_equals_ERROR_=Attribute name ({0}) must be followed by the ''='' character. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
deleted file mode 100644
index c547950d06..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if desired,
- * the console. This class should only be used by classes in this plugin. Other
- * plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.core"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message text to add to the log
- * @param exception exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- * @param message text to print
- * @param category category of the message, to be compared with /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java
deleted file mode 100644
index b4356102ab..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-abstract class AbstractNodeCleanupHandler implements IStructuredCleanupHandler {
-
- protected IStructuredCleanupPreferences fCleanupPreferences = null;
- protected IProgressMonitor fProgressMonitor = null;
-
- public void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences) {
-
- fCleanupPreferences = cleanupPreferences;
- }
-
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
- fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
-
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
-
- fProgressMonitor = progressMonitor;
- }
-
- static protected StructuredDocumentEvent replaceSource(IDOMModel model, Object requester, int offset, int length, String source) {
-
- StructuredDocumentEvent result = null;
- if (model == null)
- return result;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return result;
- if (source == null)
- source = new String();
- if (structuredDocument.containsReadOnly(offset, length))
- return result;
- if (requester == null) {
- requester = structuredDocument;
- }
- return structuredDocument.replaceText(requester, offset, length, source);
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
deleted file mode 100644
index 7a2b246877..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
+++ /dev/null
@@ -1,91 +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.html.core.internal.cleanup;
-
-
-
-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.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove
-
-public class CSSTextNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- public Node cleanup(Node node) {
- if (node == null)
- return node;
- IDOMModel model = ((IDOMNode) node).getModel();
- if (model == null)
- return node;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return node;
- if ( !getCleanupPreferences().getFormatSource())
- return node;
-
- String content = getCSSContent(node);
- if (content == null)
- return node;
-
- int offset = ((IDOMNode) node).getStartOffset();
- int length = ((IDOMNode) node).getEndOffset() - offset;
- replaceSource(model, this, offset, length, content);
- return (IDOMNode) model.getIndexedRegion(offset);
- }
-
- /**
- */
- private String getCSSContent(Node text) {
- ICSSModel model = getCSSModel(text);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
- // try another way to get formatter
- if (formatter == null)
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
- if (formatter == null)
- return null;
- StringBuffer buffer = formatter.cleanup(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private ICSSModel getCSSModel(Node text) {
- if (text == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) text.getParentNode();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
- return styleAdapter.getModel();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
deleted file mode 100644
index 841dfa93ec..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,763 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * David Carver (Intalion) - Cleanup Repeated Conditional check in isXMLType method
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class ElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- /** Non-NLS strings */
- protected static final String START_TAG_OPEN = "<"; //$NON-NLS-1$
- protected static final String END_TAG_OPEN = "</"; //$NON-NLS-1$
- protected static final String TAG_CLOSE = ">"; //$NON-NLS-1$
- protected static final String EMPTY_TAG_CLOSE = "/>"; //$NON-NLS-1$
- protected static final String SINGLE_QUOTES = "''"; //$NON-NLS-1$
- protected static final String DOUBLE_QUOTES = "\"\""; //$NON-NLS-1$
- protected static final char SINGLE_QUOTE = '\''; //$NON-NLS-1$
- protected static final char DOUBLE_QUOTE = '\"'; //$NON-NLS-1$
-
- public Node cleanup(Node node) {
- IDOMNode renamedNode = (IDOMNode) cleanupChildren(node);
-
- // call quoteAttrValue() first so it will close any unclosed attr
- // quoteAttrValue() will return the new start tag if there is a
- // structure change
- renamedNode = quoteAttrValue(renamedNode);
-
- // insert tag close if missing
- // if node is not comment tag
- // and not implicit tag
- if (!((IDOMElement) renamedNode).isCommentTag() && (renamedNode.getStartStructuredDocumentRegion() != null)) {
- IDOMModel structuredModel = renamedNode.getModel();
-
- // save start offset before insertTagClose()
- // or else renamedNode.getStartOffset() will be zero if
- // renamedNode replaced by insertTagClose()
- int startTagStartOffset = renamedNode.getStartOffset();
-
- // for start tag
- IStructuredDocumentRegion startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
- insertTagClose(structuredModel, startTagStructuredDocumentRegion);
-
- // update renamedNode and startTagStructuredDocumentRegion after
- // insertTagClose()
- renamedNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
- startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
-
- // for end tag
- IStructuredDocumentRegion endTagStructuredDocumentRegion = renamedNode.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion != startTagStructuredDocumentRegion)
- insertTagClose(structuredModel, endTagStructuredDocumentRegion);
- }
-
- // call insertMissingTags() next, it will generate implicit tags if
- // there are any
- // insertMissingTags() will return the new missing start tag if one is
- // missing
- // then compress any empty element tags
- // applyTagNameCase() will return the renamed node.
- // The renamed/new node will be saved and returned to caller when all
- // cleanup is done.
- renamedNode = insertMissingTags(renamedNode);
- renamedNode = compressEmptyElementTag(renamedNode);
- renamedNode = insertRequiredAttrs(renamedNode);
- renamedNode = applyTagNameCase(renamedNode);
- applyAttrNameCase(renamedNode);
- cleanupCSSAttrValue(renamedNode);
-
- return renamedNode;
- }
-
- /**
- * Checks if cleanup should modify case. Returns true case should be
- * preserved, false otherwise.
- *
- * @param element
- * @return true if element is case sensitive, false otherwise
- */
- private boolean shouldPreserveCase(IDOMElement element) {
- // case option can be applied to no namespace tags
- return !element.isGlobalTag();
- /*
- * ModelQueryAdapter mqadapter = (ModelQueryAdapter)
- * element.getAdapterFor(ModelQueryAdapter.class); ModelQuery mq =
- * null; CMNode nodedecl = null; if (mqadapter != null) mq =
- * mqadapter.getModelQuery(); if (mq != null) nodedecl =
- * mq.getCMNode(node); // if a Node isn't recognized as HTML or is and
- * cares about case, do not alter it // if (nodedecl == null ||
- * (nodedecl instanceof HTMLCMNode && ((HTMLCMNode)
- * nodedecl).shouldIgnoreCase())) if (!
- * nodedecl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)) return
- * false; return
- * ((Boolean)cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- */
- }
-
- /**
- * Checks if cleanup should force modifying element name to all lowercase.
- *
- * @param element
- * @return true if cleanup should lowercase element name, false otherwise
- */
- private boolean isXMLTag(IDOMElement element) {
- return element.isXMLTag();
- }
-
- protected void applyAttrNameCase(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return; // do nothing
-
- int attrNameCase = HTMLCorePreferenceNames.ASIS;
- if (!shouldPreserveCase(element)) {
- if (isXMLTag(element))
- attrNameCase = HTMLCorePreferenceNames.LOWER;
- else
- attrNameCase = getCleanupPreferences().getAttrNameCase();
- }
-
- NamedNodeMap attributes = node.getAttributes();
- int attributesLength = attributes.getLength();
-
- for (int i = 0; i < attributesLength; i++) {
- IDOMNode eachAttr = (IDOMNode) attributes.item(i);
- if (hasNestedRegion(eachAttr.getNameRegion()))
- continue;
- String oldAttrName = eachAttr.getNodeName();
- String newAttrName = oldAttrName;
- /*
- * 254961 - all HTML tag names and attribute names should be in
- * English even for HTML files in other languages like Japanese or
- * Turkish. English locale should be used to convert between
- * uppercase and lowercase (otherwise "link" would be converted to
- * Turkish "I Overdot Capital").
- */
- if (attrNameCase == HTMLCorePreferenceNames.LOWER)
- newAttrName = oldAttrName.toLowerCase(Locale.US);
- else if (attrNameCase == HTMLCorePreferenceNames.UPPER)
- newAttrName = oldAttrName.toUpperCase(Locale.US);
-
- if (newAttrName.compareTo(oldAttrName) != 0) {
- int attrNameStartOffset = eachAttr.getStartOffset();
- int attrNameLength = oldAttrName.length();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, attrNameStartOffset, attrNameLength, newAttrName);
- }
- }
- }
-
- /**
- * True if container has nested regions, meaning container is probably too
- * complicated (like JSP regions) to validate with this validator.
- */
- private boolean hasNestedRegion(ITextRegion container) {
- if (!(container instanceof ITextRegionContainer))
- return false;
- ITextRegionList regions = ((ITextRegionContainer) container).getRegions();
- if (regions == null)
- return false;
- return true;
- }
-
- protected IDOMNode applyTagNameCase(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- int tagNameCase = HTMLCorePreferenceNames.ASIS;
-
- if (!shouldPreserveCase(element)) {
- if (isXMLTag(element))
- tagNameCase = HTMLCorePreferenceNames.LOWER;
- else
- tagNameCase = getCleanupPreferences().getTagNameCase();
- }
-
- String oldTagName = node.getNodeName();
- String newTagName = oldTagName;
- IDOMNode newNode = node;
-
- /*
- * 254961 - all HTML tag names and attribute names should be in
- * English even for HTML files in other languages like Japanese or
- * Turkish. English locale should be used to convert between uppercase
- * and lowercase (otherwise "link" would be converted to Turkish "I
- * Overdot Capital").
- */
- if (tagNameCase == HTMLCorePreferenceNames.LOWER)
- newTagName = oldTagName.toLowerCase(Locale.US);
- else if (tagNameCase == HTMLCorePreferenceNames.UPPER)
- newTagName = oldTagName.toUpperCase(Locale.US);
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startTagStructuredDocumentRegion != null) {
- ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
- if (regions != null && regions.size() > 0) {
- ITextRegion startTagNameRegion = regions.get(1);
- int startTagNameStartOffset = startTagStructuredDocumentRegion.getStartOffset(startTagNameRegion);
- int startTagNameLength = startTagStructuredDocumentRegion.getTextEndOffset(startTagNameRegion) - startTagNameStartOffset;
-
- if (!newTagName.equals(oldTagName))
- replaceSource(structuredModel, structuredDocument, startTagNameStartOffset, startTagNameLength, newTagName);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagNameStartOffset); // save
- // new
- // node
- }
- }
-
- IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion != null) {
- ITextRegionList regions = endTagStructuredDocumentRegion.getRegions();
- if (regions != null && regions.size() > 0) {
- ITextRegion endTagNameRegion = regions.get(1);
- int endTagNameStartOffset = endTagStructuredDocumentRegion.getStartOffset(endTagNameRegion);
- int endTagNameLength = endTagStructuredDocumentRegion.getTextEndOffset(endTagNameRegion) - endTagNameStartOffset;
-
- if (startTagStructuredDocumentRegion != endTagStructuredDocumentRegion && !newTagName.equals(oldTagName))
- replaceSource(structuredModel, structuredDocument, endTagNameStartOffset, endTagNameLength, newTagName);
- }
- }
-
- return newNode;
- }
-
- protected Node cleanupChildren(Node node) {
- Node parentNode = node;
-
- if (node != null) {
- Node childNode = node.getFirstChild();
- HTMLCleanupHandlerFactory factory = HTMLCleanupHandlerFactory.getInstance();
- while (childNode != null) {
- // cleanup this child node
- IStructuredCleanupHandler cleanupHandler = factory.createHandler(childNode, getCleanupPreferences());
- childNode = cleanupHandler.cleanup(childNode);
-
- // get new parent node
- parentNode = childNode.getParentNode();
-
- // get next child node
- childNode = childNode.getNextSibling();
- }
- }
-
- return parentNode;
- }
-
- /**
- */
- protected void cleanupCSSAttrValue(IDOMNode node) {
- if (node == null || node.getNodeType() != Node.ELEMENT_NODE)
- return;
- IDOMElement element = (IDOMElement) node;
- if (!element.isGlobalTag())
- return;
-
- Attr attr = element.getAttributeNode("style"); //$NON-NLS-1$
- if (attr == null)
- return;
- String value = getCSSValue(attr);
- if (value == null)
- return;
- String oldValue = ((IDOMNode) attr).getValueSource();
- if (oldValue != null && value.equals(oldValue))
- return;
- attr.setValue(value);
- }
-
- /**
- */
- private ICSSModel getCSSModel(Attr attr) {
- if (attr == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
- return styleAdapter.getModel();
- }
-
- /**
- */
- private String getCSSValue(Attr attr) {
- ICSSModel model = getCSSModel(attr);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
- // try another way to get formatter
- if (formatter == null)
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
- if (formatter == null)
- return null;
- StringBuffer buffer = formatter.cleanup(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- private boolean isEmptyElement(IDOMElement element) {
- Document document = element.getOwnerDocument();
- if (document == null)
- // undefined tag, return default
- return false;
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- // undefined tag, return default
- return false;
-
- CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
- if (decl == null)
- // undefined tag, return default
- return false;
-
- return (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- protected IDOMNode insertEndTag(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
-
- int startTagStartOffset = node.getStartOffset();
- IDOMModel structuredModel = node.getModel();
- IDOMNode newNode = null;
-
- if (element.isCommentTag()) {
- // do nothing
- }
- else if (isEmptyElement(element)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- ITextRegionList regions = startStructuredDocumentRegion.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- replaceSource(structuredModel, structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), lastRegion.getLength(), EMPTY_TAG_CLOSE);
-
- if (regions.size() > 1) {
- ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);
-
- // insert a space separator before tag close if the previous
- // region does not have extra spaces
- if (regionBeforeTagClose.getTextLength() == regionBeforeTagClose.getLength())
- replaceSource(structuredModel, structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), 0, " "); //$NON-NLS-1$
- }
- }
- else {
- String tagName = node.getNodeName();
- String endTag = END_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
-
- IDOMNode lastChild = (IDOMNode) node.getLastChild();
- int endTagStartOffset = 0;
- if (lastChild != null)
- // if this node has children, insert the end tag after the
- // last child
- endTagStartOffset = lastChild.getEndOffset();
- else
- // if this node does not has children, insert the end tag
- // after the start tag
- endTagStartOffset = node.getEndOffset();
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, endTagStartOffset, 0, endTag);
- }
-
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- protected IDOMNode insertMissingTags(IDOMNode node) {
- boolean insertMissingTags = getCleanupPreferences().getInsertMissingTags();
- IDOMNode newNode = node;
-
- if (insertMissingTags) {
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startTagStructuredDocumentRegion == null) {
- // implicit start tag; generate tag for it
- newNode = insertStartTag(node);
- startTagStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- }
-
- IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getEndStructuredDocumentRegion();
-
- ITextRegionList regionList = startTagStructuredDocumentRegion.getRegions();
- if (startTagStructuredDocumentRegion != null && regionList != null && regionList.get(regionList.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-
- }
- else {
- if (startTagStructuredDocumentRegion == null) {
- // start tag missing
- if (isStartTagRequired(newNode))
- newNode = insertStartTag(newNode);
- }
- else if (endTagStructuredDocumentRegion == null) {
- // end tag missing
- if (isEndTagRequired(newNode))
- newNode = insertEndTag(newNode);
- }
- }
- }
-
- return newNode;
- }
-
- protected IDOMNode insertStartTag(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- IDOMNode newNode = null;
-
- String tagName = node.getNodeName();
- String startTag = START_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, startTagStartOffset, 0, startTag);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- protected void insertTagClose(IDOMModel structuredModel, IStructuredDocumentRegion flatNode) {
- if ((flatNode != null) && (flatNode.getRegions() != null)) {
- ITextRegionList regionList = flatNode.getRegions();
- ITextRegion lastRegion = regionList.get(regionList.size() - 1);
- if (lastRegion != null) {
- String regionType = lastRegion.getType();
- if ((regionType != DOMRegionContext.XML_EMPTY_TAG_CLOSE) && (regionType != DOMRegionContext.XML_TAG_CLOSE)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- // insert ">" after lastRegion of flatNode
- // as in "<a</a>" if flatNode is for start tag, or in
- // "<a></a" if flatNode is for end tag
- replaceSource(structuredModel, structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
- }
- }
- }
- }
-
- protected boolean isEndTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- /**
- * The end tags of HTML EMPTY content type, such as IMG, and HTML
- * undefined tags are parsed separately from the start tags. So inserting
- * the missing start tag is useless and even harmful.
- */
- protected boolean isStartTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- protected boolean isXMLType(IDOMModel structuredModel) {
- boolean result = false;
-
- if (structuredModel != null) {
- IDOMDocument document = structuredModel.getDocument();
-
- if (document != null)
- result = document.isXMLType();
- }
-
- return result;
- }
-
- protected IDOMNode quoteAttrValue(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
- IDOMNode newNode = node;
-
- if (quoteAttrValues) {
- NamedNodeMap attributes = newNode.getAttributes();
- int attributesLength = attributes.getLength();
- ISourceGenerator generator = node.getModel().getGenerator();
-
- for (int i = 0; i < attributesLength; i++) {
- attributes = newNode.getAttributes();
- attributesLength = attributes.getLength();
- IDOMAttr eachAttr = (IDOMAttr) attributes.item(i);
- // ITextRegion oldAttrValueRegion = eachAttr.getValueRegion();
- String oldAttrValue = eachAttr.getValueRegionText();
- if (oldAttrValue == null) {
- IDOMModel structuredModel = node.getModel();
- if (isXMLType(structuredModel)) {
- // TODO: Kit, please check. Is there any way to not
- // rely on getting regions from attributes?
- String newAttrValue = "=\"" + eachAttr.getNameRegionText() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, eachAttr.getNameRegionEndOffset(), 0, newAttrValue);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(node.getStartOffset()); // save
- // new
- // node
- }
- }
- else {
-
- char quote = StringUtils.isQuoted(oldAttrValue) ? oldAttrValue.charAt(0) : DOUBLE_QUOTE;
- String newAttrValue = generator.generateAttrValue(eachAttr, quote);
-
- // There is a problem in
- // StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
- // when the region is instanceof ContextRegion.
- // Workaround for now...
- if (oldAttrValue.length() == 1) {
- char firstChar = oldAttrValue.charAt(0);
- if (firstChar == SINGLE_QUOTE)
- newAttrValue = SINGLE_QUOTES;
- else if (firstChar == DOUBLE_QUOTE)
- newAttrValue = DOUBLE_QUOTES;
- }
-
- if (newAttrValue != null) {
- if (newAttrValue.compareTo(oldAttrValue) != 0) {
- int attrValueStartOffset = eachAttr.getValueRegionStartOffset();
- int attrValueLength = oldAttrValue.length();
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, attrValueStartOffset, attrValueLength, newAttrValue);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
- }
- }
- }
- }
- }
-
- return newNode;
- }
-
- private IDOMNode insertRequiredAttrs(IDOMNode node) {
- boolean insertRequiredAttrs = getCleanupPreferences().getInsertRequiredAttrs();
- IDOMNode newNode = node;
-
- if (insertRequiredAttrs) {
- List requiredAttrs = getRequiredAttrs(newNode);
- if (requiredAttrs.size() > 0) {
- NamedNodeMap currentAttrs = node.getAttributes();
- List insertAttrs = new ArrayList();
- if (currentAttrs.getLength() == 0)
- insertAttrs.addAll(requiredAttrs);
- else {
- for (int i = 0; i < requiredAttrs.size(); i++) {
- String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
- boolean found = false;
- for (int j = 0; j < currentAttrs.getLength(); j++) {
- String currentAttrName = currentAttrs.item(j).getNodeName();
- if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
- found = true;
- break;
- }
- }
- if (!found)
- insertAttrs.add(requiredAttrs.get(i));
- }
- }
- if (insertAttrs.size() > 0) {
- IStructuredDocumentRegion startStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- int index = startStructuredDocumentRegion.getEndOffset();
- ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion();
- if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) {
- index--;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- else if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- index = index - 2;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- try {
- for (int i = insertAttrs.size() - 1; i >= 0; i--) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) insertAttrs.get(i);
- String requiredAttributeName = attrDecl.getAttrName();
- String defaultValue = attrDecl.getDefaultValue();
- if (defaultValue == null)
- defaultValue = ""; //$NON-NLS-1$
- String nameAndDefaultValue = " "; //$NON-NLS-1$
- if (i == 0 && lastRegion.getLength() > lastRegion.getTextLength())
- nameAndDefaultValue = ""; //$NON-NLS-1$
- nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
- // BUG3381: MultiTextEdit applies all child
- // TextEdit's basing on offsets
- // in the document before the first TextEdit, not
- // after each
- // child TextEdit. Therefore, do not need to
- // advance the index.
- // index += nameAndDefaultValue.length();
- }
- multiTextEdit.apply(newNode.getStructuredDocument());
- }
- catch (BadLocationException e) {
- // log or now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
-
- return newNode;
- }
-
-
- protected ModelQuery getModelQuery(Node node) {
- ModelQuery result = null;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- result = ModelQueryUtil.getModelQuery((Document) node);
- }
- else {
- result = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
- return result;
- }
-
- protected List getRequiredAttrs(Node node) {
- List result = new ArrayList();
-
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
- if (elementDecl != null) {
- CMNamedNodeMap attrMap = elementDecl.getAttributes();
- Iterator it = attrMap.iterator();
- CMAttributeDeclaration attr = null;
- while (it.hasNext()) {
- attr = (CMAttributeDeclaration) it.next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
- result.add(attr);
- }
- }
- }
- }
-
- return result;
- }
-
- /**
- * <p>Compress empty element tags if the prefence is set to do so</p>
- *
- * @copyof org.eclipse.wst.xml.core.internal.cleanup.ElementNodeCleanupHandler#compressEmptyElementTag
- *
- * @param node the {@link IDOMNode} to possible compress
- * @return the compressed node if the given node should be compressed, else the node as it was given
- */
- private IDOMNode compressEmptyElementTag(IDOMNode node) {
- boolean compressEmptyElementTags = getCleanupPreferences().getCompressEmptyElementTags();
- IDOMNode newNode = node;
-
- IStructuredDocumentRegion startTagStructuredDocumentRegion = newNode.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getLastStructuredDocumentRegion();
-
- //only compress tags if they are empty
- if ((compressEmptyElementTags && startTagStructuredDocumentRegion != endTagStructuredDocumentRegion &&
- startTagStructuredDocumentRegion != null)) {
-
- //only compress end tags if its XHTML or not a container
- if(isXMLTag((IDOMElement)newNode) || !newNode.isContainer()) {
- ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- // format children and end tag if not empty element tag
- if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- NodeList childNodes = newNode.getChildNodes();
- if (childNodes == null || childNodes.getLength() == 0 || (childNodes.getLength() == 1 && (childNodes.item(0)).getNodeType() == Node.TEXT_NODE && ((childNodes.item(0)).getNodeValue().trim().length() == 0))) {
- IDOMModel structuredModel = newNode.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- int startTagStartOffset = newNode.getStartOffset();
- int offset = endTagStructuredDocumentRegion.getStart();
- int length = endTagStructuredDocumentRegion.getLength();
- structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-
- offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
- structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- }
- }
- }
- }
-
- return newNode;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
deleted file mode 100644
index 8dfc778458..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLCleanupHandlerFactory {
-
-
-
- private static HTMLCleanupHandlerFactory fInstance = null;
-
- static synchronized HTMLCleanupHandlerFactory getInstance() {
- if (fInstance == null) {
- fInstance = new HTMLCleanupHandlerFactory();
- }
- return fInstance;
- }
-
- private HTMLCleanupHandlerFactory() {
- super();
- }
-
- IStructuredCleanupHandler createHandler(Node node, IStructuredCleanupPreferences cleanupPreferences) {
- short nodeType = node.getNodeType();
- IStructuredCleanupHandler handler = null;
- switch (nodeType) {
- case Node.ELEMENT_NODE : {
- if (isXMLTag(node))
- handler = new ElementNodeCleanupHandler();
- else
- handler = new JSPElementNodeCleanupHandler();
- break;
- }
- case Node.TEXT_NODE : {
- if (isParentStyleTag(node))
- handler = new CSSTextNodeCleanupHandler();
- else
- handler = new NodeCleanupHandler();
- break;
- }
- default : {
- handler = new NodeCleanupHandler();
- }
- }
-
- handler.setCleanupPreferences(cleanupPreferences);
-
- return handler;
- }
-
- private boolean isXMLTag(Node node) {
- if(node instanceof IDOMNode) {
- IStructuredDocumentRegion region = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- return (DOMRegionContext.XML_TAG_NAME == region.getType());
- }
- return false;
- }
-
- private boolean isParentStyleTag(Node node) {
- if (node == null)
- return false;
- if (node.getNodeType() != Node.TEXT_NODE)
- return false;
- if (!(node instanceof IDOMNode))
- return false;
- IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return false;
- if (flatNode.getType() != DOMRegionContext.BLOCK_TEXT)
- return false;
-
- // check if the parent is STYLE element
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- String name = parent.getNodeName();
- if (name == null)
- return false;
- if (!name.equalsIgnoreCase("STYLE"))//$NON-NLS-1$
- return false;
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
deleted file mode 100644
index 94b29291d2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.internal.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.w3c.dom.Node;
-
-public class HTMLCleanupProcessorImpl extends AbstractStructuredCleanupProcessor {
- private IStructuredCleanupPreferences fCleanupPreferences = null;
-
- protected String getContentType() {
- return ContentTypeIdForHTML.ContentTypeID_HTML;
- }
-
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- return HTMLCleanupHandlerFactory.getInstance().createHandler(node, getCleanupPreferences());
- }
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
- fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
- protected IStructuredFormatProcessor getFormatProcessor() {
- return new HTMLFormatProcessorImpl();
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void refreshCleanupPreferences() {
- fCleanupPreferences = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
deleted file mode 100644
index e6937bff9e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.cleanup;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-public class JSPElementNodeCleanupHandler extends ElementNodeCleanupHandler {
- private static final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
- private static final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
- public Node cleanup(Node node) {
- /* <jsp:root> should cleanup its descendant nodes */
- if(node instanceof IDOMNode) {
- IStructuredDocumentRegion region = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- String regionType = region.getType();
- if(JSP_ROOT_TAG_NAME.equals(regionType))
- return super.cleanup(node);
- else if (JSP_DIRECTIVE_NAME.equals(regionType)){
- IDOMNode renamedNode = (IDOMNode) cleanupChildren(node);
- return quoteAttrValue(renamedNode);
- }
- }
- return node;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java
deleted file mode 100644
index c31f34ed05..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.w3c.dom.Node;
-
-public class NodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- public Node cleanup(Node node) {
- return node;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java
deleted file mode 100644
index 3a528bcb07..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.commentelement.handlers;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.util.CommentElementFactory;
-import org.eclipse.wst.xml.core.internal.commentelement.util.TagScanner;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class CommentElementHandlerForSSI implements CommentElementHandler {
-
- public Element createElement(Document document, String data, boolean isJSPTag) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null) {
- return null;
- }
- CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
- if (cm == null) {
- return null;
- }
- CMNamedNodeMap map = cm.getElements();
- if (map == null) {
- return null;
- }
-
- TagScanner scanner = new TagScanner(data, 1);
- String name = scanner.nextName();
- if (name == null) {
- return null;
- }
- StringBuffer buffer = new StringBuffer(name.length() + 4);
- buffer.append(SSI_PREFIX);
- buffer.append(':');
- buffer.append(name);
- String tagName = buffer.toString();
- // check if valid (defined) SSI tag or not
- if (map.getNamedItem(tagName) == null) {
- return null;
- }
-
- CommentElementFactory factory = new CommentElementFactory(document, isJSPTag, this);
- Element element = factory.create(tagName, CommentElementFactory.IS_START);
-
- // set attributes
- String attrName = scanner.nextName();
- while (attrName != null) {
- String attrValue = scanner.nextValue();
- Attr attr = document.createAttribute(attrName);
- if (attr != null) {
- if (attrValue != null)
- attr.setValue(attrValue);
- element.setAttributeNode(attr);
- }
- attrName = scanner.nextName();
- }
- return element;
- }
-
- public String generateStartTagContent(IDOMElement element) {
- ISourceGenerator generator = element.getModel().getGenerator();
- StringBuffer buffer = new StringBuffer();
-
- buffer.append('#');
- buffer.append(element.getLocalName());
-
- NamedNodeMap attributes = element.getAttributes();
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- Attr attr = (Attr) attributes.item(i);
- if (attr == null) {
- continue;
- }
- buffer.append(' ');
- String attrName = generator.generateAttrName(attr);
- if (attrName != null) {
- buffer.append(attrName);
- }
- String attrValue = generator.generateAttrValue(attr);
- if (attrValue != null) {
- // attr name only for HTML boolean and JSP
- buffer.append('=');
- buffer.append(attrValue);
- }
- }
-
- return buffer.toString();
- }
-
- public String generateEndTagContent(IDOMElement element) {
- return null; // always empty
- }
-
- public boolean isEmpty() {
- return true;
- }
-
- public boolean isCommentElement(IDOMElement element) {
- if (element == null) {
- return false;
- }
- Document document = element.getOwnerDocument();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null) {
- return false;
- }
- CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
- if (cm == null) {
- return false;
- }
- CMNamedNodeMap map = cm.getElements();
- if (map == null) {
- return false;
- }
- String prefix = element.getPrefix();
- if (prefix == null || !prefix.equals(SSI_PREFIX)) {
- return false;
- }
- String tagName = element.getTagName();
- if (tagName.length() <= 4) {
- return false;
- }
- if (map.getNamedItem(tagName) == null) {
- return false;
- }
- else {
- return true;
- }
- }
-
- private static final String SSI_PREFIX = "ssi";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
deleted file mode 100644
index d4f9f99600..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ /dev/null
@@ -1,1695 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
-
- /** bodycolors. */
- private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, ATTR_NAME_ALINK};
- /** coreattrs. */
- private static final String[] CORE = {ATTR_NAME_ID, ATTR_NAME_CLASS, ATTR_NAME_STYLE, ATTR_NAME_TITLE};
- /** events. */
- private static final String[] EVENTS = {ATTR_NAME_ONCLICK, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP, ATTR_NAME_ONHELP};
- /** i18n. lang, dir */
- private static final String[] I18N = {ATTR_NAME_LANG, ATTR_NAME_DIR};
- /** cellhaligh. */
- private static final String[] CELLHALIGN = {ATTR_NAME_CHAR, ATTR_NAME_CHAROFF};
-
- /**
- * constructor.
- */
- public AttributeCollection() {
- super();
- }
-
- /**
- * Create an attribute declaration.
- *
- * @param attrName
- * java.lang.String
- */
- protected HTMLAttrDeclImpl create(String attrName) {
- HTMLAttrDeclImpl attr = null;
- HTMLCMDataTypeImpl atype = null;
-
- if (attrName.equalsIgnoreCase(ATTR_NAME_ABBR)) {
- // (abbr %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ABBR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT)) {
- // (accept %ContentTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT_CHARSET)) {
- // (accept-charset %Charsets;; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSETS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
- // (action %URI #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ARCHIVE)) {
- // (archive CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ARCHIVE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCESSKEY)) {
- // (accesskey %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCESSKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALINK)) {
- // (alink %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
- // (alt %Text; #REQUIRED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSTART)) {
- // (autostart (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSTART, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOPLAY)) {
- // (autoplay (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSIZE)) {
- // (autosize (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AXIS)) {
- // (axis CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AXIS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BACKGROUND)) {
- // (background %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BEHAVIOR)) {
- // (behavior (scroll|slide|alternate) scroll)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_SCROLL, ATTR_VALUE_SLIDE, ATTR_VALUE_ALTERNATE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SCROLL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BEHAVIOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BGCOLOR)) {
- // (bgcolor %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
- // (border %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLSPACING)) {
- // (cellspacing %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLPADDING)) {
- // (cellpadding %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CGI)) {
- // (cgi %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CGI, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAR)) {
- // (char %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAROFF)) {
- // (charoff %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAROFF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHARSET)) {
- // (charset %Charset; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CITE)) {
- // (cite %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CITE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASS)) {
- // (class CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASSID)) {
- // (classid %URI #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASSID, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CMD)) {
- // (cmd CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CMD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
- // (checked (checked) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_CHECKED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
- // (clear (left | all | right | none) none)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODE)) {
- // (code CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODEBASE)) {
- // (codebase %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODEBASE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODETYPE)) {
- // (codetype %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLOR)) {
- // (color %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COMPACT)) {
- // (compact (compact) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_COMPACT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
- // (cols NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLSPAN)) {
- // (colspan NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT)) {
- // (content CDATA #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTROLLER)) {
- // (controller (true|false) true)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTROLLER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COORDS)) {
- // (coords %Coords; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATA)) {
- // (data %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATETIME)) {
- // (datetime %Datetime; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.DATETIME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATETIME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATAPAGESIZE)) {
- // (datapagesize CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DECLARE)) {
- // (declare (declare) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_DECLARE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DECLARE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DEFER)) {
- // (defer (defer) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_DEFER};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DEFER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIR)) {
- // (dir (ltr|rtl) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LTR, ATTR_VALUE_RTL};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTION)) {
- // (direction (left|right|up|down) left)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT, ATTR_VALUE_UP, ATTR_VALUE_DOWN};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTION, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTKEY)) {
- // (directkey %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DISABLED)) {
- // (disabled (disabled) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] values = {ATTR_NAME_DISABLED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
- // (enctype %ContentType; "application/x-www-form-urlencoded")
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ERRMSG)) {
- // (errmsg CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ERRMSG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_EVENT)) {
- // (event CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FACE)) {
- // (face CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FILE)) {
- // (file %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FOR)) {
- // (for %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAME)) {
- // (frame %TFrame; #IMPLIED)
- // %TFrame; is
- // (void|above|below|hsides|lhs|rhs|vsides|box|border).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMEBORDER)) {
- // (frameborder (1|0) 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_1, ATTR_VALUE_0};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D215684
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMESPACING)) {
- // (framespacing CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMESPACING, atype, CMAttributeDeclaration.OPTIONAL);
- // D215684
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEADERS)) {
- // (HEADERS IDREFS; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.IDREFS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEADERS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
- // (height %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HIDDEN)) {
- // (hidden CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HIDDEN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
- // (href %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREFLANG)) {
- // (hreflang %LanguageCode; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREFLANG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
- // (hspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
- // (http-equiv NAME #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ID)) {
- // (id ID #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ID);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ID, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ISMAP)) {
- // (ismap (ismap) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_ISMAP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ISTYLE)) {
- // (istyle CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LABEL)) {
- // (label %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LANG)) {
- // (lang %LanguageCode; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LANG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LANGUAGE)) {
- // (language %CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LINK)) {
- // (link %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LONGDESC)) {
- // (longdesc %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LOOP)) {
- // (loop CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MACRO)) {
- // (macro CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MACRO, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAPFILE)) {
- // (mapfile %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAPFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINWIDTH)) {
- // (marginwidth %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINHEIGHT)) {
- // (marginheight %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
- // (maxlength NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAYSCRIPT)) {
- // (mayscript (mayscript) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MAYSCRIPT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAYSCRIPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MEDIA)) {
- // (media %MediaDesc; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_DESC);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
- // (method (GET|POST) GET)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
- // (multiple (multiple) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MULTIPLE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
- // (name CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOHREF)) {
- // (nohref (nohref) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOHREF};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NORESIZE)) {
- // (noresize (noresize) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NORESIZE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NORESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
- // (noshade (noshade) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOSHADE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOWRAP)) {
- // (nowrap (nowrap) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOWRAP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOWRAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_OBJECT)) {
- // (object CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_OBJECT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_OBJECT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONBLUR)) {
- // (onblur %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONBLUR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCLICK)) {
- // (onclick %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCLICK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCHANGE)) {
- // (onchange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDBLCLICK)) {
- // (ondblclick %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDBLCLICK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
- // (onfocus %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONHELP)) {
- // (onhelp %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONHELP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYPRESS)) {
- // (onkeypress %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYPRESS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYDOWN)) {
- // (onkeydown %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYUP)) {
- // (onkyeup %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYUP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD)) {
- // (onload %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEDOWN)) {
- // (onmousedown %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEUP)) {
- // (onmouseup %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEUP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOVER)) {
- // (onmouseover %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOVER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEMOVE)) {
- // (onmousemove %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEMOVE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOUT)) {
- // (onmouseout %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOUT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRESET)) {
- // (onreset %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRESET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSELECT)) {
- // (onselect %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSELECT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUBMIT)) {
- // (onsubmit %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONUNLOAD)) {
- // (onunload %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONUNLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PALETTE)) {
- // (palette CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PALETTE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PANEL)) {
- // (panel CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PANEL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PLAYCOUNT)) {
- // (playcount NUMBER; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PLAYCOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PROFILE)) {
- // (profile %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PROFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PROMPT)) {
- // (prompt %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PROMPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_READONLY)) {
- // (readonly (readonly) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_READONLY};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_READONLY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REPEAT)) {
- // (repeat CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REPEAT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REL)) {
- // (rel %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REV)) {
- // (rev %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
- // (rows NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWSPAN)) {
- // (rowspan NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_RULES)) {
- // (rules %TRules; #IMPLIED)
- // %TRules; is (none | groups | rows | cols | all).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCALE)) {
- // (scale CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCALE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCHEME)) {
- // (scheme CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
- // (selected (selected) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_SELECTED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCOPE)) {
- // (SCOPE %Scope; #IMPLIED)
- // %Scope; is (row|col|rowgroup|colgroup)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_ROW, ATTR_VALUE_COL, ATTR_VALUE_ROWGROUP, ATTR_VALUE_COLGROUP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLAMOUNT)) {
- // (scrollamount NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLAMOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLDELAY)) {
- // (scrolldelay NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLDELAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLING)) {
- // (scrolling (yes|no|auto) auto)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_YES, ATTR_VALUE_NO, ATTR_VALUE_AUTO};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_AUTO);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SHAPE)) {
- // (shape %Shape; rect): %Shape; is (rect|circle|poly|default).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_RECT, ATTR_VALUE_CIRCLE, ATTR_VALUE_POLY, ATTR_VALUE_DEFAULT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_RECT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SHAPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SHOWCONTROLS)) {
- // (showcontrols (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SHOWCONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
- // (size %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZEFMT)) {
- // (sizefmt CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SPAN)) {
- // (span NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
- // (src %URI; #IMPLIED)
- // NOTE: "src" attributes are defined in several elements.
- // The definition of IMG is different from others.
- // So, it should be locally defined.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_START)) {
- // (start NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_START, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_STANDBY)) {
- // (standby %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_STANDBY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_STYLE)) {
- // (style %StyleSheet; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.STYLE_SHEET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_STYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SUMMARY)) {
- // (summary %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SUMMARY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TABINDEX)) {
- // (tabindex NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TABINDEX, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TARGET)) {
- // (target %FrameTarget; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXT)) {
- // (text %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXTFOCUS)) {
- // (textfocus CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXTFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TITLE)) {
- // (title %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TITLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TIMEFMT)) {
- // (timefmt CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TIMEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TRUESPEED)) {
- // (truespeed (truespeed) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_TRUESPEED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TRUESPEED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
- // (type %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_USEMAP)) {
- // (usemap %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALIGN)) {
- // (valign (top|middle|bottom|baseline) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_BASELINE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
- // (value CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUETYPE)) {
- // (valuetype (DATA|REF|OBJECT) DATA)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_DATA, ATTR_VALUE_REF, ATTR_VALUE_OBJECT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_DATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VAR)) {
- // (var CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
- // (version CDATA #FIXED '%HTML.Version;)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VIRTUAL)) {
- // (virtual %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VIRTUAL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VLINK)) {
- // (vlink %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VLINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VOLUME)) {
- // (volume CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VOLUME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
- // (width %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
- // (vspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D205514
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TOPMARGIN)) {
- // (topmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TOPMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BOTTOMMARGIN)) {
- // (bottommargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BOTTOMMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LEFTMARGIN)) {
- // (leftmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LEFTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_RIGHTMARGIN)) {
- // (rightmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_RIGHTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDERCOLOR)) {
- // (bordercolor, %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
- // D205514
-
- }
- else {
- // unknown attribute; maybe error.
- // should warn.
- attr = null;
- }
-
- return attr;
- }
-
- /**
- * Get align attribute which has %CAlign; as values.. At this time
- * (4/19/2001), it is identical to %LAlign;.
- *
- */
- public static final HTMLAttrDeclImpl createAlignForCaption() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get align attribute which has %IAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForImage() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get align attribute which has %LAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForLegend() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Create an attribute declaration for <code>align</code> in several
- * elements, like <code>P</code>, <code>DIV</code>. The values are
- * different from attributes those have the same name in other elements (<code>IMG</code>
- * and <code>TABLE</code>). So, it can't treat as global attributes.
- * <strong>NOTE: These attribute declaration has no owner CMDocument
- * instance.</strong>
- */
- public static final HTMLAttrDeclImpl createAlignForParagraph() {
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values: left|center|right|justify
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get %attrs; declarations. %attrs; consists of %coreattrs;, %i18n, and
- * %events;.
- */
- public void getAttrs(CMNamedNodeMapImpl declarations) {
- // %coreattrs;
- Iterator names = Arrays.asList(CORE).iterator();
- getDeclarations(declarations, names);
- // %i18n;
- names = Arrays.asList(I18N).iterator();
- getDeclarations(declarations, names);
- // %events;
- names = Arrays.asList(EVENTS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %bodycolors; declarations.
- */
- public void getBodycolors(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(BODYCOLORS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %cellhalign; declarations. %cellhaligh; consists of: - (align
- * (left|center|right|justify|char) #IMPLIED) - (char %Character;
- * #IMPLIED) - (charoff %Length; #IMPLIED)
- */
- public void getCellhalign(CMNamedNodeMapImpl declarations) {
- // (align (left|center|right|justify|char) #IMPLIED) should be defined
- // locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY, ATTR_VALUE_CHAR};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- declarations.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- // the rest.
- Iterator names = Arrays.asList(CELLHALIGN).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %cellvalign; declarations. %cellhaligh; is: - (valign
- * (top|middle|bottom|baseline) #IMPLIED)
- */
- public void getCellvalign(CMNamedNodeMapImpl declarations) {
- HTMLAttributeDeclaration dec = getDeclaration(ATTR_NAME_VALIGN);
- if (dec != null)
- declarations.putNamedItem(ATTR_NAME_VALIGN, dec);
- }
-
- /**
- * Get %coreattrs; declarations.
- */
- public void getCore(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(CORE).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get a global attribute declaration.
- *
- * @param attrName
- * java.lang.String
- */
- public HTMLAttributeDeclaration getDeclaration(String attrName) {
- CMNode cmnode = getNamedItem(attrName);
- if (cmnode != null)
- return (HTMLAttributeDeclaration) cmnode; // already exists.
-
- HTMLAttrDeclImpl dec = create(attrName);
- if (dec != null)
- putNamedItem(attrName, dec);
-
- return dec;
- }
-
- /**
- * Get declarations which are specified by names.
- *
- * @param names
- * java.util.Iterator
- */
- public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
- while (names.hasNext()) {
- String attrName = (String) names.next();
- HTMLAttributeDeclaration dec = getDeclaration(attrName);
- if (dec != null)
- declarations.putNamedItem(attrName, dec);
- }
- }
-
- /**
- * Get %events; declarations.
- */
- public void getEvents(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(EVENTS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %i18n; declarations.
- */
- public void getI18n(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(I18N).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * create declarations.
- */
- public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
- /* (type %InputType; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (checked (checked) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (maxlength NUMBER #IMPLIED)
- * (src %URI; #IMPLIED)
- * (alt CDATA #IMPLIED) ... should be defined locally.
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (accept %ContentTypes; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (istyle CDATA #IMPLIED)
- * <<D215684
- * (width CDATA; #IMPLIED)
- * (height CDATA; #IMPLIED)
- * (border CDATA; #IMPLIED)
- * D215684
- */
- if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %InputType; TEXT) ... should be defined locally.
- // NOTE: %InputType is ENUM;
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SIZE, attr);
-
- // (alt CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_ALT, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ACCEPT, ATTR_NAME_ALIGN, ATTR_NAME_ISTYLE,
- //<<D215684
- ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT, ATTR_NAME_BORDER
- //<D215684
- };
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /* (charset %Charset; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (type %ContentType; #IMPLIED): should be defined locally.
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (media %MediaDesc; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
- String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_MEDIA, ATTR_NAME_TARGET};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type %ContentType; #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- }
- /* (charset %Charset; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (directkey %Character; #IMPLIED)
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.A)){
- String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_TYPE, ATTR_NAME_NAME, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_ACCESSKEY, ATTR_NAME_DIRECTKEY, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- else if (elementName.equals(HTML40Namespace.ElementName.FORM)) {
- String[] names = {HTML40Namespace.ATTR_NAME_ACTION, HTML40Namespace.ATTR_NAME_METHOD, HTML40Namespace.ATTR_NAME_ENCTYPE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ONSUBMIT, HTML40Namespace.ATTR_NAME_ONRESET, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_ACCEPT_CHARSET};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /*
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (nohref (nohref) #IMPLIED)
- * (alt %Text; #REQUIRED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
- String[] names = {ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_TARGET, ATTR_NAME_NOHREF, ATTR_NAME_ALT, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /*
- * %i18n;
- * (http-equiv NAME #IMPLIED)
- * (name NAME #IMPLIED) ... should be defined locally.
- * (content CDATA #REQUIRED)
- * (scheme CDATA #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.META)){
- // %i18n;
- getI18n(attributes);
-
- // (name NAME #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_NAME, attr);
-
- String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CONTENT, ATTR_NAME_SCHEME};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /*
- * (src %URI; #REQUIRED): should be defined locally.
- * (alt %Text; #REQUIRED)
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (align %IAlign; #IMPLIED): should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mapfile %URI; #IMPLIED)
-
- */
- else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_SRC, attr);
-
- String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local); should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- }
- /*
- * (id ID #IMPLIED)
- * (name CDATA #REQUIRED) ... should be defined locally.
- * (value CDATA #IMPLIED)
- * (valuetype (DATA|REF|OBJECT) DATA)
- * (type %ContentType; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
- String[] names = {ATTR_NAME_ID, ATTR_NAME_VALUE, ATTR_NAME_VALUETYPE, ATTR_NAME_TYPE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (name CDATA #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_NAME, attr);
- }
- /*
- * %reserved; ... empty
- * (name CDATA #IMPLIED)
- * (rows NUMBER #REQUIRED)
- * (cols NUMBER #REQUIRED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (istyle CDATA #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ISTYLE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /*
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (language CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (defer (defer) #IMPLIED)
- * (event CDATA #IMPLIED)
- * (for %URI; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.SCRIPT)){
- String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_LANGUAGE, ATTR_NAME_SRC, ATTR_NAME_DEFER, ATTR_NAME_EVENT, ATTR_NAME_FOR};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- }
- /*
- * %i18n;
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (media %MediaDesc; #IMPLIED)
- * (title %Text; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
- // %i18n;
- getI18n(attributes);
-
- String[] names = {ATTR_NAME_MEDIA, ATTR_NAME_TITLE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- }
- /*
- * %reserved;
- * (name CDATA #IMPLIED)
- * (size NUMBER #IMPLIED) ... should be defined locally.
- * (multiple (multiple) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
- // (size NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SIZE, attr);
-
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- /*
- * (type %LIStyle; #IMPLIED) ... should be defined locally.
- * (value NUMBER #IMPLIED) ... should be defined locally.
- */
- else if (elementName.equals(HTML40Namespace.ElementName.LI)){
- // (type %LIStyle; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (value NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_VALUE, attr);
-
- }
- /*
- * (type %OLStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- * (start NUMBER #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.OL)){
- // (type %OLStyle; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // the rest.
- String[] names = {ATTR_NAME_COMPACT, ATTR_NAME_START};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- /**
- * %coreattrs;
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (frameborder (1|0) 1)
- * (marginwidth %Pixels; #IMPLIED)
- * (marginheight %Pixels; #IMPLIED)
- * (scrolling (yes|no|auto) auto)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
- // %coreattrs;
- getCore(attributes);
-
- String[] names = {ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_FRAMEBORDER, ATTR_NAME_MARGINWIDTH, ATTR_NAME_MARGINHEIGHT, ATTR_NAME_SCROLLING, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- }
- /*
- * %i18n attrs
- * %version
- */
- else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
- // %i18n;
- getI18n(attributes);
- // version
- HTMLAttributeDeclaration adec = getDeclaration(ATTR_NAME_VERSION);
- if (adec != null)
- attributes.putNamedItem(ATTR_NAME_VERSION, adec);
-
- }
- /*
- * (compact (compact) #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
- String[] names = {ATTR_NAME_COMPACT};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- /*
- * %reserved; ... empty.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (type (button|submit|reset) submit) ... should be defined locally.
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type (button|submit|reset) submit) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- }
- /*
- * %reserved;
- * (summary %Text; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (border %Pixels; #IMPLIED)
- * (frame %TFrame; #IMPLIED)
- * (rules %TRules; #IMPLIED)
- * (cellspacing %Length; #IMPLIED)
- * (cellpadding %Length; #IMPLIED)
- * (align %TAlign; #IMPLIED)
- * (bgcolor %Color; #IMPLIED)
- * (datapagesize CDATA #IMPLIED)
- * (height %Pixels; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
- // %reserved;
- // ... %reserved; is empty in the current DTD.
-
- String[] names = {ATTR_NAME_SUMMARY, ATTR_NAME_WIDTH, ATTR_NAME_BORDER, ATTR_NAME_FRAME, ATTR_NAME_RULES, ATTR_NAME_CELLSPACING, ATTR_NAME_CELLPADDING, ATTR_NAME_BGCOLOR, ATTR_NAME_DATAPAGESIZE, ATTR_NAME_HEIGHT, ATTR_NAME_BACKGROUND, ATTR_NAME_BORDERCOLOR // D205514
- };
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
- atype.setEnumValues(alignValues);
- HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_ALIGN, adec);
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java
deleted file mode 100644
index 07973a51c3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements CMContent {
-
- public static final int UNBOUNDED = -1;
- /** -1: it's UNBOUNDED. */
- private int maxOccur = UNBOUNDED;
- /** 0: it's OPTIONAL, 1, it's REQUIRED. */
- private int minOccur = 0;
-
- /**
- * The primary consturctor.
- * Use this one for usual cases.<br>
- */
- public CMContentImpl(String name, int min, int max) {
- super(name);
- minOccur = min;
- maxOccur = max;
- }
-
- /**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return maxOccur;
- }
-
- /**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return minOccur;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java
deleted file mode 100644
index 0108c618cb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
- private int operator = CMGroup.SEQUENCE;
- private CMNodeListImpl children = null;
-
- /**
- * CMGroupImpl constructor comment.
- */
- public CMGroupImpl(int op, int minOccur, int maxOccur) {
- super(null, minOccur, maxOccur);
- switch (op) {
- case CMGroup.ALL :
- case CMGroup.CHOICE :
- case CMGroup.SEQUENCE :
- operator = op;
- break;
- default :
- // should warn.
- break;
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendChild(CMNode child) {
- if (child == null)
- return null;
- if (children == null)
- children = new CMNodeListImpl();
- return children.appendNode(child);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
- */
- public CMNodeList getChildNodes() {
- return children;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.GROUP;
- }
-
- /**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
- public int getOperator() {
- return operator;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
deleted file mode 100644
index f8a5e601b8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * An implementation of the CMNamedNodeMap interface. This class is intented
- * to be used as a container of attribute declarations. If someone wants to
- * use this class for other purpose, he must pay attention to the fact that
- * this class is tolerant of the key name case. That is, this class does not
- * distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements CMNamedNodeMap {
-
- private Hashtable items = null;
-
- /**
- */
- public CMNamedNodeMapImpl() {
- super();
- items = new Hashtable();
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return items.size();
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode <code>null</code> for unknown keys.
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- String cookedName = makeCanonicalForm(name);
- if (!items.containsKey(cookedName))
- return null;
- return (CMNode) items.get(cookedName);
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- CMNode node = (CMNode) iter.next();
- if (--index < 0)
- return node;
- }
- return null;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator iterator() {
- return items.values().iterator();
- }
-
- /**
- * @return java.lang.String
- * @param rawForm
- * java.lang.String
- */
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
-
- /**
- * @param key
- * java.lang.String
- * @param item
- * java.lang.String
- */
- void putNamedItem(String name, CMNode item) {
- String cookedName = makeCanonicalForm(name);
- if (items.containsKey(cookedName))
- return; // already registered.
- items.put(cookedName, item);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java
deleted file mode 100644
index 6ef737a913..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMNamespace implementation.
- */
-class CMNamespaceImpl extends CMNodeImpl implements CMNamespace {
-
- private java.lang.String prefix = null;
-
- /**
- * CMNamespaceImpl constructor comment.
- */
- public CMNamespaceImpl(String uri, String pfx) {
- super(uri);
- prefix = pfx;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return CMNode.NAME_SPACE;
- }
-
- /**
- * getPrefix method
- * @return java.lang.String
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * getURI method
- * @return java.lang.String
- */
- public String getURI() {
- return getNodeName();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
deleted file mode 100644
index 2f6eb44f7b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements CMNode {
-
- private java.lang.String name = null;
-
- /**
- * CMNodeImpl constructor comment.
- */
- public CMNodeImpl(String nm) {
- super();
- name = nm;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return name;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return new Boolean(false);
- return null;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
deleted file mode 100644
index 08bf21ab05..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- * Analog of dom.NodeList for CM.
- * So, the implementation is very similar to
- * NodeListImpl<br>
- */
-class CMNodeListImpl implements CMNodeList {
-
- private java.util.Vector nodes = null;
-
- /**
- * CMNodeListImpl constructor comment.
- */
- public CMNodeListImpl() {
- super();
- nodes = new java.util.Vector();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendNode(CMNode node) {
- nodes.addElement(node);
- return node;
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return nodes.size();
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- if (index < 0 || index >= nodes.size())
- return null;
- return (CMNode) nodes.elementAt(index);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java
deleted file mode 100644
index 91dba7ca17..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
- protected CMGroupImpl content = null;
- protected ElementCollection collection = null;
- protected String primaryCandidateName = null;
-
- /**
- * ComplexTypeDefinition constructor comment.
- */
- public ComplexTypeDefinition(ElementCollection elementCollection) {
- super();
- collection = elementCollection;
- createContent();
- }
-
- /**
- * Create an actual content model.
- * This method should be called once and only once in the constructor.<br>
- */
- protected abstract void createContent();
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
- */
- public CMGroup getContent() {
- return content;
- }
-
- /**
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- /* NOTE: Do we need LOGICAL type?
- * -- 3/7/2001
- */
- public abstract int getContentType();
-
- /**
- * Get content hint.
- */
- public HTMLElementDeclaration getPrimaryCandidate() {
- if (primaryCandidateName == null)
- return null;
- return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public abstract String getTypeName();
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
deleted file mode 100644
index 51d693d046..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
- private static ComplexTypeDefinitionFactory instance = null;
- private java.util.Hashtable definitions = null;
- // constants for complex type name
- /** for ADDRESS. */
- public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
- /** CDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
- /** col group content. COL* */
- public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
- /** for DL. */
- public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
- /** for DETAILS */
- public final static String CTYPE_DETAILS_CONTAINER = "CTYPE_DETAILS_CONTAINER";//$NON-NLS-1$
- /** for EMBED. */
- public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
- /** empty content. No ComplexTypeDefinition instance should be created. */
- public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
- /** for FIELDSET. */
- public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
- /** for FRAMESET. */
- public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
- /** flow content. (%flow;)* */
- public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
- /** html content. HEAD, (FRAMESET|BODY) */
- public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
- /** head content. TITLE & ISINDEX? & BASE? */
- public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
- /** inline content. (%inline;)* */
- public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
- /** list item container. (LI)+ */
- public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
- /** for MAP. */
- public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
- /** noframes content. */
- public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
- /** for OPTGROUP. */
- public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
- /** param container. For OBJECT/APPLET. */
- public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
- /** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
- /** for SELECT. */
- public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
- /** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
- public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
- /** table cell contaier. (TH|TD)+ */
- public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
- /** table record container. (TR)+ */
- public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
- /** heading group container. (H1|h2|H3|H4|H5|H6)+ */
- public final static String CTYPE_HEADING_CONTAINER = "CTYPE_HGROUP_CONTAINER"; //$NON-NLS-1$
- /** media content. (AUDIO|VIDEO) */
- public final static String CTYPE_MEDIA_ELEMENT = "CTYPE_MEDIA";//$NON-NLS-1$
- /** for DATALIST. */
- public final static String CTYPE_DATALIST = "CTYPE_DATALIST";//$NON-NLS-1$
- /** for FIGURE. */
- public final static String CTYPE_FIGURE = "CTYPE_FIGURE";//$NON-NLS-1$
- /** for RUBY. */
- public final static String CTYPE_RUBY = "CTYPE_RUBY";//$NON-NLS-1$
-
- /**
- * ComplexTypeDefinitionFactory constructor comment.
- */
- private ComplexTypeDefinitionFactory() {
- super();
- definitions = new java.util.Hashtable();
- }
-
- /**
- * Factory method for ComplexTypeDefinition.
- * Each instance created in this method must be registered into
- * the map with its name.
- * @param definitionName java.lang.String
- * @param elementCollection ElementCollection
- */
- public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
- ComplexTypeDefinition[] defs = null;
- if (definitions.containsKey(definitionName)) {
- defs = (ComplexTypeDefinition[]) definitions.get(definitionName);
- for (int i = 0; i < defs.length; i++) {
- if (defs[i].collection == elementCollection)
- return defs[i];
- }
- }
- else {
- // initialize a new definition
- defs = new ComplexTypeDefinition[0];
- }
-
- ComplexTypeDefinition def = null;
- if (definitionName == CTYPE_ADDRESS) {
- def = new CtdAddress(elementCollection);
-
- }
- else if (definitionName == CTYPE_COLUMN_GROUP) {
- def = new CtdColumnGroup(elementCollection);
-
- }
- else if (definitionName == CTYPE_DATALIST) {
- def = new CtdDatalist(elementCollection);
-
- }
- else if (definitionName == CTYPE_DEFINITION_LIST) {
- def = new CtdDl(elementCollection);
-
- }
- else if (definitionName == CTYPE_DETAILS_CONTAINER) {
- def = new CtdDetails(elementCollection);
- }
- else if (definitionName == CTYPE_EMBED) {
- def = new CtdEmbed(elementCollection);
-
- }
- else if (definitionName == CTYPE_FIELDSET) {
- def = new CtdFieldset(elementCollection);
-
- }
- else if (definitionName == CTYPE_FIGURE) {
- def = new CtdFigure(elementCollection);
-
- }
- else if (definitionName == CTYPE_FLOW_CONTAINER) {
- def = new CtdFlowContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_FRAMESET) {
- def = new CtdFrameset(elementCollection);
-
- }
- else if (definitionName == CTYPE_HEAD) {
- def = new CtdHead(elementCollection);
-
- }
- else if (definitionName == CTYPE_HEADING_CONTAINER) {
- def = new CtdHeadingContainer(elementCollection);
- }
- else if (definitionName == CTYPE_HTML) {
- def = new CtdHtml(elementCollection);
-
- }
- else if (definitionName == CTYPE_INLINE_CONTAINER) {
- def = new CtdInlineContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_LI_CONTAINER) {
- def = new CtdLiContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_MAP) {
- def = new CtdMap(elementCollection);
-
- }
- else if (definitionName == CTYPE_MEDIA_ELEMENT) {
- def = new CtdMediaElement(elementCollection);
-
- }
- else if (definitionName == CTYPE_NOFRAMES_CONTENT) {
- def = new CtdNoframesContent(elementCollection);
-
- }
- else if (definitionName == CTYPE_OPTION_CONTAINER) {
- def = new CtdOptionContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_PARAM_CONTAINER) {
- def = new CtdParamContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_RUBY) {
- def = new CtdRuby(elementCollection);
-
- }
- else if (definitionName == CTYPE_SELECT) {
- def = new CtdSelect(elementCollection);
-
- }
- else if (definitionName == CTYPE_TABLE) {
- def = new CtdTable(elementCollection);
-
- }
- else if (definitionName == CTYPE_TCELL_CONTAINER) {
- def = new CtdTableCellContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_TR_CONTAINER) {
- def = new CtdTrContainer(elementCollection);
-
- }
- else {
- def = null;
- }
- if (def == null)
- return null; // fail to create.
- ComplexTypeDefinition[] temp = defs;
- defs = new ComplexTypeDefinition[defs.length + 1];
- System.arraycopy(temp, 0, defs, 0, temp.length);
- defs[temp.length] = def;
- definitions.put(definitionName, defs);
- return def;
- }
-
- /**
- * For singleton.
- */
- public synchronized static ComplexTypeDefinitionFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new ComplexTypeDefinitionFactory();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java
deleted file mode 100644
index 76847d053f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdAddress(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * ((%inline) | P)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // (%inline)
- CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (inlines == null)
- return;
- collection.getInline(inlines);
- content.appendChild(inlines);
- // P
- CMNode p = collection.getNamedItem(HTML40Namespace.ElementName.P);
- if (p != null)
- content.appendChild(p);
- }
-
- /**
- * ((%inline) | P)*.
- * Because %inline; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
deleted file mode 100644
index 623399d1dc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * COL group.
- * (COL)*
- */
-final class CtdColumnGroup extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdColumnGroup(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (COL)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )*
- content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- // COL
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (COL)*
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
deleted file mode 100644
index 457debf2c9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
+++ /dev/null
@@ -1,65 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for DATALIST.
- */
-final class CtdDatalist extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdDatalist(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.OPTION;
- }
-
- /**
- * (OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
-
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DATALIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
deleted file mode 100644
index 914d5db256..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
+++ /dev/null
@@ -1,50 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class CtdDetails extends ComplexTypeDefinition {
-
- public CtdDetails(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML50Namespace.ElementName.SUMMARY;
- }
-
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // summary
- CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.SUMMARY);
- if (dec != null)
- content.appendChild(dec);
-
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- content.appendChild(group);
- collection.getFlow(group);
- }
-
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
deleted file mode 100644
index 626eb8fc4b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdDl(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.DT;
- }
-
- /**
- * (DT | DD)+
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // DT
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.DT);
- if (dec != null)
- content.appendChild(dec);
- // DD
- dec = collection.getNamedItem(HTML40Namespace.ElementName.DD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (DT | DD)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
deleted file mode 100644
index da5e725c60..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for EMBED.
- */
-final class CtdEmbed extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdEmbed(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.NOEMBED;
- }
-
- /**
- * (NOEMBED).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // NOEMBED
- CMNode noembed = collection.getNamedItem(HTML40Namespace.ElementName.NOEMBED);
- if (noembed != null)
- content.appendChild(noembed);
- }
-
- /**
- * (NOEMBED).
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_EMBED;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
deleted file mode 100644
index b4f2dfdc02..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for FIELDSET.
- */
-final class CtdFieldset extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdFieldset(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.LEGEND;
- }
-
- /**
- * (#PCDATA, LEGEND, (%flow;)*)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( , , )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // #PCDATA
- // ...??
-
- // LEGEND
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.LEGEND);
- if (dec != null)
- content.appendChild(dec);
- // (%flow;)*
- CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (flows == null)
- return;
- collection.getFlow(flows);
- content.appendChild(flows);
- }
-
- /**
- * (#PCDATA, LEGEND, (%flow;)*)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
deleted file mode 100644
index 165054fdc8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
+++ /dev/null
@@ -1,93 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for FIGURE.
- */
-final class CtdFigure extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdFigure(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML50Namespace.ElementName.FIGCAPTION;
- }
-
- /**
- * (FIGCAPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
- CMGroupImpl group1 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (group1 != null){
- content.appendChild(group1);
- }
- // FIGCAPTION, FLOW
- CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
- if (dec != null)
- group1.appendChild(dec);
- CMGroupImpl flowgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- group1.appendChild(flowgroup);
- collection.getFlow(flowgroup);
-
- CMGroupImpl group2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (group2 != null){
- content.appendChild(group2);
- }
- // FLOW , FIGCAPTION
- CMGroupImpl flowgroup2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- group2.appendChild(flowgroup2);
- collection.getFlow(flowgroup2);
- CMNode dec1 = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
- if (dec1 != null)
- group2.appendChild(dec1);
- //FLOW
- CMGroupImpl group3 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (group3 != null){
- content.appendChild(group3);
-
- }
- collection.getFlow(group3);
-
- }
-
- /**
- * (FIGCAPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FIGURE;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java
deleted file mode 100644
index 6c7a08b0c6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
- /**
- */
- public CtdFlowContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%flow;)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getFlow(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
deleted file mode 100644
index 03da4b4128..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for FRAMESET.
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- */
-final class CtdFrameset extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdFrameset(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.FRAME;
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?).
- * --> ((FRAMESET | FRAME)+ & (NOFRAMES)?)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( & )
- content = new CMGroupImpl(CMGroup.ALL, 1, 1);
-
- // ( | )+
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- if (group == null)
- return;
- content.appendChild(group);
-
- // FRAMESET
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAMESET);
- if (dec != null)
- group.appendChild(dec);
- // FRAME
- dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAME);
- if (dec != null)
- group.appendChild(dec);
-
- // ( )?
- group = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (group == null)
- return;
- content.appendChild(group);
-
- // NOFRAMES
- dec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (dec != null)
- group.appendChild(dec);
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
deleted file mode 100644
index 48bc24fa75..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHead(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TITLE;
- }
-
- /**
- * for HEAD.
- * To avoid using inclusion, the content model comes from the XHTML 1.0.
- *
- * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
- * And %head.misc; is:
- * (script|style|meta|link|object|isindex)*
- *
- * 0: (%head.misc, A)
- * A: (B | C)
- * B: (title, %head.misc;, D)
- * C: (base, %head.misc;, E)
- * D: (base, %head.misc;)?
- * E: (title, %head.misc;)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // At 1st, create %head.misc; content.
- // %head.misc;
- // ( | )*
- CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (misc == null)
- return;
- String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.ISINDEX};
- collection.getDeclarations(misc, Arrays.asList(names).iterator());
- // 2nd, get a title
- CMNode title = collection.getNamedItem(HTML40Namespace.ElementName.TITLE);
- // 3rd, get a base
- CMNode base = collection.getNamedItem(HTML40Namespace.ElementName.BASE);
- if (title == null || base == null)
- return;
-
- // Top level content is a sequence of %head.misc; and A.
- // 0: (%head.misc;, A)
- // create a sequence
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
- // append %head.misc;
- content.appendChild(misc);
- // create A and append it to the top level.
- {
- // A is a choice of B and C.
- // A: (B | C)
- // create a choice
- CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (gA == null)
- return;
- // append A to the top level.
- content.appendChild(gA);
-
- // create B and append it to A
- {
- // B is a sequence of title, %head.misc;, and D.
- // B: (title, %head.misc;, D)
- // create a sequence
- CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gB == null)
- return;
- // append B to A.
- gA.appendChild(gB);
-
- // append title to B
- gB.appendChild(title);
- // append %head.misc; to B
- gB.appendChild(misc);
- // create D and append it to B.
- {
- // D is a sequence of base, %head.misc;.
- // D: (base, %head.misc;)?
- // create a sequence
- CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (gD == null)
- return;
- // append D to B.
- gB.appendChild(gD);
-
- // append base to D
- gD.appendChild(base);
- // append %head.misc; to D.
- gD.appendChild(misc);
- }
- }
- // create C and append it to A
- {
- // C is a sequence of base, %head.misc;, and E
- // C: (base, %head.misc;, E)
- // create a sequence
- CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gC == null)
- return;
- // append C to A.
- gA.appendChild(gC);
-
- // append base to C
- gC.appendChild(base);
- // append %head.misc; to C
- gC.appendChild(misc);
-
- // create E and append it to C.
- {
- // E is a sequence of title and %head.misc;.
- // E: (title, %head.misc;)
- // create a sequence
- CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gE == null)
- return;
- // append E to C.
- gC.appendChild(gE);
-
- // append title to E
- gE.appendChild(title);
- // append %head.misc; to E.
- gE.appendChild(misc);
- }
- }
- }
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HEAD;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
deleted file mode 100644
index e7fdba7ca2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
+++ /dev/null
@@ -1,55 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-
-public class CtdHeadingContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdHeadingContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
- // ( )*
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // H1|H2|H3|H4|H5|H6
- collection.getHeading(content);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
deleted file mode 100644
index ca7295b732..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHtml(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.HEAD;
- }
-
- /**
- * (%html.content;).
- * %html.content; is HEAD, (FRAMESET | BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
-
- // HEAD
- CMNode edec = collection.getNamedItem(HTML40Namespace.ElementName.HEAD);
- if (edec != null)
- content.appendChild(edec);
-
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- content.appendChild(group);
-
- // FRAMESET, BODY
- String[] names = {HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.BODY};
- collection.getDeclarations(group, Arrays.asList(names).iterator());
-
- // since BODY start and end are omissable
- // adding valid children of BODY here under HTML
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97342
- edec = collection.getNamedItem(HTML40Namespace.ElementName.MAP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.PRE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BDO);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.INPUT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.P);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.NOSCRIPT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.I);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BUTTON);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.LABEL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.U);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H6);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CENTER);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BASEFONT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.S);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BLOCKQUOTE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H3);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.UL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.B);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SELECT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.Q);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.STRIKE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SCRIPT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ABBR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BIG);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H1);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.IMG);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ACRONYM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DEL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TEXTAREA);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H2);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FONT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.OBJECT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.KBD);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.IFRAME);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.HR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H4);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DIR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SAMP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.INS);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H5);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SUP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.A);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DFN);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ISINDEX);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.VAR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FIELDSET);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TABLE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.APPLET);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.OL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SMALL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CITE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FORM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DIV);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CODE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SPAN);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SUB);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.EM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.MENU);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ADDRESS);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.STRONG);
- if (edec != null)
- content.appendChild(edec);
- edec = collection.getNamedItem(HTML50Namespace.ElementName.ARTICLE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.ASIDE);
- if (edec != null)
- content.appendChild(edec);
- edec = collection.getNamedItem(HTML50Namespace.ElementName.NAV);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.SECTION);
- if (edec != null)
- content.appendChild(edec);
- edec = collection.getNamedItem(HTML50Namespace.ElementName.AUDIO);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.VIDEO);
- if (edec != null)
- content.appendChild(edec);
- edec = collection.getNamedItem(HTML50Namespace.ElementName.CANVAS);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.COMMAND);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.HEADER);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.MARK);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML50Namespace.ElementName.FIGURE);
- if (edec != null)
- content.appendChild(edec);
- edec = collection.getNamedItem(HTML50Namespace.ElementName.RUBY);
- if (edec != null)
- content.appendChild(edec);
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HTML;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java
deleted file mode 100644
index 7fbfeabd9f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdInlineContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%inline)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getInline(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
deleted file mode 100644
index 5ccb079cb0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
- /**
- * @param elemenCollection ElementCollection
- */
- public CtdLiContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.LI;
- }
-
- /**
- * (LI)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (LI)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode li = collection.getNamedItem(HTML40Namespace.ElementName.LI);
- if (li != null)
- content.appendChild(li);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java
deleted file mode 100644
index 3ff2a165bf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for MAP.
- */
-final class CtdMap extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdMap(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.AREA;
- }
-
- /**
- * ((%block;) | AREA)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // (%block;)
- CMGroupImpl blocks = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (blocks == null)
- return;
- collection.getBlock(blocks);
- content.appendChild(blocks);
- // AREA
- CMNode area = collection.getNamedItem(HTML40Namespace.ElementName.AREA);
- if (area != null)
- content.appendChild(area);
- }
-
- /**
- * ((%block;) | AREA)+.
- * Because %block; consists of elements only, the type is ELEMENT.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_MAP;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
deleted file mode 100644
index 95cb598057..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
+++ /dev/null
@@ -1,58 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-public class CtdMediaElement extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdMediaElement(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
- // ( )*
- content = new CMGroupImpl(CMGroup.SEQUENCE,0, 1);
- //source
- CMNode source = collection.getNamedItem(HTML50Namespace.ElementName.SOURCE);
- if (source != null)
- content.appendChild(source);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
deleted file mode 100644
index d193a6c884..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for NOFRAMES.
- */
-final class CtdNoframesContent extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdNoframesContent(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.BODY;
- }
-
- /**
- * (BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // BODY
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.BODY);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (BODY)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_NOFRAMES_CONTENT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java
deleted file mode 100644
index b53480abf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdOptionContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.OPTION;
- }
-
- /**
- * (OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTION)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
deleted file mode 100644
index 4eb45b4513..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * PARAM container. For OBJECT and APPLET.
- */
-final class CtdParamContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdParamContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (PARAM | %flow;)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // PARAM
- CMNode param = collection.getNamedItem(HTML40Namespace.ElementName.PARAM);
- if (param != null)
- content.appendChild(param);
- // %flow;
- CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (flows == null)
- return;
- collection.getInline(flows);
- collection.getBlock(flows);
- content.appendChild(flows);
- }
-
- /**
- * (PARAM | %flow;)*.
- * Because %flow; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
deleted file mode 100644
index 9ec37d014e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
+++ /dev/null
@@ -1,94 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for RUBY.
- */
-final class CtdRuby extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdRuby(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML50Namespace.ElementName.RT;
- }
-
- /**
- * (RT)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
-
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-
- CMGroupImpl phraseGroup = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (phraseGroup == null)
- return;
- content.appendChild(phraseGroup);
- collection.getPhrase(phraseGroup);
-
- CMGroupImpl rtrpgroup = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (rtrpgroup == null)
- return;
- content.appendChild(rtrpgroup);
-
- //RT
- CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
- if (dec != null)
- rtrpgroup.appendChild(dec);
-
- CMGroupImpl rpgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (rpgroup == null)
- return;
- rtrpgroup.appendChild(rpgroup);
-
- // RP
- dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
- if (dec != null)
- rpgroup.appendChild(dec);
- // RT
- dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
- if (dec != null)
- rpgroup.appendChild(dec);
- dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
- if (dec != null)
- rpgroup.appendChild(dec);
- }
-
- /**
- * (RT)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_RUBY;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
deleted file mode 100644
index b1d12843cc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdSelect(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.OPTION;
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // OPTGROUP
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTGROUP);
- if (dec != null)
- content.appendChild(dec);
- // OPTION
- dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_SELECT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
deleted file mode 100644
index 7fd73d5152..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for TABLE.
- * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+, TR+)
- */
-final class CtdTable extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTable(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TBODY;
- }
-
- /**
- * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
- * --> ((CAPTION)?, ((COL)* | (COLGROUP)*), (THEAD)?, (TFOOT)?, (TBODY)+, (TR)+)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( , , , ,)
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-
- // (CAPTION)?
- // ( )?
- CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- // CAPTION
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.CAPTION);
- if (dec != null)
- wrap.appendChild(dec);
-
- // ((COL)* | (COLGROUP)*)
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (group == null)
- return;
- content.appendChild(group);
- // (COL)*
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- group.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
- if (dec != null)
- wrap.appendChild(dec);
- // (COLGROUP)*
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- group.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.COLGROUP);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (THEAD)?
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.THEAD);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (TFOOT)?
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TFOOT);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (TBODY)+
- // TBODY has optional start and end tags
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TBODY);
- if (dec != null)
- wrap.appendChild(dec);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=96101
- // TBODY start and end tag are optional, so TR should be allowed here
- // (TR)+
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TR);
- if (dec != null)
- wrap.appendChild(dec);
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TABLE;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
deleted file mode 100644
index a207876cb2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Table cell container.
- * (TH | TD)+
- */
-final class CtdTableCellContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTableCellContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TD;
- }
-
- /**
- * (TH | TD)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // TH
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.TH);
- if (dec != null)
- content.appendChild(dec);
- // TD
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (TH | TD)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
deleted file mode 100644
index 734c204fac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Table record container.
- * (TR)+
- */
-final class CtdTrContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTrContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TR;
- }
-
- /**
- * (TR)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (TR)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode tr = collection.getNamedItem(HTML40Namespace.ElementName.TR);
- if (tr != null)
- content.appendChild(tr);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
deleted file mode 100644
index d5aab547ae..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
- protected class DualMap {
- public DualMap() {
- super();
- }
-
- public DualMap(Object[] objects) {
- super();
- initialize(objects);
- }
-
- public int size() {
- return table.length;
- }
-
- public Object getValue(int key) {
- if (!isValidIndex(key))
- return null;
- return table[key];
- }
-
- public int getKey(Object value) {
- Integer keyObj = (Integer) map.get(value);
- if (keyObj == null)
- return ID_UNKNOWN;
- return keyObj.intValue();
- }
-
- protected void initialize(Object[] objects) {
- if (objects == null)
- return;
- table = objects;
- map = new HashMap();
- for (int key = 0; key < objects.length; key++) {
- Object value = table[key];
- map.put(value, new Integer(key));
- }
- }
-
- private Object[] table = null;
- private HashMap map = null;
-
- private boolean isValidIndex(int index) {
- return index >= 0 && index < table.length;
- }
- }
-
- protected class TolerantStringDualMap extends DualMap {
- public TolerantStringDualMap(String[] names) {
- super();
- Object[] objects = new Object[names.length];
- for (int i = 0; i < names.length; i++) {
- objects[i] = makeCanonicalForm(names[i]);
- }
- initialize(objects);
- }
-
- public int getKey(Object value) {
- try {
- String name = (String) value;
- return super.getKey(makeCanonicalForm(name));
- }
- catch (ClassCastException e) {
- return ID_UNKNOWN;
- }
- }
-
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
- }
-
- private class DeclIterator implements Iterator {
- public DeclIterator() {
- maxid = fDecls.length - 1;
- }
-
- public boolean hasNext() {
- return id < maxid;
- }
-
- public Object next() {
- if (!hasNext())
- return null;
- return item(++id);
- }
-
- public void remove() { /* nothing should be done. */
- }
-
- private int id = -1;
- private int maxid = -1;
- }
-
- CMNode[] fDecls = null;
- protected final static boolean STRICT_CASE = false;
- protected final static boolean TOLERANT_CASE = true;
- protected final static int ID_UNKNOWN = -1;
- private DualMap fMap = null;
-
- /**
- */
- public DeclCollection(String[] names, boolean tolerant) {
- super();
- fDecls = new CMNode[names.length];
- if (tolerant) {
- fMap = new TolerantStringDualMap(names);
- }
- else {
- fMap = new DualMap(names);
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param id int
- */
- protected abstract CMNode create(String name);
-
- /**
- */
- public CMNamedNodeMap getDeclarations(String[] names) {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMNode node = getNamedItem(name);
- if (node == null)
- continue;
- map.putNamedItem(name, node);
- }
- return map;
- }
-
- /**
- * @param names java.util.Iterator
- */
- public void getDeclarations(CMGroupImpl group, Iterator names) {
- while (names.hasNext()) {
- String entityName = (String) names.next();
- CMNode dec = getNamedItem(entityName);
- if (dec != null)
- group.appendChild(dec);
- }
- }
-
- /**
- * Map name to id.
- * @return int
- * @param name java.lang.String
- */
- protected int getID(String name) {
- return fMap.getKey(name);
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return fDecls.length;
- }
-
- /**
- * @return java.lang.String
- * @param id int
- */
- protected String getName(int id) {
- return (String) fMap.getValue(id);
- }
-
- /**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
- public CMNode getNamedItem(String name) {
- int id = getID(name);
- if (!isValidID(id))
- return null;
- return item(id);
- }
-
- /**
- * @return boolean
- * @param id int
- */
- private boolean isValidID(int id) {
- return id >= 0 && id < fDecls.length;
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- if (!isValidID(index))
- return null;
- CMNode decl = fDecls[index];
- if (decl != null)
- return decl; // already exist.
-
- decl = create(getName(index));
- fDecls[index] = decl;
- return decl;
- }
-
- /**
- */
- public Iterator iterator() {
- return new DeclIterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
deleted file mode 100644
index 92ddfdf5a2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
+++ /dev/null
@@ -1,889 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
- // Element IDs
- protected static class Ids {
- public static final int ID_A = 0;
- public static final int ID_ABBR = 1;
- public static final int ID_ACRONYM = 2;
- public static final int ID_ADDRESS = 3;
- public static final int ID_APPLET = 4;
- public static final int ID_AREA = 5;
- public static final int ID_B = 6;
- public static final int ID_BASE = 7;
- public static final int ID_BASEFONT = 8;
- public static final int ID_BDO = 9;
- public static final int ID_BIG = 10;
- public static final int ID_BLINK = 11;
- public static final int ID_BLOCKQUOTE = 12;
- public static final int ID_BODY = 13;
- public static final int ID_BR = 14;
- public static final int ID_BUTTON = 15;
- public static final int ID_CAPTION = 16;
- public static final int ID_CENTER = 17;
- public static final int ID_CITE = 18;
- public static final int ID_CODE = 19;
- public static final int ID_COL = 20;
- public static final int ID_COLGROUP = 21;
- public static final int ID_DD = 22;
- public static final int ID_DEL = 23;
- public static final int ID_DFN = 24;
- public static final int ID_DIR = 25;
- public static final int ID_DIV = 26;
- public static final int ID_DL = 27;
- public static final int ID_DT = 28;
- public static final int ID_EM = 29;
- public static final int ID_EMBED = 30;
- public static final int ID_FIELDSET = 31;
- public static final int ID_FONT = 32;
- public static final int ID_FORM = 33;
- public static final int ID_FRAME = 34;
- public static final int ID_FRAMESET = 35;
- public static final int ID_H1 = 36;
- public static final int ID_H2 = 37;
- public static final int ID_H3 = 38;
- public static final int ID_H4 = 39;
- public static final int ID_H5 = 40;
- public static final int ID_H6 = 41;
- public static final int ID_HEAD = 42;
- public static final int ID_HR = 43;
- public static final int ID_HTML = 44;
- public static final int ID_I = 45;
- public static final int ID_IFRAME = 46;
- public static final int ID_IMG = 47;
- public static final int ID_INPUT = 48;
- public static final int ID_INS = 49;
- public static final int ID_ISINDEX = 50;
- public static final int ID_KBD = 51;
- public static final int ID_LABEL = 52;
- public static final int ID_LEGEND = 53;
- public static final int ID_LI = 54;
- public static final int ID_LINK = 55;
- public static final int ID_MAP = 56;
- public static final int ID_MENU = 57;
- public static final int ID_META = 58;
- public static final int ID_NOEMBED = 59;
- public static final int ID_NOFRAMES = 60;
- public static final int ID_NOSCRIPT = 61;
- public static final int ID_OBJECT = 62;
- public static final int ID_OL = 63;
- public static final int ID_OPTGROUP = 64;
- public static final int ID_OPTION = 65;
- public static final int ID_P = 66;
- public static final int ID_PARAM = 67;
- public static final int ID_PRE = 68;
- public static final int ID_Q = 69;
- public static final int ID_S = 70;
- public static final int ID_SAMP = 71;
- public static final int ID_SCRIPT = 72;
- public static final int ID_SELECT = 73;
- public static final int ID_SMALL = 74;
- public static final int ID_SPAN = 75;
- public static final int ID_STRIKE = 76;
- public static final int ID_STRONG = 77;
- public static final int ID_STYLE = 78;
- public static final int ID_SUB = 79;
- public static final int ID_SUP = 80;
- public static final int ID_TABLE = 81;
- public static final int ID_TBODY = 82;
- public static final int ID_TD = 83;
- public static final int ID_TEXTAREA = 84;
- public static final int ID_TFOOT = 85;
- public static final int ID_TH = 86;
- public static final int ID_THEAD = 87;
- public static final int ID_TITLE = 88;
- public static final int ID_TR = 89;
- public static final int ID_TT = 90;
- public static final int ID_U = 91;
- public static final int ID_UL = 92;
- public static final int ID_VAR = 93;
- public static final int ID_MARQUEE = 94;
- public static final int ID_SSI_CONFIG = 95;
- public static final int ID_SSI_ECHO = 96;
- public static final int ID_SSI_EXEC = 97;
- public static final int ID_SSI_FSIZE = 98;
- public static final int ID_SSI_FLASTMOD = 99;
- public static final int ID_SSI_INCLUDE = 100;
- public static final int ID_SSI_PRINTENV = 101;
- public static final int ID_SSI_SET = 102;
- // <<D205513
- public static final int ID_BGSOUND = 103;
- public static final int ID_NOBR = 104;
- public static final int ID_WBR = 105;
-
- // D205513
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- /** %fontstyle;. TT | I | B | U | S | STRIKE | BIG | SMALL | BLINK */
- private static final String[] FONTSTYLE = {TT, I, B, U, S, STRIKE, BIG, SMALL, BLINK};
- /** %formctl;. INPUT | SELECT | TEXTAREA | LABEL | BUTTON */
- private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA, LABEL, BUTTON};
- /** %phrase;.
- * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM
- */
- private static final String[] PHRASE = {EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM};
- /** %special;.
- * A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
- * MAP | Q | SUB | SUP | SPAN | BDO | IFRAME | EMBED | MARQUEE |
- * D2W | SUBMIT
- * WBR | NOBR | BGSOUND
- */
- private static final String[] SPECIAL = {A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, WBR, // D205513
- SCRIPT, MAP, Q, SUB, SUP, SPAN, BDO, IFRAME, EMBED, BGSOUND, // D205513
- MARQUEE, NOBR // D205513
- };
- /** %heading;. H[1-6] */
- private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
- /** %list;. UL | OL | DIR | MENU */
- private static final String[] LIST = {UL, OL, DIR, MENU};
- /** %preformatted;. PRE */
- private static final String[] PREFORMATTED = {PRE};
- protected AttributeCollection attributeCollection = null;
- private static String[] fNames = null;
-
- /**
- */
- public ElementCollection(AttributeCollection collection) {
- super(getNames(), TOLERANT_CASE);
- attributeCollection = collection;
- }
-
- public ElementCollection(String[] names, AttributeCollection collection) {
- super(names, TOLERANT_CASE);
- attributeCollection = collection;
- }
-
- /**
- * Actually creates HTMLElementDeclaration instance.
- * @return HTMLElementDeclaration
- */
- protected CMNode create(String elementName) {
- HTMLElemDeclImpl edec = null;
-
- if (elementName.equalsIgnoreCase(A)) {
- edec = new HedA(this);
- }
- else if (elementName.equalsIgnoreCase(ABBR)) {
- edec = new HedPhrase(ABBR, this);
-
- }
- else if (elementName.equalsIgnoreCase(ACRONYM)) {
- edec = new HedPhrase(ACRONYM, this);
-
- }
- else if (elementName.equalsIgnoreCase(ADDRESS)) {
- edec = new HedADDRESS(this);
-
- }
- else if (elementName.equalsIgnoreCase(APPLET)) {
- edec = new HedAPPLET(this);
-
- }
- else if (elementName.equalsIgnoreCase(AREA)) {
- edec = new HedAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(B)) {
- edec = new HedFontStyle(B, this);
-
- }
- else if (elementName.equalsIgnoreCase(BASE)) {
- edec = new HedBASE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BASEFONT)) {
- edec = new HedBASEFONT(this);
-
- }
- else if (elementName.equalsIgnoreCase(BDO)) {
- edec = new HedBDO(this);
-
- }
- else if (elementName.equalsIgnoreCase(BIG)) {
- edec = new HedFontStyle(BIG, this);
-
- }
- else if (elementName.equalsIgnoreCase(BLINK)) {
- edec = new HedFontStyle(BLINK, this);
-
- }
- else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
- edec = new HedBLOCKQUOTE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BODY)) {
- edec = new HedBODY(this);
-
- }
- else if (elementName.equalsIgnoreCase(BR)) {
- edec = new HedBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(BUTTON)) {
- edec = new HedBUTTON(this);
-
- }
- else if (elementName.equalsIgnoreCase(CAPTION)) {
- edec = new HedCAPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(CENTER)) {
- edec = new HedCENTER(this);
-
- }
- else if (elementName.equalsIgnoreCase(CITE)) {
- edec = new HedPhrase(CITE, this);
-
- }
- else if (elementName.equalsIgnoreCase(CODE)) {
- edec = new HedPhrase(CODE, this);
-
- }
- else if (elementName.equalsIgnoreCase(COL)) {
- edec = new HedCOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(COLGROUP)) {
- edec = new HedCOLGROUP(this);
-
- }
- else if (elementName.equalsIgnoreCase(DD)) {
- edec = new HedDD(this);
-
- }
- else if (elementName.equalsIgnoreCase(DEL)) {
- edec = new HedMarkChanges(DEL, this);
-
- }
- else if (elementName.equalsIgnoreCase(DFN)) {
- edec = new HedPhrase(DFN, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIR)) {
- edec = new HedMENU(DIR, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIV)) {
- edec = new HedDIV(this);
-
- }
- else if (elementName.equalsIgnoreCase(DL)) {
- edec = new HedDL(this);
-
- }
- else if (elementName.equalsIgnoreCase(DT)) {
- edec = new HedDT(this);
-
- }
- else if (elementName.equalsIgnoreCase(EM)) {
- edec = new HedPhrase(EM, this);
-
- }
- else if (elementName.equalsIgnoreCase(EMBED)) {
- edec = new HedEMBED(this);
-
- }
- else if (elementName.equalsIgnoreCase(FIELDSET)) {
- edec = new HedFIELDSET(this);
-
- }
- else if (elementName.equalsIgnoreCase(FONT)) {
- edec = new HedFONT(this);
-
- }
- else if (elementName.equalsIgnoreCase(FORM)) {
- edec = new HedFORM(this);
-
- }
- else if (elementName.equalsIgnoreCase(FRAME)) {
- edec = new HedFRAME(this);
-
- }
- else if (elementName.equalsIgnoreCase(FRAMESET)) {
- edec = new HedFRAMESET(this);
-
- }
- else if (elementName.equalsIgnoreCase(H1)) {
- edec = new HedHeading(H1, this);
-
- }
- else if (elementName.equalsIgnoreCase(H2)) {
- edec = new HedHeading(H2, this);
-
- }
- else if (elementName.equalsIgnoreCase(H3)) {
- edec = new HedHeading(H3, this);
-
- }
- else if (elementName.equalsIgnoreCase(H4)) {
- edec = new HedHeading(H4, this);
-
- }
- else if (elementName.equalsIgnoreCase(H5)) {
- edec = new HedHeading(H5, this);
-
- }
- else if (elementName.equalsIgnoreCase(H6)) {
- edec = new HedHeading(H6, this);
-
- }
- else if (elementName.equalsIgnoreCase(HEAD)) {
- edec = new HedHEAD(this);
-
- }
- else if (elementName.equalsIgnoreCase(HR)) {
- edec = new HedHR(this);
-
- }
- else if (elementName.equalsIgnoreCase(HTML)) {
- edec = new HedHTML(this);
-
- }
- else if (elementName.equalsIgnoreCase(I)) {
- edec = new HedFontStyle(I, this);
-
- }
- else if (elementName.equalsIgnoreCase(IFRAME)) {
- edec = new HedIFRAME(this);
-
- }
- else if (elementName.equalsIgnoreCase(IMG)) {
- edec = new HedIMG(this);
-
- }
- else if (elementName.equalsIgnoreCase(INPUT)) {
- edec = new HedINPUT(this);
-
- }
- else if (elementName.equalsIgnoreCase(INS)) {
- edec = new HedMarkChanges(INS, this);
-
- }
- else if (elementName.equalsIgnoreCase(ISINDEX)) {
- edec = new HedISINDEX(this);
-
- }
- else if (elementName.equalsIgnoreCase(KBD)) {
- edec = new HedPhrase(KBD, this);
-
- }
- else if (elementName.equalsIgnoreCase(LABEL)) {
- edec = new HedLABEL(this);
-
- }
- else if (elementName.equalsIgnoreCase(LEGEND)) {
- edec = new HedLEGEND(this);
-
- }
- else if (elementName.equalsIgnoreCase(LI)) {
- edec = new HedLI(this);
-
- }
- else if (elementName.equalsIgnoreCase(LINK)) {
- edec = new HedLINK(this);
-
- }
- else if (elementName.equalsIgnoreCase(MAP)) {
- edec = new HedMAP(this);
-
- }
- else if (elementName.equalsIgnoreCase(MARQUEE)) {
- edec = new HedMARQUEE(this);
-
- }
- else if (elementName.equalsIgnoreCase(MENU)) {
- edec = new HedMENU(MENU, this);
-
- }
- else if (elementName.equalsIgnoreCase(META)) {
- edec = new HedMETA(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOEMBED)) {
- edec = new HedNOEMBED(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOFRAMES)) {
- edec = new HedNOFRAMES(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOSCRIPT)) {
- edec = new HedNOSCRIPT(this);
-
- }
- else if (elementName.equalsIgnoreCase(OBJECT)) {
- edec = new HedOBJECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(OL)) {
- edec = new HedOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTGROUP)) {
- edec = new HedOPTGROUP(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTION)) {
- edec = new HedOPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(P)) {
- edec = new HedP(this);
-
- }
- else if (elementName.equalsIgnoreCase(PARAM)) {
- edec = new HedPARAM(this);
-
- }
- else if (elementName.equalsIgnoreCase(PRE)) {
- edec = new HedPRE(this);
-
- }
- else if (elementName.equalsIgnoreCase(Q)) {
- edec = new HedQ(this);
-
- }
- else if (elementName.equalsIgnoreCase(S)) {
- edec = new HedFontStyle(S, this);
-
- }
- else if (elementName.equalsIgnoreCase(SAMP)) {
- edec = new HedPhrase(SAMP, this);
-
- }
- else if (elementName.equalsIgnoreCase(SCRIPT)) {
- edec = new HedSCRIPT(this);
-
- }
- else if (elementName.equalsIgnoreCase(SELECT)) {
- edec = new HedSELECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(SMALL)) {
- edec = new HedFontStyle(SMALL, this);
-
- }
- else if (elementName.equalsIgnoreCase(SPAN)) {
- edec = new HedSPAN(this);
-
- }
- else if (elementName.equalsIgnoreCase(STRIKE)) {
- edec = new HedFontStyle(STRIKE, this);
-
- }
- else if (elementName.equalsIgnoreCase(STRONG)) {
- edec = new HedPhrase(STRONG, this);
-
- }
- else if (elementName.equalsIgnoreCase(STYLE)) {
- edec = new HedSTYLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(SUB)) {
- edec = new HedScripts(SUB, this);
-
- }
- else if (elementName.equalsIgnoreCase(SUP)) {
- edec = new HedScripts(SUP, this);
-
- }
- else if (elementName.equalsIgnoreCase(TABLE)) {
- edec = new HedTABLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(TBODY)) {
- edec = new HedTableBody(TBODY, this);
-
- }
- else if (elementName.equalsIgnoreCase(TD)) {
- edec = new HedTableCell(TD, this);
-
- }
- else if (elementName.equalsIgnoreCase(TEXTAREA)) {
- edec = new HedTEXTAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(TFOOT)) {
- edec = new HedTableBody(TFOOT, this);
-
- }
- else if (elementName.equalsIgnoreCase(TH)) {
- edec = new HedTableCell(TH, this);
-
- }
- else if (elementName.equalsIgnoreCase(THEAD)) {
- edec = new HedTableBody(THEAD, this);
-
- }
- else if (elementName.equalsIgnoreCase(TITLE)) {
- edec = new HedTITLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(TR)) {
- edec = new HedTR(this);
-
- }
- else if (elementName.equalsIgnoreCase(TT)) {
- edec = new HedFontStyle(TT, this);
-
- }
- else if (elementName.equalsIgnoreCase(U)) {
- edec = new HedFontStyle(U, this);
-
- }
- else if (elementName.equalsIgnoreCase(UL)) {
- edec = new HedUL(this);
-
- }
- else if (elementName.equalsIgnoreCase(VAR)) {
- edec = new HedPhrase(VAR, this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
- edec = new HedSSIConfig(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
- edec = new HedSSIEcho(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
- edec = new HedSSIExec(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
- edec = new HedSSIFsize(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
- edec = new HedSSIFlastmod(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
- edec = new HedSSIInclude(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
- edec = new HedSSIPrintenv(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_SET)) {
- edec = new HedSSISet(this);
-
- }
- else if (elementName.equalsIgnoreCase(BGSOUND)) {
- edec = new HedBGSOUND(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOBR)) {
- edec = new HedNOBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(WBR)) {
- edec = new HedWBR(this);
-
- } // unknown
- else {
- // NOTE: We don't define the UNKNOWN element declaration.
- // <code>null</code> for a declaration is a sign of
- // the target element is unknown.
- // -- 3/9/2001
- edec = null;
- }
- return edec;
- }
-
- public AttributeCollection getAttributeCollection() {
- return attributeCollection;
- }
-
- public Collection getNamesOfBlock() {
- // P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
- // TABLE, FIELDSET, ADDRESS
- String[] blockMisc = {P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS};
- Vector names = new Vector(Arrays.asList(blockMisc));
- // %heading;
- names.addAll(Arrays.asList(HEADING));
- // %list;
- names.addAll(Arrays.asList(LIST));
- // %preformatted;
- names.addAll(Arrays.asList(PREFORMATTED));
-
- return names;
- }
-
- /**
- * %block;.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getBlock(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, getNamesOfBlock().iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public void getFlow(CMGroupImpl group) {
- if (group == null)
- return;
- getBlock(group);
- getInline(group);
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public void getFontstyle(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public void getFormctrl(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FORMCTL).iterator());
- }
-
- /**
- * %heading;.
- * @param group CMGroupImpl Return values.
- */
- public void getHeading(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(HEADING).iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public void getInline(CMGroupImpl group) {
- if (group == null)
- return;
- getFontstyle(group);
- getPhrase(group);
- getSpecial(group);
- getFormctrl(group);
- }
-
- /**
- * %list;.
- * @param group CMGroupImpl Return values.
- */
- public void getList(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(LIST).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public void getPhrase(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(PHRASE).iterator());
- }
-
- /**
- * %preformatted;
- * @param group CMGroupImpl Return values.
- */
- public void getPreformatted(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public void getSpecial(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SPECIAL).iterator());
- }
-
- private static String[] getNames() {
- if (fNames == null) {
- fNames = new String[Ids.getNumOfIds()];
- fNames[Ids.ID_A] = A;
- fNames[Ids.ID_ABBR] = ABBR;
- fNames[Ids.ID_ACRONYM] = ACRONYM;
- fNames[Ids.ID_ADDRESS] = ADDRESS;
- fNames[Ids.ID_APPLET] = APPLET;
- fNames[Ids.ID_AREA] = AREA;
- fNames[Ids.ID_B] = B;
- fNames[Ids.ID_BASE] = BASE;
- fNames[Ids.ID_BASEFONT] = BASEFONT;
- fNames[Ids.ID_BDO] = BDO;
- fNames[Ids.ID_BIG] = BIG;
- fNames[Ids.ID_BLINK] = BLINK;
- fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
- fNames[Ids.ID_BODY] = BODY;
- fNames[Ids.ID_BR] = BR;
- fNames[Ids.ID_BUTTON] = BUTTON;
- fNames[Ids.ID_CAPTION] = CAPTION;
- fNames[Ids.ID_CENTER] = CENTER;
- fNames[Ids.ID_CITE] = CITE;
- fNames[Ids.ID_CODE] = CODE;
- fNames[Ids.ID_COL] = COL;
- fNames[Ids.ID_COLGROUP] = COLGROUP;
- fNames[Ids.ID_DD] = DD;
- fNames[Ids.ID_DEL] = DEL;
- fNames[Ids.ID_DFN] = DFN;
- fNames[Ids.ID_DIR] = DIR;
- fNames[Ids.ID_DIV] = DIV;
- fNames[Ids.ID_DL] = DL;
- fNames[Ids.ID_DT] = DT;
- fNames[Ids.ID_EM] = EM;
- fNames[Ids.ID_EMBED] = EMBED;
- fNames[Ids.ID_FIELDSET] = FIELDSET;
- fNames[Ids.ID_FONT] = FONT;
- fNames[Ids.ID_FORM] = FORM;
- fNames[Ids.ID_FRAME] = FRAME;
- fNames[Ids.ID_FRAMESET] = FRAMESET;
- fNames[Ids.ID_H1] = H1;
- fNames[Ids.ID_H2] = H2;
- fNames[Ids.ID_H3] = H3;
- fNames[Ids.ID_H4] = H4;
- fNames[Ids.ID_H5] = H5;
- fNames[Ids.ID_H6] = H6;
- fNames[Ids.ID_HEAD] = HEAD;
- fNames[Ids.ID_HR] = HR;
- fNames[Ids.ID_HTML] = HTML;
- fNames[Ids.ID_I] = I;
- fNames[Ids.ID_IFRAME] = IFRAME;
- fNames[Ids.ID_IMG] = IMG;
- fNames[Ids.ID_INPUT] = INPUT;
- fNames[Ids.ID_INS] = INS;
- fNames[Ids.ID_ISINDEX] = ISINDEX;
- fNames[Ids.ID_KBD] = KBD;
- fNames[Ids.ID_LABEL] = LABEL;
- fNames[Ids.ID_LEGEND] = LEGEND;
- fNames[Ids.ID_LI] = LI;
- fNames[Ids.ID_LINK] = LINK;
- fNames[Ids.ID_MAP] = MAP;
- fNames[Ids.ID_MENU] = MENU;
- fNames[Ids.ID_META] = META;
- fNames[Ids.ID_NOEMBED] = NOEMBED;
- fNames[Ids.ID_NOFRAMES] = NOFRAMES;
- fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
- fNames[Ids.ID_OBJECT] = OBJECT;
- fNames[Ids.ID_OL] = OL;
- fNames[Ids.ID_OPTGROUP] = OPTGROUP;
- fNames[Ids.ID_OPTION] = OPTION;
- fNames[Ids.ID_P] = P;
- fNames[Ids.ID_PARAM] = PARAM;
- fNames[Ids.ID_PRE] = PRE;
- fNames[Ids.ID_Q] = Q;
- fNames[Ids.ID_S] = S;
- fNames[Ids.ID_SAMP] = SAMP;
- fNames[Ids.ID_SCRIPT] = SCRIPT;
- fNames[Ids.ID_SELECT] = SELECT;
- fNames[Ids.ID_SMALL] = SMALL;
- fNames[Ids.ID_SPAN] = SPAN;
- fNames[Ids.ID_STRIKE] = STRIKE;
- fNames[Ids.ID_STRONG] = STRONG;
- fNames[Ids.ID_STYLE] = STYLE;
- fNames[Ids.ID_SUB] = SUB;
- fNames[Ids.ID_SUP] = SUP;
- fNames[Ids.ID_TABLE] = TABLE;
- fNames[Ids.ID_TBODY] = TBODY;
- fNames[Ids.ID_TD] = TD;
- fNames[Ids.ID_TEXTAREA] = TEXTAREA;
- fNames[Ids.ID_TFOOT] = TFOOT;
- fNames[Ids.ID_TH] = TH;
- fNames[Ids.ID_THEAD] = THEAD;
- fNames[Ids.ID_TITLE] = TITLE;
- fNames[Ids.ID_TR] = TR;
- fNames[Ids.ID_TT] = TT;
- fNames[Ids.ID_U] = U;
- fNames[Ids.ID_UL] = UL;
- fNames[Ids.ID_VAR] = VAR;
- fNames[Ids.ID_MARQUEE] = MARQUEE;
- fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
- fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
- fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
- fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
- fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
- fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
- fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
- fNames[Ids.ID_SSI_SET] = SSI_SET;
- fNames[Ids.ID_BGSOUND] = BGSOUND;
- fNames[Ids.ID_NOBR] = NOBR;
- fNames[Ids.ID_WBR] = WBR;
- }
- return fNames;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
deleted file mode 100644
index dda7041fd0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
+++ /dev/null
@@ -1,837 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
- private static class Ids {
- public static final int ID_AACUTE_L = 0;
- public static final int ID_AACUTE_U = 1;
- public static final int ID_ACIRC_L = 2;
- public static final int ID_ACIRC_U = 3;
- public static final int ID_ACUTE = 4;
- public static final int ID_AELIG_L = 5;
- public static final int ID_AELIG_U = 6;
- public static final int ID_AGRAVE_L = 7;
- public static final int ID_AGRAVE_U = 8;
- public static final int ID_ALEFSYM = 9;
- public static final int ID_ALPHA_L = 10;
- public static final int ID_ALPHA_U = 11;
- public static final int ID_AMP = 12;
- public static final int ID_AND = 13;
- public static final int ID_ANG = 14;
- public static final int ID_ARING_L = 15;
- public static final int ID_ARING_U = 16;
- public static final int ID_ASYMP = 17;
- public static final int ID_ATILDE_L = 18;
- public static final int ID_ATILDE_U = 19;
- public static final int ID_AUML_L = 20;
- public static final int ID_AUML_U = 21;
- public static final int ID_BDQUO = 22;
- public static final int ID_BETA_L = 23;
- public static final int ID_BETA_U = 24;
- public static final int ID_BRVBAR = 25;
- public static final int ID_BULL = 26;
- public static final int ID_CAP = 27;
- public static final int ID_CCEDIL_L = 28;
- public static final int ID_CCEDIL_U = 29;
- public static final int ID_CEDIL = 30;
- public static final int ID_CENT = 31;
- public static final int ID_CHI_L = 32;
- public static final int ID_CHI_U = 33;
- public static final int ID_CIRC = 34;
- public static final int ID_CLUBS = 35;
- public static final int ID_CONG = 36;
- public static final int ID_COPY = 37;
- public static final int ID_CRARR = 38;
- public static final int ID_CUP = 39;
- public static final int ID_CURREN = 40;
- public static final int ID_DAGGER_L = 41;
- public static final int ID_DAGGER_U = 42;
- public static final int ID_DARR_L = 43;
- public static final int ID_DARR_U = 44;
- public static final int ID_DEG = 45;
- public static final int ID_DELTA_L = 46;
- public static final int ID_DELTA_U = 47;
- public static final int ID_DIAMS = 48;
- public static final int ID_DIVIDE = 49;
- public static final int ID_EACUTE_L = 50;
- public static final int ID_EACUTE_U = 51;
- public static final int ID_ECIRC_L = 52;
- public static final int ID_ECIRC_U = 53;
- public static final int ID_EGRAVE_L = 54;
- public static final int ID_EGRAVE_U = 55;
- public static final int ID_EMPTY = 56;
- public static final int ID_EMSP = 57;
- public static final int ID_ENSP = 58;
- public static final int ID_EPSILON_L = 59;
- public static final int ID_EPSILON_U = 60;
- public static final int ID_EQUIV = 61;
- public static final int ID_ETA_L = 62;
- public static final int ID_ETA_U = 63;
- public static final int ID_ETH_L = 64;
- public static final int ID_ETH_U = 65;
- public static final int ID_EUML_L = 66;
- public static final int ID_EUML_U = 67;
- public static final int ID_EURO = 68;
- public static final int ID_EXIST = 69;
- public static final int ID_FNOF = 70;
- public static final int ID_FORALL = 71;
- public static final int ID_FRAC12 = 72;
- public static final int ID_FRAC14 = 73;
- public static final int ID_FRAC34 = 74;
- public static final int ID_FRASL = 75;
- public static final int ID_GAMMA_L = 76;
- public static final int ID_GAMMA_U = 77;
- public static final int ID_GE = 78;
- public static final int ID_GT = 79;
- public static final int ID_HARR_L = 80;
- public static final int ID_HARR_U = 81;
- public static final int ID_HEARTS = 82;
- public static final int ID_HELLIP = 83;
- public static final int ID_IACUTE_L = 84;
- public static final int ID_IACUTE_U = 85;
- public static final int ID_ICIRC_L = 86;
- public static final int ID_ICIRC_U = 87;
- public static final int ID_IEXCL = 88;
- public static final int ID_IGRAVE_L = 89;
- public static final int ID_IGRAVE_U = 90;
- public static final int ID_IMAGE = 91;
- public static final int ID_INFIN = 92;
- public static final int ID_INT = 93;
- public static final int ID_IOTA_L = 94;
- public static final int ID_IOTA_U = 95;
- public static final int ID_IQUEST = 96;
- public static final int ID_ISIN = 97;
- public static final int ID_IUML_L = 98;
- public static final int ID_IUML_U = 99;
- public static final int ID_KAPPA_L = 100;
- public static final int ID_KAPPA_U = 101;
- public static final int ID_LAMBDA_L = 102;
- public static final int ID_LAMBDA_U = 103;
- public static final int ID_LANG = 104;
- public static final int ID_LAQUO = 105;
- public static final int ID_LARR_L = 106;
- public static final int ID_LARR_U = 107;
- public static final int ID_LCEIL = 108;
- public static final int ID_LDQUO = 109;
- public static final int ID_LE = 110;
- public static final int ID_LFLOOR = 111;
- public static final int ID_LOWAST = 112;
- public static final int ID_LOZ = 113;
- public static final int ID_LRM = 114;
- public static final int ID_LSAQUO = 115;
- public static final int ID_LSQUO = 116;
- public static final int ID_LT = 117;
- public static final int ID_MACR = 118;
- public static final int ID_MDASH = 119;
- public static final int ID_MICRO = 120;
- public static final int ID_MIDDOT = 121;
- public static final int ID_MINUS = 122;
- public static final int ID_MU_L = 123;
- public static final int ID_MU_U = 124;
- public static final int ID_NABLA = 125;
- public static final int ID_NBSP = 126;
- public static final int ID_NDASH = 127;
- public static final int ID_NE = 128;
- public static final int ID_NI = 129;
- public static final int ID_NOT = 130;
- public static final int ID_NOTIN = 131;
- public static final int ID_NSUB = 132;
- public static final int ID_NTILDE_L = 133;
- public static final int ID_NTILDE_U = 134;
- public static final int ID_NU_L = 135;
- public static final int ID_NU_U = 136;
- public static final int ID_OACUTE_L = 137;
- public static final int ID_OACUTE_U = 138;
- public static final int ID_OCIRC_L = 139;
- public static final int ID_OCIRC_U = 140;
- public static final int ID_OELIG_L = 141;
- public static final int ID_OELIG_U = 142;
- public static final int ID_OGRAVE_L = 143;
- public static final int ID_OGRAVE_U = 144;
- public static final int ID_OLINE = 145;
- public static final int ID_OMEGA_L = 146;
- public static final int ID_OMEGA_U = 147;
- public static final int ID_OMICRON_L = 148;
- public static final int ID_OMICRON_U = 149;
- public static final int ID_OPLUS = 150;
- public static final int ID_OR = 151;
- public static final int ID_ORDF = 152;
- public static final int ID_ORDM = 153;
- public static final int ID_OSLASH_L = 154;
- public static final int ID_OSLASH_U = 155;
- public static final int ID_OTILDE_L = 156;
- public static final int ID_OTILDE_U = 157;
- public static final int ID_OTIMES = 158;
- public static final int ID_OUML_L = 159;
- public static final int ID_OUML_U = 160;
- public static final int ID_PARA = 161;
- public static final int ID_PART = 162;
- public static final int ID_PERMIL = 163;
- public static final int ID_PERP = 164;
- public static final int ID_PHI_L = 165;
- public static final int ID_PHI_U = 166;
- public static final int ID_PIV = 167;
- public static final int ID_PI_L = 168;
- public static final int ID_PI_U = 169;
- public static final int ID_PLUSMN = 170;
- public static final int ID_POUND = 171;
- public static final int ID_PRIME_L = 172;
- public static final int ID_PRIME_U = 173;
- public static final int ID_PROD = 174;
- public static final int ID_PROP = 175;
- public static final int ID_PSI_L = 176;
- public static final int ID_PSI_U = 177;
- public static final int ID_QUOT = 178;
- public static final int ID_RADIC = 179;
- public static final int ID_RANG = 180;
- public static final int ID_RAQUO = 181;
- public static final int ID_RARR_L = 182;
- public static final int ID_RARR_U = 183;
- public static final int ID_RCEIL = 184;
- public static final int ID_RDQUO = 185;
- public static final int ID_REAL = 186;
- public static final int ID_REG = 187;
- public static final int ID_RFLOOR = 188;
- public static final int ID_RHO_L = 189;
- public static final int ID_RHO_U = 190;
- public static final int ID_RLM = 191;
- public static final int ID_RSAQUO = 192;
- public static final int ID_RSQUO = 193;
- public static final int ID_SBQUO = 194;
- public static final int ID_SCARON_L = 195;
- public static final int ID_SCARON_U = 196;
- public static final int ID_SDOT = 197;
- public static final int ID_SECT = 198;
- public static final int ID_SHY = 199;
- public static final int ID_SIGMAF = 200;
- public static final int ID_SIGMA_L = 201;
- public static final int ID_SIGMA_U = 202;
- public static final int ID_SIM = 203;
- public static final int ID_SPADES = 204;
- public static final int ID_SUB = 205;
- public static final int ID_SUBE = 206;
- public static final int ID_SUM = 207;
- public static final int ID_SUP = 208;
- public static final int ID_SUP1 = 209;
- public static final int ID_SUP2 = 210;
- public static final int ID_SUP3 = 211;
- public static final int ID_SUPE = 212;
- public static final int ID_SZLIG = 213;
- public static final int ID_TAU_L = 214;
- public static final int ID_TAU_U = 215;
- public static final int ID_THERE4 = 216;
- public static final int ID_THETASYM = 217;
- public static final int ID_THETA_L = 218;
- public static final int ID_THETA_U = 219;
- public static final int ID_THINSP = 220;
- public static final int ID_THORN_L = 221;
- public static final int ID_THORN_U = 222;
- public static final int ID_TILDE = 223;
- public static final int ID_TIMES = 224;
- public static final int ID_TRADE = 225;
- public static final int ID_UACUTE_L = 226;
- public static final int ID_UACUTE_U = 227;
- public static final int ID_UARR_L = 228;
- public static final int ID_UARR_U = 229;
- public static final int ID_UCIRC_L = 230;
- public static final int ID_UCIRC_U = 231;
- public static final int ID_UGRAVE_L = 232;
- public static final int ID_UGRAVE_U = 233;
- public static final int ID_UML = 234;
- public static final int ID_UPSIH = 235;
- public static final int ID_UPSILON_L = 236;
- public static final int ID_UPSILON_U = 237;
- public static final int ID_UUML_L = 238;
- public static final int ID_UUML_U = 239;
- public static final int ID_WEIERP = 240;
- public static final int ID_XI_L = 241;
- public static final int ID_XI_U = 242;
- public static final int ID_YACUTE_L = 243;
- public static final int ID_YACUTE_U = 244;
- public static final int ID_YEN = 245;
- public static final int ID_YUML_L = 246;
- public static final int ID_YUML_U = 247;
- public static final int ID_ZETA_L = 248;
- public static final int ID_ZETA_U = 249;
- public static final int ID_ZWJ = 250;
- public static final int ID_ZWNJ = 251;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 252.
- // -- 5/24/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_AACUTE_L] = AACUTE_L;
- names[Ids.ID_AACUTE_U] = AACUTE_U;
- names[Ids.ID_ACIRC_L] = ACIRC_L;
- names[Ids.ID_ACIRC_U] = ACIRC_U;
- names[Ids.ID_ACUTE] = ACUTE;
- names[Ids.ID_AELIG_L] = AELIG_L;
- names[Ids.ID_AELIG_U] = AELIG_U;
- names[Ids.ID_AGRAVE_L] = AGRAVE_L;
- names[Ids.ID_AGRAVE_U] = AGRAVE_U;
- names[Ids.ID_ALEFSYM] = ALEFSYM;
- names[Ids.ID_ALPHA_L] = ALPHA_L;
- names[Ids.ID_ALPHA_U] = ALPHA_U;
- names[Ids.ID_AMP] = AMP;
- names[Ids.ID_AND] = AND;
- names[Ids.ID_ANG] = ANG;
- names[Ids.ID_ARING_L] = ARING_L;
- names[Ids.ID_ARING_U] = ARING_U;
- names[Ids.ID_ASYMP] = ASYMP;
- names[Ids.ID_ATILDE_L] = ATILDE_L;
- names[Ids.ID_ATILDE_U] = ATILDE_U;
- names[Ids.ID_AUML_L] = AUML_L;
- names[Ids.ID_AUML_U] = AUML_U;
- names[Ids.ID_BDQUO] = BDQUO;
- names[Ids.ID_BETA_L] = BETA_L;
- names[Ids.ID_BETA_U] = BETA_U;
- names[Ids.ID_BRVBAR] = BRVBAR;
- names[Ids.ID_BULL] = BULL;
- names[Ids.ID_CAP] = CAP;
- names[Ids.ID_CCEDIL_L] = CCEDIL_L;
- names[Ids.ID_CCEDIL_U] = CCEDIL_U;
- names[Ids.ID_CEDIL] = CEDIL;
- names[Ids.ID_CENT] = CENT;
- names[Ids.ID_CHI_L] = CHI_L;
- names[Ids.ID_CHI_U] = CHI_U;
- names[Ids.ID_CIRC] = CIRC;
- names[Ids.ID_CLUBS] = CLUBS;
- names[Ids.ID_CONG] = CONG;
- names[Ids.ID_COPY] = COPY;
- names[Ids.ID_CRARR] = CRARR;
- names[Ids.ID_CUP] = CUP;
- names[Ids.ID_CURREN] = CURREN;
- names[Ids.ID_DAGGER_L] = DAGGER_L;
- names[Ids.ID_DAGGER_U] = DAGGER_U;
- names[Ids.ID_DARR_L] = DARR_L;
- names[Ids.ID_DARR_U] = DARR_U;
- names[Ids.ID_DEG] = DEG;
- names[Ids.ID_DELTA_L] = DELTA_L;
- names[Ids.ID_DELTA_U] = DELTA_U;
- names[Ids.ID_DIAMS] = DIAMS;
- names[Ids.ID_DIVIDE] = DIVIDE;
- names[Ids.ID_EACUTE_L] = EACUTE_L;
- names[Ids.ID_EACUTE_U] = EACUTE_U;
- names[Ids.ID_ECIRC_L] = ECIRC_L;
- names[Ids.ID_ECIRC_U] = ECIRC_U;
- names[Ids.ID_EGRAVE_L] = EGRAVE_L;
- names[Ids.ID_EGRAVE_U] = EGRAVE_U;
- names[Ids.ID_EMPTY] = EMPTY;
- names[Ids.ID_EMSP] = EMSP;
- names[Ids.ID_ENSP] = ENSP;
- names[Ids.ID_EPSILON_L] = EPSILON_L;
- names[Ids.ID_EPSILON_U] = EPSILON_U;
- names[Ids.ID_EQUIV] = EQUIV;
- names[Ids.ID_ETA_L] = ETA_L;
- names[Ids.ID_ETA_U] = ETA_U;
- names[Ids.ID_ETH_L] = ETH_L;
- names[Ids.ID_ETH_U] = ETH_U;
- names[Ids.ID_EUML_L] = EUML_L;
- names[Ids.ID_EUML_U] = EUML_U;
- names[Ids.ID_EURO] = EURO;
- names[Ids.ID_EXIST] = EXIST;
- names[Ids.ID_FNOF] = FNOF;
- names[Ids.ID_FORALL] = FORALL;
- names[Ids.ID_FRAC12] = FRAC12;
- names[Ids.ID_FRAC14] = FRAC14;
- names[Ids.ID_FRAC34] = FRAC34;
- names[Ids.ID_FRASL] = FRASL;
- names[Ids.ID_GAMMA_L] = GAMMA_L;
- names[Ids.ID_GAMMA_U] = GAMMA_U;
- names[Ids.ID_GE] = GE;
- names[Ids.ID_GT] = GT;
- names[Ids.ID_HARR_L] = HARR_L;
- names[Ids.ID_HARR_U] = HARR_U;
- names[Ids.ID_HEARTS] = HEARTS;
- names[Ids.ID_HELLIP] = HELLIP;
- names[Ids.ID_IACUTE_L] = IACUTE_L;
- names[Ids.ID_IACUTE_U] = IACUTE_U;
- names[Ids.ID_ICIRC_L] = ICIRC_L;
- names[Ids.ID_ICIRC_U] = ICIRC_U;
- names[Ids.ID_IEXCL] = IEXCL;
- names[Ids.ID_IGRAVE_L] = IGRAVE_L;
- names[Ids.ID_IGRAVE_U] = IGRAVE_U;
- names[Ids.ID_IMAGE] = IMAGE;
- names[Ids.ID_INFIN] = INFIN;
- names[Ids.ID_INT] = INT;
- names[Ids.ID_IOTA_L] = IOTA_L;
- names[Ids.ID_IOTA_U] = IOTA_U;
- names[Ids.ID_IQUEST] = IQUEST;
- names[Ids.ID_ISIN] = ISIN;
- names[Ids.ID_IUML_L] = IUML_L;
- names[Ids.ID_IUML_U] = IUML_U;
- names[Ids.ID_KAPPA_L] = KAPPA_L;
- names[Ids.ID_KAPPA_U] = KAPPA_U;
- names[Ids.ID_LAMBDA_L] = LAMBDA_L;
- names[Ids.ID_LAMBDA_U] = LAMBDA_U;
- names[Ids.ID_LANG] = LANG;
- names[Ids.ID_LAQUO] = LAQUO;
- names[Ids.ID_LARR_L] = LARR_L;
- names[Ids.ID_LARR_U] = LARR_U;
- names[Ids.ID_LCEIL] = LCEIL;
- names[Ids.ID_LDQUO] = LDQUO;
- names[Ids.ID_LE] = LE;
- names[Ids.ID_LFLOOR] = LFLOOR;
- names[Ids.ID_LOWAST] = LOWAST;
- names[Ids.ID_LOZ] = LOZ;
- names[Ids.ID_LRM] = LRM;
- names[Ids.ID_LSAQUO] = LSAQUO;
- names[Ids.ID_LSQUO] = LSQUO;
- names[Ids.ID_LT] = LT;
- names[Ids.ID_MACR] = MACR;
- names[Ids.ID_MDASH] = MDASH;
- names[Ids.ID_MICRO] = MICRO;
- names[Ids.ID_MIDDOT] = MIDDOT;
- names[Ids.ID_MINUS] = MINUS;
- names[Ids.ID_MU_L] = MU_L;
- names[Ids.ID_MU_U] = MU_U;
- names[Ids.ID_NABLA] = NABLA;
- names[Ids.ID_NBSP] = NBSP;
- names[Ids.ID_NDASH] = NDASH;
- names[Ids.ID_NE] = NE;
- names[Ids.ID_NI] = NI;
- names[Ids.ID_NOT] = NOT;
- names[Ids.ID_NOTIN] = NOTIN;
- names[Ids.ID_NSUB] = NSUB;
- names[Ids.ID_NTILDE_L] = NTILDE_L;
- names[Ids.ID_NTILDE_U] = NTILDE_U;
- names[Ids.ID_NU_L] = NU_L;
- names[Ids.ID_NU_U] = NU_U;
- names[Ids.ID_OACUTE_L] = OACUTE_L;
- names[Ids.ID_OACUTE_U] = OACUTE_U;
- names[Ids.ID_OCIRC_L] = OCIRC_L;
- names[Ids.ID_OCIRC_U] = OCIRC_U;
- names[Ids.ID_OELIG_L] = OELIG_L;
- names[Ids.ID_OELIG_U] = OELIG_U;
- names[Ids.ID_OGRAVE_L] = OGRAVE_L;
- names[Ids.ID_OGRAVE_U] = OGRAVE_U;
- names[Ids.ID_OLINE] = OLINE;
- names[Ids.ID_OMEGA_L] = OMEGA_L;
- names[Ids.ID_OMEGA_U] = OMEGA_U;
- names[Ids.ID_OMICRON_L] = OMICRON_L;
- names[Ids.ID_OMICRON_U] = OMICRON_U;
- names[Ids.ID_OPLUS] = OPLUS;
- names[Ids.ID_OR] = OR;
- names[Ids.ID_ORDF] = ORDF;
- names[Ids.ID_ORDM] = ORDM;
- names[Ids.ID_OSLASH_L] = OSLASH_L;
- names[Ids.ID_OSLASH_U] = OSLASH_U;
- names[Ids.ID_OTILDE_L] = OTILDE_L;
- names[Ids.ID_OTILDE_U] = OTILDE_U;
- names[Ids.ID_OTIMES] = OTIMES;
- names[Ids.ID_OUML_L] = OUML_L;
- names[Ids.ID_OUML_U] = OUML_U;
- names[Ids.ID_PARA] = PARA;
- names[Ids.ID_PART] = PART;
- names[Ids.ID_PERMIL] = PERMIL;
- names[Ids.ID_PERP] = PERP;
- names[Ids.ID_PHI_L] = PHI_L;
- names[Ids.ID_PHI_U] = PHI_U;
- names[Ids.ID_PIV] = PIV;
- names[Ids.ID_PI_L] = PI_L;
- names[Ids.ID_PI_U] = PI_U;
- names[Ids.ID_PLUSMN] = PLUSMN;
- names[Ids.ID_POUND] = POUND;
- names[Ids.ID_PRIME_L] = PRIME_L;
- names[Ids.ID_PRIME_U] = PRIME_U;
- names[Ids.ID_PROD] = PROD;
- names[Ids.ID_PROP] = PROP;
- names[Ids.ID_PSI_L] = PSI_L;
- names[Ids.ID_PSI_U] = PSI_U;
- names[Ids.ID_QUOT] = QUOT;
- names[Ids.ID_RADIC] = RADIC;
- names[Ids.ID_RANG] = RANG;
- names[Ids.ID_RAQUO] = RAQUO;
- names[Ids.ID_RARR_L] = RARR_L;
- names[Ids.ID_RARR_U] = RARR_U;
- names[Ids.ID_RCEIL] = RCEIL;
- names[Ids.ID_RDQUO] = RDQUO;
- names[Ids.ID_REAL] = REAL;
- names[Ids.ID_REG] = REG;
- names[Ids.ID_RFLOOR] = RFLOOR;
- names[Ids.ID_RHO_L] = RHO_L;
- names[Ids.ID_RHO_U] = RHO_U;
- names[Ids.ID_RLM] = RLM;
- names[Ids.ID_RSAQUO] = RSAQUO;
- names[Ids.ID_RSQUO] = RSQUO;
- names[Ids.ID_SBQUO] = SBQUO;
- names[Ids.ID_SCARON_L] = SCARON_L;
- names[Ids.ID_SCARON_U] = SCARON_U;
- names[Ids.ID_SDOT] = SDOT;
- names[Ids.ID_SECT] = SECT;
- names[Ids.ID_SHY] = SHY;
- names[Ids.ID_SIGMAF] = SIGMAF;
- names[Ids.ID_SIGMA_L] = SIGMA_L;
- names[Ids.ID_SIGMA_U] = SIGMA_U;
- names[Ids.ID_SIM] = SIM;
- names[Ids.ID_SPADES] = SPADES;
- names[Ids.ID_SUB] = SUB;
- names[Ids.ID_SUBE] = SUBE;
- names[Ids.ID_SUM] = SUM;
- names[Ids.ID_SUP] = SUP;
- names[Ids.ID_SUP1] = SUP1;
- names[Ids.ID_SUP2] = SUP2;
- names[Ids.ID_SUP3] = SUP3;
- names[Ids.ID_SUPE] = SUPE;
- names[Ids.ID_SZLIG] = SZLIG;
- names[Ids.ID_TAU_L] = TAU_L;
- names[Ids.ID_TAU_U] = TAU_U;
- names[Ids.ID_THERE4] = THERE4;
- names[Ids.ID_THETASYM] = THETASYM;
- names[Ids.ID_THETA_L] = THETA_L;
- names[Ids.ID_THETA_U] = THETA_U;
- names[Ids.ID_THINSP] = THINSP;
- names[Ids.ID_THORN_L] = THORN_L;
- names[Ids.ID_THORN_U] = THORN_U;
- names[Ids.ID_TILDE] = TILDE;
- names[Ids.ID_TIMES] = TIMES;
- names[Ids.ID_TRADE] = TRADE;
- names[Ids.ID_UACUTE_L] = UACUTE_L;
- names[Ids.ID_UACUTE_U] = UACUTE_U;
- names[Ids.ID_UARR_L] = UARR_L;
- names[Ids.ID_UARR_U] = UARR_U;
- names[Ids.ID_UCIRC_L] = UCIRC_L;
- names[Ids.ID_UCIRC_U] = UCIRC_U;
- names[Ids.ID_UGRAVE_L] = UGRAVE_L;
- names[Ids.ID_UGRAVE_U] = UGRAVE_U;
- names[Ids.ID_UML] = UML;
- names[Ids.ID_UPSIH] = UPSIH;
- names[Ids.ID_UPSILON_L] = UPSILON_L;
- names[Ids.ID_UPSILON_U] = UPSILON_U;
- names[Ids.ID_UUML_L] = UUML_L;
- names[Ids.ID_UUML_U] = UUML_U;
- names[Ids.ID_WEIERP] = WEIERP;
- names[Ids.ID_XI_L] = XI_L;
- names[Ids.ID_XI_U] = XI_U;
- names[Ids.ID_YACUTE_L] = YACUTE_L;
- names[Ids.ID_YACUTE_U] = YACUTE_U;
- names[Ids.ID_YEN] = YEN;
- names[Ids.ID_YUML_L] = YUML_L;
- names[Ids.ID_YUML_U] = YUML_U;
- names[Ids.ID_ZETA_L] = ZETA_L;
- names[Ids.ID_ZETA_U] = ZETA_U;
- names[Ids.ID_ZWJ] = ZWJ;
- names[Ids.ID_ZWNJ] = ZWNJ;
- }
- private static char[] values = null;
-
- static {
- values = new char[Ids.getNumOfIds()];
- values[Ids.ID_AACUTE_L] = 225;
- values[Ids.ID_AACUTE_U] = 193;
- values[Ids.ID_ACIRC_L] = 226;
- values[Ids.ID_ACIRC_U] = 194;
- values[Ids.ID_ACUTE] = 180;
- values[Ids.ID_AELIG_L] = 230;
- values[Ids.ID_AELIG_U] = 198;
- values[Ids.ID_AGRAVE_L] = 224;
- values[Ids.ID_AGRAVE_U] = 192;
- values[Ids.ID_ALEFSYM] = 8501;
- values[Ids.ID_ALPHA_L] = 945;
- values[Ids.ID_ALPHA_U] = 913;
- values[Ids.ID_AMP] = 38;
- values[Ids.ID_AND] = 8743;
- values[Ids.ID_ANG] = 8736;
- values[Ids.ID_ARING_L] = 229;
- values[Ids.ID_ARING_U] = 197;
- values[Ids.ID_ASYMP] = 8776;
- values[Ids.ID_ATILDE_L] = 227;
- values[Ids.ID_ATILDE_U] = 195;
- values[Ids.ID_AUML_L] = 228;
- values[Ids.ID_AUML_U] = 196;
- values[Ids.ID_BDQUO] = 8222;
- values[Ids.ID_BETA_L] = 946;
- values[Ids.ID_BETA_U] = 914;
- values[Ids.ID_BRVBAR] = 166;
- values[Ids.ID_BULL] = 8226;
- values[Ids.ID_CAP] = 8745;
- values[Ids.ID_CCEDIL_L] = 231;
- values[Ids.ID_CCEDIL_U] = 199;
- values[Ids.ID_CEDIL] = 184;
- values[Ids.ID_CENT] = 162;
- values[Ids.ID_CHI_L] = 967;
- values[Ids.ID_CHI_U] = 935;
- values[Ids.ID_CIRC] = 710;
- values[Ids.ID_CLUBS] = 9827;
- values[Ids.ID_CONG] = 8773;
- values[Ids.ID_COPY] = 169;
- values[Ids.ID_CRARR] = 8629;
- values[Ids.ID_CUP] = 8746;
- values[Ids.ID_CURREN] = 164;
- values[Ids.ID_DAGGER_L] = 8224;
- values[Ids.ID_DAGGER_U] = 8225;
- values[Ids.ID_DARR_L] = 8595;
- values[Ids.ID_DARR_U] = 8659;
- values[Ids.ID_DEG] = 176;
- values[Ids.ID_DELTA_L] = 948;
- values[Ids.ID_DELTA_U] = 916;
- values[Ids.ID_DIAMS] = 9830;
- values[Ids.ID_DIVIDE] = 247;
- values[Ids.ID_EACUTE_L] = 233;
- values[Ids.ID_EACUTE_U] = 201;
- values[Ids.ID_ECIRC_L] = 234;
- values[Ids.ID_ECIRC_U] = 202;
- values[Ids.ID_EGRAVE_L] = 232;
- values[Ids.ID_EGRAVE_U] = 200;
- values[Ids.ID_EMPTY] = 8709;
- values[Ids.ID_EMSP] = 8195;
- values[Ids.ID_ENSP] = 8194;
- values[Ids.ID_EPSILON_L] = 949;
- values[Ids.ID_EPSILON_U] = 917;
- values[Ids.ID_EQUIV] = 8801;
- values[Ids.ID_ETA_L] = 951;
- values[Ids.ID_ETA_U] = 919;
- values[Ids.ID_ETH_L] = 240;
- values[Ids.ID_ETH_U] = 208;
- values[Ids.ID_EUML_L] = 235;
- values[Ids.ID_EUML_U] = 203;
- values[Ids.ID_EURO] = 8364;
- values[Ids.ID_EXIST] = 8707;
- values[Ids.ID_FNOF] = 402;
- values[Ids.ID_FORALL] = 8704;
- values[Ids.ID_FRAC12] = 189;
- values[Ids.ID_FRAC14] = 188;
- values[Ids.ID_FRAC34] = 190;
- values[Ids.ID_FRASL] = 8260;
- values[Ids.ID_GAMMA_L] = 947;
- values[Ids.ID_GAMMA_U] = 915;
- values[Ids.ID_GE] = 8805;
- values[Ids.ID_GT] = 62;
- values[Ids.ID_HARR_L] = 8596;
- values[Ids.ID_HARR_U] = 8660;
- values[Ids.ID_HEARTS] = 9829;
- values[Ids.ID_HELLIP] = 8230;
- values[Ids.ID_IACUTE_L] = 237;
- values[Ids.ID_IACUTE_U] = 205;
- values[Ids.ID_ICIRC_L] = 238;
- values[Ids.ID_ICIRC_U] = 206;
- values[Ids.ID_IEXCL] = 161;
- values[Ids.ID_IGRAVE_L] = 236;
- values[Ids.ID_IGRAVE_U] = 204;
- values[Ids.ID_IMAGE] = 8465;
- values[Ids.ID_INFIN] = 8734;
- values[Ids.ID_INT] = 8747;
- values[Ids.ID_IOTA_L] = 953;
- values[Ids.ID_IOTA_U] = 921;
- values[Ids.ID_IQUEST] = 191;
- values[Ids.ID_ISIN] = 8712;
- values[Ids.ID_IUML_L] = 239;
- values[Ids.ID_IUML_U] = 207;
- values[Ids.ID_KAPPA_L] = 954;
- values[Ids.ID_KAPPA_U] = 922;
- values[Ids.ID_LAMBDA_L] = 955;
- values[Ids.ID_LAMBDA_U] = 923;
- values[Ids.ID_LANG] = 9001;
- values[Ids.ID_LAQUO] = 171;
- values[Ids.ID_LARR_L] = 8592;
- values[Ids.ID_LARR_U] = 8656;
- values[Ids.ID_LCEIL] = 8968;
- values[Ids.ID_LDQUO] = 8220;
- values[Ids.ID_LE] = 8804;
- values[Ids.ID_LFLOOR] = 8970;
- values[Ids.ID_LOWAST] = 8727;
- values[Ids.ID_LOZ] = 9674;
- values[Ids.ID_LRM] = 8206;
- values[Ids.ID_LSAQUO] = 8249;
- values[Ids.ID_LSQUO] = 8216;
- values[Ids.ID_LT] = 60;
- values[Ids.ID_MACR] = 175;
- values[Ids.ID_MDASH] = 8212;
- values[Ids.ID_MICRO] = 181;
- values[Ids.ID_MIDDOT] = 183;
- values[Ids.ID_MINUS] = 8722;
- values[Ids.ID_MU_L] = 956;
- values[Ids.ID_MU_U] = 924;
- values[Ids.ID_NABLA] = 8711;
- values[Ids.ID_NBSP] = 160;
- values[Ids.ID_NDASH] = 8211;
- values[Ids.ID_NE] = 8800;
- values[Ids.ID_NI] = 8715;
- values[Ids.ID_NOT] = 172;
- values[Ids.ID_NOTIN] = 8713;
- values[Ids.ID_NSUB] = 8836;
- values[Ids.ID_NTILDE_L] = 241;
- values[Ids.ID_NTILDE_U] = 209;
- values[Ids.ID_NU_L] = 957;
- values[Ids.ID_NU_U] = 925;
- values[Ids.ID_OACUTE_L] = 243;
- values[Ids.ID_OACUTE_U] = 211;
- values[Ids.ID_OCIRC_L] = 244;
- values[Ids.ID_OCIRC_U] = 212;
- values[Ids.ID_OELIG_L] = 339;
- values[Ids.ID_OELIG_U] = 338;
- values[Ids.ID_OGRAVE_L] = 242;
- values[Ids.ID_OGRAVE_U] = 210;
- values[Ids.ID_OLINE] = 8254;
- values[Ids.ID_OMEGA_L] = 969;
- values[Ids.ID_OMEGA_U] = 937;
- values[Ids.ID_OMICRON_L] = 959;
- values[Ids.ID_OMICRON_U] = 927;
- values[Ids.ID_OPLUS] = 8853;
- values[Ids.ID_OR] = 8744;
- values[Ids.ID_ORDF] = 170;
- values[Ids.ID_ORDM] = 186;
- values[Ids.ID_OSLASH_L] = 248;
- values[Ids.ID_OSLASH_U] = 216;
- values[Ids.ID_OTILDE_L] = 245;
- values[Ids.ID_OTILDE_U] = 213;
- values[Ids.ID_OTIMES] = 8855;
- values[Ids.ID_OUML_L] = 246;
- values[Ids.ID_OUML_U] = 214;
- values[Ids.ID_PARA] = 182;
- values[Ids.ID_PART] = 8706;
- values[Ids.ID_PERMIL] = 8240;
- values[Ids.ID_PERP] = 8869;
- values[Ids.ID_PHI_L] = 966;
- values[Ids.ID_PHI_U] = 934;
- values[Ids.ID_PIV] = 982;
- values[Ids.ID_PI_L] = 960;
- values[Ids.ID_PI_U] = 928;
- values[Ids.ID_PLUSMN] = 177;
- values[Ids.ID_POUND] = 163;
- values[Ids.ID_PRIME_L] = 8242;
- values[Ids.ID_PRIME_U] = 8243;
- values[Ids.ID_PROD] = 8719;
- values[Ids.ID_PROP] = 8733;
- values[Ids.ID_PSI_L] = 968;
- values[Ids.ID_PSI_U] = 936;
- values[Ids.ID_QUOT] = 34;
- values[Ids.ID_RADIC] = 8730;
- values[Ids.ID_RANG] = 9002;
- values[Ids.ID_RAQUO] = 187;
- values[Ids.ID_RARR_L] = 8594;
- values[Ids.ID_RARR_U] = 8658;
- values[Ids.ID_RCEIL] = 8969;
- values[Ids.ID_RDQUO] = 8221;
- values[Ids.ID_REAL] = 8476;
- values[Ids.ID_REG] = 174;
- values[Ids.ID_RFLOOR] = 8971;
- values[Ids.ID_RHO_L] = 961;
- values[Ids.ID_RHO_U] = 929;
- values[Ids.ID_RLM] = 8207;
- values[Ids.ID_RSAQUO] = 8250;
- values[Ids.ID_RSQUO] = 8217;
- values[Ids.ID_SBQUO] = 8218;
- values[Ids.ID_SCARON_L] = 353;
- values[Ids.ID_SCARON_U] = 352;
- values[Ids.ID_SDOT] = 8901;
- values[Ids.ID_SECT] = 167;
- values[Ids.ID_SHY] = 173;
- values[Ids.ID_SIGMAF] = 962;
- values[Ids.ID_SIGMA_L] = 963;
- values[Ids.ID_SIGMA_U] = 931;
- values[Ids.ID_SIM] = 8764;
- values[Ids.ID_SPADES] = 9824;
- values[Ids.ID_SUB] = 8834;
- values[Ids.ID_SUBE] = 8838;
- values[Ids.ID_SUM] = 8721;
- values[Ids.ID_SUP] = 8835;
- values[Ids.ID_SUP1] = 185;
- values[Ids.ID_SUP2] = 178;
- values[Ids.ID_SUP3] = 179;
- values[Ids.ID_SUPE] = 8839;
- values[Ids.ID_SZLIG] = 223;
- values[Ids.ID_TAU_L] = 964;
- values[Ids.ID_TAU_U] = 932;
- values[Ids.ID_THERE4] = 8756;
- values[Ids.ID_THETASYM] = 977;
- values[Ids.ID_THETA_L] = 952;
- values[Ids.ID_THETA_U] = 920;
- values[Ids.ID_THINSP] = 8201;
- values[Ids.ID_THORN_L] = 254;
- values[Ids.ID_THORN_U] = 222;
- values[Ids.ID_TILDE] = 732;
- values[Ids.ID_TIMES] = 215;
- values[Ids.ID_TRADE] = 8482;
- values[Ids.ID_UACUTE_L] = 250;
- values[Ids.ID_UACUTE_U] = 218;
- values[Ids.ID_UARR_L] = 8593;
- values[Ids.ID_UARR_U] = 8657;
- values[Ids.ID_UCIRC_L] = 251;
- values[Ids.ID_UCIRC_U] = 219;
- values[Ids.ID_UGRAVE_L] = 249;
- values[Ids.ID_UGRAVE_U] = 217;
- values[Ids.ID_UML] = 168;
- values[Ids.ID_UPSIH] = 978;
- values[Ids.ID_UPSILON_L] = 965;
- values[Ids.ID_UPSILON_U] = 933;
- values[Ids.ID_UUML_L] = 252;
- values[Ids.ID_UUML_U] = 220;
- values[Ids.ID_WEIERP] = 8472;
- values[Ids.ID_XI_L] = 958;
- values[Ids.ID_XI_U] = 926;
- values[Ids.ID_YACUTE_L] = 253;
- values[Ids.ID_YACUTE_U] = 221;
- values[Ids.ID_YEN] = 165;
- values[Ids.ID_YUML_L] = 255;
- values[Ids.ID_YUML_U] = 376;
- values[Ids.ID_ZETA_L] = 950;
- values[Ids.ID_ZETA_U] = 918;
- values[Ids.ID_ZWJ] = 8205;
- values[Ids.ID_ZWNJ] = 8204;
- }
-
- /**
- */
- public EntityCollection() {
- super(names, STRICT_CASE);
- }
-
- /**
- * Create an entity declaration.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param attrName java.lang.String
- */
- protected CMNode create(String entityName) {
- int id = getID(entityName);
- if (id == ID_UNKNOWN)
- return null;
-
- String value = String.valueOf(values[id]);
- HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
- return dec;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
deleted file mode 100644
index e16c9dd8aa..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
+++ /dev/null
@@ -1,84 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMDocument implementation for the HTML.
- */
-class H5CMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespaceImpl namespace = null;
- private HTML5ElementCollection elements = null;
- private EntityCollection entities = null;
- private AttributeCollection attributes = null;
-
- /**
- */
- public H5CMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
-
- attributes = new HTML5AttributeCollection();
- elements = new HTML5ElementCollection(attributes);
- entities = new EntityCollection();
- }
-
- AttributeCollection getAttributes() {
- return attributes;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getEntities() {
- return entities;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- if (entities == null)
- return null;
- return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java
deleted file mode 100644
index 0ba233aa50..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMDocument implementation for the HTML.
- */
-class HCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespaceImpl namespace = null;
- private ElementCollection elements = null;
- private EntityCollection entities = null;
- private AttributeCollection attributes = null;
-
- /**
- */
- public HCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
- attributes = new AttributeCollection();
- elements = new ElementCollection(attributes);
- entities = new EntityCollection();
- }
-
- AttributeCollection getAttributes() {
- return attributes;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getEntities() {
- return entities;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- if (entities == null)
- return null;
- return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
deleted file mode 100644
index 1f5065a230..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
+++ /dev/null
@@ -1,1348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-public class HTML5AttributeCollection extends AttributeCollection implements HTML50Namespace {
- /** html5 core attribs */
- private static final String[] CORE = {ATTR_NAME_ACCESSKEY, ATTR_NAME_CLASS, ATTR_NAME_CONTENT_EDITABLE, ATTR_NAME_CONTEXT_MENU, ATTR_NAME_DIR, ATTR_NAME_DRAGGABLE, ATTR_NAME_HIDDEN, ATTR_NAME_ID, ATTR_NAME_LANG, ATTR_NAME_SPELLCHECK,ATTR_NAME_STYLE, ATTR_NAME_TABINDEX, ATTR_NAME_TITLE};
- /** events for HTML5. */
- private static final String[] EVENTS = {ATTR_NAME_ONABORT, ATTR_NAME_ONBLUR, ATTR_NAME_ONCAN_PLAY, ATTR_NAME_ONCAN_PLAY_THROUGH, ATTR_NAME_ONCHANGE, ATTR_NAME_ONCLICK, ATTR_NAME_ONCONTEXT_MENU, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONDRAG, ATTR_NAME_ONDRAG_END, ATTR_NAME_ONDRAG_ENTER, ATTR_NAME_ONDRAG_LEAVE,
- ATTR_NAME_ONDRAG_OVER, ATTR_NAME_ONDRAG_START, ATTR_NAME_ONDROP, ATTR_NAME_ONDURATION_CHANGE, ATTR_NAME_ONEMPTIED, ATTR_NAME_ONENDED, ATTR_NAME_ONERROR, ATTR_NAME_ONFOCUS, ATTR_NAME_ONFORM_CHANGE, ATTR_NAME_ONFORM_INPUT, ATTR_NAME_ONINVALID,ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP,
- ATTR_NAME_ONLOAD, ATTR_NAME_ONLOAD_START, ATTR_NAME_ONLOADED_DATA, ATTR_NAME_ONLOADED_METADATA, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONMOUSE_WHEEL, ATTR_NAME_ONPAUSE, ATTR_NAME_ONPLAY, ATTR_NAME_ONPLAYING, ATTR_NAME_ONPROGRESS,
- ATTR_NAME_ONRATE_CHANGE, ATTR_NAME_ONREADY_STATE_CHANGE, ATTR_NAME_ONSCROLL, ATTR_NAME_ONSEEKED, ATTR_NAME_ONSEEKING, ATTR_NAME_ONSELECT, ATTR_NAME_ONSHOW, ATTR_NAME_ONSTALLED, ATTR_NAME_ONSUBMIT, ATTR_NAME_ONSUSPEND, ATTR_NAME_ONTIME_UPDATE, ATTR_NAME_ONVOLUME_UPDATE, ATTR_NAME_ONWAITING};
-
- protected HTMLAttrDeclImpl create(String attrName) {
- HTMLAttrDeclImpl attr = null;
- HTMLCMDataTypeImpl atype = null;
- if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOFOCUS)) {
- // (disabled (disabled) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] values = {ATTR_NAME_AUTOFOCUS};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT_EDITABLE)) {
- // (contenteditable (EMPTY|TRUE|FALSE|INHERIT) TRUE)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_INHERIT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT_EDITABLE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHALLENGE)) {
- // (challenge CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHALLENGE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTEXT_MENU)) {
- // (contextmenu, CDATA, IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DRAGGABLE)) {
- // (draggable (TRUE|FALSE|AUTO) TRUE)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_AUTO};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DRAGGABLE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FORM)) {
- // (form CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOVALIDATE)) {
- // (novalidate (novalidate) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOVALIDATE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_KEYTYPE)) {
- // (keytype CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_KEYTYPE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LOW)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LOW, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HIGH)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HIGH, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_OPTIMUM)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_OPTIMUM, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MIN)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAX)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_OPEN)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- atype.setEnumValues(new String[] { ATTR_NAME_OPEN });
- attr = new HTMLAttrDeclImpl(ATTR_NAME_OPEN, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PUBDATE)) {
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- atype.setEnumValues(new String[] { ATTR_NAME_PUBDATE });
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PUBDATE, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SPELLCHECK)) {
- // (spellcheck (EMPTY|TRUE|FALSE) TRUE)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SPELLCHECK, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONABORT)) {
- // (onabort %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONABORT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY)) {
- // (oncanplay %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY_THROUGH)) {
- // (oncanplaythrough %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY_THROUGH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCHANGE)) {
- // (onchange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCONTEXT_MENU)) {
- // (onacontextmenu %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG)) {
- // (onadrag %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_END)) {
- // (ondragend %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_END, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_ENTER)) {
- // (ondragenter %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_ENTER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_LEAVE)) {
- // (ondragleave %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_LEAVE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_OVER)) {
- // (ondragover %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_OVER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_START)) {
- // (ondragstart %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_START, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDROP)) {
- // (ondrop %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDROP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDURATION_CHANGE)) {
- // (ondurationchange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDURATION_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONEMPTIED)) {
- // (onemptied %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONEMPTIED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONENDED)) {
- // (onended %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONENDED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONERROR)) {
- // (onerror %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONERROR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
- // (onfocus %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_CHANGE)) {
- // (onformchange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_INPUT)) {
- // (onforminput %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_INPUT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINPUT)) {
- // (oninput %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINPUT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINVALID)) {
- // (oninvalid %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINVALID, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD)) {
- // (onload %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD_START)) {
- // (onloadstart %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD_START, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_DATA)) {
- // (onloadeddata %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_DATA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_METADATA)) {
- // (onloadedmetadata %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_METADATA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSE_WHEEL)) {
- // (onmousewheel %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSE_WHEEL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAY)) {
- // (onplay %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAYING)) {
- // (onplaying %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAYING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPAUSE)) {
- // (onpause %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPAUSE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPROGRESS)) {
- // (onprogress %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPROGRESS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRATE_CHANGE)) {
- // (onratechange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONREADY_STATE_CHANGE)) {
- // (onreadystatechange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONREADY_STATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSCROLL)) {
- // (onscroll %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSCROLL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKED)) {
- // (onseeked %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKING)) {
- // (onseeking %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSELECT)) {
- // (onselect %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSELECT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSHOW)) {
- // (onshow %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSHOW, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSTALLED)) {
- // (onstalled %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSTALLED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUBMIT)) {
- // (onsubmit %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUSPEND)) {
- // (onsuspend %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUSPEND, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONTIME_UPDATE)) {
- // (ontimeupdate %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONTIME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONVOLUME_UPDATE)) {
- // (onvolumeupdate %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONVOLUME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONWAITING)) {
- // (onwaiting %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONWAITING, atype, CMAttributeDeclaration.OPTIONAL);
- }
- else {
- attr = super.create(attrName);
- }
- return attr;
- }
-
- public void getAttrs(CMNamedNodeMapImpl declarations) {
- // %coreattrs;
- getCore(declarations);
- // %events;
- getEvents(declarations);
- }
-
- public void getCore(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(CORE).iterator();
- getDeclarations(declarations, names);
- }
-
- public void getEvents(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(EVENTS).iterator();
- getDeclarations(declarations, names);
- }
-
- public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
- /* (type %InputType; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (checked (checked) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (maxlength NUMBER #IMPLIED)
- * (src %URI; #IMPLIED)
- * (alt CDATA #IMPLIED) ... should be defined locally.
- * (accept %ContentTypes; #IMPLIED)
- * (width CDATA; #IMPLIED)
- * (height CDATA; #IMPLIED)
- * (autocomplete Boolean; #IMPLIED)
- * (autofocus Boolean; #IMPLIED)
- * (form CDATA; #IMPLIED)
- * (formaction)
- * (formenctype)
- * (formmethod)
- * (formnovalidate)
- * (formtarget)
- * (list)
- * (max)
- * (min)
- * (multiple)
- * (pattern)
- * (placeholder CDATA #IMPLIED)
- * (required)
- * (step)
- * discouraged tags :-
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- */
- if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %InputType; TEXT) ... should be defined locally.
- // NOTE: %InputType is ENUM;
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button
- // color| date | time | datetime | datetime-local | month | week| email|
- // number | range | search | tel)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON,
- ATTR_VALUE_COLOR, ATTR_VALUE_DATE, ATTR_VALUE_DATETIME, ATTR_VALUE_DATETIME_LOCAL, ATTR_VALUE_EMAIL, ATTR_VALUE_MONTH, ATTR_VALUE_NUMBER_STRING, ATTR_VALUE_RANGE, ATTR_VALUE_SEARCH, ATTR_VALUE_TEL, ATTR_VALUE_TIME};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SIZE, attr);
-
- // (alt CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_ALT, attr);
-
-
- // (type %autocomeplete; ) ... should be defined locally.
- // NOTE: %autocomeplete is ENUM;
- // (on | off)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] autoCompleteValues = {ATTR_VALUE_ON, ATTR_VALUE_OFF};
- atype.setEnumValues(autoCompleteValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOCOMPLETE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_AUTOCOMPLETE, attr);
-
-
- // (form CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORM, attr);
-
-
- // (formaction URI #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
-
-
- // (type %formmethod; GET) ... should be defined locally.
- // NOTE: %formmethod is ENUM;
- // (GET|POST|PUT|DELETE)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
- atype.setEnumValues(formMethodValues);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
-
- // (type %formenctype; GET) ... should be defined locally.
- // NOTE: %formenctype is ENUM;
- // (application/x-www-form-urlencoded| multipart/form-data| text/plain)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
- atype.setEnumValues(formEncTypeValues);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
-
- // (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
-
- // (formtnovalidate #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
- atype.setEnumValues(formNoValidateValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
-
-
- // (list ID #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.ID);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LIST, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_LIST, attr);
-
- // (min CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_MIN, attr);
-
- // (max CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_MAX, attr);
-
- // (maxlength NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_MAXLENGTH, attr);
-
- // (multiple #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] multipleValues = {ATTR_NAME_MULTIPLE};
- atype.setEnumValues(multipleValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_MULTIPLE, attr);
-
-
- // (step CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_STEP, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_STEP, attr);
-
- // (placeholder CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
-
- // (pattern CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PATTERN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_PATTERN, attr);
-
- // (required #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] requiredValues = {ATTR_NAME_REQUIRED};
- atype.setEnumValues(requiredValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REQUIRED, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_REQUIRED, attr);
-
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_ACCEPT, //<<D215684
- ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT, //<D215684
- //html5
- ATTR_NAME_AUTOFOCUS
- };
- getDeclarations(attributes, Arrays.asList(names).iterator());
- //discouraged
- // (ismap (ismap) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] ismapValues = {ATTR_NAME_ISMAP};
- atype.setEnumValues(ismapValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_ISMAP, attr);
-
- // (usemap %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_USEMAP, attr);
-
-
- getDeclarations(attributes, Arrays.asList(names).iterator());
- }
- /* (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (type %ContentType; #IMPLIED): should be defined locally.
- * (rel %LinkTypes; #IMPLIED)
- * (media %MediaDesc; #IMPLIED)
- * // discouraged
- * (charset %Charset; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
- String[] names = { ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL, ATTR_NAME_MEDIA};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (sizes %Pixels; #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZES, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SIZES, attr);
-
- //discouraged
- // (charset %Charset; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
-
- // (rev %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_REV, attr);
-
- // (target %FrameTarget; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_TARGET, attr);
-
- }
- /* (type %ContentType; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (media %media_desc; #IMPLIED
- * //discouraged
- * (charset %Charset; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (directkey %Character; #IMPLIED)
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.A)){
- String[] names = { ATTR_NAME_MEDIA, ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL, ATTR_NAME_TARGET};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
-
- //discouraged
- // (charset %Charset; #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
-
- // (rev %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_REV, attr);
-
- // (directkey %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_DIRECTKEY, attr);
-
- // (shape %Shape; rect): %Shape; is (rect|circle|poly|default).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_RECT, ATTR_VALUE_CIRCLE, ATTR_VALUE_POLY, ATTR_VALUE_DEFAULT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_RECT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SHAPE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_SHAPE, attr);
-
- // (coords %Coords; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_COORDS, attr);
-
- // (name CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_NAME, attr);
-
- }
- else if (elementName.equals(HTML40Namespace.ElementName.FORM)) {
- super.createAttributeDeclarations(elementName, attributes);
-
- // (type %autocomeplete; ) ... should be defined locally.
- // NOTE: %autocomeplete is ENUM;
- // (on | off)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] autoCompleteValues = {ATTR_VALUE_ON, ATTR_VALUE_OFF};
- atype.setEnumValues(autoCompleteValues);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOCOMPLETE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_AUTOCOMPLETE, attr);
- attributes.putNamedItem(ATTR_NAME_NOVALIDATE, create(ATTR_NAME_NOVALIDATE));
- }
- /*
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (alt %Text; #REQUIRED)
- * (media %media_desc; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * //disocuraged
- * (nohref (nohref) #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
- // (media %MediaDesc; #IMPLIED)
- String[] names = {ATTR_NAME_TYPE, ATTR_NAME_MEDIA, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_ALT, ATTR_NAME_REL};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (nohref (nohref) #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOHREF};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_NOHREF, attr);
-
- }
- /*
- * %globalattrs;
- * (http-equiv NAME #IMPLIED)
- * (name NAME #IMPLIED) ... should be defined locally.
- * (content CDATA #REQUIRED)
- * (charset %Charset; #IMPLIED)
- * //discouraged
- * (scheme CDATA #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.META)){
- // globalattrs;
- getAttrs(attributes);
-
- // (name NAME #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_NAME, attr);
-
- // (content CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_CONTENT, attr);
-
- String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CHARSET};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // discouraged
- // (scheme CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_SCHEME, attr);
-
- }
- /*
- * (src %URI; #REQUIRED): should be defined locally.
- * (alt %Text; #REQUIRED)
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * // discouraged
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (align %IAlign; #IMPLIED): should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mapfile %URI; #IMPLIED)
-
- */
- else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_SRC, attr);
-
- String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local); should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- }
- /*
- * (name CDATA #REQUIRED) ... should be defined locally.
- * (value CDATA #IMPLIED)
- * global attributes
- */
- else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
-
- // (name CDATA #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_NAME, attr);
-
- // (value CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_VALUE, attr);
-
- // gloabl attrs
- getAttrs(attributes);
- }
- /*
- * (autofocus Boolean; #IMPLIED)
- * (form CDATA; #IMPLIED)
- * (placeholder CDATA #IMPLIED)
- * (name CDATA #IMPLIED)
- * (rows NUMBER #REQUIRED)
- * (cols NUMBER #REQUIRED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (maxlength NUMBER; #IMPLIED)
- * (wrap ENUM; #IMPLIED)
- * //discouraged
- * (istyle CDATA #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
- String[] names = {ATTR_NAME_MAXLENGTH, ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS, ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (placeholder CDATA #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
-
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_SOFT, ATTR_VALUE_HARD};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SOFT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WRAP, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_WRAP, attr);
-
- // discouraged
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_ISTYLE, attr);
- }
- /*
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (asynch boolean #IMPLIED)
- * (src %URI; #IMPLIED)
- * (defer (defer) #IMPLIED)
- * // discouraged
- * (language CDATA #IMPLIED)
- * (event CDATA #IMPLIED)
- * (for %URI; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.SCRIPT)){
- String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_SRC, ATTR_NAME_DEFER};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_ASYNC};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ASYNC, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_ASYNC, attr);
-
-
- // discouraged
- // (language %CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_LANGUAGE, attr);
-
- // (event CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_EVENT, attr);
-
- // (for %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_FOR, attr);
-
- getAttrs(attributes);
- }
- /*
- * %attrs;
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (media %MediaDesc; #IMPLIED)
- * (scoped boolean; #implied)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
- // %i18n;
- getAttrs(attributes);
-
- String[] names = {ATTR_NAME_MEDIA};
- getDeclarations(attributes, Arrays.asList(names).iterator());
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_SCOPED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPED, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SCOPED, attr);
- }
- /*
- * %reserved;
- * (name CDATA #IMPLIED)
- * (size NUMBER #IMPLIED) ... should be defined locally.
- * (multiple (multiple) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (autofocus Boolean; #IMPLIED)
- * (form CDATA; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
- // (size NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SIZE, attr);
-
- String[] names = {ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS,ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- /*
- * (value NUMBER #IMPLIED) ... should be defined locally.
- * //discouraged
- * (type %LIStyle; #IMPLIED) ... should be defined locally.
- */
- else if (elementName.equals(HTML40Namespace.ElementName.LI)){
- // (type %LIStyle; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (value NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_VALUE, attr);
-
- }
- /*
- * (start NUMBER #IMPLIED)
- * (reversed BOOLEAN; IMPLIED)
- * //discouraged
- * (type %OLStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.OL)){
-
- String[] names = { ATTR_NAME_START};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_REVERSED};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_REVERSED, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_REVERSED, attr);
-
- //discouraged
- // (type %OLStyle; #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (compact (compact) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] compactValues = {ATTR_NAME_COMPACT};
- atype.setEnumValues(compactValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
- }
- /**
- * %attrs;
- * (src %URI; #IMPLIED)
- * (srcdoc %CONTENT_TYPE; #IMPLIED)
- * (seamless BOOLEAN; #IMPLIED)
- * (sandbox CDATA; #IMPLED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (name CDATA #IMPLIED)
- * //discouraged
- * (longdesc %URI; #IMPLIED)
- * (frameborder (1|0) 1)
- * (marginwidth %Pixels; #IMPLIED)
- * (marginheight %Pixels; #IMPLIED)
- * (scrolling (yes|no|auto) auto)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- */
- else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
- // %attrs;
- getAttrs(attributes);
-
- //srcdoc
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SRCDOC, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SRCDOC, attr);
-
- // (seamless (seamless) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] compactValues = {ATTR_NAME_SEAMLESS};
- atype.setEnumValues(compactValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SEAMLESS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SEAMLESS, attr);
-
- //sandbox
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SANDBOX, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_SANDBOX, attr);
-
-
- String[] names = { ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- //discouraged
- // (marginwidth %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_MARGINWIDTH, attr);
-
- // (marginheight %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_MARGINHEIGHT, attr);
-
- // (scrolling (yes|no|auto) auto)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_YES, ATTR_VALUE_NO, ATTR_VALUE_AUTO};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_AUTO);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLING, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_SCROLLING, attr);
-
- // (frameborder (1|0) 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] frameValues = {ATTR_VALUE_1, ATTR_VALUE_0};
- atype.setEnumValues(frameValues);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_FRAMEBORDER, attr);
-
- // (longdesc %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_LONGDESC, attr);
-
-
- // align
- attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
- }
- /*
- * (%attrs)
- * (manisfest %URI; #IMPLIED)
- * (xmlns %URI; #IMPLIED)
- * //discouraged
- * (version CDATA #FIXED '%HTML.Version;)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
- // %attrs;
- getAttrs(attributes);
- // (manisfest %URI; #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_MANIFEST, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_MANIFEST, attr);
-
- // (version CDATA #FIXED '%HTML.Version;)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_VERSION, attr);
-
- // (xmlns CDATA #FIXED '%xmlns;)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_XMLNS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_XMLNS, attr);
- }
- /*
- * (type enum; (context | toolbar | list))
- * (label %Text; #IMPLIED)
- * //discouraged
- * (compact (compact) #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
- // (type %menuType; list) ... should be defined locally is ENUM.
- // (context | toolbar | list)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_CONTEXT, ATTR_VALUE_TOOLBAR, ATTR_VALUE_LIST};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_LIST);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
- // (label %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_LABEL, attr);
-
- // (compact (compact) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] compactValues = {ATTR_NAME_COMPACT};
- atype.setEnumValues(compactValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
- }
- /*
- * (type %button; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (autofocus Boolean; #IMPLIED)
- * (form CDATA; #IMPLIED)
- * (formaction)
- * (formenctype)
- * (formmethod)
- * (formnovalidate)
- * (formtarget)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
- // (type (button|submit|reset) submit) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_TYPE, attr);
-
-
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED,
- //html5
- ATTR_NAME_AUTOFOCUS
- };
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (form CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORM, attr);
-
-
- // (formaction URI #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
-
-
- // (type %formmethod; GET) ... should be defined locally.
- // NOTE: %formmethod is ENUM;
- // (GET|POST|PUT|DELETE)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
- atype.setEnumValues(formMethodValues);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
-
- // (type %formenctype; GET) ... should be defined locally.
- // NOTE: %formenctype is ENUM;
- // (application/x-www-form-urlencoded| multipart/form-data| text/plain)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
- atype.setEnumValues(formEncTypeValues);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
-
- // (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
-
- // (formtnovalidate #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
- atype.setEnumValues(formNoValidateValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
-
- }
- /*
- * (name CDATA #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (form CDATA; #IMPLIED)
- */
- else if (elementName.equals(HTML40Namespace.ElementName.FIELDSET)){
- // (form CDATA #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(ATTR_NAME_FORM, attr);
-
- String[] names = {ATTR_NAME_NAME, ATTR_NAME_DISABLED };
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
- /*
- * (summary %Text; #IMPLIED)
- * //discouraged
- * %reserved;
- * (width %Length; #IMPLIED)
- * (border %Pixels; #IMPLIED)
- * (frame %TFrame; #IMPLIED)
- * (rules %TRules; #IMPLIED)
- * (cellspacing %Length; #IMPLIED)
- * (cellpadding %Length; #IMPLIED)
- * (align %TAlign; #IMPLIED)
- * (bgcolor %Color; #IMPLIED)
- * (datapagesize CDATA #IMPLIED)
- * (height %Pixels; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
- // %reserved;
- // ... %reserved; is empty in the current DTD.
-
- String[] names = {ATTR_NAME_SUMMARY};
- getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
- atype.setEnumValues(alignValues);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
-
- // (width %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_WIDTH, attr);
-
- // (border %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
- atype.setEnumValues(new String[] {"", "1"}); //$NON-NLS-1$ //$NON-NLS-2$
- //attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_BORDER, attr);
-
- // (frame %TFrame; #IMPLIED)
- // %TFrame; is
- // (void|above|below|hsides|lhs|rhs|vsides|box|border).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAME, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_FRAME, attr);
-
- // (rules %TRules; #IMPLIED)
- // %TRules; is (none | groups | rows | cols | all).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] ruleValues = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
- atype.setEnumValues(ruleValues);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_RULES, attr);
-
- // (cellspacing %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_CELLSPACING, attr);
-
- // (cellpadding %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_CELLPADDING, attr);
-
- // (bgcolor %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_BGCOLOR, attr);
-
- // (datapagesize CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_DATAPAGESIZE, attr);
-
- // (height %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_HEIGHT, attr);
-
- // (background %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_BACKGROUND, attr);
-
- // (bordercolor, %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
- attr.obsolete(true);
- attributes.putNamedItem(ATTR_NAME_BORDERCOLOR, attr);
-
-
- }
- }
-
- public static String[] getGlobalAttributeList(){
- return CORE;
- }
-
- public static String[] getGlobalEventList(){
- return EVENTS;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
deleted file mode 100644
index 9e2d4b82fb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
+++ /dev/null
@@ -1,577 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-class HTML5ElementCollection extends ElementCollection implements org.eclipse.wst.html.core.internal.provisional.HTML50Namespace.ElementName {
-
-
- // Element IDs
- private static class Ids50 extends Ids {
- // <<D205513
-
- public static final int ID_ARTICLE =106;
- public static final int ID_ASIDE =107;
- public static final int ID_AUDIO =108;
- public static final int ID_CANVAS =109;
- public static final int ID_COMMAND =110;
- public static final int ID_DATALIST =111;
- public static final int ID_DETAILS = 112;
- public static final int ID_FIGURE =113;
- public static final int ID_FIGCAPTION = 114;
- public static final int ID_FOOTER =115;
- public static final int ID_HEADER = 116;
- public static final int ID_HGROUP =117;
- public static final int ID_KEYGEN =118;
- public static final int ID_MARK =119;
- public static final int ID_MATH =120;
- public static final int ID_METER =121;
- public static final int ID_NAV =122;
- public static final int ID_OUTPUT =123;
- public static final int ID_PROGRESS =124;
- public static final int ID_RP = 125;
- public static final int ID_RT = 126;
- public static final int ID_RUBY =127;
- public static final int ID_SECTION =128;
- public static final int ID_SOURCE = 129;
- public static final int ID_SUMMARY = 130;
- public static final int ID_SVG =131;
- public static final int ID_TIME =132;
- public static final int ID_VIDEO =133;
-
- // D205513
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids50.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- /** %fontstyle;. TT | I | B | U | S | STRIKE | BIG | SMALL | BLINK */
- private static final String[] FONTSTYLE = {TT, I, B, U, S, STRIKE, BIG, SMALL, BLINK};
- /** %formctl;. INPUT | SELECT | TEXTAREA | LABEL | BUTTON */
- private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA, LABEL, BUTTON, DATALIST};
- /** %phrase;.
- * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM | MARK
- */ private static final String[] PHRASE = {KEYGEN, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, MARK};
- /** %special;.
- * A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
- * MAP | Q | SUB | SUP | SPAN | BDO | IFRAME | EMBED | MARQUEE |
- * D2W | SUBMIT
- * WBR | NOBR | BGSOUND
- */
- private static final String[] SPECIAL = {A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, WBR, // D205513
- SCRIPT, MAP, Q, SUB, SUP, SPAN, BDO, IFRAME, EMBED, BGSOUND, // D205513
- MARQUEE, NOBR, // D205513
- OUTPUT, TIME, METER, PROGRESS,
- COMMAND
- };
- /** %heading;. H[1-6] */
- private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
- /** %list;. UL | OL | DIR | MENU */
- private static final String[] LIST = {UL, OL, DIR, MENU};
- /** %preformatted;. PRE */
- private static final String[] PREFORMATTED = {PRE};
- /** %sectioning;. ARTICLE | ASIDE | NAV | SECTION */
- private static final String[] SECTIONING = { ARTICLE, ASIDE, NAV, SECTION };
-
- /** %embedded;. AUDIO|CANVAS|EMBED|IFRAME|IMG|MATH|OBJECT|SVG|VIDEO */
- private static final String[] EMBEDDED = { AUDIO, CANVAS, EMBED, IFRAME, IMG, MATH, OBJECT, SVG, VIDEO};
-
- private static String[] fNames = null;
-
- /**
- */
- public HTML5ElementCollection(AttributeCollection collection) {
- super(getNames(), collection);
- attributeCollection = collection;
- }
-
- /**
- * Actually creates HTMLElementDeclaration instance.
- * @return HTMLElementDeclaration
- */
- protected CMNode create(String elementName) {
- CMNode edec = null;
-
- if (elementName.equalsIgnoreCase(ACRONYM)) {
- edec = new HedPhrase(ACRONYM, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(APPLET)) {
- edec = new HedAPPLET(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(ARTICLE)) {
- edec = new HedSectioning(ARTICLE, this);
-
- }
- else if (elementName.equalsIgnoreCase(ASIDE)) {
- edec = new HedSectioning(ASIDE, this);
-
- }
- else if (elementName.equalsIgnoreCase(AUDIO)) {
- edec = new HedMediaElement(AUDIO, this);
-
- }
- else if (elementName.equalsIgnoreCase(BASEFONT)) {
- edec = new HedBASEFONT(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(BIG)) {
- edec = new HedFontStyle(BIG, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(CANVAS)) {
- edec = new HedCANVAS(this);
-
- }
- else if (elementName.equalsIgnoreCase(CENTER)) {
- edec = new HedCENTER(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(COMMAND)) {
- edec = new HedCOMMAND(this);
-
- }
- else if (elementName.equalsIgnoreCase(DATALIST)) {
- edec = new HedDATALIST(this);
-
- }
- else if (elementName.equalsIgnoreCase(DETAILS)) {
- edec = new HedDETAILS(this);
-
- }
- else if (elementName.equalsIgnoreCase(DIR)) {
- edec = new HedMENU(DIR, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(FIGCAPTION)) {
- edec = new HedFIGCAPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(FIGURE)) {
- edec = new HedFIGURE(this);
-
- }
- else if (elementName.equalsIgnoreCase(FOOTER)) {
- edec = new HedHEADER(HTML50Namespace.ElementName.FOOTER ,this);
-
- }
- else if (elementName.equalsIgnoreCase(FRAME)) {
- edec = new HedFRAME(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(FRAMESET)) {
- edec = new HedFRAMESET(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(HEADER)) {
- edec = new HedHEADER(HTML50Namespace.ElementName.HEADER ,this);
- }
- else if (elementName.equalsIgnoreCase(HGROUP)) {
- edec = new HedHGROUP(this);
-
- }
- else if (elementName.equalsIgnoreCase(ISINDEX)) {
- edec = new HedISINDEX(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(KEYGEN)) {
- edec = new HedKEYGEN(this);
-
- }
- else if (elementName.equalsIgnoreCase(MARK)) {
- edec = new HedPhrase(HTML50Namespace.ElementName.MARK,this);
-
- }
- else if (elementName.equalsIgnoreCase(MATH)) {
- edec = new HedMath(this);
-
- }
- else if (elementName.equalsIgnoreCase(METER)) {
- edec = new HedMETER(this);
- }
- else if (elementName.equalsIgnoreCase(NAV)) {
- edec = new HedSectioning(NAV, this);
- }
- else if (elementName.equalsIgnoreCase(NOFRAMES)) {
- edec = new HedNOFRAMES(this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(OUTPUT)) {
- edec = new HedOUTPUT(this);
-
- }
- else if (elementName.equalsIgnoreCase(PROGRESS)) {
- edec = new HedPROGRESS(this);
-
- }
- else if (elementName.equalsIgnoreCase(RP)) {
- edec = new HedRP(this);
-
- }
- else if (elementName.equalsIgnoreCase(RT)) {
- edec = new HedRT(this);
-
- }
- else if (elementName.equalsIgnoreCase(RUBY)) {
- edec = new HedRUBY(this);
-
- }
- else if (elementName.equalsIgnoreCase(S)) {
- edec = new HedFontStyle(S, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(SECTION)) {
- edec = new HedSectioning(SECTION, this);
-
- }
- else if (elementName.equalsIgnoreCase(SOURCE)) {
- edec = new HedSOURCE(this);
-
- }
- else if (elementName.equalsIgnoreCase(STRIKE)) {
- edec = new HedFontStyle(STRIKE, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(SUMMARY)) {
- edec = new HedSUMMARY(this);
- }
- else if (elementName.equalsIgnoreCase(SVG)) {
- edec = new HedSVG(this);
- }
- else if (elementName.equalsIgnoreCase(TIME)) {
- edec = new HedTIME(this);
- }
- else if (elementName.equalsIgnoreCase(TT)) {
- edec = new HedFontStyle(TT, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(U)) {
- edec = new HedFontStyle(U, this);
- ((HTMLElemDeclImpl) edec).obsolete(true);
- }
- else if (elementName.equalsIgnoreCase(VIDEO)) {
- edec = new HedVIDEO(this);
-
- }
- // unknown
- else {
- // NOTE: We don't define the UNKNOWN element declaration.
- // <code>null</code> for a declaration is a sign of
- // the target element is unknown.
- // -- 3/9/2001
- edec = super.create(elementName);
- }
- return edec;
- }
-
- public AttributeCollection getAttributeCollection() {
- return attributeCollection;
- }
-
- public final Collection getNamesOfBlock() {
- // P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
- // TABLE, FIELDSET, ADDRESS, RUBY, FIGURE
- String[] blockMisc = {HEADER, FOOTER, HGROUP, P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS, RUBY, FIGURE};
- Vector names = new Vector(Arrays.asList(blockMisc));
- // %heading;
- names.addAll(Arrays.asList(HEADING));
- // %list;
- names.addAll(Arrays.asList(LIST));
- // %preformatted;
- names.addAll(Arrays.asList(PREFORMATTED));
-
-
- return names;
- }
-
-
- public final void getSectioning(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SECTIONING).iterator());
- }
-
- public void getEmbedded(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(EMBEDDED).iterator());
- }
-
- public void getFlow(CMGroupImpl group) {
- if (group == null)
- return;
- super.getFlow(group);
- getSectioning(group);
- CMNode node = getNamedItem(DETAILS);
- if (node != null) {
- group.appendChild(node);
- }
- }
-
- public void getInline(CMGroupImpl group) {
- if (group == null)
- return;
- super.getInline(group);
- getEmbedded(group);
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFontstyle(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFormctrl(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FORMCTL).iterator());
- }
-
- /**
- * %heading;.
- * @param group CMGroupImpl Return values.
- */
- public final void getHeading(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(HEADING).iterator());
- }
-
-
-
- /**
- * %list;.
- * @param group CMGroupImpl Return values.
- */
- public final void getList(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(LIST).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getPhrase(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(PHRASE).iterator());
- }
-
- /**
- * %preformatted;
- * @param group CMGroupImpl Return values.
- */
- public final void getPreformatted(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getSpecial(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SPECIAL).iterator());
- }
-
- private static String[] getNames() {
- if (fNames == null) {
- fNames = new String[Ids50.getNumOfIds()];
- fNames[Ids.ID_A] = A;
- fNames[Ids.ID_ABBR] = ABBR;
- fNames[Ids.ID_ACRONYM] = ACRONYM;
- fNames[Ids.ID_ADDRESS] = ADDRESS;
- fNames[Ids.ID_APPLET] = APPLET;
- fNames[Ids.ID_AREA] = AREA;
- fNames[Ids50.ID_ARTICLE] = ARTICLE;
- fNames[Ids50.ID_ASIDE] = ASIDE;
- fNames[Ids50.ID_AUDIO] = AUDIO;
- fNames[Ids.ID_B] = B;
- fNames[Ids.ID_BASE] = BASE;
- fNames[Ids.ID_BASEFONT] = BASEFONT;
- fNames[Ids.ID_BDO] = BDO;
- fNames[Ids.ID_BIG] = BIG;
- fNames[Ids.ID_BLINK] = BLINK;
- fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
- fNames[Ids.ID_BODY] = BODY;
- fNames[Ids.ID_BR] = BR;
- fNames[Ids.ID_BUTTON] = BUTTON;
- fNames[Ids.ID_CAPTION] = CAPTION;
- fNames[Ids50.ID_CANVAS] = CANVAS;
- fNames[Ids.ID_CENTER] = CENTER;
- fNames[Ids.ID_CITE] = CITE;
- fNames[Ids.ID_CODE] = CODE;
- fNames[Ids.ID_COL] = COL;
- fNames[Ids.ID_COLGROUP] = COLGROUP;
- fNames[Ids50.ID_COMMAND] = COMMAND;
- fNames[Ids50.ID_DATALIST] = DATALIST;
- fNames[Ids50.ID_DETAILS] = DETAILS;
- fNames[Ids.ID_DD] = DD;
- fNames[Ids.ID_DEL] = DEL;
- fNames[Ids.ID_DFN] = DFN;
- fNames[Ids.ID_DIR] = DIR;
- fNames[Ids.ID_DIV] = DIV;
- fNames[Ids.ID_DL] = DL;
- fNames[Ids.ID_DT] = DT;
- fNames[Ids.ID_EM] = EM;
- fNames[Ids.ID_EMBED] = EMBED;
- fNames[Ids.ID_FIELDSET] = FIELDSET;
- fNames[Ids50.ID_FIGURE] = FIGURE;
- fNames[Ids50.ID_FIGCAPTION] = FIGCAPTION;
- fNames[Ids.ID_FONT] = FONT;
- fNames[Ids.ID_FORM] = FORM;
- fNames[Ids50.ID_FOOTER] = FOOTER;
- fNames[Ids.ID_FRAME] = FRAME;
- fNames[Ids.ID_FRAMESET] = FRAMESET;
- fNames[Ids.ID_H1] = H1;
- fNames[Ids.ID_H2] = H2;
- fNames[Ids.ID_H3] = H3;
- fNames[Ids.ID_H4] = H4;
- fNames[Ids.ID_H5] = H5;
- fNames[Ids.ID_H6] = H6;
- fNames[Ids.ID_HEAD] = HEAD;
- fNames[Ids50.ID_HEADER] = HEADER;
- fNames[Ids50.ID_HGROUP] = HGROUP;
- fNames[Ids.ID_HR] = HR;
- fNames[Ids.ID_HTML] = HTML;
- fNames[Ids.ID_I] = I;
- fNames[Ids.ID_IFRAME] = IFRAME;
- fNames[Ids.ID_IMG] = IMG;
- fNames[Ids.ID_INPUT] = INPUT;
- fNames[Ids.ID_INS] = INS;
- fNames[Ids.ID_ISINDEX] = ISINDEX;
- fNames[Ids.ID_KBD] = KBD;
- fNames[Ids50.ID_KEYGEN] = KEYGEN;
- fNames[Ids.ID_LABEL] = LABEL;
- fNames[Ids.ID_LEGEND] = LEGEND;
- fNames[Ids.ID_LI] = LI;
- fNames[Ids.ID_LINK] = LINK;
- fNames[Ids.ID_MAP] = MAP;
- fNames[Ids50.ID_MARK] = MARK;
- fNames[Ids.ID_MARQUEE] = MARQUEE;
- fNames[Ids50.ID_MATH] = MATH;
- fNames[Ids.ID_MENU] = MENU;
- fNames[Ids.ID_META] = META;
- fNames[Ids50.ID_METER] = METER;
- fNames[Ids50.ID_NAV] = NAV;
- fNames[Ids.ID_NOEMBED] = NOEMBED;
- fNames[Ids.ID_NOFRAMES] = NOFRAMES;
- fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
- fNames[Ids.ID_OBJECT] = OBJECT;
- fNames[Ids.ID_OL] = OL;
- fNames[Ids.ID_OPTGROUP] = OPTGROUP;
- fNames[Ids.ID_OPTION] = OPTION;
- fNames[Ids50.ID_OUTPUT] = OUTPUT;
- fNames[Ids.ID_P] = P;
- fNames[Ids.ID_PARAM] = PARAM;
- fNames[Ids.ID_PRE] = PRE;
- fNames[Ids50.ID_PROGRESS] = PROGRESS;
- fNames[Ids.ID_Q] = Q;
- fNames[Ids50.ID_RP] = RP;
- fNames[Ids50.ID_RT] = RT;
- fNames[Ids50.ID_RUBY] = RUBY;
- fNames[Ids.ID_S] = S;
- fNames[Ids.ID_SAMP] = SAMP;
- fNames[Ids.ID_SCRIPT] = SCRIPT;
- fNames[Ids50.ID_SECTION] = SECTION;
- fNames[Ids.ID_SELECT] = SELECT;
- fNames[Ids.ID_SMALL] = SMALL;
- fNames[Ids50.ID_SOURCE] = SOURCE;
- fNames[Ids.ID_SPAN] = SPAN;
- fNames[Ids.ID_STRIKE] = STRIKE;
- fNames[Ids.ID_STRONG] = STRONG;
- fNames[Ids.ID_STYLE] = STYLE;
- fNames[Ids50.ID_SUMMARY] = SUMMARY;
- fNames[Ids.ID_SUB] = SUB;
- fNames[Ids.ID_SUP] = SUP;
- fNames[Ids50.ID_SVG] = SVG;
- fNames[Ids.ID_TABLE] = TABLE;
- fNames[Ids.ID_TBODY] = TBODY;
- fNames[Ids.ID_TD] = TD;
- fNames[Ids.ID_TEXTAREA] = TEXTAREA;
- fNames[Ids.ID_TFOOT] = TFOOT;
- fNames[Ids.ID_TH] = TH;
- fNames[Ids.ID_THEAD] = THEAD;
- fNames[Ids50.ID_TIME] = TIME;
- fNames[Ids.ID_TITLE] = TITLE;
- fNames[Ids.ID_TR] = TR;
- fNames[Ids.ID_TT] = TT;
- fNames[Ids.ID_U] = U;
- fNames[Ids.ID_UL] = UL;
- fNames[Ids.ID_VAR] = VAR;
- fNames[Ids50.ID_VIDEO] = VIDEO;
- fNames[Ids.ID_WBR] = WBR;
- fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
- fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
- fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
- fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
- fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
- fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
- fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
- fNames[Ids.ID_SSI_SET] = SSI_SET;
- fNames[Ids.ID_BGSOUND] = BGSOUND;
- fNames[Ids.ID_NOBR] = NOBR;
- fNames[Ids.ID_WBR] = WBR;
- }
- return fNames;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
deleted file mode 100644
index 9c85e4a949..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
- private HTMLCMDataTypeImpl type = null;
- private int usage = 0;
- private boolean is_obsolete = false;
-
-
- /**
- */
- public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
- super(attrName);
- this.type = valueType;
-
- switch (valueUsage) {
- case OPTIONAL :
- case REQUIRED :
- case FIXED :
- case PROHIBITED :
- this.usage = valueUsage;
- break;
- default :
- // should warn...
- this.usage = OPTIONAL; // fall back
- break;
- }
- }
-
- /**
- * getAttrName method
- * @return java.lang.String
- */
- public String getAttrName() {
- return getNodeName();
- }
-
- /**
- * getAttrType method
- * @return CMDataType
- */
- public CMDataType getAttrType() {
- return type;
- }
-
- /**
- * @deprecated by superinterface
- */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /**
- * @deprecated by superinterface
- */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- /**
- * @return int
- */
- public int getUsage() {
- return usage;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE))
- return true;
- else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
- return is_obsolete;
-
- return super.supports(propertyName);
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE)) {
- return getAttrType().getDataTypeName() == HTMLCMDataType.SCRIPT ? new Boolean(true) : new Boolean(false);
- }
- else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
- return new Boolean(is_obsolete);
-
- return super.getProperty(propertyName);
- }
-
- public void obsolete(boolean is_obsolete){
- this.is_obsolete = is_obsolete;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
deleted file mode 100644
index 80adfe3b36..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMAttributeDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLAttributeDeclaration extends CMAttributeDeclaration {
- String IS_HTML = "isHTML"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
deleted file mode 100644
index 3c94c4706c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * HTML extension for data types.
- */
-public interface HTMLCMDataType extends CMDataType {
-
- /** Boolean; it should be defined in CMDataType. */
- public static final String BOOLEAN = "BOOLEAN"; //$NON-NLS-1$
- public static final String COLOR = "COLOR"; //$NON-NLS-1$
- public static final String EVENT = "EVENT"; //$NON-NLS-1$
- public static final String IDREFS = "IDREFS"; //$NON-NLS-1$
- /** Name; it should be defined in CMDataType. */
- public static final String NAME = "NAME"; //$NON-NLS-1$
- // Following types are just aliases.
- /** %Character; == CDATA */
- public static final String CHARACTER = CMDataType.CDATA;
- /** %Charset; == CDATA */
- public static final String CHARSET = CMDataType.CDATA;
- /** %Charsets; == CDATA */
- public static final String CHARSETS = CMDataType.CDATA;
- /** %ContentType; == CDATA */
- public static final String CONTENT_TYPE = CMDataType.CDATA;
- /** %Coords; == CDATA */
- public static final String COORDS = CMDataType.CDATA;
- /** %Datetime; == CDATA */
- public static final String DATETIME = CMDataType.CDATA;
- /** %FrameTarget; == CDATA */
- public static final String FRAME_TARGET = CMDataType.CDATA;
- /** %LanguageCode; == NAME */
- public static final String LANGUAGE_CODE = NAME;
- /** %Length; == CDATA */
- public static final String LENGTH = CMDataType.CDATA;
- /** %LinkTypes; == CDATA */
- public static final String LINK_TYPES = CMDataType.CDATA;
- /** %LIStyle; == CDATA */
- public static final String LI_STYLE = CMDataType.CDATA;
- /** %MediaDesc; == CDATA */
- public static final String MEDIA_DESC = CMDataType.CDATA;
- /** %MultiLength; == CDATA */
- public static final String MULTI_LENGTH = CMDataType.CDATA;
- /** %OLStyle; == CDATA */
- public static final String OL_STYLE = CMDataType.CDATA;
- /** %Pixles; == CDATA */
- public static final String PIXELS = CMDataType.CDATA;
- /** %Script; == EVENT */
- public static final String SCRIPT = EVENT;
- /** %StyleSheet; == EVENT */
- public static final String STYLE_SHEET = CMDataType.CDATA;
- /** %Text; == CDATA */
- public static final String TEXT = CMDataType.CDATA;
- /** %MediaType; == CDATA */
- public static final String MEDIA_TYPE = CMDataType.CDATA;
- /** %BrowsingContext; == CDATA */
- public static final String BROWSING_CONTEXT = CMDataType.CDATA;
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java
deleted file mode 100644
index 6e50c743c3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
- private int impliedValueKind = IMPLIED_VALUE_NONE;
- private String impliedValue = null;
- private final static String[] emptyArray = new String[0];
- private String[] enumValues = emptyArray;
- private String instanceValue = null;
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName) {
- super(typeName);
- }
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
- super(typeName);
- this.instanceValue = instanceValue;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * This method returns a suitable default value that can be used when an instance of the data type is created.
- * This returns null of a suitable default is not available.
- */
- public String generateInstanceValue() {
- return instanceValue;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
- */
- public String getDataTypeName() {
- return getNodeName();
- }
-
- /**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
- public String[] getEnumeratedValues() {
- return enumValues;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
- public String getImpliedValue() {
- return impliedValue;
- }
-
- /**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
- public int getImpliedValueKind() {
- return impliedValueKind;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- /**
- */
- void setEnumValues(String[] values) {
- enumValues = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- enumValues[i] = values[i];
- }
- }
-
- /**
- * package scope.
- */
- void setImpliedValue(int kind, String value) {
- switch (kind) {
- case IMPLIED_VALUE_FIXED :
- case IMPLIED_VALUE_DEFAULT :
- impliedValueKind = kind;
- impliedValue = value;
- break;
- case IMPLIED_VALUE_NONE :
- default :
- impliedValueKind = IMPLIED_VALUE_NONE;
- impliedValue = null; // maybe a null string?
- break;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java
deleted file mode 100644
index af6c7d9838..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-
-/**
- * HTML extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface HTMLCMDocument extends CMDocument {
-
- /**
- * A short hand method to get a element declaration for a HTML element.<br>
- * @param elementName java.lang.String
- */
- HTMLElementDeclaration getElementDeclaration(String elementName);
-
- /**
- * A short hand method to get a entity declaration of HTML documents.<br>
- * @param entityName java.lang.String
- */
- HTMLEntityDeclaration getEntityDeclaration(String entityName);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
deleted file mode 100644
index 7fa1cdf257..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.wst.html.core.internal.contentmodel.chtml.CHCMDocImpl;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * INodeAdapter factory for HTML and JSP documents.
- */
-public final class HTMLCMDocumentFactory {
-
- private static Hashtable cmdocs = new Hashtable();
- private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE, CMDocType.TAG21_DOC_TYPE, CMDocType.JSP21_DOC_TYPE, CMDocType.HTML5_DOC_TYPE});
-
- private static JCMDocImpl jsp11doc = null;
-
- /**
- * HTMLCMAdapterFactory constructor.
- */
- private HTMLCMDocumentFactory() {
- super();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- * @param cmtype
- * java.lang.String
- */
- public static CMDocument getCMDocument(String cmtype) {
- Object obj = cmdocs.get(cmtype);
- if (obj == null && cmtype != null) {
- if (supportedCMtypes.contains(cmtype)) {
- obj = doCreateCMDocument(cmtype);
- cmdocs.put(cmtype, obj);
- }
- }
-
- return (CMDocument) obj;
- }
-
- private static Object doCreateCMDocument(String cmtype) {
- if (CMDocType.HTML_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl h40ns = new CMNamespaceImpl(HTML40Namespace.HTML40_URI, HTML40Namespace.HTML40_TAG_PREFIX);
- HCMDocImpl html40doc = new HCMDocImpl(CMDocType.HTML_DOC_TYPE, h40ns);
- return html40doc;
- }
-
- else if (CMDocType.HTML5_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl h50ns = new CMNamespaceImpl(HTML50Namespace.HTML50_URI, HTML50Namespace.HTML50_TAG_PREFIX);
- H5CMDocImpl html50doc = new H5CMDocImpl(CMDocType.HTML5_DOC_TYPE, h50ns);
- return html50doc;
- }
-
- else if (CMDocType.JSP20_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
- JCM20DocImpl jsp20doc = new JCM20DocImpl(CMDocType.JSP20_DOC_TYPE, j20ns);
- return jsp20doc;
- }
-
- else if (CMDocType.JSP21_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX);
- JCM21DocImpl jsp21doc = new JCM21DocImpl(CMDocType.JSP21_DOC_TYPE, j21ns);
- return jsp21doc;
- }
-
- else if (CMDocType.TAG20_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
- TagCMDocImpl tag20doc = new TagCMDocImpl(CMDocType.TAG20_DOC_TYPE, j20ns);
- return tag20doc;
- }
-
- else if (CMDocType.TAG21_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX);
- TagCM21DocImpl tag21doc = new TagCM21DocImpl(CMDocType.TAG21_DOC_TYPE, j21ns);
- return tag21doc;
- }
-
- else if (CMDocType.JSP11_DOC_TYPE.equals(cmtype) || CMDocType.JSP12_DOC_TYPE.equals(cmtype)) {
- if (jsp11doc == null) {
- CMNamespaceImpl j11ns = new CMNamespaceImpl(JSP11Namespace.JSP11_URI, JSP11Namespace.JSP_TAG_PREFIX);
- jsp11doc = new JCMDocImpl(CMDocType.JSP11_DOC_TYPE, j11ns);
- }
- return jsp11doc;
- }
-
- else if (CMDocType.CHTML_DOC_TYPE.equals(cmtype)) {
- CMNamespaceImpl cH40ns = new CMNamespaceImpl(HTML40Namespace.HTML40_URI, HTML40Namespace.HTML40_TAG_PREFIX);
- CHCMDocImpl chtmldoc = new CHCMDocImpl(CMDocType.CHTML_DOC_TYPE, cH40ns);
- return chtmldoc;
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java
deleted file mode 100644
index a3623ecc1f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case. However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents. So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- /**
- * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
- * Otherwise, returns <code>false</code>.
- * @return boolean
- */
- boolean shouldIgnoreCase();
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
deleted file mode 100644
index 3f5a9b7f32..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
- // DTD
- protected CMNamedNodeMapImpl attributes = null;
- protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- /** Never access this field directly. Instead, use getComplexTypeDefinition method. */
- private ComplexTypeDefinition typeDefinition = null;
- protected CMGroupImpl inclusion = null;
- protected CMGroupImpl exclusion = null;
- // advanced information
- protected CMNamedNodeMap prohibitedAncestors = null;
- protected int correctionType = CORRECT_NONE;
- protected int formatType = FORMAT_HTML;
- protected int layoutType = LAYOUT_NONE;
- protected int omitType = OMIT_NONE;
- protected boolean keepSpaces = false;
- protected boolean indentChild = false;
- protected ElementCollection elementCollection = null;
- protected AttributeCollection attributeCollection = null;
- private boolean is_obsolete = false;
- protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
-
- /**
- * HTMLElemDeclImpl constructor.
- * In the HTML DTD, an element declaration has no specification
- * for its occurrence. Occurrence is specifed in content model, like
- * <code>(LI)+</code>. To avoid confusion (and complexity),
- * occurrence of an element declaration is always 1 (it means, min = 1 and
- * max = 1). Instead, occurrence of CMGroup represents actual occurrence
- * of the content.
- * <br>
- * @param name java.lang.String
- */
- public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
- super(elementName, 1, 1);
- elementCollection = collection;
- attributeCollection = collection.getAttributeCollection();
- }
-
- /**
- */
- protected abstract void createAttributeDeclarations();
-
- private ComplexTypeDefinition createComplexTypeDefinition() {
- if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
- return null;
-
- ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
- if (factory == null)
- return null; // fatal error.
-
- ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
- return def;
- }
-
- /**
- * Get an attribute declaration.
- */
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null) {
- createAttributeDeclarations();
- if (attributes == null)
- return null; // fail to create
- }
-
- CMNode cmnode = attributes.getNamedItem(attrName);
- if (cmnode == null) {
- return null;
- }
- else {
- return (HTMLAttributeDeclaration) cmnode; // already exists.
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes == null)
- createAttributeDeclarations(); // lazy eval.
- return attributes;
- }
-
- /**
- * Get an instance of complex type definition.
- */
- private ComplexTypeDefinition getComplexTypeDefinition() {
- if (typeDefinition == null)
- typeDefinition = createComplexTypeDefinition();
- return typeDefinition;
- }
-
- /**
- * Content.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and always return null.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMContent getContent() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContent() : null;
- }
-
- /**
- * Content type.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and return an appropriate type.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
- }
-
- /**
- * @see HTMLElementDeclaration#getCorrectionType
- */
- public int getCorrectionType() {
- return correctionType;
- }
-
- /**
- * HTML element doesn't have any data type. So, this method always
- * returns <code>null</code>.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMDataType getDataType() {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public String getElementName() {
- return getNodeName();
- }
-
- /**
- * Exclusion.
- * Almost elements don't have a exclusion.
- * Only classes those have exclusion should override this method.
- */
- public CMContent getExclusion() {
- return null;
- }
-
- /**
- * Default format type is <code>FORMAT_HTML</code>.<br>
- */
- public int getFormatType() {
- return formatType;
- }
-
- /**
- * Inclusion.
- * Almost elements don't have a inclusion.
- * Only classes those have inclusion should override this method.
- */
- public CMContent getInclusion() {
- return null;
- }
-
- /**
- */
- public int getLayoutType() {
- return layoutType;
- }
-
- /**
- * Line break hint is strongly related to layout type.
- * Indeed, in the C++DOM, it is determined from layout type only.
- * So, this implementation, as the default implementation for all declarations,
- * also determines from layout type only.<br>
- * @return int
- */
- public int getLineBreakHint() {
- switch (getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- return HTMLElementDeclaration.BREAK_AFTER_START;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- default :
- return HTMLElementDeclaration.BREAK_NONE;
- }
- }
-
- /**
- * No HTML element has local elements. So, this method always
- * returns an empty map.
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getLocalElements() {
- return EMPTY_MAP;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- /**
- */
- public int getOmitType() {
- return omitType;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null);
- }
- if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)) {
- return is_obsolete;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
-
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(true);
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null) ? def.getPrimaryCandidate() : null;
- }
- else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)){
- return new Boolean(is_obsolete);
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- /**
- * Return element names which terminates this element.<br>
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return null;
- }
-
- /**
- * return true when the element is a JSP element.
- */
- public boolean isJSP() {
- return false;
- }
-
- /**
- * In some elements, such as APPLET, a source generator should indent child
- * elements that their parents. That is, a source generator should generate
- * source of APPLET and PARAMS like this:
- * <PRE>
- * &lt;APPLET ...&gt;
- * &lt;PARAM ... &gt;
- * &lt;PARAM ... &gt;
- * &lt;/APPLET&gt;
- * <PRE>
- * @return boolean
- */
- public boolean shouldIndentChildSource() {
- return indentChild;
- }
-
- /**
- * Most of elements can compact spaces in their child text nodes.
- * Some special elements should keep them in their source.
- * @return boolean
- */
- public boolean shouldKeepSpaces() {
- return keepSpaces;
- }
-
- /**
- * @return boolean
- */
- public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
- Iterator i = getTerminators();
- if (i == null)
- return false;
- String nextName = nextElement.getElementName();
- while (i.hasNext()) {
- if (nextName.equals(i.next()))
- return true;
- }
- return false;
- }
-
- public void obsolete(boolean is_obsolete){
- this.is_obsolete = is_obsolete;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
deleted file mode 100644
index 8dbf0c8411..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMElementDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- * In addition to this, some interfaces are added to this interface,
- * those are specially to HTML elements.<br>
- */
-public interface HTMLElementDeclaration extends CMElementDeclaration {
-
- /** Tag ommission; Not ommisible. */
- int OMIT_NONE = 0;
- /** Tag ommission; Both tags are ommisible. */
- int OMIT_BOTH = 1;
- /** Tag ommission; The end tag is ommisible. */
- int OMIT_END = 2;
- /** Tag ommission; The end tag is ommitted when created. */
- int OMIT_END_DEFAULT = 3;
- /** Tag ommission; The end tag must be omitted. */
- int OMIT_END_MUST = 4;
- /** Line Break; No break. */
- int BREAK_NONE = 10;
- /** Line Break; Break after the start tag. */
- int BREAK_AFTER_START = 11;
- /** Line Break; Break both before the start tagn and after the end tag. */
- int BREAK_BEFORE_START_AND_AFTER_END = 12;
- /* Layout */
- /** initial value; the value should never returns to client programs. */
- int LAYOUT_NONE = 100;
- int LAYOUT_BLOCK = 101;
- int LAYOUT_WRAP = 102;
- /** No wrap object; like IMG, APPLET,... */
- int LAYOUT_OBJECT = 103;
- /** BR */
- int LAYOUT_BREAK = 104;
- /** Hidden object; like HTML or HEAD */
- int LAYOUT_HIDDEN = 105;
- /* Correction */
- /** Correct; No correct. */
- int CORRECT_NONE = 1000;
- /** Correct; Meaningless when the content is empty. */
- int CORRECT_EMPTY = 1001;
- /** Correct; Meaningless when no attribut is set. */
- int CORRECT_NEUTRAL = 1002;
- /** Correct; Meaningless when same element is nested. */
- int CORRECT_DUPLICATED = 1003;
- /** Format; HTML */
- int FORMAT_HTML = 10000;
- /** Format; SSI */
- int FORMAT_SSI = 10001;
- /** Format; JSP script */
- int FORMAT_JSP_SCRIPT = 10002;
- /** Format; JSP directive */
- int FORMAT_JSP_DIRECTIVE = 10003;
- /** Format; XML */
- int FORMAT_XML = 10004;
- /** Format; MW */
- int FORMAT_MW = 10005;
-
- /**
- * A short hand method to get an attribute declaration of a HTML element.
- * @param attrName java.lang.String
- */
- HTMLAttributeDeclaration getAttributeDeclaration(String attrName);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
deleted file mode 100644
index d43db28d45..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
- private java.lang.String value = null;
-
- /**
- * CMEntityDeclImpl constructor comment.
- * @param entityName java.lang.String; Entity name.
- * @param entityValue java.lang.String; Value string.
- */
- public HTMLEntityDeclImpl(String entityName, String entityValue) {
- super(entityName);
- value = entityValue;
- }
-
- /**
- * getName method
- * @return java.lang.String
- */
- public String getName() {
- return getNodeName();
- }
-
- /**
- * Get CMNode type.<br>
- * @return int; Always return ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ENTITY_DECLARATION;
- }
-
- /**
- * getValue method
- * @return java.lang.String
- */
- public String getValue() {
- return value;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- * Entities in HTML documents are always treated with ignoring cases.
- * Because no special entities are defined in JSP 1.0, this method
- * can always return <code>true</code>.<br>
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java
deleted file mode 100644
index 1f7b2d341a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMEntityDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLEntityDeclaration extends org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration {
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java
deleted file mode 100644
index 448bfb3747..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * This interface is commonly used in declaration implementation, and internal use.
- * Use getProperty() method for public use.
- */
-public interface HTMLPropertyDeclaration {
- /**
- * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
- * <ul>
- * <li>CORRECT_DUPLICATED - <code>GROUP_NODUP</code></li>
- * <li>CORRECT_EMPTY - <code>GROUP_COMPACT</code></li>
- * <li>CORRECT_NEUTRAL - <code>GROUP_NEUTRAL</code></li>
- * <li>CORRECT_NONE - <code>(N/A)</code></li>
- * </ul>
- * @return int
- */
- int getCorrectionType();
- /**
- * Get the list of declarations those should be excluded from the content.<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- CMContent getExclusion();
- /**
- * To determin the type, see the following files in the C++DOM:
- * ElementType.cpp - ElementType#setGroup().
- * Element.cpp - Element#getStartTag().
- * @return int
- */
- int getFormatType();
- /**
- * Get the list of declarations those should be included into the content.<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- CMContent getInclusion();
- /**
- * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
- * <ul>
- * <li>LAYOUT_BLOCK - <code>GROUP_BLOCK</code></li>
- * <li>LAYOUT_BREAK - <code>GROUP_BREAK</code></li>
- * <li>LAYOUT_HIDDEN - <code>GROUP_HIDDEN</code></li>
- * <li>LAYOUT_NONE - <code>(N/A)</code></li>
- * <li>LAYOUT_OBJECT - <code>GROUP_NOWRAP</code></li>
- * <li>LAYOUT_WRAP - <code>(N/A)</code></li>
- * </ul>
- * @return int
- */
- int getLayoutType();
- /**
- * To determine the type, see <code>Element::isBreakingBeforeElement()</code>
- * and <code>Element::isBreakingAfterElement()</code> defined in C++DOM/Element.cpp.<br>
- * @return int
- */
- int getLineBreakHint();
- /**
- * To determine the type, Check the HTML DTD.
- * And look up <code>GROUP_NOEND</code> in C++DOM/DTDParser.cpp.<br>
- * @return int
- */
- int getOmitType();
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap
- */
- CMNamedNodeMap getProhibitedAncestors();
- /**
- * return true when the element is a JSP element.
- */
- boolean isJSP();
- /**
- * @return boolean
- */
- boolean shouldIndentChildSource();
- /**
- * Some elements should keep spaces in its child text nodes.
- * For example, PRE and TEXTAREA. This method returns true,
- * if a target element is one of such elements.
- * @return boolean
- */
- boolean shouldKeepSpaces();
- /**
- * Returns <code>true</code>, if <code>nextElement</code> terminates
- * the current element.
- * Some elements like <code>P</code> terminates other <code>P</code>.
- * That is, when <code>&lt;P&gt;</code> appears at the next to <code>P</code>,
- * which end tags is omitted, it represents not only the beginning of the
- * new <code>P</code> element but also the end of the previous <code>P</code>.
- */
- boolean shouldTerminateAt(HTMLElementDeclaration nextElement);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
deleted file mode 100644
index 270fc91ae1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
- /**
- */
- public HedA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.A, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.A, attributes);
-
- }
-
- /**
- * Exclusion.
- * <code>A</code> has the exclusion.
- * It is <code>A</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode a = elementCollection.getNamedItem(HTML40Namespace.ElementName.A);
- if (a != null)
- exclusion.appendChild(a);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java
deleted file mode 100644
index b4913f46e9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
- /**
- */
- public HedADDRESS(ElementCollection collection) {
- super(HTML40Namespace.ElementName.ADDRESS, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
deleted file mode 100644
index 9a546f7f88..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * APPLET.
- */
-final class HedAPPLET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedAPPLET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.APPLET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %coreattrs;
- * (codebase %URI; #IMPLIED)
- * (archive CDATA #IMPLIED)
- * (code CDATA #IMPLIED)
- * (object CDATA #IMPLIED)
- * (alt %Text; #IMPLIED) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (width %Length; #REQUIRED)
- * (height %Length; #REQUIRED)
- * (align %IAlign; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mayscript (mayscript) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_CODE, HTML40Namespace.ATTR_NAME_OBJECT, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAYSCRIPT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // %align; ... should be defined locally.
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
deleted file mode 100644
index 322e65cd36..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * AREA.
- */
-final class HedAREA extends HedEmpty {
-
- /**
- */
- public HedAREA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.AREA, collection);
- // LAYOUT_HIDDEN.
- // Because, AREA is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * AREA.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.AREA, attributes);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java
deleted file mode 100644
index e528814937..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
- /**
- */
- public HedBASE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BASE, collection);
- // LAYOUT_HIDDEN.
- // Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * BASE.
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java
deleted file mode 100644
index 2c9109b273..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BASEFONT.
- */
-final class HedBASEFONT extends HedEmpty {
-
- /**
- */
- public HedBASEFONT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BASEFONT, collection);
- // LAYOUT_OBJECT - GROUP_NOWRAP.
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * BASEFONT.
- * (id ID #IMPLIED)
- * (size CDATA #REQUIRED) ... should be localy defined.
- * (color %Color; #IMPLIED)
- * (face CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (size CDATA #REQUIRED) ... should be localy defined.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java
deleted file mode 100644
index bcee51fe2d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BDO.
- */
-final class HedBDO extends HedInlineContainer {
-
- /**
- */
- public HedBDO(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BDO, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %coreattrs;
- * (lang %LanguageCode; #IMPLIED)
- * (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_LANG};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_LTR, HTML40Namespace.ATTR_VALUE_RTL};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DIR, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DIR, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java
deleted file mode 100644
index 3e731d8006..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-final class HedBGSOUND extends HedEmpty {
-
- public HedBGSOUND(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BGSOUND, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * (src, CDATA, #IMPLIED)
- * (loop, CDATA, #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return;
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // src
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_SRC);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
- // loop
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_INFINITE);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LOOP, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java
deleted file mode 100644
index d1cb608da1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
- /**
- */
- public HedBLOCKQUOTE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BLOCKQUOTE, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
deleted file mode 100644
index 3324a9ab6e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedBODY(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BODY, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_BOTH;
- }
-
- /**
- * %attrs;
- * %bodycolors;
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (marginwidth %Pixels; #IMPLIED) ... D205514
- * (marginheight %Pixels; #IMPLIED) .. D205514
- * (topmargin, CDATA, #IMPLIED) ...... D205514
- * (bottommargin, CDATA, #IMPLIED) ... D205514
- * (leftmargin, CDATA, #IMPLIED) ..... D205514
- * (rightmargin, CDATA, #IMPLIED) .... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %bodycolors;
- attributeCollection.getBodycolors(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BACKGROUND,
- // <<D205514
- HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_TOPMARGIN, HTML40Namespace.ATTR_NAME_BOTTOMMARGIN, HTML40Namespace.ATTR_NAME_LEFTMARGIN, HTML40Namespace.ATTR_NAME_RIGHTMARGIN
- // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Inclusion.
- * "Lazy eval."<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getInclusion() {
- if (inclusion != null)
- return inclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (INS|DEL)
- inclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.INS, HTML40Namespace.ElementName.DEL};
- elementCollection.getDeclarations(inclusion, Arrays.asList(names).iterator());
- return inclusion;
- }
-
- /**
- * BODY has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java
deleted file mode 100644
index 45fa6ce8ca..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
- /**
- */
- public HedBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BR, collection);
- // LAYOUT_BREAK.
- // Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BREAK;
- }
-
- /**
- * BR.
- * %coreattrs;
- * (clear (left | all | right | none) none)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // clear
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_CLEAR);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CLEAR, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
deleted file mode 100644
index 6ace2cbe6e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BUTTON.
- */
-final class HedBUTTON extends HedFlowContainer {
-
- /**
- */
- public HedBUTTON(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BUTTON, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.BUTTON, attributes);
-
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.IFRAME};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- elementCollection.getFormctrl(exclusion);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
deleted file mode 100644
index 453fb1ce01..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
+++ /dev/null
@@ -1,51 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-
-
-/**
- * CANVAS.
- */
-final class HedCANVAS extends HTMLElemDeclImpl {
-
- /**
- */
- public HedCANVAS(ElementCollection collection) {
- super(HTML50Namespace.ElementName.CANVAS, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (height, width)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
-
- String[] names = { HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
deleted file mode 100644
index 82b07dcac1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * CAPTION.
- */
-final class HedCAPTION extends HedInlineContainer {
-
- /**
- */
- public HedCAPTION(ElementCollection collection) {
- super(HTML40Namespace.ElementName.CAPTION, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (align %CAlign; #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForCaption();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java
deleted file mode 100644
index 9d5184f89f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
- /**
- */
- public HedCENTER(ElementCollection collection) {
- super(HTML40Namespace.ElementName.CENTER, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
deleted file mode 100644
index 14f322668a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COL.
- */
-final class HedCOL extends HedEmpty {
-
- /**
- */
- public HedCOL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.COL, collection);
- // LAYOUT_BLOCK.
- // Because, COL is GROUP_BLOCK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * COL.
- * %attrs;
- * (span NUMBER 1)
- * (width %MultiLength; #IMPLIED) ... should be defined locally.
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (span NUMBER 1)
- String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (width %MultiLength; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
deleted file mode 100644
index bd2e74ffa5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COLGROUP.
- */
-final class HedCOLGROUP extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT, HTML40Namespace.ElementName.TR};
-
- public HedCOLGROUP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.COLGROUP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (span NUMBER 1)
- * (width %MultiLength; #IMPLIED) ... should be defined locally.
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (width %MultiLength; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
deleted file mode 100644
index 3fc7c036bf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
+++ /dev/null
@@ -1,94 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * COMMAND.
- */
-final class HedCOMMAND extends HTMLElemDeclImpl {
-
- /**
- */
- public HedCOMMAND(ElementCollection collection) {
- super(HTML50Namespace.ElementName.COMMAND, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * COMMAND.
- * %attrs;
- * // (type %CommandTYPE; command | checkbox|radio)
- * // (label %CDATA; #REQUIRED)
- * // (icon %URI; #OPTIONAL)
- * // (disabled %BOOLEAN; #OPTIONAL)
- * // (checked %BOOLEAN; #OPTIONAL)
- * // (radiogroup %TEXT; #OPTIONAL)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %CommandTYPE; command | checkbox|radio)
- // NOTE: %InputType is ENUM;
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML50Namespace.ATTR_VALUE_COMMAND, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML50Namespace.ATTR_VALUE_COMMAND);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // (label %CDATA; #REQUIRED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
-
- // (icon %URI; #OPTIONAL)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_ICON, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_ICON, attr);
-
-
- // (disabled %BOOLEAN; #OPTIONAL)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DISABLED, attr);
-
- // (checked %BOOLEAN; #OPTIONAL)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CHECKED, attr);
-
- // (radiogroup %TEXT; #OPTIONAL)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_RADIOGROUP, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_RADIOGROUP, attr);
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
deleted file mode 100644
index ba671c6ca5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
+++ /dev/null
@@ -1,47 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-/**
- * DATALIST.
- */
-final class HedDATALIST extends HTMLElemDeclImpl {
-
- /**
- */
- public HedDATALIST(ElementCollection collection) {
- super(HTML50Namespace.ElementName.DATALIST, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DATALIST;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java
deleted file mode 100644
index 6004f847e3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
- /**
- */
- public HedDD(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DD, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
deleted file mode 100644
index a4e8f01a83..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
+++ /dev/null
@@ -1,38 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class HedDETAILS extends HTMLElemDeclImpl {
-
- public HedDETAILS(ElementCollection collection) {
- super(HTML50Namespace.ElementName.DETAILS, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
- }
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- CMNode node = attributeCollection.getDeclaration(HTML50Namespace.ATTR_NAME_OPEN);
- if (node != null)
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_OPEN, node);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java
deleted file mode 100644
index b2cd2bcdc8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
- /**
- */
- public HedDIV(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DIV, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * %align;
- * %reserved;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %align;
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- // %reserved; ... empty
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java
deleted file mode 100644
index a45f2f89bb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
- /**
- */
- public HedDL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DL, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %arrays;
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java
deleted file mode 100644
index c4797fbc92..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
- /**
- */
- public HedDT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DT, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DT has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
deleted file mode 100644
index c1e301d6d5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * EMBED.
- */
-final class HedEMBED extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEMBED(ElementCollection collection) {
- super(HTML40Namespace.ElementName.EMBED, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMBED;
- layoutType = LAYOUT_OBJECT;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %coreattrs;
- * %events;
- * (src %URI; #REQUIRED) ... should be defined locally.
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (loop CDATA #IMPLIED)
- * (hidden CDATA #IMPLIED)
- * (volume CDATA #IMPLIED)
- * (autostart (true|false) #IMPLIED)
- * (autoplay (true|false) #IMPLIED)
- * (autosize (true|false) #IMPLIED)
- * (controller (true|false) true)
- * (scale CDATA #IMPLIED)
- * (showcontrols (true|false) #IMPLIED)
- * (playcount NUMBER #IMPLIED)
- * (repeat CDATA #IMPLIED)
- * (panel CDATA #IMPLIED)
- * (text CDATA #IMPLIED)
- * (palette CDATA #IMPLIED)
- * (textfocus CDATA #IMPLIED)
- * (type CDATA #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %events;
- attributeCollection.getEvents(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_HIDDEN, HTML40Namespace.ATTR_NAME_VOLUME, HTML40Namespace.ATTR_NAME_AUTOSTART, HTML40Namespace.ATTR_NAME_AUTOPLAY, HTML40Namespace.ATTR_NAME_AUTOSIZE, HTML40Namespace.ATTR_NAME_CONTROLLER, HTML40Namespace.ATTR_NAME_SCALE, HTML40Namespace.ATTR_NAME_SHOWCONTROLS, HTML40Namespace.ATTR_NAME_PLAYCOUNT, HTML40Namespace.ATTR_NAME_REPEAT, HTML40Namespace.ATTR_NAME_PANEL, HTML40Namespace.ATTR_NAME_TEXT, HTML40Namespace.ATTR_NAME_PALETTE, HTML40Namespace.ATTR_NAME_TEXTFOCUS};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (src %URI; #REQUIRED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // (type CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java
deleted file mode 100644
index 4a24b8061b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEmpty(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- // EMPTY type has no end tag.
- omitType = OMIT_END_MUST;
- }
-
- /**
- * Content.<br>
- * EMPTY type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.EMPTY;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
deleted file mode 100644
index 3e0d7ffa3d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * FIELDSET.
- */
-final class HedFIELDSET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFIELDSET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FIELDSET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.FIELDSET, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
deleted file mode 100644
index 9b6162c44b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
+++ /dev/null
@@ -1,37 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-public class HedFIGCAPTION extends HedFlowContainer {
- public HedFIGCAPTION(ElementCollection collection) {
- super(HTML50Namespace.ElementName.FIGCAPTION, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * Article.
- * %attrs;
- * Global attributes
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
deleted file mode 100644
index 87a4610446..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
+++ /dev/null
@@ -1,48 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-/**
- * FIGURE.
- */
-final class HedFIGURE extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFIGURE(ElementCollection collection) {
- super(HTML50Namespace.ElementName.FIGURE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIGURE;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
deleted file mode 100644
index 61dd455408..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FONT.
- */
-final class HedFONT extends HedInlineContainer {
-
- /**
- */
- public HedFONT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FONT, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %coreattrs;
- * %i18n;
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (color %Color; #IMPLIED)
- * (face CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
deleted file mode 100644
index 2e5dacb790..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
- /**
- */
- public HedFORM(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FORM, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (action %URI; #REQUIRED)
- * (method (GET|POST) GET)
- * (enctype %ContentType; "application/x-www-form-urlencoded")
- * (accept %ContentTypes; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (onsubmit %Script; #IMPLIED)
- * (onreset %Script; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (accept-charset %Charsets; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.FORM, attributes);
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode form = elementCollection.getNamedItem(HTML40Namespace.ElementName.FORM);
- if (form != null)
- exclusion.appendChild(form);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
deleted file mode 100644
index 768fe2466f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * FRAME.
- */
-final class HedFRAME extends HedEmpty {
-
- /**
- */
- public HedFRAME(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FRAME, collection);
- // LAYOUT_HIDDEN.
- // Because, FRAME is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * FRAME.
- * %coreattrs;
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (frameborder (1|0) 1)
- * (marginwidth %Pixels; #IMPLIED)
- * (marginheight %Pixels; #IMPLIED)
- * (noresize (noresize) #IMPLIED)
- * (scrolling (yes|no|auto) auto)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_FRAMEBORDER, HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_NORESIZE, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D20554
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
deleted file mode 100644
index 66000dcdbd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FRAMESET.
- */
-final class HedFRAMESET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFRAMESET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FRAMESET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
- layoutType = LAYOUT_HIDDEN;
- indentChild = true;
- }
-
- /**
- * %coreattrs;
- * (rows %MultiLengths; #IMPLIED) ... should be defined locally.
- * (cols %MultiLengths; #IMPLIED) ... should be defined locally.
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (frameborder (yes|no) #IMPLIED) ... should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- * (framespacing CDATA #IMPLIED) ... D215684
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_BORDERCOLOR, // D205514
- HTML40Namespace.ATTR_NAME_FRAMESPACING // D215684
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (rows %MultiLengths; #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ROWS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ROWS, attr);
-
- // (cols %MultiLengths; #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_COLS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_COLS, attr);
-
- // (frameborder (yes|no) #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_YES, HTML40Namespace.ATTR_VALUE_NO};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FRAMEBORDER, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java
deleted file mode 100644
index bf211b2fad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFlowContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java
deleted file mode 100644
index d86b1424fd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * %fontstyle;
- */
-final class HedFontStyle extends HedInlineContainer {
-
- /**
- */
- public HedFontStyle(String elementName, ElementCollection collection) {
- super(elementName, collection);
- if (elementName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) || elementName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL)) {
- correctionType = CORRECT_EMPTY;
- }
- else { // B, I, U, ...
- correctionType = CORRECT_DUPLICATED;
- }
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- String myName = getElementName();
- if (!myName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) && !myName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL))
- return EMPTY_MAP;
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java
deleted file mode 100644
index 691a061621..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedHEAD(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HEAD, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HEAD</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- // profile
- HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROFILE);
- if (adec != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROFILE, adec);
- }
-
- /**
- * HEAD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
deleted file mode 100644
index 5e72a357e4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
+++ /dev/null
@@ -1,70 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class HedHEADER extends HedFlowContainer {
-
- public HedHEADER(String name, ElementCollection collection) {
- super(name, collection);
- }
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * Exclusion.
- * <code>HEADER</code> has the exclusion.
- * It is <code>HEADER</code> and <code>FOOTER</code>.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode node = elementCollection.getNamedItem(HTML50Namespace.ElementName.HEADER);
- if (node != null)
- exclusion.appendChild(node);
- node = elementCollection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
- if (node != null)
- exclusion.appendChild(node);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML50Namespace.ElementName.HEADER, HTML50Namespace.ElementName.FOOTER};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
deleted file mode 100644
index 3bb51a41eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
+++ /dev/null
@@ -1,50 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-public class HedHGROUP extends HTMLElemDeclImpl {
-
- public HedHGROUP(ElementCollection collection) {
- super(HTML50Namespace.ElementName.HGROUP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
deleted file mode 100644
index 868b5c729a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
- /**
- */
- public HedHR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HR, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs
- * (align (left|center|right) #IMPLIED) ... should be defined locally.
- * (noshade (noshade) #IMPLIED)
- * (size %Pixels; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (color %Color; #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (align (left|center|right) #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_NOSHADE, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_COLOR // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
deleted file mode 100644
index e393d048c5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedHTML(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HTML, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HTML</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
- * <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
- * </tr>
- * <tr>
- * <td>version</td><td>CDATA</td><td>#FIXED</td>
- * <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.HTML, attributes);
-
- }
-
- /**
- * HTML has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
deleted file mode 100644
index 6a17c164ad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
- /**
- */
- public HedHeading(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>H1</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
deleted file mode 100644
index 0e4c5646af..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IFRAME.
- */
-final class HedIFRAME extends HedFlowContainer {
-
- /**
- */
- public HedIFRAME(ElementCollection collection) {
- super(HTML40Namespace.ElementName.IFRAME, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IFRAME, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
deleted file mode 100644
index b719416973..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
- /**
- */
- public HedIMG(ElementCollection collection) {
- super(HTML40Namespace.ElementName.IMG, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * IMG.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IMG, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
deleted file mode 100644
index 908020167f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
- /**
- */
- public HedINPUT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.INPUT, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * INPUT.
- * %attrs;
-
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.INPUT, attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
deleted file mode 100644
index 8c744d6a8b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ISINDEX.
- */
-final class HedISINDEX extends HedEmpty {
-
- /**
- */
- public HedISINDEX(ElementCollection collection) {
- super(HTML40Namespace.ElementName.ISINDEX, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * ISINDEX.
- * %coreattrs;
- * %i18n;
- * (prompt %Text; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROMPT);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROMPT, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java
deleted file mode 100644
index dd08221a2e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
- /**
- * HedInlineContainer.
- * @param elementName java.lang.String
- * @param collection ElementCollection
- */
- public HedInlineContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
deleted file mode 100644
index c84b30a00d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
+++ /dev/null
@@ -1,38 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-public class HedKEYGEN extends HedEmpty {
-
- public HedKEYGEN(ElementCollection collection) {
- super(HTML50Namespace.ElementName.KEYGEN, collection);
- layoutType = LAYOUT_OBJECT;
- }
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- attributeCollection.getAttrs(attributes);
-
- String[] names = { HTML50Namespace.ATTR_NAME_AUTOFOCUS, HTML50Namespace.ATTR_NAME_CHALLENGE, HTML40Namespace.ATTR_NAME_DISABLED, HTML50Namespace.ATTR_NAME_FORM, HTML50Namespace.ATTR_NAME_KEYTYPE, HTML40Namespace.ATTR_NAME_NAME};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
deleted file mode 100644
index e0010323d2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * LABEL.
- */
-final class HedLABEL extends HedInlineContainer {
-
- /**
- */
- public HedLABEL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LABEL, collection);
- }
-
- /**
- * %attrs;
- * (for IDREF #IMPLIED) ... should be defined locally.
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (for IDREF #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FOR, attr);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>LABEL</code> has the exclusion.
- * It is <code>LABEL</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.LABEL);
- if (label != null)
- exclusion.appendChild(label);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.LABEL};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java
deleted file mode 100644
index 5e3928b6b4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * LEGEND.
- */
-final class HedLEGEND extends HedInlineContainer {
-
- /**
- */
- public HedLEGEND(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LEGEND, collection);
- }
-
- /**
- * (accesskey %Character; #IMPLIED)
- * (align %LAlign; #IMPLIED) ... shuld be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ACCESSKEY};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForLegend();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
deleted file mode 100644
index a413193cde..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.LI};
-
- /**
- */
- public HedLI(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LI, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LI, attributes);
-
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
deleted file mode 100644
index 4c28bbe850..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-/**
- * LINK.
- */
-final class HedLINK extends HedEmpty {
-
- /**
- */
- public HedLINK(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LINK, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * LINK.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LINK, attributes);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java
deleted file mode 100644
index a7ccf63be3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedListItemContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java
deleted file mode 100644
index 2a3c2a7356..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-/**
- * MAP.
- */
-final class HedMAP extends HTMLElemDeclImpl {
-
- /**
- */
- public HedMAP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.MAP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MAP;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (name CDATA #REQUIRED) ... should be defined locally
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (name CDATA #REQUIRED) ... should be defined locally
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
deleted file mode 100644
index f8653e27c4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * MARQUEE.
- */
-final class HedMARQUEE extends HedFlowContainer {
-
- /**
- */
- public HedMARQUEE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.MARQUEE, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * %attrs;
- * (behavior (scroll|slide|alternate) scroll)
- * (bgcolor %Color; #IMPLIED)
- * (direction (left|right|up|down) left)
- * (height CDATA #IMPLIED) ... should be defined locally.
- * (hspace NUMBER #IMPLIED) ... should be defined locally.
- * (loop CDATA #IMPLIED)
- * (scrollamount NUMBER #IMPLIED)
- * (scrolldelay NUMBER #IMPLIED)
- * (vspace NUMBER #IMPLIED) ... should be defined locally.
- * (width CDATA #IMPLIED) ... should be defined locally.
- * (truespeed (truespeed) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_BEHAVIOR, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DIRECTION, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_SCROLLAMOUNT, HTML40Namespace.ATTR_NAME_SCROLLDELAY, HTML40Namespace.ATTR_NAME_TRUESPEED};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (height CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HEIGHT, attr);
-
- // (width CDATA #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
- // (hspace NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HSPACE, attr);
-
- // (vspace NUMBER #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VSPACE, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
deleted file mode 100644
index 812af9b5e0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
- /**
- */
- public HedMENU(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * MENU/DIR.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.MENU, attributes);
- }
-
- /**
- * Exclusion.
- * <code>MENU/DIR</code> has the exclusion.
- * It is <code>%block;</code>.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.
- * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
- * %list; is : UL | OL | DIR | MENU.
- * %preformatted; is PRE.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // %block;
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.P, HTML40Namespace.ElementName.H1, HTML40Namespace.ElementName.H2, HTML40Namespace.ElementName.H3, HTML40Namespace.ElementName.H4, HTML40Namespace.ElementName.H5, HTML40Namespace.ElementName.H6, HTML40Namespace.ElementName.UL, HTML40Namespace.ElementName.OL, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.PRE, HTML40Namespace.ElementName.DL, HTML40Namespace.ElementName.DIV, HTML40Namespace.ElementName.CENTER, HTML40Namespace.ElementName.NOSCRIPT, HTML40Namespace.ElementName.NOFRAMES, HTML40Namespace.ElementName.BLOCKQUOTE, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.HR, HTML40Namespace.ElementName.TABLE, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.ADDRESS};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
deleted file mode 100644
index 92554ea1ab..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
- /**
- */
- public HedMETA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.META, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * META.
-
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.META, attributes);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
deleted file mode 100644
index c79e9e9f3a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
+++ /dev/null
@@ -1,74 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class HedMETER extends HedInlineContainer {
-
- public HedMETER(ElementCollection collection) {
- super(HTML50Namespace.ElementName.METER, collection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- attributeCollection.getAttrs(attributes);
-
- String[] names = { HTML50Namespace.ATTR_NAME_MIN, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_LOW, HTML50Namespace.ATTR_NAME_HIGH, HTML50Namespace.ATTR_NAME_OPTIMUM, HTML50Namespace.ATTR_NAME_FORM };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl decl = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, decl);
- }
-
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode meter = elementCollection.getNamedItem(HTML50Namespace.ElementName.METER);
- if (meter != null)
- exclusion.appendChild(meter);
-
- return exclusion;
- }
-
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML50Namespace.ElementName.METER};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java
deleted file mode 100644
index 92c3d0ce3c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * (INS|DEL)
- */
-final class HedMarkChanges extends HedFlowContainer {
-
- /**
- */
- public HedMarkChanges(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- * (datetime %Datetime; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE, HTML40Namespace.ATTR_NAME_DATETIME};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
deleted file mode 100644
index 154dbfa5f9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
+++ /dev/null
@@ -1,58 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-
-/**
- * Math.
- */
-final class HedMath extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML50Namespace.ElementName.MATH};
-
- /**
- */
- public HedMath(ElementCollection collection) {
- super(HTML50Namespace.ElementName.MATH, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * Create all attribute declarations.
- * MathML namespace
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * MATH has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
deleted file mode 100644
index d36aa40079..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * EMBED.
- */
-class HedMediaElement extends HTMLElemDeclImpl {
-
- /**
- */
- public HedMediaElement(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * MediaElement
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (preload %CDATA; #IMPLIED)
- * (autoplay %ENUM; #IMPLIED)
- * (loop %ENUM; #IMPLIED)
- * (controls %MediaType; #IMPLIED)
- * Global attributes
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
-
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
- //(preload %CDATA; #IMPLIED) ENUM
- // (none | metadata | auto)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_NONE, HTML50Namespace.ATTR_VALUE_METADATA, HTML40Namespace.ATTR_VALUE_AUTO, HTML50Namespace.ATTR_VALUE_EMPTY};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_AUTO);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_PRELOAD, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_PRELOAD, attr);
-
- // (autoplay (boolean) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] autoPlayValues = {HTML50Namespace.ATTR_NAME_AUTOPLAY};
- atype.setEnumValues(autoPlayValues);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_AUTOPLAY, attr);
-
- // (loop (boolean) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] loopValues = {HTML50Namespace.ATTR_NAME_LOOP};
- atype.setEnumValues(loopValues);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_LOOP, attr);
-
- // (controls (boolean) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] controlValues = {HTML50Namespace.ATTR_NAME_CONTROLS};
- atype.setEnumValues(controlValues);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_CONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_CONTROLS, attr);
-
-
- // global attributes
- attributeCollection.getAttrs(attributes);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java
deleted file mode 100644
index 42adbd14f0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * NOBR -- not standard tag but it is commonly used.
- */
-final class HedNOBR extends HedInlineContainer {
-
-
- public HedNOBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOBR, collection);
- correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
- }
-
- protected void createAttributeDeclarations() {
- // No attributes is defined.
- if (attributes != null)
- return;
- attributes = new CMNamedNodeMapImpl();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java
deleted file mode 100644
index ed71166d4b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * NOEMBED.
- */
-final class HedNOEMBED extends HedFlowContainer {
-
- /**
- */
- public HedNOEMBED(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOEMBED, collection);
- }
-
- /**
- * %coreattrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
deleted file mode 100644
index 2ad931b052..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * NOFRAMES.
- */
-final class HedNOFRAMES extends HTMLElemDeclImpl {
-
- /**
- */
- public HedNOFRAMES(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOFRAMES, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_NOFRAMES_CONTENT;
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * Exclusion.
- * <code>NOFRAMES</code> has the exclusion.
- * It is <code>NOFRAMES</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (label != null)
- exclusion.appendChild(label);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.NOFRAMES};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java
deleted file mode 100644
index 2747c2348d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * NOSCRIPT.
- */
-final class HedNOSCRIPT extends HedFlowContainer {
-
- /**
- */
- public HedNOSCRIPT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOSCRIPT, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
deleted file mode 100644
index ad48e2f190..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OBJECT.
- */
-final class HedOBJECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedOBJECT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OBJECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %reserved; ... empty.
- * (declare (declare) #IMPLIED)
- * (classid %URI; #IMPLIED)
- * (codebase %URI; #IMPLIED)
- * (data %URI; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (codetype %ContentType; #IMPLIED)
- * (archive CDATA #IMPLIED)
- * (standby %Text; #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %reserved; ... empty.
-
- String[] names = {HTML40Namespace.ATTR_NAME_DECLARE, HTML40Namespace.ATTR_NAME_CLASSID, HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_DATA, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_CODETYPE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_STANDBY, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- // %align; ... should be defined locally.
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
deleted file mode 100644
index 6c6d50c674..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
- /**
- */
- public HedOL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OL, collection);
- }
-
- /**
- * OL.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.OL, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java
deleted file mode 100644
index 87a3fc3591..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * OPTGROUP.
- */
-final class HedOPTGROUP extends HTMLElemDeclImpl {
-
- /**
- */
- public HedOPTGROUP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OPTGROUP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- layoutType = LAYOUT_HIDDEN;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #REQUIRED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (disabled (disabled) #IMPLIED)
- String[] names = {HTML40Namespace.ATTR_NAME_DISABLED};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (label %Text; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java
deleted file mode 100644
index b225ee8c92..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
- private static String[] terminators = {HTML40Namespace.ElementName.OPTION};
-
- /**
- */
- public HedOPTION(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OPTION, collection);
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_END;
- }
-
- /**
- * OPTION.
- * %attrs;
- * (selected (selected) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_SELECTED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_LABEL, HTML40Namespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
deleted file mode 100644
index fc172e11bd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
+++ /dev/null
@@ -1,39 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-public class HedOUTPUT extends HedInlineContainer {
-
- public HedOUTPUT(ElementCollection collection) {
- super(HTML50Namespace.ElementName.OUTPUT, collection);
- }
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = { HTML40Namespace.ATTR_NAME_FOR, HTML50Namespace.ATTR_NAME_FORM, HTML40Namespace.ATTR_NAME_NAME};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java
deleted file mode 100644
index 70feed7b9b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
- private static Collection terminators = null;
-
- /**
- */
- public HedP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.P, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>P</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
- return prohibitedAncestors;
- }
-
- /**
- * Return names of terminators.
- * <code>P</code> has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- if (terminators != null)
- return terminators.iterator();
- //<<D217982
- terminators = new Vector();
- terminators.addAll(elementCollection.getNamesOfBlock());
- terminators.add(HTML40Namespace.ElementName.LI);
- terminators.add(HTML40Namespace.ElementName.DT);
- terminators.add(HTML40Namespace.ElementName.DD);
- //D217982
- return terminators.iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
deleted file mode 100644
index 1bcea7e78c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-/**
- * PARAM.
- */
-final class HedPARAM extends HedEmpty {
-
- /**
- */
- public HedPARAM(ElementCollection collection) {
- super(HTML40Namespace.ElementName.PARAM, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * PARAM.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.PARAM, attributes);
-
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
deleted file mode 100644
index 2ba3479759..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
- /**
- * PRE element should keep spaces in its source.
- */
- public HedPRE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.PRE, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
-
- keepSpaces = true;
- }
-
- /**
- * %attrs;
- * (width NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (width NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * Exclusion.
- * <code>PRE</code> has the exclusion.
- * It is <code>%pre.exclusion;</code>.
- * %pre.exclusion is:
- * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.IMG, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.APPLET, HTML40Namespace.ElementName.BIG, HTML40Namespace.ElementName.SMALL, HTML40Namespace.ElementName.SUB, HTML40Namespace.ElementName.SUP, HTML40Namespace.ElementName.FONT, HTML40Namespace.ElementName.BASEFONT};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
deleted file mode 100644
index 223c129187..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
+++ /dev/null
@@ -1,65 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class HedPROGRESS extends HedInlineContainer {
-
- public HedPROGRESS(ElementCollection collection) {
- super(HTML50Namespace.ElementName.PROGRESS, collection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- attributeCollection.getAttrs(attributes);
-
- String[] names = { HTML40Namespace.ATTR_NAME_VALUE, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_FORM };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion;
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode progress = elementCollection.getNamedItem(HTML50Namespace.ElementName.PROGRESS);
- if (progress != null) {
- exclusion.appendChild(progress);
- }
- return exclusion;
- }
-
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors == null) {
- String[] names = { HTML50Namespace.ElementName.PROGRESS };
- prohibitedAncestors = elementCollection.getDeclarations(names);
- }
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java
deleted file mode 100644
index 556149530c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
- /**
- */
- public HedPcdata(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
- }
-
- /**
- * Content.<br>
- * PCDATA type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.PCDATA;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
deleted file mode 100644
index 0e680d5dee..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * %phrase;
- */
-final class HedPhrase extends HedInlineContainer {
-
- /**
- */
- public HedPhrase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java
deleted file mode 100644
index 185b757f9d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * Q.
- */
-final class HedQ extends HedInlineContainer {
-
- /**
- */
- public HedQ(ElementCollection collection) {
- super(HTML40Namespace.ElementName.Q, collection);
- correctionType = CORRECT_DUPLICATED;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
deleted file mode 100644
index e31a9bc26c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
+++ /dev/null
@@ -1,59 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-
-/**
- * RP.
- */
-final class HedRP extends HedPcdata {
-
- private static String[] terminators = {HTML50Namespace.ElementName.RP};
-
- /**
- */
- public HedRP(ElementCollection collection) {
- super(HTML50Namespace.ElementName.RP, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * OPTION.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
deleted file mode 100644
index aba4a385dd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
+++ /dev/null
@@ -1,60 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-
-/**
- * RT.
- */
-final class HedRT extends HedPcdata {
-
- private static String[] terminators = {HTML50Namespace.ElementName.RT};
-
- /**
- */
- public HedRT(ElementCollection collection) {
- super(HTML50Namespace.ElementName.RT, collection);
- layoutType = LAYOUT_BLOCK;
-
- }
-
- /**
- * OPTION.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
deleted file mode 100644
index 6686a2587b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
+++ /dev/null
@@ -1,47 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-/**
- * RUBY.
- */
-final class HedRUBY extends HTMLElemDeclImpl {
-
- /**
- */
- public HedRUBY(ElementCollection collection) {
- super(HTML50Namespace.ElementName.RUBY, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_RUBY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
deleted file mode 100644
index 2af131786b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * SCRIPT.
- */
-final class HedSCRIPT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSCRIPT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SCRIPT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * SCRIPT.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SCRIPT, attributes);
-
- }
-
- /**
- * <code>SCRIPT</code> is CDATA type.
- * So, the method always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * CDATA content.<br>
- * @return int
- */
- public int getContentType() {
- return CMElementDeclaration.CDATA;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
deleted file mode 100644
index a0de442d14..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
+++ /dev/null
@@ -1,63 +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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSELECT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SELECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SELECT, attributes);
-
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
deleted file mode 100644
index 647a9d4f8d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
+++ /dev/null
@@ -1,86 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * SOURCE.
- */
-final class HedSOURCE extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML50Namespace.ElementName.SOURCE};
-
- /**
- */
- public HedSOURCE(ElementCollection collection) {
- super(HTML50Namespace.ElementName.SOURCE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * SOURCE
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (type %ContentType; #IMPLIED)
- * (media %MediaType; #IMPLIED)
- * Global attributes
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
-
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
- // (type %ContentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-
- // (media %MediaType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_ALL);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_MEDIA, attr);
-
-
- // global attributes
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * SOURCE has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java
deleted file mode 100644
index 42932f6d1d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * SPAN.
- */
-final class HedSPAN extends HedInlineContainer {
-
- /**
- * SPAN.
- */
- public HedSPAN(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SPAN, collection);
- }
-
- /**
- * %attrs;
- * %reserved; ... empty.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java
deleted file mode 100644
index 46c7a80f1a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
- /**
- */
- public HedSSIBase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- */
- public int getFormatType() {
- return HTMLElementDeclaration.FORMAT_SSI;
- }
-
- /**
- */
- public boolean supports(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return true;
- return super.supports(propName);
- }
-
- /*
- */
- public Object getProperty(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return new Boolean(true);
- return super.getProperty(propName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
deleted file mode 100644
index b8406a95f5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
- /**
- */
- public HedSSIConfig(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_CONFIG, collection);
- }
-
- /**
- * SSI:CONFIG.
- * (errmsg CDATA #IMPLIED)
- * (sizefmt CDATA #IMPLIED)
- * (timefmt CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_ERRMSG, HTML40Namespace.ATTR_NAME_SIZEFMT, HTML40Namespace.ATTR_NAME_TIMEFMT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java
deleted file mode 100644
index 47388122c5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
- /**
- */
- public HedSSIEcho(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_ECHO, collection);
- }
-
- /**
- * SSI:ECHO
- * (var CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_VAR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java
deleted file mode 100644
index 2824d576da..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
- /**
- */
- public HedSSIExec(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_EXEC, collection);
- }
-
- /**
- * SSI:EXEC
- * (cgi %URI; #IMPLIED)
- * (cmd CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_CGI, HTML40Namespace.ATTR_NAME_CMD};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java
deleted file mode 100644
index 50ebdf966e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
- /**
- */
- public HedSSIFlastmod(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_FLASTMOD, collection);
- }
-
- /**
- * SSI:FLASTMOD
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java
deleted file mode 100644
index f2bdbf0361..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
- /**
- */
- public HedSSIFsize(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_FSIZE, collection);
- }
-
- /**
- * SSI:FSIZE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java
deleted file mode 100644
index 63224d8d67..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
- /**
- */
- public HedSSIInclude(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_INCLUDE, collection);
- }
-
- /**
- * SSI:INCLUDE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java
deleted file mode 100644
index bc10b56e49..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
- /**
- */
- public HedSSIPrintenv(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_PRINTENV, collection);
- }
-
- /**
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- }
-
- /**
- * SSI:PRINTENV has no attributes. So, this method should
- * always return <code>null</code>.
- * Note: Since somebody doesn't expect null is returned, return the empty attribute
- * like a custom tag which doesn't have attributes
- */
- public CMNamedNodeMap getAttributes() {
- return super.getAttributes();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java
deleted file mode 100644
index 182b85ca2d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
- /**
- */
- public HedSSISet(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_SET, collection);
- }
-
- /**
- * SSI:SET
- * (var CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_VAR, HTML40Namespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
deleted file mode 100644
index da0c3ed17c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * STYLE.
- */
-final class HedSTYLE extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSTYLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.STYLE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * STYLE
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.STYLE, attributes);
-
-
- }
-
- /**
- * Content.<br>
- * <code>STYLE</code> is CDATA content type. So, it always returns <code>null</code>.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * CDATA content.<br>
- * @return int
- */
- public int getContentType() {
- return CMElementDeclaration.CDATA;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
deleted file mode 100644
index c2b3e824d3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
+++ /dev/null
@@ -1,32 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-public class HedSUMMARY extends HedInlineContainer {
-
- public HedSUMMARY(ElementCollection collection) {
- super(HTML50Namespace.ElementName.SUMMARY, collection);
- }
-
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
deleted file mode 100644
index 0515172f8d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
+++ /dev/null
@@ -1,57 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-
-
-/**
- * SVG.
- */
-final class HedSVG extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML50Namespace.ElementName.SVG};
-
- /**
- */
- public HedSVG(ElementCollection collection) {
- super(HTML50Namespace.ElementName.SVG, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * Create all attribute declarations.
- * SVG namespace
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * SVG has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java
deleted file mode 100644
index 76bf70e6cf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SUB and SUP.
- */
-final class HedScripts extends HedInlineContainer {
-
- /**
- */
- public HedScripts(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
deleted file mode 100644
index 07a7209ade..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
+++ /dev/null
@@ -1,36 +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.wst.html.core.internal.contentmodel;
-
-public class HedSectioning extends HedFlowContainer {
- public HedSectioning(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_BLOCK;
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * Article.
- * %attrs;
- * Global attributes
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
deleted file mode 100644
index 426cd78893..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TABLE.
- */
-final class HedTABLE extends HTMLElemDeclImpl {
-
- /**
- */
- public HedTABLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TABLE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TABLE;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * TABLE.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TABLE, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
deleted file mode 100644
index 1b5ba41554..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
- /**
- * TEXTAREA should keep spaces in its source.
- */
- public HedTEXTAREA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TEXTAREA, collection);
- layoutType = LAYOUT_OBJECT;
-
- keepSpaces = true;
- }
-
- /**
- * TEXTAREA.
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- //different sets of attributes for html 4 & 5
- attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TEXTAREA, attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
deleted file mode 100644
index ec8191c819..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
+++ /dev/null
@@ -1,67 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class HedTIME extends HedInlineContainer {
-
- public HedTIME(ElementCollection collection) {
- super(HTML50Namespace.ElementName.TIME, collection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- attributeCollection.getAttrs(attributes);
-
- String[] names = { HTML40Namespace.ATTR_NAME_DATETIME, HTML50Namespace.ATTR_NAME_PUBDATE };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- }
-
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode time = elementCollection.getNamedItem(HTML50Namespace.ElementName.TIME);
- if (time != null)
- exclusion.appendChild(time);
-
- return exclusion;
- }
-
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML50Namespace.ElementName.TIME};
- prohibitedAncestors = elementCollection.getDeclarations(names);
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
deleted file mode 100644
index 6919004101..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
- /**
- */
- public HedTITLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TITLE, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * TITLE.
- * %i18n;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * Exclusion.
- * <code>TITLE</code> has the exclusion.
- * It is <code>%head.misc;</code>.
- * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (SCRIPT|STYLE|META|LINK|OBJECT)
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
- String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
deleted file mode 100644
index d68a54ac5c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * TR.
- */
-final class HedTR extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.TR};
-
- /**
- */
- public HedTR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TR, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %cellhalign;
- * %cellvalign;
- * (bgcolor %Color; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- * (height %Length #IMPLIED) bug2246
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR, HTML40Namespace.ATTR_NAME_HEIGHT // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * TR has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
deleted file mode 100644
index f66eeefaf0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * THEAD/TFOOT/TBODY
- */
-final class HedTableBody extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.COL, HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT};
-
- /**
- */
- public HedTableBody(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- if (elementName == HTML40Namespace.ElementName.TBODY) {
- omitType = OMIT_BOTH;
- }
- else {
- omitType = OMIT_END;
- }
- indentChild = true;
- }
-
- /**
- * TBODY/TFOOT/THEAD
- * %attrs;
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
- }
-
- /**
- * THEAD, TFOOT and TBODY have terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
deleted file mode 100644
index 14fcb490cc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * (TH | TD).
- */
-final class HedTableCell extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.TR, HTML40Namespace.ElementName.TH, HTML40Namespace.ElementName.TD};
-
- /**
- */
- public HedTableCell(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * %attrs;
- * (abbr %Text; #IMPLIED)
- * (axis CDATA #IMPLIED)
- * (headers IDREFS #IMPLIED)
- * (scope %Scope; #IMPLIED)
- * (rowspan NUMBER 1)
- * (colspan NUMBER 1)
- * %cellhalign;
- * %cellvalign;
- * (nowrap (nowrap) #IMPLIED)
- * (bgcolor %Color; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (height %Length; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ABBR, HTML40Namespace.ATTR_NAME_AXIS, HTML40Namespace.ATTR_NAME_HEADERS, HTML40Namespace.ATTR_NAME_SCOPE, HTML40Namespace.ATTR_NAME_ROWSPAN, HTML40Namespace.ATTR_NAME_COLSPAN, HTML40Namespace.ATTR_NAME_NOWRAP, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * TH and TD have terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
deleted file mode 100644
index 041c5a56a5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
- /**
- */
- public HedUL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.UL, collection);
- }
-
- /**
- * UL.
- * (type %ULStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (type %ULStyle; #IMPLIED) ... should be defined locally.
- // %ULStyle; is (disc|square|circle).
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_DISC, HTML40Namespace.ATTR_VALUE_SQUARE, HTML40Namespace.ATTR_VALUE_CIRCLE};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
deleted file mode 100644
index 98eb444032..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
+++ /dev/null
@@ -1,65 +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.wst.html.core.internal.contentmodel;
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-
-/**
- * VIDEO.
- */
-final class HedVIDEO extends HedMediaElement {
-
-
- public HedVIDEO(ElementCollection collection) {
- super(HTML50Namespace.ElementName.VIDEO, collection);
- }
-
- /**
- * MediaElement
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (preload %CDATA; #IMPLIED)
- * (autoplay %ENUM; #IMPLIED)
- * (loop %ENUM; #IMPLIED)
- * (controls %MediaType; #IMPLIED)
- * (poster %URI; OPTIONAL)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * Global attributes
- */
- protected void createAttributeDeclarations() {
- super.createAttributeDeclarations();
-
- // (poster %URI; #optional): should be defined locally.
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_POSTER, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML50Namespace.ATTR_NAME_POSTER, attr);
-
- // height , width
- String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-
-
- }
-}
-
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java
deleted file mode 100644
index f958fe7ed4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-final class HedWBR extends HedEmpty {
-
- public HedWBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.WBR, collection);
- // LAYOUT_BREAK.
- // same as BR.
- layoutType = LAYOUT_BREAK;
- }
-
- protected void createAttributeDeclarations() {
- // No attributes is defined.
- if (attributes != null)
- return;
- attributes = new CMNamedNodeMapImpl();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM20DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM20DocImpl.java
deleted file mode 100644
index 767b594cb8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM20DocImpl.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.html.core.internal.contentmodel;
-
-
-
-
-/**
- * Implementation of CMDocument for JSP 2.0.
- */
-class JCM20DocImpl extends JCMDocImpl {
- /**
- * JCM20DocImpl constructor comment.
- */
- public JCM20DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName, targetNamespace, new JSP20ElementCollection());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
deleted file mode 100644
index ba9e0cdb0f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
+++ /dev/null
@@ -1,20 +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.wst.html.core.internal.contentmodel;
-
-class JCM21DocImpl extends JCMDocImpl {
- /**
- * JCM21DocImpl constructor comment.
- */
- public JCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName, targetNamespace, new JSP21ElementCollection());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java
deleted file mode 100644
index b5fe4da5f3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.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.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation of CMDocument for JSP 1.1 and JSP 1.2.
- */
-class JCMDocImpl extends CMNodeImpl implements JSPCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespaceImpl namespace = null;
- private JSPElementCollection elements = null;
-
- /**
- * HCMDocImpl constructor comment.
- */
- public JCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- this(docTypeName, targetNamespace, new JSPElementCollection());
- }
-
- JCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace, JSPElementCollection collection) {
- super(docTypeName);
- namespace = targetNamespace;
- elements = collection;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getEntities() {
- return null;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
deleted file mode 100644
index 4d1a9b8b8b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * JSP 1.1 Namespace. Note, this interface was
- * copied form JSP core packages. One implication
- * is that extra care is needed in using '==' instead
- * of '.equals'.
- */
-public interface JSP11Namespace {
-
- public static interface ElementName {
- // Element names
- public static final String SCRIPTLET = "jsp:scriptlet"; //$NON-NLS-1$
- public static final String EXPRESSION = "jsp:expression"; //$NON-NLS-1$
- public static final String DECLARATION = "jsp:declaration"; //$NON-NLS-1$
- public static final String DIRECTIVE_PAGE = "jsp:directive.page"; //$NON-NLS-1$
- public static final String DIRECTIVE_INCLUDE = "jsp:directive.include"; //$NON-NLS-1$
- public static final String DIRECTIVE_TAGLIB = "jsp:directive.taglib"; //$NON-NLS-1$
- public static final String USEBEAN = "jsp:useBean"; //$NON-NLS-1$
- public static final String SETPROPERTY = "jsp:setProperty"; //$NON-NLS-1$
- public static final String GETPROPERTY = "jsp:getProperty"; //$NON-NLS-1$
- public static final String INCLUDE = "jsp:include"; //$NON-NLS-1$
- public static final String FORWARD = "jsp:forward"; //$NON-NLS-1$
- public static final String PLUGIN = "jsp:plugin"; //$NON-NLS-1$
- public static final String PARAMS = "jsp:params"; //$NON-NLS-1$
- public static final String FALLBACK = "jsp:fallback"; //$NON-NLS-1$
- public static final String PARAM = "jsp:param"; //$NON-NLS-1$
- public static final String ROOT = "jsp:root"; //$NON-NLS-1$
- public static final String TEXT = "jsp:text"; //$NON-NLS-1$
- }
-
- public static final String JSP11_URI = ""; //$NON-NLS-1$
- public static final String JSP_TAG_PREFIX = "jsp"; //$NON-NLS-1$
- // attribute names
- // directive.page
- public static final String ATTR_NAME_LANGUAGE = "language"; //$NON-NLS-1$
- public static final String ATTR_NAME_EXTENDS = "extends"; //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
- public static final String ATTR_NAME_IMPORT = "import"; //$NON-NLS-1$
- public static final String ATTR_NAME_SESSION = "session"; //$NON-NLS-1$
- public static final String ATTR_NAME_BUFFER = "buffer"; //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOFLUSH = "autoFlush"; //$NON-NLS-1$
- public static final String ATTR_NAME_IS_THREAD_SAFE = "isThreadSafe"; //$NON-NLS-1$
- public static final String ATTR_NAME_INFO = "info"; //$NON-NLS-1$
- public static final String ATTR_NAME_ERROR_PAGE = "errorPage"; //$NON-NLS-1$
- public static final String ATTR_NAME_IS_ERROR_PAGE = "isErrorPage"; //$NON-NLS-1$
- public static final String ATTR_NAME_PAGE_ENCODING = "pageEncoding"; //$NON-NLS-1$
- // directive.include
- public static final String ATTR_NAME_FILE = "file"; //$NON-NLS-1$
- // directive.taglib
- public static final String ATTR_NAME_URI = "uri"; //$NON-NLS-1$
- public static final String ATTR_NAME_PREFIX = "prefix"; //$NON-NLS-1$
- // useBean
- public static final String ATTR_NAME_ID = "id"; //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; //$NON-NLS-1$
- public static final String ATTR_NAME_BEAN_NAME = "beanName"; //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; //$NON-NLS-1$
- // setProperty
- public static final String ATTR_NAME_NAME = "name"; //$NON-NLS-1$
- public static final String ATTR_NAME_PROPERTY = "property"; //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; //$NON-NLS-1$
- public static final String ATTR_NAME_PARAM = "param"; //$NON-NLS-1$
- // include
- public static final String ATTR_NAME_PAGE = "page"; //$NON-NLS-1$
- public static final String ATTR_NAME_FLUSH = "flush"; //$NON-NLS-1$
- // plugin
- public static final String ATTR_NAME_CODE = "code"; //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; //$NON-NLS-1$
- public static final String ATTR_NAME_JREVERSION = "jreversion"; //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; //$NON-NLS-1$
- public static final String ATTR_NAME_NSPLUGINURL = "nspluginurl"; //$NON-NLS-1$
- public static final String ATTR_NAME_IEPLUGINURL = "iepluginurl"; //$NON-NLS-1$
- // root
- public static final String ATTR_NAME_XMLNS_JSP = "xmlns:jsp"; //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; //$NON-NLS-1$
- // attribute values
- public static final String ATTR_VALUE_TRUE = "true"; //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; //$NON-NLS-1$
- public static final String ATTR_VALUE_JAVA = "java"; //$NON-NLS-1$
- public static final String ATTR_VALUE_CT_DEFAULT = "text/html; charset=ISO-8859-1";//D195366 //$NON-NLS-1$
- public static final String ATTR_VALUE_BUFSIZ_DEFAULT = "8kb"; //$NON-NLS-1$
- public static final String ATTR_VALUE_PAGE = "page"; //$NON-NLS-1$
- public static final String ATTR_VALUE_SESSION = "session"; //$NON-NLS-1$
- public static final String ATTR_VALUE_REQUEST = "request"; //$NON-NLS-1$
- public static final String ATTR_VALUE_APPLICATION = "application"; //$NON-NLS-1$
- public static final String ATTR_VALUE_BEAN = "bean"; //$NON-NLS-1$
- public static final String ATTR_VALUE_APPLET = "applet"; //$NON-NLS-1$
- public static final String ATTR_VALUE_TOP = "top"; //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; //$NON-NLS-1$
- public static final String ATTR_VALUE_JVER11 = "1.1"; //$NON-NLS-1$
- public static final String ATTR_VALUE_XMLNS_JSP = "http://java.sun.com/JSP/Page"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
deleted file mode 100644
index fd404c5d5b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
+++ /dev/null
@@ -1,495 +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.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations of JSP 1.1 and JSP 1.2.
- */
-class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
-
- // element IDs
- private static class Ids20 extends Ids {
- public static final int ID_BODY = 17;
- public static final int ID_ATTRIBUTE = 18;
- public static final int ID_ELEMENT = 19;
- public static final int ID_OUTPUT = 20;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids20.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- // attribute creater
- class JACreater20 extends JACreater {
- public JACreater20() {
- super();
- }
-
- public CMNamedNodeMapImpl getDeclarations(int eid) {
- switch (eid) {
- case Ids20.ID_ATTRIBUTE :
- createForAttribute();
- break;
- case Ids20.ID_ELEMENT :
- createForElement();
- break;
- case Ids20.ID_BODY :
- createForBody();
- break;
- case Ids20.ID_OUTPUT :
- createForOutput();
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- createForDirTaglib();
- break;
- case Ids.ID_DIRECTIVE_PAGE :
- createForDirPage();
- break;
- case Ids.ID_ROOT :
- createForRoot();
- break;
- case Ids.ID_PLUGIN :
- createForPlugin();
- break;
- default :
- super.getDeclarations(eid);
- }
- return declarations;
- }
-
- private void createForBody() {
- }
-
- private void createForOutput() {
- AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, JSP20Namespace.ATTR_VALUE_YES, JSP20Namespace.ATTR_VALUE_NO};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_NO);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_SYSTEM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_SYSTEM, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_PUBLIC);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_PUBLIC, adec);
- }
-
- /**
- * Changed in 2.0
- */
- void createForDirTaglib() {
- // ("uri" URI OPTIONAL)
- AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(ATTR_NAME_URI, adec);
-
- // ("tagdir" URI OPTIONAL)
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_TAGDIR);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR, adec);
-
- // ("prefix" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PREFIX);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
- }
-
- void createForDirPage() {
- AttrDecl adec = null;
- // ("language" CDATA DECLARED "java")
- adec = new AttrDecl(ATTR_NAME_LANGUAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
- declarations.putNamedItem(ATTR_NAME_LANGUAGE, adec);
-
- // ("extends" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_EXTENDS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_EXTENDS, adec);
-
- // ("import" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IMPORT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
-
- // ("session" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_SESSION, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_SESSION, adec);
-
- // ("buffer" CDATA DECLARED "8kb")
- adec = new AttrDecl(ATTR_NAME_BUFFER);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BUFSIZ_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_BUFFER, adec);
-
- // ("autoFlush" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_AUTOFLUSH, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_AUTOFLUSH, adec);
-
- // ("isThreadSafe" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_IS_THREAD_SAFE, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_THREAD_SAFE, adec);
-
- // ("info" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_INFO);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_INFO, adec);
-
- // ("errorPage" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ERROR_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_ERROR_PAGE, adec);
-
- // ("isErrorPage" ENUM DECLARED (true|false) "false")
- adec = createBoolType(ATTR_NAME_IS_ERROR_PAGE, ATTR_VALUE_FALSE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_ERROR_PAGE, adec);
-
- // ("contentType" CDATA DECLARED "text/html; ISO-8859-1")
- adec = new AttrDecl(ATTR_NAME_CONTENT_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_CT_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_CONTENT_TYPE, adec);
-
- // ("pageEncoding" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_PAGE_ENCODING);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_ENCODING_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_PAGE_ENCODING, adec);
-
- // ("isELIgnored" ENUM DECLARED (true|false) "false")
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_ISELIGNORED);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_ISELIGNORED, adec);
- }
-
- private void createForElement() {
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
- }
-
- private void createForAttribute() {
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_TRIM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TRIM, adec);
- }
-
- private void createForRoot() {
- // ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
- AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
- declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
- // ("version" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_VERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JSP_VER_20);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VERSION, adec);
- }
-
- private void createForPlugin() {
- // ("type" ENUM REQUIRED (bean|applet))
- AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
- adec.type.setEnumValues(values);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-
- // ("code" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODE, adec);
-
- // ("codebase" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODEBASE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
-
- // ("align" ENUM IMPLIED (top|middle|bottom|left|right))
- adec = new AttrDecl(ATTR_NAME_ALIGN);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- adec.type.setEnumValues(aligns);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BOTTOM);
- declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
-
- // ("archive" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ARCHIVE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
-
- // ("height" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HEIGHT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
-
- // ("hspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
-
- // ("jreversion" CDATA DECLARED "1.1")
- adec = new AttrDecl(ATTR_NAME_JREVERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JVER12);
- declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
-
- // ("name" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("vspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
-
- // ("width" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_WIDTH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
-
- // ("nspluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
-
- // ("iepluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
-
- // ("mayscript" ENUM IMPLIED (true | false)
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_MAYSCRIPT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.type.setEnumValues(new String[] {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE});
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_MAYSCRIPT, adec);
- }
- }
-
- private static String[] names = null;
-
- static {
- names = new String[Ids20.getNumOfIds()];
- names[Ids.ID_SCRIPTLET] = SCRIPTLET;
- names[Ids.ID_EXPRESSION] = EXPRESSION;
- names[Ids.ID_DECLARATION] = DECLARATION;
- names[Ids.ID_DIRECTIVE_PAGE] = DIRECTIVE_PAGE;
- names[Ids.ID_DIRECTIVE_INCLUDE] = DIRECTIVE_INCLUDE;
- names[Ids.ID_DIRECTIVE_TAGLIB] = DIRECTIVE_TAGLIB;
- names[Ids.ID_USEBEAN] = USEBEAN;
- names[Ids.ID_SETPROPERTY] = SETPROPERTY;
- names[Ids.ID_GETPROPERTY] = GETPROPERTY;
- names[Ids.ID_INCLUDE] = INCLUDE;
- names[Ids.ID_FORWARD] = FORWARD;
- names[Ids.ID_PLUGIN] = PLUGIN;
- names[Ids.ID_PARAMS] = PARAMS;
- names[Ids.ID_FALLBACK] = FALLBACK;
- names[Ids.ID_PARAM] = PARAM;
- names[Ids.ID_ROOT] = ROOT;
- names[Ids.ID_TEXT] = TEXT;
- names[Ids20.ID_BODY] = JSP20Namespace.ElementName.BODY;
- names[Ids20.ID_ATTRIBUTE] = JSP20Namespace.ElementName.ATTRIBUTE;
- names[Ids20.ID_ELEMENT] = JSP20Namespace.ElementName.ELEMENT;
- names[Ids20.ID_OUTPUT] = JSP20Namespace.ElementName.OUTPUT;
- }
-
- /**
- */
- public JSP20ElementCollection() {
- super(JSP20ElementCollection.names, TOLERANT_CASE);
- }
-
- /**
- * @param eid
- * int
- */
- CMGroupImpl createContent(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- CMGroupImpl content = null;
- CMNode child = null;
-
- switch (eid) {
- case Ids.ID_ROOT :
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- int validChildren[] = {
- // %Directives;
- Ids.ID_TEXT, Ids.ID_DIRECTIVE_PAGE, Ids.ID_DIRECTIVE_INCLUDE, Ids20.ID_BODY, Ids20.ID_ATTRIBUTE,
- // %Scripts;
- Ids.ID_SCRIPTLET, Ids.ID_DECLARATION, Ids.ID_EXPRESSION,
- // %Actions;
- Ids.ID_USEBEAN, Ids.ID_SETPROPERTY, Ids.ID_GETPROPERTY, Ids.ID_INCLUDE, Ids.ID_FORWARD, Ids.ID_PLUGIN};
- for (int i = 0; i < validChildren.length; i++) {
- child = item(validChildren[i]);
- if (child != null)
- content.appendChild(child);
- }
- break;
- default :
- content = super.createContent(eid);
- break;
- }
-
- return content;
- }
-
- /**
- * @param eid
- * int
- */
- HTMLElementDeclaration createElemDecl(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- TypePacket packet = new TypePacket();
- switch (eid) {
- case Ids20.ID_BODY :
- // declaration
- packet.name = JSP20Namespace.ElementName.BODY;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids20.ID_ELEMENT :
- // declaration
- packet.name = JSP20Namespace.ElementName.ELEMENT;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids20.ID_ATTRIBUTE :
- // declaration
- packet.name = JSP20Namespace.ElementName.ATTRIBUTE;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids20.ID_OUTPUT :
- // declaration
- packet.name = JSP20Namespace.ElementName.OUTPUT;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- // directive.taglib
- packet.name = DIRECTIVE_TAGLIB;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_DIRECTIVE_PAGE :
- // directive.page
- packet.name = DIRECTIVE_PAGE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_ROOT :
- packet.name = ROOT;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
- break;
- case Ids.ID_PLUGIN :
- // plugin
- packet.name = PLUGIN;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- default :
- return super.createElemDecl(eid);
- }
- ElemDecl decl = new ElemDecl(packet);
-
- CMGroupImpl content = createContent(eid);
- if (content != null)
- decl.setContent(content);
-
- JACreater20 creater = getAttributeCreator();
- decl.setAttributes(creater.getDeclarations(eid));
-
- return decl;
- }
-
- protected JACreater20 getAttributeCreator() {
- return new JACreater20();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java
deleted file mode 100644
index ee138a2be4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java
+++ /dev/null
@@ -1,97 +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.wst.html.core.internal.contentmodel;
-
-/**
- * New names for JSP 2.0 spec.
- *
- * @deprecated - use
- * org.eclipse.jst.jsp.core.internal.provisional.JSP20Namespace
- */
-
-public interface JSP20Namespace extends JSP11Namespace {
- public static String JSP20_URI = "";//$NON-NLS-1$
-
- /**
- * New elements for JSP 2.0 spec.
- */
- public static interface ElementName extends JSP11Namespace.ElementName {
- String DIRECTIVE_TAG = "jsp:directive.tag"; //$NON-NLS-1$
- String DIRECTIVE_ATTRIBUTE = "jsp:directive.attribute"; //$NON-NLS-1$
- String DIRECTIVE_VARIABLE = "jsp:directive.variable"; //$NON-NLS-1$
- String BODY = "jsp:body"; //$NON-NLS-1$
- String ATTRIBUTE = "jsp:attribute"; //$NON-NLS-1$
- String ELEMENT = "jsp:element"; //$NON-NLS-1$
- String DOBODY = "jsp:doBody";
- String INVOKE = "jsp:invoke";
- String OUTPUT = "jsp:output";
- }
-
- String ATTR_NAME_TAGDIR = "tagdir"; //$NON-NLS-1$
-
- String ATTR_NAME_DISPLAY_NAME = "display-name"; //$NON-NLS-1$
- String ATTR_NAME_BODY_CONTENT = "body-content"; //$NON-NLS-1$
- String ATTR_NAME_SMALL_ICON = "small-icon"; //$NON-NLS-1$
- String ATTR_NAME_LARGE_ICON = "large-icon"; //$NON-NLS-1$
- String ATTR_NAME_DESCRIPTION = "description"; //$NON-NLS-1$
- String ATTR_NAME_EXAMPLE = "example"; //$NON-NLS-1$
- String ATTR_NAME_LANGUAGE = "language"; //$NON-NLS-1$
- String ATTR_NAME_ISELIGNORED = "isELIgnored"; //$NON-NLS-1$
-
- String ATTR_NAME_REQUIRED = "required"; //$NON-NLS-1$
- String ATTR_NAME_FRAGMENT = "fragment"; //$NON-NLS-1$
- String ATTR_NAME_RTEXPRVALUE = "rtexprvalue"; //$NON-NLS-1$
- String ATTR_NAME_TYPE = "type"; //$NON-NLS-1$
-
- String ATTR_NAME_NAME_GIVEN = "name-given"; //$NON-NLS-1$
- String ATTR_NAME_NAME_FROM_ATTRIBUTE = "name-from-attribute"; //$NON-NLS-1$
- String ATTR_NAME_ALIAS = "alias"; //$NON-NLS-1$
- String ATTR_NAME_VARIABLE_CLASS = "variable-class"; //$NON-NLS-1$
- String ATTR_NAME_DECLARE = "declare"; //$NON-NLS-1$
-
- String ATTR_VALUE_SCRIPTLESS = "scriptless"; //$NON-NLS-1$
- String ATTR_VALUE_TAGDEPENDENT = "tagdependent"; //$NON-NLS-1$
- String ATTR_VALUE_EMPTY = "empty"; //$NON-NLS-1$
-
- String ATTR_NAME_TRIM = "trim"; //$NON-NLS-1$
-
- String ATTR_NAME_VAR = "var"; //$NON-NLS-1$
- String ATTR_NAME_VARREADER = "varReader"; //$NON-NLS-1$
-
- String ATTR_NAME_OMIT_XML_DECL = "omit-xml-declaration"; //$NON-NLS-1$
- String ATTR_NAME_DOCTYPE_ROOT_ELEMENT = "doctype-root-element"; //$NON-NLS-1$
- String ATTR_NAME_DOCTYPE_SYSTEM = "doctype-system"; //$NON-NLS-1$
- String ATTR_NAME_DOCTYPE_PUBLIC = "doctype-public"; //$NON-NLS-1$
-
- String ATTR_VALUE_NO = "no"; //$NON-NLS-1$
- String ATTR_VALUE_YES = "yes"; //$NON-NLS-1$
-
- String ATTR_VALUE_SCOPE_AT_END = "AT_END"; //$NON-NLS-1$
- String ATTR_VALUE_SCOPE_AT_BEGIN = "AT_BEGIN"; //$NON-NLS-1$
- String ATTR_VALUE_SCOPE_NESTED = "NESTED"; //$NON-NLS-1$
-
- String ATTR_NAME_DYNAMIC_ATTRIBUTES = "dynamic-attributes"; //$NON-NLS-1$
-
- String ATTR_VALUE_ENCODING_DEFAULT = "ISO-8859-1"; //$NON-NLS-1$
-
- String ATTR_VALUE_VARIABLE_CLASS_DEFAULT = "java.lang.String"; //$NON-NLS-1$
-
- String ATTR_NAME_MAYSCRIPT = "mayscript"; //$NON-NLS-1$
-
- String ATTR_VALUE_JVER12 = "1.2"; //$NON-NLS-1$
-
- String ATTR_VALUE_JSP_VER_20 = "2.0"; //$NON-NLS-1$
-
- // JSP 2.1 attributes
-// String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
-// String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
deleted file mode 100644
index 4b7a1ba6fb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
+++ /dev/null
@@ -1,39 +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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-class JSP21ElementCollection extends JSP20ElementCollection {
-
- class JACreator21 extends JACreater20 {
- void createForDirPage() {
- super.createForDirPage();
- AttrDecl adec;
- // ("trimDirectiveWhitespaces" ENUM DECLARED (true|false) "false")
- adec = createBoolType(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, ATTR_VALUE_FALSE);
- if (adec != null) {
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, adec);
- }
- // ("deferredSyntaxAllowedAsLiteral" ENUM DECLARED (true|false) "false")
- adec = createBoolType(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, ATTR_VALUE_FALSE);
- if (adec != null) {
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, adec);
- }
- }
- }
-
- protected JACreater20 getAttributeCreator() {
- return new JACreator21();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
deleted file mode 100644
index dde35b77c6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
+++ /dev/null
@@ -1,17 +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.wst.html.core.internal.contentmodel;
-
-public interface JSP21Namespace extends JSP20Namespace {
- String JSP21_URI = "";//$NON-NLS-1$
- String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
- String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java
deleted file mode 100644
index 802bfb2994..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * JSP extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface JSPCMDocument extends org.eclipse.wst.xml.core.internal.contentmodel.CMDocument {
-
- /**
- * A short hand method to get a element declaration for a JSP element.
- * JSP declaration class implements HTMLElementDeclaration interface.
- * @param elementName java.lang.String
- */
- HTMLElementDeclaration getElementDeclaration(String elementName);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
deleted file mode 100644
index c517f99e3e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
+++ /dev/null
@@ -1,900 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations of the JSP 1.1 and 1.2.
- */
-class JSPElementCollection extends DeclCollection implements JSP11Namespace.ElementName {
-
-
- class TypePacket {
- public String name = null;
- public int content = CMElementDeclaration.EMPTY;
- public int omit = HTMLElementDeclaration.OMIT_NONE;
- public int lineBreak = HTMLElementDeclaration.BREAK_NONE;
- public int layout = HTMLElementDeclaration.LAYOUT_NONE;
- public int correct = HTMLElementDeclaration.CORRECT_NONE;
- public int format = HTMLElementDeclaration.FORMAT_XML;
- public boolean indentChild = false;
-
- public TypePacket() {
- }
- }
-
- /** JSP element declaration. */
- class ElemDecl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
- private TypePacket type = null;
- private CMGroupImpl content = null;
- private CMNamedNodeMapImpl attributes = null;
-
- public ElemDecl(TypePacket t) {
- super(t.name, 1, 1);
- type = t;
- }
-
- public void setContent(CMGroupImpl group) {
- content = group;
- }
-
- public void setAttributes(CMNamedNodeMapImpl attrs) {
- attributes = attrs;
- }
-
- // implements CMNode
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- return true;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
- }
-
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return Boolean.FALSE; //D208839
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- String myName = getElementName();
- if (myName == JSP11Namespace.ElementName.PLUGIN) {
- return getNamedItem(JSP11Namespace.ElementName.PARAMS); // outer class method.
- }
- else if (myName == JSP11Namespace.ElementName.PARAMS) {
- return getNamedItem(JSP11Namespace.ElementName.PARAM); // outer class method.
- }
- else {
- return null;
- }
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- // implementes CMElementDeclaration
- public CMNamedNodeMap getAttributes() {
- return attributes;
- }
-
- public CMContent getContent() {
- return content;
- }
-
- public int getContentType() {
- return type.content;
- }
-
- public CMDataType getDataType() {
- return null;
- }
-
- public String getElementName() {
- return getNodeName();
- }
-
- public CMNamedNodeMap getLocalElements() {
- return null;
- }
-
- // implementes HTMLElementDeclaration
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null)
- return null;
- return (HTMLAttributeDeclaration) attributes.getNamedItem(attrName);
- }
-
- public int getCorrectionType() {
- return type.correct;
- }
-
- public CMContent getExclusion() {
- return null;
- }
-
- public CMContent getInclusion() {
- return null;
- }
-
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- public int getFormatType() {
- return type.format;
- }
-
- public int getLayoutType() {
- return type.layout;
- }
-
- public int getLineBreakHint() {
- return type.lineBreak;
- }
-
- public int getOmitType() {
- return type.omit;
- }
-
- public boolean shouldTerminateAt(HTMLElementDeclaration dec) {
- return false;
- }
-
- public boolean shouldKeepSpaces() {
- return false;
- }
-
- public boolean shouldIndentChildSource() {
- return type.indentChild;
- }
-
- public boolean isJSP() {
- return true;
- }
- }
-
- // element IDs
- static class Ids {
- public static final int ID_SCRIPTLET = 0;
- public static final int ID_EXPRESSION = 1;
- public static final int ID_DECLARATION = 2;
- public static final int ID_DIRECTIVE_PAGE = 3;
- public static final int ID_DIRECTIVE_INCLUDE = 4;
- public static final int ID_DIRECTIVE_TAGLIB = 5;
- public static final int ID_USEBEAN = 6;
- public static final int ID_SETPROPERTY = 7;
- public static final int ID_GETPROPERTY = 8;
- public static final int ID_INCLUDE = 9;
- public static final int ID_FORWARD = 10;
- public static final int ID_PLUGIN = 11;
- public static final int ID_PARAMS = 12;
- public static final int ID_FALLBACK = 13;
- public static final int ID_PARAM = 14;
- public static final int ID_ROOT = 15;
- public static final int ID_TEXT = 16;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- // attribute creater
- class JACreater implements JSP11Namespace {
- // attribute declaration
- class AttrDecl extends CMNodeImpl implements HTMLAttributeDeclaration {
- HTMLCMDataTypeImpl type = null;
- int usage = CMAttributeDeclaration.OPTIONAL;
-
- // methods
- public AttrDecl(String attrName) {
- super(attrName);
- }
-
- public String getAttrName() {
- return getNodeName();
- }
-
- public CMDataType getAttrType() {
- return type;
- }
-
- /** @deprecated by superclass */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /** @deprecated by superclass */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- public int getUsage() {
- return usage;
- }
-
- public boolean shouldIgnoreCase() {
- return false;
- }
- }
-
- CMNamedNodeMapImpl declarations = null;
-
- public JACreater() {
- declarations = new CMNamedNodeMapImpl();
- }
-
- public CMNamedNodeMapImpl getDeclarations(int eid) {
- switch (eid) {
- case Ids.ID_DIRECTIVE_PAGE :
- createForDirPage();
- break;
- case Ids.ID_DIRECTIVE_INCLUDE :
- createForDirInclude();
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- createForDirTaglib();
- break;
- case Ids.ID_USEBEAN :
- createForUseBean();
- break;
- case Ids.ID_SETPROPERTY :
- createForSetProperty();
- break;
- case Ids.ID_GETPROPERTY :
- createForGetProperty();
- break;
- case Ids.ID_INCLUDE :
- createForInclude();
- break;
- case Ids.ID_FORWARD :
- createForForward();
- break;
- case Ids.ID_PLUGIN :
- createForPlugin();
- break;
- case Ids.ID_PARAM :
- createForParam();
- break;
- case Ids.ID_ROOT :
- createForRoot();
- break;
- default :
- // should warn.
- break;
- }
- return declarations;
- }
-
- AttrDecl createBoolType(String name, String defValue) {
- AttrDecl adec = new AttrDecl(name);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, defValue);
- return adec;
- }
-
- private void createForDirPage() {
- AttrDecl adec = null;
- // ("language" CDATA DECLARED "java")
- adec = new AttrDecl(ATTR_NAME_LANGUAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
- declarations.putNamedItem(ATTR_NAME_LANGUAGE, adec);
-
- // ("extends" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_EXTENDS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_EXTENDS, adec);
-
- // ("contentType" CDATA DECLARED "text/html; ISO-8859-1")
- adec = new AttrDecl(ATTR_NAME_CONTENT_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_CT_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_CONTENT_TYPE, adec);
-
- // ("import" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IMPORT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
-
- // ("session" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_SESSION, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_SESSION, adec);
-
- // ("buffer" CDATA DECLARED "8kb")
- adec = new AttrDecl(ATTR_NAME_BUFFER);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BUFSIZ_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_BUFFER, adec);
-
- // ("autoFlush" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_AUTOFLUSH, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_AUTOFLUSH, adec);
-
- // ("isThreadSafe" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_IS_THREAD_SAFE, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_THREAD_SAFE, adec);
-
- // ("info" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_INFO);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_INFO, adec);
-
- // ("errorPage" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ERROR_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_ERROR_PAGE, adec);
-
- // ("isErrorPage" ENUM DECLARED (true|false) "false")
- adec = createBoolType(ATTR_NAME_IS_ERROR_PAGE, ATTR_VALUE_FALSE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_ERROR_PAGE, adec);
-
- // ("pageEncoding" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_PAGE_ENCODING);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_PAGE_ENCODING, adec);
-
- }
-
- private void createForDirInclude() {
- // ("file" URI REQUIRED); Defect TORO:185241
- AttrDecl adec = new AttrDecl(ATTR_NAME_FILE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_FILE, adec);
- }
-
- private void createForDirTaglib() {
- // ("uri" URI REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_URI, adec);
-
- // ("prefix" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PREFIX);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
- }
-
- private void createForUseBean() {
- // ("id" ID REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_ID);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ID);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_ID, adec);
-
- // ("scope" ENUM DECLARED (page|session|request|application) "page")
- adec = new AttrDecl(ATTR_NAME_SCOPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_SESSION, ATTR_VALUE_REQUEST, ATTR_VALUE_APPLICATION};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
- declarations.putNamedItem(ATTR_NAME_SCOPE, adec);
-
- // ("class" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_CLASS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_CLASS, adec);
-
- // ("beanName" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_BEAN_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_BEAN_NAME, adec);
-
- // ("type" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
- }
-
- private void createForSetProperty() {
- // ("name" IDREF REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("property" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PROPERTY);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
- // ("value" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VALUE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
- // ("param" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_PARAM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_PARAM, adec);
-
- }
-
- private void createForGetProperty() {
- // ("name" IDREF REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("property" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PROPERTY);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
- }
-
- private void createForInclude() {
- AttrDecl adec = null;
- // ("page" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PAGE, adec);
-
- // ("flush" ENUM OPTIONAL (true|false)); Defect TORO:185241
- adec = new AttrDecl(ATTR_NAME_FLUSH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- declarations.putNamedItem(ATTR_NAME_FLUSH, adec);
- }
-
- private void createForForward() {
- // ("page" URI REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PAGE, adec);
- }
-
- private void createForPlugin() {
- // ("type" ENUM REQUIRED (bean|applet))
- AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
- adec.type.setEnumValues(values);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-
- // ("code" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODE, adec);
-
- // ("codebase" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODEBASE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
-
- // ("align" ENUM IMPLIED (top|middle|bottom|left|right))
- adec = new AttrDecl(ATTR_NAME_ALIGN);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- adec.type.setEnumValues(aligns);
- declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
-
- // ("archive" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ARCHIVE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
-
- // ("height" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HEIGHT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
-
- // ("hspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
-
- // ("jreversion" CDATA DECLARED "1.1")
- adec = new AttrDecl(ATTR_NAME_JREVERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JVER11);
- declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
-
- // ("name" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("vspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
-
- // ("width" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_WIDTH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
-
- // ("nspluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
-
- // ("iepluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
- }
-
- private void createForParam() {
- // ("name" CDATA REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("value" CDATA REQUIRED); Defect TORO:185241
- adec = new AttrDecl(ATTR_NAME_VALUE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
- }
-
- private void createForRoot() {
- // ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
- AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
- declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
- // ("version" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_VERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VERSION, adec);
- }
- }
-
- private final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_SCRIPTLET] = SCRIPTLET;
- names[Ids.ID_EXPRESSION] = EXPRESSION;
- names[Ids.ID_DECLARATION] = DECLARATION;
- names[Ids.ID_DIRECTIVE_PAGE] = DIRECTIVE_PAGE;
- names[Ids.ID_DIRECTIVE_INCLUDE] = DIRECTIVE_INCLUDE;
- names[Ids.ID_DIRECTIVE_TAGLIB] = DIRECTIVE_TAGLIB;
- names[Ids.ID_USEBEAN] = USEBEAN;
- names[Ids.ID_SETPROPERTY] = SETPROPERTY;
- names[Ids.ID_GETPROPERTY] = GETPROPERTY;
- names[Ids.ID_INCLUDE] = INCLUDE;
- names[Ids.ID_FORWARD] = FORWARD;
- names[Ids.ID_PLUGIN] = PLUGIN;
- names[Ids.ID_PARAMS] = PARAMS;
- names[Ids.ID_FALLBACK] = FALLBACK;
- names[Ids.ID_PARAM] = PARAM;
- names[Ids.ID_ROOT] = ROOT;
- names[Ids.ID_TEXT] = TEXT;
- }
-
- JSPElementCollection(String[] names, boolean tolerant) {
- super(names, tolerant);
- }
-
- /**
- */
- public JSPElementCollection() {
- super(names, TOLERANT_CASE);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param elementName java.lang.String
- */
- protected CMNode create(String elementName) {
- return createElemDecl(getID(elementName));
- }
-
- /**
- * @param eid int
- */
- CMGroupImpl createContent(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- CMGroupImpl content = null;
- CMNode child = null;
-
- switch (eid) {
- case Ids.ID_INCLUDE :
- case Ids.ID_FORWARD :
- // (jsp:param)*
- content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- child = item(Ids.ID_PARAM);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_PLUGIN :
- // (jsp:params | jsp:fallback)?
- content = new CMGroupImpl(CMGroup.CHOICE, 0, 1);
- // jsp:params
- child = item(Ids.ID_PARAMS);
- if (child != null)
- content.appendChild(child);
- // jsp:fallback
- child = item(Ids.ID_FALLBACK);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_PARAMS :
- // (jsp:param)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- child = item(Ids.ID_PARAM);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_ROOT :
- // %Body;
- // --> (jsp:text|%Directives;|%Scripts;|%Actions;)*
- // %Directives --> jsp:directive.page|jsp:directive.include
- // %Scripts; --> jsp:scriptlet|jsp:declaration|jsp:expression
- // %Actions --> jsp:useBean|jsp.setProperty|jsp:getProperty
- // |jsp:include|jsp:forward|jsp:plugin
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- int validChildren[] = {Ids.ID_TEXT,
- // %Directves;
- Ids.ID_DIRECTIVE_PAGE, Ids.ID_DIRECTIVE_INCLUDE,
- // %Scripts;
- Ids.ID_SCRIPTLET, Ids.ID_DECLARATION, Ids.ID_EXPRESSION,
- // %Actions;
- Ids.ID_USEBEAN, Ids.ID_SETPROPERTY, Ids.ID_GETPROPERTY, Ids.ID_INCLUDE, Ids.ID_FORWARD, Ids.ID_PLUGIN};
- for (int i = 0; i < validChildren.length; i++) {
- child = item(validChildren[i]);
- if (child != null)
- content.appendChild(child);
- }
- break;
- }
-
- return content;
- }
-
- /**
- * @param eid int
- */
- HTMLElementDeclaration createElemDecl(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- TypePacket packet = new TypePacket();
- switch (eid) {
- case Ids.ID_SCRIPTLET :
- // content, omit, lineBreak, layout, correct, format
- // scriptlet
- packet.name = SCRIPTLET;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_EXPRESSION :
- // expression
- packet.name = EXPRESSION;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_DECLARATION :
- // declaration
- packet.name = DECLARATION;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_DIRECTIVE_PAGE :
- // directive.page
- packet.name = DIRECTIVE_PAGE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_DIRECTIVE_INCLUDE :
- // directive.inlcude
- packet.name = DIRECTIVE_INCLUDE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- // directive.taglib
- packet.name = DIRECTIVE_TAGLIB;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_USEBEAN :
- // useBean
- packet.name = USEBEAN;
- packet.content = CMElementDeclaration.ANY;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.indentChild = true;
- break;
- case Ids.ID_SETPROPERTY :
- // setProperty
- packet.name = SETPROPERTY;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_GETPROPERTY :
- // getProperty
- packet.name = GETPROPERTY;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- break;
- case Ids.ID_INCLUDE :
- // include
- packet.name = INCLUDE;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_FORWARD :
- // forward
- packet.name = FORWARD;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_PLUGIN :
- // plugin
- packet.name = PLUGIN;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_PARAMS :
- // params
- packet.name = PARAMS;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.indentChild = true;
- break;
- case Ids.ID_FALLBACK :
- // fallback
- packet.name = FALLBACK;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_PARAM :
- // param
- packet.name = PARAM;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_ROOT :
- packet.name = ROOT;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
- break;
- case Ids.ID_TEXT :
- packet.name = TEXT;
- packet.content = CMElementDeclaration.PCDATA;
- break;
- default :
- // unknown ID
- return null;
- }
-
- ElemDecl dec = new ElemDecl(packet);
-
- CMGroupImpl content = createContent(eid);
- if (content != null)
- dec.setContent(content);
-
- JACreater creater = new JACreater();
- dec.setAttributes(creater.getDeclarations(eid));
-
- return dec;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java
deleted file mode 100644
index f3972ecd36..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
- boolean supports(HTMLElementDeclaration edecl);
-
- Object get(HTMLElementDeclaration edecl);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
deleted file mode 100644
index 5eb1abe27e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
- /**
- * DefaultProvider is intended to be used for unknown properties.
- * It always returns null value for any properties.
- */
- class DefaultProvider implements PropertyProvider {
- public DefaultProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return false;
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- return null;
- }
- }
-
- abstract class AbstractElementPropertyProvider implements PropertyProvider {
- protected AbstractElementPropertyProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return (edecl != null);
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- if (!(edecl instanceof HTMLPropertyDeclaration))
- return null;
- return getElementProperty((HTMLPropertyDeclaration)edecl);
- }
-
- abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
- }
-
- /*
- * "tagInfo"
- * gets documentation for the element
- */
- class PPTagInfo extends AbstractElementPropertyProvider {
- private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
- protected AnnotationMap fAnnotationMap = null;
-
- public PPTagInfo() {
- super();
- }
-
- /**
- * Gets the annotationMap.
- * @return Returns a AnnotationMap
- */
- protected AnnotationMap getAnnotationMap() {
- if (fAnnotationMap == null) {
- fAnnotationMap = new AnnotationMap();
- try {
- fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
- }
- catch (Exception e) {
- // no annotation available
- }
- }
- return fAnnotationMap;
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl instanceof HTMLElementDeclaration) {
- return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
- } else {
- return null;
- }
- }
- }
-
- /*
- * "shouldKeepSpace"
- */
- class PPShouldKeepSpace extends AbstractElementPropertyProvider {
- public PPShouldKeepSpace() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldKeepSpaces());
- }
- }
-
- /*
- * "shouldIndentChildSource"
- */
- class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
- public PPShouldIndentChildSource() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldIndentChildSource());
- }
- }
-
- /*
- * "terminators"
- */
- class PPTerminators extends AbstractElementPropertyProvider {
- public PPTerminators() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (! (decl instanceof HTMLElemDeclImpl)) return null;
- return ((HTMLElemDeclImpl)decl).getTerminators();
- }
- }
-
- /*
- * "prohibitedAncestors"
- */
- class PPProhibitedAncestors extends AbstractElementPropertyProvider {
- public PPProhibitedAncestors() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getProhibitedAncestors();
- }
- }
-
- /*
- * "isJSP"
- */
- class PPIsJSP extends AbstractElementPropertyProvider {
- public PPIsJSP() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.isJSP());
- }
- }
-
- /*
- * "isXHTML"
- * HTMLElementDeclaration itself never represent any XHTML element declaration.
- * So, this property must be always false.
- */
- class PPIsXHTML extends AbstractElementPropertyProvider {
- public PPIsXHTML() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "isSSI"
- * Each declaration class for SSI elements must provide this property itself,
- * and then return true. Other declaration must always return false.
- */
- class PPIsSSI extends AbstractElementPropertyProvider {
- public PPIsSSI() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "lineBreakHint"
- */
- class PPLineBreakHint extends AbstractElementPropertyProvider {
- public PPLineBreakHint() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String hint = HTMLCMProperties.Values.BREAK_NONE;
- switch (decl.getLineBreakHint()) {
- case HTMLElementDeclaration.BREAK_AFTER_START :
- hint = HTMLCMProperties.Values.BREAK_AFTER_START;
- break;
- case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
- hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
- break;
- case HTMLElementDeclaration.BREAK_NONE :
- // nothing to do
- default :
- break;
- }
- return hint;
- }
- }
-
- /*
- * "layoutType"
- */
- class PPLayoutType extends AbstractElementPropertyProvider {
- public PPLayoutType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.LAYOUT_NONE;
- switch (decl.getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- type = HTMLCMProperties.Values.LAYOUT_BLOCK;
- break;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- type = HTMLCMProperties.Values.LAYOUT_BREAK;
- break;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
- break;
- case HTMLElementDeclaration.LAYOUT_OBJECT :
- type = HTMLCMProperties.Values.LAYOUT_OBJECT;
- break;
- case HTMLElementDeclaration.LAYOUT_WRAP :
- type = HTMLCMProperties.Values.LAYOUT_WRAP;
- break;
- case HTMLElementDeclaration.LAYOUT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "omitType"
- */
- class PPOmitType extends AbstractElementPropertyProvider {
- public PPOmitType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.OMIT_NONE;
- switch (decl.getOmitType()) {
- case HTMLElementDeclaration.OMIT_BOTH :
- type = HTMLCMProperties.Values.OMIT_BOTH;
- break;
- case HTMLElementDeclaration.OMIT_END :
- type = HTMLCMProperties.Values.OMIT_END;
- break;
- case HTMLElementDeclaration.OMIT_END_DEFAULT :
- type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
- break;
- case HTMLElementDeclaration.OMIT_END_MUST :
- type = HTMLCMProperties.Values.OMIT_END_MUST;
- break;
- case HTMLElementDeclaration.OMIT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "inclusion"
- */
- class PPInclusion extends AbstractElementPropertyProvider {
- public PPInclusion() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getInclusion();
- }
- }
-
- public static PropertyProvider getProvider(String propName) {
- PropertyProviderFactory factory = getInstance();
- PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
- if (pp != null)
- return pp;
-
- pp = factory.create(propName);
- if (pp == null)
- return factory.defaultProvider;
-
- factory.registry.put(propName, pp);
- return pp;
- }
-
- private static PropertyProviderFactory instance = null;
-
- private synchronized static PropertyProviderFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new PropertyProviderFactory();
- return instance;
- }
-
- private Hashtable registry = new Hashtable();
- private PropertyProvider defaultProvider = new DefaultProvider();
-
- private PropertyProviderFactory() {
- super();
- }
-
- private PropertyProvider create(String propName) {
- PropertyProvider pp = null;
- if (propName.equals(HTMLCMProperties.IS_JSP))
- pp = new PPIsJSP();
- else if (propName.equals(HTMLCMProperties.IS_XHTML))
- pp = new PPIsXHTML();
- else if (propName.equals(HTMLCMProperties.IS_SSI))
- pp = new PPIsSSI();
- else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
- pp = new PPLayoutType();
- else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
- pp = new PPLineBreakHint();
- else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
- pp = new PPProhibitedAncestors();
- else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
- pp = new PPShouldKeepSpace();
- else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
- pp = new PPShouldIndentChildSource();
- else if (propName.equals(HTMLCMProperties.TERMINATORS))
- pp = new PPTerminators();
- else if (propName.equals(HTMLCMProperties.TAGINFO))
- pp = new PPTagInfo();
- else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
- pp = new PPOmitType();
- else if (propName.equals(HTMLCMProperties.INCLUSION))
- pp = new PPInclusion();
-
- return pp;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
deleted file mode 100644
index 13cbfa1615..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
+++ /dev/null
@@ -1,697 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations of JSP 2.0 Tag files.
- */
-class Tag20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
- // element IDs
- private static class TagIds20 {
- public static final int ID_SCRIPTLET = 0;
- public static final int ID_EXPRESSION = 1;
- public static final int ID_DECLARATION = 2;
- public static final int ID_DIRECTIVE_TAG = 3;
- public static final int ID_DIRECTIVE_INCLUDE = 4;
- public static final int ID_DIRECTIVE_TAGLIB = 5;
- public static final int ID_USEBEAN = 6;
- public static final int ID_SETPROPERTY = 7;
- public static final int ID_GETPROPERTY = 8;
- public static final int ID_INCLUDE = 9;
- public static final int ID_FORWARD = 10;
- public static final int ID_PLUGIN = 11;
- public static final int ID_PARAMS = 12;
- public static final int ID_FALLBACK = 13;
- public static final int ID_PARAM = 14;
- public static final int ID_ROOT = 15;
- public static final int ID_TEXT = 16;
- public static final int ID_DIRECTIVE_VARIABLE = 17;
- public static final int ID_DIRECTIVE_ATTRIBUTE = 18;
- public static final int ID_BODY = 19;
- public static final int ID_ATTRIBUTE = 20;
- public static final int ID_ELEMENT = 21;
- public static final int ID_DOBODY = 22;
- public static final int ID_INVOKE = 23;
- public static final int ID_OUTPUT = 24;
-
- // chache the result of the reflection.
- private static int numofids = -1;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = TagIds20.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
- }
-
- // attribute creater
- class TACreater20 extends JACreater {
-
- public TACreater20() {
- super();
- }
-
- private void createForAttribute() {
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_TRIM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TRIM, adec);
- }
-
- private void createForBody() {
- }
-
- private void createForDirAttribute() {
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_REQUIRED);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_REQUIRED, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_FRAGMENT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_FRAGMENT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_RTEXPRVALUE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_RTEXPRVALUE, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TYPE, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DESCRIPTION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DESCRIPTION, adec);
- }
-
- void createForDirTag() {
- // ("import" URI optional)
- AttrDecl adec = new AttrDecl(ATTR_NAME_IMPORT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DISPLAY_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ID);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DISPLAY_NAME, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_BODY_CONTENT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {JSP20Namespace.ATTR_VALUE_EMPTY, JSP20Namespace.ATTR_VALUE_TAGDEPENDENT, JSP20Namespace.ATTR_VALUE_SCRIPTLESS};
- adec.type.setEnumValues(values);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_SCRIPTLESS);
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_BODY_CONTENT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DYNAMIC_ATTRIBUTES);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DYNAMIC_ATTRIBUTES, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_SMALL_ICON);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_SMALL_ICON, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_LARGE_ICON);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_LARGE_ICON, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DESCRIPTION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DESCRIPTION, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_EXAMPLE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_EXAMPLE, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_LANGUAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_LANGUAGE, adec);
-
- adec = new AttrDecl(JSP11Namespace.ATTR_NAME_IMPORT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP11Namespace.ATTR_NAME_IMPORT, adec);
-
- adec = new AttrDecl(JSP11Namespace.ATTR_NAME_PAGE_ENCODING);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_ENCODING_DEFAULT);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP11Namespace.ATTR_NAME_PAGE_ENCODING, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_ISELIGNORED);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_ISELIGNORED, adec);
- }
-
- /**
- * Changed in 2.0 (tagdir added)
- */
- void createForDirTaglib() {
- // ("uri" URI OPTIONAL)
- AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(ATTR_NAME_URI, adec);
-
- // ("tagdir" URI OPTIONAL)
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_TAGDIR);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR, adec);
-
- // ("prefix" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PREFIX);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
- }
-
- private void createForDirVariable() {
- AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_NAME_GIVEN);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_NAME_GIVEN, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_NAME_FROM_ATTRIBUTE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_NAME_FROM_ATTRIBUTE, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_ALIAS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_ALIAS, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VARIABLE_CLASS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_VARIABLE_CLASS_DEFAULT);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VARIABLE_CLASS, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DECLARE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DECLARE, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DESCRIPTION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DESCRIPTION, adec);
-
- adec = new AttrDecl(JSP11Namespace.ATTR_NAME_SCOPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- values = new String[]{JSP20Namespace.ATTR_VALUE_SCOPE_NESTED, JSP20Namespace.ATTR_VALUE_SCOPE_AT_BEGIN, JSP20Namespace.ATTR_VALUE_SCOPE_AT_END};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_SCOPE_NESTED);
- declarations.putNamedItem(JSP11Namespace.ATTR_NAME_SCOPE, adec);
- }
-
- private void createForDoBody() {
- AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VAR);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VAR, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VARREADER);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VARREADER, adec);
-
- adec = new AttrDecl(JSP11Namespace.ATTR_NAME_SCOPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_REQUEST, ATTR_VALUE_SESSION, ATTR_VALUE_APPLICATION};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP11Namespace.ATTR_NAME_SCOPE, adec);
- }
-
- private void createForElement() {
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
- }
-
- private void createForInvoke() {
- AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_FRAGMENT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_FRAGMENT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VAR);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VAR, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VARREADER);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VARREADER, adec);
-
- adec = new AttrDecl(JSP11Namespace.ATTR_NAME_SCOPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_REQUEST, ATTR_VALUE_SESSION, ATTR_VALUE_APPLICATION};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP11Namespace.ATTR_NAME_SCOPE, adec);
- }
-
- private void createForOutput() {
- AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, JSP20Namespace.ATTR_VALUE_YES, JSP20Namespace.ATTR_VALUE_NO};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_NO);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_SYSTEM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_SYSTEM, adec);
-
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_PUBLIC);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_PUBLIC, adec);
- }
-
- private void createForRoot() {
- // ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
- AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
- declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
- // ("version" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_VERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JSP_VER_20);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VERSION, adec);
- }
-
- private void createForPlugin() {
- // ("type" ENUM REQUIRED (bean|applet))
- AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
- adec.type.setEnumValues(values);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-
- // ("code" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODE, adec);
-
- // ("codebase" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODEBASE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
-
- // ("align" ENUM IMPLIED (top|middle|bottom|left|right))
- adec = new AttrDecl(ATTR_NAME_ALIGN);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- adec.type.setEnumValues(aligns);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BOTTOM);
- declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
-
- // ("archive" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ARCHIVE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
-
- // ("height" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HEIGHT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
-
- // ("hspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
-
- // ("jreversion" CDATA DECLARED "1.1")
- adec = new AttrDecl(ATTR_NAME_JREVERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JVER12);
- declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
-
- // ("name" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("vspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
-
- // ("width" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_WIDTH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
-
- // ("nspluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
-
- // ("iepluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
-
- // ("mayscript" ENUM IMPLIED (true | false)
- adec = new AttrDecl(JSP20Namespace.ATTR_NAME_MAYSCRIPT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.type.setEnumValues(new String[] {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE});
- declarations.putNamedItem(JSP20Namespace.ATTR_NAME_MAYSCRIPT, adec);
- }
-
- public CMNamedNodeMapImpl getDeclarations(int eid) {
- switch (eid) {
- case TagIds20.ID_DIRECTIVE_TAG :
- createForDirTag();
- break;
- case TagIds20.ID_DIRECTIVE_VARIABLE :
- createForDirVariable();
- break;
- case TagIds20.ID_DIRECTIVE_ATTRIBUTE :
- createForDirAttribute();
- break;
- case TagIds20.ID_DIRECTIVE_TAGLIB :
- createForDirTaglib();
- break;
- case TagIds20.ID_ATTRIBUTE :
- createForAttribute();
- break;
- case TagIds20.ID_ELEMENT :
- createForElement();
- break;
- case TagIds20.ID_BODY :
- createForBody();
- break;
- case TagIds20.ID_DOBODY :
- createForDoBody();
- break;
- case TagIds20.ID_INVOKE :
- createForInvoke();
- break;
- case TagIds20.ID_OUTPUT :
- createForOutput();
- break;
- case TagIds20.ID_ROOT :
- createForRoot();
- break;
- case TagIds20.ID_PLUGIN :
- createForPlugin();
- break;
- default :
- super.getDeclarations(eid);
- break;
- }
- return declarations;
- }
- }
-
- private static String[] names = null;
-
- static {
- names = new String[TagIds20.getNumOfIds()];
- names[TagIds20.ID_SCRIPTLET] = JSP11Namespace.ElementName.SCRIPTLET;
- names[TagIds20.ID_EXPRESSION] = JSP11Namespace.ElementName.EXPRESSION;
- names[TagIds20.ID_DECLARATION] = JSP11Namespace.ElementName.DECLARATION;
- names[TagIds20.ID_DIRECTIVE_TAG] = JSP20Namespace.ElementName.DIRECTIVE_TAG;
- names[TagIds20.ID_DIRECTIVE_INCLUDE] = JSP11Namespace.ElementName.DIRECTIVE_INCLUDE;
- names[TagIds20.ID_DIRECTIVE_TAGLIB] = JSP11Namespace.ElementName.DIRECTIVE_TAGLIB;
- names[TagIds20.ID_USEBEAN] = JSP11Namespace.ElementName.USEBEAN;
- names[TagIds20.ID_SETPROPERTY] = JSP11Namespace.ElementName.SETPROPERTY;
- names[TagIds20.ID_GETPROPERTY] = JSP11Namespace.ElementName.GETPROPERTY;
- names[TagIds20.ID_INCLUDE] = JSP11Namespace.ElementName.INCLUDE;
- names[TagIds20.ID_FORWARD] = JSP11Namespace.ElementName.FORWARD;
- names[TagIds20.ID_PLUGIN] = JSP11Namespace.ElementName.PLUGIN;
- names[TagIds20.ID_PARAMS] = JSP11Namespace.ElementName.PARAMS;
- names[TagIds20.ID_FALLBACK] = JSP11Namespace.ElementName.FALLBACK;
- names[TagIds20.ID_PARAM] = JSP11Namespace.ElementName.PARAM;
- names[TagIds20.ID_ROOT] = JSP11Namespace.ElementName.ROOT;
- names[TagIds20.ID_TEXT] = JSP11Namespace.ElementName.TEXT;
- names[TagIds20.ID_DIRECTIVE_VARIABLE] = JSP20Namespace.ElementName.DIRECTIVE_VARIABLE;
- names[TagIds20.ID_DIRECTIVE_ATTRIBUTE] = JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE;
- names[TagIds20.ID_BODY] = JSP20Namespace.ElementName.BODY;
- names[TagIds20.ID_ATTRIBUTE] = JSP20Namespace.ElementName.ATTRIBUTE;
- names[TagIds20.ID_ELEMENT] = JSP20Namespace.ElementName.ELEMENT;
- names[TagIds20.ID_DOBODY] = JSP20Namespace.ElementName.DOBODY;
- names[TagIds20.ID_INVOKE] = JSP20Namespace.ElementName.INVOKE;
- names[TagIds20.ID_OUTPUT] = JSP20Namespace.ElementName.OUTPUT;
- }
-
- /**
- */
- public Tag20ElementCollection() {
- super(Tag20ElementCollection.names, TOLERANT_CASE);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param elementName
- * java.lang.String
- */
- protected CMNode create(String elementName) {
- return createElemDecl(getID(elementName));
- }
-
- /**
- * @param eid
- * int
- */
- CMGroupImpl createContent(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- CMGroupImpl content = null;
- CMNode child = null;
-
- switch (eid) {
- case Ids.ID_ROOT :
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- int validChildren[] = {
- // %Directives;
- Ids.ID_TEXT, Ids.ID_DIRECTIVE_PAGE, Ids.ID_DIRECTIVE_INCLUDE, TagIds20.ID_DIRECTIVE_TAG, TagIds20.ID_DIRECTIVE_VARIABLE, TagIds20.ID_DIRECTIVE_ATTRIBUTE, TagIds20.ID_BODY, TagIds20.ID_ATTRIBUTE,
- // %Scripts;
- Ids.ID_SCRIPTLET, Ids.ID_DECLARATION, Ids.ID_EXPRESSION,
- // %Actions;
- Ids.ID_USEBEAN, Ids.ID_SETPROPERTY, Ids.ID_GETPROPERTY, Ids.ID_INCLUDE, Ids.ID_FORWARD, Ids.ID_PLUGIN};
- for (int i = 0; i < validChildren.length; i++) {
- child = item(validChildren[i]);
- if (child != null)
- content.appendChild(child);
- }
- break;
- default :
- content = super.createContent(eid);
- break;
- }
-
- return content;
- }
-
- /**
- * @param eid
- * int
- */
- HTMLElementDeclaration createElemDecl(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- TypePacket packet = new TypePacket();
- switch (eid) {
- case TagIds20.ID_DIRECTIVE_TAG :
- // directive.taglib
- packet.name = DIRECTIVE_TAG;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case TagIds20.ID_DIRECTIVE_VARIABLE :
- // directive.taglib
- packet.name = DIRECTIVE_VARIABLE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case TagIds20.ID_DIRECTIVE_ATTRIBUTE :
- // directive.taglib
- packet.name = DIRECTIVE_ATTRIBUTE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case TagIds20.ID_DIRECTIVE_TAGLIB :
- // directive.taglib
- packet.name = DIRECTIVE_TAGLIB;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case TagIds20.ID_BODY :
- // declaration
- packet.name = BODY;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_ELEMENT :
- // declaration
- packet.name = JSP20Namespace.ElementName.ELEMENT;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_ATTRIBUTE :
- // declaration
- packet.name = JSP20Namespace.ElementName.ATTRIBUTE;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_DOBODY :
- // declaration
- packet.name = JSP20Namespace.ElementName.DOBODY;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_INVOKE :
- // declaration
- packet.name = JSP20Namespace.ElementName.INVOKE;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_OUTPUT :
- // declaration
- packet.name = JSP20Namespace.ElementName.OUTPUT;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case TagIds20.ID_ROOT :
- packet.name = ROOT;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
- break;
- case TagIds20.ID_PLUGIN :
- // plugin
- packet.name = PLUGIN;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- default :
- return super.createElemDecl(eid);
- }
- ElemDecl decl = new ElemDecl(packet);
-
- CMGroupImpl content = createContent(eid);
- if (content != null)
- decl.setContent(content);
-
- TACreater20 creater = getAttributeCreater();
- decl.setAttributes(creater.getDeclarations(eid));
-
- return decl;
- }
-
- protected TACreater20 getAttributeCreater(){
- return new TACreater20();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java
deleted file mode 100644
index cd23d63fe9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-public class Tag21ElementCollection extends Tag20ElementCollection {
-
- class TACreater21 extends TACreater20{
-
- void createForDirTag() {
- super.createForDirTag();
- AttrDecl adec;
- // ("trimDirectiveWhitespaces" ENUM DECLARED (true|false) "false")
- adec = createBoolType(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, ATTR_VALUE_FALSE);
- if (adec != null) {
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, adec);
- }
- // ("deferredSyntaxAllowedAsLiteral" ENUM DECLARED (true|false) "false")
- adec = createBoolType(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, ATTR_VALUE_FALSE);
- if (adec != null) {
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- declarations.putNamedItem(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, adec);
- }
- }
- }
-
- protected TACreater20 getAttributeCreater(){
- return new TACreater21();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java
deleted file mode 100644
index 3ec31c0dd2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-/**
- * Implementation of CMDocument for the JSP 2.1 tag files.
- */
-class TagCM21DocImpl extends JCMDocImpl {
- /**
- * HCMDocImpl constructor comment.
- */
- public TagCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName, targetNamespace, new Tag21ElementCollection());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCMDocImpl.java
deleted file mode 100644
index b2298f22b7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCMDocImpl.java
+++ /dev/null
@@ -1,23 +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.wst.html.core.internal.contentmodel;
-
-/**
- * Implementation of CMDocument for the JSP 2.0 tag files.
- */
-class TagCMDocImpl extends JCMDocImpl {
- /**
- * HCMDocImpl constructor comment.
- */
- public TagCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName, targetNamespace, new Tag20ElementCollection());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
deleted file mode 100644
index e563228f3c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-final class AttributeCollection extends CMNamedNodeMapImpl implements CHTMLNamespace {
- /**
- * constructor.
- */
- public AttributeCollection() {
- super();
- }
-
- /**
- * Create an attribute declaration.
- * @param attrName java.lang.String
- */
- private HTMLAttrDeclImpl create(String attrName) {
- HTMLAttrDeclImpl attr = null;
- HTMLCMDataTypeImpl atype = null;
-
- if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
- // (action %URI #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
- // (alt %Text; #REQUIRED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
- // (border %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
- // (checked (checked) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_CHECKED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
- // (clear (left | all | right | none) none)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
- // (cols NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
- // (enctype %ContentType; "application/x-www-form-urlencoded")
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
- // (height %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
- // (href %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
- // (hspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
- // (http-equiv NAME #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
- // (maxlength NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
- // (method (GET|POST) GET)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
- // (multiple (multiple) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MULTIPLE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
- // (name CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
- // (noshade (noshade) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOSHADE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
- // (rows NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
- // (selected (selected) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_SELECTED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
- // (size %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
- // (src %URI; #IMPLIED)
- // NOTE: "src" attributes are defined in several elements.
- // The definition of IMG is different from others.
- // So, it should be locally defined.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
- // (type %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
- // (value CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
- // (version CDATA #FIXED '%HTML.Version;)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
- // (width %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
- // (vspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D205514
- }
- else {
- // unknown attribute; maybe error.
- // should warn.
- attr = null;
- }
-
- return attr;
- }
-
- /**
- * Get %bodycolors; declarations.
- */
- public void getBodycolors(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get align attribute which has %IAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForImage() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Create an attribute declaration for <code>align</code>
- * in several elements, like <code>P</code>, <code>DIV</code>.
- * The values are different from attributes those have the same name
- * in other elements (<code>IMG</code> and <code>TABLE</code>).
- * So, it can't treat as global attributes.
- * <strong>NOTE: These attribute declaration has
- * no owner CMDocument instance.</strong>
- */
- public static final HTMLAttrDeclImpl createAlignForParagraph() {
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values: left|center|right|justify
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT,};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get %attrs; declarations.
- * %attrs; consists of %coreattrs;, %i18n, and %events;.
- */
- public void getAttrs(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get %coreattrs; declarations.
- */
- public void getCore(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get a global attribute declaration.
- * @param attrName java.lang.String
- */
- public HTMLAttributeDeclaration getDeclaration(String attrName) {
- CMNode cmnode = getNamedItem(attrName);
- if (cmnode != null)
- return (HTMLAttributeDeclaration) cmnode; // already exists.
-
- HTMLAttrDeclImpl dec = create(attrName);
- if (dec != null)
- putNamedItem(attrName, dec);
-
- return dec;
- }
-
- /**
- * Get declarations which are specified by names.
- * @param names java.util.Iterator
- */
- public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
- while (names.hasNext()) {
- String attrName = (String) names.next();
- HTMLAttributeDeclaration dec = getDeclaration(attrName);
- if (dec != null)
- declarations.putNamedItem(attrName, dec);
- }
- }
-
- /**
- * Get %events; declarations.
- */
- public void getEvents(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get %i18n; declarations.
- */
- public void getI18n(CMNamedNodeMapImpl declarations) {
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
deleted file mode 100644
index 00b35285ac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMDocument implementation for the HTML.
- */
-public class CHCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespace namespace = null;
- private ElementCollection elements = null;
- private EntityCollection entities = null;
- private AttributeCollection attributes = null;
-
- /**
- */
- public CHCMDocImpl(String docTypeName, CMNamespace targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
- attributes = new AttributeCollection();
- elements = new ElementCollection(attributes);
- entities = new EntityCollection();
- }
-
- AttributeCollection getAttributes() {
- return attributes;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- public CMNamedNodeMap getEntities() {
- return entities;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- if (entities == null)
- return null;
- return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
deleted file mode 100644
index 456503c123..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface CHTMLNamespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = HTML40Namespace.ElementName.A;
- public static final String ADDRESS = HTML40Namespace.ElementName.ADDRESS;
- public static final String BASE = HTML40Namespace.ElementName.BASE;
- public static final String BLOCKQUOTE = HTML40Namespace.ElementName.BLOCKQUOTE;
- public static final String BODY = HTML40Namespace.ElementName.BODY;
- public static final String BR = HTML40Namespace.ElementName.BR;
- public static final String CENTER = HTML40Namespace.ElementName.CENTER;
- public static final String DD = HTML40Namespace.ElementName.DD;
- public static final String DIR = HTML40Namespace.ElementName.DIR;
- public static final String DIV = HTML40Namespace.ElementName.DIV;
- public static final String DL = HTML40Namespace.ElementName.DL;
- public static final String DT = HTML40Namespace.ElementName.DT;
- public static final String FORM = HTML40Namespace.ElementName.FORM;
- public static final String H1 = HTML40Namespace.ElementName.H1;
- public static final String H2 = HTML40Namespace.ElementName.H2;
- public static final String H3 = HTML40Namespace.ElementName.H3;
- public static final String H4 = HTML40Namespace.ElementName.H4;
- public static final String H5 = HTML40Namespace.ElementName.H5;
- public static final String H6 = HTML40Namespace.ElementName.H6;
- public static final String HEAD = HTML40Namespace.ElementName.HEAD;
- public static final String HR = HTML40Namespace.ElementName.HR;
- public static final String HTML = HTML40Namespace.ElementName.HTML;
- public static final String IMG = HTML40Namespace.ElementName.IMG;
- public static final String INPUT = HTML40Namespace.ElementName.INPUT;
- public static final String LI = HTML40Namespace.ElementName.LI;
- public static final String MENU = HTML40Namespace.ElementName.MENU;
- public static final String META = HTML40Namespace.ElementName.META;
- public static final String OL = HTML40Namespace.ElementName.OL;
- public static final String OPTION = HTML40Namespace.ElementName.OPTION;
- public static final String P = HTML40Namespace.ElementName.P;
- public static final String PRE = HTML40Namespace.ElementName.PRE;
- public static final String SELECT = HTML40Namespace.ElementName.SELECT;
- public static final String TEXTAREA = HTML40Namespace.ElementName.TEXTAREA;
- public static final String TITLE = HTML40Namespace.ElementName.TITLE;
- public static final String UL = HTML40Namespace.ElementName.UL;
- public static final String SSI_CONFIG = HTML40Namespace.ElementName.SSI_CONFIG;
- public static final String SSI_ECHO = HTML40Namespace.ElementName.SSI_ECHO;
- public static final String SSI_EXEC = HTML40Namespace.ElementName.SSI_EXEC;
- public static final String SSI_FSIZE = HTML40Namespace.ElementName.SSI_FSIZE;
- public static final String SSI_FLASTMOD = HTML40Namespace.ElementName.SSI_FLASTMOD;
- public static final String SSI_INCLUDE = HTML40Namespace.ElementName.SSI_INCLUDE;
- public static final String SSI_PRINTENV = HTML40Namespace.ElementName.SSI_PRINTENV;
- public static final String SSI_SET = HTML40Namespace.ElementName.SSI_SET;
- }
-
- // Character Entities
- public static interface EntityName {
- }
-
- // global attribute names
- public static final String ATTR_NAME_VERSION = HTML40Namespace.ATTR_NAME_VERSION;
- public static final String ATTR_NAME_SRC = HTML40Namespace.ATTR_NAME_SRC;
- public static final String ATTR_NAME_ALT = HTML40Namespace.ATTR_NAME_ALT;
- public static final String ATTR_NAME_HEIGHT = HTML40Namespace.ATTR_NAME_HEIGHT;
- public static final String ATTR_NAME_WIDTH = HTML40Namespace.ATTR_NAME_WIDTH;
- public static final String ATTR_NAME_ALIGN = HTML40Namespace.ATTR_NAME_ALIGN;
- public static final String ATTR_NAME_BORDER = HTML40Namespace.ATTR_NAME_BORDER;
- public static final String ATTR_NAME_HSPACE = HTML40Namespace.ATTR_NAME_HSPACE;
- public static final String ATTR_NAME_VSPACE = HTML40Namespace.ATTR_NAME_VSPACE;
- public static final String ATTR_NAME_NAME = HTML40Namespace.ATTR_NAME_NAME;
- public static final String ATTR_NAME_CLEAR = HTML40Namespace.ATTR_NAME_CLEAR;
- public static final String ATTR_NAME_NOSHADE = HTML40Namespace.ATTR_NAME_NOSHADE;
- public static final String ATTR_NAME_CHECKED = HTML40Namespace.ATTR_NAME_CHECKED;
- public static final String ATTR_NAME_MAXLENGTH = HTML40Namespace.ATTR_NAME_MAXLENGTH;
- public static final String ATTR_NAME_ISTYLE = HTML40Namespace.ATTR_NAME_ISTYLE;
- public static final String ATTR_NAME_HTTP_EQUIV = HTML40Namespace.ATTR_NAME_HTTP_EQUIV;
- public static final String ATTR_NAME_CONTENT = HTML40Namespace.ATTR_NAME_CONTENT;
-
- public static final String ATTR_NAME_HREF = HTML40Namespace.ATTR_NAME_HREF;
- public static final String ATTR_NAME_MULTIPLE = HTML40Namespace.ATTR_NAME_MULTIPLE;
- public static final String ATTR_NAME_SELECTED = HTML40Namespace.ATTR_NAME_SELECTED;
- public static final String ATTR_NAME_ROWS = HTML40Namespace.ATTR_NAME_ROWS;
- public static final String ATTR_NAME_COLS = HTML40Namespace.ATTR_NAME_COLS;
- public static final String ATTR_NAME_ACTION = HTML40Namespace.ATTR_NAME_ACTION;
- public static final String ATTR_NAME_METHOD = HTML40Namespace.ATTR_NAME_METHOD;
- public static final String ATTR_NAME_ENCTYPE = HTML40Namespace.ATTR_NAME_ENCTYPE;
- public static final String ATTR_NAME_SIZE = HTML40Namespace.ATTR_NAME_SIZE;
- public static final String ATTR_NAME_TYPE = HTML40Namespace.ATTR_NAME_TYPE;
- public static final String ATTR_NAME_VALUE = HTML40Namespace.ATTR_NAME_VALUE;
-
-
-
- public static final String ATTR_NAME_ERRMSG = HTML40Namespace.ATTR_NAME_ERRMSG;
- public static final String ATTR_NAME_SIZEFMT = HTML40Namespace.ATTR_NAME_SIZEFMT;
- public static final String ATTR_NAME_TIMEFMT = HTML40Namespace.ATTR_NAME_TIMEFMT;
- public static final String ATTR_NAME_VAR = HTML40Namespace.ATTR_NAME_VAR;
- public static final String ATTR_NAME_CGI = HTML40Namespace.ATTR_NAME_CGI;
- public static final String ATTR_NAME_CMD = HTML40Namespace.ATTR_NAME_CMD;
- public static final String ATTR_NAME_FILE = HTML40Namespace.ATTR_NAME_FILE;
- public static final String ATTR_NAME_VIRTUAL = HTML40Namespace.ATTR_NAME_VIRTUAL;
-
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD Compact HTML 1.0 Draft//EN"; //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = HTML40Namespace.ATTR_VALUE_TOP;
- public static final String ATTR_VALUE_MIDDLE = HTML40Namespace.ATTR_VALUE_MIDDLE;
- public static final String ATTR_VALUE_BOTTOM = HTML40Namespace.ATTR_VALUE_BOTTOM;
- public static final String ATTR_VALUE_LEFT = HTML40Namespace.ATTR_VALUE_LEFT;
- public static final String ATTR_VALUE_CENTER = HTML40Namespace.ATTR_VALUE_CENTER;
- public static final String ATTR_VALUE_RIGHT = HTML40Namespace.ATTR_VALUE_RIGHT;
- // for clear (left|all|right|none): left and right are already defined above.
- public static final String ATTR_VALUE_ALL = HTML40Namespace.ATTR_VALUE_ALL;
- public static final String ATTR_VALUE_NONE = HTML40Namespace.ATTR_VALUE_NONE;
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = HTML40Namespace.ATTR_VALUE_TEXT;
- public static final String ATTR_VALUE_PASSWORD = HTML40Namespace.ATTR_VALUE_PASSWORD;
- public static final String ATTR_VALUE_CHECKBOX = HTML40Namespace.ATTR_VALUE_CHECKBOX;
- public static final String ATTR_VALUE_RADIO = HTML40Namespace.ATTR_VALUE_RADIO;
- public static final String ATTR_VALUE_SUBMIT = HTML40Namespace.ATTR_VALUE_SUBMIT;
- public static final String ATTR_VALUE_RESET = HTML40Namespace.ATTR_VALUE_RESET;
- public static final String ATTR_VALUE_HIDDEN = HTML40Namespace.ATTR_VALUE_HIDDEN;
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = HTML40Namespace.ATTR_VALUE_1;
- // for frameborder
- public static final String ATTR_VALUE_0 = HTML40Namespace.ATTR_VALUE_0;
- // for method of FORM
- public static final String ATTR_VALUE_GET = HTML40Namespace.ATTR_VALUE_GET;
- public static final String ATTR_VALUE_POST = HTML40Namespace.ATTR_VALUE_POST;
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = HTML40Namespace.ATTR_VALUE_WWW_FORM_URLENCODED;
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = HTML40Namespace.ATTR_VALUE_SCROLL;
- public static final String ATTR_VALUE_SLIDE = HTML40Namespace.ATTR_VALUE_SLIDE;
- public static final String ATTR_VALUE_ALTERNATE = HTML40Namespace.ATTR_VALUE_ALTERNATE;
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = HTML40Namespace.ATTR_VALUE_UP;
- public static final String ATTR_VALUE_DOWN = HTML40Namespace.ATTR_VALUE_DOWN;
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java
deleted file mode 100644
index 5633cf535a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMContent {
-
- public static final int UNBOUNDED = -1;
- /** -1: it's UNBOUNDED. */
- private int maxOccur = UNBOUNDED;
- /** 0: it's OPTIONAL, 1, it's REQUIRED. */
- private int minOccur = 0;
-
- /**
- * The primary consturctor.
- * Use this one for usual cases.<br>
- */
- public CMContentImpl(String name, int min, int max) {
- super(name);
- minOccur = min;
- maxOccur = max;
- }
-
- /**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return maxOccur;
- }
-
- /**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return minOccur;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java
deleted file mode 100644
index 2c546f5d6b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
- private int operator = CMGroup.SEQUENCE;
- private CMNodeListImpl children = null;
-
- /**
- * CMGroupImpl constructor comment.
- */
- public CMGroupImpl(int op, int minOccur, int maxOccur) {
- super(null, minOccur, maxOccur);
- switch (op) {
- case CMGroup.ALL :
- case CMGroup.CHOICE :
- case CMGroup.SEQUENCE :
- operator = op;
- break;
- default :
- // should warn.
- break;
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendChild(CMNode child) {
- if (child == null)
- return null;
- if (children == null)
- children = new CMNodeListImpl();
- return children.appendNode(child);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
- */
- public CMNodeList getChildNodes() {
- return children;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.GROUP;
- }
-
- /**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
- public int getOperator() {
- return operator;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
deleted file mode 100644
index d1bae1ef76..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * An implementation of the CMNamedNodeMap interface. This class is intented
- * to be used as a container of attribute declarations. If someone wants to
- * use this class for other purpose, he must pay attention to the fact that
- * this class is tolerant of the key name case. That is, this class does not
- * distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap {
-
- private java.util.Hashtable items = null;
-
- /**
- */
- public CMNamedNodeMapImpl() {
- super();
- items = new java.util.Hashtable();
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return items.size();
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode <code>null</code> for unknown keys.
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- String cookedName = makeCanonicalForm(name);
- if (!items.containsKey(cookedName))
- return null;
- return (CMNode) items.get(cookedName);
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- CMNode node = (CMNode) iter.next();
- if (--index < 0)
- return node;
- }
- return null;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator iterator() {
- return items.values().iterator();
- }
-
- /**
- * @return java.lang.String
- * @param rawForm
- * java.lang.String
- */
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
-
- /**
- * @param key
- * java.lang.String
- * @param item
- * java.lang.String
- */
- void putNamedItem(String name, CMNode item) {
- String cookedName = makeCanonicalForm(name);
- if (items.containsKey(cookedName))
- return; // already registered.
- items.put(cookedName, item);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java
deleted file mode 100644
index 62f7a01d45..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- private java.lang.String name = null;
-
- /**
- * CMNodeImpl constructor comment.
- */
- public CMNodeImpl(String nm) {
- super();
- name = nm;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return name;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return new Boolean(false);
- return null;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java
deleted file mode 100644
index c1b1cdac40..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Analog of dom.NodeList for CM.
- */
-class CMNodeListImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList {
-
- private java.util.Vector nodes = null;
-
- /**
- * CMNodeListImpl constructor comment.
- */
- public CMNodeListImpl() {
- super();
- nodes = new java.util.Vector();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendNode(CMNode node) {
- nodes.addElement(node);
- return node;
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return nodes.size();
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- if (index < 0 || index >= nodes.size())
- return null;
- return (CMNode) nodes.elementAt(index);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
deleted file mode 100644
index fd47c7e63d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
- protected CMGroupImpl content = null;
- protected ElementCollection collection = null;
- protected String primaryCandidateName = null;
-
- /**
- * ComplexTypeDefinition constructor comment.
- */
- public ComplexTypeDefinition(ElementCollection elementCollection) {
- super();
- collection = elementCollection;
- createContent();
- }
-
- /**
- * Create an actual content model.
- * This method should be called once and only once in the constructor.<br>
- */
- protected abstract void createContent();
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
- */
- public CMGroup getContent() {
- return content;
- }
-
- /**
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- /* NOTE: Do we need LOGICAL type?
- * -- 3/7/2001
- */
- public abstract int getContentType();
-
- /**
- * Get content hint.
- */
- public HTMLElementDeclaration getPrimaryCandidate() {
- if (primaryCandidateName == null)
- return null;
- return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public abstract String getTypeName();
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
deleted file mode 100644
index 2a682f9706..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
- private static ComplexTypeDefinitionFactory instance = null;
- private java.util.Hashtable definitions = null;
- // constants for complex type name
- /** for ADDRESS. */
- public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
- /** CDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
- /** col group content. COL* */
- public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
- /** for DL. */
- public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
- /** for EMBED. */
- public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
- /** empty content. No ComplexTypeDefinition instance should be created. */
- public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
- /** for FIELDSET. */
- public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
- /** for FRAMESET. */
- public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
- /** flow content. (%flow;)* */
- public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
- /** html content. HEAD, (FRAMESET|BODY) */
- public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
- /** head content. TITLE & ISINDEX? & BASE? */
- public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
- /** inline content. (%inline;)* */
- public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
- /** list item container. (LI)+ */
- public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
- /** for MAP. */
- public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
- /** noframes content. */
- public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
- /** for OPTGROUP. */
- public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
- /** param container. For OBJECT/APPLET. */
- public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
- /** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
- /** for SELECT. */
- public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
- /** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
- public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
- /** table cell contaier. (TH|TD)+ */
- public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
- /** table record container. (TR)+ */
- public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
-
- /**
- * ComplexTypeDefinitionFactory constructor comment.
- */
- private ComplexTypeDefinitionFactory() {
- super();
- definitions = new java.util.Hashtable();
- }
-
- /**
- * Factory method for ComplexTypeDefinition.
- * Each instance created in this method must be registered into
- * the map with its name.
- * @param definitionName java.lang.String
- * @param elementCollection ElementCollection
- */
- public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
- if (definitions.containsKey(definitionName)) {
- return (ComplexTypeDefinition) definitions.get(definitionName);
- }
-
- ComplexTypeDefinition def = null;
- if (definitionName == CTYPE_ADDRESS) {
- def = new CtdAddress(elementCollection);
-
- }
- else if (definitionName == CTYPE_DEFINITION_LIST) {
- def = new CtdDl(elementCollection);
-
- }
- else if (definitionName == CTYPE_FLOW_CONTAINER) {
- def = new CtdFlowContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_HEAD) {
- def = new CtdHead(elementCollection);
-
- }
- else if (definitionName == CTYPE_HTML) {
- def = new CtdHtml(elementCollection);
-
- }
- else if (definitionName == CTYPE_INLINE_CONTAINER) {
- def = new CtdInlineContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_LI_CONTAINER) {
- def = new CtdLiContainer(elementCollection);
-
-
- }
- else if (definitionName == CTYPE_OPTION_CONTAINER) {
- def = new CtdOptionContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_SELECT) {
- def = new CtdSelect(elementCollection);
-
- }
- else {
- def = null;
- }
- if (def == null)
- return null; // fail to create.
- definitions.put(definitionName, def);
- return def;
- }
-
- /**
- * For singleton.<br>
- */
- public synchronized static ComplexTypeDefinitionFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new ComplexTypeDefinitionFactory();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java
deleted file mode 100644
index 4ad13c025b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdAddress(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * ((%inline) | P)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // (%inline)
- CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (inlines == null)
- return;
- collection.getInline(inlines);
- content.appendChild(inlines);
- // P
- CMNode p = collection.getNamedItem(CHTMLNamespace.ElementName.P);
- if (p != null)
- content.appendChild(p);
- }
-
- /**
- * ((%inline) | P)*.
- * Because %inline; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
deleted file mode 100644
index c0abf8afb4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdDl(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.DT;
- }
-
- /**
- * (DT | DD)+
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // DT
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.DT);
- if (dec != null)
- content.appendChild(dec);
- // DD
- dec = collection.getNamedItem(CHTMLNamespace.ElementName.DD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (DT | DD)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java
deleted file mode 100644
index a198d74ec4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
- /**
- */
- public CtdFlowContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%flow;)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getFlow(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java
deleted file mode 100644
index 9af78c671d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHead(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.TITLE;
- }
-
- /**
- * for HEAD.
- * To avoid using inclusion, the content model comes from the XHTML 1.0.
- *
- * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
- * And %head.misc; is:
- * (script|style|meta|link|object|isindex)*
- *
- * 0: (%head.misc, A)
- * A: (B | C)
- * B: (title, %head.misc;, D)
- * C: (base, %head.misc;, E)
- * D: (base, %head.misc;)?
- * E: (title, %head.misc;)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // At 1st, create %head.misc; content.
- // %head.misc;
- // ( | )*
- CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (misc == null)
- return;
- String[] names = {CHTMLNamespace.ElementName.META,};
- collection.getDeclarations(misc, Arrays.asList(names).iterator());
- // 2nd, get a title
- CMNode title = collection.getNamedItem(CHTMLNamespace.ElementName.TITLE);
- // 3rd, get a base
- CMNode base = collection.getNamedItem(CHTMLNamespace.ElementName.BASE);
- if (title == null || base == null)
- return;
-
- // Top level content is a sequence of %head.misc; and A.
- // 0: (%head.misc;, A)
- // create a sequence
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
- // append %head.misc;
- content.appendChild(misc);
- // create A and append it to the top level.
- {
- // A is a choice of B and C.
- // A: (B | C)
- // create a choice
- CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (gA == null)
- return;
- // append A to the top level.
- content.appendChild(gA);
-
- // create B and append it to A
- {
- // B is a sequence of title, %head.misc;, and D.
- // B: (title, %head.misc;, D)
- // create a sequence
- CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gB == null)
- return;
- // append B to A.
- gA.appendChild(gB);
-
- // append title to B
- gB.appendChild(title);
- // append %head.misc; to B
- gB.appendChild(misc);
- // create D and append it to B.
- {
- // D is a sequence of base, %head.misc;.
- // D: (base, %head.misc;)?
- // create a sequence
- CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (gD == null)
- return;
- // append D to B.
- gB.appendChild(gD);
-
- // append base to D
- gD.appendChild(base);
- // append %head.misc; to D.
- gD.appendChild(misc);
- }
- }
- // create C and append it to A
- {
- // C is a sequence of base, %head.misc;, and E
- // C: (base, %head.misc;, E)
- // create a sequence
- CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gC == null)
- return;
- // append C to A.
- gA.appendChild(gC);
-
- // append base to C
- gC.appendChild(base);
- // append %head.misc; to C
- gC.appendChild(misc);
-
- // create E and append it to C.
- {
- // E is a sequence of title and %head.misc;.
- // E: (title, %head.misc;)
- // create a sequence
- CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gE == null)
- return;
- // append E to C.
- gC.appendChild(gE);
-
- // append title to E
- gE.appendChild(title);
- // append %head.misc; to E.
- gE.appendChild(misc);
- }
- }
- }
- }
-
- /**
- * Element content.<br>
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HEAD;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
deleted file mode 100644
index cf4fe4ae30..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHtml(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.HEAD;
- }
-
- /**
- * (%html.content;).
- * %html.content; is HEAD, (FRAMESET | BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
-
- // HEAD
- CMNode edec = collection.getNamedItem(CHTMLNamespace.ElementName.HEAD);
- if (edec != null)
- content.appendChild(edec);
-
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- content.appendChild(group);
-
- // FRAMESET, BODY
- String[] names = {CHTMLNamespace.ElementName.BODY};
- collection.getDeclarations(group, Arrays.asList(names).iterator());
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HTML;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java
deleted file mode 100644
index ed234aadae..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdInlineContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%inline)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getInline(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
deleted file mode 100644
index b28956ef73..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
- /**
- * @param elemenCollection ElementCollection
- */
- public CtdLiContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.LI;
- }
-
- /**
- * (LI)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (LI)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode li = collection.getNamedItem(CHTMLNamespace.ElementName.LI);
- if (li != null)
- content.appendChild(li);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
deleted file mode 100644
index c2ec6c535f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdOptionContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
- }
-
- /**
- * (OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTION)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java
deleted file mode 100644
index 7f0c96c0c8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdSelect(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_SELECT;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
deleted file mode 100644
index af90b74336..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
- protected class DualMap {
- public DualMap() {
- super();
- }
-
- public DualMap(Object[] objects) {
- super();
- initialize(objects);
- }
-
- public int size() {
- return table.length;
- }
-
- public Object getValue(int key) {
- if (!isValidIndex(key))
- return null;
- return table[key];
- }
-
- public int getKey(Object value) {
- Integer keyObj = (Integer) map.get(value);
- if (keyObj == null)
- return ID_UNKNOWN;
- return keyObj.intValue();
- }
-
- protected void initialize(Object[] objects) {
- if (objects == null)
- return;
- table = objects;
- map = new HashMap();
- for (int key = 0; key < objects.length; key++) {
- Object value = table[key];
- map.put(value, new Integer(key));
- }
- }
-
- private Object[] table = null;
- private HashMap map = null;
-
- private boolean isValidIndex(int index) {
- return index >= 0 && index < table.length;
- }
- }
-
- protected class TolerantStringDualMap extends DualMap {
- public TolerantStringDualMap(String[] names) {
- super();
- Object[] objects = new Object[names.length];
- for (int i = 0; i < names.length; i++) {
- objects[i] = makeCanonicalForm(names[i]);
- }
- initialize(objects);
- }
-
- public int getKey(Object value) {
- try {
- String name = (String) value;
- return super.getKey(makeCanonicalForm(name));
- }
- catch (ClassCastException e) {
- return ID_UNKNOWN;
- }
- }
-
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
- }
-
- private class DeclIterator implements Iterator {
- public DeclIterator() {
- maxid = fDecls.length - 1;
- }
-
- public boolean hasNext() {
- return id < maxid;
- }
-
- public Object next() {
- if (!hasNext())
- return null;
- return item(++id);
- }
-
- public void remove() { /* nothing should be done. */
- }
-
- private int id = -1;
- private int maxid = -1;
- }
-
- CMNode[] fDecls = null;
- protected final static boolean STRICT_CASE = false;
- protected final static boolean TOLERANT_CASE = true;
- protected final static int ID_UNKNOWN = -1;
- private DualMap fMap = null;
-
- /**
- */
- public DeclCollection(String[] names, boolean tolerant) {
- super();
- fDecls = new CMNode[names.length];
- if (tolerant) {
- fMap = new TolerantStringDualMap(names);
- }
- else {
- fMap = new DualMap(names);
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param id
- * int
- */
- protected abstract CMNode create(String name);
-
- /**
- */
- public CMNamedNodeMap getDeclarations(String[] names) {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMNode node = getNamedItem(name);
- if (node == null)
- continue;
- map.putNamedItem(name, node);
- }
- return map;
- }
-
- public void getDeclarations(CMGroupImpl group, Iterator names) {
- while (names.hasNext()) {
- String entityName = (String) names.next();
- CMNode dec = getNamedItem(entityName);
- if (dec != null)
- group.appendChild(dec);
- }
- }
-
- /**
- * Map name to id.
- *
- * @return int
- * @param name
- * java.lang.String
- */
- protected int getID(String name) {
- return fMap.getKey(name);
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return fDecls.length;
- }
-
- /**
- * @return java.lang.String
- * @param id
- * int
- */
- protected String getName(int id) {
- return (String) fMap.getValue(id);
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- int id = getID(name);
- if (!isValidID(id))
- return null;
- return item(id);
- }
-
- /**
- * @return boolean
- * @param id
- * int
- */
- private boolean isValidID(int id) {
- return id >= 0 && id < fDecls.length;
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- if (!isValidID(index))
- return null;
- CMNode decl = fDecls[index];
- if (decl != null)
- return decl; // already exist.
-
- decl = create(getName(index));
- fDecls[index] = decl;
- return decl;
- }
-
- /**
- */
- public Iterator iterator() {
- return new DeclIterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
deleted file mode 100644
index 8a80135eb5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
- // Element IDs
- private static class Ids {
- public static final int ID_A = 0;
- public static final int ID_ADDRESS = 1;
- public static final int ID_BASE = 2;
- public static final int ID_BLOCKQUOTE = 3;
- public static final int ID_BODY = 4;
- public static final int ID_BR = 5;
- public static final int ID_CENTER = 6;
- public static final int ID_DD = 7;
- public static final int ID_DIR = 8;
- public static final int ID_DIV = 9;
- public static final int ID_DL = 10;
- public static final int ID_DT = 11;
- public static final int ID_FORM = 12;
- public static final int ID_H1 = 13;
- public static final int ID_H2 = 14;
- public static final int ID_H3 = 15;
- public static final int ID_H4 = 16;
- public static final int ID_H5 = 17;
- public static final int ID_H6 = 18;
- public static final int ID_HEAD = 19;
- public static final int ID_HR = 20;
- public static final int ID_HTML = 21;
- public static final int ID_IMG = 22;
- public static final int ID_INPUT = 23;
- public static final int ID_LI = 24;
- public static final int ID_MENU = 25;
- public static final int ID_META = 26;
- public static final int ID_OL = 27;
- public static final int ID_OPTION = 28;
- public static final int ID_P = 29;
- public static final int ID_PRE = 30;
- public static final int ID_SELECT = 31;
- public static final int ID_TEXTAREA = 32;
- public static final int ID_TITLE = 33;
- public static final int ID_UL = 34;
- public static final int ID_SSI_CONFIG = 35;
- public static final int ID_SSI_ECHO = 36;
- public static final int ID_SSI_EXEC = 37;
- public static final int ID_SSI_FSIZE = 38;
- public static final int ID_SSI_FLASTMOD = 39;
- public static final int ID_SSI_INCLUDE = 40;
- public static final int ID_SSI_PRINTENV = 41;
- public static final int ID_SSI_SET = 42;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- /** %formctl;. INPUT | SELECT | TEXTAREA */
- private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA};
- /** %phrase;.
- * DFN
- */
- private static final String[] PHRASE = {DFN};
- /** %special;.
- * A | IMG | BR
- */
- private static final String[] SPECIAL = {A, IMG, BR};
- /** %heading;. H[1-6] */
- private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
- /** %list;. UL | OL | DIR | MENU */
- private static final String[] LIST = {UL, OL, DIR, MENU};
- /** %preformatted;. PRE */
- private static final String[] PREFORMATTED = {PRE};
- private AttributeCollection attributeCollection = null;
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_A] = A;
- names[Ids.ID_ADDRESS] = ADDRESS;
- names[Ids.ID_BASE] = BASE;
- names[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
- names[Ids.ID_BODY] = BODY;
- names[Ids.ID_BR] = BR;
- names[Ids.ID_CENTER] = CENTER;
- names[Ids.ID_DD] = DD;
- names[Ids.ID_DIR] = DIR;
- names[Ids.ID_DIV] = DIV;
- names[Ids.ID_DL] = DL;
- names[Ids.ID_DT] = DT;
- names[Ids.ID_FORM] = FORM;
- names[Ids.ID_H1] = H1;
- names[Ids.ID_H2] = H2;
- names[Ids.ID_H3] = H3;
- names[Ids.ID_H4] = H4;
- names[Ids.ID_H5] = H5;
- names[Ids.ID_H6] = H6;
- names[Ids.ID_HEAD] = HEAD;
- names[Ids.ID_HR] = HR;
- names[Ids.ID_HTML] = HTML;
- names[Ids.ID_IMG] = IMG;
- names[Ids.ID_INPUT] = INPUT;
- names[Ids.ID_LI] = LI;
- names[Ids.ID_MENU] = MENU;
- names[Ids.ID_META] = META;
- names[Ids.ID_OL] = OL;
- names[Ids.ID_OPTION] = OPTION;
- names[Ids.ID_P] = P;
- names[Ids.ID_PRE] = PRE;
- names[Ids.ID_SELECT] = SELECT;
- names[Ids.ID_TEXTAREA] = TEXTAREA;
- names[Ids.ID_TITLE] = TITLE;
- names[Ids.ID_UL] = UL;
- names[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
- names[Ids.ID_SSI_ECHO] = SSI_ECHO;
- names[Ids.ID_SSI_EXEC] = SSI_EXEC;
- names[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
- names[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
- names[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
- names[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
- names[Ids.ID_SSI_SET] = SSI_SET;
- }
-
- /**
- */
- public ElementCollection(AttributeCollection collection) {
- super(names, TOLERANT_CASE);
- attributeCollection = collection;
- }
-
- /**
- * Actually creates HTMLElementDeclaration instance.
- * @return HTMLElementDeclaration
- */
- protected CMNode create(String elementName) {
- HTMLElemDeclImpl edec = null;
-
- if (elementName.equalsIgnoreCase(A)) {
- edec = new HedA(this);
-
- }
- else if (elementName.equalsIgnoreCase(ADDRESS)) {
- edec = new HedADDRESS(this);
-
- }
- else if (elementName.equalsIgnoreCase(BASE)) {
- edec = new HedBASE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
- edec = new HedBLOCKQUOTE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BODY)) {
- edec = new HedBODY(this);
-
- }
- else if (elementName.equalsIgnoreCase(BR)) {
- edec = new HedBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(CENTER)) {
- edec = new HedCENTER(this);
-
- }
- else if (elementName.equalsIgnoreCase(DD)) {
- edec = new HedDD(this);
-
- }
- else if (elementName.equalsIgnoreCase(DIR)) {
- edec = new HedMENU(DIR, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIV)) {
- edec = new HedDIV(this);
-
- }
- else if (elementName.equalsIgnoreCase(DL)) {
- edec = new HedDL(this);
-
- }
- else if (elementName.equalsIgnoreCase(DT)) {
- edec = new HedDT(this);
-
- }
- else if (elementName.equalsIgnoreCase(FORM)) {
- edec = new HedFORM(this);
-
- }
- else if (elementName.equalsIgnoreCase(H1)) {
- edec = new HedHeading(H1, this);
-
- }
- else if (elementName.equalsIgnoreCase(H2)) {
- edec = new HedHeading(H2, this);
-
- }
- else if (elementName.equalsIgnoreCase(H3)) {
- edec = new HedHeading(H3, this);
-
- }
- else if (elementName.equalsIgnoreCase(H4)) {
- edec = new HedHeading(H4, this);
-
- }
- else if (elementName.equalsIgnoreCase(H5)) {
- edec = new HedHeading(H5, this);
-
- }
- else if (elementName.equalsIgnoreCase(H6)) {
- edec = new HedHeading(H6, this);
-
- }
- else if (elementName.equalsIgnoreCase(HEAD)) {
- edec = new HedHEAD(this);
-
- }
- else if (elementName.equalsIgnoreCase(HR)) {
- edec = new HedHR(this);
-
- }
- else if (elementName.equalsIgnoreCase(HTML)) {
- edec = new HedHTML(this);
-
- }
- else if (elementName.equalsIgnoreCase(IMG)) {
- edec = new HedIMG(this);
-
- }
- else if (elementName.equalsIgnoreCase(INPUT)) {
- edec = new HedINPUT(this);
-
- }
- else if (elementName.equalsIgnoreCase(LI)) {
- edec = new HedLI(this);
-
- }
- else if (elementName.equalsIgnoreCase(MENU)) {
- edec = new HedMENU(MENU, this);
-
- }
- else if (elementName.equalsIgnoreCase(META)) {
- edec = new HedMETA(this);
-
- }
- else if (elementName.equalsIgnoreCase(OL)) {
- edec = new HedOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTION)) {
- edec = new HedOPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(P)) {
- edec = new HedP(this);
-
- }
- else if (elementName.equalsIgnoreCase(PRE)) {
- edec = new HedPRE(this);
-
- }
- else if (elementName.equalsIgnoreCase(SELECT)) {
- edec = new HedSELECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(TEXTAREA)) {
- edec = new HedTEXTAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(TITLE)) {
- edec = new HedTITLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(UL)) {
- edec = new HedUL(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
- edec = new HedSSIConfig(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
- edec = new HedSSIEcho(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
- edec = new HedSSIExec(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
- edec = new HedSSIFsize(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
- edec = new HedSSIFlastmod(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
- edec = new HedSSIInclude(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
- edec = new HedSSIPrintenv(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_SET)) {
- edec = new HedSSISet(this);
-
- } // unknown
- else {
- // NOTE: We don't define the UNKNOWN element declaration.
- // <code>null</code> for a declaration is a sign of
- // the target element is unknown.
- // -- 3/9/2001
- edec = null;
- }
- return edec;
- }
-
- public AttributeCollection getAttributeCollection() {
- return attributeCollection;
- }
-
- /**
- */
- public final Collection getNamesOfBlock() {
- // P | %list | %preformatted | DL | DIV | CENTER | BLOCKQUOTE | FORM | HR
- String[] blockMisc = {P, DL, DIV, CENTER, BLOCKQUOTE, FORM, HR,};
- Vector blockNames = new Vector(Arrays.asList(blockMisc));
- // %heading;
- blockNames.addAll(Arrays.asList(HEADING));
- // %list;
- blockNames.addAll(Arrays.asList(LIST));
- // %preformatted;
- blockNames.addAll(Arrays.asList(PREFORMATTED));
-
- return blockNames;
- }
-
- /**
- * %block;.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getBlock(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, getNamesOfBlock().iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getFlow(CMGroupImpl group) {
- if (group == null)
- return;
- getBlock(group);
- getInline(group);
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFontstyle(CMGroupImpl group) {
- return;
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFormctrl(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FORMCTL).iterator());
- }
-
- /**
- * %heading;.
- * @param group CMGroupImpl Return values.
- */
- public final void getHeading(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(HEADING).iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getInline(CMGroupImpl group) {
- if (group == null)
- return;
- getFontstyle(group);
- getPhrase(group);
- getSpecial(group);
- getFormctrl(group);
- }
-
- /**
- * %list;.
- * @param group CMGroupImpl Return values.
- */
- public final void getList(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(LIST).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getPhrase(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(PHRASE).iterator());
- }
-
- /**
- * %preformatted;
- * @param group CMGroupImpl Return values.
- */
- public final void getPreformatted(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getSpecial(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SPECIAL).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
deleted file mode 100644
index 4f371fc77d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
+++ /dev/null
@@ -1,837 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
- private static class Ids {
- public static final int ID_AACUTE_L = 0;
- public static final int ID_AACUTE_U = 1;
- public static final int ID_ACIRC_L = 2;
- public static final int ID_ACIRC_U = 3;
- public static final int ID_ACUTE = 4;
- public static final int ID_AELIG_L = 5;
- public static final int ID_AELIG_U = 6;
- public static final int ID_AGRAVE_L = 7;
- public static final int ID_AGRAVE_U = 8;
- public static final int ID_ALEFSYM = 9;
- public static final int ID_ALPHA_L = 10;
- public static final int ID_ALPHA_U = 11;
- public static final int ID_AMP = 12;
- public static final int ID_AND = 13;
- public static final int ID_ANG = 14;
- public static final int ID_ARING_L = 15;
- public static final int ID_ARING_U = 16;
- public static final int ID_ASYMP = 17;
- public static final int ID_ATILDE_L = 18;
- public static final int ID_ATILDE_U = 19;
- public static final int ID_AUML_L = 20;
- public static final int ID_AUML_U = 21;
- public static final int ID_BDQUO = 22;
- public static final int ID_BETA_L = 23;
- public static final int ID_BETA_U = 24;
- public static final int ID_BRVBAR = 25;
- public static final int ID_BULL = 26;
- public static final int ID_CAP = 27;
- public static final int ID_CCEDIL_L = 28;
- public static final int ID_CCEDIL_U = 29;
- public static final int ID_CEDIL = 30;
- public static final int ID_CENT = 31;
- public static final int ID_CHI_L = 32;
- public static final int ID_CHI_U = 33;
- public static final int ID_CIRC = 34;
- public static final int ID_CLUBS = 35;
- public static final int ID_CONG = 36;
- public static final int ID_COPY = 37;
- public static final int ID_CRARR = 38;
- public static final int ID_CUP = 39;
- public static final int ID_CURREN = 40;
- public static final int ID_DAGGER_L = 41;
- public static final int ID_DAGGER_U = 42;
- public static final int ID_DARR_L = 43;
- public static final int ID_DARR_U = 44;
- public static final int ID_DEG = 45;
- public static final int ID_DELTA_L = 46;
- public static final int ID_DELTA_U = 47;
- public static final int ID_DIAMS = 48;
- public static final int ID_DIVIDE = 49;
- public static final int ID_EACUTE_L = 50;
- public static final int ID_EACUTE_U = 51;
- public static final int ID_ECIRC_L = 52;
- public static final int ID_ECIRC_U = 53;
- public static final int ID_EGRAVE_L = 54;
- public static final int ID_EGRAVE_U = 55;
- public static final int ID_EMPTY = 56;
- public static final int ID_EMSP = 57;
- public static final int ID_ENSP = 58;
- public static final int ID_EPSILON_L = 59;
- public static final int ID_EPSILON_U = 60;
- public static final int ID_EQUIV = 61;
- public static final int ID_ETA_L = 62;
- public static final int ID_ETA_U = 63;
- public static final int ID_ETH_L = 64;
- public static final int ID_ETH_U = 65;
- public static final int ID_EUML_L = 66;
- public static final int ID_EUML_U = 67;
- public static final int ID_EURO = 68;
- public static final int ID_EXIST = 69;
- public static final int ID_FNOF = 70;
- public static final int ID_FORALL = 71;
- public static final int ID_FRAC12 = 72;
- public static final int ID_FRAC14 = 73;
- public static final int ID_FRAC34 = 74;
- public static final int ID_FRASL = 75;
- public static final int ID_GAMMA_L = 76;
- public static final int ID_GAMMA_U = 77;
- public static final int ID_GE = 78;
- public static final int ID_GT = 79;
- public static final int ID_HARR_L = 80;
- public static final int ID_HARR_U = 81;
- public static final int ID_HEARTS = 82;
- public static final int ID_HELLIP = 83;
- public static final int ID_IACUTE_L = 84;
- public static final int ID_IACUTE_U = 85;
- public static final int ID_ICIRC_L = 86;
- public static final int ID_ICIRC_U = 87;
- public static final int ID_IEXCL = 88;
- public static final int ID_IGRAVE_L = 89;
- public static final int ID_IGRAVE_U = 90;
- public static final int ID_IMAGE = 91;
- public static final int ID_INFIN = 92;
- public static final int ID_INT = 93;
- public static final int ID_IOTA_L = 94;
- public static final int ID_IOTA_U = 95;
- public static final int ID_IQUEST = 96;
- public static final int ID_ISIN = 97;
- public static final int ID_IUML_L = 98;
- public static final int ID_IUML_U = 99;
- public static final int ID_KAPPA_L = 100;
- public static final int ID_KAPPA_U = 101;
- public static final int ID_LAMBDA_L = 102;
- public static final int ID_LAMBDA_U = 103;
- public static final int ID_LANG = 104;
- public static final int ID_LAQUO = 105;
- public static final int ID_LARR_L = 106;
- public static final int ID_LARR_U = 107;
- public static final int ID_LCEIL = 108;
- public static final int ID_LDQUO = 109;
- public static final int ID_LE = 110;
- public static final int ID_LFLOOR = 111;
- public static final int ID_LOWAST = 112;
- public static final int ID_LOZ = 113;
- public static final int ID_LRM = 114;
- public static final int ID_LSAQUO = 115;
- public static final int ID_LSQUO = 116;
- public static final int ID_LT = 117;
- public static final int ID_MACR = 118;
- public static final int ID_MDASH = 119;
- public static final int ID_MICRO = 120;
- public static final int ID_MIDDOT = 121;
- public static final int ID_MINUS = 122;
- public static final int ID_MU_L = 123;
- public static final int ID_MU_U = 124;
- public static final int ID_NABLA = 125;
- public static final int ID_NBSP = 126;
- public static final int ID_NDASH = 127;
- public static final int ID_NE = 128;
- public static final int ID_NI = 129;
- public static final int ID_NOT = 130;
- public static final int ID_NOTIN = 131;
- public static final int ID_NSUB = 132;
- public static final int ID_NTILDE_L = 133;
- public static final int ID_NTILDE_U = 134;
- public static final int ID_NU_L = 135;
- public static final int ID_NU_U = 136;
- public static final int ID_OACUTE_L = 137;
- public static final int ID_OACUTE_U = 138;
- public static final int ID_OCIRC_L = 139;
- public static final int ID_OCIRC_U = 140;
- public static final int ID_OELIG_L = 141;
- public static final int ID_OELIG_U = 142;
- public static final int ID_OGRAVE_L = 143;
- public static final int ID_OGRAVE_U = 144;
- public static final int ID_OLINE = 145;
- public static final int ID_OMEGA_L = 146;
- public static final int ID_OMEGA_U = 147;
- public static final int ID_OMICRON_L = 148;
- public static final int ID_OMICRON_U = 149;
- public static final int ID_OPLUS = 150;
- public static final int ID_OR = 151;
- public static final int ID_ORDF = 152;
- public static final int ID_ORDM = 153;
- public static final int ID_OSLASH_L = 154;
- public static final int ID_OSLASH_U = 155;
- public static final int ID_OTILDE_L = 156;
- public static final int ID_OTILDE_U = 157;
- public static final int ID_OTIMES = 158;
- public static final int ID_OUML_L = 159;
- public static final int ID_OUML_U = 160;
- public static final int ID_PARA = 161;
- public static final int ID_PART = 162;
- public static final int ID_PERMIL = 163;
- public static final int ID_PERP = 164;
- public static final int ID_PHI_L = 165;
- public static final int ID_PHI_U = 166;
- public static final int ID_PIV = 167;
- public static final int ID_PI_L = 168;
- public static final int ID_PI_U = 169;
- public static final int ID_PLUSMN = 170;
- public static final int ID_POUND = 171;
- public static final int ID_PRIME_L = 172;
- public static final int ID_PRIME_U = 173;
- public static final int ID_PROD = 174;
- public static final int ID_PROP = 175;
- public static final int ID_PSI_L = 176;
- public static final int ID_PSI_U = 177;
- public static final int ID_QUOT = 178;
- public static final int ID_RADIC = 179;
- public static final int ID_RANG = 180;
- public static final int ID_RAQUO = 181;
- public static final int ID_RARR_L = 182;
- public static final int ID_RARR_U = 183;
- public static final int ID_RCEIL = 184;
- public static final int ID_RDQUO = 185;
- public static final int ID_REAL = 186;
- public static final int ID_REG = 187;
- public static final int ID_RFLOOR = 188;
- public static final int ID_RHO_L = 189;
- public static final int ID_RHO_U = 190;
- public static final int ID_RLM = 191;
- public static final int ID_RSAQUO = 192;
- public static final int ID_RSQUO = 193;
- public static final int ID_SBQUO = 194;
- public static final int ID_SCARON_L = 195;
- public static final int ID_SCARON_U = 196;
- public static final int ID_SDOT = 197;
- public static final int ID_SECT = 198;
- public static final int ID_SHY = 199;
- public static final int ID_SIGMAF = 200;
- public static final int ID_SIGMA_L = 201;
- public static final int ID_SIGMA_U = 202;
- public static final int ID_SIM = 203;
- public static final int ID_SPADES = 204;
- public static final int ID_SUB = 205;
- public static final int ID_SUBE = 206;
- public static final int ID_SUM = 207;
- public static final int ID_SUP = 208;
- public static final int ID_SUP1 = 209;
- public static final int ID_SUP2 = 210;
- public static final int ID_SUP3 = 211;
- public static final int ID_SUPE = 212;
- public static final int ID_SZLIG = 213;
- public static final int ID_TAU_L = 214;
- public static final int ID_TAU_U = 215;
- public static final int ID_THERE4 = 216;
- public static final int ID_THETASYM = 217;
- public static final int ID_THETA_L = 218;
- public static final int ID_THETA_U = 219;
- public static final int ID_THINSP = 220;
- public static final int ID_THORN_L = 221;
- public static final int ID_THORN_U = 222;
- public static final int ID_TILDE = 223;
- public static final int ID_TIMES = 224;
- public static final int ID_TRADE = 225;
- public static final int ID_UACUTE_L = 226;
- public static final int ID_UACUTE_U = 227;
- public static final int ID_UARR_L = 228;
- public static final int ID_UARR_U = 229;
- public static final int ID_UCIRC_L = 230;
- public static final int ID_UCIRC_U = 231;
- public static final int ID_UGRAVE_L = 232;
- public static final int ID_UGRAVE_U = 233;
- public static final int ID_UML = 234;
- public static final int ID_UPSIH = 235;
- public static final int ID_UPSILON_L = 236;
- public static final int ID_UPSILON_U = 237;
- public static final int ID_UUML_L = 238;
- public static final int ID_UUML_U = 239;
- public static final int ID_WEIERP = 240;
- public static final int ID_XI_L = 241;
- public static final int ID_XI_U = 242;
- public static final int ID_YACUTE_L = 243;
- public static final int ID_YACUTE_U = 244;
- public static final int ID_YEN = 245;
- public static final int ID_YUML_L = 246;
- public static final int ID_YUML_U = 247;
- public static final int ID_ZETA_L = 248;
- public static final int ID_ZETA_U = 249;
- public static final int ID_ZWJ = 250;
- public static final int ID_ZWNJ = 251;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 252.
- // -- 5/24/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_AACUTE_L] = AACUTE_L;
- names[Ids.ID_AACUTE_U] = AACUTE_U;
- names[Ids.ID_ACIRC_L] = ACIRC_L;
- names[Ids.ID_ACIRC_U] = ACIRC_U;
- names[Ids.ID_ACUTE] = ACUTE;
- names[Ids.ID_AELIG_L] = AELIG_L;
- names[Ids.ID_AELIG_U] = AELIG_U;
- names[Ids.ID_AGRAVE_L] = AGRAVE_L;
- names[Ids.ID_AGRAVE_U] = AGRAVE_U;
- names[Ids.ID_ALEFSYM] = ALEFSYM;
- names[Ids.ID_ALPHA_L] = ALPHA_L;
- names[Ids.ID_ALPHA_U] = ALPHA_U;
- names[Ids.ID_AMP] = AMP;
- names[Ids.ID_AND] = AND;
- names[Ids.ID_ANG] = ANG;
- names[Ids.ID_ARING_L] = ARING_L;
- names[Ids.ID_ARING_U] = ARING_U;
- names[Ids.ID_ASYMP] = ASYMP;
- names[Ids.ID_ATILDE_L] = ATILDE_L;
- names[Ids.ID_ATILDE_U] = ATILDE_U;
- names[Ids.ID_AUML_L] = AUML_L;
- names[Ids.ID_AUML_U] = AUML_U;
- names[Ids.ID_BDQUO] = BDQUO;
- names[Ids.ID_BETA_L] = BETA_L;
- names[Ids.ID_BETA_U] = BETA_U;
- names[Ids.ID_BRVBAR] = BRVBAR;
- names[Ids.ID_BULL] = BULL;
- names[Ids.ID_CAP] = CAP;
- names[Ids.ID_CCEDIL_L] = CCEDIL_L;
- names[Ids.ID_CCEDIL_U] = CCEDIL_U;
- names[Ids.ID_CEDIL] = CEDIL;
- names[Ids.ID_CENT] = CENT;
- names[Ids.ID_CHI_L] = CHI_L;
- names[Ids.ID_CHI_U] = CHI_U;
- names[Ids.ID_CIRC] = CIRC;
- names[Ids.ID_CLUBS] = CLUBS;
- names[Ids.ID_CONG] = CONG;
- names[Ids.ID_COPY] = COPY;
- names[Ids.ID_CRARR] = CRARR;
- names[Ids.ID_CUP] = CUP;
- names[Ids.ID_CURREN] = CURREN;
- names[Ids.ID_DAGGER_L] = DAGGER_L;
- names[Ids.ID_DAGGER_U] = DAGGER_U;
- names[Ids.ID_DARR_L] = DARR_L;
- names[Ids.ID_DARR_U] = DARR_U;
- names[Ids.ID_DEG] = DEG;
- names[Ids.ID_DELTA_L] = DELTA_L;
- names[Ids.ID_DELTA_U] = DELTA_U;
- names[Ids.ID_DIAMS] = DIAMS;
- names[Ids.ID_DIVIDE] = DIVIDE;
- names[Ids.ID_EACUTE_L] = EACUTE_L;
- names[Ids.ID_EACUTE_U] = EACUTE_U;
- names[Ids.ID_ECIRC_L] = ECIRC_L;
- names[Ids.ID_ECIRC_U] = ECIRC_U;
- names[Ids.ID_EGRAVE_L] = EGRAVE_L;
- names[Ids.ID_EGRAVE_U] = EGRAVE_U;
- names[Ids.ID_EMPTY] = EMPTY;
- names[Ids.ID_EMSP] = EMSP;
- names[Ids.ID_ENSP] = ENSP;
- names[Ids.ID_EPSILON_L] = EPSILON_L;
- names[Ids.ID_EPSILON_U] = EPSILON_U;
- names[Ids.ID_EQUIV] = EQUIV;
- names[Ids.ID_ETA_L] = ETA_L;
- names[Ids.ID_ETA_U] = ETA_U;
- names[Ids.ID_ETH_L] = ETH_L;
- names[Ids.ID_ETH_U] = ETH_U;
- names[Ids.ID_EUML_L] = EUML_L;
- names[Ids.ID_EUML_U] = EUML_U;
- names[Ids.ID_EURO] = EURO;
- names[Ids.ID_EXIST] = EXIST;
- names[Ids.ID_FNOF] = FNOF;
- names[Ids.ID_FORALL] = FORALL;
- names[Ids.ID_FRAC12] = FRAC12;
- names[Ids.ID_FRAC14] = FRAC14;
- names[Ids.ID_FRAC34] = FRAC34;
- names[Ids.ID_FRASL] = FRASL;
- names[Ids.ID_GAMMA_L] = GAMMA_L;
- names[Ids.ID_GAMMA_U] = GAMMA_U;
- names[Ids.ID_GE] = GE;
- names[Ids.ID_GT] = GT;
- names[Ids.ID_HARR_L] = HARR_L;
- names[Ids.ID_HARR_U] = HARR_U;
- names[Ids.ID_HEARTS] = HEARTS;
- names[Ids.ID_HELLIP] = HELLIP;
- names[Ids.ID_IACUTE_L] = IACUTE_L;
- names[Ids.ID_IACUTE_U] = IACUTE_U;
- names[Ids.ID_ICIRC_L] = ICIRC_L;
- names[Ids.ID_ICIRC_U] = ICIRC_U;
- names[Ids.ID_IEXCL] = IEXCL;
- names[Ids.ID_IGRAVE_L] = IGRAVE_L;
- names[Ids.ID_IGRAVE_U] = IGRAVE_U;
- names[Ids.ID_IMAGE] = IMAGE;
- names[Ids.ID_INFIN] = INFIN;
- names[Ids.ID_INT] = INT;
- names[Ids.ID_IOTA_L] = IOTA_L;
- names[Ids.ID_IOTA_U] = IOTA_U;
- names[Ids.ID_IQUEST] = IQUEST;
- names[Ids.ID_ISIN] = ISIN;
- names[Ids.ID_IUML_L] = IUML_L;
- names[Ids.ID_IUML_U] = IUML_U;
- names[Ids.ID_KAPPA_L] = KAPPA_L;
- names[Ids.ID_KAPPA_U] = KAPPA_U;
- names[Ids.ID_LAMBDA_L] = LAMBDA_L;
- names[Ids.ID_LAMBDA_U] = LAMBDA_U;
- names[Ids.ID_LANG] = LANG;
- names[Ids.ID_LAQUO] = LAQUO;
- names[Ids.ID_LARR_L] = LARR_L;
- names[Ids.ID_LARR_U] = LARR_U;
- names[Ids.ID_LCEIL] = LCEIL;
- names[Ids.ID_LDQUO] = LDQUO;
- names[Ids.ID_LE] = LE;
- names[Ids.ID_LFLOOR] = LFLOOR;
- names[Ids.ID_LOWAST] = LOWAST;
- names[Ids.ID_LOZ] = LOZ;
- names[Ids.ID_LRM] = LRM;
- names[Ids.ID_LSAQUO] = LSAQUO;
- names[Ids.ID_LSQUO] = LSQUO;
- names[Ids.ID_LT] = LT;
- names[Ids.ID_MACR] = MACR;
- names[Ids.ID_MDASH] = MDASH;
- names[Ids.ID_MICRO] = MICRO;
- names[Ids.ID_MIDDOT] = MIDDOT;
- names[Ids.ID_MINUS] = MINUS;
- names[Ids.ID_MU_L] = MU_L;
- names[Ids.ID_MU_U] = MU_U;
- names[Ids.ID_NABLA] = NABLA;
- names[Ids.ID_NBSP] = NBSP;
- names[Ids.ID_NDASH] = NDASH;
- names[Ids.ID_NE] = NE;
- names[Ids.ID_NI] = NI;
- names[Ids.ID_NOT] = NOT;
- names[Ids.ID_NOTIN] = NOTIN;
- names[Ids.ID_NSUB] = NSUB;
- names[Ids.ID_NTILDE_L] = NTILDE_L;
- names[Ids.ID_NTILDE_U] = NTILDE_U;
- names[Ids.ID_NU_L] = NU_L;
- names[Ids.ID_NU_U] = NU_U;
- names[Ids.ID_OACUTE_L] = OACUTE_L;
- names[Ids.ID_OACUTE_U] = OACUTE_U;
- names[Ids.ID_OCIRC_L] = OCIRC_L;
- names[Ids.ID_OCIRC_U] = OCIRC_U;
- names[Ids.ID_OELIG_L] = OELIG_L;
- names[Ids.ID_OELIG_U] = OELIG_U;
- names[Ids.ID_OGRAVE_L] = OGRAVE_L;
- names[Ids.ID_OGRAVE_U] = OGRAVE_U;
- names[Ids.ID_OLINE] = OLINE;
- names[Ids.ID_OMEGA_L] = OMEGA_L;
- names[Ids.ID_OMEGA_U] = OMEGA_U;
- names[Ids.ID_OMICRON_L] = OMICRON_L;
- names[Ids.ID_OMICRON_U] = OMICRON_U;
- names[Ids.ID_OPLUS] = OPLUS;
- names[Ids.ID_OR] = OR;
- names[Ids.ID_ORDF] = ORDF;
- names[Ids.ID_ORDM] = ORDM;
- names[Ids.ID_OSLASH_L] = OSLASH_L;
- names[Ids.ID_OSLASH_U] = OSLASH_U;
- names[Ids.ID_OTILDE_L] = OTILDE_L;
- names[Ids.ID_OTILDE_U] = OTILDE_U;
- names[Ids.ID_OTIMES] = OTIMES;
- names[Ids.ID_OUML_L] = OUML_L;
- names[Ids.ID_OUML_U] = OUML_U;
- names[Ids.ID_PARA] = PARA;
- names[Ids.ID_PART] = PART;
- names[Ids.ID_PERMIL] = PERMIL;
- names[Ids.ID_PERP] = PERP;
- names[Ids.ID_PHI_L] = PHI_L;
- names[Ids.ID_PHI_U] = PHI_U;
- names[Ids.ID_PIV] = PIV;
- names[Ids.ID_PI_L] = PI_L;
- names[Ids.ID_PI_U] = PI_U;
- names[Ids.ID_PLUSMN] = PLUSMN;
- names[Ids.ID_POUND] = POUND;
- names[Ids.ID_PRIME_L] = PRIME_L;
- names[Ids.ID_PRIME_U] = PRIME_U;
- names[Ids.ID_PROD] = PROD;
- names[Ids.ID_PROP] = PROP;
- names[Ids.ID_PSI_L] = PSI_L;
- names[Ids.ID_PSI_U] = PSI_U;
- names[Ids.ID_QUOT] = QUOT;
- names[Ids.ID_RADIC] = RADIC;
- names[Ids.ID_RANG] = RANG;
- names[Ids.ID_RAQUO] = RAQUO;
- names[Ids.ID_RARR_L] = RARR_L;
- names[Ids.ID_RARR_U] = RARR_U;
- names[Ids.ID_RCEIL] = RCEIL;
- names[Ids.ID_RDQUO] = RDQUO;
- names[Ids.ID_REAL] = REAL;
- names[Ids.ID_REG] = REG;
- names[Ids.ID_RFLOOR] = RFLOOR;
- names[Ids.ID_RHO_L] = RHO_L;
- names[Ids.ID_RHO_U] = RHO_U;
- names[Ids.ID_RLM] = RLM;
- names[Ids.ID_RSAQUO] = RSAQUO;
- names[Ids.ID_RSQUO] = RSQUO;
- names[Ids.ID_SBQUO] = SBQUO;
- names[Ids.ID_SCARON_L] = SCARON_L;
- names[Ids.ID_SCARON_U] = SCARON_U;
- names[Ids.ID_SDOT] = SDOT;
- names[Ids.ID_SECT] = SECT;
- names[Ids.ID_SHY] = SHY;
- names[Ids.ID_SIGMAF] = SIGMAF;
- names[Ids.ID_SIGMA_L] = SIGMA_L;
- names[Ids.ID_SIGMA_U] = SIGMA_U;
- names[Ids.ID_SIM] = SIM;
- names[Ids.ID_SPADES] = SPADES;
- names[Ids.ID_SUB] = SUB;
- names[Ids.ID_SUBE] = SUBE;
- names[Ids.ID_SUM] = SUM;
- names[Ids.ID_SUP] = SUP;
- names[Ids.ID_SUP1] = SUP1;
- names[Ids.ID_SUP2] = SUP2;
- names[Ids.ID_SUP3] = SUP3;
- names[Ids.ID_SUPE] = SUPE;
- names[Ids.ID_SZLIG] = SZLIG;
- names[Ids.ID_TAU_L] = TAU_L;
- names[Ids.ID_TAU_U] = TAU_U;
- names[Ids.ID_THERE4] = THERE4;
- names[Ids.ID_THETASYM] = THETASYM;
- names[Ids.ID_THETA_L] = THETA_L;
- names[Ids.ID_THETA_U] = THETA_U;
- names[Ids.ID_THINSP] = THINSP;
- names[Ids.ID_THORN_L] = THORN_L;
- names[Ids.ID_THORN_U] = THORN_U;
- names[Ids.ID_TILDE] = TILDE;
- names[Ids.ID_TIMES] = TIMES;
- names[Ids.ID_TRADE] = TRADE;
- names[Ids.ID_UACUTE_L] = UACUTE_L;
- names[Ids.ID_UACUTE_U] = UACUTE_U;
- names[Ids.ID_UARR_L] = UARR_L;
- names[Ids.ID_UARR_U] = UARR_U;
- names[Ids.ID_UCIRC_L] = UCIRC_L;
- names[Ids.ID_UCIRC_U] = UCIRC_U;
- names[Ids.ID_UGRAVE_L] = UGRAVE_L;
- names[Ids.ID_UGRAVE_U] = UGRAVE_U;
- names[Ids.ID_UML] = UML;
- names[Ids.ID_UPSIH] = UPSIH;
- names[Ids.ID_UPSILON_L] = UPSILON_L;
- names[Ids.ID_UPSILON_U] = UPSILON_U;
- names[Ids.ID_UUML_L] = UUML_L;
- names[Ids.ID_UUML_U] = UUML_U;
- names[Ids.ID_WEIERP] = WEIERP;
- names[Ids.ID_XI_L] = XI_L;
- names[Ids.ID_XI_U] = XI_U;
- names[Ids.ID_YACUTE_L] = YACUTE_L;
- names[Ids.ID_YACUTE_U] = YACUTE_U;
- names[Ids.ID_YEN] = YEN;
- names[Ids.ID_YUML_L] = YUML_L;
- names[Ids.ID_YUML_U] = YUML_U;
- names[Ids.ID_ZETA_L] = ZETA_L;
- names[Ids.ID_ZETA_U] = ZETA_U;
- names[Ids.ID_ZWJ] = ZWJ;
- names[Ids.ID_ZWNJ] = ZWNJ;
- }
- private static char[] values = null;
-
- static {
- values = new char[Ids.getNumOfIds()];
- values[Ids.ID_AACUTE_L] = 225;
- values[Ids.ID_AACUTE_U] = 193;
- values[Ids.ID_ACIRC_L] = 226;
- values[Ids.ID_ACIRC_U] = 194;
- values[Ids.ID_ACUTE] = 180;
- values[Ids.ID_AELIG_L] = 230;
- values[Ids.ID_AELIG_U] = 198;
- values[Ids.ID_AGRAVE_L] = 224;
- values[Ids.ID_AGRAVE_U] = 192;
- values[Ids.ID_ALEFSYM] = 8501;
- values[Ids.ID_ALPHA_L] = 945;
- values[Ids.ID_ALPHA_U] = 913;
- values[Ids.ID_AMP] = 38;
- values[Ids.ID_AND] = 8743;
- values[Ids.ID_ANG] = 8736;
- values[Ids.ID_ARING_L] = 229;
- values[Ids.ID_ARING_U] = 197;
- values[Ids.ID_ASYMP] = 8776;
- values[Ids.ID_ATILDE_L] = 227;
- values[Ids.ID_ATILDE_U] = 195;
- values[Ids.ID_AUML_L] = 228;
- values[Ids.ID_AUML_U] = 196;
- values[Ids.ID_BDQUO] = 8222;
- values[Ids.ID_BETA_L] = 946;
- values[Ids.ID_BETA_U] = 914;
- values[Ids.ID_BRVBAR] = 166;
- values[Ids.ID_BULL] = 8226;
- values[Ids.ID_CAP] = 8745;
- values[Ids.ID_CCEDIL_L] = 231;
- values[Ids.ID_CCEDIL_U] = 199;
- values[Ids.ID_CEDIL] = 184;
- values[Ids.ID_CENT] = 162;
- values[Ids.ID_CHI_L] = 967;
- values[Ids.ID_CHI_U] = 935;
- values[Ids.ID_CIRC] = 710;
- values[Ids.ID_CLUBS] = 9827;
- values[Ids.ID_CONG] = 8773;
- values[Ids.ID_COPY] = 169;
- values[Ids.ID_CRARR] = 8629;
- values[Ids.ID_CUP] = 8746;
- values[Ids.ID_CURREN] = 164;
- values[Ids.ID_DAGGER_L] = 8224;
- values[Ids.ID_DAGGER_U] = 8225;
- values[Ids.ID_DARR_L] = 8595;
- values[Ids.ID_DARR_U] = 8659;
- values[Ids.ID_DEG] = 176;
- values[Ids.ID_DELTA_L] = 948;
- values[Ids.ID_DELTA_U] = 916;
- values[Ids.ID_DIAMS] = 9830;
- values[Ids.ID_DIVIDE] = 247;
- values[Ids.ID_EACUTE_L] = 233;
- values[Ids.ID_EACUTE_U] = 201;
- values[Ids.ID_ECIRC_L] = 234;
- values[Ids.ID_ECIRC_U] = 202;
- values[Ids.ID_EGRAVE_L] = 232;
- values[Ids.ID_EGRAVE_U] = 200;
- values[Ids.ID_EMPTY] = 8709;
- values[Ids.ID_EMSP] = 8195;
- values[Ids.ID_ENSP] = 8194;
- values[Ids.ID_EPSILON_L] = 949;
- values[Ids.ID_EPSILON_U] = 917;
- values[Ids.ID_EQUIV] = 8801;
- values[Ids.ID_ETA_L] = 951;
- values[Ids.ID_ETA_U] = 919;
- values[Ids.ID_ETH_L] = 240;
- values[Ids.ID_ETH_U] = 208;
- values[Ids.ID_EUML_L] = 235;
- values[Ids.ID_EUML_U] = 203;
- values[Ids.ID_EURO] = 8364;
- values[Ids.ID_EXIST] = 8707;
- values[Ids.ID_FNOF] = 402;
- values[Ids.ID_FORALL] = 8704;
- values[Ids.ID_FRAC12] = 189;
- values[Ids.ID_FRAC14] = 188;
- values[Ids.ID_FRAC34] = 190;
- values[Ids.ID_FRASL] = 8260;
- values[Ids.ID_GAMMA_L] = 947;
- values[Ids.ID_GAMMA_U] = 915;
- values[Ids.ID_GE] = 8805;
- values[Ids.ID_GT] = 62;
- values[Ids.ID_HARR_L] = 8596;
- values[Ids.ID_HARR_U] = 8660;
- values[Ids.ID_HEARTS] = 9829;
- values[Ids.ID_HELLIP] = 8230;
- values[Ids.ID_IACUTE_L] = 237;
- values[Ids.ID_IACUTE_U] = 205;
- values[Ids.ID_ICIRC_L] = 238;
- values[Ids.ID_ICIRC_U] = 206;
- values[Ids.ID_IEXCL] = 161;
- values[Ids.ID_IGRAVE_L] = 236;
- values[Ids.ID_IGRAVE_U] = 204;
- values[Ids.ID_IMAGE] = 8465;
- values[Ids.ID_INFIN] = 8734;
- values[Ids.ID_INT] = 8747;
- values[Ids.ID_IOTA_L] = 953;
- values[Ids.ID_IOTA_U] = 921;
- values[Ids.ID_IQUEST] = 191;
- values[Ids.ID_ISIN] = 8712;
- values[Ids.ID_IUML_L] = 239;
- values[Ids.ID_IUML_U] = 207;
- values[Ids.ID_KAPPA_L] = 954;
- values[Ids.ID_KAPPA_U] = 922;
- values[Ids.ID_LAMBDA_L] = 955;
- values[Ids.ID_LAMBDA_U] = 923;
- values[Ids.ID_LANG] = 9001;
- values[Ids.ID_LAQUO] = 171;
- values[Ids.ID_LARR_L] = 8592;
- values[Ids.ID_LARR_U] = 8656;
- values[Ids.ID_LCEIL] = 8968;
- values[Ids.ID_LDQUO] = 8220;
- values[Ids.ID_LE] = 8804;
- values[Ids.ID_LFLOOR] = 8970;
- values[Ids.ID_LOWAST] = 8727;
- values[Ids.ID_LOZ] = 9674;
- values[Ids.ID_LRM] = 8206;
- values[Ids.ID_LSAQUO] = 8249;
- values[Ids.ID_LSQUO] = 8216;
- values[Ids.ID_LT] = 60;
- values[Ids.ID_MACR] = 175;
- values[Ids.ID_MDASH] = 8212;
- values[Ids.ID_MICRO] = 181;
- values[Ids.ID_MIDDOT] = 183;
- values[Ids.ID_MINUS] = 8722;
- values[Ids.ID_MU_L] = 956;
- values[Ids.ID_MU_U] = 924;
- values[Ids.ID_NABLA] = 8711;
- values[Ids.ID_NBSP] = 160;
- values[Ids.ID_NDASH] = 8211;
- values[Ids.ID_NE] = 8800;
- values[Ids.ID_NI] = 8715;
- values[Ids.ID_NOT] = 172;
- values[Ids.ID_NOTIN] = 8713;
- values[Ids.ID_NSUB] = 8836;
- values[Ids.ID_NTILDE_L] = 241;
- values[Ids.ID_NTILDE_U] = 209;
- values[Ids.ID_NU_L] = 957;
- values[Ids.ID_NU_U] = 925;
- values[Ids.ID_OACUTE_L] = 243;
- values[Ids.ID_OACUTE_U] = 211;
- values[Ids.ID_OCIRC_L] = 244;
- values[Ids.ID_OCIRC_U] = 212;
- values[Ids.ID_OELIG_L] = 339;
- values[Ids.ID_OELIG_U] = 338;
- values[Ids.ID_OGRAVE_L] = 242;
- values[Ids.ID_OGRAVE_U] = 210;
- values[Ids.ID_OLINE] = 8254;
- values[Ids.ID_OMEGA_L] = 969;
- values[Ids.ID_OMEGA_U] = 937;
- values[Ids.ID_OMICRON_L] = 959;
- values[Ids.ID_OMICRON_U] = 927;
- values[Ids.ID_OPLUS] = 8853;
- values[Ids.ID_OR] = 8744;
- values[Ids.ID_ORDF] = 170;
- values[Ids.ID_ORDM] = 186;
- values[Ids.ID_OSLASH_L] = 248;
- values[Ids.ID_OSLASH_U] = 216;
- values[Ids.ID_OTILDE_L] = 245;
- values[Ids.ID_OTILDE_U] = 213;
- values[Ids.ID_OTIMES] = 8855;
- values[Ids.ID_OUML_L] = 246;
- values[Ids.ID_OUML_U] = 214;
- values[Ids.ID_PARA] = 182;
- values[Ids.ID_PART] = 8706;
- values[Ids.ID_PERMIL] = 8240;
- values[Ids.ID_PERP] = 8869;
- values[Ids.ID_PHI_L] = 966;
- values[Ids.ID_PHI_U] = 934;
- values[Ids.ID_PIV] = 982;
- values[Ids.ID_PI_L] = 960;
- values[Ids.ID_PI_U] = 928;
- values[Ids.ID_PLUSMN] = 177;
- values[Ids.ID_POUND] = 163;
- values[Ids.ID_PRIME_L] = 8242;
- values[Ids.ID_PRIME_U] = 8243;
- values[Ids.ID_PROD] = 8719;
- values[Ids.ID_PROP] = 8733;
- values[Ids.ID_PSI_L] = 968;
- values[Ids.ID_PSI_U] = 936;
- values[Ids.ID_QUOT] = 34;
- values[Ids.ID_RADIC] = 8730;
- values[Ids.ID_RANG] = 9002;
- values[Ids.ID_RAQUO] = 187;
- values[Ids.ID_RARR_L] = 8594;
- values[Ids.ID_RARR_U] = 8658;
- values[Ids.ID_RCEIL] = 8969;
- values[Ids.ID_RDQUO] = 8221;
- values[Ids.ID_REAL] = 8476;
- values[Ids.ID_REG] = 174;
- values[Ids.ID_RFLOOR] = 8971;
- values[Ids.ID_RHO_L] = 961;
- values[Ids.ID_RHO_U] = 929;
- values[Ids.ID_RLM] = 8207;
- values[Ids.ID_RSAQUO] = 8250;
- values[Ids.ID_RSQUO] = 8217;
- values[Ids.ID_SBQUO] = 8218;
- values[Ids.ID_SCARON_L] = 353;
- values[Ids.ID_SCARON_U] = 352;
- values[Ids.ID_SDOT] = 8901;
- values[Ids.ID_SECT] = 167;
- values[Ids.ID_SHY] = 173;
- values[Ids.ID_SIGMAF] = 962;
- values[Ids.ID_SIGMA_L] = 963;
- values[Ids.ID_SIGMA_U] = 931;
- values[Ids.ID_SIM] = 8764;
- values[Ids.ID_SPADES] = 9824;
- values[Ids.ID_SUB] = 8834;
- values[Ids.ID_SUBE] = 8838;
- values[Ids.ID_SUM] = 8721;
- values[Ids.ID_SUP] = 8835;
- values[Ids.ID_SUP1] = 185;
- values[Ids.ID_SUP2] = 178;
- values[Ids.ID_SUP3] = 179;
- values[Ids.ID_SUPE] = 8839;
- values[Ids.ID_SZLIG] = 223;
- values[Ids.ID_TAU_L] = 964;
- values[Ids.ID_TAU_U] = 932;
- values[Ids.ID_THERE4] = 8756;
- values[Ids.ID_THETASYM] = 977;
- values[Ids.ID_THETA_L] = 952;
- values[Ids.ID_THETA_U] = 920;
- values[Ids.ID_THINSP] = 8201;
- values[Ids.ID_THORN_L] = 254;
- values[Ids.ID_THORN_U] = 222;
- values[Ids.ID_TILDE] = 732;
- values[Ids.ID_TIMES] = 215;
- values[Ids.ID_TRADE] = 8482;
- values[Ids.ID_UACUTE_L] = 250;
- values[Ids.ID_UACUTE_U] = 218;
- values[Ids.ID_UARR_L] = 8593;
- values[Ids.ID_UARR_U] = 8657;
- values[Ids.ID_UCIRC_L] = 251;
- values[Ids.ID_UCIRC_U] = 219;
- values[Ids.ID_UGRAVE_L] = 249;
- values[Ids.ID_UGRAVE_U] = 217;
- values[Ids.ID_UML] = 168;
- values[Ids.ID_UPSIH] = 978;
- values[Ids.ID_UPSILON_L] = 965;
- values[Ids.ID_UPSILON_U] = 933;
- values[Ids.ID_UUML_L] = 252;
- values[Ids.ID_UUML_U] = 220;
- values[Ids.ID_WEIERP] = 8472;
- values[Ids.ID_XI_L] = 958;
- values[Ids.ID_XI_U] = 926;
- values[Ids.ID_YACUTE_L] = 253;
- values[Ids.ID_YACUTE_U] = 221;
- values[Ids.ID_YEN] = 165;
- values[Ids.ID_YUML_L] = 255;
- values[Ids.ID_YUML_U] = 376;
- values[Ids.ID_ZETA_L] = 950;
- values[Ids.ID_ZETA_U] = 918;
- values[Ids.ID_ZWJ] = 8205;
- values[Ids.ID_ZWNJ] = 8204;
- }
-
- /**
- */
- public EntityCollection() {
- super(names, STRICT_CASE);
- }
-
- /**
- * Create an entity declaration.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param attrName java.lang.String
- */
- protected CMNode create(String entityName) {
- int id = getID(entityName);
- if (id == ID_UNKNOWN)
- return null;
-
- String value = String.valueOf(values[id]);
- HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
- return dec;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java
deleted file mode 100644
index 98ab2d9ad8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
- private HTMLCMDataTypeImpl type = null;
- private int usage = 0;
-
- /**
- */
- public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
- super(attrName);
- this.type = valueType;
-
- switch (valueUsage) {
- case OPTIONAL :
- case REQUIRED :
- case FIXED :
- case PROHIBITED :
- this.usage = valueUsage;
- break;
- default :
- // should warn...
- this.usage = OPTIONAL; // fall back
- break;
- }
- }
-
- /**
- * getAttrName method
- * @return java.lang.String
- */
- public String getAttrName() {
- return getNodeName();
- }
-
- /**
- * getAttrType method
- * @return CMDataType
- */
- public CMDataType getAttrType() {
- return type;
- }
-
- /**
- * @deprecated in superclass
- */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /**
- * @deprecated in superclass
- */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- /**
- * @return int
- */
- public int getUsage() {
- return usage;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
deleted file mode 100644
index 63366fd3f9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
- private int impliedValueKind = IMPLIED_VALUE_NONE;
- private String impliedValue = null;
- private final static String[] emptyArray = new String[0];
- private String[] enumValues = emptyArray;
- private String instanceValue = null;
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName) {
- super(typeName);
- }
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
- super(typeName);
- this.instanceValue = instanceValue;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * This method returns a suitable default value that can be used when an instance of the data type is created.
- * This returns null of a suitable default is not available.
- */
- public String generateInstanceValue() {
- return instanceValue;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
- */
- public String getDataTypeName() {
- return getNodeName();
- }
-
- /**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
- public String[] getEnumeratedValues() {
- return enumValues;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
- public String getImpliedValue() {
- return impliedValue;
- }
-
- /**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
- public int getImpliedValueKind() {
- return impliedValueKind;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- /**
- */
- void setEnumValues(String[] values) {
- enumValues = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- enumValues[i] = values[i];
- }
- }
-
- /**
- * package scope.
- */
- void setImpliedValue(int kind, String value) {
- switch (kind) {
- case IMPLIED_VALUE_FIXED :
- case IMPLIED_VALUE_DEFAULT :
- impliedValueKind = kind;
- impliedValue = value;
- break;
- case IMPLIED_VALUE_NONE :
- default :
- impliedValueKind = IMPLIED_VALUE_NONE;
- impliedValue = null; // maybe a null string?
- break;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java
deleted file mode 100644
index b294b27576..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case. However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents. So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- /**
- * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
- * Otherwise, returns <code>false</code>.
- * @return boolean
- */
- boolean shouldIgnoreCase();
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
deleted file mode 100644
index c003526d22..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
- // DTD
- protected CMNamedNodeMapImpl attributes = null;
- protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- /** Never access this field directly. Instead, use getComplexTypeDefinition method. */
- private ComplexTypeDefinition typeDefinition = null;
- protected CMGroupImpl inclusion = null;
- protected CMGroupImpl exclusion = null;
- // advanced information
- protected CMNamedNodeMap prohibitedAncestors = null;
- protected int correctionType = CORRECT_NONE;
- protected int formatType = FORMAT_HTML;
- protected int layoutType = LAYOUT_NONE;
- protected int omitType = OMIT_NONE;
- protected boolean keepSpaces = false;
- protected boolean indentChild = false;
- protected ElementCollection elementCollection = null;
- protected AttributeCollection attributeCollection = null;
- protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
-
- /**
- * HTMLElemDeclImpl constructor.
- * In the HTML DTD, an element declaration has no specification
- * for its occurrence. Occurrence is specifed in content model, like
- * <code>(LI)+</code>. To avoid confusion (and complexity),
- * occurrence of an element declaration is always 1 (it means, min = 1 and
- * max = 1). Instead, occurrence of CMGroup represents actual occurrence
- * of the content.
- * <br>
- * @param name java.lang.String
- */
- public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
- super(elementName, 1, 1);
- elementCollection = collection;
- attributeCollection = collection.getAttributeCollection();
- }
-
- /**
- */
- protected abstract void createAttributeDeclarations();
-
- private ComplexTypeDefinition createComplexTypeDefinition() {
- if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
- return null;
-
- ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
- if (factory == null)
- return null; // fatal error.
-
- ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
- return def;
- }
-
- /**
- * Get an attribute declaration.
- */
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null) {
- createAttributeDeclarations();
- if (attributes == null)
- return null; // fail to create
- }
-
- CMNode cmnode = attributes.getNamedItem(attrName);
- if (cmnode == null) {
- return null;
- }
- else {
- return (HTMLAttributeDeclaration) cmnode; // already exists.
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes == null)
- createAttributeDeclarations(); // lazy eval.
- return attributes;
- }
-
- /**
- * Get an instance of complex type definition.
- */
- private ComplexTypeDefinition getComplexTypeDefinition() {
- if (typeDefinition == null)
- typeDefinition = createComplexTypeDefinition();
- return typeDefinition;
- }
-
- /**
- * Content.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and always return null.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMContent getContent() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContent() : null;
- }
-
- /**
- * Content type.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and return an appropriate type.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
- }
-
- /**
- * @see HTMLElementDeclaration#getCorrectionType
- */
- public int getCorrectionType() {
- return correctionType;
- }
-
- /**
- * HTML element doesn't have any data type. So, this method always
- * returns <code>null</code>.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMDataType getDataType() {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public String getElementName() {
- return getNodeName();
- }
-
- /**
- * Exclusion.
- * Almost elements don't have a exclusion.
- * Only classes those have exclusion should override this method.
- */
- public CMContent getExclusion() {
- return null;
- }
-
- /**
- * Default format type is <code>FORMAT_HTML</code>.<br>
- */
- public int getFormatType() {
- return formatType;
- }
-
- /**
- * Inclusion.
- * Almost elements don't have a inclusion.
- * Only classes those have inclusion should override this method.
- */
- public CMContent getInclusion() {
- return null;
- }
-
- /**
- */
- public int getLayoutType() {
- return layoutType;
- }
-
- /**
- * Line break hint is strongly related to layout type.
- * Indeed, in the C++DOM, it is determined from layout type only.
- * So, this implementation, as the default implementation for all declarations,
- * also determines from layout type only.<br>
- * @return int
- */
- public int getLineBreakHint() {
- switch (getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- return HTMLElementDeclaration.BREAK_AFTER_START;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- default :
- return HTMLElementDeclaration.BREAK_NONE;
- }
- }
-
- /**
- * No HTML element has local elements. So, this method always
- * returns an empty map.
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getLocalElements() {
- return EMPTY_MAP;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- /**
- */
- public int getOmitType() {
- return omitType;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null);
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
-
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(true);
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null) ? def.getPrimaryCandidate() : null;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- /**
- * Return element names which terminates this element.<br>
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return null;
- }
-
- /**
- * return true when the element is a JSP element.
- */
- public boolean isJSP() {
- return false;
- }
-
- /**
- * In some elements, such as APPLET, a source generator should indent child
- * elements that their parents. That is, a source generator should generate
- * source of APPLET and PARAMS like this:
- * <PRE>
- * &lt;APPLET ...&gt;
- * &lt;PARAM ... &gt;
- * &lt;PARAM ... &gt;
- * &lt;/APPLET&gt;
- * <PRE>
- * @return boolean
- */
- public boolean shouldIndentChildSource() {
- return indentChild;
- }
-
- /**
- * Most of elements can compact spaces in their child text nodes.
- * Some special elements should keep them in their source.
- * @return boolean
- */
- public boolean shouldKeepSpaces() {
- return keepSpaces;
- }
-
- /**
- * @return boolean
- */
- public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
- Iterator i = getTerminators();
- if (i == null)
- return false;
- String nextName = nextElement.getElementName();
- while (i.hasNext()) {
- if (nextName.equals(i.next()))
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
deleted file mode 100644
index 1a47b01dfb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
- private java.lang.String value = null;
-
- /**
- * CMEntityDeclImpl constructor comment.
- * @param entityName java.lang.String; Entity name.
- * @param entityValue java.lang.String; Value string.
- */
- public HTMLEntityDeclImpl(String entityName, String entityValue) {
- super(entityName);
- value = entityValue;
- }
-
- /**
- * getName method
- * @return java.lang.String
- */
- public String getName() {
- return getNodeName();
- }
-
- /**
- * Get CMNode type.<br>
- * @return int; Always return ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ENTITY_DECLARATION;
- }
-
- /**
- * getValue method
- * @return java.lang.String
- */
- public String getValue() {
- return value;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- * Entities in HTML documents are always treated with ignoring cases.
- * Because no special entities are defined in JSP 1.0, this method
- * can always return <code>true</code>.<br>
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
deleted file mode 100644
index f603c37b79..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
- /**
- */
- public HedA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.A, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (directkey %Character; #IMPLIED)
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HREF,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>A</code> has the exclusion.
- * It is <code>A</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode a = elementCollection.getNamedItem(CHTMLNamespace.ElementName.A);
- if (a != null)
- exclusion.appendChild(a);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.A,};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java
deleted file mode 100644
index 36a72f2f0f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
- /**
- */
- public HedADDRESS(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.ADDRESS, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java
deleted file mode 100644
index f33abe0813..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
- /**
- */
- public HedBASE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BASE, collection);
- // LAYOUT_HIDDEN.
- // Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * BASE.
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_HREF,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java
deleted file mode 100644
index 5aef97b8a6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
- /**
- */
- public HedBLOCKQUOTE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BLOCKQUOTE, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
deleted file mode 100644
index 7483c58911..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedBODY(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BODY, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_BOTH;
- }
-
- /**
- * %attrs;
- * %bodycolors;
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (marginwidth %Pixels; #IMPLIED) ... D205514
- * (marginheight %Pixels; #IMPLIED) .. D205514
- * (topmargin, CDATA, #IMPLIED) ...... D205514
- * (bottommargin, CDATA, #IMPLIED) ... D205514
- * (leftmargin, CDATA, #IMPLIED) ..... D205514
- * (rightmargin, CDATA, #IMPLIED) .... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %bodycolors;
- attributeCollection.getBodycolors(attributes);
-
- }
-
- /**
- * BODY has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java
deleted file mode 100644
index 3ec16f585b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
- /**
- */
- public HedBR(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BR, collection);
- // LAYOUT_BREAK.
- // Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BREAK;
- }
-
- /**
- * BR.
- * %coreattrs;
- * (clear (left | all | right | none) none)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // clear
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_CLEAR);
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CLEAR, attr);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java
deleted file mode 100644
index 769393380e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
- /**
- */
- public HedCENTER(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.CENTER, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java
deleted file mode 100644
index dd70e26781..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
- /**
- */
- public HedDD(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DD, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
deleted file mode 100644
index 8e2d794f13..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
- /**
- */
- public HedDIV(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DIV, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * %align;
- * %reserved;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %align;
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- // %reserved; ... empty
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java
deleted file mode 100644
index 1746bb23ed..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
- /**
- */
- public HedDL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DL, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %arrays;
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java
deleted file mode 100644
index 933d877c13..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
- /**
- */
- public HedDT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DT, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DT has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java
deleted file mode 100644
index c6de6e0bc4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEmpty(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- // EMPTY type has no end tag.
- omitType = OMIT_END_MUST;
- }
-
- /**
- * Content.<br>
- * EMPTY type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.EMPTY;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
deleted file mode 100644
index 090d61aacc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
- /**
- */
- public HedFORM(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.FORM, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (action %URI; #REQUIRED)
- * (method (GET|POST) GET)
- * (enctype %ContentType; "application/x-www-form-urlencoded")
- * (accept %ContentTypes; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (onsubmit %Script; #IMPLIED)
- * (onreset %Script; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (accept-charset %Charsets; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ACTION, CHTMLNamespace.ATTR_NAME_METHOD, CHTMLNamespace.ATTR_NAME_ENCTYPE, CHTMLNamespace.ATTR_NAME_NAME,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode form = elementCollection.getNamedItem(CHTMLNamespace.ElementName.FORM);
- if (form != null)
- exclusion.appendChild(form);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java
deleted file mode 100644
index 8c484160f5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFlowContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java
deleted file mode 100644
index e8ef6f9640..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedHEAD(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HEAD, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HEAD</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * HEAD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java
deleted file mode 100644
index 732d09528a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
- /**
- */
- public HedHR(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HR, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs
- * (align (left|center|right) #IMPLIED) ... should be defined locally.
- * (noshade (noshade) #IMPLIED)
- * (size %Pixels; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (color %Color; #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (align (left|center|right) #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {CHTMLNamespace.ATTR_VALUE_LEFT, CHTMLNamespace.ATTR_VALUE_CENTER, CHTMLNamespace.ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {CHTMLNamespace.ATTR_NAME_NOSHADE, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_WIDTH,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
deleted file mode 100644
index 36c2e4adee..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedHTML(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HTML, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HTML</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
- * <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
- * </tr>
- * <tr>
- * <td>version</td><td>CDATA</td><td>#FIXED</td>
- * <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
- * </tr>
- * </tbody>
- * </table><br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- // version
- HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_VERSION);
- if (adec != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_VERSION, adec);
- }
-
- /**
- * HTML has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
deleted file mode 100644
index af3be378f6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
- /**
- */
- public HedHeading(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>H1</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- * <br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java
deleted file mode 100644
index e8454e2774..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
- /**
- */
- public HedIMG(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.IMG, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * IMG.
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (alt %Text; #REQUIRED)
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (align %IAlign; #IMPLIED): should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mapfile %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SRC, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_BORDER, CHTMLNamespace.ATTR_NAME_HSPACE, CHTMLNamespace.ATTR_NAME_VSPACE,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local); should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
deleted file mode 100644
index 29acb3aa73..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
- /**
- */
- public HedINPUT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.INPUT, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * INPUT.
- * %attrs;
- * (type %InputType; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (checked (checked) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (maxlength NUMBER #IMPLIED)
- * (src %URI; #IMPLIED)
- * (alt CDATA #IMPLIED) ... should be defined locally.
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (accept %ContentTypes; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (istyle CDATA #IMPLIED)
- * <<D215684
- * (width CDATA; #IMPLIED)
- * (height CDATA; #IMPLIED)
- * (border CDATA; #IMPLIED)
- * D215684
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %InputType; TEXT) ... should be defined locally.
- // NOTE: %InputType is ENUM;
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {CHTMLNamespace.ATTR_VALUE_TEXT, CHTMLNamespace.ATTR_VALUE_PASSWORD, CHTMLNamespace.ATTR_VALUE_CHECKBOX, CHTMLNamespace.ATTR_VALUE_RADIO, CHTMLNamespace.ATTR_VALUE_SUBMIT, CHTMLNamespace.ATTR_VALUE_RESET, CHTMLNamespace.ATTR_VALUE_HIDDEN,};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, CHTMLNamespace.ATTR_VALUE_TEXT);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_TYPE, attr);
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
- // (alt CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALT, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_VALUE, CHTMLNamespace.ATTR_NAME_CHECKED, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_MAXLENGTH, CHTMLNamespace.ATTR_NAME_SRC, CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_ALIGN, CHTMLNamespace.ATTR_NAME_ISTYLE,
- //<<D215684
- CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_BORDER
- //<D215684
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java
deleted file mode 100644
index dbd4bc94b4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
- /**
- * HedInlineContainer.
- * @param elementName java.lang.String
- * @param collection ElementCollection
- */
- public HedInlineContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java
deleted file mode 100644
index ea1f4a63a9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.LI};
-
- /**
- */
- public HedLI(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.LI, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- * (type %LIStyle; #IMPLIED) ... should be defined locally.
- * (value NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java
deleted file mode 100644
index 1f35e93674..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedListItemContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
deleted file mode 100644
index c0f0e83b06..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
- /**
- */
- public HedMENU(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * MENU/DIR.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * Exclusion.
- * <code>MENU/DIR</code> has the exclusion.
- * It is <code>%block;</code>.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.
- * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
- * %list; is : UL | OL | DIR | MENU.
- * %preformatted; is PRE.
- * <br>
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // %block;
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {CHTMLNamespace.ElementName.P, CHTMLNamespace.ElementName.H1, CHTMLNamespace.ElementName.H2, CHTMLNamespace.ElementName.H3, CHTMLNamespace.ElementName.H4, CHTMLNamespace.ElementName.H5, CHTMLNamespace.ElementName.H6, CHTMLNamespace.ElementName.UL, CHTMLNamespace.ElementName.OL, CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU, CHTMLNamespace.ElementName.PRE, CHTMLNamespace.ElementName.DL, CHTMLNamespace.ElementName.DIV, CHTMLNamespace.ElementName.CENTER, CHTMLNamespace.ElementName.BLOCKQUOTE, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.HR, CHTMLNamespace.ElementName.ADDRESS};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
deleted file mode 100644
index 172a6fb407..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
- /**
- */
- public HedMETA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.META, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * META.
- * %i18n;
- * (http-equiv NAME #IMPLIED)
- * (name NAME #IMPLIED) ... should be defined locally.
- * (content CDATA #REQUIRED)
- * (scheme CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- // (name NAME #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_NAME, attr);
-
- // 249493
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CONTENT, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_HTTP_EQUIV,
- // CHTMLNamespace.ATTR_NAME_CONTENT
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java
deleted file mode 100644
index 7e801d2065..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
- /**
- */
- public HedOL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.OL, collection);
- }
-
- /**
- * OL.
- * (type %OLStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- * (start NUMBER #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java
deleted file mode 100644
index 6df202d46e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.OPTION};
-
- /**
- */
- public HedOPTION(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.OPTION, collection);
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_END;
- }
-
- /**
- * OPTION.
- * %attrs;
- * (selected (selected) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_SELECTED, CHTMLNamespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java
deleted file mode 100644
index a92e091b70..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
- private static Collection terminators = null;
-
- /**
- */
- public HedP(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.P, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>P</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- * <br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, adec);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
- return prohibitedAncestors;
- }
-
- /**
- * Return names of terminators.
- * <code>P</code> has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- if (terminators != null)
- return terminators.iterator();
- //<<D217982
- terminators = new Vector();
- terminators.addAll(elementCollection.getNamesOfBlock());
- terminators.add(CHTMLNamespace.ElementName.LI);
- terminators.add(CHTMLNamespace.ElementName.DT);
- terminators.add(CHTMLNamespace.ElementName.DD);
- //D217982
- return terminators.iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
deleted file mode 100644
index 02f53537b1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
- /**
- * PRE element should keep spaces in its source.
- */
- public HedPRE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.PRE, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
-
- keepSpaces = true;
- }
-
- /**
- * %attrs;
- * (width NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (width NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * Exclusion.
- * <code>PRE</code> has the exclusion.
- * It is <code>%pre.exclusion;</code>.
- * %pre.exclusion is:
- * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {CHTMLNamespace.ElementName.IMG,};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java
deleted file mode 100644
index 6490df0185..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
- /**
- */
- public HedPcdata(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
- }
-
- /**
- * Content.<br>
- * PCDATA type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.PCDATA;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
deleted file mode 100644
index db036f7b0d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSELECT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SELECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %reserved;
- * (name CDATA #IMPLIED)
- * (size NUMBER #IMPLIED) ... should be defined locally.
- * (multiple (multiple) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (size NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_MULTIPLE,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
deleted file mode 100644
index fddb04df9f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
- /**
- */
- public HedSSIBase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- */
- public int getFormatType() {
- return HTMLElementDeclaration.FORMAT_SSI;
- }
-
- /**
- */
- public boolean supports(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return true;
- return super.supports(propName);
- }
-
- /*
- */
- public Object getProperty(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return new Boolean(true);
- return super.getProperty(propName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java
deleted file mode 100644
index 3b52b06414..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
- /**
- */
- public HedSSIConfig(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_CONFIG, collection);
- }
-
- /**
- * SSI:CONFIG.
- * (errmsg CDATA #IMPLIED)
- * (sizefmt CDATA #IMPLIED)
- * (timefmt CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ERRMSG, CHTMLNamespace.ATTR_NAME_SIZEFMT, CHTMLNamespace.ATTR_NAME_TIMEFMT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java
deleted file mode 100644
index 9d1b226d53..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
- /**
- */
- public HedSSIEcho(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_ECHO, collection);
- }
-
- /**
- * SSI:ECHO
- * (var CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_VAR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java
deleted file mode 100644
index 26ad58e4d4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
- /**
- */
- public HedSSIExec(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_EXEC, collection);
- }
-
- /**
- * SSI:EXEC
- * (cgi %URI; #IMPLIED)
- * (cmd CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_CGI, CHTMLNamespace.ATTR_NAME_CMD};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java
deleted file mode 100644
index 5a0cb7333c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
- /**
- */
- public HedSSIFlastmod(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_FLASTMOD, collection);
- }
-
- /**
- * SSI:FLASTMOD
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java
deleted file mode 100644
index c56f2823a4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
- /**
- */
- public HedSSIFsize(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_FSIZE, collection);
- }
-
- /**
- * SSI:FSIZE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java
deleted file mode 100644
index 220f7264a8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
- /**
- */
- public HedSSIInclude(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_INCLUDE, collection);
- }
-
- /**
- * SSI:INCLUDE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
deleted file mode 100644
index 6860996ba5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
- /**
- */
- public HedSSIPrintenv(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_PRINTENV, collection);
- }
-
- /**
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- }
-
- /**
- * SSI:PRINTENV has no attributes. So, this method should
- * always return <code>null</code>.
- * Note: Since somebody doesn't expect null is returned, return the empty attribute
- * like a custom tag which doesn't have attributes
- */
- public CMNamedNodeMap getAttributes() {
- return super.getAttributes();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java
deleted file mode 100644
index d447488828..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
- /**
- */
- public HedSSISet(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_SET, collection);
- }
-
- /**
- * SSI:SET
- * (var CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_VAR, CHTMLNamespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
deleted file mode 100644
index 18198ea54f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
- /**
- * TEXTAREA should keep spaces in its source.
- */
- public HedTEXTAREA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.TEXTAREA, collection);
- layoutType = LAYOUT_OBJECT;
-
- keepSpaces = true;
- }
-
- /**
- * TEXTAREA.
- * %attrs;
- * %reserved; ... empty
- * (name CDATA #IMPLIED)
- * (rows NUMBER #REQUIRED)
- * (cols NUMBER #REQUIRED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (istyle CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_ROWS, CHTMLNamespace.ATTR_NAME_COLS, CHTMLNamespace.ATTR_NAME_ISTYLE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
deleted file mode 100644
index e92e0ad46d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
- /**
- */
- public HedTITLE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.TITLE, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * TITLE.
- * %i18n;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * Exclusion.
- * <code>TITLE</code> has the exclusion.
- * It is <code>%head.misc;</code>.
- * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
- * <br>
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (SCRIPT|STYLE|META|LINK|OBJECT)
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
- String[] names = {CHTMLNamespace.ElementName.META,};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java
deleted file mode 100644
index a2249a8d7b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
- /**
- */
- public HedUL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.UL, collection);
- }
-
- /**
- * UL.
- * (type %ULStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java
deleted file mode 100644
index 6040a3eec9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
- boolean supports(HTMLElementDeclaration edecl);
-
- Object get(HTMLElementDeclaration edecl);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
deleted file mode 100644
index 214a2ca5ac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
- /**
- * DefaultProvider is intended to be used for unknown properties.
- * It always returns null value for any properties.
- */
- class DefaultProvider implements PropertyProvider {
- public DefaultProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return false;
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- return null;
- }
- }
-
- abstract class AbstractElementPropertyProvider implements PropertyProvider {
- protected AbstractElementPropertyProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return (edecl != null);
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- if (!(edecl instanceof HTMLPropertyDeclaration))
- return null;
- return getElementProperty((HTMLPropertyDeclaration)edecl);
- }
-
- abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
- }
-
- /*
- * "tagInfo"
- * gets documentation for the element
- */
- class PPTagInfo extends AbstractElementPropertyProvider {
- private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
- protected AnnotationMap fAnnotationMap = null;
-
- public PPTagInfo() {
- super();
- }
-
- /**
- * Gets the annotationMap.
- * @return Returns a AnnotationMap
- */
- protected AnnotationMap getAnnotationMap() {
- if (fAnnotationMap == null) {
- fAnnotationMap = new AnnotationMap();
- try {
- fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
- }
- catch (Exception e) {
- // no annotation available
- }
- }
- return fAnnotationMap;
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl instanceof HTMLElementDeclaration) {
- return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
- } else {
- return null;
- }
- }
- }
-
- /*
- * "shouldKeepSpace"
- */
- class PPShouldKeepSpace extends AbstractElementPropertyProvider {
- public PPShouldKeepSpace() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldKeepSpaces());
- }
- }
-
- /*
- * "shouldIndentChildSource"
- */
- class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
- public PPShouldIndentChildSource() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldIndentChildSource());
- }
- }
-
- /*
- * "terminators"
- */
- class PPTerminators extends AbstractElementPropertyProvider {
- public PPTerminators() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl == null)
- return null;
- if (! (decl instanceof HTMLElemDeclImpl)) return null;
- return ((HTMLElemDeclImpl)decl).getTerminators();
- }
- }
-
- /*
- * "prohibitedAncestors"
- */
- class PPProhibitedAncestors extends AbstractElementPropertyProvider {
- public PPProhibitedAncestors() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getProhibitedAncestors();
- }
- }
-
- /*
- * "isJSP"
- */
- class PPIsJSP extends AbstractElementPropertyProvider {
- public PPIsJSP() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.isJSP());
- }
- }
-
- /*
- * "isXHTML"
- * HTMLElementDeclaration itself never represent any XHTML element declaration.
- * So, this property must be always false.
- */
- class PPIsXHTML extends AbstractElementPropertyProvider {
- public PPIsXHTML() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "isSSI"
- * Each declaration class for SSI elements must provide this property itself,
- * and then return true. Other declaration must always return false.
- */
- class PPIsSSI extends AbstractElementPropertyProvider {
- public PPIsSSI() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "lineBreakHint"
- */
- class PPLineBreakHint extends AbstractElementPropertyProvider {
- public PPLineBreakHint() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String hint = HTMLCMProperties.Values.BREAK_NONE;
- switch (decl.getLineBreakHint()) {
- case HTMLElementDeclaration.BREAK_AFTER_START :
- hint = HTMLCMProperties.Values.BREAK_AFTER_START;
- break;
- case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
- hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
- break;
- case HTMLElementDeclaration.BREAK_NONE :
- // nothing to do
- default :
- break;
- }
- return hint;
- }
- }
-
- /*
- * "layoutType"
- */
- class PPLayoutType extends AbstractElementPropertyProvider {
- public PPLayoutType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.LAYOUT_NONE;
- switch (decl.getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- type = HTMLCMProperties.Values.LAYOUT_BLOCK;
- break;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- type = HTMLCMProperties.Values.LAYOUT_BREAK;
- break;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
- break;
- case HTMLElementDeclaration.LAYOUT_OBJECT :
- type = HTMLCMProperties.Values.LAYOUT_OBJECT;
- break;
- case HTMLElementDeclaration.LAYOUT_WRAP :
- type = HTMLCMProperties.Values.LAYOUT_WRAP;
- break;
- case HTMLElementDeclaration.LAYOUT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "omitType"
- */
- class PPOmitType extends AbstractElementPropertyProvider {
- public PPOmitType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.OMIT_NONE;
- switch (decl.getOmitType()) {
- case HTMLElementDeclaration.OMIT_BOTH :
- type = HTMLCMProperties.Values.OMIT_BOTH;
- break;
- case HTMLElementDeclaration.OMIT_END :
- type = HTMLCMProperties.Values.OMIT_END;
- break;
- case HTMLElementDeclaration.OMIT_END_DEFAULT :
- type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
- break;
- case HTMLElementDeclaration.OMIT_END_MUST :
- type = HTMLCMProperties.Values.OMIT_END_MUST;
- break;
- case HTMLElementDeclaration.OMIT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "inclusion"
- */
- class PPInclusion extends AbstractElementPropertyProvider {
- public PPInclusion() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getInclusion();
- }
- }
-
- public static PropertyProvider getProvider(String propName) {
- PropertyProviderFactory factory = getInstance();
- PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
- if (pp != null)
- return pp;
-
- pp = factory.create(propName);
- if (pp == null)
- return factory.defaultProvider;
-
- factory.registry.put(propName, pp);
- return pp;
- }
-
- private static PropertyProviderFactory instance = null;
-
- private synchronized static PropertyProviderFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new PropertyProviderFactory();
- return instance;
- }
-
- private Hashtable registry = new Hashtable();
- private PropertyProvider defaultProvider = new DefaultProvider();
-
- private PropertyProviderFactory() {
- super();
- }
-
- private PropertyProvider create(String propName) {
- PropertyProvider pp = null;
- if (propName.equals(HTMLCMProperties.IS_JSP))
- pp = new PPIsJSP();
- else if (propName.equals(HTMLCMProperties.IS_XHTML))
- pp = new PPIsXHTML();
- else if (propName.equals(HTMLCMProperties.IS_SSI))
- pp = new PPIsSSI();
- else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
- pp = new PPLayoutType();
- else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
- pp = new PPLineBreakHint();
- else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
- pp = new PPProhibitedAncestors();
- else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
- pp = new PPShouldKeepSpace();
- else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
- pp = new PPShouldIndentChildSource();
- else if (propName.equals(HTMLCMProperties.TERMINATORS))
- pp = new PPTerminators();
- else if (propName.equals(HTMLCMProperties.TAGINFO))
- pp = new PPTagInfo();
- else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
- pp = new PPOmitType();
- else if (propName.equals(HTMLCMProperties.INCLUSION))
- pp = new PPInclusion();
-
- return pp;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
deleted file mode 100644
index 3a4dfd70e4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.ssi;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * CMDocument factory for SSI documents.
- */
-public final class SSICMDocumentFactory {
-
- private final static String PREFIX = "SSI";//$NON-NLS-1$
- private final static String DOC_TYPE_NAME = "SSI";//$NON-NLS-1$
-
- static class CMNamespaceImpl implements CMNamespace {
- public CMNamespaceImpl() {
- super();
- }
-
- public String getPrefix() {
- return PREFIX;
- }
-
- public String getURI() {
- return ""; //$NON-NLS-1$
- }
-
- public String getNodeName() {
- return DOC_TYPE_NAME;
- }
-
- public int getNodeType() {
- return CMNode.NAME_SPACE;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- }
-
- static class CMDocImpl implements CMDocument {
- private static CMDocument hcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
- static class Elements implements CMNamedNodeMap {
- private static String[] names = {HTML40Namespace.ElementName.SSI_CONFIG, HTML40Namespace.ElementName.SSI_ECHO, HTML40Namespace.ElementName.SSI_EXEC, HTML40Namespace.ElementName.SSI_FSIZE, HTML40Namespace.ElementName.SSI_FLASTMOD, HTML40Namespace.ElementName.SSI_INCLUDE, HTML40Namespace.ElementName.SSI_PRINTENV, HTML40Namespace.ElementName.SSI_SET};
- private Hashtable map = new Hashtable();
-
- public Elements() {
- CMNamedNodeMap elems = hcm.getElements();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMElementDeclaration dec = (CMElementDeclaration) elems.getNamedItem(name);
- if (dec != null)
- map.put(name, dec);
- }
- }
-
- public int getLength() {
- return map.size();
- }
-
- public CMNode getNamedItem(String name) {
- String cooked = getCanonicalName(name);
- if (!map.containsKey(cooked))
- return null;
- return (CMNode) map.get(cooked);
- }
-
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- Object node = iter.next();
- if (--index < 0)
- return (CMNode) node;
- }
- return null;
- }
-
- public Iterator iterator() {
- return map.values().iterator();
- }
-
- private String getCanonicalName(String rawName) {
- return rawName.toUpperCase();
- }
- }
-
- static private Elements elements = new Elements();
-
-
- public CMDocImpl() {
- super();
- }
-
- public String getNodeName() {
- return ""; //$NON-NLS-1$
- }
-
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- public CMNamedNodeMap getEntities() {
- return null;
- }
-
- public CMNamespace getNamespace() {
- return ssins;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
- }
-
- private static CMNamespace ssins = new CMNamespaceImpl();
- private static CMDocument mycm = new CMDocImpl();
-
- private SSICMDocumentFactory() {
- super();
- }
-
- public static CMDocument getCMDocument() {
- return mycm;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
deleted file mode 100644
index f76fd8e23b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.html.core.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by HTML. Clients should only read and modify the
- * HTML properties programmatically using this class.
- *
- * @since 1.1
- */
-public class HTMLContentProperties {
- static final String HTMLCORE_ID = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
- /**
- * The default document type to use when none is specified.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
-
- /**
- * Generates a preference key based on resourcePath
- *
- * @param resourcePath
- * the path the key will be based off of
- * @return preference key based on resourcePath (basically the
- * resourcePath without the filename); PROJECT_KEY if resourcePath
- * is null
- */
- static String getKeyFor(IPath resourcePath) {
- String key = PROJECT_KEY;
- if (resourcePath != null && resourcePath.segmentCount() > 1) {
- key = resourcePath.removeFirstSegments(1).toString();
- }
- return key;
- }
-
- /**
- * Get the preferences node associated with the given project scope and
- * preference key (subNode) If create is true, the preference node will be
- * created if one does not already exist
- *
- * @param project
- * the project the preference node is under
- * @param preferenceKey
- * the subnode/category the preference node is located in
- * @param create
- * if true, a preference node will be created if one does not
- * already exist
- * @return Preferences associated with the given project scope and
- * preference key. null if one could not be found and create is
- * false
- */
- static Preferences getPreferences(IProject project, String preferenceKey, boolean create) {
- if (create)
- // create all nodes down to the one we are interested in
- return new ProjectScope(project).getNode(HTMLCORE_ID).node(preferenceKey);
- // be careful looking up for our node so not to create any nodes as
- // side effect
- Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE);
- try {
- // TODO once bug 90500 is fixed, should be as simple as this:
- // String path = project.getName() + IPath.SEPARATOR +
- // ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR +
- // ENCODING_PREF_NODE;
- // return node.nodeExists(path) ? node.node(path) : null;
- // for now, take the long way
- if (!node.nodeExists(project.getName()))
- return null;
- node = node.node(project.getName());
- if (!node.nodeExists(HTMLCORE_ID))
- return null;
- node = node.node(HTMLCORE_ID);
- if (!node.nodeExists(preferenceKey))
- return null;
- return node.node(preferenceKey);
- }
- catch (BackingStoreException e) {
- // nodeExists failed
- Logger.log(Logger.WARNING_DEBUG, "Could not retrieve preference node", e); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Returns the value for the given key in the given context.
- *
- * @param key
- * The property key
- * @param resource
- * The current context or <code>null</code> if no context is
- * available and the workspace setting should be taken. Note
- * that passing <code>null</code> should be avoided.
- * @param recurse
- * whether the parent should be queried till property is found
- * @return Returns the current value for the key.
- * @since 1.1
- */
- public static String getProperty(String key, IResource resource, boolean recurse) {
- String val = null;
- // boolean preferenceFound = false;
- if (resource != null) {
- IProject project = resource.getProject();
- if (project != null) {
- Preferences preferences = getPreferences(project, key, false);
- if (preferences != null) {
- val = internalGetProperty(resource, recurse, preferences);
- // preferenceFound = true;
- }
- }
- }
- // Workbench preference may not be needed so leave out for now
- // // no preferences found - for performance reasons,
- // // short-circuit
- // // lookup by falling back to workspace's default
- // // setting
- // if (!preferenceFound)
- // val = getWorkbenchPreference(key);
- return val;
- }
-
- private static String internalGetProperty(IResource resource, boolean recurse, Preferences preferences) {
- String value = preferences.get(getKeyFor(resource.getFullPath()), null);
- if (value == null && resource != resource.getProject() && recurse) {
- value = preferences.get(getKeyFor(null), null);
- }
-
- // Workbench preference may not be needed so leave out for now
- // // ensure we default to the workspace preference if none is found
- // return value == null ? getWorkbenchPreference(key) : value;
- return value;
- }
-
- /**
- * Sets the value for the given key in the given context.
- *
- * @param key
- * The property key
- * @param resource
- * The current context. Note context cannot be
- * <code>null</code>.
- * @param value
- * The value to set for the key. If value is <code>null</code>
- * the key is removed from properties.
- * @since 1.1
- */
- public static void setProperty(String key, IResource resource, String value) throws CoreException {
- if (resource != null) {
- IProject project = resource.getProject();
- if (project != null) {
- Preferences preferences = getPreferences(project, key, true);
- if (value == null)
- preferences.remove(getKeyFor(resource.getFullPath()));
- else
- preferences.put(getKeyFor(resource.getFullPath()), value);
- try {
- // save changes
- preferences.flush();
- }
- catch (BackingStoreException e) {
- throw new CoreException(new Status(IStatus.ERROR, HTMLCORE_ID, IStatus.ERROR, "Unable to set property", e)); //$NON-NLS-1$
- }
- }
- }
- // Workbench preference may not be needed so leave out for now
- // just set a preference in the instance scope
- // if (!preferenceFound) {
- // setWorkbenchPreference(key);
- // }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
deleted file mode 100644
index 41f03c8a94..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentproperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class HTMLContentPropertiesManager {
- public HTMLContentPropertiesManager() {
- super();
- fResourceChangeListener = new ResourceChangeListener();
- fJob = new ContentPropertiesManagerJob();
- }
-
- private static HTMLContentPropertiesManager _instance = null;
- private IResourceChangeListener fResourceChangeListener;
- ContentPropertiesManagerJob fJob;
-
- /**
- * This job implementation is used to allow the resource change listener
- * to schedule operations that need to modify the workspace.
- */
- private class ContentPropertiesManagerJob extends Job {
- private static final int PROPERTIES_UPDATE_DELAY = 500;
- private List asyncChanges = new ArrayList();
-
- public ContentPropertiesManagerJob() {
- super(HTMLCoreMessages.HTMLContentPropertiesManager_Updating);
- setSystem(true);
- setPriority(Job.INTERACTIVE);
- }
-
- public void addChanges(Set newChanges) {
- if (newChanges.isEmpty())
- return;
- synchronized (asyncChanges) {
- asyncChanges.addAll(newChanges);
- asyncChanges.notify();
- }
- schedule(PROPERTIES_UPDATE_DELAY);
- }
-
- public IProject getNextChange() {
- synchronized (asyncChanges) {
- return asyncChanges.isEmpty() ? null : (IProject) asyncChanges.remove(asyncChanges.size() - 1);
- }
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- MultiStatus result = new MultiStatus(HTMLContentProperties.HTMLCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, HTMLCoreMessages.HTMLContentPropertiesManager_Updating, null);
- monitor = monitor == null ? new NullProgressMonitor() : monitor;
- try {
- monitor.beginTask(HTMLCoreMessages.HTMLContentPropertiesManager_Updating, asyncChanges.size());
- try {
- IProject next;
- while ((next = getNextChange()) != null) {
- // just exit if the system is shutting down or has
- // been shut down
- // it is too late to change the workspace at this
- // point anyway
- if (Platform.getBundle("org.eclipse.osgi").getState() != Bundle.ACTIVE) //$NON-NLS-1$
- return Status.OK_STATUS;
- try {
- // save the preferences nodes
- if (next.isAccessible()) {
- // save document type preferences
- Preferences projectPrefs = HTMLContentProperties.getPreferences(next, HTMLContentProperties.DOCUMENT_TYPE, false);
- if (projectPrefs != null)
- projectPrefs.flush();
- }
- }
- catch (BackingStoreException e) {
- // we got an error saving
- String detailMessage = NLS.bind(HTMLCoreMessages.HTMLContentPropertiesManager_Problems_Updating, next.getFullPath());
- result.add(new Status(1 << (IResourceStatus.FAILED_SETTING_CHARSET % 100 / 33), ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_SETTING_CHARSET, detailMessage, e));
- }
- }
- monitor.worked(1);
- }
- catch (OperationCanceledException e) {
- throw e;
- }
- }
- finally {
- monitor.done();
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- public boolean shouldRun() {
- synchronized (asyncChanges) {
- return !asyncChanges.isEmpty();
- }
- }
- }
-
- class ResourceChangeListener implements IResourceChangeListener {
- private void processEntryChanges(IResourceDelta projectDelta, Set projectsToSave) {
- // check each resource with web content setting to see if it has
- // been moved/deleted
- boolean resourceChanges = false;
-
- // project affected
- IProject currentProject = (IProject) projectDelta.getResource();
-
- resourceChanges = processPreferences(currentProject, HTMLContentProperties.DOCUMENT_TYPE, projectDelta, projectsToSave);
-
- // if there was a preference key change, need to save preferences
- if (resourceChanges)
- projectsToSave.add(currentProject);
- }
-
- /**
- * Goes through all the resource-dependent preferences associated with
- * currentProject & key and updates the preference keys if needed
- * based on projectDelta
- *
- * @param currentProject
- * current project of the preferences to be looked at
- * @param key
- * current key/subcategory of the preferences to be looked
- * at
- * @param projectDelta
- * the changes to process the preference keys against
- * @param projectsToSave
- * the projects that need to be updated/saved
- * @return true if currentProject's preferences were modified
- */
- private boolean processPreferences(IProject currentProject, String key, IResourceDelta projectDelta, Set projectsToSave) {
- boolean resourceChanges = false;
-
- // get the project-key preference node
- Preferences projectPrefs = HTMLContentProperties.getPreferences(currentProject, key, false);
- if (projectPrefs == null)
- // no preferences for this project-key, just bail
- return false;
- String[] affectedResources;
- try {
- affectedResources = projectPrefs.keys();
- }
- catch (BackingStoreException e) {
- // problems with the project scope... we gonna miss the
- // changes (but will log)
- Logger.log(Logger.WARNING_DEBUG, "Problem retreiving JSP Fragment preferences", e); //$NON-NLS-1$
- return false;
- }
-
- // go through each preference key (which is really a file name)
- for (int i = 0; i < affectedResources.length; i++) {
- // see if preference key/file name was file that was changed
- IResourceDelta memberDelta = projectDelta.findMember(new Path(affectedResources[i]));
- // no changes for the given resource
- if (memberDelta == null)
- continue;
- if (memberDelta.getKind() == IResourceDelta.REMOVED) {
- resourceChanges = true;
- // remove the setting for the original location
- String currentValue = projectPrefs.get(affectedResources[i], null);
- projectPrefs.remove(affectedResources[i]);
- if ((memberDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
- // if moving, copy the setting for the new location
- IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(memberDelta.getMovedToPath().segment(0));
- Preferences targetPrefs = HTMLContentProperties.getPreferences(targetProject, key, true);
- targetPrefs.put(HTMLContentProperties.getKeyFor(memberDelta.getMovedToPath()), currentValue);
- if (targetProject != currentProject)
- projectsToSave.add(targetProject);
- }
- }
- }
- return resourceChanges;
- }
-
- /**
- * For any change to the encoding file or any resource with encoding
- * set, just discard the cache for the corresponding project.
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta == null)
- return;
- IResourceDelta[] projectDeltas = delta.getAffectedChildren();
- // process each project in the delta
- Set projectsToSave = new HashSet();
- for (int i = 0; i < projectDeltas.length; i++)
- // nothing to do if a project has been added/removed/moved
- if (projectDeltas[i].getKind() == IResourceDelta.CHANGED && (projectDeltas[i].getFlags() & IResourceDelta.OPEN) == 0)
- processEntryChanges(projectDeltas[i], projectsToSave);
- fJob.addChanges(projectsToSave);
- }
- }
-
- public synchronized static void startup() {
- _instance = new HTMLContentPropertiesManager();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(_instance.fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
- }
-
- public synchronized static void shutdown() {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(_instance.fResourceChangeListener);
- _instance = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index 8b359e683a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- }
- catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- // createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index be155cf238..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- *
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
-
- public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
- protected byte[] fBuffer;
-
- protected InputStream fInputStream;
-
- protected ByteReader() {
- super();
- }
-
- public ByteReader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE);
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- }
-
- public ByteReader(InputStream inputStream, int size) {
- this.fInputStream = inputStream;
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- this.fBuffer = new byte[size];
-
- }
-
- public void close() throws IOException {
- this.fInputStream.close();
- }
-
- public void mark(int readAheadLimit) {
- this.fInputStream.mark(readAheadLimit);
- }
-
- public boolean markSupported() {
- return fInputStream.markSupported();
- }
-
- public int read() throws IOException {
- int b0 = this.fInputStream.read();
- return (b0 & 0x00FF);
- }
-
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > this.fBuffer.length) {
- length = this.fBuffer.length;
- }
-
- int count = this.fInputStream.read(this.fBuffer, 0, length);
-
- for (int i = 0; i < count; i++) {
- int b0 = this.fBuffer[i];
- // the 0x00FF is to "lose" the negative bits filled in the byte to
- // int conversion
- // (and which would be there if cast directly from byte to char).
- char c0 = (char) (b0 & 0x00FF);
- ch[offset + i] = c0;
- }
- return count;
- }
-
- public boolean ready() throws IOException {
- return this.fInputStream.available() > 0;
- }
-
- public void reset() throws IOException {
- this.fInputStream.reset();
- }
-
- public long skip(long n) throws IOException {
- return this.fInputStream.skip(n);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java
deleted file mode 100644
index 8a7098359a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-/**
- *
- * ContentDescriberForHTML
- *
- * A few design principles to remember with content describers:
- * <ul>
- * <li>Remember not to store values/data in the descriptions array of properties,
- * especially not large objects! and even no value that is already the default value,
- * since those description properties are cached per session, so can add up in memory.
- * <li>Remember that a ContentDescriber instance becomes a "root object" in the
- * ContentDescriberManager (that is, always in memory, never GC'd), so it should
- * not have any instance or state data since it would always become stale and
- * "hold on" to objects unneccessarily.
- * </ul>
- */
-
-public final class ContentDescriberForHTML implements ITextContentDescriber {
-
- final private static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.INDETERMINATE;
-
- if (description == null) {
- result = computeValidity(contents);
- }
- else {
- calculateSupportedOptions(contents, description);
- // assummming we should return same 'validity' value we did
- // when called before. (technically, could be a performance issue
- // in future, so might want to check if any 'ol value would
- // be ok here.
- result = computeValidity(contents);
- }
-
- return result;
- }
-
- public int describe(Reader contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.INDETERMINATE;
-
- if (description == null) {
- result = computeValidity(contents);
- }
- else {
- calculateSupportedOptions(contents, description);
- // assummming we should return same 'validity' value we did
- // when called before. (technically, could be a performance issue
- // in future, so might want to check if hard coded 'valid' would
- // be ok here.
- result = computeValidity(contents);
- }
-
- return result;
- }
-
- public QualifiedName[] getSupportedOptions() {
-
- return SUPPORTED_OPTIONS;
- }
-
- private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /**
- * @param contents
- * @param description
- * @throws IOException
- */
- private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- private int computeValidity(InputStream inputStream) {
- // currently no contents specific check for valid HTML contents
- // (this may change once we add XHTML content type)
- return IContentDescriber.INDETERMINATE;
- }
-
- private int computeValidity(Reader reader) {
- // currently no contents specific check for valid HTML contents
- // (this may change once we add XHTML content type)
- return IContentDescriber.INDETERMINATE;
- }
-
- private IResourceCharsetDetector getDetector() {
-
- return new HTMLResourceEncodingDetector();
-
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-
- EncodingMemento encodingMemento = ((HTMLResourceEncodingDetector) detector).getEncodingMemento();
- // TODO: I need to verify to see if this BOM work is always done
- // by text type.
- Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
- if (detectedByteOrderMark != null) {
- Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- // not sure why would ever be different, so if is different, may
- // need to "push" up into base.
- if (!detectedByteOrderMark.equals(existingByteOrderMark))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
- }
-
-
- if (!encodingMemento.isValid()) {
- /*
- * note: after setting here, its the mere presence of
- * IContentDescriptionExtended.UNSUPPORTED_CHARSET in the
- * resource's description that can be used to determine if invalid
- * in those cases, the "detected" property contains an
- * "appropriate default" to use.
- */
- description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
- description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
- }
-
- Object detectedCharset = encodingMemento.getDetectedCharsetName();
- Object javaCharset = encodingMemento.getJavaCharsetName();
-
- // we always include detected, if its different than java
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
- if (javaCharset != null) {
- Object existingCharset = description.getProperty(IContentDescription.CHARSET);
- if (javaCharset.equals(existingCharset)) {
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
- }
- else {
- // we may need to add what we found, but only need to add
- // if different from default.the
- Object defaultCharset = detector.getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- else {
- // assuming if there is no spec default, we always need to
- // add, I'm assuming
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
-
- }
-
- private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
- // since equal, we don't need to add, but if our detected version is
- // different than
- // javaCharset, then we should add it. This will happen, for example,
- // if there's
- // differences in case, or differences due to override properties
- if (detectedCharset != null) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- // else if
- // (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
- // result = true;
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
deleted file mode 100644
index 7656fba0e1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-/**
- *
- * This is ported from PageDesigner's hpbcom/Kanji.cpp's
- * Kanji::guess_kanji_code(),
- *
- */
-public class EncodingGuesser {
- private static final int ASCII = 0; // ASCII
- // ISO-2022-JP
- private static final int ASCII_IN = 8; // This is after ISO2022's change
- // Shift-JIS
- private static final int EUC_HALFKANA = 6; // This is Half Kana in EUC-JP
- private static final int EUC_JP = 3; // This is EUC-JP
- private static final int ISO2022_JP = 4; // This is ISO-2022-JP
- private static final int JIS_HALFKANA = 7; // THis is Half Kana in
- private static final byte KT_EUC1 = 0x40;
- private static final byte KT_EUC2 = (byte) 0x80;
- // ASCII
- private static final byte KT_JIN = 0x01;
- private static final byte KT_JOUT = 0x02;
- // private static final byte KT_ESC = 0x04;
- // private static final byte KT_JIS = 0x08;
- private static final byte KT_SFT1 = 0x10;
- private static final byte KT_SFT2 = 0x20;
- private static final byte ktype[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, /* !"#$%&' *//* " */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* ()*+,-./ */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 01234567 */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 89:; <=>? */
- 0x29, 0x28, 0x2b, 0x28, 0x28, 0x28, 0x28, 0x28, /* @ABCDEFG */
- 0x2a, 0x28, 0x2a, 0x28, 0x28, 0x28, 0x28, 0x28, /* HIJKLMNO */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* PQRSTUVW */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* XYZ[\]^_ */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* abcdefg */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* hijklmno */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* pqrstuvw */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, /* xyz{|}~ */
- 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 80 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 90 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* A0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* B0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* C0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* D0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* E0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* F0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xc0, (byte) 0xc0, 0x00,};
- // private static final int ISO8859_1 = 1; // ISO-1
- private static final int SHIFT_JIS = 2; // This is Shift-JIS
- private static final int SJIS_HALFKANA = 5; // This is Half Kana in
-
- /**
- * Currently, only Japanese encodings are supported.
- */
- private static final int UNKNOWN = -1; // Unknown
-
- /**
- * @return java.lang.String
- * @param code
- * int
- *
- * Convert private int to IANA Encoding name.
- */
- private static String convertToIANAEncodingName(int code) {
- String encoding = null;
-
- switch (code) {
- case SHIFT_JIS :
- case SJIS_HALFKANA :
- encoding = "Shift_JIS";//$NON-NLS-1$
- break;
- case EUC_JP :
- case EUC_HALFKANA :
- encoding = "EUC-JP";//$NON-NLS-1$
- break;
- case ISO2022_JP :
- case JIS_HALFKANA :
- encoding = "ISO-2022-JP";//$NON-NLS-1$
- default :
- break;
- }
-
- return encoding;
- }
-
- public static boolean canGuess() {
- // Currently, only Japanese is supported.
- String system_ctype = java.util.Locale.getDefault().getLanguage();
- String jp_ctype = java.util.Locale.JAPANESE.getLanguage();
- return system_ctype.compareTo(jp_ctype) == 0;
- }
-
- /**
- * 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;
-
-
- if (canGuess()) {
- // Ok, I'm under ja_JP.
- code = ASCII;
- int pos = 0;
- while ((code == ASCII) && (length > 0)) {
- int ch1 = target[pos];
- ch1 = ch1 & 0x000000FF;
- int ch2 = (length >= 2) ? target[pos + 1] : 0;
- ch2 = ch2 & 0x000000FF;
- int ch3 = (length >= 3) ? target[pos + 2] : 0;
- ch3 = ch3 & 0x000000FF;
- code = guessJapaneseKanjiCode(ch1, ch2, ch3, 0);
- pos++;
- length--;
- }
- switch (code) {
- case ISO2022_JP :
- case JIS_HALFKANA :
- code = ISO2022_JP;
- break;
- case EUC_JP :
- code = EUC_JP;
- break;
- default :
- code = SHIFT_JIS;
- }
- }
- return (convertToIANAEncodingName(code));
- }
-
- /**
- * Guess the encoding. halfkana_flag = 0x01 ( detect SJIS half kana )
- * halfkana_flag = 0x02 ( detect EUC half kana )
- */
- private static int guessJapaneseKanjiCode(int ch1, int ch2, int ch3, int halfkana_flag) {
- boolean sjis_hankaku_flag = ((halfkana_flag & 0x01) != 0) ? true : false;
- boolean euc_hankaku_flag = ((halfkana_flag & 0x02) != 0) ? true : false;
-
- if (ch1 == 0)
- return UNKNOWN;
- if (sjis_hankaku_flag && ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (euc_hankaku_flag && ch1 == 0x8e && ch2 >= 0xa1 && ch2 <= 0xdf)
- return EUC_HALFKANA;
- else if (((ktype[ch1] & KT_SFT1) != 0) && ((ktype[ch2] & KT_SFT2) != 0))
- return SHIFT_JIS;
- else if (((ktype[ch1] & KT_EUC1) != 0) && ((ktype[ch2] & KT_EUC2) != 0))
- return EUC_JP;
- else if (ch1 == 0x1b && ((ktype[ch2] & KT_JIN) != 0))
- return ISO2022_JP;
- else if (ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ch3 == 0x49/* 'I' */)
- return JIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ((ktype[ch3] & KT_JOUT) != 0))
- return ASCII_IN;
-
- return ASCII;
- }
-
- public EncodingGuesser() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
deleted file mode 100644
index a6a27fa524..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
+++ /dev/null
@@ -1,3193 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 11/2/10 2:04 PM */
-
-/*******************************************************************************
- * Copyright (c) 2004, 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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.html.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 11/2/10 2:04 PM from the specification file
- * <tt>file:/C:/dev/workspaces/indigo/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex</tt>
- */
-public class HTMLHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_META_TAG = 4;
- final public static int YYINITIAL = 0;
- final public static int UnDelimitedString = 12;
- final public static int DQ_STRING = 8;
- final public static int UnDelimitedCharset = 14;
- final public static int SQ_STRING = 10;
- final public static int ST_XMLDecl = 2;
- final public static int QuotedAttributeValue = 6;
-
- /**
- * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
- * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
- * at the beginning of a line
- * l is of the form l = 2*k, k a non negative integer
- */
- private final static int YY_LEXSTATE[] = {
- 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8
- };
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\1\11\10\0\1\6\1\7\2\0\1\10\22\0\1\6\1\23\1\40"+
- "\2\0\1\56\1\0\1\41\5\0\1\53\1\44\1\35\1\0\1\50"+
- "\1\0\1\45\5\0\1\51\1\42\1\57\1\13\1\12\1\52\1\14"+
- "\1\0\1\22\1\33\1\26\1\24\1\20\1\0\1\47\1\31\1\34"+
- "\2\0\1\17\1\16\1\36\1\25\1\30\1\54\1\46\1\37\1\21"+
- "\1\32\1\55\1\43\1\15\1\27\7\0\1\22\1\33\1\26\1\24"+
- "\1\20\1\0\1\47\1\31\1\34\2\0\1\17\1\16\1\36\1\25"+
- "\1\30\1\54\1\46\1\37\1\21\1\32\1\55\1\43\1\15\1\27"+
- "\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3"+
- "\16\0\1\1\1\2\170\0\1\2\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- //private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- //private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
- private boolean hasMore = true;
- private boolean hasCharsetAttr = false;
- private final static int MAX_TO_SCAN = 8000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
- boolean foundContentTypeValue = false;
- private boolean isXHTML;
-
-
-
- public HTMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- // yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
- // yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
- hasCharsetAttr = false;
- isXHTML = false;
-
- // 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;
- HeadParserToken result = null;
- try {
- context = primGetNextToken();
- }
- catch (IllegalStateException e) {
- hasMore = false;
- result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());
- while(yy_advance() != YYEOF) {}
- return result;
- }
- 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());
-
- }
- public final boolean hasCharsetAttr() {
- return hasCharsetAttr;
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
- public boolean isXHTML() {
- return isXHTML;
- }
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public HTMLHeadTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public HTMLHeadTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 192) {
- 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 {
- IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());
- System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);
- throw ise;
- }
- 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;
-
- yy_pushbackPos = -1;
- boolean yy_was_pushback;
-
- 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_was_pushback = false;
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_pushback = false;
- 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 = 10; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 3: 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;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 12; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 15; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 11: yy_isFinal = true; yy_state = 17; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
- }
-
- case 2:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 18; break yy_forNext;
- case 12: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 16: yy_isFinal = true; yy_state = 20; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
- }
-
- case 3:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 21; break yy_forNext;
- case 22: yy_isFinal = true; yy_state = 22; break yy_forNext;
- case 25: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 29: yy_isFinal = true; yy_state = 24; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 25; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
- }
-
- case 4:
- switch (yy_input) {
- case 6:
- case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 7: yy_isFinal = true; yy_state = 28; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- }
-
- case 5:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
- case 12:
- case 29: yy_isFinal = true; yy_state = 35; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
- }
-
- case 6:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 29: yy_isFinal = true; yy_state = 35; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 36; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
- case 46: yy_isFinal = true; yy_state = 38; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
- }
-
- case 7:
- switch (yy_input) {
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 29: yy_isFinal = true; yy_state = 35; break yy_forNext;
- case 12: yy_isFinal = true; yy_state = 38; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 40; break yy_forNext;
- case 32:
- case 33: yy_isFinal = true; yy_state = 41; break yy_forNext;
- case 47: yy_isFinal = true; yy_pushbackPos = yy_currentPos; yy_pushback = true; yy_state = 42; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
- }
-
- case 8:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
- }
-
- case 10:
- switch (yy_input) {
- case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 11:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 12:
- switch (yy_input) {
- case 4: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 13:
- switch (yy_input) {
- case 11: yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 14:
- switch (yy_input) {
- case 9: yy_state = 48; break yy_forNext;
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 15:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 52; break yy_forNext;
- case 9: yy_state = 53; break yy_forNext;
- case 11: yy_state = 54; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 16:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 52; break yy_forNext;
- case 11: yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 17:
- switch (yy_input) {
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- case 9: yy_state = 56; break yy_forNext;
- case 12: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 18:
- switch (yy_input) {
- case 12: yy_state = 58; break yy_forNext;
- case 16: yy_state = 59; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 19:
- switch (yy_input) {
- case 9: yy_state = 60; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 20:
- switch (yy_input) {
- case 9: yy_state = 62; break yy_forNext;
- case 30: yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 21:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 25; break yy_forNext;
- case 22: yy_state = 64; break yy_forNext;
- case 25: yy_state = 65; break yy_forNext;
- case 29: yy_state = 66; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 22:
- switch (yy_input) {
- case 9: yy_state = 67; break yy_forNext;
- case 25: yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 23:
- switch (yy_input) {
- case 9: yy_state = 69; break yy_forNext;
- case 17: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 24:
- switch (yy_input) {
- case 9: yy_state = 71; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 25:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 73; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 27:
- switch (yy_input) {
- case 6:
- case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 7: yy_state = 74; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 75; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- }
-
- case 28:
- switch (yy_input) {
- case 6:
- case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 7: yy_state = 74; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 75; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- }
-
- case 29:
- switch (yy_input) {
- case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_state = 74; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 30:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 76; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 31:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 77; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 33:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 78; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 34:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
- case 12:
- case 29: yy_state = 79; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 35:
- switch (yy_input) {
- case 9: yy_state = 80; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 36:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 82; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 37:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 36; break yy_forNext;
- case 29: yy_state = 79; break yy_forNext;
- case 46: yy_state = 83; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 38:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 9: yy_state = 84; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 39:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 85; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 40:
- switch (yy_input) {
- case 11:
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
- case 32:
- case 33: yy_isFinal = true; yy_state = 41; break yy_forNext;
- case 29: yy_state = 79; break yy_forNext;
- case 12: yy_state = 83; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 41:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 86; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 42:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_pushback = true; yy_state = 87; break yy_forNext;
- case 9: yy_state = 88; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 46:
- switch (yy_input) {
- case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 89; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 47:
- switch (yy_input) {
- case 9: yy_state = 48; break yy_forNext;
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 48:
- switch (yy_input) {
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 49:
- switch (yy_input) {
- case 9: yy_state = 90; break yy_forNext;
- case 16: yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 50:
- switch (yy_input) {
- case 9: yy_state = 92; break yy_forNext;
- case 20: yy_state = 93; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 51:
- switch (yy_input) {
- case 9: yy_state = 94; break yy_forNext;
- case 17: yy_state = 95; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 52:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 52; break yy_forNext;
- case 9: yy_state = 53; break yy_forNext;
- case 11: yy_state = 54; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 53:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 52; break yy_forNext;
- case 11: yy_state = 54; break yy_forNext;
- case 9: yy_state = 96; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 54:
- switch (yy_input) {
- case 12: yy_state = 57; break yy_forNext;
- case 9: yy_state = 97; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 55:
- switch (yy_input) {
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- case 9: yy_state = 56; break yy_forNext;
- case 12: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 56:
- switch (yy_input) {
- case 14: yy_state = 49; break yy_forNext;
- case 19: yy_state = 50; break yy_forNext;
- case 25: yy_state = 51; break yy_forNext;
- case 12: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 57:
- switch (yy_input) {
- case 9: yy_state = 98; break yy_forNext;
- case 13: yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 58:
- switch (yy_input) {
- case 9: yy_state = 60; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 59:
- switch (yy_input) {
- case 9: yy_state = 62; break yy_forNext;
- case 30: yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 60:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 61:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 100; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 62:
- switch (yy_input) {
- case 30: yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 63:
- switch (yy_input) {
- case 9: yy_state = 101; break yy_forNext;
- case 22: yy_state = 102; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 64:
- switch (yy_input) {
- case 9: yy_state = 67; break yy_forNext;
- case 25: yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 65:
- switch (yy_input) {
- case 9: yy_state = 69; break yy_forNext;
- case 17: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 66:
- switch (yy_input) {
- case 9: yy_state = 71; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 67:
- switch (yy_input) {
- case 25: yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 68:
- switch (yy_input) {
- case 9: yy_state = 103; break yy_forNext;
- case 18: yy_state = 104; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 69:
- switch (yy_input) {
- case 17: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 70:
- switch (yy_input) {
- case 9: yy_state = 105; break yy_forNext;
- case 17: yy_state = 106; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 71:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 72:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 107; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 74:
- switch (yy_input) {
- case 6:
- case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 7: yy_state = 74; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 75; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- }
-
- case 75:
- switch (yy_input) {
- case 6:
- case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 7: yy_state = 74; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 108; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- }
-
- case 79:
- switch (yy_input) {
- case 9: yy_state = 80; break yy_forNext;
- case 42: yy_isFinal = true; yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 80:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 81:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 109; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 83:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 9: yy_state = 84; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 84:
- switch (yy_input) {
- case 42: yy_isFinal = true; yy_state = 33; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 87:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_pushback = true; yy_state = 87; break yy_forNext;
- case 9: yy_isFinal = true; yy_pushback = true; yy_state = 110; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 88:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_pushback = true; yy_state = 87; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 90:
- switch (yy_input) {
- case 16: yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 91:
- switch (yy_input) {
- case 9: yy_state = 111; break yy_forNext;
- case 17: yy_state = 112; 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 = 113; break yy_forNext;
- case 21: yy_state = 114; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 94:
- switch (yy_input) {
- case 17: yy_state = 95; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 95:
- switch (yy_input) {
- case 9: yy_state = 115; break yy_forNext;
- case 14: yy_state = 116; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 96:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 52; break yy_forNext;
- case 11: yy_state = 54; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 97:
- switch (yy_input) {
- case 12: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 98:
- switch (yy_input) {
- case 13: yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 99:
- switch (yy_input) {
- case 9: yy_state = 117; break yy_forNext;
- case 14: yy_state = 118; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 101:
- switch (yy_input) {
- case 22: yy_state = 102; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 102:
- switch (yy_input) {
- case 9: yy_state = 119; break yy_forNext;
- case 21: yy_state = 120; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 103:
- switch (yy_input) {
- case 18: yy_state = 104; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 104:
- switch (yy_input) {
- case 9: yy_state = 121; break yy_forNext;
- case 38: yy_state = 122; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 105:
- switch (yy_input) {
- case 17: yy_state = 106; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 106:
- switch (yy_input) {
- case 9: yy_state = 123; break yy_forNext;
- case 24: yy_state = 124; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 108:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 74; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 110:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_pushback = true; yy_state = 87; break yy_forNext;
- case 9: yy_state = 88; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 111:
- switch (yy_input) {
- case 17: yy_state = 112; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 112:
- switch (yy_input) {
- case 9: yy_state = 125; break yy_forNext;
- case 18: yy_isFinal = true; yy_state = 126; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 113:
- switch (yy_input) {
- case 21: yy_state = 114; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 114:
- switch (yy_input) {
- case 9: yy_state = 127; break yy_forNext;
- case 22: yy_state = 128; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 115:
- switch (yy_input) {
- case 14: yy_state = 116; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 116:
- switch (yy_input) {
- case 9: yy_state = 129; break yy_forNext;
- case 15: yy_state = 130; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 117:
- switch (yy_input) {
- case 14: yy_state = 118; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 118:
- switch (yy_input) {
- case 9: yy_state = 131; break yy_forNext;
- case 15: yy_state = 132; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 119:
- switch (yy_input) {
- case 21: yy_state = 120; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 120:
- switch (yy_input) {
- case 9: yy_state = 133; break yy_forNext;
- case 20: yy_state = 134; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 121:
- switch (yy_input) {
- case 38: yy_state = 122; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 122:
- switch (yy_input) {
- case 9: yy_state = 135; break yy_forNext;
- case 31: yy_state = 136; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 123:
- switch (yy_input) {
- case 24: yy_state = 124; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 124:
- switch (yy_input) {
- case 9: yy_state = 137; break yy_forNext;
- case 43: yy_state = 138; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 125:
- switch (yy_input) {
- case 18: yy_isFinal = true; yy_state = 126; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 126:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 139; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 127:
- switch (yy_input) {
- case 22: yy_state = 128; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 128:
- switch (yy_input) {
- case 9: yy_state = 140; break yy_forNext;
- case 17: yy_state = 141; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 129:
- switch (yy_input) {
- case 15: yy_state = 130; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 130:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 130; break yy_forNext;
- case 9: yy_state = 142; break yy_forNext;
- case 13: yy_state = 143; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 131:
- switch (yy_input) {
- case 15: yy_state = 132; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 132:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 144; break yy_forNext;
- case 9: yy_state = 145; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 133:
- switch (yy_input) {
- case 20: yy_state = 134; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 134:
- switch (yy_input) {
- case 9: yy_state = 146; break yy_forNext;
- case 28: yy_state = 147; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 135:
- switch (yy_input) {
- case 31: yy_state = 136; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 136:
- switch (yy_input) {
- case 9: yy_state = 148; break yy_forNext;
- case 16: yy_state = 149; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 137:
- switch (yy_input) {
- case 43: yy_state = 138; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 138:
- switch (yy_input) {
- case 9: yy_state = 150; break yy_forNext;
- case 16: yy_state = 151; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 140:
- switch (yy_input) {
- case 17: yy_state = 141; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 141:
- switch (yy_input) {
- case 9: yy_state = 152; break yy_forNext;
- case 23: yy_state = 153; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 142:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 130; break yy_forNext;
- case 13: yy_state = 143; break yy_forNext;
- case 9: yy_state = 154; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 143:
- switch (yy_input) {
- case 9: yy_state = 155; break yy_forNext;
- case 14: yy_state = 156; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 144:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 144; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 157; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 145:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 144; break yy_forNext;
- case 9: yy_state = 158; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 146:
- switch (yy_input) {
- case 28: yy_state = 147; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 147:
- switch (yy_input) {
- case 9: yy_state = 159; break yy_forNext;
- case 30: yy_state = 160; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 148:
- switch (yy_input) {
- case 16: yy_state = 149; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 149:
- switch (yy_input) {
- case 9: yy_state = 161; break yy_forNext;
- case 17: yy_state = 162; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 150:
- switch (yy_input) {
- case 16: yy_state = 151; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 151:
- switch (yy_input) {
- case 9: yy_state = 163; break yy_forNext;
- case 44: yy_state = 164; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 152:
- switch (yy_input) {
- case 23: yy_state = 153; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 153:
- switch (yy_input) {
- case 9: yy_state = 165; break yy_forNext;
- case 24: yy_state = 166; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 154:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 130; break yy_forNext;
- case 13: yy_state = 143; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 155:
- switch (yy_input) {
- case 14: yy_state = 156; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 156:
- switch (yy_input) {
- case 9: yy_state = 167; break yy_forNext;
- case 15: yy_state = 168; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 157:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 144; break yy_forNext;
- case 9: yy_state = 158; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 158:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 144; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 159:
- switch (yy_input) {
- case 30: yy_state = 160; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 160:
- switch (yy_input) {
- case 9: yy_state = 169; break yy_forNext;
- case 39: yy_state = 170; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 161:
- switch (yy_input) {
- case 17: yy_state = 162; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 162:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 162; break yy_forNext;
- case 9: yy_state = 171; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 172; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 163:
- switch (yy_input) {
- case 44: yy_state = 164; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 164:
- switch (yy_input) {
- case 9: yy_state = 173; break yy_forNext;
- case 26: yy_state = 174; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 165:
- switch (yy_input) {
- case 24: yy_state = 166; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 166:
- switch (yy_input) {
- case 9: yy_state = 175; break yy_forNext;
- case 16: yy_state = 176; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 167:
- switch (yy_input) {
- case 15: yy_state = 168; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 168:
- switch (yy_input) {
- case 9: yy_state = 177; break yy_forNext;
- case 30: yy_state = 178; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 169:
- switch (yy_input) {
- case 39: yy_state = 170; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 170:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 170; break yy_forNext;
- case 9: yy_state = 179; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 180; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 171:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 162; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 172; break yy_forNext;
- case 9: yy_state = 181; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 172:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 182; break yy_forNext;
- case 9: yy_state = 183; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 173:
- switch (yy_input) {
- case 26: yy_state = 174; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 174:
- switch (yy_input) {
- case 9: yy_state = 184; break yy_forNext;
- case 28: yy_state = 185; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 175:
- switch (yy_input) {
- case 16: yy_state = 176; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 176:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 176; break yy_forNext;
- case 9: yy_state = 186; break yy_forNext;
- case 25: yy_state = 187; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 177:
- switch (yy_input) {
- case 30: yy_state = 178; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 178:
- switch (yy_input) {
- case 9: yy_state = 188; break yy_forNext;
- case 31: yy_state = 189; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 179:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 170; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 180; break yy_forNext;
- case 9: yy_state = 190; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 180:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 191; break yy_forNext;
- case 9: yy_state = 192; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 181:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 162; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 182:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 172; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 182; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 183:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 182; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 184:
- switch (yy_input) {
- case 28: yy_state = 185; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 185:
- switch (yy_input) {
- case 9: yy_state = 193; break yy_forNext;
- case 45: yy_state = 194; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 186:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 176; break yy_forNext;
- case 25: yy_state = 187; break yy_forNext;
- case 9: yy_state = 195; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 187:
- switch (yy_input) {
- case 9: yy_state = 196; break yy_forNext;
- case 17: yy_state = 197; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 188:
- switch (yy_input) {
- case 31: yy_state = 189; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 189:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 189; break yy_forNext;
- case 9: yy_state = 198; break yy_forNext;
- case 10: yy_state = 199; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 190:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 170; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 191:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 180; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 191; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 192:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 191; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 193:
- switch (yy_input) {
- case 45: yy_state = 194; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 194:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 194; break yy_forNext;
- case 9: yy_state = 200; break yy_forNext;
- case 10: yy_state = 201; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 195:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 176; break yy_forNext;
- case 25: yy_state = 187; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 196:
- switch (yy_input) {
- case 17: yy_state = 197; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 197:
- switch (yy_input) {
- case 9: yy_state = 202; break yy_forNext;
- case 14: yy_state = 203; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 198:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 189; break yy_forNext;
- case 10: yy_state = 199; break yy_forNext;
- case 9: yy_state = 204; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 199:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 199; break yy_forNext;
- case 9: yy_state = 205; break yy_forNext;
- case 32:
- case 33: yy_state = 206; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 200:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 194; break yy_forNext;
- case 10: yy_state = 201; break yy_forNext;
- case 9: yy_state = 207; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 201:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 208; break yy_forNext;
- case 9: yy_state = 209; break yy_forNext;
- case 22: yy_state = 210; break yy_forNext;
- case 32: yy_state = 211; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 202:
- switch (yy_input) {
- case 14: yy_state = 203; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 203:
- switch (yy_input) {
- case 9: yy_state = 212; break yy_forNext;
- case 15: yy_state = 213; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 204:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 189; break yy_forNext;
- case 10: yy_state = 199; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 205:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 199; break yy_forNext;
- case 32:
- case 33: yy_state = 206; break yy_forNext;
- case 9: yy_state = 214; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 206:
- switch (yy_input) {
- case 9: yy_state = 215; break yy_forNext;
- case 25: yy_state = 216; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 207:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 194; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 208:
- switch (yy_input) {
- case 9: yy_state = 201; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_state = 208; break yy_forNext;
- case 22: yy_state = 210; break yy_forNext;
- case 32: yy_state = 211; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 209:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 208; break yy_forNext;
- case 22: yy_state = 210; break yy_forNext;
- case 32: yy_state = 211; break yy_forNext;
- case 9: yy_state = 217; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 210:
- switch (yy_input) {
- case 9: yy_state = 218; break yy_forNext;
- case 21: yy_state = 219; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 211:
- switch (yy_input) {
- case 22: yy_state = 210; break yy_forNext;
- case 9: yy_state = 217; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 212:
- switch (yy_input) {
- case 15: yy_state = 213; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 213:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 213; break yy_forNext;
- case 9: yy_state = 220; break yy_forNext;
- case 24: yy_state = 221; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 214:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 199; break yy_forNext;
- case 32:
- case 33: yy_state = 206; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 215:
- switch (yy_input) {
- case 25: yy_state = 216; break yy_forNext;
- case 9: yy_state = 222; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 216:
- switch (yy_input) {
- case 9: yy_state = 223; break yy_forNext;
- case 17: yy_state = 224; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 217:
- switch (yy_input) {
- case 22: yy_state = 210; break yy_forNext;
- case 9: yy_state = 225; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 218:
- switch (yy_input) {
- case 21: yy_state = 219; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 219:
- switch (yy_input) {
- case 9: yy_state = 226; break yy_forNext;
- case 30: yy_state = 227; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 220:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 213; break yy_forNext;
- case 24: yy_state = 221; break yy_forNext;
- case 9: yy_state = 228; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 221:
- switch (yy_input) {
- case 9: yy_state = 229; break yy_forNext;
- case 26: yy_state = 230; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 222:
- switch (yy_input) {
- case 25: yy_state = 216; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 223:
- switch (yy_input) {
- case 17: yy_state = 224; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 224:
- switch (yy_input) {
- case 9: yy_state = 231; break yy_forNext;
- case 17: yy_state = 232; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 225:
- switch (yy_input) {
- case 22: yy_state = 210; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 226:
- switch (yy_input) {
- case 30: yy_state = 227; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 227:
- switch (yy_input) {
- case 9: yy_state = 233; break yy_forNext;
- case 17: yy_state = 234; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 228:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 213; break yy_forNext;
- case 24: yy_state = 221; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 229:
- switch (yy_input) {
- case 26: yy_state = 230; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 230:
- switch (yy_input) {
- case 9: yy_state = 235; break yy_forNext;
- case 27: yy_state = 236; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 231:
- switch (yy_input) {
- case 17: yy_state = 232; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 232:
- switch (yy_input) {
- case 9: yy_state = 237; break yy_forNext;
- case 24: yy_state = 238; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 233:
- switch (yy_input) {
- case 17: yy_state = 234; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 234:
- switch (yy_input) {
- case 9: yy_state = 239; break yy_forNext;
- case 16: yy_state = 240; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 235:
- switch (yy_input) {
- case 27: yy_state = 236; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 236:
- switch (yy_input) {
- case 9: yy_state = 241; break yy_forNext;
- case 15: yy_state = 242; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 237:
- switch (yy_input) {
- case 24: yy_state = 238; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 238:
- switch (yy_input) {
- case 9: yy_state = 243; break yy_forNext;
- case 34: yy_state = 244; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 239:
- switch (yy_input) {
- case 16: yy_state = 240; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 240:
- switch (yy_input) {
- case 9: yy_state = 245; break yy_forNext;
- case 30: yy_state = 246; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 241:
- switch (yy_input) {
- case 15: yy_state = 242; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 242:
- switch (yy_input) {
- case 9: yy_state = 247; break yy_forNext;
- case 28: yy_state = 248; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 243:
- switch (yy_input) {
- case 34: yy_state = 244; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 244:
- switch (yy_input) {
- case 9: yy_state = 249; break yy_forNext;
- case 29: yy_state = 250; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 245:
- switch (yy_input) {
- case 30: yy_state = 246; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 246:
- switch (yy_input) {
- case 9: yy_state = 251; break yy_forNext;
- case 17: yy_state = 252; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 247:
- switch (yy_input) {
- case 28: yy_state = 248; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 248:
- switch (yy_input) {
- case 9: yy_state = 253; break yy_forNext;
- case 22: yy_state = 254; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 249:
- switch (yy_input) {
- case 29: yy_state = 250; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 250:
- switch (yy_input) {
- case 9: yy_state = 255; break yy_forNext;
- case 29: yy_state = 256; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 251:
- switch (yy_input) {
- case 17: yy_state = 252; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 252:
- switch (yy_input) {
- case 9: yy_state = 257; break yy_forNext;
- case 43: yy_state = 258; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 253:
- switch (yy_input) {
- case 22: yy_state = 254; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 254:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 255:
- switch (yy_input) {
- case 29: yy_state = 256; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 256:
- switch (yy_input) {
- case 9: yy_state = 260; break yy_forNext;
- case 35: yy_state = 261; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 257:
- switch (yy_input) {
- case 43: yy_state = 258; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 258:
- switch (yy_input) {
- case 9: yy_state = 262; break yy_forNext;
- case 17: yy_state = 263; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 259:
- switch (yy_input) {
- case 9: yy_state = 264; break yy_forNext;
- case 29: yy_state = 265; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 260:
- switch (yy_input) {
- case 35: yy_state = 261; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 261:
- switch (yy_input) {
- case 9: yy_state = 266; break yy_forNext;
- case 35: yy_state = 267; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 262:
- switch (yy_input) {
- case 17: yy_state = 263; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 263:
- switch (yy_input) {
- case 9: yy_state = 268; break yy_forNext;
- case 23: yy_state = 269; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 264:
- switch (yy_input) {
- case 29: yy_state = 265; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 265:
- switch (yy_input) {
- case 29: yy_state = 265; break yy_forNext;
- case 9: yy_state = 270; break yy_forNext;
- case 20: yy_state = 271; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 266:
- switch (yy_input) {
- case 35: yy_state = 267; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 267:
- switch (yy_input) {
- case 9: yy_state = 272; break yy_forNext;
- case 35: yy_state = 273; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 268:
- switch (yy_input) {
- case 23: yy_state = 269; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 269:
- switch (yy_input) {
- case 9: yy_state = 274; break yy_forNext;
- case 24: yy_state = 275; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 270:
- switch (yy_input) {
- case 29: yy_state = 265; break yy_forNext;
- case 20: yy_state = 271; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 271:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 276; break yy_forNext;
- case 17: yy_state = 277; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 272:
- switch (yy_input) {
- case 35: yy_state = 273; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 273:
- switch (yy_input) {
- case 9: yy_state = 278; break yy_forNext;
- case 36: yy_state = 279; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 274:
- switch (yy_input) {
- case 24: yy_state = 275; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 275:
- switch (yy_input) {
- case 9: yy_state = 280; break yy_forNext;
- case 16: yy_state = 281; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 276:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 17: yy_state = 277; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 277:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 282; break yy_forNext;
- case 20: yy_state = 283; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 278:
- switch (yy_input) {
- case 36: yy_state = 279; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 279:
- switch (yy_input) {
- case 9: yy_state = 284; break yy_forNext;
- case 35: yy_state = 285; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 280:
- switch (yy_input) {
- case 16: yy_state = 281; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 281:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 9: yy_state = 287; break yy_forNext;
- case 32: yy_state = 288; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 282:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 20: yy_state = 283; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 283:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 6:
- case 8: yy_state = 289; break yy_forNext;
- case 7: yy_state = 290; break yy_forNext;
- case 9: yy_state = 291; break yy_forNext;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 284:
- switch (yy_input) {
- case 35: yy_state = 285; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 285:
- switch (yy_input) {
- case 9: yy_state = 292; break yy_forNext;
- case 37: yy_state = 293; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 286:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 9: yy_state = 294; break yy_forNext;
- case 22: yy_state = 295; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 287:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 32: yy_state = 288; break yy_forNext;
- case 9: yy_state = 296; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 288:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 9: yy_state = 296; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 289:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 297; break yy_forNext;
- case 13: yy_state = 298; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 290:
- switch (yy_input) {
- case 9: yy_state = 299; break yy_forNext;
- case 13: yy_state = 300; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 291:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 6:
- case 8: yy_state = 289; break yy_forNext;
- case 7: yy_state = 290; break yy_forNext;
- case 9: yy_state = 301; break yy_forNext;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 292:
- switch (yy_input) {
- case 37: yy_state = 293; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 293:
- switch (yy_input) {
- case 9: yy_state = 302; break yy_forNext;
- case 36: yy_state = 303; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 294:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 22: yy_state = 295; break yy_forNext;
- case 9: yy_state = 304; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 295:
- switch (yy_input) {
- case 9: yy_state = 305; break yy_forNext;
- case 21: yy_state = 306; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 296:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 9: yy_state = 307; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 297:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 13: yy_state = 298; break yy_forNext;
- case 9: yy_state = 308; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 298:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 309; break yy_forNext;
- case 25: yy_state = 310; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 299:
- switch (yy_input) {
- case 13: yy_state = 300; break yy_forNext;
- case 9: yy_state = 311; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 300:
- switch (yy_input) {
- case 9: yy_state = 312; break yy_forNext;
- case 25: yy_state = 313; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 301:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 6:
- case 8: yy_state = 289; break yy_forNext;
- case 7: yy_state = 290; break yy_forNext;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 302:
- switch (yy_input) {
- case 36: yy_state = 303; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 303:
- switch (yy_input) {
- case 9: yy_state = 314; break yy_forNext;
- case 21: yy_state = 315; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 304:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- case 22: yy_state = 295; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 305:
- switch (yy_input) {
- case 21: yy_state = 306; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 306:
- switch (yy_input) {
- case 9: yy_state = 316; break yy_forNext;
- case 30: yy_state = 317; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 307:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 286; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 308:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 13: yy_state = 298; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 309:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 25: yy_state = 310; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 310:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 318; break yy_forNext;
- case 17: yy_state = 319; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 311:
- switch (yy_input) {
- case 13: yy_state = 300; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 312:
- switch (yy_input) {
- case 25: yy_state = 313; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 313:
- switch (yy_input) {
- case 9: yy_state = 320; break yy_forNext;
- case 17: yy_state = 321; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 314:
- switch (yy_input) {
- case 21: yy_state = 315; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 315:
- switch (yy_input) {
- case 9: yy_state = 322; break yy_forNext;
- case 38: yy_state = 323; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 316:
- switch (yy_input) {
- case 30: yy_state = 317; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 317:
- switch (yy_input) {
- case 9: yy_state = 324; break yy_forNext;
- case 17: yy_state = 325; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 318:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 17: yy_state = 319; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 319:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 326; break yy_forNext;
- case 14: yy_state = 327; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 320:
- switch (yy_input) {
- case 17: yy_state = 321; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 321:
- switch (yy_input) {
- case 9: yy_state = 328; break yy_forNext;
- case 14: yy_state = 329; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 322:
- switch (yy_input) {
- case 38: yy_state = 323; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 323:
- switch (yy_input) {
- case 9: yy_state = 330; break yy_forNext;
- case 39: yy_state = 331; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 324:
- switch (yy_input) {
- case 17: yy_state = 325; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 325:
- switch (yy_input) {
- case 9: yy_state = 332; break yy_forNext;
- case 16: yy_state = 333; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 326:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 14: yy_state = 327; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 327:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_state = 334; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 335; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 328:
- switch (yy_input) {
- case 14: yy_state = 329; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 329:
- switch (yy_input) {
- case 9: yy_state = 336; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 337; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 330:
- switch (yy_input) {
- case 39: yy_state = 331; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 331:
- switch (yy_input) {
- case 9: yy_state = 338; break yy_forNext;
- case 29: yy_state = 339; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 332:
- switch (yy_input) {
- case 16: yy_state = 333; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 333:
- switch (yy_input) {
- case 9: yy_state = 340; break yy_forNext;
- case 30: yy_state = 341; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 334:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 335; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 335:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 342; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 336:
- switch (yy_input) {
- case 15: yy_isFinal = true; yy_state = 337; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 337:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 343; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 338:
- switch (yy_input) {
- case 29: yy_state = 339; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 339:
- switch (yy_input) {
- case 9: yy_state = 344; break yy_forNext;
- case 40: yy_state = 345; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 340:
- switch (yy_input) {
- case 30: yy_state = 341; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 341:
- switch (yy_input) {
- case 9: yy_state = 346; break yy_forNext;
- case 17: yy_state = 347; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 342:
- switch (yy_input) {
- case 29: yy_state = 259; break yy_forNext;
- case 7: break yy_forAction;
- default: yy_state = 254; break yy_forNext;
- }
-
- case 344:
- switch (yy_input) {
- case 40: yy_state = 345; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 345:
- switch (yy_input) {
- case 9: yy_state = 348; break yy_forNext;
- case 41: yy_state = 349; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 346:
- switch (yy_input) {
- case 17: yy_state = 347; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 347:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 347; break yy_forNext;
- case 9: yy_state = 350; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 351; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 348:
- switch (yy_input) {
- case 41: yy_state = 349; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 349:
- switch (yy_input) {
- case 9: yy_state = 352; break yy_forNext;
- case 41: yy_state = 353; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 350:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 347; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 351; break yy_forNext;
- case 9: yy_state = 354; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 351:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 355; break yy_forNext;
- case 9: yy_state = 356; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 352:
- switch (yy_input) {
- case 41: yy_state = 353; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 353:
- switch (yy_input) {
- case 9: yy_state = 357; break yy_forNext;
- case 41: yy_state = 358; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 354:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 347; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 355:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 351; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 355; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 356:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 355; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 357:
- switch (yy_input) {
- case 41: yy_state = 358; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 358:
- switch (yy_input) {
- case 29: yy_state = 299; break yy_forNext;
- case 9: yy_state = 359; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 359:
- switch (yy_input) {
- case 29: yy_state = 299; break yy_forNext;
- default: break yy_forAction;
- }
-
- default:
- yy_ScanError(YY_ILLEGAL_STATE);
- break;
- } }
-
- if ( yy_isFinal ) {
- yy_was_pushback = yy_pushback;
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( yy_noLookAhead ) break yy_forAction;
- }
-
- }
- }
-
- if (yy_was_pushback)
- yy_markedPos = yy_pushbackPos;
-
- switch (yy_action) {
-
- case 33:
- case 78:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 361: break;
- case 26:
- case 27:
- case 29:
- case 75:
- case 108:
- { yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
- case 362: break;
- case 25:
- case 73:
- { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
- case 363: break;
- case 41:
- case 86:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
- case 364: break;
- case 72:
- case 107:
- { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
- case 365: break;
- case 81:
- case 109:
- { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 366: break;
- case 144:
- case 157:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
- case 367: break;
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 28:
- case 34:
- case 37:
- case 40:
- { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
- case 368: break;
- case 126:
- case 139:
- { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
- case 369: break;
- case 61:
- case 100:
- { yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd; }
- case 370: break;
- case 351:
- case 355:
- { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
- case 371: break;
- case 180:
- case 191:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
- case 372: break;
- case 172:
- case 182:
- { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
- case 373: break;
- case 335:
- case 337:
- case 342:
- case 343:
- { isXHTML = true; }
- case 374: break;
- case 89:
- { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
- case 375: break;
- case 44:
- { hasMore = false; return EncodingParserConstants.UTF16BE; }
- case 376: break;
- case 45:
- { hasMore = false; return EncodingParserConstants.UTF16LE; }
- case 377: break;
- case 36:
- case 82:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 378: break;
- case 32:
- case 35:
- case 38:
- { string.append( yytext() ); }
- case 379: break;
- case 31:
- case 77:
- { yybegin(SQ_STRING); string.setLength(0); }
- case 380: break;
- case 30:
- case 76:
- { yybegin(DQ_STRING); string.setLength(0); }
- case 381: break;
- case 39:
- case 85:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 382: break;
- case 42:
- case 87:
- case 110:
- { pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() ); }
- case 383: break;
- case 43:
- { yypushback(1); popState(); }
- case 384: 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);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
deleted file mode 100644
index 2600b07801..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.html.core.internal.contenttype;
-
-
-public interface HTMLHeadTokenizerConstants {
-
- String MetaTagEnd = "MetaTagEnd"; //$NON-NLS-1$
- String MetaTagStart = "MetaTagStart"; //$NON-NLS-1$
- String MetaTagContentType = "MetaTagContentType"; //$NON-NLS-1$
- String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
deleted file mode 100644
index 22a613622b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.util.regex.Pattern;
-
-import org.eclipse.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.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-public class HTMLResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- private HTMLHeadTokenizer fTokenizer;
-
- /**
- * There is no spec defined encoding for HTML (historically), so null is
- * returned.
- */
- public String getSpecDefaultEncoding() {
- return null;
- }
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (tokenType == EncodingParserConstants.UTF16BE || 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 HTMLHeadTokenizer getTokenizer() {
- // TODO: need to work on 'reset' in tokenizer, so new instance isn't
- // always needed
- //if (fTokenizer == null) {
- fTokenizer = new HTMLHeadTokenizer();
- // }
- return fTokenizer;
- }
-
- private boolean isLegalString(String valueTokenType) {
- if (valueTokenType == null)
- return false;
- else
- return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
-
- protected void parseInput() throws IOException {
- checkInContent();
- if (fEncodingMemento == null) {
- checkHeuristics();
- }
- }
-
- /**
- *
- */
- private void checkHeuristics() throws IOException {
- boolean noHeuristic = false;
- String heuristicEncoding = null;
- try {
- if (EncodingGuesser.canGuess()) {
- fReader.reset();
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- byte[] bytes = new byte[CodedIO.MAX_MARK_SIZE];
- int nRead = 0;
- for (int i = 0; i < bytes.length; i++) {
- int oneByte = fReader.read();
- nRead++;
- if (oneByte == -1) {
- break;
- }
- if (oneByte <= 0xFF) {
- bytes[i] = (byte) oneByte;
- }
- else {
- noHeuristic = true;
- break;
- }
- }
- if (!noHeuristic) {
- heuristicEncoding = EncodingGuesser.guessEncoding(bytes, nRead);
- }
- }
- }
- catch (IOException e) {
- // if any IO exception, then not a heuristic case
- }
- finally {
- fReader.reset();
- }
- if (heuristicEncoding != null) {
- createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
- }
-
- }
-
- private void checkInContent() throws IOException {
- HTMLHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- String contentTypeValue = null;
- String xhtmlEncoding = HTMLHeadTokenizerConstants.UNDEFINED;
- boolean isXHTML = false;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (tokenizer.isXHTML()) {
- isXHTML = true;
- if (!xhtmlEncoding.equals(HTMLHeadTokenizerConstants.UNDEFINED)) {
- if (xhtmlEncoding.length() > 0) {
- createEncodingMemento(xhtmlEncoding, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- return ;
- }
- }
- }
- if (canHandleAsUnicodeStream(tokenType)) {
- // side effect of canHandle is to create appropriate
- // memento
- }
- else if (tokenType == HTMLHeadTokenizerConstants.MetaTagContentType) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- contentTypeValue = valueToken.getText();
-
- }
- }
- }
- else if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding ) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (isLegalString(tokenType))
- xhtmlEncoding = token.getText();
- }
- }
-
- }
- while (tokenizer.hasMoreTokens());
- if (contentTypeValue != null) {
- if (tokenizer.hasCharsetAttr()) {
- contentTypeValue = contentTypeValue.trim();
- if (contentTypeValue.length() > 0) {
- createEncodingMemento(contentTypeValue, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- }
- }
- else {
- parseContentTypeValue(contentTypeValue);
- }
- }
- //Content type is XHTML and no encoding found(since we did't hit return statement), use UTF-8
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=318768
- if (isXHTML) {
- createEncodingMemento("UTF-8", EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT); //$NON-NLS-1$
- }
- }
-
- private void parseContentTypeValue(String contentType) {
- String charset = null;
- Pattern pattern = Pattern.compile(";\\s*charset\\s*=\\s*"); //$NON-NLS-1$
- String[] parts = pattern.split(contentType);
- if (parts.length > 0) {
- // if only one item, it can still be charset instead of
- // contentType
- if (parts.length == 1) {
- if (parts[0].length() > 6) {
- String checkForCharset = parts[0].substring(0, 7);
- if (checkForCharset.equalsIgnoreCase("charset")) { //$NON-NLS-1$
- int eqpos = parts[0].indexOf('=');
- eqpos = eqpos + 1;
- if (eqpos < parts[0].length()) {
- charset = parts[0].substring(eqpos);
- charset = charset.trim();
- }
- }
- }
- }
- else {
- //fContentType = parts[0];
- }
- }
- if (parts.length > 1) {
- charset = parts[1].trim();
- }
-
- if (charset != null && charset.length() > 0) {
- createEncodingMemento(charset, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index a6190bfa43..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-public class HeadParserToken {
- private int fStart;
-
- private String fText;
- private String fType;
-
- protected HeadParserToken() {
- super();
- }
-
- public HeadParserToken(String type, int start, String text) {
- this();
- fType = type;
- fStart = start;
- fText = text;
-
- }
-
- public String getText() {
- return fText;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return ("text: " + fText + " offset: " + fStart + " type: " + fType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
deleted file mode 100644
index f48f2f0113..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.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 size;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
- for (int i = 0; i < size; i++) {
- s.append(list[i]);
- if(i < size - 1) {
- s.append(", ");
- }
- }
- s.append("]");
- return s.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index 1a24c3133f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
deleted file mode 100644
index dc2de33bd1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.w3c.dom.Document;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DOMStyleModelImpl extends DOMModelImpl {
- public DOMStyleModelImpl() {
- // remember, the document is created in super constructor,
- // via internalCreateDocument
- super();
- }
-
- public void releaseFromEdit() {
- releaseStyleSheets();
- super.releaseFromEdit();
- }
-
- /**
- */
- public void releaseFromRead() {
- releaseStyleSheets();
- super.releaseFromRead();
- }
-
- private void releaseStyleSheets() {
- if (!isShared()) {
- Document doc = getDocument();
- if (doc instanceof DocumentStyleImpl) {
- ((DocumentStyleImpl) doc).releaseStyleSheets();
- }
- }
- }
-
- /**
- * createDocument method
- * @return org.w3c.dom.Document
- */
- protected Document internalCreateDocument() {
- DocumentStyleImpl document = new DocumentStyleImpl();
- document.setModel(this);
- return document;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
deleted file mode 100644
index 8efb14b226..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
+++ /dev/null
@@ -1,93 +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
- *******************************************************************************/
-/*
- * http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DocumentStyleImpl extends DocumentImpl implements IDOMDocument, DocumentCSS {
- public DocumentStyleImpl() {
- super();
- }
-
- protected DocumentStyleImpl(DocumentImpl that) {
- super(that);
- }
-
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
- INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return null;
- return ((IStyleSheetListAdapter) adapter).getOverrideStyle(element, pseudoName);
- }
-
- public StyleSheetList getStyleSheets() {
- INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return null;
- return ((IStyleSheetListAdapter) adapter).getStyleSheets();
- }
-
- protected void releaseStyleSheets() {
- INodeAdapter adapter = getExistingAdapter(IStyleSheetListAdapter.class);
- if (adapter == null)
- return;
- ((IStyleSheetListAdapter) adapter).releaseStyleSheets();
- }
-
- /**
- * createElement method
- * @return org.w3c.dom.Element
- * @param tagName java.lang.String
- */
- public Element createElement(String tagName) throws DOMException {
- checkTagNameValidity(tagName);
-
- ElementStyleImpl element = new ElementStyleImpl();
- element.setOwnerDocument(this);
- element.setTagName(tagName);
- return element;
- }
-
- /**
- * cloneNode method
- * @return org.w3c.dom.Node
- * @param deep boolean
- */
- public Node cloneNode(boolean deep) {
- DocumentStyleImpl cloned = new DocumentStyleImpl(this);
- if (deep)
- cloned.importChildNodes(this, true);
- return cloned;
- }
-
- protected void setModel(IDOMModel model) {
- super.setModel(model);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
deleted file mode 100644
index 7acc0fbfe8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-import org.w3c.dom.stylesheets.LinkStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-public class ElementStyleImpl extends ElementImpl implements IDOMElement, ElementCSSInlineStyle, LinkStyle {
- public ElementStyleImpl() {
- super();
- }
-
- public ElementStyleImpl(ElementImpl that) {
- super(that);
- }
-
- public StyleSheet getSheet() {
- INodeAdapter adapter = getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- return ((IStyleSheetAdapter) adapter).getSheet();
- }
-
- public CSSStyleDeclaration getStyle() {
- INodeAdapter adapter = getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- return ((IStyleDeclarationAdapter) adapter).getStyle();
- }
-
- protected void setOwnerDocument(Document ownerDocument) {
- super.setOwnerDocument(ownerDocument);
- }
-
- protected void setTagName(String tagName) {
- super.setTagName(tagName);
- }
-
- protected ElementImpl newInstance() {
- return new ElementStyleImpl(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
deleted file mode 100644
index c1cfcc1502..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- */
-public class HTMLConverter {
-
- /**
- */
- public HTMLConverter() {
- super();
-
- }
-
- public void cleanupModel(IDOMModel model) {
- if (model == null)
- return;
-
- HTMLCleanupProcessorImpl processor = new HTMLCleanupProcessorImpl();
- IStructuredCleanupPreferences pref = processor.getCleanupPreferences();
-
- // backup options
- boolean compressEmptyElementTags = pref.getCompressEmptyElementTags();
- boolean insertRequiredAttrs = pref.getInsertRequiredAttrs();
- boolean insertMissingTags = pref.getInsertMissingTags();
- boolean quoteAttrValues = pref.getQuoteAttrValues();
- boolean formatSource = pref.getFormatSource();
- int tagNameCase = pref.getTagNameCase();
- int attrNameCase = pref.getAttrNameCase();
-
- // setup options
- pref.setCompressEmptyElementTags(true);
- pref.setInsertRequiredAttrs(true);
- pref.setInsertMissingTags(true);
- pref.setQuoteAttrValues(true);
- pref.setFormatSource(false);
- if (model.getDocument().isXMLType()) { // XHTML
- pref.setTagNameCase(HTMLCorePreferenceNames.LOWER);
- pref.setAttrNameCase(HTMLCorePreferenceNames.LOWER);
- }
- else {
- pref.setTagNameCase(HTMLCorePreferenceNames.ASIS);
- pref.setAttrNameCase(HTMLCorePreferenceNames.ASIS);
- }
-
- processor.cleanupModel(model);
-
- // set back options
- pref.setCompressEmptyElementTags(compressEmptyElementTags);
- pref.setInsertRequiredAttrs(insertRequiredAttrs);
- pref.setInsertMissingTags(insertMissingTags);
- pref.setQuoteAttrValues(quoteAttrValues);
- pref.setFormatSource(formatSource);
- pref.setTagNameCase(tagNameCase);
- pref.setAttrNameCase(attrNameCase);
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(IDOMModel model, String declaration, String publicId) {
- if (model == null)
- return;
- setDeclaration(model, declaration, publicId);
- cleanupModel(model);
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(InputStream input, OutputStream output, String declaration, String publicId) throws UnsupportedEncodingException, IOException, CoreException {
- IDOMModel model = readModel(input);
- if (model == null)
- return;
- try {
- convert(model, declaration, publicId);
- writeModel(model, output);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(IFile file, String declaration, String publicId) throws IOException, CoreException {
- IDOMModel model = readModel(file);
- if (model == null)
- return;
- try {
- convert(model, declaration, publicId);
- writeModel(model, file);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
-
- /**
- */
- private static void insertBreak(IDOMModel model, Node node) {
- if (model == null || node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
-
- // get delimiter string
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- String delim = structuredDocument.getLineDelimiter();
- if (delim == null || delim.length() == 0)
- return;
-
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Document document = node.getOwnerDocument();
- if (document == null)
- return;
- Text text = document.createTextNode(delim);
- parent.insertBefore(text, node);
- }
-
- /**
- */
- private IDOMModel readModel(InputStream input) throws IOException, UnsupportedEncodingException {
- if (input == null)
- return null;
- // create temporary model
- String id = input.toString() + ".html"; //$NON-NLS-1$
- IModelManager manager = StructuredModelManager.getModelManager();
- IStructuredModel model = manager.getModelForEdit(id, input, null);
- if (!(model instanceof IDOMModel)) {
- if (model != null)
- model.releaseFromEdit();
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- private IDOMModel readModel(IFile file) throws IOException, CoreException {
- if (file == null)
- return null;
- IModelManager manager = StructuredModelManager.getModelManager();
- IStructuredModel model = manager.getModelForEdit(file);
- if (!(model instanceof IDOMModel)) {
- if (model != null)
- model.releaseFromEdit();
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- public void setDeclaration(IDOMModel model, String declaration, String publicId) {
- if (model == null)
- return;
- IDOMDocument document = model.getDocument();
- if (document == null)
- return;
-
- try {
- model.aboutToChangeModel();
-
- ProcessingInstruction pi = null;
- Node child = document.getFirstChild();
- if (child != null && child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- String target = child.getNodeName();
- if (target != null && target.equals("xml")) { //$NON-NLS-1$
- pi = (ProcessingInstruction) child;
- child = child.getNextSibling();
- }
- }
- IDOMDocumentType docType = (IDOMDocumentType) document.getDoctype();
-
- if (declaration != null) {
- if (pi != null) {
- pi.setData(declaration);
- }
- else {
- pi = document.createProcessingInstruction("xml", declaration); //$NON-NLS-1$
- document.insertBefore(pi, child);
- insertBreak(model, child);
- }
- }
-
- if (publicId != null) {
- HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
- String name = (entry != null ? entry.getName() : null);
- if (name == null || name.length() == 0)
- name = "HTML"; // default //$NON-NLS-1$
- if (docType != null) {
- if (!name.equals(docType.getName())) { // replace
- Node parent = docType.getParentNode();
- child = docType;
- docType = (IDOMDocumentType) document.createDoctype(name);
- parent.insertBefore(docType, child);
- parent.removeChild(child);
- }
- }
- else {
- docType = (IDOMDocumentType) document.createDoctype(name);
- document.insertBefore(docType, child);
- insertBreak(model, child);
- }
- docType.setPublicId(publicId);
- if (entry != null) {
- String systemId = entry.getSystemId();
- if (systemId != null)
- docType.setSystemId(systemId);
- String namespaceURI = entry.getNamespaceURI();
- if (namespaceURI != null) {
- Element element = document.getDocumentElement();
- if (element != null) {
- element.setAttribute("xmlns", namespaceURI); //$NON-NLS-1$
- }
- }
- }
- }
- }
- finally {
- model.changedModel();
- }
- }
-
- /**
- */
- private void writeModel(IDOMModel model, OutputStream output) throws UnsupportedEncodingException, IOException, CoreException {
- if (model == null || output == null)
- return;
- model.save();
- }
-
- /**
- */
- private void writeModel(IDOMModel model, IFile file) throws IOException, CoreException {
- if (model == null || file == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- //ByteArrayOutputStream output = null;
- ByteArrayInputStream input = null;
- try {
- //output = new
- // ByteArrayOutputStream(structuredDocument.getLength());
- model.save();
- //input = new ByteArrayInputStream(output.toByteArray());
- //file.setContents(input, true, true, null);
- }
- finally {
- // if (output != null)
- // output.close();
- if (input != null)
- input.close();
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
deleted file mode 100644
index d03900aab4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapterImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- */
-public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements HTMLDocumentTypeConstants {
-
- private HTMLDocumentTypeAdapterFactory fFactory = null;
- private HTMLDocumentTypeEntry entry = null;
- private boolean isXMLType = false;
- private final static String XML = "xml"; //$NON-NLS-1$
- private final static String XHTML = "xhtml"; //$NON-NLS-1$
- private final static String WML = "wml"; //$NON-NLS-1$
-
- /**
- */
- protected HTMLDocumentTypeAdapter() {
- super();
- }
-
- /**
- */
- protected HTMLDocumentTypeAdapter(IDOMDocument document, HTMLDocumentTypeAdapterFactory factory) {
- super(document);
-
- this.fFactory = factory;
-
- // initialize
- documentTypeChanged();
- }
-
- /**
- */
- private void documentTypeChanged() {
- IDOMDocument document = getDocument();
- if (document == null)
- return; // error
- IDOMModel model = document.getModel();
- if (model == null)
- return; // error
-
- IFile file = getFile(model);
-
- // find DOCTYPE delcaration and Public ID
- String publicId = null;
- String systemId = null;
- DocumentType newDocumentType = findDocumentType(document);
- if (newDocumentType != null) {
- publicId = newDocumentType.getPublicId();
- systemId = newDocumentType.getSystemId();
- }
- else {
- // lookup default set by contentsettings
- publicId = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, file, true);
- }
-
- // lookup DOCTYPE registry
- HTMLDocumentTypeEntry newEntry = null;
- if (publicId != null) {
- newEntry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
- }
- else if (systemId == null){
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML5);
- }
-
- boolean newXMLType = (newEntry != null ? newEntry.isXMLType() : false);
- boolean newWMLType = (newEntry != null ? newEntry.isWMLType() : false);
-
- if (!newXMLType) {
- // find XML declaration
- if (findXMLNode(document) != null) {
- newXMLType = true;
- }
-
- // check file extension
- if (file != null) {
- String ext = file.getFileExtension();
- if (ext != null && ext.equalsIgnoreCase(XHTML)) {
- newXMLType = true;
- }
-
- if (ext != null && ext.equalsIgnoreCase(WML)) {
- newXMLType = true;
- newWMLType = true;
- }
- }
-
- }
-
- if (newEntry == null) {
- // lookup system default
- if (newXMLType && newDocumentType == null) {
- // use default XHTML, if it's XML and no document type
- // declared
- if (newWMLType)
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_WML);
- else
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_XHTML);
-
- }
- else {
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML);
- }
- if (newEntry == null)
- return; // error
- }
-
- if (newDocumentType == null) {
- DocumentType oldDocumentType = getDocumentType();
- if (oldDocumentType == null || oldDocumentType.getName() != newEntry.getName()) {
- // create implicit DocumentType
- DOMImplementation impl = document.getImplementation();
- if (impl != null) {
- String name = newEntry.getName();
- publicId = newEntry.getPublicId();
- systemId = newEntry.getSystemId();
- newDocumentType = impl.createDocumentType(name, publicId, systemId);
- }
- }
- }
-
- boolean notify = false;
- if (this.entry != null) { // do not notify on initialization
- notify = (newEntry != this.entry || newXMLType != this.isXMLType);
- }
-
- if (newDocumentType != null)
- setDocumentType(newDocumentType);
- this.entry = newEntry;
- this.isXMLType = newXMLType;
-
- if (notify)
- notifyDocumentTypeChanged();
- }
-
- /**
- */
- private IDOMDocumentType findDocumentType(IDOMDocument document) {
- IDOMDocumentType documentType = (IDOMDocumentType) document.getDoctype();
- if (documentType != null && documentType.getExistingAdapter(DocumentTypeAdapter.class) == null) {
- // watch future changes
- documentType.addAdapter(this);
- }
- return documentType;
- }
-
- /**
- */
- private Node findXMLNode(Document document) {
- for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
- continue;
- String target = child.getNodeName();
- if (target != null && target.equals(XML)) {
- return child;
- }
- }
- return null;
- }
-
- /**
- */
- public int getAttrNameCase() {
- if (isXMLType())
- return super.getAttrNameCase(); // XHTML
- return this.fFactory.getAttrNameCase();
- }
-
- private IFile getFile(IStructuredModel model) {
- IFile result = null;
- String location = model.getBaseLocation();
- if (location != null) {
- IPath path = new Path(location);
- if (path.segmentCount() > 1) {
- result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return result;
- }
-
- /**
- */
- public int getTagNameCase() {
- if (isXMLType())
- return LOWER_CASE; // XHTML
- return this.fFactory.getTagNameCase();
- }
-
- /**
- */
- public boolean hasFeature(String feature) {
- if (feature == null)
- return false;
- if (feature.equals(HTML))
- return true;
- if (feature.equals(SSI))
- return true;
- if (feature.equals(FRAMESET)) {
- if (this.entry == null)
- return false;
- return this.entry.hasFrameset();
- }
- if (feature.equals(HTML5)) {
- if (this.entry == null)
- return false;
- return this.entry == HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML5);
- }
- return false;
- }
-
- /**
- */
- public boolean isXMLType() {
- return this.isXMLType;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifier == null)
- return;
- if (notifier instanceof IDOMDocument) {
- if (eventType != INodeNotifier.STRUCTURE_CHANGED)
- return;
- }
- else {
- if (eventType != INodeNotifier.CHANGE)
- return;
- }
- documentTypeChanged();
- }
-
- /**
- */
- public void release() {
- super.release();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
deleted file mode 100644
index 3e15e1348b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLDocumentTypeAdapterFactory implements INodeAdapterFactory, Preferences.IPropertyChangeListener {
-
- private int tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- private int attrNameCase = DocumentTypeAdapter.LOWER_CASE;
- private Preferences preferences = null;
-
- // for removal later on release()
- private HashMap fDoc2AdapterMap = new HashMap();
-
- /**
- */
- public HTMLDocumentTypeAdapterFactory() {
- super();
- this.preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-
- if (this.preferences != null) {
- updateCases(); // initialize
- this.preferences.addPropertyChangeListener(this);
- }
- }
-
- /**
- * Method that returns the adapter associated with the given object. It
- * may be a singleton or not ... depending on the needs of the
- * INodeAdapter ... but in general it is recommended for an adapter to be
- * stateless, so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter result = null;
- // only adapt IDOMDocument
- if (notifier instanceof IDOMDocument) {
-
- // if already has an adapter, no need to recreate/initialize.
- // Note: this means if "doctype" for DOM changes,
- // theDocumentTypeAdatper for that DOM
- // should be removed (and released) and it will be re-created next
- // time required.
- DocumentTypeAdapter oldAdapter = (DocumentTypeAdapter) notifier.getExistingAdapter(DocumentTypeAdapter.class);
- if (oldAdapter != null) {
- result = oldAdapter;
- }
- else {
-
- // if there already was an adapter
- //if(fAdapter != null)
- // fAdapter.release();
-
- // note, the factory is included in this case to have a central place
- // to come back to for case preferences.
- result = new HTMLDocumentTypeAdapter((IDOMDocument) notifier, this);
- notifier.addAdapter(result);
-
- fDoc2AdapterMap.put(notifier, result);
- }
- }
- return result;
- }
-
- /**
- */
- public int getAttrNameCase() {
- return this.attrNameCase;
- }
-
- /**
- */
- public int getTagNameCase() {
- return this.tagNameCase;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == DocumentTypeAdapter.class);
- }
-
- /**
- */
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (event == null)
- return;
- String property = event.getProperty();
- if (property == null)
- return;
-
- if (property.equals(HTMLCorePreferenceNames.TAG_NAME_CASE) || property.equals(HTMLCorePreferenceNames.ATTR_NAME_CASE)) {
- updateCases();
- }
- }
-
- /**
- */
- private void updateCases() {
- this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
-
- if (this.preferences == null)
- return;
-
- int tagCase = this.preferences.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- if (tagCase == HTMLCorePreferenceNames.LOWER)
- this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- else if (tagCase == HTMLCorePreferenceNames.UPPER)
- this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
-
- int attCase = this.preferences.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- if (attCase == HTMLCorePreferenceNames.LOWER)
- this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
- else if (attCase == HTMLCorePreferenceNames.UPPER)
- this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
- }
-
- /**
- */
- public void release() {
-
- if(!fDoc2AdapterMap.isEmpty()) {
- Object[] docs = fDoc2AdapterMap.keySet().toArray();
- DocumentTypeAdapter adapter = null;
- for (int i = 0; i < docs.length; i++) {
- adapter = (DocumentTypeAdapter)fDoc2AdapterMap.get(docs[i]);
- adapter.release();
- ((IDOMDocument)docs[i]).removeAdapter(adapter);
- }
- fDoc2AdapterMap.clear();
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95960
- if (this.preferences != null) {
- this.preferences.removePropertyChangeListener(this);
- }
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return new HTMLDocumentTypeAdapterFactory();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
deleted file mode 100644
index 7aae3cffec..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-public interface HTMLDocumentTypeConstants {
-
- public final static String HTML = "HTML"; //$NON-NLS-1$
- public final static String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public final static String SSI = "SSI"; //$NON-NLS-1$
- String HTML5 = "HTML5"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
deleted file mode 100644
index 83158e7b8d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-public class HTMLDocumentTypeEntry {
-
- private String name;
- private String publicId;
- private String systemId;
- private String namespaceURI;
- private boolean isXMLType;
- private boolean isXHTMLType;
- private boolean isWMLType;
- private boolean hasFrameset;
- private String displayName;
- private boolean isDefaultXHTML;
- private boolean isDefaultWML;
- private static String XHTML_NAME = "html"; //$NON-NLS-1$
- private static String HTML_NAME = "HTML"; //$NON-NLS-1$
- private boolean useInternalModel = false;
-
- /**
- */
- private HTMLDocumentTypeEntry() {
- super();
- }
-
- /**
- */
- public HTMLDocumentTypeEntry(String name, String publicId, String systemId, String namespaceURI, boolean isXHTMLType, boolean hasFrameset, String displayName, boolean isDefaultXHTML, boolean isDefaultWML, boolean isWMLType) {
- this();
-
- if (name != null && name.length() > 0) {
- this.name = name;
- }
- else {
- if (isXMLType)
- this.name = XHTML_NAME;// need code for wml?
- else
- this.name = HTML_NAME;
- }
- this.publicId = publicId;
- this.systemId = systemId;
- this.namespaceURI = namespaceURI;
- this.isXMLType = isXHTMLType | isWMLType;
- this.hasFrameset = hasFrameset;
- this.displayName = displayName;
- this.isDefaultXHTML = isDefaultXHTML;
- this.isDefaultWML = isDefaultWML;
- this.isXHTMLType = isXHTMLType;
- this.isWMLType = isWMLType;
- }
-
- HTMLDocumentTypeEntry(String name, String publicId, String systemId, String namespaceURI, boolean isXHTMLType, boolean hasFrameset, String displayName, boolean isDefaultXHTML, boolean isDefaultWML, boolean isWMLType, boolean useInternalModel) {
- this(name, publicId, systemId, namespaceURI, isXHTMLType, hasFrameset, displayName, isDefaultXHTML, isDefaultWML, isWMLType);
- this.useInternalModel = useInternalModel;
- }
-
- /**
- */
- public final String getName() {
- return this.name;
- }
-
- /**
- */
- public final String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- /**
- */
- public final String getPublicId() {
- return this.publicId;
- }
-
- /**
- */
- public final String getSystemId() {
- return this.systemId;
- }
-
- /**
- */
- public final boolean isXMLType() {
- return this.isXMLType;
- }
-
- /**
- */
- public final boolean hasFrameset() {
- return this.hasFrameset;
- }
-
- /**
- */
- public final String getDisplayName() {
- return this.displayName;
- }
-
- /**
- */
- public final boolean isDefaultXHTML() {
- return this.isDefaultXHTML;
- }
-
- public final boolean isDefaultWML() {
- return this.isDefaultWML;
- }
-
-
- public final boolean isXHTMLType() {
- return isXHTMLType;
- }
-
- public final boolean isWMLType() {
- return isWMLType;
- }
-
- public final boolean useInternalModel() {
- return useInternalModel;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
deleted file mode 100644
index 457558f22f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.document;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-public class HTMLDocumentTypeRegistry {
- static class HTMLDocumentTypeEntryComparator implements Comparator {
- static Collator delegate = Collator.getInstance();
-
- public int compare(Object o1, Object o2) {
- if (o1 instanceof HTMLDocumentTypeEntry && o2 instanceof HTMLDocumentTypeEntry) {
- if (((HTMLDocumentTypeEntry) o1).getDisplayName() != null && ((HTMLDocumentTypeEntry) o2).getDisplayName() != null) {
- return delegate.compare(((HTMLDocumentTypeEntry) o1).getDisplayName(), ((HTMLDocumentTypeEntry) o2).getDisplayName());
- }
- }
- return 0;
- }
- }
-
- private static HTMLDocumentTypeRegistry instance = null;
- private Hashtable entries = null;
- private HTMLDocumentTypeEntry defaultEntry = null;
- private HTMLDocumentTypeEntry defaultXHTMLEntry = null;
- private HTMLDocumentTypeEntry defaultWMLEntry = null;
- private HTMLDocumentTypeEntry defaultCHTMLEntry = null;
- private HTMLDocumentTypeEntry defaultHTML5Entry = null;
-
- final static int DEFAULT_HTML = 0;
- final static int DEFAULT_XHTML = 1;
- final static int DEFAULT_WML = 2;
- final static int DEFAULT_CHTML = 3;
- final static int DEFAULT_HTML5 = 4;
-
- public static final String CHTML_PUBLIC_ID = "-//W3C//DTD Compact HTML 1.0 Draft//EN";//$NON-NLS-1$
-
- /**
- */
- private HTMLDocumentTypeRegistry() {
- super();
-
- this.entries = new Hashtable();
- // HTML 4.01
- String name = "HTML";//$NON-NLS-1$
- String publicId = "-//W3C//DTD HTML 4.01 Transitional//EN";//$NON-NLS-1$
- String systemId = "http://www.w3.org/TR/html4/loose.dtd";//$NON-NLS-1$
- String displayName = "HTML 4.01 Transitional"; //$NON-NLS-1$
- this.defaultEntry = new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, false, displayName, false, false, false, true);
- this.entries.put(publicId, this.defaultEntry);
- publicId = "-//W3C//DTD HTML 4.01//EN";//$NON-NLS-1$
- systemId = "http://www.w3.org/TR/html4/strict.dtd";//$NON-NLS-1$
- displayName = "HTML 4.01 Strict"; //$NON-NLS-1$
- this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, false, displayName, false, false, false, true));
- publicId = "-//W3C//DTD HTML 4.01 Frameset//EN";//$NON-NLS-1$
- systemId = "http://www.w3.org/TR/html4/frameset.dtd";//$NON-NLS-1$
- displayName = "HTML 4.01 Frameset"; //$NON-NLS-1$
- this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, true, displayName, false, false, false, true));
- // CHTML
- name = "HTML";//$NON-NLS-1$
- publicId = CHTML_PUBLIC_ID;
- displayName = "Compact HTML 1.0 Draft"; //$NON-NLS-1$
- this.defaultCHTMLEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
- this.entries.put(publicId, this.defaultCHTMLEntry);
-
- //HTML5
- name = "HTML5";//$NON-NLS-1$
- publicId = "";
- displayName = "HTML5"; //$NON-NLS-1$
- this.defaultHTML5Entry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
- this.entries.put(publicId, this.defaultHTML5Entry);
-
-
-
- HTMLDocumentTypeRegistryReader reader = new HTMLDocumentTypeRegistryReader();
- if (reader != null)
- reader.readRegistry(this);
- }
-
- /**
- */
- void regist(String pid, HTMLDocumentTypeEntry doctype) {
- if (pid == null || doctype == null)
- return;
- this.entries.put(pid, doctype);
- if (this.defaultXHTMLEntry == null) {
- if (doctype.isDefaultXHTML())
- this.defaultXHTMLEntry = doctype;
- }
- if (this.defaultWMLEntry == null) {
- if (doctype.isDefaultWML())
- this.defaultWMLEntry = doctype;
- }
- }
-
- /**
- *
- */
- public HTMLDocumentTypeEntry getDefaultEntry(int type) {
- HTMLDocumentTypeEntry entry = null;
- switch (type) {
- case DEFAULT_HTML5 :
- entry = this.defaultHTML5Entry;
- break;
- case DEFAULT_XHTML :
- entry = this.defaultXHTMLEntry;
- break;
- case DEFAULT_WML :
- entry = this.defaultWMLEntry;
- break;
- case DEFAULT_CHTML :
- entry = this.defaultCHTMLEntry;
- break;
- case DEFAULT_HTML :
- default :
- entry = this.defaultEntry;
- break;
- }
- return entry;
- }
-
- /**
- *
- */
- public HTMLDocumentTypeEntry getDefaultEntry() {
- return this.defaultEntry;
- }
-
- /**
- */
- public HTMLDocumentTypeEntry getXHTMLDefaultEntry() {
- return this.defaultXHTMLEntry;
- }
-
- /**
- */
- public Enumeration getEntries() {
- List values = new ArrayList(this.entries.values());
- Collections.sort(values, new HTMLDocumentTypeEntryComparator());
- return new Vector(values).elements();
- }
-
- /**
- */
- public HTMLDocumentTypeEntry getEntry(String publicId) {
- if (publicId == null)
- return null;
- return (HTMLDocumentTypeEntry) this.entries.get(publicId);
- }
-
- /**
- */
- public synchronized static HTMLDocumentTypeRegistry getInstance() {
- if (instance == null)
- instance = new HTMLDocumentTypeRegistry();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
deleted file mode 100644
index f419978fad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-
-/**
- */
-class HTMLDocumentTypeRegistryReader {
-
- //
- private final static String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- private final static String EXTENSION_POINT_ID = "documentTypes"; //$NON-NLS-1$
- private final static String TAG_NAME = "documentType"; //$NON-NLS-1$
- private final static String ATT_PID = "publicID"; //$NON-NLS-1$
- private final static String ATT_SID = "systemID"; //$NON-NLS-1$
- private final static String ATT_IS_XHTML = "isXHTML"; //$NON-NLS-1$
- private final static String ATT_IS_WML = "isWML"; //$NON-NLS-1$
- private final static String ATT_HAS_FRAMESET = "hasFrameset"; //$NON-NLS-1$
- private final static String ATT_NSURI = "namespaceURI"; //$NON-NLS-1$
- private final static String ATT_ENAME = "elementName"; //$NON-NLS-1$
- private final static String ATT_DNAME = "displayName"; //$NON-NLS-1$
- private final static String ATT_IS_DEFAULT_XHTML = "defaultXHTML"; //$NON-NLS-1$
- private final static String ATT_IS_DEFAULT_WML = "defaultWML"; //$NON-NLS-1$
- private final static String ATV_TRUE = "true"; //$NON-NLS-1$
- private final static String ATV_NULL_STRING = ""; //$NON-NLS-1$
-
- /**
- */
- HTMLDocumentTypeRegistryReader() {
- super();
- }
-
- /**
- */
- void readRegistry(HTMLDocumentTypeRegistry reg) {
- if (reg == null)
- return;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- HTMLDocumentTypeEntry doctype = readElement(elements[i]);
- // null can be returned if there's an error reading the element
- if (doctype != null) {
- reg.regist(doctype.getPublicId(), doctype);
- }
- }
- }
- }
-
- /**
- */
- private HTMLDocumentTypeEntry readElement(IConfigurationElement element) {
- HTMLDocumentTypeEntry doctype = null;
- String pid = null;
- String sid = null;
- String nsuri = null;
- String root = null;
- boolean xhtml = true;
- boolean frameset = false;
- String dname = null;
- boolean defaultXhtml = false;
- boolean defaultWML = false;
- boolean isWML = false;
-
- if (element.getName().equals(TAG_NAME)) {
- pid = element.getAttribute(ATT_PID);
- // publicID attribute is mandatory.
- if (pid == null || pid.equals(ATV_NULL_STRING))
- return null;
-
- sid = element.getAttribute(ATT_SID);
- nsuri = element.getAttribute(ATT_NSURI);
- root = element.getAttribute(ATT_ENAME);
- xhtml = getBoolean(element, ATT_IS_XHTML);
- frameset = getBoolean(element, ATT_HAS_FRAMESET);
- dname = element.getAttribute(ATT_DNAME);
- defaultXhtml = getBoolean(element, ATT_IS_DEFAULT_XHTML);
- defaultWML = getBoolean(element, ATT_IS_DEFAULT_WML);
- isWML = getBoolean(element, ATT_IS_WML);
- doctype = new HTMLDocumentTypeEntry(root, pid, sid, nsuri, xhtml, frameset, dname, defaultXhtml, defaultWML, isWML);
- }
- return doctype;
- }
-
- /**
- */
- private boolean getBoolean(IConfigurationElement element, String att) {
- String value = element.getAttribute(att);
- if (value != null && value.equals(ATV_TRUE))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
deleted file mode 100644
index 4e7ddcb52b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.document.CMNodeUtil;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * HTMLDocumentImpl class
- */
-public class HTMLModelParserAdapter implements ModelParserAdapter {
- /**
- * note: I made public, temparily, so could be used by JSPLoader
- */
- protected HTMLModelParserAdapter() {
- super();
- }
-
- private boolean shouldTerminateAt(CMElementDeclaration parent, CMElementDeclaration child) {
- if (!parent.supports(HTMLCMProperties.TERMINATORS))
- return false;
- java.util.Iterator i = (java.util.Iterator) parent.getProperty(HTMLCMProperties.TERMINATORS);
- if (i == null)
- return false;
- String nextName = child.getElementName();
- while (i.hasNext()) {
- // NOTE: CMElementDeclaration of child is not always HTMLCMElementDeclaration.
- // It might be one of based on DTD (for XHTML element). So, comparison must
- // be performed ignoring case.
- // -- 3/20/2002
- String terminator = (String) i.next();
- if (terminator == null)
- continue;
- if (nextName.equalsIgnoreCase(terminator))
- return true;
- }
- return false;
- }
-
- public boolean isEndTagOmissible(Element element) {
- CMElementDeclaration dec = CMNodeUtil.getElementDeclaration(element);
- if (dec == null || !(dec instanceof HTMLPropertyDeclaration))
- return false;
- int type = ((HTMLPropertyDeclaration)dec ).getOmitType();
- return type == HTMLElementDeclaration.OMIT_BOTH || type == HTMLElementDeclaration.OMIT_END || type == HTMLElementDeclaration.OMIT_END_DEFAULT || type == HTMLElementDeclaration.OMIT_END_MUST;
- }
-
- /**
- */
- public boolean canContain(Element element, Node child) {
- if (element == null || child == null)
- return false;
- IDOMElement impl = (IDOMElement) element;
-
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (!impl.isGlobalTag())
- return true; // non HTML tag
- IDOMElement childElement = (IDOMElement) child;
-
- CMElementDeclaration myDec = CMNodeUtil.getElementDeclaration(element);
- if (myDec == null)
- return true;
- //if (!(myDec instanceof HTMLElementDeclaration)) return true;
- if (myDec.getContentType() == CMElementDeclaration.EMPTY)
- return false;
-
- if (!childElement.isGlobalTag())
- return true; // non HTML tag
- CMElementDeclaration childDec = CMNodeUtil.getElementDeclaration(childElement);
- if (childDec == null)
- return true;
- //if (!(childDec instanceof HTMLElementDeclaration)) return true;
-
- if (myDec instanceof HTMLElementDeclaration) {
- if (((Boolean) ((HTMLElementDeclaration) myDec).getProperty(HTMLCMProperties.IS_JSP)).booleanValue())
- return true;
- }
- if (shouldTerminateAt(myDec, childDec) && !isValidChild(myDec, childDec)) {
- return false;
- }
-
- String tagName = impl.getTagName();
- if (tagName == null)
- return true;
- String childName = childElement.getTagName();
- if (childName == null)
- return true;
- if (!impl.hasStartTag() && !impl.hasEndTag()) {
- // implicit element
- if (tagName.equalsIgnoreCase(childElement.getTagName()))
- return false;
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
- if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.META) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.TITLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.ISINDEX)) {
- return false;
- }
- }
-
- Node parent = element.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement parentElement = (IDOMElement) parent;
- if (!parentElement.hasStartTag() && !parentElement.hasEndTag()) {
- if (!canContain(parentElement, child))
- return false;
- }
- }
- return true;
- }
-
- // contexual termination for TABLE content tags
- boolean isTableContent = false;
- if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TR)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TH)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TR) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- if (isTableContent) {
- // TABLE content tags should terminate non TABLE content tags,
- // if in TABLE
- for (Node parent = element.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- IDOMElement parentElement = (IDOMElement) parent;
- String parentName = parentElement.getTagName();
- if (parentName == null)
- continue;
- if (parentName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return false;
- }
- }
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
- if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.NOEMBED))
- return false;
- }
- }
- else if (child.getNodeType() == Node.TEXT_NODE) {
- String tagName = impl.getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
- IDOMText text = (IDOMText) child;
- if (!text.isElementContentWhitespace())
- return false;
- }
- }
- else if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- if (impl.isImplicitTag())
- return false;
- }
-
- return true;
- }
-
- /**
- */
- public boolean canBeImplicitTag(Element element) {
- return false;
- }
-
- /**
- */
- public boolean canBeImplicitTag(Element element, Node child) {
- return false;
- }
-
- /**
- */
- public Element createCommentElement(Document document, String data, boolean isJSPTag) {
- if (document == null || data == null || data.length() == 0)
- return null;
-
- return createMetaElement(document, data, isJSPTag);
- }
-
- /**
- * This routine create an implicit Element for given parent and child,
- * such as HTML, BODY, HEAD, and TBODY for HTML document.
- */
- public Element createImplicitElement(Document document, Node parent, Node child) {
- return null;
- }
-
- /**
- */
- private Element createMetaElement(Document document, String data, boolean isJSPTag) {
- if (data == null || data.length() == 0)
- return null;
-
- TagScanner scanner = new TagScanner(data, 0, true); // one line
- String name = scanner.nextName();
- if (name == null || !name.equalsIgnoreCase(MetaData.METADATA))
- return null;
-
- String type = null;
- boolean isStartSpan = false;
- boolean isEndSpan = false;
- name = scanner.nextName();
- while (name != null) {
- String value = scanner.nextValue();
- if (name.equalsIgnoreCase(MetaData.TYPE)) {
- if (value == null)
- return null;
- if (value.equalsIgnoreCase(MetaData.DESIGNER_CONTROL)) {
- type = MetaData.DESIGNER_CONTROL;
- }
- else if (value.equalsIgnoreCase(MetaData.DYNAMIC_DATA)) {
- type = MetaData.DYNAMIC_DATA;
- }
- else if (value.equalsIgnoreCase(MetaData.AUTHOR_TIME_VISUAL)) {
- type = MetaData.AUTHOR_TIME_VISUAL;
- }
- else if (value.equalsIgnoreCase(MetaData.ANNOTATION)) {
- type = MetaData.ANNOTATION;
- }
- else {
- return null;
- }
- }
- else if (name.equalsIgnoreCase(MetaData.STARTSPAN)) {
- isStartSpan = true;
- }
- else if (name.equalsIgnoreCase(MetaData.ENDSPAN)) {
- if (!isStartSpan)
- isEndSpan = true;
- }
- name = scanner.nextName();
- }
- if (type == null)
- return null;
- if (!isStartSpan && !isEndSpan)
- return null;
- String metaData = null;
- int offset = scanner.getNextOffset(); // skip new line
- if (offset < data.length())
- metaData = data.substring(offset);
- if (metaData == null)
- metaData = new String();
-
- IDOMElement element = (IDOMElement) document.createElement(MetaData.PREFIX + type);
-
- MetaDataAdapter adapter = new MetaDataAdapter(type);
- if (isStartSpan) {
- if (metaData != null)
- adapter.setData(metaData);
- }
- else {
- if (metaData != null)
- adapter.setEndData(metaData);
- }
- element.addAdapter(adapter);
- adapter.setElement(element);
- element.setJSPTag(isJSPTag);
-
- return element;
- }
-
- /**
- */
- public String getFindRootName(String tagName) {
- if (tagName == null)
- return null;
- // tag matching should not beyond TABLE tag except BODY tag
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BODY))
- return null;
- return HTML40Namespace.ElementName.TABLE;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == ModelParserAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag(IDOMElement element) {
- TagAdapter adapter = (TagAdapter) element.getExistingAdapter(TagAdapter.class);
- if (adapter != null)
- return adapter.isEndTag();
- return element.isEndTag();
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing on notifiy change
- // TODO: this means good candidate for regular platform adapter
- }
-
- private static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
- if (parent == null || child == null)
- return false;
- CMContent content = parent.getContent();
- if (content == null)
- return false;
- return isChild(content, child);
- }
-
- /**
- */
- private static boolean isChild(CMContent content, CMElementDeclaration target) {
- switch (content.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- return isSameDeclaration((CMElementDeclaration) content, target);
- case CMNode.GROUP :
- CMNodeList children = ((CMGroup) content).getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- switch (child.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isSameDeclaration((CMElementDeclaration) child, target))
- return true;
- continue; // Go next child.
- case CMNode.GROUP :
- if (isChild((CMContent) child, target))
- return true;
- continue; // Go next child.
- default :
- continue; // Go next child.
- }
- }
- }
- return false;
- }
-
- /**
- */
- private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
- return aDec.getElementName() == otherDec.getElementName();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java
deleted file mode 100644
index 98765e8d3b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLModelParserAdapterFactory implements INodeAdapterFactory {
-
- private static HTMLModelParserAdapterFactory instance = null;
-
- /**
- */
- private HTMLModelParserAdapterFactory() {
- super();
- }
-
- /**
- * Method that returns the adapter associated with the given object. It
- * may be a singleton or not ... depending on the needs of the
- * INodeAdapter ... but in general it is recommended for an adapter to be
- * stateless, so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter adapter = null;
- if (notifier != null) {
- if (notifier instanceof IDOMDocument) {
- adapter = notifier.getExistingAdapter(ModelParserAdapter.class);
- if (adapter == null) {
- adapter = new HTMLModelParserAdapter();
- notifier.addAdapter(adapter);
- }
- }
- }
- return adapter;
-
- }
-
- /**
- */
- public synchronized static HTMLModelParserAdapterFactory getInstance() {
- if (instance == null)
- instance = new HTMLModelParserAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == ModelParserAdapter.class);
- }
-
- /**
- */
- public void release() {
- // no state to cleanup
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java
deleted file mode 100644
index a05758c072..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-public interface MetaData {
-
- static final String METADATA = "METADATA";//$NON-NLS-1$
- static final String TYPE = "type";//$NON-NLS-1$
- static final String STARTSPAN = "startspan";//$NON-NLS-1$
- static final String ENDSPAN = "endspan";//$NON-NLS-1$
- static final String DESIGNER_CONTROL = "DesignerControl";//$NON-NLS-1$
- static final String DYNAMIC_DATA = "DynamicData";//$NON-NLS-1$
- static final String AUTHOR_TIME_VISUAL = "AuthorTimeVisual";//$NON-NLS-1$
- static final String ANNOTATION = "Annotation";//$NON-NLS-1$
- static final String PREFIX = "METADATA:";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
deleted file mode 100644
index 9b8596e610..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- */
-public class MetaDataAdapter implements TagAdapter, MetaData {
-
- private IDOMElement element = null;
- private String type = null;
- private String data = null;
- private String endData = null;
-
- /**
- */
- public MetaDataAdapter(String type) {
- super();
-
- if (type != null) {
- if (type.equals(ANNOTATION)) {
- this.type = ANNOTATION;
- }
- else if (type.equals(AUTHOR_TIME_VISUAL)) {
- this.type = AUTHOR_TIME_VISUAL;
- }
- else {
- this.type = type;
- }
- }
- }
-
- /**
- */
- private String getData(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return null;
-
- String data = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (isCommentText(regionType)) {
- data = flatNode.getText(region);
- break;
- }
- }
- if (data == null)
- return null;
- int length = data.length();
- int offset = 0;
- for (; offset < length; offset++) {
- char c = data.charAt(offset);
- if (c == '\r' || c == '\n') {
- offset++;
- break;
- }
- }
- for (; offset < length; offset++) {
- char c = data.charAt(offset);
- if (c != '\r' && c != '\n') {
- break;
- }
- }
- return data.substring(offset);
- }
-
- private boolean isCommentText(String regionType) {
- boolean result = false;
- result = isDOMComment(regionType) || isNestedContentComment(regionType);
- return result;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
-
- private boolean isNestedContentComment(String regionType) {
- final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
- return regionType.equals(JSP_COMMENT_TEXT);
- }
-
- private boolean isDOMComment(String regionType) {
- return regionType == DOMRegionContext.XML_COMMENT_TEXT;
- }
-
- public String getData() {
- if (this.element == null)
- return null;
- IStructuredDocumentRegion flatNode = this.element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- if (this.data != null)
- return this.data;
- return getData(flatNode);
- }
-
- /**
- */
- private String getDelimiter(IDOMModel model) {
- String delim = null;
- if (model != null) {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument != null)
- delim = structuredDocument.getLineDelimiter();
- }
- if (delim == null)
- delim = "\r\n";//$NON-NLS-1$
- return delim;
- }
-
- /**
- */
- public String getEndData() {
- if (this.element == null)
- return null;
- IStructuredDocumentRegion flatNode = this.element.getEndStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- if (this.endData != null)
- return this.endData;
- return getData(flatNode);
- }
-
- /**
- */
- public String getEndTag(IDOMElement element) {
- StringBuffer buffer = new StringBuffer();
- if (element.isJSPTag())
- buffer.append("<%--");//$NON-NLS-1$
- else
- buffer.append("<!--");//$NON-NLS-1$
- buffer.append(METADATA);
- buffer.append(' ');
- buffer.append(TYPE);
- buffer.append("=\"");//$NON-NLS-1$
- buffer.append(this.type);
- buffer.append("\" ");//$NON-NLS-1$
- buffer.append(MetaData.ENDSPAN);
- String data = getEndData();
- if (data != null && data.length() > 0) {
- String delim = getDelimiter(element.getModel());
- buffer.append(delim);
- buffer.append(data);
- buffer.append(delim);
- }
- if (element.isJSPTag())
- buffer.append("--%>");//$NON-NLS-1$
- else
- buffer.append("-->");//$NON-NLS-1$
-
- return buffer.toString();
- }
-
- /**
- */
- public String getStartTag(IDOMElement element) {
- StringBuffer buffer = new StringBuffer();
- if (element.isJSPTag())
- buffer.append("<%--");//$NON-NLS-1$
- else
- buffer.append("<!--");//$NON-NLS-1$
- buffer.append(METADATA);
- buffer.append(' ');
- buffer.append(TYPE);
- buffer.append("=\"");//$NON-NLS-1$
- buffer.append(this.type);
- buffer.append("\" ");//$NON-NLS-1$
- buffer.append(MetaData.STARTSPAN);
- String data = getData();
- if (data != null && data.length() > 0) {
- String delim = getDelimiter(element.getModel());
- buffer.append(delim);
- buffer.append(data);
- buffer.append(delim);
- }
- if (element.isJSPTag())
- buffer.append("--%>");//$NON-NLS-1$
- else
- buffer.append("-->");//$NON-NLS-1$
-
- return buffer.toString();
- }
-
- /**
- */
- public String getType() {
- return this.type;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == TagAdapter.class || type == MetaDataAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag() {
- if (this.element == null)
- return false;
- if (this.element.hasStartTag())
- return false;
- if (this.element.hasEndTag())
- return true;
- if (this.data != null)
- return false;
- return (this.endData != null);
- }
-
- /**
- */
- public boolean isRuntimeContainer() {
- return (this.type == ANNOTATION || this.type == AUTHOR_TIME_VISUAL);
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setData(String data) {
- this.data = data;
-
- if (this.element != null)
- this.element.notifyStartTagChanged();
- }
-
- /**
- */
- public void setEndData(String data) {
- this.endData = data;
-
- if (this.element != null)
- this.element.notifyEndTagChanged();
- }
-
- /**
- */
- public void setElement(IDOMElement element) {
- this.element = element;
-
- if (this.element != null) {
- this.element.setCommentTag(true);
- if (this.type != MetaData.ANNOTATION) {
- this.element.setJSPTag(true);
- }
- }
- }
-
- /**
- */
- public void setRuntimeSource(String source) {
- if (source == null)
- return;
- if (this.element == null)
- return;
- if (isRuntimeContainer())
- return;
-
- IDOMModel model = this.element.getModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- int offset = this.element.getStartEndOffset();
- int end = this.element.getEndStartOffset();
- int length = end - offset;
- structuredDocument.replaceText(model, offset, length, source);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
deleted file mode 100644
index 4cbd5096b2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-class TagScanner {
-
- private String tag = null;
- private int offset = 0;
- private int length = 0;
- private boolean oneLine = false;
-
- /**
- */
- TagScanner(String tag, int offset) {
- super();
-
- this.tag = tag;
- this.offset = offset;
- if (tag != null)
- this.length = tag.length();
- }
-
- /**
- */
- TagScanner(String tag, int offset, boolean oneLine) {
- this(tag, offset);
-
- this.oneLine = oneLine;
- }
-
- /**
- */
- int getNextOffset() {
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (!isEnd(c))
- break;
- }
- return this.offset;
- }
-
- /**
- */
- int getOffset() {
- return this.offset;
- }
-
- /**
- */
- private final boolean isEnd(char c) {
- return (this.oneLine && (c == '\r' || c == '\n'));
- }
-
- /**
- */
- private static boolean isEqual(char c) {
- return (c == '=');
- }
-
- /**
- */
- private static boolean isQuote(char c) {
- return (c == '"' || c == '\'');
- }
-
- /**
- */
- private static boolean isSpace(char c) {
- return Character.isWhitespace(c);
- }
-
- /**
- */
- private char nextChar() {
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c))
- break;
- if (!isSpace(c))
- return c;
- }
- return 0;
- }
-
- /**
- */
- String nextName() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- if (nextChar() == 0)
- return null;
-
- int nameOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c) || isSpace(c))
- break;
- if (isEqual(c) && this.offset > nameOffset)
- break;
- }
- if (this.offset == nameOffset)
- return null;
-
- return this.tag.substring(nameOffset, this.offset);
- }
-
- /**
- */
- String nextValue() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- char seperator = nextChar();
- if (!isEqual(seperator))
- return null;
- this.offset++; // skip '='
- char quote = nextChar();
- if (quote == 0)
- return null;
- if (isQuote(quote))
- this.offset++;
- else
- quote = 0;
-
- int valueOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c)) {
- quote = 0;
- break;
- }
- if (quote == 0) {
- if (isSpace(c))
- break;
- }
- else {
- if (c == quote)
- break;
- }
- }
- int valueEnd = this.offset;
- if (quote != 0 && this.offset < this.length)
- this.offset++;
- if (valueEnd == valueOffset)
- return null;
-
- return this.tag.substring(valueOffset, valueEnd);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
deleted file mode 100644
index ec6053fe0c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- */
-public class UnknownTagAdapter implements TagAdapter {
-
- private String startTag = null;
- private String endTag = null;
-
- /**
- */
- public UnknownTagAdapter() {
- super();
- }
-
- /**
- */
- public String getEndTag(IDOMElement element) {
- String tag = null;
- if (this.endTag != null) {
- tag = this.endTag;
- this.endTag = null;
- }
- return tag;
- }
-
- /**
- */
- public String getStartTag(IDOMElement element) {
- String tag = null;
- if (this.startTag != null) {
- tag = this.startTag;
- this.startTag = null;
- }
- return tag;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == TagAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag() {
- return false;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setEndTag(String endTag) {
- this.endTag = endTag;
- }
-
- /**
- */
- public void setStartTag(String startTag) {
- this.startTag = startTag;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java
deleted file mode 100644
index 40d3692252..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.core.internal.contenttype.HTMLResourceEncodingDetector;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-
-/**
- * This class parses beginning portion of HTML file to get the encoding value
- * in a META tag. Example:
- * <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- *
- * Note: even though, technically, a META tag must come in a <HEAD>tag, we
- * don't check for that, under the assumption that whatever, or whereever, the
- * the first <META>tag is, it is the one intended to be used by the user, and
- * they may just be trying to repair the error. The HTML validator will tell
- * them if its in the wrong location.
- *
- */
-public class HTMLDocumentCharsetDetector extends HTMLResourceEncodingDetector implements IDocumentCharsetDetector {
-
-
- public HTMLDocumentCharsetDetector() {
- super();
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
deleted file mode 100644
index 8027e3c5f6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.html.core.internal.contenttype.EncodingGuesser;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.AbstractDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentLoader extends AbstractDocumentLoader {
-
- public HTMLDocumentLoader() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- /**
- * Default encoding. For HTML, there is no spec.
- */
- protected String getSpecDefaultEncoding() {
- return null;
- }
-
- /**
- * @return java.lang.String
- * @param string
- * byte[]
- * @param length
- * int
- *
- * Do automatic encoding detection by guess
- */
- protected String getEncodingNameByGuess(byte[] string, int length) {
- final String ianaEnc = EncodingGuesser.guessEncoding(string, length);
- return ianaEnc;
- }
-
- /*
- * @see AbstractLoader#createNewStructuredDocument()
- */
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- ((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser());
-
- return structuredDocument;
- }
-
- /*
- * @see IModelLoader#getParser()
- */
- public RegionParser getParser() {
- XMLSourceParser parser = new XMLSourceParser();
- // for the "static HTML" case, we need to initialize
- // Blocktags here.
- addHTMLishTag(parser, "script"); //$NON-NLS-1$
- addHTMLishTag(parser, "style"); //$NON-NLS-1$
- return parser;
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- INodeAdapterFactory factory = null;
- factory = StyleAdapterFactory.getInstance();
- result.add(factory);
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- result.add(factory);
- factory = new HTMLDocumentTypeAdapterFactory();
- result.add(factory);
- factory = HTMLModelParserAdapterFactory.getInstance();
- result.add(factory);
- //
- factory = new ModelQueryAdapterFactoryForHTML();
- result.add(factory);
-
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
-
-
- return result;
- }
-
- protected String getPreferredNewLineDelimiter(IFile file) {
- String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForHTML.ContentTypeID_HTML);
- if (delimiter == null)
- delimiter = super.getPreferredNewLineDelimiter(file);
- return delimiter;
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new HTMLDocumentCharsetDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- // DMW: just added this preload on 8/16/2002
- // I noticed the ProagatingAdapterFactory was being added,
- // that that the ProagatingAdapterAdapter was not being
- // preload adapted -- I'm assuing it ALWAYS has to be.
- IDOMModel domModel = (IDOMModel) structuredModel;
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForHTML();
- }
-
- public IDocumentLoader newInstance() {
- return new HTMLDocumentLoader();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
deleted file mode 100644
index 398b15466e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.model.AbstractModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.DebugAdapterFactory;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLModelLoader extends AbstractModelLoader {
-
-
- public HTMLModelLoader() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- public IStructuredModel newModel() {
- DOMStyleModelImpl model = new DOMStyleModelImpl();
- return model;
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- INodeAdapterFactory factory = null;
- factory = StyleAdapterFactory.getInstance();
- result.add(factory);
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- result.add(factory);
- factory = new HTMLDocumentTypeAdapterFactory();
- result.add(factory);
- factory = HTMLModelParserAdapterFactory.getInstance();
- result.add(factory);
- //
- factory = new ModelQueryAdapterFactoryForHTML();
- result.add(factory);
-
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
-
-
- return result;
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- super.preLoadAdapt(structuredModel);
- // DMW: just added this preload on 8/16/2002
- // I noticed the ProagatingAdapterFactory was being added,
- // that that the ProagatingAdapterAdapter was not being
- // preload adapted -- I'm assuing it ALWAYS has to be.
- IDOMModel domModel = (IDOMModel) structuredModel;
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- if (Debug.debugNotificationAndEvents) {
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
- } }
-
- public IModelLoader newInstance() {
- return new HTMLModelLoader();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new HTMLDocumentLoader();
- }
- return documentLoaderInstance;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
deleted file mode 100644
index 74ec679e83..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-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.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-
-// nakamori_TODO: check and remove
-
-public class EmbeddedCSSFormatter extends HTMLFormatter {
-
- // private IAdapterFactory factory = new
- // CSSSourceFormatterFactory(CSSSourceFormatter.class, true);
- /**
- */
- protected EmbeddedCSSFormatter() {
- super();
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- IDOMText text = (IDOMText) node;
-
- String source = getCSSContent(node);
- if (source == null) { // fallback
- source = text.getSource();
- }
-
- int offset = text.getStartOffset();
- int length = text.getEndOffset() - offset;
- replaceSource(text.getModel(), offset, length, source);
- setWidth(contraints, source);
- }
-
- /**
- */
- private String getCSSContent(IDOMNode text) {
- ICSSModel model = getCSSModel(text);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
- // try another way to get formatter
- if (formatter == null)
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
- if (formatter == null)
- return null;
- StringBuffer buffer = formatter.format(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private ICSSModel getCSSModel(IDOMNode text) {
- if (text == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) text.getParentNode();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
- return styleAdapter.getModel();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
deleted file mode 100644
index ce14df4cac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import java.util.Iterator;
-
-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.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class HTMLElementFormatter extends HTMLFormatter {
-
- /**
- */
- protected HTMLElementFormatter() {
- super();
- }
-
- /**
- */
- private void compressTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count == 1) {
- String source = flatNode.getFullText(region);
- int start = region.getStart();
- if (source != null && source.charAt(offset - start) == ' ') {
- // nothing to do
- return;
- }
- }
- replaceSource(flatNode, offset, count, " ");//$NON-NLS-1$
- }
-
- /**
- */
- private void formatEndTag(IDOMElement element, HTMLFormatContraints contraints) {
- Node lastChild = element.getLastChild();
-
- if (lastChild != null && lastChild instanceof IDOMElement && lastChild.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
- insertBreakAfter((IDOMElement) lastChild, contraints);
- return;
- }
-
-
- IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion == null)
- return;
-
- if (element.isJSPTag() || element.isCommentTag()) {
- String endTag = endStructuredDocumentRegion.getText();
- if (endTag != null && endTag.length() > 0) {
- setWidth(contraints, endTag);
- }
- return;
- }
-
- ITextRegion prevRegion = null;
- ITextRegionList regions = endStructuredDocumentRegion.getRegions();
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTag(regionType)) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
- }
- prevRegion = region;
- }
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
-
- // BUG123890 (end tag length was already prefactored into
- // formatStartTag so no need to do it here)
- // String newEndTag = endStructuredDocumentRegion.getText();
- // if (newEndTag != null && newEndTag.length() > 0) {
- // setWidth(contraints, newEndTag);
- // }
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- IDOMElement element = (IDOMElement) node;
-
- formatStartTag(element, contraints);
-
- formatChildNodes(element, contraints);
-
- formatEndTag(element, contraints);
- }
-
- /**
- */
- private void formatStartTag(IDOMElement element, HTMLFormatContraints contraints) {
-
- if (element.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
- insertBreakBefore(element, contraints);
- return;
- }
-
- IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion == null)
- return;
-
- // We should format attributes in JSPTag?
- // if (element.isJSPTag() || element.isCommentTag()) {
- if (element.isCommentTag()) {
- String startTag = startStructuredDocumentRegion.getText();
- if (startTag != null && startTag.length() > 0) {
- setWidth(contraints, startTag);
- }
- return;
- }
-
- // first process style attribute
- if (element.isGlobalTag()) {
- Attr attr = element.getAttributeNode("style");//$NON-NLS-1$
- if (attr != null)
- formatStyleAttr(attr);
- }
- boolean insertBreak = false;
- insertBreak = ((StructuredFormatPreferencesXML) getFormatPreferences()).getSplitMultiAttrs();
- boolean alignEndBracket = ((StructuredFormatPreferencesXML) getFormatPreferences()).isAlignEndBracket();
- boolean attributesSplitted = false;
-
- if (insertBreak) {
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null || attributes.getLength() < 2)
- insertBreak = false;
- }
- String breakSpaces = getBreakSpaces(element);
- String originalBreakSpaces = breakSpaces;
- String indent = getIndent();
- if (indent != null && indent.length() > 0) {
- breakSpaces += indent;
- }
- ITextRegion lastBreakRegion = null;
-
- ITextRegion prevRegion = null;
- ITextRegionList regions = startStructuredDocumentRegion.getRegions();
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
-
- ITextRegion breakRegion = null;
-
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTag(regionType)) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_OPEN) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- breakRegion = region;
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- breakRegion = prevRegion;
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- breakRegion = region;
- }
- else if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- breakRegion = prevRegion;
- }
- }
-
- if (breakRegion != null) {
- int end = breakRegion.getTextEnd();
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getEnd();
- int count = end - offset;
- if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
- replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
- setWidth(contraints, breakSpaces);
- attributesSplitted = true;
- }
- else {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- addWidth(contraints, 1);
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, end);
- }
- lastBreakRegion = breakRegion;
- }
-
- prevRegion = region;
- }
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- int end = prevRegion.getTextEnd();
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getEnd();
- int count = end - offset;
- if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
- replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
- setWidth(contraints, breakSpaces);
- attributesSplitted = true;
- }
- else {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- addWidth(contraints, 1);
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, end);
- }
- lastBreakRegion = prevRegion;
- }
-
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getTextEnd();
- int count = startStructuredDocumentRegion.getLength() - offset;
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- count++;
- }
- else {
- removeTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- // BUG123890 (pre-factor in end tag)
- count += element.getTagName().length() + 3;
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, startStructuredDocumentRegion.getLength());
- }
- // BUG113584 - align last bracket
- if (alignEndBracket && attributesSplitted) {
- removeTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, originalBreakSpaces);
- contraints.setAvailableLineWidth(getLineWidth() - originalBreakSpaces.length() - 1);
- }
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedTag(String regionType) {
- final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
- boolean result = regionType.equals(JSP_ROOT_TAG_NAME) || regionType.equals(JSP_DIRECTIVE_NAME);
- return result;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedRootTag(String regionType) {
- final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
- boolean result = regionType.equals(JSP_ROOT_TAG_NAME);
- return result;
- }
-
-
- /**
- */
- private void formatStyleAttr(Attr attr) {
- if (attr == null)
- return;
- // if someone's made it a container somehow, CSS can't format it
- if (((IDOMNode) attr).getValueRegion() instanceof ITextRegionContainer)
- return;
- String value = getCSSValue(attr);
- if (value == null)
- return;
- String oldValue = ((IDOMNode) attr).getValueSource();
- if (oldValue != null && value.equals(oldValue))
- return;
- attr.setValue(value);
- }
-
- /**
- */
- private ICSSModel getCSSModel(Attr attr) {
- if (attr == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
- return styleAdapter.getModel();
- }
-
- /**
- */
- private String getCSSValue(Attr attr) {
- ICSSModel model = getCSSModel(attr);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
- // try another way to get formatter
- if (formatter == null)
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
- if (formatter == null)
- return null;
- StringBuffer buffer = formatter.format(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private void removeTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count <= 0)
- return;
- replaceSource(flatNode, offset, count, null);
- }
-
- /**
- */
- private void replaceTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region, String spaces) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count == spaces.length()) {
- String source = flatNode.getFullText(region);
- if (source != null && source.endsWith(spaces)) {
- // nothing to do
- return;
- }
- }
- replaceSource(flatNode, offset, count, spaces);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java
deleted file mode 100644
index bf81533ea5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public class HTMLFormatContraintsImpl extends StructuredFormatContraints implements HTMLFormatContraints {
- protected int fAvailableLineWidth;
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- public int getAvailableLineWidth() {
- return fAvailableLineWidth;
- }
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- public void setAvailableLineWidth(int availableLineWidth) {
- fAvailableLineWidth = availableLineWidth;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java
deleted file mode 100644
index 0552bc2d5e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-public class HTMLFormatProcessorImpl extends FormatProcessorXML {
- protected String getFileExtension() {
- return "html"; //$NON-NLS-1$
- }
-
- protected IStructuredFormatter getFormatter(Node node) {
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(node, getFormatPreferences());
-
- return formatter;
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
deleted file mode 100644
index 38e003fdd5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
+++ /dev/null
@@ -1,859 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 - fix for bug #203252
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class HTMLFormatter implements IStructuredFormatter {
-
- private static final String HTML_NAME = "html";//$NON-NLS-1$
- private static final String HEAD_NAME = "head"; //$NON-NLS-1$
- private static final String BODY_NAME = "BODY";//$NON-NLS-1$
- // hidden jsp logic that should be removed when jsp formatter is created
- private static final String JSP = "jsp";//$NON-NLS-1$
-
- private HTMLFormattingUtil formattingUtil;
-
- public HTMLFormatter() {
- formattingUtil = new HTMLFormattingUtil();
- }
-
- /**
- */
- protected void addWidth(HTMLFormatContraints contraints, int width) {
- if (contraints == null)
- return;
- if (!splitLines() || getLineWidth() < 0)
- return;
-
- int availableWidth = contraints.getAvailableLineWidth() - width;
- if (availableWidth < 0)
- availableWidth = 0;
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected boolean canFormatChild(Node node) {
- while (node != null) {
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return true;
- CMElementDeclaration decl = getElementDeclaration((Element) node);
- if (decl != null) {
- if (decl.getContentType() == CMElementDeclaration.CDATA)
- return false;
- if (decl.supports(HTMLCMProperties.SHOULD_KEEP_SPACE)) {
- boolean shouldKeepSpace = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_KEEP_SPACE)).booleanValue();
- if (shouldKeepSpace)
- return false;
- }
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- */
- protected boolean canInsertBreakAfter(CMElementDeclaration decl) {
- if (decl == null)
- return false;
- if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- if (hint == null)
- return false;
- return (hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END) || hint.equals(HTMLCMProperties.Values.BREAK_AFTER_START));
- }
-
- /**
- */
- protected boolean canInsertBreakAfter(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- Node next = node.getNextSibling();
-
- // special exception if this node is a non-HTML tag (like JSP
- // elements)
- // BUG188093 - only preserve whitespace for jsp (not custom) tags
- String prefix = node.getPrefix();
- if (prefix != null && JSP.equals(prefix)) {
- boolean canInsertBreakAfter = false;
- // if a whitespace does not exist after it, do not add one
- if (next != null && next.getNodeType() == Node.TEXT_NODE) {
- String theText = ((Text) next).getData();
- if (theText != null && theText.length() > 0) {
- char theChar = theText.charAt(0);
- canInsertBreakAfter = Character.isWhitespace(theChar);
- }
- }
- // if cannot insert break, go ahead and return false (otherwise,
- // continue processing)
- if (!canInsertBreakAfter)
- return false;
- }
-
- // special exception if next node is a non-HTML tag (like JSP
- // elements)
- // BUG188093 - only preserve whitespace for jsp (not custom) tags
- if (next != null) {
- prefix = next.getPrefix();
- if (prefix != null && JSP.equals(prefix)) {
- boolean canInsertBreakAfterPrevious = false;
- // if a whitespace does not exist before it, do not add one
- if (node.getNodeType() == Node.TEXT_NODE) {
- String theText = ((Text) node).getData();
- if (theText != null && theText.length() > 0) {
- char theChar = theText.charAt(theText.length() - 1);
- canInsertBreakAfterPrevious = Character.isWhitespace(theChar);
- }
- }
- // if cannot insert break, go ahead and return false
- // (otherwise,
- // continue processing)
- if (!canInsertBreakAfterPrevious)
- return false;
- }
- }
- if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // do not insert break after unclosed tag
- if (!((IDOMElement) node).isClosed())
- return false;
- }
- return true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- // do not insert break before missing end tag
- if (next == null && element.getEndStructuredDocumentRegion() == null)
- return false;
-
- // insert line break under non-HTML elements including JSP
- // elements
- if (element.getPrefix() != null)
- return true;
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null) {
- if (decl.getContentType() == CMElementDeclaration.ELEMENT)
- return true;
- // causes all closing tags to wrap to a new line
- boolean allowsText = decl.getContentType() == CMElementDeclaration.MIXED
- || decl.getContentType() == CMElementDeclaration.PCDATA;
- if (allowsNewlineAfter(allowsText, node, element))
- return true;
- String tagName = element.getTagName();
- // special for direct children under BODY
- if (tagName != null && tagName.equalsIgnoreCase(BODY_NAME))
- return true;
- }
- }
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- CMElementDeclaration decl = getElementDeclaration(element);
- if (canInsertBreakAfter(decl)) {
- // spcial for BR
- return canFormatChild(parent);
- }
- }
- if (next != null && next.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration decl = getElementDeclaration((Element) next);
- if (canInsertBreakBefore(decl))
- return true;
- }
- return false;
- }
-
- /**
- */
- protected boolean canInsertBreakBefore(CMElementDeclaration decl) {
- if (decl == null)
- return false;
- if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- if (hint == null)
- return false;
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- protected boolean canInsertBreakBefore(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- Node prev = node.getPreviousSibling();
-
- // special exception if this node is a non-HTML tag (like JSP
- // elements)
- // BUG188093 - only preserve whitespace for jsp (not custom) tags
- String prefix = node.getPrefix();
- if (prefix != null && JSP.equals(prefix)) {
- boolean canInsertBreakBefore = false;
- // if a whitespace does not exist before it, do not add one
- if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- String theText = ((Text) prev).getData();
- if (theText != null && theText.length() > 0) {
- char theChar = theText.charAt(theText.length() - 1);
- canInsertBreakBefore = Character.isWhitespace(theChar);
- }
- }
- // if cannot insert break, go ahead and return false (otherwise,
- // continue processing)
- if (!canInsertBreakBefore)
- return false;
- }
-
- // special exception if previous node is a non-HTML tag (like JSP
- // elements)
- // BUG188093 - only preserve whitespace for jsp (not custom) tags
- if (prev != null) {
- prefix = prev.getPrefix();
- if (prefix != null && JSP.equals(prefix)) {
- boolean canInsertBreakBeforeNext = false;
- // if a whitespace does not exist after it, do not add one
- if (node.getNodeType() == Node.TEXT_NODE) {
- String theText = ((Text) node).getData();
- if (theText != null && theText.length() > 0) {
- char theChar = theText.charAt(0);
- canInsertBreakBeforeNext = Character.isWhitespace(theChar);
- }
- }
- // if cannot insert break, go ahead and return false
- // (otherwise,
- // continue processing)
- if (!canInsertBreakBeforeNext)
- return false;
- }
- }
-
- if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- if (prev == null)
- return false;
- return true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- // do not insert break after missing start tag
- if (prev == null && element.getStartStructuredDocumentRegion() == null)
- return false;
-
- // insert line break under non-HTML elements including JSP
- // elements
- if (element.getPrefix() != null)
- return true;
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null) {
- return allowNewlineBefore(node, element);
- }
- }
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- return true;
- }
- if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration decl = getElementDeclaration((Element) prev);
- if (canInsertBreakAfter(decl)) {
- // spcial for BR
- return canFormatChild(parent);
- }
- }
- return false;
- }
-
- /**
- */
- public void format(Node node) {
- format(node, getFormatContraints());
- }
-
- /**
- */
- public void format(Node node, IStructuredFormatContraints contraints) {
- if (node instanceof IDOMNode && contraints instanceof HTMLFormatContraints)
- format((IDOMNode) node, (HTMLFormatContraints) contraints);
- }
-
- public void format(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getParentNode() == null)
- return; // do not format removed node
-
- setWidth(contraints, node);
-
- if (canInsertBreakBefore(node))
- insertBreakBefore(node, contraints);
-
- formatNode(node, contraints);
-
- if (canInsertBreakAfter(node))
- insertBreakAfter(node, contraints);
- }
-
- /**
- */
- protected void formatChildNodes(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (!node.hasChildNodes())
- return;
-
- // concat adjacent texts
- node.normalize();
-
- // disable sibling indent during formatting all the children
- boolean indent = false;
- if (contraints != null) {
- indent = contraints.getFormatWithSiblingIndent();
- contraints.setFormatWithSiblingIndent(false);
- }
-
- boolean insertBreak = true;
- IDOMNode child = (IDOMNode) node.getFirstChild();
- while (child != null) {
- if (child.getParentNode() != node)
- break;
- IDOMNode next = (IDOMNode) child.getNextSibling();
-
- if (insertBreak && canInsertBreakBefore(child)) {
- insertBreakBefore(child, contraints);
- }
-
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(child, getFormatPreferences());
- if (formatter != null) {
- if (formatter instanceof HTMLFormatter) {
- HTMLFormatter htmlFormatter = (HTMLFormatter) formatter;
- htmlFormatter.formatNode(child, contraints);
- }
- else {
- formatter.format(child);
- }
- }
-
- if (canInsertBreakAfter(child)) {
- insertBreakAfter(child, contraints);
- insertBreak = false; // not to insert twice
- }
- else {
- insertBreak = true;
- }
-
- child = next;
- }
-
- if (contraints != null)
- contraints.setFormatWithSiblingIndent(indent);
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
-
- if (node.hasChildNodes()) { // container
- formatChildNodes(node, contraints);
- }
- else { // leaf
- IStructuredDocumentRegion flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- String source = flatNode.getText();
- if (source != null && source.length() > 0) {
- setWidth(contraints, source);
- }
- }
- }
- }
-
- /**
- */
- protected String getBreakSpaces(Node node) {
- if (node == null)
- return null;
- StringBuffer buffer = new StringBuffer();
-
- String delim = ((IDOMNode) node).getModel().getStructuredDocument().getLineDelimiter();
- if (delim != null && delim.length() > 0)
- buffer.append(delim);
-
- String indent = getIndent();
- if (indent != null && indent.length() > 0) {
- for (Node parent = node.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- // ignore omitted tag
- if (((IDOMNode) parent).getStartStructuredDocumentRegion() == null)
- continue;
-
- IDOMElement element = (IDOMElement) parent;
- if (element.getPrefix() != null) {
- String localName = element.getLocalName();
- // special for html:html
- if (localName != null && !localName.equals(HTML_NAME)) {
- buffer.append(indent);
- }
- continue;
- }
- else {
- String localName = element.getLocalName();
- if (HTML_NAME.equalsIgnoreCase(localName) || HEAD_NAME.equalsIgnoreCase(localName))
- break;
- }
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null && decl.supports(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)) {
- boolean shouldIndent = isIdentable(node, parent);
- if (shouldIndent)
- buffer.append(indent);
- }
-
- }
- }
-
- return buffer.toString();
- }
-
- /**
- */
- protected String getIndent() {
- return getFormatPreferences().getIndent();
- }
-
- /**
- */
- protected int getLineWidth() {
- return getFormatPreferences().getLineWidth();
- }
-
- /**
- */
- protected CMElementDeclaration getElementDeclaration(Element element) {
- if (element == null)
- return null;
- Document document = element.getOwnerDocument();
- if (document == null)
- return null;
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- return null;
- return modelQuery.getCMElementDeclaration(element);
- }
-
- /**
- * Checks if the content of an inline node has been formatted in any way
- * @param parent the parent node to check for formatting
- * @return true if the parent node is inline and also has text formatting
- */
- protected boolean isContentFormatted(Node parent) {
- final Node first = parent.getFirstChild();
- if (first != null && first.getNodeType() == Node.TEXT_NODE) {
- final String content = first.getNodeValue();
- final int length = content.length();
- for (int i = 0; i < length; i++) {
- final char c = content.charAt(i);
- if (c == '\r' || c == '\n') {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- */
- protected void insertBreakAfter(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
- // don't insert break if node is on the last line
- int documentLength = node.getStructuredDocument().getLength();
- if (documentLength < 1 || (node.getEndOffset() >= (documentLength - 1)))
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Node next = node.getNextSibling();
-
- String spaces = null;
- if (next == null) { // last spaces
- // If the parent is inline and its content is not formatted don't insert
- if (formattingUtil.isInline(parent) && !isContentFormatted(parent))
- return;
- // use parent indent for the end tag
- spaces = getBreakSpaces(parent);
- }
- else if (next.getNodeType() == Node.TEXT_NODE) {
- if (contraints != null && contraints.getFormatWithSiblingIndent()) {
- IDOMNode text = (IDOMNode) next;
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
- if (formatter instanceof HTMLTextFormatter) {
- HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
- textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_HEAD);
- }
- }
- return;
- }
- else {
- spaces = getBreakSpaces(node);
- }
- if (spaces == null || spaces.length() == 0)
- return;
-
- replaceSource(node.getModel(), node.getEndOffset(), 0, spaces);
- setWidth(contraints, spaces);
- }
-
- /**
- */
- protected void insertBreakBefore(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Node prev = node.getPreviousSibling();
-
- String spaces = null;
- if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- if (contraints != null && contraints.getFormatWithSiblingIndent()) {
- IDOMNode text = (IDOMNode) prev;
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
- if (formatter instanceof HTMLTextFormatter) {
- HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
- textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_TAIL);
- }
- }
- return;
- }
- else {
- spaces = getBreakSpaces(node);
- }
- if (spaces == null || spaces.length() == 0)
- return;
-
- replaceSource(node.getModel(), node.getStartOffset(), 0, spaces);
- setWidth(contraints, spaces);
- }
-
- /**
- */
- protected boolean isWidthAvailable(HTMLFormatContraints contraints, int width) {
- if (contraints == null)
- return true;
- if (!splitLines() || getLineWidth() < 0)
- return true;
- return (contraints.getAvailableLineWidth() >= width);
- }
-
- /**
- */
- protected boolean keepBlankLines(HTMLFormatContraints contraints) {
- if (contraints == null)
- return true;
- return (!contraints.getClearAllBlankLines());
- }
-
- /**
- */
- protected void replaceSource(IStructuredDocumentRegion flatNode, int offset, int length, String source) {
- if (flatNode == null)
- return;
- IStructuredDocument structuredDocument = flatNode.getParentDocument();
- if (structuredDocument == null)
- return;
- if (source == null)
- source = new String();
- int startOffset = flatNode.getStartOffset();
- if (structuredDocument.containsReadOnly(startOffset + offset, length))
- return;
- // We use 'structuredDocument' as the requester object just so this
- // and the other
- // format-related 'repalceText' (in replaceSource) can use the same
- // requester.
- // Otherwise, if requester is not identical,
- // the undo group gets "broken" into multiple pieces based
- // on the requesters being different. Technically, any unique, common
- // requester object would work.
- structuredDocument.replaceText(structuredDocument, startOffset + offset, length, source);
- }
-
- /**
- */
- protected void replaceSource(IDOMModel model, int offset, int length, String source) {
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- if (source == null)
- source = new String();
- if (structuredDocument.containsReadOnly(offset, length))
- return;
- // We use 'structuredDocument' as the requester object just so this
- // and the other
- // format-related 'repalceText' (in replaceSource) can use the same
- // requester.
- // Otherwise, if requester is not identical,
- // the undo group gets "broken" into multiple pieces based
- // on the requesters being different. Technically, any unique, common
- // requester object would work.
- structuredDocument.replaceText(structuredDocument, offset, length, source);
- }
-
- /**
- */
- protected void setWidth(HTMLFormatContraints contraints, String source) {
- if (contraints == null)
- return;
- if (source == null)
- return;
- int length = source.length();
- if (length == 0)
- return;
-
- if (!splitLines())
- return;
- int lineWidth = getLineWidth();
- if (lineWidth < 0)
- return;
-
- int offset = source.lastIndexOf('\n');
- int offset2 = source.lastIndexOf('\r');
- if (offset2 > offset)
- offset = offset2;
- if (offset >= 0)
- offset++;
-
- int availableWidth = 0;
- if (offset >= 0) {
- availableWidth = lineWidth - (length - offset);
- }
- else {
- availableWidth = contraints.getAvailableLineWidth() - length;
- }
- if (availableWidth < 0)
- availableWidth = 0;
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected void setWidth(HTMLFormatContraints contraints, Node node) {
- if (contraints == null)
- return;
- if (node == null)
- return;
- IStructuredDocument structuredDocument = ((IDOMNode) node).getStructuredDocument();
- if (structuredDocument == null)
- return; // error
-
- if (!splitLines())
- return;
- int lineWidth = getLineWidth();
- if (lineWidth < 0)
- return;
-
- int offset = ((IDOMNode) node).getStartOffset();
- int line = structuredDocument.getLineOfOffset(offset);
- int lineOffset = 0;
- try {
- lineOffset = structuredDocument.getLineOffset(line);
- }
- catch (BadLocationException ex) {
- return; // error
- }
- if (lineOffset > offset)
- return; // error
-
- int availableWidth = lineWidth - (offset - lineOffset);
- if (availableWidth < 0)
- availableWidth = 0;
-
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected boolean splitLines() {
- return true;// getFormatPreferences().getSplitLines();
- }
-
- protected IStructuredFormatPreferences fFormatPreferences = null;
- protected HTMLFormatContraints fFormatContraints = null;
- protected IProgressMonitor fProgressMonitor = null;
-
- // public void format(XMLNode node, FormatContraints formatContraints) {
- // if (formatContraints.getFormatWithSiblingIndent())
- // formatContraints.setCurrentIndent(getSiblingIndent(node));
- //
- // formatNode(node, formatContraints);
- // }
-
- public void setFormatPreferences(IStructuredFormatPreferences formatPreferences) {
- fFormatPreferences = formatPreferences;
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-
- public IStructuredFormatContraints getFormatContraints() {
- if (fFormatContraints == null) {
- fFormatContraints = new HTMLFormatContraintsImpl();
-
- fFormatContraints.setAvailableLineWidth(getFormatPreferences().getLineWidth());
- fFormatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
- }
-
- return fFormatContraints;
- }
-
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- fProgressMonitor = progressMonitor;
- }
-
- /* Check to see if current text Node is a child of an inline element. */
- public boolean isInlinableTextNode(Node theNode, Element theParentElement) {
- return formattingUtil.isInline(theParentElement) &&
- theNode.getNodeType() == Node.TEXT_NODE;
- }
-
- public boolean allowsNewlineAfter(boolean theBool, Node theNode, Element theParentElement) {
- boolean result = theBool;
- if ((theNode.getNodeType() == Node.TEXT_NODE) && formattingUtil.isInline(theParentElement)) {
- if (theParentElement.getChildNodes().getLength() == 1) { // Only child is a text node, no newline
- result = false;
- }
- else if (theNode == theParentElement.getLastChild()) { // theNode is the last, does formatting need corrected
- if (theParentElement.getFirstChild().getNodeType() == Node.ELEMENT_NODE) {
- result = false;
- }
- }
- else {
- result = false;
- }
- } else if (theNode.getNodeType() == Node.ELEMENT_NODE
- && formattingUtil.isInline(theNode.getNextSibling())) {
- result = false;
- }
- else if (theNode.getNodeType() == Node.TEXT_NODE) {
- Node next = theNode.getNextSibling();
- if (next != null && formattingUtil.isInline(next) || theParentElement.getChildNodes().getLength() <= 1) {
- result = false;
- }
- }
- return result;
- }
-
- public boolean allowNewlineBefore(Node theNode) {
- if (theNode.getNodeType() != Node.TEXT_NODE &&
- theNode.getNodeType() != Node.ELEMENT_NODE) return false;
- return (formattingUtil.isInline(theNode.getParentNode()) ||
- formattingUtil.isInline(theNode.getPreviousSibling()));
- }
-
- public boolean allowNewlineBefore(Node theNode, Element theParentElement) {
- boolean result = true;
- /* The calling method canInsertBreakBefore is checking if you can
- * insert a line break after the text node in the parentElement. We
- * need to check for the case with inline element because we don't want to
- * break before the closing </tag> */
- if (isInlinableTextNode(theNode, theParentElement)) {
- result = false;
- /* Check to see if we need to not break the line because we are
- * a child of a inline element or a next sibling to an inline element*/
- } else if (allowNewlineBefore(theNode)) {
- result = false;
- } else if (theNode.getNodeType() == Node.TEXT_NODE && theParentElement.getChildNodes().getLength() <= 1) {
- result = false;
- }
- return result;
- }
-
- public boolean isIdentable(Node theNode, Node theParent) {
- boolean result = true;
- /* The first 2 cases where we don't want to break/indent or if the
- * node is a inlineText ELement or if we should skip it before its parent
- * is an inlineText element.
- * The last check is to make sure that the parent is actually the parent
- * of the node. This method is called when the formatter is formatting
- * the startTag and the wrap margin causes attributes to be indents on
- * mulitple lines. In this case where the parentNode doesn't match
- * theParent argument, we can allow the indent. */
- if (formattingUtil.isInline(theNode) &&
- formattingUtil.shouldSkipIndentForNode(theNode) &&
- theParent == theNode.getParentNode()) {
- result = false;
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java
deleted file mode 100644
index d34701a590..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLFormatterFactory {
- private static HTMLFormatterFactory fInstance = null;
- protected StructuredFormatPreferencesXML fFormatPreferences = null;
-
- static synchronized HTMLFormatterFactory getInstance() {
- if (fInstance == null) {
- fInstance = new HTMLFormatterFactory();
- }
- return fInstance;
- }
-
- protected IStructuredFormatter createFormatter(Node node, IStructuredFormatPreferences formatPreferences) {
- IStructuredFormatter formatter = null;
-
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE :
- formatter = new HTMLElementFormatter();
- break;
- case Node.TEXT_NODE :
- if (isEmbeddedCSS(node)) {
- formatter = new EmbeddedCSSFormatter();
- }
- else {
- formatter = new HTMLTextFormatter();
- }
- break;
- default :
- formatter = new HTMLFormatter();
- break;
- }
-
- // init FormatPreferences
- formatter.setFormatPreferences(formatPreferences);
-
- return formatter;
- }
-
- /**
- */
- private boolean isEmbeddedCSS(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- String name = parent.getNodeName();
- if (name == null)
- return false;
- return name.equalsIgnoreCase("STYLE");//$NON-NLS-1$
- }
-
-
- private HTMLFormatterFactory() {
- super();
- }
-
- protected StructuredFormatPreferencesXML getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- fFormatPreferences.setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fFormatPreferences.setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormattingUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormattingUtil.java
deleted file mode 100644
index 9a2b000632..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormattingUtil.java
+++ /dev/null
@@ -1,90 +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.wst.html.core.internal.format;
-
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Set;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.w3c.dom.Node;
-
-import com.ibm.icu.util.StringTokenizer;
-
-public class HTMLFormattingUtil {
-
- private Set fInlineElements;
-
- public HTMLFormattingUtil() {
- fInlineElements = getInlineSet();
- }
-
- public boolean isInline(Node node) {
- return node != null && fInlineElements.contains(node.getNodeName().toLowerCase(Locale.US));
- }
-
- public boolean shouldSkipIndentForNode(Node node) {
- return isInline(node.getParentNode());
- }
-
- /**
- * Returns an array of the element names considered as "inline" for the purposes of formatting.
- * This list represents those stored in the preference store when invoked.
- *
- * @return An array of element names considered to be "inline"
- */
- public static Object[] getInlineElements() {
- return getInlineSet().toArray();
- }
-
- /**
- * Stores the element names to the preference store to be considered as "inline"
- *
- * @param elements The element names considered to be "inline"
- */
- public static void exportToPreferences(Object[] elements) {
- if (elements != null) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < elements.length; i++) {
- if (i > 0)
- buffer.append(',');
- buffer.append(elements[i]);
- }
- HTMLCorePlugin.getDefault().getPluginPreferences().setValue(HTMLCorePreferenceNames.INLINE_ELEMENTS, buffer.toString());
- }
- }
-
- /**
- * Returns an array of the default element names considered as "inline" for the purposes of formatting.
- *
- * @return An array of the default element names considered to be "inline"
- */
- public static Object[] getDefaultInlineElements() {
- String inline = HTMLCorePlugin.getDefault().getPluginPreferences().getDefaultString(HTMLCorePreferenceNames.INLINE_ELEMENTS);
- Set defaults = new HashSet();
- StringTokenizer tokenizer = new StringTokenizer(inline, ",");
- while (tokenizer.hasMoreTokens()) {
- defaults.add(tokenizer.nextToken());
- }
- return defaults.toArray();
- }
-
- private static Set getInlineSet() {
- String inline = HTMLCorePlugin.getDefault().getPluginPreferences().getString(HTMLCorePreferenceNames.INLINE_ELEMENTS);
- Set elements = new HashSet();
- StringTokenizer tokenizer = new StringTokenizer(inline, ",");
- while (tokenizer.hasMoreTokens()) {
- elements.add(tokenizer.nextToken());
- }
- return elements;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
deleted file mode 100644
index 91aefd3c17..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLTextFormatter extends HTMLFormatter {
-
- public static int FORMAT_ALL = 0;
- public static int FORMAT_HEAD = 1;
- public static int FORMAT_TAIL = 2;
-
- /**
- */
- protected HTMLTextFormatter() {
- super();
- }
-
- /**
- */
- private boolean canFormatText(IDOMText text) {
- if (text == null)
- return false;
-
- IStructuredDocumentRegion flatNode = text.getFirstStructuredDocumentRegion();
- if (flatNode != null) {
- String type = flatNode.getType();
- if (isUnparsedRegion(type))
- return false;
- }
-
- Node parent = text.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- if (!element.isGlobalTag() && !text.isElementContentWhitespace())
- return false;
- }
-
- return canFormatChild(parent);
- }
-
- private boolean isUnparsedRegion(String type) {
- boolean result = isNestedScannedRegion(type) || isBlockScannedRegion(type);
- return result;
- }
-
- private boolean isBlockScannedRegion(String type) {
- return type == DOMRegionContext.BLOCK_TEXT;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedScannedRegion(String type) {
- final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
- return type.equals(JSP_CONTENT);
- }
-
- /**
- */
- private boolean canRemoveHeadingSpaces(IDOMNode node) {
- if (node == null)
- return false;
- if (node.getPreviousSibling() != null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
-
- CMElementDeclaration decl = getElementDeclaration((Element) parent);
- if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- private boolean canRemoveTailingSpaces(IDOMNode node) {
- if (node == null)
- return false;
- if (node.getNextSibling() != null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
-
- CMElementDeclaration decl = getElementDeclaration((Element) parent);
- if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- formatText(node, contraints, FORMAT_ALL); // full format
- }
-
- /**
- */
- protected void formatText(IDOMNode node, HTMLFormatContraints contraints, int mode) {
- if (node == null)
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
-
- IDOMText text = (IDOMText) node;
- String source = text.getSource();
-
- if (!canFormatText(text)) {
- setWidth(contraints, source);
- return;
- }
-
- int offset = text.getStartOffset();
- int length = text.getEndOffset() - offset;
-
- // format adjacent text at once
- if (mode == FORMAT_HEAD) {
- Node next = node.getNextSibling();
- while (next != null && next.getNodeType() == Node.TEXT_NODE) {
- IDOMText nextText = (IDOMText) next;
- length += (nextText.getEndOffset() - nextText.getStartOffset());
- String nextSource = nextText.getSource();
- if (nextSource != null && nextSource.length() > 0) {
- if (source == null)
- source = nextSource;
- else
- source += nextSource;
- }
- next = next.getNextSibling();
- }
- }
- else if (mode == FORMAT_TAIL) {
- Node prev = node.getPreviousSibling();
- while (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- IDOMText prevText = (IDOMText) prev;
- offset = prevText.getStartOffset();
- length += (prevText.getEndOffset() - offset);
- String prevSource = prevText.getSource();
- if (prevSource != null && prevSource.length() > 0) {
- if (source == null)
- source = prevSource;
- else
- source = prevSource + source;
- }
- prev = prev.getPreviousSibling();
- }
- }
-
- SpaceConverter converter = new SpaceConverter(source, keepBlankLines(contraints));
-
- int wordLength = converter.nextWord();
- if (wordLength == 0) { // only spaces
- if (!converter.hasSpaces())
- return; // empty
- boolean removeSpaces = false;
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- // check if tags are omitted
- IDOMNode element = (IDOMNode) parent;
- if (node.getPreviousSibling() == null && element.getStartStructuredDocumentRegion() == null) {
- removeSpaces = true;
- }
- else if (node.getNextSibling() == null && element.getEndStructuredDocumentRegion() == null) {
- removeSpaces = true;
- }
- }
- if (removeSpaces) {
- converter.replaceSpaces(null);
- }
- else if (!isWidthAvailable(contraints, 2) || canInsertBreakAfter(node) || canInsertBreakBefore(node)) {
- String spaces = null;
- if (node.getNextSibling() == null) { // last spaces
- // use parent indent for the end tag
- spaces = getBreakSpaces(parent);
- }
- else {
- spaces = getBreakSpaces(node);
- }
- converter.replaceSpaces(spaces);
- setWidth(contraints, spaces);
- }
- else if (canRemoveHeadingSpaces(node) || canRemoveTailingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- else {
- String breakSpaces = null;
-
- // format heading spaces
- boolean hasSpaces = converter.hasSpaces();
- if (mode == FORMAT_TAIL) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if ((hasSpaces && !isWidthAvailable(contraints, wordLength + 1)) || canInsertBreakBefore(node)) {
- breakSpaces = getBreakSpaces(node);
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- if (hasSpaces) {
- if (canRemoveHeadingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- }
- addWidth(contraints, wordLength);
-
- // format middle
- wordLength = converter.nextWord();
- while (wordLength > 0) {
- if (mode != FORMAT_ALL) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if (!isWidthAvailable(contraints, wordLength + 1)) {
- if (breakSpaces == null)
- breakSpaces = getBreakSpaces(node);
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- addWidth(contraints, wordLength);
- wordLength = converter.nextWord();
- }
-
- // format tailing spaces
- hasSpaces = converter.hasSpaces();
- if (mode == FORMAT_HEAD) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if ((hasSpaces && !isWidthAvailable(contraints, 2)) || canInsertBreakAfter(node)) {
- if (node.getNextSibling() == null) { // last test
- // use parent indent for the end tag
- breakSpaces = getBreakSpaces(parent);
- }
- else {
- if (breakSpaces == null)
- breakSpaces = getBreakSpaces(node);
- }
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- if (hasSpaces) {
- if (canRemoveTailingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- }
- }
-
- if (converter.isModified()) {
- source = converter.getSource();
- replaceSource(text.getModel(), offset, length, source);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
deleted file mode 100644
index 38f9203a85..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-final class SpaceConverter {
-
- private String source = null;
- private int length = 0;
- private int startOffset = 0;
- private int endOffset = 0;
- private int spaceCount = 0;
- private int wordCount = 0;
- private StringBuffer buffer = null;
- private int lastOffset = 0;
- private boolean keepBlankLines = false;
-
- /**
- */
- public SpaceConverter(String source) {
- super();
-
- if (source == null) {
- this.source = new String();
- }
- else {
- this.source = source;
- this.length = source.length();
- }
- }
-
- /**
- */
- public SpaceConverter(String source, boolean keepBlankLines) {
- super();
-
- if (source == null) {
- this.source = new String();
- }
- else {
- this.source = source;
- this.length = source.length();
- }
- this.keepBlankLines = keepBlankLines;
- }
-
- /**
- */
- public void compressSpaces() {
- if (this.spaceCount == 0)
- return;
- if (this.spaceCount == 1 && this.source.charAt(this.startOffset) == ' ')
- return;
-
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.startOffset > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
- }
-
- this.buffer.append(' ');
-
- this.lastOffset = this.startOffset + this.spaceCount;
- }
-
- /**
- */
- public String getSource() {
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.length > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.length));
- }
- return this.buffer.toString();
- }
-
- /**
- */
- public int getSpaceCount() {
- return this.spaceCount;
- }
-
- /**
- */
- public boolean hasSpaces() {
- return (this.spaceCount > 0);
- }
-
- /**
- */
- public boolean isModified() {
- return (this.buffer != null);
- }
-
- /**
- * Add number of the old blank lines to new space string
- */
- private static String mergeBlankLines(String newSpaces, String oldSpaces) {
- if (newSpaces == null || newSpaces.length() == 0)
- return newSpaces;
- if (oldSpaces == null)
- return newSpaces;
-
- // count old new lines
- int newLineCount = 0;
- int oldLength = oldSpaces.length();
- for (int i = 0; i < oldLength; i++) {
- char c = oldSpaces.charAt(i);
- if (c == '\r') {
- newLineCount++;
- if (i + 1 < oldLength) {
- c = oldSpaces.charAt(i + 1);
- if (c == '\n')
- i++;
- }
- }
- else {
- if (c == '\n')
- newLineCount++;
- }
- }
- if (newLineCount < 2)
- return newSpaces; // no blank line
-
- // here assuming newSpaces starts with a new line if any
- String delim = null;
- char d = newSpaces.charAt(0);
- if (d == '\r') {
- if (newSpaces.length() > 1 && newSpaces.charAt(1) == '\n')
- delim = "\r\n";//$NON-NLS-1$
- else
- delim = "\r";//$NON-NLS-1$
- }
- else {
- if (d == '\n')
- delim = "\n";//$NON-NLS-1$
- else
- return newSpaces; // no new line
- }
-
- newLineCount--;
- StringBuffer buffer = new StringBuffer(newSpaces.length() + newLineCount * 2);
- while (newLineCount > 0) {
- buffer.append(delim);
- newLineCount--;
- }
- buffer.append(newSpaces);
- return buffer.toString();
- }
-
- /**
- */
- public int nextWord() {
- if (this.endOffset == this.length) {
- this.startOffset = this.endOffset;
- this.spaceCount = 0;
- this.wordCount = 0;
- return 0;
- }
-
- this.startOffset = this.endOffset;
- int i = this.startOffset;
- for (; i < this.length; i++) {
- if (!Character.isWhitespace(this.source.charAt(i)))
- break;
- }
- this.spaceCount = i - this.startOffset;
-
- int wordOffset = i;
- for (; i < this.length; i++) {
- if (Character.isWhitespace(this.source.charAt(i)))
- break;
- }
- this.wordCount = i - wordOffset;
- this.endOffset = i;
-
- return this.wordCount;
- }
-
- /**
- */
- public void replaceSpaces(String spaces) {
- int spaceLength = (spaces != null ? spaces.length() : 0);
- String oldSpaces = null;
- if (spaceLength == this.spaceCount) {
- if (spaceLength == 0)
- return;
- if (this.startOffset == 0) {
- if (this.source.startsWith(spaces))
- return;
- }
- else if (this.endOffset == this.length) {
- if (this.source.endsWith(spaces))
- return;
- }
- else {
- int textOffset = this.startOffset + this.spaceCount;
- oldSpaces = this.source.substring(this.startOffset, textOffset);
- if (oldSpaces.equals(spaces))
- return;
- }
- }
- if (this.keepBlankLines && this.spaceCount > 0) {
- if (oldSpaces == null) {
- int textOffset = this.startOffset + this.spaceCount;
- oldSpaces = this.source.substring(this.startOffset, textOffset);
- }
- if (oldSpaces != null) {
- spaces = mergeBlankLines(spaces, oldSpaces);
- if (oldSpaces.equals(spaces))
- return;
- }
- }
-
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.startOffset > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
- }
-
- if (spaceLength > 0)
- this.buffer.append(spaces);
-
- this.lastOffset = this.startOffset + this.spaceCount;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
deleted file mode 100644
index 891868cb2f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- */
-public abstract class AbstractCSSModelAdapter implements ICSSModelAdapter {
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-
- private Element element = null;
- private ICSSModel model = null;
-
- /**
- */
- AbstractCSSModelAdapter() {
- super();
- }
-
- /**
- */
- protected ICSSModel createModel() {
- // create embedded CSS model (not for external CSS)
- if (getElement() == null)
- return null;
- IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
- ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
- ((CSSModelImpl) newModel).setOwnerDOMNode(getElement());
- return newModel;
- }
-
- /**
- */
- public Element getElement() {
- return this.element;
- }
-
- /**
- */
- protected ICSSModel getExistingModel() {
- return this.model;
- }
-
- /**
- */
- protected void notifyStyleChanged(Element target) {
- INodeNotifier notifier = (INodeNotifier) target;
- if (notifier == null)
- return;
- Collection adapters = notifier.getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof StyleListener) {
- StyleListener listener = (StyleListener) adapter;
- listener.styleChanged();
- }
- }
- }
-
- /**
- */
- void setElement(Element element) {
- this.element = element;
- }
-
- /**
- * check
- * 1. If attributes of element is valid (type,rel ...)
- * 2. If content model supports this element / attribute (future ?)
- */
- protected boolean isValidAttribute() {
- return (getElement() != null);
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- this.model = model;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
deleted file mode 100644
index 90514836eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- * Masaki Saitoh (MSAITOH@jp.ibm.com)
- * See Bug 153000 Style Adapters should be lazier
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153000
- *
- ********************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.XMLModelNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- */
-public abstract class AbstractStyleSheetAdapter extends AbstractCSSModelAdapter implements ICSSStyleListener, IStyleSheetAdapter {
-
- // this variable to hold the class is just a VAJava trick.
- // it improves performance in VAJava by minimizing class loading.
- private final Class StyleSheetAdapterClass = IStyleSheetAdapter.class;
- private Collection styleChangedNodes;
-
- /**
- */
- protected AbstractStyleSheetAdapter() {
- super();
- }
-
- /**
- */
- protected ICSSModel createModel() {
- return createModel(true);
- }
-
- /**
- */
- protected ICSSModel createModel(boolean notify) {
- ICSSModel newModel = super.createModel();
- if (notify && newModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
- }
- return newModel;
- }
-
- /**
- */
- public StyleSheet getSheet() {
- ICSSModel model = getModel();
- if (model == null)
- return null;
- return (StyleSheet) model.getDocument();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return (type == StyleSheetAdapterClass);
- }
-
- /**
- */
- public void released() {
- ICSSModel currentModel = getModel();
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
- setElement(null);
- setModel(null);
-
- if (adapter != null)
- adapter.modelReleased(currentModel);
-
- if (currentModel != null)
- currentModel.releaseFromRead();
- }
-
- /**
- */
- public void removed() {
- ICSSModel currentModel = getModel();
-
- setModel(null);
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(currentModel);
-
- if (currentModel != null)
- currentModel.releaseFromRead();
- }
-
- /**
- * @param srcModel com.ibm.sed.css.model.interfaces.ICSSModel
- * @param removed com.ibm.sed.css.model.interfaces.ICSSSelector[]
- * @param added com.ibm.sed.css.model.interfaces.ICSSSelector[]
- * @param media java.lang.String
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- Element element = getElement();
- if (element == null)
- return; // might released
- Document doc = element.getOwnerDocument();
- if (doc == null)
- return; // error
-
- // to notify GEF tree
- if (doc instanceof INodeNotifier) {
- Collection adapters = ((INodeNotifier) doc).getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleChanged(srcModel, removed, added, media);
- }
- }
- }
- //
-
- if (styleChangedNodes == null) {
- styleChangedNodes = new HashSet();
- }
-
- try {
- int removedSelNum = removed != null ? removed.length : 0;
- int addedSelNum = added != null ? added.length : 0;
-
- NodeIterator iter = ((DocumentTraversal) doc).createNodeIterator(doc, NodeFilter.SHOW_ELEMENT, null, true);
- Node node;
- while ((node = iter.nextNode()) != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element elm = (Element) node;
- boolean match = false;
- int i;
- for (i = 0; i < removedSelNum && !match; i++) {
- match = removed[i].match(elm, null);
- }
- for (i = 0; i < addedSelNum && !match; i++) {
- match = added[i].match(elm, null);
- }
- if (match) {
- if (!styleChangedNodes.contains(elm))
- styleChangedNodes.add(elm);
- // notifyStyleChanged(elm);
- }
- }
- }
- }
- catch (ClassCastException ex) {
- // Document doesn't implement DocumentTraversal...
- }
-
- }
-
- /**
- * @param srcModel com.ibm.sed.css.model.interfaces.ICSSModel
- */
- public void styleUpdate(ICSSModel srcModel) {
- IDOMNode node = (IDOMNode) getElement();
- if (node == null)
- return;
- IDOMModel model = node.getModel();
- if (model == null)
- return;
- XMLModelNotifier notifier = model.getModelNotifier();
- if (notifier == null)
- return;
-
- // before updating, all sub-models should be loaded!
- DocumentStyle document = (DocumentStyle) model.getDocument();
- StyleSheetList styles = document.getStyleSheets();
- if (styles != null) {
- int n = styles.getLength();
- ImportedCollector trav = new ImportedCollector();
- for (int i = 0; i < n; i++) {
- org.w3c.dom.stylesheets.StyleSheet sheet = styles.item(i);
- if (sheet instanceof ICSSNode)
- trav.apply((ICSSNode) sheet);
- }
- }
-
- // flash style changed events
- if (styleChangedNodes != null) {
- Object[] elements = styleChangedNodes.toArray();
- for (int i = 0; elements != null && i < elements.length; i++)
- notifyStyleChanged((Element) elements[i]);
- styleChangedNodes.clear();
- }
-
- // to notify GEF tree
- if (document instanceof INodeNotifier) {
- Collection adapters = ((INodeNotifier) document).getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleUpdate(srcModel);
- }
- }
- }
-
- notifier.propertyChanged(node);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java
deleted file mode 100644
index 1e98f23621..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-
-/**
- */
-class CSSQueryContext extends CSSPropertyContext {
-
- /**
- */
- public CSSQueryContext() {
- super();
- }
-
- /**
- */
- public CSSQueryContext(ICSSStyleDeclaration decl) {
- super(decl);
- }
-
- /**
- *
- */
- public void applyFull(ICSSStyleDeclaration decl) {
- if (decl == null)
- return;
- Enumeration keys = fProperties.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- Object val = fProperties.get(key);
-
- if (val instanceof CSSQueryDeclarationData) {
- ICSSStyleDeclItem declItem = ((CSSQueryDeclarationData) val).getDeclItem();
- if (declItem.getLength() <= 0) {
- ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
- if (itemToRemove != null) {
- decl.removeDeclItemNode(itemToRemove);
- }
- }
- else {
- decl.setDeclItemNode(declItem);
- }
- }
- else {
- String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : val.toString();
-
- if (value == null || value.length() <= 0) {
- ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
- if (itemToRemove != null) {
- decl.removeDeclItemNode(itemToRemove);
- }
- }
- else {
- decl.setProperty(key.toString(), value, null);
- }
- }
- }
- }
-
- /**
- */
- private boolean check(String propName, boolean important, int specificity) {
- Object current = fProperties.get(propName);
- if (current != null && current instanceof CSSQueryValueData) {
- CSSQueryValueData currentValue = (CSSQueryValueData) current;
- if ((!important && currentValue.important) || (currentValue.getSpecificity() > specificity)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- */
- public void overrideWithExpand(ICSSStyleDeclaration decl, int specificity) {
- if (decl == null)
- return;
-
- CSSLinkConverter conv = new CSSLinkConverter(decl.getOwnerDocument().getModel());
-
- int nProperties = decl.getLength();
- for (int i = 0; i < nProperties; i++) {
- String propName = decl.item(i);
- if (propName != null) {
- String propN = propName.trim().toLowerCase();
- if (propN.length() != 0) {
- PropCMProperty prop = PropCMProperty.getInstanceOf(propN);
- String priority = decl.getPropertyPriority(propName);
- boolean important = priority != null && priority.length() > 0;
- if (prop != null && prop.isShorthand()) {
- // expand shorthand property
- CSSQueryContext context = new CSSQueryContext();
- expandToLeaf(prop, decl.getPropertyValue(propName), context);
-
- Enumeration properties = context.properties();
- while (properties.hasMoreElements()) {
- propN = properties.nextElement().toString();
- if (check(propN, important, specificity)) {
- fProperties.put(propN, new CSSQueryValueData(conv.toAbsolute(context.get(propN)), important, specificity));
- }
- }
- }
- else {
- if (check(propN, important, specificity)) {
- ICSSStyleDeclItem declItem = (ICSSStyleDeclItem) decl.getDeclItemNode(propName).cloneNode(true);
- int nValues = declItem.getLength();
- for (int j = 0; j < nValues; j++) {
- conv.toAbsolute(declItem.item(j));
- }
- declItem.setPriority(null);
- fProperties.put(propN, new CSSQueryDeclarationData(declItem, important, specificity));
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java
deleted file mode 100644
index 4f6125d0e7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-
-
-
-/**
- */
-public class CSSQueryDeclarationData extends CSSQueryValueData {
-
-
- ICSSStyleDeclItem declItem;
-
- public CSSQueryDeclarationData(ICSSStyleDeclItem declItem, boolean imp, int specificity) {
- super(null, imp, specificity);
- this.declItem = declItem;
- }
-
- /**
- */
- ICSSStyleDeclItem getDeclItem() {
- return declItem;
- }
-
- /**
- */
- public String toString() {
- if (value == null && declItem != null) {
- value = declItem.getCSSValueText();
- }
- return value;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
deleted file mode 100644
index 860610a6e4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.internal.util.CSSStyleDeclarationFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- */
-public class CSSQueryTraverser extends AbstractCssTraverser {
-
- private Element element;
- private String pseudoName;
- private CSSQueryContext context = null;
- ICSSStyleDeclaration decl = null;
-
- /**
- */
- public ICSSStyleDeclaration getDeclaration() {
- try {
- ICSSStyleDeclaration inlineStyle = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
- if (inlineStyle != null) {
- if (context == null) {
- context = new CSSQueryContext();
- }
- context.overrideWithExpand(inlineStyle, 10000);
- // style attribute's specificity is 100 (in CSS2 spec.) and
- // our implement use 100 as base number (see CSSSelector.java)
- }
- }
- catch (ClassCastException ex) {
- // element is not ElementCSSInlineStyle ???
- }
- if (context == null)
- return null;
-
- if (decl == null)
- decl = CSSStyleDeclarationFactory.getInstance().createStyleDeclaration();
- context.applyFull(decl);
- return decl;
- }
-
- /**
- */
- private void overwriteDeclaration(ICSSStyleDeclaration d, int specificity) {
- if (d == null)
- return;
- if (context == null)
- context = new CSSQueryContext();
- context.overrideWithExpand(d, specificity);
- }
-
- /**
- */
- protected short postNode(ICSSNode node) {
- return TRAV_CONT;
- }
-
- /**
- */
- protected short preNode(ICSSNode node) {
- if (node instanceof ICSSStyleRule) {
- // style rule
- ICSSStyleRule style = (ICSSStyleRule) node;
- ICSSSelectorList list = style.getSelectors();
- int nSelectors = list.getLength();
- int maxSpecificity = -1;
- for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
- // Check each Selector Lists
- ICSSSelector selector = list.getSelector(iSelector);
- int specificity = selector.getSpecificity();
- if (maxSpecificity < specificity && selector.match(element, pseudoName)) {
- maxSpecificity = specificity;
- }
- }
- if (maxSpecificity >= 0) {
- // apply this style to the element
- overwriteDeclaration((ICSSStyleDeclaration) style.getStyle(), maxSpecificity);
- }
- return TRAV_PRUNE;
- }
- return TRAV_CONT;
- }
-
- /**
- */
- private void resetContext() {
- context = null;
- }
-
- /**
- */
- public void setElement(Element element, String pseudoName) {
- this.element = element;
- this.pseudoName = pseudoName;
- resetContext();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java
deleted file mode 100644
index 6198156a74..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.util.declaration.ValueData;
-
-
-
-/**
- */
-class CSSQueryValueData extends ValueData {
-
- private int specificity;
-
- /**
- */
- public CSSQueryValueData() {
- super();
- }
-
- /**
- */
- public CSSQueryValueData(String val, boolean imp) {
- super(val, imp);
- }
-
- /**
- */
- public CSSQueryValueData(String val, boolean imp, int specificity) {
- super(val, imp);
- this.specificity = specificity;
- }
-
- /**
- */
- int getSpecificity() {
- return specificity;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
deleted file mode 100644
index 49eb7ff870..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.htmlcss;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSClassTraverser;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.html.core.internal.contentmodel.JSP11Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-
-
-/**
- */
-public class HTMLDocumentAdapter implements IStyleSheetListAdapter, StyleSheetList {
-
- private Document document = null;
- private Vector styleAdapters = null;
- private Vector oldStyleAdapters = null;
-
- /**
- */
- HTMLDocumentAdapter() {
- super();
- }
-
- /**
- */
- private void addStyleSheet(Element node) {
- IDOMElement element = (IDOMElement) node;
- String tagName = element.getTagName();
- if (tagName == null)
- return;
- boolean isContainer = false;
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || (!element.isGlobalTag() && element.isContainer())) {
- isContainer = true;
- }
- else if (element.isCommentTag()) {
- Node parent = element.getParentNode();
- if (parent == element.getOwnerDocument()) {
- // This condition is too severe, actually do not work for JSF template.
- // But above (! globalTag() && isContainer()) cover JSF template + tpl template
- isContainer = true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- tagName = ((Element) parent).getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
- isContainer = true;
- }
- }
- }
-
- else {
- String localName = element.getLocalName();
- if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
- // taglib html tag
- isContainer = true;
- }
- else {
- INodeNotifier notifier = element;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter != null && adapter instanceof IStyleSheetAdapter) {
- this.styleAdapters.addElement(adapter);
- }
- }
- }
- if (isContainer) {
- INodeNotifier notifier = element;
- if (notifier.getExistingAdapter(IStyleSheetListAdapter.class) == null) {
- notifier.addAdapter(this);
- }
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- addStyleSheet((Element) child);
- }
- }
- }
-
- /**
- */
- void childReplaced() {
- if (this.styleAdapters == null)
- return;
-
- // backup old adapters to be released on updating in getStyleSheets()
- this.oldStyleAdapters = this.styleAdapters;
- // invalidate the list
- this.styleAdapters = null;
-
- notifyStyleSheetsChanged(this.document);
- }
-
- /**
- */
- public Enumeration getClasses() {
- StyleSheetList sheetList = getStyleSheets();
- int nSheets = sheetList.getLength();
-
- final ArrayList classes = new ArrayList();
-
- CSSClassTraverser traverser = new CSSClassTraverser();
- traverser.setTraverseImported(true);
-
- for (int i = 0; i < nSheets; i++) {
- org.w3c.dom.stylesheets.StyleSheet sheet = sheetList.item(i);
- if (sheet instanceof ICSSNode) {
- traverser.apply((ICSSNode) sheet);
- }
- }
- classes.addAll(traverser.getClassNames());
-
- return new Enumeration() {
- int i = 0;
-
- public boolean hasMoreElements() {
- return i < classes.size();
- }
-
- public Object nextElement() {
- return classes.get(i++);
- }
- };
- }
-
- /**
- */
- private List getValidAdapters() {
- Vector validAdapters = new Vector();
- if (this.styleAdapters != null) {
- Iterator i = this.styleAdapters.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof AbstractStyleSheetAdapter && ((AbstractStyleSheetAdapter) obj).isValidAttribute()) {
- validAdapters.add(obj);
- }
- }
- }
- return validAdapters;
- }
-
- /**
- */
- public int getLength() {
- return getValidAdapters().size();
- }
-
- /**
- */
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
- StyleSheetList ssl = getStyleSheets();
- int numStyles = ssl.getLength();
-
- CSSQueryTraverser query = new CSSQueryTraverser();
- query.setTraverseImported(true);
- query.setTraverseImportFirst(true);
- query.setElement(element, pseudoName);
-
- for (int i = 0; i < numStyles; i++) {
- // loop for styles (<style> and <link>)
- org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
-
- try {
- query.apply((ICSSNode) ss);
- }
- catch (ClassCastException ex) {
- // I can handle only CSS style
- }
- }
-
- return query.getDeclaration();
- }
-
- /**
- */
- public StyleSheetList getStyleSheets() {
- if (this.styleAdapters == null) {
- if (this.document == null)
- return null;
-
- this.styleAdapters = new Vector();
- for (Node child = this.document.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- addStyleSheet((Element) child);
- }
-
- removeOldStyleSheets();
- }
- return this;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return (type == IStyleSheetListAdapter.class);
- }
-
- /**
- */
- public StyleSheet item(int index) {
- if (this.styleAdapters == null)
- return null;
-
- List validAdapters = getValidAdapters();
-
- if (index < 0 || index >= validAdapters.size())
- return null;
- StyleSheet sheet = ((IStyleSheetAdapter) validAdapters.get(index)).getSheet();
- if (sheet == null) {// for LINK element whose link is broken
- ICSSModel model = ((AbstractStyleSheetAdapter) validAdapters.get(index)).createModel();
- sheet = ((model != null) ? (StyleSheet) model.getDocument() : null);
- }
- return sheet;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- Node node = null;
- switch (eventType) {
- case INodeNotifier.ADD :
- if (newValue instanceof Node)
- node = (Node) newValue;
- else if (changedFeature instanceof Attr)
- node = ((Attr) changedFeature);
- break;
- case INodeNotifier.REMOVE :
- if (oldValue instanceof Node)
- node = (Node) oldValue;
- else if (changedFeature instanceof Attr)
- node = ((Attr) changedFeature);
- break;
- case INodeNotifier.CHANGE :
- node = (Node) notifier;
- break;
- default :
- break;
- }
-
- if (node == null)
- return;
-
- switch(node.getNodeType()) {
- case Node.ELEMENT_NODE: {
- IDOMElement element = (IDOMElement) node;
- String tagName = element.getTagName();
- if (tagName == null)
- return;
-
- if (eventType == INodeNotifier.CHANGE) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
- refreshAdapters();
- }
- }
- else {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || element.isCommentTag() || (!element.isGlobalTag() && element.isContainer())) {
- childReplaced();
- }
- else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
- refreshAdapters();
- }
- else {
- String localName = element.getLocalName();
- if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
- // taglib html tag
- childReplaced();
- }
- }
- }
- break;
- }
- case Node.ATTRIBUTE_NODE : {
- if (HTML40Namespace.ElementName.BASE.equals(((Attr) node).getOwnerElement().getLocalName())) {
- refreshAdapters();
- }
- }
- }
-
- }
-
- /**
- * reload LINK / @import if BASE changed
- */
- private void refreshAdapters() {
- Iterator iAdapter = this.styleAdapters.iterator();
- while (iAdapter.hasNext()) {
- Object adapter = iAdapter.next();
- if (adapter instanceof LinkElementAdapter) {
- ((LinkElementAdapter) adapter).refreshSheet();
- }
- else if (adapter instanceof StyleElementAdapter) {
- ICSSModel model = ((StyleElementAdapter) adapter).getModel();
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(model);
- Iterator iRule = trav.getRules().iterator();
- while (iRule.hasNext()) {
- ICSSImportRule rule = (ICSSImportRule) iRule.next();
- rule.refreshStyleSheet();
- }
- }
- }
- }
-
- /**
- */
- private void notifyStyleSheetsChanged(Document target) {
- INodeNotifier notifier = (INodeNotifier) target;
- if (notifier == null)
- return;
- Collection adapters = notifier.getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof StyleListener) {
- StyleListener listener = (StyleListener) adapter;
- listener.styleChanged();
- }
- }
- }
-
- /**
- */
- private void releaseOldStyleSheets() {
- if (this.oldStyleAdapters == null)
- return;
- Iterator it = this.oldStyleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter == null)
- continue;
- // if the same adapter is in the current list,
- // do not release
- if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
- continue;
- adapter.released();
- }
- this.oldStyleAdapters = null;
- }
-
- /**
- */
- public void releaseStyleSheets() {
- releaseOldStyleSheets();
-
- if (this.styleAdapters == null)
- return;
- Iterator it = this.styleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter != null)
- adapter.released();
- }
- this.styleAdapters = null;
- }
-
- /**
- */
- private void removeOldStyleSheets() {
- if (this.oldStyleAdapters == null)
- return;
- Iterator it = this.oldStyleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter == null)
- continue;
- // if the same adapter is in the current list,
- // do not release
- if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
- continue;
- adapter.removed();
- }
- this.oldStyleAdapters = null;
- }
-
- /**
- */
- void setDocument(Document document) {
- this.document = document;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
deleted file mode 100644
index cee65d1423..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
+++ /dev/null
@@ -1,140 +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.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapter implements IStyleSelectorAdapter {
-
- static private HTMLStyleSelectorAdapter instance;
- private Object toMatch = IStyleSelectorAdapter.class;
-
- public synchronized static HTMLStyleSelectorAdapter getInstance() {
- if (instance == null) {
- instance = new HTMLStyleSelectorAdapter();
- }
- return instance;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == toMatch;
- }
-
- public boolean match(ICSSSimpleSelector selector, Element element, String pseudoName) {
- if (element == null)
- return false;
- int i;
- String key;
-
- // PseudoName
- i = selector.getNumOfPseudoNames();
- if (i > 0) {
- if (pseudoName == null || pseudoName.length() == 0)
- return false;
- for (i = i - 1; i >= 0; i--) {
- if (pseudoName.equalsIgnoreCase(selector.getPseudoName(i))) {
- break;
- }
- }
- if (i < 0)
- return false;
- }
-
- // check tag name
- if (!selector.isUniversal() && !element.getNodeName().equalsIgnoreCase(selector.getName()))
- return false;
-
- // check id
- i = selector.getNumOfIDs();
- if (i > 0) {
- if (i > 1)
- return false;
- if (!element.hasAttribute("id") || (key = element.getAttribute("id")).length() == 0)//$NON-NLS-1$ //$NON-NLS-2$
- return false;
- if (!selector.getID(0).equals(key))
- return false;
- }
-
- // check class
- i = selector.getNumOfClasses();
- if (i > 0) {
- if (!element.hasAttribute("class") || (key = element.getAttribute("class")).length() == 0) //$NON-NLS-1$ //$NON-NLS-2$
- 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 attrName = tokenizer.nextToken();
- String attrValue = null;
- if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
- return false;
- if (countTokens > 1) {
- String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
- StringTokenizer attrValueTokenizer = null;
- if (token.equals("~")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue);
- }
- else if (token.equals("|")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
- }
- if (attrValueTokenizer != null) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- boolean ok = false;
- while (attrValueTokenizer.hasMoreTokens()) {
- if (token.equals(attrValueTokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
- else {
- if (!attrValue.equals(token))
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
deleted file mode 100644
index 57cd685645..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapterFactory implements INodeAdapterFactory {
-
- private static HTMLStyleSelectorAdapterFactory instance;
- private Object toMatch = IStyleSelectorAdapter.class;
-
- /**
- * CSSModelProvideAdapterFactory constructor comment.
- */
- public HTMLStyleSelectorAdapterFactory() {
- super();
- }
-
- /**
- * Method that returns the adapter associated with the given object.
- * It may be a singleton or not ... depending on the needs of the INodeAdapter ...
- * but in general it is recommended for an adapter to be stateless,
- * so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSelectorAdapter.class);
- if (adapter != null)
- return adapter;
- adapter = HTMLStyleSelectorAdapter.getInstance();
- notifier.addAdapter(adapter);
- return adapter;
- }
-
- public synchronized static HTMLStyleSelectorAdapterFactory getInstance() {
- if (instance == null)
- instance = new HTMLStyleSelectorAdapterFactory();
- return instance;
- }
-
- /**
- * isFactoryForType method comment.
- */
- public boolean isFactoryForType(Object type) {
- return type == toMatch;
- }
-
- public void release() {
- // default is to do nothing
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
deleted file mode 100644
index 6113d4b3d6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
+++ /dev/null
@@ -1,273 +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.html.core.internal.htmlcss;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- */
-public class LinkElementAdapter extends AbstractStyleSheetAdapter {
-
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
- private boolean replaceModel = true;
- // this variable to hold the class is just a VAJava trick.
- // it improves performance in VAJava by minimizing class loading.
- private final Class ModelProvideAdapterClass = IModelProvideAdapter.class;
-
- /**
- */
- protected LinkElementAdapter() {
- super();
- }
-
- /**
- */
- private void attrReplaced() {
- this.replaceModel = true;
-
- Element element = getElement();
- if (element == null)
- return; // error
- Document document = element.getOwnerDocument();
- if (document == null)
- return; // error
- INodeNotifier notifier = (INodeNotifier) document;
- HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) notifier.getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return;
- adapter.childReplaced();
- }
-
- protected ICSSModel createModel() {
- // create phantom(broken link) external CSS model
- if (getElement() == null)
- return null;
- IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
- ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
-
- // calculate base location and set
- // get resolver in Model
- URIResolver resolver = baseModel.getResolver();
-
- // resolve to absolute url : this need not exact location of css file. It is important that absurl is not null.
- String ref = getElement().getAttribute(HTML40Namespace.ATTR_NAME_HREF);
- String absurl = (resolver != null && ref != null && ref.length() > 0) ? resolver.getLocationByURI(ref, true) : null;
- if ((absurl == null) || (absurl.length() == 0)) {
- IPath basePath = new Path(baseModel.getBaseLocation());
- URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
- absurl = helper.toAbsolute(ref == null ? "" : ref);//$NON-NLS-1$
- }
- if ((absurl == null) || (absurl.length() == 0)) {
- absurl = ref;
- }
- if (absurl == null) {
- absurl = "";//$NON-NLS-1$
- }
- newModel.setBaseLocation(absurl);
-
- // set style listener
- newModel.addStyleListener(this);
-
- return newModel;
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (this.replaceModel) {
- ICSSModel oldModel = model;
- try {
- model = retrieveModel();
- setModel(model);
-
- // release old model
- if (oldModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(oldModel);
- }
- }
- finally {
- if (oldModel != null)
- oldModel.releaseFromRead();
- }
- this.replaceModel = false;
- }
- return model;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (eventType != INodeNotifier.CHANGE)
- return;
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase("rel") || //$NON-NLS-1$
- name.equalsIgnoreCase("type") || //$NON-NLS-1$
- name.equalsIgnoreCase("href")) {//$NON-NLS-1$
- attrReplaced();
- }
- }
-
- /**
- */
- public void refreshSheet() {
- if (!replaceModel) {
- removed();
- replaceModel = true;
-
- IDOMNode node = (IDOMNode) getElement();
- if (node != null) {
- node.notify(INodeNotifier.CHANGE, getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF), null, null, node.getStartOffset());
- }
- }
- }
-
- /**
- */
- public void released() {
- ICSSModel model = getExistingModel();
- if (model != null) {
- try {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
- // set element to null first, so that no document wide updates
- setElement(null);
- setModel(null);
-
- if (adapter != null)
- adapter.modelReleased(model);
- }
- finally {
- model.releaseFromRead();
- }
- }
- this.replaceModel = false;
- }
-
- /**
- */
- public void removed() {
- ICSSModel model = getExistingModel();
- if (model != null) {
- try {
- setModel(null);
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(model);
- }
- finally {
- model.releaseFromRead();
- }
- }
- this.replaceModel = false;
- }
-
- /**
- */
- protected boolean isValidAttribute() {
- Element element = getElement();
- if (element == null)
- return false;
- if (!element.hasAttribute("rel") || !"stylesheet".equalsIgnoreCase(element.getAttribute("rel")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return false;
- if (element.hasAttribute("type") && !"text/css".equalsIgnoreCase(element.getAttribute("type")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return false;
- if (!element.hasAttribute("href") || element.getAttribute("href").length() == 0) //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- return true;
- }
-
- /**
- */
- private ICSSModel retrieveModel() {
- if (!isValidAttribute()) {
- return null;
- }
-
- // null,attr check is done in isValidAttribute()
- Element element = getElement();
- String href = element.getAttribute("href");//$NON-NLS-1$
-
- IDOMModel baseModel = ((IDOMNode) element).getModel();
- if (baseModel == null)
- return null;
- Object id = baseModel.getId();
- if (!(id instanceof String))
- return null;
- //String base = (String)id;
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(ModelProvideAdapterClass);
-
- URLModelProvider provider = new URLModelProvider();
- try {
- IStructuredModel newModel = provider.getModelForRead(baseModel, href);
- if (newModel == null)
- return null;
- if (!(newModel instanceof ICSSModel)) {
- newModel.releaseFromRead();
- return null;
- }
-
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
-
- return (ICSSModel) newModel;
- }
- catch (UnsupportedEncodingException e) {
- }
- catch (IOException e) {
- }
-
- return null;
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- ICSSModel oldModel = getExistingModel();
- if (model == oldModel)
- return;
- super.setModel(model);
- if (this.replaceModel)
- this.replaceModel = false;
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
deleted file mode 100644
index 922ee62e31..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleAdapterFactory implements INodeAdapterFactory {
-
- private static StyleAdapterFactory instance = null;
-
- // private static String CSS_CONTENT_TYPE = "text/css";//$NON-NLS-1$
- /**
- */
- private StyleAdapterFactory() {
- super();
- }
-
- /**
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- if (notifier == null)
- return null;
-
- Node node = (Node) notifier;
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_NODE) {
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetListAdapter.class);
- if (adapter != null)
- return adapter;
- HTMLDocumentAdapter newAdapter = new HTMLDocumentAdapter();
- newAdapter.setDocument((Document) node);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
- if (nodeType != Node.ELEMENT_NODE)
- return null;
-
- Element element = (Element) node;
- String tagName = element.getTagName();
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.STYLE)) {
- return null;
- }
- // String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
- // if (type != null && ! type.equalsIgnoreCase(CSS_CONTENT_TYPE)) {
- // return null;
- // }
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
- if (adapter != null)
- return adapter;
- StyleElementAdapter newAdapter = new StyleElementAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
- else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK)) {
- if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.LINK)) {
- return null;
- }
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
- if (adapter != null)
- return adapter;
- LinkElementAdapter newAdapter = new LinkElementAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
-
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleDeclarationAdapter.class);
- if (adapter != null)
- return adapter;
-
- if (!isAttributeAvailable(element, HTML40Namespace.ATTR_NAME_STYLE)) {
- return null;
- }
- StyleAttrAdapter newAdapter = new StyleAttrAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
-
- /**
- */
- public synchronized static StyleAdapterFactory getInstance() {
- if (instance == null)
- instance = new StyleAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == IStyleSheetAdapter.class || type == IStyleDeclarationAdapter.class || type == IStyleSheetListAdapter.class);
- }
-
- public void release() {
- // default is to do nothing
- }
-
- private static boolean isTagAvailable(Document document, String elementName) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
- CMNamedNodeMap map = cmdoc.getElements();
- if ((CMElementDeclaration) map.getNamedItem(elementName) != null) {
- return true;
- }
- }
-
- return false;
- }
-
- private static boolean isAttributeAvailable(Element element, String attrName) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null) {
- CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
- if (decl != null) {
- CMNamedNodeMap map = decl.getAttributes();
- if ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Overriding Object's clone() method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
deleted file mode 100644
index a4d8c7327a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- */
-public class StyleAttrAdapter extends AbstractCSSModelAdapter implements IStructuredDocumentListener, IStyleDeclarationAdapter {
-
- private boolean ignoreNotification = false;
- private final static String STYLE = "style";//$NON-NLS-1$
-
- /**
- */
- StyleAttrAdapter() {
- super();
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (model == null && isModelNecessary()) {
- model = createModel();
- if (model == null)
- return null;
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
-
- RegionParser parser = structuredDocument.getParser();
- if (parser instanceof CSSSourceParser) {
- ((CSSSourceParser)parser).setParserMode(CSSSourceParser.MODE_DECLARATION);
- } else {
- return null;
- }
-
- structuredDocument.addDocumentChangedListener(this);
-
- setModel(model); // need to set before valueChanged()
- valueChanged();
- }
- if (model != null && !isModelNecessary()) {
- model = null;
- valueChanged();
- }
- return model;
- }
-
- /**
- */
- public CSSStyleDeclaration getStyle() {
- ICSSModel model = getModel();
- if (model == null)
- return null;
- return (CSSStyleDeclaration) model.getDocument();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return (type == IStyleDeclarationAdapter.class);
- }
-
- /**
- */
- public void newModel(NewDocumentEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- }
-
- /**
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (this.ignoreNotification)
- return;
-
- if (eventType != INodeNotifier.CHANGE)
- return;
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase(STYLE)) {
- valueChanged();
- }
- }
-
- /**
- */
- public void regionChanged(RegionChangedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void regionsReplaced(RegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- private void setValue() {
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- String value = null;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes != null) {
- int count = flatNodes.getLength();
- if (count > 0) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion flatNode = flatNodes.item(i);
- if (flatNode == null)
- continue;
- buffer.append(flatNode.getText());
- }
- value = buffer.toString();
- }
- }
-
- this.ignoreNotification = true;
- if (value == null || value.length() == 0) {
- element.removeAttribute(STYLE);
- }
- else {
- Attr attr = element.getAttributeNode(STYLE);
- if (attr != null) {
- ((IDOMNode) attr).setValueSource(value);
- }
- else {
- Document document = element.getOwnerDocument();
- attr = document.createAttribute(STYLE);
- ((IDOMNode) attr).setValueSource(value);
- element.setAttributeNode(attr);
- }
- }
- this.ignoreNotification = false;
-
- notifyStyleChanged(element);
- }
-
- /**
- */
- private void valueChanged() {
- Element element = getElement();
- if (element == null)
- return;
- if (!isModelNecessary()) { // removed
- setModel(null);
-
- notifyStyleChanged(element);
- return;
- }
-
- ICSSModel model = getExistingModel();
- if (model == null)
- return; // defer
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return; // error
-
- String value = null;
- Attr attr = element.getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE);
- if (attr != null)
- value = ((IDOMNode) attr).getValueSource();
- structuredDocument.setText(this, value);
-
- notifyStyleChanged(element);
- }
-
- /**
- * @return boolean
- */
- private boolean isModelNecessary() {
- return getElement() != null && getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE) != null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
deleted file mode 100644
index f26c90425c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- *
- * Masaki Saitoh (MSAITOH@jp.ibm.com)
- * See Bug 153000 Style Adapters should be lazier
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153000
- *
- ********************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleElementAdapter extends AbstractStyleSheetAdapter implements IStructuredDocumentListener {
-
- private boolean replaceModel = true;
- private boolean ignoreNotification = false;
-
- /**
- */
- protected StyleElementAdapter() {
- super();
- }
-
- /**
- * Preparation of applying changes from CSS sub-model to HTML model
- */
- private void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return;
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- // get old content length
- Node child = element.getFirstChild();
- if (child == null || child.getNodeType() != Node.TEXT_NODE)
- return;
- IDOMNode content = (IDOMNode) child;
- int oldLength = content.getEndOffset() - content.getStartOffset();
-
- // get new content length
- int newLength = 0;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes != null) {
- int count = flatNodes.getLength();
- if (count > 0) {
- IStructuredDocumentRegion last = flatNodes.item(count - 1);
- if (last != null)
- newLength = last.getEnd();
- }
- }
-
- int offset = flatNode.getStart();
- int end = flatNode.getEnd();
- int diff = oldLength - newLength;
- int length = end - offset + diff;
- String data = flatNode.getText();
-
- replaceData(offset, length, data);
- }
-
- /**
- * Apply changes from HTML model to CSS sub-model
- */
- private void contentChanged() {
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- String data = null;
- Node child = element.getFirstChild();
- if (child != null && child.getNodeType() == Node.TEXT_NODE && child.getNextSibling() == null) {
- data = child.getNodeValue();
- }
- if (data == null)
- data = "";//$NON-NLS-1$
-
- // minimize replace range
- int start = 0, end = 0;
- String oldData = structuredDocument.get();
- if (oldData == null)
- oldData = "";//$NON-NLS-1$
-
- // search differenct character position from first
- for (; start < oldData.length() && start < data.length(); start++)
- if (oldData.charAt(start) != data.charAt(start))
- break;
-
- if (start == oldData.length() && start == data.length())
- return; // no change
- else if (start == oldData.length()) {
- structuredDocument.replaceText(getRequesterH2C(), start, 0, data.substring(start)); // append text to last
- }
- else if (start == data.length()) {
- structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - start, ""); // remove text of last //$NON-NLS-1$
- }
- else {
- // search differenct character position from last
- for (; start < oldData.length() - end && start < data.length() - end; end++) {
- if (oldData.charAt(oldData.length() - end - 1) != data.charAt(data.length() - end - 1))
- break;
- }
- structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - end - start, data.substring(start, data.length() - end));
- }
-
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (this.replaceModel) {
- ICSSModel oldModel = model;
- model = createModel(false);
-
- setModel(model, false); // need to set before contentChanged()
- contentChanged();
-
- // from super.createModel()
- // get ModelProvideAdapter
- IModelProvideAdapter modelProvideAdapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- // notify adapter
- if (modelProvideAdapter != null)
- modelProvideAdapter.modelProvided(model);
-
- // from createModel()
- IStructuredDocument structuredDocument = null;
- if (model != null)
- structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
- structuredDocument.addDocumentChangedListener(this);
-
- // from setModel()
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
-
- if (oldModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null) {
- adapter.modelRemoved(oldModel);
- }
- }
-
- this.replaceModel = false;
- }
- return model;
- }
-
- /**
- */
- protected boolean isValidAttribute() {
- Element element = getElement();
- if (element == null) {
- return false;
- }
- String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
- if (element.hasAttribute(HTML40Namespace.ATTR_NAME_TYPE) && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
- return false;
- }
- return true;
- }
-
- /**
- */
- protected ICSSModel createModel() {
- return createModel(true);
- }
-
- /**
- */
- protected ICSSModel createModel(boolean addListener) {
- if (!isValidAttribute()) {
- return null;
- }
-
- ICSSModel model = super.createModel(addListener);
-
- if (!addListener)
- return model;
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
- structuredDocument.addDocumentChangedListener(this);
-
- return model;
- }
-
- /**
- */
- // public ICSSModel getModel() {
- // ICSSModel model = getExistingModel();
- // if (model == null) {
- // model = createModel();
- // if (model == null) return null;
- // IStructuredDocument structuredDocument = model.getStructuredDocument();
- // if (structuredDocument == null) return null;
- // structuredDocument.addModelChangedListener(this);
- // setModel(model); // need to set before contentChanged()
- // contentChanged();
- // }
- // return model;
- // }
- /**
- */
- private Object getRequesterH2C() {
- return (getElement() != null && ((IDOMNode) getElement()).getModel() != null) ? (Object) ((IDOMNode) getElement()).getModel() : this;
- }
-
- /**
- */
- private Object getRequesterC2H() {
- return (getModel() != null) ? (Object) getModel() : this;
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void newModel(NewDocumentEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocument structuredDocument = event.getStructuredDocument();
- if (structuredDocument == null)
- return;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes == null)
- return;
-
- replaceStructuredDocumentRegions(flatNodes, null);
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegionList oldStructuredDocumentRegions = event.getOldStructuredDocumentRegions();
- IStructuredDocumentRegionList newStructuredDocumentRegions = event.getNewStructuredDocumentRegions();
- if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null)
- return;
-
- replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
-
- /**
- * Overriding INodeAdapter's method
- * Event from <STYLE> element
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (this.ignoreNotification)
- return;
-
- if (eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE || eventType == INodeNotifier.CONTENT_CHANGED) {
- contentChanged();
- }
- else if (eventType == INodeNotifier.CHANGE) {
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase("type")) { //$NON-NLS-1$
- this.replaceModel = true;
-
- Element element = getElement();
- if (element == null) {
- return;
- }
- Document document = element.getOwnerDocument();
- if (document == null) {
- return;
- }
- HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) ((INodeNotifier) document).getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter != null) {
- adapter.childReplaced();
- }
- }
- }
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void regionChanged(RegionChangedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void regionsReplaced(RegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- * Apply changes from CSS sub-model to HTML model
- */
- private void replaceData(int offset, int length, String data) {
- IDOMNode element = (IDOMNode) getElement();
- if (element == null)
- return;
- IDOMModel ownerModel = element.getModel();
- if (ownerModel == null)
- return;
- IStructuredDocument structuredDocument = ownerModel.getStructuredDocument();
- if (structuredDocument == null)
- return;
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- int contentOffset = flatNode.getEndOffset();
- if (data == null)
- data = "";//$NON-NLS-1$
-
- this.ignoreNotification = true;
- structuredDocument.replaceText(getRequesterC2H(), contentOffset + offset, length, data);
- this.ignoreNotification = false;
- }
-
- /**
- * Preparation of applying changes from CSS sub-model to HTML model
- */
- private void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- int offset = 0;
- int length = 0;
- if (oldStructuredDocumentRegions != null) {
- int count = oldStructuredDocumentRegions.getLength();
- if (count > 0) {
- IStructuredDocumentRegion first = oldStructuredDocumentRegions.item(0);
- if (first != null)
- offset = first.getStart();
- IStructuredDocumentRegion last = oldStructuredDocumentRegions.item(count - 1);
- if (last != null)
- length = last.getEnd() - offset;
- }
- }
- String data = null;
- if (newStructuredDocumentRegions != null) {
- int count = newStructuredDocumentRegions.getLength();
- if (count > 0) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion flatNode = newStructuredDocumentRegions.item(i);
- if (flatNode == null)
- continue;
- buffer.append(flatNode.getText());
- if (i == 0)
- offset = flatNode.getStart();
- }
- data = buffer.toString();
- }
- }
-
- replaceData(offset, length, data);
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- setModel(model, true);
- }
-
- /**
- */
- protected void setModel(ICSSModel model, boolean setupListener) {
- ICSSModel oldModel = getExistingModel();
- if (model == oldModel)
- return;
- super.setModel(model);
- if (!setupListener)
- return;
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java
deleted file mode 100644
index 5dc6d51a58..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-/**
- */
-public interface StyleListener {
-
- /**
- */
- void styleChanged();
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java
deleted file mode 100644
index 68559e3854..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-/**
- * @deprecated
- */
-public class URLHelper extends org.eclipse.wst.css.core.internal.util.URLHelper {
-
- /**
- * @param baseUrl
- */
- public URLHelper(String baseUrl) {
- super(baseUrl);
- }
-
- /**
- * @param baseUrl
- * @param docRoot
- */
- public URLHelper(String baseUrl, String docRoot) {
- super(baseUrl, docRoot);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
deleted file mode 100644
index 821b118efd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
-import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
-import org.eclipse.wst.sse.core.internal.util.PathHelper;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-// TODO when this class is removed from .core, PathHelper and URLHelper class
-// also can be removed.
-
-/**
- */
-public class URLModelProvider {
-
- private static final int GET_MODEL_FOR_READ = 1;
- // private static final int GET_NEW_MODEL_FOR_READ = 2;
- private static final int GET_MODEL_FOR_EDIT = 3;
- // private static final int GET_NEW_MODEL_FOR_EDIT = 4;
- // private static final int READ_BUFFER_SIZE = 4096;
- // IModelManager
- private IModelManager modelManager = null;
-
- /**
- */
- public URLModelProvider() {
- super();
-
- // obtain model manager
- modelManager = StructuredModelManager.getModelManager();
- }
-
- /**
- * Calculate ID from a filename. This must be same as
- * FileModelProvider.calculateId(IFile)
- */
- private static String calculateId(IPath fullIPath) {
- return fullIPath.toString();
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- private IStructuredModel getCommonModelFor(final IStructuredModel baseModel, final String ref, final int which) throws IOException {
- // first, create absolute url
- String absURL = resolveURI(baseModel, ref, true);
- if ((absURL == null) || (absURL.length() == 0)) {
- return null;
- }
-
- // need to remove file:// scheme if necessary
- try {
- final java.net.URL aURL = new java.net.URL(absURL);
- // An actual URL was given, only file:/// is supported
- // resolve it by finding the file it points to
- if (!aURL.getProtocol().equals("platform")) { //$NON-NLS-1$
- if (aURL.getProtocol().equals("file") && (aURL.getHost().equals("localhost") || aURL.getHost().length() == 0)) {//$NON-NLS-2$//$NON-NLS-1$
- absURL = aURL.getFile();
- final IPath ipath = new Path(absURL);
- // if path has a device, and if it begins with
- // IPath.SEPARATOR, remove it
- final String device = ipath.getDevice();
- if ((device != null) && (device.length() > 0)) {
- if (device.charAt(0) == IPath.SEPARATOR) {
- final String newDevice = device.substring(1);
- absURL = ipath.setDevice(newDevice).toString();
- }
- }
-
- }
- }
- }
- catch (java.net.MalformedURLException mfuExc) {
- }
-
-
- // next, decide project
- IProject project = null;
- final IPath fullIPath = new Path(absURL);
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- IContainer container = workspace.getContainerForLocation(fullIPath);
- if (container != null) {
- // fullIPath doesn't exist in workspace
- project = container.getProject();
- }
-
- // If HTML document has a link to an extern CSS which is not in
- // IProject
- // workspace.getContainerForLoation() may return null. We need to take
- // care
- // of this case
-
- // now, get absURL's IFile
- if ((project != null) && (project.getLocation().isPrefixOf(fullIPath) == false)) {
- // it's at outside of Project
- return null;
- }
-
- IStructuredModel model = null;
- if (project != null) {
- IPath filePath = fullIPath.removeFirstSegments(project.getLocation().segmentCount());
- IFile file = (filePath != null && !filePath.isEmpty()) ? project.getFile(filePath) : null;
- if (file == null) {
- return null;
- }
-
- // obtain model
- if (which == GET_MODEL_FOR_EDIT) {
- model = getModelForEdit(file);
- }
- else if (which == GET_MODEL_FOR_READ) {
- model = getModelForRead(file);
- }
-
- // setting synchronization stamp is IModelManager's client's
- // responsibility
- if (model != null && model.getSynchronizationStamp() == IResource.NULL_STAMP)
- model.resetSynchronizationStamp(file);
- }
- else {
- String id = null;
- InputStream inStream = null;
- // obtain resolver
- URIResolver resolver = (project != null) ? (URIResolver) project.getAdapter(URIResolver.class) : null;
- if (resolver == null) {
- // ProjectResolver can take care of the case if project is
- // null.
- resolver = new ProjectResolver(project);
- }
- if (resolver == null) {
- return null;
- }
-
- // there is no project. we can't expect IProject help to create
- // id/inputStream
- java.io.File file = fullIPath.toFile();
-
- // obatin id
- id = calculateId(fullIPath);
-
- // obtain InputStream
- try {
- inStream = new FileInputStream(file);
- }
- catch (FileNotFoundException fnfe) {
- // the file does not exist, or we don't have read permission
- return null;
- }
-
- // obtain model
- try {
- if (which == GET_MODEL_FOR_EDIT) {
- model = getModelManager().getModelForEdit(id, inStream, resolver);
- }
- else if (which == GET_MODEL_FOR_READ) {
- model = getModelManager().getModelForRead(id, inStream, resolver);
- }
- }
- catch (UnsupportedEncodingException ue) {
- }
- catch (IOException ioe) {
- }
- finally {
- // close now !
- if (inStream != null) {
- inStream.close();
- }
- }
- }
-
-
- // set locationid
- if (model != null && model.getBaseLocation() == null) {
- model.setBaseLocation(fullIPath.toString());
- }
-
- return model;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- public IStructuredModel getModelForEdit(IStructuredModel baseModel, String ref) throws IOException {
- return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_EDIT);
- }
-
- /**
- */
- private IStructuredModel getModelForEdit(IFile file) throws IOException {
- if (file == null)
- return null;
- IModelManager manager = getModelManager();
-
- // create a fake InputStream
- IStructuredModel model = null;
- try {
- model = manager.getModelForEdit(file);
- }
- catch (UnsupportedCharsetException ex) {
- try {
- model = manager.getModelForEdit(file, EncodingRule.FORCE_DEFAULT);
- }
- catch (IOException ioe) {
- }
- catch (CoreException ce) {
- }
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- public IStructuredModel getModelForRead(IStructuredModel baseModel, String ref) throws UnsupportedEncodingException, IOException {
- return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_READ);
- }
-
- /**
- */
- private IStructuredModel getModelForRead(IFile file) throws IOException {
- if (file == null)
- return null;
- IModelManager manager = getModelManager();
-
- // create a fake InputStream
- IStructuredModel model = null;
- try {
- model = manager.getModelForRead(file);
- }
- catch (UnsupportedCharsetException ex) {
- try {
- model = manager.getModelForRead(file, EncodingRule.FORCE_DEFAULT);
- }
- catch (IOException ioe) {
- }
- catch (CoreException ce) {
- }
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- */
- private IModelManager getModelManager() {
- return modelManager;
- }
-
- public IStructuredModel getNewModelForEdit(IFile iFile) {
- if (iFile == null)
- return null;
- IModelManager manager = getModelManager();
- if (manager == null)
- return null;
-
- IStructuredModel model = null;
- try {
- model = manager.getNewModelForEdit(iFile, false);
- }
- catch (IOException ex) {
- }
- catch (ResourceInUse riu) {
- }
- catch (ResourceAlreadyExists rae) {
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- public IStructuredModel getNewModelForRead(IFile iFile) {
- if (iFile == null)
- return null;
- IModelManager manager = getModelManager();
- if (manager == null)
- return null;
-
- IStructuredModel model = null;
- try {
- model = manager.getNewModelForEdit(iFile, false);
- }
- catch (IOException ex) {
- }
- catch (ResourceInUse riu) {
- }
- catch (ResourceAlreadyExists rae) {
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- * Utility to check the model is HTML family or not
- */
- static private boolean isHTMLFamily(IStructuredModel model) {
- if (model instanceof IDOMModel) {
- IDOMDocument document = ((IDOMModel) model).getDocument();
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null)
- return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
- }
- return false;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- * <code>resolveCrossProjectLinks</code>: If resolveCrossProjectLinks
- * is set to true, then this method will properly resolve the URI if it is
- * a valid URI pointing to another (appropriate) project.
- */
- public static String resolveURI(IStructuredModel baseModel, String ref, boolean resolveCrossProjectLinks) {
- if (baseModel == null)
- return null;
- // for HTML, 'href' attribute value of BASE element
- // should be used, if exists any
- String baseHref = null;
- // dmw_TODO needs to be changed to handle a content model
- // of HTML or XHTML
- if (isHTMLFamily(baseModel)) {
- final IDOMModel xmlmodel = (IDOMModel) baseModel;
- final IDOMDocument doc = xmlmodel.getDocument();
- // look for <BASE> w/ href
- final NodeList nl = doc.getElementsByTagName("BASE");//$NON-NLS-1$
- if ((nl != null) && (nl.getLength() > 0)) {
- // per each <BASE>
- for (int i = 0; i < nl.getLength(); i++) {
- final Node baseNode = nl.item(i);
- if (baseNode != null) {
- // get all attrs
- final NamedNodeMap attrNodes = baseNode.getAttributes();
- if (attrNodes != null) {
- final Node attrNode = attrNodes.getNamedItem("HREF");//$NON-NLS-1$
- if (attrNode != null) {
- // found href=""
- final String attrValue = attrNode.getNodeValue();
- if (attrValue != null) {
- baseHref = attrValue.trim();
- }
- }
- }
- }
- // what if there are multiple <BASE> tags ??
- if (baseHref != null) {
- break;
- }
- }
- }
- }
-
- // get resolver in Model
- final URIResolver resolver = baseModel.getResolver();
-
- // resolve to absolute url
- final String absurl = (resolver != null) ? ((baseHref != null) ? resolver.getLocationByURI(ref, baseHref, resolveCrossProjectLinks) : resolver.getLocationByURI(ref, resolveCrossProjectLinks)) : null;
- if ((resolver != null) && (absurl == null) && (ref != null) && (ref.trim().length() > 0) && (ref.trim().charAt(0) == '/')) {
- // to reach here means :
- // ref is a Docroot relative
- // resolver can't resolve ref
- // so that href is a broken and should not create model
- return null;
- }
- if ((absurl != null) && (absurl.length() > 0)) {
- return absurl;
- }
-
- // maybe ref is at outside of the Project
- // obtain docroot;
- final IContainer container = (resolver != null) ? resolver.getRootLocation() : null;
- String docroot = null;
- if (container != null) {
- IPath containerLocation = container.getLocation();
- if (containerLocation != null) {
- docroot = containerLocation.toString();
- }
- else if (container.getLocationURI() != null) {
- docroot = container.getLocationURI().toString();
- }
- }
- if (docroot == null) {
- docroot = baseModel.getBaseLocation();
- }
- if (docroot == null) {
- // should not be
- return null;
- }
-
- // obtain document url
- String modelBaseLocation = baseModel.getBaseLocation();
- if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
- // fallback...
- modelBaseLocation = baseModel.getId();
- }
- if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
- // i can't resolve uri !
- return null;
- }
-
- // resolve url
- URLHelper helper = new URLHelper(PathHelper.getContainingFolderPath(modelBaseLocation), PathHelper.getContainingFolderPath(PathHelper.appendTrailingURLSlash(docroot)));
- return helper.toAbsolute(ref);
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
deleted file mode 100644
index cf9ffb77e2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
+++ /dev/null
@@ -1,170 +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.html.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedHTML;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class EmbeddedHTML implements EmbeddedTypeHandler {
-
- public String ContentTypeID_EmbeddedHTML = "org.eclipse.wst.html.core.internal.contenttype.EmbeddedHTML"; //$NON-NLS-1$
- private List supportedMimeTypes;
-
- /**
- * Constructor for EmbeddedHTML.
- */
- public EmbeddedHTML() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- private void addHTMLishTag(BlockTagParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- /**
- * @see EmbeddedContentType#getFamilyId()
- */
- public String getFamilyId() {
- return ModelHandlerForHTML.AssociatedContentTypeID;
- }
-
- /*
- * Only "model side" embedded factories can be added here.
- */
- public List getAdapterFactories() {
- List factories = new ArrayList();
- factories.add(new ModelQueryAdapterFactoryForEmbeddedHTML());
- // factories.addAll(PluginContributedFactoryReader.getInstance().getFactories(this));
- return factories;
- }
-
- /*
- * @see EmbeddedContentType#initializeParser(RegionParser)
- */
- public void initializeParser(RegionParser parser) {
- if (parser instanceof BlockTagParser) {
- addHTMLishTag((BlockTagParser) parser, "script"); //$NON-NLS-1$
- addHTMLishTag((BlockTagParser) parser, "style"); //$NON-NLS-1$
- }
- }
-
- public List getSupportedMimeTypes() {
- if (supportedMimeTypes == null) {
- supportedMimeTypes = new ArrayList();
- supportedMimeTypes.add("text/html"); //$NON-NLS-1$
- supportedMimeTypes.add("text/xhtml"); //$NON-NLS-1$
- supportedMimeTypes.add("application/xhtml+xml"); //$NON-NLS-1$
- supportedMimeTypes.add("text/vnd.wap.wml"); //$NON-NLS-1$
- }
- return supportedMimeTypes;
- }
-
- public void initializeFactoryRegistry(FactoryRegistry registry) {
- Assert.isNotNull(registry);
-
- INodeAdapterFactory factory = null;
- if (!registry.contains(DocumentTypeAdapter.class)) {
- factory = new HTMLDocumentTypeAdapterFactory();
- registry.addFactory(factory);
- }
- if (!registry.contains(ModelParserAdapter.class)) {
- factory = HTMLModelParserAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
- if (!registry.contains(IStyleSelectorAdapter.class)) {
-
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
- if (!registry.contains(IStyleSheetAdapter.class)) {
-
- factory = StyleAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
-
- }
-
- public void uninitializeFactoryRegistry(FactoryRegistry registry) {
- Assert.isNotNull(registry);
-
- // ISSUE: should these factories be released? Or just
- // removed from this registry, because we are getting ready to
- // re-add them?
- INodeAdapterFactory factory = null;
- if (!registry.contains(DocumentTypeAdapter.class)) {
- factory = registry.getFactoryFor(DocumentTypeAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(ModelParserAdapter.class)) {
- factory = registry.getFactoryFor(ModelParserAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(IStyleSelectorAdapter.class)) {
- factory = registry.getFactoryFor(IStyleSelectorAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(IStyleSheetAdapter.class)) {
- factory = registry.getFactoryFor(IStyleSheetAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
-
- }
-
- public void uninitializeParser(RegionParser parser) {
- // I'm assuming block markers are unique based on name only
- // we add these as full BlockMarkers, but remove based on name alone.
- if (parser instanceof BlockTagParser) {
- ((BlockTagParser) parser).removeBlockMarker("style"); //$NON-NLS-1$
- ((BlockTagParser) parser).removeBlockMarker("script"); //$NON-NLS-1$
- }
- }
-
- public EmbeddedTypeHandler newInstance() {
- return new EmbeddedHTML();
- }
-
- /**
- * will someday be controlled via extension point
- */
- public boolean isDefault() {
- return true;
- }
-
- public boolean canHandleMimeType(String mimeType) {
- return getSupportedMimeTypes().contains(mimeType);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java
deleted file mode 100644
index 9f9badb03a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelhandler;
-
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentCharsetDetector;
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentLoader;
-import org.eclipse.wst.html.core.internal.encoding.HTMLModelLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-
-public class ModelHandlerForHTML extends AbstractModelHandler implements IModelHandler {
- /**
- * Needs to match what's in plugin registry.
- * In fact, can be overwritten at run time with
- * what's in registry! (so should never be 'final')
- */
- static String AssociatedContentTypeID = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
- /**
- * Needs to match what's in plugin registry.
- * In fact, can be overwritten at run time with
- * what's in registry! (so should never be 'final')
- */
- private static String ModelHandlerID_HTML = "org.eclipse.wst.html.core.modelhandler"; //$NON-NLS-1$
-
-
- public ModelHandlerForHTML() {
- super();
- setId(ModelHandlerID_HTML);
- setAssociatedContentTypeId(AssociatedContentTypeID);
- }
-
- public IModelLoader getModelLoader() {
- return new HTMLModelLoader();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new HTMLDocumentCharsetDetector();
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new HTMLDocumentLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
deleted file mode 100644
index 34b600cd9f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- */
-class CMAttributeDeclarationBuddySystem extends CMNodeBuddySystem implements CMAttributeDeclaration {
-
-
- public CMAttributeDeclarationBuddySystem(CMAttributeDeclaration self, CMAttributeDeclaration buddy, boolean isXHTML) {
- super(self, buddy, isXHTML);
- }
-
- /*
- * @see CMAttributeDeclaration#getAttrName()
- */
- public String getAttrName() {
- return getSelf().getAttrName();
- }
-
- /*
- * @see CMAttributeDeclaration#getAttrType()
- */
- public CMDataType getAttrType() {
- return getSelf().getAttrType();
- }
-
- /*
- * @see CMAttributeDeclaration#getDefaultValue()
- * @deprecated in superclass
- */
- public String getDefaultValue() {
- return getSelf().getDefaultValue();
- }
-
- /*
- * @see CMAttributeDeclaration#getEnumAttr()
- * @deprecated in superclass
- */
- public Enumeration getEnumAttr() {
- return getSelf().getEnumAttr();
- }
-
- /*
- * @see CMAttributeDeclaration#getUsage()
- */
- public int getUsage() {
- return getSelf().getUsage();
- }
-
- private CMAttributeDeclaration getSelf() {
- return (CMAttributeDeclaration) self;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java
deleted file mode 100644
index a710eab4a5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.contentmodel.ssi.SSICMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMDocumentForBuddySystem extends CMNodeBuddySystem implements CMDocument {
-
-
- private static CMDocument getHTMLCMDocument() {
- return HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- }
-
- class Elements extends CMNamedNodeMapForBuddySystem {
- public Elements(CMNamedNodeMap elements, boolean isXHTML) {
- super(isXHTML);
- makeBuddySystem(elements);
- addSSIDecls();
- }
-
- protected String getKeyName(CMNode original) {
- CMElementDeclaration edecl = getDecl(original);
- if (edecl == null)
- return null;
- return edecl.getElementName();
- }
-
- protected CMNode createBuddySystem(CMNode original) {
- CMElementDeclaration edecl = getDecl(original);
- return new CMElementDeclarationBuddySystem(edecl, isXHTML());
- }
-
- private CMElementDeclaration getDecl(CMNode cmnode) {
- if (cmnode == null)
- return null;
- if (cmnode.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) cmnode;
- }
-
- private void addSSIDecls() {
- CMDocument ssi = SSICMDocumentFactory.getCMDocument();
- if (ssi == null)
- return;
- CMNamedNodeMap elements = ssi.getElements();
- Iterator i = elements.iterator();
- while (i.hasNext()) {
- CMElementDeclaration decl = (CMElementDeclaration) i.next();
- if (decl == null)
- continue;
- put(decl.getElementName(), decl);
- }
- }
- }
-
- private Elements elements = null;
-
- public CMDocumentForBuddySystem(CMDocument self, boolean isXHTML) {
- super(self, getHTMLCMDocument(), isXHTML);
- }
-
- /*
- * @see CMDocument#getElements()
- */
- public CMNamedNodeMap getElements() {
- if (elements != null)
- return elements;
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- elements = new Elements(cmdoc.getElements(), isXHTML);
- return elements;
- }
-
- /*
- * @see CMDocument#getEntities()
- */
- public CMNamedNodeMap getEntities() {
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- return cmdoc.getEntities();
- }
-
- /*
- * @see CMDocument#getNamespace()
- */
- public CMNamespace getNamespace() {
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- return cmdoc.getNamespace();
- }
-
- private CMDocument getSelf() {
- if (self.getNodeType() != CMNode.DOCUMENT)
- return null;
- return (CMDocument) self;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
deleted file mode 100644
index c934dbb9dd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMElementDeclarationBuddySystem extends CMNodeBuddySystem implements CMElementDeclaration {
-
-
- private static CMDocument htmlcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
- private static CMElementDeclaration getHTMLCMElemDecl(CMElementDeclaration original) {
- CMElementDeclaration buddy = null;
- if (htmlcm != null) {
- CMNamedNodeMap elems = htmlcm.getElements();
- if (elems != null) {
- buddy = (CMElementDeclaration) elems.getNamedItem(original.getElementName());
- }
- }
- return buddy;
- }
-
- private class Attrs extends CMNamedNodeMapForBuddySystem {
- private CMNamedNodeMap buddyAttrs = null;
-
- public Attrs(CMNamedNodeMap attrs, CMNamedNodeMap buddyAttrs, boolean isXHTML) {
- super(isXHTML);
- this.buddyAttrs = buddyAttrs;
- makeBuddySystem(attrs);
- }
-
- protected String getKeyName(CMNode original) {
- CMAttributeDeclaration adecl = getDecl(original);
- if (adecl == null)
- return null;
- return adecl.getAttrName();
- }
-
- protected CMNode createBuddySystem(CMNode original) {
- CMAttributeDeclaration adecl = getDecl(original);
- if (adecl == null)
- return null;
- CMAttributeDeclaration buddy = null;
- if (buddyAttrs != null) {
- buddy = (CMAttributeDeclaration) buddyAttrs.getNamedItem(adecl.getAttrName());
- }
- return new CMAttributeDeclarationBuddySystem(adecl, buddy, isXHTML());
- }
-
- private CMAttributeDeclaration getDecl(CMNode cmnode) {
- if (cmnode == null)
- return null;
- if (cmnode.getNodeType() != CMNode.ATTRIBUTE_DECLARATION)
- return null;
- return (CMAttributeDeclaration) cmnode;
- }
- }
-
- private Attrs attributes = null;
-
- public CMElementDeclarationBuddySystem(CMElementDeclaration self, boolean isXHTML) {
- super(self, getHTMLCMElemDecl(self), isXHTML);
- }
-
- /*
- * @see CMElementDeclaration#getAttributes()
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes != null)
- return attributes;
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- CMElementDeclaration htmlDecl = getBuddy();
- CMNamedNodeMap htmlAttrs = (htmlDecl == null) ? null : htmlDecl.getAttributes();
- attributes = new Attrs(edecl.getAttributes(), htmlAttrs, isXHTML);
- return attributes;
- }
-
- /*
- * @see CMElementDeclaration#getContent()
- */
- public CMContent getContent() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getContent();
- }
-
- /*
- * @see CMElementDeclaration#getContentType()
- */
- public int getContentType() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return CMElementDeclaration.ANY;
- return edecl.getContentType();
- }
-
- /*
- * @see CMElementDeclaration#getElementName()
- */
- public String getElementName() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getElementName();
- }
-
- /*
- * @see CMElementDeclaration#getDataType()
- */
- public CMDataType getDataType() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getDataType();
- }
-
- /*
- * @see CMElementDeclaration#getLocalElements()
- */
- public CMNamedNodeMap getLocalElements() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getLocalElements();
- }
-
- /*
- * @see CMContent#getMaxOccur()
- */
- public int getMaxOccur() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return -1;
- return edecl.getMaxOccur();
- }
-
- /*
- * @see CMContent#getMinOccur()
- */
- public int getMinOccur() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return -1;
- return edecl.getMinOccur();
- }
-
- /*
- * @see CMNode#supports(String)
- */
- public boolean supports(String propertyName) {
- if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
- return true;
- return super.supports(propertyName);
- }
-
- /*
- * @see CMNode#getProperty(String)
- */
- public Object getProperty(String propertyName) {
- if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
- return HTMLCMProperties.Values.OMIT_NONE;
- return super.getProperty(propertyName);
- }
-
- private CMElementDeclaration getSelf() {
- if (self.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) self;
- }
-
- private CMElementDeclaration getBuddy() {
- if (buddy == null)
- return null;
- if (buddy.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) buddy;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java
deleted file mode 100644
index 9b584bfea8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class CMNamedNodeMapForBuddySystem implements CMNamedNodeMap {
-
-
- private boolean isXHTML = false;
- private Hashtable map = new Hashtable();
-
- /**
- * Constructor of CMNamedNodeMapForBuddySystem.
- * CAUTION: Each derived class must call 'makeBuddySystem' method in its
- * constructor to build up its contents.
- */
- public CMNamedNodeMapForBuddySystem(boolean isXHTML) {
- super();
- this.isXHTML = isXHTML;
- }
-
- /*
- * @see CMNamedNodeMap#getLength()
- */
- public int getLength() {
- return map.size();
- }
-
- /*
- * @see CMNamedNodeMap#getNamedItem(String)
- */
- public CMNode getNamedItem(String name) {
- String key = canonicalName(name);
- if (!map.containsKey(key))
- return null;
- return (CMNode) map.get(key);
- }
-
- /*
- * @see CMNamedNodeMap#item(int)
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- Object node = iter.next();
- if (--index < 0)
- return (CMNode) node;
- }
- return null;
- }
-
- /*
- * @see CMNamedNodeMap#iterator()
- */
- public Iterator iterator() {
- return map.values().iterator();
- }
-
- /* package scope. */
- void put(String name, CMNode cmnode) {
- if (name == null || cmnode == null)
- return;
- map.put(canonicalName(name), cmnode);
- }
-
- abstract protected String getKeyName(CMNode original);
-
- abstract protected CMNode createBuddySystem(CMNode original);
-
- protected boolean isXHTML() {
- return isXHTML;
- }
-
- /**
- * Each derived class must call this method in its constructor
- * to build up its contents.
- */
- protected void makeBuddySystem(CMNamedNodeMap original) {
- Iterator i = original.iterator();
- if (i == null)
- return;
- while (i.hasNext()) {
- CMNode org = (CMNode) i.next();
- String key = getKeyName(org);
- CMNode newNode = createBuddySystem(org);
- put(key, newNode);
- }
- }
-
- private String canonicalName(String name) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=171918
- // we are able to "cheat" here a little and use US Locale
- // to get a good canonical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return name.toUpperCase(Locale.US);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
deleted file mode 100644
index e282f9af63..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-class CMNodeBuddySystem implements CMNode {
-
-
- protected boolean isXHTML = false;
- protected CMNode self = null;
- protected CMNode buddy = null;
-
- public CMNodeBuddySystem(CMNode self, CMNode buddy, boolean isXHTML) {
- super();
- this.self = self;
- this.buddy = buddy;
- this.isXHTML = isXHTML;
- }
-
- /*
- * @see CMNode#getNodeName()
- */
- public String getNodeName() {
- return self.getNodeName();
- }
-
- /*
- * @see CMNode#getNodeType()
- */
- public int getNodeType() {
- return self.getNodeType();
- }
-
- /*
- * @see CMNode#supports(String)
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- if (buddy == null)
- return false;
- return buddy.supports(propertyName);
- }
-
- /*
- * @see CMNode#getProperty(String)
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(!isXHTML);
- }
- if (propertyName.equals(HTMLCMProperties.IS_XHTML)) {
- return new Boolean(isXHTML);
- }
-
- if (buddy == null || (!buddy.supports(propertyName)))
- return null;
- return buddy.getProperty(propertyName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
deleted file mode 100644
index 2d802d8c31..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ranges.Range;
-
-/**
- */
-public interface DocumentQuery {
-
- /**
- * isRenderRoot() returns true if - node is BODY element (both explicit
- * and implicit) - node is portalhtml:body element - node is Document node
- * and the document is treated as fragment (with BODY context) Note that
- * in editing a fragment file, Document node should be treated as a
- * substitute of BODY element.
- */
- boolean isRenderRoot(Node node);
-
- /**
- * isHeadCorrespondent() returns true if - node is HEAD element (both
- * explicit and implicit) - node is portalhtml:head element - node is
- * Document node and the document is treated as fragment (with HEAD
- * context) Note that in editing a fragment file (with HEAD context),
- * Document node should be treated as a substitute of HEAD element.
- */
- boolean isHeadCorrespondent(Node node);
-
- /**
- * Implicit BODY element will be gone in V6 SED model. So page designer
- * provides an API to get a range whose content nodes are rendered in
- * design view. getRenderRootRange() returns - a range from BODY's first
- * to its last (if the document has BODY element) - a range form
- * Document's first to its last (if the document is fragment with BODY
- * context) - null (if the document is fragment with HEAD context) [The
- * following cases will be supported since V6] - a range from a custom
- * tag's first to its last (if the document has a custom tag which
- * generates BODY element at runtime) - a range from Document's
- * appropirate offset to its last (if the document does not have explicit
- * BODY/HTML) - a range from HTML element's appropriate offset to its last
- * (if the document does not have explicit BODY but have explicit HTML)
- *
- * @param doc
- * @return
- */
- Range getRenderRootRange(Document doc);
-
- /**
- * Implicit HEAD element will be gone in V6 SED model. So page designer
- * provides an API to get a range whose content nodes are treated as HEAD
- * element's child. getHeadCorrespondentRange() returns - a range from
- * HEAD's first to its last (if the document has HEAD element) - a range
- * form Document's first to its last (if the document is fragment with
- * HEAD context) - null (if the document is fragment with BODY context)
- * [The following cases will be supported since V6] - a range from a
- * custom tag's first to its last (if the document has a custom tag which
- * generates HEAD element at runtime) - a range from Document's first to
- * appropirate offset (if the document does not have explicit HEAD/HTML) -
- * a range from HTML element's first to appropriate offset (if the
- * document does not have explicit HEAD but have explicit HTML)
- *
- * @param doc
- * @return
- */
- Range getHeadCorrespondentRange(Document doc);
-
- /**
- * getRenderRootNode() with [create=false] returns - BODY element if this
- * document is not fragment and has BODY element - null if this document
- * is not fragment and does not have BODY element - Document node if this
- * document is fragment with BODY context - null if this document is
- * fragment with HEAD context [The following cases will be supported since
- * V6] - a custom tag which generates BODY tag at runtime - Document node
- * or HTML element if this document is not fragment but does not have
- * explicit BODY element getRenderRootNode() with [create=true] returns -
- * BODY element if this document is not fragment and has BODY element (no
- * modifictation) - newly created BODY element if this document is not
- * fragment but does not have BODY element - Document node if this
- * document is fragment with BODY context (no modifictation) [The
- * following cases will be supported since V6] - a custom tag which
- * generates BODY tag at runtime (no modifictation) - newly created BODY
- * element if this document is not fragment but does not have explicit
- * BODY element getRenderRootNode() throws HTMLCommandException (since V6)
- * if - this document is fragment with HEAD context and - "create"
- * parameter is true Note that in editing a fragment file, Document node
- * should be treated as a substitute of BODY element.
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getRenderRootNode(Node childOrDocument, boolean create);
-
- /**
- * getHeadCorrespondentNode() with [create=false] returns - HEAD element
- * if this document is not fragment and has HEAD element - null if this
- * document is not fragment and does not have HEAD element - Document node
- * if this document is fragment with HEAD context - null if this document
- * is fragment with BODY context [The following cases will be supported
- * since V6] - a custom tag which generates HEAD tag at runtime - Document
- * node or HTML element if this document is not fragment but does not have
- * explicit HEAD element getHeadCorrespondentNode() with [create=true]
- * returns - HEAD element if this document is not fragment and has HEAD
- * element (no modifictation) - newly created HEAD element if this
- * document is not fragment but does not have HEAD element - Document node
- * if this document is fragment with HEAD context (no modifictation) [The
- * following cases will be supported since V6] - a custom tag which
- * generates HEAD tag at runtime (no modifictation) - newly created HEAD
- * element if this document is not fragment but does not have explicit
- * HEAD element getHeadCorrespondentNode() throws HTMLCommandException
- * (since V6) if - this document is fragment with BODY context and -
- * "create" parameter is true Note that in editing a fragment file,
- * Document node should be treated as a substitute of HEAD element.
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getHeadCorrespondentNode(Node childOrDocument, boolean create);
-
- /**
- * getHtmlCorrespondentNode() throws HTMLCommandException (since V6) if -
- * this document is fragment and "create" parameter is true
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getHtmlCorrespondentNode(Node childOrDocument, boolean create);
-
- /**
- * This inner class is intended for insertion target. please use this like
- * the following : DocumentQuery.InsertionTarget ins;
- * ins.getParent().insertBefore(youInsertionNode, ins.getRef());
- */
- public class InsertionTarget {
- private final Node parent;
- private final Node ref;
-
- public InsertionTarget(Node parent, Node ref) {
- this.parent = parent;
- this.ref = ref;
- }
-
- public Node getParent() {
- return parent;
- }
-
- public Node getRef() {
- return ref;
- }
- }
-
- /**
- * getHeadInsertionTarget() returns appropriate insetion target location
- * for HEAD child tags such as <script>, <style>, <meta>etc. Basically
- * this function returns <HEAD>tag's the last position. Note that this
- * would not create actual <HEAD>tag when the document does not have it.
- * <HEAD>is omittable tag so this function returns appropriate position
- * to which implicit <HEAD>can be inserted, if the document has no
- * <HEAD>.
- *
- * @param doc
- * @return
- */
- InsertionTarget getHeadInsertionTarget(Document doc);
-
- /**
- * getPageInsertionTarget() returns appropriate insetion target location
- * for page-level markups, such as JSP directives, usebean tags or <html>
- * tag. Basically this function returns just before <HTML>tag. Note that
- * this would not create actual <HTML>tag when the document does not have
- * it. In such case, this function returns a position just before the
- * meaningful tags such as HTML/JSP elements.
- *
- * @param doc
- * @return
- */
- InsertionTarget getPageInsertionTarget(Document doc);
-
- /**
- * isFragment() returns whether the document is fragment or complete
- * document
- *
- * @param doc
- * @return
- */
- boolean isFragment(Document doc);
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java
deleted file mode 100644
index e5ee29645b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public interface ElementDeclarationAdapter extends INodeAdapter {
-
- /**
- */
- CMElementDeclaration getDeclaration();
-
- /**
- */
- void setDeclaration(CMElementDeclaration declaration);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
deleted file mode 100644
index b558fb5e00..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- */
-public class ElementDeclarationAdapterFactory implements INodeAdapterFactory {
-
- private static ElementDeclarationAdapterFactory instance = null;
-
- /**
- */
- private ElementDeclarationAdapterFactory() {
- super();
- }
-
- /**
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getExistingAdapter(ElementDeclarationAdapter.class);
- if (adapter != null)
- return adapter;
- adapter = new HTMLElementDeclarationAdapter();
- notifier.addAdapter(adapter);
- return adapter;
- }
-
- /**
- */
- public synchronized static ElementDeclarationAdapterFactory getInstance() {
- if (instance == null)
- instance = new ElementDeclarationAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == ElementDeclarationAdapter.class);
- }
-
- public void release() {
- // default is to do nothing
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java
deleted file mode 100644
index 377ad0972d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public final class HMQUtil {
-
- private final static Vector nullVector = new Vector();
-
- /* HMQUtil class must not instantiate. */
- private HMQUtil() {
- super();
- }
-
- /* gather all element declarations in inclusion of each parent of the target.
- * the inclusion of the target is also gathered. */
- public static Collection getInclusions(Element target) {
- if (target == null)
- return nullVector;
- Collection inclusions = gatherInclusions(getAncestorDeclarations(target));
-
- Hashtable availables = new Hashtable();
- Iterator iter = inclusions.iterator();
- while (iter.hasNext()) {
- CMContent inclusion = (CMContent) iter.next();
- switch (inclusion.getNodeType()) {
- case CMNode.GROUP :
- extractDeclarations(availables, (CMGroup) inclusion);
- break;
- case CMNode.ELEMENT_DECLARATION :
- addInclusion(availables, (CMElementDeclaration) inclusion);
- break;
- }
- }
-
- return availables.values();
- }
-
- private static Collection getAncestorDeclarations(Element target) {
- Vector ancestors = new Vector();
-
- Document doc = target.getOwnerDocument();
- ModelQuery query = ModelQueryUtil.getModelQuery(doc);
- CMElementDeclaration decl = query.getCMElementDeclaration(target);
- ancestors.add(decl);
-
- Element parent = getParent(target);
- while (parent != null) {
- decl = query.getCMElementDeclaration(parent);
- if (decl != null)
- ancestors.add(decl);
- parent = getParent(parent);
- }
- return ancestors;
- }
-
- private static void addInclusion(Hashtable availables, CMElementDeclaration decl) {
- String name = decl.getElementName();
- if (availables.containsKey(name))
- return;
- availables.put(name, decl);
- }
-
- private static Collection gatherInclusions(Collection ancestors) {
- Vector inclusions = new Vector();
- Iterator iter = ancestors.iterator();
- while (iter.hasNext()) {
- CMElementDeclaration decl = (CMElementDeclaration) iter.next();
- if (decl.supports(HTMLCMProperties.INCLUSION)) {
- CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION);
- if (inclusion != null)
- inclusions.add(inclusion);
- }
- }
- return inclusions;
- }
-
- private static Element getParent(Node target) {
- Node parent = target.getParentNode();
- while (parent != null) {
- if (parent.getNodeType() == Node.ELEMENT_NODE)
- return (Element) parent;
- parent = parent.getParentNode();
- }
- return null;
- }
-
- private static void extractDeclarations(Hashtable availables, CMGroup group) {
- CMNodeList content = group.getChildNodes();
- for (int i = 0; i < content.getLength(); i++) {
- CMNode cmn = content.item(i);
- if (cmn == null || cmn.getNodeType() != CMNode.ELEMENT_DECLARATION)
- continue;
- addInclusion(availables, (CMElementDeclaration) cmn);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java
deleted file mode 100644
index 76f0281967..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public class HTMLElementDeclarationAdapter implements ElementDeclarationAdapter {
-
- private CMElementDeclaration declaration = null;
-
- /**
- */
- public HTMLElementDeclarationAdapter() {
- super();
- }
-
- /**
- */
- public CMElementDeclaration getDeclaration() {
- return this.declaration;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return (type == ElementDeclarationAdapter.class);
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setDeclaration(CMElementDeclaration declaration) {
- this.declaration = declaration;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java
deleted file mode 100644
index 6d7fbbe3ae..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.SimpleAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-/**
- */
-public class HTMLModelQueryAssociationProvider extends SimpleAssociationProvider {
-
- /**
- * @param modelQueryCMProvider org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider
- */
- public HTMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
- super(new HTMLModelQueryCMProvider(cache, idResolver));
- }
-
- // MIWA: We cannot cache a CMElementDeclaration any more. Because, when the DOCTYPE
- // was changed, CMDocument would be changed. Then, a cached CMElementDeclaration
- // would be invalid. If some performance problems occurs, we consider a smarter
- // cache mechanism.
- //
- // public CMElementDeclaration getCMElementDeclaration(Element element) {
- // // check if element declaration is cached
- // INodeNotifier notifier = (INodeNotifier) element;
- // ElementDeclarationAdapter adapter = (ElementDeclarationAdapter) notifier.getExistingAdapter(ElementDeclarationAdapter.class);
- // if (adapter != null)
- // return adapter.getDeclaration();
- //
- // CMElementDeclaration decl = super.getCMElementDeclaration(element);
- //
- // // cache HTML element declaration only
- // if (decl != null && decl instanceof HTMLElementDeclaration) {
- // IAdapterFactory factory = ElementDeclarationAdapterFactory.getInstance();
- // adapter = (ElementDeclarationAdapter) factory.adapt(notifier);
- // if (adapter != null)
- // adapter.setDeclaration(decl);
- // }
- //
- // return decl;
- // }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
deleted file mode 100644
index 80c1ce5cec..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.modelquery;
-
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- * CMDocument provider for HTML and XHTML documents.
- *
- * This added and/or made public specifically for experimentation. It will
- * change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
-
-
-public class HTMLModelQueryCMProvider implements ModelQueryCMProvider {
-
-
- private static CMDocument staticHTML5 = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML5_DOC_TYPE);
- private static CMDocument staticHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- private static CMDocument staticCHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.CHTML_DOC_TYPE);
- private static HTMLDocumentTypeRegistry doctypeRegistry = HTMLDocumentTypeRegistry.getInstance();
- private static Hashtable buddyCache = new Hashtable();
-
- private XHTMLAssociationProvider xhtmlassoc = null;
-
- public HTMLModelQueryCMProvider(CMDocumentCache cache, URIResolver idResolver) {
- super();
- xhtmlassoc = new XHTMLAssociationProvider(cache, idResolver);
- }
-
- /**
- * Returns the CMDocument that corresponds to the DOM Node. or null if no
- * CMDocument is appropriate for the DOM Node.
- */
- public CMDocument getCorrespondingCMDocument(Node node) {
- IDOMDocument owner = getOwnerXMLDocument(node);
- if (owner == null)
- return null;
-
- String pid = getPublicId(owner);
- // no PID, always return the currently-supported HTML version
- if (pid == null || "".equals(pid)){
- return staticHTML5;
- }
-
- HTMLDocumentTypeEntry entry = doctypeRegistry.getEntry(pid);
- if (entry == null)
- return staticHTML;
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=151000 - use internal content model
- if (entry.useInternalModel()) {
- if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
- return staticCHTML;
- }
- return staticHTML;
- }
-
- pid = entry.getPublicId();
- String sid = entry.getSystemId();
-
- CMDocument dtdcm = xhtmlassoc.getXHTMLCMDocument(pid, sid);
- if (dtdcm == null) {
- if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
- return staticCHTML;
- }
- return staticHTML;
- }
-
- String grammarURI = xhtmlassoc.getCachedGrammerURI();
- CMDocument buddycm = (CMDocument) buddyCache.get(grammarURI);
- if (buddycm != null)
- return buddycm;
-
- buddycm = new CMDocumentForBuddySystem(dtdcm, entry.isXMLType());
- buddyCache.put(grammarURI, buddycm);
- return buddycm;
- }
-
- // private methods
- private IDOMDocument getOwnerXMLDocument(Node node) {
- if (node == null)
- return null;
- Document owner = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument();
- if (owner == null)
- return null;
- if (!(owner instanceof IDOMDocument))
- return null;
- return (IDOMDocument) owner;
- }
-
- private String getPublicId(IDOMDocument doc) {
- if (doc == null)
- return null;
- DocumentType doctype = doc.getDoctype();
- //doctype.
- return (doctype != null) ? doctype.getPublicId() : doc.getDocumentTypeId();
- }
-
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
deleted file mode 100644
index b3b02bd597..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.XMLModelQueryAssociationProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This added and/or made public specifically for experimentation. It
- * will change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
-
-public class HTMLModelQueryImpl extends ModelQueryImpl implements MovableModelQuery {
-
- protected CMDocumentCache fCache = null;
- protected XMLModelQueryAssociationProvider xmlAssocProv = null;
-
- public HTMLModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
- super(new HTMLModelQueryAssociationProvider(cache, idResolver));
- fCache = cache;
- xmlAssocProv = new XMLModelQueryAssociationProvider(cache, idResolver);
- }
-
- public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions) {
- List originalCandidates = super.getAvailableContent(element, ed, includeOptions);
- if ((includeOptions & INCLUDE_CHILD_NODES) == 0)
- return originalCandidates;
- // When the target document is XHTML, it is waste to find inclusions,
- // since inclusion is available in HTML only.
- if (!ed.supports(HTMLCMProperties.IS_XHTML))
- return originalCandidates;
-
- Boolean isXhtml = Boolean.FALSE;
- isXhtml = (Boolean) ed.getProperty(HTMLCMProperties.IS_XHTML);
- if (isXhtml != null && isXhtml.booleanValue())
- return originalCandidates;
-
- // OK, the target is surely a HTML element, so it may have inclusion.
- // Try to find it.
- Vector candidates = new Vector(originalCandidates);
-
- switch (ed.getContentType()) {
- case CMElementDeclaration.ANY :
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.MIXED :
- // do enumerate inclusions.
- candidates.addAll(HMQUtil.getInclusions(element));
- break;
- case CMElementDeclaration.EMPTY :
- case CMElementDeclaration.PCDATA :
- case CMElementDeclaration.CDATA :
- default :
- // should not add any inclusions.
- // so, nothing to do here.
- break;
- }
- // If the current element does not available, it is impossible
- // to filter out exclusion.
- if (element == null)
- return candidates;
-
- // Now, the time to check exclusion.
- Vector content = new Vector(candidates.size());
- for (int i = 0; i < candidates.size(); i++) {
- Object eCandidate = candidates.elementAt(i);
- if(eCandidate instanceof CMElementDeclaration) {
- CMElementDeclaration candidate = (CMElementDeclaration) eCandidate;
- if (candidate == null)
- continue;
- if (isExcluded(candidate, element))
- continue;
- content.add(candidate);
- }
- }
-
- return content;
- }
-
- /**
- * @see MovableModelQuery#setIdResolver(IdResolver)
- */
- public void setIdResolver(URIResolver newIdResolver) {
- modelQueryAssociationProvider = new HTMLModelQueryAssociationProvider(fCache, newIdResolver);
- }
-
- // utilities
- private static boolean isExcluded(CMElementDeclaration candidate, Element target) {
- CMNamedNodeMap prohibited = getProhibitedAncestors(candidate);
- if (prohibited == null)
- return false;
- Element parent = target;
- while (parent != null) {
- CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
- if (pdec != null)
- return true;
- parent = getExplicitParentElement(parent);
- }
- return false;
- }
-
- private static CMNamedNodeMap getProhibitedAncestors(CMElementDeclaration dec) {
- if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
- return null;
- return (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
- }
-
- /* get an ancestor element ignoring implicit ones. */
- private static Element getExplicitParentElement(Node child) {
- if (child == null)
- return null;
-
- Node p = child.getParentNode();
- while (p != null) {
- if (p.getNodeType() == Node.ELEMENT_NODE) {
- if (p instanceof IDOMElement) {
- if (((IDOMElement) p).isImplicitTag()) {
- p = p.getParentNode();
- continue;
- }
- }
- return (Element) p;
- }
- p = p.getParentNode();
- }
- return null;
- }
-
- public CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration result = super.getCMElementDeclaration(element);
- if (null != result)
- return result;
-
- return xmlAssocProv.getCMElementDeclaration(element);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
deleted file mode 100644
index ef7c2638c4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-
-public class ModelQueryAdapterFactoryForEmbeddedHTML extends ModelQueryAdapterFactoryForHTML {
-
-
- /**
- * Constructor for ModelQueryAdapterFactoryForEmbeddedHTML.
- */
- public ModelQueryAdapterFactoryForEmbeddedHTML() {
- super(ModelQueryAdapter.class, false);
- }
-
-
- public INodeAdapterFactory copy() {
-
- return new ModelQueryAdapterFactoryForEmbeddedHTML();
- }
-
- /**
- * ISSUE: this "forces" a new one to always be created/returned, not
- * "cached" on the node. That seems incorrect. Simply using
- * shouldRegisterFalse should work, except, there might have been one
- * there that someone else already explicitly put there, so this is only
- * way I know to override that. Especially complicated here since a number
- * of adapters are for ModelQueryAdapter.class.
- */
- public INodeAdapter adapt(INodeNotifier object) {
- return adaptNew(object);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
deleted file mode 100644
index 9cc2f2e7b2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import java.io.File;
-import java.net.URI;
-
-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.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.XMLCatalogIdResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapterImpl;
-
-/**
- * Creates a ModelQueryAdapter for HTML models
- */
-public class ModelQueryAdapterFactoryForHTML extends AbstractAdapterFactory {
-
- ModelQueryAdapterImpl modelQueryAdapter;
- IStructuredModel modelStateNotifier;
- private InternalModelStateListener internalModelStateListener;
-
- class InternalModelStateListener implements IModelStateListener {
-
- /**
- * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
- */
- public void modelAboutToBeChanged(IStructuredModel model) {
- // ISSUE: should we "freeze" state, or anything?
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- // ISSUE: should we "freeze" state, or anything?
-
- }
-
- /**
- * @see IModelStateListener#modelChanged(IStructuredModel)
- */
- public void modelChanged(IStructuredModel model) {
- // nothing to do?
- }
-
- /**
- * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
- * boolean)
- */
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- // nothing to do
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- updateResolver(structuredModel);
- }
-
- /**
- * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
- */
- public void modelResourceDeleted(IStructuredModel model) {
- // nothing to do?
- }
-
- /**
- * @see IModelStateListener#modelResourceMoved(IStructuredModel,
- * IStructuredModel)
- */
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- modelStateNotifier.removeModelStateListener(this);
- modelStateNotifier = newModel;
- updateResolver(modelStateNotifier);
- modelStateNotifier.addModelStateListener(this);
- }
-
- private void updateResolver(IStructuredModel model) {
- String baseLocation = model.getBaseLocation();
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- if (baseFile != null) {
- if (baseFile.getLocation() != null) {
- baseLocation = baseFile.getLocation().toString();
- }
- if (baseLocation == null && baseFile.getLocationURI() != null) {
- baseLocation = baseFile.getLocationURI().toString();
- }
- if (baseLocation == null) {
- baseLocation = baseFile.getFullPath().toString();
- }
- }
- else {
- baseLocation = model.getBaseLocation();
- }
- modelQueryAdapter.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
- }
-
- }
-
-
- /**
- * ModelQueryAdapterFactoryForHTML constructor comment. Note: this is a
- * case there the key is not exactly same as the class we are after.
- */
- public ModelQueryAdapterFactoryForHTML() {
- super(ModelQueryAdapter.class, true);
- }
-
- /**
- * We need this protected version to allow subclasses to pass up standard
- * behaviour.
- *
- * @param adapterKey
- * @param registerAdapters
- */
-
- protected ModelQueryAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
-
- public INodeAdapterFactory copy() {
-
- return new ModelQueryAdapterFactoryForHTML();
- }
-
- public void release() {
- super.release();
- if (modelStateNotifier != null) {
- modelStateNotifier.removeModelStateListener(internalModelStateListener);
- }
-
- modelStateNotifier = null;
-
- if (modelQueryAdapter != null) {
- modelQueryAdapter.release();
- }
- }
-
- /**
- * createAdapter method comment.
- *
- * XXX: we must make this method more independent of 'location' (at least
- * provide some fall-back method).
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
-
- if (Debug.displayInfo) {
- Logger.log(Logger.INFO_DEBUG, "-----------------------ModelQueryAdapterFactoryForHTML.createAdapter" + target); //$NON-NLS-1$
- }
- if (modelQueryAdapter == null) {
- if (target instanceof IDOMNode) {
- IDOMNode xmlNode = (IDOMNode) target;
- modelStateNotifier = xmlNode.getModel();
- modelStateNotifier.addModelStateListener(getInternalModelStateListener());
-
- IStructuredModel model = xmlNode.getModel();
- org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
- if (Debug.displayInfo)
- System.out.println("----------------ModelQueryAdapterFactoryForHTML... baseLocation : " + resolver.getFileBaseLocation()); //$NON-NLS-1$
-
- /**
- * XMLCatalogIdResolver currently requires a filesystem
- * location string. Customarily this will be what is in the
- * deprecated SSE URIResolver and required by the Common URI
- * Resolver.
- */
- URIResolver idResolver = null;
- if (resolver != null) {
- idResolver = new XMLCatalogIdResolver(resolver.getFileBaseLocation(), resolver);
- }
- else {
- /*
- * 203649 - this block may be necessary due to ordering of
- * setting the resolver into the model
- */
- String baseLocation = null;
- String modelsBaseLocation = model.getBaseLocation();
- if (modelsBaseLocation != null) {
- File file = new Path(modelsBaseLocation).toFile();
- if (file.exists()) {
- baseLocation = file.getAbsolutePath();
- }
- else {
- IPath basePath = new Path(model.getBaseLocation());
- IResource derivedResource = null;
- if (basePath.segmentCount() > 1)
- derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- else
- derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
- IPath derivedPath = derivedResource.getLocation();
- if (derivedPath != null) {
- baseLocation = derivedPath.toString();
- }
- else {
- URI uri = derivedResource.getLocationURI();
- if (uri != null) {
- baseLocation = uri.toString();
- }
- }
- }
- if(baseLocation == null) {
- baseLocation = modelsBaseLocation;
- }
- }
- idResolver = new XMLCatalogIdResolver(baseLocation, null);
- }
- CMDocumentCache documentCache = new CMDocumentCache();
- ModelQuery modelQuery = new HTMLModelQueryImpl(documentCache, idResolver);
- modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
- modelQueryAdapter = new ModelQueryAdapterImpl(documentCache, modelQuery, idResolver);
- }
- }
- return modelQueryAdapter;
- }
-
-
-
- private final InternalModelStateListener getInternalModelStateListener() {
- if (internalModelStateListener == null) {
- internalModelStateListener = new InternalModelStateListener();
- }
- return internalModelStateListener;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
deleted file mode 100644
index 4c442976fd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-
-/**
- * A Class to provide an association between XHTML documents and DTDs for
- * XHTML. This class is intended to be used only in HTMLModelQueryCMProvider.
- */
-/*
- * This class closely resemble XMLModelQueryAssociationProvider.
- */
-class XHTMLAssociationProvider extends XMLAssociationProvider {
-
- /**
- * set CACHE_FIXED_DOCUMENTS to false to test effects of not caching certain catalog-contributed schemas.
- */
- private static final boolean CACHE_FIXED_DOCUMENTS = true;
- private static final String[] STANDARD_SCHEMA_BUNDLES = new String[] {"org.eclipse.wst.standard.schemas","org.eclipse.jst.standard.schemas"};
- private static final String XML_CATALOG_EXT_POINT = "org.eclipse.wst.xml.core.catalogContributions";
- private static Collection fFixedPublicIDs = null;
- private static Map fFixedCMDocuments = new HashMap();
-
- /**
- * set USE_QUICK_CACHE to false to test effects of not caching at all.
- */
- private static final boolean USE_QUICK_CACHE = true;
- protected URIResolver idResolver;
- private String fCachedGrammerURI;
- private String fCachedPublicID;
- private String fCachedSystemID;
- private boolean cached;
-
- public XHTMLAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
- super(cache);
- this.idResolver = idResolver;
-
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399. If the CM document URI
- // is resolved and cached at this level instruct the CM model manager to avoid
- // re-resolving the URI.
-
- if (USE_QUICK_CACHE) {
- documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_PERFORM_URI_RESOLUTION, false);
- }
- }
-
- /**
- *
- * @param publicId
- * @param systemId
- * @return
- */
- public CMDocument getXHTMLCMDocument(String publicId, String systemId) {
- if (idResolver == null)
- return null;
-
- String grammerURI = null;
- if (USE_QUICK_CACHE) {
- /*
- * In parsing a document, we get many identical requests to this
- * method, so instead of looking up (resolving) grammerURI each
- * time, we'll just return previously cached one. Probably not
- * worth have a more complex cache than that.
- */
- if (cached && sameAs(fCachedPublicID, publicId) && sameAs(fCachedSystemID, systemId)) {
- grammerURI = fCachedGrammerURI;
- }
- else {
- grammerURI = idResolver.resolve(null, publicId, systemId);
- fCachedGrammerURI = grammerURI;
- fCachedPublicID = publicId;
- fCachedSystemID = systemId;
- cached = true;
- }
- }
- else {
- grammerURI = idResolver.resolve(null, publicId, systemId);
- }
-
- if (grammerURI == null)
- return null;
-
- CMDocument cmDocument = null;
- if (CACHE_FIXED_DOCUMENTS) {
- Reference ref = (Reference) fFixedCMDocuments.get(publicId);
- if (ref != null) {
- cmDocument = (CMDocument) ref.get();
- if (cmDocument != null) {
- return cmDocument;
- }
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88896
- *
- * We once called the deprecated 2 argument form of getCMDocument.
- *
- * CMDocument cmDocument = documentManager.getCMDocument(publicId,
- * grammerURI);
- *
- * which eventually resulted in empty string for type, which I don't
- * think the infrastructure handles any longer. So, I deleted
- * deprecated methods, and switched to null for type argument.
- *
- * 'null' means to "create based on uri".
- *
- * FYI, 'dtd' would mean load only those registered as dtd's
- *
- * CMDocument cmDocument = documentManager.getCMDocument(publicId,
- * grammerURI); CMDocument cmDocument =
- * documentManager.getCMDocument(publicId, grammerURI, "dtd");
- */
- synchronized (grammerURI) {
- cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
- }
-
- if (CACHE_FIXED_DOCUMENTS && getFixedPublicIDs().contains(publicId)) {
- fFixedCMDocuments.put(publicId, new SoftReference(cmDocument));
- }
-
- return cmDocument;
- }
-
- /**
- */
- protected String resolveGrammarURI(Document document, String publicId, String systemId) {
- return idResolver.resolve(null, publicId, systemId);
- }
-
- private boolean sameAs(String a, String b) {
- boolean result = false;
- if (a == null) {
- result = b == null;
- }
- else {
- result = a.equals(b);
- }
- return result;
- }
-
- /**
- * This added and/or made public specifically for experimentation. It
- * will change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
- public String getCachedGrammerURI() {
- return fCachedGrammerURI;
- }
-
- /**
- * @return the fFixedPublicIDs, a collection of contributed Public
- * Identifiers from the known schema plug-ins.
- */
- private static Collection getFixedPublicIDs() {
- /**
- * public:publicId
- * TODO: system:systemId and uri:name in their own methods and maps?
- */
- synchronized (STANDARD_SCHEMA_BUNDLES) {
- if (fFixedPublicIDs == null) {
- fFixedPublicIDs = new HashSet();
- for (int i = 0; i < STANDARD_SCHEMA_BUNDLES.length; i++) {
- IExtension[] extensions = Platform.getExtensionRegistry().getExtensions(STANDARD_SCHEMA_BUNDLES[i]);
- for (int j = 0; j < extensions.length; j++) {
- if (XML_CATALOG_EXT_POINT.equals(extensions[j].getExtensionPointUniqueIdentifier())) {
- IConfigurationElement[] configurationElements = extensions[j].getConfigurationElements();
- for (int k = 0; k < configurationElements.length; k++) {
- IConfigurationElement[] publics = configurationElements[k].getChildren("public");
- for (int l = 0; l < publics.length; l++) {
- String publicId = publics[l].getAttribute("publicId");
- if (publicId != null && publicId.length() > 0) {
- fFixedPublicIDs.add(publicId);
- }
- }
- }
- }
- }
- }
- }
- }
- return fFixedPublicIDs;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
deleted file mode 100644
index 0186a71cec..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-
-/**
- * Sets default values for HTML Core preferences
- */
-public class HTMLCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
- // formatting preferences
- node.putInt(HTMLCorePreferenceNames.LINE_WIDTH, 72);
- node.putBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
- node.put(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
- node.putInt(HTMLCorePreferenceNames.INDENTATION_SIZE, 1);
- node.putBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
- node.putBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET, false);
-
- // cleanup preferences
- node.putInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
- node.putInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
- // node.putBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS,
- // true);
- node.putBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
- node.putBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, true);
- node.putBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
- node.putBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE, true);
- node.putBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES, false);
-
- // code generation preferences
- node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
- String defaultEnc = "UTF-8";//$NON-NLS-1$
- String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
- if (systemEnc != null) {
- defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, "UTF-8");//$NON-NLS-1$
- }
- node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
- node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
- node.putInt(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- node.putInt(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-
- // this could be made smarter by actually looking up the content
- // type's valid extensions
- node.put(HTMLCorePreferenceNames.DEFAULT_EXTENSION, "html"); //$NON-NLS-1$
-
- node.put(HTMLCorePreferenceNames.INLINE_ELEMENTS, "a,abbr,acronym,b,basefont,big,br,cite,em,font,i,img,input,label,li,q,s,select,small,span,strike,strong,sub,sup,td,th,title,u");
-
- initializeValidationPreferences(node);
- }
-
- /**
- * Initializes the default validation preferences
- * @param node the Eclipse preference node
- */
- private void initializeValidationPreferences(IEclipsePreferences node) {
- // Attributes
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_NAME, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_VALUE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_NAME_MISMATCH, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_NAME, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_VALUE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, ValidationMessage.IGNORE);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_EQUALS_MISSING, ValidationMessage.WARNING);
-
-
- // Elements
- node.putInt(HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_NAME, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_END, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_DUPLICATE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_COEXISTENCE, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_TEXT, ValidationMessage.WARNING);
-
-
- // DOCTYPE
- node.putInt(HTMLCorePreferenceNames.DOC_DUPLICATE, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.DOC_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.DOC_DOCTYPE_UNCLOSED, ValidationMessage.ERROR);
-
- // Text
- node.putInt(HTMLCorePreferenceNames.TEXT_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.TEXT_INVALID_CHAR, ValidationMessage.WARNING);
-
- // Comment
- node.putInt(HTMLCorePreferenceNames.COMMENT_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.COMMENT_UNCLOSED, ValidationMessage.ERROR);
-
- // CDATA
- node.putInt(HTMLCorePreferenceNames.CDATA_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.CDATA_UNCLOSED, ValidationMessage.ERROR);
-
- // Processing Instructions
- node.putInt(HTMLCorePreferenceNames.PI_INVALID_CONTENT, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.PI_UNCLOSED, ValidationMessage.ERROR);
-
- // Entity Reference
- node.putInt(HTMLCorePreferenceNames.REF_UNDEFINED, ValidationMessage.WARNING);
- node.putInt(HTMLCorePreferenceNames.REF_INVALID_CONTENT, ValidationMessage.WARNING);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
deleted file mode 100644
index fe7fb60010..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.preferences;
-
-/**
- * Common preference keys used by HTML core
- *
- * @plannedfor 1.0
- */
-public class HTMLCorePreferenceNames {
- private HTMLCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * The default extension to use when none is specified in the New HTML
- * File Wizard.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
- /**
- * The maximum width of a line before a line split is needed.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-
- /**
- * Indicates if all blanks lines should be cleared during formatting.
- * Blank lines will be kept when false.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
- /**
- * The number of #INDENTATION_CHAR for 1 indentation.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String INDENTATION_SIZE = "indentationSize";//$NON-NLS-1$
-
- /**
- * The character used for indentation.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {TAB, SPACE}
- * </p>
- */
- public static final String INDENTATION_CHAR = "indentationChar";//$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * tab character when formatting.
- *
- * @see #SPACE
- * @see #INDENTATION_CHAR
- */
- public static final String TAB = "tab"; //$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * space character when formatting.
- *
- * @see #TAB
- * @see #INDENTATION_CHAR
- */
- public static final String SPACE = "space"; //$NON-NLS-1$
-
- /**
- * Indicates if tags with multiple attributes should be formatted
- * (splitting each attr on a new line).
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-
- /**
- * Indicates if end brackets of start tags should be placed on a new line
- * if the start tag spans more than one line.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String ALIGN_END_BRACKET = "alignEndBracket";//$NON-NLS-1$
-
- /**
- * Indicates whether or not cleanup processor should format source.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
- /**
- * Indicates whether or not empty elements should be compressed during
- * cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert required attributes during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert missing tags during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to quote all attribute values during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to convert all line delimiters during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-
- /**
- * Indicates the line delimiter to use during cleanup if converting line
- * delimiters.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {CR, CRLF, LF, NO_TRANSLATION}
- * </p>
- *
- */
- public static final String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
- /**
- * Indicates case to use on all tag names during cleanup.
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER, ASIS}
- * </p>
- */
- public static final String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
-
- /**
- * Indicates case to use on all attribute names during cleanup.
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER, ASIS}
- * </p>
- */
- public static final String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
-
- /**
- * Preferred markup case for tag names in code generation
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER}
- * </p>
- */
- public static final String TAG_NAME_CASE = "tagNameCase";//$NON-NLS-1$
-
- /**
- * Preferred markup case for attribute names in code generation
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER}
- * </p>
- */
- public static final String ATTR_NAME_CASE = "attrNameCase";//$NON-NLS-1$
-
- /**
- * Preferred elements to be considered as inline for the purposes of formatting
- * <p>
- * Value is a comma-separated list of element names
- * </p>
- */
- public static final String INLINE_ELEMENTS = "inlineElements"; //$NON-NLS-1$
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to leave case as is.
- *
- * @see #LOWER
- * @see #UPPER
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int ASIS = 0;
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to make name lowercase.
- *
- * @see #ASIS
- * @see #UPPER
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int LOWER = 1;
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to make name uppercase.
- *
- * @see #LOWER
- * @see #ASIS
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int UPPER = 2;
-
- public static final String USE_PROJECT_SETTINGS = "use-project-settings";//$NON-NLS-1$
-
- public static final String ATTRIBUTE_UNDEFINED_NAME = "attrUndefName";//$NON-NLS-1$
- public static final String ATTRIBUTE_UNDEFINED_VALUE = "attrUndefValue";//$NON-NLS-1$
- public static final String ATTRIBUTE_NAME_MISMATCH = "attrNameMismatch";//$NON-NLS-1$
- public static final String ATTRIBUTE_INVALID_NAME = "attrInvalidName";//$NON-NLS-1$
- public static final String ATTRIBUTE_INVALID_VALUE = "attrInvalidValue";//$NON-NLS-1$
- public static final String ATTRIBUTE_DUPLICATE = "attrDuplicate";//$NON-NLS-1$
- public static final String ATTRIBUTE_VALUE_MISMATCH = "attrValueMismatch";//$NON-NLS-1$
- public static final String ATTRIBUTE_VALUE_UNCLOSED = "attrValueUnclosed";//$NON-NLS-1$
- public static final String ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND = "resourceNotFound";//$NON-NLS-1$
- public static final String ATTRIBUTE_OBSOLETE_NAME = "attrObsoleteName";//$NON-NLS-1$
- public static final String ATTRIBUTE_VALUE_EQUALS_MISSING = "attrValueEqualsMissing";//$NON-NLS-1$
-
-
- public static final String ELEM_UNKNOWN_NAME = "elemUnknownName";//$NON-NLS-1$
- public static final String ELEM_INVALID_NAME = "elemInvalidName";//$NON-NLS-1$
- public static final String ELEM_START_INVALID_CASE = "elemStartInvalidCase";//$NON-NLS-1$
- public static final String ELEM_END_INVALID_CASE = "elemEndInvalidCase";//$NON-NLS-1$
- public static final String ELEM_MISSING_START = "elemMissingStart";//$NON-NLS-1$
- public static final String ELEM_MISSING_END = "elemMissingEnd";//$NON-NLS-1$
- public static final String ELEM_UNNECESSARY_END = "elemUnnecessaryEnd";//$NON-NLS-1$
- public static final String ELEM_INVALID_DIRECTIVE = "elemInvalidDirective";//$NON-NLS-1$
- public static final String ELEM_INVALID_CONTENT = "elemInvalidContent";//$NON-NLS-1$
- public static final String ELEM_DUPLICATE = "elemDuplicate";//$NON-NLS-1$
- public static final String ELEM_COEXISTENCE = "elemCoexistence";//$NON-NLS-1$
- public static final String ELEM_UNCLOSED_START_TAG = "elemUnclosedStartTag";//$NON-NLS-1$
- public static final String ELEM_UNCLOSED_END_TAG = "elemUnclosedEndTag";//$NON-NLS-1$
- public static final String ELEM_INVALID_EMPTY_TAG = "elemInvalidEmptyTag";//$NON-NLS-1$
- public static final String ELEM_OBSOLETE_NAME = "elemObsoleteName";//$NON-NLS-1$
- public static final String ELEM_INVALID_TEXT = "elemInvalidText";//$NON-NLS-1$
-
- public static final String DOC_DUPLICATE = "docDuplicateTag";//$NON-NLS-1$
- public static final String DOC_INVALID_CONTENT = "docInvalidContent";//$NON-NLS-1$
- public static final String DOC_DOCTYPE_UNCLOSED = "docDoctypeUnclosed";//$NON-NLS-1$
-
- public static final String TEXT_INVALID_CONTENT = "docInvalidContent";//$NON-NLS-1$
- public static final String TEXT_INVALID_CHAR = "docInvalidChar";//$NON-NLS-1$
-
- public static final String COMMENT_INVALID_CONTENT = "commentInvalidContent";//$NON-NLS-1$
- public static final String COMMENT_UNCLOSED = "commentUnclosed";//$NON-NLS-1$
-
- public static final String CDATA_INVALID_CONTENT = "cdataInvalidContent";//$NON-NLS-1$
- public static final String CDATA_UNCLOSED = "cdataUnclosed";//$NON-NLS-1$
-
- public static final String PI_INVALID_CONTENT = "piInvalidContent";//$NON-NLS-1$
- public static final String PI_UNCLOSED = "piUnclosed";//$NON-NLS-1$
-
- public static final String REF_INVALID_CONTENT = "refInvalidContent";//$NON-NLS-1$
- public static final String REF_UNDEFINED = "piUndefined";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
deleted file mode 100644
index 5d1a53a703..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface HTML40Namespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = "A"; //$NON-NLS-1$
- public static final String ABBR = "ABBR"; //$NON-NLS-1$
- public static final String ACRONYM = "ACRONYM"; //$NON-NLS-1$
- public static final String ADDRESS = "ADDRESS"; //$NON-NLS-1$
- public static final String APPLET = "APPLET"; //$NON-NLS-1$
- public static final String AREA = "AREA"; //$NON-NLS-1$
- public static final String B = "B"; //$NON-NLS-1$
- public static final String BASE = "BASE"; //$NON-NLS-1$
- public static final String BASEFONT = "BASEFONT"; //$NON-NLS-1$
- public static final String BDO = "BDO"; //$NON-NLS-1$
- public static final String BGSOUND = "BGSOUND"; // D205513 //$NON-NLS-1$
- public static final String BIG = "BIG"; //$NON-NLS-1$
- public static final String BLINK = "BLINK"; //$NON-NLS-1$
- public static final String BLOCKQUOTE = "BLOCKQUOTE"; //$NON-NLS-1$
- public static final String BODY = "BODY"; //$NON-NLS-1$
- public static final String BR = "BR"; //$NON-NLS-1$
- public static final String BUTTON = "BUTTON"; //$NON-NLS-1$
- public static final String CAPTION = "CAPTION"; //$NON-NLS-1$
- public static final String CENTER = "CENTER"; //$NON-NLS-1$
- public static final String CITE = "CITE"; //$NON-NLS-1$
- public static final String CODE = "CODE"; //$NON-NLS-1$
- public static final String COL = "COL"; //$NON-NLS-1$
- public static final String COLGROUP = "COLGROUP"; //$NON-NLS-1$
- public static final String DD = "DD"; //$NON-NLS-1$
- public static final String DEL = "DEL"; //$NON-NLS-1$
- public static final String DFN = "DFN"; //$NON-NLS-1$
- public static final String DIR = "DIR"; //$NON-NLS-1$
- public static final String DIV = "DIV"; //$NON-NLS-1$
- public static final String DL = "DL"; //$NON-NLS-1$
- public static final String DT = "DT"; //$NON-NLS-1$
- public static final String EM = "EM"; //$NON-NLS-1$
- public static final String EMBED = "EMBED"; //$NON-NLS-1$
- public static final String FIELDSET = "FIELDSET"; //$NON-NLS-1$
- public static final String FONT = "FONT"; //$NON-NLS-1$
- public static final String FORM = "FORM"; //$NON-NLS-1$
- public static final String FRAME = "FRAME"; //$NON-NLS-1$
- public static final String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public static final String H1 = "H1"; //$NON-NLS-1$
- public static final String H2 = "H2"; //$NON-NLS-1$
- public static final String H3 = "H3"; //$NON-NLS-1$
- public static final String H4 = "H4"; //$NON-NLS-1$
- public static final String H5 = "H5"; //$NON-NLS-1$
- public static final String H6 = "H6"; //$NON-NLS-1$
- public static final String HEAD = "HEAD"; //$NON-NLS-1$
- public static final String HR = "HR"; //$NON-NLS-1$
- public static final String HTML = "HTML"; //$NON-NLS-1$
- public static final String I = "I"; //$NON-NLS-1$
- public static final String IFRAME = "IFRAME"; //$NON-NLS-1$
- public static final String IMG = "IMG"; //$NON-NLS-1$
- public static final String INPUT = "INPUT"; //$NON-NLS-1$
- public static final String INS = "INS"; //$NON-NLS-1$
- public static final String ISINDEX = "ISINDEX"; //$NON-NLS-1$
- public static final String KBD = "KBD"; //$NON-NLS-1$
- public static final String LABEL = "LABEL"; //$NON-NLS-1$
- public static final String LEGEND = "LEGEND"; //$NON-NLS-1$
- public static final String LI = "LI"; //$NON-NLS-1$
- public static final String LINK = "LINK"; //$NON-NLS-1$
- public static final String MAP = "MAP"; //$NON-NLS-1$
- public static final String MENU = "MENU"; //$NON-NLS-1$
- public static final String META = "META"; //$NON-NLS-1$
- public static final String NOBR = "NOBR"; // D205513 //$NON-NLS-1$
- public static final String NOEMBED = "NOEMBED"; //$NON-NLS-1$
- public static final String NOFRAMES = "NOFRAMES"; //$NON-NLS-1$
- public static final String NOSCRIPT = "NOSCRIPT"; //$NON-NLS-1$
- public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
- public static final String OL = "OL"; //$NON-NLS-1$
- public static final String OPTGROUP = "OPTGROUP"; //$NON-NLS-1$
- public static final String OPTION = "OPTION"; //$NON-NLS-1$
- public static final String P = "P"; //$NON-NLS-1$
- public static final String PARAM = "PARAM"; //$NON-NLS-1$
- public static final String PRE = "PRE"; //$NON-NLS-1$
- public static final String Q = "Q"; //$NON-NLS-1$
- public static final String S = "S"; //$NON-NLS-1$
- public static final String SAMP = "SAMP"; //$NON-NLS-1$
- public static final String SCRIPT = "SCRIPT"; //$NON-NLS-1$
- public static final String SELECT = "SELECT"; //$NON-NLS-1$
- public static final String SMALL = "SMALL"; //$NON-NLS-1$
- public static final String SPAN = "SPAN"; //$NON-NLS-1$
- public static final String STRIKE = "STRIKE"; //$NON-NLS-1$
- public static final String STRONG = "STRONG"; //$NON-NLS-1$
- public static final String STYLE = "STYLE"; //$NON-NLS-1$
- public static final String SUB = "SUB"; //$NON-NLS-1$
- public static final String SUP = "SUP"; //$NON-NLS-1$
- public static final String TABLE = "TABLE"; //$NON-NLS-1$
- public static final String TBODY = "TBODY"; //$NON-NLS-1$
- public static final String TD = "TD"; //$NON-NLS-1$
- public static final String TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
- public static final String TFOOT = "TFOOT"; //$NON-NLS-1$
- public static final String TH = "TH"; //$NON-NLS-1$
- public static final String THEAD = "THEAD"; //$NON-NLS-1$
- public static final String TITLE = "TITLE"; //$NON-NLS-1$
- public static final String TR = "TR"; //$NON-NLS-1$
- public static final String TT = "TT"; //$NON-NLS-1$
- public static final String U = "U"; //$NON-NLS-1$
- public static final String UL = "UL"; //$NON-NLS-1$
- public static final String VAR = "VAR"; //$NON-NLS-1$
- public static final String WBR = "WBR"; // D205513 //$NON-NLS-1$
- public static final String MARQUEE = "MARQUEE"; //$NON-NLS-1$
- public static final String SSI_CONFIG = "SSI:CONFIG"; // D210393 //$NON-NLS-1$
- public static final String SSI_ECHO = "SSI:ECHO"; //$NON-NLS-1$
- public static final String SSI_EXEC = "SSI:EXEC"; //$NON-NLS-1$
- public static final String SSI_FSIZE = "SSI:FSIZE"; //$NON-NLS-1$
- public static final String SSI_FLASTMOD = "SSI:FLASTMOD"; //$NON-NLS-1$
- public static final String SSI_INCLUDE = "SSI:INCLUDE"; //$NON-NLS-1$
- public static final String SSI_PRINTENV = "SSI:PRINTENV"; //$NON-NLS-1$
- public static final String SSI_SET = "SSI:SET"; //$NON-NLS-1$
- public static final String WML_WML = "wml"; //$NON-NLS-1$
- public static final String WML_CARD = "card"; //$NON-NLS-1$
- public static final String WML_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String WML_ACCESS = "access"; //$NON-NLS-1$
- public static final String WML_DO = "do"; //$NON-NLS-1$
- public static final String WML_ONEVENT = "onevent"; //$NON-NLS-1$
- public static final String WML_TIMER = "timer"; //$NON-NLS-1$
- public static final String WML_ANCHOR = "anchor"; //$NON-NLS-1$
- public static final String WML_PREV = "prev"; //$NON-NLS-1$
- public static final String WML_REFRESH = "refresh"; //$NON-NLS-1$
- public static final String WML_GO = "go"; //$NON-NLS-1$
- public static final String WML_NOOP = "noop"; //$NON-NLS-1$
- public static final String WML_SETVAR = "setvar"; //$NON-NLS-1$
- public static final String WML_POSTFIELD = "postfield"; //$NON-NLS-1$
- }
-
- // Character Entities
- public static interface EntityName {
- public static final String AACUTE_U = "Aacute"; //$NON-NLS-1$
- public static final String AACUTE_L = "aacute"; //$NON-NLS-1$
- public static final String ACIRC_U = "Acirc"; //$NON-NLS-1$
- public static final String ACIRC_L = "acirc"; //$NON-NLS-1$
- public static final String ACUTE = "acute"; //$NON-NLS-1$
- public static final String AELIG_U = "AElig"; //$NON-NLS-1$
- public static final String AELIG_L = "aelig"; //$NON-NLS-1$
- public static final String AGRAVE_U = "Agrave"; //$NON-NLS-1$
- public static final String AGRAVE_L = "agrave"; //$NON-NLS-1$
- public static final String ALEFSYM = "alefsym"; //$NON-NLS-1$
- public static final String ALPHA_U = "Alpha"; //$NON-NLS-1$
- public static final String ALPHA_L = "alpha"; //$NON-NLS-1$
- public static final String AMP = "amp"; //$NON-NLS-1$
- public static final String AND = "and"; //$NON-NLS-1$
- public static final String ANG = "ang"; //$NON-NLS-1$
- public static final String ARING_U = "Aring"; //$NON-NLS-1$
- public static final String ARING_L = "aring"; //$NON-NLS-1$
- public static final String ASYMP = "asymp"; //$NON-NLS-1$
- public static final String ATILDE_U = "Atilde"; //$NON-NLS-1$
- public static final String ATILDE_L = "atilde"; //$NON-NLS-1$
- public static final String AUML_U = "Auml"; //$NON-NLS-1$
- public static final String AUML_L = "auml"; //$NON-NLS-1$
- public static final String BDQUO = "bdquo"; //$NON-NLS-1$
- public static final String BETA_U = "Beta"; //$NON-NLS-1$
- public static final String BETA_L = "beta"; //$NON-NLS-1$
- public static final String BRVBAR = "brvbar"; //$NON-NLS-1$
- public static final String BULL = "bull"; //$NON-NLS-1$
- public static final String CAP = "cap"; //$NON-NLS-1$
- public static final String CCEDIL_U = "Ccedil"; //$NON-NLS-1$
- public static final String CCEDIL_L = "ccedil"; //$NON-NLS-1$
- public static final String CEDIL = "cedil"; //$NON-NLS-1$
- public static final String CENT = "cent"; //$NON-NLS-1$
- public static final String CHI_U = "Chi"; //$NON-NLS-1$
- public static final String CHI_L = "chi"; //$NON-NLS-1$
- public static final String CIRC = "circ"; //$NON-NLS-1$
- public static final String CLUBS = "clubs"; //$NON-NLS-1$
- public static final String CONG = "cong"; //$NON-NLS-1$
- public static final String COPY = "copy"; //$NON-NLS-1$
- public static final String CRARR = "crarr"; //$NON-NLS-1$
- public static final String CUP = "cup"; //$NON-NLS-1$
- public static final String CURREN = "curren"; //$NON-NLS-1$
- public static final String DAGGER_U = "Dagger"; //$NON-NLS-1$
- public static final String DAGGER_L = "dagger"; //$NON-NLS-1$
- public static final String DARR_U = "dArr"; //$NON-NLS-1$
- public static final String DARR_L = "darr"; //$NON-NLS-1$
- public static final String DEG = "deg"; //$NON-NLS-1$
- public static final String DELTA_U = "Delta"; //$NON-NLS-1$
- public static final String DELTA_L = "delta"; //$NON-NLS-1$
- public static final String DIAMS = "diams"; //$NON-NLS-1$
- public static final String DIVIDE = "divide"; //$NON-NLS-1$
- public static final String EACUTE_U = "Eacute"; //$NON-NLS-1$
- public static final String EACUTE_L = "eacute"; //$NON-NLS-1$
- public static final String ECIRC_U = "Ecirc"; //$NON-NLS-1$
- public static final String ECIRC_L = "ecirc"; //$NON-NLS-1$
- public static final String EGRAVE_U = "Egrave"; //$NON-NLS-1$
- public static final String EGRAVE_L = "egrave"; //$NON-NLS-1$
- public static final String EMPTY = "empty"; //$NON-NLS-1$
- public static final String EMSP = "emsp"; //$NON-NLS-1$
- public static final String ENSP = "ensp"; //$NON-NLS-1$
- public static final String EPSILON_U = "Epsilon"; //$NON-NLS-1$
- public static final String EPSILON_L = "epsilon"; //$NON-NLS-1$
- public static final String EQUIV = "equiv"; //$NON-NLS-1$
- public static final String ETA_U = "Eta"; //$NON-NLS-1$
- public static final String ETA_L = "eta"; //$NON-NLS-1$
- public static final String ETH_U = "ETH"; //$NON-NLS-1$
- public static final String ETH_L = "eth"; //$NON-NLS-1$
- public static final String EUML_U = "Euml"; //$NON-NLS-1$
- public static final String EUML_L = "euml"; //$NON-NLS-1$
- public static final String EURO = "euro"; //$NON-NLS-1$
- public static final String EXIST = "exist"; //$NON-NLS-1$
- public static final String FNOF = "fnof"; //$NON-NLS-1$
- public static final String FORALL = "forall"; //$NON-NLS-1$
- public static final String FRAC12 = "frac12"; //$NON-NLS-1$
- public static final String FRAC14 = "frac14"; //$NON-NLS-1$
- public static final String FRAC34 = "frac34"; //$NON-NLS-1$
- public static final String FRASL = "frasl"; //$NON-NLS-1$
- public static final String GAMMA_U = "Gamma"; //$NON-NLS-1$
- public static final String GAMMA_L = "gamma"; //$NON-NLS-1$
- public static final String GE = "ge"; //$NON-NLS-1$
- public static final String GT = "gt"; //$NON-NLS-1$
- public static final String HARR_U = "hArr"; //$NON-NLS-1$
- public static final String HARR_L = "harr"; //$NON-NLS-1$
- public static final String HEARTS = "hearts"; //$NON-NLS-1$
- public static final String HELLIP = "hellip"; //$NON-NLS-1$
- public static final String IACUTE_U = "Iacute"; //$NON-NLS-1$
- public static final String IACUTE_L = "iacute"; //$NON-NLS-1$
- public static final String ICIRC_U = "Icirc"; //$NON-NLS-1$
- public static final String ICIRC_L = "icirc"; //$NON-NLS-1$
- public static final String IEXCL = "iexcl"; //$NON-NLS-1$
- public static final String IGRAVE_U = "Igrave"; //$NON-NLS-1$
- public static final String IGRAVE_L = "igrave"; //$NON-NLS-1$
- public static final String IMAGE = "image"; //$NON-NLS-1$
- public static final String INFIN = "infin"; //$NON-NLS-1$
- public static final String INT = "int"; //$NON-NLS-1$
- public static final String IOTA_U = "Iota"; //$NON-NLS-1$
- public static final String IOTA_L = "iota"; //$NON-NLS-1$
- public static final String IQUEST = "iquest"; //$NON-NLS-1$
- public static final String ISIN = "isin"; //$NON-NLS-1$
- public static final String IUML_U = "Iuml"; //$NON-NLS-1$
- public static final String IUML_L = "iuml"; //$NON-NLS-1$
- public static final String KAPPA_U = "Kappa"; //$NON-NLS-1$
- public static final String KAPPA_L = "kappa"; //$NON-NLS-1$
- public static final String LAMBDA_U = "Lambda"; //$NON-NLS-1$
- public static final String LAMBDA_L = "lambda"; //$NON-NLS-1$
- public static final String LANG = "lang"; //$NON-NLS-1$
- public static final String LAQUO = "laquo"; //$NON-NLS-1$
- public static final String LARR_U = "lArr"; //$NON-NLS-1$
- public static final String LARR_L = "larr"; //$NON-NLS-1$
- public static final String LCEIL = "lceil"; //$NON-NLS-1$
- public static final String LDQUO = "ldquo"; //$NON-NLS-1$
- public static final String LE = "le"; //$NON-NLS-1$
- public static final String LFLOOR = "lfloor"; //$NON-NLS-1$
- public static final String LOWAST = "lowast"; //$NON-NLS-1$
- public static final String LOZ = "loz"; //$NON-NLS-1$
- public static final String LRM = "lrm"; //$NON-NLS-1$
- public static final String LSAQUO = "lsaquo"; //$NON-NLS-1$
- public static final String LSQUO = "lsquo"; //$NON-NLS-1$
- public static final String LT = "lt"; //$NON-NLS-1$
- public static final String MACR = "macr"; //$NON-NLS-1$
- public static final String MDASH = "mdash"; //$NON-NLS-1$
- public static final String MICRO = "micro"; //$NON-NLS-1$
- public static final String MIDDOT = "middot"; //$NON-NLS-1$
- public static final String MINUS = "minus"; //$NON-NLS-1$
- public static final String MU_U = "Mu"; //$NON-NLS-1$
- public static final String MU_L = "mu"; //$NON-NLS-1$
- public static final String NABLA = "nabla"; //$NON-NLS-1$
- public static final String NBSP = "nbsp"; //$NON-NLS-1$
- public static final String NDASH = "ndash"; //$NON-NLS-1$
- public static final String NE = "ne"; //$NON-NLS-1$
- public static final String NI = "ni"; //$NON-NLS-1$
- public static final String NOT = "not"; //$NON-NLS-1$
- public static final String NOTIN = "notin"; //$NON-NLS-1$
- public static final String NSUB = "nsub"; //$NON-NLS-1$
- public static final String NTILDE_U = "Ntilde"; //$NON-NLS-1$
- public static final String NTILDE_L = "ntilde"; //$NON-NLS-1$
- public static final String NU_U = "Nu"; //$NON-NLS-1$
- public static final String NU_L = "nu"; //$NON-NLS-1$
- public static final String OACUTE_U = "Oacute"; //$NON-NLS-1$
- public static final String OACUTE_L = "oacute"; //$NON-NLS-1$
- public static final String OCIRC_U = "Ocirc"; //$NON-NLS-1$
- public static final String OCIRC_L = "ocirc"; //$NON-NLS-1$
- public static final String OELIG_U = "OElig"; //$NON-NLS-1$
- public static final String OELIG_L = "oelig"; //$NON-NLS-1$
- public static final String OGRAVE_U = "Ograve"; //$NON-NLS-1$
- public static final String OGRAVE_L = "ograve"; //$NON-NLS-1$
- public static final String OLINE = "oline"; //$NON-NLS-1$
- public static final String OMEGA_U = "Omega"; //$NON-NLS-1$
- public static final String OMEGA_L = "omega"; //$NON-NLS-1$
- public static final String OMICRON_U = "Omicron"; //$NON-NLS-1$
- public static final String OMICRON_L = "omicron"; //$NON-NLS-1$
- public static final String OPLUS = "oplus"; //$NON-NLS-1$
- public static final String OR = "or"; //$NON-NLS-1$
- public static final String ORDF = "ordf"; //$NON-NLS-1$
- public static final String ORDM = "ordm"; //$NON-NLS-1$
- public static final String OSLASH_U = "Oslash"; //$NON-NLS-1$
- public static final String OSLASH_L = "oslash"; //$NON-NLS-1$
- public static final String OTILDE_U = "Otilde"; //$NON-NLS-1$
- public static final String OTILDE_L = "otilde"; //$NON-NLS-1$
- public static final String OTIMES = "otimes"; //$NON-NLS-1$
- public static final String OUML_U = "Ouml"; //$NON-NLS-1$
- public static final String OUML_L = "ouml"; //$NON-NLS-1$
- public static final String PARA = "para"; //$NON-NLS-1$
- public static final String PART = "part"; //$NON-NLS-1$
- public static final String PERMIL = "permil"; //$NON-NLS-1$
- public static final String PERP = "perp"; //$NON-NLS-1$
- public static final String PHI_U = "Phi"; //$NON-NLS-1$
- public static final String PHI_L = "phi"; //$NON-NLS-1$
- public static final String PI_U = "Pi"; //$NON-NLS-1$
- public static final String PI_L = "pi"; //$NON-NLS-1$
- public static final String PIV = "piv"; //$NON-NLS-1$
- public static final String PLUSMN = "plusmn"; //$NON-NLS-1$
- public static final String POUND = "pound"; //$NON-NLS-1$
- public static final String PRIME_U = "Prime"; //$NON-NLS-1$
- public static final String PRIME_L = "prime"; //$NON-NLS-1$
- public static final String PROD = "prod"; //$NON-NLS-1$
- public static final String PROP = "prop"; //$NON-NLS-1$
- public static final String PSI_U = "Psi"; //$NON-NLS-1$
- public static final String PSI_L = "psi"; //$NON-NLS-1$
- public static final String QUOT = "quot"; //$NON-NLS-1$
- public static final String RADIC = "radic"; //$NON-NLS-1$
- public static final String RANG = "rang"; //$NON-NLS-1$
- public static final String RAQUO = "raquo"; //$NON-NLS-1$
- public static final String RARR_U = "rArr"; //$NON-NLS-1$
- public static final String RARR_L = "rarr"; //$NON-NLS-1$
- public static final String RCEIL = "rceil"; //$NON-NLS-1$
- public static final String RDQUO = "rdquo"; //$NON-NLS-1$
- public static final String REAL = "real"; //$NON-NLS-1$
- public static final String REG = "reg"; //$NON-NLS-1$
- public static final String RFLOOR = "rfloor"; //$NON-NLS-1$
- public static final String RHO_U = "Rho"; //$NON-NLS-1$
- public static final String RHO_L = "rho"; //$NON-NLS-1$
- public static final String RLM = "rlm"; //$NON-NLS-1$
- public static final String RSAQUO = "rsaquo"; //$NON-NLS-1$
- public static final String RSQUO = "rsquo"; //$NON-NLS-1$
- public static final String SBQUO = "sbquo"; //$NON-NLS-1$
- public static final String SCARON_U = "Scaron"; //$NON-NLS-1$
- public static final String SCARON_L = "scaron"; //$NON-NLS-1$
- public static final String SDOT = "sdot"; //$NON-NLS-1$
- public static final String SECT = "sect"; //$NON-NLS-1$
- public static final String SHY = "shy"; //$NON-NLS-1$
- public static final String SIGMA_U = "Sigma"; //$NON-NLS-1$
- public static final String SIGMA_L = "sigma"; //$NON-NLS-1$
- public static final String SIGMAF = "sigmaf"; //$NON-NLS-1$
- public static final String SIM = "sim"; //$NON-NLS-1$
- public static final String SPADES = "spades"; //$NON-NLS-1$
- public static final String SUB = "sub"; //$NON-NLS-1$
- public static final String SUBE = "sube"; //$NON-NLS-1$
- public static final String SUM = "sum"; //$NON-NLS-1$
- public static final String SUP = "sup"; //$NON-NLS-1$
- public static final String SUP1 = "sup1"; //$NON-NLS-1$
- public static final String SUP2 = "sup2"; //$NON-NLS-1$
- public static final String SUP3 = "sup3"; //$NON-NLS-1$
- public static final String SUPE = "supe"; //$NON-NLS-1$
- public static final String SZLIG = "szlig"; //$NON-NLS-1$
- public static final String TAU_U = "Tau"; //$NON-NLS-1$
- public static final String TAU_L = "tau"; //$NON-NLS-1$
- public static final String THERE4 = "there4"; //$NON-NLS-1$
- public static final String THETA_U = "Theta"; //$NON-NLS-1$
- public static final String THETA_L = "theta"; //$NON-NLS-1$
- public static final String THETASYM = "thetasym"; //$NON-NLS-1$
- public static final String THINSP = "thinsp"; //$NON-NLS-1$
- public static final String THORN_U = "THORN"; //$NON-NLS-1$
- public static final String THORN_L = "thorn"; //$NON-NLS-1$
- public static final String TILDE = "tilde"; //$NON-NLS-1$
- public static final String TIMES = "times"; //$NON-NLS-1$
- public static final String TRADE = "trade"; //$NON-NLS-1$
- public static final String UACUTE_U = "Uacute"; //$NON-NLS-1$
- public static final String UACUTE_L = "uacute"; //$NON-NLS-1$
- public static final String UARR_U = "uArr"; //$NON-NLS-1$
- public static final String UARR_L = "uarr"; //$NON-NLS-1$
- public static final String UCIRC_U = "Ucirc"; //$NON-NLS-1$
- public static final String UCIRC_L = "ucirc"; //$NON-NLS-1$
- public static final String UGRAVE_U = "Ugrave"; //$NON-NLS-1$
- public static final String UGRAVE_L = "ugrave"; //$NON-NLS-1$
- public static final String UML = "uml"; //$NON-NLS-1$
- public static final String UPSIH = "upsih"; //$NON-NLS-1$
- public static final String UPSILON_U = "Upsilon"; //$NON-NLS-1$
- public static final String UPSILON_L = "upsilon"; //$NON-NLS-1$
- public static final String UUML_U = "Uuml"; //$NON-NLS-1$
- public static final String UUML_L = "uuml"; //$NON-NLS-1$
- public static final String WEIERP = "weierp"; //$NON-NLS-1$
- public static final String XI_U = "Xi"; //$NON-NLS-1$
- public static final String XI_L = "xi"; //$NON-NLS-1$
- public static final String YACUTE_U = "Yacute"; //$NON-NLS-1$
- public static final String YACUTE_L = "yacute"; //$NON-NLS-1$
- public static final String YEN = "yen"; //$NON-NLS-1$
- public static final String YUML_U = "Yuml"; //$NON-NLS-1$
- public static final String YUML_L = "yuml"; //$NON-NLS-1$
- public static final String ZETA_U = "Zeta"; //$NON-NLS-1$
- public static final String ZETA_L = "zeta"; //$NON-NLS-1$
- public static final String ZWJ = "zwj"; //$NON-NLS-1$
- public static final String ZWNJ = "zwnj"; //$NON-NLS-1$
- }
-
- public static final String HTML40_URI = "http://www.w3.org/TR/REC-html40/frameset.dtd"; //$NON-NLS-1$
- public static final String HTML40_TAG_PREFIX = ""; //$NON-NLS-1$
- // global attribute names
- public static final String ATTR_NAME_ID = "id"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_STYLE = "style"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_TITLE = "title"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_LANG = "lang"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_DIR = "dir"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_ONCLICK = "onclick"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONDBLCLICK = "ondblclick"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEDOWN = "onmousedown"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEUP = "onmouseup"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOVER = "onmouseover"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEMOVE = "onmousemove"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOUT = "onmouseout"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYPRESS = "onkeypress"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYDOWN = "onkeydown"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYUP = "onkeyup"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONHELP = "onhelp"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_BGCOLOR = "bgcolor"; // %bodycolor;, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_TEXT = "text"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_LINK = "link"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_VLINK = "vlink"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_ALINK = "alink"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; // HTML //$NON-NLS-1$
- public static final String ATTR_NAME_PROFILE = "profile"; // HEAD //$NON-NLS-1$
- public static final String ATTR_NAME_ONLOAD = "onload"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_ONUNLOAD = "onunload"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BACKGROUND = "background"; // BODY, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_SRC = "src"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALT = "alt"; // IMG,AREA //$NON-NLS-1$
- public static final String ATTR_NAME_LONGDESC = "longdesc"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_NAME = "name"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; // IMG, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; // IMG, TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_USEMAP = "usemap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ISMAP = "ismap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; // IMG, TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_BORDER = "border"; // IMG, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_MAPFILE = "mapfile"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_SUMMARY = "summary"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_FRAME = "frame"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_RULES = "rules"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_CELLSPACING = "cellspacing"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_CELLPADDING = "cellpadding"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_DATAPAGESIZE = "datapagesize"; // TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_COLOR = "color"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_FACE = "face"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_SIZE = "size"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_CLEAR = "clear"; // BR //$NON-NLS-1$
- public static final String ATTR_NAME_SHAPE = "shape"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_COORDS = "coords"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_HREF = "href"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TARGET = "target"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_NOHREF = "nohref"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TABINDEX = "tabindex"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ACCESSKEY = "accesskey"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ONFOCUS = "onfocus"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ONBLUR = "onblur"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_CHARSET = "charset"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_HREFLANG = "hreflang"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REL = "rel"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REV = "rev"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_MEDIA = "media"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; // PARAM //$NON-NLS-1$
- public static final String ATTR_NAME_VALUETYPE = "valuetype"; // PARAM //$NON-NLS-1$
- public static final String ATTR_NAME_NOSHADE = "noshade"; // HR //$NON-NLS-1$
- public static final String ATTR_NAME_CHECKED = "checked"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_DISABLED = "disabled"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_READONLY = "readonly"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_MAXLENGTH = "maxlength"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ONSELECT = "onselect"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ONCHANGE = "onchange"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT = "accept"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ISTYLE = "istyle"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_CHAR = "char"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_CHAROFF = "charoff"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_VALIGN = "valign"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_SPAN = "span"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_FRAMEBORDER = "frameborder"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINWIDTH = "marginwidth"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINHEIGHT = "marginheight"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_NORESIZE = "noresize"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLING = "scrolling"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_PROMPT = "prompt"; // ISINDEX //$NON-NLS-1$
- public static final String ATTR_NAME_HTTP_EQUIV = "http-equiv"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT = "content"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_SCHEME = "scheme"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_ERRMSG = "errmsg"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_SIZEFMT = "sizefmt"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_TIMEFMT = "timefmt"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_VAR = "var"; // ssi:echo //$NON-NLS-1$
- public static final String ATTR_NAME_CGI = "cgi"; // ssi:exec //$NON-NLS-1$
- public static final String ATTR_NAME_CMD = "cmd"; // ssi:exec //$NON-NLS-1$
- public static final String ATTR_NAME_FILE = "file"; // ssi:fsize //$NON-NLS-1$
- public static final String ATTR_NAME_VIRTUAL = "virtual"; // ssi:fsize //$NON-NLS-1$
- public static final String ATTR_NAME_SELECTED = "selected"; // OPTION //$NON-NLS-1$
- public static final String ATTR_NAME_LABEL = "label"; // OPTION //$NON-NLS-1$
- public static final String ATTR_NAME_ROWS = "rows"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_NAME_COLS = "cols"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_NAME_LANGUAGE = "language"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_DEFER = "defer"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_EVENT = "event"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_FOR = "for"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_COMPACT = "compact"; // OL/UL //$NON-NLS-1$
- public static final String ATTR_NAME_START = "start"; // OL/UL //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTKEY = "directkey"; // A //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_CODE = "code"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_OBJECT = "object"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_MAYSCRIPT = "mayscript"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_CITE = "cite"; // BLOCKQUOTE //$NON-NLS-1$
- public static final String ATTR_NAME_MACRO = "macro"; // D2W //$NON-NLS-1$
- public static final String ATTR_NAME_DATETIME = "datetime"; // INS/DEL //$NON-NLS-1$
- public static final String ATTR_NAME_LOOP = "loop"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_HIDDEN = "hidden"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_VOLUME = "volume"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSTART = "autostart"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOPLAY = "autoplay"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSIZE = "autosize"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_CONTROLLER = "controller";// EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_SCALE = "scale"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_SHOWCONTROLS = "showcontrols";// EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PLAYCOUNT = "playcount"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_REPEAT = "repeat"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PANEL = "panel"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PALETTE = "palette"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_TEXTFOCUS = "textfocus"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_ACTION = "action"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_METHOD = "method"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ENCTYPE = "enctype"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ONSUBMIT = "onsubmit"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ONRESET = "onreset"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT_CHARSET = "accept-charset";// FORM //$NON-NLS-1$
- public static final String ATTR_NAME_BEHAVIOR = "behavior"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTION = "direction"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLAMOUNT = "scrollamount";// MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLDELAY = "scrolldelay";// MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_TRUESPEED = "truespeed"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_DECLARE = "declare"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_CLASSID = "classid"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_DATA = "data"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_CODETYPE = "codetype"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_STANDBY = "standby"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_MULTIPLE = "multiple"; // SELECT //$NON-NLS-1$
- public static final String ATTR_NAME_ABBR = "abbr"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_AXIS = "axis"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_HEADERS = "headers"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_ROWSPAN = "rowspan"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_COLSPAN = "colspan"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_NOWRAP = "nowrap"; // TH/TD //$NON-NLS-1$
- // <<D205514
- public static final String ATTR_NAME_TOPMARGIN = "topmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BOTTOMMARGIN = "bottommargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_LEFTMARGIN = "leftmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_RIGHTMARGIN = "rightmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BORDERCOLOR = "bordercolor"; // TABLE/TR/TH/TD/FRAMESET/FRAME //$NON-NLS-1$
- // for WML
- public static final String WML_ATTR_NAME_TITLE = "title"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_DOMAIN = "domain"; // access //$NON-NLS-1$
- public static final String WML_ATTR_NAME_PATH = "path"; // access //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERFORWARD = "onenterforward"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERBACKWARD = "onenterbackward"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONPICK = "onpick"; // option //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONTIMER = "ontimer"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_NEWCONTEXT = "newcontext"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ORDERED = "ordered"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_OPTIONAL = "optional"; // do //$NON-NLS-1$
- public static final String WML_ATTR_NAME_CACHE_CONTROL = "cache-control"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_SENDREFERER = "sendreferer"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_METHOD = "method"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ENCTYPE = "enctype"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ACCEPT_CHARSET = "accept-charset"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_COLUMNS = "columns"; // table //$NON-NLS-1$
- // D205514
- //<<D215684
- public static final String ATTR_NAME_FRAMESPACING = "framespacing"; // FRAMESET //$NON-NLS-1$
- //D215684
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD HTML 4.01 Transitional//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_VERSION_FRAMESET = "-//W3C//DTD HTML 4.01 Frameset//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LTR = "ltr"; // dir //$NON-NLS-1$
- public static final String ATTR_VALUE_RTL = "rtl"; // dir //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = "top"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_CENTER = "center"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_JUSTIFY = "justify"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_CHAR = "char"; // align //$NON-NLS-1$
- // for valign (baseline)
- public static final String ATTR_VALUE_BASELINE = "baseline"; // valign //$NON-NLS-1$
- // for clear (left|all|right|none): left and right are already defined above.
- public static final String ATTR_VALUE_ALL = "all"; // clear //$NON-NLS-1$
- public static final String ATTR_VALUE_NONE = "none"; // clear //$NON-NLS-1$
- // for shape (rect|circle|poly|default)
- public static final String ATTR_VALUE_RECT = "rect"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_CIRCLE = "circle"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_POLY = "poly"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_DEFAULT = "default"; // shape //$NON-NLS-1$
- // for valuetype (data|ref|object)
- public static final String ATTR_VALUE_DATA = "data"; // valuetype //$NON-NLS-1$
- public static final String ATTR_VALUE_REF = "ref"; // valuetype //$NON-NLS-1$
- public static final String ATTR_VALUE_OBJECT = "object"; // valuetype //$NON-NLS-1$
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = "text"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_PASSWORD = "password"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_CHECKBOX = "checkbox"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_RADIO = "radio"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_SUBMIT = "submit"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_RESET = "reset"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_FILE = "file"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_HIDDEN = "hidden"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_IMAGE = "image"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_BUTTON = "button"; // INPUT:type //$NON-NLS-1$
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = "1"; // span //$NON-NLS-1$
- // for frameborder
- public static final String ATTR_VALUE_0 = "0"; // FRAME //$NON-NLS-1$
- // for scrolling
- public static final String ATTR_VALUE_YES = "yes"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_NO = "no"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_AUTO = "auto"; // FRAME //$NON-NLS-1$
- // for UL
- public static final String ATTR_VALUE_DISC = "disc"; // UL:type //$NON-NLS-1$
- public static final String ATTR_VALUE_SQUARE = "square"; // UL:type //$NON-NLS-1$
- // for frame of TABLE
- public static final String ATTR_VALUE_VOID = "void"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_ABOVE = "above"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BELOW = "below"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_HSIDES = "hsides"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_LHS = "lhs"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_RHS = "rhs"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_VSIDES = "vsides"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BOX = "box"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BORDER = "border"; // TABLE:frame //$NON-NLS-1$
- // for rules of TABLE
- public static final String ATTR_VALUE_GROUPS = "groups"; // TABLE:rules //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWS = "rows"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_VALUE_COLS = "cols"; // TEXTAREA //$NON-NLS-1$
- // for method of FORM
- public static final String ATTR_VALUE_GET = "get"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_POST = "post"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
- // for scope of (TH | TD)
- public static final String ATTR_VALUE_ROW = "row"; // (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_COL = "col"; // (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWGROUP = "rowgroup";// (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_COLGROUP = "colgroup";// (TH|TD):scope //$NON-NLS-1$
- // for auto?? of EMBED
- public static final String ATTR_VALUE_TRUE = "true"; // EMBED //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; // EMBED //$NON-NLS-1$
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = "scroll"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_SLIDE = "slide"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_ALTERNATE = "alternate"; // MARQUEE //$NON-NLS-1$
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = "up"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_DOWN = "down"; // MARQUEE //$NON-NLS-1$
- // for type of LI (D19924)
- public static final String ATTR_VALUE_NUMBER = "1"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ALPHA = "a"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_UPPER_ALPHA = "A"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ROMAN = "i"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_UPPER_ROMAN = "I"; // LI //$NON-NLS-1$
- // for loop of BGSOUND (D205513)
- public static final String ATTR_VALUE_INFINITE = "infinite"; // BGSOUND //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
deleted file mode 100644
index e20fdacabd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-public interface HTML50Namespace extends HTML40Namespace {
-
- public static interface ElementName extends HTML40Namespace.ElementName {
- String ARTICLE = "article"; //$NON-NLS-1$
- String ASIDE = "aside"; //$NON-NLS-1$
- String AUDIO = "audio";
- String CANVAS = "canvas";
- String COMMAND = "command";
- String DATALIST = "datalist";
- String DETAILS = "details";
- String FIGURE = "figure"; //$NON-NLS-1$
- String FIGCAPTION = "figcaption"; //$NON-NLS-1$
- String FOOTER = "footer"; //$NON-NLS-1$
- String HEADER = "header";
- String HGROUP = "hgroup";
- String KEYGEN = "keygen";
- String MARK = "mark";
- String MATH = "math";
- String METER = "meter";
- String NAV = "nav";
- String OUTPUT = "output";
- String PROGRESS = "progress";
- String RP = "rp";
- String RT = "rt";
- String RUBY = "ruby";
- String SECTION = "section"; //$NON-NLS-1$
- String SOURCE = "source";
- String SUMMARY = "summary";
- String SVG = "svg";
- String TIME = "time";
- String VIDEO = "video";
- }
-
- String HTML50_URI = "http://www.w3.org/TR/html50/";
- String HTML50_TAG_PREFIX = "";
-
- // global attribute names
- String ATTR_NAME_CONTENT_EDITABLE = "contenteditable"; // %coreattrs; //$NON-NLS-1$
- String ATTR_NAME_CONTEXT_MENU = "contextmenu"; // %coreattrs; //$NON-NLS-1$
- String ATTR_NAME_DRAGGABLE = "draggable"; // %coreattrs; //$NON-NLS-1$
- String ATTR_NAME_ROLE = "role"; // %coreattrs; //$NON_NLS-1$
- String ATTR_NAME_SPELLCHECK = "spellcheck"; // %coreattrs; //$NON-NLS-1$
- String ATTR_NAME_ONABORT = "onabort"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONCAN_PLAY = "oncanplay"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONCAN_PLAY_THROUGH = "oncanplaythrough"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONCONTEXT_MENU = "oncontextmenu"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG = "ondrag"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG_END = "ondragend"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG_OVER = "ondragover"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG_ENTER = "ondragenter"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG_LEAVE = "ondragleave"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDRAG_START = "ondragstart"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDROP = "ondrop"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONDURATION_CHANGE = "ondurationchange"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONEMPTIED = "onemptied"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONENDED = "onended"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONERROR = "onerror"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONFORM_CHANGE = "onformchange"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONFORM_INPUT = "onforminput"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONINPUT = "oninput"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONINVALID = "oninvalid"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONLOADED_DATA = "onloadeddata"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONLOADED_METADATA = "onloadedmetadeta"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONLOAD_START = "onloadstart"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONMOUSE_WHEEL = "onmousewheel"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONPAUSE = "onpause"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONPLAY = "onplay"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONPLAYING = "onplaying"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONPROGRESS = "onprogress"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONRATE_CHANGE = "onratechange"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONREADY_STATE_CHANGE = "onreadystatechange"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSCROLL = "onscroll"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSEEKED = "onseeked"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSEEKING = "onseeking"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSHOW = "onshow"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSTALLED = "onstalled"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONSUSPEND = "onsuspend"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONTIME_UPDATE = "ontimeupdate"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONVOLUME_UPDATE = "onvolumeupdate"; // %event; //$NON-NLS-1$
- String ATTR_NAME_ONWAITING = "onwaiting"; // %event; //$NON-NLS-1$
-
- String ATTR_NAME_PING = "ping";
- String ATTR_NAME_AUTOFOCUS = "autofocus";
- String ATTR_NAME_CHALLENGE = "challenge";
- String ATTR_NAME_FORM = "form";
- String ATTR_NAME_KEYTYPE = "keytype";
- String ATTR_NAME_REQUIRED = "required";
- String ATTR_NAME_AUTOCOMPLETE = "autocomplete"; // input
- String ATTR_NAME_MIN = "min"; // input
- String ATTR_NAME_MAX = "max"; // input
- String ATTR_NAME_PATTERN = "pattern"; // input
- String ATTR_NAME_STEP = "step"; // input
- String ATTR_NAME_NOVALIDATE = "novalidate"; // form
- String ATTR_NAME_FORMACTION = "formaction"; // input|button
- String ATTR_NAME_FORMENCTYPE = "formenctype"; // input|button
- String ATTR_NAME_FORMMETHOD = "formmethod"; // input|button
- String ATTR_NAME_FORMNOVALIDATE = "formnovalidate"; // input|button
- String ATTR_NAME_FORMTARGET = "formtarget"; // input|button
- String ATTR_NAME_SCOPED = "scoped"; // style
- String ATTR_NAME_ASYNC = "async"; // script
- String ATTR_NAME_MANIFEST = "manifest"; // html
- String ATTR_NAME_SIZES = "sizes"; // link
- String ATTR_NAME_REVERSED = "reversed"; // ol
- String ATTR_NAME_SANDBOX = "sandbox"; // iframe
- String ATTR_NAME_SEAMLESS = "seamless"; // iframe
- String ATTR_NAME_SRCDOC = "srcdoc"; // iframe
- String ATTR_NAME_PRELOAD = "preload"; // %mediaElement; //$NON-NLS-1$
- String ATTR_NAME_AUTOPLAY = "autoplay"; // %mediaElement; //$NON-NLS-1$
- String ATTR_NAME_LOOP = "loop"; // %mediaElement; //$NON-NLS-1$
- String ATTR_NAME_CONTROLS = "controls"; // %mediaElement; //$NON-NLS-1$
- String ATTR_NAME_POSTER = "poster"; // %video; //$NON-NLS-1$
- String ATTR_NAME_OPEN = "open"; // details //$NON-NLS-1$
- String ATTR_NAME_PUBDATE = "pubdate"; //time //$NON-NLS-1$
- String ATTR_NAME_LOW = "low"; //meter //$NON-NLS-1$
- String ATTR_NAME_HIGH = "high"; //meter //$NON-NLS-1$
- String ATTR_NAME_OPTIMUM = "optimum"; //meter //$NON-NLS-1$
- String ATTR_NAME_ICON = "icon"; //command //$NON-NLS-1$
- String ATTR_NAME_RADIOGROUP = "radiogroup"; //command //$NON-NLS-1$
- String ATTR_NAME_LIST = "list"; //input //$NON-NLS-1$
- String ATTR_NAME_PLACEHOLDER = "placeholder"; //input //$NON-NLS-1$
- String ATTR_NAME_WRAP = "wrap"; //textarea //$NON-NLS-1$
- String ATTR_NAME_XMLNS = "xmlns"; //html //$NON-NLS-1$
-
- // Global attributes properties
-
- // for contenteditable (EMPTY|TRUE|FALSE|INHERIT)
- String ATTR_VALUE_EMPTY = ""; // contenteditable //$NON-NLS-1$
- String ATTR_VALUE_INHERIT = "inherit"; // contenteditable //$NON-NLS-1$
-
- // for MediaElement (Audio/Video)
- String ATTR_VALUE_METADATA = "metadata"; // mediaelement //$NON-NLS-1$
-
- // for Command
- String ATTR_VALUE_COMMAND = "command"; //command //$NON-NLS-1$
-
- //Input type
- String ATTR_VALUE_SEARCH = "search"; //input type //$NON-NLS-1$
- String ATTR_VALUE_TEL = "tel"; //input type //$NON-NLS-1$
- String ATTR_VALUE_URL = "url"; //input type //$NON-NLS-1$
- String ATTR_VALUE_EMAIL = "email"; //input type //$NON-NLS-1$
- String ATTR_VALUE_DATE = "date"; //input type //$NON-NLS-1$
- String ATTR_VALUE_DATETIME = "datetime"; //input type //$NON-NLS-1$
- String ATTR_VALUE_MONTH = "month"; //input type //$NON-NLS-1$
- String ATTR_VALUE_WEEK = "week"; //input type //$NON-NLS-1$
- String ATTR_VALUE_TIME = "time"; //input type //$NON-NLS-1$
- String ATTR_VALUE_DATETIME_LOCAL = "datetime-local"; //input type //$NON-NLS-1$
- String ATTR_VALUE_RANGE = "range"; //input type //$NON-NLS-1$
- String ATTR_VALUE_COLOR = "color"; //input type //$NON-NLS-1$
- String ATTR_VALUE_NUMBER_STRING = "number"; //input type //$NON-NLS-1$
-
- String ATTR_VALUE_ON = "on"; //input autocomplete //$NON-NLS-1$
- String ATTR_VALUE_OFF = "off"; //input autocomplete //$NON-NLS-1$
-
- String ATTR_VALUE_PUT = "PUT"; //input formmethod //$NON-NLS-1$
- String ATTR_VALUE_DELETE = "DELETE"; //input formmethod //$NON-NLS-1$
-
- String ATTR_VALUE_FORM_DATA = "multipart/form-data"; //input formencType //$NON-NLS-1$
- String ATTR_VALUE_PLAIN = "text/plain"; //input formencType //$NON-NLS-1$
-
- String ATTR_VALUE_SOFT = "soft"; //textarea wrap //$NON-NLS-1$
- String ATTR_VALUE_HARD = "hard"; //textarea wrap //$NON-NLS-1$
-
-
- String ATTR_VALUE_CONTEXT = "context"; //menu type //$NON-NLS-1$
- String ATTR_VALUE_TOOLBAR = "toolbar"; //menu type //$NON-NLS-1$
- String ATTR_VALUE_LIST = "list"; //menu type //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
deleted file mode 100644
index 8098721876..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.provisional;
-
-
-/**
- * HTMLCMProperties defines all property names and pre-defined values in HTML CM.
- * All of those properties can be retreived from element declarations of HTML CM
- * via CMNode#getProperty(String propName).
- */
-public interface HTMLCMProperties {
-
- /**
- * "shouldIgnoreCase" returns java.lang.Boolean object.
- */
- public static final String SHOULD_IGNORE_CASE = "shouldIgnoreCase";//$NON-NLS-1$
- /**
- * "shouldKeepSpace" returns java.lang.Boolean object.
- */
- public static final String SHOULD_KEEP_SPACE = "shouldKeepSpace";//$NON-NLS-1$
- /**
- * "indentChildSource" returns java.lang.Boolean object.
- */
- public static final String SHOULD_INDENT_CHILD_SOURCE = "shouldIndentChildSource";//$NON-NLS-1$
- /**
- * "terminators" returns java.util.Iterator (an array of String objects).
- */
- public static final String TERMINATORS = "terminators";//$NON-NLS-1$
- /**
- * "contentHint" returns CMElementDeclaration instnace.
- */
- public static final String CONTENT_HINT = "contentHint";//$NON-NLS-1$
- /**
- * "prohibitedAncestors" returns org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap.
- */
- public static final String PROHIBITED_ANCESTORS = "prohibitedAncestors";//$NON-NLS-1$
- /**
- * "isJSP" returns java.lang.Boolean object.
- */
- public static final String IS_JSP = "isJSP";//$NON-NLS-1$
- /**
- * "isXHTML" returns java.lang.Boolean object.
- */
- public static final String IS_XHTML = "isXHTML";//$NON-NLS-1$
- /**
- * "isSSI" returns java.lang.Boolean object.
- */
- public static final String IS_SSI = "isSSI";//$NON-NLS-1$
- /**
- * "lineBreakHint" returns String (one of pre-defined values in Values).
- */
- public static final String LINE_BREAK_HINT = "lineBreakHint";//$NON-NLS-1$
- /**
- * "layoutType" returns String (one of pre-defined values in Values).
- */
- public static final String LAYOUT_TYPE = "layoutType";//$NON-NLS-1$
- /**
- * "tagInfo" returns String (documentation for this element).
- */
- public static final String TAGINFO = "tagInfo";//$NON-NLS-1$
- /**
- * "omitType" returns String (one of pre-defined values in Values).
- */
- public static final String OMIT_TYPE = "omitType";//$NON-NLS-1$
- /**
- * "inclusion" returns org.eclipse.wst.xml.core.internal.contentmodel.CMContent.
- */
- public static final String INCLUSION = "inclusion";//$NON-NLS-1$
- /**
- * "isScriptable" returns java.lang.Boolean object.
- */
- public static final String IS_SCRIPTABLE = "isScriptable"; //$NON-NLS-1$
- /**
- * "isObsolete" returns java.lang.Boolean object.
- */
- public static final String IS_OBSOLETE = "isObsolete";//$NON-NLS-1$
-
-
- public static interface Values {
- /*
- * for LINE_BREAK_HINT = "lineBreakHint".
- */
- public static final String BREAK_NONE = "breakNone";//$NON-NLS-1$
- public static final String BREAK_AFTER_START = "breakAfterStart";//$NON-NLS-1$
- public static final String BREAK_BEFORE_START_AND_AFTER_END = "breakBeforeStartAndAfterEnd";//$NON-NLS-1$
- /*
- * for LAYOUT_TYPE = "layoutType"
- */
- public static final String LAYOUT_BLOCK = "layoutBlock";//$NON-NLS-1$
- /** BR */
- public static final String LAYOUT_BREAK = "layoutBreak";//$NON-NLS-1$
- /** Hidden object; like HTML or HEAD */
- public static final String LAYOUT_HIDDEN = "layoutHidden";//$NON-NLS-1$
- public static final String LAYOUT_NONE = "layoutNone";//$NON-NLS-1$
- /** No wrap object; like IMG, APPLET,... */
- public static final String LAYOUT_OBJECT = "layoutObject";//$NON-NLS-1$
- public static final String LAYOUT_WRAP = "layoutWrap";//$NON-NLS-1$
- /*
- * for OMIT_TYPE = "omitType"
- */
- /** Not ommisible. */
- public static final String OMIT_NONE = "omitNone";//$NON-NLS-1$
- /** Both tags are ommisible. */
- public static final String OMIT_BOTH = "omitBoth";//$NON-NLS-1$
- /** The end tag is ommisible. */
- public static final String OMIT_END = "omitEnd";//$NON-NLS-1$
- /** The end tag is ommitted when created. */
- public static final String OMIT_END_DEFAULT = "omitEndDefault";//$NON-NLS-1$
- /** The end tag must be omitted. */
- public static final String OMIT_END_MUST = "omitEndMust";//$NON-NLS-1$
-
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java
deleted file mode 100644
index 88bb2eab16..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @deprecated not used in WTP
- */
-public interface HTMLFilesPreferenceNames {
-
- static final String DEFAULT_SUFFIX = "defaultSuffix";//$NON-NLS-1$
- static final String HTML_SUFFIX = "html";//$NON-NLS-1$
- static final String GENERATE_DOCUMENT_TYPE = "generateDocumentType";//$NON-NLS-1$
- static final String GENERATE_GENERATOR = "generateGenerator";//$NON-NLS-1$
- // added this as a potential way to handle changing
- // product names "up" the stack. Note, not declared final
- // to avoid getting 'inlined' by compiler.
- static IProduct product = Platform.getProduct();
- // Platform.getProduct() is spec'd so it might return null.
- // Its expected for any final product it would not be, so we'll return
- // "WTP" for development/interim builds. No need to translate.
- static String GENERATOR = (product == null) ? "WTP": product.getName(); //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java
deleted file mode 100644
index db3217e206..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public interface HTMLFormatContraints extends IStructuredFormatContraints {
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- int getAvailableLineWidth();
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- void setAvailableLineWidth(int availableLineWidth);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java
deleted file mode 100644
index 5d1018a9f3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-
-public interface PreferenceNames {
-
- String TRUE = "true"; //$NON-NLS-1$
- String FALSE = "false"; //$NON-NLS-1$
- String YES = "yes"; //$NON-NLS-1$
- String NO = "no"; //$NON-NLS-1$
-
-
- String SETTINGS = "settings"; //$NON-NLS-1$
-
- String TREEVIEW = "treeview"; //$NON-NLS-1$
- String DEFAULT_DEPTH = "defaultdepth"; //$NON-NLS-1$
-
- String ASIS = "as-is"; //$NON-NLS-1$
- String LOWER = "lower"; //$NON-NLS-1$
- String UPPER = "upper"; //$NON-NLS-1$
-
- String PREFERRED_CASE = "preferred-case"; //$NON-NLS-1$
- String TAGNAME = "tagname"; //$NON-NLS-1$
- String ATTRIBUTENAME = "attributename"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java
deleted file mode 100644
index 35f17ff6a6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.core.internal.provisional.contenttype;
-
-/**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially set with default protected
- * method so it will not be inlined.
- */
-
-public class ContentTypeFamilyForHTML {
- /**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially not declared as final,
- * so it will not be inlined.
- */
- public final static String HTML_FAMILY = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeFamilyForHTML() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.html.core.contentfamily.html"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java
deleted file mode 100644
index 66491193e8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.core.internal.provisional.contenttype;
-
-/**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially set with default protected
- * method so it will not be inlined.
- */
-
-public class ContentTypeIdForHTML {
- /**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially not declared as final,
- * so it will not be inlined.
- */
- public final static String ContentTypeID_HTML = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeIdForHTML() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
deleted file mode 100644
index 50f61db6b1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- *
- * @deprecated use org.eclipse.wst.html.core.text.IHTMLPartitions
- */
-public interface IHTMLPartitionTypes {
-
- String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
- String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
- String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
- String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
- String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
- // ISSUE: I think meta tag areas are here too?
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
deleted file mode 100644
index 08c61ee3eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.text;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
-import org.eclipse.wst.sse.core.internal.util.ScriptLanguageKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-
-/**
- * Document partitioner for HTML. Client-side scripts of type JavaScript are
- * reported as ST_SCRIPT, all others for <script language="foo" type="foo2">
- * as SCRIPT.language:FOO and SCRIPT.type:FOO2.
- */
-public class StructuredTextPartitionerForHTML extends StructuredTextPartitionerForXML implements IStructuredTextPartitioner {
-
- private final static String[] configuredContentTypes = new String[]{IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.HTML_DECLARATION, IHTMLPartitions.HTML_COMMENT, IHTMLPartitions.SCRIPT, ICSSPartitions.STYLE,IHTMLPartitions.SCRIPT_EVENTHANDLER};
-
- public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
- public static final String JAVASCRIPT_APPLICATION = "application/x-javascript"; //$NON-NLS-1$
-
- private static final String[] EVENT_ATTRIBUTE_NAMES =
- {HTML40Namespace.ATTR_NAME_ONCLICK,
- HTML40Namespace.ATTR_NAME_ONDBLCLICK,
- HTML40Namespace.ATTR_NAME_ONMOUSEDOWN,
- HTML40Namespace.ATTR_NAME_ONMOUSEUP,
- HTML40Namespace.ATTR_NAME_ONMOUSEOVER,
- HTML40Namespace.ATTR_NAME_ONMOUSEMOVE,
- HTML40Namespace.ATTR_NAME_ONMOUSEOUT,
- HTML40Namespace.ATTR_NAME_ONKEYPRESS,
- HTML40Namespace.ATTR_NAME_ONKEYDOWN,
- HTML40Namespace.ATTR_NAME_ONKEYUP,
- HTML40Namespace.ATTR_NAME_ONHELP,
- HTML40Namespace.ATTR_NAME_ONBLUR,
- HTML40Namespace.ATTR_NAME_ONFOCUS,
- HTML40Namespace.ATTR_NAME_ONLOAD,
- HTML40Namespace.ATTR_NAME_ONUNLOAD,
- HTML40Namespace.ATTR_NAME_ONSUBMIT};
-
- /** array of style attribute names */
- private static final String[] STYLE_ATTRIBUTE_NAMES = {HTML40Namespace.ATTR_NAME_STYLE};
-
- public StructuredTextPartitionerForHTML() {
- super();
- }
-
- public IStructuredTypedRegion createPartition(int offset, int length, String type) {
- if (type == IHTMLPartitions.SCRIPT) {
- IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (node != null) {
- String stype = getScriptingPartitionType(node);
- return super.createPartition(offset, length, stype);
- }
- }
- return super.createPartition(offset, length, type);
- }
-
- protected void setInternalPartition(int offset, int length, String type) {
- String localType = type;
- if (type == IHTMLPartitions.SCRIPT) {
- IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (node != null) {
- localType = getScriptingPartitionType(node);
- }
- }
- super.setInternalPartition(offset, length, localType);
- }
-
- private String getScriptingPartitionType(IStructuredDocumentRegion coreNode) {
- String language = null;
- String type = null;
- String result = IHTMLPartitions.SCRIPT;
- IStructuredDocumentRegion node = coreNode;
- ITextRegion attrNameRegion = null;
- while (node != null && isValidScriptingRegionType(node.getType())) {
- node = node.getPrevious();
- }
-
- ITextRegionList regions = node.getRegions();
- if (regions.size() > 4 && regions.get(1).getType() == DOMRegionContext.XML_TAG_NAME) {
- ITextRegion potentialLanguageRegion = regions.get(1);
- String potentialLanguageString = node.getText(potentialLanguageRegion);
- if (potentialLanguageString.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- attrNameRegion = region;
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- String attrName = node.getText(attrNameRegion);
- if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_LANGUAGE))
- language = StringUtils.strip(node.getText(region));
- else if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_TYPE)) {
- type = StringUtils.strip(node.getText(region));
- /*
- * Avoid partition names built with MIME subtypes,
- * e.g. type="text/javascript;e4x=1"
- */
- if (type != null) {
- int index = type.indexOf(';');
- if (index > 1)
- type = type.substring(0, index);
- }
- break;
- }
- attrNameRegion = null;
- }
- }
- }
- }
- if (type != null)
- result = lookupScriptType(type);
- else if (language != null)
- result = lookupScriptLanguage(language);
- return result;
- }
-
- private boolean isValidScriptingRegionType(String type) {
- return type == DOMRegionContext.BLOCK_TEXT || type == DOMRegionContext.XML_CDATA_OPEN || type == DOMRegionContext.XML_CDATA_TEXT || type == DOMRegionContext.XML_CDATA_CLOSE;
- }
-
- protected void initLegalContentTypes() {
- fSupportedTypes = getConfiguredContentTypes();
- }
-
- private String lookupScriptType(String type) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++)
- if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type))
- return IHTMLPartitions.SCRIPT;
- return IHTMLPartitions.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
- }
-
- private String lookupScriptLanguage(String language) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++)
- if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
- return IHTMLPartitions.SCRIPT;
- return IHTMLPartitions.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
- }
-
- public String getPartitionType(ITextRegion region, int offset) {
- String result = null;
- if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN || region.getType() == DOMRegionContext.XML_COMMENT_CLOSE)
- result = IHTMLPartitions.HTML_COMMENT;
- else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
- result = IHTMLPartitions.HTML_DECLARATION;
- else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
- result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
- else if (isStyleAttributeValue(region, offset))
- result = ICSSPartitions.STYLE;
- else
- result = super.getPartitionType(region, offset);
- return result;
- }
-
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
-
- ITextRegion previousStartTagNameRegion = null;
- ITextRegion nextEndTagNameRegion = null;
-
- ITextRegion[] regions = previousNode.getRegions().toArray();
- for (int i = 0; i < regions.length; i++) {
- if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
- previousStartTagNameRegion = regions[i];
- break;
- }
- }
- regions = nextNode.getRegions().toArray();
- for (int i = 0; i < regions.length; i++) {
- if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
- nextEndTagNameRegion = regions[i];
- break;
- }
- }
-
- if(previousStartTagNameRegion == null || nextEndTagNameRegion == null)
- return IHTMLPartitions.HTML_DEFAULT;
-
- String name1 = previousNode.getText(previousStartTagNameRegion);
- String name2 = nextNode.getText(nextEndTagNameRegion);
- if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
- // return ST_SCRIPT;
- return getScriptingPartitionType(fStructuredDocument.getRegionAtCharacterOffset(previousNode.getStartOffset(previousStartTagNameRegion)));
- else if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
- return ICSSPartitions.STYLE;
- return super.getPartitionTypeBetween(previousNode, nextNode);
- }
-
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- String tagname = region.getSurroundingTag();
- String result = null;
- // tagname should not be null,
- // but see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4911
- if (tagname == null) {
- result = getUnknown();
- }
- else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
- result = IHTMLPartitions.SCRIPT;
- else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || isStyleAttributeValue(region,offset))
- result = ICSSPartitions.STYLE;
- else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
- result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
- else
- result = super.getPartitionType(region, offset);
-
- return result;
- }
-
- public String getDefaultPartitionType() {
- return IHTMLPartitions.HTML_DEFAULT;
- }
-
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitionerForHTML();
- }
-
- /**
- * @return
- */
- public static String[] getConfiguredContentTypes() {
- return configuredContentTypes;
- }
-
- private boolean isScriptAttributeValue(ITextRegion region, int offset) {
- if (region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- return false;
-
- return isAttributeNameForValueInArray(EVENT_ATTRIBUTE_NAMES, region, offset);
- }
-
- /**
- * @param region {@link ITextRegion} containing <code>offset</code>
- * @param offset offset in the given <code>region</code> to check if it is in
- * the attribute value region of a style attribute
- * @return <code>true</code> if the given offset in the given region is
- * in the value region of a style attribute, <code>false</code> otherwise
- */
- private boolean isStyleAttributeValue(ITextRegion region, int offset) {
- boolean isStyleAttributeValue = false;
- if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- isStyleAttributeValue = isAttributeNameForValueInArray(STYLE_ATTRIBUTE_NAMES, region, offset);
- }
-
- return isStyleAttributeValue;
- }
-
- /**
- * <p>determines if the attribute name associated with the given attribute region
- * is in the given array of attribute names</p>
- *
- * @param attributeNames determine if the attribute name associated with the given offset
- * is in this array of attribute names
- * @param attrValueRegion {@link ITextRegion} of the attribute region containing the given offset
- * @param offset offset in an attribute region to determine if it is in the list of given attribute names
- * @return <code>true</code> if the attribute name associated with the given offset is in the given
- * list of attribute names, <code>false</code> otherwise
- */
- private boolean isAttributeNameForValueInArray(String[] attributeNames, ITextRegion attrValueRegion, int offset) {
- IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegionList regionList = node.getRegions();
- int currentIndex = regionList.indexOf(attrValueRegion);
-
- /*
- * 4 is the minimum index allowing for the tag's open, name, attribute
- * name and equals character to appear first
- */
- if (currentIndex < 4)
- return false;
- ITextRegion tagAttrNameRegion = regionList.get(currentIndex - 2);
-
- boolean foundAttributeName = false;
- if (fStructuredDocument instanceof IRegionComparible) {
- int start = node.getStartOffset(tagAttrNameRegion);
- for (int i = 0; !foundAttributeName && i < attributeNames.length; i++) {
- foundAttributeName = ((IRegionComparible) fStructuredDocument).regionMatchesIgnoreCase(start, tagAttrNameRegion.getTextLength(), attributeNames[i]);
- }
- }
- else {
- String tagAttrName = node.getText(tagAttrNameRegion);
- foundAttributeName = StringUtils.contains(attributeNames, tagAttrName, false);
- }
- return foundAttributeName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner#getParserSpecificPreviousRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
- */
- protected IStructuredDocumentRegion getParserSpecificPreviousRegion(IStructuredDocumentRegion currentRegion) {
- if (currentRegion == null)
- return null;
- do {
- currentRegion = currentRegion.getPrevious();
- } while (currentRegion != null && currentRegion.getType().equals(DOMRegionContext.BLOCK_TEXT));
-
- return currentRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java
deleted file mode 100644
index 41354829ed..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.validate.ErrorInfo;
-
-abstract class AbstractErrorInfo implements ErrorInfo, ErrorState {
-
-
- private int state = NONE_ERROR;
- private Segment seg = null;
-
- public AbstractErrorInfo(int state, Segment seg) {
- super();
- this.state = state;
- this.seg = seg;
- }
-
- abstract public short getTargetType();
-
- public int getLength() {
- return (seg == null) ? 0 : seg.getLength();
- }
-
- public int getOffset() {
- return (seg == null) ? 0 : seg.getOffset();
- }
-
- public int getState() {
- return this.state;
- }
-
- /**
- * @return the arguments to be injected into a message for the user about this error
- */
- public String[] getMessageArguments() {
- String hint = getHint();
- return hint != null ? new String[] { hint } : null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
deleted file mode 100644
index 963391616c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.core.internal.validate;
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.modelquery.HMQUtil;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-final class CMUtil {
-
- /**
- * Never instantiate!
- */
- private CMUtil() {
- super();
- }
-
- /**
- * You cannot always retrieve HTMLElementDeclaration via an Element instance.
- * Because, it occasionally a JSP custom tag. -- 9/7/2001
- */
- public static CMElementDeclaration getDeclaration(Element target) {
- Document doc = target.getOwnerDocument();
- ModelQuery query = ModelQueryUtil.getModelQuery(doc);
- return query.getCMElementDeclaration(target);
- }
-
- /**
- */
- public static boolean isCaseSensitive(CMElementDeclaration decl) {
- if (decl == null || (!decl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)))
- return false;
- return !((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- /**
- */
- private static boolean isChild(CMContent content, CMElementDeclaration target) {
- switch (content.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isWholeTagOmissible((CMElementDeclaration) content))
- if (isChild(((CMElementDeclaration) content).getContent(), target))
- return true;
- return isSameDeclaration((CMElementDeclaration) content, target);
- case CMNode.GROUP :
- CMNodeList children = ((CMGroup) content).getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- switch (child.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isWholeTagOmissible((CMElementDeclaration) child))
- if (isChild(((CMElementDeclaration) child).getContent(), target))
- return true;
- if (isSameDeclaration((CMElementDeclaration) child, target))
- return true;
- continue; // Go next child.
- case CMNode.GROUP :
- if (isChild((CMContent) child, target))
- return true;
- continue; // Go next child.
- default :
- continue; // Go next child.
- }
- }
- }
- return false;
- }
-
- /**
- */
- public static boolean isEndTagOmissible(CMElementDeclaration decl) {
- if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
- return false;
- String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
- return !omitType.equals(HTMLCMProperties.Values.OMIT_NONE);
- }
-
- /**
- */
- public static boolean isWholeTagOmissible(CMElementDeclaration decl) {
- if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
- return false;
- String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
- return omitType.equals(HTMLCMProperties.Values.OMIT_BOTH);
- }
-
- /**
- */
- public static boolean isJSP(CMElementDeclaration decl) {
- if (!decl.supports(HTMLCMProperties.IS_JSP))
- return false;
- return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue();
- }
-
- /**
- */
- public static boolean isXHTML(CMElementDeclaration decl) {
- if (!decl.supports(HTMLCMProperties.IS_XHTML))
- return false;
- return ((Boolean) decl.getProperty(HTMLCMProperties.IS_XHTML)).booleanValue();
- }
-
- /**
- * The method to distinguish HTML and XHTML from other mark up.
- * This method returns true if the target is,
- * (1) not JSP,
- * (2) not SSI.
- */
- public static boolean isHTML(CMElementDeclaration decl) {
- return (!isJSP(decl)) && (!isSSI(decl));
- }
-
- /**
- */
- private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
- return aDec.getElementName() == otherDec.getElementName();
- }
-
- /**
- */
- public static boolean isSSI(CMElementDeclaration edec) {
- if (edec == null)
- return false;
- if (!edec.supports(HTMLCMProperties.IS_SSI))
- return false;
- return ((Boolean) edec.getProperty(HTMLCMProperties.IS_SSI)).booleanValue();
- }
-
- /**
- * Call this method only when the parent content type is one of
- * the following: ANY, ELEMENT, or MIXED.
- */
- public static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
- if (parent == null || child == null)
- return false;
- if (isHTML(parent) && (!isHTML(child)))
- return true;
- CMContent content = parent.getContent();
- if (content == null)
- return false;
- return isChild(content, child);
- }
-
- public static boolean isForeign(Element target) {
- if (!(target instanceof IDOMElement))
- return true;
- IDOMElement element = (IDOMElement) target;
- return !element.isGlobalTag();
- }
-
- /**
- * This method returns true if all of the following conditions are met:
- * (1) value type is ENUM,
- * (2) only one value is defined in the enumeration,
- * (3) the value has same name to the attribute name.
- */
- public static boolean isBooleanAttr(CMAttributeDeclaration adec) {
- CMDataType attrtype = adec.getAttrType();
- if (attrtype == null)
- return false;
- if (attrtype.getDataTypeName() != CMDataType.ENUM)
- return false;
- String[] values = attrtype.getEnumeratedValues();
- if (values.length != 1)
- return false;
- return values[0].equals(adec.getAttrName());
- }
-
- public static boolean isValidInclusion(CMElementDeclaration decl, Element parent) {
- Iterator iter = HMQUtil.getInclusions(parent).iterator();
- while (iter.hasNext()) {
- CMElementDeclaration inclusion = (CMElementDeclaration) iter.next();
- if (isSameDeclaration(decl, inclusion))
- return true;
- }
- return false;
- }
-
- /**
- * The method to distinguish HTML and XHTML from other mark up.
- * This method returns true if the target is,
- * (1) not JSP,
- * (2) not SSI.
- */
- public static boolean isObsolete(CMNode decl) {
- return decl.supports(HTMLCMProperties.IS_OBSOLETE) && ((Boolean)(decl.getProperty(HTMLCMProperties.IS_OBSOLETE))).booleanValue();
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
deleted file mode 100644
index b0e752305f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class CompositeValidator extends ValidationComponent {
-
- protected Vector components = new Vector();
-
- /**
- * CompositeValidator constructor comment.
- */
- public CompositeValidator() {
- super();
- }
-
- /**
- */
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
-
- Iterator i = components.iterator();
- while (i.hasNext()) {
- ValidationAdapter component = (ValidationAdapter) i.next();
- if (component == null)
- continue;
- component.setReporter(reporter);
- }
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Iterator i = components.iterator();
- while (i.hasNext()) {
- ValidationComponent component = (ValidationComponent) i.next();
- if (component == null)
- continue;
- component.validate(node);
- }
- }
-
- /**
- */
- void add(ValidationComponent validator) {
- components.add(validator);
- }
-
- /**
- * This method registers all components in 'validators'.
- * Each derivative must call this methid in its constructor.
- */
- protected void register(ValidationComponent[] validators) {
- for (int i = 0; i < validators.length; i++) {
- if (validators[i] != null)
- add(validators[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
deleted file mode 100644
index 562915b136..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class DocumentPropagatingValidator extends AbstractPropagatingValidator {
-
-
- private ValidationComponent validator = new HTMLSimpleDocumentValidator();
- private ElementPropagatingValidator propagatee = new ElementPropagatingValidator();
-
- public DocumentPropagatingValidator() {
- super();
- }
-
- public void validate(IndexedRegion node) {
- getPropagatee().setReporter(this.reporter);
- super.validate(node);
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == DocumentPropagatingValidator.class || super.isAdapterForType(type));
- }
-
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
- validator.setReporter(reporter);
- propagatee.setReporter(reporter);
- }
-
- protected final ValidationComponent getPropagatee() {
- return propagatee;
- }
-
- protected final ValidationAdapter getValidator() {
- return validator;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java
deleted file mode 100644
index c290b6230d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class ElementPropagatingValidator extends AbstractPropagatingValidator {
-
-
- private ValidationComponent validator = new HTMLSimpleValidator();
-
- public ElementPropagatingValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == ElementPropagatingValidator.class || super.isAdapterForType(type));
- }
-
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
- validator.setReporter(reporter);
- }
-
- protected ValidationComponent getPropagatee() {
- return this;
- }
-
- protected ValidationAdapter getValidator() {
- return validator;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
deleted file mode 100644
index f134ee4dac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-final class ErrorInfoImpl extends AbstractErrorInfo {
-
- private Node target = null;
- /**
- * The message arguments to list before the target information
- */
- private String[] fPreTargetMsgArgs;
-
- /**
- * The message arguments to list after the target information
- */
- private String[] fPostTargetMsgArgs;
-
- /**
- * <p>Create error info without any extra message arguments
- * before or after the <code>target</code> information</p>
- *
- * @param state the error state
- * @param errorSeg the <code>Segment</code> to report the error on
- * @param target the <code>Node</code> that is causing the error
- */
- public ErrorInfoImpl(int state, Segment errorSeg, Node target) {
- super(state, errorSeg);
- this.target = target;
- this.fPreTargetMsgArgs = new String[0];
- this.fPostTargetMsgArgs = new String[0];
- }
-
- /**
- * <p>Create error info with extra message arguments before and/or
- * after the <code>target</code> information</p>
- *
- * @param state the error state
- * @param errorSeg the <code>Segment</code> to report the error on
- * @param target the <code>Node</code> that is causing the error
- * @param preTargetMsgArgs message arguments to place before the <code>target</code> information
- * @param postTargetMsgInjections message arguments to place after the <code>target</code> information
- */
- public ErrorInfoImpl(int state, Segment errorSeg, Node target, String[] preTargetMsgArgs, String[] postTargetMsgInjections) {
- super(state, errorSeg);
- this.target = target;
- this.fPreTargetMsgArgs = preTargetMsgArgs;
- this.fPostTargetMsgArgs = postTargetMsgInjections;
- }
-
- /**
- */
- public String getHint() {
- switch (target.getNodeType()) {
- case Node.ATTRIBUTE_NODE :
- switch (getState()) {
- case UNDEFINED_VALUE_ERROR :
- case MISMATCHED_VALUE_ERROR :
- case UNCLOSED_ATTR_VALUE :
- case RESOURCE_NOT_FOUND :
- //D210422
- return ((Attr) target).getValue();
- default :
- return target.getNodeName();
- }
- case Node.TEXT_NODE :
- return ((Text) target).getData();
- case Node.ELEMENT_NODE :
- default :
- return target.getNodeName();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.html.core.internal.validate.AbstractErrorInfo#getMessageArguments()
- */
- public String[] getMessageArguments() {
- String[] messageInjections = new String[this.fPreTargetMsgArgs.length + 1 + this.fPostTargetMsgArgs.length];
- //copy the pre target message injections in
- System.arraycopy(this.fPreTargetMsgArgs, 0, messageInjections, 0, this.fPreTargetMsgArgs.length);
- int nextIndex = fPreTargetMsgArgs.length;
-
- //put the target message injection in
- switch (target.getNodeType()) {
- case Node.ATTRIBUTE_NODE :
- switch (getState()) {
- case UNDEFINED_VALUE_ERROR :
- case MISMATCHED_VALUE_ERROR :
- case UNCLOSED_ATTR_VALUE :
- case RESOURCE_NOT_FOUND :
- //D210422
- messageInjections[nextIndex] = ((Attr) target).getValue();
- break;
- default :
- messageInjections[nextIndex] = target.getNodeName();
- break;
- }
- break;
- case Node.TEXT_NODE :
- messageInjections[nextIndex] = ((Text) target).getData();
- break;
- case Node.ELEMENT_NODE :
- default :
- messageInjections[nextIndex] = target.getNodeName();
- break;
- }
- //copy the post target message injections in
- System.arraycopy(this.fPostTargetMsgArgs, 0, messageInjections, nextIndex+1, this.fPostTargetMsgArgs.length);
- return messageInjections;
- }
-
- public short getTargetType() {
- return target.getNodeType();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
deleted file mode 100644
index 7be1deb5bf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-interface ErrorState {
- static final int NONE_ERROR = 0;
- // generic error
- static final int UNDEFINED_NAME_ERROR = 11;
- static final int UNDEFINED_VALUE_ERROR = 12;
- static final int MISMATCHED_VALUE_ERROR = 13;
- static final int OBSOLETE_ATTR_NAME_ERROR = 14;
- static final int OBSOLETE_TAG_NAME_ERROR = 15;
- static final int MISSING_ATTR_VALUE_EQUALS_ERROR = 16;
-
- // format error
- static final int FORMAT_ERROR_LEVEL = 100;
- static final int INVALID_NAME_ERROR = 101;
- static final int INVALID_CHAR_ERROR = 102;
- static final int MISMATCHED_ERROR = 103;
- static final int MISMATCHED_END_TAG_ERROR = 104;
- static final int MISSING_START_TAG_ERROR = 105;
- static final int MISSING_END_TAG_ERROR = 106;
- static final int UNNECESSARY_END_TAG_ERROR = 107;
- static final int INVALID_ATTR_ERROR = 108;
- static final int INVALID_DIRECTIVE_ERROR = 109;
- static final int UNCLOSED_TAG_ERROR = 110;
- static final int UNCLOSED_END_TAG_ERROR = 111;
- static final int INVALID_EMPTY_ELEMENT_TAG = 112;
- static final int UNCLOSED_ATTR_VALUE = 113; //D210422
- static final int RESOURCE_NOT_FOUND = 114; //D210422
- static final int INVALID_TEXT_IN_ELEM_ERROR = 115;
-
- // layout error
- static final int LAYOUT_ERROR_LEVEL = 1000;
- static final int INVALID_CONTENT_ERROR = 1001;
- static final int DUPLICATE_ERROR = 1002;
- static final int COEXISTENCE_ERROR = 1003;
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
deleted file mode 100644
index f3ee02a826..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.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.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-final class FMUtil {
-
- public final static int SEG_NONE = 0;
- public final static int SEG_WHOLE_TAG = 1;
- public final static int SEG_START_TAG = 2;
- public final static int SEG_END_TAG = 3;
- public final static int SEG_START_TAG_NAME = 4;
- public final static int SEG_END_TAG_NAME = 5;
-
- /**
- */
- private FMUtil() {
- super();
- }
-
- /**
- */
- public final static Segment getSegment(IDOMNode target, int segType) {
- if (target == null)
- return new Segment(0, 0);
- Segment seg = null;
- IStructuredDocumentRegion startTag = null;
- IStructuredDocumentRegion endTag = null;
- switch (segType) {
- case SEG_WHOLE_TAG :
- startTag = target.getFirstStructuredDocumentRegion();
- if (startTag != null) {
- endTag = target.getLastStructuredDocumentRegion();
- seg = new Segment(startTag, endTag);
- }
- else {
- int startOffset = target.getStartOffset();
- int endOffset = target.getEndOffset();
- seg = new Segment(startOffset, endOffset - startOffset);
- }
- break;
- case SEG_START_TAG :
- startTag = target.getStartStructuredDocumentRegion();
- if (startTag != null) {
- seg = new Segment(startTag);
- }
- else {
- seg = new Segment(target.getStartOffset(), 1);
- }
- break;
- case SEG_END_TAG :
- endTag = target.getEndStructuredDocumentRegion();
- if (endTag != null) {
- seg = new Segment(endTag);
- }
- else {
- seg = new Segment(target.getEndOffset(), 1);
- }
- break;
- case SEG_START_TAG_NAME :
- startTag = target.getStartStructuredDocumentRegion();
- if (startTag != null) {
- ITextRegion nameRegion = getNameRegion(startTag);
- if (nameRegion != null) {
- seg = new Segment(startTag.getStartOffset(nameRegion), nameRegion.getTextLength());
- }
- }
- if (seg == null) {
- seg = getSegment(target, SEG_START_TAG);
- }
- break;
- case SEG_END_TAG_NAME :
- endTag = target.getEndStructuredDocumentRegion();
- if (endTag != null) {
- ITextRegion nameRegion = getNameRegion(endTag);
- if (nameRegion != null) {
- seg = new Segment(endTag.getStartOffset(nameRegion), nameRegion.getTextLength());
- }
- }
- if (seg == null) {
- seg = getSegment(target, SEG_END_TAG);
- }
- break;
- case SEG_NONE :
- default :
- return new Segment(0, 0);
- }
- return seg;
- }
-
- private static ITextRegion 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;
- }
- }
- return nameRegion ;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
deleted file mode 100644
index 272a45b1a6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.List;
-import java.util.Locale;
-
-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.html.core.internal.document.HTMLDocumentTypeConstants;
-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.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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class HTMLAttributeValidator extends PrimeValidator {
-
- private static final int REGION_NAME = 1;
- private static final int REGION_VALUE = 2;
- // <<D210422
- private static final char SINGLE_QUOTE = '\'';
- private static final char DOUBLE_QUOTE = '\"';
-
- // HTML(5) data attributes
- private static final String ATTR_NAME_DATA = "data-"; //$NON-NLS-1$
- private static final int ATTR_NAME_DATA_LENGTH = ATTR_NAME_DATA.length();
-
- //WHATWG x-vendor-feature attributes
- private static final String ATTR_NAME_USER_AGENT_FEATURE = "x-"; //$NON-NLS-1$
- private static final int ATTR_NAME_USER_AGENT_FEATURE_LENGTH = ATTR_NAME_USER_AGENT_FEATURE.length();
-
- // D210422
- /**
- * HTMLAttributeValidator constructor comment.
- */
- public HTMLAttributeValidator() {
- super();
- }
-
- /**
- */
- private Segment getErrorSegment(IDOMNode errorNode, int regionType) {
- ITextRegion rgn = null;
- switch (regionType) {
- case REGION_NAME :
- rgn = errorNode.getNameRegion();
- break;
- case REGION_VALUE :
- rgn = errorNode.getValueRegion();
- break;
- default :
- // nothing to do.
- break;
- }
- if (rgn != null) {
- if (errorNode instanceof IDOMAttr) {
- IDOMElement ownerElement = (IDOMElement) ((IDOMAttr) errorNode).getOwnerElement();
- if (ownerElement != null) {
- //if editor closed during validation this could be null
- IStructuredDocumentRegion firstRegion = ownerElement.getFirstStructuredDocumentRegion();
- if(firstRegion != null) {
- int regionStartOffset = firstRegion.getStartOffset(rgn);
- int regionLength = rgn.getTextLength();
- return new Segment(regionStartOffset, regionLength);
- }
- }
- }
- }
- return new Segment(errorNode.getStartOffset(), 1);
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLAttributeValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
- CMElementDeclaration edec = CMUtil.getDeclaration(target);
- if (edec == null)
- return;
- CMNamedNodeMap declarations = edec.getAttributes();
-
- List modelQueryNodes = null;
- NamedNodeMap attrs = target.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- int rgnType = REGION_NAME;
- int state = ErrorState.NONE_ERROR;
- Attr a = (Attr) attrs.item(i);
- // D203637; If the target attr has prefix, the validator should
- // not
- // warn about it. That is, just ignore. It is able to check
- // whether
- // an attr has prefix or not by calling XMLAttr#isGlobalAttr().
- // When a attr has prefix (not global), it returns false.
- boolean isXMLAttr = a instanceof IDOMAttr;
- if (isXMLAttr) {
- IDOMAttr xmlattr = (IDOMAttr) a;
- if (!xmlattr.isGlobalAttr() || xmlattr.getNameRegion() instanceof ITextRegionContainer)
- continue; // skip futher validation and begin next loop.
- }
-
- CMAttributeDeclaration adec = (CMAttributeDeclaration) declarations.getNamedItem(a.getName());
- final String attrName = a.getName().toLowerCase(Locale.US);
- /* Check the modelquery if nothing is declared by the element declaration */
- if (adec == null) {
- if (modelQueryNodes == null)
- modelQueryNodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
-
-
- for (int k = 0; k < modelQueryNodes.size(); k++) {
- CMNode cmnode = (CMNode) modelQueryNodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(attrName)) {
- adec = (CMAttributeDeclaration) cmnode;
- break;
- }
- }
- }
-
- if (adec == null) {
- if ((attrName.startsWith(ATTR_NAME_DATA) && attrName.length() > ATTR_NAME_DATA_LENGTH) || (attrName.startsWith(ATTR_NAME_USER_AGENT_FEATURE) && attrName.length() > ATTR_NAME_USER_AGENT_FEATURE_LENGTH)) {
- DocumentTypeAdapter documentTypeAdapter = (DocumentTypeAdapter) ((INodeNotifier) target.getOwnerDocument()).getAdapterFor(DocumentTypeAdapter.class);
- if (documentTypeAdapter != null && documentTypeAdapter.hasFeature(HTMLDocumentTypeConstants.HTML5))
- continue;
- }
- // No attr declaration was found. That is, the attr name is
- // undefined.
- // but not regard it as undefined name if it includes nested
- // region
- if (!hasNestedRegion(((IDOMNode) a).getNameRegion())) {
- rgnType = REGION_NAME;
- state = ErrorState.UNDEFINED_NAME_ERROR;
- }
- } else {
- // The attr declaration was found.
- // At 1st, the name should be checked.
- if (CMUtil.isObsolete(adec)){
- state = ErrorState.OBSOLETE_ATTR_NAME_ERROR;
- }
- if (CMUtil.isHTML(edec) && (!CMUtil.isXHTML(edec))) {
- // If the target element is pure HTML (not XHTML), some
- // attributes
- // might be written in boolean format. It should be check
- // specifically.
- if (CMUtil.isBooleanAttr(adec) && ((IDOMAttr) a).hasNameOnly())
- continue; // OK, keep going. No more check is needed
- // against this attr.
- } else {
- // If the target is other than pure HTML (JSP or XHTML),
- // the name
- // must be checked exactly (ie in case sensitive way).
- String actual = a.getName();
- String desired = adec.getAttrName();
- if (!actual.equals(desired)) { // case mismatch
- rgnType = REGION_NAME;
- state = ErrorState.MISMATCHED_ERROR;
- }
- }
- // Then, the value must be checked.
- if (state == ErrorState.NONE_ERROR) { // Need more check.
- // Now, the value should be checked, if the type is ENUM.
- CMDataType attrType = adec.getAttrType();
- if (a instanceof IDOMAttr) {
- final ITextRegion region = ((IDOMAttr) a).getEqualRegion();
- if (region == null) {
- rgnType = REGION_NAME;
- state = ErrorState.MISSING_ATTR_VALUE_EQUALS_ERROR;
- }
- }
- String actualValue = a.getValue();
- if (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) {
- // Check FIXED value.
- String validValue = attrType.getImpliedValue();
- if (!actualValue.equals(validValue)) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNDEFINED_VALUE_ERROR;
- }
- }
- else if (CMDataType.URI.equals(attrType.getDataTypeName())) {
- // TODO: URI validation?
- if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
- IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
- if (start != null && start.getFirstRegion().getTextLength() == 1) {
- IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
- if (basePath.segmentCount() > 1) {
- IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
- IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
- if (found == null || !found.isAccessible()) {
- rgnType = REGION_VALUE;
- state = ErrorState.RESOURCE_NOT_FOUND;
- }
- }
- }
- }
- }
- else if (CMDataType.ENUM.equals(attrType.getDataTypeName())) {
- /*
- * Check current value is valid among a known list.
- * There may be enumerated values provided even when
- * the datatype is not ENUM, but we'll only validate
- * against that list if the type matches.
- */
- String[] enumeratedValues = attrType.getEnumeratedValues();
- // several candidates are found.
- boolean found = false;
- for (int j = 0; j < enumeratedValues.length; j++) {
- // At 1st, compare ignoring case.
- if (actualValue.equalsIgnoreCase(enumeratedValues[j])) {
- found = true;
- if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(enumeratedValues[j]))) {
- rgnType = REGION_VALUE;
- state = ErrorState.MISMATCHED_VALUE_ERROR;
- }
- break; // exit the loop.
- }
- }
- if (!found) {
- // retrieve and check extended values (retrieval can call extensions, which may take longer)
- String[] modelQueryExtensionValues = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getPossibleDataTypeValues((Element) node, adec);
- // copied loop from above
- for (int j = 0; j < modelQueryExtensionValues.length; j++) {
- // At 1st, compare ignoring case.
- if (actualValue.equalsIgnoreCase(modelQueryExtensionValues[j])) {
- found = true;
- if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(modelQueryExtensionValues[j]))) {
- rgnType = REGION_VALUE;
- state = ErrorState.MISMATCHED_VALUE_ERROR;
- }
- break; // exit the loop.
- }
- }
- // No candidate was found. That is,
- // actualValue is invalid.
- // but not regard it as undefined value if it
- // includes nested region.
- if (!hasNestedRegion(((IDOMNode) a).getValueRegion())) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNDEFINED_VALUE_ERROR;
- }
- }
- }
- }
- // <<D210422
- if (state == ErrorState.NONE_ERROR) { // Need more check.
- if (isXMLAttr) {
- String source = ((IDOMAttr) a).getValueRegionText();
- if (source != null) {
- char firstChar = source.charAt(0);
- char lastChar = source.charAt(source.length() - 1);
- if (isQuote(firstChar) || isQuote(lastChar)) {
- if (lastChar != firstChar) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNCLOSED_ATTR_VALUE;
- }
- }
- }
- }
- }
- // D210422
- }
- if (state != ErrorState.NONE_ERROR) {
- Segment seg = getErrorSegment((IDOMNode) a, rgnType);
- if (seg != null)
- reporter.report(new ErrorInfoImpl(state, seg, a));
- }
- }
- }
-
- /**
- * True if container has nested regions, meaning container is probably too
- * complicated (like JSP regions) to validate with this validator.
- */
- private boolean hasNestedRegion(ITextRegion container) {
- if (!(container instanceof ITextRegionContainer))
- return false;
- ITextRegionList regions = ((ITextRegionContainer) container).getRegions();
- if (regions == null)
- return false;
- // BUG207194: return true by default as long as container is an
- // ITextRegionContainer with at least 1 region
- return true;
- }
-
- // <<D214022
- private boolean isQuote(char c) {
- return (c == SINGLE_QUOTE) || (c == DOUBLE_QUOTE);
- }
- // D210422
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
deleted file mode 100644
index cb6cab3115..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class HTMLDocumentContentValidator extends PrimeValidator {
-
-
- private final static class Division {
- private Vector explicitHtmls = new Vector();
- private Vector rest = new Vector();
-
- public Division(Document document, NodeList children) {
- String rootTagName = getRootTagName(document);
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (isHtmlTag(child, rootTagName)) {
- explicitHtmls.add(child);
- }
- else {
- rest.add(child);
- }
- }
- }
-
- public boolean hasExplicitHtmls() {
- return explicitHtmls.size() > 0;
- }
-
- public List getExplicitHtmls() {
- return explicitHtmls;
- }
-
- public Iterator getRestNodes() {
- return rest.iterator();
- }
-
- /* utilities */
- private static boolean isHtmlTag(Node node, String tagName) {
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return false;
- return ((Element) node).getTagName().equalsIgnoreCase(tagName);
- }
-
- private static String getRootTagName(Document document) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) document).getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null) {
- DocumentType docType = adapter.getDocumentType();
- if (docType != null) {
- return docType.getName();
- }
- }
-
- return HTML40Namespace.ElementName.HTML;
- }
- }
-
- /**
- * HTMLDocumentContentValidator constructor comment.
- */
- public HTMLDocumentContentValidator() {
- super();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLDocumentContentValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- // isFragment check should be more intelligent.
- boolean isFragment = true;
-
- Document target = (Document) node;
- NodeList children = target.getChildNodes();
- if (children == null)
- return;
-
- Division division = new Division(target, children);
- if (division.hasExplicitHtmls()) {
- isFragment = false;
-
- List explicits = division.getExplicitHtmls();
- if (explicits.size() > 1) {
- for (int i = 1; i < explicits.size(); i++) {
- Element html = (Element) explicits.get(i);
- // report error (duplicate)
- Segment errorSeg = FMUtil.getSegment((IDOMNode) html, FMUtil.SEG_START_TAG);
- if (errorSeg != null)
- reporter.report(new ErrorInfoImpl(ErrorState.DUPLICATE_ERROR, errorSeg, html));
- }
- }
- }
- validateContent(division.getRestNodes(), isFragment);
- }
-
- /*
- * This methods validate nodes other than HTML elements.
- */
- private void validateContent(Iterator children, boolean isFragment) {
- boolean foundDoctype = false;
- while (children.hasNext()) {
- IDOMNode child = (IDOMNode) children.next();
-
- int error = ErrorState.NONE_ERROR;
- int segType = FMUtil.SEG_WHOLE_TAG;
-
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE :
- if (!isFragment) {
- Element childElem = (Element) child;
- CMElementDeclaration ced = CMUtil.getDeclaration(childElem);
- // Undefined element is valid.
- if (ced == null)
- continue;
- // JSP (includes custom tags) and SSI are valid.
- if (CMUtil.isForeign(childElem) || CMUtil.isSSI(ced))
- continue; // Defect 186774
-
- // report error (invalid content)
- error = ErrorState.INVALID_CONTENT_ERROR;
- // mark the whole start tag as error.
- segType = FMUtil.SEG_START_TAG;
- }
- break;
- case Node.TEXT_NODE :
- if (!isFragment) {
- // TEXT node is valid when it contains white space
- // characters only.
- // Otherwise, it is invalid content.
- if (((IDOMText) child).isElementContentWhitespace())
- continue;
- error = ErrorState.INVALID_CONTENT_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- }
- break;
- case Node.DOCUMENT_TYPE_NODE :
- // DOCTYPE is also valid when it appears once and only
- // once.
- if (!foundDoctype) {
- foundDoctype = true;
- continue;
- }
- error = ErrorState.DUPLICATE_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.COMMENT_NODE :
- // always valid.
- case Node.PROCESSING_INSTRUCTION_NODE :
- continue;
- default :
- if (!isFragment) {
- error = ErrorState.INVALID_CONTENT_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- }
- break;
- }
- if (error != ErrorState.NONE_ERROR) {
- Segment errorSeg = FMUtil.getSegment(child, segType);
- if (errorSeg != null)
- reporter.report(new ErrorInfoImpl(error, errorSeg, child));
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java
deleted file mode 100644
index 0c61edd80a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-public class HTMLElementAncestorValidator extends PrimeValidator {
-
- /**
- * HTMLElementAncestorValidator constructor comment.
- */
- public HTMLElementAncestorValidator() {
- super();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLElementAncestorValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- * Check exclusion which is defined in only HTML DTD (SGML).
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- if (dec == null)
- return; // cannot validate.
- if (!CMUtil.isHTML(dec))
- return; // no need to validate
- if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
- return; // cannot validate.
- CMNamedNodeMap prohibited = (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
- if (prohibited.getLength() <= 0)
- return; // no prohibited ancestors.
-
- Element parent = SMUtil.getParentElement(target);
- while (parent != null) {
- CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
- if (pdec != null) { // prohibited element is found in ancestors.
- Segment errorSeg = FMUtil.getSegment((IDOMNode) node, FMUtil.SEG_START_TAG);
- if (errorSeg != null)
- reporter.report(new ErrorInfoImpl(ErrorState.INVALID_CONTENT_ERROR, errorSeg, target));
- break; // If one prohibited ancestor is found, it's enough.
- }
- parent = SMUtil.getParentElement(parent);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
deleted file mode 100644
index 30259deb1e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-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.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLElementContentValidator extends PrimeValidator {
-
- /**
- * HTMLElementContentValidator constructor comment.
- */
- public HTMLElementContentValidator() {
- super();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLElementContentValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
-
- validateContent(target, target.getFirstChild());
- }
-
- private void validateContent(Element parent, Node child) {
- if (child == null)
- return;
-
- CMElementDeclaration ed = CMUtil.getDeclaration(parent);
- if(ed == null || ed.getContentType() == CMElementDeclaration.ANY)
- return;
-
- List[] extendedContent = new List[1];
- while (child != null) {
- // perform actual validation
- validateNode(parent, child, ed, extendedContent);
- child = child.getNextSibling();
- }
- }
-
- // private int countExplicitSiblings(Element parent, String tagName) {
- // NodeList children = parent.getChildNodes();
- // int count = 0;
- // for (int i = 0; i < children.getLength(); i++) {
- // Node child = children.item(i);
- // if (child.getNodeType() != Node.ELEMENT_NODE)
- // continue;
- // if (tagName.equalsIgnoreCase(((Element) child).getTagName())) {
- // count++;
- // }
- // }
- // return count;
- // }
-
- /*
- * The implementation of the following method is practical but accurate.
- * The accurate maximum occurrence should be retrieve from the content
- * model. However, it is useful enough, since almost implicit elements are
- * HTML, HEAD, or BODY.
- */
- // private int getMaxOccur(Element parent, String childTag) {
- // return 1;
- // }
-
-// private boolean containsName(String name, Object[] possible) {
-// if (name != null && possible != null) {
-// for (int i = 0; i < possible.length; i++) {
-// if(name.equals(possible[i]))
-// return true;
-// }
-// }
-// return false;
-// }
-
- private void validateNode(Element target, Node child, CMElementDeclaration edec, List[] extendedContent) {
- // NOTE: If the target element is 'UNKNOWN', that is, it has no
- // element declaration, the content type of the element should be
- // regarded as 'ANY'. -- 9/10/2001
- int contentType = CMElementDeclaration.ANY;
- if (edec != null)
- contentType = edec.getContentType();
-
- int error = ErrorState.NONE_ERROR;
- int segType = FMUtil.SEG_WHOLE_TAG;
-
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE :
- Element childElem = (Element) child;
- // Defect 200321:
- // This validator cares only HTML/XHTML elements. If a child
- // is
- // an element of foreign markup languages, just ignore it.
- if (CMUtil.isForeign(childElem))
- return;
-
- CMElementDeclaration ced = CMUtil.getDeclaration((Element) child);
- // Defect 186774: If a child is not one of HTML elements,
- // it should be regarded as a valid child regardless the
- // type of the parent content model. -- 10/12/2001
- if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)))
- return;
- if (CMUtil.isObsolete(ced)){
- error = ErrorState.OBSOLETE_TAG_NAME_ERROR;
- break;
- }
-
- switch (contentType) {
- case CMElementDeclaration.ANY :
- // Keep going.
- return;
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.MIXED :
- if (ced == null)
- return;
- if (CMUtil.isValidChild(edec, ced))
- return;
- // Now, it is the time to check inclusion, unless the
- // target
- // document is not a XHTML.
- if (!CMUtil.isXHTML(edec)) {
- // pure HTML
- if (CMUtil.isValidInclusion(ced, target))
- return;
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=218143 -
- * ModelQuery use not pervasive enough
- */
- if (extendedContent[0] == null) {
- extendedContent[0] = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent(target, edec, ModelQuery.INCLUDE_CHILD_NODES);
- }
-
- List availableChildElementDeclarations = extendedContent[0];
- /*
- * Retrieve and set aside just the element names for faster checking
- * later.
- */
- int availableChildCount = availableChildElementDeclarations.size();
- String elementName = ced.getElementName().toLowerCase(Locale.US);
- for (int i = 0; i < availableChildCount; i++) {
- CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
- return;
- }
- }
-
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- }
- // Mark the whole START tag as an error segment.
- segType = FMUtil.SEG_START_TAG;
- break;
- case Node.TEXT_NODE :
- switch (contentType) {
- case CMElementDeclaration.ANY :
- case CMElementDeclaration.MIXED :
- case CMElementDeclaration.PCDATA :
- case CMElementDeclaration.CDATA :
- // D184339
- // Keep going.
- return;
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.EMPTY :
- if (((IDOMText) child).isElementContentWhitespace())
- return;
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- }
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.COMMENT_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- if (contentType != CMElementDeclaration.EMPTY)
- return;
- error = ErrorState.INVALID_CONTENT_ERROR;
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.CDATA_SECTION_NODE :
- if (edec.supports(HTMLCMProperties.IS_XHTML) && Boolean.TRUE.equals(edec.getProperty(HTMLCMProperties.IS_XHTML)))
- return;
- if (!edec.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.BODY)) { // special case for body element
- switch (contentType) {
- case CMElementDeclaration.ANY:
- case CMElementDeclaration.CDATA:
- case CMElementDeclaration.MIXED:
- case CMElementDeclaration.PCDATA:
- return;
- }
- }
- // Mark the whole CDATA section as an error segment
- error = ErrorState.INVALID_CONTENT_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.ENTITY_REFERENCE_NODE :
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- }
- if (error != ErrorState.NONE_ERROR) {
- Segment errorSeg = FMUtil.getSegment((IDOMNode) child, segType);
- if (errorSeg != null)
- reporter.report(new ErrorInfoImpl(error, errorSeg, child));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
deleted file mode 100644
index 65795b3d69..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleDocumentValidator extends CompositeValidator {
-
- /**
- * HTMLSimpleDocumentValidator constructor comment.
- */
- public HTMLSimpleDocumentValidator() {
- super();
-
- ValidationComponent[] validators = new ValidationComponent[2];
-
- validators[0] = new HTMLDocumentContentValidator();
- validators[1] = new SyntaxValidator();
-
- register(validators);
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLSimpleDocumentValidator.class) || super.isAdapterForType(type));
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java
deleted file mode 100644
index 7276fd81fb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleValidator extends CompositeValidator {
-
- /**
- * HTMLSimpleValidator constructor comment.
- */
- public HTMLSimpleValidator() {
- super();
-
- ValidationComponent[] validators = new ValidationComponent[5];
-
- validators[0] = new HTMLAttributeValidator();
- validators[1] = new HTMLElementContentValidator();
- validators[2] = new SyntaxValidator();
- validators[3] = new HTMLElementAncestorValidator();
- validators[4] = new NamespaceValidator();
-
- register(validators);
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type
- * allows it to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return ((type == HTMLSimpleValidator.class) || super.isAdapterForType(type));
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java
deleted file mode 100644
index 1010e0473c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-
-public class HTMLValidationAdapterFactory extends AbstractAdapterFactory {
-
- private static HTMLValidationAdapterFactory instance = null;
-
- /**
- * HTMLValidationAdapterFactory constructor comment.
- */
- public HTMLValidationAdapterFactory() {
- super(ValidationAdapter.class, true);
- }
-
- /**
- * HTMLValidationAdapterFactory constructor comment.
- * @param adapterKey java.lang.Object
- * @param registerAdapters boolean
- */
- public HTMLValidationAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- /**
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- Node node = (Node) target;
- switch (node.getNodeType()) {
- case Node.DOCUMENT_NODE :
- return new DocumentPropagatingValidator();
- case Node.ELEMENT_NODE :
- return new ElementPropagatingValidator();
- default :
- return new NullValidator();
- }
- }
-
- /**
- */
- public synchronized static HTMLValidationAdapterFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new HTMLValidationAdapterFactory();
- return instance;
- }
-
- /**
- * Overriding Object's clone() method
- * This is used in IModelManager's IStructuredModel copying.
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
deleted file mode 100644
index 83eb689e91..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.validate.ErrorInfo;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.w3c.dom.Node;
-
-public class MessageFactory implements ErrorState {
-
-
- private IProject fProject;
- private IScopeContext[] fLookupOrder;
- private IPreferencesService fPreferenceService;
-
- public MessageFactory() {
- init();
- }
-
- public MessageFactory(IProject project) {
- fProject = project;
- init();
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /**
- * Creates a packet for the error table based on the state, message, and the
- * severity defined in the preference store. This packet, in addition to
- * being added to the error table, is also placed in a map based on the
- * supplied preference key
- *
- * @param key the preference key for the error severity
- * @param errorTable the error table to store the packet information in
- * @param state the error state
- * @param msg the message for the error
- */
- private void mapToKey(String key, ErrorTable errorTable, int state, String msg) {
- int severity = ValidationMessage.WARNING;
- severity = fPreferenceService.getInt(HTMLCorePlugin.getDefault().getBundle().getSymbolicName(), key, ValidationMessage.WARNING, fLookupOrder);
- errorTable.put(state, msg, severity);
- }
-
- private void init() {
- fPreferenceService = Platform.getPreferencesService();
- fLookupOrder = new IScopeContext[] {new InstanceScope(), new DefaultScope()};
-
- if (fProject != null) {
- ProjectScope projectScope = new ProjectScope(fProject);
- if(projectScope.getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
- fLookupOrder = new IScopeContext[] {projectScope, new InstanceScope(), new DefaultScope()};
- }
-
- for (int i = 0; i < NodeType.MAX_TYPE; i++) {
- errTables[i] = new ErrorTable();
- }
- // NOTE: The severities are just stub. They must be reviewed.
- // -- 8/30/2001
-
- // attribute error map
- ErrorTable attrTable = errTables[NodeType.ATTRIBUTE];// short hand
- attrTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_NAME, attrTable, UNDEFINED_NAME_ERROR, MSG_UNDEFINED_ATTR_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_VALUE, attrTable, UNDEFINED_VALUE_ERROR, MSG_UNDEFINED_VALUE_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_NAME_MISMATCH, attrTable, MISMATCHED_ERROR, MSG_MISMATCHED_ATTR_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_NAME, attrTable, INVALID_NAME_ERROR, MSG_INVALID_ATTR_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_VALUE, attrTable, INVALID_ATTR_ERROR, MSG_ATTR_NO_VALUE_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, attrTable, DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, attrTable, MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, attrTable, UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, attrTable, RESOURCE_NOT_FOUND, MSG_RESOURCE_NOT_FOUND);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, attrTable, OBSOLETE_ATTR_NAME_ERROR, MSG_OBSOLETE_ATTR_ERROR);
- mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_EQUALS_MISSING, attrTable, MISSING_ATTR_VALUE_EQUALS_ERROR, MSG_MISSING_ATTR_VALUE_EQUALS_ERROR);
-
- // element error map
- ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
- elemTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, elemTable, UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_NAME, elemTable, INVALID_NAME_ERROR, MSG_INVALID_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, elemTable, MISMATCHED_ERROR, MSG_MISMATCHED_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, elemTable, MISMATCHED_END_TAG_ERROR, MSG_MISMATCHED_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_MISSING_START, elemTable, MISSING_START_TAG_ERROR, MSG_MISSING_START_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_MISSING_END, elemTable, MISSING_END_TAG_ERROR, MSG_MISSING_END_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, elemTable, UNNECESSARY_END_TAG_ERROR, MSG_UNNECESSARY_END_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, elemTable, INVALID_DIRECTIVE_ERROR, MSG_INVALID_DIRECTIVE_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_CONTENT, elemTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_DUPLICATE, elemTable, DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_COEXISTENCE, elemTable, COEXISTENCE_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, elemTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, elemTable, UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, elemTable, INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG);
- mapToKey(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, elemTable, OBSOLETE_TAG_NAME_ERROR, MSG_OBSOLETE_TAG_ERROR);
-
- mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_TEXT, elemTable, INVALID_TEXT_IN_ELEM_ERROR, MSG_INVALID_TEXT_IN_ELEM_ERROR);
-
- // document type error map
- ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
- docTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.DOC_DUPLICATE, docTable, DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.DOC_INVALID_CONTENT, docTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.DOC_DOCTYPE_UNCLOSED, docTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR);
-
- // text error map
- ErrorTable textTable = errTables[NodeType.TEXT];
- textTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.TEXT_INVALID_CONTENT, textTable, INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR);
- mapToKey(HTMLCorePreferenceNames.TEXT_INVALID_CHAR, textTable, INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR);
-
- // comment error map
- ErrorTable commTable = errTables[NodeType.COMMENT];
- commTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.COMMENT_INVALID_CONTENT, commTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.COMMENT_UNCLOSED, commTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR);
-
- // cdata section error map
- ErrorTable cdatTable = errTables[NodeType.CDATA_SECTION];
- cdatTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.CDATA_INVALID_CONTENT, cdatTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.CDATA_UNCLOSED, cdatTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR);
-
- // processing instruction error map
- ErrorTable piTable = errTables[NodeType.PROCESSING_INSTRUCTION];
- piTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.PI_INVALID_CONTENT, piTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- mapToKey(HTMLCorePreferenceNames.PI_UNCLOSED, piTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR);
-
- // entity reference error map
- ErrorTable erTable = errTables[NodeType.ENTITY_REFERENCE];
- erTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- mapToKey(HTMLCorePreferenceNames.REF_UNDEFINED, erTable, UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR);
- mapToKey(HTMLCorePreferenceNames.REF_INVALID_CONTENT, erTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
- }
-
- private static class ErrorTable {
- private class Packet {
- public Packet(String msg, int severity) {
- this.msg = msg;
- this.severity = severity;
- }
-
- public String getMessage() {
- return msg;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- private String msg = null;
- private int severity = -1;
- }
-
- public ErrorTable() {
- }
-
- public Packet put(int state, String msg, int severity) {
- Packet packet = new Packet(msg, severity);
- map.put(new Integer(state), packet);
- return packet;
- }
-
- public String getMessage(int state) {
- return getPacket(state).getMessage();
- }
-
- public int getSeverity(int state) {
- return getPacket(state).getSeverity();
- }
-
- private Packet getPacket(int state) {
- return (Packet) map.get(new Integer(state));
- }
-
- private Hashtable map = new Hashtable();
- }
-
- private static interface NodeType {
- static final int ATTRIBUTE = 0;
- static final int ELEMENT = 1;
- static final int DOCUMENT_TYPE = 2;
- static final int TEXT = 3;
- static final int COMMENT = 4;
- static final int CDATA_SECTION = 5;
- static final int PROCESSING_INSTRUCTION = 6;
- static final int ENTITY_REFERENCE = 7;
-
- static final int MAX_TYPE = 8;
- }
-
- // error messages
- private static final String MSG_NO_ERROR = HTMLCoreMessages.No_error__UI_;
- private static final String MSG_UNDEFINED_ATTR_ERROR = HTMLCoreMessages.Undefined_attribute_name___ERROR_;
- private static final String MSG_UNDEFINED_VALUE_ERROR = HTMLCoreMessages.Undefined_attribute_value__ERROR_;
- private static final String MSG_DUPLICATE_ATTR_ERROR = HTMLCoreMessages.Multiple_values_specified__ERROR_;
- private static final String MSG_MISMATCHED_ATTR_ERROR = HTMLCoreMessages.Attribute_name___0___uses__ERROR_;
- private static final String MSG_INVALID_ATTR_ERROR = HTMLCoreMessages.Invalid_attribute_name___0_ERROR_;
- private static final String MSG_ATTR_NO_VALUE_ERROR = HTMLCoreMessages.Invalid_attribute___0____ERROR_;
- private static final String MSG_INVALID_CONTENT_ERROR = HTMLCoreMessages.Invalid_location_of_tag____ERROR_;
- private static final String MSG_DUPLICATE_TAG_ERROR = HTMLCoreMessages.Duplicate_tag___0____ERROR_;
- private static final String MSG_MISSING_START_TAG_ERROR = HTMLCoreMessages.No_start_tag____0_____ERROR_;
- private static final String MSG_MISSING_END_TAG_ERROR = HTMLCoreMessages.No_end_tag_____0_____ERROR_;
- private static final String MSG_UNNECESSARY_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_neede_ERROR_;
- private static final String MSG_UNDEFINED_TAG_ERROR = HTMLCoreMessages.Unknown_tag___0____ERROR_;
- private static final String MSG_MISMATCHED_TAG_ERROR = HTMLCoreMessages.Tag_name___0___uses_wrong__ERROR_;
- private static final String MSG_INVALID_TAG_ERROR = HTMLCoreMessages.Invalid_tag_name___0____ERROR_;
- private static final String MSG_INVALID_DIRECTIVE_ERROR = HTMLCoreMessages.Invalid_JSP_directive___0__ERROR_;
- private static final String MSG_INVALID_TEXT_ERROR = HTMLCoreMessages.Invalid_text_string___0____ERROR_;
- private static final String MSG_INVALID_CHAR_ERROR = HTMLCoreMessages.Invalid_character_used_in__ERROR_;
- private static final String MSG_UNKNOWN_ERROR = HTMLCoreMessages.Unknown_error__ERROR_;
- private static final String MSG_UNCLOSED_START_TAG_ERROR = HTMLCoreMessages.Start_tag____0____not_clos_ERROR_;
- private static final String MSG_UNCLOSED_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_close_ERROR_;
- private static final String MSG_MISMATCHED_ATTR_VALUE_ERROR = HTMLCoreMessages.Attribute_value___0___uses_ERROR_;
- private static final String MSG_UNCLOSED_COMMENT_ERROR = HTMLCoreMessages.Comment_not_closed__ERROR_;
- private static final String MSG_UNCLOSED_DOCTYPE_ERROR = HTMLCoreMessages.DOCTYPE_declaration_not_cl_ERROR_;
- private static final String MSG_UNCLOSED_PI_ERROR = HTMLCoreMessages.Processing_instruction_not_ERROR_;
- private static final String MSG_UNCLOSED_CDATA_SECTION_ERROR = HTMLCoreMessages.CDATA_section_not_closed__ERROR_;
- private static final String MSG_INVALID_EMPTY_ELEMENT_TAG = HTMLCoreMessages._ERROR_Tag___0___should_be_an_empty_element_tag_1;
- private static final String MSG_UNCLOSED_ATTR_VALUE_ERROR = HTMLCoreMessages._ERROR_Attribute_value___0___not_closed__1;
- private static final String MSG_RESOURCE_NOT_FOUND = HTMLCoreMessages._ERROR_Resource_not_found_0;
- private static final String MSG_OBSOLETE_ATTR_ERROR = HTMLCoreMessages.Obsolete_attribute_name___ERROR_;
- private static final String MSG_OBSOLETE_TAG_ERROR = HTMLCoreMessages.Obsolete_tag___ERROR_;
- private static final String MSG_INVALID_TEXT_IN_ELEM_ERROR = HTMLCoreMessages.Invalid_text_in_tag__ERROR_;
- private static final String MSG_MISSING_ATTR_VALUE_EQUALS_ERROR = HTMLCoreMessages.Missing_attribute_value_equals_ERROR_;
-
- private ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
-
-// static {
-// for (int i = 0; i < NodeType.MAX_TYPE; i++) {
-// errTables[i] = new ErrorTable();
-// }
-// // NOTE: The severities are just stub. They must be reviewed.
-// // -- 8/30/2001
-//
-// // attribute error map
-// ErrorTable attrTable = errTables[NodeType.ATTRIBUTE];// short hand
-// attrTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// attrTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_ATTR_ERROR, ValidationMessage.WARNING);
-// attrTable.put(UNDEFINED_VALUE_ERROR, MSG_UNDEFINED_VALUE_ERROR, ValidationMessage.WARNING);
-// attrTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_ATTR_ERROR, ValidationMessage.WARNING);
-// attrTable.put(INVALID_NAME_ERROR, MSG_INVALID_ATTR_ERROR, ValidationMessage.WARNING);
-// attrTable.put(INVALID_ATTR_ERROR, MSG_ATTR_NO_VALUE_ERROR, ValidationMessage.WARNING);
-// attrTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR, ValidationMessage.WARNING);
-// attrTable.put(MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR, ValidationMessage.ERROR);
-// //<<D210422
-// attrTable.put(UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR, ValidationMessage.WARNING);
-// //D210422
-// // element error map
-// ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
-// elemTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// elemTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-// elemTable.put(INVALID_NAME_ERROR, MSG_INVALID_TAG_ERROR, ValidationMessage.ERROR);
-// elemTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.WARNING);
-// elemTable.put(MISMATCHED_END_TAG_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.ERROR);
-// elemTable.put(MISSING_START_TAG_ERROR, MSG_MISSING_START_TAG_ERROR, ValidationMessage.ERROR);
-// elemTable.put(MISSING_END_TAG_ERROR, MSG_MISSING_END_TAG_ERROR, ValidationMessage.WARNING);
-// elemTable.put(UNNECESSARY_END_TAG_ERROR, MSG_UNNECESSARY_END_TAG_ERROR, ValidationMessage.WARNING);
-// elemTable.put(INVALID_DIRECTIVE_ERROR, MSG_INVALID_DIRECTIVE_ERROR, ValidationMessage.ERROR);
-// elemTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// elemTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.WARNING);
-// elemTable.put(COEXISTENCE_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// elemTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR, ValidationMessage.ERROR);
-// elemTable.put(UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR, ValidationMessage.ERROR);
-// elemTable.put(INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG, ValidationMessage.WARNING);
-//
-// // document type error map
-// ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
-// docTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// docTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.ERROR);
-// docTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// docTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR, ValidationMessage.ERROR);
-//
-// // text error map
-// ErrorTable textTable = errTables[NodeType.TEXT];
-// textTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// textTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR, ValidationMessage.WARNING);
-// textTable.put(INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR, ValidationMessage.WARNING);
-//
-// // comment error map
-// ErrorTable commTable = errTables[NodeType.COMMENT];
-// commTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// commTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// commTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR, ValidationMessage.ERROR);
-//
-// // cdata section error map
-// ErrorTable cdatTable = errTables[NodeType.CDATA_SECTION];
-// cdatTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// cdatTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// cdatTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR, ValidationMessage.ERROR);
-//
-// // processing instruction error map
-// ErrorTable piTable = errTables[NodeType.PROCESSING_INSTRUCTION];
-// piTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// piTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// piTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR, ValidationMessage.ERROR);
-//
-// // entity reference error map
-// ErrorTable erTable = errTables[NodeType.ENTITY_REFERENCE];
-// erTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-// erTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-// erTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-// }
-
- /**
- */
- public ValidationMessage createMessage(ErrorInfo info) {
- String errorMsg = getErrorMessage(info);
- int errorSeverity = getErrorSeverity(info);
- return new ValidationMessage(errorMsg, info.getOffset(), info.getLength(), errorSeverity);
- }
-
- private String getErrorMessage(ErrorInfo info) {
- ErrorTable tab = getErrorTable(info.getTargetType());
- if (tab == null)
- return MSG_UNKNOWN_ERROR;
-
- String template = tab.getMessage(info.getState());
- Object[] arguments = (info instanceof AbstractErrorInfo) ? ((AbstractErrorInfo) info).getMessageArguments() : new Object[] {info.getHint()};
- String s = null;
- try {
- s = NLS.bind(template, arguments);
- }
- catch (IllegalArgumentException e) {
- Logger.logException(e);
- s = template + ":" + arguments.toString(); //$NON-NLS-1$
- }
- return s;
- }
-
- /**
- */
- private int getErrorSeverity(ErrorInfo info) {
- ErrorTable tab = getErrorTable(info.getTargetType());
- if (tab == null)
- return 0;
- return tab.getSeverity(info.getState());
- }
-
- private ErrorTable getErrorTable(short nodetype) {
- ErrorTable tab = null;
- switch (nodetype) {
- case Node.ATTRIBUTE_NODE :
- tab = errTables[NodeType.ATTRIBUTE];
- break;
- case Node.ELEMENT_NODE :
- tab = errTables[NodeType.ELEMENT];
- break;
- case Node.DOCUMENT_TYPE_NODE :
- tab = errTables[NodeType.DOCUMENT_TYPE];
- break;
- case Node.TEXT_NODE :
- tab = errTables[NodeType.TEXT];
- break;
- case Node.COMMENT_NODE :
- tab = errTables[NodeType.COMMENT];
- break;
- case Node.CDATA_SECTION_NODE :
- tab = errTables[NodeType.CDATA_SECTION];
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- tab = errTables[NodeType.PROCESSING_INSTRUCTION];
- break;
- case Node.ENTITY_REFERENCE_NODE :
- tab = errTables[NodeType.ENTITY_REFERENCE];
- break;
- default :
- return null;
- }
- return tab;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
deleted file mode 100644
index 1bce59a6fd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
+++ /dev/null
@@ -1,198 +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.wst.html.core.internal.validate;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * This class encapsulates any used Module Core APIs along with fallbacks for
- * use on non-compliant projects and when those services are not available at
- * runtime.
- *
- * Because ModuleCore API calls can result in locks needing to be acquired,
- * none of these methods should be called while other thread locks have
- * already been acquired.
- */
-public final class ModuleCoreSupport {
- static final boolean _dump_NCDFE = false;
- private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static final IPath WEB_INF_PATH = new Path(WEB_INF);
-
- /**
- * @param project
- * @return the computed IPath to the "root" of the web contents, either
- * from facet knowledge or hueristics, or null if one can not be
- * determined
- */
- public static IPath computeWebContentRootPath(IPath path) {
- IPath root = null;
- try {
- root = ModuleCoreSupportDelegate.getWebContentRootPath(ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)));
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- if (root == null) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=213245
- *
- * NPE in JSPTaglibDirectiveContentAssistProcessor with
- * non-faceted project
- */
- root = getLocalRoot(path);
- }
- return root;
- }
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- public static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- IPath path = null;
- try {
- path = ModuleCoreSupportDelegate.getWebContentRootPath(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return path;
- }
-
- /**
- * @param path
- * - the full path to a resource within the workspace
- * @return - the runtime path of the resource if one exists, null
- * otherwise
- */
- public static IPath getRuntimePath(IPath path) {
- IPath result = null;
- try {
- result = ModuleCoreSupportDelegate.getRuntimePath(path);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- if (result == null) {
- IPath root = getLocalRoot(path);
- result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();
- }
- return result;
- }
-
- /**
- * @param basePath
- * - the full path to a resource within the workspace
- * @param reference
- * - the reference string to resolve
- * @return - the full path within the workspace that corresponds to the
- * given reference according to the virtual pathing support
- */
- public static IPath resolve(IPath basePath, String reference) {
- IPath resolvedPath = null;
- try {
- resolvedPath = ModuleCoreSupportDelegate.resolve(basePath, reference);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
-
- if (resolvedPath == null) {
- IPath rootPath = getLocalRoot(basePath);
- if (reference.startsWith(Path.ROOT.toString())) {
- resolvedPath = rootPath.append(reference);
- }
- else {
- resolvedPath = basePath.removeLastSegments(1).append(reference);
- }
- }
-
- return resolvedPath;
- }
-
- /**
- * @param basePath
- * @return the applicable Web context root path, if one exists
- */
- private static IPath getLocalRoot(IPath basePath) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-
- // existing workspace resources - this is the 93% case
- IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);
-
- // Try the base path as a folder first
- if (file == null && basePath.segmentCount() > 1) {
- file = workspaceRoot.getFolder(basePath);
- }
- // If not a folder, then try base path as a file
- if (file != null && !file.exists() && basePath.segmentCount() > 1) {
- file = workspaceRoot.getFile(basePath);
- }
-
- if (file == null && basePath.segmentCount() == 1) {
- file = workspaceRoot.getProject(basePath.segment(0));
- }
-
- if (file == null) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=116529
- *
- * This method produces a less accurate result, but doesn't
- * require that the file exist yet.
- */
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(basePath);
- if (files.length > 0)
- file = files[0];
- }
-
- while (file != null) {
- /**
- * Treat any parent folder with a WEB-INF subfolder as a web-app
- * root
- */
- IContainer folder = null;
- if ((file.getType() & IResource.FOLDER) != 0) {
- folder = (IContainer) file;
- }
- else {
- folder = file.getParent();
- }
- // getFolder on a workspace root must use a full path, skip
- if (folder != null && (folder.getType() & IResource.ROOT) == 0) {
- IFolder webinf = folder.getFolder(WEB_INF_PATH);
- if (webinf != null && webinf.exists()) {
- return folder.getFullPath();
- }
- }
- file = file.getParent();
- }
-
- return basePath.uptoSegment(1);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
deleted file mode 100644
index 818d340423..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
+++ /dev/null
@@ -1,151 +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 License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
- * bundles are not available, this class will not load, or if it does, its
- * methods will cause NoClassDefFoundErrors. This allows us to
- * compartmentalize the dependencies.
- *
- */
-final class ModuleCoreSupportDelegate {
- private static final String SLASH = "/";
- private static Map fResolvedMap = new HashMap();
-
- /**
- * @param path
- * - the full path to a resource within the workspace
- * @return - the runtime path of the resource if one exists, null
- * otherwise
- */
- static IPath getRuntimePath(IPath path) {
- if (path == null)
- return null;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
- if (virtualResources != null && virtualResources.length > 0) {
- return virtualResources[0].getRuntimePath();
- }
- return null;
- }
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- IPath path = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null && component.exists()) {
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
- return path;
- }
-
- /**
- * @param basePath
- * - the full path to a resource within the workspace
- * @param reference
- * - the reference string to resolve
- * @return - the full path within the workspace that corresponds to the
- * given reference according to the virtual pathing support
- */
- static IPath resolve(IPath basePath, String reference) {
- if (reference == null || basePath == null || basePath.segmentCount() == 0)
- return null;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- if (basePath.segmentCount() > 1) {
- /*
- * It can take the better part of a full second to do this, so
- * cache the result.
- */
- IPath resolved = null;
- Map mapForBaseResource = null;
- mapForBaseResource = (Map) fResolvedMap.get(basePath);
- if (mapForBaseResource != null) {
- Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
- if (resolvedReference != null)
- resolved = (IPath) resolvedReference.get();
- }
- else {
- mapForBaseResource = new HashMap();
- fResolvedMap.put(basePath, mapForBaseResource);
- }
-
- if (resolved == null) {
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
- for (int i = 0; i < virtualResources.length; i++) {
- IPath baseRuntimePath = virtualResources[i].getRuntimePath();
- IPath referenceRuntimePath = null;
- if (reference.startsWith(SLASH)) {
- referenceRuntimePath = new Path(reference);
- }
- else {
- referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
- }
- IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
- if (virtualFile != null && virtualFile.exists()) {
- IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
- for (int j = 0; j < underlyingFiles.length; j++) {
- if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
- mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
- resolved = underlyingFiles[j].getFullPath();
- }
-
- }
- }
- }
- }
- return resolved;
- }
- else {
- IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
- if (virtualFile != null && virtualFile.exists()) {
- return virtualFile.getUnderlyingFile().getFullPath();
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
deleted file mode 100644
index 164f67ea4c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class NamespaceValidator extends PrimeValidator implements ErrorState {
-
- private final static String XMLNS_PREFIX = "xmlns";//$NON-NLS-1$
- private final static String NS_SEPARATOR = ":";//$NON-NLS-1$
-
- public NamespaceValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return ((type == NamespaceValidator.class) || super.isAdapterForType(type));
- }
-
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (isXMLElement(target) && hasUnknownPrefix(target)) {
- IDOMElement e = (IDOMElement) target;
- if (!isValidPrefix(e.getPrefix(), target) && !e.isCommentTag()) {
- // report unknown tag error.
- Segment errorSeg = null;
- if (e.hasStartTag())
- errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
- else if (e.hasEndTag())
- errorSeg = FMUtil.getSegment(e, FMUtil.SEG_END_TAG);
-
- if (errorSeg != null)
- reporter.report(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, errorSeg, e));
- }
- }
- // (2) check prefix of each attr
- NamedNodeMap attrs = target.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node n = attrs.item(i);
- // some containers will contain languages that also use ':'
- if (!(n instanceof IDOMAttr) || ((IDOMAttr)n).getNameRegion() instanceof ITextRegionContainer)
- continue;
- IDOMAttr a = (IDOMAttr) n;
- String prefix = a.getPrefix();
- if ((prefix != null) && isUnknownAttr(a, target)) {
- // The attr has unknown prefix. So, check it.
- if (!isValidPrefix(prefix, target)) {
- // report unknown attr error.
- ITextRegion r = a.getNameRegion();
- if (r == null)
- continue;
- int a_offset = a.getNameRegionStartOffset();
- int a_length = a.getNameRegion().getLength();
- reporter.report(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, new Segment(a_offset, a_length), a));
- }
- }
- }
- }
-
- // private methods
- private boolean isXMLElement(Element target) {
- return target instanceof IDOMElement;
- }
-
- private boolean hasUnknownPrefix(Element target) {
- return isUnknownElement(target) && CMUtil.isForeign(target);
- }
-
- private boolean isUnknownElement(Element target) {
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- return dec == null;
- }
-
- private boolean isUnknownAttr(IDOMAttr attr, Element target) {
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- if (dec == null)
- return true; // unknown.
- CMNamedNodeMap adecls = dec.getAttributes();
- CMAttributeDeclaration adec = (CMAttributeDeclaration) adecls.getNamedItem(attr.getName());
- return adec == null;
- }
-
- private boolean isValidPrefix(String prefix, Element e) {
- if (prefix.equals(XMLNS_PREFIX))
- return true; // "xmlns:foo" attr is always valid.
-
- // (1) check the element has the namespace definition or not.
- if (isValidPrefixWithinElement(prefix, e))
- return true;
-
- // (2) check ancestors of the element have the namespace definition or not.
- Element parent = SMUtil.getParentElement(e);
- while (parent != null) {
- if (isValidPrefixWithinElement(prefix, parent))
- return true;
- parent = SMUtil.getParentElement(parent);
- }
- return false;
- }
-
- private boolean isValidPrefixWithinElement(String prefix, Element e) {
- String ns = XMLNS_PREFIX + NS_SEPARATOR + prefix;
- NamedNodeMap attrs = e.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node n = attrs.item(i);
- if (n == null)
- continue;
- if (n.getNodeType() != Node.ATTRIBUTE_NODE)
- continue;
- if (ns.equals(((Attr) n).getName()))
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java
deleted file mode 100644
index 165c4a656e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-/**
- * NullValidator class is intended to be a replacement of null
- * for ValidationComponent type.
- */
-final class NullValidator extends ValidationComponent {
-
- public NullValidator() {
- super();
- }
-
- public void validate(IndexedRegion node) {
- return;
- }
-
- public void setReporter(ValidationReporter reporter) {
- return;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java
deleted file mode 100644
index f9aa0e52db..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class PrimeValidator extends ValidationComponent {
-
- /**
- * PrimeValidator constructor comment.
- */
- public PrimeValidator() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java
deleted file mode 100644
index 8d3b9c066b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-final class SMUtil {
-
- private SMUtil() {
- super();
- }
-
- /* get an ancestor element ignoring implicit ones. */
- public static Element getParentElement(Node child) {
- if (child == null)
- return null;
-
- Node p = child.getParentNode();
- while (p != null) {
- if (p.getNodeType() == Node.ELEMENT_NODE) {
- return (Element) p;
- }
- p = p.getParentNode();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java
deleted file mode 100644
index 48baf4e227..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public class Segment {
-
- private int offset = 0;
- private int length = 0;
-
- /**
- */
- public Segment(int offset, int length) {
- super();
- this.offset = offset;
- this.length = length;
- }
-
- public Segment(IStructuredDocumentRegion region) {
- super();
- this.offset = region.getStartOffset();
- this.length = region.getLength();
- }
-
- /**
- * NOTE: 'start' and 'end' must be the start and end of the contiguous regions.
- * Otherwise, this class cannot work correctly.
- */
- public Segment(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
- super();
- this.offset = start.getStartOffset();
- int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
- this.length = endOffset - this.offset;
- }
-
- //public Segment(ITextRegion start, ITextRegion end) {
- // super();
- // this.offset = start.getStartOffset();
- // int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
- // this.length = endOffset - this.offset;
- //}
- /**
- */
- public int getLength() {
- return this.length;
- }
-
- /**
- */
- public int getOffset() {
- return this.offset;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
deleted file mode 100644
index 9265639e2e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.validate.ErrorInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-class SyntaxValidator extends PrimeValidator implements ErrorState {
-
-
- static private boolean isValidRegion(ITextRegion rgn) {
- String type = rgn.getType();
- if (type == null)
- return false; // no type is invalid.
- if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_NAME || type == DOMRegionContext.XML_TAG_CLOSE) {
- return true;
- }
- return false;
- }
-
- static private String getTagName(IStructuredDocumentRegion tag) {
- ITextRegionList regions = tag.getRegions();
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- if (rgn.getType() == DOMRegionContext.XML_TAG_NAME)
- return tag.getText(rgn);
- }
- return "";//$NON-NLS-1$
- }
-
- static private boolean isEmptyContent(CMElementDeclaration decl) {
- return (decl != null) && (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- public SyntaxValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return ((type == SyntaxValidator.class) || super.isAdapterForType(type));
- }
-
- class ElementInfo {
- public ElementInfo() {
- super();
- }
-
- public IDOMElement target = null;
- public CMElementDeclaration decl = null;
- public IStructuredDocumentRegion startTag = null;
- public IStructuredDocumentRegion endTag = null;
- public boolean hasStartTag() {return startTag != null;}
- public boolean hasEndTag() {return endTag != null;}
- public boolean isXHTML = false;
- public boolean isXHTML5 = false;
- }
-
- public void validate(IndexedRegion indexedNode) {
- Node node = (Node) indexedNode;
- validateChildren(node);
-
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return;
- if (!(node instanceof IDOMElement))
- return;
-
- ElementInfo info = new ElementInfo();
- info.target = (IDOMElement) node;
-
- // gather information to validate from target at once.
- getInfo(info);
-
- validateTags(info);
- if (info.target.isGlobalTag()) {
- validateNames(info);
- if (info.decl != null && info.isXHTML) {
- validateTagCase(info);
- }
- }
-
- //validate the syntax of the attributes
- validateAttributes(info);
- }
-
- private void getInfo(ElementInfo info) {
- info.decl = CMUtil.getDeclaration(info.target);
- info.startTag = info.target.getStartStructuredDocumentRegion();
- info.endTag = info.target.getEndStructuredDocumentRegion();
-
- Document doc = info.target.getOwnerDocument();
- if (!(doc instanceof IDOMDocument))
- return;
- String typeid = ((IDOMDocument) doc).getDocumentTypeId();
- if (typeid != null) {
- if (typeid.trim().length()!= 0){
- HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
- info.isXHTML = (entry != null && entry.isXMLType());
- }
- else {
- info.isXHTML = getXMLTarget(doc);
- info.isXHTML5 = info.isXHTML;
- }
- }
- }
-
- private boolean getXMLTarget(Document doc) {
- if (doc == null)
- return false;
- Node child = doc.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equalsIgnoreCase("html")){
- if (child.getAttributes()!= null){
- NamedNodeMap attrs = child.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Attr a = (Attr) attrs.item(i);
- if (a.getName().equalsIgnoreCase(HTML50Namespace.ATTR_NAME_XMLNS))
- return true;
- }
- }
- return false;
- }
-
- }
- child = child.getNextSibling();
- }
- return false;
- }
-
- class TagErrorInfoImpl extends AbstractErrorInfo {
- private String hint = null;
-
- public TagErrorInfoImpl(int state, IStructuredDocumentRegion tag, String hint) {
- super(state, new Segment(tag));
- this.hint = hint;
- }
-
- public String getHint() {
- return hint;
- }
-
- public short getTargetType() {
- return Node.ELEMENT_NODE;
- }
- }
-
- private boolean isEndTagCorrupted(ElementInfo info) {
- ITextRegionList regions = info.endTag.getRegions();
- if (regions == null || regions.isEmpty())
- return false;
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- if (!isValidRegion(rgn))
- return true; // found invalid region type.
- }
- return false; // all regions are valid.
- }
-
- private String getEndTagFullText(ElementInfo info) {
- String hint = "";//$NON-NLS-1$
- ITextRegionList regions = info.endTag.getRegions();
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- String type = rgn.getType();
- if (type == null)
- continue;
- if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_CLOSE)
- continue;
- hint += info.endTag.getFullText(rgn);
- }
- return hint;
- }
-
- private void reportCorruptedEndTagError(ElementInfo info) {
- String hint = getEndTagFullText(info);
- TagErrorInfoImpl error = new TagErrorInfoImpl(UNDEFINED_NAME_ERROR, info.endTag, hint);
- this.reporter.report(error);
- }
-
- private void validateTags(ElementInfo info) {
- if (info.hasStartTag()) {
- if (!info.target.isStartTagClosed()) {
- // Mark the whole START tag as an error segment.
- Segment errorSeg = new Segment(info.startTag);
- report(UNCLOSED_TAG_ERROR, errorSeg, info.target);
- }
- }
- else {
- if (info.hasEndTag()) {
- if (info.decl != null) {
- //if xhtml then must have end tag
- //else determine if end tag is omissible
- if (info.isXHTML) {
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG_NAME);
- report(MISSING_START_TAG_ERROR, errorSeg, info.target);
- } else {
- //determine if the end tag is omissible
- boolean canOmitStartTag = false;
- if(info.decl instanceof HTMLPropertyDeclaration) {
- int omitType = ((HTMLPropertyDeclaration)info.decl).getOmitType();
- canOmitStartTag = omitType == HTMLElementDeclaration.OMIT_BOTH;
- }
-
- if (!canOmitStartTag && !info.target.hasChildNodes()) {
- if (info.target.isContainer()) {
- // Set the error mark to the start of the element.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG);
- report(MISSING_START_TAG_ERROR, errorSeg, info.target);
- }
- else {
- // Mark the whole END tag as an error segment.
- Segment errorSeg = new Segment(info.endTag);
- report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- }
- }
- }
-
- if (info.hasEndTag()) {
- if (!info.target.isClosed()) {
- // Set the whole END tag as error segment.
- Segment errorSeg = new Segment(info.endTag);
- report(UNCLOSED_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- else {
- if (info.isXHTML) { // XHTML
- //if editor closed during validation this could be null
- IStructuredDocumentRegion structRegion = info.target.getStartStructuredDocumentRegion();
- if (!info.target.isEmptyTag() && structRegion != null && DOMRegionContext.XML_TAG_OPEN.equals(structRegion.getFirstRegion().getType())) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=248963 :
- * report empty tags not written as such, but only when
- * they follow actual XML/HTML syntax
- */
- if (isEmptyContent(info.decl)) {
- // EMPTY element should be written in <.../> form
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(INVALID_EMPTY_ELEMENT_TAG, errorSeg, info.target);
- }
- else {
- // end tag is required.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(MISSING_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- else { // HTML
- if (info.hasStartTag()) {
- if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl) && DOMRegionContext.XML_TAG_OPEN.equals(info.startTag.getFirstRegion().getType())) {
- // Set the error mark to the end of the element.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(MISSING_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- }
- }
-
- /* perform validation about tag name definition. */
- private void validateNames(ElementInfo info) {
- boolean corrupted = info.hasEndTag() && isEndTagCorrupted(info);
- if (info.decl == null) {
- // If no declaration is retrieved, the target is really
- // unknown element.
- if (!info.hasStartTag() && corrupted) {
- reportCorruptedEndTagError(info);
- }
- else {
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG_NAME);
- report(UNDEFINED_NAME_ERROR, errorSeg, info.target);
- }
- }
- else {
- // Even if a declaration could be retrieved, if the end
- // tag is corrupted, it should be reported as undefined
- // name. (D202493)
- if (corrupted) {
- reportCorruptedEndTagError(info);
- }
- }
- }
-
- /* perform validation tag case only for XHTML document */
- private void validateTagCase(ElementInfo info) {
- String declared = info.decl.getElementName();
- String startTagName = "";//$NON-NLS-1$
- String endTagName = "";//$NON-NLS-1$
- if (declared == null)
- return;
-
- if (info.isXHTML5){
- if (info.hasStartTag()) {
- startTagName = getTagName(info.startTag);
- if (info.hasEndTag()) {
- endTagName = getTagName(info.endTag);
- if (!endTagName.equals(startTagName)){
- TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
- this.reporter.report(error);
- }
- }
- }
-
- }
- else
- {
- // start tag
- if (info.hasStartTag()) {
- startTagName = getTagName(info.startTag);
- if (!declared.equals(startTagName)) {
- TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
- this.reporter.report(error);
- }
- }
- // end tag
- if (info.hasEndTag()) {
- endTagName = getTagName(info.endTag);
- if (!info.hasStartTag() || (!endTagName.equals(startTagName))) {
- if (!declared.equals(endTagName)) {
- TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
- this.reporter.report(error);
- }
- }
- }
- }
-
- }
-
- private void validateChildren(Node target) {
- if ((target.getNodeType() == Node.ELEMENT_NODE) && CMUtil.isForeign((Element) target))
- return;
-
- for (Node child = target.getFirstChild(); child != null; child = child.getNextSibling()) {
- switch (child.getNodeType()) {
- case Node.TEXT_NODE :
- {
- IDOMNode text = (IDOMNode) child;
- int charOffset = validateTextSource(text);
- if (charOffset >= 0) {
- charOffset += text.getStartOffset();
- Segment errorSeg = new Segment(charOffset, 1);
- if (errorSeg != null)
- report(INVALID_CHAR_ERROR, errorSeg, text);
- }
- break;
- }
- case Node.COMMENT_NODE :
- case Node.DOCUMENT_TYPE_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- case Node.CDATA_SECTION_NODE :
- {
- IDOMNode tag = (IDOMNode) child;
- if (!tag.isClosed()) {
- Segment errorSeg = FMUtil.getSegment(tag, FMUtil.SEG_WHOLE_TAG);
- if (errorSeg != null)
- report(UNCLOSED_TAG_ERROR, errorSeg, tag);
- }
- break;
- }
- default :
- break;
- }
- }
- }
-
- private int validateTextSource(IDOMNode text) {
- try {
- SourceValidator validator = new SourceValidator(text);
- validator.validateSource(text.getSource());
- }
- catch (InvalidCharacterException ex) {
- return ex.getOffset();
- }
- return -1;
- }
-
- /**
- * <p>Used to validate the syntax of the arguments in a tag.</p>
- *
- * @param info the <code>ElementInfo</code> about the tag to validate
- */
- private void validateAttributes(ElementInfo info) {
- if(info != null && info.hasStartTag()) {
- ITextRegionList list = info.startTag.getRegions();
-
- //for each region in the tag, these make up the arguments
- for(int i = 0; i < list.size(); ++i) {
- ITextRegion region = list.get(i);
- String type = region.getType();
-
- //if the type is undefined then there is a syntax error
- if(type == DOMRegionContext.UNDEFINED) {
- String invalidText = info.startTag.getFullText(region).trim();
- Segment errorSeg = new Segment(info.startTag.getStartOffset() + region.getStart(), invalidText.length());
- report(INVALID_TEXT_IN_ELEM_ERROR, errorSeg, info.target, new String[]{invalidText}, new String[0]);
- }
- }
- }
- }
-
- private void report(int state, Segment errorSeg, Node node) {
- ErrorInfo info = new ErrorInfoImpl(state, errorSeg, node);
- reporter.report(info);
- }
-
- private void report(int state, Segment errorSeg, Node node, String[] preTargetMsgInjections, String[] postTargetMsgInjections) {
- ErrorInfo info = new ErrorInfoImpl(state, errorSeg, node, preTargetMsgInjections, postTargetMsgInjections);
- reporter.report(info);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
deleted file mode 100644
index f5e98cdcf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.html.core.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- *
- * @since 1.1
- */
-public interface IHTMLPartitions {
-
- String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
- String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
- String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
- String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
- String SCRIPT_EVENTHANDLER = SCRIPT + ".EVENTHANDLER"; //$NON-NLS-1$
-
- /**
- * @deprecated this partition type is not used locally any longer
- */
- String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
- // ISSUE: I think meta tag areas are here too?
-}
diff --git a/bundles/org.eclipse.wst.html.ui/.classpath b/bundles/org.eclipse.wst.html.ui/.classpath
deleted file mode 100644
index ce55878876..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-html-validation"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/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/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.html.ui/.cvsignore b/bundles/org.eclipse.wst.html.ui/.cvsignore
deleted file mode 100644
index e4239f5540..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-htmleditor.jar
-temp.folder
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.html.ui/.options b/bundles/org.eclipse.wst.html.ui/.options
deleted file mode 100644
index 6d015ff08a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.html.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.html.ui/.project b/bundles/org.eclipse.wst.html.ui/.project
deleted file mode 100644
index 38bee736ad..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.html.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.html.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.wst.html.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ecc10e439c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Wed Mar 28 03:26:40 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.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.html.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.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.html.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.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 111184a517..0000000000
--- a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,52 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
-Bundle-Version: 1.0.602.qualifier
-Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.internal.validation;x-internal:=true,
- org.eclipse.wst.html.ui,
- org.eclipse.wst.html.ui.internal;x-internal:=true,
- org.eclipse.wst.html.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentoutline;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.correction;x-internal:=true,
- org.eclipse.wst.html.ui.internal.derived;x-internal:=true,
- org.eclipse.wst.html.ui.internal.edit.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.html.ui.internal.handlers;x-internal:=true,
- org.eclipse.wst.html.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.html.ui.internal.search;x-internal:=true,
- org.eclipse.wst.html.ui.internal.style;x-internal:=true,
- org.eclipse.wst.html.ui.internal.taginfo;x-internal:=true,
- org.eclipse.wst.html.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.html.ui.internal.text;x-internal:=true,
- org.eclipse.wst.html.ui.internal.wizard;x-internal:=true,
- org.eclipse.wst.html.ui.views.contentoutline
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.html.ui/about.html b/bundles/org.eclipse.wst.html.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.html.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>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.html.ui/build.properties b/bundles/org.eclipse.wst.html.ui/build.properties
deleted file mode 100644
index be98a59124..0000000000
--- a/bundles/org.eclipse.wst.html.ui/build.properties
+++ /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
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- templates/,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = src/,\
- src-html-validation/
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
deleted file mode 100644
index 8175aa93fb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
deleted file mode 100644
index 976e18d7cd..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
deleted file mode 100644
index b99b45cac1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
deleted file mode 100644
index f58992d6c8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
deleted file mode 100644
index 005fa99b46..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
deleted file mode 100644
index d143fcf621..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
deleted file mode 100644
index bbb40cb3f1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
deleted file mode 100644
index 3b139588c1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
deleted file mode 100644
index 65f516e80a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
deleted file mode 100644
index fb39ba6f9e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
deleted file mode 100644
index ef3235d170..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
deleted file mode 100644
index a988c1d5fb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
deleted file mode 100644
index 4084602119..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
deleted file mode 100644
index 5d1f81b6d4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
deleted file mode 100644
index b129090b16..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
deleted file mode 100644
index 5e7fb33399..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png b/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png
deleted file mode 100644
index a4fa448496..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
deleted file mode 100644
index 5d09597f3b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.properties
+++ /dev/null
@@ -1,85 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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 Web Tools Platform
-pluginName=HTML UI Source Editor
-HTML_Source_Page_Editor.name=HTML Editor
-WEB.name=Web
-HTML_Files.name=HTML Files
-HTML_Source.name=Editor
-HTML_Content_Assist.name=Content Assist
-HTML_Templates.name=Templates
-HTML_Styles.name=Styles
-HTML_Syntax_Coloring=Syntax Coloring
-HTML_Typing=Typing
-HTML_Validation=Validation
-HTML_Property_validation=HTML Syntax
-WebContentSettings.name=Web Content Settings
-Device_Profile_Entry_Provider_Extension.name=Device Profile Entry Provider Extension
-All_HTML_context_type_Extension_Element.name=All HTML
-HTML_New_context_type_Extension_Element.name=New HTML
-HTML_Tag_context_type_Extension_Element.name=HTML Tag
-HTML_Attribute_context_type_Extension_Element.name=HTML Attribute
-HTML_Attribute_value_context_type_Extension_Element.name=HTML Attribute value
-HTML_Syntax_Validator.name=HTML Syntax Validator
-###############################################################################
-#org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = HTML File
-_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML file
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-##
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectHistory_label=Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
-##
-preferenceKeywords.files=editor html creating saving files suffix specified encoding iana loading
-preferenceKeywords.source=editor html source formatting line width split multiple attributes new clear blank indent tabs spaces size content assist automatically suggestions prompt characters inserted strategy lax strict markup case code generation tag names capitalization uppercase lowercase
-preferenceKeywords.contentassist=html editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
-preferenceKeywords.templates=editor html templates snippet macros
-preferenceKeywords.styles=editor html style customize syntax highlighting type text content foreground background bold color
-preferenceKeywords.webcontent=editor html web content settings profile style document type doctype public system css
-preferenceKeywords.severities=html errors warnings ignore options severity severities suppress project specific projectspecific
-##
-HTML_Editors_target_name=HTML Editors
-
-scope.structured.text.editor.html.name=Editing HTML Source
-scope.structured.text.editor.html.description=Editing HTML Source
-scope.structured.text.editor.html.occurrences.name=HTML Source Occurrences
-scope.structured.text.editor.html.occurrences.description=HTML Source Occurrences
-
-Colors.scriptAreaBorder=Script Area Border
-hyperlinkDetector.anchor.name=Anchors
-hyperlink.target.script.name=HTML Client Script
-hyperlink.target.eventhandler.name=HTML Event Handlers
-
-proposalCategory.htmlTags=HTML Tag Proposals
-proposalCategory.htmlTemplates=HTML Template Proposals
-
-HideComments.label=Comments
-HideComments.description=Hides Comments \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
deleted file mode 100644
index fcca90e9ea..0000000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ /dev/null
@@ -1,750 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="deviceProfileEntryProvider" name="%Device_Profile_Entry_Provider_Extension.name" schema="schema/deviceProfileEntryProvider.exsd"/>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%HTML_Source_Page_Editor.name"
- icon="$nl$/icons/full/obj16/sourceEditor.gif"
- contributorClass="org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.html.core.htmlsource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.html.core.htmlsource" />
- </editor>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML"
- target="org.eclipse.wst.html.core.htmlsource" />
- <contentOutlineConfiguration
- class="org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration"
- target="org.eclipse.wst.html.core.htmlsource" />
- <quickOutlineConfiguration
- class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
- target="org.eclipse.wst.html.core.htmlsource"/>
- <propertySheetConfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.wst.html.core.htmlsource" />
- <documentationTextHover
- class="org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor"
- target="org.eclipse.wst.html.HTML_DEFAULT">
- </documentationTextHover>
- <provisionalConfiguration
- type="sourceeditingtexttools"
- class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.html.ui.internal.text.HTMLDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="foldingstrategy"
- class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
- class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
- target="org.eclipse.wst.html.HTML_DEFAULT" />
- <provisionalConfiguration
- type="autoeditstrategy"
- class="org.eclipse.wst.html.ui.internal.autoedit.StructuredAutoEditStrategyHTML"
- target="org.eclipse.wst.html.HTML_DEFAULT, org.eclipse.wst.html.HTML_DECLARATION" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.html.ui.preferences.html, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles,org.eclipse.wst.html.ui.preferences.validation, org.eclipse.wst.html.ui.preferences.contentassist"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalDefinition
- type="spellingregions"
- value="XML_COMMENT_TEXT, XML_CONTENT"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalDefinition
- type="activecontexts"
- value="org.eclipse.wst.html.core.htmlsource, org.eclipse.wst.html.occurrences, org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.selection, org.eclipse.wst.sse.comments"
- target="org.eclipse.wst.html.core.htmlsource" />
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.html.ui.internal.registry.AdapterFactoryProviderForHTML">
- <contentType id="org.eclipse.wst.html.core.htmlsource" />
- </adapterFactoryDescription>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="%WEB.name"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.EmptyFilePreferencePage"
- id="org.eclipse.wst.html.ui.preferences.web">
- </page>
- <!-- HTML PREFERENCE PAGES-->
- <page
- name="%HTML_Files.name"
- category="org.eclipse.wst.html.ui.preferences.web"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage"
- id="org.eclipse.wst.html.ui.preferences.html">
- <keywordReference id="org.eclipse.wst.html.ui.files"/>
- </page>
- <page
- name="%HTML_Source.name"
- category="org.eclipse.wst.html.ui.preferences.html"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLSourcePreferencePage"
- id="org.eclipse.wst.html.ui.preferences.source">
- <keywordReference id="org.eclipse.wst.html.ui.source"/>
- </page>
- <page
- category="org.eclipse.wst.html.ui.preferences.source"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLContentAssistPreferencePage"
- id="org.eclipse.wst.html.ui.preferences.contentassist"
- name="%HTML_Content_Assist.name">
- <keywordReference
- id="org.eclipse.wst.html.ui.contentassist">
- </keywordReference>
- </page>
- <page
- name="%HTML_Templates.name"
- category="org.eclipse.wst.html.ui.preferences.source"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTemplatePreferencePage"
- id="org.eclipse.wst.html.ui.preferences.templates">
- <keywordReference id="org.eclipse.wst.html.ui.templates"/>
- </page>
- <page
- name="%HTML_Syntax_Coloring"
- category="org.eclipse.wst.html.ui.preferences.source"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLSyntaxColoringPage"
- id="org.eclipse.wst.html.ui.preferences.styles">
- <keywordReference id="org.eclipse.wst.html.ui.styles"/>
- </page>
- <page
- name="%HTML_Validation"
- category="org.eclipse.wst.html.ui.preferences.html"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLValidationPreferencePage"
- id="org.eclipse.wst.html.ui.preferences.validation">
- </page>
- <page
- name="%HTML_Typing"
- category="org.eclipse.wst.html.ui.preferences.source"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTypingPreferencePage"
- id="org.eclipse.wst.html.ui.preferences.typing">
- </page>
- </extension>
- <!-- Web content settings -->
- <extension point="org.eclipse.ui.propertyPages">
- <!-- for dynamic web project -->
- <page
- name="%WebContentSettings.name"
- class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectWebContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="wst.web" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- <keywordReference id="org.eclipse.wst.html.ui.webcontent"/>
- </page>
- <page
- name="%WebContentSettings.name"
- class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IFile">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.wst.html.core.htmlsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspfragmentsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- <keywordReference id="org.eclipse.wst.html.ui.webcontent"/>
- </page>
- <page
- name="%HTML_Property_validation"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLValidationPreferencePage"
- id="org.eclipse.wst.html.ui.propertyPage.project.validation"
- category="ValidationPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
-
- </adapt>
- </enabledWhen>
- </page>
- </extension>
-
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.files"
- id="org.eclipse.wst.html.ui.files"/>
- <keyword
- label="%preferenceKeywords.source"
- id="org.eclipse.wst.html.ui.source"/>
- <keyword
- label="%preferenceKeywords.contentassist"
- id="org.eclipse.wst.html.ui.contentassist"/>
- <keyword
- label="%preferenceKeywords.templates"
- id="org.eclipse.wst.html.ui.templates"/>
- <keyword
- label="%preferenceKeywords.styles"
- id="org.eclipse.wst.html.ui.styles"/>
- <keyword
- label="%preferenceKeywords.webcontent"
- id="org.eclipse.wst.html.ui.webcontent"/>
- <keyword
- label="%preferenceKeywords.severities"
- id="org.eclipse.wst.html.ui.severities"/>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.wst.html.core.htmlsource.source">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.html.core.htmlsource.source">
- </part>
- </actionSetPartAssociation>
- </extension>
-
- <!-- Templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%All_HTML_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_all">
- </contextType>
- <contextType
- name="%HTML_New_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_new">
- </contextType>
- <contextType
- name="%HTML_Tag_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_tag">
- </contextType>
- <contextType
- name="%HTML_Attribute_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_attribute">
- </contextType>
- <contextType
- name="%HTML_Attribute_value_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_attribute_value">
- </contextType>
- <include
- file="templates/htmldefault-templates.xml"
- translations="$nl$/templates/htmldefault-templates.properties">
- </include>
- </extension>
-
- <!-- Define the HTML Contexts -->
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structured.text.editor.html.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.html.description"
- id="org.eclipse.wst.html.core.htmlsource">
- </context>
- <context
- name="%scope.structured.text.editor.html.occurrences.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.html.occurrences.description"
- id="org.eclipse.wst.html.occurrences">
- </context>
- </extension>
-
- <!-- initialize html ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceInitializer" />
- </extension>
-
- <!--======================================================================================-->
- <!-- Document provider for ExternalFileEditorInput -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.editors.documentProviders">
- <provider
- inputTypes="org.eclipse.wst.html.ui.internal.hyperlink.ExternalFileEditorInput"
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- id="org.eclipse.wst.html.ui.internal.ExternalFileDocumentProvider">
- </provider>
- </extension>
-
- <!--======================================================================================-->
- <!-- Workbench validation -->
- <!--======================================================================================-->
- <extension id="HTMLValidator" name="%HTML_Syntax_Validator.name" point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.eclipse.wst.html.internal.validation.HTMLValidator"
- manual="true"
- sourceid="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator"
- version="1"
- markerId="org.eclipse.wst.html.core.validationMarker">
- <include>
- <rules>
- <contentType id="org.eclipse.wst.html.core.htmlsource"></contentType>
- <fileext caseSensitive="false" ext="html"/>
- <fileext caseSensitive="false" ext="xhtml"/>
- <fileext caseSensitive="false" ext="htm"/>
- <fileext caseSensitive="false" ext="htpl"/>
- <fileext caseSensitive="false" ext="wml"/>
- </rules>
- </include>
- <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
- </validator>
- </extension>
-
- <!--======================================================================================-->
- <!-- As you type validation -->
- <!--======================================================================================-->
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.html.internal.validation.HTMLValidator"
- id="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.html.HTML_DECLARATION"/>
- <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>
-
- <!-- New HTML wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <wizard
- id="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
- name="%_UI_WIZARD_NAME"
- class="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
- category="org.eclipse.wst.web.ui"
- icon="$nl$/icons/full/etool16/newhtml_wiz.gif">
- <description>%_UI_WIZARD_CREATE_NEW_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <!-- Add new HTML wizard to Common Navigator -->
- <extension
- id="org.eclipse.wst.html.commonWizard.newHTML"
- point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard
- menuGroupId="org.eclipse.wst.web.ui"
- type="new"
- wizardId="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard">
- <enablement>
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <or>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="wst.web"/>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web"/>
- </or>
- </adapt>
- </or>
- </enablement>
- </commonWizard>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.html.core.htmlsource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <!-- <editorContribution
- id="org.eclipse.wst.html.core.htmlsource.source.editorActions"
- targetID="org.eclipse.wst.html.core.htmlsource.source">
- <action
- id="CleanupDocument"
- label="%CleanupDocument_label"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- tooltip="%CleanupDocument_tooltip"
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
- actionID="CleanupDocument">
- </action>
- <action
- id="ToggleComment"
- label="%ToggleComment_label"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- tooltip="%ToggleComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- actionID="ToggleComment">
- </action>
- <action
- id="AddBlockComment"
- label="%AddBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- tooltip="%AddBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- actionID="AddBlockComment">
- </action>
- <action
- id="RemoveBlockComment"
- label="%RemoveBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- tooltip="%RemoveBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- actionID="RemoveBlockComment">
- </action>
- <action
- id="FindOccurrences"
- label="%FindOccurrences_label"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesActionDelegate"
- actionID="FindOccurrences">
- </action>
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- actionID="StructureSelectEnclosing">
- </action>
- <action
- id="StructureSelectNext"
- label="%StructureSelectNext_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- tooltip="%StructureSelectNext_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- actionID="StructureSelectNext">
- </action>
- <action
- id="StructureSelectPrevious"
- label="%StructureSelectPrevious_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- tooltip="%StructureSelectPrevious_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>-->
- <editorContribution
- targetID="org.eclipse.wst.html.core.htmlsource.source"
- id="org.eclipse.wst.html.core.htmlsource.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction"/>
- </editorContribution>
- </extension>
-
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupDocumentHandler"
- commandId="org.eclipse.wst.sse.ui.cleanup.document">
- <activeWhen>
- <reference
- definitionId="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
- </reference>
- </activeWhen>
- <enabledWhen>
- <reference
- definitionId="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
- </reference>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.html.ui.internal.handlers.HTMLFindOccurrencesHandler"
- commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
- <activeWhen>
- <reference
- definitionId="org.eclipse.wst.html.ui.occurrences">
- </reference>
- </activeWhen>
- <enabledWhen>
- <reference
- definitionId="org.eclipse.wst.html.ui.occurrences">
- </reference>
- </enabledWhen>
- </handler>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
- <target
- id="org.eclipse.wst.html.core.htmlsource"
- name="%HTML_Editors_target_name"/>
- <target
- id="org.eclipse.wst.html.SCRIPT"
- name="%hyperlink.target.script.name"/>
- <target
- id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"
- name="%hyperlink.target.eventhandler.name"/>
- </extension>
-
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
- id="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
- name="%hyperlinkDetector.anchor.name"
- targetId="org.eclipse.core.runtime.xml">
- </hyperlinkDetector>
-
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.html.core.htmlsource"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.html.ui.occurrences">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.html.occurrences"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <!-- Define theme - Many of the color overrides and definitions come from
- the XML plugin -->
- <extension
- point="org.eclipse.ui.themes">
- <theme
- id="org.eclipse.ui.ide.systemDefault">
- <colorOverride
- id="SCRIPT_AREA_BORDER"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- </theme>
- <colorDefinition
- id="SCRIPT_AREA_BORDER"
- isEditable="false"
- label="%Colors.scriptAreaBorder"
- value="191, 95, 63">
- </colorDefinition>
- </extension>
-
- <!-- Enable the FormatHandler for HTML 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.html.ui.htmlContentType.definition"></reference>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.html.ui.htmlContentType.definition"></reference>
- </enabledWhen>
- </handler>
- </extension>
-
- <extension
- point="org.eclipse.wst.sse.ui.commentingStrategy">
- <blockCommentingStrategy
- prefix="&lt;!--"
- suffix="--&gt;">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource"
- associatedCommentPartitionTypeID="org.eclipse.wst.html.HTML_COMMENT">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.HTML_DECLARATION">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.xml.XML_PI">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- </extension>
- <!-- Set up a definition for HTML Content Types -->
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.html.ui.htmlContentType.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.wst.html.core.htmlsource" forcePluginActivation="true"/>
- </adapt>
- </iterate>
- </definition>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.html.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource"
- partitions="org.eclipse.wst.html.HTML_DEFAULT">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalCategory
- icon="icons/full/obj16/tag-generic.gif"
- id="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
- name="%proposalCategory.htmlTags">
- </proposalCategory>
- <proposalCategory
- icon="icons/full/obj16/tag-template.gif"
- id="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
- name="%proposalCategory.htmlTemplates">
- </proposalCategory>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
- class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer"
- id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
- class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTemplatesCompletionProposalComputer"
- id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT">
- </partitionType>
- </contentType>
- </proposalComputer>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.css.ui.proposalComputer.css">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.css.STYLE">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
- <categoriesConfiguration
- class="org.eclipse.wst.html.ui.internal.preferences.HTMLCompletionProposalCategoriesConfiguration"
- contentTypeID="org.eclipse.wst.html.core.htmlsource">
- </categoriesConfiguration>
- </extension>
-
-<extension
- point="org.eclipse.wst.sse.ui.outlineFilters">
- <filter
- targetId="org.eclipse.wst.html.ui.OutlinePage"
- name="%HideComments.label"
- enabled="false"
- description="%HideComments.description"
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLCommentFilter"
- id="org.eclipse.wst.html.ui.views.contentoutline.XMLCommentFilter">
- </filter>
-</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
deleted file mode 100644
index 742f82f5ab..0000000000
--- a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.html.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.html.ui" id="deviceProfileEntryProvider" name="Device Profile Entry Provider Extension"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="deviceProfileEntryProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="deviceProfileEntryProvider">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
deleted file mode 100644
index 4d1068c47c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.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;
-
-public class HTMLValidationReporter implements ValidationReporter {
-
- private IValidator owner = null;
- private IReporter reporter = null;
- private IFile file = null;
- private IStructuredModel model = null;
- private HTMLValidationResult result = null;
- 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;
-
- this.result = null;
-
- if (this.reporter != null) {
- this.reporter.removeAllMessages(this.owner, this.file);
- }
- else {
- // remove by myself?
- String id = HTMLValidator.class.getName();
- try {
- // TaskListHelper API changed
- // TaskListHelper.getTaskList().removeAllTasks(id, this.file,
- // null);
- TaskListHelper.getTaskList().removeAllTasks(this.file, id, null);
- }
- catch (CoreException ex) {
- }
- }
- }
-
-
- /**
- */
- public HTMLValidationResult getResult() {
- if (this.result == null)
- this.result = new HTMLValidationResult();
- return this.result;
- }
-
- /**
- */
- public void report(ValidationMessage message) {
- if (message == null || message.getSeverity() == ValidationMessage.IGNORE)
- return;
- IMessage mes = translateMessage(message);
-
- if (this.reporter != null) {
- this.reporter.addMessage(this.owner, mes);
- }
- else {
- if (this.file == null)
- return;
-
- // add by myself?
- String id = HTMLValidator.class.getName();
- String location = Integer.toString(mes.getLineNumber());
- String name = ""; //$NON-NLS-1$
- IPath filePath = this.file.getFullPath();
- if (filePath != null) {
- name = filePath.toString();
- }
- try {
- TaskListHelper.getTaskList().addTask(id, this.file, location, mes.getId(), mes.getText(), mes.getSeverity(), name, mes.getGroupName(), mes.getOffset(), mes.getLength());
- }
- catch (CoreException ex) {
- }
- }
- }
-
- /**
- * Translate ValidationMessage to IMessage and generate result log
- */
- private IMessage translateMessage(ValidationMessage message) {
- int severity = IMessage.LOW_SEVERITY;
- HTMLValidationResult result = getResult();
- switch (message.getSeverity()) {
- case ValidationMessage.ERROR :
- severity = IMessage.HIGH_SEVERITY;
- result.addError();
- break;
- case ValidationMessage.WARNING :
- severity = IMessage.NORMAL_SEVERITY;
- result.addWarning();
- break;
- case ValidationMessage.INFORMATION :
- result.addInformation();
- break;
- default :
-// result.addInformation();
- 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));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
deleted file mode 100644
index 26c5f0861e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-public class HTMLValidationResult {
- private int errors = 0;
- private int warnings = 0;
- private int informations = 0;
-
- /**
- */
- public HTMLValidationResult() {
- }
-
- /**
- */
- public void addError() {
- this.errors++;
- }
-
- /**
- */
- public void addInformation() {
- this.informations++;
- }
-
- /**
- */
- public void addWarning() {
- this.warnings++;
- }
-
- /**
- */
- public int getErrors() {
- return this.errors;
- }
-
- /**
- */
- public int getInformations() {
- return this.informations;
- }
-
- /**
- */
- public int getWarnings() {
- return this.warnings;
- }
-
- /**
- */
- public boolean isValid() {
- return (this.errors == 0 && this.warnings == 0 && this.informations == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
deleted file mode 100644
index 90bfde5134..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
-
-public class HTMLValidationWorkbenchHelper extends WorkbenchContext {
- /**
- */
- public HTMLValidationWorkbenchHelper() {
- super();
- }
-
- /**
- * When an IValidator associates a target object with an IMessage, the
- * WorkbenchReporter eventually resolves that target object with an
- * IResource. Sometimes more than one target object resolves to the same
- * IResource (usually the IProject, which is the default IResource when an
- * IFile cannot be found). This method is called, by the
- * WorkbenchReporter, so that the WorkbenchReporter can distinguish
- * between the IMessages which are on the same IResource, but refer to
- * different target objects. This is needed for the
- * removeAllMessages(IValidator, Object) method, so that when one target
- * object removes all of its messages, that it doesn't remove another
- * target object's messages.
- *
- * This method may return null only if object is null. Otherwise, an id
- * which can uniquely identify a particular object must be returned. The
- * id needs to be unique only within one particular IValidator.
- */
- public String getTargetObjectName(Object object) {
- if (object == null)
- return null;
- if (object instanceof IFile)
- return getPortableName((IFile) object);
- return object.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
deleted file mode 100644
index 77df2feae8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
-import org.eclipse.wst.html.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.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Text;
-
-public class HTMLValidator extends AbstractValidator implements IValidatorJob, ISourceValidator, IExecutableExtension {
- private static final String ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
-
- static boolean shouldValidate(IFile file) {
- IResource resource = file;
- do {
- if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || (resource.getName().charAt(0) == '.' && resource.getType() == IResource.FOLDER)) {
- return false;
- }
- resource = resource.getParent();
- }
- while ((resource.getType() & IResource.PROJECT) == 0);
- return true;
- }
-
- private IDocument fDocument;
- private IContentTypeManager fContentTypeManager;
- private IContentType[] fOtherSupportedContentTypes = null;
- private String[] fAdditionalContentTypesIDs = null;
- private IContentType fHTMLContentType;
-
- public HTMLValidator() {
- super();
- fContentTypeManager = Platform.getContentTypeManager();
- fHTMLContentType = fContentTypeManager.getContentType(ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE);
- }
-
- /**
- */
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
- /**
- * Gets list of content types this validator is interested in
- *
- * @return All HTML-related content types
- */
- private IContentType[] getOtherSupportedContentTypes() {
- if (fOtherSupportedContentTypes == null) {
- List contentTypes = new ArrayList(3);
- if (fAdditionalContentTypesIDs != null) {
- for (int i = 0; i < fAdditionalContentTypesIDs.length; i++) {
- IContentType type = Platform.getContentTypeManager().getContentType(fAdditionalContentTypesIDs[i]);
- if (type != null) {
- contentTypes.add(type);
- }
- }
- }
- fOtherSupportedContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
- }
- return fOtherSupportedContentTypes;
- }
-
-
- /**
- */
- protected IDOMModel getModel(IProject project, IFile file) {
- if (project == null || file == null)
- return null;
- if (!file.exists())
- return null;
- if (!canHandle(file))
- return null;
-
- IModelManager manager = StructuredModelManager.getModelManager();
- if (manager == null)
- return null;
-
- IStructuredModel model = null;
- try {
- file.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- try {
- try {
- model = manager.getModelForRead(file);
- }
- catch (UnsupportedEncodingException ex) {
- // retry ignoring META charset for invalid META charset
- // specification
- // recreate input stream, because it is already partially read
- model = manager.getModelForRead(file, new String(), null);
- }
- }
- catch (UnsupportedEncodingException ex) {
- }
- catch (IOException ex) {
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
-
- if (model == null)
- return null;
- if (!(model instanceof IDOMModel)) {
- releaseModel(model);
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- protected HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
- return new HTMLValidationReporter(this, reporter, file, model);
- }
-
- /**
- * Check file extension to validate
- */
- private boolean canHandle(IFile file) {
- boolean result = false;
- if (file != null) {
- try {
- IContentDescription contentDescription = file.getContentDescription();
- if (contentDescription != null) {
- IContentType fileContentType = contentDescription.getContentType();
- if (fileContentType.isKindOf(fHTMLContentType)) {
- result = true;
- }
- else {
- IContentType[] otherTypes = getOtherSupportedContentTypes();
- for (int i = 0; i < otherTypes.length; i++) {
- result = result || fileContentType.isKindOf(otherTypes[i]);
- }
- }
- }
- else if (fHTMLContentType != null) {
- result = fHTMLContentType.isAssociatedWith(file.getName());
- }
- }
- catch (CoreException e) {
- // should be rare, but will ignore to avoid logging "encoding
- // exceptions" and the like here.
- // Logger.logException(e);
- }
- }
- return result;
- }
-
- /**
- */
- private boolean hasHTMLFeature(IDOMDocument document) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return false;
- return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
- }
-
- /**
- */
- protected void releaseModel(IStructuredModel model) {
- if (model != null)
- model.releaseFromRead();
- }
-
- /**
- */
- public void validate(IValidationContext helper, IReporter reporter) {
- if (helper == null)
- return;
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
- String[] deltaArray = helper.getURIs();
- if (deltaArray != null && deltaArray.length > 0) {
- validateDelta(helper, reporter);
- }
- else {
- validateFull(helper, reporter);
- }
- }
-
- /**
- * This validate call is for the ISourceValidator partial document
- * validation approach
- *
- * @param dirtyRegion
- * @param helper
- * @param reporter
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-
- if (helper == null || fDocument == null)
- return;
-
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
-
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model == null)
- return; // error
-
- try {
-
- IDOMDocument document = null;
- if (model instanceof IDOMModel) {
- document = ((IDOMModel) model).getDocument();
- }
-
- if (document == null || !hasHTMLFeature(document)) {
- // handled in finally clause
- // model.releaseFromRead();
- return; //ignore
- }
-
- IPath filePath = null;
- IFile file = null;
-
- ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
- if (fb != null) {
- filePath = fb.getLocation();
-
- if (filePath.segmentCount() > 1) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
- if (!file.isAccessible()) {
- file = null;
- }
- }
- }
- else {
- filePath = new Path(model.getId());
- }
-
- // 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, filePath.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;
- }
- protected IndexedRegion getLargest(IStructuredDocumentRegion[] sdRegions) {
-
- if(sdRegions == null || sdRegions.length == 0)
- return null;
-
- IndexedRegion currentLargest = getCorrespondingNode(sdRegions[0]);
- for (int i = 0; i < sdRegions.length; i++) {
- if(!sdRegions[i].isDeleted()) {
- IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
-
- if(currentLargest instanceof Text)
- currentLargest = corresponding;
-
- if(corresponding != null) {
- if(!(corresponding instanceof Text)) {
- if (corresponding.getStartOffset() <= currentLargest.getStartOffset()
- && corresponding.getEndOffset() >= currentLargest.getEndOffset() )
- currentLargest = corresponding;
- }
- }
-
- }
- }
- return currentLargest;
- }
- protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- IndexedRegion indexedRegion = null;
- try {
- if (sModel != null)
- indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());
- } finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return indexedRegion;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void connect(IDocument document) {
- fDocument = document;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void disconnect(IDocument document) {
- fDocument = null;
- }
-
- /**
- */
- protected HTMLValidationResult validate(IDOMModel model, IFile file) {
- IProject prj = null;
- if (file != null) {
- prj = file.getProject();
- }
- if ((prj == null) && (model != null)) {
- URIResolver res = model.getResolver();
- if (res != null) {
- prj = res.getProject();
- }
- }
- final WorkbenchReporter reporter = new WorkbenchReporter(prj, new NullProgressMonitor());
- return validate(reporter, file, model);
- }
-
- /**
- */
- private HTMLValidationResult validate(IReporter reporter, IFile file, IDOMModel model) {
- if (file == null || model == null)
- return null; // error
- IDOMDocument document = model.getDocument();
- if (document == null)
- return null; // error
- if (!hasHTMLFeature(document))
- return null; // ignore
-
- INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
- ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
- if (adapter == null)
- return null; // error
-
- HTMLValidationReporter rep = getReporter(reporter, file, model);
- rep.clear();
- adapter.setReporter(rep);
- adapter.validate(document);
- return rep.getResult();
- }
-
- /**
- */
- private void validateContainer(IValidationContext helper, IReporter reporter, IContainer container) {
- try {
- IResource[] resourceArray = container.members(false);
- for (int i = 0; i < resourceArray.length; i++) {
- IResource resource = resourceArray[i];
- if (resource == null || reporter.isCancelled())
- continue;
- if (resource instanceof IFile) {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, resource.getFullPath().toString().substring(1));
- reporter.displaySubtask(this, message);
- validateFile(helper, reporter, (IFile) resource);
- }
- else if (resource instanceof IContainer) {
- validateContainer(helper, reporter, (IContainer) resource);
- }
- }
- }
- catch (CoreException ex) {
- }
- }
-
- /**
- */
- private void validateDelta(IValidationContext helper, IReporter reporter) {
- String[] deltaArray = helper.getURIs();
- for (int i = 0; i < deltaArray.length; i++) {
- String delta = deltaArray[i];
- if (delta == null)
- continue;
-
- if (reporter != null) {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, delta.substring(1));
- reporter.displaySubtask(this, message);
- }
-
- IResource resource = getResource(delta);
- if (resource == null || !(resource instanceof IFile))
- continue;
- validateFile(helper, reporter, (IFile) resource);
- }
- }
-
- /**
- */
- private void validateFile(IValidationContext helper, IReporter reporter, IFile file) {
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
- if (!shouldValidate(file)) {
- return;
- }
- IDOMModel model = getModel(file.getProject(), file);
- if (model == null)
- return;
-
- try {
- validate(reporter, file, model);
- }
- finally {
- releaseModel(model);
- }
- }
-
- /**
- */
- private void validateFull(IValidationContext helper, IReporter reporter) {
- IProject project = null;
- String[] fileDelta = helper.getURIs();
- if (helper instanceof IWorkbenchContext) {
- IWorkbenchContext wbHelper = (IWorkbenchContext) helper;
- project = wbHelper.getProject();
- }
- else if(fileDelta.length > 0){
- // won't work for project validation (b/c nothing in file delta)
- project = getResource(fileDelta[0]).getProject();
- }
- if (project == null)
- return;
- validateContainer(helper, reporter, project);
- }
-
- /*
- * added to get rid or dependency on IWorkbenchHelper
- *
- */
- public IResource getResource(String delta) {
- Path path = new Path(delta);
- if (path.segmentCount() > 1)
- return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (path.segmentCount() == 1)
- return ResourcesPlugin.getWorkspace().getRoot().getProject(delta);
- return null;
- }
-
- public ISchedulingRule getSchedulingRule(IValidationContext helper) {
- return null;
- }
-
- public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
- // Exception catching was removed, see
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=123600
- IStatus status = Status.OK_STATUS;
- validate(helper, reporter);
- return status;
- }
-
- /**
- * @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 {
- fAdditionalContentTypesIDs = new String[0];
- if (data != null) {
- if (data instanceof String && data.toString().length() > 0) {
- fAdditionalContentTypesIDs = StringUtils.unpack(data.toString());
- }
- }
- }
-
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE)
- return null;
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- validateFile(null, reporter, (IFile) resource);
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
deleted file mode 100644
index 1e3872945f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.core.Message;
-
-/**
- * copied from org.eclipse.wst.validation.internal.operations.LocalizedMessage
- *
- * This class is provided for validators which run only in Eclipse and whose messages, because they
- * come from another tool, are already localized. LocalizedMessage cannot be used by any validator
- * which needs to run in both WebSphere and Eclipse.
- */
-public class LocalizedMessage extends Message {
- private String _message = null;
-
- public LocalizedMessage(int severity, String messageText) {
- this(severity, messageText, null);
- }
-
- public LocalizedMessage(int severity, String messageText, IResource targetObject) {
- this(severity, messageText, (Object) targetObject);
- }
-
- public LocalizedMessage(int severity, String messageText, Object targetObject) {
- super(null, severity, null);
- setLocalizedMessage(messageText);
- setTargetObject(targetObject);
- }
-
- public void setLocalizedMessage(String message) {
- _message = message;
- }
-
- public String getLocalizedMessage() {
- return _message;
- }
-
- public String getText() {
- return getLocalizedMessage();
- }
-
- public String getText(ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l, ClassLoader cl) {
- return getLocalizedMessage();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
deleted file mode 100644
index 71ede2d9d7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- *
- * Class to help this Problem's list.
- *
- */
-class TaskListHelper {
- private static TaskListHelper _taskListHelper = null;
-
- public static TaskListHelper getTaskList() {
- if (_taskListHelper == null) {
- _taskListHelper = new TaskListHelper();
- }
- return _taskListHelper;
- }
-
- /**
- * This method adds a message to a resource in the task list.
- */
- public void addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
- TaskListUtility.addTask(pluginId, resource, location, messageId, message, markerType, targetObjectName, groupName, offset, length);
- }
-
- /**
- * This method removes all messages from a resource in the task list.
- */
- public void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
- TaskListUtility.removeAllTasks(resource, owner, objectName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
deleted file mode 100644
index 3de0a92f1b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * This class must be called only by the validation framework.
- *
- * This singleton interacts with the eclipse workbench's Task list.
- * TaskListUtility adds and removes tasks from the list.
- *
- * This class must not be called outside of an IWorkspaceRunnable or
- * IRunnableWithProgress. Many resource deltas can be generated by the methods
- * in this class.
- *
- * This came from TaskListUtility
- */
-public class TaskListUtility {
- // private static final String PLUGIN_ID = ValidationPlugin.PLUGIN_ID;
- private static final String PLUGIN_ID = HTMLUIPlugin.ID;
- private static final String VALIDATION_MARKER = PLUGIN_ID + ".problemmarker"; //$NON-NLS-1$ // The extension which is used to add validation markers to the task list
- private static final String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$ // The IValidator who owns the IMarker on the task list
- private static final String VALIDATION_MARKER_SEVERITY = "validationSeverity"; //$NON-NLS-1$ // one of the IMessage values
- private static final String VALIDATION_MARKER_TARGETOBJECT = "targetObject"; //$NON-NLS-1$ // When more than one target object resolves to the same IResource, this field identifies which targetObject owns a particular message.
- private static final String VALIDATION_MARKER_GROUP = "groupName"; //$NON-NLS-1$ // For incremental validation, this field associates a message with a group, so that a subset of messages may be removed from a file.
- private static final String VALIDATION_MARKER_MESSAGEID = "messageId"; //$NON-NLS-1$ // Persist the message id of the message, not just the translated text.
- private static final int DEPTH_INFINITE = IResource.DEPTH_INFINITE;
- private static final int DEPTH_ZERO = IResource.DEPTH_ZERO;
- private final static IMarker[] NO_MARKERS = new IMarker[0];
-
- /**
- * This method adds a message to a resource in the task list.
- */
- public static IMarker addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
- if ((message == null) || (resource == null)) {
- return null;
- }
-
- int severity = getSeverity(markerType);
-
- // Allow duplicate entries in the task list.
- // Prior to a full validation, the validation framework will remove
- // all messages owned
- // by a validator before it is executed.
- // Prior to an incremental validation, the validation framework will
- // remove all messages,
- // on each of the changed resources, owned by a validator before it is
- // invoked.
- //
- // It is up to the validator to make sure that it is not adding the
- // same message
- // in more than one place, and also to clear out any old messages
- // which are not cleared
- // by the validation framework.
- IMarker item = resource.createMarker(VALIDATION_MARKER); // add a
- // validation
- // marker
-
- // For performance reasons, replace the multiple setAttribute
- // calls above with a single setAttributes call.
- boolean offsetSet = ((offset != IMessage.OFFSET_UNSET) && (length != IMessage.OFFSET_UNSET));
- int size = (offsetSet) ? 10 : 8; // add CHAR_START, CHAR_END only
- // if the offset is set. If the
- // offset is set, it takes
- // precendence over the line
- // number. (eclipse's rule, not
- // mine.)
- String[] attribNames = new String[size];
- Object[] attribValues = new Object[size];
-
- // Very first thing, add the owner. That way, if the code dies
- // before things are persisted, hopefully this marker will be
- // persisted.
- // Hopefully, eclipse WILL persist this field, as requested.
- attribNames[0] = VALIDATION_MARKER_OWNER;
- attribValues[0] = pluginId;
- attribNames[1] = VALIDATION_MARKER_SEVERITY; // this validation
- // severity is stored,
- // in addition to the
- // marker severity, to
- // enable more than
- // one severity of
- // message to be
- // displayed. e.g.
- // ERROR | WARNING
- // (using binary OR).
- // The IMarker
- // constants are
- // regular decimal
- // constants.
- attribValues[1] = new Integer(markerType);
- attribNames[2] = VALIDATION_MARKER_TARGETOBJECT; // to distinguish
- // between
- // messages which
- // are registered
- // on an
- // IResource, but
- // against
- // different
- // target objects
- attribValues[2] = ((targetObjectName == null) ? "" : targetObjectName); //$NON-NLS-1$
- attribNames[3] = VALIDATION_MARKER_GROUP;
- attribValues[3] = ((groupName == null) ? "" : groupName); //$NON-NLS-1$
- attribNames[4] = IMarker.MESSAGE;
- attribValues[4] = message;
- attribNames[5] = VALIDATION_MARKER_MESSAGEID;
- attribValues[5] = messageId;
-
- attribNames[6] = IMarker.SEVERITY; // IMarker.SEVERITY_ERROR,
- // IMarker.SEVERITY_WARNING,
- // IMarker.SEVERITY_INFO
- attribValues[6] = new Integer(severity);
- try {
- // If the location is a line number, store it as a line number
- Integer lineNumber = Integer.valueOf(location);
- attribNames[7] = IMarker.LINE_NUMBER;
- attribValues[7] = lineNumber;
- }
- catch (NumberFormatException exc) {
- // Otherwise, store it as a text location
- attribNames[7] = IMarker.LOCATION;
- attribValues[7] = location;
- }
-
- if (offsetSet) {
- attribNames[8] = IMarker.CHAR_START;
- attribValues[8] = new Integer(offset);
- attribNames[9] = IMarker.CHAR_END;
- attribValues[9] = new Integer(offset + length);
- }
-
- item.setAttributes(attribNames, attribValues);
-
- return item;
- }
-
- /**
- * Given one of the SeverityEnum severities, return the IMarker severity
- * int that is its equivalent.
- */
- private static int getSeverity(int severityEnumValue) {
- switch (severityEnumValue) {
- case (IMessage.HIGH_SEVERITY) : {
- return IMarker.SEVERITY_ERROR;
- }
-
- case (IMessage.LOW_SEVERITY) : {
- return IMarker.SEVERITY_INFO;
- }
-
- case (IMessage.NORMAL_SEVERITY) : {
- return IMarker.SEVERITY_WARNING;
- }
-
- case (IMessage.ALL_MESSAGES) :
- case (IMessage.ERROR_AND_WARNING) :
- default : {
- // assume it's a warning.
- return IMarker.SEVERITY_WARNING;
- }
- }
- }
-
- private static int getDepth(IResource resource) {
- if (resource instanceof IProject) {
- return DEPTH_INFINITE; // DEPTH_INFINITE means get this project's
- // markers, and the markers belonging to
- // the project's children.
- }
- else if (resource instanceof IWorkspaceRoot) {
- // Needed for the ValidationMigrator when it checks for orphan
- // tasks.
- return DEPTH_INFINITE; // DEPTH_INFINITE means get all of the
- // markers in the workspace
- }
-
- return DEPTH_ZERO; // DEPTH_ZERO means just this resource, not its
- // children
- }
-
- private static IMarker[] getValidationTasks(IResource resource, int severity, int depth) {
- IMarker[] tempMarkers = null;
- int validCount = 0;
- try {
- IMarker[] allMarkers = null;
- try {
- allMarkers = resource.findMarkers(VALIDATION_MARKER, false, depth); // false
- // means
- // only
- // consider
- // PROBLEM_MARKER,
- // not
- // variants
- // of
- // PROBLEM_MARKER.
- // Since
- // addTask
- // only
- // adds
- // PROBLEM_MARKER,
- // we
- // don't
- // need
- // to
- // consider
- // its
- // subtypes.
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(IResource,
- // int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- return NO_MARKERS;
- }
-
- // Now filter in the markers, based on severity type.
- if (allMarkers.length != 0) {
- tempMarkers = new IMarker[allMarkers.length];
- for (int i = 0; i < allMarkers.length; i++) {
- IMarker marker = allMarkers[i];
- Integer filterSeverity = (Integer) marker.getAttribute(VALIDATION_MARKER_SEVERITY);
- if (filterSeverity == null) {
- // odd...marker wasn't created correctly. How could
- // this happen?
- // Default to the current severity and add it to the
- // list.
- try {
- marker.setAttribute(IMarker.SEVERITY, getSeverity(severity));
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry =
- // ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- continue;
- }
- catch (Exception exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry =
- // ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- continue;
- }
- }
- else if ((severity & filterSeverity.intValue()) == 0) {
- continue;
- }
- tempMarkers[validCount++] = marker;
- }
- }
- }
- catch (CoreException exc) {
- // Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- }
-
- if (validCount == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] validMarkers = new IMarker[validCount];
- System.arraycopy(tempMarkers, 0, validMarkers, 0, validCount);
- return validMarkers;
- }
-
- private static IMarker[] getValidationTasks(IResource resource, String[] messageOwners, int depth) {
- IMarker[] markers = getValidationTasks(resource, IMessage.ALL_MESSAGES, depth);
- if (markers.length == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] temp = new IMarker[markers.length];
- int validCount = 0;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
-
- try {
- Object owner = marker.getAttribute(VALIDATION_MARKER_OWNER);
- if ((owner == null) || !(owner instanceof String)) {
- // The ValidationMigrator will remove any "unowned"
- // validation markers.
- continue;
- }
-
- for (int j = 0; j < messageOwners.length; j++) {
- String messageOwner = messageOwners[j];
- if (((String) owner).equals(messageOwner)) {
- temp[validCount++] = marker;
- break;
- }
- }
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(project,
- // String[])"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- return NO_MARKERS;
- }
- }
-
- IMarker[] result = new IMarker[validCount];
- System.arraycopy(temp, 0, result, 0, validCount);
- return result;
- }
-
- /**
- * This method retrieves all validation tasks from the resource. If depth
- * is INFINITE, child tasks are returned as well. Only the tasks which are
- * owned by the specified messageOwner, and apply to the named IMessage's
- * target object (objectName) will be returned.
- */
- private static IMarker[] getValidationTasks(IResource resource, String[] messageOwner, String objectName, String groupName, int depth) throws CoreException {
- if ((messageOwner == null) || (resource == null)) {
- return NO_MARKERS;
- }
-
- int validCount = 0;
- IMarker[] validList = null;
- IMarker[] markers = getValidationTasks(resource, messageOwner, depth);
- if (markers != null) {
- validList = new IMarker[markers.length];
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
-
- // If more than one target object resolves to the same
- // resource, removing one target's
- // messages should not remove the other target object's
- // messages.
- if (objectName != null) {
- Object targetObject = marker.getAttribute(VALIDATION_MARKER_TARGETOBJECT);
- if ((targetObject == null) || !(targetObject instanceof String) || !(((String) targetObject).equals(objectName))) {
- continue;
- }
- }
-
- if (groupName != null) {
- Object group = marker.getAttribute(VALIDATION_MARKER_GROUP);
- if ((group == null) || !(group instanceof String) || !(((String) group).equals(groupName))) {
- continue;
- }
- }
-
- validList[validCount++] = marker;
- }
- }
-
- if (validCount == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] result = new IMarker[validCount];
- System.arraycopy(validList, 0, result, 0, validCount);
- return result;
- }
-
- /**
- * This method removes all messages from a resource in the task list.
- */
- public static void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
- removeAllTasks(resource, new String[]{owner}, objectName);
- }
-
- public static void removeAllTasks(IResource resource, String[] owners, String objectName) throws CoreException {
- removeAllTasks(resource, owners, objectName, getDepth(resource));
- }
-
- protected static void removeAllTasks(IResource resource, String[] owners, String objectName, int depth) throws CoreException {
- removeTaskSubset(resource, owners, objectName, null, depth); // null
- // means
- // no
- // group
- // name
- }
-
- /**
- * This method removes a subset of tasks from the project, including child
- * tasks. Every task which belongs to the group, identified by groupName,
- * will be removed.
- */
- protected static void removeTaskSubset(IResource resource, String[] owners, String objectName, String groupName, int depth) throws CoreException {
- if ((owners == null) || (resource == null)) {
- return;
- }
-
- IMarker[] allTasks = getValidationTasks(resource, owners, objectName, groupName, depth);
- if (allTasks.length > 0) {
- ResourcesPlugin.getWorkspace().deleteMarkers(allTasks);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
deleted file mode 100644
index a38409f1f9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor;
-import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
-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.internal.text.rules.StructuredTextPartitionerForXML;
-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.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Configuration for a source viewer which shows HTML content.
- * <p>
- * Clients can subclass and override just those methods which must be specific
- * to their needs.
- * </p>
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- * @since 1.0
- */
-public class StructuredTextViewerConfigurationHTML extends StructuredTextViewerConfiguration {
- /*
- * One instance per configuration because not sourceviewer-specific and
- * it's a String array
- */
- private String[] fConfiguredContentTypes;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForEmbeddedCSS;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForHTML;
- /*
- * One instance per configuration
- */
- private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
- private ILabelProvider fStatusLineLabelProvider;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationHTML
- */
- public StructuredTextViewerConfigurationHTML() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- // be sure this is added last in list, so it has a change to modify
- // previous results.
- // add auto edit strategy that handles when tab key is pressed
- allStrategies.add(new AutoEditStrategyForTabs());
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
- String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
- fConfiguredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
-
- fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
- fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
-
- int index = 0;
- System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
- System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index += xmlTypes.length, htmlTypes.length);
- }
-
- return fConfiguredContentTypes;
- }
-
- protected IContentAssistProcessor[] getContentAssistProcessors(
- ISourceViewer sourceViewer, String partitionType) {
-
- IContentAssistProcessor processor = new HTMLStructuredContentAssistProcessor(
- this.getContentAssistant(), partitionType, sourceViewer);
- return new IContentAssistProcessor[]{processor};
- }
-
- 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), IHTMLPartitions.HTML_DEFAULT);
- ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-
- return formatter;
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (contentType == IHTMLPartitions.HTML_DEFAULT) {
- // use xml's doubleclick strategy
- return getXMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IXMLPartitions.XML_DEFAULT);
- }
- else
- return super.getDoubleClickStrategy(sourceViewer, contentType);
-
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- Vector vector = new Vector();
-
- // prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- boolean useSpaces = HTMLCorePreferenceNames.SPACE.equals(indentCharPref);
-
- for (int i = 0; i <= indentationWidth; i++) {
- StringBuffer prefix = new StringBuffer();
- boolean appendTab = false;
-
- if (useSpaces) {
- for (int j = 0; j + i < indentationWidth; j++)
- prefix.append(' ');
-
- if (i != 0)
- appendTab = true;
- }
- else {
- for (int j = 0; j < i; j++)
- prefix.append(' ');
-
- if (i != indentationWidth)
- appendTab = true;
- }
-
- if (appendTab) {
- prefix.append('\t');
- vector.add(prefix.toString());
- // remove the tab so that indentation - tab is also an indent
- // prefix
- prefix.deleteCharAt(prefix.length() - 1);
- }
- vector.add(prefix.toString());
- }
-
- vector.add(""); //$NON-NLS-1$
-
- return (String[]) vector.toArray(new String[vector.size()]);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
-
- // workaround IXMLPartitions.XML_PI
- if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
- providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
- }
- else if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
- providers = new LineStyleProvider[]{getLineStyleProviderForEmbeddedCSS()};
- }
-
- return providers;
- }
-
- private LineStyleProvider getLineStyleProviderForEmbeddedCSS() {
- if (fLineStyleProviderForEmbeddedCSS == null) {
- fLineStyleProviderForEmbeddedCSS = new LineStyleProviderForEmbeddedCSS();
- }
- return fLineStyleProviderForEmbeddedCSS;
- }
-
- private LineStyleProvider getLineStyleProviderForHTML() {
- if (fLineStyleProviderForHTML == null) {
- fLineStyleProviderForHTML = new LineStyleProviderForHTML();
- }
- return fLineStyleProviderForHTML;
- }
-
- public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
- if (fStatusLineLabelProvider == null) {
- fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
- public String getText(Object element) {
- if (element == null)
- return null;
-
- StringBuffer s = new StringBuffer();
- Node node = (Node) element;
- while (node != null) {
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, super.getText(node));
- }
-
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- node = ((Attr) node).getOwnerElement();
- else
- 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(ContentTypeIdForHTML.ContentTypeID_HTML, null);
-
- // also add xml since there could be xml content in html
- // (just hope the hyperlink detectors will do additional checking)
- targets.put(ContentTypeIdForXML.ContentTypeID_XML, null);
- return targets;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
deleted file mode 100644
index e1f4b83fda..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML UI
- *
- * @plannedfor 1.0
- */
-public class HTMLUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.html.ui.internal.HTMLUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
- }
-
- private HTMLUIMessages() {
- // cannot create new instance of this class
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- public static String Sample_HTML_doc;
- public static String HTMLFilesPreferencePage_0;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _ERROR_FILENAME_MUST_END_HTML;
- public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
- public static String ResourceGroup_nameExists;
- public static String NewHTMLTemplatesWizardPage_0;
- public static String NewHTMLTemplatesWizardPage_1;
- public static String NewHTMLTemplatesWizardPage_2;
- public static String NewHTMLTemplatesWizardPage_3;
- public static String NewHTMLTemplatesWizardPage_4;
- public static String NewHTMLTemplatesWizardPage_5;
- public static String NewHTMLTemplatesWizardPage_6;
- public static String NewHTMLTemplatesWizardPage_7;
- public static String Creating_files_encoding;
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String CleanupDocument_description; // resource bundle
- public static String ToggleComment_label; // resource bundle
- public static String ToggleComment_tooltip; // resource bundle
- public static String ToggleComment_description; // resource bundle
- public static String Add_inline;
- public static String AddBlockComment_label; // resource bundle
- public static String AddBlockComment_tooltip; // resource bundle
- public static String AddBlockComment_description; // resource bundle
- public static String Remove_inline;
- public static String RemoveBlockComment_label; // resource bundle
- public static String RemoveBlockComment_tooltip; // resource bundle
- public static String RemoveBlockComment_description; // resource bundle
- public static String FindOccurrences_label; // resource bundle
- public static String Creating_files;
- public static String Elements_Dialog_message;
- public static String Elements_Dialog_title;
- public static String Encoding_desc;
- public static String UI_Description_of_role_of_following_DOCTYPE;
- public static String UI_Default_HTML_DOCTYPE_ID___1;
- public static String UI_Public_ID;
- public static String UI_System_ID;
- public static String UI_none;
- public static String UI_CSS_profile___2;
- public static String WebContentSettingsPropertyPage_0;
- public static String ProjectWebContentSettingsPropertyPage_0;
-
- public static String Auto_Activation_UI_;
- public static String Auto_Activation_Delay;
- public static String Automatically_make_suggest_UI_;
- public static String Prompt_when_these_characte_UI_;
- public static String Cycling_UI_;
- public static String Formatting_UI_;
- public static String Line_width__UI_;
- public static String Split_multiple_attributes;
- public static String Align_final_bracket;
- public static String Indent_using_tabs;
- public static String Indent_using_spaces;
- public static String Indentation_size;
- public static String Indentation_size_tip;
- public static String Inline_elements_table_label;
- public static String Clear_all_blank_lines_UI_;
- public static String Preferred_markup_case_UI_;
- public static String Tag_names__UI_;
- public static String Tag_names_Upper_case_UI_;
- public static String Tag_names_Lower_case_UI_;
- public static String Attribute_names__UI_;
- public static String Attribute_names_Upper_case_UI_;
- public static String Attribute_names_Lower_case_UI_;
- public static String Cleanup_UI_;
- public static String Tag_name_case_for_HTML_UI_;
- public static String Tag_name_case_As_is_UI_;
- public static String Tag_name_case_Lower_UI_;
- public static String Tag_name_case_Upper_UI_;
- public static String Attribute_name_case_for_HTML_UI_;
- public static String Attribute_name_case_As_is_UI_;
- public static String Attribute_name_case_Lower_UI_;
- public static String Attribute_name_case_Upper_UI_;
- public static String Insert_required_attributes_UI_;
- public static String Insert_missing_tags_UI_;
- public static String Quote_attribute_values_UI_;
- public static String Format_source_UI_;
- public static String Convert_EOL_codes_UI_;
- public static String EOL_Windows_UI;
- public static String EOL_Unix_UI;
- public static String EOL_Mac_UI;
- public static String 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;
-
- // below are possibly unused strings that may be deleted
- public static String HTMLFilesPreferencePage_1;
- public static String HTMLFilesPreferencePage_2;
- public static String HTMLFilesPreferencePage_3;
- // above are possibly unused strings that may be deleted
- public static String EmptyFilePreferencePage_0;
- public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
-
- // HTML Typing Preferences
- public static String HTMLTyping_Auto_Complete;
- public static String HTMLTyping_Auto_Remove;
- public static String HTMLTyping_Complete_Comments;
- public static String HTMLTyping_Complete_End_Tags;
- public static String HTMLTyping_Remove_End_Tags;
- public static String HTMLTyping_Close_Strings;
- public static String HTMLTyping_Close_Brackets;
-
- // 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 Expandable_label_attributes;
- public static String Expandable_label_elements;
- public static String Expandable_label_document_type;
- public static String Expandable_label_text;
- public static String Expandable_label_comment;
- public static String Expandable_label_cdata;
- public static String Expandable_label_pi;
- public static String Expandable_label_entity_ref;
-
- public static String HTMLValidationPreferencePage_0;
- public static String HTMLValidationPreferencePage_1;
- public static String HTMLValidationPreferencePage_10;
- public static String HTMLValidationPreferencePage_11;
- public static String HTMLValidationPreferencePage_12;
- public static String HTMLValidationPreferencePage_13;
- public static String HTMLValidationPreferencePage_14;
- public static String HTMLValidationPreferencePage_15;
- public static String HTMLValidationPreferencePage_16;
- public static String HTMLValidationPreferencePage_17;
- public static String HTMLValidationPreferencePage_18;
- public static String HTMLValidationPreferencePage_19;
- public static String HTMLValidationPreferencePage_2;
- public static String HTMLValidationPreferencePage_20;
- public static String HTMLValidationPreferencePage_21;
- public static String HTMLValidationPreferencePage_22;
- public static String HTMLValidationPreferencePage_23;
- public static String HTMLValidationPreferencePage_24;
- public static String HTMLValidationPreferencePage_25;
- public static String HTMLValidationPreferencePage_26;
- public static String HTMLValidationPreferencePage_27;
- public static String HTMLValidationPreferencePage_28;
- public static String HTMLValidationPreferencePage_29;
- public static String HTMLValidationPreferencePage_3;
- public static String HTMLValidationPreferencePage_30;
- public static String HTMLValidationPreferencePage_31;
- public static String HTMLValidationPreferencePage_32;
- public static String HTMLValidationPreferencePage_33;
- public static String HTMLValidationPreferencePage_34;
- public static String HTMLValidationPreferencePage_35;
- public static String HTMLValidationPreferencePage_36;
- public static String HTMLValidationPreferencePage_37;
- public static String HTMLValidationPreferencePage_4;
- public static String HTMLValidationPreferencePage_5;
- public static String HTMLValidationPreferencePage_6;
- public static String HTMLValidationPreferencePage_7;
- public static String HTMLValidationPreferencePage_8;
- public static String HTMLValidationPreferencePage_9;
-
-
-
- // Hyperlinks
- public static String Hyperlink_line;
- public static String Open;
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
deleted file mode 100644
index 6d049337ad..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- protected static HTMLUIPlugin instance = null;
-
- /**
- * The template store for the html editor.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for the html editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- public HTMLUIPlugin() {
- super();
- instance = this;
- }
-
- public static HTMLUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static HTMLUIPlugin getInstance() {
- return instance;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * Returns the template store for the html editor templates.
- *
- * @return the template store for the html editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), HTMLUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the html plugin.
- *
- * @return the template context type registry for the html plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsHTML.ALL);
- registry.addContextType(TemplateContextTypeIdsHTML.NEW);
- registry.addContextType(TemplateContextTypeIdsHTML.TAG);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
deleted file mode 100644
index d148dd8f95..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ /dev/null
@@ -1,183 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
-###############################################################################
-## The following line is a sample HTML document. Please translate only the following parts:
-## HTML Highlighting Preferences
-## we need a flaming logo
-Sample_HTML_doc=<!DOCTYPE html\n\tPUBLIC \"-//W3C/DTD/ HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n\t<head>\n\t\t<meta content=\"text/html\">\n\t\t<title>HTML Highlighting Preferences</title>\n\t</head>\n<body>\n\t<!--\n\t\twe need a flaming logo!\n\t-->\n\t<p>three&nbsp;&nbsp;&nbsp;spaces</p>\n</body>\n</html>
-
-HTMLFilesPreferencePage_0=Loading files
-#
-_UI_WIZARD_NEW_TITLE = New HTML File
-_UI_WIZARD_NEW_HEADING = HTML
-_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML file.
-_ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
-_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application.
-ResourceGroup_nameExists = The same name already exists.
-NewHTMLTemplatesWizardPage_0=Select HTML Template
-NewHTMLTemplatesWizardPage_1=Select a template as initial content in the HTML page.
-NewHTMLTemplatesWizardPage_2=Name
-NewHTMLTemplatesWizardPage_3=Description
-NewHTMLTemplatesWizardPage_4=&Use HTML Template
-NewHTMLTemplatesWizardPage_5=&Preview:
-NewHTMLTemplatesWizardPage_6=Templates are 'New HTML' templates found in the <a>HTML Templates</a> preference page.
-NewHTMLTemplatesWizardPage_7=&Templates:
-#
-Creating_files_encoding=Creating files encoding preference
-# 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
-Add_inline=A&dd...
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_description=Add Block Comment
-Remove_inline=&Remove
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_description=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-Creating_files=Creating files
-Elements_Dialog_message=&Select elements to treat as inline.
-Elements_Dialog_title=Add Elements
-Encoding_desc=The following encoding will apply:
-## HTML Source preference page
-Auto_Activation_UI_=Auto Activation
-Auto_Activation_Delay=Auto activation dela&y (ms):
-Automatically_make_suggest_UI_=Automatically ma&ke suggestions
-Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
-Cycling_UI_=Cycling
-Formatting_UI_=Formatting
-Line_width__UI_=Line &width:
-Split_multiple_attributes=Split &multiple attributes each on a new line
-Align_final_bracket=&Align final bracket in multi-line element tags
-Indent_using_tabs=&Indent using tabs
-Indent_using_spaces=I&ndent using spaces
-Indentation_size=Inden&tation size:
-Indentation_size_tip=Indentation size
-Inline_elements_table_label=Inline &Elements:
-Clear_all_blank_lines_UI_=Clear all &blank lines
-Preferred_markup_case_UI_=Preferred markup case for content assist, and code generation
-Tag_names__UI_=Tag names:
-Tag_names_Upper_case_UI_=&Uppercase
-Tag_names_Lower_case_UI_=&Lowercase
-Attribute_names__UI_=Attribute names:
-Attribute_names_Upper_case_UI_=U&ppercase
-Attribute_names_Lower_case_UI_=L&owercase
-Cleanup_UI_=Cleanup
-Tag_name_case_for_HTML_UI_=Tag name case for HTML:
-Tag_name_case_As_is_UI_=&As-is
-Tag_name_case_Lower_UI_=&Lower
-Tag_name_case_Upper_UI_=&Upper
-Attribute_name_case_for_HTML_UI_=Attribute name case for HTML:
-Attribute_name_case_As_is_UI_=A&s-is
-Attribute_name_case_Lower_UI_=L&ower
-Attribute_name_case_Upper_UI_=U&pper
-Insert_required_attributes_UI_=Insert &required attributes
-Insert_missing_tags_UI_=&Insert missing tags
-Quote_attribute_values_UI_=&Quote attribute values
-Format_source_UI_=&Format source
-Convert_EOL_codes_UI_=Convert line &delimiters to
-EOL_Windows_UI=&Windows
-EOL_Unix_UI=U&NIX
-EOL_Mac_UI=&Mac
-
-# web content settings
-UI_Description_of_role_of_following_DOCTYPE=Use the following default document type when no DOCTYPE is declared in a file:
-UI_Default_HTML_DOCTYPE_ID___1=Document type:
-UI_Public_ID=Public ID:
-UI_System_ID=System ID:
-UI_none=none
-UI_CSS_profile___2=CSS profile:
-WebContentSettingsPropertyPage_0=The properties used that cannot or are not specified in web files. The project setting is used if you specify "none."
-ProjectWebContentSettingsPropertyPage_0=These values are used when the corresponding properties are not specified within a web page.
-SyntaxColoringPage_0=S&yntax Element:
-SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=&Bold
-SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strikethrough
-SyntaxColoringPage_6=&Underline
-# below are possibly unused strings that may be deleted
-HTMLFilesPreferencePage_1=Add this suffix (if not specified):
-HTMLFilesPreferencePage_2=Insert DOCTYPE declaration
-HTMLFilesPreferencePage_3=Insert GENERATOR with META tag
-EmptyFilePreferencePage_0=Expand the tree to edit preferences for a specific feature.
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=HTML editing preferences. Note that some preferences may be set on the <a>{0}</a> preference page.
-# above are possibly unused strings that may be deleted
-
-# HTML Typing Preference Page
-HTMLTyping_Auto_Complete=Automatically close
-HTMLTyping_Auto_Remove=Automatically remove
-HTMLTyping_Complete_Comments=&Comments
-HTMLTyping_Close_Strings=A&ttribute values
-HTMLTyping_Close_Brackets=(Parentheses) and [square] brac&kets
-HTMLTyping_Complete_End_Tags=&End tags
-HTMLTyping_Remove_End_Tags=E&nd tags when creating empty self-closing tags
-
-
-# Validation strings
-Validation_description=Select the severity level for the following validation problems:
-Validation_Warning=Warning
-Validation_Error=Error
-Validation_Ignore=Ignore
-Expandable_label_attributes=Attributes
-Expandable_label_elements=Elements
-Expandable_label_document_type=Document Type
-Expandable_label_text=Text Regions
-Expandable_label_comment=Comments
-Expandable_label_cdata=CDATA Sections
-Expandable_label_pi=Processing Instructions
-Expandable_label_entity_ref=Entity References
-
-HTMLValidationPreferencePage_0=Undefined attribute name:
-HTMLValidationPreferencePage_1=Undefined attribute value:
-HTMLValidationPreferencePage_10=Start-tag uses invalid case:
-HTMLValidationPreferencePage_11=End tag uses invalid case:
-HTMLValidationPreferencePage_12=Missing start tag:
-HTMLValidationPreferencePage_13=Missing end tag:
-HTMLValidationPreferencePage_14=Unnecessary end tag:
-HTMLValidationPreferencePage_15=Invalid directive:
-HTMLValidationPreferencePage_16=Invalid tag location:
-HTMLValidationPreferencePage_17=Duplicate tag:
-HTMLValidationPreferencePage_18=Coexistence:
-HTMLValidationPreferencePage_19=Unclosed start tag:
-HTMLValidationPreferencePage_2=Attribute name using wrong case character:
-HTMLValidationPreferencePage_20=Unclosed end tag:
-HTMLValidationPreferencePage_21=Invalid empty element tag:
-HTMLValidationPreferencePage_22=Duplicate DOCTYPE declaration:
-HTMLValidationPreferencePage_23=Invalid location:
-HTMLValidationPreferencePage_24=DOCTYPE declaration unclosed:
-HTMLValidationPreferencePage_25=Invalid text string:
-HTMLValidationPreferencePage_26=Invalid characters used in text string:
-HTMLValidationPreferencePage_27=Invalid location:
-HTMLValidationPreferencePage_28=Unclosed comment:
-HTMLValidationPreferencePage_29=Invalid location:
-HTMLValidationPreferencePage_3=Invalid attribute name:
-HTMLValidationPreferencePage_30=Unclosed CDATA section:
-HTMLValidationPreferencePage_31=Invalid location:
-HTMLValidationPreferencePage_32=Unclosed processing instruction:
-HTMLValidationPreferencePage_33=Invalid location:
-HTMLValidationPreferencePage_34=Unknown entity:
-HTMLValidationPreferencePage_4=Invalid attribute:
-HTMLValidationPreferencePage_5=Multiple values specified for an attribute:
-HTMLValidationPreferencePage_6=Attribute value using wrong case character:
-HTMLValidationPreferencePage_7=Unclosed attribute value:
-HTMLValidationPreferencePage_8=Unknown tag name:
-HTMLValidationPreferencePage_9=Invalid tag name:
-HTMLValidationPreferencePage_35=Attribute value refers to missing resource:
-HTMLValidationPreferencePage_36=Invalid location of text in tag:
-HTMLValidationPreferencePage_37=Missing attribute equals sign character:
-
-Hyperlink_line={0}={1} : line {2}
-Open=Open ''{0}''
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
deleted file mode 100644
index 580f3fe80e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.html.ui.internal;
-
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index bc89ee54c6..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * AutoEditStrategy to handle characters inserted when Tab key is pressed
- */
-public class AutoEditStrategyForTabs implements IAutoEditStrategy {
- private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
-
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- // if not in smart insert mode just ignore
- if (!isSmartInsertMode())
- return;
-
- // spaces for tab character
- if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1)
- smartInsertForTab(command, document);
- }
-
- /**
- * Insert spaces for tabs
- *
- * @param command
- */
- private void smartInsertForTab(DocumentCommand command, IDocument document) {
- // tab key was pressed. now check preferences to see if need to insert
- // spaces instead of tab
- int indentationWidth = getIndentationWidth();
- if (indentationWidth > -1) {
- String originalText = command.text;
- StringBuffer newText = new StringBuffer(originalText);
-
- // determine where in line this command begins
- int lineOffset = -1;
- try {
- IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
- lineOffset = command.offset - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- ILineTracker lineTracker = getLineTracker(document, originalText);
-
- int startIndex = 0;
- int index = newText.indexOf(TAB_CHARACTER);
- while (index != -1) {
- String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
-
- // replace \t character with spaces
- newText.replace(index, index + 1, indent);
- if (lineTracker != null) {
- try {
- lineTracker.replace(index, 1, indent);
- } catch (BadLocationException e) {
- // if something goes wrong with replacing text, just
- // reset to current string
- lineTracker.set(newText.toString());
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- startIndex = index + indent.length();
- index = newText.indexOf(TAB_CHARACTER, startIndex);
- }
- command.text = newText.toString();
- }
- }
-
- /**
- * Calculate number of spaces for next tab stop
- */
- private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
- int indentSize = indentationWidth;
- int offsetInLine = -1;
- if (lineTracker != null) {
- try {
- IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
- if (lineInfo.getOffset() == 0 && lineOffset > -1)
- offsetInLine = lineOffset + index;
- else
- offsetInLine = index - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- } else {
- if (lineOffset > -1) {
- offsetInLine = lineOffset + index;
- }
- }
- if (offsetInLine > -1 && indentationWidth > 0) {
- int remainder = offsetInLine % indentationWidth;
- indentSize = indentationWidth - remainder;
- }
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentSize; i++)
- indent.append(' ');
- return indent.toString();
- }
-
- /**
- * Set up a line tracker for text within command if text is multi-line
- */
- private ILineTracker getLineTracker(IDocument document, String originalText) {
- ConfigurableLineTracker lineTracker = null;
- int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
- if (delims[0] != -1 || delims[1] != -1) {
- lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
- lineTracker.set(originalText);
- }
- return lineTracker;
- }
-
- /**
- * Return true if active editor is in smart insert mode, false otherwise
- *
- * @return
- */
- private boolean isSmartInsertMode() {
- boolean isSmartInsertMode = false;
-
- ITextEditor textEditor = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor)editor;
- else
- textEditor = (ITextEditor)editor.getAdapter(ITextEditor.class);
- }
- }
- }
-
- // check if smart insert mode
- if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT)
- isSmartInsertMode = true;
- return isSmartInsertMode;
- }
-
- /**
- * Returns indentation width if using spaces for indentation, -1 otherwise
- *
- * @return
- */
- private int getIndentationWidth() {
- int width = -1;
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
- width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- return width;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
deleted file mode 100644
index af18a5b38e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.autoedit;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-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.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-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.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Automatically inserts closing comment tag or end tag when appropriate.
- */
-public class StructuredAutoEditStrategyHTML implements IAutoEditStrategy {
- /*
- * NOTE: copies of this class exists in
- * org.eclipse.wst.xml.ui.internal.autoedit
- * org.eclipse.wst.html.ui.internal.autoedit
- */
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
- return;
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- if (command.text != null) {
- smartInsertCloseElement(command, document, model);
- smartInsertForComment(command, document, model);
- smartInsertForEndTag(command, document, model);
- smartRemoveEndTag(command, document, model);
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- private boolean isPreferenceEnabled(String key) {
- return (key != null && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
- }
-
- private boolean isCommentNode(IDOMNode node) {
- return (node != null && node instanceof IDOMElement && ((IDOMElement) node).isCommentTag());
- }
-
- private boolean isDocumentNode(IDOMNode node) {
- return (node != null && node.getNodeType() == Node.DOCUMENT_NODE);
- }
-
- /**
- * Attempts to clean up an end-tag if a start-tag is converted into an empty-element
- * tag (e.g., <node />) and the original element was empty.
- *
- * @param command the document command describing the change
- * @param document the document that will be changed
- * @param model the model based on the document
- */
- private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- // An opening tag is now a self-terminated end-tag
- if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if (node != null && !node.hasChildNodes()) {
- IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
- if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
-
- /* if the region before the command offset is a an attribute value region
- * check to see if it has both and opening and closing quote
- */
- ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
- boolean inUnclosedAttValueRegion = false;
- if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- //get the text of the attribute value region
- String prevText = region.getText(prevTextRegion);
- inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
- (prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
- }
-
- //if command offset is in an unclosed attribute value region then done remove the end tag
- if(!inUnclosedAttValueRegion) {
- region = node.getEndStructuredDocumentRegion();
- if (region != null && region.isEnded()) {
- document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- private void smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("-") && document.getLength() >= 3 && document.get(command.offset - 3, 3).equals("<!-") && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " -->"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 2;
- command.doit = false;
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
-
- }
-
- /**
- * Attempts to insert the end tag when completing a start-tag with the '&gt;' character.
- *
- * @param command
- * @param document
- * @param model
- */
- private void smartInsertCloseElement(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- // Check terminating start tag, but ignore empty-element tags
- if (command.text.equals(">") && document.getLength() > 0 && document.getChar(command.offset - 1) != '/' && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS)) { //$NON-NLS-1$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset - 1);
- boolean isClosedByParent = false;
- // Only insert an end-tag if necessary. Because of the way the document is parsed, it is possible for a child tag with the same
- // name as an ancestor to be paired with the end-tag of an ancestor, so the ancestors must be checked for an unclosed tag.
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE && (!node.isClosed() || (isClosedByParent = hasUnclosedAncestor(node)))) {
- IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
- if (region != null && region.getRegions().size() > 0 && region.getRegions().get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN && !isClosedByParent)
- return;
- region = node.getStartStructuredDocumentRegion();
- if (region != null) {
- ITextRegion textRegion = region.getRegionAtCharacterOffset(command.offset - 1);
- if (textRegion != null && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {
- // Check that the command is not within a quoted attribute value
- final String text = region.getText(textRegion);
- final char first = text.charAt(0);
- if (first == '\'' || first == '"') {
- if (text.length() < 2) // Just an opening quote
- return;
- final char last = text.charAt(text.length() - 1);
- if (last == first) { // Quote is paired
- if (command.offset < region.getTextEndOffset(textRegion)) // Command is within the value
- return;
- }
- else // Unpaired quote
- return;
- }
- }
- }
- CMElementDeclaration decl = getCMElementDeclaration(node);
- // If it's XHTML, always generate the end tag
- if (isXHTML(node) || shouldGenerateEndTag(decl)) {
- command.text += "</" + getElementName(node, command.offset) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 1;
- }
- }
-
- }
- } catch (BadLocationException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Get the element name that will be created by closing the start tag. Defaults
- * to the node's nodeName.
- * @param node the node that is being edited
- * @param offset the offset in the document where the start tag is closed
- * @return The element name of the tag
- */
- private String getElementName(IDOMNode node, int offset) {
- String name = null;
-
- IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
- ITextRegion textRegion = region.getRegionAtCharacterOffset(offset);
- if (textRegion != null && textRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
- int nameStart = region.getStartOffset(textRegion);
- String regionText = region.getText(textRegion);
- int length = offset - nameStart;
- if (length <= regionText.length())
- name = regionText.substring(0, length);
- }
-
- // Default to the node name
- if (name == null)
- name = node.getNodeName();
- return name;
- }
-
- private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("/") && document.getLength() >= 1 && document.get(command.offset - 1, 1).equals("<") && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
- if (isCommentNode(parentNode)) {
- // loop and find non comment node parent
- while (parentNode != null && isCommentNode(parentNode)) {
- parentNode = (IDOMNode) parentNode.getParentNode();
- }
- }
-
- if (!isDocumentNode(parentNode)) {
- // only add end tag if one does not already exist or if
- // add '/' does not create one already
- IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
- IDOMNode ancestor = parentNode;
- boolean smartInsertForEnd = false;
- if(endTagStructuredDocumentRegion != null) {
- // Look for ancestors by the same name that are missing end tags
- while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
- if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
- smartInsertForEnd = true;
- break;
- }
- }
- }
- if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
- StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
- if (toAdd.length() > 0) {
- toAdd.append(">"); //$NON-NLS-1$
- String suffix = toAdd.toString();
- if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
- command.text += suffix;
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * Checks if <code>node</code> has an unclosed ancestor by the same name
- *
- * @param node the node to check
- * @return true if <code>node</code> has an unclosed parent with the same node name
- */
- private boolean hasUnclosedAncestor(IDOMNode node) {
- IDOMNode parent = (IDOMNode) node.getParentNode();
- while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE && parent.getNodeName().equals(node.getNodeName())) {
- if (!parent.isClosed())
- return true;
- parent = (IDOMNode) parent.getParentNode();
- }
- return false;
- }
-
- /**
- * Based on the content model, determine if an end tag should be generated
- * @param elementDecl the content model element declaration
- * @return true if the end tag should be generated; false otherwise.
- */
- private boolean shouldGenerateEndTag(CMElementDeclaration elementDecl) {
- if (elementDecl == null)
- return false;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return false;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return false;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return false;
- return true;
- }
-
- private CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (modelQuery != null) {
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- }
- return result;
- }
-
- /**
- * Is the node part of an XHTML document
- * @param node
- * @return
- */
- private boolean isXHTML(Node node) {
- Document doc = node.getOwnerDocument();
- if (!(doc instanceof IDOMDocument))
- return false;
- String typeid = ((IDOMDocument) doc).getDocumentTypeId();
- if (typeid != null) {
- HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
- return (entry != null && entry.isXMLType());
- }
- return false;
- }
-
- /**
- * Return the active text editor if possible, otherwise the active editor
- * part.
- *
- * @return Object
- */
- private Object getActiveTextEditor() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- return editor;
- ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- if (textEditor != null)
- return textEditor;
- return editor;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
deleted file mode 100644
index 6bb0f2061b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-/**
- * Purpose of this class is to make the additional proposal info into content
- * fit for an HTML viewer (by escaping characters)
- */
-class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
- // copies of this class exist in:
- // org.eclipse.jst.jsp.ui.internal.contentassist
- // org.eclipse.wst.html.ui.internal.contentassist
- // org.eclipse.wst.xml.ui.internal.contentassist
-
- public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
- super(template, context, region, image, relevance);
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- return StringUtils.convertToHTMLContent(additionalInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
deleted file mode 100644
index 63c2ced2b7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.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.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see HTMLStructuredContentAssistProcessor
- */
-public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
- private INodeAdapterFactory factoryForCSS = null;
- protected IPreferenceStore fPreferenceStore = null;
- protected boolean isXHTML = false;
- private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
- private IContentAssistProcessor fJSContentAssistProcessor = null;
- private List fTemplateContexts = new ArrayList();
-
- public HTMLContentAssistProcessor() {
-
- super();
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE);
- super.addAttributeNameProposals(contentAssistRequest);
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
- /**
- * Add the proposals for a completely empty document
- */
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW);
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addPCDATAProposal(nodeName, contentAssistRequest);
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- addEmptyDocumentProposals(contentAssistRequest);
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG);
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
- addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- * @param startOffset
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
- if (contentAssistRequest == null)
- return;
-
- // if already adding template proposals for a certain context type, do
- // not add again
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList)
- contentAssistRequest.addProposal(proposals[i]);
- else
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
-
- protected boolean beginsWith(String aString, String prefix) {
- if (aString == null || prefix == null || prefix.length() == 0)
- return true;
- int minimumLength = Math.min(prefix.length(), aString.length());
- String beginning = aString.substring(0, minimumLength);
- return beginning.equalsIgnoreCase(prefix);
- }
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- // bug115927 use original document position for all/any region templates
- addTemplates(request, TemplateContextTypeIdsHTML.ALL, documentPosition);
- return request;
- }
-
- /**
- * Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.
- *
- * @param documentPosition
- * a location within the document
- * @return an array of code-assist items
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
- fTemplateContexts.clear();
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
- IDOMNode node = (IDOMNode) treeNode;
- setErrorMessage(null);
-
- // check if it's in a comment node
- IStructuredDocument structuredDocument = (IStructuredDocument) textViewer.getDocument();
- IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
- if (fn != null && fn.getType() == DOMRegionContext.XML_COMMENT_TEXT && documentPosition != fn.getStartOffset()) {
- return new ICompletionProposal[0];
- }
-
- // CMVC 242695
- // if it's a </script> tag, bounce back to JS ca processor...
- if (fn != null && fn.getType() == DOMRegionContext.XML_TAG_NAME && documentPosition == fn.getStartOffset()) {
- ITextRegionList v = fn.getRegions();
- if (v.size() > 1) {
- // determine that it's a close tag
- if ((v.get(0)).getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- Iterator it = v.iterator();
- ITextRegion region = null;
- // search for script tag name
- while (it.hasNext()) {
- region = (ITextRegion) it.next();
- if (fn.getText(region).equalsIgnoreCase("script")) { //$NON-NLS-1$
- IContentAssistProcessor jsProcessor = getJSContentAssistProcessor();
- if (jsProcessor != null) {
- return jsProcessor.computeCompletionProposals(textViewer, documentPosition);
- }
- return new ICompletionProposal[0];
- }
- }
- }
- }
- }
-
- isXHTML = getXHTML(node);
-
- fGenerator = null; // force reload of content generator
-
- // handle blank HTML document case
- if (treeNode == null || isViewerEmpty(textViewer)) {
- // cursor is at the EOF
- ICompletionProposal htmlTagProposal = getHTMLTagProposal(textViewer, documentPosition);
- ICompletionProposal[] superResults = super.computeCompletionProposals(textViewer, documentPosition);
- if (superResults != null && superResults.length > 0 && htmlTagProposal != null) {
- ICompletionProposal[] blankHTMLDocResults = new ICompletionProposal[superResults.length + 1];
- blankHTMLDocResults[0] = htmlTagProposal;
- System.arraycopy(superResults, 0, blankHTMLDocResults, 1, superResults.length);
- return blankHTMLDocResults;
- }
- }
-
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
-
- // check embedded CSS proposals at the beginning of the STYLE end
- // tag
- Element element = (Element) node;
- String tagName = element.getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) {//$NON-NLS-1$
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.getStartOffset() == documentPosition) {
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- int offset = startStructuredDocumentRegion.getEndOffset();
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, (char) 0);
- if (proposals != null)
- return proposals;
- }
- }
- }
-
- // check inline CSS proposals
- // need to find attr region from sd region
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(textViewer, documentPosition);
- Iterator regions = sdRegion.getRegions().iterator();
- ITextRegion styleNameRegion = null;
- ITextRegion styleValueRegion = null;
- while (regions.hasNext()) {
- styleNameRegion = (ITextRegion) regions.next();
- if (styleNameRegion.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && sdRegion.getText(styleNameRegion).equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) { //$NON-NLS-1$
- // the next region should be "="
- if (regions.hasNext()) {
- regions.next(); // skip the "="
- // next region should be attr value region
- if (regions.hasNext()) {
- styleValueRegion = (ITextRegion) regions.next();
- break;
- }
- }
- }
- }
-
- if (styleValueRegion != null) {
- int offset = sdRegion.getStartOffset(styleValueRegion);
- int end = sdRegion.getTextEndOffset(styleValueRegion);
- if (documentPosition >= offset && documentPosition <= end) {
- boolean askCSS = true;
- char quote = (char) 0;
- String text = sdRegion.getText(styleValueRegion);
- int length = (text != null ? text.length() : 0);
- if (length > 0) {
- char firstChar = text.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- if (documentPosition == offset) {
- // before quote
- askCSS = false;
- }
- else {
- offset++;
- quote = firstChar;
- }
- }
- if (documentPosition == end) {
- if (length > 1 && text.charAt(length - 1) == quote) {
- // after quote
- askCSS = false;
- }
- }
- }
- if (askCSS) {
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, quote);
- if (proposals != null)
- return proposals;
- }
- }
- }
- }
-
- return super.computeCompletionProposals(textViewer, documentPosition);
- }
-
- /**
- * Returns true if there is no text or it's all white space, otherwise
- * returns false
- *
- * @param treeNode
- * @param textViewer
- * @return boolean
- */
- private boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if (text == null || (text != null && text.trim().equals(""))) //$NON-NLS-1$
- isEmpty = true;
- return isEmpty;
- }
-
- /**
- * @return ICompletionProposal
- */
- private ICompletionProposal getHTMLTagProposal(ITextViewer viewer, int documentPosition) {
- IModelManager mm = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- ICompletionProposal result = null;
- try {
- if (mm != null) {
- model = mm.getExistingModelForRead(viewer.getDocument());
-
- if (model != null) {
- IDOMDocument doc = ((IDOMModel) model).getDocument();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
- if (mq != null) {
-
- // XHTML requires lowercase tagname for lookup
- CMDocument correspondingCMDocument = mq.getCorrespondingCMDocument(doc);
- if (correspondingCMDocument != null) {
- CMElementDeclaration htmlDecl = (CMElementDeclaration) correspondingCMDocument.getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
- if (htmlDecl != null) {
- StringBuffer proposedTextBuffer = new StringBuffer();
- getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
-
- String proposedText = proposedTextBuffer.toString();
- String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
-
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, documentPosition,
- /* start pos */
- 0, /* replace length */
- requiredName.length() + 2, /*
- * cursor position
- * after
- * (relavtive to
- * start)
- */
- HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
- result = proposal;
- }
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return result;
- }
-
- /**
- * @see AbstractContentAssistProcessor#getContentGenerator()
- */
- public XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- if (isXHTML)
- fGenerator = XHTMLMinimalContentModelGenerator.getInstance();
- else
- fGenerator = HTMLMinimalContentModelGenerator.getInstance();
- }
- return fGenerator;
- }
-
- protected ICompletionProposal[] getCSSProposals(ITextViewer viewer, int pos, IDOMNode element, int offset, char quote) {
-
- CSSContentAssistProcessor cssProcessor = new CSSContentAssistProcessor();
- cssProcessor.setDocumentOffset(offset);
- cssProcessor.setQuoteCharOfStyleAttribute(quote);
-
- return cssProcessor.computeCompletionProposals(viewer, pos);
- }
-
- protected String getEmptyTagCloseString() {
- if (isXHTML)
- return " />"; //$NON-NLS-1$
- return ">"; //$NON-NLS-1$
- }
-
- private IContentAssistProcessor getJSContentAssistProcessor() {
- if (fJSContentAssistProcessor == null) {
- fJSContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
- }
- return fJSContentAssistProcessor;
- }
-
- private HTMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new HTMLTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-
- /**
- * Determine if this Document is an XHTML Document. Oprates solely off of
- * the Document Type declaration
- */
- protected boolean getXHTML(Node node) {
- if (node == null)
- return false;
-
- Document doc = null;
- if (node.getNodeType() != Node.DOCUMENT_NODE)
- doc = node.getOwnerDocument();
- else
- doc = ((Document) node);
-
- if (doc instanceof IDOMDocument)
- return ((IDOMDocument) doc).isXMLType();
-
-
- if (doc instanceof INodeNotifier) {
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
- CMDocument cmdoc = null;
- if (adapter != null && adapter.getModelQuery() != null)
- cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
- if (cmdoc != null) {
- // treat as XHTML unless we've got the in-code HTML content
- // model
- if (cmdoc instanceof HTMLCMDocument)
- return false;
- if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
- return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
- }
- }
- // this should never be reached
- DocumentType docType = doc.getDoctype();
- return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
- }
-
- protected void init() {
- getPreferenceStore().addPropertyChangeListener(this);
- reinit();
- }
-
- protected void reinit() {
- String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- }
- else {
- completionProposalAutoActivationCharacters = null;
- }
- }
-
- public void release() {
- if (factoryForCSS != null) {
- factoryForCSS.release();
- }
- if (fJSContentAssistProcessor instanceof IReleasable) {
- ((IReleasable)fJSContentAssistProcessor).release();
- }
- getPreferenceStore().removePropertyChangeListener(this);
- super.release();
- }
-
- protected boolean stringsEqual(String a, String b) {
- return a.equalsIgnoreCase(b);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
-
- if (property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
- reinit();
- }
- }
-
- protected IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null)
- fPreferenceStore = HTMLUIPlugin.getDefault().getPreferenceStore();
-
- return fPreferenceStore;
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, ITextRegion region) {
- return computeCompletionProposals(viewer, documentPosition);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
deleted file mode 100644
index 0bdd85ffdd..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class HTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static HTMLMinimalContentModelGenerator instance = null;
- protected int fTagCase;
- protected int fAttrCase;
-
- /**
- * HTMLMinimalContentModelGenerator constructor comment.
- */
- private HTMLMinimalContentModelGenerator() {
- super();
- }
-
- private void init() {
- String qualifier = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- fTagCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.TAG_NAME_CASE, 0, null);
- fAttrCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.ATTR_NAME_CASE, 0, null);
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- public String getRequiredName(Node ownerNode, CMNode cmnode) {
- String name = super.getRequiredName(ownerNode, cmnode);
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- int caseVal = -1;
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- caseVal = fTagCase;
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- caseVal = fAttrCase;
- switch (caseVal) {
- case HTMLCorePreferenceNames.LOWER :
- {
- name = name.toLowerCase();
- }
- break;
- case HTMLCorePreferenceNames.UPPER :
- {
- name = name.toUpperCase();
- }
- break;
- }
- }
- return name;
- }
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return "/>"; //$NON-NLS-1$
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return ">"; //$NON-NLS-1$
- }
- }
- }
-
- //if not an html element and empty, assume start tag needs to be closed
- else if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- return "/>"; //$NON-NLS-1$
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- /**
- * Gets the instance.
- * @return Returns a HTMLMinimalContentModelGenerator
- */
- public synchronized static HTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new HTMLMinimalContentModelGenerator();
- instance.init();
- return instance;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
deleted file mode 100644
index 41916f9ddd..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
-
-/**
- * <p>Implementation of {@link StructuredContentAssistProcessor} for HTML documents</p>
- *
- * <p>This implementation will react to user preference changes for auto activation
- * characters for HTML pages</p>
- */
-public class HTMLStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
- /** the auto activation characters for this processor, set by user preference */
- private char[] fCompletionProposalAutoActivationCharacters;
-
- /** the context information validator for this processor */
- private IContextInformationValidator fContextInformationValidator;
-
- /**
- * <p>Constructor</p>
- *
- * @param assistant {@link ContentAssistant} to use
- * @param partitionTypeID the partition type this processor is for
- * @param viewer {@link ITextViewer} this processor is acting in
- */
- public HTMLStructuredContentAssistProcessor(ContentAssistant assistant,
- String partitionTypeID, ITextViewer viewer) {
-
- super(assistant, partitionTypeID, viewer, HTMLUIPlugin.getDefault().getPreferenceStore());
- getAutoActivationCharacterPreferences();
- updateAutoActivationDelay();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- if (this.fContextInformationValidator == null) {
- this.fContextInformationValidator = new AttributeContextInformationPresenter();
- }
- return this.fContextInformationValidator;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return super.getCompletionProposalAutoActivationCharacters() != null ? super.getCompletionProposalAutoActivationCharacters() : this.fCompletionProposalAutoActivationCharacters;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
- * org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE) ||
- event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE)) {
- getAutoActivationCharacterPreferences();
- }
- else if (event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY)) {
- updateAutoActivationDelay();
- }
- }
-
- /**
- * <p>Sets the auto activation delay in Content Assist</p>
- */
- private void updateAutoActivationDelay() {
- IPreferenceStore store = getPreferenceStore();
- boolean doAuto = store.getBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE);
- if (doAuto) {
- setAutoActivationDelay(store.getInt(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY));
- }
- }
-
- /**
- * <p>Gets the auto activation character user preferences and stores them for later use</p>
- */
- private void getAutoActivationCharacterPreferences() {
- String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- this.fCompletionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- }
- else {
- this.fCompletionProposalAutoActivationCharacters = null;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
deleted file mode 100644
index 24d72db07d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMElementDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
-import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationProvider;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- * <p>{@link AbstractXMLModelQueryCompletionProposalComputer} for HTML tag proposals</p>
- */
-public class HTMLTagsCompletionProposalComputer extends
- AbstractXMLModelQueryCompletionProposalComputer {
-
- /** <code>true</code> if the document the proposal request is on is XHTML */
- protected boolean isXHTML = false;
-
- /** the context information validator for this computer */
- private IContextInformationValidator fContextInformationValidator;
-
- /**
- * <p>Default constructor</p>
- */
- public HTMLTagsCompletionProposalComputer() {
- this.fContextInformationValidator = null;
- }
-
- /**
- * <p>Determine if the document is XHTML or not, then compute the proposals</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- //determine if the content is XHTML or not
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(context.getViewer(),
- context.getInvocationOffset());
- IDOMNode node = (IDOMNode) treeNode;
- boolean isXHTMLNode = isXHTMLNode(node);
- if(this.isXHTML != isXHTMLNode) {
- this.isXHTML = isXHTMLNode;
- }
-
- //compute the completion proposals
- return super.computeCompletionProposals(context, monitor);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- AttributeContextInformationProvider attributeInfoProvider =
- new AttributeContextInformationProvider((IStructuredDocument)context.getDocument(),
- (AttributeContextInformationPresenter) getContextInformationValidator());
- return Arrays.asList(attributeInfoProvider.getAttributeInformation(context.getInvocationOffset()));
- }
-
- /**
- * <p>Dependent on if the document is XHTML or not</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getContentGenerator()
- */
- protected XMLContentModelGenerator getContentGenerator() {
- if (isXHTML) {
- return XHTMLMinimalContentModelGenerator.getInstance();
- } else {
- return HTMLMinimalContentModelGenerator.getInstance();
- }
- }
-
- /**
- * <p>Filter out all {@link CMNode}s except those specific to HTML documents</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
- */
- protected boolean validModelQueryNode(CMNode node) {
- boolean isValid = false;
- Object cmdoc = node.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmdoc instanceof CMNode) {
- String name = ((CMNode) cmdoc).getNodeName();
- isValid = name != null && name.endsWith(".dtd") && name.indexOf("html") != -1; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (node.supports(HTMLAttributeDeclaration.IS_HTML)) {
- Boolean isHTML = (Boolean) node.getProperty(HTMLAttributeDeclaration.IS_HTML);
- isValid = isHTML == null || isHTML.booleanValue();
- } else if(node instanceof HTMLPropertyDeclaration) {
- HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
- isValid = !propDec.isJSP();
- } else if (node instanceof CMAttributeDeclaration || node instanceof CMElementDeclarationImpl) {
- isValid = true;
- } else if(node instanceof CMElementDeclaration) {
- Boolean isXHTML = ((Boolean)node.getProperty(HTMLCMProperties.IS_XHTML));
- isValid = isXHTML != null && isXHTML.booleanValue();
- }
-
- // Do not propose obsolete tags, regardless
- if (isValid && node.supports(HTMLCMProperties.IS_OBSOLETE)) {
- Boolean isObsolete = ((Boolean) node.getProperty(HTMLCMProperties.IS_OBSOLETE));
- isValid = !(isObsolete != null && isObsolete.booleanValue());
- }
-
- return isValid;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addHTMLTagProposal(contentAssistRequest, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addStartDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- //determine if XMLPI is first element
- Node aNode = contentAssistRequest.getNode();
- Document owningDocument = aNode.getOwnerDocument();
- Node first = owningDocument.getFirstChild();
- boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
-
- //if there is an XMLPI then XHTML doctype, else HTML doctype
- if (xmlpiIsFirstElement && (owningDocument.getDoctype() == null) &&
- isCursorAfterXMLPI(contentAssistRequest)) {
-
- addDocTypeProposal(contentAssistRequest, true);
- } else {
- addDocTypeProposal(contentAssistRequest, false);
- }
- }
-
- /**
- *
- * @param contentAssistRequest
- * @param isXHTML
- */
- private void addDocTypeProposal(ContentAssistRequest contentAssistRequest, boolean isXHTML) {
- // if a DocumentElement exists, use that for the root Element name
- String rootname = "unspecified"; //$NON-NLS-1$
- if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
- rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
- }
-
- //decide which entry to use
- HTMLDocumentTypeEntry entry;
- if(isXHTML) {
- entry = HTMLDocumentTypeRegistry.getInstance().getXHTMLDefaultEntry();
- } else {
- entry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry();
- }
-
- //create the content assist string and proposal
- String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"" + //$NON-NLS-1$ //$NON-NLS-2$
- entry.getPublicId() + "\" \"" + entry.getSystemId() + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
- ICompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), 10,
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE),
- entry.getDisplayName() + " " + HTMLUIMessages.Expandable_label_document_type, //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_DOCTYPE);
- contentAssistRequest.addProposal(proposal);
- }
-
- /**
- * <p>adds HTML tag proposal for empty document</p>
- *
- * @param contentAssistRequest request to add proposal too
- * @param context context of the completion request
- */
- private void addHTMLTagProposal(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
- IStructuredModel model = null;
- try {
- if(context.getDocument() instanceof IStructuredDocument) {
- model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)context.getDocument());
- }
- if (model != null) {
- IDOMDocument doc = ((IDOMModel) model).getDocument();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
- if (mq != null) {
-
- // XHTML requires lowercase tagname for lookup
- CMDocument correspondingCMDocument = mq.getCorrespondingCMDocument(doc);
- if (correspondingCMDocument != null) {
- CMElementDeclaration htmlDecl = (CMElementDeclaration) correspondingCMDocument.getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
- if (htmlDecl != null) {
- StringBuffer proposedTextBuffer = new StringBuffer();
- getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
-
- String proposedText = proposedTextBuffer.toString();
- String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
-
- IStructuredDocumentRegion region = contentAssistRequest.getDocumentRegion();
- if (region != null) {
- if (region.getFirstRegion() != null &&
- region.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
- //in order to differentiate between content assist on
- //completely empty document and the one with xml open tag
- proposedText = proposedText.substring(1);
- }
- }
- if (!beginsWith(proposedText, contentAssistRequest.getMatchString())) {
- return;
- }
- int cursorAdjustment = getCursorPositionForProposedText(proposedText);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), cursorAdjustment,
- HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC),
- requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- /**
- * Determine if this Document is an XHTML Document. Operates solely off of
- * the Document Type declaration
- */
- private static boolean isXHTMLNode(Node node) {
- if (node == null) {
- return false;
- }
-
- Document doc = null;
- if (node.getNodeType() != Node.DOCUMENT_NODE)
- doc = node.getOwnerDocument();
- else
- doc = ((Document) node);
-
- if (doc instanceof IDOMDocument) {
- return ((IDOMDocument) doc).isXMLType();
- }
-
- if (doc instanceof INodeNotifier) {
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
- CMDocument cmdoc = null;
- if (adapter != null && adapter.getModelQuery() != null)
- cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
- if (cmdoc != null) {
- // treat as XHTML unless we've got the in-code HTML content
- // model
- if (cmdoc instanceof HTMLCMDocument)
- return false;
- if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
- return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
- }
- }
- // this should never be reached
- DocumentType docType = doc.getDoctype();
- return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
- }
-
- /**
- * 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.
- *
- * a context information validator, or <code>null</code> if the
- * processor is incapable of computing context information
- */
- private IContextInformationValidator getContextInformationValidator() {
- if (fContextInformationValidator == null) {
- fContextInformationValidator = new AttributeContextInformationPresenter();
- }
- return fContextInformationValidator;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
deleted file mode 100644
index bdbba404df..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.contentassist.ReplaceNameTemplateContext;
-
-
-/**
- * <p>Completion computer for HTML templates</p>
- */
-public class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
- private static final class ProposalComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
- }
- }
-
- private static final Comparator fgProposalComparator = new ProposalComparator();
- private String fContextTypeId = null;
-
- /*
- * Copied from super class except instead of calling createContext(viewer,
- * region) call createContext(viewer, region, offset) instead
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
-
- ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
-
- // adjust offset to end of normalized selection
- if (selection.getOffset() == offset)
- offset = selection.getOffset() + selection.getLength();
-
- String prefix = extractPrefix(viewer, offset);
- Region region = new Region(offset - prefix.length(), prefix.length());
- TemplateContext context = createContext(viewer, region, offset);
- if (context == null)
- return new ICompletionProposal[0];
- // name of the selection variables {line, word}_selection
- context.setVariable("selection", selection.getText()); //$NON-NLS-1$
-
- Template[] templates = getTemplates(context.getContextType().getId());
-
- List matches = new ArrayList();
- for (int i = 0; i < templates.length; i++) {
- Template template = templates[i];
- try {
- context.getContextType().validate(template.getPattern());
- }
- catch (TemplateException e) {
- continue;
- }
- if (template.matches(prefix, context.getContextType().getId()))
- matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
- }
-
- Collections.sort(matches, fgProposalComparator);
-
- return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
- }
-
- /**
- * Creates a concrete template context for the given region in the
- * document. This involves finding out which context type is valid at the
- * given location, and then creating a context of this type. The default
- * implementation returns a <code>SmartReplaceTemplateContext</code> for
- * the context type at the given location. This takes the offset at which
- * content assist was invoked into consideration.
- *
- * @param viewer
- * the viewer for which the context is created
- * @param region
- * the region into <code>document</code> for which the
- * context is created
- * @param offset
- * the original offset where content assist was invoked
- * @return a template context that can handle template insertion at the
- * given location, or <code>null</code>
- */
- private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
- // pretty much same code as super.createContext except create
- // SmartReplaceTemplateContext
- TemplateContextType contextType = getContextType(viewer, region);
- if (contextType != null) {
- IDocument document = viewer.getDocument();
- return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
- }
- return null;
- }
-
- protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
- return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
- }
-
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- TemplateContextType type = null;
-
- ContextTypeRegistry registry = getTemplateContextRegistry();
- if (registry != null)
- type = registry.getContextType(fContextTypeId);
-
- return type;
- }
-
- protected Image getImage(Template template) {
- // just return the same image for now
- return HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return HTMLUIPlugin.getDefault().getTemplateContextRegistry();
- }
-
- protected Template[] getTemplates(String contextTypeId) {
- Template templates[] = null;
-
- TemplateStore store = getTemplateStore();
- if (store != null)
- templates = store.getTemplates(contextTypeId);
-
- return templates;
- }
-
- private TemplateStore getTemplateStore() {
- return HTMLUIPlugin.getDefault().getTemplateStore();
- }
-
- public void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
deleted file mode 100644
index 2fe72d1e2a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
+++ /dev/null
@@ -1,146 +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.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
-
-/**
- * <p>XML type proposal computer to create HTML template proposals</p>
- */
-public class HTMLTemplatesCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /** template processor used to create template proposals */
- private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
-
- /**
- * <p>Create the computer</p>
- */
- public HTMLTemplatesCompletionProposalComputer() {
- fTemplateProcessor = new HTMLTemplateCompletionProcessor();
- }
-
- /**
- * <p>Calls super to add templates based on context and then
- * adds templates not specific to a context</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- //get the templates specific to the context
- List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
-
- //get templates not specific to the context
- proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsHTML.ALL, context));
-
- return proposals;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG, context);
- }
-
- /**
- * <p>Get the template proposals from the template processor</p>
- *
- * @param templateContext
- * @param context
- * @return
- */
- private List getTemplateProposals(String templateContext,
- CompletionProposalInvocationContext context) {
-
- List templateProposals = new ArrayList();
-
- if (fTemplateProcessor != null) {
- fTemplateProcessor.setContextType(templateContext);
- ICompletionProposal[] proposals =
- fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
-
- templateProposals.addAll(Arrays.asList(proposals));
- }
-
- return templateProposals;
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param templateContext
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
- CompletionProposalInvocationContext context) {
-
- if (contentAssistRequest != null) {
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
- List proposals = this.getTemplateProposals(templateContext, context);
-
- for (int i = 0; i < proposals.size(); ++i) {
- if (useProposalList) {
- contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
- }
- else {
- contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
deleted file mode 100644
index 748a54dd38..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-
-/**
- *
- * @author pavery
- */
-public class NoRegionContentAssistProcessorForHTML extends NoRegionContentAssistProcessor {
- protected void initPartitionToProcessorMap() {
-
- super.initPartitionToProcessorMap();
- IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
- addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
- addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
-
- IContentAssistProcessor jsContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
- addPartitionProcessor(IHTMLPartitions.SCRIPT, jsContentAssistProcessor);
-
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- addPartitionProcessor(ICSSPartitions.STYLE, cssContentAssistProcessor);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
deleted file mode 100644
index 8fba299199..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.TemplateVariable;
-
-/**
- * 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)
- *
- * @deprecated No longer used
- */
-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
- int prefixSize = prefix.length();
- TemplateVariable[] newTemplateVar = buffer.getVariables();
- for (int i =0; i < newTemplateVar.length; i++ ){
- int[] offsets = newTemplateVar[i].getOffsets();
- for (int j=0; j<offsets.length ;j++){
- offsets[j] += prefixSize;
- }
- }
- buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
- }
- }
- }
- return buffer;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
deleted file mode 100644
index 2a9607ea48..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class XHTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static XHTMLMinimalContentModelGenerator instance = null;
-
- private XHTMLMinimalContentModelGenerator() {
- super();
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- // EMPTY tag, do a self-close
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- // if it's a JSP element, don't add the space since the JSP container doesn't/shouldn't care
- if (elementDecl instanceof HTMLElementDeclaration && (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()))
- // if it's not JSP, conform to XHTML guidelines and add the space
- return "/>"; //$NON-NLS-1$
- else
- return " />"; //$NON-NLS-1$
- }
- // not defined as EMPTY, but should be treated as such anyway
- else if (elementDecl instanceof HTMLElementDeclaration) {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return " />"; //$NON-NLS-1$
- }
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- public synchronized static XHTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new XHTMLMinimalContentModelGenerator();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
deleted file mode 100644
index b59c9545fe..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.html.core.internal.HTMLContentBuilder;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- *
- */
-public class HTMLNodeActionManager extends XMLNodeActionManager {
- protected int fTagCase;
- protected int fAttrCase;
-
- public HTMLNodeActionManager(IStructuredModel model, Viewer viewer) {
- super(model, viewer);
- updateCase();
- }
-
- /**
- * If neccessary, employ a DOMContentBuilder that understands how to
- * change the case of HTML tags (but NOT taglib derived tags).
- */
- public DOMContentBuilder createDOMContentBuilder(Document document) {
- DOMContentBuilder builder = null;
- String one = fModel.getModelHandler().getAssociatedContentTypeId();
- String modelContentTypeId = fModel.getContentTypeIdentifier();
- if (one != modelContentTypeId) {
- System.out.println("not equal"); //$NON-NLS-1$
- }
- if (modelContentTypeId.equals(ContentTypeIdForHTML.ContentTypeID_HTML))
- builder = new HTMLContentBuilder(document);
- else
- builder = super.createDOMContentBuilder(document);
-
- return builder;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- /**
- * Modify the displayed menuitem label to change the case of HTML children
- * but neither XML nor taglib-derived children.
- */
- public String getLabel(Node parent, CMNode cmnode) {
- String result = null;
- // CMNode cmnode = action.getCMNode();
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- String name = cmnode.getNodeName();
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (fTagCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fTagCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fAttrCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- result = name;
- }
- else {
- result = super.getLabel(parent, cmnode);
- }
-
- return result;
- }
-
- /**
- * Another HTML specific detail.
- */
- protected void updateCase() {
- if (fModel != null) {
- String modelContentTypeId = fModel.getContentTypeIdentifier();
- if (modelContentTypeId != null) {
- if (modelContentTypeId.equals(ContentTypeIdForHTML.ContentTypeID_HTML)) {
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
- fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- }
- }
- }
- }
-
- public void reformat(Node newElement, boolean deep) {
- try {
- // tell the model that we are about to make a big model change
- fModel.aboutToChangeModel();
-
- // format selected node
- IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
- formatProcessor.formatNode(newElement);
- }
- finally {
- // tell the model that we are done with the big model change
- fModel.changedModel();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
deleted file mode 100644
index ea1dddd581..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-
-/**
- * An adapter factory to create JFaceNodeAdapters. Use this
- * adapter factory with a JFaceAdapterContentProvider to display
- * DOM nodes in a tree.
- */
-public class JFaceNodeAdapterFactoryForHTML extends JFaceNodeAdapterFactory {
-
-
- public JFaceNodeAdapterFactoryForHTML() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new JFaceNodeAdapterForHTML(this);
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-
- public INodeAdapterFactory copy() {
- return new JFaceNodeAdapterFactoryForHTML(getAdapterKey(), isShouldRegisterAdapter());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
deleted file mode 100644
index 1b494c5de5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-
-
-import java.util.Locale;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapterForHTML extends JFaceNodeAdapter {
-
- private Image createHTMLImage(String imageResourceName) {
- return HTMLEditorPluginImageHelper.getInstance().getImage(imageResourceName);
- }
-
- /**
- * Constructor for JFaceNodeAdapterForHTML.
- *
- * @param adapterFactory
- */
- public JFaceNodeAdapterForHTML(JFaceNodeAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- protected Image createImage(Object object) {
- Image image = null;
-
- Node node = (Node) object;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String lowerName = node.getNodeName().toLowerCase(Locale.US);
- if (lowerName.equals("table") || lowerName.endsWith(":table")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
- else if (lowerName.equals("a") || lowerName.endsWith(":a")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
- else if (lowerName.equals("body") || lowerName.endsWith(":body")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
- else if (lowerName.equals("button") || lowerName.endsWith(":button")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
- else if (lowerName.equals("font") || lowerName.endsWith(":font")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
- else if (lowerName.equals("form") || lowerName.endsWith(":form")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
- else if (lowerName.equals("html") || lowerName.endsWith(":html")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
- else if (lowerName.equals("img") || lowerName.endsWith(":img")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
- else if (lowerName.equals("map") || lowerName.endsWith(":map")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
- else if (lowerName.equals("title") || lowerName.endsWith(":title")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE);
- else
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG);
- }
- if (image == null) {
- image = super.createImage(node);
- }
- return image;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
deleted file mode 100644
index b123df94ad..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-public class AbstractDeviceProfileEntry implements DeviceProfileEntry {
-
- public AbstractDeviceProfileEntry() {
- super();
- }
-
- public String getEntryId() {
- return null;
- }
-
- public String getEntryName() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
deleted file mode 100644
index 664084c663..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-public class AbstractDeviceProfileEntryProvider implements
- DeviceProfileEntryProvider {
-
- public AbstractDeviceProfileEntryProvider() {
- super();
- }
-
- public Iterator getDeviceProfileEntries() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
deleted file mode 100644
index 75b272d25e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
-
-/**
- * @deprecated This class only contains helper methods that you should
- * actually implement yourself.
- */
-public final class ContentSettingsRegistry {
-
- private static final String NONE = HTMLUIMessages.UI_none;
-
- public static String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
- public static String maxLengthStringInCharacterCodeRegistry = ""; //$NON-NLS-1$
-
- private ContentSettingsRegistry() {
- }
-
- public static void setHTMLDocumentTypeRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- String publicId = entry.getPublicId();
- String displayName = entry.getDisplayName();
- if (displayName != null) {
- combo.add(displayName, publicId);
- if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = displayName;
- }
- else
- combo.add(publicId, publicId);
- if (publicId.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = publicId;
- if (entry.getSystemId() == null)
- continue; // if HTML entry
- if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
- }
-
- combo.sortByKey(1);
- }
-
- public static void setCSSMetaModelRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- combo.add(name, id);
- }
- combo.sortByKey(1);
- }
-
- public static void setDeviceProfileRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- DeviceProfileEntryProvider reg = DeviceProfileEntryProviderBuilder.getEntryProvider();
- if (reg == null) {
- return;
- }
- Iterator profiles = reg.getDeviceProfileEntries();
- if (profiles == null) {
- reg.release();
- return;
- }
- DeviceProfileEntry entry;
- while (profiles.hasNext()) {
- entry = (DeviceProfileEntry) profiles.next();
- combo.add(entry.getEntryName(), entry.getEntryId());
- entry.release();
- }
- reg.release();
- combo.sortByKey(1);
- }
-
- public static String getSystemIdFrom(String publicId) {
- if (publicId == null || publicId.length() == 0)
- return null;
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- if (entry.getPublicId().equals(publicId))
- return entry.getSystemId();
- }
- return null;
- }
-
- public static void setContentTypeInto(ComboList combo) {
- String[] type = {"", //$NON-NLS-1$
- "application/xhtml+xml", //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- String[] displayName = {NONE, "application/xhtml+xml", //$NON-NLS-1$
- //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- for (int i = 0; i < type.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], type[i]);
- else
- combo.add(type[i], type[i]);
- }
-
- }
-
- public static void setCharacterCodeInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- String max = ""; //$NON-NLS-1$
- // CommonCharsetNames encoding = new CommonCharsetNames();
- String[] charCode = CommonCharsetNames.getCommonCharsetNames();
- for (int i = 0; i < charCode.length; i++) {
- String displayName = CommonCharsetNames.getDisplayString(charCode[i]);
- if (displayName != null && displayName.length() != 0) {
- combo.add(displayName, charCode[i]);
- int n_byte = displayName.getBytes().length;
- if (max.getBytes().length < n_byte)
- max = displayName;
- }
- else
- combo.add(charCode[i], charCode[i]);
- }
- /*
- * charCode = encoding.getSupportedJavaEncodings(); for(int i=0;i<charCode.length;i++){
- * String displayName = encoding.getDisplayString(charCode[i]); if
- * (displayName!=null && displayName.length()!=0)
- * combo.add(displayName,charCode[i]); else
- * combo.add(charCode[i],charCode[i]); }
- */
- // combo.sortByKey(1);
- maxLengthStringInCharacterCodeRegistry = max;
- }
-
- public static void setLanguageInto(ComboList combo) {
- String[] lang = {"", //$NON-NLS-1$
- "java", //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- String[] displayName = {NONE, "java", //$NON-NLS-1$
- //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- for (int i = 0; i < lang.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], lang[i]);
- else
- combo.add(lang[i], lang[i]);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
deleted file mode 100644
index c42cb159a3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients directly.
- * Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
- * </p>
- *
- * @deprecated Not needed. See BUG118359
- */
-public interface DeviceProfileEntry {
- public String getEntryId();
-
- public String getEntryName();
-
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
deleted file mode 100644
index fe607798e5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients directly.
- * Instead, please use abstract class(AbstractDeviceProfileEntryProvider)
- * instead.
- * </p>
- *
- * @deprecated Not needed. See BUG118359
- */
-public interface DeviceProfileEntryProvider {
- public Iterator getDeviceProfileEntries();
-
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
deleted file mode 100644
index 3263eaa304..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-public class DeviceProfileEntryProviderBuilder {
- private static final String EXTENSION_POINT_PLUGINID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
- private static final String EXTENSION_POINT_NAME = "deviceProfileEntryProvider"; //$NON-NLS-1$
- private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
- public DeviceProfileEntryProviderBuilder() {
- super();
- }
- static public DeviceProfileEntryProvider getEntryProvider() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_PLUGINID, EXTENSION_POINT_NAME);
- if (point != null) {
- IExtension extensions[] = point.getExtensions();
- if ((extensions != null) && (extensions.length > 0)) {
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement elements[] = extensions[i].getConfigurationElements();
- if ((elements != null) && (elements.length > 0)) {
- for (int j = 0; j < elements.length; j++) {
- IConfigurationElement config = elements[j];
- if ((config != null) && (config.getName().equals(EXTENSION_POINT_NAME) == true)) {
- String className = config.getAttribute(ATTR_CLASS);
- if (className != null) {
- try {
- DeviceProfileEntryProvider provider = (DeviceProfileEntryProvider)config.createExecutableExtension(ATTR_CLASS);
- if (provider != null) {
- return provider;
- }
- } catch (CoreException ignored) {
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
deleted file mode 100644
index 395fdedfca..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
-
-/**
- * @deprecated Use WebContentSettingsPropertyPage instead
- */
-public final class HTMLContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public HTMLContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.FILE :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "HTMLContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(HTMLUIMessages.UI_Public_ID);
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(HTMLUIMessages.UI_System_ID);
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
deleted file mode 100644
index 333c615c7f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
-
-/**
- * @deprecated Use ProjectHTMLContentSettingsPropertyPage instead
- */
-public final class ProjectContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public ProjectContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.PROJECT :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "ProjectContentSettingsPropertyPage is instantiated by resource except PROJECT");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
-
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
-
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
-
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(HTMLUIMessages.UI_Public_ID);
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(HTMLUIMessages.UI_System_ID);
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class
- // ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
deleted file mode 100644
index 6ccbe4cec4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-public class ProjectWebContentSettingsPropertyPage extends WebContentSettingsPropertyPage {
- public ProjectWebContentSettingsPropertyPage() {
- setDescription(HTMLUIMessages.ProjectWebContentSettingsPropertyPage_0);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
deleted file mode 100644
index cacd68657b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-public class WebContentSettingsPropertyPage extends PropertyPage {
- private static final String SELECT_NONE = HTMLUIMessages.UI_none;
- private String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
-
- private class ComboSelectionListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int index = fDocumentTypeCombo.getSelectionIndex();
- String doctype = (String) fDocumentTypeIds.get(index);
- updateDoctypeText(index, doctype);
- }
- }
-
- Combo fDocumentTypeCombo;
- List fDocumentTypeIds;
- private Text fPublicIdText;
- private Text fSystemIdText;
- private Combo fProfileCombo;
- private List fProfileIds;
- private SelectionListener fListener;
-
- public WebContentSettingsPropertyPage() {
- super();
- setDescription(HTMLUIMessages.WebContentSettingsPropertyPage_0);
- }
-
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite propertyPage = createComposite(parent, 2);
-
- createDoctypeContents(propertyPage);
- createCSSProfileContents(propertyPage);
-
- populateValues();
- initializeValues();
- computeMaxWidthHint();
-
- fListener = new ComboSelectionListener();
- fDocumentTypeCombo.addSelectionListener(fListener);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- Dialog.applyDialogFont(parent);
- return propertyPage;
- }
-
- private void createCSSProfileContents(Composite parent) {
- // CSS Profile
- Label languageLabel = new Label(parent, SWT.NONE);
- languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
- fProfileCombo = new Combo(parent, SWT.READ_ONLY);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fProfileCombo.setLayoutData(data);
- }
-
- private void createDoctypeContents(Composite parent) {
- // create description of implicit DOCTYPE
- Text doctypeLabel = new Text(parent, SWT.READ_ONLY);
- doctypeLabel.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- data.horizontalSpan = 2;
- doctypeLabel.setLayoutData(data);
-
- // document type
- Label languageLabel = new Label(parent, SWT.NONE);
- languageLabel.setText(HTMLUIMessages.UI_Default_HTML_DOCTYPE_ID___1);
- fDocumentTypeCombo = new Combo(parent, SWT.READ_ONLY);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fDocumentTypeCombo.setLayoutData(data);
-
- // public ID
- Label publicIdLabel = new Label(parent, SWT.NONE);
- publicIdLabel.setText(HTMLUIMessages.UI_Public_ID);
- fPublicIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fPublicIdText.setLayoutData(data);
-
- // system ID
- Label systemIdLabel = new Label(parent, SWT.NONE);
- systemIdLabel.setText(HTMLUIMessages.UI_System_ID);
- fSystemIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fSystemIdText.setLayoutData(data);
-
- // create separator
- Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
- /**
- * Get the resource this properties page is for
- *
- * @return IResource for this properties page or null if there is no
- * IResource
- */
- private IResource getResource() {
- IResource resource = null;
- 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 String getSystemIdFrom(String publicId) {
- if (publicId == null || publicId.length() == 0)
- return null;
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- if (entry.getPublicId().equals(publicId))
- return entry.getSystemId();
- }
- return null;
- }
-
- private void initializeValues() {
- initializeDoctypeValues();
- initializeCSSProfileValues();
- }
-
- private void initializeCSSProfileValues() {
- int index = 0;
- String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
- if (profile != null && profile.length() > 0) {
- /*
- * If item is already part of combo, select it. Otherwise, select
- * none.
- */
- index = fProfileIds.indexOf(profile);
- }
- index = index >= 0 ? index : 0;
- fProfileCombo.select(index);
- }
-
- private void initializeDoctypeValues() {
- int index = 0;
- String doctype = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), false);
- if (doctype != null) {
- /*
- * If item is already part of combo, select it. Otherwise, select
- * none.
- */
- index = fDocumentTypeIds.indexOf(doctype);
- }
-
- // set combobox
- index = index >= 0 ? index : 0;
- fDocumentTypeCombo.select(index);
-
- updateDoctypeText(index, doctype);
- }
-
- void updateDoctypeText(int index, String doctype) {
- if (index > 0) {
- // set public/system id text
- fPublicIdText.setText(doctype);
- String systemId = getSystemIdFrom(doctype);
- if (systemId != null)
- fSystemIdText.setText(systemId);
- else
- fSystemIdText.setText(""); //$NON-NLS-1$
- }
- else {
- // set public/system id text
- fPublicIdText.setText(""); //$NON-NLS-1$
- fSystemIdText.setText(""); //$NON-NLS-1$
- }
- }
-
- private void populateValues() {
- populateDoctypeValues();
- populateCSSProfileValues();
- }
-
- private void populateCSSProfileValues() {
- fProfileIds = new ArrayList();
- // add none first
- fProfileCombo.add(SELECT_NONE);
- fProfileIds.add(null);
-
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- fProfileCombo.add(name);
- fProfileIds.add(id);
- }
- }
-
- private void populateDoctypeValues() {
- fDocumentTypeIds = new ArrayList();
- // add none first
- fDocumentTypeCombo.add(SELECT_NONE);
- fDocumentTypeIds.add(null);
-
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- String publicId = entry.getPublicId();
- String displayName = entry.getDisplayName();
- displayName = displayName != null ? displayName : publicId;
-
- fDocumentTypeCombo.add(displayName);
- fDocumentTypeIds.add(publicId);
-
- if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length()) {
- maxLengthStringInHTMLDocumentTypeRegistry = displayName;
- }
-
- if (entry.getSystemId() == null)
- continue; // if HTML entry
-
-
- if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
- }
- }
-
- private void computeMaxWidthHint() {
- // maxLengthString was set populateDoctypeValues was called
- String maxLengthString = maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = fSystemIdText.getText();
- fSystemIdText.setText(maxLengthString);
- int maxWidthHint = fSystemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- fSystemIdText.setText(backup);
-
- if (fDocumentTypeCombo.getLayoutData() != null)
- ((GridData) fDocumentTypeCombo.getLayoutData()).widthHint = maxWidthHint;
- if (fPublicIdText.getLayoutData() != null)
- ((GridData) fPublicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (fSystemIdText.getLayoutData() != null)
- ((GridData) fSystemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (fProfileCombo.getLayoutData() != null)
- ((GridData) fProfileCombo.getLayoutData()).widthHint = maxWidthHint;
- }
-
- private void performCSSProfileDefaults() {
- int index = fProfileCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fProfileCombo.select(index);
-
- super.performDefaults();
- }
-
- private boolean performCSSProfileOk() {
- int index = fProfileCombo.getSelectionIndex();
- if (index > -1) {
- String id = (String) fProfileIds.get(index);
- if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- id = null;
- }
- try {
- CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving
- // file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- return false;
- }
- }
- return true;
- }
-
- protected void performDefaults() {
- super.performDefaults();
-
- performDoctypeDefaults();
- performCSSProfileDefaults();
- }
-
- private void performDoctypeDefaults() {
- fPublicIdText.setText("");//$NON-NLS-1$
- fSystemIdText.setText(""); //$NON-NLS-1$
- int index = fDocumentTypeCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fDocumentTypeCombo.select(index);
- }
-
- private boolean performDoctypeOk() {
- int index = fDocumentTypeCombo.getSelectionIndex();
- if (index > -1) {
- String id = (String) fDocumentTypeIds.get(index);
- if (id == null || id.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- id = null;
- }
- try {
- HTMLContentProperties.setProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), id);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving
- // file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- return false;
- }
- }
- return true;
- }
-
- public boolean performOk() {
- if (performDoctypeOk() || performCSSProfileOk()) {
- // touch to mark for build-driven revalidation
- IResource resource = getResource();
- if (resource != null) {
- try {
- resource.accept(new IResourceVisitor() {
-
- public boolean visit(IResource resource) throws CoreException {
- try {
- resource.touch(null);
- }
- catch (CoreException e) {
- return false;
- }
- return true;
- }
- }, IResource.DEPTH_INFINITE, false);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- return super.performOk();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
deleted file mode 100644
index 3ddb028abe..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
+++ /dev/null
@@ -1,54 +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 - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.correction;
-
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
-
-/**
- * Correction assistant for HTML
- *
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class CorrectionAssistantProviderHTML extends CorrectionAssistantProvider {
-
- public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = null;
-
- if (sourceViewer != null) {
- ContentAssistant assistant = new ContentAssistant();
-
- if (sourceViewer != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
- assistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
- }
- ca = assistant;
- }
-
- return ca;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index 3860bbcbcf..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
- * Modification was made to fix statement unnecessarily nested within else
- * clause warning in read(..).
- */
-public abstract class SingleCharReader extends Reader {
-
- /**
- * @see Reader#read()
- */
- public abstract int read() throws IOException;
-
- /**
- * @see Reader#read(char[],int,int)
- */
- public int read(char cbuf[], int off, int len) throws IOException {
- int end = off + len;
- for (int i = off; i < end; i++) {
- int ch = read();
- if (ch == -1) {
- if (i == off) {
- return -1;
- }
- return i - off;
- }
- cbuf[i] = (char) ch;
- }
- return len;
- }
-
- /**
- * @see Reader#ready()
- */
- public boolean ready() throws IOException {
- return true;
- }
-
- /**
- * Gets the content as a String
- */
- public String getString() throws IOException {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = read()) != -1) {
- buf.append((char) ch);
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
deleted file mode 100644
index c471d0622c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-/**
- *
- * Instead, use SourcePageActionContributor for source page contributor
- * of multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorHTML extends ActionContributorXML {
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
-
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
deleted file mode 100644
index 6d8fd56fb0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Cleanup action delegate for HTML editor
- */
-public class CleanupActionHTMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- fCleanupProcessor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(HTMLUIMessages.CleanupDocument_label);
- action.setToolTipText(HTMLUIMessages.CleanupDocument_tooltip);
- action.setDescription(HTMLUIMessages.CleanupDocument_description);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- final ITextEditor editor = (ITextEditor) fEditor;
- CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell());
- cleanupDialog.setisXHTMLType(isXHTML());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null)
- cleanupProcessor.cleanupModel(model);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(fEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new HTMLCleanupProcessorImpl();
-
- return fCleanupProcessor;
- }
-
- private boolean isXHTML() {
- boolean isxhtml = false;
- if (fEditor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor) fEditor;
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- IDOMDocument domDocument = ((IDOMModel) model).getDocument();
- if (domDocument != null)
- isxhtml = domDocument.isXMLType();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return isxhtml;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
deleted file mode 100644
index 97642105ff..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
+++ /dev/null
@@ -1,333 +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.html.ui.internal.edit.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class CleanupDialogHTML extends Dialog implements SelectionListener {
-
- protected Button fRadioButtonTagNameCaseAsis;
- protected Button fRadioButtonTagNameCaseLower;
- protected Button fRadioButtonTagNameCaseUpper;
- protected Button fRadioButtonAttrNameCaseAsis;
- protected Button fRadioButtonAttrNameCaseLower;
- protected Button fRadioButtonAttrNameCaseUpper;
- protected Button fCheckBoxCompressEmptyElementTags;
- protected Button fCheckBoxInsertRequiredAttrs;
- protected Button fCheckBoxInsertMissingTags;
- protected Button fCheckBoxQuoteAttrValues;
- protected Button fCheckBoxFormatSource;
- protected Button fCheckBoxConvertEOLCodes;
- protected Button fRadioButtonConvertEOLWindows;
- protected Button fRadioButtonConvertEOLUnix;
- protected Button fRadioButtonConvertEOLMac;
- protected Preferences fPreferences = null;
- private boolean fIsXHTML = false;
- private Group fTagNameCase;
- private Group fAttrNameCase;
-
- public CleanupDialogHTML(Shell shell) {
- super(shell);
- }
-
- protected Control createDialogArea(Composite parent) {
- getShell().setText(HTMLUIMessages.Cleanup_UI_);
- Composite composite = new Composite(parent, SWT.NULL);
-
- createDialogAreaInComposite(composite);
- initializeOptions();
-
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control c = super.createButtonBar(parent);
- okButtonEnablement();
- return c;
- }
-
- protected void createDialogAreaInCompositeForHTML(Composite composite) {
- // Convert tag name case
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- fTagNameCase = new Group(composite, SWT.NONE);
- fTagNameCase.setText(HTMLUIMessages.Tag_name_case_for_HTML_UI_);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- fTagNameCase.setLayout(hLayout);
- fRadioButtonTagNameCaseAsis = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseAsis.setText(HTMLUIMessages.Tag_name_case_As_is_UI_);
- fRadioButtonTagNameCaseAsis.addSelectionListener(this);
- fRadioButtonTagNameCaseLower = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseLower.setText(HTMLUIMessages.Tag_name_case_Lower_UI_);
- fRadioButtonTagNameCaseLower.addSelectionListener(this);
- fRadioButtonTagNameCaseUpper = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseUpper.setText(HTMLUIMessages.Tag_name_case_Upper_UI_);
- fRadioButtonTagNameCaseUpper.addSelectionListener(this);
-
- // Convert attr name case
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- fAttrNameCase = new Group(composite, SWT.NONE);
- fAttrNameCase.setText(HTMLUIMessages.Attribute_name_case_for_HTML_UI_);
- fAttrNameCase.setLayout(hLayout);
- fRadioButtonAttrNameCaseAsis = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseAsis.setText(HTMLUIMessages.Attribute_name_case_As_is_UI_);
- fRadioButtonAttrNameCaseAsis.addSelectionListener(this);
- fRadioButtonAttrNameCaseLower = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseLower.setText(HTMLUIMessages.Attribute_name_case_Lower_UI_);
- fRadioButtonAttrNameCaseLower.addSelectionListener(this);
- fRadioButtonAttrNameCaseUpper = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseUpper.setText(HTMLUIMessages.Attribute_name_case_Upper_UI_);
- fRadioButtonAttrNameCaseUpper.addSelectionListener(this);
- }
-
- protected void createDialogAreaInComposite(Composite composite) {
- createDialogAreaInCompositeForHTML(composite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CLEANUP_HTML_HELPID); // use
- // HTML
- // specific
- // help
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- composite.setLayout(layout);
-
- // Compress empty element tags
- fCheckBoxCompressEmptyElementTags = new Button(composite, SWT.CHECK);
- fCheckBoxCompressEmptyElementTags.setText(XMLUIMessages.Compress_empty_element_tags_UI_);
- fCheckBoxCompressEmptyElementTags.addSelectionListener(this);
-
- // Insert missing required attrs
- fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
- fCheckBoxInsertRequiredAttrs.setText(HTMLUIMessages.Insert_required_attributes_UI_);
- fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
- // Insert missing begin/end tags
- fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
- fCheckBoxInsertMissingTags.setText(HTMLUIMessages.Insert_missing_tags_UI_);
- fCheckBoxInsertMissingTags.addSelectionListener(this);
-
- // Quote attribute values
- fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
- fCheckBoxQuoteAttrValues.setText(HTMLUIMessages.Quote_attribute_values_UI_);
- fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
- // Format source
- fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
- fCheckBoxFormatSource.setText(HTMLUIMessages.Format_source_UI_);
- fCheckBoxFormatSource.addSelectionListener(this);
-
- // Convert EOL code
- fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
- fCheckBoxConvertEOLCodes.setText(HTMLUIMessages.Convert_EOL_codes_UI_);
- fCheckBoxConvertEOLCodes.addSelectionListener(this);
- Composite EOLCodes = new Composite(composite, SWT.NULL);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- EOLCodes.setLayout(hLayout);
- fRadioButtonConvertEOLWindows = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLWindows.setText(HTMLUIMessages.EOL_Windows_UI);
- fRadioButtonConvertEOLWindows.addSelectionListener(this);
- fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLUnix.setText(HTMLUIMessages.EOL_Unix_UI);
- fRadioButtonConvertEOLUnix.addSelectionListener(this);
- fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLMac.setText(HTMLUIMessages.EOL_Mac_UI);
- fRadioButtonConvertEOLMac.addSelectionListener(this);
- }
-
- protected void okPressed() {
- storeOptions();
-
- super.okPressed();
- }
-
- protected void initializeOptionsForHTML() {
- boolean caseSensitive = isXHTMLType();
-
- if (caseSensitive) {
- fRadioButtonTagNameCaseLower.setSelection(true);
- } else {
- int tagNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE);
- if (tagNameCase == HTMLCorePreferenceNames.UPPER) {
- fRadioButtonTagNameCaseUpper.setSelection(true);
- } else if (tagNameCase == HTMLCorePreferenceNames.LOWER)
- fRadioButtonTagNameCaseLower.setSelection(true);
- else
- fRadioButtonTagNameCaseAsis.setSelection(true);
- }
-
- if (caseSensitive) {
- fRadioButtonAttrNameCaseLower.setSelection(true);
- } else {
- int attrNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE);
- if (attrNameCase == HTMLCorePreferenceNames.UPPER) {
- fRadioButtonAttrNameCaseUpper.setSelection(true);
- } else if (attrNameCase == HTMLCorePreferenceNames.LOWER)
- fRadioButtonAttrNameCaseLower.setSelection(true);
- else
- fRadioButtonAttrNameCaseAsis.setSelection(true);
- }
-
- enableCaseControls(!caseSensitive);
- }
-
- protected void initializeOptions() {
- initializeOptionsForHTML();
-
- fCheckBoxCompressEmptyElementTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- String EOLCode = getModelPreferences().getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE);
- if (EOLCode == CommonEncodingPreferenceNames.LF)
- fRadioButtonConvertEOLUnix.setSelection(true);
- else if (EOLCode == CommonEncodingPreferenceNames.CR)
- fRadioButtonConvertEOLMac.setSelection(true);
- else
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- protected void storeOptionsForHTML() {
- if (!isXHTMLType() && fRadioButtonTagNameCaseUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else if (fRadioButtonTagNameCaseLower.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-
- if (!isXHTMLType() && fRadioButtonAttrNameCaseUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else if (fRadioButtonAttrNameCaseLower.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- protected void storeOptions() {
- storeOptionsForHTML();
-
- getModelPreferences().setValue(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
-
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- if (fRadioButtonConvertEOLUnix.getSelection()) {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
- } else if (fRadioButtonConvertEOLMac.getSelection()) {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
- } else {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
- }
- }
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == fCheckBoxConvertEOLCodes)
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
-
- okButtonEnablement();
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- private boolean isXHTMLType() {
- return fIsXHTML;
- }
-
- protected void enableEOLCodeRadios(boolean enable) {
- if ((fRadioButtonConvertEOLWindows != null) && (fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLMac != null)) {
- fRadioButtonConvertEOLWindows.setEnabled(enable);
- fRadioButtonConvertEOLUnix.setEnabled(enable);
- fRadioButtonConvertEOLMac.setEnabled(enable);
-
- if (!fRadioButtonConvertEOLWindows.getSelection() && !fRadioButtonConvertEOLUnix.getSelection() && !fRadioButtonConvertEOLMac.getSelection())
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- }
-
- /**
- * Enables/disables the tag/attr case radio buttons
- */
- private void enableCaseControls(boolean enable) {
- fTagNameCase.setEnabled(enable);
- fRadioButtonTagNameCaseAsis.setEnabled(enable);
- fRadioButtonTagNameCaseLower.setEnabled(enable);
- fRadioButtonTagNameCaseUpper.setEnabled(enable);
-
- fAttrNameCase.setEnabled(enable);
- fRadioButtonAttrNameCaseAsis.setEnabled(enable);
- fRadioButtonAttrNameCaseLower.setEnabled(enable);
- fRadioButtonAttrNameCaseUpper.setEnabled(enable);
- }
-
- /**
- * Enables/disables OK button
- *
- */
- private void okButtonEnablement() {
- boolean tagNameCaseCheck = ((fRadioButtonTagNameCaseUpper != null && fRadioButtonTagNameCaseUpper.getSelection()) || fRadioButtonTagNameCaseLower.getSelection());
- boolean attrNameCaseCheck = ((fRadioButtonAttrNameCaseUpper != null && fRadioButtonAttrNameCaseUpper.getSelection()) || fRadioButtonAttrNameCaseLower.getSelection());
- boolean eolCheck = fCheckBoxConvertEOLCodes.getSelection() && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection());
- boolean buttonEnabled = false;
- if (isXHTMLType()){
- buttonEnabled = fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
- }
- else {
- buttonEnabled = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
- }
- getButton(IDialogConstants.OK_ID).setEnabled(buttonEnabled);
- }
-
- void setisXHTMLType(boolean isXHTML) {
- fIsXHTML = isXHTML;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java
deleted file mode 100644
index 75c5267d26..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class CleanupDocumentHandler extends AbstractHandler implements IHandler {
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void dispose() {
- // nulling out just in case
- fCleanupProcessor = null;
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editorPart instanceof ITextEditor)
- textEditor = (ITextEditor) editorPart;
- else {
- Object o = editorPart.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- final ITextEditor editor = textEditor;
- CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell());
- cleanupDialog.setisXHTMLType(isXHTML(editor));
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null)
- cleanupProcessor.cleanupModel(model);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(editor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- return null;
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new HTMLCleanupProcessorImpl();
-
- return fCleanupProcessor;
- }
-
- private boolean isXHTML(ITextEditor editor) {
- boolean isxhtml = false;
- if (editor != null) {
- IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- IDOMDocument domDocument = ((IDOMModel) model).getDocument();
- if (domDocument != null)
- isxhtml = domDocument.isXMLType();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return isxhtml;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
deleted file mode 100644
index ab6450af50..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.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.html.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- */
-public class HTMLEditorPluginImageHelper {
- private final String PLUGINID = HTMLUIPlugin.ID;
- private static HTMLEditorPluginImageHelper instance = null;
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a HTMLEditorPluginImageHelper
- */
- public synchronized static HTMLEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new HTMLEditorPluginImageHelper();
- return instance;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- //create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return HTMLUIPlugin.getInstance().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.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
deleted file mode 100644
index 1fa0f242e7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.editor;
-
-/**
- * Bundle of most images used by the HTML Editor plug-in.
- */
-public class HTMLEditorPluginImages {
- public static final String IMG_OBJ_TABLE = "icons/full/obj16/table.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_ANCHOR = "icons/full/obj16/tag-anchor.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BODY = "icons/full/obj16/tag-body.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BUTTON = "icons/full/obj16/tag-button.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FONT = "icons/full/obj16/tag-font.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FORM = "icons/full/obj16/tag-form.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_HTML = "icons/full/obj16/tag-html.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE_MAP = "icons/full/obj16/tag-image-map.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE = "icons/full/obj16/tag-image.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_JSP = "icons/full/obj16/tag-jsp.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_TEMPLATE = "icons/full/obj16/tag-template.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_TITLE = "icons/full/obj16/tag-title.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG = "icons/full/obj16/tag.gif"; //$NON-NLS-1$
- public static final String IMG_WIZBAN_NEWHTMLFILE = "icons/full/wizban/newhfile_wiz.png"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 569b7240a3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.editor;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-
-/**
- * Help context ids for the HTML Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.html.ui.
- public static final String PREFIX = HTMLUIPlugin.ID + "."; //$NON-NLS-1$
-
- // // figured out on the fly
- // // HTML Source page editor
- // public static final String HTML_SOURCEVIEW_HELPID =
- // ContentTypeIdForHTML.ContentTypeID_HTML +"_source_HelpId";
- // //$NON-NLS-1$
-
- // HTML Files Preference page
- public static final String HTML_PREFWEBX_FILES_HELPID = PREFIX + "webx0030"; //$NON-NLS-1$
- // HTML Source Preference page
- public static final String HTML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0031"; //$NON-NLS-1$
- // HTML Styles Preference page
- public static final String HTML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0032"; //$NON-NLS-1$
- // HTML Templates Preference page
- public static final String HTML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0033"; //$NON-NLS-1$
-
- // HTML Cleanup dialog
- public static final String CLEANUP_HTML_HELPID = PREFIX + "xmlm1100"; //$NON-NLS-1$
-
- // HTML Content Settings
- public static final String WEB_CONTENT_SETTINGS_HELPID = PREFIX + "misc0170"; //$NON-NLS-1$
-
- // HTML New File Wizard - Template Page
- public static final String HTML_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "htmlw0010"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
deleted file mode 100644
index 68cc317bfc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.wst.html.ui.internal.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-public class HTMLFindOccurrencesHandler extends AbstractHandler implements IHandler {
- private List fProcessors;
-
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- boolean okay = false;
-
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
-
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null) {
- ITextSelection textSelection = getTextSelection(textEditor);
- FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
- if (findOccurrenceProcessor != null) {
- if (textEditor.getEditorInput() instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
- okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
- }
- }
- }
- }
- if (okay) {
- // clear status message
- PlatformStatusLineUtil.clearStatusLine();
- }
- else {
- String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
- if (textEditor instanceof StructuredTextEditor) {
- PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
- }
- else {
- PlatformStatusLineUtil.displayErrorMessage(errorMessage);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
- return null;
- }
-
- /**
- * Get the appropriate find occurrences processor
- *
- * @param document -
- * assumes not null
- * @param textSelection
- * @return
- */
- private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
- // check if we have an action that's enabled on the current partition
- ITypedRegion tr = getPartition(document, textSelection);
- String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
-
- Iterator it = getProcessors().iterator();
- FindOccurrencesProcessor processor = null;
- while (it.hasNext()) {
- processor = (FindOccurrencesProcessor) it.next();
- // we just choose the first action that can handle the partition
- if (processor.enabledForParitition(partition))
- return processor;
- }
-
- List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
- for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
- Object o = extendedFindOccurrencesProcessors.get(i);
- if (o instanceof FindOccurrencesProcessor) {
- /*
- * We just choose the first registered processor that
- * explicitly says it can handle the partition
- */
- processor = (FindOccurrencesProcessor) o;
- if (processor.enabledForParitition(partition))
- return processor;
- }
- }
- return null;
- }
-
- private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
- ITypedRegion region = null;
- if (textSelection != null) {
- try {
- region = document.getPartition(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- region = null;
- }
- }
- return region;
- }
-
- private ITextSelection getTextSelection(ITextEditor textEditor) {
- ITextSelection textSelection = null;
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection && !selection.isEmpty()) {
- textSelection = (ITextSelection) selection;
- }
- return textSelection;
- }
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
- }
- return fProcessors;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
deleted file mode 100644
index e48f0deb28..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-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.ITextViewerExtension5;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-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.progress.UIJob;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.validate.ModuleCoreSupport;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.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.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.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.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.ibm.icu.util.StringTokenizer;
-
-public class AnchorHyperlinkDetector extends AbstractHyperlinkDetector {
- static class ExternalElementHyperlink implements IHyperlink {
- private String fAnchorName = null;
- private Element fBaseElement = null;
- private Display fDisplay = null;
- private IRegion fHyperlinkRegion = null;
-
- /**
- * @param hyperlinkRegion
- * @param anchorName
- */
- public ExternalElementHyperlink(Display display, IRegion hyperlinkRegion, String anchorName, Element baseElement) {
- super();
- fDisplay = display;
- fHyperlinkRegion = hyperlinkRegion;
- fAnchorName = anchorName;
- fBaseElement = baseElement;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- IStatus _open() {
- if (fBaseElement instanceof IDOMNode) {
- StringTokenizer tokenizer = new StringTokenizer(fAnchorName, "#"); //$NON-NLS-1$
- String filename = null;
- String anchorName = null;
- if (tokenizer.hasMoreTokens()) {
- try {
- filename = tokenizer.nextToken();
- anchorName = tokenizer.nextToken();
- }
- catch (NoSuchElementException e) {
- // poorly formed value
- }
- }
- if (filename != null && anchorName != null) {
- // System.out.println(filename + ":" + anchorName + "-" +
- // fBaseElement);
-
- IPath basePath = new Path(((IDOMNode) fBaseElement).getModel().getBaseLocation());
- if (basePath.segmentCount() > 1) {
- IPath resolved = ModuleCoreSupport.resolve(basePath, filename);
- IFile targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile(resolved);
- if (targetFile.isAccessible()) {
- IStructuredModel model = null;
- int start = -1;
- int end = -1;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead(targetFile);
- if (model instanceof IDOMModel) {
- NodeList anchors = ((IDOMModel) model).getDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$
- for (int i = 0; i < anchors.getLength() && start < 0; i++) {
- Node item = anchors.item(i);
- Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);
- if (nameNode == null)
- nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {
- start = ((IndexedRegion) nameNode).getStartOffset();
- end = ((IndexedRegion) nameNode).getEndOffset();
- }
- }
- }
- anchors = ((IDOMModel) model).getDocument().getElementsByTagName(HTML40Namespace.ElementName.A);
- for (int i = 0; i < anchors.getLength() && start < 0; i++) {
- Node item = anchors.item(i);
- Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);
- if (nameNode == null)
- nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {
- start = ((IndexedRegion) nameNode).getStartOffset();
- end = ((IndexedRegion) nameNode).getEndOffset();
- }
- }
- }
-
- anchors = ((IDOMModel) model).getDocument().getElementsByTagName("*"); //$NON-NLS-1$
- for (int i = 0; i < anchors.getLength() && start < 0; i++) {
- Node item = anchors.item(i);
- Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);
- if (nameNode == null)
- nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {
- start = ((IndexedRegion) nameNode).getStartOffset();
- end = ((IndexedRegion) nameNode).getEndOffset();
- }
- }
- }
-
- }
- return open(basePath.toString(), targetFile, start, end);
- }
- catch (Exception e) {
- Logger.logException(e);
- return new Status(IStatus.ERROR, HTMLUIPlugin.ID, e.getMessage());
-
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
- }
- }
- return Status.OK_STATUS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return NLS.bind(HTMLUIMessages.Open, fAnchorName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- public void open() {
- scheduleOpen();
- }
-
- /**
- * @param targetFile
- * @param start
- * @param end
- */
- private IStatus open(String base, IFile targetFile, int start, int end) throws CoreException, PartInitException {
- IMarker temporaryMarker = null;
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- IEditorPart editor = IDE.openEditor(page, targetFile);
-
- if (0 <= start && start <= end) {
- temporaryMarker = targetFile.createMarker(IMarker.BOOKMARK);
- temporaryMarker.setAttribute(IMarker.MESSAGE, base);
- temporaryMarker.setAttribute(IMarker.CHAR_START, start);
- temporaryMarker.setAttribute(IMarker.CHAR_END, end);
- IDE.gotoMarker(editor, temporaryMarker);
- }
- return Status.OK_STATUS;
- }
- finally {
- if (temporaryMarker != null)
- try {
- temporaryMarker.delete();
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- void scheduleOpen() {
- Job opener = new UIJob(fDisplay, fAnchorName) {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- return _open();
- }
-
- };
- opener.setSystem(true);
- opener.setUser(false);
- opener.schedule();
- }
- }
-
- /**
- * Links to the given target node within the text viewer. The target node
- * is expected to implement IndexedNode and appear in that text viewer
- * (i.e. same editor).
- *
- */
- static class InternalElementHyperlink implements IHyperlink {
- private IRegion fHyperlinkRegion;
- private Node fTarget = null;
- private ITextViewer fViewer = null;
-
- /**
- *
- */
- public InternalElementHyperlink(ITextViewer textViewer, IRegion hyperlinkRegion, Node targetNode) {
- fHyperlinkRegion = hyperlinkRegion;
- fTarget = targetNode;
- fViewer = textViewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- if (fTarget instanceof IndexedRegion) {
- try {
- int line = fViewer.getDocument().getLineOfOffset(((IndexedRegion) fTarget).getStartOffset()) + 1;
- return NLS.bind(HTMLUIMessages.Hyperlink_line, new String[]{fTarget.getNodeName(), fTarget.getNodeValue(), String.valueOf(line)});
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- return NLS.bind(HTMLUIMessages.Open, fTarget.getNodeName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- if (fTarget instanceof IndexedRegion) {
- int offset = ((IndexedRegion) fTarget).getStartOffset();
- if (fViewer instanceof ITextViewerExtension5) {
- offset = ((ITextViewerExtension5) fViewer).modelOffset2WidgetOffset(offset);
- }
- fViewer.getSelectionProvider().setSelection(new TextSelection(offset, 0));
- fViewer.revealRange(offset, 0);
- }
- }
- }
-
- public AnchorHyperlinkDetector() {
- super();
- }
-
- private void addHyperLinkForHref(ITextViewer textViewer, IRegion linkRegion, Element element, String hrefValue, List links, Node anchor) {
- Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_HREF);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (hrefValue.equals(name) && nameNode instanceof IndexedRegion) {
- links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));
- }
- }
- }
-
- private void addHyperLinkForName(ITextViewer textViewer, IRegion linkRegion, Element element, String anchorName, List links, Node anchor) {
- Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {
- links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));
- }
- }
- nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);
- if (nameNode != null) {
- String name = nameNode.getNodeValue();
- if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {
- links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));
- }
- }
- }
-
- /**
- * @param documentRegion
- * @param valueRegion
- * @return
- */
- private IRegion createHyperlinkRegion(IStructuredDocumentRegion documentRegion, ITextRegion valueRegion) {
- return new Region(documentRegion.getStartOffset(valueRegion), valueRegion.getTextLength());
- }
-
- // link to anchors with the given name (value includes the '#')
- IHyperlink[] createHyperlinksToAnchorNamed(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String anchorName, boolean canShowMultipleHyperlinks) {
- List links = new ArrayList(1);
- // >1 guards the substring-ing
- if (anchorName.length() > 1 && anchorName.startsWith("#")) { //$NON-NLS-1$
- // an anchor in this document
- NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$
- String internalAnchorName = anchorName.substring(1);
-// for (int i = 0; i < anchors.getLength(); i++) {
-// addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));
-// }
-// anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);
-// for (int i = 0; i < anchors.getLength(); i++) {
-// addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));
-// }
- anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$
- for (int i = 0; i < anchors.getLength(); i++) {
- addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));
- }
- }
- else {
- // another file, possibly very slow to compute ahead of time
- links.add(new ExternalElementHyperlink(textViewer.getTextWidget().getDisplay(), hyperlinkRegion, anchorName, element));
- }
- if (!links.isEmpty()) {
- return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);
- }
- return null;
- }
-
- // link to anchors that link to this target
- IHyperlink[] createReferrerHyperlinks(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String nameValue, boolean canShowMultipleHyperlinks) {
- List links = new ArrayList(1);
- if (nameValue.length() > 0) {
- String target = "#" + nameValue; //$NON-NLS-1$
- NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$
-// for (int i = 0; i < anchors.getLength(); i++) {
-// addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));
-// }
-// anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);
-// for (int i = 0; i < anchors.getLength(); i++) {
-// addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));
-// }
- anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$
- for (int i = 0; i < anchors.getLength(); i++) {
- addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));
- }
- }
- if (!links.isEmpty()) {
- return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);
- }
- return null;
- }
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- if (textViewer != null && region != null) {
- IDocument document = textViewer.getDocument();
- if (document != null) {
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) currentNode;
- IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(region.getOffset());
- ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(region.getOffset());
- ITextRegion nameRegion = null;
- ITextRegion valueRegion = null;
- String name = null;
- String value = null;
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {
- ITextRegionList regions = documentRegion.getRegions();
- /*
- * Could use 2, but there needs to be the tag open
- * and name regions
- */
- int index = regions.indexOf(textRegion);
- if (index >= 4) {
- nameRegion = regions.get(index - 2);
- valueRegion = textRegion;
- name = documentRegion.getText(nameRegion);
- value = StringUtils.strip(documentRegion.getText(valueRegion));
- }
- }
- else if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegion.getType())) {
- ITextRegionList regions = documentRegion.getRegions();
- int index = regions.indexOf(textRegion);
- // minus 3 to leave equal and value regions
- if (index <= regions.size() - 3) {
- nameRegion = textRegion;
- valueRegion = regions.get(index + 2);
- name = documentRegion.getText(nameRegion);
- value = StringUtils.strip(documentRegion.getText(valueRegion));
- }
- }
- if (name != null && value != null) {
- int idx = -1;
- if (HTML40Namespace.ATTR_NAME_HREF.equalsIgnoreCase(name) && (idx = value.indexOf("#")) >= 0) { //$NON-NLS-1$
- String filename = value.substring(0, idx);
- final String anchorName = idx < value.length() - 1? value.substring(idx + 1) : null;
- if (anchorName != null) {
- final IPath basePath = new Path(((IDOMNode) element).getModel().getBaseLocation());
- if (basePath.segmentCount() > 1) {
- if (filename.length() == 0) {
- filename = basePath.lastSegment();
- }
- final IPath resolved = ModuleCoreSupport.resolve(basePath, filename);
- final IFile targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile(resolved);
- if (targetFile.isAccessible())
- return createHyperlinksToAnchorNamed(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);
- }
- }
- }
- if (HTML40Namespace.ATTR_NAME_NAME.equalsIgnoreCase(name)||HTML40Namespace.ATTR_NAME_ID.equalsIgnoreCase(name)) {
- return createReferrerHyperlinks(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- 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.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
deleted file mode 100644
index 11cb1d09d4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 20109 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
-
-/**
- * <p>The readable and writable completion proposal categories configuration
- * for the HTML content type</p>
- */
-public class HTMLCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
-
- /** the ID of the preference page where users can change the preferences */
- private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.html.ui.preferences.contentassist"; //$NON-NLS-1$
-
- /**
- * <p>Creates the configuration</p>
- */
- public HTMLCompletionProposalCategoriesConfiguration() {
- //nothing to do.
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
- */
- public boolean hasAssociatedPropertiesPage() {
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
- */
- public String getPropertiesPageID() {
- return PREFERENCES_PAGE_ID;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
- */
- protected String getShouldNotDisplayOnDefaultPagePrefKey() {
- return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
- */
- protected String getShouldNotDisplayOnOwnPagePrefKey() {
- return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
- */
- protected String getPageSortOrderPrefKey() {
- return HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
- */
- protected String getDefaultPageSortOrderPrefKey() {
- return HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
deleted file mode 100644
index bc91ec69a7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for HTML UI preferences
- */
-public class HTMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = HTMLUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE, true);
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<=");//$NON-NLS-1$
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY, 500);
- // HTML 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$
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified value is black; leaving as widget default
-
- 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.DECL_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_NAME, 0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, 0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, 128, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, 63, 127, 95) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.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, IStyleConstantsXML.PI_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_TEXT, 0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 191, 95, 63) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.ENTITY_REFERENCE, 42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.ENTITY_REFERENCE, styleValue);
-
- // set default new html file template to use in new file wizard
- /*
- * Need to find template name that goes with default template id (name
- * may change for different language)
- */
- store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
-
- // Defaults for the Typing preference page
- store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
- store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true);
- store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, true);
- store.setDefault(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true);
- store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
- store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
-
- // Defaults for Content Assist preference page
- store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
- store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
- store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
- "org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
- "org.eclipse.wst.css.ui.proposalCategory.css\0" +
- "org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
- store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
- "org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0"+
- "org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
- "org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
- "org.eclipse.wst.css.ui.proposalCategory.css");
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
deleted file mode 100644
index 5a060963ab..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences;
-
-/**
- * Preference keys for HTML UI
- */
-public class HTMLUIPreferenceNames {
-
- /**
- * A named preference that controls time before code assist gets auto activated.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE_DELAY = "autoProposeDelay";//$NON-NLS-1$
-
- /**
- * A named preference that controls if code assist gets auto activated.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE = getAutoProposeKey();
-
- private static String getAutoProposeKey() {
- return "autoPropose";//$NON-NLS-1$
- }
-
- /**
- * A named preference that holds the characters that auto activate code
- * assist.
- * <p>
- * Value is of type <code>String</code>. All characters that trigger
- * auto code assist.
- * </p>
- */
- public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
-
- private static String getAutoProposeCodeKey() {
- return "autoProposeCode";//$NON-NLS-1$
- }
-
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = getTemplatesKey();
-
- private static String getTemplatesKey() {
- return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
- }
-
- /**
- * The key to store the last template name used in new HTML file wizard.
- * Template name is stored instead of template id because user-created
- * templates do not have template ids.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-
- /**
- * The initial template ID to be used in the new HTML file wizard. In the absence
- * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
- */
- public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing comments while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_COMMENTS = "completeComments"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing end-tags after entering
- * <code>&lt;/</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_END_TAGS = "completeEndTags"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing the element after entering
- * <code>&gt;</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_ELEMENTS = "completeElements"; //$NON-NLS-1$
-
- /**
- * The key to store the option for removing an end-tag if the start tag is
- * converted to an empty-tag.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_REMOVE_END_TAGS = "removeEndTags"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing strings (" and ') while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing brackets ([ and () while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), ordered is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "html_content_assist_display_on_default_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), order is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "html_content_assist_display_on_own_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "html_content_assist_own_page_sort_order"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "html_content_assist_default_page_sort_order"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java
deleted file mode 100644
index cc3ca1b388..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java
+++ /dev/null
@@ -1,100 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-public class EmptyFilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private Composite createComposite(Composite parent, int numColumns) {
- noDefaultAndApplyButton();
-
- 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;
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createScrolledComposite(parent);
-
- String description = HTMLUIMessages.EmptyFilePreferencePage_0;
- Text text = new Text(composite, SWT.READ_ONLY);
- // some themes on GTK have different background colors for Text and Labels
- text.setBackground(composite.getBackground());
- text.setText(description);
-
- setSize(composite);
- return composite;
- }
-
- private Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1, 1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- public void init(IWorkbench workbench) {
- }
-
- private void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
deleted file mode 100644
index c299dacce8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004,2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
-
-/**
- * @deprecated
- */
-public class HTMLColorPage extends XMLColorPage {
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String)i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public String getSampleText() {
- return HTMLUIMessages.Sample_HTML_doc;
-
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- initDocTypeContextStyleMap(contextStyleMap);
- // FIXME: these were "brute forced" commented out when moving XMLJSPRegionContexts
- // effect is unknown, but thought just to effect preference page
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
-
- initCommonDescriptions(descriptions);
- initDocTypeDescriptions(descriptions);
- }
-
- protected void initStyleList(ArrayList list) {
- initCommonStyleList(list);
- initDocTypeStyleList(list);
- // list.add(HTMLColorManager.SCRIPT_AREA_BORDER);
-
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForHTML.ContentTypeID_HTML).getParser());
-
- // create descriptions for hilighting types
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- // map region types to hilighting types
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- // updatePickerFont(picker);
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
- return c;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- HTMLUIPlugin.getDefault().savePluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
deleted file mode 100644
index bd2c0c58e4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * <p>Defines the preference page for allowing the user to change the content
- * assist preferences</p>
- */
-public class HTMLContentAssistPreferencePage extends AbstractPreferencePage implements
- IWorkbenchPreferencePage {
-
- private static final String HTML_CONTENT_TYPE_ID = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
-
- // Auto Activation
- private Button fAutoPropose;
- private Label fAutoProposeDelayLabel;
- private Text fAutoProposeDelay;
- private Label fAutoProposeLabel;
- private Text fAutoProposeText;
-
- /** configuration block for changing preference having to do with the content assist categories */
- private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
-
- createContentsForAutoActivationGroup(composite);
- createContentsForCyclingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
- */
- protected void performDefaults() {
- performDefaultsForAutoActivationGroup();
- performDefaultsForCyclingGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- initializeValuesForAutoActivationGroup();
- initializeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- storeValuesForAutoActivationGroup();
- storeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#enableValues()
- */
- protected void enableValues() {
- if (fAutoPropose != null) {
- if (fAutoPropose.getSelection()) {
- fAutoProposeDelayLabel.setEnabled(true);
- fAutoProposeDelay.setEnabled(true);
- fAutoProposeLabel.setEnabled(true);
- fAutoProposeText.setEnabled(true);
- }
- else {
- fAutoProposeDelayLabel.setEnabled(false);
- fAutoProposeDelay.setEnabled(false);
- fAutoProposeLabel.setEnabled(false);
- fAutoProposeText.setEnabled(false);
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * <p>Create contents for the auto activation preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForAutoActivationGroup(Composite parent) {
- Group contentAssistGroup = createGroup(parent, 2);
- contentAssistGroup.setText(HTMLUIMessages.Auto_Activation_UI_);
-
- fAutoPropose = createCheckBox(contentAssistGroup, HTMLUIMessages.Automatically_make_suggest_UI_);
- ((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
- fAutoPropose.addSelectionListener(this);
-
- fAutoProposeDelayLabel = createLabel(contentAssistGroup, HTMLUIMessages.Auto_Activation_Delay);
- fAutoProposeDelay = createTextField(contentAssistGroup);
- fAutoProposeDelay.setTextLimit(4);
- fAutoProposeDelay.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- verifyDelay();
- }
- });
-
- fAutoProposeLabel = createLabel(contentAssistGroup, HTMLUIMessages.Prompt_when_these_characte_UI_);
- fAutoProposeText = createTextField(contentAssistGroup);
- }
-
- private void verifyDelay() {
- final String text = fAutoProposeDelay.getText();
- boolean valid = true;
- try {
- final int delay = Integer.parseInt(text);
- if (delay < 0) {
- valid = false;
- }
- }
- catch (NumberFormatException e) {
- valid = false;
- }
- if (!valid) {
- if (text.trim().length() > 0)
- setErrorMessage(NLS.bind(XMLUIMessages.Not_an_integer, text));
- else
- setErrorMessage(XMLUIMessages.Missing_integer);
- setValid(false);
- }
- else {
- setErrorMessage(null);
- setValid(true);
- }
- }
-
- /**
- * <p>Create the contents for the content assist cycling preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForCyclingGroup(Composite parent) {
- ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(HTML_CONTENT_TYPE_ID);
-
- if(configurationWriter != null) {
- fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(HTML_CONTENT_TYPE_ID, configurationWriter);
- fConfigurationBlock.createContents(parent, HTMLUIMessages.Cycling_UI_);
- } else {
- Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
- " specified for the HTML content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
- " preference block for editing proposal categories preferences."); //$NON-NLS-1$
- }
- }
-
- /**
- * <p>Store the values for the auto activation group</p>
- */
- private void storeValuesForAutoActivationGroup() {
- getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
- getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
- getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY, Integer.parseInt(fAutoProposeDelay.getText()));
- }
-
- /**
- * <p>Store the values for the cycling group</p>
- */
- private void storeValuesForCyclingGroup() {
- if (fConfigurationBlock != null) {
- fConfigurationBlock.storeValues();
- }
- }
-
- /**
- * <p>Initialize the values for the auto activation group</p>
- */
- private void initializeValuesForAutoActivationGroup() {
- // Content Assist
- fAutoPropose.setSelection(getPreferenceStore().getBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
- fAutoProposeText.setText(getPreferenceStore().getString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
- fAutoProposeDelay.setText(Integer.toString(getPreferenceStore().getInt(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY)));
- }
-
- /**
- * <p>Initialize the values for the cycling group</p>
- */
- private void initializeValuesForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.initializeValues();
- }
- }
-
- /**
- * <p>Load the defaults for the auto activation group</p>
- */
- private void performDefaultsForAutoActivationGroup() {
- // Content Assist
- fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
- fAutoProposeText.setText(getPreferenceStore().getDefaultString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
- fAutoProposeDelay.setText(Integer.toString(getPreferenceStore().getDefaultInt(HTMLUIPreferenceNames.AUTO_PROPOSE_DELAY)));
- }
-
- /**
- * <p>Load the defaults of the cycling group</p>
- */
- private void performDefaultsForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.performDefaults();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
deleted file mode 100644
index 1aa3304872..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.preferences.WorkbenchDefaultEncodingSettings;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class HTMLFilesPreferencePage extends XMLFilesPreferencePage {
- private WorkbenchDefaultEncodingSettings fInputEncodingSettings = null;
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite scrolledComposite = createScrolledComposite(parent);
- createContentsForCreatingGroup(scrolledComposite);
- createContentsForLoadingGroup(scrolledComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
-
- return scrolledComposite;
- }
-
- protected void createContentsForLoadingGroup(Composite parent) {
- Group group = createGroup(parent, 1);
- group.setText(HTMLUIMessages.HTMLFilesPreferencePage_0);
-
- fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
- }
-
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
- }
-
- protected void initializeValues() {
- super.initializeValues();
- initializeValuesForLoadingGroup();
- }
-
- protected void initializeValuesForLoadingGroup() {
- String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- performDefaultsForLoadingGroup();
- }
-
- protected void performDefaultsForLoadingGroup() {
- String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- protected void storeValues() {
- super.storeValues();
- storeValuesForLoadingGroup();
- }
-
- protected void storeValuesForLoadingGroup() {
- getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
deleted file mode 100644
index 8c63e1bf23..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.html.ui.internal.preferences.ui;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.format.HTMLFormattingUtil;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-import com.ibm.icu.text.Collator;
-
-public class HTMLSourcePreferencePage extends AbstractPreferencePage {
- private Button fTagNameUpper = null;
- private Button fTagNameLower = null;
- private Button fAttrNameUpper = null;
- private Button fAttrNameLower = null;
-
- private final int MIN_INDENTATION_SIZE = 0;
- private final int MAX_INDENTATION_SIZE = 16;
-
- private Button fClearAllBlankLines;
-
- // Formatting
- private Text fLineWidthText;
- private Button fSplitMultiAttrs;
- private Button fAlignEndBracket;
- private Button fIndentUsingTabs;
- private Button fIndentUsingSpaces;
- private Spinner fIndentationSize;
-
- private Button fAddButton;
- private Button fRemoveButton;
-
- private TableViewer fViewer;
-
- private ContentProvider fContentProvider;
-
- private Composite createContentsForPreferredCaseGroup(Composite parent, int columnSpan) {
- Group caseGroup = createGroup(parent, columnSpan);
- caseGroup.setText(HTMLUIMessages.Preferred_markup_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- Group tagNameGroup = createGroup(caseGroup, 1);
- tagNameGroup.setText(HTMLUIMessages.Tag_names__UI_);
- fTagNameUpper = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Upper_case_UI_);
- fTagNameLower = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Lower_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- Group attrNameGroup = createGroup(caseGroup, 1);
- attrNameGroup.setText(HTMLUIMessages.Attribute_names__UI_);
- fAttrNameUpper = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Upper_case_UI_);
- fAttrNameLower = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Lower_case_UI_);
-
- return parent;
-
- }
-
- private void createContentsForFormattingGroup(Composite parent) {
- Group formattingGroup = createGroup(parent, 2);
- formattingGroup.setText(HTMLUIMessages.Formatting_UI_);
-
- createLabel(formattingGroup, HTMLUIMessages.Line_width__UI_);
- fLineWidthText = new Text(formattingGroup, SWT.SINGLE | SWT.BORDER);
- GridData gData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.BEGINNING);
- gData.widthHint = 25;
- fLineWidthText.setLayoutData(gData);
- fLineWidthText.addModifyListener(this);
-
- fSplitMultiAttrs = createCheckBox(formattingGroup, HTMLUIMessages.Split_multiple_attributes);
- ((GridData) fSplitMultiAttrs.getLayoutData()).horizontalSpan = 2;
- fAlignEndBracket = createCheckBox(formattingGroup, HTMLUIMessages.Align_final_bracket);
- ((GridData) fAlignEndBracket.getLayoutData()).horizontalSpan = 2;
- fClearAllBlankLines = createCheckBox(formattingGroup, HTMLUIMessages.Clear_all_blank_lines_UI_);
- ((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
-
- // [269224] - Place the indent controls in their own composite for proper tab ordering
- Composite indentComposite = createComposite(formattingGroup, 1);
- ((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
- ((GridLayout) indentComposite.getLayout()).marginWidth = 0;
- ((GridLayout) indentComposite.getLayout()).marginHeight = 0;
-
- fIndentUsingTabs = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_tabs);
- ((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
-
- fIndentUsingSpaces = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_spaces);
- ((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
-
- createLabel(formattingGroup, HTMLUIMessages.Indentation_size);
- fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- fIndentationSize.setLayoutData(gd);
- fIndentationSize.setToolTipText(HTMLUIMessages.Indentation_size_tip);
- fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
- fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
- fIndentationSize.setIncrement(1);
- fIndentationSize.setPageIncrement(4);
- fIndentationSize.addModifyListener(this);
-
- GridData data;
-
-
- Composite inlineGroup = new Composite(formattingGroup, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- inlineGroup.setLayout(layout);
-
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- inlineGroup.setLayoutData(data);
-
- Label label = createLabel(inlineGroup, HTMLUIMessages.Inline_elements_table_label);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- final TableViewer viewer = new TableViewer(inlineGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- data.verticalAlignment = SWT.BEGINNING;
- data.heightHint = convertHeightInCharsToPixels(10);
- viewer.getTable().setLayoutData(data);
-
- Composite buttonContainer = new Composite(inlineGroup, SWT.NONE);
- data = new GridData(GridData.FILL_VERTICAL);
- buttonContainer.setLayoutData(data);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonContainer.setLayout(layout);
-
- fAddButton = new Button(buttonContainer, SWT.PUSH);
- fAddButton.setText(HTMLUIMessages.Add_inline);
- fAddButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- HTMLElementDialog dialog = new HTMLElementDialog(getShell());
- dialog.setMessage(HTMLUIMessages.Elements_Dialog_message);
- dialog.setTitle(HTMLUIMessages.Elements_Dialog_title);
- dialog.setMultipleSelection(true);
- dialog.setAllowDuplicates(false);
- dialog.open();
- Object[] result = dialog.getResult();
- if (result != null) {
- for (int i = 0; i < result.length; i++) {
- fContentProvider.addElement(result[i].toString());
- }
- fViewer.refresh();
- }
- }
- });
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, fAddButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- data.horizontalSpan = 1;
- fAddButton.setLayoutData(data);
-
- fRemoveButton = new Button(buttonContainer, SWT.PUSH);
- fRemoveButton.setText(HTMLUIMessages.Remove_inline);
- fRemoveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ISelection selection = viewer.getSelection();
- if (selection != null && !selection.isEmpty() && selection instanceof StructuredSelection) {
- Object[] remove = ((StructuredSelection) selection).toArray();
- for (int i = 0; i < remove.length; i++) {
- fContentProvider.removeElement(remove[i].toString());
- }
- if (remove.length > 0) {
- fViewer.refresh();
- }
- }
- }
- });
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 1;
- fRemoveButton.setLayoutData(data);
-
- fViewer = viewer;
- fContentProvider = new ContentProvider();
- viewer.setContentProvider(fContentProvider);
- viewer.setInput(this);
- viewer.setComparator(new ViewerComparator(Collator.getInstance()));
- }
-
- protected void performDefaults() {
- fTagNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
-
- performDefaultsForFormattingGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- private void performDefaultsForFormattingGroup() {
- // Formatting
- fLineWidthText.setText(getModelPreferences().getDefaultString(HTMLCorePreferenceNames.LINE_WIDTH));
- fSplitMultiAttrs.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fAlignEndBracket.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
- fClearAllBlankLines.setSelection(getModelPreferences().getDefaultBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- if (HTMLCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(HTMLCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- }
- else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
- fIndentationSize.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.INDENTATION_SIZE));
-
- // Inline elements
- fContentProvider.restoreDefaults();
- fViewer.refresh();
- }
-
- protected void initializeValues() {
- fTagNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
-
- initializeValuesForFormattingGroup();
- }
-
- private void initializeValuesForFormattingGroup() {
- // Formatting
- fLineWidthText.setText(getModelPreferences().getString(HTMLCorePreferenceNames.LINE_WIDTH));
- fSplitMultiAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fAlignEndBracket.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
- fClearAllBlankLines.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- if (HTMLCorePreferenceNames.TAB.equals(getModelPreferences().getString(HTMLCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- }
- else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
-
- fIndentationSize.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.INDENTATION_SIZE));
- }
-
- protected void storeValues() {
- if (fTagNameUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- if (fAttrNameUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-
- storeValuesForFormattingGroup();
- }
-
- private void storeValuesForFormattingGroup() {
- // Formatting
- getModelPreferences().setValue(HTMLCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
- getModelPreferences().setValue(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, fSplitMultiAttrs.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.ALIGN_END_BRACKET, fAlignEndBracket.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, fClearAllBlankLines.getSelection());
-
- if (fIndentUsingTabs.getSelection()) {
- getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
- }
- else {
- getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.SPACE);
- }
- getModelPreferences().setValue(HTMLCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- // Save values from inline elements
- HTMLFormattingUtil.exportToPreferences(fContentProvider.fElements.toArray());
-
- return result;
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- private void doSavePreferenceStore() {
- HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.HTML_PREFWEBX_SOURCE_HELPID);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", HTMLUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- createContentsForFormattingGroup(composite);
- createContentsForPreferredCaseGroup(composite, 2);
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- protected void validateValues() {
- boolean isError = false;
- String widthText = null;
-
- if (fLineWidthText != null) {
- try {
- widthText = fLineWidthText.getText();
- int formattingLineWidth = Integer.parseInt(widthText);
- if ((formattingLineWidth < WIDTH_VALIDATION_LOWER_LIMIT) || (formattingLineWidth > WIDTH_VALIDATION_UPPER_LIMIT)) {
- throw new NumberFormatException();
- }
- }
- catch (NumberFormatException nfexc) {
- setInvalidInputMessage(widthText);
- setValid(false);
- isError = true;
- }
- }
-
- int indentSize = 0;
- if (fIndentationSize != null) {
- try {
- indentSize = fIndentationSize.getSelection();
- if ((indentSize < MIN_INDENTATION_SIZE) || (indentSize > MAX_INDENTATION_SIZE)) {
- throw new NumberFormatException();
- }
- }
- catch (NumberFormatException nfexc) {
- setInvalidInputMessage(Integer.toString(indentSize));
- setValid(false);
- isError = true;
- }
- }
-
- if (!isError) {
- setErrorMessage(null);
- setValid(true);
- }
- }
-
- private static class HTMLElementDialog extends ElementListSelectionDialog {
- public HTMLElementDialog(Shell parent) {
- super(parent, new ILabelProvider() {
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void dispose() {
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
- public Image getImage(Object element) {
- return null;
- }
- });
- }
-
- public int open() {
- final List list = new ArrayList();
- IRunnableContext context = PlatformUI.getWorkbench().getProgressService();
- IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask("Searching for known elements", 1); //$NON-NLS-1$
- try {
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
- CMNamedNodeMap map = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML5_DOC_TYPE).getElements();
- Iterator it = map.iterator();
- while (it.hasNext()) {
- CMNode node = (CMNode) it.next();
- if (!node.getNodeName().startsWith("SSI:")) { //$NON-NLS-1$
- list.add(node.getNodeName().toLowerCase(Locale.US));
- }
- monitor.worked(1);
- }
- }
- finally {
- monitor.done();
- }
- }
- };
- try {
- context.run(true, true, runnable);
- }
- catch (InvocationTargetException e) {
- return CANCEL;
- }
- catch (InterruptedException e) {
- return CANCEL;
- }
- setElements(list.toArray());
- return super.open();
- }
- }
-
- private class ContentProvider implements IStructuredContentProvider {
-
- private List fElements;
-
- public ContentProvider() {
- fElements = new ArrayList(Arrays.asList(HTMLFormattingUtil.getInlineElements()));
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void addElement(String name) {
- if (!fElements.contains(name))
- fElements.add(name);
- }
-
- public void removeElement(String name) {
- fElements.remove(name);
- }
-
- public Object[] getElements(Object inputElement) {
- return fElements.toArray();
- }
-
- public void restoreDefaults() {
- fElements = new ArrayList(Arrays.asList(HTMLFormattingUtil.getDefaultInlineElements()));
- }
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
deleted file mode 100644
index eb532d7364..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.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.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.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.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.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.AbstractSyntaxColoringPage;
-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 HTMLSyntaxColoringPage extends AbstractSyntaxColoringPage 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;
- private ISourceViewer fPreviewViewer;
-
- // 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);
- fBold.setEnabled(true);
- fItalic.setEnabled(true);
- fStrike.setEnabled(true);
- fUnderline.setEnabled(true);
- fForegroundLabel.setEnabled(true);
- fBackgroundLabel.setEnabled(true);
- fForegroundColorEditor.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.HTML_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, HTMLUIMessages.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, HTMLUIMessages.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);
- fForegroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Foreground_Color_Selector_Button;
- }
- });
-
- 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);
- fBackgroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Background_Color_Selector_Button;
- }
- });
-
-
- fBold = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_3);
- fBold.setEnabled(false);
- ((GridData) fBold.getLayoutData()).horizontalSpan = 2;
- fItalic = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_4);
- fItalic.setEnabled(false);
- ((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
- fStrike = createCheckbox(editControls, HTMLUIMessages.SyntaxColoringPage_5);
- fStrike.setEnabled(false);
- ((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
- fUnderline = createCheckbox(editControls, HTMLUIMessages.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:"
- fPreviewViewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = fPreviewViewer.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(ContentTypeIdForHTML.ContentTypeID_HTML);
- fDocument.set(getExampleText());
- initializeSourcePreviewColors(fPreviewViewer);
- fPreviewViewer.setDocument(fDocument);
-
- top.setWeights(new int[]{1, 1});
- editor.setWeights(new int[]{1, 1});
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.HTML_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;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSyntaxColoringPage#getSourcePreviewViewer()
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return fPreviewViewer;
- }
-
- 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 HTMLUIPlugin.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 HTMLUIMessages.Sample_HTML_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.ENTITY_REFERENCE);
- styles.add(IStyleConstantsXML.TAG_BORDER);
- styles.add(IStyleConstantsXML.TAG_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- styles.add(IStyleConstantsXML.COMMENT_BORDER);
- styles.add(IStyleConstantsXML.COMMENT_TEXT);
- styles.add(IStyleConstantsXML.DECL_BORDER);
- styles.add(IStyleConstantsXML.XML_CONTENT);
- styles.add(IStyleConstantsXML.DOCTYPE_NAME);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-// styles.add(IStyleConstantsXML.CDATA_BORDER);
-// styles.add(IStyleConstantsXML.CDATA_TEXT);
-// styles.add(IStyleConstantsXML.PI_BORDER);
-// styles.add(IStyleConstantsXML.PI_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_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- 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_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_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(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
-
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-
-// fContextToStyleMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
-// fContextToStyleMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
-// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
-// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
-// fContextToStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
- }
-
- 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_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_NAME, XMLUIMessages.DOCTYPE_Name_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, XMLUIMessages.DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, XMLUIMessages.DOCTYPE_Public_Reference_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, XMLUIMessages.DOCTYPE_System_Reference_UI_); // =
-// fStyleToDescriptionMap.put(IStyleConstantsXML.PI_BORDER, XMLUIMessages.Processing_Instruction_Del_UI_);
-// fStyleToDescriptionMap.put(IStyleConstantsXML.PI_CONTENT, XMLUIMessages.Processing_Instruction_Con_UI__UI_);
-// fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_BORDER, XMLUIMessages.CDATA_Delimiters_UI_);
-// fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_TEXT, XMLUIMessages.CDATA_Content_UI_);
-}
-
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- fText.redraw();
- }
-
- public boolean performOk() {
- getOverlayStore().propagate();
-
- HTMLUIPlugin.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.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
deleted file mode 100644
index 0700d82417..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.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.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.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.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 HTML templates
- */
-public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
- class HTMLEditTemplateDialog extends EditTemplateDialog {
- public HTMLEditTemplateDialog(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 StructuredTextViewerConfigurationHTML();
-
- 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 HTMLTemplatePreferencePage() {
- HTMLUIPlugin htmlEditorPlugin = HTMLUIPlugin.getDefault();
-
- setPreferenceStore(htmlEditorPlugin.getPreferenceStore());
- setTemplateStore(htmlEditorPlugin.getTemplateStore());
- setContextTypeRegistry(htmlEditorPlugin.getTemplateContextRegistry());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- HTMLUIPlugin.getDefault().savePluginPreferences();
- return ok;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
- */
- protected boolean isShowFormatterSetting() {
- // template formatting has not been implemented
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite ancestor) {
- Control c = super.createContents(ancestor);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_TEMPLATES_HELPID);
- return c;
- }
- /*
- * (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 StructuredTextViewerConfigurationHTML();
-
- 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 = ContentTypeIdForHTML.ContentTypeID_HTML;
- viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- 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 HTMLEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
- if (dialog.open() == Window.OK) {
- return dialog.getTemplate();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
deleted file mode 100644
index 8942dfeefc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.html.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class HTMLTypingPreferencePage extends AbstractPreferencePage {
-
- private Button fCloseComment;
- private Button fCloseEndTag;
- private Button fRemoveEndTag;
- private Button fCloseElement;
- private Button fCloseStrings;
- private Button fCloseBrackets;
-
- protected Control createContents(Composite parent) {
- Composite composite = super.createComposite(parent, 1);
-
- createStartTagGroup(composite);
- createEndTagGroup(composite);
- createAutoComplete(composite);
- createAutoRemove(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private void createStartTagGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_Start_Tag);
-
- fCloseElement = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Elements);
- ((GridData) fCloseElement.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createEndTagGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_End_Tag);
-
- fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
- ((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createAutoComplete(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(HTMLUIMessages.HTMLTyping_Auto_Complete);
-
- fCloseComment = createCheckBox(group, HTMLUIMessages.HTMLTyping_Complete_Comments);
- ((GridData) fCloseComment.getLayoutData()).horizontalSpan = 2;
-
- fCloseStrings = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Strings);
- ((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
-
- fCloseBrackets = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Brackets);
- ((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createAutoRemove(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(HTMLUIMessages.HTMLTyping_Auto_Remove);
-
- fRemoveEndTag = createCheckBox(group, HTMLUIMessages.HTMLTyping_Remove_End_Tags);
- ((GridData) fRemoveEndTag.getLayoutData()).horizontalSpan = 2;
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- HTMLUIPlugin.getDefault().savePluginPreferences();
-
- return result;
- }
-
- protected void initializeValues() {
- initCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- initCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
- initCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
- initCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
- initCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- initCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- protected void performDefaults() {
- defaultCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- defaultCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
- defaultCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
- defaultCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
- defaultCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- defaultCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- protected void storeValues() {
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComment != null) ? fCloseComment.getSelection() : false);
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, (fCloseEndTag != null) ? fCloseEndTag.getSelection() : false);
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, (fCloseElement != null) ? fCloseElement.getSelection() : false);
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, (fRemoveEndTag != null) ? fRemoveEndTag.getSelection() : false);
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
- getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
deleted file mode 100644
index 9186ccee4f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.layout.PixelConverter;
-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.ui.IWorkbench;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractValidationSettingsPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-
-public class HTMLValidationPreferencePage extends AbstractValidationSettingsPage {
-
- private static final int[] SEVERITIES = {ValidationMessage.ERROR, ValidationMessage.WARNING, ValidationMessage.IGNORE};
-
- private static final String SETTINGS_SECTION_NAME = "HTMLValidationSeverities";//$NON-NLS-1$
-
- public HTMLValidationPreferencePage() {
- super();
- }
-
- private PixelConverter fPixelConverter;
-
- 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);
-
- final Composite content = createValidationSection(page);
-
- GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
- content.setLayoutData(gridData);
-
- return page;
- }
-
- 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(HTMLUIMessages.Validation_description);
- description.setFont(page.getFont());
-
-
- ExpandableComposite ec;
- Composite inner;
- String label;
-
- String[] errorWarningIgnoreLabel = new String[] { HTMLUIMessages.Validation_Error, HTMLUIMessages.Validation_Warning, HTMLUIMessages.Validation_Ignore };
-
- // Element section
-
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_elements, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_8;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_9;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_10;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_11;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_12;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_MISSING_START, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_13;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_MISSING_END, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_14;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_15;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_16;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_17;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_18;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_COEXISTENCE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_19;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_20;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_21;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_36;
- addComboBox(inner, label, HTMLCorePreferenceNames.ELEM_INVALID_TEXT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Element Section
-
- // The Attribute validation section
-
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_attributes, nColumns);
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_0;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_1;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_VALUE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_2;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_NAME_MISMATCH, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_3;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_INVALID_NAME, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_4;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_INVALID_VALUE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_5;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_6;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_7;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_37;
- addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_EQUALS_MISSING, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_35;
- // TODO: validate resources?
- // addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Attribute section
-
-
- // Document Type
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_document_type, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_22;
- addComboBox(inner, label, HTMLCorePreferenceNames.DOC_DUPLICATE, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_23;
- addComboBox(inner, label, HTMLCorePreferenceNames.DOC_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_24;
- addComboBox(inner, label, HTMLCorePreferenceNames.DOC_DOCTYPE_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Document Type
-
- // Comments
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_comment, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_27;
- addComboBox(inner, label, HTMLCorePreferenceNames.COMMENT_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_28;
- addComboBox(inner, label, HTMLCorePreferenceNames.COMMENT_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Comments
-
-
- // CDATA Sections
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_cdata, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_29;
- addComboBox(inner, label, HTMLCorePreferenceNames.CDATA_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_30;
- addComboBox(inner, label, HTMLCorePreferenceNames.CDATA_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End CDATA Sections
-
- // Processing Instructions
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_pi, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_31;
- addComboBox(inner, label, HTMLCorePreferenceNames.PI_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_32;
- addComboBox(inner, label, HTMLCorePreferenceNames.PI_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Processing Instructions
-
- // Entity References
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_entity_ref, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_33;
- addComboBox(inner, label, HTMLCorePreferenceNames.REF_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_34;
- addComboBox(inner, label, HTMLCorePreferenceNames.REF_UNDEFINED, SEVERITIES, errorWarningIgnoreLabel, 0);
-
-
- // End Entity References
-
-
- // Text Content
- ec = createStyleSection(composite, HTMLUIMessages.Expandable_label_text, nColumns);
-
- inner = new Composite(ec, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- ec.setClient(inner);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_25;
- addComboBox(inner, label, HTMLCorePreferenceNames.TEXT_INVALID_CONTENT, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- label = HTMLUIMessages.HTMLValidationPreferencePage_26;
- addComboBox(inner, label, HTMLCorePreferenceNames.TEXT_INVALID_CHAR, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- // End Text Content
-
- restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
-
- return spContent;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- resetSeverities();
- super.performDefaults();
- }
-
- protected IDialogSettings getDialogSettings() {
- return HTMLUIPlugin.getDefault().getDialogSettings();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
- super.dispose();
- }
-
- protected String getQualifier() {
- return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- protected String getPreferenceNodeQualifier() {
- return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- protected String getPreferencePageID() {
- return "org.eclipse.wst.html.ui.preferences.validation";//$NON-NLS-1$
- }
-
- protected String getProjectSettingsKey() {
- return HTMLCorePreferenceNames.USE_PROJECT_SETTINGS;
- }
-
- protected String getPropertyPageID() {
- return "org.eclipse.wst.html.ui.propertyPage.project.validation";//$NON-NLS-1$
- }
-
- public void init(IWorkbench workbench) {
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
deleted file mode 100644
index 145ab9afef..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.registry;
-
-import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-public class AdapterFactoryProviderForHTML implements AdapterFactoryProvider {
-
-
- public void addAdapterFactories(IStructuredModel structuredModel) {
-
- // these are the normal edit side content based factories
- addContentBasedFactories(structuredModel);
- // Must update/add to propagating adapter here too
- if (structuredModel instanceof IDOMModel) {
- addPropagatingAdapters(structuredModel);
- }
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
-
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- INodeAdapterFactory factory = null;
-
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryForHTML();
- factoryRegistry.addFactory(factory);
- }
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {
- // no propagating to add
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForHTML);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
deleted file mode 100644
index 23c2c49085..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
-
-/**
- * Sets up FindOccurrencesActionDelegate for html find occurrences processors
- */
-public class HTMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
- private List fProcessors;
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
- }
- return fProcessors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
deleted file mode 100644
index c20efa168c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.search;
-
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-/**
- * Configures a FindOccurrencesProcessor with HTML partitions and regions
- */
-public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
- protected String[] getPartitionTypes() {
- return new String[]{IHTMLPartitions.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
- }
-
- protected String[] getRegionTypes() {
- return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE};
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
deleted file mode 100644
index 81f765c1a4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.style;
-
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider, ColorManager, and
- * any others who may be interested
- */
-public interface IStyleConstantsHTML extends IStyleConstantsXML {
- public static final String SCRIPT_AREA_BORDER = "SCRIPT_AREA_BORDER";//$NON-NLS-1$
- public static final String SCRIPT_AREA = "SCRIPT_AREA";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
deleted file mode 100644
index 4db6f6400b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.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.html.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
-
-public class LineStyleProviderForHTML extends LineStyleProviderForXML implements LineStyleProvider {
-
- public LineStyleProviderForHTML() {
- super();
- }
-
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // NOTE: this method was just copied down form LineStyleProviderForXML
- public TextAttribute getAttributeFor(ITextRegion region) {
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- String type = region.getType();
- if (type == DOMRegionContext.BLOCK_TEXT) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- // workaround: make PI edges the same color as tag edges
- else if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
- }
- // first try "standard" tag attributes from super class
- return super.getAttributeFor(region);
- }
-
- protected void loadColors() {
- super.loadColors();
-
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- }
-
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-
- // this is what AbstractLineStyleProvider.propertyChange() does
- getHighlighter().refreshDisplay();
- } else {
- super.handlePropertyChange(event);
- }
- } else {
- super.handlePropertyChange(event);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider#getColorPreferences()
- */
- protected IPreferenceStore getColorPreferences() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
deleted file mode 100644
index 5f859c7c56..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides context information for HTML tags (Shows tooltip description)
- *
- * @deprecated StructuredTextViewerConfiguration creates the appropriate
- * information provider
- */
-public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
- private ITextHover fTextHover = null;
-
- public HTMLInformationProvider() {
- fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new HTMLTagInfoHoverProcessor());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
deleted file mode 100644
index a99186ab1a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-
-
-import org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor;
-
-/**
- * Provides hover help documentation for HTML tags
- *
- * @author amywu
- */
-public class HTMLTagInfoHoverProcessor extends XMLTagInfoHoverProcessor {
- // currently empty because XMLTagInfoHoverProcessor handles all cases relevant to HTML
- public HTMLTagInfoHoverProcessor() {
- super();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
deleted file mode 100644
index aca7d175e7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverHTML extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverHTML() {
- super(ENCODING_TYPE, HTMLUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return HTMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
deleted file mode 100644
index 2a18055243..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for HTML template context types. Templates of this context type
- * apply to any place within HTML content type.
- */
-public class TemplateContextTypeHTML extends TemplateContextType {
-
- public TemplateContextTypeHTML() {
- super();
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new EncodingTemplateVariableResolverHTML());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
deleted file mode 100644
index 794b13db36..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsHTML {
-
- public static final String ALL = getAll();
-
- public static final String ATTRIBUTE = getAttribute();
-
- public static final String ATTRIBUTE_VALUE = getAttributeValue();
-
- public static final String NEW = getNew();
-
- public static final String TAG = getTag();
-
- private static String getAll() {
- return getPrefix() + "_all"; //$NON-NLS-1$
- }
-
- private static String getAttribute() {
- return getPrefix() + "_attribute"; //$NON-NLS-1$
- }
-
- private static String getAttributeValue() {
- return getPrefix() + "_attribute_value"; //$NON-NLS-1$
- }
-
- private static String getNew() {
- return getPrefix() + "_new"; //$NON-NLS-1$
- }
-
- private static String getTag() {
- return getPrefix() + "_tag"; //$NON-NLS-1$
- }
-
- private static String getPrefix() {
- return "html"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
deleted file mode 100644
index 597d9a91b0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-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.ui.typing.AbstractCharacterPairInserter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class CharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {
-
- // preferences
- private boolean fCloseStrings = true;
- private boolean fCloseBrackets = true;
-
- protected boolean shouldPair(ISourceViewer viewer, char c) {
- switch (c) {
- case '\'':
- case '"':
- return fCloseStrings ? checkRegion(viewer, c) : false;
- default:
- return fCloseBrackets;
- }
- }
-
- /**
- * Checks if the region should support paired quotes
- * @param viewer the viewer
- * @return true if the region is not in an XML attribute value
- */
- private boolean checkRegion(ISourceViewer viewer, char c) {
- IDocument doc = viewer.getDocument();
- final Point selection= viewer.getSelectedRange();
- final int offset= selection.x;
-
- if (doc instanceof IStructuredDocument) {
- IStructuredDocumentRegion[] regions = ((IStructuredDocument) doc).getStructuredDocumentRegions(offset, 0);
- if (regions != null && regions.length > 0) {
- ITextRegion region = regions[0].getRegionAtCharacterOffset(offset);
- if (region != null) {
- final String type = region.getType();
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(type))
- return true;
- else if (DOMRegionContext.XML_TAG_CLOSE.equals(type) || DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(type)) {
- if (regions[0].containsOffset(offset - 1)) {
- region = regions[0].getRegionAtCharacterOffset(offset - 1);
- if (region != null && DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(region.getType()))
- return true;
- }
- }
- return c != '\'' && DOMRegionContext.XML_CONTENT.equals(type);
- }
- }
- }
- return true;
- }
-
- public boolean hasPair(char c) {
- switch (c) {
- case '"':
- case '\'':
- case '[':
- case '(':
- return true;
- default:
- return false;
- }
- }
-
- protected char getPair(char c) {
- switch (c) {
- case '\'':
- case '"':
- return c;
- case '(':
- return ')';
- case '[':
- return ']';
- default:
- throw new IllegalArgumentException();
- }
- }
-
- public void initialize() {
- IPreferenceStore store = HTMLUIPlugin.getInstance().getPreferenceStore();
- fCloseStrings = store.getBoolean(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- fCloseBrackets = store.getBoolean(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- store.addPropertyChangeListener(this);
- }
-
- public void dispose() {
- HTMLUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))
- fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
- else if (HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))
- fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index aa75cdbfb4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']','"','"','\'','\''};
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public HTMLDocumentRegionEdgeMatcher() {
- super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
deleted file mode 100644
index b9d8561a47..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-/**
- * Definition of Java partitioning and its partitions.
- *
- * @see Eclipse 3.1
- */
-interface IJavaPartitions {
-
- /**
- * The identifier of the Java partitioning.
- */
- String JAVA_PARTITIONING = "___java_partitioning"; //$NON-NLS-1$
-
- /**
- * The identifier of the single-line (JLS2: EndOfLineComment) end comment
- * partition content type.
- */
- String JAVA_SINGLE_LINE_COMMENT = "__java_singleline_comment"; //$NON-NLS-1$
-
- /**
- * The identifier multi-line (JLS2: TraditionalComment) comment partition
- * content type.
- */
- String JAVA_MULTI_LINE_COMMENT = "__java_multiline_comment"; //$NON-NLS-1$
-
- /**
- * The identifier of the Javadoc (JLS2: DocumentationComment) partition
- * content type.
- */
- String JAVA_DOC = "__java_javadoc"; //$NON-NLS-1$
-
- /**
- * The identifier of the Java string partition content type.
- */
- String JAVA_STRING = "__java_string"; //$NON-NLS-1$
-
- /**
- * The identifier of the Java character partition content type.
- */
- String JAVA_CHARACTER = "__java_character"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
deleted file mode 100644
index e3cace3005..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.ui.internal.derived.SingleCharReader;
-
-/**
- * Reads from a document either forwards or backwards. May be configured to
- * skip comments and strings.
- */
-class JavaCodeReader extends SingleCharReader {
-
- /** The EOF character */
- public static final int EOF = -1;
-
- private boolean fSkipComments = false;
- private boolean fSkipStrings = false;
- private boolean fForward = false;
-
- private IDocument fDocument;
- private int fOffset;
-
- private int fEnd = -1;
- private int fCachedLineNumber = -1;
- private int fCachedLineOffset = -1;
-
-
- public JavaCodeReader() {
- }
-
- /**
- * Returns the offset of the last read character. Should only be called
- * after read has been called.
- */
- public int getOffset() {
- return fForward ? fOffset - 1 : fOffset;
- }
-
- public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = true;
- fEnd = Math.min(fDocument.getLength(), fOffset + length);
- }
-
- public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = false;
- try {
- fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- /*
- * @see Reader#close()
- */
- public void close() throws IOException {
- fDocument = null;
- }
-
- /*
- * @see SingleCharReader#read()
- */
- public int read() throws IOException {
- try {
- return fForward ? readForwards() : readBackwards();
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- private void gotoCommentEnd() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '*') {
- if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
- ++fOffset;
- return;
- }
- }
- }
- }
-
- private void gotoStringEnd(char delimiter) throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '\\') {
- // ignore escaped characters
- ++fOffset;
- }
- else if (current == delimiter) {
- return;
- }
- }
- }
-
- private void gotoLineEnd() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- fOffset = fDocument.getLineOffset(line + 1);
- }
-
- private int readForwards() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
-
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset < fEnd) {
- char next = fDocument.getChar(fOffset);
- if (next == '*') {
- // a comment starts, advance to the comment end
- ++fOffset;
- gotoCommentEnd();
- continue;
- }
- else if (next == '/') {
- // '//'-comment starts, advance to the line end
- gotoLineEnd();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- gotoStringEnd(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-
- private void handleSingleLineComment() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- if (line < fCachedLineNumber) {
- fCachedLineNumber = line;
- fCachedLineOffset = fDocument.getLineOffset(line);
- int offset = fOffset;
- while (fCachedLineOffset < offset) {
- char current = fDocument.getChar(offset--);
- if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
- fOffset = offset;
- return;
- }
- }
- }
- }
-
- private void gotoCommentStart() throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset--);
- if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/')
- return;
- }
- }
-
- private void gotoStringStart(char delimiter) throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset);
- if (current == delimiter) {
- if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\'))
- return;
- }
- --fOffset;
- }
- }
-
- private int readBackwards() throws BadLocationException {
-
- while (0 < fOffset) {
- --fOffset;
-
- handleSingleLineComment();
-
- char current = fDocument.getChar(fOffset);
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset > 1) {
- char next = fDocument.getChar(fOffset - 1);
- if (next == '*') {
- // a comment ends, advance to the comment start
- fOffset -= 2;
- gotoCommentStart();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- --fOffset;
- gotoStringStart(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
deleted file mode 100644
index 01602a291e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
+++ /dev/null
@@ -1,986 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-// taken from package org.eclipse.jdt.internal.ui.text;
-
-import java.util.Arrays;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedRegion;
-
-/**
- * Utility methods for heuristic based Java manipulations in an incomplete
- * Java source file.
- *
- * <p>
- * An instance holds some internal position in the document and is therefore
- * not threadsafe.
- * </p>
- *
- * @see Eclipse 3.0
- */
-final class JavaHeuristicScanner implements Symbols {
- /**
- * Returned by all methods when the requested position could not be found,
- * or if a {@link BadLocationException} was thrown while scanning.
- */
- public static final int NOT_FOUND = -1;
-
- /**
- * Special bound parameter that means either -1 (backward scanning) or
- * <code>fDocument.getLength()</code> (forward scanning).
- */
- public static final int UNBOUND = -2;
-
-
- /* character constants */
- private static final char LBRACE = '{';
- private static final char RBRACE = '}';
- private static final char LPAREN = '(';
- private static final char RPAREN = ')';
- private static final char SEMICOLON = ';';
- private static final char COLON = ':';
- private static final char COMMA = ',';
- private static final char LBRACKET = '[';
- private static final char RBRACKET = ']';
- private static final char QUESTIONMARK = '?';
- private static final char EQUAL = '=';
- private static final char LANGLE = '<';
- private static final char RANGLE = '>';
-
- /**
- * Specifies the stop condition, upon which the <code>scanXXX</code>
- * methods will decide whether to keep scanning or not. This interface may
- * implemented by clients.
- */
- private static abstract class StopCondition {
- /**
- * Instructs the scanner to return the current position.
- *
- * @param ch
- * the char at the current position
- * @param position
- * the current position
- * @param forward
- * the iteration direction
- * @return <code>true</code> if the stop condition is met.
- */
- public abstract boolean stop(char ch, int position, boolean forward);
-
- /**
- * Asks the condition to return the next position to query. The
- * default is to return the next/previous position.
- *
- * @return the next position to scan
- */
- public int nextPosition(int position, boolean forward) {
- return forward ? position + 1 : position - 1;
- }
- }
-
- /**
- * Stops upon a non-whitespace (as defined by
- * {@link Character#isWhitespace(char)}) character.
- */
- private static class NonWhitespace extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isWhitespace(ch);
- }
- }
-
- /**
- * Stops upon a non-whitespace character in the default partition.
- *
- * @see NonWhitespace
- */
- private final class NonWhitespaceDefaultPartition extends NonWhitespace {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a non-java identifier (as defined by
- * {@link Character#isJavaIdentifierPart(char)}) character.
- */
- private static class NonJavaIdentifierPart extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isJavaIdentifierPart(ch);
- }
- }
-
- /**
- * Stops upon a non-java identifier character in the default partition.
- *
- * @see NonJavaIdentifierPart
- */
- private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) || !isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a character in the default partition that matches the given
- * character list.
- */
- private final class CharacterMatch extends StopCondition {
- private final char[] fChars;
-
- /**
- * Creates a new instance.
- *
- * @param ch
- * the single character to match
- */
- public CharacterMatch(char ch) {
- this(new char[]{ch});
- }
-
- /**
- * Creates a new instance.
- *
- * @param chars
- * the chars to match.
- */
- public CharacterMatch(char[] chars) {
- Assert.isNotNull(chars);
- Assert.isTrue(chars.length > 0);
- fChars = chars;
- Arrays.sort(chars);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char,
- * int)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /** The document being scanned. */
- private IDocument fDocument;
- /** The partitioning being used for scanning. */
- private String fPartitioning;
- /** The partition to scan in. */
- private String fPartition;
-
- /* internal scan state */
-
- /** the most recently read character. */
- private char fChar;
- /** the most recently read position. */
- private int fPos;
-
- /* preset stop conditions */
- private final StopCondition fNonWSDefaultPart = new NonWhitespaceDefaultPartition();
- private final static StopCondition fNonWS = new NonWhitespace();
- private final StopCondition fNonIdent = new NonJavaIdentifierPartDefaultPartition();
-
- /**
- * Creates a new instance.
- *
- * @param document
- * the document to scan
- * @param partitioning
- * the partitioning to use for scanning
- * @param partition
- * the partition to scan in
- */
- public JavaHeuristicScanner(IDocument document, String partitioning, String partition) {
- Assert.isNotNull(document);
- Assert.isNotNull(partitioning);
- Assert.isNotNull(partition);
- fDocument = document;
- fPartitioning = partitioning;
- fPartition = partition;
- }
-
- /**
- * Calls
- * <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
- *
- * @param document
- * the document to scan.
- */
- public JavaHeuristicScanner(IDocument document) {
- this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
- }
-
- /**
- * Returns the most recent internal scan position.
- *
- * @return the most recent internal scan position.
- */
- public int getPosition() {
- return fPos;
- }
-
- /**
- * Returns the next token in forward direction, starting at
- * <code>start</code>, and not extending further than
- * <code>bound</code>. The return value is one of the constants defined
- * in {@link Symbols}. After a call, {@link #getPosition()} will return
- * the position just after the scanned token (i.e. the next position that
- * will be scanned).
- *
- * @param start
- * the first character position in the document to consider
- * @param bound
- * the first position not to consider any more
- * @return a constant from {@link Symbols} describing the next token
- */
- public int nextToken(int start, int bound) {
- int pos = scanForward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos++;
-
- switch (fChar) {
- case LBRACE :
- return TokenLBRACE;
- case RBRACE :
- return TokenRBRACE;
- case LBRACKET :
- return TokenLBRACKET;
- case RBRACKET :
- return TokenRBRACKET;
- case LPAREN :
- return TokenLPAREN;
- case RPAREN :
- return TokenRPAREN;
- case SEMICOLON :
- return TokenSEMICOLON;
- case COMMA :
- return TokenCOMMA;
- case QUESTIONMARK :
- return TokenQUESTIONMARK;
- case EQUAL :
- return TokenEQUAL;
- case LANGLE :
- return TokenLESSTHAN;
- case RANGLE :
- return TokenGREATERTHAN;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an ident or keyword
- int from = pos, to;
- pos = scanForward(pos + 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- to = bound == UNBOUND ? fDocument.getLength() : bound;
- else
- to = pos;
-
- String identOrKeyword;
- try {
- identOrKeyword = fDocument.get(from, to - from);
- }
- catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- }
- else {
- // operators, number literals etc
- return TokenOTHER;
- }
- }
-
- /**
- * Returns the next token in backward direction, starting at
- * <code>start</code>, and not extending further than
- * <code>bound</code>. The return value is one of the constants defined
- * in {@link Symbols}. After a call, {@link #getPosition()} will return
- * the position just before the scanned token starts (i.e. the next
- * position that will be scanned).
- *
- * @param start
- * the first character position in the document to consider
- * @param bound
- * the first position not to consider any more
- * @return a constant from {@link Symbols} describing the previous token
- */
- public int previousToken(int start, int bound) {
- int pos = scanBackward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos--;
-
- switch (fChar) {
- case LBRACE :
- return TokenLBRACE;
- case RBRACE :
- return TokenRBRACE;
- case LBRACKET :
- return TokenLBRACKET;
- case RBRACKET :
- return TokenRBRACKET;
- case LPAREN :
- return TokenLPAREN;
- case RPAREN :
- return TokenRPAREN;
- case SEMICOLON :
- return TokenSEMICOLON;
- case COLON :
- return TokenCOLON;
- case COMMA :
- return TokenCOMMA;
- case QUESTIONMARK :
- return TokenQUESTIONMARK;
- case EQUAL :
- return TokenEQUAL;
- case LANGLE :
- return TokenLESSTHAN;
- case RANGLE :
- return TokenGREATERTHAN;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an ident or keyword
- int from, to = pos + 1;
- pos = scanBackward(pos - 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- from = bound == UNBOUND ? 0 : bound + 1;
- else
- from = pos + 1;
-
- String identOrKeyword;
- try {
- identOrKeyword = fDocument.get(from, to - from);
- }
- catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- }
- else {
- // operators, number literals etc
- return TokenOTHER;
- }
-
- }
-
- /**
- * Returns one of the keyword constants or <code>TokenIDENT</code> for a
- * scanned identifier.
- *
- * @param s
- * a scanned identifier
- * @return one of the constants defined in {@link Symbols}
- */
- private int getToken(String s) {
- Assert.isNotNull(s);
-
- switch (s.length()) {
- case 2 :
- if ("if".equals(s)) //$NON-NLS-1$
- return TokenIF;
- if ("do".equals(s)) //$NON-NLS-1$
- return TokenDO;
- break;
- case 3 :
- if ("for".equals(s)) //$NON-NLS-1$
- return TokenFOR;
- if ("try".equals(s)) //$NON-NLS-1$
- return TokenTRY;
- if ("new".equals(s)) //$NON-NLS-1$
- return TokenNEW;
- break;
- case 4 :
- if ("case".equals(s)) //$NON-NLS-1$
- return TokenCASE;
- if ("else".equals(s)) //$NON-NLS-1$
- return TokenELSE;
- if ("enum".equals(s)) //$NON-NLS-1$
- return TokenENUM;
- if ("goto".equals(s)) //$NON-NLS-1$
- return TokenGOTO;
- break;
- case 5 :
- if ("break".equals(s)) //$NON-NLS-1$
- return TokenBREAK;
- if ("catch".equals(s)) //$NON-NLS-1$
- return TokenCATCH;
- if ("class".equals(s)) //$NON-NLS-1$
- return TokenCLASS;
- if ("while".equals(s)) //$NON-NLS-1$
- return TokenWHILE;
- break;
- case 6 :
- if ("return".equals(s)) //$NON-NLS-1$
- return TokenRETURN;
- if ("static".equals(s)) //$NON-NLS-1$
- return TokenSTATIC;
- if ("switch".equals(s)) //$NON-NLS-1$
- return TokenSWITCH;
- break;
- case 7 :
- if ("default".equals(s)) //$NON-NLS-1$
- return TokenDEFAULT;
- if ("finally".equals(s)) //$NON-NLS-1$
- return TokenFINALLY;
- break;
- case 9 :
- if ("interface".equals(s)) //$NON-NLS-1$
- return TokenINTERFACE;
- break;
- case 12 :
- if ("synchronized".equals(s)) //$NON-NLS-1$
- return TokenSYNCHRONIZED;
- break;
- }
- return TokenIDENT;
- }
-
- /**
- * Returns the position of the closing peer character (forward search).
- * Any scopes introduced by opening peers are skipped. All peers accounted
- * for must reside in the default partition.
- *
- * <p>
- * Note that <code>start</code> must not point to the opening peer, but
- * to the first character being searched.
- * </p>
- *
- * @param start
- * the start position
- * @param openingPeer
- * the opening peer character (e.g. '{')
- * @param closingPeer
- * the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
- Assert.isNotNull(fDocument);
- Assert.isTrue(start >= 0);
-
- try {
- int depth = 1;
- start -= 1;
- while (true) {
- start = scanForward(start + 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == openingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- }
- catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Returns the position of the opening peer character (backward search).
- * Any scopes introduced by closing peers are skipped. All peers accounted
- * for must reside in the default partition.
- *
- * <p>
- * Note that <code>start</code> must not point to the closing peer, but
- * to the first character being searched.
- * </p>
- *
- * @param start
- * the start position
- * @param openingPeer
- * the opening peer character (e.g. '{')
- * @param closingPeer
- * the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
- Assert.isTrue(start < fDocument.getLength());
-
- try {
- int depth = 1;
- start += 1;
- while (true) {
- start = scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == closingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- }
- catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Computes the surrounding block around <code>offset</code>. The
- * search is started at the beginning of <code>offset</code>, i.e. an
- * opening brace at <code>offset</code> will not be part of the
- * surrounding block, but a closing brace will.
- *
- * @param offset
- * the offset for which the surrounding block is computed
- * @return a region describing the surrounding block, or <code>null</code>
- * if none can be found
- */
- public IRegion findSurroundingBlock(int offset) {
- if (offset < 1 || offset >= fDocument.getLength())
- return null;
-
- int begin = findOpeningPeer(offset - 1, LBRACE, RBRACE);
- int end = findClosingPeer(offset, LBRACE, RBRACE);
- if (begin == NOT_FOUND || end == NOT_FOUND)
- return null;
- return new Region(begin, end + 1 - begin);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code> and the position is in the default
- * partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>) that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceForward(int position, int bound) {
- return scanForward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code>.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>), or <code>NOT_FOUND</code> if none can
- * be found
- */
- public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
- return scanForward(position, bound, fNonWS);
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code> and the position is in the default
- * partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the highest position of a non-whitespace character in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceBackward(int position, int bound) {
- return scanBackward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the lowest position <code>p</code> in <code>fDocument</code>
- * such that <code>start</code> &lt;= p &lt; <code>bound</code> and
- * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
- * <code>true</code>.
- *
- * @param start
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>start</code>, or <code>UNBOUND</code>
- * @param condition
- * the <code>StopCondition</code> to check
- * @return the lowest position in [<code>start</code>,
- * <code>bound</code>) for which <code>condition</code>
- * holds, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int start, int bound, StopCondition condition) {
- Assert.isTrue(start >= 0);
-
- if (bound == UNBOUND)
- bound = fDocument.getLength();
-
- Assert.isTrue(bound <= fDocument.getLength());
-
- try {
- fPos = start;
- while (fPos < bound) {
-
- fChar = fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, true))
- return fPos;
-
- fPos = condition.nextPosition(fPos, true);
- }
- }
- catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> and the position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param ch
- * the <code>char</code> to search for
- * @return the lowest position of <code>ch</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char ch) {
- return scanForward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param chars
- * an array of <code>char</code> to search for
- * @return the lowest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>) that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char[] chars) {
- return scanForward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Finds the highest position <code>p</code> in <code>fDocument</code>
- * such that <code>bound</code> &lt; <code>p</code> &lt;=
- * <code>start</code> and
- * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
- * <code>true</code>.
- *
- * @param start
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>start</code>, or <code>UNBOUND</code>
- * @param condition
- * the <code>StopCondition</code> to check
- * @return the highest position in (<code>bound</code>,
- * <code>start</code> for which <code>condition</code> holds,
- * or <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int start, int bound, StopCondition condition) {
- if (bound == UNBOUND)
- bound = -1;
-
- Assert.isTrue(bound >= -1);
- Assert.isTrue(start < fDocument.getLength());
-
- try {
- fPos = start;
- while (fPos > bound) {
-
- fChar = fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, false))
- return fPos;
-
- fPos = condition.nextPosition(fPos, false);
- }
- }
- catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param ch
- * the <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char ch) {
- return scanBackward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param chars
- * an array of <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char[] chars) {
- return scanBackward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Checks whether <code>position</code> resides in a default (Java)
- * partition of <code>fDocument</code>.
- *
- * @param position
- * the position to be checked
- * @return <code>true</code> if <code>position</code> is in the
- * default partition of <code>fDocument</code>,
- * <code>false</code> otherwise
- */
- public boolean isDefaultPartition(int position) {
- Assert.isTrue(position >= 0);
- Assert.isTrue(position <= fDocument.getLength());
-
- try {
- return fPartition.equals(TextUtilities.getContentType(fDocument, fPartitioning, position, false));
- }
- catch (BadLocationException e) {
- return false;
- }
- }
-
- /**
- * Returns the partition at <code>position</code>.
- *
- * @param position
- * the position to get the partition for
- * @return the partition at <code>position</code> or a dummy zero-length
- * partition if accessing the document fails
- */
- private ITypedRegion getPartition(int position) {
- Assert.isTrue(position >= 0);
- Assert.isTrue(position <= fDocument.getLength());
-
- try {
- return TextUtilities.getPartition(fDocument, fPartitioning, position, false);
- }
- catch (BadLocationException e) {
- return new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
- }
-
- }
-
- /**
- * Checks if the line seems to be an open condition not followed by a
- * block (i.e. an if, while, or for statement with just one following
- * statement, see example below).
- *
- * <pre>
- * if (condition)
- * doStuff();
- * </pre>
- *
- * <p>
- * Algorithm: if the last non-WS, non-Comment code on the line is an if
- * (condition), while (condition), for( expression), do, else, and there
- * is no statement after that
- * </p>
- *
- * @param position
- * the insert position of the new character
- * @param bound
- * the lowest position to consider
- * @return <code>true</code> if the code is a conditional statement or
- * loop without a block, <code>false</code> otherwise
- */
- public boolean isBracelessBlockStart(int position, int bound) {
- if (position < 1)
- return false;
-
- switch (previousToken(position, bound)) {
- case TokenDO :
- case TokenELSE :
- return true;
- case TokenRPAREN :
- position = findOpeningPeer(fPos, LPAREN, RPAREN);
- if (position > 0) {
- switch (previousToken(position - 1, bound)) {
- case TokenIF :
- case TokenFOR :
- case TokenWHILE :
- return true;
- }
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
deleted file mode 100644
index 020769fb6b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-
-class JavaPairMatcher implements ICharacterPairMatcher {
-
- protected char[] fPairs;
- protected IDocument fDocument;
- protected int fOffset;
-
- protected int fStartPos;
- protected int fEndPos;
- protected int fAnchor;
-
- protected JavaCodeReader fReader = new JavaCodeReader();
- /**
- * Stores the source version state.
- *
- * @see Eclipse 3.1
- */
- private boolean fHighlightAngularBrackets = false;
-
-
- public JavaPairMatcher(char[] pairs) {
- fPairs = pairs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument,
- * int)
- */
- public IRegion match(IDocument document, int offset) {
- fOffset = offset;
-
- if(offset < 0 || offset >= document.getLength())
- return null;
-
- fDocument = document;
-
- if (fDocument != null && matchPairsAt() && fStartPos != fEndPos)
- return new Region(fStartPos, fEndPos - fStartPos + 1);
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- return fAnchor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- clear();
- fDocument = null;
- fReader = null;
- }
-
- /*
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- if (fReader != null) {
- try {
- fReader.close();
- }
- catch (IOException x) {
- // ignore
- }
- }
- }
-
- protected boolean matchPairsAt() {
-
- int i;
- int pairIndex1 = fPairs.length;
- int pairIndex2 = fPairs.length;
-
- fStartPos = -1;
- fEndPos = -1;
-
- // get the chars preceding and following the start position
- try {
-
- char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
- // modified behavior for
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=16879
- // char nextChar= fDocument.getChar(fOffset);
-
- // search for opening peer character next to the activation point
- for (i = 0; i < fPairs.length; i = i + 2) {
- // if (nextChar == fPairs[i]) {
- // fStartPos= fOffset;
- // pairIndex1= i;
- // } else
- if (prevChar == fPairs[i]) {
- fStartPos = fOffset - 1;
- pairIndex1 = i;
- }
- }
-
- // search for closing peer character next to the activation point
- for (i = 1; i < fPairs.length; i = i + 2) {
- if (prevChar == fPairs[i]) {
- fEndPos = fOffset - 1;
- pairIndex2 = i;
- }
- // else if (nextChar == fPairs[i]) {
- // fEndPos= fOffset;
- // pairIndex2= i;
- // }
- }
-
- if (fEndPos > -1) {
- fAnchor = RIGHT;
- fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
- if (fStartPos > -1)
- return true;
- else
- fEndPos = -1;
- }
- else if (fStartPos > -1) {
- fAnchor = LEFT;
- fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
- if (fEndPos > -1)
- return true;
- else
- fStartPos = -1;
- }
-
- }
- catch (BadLocationException x) {
- }
- catch (IOException x) {
- }
-
- return false;
- }
-
- protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
- if (openingPeer == '<' && !(fHighlightAngularBrackets && isTypeParameterBracket(offset, document)))
- return -1;
-
- fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == openingPeer && c != closingPeer)
- stack++;
- else if (c == closingPeer)
- stack--;
-
- if (stack == 0)
- return fReader.getOffset();
-
- c = fReader.read();
- }
-
- return -1;
- }
-
-
- protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
- if (openingPeer == '<' && !fHighlightAngularBrackets)
- return -1;
-
- fReader.configureBackwardReader(document, offset, true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == closingPeer && c != openingPeer)
- stack++;
- else if (c == openingPeer)
- stack--;
-
- if (stack == 0) {
- if (closingPeer == '>' && !isTypeParameterBracket(fReader.getOffset(), document))
- return -1;
- return fReader.getOffset();
- }
-
- c = fReader.read();
- }
-
- return -1;
- }
-
- /**
- * Checks if the angular bracket at <code>offset</code> is a type
- * parameter bracket.
- *
- * @param offset
- * the offset of the opening bracket
- * @param document
- * the document
- * @return <code>true</code> if the bracket is part of a type parameter,
- * <code>false</code> otherwise
- * @see Eclipse 3.1
- */
- private boolean isTypeParameterBracket(int offset, IDocument document) {
- /*
- * type parameter come after braces (closing or opening), semicolons,
- * or after a Type name (heuristic: starts with capital character, or
- * after a modifier keyword in a method declaration (visibility,
- * static, synchronized, final)
- */
-
- try {
- IRegion line = document.getLineInformationOfOffset(offset);
-
- JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);
- int prevToken = scanner.previousToken(offset - 1, line.getOffset());
- int prevTokenOffset = scanner.getPosition() + 1;
- String previous = prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
-
- if (prevToken == Symbols.TokenLBRACE || prevToken == Symbols.TokenRBRACE || prevToken == Symbols.TokenSEMICOLON || prevToken == Symbols.TokenSYNCHRONIZED || prevToken == Symbols.TokenSTATIC || (prevToken == Symbols.TokenIDENT && isTypeParameterIntroducer(previous)) || prevToken == Symbols.TokenEOF)
- return true;
- }
- catch (BadLocationException e) {
- return false;
- }
-
- return false;
- }
-
- /**
- * Returns <code>true</code> if <code>identifier</code> is an
- * identifier that could come right before a type parameter list. It uses
- * a heuristic: if the identifier starts with an upper case, it is assumed
- * a type name. Also, if <code>identifier</code> is a method modifier,
- * it is assumed that the angular bracket is part of the generic type
- * parameter of a method.
- *
- * @param identifier
- * the identifier to check
- * @return <code>true</code> if the identifier could introduce a type
- * parameter list
- * @see Eclipse 3.1
- */
- private boolean isTypeParameterIntroducer(String identifier) {
- return identifier.length() > 0 && (Character.isUpperCase(identifier.charAt(0)) || identifier.startsWith("final") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("protected") //$NON-NLS-1$
- || identifier.startsWith("private")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
deleted file mode 100644
index 1b203e3ac9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-/**
- * Symbols for the heuristic java scanner.
- *
- * @see Eclipse 3.0
- */
-interface Symbols {
- int TokenEOF = -1;
- int TokenLBRACE = 1;
- int TokenRBRACE = 2;
- int TokenLBRACKET = 3;
- int TokenRBRACKET = 4;
- int TokenLPAREN = 5;
- int TokenRPAREN = 6;
- int TokenSEMICOLON = 7;
- int TokenOTHER = 8;
- int TokenCOLON = 9;
- int TokenQUESTIONMARK = 10;
- int TokenCOMMA = 11;
- int TokenEQUAL = 12;
- int TokenLESSTHAN = 13;
- int TokenGREATERTHAN = 14;
- int TokenIF = 109;
- int TokenDO = 1010;
- int TokenFOR = 1011;
- int TokenTRY = 1012;
- int TokenCASE = 1013;
- int TokenELSE = 1014;
- int TokenBREAK = 1015;
- int TokenCATCH = 1016;
- int TokenWHILE = 1017;
- int TokenRETURN = 1018;
- int TokenSTATIC = 1019;
- int TokenSWITCH = 1020;
- int TokenFINALLY = 1021;
- int TokenSYNCHRONIZED = 1022;
- int TokenGOTO = 1023;
- int TokenDEFAULT = 1024;
- int TokenNEW = 1025;
- int TokenCLASS = 1026;
- int TokenINTERFACE = 1027;
- int TokenENUM = 1028;
- int TokenIDENT = 2000;
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
deleted file mode 100644
index b02801ad05..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupport.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * This class encapsulates any used Module Core and Facets APIs along with
- * fallbacks for use on non-compliant projects and when those services are not
- * available at runtime.
- *
- * Because ModuleCore API calls can result in locks needing to be acquired,
- * none of these methods should be called while other thread locks have
- * already been acquired.
- */
-final class FacetModuleCoreSupport {
- static final boolean _dump_NCDFE = false;
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- public static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
- IPath path = null;
- try {
- path = FacetModuleCoreSupportDelegate.getWebContentRootPath(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return path;
- }
-
- /**
- * @param project
- * @return the IPaths to acceptable "roots" in a project
- */
- public static IPath[] getAcceptableRootPaths(IProject project) {
- if (project == null)
- return null;
- IPath[] paths = null;
- try {
- paths = FacetModuleCoreSupportDelegate.getAcceptableRootPaths(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- return new IPath[]{project.getFullPath()};
- }
- return paths;
- }
-
- /**
- * @param project
- * @return
- * @throws org.eclipse.core.runtime.CoreException
- */
- public static boolean isWebProject(IProject project) {
- if (project == null)
- return false;
- try {
- return FacetModuleCoreSupportDelegate.isWebProject(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return true;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
deleted file mode 100644
index 2698791734..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
- * bundles are not available, this class will not load, or if it does, its
- * methods will cause NoClassDefFoundErrors. This allows us to
- * compartmentalize the dependencies.
- *
- */
-final class FacetModuleCoreSupportDelegate {
- /**
- * Copied to avoid unneeded extra dependency (plus it's unclear why the
- * value is in that plug-in).
- *
- * @see org.eclipse.wst.common.componentcore.internal.util.IModuleConstants.JST_WEB_MODULE
- */
- private final static String JST_WEB_MODULE = "jst.web"; //$NON-NLS-1$
-
- private final static String WST_WEB_MODULE = "wst.web"; //$NON-NLS-1$
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- static IPath getWebContentRootPath(IProject project) {
- if (!ModuleCoreNature.isFlexibleProject(project))
- return project.getFullPath();
-
- IPath path = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null && component.exists()) {
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
- else {
- path = project.getFullPath();
- }
- return path;
- }
-
- /**
- * @param project
- * @return
- * @throws CoreException
- */
- static boolean isWebProject(IProject project) {
- boolean is = false;
- try {
- IFacetedProject faceted = ProjectFacetsManager.create(project);
- if (ProjectFacetsManager.isProjectFacetDefined(JST_WEB_MODULE)) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(JST_WEB_MODULE);
- is = is || (faceted != null && faceted.hasProjectFacet(facet));
- }
- if (ProjectFacetsManager.isProjectFacetDefined(WST_WEB_MODULE)) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(WST_WEB_MODULE);
- is = is || (faceted != null && faceted.hasProjectFacet(facet));
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- return is;
- }
-
- static IPath[] getAcceptableRootPaths(IProject project) {
- if (!ModuleCoreNature.isFlexibleProject(project)) {
- return new IPath[]{project.getFullPath()};
- }
-
- IPath[] paths = null;
- IVirtualFolder componentFolder = ComponentCore.createFolder(project, Path.ROOT);
- if (componentFolder != null && componentFolder.exists()) {
- IContainer[] workspaceFolders = componentFolder.getUnderlyingFolders();
- paths = new IPath[workspaceFolders.length];
- for (int i = 0; i < workspaceFolders.length; i++) {
- paths[i] = workspaceFolders[i].getFullPath();
- }
- }
- else {
- paths = new IPath[]{project.getFullPath()};
- }
- return paths;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
deleted file mode 100644
index 44e414e2e0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-class NewHTMLFileWizardPage extends WizardNewFileCreationPage {
-
- private static final String defaultName = "NewFile"; //$NON-NLS-1$
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewHTMLFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName, selection);
- }
-
- public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- setFileName(computeDefaultFileName());
- setPageComplete(validatePage());
- }
-
- protected String computeDefaultFileName() {
- int count = 0;
- String fileName = addDefaultExtension(defaultName);
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null) {
- while (true) {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path)) {
- count++;
- fileName = addDefaultExtension(defaultName + count);
- }
- else {
- break;
- }
- }
- }
- return fileName;
- }
-
- /**
- * This method is overridden 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[] webContentPaths = FacetModuleCoreSupport.getAcceptableRootPaths(project);
- for (int i = 0; webContentPaths != null && i < webContentPaths.length; i++) {
- if (!webContentPaths[i].isPrefixOf(fullPath)) {
- setContainerFullPath(webContentPaths[i]);
- break;
- }
- }
- }
-
- /**
- * This method is overridden to set additional validation specific to
- * html files.
- */
- protected boolean validatePage() {
- setMessage(null);
- setErrorMessage(null);
-
- if (!super.validatePage()) {
- return false;
- }
-
- String fileName = getFileName();
- IPath fullPath = getContainerFullPath();
- if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
- // check that filename does not contain invalid extension
- if (!extensionValidForContentType(fileName)) {
- setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
- return false;
- }
- // no file extension specified so check adding default
- // extension doesn't equal a file that already exists
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = addDefaultExtension(fileName);
- IPath resourcePath = fullPath.append(newFileName);
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
- if (!result.isOK()) {
- // path invalid
- setErrorMessage(result.getMessage());
- return false;
- }
-
- if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
- setErrorMessage(HTMLUIMessages.ResourceGroup_nameExists);
- return false;
- }
- }
-
- // get the IProject for the selection path
- IProject project = getProjectFromPath(fullPath);
- // if inside web project, check if inside webContent folder
- if (project != null && isWebProject(project)) {
- // check that the path is inside the webContent folder
- IPath[] webContentPaths = FacetModuleCoreSupport.getAcceptableRootPaths(project);
- boolean isPrefix = false;
- for (int i = 0; !isPrefix && i < webContentPaths.length; i++) {
- isPrefix |= webContentPaths[i].isPrefixOf(fullPath);
- }
- if (!isPrefix) {
- setMessage(HTMLUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
- }
- }
- }
-
- return true;
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType() {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
- return fContentType;
- }
-
- /**
- * Get list of valid extensions for HTML Content type
- *
- * @return
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /**
- * Verifies if fileName is valid name for content type. Takes base content
- * type into consideration.
- *
- * @param fileName
- * @return true if extension is valid for this content type
- */
- private boolean extensionValidForContentType(String fileName) {
- boolean valid = false;
-
- IContentType type = getContentType();
- // there is currently an extension
- if (fileName.lastIndexOf('.') != -1) {
- // check what content types are associated with current extension
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
- int i = 0;
- while (i < types.length && !valid) {
- valid = types[i].isKindOf(type);
- ++i;
- }
- }
- else
- valid = true; // no extension so valid
- return valid;
- }
-
- /**
- * Adds default extension to the filename
- *
- * @param filename
- * @return
- */
- String addDefaultExtension(String filename) {
- StringBuffer newFileName = new StringBuffer(filename);
-
- Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
- String ext = preference.getString(HTMLCorePreferenceNames.DEFAULT_EXTENSION);
-
- newFileName.append("."); //$NON-NLS-1$
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Returns the project that contains the specified path
- *
- * @param path the path which project is needed
- * @return IProject object. If path is <code>null</code> the return value
- * is also <code>null</code>.
- */
- private IProject getProjectFromPath(IPath path) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = null;
-
- if (path != null) {
- if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
- project = workspace.getRoot().getProject(path.toString());
- } else {
- project = workspace.getRoot().getFile(path).getProject();
- }
- }
-
- return project;
- }
-
- /**
- * Checks if the specified project is a web project.
- *
- * @param project project to be checked
- * @return true if the project is web project, otherwise false
- */
- private boolean isWebProject(IProject project) {
- return FacetModuleCoreSupport.isWebProject(project);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
deleted file mode 100644
index 115042e374..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.html.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.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-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 NewHTMLTemplatesWizardPage extends WizardPage {
-
- /**
- * Content provider for templates
- */
- private class TemplateContentProvider implements IStructuredContentProvider {
- /** The template store. */
- private TemplateStore fStore;
-
- /*
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- fStore = null;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object input) {
- return fStore.getTemplates(TemplateContextTypeIdsHTML.NEW);
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fStore = (TemplateStore) newInput;
- }
- }
-
- /**
- * Label provider for templates.
- */
- private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
- * int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
- * int)
- */
- public String getColumnText(Object element, int columnIndex) {
- Template template = (Template) element;
-
- switch (columnIndex) {
- case 0 :
- return template.getName();
- case 1 :
- return template.getDescription();
- default :
- return ""; //$NON-NLS-1$
- }
- }
- }
-
- /** Last selected template name */
- private String fLastSelectedTemplateName;
- /** The viewer displays the pattern of selected template. */
- private SourceViewer fPatternViewer;
- /** The table presenting the templates. */
- private TableViewer fTableViewer;
- /** Template store used by this wizard page */
- private TemplateStore fTemplateStore;
- /** Checkbox for using templates. */
- private Button fUseTemplateButton;
-
- public NewHTMLTemplatesWizardPage() {
- super("NewHTMLTemplatesWizardPage", HTMLUIMessages.NewHTMLTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(HTMLUIMessages.NewHTMLTemplatesWizardPage_1);
- }
-
- /**
- * Correctly resizes the table so no phantom columns appear
- *
- * @param parent
- * the parent control
- * @param buttons
- * the buttons
- * @param table
- * the table
- * @param column1
- * the first column
- * @param column2
- * the second column
- * @param column3
- * the third column
- */
- private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
- parent.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area = parent.getClientArea();
- Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column
- // width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
-
- Point oldSize = table.getSize();
- if (oldSize.x > width) {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- table.setSize(width, area.height);
- }
- else {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(width, area.height);
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- }
- }
- });
- }
-
- public void createControl(Composite ancestor) {
- Composite parent = new Composite(ancestor, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout(layout);
-
- // create checkbox for user to use HTML Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_4);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- fUseTemplateButton.setLayoutData(data);
- fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- enableTemplates();
- }
- });
-
- // create composite for Templates table
- Composite innerParent = new Composite(parent, SWT.NONE);
- GridLayout innerLayout = new GridLayout();
- innerLayout.numColumns = 2;
- innerLayout.marginHeight = 0;
- innerLayout.marginWidth = 0;
- innerParent.setLayout(innerLayout);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
- innerParent.setLayoutData(gd);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // create table that displays templates
- Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
-
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertWidthInCharsToPixels(2);
- data.heightHint = convertHeightInCharsToPixels(10);
- data.horizontalSpan = 2;
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_3);
-
- fTableViewer = new TableViewer(table);
- fTableViewer.setLabelProvider(new TemplateLabelProvider());
- fTableViewer.setContentProvider(new TemplateContentProvider());
-
- fTableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object object1, Object object2) {
- if ((object1 instanceof Template) && (object2 instanceof Template)) {
- Template left = (Template) object1;
- Template right = (Template) object2;
- int result = left.getName().compareToIgnoreCase(right.getName());
- if (result != 0)
- return result;
- return left.getDescription().compareToIgnoreCase(right.getDescription());
- }
- return super.compare(viewer, object1, object2);
- }
-
- public boolean isSorterProperty(Object element, String property) {
- return true;
- }
- });
-
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- updateViewerInput();
- }
- });
-
- // create viewer that displays currently selected template's contents
- fPatternViewer = doCreateViewer(parent);
-
- fTemplateStore = HTMLUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.HTML_NEWWIZARD_TEMPLATE_HELPID);
- Dialog.applyDialogFont(parent);
- setControl(parent);
- }
-
- /**
- * Creates, configures and returns a source viewer to present the template
- * pattern on the preference page. Clients may override to provide a
- * custom source viewer featuring e.g. syntax coloring.
- *
- * @param parent
- * the parent control
- * @return a configured source viewer
- */
- private SourceViewer createViewer(Composite parent) {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationHTML();
-
- 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);
- viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForHTML.ContentTypeID_HTML);
- 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(HTMLUIMessages.NewHTMLTemplatesWizardPage_5);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- SourceViewer viewer = createViewer(parent);
- viewer.setEditable(false);
-
- Control control = viewer.getControl();
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- data.heightHint = convertHeightInCharsToPixels(5);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- control.setLayoutData(data);
-
- return viewer;
- }
-
- /**
- * Enable/disable controls in page based on fUseTemplateButton's current
- * state.
- */
- void enableTemplates() {
- boolean enabled = fUseTemplateButton.getSelection();
-
- if (!enabled) {
- // save last selected template
- Template template = getSelectedTemplate();
- if (template != null)
- fLastSelectedTemplateName = template.getName();
- else
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
-
- fTableViewer.setSelection(null);
- }
- else {
- setSelectedTemplate(fLastSelectedTemplateName);
- }
-
- fTableViewer.getControl().setEnabled(enabled);
- fPatternViewer.getControl().setEnabled(enabled);
- }
-
- /**
- * Return the template preference page id
- *
- * @return
- */
- private String getPreferencePageId() {
- return "org.eclipse.wst.html.ui.preferences.templates"; //$NON-NLS-1$
- }
-
- /**
- * Get the currently selected template.
- *
- * @return
- */
- private Template getSelectedTemplate() {
- Template template = null;
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
-
- if (selection.size() == 1) {
- template = (Template) selection.getFirstElement();
- }
- return template;
- }
-
- /**
- * Returns template string to insert.
- *
- * @return String to insert or null if none is to be inserted
- */
- String getTemplateString() {
- String templateString = null;
-
- Template template = getSelectedTemplate();
- if (template != null) {
- TemplateContextType contextType = HTMLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsHTML.NEW);
- IDocument document = new Document();
- TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
- try {
- TemplateBuffer buffer = context.evaluate(template);
- templateString = buffer.getString();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create template for new html", e); //$NON-NLS-1$
- }
- }
-
- return templateString;
- }
-
- void linkClicked() {
- String pageId = getPreferencePageId();
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
- dialog.open();
- fTableViewer.refresh();
- }
-
- /**
- * Load the last template name used in New HTML File wizard.
- */
- private void loadLastSavedPreferences() {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- boolean setSelection = false;
- String templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
- if (templateName != null && templateName.length() > 0) {
- Template template = fTemplateStore.findTemplateById(templateName);
- if (template != null) {
- fLastSelectedTemplateName = template.getName();
- setSelection = true;
- }
- }
- }
- else {
- fLastSelectedTemplateName = templateName;
- setSelection = true;
- }
- fUseTemplateButton.setSelection(setSelection);
- enableTemplates();
- }
-
- /**
- * Save template name used for next call to New HTML File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- HTMLUIPlugin.getDefault().getPreferenceStore().setValue(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- HTMLUIPlugin.getDefault().savePluginPreferences();
- }
-
- /**
- * Select a template in the table viewer given the template name. If
- * template name cannot be found or templateName is null, just select
- * first item in table. If no items in table select nothing.
- *
- * @param templateName
- */
- private void setSelectedTemplate(String templateName) {
- Object template = null;
-
- if (templateName != null && templateName.length() > 0) {
- // pick the last used template
- template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsHTML.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
deleted file mode 100644
index 77c52f1d51..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.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.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class NewHTMLWizard extends Wizard implements INewWizard {
-
- private NewHTMLFileWizardPage fNewFilePage;
- private NewHTMLTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- public void addPages() {
- fNewFilePage = new NewHTMLFileWizardPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle(HTMLUIMessages._UI_WIZARD_NEW_HEADING);
- fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewHTMLTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- 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(HTMLUIMessages._UI_WIZARD_NEW_TITLE);
-
- ImageDescriptor descriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(HTMLEditorPluginImages.IMG_WIZBAN_NEWHTMLFILE);
- setDefaultPageImageDescriptor(descriptor);
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- });
- }
- }
-
- public boolean performFinish() {
- boolean performedOK = false;
- // save user options for next use
- fNewFileTemplatesPage.saveLastSavedPreferences();
-
- // no file extension specified so add default extension
- String fileName = fNewFilePage.getFileName();
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = fNewFilePage.addDefaultExtension(fileName);
- fNewFilePage.setFileName(newFileName);
- }
-
- // create a new empty file
- IFile file = fNewFilePage.createNewFile();
-
- // if there was problem with creating file, it will be null, so make
- // sure to check
- if (file != null) {
- // put template contents into file
- String templateString = fNewFileTemplatesPage.getTemplateString();
- if (templateString != null) {
- templateString = applyLineDelimiter(file, templateString);
- // determine the encoding for the new file
- Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- try {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- OutputStreamWriter outputStreamWriter = null;
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- // just use default encoding
- outputStreamWriter = new OutputStreamWriter(outputStream);
- }
- else {
- outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
- }
- outputStreamWriter.write(templateString);
- outputStreamWriter.flush();
- outputStreamWriter.close();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- file.setContents(inputStream, true, false, null);
- inputStream.close();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new HTML file", e); //$NON-NLS-1$
- }
- }
-
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
deleted file mode 100644
index dbb3cf3e17..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows HTML content.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class HTMLContentOutlineConfiguration extends XMLContentOutlineConfiguration {
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.html.ui.OutlinePage"; //$NON-NLS-1$
- /**
- * Create new instance of HTMLContentOutlineConfiguration
- */
- public HTMLContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new HTMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
- }
-
- protected IPreferenceStore getPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected String getOutlineFilterTarget(){
- return OUTLINE_FILTER_PREF ;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
deleted file mode 100644
index cfa1c621e7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 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
-# Benjamin Muskalla, b.muskalla@gmx.net - [156040] no new html template for xhtml 1.0 strict
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=comment
-Templates.ul.name=ul
-Templates.ul.desc=unordered list
-Templates.ul.content=<ul>\n <li> Item one </li>\n <li> Item two </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=definition list
-Templates.dl.content=<dl>\n <dt> First definition</dt> <dd> First explanation</dd>\n <dt> Second definition</dt> <dd> Second explanation</dd>\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table
-Templates.table.content=<table>\n <tr>\n <th>Column 1 Heading</th>\n <th>Column 2 Heading</th>\n </tr>\n <tr>\n <td>Row 1: Col 1</td>\n <td>Row 1: Col 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ordered list
-Templates.ol.content=<ol>\n <li> Item one </li>\n <li> Item two </li>\n</ol>\n
-Templates.html.name=New HTML File (4.01 transitional)
-Templates.html.desc=html 4.01 transitional
-Templates.html.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.htmlframeset.name=New HTML File (4.01 frameset)
-Templates.htmlframeset.desc=html 4.01 frameset
-Templates.htmlframeset.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<frameset>\n <frame>\n <frame>\n <noframes>\n <body>\n <p>This page uses frames. The current browser you are using does not support frames.</p>\n </body>\n </noframes>\n</frameset>\n</html>
-Templates.htmlstrict.name=New HTML File (4.01 strict)
-Templates.htmlstrict.desc=html 4.01 strict
-Templates.htmlstrict.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.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.xhtml.name=New XHTML File (1.0 transitional)
-Templates.xhtml.desc=xhtml 1.0 transitional
-Templates.xhtml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.xhtmlframeset.name=New XHTML File (1.0 frameset)
-Templates.xhtmlframeset.desc=xhtml 1.0 frameset
-Templates.xhtmlframeset.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<frameset>\n <frame />\n <frame />\n <noframes>\n <body>\n <p>This page uses frames. The current browser you are using does not support frames.</p>\n </body>\n </noframes>\n</frameset>\n</html>
-Templates.xhtmlstrict.name=New XHTML File (1.0 strict)
-Templates.xhtmlstrict.desc=xhtml 1.0 strict
-Templates.xhtmlstrict.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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.script.name=script
-Templates.script.desc=script (commented)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style (commented)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (map)
-Templates.html5.name=New HTML File (5)
-Templates.html5.desc=html 5
-Templates.html5.content=<!DOCTYPE html>\n<html>\n<head>\n<meta charset="${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
deleted file mode 100644
index c600c08b51..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * Benjamin Muskalla, b.muskalla@gmx.net - [156040] no new html template for xhtml 1.0 strict
- *
- *******************************************************************************/
- -->
-<templates>
-
-<template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.html.ui.templates.comment" context="html_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
-
-<template name="%Templates.imgmap.name" description="%Templates.imgmap.desc" id="org.eclipse.wst.html.ui.templates.imgmap" context="html_tag" enabled="true">&lt;img ismap&gt;</template>
-
-<template name="%Templates.ul.name" description="%Templates.ul.desc" id="org.eclipse.wst.html.ui.templates.ul" context="html_tag" enabled="true">%Templates.ul.content</template>
-
-<template name="%Templates.dl.name" description="%Templates.dl.desc" id="org.eclipse.wst.html.ui.templates.dl" context="html_tag" enabled="true">%Templates.dl.content</template>
-
-<template name="%Templates.table.name" description="%Templates.table.desc" id="org.eclipse.wst.html.ui.templates.table" context="html_tag" enabled="true">%Templates.table.content</template>
-
-<template name="%Templates.ol.name" description="%Templates.ol.desc" id="org.eclipse.wst.html.ui.templates.ol" context="html_tag" enabled="true">%Templates.ol.content</template>
-
-<template name="%Templates.html.name" description="%Templates.html.desc" id="org.eclipse.wst.html.ui.templates.html" context="html_new" enabled="true">%Templates.html.content</template>
-
-<template name="%Templates.htmlframeset.name" description="%Templates.htmlframeset.desc" id="org.eclipse.wst.html.ui.templates.htmlframeset" context="html_new" enabled="true">%Templates.htmlframeset.content</template>
-
-<template name="%Templates.htmlstrict.name" description="%Templates.htmlstrict.desc" id="org.eclipse.wst.html.ui.templates.htmlstrict" context="html_new" enabled="true">%Templates.htmlstrict.content</template>
-
-<template name="%Templates.xhtml.name" description="%Templates.xhtml.desc" id="org.eclipse.wst.html.ui.templates.xhtml" context="html_new" enabled="true">%Templates.xhtml.content</template>
-
-<template name="%Templates.xhtmlframeset.name" description="%Templates.xhtmlframeset.desc" id="org.eclipse.wst.html.ui.templates.xhtmlframeset" context="html_new" enabled="true">%Templates.xhtmlframeset.content</template>
-
-<template name="%Templates.xhtmlstrict.name" description="%Templates.xhtmlstrict.desc" id="org.eclipse.wst.html.ui.templates.xhtmlstrict" context="html_new" enabled="true">%Templates.xhtmlstrict.content</template>
-
-<template name="%Templates.script.name" description="%Templates.script.desc" id="org.eclipse.wst.html.ui.templates.script" context="html_tag" enabled="true">%Templates.script.content</template>
-
-<template name="%Templates.style.name" description="%Templates.style.desc" id="org.eclipse.wst.html.ui.templates.style" context="html_tag" enabled="true">%Templates.style.content</template>
-
-<template name="%Templates.html5.name" description="%Templates.html5.desc" id="org.eclipse.wst.html.ui.templates.html5" context="html_new" enabled="true">%Templates.html5.content</template>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.classpath b/bundles/org.eclipse.wst.jsdt.web.core/.classpath
deleted file mode 100644
index 52165ecfb5..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.options b/bundles/org.eclipse.wst.jsdt.web.core/.options
deleted file mode 100644
index 4ac5072140..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/.options
+++ /dev/null
@@ -1,12 +0,0 @@
-org.eclipse.wst.jsdt.web.core/debug=true
-org.eclipse.wst.jsdt.web.core/debug/tracefilter=
-org.eclipse.wst.jsdt.web.core/debug/jsindexmanager=false
-org.eclipse.wst.jsdt.web.core/debug/jstranslation=false
-org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk=false
-org.eclipse.wst.jsdt.web.core/debug/jssearch=false
-
-org.eclipse.wst.jsdt.web.core/taglib/resolve=false
-
-org.eclipse.wst.jsdt.web.core/debug/jsjavamapping=false
-
-org.eclipse.wst.jsdt.web.core/debug/jsvalidator=false \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.project b/bundles/org.eclipse.wst.jsdt.web.core/.project
deleted file mode 100644
index 22cb875e7e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.web.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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.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.jsdt.web.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.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.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6e07215901..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,96 +0,0 @@
-#Wed Oct 24 19:49: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.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-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=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-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.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=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=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-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=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-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.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index c91d09d875..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,51 +0,0 @@
-#Wed Oct 24 19:41:31 EDT 2007
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=false
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=true
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.format_source_code=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=false
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=true
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_SSE Team Styles
-cleanup_settings_version=2
-eclipse.preferences.version=1
-internal.default.compliance=default
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.overrideannotation=false
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.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.jsdt.web.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.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.jsdt.web.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
deleted file mode 100644
index c8bea09047..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,34 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.jsdt.web.core;singleton:=true
-Bundle-Version: 1.0.401.qualifier
-Bundle-Activator: org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.jsdt.web.core.internal;x-internal:=true,
- org.eclipse.wst.jsdt.web.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.jsdt.web.core.internal.project;x-internal:=true;
- uses:="org.eclipse.wst.common.project.facet.core,
- org.eclipse.wst.jsdt.internal.core,
- org.eclipse.wst.jsdt.core,
- org.eclipse.core.resources,
- org.eclipse.core.runtime",
- org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.jsdt.web.core.internal.validation;x-internal:=true,
- org.eclipse.wst.jsdt.web.core.javascript,
- org.eclipse.wst.jsdt.web.core.javascript.search,
- org.eclipse.wst.jsdt.web.core.text
-Import-Package: com.ibm.icu.util; version="3.8"
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.504,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,2.0.0)";resolution:=optional
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.jsdt.web.core.internal.project"
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/about.html b/bundles/org.eclipse.wst.jsdt.web.core/about.html
deleted file mode 100644
index 460233046e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/build.properties b/bundles/org.eclipse.wst.jsdt.web.core/build.properties
deleted file mode 100644
index 0a4269ee84..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/build.properties
+++ /dev/null
@@ -1,20 +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
-###############################################################################
-source.. = src/
-bin.includes = .options,\
- META-INF/,\
- .,\
- plugin.properties,\
- plugin.xml,\
- component.xml,\
- about.html
-src.includes = component.xml
- \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/component.xml b/bundles/org.eclipse.wst.jsdt.web.core/component.xml
deleted file mode 100644
index 0d66ac286d..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/component.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.jsdt.web">
- <component-depends unrestricted="true" />
- <plugin id="org.eclipse.wst.jsdt.web.core" fragment="false" />
- <package name="org.eclipse.wst.jsdt.web.core.taglib" api="false">
- <type name="IJarRecord" implement="false" />
- <!-- <type name="ITagDirRecord" implement="false" /> -->
- <!-- <type name="ITaglibIndexListener" implement="true" /> -->
- <type name="ITaglibDescriptor" implement="false" />
- <type name="ITaglibRecord" implement="false" />
- <!-- <type name="ITaglibRecordEvent" implement="false" /> -->
- <type name="ITLDRecord" implement="false" />
- <type name="IURLRecord" implement="false" />
- <type name="TaglibIndex" subclass="false" instantiate="false" />
- </package>
- <plugin id="org.eclipse.wst.jsdt.web.ui" fragment="false" />
- <package name="org.eclipse.wst.jsdt.web.ui" api="false">
- <type name="StructuredTextViewerConfigurationJSP" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.jsdt.web.ui.views.contentoutline" api="false">
- <type name="JSPContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.jsdt.web.ui.infopop" fragment="false" />
- <description url="http://eclipse.org/webtools/jst/components/jsp/overview.html" />
-</component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
deleted file mode 100644
index c2042591e1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-pluginName= JavaScript Support
-providerName= Eclipse Web Tools Platform
-Bundle-Name.0 = JSDT Web Support Core
-Bundle-Vendor.0 = Eclipse.org
-extension.name.0 = JavaScript Embedded
-extension.name.1 = Embedded JavaScript Builder
-extension-point.name.0 = JavaScript Pre Processing
-javascript.validator= Client-side JavaScript Validator
-problemMarker.name=Client-side JavaScript Problem
-facet.label=JavaScript
-facet.description=Enables JavaScript development using multiple source files in a configurable Include Path.
-
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
deleted file mode 100644
index 6aa44084f7..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="javascriptPreProcessor" name="%extension-point.name.0" schema="schema/javascriptPreProcessor.exsd"/>
-
- <!-- Full blown JSDT FACET -->
- <extension point="org.eclipse.wst.common.project.facet.core.facets">
- <project-facet id="wst.jsdt.web">
- <label>%facet.label</label>
- <description>%facet.description</description>
- <default-version version="1.0"/>
- </project-facet>
-
- <project-facet-version facet="wst.jsdt.web" version="1.0" />
-
- <action facet="wst.jsdt.web" type="install" id="wst.jsdt.web.install" version="1.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
- </action>
-
- <action facet="wst.jsdt.web" type="uninstall" id="wst.jsdt.web.uninstall" version="1.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
- </action>
-
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
- <supported>
- <facet id="wst.jsdt.web"/>
- <runtime-component any="true"/>
- </supported>
-
- </extension>
-
- <extension point="org.eclipse.wst.jsdt.web.core.javascriptPreProcessor">
- <javascriptPreProcessor
- class="org.eclipse.wst.jsdt.web.core.javascript.JsTranslation"
- priority="1" />
- </extension>
-
- <!-- Install Handler for web JSDT.. Piggybacks on wst.web/jst.web facet-->
- <extension point="org.eclipse.wst.common.project.facet.core.listeners">
- <listener class="org.eclipse.wst.jsdt.web.core.internal.project.FacetedProjectListener" eventTypes="POST_INSTALL"/>
- </extension>
-
- <!--
- <extension point="org.eclipse.wst.common.project.facet.core.facets">
-
- <event-handler facet="wst.web" type="POST_INSTALL" version="[1.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
- </event-handler>
-
- <event-handler facet="wst.web" type="POST_UNINSTALL" version="[1.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
- </event-handler>
-
- </extension>
- -->
- <!-- removed due to JUnit failures during initial WTP build
- <extension id="embeded.jsNature" name="%extension.name.0" point="org.eclipse.core.resources.natures">
- <runtime>
- <run class="org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature"/>
- </runtime>
- <builder id="org.eclipse.wst.jsdt.web.core.embeded.javascript"/>
- </extension>
- -->
-
- <!--
- Not using this at the moment, but everythings in place if we need in the future.
- -->
-
- <extension id="embeded.javascript" name="%extension.name.1" point="org.eclipse.core.resources.builders">
- <builder hasNature="true" callOnEmptyDelta="true">
- <run class="org.eclipse.wst.jsdt.web.core.internal.IncrementalBuilder"/>
- </builder>
- </extension>
-
- <extension id="problem" point="org.eclipse.core.resources.markers" name="%problemMarker.name">
- <super type="org.eclipse.wst.jsdt.core.problem"/>
- <super type="org.eclipse.core.resources.problemmarker"/>
- <super type="org.eclipse.core.resources.textmarker"/>
- <persistent value="true"/>
- <attribute name="id"/>
- <attribute name="flags"/>
- <attribute name="arguments"/>
- <attribute name="categoryId"/>
- </extension>
-
- <!--======================================================================================-->
- <!-- JS batch validation in Web files -->
- <!--======================================================================================-->
- <extension
- id="JsBatchValidator"
- name="%javascript.validator"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="false"
- class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
- manual="false"
- sourceid="org.eclipse.wst.jsdt.web.jssourcevalidator"
- version="2"
- markerId="org.eclipse.wst.jsdt.web.core.problem">
- <include>
- <rules>
- <projectNature id="org.eclipse.wst.jsdt.core.jsNature" />
- </rules>
- </include>
- <include>
- <rules>
- <fileext caseSensitive="false" ext="html"/>
- <fileext caseSensitive="false" ext="xhtml"/>
- <fileext caseSensitive="false" ext="htm"/>
- <fileext caseSensitive="false" ext="htpl"/>
- <fileext caseSensitive="false" ext="jsp"/>
- <fileext caseSensitive="false" ext="jsf"/>
- <fileext caseSensitive="false" ext="jsv"/>
- <fileext caseSensitive="false" ext="jtpl"/>
- <contentType id="org.eclipse.wst.html.core.htmlsource"/>
- <contentType id="org.eclipse.jst.jsp.core.jspsource"/>
- </rules>
- </include>
- <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
- </validator>
- </extension>
-
- <extension point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
- <JsGlobalScopeContainerInitializer
- class="org.eclipse.wst.jsdt.web.core.internal.project.WebProjectJsGlobalScopeContainerInitializer"
- id="org.eclipse.wst.jsdt.launching.WebProject">
- </JsGlobalScopeContainerInitializer>
- </extension>
-
- <extension
- id="webSourcePathProvider"
- point="org.eclipse.wst.jsdt.core.sourcePathProvider">
- <provider class="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd b/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd
deleted file mode 100644
index 82f6f300d6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.jsdt.web.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.jsdt.web.core" id="javascriptPreProcessor" name="JavaScript Pre Processing"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="javascriptPreProcessor"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="javascriptPreProcessor">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="priority" type="string">
- <annotation>
- <documentation>
- loading priority. the highest number wins.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
deleted file mode 100644
index 443bdb7d17..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
+++ /dev/null
@@ -1,47 +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.wst.jsdt.web.core.internal;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class IncrementalBuilder extends IncrementalProjectBuilder {
- public IncrementalBuilder() {
- System.out.println("Unimplemented method:IncrementalProjectBuilder()"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.resources.IncrementalProjectBuilder#build(int,
- * java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
- */
-
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
- System.out.println("Unimplemented method:IncrementalBuilder.build"); //$NON-NLS-1$
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
deleted file mode 100644
index 06df843189..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-JSPIndexManager_0=Updating JavaScript Index
-JSPIndexManager_2=JavaScript Indexer indexing {0} files
-JSP_Search=JavaScript Search -
-JSPDocumentLoader_1=Program Error: structured model had no structuredDocument
-JSPEL_Syntax=EL Syntax Error
-JSPEL_Token=Unable to analyse EL expression due to lexical analysis error
-MESSAGE_JSP_VALIDATING_MESSAGE_UI_=JavaScript Validator validating {0}
-JSPFContentPropertiesManager_Updating=Updating JavaScript Fragment Content Settings
-JSPFContentPropertiesManager_Problems_Updating=Problem saving JavaScript Fragment Content Settings for {0}
-JSPDirectiveValidator_0={0} is a reserved prefix. Try another
-JSPDirectiveValidator_1=Cannot find the tag library descriptor for {0}
-JSPDirectiveValidator_2=The prefix {0} is used more than once
-JSPDirectiveValidator_3=A {0} value is required in this directive
-JSPBatchValidator_0=Gathering files in {0}
-#
-model_initialization=Initializing Client-side JavaScript tooling \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSWebResourceEventManager.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSWebResourceEventManager.java
deleted file mode 100644
index c762a74fcf..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSWebResourceEventManager.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-import org.eclipse.wst.jsdt.internal.core.util.Messages;
-import org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider;
-import org.eclipse.wst.sse.core.indexing.AbstractIndexManager;
-
-/**
- * <p>This is an implementation of the {@link AbstractIndexManager} for the JavaScript Web core plugin.</p>
- *
- * <p>Current Uses:
- * <ul>
- * <li>listen for .project changes so that JavaScript class paths can be updated
- * if the module core nature is added to a project</li>
- * </ul></p>
- *
- * <p><b>NOTE:</b> If any other file resource change listening needs to take place in the future
- * in this plugin it should be done here.</p>
- */
-public class JSWebResourceEventManager extends AbstractIndexManager {
- /** the singleton instance of the {@link JSWebResourceEventManager} */
- private static JSWebResourceEventManager INSTANCE;
-
- /** the name of the ".project" file where natures are stored */
- private static final String DOT_PROJECT_FILE_NAME = ".project"; //$NON-NLS-1$
-
- /** the location to store state */
- private IPath fWorkingLocation;
-
- /**
- * <p>Private constructor for the resource event manager</p>
- */
- private JSWebResourceEventManager() {
- super(Messages.build_analyzingDeltas, Messages.build_analyzingDeltas,
- JsCoreMessages.model_initialization, Messages.manager_filesToIndex);
- }
-
- /**
- * @return the singleton instance of the {@link JSWebResourceEventManager}
- */
- public static JSWebResourceEventManager getDefault() {
- return INSTANCE != null ? INSTANCE : (INSTANCE = new JSWebResourceEventManager());
- }
-
- /**
- * @see org.eclipse.wst.sse.core.indexing.AbstractIndexManager#isResourceToIndex(int, org.eclipse.core.runtime.IPath)
- */
- protected boolean isResourceToIndex(int type, IPath path) {
- return
- type == IResource.ROOT ||
- type == IResource.PROJECT ||
- (type == IResource.FILE && DOT_PROJECT_FILE_NAME.equals(path.lastSegment()));
- }
-
- /**
- * @see org.eclipse.wst.sse.core.indexing.AbstractIndexManager#performAction(byte, byte, org.eclipse.core.resources.IResource, org.eclipse.core.runtime.IPath)
- */
- protected void performAction(byte source, byte action, IResource resource,
- IPath movePath) {
-
- switch(action) {
- case(AbstractIndexManager.ACTION_ADD): {
- if(resource.getName().equals(DOT_PROJECT_FILE_NAME)) {
- updateClassPathEntries(resource.getProject());
- }
- break;
- }
- }
-
- }
-
- /**
- * @see org.eclipse.wst.sse.core.indexing.AbstractIndexManager#getWorkingLocation()
- */
- protected IPath getWorkingLocation() {
- if(this.fWorkingLocation == null) {
- //create path to working area
- IPath workingLocation =
- JsCorePlugin.getDefault().getStateLocation().append("resourceEventManager"); //$NON-NLS-1$
-
- // ensure that it exists on disk
- File folder = new File(workingLocation.toOSString());
- if (!folder.isDirectory()) {
- try {
- folder.mkdir();
- }
- catch (SecurityException e) {
- Logger.logException(this.getName() +
- ": Error while creating state location: " + folder + //$NON-NLS-1$
- " This renders the index manager irrevocably broken for this workspace session", //$NON-NLS-1$
- e);
- }
- }
-
- this.fWorkingLocation = workingLocation;
- }
-
- return this.fWorkingLocation;
- }
-
- /**
- * <p>Updates the JavaScript class path entries for the given project if
- * both the Module core and JavaScript natures are installed on that project.</p>
- *
- * @param project {@link IProject} to update the JavaScript class path entries for
- */
- private static void updateClassPathEntries(IProject project) {
- try {
- /*
- * if a JS project with Module Core nature, check if include path
- * needs to be updated
- */
- if (project.hasNature(JavaScriptCore.NATURE_ID) && ModuleCoreNature.isFlexibleProject(project)) {
- JavaProject jsProject = (JavaProject) JavaScriptCore.create(project);
-
- IIncludePathEntry[] oldEntries = jsProject.getRawIncludepath();
- List updatedEntries = new ArrayList();
- boolean updateIncludePath = false;
-
- for (int oldEntry = 0; oldEntry < oldEntries.length; ++oldEntry) {
- IIncludePathAttribute[] entryAttributes = oldEntries[oldEntry].getExtraAttributes();
-
- boolean isProvidedEntry = false;
- for (int attribute = 0; attribute < entryAttributes.length; ++attribute) {
- isProvidedEntry = entryAttributes[attribute].getName().equals(ModuleSourcePathProvider.PROVIDER_ATTRIBUTE_KEY_NAME) && entryAttributes[attribute].getValue().equals(ModuleSourcePathProvider.PROVIDER_ATTRIBUTE_KEY_VALUE);
- updateIncludePath |= isProvidedEntry;
- if (isProvidedEntry) {
- /*
- * create updated exclusion paths that are not
- * relative to the parent entry
- */
- IPath[] nonRelativeExclusionPaths = oldEntries[oldEntry].getExclusionPatterns();
- for (int i = 0; i < nonRelativeExclusionPaths.length; ++i) {
- nonRelativeExclusionPaths[i] = oldEntries[oldEntry].getPath().append(nonRelativeExclusionPaths[i]);
- }
-
- /*
- * create updated inclusion paths that are not
- * relative to the parent entry
- */
- IPath[] nonRelativeInclusionPaths = oldEntries[oldEntry].getInclusionPatterns();
- for (int i = 0; i < nonRelativeInclusionPaths.length; ++i) {
- nonRelativeInclusionPaths[i] = oldEntries[oldEntry].getPath().append(nonRelativeInclusionPaths[i]);
- }
-
- IResource[] roots = getRoots(project);
- IIncludePathEntry[] resolvedEntries = jsProject.getResolvedClasspath();
- for (int root = 0; root < roots.length; ++root) {
- IPath rootPath = roots[root].getFullPath();
-
- // make sure we do not create a source entry that conflicts with an existing library
- boolean foundMatch = false;
- for(int k = 0; k < resolvedEntries.length; k++) {
- if(resolvedEntries[k].getPath().equals(rootPath)) {
- foundMatch = true;
- break;
- }
- }
- if(foundMatch)
- continue;
-
- /*
- * find matching pre-existing exclusion
- * patterns
- */
- List exclusionPatterns = new ArrayList();
- for (int i = 0; i < nonRelativeExclusionPaths.length; ++i) {
- IPath parentRelativeExclusionPattern = PathUtils.makePatternRelativeToParent(nonRelativeExclusionPaths[i], rootPath);
- if (parentRelativeExclusionPattern != null) {
- exclusionPatterns.add(parentRelativeExclusionPattern);
- }
- }
-
- /*
- * find matching pre-existing inclusion
- * patterns
- */
- List inclusionPatterns = new ArrayList();
- for (int i = 0; i < nonRelativeInclusionPaths.length; ++i) {
- IPath parentRelativeInclusionPattern = PathUtils.makePatternRelativeToParent(nonRelativeInclusionPaths[i], rootPath);
- if (parentRelativeInclusionPattern != null) {
- inclusionPatterns.add(parentRelativeInclusionPattern);
- }
- }
-
- // create new inclusion/exclusion rules
- IPath[] exclusionPaths = exclusionPatterns.isEmpty() ? ClasspathEntry.EXCLUDE_NONE : (IPath[]) exclusionPatterns.toArray(new IPath[exclusionPatterns.size()]);
- IPath[] inclusionPaths = inclusionPatterns.isEmpty() ? ClasspathEntry.INCLUDE_ALL : (IPath[]) inclusionPatterns.toArray(new IPath[inclusionPatterns.size()]);
-
- IIncludePathEntry newEntry = JavaScriptCore.newSourceEntry(rootPath, inclusionPaths, exclusionPaths, null);
- updatedEntries.add(newEntry);
- }
- }
- }
- if (!isProvidedEntry) {
- updatedEntries.add(oldEntries[oldEntry]);
- }
- }
-
- /*
- * if found that a default source path was added, replace with
- * module core determined path
- */
- if (updateIncludePath) {
- // commit the updated include path
- jsProject.setRawIncludepath((IIncludePathEntry[]) updatedEntries.toArray(new IIncludePathEntry[updatedEntries.size()]), jsProject.getOutputLocation(), null);
- }
- }
- }
- catch (CoreException e) {
- Logger.logException("Error while updating JavaScript includepath", e); //$NON-NLS-1$
- }
- }
-
- /**
- * <p>Uses module core to get the roots of the given project.</p>
- *
- * @param project find the module core roots for this {@link IProject}
- * @return the module core roots for the given {@link IProject
- */
- private static IResource[] getRoots(IProject project) {
- IVirtualFile root = ComponentCore.createFile(project, Path.ROOT);
- IResource[] underlyingResources = root.getUnderlyingResources();
- if (underlyingResources == null || underlyingResources.length == 0) {
- underlyingResources = new IResource[]{root.getUnderlyingResource()};
- }
-
- return underlyingResources;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
deleted file mode 100644
index 28adafc05f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
+++ /dev/null
@@ -1,48 +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.wst.jsdt.web.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsCoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.JSPCorePluginResources"; //$NON-NLS-1$
- public static String JSP_Search;
- public static String JSPBatchValidator_0;
- public static String JSPDirectiveValidator_0;
- public static String JSPDirectiveValidator_1;
- public static String JSPDirectiveValidator_2;
- public static String JSPDirectiveValidator_3;
- public static String JSPDocumentLoader_1;
- public static String JSPEL_Syntax;
- public static String JSPEL_Token;
- public static String JSPFContentPropertiesManager_Problems_Updating;
- public static String JSPFContentPropertiesManager_Updating;
- public static String JSPIndexManager_0;
- public static String JSPIndexManager_2;
- public static String model_initialization;
- /**
- * @deprecated
- */
-
- public static String MESSAGE_JSP_VALIDATING_MESSAGE_UI_;
- static {
- // initialize resource bundle
- NLS.initializeMessages(JsCoreMessages.BUNDLE_NAME, JsCoreMessages.class);
- }
-
- private JsCoreMessages() {}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
deleted file mode 100644
index 6fd1201df7..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal;
-
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.resources.ISavedState;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsIndexManager;
-import org.osgi.framework.BundleContext;
-
-public class JsCorePlugin extends Plugin {
- /**
- * <p>
- * A {@link Job} used to perform delayed initialization for the plug-in
- * </p>
- */
- private static class PluginInitializerJob extends Job {
- /**
- * <p>
- * Default constructor to set up this {@link Job} as a long running
- * system {@link Job}
- * </p>
- */
- PluginInitializerJob() {
- super(JsCoreMessages.model_initialization);
-
- this.setUser(false);
- this.setSystem(true);
- this.setPriority(Job.LONG);
- }
-
- /**
- * <p>
- * Perform delayed initialization for the plugin
- * </p>
- *
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- final IWorkspace workspace = ResourcesPlugin.getWorkspace();
- try {
- /*
- * Restore save state and process any events that happened
- * before plug-in loaded. Don't do it immediately since adding
- * the save participant requires a lock on the workspace to
- * compute the accumulated deltas, and if the tree is not
- * already locked it becomes a blocking call.
- */
- IWorkspaceRunnable registerParticipant = new IWorkspaceRunnable() {
- public void run(final IProgressMonitor monitor) throws CoreException {
- ISavedState savedState = null;
-
- try {
- // add the save participant for this bundle
- savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(JsCorePlugin.PLUGIN_ID, new SaveParticipant());
- }
- catch (CoreException e) {
- Logger.logException("JavaScript Web Core failed loading previously saved state; it will be recalculated for this workspace.", e); //$NON-NLS-1$
- }
-
- /*
- * if there is a saved state start up using that, else
- * start up cold
- */
- if (savedState != null) {
- try {
- Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
- }
- finally {
- savedState.processResourceChangeEvents(new IResourceChangeListener() {
- /**
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- JSWebResourceEventManager.getDefault().start(event.getDelta(), monitor);
- }
- });
- }
- }
- else {
- JSWebResourceEventManager.getDefault().start(null, monitor);
- }
- }
- };
- workspace.run(registerParticipant, monitor);
- }
- catch (CoreException e) {
- status = e.getStatus();
- }
-
- return status;
- }
-
- }
-
- /**
- * Used so that all of the IResourceChangeEvents that occurred before this
- * plugin loaded can be processed.
- */
- private static class SaveParticipant implements ISaveParticipant {
- /**
- * <p>
- * Default constructor
- * </p>
- */
- protected SaveParticipant() {
- }
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
- */
- public void doneSaving(ISaveContext context) {
- // ignore
- }
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
- */
- public void prepareToSave(ISaveContext context) throws CoreException {
- // ignore
- }
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
- */
- public void rollback(ISaveContext context) {
- // ignore
- }
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
- */
- public void saving(ISaveContext context) throws CoreException {
- context.needDelta();
- }
- }
-
- // The shared instance.
- private static JsCorePlugin plugin;
- public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.core"; //$NON-NLS-1$
-
- /**
- * <p>
- * Job used to finish tasks needed to start up the plugin but that did not
- * have to block the plugin start up process.
- * </p>
- */
- private Job fPluginInitializerJob;
-
- /**
- * Returns the shared instance.
- *
- * @deprecated - will be removed. Currently used to get
- * "model preferences", but there are other, better ways.
- */
-
- public static JsCorePlugin getDefault() {
- return JsCorePlugin.plugin;
- }
-
- public JsCorePlugin() {
- super();
- JsCorePlugin.plugin = this;
- this.fPluginInitializerJob = new PluginInitializerJob();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // listen for include path changes
- JsIndexManager.getInstance().initialize();
-
- // schedule delayed initialization of our save participant
- this.fPluginInitializerJob.schedule(2000);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
-
- public void stop(BundleContext context) throws Exception {
- /*
- * stop listening for resource changes and interacting with the JS
- * IndexManager
- */
- JsIndexManager.getInstance().shutdown();
- /* Stop the resource event manager */
- JSWebResourceEventManager.getDefault().stop();
- super.stop(context);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
deleted file mode 100644
index 50ac416878..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
+++ /dev/null
@@ -1,155 +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.jsdt.web.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Logger {
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + Logger.ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + Logger.INFO;
- public static final int OK = IStatus.OK; // 0
- public static final int OK_DEBUG = 200 + Logger.OK;
- private static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.core"; //$NON-NLS-1$
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + Logger.WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == Logger.OK_DEBUG || level == Logger.INFO_DEBUG || level == Logger.WARNING_DEBUG || level == Logger.ERROR_DEBUG) {
- if (!Logger.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, Logger.PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(Logger.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 (Logger.isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, Logger.PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(Logger.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 (!Logger.isDebugging()) {
- return false;
- }
- String traceFilter = Platform.getDebugOption(Logger.PLUGIN_ID + Logger.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) {
- Logger._log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- Logger._log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- Logger._log(Logger.ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- Logger._log(Logger.ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- Logger._trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- Logger._trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- Logger._trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/PathUtils.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/PathUtils.java
deleted file mode 100644
index 5d8670e6d1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/PathUtils.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-
-/**
- * <p>Utility class dealing with {@link IPath}s.</p>
- */
-public class PathUtils {
- /** represents the * pattern in a path pattern */
- private static final String STAR = "*"; //$NON-NLS-1$
-
- /** represents the ** pattern in a path pattern */
- private static final String STAR_STAR = "**"; //$NON-NLS-1$
-
- /**
- * <p>Counts the number of segments in a given pattern that match segments in a given parent path.
- * This counting takes place from the beginning of both the pattern and parent and stops when
- * they no longer match. The pattern can contain **, * and ? wild cards.</p>
- *
- * @param pattern count the number of segments of this pattern that match the given <code>parent</code>
- * @param parent count the number of segments in the given <code>pattern</code> that match this path
- * @return the number of segments from the beginning of the given <code>pattern</code> {@link IPath}
- * that match the beginning segments of the given <code>parent</code> {@link IPath}
- */
- public static int countPatternSegmentsThatMatchParent(IPath pattern, IPath parent) {
- int matchingSegments = 0;
-
- //ignore a pattern that is just ** or *
- if(!(pattern.segmentCount() == 1 &&
- (pattern.segment(0).equals(STAR_STAR) || pattern.segment(0).equals(STAR)))) {
-
- int patternSegmentIndex = 0;
- int parentSegmentIndex = 0;
- boolean starStarMode = false;
- while(patternSegmentIndex < pattern.segmentCount() &&
- parentSegmentIndex < parent.segmentCount()) {
-
- String patternSegment = pattern.segment(patternSegmentIndex);
- String parentSegment = parent.segment(parentSegmentIndex);
-
- /* if matching on wild
- * else if wild match on multiple path segments
- * else if wild match on one path segment or path segments are equal
- * else not equal so stop comparing
- */
- if(starStarMode) {
- /* if parent segment equals first pattern segment after a ** stop matching on it
- * else still matching on **
- */
- if(pathSegmentMatchesPattern(patternSegment, parentSegment)) {
- starStarMode = false;
- matchingSegments++;
- patternSegmentIndex++;
- parentSegmentIndex++;
- } else {
- parentSegmentIndex++;
- }
-
- } else if(patternSegment.equals(STAR_STAR)) { //$NON-NLS-1$
- starStarMode = true;
-
- //find the first pattern segment after the ** that is not another ** or *
- matchingSegments++;
- parentSegmentIndex++;
-
- for(int i = patternSegmentIndex+1; i < pattern.segmentCount(); ++i) {
-
- if(!(pattern.segment(i).equals(STAR_STAR) || //$NON-NLS-1$
- pattern.segment(i).equals(STAR))) { //$NON-NLS-1$
-
- patternSegmentIndex = i;
- break;
- }
- }
- } else if(patternSegment.equals("*") || //$NON-NLS-1$
- pathSegmentMatchesPattern(patternSegment, parentSegment)){
-
- matchingSegments++;
- patternSegmentIndex++;
- parentSegmentIndex++;
- } else {
- break;
- }
- }
- }
-
- return matchingSegments;
- }
-
- /**
- * <p>Given a pattern path and a parent path attempts to truncate the given pattern path such
- * that it is relative to the given parent path.</p>
- *
- * @param pattern attempt to truncate this {@link IPath} such that it is relative to the given
- * <code>parent</code> {@link IPath}
- * @param parent attempt to truncate the given <code>pattern</code> {@link IPath} such that it
- * is relative to this {@link IPath}
- * @return either a truncated version of the given <code>pattern</code> {@link IPath} that is
- * relative to the given <code>parent</code> {@link IPath}, or <code>null</code> if the given
- * <code>pattern</code> {@link IPath} could not be truncated to be relative to the given
- * <code>parent</code> {@link IPath}
- */
- public static IPath makePatternRelativeToParent(IPath pattern, IPath parent) {
- int matchedSegments = countPatternSegmentsThatMatchParent(pattern, parent);
-
- IPath relativePattern = null;
- if(matchedSegments != 0) {
- relativePattern = pattern.removeFirstSegments(matchedSegments);
-
- if(relativePattern.segmentCount() == 0) {
- relativePattern = null;
- } else {
- relativePattern.makeRelative();
- }
- }
-
- return relativePattern;
- }
-
- /**
- * <p>A convenience method for checking the matching of one segment from a pattern path with
- * one segment from a path.</p>
- *Bug 334922 - CharOperation#match does not work as expected when isCaseSensitive is passed as false
- * @param patternSegment check if this pattern segment is a match with the given path segment.
- * @param segment check if this path segment matches with the given pattern segment
- * @return <code>true</code> if the segments match, <code>false</code> otherwise
- */
- private static boolean pathSegmentMatchesPattern(String patternSegment, String segment) {
- return CharOperation.pathMatch(patternSegment.toCharArray(), segment.toCharArray(),
- false, File.separatorChar);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
deleted file mode 100644
index 9d4edd7688..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
+++ /dev/null
@@ -1,29 +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.wst.jsdt.web.core.internal.modelhandler;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IWebDocumentChangeListener extends IWebResourceChangedListener {
- public static final int BORING = 0;
- public static final int DIRTY_DOC = 1;
- public static final int DIRTY_MODEL = 2;
-
- public int getIntrestLevelAtOffset(int documentOffset);
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
deleted file mode 100644
index 4084e8b936..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
+++ /dev/null
@@ -1,25 +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.wst.jsdt.web.core.internal.modelhandler;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IWebResourceChangedListener {
- public void resourceChanged();
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
deleted file mode 100644
index 889438fd6f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
+++ /dev/null
@@ -1,41 +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.wst.jsdt.web.core.internal.modelhandler;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.modelhandler.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
deleted file mode 100644
index 106843f247..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class WebResourceChangeHandler implements IResourceChangeListener, IDocumentListener, IModelLifecycleListener {
- /*
- * Check the level of dirty regions when signaling for document events.
- *
- * sometimes the SSE editor doesn't re-validate regions when text is
- * inserted, so setting this to false causes every document change event to
- * trigger a revalidation.
- *
- * setting to true may speed things up.
- *
- */
-// private static final boolean CHECK_INTREST_LEVEL = false;
- private static Hashtable instances = new Hashtable();
- private static final boolean SIGNAL_MODEL = false;
-
- public static WebResourceChangeHandler getInstance(IStructuredModel xmlModel, IWebResourceChangedListener changeListener) {
- WebResourceChangeHandler handler = null;
- synchronized (WebResourceChangeHandler.instances) {
- Enumeration values = WebResourceChangeHandler.instances.elements();
- while (values.hasMoreElements()) {
- Object model = values.nextElement();
- if (model == xmlModel) {
- handler = (WebResourceChangeHandler) WebResourceChangeHandler.instances.get(model);
- }
- }
- if (handler == null) {
- handler = new WebResourceChangeHandler();
- WebResourceChangeHandler.instances.put(handler, xmlModel);
- }
- }
- handler.initialize();
- handler.fchangeListener.add(changeListener);
- return handler;
- }
- private class ModelIrritantThread implements Runnable {
- public void run() {
- signalAllDirtyModel();
- }
-
- public void signalAllDirtyModel() {
- for (int i = 0; i < fchangeListener.size(); i++) {
- ((IWebResourceChangedListener) fchangeListener.get(i)).resourceChanged();
- }
- if (!WebResourceChangeHandler.SIGNAL_MODEL) {
- return;
- }
- IStructuredModel xmlModel = null;
- Object modelRef = getModel();
- if (modelRef == null) {
- return;
- }
- try {
-// for(int i =0;i<fchangeListener.size();i++) {
-// ((IWebResourceChangedListener)fchangeListener.get(i)).resourceChanged();
-// }
- xmlModel = (IStructuredModel) modelRef;//(IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(((IStructuredModel) modelRef).getBaseLocation());
- if (xmlModel != null) {
- IStructuredDocument doc = xmlModel.getStructuredDocument();
- try {
- xmlModel.aboutToChangeModel();
- // xmlModel.setReinitializeNeeded(true);
- // (doc).replace(0, doc.getLength(),doc.get());
- }
- finally {
- xmlModel.changedModel();
- }
- }
- } catch (Exception e) {
- System.out.println(Messages.getString("WebResourceChangeHandler.0")); //$NON-NLS-1$
- } finally {
- if (xmlModel != null) {
-// xmlModel.releaseFromEdit();
- }
- }
- }
- }
- private ArrayList fchangeListener = new ArrayList();
- private ModelIrritantThread irritator;
-
- private WebResourceChangeHandler() {}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
-// if (WebResourceChangeHandler.CHECK_INTREST_LEVEL) {
-// for (int i = 0; i < fchangeListener.size(); i++) {
-// Object o = fchangeListener.get(i);
-// if (o instanceof IWebDocumentChangeListener) {
-// int intrest = ((IWebDocumentChangeListener) o).getIntrestLevelAtOffset(event.fOffset);
-// switch (intrest) {
-// case IWebDocumentChangeListener.DIRTY_MODEL:
-// irritator.signalAllDirtyModel();
-// return;
-// case IWebDocumentChangeListener.DIRTY_DOC:
-// ((IWebDocumentChangeListener) o).resourceChanged();
-// break;
-// }
-// return;
-// }
-// }
-// } else {
- irritator.signalAllDirtyModel();
- //}
- }
-
-
- public boolean equals(Object o) {
- return (o instanceof WebResourceChangeHandler && ((WebResourceChangeHandler) o).fchangeListener == this.fchangeListener);
- }
-
-
- public void finalize() {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- if (WebResourceChangeHandler.instances == null) {
- return;
- }
- Object o = null;
- synchronized (WebResourceChangeHandler.instances) {
- o = WebResourceChangeHandler.instances.get(this);
- WebResourceChangeHandler.instances.remove(this);
- }
- if (o != null) {
- IStructuredModel fXMLModel = (IStructuredModel) o;
- IStructuredDocument fJspDocument = fXMLModel.getStructuredDocument();
- if (fJspDocument != null) {
- fJspDocument.removeDocumentListener(this);
- }
- }
- }
-
- private IStructuredModel getModel() {
- if (WebResourceChangeHandler.instances == null) {
- return null;
- }
- return (IStructuredModel) WebResourceChangeHandler.instances.get(this);
- }
-
- private void initialize() {
- IStructuredModel xmlModel = getModel();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- xmlModel.addModelLifecycleListener(this);
- IStructuredDocument fJspDocument = xmlModel.getStructuredDocument();
- if (fJspDocument != null) {
- fJspDocument.addDocumentListener(this);
- }
- irritator = new ModelIrritantThread();
- }
-
- public void processPostModelEvent(ModelLifecycleEvent event) {
- if (irritator != null) {
- irritator.signalAllDirtyModel();
- }
- if (WebResourceChangeHandler.instances == null) {
- return;
- }
- if (event.getType() == ModelLifecycleEvent.MODEL_RELEASED) {
- synchronized (WebResourceChangeHandler.instances) {
- WebResourceChangeHandler.instances.remove(this);
- }
- }
- }
-
- public void processPreModelEvent(ModelLifecycleEvent event) {}
-
- public void resourceChanged(IResourceChangeEvent event) {
- FileBuffers.getTextFileBufferManager().execute(irritator);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
deleted file mode 100644
index c06bf5de70..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
+++ /dev/null
@@ -1,11 +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
-###############################################################################
-WebResourceChangeHandler.0=Error when updating the model.
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
deleted file mode 100644
index 5824025d38..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
+++ /dev/null
@@ -1,86 +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.wst.jsdt.web.core.internal.project;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.jsdt.internal.core.util.Messages;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-
-/**
- * Installs the JSDT facet, if asked, and setting it as a "fixed" facet.
- *
- */
-class ConvertJob extends WorkspaceJob {
- final static String JSDT_FACET = "wst.jsdt.web";
- private IProject fProject;
- private boolean fInstall = true;
- private boolean fUseExplicitWorkingCopy = false;
-
- ConvertJob(IProject project, boolean install, boolean useExplicitWorkingCopy) {
- super(Messages.converter_ConfiguringForJavaScript);
- fProject = project;
- fInstall = install;
- fUseExplicitWorkingCopy = useExplicitWorkingCopy;
- }
-
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try {
- IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(JSDT_FACET);
- IFacetedProject facetedProject = ProjectFacetsManager.create(fProject);
-
- if (facetedProject != null && fProject.isAccessible()) {
- if (fInstall) {
- IProjectFacetVersion latestVersion = projectFacet.getLatestVersion();
- facetedProject.installProjectFacet(latestVersion, null, monitor);
- }
-
-
- if (fUseExplicitWorkingCopy) {
- IFacetedProjectWorkingCopy copy = facetedProject.createWorkingCopy();
- Set fixed = new HashSet(facetedProject.getFixedProjectFacets());
- fixed.add(projectFacet);
- copy.setFixedProjectFacets(fixed);
- copy.commitChanges(new NullProgressMonitor());
- }
- else {
- Set fixed = new HashSet(facetedProject.getFixedProjectFacets());
- if (!fixed.contains(projectFacet)) {
- fixed.add(projectFacet);
- facetedProject.setFixedProjectFacets(fixed);
- }
- }
- }
- }
- catch (IllegalArgumentException e) {
- // unknown facet ID, bad installation configuration?
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- return Status.OK_STATUS;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
deleted file mode 100644
index d1a9abca96..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
+++ /dev/null
@@ -1,47 +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.wst.jsdt.web.core.internal.project;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-
-public class FacetedProjectListener implements IFacetedProjectListener {
- final static Collection INTERESTING_FACETS = Arrays.asList(new Object[]{"wst.web", "jst.web"});
-
- /**
- *
- */
- public FacetedProjectListener() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener
- * #handleEvent(org.eclipse.wst.common.project.facet.core.events.
- * IFacetedProjectEvent)
- */
- public void handleEvent(IFacetedProjectEvent event) {
- if (event.getType() == IFacetedProjectEvent.Type.POST_INSTALL) {
- IProjectFacetActionEvent actionEvent = (IProjectFacetActionEvent) event;
- if (INTERESTING_FACETS.contains(actionEvent.getProjectFacet().getId())) {
- new ConvertJob(event.getProject().getProject(), true, true).schedule(1000);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
deleted file mode 100644
index d9b36d3820..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.project;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsNatureInstaller implements IDelegate {
- public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask("Installing Facet for JavaScript Development Tools" + ".", 100); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- if(!JsWebNature.hasNature(project))
- installNature(project, monitor);
- } finally {
- monitor.done();
- }
- }
-
- public void installNature(IProject project, IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(Messages.getString("JsNatureInstaller.1"), 100); //$NON-NLS-1$
- monitor.subTask(Messages.getString("JsNatureInstaller.2")); //$NON-NLS-1$
- try {
- monitor.worked(20);
- JsWebNature jsNature = new JsWebNature(project, monitor);
- monitor.worked(20);
- jsNature.configure();
- monitor.worked(40);
-
- new ConvertJob(project, false, true).schedule(1000);
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JsCorePlugin.PLUGIN_ID, IStatus.OK, Messages.getString("JsNatureInstaller.3"), e)); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
deleted file mode 100644
index c59fc6d827..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.core.internal.project;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsNatureUninstaller implements IDelegate {
- public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask("Uninstalling Facet for JavaScript Development Tools" + ".", 100); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- uninstallNature(project, monitor);
- } finally {
- monitor.done();
- }
- }
-
- public void uninstallNature(IProject project, IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(Messages.getString("JsNatureUninstaller.1"), 100); //$NON-NLS-1$
- // by using natures we can leverage the precondition support
- monitor.subTask(Messages.getString("JsNatureUninstaller.2")); //$NON-NLS-1$
- if (!JsWebNature.hasNature(project)) {
- return;
- }
- try {
- IProjectNature jsNature = new JsWebNature(project, monitor);
- monitor.worked(20);
- monitor.worked(50);
- jsNature.deconfigure();
- monitor.worked(20);
- } catch (CoreException e) {
- throw new CoreException(new Status(IStatus.ERROR, JsCorePlugin.PLUGIN_ID, IStatus.OK, Messages.getString("JsNatureUninstaller.3"), e)); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
deleted file mode 100644
index d8c3448a7f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.core.internal.project;
-
-import java.util.Arrays;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IAccessRule;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.LibrarySuperType;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-import org.eclipse.wst.jsdt.internal.core.util.ConvertUtility;
-//import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsWebNature implements IProjectNature {
- //private static final String FILENAME_CLASSPATH = ".classpath"; //$NON-NLS-1$
- // private static final String NATURE_IDS[] =
- // {"org.eclipse.wst.jsdt.web.core.embeded.jsNature",JavaScriptCore.NATURE_ID};
- // //$NON-NLS-1$
- private static final String NATURE_IDS[] = { JavaScriptCore.NATURE_ID };
-
- public static final IPath VIRTUAL_BROWSER_CLASSPATH = new Path("org.eclipse.wst.jsdt.launching.baseBrowserLibrary"); //$NON-NLS-1$
- public static final String VIRTUAL_CONTAINER = "org.eclipse.wst.jsdt.launching.WebProject"; //$NON-NLS-1$
- public static final IIncludePathEntry VIRTUAL_SCOPE_ENTRY = JavaScriptCore.newContainerEntry(new Path(VIRTUAL_CONTAINER), new IAccessRule[0], new IIncludePathAttribute[] {IIncludePathAttribute.HIDE}, false);
- private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
- private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
-
- /* Default JRE entry */
- private static final String DEFAULT_JRE_PATH = "org.eclipse.wst.jsdt.launching.JRE_CONTAINER"; //$NON-NLS-1$
-
- public static void addJsNature(IProject project, IProgressMonitor monitor) throws CoreException {
- if (monitor != null && monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- if (!JsWebNature.hasNature(project)) {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + JsWebNature.NATURE_IDS.length];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- // newNatures[prevNatures.length] = JavaScriptCore.NATURE_ID;
- for (int i = 0; i < JsWebNature.NATURE_IDS.length; i++) {
- newNatures[prevNatures.length + i] = JsWebNature.NATURE_IDS[i];
- }
- description.setNatureIds(newNatures);
- project.setDescription(description, monitor);
- } else {
- if (monitor != null) {
- monitor.worked(1);
- }
- }
- }
-
- public static boolean hasNature(IProject project) {
- try {
- for (int i = 0; i < JsWebNature.NATURE_IDS.length; i++) {
- if (!project.hasNature(JsWebNature.NATURE_IDS[i])) {
- return false;
- }
- }
- } catch (CoreException ex) {
- return false;
- }
- return true;
- }
-
- public static void removeJsNature(IProject project, IProgressMonitor monitor) throws CoreException {
- if (monitor != null && monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- if (JsWebNature.hasNature(project)) {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length - JsWebNature.NATURE_IDS.length];
- int k = 0;
- head: for (int i = 0; i < prevNatures.length; i++) {
- for (int j = 0; j < JsWebNature.NATURE_IDS.length; j++) {
- if (prevNatures[i].equals(JsWebNature.NATURE_IDS[j])) {
- continue head;
- }
- }
- newNatures[k++] = prevNatures[i];
- }
- description.setNatureIds(newNatures);
- project.setDescription(description, monitor);
- } else {
- if (monitor != null) {
- monitor.worked(1);
- }
- }
- }
- private Vector classPathEntries = new Vector();
- private boolean DEBUG = false;
- private IProject fCurrProject;
- private JavaProject fJavaProject;
- private IPath fOutputLocation;
- private IProgressMonitor monitor;
-
- public JsWebNature() {
- monitor = new NullProgressMonitor();
- }
-
- public JsWebNature(IProject project, IProgressMonitor monitor) {
- fCurrProject = project;
- if (monitor != null) {
- this.monitor = monitor;
- } else {
- monitor = new NullProgressMonitor();
- }
- }
-
- public void configure() throws CoreException {
-
- initOutputPath();
- createSourceClassPath();
- initJREEntry();
- initLocalClassPath();
-
- if (hasProjectClassPathFile()) {
- IIncludePathEntry[] entries = getRawClassPath();
- if (entries != null && entries.length > 0) {
- classPathEntries.removeAll(Arrays.asList(entries));
- classPathEntries.addAll(Arrays.asList(entries));
- }
- }
-
- JsWebNature.addJsNature(fCurrProject, monitor);
- fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
- fJavaProject.setProject(fCurrProject);
- try {
- // , fOutputLocation
- if (!hasProjectClassPathFile()) {
- fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), fOutputLocation, monitor);
- }else{
- fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), monitor);
- }
- } catch (Exception e) {
- System.out.println(e);
- }
- LibrarySuperType superType = new LibrarySuperType(new Path( SUPER_TYPE_LIBRARY), getJavaProject(), SUPER_TYPE_NAME);
- getJavaProject().setCommonSuperType(superType);
- // getJavaProject().addToBuildSpec(BUILDER_ID);
- fCurrProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- }
-
- private void createSourceClassPath() {
- if (hasAValidSourcePath()) {
- return;
- }
- IIncludePathEntry[] entries = new ConvertUtility(fCurrProject).getDefaultSourcePaths(fCurrProject);
- for (int i = 0; i < entries.length; i++) {
- classPathEntries.add(entries[i]);
- }
- // IPath projectPath = fCurrProject.getFullPath();
- // classPathEntries.add(JavaScriptCore.newSourceEntry(projectPath));
- }
-
- public void deconfigure() throws CoreException {
- Vector badEntries = new Vector();
- IIncludePathEntry defaultJRELibrary = getJreEntry();
- IIncludePathEntry[] localEntries = initLocalClassPath();
- badEntries.add(defaultJRELibrary);
- badEntries.addAll(Arrays.asList(localEntries));
- IIncludePathEntry[] entries = getRawClassPath();
- Vector goodEntries = new Vector();
- for (int i = 0; i < entries.length; i++) {
- if (!badEntries.contains(entries[i])) {
- goodEntries.add(entries[i]);
- }
- }
- // getJavaProject().removeFromBuildSpec(BUILDER_ID);
- IPath outputLocation = getJavaProject().getOutputLocation();
- getJavaProject().setRawIncludepath((IIncludePathEntry[]) goodEntries.toArray(new IIncludePathEntry[] {}), outputLocation, monitor);
- getJavaProject().deconfigure();
- JsWebNature.removeJsNature(fCurrProject, monitor);
- fCurrProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- }
-
- public JavaProject getJavaProject() {
- if (fJavaProject == null) {
- fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
- fJavaProject.setProject(fCurrProject);
- }
- return fJavaProject;
- }
-
- public IProject getProject() {
- return this.fCurrProject;
- }
-
- private IIncludePathEntry[] getRawClassPath() {
- JavaProject proj = new JavaProject();
- proj.setProject(fCurrProject);
- return proj.readRawIncludepath();
- }
-
- private boolean hasAValidSourcePath() {
- if (hasProjectClassPathFile()) {
- try {
- IIncludePathEntry[] entries = getRawClassPath();
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].getEntryKind() == IIncludePathEntry.CPE_SOURCE) {
- return true;
- }
- }
- } catch (Exception e) {
- if (DEBUG) {
- System.out.println(Messages.getString("JsWebNature.5") + e); //$NON-NLS-1$
- }
- }
- }
- return false;
- }
-
- private boolean hasProjectClassPathFile() {
- if (fCurrProject == null) {
- return false;
- }
- return fCurrProject.getFolder(JavaProject.DEFAULT_PREFERENCES_DIRNAME).getFile(JavaProject.CLASSPATH_FILENAME).exists();
- }
-
- private IIncludePathEntry getJreEntry() {
- return JavaScriptCore.newContainerEntry(new Path(DEFAULT_JRE_PATH));
- }
-
- private void initJREEntry() {
- IIncludePathEntry defaultJRELibrary = getJreEntry();
- try {
- IIncludePathEntry[] entries = getRawClassPath();
- for (int i = 0; i < entries.length; i++) {
- if (entries[i] == defaultJRELibrary) {
- return;
- }
- }
- classPathEntries.add(defaultJRELibrary);
- } catch (Exception e) {
- if (DEBUG) {
- System.out.println(Messages.getString("JsWebNature.6") + e); //$NON-NLS-1$
- }
- }
- }
-
- private IIncludePathEntry[] initLocalClassPath() {
-
- classPathEntries.add(JsWebNature.VIRTUAL_SCOPE_ENTRY);
- IIncludePathEntry browserLibrary = JavaScriptCore.newContainerEntry( VIRTUAL_BROWSER_CLASSPATH);
- classPathEntries.add(browserLibrary);
- //IPath webRoot = WebRootFinder.getWebContentFolder(fCurrProject);
- // IIncludePathEntry source = JavaScriptCore.newSourceEntry(fCurrProject.getFullPath().append(webRoot).append("/"));
- // classPathEntries.add(source);
- return new IIncludePathEntry[] { JsWebNature.VIRTUAL_SCOPE_ENTRY , browserLibrary/*,source*/};
- }
-
- private void initOutputPath() {
- if (fOutputLocation == null) {
- fOutputLocation = fCurrProject.getFullPath();
- }
- }
-
- public void setProject(IProject project) {
- this.fCurrProject = project;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
deleted file mode 100644
index 3c2697f752..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
+++ /dev/null
@@ -1,42 +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.wst.jsdt.web.core.internal.project;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.project.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
deleted file mode 100644
index d841af840f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
+++ /dev/null
@@ -1,198 +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.wst.jsdt.web.core.internal.project;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * This class encapsulates any used Module Core APIs along with fallbacks for
- * use on non-compliant projects and when those services are not available at
- * runtime.
- *
- * Because ModuleCore API calls can result in locks needing to be acquired,
- * none of these methods should be called while other thread locks have
- * already been acquired.
- */
-public final class ModuleCoreSupport {
- static final boolean _dump_NCDFE = false;
- private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static final IPath WEB_INF_PATH = new Path(WEB_INF);
-
- /**
- * @param project
- * @return the computed IPath to the "root" of the web contents, either
- * from facet knowledge or hueristics, or null if one can not be
- * determined
- */
- public static IPath computeWebContentRootPath(IPath path) {
- IPath root = null;
- try {
- root = ModuleCoreSupportDelegate.getWebContentRootPath(ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)));
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- if (root == null) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=213245
- *
- * NPE in JSPTaglibDirectiveContentAssistProcessor with
- * non-faceted project
- */
- root = getLocalRoot(path);
- }
- return root;
- }
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- public static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- IPath path = project.getFullPath();
- try {
- path = ModuleCoreSupportDelegate.getWebContentRootPath(project);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- return path;
- }
-
- /**
- * @param path
- * - the full path to a resource within the workspace
- * @return - the runtime path of the resource if one exists, null
- * otherwise
- */
- public static IPath getRuntimePath(IPath path) {
- IPath result = null;
- try {
- result = ModuleCoreSupportDelegate.getRuntimePath(path);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
- if (result == null) {
- IPath root = getLocalRoot(path);
- result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();
- }
- return result;
- }
-
- /**
- * @param basePath
- * - the full path to a resource within the workspace
- * @param reference
- * - the reference string to resolve
- * @return - the full path within the workspace that corresponds to the
- * given reference according to the virtual pathing support
- */
- public static IPath resolve(IPath basePath, String reference) {
- IPath resolvedPath = null;
- try {
- resolvedPath = ModuleCoreSupportDelegate.resolve(basePath, reference);
- }
- catch (NoClassDefFoundError e) {
- if (_dump_NCDFE)
- e.printStackTrace();
- }
-
- if (resolvedPath == null) {
- IPath rootPath = getLocalRoot(basePath);
- if (reference.startsWith(Path.ROOT.toString())) {
- resolvedPath = rootPath.append(reference);
- }
- else {
- resolvedPath = basePath.removeLastSegments(1).append(reference);
- }
- }
-
- return resolvedPath;
- }
-
- /**
- * @param basePath
- * @return the applicable Web context root path, if one exists
- */
- private static IPath getLocalRoot(IPath basePath) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-
- // existing workspace resources - this is the 93% case
- IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);
-
- // Try the base path as a folder first
- if (file == null && basePath.segmentCount() > 1) {
- file = workspaceRoot.getFolder(basePath);
- }
- // If not a folder, then try base path as a file
- if (file != null && !file.exists() && basePath.segmentCount() > 1) {
- file = workspaceRoot.getFile(basePath);
- }
-
- if (file == null && basePath.segmentCount() == 1) {
- file = workspaceRoot.getProject(basePath.segment(0));
- }
-
- if (file == null) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=116529
- *
- * This method produces a less accurate result, but doesn't
- * require that the file exist yet.
- */
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(basePath);
- if (files.length > 0)
- file = files[0];
- }
-
- while (file != null) {
- /**
- * Treat any parent folder with a WEB-INF subfolder as a web-app
- * root
- */
- IContainer folder = null;
- if ((file.getType() & IResource.FOLDER) != 0) {
- folder = (IContainer) file;
- }
- else {
- folder = file.getParent();
- }
- // getFolder on a workspace root must use a full path, skip
- if (folder != null && (folder.getType() & IResource.ROOT) == 0) {
- IFolder webinf = folder.getFolder(WEB_INF_PATH);
- if (webinf != null && webinf.exists()) {
- return folder.getFullPath();
- }
- }
- file = file.getParent();
- }
-
- return basePath.uptoSegment(1);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
deleted file mode 100644
index e8b6112e54..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.project;
-
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * Wrapper class for all Facet and ModuleCore-related calls. If the Facet or
- * ModuleCore bundles are not available, this class will not load, or if it
- * does, its methods will cause NoClassDefFoundErrors. This allows us to
- * compartmentalize the dependencies.
- *
- */
-final class ModuleCoreSupportDelegate {
- private static final String SLASH = "/";
- private static Map fResolvedMap = new HashMap();
-
- /**
- * @param path
- * - the full path to a resource within the workspace
- * @return - the runtime path of the resource if one exists, null
- * otherwise
- */
- static IPath getRuntimePath(IPath path) {
- if (path == null)
- return null;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
- if (virtualResources != null && virtualResources.length > 0) {
- return virtualResources[0].getRuntimePath();
- }
- return null;
- }
-
- /**
- * @param project
- * @return the IPath to the "root" of the web contents
- */
- static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- IPath path = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null && component.exists()) {
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
- return path;
- }
-
- /**
- * @param basePath
- * - the full path to a resource within the workspace
- * @param reference
- * - the reference string to resolve
- * @return - the full path within the workspace that corresponds to the
- * given reference according to the virtual pathing support
- */
- static IPath resolve(IPath basePath, String reference) {
- if (reference == null || basePath == null || basePath.segmentCount() == 0)
- return null;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- if (basePath.segmentCount() > 1) {
- /*
- * It can take the better part of a full second to do this, so
- * cache the result.
- */
- IPath resolved = null;
- Map mapForBaseResource = null;
- mapForBaseResource = (Map) fResolvedMap.get(basePath);
- if (mapForBaseResource != null) {
- Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
- if (resolvedReference != null)
- resolved = (IPath) resolvedReference.get();
- }
- else {
- mapForBaseResource = new HashMap();
- fResolvedMap.put(basePath, mapForBaseResource);
- }
-
- if (resolved == null) {
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
- for (int i = 0; i < virtualResources.length; i++) {
- IPath baseRuntimePath = virtualResources[i].getRuntimePath();
- IPath referenceRuntimePath = null;
- if (reference.startsWith(SLASH)) {
- referenceRuntimePath = new Path(reference);
- }
- else {
- referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
- }
- IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
- if (virtualFile != null && virtualFile.exists()) {
- IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
- for (int j = 0; j < underlyingFiles.length; j++) {
- if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
- mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
- resolved = underlyingFiles[j].getFullPath();
- }
-
- }
- }
- }
- }
- return resolved;
- }
- else {
- IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
- if (virtualFile != null && virtualFile.exists()) {
- return virtualFile.getUnderlyingFile().getFullPath();
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
deleted file mode 100644
index 1183854a9e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.project;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
-import org.eclipse.wst.jsdt.internal.core.util.DefaultSourcePathProvider;
-
-public class ModuleSourcePathProvider extends DefaultSourcePathProvider {
-
- public static final String PROVIDER_ATTRIBUTE_KEY_NAME = "provider"; //$NON-NLS-1$
- public static final String PROVIDER_ATTRIBUTE_KEY_VALUE = ModuleSourcePathProvider.class.getName(); //$NON-NLS-1$
-
- public ModuleSourcePathProvider() {
- }
-
- public IIncludePathEntry[] getDefaultSourcePaths(IProject p) {
- if (ModuleCoreNature.isFlexibleProject(p)) {
- IVirtualFile root = ComponentCore.createFile(p, Path.ROOT);
- IResource[] underlyingResources = root.getUnderlyingResources();
- if (underlyingResources == null || underlyingResources.length == 0) {
- underlyingResources = new IResource[]{root.getUnderlyingResource()};
- }
- if (underlyingResources.length > 0 && underlyingResources[0] != null) {
- IPath[] paths = new IPath[underlyingResources.length];
- for (int i = 0; i < underlyingResources.length; i++) {
- paths[i] = underlyingResources[i].getFullPath();
- }
- if (paths.length > 0) {
- IIncludePathEntry[] entries = new IIncludePathEntry[paths.length];
- for (int i = 0; i < paths.length; i++) {
- entries[i] = JavaScriptCore.newSourceEntry(paths[i]);
- }
- return entries;
- }
- }
- }
-
- return new IIncludePathEntry[]{JavaScriptCore.newSourceEntry(p.getFullPath(),
- ClasspathEntry.INCLUDE_ALL,ClasspathEntry.EXCLUDE_NONE,null,
- new IIncludePathAttribute[]{JavaScriptCore.newIncludepathAttribute(PROVIDER_ATTRIBUTE_KEY_NAME, PROVIDER_ATTRIBUTE_KEY_VALUE)})};
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
deleted file mode 100644
index ba256bdb7f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
+++ /dev/null
@@ -1,237 +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.wst.jsdt.web.core.internal.project;
-
-import java.net.URI;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
-import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsNameManglerUtil;
-import org.eclipse.wst.jsdt.web.core.javascript.WebRootFinder;
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class WebProjectJsGlobalScopeContainerInitializer extends JsGlobalScopeContainerInitializer {
- private static final String CONTAINER_DESCRIPTION = Messages.getString("WebProjectJsGlobalScopeContainerInitializer.0"); //$NON-NLS-1$
-
- public static final char[] LIB_NAME = {'b','r','o','w','s','e','r','W','i','n','d','o','w','.','j','s'};
- /* Some tokens for us to identify mangled paths */
- private static final String MANGLED_BUTT1 = "htm"; //$NON-NLS-1$
- private static final String MANGLED_BUTT2 = ".js"; //$NON-NLS-1$
-
- //private IJavaScriptProject javaProject;
-
-
- private static String getUnmangedHtmlPath(String containerPathString) {
- if (containerPathString == null) {
- return null;
- }
- if (containerPathString.toLowerCase().indexOf(WebProjectJsGlobalScopeContainerInitializer.MANGLED_BUTT1) != -1 && containerPathString.toLowerCase().indexOf(WebProjectJsGlobalScopeContainerInitializer.MANGLED_BUTT2) != -1) {
- return JsNameManglerUtil.unmangle(containerPathString);
- }
- return null;
- }
- public LibraryLocation getLibraryLocation() {
- return null;
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#canUpdateJsGlobalScopeContainer(org.eclipse.core.runtime.IPath,
- * org.eclipse.wst.jsdt.core.IJavaScriptProject)
- */
-
- public boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project) {
- /* dont remove from this project */
- return false;
- }
-
-
- protected IJsGlobalScopeContainer getContainer(IPath containerPath, IJavaScriptProject project) {
- return this;
- }
-
-
- public String getDescription() {
- return WebProjectJsGlobalScopeContainerInitializer.CONTAINER_DESCRIPTION;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getDescription(org.eclipse.core.runtime.IPath,
- * org.eclipse.wst.jsdt.core.IJavaScriptProject)
- */
-
- public String getDescription(IPath containerPath, IJavaScriptProject javaProject) {
- if (containerPath.equals(new Path(JsWebNature.VIRTUAL_CONTAINER))) {
- return WebProjectJsGlobalScopeContainerInitializer.CONTAINER_DESCRIPTION;
- }
-
- String containerPathString = containerPath.toString();
- IPath webContext = getWebContextRoot(javaProject);
- String fileExtension = containerPath.getFileExtension();
- if(containerPath.equals(getWebContextRoot(javaProject)) || (fileExtension!=null && fileExtension.equals("js"))) { //$NON-NLS-1$
- return webContext.toString();
- }
- String unmangled = WebProjectJsGlobalScopeContainerInitializer.getUnmangedHtmlPath(containerPathString);
- if (unmangled != null) {
- IPath projectPath = javaProject.getPath();
- /* Replace the project path with the project name */
- if (unmangled.indexOf(projectPath.toString()) >= 0) {
- unmangled = javaProject.getDisplayName() + ":" + unmangled.substring(projectPath.toString().length()); //$NON-NLS-1$
- }
- return unmangled;
- }
- return containerPathString;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getHostPath(org.eclipse.core.runtime.IPath)
- */
-
- public URI getHostPath(IPath path, IJavaScriptProject project) {
- // TODO Auto-generated method stub
- String htmlPath = WebProjectJsGlobalScopeContainerInitializer.getUnmangedHtmlPath(path.toString());
- if (htmlPath != null) {
- URI fileUri = new Path(htmlPath).toFile().toURI();
- return fileUri;
- // try {
-// return new URI(htmlPath);
-// } catch (URISyntaxException ex) {
-// ex.printStackTrace();
-// }
- }
-// else {
-// try {
-// return new URI(path.toString());
-// } catch (URISyntaxException ex) {
-// // TODO Auto-generated catch block
-// ex.printStackTrace();
-// }
-// }
- return null;
- }
-
-
- public int getKind() {
- return IJsGlobalScopeContainer.K_SYSTEM;
- }
-
-
- public IPath getPath() {
- return new Path(JsWebNature.VIRTUAL_CONTAINER);
- }
-
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
- public IIncludePathEntry[] getIncludepathEntries() {
-
- //IIncludePathEntry entry=null;
-
- return new IIncludePathEntry[0];
-// try {
-//
-//
-//
-// IPath contextPath = getWebContextRoot(javaProject);
-// //entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null,null, new IAccessRule[0], new IIncludePathAttribute[0], true);
-// //entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null, null, new IAccessRule[0], new IIncludePathAttribute[0], true);
-// //entry =JavaScriptCore.newSourceEntry(contextPath.makeAbsolute());
-// entry = new ClasspathEntry(
-// IPackageFragmentRoot.K_SOURCE,
-// IIncludePathEntry.CPE_SOURCE,
-// contextPath.makeAbsolute(),
-// ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE,
-// null, // source attachment
-// null, // source attachment root
-// null, // custom output location
-// false,
-// null,
-// false, // no access rules to combine
-// new IIncludePathAttribute[] {ClasspathEntry.EXCLUDE_VALIDATE});
-//
-// } catch (RuntimeException ex) {
-// // TODO Auto-generated catch block
-// ex.printStackTrace();
-// }
-//
-// if(entry!=null) return new IIncludePathEntry[] {entry};
-// return new IIncludePathEntry[0];
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- //this.javaProject = project;
- super.initialize(containerPath, project);
-
- }
-
- public static IPath getWebContextRoot(IJavaScriptProject javaProject) {
- IPath projectRelativeWebRoot = WebRootFinder.getWebContentFolder(javaProject.getProject());
- IPath webRootPath = javaProject.getPath().append(projectRelativeWebRoot);
- return webRootPath;
- }
-
-// public IPath[] getAllHtmlInProject() {
-// final ArrayList found = new ArrayList();
-// String webRoot = getWebContextRoot(javaProject).toString();
-// IResourceProxyVisitor visitor = new IResourceProxyVisitor()
-// {
-// public boolean visit( IResourceProxy proxy ) throws CoreException
-// {
-// if ( proxy.getName().endsWith( ".htm" ) )
-// {
-// IPath path = proxy.requestResource().getLocation();
-// found.add(path);
-// //IIncludePathEntry newLibraryEntry = JavaScriptCore.newLibraryEntry( path,null, null, new IAccessRule[ 0 ], new IIncludePathAttribute[ 0 ], true );
-// //entries.add( newLibraryEntry );
-// return false;
-// }
-//
-// return true;
-// }
-// };
-// try
-// {
-// javaProject.getProject().findMember( new Path(webRoot) ).accept( visitor, 0 );
-// }
-// catch ( CoreException e )
-// {
-// }
-//
-//
-// return (IPath[])found.toArray(new IPath[found.size()]);
-//
-// }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
deleted file mode 100644
index 6801bd8257..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-JsNatureUninstaller.1=Uninstalling JavaScript Development Tools...
-JsNatureUninstaller.2=Removing JavaScript Development Tools Nature...
-JsNatureUninstaller.3=Error installing runtime\! JavaScript Development Tools could not be removed, or is not present in target project..
-JsNatureInstaller.1=Installing JavaScript Development Tools...
-JsNatureInstaller.2=Adding JavaScript Development Toolkit Nature...
-JsNatureInstaller.3=Error installing runtime\! JavaScript Development Tools could not be added..
-JsWebNature.5=Error checking sourcepath:
-JsWebNature.6=Error checking sourcepath:
-WebProjectJsGlobalScopeContainerInitializer.0=JavaScript Web Project support
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
deleted file mode 100644
index f4f8734061..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
+++ /dev/null
@@ -1,35 +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.jsdt.web.core.internal.provisional.contenttype;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class ContentTypeIdForEmbededJs {
- /**
- * 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[] ContentTypeIds = ContentTypeIdForEmbededJs. getJsConstantString();
-
- static String[] getJsConstantString() {
- return new String[] {"org.eclipse.wst.html.core.htmlsource","org.eclipse.jst.jsp.core.jspsource"}; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private ContentTypeIdForEmbededJs() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
deleted file mode 100644
index 2b48f85199..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
+++ /dev/null
@@ -1,29 +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.jsdt.web.core.internal.provisional.contenttype;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IContentDescriptionForJSP {
- public final static QualifiedName CONTENT_FAMILY_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentFamilyAttribute"); //$NON-NLS-1$;
- /**
- * Extra properties as part of ContentDescription, if the content is JSP.
- */
- public final static QualifiedName CONTENT_TYPE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentTypeAttribute"); //$NON-NLS-1$
- public final static QualifiedName LANGUAGE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "languageAttribute"); //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
deleted file mode 100644
index 9a24fd5daf..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.jsdt.web.core.internal.validation;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.IWorkspaceRoot;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
-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.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class JsValidator extends AbstractValidator implements IValidator, IExecutableExtension {
- private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsvalidator")).booleanValue(); //$NON-NLS-1$
- private IValidator fMessageOriginator;
- private Set fValidFileExts = new HashSet();
-
- private static final String[] METADATA_FILES = new String[]{".settings/.jsdtscope",".settings/org.eclipse.wst.jsdt.ui.superType.container",".settings/org.eclipse.wst.jsdt.ui.superType.name"};
-
-// private static String [] jsdtValidator = {"org.eclipse.wst.jsdt.web.core.internal.validation.JsBatchValidator"}; //$NON-NLS-1$
-
-
- protected 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 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();
- }
-
- public void setLocalizedMessage(String message) {
- _message = message;
- }
- }
- public JsValidator() {
- this.fMessageOriginator = this;
- }
-
- /**
- * Creates an IMessage from an IProblem
- *
- * @param problem
- * @param f
- * @param translation
- * @param textDoc
- * @return message representation of the problem, or null if it could not
- * create one
- */
- private IMessage createMessageFromProblem(IProblem problem, IFile f, IJsTranslation translation, IDocument textDoc) {
- int sourceStart = problem.getSourceStart();
- int sourceEnd = problem.getSourceEnd();
- if (sourceStart == -1) {
- return null;
- }
-
- /*
- * Bug 241794 - Validation shows errors when using JSP Expressions
- * inside JavaScript code
- */
- IStructuredDocument doc = (IStructuredDocument) textDoc;
- IStructuredDocumentRegion documentRegion = doc.getRegionAtCharacterOffset(sourceStart);
- if (documentRegion != null) {
- ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(sourceStart);
- /*
- * Filter out problems from areas that aren't simple JavaScript,
- * e.g. JSP.
- */
- if (textRegion != null && textRegion instanceof ITextRegionCollection)
- return null;
- }
-
- int sev = problem.isError() ? IMessage.HIGH_SEVERITY : (problem.isWarning() ? IMessage.NORMAL_SEVERITY : IMessage.LOW_SEVERITY);
- IMessage m = new LocalizedMessage(sev, problem.getMessage(), f);
- // line numbers for marker starts @ 1
- // line numbers from document starts @ 0
- try {
- int lineNo = textDoc.getLineOfOffset(sourceStart) + 1;
- m.setLineNo(lineNo);
- m.setOffset(sourceStart);
- m.setLength(sourceEnd - sourceStart + 1);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- return m;
- }
-
- void performValidation(IFile f, IReporter reporter, IStructuredModel model, boolean inBatch) {
- if (model instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) model;
- setupAdapterFactory(domModel);
- IDOMDocument xmlDoc = domModel.getDocument();
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- //translationAdapter.resourceChanged();
- IJsTranslation translation = translationAdapter.getJsTranslation(false);
- if (!reporter.isCancelled()) {
- translation.setProblemCollectingActive(true);
- translation.reconcileCompilationUnit();
- List problems = translation.getProblems();
-// if(!inBatch) reporter.removeAllMessages(this, f);
- // add new messages
- for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
- IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, domModel.getStructuredDocument());
- if (m != null) {
- reporter.addMessage(fMessageOriginator, m);
- }
- }
- }
- }
- }
-
- /* Read the definition for this validator and the declared valid file extensions
- * @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 {
- IConfigurationElement[] includes = config.getChildren("include"); //$NON-NLS-1$
- for (int i = 0; i < includes.length; i++) {
- IConfigurationElement[] fileexts = includes[i].getChildren("fileext"); //$NON-NLS-1$
- for (int j = 0; j < fileexts.length; j++) {
- String fileext = fileexts[j].getAttribute("ext"); //$NON-NLS-1$
- if (fileext != null) {
- fValidFileExts.add(fileext);
- }
- }
- }
- }
-
- /**
- * Ensures that our translation adapter is present before we try to use it
- *
- * @param sm
- */
- private void setupAdapterFactory(IStructuredModel sm) {
- if (sm.getFactoryRegistry().getFactoryFor(IJsTranslation.class) == null) {
- JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
- sm.getFactoryRegistry().addFactory(factory);
- }
- }
-
- boolean shouldValidate(IFile file) {
- 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 fValidFileExts.isEmpty() || fValidFileExts.contains(file.getFileExtension());
- }
-
- public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
- /* Added by BC ---- */
- // if(true) return;
- /* end Added by BC ---- */
-
- String[] uris = helper.getURIs();
- if (uris.length > 0) {
- IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- IFile currentFile = null;
- for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
- currentFile = wsRoot.getFile(new Path(uris[i]));
- reporter.removeAllMessages(this, currentFile);
- if (currentFile != null && currentFile.exists()) {
- if (shouldValidate(currentFile) ){ //&& fragmentCheck(currentFile)) {
- int percent = (i * 100) / uris.length + 1;
- IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + uris[i]); //$NON-NLS-1$
- reporter.displaySubtask(this, message);
- validateFile(currentFile, reporter);
- }
- if (DEBUG) {
- System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- } else {
- // if uris[] length 0 -> validate() gets called for each project
- if (helper instanceof IWorkbenchContext) {
- IProject project = ((IWorkbenchContext) helper).getProject();
- JSFileVisitor visitor = new JSFileVisitor(reporter);
- try {
- // collect all jsp files for the project
- project.accept(visitor, IResource.DEPTH_INFINITE);
- } catch (CoreException e) {
- if (DEBUG) {
- e.printStackTrace();
- }
- }
- IFile[] files = visitor.getFiles();
- for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
- int percent = (i * 100) / files.length + 1;
- IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString()); //$NON-NLS-1$
- reporter.displaySubtask(this, message);
- validateFile(files[i], reporter);
- if (DEBUG) {
- System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
- }
-
- protected class JSFileVisitor implements IResourceProxyVisitor {
- private List fFiles = new ArrayList();
- private IReporter fReporter = null;
-
- public JSFileVisitor(IReporter reporter) {
- fReporter = reporter;
- }
-
- public final IFile[] getFiles() {
- return (IFile[]) fFiles.toArray(new IFile[fFiles.size()]);
- }
-
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
- // check validation
- if (fReporter.isCancelled()) {
- return false;
- }
- if (proxy.getType() == IResource.FILE) {
- if (Util.isJsType(proxy.getName())) {
- IFile file = (IFile) proxy.requestResource();
- if (file.exists() && shouldValidate(file)) {
- if (DEBUG) {
- System.out.println("(+) JSPValidator adding file: " + file.getName()); //$NON-NLS-1$
- }
- fFiles.add(file);
- // don't search deeper for files
- return false;
- }
- }
- }
- return true;
- }
- }
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
- /**
- * Validate one file. It's assumed that the file has JSP content type.
- *
- * @param f
- * @param reporter
- */
-
- protected void validateFile(IFile f, IReporter reporter) {
- if (JsValidator.DEBUG) {
- Logger.log(Logger.INFO, getClass().getName() + " validating: " + f); //$NON-NLS-1$
- }
- IStructuredModel model = null;
- try {
- // get jsp model, get tranlsation
- model = StructuredModelManager.getModelManager().getModelForRead(f);
- if (!reporter.isCancelled() && model != null) {
- // get DOM model then translation
- //WorkbenchReporter.removeAllMessages(f.getProject(), jsdtValidator, f.toString());
- //reporter.removeAllMessages(fMessageOriginator, f);
- performValidation(f, reporter, model, false);
- }
- } catch (IOException e) {
- Logger.logException(e);
- } catch (CoreException e) {
- Logger.logException(e);
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE || !shouldValidate((IFile) resource))
- return null;
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- IFile file = (IFile) resource;
- validateFile(file, reporter);
- result.setDependsOn(createDependencies(file));
- return result;
- }
-
- private IResource[] createDependencies(IFile file) {
- IFile[] depends = new IFile[METADATA_FILES.length];
- for (int i = 0; i < METADATA_FILES.length; i++) {
- depends[i] = file.getProject().getFile(METADATA_FILES[i]);
- }
- return depends;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
deleted file mode 100644
index 5e84a72acc..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
+++ /dev/null
@@ -1,57 +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.wst.jsdt.web.core.internal.validation;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype.ContentTypeIdForEmbededJs;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Util {
-
- public static boolean isJsType(String fileName) {
- if(fileName==null) return false;
- boolean valid = false;
- IContentType[] types =getJavascriptContentTypes();
- int i = 0;
- while (types!=null && i < types.length && !valid) {
- valid = types[i]!=null && types[i].isAssociatedWith(fileName);
- ++i;
- }
- return valid;
-
- }
-
- public static IContentType[] getJavascriptContentTypes() {
-
- String[] contentTypeIds = ContentTypeIdForEmbededJs.ContentTypeIds;
- ArrayList fContentTypes = new ArrayList();
-
-
- for(int i = 0;i<contentTypeIds.length;i++) {
- IContentType ct = Platform.getContentTypeManager().getContentType(contentTypeIds[i]);
- if(ct!=null) fContentTypes.add(ct);
- }
-
- return (IContentType[])fContentTypes.toArray(new IContentType[fContentTypes.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
deleted file mode 100644
index 8dbeb85e30..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.core.javascript;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IProblemRequestor;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-
-/**
-
-
-
-
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- * <br><br> this code was taken from the JSP plugin. This class is to ensure only one copy of the compilation unit exits.
- *
- * @author pavery
- */
-public class CompilationUnitHelper {
- private static CompilationUnitHelper instance;
-
- public synchronized static final CompilationUnitHelper getInstance() {
- if (CompilationUnitHelper.instance == null) {
- CompilationUnitHelper.instance = new CompilationUnitHelper();
- }
- return CompilationUnitHelper.instance;
- }
- private JsProblemRequestor fProblemRequestor = null;
- private WorkingCopyOwner fWorkingCopyOwner = null;
-
- private CompilationUnitHelper() {
- // force use of instance
- }
-
- public JsProblemRequestor getProblemRequestor() {
- if (fProblemRequestor == null) {
- fProblemRequestor = new JsProblemRequestor();
- }
- return fProblemRequestor;
- }
-
- public WorkingCopyOwner getWorkingCopyOwner() {
- if (fWorkingCopyOwner == null) {
- fWorkingCopyOwner = new WorkingCopyOwner() {
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.WorkingCopyOwner#getProblemRequestor(org.eclipse.wst.jsdt.core.IJavaScriptUnit)
- */
- public IProblemRequestor getProblemRequestor(IJavaScriptUnit workingCopy) {
- return CompilationUnitHelper.this.getProblemRequestor();
- }
-
- public String toString() {
- return "Client JavaScript WorkingCopyOwner"; //$NON-NLS-1$
- }
- };
- }
- return fWorkingCopyOwner;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
deleted file mode 100644
index 7320ba9208..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
+++ /dev/null
@@ -1,77 +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.wst.jsdt.web.core.javascript;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-* <br><br>
-*
-* this class attaches to a "cloned" document, listens for changes to that document then translates
-* the changes to text edits. these changes can then be applied back to the original document.
-*
-*
-*/
-public class DocumentChangeListenerToTextEdit implements IDocumentListener {
- private MultiTextEdit textEdit;
-
- public DocumentChangeListenerToTextEdit() {
- textEdit = new MultiTextEdit();
- }
-
- public void documentAboutToBeChanged(DocumentEvent event) {
- // System.out.println("Unimplemented
- // method:DocumentChangeListenerToTextEdit.documentAboutToBeChanged");
- }
-
- public void documentChanged(DocumentEvent event) {
- int length = event.getLength();
- int offset = event.getOffset();
- String text = event.getText();
- if (length < 0) {
- return;
- }
- if (length == 0) {
- /* inserting text operation */
- InsertEdit edit = new InsertEdit(offset, text);
- textEdit.addChild(edit);
-
- } else if (text == null || text.equals("")) { //$NON-NLS-1$
- /* delete operation */
- DeleteEdit edit = new DeleteEdit(offset, length);
- textEdit.addChild(edit);
-
- } else if (length > 0) {
- /* replace text operation */
- ReplaceEdit edit = new ReplaceEdit(offset, length, text);
- textEdit.addChild(edit);
-
- }
- }
-
- public MultiTextEdit getTextEdits() {
- return textEdit;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
deleted file mode 100644
index e34d226754..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
+++ /dev/null
@@ -1,679 +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.jsdt.web.core.javascript;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface HTML40Namespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = "A"; //$NON-NLS-1$
- public static final String ABBR = "ABBR"; //$NON-NLS-1$
- public static final String ACRONYM = "ACRONYM"; //$NON-NLS-1$
- public static final String ADDRESS = "ADDRESS"; //$NON-NLS-1$
- public static final String APPLET = "APPLET"; //$NON-NLS-1$
- public static final String AREA = "AREA"; //$NON-NLS-1$
- public static final String B = "B"; //$NON-NLS-1$
- public static final String BASE = "BASE"; //$NON-NLS-1$
- public static final String BASEFONT = "BASEFONT"; //$NON-NLS-1$
- public static final String BDO = "BDO"; //$NON-NLS-1$
- public static final String BGSOUND = "BGSOUND"; // D205513 //$NON-NLS-1$
- public static final String BIG = "BIG"; //$NON-NLS-1$
- public static final String BLINK = "BLINK"; //$NON-NLS-1$
- public static final String BLOCKQUOTE = "BLOCKQUOTE"; //$NON-NLS-1$
- public static final String BODY = "BODY"; //$NON-NLS-1$
- public static final String BR = "BR"; //$NON-NLS-1$
- public static final String BUTTON = "BUTTON"; //$NON-NLS-1$
- public static final String CAPTION = "CAPTION"; //$NON-NLS-1$
- public static final String CENTER = "CENTER"; //$NON-NLS-1$
- public static final String CITE = "CITE"; //$NON-NLS-1$
- public static final String CODE = "CODE"; //$NON-NLS-1$
- public static final String COL = "COL"; //$NON-NLS-1$
- public static final String COLGROUP = "COLGROUP"; //$NON-NLS-1$
- public static final String DD = "DD"; //$NON-NLS-1$
- public static final String DEL = "DEL"; //$NON-NLS-1$
- public static final String DFN = "DFN"; //$NON-NLS-1$
- public static final String DIR = "DIR"; //$NON-NLS-1$
- public static final String DIV = "DIV"; //$NON-NLS-1$
- public static final String DL = "DL"; //$NON-NLS-1$
- public static final String DT = "DT"; //$NON-NLS-1$
- public static final String EM = "EM"; //$NON-NLS-1$
- public static final String EMBED = "EMBED"; //$NON-NLS-1$
- public static final String FIELDSET = "FIELDSET"; //$NON-NLS-1$
- public static final String FONT = "FONT"; //$NON-NLS-1$
- public static final String FORM = "FORM"; //$NON-NLS-1$
- public static final String FRAME = "FRAME"; //$NON-NLS-1$
- public static final String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public static final String H1 = "H1"; //$NON-NLS-1$
- public static final String H2 = "H2"; //$NON-NLS-1$
- public static final String H3 = "H3"; //$NON-NLS-1$
- public static final String H4 = "H4"; //$NON-NLS-1$
- public static final String H5 = "H5"; //$NON-NLS-1$
- public static final String H6 = "H6"; //$NON-NLS-1$
- public static final String HEAD = "HEAD"; //$NON-NLS-1$
- public static final String HR = "HR"; //$NON-NLS-1$
- public static final String HTML = "HTML"; //$NON-NLS-1$
- public static final String I = "I"; //$NON-NLS-1$
- public static final String IFRAME = "IFRAME"; //$NON-NLS-1$
- public static final String IMG = "IMG"; //$NON-NLS-1$
- public static final String INPUT = "INPUT"; //$NON-NLS-1$
- public static final String INS = "INS"; //$NON-NLS-1$
- public static final String ISINDEX = "ISINDEX"; //$NON-NLS-1$
- public static final String KBD = "KBD"; //$NON-NLS-1$
- public static final String LABEL = "LABEL"; //$NON-NLS-1$
- public static final String LEGEND = "LEGEND"; //$NON-NLS-1$
- public static final String LI = "LI"; //$NON-NLS-1$
- public static final String LINK = "LINK"; //$NON-NLS-1$
- public static final String MAP = "MAP"; //$NON-NLS-1$
- public static final String MENU = "MENU"; //$NON-NLS-1$
- public static final String META = "META"; //$NON-NLS-1$
- public static final String NOBR = "NOBR"; // D205513 //$NON-NLS-1$
- public static final String NOEMBED = "NOEMBED"; //$NON-NLS-1$
- public static final String NOFRAMES = "NOFRAMES"; //$NON-NLS-1$
- public static final String NOSCRIPT = "NOSCRIPT"; //$NON-NLS-1$
- public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
- public static final String OL = "OL"; //$NON-NLS-1$
- public static final String OPTGROUP = "OPTGROUP"; //$NON-NLS-1$
- public static final String OPTION = "OPTION"; //$NON-NLS-1$
- public static final String P = "P"; //$NON-NLS-1$
- public static final String PARAM = "PARAM"; //$NON-NLS-1$
- public static final String PRE = "PRE"; //$NON-NLS-1$
- public static final String Q = "Q"; //$NON-NLS-1$
- public static final String S = "S"; //$NON-NLS-1$
- public static final String SAMP = "SAMP"; //$NON-NLS-1$
- public static final String SCRIPT = "SCRIPT"; //$NON-NLS-1$
- public static final String SELECT = "SELECT"; //$NON-NLS-1$
- public static final String SMALL = "SMALL"; //$NON-NLS-1$
- public static final String SPAN = "SPAN"; //$NON-NLS-1$
- public static final String STRIKE = "STRIKE"; //$NON-NLS-1$
- public static final String STRONG = "STRONG"; //$NON-NLS-1$
- public static final String STYLE = "STYLE"; //$NON-NLS-1$
- public static final String SUB = "SUB"; //$NON-NLS-1$
- public static final String SUP = "SUP"; //$NON-NLS-1$
- public static final String TABLE = "TABLE"; //$NON-NLS-1$
- public static final String TBODY = "TBODY"; //$NON-NLS-1$
- public static final String TD = "TD"; //$NON-NLS-1$
- public static final String TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
- public static final String TFOOT = "TFOOT"; //$NON-NLS-1$
- public static final String TH = "TH"; //$NON-NLS-1$
- public static final String THEAD = "THEAD"; //$NON-NLS-1$
- public static final String TITLE = "TITLE"; //$NON-NLS-1$
- public static final String TR = "TR"; //$NON-NLS-1$
- public static final String TT = "TT"; //$NON-NLS-1$
- public static final String U = "U"; //$NON-NLS-1$
- public static final String UL = "UL"; //$NON-NLS-1$
- public static final String VAR = "VAR"; //$NON-NLS-1$
- public static final String WBR = "WBR"; // D205513 //$NON-NLS-1$
- public static final String MARQUEE = "MARQUEE"; //$NON-NLS-1$
- public static final String SSI_CONFIG = "SSI:CONFIG"; // D210393 //$NON-NLS-1$
- public static final String SSI_ECHO = "SSI:ECHO"; //$NON-NLS-1$
- public static final String SSI_EXEC = "SSI:EXEC"; //$NON-NLS-1$
- public static final String SSI_FSIZE = "SSI:FSIZE"; //$NON-NLS-1$
- public static final String SSI_FLASTMOD = "SSI:FLASTMOD"; //$NON-NLS-1$
- public static final String SSI_INCLUDE = "SSI:INCLUDE"; //$NON-NLS-1$
- public static final String SSI_PRINTENV = "SSI:PRINTENV"; //$NON-NLS-1$
- public static final String SSI_SET = "SSI:SET"; //$NON-NLS-1$
- public static final String WML_WML = "wml"; //$NON-NLS-1$
- public static final String WML_CARD = "card"; //$NON-NLS-1$
- public static final String WML_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String WML_ACCESS = "access"; //$NON-NLS-1$
- public static final String WML_DO = "do"; //$NON-NLS-1$
- public static final String WML_ONEVENT = "onevent"; //$NON-NLS-1$
- public static final String WML_TIMER = "timer"; //$NON-NLS-1$
- public static final String WML_ANCHOR = "anchor"; //$NON-NLS-1$
- public static final String WML_PREV = "prev"; //$NON-NLS-1$
- public static final String WML_REFRESH = "refresh"; //$NON-NLS-1$
- public static final String WML_GO = "go"; //$NON-NLS-1$
- public static final String WML_NOOP = "noop"; //$NON-NLS-1$
- public static final String WML_SETVAR = "setvar"; //$NON-NLS-1$
- public static final String WML_POSTFIELD = "postfield"; //$NON-NLS-1$
- }
-
- // Character Entities
- public static interface EntityName {
- public static final String AACUTE_U = "Aacute"; //$NON-NLS-1$
- public static final String AACUTE_L = "aacute"; //$NON-NLS-1$
- public static final String ACIRC_U = "Acirc"; //$NON-NLS-1$
- public static final String ACIRC_L = "acirc"; //$NON-NLS-1$
- public static final String ACUTE = "acute"; //$NON-NLS-1$
- public static final String AELIG_U = "AElig"; //$NON-NLS-1$
- public static final String AELIG_L = "aelig"; //$NON-NLS-1$
- public static final String AGRAVE_U = "Agrave"; //$NON-NLS-1$
- public static final String AGRAVE_L = "agrave"; //$NON-NLS-1$
- public static final String ALEFSYM = "alefsym"; //$NON-NLS-1$
- public static final String ALPHA_U = "Alpha"; //$NON-NLS-1$
- public static final String ALPHA_L = "alpha"; //$NON-NLS-1$
- public static final String AMP = "amp"; //$NON-NLS-1$
- public static final String AND = "and"; //$NON-NLS-1$
- public static final String ANG = "ang"; //$NON-NLS-1$
- public static final String ARING_U = "Aring"; //$NON-NLS-1$
- public static final String ARING_L = "aring"; //$NON-NLS-1$
- public static final String ASYMP = "asymp"; //$NON-NLS-1$
- public static final String ATILDE_U = "Atilde"; //$NON-NLS-1$
- public static final String ATILDE_L = "atilde"; //$NON-NLS-1$
- public static final String AUML_U = "Auml"; //$NON-NLS-1$
- public static final String AUML_L = "auml"; //$NON-NLS-1$
- public static final String BDQUO = "bdquo"; //$NON-NLS-1$
- public static final String BETA_U = "Beta"; //$NON-NLS-1$
- public static final String BETA_L = "beta"; //$NON-NLS-1$
- public static final String BRVBAR = "brvbar"; //$NON-NLS-1$
- public static final String BULL = "bull"; //$NON-NLS-1$
- public static final String CAP = "cap"; //$NON-NLS-1$
- public static final String CCEDIL_U = "Ccedil"; //$NON-NLS-1$
- public static final String CCEDIL_L = "ccedil"; //$NON-NLS-1$
- public static final String CEDIL = "cedil"; //$NON-NLS-1$
- public static final String CENT = "cent"; //$NON-NLS-1$
- public static final String CHI_U = "Chi"; //$NON-NLS-1$
- public static final String CHI_L = "chi"; //$NON-NLS-1$
- public static final String CIRC = "circ"; //$NON-NLS-1$
- public static final String CLUBS = "clubs"; //$NON-NLS-1$
- public static final String CONG = "cong"; //$NON-NLS-1$
- public static final String COPY = "copy"; //$NON-NLS-1$
- public static final String CRARR = "crarr"; //$NON-NLS-1$
- public static final String CUP = "cup"; //$NON-NLS-1$
- public static final String CURREN = "curren"; //$NON-NLS-1$
- public static final String DAGGER_U = "Dagger"; //$NON-NLS-1$
- public static final String DAGGER_L = "dagger"; //$NON-NLS-1$
- public static final String DARR_U = "dArr"; //$NON-NLS-1$
- public static final String DARR_L = "darr"; //$NON-NLS-1$
- public static final String DEG = "deg"; //$NON-NLS-1$
- public static final String DELTA_U = "Delta"; //$NON-NLS-1$
- public static final String DELTA_L = "delta"; //$NON-NLS-1$
- public static final String DIAMS = "diams"; //$NON-NLS-1$
- public static final String DIVIDE = "divide"; //$NON-NLS-1$
- public static final String EACUTE_U = "Eacute"; //$NON-NLS-1$
- public static final String EACUTE_L = "eacute"; //$NON-NLS-1$
- public static final String ECIRC_U = "Ecirc"; //$NON-NLS-1$
- public static final String ECIRC_L = "ecirc"; //$NON-NLS-1$
- public static final String EGRAVE_U = "Egrave"; //$NON-NLS-1$
- public static final String EGRAVE_L = "egrave"; //$NON-NLS-1$
- public static final String EMPTY = "empty"; //$NON-NLS-1$
- public static final String EMSP = "emsp"; //$NON-NLS-1$
- public static final String ENSP = "ensp"; //$NON-NLS-1$
- public static final String EPSILON_U = "Epsilon"; //$NON-NLS-1$
- public static final String EPSILON_L = "epsilon"; //$NON-NLS-1$
- public static final String EQUIV = "equiv"; //$NON-NLS-1$
- public static final String ETA_U = "Eta"; //$NON-NLS-1$
- public static final String ETA_L = "eta"; //$NON-NLS-1$
- public static final String ETH_U = "ETH"; //$NON-NLS-1$
- public static final String ETH_L = "eth"; //$NON-NLS-1$
- public static final String EUML_U = "Euml"; //$NON-NLS-1$
- public static final String EUML_L = "euml"; //$NON-NLS-1$
- public static final String EURO = "euro"; //$NON-NLS-1$
- public static final String EXIST = "exist"; //$NON-NLS-1$
- public static final String FNOF = "fnof"; //$NON-NLS-1$
- public static final String FORALL = "forall"; //$NON-NLS-1$
- public static final String FRAC12 = "frac12"; //$NON-NLS-1$
- public static final String FRAC14 = "frac14"; //$NON-NLS-1$
- public static final String FRAC34 = "frac34"; //$NON-NLS-1$
- public static final String FRASL = "frasl"; //$NON-NLS-1$
- public static final String GAMMA_U = "Gamma"; //$NON-NLS-1$
- public static final String GAMMA_L = "gamma"; //$NON-NLS-1$
- public static final String GE = "ge"; //$NON-NLS-1$
- public static final String GT = "gt"; //$NON-NLS-1$
- public static final String HARR_U = "hArr"; //$NON-NLS-1$
- public static final String HARR_L = "harr"; //$NON-NLS-1$
- public static final String HEARTS = "hearts"; //$NON-NLS-1$
- public static final String HELLIP = "hellip"; //$NON-NLS-1$
- public static final String IACUTE_U = "Iacute"; //$NON-NLS-1$
- public static final String IACUTE_L = "iacute"; //$NON-NLS-1$
- public static final String ICIRC_U = "Icirc"; //$NON-NLS-1$
- public static final String ICIRC_L = "icirc"; //$NON-NLS-1$
- public static final String IEXCL = "iexcl"; //$NON-NLS-1$
- public static final String IGRAVE_U = "Igrave"; //$NON-NLS-1$
- public static final String IGRAVE_L = "igrave"; //$NON-NLS-1$
- public static final String IMAGE = "image"; //$NON-NLS-1$
- public static final String INFIN = "infin"; //$NON-NLS-1$
- public static final String INT = "int"; //$NON-NLS-1$
- public static final String IOTA_U = "Iota"; //$NON-NLS-1$
- public static final String IOTA_L = "iota"; //$NON-NLS-1$
- public static final String IQUEST = "iquest"; //$NON-NLS-1$
- public static final String ISIN = "isin"; //$NON-NLS-1$
- public static final String IUML_U = "Iuml"; //$NON-NLS-1$
- public static final String IUML_L = "iuml"; //$NON-NLS-1$
- public static final String KAPPA_U = "Kappa"; //$NON-NLS-1$
- public static final String KAPPA_L = "kappa"; //$NON-NLS-1$
- public static final String LAMBDA_U = "Lambda"; //$NON-NLS-1$
- public static final String LAMBDA_L = "lambda"; //$NON-NLS-1$
- public static final String LANG = "lang"; //$NON-NLS-1$
- public static final String LAQUO = "laquo"; //$NON-NLS-1$
- public static final String LARR_U = "lArr"; //$NON-NLS-1$
- public static final String LARR_L = "larr"; //$NON-NLS-1$
- public static final String LCEIL = "lceil"; //$NON-NLS-1$
- public static final String LDQUO = "ldquo"; //$NON-NLS-1$
- public static final String LE = "le"; //$NON-NLS-1$
- public static final String LFLOOR = "lfloor"; //$NON-NLS-1$
- public static final String LOWAST = "lowast"; //$NON-NLS-1$
- public static final String LOZ = "loz"; //$NON-NLS-1$
- public static final String LRM = "lrm"; //$NON-NLS-1$
- public static final String LSAQUO = "lsaquo"; //$NON-NLS-1$
- public static final String LSQUO = "lsquo"; //$NON-NLS-1$
- public static final String LT = "lt"; //$NON-NLS-1$
- public static final String MACR = "macr"; //$NON-NLS-1$
- public static final String MDASH = "mdash"; //$NON-NLS-1$
- public static final String MICRO = "micro"; //$NON-NLS-1$
- public static final String MIDDOT = "middot"; //$NON-NLS-1$
- public static final String MINUS = "minus"; //$NON-NLS-1$
- public static final String MU_U = "Mu"; //$NON-NLS-1$
- public static final String MU_L = "mu"; //$NON-NLS-1$
- public static final String NABLA = "nabla"; //$NON-NLS-1$
- public static final String NBSP = "nbsp"; //$NON-NLS-1$
- public static final String NDASH = "ndash"; //$NON-NLS-1$
- public static final String NE = "ne"; //$NON-NLS-1$
- public static final String NI = "ni"; //$NON-NLS-1$
- public static final String NOT = "not"; //$NON-NLS-1$
- public static final String NOTIN = "notin"; //$NON-NLS-1$
- public static final String NSUB = "nsub"; //$NON-NLS-1$
- public static final String NTILDE_U = "Ntilde"; //$NON-NLS-1$
- public static final String NTILDE_L = "ntilde"; //$NON-NLS-1$
- public static final String NU_U = "Nu"; //$NON-NLS-1$
- public static final String NU_L = "nu"; //$NON-NLS-1$
- public static final String OACUTE_U = "Oacute"; //$NON-NLS-1$
- public static final String OACUTE_L = "oacute"; //$NON-NLS-1$
- public static final String OCIRC_U = "Ocirc"; //$NON-NLS-1$
- public static final String OCIRC_L = "ocirc"; //$NON-NLS-1$
- public static final String OELIG_U = "OElig"; //$NON-NLS-1$
- public static final String OELIG_L = "oelig"; //$NON-NLS-1$
- public static final String OGRAVE_U = "Ograve"; //$NON-NLS-1$
- public static final String OGRAVE_L = "ograve"; //$NON-NLS-1$
- public static final String OLINE = "oline"; //$NON-NLS-1$
- public static final String OMEGA_U = "Omega"; //$NON-NLS-1$
- public static final String OMEGA_L = "omega"; //$NON-NLS-1$
- public static final String OMICRON_U = "Omicron"; //$NON-NLS-1$
- public static final String OMICRON_L = "omicron"; //$NON-NLS-1$
- public static final String OPLUS = "oplus"; //$NON-NLS-1$
- public static final String OR = "or"; //$NON-NLS-1$
- public static final String ORDF = "ordf"; //$NON-NLS-1$
- public static final String ORDM = "ordm"; //$NON-NLS-1$
- public static final String OSLASH_U = "Oslash"; //$NON-NLS-1$
- public static final String OSLASH_L = "oslash"; //$NON-NLS-1$
- public static final String OTILDE_U = "Otilde"; //$NON-NLS-1$
- public static final String OTILDE_L = "otilde"; //$NON-NLS-1$
- public static final String OTIMES = "otimes"; //$NON-NLS-1$
- public static final String OUML_U = "Ouml"; //$NON-NLS-1$
- public static final String OUML_L = "ouml"; //$NON-NLS-1$
- public static final String PARA = "para"; //$NON-NLS-1$
- public static final String PART = "part"; //$NON-NLS-1$
- public static final String PERMIL = "permil"; //$NON-NLS-1$
- public static final String PERP = "perp"; //$NON-NLS-1$
- public static final String PHI_U = "Phi"; //$NON-NLS-1$
- public static final String PHI_L = "phi"; //$NON-NLS-1$
- public static final String PI_U = "Pi"; //$NON-NLS-1$
- public static final String PI_L = "pi"; //$NON-NLS-1$
- public static final String PIV = "piv"; //$NON-NLS-1$
- public static final String PLUSMN = "plusmn"; //$NON-NLS-1$
- public static final String POUND = "pound"; //$NON-NLS-1$
- public static final String PRIME_U = "Prime"; //$NON-NLS-1$
- public static final String PRIME_L = "prime"; //$NON-NLS-1$
- public static final String PROD = "prod"; //$NON-NLS-1$
- public static final String PROP = "prop"; //$NON-NLS-1$
- public static final String PSI_U = "Psi"; //$NON-NLS-1$
- public static final String PSI_L = "psi"; //$NON-NLS-1$
- public static final String QUOT = "quot"; //$NON-NLS-1$
- public static final String RADIC = "radic"; //$NON-NLS-1$
- public static final String RANG = "rang"; //$NON-NLS-1$
- public static final String RAQUO = "raquo"; //$NON-NLS-1$
- public static final String RARR_U = "rArr"; //$NON-NLS-1$
- public static final String RARR_L = "rarr"; //$NON-NLS-1$
- public static final String RCEIL = "rceil"; //$NON-NLS-1$
- public static final String RDQUO = "rdquo"; //$NON-NLS-1$
- public static final String REAL = "real"; //$NON-NLS-1$
- public static final String REG = "reg"; //$NON-NLS-1$
- public static final String RFLOOR = "rfloor"; //$NON-NLS-1$
- public static final String RHO_U = "Rho"; //$NON-NLS-1$
- public static final String RHO_L = "rho"; //$NON-NLS-1$
- public static final String RLM = "rlm"; //$NON-NLS-1$
- public static final String RSAQUO = "rsaquo"; //$NON-NLS-1$
- public static final String RSQUO = "rsquo"; //$NON-NLS-1$
- public static final String SBQUO = "sbquo"; //$NON-NLS-1$
- public static final String SCARON_U = "Scaron"; //$NON-NLS-1$
- public static final String SCARON_L = "scaron"; //$NON-NLS-1$
- public static final String SDOT = "sdot"; //$NON-NLS-1$
- public static final String SECT = "sect"; //$NON-NLS-1$
- public static final String SHY = "shy"; //$NON-NLS-1$
- public static final String SIGMA_U = "Sigma"; //$NON-NLS-1$
- public static final String SIGMA_L = "sigma"; //$NON-NLS-1$
- public static final String SIGMAF = "sigmaf"; //$NON-NLS-1$
- public static final String SIM = "sim"; //$NON-NLS-1$
- public static final String SPADES = "spades"; //$NON-NLS-1$
- public static final String SUB = "sub"; //$NON-NLS-1$
- public static final String SUBE = "sube"; //$NON-NLS-1$
- public static final String SUM = "sum"; //$NON-NLS-1$
- public static final String SUP = "sup"; //$NON-NLS-1$
- public static final String SUP1 = "sup1"; //$NON-NLS-1$
- public static final String SUP2 = "sup2"; //$NON-NLS-1$
- public static final String SUP3 = "sup3"; //$NON-NLS-1$
- public static final String SUPE = "supe"; //$NON-NLS-1$
- public static final String SZLIG = "szlig"; //$NON-NLS-1$
- public static final String TAU_U = "Tau"; //$NON-NLS-1$
- public static final String TAU_L = "tau"; //$NON-NLS-1$
- public static final String THERE4 = "there4"; //$NON-NLS-1$
- public static final String THETA_U = "Theta"; //$NON-NLS-1$
- public static final String THETA_L = "theta"; //$NON-NLS-1$
- public static final String THETASYM = "thetasym"; //$NON-NLS-1$
- public static final String THINSP = "thinsp"; //$NON-NLS-1$
- public static final String THORN_U = "THORN"; //$NON-NLS-1$
- public static final String THORN_L = "thorn"; //$NON-NLS-1$
- public static final String TILDE = "tilde"; //$NON-NLS-1$
- public static final String TIMES = "times"; //$NON-NLS-1$
- public static final String TRADE = "trade"; //$NON-NLS-1$
- public static final String UACUTE_U = "Uacute"; //$NON-NLS-1$
- public static final String UACUTE_L = "uacute"; //$NON-NLS-1$
- public static final String UARR_U = "uArr"; //$NON-NLS-1$
- public static final String UARR_L = "uarr"; //$NON-NLS-1$
- public static final String UCIRC_U = "Ucirc"; //$NON-NLS-1$
- public static final String UCIRC_L = "ucirc"; //$NON-NLS-1$
- public static final String UGRAVE_U = "Ugrave"; //$NON-NLS-1$
- public static final String UGRAVE_L = "ugrave"; //$NON-NLS-1$
- public static final String UML = "uml"; //$NON-NLS-1$
- public static final String UPSIH = "upsih"; //$NON-NLS-1$
- public static final String UPSILON_U = "Upsilon"; //$NON-NLS-1$
- public static final String UPSILON_L = "upsilon"; //$NON-NLS-1$
- public static final String UUML_U = "Uuml"; //$NON-NLS-1$
- public static final String UUML_L = "uuml"; //$NON-NLS-1$
- public static final String WEIERP = "weierp"; //$NON-NLS-1$
- public static final String XI_U = "Xi"; //$NON-NLS-1$
- public static final String XI_L = "xi"; //$NON-NLS-1$
- public static final String YACUTE_U = "Yacute"; //$NON-NLS-1$
- public static final String YACUTE_L = "yacute"; //$NON-NLS-1$
- public static final String YEN = "yen"; //$NON-NLS-1$
- public static final String YUML_U = "Yuml"; //$NON-NLS-1$
- public static final String YUML_L = "yuml"; //$NON-NLS-1$
- public static final String ZETA_U = "Zeta"; //$NON-NLS-1$
- public static final String ZETA_L = "zeta"; //$NON-NLS-1$
- public static final String ZWJ = "zwj"; //$NON-NLS-1$
- public static final String ZWNJ = "zwnj"; //$NON-NLS-1$
- }
-
- public static final String HTML40_URI = "http://www.w3.org/TR/REC-html40/frameset.dtd"; //$NON-NLS-1$
- public static final String HTML40_TAG_PREFIX = ""; //$NON-NLS-1$
- // global attribute names
- public static final String ATTR_NAME_ID = "id"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_STYLE = "style"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_TITLE = "title"; // %coreattrs; //$NON-NLS-1$
- public static final String ATTR_NAME_LANG = "lang"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_DIR = "dir"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_ONCLICK = "onclick"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONDBLCLICK = "ondblclick"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEDOWN = "onmousedown"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEUP = "onmouseup"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOVER = "onmouseover"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEMOVE = "onmousemove"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOUT = "onmouseout"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYPRESS = "onkeypress"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYDOWN = "onkeydown"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYUP = "onkeyup"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_ONHELP = "onhelp"; // %events; //$NON-NLS-1$
- public static final String ATTR_NAME_BGCOLOR = "bgcolor"; // %bodycolor;, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_TEXT = "text"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_LINK = "link"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_VLINK = "vlink"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_ALINK = "alink"; // %bodycolor; //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; // HTML //$NON-NLS-1$
- public static final String ATTR_NAME_PROFILE = "profile"; // HEAD //$NON-NLS-1$
- public static final String ATTR_NAME_ONLOAD = "onload"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_ONUNLOAD = "onunload"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BACKGROUND = "background"; // BODY, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_SRC = "src"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALT = "alt"; // IMG,AREA //$NON-NLS-1$
- public static final String ATTR_NAME_LONGDESC = "longdesc"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_NAME = "name"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; // IMG, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; // IMG, TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_USEMAP = "usemap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ISMAP = "ismap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; // IMG, TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_BORDER = "border"; // IMG, TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_MAPFILE = "mapfile"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_SUMMARY = "summary"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_FRAME = "frame"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_RULES = "rules"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_CELLSPACING = "cellspacing"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_CELLPADDING = "cellpadding"; // TABLE //$NON-NLS-1$
- public static final String ATTR_NAME_DATAPAGESIZE = "datapagesize"; // TABLE,HR //$NON-NLS-1$
- public static final String ATTR_NAME_COLOR = "color"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_FACE = "face"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_SIZE = "size"; // BASEFONT,FONT //$NON-NLS-1$
- public static final String ATTR_NAME_CLEAR = "clear"; // BR //$NON-NLS-1$
- public static final String ATTR_NAME_SHAPE = "shape"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_COORDS = "coords"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_HREF = "href"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TARGET = "target"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_NOHREF = "nohref"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TABINDEX = "tabindex"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ACCESSKEY = "accesskey"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ONFOCUS = "onfocus"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_ONBLUR = "onblur"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_CHARSET = "charset"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_HREFLANG = "hreflang"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REL = "rel"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REV = "rev"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_MEDIA = "media"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; // PARAM //$NON-NLS-1$
- public static final String ATTR_NAME_VALUETYPE = "valuetype"; // PARAM //$NON-NLS-1$
- public static final String ATTR_NAME_NOSHADE = "noshade"; // HR //$NON-NLS-1$
- public static final String ATTR_NAME_CHECKED = "checked"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_DISABLED = "disabled"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_READONLY = "readonly"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_MAXLENGTH = "maxlength"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ONSELECT = "onselect"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ONCHANGE = "onchange"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT = "accept"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_ISTYLE = "istyle"; // INPUT //$NON-NLS-1$
- public static final String ATTR_NAME_CHAR = "char"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_CHAROFF = "charoff"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_VALIGN = "valign"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_SPAN = "span"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_FRAMEBORDER = "frameborder"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINWIDTH = "marginwidth"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINHEIGHT = "marginheight"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_NORESIZE = "noresize"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLING = "scrolling"; // FRAME //$NON-NLS-1$
- public static final String ATTR_NAME_PROMPT = "prompt"; // ISINDEX //$NON-NLS-1$
- public static final String ATTR_NAME_HTTP_EQUIV = "http-equiv"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT = "content"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_SCHEME = "scheme"; // META //$NON-NLS-1$
- public static final String ATTR_NAME_ERRMSG = "errmsg"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_SIZEFMT = "sizefmt"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_TIMEFMT = "timefmt"; // ssi:config //$NON-NLS-1$
- public static final String ATTR_NAME_VAR = "var"; // ssi:echo //$NON-NLS-1$
- public static final String ATTR_NAME_CGI = "cgi"; // ssi:exec //$NON-NLS-1$
- public static final String ATTR_NAME_CMD = "cmd"; // ssi:exec //$NON-NLS-1$
- public static final String ATTR_NAME_FILE = "file"; // ssi:fsize //$NON-NLS-1$
- public static final String ATTR_NAME_VIRTUAL = "virtual"; // ssi:fsize //$NON-NLS-1$
- public static final String ATTR_NAME_SELECTED = "selected"; // OPTION //$NON-NLS-1$
- public static final String ATTR_NAME_LABEL = "label"; // OPTION //$NON-NLS-1$
- public static final String ATTR_NAME_ROWS = "rows"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_NAME_COLS = "cols"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_NAME_LANGUAGE = "language"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_DEFER = "defer"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_EVENT = "event"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_FOR = "for"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_COMPACT = "compact"; // OL/UL //$NON-NLS-1$
- public static final String ATTR_NAME_START = "start"; // OL/UL //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTKEY = "directkey"; // A //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_CODE = "code"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_OBJECT = "object"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_MAYSCRIPT = "mayscript"; // APPLET //$NON-NLS-1$
- public static final String ATTR_NAME_CITE = "cite"; // BLOCKQUOTE //$NON-NLS-1$
- public static final String ATTR_NAME_MACRO = "macro"; // D2W //$NON-NLS-1$
- public static final String ATTR_NAME_DATETIME = "datetime"; // INS/DEL //$NON-NLS-1$
- public static final String ATTR_NAME_LOOP = "loop"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_HIDDEN = "hidden"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_VOLUME = "volume"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSTART = "autostart"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOPLAY = "autoplay"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSIZE = "autosize"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_CONTROLLER = "controller";// EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_SCALE = "scale"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_SHOWCONTROLS = "showcontrols";// EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PLAYCOUNT = "playcount"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_REPEAT = "repeat"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PANEL = "panel"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_PALETTE = "palette"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_TEXTFOCUS = "textfocus"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_ACTION = "action"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_METHOD = "method"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ENCTYPE = "enctype"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ONSUBMIT = "onsubmit"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ONRESET = "onreset"; // FORM //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT_CHARSET = "accept-charset";// FORM //$NON-NLS-1$
- public static final String ATTR_NAME_BEHAVIOR = "behavior"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTION = "direction"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLAMOUNT = "scrollamount";// MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLDELAY = "scrolldelay";// MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_TRUESPEED = "truespeed"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_NAME_DECLARE = "declare"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_CLASSID = "classid"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_DATA = "data"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_CODETYPE = "codetype"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_STANDBY = "standby"; // OBJECT //$NON-NLS-1$
- public static final String ATTR_NAME_MULTIPLE = "multiple"; // SELECT //$NON-NLS-1$
- public static final String ATTR_NAME_ABBR = "abbr"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_AXIS = "axis"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_HEADERS = "headers"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_ROWSPAN = "rowspan"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_COLSPAN = "colspan"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_NOWRAP = "nowrap"; // TH/TD //$NON-NLS-1$
- // <<D205514
- public static final String ATTR_NAME_TOPMARGIN = "topmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BOTTOMMARGIN = "bottommargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_LEFTMARGIN = "leftmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_RIGHTMARGIN = "rightmargin"; // BODY //$NON-NLS-1$
- public static final String ATTR_NAME_BORDERCOLOR = "bordercolor"; // TABLE/TR/TH/TD/FRAMESET/FRAME //$NON-NLS-1$
- // for WML
- public static final String WML_ATTR_NAME_TITLE = "title"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_DOMAIN = "domain"; // access //$NON-NLS-1$
- public static final String WML_ATTR_NAME_PATH = "path"; // access //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERFORWARD = "onenterforward"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERBACKWARD = "onenterbackward"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONPICK = "onpick"; // option //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONTIMER = "ontimer"; // template,card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_NEWCONTEXT = "newcontext"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ORDERED = "ordered"; // card //$NON-NLS-1$
- public static final String WML_ATTR_NAME_OPTIONAL = "optional"; // do //$NON-NLS-1$
- public static final String WML_ATTR_NAME_CACHE_CONTROL = "cache-control"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_SENDREFERER = "sendreferer"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_METHOD = "method"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ENCTYPE = "enctype"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ACCEPT_CHARSET = "accept-charset"; // go //$NON-NLS-1$
- public static final String WML_ATTR_NAME_COLUMNS = "columns"; // table //$NON-NLS-1$
- // D205514
- //<<D215684
- public static final String ATTR_NAME_FRAMESPACING = "framespacing"; // FRAMESET //$NON-NLS-1$
- //D215684
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD HTML 4.01 Transitional//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_VERSION_FRAMESET = "-//W3C//DTD HTML 4.01 Frameset//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LTR = "ltr"; // dir //$NON-NLS-1$
- public static final String ATTR_VALUE_RTL = "rtl"; // dir //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = "top"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_CENTER = "center"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_JUSTIFY = "justify"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_CHAR = "char"; // align //$NON-NLS-1$
- // for valign (baseline)
- public static final String ATTR_VALUE_BASELINE = "baseline"; // valign //$NON-NLS-1$
- // for clear (left|all|right|none): left and right are already defined above.
- public static final String ATTR_VALUE_ALL = "all"; // clear //$NON-NLS-1$
- public static final String ATTR_VALUE_NONE = "none"; // clear //$NON-NLS-1$
- // for shape (rect|circle|poly|default)
- public static final String ATTR_VALUE_RECT = "rect"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_CIRCLE = "circle"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_POLY = "poly"; // shape //$NON-NLS-1$
- public static final String ATTR_VALUE_DEFAULT = "default"; // shape //$NON-NLS-1$
- // for valuetype (data|ref|object)
- public static final String ATTR_VALUE_DATA = "data"; // valuetype //$NON-NLS-1$
- public static final String ATTR_VALUE_REF = "ref"; // valuetype //$NON-NLS-1$
- public static final String ATTR_VALUE_OBJECT = "object"; // valuetype //$NON-NLS-1$
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = "text"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_PASSWORD = "password"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_CHECKBOX = "checkbox"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_RADIO = "radio"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_SUBMIT = "submit"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_RESET = "reset"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_FILE = "file"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_HIDDEN = "hidden"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_IMAGE = "image"; // INPUT:type //$NON-NLS-1$
- public static final String ATTR_VALUE_BUTTON = "button"; // INPUT:type //$NON-NLS-1$
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = "1"; // span //$NON-NLS-1$
- // for frameborder
- public static final String ATTR_VALUE_0 = "0"; // FRAME //$NON-NLS-1$
- // for scrolling
- public static final String ATTR_VALUE_YES = "yes"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_NO = "no"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_AUTO = "auto"; // FRAME //$NON-NLS-1$
- // for UL
- public static final String ATTR_VALUE_DISC = "disc"; // UL:type //$NON-NLS-1$
- public static final String ATTR_VALUE_SQUARE = "square"; // UL:type //$NON-NLS-1$
- // for frame of TABLE
- public static final String ATTR_VALUE_VOID = "void"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_ABOVE = "above"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BELOW = "below"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_HSIDES = "hsides"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_LHS = "lhs"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_RHS = "rhs"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_VSIDES = "vsides"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BOX = "box"; // TABLE:frame //$NON-NLS-1$
- public static final String ATTR_VALUE_BORDER = "border"; // TABLE:frame //$NON-NLS-1$
- // for rules of TABLE
- public static final String ATTR_VALUE_GROUPS = "groups"; // TABLE:rules //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWS = "rows"; // TEXTAREA //$NON-NLS-1$
- public static final String ATTR_VALUE_COLS = "cols"; // TEXTAREA //$NON-NLS-1$
- // for method of FORM
- public static final String ATTR_VALUE_GET = "get"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_POST = "post"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
- // for scope of (TH | TD)
- public static final String ATTR_VALUE_ROW = "row"; // (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_COL = "col"; // (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWGROUP = "rowgroup";// (TH|TD):scope //$NON-NLS-1$
- public static final String ATTR_VALUE_COLGROUP = "colgroup";// (TH|TD):scope //$NON-NLS-1$
- // for auto?? of EMBED
- public static final String ATTR_VALUE_TRUE = "true"; // EMBED //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; // EMBED //$NON-NLS-1$
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = "scroll"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_SLIDE = "slide"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_ALTERNATE = "alternate"; // MARQUEE //$NON-NLS-1$
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = "up"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_DOWN = "down"; // MARQUEE //$NON-NLS-1$
- // for type of LI (D19924)
- public static final String ATTR_VALUE_NUMBER = "1"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ALPHA = "a"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_UPPER_ALPHA = "A"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ROMAN = "i"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_UPPER_ROMAN = "I"; // LI //$NON-NLS-1$
- // for loop of BGSOUND (D205513)
- public static final String ATTR_VALUE_INFINITE = "infinite"; // BGSOUND //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
deleted file mode 100644
index 5a6dd23e76..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
+++ /dev/null
@@ -1,167 +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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.<br>
-*
-*/
-public interface IJsTranslation {
-
- /**
- * @return IJavaScriptProject that this translation belongs to
- */
- public IJavaScriptProject getJavaProject();
-
- /**
- * @return Original HTML document from the translation.
- */
- public IDocument getHtmlDocument();
-
- /**
- * @return integer position of a missing </script> tag (the document isn't well formed and resulted in translation error.).
- *
- */
- public int getMissingTagStart();
-
- /**
- * @param javaPositionStart
- * @param javaPositionEnd
- * @return all javascript elements within the given range
- */
- public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd);
-
- /**
- * @return the javascript unit from the jsdt.core
- */
- public IJavaScriptUnit getCompilationUnit();
-
- /**
- * @param javaPositionStart
- * @param javaPositionEnd
- * @return
- */
- public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd);
-
- /**
- * @return string of the document.
- */
- public String getHtmlText();
-
- /**
- * @param jsOffset
- * @return a single javascript element at the given offset.
- */
- public IJavaScriptElement getJsElementAtOffset(int jsOffset);
-
- /**
- * @return only the translated javascript text
- */
- public String getJsText();
-
- /**
- * @return a list of the script regions within the translation.
- */
- public Position[] getScriptPositions();
-
- /**
- * @param text
- */
- public void insertInFirstScriptRegion(String text);
-
- /**
- * insert javascript at the given offset. method should ensure the documents well-formedness and proper script region.
- *
- * @param offset
- * @param text
- */
- public void insertScript(int offset, String text);
-
- /**
- * @return a list of javascript errors
- */
- public List getProblems();
-
- /**
- * @param offset
- * @return if the offset is within a script import node.
- */
- public boolean ifOffsetInImportNode(int offset);
-
- /**
- * checks the CU for errors/consistancy.
- */
- public void reconcileCompilationUnit();
-
- /**
- * release the translation. always a good idea to do when you're done. you may notice document and model locks if not.
- */
- public void release();
-
- /**
- * fixes a mangled html--> pure js name.
- * @param displayString
- * @return
- */
- public String fixupMangledName(String displayString);
-
- /**
- * start/stop collecting problems within the javascript unit.
- * @param collect
- */
- public void setProblemCollectingActive(boolean collect);
-
- /**
- * @return
- */
- public String getJavaPath();
-
- /**
- *
- *
- * @param htmlDocument
- * @param javaProj
- * @param listenForChanges
- * @return
- */
- public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) ;
-
- /**
- * notify the translation to update any external dependancies that are created during translation
- *
- */
- public void classpathChange() ;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
deleted file mode 100644
index 8726cab020..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
+++ /dev/null
@@ -1,100 +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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IJsTranslator extends IDocumentListener{
-
- /**
- * @return string of javascript from the document
- */
- public String getJsText();
-
- /**
- * sets the javascript unit buffer
- * @param buffer
- */
- public void setBuffer(IBuffer buffer);
-
- /**
- *
- * @return a list of html locations within the docuemnt.
- */
- public Position[] getHtmlLocations();
-
- /**
- * @return the region of a missing </script> tag
- */
- public int getMissingEndTagRegionStart();
-
- /**
- * @return position array of <script src=".."> within the doc.
- */
- public Position[] getImportHtmlRanges();
-
- /**
- * @return raw/unresolved <script imports>
- */
- public String[] getRawImports();
-
- /**
- * begin translating the document.
- */
- public void translate();
-
- /**
- * translates an inline (event="..") js container region and adds it to the document text. must be called in order
- * @param container
- */
- public void translateInlineJSNode(IStructuredDocumentRegion container);
-
- /**
- * translates a script block. must be called in the order it appears within the document.
- * @param container
- */
- public void translateJSNode(IStructuredDocumentRegion container);
-
- /**
- * translates a <script src=".."> element, parsing out an import.
- * @param region
- */
- public void translateScriptImportNode(IStructuredDocumentRegion region);
-
- /**
- * release any resources the translation is holding onto.
- *
- */
- public void release();
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
deleted file mode 100644
index 8bd2ae1810..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
+++ /dev/null
@@ -1,47 +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.wst.jsdt.web.core.javascript;
-
-
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface JsDataTypes extends HTML40Namespace {
- /*
- * remove when when we refactor (need to add this content type to many
- * project types in wst)
- */
- public static final String BASE_FILE_EXTENSION = ".js"; //$NON-NLS-1$
- public static String[] CONSTANTS = { "false", "null", "true" }; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- public static final String[] EVENTS = { HTML40Namespace.ATTR_NAME_ONCLICK, HTML40Namespace.ATTR_NAME_ONDBLCLICK, HTML40Namespace.ATTR_NAME_ONMOUSEDOWN,
- HTML40Namespace.ATTR_NAME_ONMOUSEUP, HTML40Namespace.ATTR_NAME_ONMOUSEOVER, HTML40Namespace.ATTR_NAME_ONMOUSEMOVE,
- HTML40Namespace.ATTR_NAME_ONMOUSEOUT, HTML40Namespace.ATTR_NAME_ONKEYPRESS, HTML40Namespace.ATTR_NAME_ONKEYDOWN, HTML40Namespace.ATTR_NAME_ONKEYUP,
- HTML40Namespace.ATTR_NAME_ONHELP };
- public static final String[] HTMLATREVENTS = { "onload ", "onunload", "onclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
- "onfocus", "onblur", "onkeypress", "onkeydown", "onkeyup", "onsubmit", "onreset", "onselect", "onchange", }; //$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$
- public static final String[] JSVALIDDATATYPES = { "JAVASCRIPT", "TEXT/JAVASCRIPT" }; //$NON-NLS-1$ //$NON-NLS-2$
- public static String[] KEYWORDS = { "abstract", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", //$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$ //$NON-NLS-11$ //$NON-NLS-12$
- "enum", "export", "extends", "final", "finally", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "interface", //$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$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ //$NON-NLS-14$
- "native", "new", "package", "private", "protected", "public", "return", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "typeof", "volatile", "while", "with" }; //$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$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$
- // public static final String
- // NEW_PARTITION_TYPE="org.eclipse.wst.jsdt.StructuredJs";
- // public static final String NEW_PARTITION_TYPE=IHTMLPartitions.SCRIPT;
- public static final String NEW_PARTITION_TYPE = IHTMLPartitions.SCRIPT;
- public static final String[] TAKEOVER_PARTITION_TYPES = { "none" }; //$NON-NLS-1$
- public static String[] TYPES = { "boolean", "byte", "char", "double", "int", "long", "short", "float", "var", "void" }; //$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$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
deleted file mode 100644
index 40cee8f84f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
+++ /dev/null
@@ -1,135 +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.jsdt.web.core.javascript;
-
-import java.io.File;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsNameManglerUtil {
- /**
- * Determine if given string is a valid Hex representation of an ASCII
- * character (eg. 2F -> /)
- *
- * @param possible
- * @return
- */
- private static boolean isValid(String possible) {
- boolean result = false;
- if (possible.length() == 2) {
- char c1 = possible.charAt(0);
- char c2 = possible.charAt(1);
- // 1st character must be a digit
- if (Character.isDigit(c1)) {
- // 2nd character must be digit or upper case letter A-F
- if (Character.isDigit(c2)) {
- result = true;
- } else if (Character.isUpperCase(c2) && (c2 == 'A' || c2 == 'B' || c2 == 'C' || c2 == 'D' || c2 == 'E' || c2 == 'F')) {
- result = true;
- }
- }
- }
- return result;
- }
-
- /**
- * Mangle string to WAS-like specifications
- *
- */
- public final static String mangle(String name) {
- StringBuffer modifiedName = new StringBuffer();
- // extension (.jsp, .jspf, .jspx, etc...) should already be encoded in
- // name
- int length = name.length();
- // in case name is forbidden (a number, class, for, etc...)
- modifiedName.append('_');
- // ensure rest of characters are valid
- for (int i = 0; i < length; i++) {
- char currentChar = name.charAt(i);
- if (Character.isJavaIdentifierPart(currentChar) == true) {
- modifiedName.append(currentChar);
- } else {
- modifiedName.append(JsNameManglerUtil.mangleChar(currentChar));
- }
- }
- return modifiedName.toString();
- }
-
- /**
- * take a character and return its hex equivalent
- */
- private final static String mangleChar(char ch) {
- if (ch == File.separatorChar) {
- ch = '/';
- }
- if (Character.isLetterOrDigit(ch) == true) {
- return "" + ch; //$NON-NLS-1$
- }
- return "_" + Integer.toHexString(ch).toUpperCase() + "_"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * WAS mangles Tom&Jerry as: _Tom_26_Jerry; this takes in the mangled name
- * and returns the original name.
- *
- * Unmangles the qualified type name. If an underscore is found it is
- * assumed to be a mangled representation of a non-alpha, non-digit
- * character of the form _NN_, where NN are hex digits representing the
- * encoded character. This routine converts it back to the original
- * character.
- */
- public final static String unmangle(String qualifiedTypeName) {
- if (qualifiedTypeName.charAt(0) != '_') {
- return qualifiedTypeName;
- }
- StringBuffer buf = new StringBuffer();
- String possible = ""; //$NON-NLS-1$
- // remove the .java extension if there is one
- if (qualifiedTypeName.endsWith(".js")) { //$NON-NLS-1$
- qualifiedTypeName = qualifiedTypeName.substring(0, qualifiedTypeName.length() - 3);
- }
- for (int i = 1; i < qualifiedTypeName.length(); i++) { // start at
- // index 1 b/c
- // 1st char is
- // always '_'
- char c = qualifiedTypeName.charAt(i);
- if (c == '_') {
- int endIndex = qualifiedTypeName.indexOf('_', i + 1);
- if (endIndex == -1) {
- buf.append(c);
- } else {
- char unmangled;
- try {
- possible = qualifiedTypeName.substring(i + 1, endIndex);
- if (JsNameManglerUtil.isValid(possible)) {
- unmangled = (char) Integer.decode("0x" + possible).intValue();//$NON-NLS-1$
- i = endIndex;
- } else {
- unmangled = c;
- }
- } catch (NumberFormatException e) {
- unmangled = c;
- }
- buf.append(unmangled);
- }
- } else {
- buf.append(c);
- }
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
deleted file mode 100644
index ac94dd07e8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.core.javascript;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.IProblemRequestor;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-
-class JsProblemRequestor implements IProblemRequestor {
- private List fCollectedProblems;
- private boolean fIsActive = false;
- private boolean fIsRunning = false;
-
- public void acceptProblem(IProblem problem) {
- if (isActive()) {
- getCollectedProblems().add(problem);
- }
- }
-
- public void beginReporting() {
- fIsRunning = true;
- }
-
- public void endReporting() {
- fIsRunning = false;
- }
-
- /**
- * @return the list of collected problems
- */
- public List getCollectedProblems() {
- if (fCollectedProblems == null)
- fCollectedProblems = new ArrayList();
- return fCollectedProblems;
- }
-
- public boolean isActive() {
- return fIsActive;
- }
-
- public boolean isRunning() {
- return fIsRunning;
- }
-
- /**
- * Sets the active state of this problem requestor.
- *
- * @param isActive
- * the state of this problem requestor
- */
- public void setIsActive(boolean isActive) {
- fIsActive = isActive;
- }
-
- /**
- * Tells this annotation model to collect temporary problems from now on.
- */
- private void startCollectingProblems() {
- getCollectedProblems().clear();
- }
-
- /**
- * Tells this annotation model to no longer collect temporary problems.
- */
- private void stopCollectingProblems() {
- // do nothing
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
deleted file mode 100644
index 060769e6a9..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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
- * bug:244839 - eugene@genuitec.com
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.internal.core.DocumentContextFragmentRoot;
-import org.eclipse.wst.jsdt.internal.core.Member;
-import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsTranslation implements IJsTranslation {
-
- private static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private IJavaScriptUnit fCompilationUnit = null;
- private DocumentContextFragmentRoot fDocumentScope;
- private IJavaScriptProject fJavaProject = null;
- private byte[] fLock = null;
- private IProgressMonitor fProgressMonitor = null;
- protected IStructuredDocument fHtmlDocument;
- protected String fModelBaseLocation;
-
-
-// private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
-// private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
-
- protected IJsTranslator fTranslator;
-
- private String mangledName;
- protected boolean listenForChanges;
-
- public JsTranslation() {
- /* do nothing */
- }
-
- public IJsTranslator getTranslator() {
- if(fTranslator!=null) {
- return fTranslator;
- }
-
- fTranslator = new JsTranslator(fHtmlDocument, fModelBaseLocation, listenForChanges);
- return this.fTranslator;
- }
-
-
-
- protected JsTranslation(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
- fLock = new byte[0];
- fJavaProject = javaProj;
- fHtmlDocument = htmlDocument;
- setBaseLocation();
- mangledName = createMangledName();
- this.listenForChanges=listenForChanges;
- }
-
- public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
- return new JsTranslation(htmlDocument,javaProj, listenForChanges);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJavaProject()
- */
- public IJavaScriptProject getJavaProject() {
- return fJavaProject;
- }
-
- private IPackageFragmentRoot getDocScope(boolean reset) {
- if (fDocumentScope == null) {
- // IProject project = getJavaProject().getProject();
- // IResource absoluteRoot =
- // ((IContainer)getJavaProject().getResource()).findMember(
- // WebRootFinder.getWebContentFolder(fJavaProject.getProject()));
- fDocumentScope = new DocumentContextFragmentRoot(fJavaProject, getFile(), WebRootFinder.getWebContentFolder(fJavaProject.getProject()), WebRootFinder.getServerContextRoot(fJavaProject.getProject()), JsWebNature.VIRTUAL_SCOPE_ENTRY);
- fDocumentScope.setIncludedFiles(getTranslator().getRawImports());
- return fDocumentScope;
- }
-
- if (reset)
- fDocumentScope.setIncludedFiles(getTranslator().getRawImports());
- return fDocumentScope;
- }
-
- private void setBaseLocation() {
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fHtmlDocument);
- if (xmlModel == null) {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(fHtmlDocument);
- }
- fModelBaseLocation = xmlModel.getBaseLocation();
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
- // return xmlModel;
- }
-
- public IFile getFile() {
- return FileBuffers.getWorkspaceFileAtLocation(new Path(fModelBaseLocation));
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getHtmlDocument()
- */
- public IDocument getHtmlDocument() {
- return fHtmlDocument;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getMissingTagStart()
- */
- public int getMissingTagStart() {
- return getTranslator().getMissingEndTagRegionStart();
- }
-
- private IPath getWebRoot() {
- return WebRootFinder.getWebContentFolder(fJavaProject.getProject());
- }
-
-
- public String getDirectoryUnderRoot() {
- IPath webRoot = getWebRoot();
- IPath projectWebRootPath = getJavaProject().getPath().append(webRoot);
- IPath filePath = new Path(fModelBaseLocation).removeLastSegments(1);
- return filePath.removeFirstSegments(projectWebRootPath.matchingFirstSegments(filePath)).toString();
- }
-
- /**
- * Originally from ReconcileStepForJava. Creates an IJavaScriptUnit from
- * the contents of the JSP document.
- *
- * @return an IJavaScriptUnit from the contents of the JSP document
- */
- private IJavaScriptUnit createCompilationUnit() throws JavaScriptModelException {
- IPackageFragmentRoot root = getDocScope(true);
- IJavaScriptUnit cu = root.getPackageFragment("").getJavaScriptUnit(getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor()); //$NON-NLS-1$
- IBuffer buffer;
- try {
- buffer = cu.getBuffer();
- }
- catch (JavaScriptModelException e) {
- e.printStackTrace();
- buffer = null;
- }
- if (buffer != null) {
- getTranslator().setBuffer(buffer);
- }
- return cu;
- }
-
- public String fixupMangledName(String displayString) {
- if (displayString == null) {
- return null;
- }
- return displayString.replaceAll(getMangledName() + ".js", getHtmlPageName()); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getAllElementsInJsRange(int, int)
- */
- public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd) {
- IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
- IJavaScriptElement[] result = EMTPY_RESULT_SET;
- IJavaScriptElement[] allChildren = null;
- try {
- allChildren = getCompilationUnit().getChildren();
- }
- catch (JavaScriptModelException e) {
- }
- Vector validChildren = new Vector();
- for (int i = 0; i < allChildren.length; i++) {
- ISourceRange range = getJSSourceRangeOf(allChildren[i]);
- if (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd)) {
- validChildren.add(allChildren[i]);
- }
- else if (allChildren[i].getElementType() == IJavaScriptElement.TYPE) {
- validChildren.add(allChildren[i]);
- }
- }
- if (validChildren.size() > 0) {
- result = (IJavaScriptElement[]) validChildren.toArray(new IJavaScriptElement[]{});
- }
- if (result == null || result.length == 0) {
- return EMTPY_RESULT_SET;
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getCompilationUnit()
- */
- public IJavaScriptUnit getCompilationUnit() {
- // Genuitec Begin Fix 6149: Exception opening external HTML file
- if (!getJavaProject().exists()) {
- return null;
- }
- // Genuitec End Fix 6149: Exception opening external HTML file
- synchronized (fLock) {
- try {
- if (fCompilationUnit == null) {
- fCompilationUnit = createCompilationUnit();
- return fCompilationUnit;
- }
-
- }
- catch (JavaScriptModelException jme) {
- if (JsTranslation.DEBUG) {
- Logger.logException("error creating JSP working copy... ", jme); //$NON-NLS-1$
- }
- }
-
- }
- getDocScope(true);
- try {
- fCompilationUnit = fCompilationUnit.getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor());
- // fCompilationUnit.makeConsistent(getProgressMonitor());
- }
- catch (JavaScriptModelException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- }
- return fCompilationUnit;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getElementsFromJsRange(int, int)
- */
- public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd) {
- IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
- IJavaScriptElement[] result = EMTPY_RESULT_SET;
- try {
- IJavaScriptUnit cu = getCompilationUnit();
- if (cu != null) {
- synchronized (fLock) {
- int cuDocLength = cu.getBuffer().getLength();
- int javaLength = javaPositionEnd - javaPositionStart;
- if (cuDocLength > 0 && javaPositionStart >= 0 && javaLength >= 0 && javaPositionEnd <= cuDocLength) {
- result = cu.codeSelect(javaPositionStart, javaLength, getWorkingCopyOwner());
- }
- }
- }
- if (result == null || result.length == 0) {
- return EMTPY_RESULT_SET;
- }
- }
- catch (JavaScriptModelException x) {
- Logger.logException(x);
- }
- return result;
- }
-
- private String getHtmlPageName() {
- IPath path = new Path(fModelBaseLocation);
- return path.lastSegment();
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getHtmlText()
- */
- public String getHtmlText() {
- return fHtmlDocument.get();
- }
-
- public String getJavaPath() {
- IPath rootPath = new Path(fModelBaseLocation).removeLastSegments(1);
- String cuPath = rootPath.append("/" + getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).toString(); //$NON-NLS-1$
- return cuPath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJsElementAtOffset(int)
- */
- public IJavaScriptElement getJsElementAtOffset(int jsOffset) {
- IJavaScriptElement elements = null;
- try {
- elements = getCompilationUnit().getElementAt(jsOffset);
- }
- catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- if (JsTranslation.DEBUG) {
- Logger.logException("error retrieving java elemtnt from compilation unit... ", e); //$NON-NLS-1$
- }
- // }
- }
- return elements;
- }
-
- private ISourceRange getJSSourceRangeOf(IJavaScriptElement element) {
- // returns the offset in html of given element
- ISourceRange range = null;
- if (element instanceof Member) {
- try {
- range = ((Member) element).getNameRange();
- } catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }else if (element instanceof SourceRefElement) {
- try {
- range = ((SourceRefElement) element).getSourceRange();
- }
- catch (JavaScriptModelException e) {
- e.printStackTrace();
- }
- }
- return range;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJsText()
- */
- public String getJsText() {
- return getTranslator().getJsText();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getScriptPositions()
- */
- public Position[] getScriptPositions() {
- return getTranslator().getHtmlLocations();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#insertInFirstScriptRegion(java.lang.String)
- */
- public void insertInFirstScriptRegion(String text) {
- Position pos[] = getScriptPositions();
- int scriptStartOffset = 0;
- if(pos!=null && pos.length>0) {
- scriptStartOffset = pos[0].getOffset();
-
- }
- String insertText = (scriptStartOffset==0?"":"\n") + text;
- insertScript(scriptStartOffset,insertText);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#insertScript(int, java.lang.String)
- */
- public void insertScript(int offset, String text) {
-
- IDOMModel xmlModel = null;
- Position[] inHtml = getScriptPositions();
- boolean isInsideExistingScriptRegion = false;
- for (int i = 0; i < inHtml.length; i++) {
- if (inHtml[i].overlapsWith(offset, 1)) {
- // * inserting into a script region
- isInsideExistingScriptRegion = true;
- }
- }
-
- String insertText = null;
-
- if (isInsideExistingScriptRegion) {
- insertText = text;
- }
- else {
- insertText = offset != 0 ? "\n" : "" + "<script type=\"text/javascript\">\n" + text + "\n</script>\n";
- }
- // translator.documentAboutToBeChanged(null);
-
- synchronized (fLock) {
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(fHtmlDocument);
- if (xmlModel == null) {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(fHtmlDocument);
- }
- if (xmlModel != null) {
-
-
- xmlModel.aboutToChangeModel();
- xmlModel.getDocument().getStructuredDocument().replaceText(this, offset, 0, insertText);
- xmlModel.changedModel();
- try {
- xmlModel.save();
- }
-
- catch (UnsupportedEncodingException e) {}
- catch (IOException e) {}
- catch (CoreException e) {}
- }
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromEdit();
- }
- }
-
- // translator.documentChanged(null);
-
- }
-
- public String getMangledName() {
- return this.mangledName;
- }
-
- private String createMangledName() {
- return JsNameManglerUtil.mangle(fModelBaseLocation);
- }
-
- /**
- *
- * @return the problem requestor for the JavaScriptUnit in this
- * JsTranslation
- */
- private JsProblemRequestor getProblemRequestor() {
- return CompilationUnitHelper.getInstance().getProblemRequestor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getProblems()
- */
- public List getProblems() {
- List problemList = getProblemRequestor().getCollectedProblems();
- getProblemRequestor().endReporting();
- IProblem[] problems = null;
- if (problemList == null)
- problems = new IProblem[0];
- else
- problems = (IProblem[]) problemList.toArray(new IProblem[problemList.size()]);
-
- IJsTranslator translator = getTranslator();
- if (translator instanceof JsTranslator && problems.length > 0) {
- Region[] generatedRanges = ((JsTranslator) translator).getGeneratedRanges();
- for (int i = 0; i < problems.length; i++) {
- for (int j = 0; j < generatedRanges.length; j++) {
- // remove any problems that are fully reported within a region generated by the translator
- if (problems[i].getSourceStart() >= generatedRanges[j].getOffset() && problems[i].getSourceEnd() <= (generatedRanges[j].getOffset() + generatedRanges[j].getLength())) {
- problemList.remove(problems[i]);
- }
- }
- }
- }
- return problemList;
- }
-
- private IProgressMonitor getProgressMonitor() {
- if (fProgressMonitor == null) {
- fProgressMonitor = new NullProgressMonitor();
- }
- return fProgressMonitor;
- }
-
- public WorkingCopyOwner getWorkingCopyOwner() {
- return CompilationUnitHelper.getInstance().getWorkingCopyOwner();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#ifOffsetInImportNode(int)
- */
- public boolean ifOffsetInImportNode(int offset) {
- Position[] importRanges = getTranslator().getImportHtmlRanges();
- for (int i = 0; i < importRanges.length; i++) {
- if (importRanges[i].includes(offset)) {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#reconcileCompilationUnit()
- */
- public void reconcileCompilationUnit() {
- // if(true) return;
- IJavaScriptUnit cu = getCompilationUnit();
- if (fCompilationUnit == null) {
- return;
- }
- if (cu != null) {
- try {
- synchronized (fLock) {
- // clear out old validation messages
- WorkingCopyOwner workingCopyOwner = getWorkingCopyOwner();
- JsProblemRequestor problemRequestor = (JsProblemRequestor) workingCopyOwner.getProblemRequestor(cu.getWorkingCopy(getProgressMonitor()));
- if(problemRequestor != null && problemRequestor.getCollectedProblems() != null)
- problemRequestor.getCollectedProblems().clear();
- cu.reconcile(IJavaScriptUnit.NO_AST, true, true, getWorkingCopyOwner(), getProgressMonitor());
- }
- }
- catch (JavaScriptModelException e) {
- Logger.logException(e);
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#release()
- */
- public void release() {
- if (getTranslator() != null)
- getTranslator().release();
- synchronized (fLock) {
- if (fCompilationUnit != null) {
- try {
- if (JsTranslation.DEBUG) {
- System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
- System.out.println("(-) JsTranslation [" + this + "] discarding JavaScriptUnit: " + fCompilationUnit); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
- }
- fCompilationUnit.discardWorkingCopy();
- }
- catch (JavaScriptModelException e) {
- // we're done w/ it anyway
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#setProblemCollectingActive(boolean)
- */
- public void setProblemCollectingActive(boolean collect) {
- IJavaScriptUnit cu = getCompilationUnit();
- if (cu != null) {
- getProblemRequestor().setIsActive(collect);
- }
- }
-
- public void classpathChange() {
-
- if (fDocumentScope != null) {
- fDocumentScope.classpathChange();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
deleted file mode 100644
index 61aa63d061..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-
- * <br><br> this adapter loads translation information from extension points. this is to allow more complicated html/js translations through extensions.
- * @author pavery
- */
-public class JsTranslationAdapter implements INodeAdapter, IResourceChangeListener {
-
- private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation")); //$NON-NLS-1$ //$NON-NLS-2$
- private IStructuredDocument fHtmlDocument = null;
- private IJsTranslation fJSTranslation = null;
- private NullProgressMonitor fTranslationMonitor = null;
- private String baseLocation;
- private boolean listenForChanges=false;
- private static final String PRIORITY_ATTRIB = "priority";
- private IJsTranslation fTranslationAsFactory;
-
- public JsTranslationAdapter(IDOMModel xmlModel) {
- fHtmlDocument = xmlModel.getStructuredDocument();
- baseLocation = xmlModel.getBaseLocation();
- initializeJavaPlugins();
-
-
- }
- public void shouldListenForChanges(boolean listenForProjectChanges) {
- if(listenForProjectChanges) {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- }
- }
-
- public IJavaScriptProject getJavaProject() {
- IJavaScriptProject javaProject = null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = new Path(baseLocation);
- IProject project = null;
- if (filePath.segmentCount() > 0) {
- project = root.getProject(filePath.segment(0));
- }
- if (project != null) {
- javaProject = JavaScriptCore.create(project);
- }
-
- return javaProject;
- }
-
- /**
- * Returns the IJsTranslation for this adapter.
- *
- * @return a IJsTranslation
- */
- public IJsTranslation getJsTranslation(boolean listenForChanges) {
- /*
- * If no translation exists or switching from not listening to
- * listening
- */
- if (fJSTranslation == null || (!this.listenForChanges && listenForChanges)) {
- if (fJSTranslation != null)
- fJSTranslation.release();
- if (fTranslationAsFactory == null) {
- /* load the translation factory from the extension point */
- try {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.wst.jsdt.web.core.javascriptPreProcessor");
- IConfigurationElement points[] = extensionPoint.getConfigurationElements();
-
- int highestPriorityValue = -1;
- int highestPriorityIndex = -1;
-
- for (int i = 0; i < points.length; i++) {
- String priority = points[i].getAttribute(PRIORITY_ATTRIB);
- int value = Integer.parseInt(priority);
- if (value > highestPriorityValue) {
- highestPriorityIndex = i;
- highestPriorityValue = value;
- }
- }
- fTranslationAsFactory = (IJsTranslation) points[highestPriorityIndex].createExecutableExtension("class");
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
- if (fTranslationAsFactory != null) {
- fJSTranslation = fTranslationAsFactory.getInstance(fHtmlDocument, getJavaProject(), listenForChanges);
- }
- else {
- fJSTranslation = new JsTranslation(fHtmlDocument, getJavaProject(), listenForChanges);
- }
- this.listenForChanges = listenForChanges;
- }
- shouldListenForChanges(listenForChanges);
- return fJSTranslation;
- }
-
-
- private void initializeJavaPlugins() {
- JavaScriptCore.getPlugin();
- }
-
- public boolean isAdapterForType(Object type) {
- return type.equals(IJsTranslation.class);
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {}
-
- public void release() {
- if (fTranslationMonitor != null) {
- fTranslationMonitor.setCanceled(true);
- }
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- if (fJSTranslation != null) {
- if (JsTranslationAdapter.DEBUG) {
- System.out.println("JSTranslationAdapter releasing:" + fJSTranslation); //$NON-NLS-1$
- }
- fJSTranslation.release();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IProject changedProject = (event==null || event.getResource()==null)?null:event.getResource().getProject();
- if(changedProject!=null && getJavaProject().getProject().equals(changedProject) && fJSTranslation!=null){
- fJSTranslation.classpathChange();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
deleted file mode 100644
index b621153258..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-/*******************************************************************************
- * 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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-
- * @author pavery
- *
- */
-public class JsTranslationAdapterFactory extends AbstractAdapterFactory {
- // for debugging
- private static final boolean DEBUG;
-
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- private JsTranslationAdapter fAdapter = null;
-
- public JsTranslationAdapterFactory() {
- super(IJsTranslation.class, true);
- }
-
-
- public INodeAdapterFactory copy() {
- return new JsTranslationAdapterFactory();
- }
-
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if (target instanceof IDOMNode && fAdapter == null) {
- fAdapter = new JsTranslationAdapter(((IDOMNode) target).getModel());
- if (JsTranslationAdapterFactory.DEBUG) {
- System.out.println("(+) JSPTranslationAdapterFactory [" + this + "] created adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return fAdapter;
- }
-
-
- public void release() {
- if (fAdapter != null) {
- if (JsTranslationAdapterFactory.DEBUG) {
- System.out.println("(-) JSPTranslationAdapterFactory [" + this + "] releasing adapter: " + fAdapter); //$NON-NLS-1$ //$NON-NLS-2$
- }
- fAdapter.release();
- }
- super.release();
- }
-
- public static void setupAdapterFactory(IStructuredModel sm) {
- if (sm.getFactoryRegistry().getFactoryFor(IJsTranslation.class) == null) {
- JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
- sm.getFactoryRegistry().addFactory(factory);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
deleted file mode 100644
index 18896cfd41..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-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.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.DocumentRewriteSessionEvent;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentRewriteSessionListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-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.ITextRegionContainer;
-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.regions.DOMRegionContext;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-
- * Translates a web page into its JavaScript pieces.
- *
- */
-public class JsTranslator extends Job implements IJsTranslator, IDocumentListener {
-
- protected static final boolean DEBUG;
- private static final boolean DEBUG_SAVE_OUTPUT = false; //"true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk")); //$NON-NLS-1$ //$NON-NLS-2$
-// private static final String ENDL = "\n"; //$NON-NLS-1$
-
- private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
-// private static final String XML_COMMENT_END = "-->"; //$NON-NLS-1$
-
- private static final String CDATA_START = "<![CDATA["; //$NON-NLS-1$
- private static final String CDATA_START_PAD = new String(Util.getPad(CDATA_START.length()));
- private static final String CDATA_END = "]]>"; //$NON-NLS-1$
- private static final String CDATA_END_PAD = new String(Util.getPad(CDATA_END.length()));
-
-
- //TODO: should be an inclusive rule rather than exclusive
- private static final Pattern fClientSideTagPattern = Pattern.compile("<[^<%?)!>]+/?>"); //$NON-NLS-1$
-
- // FIXME: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=307401
- private String[][] fServerSideDelimiters = new String[][]{{"<%","%>"},{"<?","?>"}};
- private int fShortestServerSideDelimiterPairLength = 4;
-
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsjavamapping"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private class DocumentRewriteSessionListener implements IDocumentRewriteSessionListener {
- public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
- if (DocumentRewriteSessionEvent.SESSION_START.equals(event.getChangeType())) {
- fIsInRewriteSession = true;
- }
- else if (DocumentRewriteSessionEvent.SESSION_STOP.equals(event.getChangeType())) {
- fIsInRewriteSession = false;
- schedule();
- }
- }
- }
-
- private IStructuredDocumentRegion fCurrentNode;
- boolean fIsInRewriteSession = false;
- protected StringBuffer fScriptText = new StringBuffer();
- protected IStructuredDocument fStructuredDocument = null;
- protected ArrayList importLocationsInHtml = new ArrayList();
- /* use java script by default */
- protected boolean fIsGlobalJs = true;
- protected ArrayList rawImports = new ArrayList(); // translated
- protected ArrayList scriptLocationInHtml = new ArrayList();
- protected int scriptOffset = 0;
-
- protected byte[] fLock = new byte[0];
- protected byte[] finished = new byte[0];
-
- protected IBuffer fCompUnitBuff;
- protected boolean cancelParse = false;
- protected int missingEndTagRegionStart = -1;
- protected static final boolean ADD_SEMICOLON_AT_INLINE=true;
- private IDocumentRewriteSessionListener fDocumentRewriteSessionListener = new DocumentRewriteSessionListener();
-
- /*
- * org.eclipse.jface.text.Regions that contain purely generated code, for
- * which no validation messages should be reported to the user
- */
- private List fGeneratedRanges = new ArrayList();
-
- protected boolean isGlobalJs() {
- return fIsGlobalJs;
- }
-
- protected IBuffer getCompUnitBuffer() {
- return fCompUnitBuff;
- }
-
- protected StringBuffer getScriptTextBuffer() {
- return fScriptText;
- }
-
-
- protected void setIsGlobalJs(boolean value) {
- this.fIsGlobalJs = value;
- }
-
- protected void advanceNextNode() {
- setCurrentNode(getCurrentNode().getNext());
- }
-
- public JsTranslator(IStructuredDocument document, String fileName) {
- this(document, fileName, false);
- }
-
- /**
- * @deprecated
- */
- public JsTranslator() {
- super("JavaScript Translation");
- }
-
- public JsTranslator(IStructuredDocument document, String fileName, boolean listenForChanges) {
- super("JavaScript translation for : " + fileName); //$NON-NLS-1$
- fStructuredDocument = document;
- if (listenForChanges) {
- fStructuredDocument.addDocumentListener(this);
- if (fStructuredDocument instanceof IDocumentExtension4) {
- ((IDocumentExtension4) fStructuredDocument).addDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
- }
- setPriority(Job.LONG);
- setSystem(true);
- schedule();
- }
- reset();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getJsText()
- */
- public String getJsText() {
- synchronized(finished) {
- /* if mid re-write session doc changes have been ignored,
- * but if jsText is specifically request we should re-translate
- * to pick up any changes thus far
- */
- if(this.fIsInRewriteSession) {
- this.reset();
- }
-
- return fScriptText.toString();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getCurrentNode()
- */
- protected final IStructuredDocumentRegion getCurrentNode() {
-
- return fCurrentNode;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#setBuffer(org.eclipse.wst.jsdt.core.IBuffer)
- */
- public void setBuffer(IBuffer buffer) {
- fCompUnitBuff = buffer;
- synchronized(finished) {
- fCompUnitBuff.setContents(fScriptText.toString());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getHtmlLocations()
- */
- public Position[] getHtmlLocations() {
- synchronized(finished) {
- return (Position[]) scriptLocationInHtml.toArray(new Position[scriptLocationInHtml.size()]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getMissingEndTagRegionStart()
- */
- public int getMissingEndTagRegionStart() {
- return missingEndTagRegionStart;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getImportHtmlRanges()
- */
- public Position[] getImportHtmlRanges() {
- synchronized(finished) {
- return (Position[]) importLocationsInHtml.toArray(new Position[importLocationsInHtml.size()]);
- }
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#getRawImports()
- */
- public String[] getRawImports() {
- synchronized(finished) {
- return (String[]) this.rawImports.toArray(new String[rawImports.size()]);
- }
- }
-
-
-
- /**
- *
- * @return the status of the translator's progrss monitor, false if the
- * monitor is null
- */
- protected boolean isCanceled() {
- return cancelParse;
- }
-
- /**
- * Reinitialize some fields
- */
- protected void reset() {
- synchronized (finished) {
- synchronized (fLock) {
- scriptOffset = 0;
- // reset progress monitor
- fScriptText = new StringBuffer();
- fCurrentNode = fStructuredDocument.getFirstStructuredDocumentRegion();
- rawImports.clear();
- importLocationsInHtml.clear();
- scriptLocationInHtml.clear();
- missingEndTagRegionStart = -1;
- cancelParse = false;
- fGeneratedRanges.clear();
- }
- translate();
- }
- }
-
-
-
- protected IStructuredDocumentRegion setCurrentNode(IStructuredDocumentRegion currentNode) {
- synchronized(fLock) {
- return this.fCurrentNode = currentNode;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translate()
- */
- public void translate() {
- //setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion());
-
- synchronized(finished) {
- if(getCurrentNode() != null) {
- NodeHelper nh = new NodeHelper(getCurrentNode());
- while (getCurrentNode() != null && !isCanceled()) {
- nh.setDocumentRegion(getCurrentNode());
-
- // System.out.println("Translator Looking at Node
- // type:"+getCurrentNode().getType()+"---------------------------------:");
- // System.out.println(new NodeHelper(getCurrentNode()));
- // i.println("/---------------------------------------------------");
- if (getCurrentNode().getType() == DOMRegionContext.XML_TAG_NAME) {
- if ((!nh.isEndTag() || nh.isSelfClosingTag()) && nh.nameEquals("script")) { //$NON-NLS-1$
- /*
- * Handles the following cases: <script
- * type="javascriptype"> <script language="javascriptype>
- * <script src='' type=javascriptype> <script src=''
- * language=javascripttype <script src=''> global js type.
- * <script> (global js type)
- */
- if (NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("type")) || NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("language")) || (nh.getAttributeValue("type")==null && nh.getAttributeValue("language")==null && isGlobalJs())) { //$NON-NLS-1$ //$NON-NLS-2$
- if (nh.containsAttribute(new String[] { "src" })) { //$NON-NLS-1$
- // Handle import
- translateScriptImportNode(getCurrentNode());
- }
- // } else {
- // handle script section
-
- if (getCurrentNode().getNext() != null /*&& getCurrentNode().getNext().getType() == DOMRegionContext.BLOCK_TEXT*/) {
- translateJSNode(getCurrentNode().getNext());
- }
- } // End search for <script> sections
- } else if (nh.containsAttribute(JsDataTypes.HTMLATREVENTS)) {
- /* Check for embedded JS events in any tags */
- translateInlineJSNode(getCurrentNode());
- } else if (nh.nameEquals("META") && nh.attrEquals("http-equiv", "Content-Script-Type") && nh.containsAttribute(new String[] { "content" })) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- // <META http-equiv="Content-Script-Type" content="type">
- setIsGlobalJs( NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("content"))); //$NON-NLS-1$
- } // End big if of JS types
- }
- if (getCurrentNode() != null) {
- advanceNextNode();
- }
- } // end while loop
- if(getCompUnitBuffer()!=null) getCompUnitBuffer().setContents(fScriptText.toString());
- }
- finishedTranslation();
- }
- }
-
- protected void finishedTranslation() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateInlineJSNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
- */
- public void translateInlineJSNode(IStructuredDocumentRegion container) {
- // System.out
- // .println("JSPTranslator.translateInlineJSNode Entered
- // w/ScriptOffset:"
- // + scriptOffset);
-
- //NodeHelper nh = new NodeHelper(container);
- // System.out.println("inline js node looking at:\n" + nh);
- /* start a function header.. will amend later */
- ITextRegionList t = container.getRegions();
- ITextRegion r;
- Iterator regionIterator = t.iterator();
- while (regionIterator.hasNext() && !isCanceled() ) {
- r = (ITextRegion) regionIterator.next();
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- int start = r.getStart();
- int offset = r.getTextEnd();
- String tagAttrname = container.getText().substring(start, offset).trim();
- /*
- * Attribute values aren't case sensative, also make sure next
- * region is attrib value
- */
- if (NodeHelper.isInArray(JsDataTypes.HTMLATREVENTS, tagAttrname)) {
- if (regionIterator.hasNext()) {
- regionIterator.next();
- }
- if (regionIterator.hasNext()) {
- r = ((ITextRegion) regionIterator.next());
- }
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- int valStartOffset = container.getStartOffset(r);
- // int valEndOffset = r.getTextEnd();
- String rawText = container.getText().substring(r.getStart(), r.getTextEnd());
- if (rawText == null || rawText.length() == 0) {
- return;
- }
- /* Strip quotes */
- switch (rawText.charAt(0)) {
- case '\'':
- case '"':
- rawText = rawText.substring(1);
- valStartOffset++;
- }
- if (rawText == null || rawText.length() == 0) {
- return;
- }
- switch (rawText.charAt(rawText.length() - 1)) {
- case '\'':
- case '"':
- rawText = rawText.substring(0, rawText.length() - 1);
- }
- // Position inScript = new Position(scriptOffset,
- // rawText.length());
- /* Quoted text starts +1 and ends -1 char */
- if(ADD_SEMICOLON_AT_INLINE) rawText = rawText + ";"; //$NON-NLS-1$
- Position inHtml = new Position(valStartOffset, rawText.length());
- scriptLocationInHtml.add(inHtml);
- /* need to pad the script text with spaces */
- char[] spaces = Util.getPad(valStartOffset - scriptOffset);
- fScriptText.append(spaces);
- fScriptText.append(rawText);
- scriptOffset = fScriptText.length();
- }
- }
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateJSNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
- */
- public void translateJSNode(IStructuredDocumentRegion container) {
- ITextRegionCollection containerRegion = container;
- Iterator regions = containerRegion.getRegions().iterator();
- ITextRegion region = null;
-
- if(container==null) return;
-
- char[] spaces = Util.getPad(container.getStartOffset() - scriptOffset);
- fScriptText.append(spaces);
- scriptOffset = container.getStartOffset();
-
- if(container.getType()!=DOMRegionContext.BLOCK_TEXT && container.getType()!= DOMRegionContext.XML_CDATA_TEXT) {
- return;
- }
-
- while (regions.hasNext() && !isCanceled()) {
- region = (ITextRegion) regions.next();
- String type = region.getType();
- // content assist was not showing up in JSP inside a javascript
- // region
-
- //System.out.println("Region text: " + container.getText().substring(region.getStart(), region.getEnd()));
- boolean isContainerRegion = region instanceof ITextRegionContainer;
- /* make sure its not a sub container region, probably JSP */
- if (type == DOMRegionContext.BLOCK_TEXT ) {
- int scriptStart = container.getStartOffset();
- int scriptTextLength = container.getLength();
- String regionText = container.getFullText(region);
- regionText = StringUtils.replace(regionText, CDATA_START, CDATA_START_PAD);
- regionText = StringUtils.replace(regionText, CDATA_END, CDATA_END_PAD);
- int regionLength = region.getLength();
-
- spaces = Util.getPad(scriptStart - scriptOffset);
- fScriptText.append(spaces);
- // skip over XML/HTML comment starts
- if (regionText.indexOf(XML_COMMENT_START) >= 0) {
- int index = regionText.indexOf(XML_COMMENT_START);
-
- boolean replaceCommentStart = true;
- for (int i = 0; i < index; i++) {
- /*
- * replace the comment start in the translation when
- * it's preceded only by white space
- */
- replaceCommentStart = replaceCommentStart && Character.isWhitespace(regionText.charAt(i));
- }
-
- if (replaceCommentStart) {
- IRegion line;
- int end;
- int length;
- try {
- line = container.getParentDocument().getLineInformationOfOffset(index + scriptStart);
- end = line.getOffset() + line.getLength() - scriptStart;
- if(end > regionText.length()) {
- end = regionText.length()-1;
- }
- length = end - index;
- } catch (BadLocationException e) {
- Logger.logException("Could not get HTML style comment line information", e); //$NON-NLS-1$
-
- end = index + XML_COMMENT_START.length();
- length = XML_COMMENT_START.length();
- }
-
- StringBuffer newRegionText = new StringBuffer(regionText.substring(0, index));
- spaces = Util.getPad(length);
- newRegionText.append(spaces);
- newRegionText.append(regionText.substring(end));
- regionText = newRegionText.toString();
- }
- }
- // server-side code
-// else {
- /*
- * Fix for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=284774
- * end of last valid JS source, start of next content to
- * skip
- */
- // last offset of valid JS source, after which there's server-side stuff
- int validJSend = 0;
- // start of next valid JS source, last offset of content that was skipped
- int validJSstart = 0;
-
- Matcher matcher = fClientSideTagPattern.matcher(regionText);
- // note the start of a HTML tag if one's present
- int clientMatchStart = matcher.find() ? matcher.start() : -1;
-
- StringBuffer contents = new StringBuffer();
-
- int serverSideStart = -1;
- int serverSideDelimiter = 0;
-
- // find any instance of server code blocks in the region text
- for (int i = 0; i < fServerSideDelimiters.length; i++) {
- int index = regionText.indexOf(fServerSideDelimiters[i][0]);
- if (serverSideStart < 0) {
- serverSideStart = index;
- serverSideDelimiter = i;
- }
- else if (index >= 0) {
- serverSideStart = Math.min(serverSideStart, index);
- if (serverSideStart == index) {
- serverSideDelimiter = i;
- }
- }
- }
- // contains something other than pure JavaScript
- while (serverSideStart > -1 || clientMatchStart > -1) { //$NON-NLS-1$
- validJSend = validJSstart;
- boolean biasClient = false;
- boolean biasServer = false;
- // update the start of content to skip
- if (clientMatchStart > -1 && serverSideStart > -1) {
- validJSend = Math.min(clientMatchStart, serverSideStart);
- biasClient = validJSend == clientMatchStart;
- biasServer = validJSend == serverSideStart;
- }
- else if (clientMatchStart > -1 && serverSideStart < 0) {
- validJSend = clientMatchStart;
- biasClient = true;
- }
- else if (clientMatchStart < 0 && serverSideStart > -1) {
- validJSend = serverSideStart;
- biasServer = true;
- }
-
- // append if there's something we want to include
- if (-1 < validJSstart && -1 < validJSend) {
- // append what we want to include
- contents.append(regionText.substring(validJSstart, validJSend));
-
- // change the skipped content to a valid variable name and append it as a placeholder
- int startOffset = container.getStartOffset(region) + validJSend;
-
- String serverEnd = fServerSideDelimiters[serverSideDelimiter][1];
- int serverSideEnd = (regionLength > validJSend + serverEnd.length()) ? regionText.indexOf(serverEnd, validJSend + fServerSideDelimiters[serverSideDelimiter][1].length()) : -1;
- if (serverSideEnd > -1)
- serverSideEnd += serverEnd.length();
- int clientMatchEnd = matcher.find(validJSend) ? matcher.end() : -1;
- // update end of what we skipped
- validJSstart = -1;
- if (clientMatchEnd > validJSend && serverSideEnd > validJSend) {
- if (biasClient)
- validJSstart = clientMatchEnd;
- else if (biasServer)
- validJSstart = serverSideEnd;
- else
- validJSstart = Math.min(clientMatchEnd, serverSideEnd);
- }
- if (clientMatchEnd >= validJSend && serverSideEnd < 0)
- validJSstart = matcher.end();
- if (clientMatchEnd < 0 && serverSideEnd >= validJSend)
- validJSstart = serverSideEnd;
- int line = container.getParentDocument().getLineOfOffset(startOffset);
- int column;
- try {
- column = startOffset - container.getParentDocument().getLineOffset(line);
- }
- catch (BadLocationException e) {
- column = -1;
- }
- // substituted text length much match original length exactly, find text of the right length
- int start = validJSend + container.getStartOffset(region);
- contents.append('_');
- for (int i = validJSend + 1; i < validJSstart; i++) {
- switch (i - validJSend) {
- case 1 :
- contents.append('$');
- break;
- case 2 :
- contents.append('t');
- break;
- case 3 :
- contents.append('a');
- break;
- case 4 :
- contents.append('g');
- break;
- default :
- contents.append('_');
- }
- }
- int end = validJSstart + container.getStartOffset(region);
- // remember that this source range w
- fGeneratedRanges.add(new Region(start, end - start));
- }
- // set up to end while if no end for valid
- if (validJSstart > 0) {
- int serverSideStartGuess = -1;
- for (int i = 0; i < fServerSideDelimiters.length; i++) {
- int index = regionText.indexOf(fServerSideDelimiters[i][0], validJSstart);
- if (serverSideStartGuess < 0) {
- serverSideStartGuess = index;
- serverSideDelimiter = i;
- }
- else if (index >= 0) {
- serverSideStartGuess = Math.min(serverSideStartGuess, index);
- if (serverSideStartGuess == index) {
- serverSideDelimiter = i;
- }
- }
- }
- serverSideStart = validJSstart < regionLength - fShortestServerSideDelimiterPairLength ? serverSideStartGuess : -1;
- clientMatchStart = validJSstart < regionLength ? (matcher.find(validJSstart) ? matcher.start() : -1) : -1;
- }
- else {
- serverSideStart = clientMatchStart = -1;
- }
- }
- if (validJSstart >= 0) {
- contents.append(regionText.substring(validJSstart));
- }
- if (contents.length() != 0) {
- fScriptText.append(contents.toString());
- }
- else {
- fScriptText.append(regionText);
- }
- Position inHtml = new Position(scriptStart, scriptTextLength);
- scriptLocationInHtml.add(inHtml);
-// }
-
- scriptOffset = fScriptText.length();
- }
- }
-
- IStructuredDocumentRegion endTag = container.getNext();
-
- if(endTag==null) {
- missingEndTagRegionStart = container.getStartOffset();
- }else if(endTag!=null) {
- NodeHelper nh = new NodeHelper(endTag);
- String name = nh.getTagName();
-
- if(name==null || !name.trim().equalsIgnoreCase("script") || !nh.isEndTag()) { //$NON-NLS-1$
- missingEndTagRegionStart = container.getStartOffset();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#translateScriptImportNode(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)
- */
- public void translateScriptImportNode(IStructuredDocumentRegion region) {
- NodeHelper nh = new NodeHelper(region);
- String importName = nh.getAttributeValue("src"); //$NON-NLS-1$
- if (importName != null && !importName.equals("")) { //$NON-NLS-1$
- rawImports.add(importName);
- Position inHtml = new Position(region.getStartOffset(), region.getEndOffset());
- importLocationsInHtml.add(inHtml);
- }
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- cancelParse = true;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- if (fIsInRewriteSession) {
- return;
- }
-
- cancel();
- schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- reset();
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#release()
- */
- public void release() {
- fStructuredDocument.removeDocumentListener(this);
- if (fStructuredDocument instanceof IDocumentExtension4) {
- ((IDocumentExtension4) fStructuredDocument).removeDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
- }
- }
-
- /**
- * @return the fGeneratedRanges
- */
- public Region[] getGeneratedRanges() {
- return (Region[]) fGeneratedRanges.toArray(new Region[fGeneratedRanges.size()]);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
deleted file mode 100644
index 4b0baff36b..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
+++ /dev/null
@@ -1,46 +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.wst.jsdt.web.core.javascript;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * Provisional API: This class/interface is part of an interim API that is
- * still under development and expected to change significantly before
- * reaching stability. It is being made available at this early stage to
- * solicit feedback from pioneering adopters on the understanding that any
- * code that uses this API will almost certainly be broken (repeatedly) as the
- * API evolves.
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.java.messages"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
- }
-
- public static String NodeHelper00;
- public static String NodeHelper01;
- public static String NodeHelper03;
- public static String NodeHelper11;
- public static String NodeHelper12;
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
deleted file mode 100644
index 8afd83e544..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class NodeHelper {
- protected static final char DOUBLE_QUOTE_CHAR = '\"';
- protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
- protected static final char SINGLE_QUOTE_CHAR = '\'';
- protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
-
- public static boolean isInArray(String StringArray[], String text) {
- if (StringArray == null || text == null) {
- return false;
- }
- for (int i = 0; i < StringArray.length; i++) {
- if (StringArray[i].equalsIgnoreCase(text.trim())) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean isQuoted(String string) {
- if ((string == null) || (string.length() < 2)) {
- return false;
- }
- int lastIndex = string.length() - 1;
- char firstChar = string.charAt(0);
- char lastChar = string.charAt(lastIndex);
- return (((firstChar == NodeHelper.SINGLE_QUOTE_CHAR) && (lastChar == NodeHelper.SINGLE_QUOTE_CHAR)) || ((firstChar == NodeHelper.DOUBLE_QUOTE_CHAR) && (lastChar == NodeHelper.DOUBLE_QUOTE_CHAR)));
- }
- protected IStructuredDocumentRegion region;
-
- public NodeHelper(IStructuredDocumentRegion region) {
- this.region = region;
- }
-
- public boolean attrEquals(String attribute, String value) {
- String attValue = getAttributeValue(attribute);
- if(attValue==null) return false;
- return attValue.equalsIgnoreCase(value);
- }
-
- public String AttrToString() {
- if (region == null) {
- return null;
- }
- // For debugging
- ITextRegionList t = region.getRegions();
- ITextRegion r;
- Iterator regionIterator = t.iterator();
- String StructuredValue = Messages.NodeHelper00 + getTagName() + Messages.NodeHelper01; //$NON-NLS-1$ //$NON-NLS-2$
- while (regionIterator.hasNext()) {
- r = (ITextRegion) regionIterator.next();
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- StructuredValue += "\t\t" + region.getText(r); //$NON-NLS-1$
- /*
- * Theres a XML_TAG_ATTRIBUTE_EQUALS after the
- * XML_TAG_ATTRIBUTE_NAME we have to get rid of
- */
- if (regionIterator.hasNext()) {
- regionIterator.next();
- }
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (regionIterator.hasNext()) {
- r = ((ITextRegion) regionIterator.next());
- }
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- StructuredValue += "\t\t" + stripEndQuotes(region.getText(r)) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
- return StructuredValue;
- }
-
- public boolean containsAttribute(String name[]) {
- if (name == null) {
- return false;
- }
- if (region == null) {
- return false;
- }
- ITextRegionList t = region.getRegions();
- ITextRegion r;
- Iterator regionIterator = t.iterator();
- while (regionIterator.hasNext()) {
- r = (ITextRegion) regionIterator.next();
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- String tagname = region.getText(r).trim();
- /* Attribute values aren't case sensative */
- if (NodeHelper.isInArray(name, tagname)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public String getAttributeValue(String name) {
- if (region == null) {
- return null;
- }
- if (name == null) {
- return null;
- }
- ITextRegionList t = region.getRegions();
- ITextRegion r;
- Iterator regionIterator = t.iterator();
- while (regionIterator.hasNext()) {
- r = (ITextRegion) regionIterator.next();
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- String tagname = region.getText(r).trim();
- /*
- * Attribute values aren't case sensative, also make sure next
- * region is attrib value
- */
- if (tagname.equalsIgnoreCase(name)) {
- if (regionIterator.hasNext()) {
- regionIterator.next();
- }
- if (regionIterator.hasNext()) {
- r = ((ITextRegion) regionIterator.next());
- }
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- return stripEndQuotes(region.getText(r));
- }
- }
- }
- }
- return null;
- }
-
- public String getElementAsFlatString() {
- /*
- * Returns a full string of this element minus and 'illegal' characters
- * (usefull for identifying the HTML element in a generic JS function)
- */
- if (region == null) {
- return null;
- }
- String fullRegionText = region.getFullText();
- if (fullRegionText == null) {
- return null;
- }
- return fullRegionText.replaceAll("[^a-zA-Z0-9]", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String getTagName() {
- if (region == null) {
- return null;
- }
- ITextRegionList t = region.getRegions();
- ITextRegion r;
- Iterator regionIterator = t.iterator();
- while (regionIterator.hasNext()) {
- r = (ITextRegion) regionIterator.next();
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- return region.getText(r);
- }
- }
- return null;
- }
-
- public boolean isEndTag() {
- if (region == null) {
- return false;
- }
- return DOMRegionContext.XML_END_TAG_OPEN.equals(region.getFirstRegion().getType());
- }
-
- public boolean isSelfClosingTag() {
- if (region == null) {
- return false;
- }
- return DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(region.getLastRegion().getType());
- }
-
- public boolean nameEquals(String name) {
- if (region == null || name == null) {
- return false;
- }
- return name.equalsIgnoreCase(getTagName());
- }
-
- public void setDocumentRegion(IStructuredDocumentRegion newRegion) {
- if (newRegion == null)
- throw new IllegalArgumentException();
- region = newRegion;
- }
-
- public String stripEndQuotes(String text) {
- if (text == null) {
- return null;
- }
- if (NodeHelper.isQuoted(text)) {
- return text.substring(1, text.length() - 1);
- }
- return text;
- }
-
-
- public String toString() {
- ITextRegionList t = region.getRegions();
- Iterator regionIterator = t.iterator();
- String nodeText = new String();
- while (regionIterator.hasNext()) {
- ITextRegion r = (ITextRegion) regionIterator.next();
- String nodeType = r.getType();
- nodeText += (Messages.NodeHelper11 + nodeType + Messages.NodeHelper12 + region.getText(r) + "\n"); //$NON-NLS-1$
- }
- return nodeText;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
deleted file mode 100644
index a42aeadd5e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
+++ /dev/null
@@ -1,54 +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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import java.util.Arrays;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class Util {
- public static char[] getPad(int numberOfChars) {
- if(numberOfChars < 0) return new char[0];
- final char[] spaceArray = new char[numberOfChars];
- Arrays.fill(spaceArray, ' ');
- return spaceArray;
- }
-
- public static String removeAll(String source, char remove) {
-
- String newString = "";
-
- char[] oldStringArray = source.toCharArray();
-
- for(int i = 0;i<oldStringArray.length;i++) {
- if(oldStringArray[i]!=remove) newString+=oldStringArray[i];
- }
- return newString;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
deleted file mode 100644
index 5d958e50fc..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
+++ /dev/null
@@ -1,57 +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
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *
- *
- *******************************************************************************/
-
-
-
-package org.eclipse.wst.jsdt.web.core.javascript;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.web.core.internal.project.ModuleCoreSupport;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class WebRootFinder {
- public static IPath getServerContextRoot(IProject project) {
- IPath root = ModuleCoreSupport.getWebContentRootPath(project);
- if (root != null)
- return root;
- return Path.ROOT;
- }
-
- /**
- * @param project
- * @return project-relative path to the web content root
- */
- public static IPath getWebContentFolder(IProject project) {
- IPath root = ModuleCoreSupport.getWebContentRootPath(project);
- if (root != null)
- return root.removeFirstSegments(1);
- return Path.ROOT;
- }
-
- public static String getWebContext(IProject project) {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
deleted file mode 100644
index ebccdda2cd..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
+++ /dev/null
@@ -1,15 +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
-###############################################################################
-NodeHelper.0=Tag name:
-NodeHelper.1=\tAttribute\tValue\n
-NodeHelper.3=attrib type
-NodeHelper.11=\tNode Type:
-NodeHelper.12=\ \t\tValue:
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
deleted file mode 100644
index 83d1ed477e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.javascript.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
-import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-* (copied from JSP)
- * Re-indexes the entire workspace.
- * Ensures the JSP Index is in a stable state before performing a search.
- * (like after a crash or if previous indexing was canceled)
- *
- * @author pavery
- */
-public class IndexWorkspaceJob extends Job {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * Visitor that retrieves project paths for all web page files in the workspace,
- * and adds the files to be indexed as they are encountered
- */
- private class WebFileVisitor implements IResourceProxyVisitor {
- private List files = new ArrayList();
-
- // monitor from the Job
- IProgressMonitor fMonitor = null;
- public WebFileVisitor(IProgressMonitor monitor) {
- this.fMonitor = monitor;
- }
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
- // check job canceled
- if ((this.fMonitor != null) && this.fMonitor.isCanceled()) {
- setCanceledState();
- return false;
- }
-
- // check search support canceled
- if(JsSearchSupport.getInstance().isCanceled()) {
- setCanceledState();
- return false;
- }
- // skip hidden, unreadable, or derived files
- if (proxy.getType() == IResource.FILE && !proxy.isDerived() && !proxy.isHidden() && proxy.isAccessible()) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // check this before description
- // check name before actually getting the file (less work)
- if(Util.isJsType(proxy.getName())) {
- this.fMonitor.subTask(proxy.getName());
- IFile file = (IFile) proxy.requestResource();
-
- if (DEBUG) {
- System.out.println("(+) IndexWorkspaceJob adding file: " + file.getName()); //$NON-NLS-1$
- }
- // this call will check the ContentTypeDescription, so don't need to do it here.
- //JSPSearchSupport.getInstance().addJspFile(file);
- this.files.add(file);
-
- // don't search deeper for files
- return false;
- }
- }
- return !proxy.getName().startsWith(".");
- }
-
- public final IFile[] getFiles() {
- return (IFile[])this.files.toArray(new IFile[this.files.size()]);
- }
- }
-
- //private IContentType fContentTypeJSP = null;
-
- public IndexWorkspaceJob() {
- // pa_TODO may want to say something like "Rebuilding JSP Index" to be more
- // descriptive instead of "Updating JSP Index" since they are 2 different things
- super(JsCoreMessages.JSPIndexManager_0);
- setPriority(Job.LONG);
- setSystem(true);
- }
-
-// IContentType getJspContentType() {
-// if(this.fContentTypeJSP == null)
-// this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
-// return this.fContentTypeJSP;
-// }
-
- /**
- * @see org eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- * for similar method
- */
- protected IStatus run(IProgressMonitor monitor) {
-
- IStatus status = Status.OK_STATUS;
-
- if(monitor.isCanceled()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
-
- if(DEBUG) {
- System.out.println(" ^ IndexWorkspaceJob started: "); //$NON-NLS-1$
- }
-
- long start = System.currentTimeMillis();
-
- try {
- WebFileVisitor visitor = new WebFileVisitor(monitor);
- // collect all jsp files
- ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.DEPTH_INFINITE);
- // request indexing
- // this is pretty much like faking an entire workspace resource delta
- JsIndexManager.getInstance().indexFiles(visitor.getFiles());
- }
- catch (CoreException e) {
- if(DEBUG) {
- e.printStackTrace();
- }
- }
- finally {
- monitor.done();
- }
- long finish = System.currentTimeMillis();
- if(DEBUG) {
- System.out.println(" ^ IndexWorkspaceJob finished\n total time running: " + (finish - start)); //$NON-NLS-1$
- }
-
- return status;
- }
-
- void setCanceledState() {
- JsIndexManager.getInstance().setIndexState(JsIndexManager.S_CANCELED);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
deleted file mode 100644
index 0862b4bf8a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
+++ /dev/null
@@ -1,84 +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.jsdt.web.core.javascript.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.core.search.JavaSearchDocument;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * Wrapper method to set getPath() path to be the path of the compilation unit
- * for the jsp file. (since it's a final method, it needs to be set via constructor)
- *
- * @author pavery
- */
-public class JSDTSearchDocumentDelegate extends JavaSearchDocument {
-
- private JsSearchDocument fJSPSearchDoc = null;
-
- public JSDTSearchDocumentDelegate(JsSearchDocument jspSearchDoc) {
-
- super(jspSearchDoc.getPath(), jspSearchDoc.getParticipant());
- this.fJSPSearchDoc = jspSearchDoc;
- }
-
- public byte[] getByteContents() {
-
- return this.fJSPSearchDoc.getByteContents();
- }
-
- public char[] getCharContents() {
-
- return this.fJSPSearchDoc.getCharContents();
- }
-
- public String getJavaText() {
- return this.fJSPSearchDoc.getJavaText();
- }
-
- public String getEncoding() {
-
- return this.fJSPSearchDoc.getEncoding();
- }
-
- public IFile getFile() {
-
- return this.fJSPSearchDoc.getFile();
- }
-
- public IJsTranslation getJspTranslation() {
-
- return this.fJSPSearchDoc.getJSTranslation();
- }
-
-// public int getJspOffset(int javaOffset) {
-//
-// return this.fJSPSearchDoc.getJspOffset(javaOffset);
-// }
-
- public void release() {
- this.fJSPSearchDoc.release();
- }
- public IJavaScriptElement getJavaElement() {
- return getJspTranslation().getCompilationUnit();
- }
- public boolean isVirtual() {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
deleted file mode 100644
index b503069ef6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
+++ /dev/null
@@ -1,772 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.javascript.search;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.index.Index;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexRequest;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.ReadWriteMonitor;
-import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
-import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
-import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- *(copied from JSP)
- * Responsible for keeping the JS index up to date.
- *
- */
-public class JsIndexManager {
-
- // for debugging
- // TODO move this to Logger, as we have in SSE
- static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private static final String PKEY_INDEX_STATE = "jspIndexState"; //$NON-NLS-1$
-
- private IndexWorkspaceJob indexingJob = new IndexWorkspaceJob();
-
-
-
- // TODO: consider enumeration for these int constants
- // set to S_UPDATING once a resource change comes in
- // set to S_STABLE if:
- // - we know we aren't interested in the resource change
- // - or the ProcessFilesJob completes
- // set to S_CANCELED if an indexing job is canceled
- // set to S_REBUILDING if re-indexing the entire workspace
-
- // the int '0' is reserved for the default value if a preference is not
- // there
- /** index is reliable to use */
- public static final int S_STABLE = 1;
- /** index is being updated (from a resource delta) */
- public static final int S_UPDATING = 2;
- /** entire index is being rebuilt */
- public static final int S_REBUILDING = 3;
- /**
- * indexing job was canceled in the middle of it, index needs to be
- * rebuilt
- */
- public static final int S_CANCELED = 4;
-
- /** symbolic name for OSGI framework */
- private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
-
- /**
- * Collects web page files from a resource delta. Derived resources should
- * be included to handle resources whose derived flag is being toggled.
- */
- private class JSResourceDeltaVisitor implements IResourceDeltaVisitor {
- // using hash map ensures only one of each file
- // must be reset before every use
- private HashMap webPageFiles = null;
-
- public JSResourceDeltaVisitor() {
- this.webPageFiles = new HashMap();
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException {
-
- // in case JS search was canceled (eg. when closing the editor)
- if (JsSearchSupport.getInstance().isCanceled() || frameworkIsShuttingDown()) {
- setCanceledState();
- return false;
- }
-
- try {
- // skip anything hidden by name
- if (isHiddenResource(delta.getFullPath())) {
- return false;
- }
-
- int kind = delta.getKind();
- int flags = delta.getFlags();
- boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
- boolean isInterestingChange = false;
- if ((kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
- // ignore things like marker changes
- isInterestingChange = (flags & IResourceDelta.CONTENT) > 0 || (flags & IResourceDelta.REPLACED) > 0 || (flags & IResourceDelta.TYPE) > 0 || (flags & IResourceDelta.MOVED_FROM) > 0;
- }
- boolean removed = (kind & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
- if (added || isInterestingChange) {
- visitAdded(delta);
- }
- else if (removed) {
- visitRemoved(delta);
- }
- }
- catch (Exception e) {
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if (DEBUG) {
- Logger.logException("Delta analysis may not be complete", e); //$NON-NLS-1$
- }
- }
- // if the delta has children, continue to add/remove files
- return true;
- }
-
- private void visitRemoved(IResourceDelta delta) {
- // handle cleanup
- if (delta.getResource() != null) {
- IResource r = delta.getResource();
- if ((r.getType() == IResource.FOLDER) && r.exists()) {
- deleteIndex((IFolder) r);
- }
- if ((r.getType() == IResource.FILE) && r.exists()) {
- deleteIndex((IFile) r);
- }
- }
- }
-
- private void visitAdded(IResourceDelta delta) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // quick check if it's even web page related to improve
- // performance
- // checking name from the delta before getting
- // resource because it's lighter
- String filename = delta.getFullPath().lastSegment();
- if (filename != null && Util.isJsType(filename)) {
- IResource r = delta.getResource();
- if (r.isAccessible() && r.getType() == IResource.FILE) {
- this.webPageFiles.put(r.getFullPath(), r);
- }
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=93463
- private boolean isHiddenResource(IPath p) {
- return p.segmentCount() > 0 && p.lastSegment().startsWith(".");
- }
-
- private void deleteIndex(IFolder folder) {
- // cleanup index
- IndexManager im = JavaModelManager.getJavaModelManager().getIndexManager();
- IPath folderPath = folder.getFullPath();
- IPath indexLocation = JsSearchSupport.getInstance().computeIndexLocation(folderPath);
- im.removeIndex(indexLocation);
- // im.indexLocations.removeKey(folderPath);
- // im.indexLocations.removeValue(indexLocation);
- File f = indexLocation.toFile();
- f.delete();
- }
-
- private void deleteIndex(IFile file) {
- // have to use our own job to compute the correct index location
- RemoveFileFromIndex removeFileFromIndex = new RemoveFileFromIndex(file.getFullPath());
- JavaModelManager.getJavaModelManager().getIndexManager().request(removeFileFromIndex);
- }
-
- public IFile[] getFiles() {
- return (IFile[]) this.webPageFiles.values().toArray(new IFile[this.webPageFiles.size()]);
- }
-
- public void reset() {
- this.webPageFiles.clear();
- }
- }
-
-
- /**
- * schedules web pages for indexing
- */
- private class ProcessFilesJob extends Job {
- List fileList = null;
- // keep track of how many files we've indexed
- int lastFileCursor = 0;
-
- ProcessFilesJob(String taskName) {
- super(taskName);
- fileList = new ArrayList();
- }
-
- synchronized void process(IFile[] files) {
- for (int i = 0; i < files.length; i++) {
- fileList.add(files[i]);
- }
- if (DEBUG) {
- System.out.println("JSIndexManager queuing " + files.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- synchronized IFile[] getFiles() {
- return (IFile[]) fileList.toArray(new IFile[fileList.size()]);
- }
-
- synchronized void clearFiles() {
- fileList.clear();
- lastFileCursor = 0;
- //System.out.println("cleared files");
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- // System.out.println("indexer monitor" + monitor);
- if (isCanceled(monitor) || frameworkIsShuttingDown()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
-
- long start = System.currentTimeMillis();
-
- try {
- IFile[] filesToBeProcessed = getFiles();
-
- if (DEBUG) {
- System.out.println("JSIndexManager indexing " + filesToBeProcessed.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
- }
- // API indicates that monitor is never null
- monitor.beginTask("", filesToBeProcessed.length); //$NON-NLS-1$
- JsSearchSupport ss = JsSearchSupport.getInstance();
- String processingNFiles = ""; //$NON-NLS-1$
-
-
- for (;lastFileCursor < filesToBeProcessed.length; lastFileCursor++) {
-
- if (isCanceled(monitor) || frameworkIsShuttingDown()) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
- IFile file = filesToBeProcessed[lastFileCursor];
- // do not add files that are derived
- if(!file.isDerived()) {
- try {
- IJavaScriptProject project = JavaScriptCore.create(file.getProject());
- if (project.exists()) {
- ss.addJspFile(file);
- // JS Indexer processing n files
- processingNFiles = NLS.bind(JsCoreMessages.JSPIndexManager_2, new String[]{Integer.toString((filesToBeProcessed.length - lastFileCursor))});
- monitor.subTask(processingNFiles + " - " + file.getName()); //$NON-NLS-1$
- monitor.worked(1);
-
- if (DEBUG) {
- System.out.println("JSIndexManager Job added file: " + file.getName()); //$NON-NLS-1$
- }
- }
- }
- catch (Exception e) {
- // RATLC00284776
- // ISSUE: we probably shouldn't be catching EVERY
- // exception, but
- // the framework only allows to return IStatus in
- // order to communicate
- // that something went wrong, which means the loop
- // won't complete, and we would hit the same problem
- // the next time.
- //
- // a possible solution is to keep track of the
- // exceptions logged
- // and only log a certain amt of the same one,
- // otherwise skip it.
- if (!frameworkIsShuttingDown()) {
- String filename = file != null ? file.getFullPath().toString() : ""; //$NON-NLS-1$
- Logger.logException("JSIndexer problem indexing:" + filename, e); //$NON-NLS-1$
- }
- }
- }
- } // end for
- }
- finally {
- // just in case something didn't follow API (monitor is null)
- if (monitor != null) {
- monitor.done();
- }
- }
-
- // successfully finished, clear files list
- clearFiles();
-
- long finish = System.currentTimeMillis();
- long diff = finish - start;
- if (DEBUG) {
- fTotalTime += diff;
- System.out.println("============================================================================"); //$NON-NLS-1$
- System.out.println("this time: " + diff + " cumulative time for resource changed: " + fTotalTime); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("============================================================================"); //$NON-NLS-1$
- }
- return Status.OK_STATUS;
- }
-
- private boolean isCanceled(IProgressMonitor runMonitor) {
- boolean canceled = false;
- // check specific monitor passed into run method (the progress
- // group in this case)
- // check main search support canceled
- if ((runMonitor != null) && runMonitor.isCanceled()) {
- canceled = true;
- } else if (JsSearchSupport.getInstance().isCanceled()) {
- canceled = true;
- if (runMonitor != null) {
- runMonitor.setCanceled(true);
- }
- }
- return canceled;
- }
-
- }
-
- // end class ProcessFilesJob
-
- class RemoveFileFromIndex extends IndexRequest {
- IPath filePath;
-
- public RemoveFileFromIndex(IPath filePath) {
- super(filePath.removeLastSegments(1), JavaModelManager.getJavaModelManager().getIndexManager());
- }
- public boolean execute(IProgressMonitor progressMonitor) {
-
- if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true;
-
- /* ensure no concurrent write access to index */
- Index index = this.manager.getIndex(this.containerPath, JsSearchSupport.getInstance().computeIndexLocation(filePath.removeLastSegments(1)), true, /*reuse index file*/ false /*create if none*/);
- if (index == null) return true;
- ReadWriteMonitor monitor = index.monitor;
- if (monitor == null) return true; // index got deleted since acquired
-
- try {
- monitor.enterWrite(); // ask permission to write
- index.remove(filePath.lastSegment());
- } finally {
- monitor.exitWrite(); // free write lock
- }
- return true;
- }
- public String toString() {
- return "removing " + filePath.lastSegment() + " from index " + this.containerPath; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private static JsIndexManager fSingleton = null;
- private boolean initialized;
- private boolean initializing = true;
-
- private IndexJobCoordinator indexJobCoordinator;
- private IResourceChangeListener jsResourceChangeListener;
-
- private JSResourceDeltaVisitor fVisitor = null;
- static long fTotalTime = 0;
-
- // Job for processing resource delta
- private ProcessFilesJob processFilesJob = null;
-
- private JsIndexManager() {
- processFilesJob = new ProcessFilesJob(JsCoreMessages.JSPIndexManager_0);
- // only show in verbose mode
- processFilesJob.setSystem(true);
- processFilesJob.setPriority(Job.LONG);
- processFilesJob.addJobChangeListener(new JobChangeAdapter() {
- public void done(IJobChangeEvent event) {
- super.done(event);
- setStableState();
- }
- });
- }
-
- public synchronized static JsIndexManager getInstance() {
- if (fSingleton == null) {
- fSingleton = new JsIndexManager();
- }
- return fSingleton;
- }
-
- public void initialize() {
- JsIndexManager singleInstance = getInstance();
-
- if (!singleInstance.initialized) {
- singleInstance.initialized = true;
-
- singleInstance.indexJobCoordinator = new IndexJobCoordinator();
- singleInstance.jsResourceChangeListener = new JSResourceChangeListener();
-
- // added as JobChange listener so JSIndexManager can be smarter
- // about when it runs
- Job.getJobManager().addJobChangeListener(singleInstance.indexJobCoordinator);
-
- // add JSIndexManager to keep JSP Index up to date
- // listening for IResourceChangeEvent.PRE_DELETE and
- // IResourceChangeEvent.POST_CHANGE
- ResourcesPlugin.getWorkspace().addResourceChangeListener(jsResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
- // makes sure IndexManager is aware of our indexes
- saveIndexes();
- //rebuildIndexIfNeeded();
- singleInstance.initializing = false;
-
- }
-
- }
-
- synchronized void setIndexState(int state) {
- if (DEBUG) {
- System.out.println("JSIndexManager setting index state to: " + state2String(state)); //$NON-NLS-1$
- }
- Plugin jspModelPlugin = JsCorePlugin.getDefault();
- jspModelPlugin.getPluginPreferences().setValue(PKEY_INDEX_STATE, state);
- jspModelPlugin.savePluginPreferences();
-
- }
-
- private String state2String(int state) {
- String s = "UNKNOWN"; //$NON-NLS-1$
- switch (state) {
- case (S_STABLE) :
- s = "S_STABLE"; //$NON-NLS-1$
- break;
- case (S_UPDATING) :
- s = "S_UPDATING"; //$NON-NLS-1$
- break;
- case (S_CANCELED) :
- s = "S_CANCELED"; //$NON-NLS-1$
- break;
- case (S_REBUILDING) :
- s = "S_REBUILDING"; //$NON-NLS-1$
- break;
- }
- return s;
- }
-
- int getIndexState() {
- return JsCorePlugin.getDefault().getPluginPreferences().getInt(PKEY_INDEX_STATE);
- }
-
- void setUpdatingState() {
- //if (getIndexState() != S_CANCELED)
- setIndexState(S_UPDATING);
- }
-
- void setCanceledState() {
- setIndexState(JsIndexManager.S_CANCELED);
- }
-
- void setStableState() {
- //if (getIndexState() != S_CANCELED)
- setIndexState(S_STABLE);
- }
-
- void setRebuildingState() {
- setIndexState(S_REBUILDING);
- }
-
- synchronized void rebuildIndexIfNeeded() {
- if (getIndexState() != S_STABLE) {
- rebuildIndex();
- }
- }
-
- void rebuildIndex() {
-
- if (DEBUG) {
- System.out.println("*** JS web page Index unstable, requesting re-indexing"); //$NON-NLS-1$
- }
-
- getIndexingJob().addJobChangeListener(new JobChangeAdapter() {
- public void aboutToRun(IJobChangeEvent event) {
- super.aboutToRun(event);
- setRebuildingState();
- }
-
- public void done(IJobChangeEvent event) {
- super.done(event);
- setStableState();
- getIndexingJob().removeJobChangeListener(this);
- }
- });
- // we're about to reindex everything anyway
- getProcessFilesJob().clearFiles();
- getIndexingJob().schedule();
-
- }
-
- /**
- * Creates and schedules a Job to process collected files. All JSP
- * indexing should be done through this method or processFiles(IFile file)
- *
- * @param files
- */
- final void indexFiles(IFile[] files) {
- // don't use this rule
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4931
- // processFiles.setRule(new IndexFileRule());
- processFilesJob.process(files);
- }
-
-
- /**
- * Package protected for access by inner Job class in resourceChanged(...)
- *
- * @return
- */
- JSResourceDeltaVisitor getVisitor() {
-
- if (this.fVisitor == null) {
- this.fVisitor = new JSResourceDeltaVisitor();
- }
- return this.fVisitor;
- }
- void saveIndexes() {
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
- IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int j = 0; j < allProjects.length; j++) {
- if (!JsWebNature.hasNature(allProjects[j]) || !allProjects[j].isOpen()) {
- continue;
- }
- IPath jsModelWorkingLocation = JsSearchSupport.getInstance().getModelJspPluginWorkingLocation(allProjects[j]);
- File folder = new File(jsModelWorkingLocation.toOSString());
- String[] files = folder.list();
- String locay = ""; //$NON-NLS-1$
- try {
- for (int i = 0; i < files.length; i++) {
- if (files[i].toLowerCase().endsWith(".index")) { //$NON-NLS-1$
- locay = jsModelWorkingLocation.toString() + "/" + files[i]; //$NON-NLS-1$
- // XXX: might not be the right container path, check IndexManager.indexLocations ?
- indexManager.getIndex(allProjects[j].getFullPath(), new Path(locay), true, false);
- // indexManager.saveIndex(index);
- }
- }
- } catch (Exception e) {
- // we should be shutting down, want to shut down quietly
- if (JsIndexManager.DEBUG) {
- e.printStackTrace();
- }
- }
- }
- }
-
- /**
- * A check to see if the OSGI framework is shutting down.
- *
- * @return true if the System Bundle is stopped (ie. the framework is
- * shutting down)
- */
- boolean frameworkIsShuttingDown() {
- // in the Framework class there's a note:
- // set the state of the System Bundle to STOPPING.
- // this must be done first according to section 4.19.2 from the OSGi
- // R3 spec.
- boolean shuttingDown = Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
- if (DEBUG && shuttingDown) {
- System.out.println("JSIndexManager: system is shutting down!"); //$NON-NLS-1$
- }
- return shuttingDown;
- }
-
-
- public void shutdown() {
-
- // stop listening
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(jsResourceChangeListener);
-
-
- // stop any searching
- JsSearchSupport.getInstance().setCanceled(true);
-
- // stop listening to jobs
- Job.getJobManager().removeJobChangeListener(indexJobCoordinator);
-
-
- int maxwait = 5000;
- if (processFilesJob != null) {
- processFilesJob.cancel();
- }
- // attempt to make sure this indexing job is litterally
- // done before continuing, since we are shutting down
- waitTillNotRunning(maxwait, processFilesJob);
-
- if (indexingJob != null) {
- indexingJob.cancel();
- }
- waitTillNotRunning(maxwait, processFilesJob);
- }
-
- private void waitTillNotRunning(int maxSeconds, Job job) {
- int pauseTime = 10;
- int maxtries = maxSeconds / pauseTime;
- int count = 0;
- while ((count++ < maxtries) && (job.getState() == Job.RUNNING)) {
- try {
- Thread.sleep(pauseTime);
- // System.out.println("count: " + count + " max: " +
- // maxtries);
- }
- catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
- }
-
- private class IndexJobCoordinator extends JobChangeAdapter {
-
- public void aboutToRun(IJobChangeEvent event) {
- Job jobToCoordinate = event.getJob();
- if (isJobToAvoid(jobToCoordinate)) {
- // job will be rescheduled when the job we
- // are avoiding (eg. build) is done
- getProcessFilesJob().cancel();
- //System.out.println("cancel:" + jobToCoordinate.getName());
- }
- }
-
- public void done(IJobChangeEvent event) {
-
- Job jobToCoordinate = event.getJob();
- if (isJobToAvoid(jobToCoordinate)) {
- if (getProcessFilesJob().getFiles().length > 0) {
- getProcessFilesJob().schedule(500);
- //System.out.println("schedule:" + jobToCoordinate.getName());
- }
-
-
- }
- }
-
- private boolean isJobToAvoid(Job jobToCoordinate) {
- boolean result = false;
- if (jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_REFRESH)) {
- result = true;
- }
- return result;
-
- }
-
- }
-
- private class JSResourceChangeListener implements IResourceChangeListener {
-
-
- /**
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
-
- if (isInitializing()) {
- return;
- }
-
- // ignore resource changes if already rebuilding
- if (getIndexState() == S_REBUILDING) {
- return;
- }
- // previously canceled, needs entire index rebuild
- if (getIndexState() == S_CANCELED) {
- // rebuildIndex();
- // just resume indexing
- getProcessFilesJob().schedule(500);
- //System.out.println("schedule: resource changed, previously canceled");
- return;
- }
-
- IResourceDelta delta = event.getDelta();
- if (delta != null) {
- // only care about adds or changes right now...
- int kind = delta.getKind();
- boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
- boolean changed = (kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED;
- if (added || changed) {
-
- // only analyze the full (starting at root) delta
- // hierarchy
- if (delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
- try {
- JSResourceDeltaVisitor v = getVisitor();
- // clear from last run
- v.reset();
- // count files, possibly do this in a job too...
- // don't include PHANTOM resources
- delta.accept(v, false);
-
- // process files from this delta
- IFile[] files = v.getFiles();
- if (files.length > 0) {
- /*
- * Job change listener should set back to
- * stable when finished
- */
- setUpdatingState();
- // processFiles(files);
- indexFiles(files);
- }
- }
- catch (CoreException e) {
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if (DEBUG) {
- Logger.logException(e);
- }
- }
- catch (Exception e) {
- // need to set state here somehow, and reindex
- // otherwise index will be unreliable
- if (DEBUG) {
- Logger.logException(e);
- }
- }
- }
- }
-
- }
- }
-
- }
-
- IndexWorkspaceJob getIndexingJob() {
- return indexingJob;
- }
-
- ProcessFilesJob getProcessFilesJob() {
- return processFilesJob;
- }
-
- boolean isInitializing() {
- return initializing;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
deleted file mode 100644
index b1ebaad99a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
+++ /dev/null
@@ -1,119 +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.jsdt.web.core.javascript.search;
-
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * pa_TODO Still need to take into consideration:
- * - focus in workspace
- * - search pattern
- *
- * @author pavery
- */
-public class JsPathIndexer {
-
- // for debugging
- static final boolean DEBUG;
- static {
-
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-
- }
-
- // visitor that retrieves jsp project paths for all jsp files in the workspace
- class JSPFileVisitor implements IResourceProxyVisitor {
- // hash map forces only one of each file
- private HashMap fPaths = new HashMap();
- IJavaScriptSearchScope fScope = null;
- SearchPattern fPattern = null;
-
- public JSPFileVisitor(SearchPattern pattern, IJavaScriptSearchScope scope) {
- this.fPattern = pattern;
- this.fScope = scope;
- }
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
-
- if(JsSearchSupport.getInstance().isCanceled()) {
- return false;
- }
-
- if (proxy.getType() == IResource.FILE) {
-
- //IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
- // check this before description
- // check name before actually getting the file (less work)
- //if(contentTypeJSP.isAssociatedWith(proxy.getName())) {
- if(Util.isJsType(proxy.getName())){
- IFile file = (IFile)proxy.requestResource();
- //IContentDescription contentDescription = file.getContentDescription();
- //String ctId = null;
-// if (contentDescription != null) {
-// ctId = contentDescription.getContentType().getId();
-// }
- //if (ContentTypeIdForJSP.ContentTypeID_JSP.equals(ctId)) {
- //if(Util.isJsType(file.getName())){
- if (this.fScope.encloses(proxy.requestFullPath().toString())) {
-
- if (DEBUG) {
- System.out.println("adding selected index path:" + file.getParent().getFullPath()); //$NON-NLS-1$
- }
-
- fPaths.put(file.getParent().getFullPath(), JsSearchSupport.getInstance().computeIndexLocation(file.getParent().getFullPath()));
- }
- //}
- }
- // don't search deeper for files
- return false;
- }
- return true;
- }
-
- public IPath[] getPaths() {
- return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
- }
- }
-
- public IPath[] getVisibleJspPaths(SearchPattern pattern, IJavaScriptSearchScope scope) {
-
- JSPFileVisitor jspFileVisitor = new JSPFileVisitor(pattern, scope);
- try {
- ResourcesPlugin.getWorkspace().getRoot().accept(jspFileVisitor, 0);
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- return jspFileVisitor.getPaths();
- }
-}
-
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
deleted file mode 100644
index ce87bb13b8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
+++ /dev/null
@@ -1,261 +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.jsdt.web.core.javascript.search;
-
-import java.io.IOException;
-
-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.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * Created with a .jsp file, but should appear to be a .java file for indexing
- * and searching purposes. There are purposely few fields in this class, and
- * those fields are lightweight since it's possible for many JSP search
- * documents to exist in memory at one time (eg. after importing a project
- * with a large number of JSP files)
- *
- * @author pavery
- */
-public class JsSearchDocument {
-
- private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
- private String fJSPPathString = UNKNOWN_PATH;
- private String fCUPath = UNKNOWN_PATH;
- private SearchParticipant fParticipant = null;
- private long fLastModifiedStamp;
- private char[] fCachedCharContents;
-
- /**
- * @param file
- * @param participant
- * @throws CoreException
- */
- public JsSearchDocument(String filePath, SearchParticipant participant) {
-
- this.fJSPPathString = filePath;
- this.fParticipant = participant;
- }
-
- public SearchParticipant getParticipant() {
- return this.fParticipant;
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
- */
- public char[] getCharContents() {
-
- if((fCachedCharContents == null) || isDirty()) {
- IJsTranslation trans = getJSTranslation();
- fCachedCharContents = trans != null ? trans.getJsText().toCharArray() : new char[0];
- fCUPath = trans.getJavaPath();
- }
- return fCachedCharContents;
- }
-
- public String getJavaText() {
- return new String(getCharContents());
- }
-
- private IModelManager getModelManager() {
- return StructuredModelManager.getModelManager();
- }
-
- /**
- * It's not recommended for clients to hold on to this JSPTranslation
- * since it's kind of large. If possible, hold on to the
- * JSPSearchDocument, which is more of a lightweight proxy.
- *
- * @return the JSPTranslation for the jsp file, or null if it's an
- * unsupported file.
- */
- public final IJsTranslation getJSTranslation() {
- IJsTranslation translation = null;
- IFile jspFile = getFile();
- if (!JsSearchSupport.isJsp(jspFile)) {
- return translation;
- }
-
- IStructuredModel model = null;
- try {
- // get existing model for read, then get document from it
- IModelManager modelManager = getModelManager();
- if (modelManager != null) {
- jspFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- model = modelManager.getModelForRead(jspFile);
- }
- // handle unsupported
- if (model instanceof IDOMModel) {
- IDOMModel xmlModel = (IDOMModel)model;
- setupAdapterFactory(xmlModel);
- IDOMDocument doc = xmlModel.getDocument();
- JsTranslationAdapter adapter = (JsTranslationAdapter) doc.getAdapterFor(IJsTranslation.class);
- translation = adapter.getJsTranslation(false);
- }
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- catch (UnsupportedCharsetExceptionWithDetail e) {
- // no need to log this. Just consider it an invalid file for our
- // purposes.
- // Logger.logException(e);
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return translation;
- }
-
- /**
- * add the factory for JSPTranslationAdapter here
- *
- * @param sm
- */
- private void setupAdapterFactory(IStructuredModel sm) {
- JsTranslationAdapterFactory.setupAdapterFactory(sm);
- }
-
- /**
- * the path to the Java compilation unit
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getPath()
- */
- public String getPath() {
- // caching the path since it's expensive to get translation
- // important that isDirty() check is second to cache modification stamp
- if((this.fCUPath == null) || isDirty() || (this.fCUPath == UNKNOWN_PATH)) {
- IJsTranslation trans = getJSTranslation();
- if(trans != null) {
- this.fCUPath = trans.getJavaPath();
- // save since it's expensive to calculate again later
- fCachedCharContents = trans.getJsText().toCharArray();
- }
- }
- return fCUPath != null ? fCUPath : UNKNOWN_PATH;
- }
-
-// public int getJspOffset(int javaOffset) {
-// // copied from JSPTranslation
-// int result = -1;
-// int offsetInRange = 0;
-// Position jspPos, javaPos = null;
-// IJsTranslation trans = getJSPTranslation();
-// if (trans != null) {
-// HashMap java2jspMap = trans.getJava2JspMap();
-//
-// // iterate all mapped java ranges
-// Iterator it = java2jspMap.keySet().iterator();
-// while (it.hasNext()) {
-// javaPos = (Position) it.next();
-// // need to count the last position as included
-// if (!javaPos.includes(javaOffset) && !(javaPos.offset + javaPos.length == javaOffset))
-// continue;
-//
-// offsetInRange = javaOffset - javaPos.offset;
-// jspPos = (Position) java2jspMap.get(javaPos);
-//
-// if (jspPos != null)
-// result = jspPos.offset + offsetInRange;
-// else {
-// Logger.log(Logger.ERROR, "jspPosition was null!" + javaOffset); //$NON-NLS-1$
-// }
-// break;
-// }
-// }
-// return result;
-// }
-
- public IFile getFile() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath jspPath = new Path(this.fJSPPathString);
- IFile jspFile = root.getFile(jspPath);
- if (!jspFile.exists()) {
- // possibly outside workspace
- jspFile = root.getFileForLocation(jspPath);
- }
- return jspFile;
- }
-
-
- private boolean isDirty() {
- boolean modified = false;
- IFile f = getFile();
- if(f != null) {
- long currentStamp = f.getModificationStamp();
- if(currentStamp != fLastModifiedStamp) {
- modified = true;
- }
- fLastModifiedStamp = currentStamp;
- }
- return modified;
- }
-
- public void release() {
- // nothing to do now since JSPTranslation is created on the fly
- }
-
- /**
- * for debugging
- */
- public String toString() {
- return "[JSPSearchDocument:" + this.fJSPPathString + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getEncoding()
- */
- public String getEncoding() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchDocument#getByteContents()
- */
- public byte[] getByteContents() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
deleted file mode 100644
index 88ac3a1509..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
+++ /dev/null
@@ -1,117 +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.jsdt.web.core.javascript.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * Integration of JSP w/ java search.
- *
- * @author pavery
- */
-public class JsSearchParticipant extends SearchParticipant {
-
- // for debugging
- private static final boolean DEBUG = calculateValue();
-
- private static boolean calculateValue() {
- String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
- boolean debug = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- return debug;
- }
-
- /**
- * Important to never return null here or else Java search participation
- * will break.
- */
- public SearchDocument getDocument(String documentPath) {
- SearchDocument sDoc = JsSearchSupport.getInstance().getSearchDocument(documentPath);
-
- if (sDoc == null) {
- // return a dummy doc here so search participation doesn't break
- return new NullSearchDocument(documentPath);
- }
- return sDoc;
- }
-
- public String getDescription() {
- return "Embeded JavaScript"; //$NON-NLS-1$
- }
-
- public IPath[] selectIndexes(SearchPattern pattern, IJavaScriptSearchScope scope) {
- JsPathIndexer indexer = new JsPathIndexer();
- return indexer.getVisibleJspPaths(pattern, scope);
- }
-
- public void indexDocument(SearchDocument document, IPath indexPath) {
- if (!(document instanceof JSDTSearchDocumentDelegate)) {
- return;
- }
-
- // use Java search indexing
- SearchEngine.getDefaultSearchParticipant().indexDocument(document, indexPath);
- }
-
- public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaScriptSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException {
-
- if ((monitor != null) && monitor.isCanceled()) {
- return;
- }
-
- // filter out null matches
- List filtered = new ArrayList();
- SearchDocument match = null;
- for (int i = 0; i < indexMatches.length; i++) {
- if (DEBUG) {
- System.out.println("found possible matching JavaSearchDocumentDelegate: " + indexMatches[i]); //$NON-NLS-1$
- }
- match = indexMatches[i];
- if (match != null) {
- // some matches may be null, or if the index is out of date,
- // the file may not even exist
- if ((match instanceof JSDTSearchDocumentDelegate) && ((JSDTSearchDocumentDelegate) match).getFile().exists()) {
- filtered.add(match);
- }
- }
- }
-
- indexMatches = (SearchDocument[]) filtered.toArray(new SearchDocument[filtered.size()]);
- SearchEngine.getDefaultSearchParticipant().locateMatches(indexMatches, pattern, scope, requestor, monitor);
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchParticipant#getDocument(org.eclipse.core.resources.IFile)
- */
- public SearchDocument getDocument(IFile file) {
- // never gets called?
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
deleted file mode 100644
index 815e7f77f8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
+++ /dev/null
@@ -1,124 +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.jsdt.web.core.javascript.search;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * Used to constrain JSP/java search to certain paths and elements.
- * @author pavery
- */
-public class JsSearchScope implements IJavaScriptSearchScope {
-
- private boolean fEnclosesAll = false;
- private List fResourcePaths = null;
- private List fJavaElements = null;
-
- public JsSearchScope() {
- // empty constructor just returns true for everything
- // everything is in scope
- this.fEnclosesAll = true;
- init();
- }
-
- public JsSearchScope(String[] resourceStringPath) {
- init();
- fResourcePaths.addAll(Arrays.asList(resourceStringPath));
- }
-
- public JsSearchScope(IJavaScriptElement[] javaElement) {
- init();
- fJavaElements.addAll(Arrays.asList(javaElement));
- }
-
- private void init() {
- this.fResourcePaths = new ArrayList();
- this.fJavaElements = new ArrayList();
- }
-
- public boolean encloses(String resourcePathString) {
-
- if (this.fEnclosesAll) {
- return true;
- } else if (enclosesPath(resourcePathString)) {
- return true;
- }
-
- return false;
- }
-
- public boolean encloses(IJavaScriptElement element) {
-
- // pa_TOD implement
- if (this.fEnclosesAll) {
- return true;
- }
-
- return true;
- }
-
- public boolean encloses(IResourceProxy element) {
-
- if (this.fEnclosesAll) {
- return true;
- } else if (enclosesPath(element.requestFullPath().toOSString())) {
- return true;
- }
-
- return true;
- }
-
- public void addPath(String path) {
- this.fResourcePaths.add(path);
- }
-
- public void addElement(IJavaScriptElement element) {
- this.fJavaElements.add(element);
- }
-
- private boolean enclosesPath(String possible) {
-
- String[] paths = (String[]) fResourcePaths.toArray(new String[fResourcePaths.size()]);
- for (int i = 0; i < paths.length; i++) {
- if (possible.equals(paths[i])) {
- return true;
- }
- }
- return false;
- }
-
- public String getDescription() {
-
- return "JavaScript Search Scope"; //$NON-NLS-1$
- }
-
- public IPath[] enclosingProjectsAndJars() {
- return (IPath[]) fResourcePaths.toArray(new IPath[fResourcePaths.size()]);
- }
-
- public boolean shouldExclude(String container, String resourceName) {
- /* auto gen */
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
deleted file mode 100644
index ae94888689..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.javascript.search;
-
-import java.io.File;
-import java.util.zip.CRC32;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
-import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
-import org.eclipse.wst.jsdt.web.core.javascript.JsNameManglerUtil;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*(copied from JSP)
- * Central access to java indexing and search. All contact between JDT indexing
- * and Searching should be done through here.
- *
- * Clients should access the methods of this class via the single instance via
- * <code>getInstance()</code>.
- *
- * @author pavery
- */
-public class JsSearchSupport {
-
- // for debugging
- static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private static JsSearchSupport singleton = null;
-
- private JsSearchParticipant fParticipant = null;
-
- private IPath fJsPluginLocation = null;
-
- // pa_TODO may be slow (esp for indexing entire workspace)
- private final CRC32 fChecksumCalculator = new CRC32();
-
- /** main cancel montior for all search support */
- private final IProgressMonitor fMonitor = new NullProgressMonitor();
-
- private JsSearchSupport() {
- // force use of single instance
- }
-
- /**
- * This operation ensures that the live resource's search markers show up in
- * the open editor. It also allows the ability to pass in a ProgressMonitor
- */
- private class SearchJob extends Job implements IJavaScriptSearchConstants {
-
- String fSearchText = ""; //$NON-NLS-1$
-
- IJavaScriptSearchScope fScope = null;
-
- int fSearchFor = FIELD;
-
- int fLimitTo = ALL_OCCURRENCES;
-
- int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-
- // boolean fIsCaseSensitive = false;
-
- SearchRequestor fRequestor = null;
-
- IJavaScriptElement fElement = null;
-
- // constructor w/ java element
- public SearchJob(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
-
- super(JsCoreMessages.JSP_Search + element.getElementName());
- this.fElement = element;
- this.fScope = scope;
- this.fRequestor = requestor;
- }
-
- // constructor w/ search text
- public SearchJob(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
- super(JsCoreMessages.JSP_Search + searchText);
- this.fSearchText = searchText;
- this.fScope = scope;
- this.fSearchFor = searchFor;
- this.fLimitTo = limitTo;
- this.fMatchMode = matchMode;
- // this.fIsCaseSensitive = isCaseSensitive;
- this.fRequestor = requestor;
- }
-
- public IStatus run(IProgressMonitor jobMonitor) {
-
- if ((jobMonitor != null) && jobMonitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
- if (JsSearchSupport.getInstance().isCanceled()) {
- return Status.CANCEL_STATUS;
- }
-
- SearchPattern javaSearchPattern = null;
- // if an element is available, use that to create search pattern
- // (eg. LocalVariable)
- // otherwise use the text and other paramters
- if (this.fElement != null) {
- javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
- } else {
- javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
- }
-
- if (javaSearchPattern != null) {
- JsSearchParticipant[] participants = { getSearchParticipant() };
- SearchEngine engine = new SearchEngine();
- try {
- if (jobMonitor != null) {
- jobMonitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- }
- engine.search(javaSearchPattern, participants, this.fScope, this.fRequestor, jobMonitor);
- } catch (CoreException e) {
- if (DEBUG) {
- Logger.logException(e);
- }
- }
- // non-CoreExceptions will permanently stall the Worker thread
- catch (Exception e) {
- if (DEBUG) {
- Logger.logException(e);
- }
- } finally {
- if (jobMonitor != null) {
- jobMonitor.done();
- }
- }
- }
- return Status.OK_STATUS;
- }
- }
-
- // end SearchJob
- /**
- * Runnable forces caller to wait until finished (as opposed to using a Job)
- */
- private class SearchRunnable implements IWorkspaceRunnable, IJavaScriptSearchConstants {
-
- String fSearchText = ""; //$NON-NLS-1$
-
- IJavaScriptSearchScope fScope = null;
-
- int fSearchFor = FIELD;
-
- int fLimitTo = ALL_OCCURRENCES;
-
- int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-
- //boolean fIsCaseSensitive = false;
-
- SearchRequestor fRequestor = null;
-
- IJavaScriptElement fElement = null;
-
- // constructor w/ java element
- public SearchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
-
- this.fElement = element;
- this.fScope = scope;
- this.fRequestor = requestor;
- }
-
- // constructor w/ search text
-// public SearchRunnable(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-//
-// this.fSearchText = searchText;
-// this.fScope = scope;
-// this.fSearchFor = searchFor;
-// this.fLimitTo = limitTo;
-// this.fMatchMode = matchMode;
-// this.fIsCaseSensitive = isCaseSensitive;
-// this.fRequestor = requestor;
-// }
-
- public void run(IProgressMonitor monitor) throws CoreException {
-
- if ((monitor != null) && monitor.isCanceled()) {
- return;
- }
- if (JsSearchSupport.getInstance().isCanceled()) {
- return;
- }
-
- SearchPattern javaSearchPattern = null;
- // if an element is available, use that to create search pattern
- // (eg. LocalVariable)
- // otherwise use the text and other paramters
- if (this.fElement != null) {
- javaSearchPattern = SearchPattern.createPattern(this.fElement, fLimitTo);
- } else {
- javaSearchPattern = SearchPattern.createPattern(fSearchText, fSearchFor, fLimitTo, fMatchMode);
- }
-
- if (javaSearchPattern != null) {
- JsSearchParticipant[] participants = { getSearchParticipant() };
- SearchEngine engine = new SearchEngine();
- try {
- if (monitor != null) {
- monitor.beginTask("", 0); //$NON-NLS-1$
- }
- engine.search(javaSearchPattern, participants, fScope, fRequestor, monitor);
- } catch (CoreException e) {
- Logger.logException(e);
- //throw e;
- }
- // non-CoreExceptions will permanently stall the Worker thread
- catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (monitor != null) {
- monitor.done();
- }
- }
- }
- }
- }
-
- // end SearchRunnable
-
- /**
- * Clients should access the methods of this class via the single instance
- * via getInstance()
- *
- * @return
- */
- public synchronized static JsSearchSupport getInstance() {
-
- if (singleton == null) {
- singleton = new JsSearchSupport();
- }
- return singleton;
- }
-
- /**
- * Utility method to check if a file is a jsp file (since this is done
- * frequently)
- */
- public static boolean isJsp(IFile file) {
- return Util.isJsType(file.getName());
- // (pa) 20051025 removing deep content type check
- // because this method is called frequently
- // and IO is expensive
-// boolean isJsp = false;
-//
-// if (file != null && file.exists()) {
-//
-// IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
-// // check this before description, it's less expensive
-// if (contentTypeJSP.isAssociatedWith(file.getName())) {
-// isJsp = true;
-// }
-// }
-//
-// return isJsp;
- }
-
- /**
- * schedules a search document representing this JSP file for indexing (by
- * the java indexer)
- *
- * @param file
- * the JSP file
- * @return true if indexing was successful, false otherwise
- * @throws CoreException
- */
- public SearchDocument addJspFile(IFile file) {
- if (JsSearchSupport.getInstance().isCanceled() || !file.isAccessible()) {
- return null;
- }
-
- if (DEBUG) {
- System.out.println("adding web page file:" + file.getFullPath()); //$NON-NLS-1$
- }
-
- // create
- SearchDocument delegate = createSearchDocument(file);
- // null if not a jsp file
- if (delegate != null) {
- try {
- getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
- } catch (Exception e) {
- // ensure that failure here doesn't keep other documents from
- // being indexed
- // if peformed in a batch call (like JSPIndexManager)
- if (DEBUG) {
- e.printStackTrace();
- }
- }
- }
-
- if (DEBUG) {
- System.out.println("scheduled" + delegate + "for indexing"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return delegate;
- }
-
- /**
- * Perform a java search w/ the given parameters. Runs in a background Job
- * (results may still come in after this method call)
- *
- * @param searchText
- * the string of text to search on
- * @param searchFor
- * IJavaScriptSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
- * @param limitTo
- * IJavaScriptSearchConstants.DECLARATIONS,
- * IJavaScriptSearchConstants.REFERENCES,
- * IJavaScriptSearchConstants.IMPLEMENTORS, or
- * IJavaScriptSearchConstants.ALL_OCCURRENCES
- * @param matchMode
- * allow * wildcards or not
- * @param isCaseSensitive
- * @param requestor
- * passed in to accept search matches (and do "something" with
- * them)
- */
- public void search(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-
- JsIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchJob job = new SearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
- setCanceled(false);
- job.setUser(true);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
- // pops up user operation blocked dialog if you perform a long search,
- // then open a file because it locks the workspace
- //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
- job.schedule();
- }
-
- /**
- * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
- * a background Job (results may still come in after this method call)
- *
- * @param element
- * @param scope
- * @param requestor
- */
- public void search(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
-
- JsIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchJob job = new SearchJob(element, scope, requestor);
- setCanceled(false);
- job.setUser(true);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
- //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
- job.schedule();
- }
-
- /**
- * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
- * an IWorkspace runnable (results will be reported by the end of this
- * method)
- *
- * @param element
- * @param scope
- * @param requestor
- */
- public void searchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
-
- JsIndexManager.getInstance().rebuildIndexIfNeeded();
-
- SearchRunnable searchRunnable = new SearchRunnable(element, scope, requestor);
- try {
- setCanceled(false);
- ResourcesPlugin.getWorkspace().run(searchRunnable, JsSearchSupport.getInstance().getProgressMonitor());
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param jsFile
- * @return SearchDocument if the file is not null, exists, and is a JSP
- * file, otherwise null.
- */
- private SearchDocument createSearchDocument(IFile jsFile) {
-
- JSDTSearchDocumentDelegate delegate = null;
- if ((jsFile != null) && jsFile.exists() && isJsp(jsFile)) {
-
- delegate = new JSDTSearchDocumentDelegate(new JsSearchDocument(jsFile.getFullPath().toString(), getSearchParticipant()));
- }
- return delegate;
-
- }
-
- /**
- * Centralized place to access JSPSearchDocuments (used by
- * JSPSearchParticipant and JSPSearchRequestor)
- *
- * @param searchDocPath
- * @param doc
- * @return the JSPSearchDocument or null if one is not found
- */
- public SearchDocument getSearchDocument(String searchDocPath) {
-
- SearchDocument delegate = null;
- IFile f = fileForCUPath(searchDocPath);
- if (f != null) {
- delegate = createSearchDocument(f);
- } else {
- // handle failure case... (file deleted maybe?)
- }
- return delegate;
- }
-
- /**
- * Unmangles the searchDocPath and returns the corresponding JSP file.
- *
- * @param searchDocPath
- */
- private IFile fileForCUPath(String searchDocPath) {
-
- String[] split = searchDocPath.split("/"); //$NON-NLS-1$
- String classname = split[split.length - 1];
-
- // ignore anything but .java matches (like .class binary matches)
- if(!searchDocPath.endsWith(".js")) { //$NON-NLS-1$
- return null;
- }
-
- String filePath = JsNameManglerUtil.unmangle(classname);
-
- // try absolute path
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
- // workspace relative then
- if(f == null) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86009
- // must have a project name as well
- // which would mean >= 2 path segments
- IPath path = new Path(filePath);
- if(path.segmentCount() >= 2) {
- f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return f;
- }
-
- JsSearchParticipant getSearchParticipant() {
-
- if (this.fParticipant == null) {
- this.fParticipant = new JsSearchParticipant();
- }
- return this.fParticipant;
- }
-
- // This is called from JSPPathIndexer
- // pa_TODO
- //how can we make sure participant indexLocations are updated at startup?
- public final IPath computeIndexLocation(IPath containerPath) {
-
- IPath indexLocation = null;
- // we don't want to inadvertently use a JDT Index
- // we want to be sure to use the Index from the JSP location
- //Object obj = indexLocations.get(containerPath);
- //if (obj != null) {
- // indexLocation = (String) obj;
- //} else {
- // create index entry
- String pathString = containerPath.toOSString();
- this.fChecksumCalculator.reset();
- this.fChecksumCalculator.update(pathString.getBytes());
- String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
- // this is the only difference from
- // IndexManager#computeIndexLocation(...)
- indexLocation = getModelJspPluginWorkingLocation().append(fileName);
-
- // pa_TODO need to add to java path too, so JDT search support knows
- // there should be a non internal way to do this.
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77564
- JavaModelManager.getJavaModelManager().getIndexManager().indexLocations.put(containerPath, indexLocation);
- //}
- return indexLocation;
- }
- public IPath getModelJspPluginWorkingLocation(IProject project) {
- if (project == null) {
- System.out.println("Null project"); //$NON-NLS-1$
- }
- IPath workingLocationFile = project.getWorkingLocation(JsCorePlugin.PLUGIN_ID).append("jssearch"); //$NON-NLS-1$
- // ensure that it exists on disk
- File folder = new File(workingLocationFile.toOSString());
- if (!folder.isDirectory()) {
- try {
- folder.mkdir();
- } catch (SecurityException e) {
- }
- }
- return workingLocationFile;
- }
- // copied from JDT IndexManager
- public IPath getModelJspPluginWorkingLocation() {
-
- if (this.fJsPluginLocation != null) {
- return this.fJsPluginLocation;
- }
-
- // Append the folder name "jssearch" to keep the state location area cleaner
- IPath stateLocation = JsCorePlugin.getDefault().getStateLocation().addTrailingSeparator().append("jssearch"); //$NON-NLS-1$
-
- // pa_TODO workaround for
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=62267
- // copied from IndexManager
- String device = stateLocation.getDevice();
- if ((device != null) && (device.charAt(0) == '/')) {
- stateLocation = stateLocation.setDevice(device.substring(1));
- }
-
- // ensure that it exists on disk
- File folder = new File(stateLocation.toOSString());
- if (!folder.isDirectory()) {
- try {
- folder.mkdir();
- }
- catch (SecurityException e) {
- }
- }
-
- return this.fJsPluginLocation = stateLocation;
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public synchronized final void setCanceled(boolean cancel) {
- //System.out.println("search support monitor" + fMonitor);
- fMonitor.setCanceled(cancel);
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public synchronized final boolean isCanceled() {
-
- return fMonitor.isCanceled();
- }
-
- /**
- * JSP Indexing and Search jobs check this
- *
- * @return
- */
- public final IProgressMonitor getProgressMonitor() {
-
- return this.fMonitor;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
deleted file mode 100644
index 7f1ce797da..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.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.wst.jsdt.web.core.javascript.search;
-
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * An empty servlet, safe for Java search participation
- *
- * @author pavery
- */
-public class NullSearchDocument extends SearchDocument {
-
- StringBuffer fEmptyServletBuffer = null;
-
- public NullSearchDocument(String documentPath) {
- super(documentPath, new JsSearchParticipant());
- this.fEmptyServletBuffer = new StringBuffer();
- }
-
- public byte[] getByteContents() {
- return this.fEmptyServletBuffer.toString().getBytes();
- }
-
- public char[] getCharContents() {
- return this.fEmptyServletBuffer.toString().toCharArray();
- }
-
- public String getEncoding() {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
deleted file mode 100644
index 44ab14bd25..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
+++ /dev/null
@@ -1,26 +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.wst.jsdt.web.core.text;
-
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IJsPartitions {
- String HtmlJsPartition = IHTMLPartitions.SCRIPT;
- //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath
deleted file mode 100644
index ce73933404..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
deleted file mode 100644
index c7e8ba8ef8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-@dot
-build.xml
-javaCompiler...args
-org.eclipse.wst.jsdt.web.support.jsp_1.0.0.200806031304.jar
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project
deleted file mode 100644
index f9e07960bf..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.web.support.jsp</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.jsdt.web.support.jsp/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.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.jsdt.web.support.jsp/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.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.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 915373933e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sat Mar 24 11:23:54 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=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=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.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.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.jsdt.web.support.jsp/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.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.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.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.jsdt.web.support.jsp/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
deleted file mode 100644
index ced11391d3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.jsdt.web.support.jsp;singleton:=true
-Bundle-Version: 1.0.400.qualifier
-Bundle-Activator: org.eclipse.wst.jsdt.web.support.jsp.Activator
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.jsdt.web.ui;bundle-version="[1.0.200,2.0.0)",
- org.eclipse.jst.jsp.ui;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.3,1.4.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.2.300,1.3.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)"
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.wst.jsdt.web.support.jsp
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html b/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
deleted file mode 100644
index 460233046e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
deleted file mode 100644
index bc3b0f2bf1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
deleted file mode 100644
index 8189ecbcd6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 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
-###############################################################################
-
-#Properties file for org.eclipse.wst.jsdt.web.support.jsp
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-Bundle-Name.0 = JSDT support for JSP Plug-in \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
deleted file mode 100644
index fd718b5d03..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.jsdt.web.support.jsp.JSDTStructuredTextViewerConfigurationJSP"
- target="org.eclipse.jst.jsp.core.jspsource.source" />
- <provisionalConfiguration
- type="contentassistprocessor"
- class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
- target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
- <documentationTextHover
- class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
- target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
- <provisionalConfiguration
- type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
- target="org.eclipse.jst.jsp.SCRIPT,org.eclipse.jst.jsp.SCRIPT.EVENTHANDLER" />
- <provisionalConfiguration
- type="slaveformattingstrategy"
- class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
- target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
- id="org.eclipse.wst.jsdt.web.support.jsp.jssourcevalidator">
- <contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.wst.html.SCRIPT"></partitionType>
- <partitionType id="org.eclipse.wst.html.SCRIPT.EVENT"></partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalComputerExtendedActivation
- id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals">
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- autoActivationDelegate="org.eclipse.wst.jsdt.web.ui.contentassist.JSDTAutoActivationDelegate"
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- <partitionType
- autoActivationDelegate="org.eclipse.wst.jsdt.web.ui.contentassist.JSDTAutoActivationDelegate"
- id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </partitionType>
- </contentType>
- </proposalComputerExtendedActivation>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.jsdt.web.ui.internal.text.JsCharacterPairInserter" id="org.eclipse.wst.jsdt.web.jsp.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource"
- partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <!--
- <extension point="org.eclipse.wst.common.project.facet.core.facets">
- <event-handler facet="jst.web" type="POST_INSTALL" version="[2.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
- </event-handler>
-
- <event-handler facet="jst.web" type="POST_UNINSTALL" version="[2.0">
- <delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
- </event-handler>
- </extension>-->
-</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
deleted file mode 100644
index dd179c0e8d..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
+++ /dev/null
@@ -1,70 +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.wst.jsdt.web.support.jsp;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.support.jsp";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
deleted file mode 100644
index 661e60d1b9..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.support.jsp;
-
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT;
-import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTStructuredTextViewerConfigurationJSP extends StructuredTextViewerConfigurationJSP{
-
- private StructuredTextViewerConfiguration fHTMLSourceViewerConfiguration;
-
- private StructuredTextViewerConfiguration getJSDTHTMLSourceViewerConfiguration() {
- if (fHTMLSourceViewerConfiguration == null) {
- fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationJSDT();
- }
- return fHTMLSourceViewerConfiguration;
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- String[] indentations = null;
- if (IHTMLPartitions.SCRIPT.equals(contentType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(contentType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(contentType))
- indentations = getJSDTHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
- else
- indentations = super.getIndentPrefixes(sourceViewer, contentType);
- return indentations;
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
- if (IHTMLPartitions.SCRIPT.equals(partitionType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(partitionType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(partitionType)) {
- providers = getJSDTHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
- }
- else{
- providers = super.getLineStyleProviders(sourceViewer, partitionType);
- }
-
- return providers;
- }
-
- /**
- * @see org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
- IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
- strategies[0] = new AutoEditStrategyForJs();
- return strategies;
- } else {
- return super.getAutoEditStrategies(sourceViewer, contentType);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.classpath b/bundles/org.eclipse.wst.jsdt.web.ui/.classpath
deleted file mode 100644
index 52165ecfb5..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.project b/bundles/org.eclipse.wst.jsdt.web.ui/.project
deleted file mode 100644
index 4917858e12..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.web.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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.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.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6e07215901..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,96 +0,0 @@
-#Wed Oct 24 19:49: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.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-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=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-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.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=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=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-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=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-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.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index c91d09d875..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,51 +0,0 @@
-#Wed Oct 24 19:41:31 EDT 2007
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=false
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=true
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.format_source_code=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=false
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=true
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_SSE Team Styles
-cleanup_settings_version=2
-eclipse.preferences.version=1
-internal.default.compliance=default
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.overrideannotation=false
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 262b0ab394..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,28 +0,0 @@
-#Fri Feb 27 12:45:35 EST 2009
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.illegal-att-value=0
-compilers.p.internal=1
-compilers.p.missing-packages=2
-compilers.p.missing-version-export-package=2
-compilers.p.missing-version-import-package=2
-compilers.p.missing-version-require-bundle=2
-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-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 349427c603..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,54 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.jsdt.web.ui; singleton:=true
-Bundle-Version: 1.0.401.qualifier
-Bundle-Activator: org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.jsdt.web.ui;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.contentassist,
- org.eclipse.wst.jsdt.web.ui.internal;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.derived;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.format;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.java.search;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.java.search.ui;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.style;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.style.java;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.taginfo;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.internal.text;x-internal:=true,
- org.eclipse.wst.jsdt.web.ui.views.contentoutline
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8",
- org.eclipse.core.filesystem,
- org.eclipse.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.3.0,1.4.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
- org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.jsdt.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.jsdt.manipulation;bundle-version="[1.0.200,2.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/about.html b/bundles/org.eclipse.wst.jsdt.web.ui/about.html
deleted file mode 100644
index 460233046e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/build.properties b/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
deleted file mode 100644
index 01667d8dc3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 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
-###############################################################################
-source.. = src/
-bin.includes = META-INF/,\
- .,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
deleted file mode 100644
index 078398e1bc..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
deleted file mode 100644
index e9a6bd966a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
deleted file mode 100644
index 88766f0790..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 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
-###############################################################################
-
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-Bundle-Name.0 = JSDT Web Support UI
-hyperlinkDetector.name.0 = JavaScript Element
-menu.label.0 = Declarations
-action.tooltip.0 = Working Set
-action.label.0 = Working Set
-action.label.1 = Hierarchy
-action.tooltip.1 = Hierarchy
-action.label.2 = Project
-action.tooltip.2 = Project
-action.label.3 = Workspace
-action.tooltip.3 = Declarations
-menu.label.1 = References
-action.label.4 = Working Set
-action.tooltip.4 = Working Set
-action.label.5 = Hierarchy
-action.tooltip.5 = Hierarchy
-action.label.6 = Project
-action.tooltip.6 = Project
-action.label.7 = Workspace
-action.tooltip.7 =
-menu.label.2 = Refactor
-menu.label.3 = Source
-action.label.8 = Generate Element Comment
-action.tooltip.8 = Generate Element Comment
-action.label.9 = Change Function Signature
-action.tooltip.9 = Change Function Signature
-action.label.10 = Move
-action.tooltip.10 = Move
-action.label.11 = Rename
-action.tooltip.11 = Rename
-action.label.12 = Delete
-action.tooltip.12 = Delete
-action.label.13 = Paste After
-action.tooltip.13 = Paste
-action.label.14 = Paste Before
-action.tooltip.14 = Paste
-action.label.15 = Copy
-action.tooltip.15 = Copy
-action.label.16 = Cut
-action.tooltip.16 = Cut
-menu.label.4 = Show In
-action.label.17 = Navigator
-action.tooltip.17 = Show In Navigator
-action.label.18 = Script Explorer
-action.tooltip.18 = Show In Script Explorer
-action.label.19 = Open Call Hierarchy
-action.tooltip.19 = Open Call Hierarchy
-action.label.20 = Open Type Hierarchy
-action.tooltip.20 = Open Type Hierarchy
-renameParticipant.name.0 = JSDT Web Rename Participant
-renameParticipant.name.1 = JSDT Web Rename Participant
-renameParticipant.name.2 = JSDT Web Rename Participant
-renameParticipant.name.3 = JSDT Web Rename Participant
-queryParticipant.name.0 = JavaScript Query Participant
-javaScriptProposals = JavaScript Proposals
-
-
-##########################################################################
-# Marker Support
-##########################################################################
-markerCategory.problem = JavaScript Problems
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
deleted file mode 100644
index 9088bd7669..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
+++ /dev/null
@@ -1,791 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig"
- target="org.eclipse.wst.html.core.htmlsource.source" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT"
- target="org.eclipse.wst.html.core.htmlsource.source" />
- <provisionalConfiguration
- type="linestyleprovider"
- class="org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT"
- target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
- <documentationTextHover
- class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
- target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.jsdt.web.ui.internal.text.JsDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
- <provisionalConfiguration
- type="autoeditstrategy"
- class="org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs"
- target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
- <provisionalConfiguration
- type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
- target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
- <provisionalConfiguration
- type="slaveformattingstrategy"
- class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
- target="org.eclipse.wst.html.SCRIPT" />
- </extension>
-
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
- id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT"
- name="%hyperlinkDetector.name.0"
- targetId="org.eclipse.wst.html.SCRIPT"/>
- <hyperlinkDetector
- class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
- id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT.events"
- name="%hyperlinkDetector.name.0"
- targetId="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
- <hyperlinkDetector
- class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
- id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.HTML"
- name="%hyperlinkDetector.name.0"
- targetId="org.eclipse.wst.html.core.htmlsource"/>
- </extension>
-
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <!-- content outline contributions for Open Type and Open Hierarchy menu. Menus show up in reverse order of decliration (google it). -->
- <objectContribution
- objectClass="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode"
- id="org.eclipse.wst.jsdt.web.ui.JavaActions">
- <!-- Declarations Search Menu -->
- <menu
- id="org.eclipse.wst.jsdt.web.declerations"
- label="%menu.label.0"
- path="group.search">
- <separator name="declerations"/>
- </menu>
- <action
- label="%action.label.0"
- tooltip="%action.tooltip.0"
- menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesInWorkingSetAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInWorkingSetAction">
- </action>
- <action
- label="%action.label.1"
- tooltip="%action.tooltip.1"
- menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInHierarchyAction">
- </action>
- <action
- label="%action.label.2"
- tooltip="%action.tooltip.2"
- menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsInProjectAction">
- </action>
-
- <action
- label="%action.label.3"
- tooltip="%action.tooltip.3"
- menubarPath="org.eclipse.wst.jsdt.web.declerations/declerations"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindDeclarationsAction">
- </action>
-
- <!-- Refrences Search menu -->
- <menu
- id="org.eclipse.wst.jsdt.web.references"
- label="%menu.label.1"
- path="group.search">
- <separator name="references"/>
- </menu>
- <action
- label="%action.label.4"
- tooltip="%action.tooltip.4"
- menubarPath="org.eclipse.wst.jsdt.web.references/references"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesInWorkingSetAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInWorkingSetAction">
- </action>
- <action
- label="%action.label.5"
- tooltip="%action.tooltip.5"
- menubarPath="org.eclipse.wst.jsdt.web.references/references"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInHierarchyAction">
- </action>
- <action
- label="%action.label.6"
- tooltip="%action.tooltip.6"
- menubarPath="org.eclipse.wst.jsdt.web.references/references"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindReferencesInProjectAction">
- </action>
-
- <action
- label="%action.label.7"
- tooltip="%action.tooltip.7"
- menubarPath="org.eclipse.wst.jsdt.web.references/references"
- class="org.eclipse.wst.jsdt.web.ui.actions.FindReferencesAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.FindReferencesAction">
- </action>
- <!-- Source and Refactoring Menu's -->
- <menu
- id="org.eclipse.wst.jsdt.web.refactor"
- label="%menu.label.2"
- path="group.generate">
- <separator name="refactor"/>
- </menu>
-
- <menu
- id="org.eclipse.wst.jsdt.web.source"
- label="%menu.label.3"
- path="group.generate">
- <separator name="source"/>
- </menu>
- <!-- Source Actions -->
- <action
- label="%action.label.8"
- tooltip="%action.tooltip.8"
- menubarPath="org.eclipse.wst.jsdt.web.source/source"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.AddJavaDocStubAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.generate.element.comment">
- </action>
- <!-- Refactor Actions -->
- <action
- label="%action.label.9"
- tooltip="%action.tooltip.9"
- menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.change.function.signature">
- </action>
- <action
- label="%action.label.10"
- tooltip="%action.tooltip.10"
- menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.Move">
- </action>
- <action
- label="%action.label.11"
- tooltip="%action.tooltip.11"
- menubarPath="org.eclipse.wst.jsdt.web.refactor/refactor"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.SourceActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.rename">
- </action>
-
-
- <!-- Edit (cut copy paste etc.. -->
- <action
- label="%action.label.12"
- tooltip="%action.tooltip.12"
- menubarPath="group.edit"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.delete">
- </action>
-
- <action
- label="%action.label.13"
- tooltip="%action.tooltip.13"
- menubarPath="group.edit"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.web.ui.paste.after">
- </action>
- <action
- label="%action.label.14"
- tooltip="%action.tooltip.14"
- menubarPath="group.edit"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.web.ui.paste.before">
- </action>
- <action
- label="%action.label.15"
- tooltip="%action.tooltip.15"
- menubarPath="group.edit"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.copy">
- </action>
-
- <action
- label="%action.label.16"
- tooltip="%action.tooltip.16"
- menubarPath="group.edit"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.StandardEditorActionsAction"
- enablesFor="*"
- id="org.eclipse.wst.jsdt.web.ui.cut">
- </action>
-
- <!-- Show in Script Explorer, History and Navigator -->
- <menu
- id="org.eclipse.wst.jsdt.web.showin"
- label="%menu.label.4"
- path="group.show">
- <separator name="showin"/>
- </menu>
- <action
- label="%action.label.17"
- tooltip="%action.tooltip.17"
- menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.ShowInNavigatorAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.ShowInNavigatorViewAction">
- </action>
- <!-- History not working well -->
- <!--
- <action
- label="History"
- tooltip="Show In History"
- menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.ShowHistoryAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.internal.ui.callhierarchy.OpenCallHierarchyAction">
- </action>
- -->
- <action
- label="%action.label.18"
- tooltip="%action.tooltip.18"
- menubarPath="org.eclipse.wst.jsdt.web.showin/showin"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.ShowInScriptExplorerAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.ShowInScriptExplorer">
- </action>
-
- <!-- Open Call and Type Hierarchies -->
- <action
- label="%action.label.19"
- tooltip="%action.tooltip.19"
- menubarPath="group.show"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.OpenCallHierarchyAction"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.internal.ui.callhierarchy.OpenCallHierarchyAction">
- </action>
- <action
- label="%action.label.20"
- tooltip="%action.tooltip.20"
- menubarPath="group.show"
- style="push"
- class="org.eclipse.wst.jsdt.web.ui.actions.OpenTypeHierarchy"
- enablesFor="1"
- id="org.eclipse.wst.jsdt.ui.actions.OpenTypeHierarchyAction">
- </action>
- </objectContribution>
-
- </extension>
-
-
- <!-- ====================================================================================== -->
- <!-- source validation for JSP -->
- <!--======================================================================================-->
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
- id="org.eclipse.wst.jsdt.web.jssourcevalidator">
- <contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.SCRIPT"/>
- <partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.wst.html.SCRIPT"/>
- <partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <!--======================================================================================-->
- <!-- JSP UI Adapter factories -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.jsdt.web.ui.internal.registry.AdapterFactoryProviderForJSDT">
- <contentType id="org.eclipse.wst.html.core.htmlsource" />
- </adapterFactoryDescription>
- </extension>
-
-
-
-
- <!--======================================================================================-->
- <!-- for breakpoint -->
- <!--======================================================================================-->
- <!-- removed for now -->
- <!--
- <extension point="org.eclipse.wst.sse.ui.breakpoint">
- <breakpointContribution id="org.eclipse.wst.jsdt.web.ui.providers">
- <provider
- contentTypes="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.jsdt.web.ui.internal.breakpointproviders.JavaStratumBreakpointProvider:*html,js,htm*"
- id="org.eclipse.wst.jsdt.web.ui.internal.breakpointproviders.JavaStratumBreakpointProvider" />
- </breakpointContribution>
- </extension>
- -->
-
-
- <!-- Editor actionsets -->
- <!--
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.wst.jsdt.web.core.jspsource.source" />
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.jsdt.web.core.jspsource.source" />
- </actionSetPartAssociation>
- </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.wst.jsdt.web.ui.structured.text.editor.jsp.scope"
- commandId="org.eclipse.wst.jsdt.ui.edit.text.java.rename.element"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- -->
- <!-- move refactor -->
- <!--
- <key
- sequence="M2+M3+V"
- contextId="org.eclipse.wst.jsdt.web.ui.structured.text.editor.jsp.scope"
- commandId="org.eclipse.wst.jsdt.web.ui.refactor.move"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- </extension>
- -->
-
-
- <!--======================================================================================-->
- <!-- queryParticipant to participate in java seraches -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.jsdt.ui.queryParticipants">
- <queryParticipant
- name="%queryParticipant.name.0"
- nature="org.eclipse.wst.jsdt.core.jsNature"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.search.ui.JsQueryParticipant"
- id="org.eclipse.wst.jsdt.web.ui.java.search.ui.JsQueryParticipant" />
-
- </extension>
-
-
- <!--======================================================================================-->
- <!-- Document provider for ExternalFileEditorInput -->
- <!--======================================================================================-->
- <!--
- <extension point="org.eclipse.ui.editors.documentProviders">
- <provider
- inputTypes="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.ExternalFileEditorInput"
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- id="org.eclipse.wst.jsdt.web.ui.internal.ExternalFileDocumentProvider" />
-
- </extension>
- -->
- <!--
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.jsdt.web.core.jspsource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction" />
-
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
-
- </viewerContribution>
- </extension>
--->
-
-
-<!--
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.wst.jsdt.web.core.jspsource.source.editorActions"
- contributorClass="org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
- targetID="org.eclipse.wst.html.core.htmlsource">
- <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.wst.jsdt.web.ui.refactor.rename"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPRenameElementActionDelegate"
- actionID="RenameElement">
- </action>
- <action
- id="MoveElement"
- label="%MoveElement_label"
- definitionId="org.eclipse.wst.jsdt.web.ui.refactor.move"
- class="org.eclipse.wst.jsdt.web.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.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesActionDelegate"
- actionID="FindOccurrences">
- </action>
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- actionID="StructureSelectEnclosing">
- </action>
- <action
- id="StructureSelectNext"
- label="%StructureSelectNext_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- tooltip="%StructureSelectNext_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- actionID="StructureSelectNext">
- </action>
- <action
- id="StructureSelectPrevious"
- label="%StructureSelectPrevious_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- tooltip="%StructureSelectPrevious_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.wst.html.core.htmlsource"
- id="org.eclipse.wst.jsdt.web.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>
- -->
- <!--======================================================================================-->
- <!-- FOR JSP/JAVA RENAME PARTICIPATION -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- name="%renameParticipant.name.0"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant"
- id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.wst.jsdt.core.jsNature" />
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.wst.jsdt.core.IType" />
-
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- name="%renameParticipant.name.1"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant"
- id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPTypeRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.wst.jsdt.core.jsNature" />
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode" />
-
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- name="%renameParticipant.name.2"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant"
- id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.wst.jsdt.core.jsNature" />
-
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.wst.jsdt.core.IFunction" />
-
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- name="%renameParticipant.name.3"
- class="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant"
- id="org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.JSPMethodRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.wst.jsdt.core.jsNature" />
-
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode" />
-
- </with>
- </enablement>
- </renameParticipant>
-
- </extension>
-
- <!--
- <extension point="org.eclipse.wst.jsdt.ui.JsGlobalScopeUIInitializer">
- <JsGlobalScopeUIInitializer
- id="org.eclipse.wst.jsdt.launching.WebProject"
- class="org.eclipse.wst.jsdt.web.ui.WebProjectJsGlobalScopeUIInitializer">
- </JsGlobalScopeUIInitializer>
- </extension>
--->
-
- <!--
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- id="org.eclipse.wst.jsdt.web.ui.jsdtSetup">
- <visibility>
- <not>
- <or>
- <objectState
- name="projectNature"
- value="org.eclipse.wst.jsdt.core.jsNature"/>
- <objectState
- name="open"
- value="false"/>
- </or>
- </not>
- </visibility>
- <action
- class="org.eclipse.wst.jsdt.web.ui.SetupProjectsWizzard"
- label="%action.label.21"
- menubarPath="org.eclipse.ui.projectConfigure/additions"
- enablesFor="+"
- id="org.eclipse.wst.jsdt.internal.web.ui.convertProjects">
- </action>
- </objectContribution>
- </extension>
--->
- <extension
- point="org.eclipse.wst.sse.ui.commentingStrategy">
- <blockCommentingStrategy
- prefix="/*"
- suffix="*/">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- <lineCommentingStrategy
- prefix="//">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- <requiredPartitionTypes>
- <partitionType
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- <partitionType
- id="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT">
- </partitionType>
- </requiredPartitionTypes>
- <allowablePartitionTypes
- anyPartitionType="false">
- </allowablePartitionTypes>
- </contentType>
- </lineCommentingStrategy>
- </extension>
-
- <!-- Uncomment for Standalone + HTML as seperate options -->
- <!--
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- id="org.eclipse.wst.jsdt.web.ui.jsdtSetup">
- <action
- label="Add Support for JavaScript in HTML"
- class="org.eclipse.wst.jsdt.web.ui.SetupProjectsWizzard"
- menubarPath="org.eclipse.wst.jsdt.ui.project.tools/group0"
- enablesFor="+"
- id="org.eclipse.wst.jsdt.web.internal.ui.convertProjects">
- </action>
- </objectContribution>
- </extension>
- -->
- <extension point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalCategory
- id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
- name="%javaScriptProposals"
- icon="icons/full/elcl16/javaassist_co.gif">
- </proposalCategory>
- <proposalComputer
- activate="true"
- categoryId="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
- class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
- id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals">
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- autoActivationDelegate="org.eclipse.wst.jsdt.web.ui.contentassist.JSDTAutoActivationDelegate"
- id="org.eclipse.wst.html.SCRIPT">
- </partitionType>
- <partitionType
- autoActivationDelegate="org.eclipse.wst.jsdt.web.ui.contentassist.JSDTAutoActivationDelegate"
- id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </partitionType>
- </contentType>
- </proposalComputer>
-</extension>
-<extension point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter class="org.eclipse.wst.jsdt.web.ui.internal.text.JsCharacterPairInserter" id="org.eclipse.wst.jsdt.web.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource"
- partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
- </contentTypeIdentifier>
- </inserter>
-</extension>
-
- <extension point="org.eclipse.ui.ide.markerSupport">
- <markerTypeCategory name="%markerCategory.problem">
- <markerTypeReference id="org.eclipse.wst.jsdt.web.core.problem"/>
- </markerTypeCategory>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
deleted file mode 100644
index 3c7655f2f6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
+++ /dev/null
@@ -1,46 +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.wst.jsdt.web.ui;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
deleted file mode 100644
index 298210c003..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui;
-
-import java.lang.reflect.InvocationTargetException;
-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.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
-
-/**
- * Not API
- */
-public class SetupProjectsWizzard implements IObjectActionDelegate, IActionDelegate {
- IWorkbenchPart fPart;
- Object[] fTarget;
-
- private void doInstall(IProject project, final boolean openProperties, IProgressMonitor monitor) {
- boolean configured = false;
- JsWebNature nature = new JsWebNature(project, monitor);
- try {
- boolean hadBasicNature = JsWebNature.hasNature(project);
-
- nature.configure();
-
- if (!hadBasicNature) {
- /*
- * No nature before, so no existing build path. Define the
- * project itself as an include folder.
- */
- IJavaScriptProject jp = JavaScriptCore.create(project);
- IIncludePathEntry[] oldEntries = null;
- try {
- oldEntries = jp.getRawIncludepath();
- }
- catch (JavaScriptModelException ex1) {
- Logger.log(Logger.ERROR_DEBUG, null, ex1);
- }
-
- IPath projectPath = project.getFullPath();
- IIncludePathEntry projectPathEntry = JavaScriptCore.newSourceEntry(projectPath);
-
- if (! Arrays.asList(oldEntries).contains(projectPathEntry)) {
- IIncludePathEntry[] newEntries = new IIncludePathEntry[oldEntries.length + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
-
- newEntries[oldEntries.length] = projectPathEntry;
- jp.setRawIncludepath(newEntries, monitor);
- }
- }
- configured = true;
- }
- catch (CoreException ex) {
- Logger.logException(ex);
- }
-
- if (configured && openProperties) {
- showPropertiesOn(project, monitor);
- }
- }
-
- private void doUninstall(IProject project, IProgressMonitor monitor) {
- JsWebNature nature = new JsWebNature(project, monitor);
- try {
- nature.deconfigure();
- } catch (CoreException ex) {
- Logger.logException(ex);
- }
- }
-
- private void install(final IProject project, final boolean openProperties) {
- IProgressService service = null;
- if (fPart != null) {
- service = (IProgressService) fPart.getSite().getService(IProgressService.class);
- }
- if (service == null) {
- doInstall(project, openProperties, null);
- }
- else {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- doInstall(project, openProperties, monitor);
- }
- };
- try {
- service.run(false, false, runnable);
- }
- catch (InvocationTargetException e) {
- Logger.logException(e);
- }
- catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
- }
-
- public void run(IAction action) {
- if (fTarget == null)
- return;
-
- for (int i = 0; i < fTarget.length; i++) {
- if (fTarget[i] instanceof IResource) {
- final IProject project = ((IResource) fTarget[i]).getProject();
-
- if (!JsWebNature.hasNature(project)) {
- /* Doesn't have nature, do a full install. */
- install(project, i == fTarget.length - 1);
- }
- else {
- /*
- * Has nature, check for browser library on include path
- * and setup if not found.
- */
- IJavaScriptProject jp = JavaScriptCore.create(project);
- IIncludePathEntry[] rawClasspath = null;
- try {
- rawClasspath = jp.getRawIncludepath();
- }
- catch (JavaScriptModelException ex1) {
- Logger.log(Logger.ERROR_DEBUG, null, ex1);
- }
-
- boolean browserFound = false;
- for (int k = 0; rawClasspath != null && !browserFound && k < rawClasspath.length; k++) {
- if (rawClasspath[k].getPath().equals(JsWebNature.VIRTUAL_BROWSER_CLASSPATH)) {
- browserFound = true;
- }
- }
- if (!browserFound) {
- install(project, false);
- }
- }
- }
- }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- fTarget = ((IStructuredSelection) selection).toArray();
- }
- else {
- fTarget = null;
- }
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- fPart = targetPart;
- }
-
- private void showPropertiesOn(final IProject project, final IProgressMonitor monitor) {
- IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.propertyPages").getExtensions(); //$NON-NLS-1$
- final List pageIds = new ArrayList(8);
- for (int i = 0; i < extensions.length; i++) {
- if (extensions[i].getNamespaceIdentifier().startsWith("org.eclipse.wst.jsdt.")) { //$NON-NLS-1$
- IConfigurationElement[] configurationElements = extensions[i].getConfigurationElements();
- for (int j = 0; j < configurationElements.length; j++) {
- if ("page".equals(configurationElements[j].getName())) {
- pageIds.add(configurationElements[j].getAttribute("id")); //$NON-NLS-1$
- }
- }
- }
- }
- Shell shell = (Shell) fPart.getAdapter(Shell.class);
- if (shell == null) {
- IWorkbenchWindow activeWorkbenchWindow = JsUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null)
- shell = activeWorkbenchWindow.getShell();
- }
- final Shell finalShell = shell;
- if (finalShell != null) {
- finalShell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(finalShell, project, "org.eclipse.wst.jsdt.ui.propertyPages.BuildPathsPropertyPage", (String[]) pageIds.toArray(new String[pageIds.size()]), null); //$NON-NLS-1$
- if (dialog.open() == Window.CANCEL) {
- doUninstall(project, monitor);
- }
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
deleted file mode 100644
index a1d8070fbf..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.jsdt.web.ui;
-
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * Configuration for a source viewer which shows Html and supports JSDT.
- * <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 StructuredTextViewerConfigurationJSDT extends StructuredTextViewerConfigurationHTML {
- /**
- * Create new instance of StructuredTextViewerConfigurationHTML
- */
- public StructuredTextViewerConfigurationJSDT() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /**
- * @see org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
- IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
- strategies[0] = new AutoEditStrategyForJs();
- return strategies;
- } else {
- return super.getAutoEditStrategies(sourceViewer, contentType);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
deleted file mode 100644
index 03aeccebb3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
+++ /dev/null
@@ -1,38 +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.wst.jsdt.web.ui;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitializerExtension;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class WebProjectJsGlobalScopeUIInitializer implements IJsGlobalScopeContainerInitializerExtension{
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitialzerExtension#getImage(org.eclipse.core.runtime.IPath, java.lang.String, org.eclipse.wst.jsdt.core.IJavaScriptProject)
- */
- public ImageDescriptor getImage(IPath containerPath, String element, IJavaScriptProject project) {
- return ImageDescriptor.createFromFile(this.getClass(),"web1.JPG"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
deleted file mode 100644
index 560444cc64..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
+++ /dev/null
@@ -1,100 +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.wst.jsdt.web.ui.actions;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.internal.ui.actions.WorkbenchRunnableAdapter;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class AddJavaDocStubAction implements IObjectActionDelegate {
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- public String getDialogTitle() {
- return Messages.getString("AddJavaDocStubAction.0"); //$NON-NLS-1$
- }
-
- public Shell getShell() {
- return getSite().getShell();
- }
-
- public IWorkbenchPartSite getSite() {
- return targetPart.getSite();
- }
-
- public void run(IAction action) {
- IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
- if (elements == null || elements.length < 1) {
- return;
- }
- IJavaScriptElement parent = elements[0].getParent();
- /* find the cu */
- while (parent != null && !(parent instanceof IJavaScriptUnit)) {
-
- }
- if (parent != null) {
- ArrayList members = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IMember) {
- members.add(elements[i]);
- }
- }
- JsJfaceNode node[] = SimpleJSDTActionProxy.getJsJfaceNodesFromSelection(selection);
- /* only should be one node */
- run((IJavaScriptUnit) parent, (IMember[]) members.toArray(new IMember[members.size()]), node[0]);
- }
- }
-
- public void run(IJavaScriptUnit cu, IMember[] members, JsJfaceNode node) {
- try {
- AddJavaDocStubOperation op = new AddJavaDocStubOperation(members, node);
- PlatformUI.getWorkbench().getProgressService().runInUI(PlatformUI.getWorkbench().getProgressService(), new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule());
- } catch (InvocationTargetException e) {
- ExceptionHandler.handle(e, getShell(), getDialogTitle(), Messages.getString("AddJavaDocStubAction.1")); //$NON-NLS-1$
- } catch (InterruptedException e) {
- // operation canceled
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
deleted file mode 100644
index edde605e85..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
+++ /dev/null
@@ -1,110 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.web.core.javascript.DocumentChangeListenerToTextEdit;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class AddJavaDocStubOperation extends org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation {
- private IDocument copy;
- /**
- * @param members
- */
- private JsJfaceNode node;
- private DocumentChangeListenerToTextEdit textEditListener;
-
- public AddJavaDocStubOperation(IMember[] members, JsJfaceNode node) {
- super(members);
- this.node = node;
- }
-
- protected void applyChanges() {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- IStructuredDocument doc = node.getStructuredDocument();
- try {
- MultiTextEdit edits = textEditListener.getTextEdits();
- model = modelManager.getExistingModelForEdit(doc);
- model.aboutToChangeModel();
- model.beginRecording(this, Messages.getString("AddJavaDocStubOperation.0"), Messages.getString("AddJavaDocStubOperation.1")); //$NON-NLS-1$ //$NON-NLS-2$
- edits.apply(doc);
- } catch (MalformedTreeException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (BadLocationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } finally {
- if (model != null) {
- model.endRecording(this);
- model.changedModel();
- model.releaseFromEdit();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation#getDocument(org.eclipse.wst.jsdt.core.IJavaScriptUnit,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
-
- protected IDocument getDocument(IJavaScriptUnit cu, IProgressMonitor monitor) throws CoreException {
- return getJavaDocumentFromNode();
- }
-
- protected IDocument getJavaDocumentFromNode() {
- if (copy == null) {
- IJsTranslation tran = node.getTranslation();
- copy = new Document(tran.getJsText());
- textEditListener = new DocumentChangeListenerToTextEdit();
- copy.addDocumentListener(textEditListener);
- }
- return copy;
- }
-
-
- public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException {
- super.run(monitor);
- applyChanges();
- /* need to apply the text edits back to the original doc */
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
deleted file mode 100644
index 28a4c705a4..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
+++ /dev/null
@@ -1,60 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class FindReferencesAction extends JsElementActionProxy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgs(org.eclipse.jface.action.IAction)
- */
-
- public Object[] getRunArgs(IAction action) {
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements != null && elements.length > 0) {
- return new Object[] { elements[0] };
- }
- return new Object[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgTypes()
- */
-
- public Class[] getRunArgTypes() {
- return new Class[] { IJavaScriptElement.class };
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- setSelection(selection);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
deleted file mode 100644
index 0c8f424f86..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
+++ /dev/null
@@ -1,61 +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.wst.jsdt.web.ui.actions;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class FindReferencesInWorkingSetAction extends FindReferencesAction {
-
- public void run(IAction action) {
- try {
- Object handler = getActionHandler(action);
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements == null || elements.length == 0) {
- return;
- }
- SimpleJSDTActionProxy.executeMethod(handler, "run", new Class[] { IJavaScriptElement.class }, new Object[] { elements[0] }); //$NON-NLS-1$
- } catch (IllegalArgumentException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (SecurityException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (IllegalAccessException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (NoSuchMethodException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InstantiationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InvocationTargetException ex) {
- // If user doesn't select a working set an exception is thrown so we
- // wont print stack trace here
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
deleted file mode 100644
index 00771faad8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
+++ /dev/null
@@ -1,77 +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.wst.jsdt.web.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class JsElementActionProxy extends SimpleJSDTActionProxy {
- /* Util method to get all the java elements in a selection */
- public static IJavaScriptElement[] getJsElementsFromSelection(ISelection selection) {
- if (selection == null) {
- return new IJavaScriptElement[0];
- }
- ArrayList elements = new ArrayList();
- if (selection instanceof IStructuredSelection) {
- Iterator itt = ((IStructuredSelection) selection).iterator();
- while (itt.hasNext()) {
- Object element = itt.next();
- if (element instanceof IJavaScriptElement) {
- elements.add(element);
- }
- if (element instanceof IJavaWebNode) {
- elements.add(((IJavaWebNode) element).getJavaElement());
- }
- }
- return (IJavaScriptElement[]) elements.toArray(new IJavaScriptElement[elements.size()]);
- }
- return new IJavaScriptElement[0];
- }
-
-
- public Object[] getRunArgs(IAction action) {
- /*
- * Needs to return an array of IJavaElements. Since its one arg of type
- * IJavaScriptElement[] need to put into an object array
- */
- return new Object[] { JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection()) };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#getRunArgTypes()
- */
-
- public Class[] getRunArgTypes() {
- return new Class[] { (new IJavaScriptElement[0]).getClass() };
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
deleted file mode 100644
index 0bfa17b330..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
+++ /dev/null
@@ -1,45 +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.wst.jsdt.web.ui.actions;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.actions.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
deleted file mode 100644
index 06083a323f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
+++ /dev/null
@@ -1,50 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class OpenCallHierarchyAction extends JsElementActionProxy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.SimpleJSDTActionProxy#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
-
- public void selectionChanged(IAction action, ISelection selection) {
- IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
- /* Open call hierarchy needs to be disabled for TYPEs */
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].getElementType() == IJavaScriptElement.TYPE) {
- action.setEnabled(false);
- return;
- }
- }
- super.selectionChanged(action, selection);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
deleted file mode 100644
index 405a4c6d48..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
+++ /dev/null
@@ -1,43 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class OpenTypeHierarchy extends JsElementActionProxy {
-
- public void selectionChanged(IAction action, ISelection selection) {
- IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
- /* Open call hierarchy needs to be disabled for TYPEs */
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].getElementType() != IJavaScriptElement.TYPE) {
- action.setEnabled(false);
- return;
- }
- }
- super.selectionChanged(action, selection);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
deleted file mode 100644
index 678c02f444..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
+++ /dev/null
@@ -1,94 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class ShowHistoryAction extends JsElementActionProxy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- private IResource getHostResource(IJavaScriptElement virtualElement) {
- IProject project = virtualElement.getJavaScriptProject().getProject();
- IPath path = new Path(virtualElement.getHostPath().getPath());
- IResource host = project.getWorkspace().getRoot().findMember(path);
- return host;
- }
-
-
- public void run(IAction action) {
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements == null || elements.length == 0) {
- return;
- }
- IResource resource = null;
- if (elements[0].isVirtual()) {
- resource = getHostResource(elements[0]);
- } else {
- resource = elements[0].getResource();
- }
- if (resource == null) {
- return;
- }
- try {
- IWorkbenchPage page = targetWorkbenchPart.getSite().getPage();
- IViewPart view = page.showView(IPageLayout.ID_RES_NAV);
- if (view instanceof ISetSelectionTarget) {
- ISelection selection = new StructuredSelection(resource);
- ((ISetSelectionTarget) view).selectReveal(selection);
- }
- } catch (PartInitException e) {
- ExceptionHandler.handle(e, targetWorkbenchPart.getSite().getShell(), Messages.getString("ShowHistoryAction.0"), Messages.getString("ShowHistoryAction.1") + e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- setSelection(selection);
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].isVirtual()) {
- IResource resource = getHostResource(elements[i]);
- if (resource == null || !resource.exists()) {
- action.setEnabled(false);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
deleted file mode 100644
index 628b942632..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
+++ /dev/null
@@ -1,94 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class ShowInNavigatorAction extends JsElementActionProxy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- private IResource getHostResource(IJavaScriptElement virtualElement) {
- IProject project = virtualElement.getJavaScriptProject().getProject();
- IPath path = new Path(virtualElement.getHostPath().getPath());
- IResource host = project.getWorkspace().getRoot().findMember(path);
- return host;
- }
-
-
- public void run(IAction action) {
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements == null || elements.length == 0) {
- return;
- }
- IResource resource = null;
- if (elements[0].isVirtual()) {
- resource = getHostResource(elements[0]);
- } else {
- resource = elements[0].getResource();
- }
- if (resource == null) {
- return;
- }
- try {
- IWorkbenchPage page = targetWorkbenchPart.getSite().getPage();
- IViewPart view = page.showView(IPageLayout.ID_RES_NAV);
- if (view instanceof ISetSelectionTarget) {
- ISelection selection = new StructuredSelection(resource);
- ((ISetSelectionTarget) view).selectReveal(selection);
- }
- } catch (PartInitException e) {
- ExceptionHandler.handle(e, targetWorkbenchPart.getSite().getShell(), Messages.getString("ShowInNavigatorAction.0"), Messages.getString("ShowInNavigatorAction.1") + e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- setSelection(selection);
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].isVirtual()) {
- IResource resource = getHostResource(elements[i]);
- if (resource == null || !resource.exists()) {
- action.setEnabled(false);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
deleted file mode 100644
index 799ea1f01d..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
+++ /dev/null
@@ -1,120 +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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.ui.packageview.PackageExplorerPart;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class ShowInScriptExplorerAction extends JsElementActionProxy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- private IResource getHostResource(IJavaScriptElement virtualElement) {
- IProject project = virtualElement.getJavaScriptProject().getProject();
- IPath path = new Path(virtualElement.getHostPath().getPath());
- IResource host = project.getWorkspace().getRoot().findMember(path);
- return host;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgs(org.eclipse.jface.action.IAction)
- */
-
- public Object[] getRunArgs(IAction action) {
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements != null && elements.length > 0) {
- return new Object[] { elements[0] };
- }
- return new Object[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.actions.JsElementActionProxy#getRunArgTypes()
- */
-
- public Class[] getRunArgTypes() {
- return new Class[] { IJavaScriptElement.class };
- }
-
-
- public void run(IAction action) {
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- if (elements == null || elements.length == 0) {
- return;
- }
- IResource resource = null;
- if (elements[0].isVirtual()) {
- resource = getHostResource(elements[0]);
- } else {
- resource = elements[0].getResource();
- }
- if (resource == null) {
- return;
- }
- try {
- PackageExplorerPart view = PackageExplorerPart.openInActivePerspective();
- view.tryToReveal(resource);
-// IWorkbenchPage page= targetWorkbenchPart.getSite().getPage();
-// IViewPart view= page.showView(IPageLayout.ID_RES_NAV);
- if (view instanceof ISetSelectionTarget) {
- ISelection selection = new StructuredSelection(resource);
- ((ISetSelectionTarget) view).selectReveal(selection);
- }
- } catch (Exception e) {
- // ExceptionHandler.handle(e,
- // targetWorkbenchPart.getSite().getShell(), "Error Opening in
- // Script View", "Error while displaying element in Script View:\n"
- // + e);
- }
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- setSelection(selection);
- IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].isVirtual()) {
- IResource resource = getHostResource(elements[i]);
- if (resource == null || !resource.exists()) {
- action.setEnabled(false);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
deleted file mode 100644
index 3d24b703fa..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
+++ /dev/null
@@ -1,199 +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.wst.jsdt.web.ui.actions;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class SimpleJSDTActionProxy implements IObjectActionDelegate {
- public static Object executeMethod(Object handler, String methodName, Class[] paramaterTypes, Object[] paramaterValues) throws SecurityException,
- NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
- Class target = handler.getClass();
- Method m = target.getMethod(methodName, paramaterTypes);
- return m.invoke(handler, paramaterValues);
- }
-
- public static JsJfaceNode[] getJsJfaceNodesFromSelection(ISelection selection) {
- if (selection == null) {
- return new JsJfaceNode[0];
- }
- ArrayList elements = new ArrayList();
- if (selection instanceof IStructuredSelection) {
- Iterator itt = ((IStructuredSelection) selection).iterator();
- while (itt.hasNext()) {
- Object element = itt.next();
- if (element instanceof JsJfaceNode) {
- elements.add(element);
- }
- }
- return (JsJfaceNode[]) elements.toArray(new JsJfaceNode[elements.size()]);
- }
- return new JsJfaceNode[0];
- }
- protected Object actionHandlerTarget;
- private ISelection currentSelection;
- protected IAction handlerTargetAction;
- protected IWorkbenchPart targetWorkbenchPart;
-
- public SimpleJSDTActionProxy() {}
-
- /*
- * Most handlers look for WorkBenchSite, so we convert the WorkBenchPart to
- * WorkBenchSite for init
- */
- protected Object getActionHandler(IAction action) throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InstantiationException,
- InvocationTargetException {
- /* Target class is cached */
- if (handlerTargetAction == action && actionHandlerTarget != null) {
- return actionHandlerTarget;
- }
- Class target = null;
- String className = getActionHandlerClassName(action);
- try {
- target = Class.forName(className);
- } catch (ClassNotFoundException ex) {
- System.out.println("Error.. Class target of action handler not found: " + action);
- System.out.println(Messages.getString("SimpleJSDTActionProxy.0") + ex); //$NON-NLS-1$
- }
- // use the loaded class
- Class[] types = new Class[] { IWorkbenchSite.class };
- Constructor cons = target.getConstructor(types);
- Object[] args = new Object[] { targetWorkbenchPart.getSite() };
-
- actionHandlerTarget = cons.newInstance(args);
- handlerTargetAction = action;
- return actionHandlerTarget;
- }
-
- /*
- * Default way of determining the action handlers class name.. may be
- * subclassed/overridden
- */
- protected String getActionHandlerClassName(IAction action) {
- return action.getId();
- }
-
- public ISelection getCurrentSelection() {
- return currentSelection;
- }
-
- public Object[] getRunArgs(IAction action) {
- return new Object[] { getCurrentSelection() };
- }
-
- public Class[] getRunArgTypes() {
- return new Class[] { IStructuredSelection.class };
- }
-
- public Object[] getSelectionChangeArgs(IAction action, ISelection selection) {
- return new Object[] { getCurrentSelection() };
- }
-
- public Class[] getSelectionChangeArgTypes() {
- return new Class[] { IStructuredSelection.class };
- }
-
- /*
- * Generic reflection util method to execute a named method with unknown
- * paramaters on an object
- */
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- try {
- Object handler = getActionHandler(action);
- SimpleJSDTActionProxy.executeMethod(handler, "run", getRunArgTypes(), getRunArgs(action)); //$NON-NLS-1$
- } catch (IllegalArgumentException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (SecurityException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (IllegalAccessException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (NoSuchMethodException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InstantiationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InvocationTargetException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- currentSelection = selection;
- if(targetWorkbenchPart==null) return;
-
- try {
- Object handler = getActionHandler(action);
- SimpleJSDTActionProxy.executeMethod(handler, "selectionChanged", getSelectionChangeArgTypes(), getSelectionChangeArgs(action, selection)); //$NON-NLS-1$
- } catch (IllegalArgumentException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (SecurityException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (IllegalAccessException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (NoSuchMethodException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InstantiationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- } catch (InvocationTargetException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- }
-
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetWorkbenchPart = targetPart;
- }
-
- protected void setSelection(ISelection selection) {
- this.currentSelection = selection;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
deleted file mode 100644
index 75815ea255..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.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.wst.jsdt.web.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class SourceActionsAction implements IObjectActionDelegate {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- action.setEnabled(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
- * org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
deleted file mode 100644
index 8677ee4a68..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class StandardEditorActionsAction implements IObjectActionDelegate {
- private static final boolean APPEND_NEW_LINES_TO_COPY = true;
- protected static final String COPY = "org.eclipse.wst.jsdt.web.ui.copy"; //$NON-NLS-1$
- protected static final String CUT = "org.eclipse.wst.jsdt.web.ui.cut"; //$NON-NLS-1$
- protected static final String DELETE = "org.eclipse.wst.jsdt.web.ui.delete"; //$NON-NLS-1$
- private static final char NEW_LINE = '\n';
- protected static final String PASTE_AFTER = "org.eclipse.wst.jsdt.web.ui.paste.after"; //$NON-NLS-1$
- protected static final String PASTE_BEFORE = "org.eclipse.wst.jsdt.web.ui.paste.before"; //$NON-NLS-1$
- protected ISelection selection;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- private void copy(IAction action) {
- JsJfaceNode[] nodes = parseSelection();
- if (nodes == null || nodes.length == 0) {
- return;
- }
- Clipboard clipboard = null;
- StringBuffer text = new StringBuffer();
- if (StandardEditorActionsAction.APPEND_NEW_LINES_TO_COPY) {
- text.append(StandardEditorActionsAction.NEW_LINE);
- }
- try {
- for (int i = 0; i < nodes.length; i++) {
- JsJfaceNode currentNode = nodes[i];
- int start = currentNode.getStartOffset();
- int length = currentNode.getLength();
- IStructuredDocument doc = currentNode.getStructuredDocument();
- try {
- String elementText = doc.get(start, length);
- text.append(elementText);
- } catch (BadLocationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- }
- if (StandardEditorActionsAction.APPEND_NEW_LINES_TO_COPY) {
- text.append(StandardEditorActionsAction.NEW_LINE);
- }
- clipboard = new Clipboard(Display.getCurrent());
- clipboard.setContents(new Object[] { text.toString() }, new Transfer[] { TextTransfer.getInstance() });
- }
- } finally {
- if (clipboard != null) {
- clipboard.dispose();
- }
- }
- }
-
- private void delete(IAction action) {
- JsJfaceNode[] nodes = parseSelection();
- if (nodes == null || nodes.length == 0) {
- return;
- }
- IStructuredDocument lastDoc = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- try {
- int start;
- int length;
- for (int i = 0; i < nodes.length; i++) {
- JsJfaceNode currentNode = nodes[i];
- start = currentNode.getStartOffset();
- length = currentNode.getLength();
- IStructuredDocument doc = currentNode.getStructuredDocument();
- if (doc != lastDoc) {
- lastDoc = doc;
- if (model != null) {
- model.endRecording(action);
- model.changedModel();
- model.releaseFromEdit();
- }
- if (modelManager != null) {
- model = modelManager.getExistingModelForEdit(doc);
- model.aboutToChangeModel();
- model.beginRecording(action, "Delete JavaScript Element", "Delete JavaScript Element");
- }
- }
- doc.replaceText(action, start, length, ""); //$NON-NLS-1$
- }
- model.endRecording(action);
- } catch (Exception e) {
- System.out.println(Messages.getString("StandardEditorActionsAction.8") + e); //$NON-NLS-1$
- } finally {
- if (model != null) {
- model.changedModel();
- model.releaseFromEdit();
- }
- }
- }
-
- private JsJfaceNode[] parseSelection() {
- if (selection == null) {
- return new JsJfaceNode[0];
- }
- ArrayList elements = new ArrayList();
- if (selection instanceof IStructuredSelection) {
- Iterator itt = ((IStructuredSelection) selection).iterator();
- while (itt.hasNext()) {
- Object element = itt.next();
- if (element instanceof IJavaScriptElement) {
- elements.add(element);
- }
- if (element instanceof IJavaWebNode) {
- elements.add(element);
- }
- }
- return (JsJfaceNode[]) elements.toArray(new JsJfaceNode[elements.size()]);
- }
- return new JsJfaceNode[0];
- }
-
- private void paste(IAction action, boolean atEnd) {
- JsJfaceNode[] nodes = parseSelection();
- if (nodes == null || nodes.length == 0) {
- return;
- }
- int startOfPaste = -1;
- IStructuredDocument doc = null;
- /* Figure out where to paste the content */
- if (atEnd) {
- for (int i = 0; i < nodes.length; i++) {
- if ((nodes[i].getStartOffset() + nodes[i].getLength()) > startOfPaste) {
- startOfPaste = (nodes[i].getStartOffset() + nodes[i].getLength());
- doc = nodes[i].getStructuredDocument();
- }
- }
- } else {
- for (int i = 0; i < nodes.length; i++) {
- if ((nodes[i].getStartOffset() < startOfPaste || startOfPaste < 0)) {
- startOfPaste = nodes[i].getStartOffset();
- doc = nodes[i].getStructuredDocument();
- }
- }
- }
- Clipboard clipboard = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- try {
- clipboard = new Clipboard(Display.getCurrent());
- String pasteString = (String) clipboard.getContents(TextTransfer.getInstance());
- model = modelManager.getExistingModelForEdit(doc);
- model.aboutToChangeModel();
- model.beginRecording(action, Messages.getString("StandardEditorActionsAction.9") + (atEnd ? Messages.getString("StandardEditorActionsAction.10") : Messages.getString("StandardEditorActionsAction.11")) + Messages.getString("StandardEditorActionsAction.12"), Messages.getString("StandardEditorActionsAction.13") + (atEnd ? Messages.getString("StandardEditorActionsAction.14") : Messages.getString("StandardEditorActionsAction.15")) + Messages.getString("StandardEditorActionsAction.16")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
- doc.replaceText(action, startOfPaste, 0, pasteString);
- } finally {
- if (clipboard != null) {
- clipboard.dispose();
- }
- if (model != null) {
- model.endRecording(action);
- model.changedModel();
- model.releaseFromEdit();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (action.getId().equals(StandardEditorActionsAction.CUT)) {
- copy(action);
- delete(action);
- } else if (action.getId().equals(StandardEditorActionsAction.COPY)) {
- copy(action);
- } else if (action.getId().equals(StandardEditorActionsAction.PASTE_BEFORE)) {
- paste(action, false);
- } else if (action.getId().equals(StandardEditorActionsAction.PASTE_AFTER)) {
- paste(action, true);
- } else if (action.getId().equals(StandardEditorActionsAction.DELETE)) {
- delete(action);
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
deleted file mode 100644
index c89b7618ee..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
+++ /dev/null
@@ -1,28 +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
-###############################################################################
-StandardEditorActionsAction.8=Error in Standard Editor Action :
-StandardEditorActionsAction.9=Insert Text
-StandardEditorActionsAction.10=before
-StandardEditorActionsAction.11=after
-StandardEditorActionsAction.12=\ a JavaScript Element.
-StandardEditorActionsAction.13=Insert Text
-StandardEditorActionsAction.14=before
-StandardEditorActionsAction.15=after
-StandardEditorActionsAction.16=\ a JavaScript Element.
-SimpleJSDTActionProxy.0=Exception :
-ShowHistoryAction.0=Error Opening in Script View
-ShowHistoryAction.1=Error while displaying element in Script View:\n
-ShowInNavigatorAction.0=Error Opening in Script View
-ShowInNavigatorAction.1=Error while displaying element in Script View:\n
-AddJavaDocStubAction.0=JavaScript Doc
-AddJavaDocStubAction.1=Error while adding comment
-AddJavaDocStubOperation.0=Generate JsDoc
-AddJavaDocStubOperation.1=Generate JsDoc
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/contentassist/JSDTAutoActivationDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/contentassist/JSDTAutoActivationDelegate.java
deleted file mode 100644
index 695a37497a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/contentassist/JSDTAutoActivationDelegate.java
+++ /dev/null
@@ -1,88 +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.wst.jsdt.web.ui.contentassist;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-import org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate;
-
-/**
- * <p>Used to provide auto activation characters to the content assist framework for JS regions in web pages
- * based on the JS auto activation character preferences.</p>
- *
- */
-public class JSDTAutoActivationDelegate extends AutoActivationDelegate implements IPropertyChangeListener {
-
- /** auto activation characters */
- private char[] fCompletionPropoaslAutoActivationCharacters;
-
- /**
- * <p>Default constructor needed because this class is instantiated by extension point.</p>
- */
- public JSDTAutoActivationDelegate() {
- getPreferenceStore().addPropertyChangeListener(this);
-
- //get the current user preference
- getAutoActivationCharacterPreferences();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return this.fCompletionPropoaslAutoActivationCharacters;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate#dispose()
- */
- public void dispose() {
- getPreferenceStore().removePropertyChangeListener(this);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
- * org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if(property.equals(PreferenceConstants.CODEASSIST_AUTOACTIVATION) ||
- property.equals(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA)) {
-
- getAutoActivationCharacterPreferences();
- }
- }
-
- /**
- * @return the associated preference store
- */
- private IPreferenceStore getPreferenceStore() {
- return PreferenceConstants.getPreferenceStore();
- }
-
- /**
- * <p>Gets the auto activation character user preferences for Javascript and stores them for later use</p>
- */
- private void getAutoActivationCharacterPreferences() {
- IPreferenceStore store = getPreferenceStore();
-
- boolean doAuto = store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
- if (doAuto) {
- fCompletionPropoaslAutoActivationCharacters =
- store.getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA).toCharArray();
- } else {
- fCompletionPropoaslAutoActivationCharacters = null;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
deleted file mode 100644
index 7d1af51520..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
+++ /dev/null
@@ -1,25 +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.jsdt.web.ui.internal;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public interface IActionConstantsJs {
- public final static String ACTION_NAME_MOVE_ELEMENT = "MoveElement"; //$NON-NLS-1$
- public final static String ACTION_NAME_RENAME_ELEMENT = "RenameElement"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
deleted file mode 100644
index 91616817f8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
+++ /dev/null
@@ -1,28 +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.jsdt.web.ui.internal;
-
-import org.eclipse.wst.jsdt.ui.actions.IJavaEditorActionDefinitionIds;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public interface IActionDefinitionIdsJs {
- public final static String MOVE_ELEMENT = IJavaEditorActionDefinitionIds.MOVE_ELEMENT;
- public final static String RENAME_ELEMENT = IJavaEditorActionDefinitionIds.RENAME_ELEMENT;
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
deleted file mode 100644
index 2cb5d2733c..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
+++ /dev/null
@@ -1,87 +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
-###############################################################################
-## The following line is a sample JSP document. Please translate only the following parts:
-## Use below tags ONLY for JSP 1.1
-## Welcome!
-## Use below tags ONLY for JSP 1.2
-## Welcome!
-Sample_JSP_doc=<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>
-JSP_Delimiters_UI_=JSP Delimiters
-Refactor_label=Refactor
-RenameElement_label=Rename
-MoveElement_label=Move
-MoveElementWizard=Move the selected elements
-#
-OK=OK
-JSP_changes=JSP changes
-ActionContributorJSP_0=Refa&ctor
-JSPRenameElementAction_0=Editor selection does not resolve to a renamable Java element
-JSPMoveElementAction_0=Editor selection does not resolve to movable Java elements
-BasicRefactorSearchRequestor_0=JSP Rename
-BasicRefactorSearchRequestor_1=in file: {0} line: {1}
-BasicRefactorSearchRequestor_2=Move Type ''{0}'' to package ''{1}''
-BasicRefactorSearchRequestor_3=Rename Method ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_4=Rename Type ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_5=Rename Package ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_6=JSP Rename Change
-#
-_UI_WIZARD_NEW_TITLE = New JavaServer Page
-_UI_WIZARD_NEW_HEADING = JavaServer Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new JavaServer Page.
-_ERROR_FILENAME_MUST_END_JSP = The file name must end in one of the following extensions {0}.
-_WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT = JavaServer Pages created in projects that do not support Java might not work as expected.
-_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application.
-ResourceGroup_nameExists = The same name already exists.
-NewJSPTemplatesWizardPage_0=Select JSP Template
-NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
-NewJSPTemplatesWizardPage_2=Name
-NewJSPTemplatesWizardPage_3=Description
-NewJSPTemplatesWizardPage_4=Use JSP Template
-NewJSPTemplatesWizardPage_5=Preview
-NewJSPTemplatesWizardPage_6=Templates are 'New JSP' templates found in the <a>JSP Templates</a> preference page.
-# Copied from sse.ui
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_description=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_description=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
-OccurrencesSearchQuery_2=file
-Content_Assist_not_availab_UI_=Content Assist not available at the current location
-Java_Content_Assist_is_not_UI_=Java Content Assist is not available for the current cursor location
-#
-Override_method_in=Override method in '
-Creating_files_encoding=Creating files encoding preference
-#
-JSPSourcePreferencePage_0=JSP Source preferences are based on the content within the JSP.
-JSPSourcePreferencePage_1=See <a>''{0}''</a> for JSP with HTML content.
-JSPSourcePreferencePage_2=See <a>''{0}''</a> for JSP with XML content.
-JSPColorPage_jsp_content=JSP Content
-JSPFilesPreferencePage_0=Validating files
-JSPFilesPreferencePage_1=Validate JSP fragments
-# JSP Fragments
-JSPFContentSettingsPropertyPage_0=none
-JSPFContentSettingsPropertyPage_1=The properties used instead of the page directive that cannot be specified in JSP fragment files. The project setting is used if you specify "none."
-JSPFContentSettingsPropertyPage_2=Language:
-JSPFContentSettingsPropertyPage_3=Content Type:
-JSPFContentSettingsPropertyPage_4=Enable specific setting:
-ProjectJSPFContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular JSP fragment file.
-# CSS JSP
-Title_InvalidValue=Invalid Value
-Message_InvalidValue=Invalid property value.
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
deleted file mode 100644
index fbd9cf896f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
+++ /dev/null
@@ -1,110 +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 - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
-
- */
-public class JsUIMessages extends NLS {
- public static String _ERROR_FILENAME_MUST_END_JSP;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT;
- public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
- public static String ActionContributorJSP_0;
- public static String AddBlockComment_description; // resource bundle
- public static String AddBlockComment_label; // resource bundle
- public static String AddBlockComment_tooltip; // resource bundle
- 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;
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.internal.JSPUIPluginResources";//$NON-NLS-1$
- public static String CleanupDocument_description; // resource bundle
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String Content_Assist_not_availab_UI_;
- public static String Creating_files_encoding;
- public static String FindOccurrences_label; // resource bundle
- private static ResourceBundle fResourceBundle;
- public static String Java_Content_Assist_is_not_UI_;
- public static String JSP_changes;
- public static String JSP_Delimiters_UI_;
- public static String JSPColorPage_jsp_content;
- 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 JSPFilesPreferencePage_0;
- public static String JSPFilesPreferencePage_1;
- public static String JSPMoveElementAction_0;
- public static String JSPRenameElementAction_0;
- public static String JSPSourcePreferencePage_0;
- public static String JSPSourcePreferencePage_1;
- public static String JSPSourcePreferencePage_2;
- public static String Message_InvalidValue;
- public static String MoveElement_label; // resource bundle
- public static String MoveElementWizard;
- 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 OccurrencesSearchQuery_0;
- public static String OccurrencesSearchQuery_2;
- public static String OK;
- public static String Override_method_in;
- public static String ProjectJSPFContentSettingsPropertyPage_0;
- public static String Refactor_label;
- public static String RemoveBlockComment_description; // resource bundle
- public static String RemoveBlockComment_label; // resource bundle
- public static String RemoveBlockComment_tooltip; // resource bundle
- public static String RenameElement_label; // resource bundle
- public static String ResourceGroup_nameExists;
- public static String Sample_JSP_doc;
- public static String Title_InvalidValue;
- public static String ToggleComment_description; // resource bundle
- public static String ToggleComment_label; // resource bundle
- public static String ToggleComment_tooltip; // resource bundle
- static {
- // load message values from bundle file
- NLS.initializeMessages(JsUIMessages.BUNDLE_NAME, JsUIMessages.class);
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (JsUIMessages.fResourceBundle == null) {
- JsUIMessages.fResourceBundle = ResourceBundle.getBundle(JsUIMessages.BUNDLE_NAME);
- }
- } catch (MissingResourceException x) {
- JsUIMessages.fResourceBundle = null;
- }
- return JsUIMessages.fResourceBundle;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
deleted file mode 100644
index 70b836d4b3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
+++ /dev/null
@@ -1,115 +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.jsdt.web.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-import org.osgi.framework.BundleContext;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.jsdt.web.ui"; //$NON-NLS-1$
- protected static JsUIPlugin instance = null;
-
- public static JsUIPlugin getDefault() {
- return JsUIPlugin.instance;
- }
-
- public synchronized static JsUIPlugin getInstance() {
- return JsUIPlugin.instance;
- }
- /**
- * The template context type registry for the jsp editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
- /**
- * The template store for the jsp editor.
- */
- private TemplateStore fTemplateStore;
-
- public JsUIPlugin() {
- super();
- JsUIPlugin.instance = this;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
- }
-
- /**
- * Returns the template context type registry for the jsp plugin.
- *
- * @return the template context type registry for the jsp plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
-// ContributionContextTypeRegistry registry = new
-// ContributionContextTypeRegistry();
-// registry.addContextType(TemplateContextTypeIdsJSP.ALL);
-// registry.addContextType(TemplateContextTypeIdsJSP.NEW);
-// registry.addContextType(TemplateContextTypeIdsJSP.TAG);
-// registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE);
-// registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
- fContextTypeRegistry = JavaScriptPlugin.getDefault().getCodeTemplateContextRegistry();
- }
- return fContextTypeRegistry;
- }
-
- /**
- * 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);
- JavaScriptPlugin jp = JavaScriptPlugin.getDefault();
- fTemplateStore = jp.getTemplateStore();
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- instance = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
deleted file mode 100644
index f79c751d2f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
+++ /dev/null
@@ -1,156 +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.jsdt.web.ui.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Logger {
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + Logger.ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + Logger.INFO;
- public static final int OK = IStatus.OK; // 0
- public static final int OK_DEBUG = 200 + Logger.OK;
- private static final String PLUGIN_ID = "org.eclipse.wst.jsdt.web.ui"; //$NON-NLS-1$
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + Logger.WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == Logger.OK_DEBUG || level == Logger.INFO_DEBUG || level == Logger.WARNING_DEBUG || level == Logger.ERROR_DEBUG) {
- if (!Logger.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, Logger.PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(Logger.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 (Logger.isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, Logger.PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(Logger.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 (!Logger.isDebugging()) {
- return false;
- }
- String traceFilter = Platform.getDebugOption(Logger.PLUGIN_ID + Logger.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) {
- Logger._log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- Logger._log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- Logger._log(Logger.ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- Logger._log(Logger.ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- Logger._trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- Logger._trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- Logger._trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
deleted file mode 100644
index 9c1f97c21f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui.internal.autoedit;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.ui.text.java.JavaAutoIndentStrategy;
-import org.eclipse.wst.jsdt.internal.ui.text.java.SmartSemicolonAutoEditStrategy;
-import org.eclipse.wst.jsdt.internal.ui.text.javadoc.JavaDocAutoIndentStrategy;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class AutoEditStrategyForJs implements IAutoEditStrategy {
- private IAutoEditStrategy[] fStrategies;
-
- public AutoEditStrategyForJs() {
- super();
- }
-
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- IAutoEditStrategy[] strats = getAutoEditStrategies(document);
- for (int i = 0; i < strats.length; i++) {
- strats[i].customizeDocumentCommand(document, command);
- }
- }
-
- public IAutoEditStrategy[] getAutoEditStrategies(IDocument document) {
- if (fStrategies != null) {
- return fStrategies;
- }
- String partitioning = IHTMLPartitions.SCRIPT;
- fStrategies = new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning),
- new JavaAutoIndentStrategy(partitioning, getJavaProject(document), null), new JavaDocAutoIndentStrategy(partitioning) };
- /* new AutoEditStrategyForTabs() */
- return fStrategies;
- }
-
- private IJavaScriptProject getJavaProject(IDocument document) {
- IDOMModel model = null;
- IJavaScriptProject javaProject = null;
- try {
- model = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
- String baseLocation = model.getBaseLocation();
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = new Path(baseLocation);
- IProject project = null;
- if (filePath.segmentCount() > 0) {
- project = root.getProject(filePath.segment(0));
- }
- if (project != null) {
- javaProject = JavaScriptCore.create(project);
- }
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return javaProject;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index 50ab442d0b..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,187 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-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);
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
deleted file mode 100644
index c32f660214..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-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.swt.graphics.Point;
-import org.eclipse.wst.jsdt.internal.ui.text.java.JavaCompletionProposal;
-import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaCompletionProposal;
-import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaTypeCompletionProposal;
-import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTCompletionProposal extends JavaCompletionProposal implements IJavaCompletionProposal {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
- *
- * This is a wrapped proposal so we don't need to make "slow" calls to the
- * java proposal up front, only when needed for example, getAdditionalInfo()
- * reads external javadoc, and it makes no sense
- */
- ICompletionProposal fJavaCompletionProposal = null;
-
- public JSDTCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image,
- String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance,
- boolean updateReplacementLengthOnValidate) {
- super(replacementString, replacementOffset, replacementLength, image, displayString, relevance);
- super.setCursorPosition(cursorPosition);
- super.setContextInformation(contextInformation);
-// super(replacementString, replacementOffset, replacementLength,
-// cursorPosition, image, displayString, contextInformation,
-// additionalProposalInfo, relevance,
-// updateReplacementLengthOnValidate);
- }
-
- /**
- * <p>Uses the wrapped proposal if its lazy</p>
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
- ((LazyJavaCompletionProposal) this.fJavaCompletionProposal).apply(viewer, trigger, stateMask, offset);
- }
- else {
- super.apply(viewer, trigger, stateMask, offset);
- }
- }
-
- /**
- * <p>Uses the wrapped proposal if its lazy</p>
- *
- * @return the selection after the proposal has been applied
- */
- public Point getSelection(IDocument document) {
- Point selection;
- if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
- selection = this.fJavaCompletionProposal.getSelection(document);
- }
- else {
- selection = super.getSelection(document);
- }
- return selection;
- }
-
- public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
- Object additionalInfo = super.getAdditionalProposalInfo(monitor);
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if ((javaProposal != null) && (javaProposal instanceof ICompletionProposalExtension5)) {
- additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
- }
- return additionalInfo;
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if (javaProposal != null) {
- additionalInfo = javaProposal.getAdditionalProposalInfo();
- }
- return additionalInfo;
- }
-
- final public ICompletionProposal getJavaCompletionProposal() {
- return fJavaCompletionProposal;
- }
-
- final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
- fJavaCompletionProposal = javaCompletionProposal;
- }
-
- protected boolean isValidPrefix(String prefix) {
- if (this.fJavaCompletionProposal instanceof LazyJavaTypeCompletionProposal) {
- return ((LazyJavaTypeCompletionProposal) this.fJavaCompletionProposal).isValidTypePrefix(prefix);
- }
- return super.isValidPrefix(prefix);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
deleted file mode 100644
index ee92dd9eee..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.jsdt.core.CompletionProposal;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-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.ui.internal.contentassist.AbstractContentAssistProcessor;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTContentAssistant extends AbstractContentAssistProcessor implements ICompletionProposalComputer {
- private JSDTContentAssistantProcessor fContentAssistProcessor;
- private JSDTTemplateAssistProcessor fTemplateAssistProcessor;
- private JSDTHtmlCompletionProcessor fHhtmlcomp;
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
- Vector proposals = new Vector();
- ICompletionProposal[] completionProposals;
- ICompletionProposal endScript = getHtmlContentAssistProcessor().getEndScriptProposal(viewer, documentPosition);
- if(endScript!=null) {
- return new ICompletionProposal[] {endScript};
- //proposals.add(endScript);
- }
- JSDTProposalCollector theCollector = getProposalCollector(viewer, documentPosition);
- /* add end script tag if needed */
-
- /* --------- Content Assistant --------- */
- if(theCollector==null) return new ICompletionProposal[0];
-
- getContentAssistProcessor().setProposalCollector(theCollector);
- completionProposals = getContentAssistProcessor().computeCompletionProposals(viewer, documentPosition);
- proposals.addAll(Arrays.asList(completionProposals));
- /* HTML Proposals */
- completionProposals = getHtmlContentAssistProcessor().computeCompletionProposals(viewer, documentPosition);
- proposals.addAll(Arrays.asList(completionProposals));
- /* --------- template completions --------- */
- getTemplateCompletionProcessor().setProposalCollector(theCollector);
- completionProposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
- proposals.addAll(Arrays.asList(completionProposals));
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[0]);
- }
-
- private JSDTHtmlCompletionProcessor getHtmlContentAssistProcessor() {
- if (fHhtmlcomp == null) {
- fHhtmlcomp = new JSDTHtmlCompletionProcessor();
- }
- return fHhtmlcomp;
- }
-
- private JSDTContentAssistantProcessor getContentAssistProcessor() {
- if (fContentAssistProcessor == null) {
- fContentAssistProcessor = new JSDTContentAssistantProcessor();
- }
- return fContentAssistProcessor;
- }
- private IJsTranslation getJSPTranslation(ITextViewer viewer, int offset) {
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
- IDOMDocument xmlDoc = xmlModel.getDocument();
-
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-
- if (translationAdapter != null) {
- return translationAdapter.getJsTranslation(true);
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return null;
- }
-
- protected JSDTProposalCollector getProposalCollector(ITextViewer viewer, int offset) {
- IJsTranslation tran = getJSPTranslation(viewer, offset);
- if(tran==null) return null;
- return new JSDTProposalCollector(tran);
- }
-
- private JSDTTemplateAssistProcessor getTemplateCompletionProcessor() {
- if (fTemplateAssistProcessor == null) {
- fTemplateAssistProcessor = new JSDTTemplateAssistProcessor();
- }
- return fTemplateAssistProcessor;
- }
-
- public void sessionStarted() {
- // TODO Auto-generated method stub
-
- }
-
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
- Vector proposals = new Vector();
- ICompletionProposal[] completionProposals;
- ICompletionProposal endScript = getHtmlContentAssistProcessor().getEndScriptProposal(context.getViewer(), context.getInvocationOffset());
- if(endScript!=null) {
- return new ArrayList(0);
- //proposals.add(endScript);
- }
- JSDTProposalCollector theCollector = getProposalCollector(context.getViewer(), context.getInvocationOffset());
- /* add end script tag if needed */
-
- theCollector.setAllowsRequiredProposals(CompletionProposal.CONSTRUCTOR_INVOCATION, CompletionProposal.TYPE_REF, true);
-
- /* --------- Content Assistant --------- */
- if(theCollector==null) return new ArrayList(0);
-
- getContentAssistProcessor().setProposalCollector(theCollector);
- completionProposals = getContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
- proposals.addAll(Arrays.asList(completionProposals));
- /* HTML Proposals */
- completionProposals = getHtmlContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
- proposals.addAll(Arrays.asList(completionProposals));
- /* --------- template completions --------- */
- getTemplateCompletionProcessor().setProposalCollector(theCollector);
- completionProposals = getTemplateCompletionProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
- proposals.addAll(Arrays.asList(completionProposals));
- return proposals;
- }
-
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
- return Arrays.asList(computeContextInformation(context.getViewer(), context.getInvocationOffset()));
- }
-
- public void sessionEnded() {
- fContentAssistProcessor = null;
- fTemplateAssistProcessor = null;
- fHhtmlcomp = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
deleted file mode 100644
index 29b5e2624b..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.osgi.framework.Bundle;
-
-/**
- * Provisional API: This class/interface is part of an interim API that is
- * still under development and expected to change significantly before
- * reaching stability. It is being made available at this early stage to
- * solicit feedback from pioneering adopters on the understanding that any
- * code that uses this API will almost certainly be broken (repeatedly) as the
- * API evolves.
- *
- * This class is not intended to be subclassed.
- */
-public class JSDTContentAssistantProcessor extends AbstractContentAssistProcessor {
- private static final String JSDT_CORE_PLUGIN_ID = "org.eclipse.wst.jsdt.core"; //$NON-NLS-1$
-// static {
-// String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
-// //DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-// }
- protected String fErrorMessage = null;
- protected int fJspSourcePosition, fJavaPosition;
- private JSDTProposalCollector fProposalCollector;
- protected ITextViewer fViewer = null;
-
- public JSDTContentAssistantProcessor() {
- super();
- }
-
- /**
- * 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);
- JSDTProposalCollector collector = null;
- IDOMModel xmlModel = null;
- try {
- fViewer = viewer;
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-
- if (translationAdapter != null) {
- IJsTranslation translation = translationAdapter.getJsTranslation(true);
- fJavaPosition = getDocumentPosition();
- try {
- IJavaScriptUnit 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();
- 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 = JsUIMessages.Java_Content_Assist_is_not_UI_;
- }
- }
- return results;
- }
-
- /**
- * 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;
- }
-
- protected JSDTProposalCollector getProposalCollector() {
- return fProposalCollector;
- // return new JSPProposalCollector(translation);
- }
-
- /**
- * 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(JSDTContentAssistantProcessor.JSDT_CORE_PLUGIN_ID);
- bundle.loadClass("dummyClassNameThatShouldNeverExist"); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- // this is the expected result, we just want to
- // nudge the bundle to be sure its activated.
- }
- }
-
- public void setProposalCollector(JSDTProposalCollector translation) {
- this.fProposalCollector = translation;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
deleted file mode 100644
index dcd07a86c0..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTContetAssistInvocationContext extends JavaContentAssistInvocationContext {
- public static JSDTContetAssistInvocationContext getInstance(ITextViewer viewer, int offset, JSDTProposalCollector theCollector) {
- JSDTContetAssistInvocationContext.getJSPTranslation(viewer);
- return new JSDTContetAssistInvocationContext(viewer, offset, theCollector);
- }
-
- private static IJsTranslation getJSPTranslation(ITextViewer viewer) {
- IJsTranslation fTranslation = null;
-
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (fTranslationAdapter != null) {
- fTranslation = fTranslationAdapter.getJsTranslation(true);
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return fTranslation;
- }
- ITextViewer viewer;
-
- private JSDTContetAssistInvocationContext(ITextViewer viewer, int offset, JSDTProposalCollector theCollector) {
- super(viewer, offset, null);
- this.viewer = viewer;
- // this.offset=getJSPTranslation().getJavaOffset(offset);
- // CompletionProposalCollector theCollector = getProposalCollector();
- super.setCollector(theCollector);
- }
-
-// public IDocument getDocument() {
-// return
-// ((JSPTranslationExtension)getJSPTranslation(viewer)).getJavaDocument();
-//
-// }
-// protected CompletionProposalCollector getProposalCollector() {
-//
-// return ((CompletionProposalCollector) ( new JSPProposalCollector(
-// getJSPTranslation()) ));
-// }
-
- public IDocument getDocument() {
- return viewer.getDocument();
- }
-// public IJavaScriptUnit getCompilationUnit() {
-// return getJSPTranslation(viewer).getCompilationUnit();
-// }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
deleted file mode 100644
index 21727a6cff..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.internal.contentassist;
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTHtmlCompletionProcessor {
-
- public JSDTHtmlCompletionProcessor() {}
-
-
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- /* add </script if necisary */
- ArrayList allProposals = new ArrayList();
- getJSPTranslation(viewer);
-
- return (ICompletionProposal[])allProposals.toArray(new ICompletionProposal[allProposals.size()]);
- }
-
- public ICompletionProposal getEndScriptProposal(ITextViewer viewer, int offset) {
- /* add </script if necisary */
-
- IJsTranslation tran = getJSPTranslation(viewer);
- if(tran==null) return null;
-
- int missingAtOffset = tran.getMissingTagStart();
-
- if(offset>=missingAtOffset&& missingAtOffset>-1) {
-
- String allText = viewer.getDocument().get();
- String text = "</script>"; //$NON-NLS-1$
-
- int startInTag = -1;
-
- for(int i=0;i<text.length() && allText.length()>offset-1;i++) {
- if(allText.charAt(offset-1)==text.charAt(i)) {
- startInTag = i;
- break;
- }
- }
-
- if(startInTag==-1 ) {
- String displayText = Messages.getString("JSDTHtmlCompletionProcessor.1"); //$NON-NLS-1$
- return new CustomCompletionProposal("\n" + text + "\n" ,offset,0,offset,null,displayText,null,Messages.getString("JSDTHtmlCompletionProcessor.4"),100); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- String text1 = allText.substring(offset - startInTag - 1, offset).toLowerCase();
- String text2 = text.substring(0, startInTag+1).toLowerCase();
- if(startInTag>-1 && text2.compareTo(text1)==0 ) {
- String displayText = Messages.getString("JSDTHtmlCompletionProcessor.5"); //$NON-NLS-1$
- return new CustomCompletionProposal(text ,offset-startInTag-1,0,text.length(),null,displayText,null,Messages.getString("JSDTHtmlCompletionProcessor.6"),100); //$NON-NLS-1$
- }
-
- }
-
- return null;
- }
- private IJsTranslation getJSPTranslation(ITextViewer viewer) {
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
- IDOMDocument xmlDoc = xmlModel.getDocument();
-
- JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-
- if (fTranslationAdapter != null) {
- return fTranslationAdapter.getJsTranslation(true);
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
deleted file mode 100644
index 9f873f5289..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.CompletionProposal;
-import org.eclipse.wst.jsdt.core.Signature;
-import org.eclipse.wst.jsdt.ui.text.java.CompletionProposalCollector;
-import org.eclipse.wst.jsdt.ui.text.java.CompletionProposalComparator;
-import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTProposalCollector extends CompletionProposalCollector {
- static char[] getTypeTriggers() {
- return CompletionProposalCollector.TYPE_TRIGGERS;
- }
- private Comparator fComparator;
- private IJsTranslation fTranslation;
-
-// public List getGeneratedFunctionNames(){
-// if(fGeneratedFunctionNames==null){
-// fGeneratedFunctionNames = fTranslation.getGeneratedFunctionNames();
-// }
-// return fGeneratedFunctionNames;
-// }
- public JSDTProposalCollector(IJsTranslation translation) {
- super(translation!=null?translation.getCompilationUnit():null);
- if (translation == null) {
- throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
- }
- fTranslation = translation;
- }
-
- /**
- * Cacluates the where the cursor should be after applying this proposal.
- * eg. method(|) if the method proposal chosen had params.
- *
- * @param proposal
- * @param completion
- * @return
- */
- private int calculatePositionAfter(CompletionProposal proposal, String completion) {
- 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) {
- int paramCount = Signature.getParameterCount(proposal.getSignature());
- if (completion.length() > 0 && paramCount > 0) {
- positionAfter--;
- }
- }
- return positionAfter;
- }
-
- /**
- * 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) {
- return createJSDTProposal(proposal);
- }
-
- private JSDTCompletionProposal createJSDTProposal(CompletionProposal proposal) {
- JSDTCompletionProposal 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
- // cursor position after must be calculated
- int positionAfter = calculatePositionAfter(proposal, completion);
- // 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 JSDTCompletionProposal(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;
- }
-
- private Comparator getComparator() {
- if (fComparator == null) {
- fComparator = new CompletionProposalComparator();
- }
- return fComparator;
- }
-
- /**
- * Ensures that we only return JSPCompletionProposals.
- *
- * @return an array of JSPCompletionProposals
- */
- public JSDTCompletionProposal[] 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 JSDTCompletionProposal) {
- results.add(javaProposals[i]);
- }
- }
- Collections.sort(results, getComparator());
- return (JSDTCompletionProposal[]) results.toArray(new JSDTCompletionProposal[results.size()]);
- }
-
- public IJsTranslation getTranslation() {
- return fTranslation;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
deleted file mode 100644
index 1f9817875e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
+++ /dev/null
@@ -1,65 +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.wst.jsdt.web.ui.internal.contentassist;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.jsdt.internal.ui.text.java.TemplateCompletionProposalComputer;
-import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTTemplateAssistProcessor {
- TemplateCompletionProposalComputer fJavaTemplateCompletion;
- JSDTProposalCollector fProposalCollector;
- JsTranslationAdapter fTranslationAdapter;
- IProgressMonitor monitor;
-
- public JSDTTemplateAssistProcessor() {
- monitor = new NullProgressMonitor();
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- JavaContentAssistInvocationContext context = getInvocationContext(viewer, offset);
- List props = getTemplateCompletionProposalComputer().computeCompletionProposals(context, monitor);
- return (ICompletionProposal[]) props.toArray(new ICompletionProposal[] {});
- }
-
- private JavaContentAssistInvocationContext getInvocationContext(ITextViewer viewer, int offset) {
- return JSDTContetAssistInvocationContext.getInstance(viewer, offset, getProposalCollector());
- }
-
- protected JSDTProposalCollector getProposalCollector() {
- return fProposalCollector;
- // return new JSPProposalCollector(translation);
- }
-
- private TemplateCompletionProposalComputer getTemplateCompletionProposalComputer() {
- if (fJavaTemplateCompletion == null) {
- fJavaTemplateCompletion = new TemplateCompletionProposalComputer();
- }
- return fJavaTemplateCompletion;
- }
-
- public void setProposalCollector(JSDTProposalCollector translation) {
- this.fProposalCollector = translation;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
deleted file mode 100644
index d59e21666a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
+++ /dev/null
@@ -1,42 +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.wst.jsdt.web.ui.internal.contentassist;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.internal.contentassist.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
deleted file mode 100644
index fbdf80852c..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
+++ /dev/null
@@ -1,14 +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
-###############################################################################
-JSDTHtmlCompletionProcessor.1=<> end with </script>
-JSDTHtmlCompletionProcessor.4=Close the script tag.
-JSDTHtmlCompletionProcessor.5=<> end with </script>
-JSDTHtmlCompletionProcessor.6=Close the script tag.
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index e893d448c3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,70 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public abstract class SingleCharReader extends Reader {
- /**
- * 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();
- }
-
- /**
- * @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;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
deleted file mode 100644
index 7a9f5d9755..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
+++ /dev/null
@@ -1,81 +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.jsdt.web.ui.internal.editor;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML;
-import org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup;
-import org.eclipse.wst.jsdt.web.ui.internal.IActionConstantsJs;
-import org.eclipse.wst.jsdt.web.ui.internal.IActionDefinitionIdsJs;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class ActionContributorJSP extends ActionContributorHTML {
- private static final String[] EDITOR_IDS = { "org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor" }; //$NON-NLS-1$ //$NON-NLS-2$
- private RetargetTextEditorAction moveElementAction = null;
- private IMenuManager refactorMenu = null;
- private RetargetTextEditorAction renameElementAction = null;
-
- public ActionContributorJSP() {
- super();
- ResourceBundle bundle = JsUIMessages.getResourceBundle();
- this.renameElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJs.ACTION_NAME_RENAME_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
- this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJs.RENAME_ELEMENT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.renameElementAction, IHelpContextIds.JSP_REFACTORRENAME_HELPID);
- this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJs.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.UNDERSCORE);
- this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJs.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(JsUIMessages.ActionContributorJSP_0, RefactorActionGroup.MENU_ID);
- refactorMenu.add(this.renameElementAction);
- refactorMenu.add(this.moveElementAction);
- }
-
-
- protected void addToMenu(IMenuManager menu) {
- super.addToMenu(menu);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, this.refactorMenu);
- }
-
-
- protected String[] getExtensionIDs() {
- return ActionContributorJSP.EDITOR_IDS;
- }
-
-
- public void setActiveEditor(IEditorPart activeEditor) {
- super.setActiveEditor(activeEditor);
- this.renameElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJs.ACTION_NAME_RENAME_ELEMENT));
- this.moveElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJs.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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index c4418fb7d7..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,45 +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.jsdt.web.ui.internal.editor;
-
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IHelpContextIds {
- // JSP Fragment Property Page
- public static final String JSP_FRAGMENT_HELPID = IHelpContextIds.PREFIX + "jspf1000"; //$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 New File Wizard - Template Page
- public static final String JSP_NEWWIZARD_TEMPLATE_HELPID = IHelpContextIds.PREFIX + "jspw0010"; //$NON-NLS-1$
- // JSP Files Preference page
- public static final String JSP_PREFWEBX_FILES_HELPID = IHelpContextIds.PREFIX + "webx0050"; //$NON-NLS-1$
- // JSP Styles Preference page
- public static final String JSP_PREFWEBX_STYLES_HELPID = IHelpContextIds.PREFIX + "webx0051"; //$NON-NLS-1$
- // JSP Templates Preference page
- public static final String JSP_PREFWEBX_TEMPLATES_HELPID = IHelpContextIds.PREFIX + "webx0052"; //$NON-NLS-1$
- // Refactor Move
- public static final String JSP_REFACTORMOVE_HELPID = IHelpContextIds.PREFIX + "jspr0020"; //$NON-NLS-1$
- // JSP Source Editor Context Menu
- // Refactor Rename
- public static final String JSP_REFACTORRENAME_HELPID = IHelpContextIds.PREFIX + "jspr0010"; //$NON-NLS-1$
- // org.eclipse.wst.jsdt.web.ui.
- public static final String PREFIX = JsUIPlugin.ID + "."; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
deleted file mode 100644
index b295d824c5..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui.internal.format;
-
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.Region;
-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.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.internal.corext.util.CodeFormatterUtil;
-import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslator;
-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.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy {
- /** matches on //--> at end of script region */
- private static final Pattern END_PATTERN = Pattern.compile("((//.*-->\\s*)\\z)"); //$NON-NLS-1$
-
- private static final int regionStartIndentLevel = 1;
- /** 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();
- private int startIndentLevel;
-
- /**
- * Creates a new java formatting strategy.
- */
- public FormattingStrategyJSDT() {
- super();
- }
-
- class ModelIrritant implements IDocumentPartitioningListener {
- public ModelIrritant(IDocument attachedDoc) {}
-
- public void documentPartitioningChanged(IDocument document) {
- document.removeDocumentPartitioningListener(this);
- if (document instanceof BasicStructuredDocument) {
- try {
- ((BasicStructuredDocument) document).replace(0, document.getLength(), document.get());
- } catch (BadLocationException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
- */
-
- public void format() {
- super.format();
- final IStructuredDocument document = (IStructuredDocument) fDocuments.removeFirst();
- final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
-
- if (document != null) {
- //calculate the indent of the leading <script> tag because we need to add that indent level to the JS indent level
- IStructuredDocumentRegion scriptTagStartRegion = document.getRegionAtCharacterOffset(partition.offset-1);
- String scriptRegionIndent = ""; //$NON-NLS-1$
- if(scriptTagStartRegion != null) {
- try {
- int scriptRegionIndentLevel = getIndentOfLine(document,document.getLineOfOffset(scriptTagStartRegion.getStartOffset())).length();
- scriptRegionIndent = getIndentationString(getPreferences(), scriptRegionIndentLevel);
- this.startIndentLevel += scriptRegionIndentLevel;
- } catch (BadLocationException e) {
- Logger.logException("Could not calculate starting indent of the script region, using 0", e);//$NON-NLS-1$
- }
- }
-
- String lineDelim = TextUtilities.getDefaultLineDelimiter(document);
- try {
- //get the JS text from the document (not translated)
- String jsTextNotTranslated = document.get(partition.getOffset(), partition.getLength());
-
- //deal with getting the JS text and unwrapping it from any <!-- //--> statements
- String preText = "";
- String postText = lineDelim + scriptRegionIndent;
-
- //find start comment tag
- Pattern startPattern = Pattern.compile("(\\A(\\s*<!--.*(" + lineDelim + ")?))"); //$NON-NLS-1$
- Matcher matcher = startPattern.matcher(jsTextNotTranslated);
- if(matcher.find()) {
- jsTextNotTranslated = matcher.replaceFirst(""); //$NON-NLS-1$
- preText = lineDelim + scriptRegionIndent + matcher.group().trim();
- }
-
- //find end tag
- matcher = END_PATTERN.matcher(jsTextNotTranslated);
- if(matcher.find()) {
- jsTextNotTranslated = matcher.replaceFirst(""); //$NON-NLS-1$
- postText = lineDelim + scriptRegionIndent + matcher.group().trim() + postText;
- }
-
- //replace the text in the document with the none-translated JS text but without HTML leading and trailing comments
- TextEdit replaceEdit = new ReplaceEdit(partition.getOffset(), partition.getLength(), jsTextNotTranslated);
- replaceEdit.apply(document);
- int jsRegionLength = jsTextNotTranslated.length();
-
- //translate the updated document
- IJsTranslation translation = getTranslation(document);
- String jsTextTranslated = translation.getJsText();
-
- //format the text translated text
- TextEdit edit = CodeFormatterUtil.format2(CodeFormatter.K_JAVASCRIPT_UNIT, jsTextTranslated, partition.getOffset(), jsRegionLength, startIndentLevel, lineDelim, getPreferences());
- IDocument jsDoc = new Document(jsTextTranslated);
-
- //Undo the text replacements done by the translator so that it could build a CU for the JS region
- if(translation instanceof JsTranslation) {
- IJsTranslator translator = ((JsTranslation)translation).getTranslator();
-
- if(translator instanceof JsTranslator) {
- Region[] regions = ((JsTranslator)translator).getGeneratedRanges();
- //for each generated range, replace it with the original text
- for(int r = 0; r < regions.length; ++r) {
- jsDoc.replace(regions[r].getOffset(), regions[r].getLength(),
- document.get(regions[r].getOffset(), regions[r].getLength()));
- }
- }
- }
-
- /* error formating the code so abort */
- if(edit==null) return;
- edit.apply(jsDoc);
- String replaceText = lineDelim + getIndentationString(getPreferences(), startIndentLevel) + (jsDoc.get(edit.getOffset(), edit.getLength())).trim();
-
- //apply edit to html doc using the formated translated text and the possible leading and trailing html comments
- replaceText = preText + replaceText + postText;
- replaceEdit = new ReplaceEdit(partition.getOffset(), jsRegionLength, replaceText);
- replaceEdit.apply(document);
- } catch (BadLocationException e) {
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
- */
-
- public void formatterStarts(final IFormattingContext context) {
- fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
- fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM));
- startIndentLevel = FormattingStrategyJSDT.regionStartIndentLevel + 0;
- Map projectOptions = (Map) context.getProperty(FormattingContextProperties.CONTEXT_PREFERENCES);
- if (projectOptions == null) {
- IDocument doc = (IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM);
- context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, getProjectOptions(doc));
- }
- super.formatterStarts(context);
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
- */
-
- public void formatterStops() {
- super.formatterStops();
- fPartitions.clear();
- fDocuments.clear();
- startIndentLevel = 0;
- }
-
- public String getIndentationString(Map options, int indentationLevel) {
- DefaultCodeFormatter formatter = new DefaultCodeFormatter(options);
- return formatter.createIndentationString(indentationLevel);
- }
-
- private Map getProjectOptions(IDocument baseDocument) {
- IJavaScriptProject javaProject = null;
- Map options = null;
- ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(baseDocument);
- if (buffer != null) {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = buffer.getLocation();
- IProject project = null;
- if (filePath.segmentCount() > 0) {
- project = root.getProject(filePath.segment(0));
- }
- if (project != null) {
- javaProject = JavaScriptCore.create(project);
- }
- }
- if (javaProject != null) {
- options = javaProject.getOptions(true);
- }
- if (options == null) {
- options = JavaScriptCore.getOptions();
- }
- return options;
- }
-
- public IJsTranslation getTranslation(IStructuredDocument document) {
- IJsTranslation tran = null;
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (translationAdapter != null) {
- tran = translationAdapter.getJsTranslation(true);
- }
- } finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return tran;
- }
-
- /**
- *
- * @param d
- * @param line
- * @return
- * @throws BadLocationException
- *
- * @see org.eclipse.wst.jsdt.internal.ui.text.java.JavaAutoIndentStrategy#getIndentOfLine
- */
- private String getIndentOfLine(IDocument d, int line) throws BadLocationException {
- if (line > -1) {
- int start= d.getLineOffset(line);
- int end= start + d.getLineLength(line) - 1;
- int whiteEnd= findEndOfWhiteSpace(d, start, end);
- return d.get(start, whiteEnd - start);
- } else {
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the first offset greater than <code>offset</code> and smaller than
- * <code>end</code> whose character is not a space or tab character. If no such
- * offset is found, <code>end</code> is returned.
- *
- * @param document the document to search in
- * @param offset the offset at which searching start
- * @param end the offset at which searching stops
- * @return the offset in the specified range whose character is not a space or tab
- * @exception BadLocationException if position is an invalid range in the given document
- *
- * @see org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy#findEndOfWhiteSpace
- */
- private int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
- while (offset < end) {
- char c= document.getChar(offset);
- if (c != ' ' && c != '\t') {
- return offset;
- }
- offset++;
- }
- return end;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 018c42416e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,174 +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.wst.jsdt.web.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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-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.wst.jsdt.web.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 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 org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @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.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fFile.getName();
- }
-
- /*
- * @see org.eclipse.ui.IPathEditorInput#getPath()
- * @since 3.1
- */
- public IPath getPath() {
- return Path.fromOSString(fFile.getAbsolutePath());
- }
-
- /*
- * @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.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
-
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index d8905ef9f1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,79 +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.wst.jsdt.web.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-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.wst.jsdt.web.ui.internal.hyperlink
- private File fHyperlinkFile;
- private IRegion fHyperlinkRegion;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getHyperlinkText() {
- String path = fHyperlinkFile.getPath();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- return NLS.bind(HTMLUIMessages.Open, path);
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName(), true);
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- } catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
deleted file mode 100644
index 2dbb3fd3d2..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
-import org.eclipse.wst.jsdt.ui.JavaScriptUI;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JSDTHyperlink implements IHyperlink {
- private IJavaScriptElement fElement;
- private IRegion fRegion;
-
- public JSDTHyperlink(IRegion region, IJavaScriptElement 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#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return fElement != null ? NLS.bind(HTMLUIMessages.Open, fElement.getDisplayName()) : ActionMessages.OpenAction_declaration_label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- try {
- IEditorPart editor = JavaScriptUI.openInEditor(fElement);
- if (editor != null) {
- JavaScriptUI.revealInEditor(editor, fElement);
- }
- } catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
deleted file mode 100644
index 2193098830..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.internal.hyperlink;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-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.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ILocalVariable;
-import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.ISourceReference;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTHyperlinkDetector extends AbstractHyperlinkDetector {
- private IHyperlink createHyperlink(IJavaScriptElement 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;
- IPath outsidePath = 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();
- String uriString = sModel.getBaseLocation();
- file = getFile(uriString);
- // }
- }
- } finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- // get Java range, translate coordinate to JSP
- try {
- ISourceRange range = null;
- IJsTranslation jspTranslation = getJsTranslation(document);
- if (jspTranslation != null) {
- // link to local variable definitions
- if (element instanceof ILocalVariable) {
- range = ((ILocalVariable) element).getNameRange();
- IJavaScriptElement unit=((ILocalVariable) element).getParent();
- IJavaScriptUnit myUnit = jspTranslation.getCompilationUnit();
-
- while(!(unit instanceof IJavaScriptUnit || unit instanceof IClassFile || unit==null)) {
- unit = ((JavaElement) unit).getParent();
- }
- if(unit instanceof IJavaScriptUnit) {
- IJavaScriptUnit cu = (IJavaScriptUnit)unit;
- if(cu!=myUnit) {
- file = getFile(cu.getPath().toString());
- if(file==null) {
- outsidePath = cu.getPath();
- }
- }
- }else if(unit instanceof IClassFile) {
- IClassFile cu = (IClassFile)unit;
- if(cu!=myUnit) {
- file = getFile(cu.getPath().toString());
- if(file==null) {
- outsidePath = cu.getPath();
- }
- }
- }
-
- }
- // linking to fields of the same compilation unit
- else if (element.getElementType() == IJavaScriptElement.FIELD) {
- Object cu = ((IField) element).getJavaScriptUnit();
- if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
- range = ((ISourceReference) element).getSourceRange();
- }
- }
- // linking to methods of the same compilation unit
- else if (element.getElementType() == IJavaScriptElement.METHOD) {
- Object cu = ((IFunction) element).getJavaScriptUnit();
- if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
- range = ((ISourceReference) element).getSourceRange();
- }
- }
- }
- if (range != null && file != null) {
- jspOffset = range.getOffset();
- if (jspOffset >= 0) {
- link = new WorkspaceFileHyperlink(region, file, new Region(jspOffset, range.getLength()));
- }
- }else if (range!=null && outsidePath!=null) {
- jspOffset = range.getOffset();
- if (jspOffset >= 0) {
- link = new ExternalFileHyperlink(region,outsidePath.toFile());
- }
- }
- } catch (JavaScriptModelException jme) {
- Logger.log(Logger.WARNING_DEBUG, jme.getMessage(), jme);
- }
- }
- if (link == null) {
- link = new JSDTHyperlink(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();
- IJsTranslation jsTranslation = getJsTranslation(document);
- if (jsTranslation != null) {
- IJavaScriptElement[] elements = jsTranslation.getElementsFromJsRange(region.getOffset(), region.getOffset() + region.getLength());
- if (elements != null && elements.length > 0) {
- // create a hyperlink for each JavaScript element
- for (int i = 0; i < elements.length; ++i) {
- IJavaScriptElement 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) {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fileString);
- if(resource!=null && resource instanceof IFile) {
- file = (IFile)resource;
- }
- }
- return file;
- }
-
- /**
- * Get JSP translation object
- *
- * @return JSPTranslation if one exists, null otherwise
- */
- private IJsTranslation getJsTranslation(IDocument document) {
- IJsTranslation translation = null;
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (xmlModel != null) {
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (adapter != null) {
- translation = adapter.getJsTranslation(true);
- }
- }
- } 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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index ea48fbb941..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.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.osgi.util.NLS;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
-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.wst.jsdt.web.ui.internal.hyperlink
- private IFile fFile;
- private IRegion fHighlightRange;
- private IRegion fRegion;
-
- 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#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String path = fFile.getFullPath().toString();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- return NLS.bind(HTMLUIMessages.Open, path);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- if (fFile != null && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if (fHighlightRange != null && editor instanceof ITextEditor) {
- ((ITextEditor) editor).selectAndReveal(fHighlightRange.getOffset(), fHighlightRange.getLength());
- }
- } catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index bf603d05b9..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,502 +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.wst.jsdt.web.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-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.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class XMLHyperlinkDetector implements IHyperlinkDetector {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.wst.jsdt.web.ui.internal.hyperlink
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
- private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
- if (isHttp(uriString)) {
- link = new URLHyperlink(hyperlinkRegion, uriString);
- } else {
- // try to locate the file in the workspace
- File systemFile = getFileFromUriString(uriString);
- if (systemFile != null) {
- String systemPath = systemFile.getPath();
- IFile file = getFile(systemPath);
- if (file != null) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- } else {
- // this is an ExternalFileHyperlink since file does not
- // exist in workspace
- link = new ExternalFileHyperlink(hyperlinkRegion, systemFile);
- }
- }
- }
- return link;
- }
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- // for now, only capable of creating 1 hyperlink
- List hyperlinks = new ArrayList(0);
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null) {
- String uriString = null;
- if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- // doctype nodes
- uriString = getURIString(currentNode, document);
- } else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
- // element nodes
- Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
- if (currentAttr != null) {
- // try to find link for current attribute
- // resolve attribute value
- uriString = getURIString(currentAttr, document);
- // verify validity of uri string
- if (uriString == null || !isValidURI(uriString)) {
- // reset current attribute
- currentAttr = null;
- }
- }
- if (currentAttr == null) {
- // try to find a linkable attribute within element
- currentAttr = getLinkableAttr((Element) currentNode);
- if (currentAttr != null) {
- uriString = getURIString(currentAttr, document);
- }
- }
- currentNode = currentAttr;
- }
- // try to create hyperlink from information gathered
- if (uriString != null && currentNode != null && isValidURI(uriString)) {
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
- IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
- if (hyperlink != null) {
- hyperlinks.add(hyperlink);
- }
- }
- }
- }
- if (hyperlinks.size() == 0) {
- return null;
- }
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Get the base location from the current model (local file system)
- */
- private String getBaseLocation(IDocument document) {
- String baseLoc = null;
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- IPath location = new Path(sModel.getBaseLocation());
- if (location.toFile().exists()) {
- baseLoc = location.toString();
- } else {
- if (location.segmentCount() > 1) {
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(location).getLocation().toString();
- } else {
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(location).toString();
- }
- }
- }
- } finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return baseLoc;
- }
-
- /**
- * Get the CMElementDeclaration for an element
- *
- * @param element
- * @return CMElementDeclaration
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration ed = null;
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- ed = mq.getCMElementDeclaration(element);
- }
- return ed;
- }
-
- /**
- * Returns the attribute node within node at offset
- *
- * @param node
- * @param offset
- * @return Attr
- */
- private Attr getCurrentAttrNode(Node node, int offset) {
- if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
- NamedNodeMap attrs = node.getAttributes();
- // go through each attribute in node and if attribute contains
- // offset, return that attribute
- for (int i = 0; i < attrs.getLength(); ++i) {
- // assumption that if parent node is of type IndexedRegion,
- // then its attributes will also be of type IndexedRegion
- IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
- if (attRegion.contains(offset)) {
- return (Attr) attrs.item(i);
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null) {
- inode = sModel.getIndexedRegion(offset - 1);
- }
- } finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-
- /**
- * Returns an IFile from the given uri if possible, null if cannot find file
- * from uri.
- *
- * @param fileString
- * file system path
- * @return returns IFile if fileString exists in the workspace
- */
- private IFile getFile(String fileString) {
- IFile file = null;
- if (fileString != null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
- for (int i = 0; i < files.length && file == null; i++) {
- if (files[i].exists()) {
- file = files[i];
- }
- }
- }
- return file;
- }
-
- /**
- * Create a file from the given uri string
- *
- * @param uriString -
- * assumes uriString is not http://
- * @return File created from uriString if possible, null otherwise
- */
- private File getFileFromUriString(String uriString) {
- File file = null;
- try {
- // first just try to create a file directly from uriString as
- // default in case create file from uri does not work
- file = new File(uriString);
- // try to create file from uri
- URI uri = new URI(uriString);
- file = new File(uri);
- } catch (Exception e) {
- // if exception is thrown while trying to create File just ignore
- // and file will be null
- }
- return file;
- }
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- } else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null) {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- /**
- * Attempts to find an attribute within element that is openable.
- *
- * @param element -
- * cannot be null
- * @return Attr attribute that can be used for open on, null if no attribute
- * could be found
- */
- private Attr getLinkableAttr(Element element) {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- // get the list of attributes for this node
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- // check if this attribute is "openOn-able"
- Attr att = (Attr) attrs.item(i);
- if (isLinkableAttr(att, ed)) {
- return att;
- }
- }
- return null;
- }
-
- /**
- * Find the location hint for the given namespaceURI if it exists
- *
- * @param elementNode -
- * cannot be null
- * @param namespaceURI -
- * cannot be null
- * @return location hint (systemId) if it was found, null otherwise
- */
- private String getLocationHint(Element elementNode, String namespaceURI) {
- Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
- if (schemaLocNode != null) {
- StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
- while (st.hasMoreTokens()) {
- String publicId = st.hasMoreTokens() ? st.nextToken() : null;
- String systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // found location hint
- if (namespaceURI.equalsIgnoreCase(publicId)) {
- return systemId;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the URI string
- *
- * @param node -
- * assumes not null
- */
- private String getURIString(Node node, IDocument document) {
- String resolvedURI = null;
- // need the base location, publicId, and systemId for URIResolver
- String baseLoc = null;
- String publicId = null;
- String systemId = null;
- short nodeType = node.getNodeType();
- // handle doc type node
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- baseLoc = getBaseLocation(document);
- publicId = ((DocumentType) node).getPublicId();
- systemId = ((DocumentType) node).getSystemId();
- } else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- String attrName = attrNode.getName();
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
- if (attrValue != null && attrValue.length() > 0) {
- baseLoc = getBaseLocation(document);
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- publicId = attrValue;
- systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
- if (systemId == null) {
- systemId = attrValue;
- }
- } else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- // for now just use the first pair
- // need to look into being more precise
- StringTokenizer st = new StringTokenizer(attrValue);
- publicId = st.hasMoreTokens() ? st.nextToken() : null;
- systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // else check if xmlns publicId = value
- } else {
- systemId = attrValue;
- }
- }
- }
- resolvedURI = resolveURI(baseLoc, publicId, systemId);
- return resolvedURI;
- }
-
- /**
- * Returns true if this uriString is an http string
- *
- * @param uriString
- * @return true if uriString is http string, false otherwise
- */
- private boolean isHttp(String uriString) {
- boolean isHttp = false;
- if (uriString != null) {
- String tempString = uriString.toLowerCase();
- if (tempString.startsWith(HTTP_PROTOCOL)) {
- isHttp = true;
- }
- }
- return isHttp;
- }
-
- /**
- * Checks to see if the given attribute is openable. Attribute is openable
- * if it is a namespace declaration attribute or if the attribute value is
- * of type URI.
- *
- * @param attr
- * cannot be null
- * @param cmElement
- * CMElementDeclaration associated with the attribute (can be
- * null)
- * @return true if this attribute is "openOn-able" false otherwise
- */
- private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
- String attrName = attr.getName();
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- // determine if attribute is namespace declaration
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- return true;
- }
- // determine if attribute contains schema location
- if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName)))) {
- return true;
- }
- // determine if attribute value is of type URI
- if (cmElement != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) cmElement.getAttributes().getNamedItem(attrName);
- if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Checks whether the given uriString is really pointing to a file
- *
- * @param uriString
- * @return boolean
- */
- private boolean isValidURI(String uriString) {
- boolean isValid = false;
- if (isHttp(uriString)) {
- isValid = true;
- } else {
- File file = getFileFromUriString(uriString);
- if (file != null) {
- isValid = file.isFile();
- }
- }
- return isValid;
- }
-
- /**
- * Resolves the given URI information
- *
- * @param baseLocation
- * @param publicId
- * @param systemId
- * @return String resolved uri.
- */
- private String resolveURI(String baseLocation, String publicId, String systemId) {
- // dont resolve if there's nothing to resolve
- if ((baseLocation == null) && (publicId == null) && (systemId == null)) {
- return null;
- }
- return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
deleted file mode 100644
index e165f7ddd7..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ /dev/null
@@ -1,347 +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.jsdt.web.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.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-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.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class BasicRefactorSearchRequestor extends SearchRequestor {
- /**
- * Change class that wraps a text edit on the jsp document
- */
- private class RenameChange extends DocumentChange {
- private String fDescription = JsUIMessages.BasicRefactorSearchRequestor_0;
- private TextEdit fEdit = null;
- private IDocument fJSPDoc = null;
- private IFile fJSPFile = null;
-
- public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
- super(JsUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
- this.fEdit = edit;
- this.fJSPFile = jspFile;
- this.fJSPDoc = jspDoc;
- this.fDescription = description;
- }
-
-
- public Object getModifiedElement() {
- return getElement();
- }
-
-
- public String getName() {
- return this.fDescription;
- }
-
-
- 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;
- }
-
- /**
- * 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 RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
- return new RefactoringStatus();
- }
-
-
- 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(JsSearchSupport.getInstance().getProgressMonitor());
- } catch (InvocationTargetException e) {
- Logger.logException(e);
- } catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
- }
- // end inner class SaveJspFileOp
- /**
- * 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 RenameChange
- /** The type being renamed (the old type) */
- IJavaScriptElement 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(IJavaScriptElement element, String newName) {
- this.fNewName = newName;
- this.fElement = element;
- this.fSearchDocPath2JavaEditMap = new HashMap();
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
- */
-
- public void acceptSearchMatch(SearchMatch javaMatch) throws CoreException {
- String matchDocumentPath = javaMatch.getResource().getFullPath().toString();
- SearchDocument searchDoc = JsSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
- if (searchDoc != null && searchDoc instanceof JSDTSearchDocumentDelegate) {
- String renameText = getRenameText((JSDTSearchDocumentDelegate) searchDoc, javaMatch);
- // add it for the correct document
- addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
- }
- }
-
- /**
- * 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);
- }
- }
-
- private Change createChange(JSDTSearchDocumentDelegate searchDoc, TextEdit edit) {
- IDocument doc = searchDoc.getJspTranslation().getHtmlDocument();
- 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(JsUIMessages.BasicRefactorSearchRequestor_1, new String[] { file, lineNumber }); //$NON-NLS-1$
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- return new RenameChange(searchDoc.getFile(), doc, edit, description);
- }
-
- /**
- *
- * @return all JSP changes for the search matches for the given Type
- */
- public Change[] getChanges() {
- JsSearchSupport support = JsSearchSupport.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 JSDTSearchDocumentDelegate) {
- JSDTSearchDocumentDelegate javaDelegate = (JSDTSearchDocumentDelegate) delegate;
- changes.add(createChange(javaDelegate, javaEdit));
- }
- }
- return (Change[]) changes.toArray(new Change[changes.size()]);
- }
-
- /**
- * Subclasses should override to better describe the change.
- *
- * @return
- */
- protected String getDescription() {
- return ""; //$NON-NLS-1$
- }
-
- public IJavaScriptElement getElement() {
- return this.fElement;
- }
-
- /**
- * @return the new name for the Type
- */
- public String getNewName() {
- return this.fNewName;
- }
-
- /**
- * @param searchDoc
- * @return
- */
- protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
- return getNewName();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
deleted file mode 100644
index d671fcf160..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-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;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JSPJavaSelectionProvider {
- static IJavaScriptElement[] getSelection(ITextEditor textEditor) {
- IJavaScriptElement[] 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 = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- IDOMModel xmlModel = (IDOMModel) model;
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (adapter != null) {
- IJsTranslation translation = adapter.getJsTranslation(true);
- elements = translation.getElementsFromJsRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
- }
- }
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- if (elements == null) {
- elements = new IJavaScriptElement[0];
- }
- return elements;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
deleted file mode 100644
index 447afce30b..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ /dev/null
@@ -1,74 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPMethodRenameChange extends Change {
- public static Change[] createChangesFor(IFunction method, String newName) {
- JsSearchSupport support = JsSearchSupport.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 JsSearchScope(), requestor);
- return requestor.getChanges();
- }
-
-
- public Object getModifiedElement() {
- // pa_TODO Auto-generated method stub
- return null;
- }
-
-
- public String getName() {
- return JsUIMessages.JSP_changes;
- }
-
-
- 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;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
deleted file mode 100644
index 27f7ddbfb2..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-/*
- * Created on May 6, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPMethodRenameParticipant extends RenameParticipant {
- private IFunction fMethod = null;
-
- /*
- * (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(JsUIMessages.JSP_changes, changes);
- }
- return multiChange;
- }
-
- /**
- * @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 (JavaScriptModelException e) {
- Logger.logException(e);
- }
- }
- return name;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
-
- protected boolean initialize(Object element) {
- if (element instanceof IFunction) {
- this.fMethod = (IFunction) element;
- return true;
- }else if (element instanceof IJavaWebNode) {
- if(((IJavaWebNode)element).getJavaElement() instanceof IFunction) {
- this.fMethod = (IFunction) ((IJavaWebNode)element).getJavaElement();
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
deleted file mode 100644
index 11e6833c3e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
+++ /dev/null
@@ -1,54 +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.jsdt.web.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPMethodRenameRequestor extends BasicRefactorSearchRequestor {
- public JSPMethodRenameRequestor(IJavaScriptElement element, String newName) {
- super(element, newName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
-
- protected String getDescription() {
- String methodName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_3, new String[] { methodName, newName });
- return description;
- }
-
-
- protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
- String javaText = searchDoc.getJspTranslation().getJsText();
- String methodText = javaText.substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
- String methodSuffix = methodText.substring(methodText.indexOf("(")); //$NON-NLS-1$
- return getNewName() + methodSuffix;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
deleted file mode 100644
index 0679a104e2..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-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.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * 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 dispose() {
- // nulling out just in case
- // fEditor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(JsUIMessages.MoveElement_label);
- action.setToolTipText(JsUIMessages.MoveElement_label);
- }
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- 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
- // IJavaScriptElement[] 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 (JavaScriptModelException e) {
- // Logger.logException(e);
- // }
- // }
- // else {
- // PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0);
- // //$NON-NLS-1$
- // }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- PlatformStatusLineUtil.clearStatusLine();
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- // fEditor = targetEditor;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
deleted file mode 100644
index 8a8a378351..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ /dev/null
@@ -1,74 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPPackageRenameChange extends Change {
- public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
- JsSearchSupport support = JsSearchSupport.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 JsSearchScope(), requestor);
- return requestor.getChanges();
- }
-
-
- public Object getModifiedElement() {
- // return this.pkg;
- return null;
- }
-
-
- public String getName() {
- return JsUIMessages.JSP_changes;
- }
-
-
- 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;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
deleted file mode 100644
index 161f73a736..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ /dev/null
@@ -1,84 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * 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#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(JsUIMessages.JSP_changes, changes);
- }
- return multiChange;
- }
-
- /**
- * @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#initialize(java.lang.Object)
- */
-
- protected boolean initialize(Object element) {
- if (element instanceof IPackageFragment) {
- this.fPkg = (IPackageFragment) element;
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
deleted file mode 100644
index 6fa4592043..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
+++ /dev/null
@@ -1,47 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPPackageRenameRequestor extends BasicRefactorSearchRequestor {
- /**
- * Element is the old package. newName is the new package name.
- *
- * @param element
- * @param newName
- */
- public JSPPackageRenameRequestor(IJavaScriptElement element, String newName) {
- super(element, newName);
- }
-
- /*
- * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
-
- protected String getDescription() {
- String packageName = getElement().getElementName();
- String newName = getNewName();
- String description = NLS.bind(JsUIMessages.BasicRefactorSearchRequestor_5, (new String[] { packageName, newName }));
- return description;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
deleted file mode 100644
index 7fd2fb5441..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-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.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.ui.refactoring.RenameSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSPRenameElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- }
-
- private IJavaScriptElement getSelectedElement() {
- IJavaScriptElement element = null;
- if (fEditor instanceof ITextEditor) {
- IJavaScriptElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
- if (elements.length == 1) {
- element = elements[0];
- }
- }
- return element;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(JsUIMessages.RenameElement_label);
- action.setToolTipText(JsUIMessages.RenameElement_label);
- }
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- IJavaScriptElement element = getSelectedElement();
- if (element != null) {
- RenameSupport renameSupport = null;
- try {
- switch (element.getElementType()) {
- case IJavaScriptElement.TYPE:
- renameSupport = RenameSupport.create((IType) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
- break;
- case IJavaScriptElement.METHOD:
- renameSupport = RenameSupport.create((IFunction) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
- break;
- case IJavaScriptElement.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(JsUIMessages.JSPRenameElementAction_0);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- PlatformStatusLineUtil.clearStatusLine();
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
deleted file mode 100644
index 6eaa39b9ec..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
+++ /dev/null
@@ -1,72 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSPTypeMoveChange extends Change {
- public static Change[] createChangesFor(IType type, String newName) {
- JsSearchSupport support = JsSearchSupport.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 JsSearchScope(), requestor);
- return requestor.getChanges();
- }
-
-
- public Object getModifiedElement() {
- return null;
- }
-
-
- public String getName() {
- return JsUIMessages.JSP_changes;
- }
-
-
- 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;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
deleted file mode 100644
index 8088e460a5..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ /dev/null
@@ -1,94 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSPTypeMoveParticipant extends MoveParticipant {
- IType fType = null;
-
- /*
- * (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(JsUIMessages.JSP_changes, changes);
- }
- }
- return multiChange;
- }
-
- /*
- * (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#initialize(java.lang.Object)
- */
-
- protected boolean initialize(Object element) {
- if (element instanceof IType) {
- this.fType = (IType) element;
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
deleted file mode 100644
index e76080983e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
+++ /dev/null
@@ -1,70 +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.jsdt.web.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-//import org.eclipse.wst.jsdt.web.core.internal.java.JsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPTypeMoveRequestor extends BasicRefactorSearchRequestor {
- /**
- * @param element
- * @param newName
- */
- public JSPTypeMoveRequestor(IJavaScriptElement element, String newPackage) {
- super(element, newPackage);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
-
- protected String getDescription() {
- String typeName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_2, new String[] { typeName, newName });
- return description;
- }
-
-
- protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
- String renameText = getElement().getElementName();
- // JsTranslation trans = searchDoc.getJspTranslation();
- //String matchText = trans.getJsText().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())
-//
-// || isFullyQualified(matchText)) {
-// if (!getNewName().equals("")) {
-// // getNewName() is the pkg name
-// renameText = getNewName() + "." + renameText; //$NON-NLS-1$
-// }
-// }
- return renameText;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
deleted file mode 100644
index 10ad88af5e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ /dev/null
@@ -1,74 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JSPTypeRenameChange extends Change {
- public static Change[] createChangesFor(IType type, String newName) {
- JsSearchSupport support = JsSearchSupport.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 JsSearchScope(), requestor);
- return requestor.getChanges();
- }
-
-
- public Object getModifiedElement() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- public String getName() {
- return JsUIMessages.JSP_changes;
- }
-
-
- 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;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
deleted file mode 100644
index 56a46dd590..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ /dev/null
@@ -1,95 +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.jsdt.web.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * 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#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(JsUIMessages.JSP_changes, changes);
- }
- return multiChange;
- }
-
- /**
- * @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 (JavaScriptModelException e) {
- Logger.logException(e);
- }
- }
- return name;
- }
-
- /**
- * @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;
- }else if (element instanceof IJavaWebNode) {
- if(((IJavaWebNode)element).getJavaElement() instanceof IType) {
- this.fType = (IType) ((IJavaWebNode)element).getJavaElement();
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
deleted file mode 100644
index fbce86e9a5..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
+++ /dev/null
@@ -1,73 +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.jsdt.web.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-//import org.eclipse.wst.jsdt.web.core.internal.java.JsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * 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);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.web.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
-
- protected String getDescription() {
- String typeName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JsUIMessages.BasicRefactorSearchRequestor_4, new String[] { typeName, newName });
- return description;
- }
-
-
- protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
- String renameText = getNewName();
- // String pkg = getType().getPackageFragment().getElementName();
- // JsTranslation trans = searchDoc.getJspTranslation();
- // String matchText = trans.getJsText().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("")) {
-// renameText = pkg + "." + renameText; //$NON-NLS-1$
-// }
-// }
- return renameText;
- }
-
-// private IType getType() {
-// return (IType) getElement();
-// }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
deleted file mode 100644
index 31d10ba172..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
+++ /dev/null
@@ -1,148 +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.jsdt.web.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.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class BasicJsSearchRequestor extends SearchRequestor {
- // for debugging
- private static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.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.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
- */
-
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- if (JsSearchSupport.getInstance().isCanceled()) {
- return;
- }
- String matchDocumentPath = match.getResource().getFullPath().toString();
- SearchDocument searchDoc = JsSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
- if (searchDoc != null && searchDoc instanceof JSDTSearchDocumentDelegate) {
- JSDTSearchDocumentDelegate javaSearchDoc = (JSDTSearchDocumentDelegate) searchDoc;
- int jspStart = match.getOffset();
- int jspEnd = match.getOffset() + match.getLength();
- IJsTranslation trans = javaSearchDoc.getJspTranslation();
- String jspText = trans.getHtmlText();
- String javaText = javaSearchDoc.getJavaText();
- if (BasicJsSearchRequestor.DEBUG) {
- displayDebugInfo(match, jspStart, jspEnd, jspText, javaText);
- }
- if (jspStart > -1 && jspEnd > -1) {
- addSearchMatch(new Document(trans.getHtmlText()), 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.wst.jsdt.core.search.SearchRequestor#beginReporting()
- */
-
- public void beginReporting() {
- if (BasicJsSearchRequestor.DEBUG) {
- System.out.println("JSP Search requestor: beginReporting()"); //$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$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#endReporting()
- */
-
- public void endReporting() {
- if (BasicJsSearchRequestor.DEBUG) {
- System.out.println("JSP Search requestor: endReporting()"); //$NON-NLS-1$
- }
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#enterParticipant(org.eclipse.wst.jsdt.core.search.SearchParticipant)
- */
-
- public void enterParticipant(SearchParticipant participant) {
- if (BasicJsSearchRequestor.DEBUG) {
- System.out.println("JSP Search requestor: enterParticipant()"); //$NON-NLS-1$
- }
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#exitParticipant(org.eclipse.wst.jsdt.core.search.SearchParticipant)
- */
-
- public void exitParticipant(SearchParticipant participant) {
- if (BasicJsSearchRequestor.DEBUG) {
- System.out.println("JSP Search requestor: exitParticipant()"); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
deleted file mode 100644
index bbfc6339b0..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,47 +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.wst.jsdt.web.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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsFindOccurrencesActionDelegate 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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
deleted file mode 100644
index 7a0d93d760..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.jsdt.web.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.jsdt.web.core.text.IJsPartitions;
-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;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsFindOccurrencesProcessor extends FindOccurrencesProcessor {
- private IJavaScriptElement getJavaElement(IDocument document, ITextSelection textSelection) {
- IJavaScriptElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
- return elements.length > 0 ? elements[0] : null;
- }
-
- /**
- * uses JSPTranslation to get currently selected Java elements.
- *
- * @return currently selected IJavaElements
- */
- private IJavaScriptElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
- IJavaScriptElement[] elements = new IJavaScriptElement[0];
- // get JSP translation object for this viewer's document
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null && model instanceof IDOMModel) {
- IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
- JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (adapter != null) {
- IJsTranslation translation = adapter.getJsTranslation(false);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
- elements = translation.getElementsFromJsRange(selection.getOffset(), selection.getOffset() + selection.getLength());
- }
- }
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return elements;
- }
-
-
- protected String[] getPartitionTypes() {
- return new String[] { IJsPartitions.HtmlJsPartition };
- }
-
-
- protected String[] getRegionTypes() {
- return new String[] { DOMRegionContext.BLOCK_TEXT };
- }
-
-
- protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
- IJavaScriptElement javaScriptElement = getJavaElement(document, textSelection);
- if (javaScriptElement != null) {
- return new JsSearchQuery(file, javaScriptElement);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
deleted file mode 100644
index 504987ec64..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
+++ /dev/null
@@ -1,35 +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.jsdt.web.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;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsOccurrencesSearchResult extends OccurrencesSearchResult {
- public JsOccurrencesSearchResult(ISearchQuery query) {
- super(query);
- }
-
-
- public Match[] getMatches() {
- return super.getMatches();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
deleted file mode 100644
index d3807e0220..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
+++ /dev/null
@@ -1,121 +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.jsdt.web.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.osgi.util.NLS;
-import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsSearchQuery extends BasicSearchQuery {
- /** the IJavaScriptElement we are searching for in the file * */
- private IJavaScriptElement fElement = null;
-
- public JsSearchQuery(IFile file, IJavaScriptElement element) {
- super(file);
- this.fElement = element;
- }
-
-
- public boolean canRerun() {
- return false;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
- */
-
- public boolean canRunInBackground() {
- return true;
- }
-
-
- protected IStatus doQuery() {
- IStatus status = Status.OK_STATUS;
- try {
- JsSearchSupport support = JsSearchSupport.getInstance();
- // index the file
- SearchDocument delegate = support.addJspFile(getFile());
- String scopePath = delegate.getPath();
- JsSearchScope singleFileScope = new JsSearchScope(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()));
- support.searchRunnable(getJavaElement(), singleFileScope, new JsSingleFileSearchRequestor(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;
- }
-
- private String getFilename() {
- String filename = JsUIMessages.OccurrencesSearchQuery_2;
- if (getFile() != null) {
- filename = getFile().getName();
- }
- return filename;
- }
-
- // for access by inner class
- public JsSearchQuery getInstance() {
- return this;
- }
-
- public IJavaScriptElement getJavaElement() {
- return this.fElement;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#getLabel()
- */
-
- public String getLabel() {
- String[] args = { getSearchText(), getOccurrencesCountText(), getFilename() };
- return NLS.bind(JsUIMessages.OccurrencesSearchQuery_0, args);
- }
-
- private String getOccurrencesCountText() {
- String count = ""; //$NON-NLS-1$
- // pa_TODO make dynamic
- return count;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
- */
-
- public ISearchResult getSearchResult() {
- return new JsOccurrencesSearchResult(this);
- }
-
-
- protected String getSearchText() {
- return fElement.getElementName();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
deleted file mode 100644
index 33feb500d8..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
+++ /dev/null
@@ -1,81 +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.jsdt.web.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.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.wst.jsdt.ui.search.ISearchRequestor;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsSearchRequestor extends BasicJsSearchRequestor {
- private ISearchRequestor fJavaRequestor = null;
-
- public JsSearchRequestor() {
- super();
- }
-
- public JsSearchRequestor(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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
deleted file mode 100644
index 955652546e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
+++ /dev/null
@@ -1,38 +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.jsdt.web.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsSingleFileSearchRequestor extends BasicJsSearchRequestor {
- private JsSearchQuery fQuery = null;
-
- public JsSingleFileSearchRequestor(JsSearchQuery 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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
deleted file mode 100644
index aaa8880d9f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
+++ /dev/null
@@ -1,52 +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.jsdt.web.ui.internal.java.search.ui;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.jsdt.ui.search.IMatchPresentation;
-import org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsMatchPresentation implements IMatchPresentation {
- /**
- * @see org.eclipse.wst.jsdt.ui.search.IMatchPresentation#createLabelProvider()
- */
- public ILabelProvider createLabelProvider() {
- return new BasicSearchLabelProvider();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.jsdt.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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
deleted file mode 100644
index faf529194d..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
+++ /dev/null
@@ -1,90 +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.jsdt.web.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.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-import org.eclipse.wst.jsdt.ui.search.ElementQuerySpecification;
-import org.eclipse.wst.jsdt.ui.search.IMatchPresentation;
-import org.eclipse.wst.jsdt.ui.search.IQueryParticipant;
-import org.eclipse.wst.jsdt.ui.search.ISearchRequestor;
-import org.eclipse.wst.jsdt.ui.search.PatternQuerySpecification;
-import org.eclipse.wst.jsdt.ui.search.QuerySpecification;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
-import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
-import org.eclipse.wst.jsdt.web.ui.internal.java.search.JsSearchRequestor;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author pavery
- */
-public class JsQueryParticipant implements IQueryParticipant {
- // for debugging
- private static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspsearch"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#estimateTicks(org.eclipse.wst.jsdt.ui.search.QuerySpecification)
- */
- public int estimateTicks(QuerySpecification data) {
- // pa_TODO use project file counter from JSPSearchSupport...
- return 0;
- }
-
- /**
- * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#getUIParticipant()
- */
- public IMatchPresentation getUIParticipant() {
- return new JsMatchPresentation();
- }
-
- /**
- * @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#search(org.eclipse.wst.jsdt.ui.search.ISearchRequestor,
- * org.eclipse.wst.jsdt.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;
- IJavaScriptElement element = elementQuery.getElement();
- if (JsQueryParticipant.DEBUG) {
- System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
- }
- SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
- // pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
- JsSearchSupport.getInstance().search(element, new JsSearchScope(), jspRequestor);
- } else if (querySpecification instanceof PatternQuerySpecification) {
- // pattern search (eg. from Java search page)
- PatternQuerySpecification patternQuery = (PatternQuerySpecification) querySpecification;
- String pattern = patternQuery.getPattern();
- if (JsQueryParticipant.DEBUG) {
- System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
- }
- SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
- JsSearchSupport.getInstance().search(pattern, new JsSearchScope(), patternQuery.getSearchFor(), patternQuery.getLimitTo(), SearchPattern.R_PATTERN_MATCH, false, jspRequestor);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
deleted file mode 100644
index f4b6a69287..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
+++ /dev/null
@@ -1,70 +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.jsdt.web.ui.internal.registry;
-
-import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT;
-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;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class AdapterFactoryProviderForJSDT 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 instanceof JFaceNodeAdapterFactoryForJSDT)) {
- factoryRegistry.removeFactoriesFor(IJFaceNodeAdapter.class);
- factory = new JFaceNodeAdapterFactoryForJSDT(IJFaceNodeAdapter.class, true);
- factoryRegistry.addFactory(factory);
- }
-
- JsTranslationAdapterFactory.setupAdapterFactory(structuredModel);
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {}
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- // return (contentTypeDescription instanceof ModelHandlerForJSP);
- return (contentTypeDescription instanceof ModelHandlerForHTML);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- addAdapterFactories(structuredModel);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
deleted file mode 100644
index 4a237d6f1e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
+++ /dev/null
@@ -1,22 +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.wst.jsdt.web.ui.internal.style;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IStyleConstantsJs {
- public static final String JSP_CONTENT = "jsp_content"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
deleted file mode 100644
index 6ec51cb30c..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.style.java;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IStyleConstantsJSDT {
- String JAVA_DEFAULT = "default"; //$NON-NLS-1$
- String JAVA_KEYWORD = "keyword"; //$NON-NLS-1$
- String JAVA_SINGLE_LINE_COMMENT = "single_line_comment"; //$NON-NLS-1$
- String JAVA_MULTI_LINE_COMMENT = "multi_line_comment"; //$NON-NLS-1$
- String JAVA_STRING = "string"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
deleted file mode 100644
index d6d50e3ea6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.jsdt.web.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.ICharacterScanner;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.PatternRule;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.wst.jsdt.web.core.javascript.JsDataTypes;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JSDTCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
- private static String[] fgConstants = JsDataTypes.CONSTANTS;
- private static String[] fgKeywords = JsDataTypes.KEYWORDS;
- private static String[] fgTypes = JsDataTypes.TYPES;
- private IToken fDefaultToken;
- private IToken fKeywordToken;
- private IToken fSingleLineCommentToken;
- private IToken fMultiLineCommentToken;
- private IToken fStringToken;
- private IToken fTypeToken;
- private IToken fHTMLCommentBorderToken;
-
- /**
- * Creates a Java code scanner
- */
- public JSDTCodeScanner() {
- super();
- }
-
- public void initializeRules() {
- List rules = new ArrayList();
- // Add rule for multiple line comments.
- rules.add(new MultiLineRule("/*", "*/", fMultiLineCommentToken));//$NON-NLS-1$ //$NON-NLS-2$
- // Add rule for single line comments.
- rules.add(new NoneInclusiveEndSequenceSingleLineRule("//", "-->", 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 < JSDTCodeScanner.fgKeywords.length; i++) {
- wordRule.addWord(JSDTCodeScanner.fgKeywords[i], fKeywordToken);
- }
- for (int i = 0; i < JSDTCodeScanner.fgTypes.length; i++) {
- wordRule.addWord(JSDTCodeScanner.fgTypes[i], fTypeToken);
- }
- for (int i = 0; i < JSDTCodeScanner.fgConstants.length; i++) {
- wordRule.addWord(JSDTCodeScanner.fgConstants[i], fTypeToken);
- }
- rules.add(wordRule);
-
- //add word rule for HTML style comment delimiters
- rules.add(new WordRule(new HTMLCommentDetector(), this.fHTMLCommentBorderToken));
-
- //add rule for text after leading HTML comment delimiter
- rules.add(new NoneInclusiveStartSequenceEndOfLineRule("<!--", this.fSingleLineCommentToken));
-
- IRule[] result = new IRule[rules.size()];
- rules.toArray(result);
- setRules(result);
- }
-
- public void setTokenData(String tokenKey, Object data) {
- if (tokenKey == IStyleConstantsJSDT.JAVA_KEYWORD) {
- fKeywordToken = new Token(data);
- fTypeToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSDT.JAVA_STRING) {
- fStringToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT) {
- fSingleLineCommentToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSDT.JAVA_MULTI_LINE_COMMENT) {
- fMultiLineCommentToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSDT.JAVA_DEFAULT) {
- fDefaultToken = new Token(data);
- } else if(tokenKey == IStyleConstantsXML.COMMENT_BORDER) {
- fHTMLCommentBorderToken = new Token(data);
- }
- }
-
- /**
- * <p>Detector for HTML comment delimiters.</p>
- */
- private static class HTMLCommentDetector implements IWordDetector {
-
- /**
- * @see IWordDetector#isWordStart(char)
- */
- public boolean isWordStart(char c) {
- return (c == '<' || c == '-');
- }
-
- /**
- * @see IWordDetector#isWordPart(char)
- */
- public boolean isWordPart(char c) {
- return (c == '-' || c == '!' || c == '>');
- }
- }
-
- /**
- * <p>Same as a {@link SingleLineRule} except the given end sequence is not counted as part of the match.</p>
- *
- * @see SingleLineRule
- */
- private static class NoneInclusiveEndSequenceSingleLineRule extends SingleLineRule {
-
- /**
- * @param startSequence start sequence included in rule match
- * @param endSequence end sequence that will end this rule but will not be counted as part of the match
- * @param token to return on a match by this rule
- */
- public NoneInclusiveEndSequenceSingleLineRule(String startSequence, String endSequence, IToken token) {
- super(startSequence, endSequence, token);
- }
-
- /**
- * <p>If the end sequence is detected then scanner is rewind to just before the end sequence,
- * otherwise acts the same as {@link PatternRule#endSequenceDetected}</p>
- *
- * @see PatternRule#endSequenceDetected
- */
- protected boolean endSequenceDetected(ICharacterScanner scanner) {
- boolean success = super.endSequenceDetected(scanner);
- if(success) {
- for (int length = this.fEndSequence.length-1; length > 0; length--) {
- scanner.unread();
- }
-
- if(this.sequenceDetected(scanner, this.fEndSequence, false)) {
- for (int length = this.fEndSequence.length; length > 0; length--) {
- scanner.unread();
- }
- }
- }
- return success;
- }
- }
-
- /**
- * <p>Same as an {@link EndOfLineRule} except the given start sequence is not counted as part of the match.</p>
- *
- * @see EndOfLineRule
- */
- private static class NoneInclusiveStartSequenceEndOfLineRule extends EndOfLineRule {
-
- /**
- * @param startSequence start sequence the identifies the start of this match but is not counted as part of the match
- * @param token to return on a match by this rule
- */
- public NoneInclusiveStartSequenceEndOfLineRule(String startSequence, IToken token) {
- super(startSequence, token);
- }
-
- /**
- * <p>Same as overridden function except unreads the scanner back the length of the start sequence
- * since the start sequence is not counted as part of the match.</p>
- *
- * @see org.eclipse.jface.text.rules.PatternRule#doEvaluate(org.eclipse.jface.text.rules.ICharacterScanner, boolean)
- */
- protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) {
- if (resume) {
- if (endSequenceDetected(scanner))
- return fToken;
- } else {
- //unread the length of the start sequence since it is not counted as part of the match
- for(int i = 0; i < this.fStartSequence.length && scanner.getColumn() >= 0; ++i) {
- scanner.unread();
- }
-
- int c= scanner.read();
- if (c == fStartSequence[0]) {
- if (sequenceDetected(scanner, fStartSequence, false)) {
- if (endSequenceDetected(scanner))
- return fToken;
- }
- }
-
- //be sure to re-read the length of the start sequence if we did not match
- for(int i = 0; i < this.fStartSequence.length && scanner.getColumn() >= 0; ++i) {
- scanner.read();
- }
- }
-
- scanner.unread();
- return Token.UNDEFINED;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
deleted file mode 100644
index a16268abfd..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
+++ /dev/null
@@ -1,35 +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.jsdt.web.ui.internal.style.java;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
deleted file mode 100644
index 75357fcaf3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.jsdt.web.ui.internal.style.java;
-
-import java.util.Collection;
-
-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.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.HTMLUIPlugin;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
-import org.eclipse.wst.jsdt.web.ui.internal.style.IStyleConstantsJs;
-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;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class LineStyleProviderForJSDT extends AbstractLineStyleProvider implements LineStyleProvider {
- /** The scanner it uses */
- private JSDTCodeScanner fScanner;
-
- private IPropertyChangeListener fPreferenceListener = new IPropertyChangeListener() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // have to do it this way so others can override the method
- handlePropertyChange(event);
- }
- };
-
- public LineStyleProviderForJSDT() {
- super();
- fScanner = new JSDTCodeScanner();
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- protected void addTextAttribute(String colorKey) {
- IPreferenceStore javaStore = getJavaColorPreferences();
- if (javaStore != null && colorKey != null) {
- TextAttribute ta = null;
- if (colorKey == IStyleConstantsJSDT.JAVA_KEYWORD) {
- // keyword
- RGB foreground = PreferenceConverter.getColor(javaStore, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
- boolean bold = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
- boolean italics = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
- boolean strikethrough = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
- boolean underline = javaStore.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 == IStyleConstantsJSDT.JAVA_STRING) {
- // string
- RGB foreground = PreferenceConverter.getColor(javaStore, PreferenceConstants.EDITOR_STRING_COLOR);
- boolean bold = javaStore.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD);
- boolean italics = javaStore.getBoolean(PreferenceConstants.EDITOR_STRING_ITALIC);
- boolean strikethrough = javaStore.getBoolean(PreferenceConstants.EDITOR_STRING_STRIKETHROUGH);
- boolean underline = javaStore.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 == IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT) {
- // single line comment
- RGB foreground = PreferenceConverter.getColor(javaStore, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
- boolean bold = javaStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD);
- boolean italics = javaStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC);
- boolean strikethrough = javaStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_STRIKETHROUGH);
- boolean underline = javaStore.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 == IStyleConstantsJSDT.JAVA_MULTI_LINE_COMMENT) {
- // multi line comment
- RGB foreground = PreferenceConverter.getColor(javaStore, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR);
- boolean bold = javaStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD);
- boolean italics = javaStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_ITALIC);
- boolean strikethrough = javaStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_STRIKETHROUGH);
- boolean underline = javaStore.getBoolean(PreferenceConstants.EDITOR_MULTI_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 == IStyleConstantsJSDT.JAVA_DEFAULT) {
- // default
- RGB foreground = PreferenceConverter.getColor(javaStore, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
- boolean bold = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
- boolean italics = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
- boolean strikethrough = javaStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
- boolean underline = javaStore.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);
- } else if(colorKey == IStyleConstantsXML.COMMENT_BORDER ||
- colorKey == IStyleConstantsJs.JSP_CONTENT) {
-
- /** @see AbstractLineStyleProvider#addTextAttribute */
- ta = (TextAttribute)getTextAttributes().get(colorKey);
- String prefString = getHTMLColorPreferences().getString(colorKey);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
- boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italic) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, background, style);
- }
- }
- if (ta != null) {
- getTextAttributes().put(colorKey, ta);
- fScanner.setTokenData(colorKey, ta);
- }
- }
- }
-
- /**
- * 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(IStyleConstantsJs.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);
- }
-
- protected IPreferenceStore getColorPreferences() {
- return JsUIPlugin.getDefault().getPreferenceStore();
- }
-
- private IPreferenceStore getJavaColorPreferences() {
- return PreferenceConstants.getPreferenceStore();
- }
-
- private IPreferenceStore getHTMLColorPreferences() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * 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(IStyleConstantsJSDT.JAVA_DEFAULT);
- }
- return ta;
- }
-
- 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.COMMENT_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.COMMENT_BORDER;
- } else if(IStyleConstantsXML.COMMENT_TEXT.equals(prefKey)) {
- styleKey = IStyleConstantsXML.COMMENT_TEXT;
- } else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
- styleKey = IStyleConstantsJSDT.JAVA_KEYWORD;
- } else if (PreferenceConstants.EDITOR_STRING_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_STRING_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_STRING_ITALIC.equals(prefKey))) {
- styleKey = IStyleConstantsJSDT.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))) {
- styleKey = IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT;
- } else if (PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_ITALIC.equals(prefKey))) {
- styleKey = IStyleConstantsJSDT.JAVA_MULTI_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))) {
- styleKey = IStyleConstantsJSDT.JAVA_DEFAULT;
- }
- }
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- fRecHighlighter.refreshDisplay();
- fScanner.initializeRules();
- }
- }
-
- protected void loadColors() {
- addTextAttribute(IStyleConstantsXML.COMMENT_BORDER);
- addTextAttribute(IStyleConstantsXML.COMMENT_TEXT);
- addTextAttribute(IStyleConstantsJs.JSP_CONTENT);
- addTextAttribute(IStyleConstantsJSDT.JAVA_KEYWORD);
- addTextAttribute(IStyleConstantsJSDT.JAVA_STRING);
- addTextAttribute(IStyleConstantsJSDT.JAVA_SINGLE_LINE_COMMENT);
- addTextAttribute(IStyleConstantsJSDT.JAVA_MULTI_LINE_COMMENT);
- addTextAttribute(IStyleConstantsJSDT.JAVA_DEFAULT);
- fScanner.initializeRules();
- }
-
- 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 TextAttribute getAttributeFor(ITextRegion region) {
- return null;
- }
-
- protected void registerPreferenceManager() {
- getColorPreferences().addPropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
- this.getHTMLColorPreferences().addPropertyChangeListener(fPreferenceListener);
- }
-
- public void release() {
- super.release();
- fScanner = null;
- }
-
- protected void unRegisterPreferenceManager() {
- getColorPreferences().removePropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
- this.getHTMLColorPreferences().removePropertyChangeListener(fPreferenceListener);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
deleted file mode 100644
index bd00e78d09..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
+++ /dev/null
@@ -1,203 +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.jsdt.web.ui.internal.taginfo;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.net.URL;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class HTMLPrinter {
- static RGB BG_COLOR_RGB = null;
- static {
- final Display display = Display.getDefault();
- if (display != null && !display.isDisposed()) {
- try {
- display.asyncExec(new Runnable() {
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() {
- HTMLPrinter.BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
- }
- });
- } catch (SWTError err) {
- // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
- if (err.code != SWT.ERROR_DEVICE_DISPOSED) {
- throw err;
- }
- }
- }
- }
-
- public static void addBullet(StringBuffer buffer, String bullet) {
- if (bullet != null) {
- buffer.append("<li>"); //$NON-NLS-1$
- buffer.append(bullet);
- buffer.append("</li>"); //$NON-NLS-1$
- }
- }
-
- public static void addPageEpilog(StringBuffer buffer) {
- buffer.append("</font></body></html>"); //$NON-NLS-1$
- }
-
- public static void addPageProlog(StringBuffer buffer) {
- HTMLPrinter.insertPageProlog(buffer, buffer.length());
- }
-
- public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
- if (paragraphReader != null) {
- HTMLPrinter.addParagraph(buffer, HTMLPrinter.read(paragraphReader));
- }
- }
-
- public static void addParagraph(StringBuffer buffer, String paragraph) {
- if (paragraph != null) {
- buffer.append("<p>"); //$NON-NLS-1$
- buffer.append(paragraph);
- }
- }
-
- public static void addSmallHeader(StringBuffer buffer, String header) {
- if (header != null) {
- buffer.append("<h5>"); //$NON-NLS-1$
- buffer.append(header);
- buffer.append("</h5>"); //$NON-NLS-1$
- }
- }
-
- private static void appendColor(StringBuffer buffer, RGB rgb) {
- buffer.append('#');
- buffer.append(Integer.toHexString(rgb.red));
- buffer.append(Integer.toHexString(rgb.green));
- buffer.append(Integer.toHexString(rgb.blue));
- }
-
- private static void appendStyleSheetLink(StringBuffer buffer, URL styleSheetURL) {
- if (styleSheetURL == null) {
- return;
- }
- buffer.append("<head>"); //$NON-NLS-1$
- buffer.append("<LINK REL=\"stylesheet\" HREF= \""); //$NON-NLS-1$
- buffer.append(styleSheetURL);
- buffer.append("\" CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
- buffer.append("</head>"); //$NON-NLS-1$
- }
-
- public static String convertToHTMLContent(String content) {
- content = HTMLPrinter.replace(content, '&', "&amp;"); //$NON-NLS-1$
- content = HTMLPrinter.replace(content, '"', "&quot;"); //$NON-NLS-1$
- content = HTMLPrinter.replace(content, '<', "&lt;"); //$NON-NLS-1$
- return HTMLPrinter.replace(content, '>', "&gt;"); //$NON-NLS-1$
- }
-
- public static void endBulletList(StringBuffer buffer) {
- buffer.append("</ul>"); //$NON-NLS-1$
- }
-
- private static RGB getBgColor() {
- if (HTMLPrinter.BG_COLOR_RGB != null) {
- return HTMLPrinter.BG_COLOR_RGB;
- }
- // RGB value of info bg color on WindowsXP
- return new RGB(255, 255, 225);
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position) {
- HTMLPrinter.insertPageProlog(buffer, position, HTMLPrinter.getBgColor());
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB) {
- if (bgRGB == null) {
- HTMLPrinter.insertPageProlog(buffer, position);
- } else {
- StringBuffer pageProlog = new StringBuffer(60);
- pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
- HTMLPrinter.appendColor(pageProlog, bgRGB);
- pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
- buffer.insert(position, pageProlog.toString());
- }
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
- if (bgRGB == null) {
- HTMLPrinter.insertPageProlog(buffer, position, styleSheetURL);
- } else {
- StringBuffer pageProlog = new StringBuffer(300);
- pageProlog.append("<html>"); //$NON-NLS-1$
- HTMLPrinter.appendStyleSheetLink(pageProlog, styleSheetURL);
- pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
- HTMLPrinter.appendColor(pageProlog, bgRGB);
- pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
- buffer.insert(position, pageProlog.toString());
- }
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
- HTMLPrinter.insertPageProlog(buffer, position, HTMLPrinter.getBgColor(), styleSheetURL);
- }
-
- static String read(Reader rd) {
- StringBuffer buffer = new StringBuffer();
- char[] readBuffer = new char[2048];
- try {
- int n = rd.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n = rd.read(readBuffer);
- }
- return buffer.toString();
- } catch (IOException x) {
- // never expected
- Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
- }
- return null;
- }
-
- private static String replace(String text, char c, String s) {
- int previous = 0;
- int current = text.indexOf(c, previous);
- if (current == -1) {
- return text;
- }
- StringBuffer buffer = new StringBuffer();
- while (current > -1) {
- buffer.append(text.substring(previous, current));
- buffer.append(s);
- previous = current + 1;
- current = text.indexOf(c, previous);
- }
- buffer.append(text.substring(previous));
- return buffer.toString();
- }
-
- public static void startBulletList(StringBuffer buffer) {
- buffer.append("<ul>"); //$NON-NLS-1$
- }
-
- private HTMLPrinter() {
- // nothing
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
deleted file mode 100644
index d5e16697ea..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
+++ /dev/null
@@ -1,167 +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.jsdt.web.ui.internal.taginfo;
-
-import java.io.Reader;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.ui.JSdocContentAccess;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JSDTHoverProcessor extends AbstractHoverProcessor {
- /*
- * Bulk of the work was copied from
- * org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover
- */
- private final long LABEL_FLAGS = JavaScriptElementLabels.ALL_FULLY_QUALIFIED | JavaScriptElementLabels.M_PRE_RETURNTYPE | JavaScriptElementLabels.M_PARAMETER_TYPES | JavaScriptElementLabels.M_PARAMETER_NAMES | JavaScriptElementLabels.M_EXCEPTIONS | JavaScriptElementLabels.F_PRE_TYPE_SIGNATURE | JavaScriptElementLabels.M_PRE_TYPE_PARAMETERS | JavaScriptElementLabels.T_TYPE_PARAMETERS | JavaScriptElementLabels.USE_RESOLVED;
- private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaScriptElementLabels.F_FULLY_QUALIFIED | JavaScriptElementLabels.F_POST_QUALIFIED;
-
- private String getHoverInfo(IJavaScriptElement[] 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);
- IJavaScriptElement curr = result[i];
- if (curr instanceof IMember || curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
- HTMLPrinter.addBullet(buffer, getInfoText(curr));
- }
- HTMLPrinter.endBulletList(buffer);
- }
- } else {
- IJavaScriptElement curr = result[0];
- if (curr == null) {
- return null;
- }
- if (curr instanceof IMember) {
- IMember member = (IMember) curr;
- HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
- Reader reader;
- try {
- reader = JSdocContentAccess.getHTMLContentReader(member, true, true);
- } catch (JavaScriptModelException ex) {
- return null;
- }
- if (reader != null) {
- HTMLPrinter.addParagraph(buffer, reader);
- }
- } else if (curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
- 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 = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
- if (xmlModel != null) {
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- if (adapter != null) {
- IJsTranslation translation = adapter.getJsTranslation(true);
- IJavaScriptElement[] result = translation.getElementsFromJsRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
-// Vector filteredResults = new Vector();
-// List badFunctions = translation.getGeneratedFunctionNames();
-// boolean bad = false;
-// for(int i = 0;i<result.length;i++){
-// bad=false;
-// if(result[i] instanceof IFunction){
-// for(int j=0;j<badFunctions.size() && ! bad;j++){
-// if(((IFunction)result[i]).getElementName().equalsIgnoreCase((String)badFunctions.get(j))){
-// bad=true;
-// continue;
-// }
-// }
-// if(!bad)filteredResults.add(result[i]);
-// }
-// }
-// if(filteredResults.size()<1) return new String();
-//
-// String filteredResult =
-// translation.fixupMangledName(getHoverInfo((IJavaScriptElement[])filteredResults.toArray(new
-// IJavaScriptElement[]{})));
-// for(int i = 0;i<badFunctions.size();i++){
-// filteredResult.replace((String)badFunctions.get(i), "");
-// }
-// return filteredResult;
- 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 JsWordFinder.findWord(textViewer.getDocument(), offset);
- }
-
- private String getInfoText(IJavaScriptElement member) {
- long flags = member.getElementType() == IJavaScriptElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
- String label = JavaScriptElementLabels.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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
deleted file mode 100644
index b9311afa9f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
+++ /dev/null
@@ -1,71 +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.jsdt.web.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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JsWordFinder {
- 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);
- // System.out.println("JavaWordFinder.findWord() Test java char
- // (--):" + c);
- if (!Character.isJavaIdentifierPart(c)) {
- break;
- }
- --pos;
- }
- start = pos;
- pos = offset;
- int length = document.getLength();
- while (pos < length) {
- c = document.getChar(pos);
- // System.out.println("JavaWordFinder.findWord() Test java char
- // (++):" + c);
- if (!Character.isJavaIdentifierPart(c)) {
- break;
- }
- ++pos;
- }
- end = pos;
- // System.out.println("Start:" + start + "End:"+end);
- // System.out.println("JavaWordFinder.findWord() Retrieved java
- // token of:" + document.get(start, end-start) );
- } 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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
deleted file mode 100644
index 38d02d7ad7..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
+++ /dev/null
@@ -1,293 +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.wst.jsdt.web.ui.internal.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.link.ILinkedModeListener;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
-import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.text.JavaHeuristicScanner;
-import org.eclipse.wst.jsdt.internal.ui.text.Symbols;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
-
-/**
- * <p>Inserts character pairs in script regions in HTML and JSP documents based on the Javascript
- * character pairing preferences.</p>
- */
-public class JsCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener{
-
- private boolean fCloseStrings;
- private boolean fCloseBrackets;
- private boolean fCloseBraces;
- private boolean fCloseAngularBrackets;
-
- /**
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#hasPair(char)
- */
- public boolean hasPair(char c) {
- switch (c) {
- case '(':
- case '<':
- case '[':
- case '\'':
- case '\"':
- case '{':
- return true;
- default:
- return false;
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#shouldPair(org.eclipse.jface.text.source.ISourceViewer, char)
- */
- protected boolean shouldPair(ISourceViewer viewer, char c) {
- IDocument document= viewer.getDocument();
-
- final Point selection= viewer.getSelectedRange();
- final int offset= selection.x;
- final int length= selection.y;
-
- try {
- IRegion startLine= document.getLineInformationOfOffset(offset);
- IRegion endLine= document.getLineInformationOfOffset(offset + length);
-
- JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
- int nextToken= scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());
- String next= nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();
- int prevToken= scanner.previousToken(offset - 1, startLine.getOffset());
- int prevTokenOffset= scanner.getPosition() + 1;
- String previous= prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
-
- switch (c) {
- case '(':
- if (!fCloseBrackets
- || nextToken == Symbols.TokenLPAREN
- || nextToken == Symbols.TokenIDENT
- || next != null && next.length() > 1)
- return false;
- break;
-
- case '<':
- if (!(fCloseAngularBrackets && fCloseBrackets)
- || nextToken == Symbols.TokenLESSTHAN
- || prevToken != Symbols.TokenLBRACE
- && prevToken != Symbols.TokenRBRACE
- && prevToken != Symbols.TokenSEMICOLON
- && prevToken != Symbols.TokenSYNCHRONIZED
- && prevToken != Symbols.TokenSTATIC
- && (prevToken != Symbols.TokenIDENT || !isAngularIntroducer(previous))
- && prevToken != Symbols.TokenEOF)
- return false;
- break;
-
- case '{':
- if (!fCloseBraces
- || nextToken == Symbols.TokenIDENT
- || next != null && next.length() > 1)
- return false;
- break;
- case '[':
- if (!fCloseBrackets
- || nextToken == Symbols.TokenIDENT
- || next != null && next.length() > 1)
- return false;
- break;
-
- case '\'':
- case '"':
- if (!fCloseStrings
- || nextToken == Symbols.TokenIDENT
- || prevToken == Symbols.TokenIDENT
- || next != null && next.length() > 1
- || previous != null && previous.length() > 1)
- return false;
- break;
-
- default:
- return false;
- }
- } catch (BadLocationException e) {
- return false;
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getPair(char)
- */
- protected char getPair(char c) {
- switch (c) {
- case '(':
- return ')';
- case '<':
- return '>';
- case '[':
- return ']';
- case '{':
- return '}';
- case '\'':
- return c;
- case '\"':
- return c;
- default:
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * <p>Initialize the preference listener</p>
- *
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#initialize()
- */
- public void initialize() {
- super.initialize();
- IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
- this.fCloseStrings = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_STRINGS);
- this.fCloseBrackets = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS);
- this.fCloseBraces = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
- this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(
- preferenceStore.getString(JavaScriptCore.COMPILER_SOURCE)) <= 0;
- preferenceStore.addPropertyChangeListener(this);
- }
-
- /**
- * <p>Dispose the preference listener</p>
- *
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#dispose()
- */
- public void dispose() {
- JavaScriptPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- super.dispose();
- }
-
- /**
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (PreferenceConstants.EDITOR_CLOSE_STRINGS.equals(event.getProperty())){
- this.fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
- } else if (PreferenceConstants.EDITOR_CLOSE_BRACKETS.equals(event.getProperty())) {
- this.fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
- } else if (PreferenceConstants.EDITOR_CLOSE_BRACES.equals(event.getProperty())) {
- this.fCloseBraces = ((Boolean) event.getNewValue()).booleanValue();
- } else if (JavaScriptCore.COMPILER_SOURCE.equals(event.getProperty())) {
- IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
- this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(preferenceStore.getString(
- JavaScriptCore.COMPILER_SOURCE)) <= 0;
- }
- }
-
- /**
- * TODO: IAN: comment me
- * @param identifier
- * @return
- */
- private boolean isAngularIntroducer(String identifier) {
- return identifier.length() > 0
- && (Character.isUpperCase(identifier.charAt(0))
- || identifier.startsWith("final") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("protected") //$NON-NLS-1$
- || identifier.startsWith("private")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getExitPolicy(char, char, org.eclipse.jface.text.IDocument)
- */
- protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
- return new ExitPolicy(exit, escape, document);
- }
-
- /**
- * <p>An exit policy that deals with a user adding a carriage return between {}.
- * In that case rather then exiting to the exit position the linked mode is exited
- * and the carriage return inserted.</p>
- */
- private static class ExitPolicy implements IExitPolicy {
-
- /** exit character */
- private char fExit;
-
- /** escape character for the exit character */
- private char fEscape;
-
- /** document to execute this exit policy on */
- private IDocument fDocument;
-
- /**
- * <p>Default constructor</p>
- *
- * @param exit exit character
- * @param escape escape character for the exit character
- * @param document document to execute this exit policy on
- */
- public ExitPolicy(char exit, char escape, IDocument document) {
- fExit = exit;
- fEscape = escape;
- fDocument = document;
- }
-
- /**
- * @see org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy#doExit(org.eclipse.jface.text.link.LinkedModeModel, org.eclipse.swt.events.VerifyEvent, int, int)
- */
- public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
- if(!isMasked(offset)) {
- // if exit character then exit to exit location
- if (event.character == fExit) {
- return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
- }
-
- // if carriage return and previous character is { then exit linked mode and insert return
- if (event.character == SWT.CR && offset > 0) {
- try {
- if (this.fDocument.getChar(offset - 1) == '{') {
- return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
- }
- } catch (BadLocationException e) {
- Logger.logException("Error while trying to exit linked mode", e); //$NON-NLS-1$
- }
- }
- }
- return null;
- }
-
- /**
- * <p>Determine if the exit character has been escaped.<p>
- *
- * @param offset current offset in the document
- * @return <code>true</code> if exit character escaped, <code>false</code> otherwise
- */
- private boolean isMasked(int offset) {
- try {
- return fEscape == fDocument.getChar(offset - 1);
- } catch (BadLocationException e) {
- }
- return false;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
deleted file mode 100644
index 29937d0e11..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
+++ /dev/null
@@ -1,225 +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
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.wst.jsdt.web.ui.internal.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.jsdt.web.ui.internal.derived.SingleCharReader;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JsCodeReader extends SingleCharReader {
- /** The EOF character */
- public static final int EOF = -1;
- private int fCachedLineNumber = -1;
- private int fCachedLineOffset = -1;
- private IDocument fDocument;
- private int fEnd = -1;
- private boolean fForward = false;
- private int fOffset;
- private boolean fSkipComments = false;
- private boolean fSkipStrings = false;
-
- public JsCodeReader() {}
-
- /*
- * @see Reader#close()
- */
-
- public void close() throws IOException {
- fDocument = null;
- }
-
- 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());
- }
- }
-
- 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);
- }
-
- /**
- * 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;
- }
-
- 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 gotoCommentStart() throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset--);
- if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/') {
- return;
- }
- }
- }
-
- private void gotoLineEnd() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- fOffset = fDocument.getLineOffset(line + 1);
- }
-
- 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 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 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;
- }
- }
- }
- }
-
- /*
- * @see SingleCharReader#read()
- */
-
- public int read() throws IOException {
- try {
- return fForward ? readForwards() : readBackwards();
- } catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- 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 JsCodeReader.EOF;
- }
-
- 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 JsCodeReader.EOF;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 86c10d8a8a..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,34 +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.jsdt.web.ui.internal.text;
-
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
- protected final static char[] BRACKETS = { '{', '}', '(', ')', '[', ']' };
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public JsDocumentRegionEdgeMatcher() {
- super(new String[] { DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN,
- DOMRegionContext.XML_PI_CONTENT }, new JsPairMatcher(JsDocumentRegionEdgeMatcher.BRACKETS));
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
deleted file mode 100644
index a1965a0833..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
+++ /dev/null
@@ -1,185 +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.jsdt.web.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;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-class JsPairMatcher implements ICharacterPairMatcher {
- protected int fAnchor;
- protected IDocument fDocument;
- protected int fEndPos;
- protected int fOffset;
- protected char[] fPairs;
- protected JsCodeReader fReader = new JsCodeReader();
- protected int fStartPos;
-
- public JsPairMatcher(char[] pairs) {
- fPairs = pairs;
- }
-
- /*
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- if (fReader != null) {
- try {
- fReader.close();
- } catch (IOException x) {
- // ignore
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- clear();
- fDocument = null;
- fReader = 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#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;
- }
-
- 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 = ICharacterPairMatcher.RIGHT;
- fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
- if (fStartPos > -1) {
- return true;
- } else {
- fEndPos = -1;
- }
- } else if (fStartPos > -1) {
- fAnchor = ICharacterPairMatcher.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 != JsCodeReader.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 != JsCodeReader.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.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
deleted file mode 100644
index c6061c4829..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
+++ /dev/null
@@ -1,11 +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
-###############################################################################
-WebProjectJsGlobalScopeContainerInitializer.0=Web Project support for JSDT
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg
deleted file mode 100644
index b5a6af566e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpg
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
deleted file mode 100644
index b69918f873..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
+++ /dev/null
@@ -1,34 +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.wst.jsdt.web.ui.views.contentoutline;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.w3c.dom.Node;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public interface IJavaWebNode {
- public IJavaScriptElement getJavaElement();
-
- public Node getParentNode();
-
- public boolean hasChildren();
-
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
deleted file mode 100644
index 9afa9561e6..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
+++ /dev/null
@@ -1,55 +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.jsdt.web.ui.views.contentoutline;
-
-import org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JFaceNodeAdapterFactoryForJSDT extends JFaceNodeAdapterFactory {
- public JFaceNodeAdapterFactoryForJSDT() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryForJSDT(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
- public INodeAdapterFactory copy() {
- return new JFaceNodeAdapterFactoryForJSDT(getAdapterKey(), isShouldRegisterAdapter());
- }
-
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- // singletonAdapter = new JFaceNodeAdapterForJSDT(this);
- if (JsContentOutlineConfig.USE_ADVANCED) {
- singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JFaceNodeAdapterForJs(this);
- } else {
- singletonAdapter = new org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterForJs(this);
- }
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
deleted file mode 100644
index 456ef6f5ac..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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
- * bug:244839 - eugene@genuitec.com
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.Position;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.ISourceReference;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.internal.core.Member;
-import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-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.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.NodeImpl;
-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.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.w3c.dom.Node;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
-
- public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- private IJavaScriptUnit lazyCu;
- private IProgressMonitor monitor;
- private JavaScriptElementLabelProvider javaElementLabelProvider;
-
- public Object[] getChildren(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().getChildren(object);
- }
- if (object instanceof IJavaWebNode) {
- JavaElement enclosedElement = (JavaElement) ((IJavaWebNode) object).getJavaElement();
- if (enclosedElement != null) {
- try {
- IJavaScriptElement[] children = enclosedElement.getChildren();
- if (children == null) {
- return new IJavaScriptElement[0];
- }
- Object[] nodes = new Object[children.length];
- Node parent = ((IJavaWebNode) object).getParentNode();
-
- for (int i = 0; i < children.length; i++) {
- // int htmllength = ((SourceRefElement) (children[i])).getSourceRange().getLength();
- // int htmloffset = ((SourceRefElement) (children[i])).getSourceRange().getOffset();
- IJavaScriptElement javaElement = children[i];
- ISourceRange range = null;
- if (javaElement instanceof Member) {
- range = ((IMember) javaElement).getNameRange();
- } else {
- range = ((ISourceReference) javaElement).getSourceRange();
- }
- int htmllength = range.getLength();
- int htmloffset = range.getOffset();
-
-
- Position position = new Position(htmloffset, htmllength);
- nodes[i] = getJsNode(parent, javaElement, position);
- }
- return nodes;
- } catch (JavaScriptModelException ex) {
- }
- }
- }
- Node node = (Node) object;
- if (isJSElementParent(node)) {
- Object[] results = getJSElementsFromNode(node.getFirstChild(), true);
-
-
- return filter( results );
- }
- return super.getChildren(object);
- }
-
- /*
- * @GINO: Anonymous -- matches anonymous types on the top level
- */
- protected boolean matches(Object elementObj) {
-
- if( elementObj instanceof IJavaWebNode ){
- IJavaScriptElement element = ((IJavaWebNode)elementObj).getJavaElement();
- if (element.getElementType() == IJavaScriptElement.TYPE && element.getParent().getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT ) {
-
- IType type = (IType)element;
- try {
- return type.isAnonymous();
- } catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
-
- return false;
- }
-
- /*
- * @GINO: Anonymous Filter from top level
- *
- */
- protected Object[] filter(Object[] children) {
- boolean initializers= false;
- for (int i= 0; i < children.length; i++) {
- if (matches(children[i])) {
- initializers= true;
- break;
- }
- }
-
- if (!initializers)
- return children;
-
- Vector v= new Vector();
- for (int i= 0; i < children.length; i++) {
- if (matches(children[i]))
- continue;
- v.addElement(children[i]);
- }
-
- Object[] result= new Object[v.size()];
- v.copyInto(result);
- return result;
- }
-
- public Object[] getElements(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().getElements(object);
- }
- return super.getElements(object);
- }
-
- private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
- if(javaElementLabelProvider==null) {
- javaElementLabelProvider = new JavaScriptElementLabelProvider();
- }
- return javaElementLabelProvider;
- }
-
- private StandardJavaScriptElementContentProvider getJavaElementProvider() {
- return new StandardJavaScriptElementContentProvider(true);
- }
-
- private Object[] filterChildrenForRange(IJavaScriptElement[] allChildren, Node node) {
- // int javaPositionStart = ((NodeImpl) node).getStartOffset();
- // int javaPositionEnd = ((NodeImpl) node).getEndOffset();
-
- // Object[] result =new Object[0];
-
- int javaPositionEnd = ((NodeImpl) node).getEndOffset();
- int javaPositionStart = ((NodeImpl) node).getStartOffset();
-
- Vector validChildren = new Vector();
- for (int i = 0; i < allChildren.length; i++) {
- if (allChildren[i] instanceof IJavaScriptElement) {
- ISourceRange range = null;
- if (allChildren[i] instanceof Member) {
- try {
- range = ((Member) allChildren[i]).getNameRange();
- } catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else if (allChildren[i] instanceof SourceRefElement) {
- try {
- range = ((SourceRefElement)allChildren[i] ).getSourceRange();
- } catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- if (allChildren[i].getElementType() == IJavaScriptElement.TYPE || (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) {
-
-
- int htmllength = range == null ? 0 : range.getLength();
- int htmloffset = range == null ? 0 : range.getOffset();
- if (htmllength < 0 || htmloffset < 0) {
- continue;
- }
- Position position = new Position(htmloffset, htmllength);
- validChildren.add(getJsNode(node.getParentNode(), allChildren[i], position));
-
-
- }
- }
- }
- Object[] result = new Object[0];
-
-
- if (validChildren.size() > 0) {
- result = validChildren.toArray();
- }
- if (result == null || result.length == 0) {
- return new IJavaScriptElement[0];
- }
- return result;
- }
-
- private synchronized Object[] getJSElementsFromNode(Node node, boolean ensureConsistant) {
-
-// int startOffset = 0;
-// int endOffset = 0;
-// int type = node.getNodeType();
- Object[] result = null;
- //JsTranslation translation = null;
- if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
-// startOffset = ((NodeImpl) node).getStartOffset();
-// endOffset = ((NodeImpl) node).getEndOffset();
- IJavaScriptUnit unit = getLazyCu(node);
- // Genuitec Begin Fix 6149: Exception opening external HTML file
- if (unit == null) {
- return new Object[0];
- }
- // Genuitec End Fix 6149: Exception opening external HTML file
- try {
- if(ensureConsistant) unit.makeConsistent(getProgressMonitor());
- } catch (JavaScriptModelException ex1) {
- // TODO Auto-generated catch block
- ex1.printStackTrace();
- }
- try {
- result = filterChildrenForRange(unit.getChildren(),node);
- } catch (JavaScriptModelException ex) {
- // TODO Auto-generated catch block
- ex.printStackTrace();
- result = new Object[0];
- lazyCu=null;
- }
-
- //translation = getTranslation(node);
- //result = translation.getAllElementsInJsRange(startOffset, endOffset);
- }
- return result;
- }
-
- private IProgressMonitor getProgressMonitor() {
- if(monitor==null) {
- monitor = new NullProgressMonitor();
- }
-
- return monitor;
-
- }
-
- private Object getJsNode(Node parent, IJavaScriptElement root, Position position) {
- JsJfaceNode instance = null;
- if (root.getElementType() == IJavaScriptElement.TYPE) {
- instance = new JsJfaceNode(parent, root, position, ((SourceRefElement) root).getElementName());
- } else if (root.getElementType() == IJavaScriptElement.FIELD) {
- /* Field refrence, possibly to a type may need to implement later */
- instance = new JsJfaceNode(parent, root, position);
- } else {
- instance = new JsJfaceNode(parent, root, position);
- }
- String name = getJavaElementLabelProvider().getText(root);
- instance.setName(name);
- // ((JsJfaceNode)instance).setAdapterRegistry(registry);
- INodeAdapter adapter = (instance).getAdapterFor(IJFaceNodeAdapter.class);
- if (!(adapter instanceof JFaceNodeAdapterForJs)) {
- (instance).removeAdapter(adapter);
- (instance).addAdapter(this);
- }
- return instance;
- }
-
-
- public Image getLabelImage(Object node) {
- if (node instanceof JsJfaceNode) {
- return ((JsJfaceNode) node).getImage();
- }
- if (node instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getImage(node);
- }
- return super.getLabelImage(node);
- }
-
-
- public String getLabelText(Object node) {
-// if (node instanceof JsJfaceNode) {
-// return ((JsJfaceNode) node).getName();
-// }
- if (node instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getText(node);
- }
- return super.getLabelText(node);
- }
-
-
- public Object getParent(Object element) {
- if (element instanceof IJavaScriptElement) {
- return getJavaElementProvider().getParent(element);
- }
- return super.getParent(element);
- }
-
- private IJavaScriptUnit getLazyCu(Node node) {
- if(lazyCu==null) {
- IJsTranslation tran = getTranslation(node);
- if(tran== null) return null;
- lazyCu = tran.getCompilationUnit();
- if(lazyCu==null) return null;
-
- try {
- lazyCu.makeConsistent( new NullProgressMonitor() );
- } catch (JavaScriptModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return lazyCu;
- }
-
- private IJsTranslation getTranslation(Node node) {
- IStructuredModel model = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IDOMDocument xmlDoc = null;
- try {
- if (modelManager != null) {
- IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument();
- model = modelManager.getExistingModelForRead(doc);
- // model = modelManager.getModelForRead(doc);
- }
- IDOMModel domModel = (IDOMModel) model;
- if(domModel == null) return null;
- xmlDoc = domModel.getDocument();
- } catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (model != null) {
- // model.changedModel();
- model.releaseFromRead();
- }
- }
- if (xmlDoc == null) {
- return null;
- }
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- return translationAdapter.getJsTranslation(true);
- }
-
-
- public boolean hasChildren(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().hasChildren(object);
- }
- Node node = (Node) object;
- if (node instanceof IJavaWebNode) {
- return ((IJavaWebNode) object).hasChildren();
-
- }
- if (isJSElementParent(node)) {
- Object[] nodes = getJSElementsFromNode(node.getFirstChild(),false);
- boolean hasElements = (nodes != null && nodes.length > 0);
- return hasElements;
- }
- return super.hasChildren(object);
- }
-
- private boolean isJSElementParent(Node node) {
- return (node.hasChildNodes() && node.getNodeName().equalsIgnoreCase("script")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
deleted file mode 100644
index 0f5b3410d1..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.views.contentoutline;
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.IModelManager;
-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.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsJfaceNode extends ElementImpl implements IndexedRegion, INodeNotifier, Node, IJavaWebNode {
- private class JsAdaptableNode extends AbstractNotifier {
-
- public FactoryRegistry getFactoryRegistry() {
- return adapterRegistry;
- }
- }
- private JsAdaptableNode adaptableDomNode = new JsAdaptableNode();
- private FactoryRegistry adapterRegistry;
- private Position fDocPosition;
-// private Node parent;
- private String typeName;
- //private IJavaScriptElement dirtyElement;
- private boolean hasChildren;
- //private String name;
- private Image me;
-
- public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation) {
- this(parent, originalElement, structureDocLocation, null);
- }
-
- public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation, String typeName) {
- //super();
- super(((ElementImpl)parent));
- // super(parentObject, parentObject.getElementName());
- fDocPosition = structureDocLocation;
- //this.parent = parent;
- this.typeName = typeName;
- try {
- hasChildren=((JavaElement)originalElement).hasChildren();
- } catch (JavaScriptModelException ex) {
- hasChildren=false;
- }
- removeAttributes();
- me = (new JavaScriptElementLabelProvider(JavaScriptElementLabelProvider.SHOW_DEFAULT|JavaScriptElementLabelProvider.SHOW_SMALL_ICONS)).getImage(originalElement);
- }
-
- public Image getImage() {
- return me;
- }
-
- public boolean hasChildren() {
-// try {
-// return ((JavaElement)this.dirtyElement).hasChildren();
-// } catch (JavaScriptModelException ex) {
-// // TODO Auto-generated catch block
-// ex.printStackTrace();
-// }
- return hasChildren;
- }
-
-
- public void setName(String name) {
- super.setTagName(name);
- }
-
- public void addAdapter(INodeAdapter adapter) {
- adaptableDomNode.addAdapter(adapter);
- }
-
-
- public boolean contains(int testPosition) {
- return false;
- }
-
-
- public boolean equals(Object o) {
- return (o != null && o instanceof JsJfaceNode && ((JsJfaceNode) o).fDocPosition == this.fDocPosition);
- }
-
-// public static Object getInstance(Object parent, Position structureDocLocation
-// ){
-// //return new JsJfaceNode((JavaElement)parent.getParent(),
-// parent.getElementName(),structureDocLocation);
-// Vector interfaces = new Vector();
-// interfaces.addAll(Arrays.asList(parent.getClass().getInterfaces()));
-// JsJfaceNode me = new JsJfaceNode(parent,structureDocLocation);
-// interfaces.addAll(Arrays.asList(me.getClass().getInterfaces()));
-// Object proxy = null;
-// try {
-// proxy= Proxy.newProxyInstance(
-// parent.getClass().getClassLoader(),
-// (Class[])interfaces.toArray(new Class[]{}),me);
-// } catch (Exception e) {
-// // TODO Auto-generated catch block
-// System.out.println(e);
-// }
-// return proxy;
-// }
-//
-
- public INodeAdapter getAdapterFor(Object type) {
- return adaptableDomNode.getAdapterFor(type);
- }
-
-
- public Collection getAdapters() {
- return adaptableDomNode.getAdapters();
- }
-
-
- public int getEndOffset() {
- return fDocPosition.getOffset() + fDocPosition.getLength();
- }
-
-
- public INodeAdapter getExistingAdapter(Object type) {
- // TODO Auto-generated method stub
- return adaptableDomNode.getExistingAdapter(type);
- }
-
- public synchronized IJavaScriptElement getJavaElement() {
- /*
- * since this may become 'stale' we need to rediscover our element every
- * time we're asked
- */
- IJsTranslation tran = getTranslation();
- int startOffset = getStartOffset();
- int endOffset = getLength();
- if (typeName != null) {
- IJavaScriptElement myType = tran.getCompilationUnit().getType(typeName);
- return myType;
- }
- IJavaScriptElement elements[] = tran.getAllElementsInJsRange(startOffset, startOffset + endOffset);
- if (elements != null) {
- return elements[0];
- } else {
- System.out.println(Messages.getString("JsJfaceNode.1")); //$NON-NLS-1$
- return null;
- }
- }
-
-
- public int getLength() {
- return fDocPosition.getLength();
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xml.core.internal.document.NodeImpl#getOwnerDocument()
- */
-
-
-
-
-
-
-
- public int getStartOffset() {
- return fDocPosition.getOffset();
- }
-
-// private Method[] getMethods(){
-// // returns the methods this class supports (as declared in interfaces)
-// Class[] interfaces = getClass().getInterfaces();
-// Vector vMethods = new Vector();
-// for(int i = 0;i<interfaces.length;i++){
-// Method methods[] = interfaces[i].getDeclaredMethods();
-// vMethods.addAll(Arrays.asList(methods));
-// }
-//
-// return (Method[])vMethods.toArray();
-// }
-// public Object invoke(Object proxy, Method method, Object[] args) throws
-// Throwable {
-// Object result;
-// Method[] myMethods = getMethods();
-//
-// try {
-// for(int i = 0;i<myMethods.length;i++){
-// if(myMethods[i]==method){
-// return method.invoke(this, args);
-// }
-// }
-// result = method.invoke(parentType, args);
-// } catch (InvocationTargetException e) {
-// throw e.getTargetException();
-// } catch (Exception e) {
-// throw new RuntimeException("unexpected invocation exception: " +
-// e.getMessage());
-// }
-//
-// return result;
-// }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xml.core.internal.document.NodeImpl#getStructuredDocument()
- */
-
-
-
- public IJsTranslation getTranslation() {
- IStructuredModel model = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IDOMDocument xmlDoc = null;
- try {
- if (modelManager != null) {
- IStructuredDocument doc = getStructuredDocument();
- model = modelManager.getExistingModelForRead(doc);
- // model = modelManager.getModelForRead(doc);
- }
- IDOMModel domModel = (IDOMModel) model;
- xmlDoc = domModel.getDocument();
- } catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (model != null) {
- // model.changedModel();
- model.releaseFromRead();
- }
- }
- if (xmlDoc == null) {
- return null;
- }
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- return translationAdapter.getJsTranslation(true);
- }
-
-
- public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- adaptableDomNode.notify(eventType, changedFeature, oldValue, newValue, pos);
- }
-
-
- public void removeAdapter(INodeAdapter adapter) {
- adaptableDomNode.removeAdapter(adapter);
- }
-
- public void setAdapterRegistry(FactoryRegistry registry) {
- this.adapterRegistry = registry;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
deleted file mode 100644
index 8a4481361e..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
+++ /dev/null
@@ -1,46 +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.wst.jsdt.web.ui.views.contentoutline;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*
- * @author childsb
- *
- */
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.views.contentoutline.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
deleted file mode 100644
index b36e5bef71..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
+++ /dev/null
@@ -1,11 +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
-###############################################################################
-JsJfaceNode.1=error in JsJfaceNode... I couldn't retrieve my java element from the original page
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
deleted file mode 100644
index 6e47c34294..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.document.NodeImpl;
-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.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.w3c.dom.Node;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
- public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
-
- public Object[] getChildren(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().getChildren(object);
- }
- Node node = (Node) object;
- if (isJSElementParent(node)) {
-// Object[] results = getJSElementsFromNode(node.getFirstChild());
-// IMember[] allResults = new IMember[results.length];
-// for(int i = 0;i<results.length;i++) {
-// if(results[i]==null) continue;
-// IMember member = ((IMember)results[i]);
-// allResults[i] = member;
- // }
- return getJSElementsFromNode(node.getFirstChild());
- }
- return super.getChildren(object);
- }
-
-
- public Object[] getElements(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().getElements(object);
- }
- return super.getElements(object);
- }
-
- private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
- return new JavaScriptElementLabelProvider();
- }
-
- private StandardJavaScriptElementContentProvider getJavaElementProvider() {
- return new StandardJavaScriptElementContentProvider(true);
- }
-
- private synchronized Object[] getJSElementsFromNode(Node node) {
- if (node == null) {
- return new Object[0];
- }
- int startOffset = 0;
- int endOffset = 0;
- IJavaScriptElement[] result = null;
- IJsTranslation translation = null;
- if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
- startOffset = ((NodeImpl) node).getStartOffset();
- endOffset = ((NodeImpl) node).getEndOffset();
- translation = getTranslation(node);
- result = translation.getAllElementsInJsRange(startOffset, endOffset);
- }
- return result;
-//
-// if (result == null) return null;
-// Object[] newResults = new Object[result.length];
-// for (int i = 0; i < result.length; i++) {
-// int htmllength = 0;
-// int htmloffset = 0;
-// Position position = null;
-// try {
-// htmllength = ((SourceRefElement) (result[i])).getSourceRange().getLength();
-// htmloffset = translation.getJspOffset(((SourceRefElement)
-// (result[i])).getSourceRange().getOffset());
-// position = new Position(htmloffset, htmllength);
-// } catch (JavaScriptModelException e) {
-// e.printStackTrace();
-// }
-// newResults[i] = getJsNode(node.getParentNode(), (IJavaScriptElement) result[i],
-// position);
-// }
-// return newResults;
- }
-
-
- public Image getLabelImage(Object node) {
- if (node instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getImage(node);
- }
- return super.getLabelImage(node);
- }
-
-
- public String getLabelText(Object node) {
- if (node instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getText(node);
- }
- return super.getLabelText(node);
- }
-
-
- public Object getParent(Object element) {
- if (element instanceof IJavaScriptElement) {
- return getJavaElementProvider().getParent(element);
- }
- return super.getParent(element);
- }
-
- private IJsTranslation getTranslation(Node node) {
- IStructuredModel model = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IDOMDocument xmlDoc = null;
- try {
- if (modelManager != null) {
- IStructuredDocument doc = ((NodeImpl) node).getStructuredDocument();
- model = modelManager.getExistingModelForRead(doc);
- // model = modelManager.getModelForRead(doc);
- }
- IDOMModel domModel = (IDOMModel) model;
- xmlDoc = domModel.getDocument();
- } catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (model != null) {
- // model.changedModel();
- model.releaseFromRead();
- }
- }
- if (xmlDoc == null) {
- return null;
- }
- JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
- return translationAdapter.getJsTranslation(true);
- }
-
-
- public boolean hasChildren(Object object) {
- if (object instanceof IJavaScriptElement) {
- return getJavaElementProvider().hasChildren(object);
- }
- Node node = (Node) object;
- if (isJSElementParent(node)) {
- Object[] results = getJSElementsFromNode(node.getFirstChild());
- return (results != null && results.length > 0);
- }
- return super.hasChildren(object);
- }
-
- private boolean isJSElementParent(Node node) {
- return (node.getNodeName().equalsIgnoreCase("script")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
deleted file mode 100644
index 88896318b0..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
+++ /dev/null
@@ -1,64 +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.wst.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsContentOutlineConfig extends HTMLContentOutlineConfiguration {
- public static final boolean USE_ADVANCED = false;
- ILabelProvider fLabelProvider = null;
-
- public JsContentOutlineConfig() {}
-
- private ILabelProvider getJavaLabelProvider() {
- if (fLabelProvider == null) {
- fLabelProvider = new JsLabelProvider();
- }
- return fLabelProvider;
- }
-
-
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (!JsContentOutlineConfig.USE_ADVANCED) {
- return super.getLabelProvider(viewer);
- }
- return getJavaLabelProvider();
- }
-
-
- public IMenuListener getMenuListener(TreeViewer treeViewer) {
- // if(!USE_ADVANCED)
- // return super.getMenuListener(treeViewer);
- return new JsMenuListener(treeViewer);
- }
-
-
- public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
- if (!JsContentOutlineConfig.USE_ADVANCED) {
- return super.getStatusLineLabelProvider(treeViewer);
- }
- return getJavaLabelProvider();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
deleted file mode 100644
index 9c30f15ea3..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- *
- */
-package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsLabelProvider extends XMLLabelProvider {
- JavaScriptElementLabelProvider fLabelProvider = null;
-
-
- public Image getImage(Object o) {
- if (o instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getImage(o);
- }
- return super.getImage(o);
- }
-
- private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
- if (fLabelProvider == null) {
- fLabelProvider = new JavaScriptElementLabelProvider();
- }
- return fLabelProvider;
- }
-
-
- public String getText(Object o) {
- if (o instanceof IJavaScriptElement) {
- return getJavaElementLabelProvider().getText(o);
- }
- return super.getText(o);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
deleted file mode 100644
index 1f3e0785ea..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
-import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor;
-import org.eclipse.wst.jsdt.ui.IContextMenuConstants;
-import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsMenuListener extends HTMLNodeActionManager implements IMenuListener, IReleasable {
- public static final String EDIT_GROUP_ID = "group.edit"; //$NON-NLS-1$
- CompilationUnitEditorActionContributor contrib;
- private XMLNodeActionManager fActionManager;
- private TreeViewer fTreeViewer;
- ISelectionProvider selectionProvider;
-
- public JsMenuListener(TreeViewer viewer) {
- super((IStructuredModel) viewer.getInput(), viewer);
- contrib = new CompilationUnitEditorActionContributor();
- fTreeViewer = viewer;
-//
-// fActionGroups= new CompositeActionGroup(new ActionGroup[] {
-// new OpenViewActionGroup(getWorkbenchSite(), getSelectionProvider()),
-// new CCPActionGroup(getWorkbenchSite()),
-// new GenerateActionGroup(getWorkbenchSite()),
-// new RefactorActionGroup(getWorkbenchSite()),
-// new JavaSearchActionGroup(getWorkbenchSite())});
- }
-
- public IAction[] getAllJsActions() {
- return null;
- }
-
-// private IWorkbenchSite getWorkbenchSite() {
-// return InternalHandlerUtil.getActiveSite(fTreeViewer);
-// }
-
- public void menuAboutToShow(IMenuManager manager) {
- ISelection selection = fTreeViewer.getSelection();
- if (selection instanceof TreeSelection) {
- TreeSelection tselect = (TreeSelection) selection;
- Object[] elements = tselect.toArray();
- int javaCount = 0;
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IJavaWebNode) {
- javaCount++;
- }
- }
- //IContributionItem[] items = manager.getItems();
-// manager.add(new Separator(IContextMenuConstants.GROUP_NEW));
-// menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
-// menu.add(new Separator(IContextMenuConstants.GROUP_OPEN));
-// manager.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
-// menu.add(new Separator(ICommonMenuConstants.GROUP_EDIT));
-// menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
-// menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
-// menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
-// menu.add(new Separator(IContextMenuConstants.GROUP_BUILD));
-// menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
-// menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
-// menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
- if (javaCount == elements.length && javaCount != 0) {
- // see plugin.xml for object contributions that populate these
- // menus
- /*
- * Menu for:
- *
- * Open Type Hierarchy Open Call Hierarchy Show In--> Script
- * Explorer Navigator
- */
- manager.add(new Separator(IContextMenuConstants.GROUP_SHOW));
- manager.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
- /*
- * Menu for: Cut Copy Paste Delete
- */
- manager.add(new Separator(JsMenuListener.EDIT_GROUP_ID));
- manager.add(new GroupMarker(JsMenuListener.EDIT_GROUP_ID));
- /*
- * Menu for:
- *
- * Source--> Generate Element Comment
- *
- *
- * Refactor--> Rename Move Change Function Signature Inline
- * Introduce Indirection Infer Generic Type Arguments
- */
- manager.add(new Separator(IContextMenuConstants.GROUP_SOURCE));
- manager.add(new GroupMarker(IContextMenuConstants.GROUP_SOURCE));
- /*
- * Menu for:
- *
- * Refrences--> Workspace Project Hierarchy Working Set
- *
- * Declerations--> Workspace Project Hierarchy Working Set
- *
- */
- manager.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
- manager.add(new GroupMarker(IContextMenuConstants.GROUP_SEARCH));
- /* all Java Elements */
-//
-//
-//
-// JavaScriptPlugin.createStandardGroups(manager);
-// String[] actionSets = JSDTActionSetUtil.getAllActionSets();
-//
-// IAction[] actions = JSDTActionSetUtil.getActionsFromSet(actionSets);
-// for(int i = 0;i<actions.length;i++) {
-// manager.add(actions[i]);
-// }
-// fActionGroups.setContext(new ActionContext(selection));
-// fActionGroups.fillContextMenu(manager);
-//
- } else if (javaCount == 0) {
- fillContextMenu(manager, selection);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
- */
- public void release() {
- fTreeViewer = null;
- if (fActionManager != null) {
- fActionManager.setModel(null);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
deleted file mode 100644
index 1c0db53d01..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
+++ /dev/null
@@ -1,25 +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.wst.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class JsWebElementProvider extends StandardJavaScriptElementContentProvider {}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
deleted file mode 100644
index cf5c62c187..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
+++ /dev/null
@@ -1,115 +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.wst.jsdt.web.ui.views.provisional.contentoutline;
-
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
-*
-
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
-public class XMLLabelProvider extends JFaceNodeLabelProvider {
- boolean fShowAttributes = false;
-
-
- public String getText(Object o) {
- StringBuffer text = new StringBuffer(super.getText(o));
- if (o instanceof Node) {
- Node node = (Node) o;
- if ((node.getNodeType() == Node.ELEMENT_NODE) && fShowAttributes) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
- if (node.hasAttributes()) {
- Element element = (Element) node;
- NamedNodeMap attributes = element.getAttributes();
- Node idTypedAttribute = null;
- Node requiredAttribute = null;
- boolean hasId = false;
- boolean hasName = false;
- Node shownAttribute = null;
- // try to get content model element
- // declaration
- CMElementDeclaration elementDecl = null;
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- elementDecl = mq.getCMElementDeclaration(element);
- }
- // find an attribute of type (or just named)
- // ID
- if (elementDecl != null) {
- int i = 0;
- while ((i < attributes.getLength()) && (idTypedAttribute == null)) {
- Node attr = attributes.item(i);
- String attrName = attr.getNodeName();
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) elementDecl.getAttributes().getNamedItem(attrName);
- if (attrDecl != null) {
- if ((attrDecl.getAttrType() != null) && (CMDataType.ID.equals(attrDecl.getAttrType().getDataTypeName()))) {
- idTypedAttribute = attr;
- } else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) && (requiredAttribute == null)) {
- // as a backup, keep tabs on
- // any required
- // attributes
- requiredAttribute = attr;
- } else {
- hasId = hasId || attrName.equals("id"); //$NON-NLS-1$
- hasName = hasName || attrName.equals("name"); //$NON-NLS-1$
- }
- }
- ++i;
- }
- }
- /*
- * If no suitable attribute was found, try using a
- * required attribute, if none, then prefer "id" or
- * "name", otherwise just use first attribute
- */
- if (idTypedAttribute != null) {
- shownAttribute = idTypedAttribute;
- } else if (requiredAttribute != null) {
- shownAttribute = requiredAttribute;
- } else if (hasId) {
- shownAttribute = attributes.getNamedItem("id"); //$NON-NLS-1$
- } else if (hasName) {
- shownAttribute = attributes.getNamedItem("name"); //$NON-NLS-1$
- }
- if (shownAttribute == null) {
- shownAttribute = attributes.item(0);
- }
- // display the attribute and value (without quotes)
- String attributeName = shownAttribute.getNodeName();
- if ((attributeName != null) && (attributeName.length() > 0)) {
- text.append(" " + attributeName); //$NON-NLS-1$
- String attributeValue = shownAttribute.getNodeValue();
- if ((attributeValue != null) && (attributeValue.length() > 0)) {
- text.append("=" + StringUtils.strip(attributeValue)); //$NON-NLS-1$
- }
- }
- }
- }
- }
- return text.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF
deleted file mode 100644
index a9a220dada..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIF
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG
deleted file mode 100644
index 68bf9c549f..0000000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPG
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.core/.classpath b/bundles/org.eclipse.wst.sse.core/.classpath
deleted file mode 100644
index df9dea9b04..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-encoding"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-tasktags"/>
- <classpathentry kind="src" path="src-contentproperties"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
- <accessrules>
- <accessrule kind="accessible" pattern="org/w3c/dom/traversal/NodeIterator"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.sse.core/.cvsignore b/bundles/org.eclipse.wst.sse.core/.cvsignore
deleted file mode 100644
index a71230f0ae..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-bin
-model.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.core_1.0.0.jar
-@dot
-src.zip
-.fbwarnings
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.sse.core/.options b/bundles/org.eclipse.wst.sse.core/.options
deleted file mode 100644
index 50b0b1635e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.options
+++ /dev/null
@@ -1,19 +0,0 @@
-org.eclipse.wst.sse.core/debug=true
-org.eclipse.wst.sse.core/dom/adapter/notification/time=false
-org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria=10
-org.eclipse.wst.sse.core/structureddocument=false
-org.eclipse.wst.sse.core/filebuffers/modelmanagement=false
-org.eclipse.wst.sse.core/filebuffers/leaks=true
-org.eclipse.wst.sse.core/filebuffers/lifecycle=false
-org.eclipse.wst.sse.core/structuredmodel/lifecycle=false
-org.eclipse.wst.sse.core/structuredmodel/state=false
-org.eclipse.wst.sse.core/structuredmodel/locks=true
-org.eclipse.wst.sse.core/structuredmodel/modelmanager=false
-org.eclipse.wst.sse.core/tasks=false
-org.eclipse.wst.sse.core/tasks/detection=false
-org.eclipse.wst.sse.core/tasks/job=false
-org.eclipse.wst.sse.core/tasks/overalltime=false
-org.eclipse.wst.sse.core/tasks/time=false
-org.eclipse.wst.sse.core/tasks/preferences=false
-org.eclipse.wst.sse.core/tasks/registry=false
-org.eclipse.wst.sse.core/format=false
diff --git a/bundles/org.eclipse.wst.sse.core/.project b/bundles/org.eclipse.wst.sse.core/.project
deleted file mode 100644
index 36c5b34912..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 104e60da23..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sat Mar 24 11:23:54 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=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=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.wst.sse.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
deleted file mode 100644
index bd7272aa65..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
+++ /dev/null
@@ -1,279 +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
- *******************************************************************************/
-/*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;
-
-
-
-%%
-
-%{
-
-
- 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);
- }
-
-
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class CSSHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-%debug
-%switch
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-//SpaceChar = [\x20\x09]
-
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-//BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-// Z is the single-byte zero character to be used in parsing double-byte files
-Z = (\x00)?
-S_UTF = {Z}{S}{Z}
-BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*
-
-%state ST_XMLDecl
-%state CHARSET_RULE
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>
-{
- {UTF16BE} {hasMore = false; return EncodingParserConstants.UTF16BE;}
- {UTF16LE} {hasMore = false; return EncodingParserConstants.UTF16LE;}
- {UTF83ByteBOM} {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
- // force to be started on first line, but we do allow preceeding spaces
- ^ {Z}({S}{Z})* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-
- ^ {Z}({S}{Z})*({Z}@{Z}c{Z}h{Z}a{Z}r{Z}s{Z}e{Z}t{Z}) {if (yychar == 0 ) {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;}}
-}
-
-// I don't think there's really an XML form of CSS files ... but will leave here for consistency
-<ST_XMLDecl>
-{
- //"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
- {Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
- // note this "forced end" once end of XML Declaration found
- {Z}\?{Z}>{Z} {yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-<CHARSET_RULE>
-{
-
- {S_UTF}* {pushCurrentState(); yybegin(QuotedAttributeValue);}
- {Z};{Z} { yybegin(YYINITIAL); hasMore = false; return CSSHeadTokenizerConstants.RuleEnd;}
-}
-
-
-<QuotedAttributeValue>
-{
- {Z}\"{Z} { yybegin(DQ_STRING); string.setLength(0); }
- {Z}\'{Z} { yybegin(SQ_STRING); string.setLength(0); }
- // in this state, anything other than a space character can start an undelimited string
- {S_UTF}*. { yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
- {Z}\"{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z};{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- [^\x00] { string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
- {Z}\'{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}%{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z};{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- [^\x00] { string.append( yytext() ); }
-
-}
-
-<UnDelimitedString>
-{
-
-
- {S_UTF} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
- {Z}\'{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
- {Z}\"{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z};{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- [^\x00] { string.append( yytext() ); }
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-.|\n {if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-
-// this rule always in effect
-<<EOF>> {hasMore = false; return EncodingParserConstants.EOF;}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
deleted file mode 100644
index d2309dd3a6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,1441 +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]);
- }
-
- System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore=false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state+1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext: { switch (yy_state) {
- case 0:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 6:
- case 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.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
deleted file mode 100644
index 9ef06e965e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;d:jdks\j2sdk1.4.1_02\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\PureHeadWorkspace
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=CSSHeadTokenizer
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\css\
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% 1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-rem pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
deleted file mode 100644
index e0743ca042..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading "CSSHeadTokenizer.jflex"
-Constructing NFA : 458 states in NFA
-Converting NFA to DFA :
-........................................................................................
-102 states before minimization, 64 states in minimized DFA
-Writing code to "CSSHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
deleted file mode 100644
index d35d074444..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.html.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-%%
-
-%{
-
-
- private boolean hasMore = true;
- private boolean hasCharsetAttr = false;
- private final static int MAX_TO_SCAN = 8000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
- boolean foundContentTypeValue = false;
- private boolean isXHTML;
-
-
-
- public HTMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- // yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
- // yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
- hasCharsetAttr = false;
- isXHTML = false;
-
- // 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;
- HeadParserToken result = null;
- try {
- context = primGetNextToken();
- }
- catch (IllegalStateException e) {
- hasMore = false;
- result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());
- while(yy_advance() != YYEOF) {}
- return result;
- }
- 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());
-
- }
- public final boolean hasCharsetAttr() {
- return hasCharsetAttr;
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
- public boolean isXHTML() {
- return isXHTML;
- }
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class HTMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-//%debug
-%switch
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-SpaceChar = [\x20\x09]
-
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-// BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-Z = (\x00)?
-S_UTF = {Z}{S}{Z}
-BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*
-
-%state ST_XMLDecl
-%state ST_META_TAG
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-%state UnDelimitedCharset
-
-%%
-
-
-<YYINITIAL>
-{
- {UTF16BE} {hasMore = false; return EncodingParserConstants.UTF16BE;}
- {UTF16LE} {hasMore = false; return EncodingParserConstants.UTF16LE;}
- {UTF83ByteBOM} {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
- // force to be started on first line, but we do allow preceeding spaces
- ^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
- ({Z}<{Z}M{Z}E{Z}T{Z}A{Z}) {yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart;}
-
- // To determine if content is XHTML.Taken from JSPHeadTokenizer.
- {Z}<{Z}\!{Z}D{Z}O{Z}C{Z}T{Z}Y{Z}P{Z}E{Z} {S_UTF}* {Z}h{Z}t{Z}m{Z}l{Z} {S_UTF}* {Z}P{Z}U{Z}B{Z}L{Z}I{Z}C{Z} .* {Z}\/{Z}\/{Z}D{Z}T{Z}D{Z}{S_UTF}{Z}X{Z}H{Z}T{Z}M{Z}L{Z} {isXHTML = true;}
- {Z}<{Z}h{Z}t{Z}m{Z}l{Z} {S_UTF}* {Z}x{Z}m{Z}l{Z}n{Z}s{Z} {S_UTF}* {Z}\={Z} {S_UTF}* (({Z}\"{Z}) | ({Z}\'{Z})) {Z}h{Z}t{Z}t{Z}p{Z}:{Z}\/{Z}\/{Z}w{Z}w{Z}w{Z}\.{Z}w{Z}3{Z}\.{Z}o{Z}r{Z}g{Z}\/{Z}1{Z}9{Z}9{Z}9{Z}\/{Z}x{Z}h{Z}t{Z}m{Z}l{Z} {isXHTML = true;}
-
-}
-
-<ST_XMLDecl>
-{
- //"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
- ({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
- // note this "forced end" once end of XML Declaration found
- ({Z}\?{Z}>{Z}) {yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-<ST_META_TAG>
-{
-
-// "http-equiv" {S}* \= {S}* \"? "Content-Type" \"? {S}+ "content" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}
- {Z}h{Z}t{Z}t{Z}p{Z}-{Z}e{Z}q{Z}u{Z}i{Z}v{Z} {S_UTF}* \= {S_UTF}* {Z}\"?{Z} ({Z}C{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}-{Z}T{Z}y{Z}p{Z}e{Z}) \"?{Z} ({S_UTF})+ ({Z}c{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}
- {Z}c{Z}h{Z}a{Z}r{Z}s{Z}e{Z}t{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}
- {Z}>{Z} { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
- {Z}\/{Z}>{Z} { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
-}
-
-
-<QuotedAttributeValue>
-{
- {Z}\"{Z} { yybegin(DQ_STRING); string.setLength(0); }
- {Z}\'{Z} { yybegin(SQ_STRING); string.setLength(0); }
- // in this state, anything other than a space character can start an undelimited string
- {S_UTF}*. { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
- {Z}\"{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- [^\x00] { string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
- {Z}\'{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}%{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- [^\x00] { string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
- // note this initial special case for HTTP contenttype values
- // Look ahead and see if there are spaces, but don't append the spaces as they may be double-byte
- // Let the next state handle removal of the \x00 and properly append spaces
- ";"/{S_UTF}* { pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() ); }
- {S_UTF} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
- {Z}\'{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
- {Z}\"{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- {Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\/{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- [^\x00] { string.append( yytext() ); }
-
-}
-
-<UnDelimitedCharset>
-{
- {S} { string.append( yytext() ); }
- // For non \x00 characters, let the previous state handle it
- [^\x00] {yypushback(1); popState(); }
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-.|\n {if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-
-// this rule always in effect
-<<EOF>> {hasMore = false; return EncodingParserConstants.EOF;}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java
deleted file mode 100644
index 87d6c8fd9a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java
+++ /dev/null
@@ -1,1206 +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
- *
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:41 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.html;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:41 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jflex</tt>
- */
-public class HTMLHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_META_TAG = 4;
- final public static int YYINITIAL = 0;
- final public static int UnDelimitedString = 12;
- final public static int DQ_STRING = 8;
- final public static int SQ_STRING = 10;
- final public static int ST_XMLDecl = 2;
- final public static int QuotedAttributeValue = 6;
-
- /**
- * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
- * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
- * at the beginning of a line
- * l is of the form l = 2*k, k a non negative integer
- */
- private final static int YY_LEXSTATE[] = {
- 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7
- };
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\6\1\7\2\0\1\11\22\0\1\22\1\0\1\40\2\0"+
- "\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45\1\12"+
- "\1\10\1\31\1\13\1\0\1\21\1\0\1\24\1\26\1\17\1\0"+
- "\1\30\1\32\1\27\2\0\1\16\1\15\1\23\1\25\1\33\1\35"+
- "\2\0\1\20\1\36\1\37\1\0\1\14\1\41\7\0\1\21\1\0"+
- "\1\24\1\26\1\17\1\0\1\30\1\32\1\27\2\0\1\16\1\15"+
- "\1\23\1\25\1\33\1\35\2\0\1\20\1\36\1\37\1\0\1\14"+
- "\1\41\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0"+
- "\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** 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;
- boolean foundContentTypeValue = false;
-
-
-
- public HTMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
- yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- // its a little wasteful to "throw away" first char array generated
- // by class init (via auto generated code), but we really do want
- // a small buffer for our head parsers.
- if (yy_buffer.length != MAX_TO_SCAN) {
- yy_buffer = new char[MAX_TO_SCAN];
- }
-
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- } else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public HTMLHeadTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public HTMLHeadTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 174) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- System.out.println(YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
-
- System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore=false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state+1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext: { switch (yy_state) {
- case 0:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 12; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 13; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 14; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 2:
- switch (yy_input) {
- case 11: yy_isFinal = true; yy_state = 15; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 16; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 3:
- switch (yy_input) {
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 17; break yy_forNext;
- case 26: yy_isFinal = true; yy_state = 18; break yy_forNext;
- case 34: yy_isFinal = true; yy_state = 19; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 4:
- switch (yy_input) {
- case 6:
- case 9:
- case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
- case 7: yy_isFinal = true; yy_state = 22; break yy_forNext;
- case 32: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
- case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 5:
- switch (yy_input) {
- case 7:
- case 9:
- case 10:
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- case 11:
- case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 32: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
- }
-
- case 6:
- switch (yy_input) {
- case 7:
- case 9:
- case 10:
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- case 36: yy_isFinal = true; yy_state = 29; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
- }
-
- case 7:
- switch (yy_input) {
- case 10:
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
- case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 11: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
- case 32:
- case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
- case 37: yy_isFinal = true; yy_state = 32; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
- }
-
- case 9:
- switch (yy_input) {
- case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 33; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 10:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 34; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 11:
- switch (yy_input) {
- case 4: yy_state = 35; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 12:
- switch (yy_input) {
- case 13: yy_state = 36; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 13:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 37; break yy_forNext;
- case 10: yy_state = 38; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 14:
- switch (yy_input) {
- case 13: yy_state = 36; break yy_forNext;
- case 11: yy_state = 39; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 15:
- switch (yy_input) {
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 16:
- switch (yy_input) {
- case 19: yy_state = 41; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 18:
- switch (yy_input) {
- case 16: yy_state = 42; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 19:
- switch (yy_input) {
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 21:
- switch (yy_input) {
- case 6:
- case 9:
- case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
- case 7: yy_state = 44; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 22:
- switch (yy_input) {
- case 6:
- case 9:
- case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
- case 7: yy_state = 44; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 27:
- switch (yy_input) {
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 29:
- switch (yy_input) {
- case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 32:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 32; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 35:
- switch (yy_input) {
- case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 36:
- switch (yy_input) {
- case 15: yy_state = 48; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 37:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 37; break yy_forNext;
- case 10: yy_state = 38; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 38:
- switch (yy_input) {
- case 11: yy_state = 39; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 39:
- switch (yy_input) {
- case 12: yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 41:
- switch (yy_input) {
- case 20: yy_state = 50; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 42:
- switch (yy_input) {
- case 16: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 44:
- switch (yy_input) {
- case 6:
- case 9:
- case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
- case 7: yy_state = 44; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 48:
- switch (yy_input) {
- case 16: yy_state = 52; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 49:
- switch (yy_input) {
- case 13: yy_state = 53; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 50:
- switch (yy_input) {
- case 21: yy_state = 54; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 51:
- switch (yy_input) {
- case 27: yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 52:
- switch (yy_input) {
- case 17: yy_state = 56; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 53:
- switch (yy_input) {
- case 14: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 54:
- switch (yy_input) {
- case 22: yy_state = 58; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 55:
- switch (yy_input) {
- case 28: yy_state = 59; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 56:
- switch (yy_input) {
- case 18: yy_isFinal = true; yy_noLookAhead = true; yy_state = 60; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 57:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 58:
- switch (yy_input) {
- case 23: yy_state = 62; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 59:
- switch (yy_input) {
- case 15: yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 61:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 62:
- switch (yy_input) {
- case 19: yy_state = 64; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 63:
- switch (yy_input) {
- case 29: yy_state = 65; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 64:
- switch (yy_input) {
- case 24: yy_state = 66; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 65:
- switch (yy_input) {
- case 30: yy_state = 67; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 66:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 66; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 67:
- switch (yy_input) {
- case 23: yy_state = 69; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 68:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 69:
- switch (yy_input) {
- case 31: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 70:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 70; break yy_forNext;
- case 8: yy_state = 71; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 71:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 71; break yy_forNext;
- case 20: yy_state = 72; break yy_forNext;
- case 32: yy_state = 73; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 72:
- switch (yy_input) {
- case 21: yy_state = 74; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 73:
- switch (yy_input) {
- case 20: yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 74:
- switch (yy_input) {
- case 19: yy_state = 75; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 75:
- switch (yy_input) {
- case 16: yy_state = 76; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 76:
- switch (yy_input) {
- case 15: yy_state = 77; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 77:
- switch (yy_input) {
- case 19: yy_state = 78; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 78:
- switch (yy_input) {
- case 16: yy_state = 79; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 79:
- switch (yy_input) {
- case 28: yy_state = 80; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 80:
- switch (yy_input) {
- case 16: yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 81:
- switch (yy_input) {
- case 33: yy_state = 82; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 82:
- switch (yy_input) {
- case 27: yy_state = 83; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 83:
- switch (yy_input) {
- case 15: yy_state = 84; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 84:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 85; break yy_forNext;
- case 32: yy_state = 86; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 85:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 85; break yy_forNext;
- case 20: yy_state = 87; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 86:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 85; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 87:
- switch (yy_input) {
- case 21: yy_state = 88; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 88:
- switch (yy_input) {
- case 19: yy_state = 89; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 89:
- switch (yy_input) {
- case 16: yy_state = 90; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 90:
- switch (yy_input) {
- case 15: yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 91:
- switch (yy_input) {
- case 19: yy_state = 92; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 92:
- switch (yy_input) {
- case 16: yy_state = 93; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 93:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_state = 93; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 94; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 94:
- switch (yy_input) {
- case 6:
- case 7:
- case 9:
- case 18: yy_isFinal = true; yy_state = 94; break yy_forNext;
- default: break yy_forAction;
- }
-
- default:
- yy_ScanError(YY_ILLEGAL_STATE);
- break;
- } }
-
- if ( yy_isFinal ) {
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( yy_noLookAhead ) break yy_forAction;
- }
-
- }
- }
-
-
- switch (yy_action) {
-
- case 26:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 96: break;
- case 20:
- case 21:
- { yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
- case 97: break;
- case 17:
- { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
- case 98: break;
- case 31:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
- case 99: break;
- case 43:
- { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
- case 100: break;
- case 45:
- { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 101: break;
- case 46:
- { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 102: break;
- case 61:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
- case 103: break;
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 18:
- case 19:
- case 22:
- { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
- case 104: break;
- case 60:
- { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
- case 105: break;
- case 40:
- { yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd; }
- case 106: break;
- case 94:
- { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
- case 107: break;
- case 68:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
- case 108: break;
- case 33:
- { hasMore = false; return EncodingParserConstants.UTF16BE; }
- case 109: break;
- case 34:
- { hasMore = false; return EncodingParserConstants.UTF16LE; }
- case 110: break;
- case 47:
- { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
- case 111: break;
- case 28:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 112: break;
- case 25:
- case 27:
- case 29:
- case 32:
- { string.append( yytext() ); }
- case 113: break;
- case 24:
- { yybegin(SQ_STRING); string.setLength(0); }
- case 114: break;
- case 23:
- { yybegin(DQ_STRING); string.setLength(0); }
- case 115: break;
- case 30:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 116: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- { hasMore = false; return EncodingParserConstants.EOF; }
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
- /**
- * Runs the scanner on input files.
- *
- * This main method is the debugging routine for the scanner.
- * It prints each returned token to System.out until the end of
- * file is reached, or an error occured.
- *
- * @param argv the command line, contains the filenames to run
- * the scanner on.
- */
- public static void main(String argv[]) {
- for (int i = 0; i < argv.length; i++) {
- HTMLHeadTokenizer scanner = null;
- try {
- scanner = new HTMLHeadTokenizer( new java.io.FileReader(argv[i]) );
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \""+argv[i]+"\"");
- System.exit(1);
- }
- catch (java.io.IOException e) {
- System.out.println("Error opening file \""+argv[i]+"\"");
- System.exit(1);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java HTMLHeadTokenizer <inputfile>");
- System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- } while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd
deleted file mode 100644
index 96f2325cf6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;d:jdks\j2sdk1.4.1_02\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\PureHeadWorkspace
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=HTMLHeadTokenizer
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\html\
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% 1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-rem pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt
deleted file mode 100644
index 1469e9c1d2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading "HTMLHeadTokenizer.jflex"
-
-Warning : Macro "SpaceChar" has been declared but never used.
-Constructing NFA : 660 states in NFA
-Converting NFA to DFA :
-.........................................................................................................................
-135 states before minimization, 95 states in minimized DFA
-Writing code to "HTMLHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
deleted file mode 100644
index 4a9b3f74a6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
+++ /dev/null
@@ -1,268 +0,0 @@
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
---- lexical states, charmap
-
- /* 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"
- };
-
---- isFinal list
- /** 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;
-
---- user class code
-
- /**
- * 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.
- */
---- constructor declaration
-
-
- /**
- * 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 {
- IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());
- System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);
- throw ise;
- }
- 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;
- }
-
-
---- yy_doEof
- /**
- * 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
- */
---- yylex declaration
- int yy_input;
- int yy_action;
-
---- local declarations
-
- while (true) {
-
---- start admin (line, char, col count)
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
---- start admin (lexstate etc)
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
---- line, col, char count, next transition, isFinal action
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
---- line count update
- }
-
- }
- }
-
---- char count update
-
- switch (yy_action) {
-
---- actions
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
---- eofvalue
- }
- else {
---- no match
- }
- }
- }
- }
-
---- main
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
deleted file mode 100644
index eb89700a6d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
+++ /dev/null
@@ -1,6 +0,0 @@
-The skeleton.sed file contains the modified JFlex 1.2.2 skeleton file with
-changes for use with the tokenizers within the org.eclipse.wst.sse.core.xml and
-org.eclipse.wst.sse.core.jsp plugins.
-
-The skeleton file's method definitions are copied into the generated output
-directly.
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
deleted file mode 100644
index d3073891ff..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
+++ /dev/null
@@ -1,98 +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
- * kb.huang - Bug 214416 Dot char is not escaped in XML10Names.jFlex
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-%%
-
-%table
-%public
-%final
-%class XML10Names
-%function isValidXML10Name
-%type boolean
-%unicode
-%ignorecase
-%buffer 2048
-%apiprivate
-
-BaseChar = [\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-CombiningChar = [\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-Digit = [\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-Letter = ({BaseChar} | {Ideographic})
-
-NameChar = ({Letter} | {Digit} | "." | "-" | "_" | ":" | {CombiningChar} | {Extender})
-
-Name = ({Letter} | "_" | ":" ) ({NameChar})*
-
-
-
-%{
- boolean result;
- /**
- * Creates a new scanner
- */
- public XML10Names() {
- this.zzReader = null;
- }
-
- public boolean isValidXML10Name(String stringToCheck) {
- boolean result = false;
- yyreset(new java.io.StringReader(stringToCheck));
- try {
- result = isValidXML10Name();
- }
- catch (java.io.IOException e) {
- // should be impossible with strings, but if occurs, just means
- // "not"
- result = false;
- }
- return result;
- }
-
-%}
-
-
-
-
-%%
-
-<YYINITIAL>
-{
-
- // name must be whole line (input), not partial
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=214416
- {Name} {return true; /* exact name */}
- {Name}.+ {return false; /* more than name */}
-
- // match anything (else) should normally come last
- . {return false; /* matched wild */}
-
-}
-
-
-// this rule always in effect
-<<EOF>>
-{
- {return false; /* hit end with no match */}
-}
-
-
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
deleted file mode 100644
index fe91212b5a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 2/25/08 10:25 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
- * kb.huang - Bug 214416 Dot char is not escaped in XML10Names.jFlex
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 2/25/08 10:25 AM from the specification file
- * <tt>XML10Names.jflex</tt>
- */
-public final class XML10Names {
-
- /** This character denotes the end of file */
- private static final int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- private static final int ZZ_BUFFERSIZE = 2048;
-
- /** lexical states */
- private static final int YYINITIAL = 0;
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\12\0\1\3\42\0\1\2\1\2\1\0\12\2\1\1\6\0\32\1"+
- "\4\0\1\1\1\0\32\1\74\0\1\2\10\0\27\1\1\0\37\1"+
- "\1\0\72\1\2\0\13\1\2\0\10\1\1\0\65\1\1\0\104\1"+
- "\11\0\44\1\3\0\2\1\4\0\36\1\70\0\131\1\22\0\7\1"+
- "\16\0\2\2\56\0\106\2\32\0\2\2\44\0\1\1\1\2\3\1"+
- "\1\0\1\1\1\0\24\1\1\0\54\1\1\0\7\1\3\0\1\1"+
- "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\22\1\15\0\14\1"+
- "\1\0\102\1\1\0\14\1\1\0\44\1\1\0\4\2\11\0\65\1"+
- "\2\0\2\1\2\0\2\1\3\0\34\1\2\0\10\1\2\0\2\1"+
- "\67\0\46\1\2\0\1\1\7\0\46\1\12\0\21\2\1\0\27\2"+
- "\1\0\3\2\1\0\1\2\1\0\2\2\1\0\1\2\13\0\33\1"+
- "\5\0\3\1\56\0\32\1\5\0\1\2\12\1\10\2\15\0\12\2"+
- "\6\0\1\2\107\1\2\0\5\1\1\0\17\1\1\0\4\1\1\0"+
- "\1\1\17\2\2\1\2\2\1\0\4\2\2\0\12\2\u0207\0\3\2"+
- "\1\0\65\1\2\0\1\2\1\1\20\2\3\0\4\2\3\0\12\1"+
- "\2\2\2\0\12\2\21\0\3\2\1\0\10\1\2\0\2\1\2\0"+
- "\26\1\1\0\7\1\1\0\1\1\3\0\4\1\2\0\1\2\1\0"+
- "\7\2\2\0\2\2\2\0\3\2\11\0\1\2\4\0\2\1\1\0"+
- "\3\1\2\2\2\0\12\2\2\1\20\0\1\2\2\0\6\1\4\0"+
- "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0"+
- "\2\1\2\0\1\2\1\0\5\2\4\0\2\2\2\0\3\2\13\0"+
- "\4\1\1\0\1\1\7\0\12\2\2\2\3\1\14\0\3\2\1\0"+
- "\7\1\1\0\1\1\1\0\3\1\1\0\26\1\1\0\7\1\1\0"+
- "\2\1\1\0\5\1\2\0\1\2\1\1\10\2\1\0\3\2\1\0"+
- "\3\2\22\0\1\1\5\0\12\2\21\0\3\2\1\0\10\1\2\0"+
- "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\2\0\4\1\2\0"+
- "\1\2\1\1\6\2\3\0\2\2\2\0\3\2\10\0\2\2\4\0"+
- "\2\1\1\0\3\1\4\0\12\2\22\0\2\2\1\0\6\1\3\0"+
- "\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0"+
- "\2\1\3\0\3\1\3\0\10\1\1\0\3\1\4\0\5\2\3\0"+
- "\3\2\1\0\4\2\11\0\1\2\17\0\11\2\21\0\3\2\1\0"+
- "\10\1\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\4\0"+
- "\7\2\1\0\3\2\1\0\4\2\7\0\2\2\11\0\2\1\4\0"+
- "\12\2\22\0\2\2\1\0\10\1\1\0\3\1\1\0\27\1\1\0"+
- "\12\1\1\0\5\1\4\0\7\2\1\0\3\2\1\0\4\2\7\0"+
- "\2\2\7\0\1\1\1\0\2\1\4\0\12\2\22\0\2\2\1\0"+
- "\10\1\1\0\3\1\1\0\27\1\1\0\20\1\4\0\6\2\2\0"+
- "\3\2\1\0\4\2\11\0\1\2\10\0\2\1\4\0\12\2\221\0"+
- "\56\1\1\0\1\1\1\2\2\1\7\2\5\0\6\1\1\2\10\2"+
- "\1\0\12\2\47\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1"+
- "\2\0\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1"+
- "\1\0\1\1\2\0\2\1\1\0\2\1\1\0\1\1\1\2\2\1"+
- "\6\2\1\0\2\2\1\1\2\0\5\1\1\0\1\2\1\0\6\2"+
- "\2\0\12\2\76\0\2\2\6\0\12\2\13\0\1\2\1\0\1\2"+
- "\1\0\1\2\4\0\2\2\10\1\1\0\41\1\7\0\24\2\1\0"+
- "\6\2\4\0\6\2\1\0\1\2\1\0\25\2\3\0\7\2\1\0"+
- "\1\2\346\0\46\1\12\0\47\1\11\0\1\1\1\0\2\1\1\0"+
- "\3\1\1\0\1\1\1\0\2\1\1\0\5\1\51\0\1\1\1\0"+
- "\1\1\1\0\1\1\13\0\1\1\1\0\1\1\1\0\1\1\3\0"+
- "\2\1\3\0\1\1\5\0\3\1\1\0\1\1\1\0\1\1\1\0"+
- "\1\1\1\0\1\1\3\0\2\1\3\0\2\1\1\0\1\1\50\0"+
- "\1\1\11\0\1\1\2\0\1\1\2\0\2\1\7\0\2\1\1\0"+
- "\1\1\1\0\7\1\50\0\1\1\4\0\1\1\10\0\1\1\u0c06\0"+
- "\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0"+
- "\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+
- "\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0"+
- "\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0"+
- "\7\1\323\0\15\2\4\0\1\2\104\0\1\1\3\0\2\1\2\0"+
- "\1\1\121\0\3\1\u0e82\0\1\2\1\0\1\1\31\0\11\1\6\2"+
- "\1\0\5\2\13\0\124\1\4\0\2\2\2\0\2\2\2\0\132\1"+
- "\1\0\3\2\6\0\50\1\u1cd3\0\u51a6\1\u0c5a\0\u2ba4\1\u285c\0";
-
- /**
- * 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 =
- "\1\0\1\1\1\2\1\3";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[4];
- 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\4\0\10\0\14";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[4];
- 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 [] = {
- 1, 2, 1, -1, -1, -1, -1, -1, 3, 2,
- 2, -1, 3, 3, 3, -1
- };
-
- /* 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 =
- "\1\0\1\11\2\1";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[4];
- 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 textposition at the last state to be included in yytext */
- private int zzPushbackPos;
-
- /** 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: */
- boolean result;
- /**
- * Creates a new scanner
- */
- public XML10Names() {
- this.zzReader = null;
- }
-
- public boolean isValidXML10Name(String stringToCheck) {
- boolean result = false;
- yyreset(new java.io.StringReader(stringToCheck));
- try {
- result = isValidXML10Name();
- }
- catch (java.io.IOException e) {
- // should be impossible with strings, but if occurs, just means
- // "not"
- result = false;
- }
- return result;
- }
-
-
-
- /**
- * 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 XML10Names(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 XML10Names(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 < 1218) {
- 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;
- zzPushbackPos-= 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) {
- return true;
- }
- else {
- zzEndRead+= numRead;
- return false;
- }
- }
-
-
- /**
- * Closes the input stream.
- */
- private 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
- */
- private final void yyreset(java.io.Reader reader) {
- zzReader = reader;
- zzAtBOL = true;
- zzAtEOF = false;
- zzEndRead = zzStartRead = 0;
- zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
- yyline = yychar = yycolumn = 0;
- zzLexicalState = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
- private final int yystate() {
- return zzLexicalState;
- }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- private final void yybegin(int newState) {
- zzLexicalState = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- private 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
- */
- private final char yycharat(int pos) {
- return zzBuffer[zzStartRead+pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- private 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()!
- */
- private 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
- */
- private boolean isValidXML10Name() 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;
-
- zzAction = -1;
-
- zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-
- zzState = 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 1:
- { return false; /* matched wild */
- }
- case 4: break;
- case 2:
- { return true; /* exact name */
- }
- case 5: break;
- case 3:
- { return false; /* more than name */
- }
- case 6: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- { {return false; /* hit end with no match */} }
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd
deleted file mode 100644
index 7c816d0435..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd
+++ /dev/null
@@ -1,25 +0,0 @@
-@echo on
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;D:\JDKs\ibm-java2-sdk-50-win-i386\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\newWTPpurehead
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex-1.4\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=XML10Names
-
-set PROJECT_SRC=\org.eclipse.wst.xml.core\src\
-set PACKAGE_DIR=org\eclipse\wst\xml\core\internal\parser\
-
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\Jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\Jflex.jar;. JFlex.Main %JFLEX_RULES% 1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt
deleted file mode 100644
index c336f12397..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading "XML10Names.jflex"
-Constructing NFA : 84 states in NFA
-Converting NFA to DFA :
-............
-14 states before minimization, 4 states in minimized DFA
-Writing code to "XML10Names.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex
deleted file mode 100644
index d6fe899700..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.xml;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-%%
-
-%{
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 8000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
-
-
- public XMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- zzReader = in;
-
- /* the current state of the DFA */
- zzState = 0;
-
- /* the current lexical state */
- zzLexicalState = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- 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 */
- zzPushbackPos = 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
- */
- zzAtBOL = true;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- zzAtEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- zzEOFDone = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- } else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
-
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class XMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-//%debug
-%switch
-%buffer 8192
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-SpaceChar = [\x20\x09]
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>
-{
- // force to start at beginning of line (^) and at beginning of file (yychar == 0)
- ^{UTF16BE} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}
- ^{UTF16LE} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}
- ^{UTF83ByteBOM} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}
-
- // force to be started on first line, but we do allow preceeding spaces
- ^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-
-}
-
-<ST_XMLDecl>
-{
- "version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
- "encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
- // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found
- // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is
- // read with incorrect encoding (such as if platform encoding is in effect until true encoding detected).
- "\?>" {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-
-
-<QuotedAttributeValue>
-{
- \" { yybegin(DQ_STRING); string.setLength(0); }
- \' { yybegin(SQ_STRING); string.setLength(0); }
- // in this state, anything other than a space character can start an undelimited string
- {S}*. { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
- \" { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\?>" { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- '<' { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- . { string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
- \' { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "%>" { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- '<' { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- . { string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
- {S} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\?>" { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- '<'
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
- \' { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- \" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- . { string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue>
-{
-// this is the fallback (match "anything") rule (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>> {hasMore = false; return EncodingParserConstants.EOF;}
-
- \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java
deleted file mode 100644
index b353067003..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java
+++ /dev/null
@@ -1,905 +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
- *
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 4/6/04 11:13 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.xml;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 4/6/04 11:13 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jflex</tt>
- */
-public class XMLHeadTokenizer {
-
- /** 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 = 10;
- final public static int DQ_STRING = 6;
- final public static int SQ_STRING = 8;
- final public static int ST_XMLDecl = 2;
- final public static int QuotedAttributeValue = 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
- };
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\6\1\7\2\0\1\11\22\0\1\6\1\0\1\27\2\0"+
- "\1\31\1\0\1\30\24\0\1\12\1\10\1\26\1\13\3\0\1\21"+
- "\1\23\1\17\1\0\1\25\1\0\1\24\2\0\1\16\1\15\1\20"+
- "\1\22\10\0\1\14\12\0\1\21\1\23\1\17\1\0\1\25\1\0"+
- "\1\24\2\0\1\16\1\15\1\20\1\22\10\0\1\14\102\0\1\4"+
- "\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3\16\0\1\1"+
- "\1\2\170\0\1\2\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 8000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
-
-
- public XMLHeadTokenizer() {
- 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 XMLHeadTokenizer(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 XMLHeadTokenizer(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 < 128) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- System.out.println(YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
-
- System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore=false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state+1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext: { switch (yy_state) {
- case 0:
- switch (yy_input) {
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 8; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 12; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
- }
-
- case 2:
- switch (yy_input) {
- case 11: yy_isFinal = true; yy_state = 13; break yy_forNext;
- case 15: yy_isFinal = true; yy_state = 14; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
- }
-
- case 3:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 7: yy_isFinal = true; yy_state = 17; break yy_forNext;
- case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 18; break yy_forNext;
- case 24: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
- }
-
- case 4:
- switch (yy_input) {
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
- case 11: yy_isFinal = true; yy_state = 22; break yy_forNext;
- case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
- case 24: yy_isFinal = true; yy_state = 24; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 5:
- switch (yy_input) {
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
- case 24: yy_isFinal = true; yy_state = 25; break yy_forNext;
- case 25: yy_isFinal = true; yy_state = 26; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 6:
- switch (yy_input) {
- case 11: yy_isFinal = true; yy_state = 26; break yy_forNext;
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
- case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- case 24: yy_isFinal = true; yy_state = 29; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
- }
-
- case 8:
- switch (yy_input) {
- case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 9:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 10:
- switch (yy_input) {
- case 4: yy_state = 32; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 11:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 33; break yy_forNext;
- case 10: yy_state = 34; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 12:
- switch (yy_input) {
- case 11: yy_state = 35; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 13:
- switch (yy_input) {
- case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 36; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 14:
- switch (yy_input) {
- case 16: yy_state = 37; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 16:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 7: yy_state = 38; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
- }
-
- case 17:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 7: yy_state = 38; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
- }
-
- case 22:
- switch (yy_input) {
- case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 39; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 24:
- switch (yy_input) {
- case 10: yy_state = 40; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 25:
- switch (yy_input) {
- case 10: yy_state = 40; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 26:
- switch (yy_input) {
- case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 29:
- switch (yy_input) {
- case 10: yy_state = 40; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 32:
- switch (yy_input) {
- case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 42; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 33:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 33; break yy_forNext;
- case 10: yy_state = 34; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 34:
- switch (yy_input) {
- case 11: yy_state = 35; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 35:
- switch (yy_input) {
- case 12: yy_state = 43; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 37:
- switch (yy_input) {
- case 17: yy_state = 44; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 38:
- switch (yy_input) {
- case 6:
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 7: yy_state = 38; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
- }
-
- case 40:
- switch (yy_input) {
- case 24: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 43:
- switch (yy_input) {
- case 13: yy_state = 45; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 44:
- switch (yy_input) {
- case 18: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 45:
- switch (yy_input) {
- case 14: yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 46:
- switch (yy_input) {
- case 19: yy_state = 48; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 47:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 48:
- switch (yy_input) {
- case 20: yy_state = 50; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 49:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 50:
- switch (yy_input) {
- case 16: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 51:
- switch (yy_input) {
- case 21: yy_state = 52; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 52:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_state = 52; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 53; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 53:
- switch (yy_input) {
- case 6:
- case 7:
- case 9: yy_isFinal = true; yy_state = 53; 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 25:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 55: break;
- case 21:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 56: break;
- case 15:
- case 16:
- { yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
- case 57: break;
- case 28:
- case 29:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
- case 58: break;
- case 39:
- { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 59: break;
- case 41:
- { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 60: break;
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 17:
- { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
- case 61: break;
- case 30:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;} }
- case 62: break;
- case 31:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;} }
- case 63: break;
- case 42:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;} }
- case 64: break;
- case 49:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
- case 65: break;
- case 36:
- { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd; }
- case 66: break;
- case 53:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
- case 67: break;
- case 23:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 68: break;
- case 20:
- case 22:
- case 24:
- case 26:
- { string.append( yytext() ); }
- case 69: break;
- case 19:
- { yybegin(SQ_STRING); string.setLength(0); }
- case 70: break;
- case 18:
- { yybegin(DQ_STRING); string.setLength(0); }
- case 71: break;
- case 27:
- { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 72: 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++) {
- XMLHeadTokenizer scanner = null;
- try {
- scanner = new XMLHeadTokenizer( 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 XMLHeadTokenizer <inputfile>");
- System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- } while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd
deleted file mode 100644
index 7ec1c7bac4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo on
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;D:\JDKs\j2sdk1.4.2_03\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\WSWBM8
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=XMLHeadTokenizer
-
-rem set PROJECT_SRC=\org.eclipse.wst.sse.core.xml\src\
-rem set PACKAGE_DIR=com\ibm\sse\model\xml\encoding\
-
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\xml\
-
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% 1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt
deleted file mode 100644
index 316c32ee0f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading "XMLHeadTokenizer.jflex"
-
-Warning : Macro "SpaceChar" has been declared but never used.
-Constructing NFA : 358 states in NFA
-Converting NFA to DFA :
-...................................................................
-79 states before minimization, 54 states in minimized DFA
-Writing code to "XMLHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton
deleted file mode 100644
index 98096024bc..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton
+++ /dev/null
@@ -1,263 +0,0 @@
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
---- lexical states, charmap
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
---- isFinal list
- /** 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;
-
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
-
-
---- user class code
-
- /**
- * 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.
- */
---- constructor declaration
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- //Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- System.out.println("ScanError: " + errorCode + ": " + YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- //Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- System.out.println("ScanError: " + errorCode + ": " + YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
---- yy_doEof
- /**
- * 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
- */
---- yylex declaration
- int yy_input;
- int yy_action;
-
---- local declarations
-
- while (true) {
-
---- start admin (line, char, col count)
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
---- start admin (lexstate etc)
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
---- line, col, char count, next transition, isFinal action
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
---- line count update
- }
-
- }
- }
-
---- char count update
-
- switch (yy_action) {
-
---- actions
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
---- eofvalue
- }
- else {
---- no match
- }
- }
- }
- }
-
---- main
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
deleted file mode 100644
index 4648a3f43f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
+++ /dev/null
@@ -1,522 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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;
-
-%%
-
-%public
-%class CSSTokenizer
-%implements CSSRegionContexts, ICSSTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%caseless
-//%debug
-%pack
-
-%{
- 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 && (context != CSS_COMMENT)) {
- // 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));
- }
-%}
-
-%state ST_CHARSET_NAME
-%state ST_CHARSET_DELIMITER
-%state ST_IMPORT_URI
-%state ST_IMPORT_MEDIUM
-%state ST_IMPORT_DELIMITER
-%state ST_MEDIA_MEDIUM
-%state ST_MEDIA_DELIMITER
-%state ST_PAGE_PSEUDO_PAGE
-%state ST_PAGE_DELIMITER
-%state ST_FONT_FACE_DELIMITER
-%state ST_SELECTOR
-%state ST_SELECTOR_MODIFIER
-%state ST_SELECTOR_ATTRIBUTE_NAME
-%state ST_SELECTOR_ATTRIBUTE_OPERATOR
-%state ST_SELECTOR_ATTRIBUTE_VALUE
-%state ST_SELECTOR_ATTRIBUTE_END
-%state ST_DECLARATION
-%state ST_DECLARATION_SEPARATOR
-%state ST_DECLARATION_PRE_VALUE
-%state ST_DECLARATION_VALUE
-
-h = [0-9a-f]
-nonascii = [\u0080-\uffff]
-unicode = \\{h}{1,6}[ \t\r\n\f]?
-escape = {unicode}|\\[ -~\u0080-\uffff]
-
-
-
-nmstart = [_a-zA-Z]|{nonascii}|{escape}
-nmchar = [_a-zA-Z0-9-]|{nonascii}|{escape}
-string1 = \"([\t !#$%&(-~]|\\{nl}|\'|{nonascii}|{escape})*\"
-string2 = \'([\t !#$%&(-~]|\\{nl}|\"|{nonascii}|{escape})*\'
-
-ident = -?{nmstart}{nmchar}*
-value_ident = -?{nmstart}"."?({nmchar}+"."?)*
-
-name = {nmchar}+
-num = [+-]?([0-9]+|[0-9]*"."[0-9]+)
-string = {string1}|{string2}
-url = ([ !#$%&*-~]|{nonascii}|{escape})*
-s = [ \t\r\n\f]
-w = {s}*
-nl = \n|\r\n|\r|\f
-
-//range = \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
-
-hash = "#"{name}
-uri = ("url("{w}{string}{w}")"|"url("{w}{url}{w}")")
-function = {ident}"("
-unicode_range = "U"\+[0-9a-fA-F?]{1,6}("-"[0-9a-fA-F?]{1,6})?
-
-%%
-
-/*
- * *** global ***
- */
-
-{s}+ { return CSS_S; }
-"<!--" { return CSS_CDO; }
-"-->" { return CSS_CDC; }
-"}" { yybegin(YYINITIAL); return CSS_RBRACE; }
-\/\*[^*]*\*+([^/*][^*]*\*+)*\/ { return CSS_COMMENT; }
-
-//<YYINITIAL> {
-// "@import" { yybegin(ST_IMPORT_URI); return CSS_IMPORT; }
-//}
-
-/*
- * *** charset rule ***
- * CHARSET_SYM S* STRING S* ';'
- */
-
-"@charset" { yybegin(ST_CHARSET_NAME); return CSS_CHARSET; }
-
-<ST_CHARSET_NAME> {
- {string} { yybegin(ST_CHARSET_DELIMITER); return CSS_STRING; }
-}
-
-<ST_CHARSET_DELIMITER> {
- ";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-/*
- * *** import rule ***
- * IMPORT_SYM S* [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
- */
-
-"@import" { yybegin(ST_IMPORT_URI); return CSS_IMPORT; }
-
-<ST_IMPORT_URI> {
- {string} { yybegin(ST_IMPORT_MEDIUM); return CSS_STRING; }
- // "url("{w}{string}{w}")" { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
- // "url("{w}{url}{w}")" { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
- {uri} { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
- ";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-<ST_IMPORT_MEDIUM> {
- {ident} { yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM; }
- ";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-<ST_IMPORT_DELIMITER> {
- ";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
- "," { yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR; }
-}
-
-/*
- * *** media rule ***
- * MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
- */
-
-"@media" { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA; }
-
-/*
- * medium
- * IDENT S*
- */
-<ST_MEDIA_MEDIUM> {
- {ident} { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM; }
- "{" { yybegin(YYINITIAL); return CSS_LBRACE; }
-}
-
-<ST_MEDIA_DELIMITER> {
- "{" { yybegin(YYINITIAL); return CSS_LBRACE; }
- "," { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR; }
-}
-
-/*
- * *** page rule **
- * PAGE_SYM S* pseudo_page? S* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
- */
-
-"@page" { yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE; }
-
-/*
- * pseudo_page
- * ':' IDENT
- */
-
-<ST_PAGE_PSEUDO_PAGE> {
- ":"?{ident} { yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR; }
- "{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-<ST_PAGE_DELIMITER> {
- "{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * font-face
- * FONT_FACE_SYM S* '{' S* declaration [ ';' S* declaration '* '}' S*
- */
-
-"@font-face" { yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE; }
-
-<ST_FONT_FACE_DELIMITER> {
- "{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * selector
- * simple_selector [ combinator simple_selector ]*
- */
-
-/*
- * simple_selector
- * element_name [ HASH | class | attrib | pseudo ]* | [ HASH | class | attrib | pseudo ]+
- */
-
-<YYINITIAL, ST_SELECTOR_MODIFIER, ST_SELECTOR> {
- "*" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL; }
- {hash} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID; }
-// ":"{ident}("("{s}*{ident}{s}*")")? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }
- ":"({ident}("("{s}*([a-zA-Z0-9]|[-+]|{s})*{s}*")")?)? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }
- "."{name} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS; }
- "[" { yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START; }
-}
-
-<YYINITIAL, ST_SELECTOR> {
- {ident} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME; }
-}
-
-<ST_SELECTOR_MODIFIER> {
- "," { yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR; }
- // using LOOKAHEAD
- {s}+/[^+>\{,/] { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }
- "+"|">" { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }
- "{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * attrib
- * '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* [ IDENT | STRING ] S* ]? ']'
- */
-
-<ST_SELECTOR_ATTRIBUTE_NAME> {
- {ident} { yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME; }
- "]" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_OPERATOR> {
- "="|"~="|"|="|"*="|"$="|"^=" { yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR; }
- "]" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_VALUE> {
- {ident}|{string} { yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_END> {
- "]" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END; }
-}
-
-/*
- * declaration
- * property ':' S* expr prio? | // empty //
- */
-
-<ST_DECLARATION> {
- \x2A?{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }
-}
-
-<ST_DECLARATION_SEPARATOR> {
- ":" { yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR; }
-}
-
-<ST_DECLARATION_PRE_VALUE, ST_DECLARATION_VALUE> {
- "!"{s}*"important" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT; }
-
-
- ")" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE; }
-
- // ordered following two rules deliberately, see
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129902
- {num}{ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION; }
- {value_ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT; }
-
-
- {num}"%" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE; }
-
- {num} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER; }
-
-
-
- {function} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION; }
- {string} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING; }
- {uri} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI; }
- "#"{name} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH; }
- {unicode_range} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE; }
- [,/] { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR; }
-}
-
-<ST_DECLARATION_VALUE> {
- {s}+/[^;}] { return CSS_DECLARATION_VALUE_S; }
-}
-
-<ST_DECLARATION, ST_DECLARATION_SEPARATOR, ST_DECLARATION_PRE_VALUE, ST_DECLARATION_VALUE> {
- ";" { yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER; }
- // "}" { yybegin(YYINITIAL); return CSS_RBRACE; }
-}
-
-
-//<YYINITIAL, ST_IMPORT_URI, ST_IMPORT_MEDIUM, ST_IMPORT_DELIMITER> {
-// \/\*[^*]*\*+([^/*][^*]*\*+)*\/ { return CSS_COMMENT; }
-// {s}+ { return CSS_S; }
-// . { return UNDEFINED; }
-//}
-
-//<YYINITIAL, ST_IMPORT_URI, ST_IMPORT_MEDIUM, ST_IMPORT_DELIMITER> {
-// [^ \t\r\n\f]+ { return CSS_UNKNOWN; }
-//}
-
-. {
- return UNDEFINED;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
deleted file mode 100644
index d39ae78fa8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-set JAVA_HOME=d:\jdk6_03
-set JFLEX_HOME=D:\JFlex\jflex-1.4.2
-
-%JAVA_HOME%\bin\java -Xmx470M -jar %JFLEX_HOME%\lib\JFlex.jar CSSTokenizer.jflex
-move CSSTokenizer.java ..\..\..\..\..\org.eclipse.wst.css.core\src\org\eclipse\wst\css\core\internal\parser\ && del CSSTokenizer.java*
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README
deleted file mode 100644
index 3d820e1d21..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README
+++ /dev/null
@@ -1,9 +0,0 @@
-devel - the active development environment (sans JDK)
- - latest version of HTMLTokenizer specification and generated code
- - modified skeleton to prevent VM exits on unmatched input
- - "flex" scripts to run JFlex with modified skeleton
- - active RCS archive
-resources - backup/pristine resources
- - Unmodified JFlex 1.2.2 download
- - Separate modifications to the JFlex skeleton
- - W3C XML recommendation used for several of the HTMLTokenizer rules
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java
deleted file mode 100644
index b4244760d2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java
+++ /dev/null
@@ -1,3838 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 10/24/07 5:16 AM */
-
-/*******************************************************************************
- * 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.core.internal.parser.internal;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
-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;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
-import org.eclipse.wst.xml.core.internal.parser.IntStack;
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 10/24/07 5:16 AM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
- */
-public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_JSP_VBL_DQUOTES = 51;
- final public static int ST_JSP_VBL_SQUOTES = 50;
- final public static int ST_JSP_VBL_SQUOTES_END = 52;
- final public static int ST_XML_COMMENT_END = 4;
- final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE = 21;
- final public static int ST_JSP_EL_SQUOTES_END = 45;
- final public static int ST_JSP_EL_DQUOTES = 44;
- final public static int ST_JSP_EL = 42;
- final public static int ST_BLOCK_TAG_SCAN = 36;
- final public static int ST_JSP_EL_SQUOTES = 43;
- final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
- final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
- final public static int ST_DHTML_TAG_CLOSE = 15;
- final public static int ST_XML_ATTRIBUTE_VALUE_DQUOTED = 41;
- final public static int ST_DHTML_EQUALS = 13;
- final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
- final public static int ST_XML_ATTRIBUTE_VALUE = 25;
- final public static int ST_JSP_VBL = 49;
- final public static int ST_JSP_SQUOTED_VBL = 55;
- final public static int ST_XML_ATTRIBUTE_VALUE_SQUOTED = 40;
- final public static int ST_XML_ATTRIBUTE_NAME = 23;
- final public static int ST_XML_EQUALS = 24;
- final public static int YYINITIAL = 0;
- final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_NAME = 19;
- final public static int ST_JSP_CONTENT = 16;
- final public static int ST_XML_DOCTYPE_ID_SYSTEM = 31;
- final public static int ST_XML_ELEMENT_DECLARATION = 32;
- final public static int ST_XML_DECLARATION_CLOSE = 27;
- final public static int ST_JSP_DIRECTIVE_EQUALS = 20;
- final public static int ST_JSP_VBL_DQUOTES_END = 53;
- final public static int ST_JSP_DQUOTED_EL = 47;
- final public static int ST_XML_DOCTYPE_DECLARATION = 28;
- final public static int ST_CDATA_END = 2;
- final public static int ST_PI_WS = 6;
- final public static int ST_CDATA_TEXT = 1;
- final public static int ST_JSP_DIRECTIVE_NAME_WHITESPACE = 18;
- final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 33;
- final public static int ST_XML_ATTLIST_DECLARATION = 34;
- final public static int ST_JSP_EL_DQUOTES_END = 46;
- final public static int ST_JSP_SQUOTED_EL = 48;
- final public static int ST_JSP_COMMENT_END = 39;
- final public static int ST_XML_PI_EQUALS = 9;
- final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 35;
- final public static int ST_XML_DOCTYPE_ID_PUBLIC = 30;
- final public static int ST_JSP_DQUOTED_VBL = 54;
- final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
- final public static int ST_ABORT_EMBEDDED = 37;
- final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 29;
- final public static int ST_JSP_COMMENT = 38;
- final public static int ST_PI_CONTENT = 7;
- final public static int ST_BLOCK_TAG_INTERNAL_SCAN = 37;
- final public static int ST_PI = 5;
- final public static int ST_XML_DECLARATION = 26;
- final public static int ST_JSP_DIRECTIVE_NAME = 17;
- final public static int ST_XML_TAG_NAME = 22;
- final public static int ST_XML_PI_TAG_CLOSE = 11;
- final public static int ST_XML_COMMENT = 3;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\5\1\26\2\0\1\17\22\0\1\17\1\25\1\12\1\65"+
- "\1\15\1\22\1\13\1\14\1\24\1\24\1\24\1\24\1\24\1\7"+
- "\1\6\1\3\12\20\1\11\1\72\1\1\1\51\1\2\1\4\1\21"+
- "\1\40\1\73\1\36\1\37\1\55\1\70\1\62\1\62\1\63\1\62"+
- "\1\62\1\33\1\31\1\64\1\52\1\54\1\62\1\67\1\66\1\41"+
- "\1\71\2\62\1\27\1\53\1\62\1\35\1\104\1\23\1\0\1\10"+
- "\1\0\1\57\1\103\1\74\1\60\1\43\1\70\1\75\1\106\1\46"+
- "\1\100\1\62\1\34\1\32\1\50\1\47\1\101\1\62\1\44\1\45"+
- "\1\56\1\102\1\42\1\62\1\30\1\61\1\62\1\16\1\0\1\105"+
- "\71\0\1\77\10\0\27\76\1\0\37\76\1\0\72\76\2\0\13\76"+
- "\2\0\10\76\1\0\65\76\1\0\104\76\11\0\44\76\3\0\2\76"+
- "\4\0\36\76\70\0\131\76\22\0\7\76\16\0\2\77\56\0\106\77"+
- "\32\0\2\77\44\0\1\76\1\77\3\76\1\0\1\76\1\0\24\76"+
- "\1\0\54\76\1\0\7\76\3\0\1\76\1\0\1\76\1\0\1\76"+
- "\1\0\1\76\1\0\22\76\15\0\14\76\1\0\102\76\1\0\14\76"+
- "\1\0\44\76\1\0\4\77\11\0\65\76\2\0\2\76\2\0\2\76"+
- "\3\0\34\76\2\0\10\76\2\0\2\76\67\0\46\76\2\0\1\76"+
- "\7\0\46\76\12\0\21\77\1\0\27\77\1\0\3\77\1\0\1\77"+
- "\1\0\2\77\1\0\1\77\13\0\33\76\5\0\3\76\56\0\32\76"+
- "\5\0\1\77\12\76\10\77\15\0\12\77\6\0\1\77\107\76\2\0"+
- "\5\76\1\0\17\76\1\0\4\76\1\0\1\76\17\77\2\76\2\77"+
- "\1\0\4\77\2\0\12\77\u0207\0\3\77\1\0\65\76\2\0\1\77"+
- "\1\76\20\77\3\0\4\77\3\0\12\76\2\77\2\0\12\77\21\0"+
- "\3\77\1\0\10\76\2\0\2\76\2\0\26\76\1\0\7\76\1\0"+
- "\1\76\3\0\4\76\2\0\1\77\1\0\7\77\2\0\2\77\2\0"+
- "\3\77\11\0\1\77\4\0\2\76\1\0\3\76\2\77\2\0\12\77"+
- "\2\76\20\0\1\77\2\0\6\76\4\0\2\76\2\0\26\76\1\0"+
- "\7\76\1\0\2\76\1\0\2\76\1\0\2\76\2\0\1\77\1\0"+
- "\5\77\4\0\2\77\2\0\3\77\13\0\4\76\1\0\1\76\7\0"+
- "\12\77\2\77\3\76\14\0\3\77\1\0\7\76\1\0\1\76\1\0"+
- "\3\76\1\0\26\76\1\0\7\76\1\0\2\76\1\0\5\76\2\0"+
- "\1\77\1\76\10\77\1\0\3\77\1\0\3\77\22\0\1\76\5\0"+
- "\12\77\21\0\3\77\1\0\10\76\2\0\2\76\2\0\26\76\1\0"+
- "\7\76\1\0\2\76\2\0\4\76\2\0\1\77\1\76\6\77\3\0"+
- "\2\77\2\0\3\77\10\0\2\77\4\0\2\76\1\0\3\76\4\0"+
- "\12\77\22\0\2\77\1\0\6\76\3\0\3\76\1\0\4\76\3\0"+
- "\2\76\1\0\1\76\1\0\2\76\3\0\2\76\3\0\3\76\3\0"+
- "\10\76\1\0\3\76\4\0\5\77\3\0\3\77\1\0\4\77\11\0"+
- "\1\77\17\0\11\77\21\0\3\77\1\0\10\76\1\0\3\76\1\0"+
- "\27\76\1\0\12\76\1\0\5\76\4\0\7\77\1\0\3\77\1\0"+
- "\4\77\7\0\2\77\11\0\2\76\4\0\12\77\22\0\2\77\1\0"+
- "\10\76\1\0\3\76\1\0\27\76\1\0\12\76\1\0\5\76\4\0"+
- "\7\77\1\0\3\77\1\0\4\77\7\0\2\77\7\0\1\76\1\0"+
- "\2\76\4\0\12\77\22\0\2\77\1\0\10\76\1\0\3\76\1\0"+
- "\27\76\1\0\20\76\4\0\6\77\2\0\3\77\1\0\4\77\11\0"+
- "\1\77\10\0\2\76\4\0\12\77\221\0\56\76\1\0\1\76\1\77"+
- "\2\76\7\77\5\0\6\76\1\77\10\77\1\0\12\77\47\0\2\76"+
- "\1\0\1\76\2\0\2\76\1\0\1\76\2\0\1\76\6\0\4\76"+
- "\1\0\7\76\1\0\3\76\1\0\1\76\1\0\1\76\2\0\2\76"+
- "\1\0\2\76\1\0\1\76\1\77\2\76\6\77\1\0\2\77\1\76"+
- "\2\0\5\76\1\0\1\77\1\0\6\77\2\0\12\77\76\0\2\77"+
- "\6\0\12\77\13\0\1\77\1\0\1\77\1\0\1\77\4\0\2\77"+
- "\10\76\1\0\41\76\7\0\24\77\1\0\6\77\4\0\6\77\1\0"+
- "\1\77\1\0\25\77\3\0\7\77\1\0\1\77\346\0\46\76\12\0"+
- "\47\76\11\0\1\76\1\0\2\76\1\0\3\76\1\0\1\76\1\0"+
- "\2\76\1\0\5\76\51\0\1\76\1\0\1\76\1\0\1\76\13\0"+
- "\1\76\1\0\1\76\1\0\1\76\3\0\2\76\3\0\1\76\5\0"+
- "\3\76\1\0\1\76\1\0\1\76\1\0\1\76\1\0\1\76\3\0"+
- "\2\76\3\0\2\76\1\0\1\76\50\0\1\76\11\0\1\76\2\0"+
- "\1\76\2\0\2\76\7\0\2\76\1\0\1\76\1\0\7\76\50\0"+
- "\1\76\4\0\1\76\10\0\1\76\u0c06\0\234\76\4\0\132\76\6\0"+
- "\26\76\2\0\6\76\2\0\46\76\2\0\6\76\2\0\10\76\1\0"+
- "\1\76\1\0\1\76\1\0\1\76\1\0\37\76\2\0\65\76\1\0"+
- "\7\76\1\0\1\76\3\0\3\76\1\0\7\76\3\0\4\76\2\0"+
- "\6\76\4\0\15\76\5\0\3\76\1\0\7\76\323\0\15\77\4\0"+
- "\1\77\104\0\1\76\3\0\2\76\2\0\1\76\121\0\3\76\u0e82\0"+
- "\1\77\1\0\1\76\31\0\11\76\6\77\1\0\5\77\13\0\124\76"+
- "\4\0\2\77\2\0\2\77\2\0\132\76\1\0\3\77\6\0\50\76"+
- "\u1cd3\0\u51a6\76\u0c5a\0\u2ba4\76\134\0\u0800\0\u1ffe\0\2\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
- /**
- * Translates a state to a row index in the transition table
- */
- final private static int yy_rowMap [] = {
- 0, 71, 142, 213, 284, 355, 426, 497, 568, 639,
- 710, 781, 852, 923, 994, 1065, 1136, 1207, 1278, 1349,
- 1420, 1491, 1562, 1633, 1704, 1775, 1846, 1917, 1988, 2059,
- 2130, 2201, 2272, 2343, 2414, 2485, 2556, 2627, 2698, 2769,
- 2840, 2911, 2982, 3053, 3124, 3195, 3266, 3337, 3408, 3479,
- 3550, 3621, 3692, 3763, 3834, 3905, 3976, 4047, 4118, 4189,
- 4260, 4331, 4402, 4473, 4402, 4473, 4544, 4402, 4402, 4473,
- 4615, 4686, 4757, 4828, 4899, 4970, 5041, 5112, 4402, 4473,
- 5183, 5254, 5325, 4402, 5396, 5396, 5467, 5538, 5609, 5183,
- 4402, 5680, 5751, 4402, 5822, 5893, 5964, 6035, 4402, 4473,
- 6106, 6177, 6248, 6319, 6390, 6461, 4402, 6532, 6532, 6603,
- 6674, 6745, 6816, 6887, 4402, 6958, 7029, 7100, 7171, 7242,
- 7313, 4402, 7384, 7455, 7526, 7597, 7668, 7739, 7810, 7881,
- 4402, 7952, 8023, 8094, 8165, 8236, 8307, 8378, 8449, 8449,
- 8520, 8591, 8662, 8733, 8733, 8804, 8875, 8946, 9017, 9017,
- 9088, 9159, 9230, 9301, 4402, 9372, 9372, 9443, 9514, 9585,
- 9656, 4402, 4402, 4473, 4402, 4473, 9727, 9798, 9869, 9940,
- 4402, 10011, 10082, 10153, 10224, 4402, 10295, 10366, 10437, 10508,
- 4402, 4402, 10579, 4402, 10650, 10721, 10650, 10792, 10863, 10792,
- 4402, 4402, 10934, 11005, 11076, 4402, 11147, 11218, 11289, 11360,
- 11431, 4402, 4402, 11502, 4402, 11573, 11644, 11573, 11715, 11786,
- 11715, 4402, 4402, 11857, 11928, 11999, 4402, 12070, 12141, 12212,
- 4402, 4402, 12283, 12354, 12425, 12496, 12567, 4402, 12638, 12709,
- 12780, 12851, 12922, 12993, 13064, 13135, 4402, 13206, 13277, 13348,
- 4402, 4402, 5396, 5538, 4402, 13419, 5609, 13490, 5680, 5822,
- 5893, 13561, 5964, 4402, 13632, 13703, 6035, 13774, 4402, 12354,
- 4402, 6532, 6603, 4402, 13845, 6674, 13916, 4402, 13987, 14058,
- 7384, 14129, 7597, 4402, 14200, 7668, 14271, 14342, 14413, 14484,
- 14555, 14626, 8165, 4402, 14697, 14768, 8449, 8520, 4402, 14839,
- 14910, 14981, 15052, 15123, 8662, 8449, 8733, 8804, 4402, 8875,
- 8946, 8733, 9017, 9088, 4402, 15194, 15265, 15336, 15407, 15478,
- 15549, 15620, 9372, 9443, 4402, 15691, 15762, 15833, 15904, 15975,
- 16046, 16117, 16188, 16259, 4402, 4402, 4402, 16330, 4402, 4402,
- 16401, 16472, 16543, 16614, 10650, 4402, 16685, 16756, 10792, 4402,
- 16827, 16898, 16969, 17040, 17111, 17182, 17253, 17324, 17395, 11360,
- 11573, 4402, 17466, 17537, 11715, 4402, 17608, 17679, 17750, 17821,
- 17892, 17963, 18034, 18105, 18176, 4402, 4402, 4402, 18247, 18318,
- 18389, 18460, 18531, 4402, 18602, 18673, 4402, 4402, 4402, 4402,
- 4402, 4828, 18744, 18815, 18886, 18957, 19028, 19099, 19170, 19099,
- 19241, 19312, 19241, 19383, 19454, 19525, 19596, 19667, 19738, 19809,
- 19809, 19880, 19951, 19951, 20022, 9230, 9230, 9230, 20093, 20164,
- 20235, 20235, 20306, 9585, 9585, 9585, 20377, 20448, 16543, 20519,
- 10437, 10437, 10437, 20590, 20661, 10650, 10650, 10650, 20732, 20803,
- 10792, 10792, 10792, 20874, 20945, 10934, 10934, 10934, 17111, 21016,
- 21087, 11147, 11147, 11147, 17324, 21158, 21229, 11360, 11360, 11360,
- 21300, 11573, 11573, 11573, 21371, 21442, 11715, 11715, 11715, 21513,
- 21584, 11857, 11857, 11857, 17892, 21655, 21726, 12070, 12070, 12070,
- 18105, 21797, 4402, 4402, 21868, 21939, 4402, 22010, 22081, 22152,
- 22223, 7384, 4402, 4402, 22294, 22365, 22436, 22507, 22578, 15052,
- 15407, 9230, 22649, 15904, 9585, 22720, 4402, 10437, 10650, 22791,
- 10792, 22862, 10934, 22933, 4402, 11147, 23004, 11360, 11573, 23075,
- 11715, 23146, 11857, 23217, 4402, 12070, 23288, 23359, 23430, 23501,
- 23572, 23643, 23714, 23785, 23856, 23927, 23998, 24069, 24140, 24211,
- 24282, 24353, 24424, 24495, 24566, 24637, 24708, 24779, 24850, 4828,
- 24921, 24992, 25063, 25134, 25205, 4402, 4402, 25276, 25347, 25418,
- 25489, 17111, 17324, 25560, 25631, 17892, 18105, 25702, 25773, 25844,
- 25915, 4402, 4402, 4402, 25986, 26057, 26128, 26199, 26270, 26341,
- 26412, 26483, 7100, 26554, 26625, 26696, 26767, 26838, 26909, 26980,
- 4402, 27051, 27122, 9230, 9585, 10650, 10792, 11573, 11715, 27193,
- 27264, 27335, 27406, 27477, 27548, 27619, 27690, 4828, 27761, 27832,
- 27903, 27974, 28045, 28116, 28187, 28258, 28329, 28400, 28471, 28542,
- 28613, 28684, 28755, 28826, 28897, 28968, 29039, 29110, 29181, 29252,
- 29323, 29394, 29465, 29536, 29607, 29678, 29749, 29820, 29891, 29962,
- 30033, 30104, 30175, 30246, 4402, 30317, 30388, 30459, 30530, 7100,
- 30601, 30672, 30743, 30814, 30885, 30956, 31027, 31098, 31169, 31240,
- 31311, 31382, 31453, 31524
- };
-
- /**
- * The packed transition table of the DFA
- */
- final private static String yy_packed =
- "\1\71\1\72\11\71\1\73\1\71\1\74\4\71\1\75"+
- "\42\71\1\76\21\71\1\77\1\100\105\77\1\101\1\102"+
- "\21\101\1\103\2\101\1\104\60\101\1\105\1\106\105\105"+
- "\1\101\1\102\5\101\1\107\16\101\1\104\61\101\1\102"+
- "\2\101\1\110\1\111\2\101\2\112\5\101\1\111\6\101"+
- "\1\111\1\113\1\114\4\112\1\101\10\112\1\115\2\112"+
- "\1\101\11\112\1\115\1\112\1\101\4\112\1\101\4\112"+
- "\1\101\4\112\2\101\1\112\1\101\1\102\2\101\1\110"+
- "\1\116\11\101\1\116\6\101\1\116\60\101\1\117\1\120"+
- "\2\117\1\121\21\117\1\104\60\117\1\101\1\102\2\101"+
- "\1\122\1\111\2\101\2\123\5\101\1\111\6\101\1\111"+
- "\6\123\1\101\13\123\1\101\13\123\1\101\4\123\1\101"+
- "\4\123\1\101\4\123\2\101\1\123\1\101\1\102\2\101"+
- "\1\122\1\111\2\101\2\123\5\101\1\111\6\101\1\111"+
- "\6\123\1\101\13\123\1\124\13\123\1\101\4\123\1\101"+
- "\4\123\1\101\4\123\2\101\1\123\1\125\1\102\1\101"+
- "\1\126\1\127\1\111\4\125\1\130\1\125\1\131\2\125"+
- "\1\111\6\125\1\111\60\125\1\101\1\102\2\101\1\132"+
- "\21\101\1\104\61\101\1\102\1\133\1\134\1\101\1\111"+
- "\2\101\2\135\5\101\1\111\6\101\1\111\6\135\1\101"+
- "\13\135\1\101\13\135\1\101\4\135\1\101\4\135\1\101"+
- "\4\135\2\101\1\135\1\101\1\102\1\133\1\134\1\101"+
- "\1\111\2\101\2\135\5\101\1\111\6\101\1\111\6\135"+
- "\1\101\13\135\1\136\13\135\1\101\4\135\1\101\4\135"+
- "\1\101\4\135\2\101\1\135\1\137\1\102\1\133\1\140"+
- "\1\137\1\111\4\137\1\141\1\137\1\142\2\137\1\111"+
- "\6\137\1\111\60\137\1\101\1\102\3\101\1\111\11\101"+
- "\1\111\6\101\1\111\60\101\1\143\1\144\20\143\1\145"+
- "\64\143\1\101\1\146\3\101\1\111\2\101\2\147\5\101"+
- "\1\111\2\101\1\150\3\101\1\111\6\147\1\101\13\147"+
- "\1\101\13\147\1\101\4\147\1\101\4\147\1\101\4\147"+
- "\2\101\1\147\1\101\1\146\3\101\1\151\11\101\1\151"+
- "\2\101\1\150\3\101\1\151\61\101\1\146\3\101\1\111"+
- "\2\101\2\152\5\101\1\111\2\101\1\150\3\101\1\111"+
- "\6\152\1\101\13\152\1\101\13\152\1\101\4\152\1\101"+
- "\4\152\1\101\4\152\2\101\1\152\1\101\1\146\3\101"+
- "\1\111\2\101\2\152\5\101\1\111\2\101\1\150\3\101"+
- "\1\111\6\152\1\101\13\152\1\153\13\152\1\101\4\152"+
- "\1\101\4\152\1\101\4\152\2\101\1\152\1\154\1\146"+
- "\1\101\1\155\1\154\1\111\4\154\1\156\1\154\1\157"+
- "\2\154\1\111\2\154\1\160\3\154\1\111\60\154\1\161"+
- "\1\162\1\163\1\164\4\161\2\165\15\161\6\166\1\161"+
- "\13\166\1\161\13\166\1\161\4\166\1\161\4\166\1\161"+
- "\1\167\3\166\2\161\1\166\1\101\1\170\1\163\1\164"+
- "\1\101\1\111\2\101\2\171\5\101\1\111\6\101\1\111"+
- "\6\171\1\101\13\171\1\101\13\171\1\101\4\171\1\101"+
- "\4\171\1\101\4\171\2\101\1\171\1\101\1\170\1\163"+
- "\1\164\1\101\1\111\2\101\2\171\5\101\1\111\6\101"+
- "\1\111\6\171\1\101\13\171\1\172\13\171\1\101\4\171"+
- "\1\101\4\171\1\101\4\171\2\101\1\171\1\173\1\174"+
- "\1\163\1\175\1\173\1\111\4\173\1\176\1\173\1\177"+
- "\1\200\1\173\1\111\6\173\1\111\36\173\1\201\21\173"+
- "\1\101\1\202\1\203\2\101\1\111\11\101\1\111\6\101"+
- "\1\111\10\101\1\204\1\205\2\101\1\206\11\101\1\206"+
- "\1\101\1\205\1\204\27\101\1\102\1\203\2\101\1\111"+
- "\11\101\1\111\6\101\1\111\6\101\1\207\52\101\1\102"+
- "\1\203\2\101\1\111\2\101\2\210\5\101\1\111\6\101"+
- "\1\111\6\210\1\207\13\210\1\101\13\210\1\101\4\210"+
- "\1\101\4\210\1\101\4\210\2\101\1\210\1\101\1\102"+
- "\1\203\2\101\1\111\11\101\1\111\6\101\1\111\6\101"+
- "\1\207\7\101\1\211\6\101\1\212\11\101\1\211\12\101"+
- "\1\212\5\101\1\213\1\102\1\203\1\214\1\213\1\111"+
- "\4\213\1\215\1\213\1\216\2\213\1\111\6\213\1\111"+
- "\6\213\1\217\51\213\1\220\1\102\1\203\1\221\1\220"+
- "\1\111\4\220\1\222\1\220\1\223\2\220\1\111\6\220"+
- "\1\111\6\220\1\224\51\220\1\225\1\102\1\203\1\226"+
- "\1\225\1\111\4\225\1\227\1\225\1\230\2\225\1\111"+
- "\6\225\1\111\60\225\1\231\1\232\1\233\104\231\1\234"+
- "\1\102\1\203\1\235\1\234\1\111\4\234\1\236\1\234"+
- "\1\237\2\234\1\111\6\234\1\111\60\234\1\240\1\241"+
- "\1\242\104\240\1\243\1\244\105\243\1\101\1\102\24\101"+
- "\1\104\60\101\1\245\1\246\105\245\1\101\1\102\5\101"+
- "\1\247\16\101\1\104\60\101\1\250\1\251\3\250\1\252"+
- "\6\250\1\253\1\254\1\250\1\252\6\250\1\252\36\250"+
- "\1\255\21\250\1\256\1\251\3\256\1\257\4\256\1\260"+
- "\2\256\1\261\1\256\1\257\6\256\1\257\36\256\1\262"+
- "\21\256\1\263\1\264\10\263\1\265\1\263\1\266\1\267"+
- "\67\263\1\270\1\263\1\271\1\272\12\271\1\101\11\271"+
- "\1\273\60\271\1\274\1\275\10\274\1\101\13\274\1\276"+
- "\60\274\1\101\1\102\12\101\1\277\11\101\1\104\61\101"+
- "\1\102\10\101\1\300\13\101\1\104\60\101\1\301\1\302"+
- "\10\301\1\260\71\301\1\303\1\304\1\301\1\305\1\306"+
- "\12\305\1\253\67\305\1\307\1\304\1\305\1\310\1\311"+
- "\10\310\1\312\1\310\1\313\50\310\1\314\17\310\1\315"+
- "\1\310\1\316\1\317\12\316\1\101\11\316\1\320\60\316"+
- "\1\321\1\322\10\321\1\101\13\321\1\323\60\321\1\101"+
- "\1\102\12\101\1\324\11\101\1\104\61\101\1\102\10\101"+
- "\1\325\13\101\1\104\60\101\1\326\1\327\10\326\1\260"+
- "\71\326\1\330\1\331\1\326\1\332\1\333\12\332\1\253"+
- "\67\332\1\334\1\331\1\332\1\71\1\0\11\71\1\0"+
- "\1\71\1\0\4\71\1\0\42\71\1\0\21\71\3\0"+
- "\1\335\1\336\15\0\1\337\2\0\1\340\66\0\1\341"+
- "\2\0\2\342\5\0\1\341\6\0\1\341\6\342\1\0"+
- "\13\342\1\0\13\342\1\343\4\342\1\0\4\342\1\0"+
- "\4\342\2\0\1\342\1\344\1\0\11\344\1\0\1\344"+
- "\1\345\1\346\3\344\1\0\64\344\5\0\1\341\2\0"+
- "\2\347\5\0\1\341\6\0\1\341\6\347\1\0\13\347"+
- "\1\0\13\347\1\0\4\347\1\0\4\347\1\0\4\347"+
- "\2\0\1\347\1\344\1\0\11\344\1\0\2\344\1\350"+
- "\3\344\1\0\42\344\1\351\21\344\131\0\1\337\2\0"+
- "\1\352\104\0\1\353\72\0\1\354\101\0\1\355\111\0"+
- "\1\111\11\0\1\111\6\0\1\111\66\0\4\112\6\0"+
- "\1\112\6\0\6\112\1\0\13\112\1\0\13\112\1\0"+
- "\4\112\1\0\11\112\2\0\1\112\6\0\4\112\6\0"+
- "\1\112\6\0\2\112\2\356\2\112\1\0\13\112\1\0"+
- "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
- "\4\112\6\0\1\112\6\0\2\112\1\356\1\357\2\112"+
- "\1\0\13\112\1\0\13\112\1\0\4\112\1\0\11\112"+
- "\2\0\1\112\6\0\4\112\6\0\1\112\6\0\2\112"+
- "\2\360\2\112\1\0\13\112\1\0\13\112\1\0\4\112"+
- "\1\0\11\112\2\0\1\112\5\0\1\116\11\0\1\116"+
- "\6\0\1\116\62\0\1\361\106\0\1\362\112\0\4\123"+
- "\6\0\1\123\6\0\6\123\1\0\13\123\1\0\13\123"+
- "\1\0\4\123\1\0\11\123\2\0\1\123\1\125\2\0"+
- "\1\363\1\125\1\0\4\125\1\0\1\125\1\0\2\125"+
- "\1\0\6\125\1\0\61\125\1\0\1\362\1\363\1\125"+
- "\1\0\4\125\1\0\1\125\1\0\2\125\1\0\6\125"+
- "\1\0\60\125\1\364\1\0\10\364\1\365\2\364\1\366"+
- "\47\364\1\366\21\364\1\367\1\0\12\367\1\365\1\370"+
- "\47\367\1\370\21\367\2\0\1\133\1\371\111\0\4\135"+
- "\6\0\1\135\6\0\6\135\1\0\13\135\1\0\13\135"+
- "\1\0\4\135\1\0\11\135\2\0\1\135\1\137\2\0"+
- "\1\372\1\137\1\0\4\137\1\0\1\137\1\0\2\137"+
- "\1\0\6\137\1\0\61\137\1\0\1\133\1\373\1\137"+
- "\1\0\4\137\1\0\1\137\1\0\2\137\1\0\6\137"+
- "\1\0\60\137\1\141\1\0\1\374\1\375\1\141\1\374"+
- "\4\141\1\376\1\141\1\374\1\377\1\141\1\374\6\141"+
- "\1\374\36\141\1\377\21\141\1\142\1\0\1\u0100\1\u0101"+
- "\1\142\1\u0100\4\142\1\u0100\1\142\1\376\1\u0102\1\142"+
- "\1\u0100\6\142\1\u0100\36\142\1\u0102\21\142\2\0\1\u0103"+
- "\126\0\1\337\2\0\1\u0104\67\0\4\147\6\0\1\147"+
- "\6\0\6\147\1\0\13\147\1\0\13\147\1\0\4\147"+
- "\1\0\11\147\2\0\1\147\2\0\1\u0105\111\0\1\151"+
- "\11\0\1\151\6\0\1\151\66\0\4\152\6\0\1\152"+
- "\6\0\6\152\1\0\13\152\1\0\13\152\1\0\4\152"+
- "\1\0\11\152\2\0\1\152\1\154\2\0\1\u0106\1\154"+
- "\1\0\4\154\1\0\1\154\1\0\2\154\1\0\6\154"+
- "\1\0\60\154\1\u0107\1\0\10\u0107\1\u0108\2\u0107\1\u0109"+
- "\47\u0107\1\u0109\21\u0107\1\u010a\1\0\12\u010a\1\u0108\1\u010b"+
- "\47\u010a\1\u010b\21\u010a\1\154\1\0\1\u0105\1\u0106\1\154"+
- "\1\0\4\154\1\0\1\154\1\0\2\154\1\0\6\154"+
- "\1\0\60\154\1\161\3\0\23\161\6\0\1\161\13\0"+
- "\1\161\13\0\1\161\4\0\1\161\4\0\1\161\4\0"+
- "\2\161\4\0\1\335\16\0\1\337\2\0\1\340\63\0"+
- "\1\u010c\104\0\1\161\3\0\2\161\4\165\6\161\1\165"+
- "\6\161\6\166\1\161\13\166\1\161\13\166\1\161\4\166"+
- "\1\161\4\166\1\165\4\166\2\161\1\166\6\0\4\166"+
- "\6\0\1\166\6\0\6\166\1\0\13\166\1\0\13\166"+
- "\1\0\4\166\1\0\11\166\2\0\1\166\6\0\4\166"+
- "\6\0\1\166\6\0\6\166\1\0\7\166\1\u010d\3\166"+
- "\1\0\13\166\1\0\4\166\1\0\11\166\2\0\1\166"+
- "\3\0\1\335\4\0\2\u010e\10\0\1\337\2\0\1\340"+
- "\1\0\6\u010e\1\0\13\u010e\1\0\13\u010e\1\0\4\u010e"+
- "\1\0\4\u010e\1\0\4\u010e\2\0\1\u010e\6\0\4\171"+
- "\6\0\1\171\6\0\6\171\1\0\13\171\1\0\13\171"+
- "\1\0\4\171\1\0\11\171\2\0\1\171\1\173\2\0"+
- "\1\u010f\1\173\1\0\4\173\1\0\1\173\1\0\2\173"+
- "\1\0\6\173\1\0\60\173\3\0\1\335\4\0\2\u0110"+
- "\10\0\1\337\2\0\1\340\1\0\6\u0110\1\0\13\u0110"+
- "\1\0\13\u0110\1\0\4\u0110\1\0\4\u0110\1\0\4\u0110"+
- "\2\0\1\u0110\1\173\1\0\1\u010c\1\u010f\1\173\1\0"+
- "\4\173\1\0\1\173\1\0\2\173\1\0\6\173\1\0"+
- "\60\173\1\u0111\1\0\10\u0111\1\u0112\2\u0111\1\u0113\47\u0111"+
- "\1\u0113\21\u0111\1\u0114\1\0\12\u0114\1\u0112\1\u0115\47\u0114"+
- "\1\u0115\21\u0114\1\173\2\0\1\u010f\1\173\1\0\4\173"+
- "\1\0\1\173\1\0\1\173\1\u0116\1\0\6\173\1\0"+
- "\61\173\2\0\1\u010f\1\173\1\0\4\173\1\0\1\173"+
- "\1\0\1\173\1\u0117\1\0\6\173\1\0\60\173\3\0"+
- "\1\335\16\0\1\337\2\0\1\u0104\130\0\1\u0118\2\0"+
- "\1\u0118\75\0\1\u0119\14\0\1\u0119\63\0\2\u011a\52\0"+
- "\23\u011b\1\u011c\63\u011b\6\0\4\210\6\0\1\210\6\0"+
- "\6\210\1\0\13\210\1\0\13\210\1\0\4\210\1\0"+
- "\11\210\2\0\1\210\53\0\1\u011d\5\0\1\u011d\116\0"+
- "\1\u011e\10\0\1\u011e\4\0\1\213\2\0\1\u011f\1\213"+
- "\1\0\4\213\1\0\1\213\1\0\2\213\1\0\6\213"+
- "\1\0\60\213\1\u0120\1\0\10\u0120\1\u0121\2\u0120\1\u0122"+
- "\47\u0120\1\u0122\21\u0120\1\u0123\1\0\1\u0123\2\u0124\1\u0123"+
- "\4\u0124\2\u0123\1\u0125\1\u0126\1\u0123\4\u0124\1\u0123\11\u0124"+
- "\1\u0123\27\u0124\1\u0126\10\u0124\2\u0123\4\u0124\2\u0123\1\u0124"+
- "\1\217\2\u011b\1\u0127\1\217\1\u011b\4\217\1\u011b\1\217"+
- "\1\u011b\2\217\1\u011b\3\217\1\u0128\2\217\1\u011b\60\217"+
- "\1\220\2\0\1\u0129\1\220\1\0\4\220\1\0\1\220"+
- "\1\0\2\220\1\0\6\220\1\0\60\220\12\u012a\1\u012b"+
- "\74\u012a\14\u012c\1\u012b\72\u012c\1\224\2\u011b\1\u012d\1\224"+
- "\1\u011b\4\224\1\u011b\1\224\1\u011b\2\224\1\u011b\3\224"+
- "\1\u012e\2\224\1\u011b\60\224\1\225\2\0\1\u012f\1\225"+
- "\1\0\4\225\1\0\1\225\1\0\2\225\1\0\6\225"+
- "\1\0\60\225\1\u0130\1\0\10\u0130\1\u0131\2\u0130\1\u0132"+
- "\47\u0130\1\u0132\21\u0130\1\u0133\1\0\1\u0133\2\u0134\1\u0133"+
- "\4\u0134\2\u0133\1\u0135\1\u0136\1\u0133\4\u0134\1\u0133\11\u0134"+
- "\1\u0133\27\u0134\1\u0136\10\u0134\2\u0133\4\u0134\2\u0133\1\u0134"+
- "\2\231\1\0\106\231\1\0\17\231\1\u0137\2\231\1\u0138"+
- "\61\231\1\234\2\0\1\u0139\1\234\1\0\4\234\1\0"+
- "\1\234\1\0\2\234\1\0\6\234\1\0\60\234\1\u013a"+
- "\1\0\10\u013a\1\u013b\2\u013a\1\u013c\47\u013a\1\u013c\21\u013a"+
- "\1\u013d\1\0\1\u013d\2\u013e\1\u013d\4\u013e\2\u013d\1\u013f"+
- "\1\u0140\1\u013d\4\u013e\1\u013d\11\u013e\1\u013d\27\u013e\1\u0140"+
- "\10\u013e\2\u013d\4\u013e\2\u013d\1\u013e\2\240\1\0\106\240"+
- "\1\0\17\240\1\u0141\2\240\1\u0142\61\240\7\0\1\u0143"+
- "\77\0\1\250\1\0\12\250\1\0\1\u0144\47\250\1\u0144"+
- "\21\250\3\0\1\u0145\16\0\1\337\2\0\1\352\61\0"+
- "\1\250\1\0\3\250\1\252\6\250\1\0\1\u0144\1\250"+
- "\1\252\6\250\1\252\36\250\1\u0144\37\250\1\u0146\106\250"+
- "\1\u0147\70\250\1\256\1\0\10\256\1\0\2\256\1\u0148"+
- "\47\256\1\u0148\22\256\1\0\3\256\1\257\4\256\1\0"+
- "\2\256\1\u0148\1\256\1\257\6\256\1\257\36\256\1\u0148"+
- "\37\256\1\u0149\106\256\1\u014a\70\256\12\263\1\0\1\263"+
- "\1\0\1\u014b\67\263\1\0\13\263\1\0\1\263\1\0"+
- "\1\u014b\4\263\1\u014c\62\263\1\0\13\263\1\0\1\263"+
- "\1\0\1\263\1\u014d\66\263\1\u014e\1\263\14\u014f\1\u0150"+
- "\106\u014f\1\u0150\5\u014f\1\u0151\2\u014f\1\u0152\61\u014f\12\u0153"+
- "\1\u0154\106\u0153\1\u0154\7\u0153\1\u0155\2\u0153\1\u0156\61\u0153"+
- "\12\301\1\0\71\301\1\u0157\1\0\13\301\1\0\7\301"+
- "\1\u0158\61\301\1\u0157\1\0\13\301\1\u0159\74\301\14\305"+
- "\1\0\67\305\1\u015a\1\0\15\305\1\0\5\305\1\u015b"+
- "\61\305\1\u015a\1\0\15\305\1\u015c\72\305\12\310\1\0"+
- "\1\310\1\0\70\310\1\0\13\310\1\0\1\310\1\0"+
- "\5\310\1\u015d\62\310\1\0\13\310\1\0\1\310\1\0"+
- "\1\310\1\u015e\66\310\1\0\1\310\14\u015f\1\u0160\106\u015f"+
- "\1\u0160\5\u015f\1\u0161\2\u015f\1\u0162\61\u015f\12\u0163\1\u0164"+
- "\106\u0163\1\u0164\7\u0163\1\u0165\2\u0163\1\u0166\61\u0163\12\326"+
- "\1\0\71\326\1\u0167\1\0\13\326\1\0\7\326\1\u0168"+
- "\61\326\1\u0167\1\0\13\326\1\u0169\74\326\14\332\1\0"+
- "\67\332\1\u016a\1\0\15\332\1\0\5\332\1\u016b\61\332"+
- "\1\u016a\1\0\15\332\1\u016c\72\332\7\0\1\u016d\11\0"+
- "\1\u016e\3\0\1\u016f\23\0\1\u0170\44\0\1\u0171\25\0"+
- "\1\u0172\56\0\1\341\2\0\2\u0173\5\0\1\341\6\0"+
- "\1\341\6\u0173\1\0\13\u0173\1\0\13\u0173\1\0\4\u0173"+
- "\1\0\4\u0173\1\0\4\u0173\2\0\1\u0173\1\u0174\1\0"+
- "\3\u0174\1\u0175\4\342\1\u0174\1\0\3\u0174\1\u0175\1\342"+
- "\1\u0174\1\0\3\u0174\1\u0175\6\342\1\u0174\13\342\1\u0174"+
- "\13\342\1\u0174\4\342\1\u0176\11\342\2\u0174\1\342\20\0"+
- "\1\u0177\7\0\1\u0178\73\0\1\345\71\0\105\346\1\u0179"+
- "\1\346\1\u0174\1\0\3\u0174\1\u0175\4\347\1\u0174\1\0"+
- "\3\u0174\1\u0175\1\347\1\u0174\1\0\3\u0174\1\u0175\6\347"+
- "\1\u0174\13\347\1\u0174\13\347\1\u0174\4\347\1\u017a\11\347"+
- "\2\u0174\1\347\105\350\1\u017b\1\350\65\0\1\351\56\0"+
- "\1\u0172\53\0\1\u017c\106\0\1\u017d\112\0\4\112\6\0"+
- "\1\112\6\0\4\112\2\u017e\1\0\13\112\1\0\13\112"+
- "\1\0\4\112\1\0\11\112\2\0\1\112\6\0\4\112"+
- "\6\0\1\112\6\0\4\112\1\u017e\1\u017f\1\0\13\112"+
- "\1\0\13\112\1\0\4\112\1\0\11\112\2\0\1\112"+
- "\6\0\4\112\6\0\1\112\6\0\6\112\1\0\13\112"+
- "\1\0\2\112\1\u0180\10\112\1\0\4\112\1\0\6\112"+
- "\1\u0180\2\112\2\0\1\112\12\364\1\365\3\364\1\0"+
- "\70\364\14\367\1\365\1\367\1\0\70\367\1\374\1\0"+
- "\10\374\1\376\2\374\1\u0181\47\374\1\u0181\21\374\1\141"+
- "\2\374\1\375\1\141\1\374\4\141\1\376\1\141\1\374"+
- "\1\141\1\137\1\374\6\141\1\374\60\141\1\u0100\1\0"+
- "\12\u0100\1\376\1\u0182\47\u0100\1\u0182\21\u0100\1\142\2\u0100"+
- "\1\u0101\1\142\1\u0100\4\142\1\u0100\1\142\1\376\1\142"+
- "\1\137\1\u0100\6\142\1\u0100\60\142\12\u0107\1\u0108\3\u0107"+
- "\1\0\70\u0107\14\u010a\1\u0108\1\u010a\1\0\70\u010a\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
- "\13\166\1\0\4\166\1\0\6\166\1\u0183\2\166\2\0"+
- "\1\166\6\0\4\u010e\6\0\1\u010e\6\0\6\u010e\1\0"+
- "\13\u010e\1\0\13\u010e\1\0\4\u010e\1\0\11\u010e\2\0"+
- "\1\u010e\6\0\4\u0110\6\0\1\u0110\6\0\6\u0110\1\0"+
- "\13\u0110\1\0\13\u0110\1\0\4\u0110\1\0\11\u0110\2\0"+
- "\1\u0110\12\u0111\1\u0112\3\u0111\1\0\70\u0111\14\u0114\1\u0112"+
- "\1\u0114\1\0\70\u0114\1\u0184\2\u0185\1\u0186\1\u0184\1\u0185"+
- "\4\u0184\1\u0185\1\u0184\1\u0185\2\u0184\1\u0185\6\u0184\1\u0185"+
- "\56\u0184\1\173\1\u0184\1\u0187\2\u0188\1\u0189\1\u0187\1\u0188"+
- "\4\u0187\1\u0188\1\u0187\1\u0188\2\u0187\1\u0188\6\u0187\1\u0188"+
- "\56\u0187\1\173\1\u0187\36\0\1\u018a\35\0\1\u018a\53\0"+
- "\1\u018b\14\0\1\u018b\73\0\1\u018c\11\0\1\u018c\76\0"+
- "\1\u018d\20\0\1\u018d\113\0\1\u018e\7\0\1\u018e\3\0"+
- "\12\u0120\1\u0121\3\u0120\1\0\70\u0120\1\u0123\1\0\12\u0123"+
- "\1\u0121\1\u018f\47\u0123\1\u018f\22\u0123\1\0\12\u0123\1\u0190"+
- "\1\u018f\47\u0123\1\u018f\21\u0123\14\0\1\u0191\72\0\14\u0123"+
- "\1\u0190\1\u0123\1\0\70\u0123\12\u0130\1\u0131\3\u0130\1\0"+
- "\70\u0130\1\u0133\1\0\12\u0133\1\u0131\1\u0192\47\u0133\1\u0192"+
- "\22\u0133\1\0\12\u0133\1\u0193\1\u0192\47\u0133\1\u0192\21\u0133"+
- "\14\0\1\u0194\72\0\14\u0133\1\u0193\1\u0133\1\0\70\u0133"+
- "\2\231\1\0\4\231\1\u0195\11\231\1\u0196\3\231\1\u0197"+
- "\23\231\1\u0198\37\231\1\0\32\231\1\u0199\51\231\12\u013a"+
- "\1\u013b\3\u013a\1\0\70\u013a\1\u013d\1\0\12\u013d\1\u013b"+
- "\1\u019a\47\u013d\1\u019a\22\u013d\1\0\12\u013d\1\u019b\1\u019a"+
- "\47\u013d\1\u019a\21\u013d\14\0\1\u019c\72\0\14\u013d\1\u019b"+
- "\1\u013d\1\0\70\u013d\2\240\1\0\4\240\1\u019d\11\240"+
- "\1\u019e\3\240\1\u019f\23\240\1\u01a0\37\240\1\0\32\240"+
- "\1\u01a1\51\240\22\0\1\u01a2\64\0\16\250\1\0\70\250"+
- "\16\256\1\0\70\256\12\263\1\0\1\263\1\0\1\263"+
- "\1\u01a3\66\263\1\u014e\10\263\1\u01a4\2\263\1\0\1\263"+
- "\1\0\1\u014b\3\263\1\u01a5\3\263\1\u01a6\23\263\1\u01a7"+
- "\33\263\1\0\1\263\12\u01a3\1\0\1\u01a3\1\0\70\u01a3"+
- "\1\0\1\u01a3\12\u014e\1\0\1\u014e\1\0\1\u01a8\67\u014e"+
- "\1\0\1\u014e\7\u014f\1\u01a9\4\u014f\1\u0150\4\u014f\1\u01aa"+
- "\3\u014f\1\u01ab\23\u014f\1\u01ac\51\u014f\1\u0150\20\u014f\1\u01ad"+
- "\51\u014f\7\u0153\1\u01ae\2\u0153\1\u0154\6\u0153\1\u01af\3\u0153"+
- "\1\u01b0\23\u0153\1\u01b1\47\u0153\1\u0154\22\u0153\1\u01b2\51\u0153"+
- "\12\301\1\0\103\301\1\u01b3\2\301\1\0\6\301\1\u01b4"+
- "\3\301\1\u01b5\23\301\1\u01b6\32\301\1\u0157\1\0\1\301"+
- "\104\u01b7\1\u01b8\2\u01b7\14\305\1\0\101\305\1\u01b9\4\305"+
- "\1\0\4\305\1\u01ba\3\305\1\u01bb\23\305\1\u01bc\32\305"+
- "\1\u015a\1\0\1\305\104\u01bd\1\u01be\2\u01bd\7\310\1\u01bf"+
- "\2\310\1\0\1\310\1\0\4\310\1\u01c0\3\310\1\u01c1"+
- "\23\310\1\u01c2\33\310\1\0\1\310\7\u015f\1\u01c3\4\u015f"+
- "\1\u0160\4\u015f\1\u01c4\3\u015f\1\u01c5\23\u015f\1\u01c6\51\u015f"+
- "\1\u0160\20\u015f\1\u01c7\51\u015f\7\u0163\1\u01c8\2\u0163\1\u0164"+
- "\6\u0163\1\u01c9\3\u0163\1\u01ca\23\u0163\1\u01cb\47\u0163\1\u0164"+
- "\22\u0163\1\u01cc\51\u0163\12\326\1\0\103\326\1\u01cd\2\326"+
- "\1\0\6\326\1\u01ce\3\326\1\u01cf\23\326\1\u01d0\32\326"+
- "\1\u0167\1\0\1\326\104\u01d1\1\u01d2\2\u01d1\14\332\1\0"+
- "\101\332\1\u01d3\4\332\1\0\4\332\1\u01d4\3\332\1\u01d5"+
- "\23\332\1\u01d6\32\332\1\u016a\1\0\1\332\104\u01d7\1\u01d8"+
- "\2\u01d7\7\0\1\u01d9\106\0\1\u01da\135\0\1\u01db\50\0"+
- "\1\u0173\1\0\11\u0173\1\0\6\u0173\1\0\64\u0173\1\u0174"+
- "\1\0\11\u0174\1\0\6\u0174\1\0\47\u0174\1\0\15\u0174"+
- "\1\0\3\u0174\1\u0175\5\u0174\1\0\3\u0174\1\u0175\2\u0174"+
- "\1\0\3\u0174\1\u0175\43\u0174\1\u01dc\14\u0174\20\0\1\u0177"+
- "\51\0\1\u01dd\34\0\1\u01de\15\0\3\u01de\2\0\1\u01de"+
- "\11\0\1\u01de\1\0\2\u01de\7\0\1\u01de\2\0\2\u01de"+
- "\6\0\1\u01de\11\0\1\112\1\u01df\2\112\6\0\1\112"+
- "\6\0\6\112\1\0\13\112\1\0\13\112\1\0\4\112"+
- "\1\0\11\112\2\0\1\112\6\0\4\112\6\0\1\112"+
- "\6\0\6\112\1\0\11\112\1\u01e0\1\112\1\0\1\u01e0"+
- "\12\112\1\0\4\112\1\0\11\112\2\0\1\112\12\374"+
- "\1\376\3\374\1\0\70\374\14\u0100\1\376\1\u0100\1\0"+
- "\70\u0100\6\0\3\166\1\u01e1\6\0\1\166\6\0\6\166"+
- "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\11\166"+
- "\2\0\1\166\1\u0184\2\u0185\1\u0186\1\u0184\1\u0185\4\u0184"+
- "\1\u0185\1\u0184\1\u0185\2\u0184\1\u0185\6\u0184\1\u0185\56\u0184"+
- "\1\u01e2\1\u0184\105\u0185\1\u01e3\1\u0185\1\u0187\2\u0188\1\u0189"+
- "\1\u0187\1\u0188\4\u0187\1\u0188\1\u0187\1\u0188\2\u0187\1\u0188"+
- "\6\u0187\1\u0188\56\u0187\1\u01e2\1\u0187\105\u0188\1\u01e4\1\u0188"+
- "\41\0\1\u01e5\14\0\1\u01e5\63\0\2\u01e6\103\0\2\u01e7"+
- "\115\0\1\u01e8\14\0\1\u01e8\63\0\2\u01e9\52\0\14\u0123"+
- "\1\u0121\1\u0123\1\0\70\u0123\3\0\2\u01ea\1\0\4\u01ea"+
- "\2\0\1\u0125\1\u01ea\1\0\4\u01ea\1\0\11\u01ea\1\0"+
- "\40\u01ea\2\0\4\u01ea\2\0\1\u01ea\14\u0133\1\u0131\1\u0133"+
- "\1\0\70\u0133\3\0\2\u01eb\1\0\4\u01eb\2\0\1\u0135"+
- "\1\u01eb\1\0\4\u01eb\1\0\11\u01eb\1\0\40\u01eb\2\0"+
- "\4\u01eb\2\0\1\u01eb\2\231\1\0\4\231\1\u01ec\101\231"+
- "\1\0\33\231\1\u01ed\50\231\14\u013d\1\u013b\1\u013d\1\0"+
- "\70\u013d\3\0\2\u01ee\1\0\4\u01ee\2\0\1\u013f\1\u01ee"+
- "\1\0\4\u01ee\1\0\11\u01ee\1\0\40\u01ee\2\0\4\u01ee"+
- "\2\0\1\u01ee\2\240\1\0\4\240\1\u01ef\101\240\1\0"+
- "\33\240\1\u01f0\50\240\2\0\1\u01f1\104\0\7\263\1\u01f2"+
- "\2\263\1\0\1\263\1\0\1\u014b\67\263\1\0\1\263"+
- "\12\u014e\1\0\1\u014e\1\0\1\u014e\1\0\70\u014e\7\u014f"+
- "\1\u01f3\4\u014f\1\u0150\106\u014f\1\u0150\21\u014f\1\u01f4\50\u014f"+
- "\7\u0153\1\u01f5\2\u0153\1\u0154\106\u0153\1\u0154\23\u0153\1\u01f6"+
- "\50\u0153\7\301\1\u01f7\2\301\1\0\71\301\1\u0157\1\0"+
- "\1\301\12\u01f8\1\u01f9\72\u01f8\1\0\1\u01f8\7\305\1\u01fa"+
- "\4\305\1\0\67\305\1\u015a\1\0\1\305\14\u01fb\1\u01f9"+
- "\70\u01fb\1\0\1\u01fb\7\310\1\u01fc\2\310\1\0\1\310"+
- "\1\0\70\310\1\0\1\310\7\u015f\1\u01fd\4\u015f\1\u0160"+
- "\106\u015f\1\u0160\21\u015f\1\u01fe\50\u015f\7\u0163\1\u01ff\2\u0163"+
- "\1\u0164\106\u0163\1\u0164\23\u0163\1\u0200\50\u0163\7\326\1\u0201"+
- "\2\326\1\0\71\326\1\u0167\1\0\1\326\12\u0202\1\u0203"+
- "\72\u0202\1\0\1\u0202\7\332\1\u0204\4\332\1\0\67\332"+
- "\1\u016a\1\0\1\332\14\u0205\1\u0203\70\u0205\1\0\1\u0205"+
- "\37\0\1\u0206\141\0\1\u01dc\34\0\1\u01de\15\0\3\u01de"+
- "\2\0\1\u01de\11\0\1\u01de\1\0\2\u01de\7\0\1\u01de"+
- "\1\0\1\u01dd\2\u01de\6\0\1\u01de\11\0\4\112\6\0"+
- "\1\112\6\0\6\112\1\0\7\112\1\u0207\3\112\1\0"+
- "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
- "\4\112\6\0\1\112\6\0\6\112\1\0\6\112\1\u0208"+
- "\4\112\1\0\13\112\1\0\1\112\1\u0208\2\112\1\0"+
- "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\6\166\1\u0209\4\166\1\0\6\166\1\u020a"+
- "\4\166\1\0\4\166\1\0\11\166\2\0\1\166\53\0"+
- "\1\u020b\5\0\1\u020b\73\0\1\u020c\14\0\1\u020c\66\0"+
- "\1\u020d\11\0\1\u020d\74\0\1\u020e\11\0\1\u020e\77\0"+
- "\1\u020f\14\0\1\u020f\23\0\2\231\1\0\34\231\1\u0210"+
- "\47\231\2\240\1\0\34\240\1\u0211\47\240\14\u014f\1\u0150"+
- "\22\u014f\1\u0212\47\u014f\12\u0153\1\u0154\24\u0153\1\u0213\47\u0153"+
- "\12\u01f8\1\u01b7\71\u01f8\1\u0214\1\u01b7\1\u01f8\14\u01fb\1\u01bd"+
- "\67\u01fb\1\u0215\1\u01bd\1\u01fb\14\u015f\1\u0160\22\u015f\1\u0216"+
- "\47\u015f\12\u0163\1\u0164\24\u0163\1\u0217\47\u0163\12\u0202\1\u01d1"+
- "\71\u0202\1\u0218\1\u01d1\1\u0202\14\u0205\1\u01d7\67\u0205\1\u0219"+
- "\1\u01d7\1\u0205\40\0\1\u021a\54\0\4\112\6\0\1\112"+
- "\6\0\6\112\1\0\13\112\1\0\4\112\1\u021b\6\112"+
- "\1\0\4\112\1\0\11\112\2\0\1\112\6\0\4\112"+
- "\6\0\1\112\6\0\6\112\1\0\3\112\1\u021c\7\112"+
- "\1\0\4\112\1\u021c\6\112\1\0\4\112\1\0\11\112"+
- "\2\0\1\112\6\0\4\166\6\0\1\166\6\0\6\166"+
- "\1\0\11\166\1\u021d\1\166\1\0\13\166\1\0\4\166"+
- "\1\0\11\166\2\0\1\166\6\0\4\166\6\0\1\166"+
- "\6\0\6\166\1\0\10\166\1\u021e\2\166\1\0\13\166"+
- "\1\0\4\166\1\0\11\166\2\0\1\166\54\0\1\u021f"+
- "\24\0\1\u021f\52\0\1\u0220\20\0\1\u0220\70\0\1\u0221"+
- "\13\0\1\u0221\53\0\2\u0222\112\0\1\u0223\35\0\1\u0223"+
- "\12\0\2\231\1\0\35\231\1\u0224\46\231\2\240\1\0"+
- "\35\240\1\u0225\46\240\14\u014f\1\u0150\23\u014f\1\u0226\46\u014f"+
- "\12\u0153\1\u0154\25\u0153\1\u0227\46\u0153\12\u01f8\1\u0228\71\u01f8"+
- "\1\u0214\1\u01b7\1\u01f8\14\u01fb\1\u0229\67\u01fb\1\u0215\1\u01bd"+
- "\1\u01fb\14\u015f\1\u0160\23\u015f\1\u022a\46\u015f\12\u0163\1\u0164"+
- "\25\u0163\1\u022b\46\u0163\12\u0202\1\u022c\71\u0202\1\u0218\1\u01d1"+
- "\1\u0202\14\u0205\1\u022d\67\u0205\1\u0219\1\u01d7\1\u0205\41\0"+
- "\1\u022e\53\0\4\112\6\0\1\112\6\0\6\112\1\0"+
- "\13\112\1\0\7\112\1\u022f\3\112\1\0\4\112\1\0"+
- "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\11\166\1\u0230\1\166\1\0\13\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\6\166\1\u0231\4\166\1\0"+
- "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\43\0"+
- "\1\u0232\11\0\1\u0232\72\0\1\u0233\14\0\1\u0233\71\0"+
- "\1\u0234\14\0\1\u0234\30\0\2\231\1\0\36\231\1\u0235"+
- "\45\231\2\240\1\0\36\240\1\u0236\45\240\14\u014f\1\u0150"+
- "\24\u014f\1\u0237\45\u014f\12\u0153\1\u0154\26\u0153\1\u0238\45\u0153"+
- "\14\u015f\1\u0160\24\u015f\1\u0239\45\u015f\12\u0163\1\u0164\26\u0163"+
- "\1\u023a\45\u0163\40\0\1\u023b\54\0\4\112\6\0\1\112"+
- "\6\0\5\112\1\u023c\1\0\13\112\1\0\13\112\1\0"+
- "\4\112\1\0\11\112\2\0\1\112\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u023d"+
- "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\5\166\1\u023e"+
- "\5\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\2\231\1\0\35\231\1\u023f\46\231\2\240\1\0"+
- "\35\240\1\u0240\46\240\14\u014f\1\u0150\23\u014f\1\u0241\46\u014f"+
- "\12\u0153\1\u0154\25\u0153\1\u0242\46\u0153\14\u015f\1\u0160\23\u015f"+
- "\1\u0243\46\u015f\12\u0163\1\u0164\25\u0163\1\u0244\46\u0163\35\0"+
- "\1\u0245\57\0\4\112\6\0\1\112\6\0\6\112\1\0"+
- "\5\112\1\u0246\5\112\1\0\13\112\1\0\4\112\1\0"+
- "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
- "\1\166\1\u0247\7\166\2\0\1\166\2\231\1\0\32\231"+
- "\1\u0248\51\231\2\240\1\0\32\240\1\u0249\51\240\14\u014f"+
- "\1\u0150\20\u014f\1\u024a\51\u014f\12\u0153\1\u0154\22\u0153\1\u024b"+
- "\51\u0153\14\u015f\1\u0160\20\u015f\1\u024c\51\u015f\12\u0163\1\u0164"+
- "\22\u0163\1\u024d\51\u0163\6\0\4\112\6\0\1\112\6\0"+
- "\6\112\1\0\7\112\1\u024e\3\112\1\0\13\112\1\0"+
- "\4\112\1\0\11\112\2\0\1\112\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u024f"+
- "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
- "\4\112\6\0\1\112\6\0\6\112\1\0\13\112\1\0"+
- "\13\112\1\0\4\112\1\0\11\112\2\0\1\u0250\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\10\166\1\u0251"+
- "\2\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\6\0\4\112\6\0\1\112\6\0\6\112\1\0"+
- "\5\112\1\u0252\5\112\1\0\13\112\1\0\4\112\1\0"+
- "\11\112\2\0\1\112\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\4\166\1\u0253\6\166\1\0\13\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\112\6\0"+
- "\1\112\6\0\6\112\1\0\5\112\1\u0254\5\112\1\0"+
- "\13\112\1\0\4\112\1\0\11\112\2\0\1\112\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\5\166\1\u0255"+
- "\5\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\6\0\4\112\6\0\1\112\6\0\6\112\1\0"+
- "\13\112\1\0\4\112\1\u0256\6\112\1\0\4\112\1\0"+
- "\11\112\2\0\1\112\6\u0257\4\u0258\6\u0257\1\u0258\5\u0257"+
- "\1\0\6\u0258\1\u0257\13\u0258\1\u0257\13\u0258\1\u0257\4\u0258"+
- "\1\u0257\11\u0258\2\u0257\1\u0258\42\0\1\u0259\3\0\1\u025a"+
- "\7\0\1\u025b\1\u025c\21\0\1\u025d\13\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\4\166\1\u025e\3\166\1\u025f"+
- "\2\166\1\0\4\166\1\u0260\1\u0261\5\166\1\0\4\166"+
- "\1\0\6\166\1\u0262\2\166\2\0\1\166\57\0\1\u0263"+
- "\77\0\1\u0264\115\0\1\u0265\105\0\1\u0266\107\0\1\u0267"+
- "\35\0\4\166\6\0\1\166\6\0\6\166\1\0\13\166"+
- "\1\0\5\166\1\u0268\5\166\1\0\4\166\1\0\11\166"+
- "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\6\166"+
- "\1\0\12\166\1\u0269\1\0\13\166\1\0\4\166\1\0"+
- "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\13\166\1\0\5\166\1\u026a\5\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u026b"+
- "\6\166\1\0\4\166\1\0\11\166\2\0\1\166\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
- "\5\166\1\u026c\5\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\44\0\1\u026d\136\0\1\u026e\107\0\1\u026f\67\0"+
- "\1\u0270\125\0\1\u0271\17\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\6\166\1\u0272\4\166\1\0\13\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\13\166\1\0\13\166\1\0"+
- "\4\166\1\0\1\166\1\u0273\7\166\2\0\1\166\6\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
- "\13\166\1\0\4\166\1\0\2\166\1\u0274\6\166\2\0"+
- "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
- "\13\166\1\0\4\166\1\u0275\6\166\1\0\4\166\1\0"+
- "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
- "\2\166\1\u0276\6\166\2\0\1\166\46\0\1\u0277\74\0"+
- "\1\u0278\106\0\1\u0279\116\0\1\u027a\105\0\1\u027b\51\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\10\166\1\u027c"+
- "\2\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\6\0\4\166\6\0\1\166\6\0\5\166\1\u027d"+
- "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\11\166"+
- "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\5\166"+
- "\1\u027e\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
- "\11\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\6\166\1\u027f\4\166\1\0\13\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\5\166\1\u0280\5\166\1\0"+
- "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\57\0"+
- "\1\u0281\131\0\1\u0282\52\0\1\u0283\106\0\1\u0284\46\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
- "\5\166\1\u0285\5\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
- "\13\166\1\0\13\166\1\0\4\166\1\0\7\166\1\u0286"+
- "\1\166\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\10\166\1\u0287\2\166\1\0\13\166\1\0"+
- "\4\166\1\0\11\166\2\0\1\166\6\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\10\166\1\u0288\2\166\1\0"+
- "\13\166\1\0\4\166\1\0\11\166\2\0\1\166\103\0"+
- "\1\u0289\63\0\1\u0271\131\0\1\u027b\106\0\1\u028a\11\0"+
- "\4\166\6\0\1\166\6\0\6\166\1\0\13\166\1\0"+
- "\13\166\1\0\4\166\1\0\10\166\1\u028b\2\0\1\166"+
- "\6\0\4\166\6\0\1\166\6\0\6\166\1\0\13\166"+
- "\1\0\6\166\1\u0276\4\166\1\0\4\166\1\0\11\166"+
- "\2\0\1\166\6\0\4\166\6\0\1\166\6\0\6\166"+
- "\1\0\13\166\1\0\13\166\1\0\4\166\1\0\10\166"+
- "\1\u0280\2\0\1\166\6\0\4\166\6\0\1\166\6\0"+
- "\6\166\1\0\13\166\1\0\13\166\1\0\4\166\1\0"+
- "\10\166\1\u028c\2\0\1\166\34\0\1\u0271\154\0\1\u028d"+
- "\12\0\4\166\6\0\1\166\6\0\5\166\1\u0276\1\0"+
- "\13\166\1\0\13\166\1\0\4\166\1\0\11\166\2\0"+
- "\1\166\6\0\4\166\6\0\1\166\6\0\6\166\1\0"+
- "\13\166\1\0\13\166\1\0\4\166\1\0\7\166\1\u028e"+
- "\1\166\2\0\1\166\56\0\1\u0271\36\0\4\166\6\0"+
- "\1\166\6\0\6\166\1\0\13\166\1\0\4\166\1\u0276"+
- "\6\166\1\0\4\166\1\0\11\166\2\0\1\166";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans [] = yy_unpack(yy_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- // final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {
- 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 9, 1,
- 9, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1,
- 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 9, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1,
- 1, 9, 9, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 9,
- 1, 1, 1, 1, 9, 9, 1, 9, 3, 3, 3, 3, 3, 3, 9, 9,
- 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 9, 1, 9, 3, 3, 3,
- 3, 3, 3, 9, 9, 1, 1, 1, 9, 1, 1, 1, 9, 9, 1, 1,
- 0, 1, 0, 9, 1, 2, 1, 2, 1, 0, 0, 0, 9, 1, 1, 1,
- 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 0,
- 0, 1, 9, 0, 9, 0, 0, 9, 0, 0, 0, 9, 1, 1, 0, 1,
- 0, 9, 0, 0, 0, 1, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 9, 0, 0, 0, 1, 0, 0, 1, 0, 0, 9, 0, 0, 1, 0, 0,
- 9, 0, 0, 0, 1, 0, 1, 1, 0, 0, 9, 0, 0, 0, 1, 0,
- 1, 1, 0, 0, 9, 9, 9, 0, 9, 9, 1, 1, 1, 1, 2, 13,
- 3, 2, 2, 13, 3, 2, 0, 1, 1, 0, 1, 1, 1, 1, 2, 13,
- 3, 2, 2, 13, 3, 2, 0, 1, 1, 0, 1, 1, 0, 9, 9, 9,
- 0, 0, 1, 1, 1, 9, 0, 0, 13, 9, 13, 9, 9, 1, 1, 1,
- 0, 0, 1, 3, 2, 2, 3, 2, 2, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 0, 2, 3, 3, 3, 2, 2, 3, 3,
- 3, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,
- 1, 1, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 1, 1, 1, 1,
- 0, 0, 1, 1, 1, 1, 0, 0, 9, 9, 0, 1, 9, 0, 1, 1,
- 1, 5, 13, 13, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1,
- 9, 1, 3, 2, 3, 2, 1, 0, 9, 1, 0, 1, 3, 2, 3, 2,
- 1, 0, 9, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1,
- 1, 2, 2, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 0, 0,
- 0, 9, 9, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 0, 1, 1,
- 1, 9, 9, 9, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 9, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0,
- 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- // private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- // private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private ContextRegionContainer fBufferedEmbeddedContainer = null;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
- // a "hint" as to what an embedded region should be evaluated
- private String fEmbeddedHint = UNDEFINED;
- // a "hint" as to what state to enter once an embedded region has
- // been completed
- private int fEmbeddedPostState = YYINITIAL;
- // the container used to create embedded regions
- private ContextRegionContainer fEmbeddedContainer = null;
- private static final String PROXY_CONTEXT = "PROXY_CONTEXT";
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the name of the current tag inside of an embedded region
- private String internalTagName = null;
- private String internalContext = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList(0);
- private List fNestablePrefixes = new ArrayList(1);
-
- // where the last internal container block was found
- private int fLastInternalBlockStart = -1;
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private static final boolean fForbidJSP = false;
-
- private int fELlevel = 0;
-
- private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
-
- /**
- * user method
- */
- public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
- }
- /**
- * user method
- */
- public final void addNestablePrefix(TagMarker marker) {
- fNestablePrefixes.add(marker);
- }
- /* user method */
- public List getNestablePrefixes() {
- return fNestablePrefixes;
- }
- /**
- * user method
- */
- private boolean isNestable(String tagName) {
- //Iterator blocks = fNestablePrefixes.iterator();
- //while(blocks.hasNext()) {
- // TagMarker marker = (TagMarker)blocks.next();
- // String markerName = marker.getTagName();
- // if(tagName.length() > markerName.length() + 1 && tagName.startsWith(markerName) && tagName.charAt(markerName.length()) == ':') {
- // return marker.isGlobal() || getOffset() >= marker.getMarker().getStart();
- // }
- //}
- //return false;
- return true;
- }
- /**
- * user method
- */
- public final void removeNestablePrefix(String name) {
- if (fNestablePrefixes != null) {
- Iterator nestables = fNestablePrefixes.iterator();
- while (nestables.hasNext()) {
- if (((TagMarker) nestables.next()).getTagName().equalsIgnoreCase(name))
- nestables.remove();
- }
- }
- }
- /**
- * user method
- */
- public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
- }
- /**
- * user method
- */
- public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
- }
- /* user method */
- private final void assembleEmbeddedTagSequence(String startType, String endTagName) {
- assembleEmbeddedContainer(startType, null, endTagName);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String[] endTypes) {
- assembleEmbeddedContainer(startType, endTypes, null);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String endType) {
- assembleEmbeddedContainer(startType, new String[]{endType}, null);
- }
- /**
- * user method
- *
- * Assembles an embedded container beginning with the given startType as
- * the first ContextRegion within it and of the type fEmbeddedHint. The
- * endTypes[] array contains the context types that will cause a successful
- * exit. Use of the endTagName parameter alters this behavior to force an
- * exit on an XML_TAG_CLOSE after seeing an XML_TAG_NAME whose significant
- * text matches the endTagName String. All contents in between are
- * insignificant, and yes, this means comments are allowed inside.
- **/
- private final void assembleEmbeddedContainer(String startType, String[] endTypes, String endTagName) {
- // the context of the region being added to the embedded container
- internalContext = startType;
- // keep track of where this container began; to provide relative indeces for the regions
- int containerStart = yychar;
- boolean notFinished = true;
- // keep track of where we seem to be so that the endTagName can be checked
- boolean isInEndTag = false;
- boolean isInFirstTag = true;
- // create the embedded container and setup its "type"
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(fEmbeddedHint);
- fEmbeddedContainer.setStart(containerStart);
- // TODO: parent region needs to be set .... but not sure where to get it from
- // fEmbeddedContainer.setParent(parentRegion);
- }
- containerStart = fEmbeddedContainer.getStart();
- while (notFinished) {
- // add the region to the container
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- }
- try {
- // longscan determines whether to attempt a blockTagScan within the embedded container
- boolean longscan = false;
- // save the tokenizer state in case of a block tag scan
- int previousState = yystate();
- String previousCurrentTagName = fCurrentTagName;
- int previousPostState = fEmbeddedPostState;
- String previousEmbeddedHint = fEmbeddedHint;
- // determine if a block tag scan is necessary
- if (internalContext == XML_TAG_NAME) {
- internalTagName = yytext();
- if(!isNestable(internalTagName)) {
- internalTagName = null;
- // snagged a tag name we shouldn't have
- fEmbeddedPostState = ST_ABORT_EMBEDDED;
- notFinished = false;
- }
- }
- else if (internalContext == XML_TAG_OPEN || internalContext == XML_END_TAG_OPEN) {
- internalTagName = null;
- }
- // do upkeep for endTagName usage; must be here since the next token could be the close
- if (internalContext == XML_END_TAG_OPEN) {
- isInEndTag = true;
- } else if (internalContext == XML_TAG_CLOSE) {
- isInFirstTag = isInEndTag = false;
- } else {
- ITextRegionList embeddedRegions = fEmbeddedContainer.getRegions();
- if (embeddedRegions.size() > 2 && (embeddedRegions.get(embeddedRegions.size()-1)).getType() == XML_TAG_CLOSE && (embeddedRegions.get(embeddedRegions.size() - 3)).getType() == XML_TAG_OPEN && internalTagName != null) {
- if (containsTagName(internalTagName)) {
- longscan = true;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- }
- }
- if (longscan)
- fCurrentTagName = internalTagName;
- // read the next region and context
- internalContext = primGetNextToken();
- if (longscan) {
- // Returning from a block tag scan requires restoring some state variables
- // as well as handling the block region and setting up for normal scanning
- // inside the embedded container
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- // newToken.setParent(fEmbeddedContainer);
- longscan = false;
- fEmbeddedPostState = previousPostState;
- fEmbeddedHint = previousEmbeddedHint;
- fCurrentTagName = previousCurrentTagName;
- yybegin(previousState);
- internalContext = primGetNextToken();
- }
- } catch (IOException e) {
- // primGetNextToken() calls may throw an IOException
- // catch and do nothing since the isEOF check below
- // will properly exit if the input was too short
- } catch (Exception f) {
- // some other exception happened; never should
- Logger.logException(f);
- }
- boolean isEndingType = yystate() == ST_ABORT_EMBEDDED;
- if(!isEndingType) {
- // check for ending context
- if (endTagName == null) {
- for (int i = 0; i < endTypes.length; i++) {
- isEndingType = isEndingType || (internalContext == endTypes[i]);
- }
- }
- else {
- isEndingType = ((isInEndTag && internalContext == XML_TAG_CLOSE) || (isInFirstTag && internalContext == XML_EMPTY_TAG_CLOSE)) && internalTagName != null && internalTagName.equals(endTagName);
- }
- }
- ITextRegionList embeddedList = fEmbeddedContainer.getRegions();
- notFinished = notFinished && ((!isEndingType) && !isEOF() && (endTagName != null || internalContext != UNDEFINED) && !(internalContext == PROXY_CONTEXT && (embeddedList.get(embeddedList.size()-1)).getType() == UNDEFINED));
- }
- // finish adding the last context
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- fEmbeddedContainer.setLength(yychar - containerStart + yylength());
- fEmbeddedContainer.setTextLength(yychar - containerStart + yylength());
- }
- yybegin(fEmbeddedPostState);
- }
- /* user method */
- public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
- }
- /* user method */
- public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP() {
- return getBlockMarkerAllowsJSP(fCurrentTagName);
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return marker.allowsJSP();
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return marker.allowsJSP();
- }
- return true;
- }
- /* user method */
- public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
- }
- public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
- }
- /* user method */
- public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
- }
- /* user method */
- public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
- }
- /* user method */
- public List getBlockMarkers() {
- return fBlockMarkers;
- }
- /* user method */
- public final int getOffset() {
- return fOffset + yychar;
- }
- private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
- }
- private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
- }
- /**
- * user method
- */
- public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
- }
- /**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
- public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
- }
-
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param allowJSP - check for and allow for JSP markup <%%>
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- // Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE
- boolean checkJSPs = allowJSP && !fForbidJSP;
- boolean checkedForJSPsOnce = !checkJSPs;
- boolean checkedJSPsAtStartOnce = false;
-
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
-// c = (char) n;
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF && checkedForJSPsOnce) {
- stillSearching = false;
- }
- else {
- /**
- * Look for starting JSPs "<%"
- */
- checkedForJSPsOnce = true;
- // 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs
- // ---
- // Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedJSPsAtStartOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
-
-
- /**
- * Look for starting CDATA "<![CDATA["
- */
- // 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA
- // ---
- // Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
-/* if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- // go to a state where CDATA can be found
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(searchContext);
- fEmbeddedContainer.setStart(yychar);
- }
- ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- yybegin(YYINITIAL);
- String context = primGetNextToken();
- if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
- assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);
- }
- yybegin(resumeState);
- return searchContext;
- }
-*//*
- // 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedForCDATAOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
-*/
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // safety check for array accesses
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength; i++) {
- if(same && fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else if(same && !fIsCaseSensitiveBlocking)
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerAllowsJSP(), true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
- /**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
- public final ITextRegion getNextToken() throws IOException {
- fEmbeddedContainer = null;
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- if (fBufferedEmbeddedContainer != null) {
- ITextRegion container = fBufferedEmbeddedContainer;
- fBufferedEmbeddedContainer = null;
- fShouldLoadBuffered = false;
- return container;
- }
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- } else {
- context = primGetNextToken();
- if (context == PROXY_CONTEXT) {
- return fEmbeddedContainer;
- } else if (context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == PROXY_CONTEXT) {
- fBufferedEmbeddedContainer = fEmbeddedContainer;
- fShouldLoadBuffered = true;
- } else if (f_context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
- }
- /* user method */
- public JSPTokenizer(){
- super();
- }
- /* user method */
- public JSPTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
- }
- /* user method */
- public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
- }
- /* user method */
- public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
- }
- /* user method */
- public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
- }
- /* user method */
- public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
- }
- /* user method */
- public void reset(java.io.Reader in) {
- reset(in, 0);
- }
- /**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
- public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- fLastInternalBlockStart = -1;
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-
- fEmbeddedContainer = null;
-
- fELlevel = 0;
- }
- /**
- * user method
- *
- */
- public BlockTokenizer newInstance() {
- JSPTokenizer newInstance = new JSPTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- for(int i = 0; i < fNestablePrefixes.size(); i++) {
- TagMarker marker = (TagMarker) fNestablePrefixes.get(i);
- if(marker.isGlobal())
- newInstance.addNestablePrefix(marker);
- }
- return newInstance;
- }
- /* user method */
- private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
- }
- /* user method */
- private final String scanJSPCommentText() throws IOException {
- // Scan for '--%>' and return the text up to that point as
- // JSP_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_JSP_COMMENT_END state and return the next
- // context as usual.
- return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);
- }
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public JSPTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public JSPTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed the packed transition table
- * @return the unpacked transition table
- */
- private static int [] yy_unpack(String packed) {
- int [] trans = new int[31595];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 8206) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do trans[j++] = value; while (--count > 0);
- }
- return trans;
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 1376) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
- /**
- * user method - skeleton.sed
- */
- protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
- for(int j = 0; j < fBlockMarkers.size(); j++) {
- BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
- if(marker.getTagName().length() == tagnameLength) {
- boolean matchesSoFar = true;
- for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().charAt(i) != markerTagName[i + offset])
- matchesSoFar = false;
- }
- else {
- if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
- matchesSoFar = false;
- }
- }
- if(matchesSoFar)
- return true;
- }
- }
- return false;
- }
-
- /**
- * user method - skeleton.sed
- *
- * Return ALL of the regions scannable within the remaining text
- * Note: for verification use
- */
- public final List getRegions() {
- List tokens = new ArrayList();
- ITextRegion region = null;
- try {
- region = getNextToken();
- while(region != null) {
- if (region != null) {
- tokens.add(region);
- }
- region = getNextToken();
- }
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- // Since this is convenience method and NOT the recommended
- // way of getting tokens, many errors are simply hidden
- Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
- }
- return tokens;
- }
- /**
- * user method - skeleton.sed
- */
- private final void dump(String s) {
- if (Debug.debugTokenizer) {
- System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
- (yylength() + yychar) + "):\'" +//$NON-NLS-1$
- StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
- }
- }
- /* user method - skeleton.sed */
- public final boolean isEOF() {
- return yy_atEOF;
- }
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
- Iterator blocks = fBlockMarkers.iterator();
- while(blocks.hasNext()) {
- BlockMarker marker = (BlockMarker)blocks.next();
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().equals(markerTagName))
- return true;
- }
- else {
- if(marker.getTagName().equalsIgnoreCase(markerTagName))
- return true;
- }
- }
- return false;
-}
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- // do nothing, this is the downstream parser's job
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
- yy_pushbackPos = -1;
- boolean yy_was_pushback;
-
- while (true) {
-
- yychar+= yylength();
-
- boolean yy_counted = false;
- for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos;
- yy_currentPos++) {
- switch (yy_buffer[yy_currentPos]) {
- case '\r':
- yyline++;
- yy_counted = true;
- break;
- case '\n':
- if (yy_counted)
- yy_counted = false;
- else {
- yyline++;
- }
- break;
- default:
- yy_counted = false;
- }
- }
-
- if (yy_counted) {
- if ( yy_advance() == '\n' ) yyline--;
- if ( !yy_atEOF ) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- yy_state = yy_lexical_state;
-
- yy_was_pushback = false;
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
- if (yy_next == -1) break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = YY_ATTRIBUTE[yy_state];
- if ( (yy_attributes & 2) > 0 )
- yy_pushbackPos = yy_currentPos;
-
- if ( (yy_attributes & 1) > 0 ) {
- yy_was_pushback = (yy_attributes & 4) > 0;
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( (yy_attributes & 8) > 0 ) break yy_forAction;
- }
-
- }
- }
-
- if (yy_was_pushback)
- yy_markedPos = yy_pushbackPos;
-
- switch (yy_action) {
-
- case 622:
- case 627:
- case 634:
- case 639:
- {
- if(Debug.debugTokenizer)
- dump("jsp directive tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_DIRECTIVE_NAME;
- }
- case 655: break;
- case 597:
- {
- if(Debug.debugTokenizer)
- dump("XSL processing instruction target");//$NON-NLS-1$
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 656: break;
- case 580:
- case 583:
- case 584:
- case 585:
- case 586:
- case 587:
- case 588:
- {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
- }
- case 657: break;
- case 572:
- {
- if(Debug.debugTokenizer)
- dump("jsp:root tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_ROOT_TAG_NAME;
- }
- case 658: break;
- case 563:
- {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
- }
- case 659: break;
- case 562:
- {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
- }
- case 660: break;
- case 561:
- {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
- }
- case 661: break;
- case 546:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
- case 662: break;
- case 545:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
- case 663: break;
- case 539:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 664: break;
- case 514:
- case 555:
- case 556:
- {
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 665: break;
- case 504:
- case 551:
- case 552:
- {
- return JSP_EL_QUOTED_CONTENT;
- }
- case 666: break;
- case 496:
- {
- if(Debug.debugTokenizer)
- dump("\nJSP comment close");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return JSP_COMMENT_CLOSE;
- }
- case 667: break;
- case 483:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("VBL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_VBL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 668: break;
- case 482:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("EL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_EL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 669: break;
- case 476:
- {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
- }
- case 670: break;
- case 473:
- {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- fEmbeddedHint = XML_COMMENT_TEXT;
- fEmbeddedPostState = ST_XML_COMMENT;
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
- }
- case 671: break;
- case 472:
- case 491:
- case 494:
- case 497:
- case 498:
- case 500:
- case 502:
- case 505:
- case 507:
- case 508:
- case 510:
- case 512:
- case 515:
- {
- /* JSP comment begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(3);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(4);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(4);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(4);
- return scanJSPCommentText();
- }
- else if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_JSP_COMMENT);
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
- yybegin(ST_BLOCK_TAG_SCAN);
- return PROXY_CONTEXT;
- }
- // finished sanity checks
- if(yystate()==YYINITIAL) {
- // the simple case, just a regular scriptlet out in content
- if(Debug.debugTokenizer)
- dump("\nJSP comment start");//$NON-NLS-1$
- yybegin(ST_JSP_COMMENT);
- return JSP_COMMENT_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP comment start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_COMMENT);
- // the comment container itself will act as comment text
- fEmbeddedHint = JSP_COMMENT_TEXT;
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- /*
- * required help for successive embedded regions; mark this one as a
- * comment so it will be otherwise ignored but preserved (which is why
- * we can't use white-space)
- */
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 672: break;
- case 381:
- case 382:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 673: break;
- case 380:
- {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
- }
- case 674: break;
- case 379:
- {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
- }
- case 675: break;
- case 378:
- {
- yybegin(ST_JSP_VBL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
- }
- case 676: break;
- case 377:
- {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
- }
- case 677: break;
- case 376:
- {
- yybegin(ST_JSP_EL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
- }
- case 678: break;
- case 373:
- {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
- }
- case 679: break;
- case 367:
- case 407:
- case 415:
- case 422:
- case 427:
- case 432:
- case 437:
- case 443:
- case 449:
- case 453:
- case 458:
- case 463:
- case 469:
- {
- /* JSP expression begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just an expression out in content
- if(Debug.debugTokenizer)
- dump("\nJSP expression start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_EXPRESSION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP expression start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_EXPRESSION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 680: break;
- case 366:
- case 406:
- case 414:
- case 421:
- case 426:
- case 431:
- case 436:
- case 442:
- case 448:
- case 452:
- case 457:
- case 462:
- case 468:
- {
- /* JSP declaration begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a declaration out in content
- if(Debug.debugTokenizer)
- dump("\nJSP declaration start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_DECLARATION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP declaration start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_DECLARATION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 681: break;
- case 365:
- case 405:
- case 413:
- case 420:
- case 425:
- case 430:
- case 435:
- case 441:
- case 447:
- case 451:
- case 456:
- case 461:
- case 467:
- {
- /* JSP directive begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a declaration out in content
- if(Debug.debugTokenizer)
- dump("\nJSP directive start");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME);
- return JSP_DIRECTIVE_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP declaration start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_DIRECTIVE_NAME);
- assembleEmbeddedContainer(JSP_DIRECTIVE_OPEN, new String[]{JSP_DIRECTIVE_CLOSE, JSP_CLOSE});
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 682: break;
- case 355:
- {
- yybegin(ST_JSP_VBL_DQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 683: break;
- case 351:
- {
- yybegin(ST_JSP_VBL_SQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
- }
- case 684: break;
- case 349:
- {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_VBL_OPEN;
- }
- }
- case 685: break;
- case 339:
- {
- yybegin(ST_JSP_EL_DQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
- }
- case 686: break;
- case 335:
- {
- yybegin(ST_JSP_EL_SQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
- }
- case 687: break;
- case 333:
- {
- //System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
- return JSP_EL_CONTENT;
- }
- case 688: break;
- case 332:
- {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_EL_OPEN;
- }
- }
- case 689: break;
- case 329:
- {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 690: break;
- case 328:
- {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 691: break;
- case 326:
- {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 692: break;
- case 325:
- {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
- }
- case 693: break;
- case 324:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - end tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_END_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
- }
- case 694: break;
- case 283:
- case 295:
- case 301:
- {
- return XML_DOCTYPE_INTERNAL_SUBSET;
- }
- case 695: break;
- case 271:
- {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- /*
- * If this tag can not be nested or we're already searching for an
- * attribute name, equals, or value, return immediately.
- */
- if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 696: break;
- case 269:
- {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- /*
- * If this tag can not be nested or we're already searching for an
- * attribute name, equals, or value, return immediately.
- */
- if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_EQUALS);
- return PROXY_CONTEXT;
- }
- case 697: break;
- case 267:
- {
- yybegin(YYINITIAL);
- fEmbeddedHint = UNDEFINED;
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
- return XML_EMPTY_TAG_CLOSE;
- }
- case 698: break;
- case 125:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_DQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_DQUOTE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 699: break;
- case 123:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP tag embedded name start - start tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
- }
- case 700: break;
- case 122:
- case 127:
- case 128:
- case 273:
- case 277:
- case 278:
- case 387:
- case 390:
- case 481:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 701: break;
- case 121:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 702: break;
- case 120:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 703: break;
- case 116:
- case 117:
- case 118:
- case 268:
- case 386:
- case 480:
- case 520:
- case 521:
- case 540:
- case 541:
- case 559:
- case 560:
- case 573:
- case 582:
- case 590:
- case 592:
- case 594:
- case 596:
- case 599:
- case 605:
- case 606:
- case 607:
- case 608:
- case 609:
- case 615:
- case 616:
- case 617:
- case 618:
- case 619:
- case 625:
- case 626:
- case 628:
- case 629:
- case 635:
- case 636:
- case 637:
- case 638:
- case 644:
- case 645:
- case 646:
- case 647:
- case 650:
- case 651:
- case 653:
- {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 704: break;
- case 114:
- {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- if(isBlockMarker()) {
- fEmbeddedHint = getBlockMarkerContext();
- fEmbeddedPostState = ST_BLOCK_TAG_SCAN;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
- return XML_TAG_CLOSE;
- }
- case 705: break;
- case 107:
- case 111:
- case 263:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 706: break;
- case 106:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 707: break;
- case 105:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 708: break;
- case 102:
- {
- if(Debug.debugTokenizer)
- dump("JSP directive name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
- return JSP_DIRECTIVE_NAME;
- }
- case 709: break;
- case 98:
- case 99:
- case 100:
- {
- if(Debug.debugTokenizer)
- dump("JSP code content");//$NON-NLS-1$
- return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
- }
- case 710: break;
- case 94:
- case 96:
- case 97:
- case 253:
- case 254:
- case 257:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 711: break;
- case 93:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 712: break;
- case 92:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 713: break;
- case 90:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 714: break;
- case 84:
- case 86:
- case 244:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 715: break;
- case 83:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 716: break;
- case 49:
- case 199:
- case 200:
- case 203:
- case 213:
- case 214:
- case 217:
- case 218:
- case 360:
- case 363:
- case 446:
- case 460:
- case 466:
- {
- return JSP_VBL_CONTENT;
- }
- case 717: break;
- case 42:
- case 178:
- case 179:
- case 182:
- case 192:
- case 193:
- case 196:
- case 197:
- case 330:
- case 344:
- case 347:
- case 418:
- case 419:
- case 434:
- case 440:
- {
- return JSP_EL_CONTENT;
- }
- case 718: break;
- case 35:
- case 159:
- case 160:
- case 321:
- case 412:
- case 416:
- case 495:
- case 528:
- case 548:
- case 565:
- case 575:
- {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
- }
- case 719: break;
- case 33:
- case 152:
- case 153:
- case 311:
- case 404:
- case 408:
- case 492:
- case 527:
- case 547:
- case 564:
- case 574:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
- }
- case 720: break;
- case 22:
- case 112:
- {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {
- yybegin(ST_ABORT_EMBEDDED);
- yypushback(yylength()-1);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- yybegin(YYINITIAL);
- return XML_CONTENT;
- }
- case 721: break;
- case 18:
- case 104:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return WHITE_SPACE;
- }
- case 722: break;
- case 5:
- case 8:
- case 9:
- case 10:
- case 12:
- case 13:
- case 14:
- case 15:
- case 17:
- case 19:
- case 20:
- case 21:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 34:
- case 40:
- case 41:
- case 72:
- case 169:
- case 174:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 723: break;
- case 0:
- case 56:
- case 59:
- case 61:
- case 225:
- case 227:
- case 228:
- case 230:
- case 232:
- case 370:
- case 371:
- case 372:
- case 475:
- {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
- }
- case 724: break;
- case 57:
- case 101:
- case 113:
- case 119:
- case 129:
- {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- case 725: break;
- case 58:
- case 60:
- case 64:
- case 65:
- case 66:
- case 70:
- case 71:
- case 81:
- case 85:
- case 87:
- case 88:
- case 89:
- case 91:
- case 95:
- case 103:
- case 108:
- case 109:
- case 110:
- case 115:
- case 124:
- case 131:
- case 132:
- case 133:
- case 134:
- case 136:
- case 137:
- case 139:
- case 140:
- case 141:
- case 144:
- case 145:
- case 146:
- case 149:
- case 150:
- case 151:
- case 156:
- case 157:
- case 158:
- case 166:
- case 171:
- case 172:
- case 176:
- case 177:
- case 184:
- case 185:
- case 187:
- case 188:
- case 194:
- case 198:
- case 205:
- case 206:
- case 208:
- case 209:
- case 215:
- case 219:
- {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
- }
- case 726: break;
- case 62:
- case 63:
- {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- String returnedContext = doScan("]]>", false, true, true, XML_CDATA_TEXT, ST_CDATA_END, ST_CDATA_END);//$NON-NLS-1$
- if(returnedContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return returnedContext;
- }
- case 727: break;
- case 67:
- case 186:
- case 189:
- case 207:
- case 210:
- {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 728: break;
- case 68:
- case 69:
- {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
- }
- case 729: break;
- case 73:
- case 74:
- case 75:
- case 76:
- case 237:
- case 238:
- case 239:
- case 383:
- case 478:
- case 479:
- case 518:
- case 519:
- case 538:
- case 558:
- case 571:
- case 581:
- case 589:
- case 591:
- case 593:
- case 595:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_CONTENT;
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
- }
- case 730: break;
- case 77:
- {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
- }
- case 731: break;
- case 78:
- case 79:
- case 80:
- {
- // block scan until close is found
- return doScan("?>", false, false, false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
- case 732: break;
- case 82:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 733: break;
- case 126:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_SQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_SQUOTE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
- }
- case 734: break;
- case 130:
- {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 735: break;
- case 135:
- {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
- }
- case 736: break;
- case 138:
- case 142:
- case 288:
- case 292:
- case 399:
- {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
- case 737: break;
- case 143:
- case 147:
- case 298:
- {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
- case 738: break;
- case 148:
- case 304:
- case 308:
- case 402:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
- }
- case 739: break;
- case 154:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 740: break;
- case 155:
- case 314:
- case 318:
- case 410:
- {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
- }
- case 741: break;
- case 161:
- {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 742: break;
- case 164:
- case 165:
- {
- if(Debug.debugTokenizer)
- dump("\nJSP comment text");//$NON-NLS-1$
- return scanJSPCommentText();
- }
- case 743: break;
- case 167:
- case 173:
- {
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 744: break;
- case 168:
- {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("tag inside of JSP attribute value start");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
- }
- case 745: break;
- case 170:
- {
- return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
- }
- case 746: break;
- case 175:
- {
- return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
- }
- case 747: break;
- case 180:
- {
- yybegin(ST_JSP_EL_DQUOTES);
- return JSP_EL_DQUOTE;
- }
- case 748: break;
- case 181:
- {
- yybegin(ST_JSP_EL_SQUOTES);
- return JSP_EL_SQUOTE;
- }
- case 749: break;
- case 183:
- {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_EL_CLOSE;
- }
- return JSP_EL_CONTENT;
- }
- case 750: break;
- case 190:
- {
- yybegin(ST_JSP_EL);
- return JSP_EL_SQUOTE;
- }
- case 751: break;
- case 191:
- {
- yybegin(ST_JSP_EL);
- return JSP_EL_DQUOTE;
- }
- case 752: break;
- case 195:
- {
- return JSP_EL_CLOSE;
- }
- case 753: break;
- case 201:
- {
- yybegin(ST_JSP_VBL_DQUOTES);
- return JSP_VBL_DQUOTE;
- }
- case 754: break;
- case 202:
- {
- yybegin(ST_JSP_VBL_SQUOTES);
- return JSP_VBL_SQUOTE;
- }
- case 755: break;
- case 204:
- {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_VBL_CLOSE;
- }
- return JSP_VBL_CONTENT;
- }
- case 756: break;
- case 211:
- {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_SQUOTE;
- }
- case 757: break;
- case 212:
- {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_DQUOTE;
- }
- case 758: break;
- case 216:
- {
- return JSP_VBL_CLOSE;
- }
- case 759: break;
- case 220:
- {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
- }
- case 760: break;
- case 221:
- {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
- }
- case 761: break;
- case 222:
- case 310:
- case 320:
- case 331:
- case 336:
- case 340:
- case 343:
- case 346:
- case 348:
- case 352:
- case 356:
- case 359:
- case 362:
- {
- /* JSP scriptlet begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(1);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(2);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(2);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(2);
- return scanJSPCommentText();
- }
- // finished sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a regular scriptlet out in content
- if(Debug.debugTokenizer)
- dump("\nJSP scriptlet start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_SCRIPTLET_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP scriptlet start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_SCRIPTLET_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
- }
- case 762: break;
- case 223:
- {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
- }
- case 763: break;
- case 236:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 764: break;
- case 240:
- {
- // ended with nothing inside
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 765: break;
- case 241:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 766: break;
- case 258:
- {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_CLOSE;
- }
- case 767: break;
- case 260:
- {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_DIRECTIVE_CLOSE;
- }
- case 768: break;
- case 162:
- case 163:
- {
- return doBlockTagScan();
- }
- case 769: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- return null;
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
deleted file mode 100644
index 0c21b1c977..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ /dev/null
@@ -1,2859 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.core.internal.parser.internal;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contenttype.IntStack;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
-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;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
-
-%%
-
-%{
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private ITextRegion fBufferedEmbeddedContainer = null;
- private ITextRegion fProxyUnknownRegion = null;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
- // a "hint" as to what an embedded region should be evaluated
- private String fEmbeddedHint = UNDEFINED;
- // a "hint" as to what state to enter once an embedded region has
- // been completed
- private int fEmbeddedPostState = YYINITIAL;
-
- // the container used to create embedded regions
- private ContextRegionContainer fEmbeddedContainer = null;
- private static final String PROXY_CONTEXT = "PROXY_CONTEXT";
- private static final String PROXY_UNKNOWN_CONTEXT = "PROXY_UNKNOWN_CONTEXT";
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the name of the current tag inside of an embedded region
- private String internalTagName = null;
- private String internalContext = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList(0);
- private List fNestablePrefixes = new ArrayList(1);
-
- // where the last internal container block was found
- private int fLastInternalBlockStart = -1;
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private static final boolean fForbidJSP = false;
-
- private int fELlevel = 0;
-
- private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
-
- // Is the embedded tag a JSP tag
- private boolean fEmbeddedTag = false;
- // Is the non-embedded tag a JSP tag
- private boolean fContainerTag = false;
- // Is the tokenizer in a non-embedded tag (between < and >)
- private boolean fInTagContainer = false;
- // Is the tokenizer in an embedded tag (between < and >)
- private boolean fInTagEmbedded = false;
-
- /**
- * user method
- */
- public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
- }
- /**
- * user method
- */
- public final void addNestablePrefix(TagMarker marker) {
- fNestablePrefixes.add(marker);
- }
- /* user method */
- public List getNestablePrefixes() {
- return fNestablePrefixes;
- }
- /**
- * user method
- */
- private boolean isNestable(String tagName) {
- //Iterator blocks = fNestablePrefixes.iterator();
- //while(blocks.hasNext()) {
- // TagMarker marker = (TagMarker)blocks.next();
- // String markerName = marker.getTagName();
- // if(tagName.length() > markerName.length() + 1 && tagName.startsWith(markerName) && tagName.charAt(markerName.length()) == ':') {
- // return marker.isGlobal() || getOffset() >= marker.getMarker().getStart();
- // }
- //}
- //return false;
- return true;
- }
- /**
- * user method
- */
- public final void removeNestablePrefix(String name) {
- if (fNestablePrefixes != null) {
- Iterator nestables = fNestablePrefixes.iterator();
- while (nestables.hasNext()) {
- if (((TagMarker) nestables.next()).getTagName().equalsIgnoreCase(name))
- nestables.remove();
- }
- }
- }
- /**
- * user method
- */
- public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
- }
- /**
- * user method
- */
- public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
- }
- /* user method */
- private final void assembleEmbeddedTagSequence(String startType, String endTagName) {
- assembleEmbeddedContainer(startType, null, endTagName);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String[] endTypes) {
- assembleEmbeddedContainer(startType, endTypes, null);
- }
- /* user method */
- private final void assembleEmbeddedContainer(String startType, String endType) {
- assembleEmbeddedContainer(startType, new String[]{endType}, null);
- }
- /**
- * user method
- *
- * Assembles an embedded container beginning with the given startType as
- * the first ContextRegion within it and of the type fEmbeddedHint. The
- * endTypes[] array contains the context types that will cause a successful
- * exit. Use of the endTagName parameter alters this behavior to force an
- * exit on an XML_TAG_CLOSE after seeing an XML_TAG_NAME whose significant
- * text matches the endTagName String. All contents in between are
- * insignificant, and yes, this means comments are allowed inside.
- **/
- private final void assembleEmbeddedContainer(String startType, String[] endTypes, String endTagName) {
- // the context of the region being added to the embedded container
- internalContext = startType;
- // keep track of where this container began; to provide relative indeces for the regions
- int containerStart = yychar;
- boolean notFinished = true;
- // keep track of where we seem to be so that the endTagName can be checked
- boolean isInEndTag = false;
- boolean isInFirstTag = true;
- // create the embedded container and setup its "type"
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(fEmbeddedHint);
- fEmbeddedContainer.setStart(containerStart);
- // TODO: parent region needs to be set .... but not sure where to get it from
- // fEmbeddedContainer.setParent(parentRegion);
- }
- int initialLength = fEmbeddedContainer.getRegions().size();
- containerStart = fEmbeddedContainer.getStart();
- while (notFinished) {
- // add the region to the container
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- }
- try {
- // longscan determines whether to attempt a blockTagScan within the embedded container
- boolean longscan = false;
- // save the tokenizer state in case of a block tag scan
- int previousState = yystate();
- String previousCurrentTagName = fCurrentTagName;
- int previousPostState = fEmbeddedPostState;
- String previousEmbeddedHint = fEmbeddedHint;
- // determine if a block tag scan is necessary
- if (internalContext == XML_TAG_NAME) {
- internalTagName = yytext();
- if (endTagName != null && endTagName.length() == 0){
- endTagName = internalTagName;
- }
- if(!isNestable(internalTagName)) {
- internalTagName = null;
- // snagged a tag name we shouldn't have
- fEmbeddedPostState = ST_ABORT_EMBEDDED;
- notFinished = false;
- }
- }
- else if (internalContext == XML_TAG_OPEN || internalContext == XML_END_TAG_OPEN) {
- internalTagName = null;
- }
- // do upkeep for endTagName usage; must be here since the next token could be the close
- if (internalContext == XML_END_TAG_OPEN) {
- isInEndTag = true;
- } else if (internalContext == XML_TAG_CLOSE) {
- isInFirstTag = isInEndTag = false;
- } else {
- ITextRegionList embeddedRegions = fEmbeddedContainer.getRegions();
- if (embeddedRegions.size() > 2 && (embeddedRegions.get(embeddedRegions.size()-1)).getType() == XML_TAG_CLOSE && (embeddedRegions.get(embeddedRegions.size() - 3)).getType() == XML_TAG_OPEN && internalTagName != null) {
- if (containsTagName(internalTagName)) {
- longscan = true;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- }
- }
- if (longscan)
- fCurrentTagName = internalTagName;
- // read the next region and context
- internalContext = primGetNextToken();
- if (longscan) {
- // Returning from a block tag scan requires restoring some state variables
- // as well as handling the block region and setting up for normal scanning
- // inside the embedded container
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- // DW, 4/16/2003 token regions no longer have parents
- // newToken.setParent(fEmbeddedContainer);
- longscan = false;
- fEmbeddedPostState = previousPostState;
- fEmbeddedHint = previousEmbeddedHint;
- fCurrentTagName = previousCurrentTagName;
- yybegin(previousState);
- internalContext = primGetNextToken();
- }
- } catch (IOException e) {
- // primGetNextToken() calls may throw an IOException
- // catch and do nothing since the isEOF check below
- // will properly exit if the input was too short
- } catch (Exception f) {
- // some other exception happened; never should
- Logger.logException(f);
- }
- boolean isEndingType = yystate() == ST_ABORT_EMBEDDED;
- ITextRegionList embeddedList = fEmbeddedContainer.getRegions();
- if(!isEndingType) {
- // check for ending context
- if (endTagName == null) {
- for (int i = 0; i < endTypes.length; i++) {
- isEndingType = isEndingType || (internalContext == endTypes[i]) || (embeddedList.size() - initialLength) >= 2 && (embeddedList.get(embeddedList.size()-1)).getType() == endTypes[i];
- }
- }
- else {
- isEndingType = ((isInEndTag && internalContext == XML_TAG_CLOSE) || (isInFirstTag && internalContext == XML_EMPTY_TAG_CLOSE)) && internalTagName != null && internalTagName.equals(endTagName);
- }
- }
- notFinished = notFinished && ((!isEndingType) && !isEOF() && (endTagName != null || internalContext != UNDEFINED) && !(internalContext == PROXY_CONTEXT && (embeddedList.get(embeddedList.size()-1)).getType() == UNDEFINED));
- }
- // finish adding the last context
- if (internalContext != null && internalContext != PROXY_CONTEXT) {
- ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- // DW, 4/16/2003 token regions no longer have parents
- //newToken.setParent(fEmbeddedContainer);
- fEmbeddedContainer.setLength(yychar - containerStart + yylength());
- fEmbeddedContainer.setTextLength(yychar - containerStart + yylength());
- }
- yybegin(fEmbeddedPostState);
- }
- /* user method */
- public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
- }
- /* user method */
- public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP() {
- return getBlockMarkerAllowsJSP(fCurrentTagName);
- }
- /* user method */
- public boolean getBlockMarkerAllowsJSP(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return marker.allowsJSP();
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return marker.allowsJSP();
- }
- return true;
- }
- /* user method */
- public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
- }
- public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
- }
- /* user method */
- public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
- }
- /* user method */
- public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
- }
- /* user method */
- public List getBlockMarkers() {
- return fBlockMarkers;
- }
- /* user method */
- public final int getOffset() {
- return fOffset + yychar;
- }
- private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
- }
- private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
- }
- /**
- * user method
- */
- public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
- }
- /**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
- public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
- }
-
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param allowJSP - check for and allow for JSP markup <%%>
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- boolean wasBlockingEnabled = fIsBlockingEnabled;
- try {
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- // Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE
- boolean checkJSPs = allowJSP && !fForbidJSP;
- boolean checkedForJSPsOnce = !checkJSPs;
- boolean checkedJSPsAtStartOnce = false;
-
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
- // c = (char) n;
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF && checkedForJSPsOnce) {
- stillSearching = false;
- }
- else {
- /**
- * Look for starting JSPs "<%"
- */
- checkedForJSPsOnce = true;
- // 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs
- // ---
- // Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedJSPsAtStartOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
-
-
- /**
- * Look for starting CDATA "<![CDATA["
- */
- // 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA
- // ---
- // Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.
- // Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- /* if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
- charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- // go to a state where CDATA can be found
- if (fEmbeddedContainer == null) {
- fEmbeddedContainer = new ContextRegionContainer();
- fEmbeddedContainer.setType(searchContext);
- fEmbeddedContainer.setStart(yychar);
- }
- ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());
- fEmbeddedContainer.getRegions().add(newToken);
- fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
- fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
- yybegin(YYINITIAL);
- String context = primGetNextToken();
- if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
- assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);
- }
- yybegin(resumeState);
- return searchContext;
- }
- *//*
- // 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read
- // ---
- // Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section
- // since it relies upon *having* closeTagStringLength amount of input to work as designed. Must be sure we don't
- // spill over the end of the buffer while checking.
- else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&
- yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {
- fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- // 3) yy_currentPos : Check at the start of the block one time
- // ---
- // Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section
- // since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.
- else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&
- yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {
- checkedForCDATAOnce = true;
- fLastInternalBlockStart = yy_markedPos = yy_startRead;
- yy_currentPos = yy_markedPos + 1;
- int resumeState = yystate();
- yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);
- if(yy_markedPos == yy_startRead) {
- String jspContext = primGetNextToken();
- yybegin(resumeState);
- return jspContext;
- }
- return searchContext;
- }
- */
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // safety check for array accesses
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength && same; i++) {
- if(fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
- }
- finally {
- fIsBlockingEnabled = wasBlockingEnabled;
- }
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerAllowsJSP(), true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
- /**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
- public final ITextRegion getNextToken() throws IOException {
- fEmbeddedContainer = null;
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- if (fBufferedEmbeddedContainer != null) {
- ITextRegion container = fBufferedEmbeddedContainer;
- fBufferedEmbeddedContainer = null;
- fShouldLoadBuffered = false;
- return container;
- }
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- } else {
- context = primGetNextToken();
- if (context == PROXY_CONTEXT) {
- return fEmbeddedContainer;
- } else if (context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == PROXY_CONTEXT) {
- fBufferedEmbeddedContainer = fEmbeddedContainer;
- fShouldLoadBuffered = true;
- } else if (f_context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- } else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- } else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- } else if (f_context == PROXY_UNKNOWN_CONTEXT) {
- fBufferedEmbeddedContainer = fProxyUnknownRegion;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
- }
- /* user method */
- public JSPTokenizer(){
- super();
- }
- /* user method */
- public JSPTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
- }
- /* user method */
- public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
- }
- /* user method */
- public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
- }
- /* user method */
- public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
- }
- /* user method */
- public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
- }
- /* user method */
- public void reset(java.io.Reader in) {
- reset(in, 0);
- }
- /**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
- public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- //yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- fLastInternalBlockStart = -1;
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-
- fEmbeddedContainer = null;
-
- fELlevel = 0;
- }
- /**
- * user method
- *
- */
- public BlockTokenizer newInstance() {
- JSPTokenizer newInstance = new JSPTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- for(int i = 0; i < fNestablePrefixes.size(); i++) {
- TagMarker marker = (TagMarker) fNestablePrefixes.get(i);
- if(marker.isGlobal())
- newInstance.addNestablePrefix(marker);
- }
- return newInstance;
- }
- /* user method */
- private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
- }
- /* user method */
- private final String scanJSPCommentText() throws IOException {
- // Scan for '--%>' and return the text up to that point as
- // JSP_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_JSP_COMMENT_END state and return the next
- // context as usual.
- return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);
- }
-
- /* user method */
- private boolean isJspTag() {
- return (fContainerTag && fEmbeddedContainer != null) || (fContainerTag && fInTagContainer) || (fEmbeddedTag && fInTagEmbedded);
- }
-%}
-
-%eof{
-// do nothing, this is the downstream parser's job
-%eof}
-
-%public
-%class JSPTokenizer
-%implements BlockTokenizer, DOMJSPRegionContexts
-%function primGetNextToken
-%type String
-%char
-%unicode
-%pack
-
-%state ST_CDATA_TEXT
-%state ST_CDATA_END
-%state ST_XML_COMMENT
-%state ST_XML_COMMENT_END
-%state ST_PI
-%state ST_PI_WS
-%state ST_PI_CONTENT
-%state ST_XML_PI_ATTRIBUTE_NAME
-%state ST_XML_PI_EQUALS
-%state ST_XML_PI_ATTRIBUTE_VALUE
-%state ST_XML_PI_TAG_CLOSE
-%state ST_DHTML_ATTRIBUTE_NAME
-%state ST_DHTML_EQUALS
-%state ST_DHTML_ATTRIBUTE_VALUE
-%state ST_DHTML_TAG_CLOSE
-
-// scriptlet state(s)
-%state ST_JSP_CONTENT
-%state ST_JSP_DIRECTIVE_NAME
-%state ST_JSP_DIRECTIVE_NAME_WHITESPACE
-%state ST_JSP_DIRECTIVE_ATTRIBUTE_NAME
-%state ST_JSP_DIRECTIVE_EQUALS
-%state ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE
-
-// normal tag states
-%state ST_XML_TAG_NAME
-%state ST_XML_ATTRIBUTE_NAME
-%state ST_XML_EQUALS
-%state ST_XML_ATTRIBUTE_VALUE
-
-// declaration (DTD) states
-%state ST_XML_DECLARATION
-%state ST_XML_DECLARATION_CLOSE
-
-%state ST_XML_DOCTYPE_DECLARATION
-%state ST_XML_DOCTYPE_EXTERNAL_ID
-%state ST_XML_DOCTYPE_ID_PUBLIC
-%state ST_XML_DOCTYPE_ID_SYSTEM
-
-%state ST_XML_ELEMENT_DECLARATION
-%state ST_XML_ELEMENT_DECLARATION_CONTENT
-
-%state ST_XML_ATTLIST_DECLARATION
-%state ST_XML_ATTLIST_DECLARATION_CONTENT
-
-
-%state ST_BLOCK_TAG_SCAN
-%state ST_BLOCK_TAG_INTERNAL_SCAN
-
-%state ST_JSP_COMMENT
-%state ST_JSP_COMMENT_END
-
-%state ST_JSP_ATTRIBUTE_VALUE
-%state ST_XML_ATTRIBUTE_VALUE_SQUOTED
-%state ST_XML_ATTRIBUTE_VALUE_DQUOTED
-
-%state ST_ABORT_EMBEDDED
-
-%state ST_JSP_EL
-%state ST_JSP_EL_SQUOTES
-%state ST_JSP_EL_DQUOTES
-%state ST_JSP_EL_SQUOTES_END
-%state ST_JSP_EL_DQUOTES_END
-
-%state ST_JSP_DQUOTED_EL
-%state ST_JSP_SQUOTED_EL
-
-%state ST_JSP_VBL
-%state ST_JSP_VBL_SQUOTES
-%state ST_JSP_VBL_DQUOTES
-%state ST_JSP_VBL_SQUOTES_END
-%state ST_JSP_VBL_DQUOTES_END
-
-%state ST_JSP_DQUOTED_VBL
-%state ST_JSP_SQUOTED_VBL
-
-// Letter = ([A-Za-z])
-// Digit = ([0-9])
-
-/**
- * smaller tokens
- */
-genericTagOpen = <
-genericTagClose = >
-genericEndTagOpen = <\/
-genericEmptyTagClose = \/>
-
-PIstart = <\?
-PIend = \?>
-
-
-// [1] document ::= prolog element Misc*
-document = ({prolog} {element} {Misc}*)
-
-// [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //Char = (.)
-Char = [\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]+
-
-// [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
-NameChar = ({Letter} | {Digit} | \. | \- | _ | : | {CombiningChar} | {Extender})
-
-// [5] Name ::= (Letter | '_' | ':') NameChar*
-//Name = ({NameChar}{NameChar}*)
-Name = ({Letter} | _ | :){NameChar}*
-
-// [6] Names ::= {Name} ({S} {Name})*
-Names = ({Name} ({S} {Name})*)
-
-// [7] Nmtoken ::= (NameChar)+
-Nmtoken = ({NameChar}+)
-
-// [8] Nmtokens ::= Nmtoken (S Nmtoken)*
-Nmtokens = ({Nmtoken} ({S} {Nmtoken})*)
-
-// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
-EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" | \' ([^%&\'] | {PEReference} | {Reference})* \')
-
-// \x24 = '$', \x7b = '{', \x23 = '#'
-// [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
-AttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b\x3c"] | \\[\x24\x23][\x7b] | {Reference})* [\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b\x3c'] | \\[\x24\x23][\x7b] | {Reference})*[\x24\x23]*\' | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)
-
-// As Attvalue, but accepts escaped versions of the lead-in quote also
-QuotedAttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | \\[\x24\x23][\x7b] | \\\" | {Reference})*[\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | \\[\x24\x23][\x7b] | \\\' | {Reference})*[\x24\x23]*\' | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)
-
-// [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
-SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \'))
-
-// [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
-PubidLiteral = (\" {PubidChar}* \" | \' ({PubidChar}\')* "'")
-
-// [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
-PubidChar = ([\040\015\012] | [a-zA-Z0-9] | [\-\'()\+,.\/:=?;!\*#@\$_%])
-
-// [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
-// implement lookahead behavior during action definition
-CharData = ([^<&(\]\]>)]*)
-
-// [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
-CommentStart = (<!\-\-)
-CommentEnd = (\-\->)
-Comment = ({CommentStart}.*{CommentEnd})
-
-// [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
-PI = (<\?{PITarget} {Char}* \?>)
-
-// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
-PITarget = ({Name}((X|x)(M|m)(L|l)))
-
-// [18] CDSect ::= CDStart CData CDEnd
-CDSect = ({CDStart}{CData}{CDEnd})
-
-// [19] CDStart ::= '<![CDATA['
-CDStart = <!\[CDATA\[
-
-// [20] CData ::= (Char* - (Char* ']]>' Char*))
-// implement lookahead behavior during action definition
-CData = ([^(\]\]>)]*)
-
-// [21] CDEnd ::= ']]>'
-CDEnd = (\]\]>)
-
-// [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
-prolog = ({XMLDecl}? {Misc}* ({doctypedecl} {Misc}*)?)
-
-// [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
-XMLDecl = (<\?xml {VersionInfo} {EncodingDecl}? {SDDecl}? {S}? \?>)
-
-// [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
-VersionInfo = ({S}version{Eq}(\'{VersionNum}\' | \"{VersionNum}\"))
-
-// [25] Eq ::= S? '=' S?
-Eq = (\=)
-
-// [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
-VersionNum = (([a-zA-Z0-9_.:]|\-)+)
-
-// [27] Misc ::= Comment | PI | S
-Misc = ({Comment} | {PI} | {S})
-
-// [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
-doctypedecl = (<\!DOCTYPE{S}{Name} ({S}{ExternalID})? {S}? (\[ ({markupdecl}|{PEReference}|{S})* \]{S}?)?>)
-
-// [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
-markupdecl = ({elementdecl} | {AttlistDecl} | {EntityDecl} | {NotationDecl} | {PI} | {Comment})
-
-// [30] extSubset ::= TextDecl? extSubsetDecl
-extSubset = ({TextDecl}? {extSubsetDecl})
-
-// [31] extSubsetDecl ::= ( markupdecl | conditionalSect | PEReference | S )*
-extSubsetDecl = (( {markupdecl} | {conditionalSect} | {PEReference} | {S} )*)
-
-// [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
-SDDecl = ({S}standalone{Eq}{S}*((\'(yes|no)\')|(\"(yes|no)\")))
-
-// [33] LanguageID ::= Langcode ('-' Subcode)*
-LanguageID = ({Langcode}(\-{Subcode})*)
-
-// [34] Langcode ::= ISO639Code | IanaCode | UserCode
-Langcode = ({ISO639Code} | {IanaCode} | {UserCode})
-
-// [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
-ISO639Code = (([a-z]|[A-Z])([a-z]|[A-Z]))
-
-// [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
-IanaCode = ((i|I)\-([a-z]|[A-Z])+)
-
-// [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
-UserCode = ((x|X)\-([a-z]|[A-Z])+)
-
-// [38] Subcode ::= ([a-z] | [A-Z])+
-Subcode = (([a-z]|[A-Z])+)
-
-// [39] element ::= EmptyElemTag | STag content ETag
-element = ({EmptyElemTag} | {STag} {content} {ETag})
-
-// [40] STag ::= '<' Name (S Attribute)* S? '>'
-STag = (<{Name}({S}{Attribute})*{S}?>)
-
-// [41] Attribute ::= Name Eq AttValue
-Attribute = ({Name}{S}*{Eq}{S}*{AttValue})
-
-// [42] ETag ::= 'Name S? '>'
-ETag = (<\/{Name}{S}?>)
-
-// [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
-content = (({element} | {CharData} | {Reference} | {CDSect} | {PI} | {Comment})*)
-
-// [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
-EmptyElemTag = (<{Name}({S}{Attribute})*{S}?\/>)
-
-// [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
-elementdecl = (<\!ELEMENT{S}{Name}{S}{contentspec}{S}?>)
-
-// [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
-contentspec = (EMPTY|ANY|{Mixed}|{children})
-
-// [47] children ::= (choice | seq) ('?' | '*' | '+')?
-children = (({choice}|{seq})(\?|\*|\+)?)
-
-// CAUSES LOOP THROUGH DEFS OF CHOICE AND SEQ
-// [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
-cp = (({Name} | {choice} | {seq}) (\?|\*|\+)?)
-
-// [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
-// choice = \({S}?{cp}({S}?\|{S}?{cp})*{S}?\)
-choice = \({S}?{Name}({S}?\|{S}?{Name})*{S}?\)
-
-// [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
-// seq = (\({S}?{cp}({S}?\,{S}?{cp})*{S}?\))
-seq = (\({S}?{Name}({S}?\,{S}?{Name})*{S}?\))
-
-// [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'
-Mixed = ({S}?\#PCDATA({S}?\|{S}?{Name})*{S}?)*\|({S}?\#PCDATA{S}?)
-
-// [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
-AttlistDecl = (<\!ATTLIST{S}{Name}{AttDef}*{S}?>)
-
-// [53] AttDef ::= S Name S AttType S DefaultDecl
-AttDef = ({S}{Name}{S}{AttType}{S}{DefaultDecl})
-
-// [54] AttType ::= StringType | TokenizedType | EnumeratedType
-AttType = ({StringType} | {TokenizedType} | {EnumeratedType})
-
-// [55] StringType ::= 'CDATA'
-StringType = (CDATA)
-
-// [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
-TokenizedType = (ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS)
-
-// [57] EnumeratedType ::= NotationType | Enumeration
-EnumeratedType = ({NotationType} | {Enumeration})
-
-// [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
-NotationType = (NOTATION{S}\({S}?{Name}({S}?\|{S}?{Name})*{S}?\))
-
-// [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
-Enumeration = (\({S}?{Nmtoken}({S}?\|{S}?{Nmtoken})*{S}?\))
-
-// [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
-DefaultDecl = (\#REQUIRED|\#IMPLIED|((\#FIXED{S})?{AttValue}))
-
-// [61] conditionalSect ::= includeSect | ignoreSect
-conditionalSect = ({includeSect} | {ignoreSect})
-
-// [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
-includeSect = (<\!\[{S}?INCLUDE{S}?\[{extSubsetDecl}\]\]>)
-
-// [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
-ignoreSect = (<\!\[{S}?IGNORE{S}?\[{ignoreSectContents}*\]\]>)
-
-// [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
-ignoreSectContents = ({Ignore}(<\!\[{ignoreSectContents}\]\]>{Ignore})*)
-
-// [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
-Ignore = ([^(\<\!\[|\]\]\>)]*)
-
-// [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
-CharRef = (&#[0-9]+;|&#x[0-9a-fA-F]+;)
-
-// [67] Reference ::= EntityRef | CharRef
-Reference = ({EntityRef} | {CharRef})
-
-// [68] EntityRef = '&' Name ';'
-EntityRef = (&{Name};)
-
-// [69] PEReference ::= '%' Name ';'
-PEReference = (%{Name};)
-
-// [70] EntityDecl ::= GEDecl | PEDecl
-EntityDecl = ({GEDecl} | {PEDecl})
-
-// [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
-GEDecl = (<\!ENTITY{S}{Name}{S}{EntityDef}{S}?>)
-
-// [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
-PEDecl = (<\!ENTITY{S}\%{S}{Name}{S}{PEDef}{S}?>)
-
-// [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
-EntityDef = ({EntityValue} | ({ExternalID}{NDataDecl}?))
-
-// [74] PEDef ::= EntityValue | ExternalID
-PEDef = ({EntityValue} | {ExternalID})
-
-// [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
-ExternalID = (SYSTEM{S}{SystemLiteral}|PUBLIC{S}{PubidLiteral}{S}{SystemLiteral} )
-
-// [76] NDataDecl ::= S 'NDATA' S Name
-NDataDecl = ({S}NDATA{S}{Name})
-
-// [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
-TextDecl = (<\?xml{VersionInfo}?{EncodingDecl}{S}?\?>)
-
-// [78] extParsedEnt ::= TextDecl? content
-extParsedEnt = ({TextDecl}?{content})
-
-// [79] extPE ::= TextDecl? extSubsetDecl
-extPE = ({TextDecl}?{extSubsetDecl})
-
-// [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
-EncodingDecl = ({S}encoding{S}*{Eq}{S}*(\"{EncName}\"|\'{EncName}\'))
-
-// [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
-EncName = ([A-Za-z]([A-Za-z0-9._]|\-)*)
-
-// [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
-NotationDecl = (<\!NOTATION{S}{Name}{S}({ExternalID}|{PublicID}){S}?>)
-
-// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-PublicID = (PUBLIC{S}{PubidLiteral})
-
-// [84] Letter ::= BaseChar | Ideographic
-Letter = ({BaseChar} | {Ideographic})
-
-// [85] BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6]
-// | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131]
-// | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
-// | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5]
-// | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386
-// | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE]
-// | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0
-// | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F]
-// | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4]
-// | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB]
-// | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559
-// | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2]
-// | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7]
-// | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5
-// | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961]
-// | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8]
-// | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD]
-// | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A]
-// | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30]
-// | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]
-// | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B]
-// | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0]
-// | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0
-// | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28]
-// | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D
-// | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
-// | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C
-// | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA]
-// | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C]
-// | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33]
-// | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C]
-// | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3]
-// | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C]
-// | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39]
-// | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
-// | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88]
-// | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F]
-// | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
-// | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD
-// | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69]
-// | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103]
-// | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112]
-// | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150
-// | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165
-// | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175
-// | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8]
-// | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9
-// | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15]
-// | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D]
-// | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D]
-// | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4]
-// | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB]
-// | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126
-// | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094]
-// | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]
-BaseChar = [\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-// [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-// [87] CombiningChar ::= [#x0300-#x0345] | [#x0360-#x0361]
-// | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9]
-// | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4
-// | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF]
-// | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED]
-// | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D
-// | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC
-// | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8]
-// | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C
-// | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48]
-// | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC
-// | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD]
-// | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48]
-// | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83]
-// | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7
-// | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48]
-// | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83]
-// | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD]
-// | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43]
-// | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31
-// | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9]
-// | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35
-// | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84]
-// | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD]
-// | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1
-// | [#x302A-#x302F] | #x3099 | #x309A
-CombiningChar = [\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-// [88] Digit ::= [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9]
-// | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F]
-// | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF]
-// | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F]
-// | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]
-Digit = [\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-// [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46
-// | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E]
-// | [#x30FC-#x30FE]
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-
-
-/**
- * JSP and scripting marker allowances
- */
-
-jspCommentStart = <%--
-jspCommentEnd = --%>
-
-jspScriptletStart = <%
-jspExpressionStart = {jspScriptletStart}=
-jspDeclarationStart = {jspScriptletStart}\!
-jspScriptletEnd = %>
-jspDirectiveStart = {jspScriptletStart}@
-
-%%
-
-/* white space within a tag */
-<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE,ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-
-// BEGIN REGULAR XML
-/* handle opening a new tag almost anywhere */
-
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {genericTagOpen} {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- if (!fStateStack.empty() && fStateStack.peek()== ST_XML_COMMENT){
- fStateStack.pop();
- fEmbeddedHint = XML_COMMENT_TEXT;
- yybegin(ST_XML_TAG_NAME);
- String tagName = "";
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- return PROXY_CONTEXT;
- }
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
-}
-/* VERY special cases for tags as values */
-/* quoted JSP */
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ["] {
- return isJspTag()? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE : XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ['] {
- return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
-}
-<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ["] {
- String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_DQUOTE : JSP_TAG_ATTRIBUTE_VALUE_DQUOTE;
-
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_DQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(type, type);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {
- fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());
- return PROXY_UNKNOWN_CONTEXT;
- }
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ['] {
- String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_SQUOTE : JSP_TAG_ATTRIBUTE_VALUE_SQUOTE;
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- yybegin(ST_XML_ATTRIBUTE_VALUE_SQUOTED);
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$
- assembleEmbeddedContainer(type, type);
- fStateStack.pop();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {
- fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());
- return PROXY_UNKNOWN_CONTEXT;
- }
- return PROXY_CONTEXT;
-}
-
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]+|[\x24\x23]{S}*)
-{
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]+|[\x24\x23]{S}*)
-{
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-
-
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericTagOpen} {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", genericTagOpen");//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("tag inside of JSP attribute value start");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericEndTagOpen} {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", genericEndTagOpen");//$NON-NLS-1$
- }
- int incomingState = yystate();
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- if(Debug.debugTokenizer)
- dump("JSP attribute value start - end tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_END_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- if(yystate() != ST_ABORT_EMBEDDED)
- yybegin(incomingState);
- return PROXY_CONTEXT;
-}
-
-/* unquoted */
-<ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", unquoted genericTagOpen");//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("JSP tag embedded name start - start tag");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
-}
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
-}
-/* specially treated JSP tag names */
-<ST_XML_TAG_NAME> jsp:root {
- if(Debug.debugTokenizer)
- dump("jsp:root tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_ROOT_TAG_NAME;
-}
-<ST_XML_TAG_NAME> jsp:directive.(page|include|tag|taglib|attribute|variable) {
- if(Debug.debugTokenizer)
- dump("jsp directive tag name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return JSP_DIRECTIVE_NAME;
-}
-/* the tag's name was found, start scanning for attributes */
-<ST_XML_TAG_NAME> {Name} {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- String tagname = yytext();
- boolean jspTag = tagname.indexOf(':') != -1;
- if (fEmbeddedContainer != null) {
- fEmbeddedTag = jspTag;
- fInTagEmbedded = true;
- }
- else {
- fContainerTag = jspTag;
- fInTagContainer = true;
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-
-/* another attribute name was found, resume looking for the equals sign */
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-/* an equal sign was found, what's next is the value */
-<ST_XML_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(isJspTag() ? ST_JSP_ATTRIBUTE_VALUE : ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_ATTRIBUTE_VALUE> {AttValue} { /* only allow for non-JSP tags for this does not obey JSP quoting rules */
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-<ST_JSP_ATTRIBUTE_VALUE> {QuotedAttValue} { /* JSP attribute values have escape semantics */
- if(Debug.debugTokenizer)
- dump("jsp attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-
-/* the tag's close was found */
-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- if(isBlockMarker()) {
- fEmbeddedHint = getBlockMarkerContext();
- fEmbeddedPostState = ST_BLOCK_TAG_SCAN;
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
-
- if (fEmbeddedContainer != null)
- fInTagEmbedded = false;
- else
- fInTagContainer = false;
-
- return XML_TAG_CLOSE;
-}
-/* the tag's close was found, but the tag doesn't need a matching end tag */
-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericEmptyTagClose} {
- yybegin(YYINITIAL);
- fEmbeddedHint = UNDEFINED;
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
-
- if (fEmbeddedContainer != null)
- fInTagEmbedded = false;
- else
- fInTagContainer = false;
-
- return XML_EMPTY_TAG_CLOSE;
-}
-
-<ST_XML_TAG_NAME> [^</>\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029]* {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {
- yybegin(ST_ABORT_EMBEDDED);
- char c = yy_buffer[yy_markedPos - 1];
- if (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED && c == '\"') {
- return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE : XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
- }
- if (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED && c == '\'') {
- return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
- }
- yypushback(yylength()-1);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- yybegin(YYINITIAL);
- return XML_CONTENT;
-}
-
-// END REGULAR XML
-
-// BEGIN NESTED XML TAGS
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> <{Name} {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- /*
- * If this tag can not be nested or we're already searching for an
- * attribute name, equals, or value, return immediately.
- */
- if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr name");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_EQUALS);
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> <{Name} {
- String tagName = yytext().substring(1);
- // pushback to just after the opening bracket
- yypushback(yylength() - 1);
- /*
- * If this tag can not be nested or we're already searching for an
- * attribute name, equals, or value, return immediately.
- */
- if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- if(Debug.debugTokenizer)
- dump("tag in place of attr value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- // embedded container should be looking for the name (again) next
- yybegin(ST_XML_TAG_NAME);
- assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
-}
-// END NESTED XML
-
-// XML & JSP Comments
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {CommentStart} {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- fEmbeddedHint = XML_COMMENT_TEXT;
- fEmbeddedPostState = ST_XML_COMMENT;
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
-}
-<ST_XML_COMMENT> .|\r|\n {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
-}
-
-<ST_XML_COMMENT_END> {CommentEnd} {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
-}
-
-<ST_JSP_CONTENT> {jspScriptletEnd} {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_CLOSE;
-}
-<ST_JSP_CONTENT> .|\n|\r {
- if(Debug.debugTokenizer)
- dump("JSP code content");//$NON-NLS-1$
- return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
-}
-{jspScriptletStart} {
- /* JSP scriptlet begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(1);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(2);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(2);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(2);
- return scanJSPCommentText();
- }
- // finished sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a regular scriptlet out in content
- if(Debug.debugTokenizer)
- dump("\nJSP scriptlet start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_SCRIPTLET_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", jspScriptletStart");//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP scriptlet start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_SCRIPTLET_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
-
- return PROXY_CONTEXT;
- }
-}
-{jspExpressionStart} {
- /* JSP expression begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just an expression out in content
- if(Debug.debugTokenizer)
- dump("\nJSP expression start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_EXPRESSION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", jspExpressionStart");//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP expression start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_EXPRESSION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
-
- return PROXY_CONTEXT;
- }
-}
-{jspDeclarationStart} {
- /* JSP declaration begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a declaration out in content
- if(Debug.debugTokenizer)
- dump("\nJSP declaration start");//$NON-NLS-1$
- yybegin(ST_JSP_CONTENT);
- return JSP_DECLARATION_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", jspDeclarationStart");//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP declaration start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_CONTENT);
- assembleEmbeddedContainer(JSP_DECLARATION_OPEN, JSP_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
-}
-{jspCommentStart} {
- /* JSP comment begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(3);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(4);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(4);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(4);
- return scanJSPCommentText();
- }
- else if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_JSP_COMMENT);
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
- yybegin(ST_BLOCK_TAG_SCAN);
- return PROXY_CONTEXT;
- }
- // finished sanity checks
- if(yystate()==YYINITIAL) {
- // the simple case, just a regular scriptlet out in content
- if(Debug.debugTokenizer)
- dump("\nJSP comment start");//$NON-NLS-1$
- yybegin(ST_JSP_COMMENT);
- return JSP_COMMENT_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", jspCommentStart");//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP comment start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_COMMENT);
- // the comment container itself will act as comment text
- fEmbeddedHint = JSP_COMMENT_TEXT;
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- /*
- * required help for successive embedded regions; mark this one as a
- * comment so it will be otherwise ignored but preserved (which is why
- * we can't use white-space)
- */
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
-}
-
-<ST_BLOCK_TAG_INTERNAL_SCAN> {jspCommentStart} {
- yybegin(ST_JSP_COMMENT);
- assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
- yybegin(ST_BLOCK_TAG_SCAN);
- return PROXY_CONTEXT;
-}
-
-{jspDirectiveStart} {
- /* JSP directive begun (anywhere)
- * A consequence of the start anywhere possibility is that the
- * incoming state must be checked to see if it's erroneous
- * due to the order of precedence generated
- */
- // begin sanity checks
- if(yystate() == ST_JSP_CONTENT) {
- // at the beginning?!
- yypushback(2);
- return JSP_CONTENT;
- }
- else if(yystate() == ST_BLOCK_TAG_SCAN) {
- yypushback(3);
- return doBlockTagScan();
- }
- else if(yystate() == ST_XML_COMMENT) {
- yypushback(3);
- return scanXMLCommentText();
- }
- else if(yystate() == ST_JSP_COMMENT) {
- yypushback(3);
- return scanJSPCommentText();
- }
- // end sanity checks
- fStateStack.push(yystate());
- if(fStateStack.peek()==YYINITIAL) {
- // the simple case, just a declaration out in content
- if(Debug.debugTokenizer)
- dump("\nJSP directive start");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME);
- return JSP_DIRECTIVE_OPEN;
- }
- else {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", jspDirectiveStart");//$NON-NLS-1$
- }
- if(Debug.debugTokenizer)
- dump("JSP declaration start");//$NON-NLS-1$
- if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
- fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
- else if(yystate() == ST_CDATA_TEXT) {
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- }
- yybegin(ST_JSP_DIRECTIVE_NAME);
- assembleEmbeddedContainer(JSP_DIRECTIVE_OPEN, new String[]{JSP_DIRECTIVE_CLOSE, JSP_CLOSE});
- if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
- yybegin(ST_BLOCK_TAG_SCAN);
- return BLOCK_TEXT;
- }
- // required help for successive embedded regions
- if(yystate() == ST_XML_TAG_NAME) {
- fEmbeddedHint = XML_TAG_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- }
- else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- return PROXY_CONTEXT;
- }
-}
-
-
-<ST_JSP_DIRECTIVE_NAME> {Name} {
- if(Debug.debugTokenizer)
- dump("JSP directive name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
- return JSP_DIRECTIVE_NAME;
-}
-<ST_JSP_DIRECTIVE_NAME_WHITESPACE> {S}? {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return WHITE_SPACE;
-}
-<ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_JSP_DIRECTIVE_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-<ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {AttValue} {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-<ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {jspScriptletEnd} {
- if(Debug.debugTokenizer)
- dump("JSP end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return JSP_DIRECTIVE_CLOSE;
-}
-
-<YYINITIAL> {jspCommentStart} {
- if(Debug.debugTokenizer)
- dump("\nJSP comment start");//$NON-NLS-1$
- yybegin(ST_JSP_COMMENT);
- return JSP_COMMENT_OPEN;
-}
-
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x24\x7b {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x23\x7b {
- int enterState = yystate();
- yybegin(ST_JSP_DQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});
- // abort early when an unescaped double quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x24\x7b {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_EL);
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the EL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x23\x7b {
- int enterState = yystate();
- yybegin(ST_JSP_SQUOTED_VBL);
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});
- // abort early when an unescaped single quote is found in the VBL
- if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- yybegin(ST_ABORT_EMBEDDED);
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- }
- else {
- yybegin(enterState);
- }
- return PROXY_CONTEXT;
-}
-
-// unescaped double quote, return as ending region
-<ST_JSP_DQUOTED_EL,ST_JSP_DQUOTED_VBL> ["] {
- return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE: XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
-}
-// unescaped single quote, return as ending region
-<ST_JSP_SQUOTED_EL,ST_JSP_SQUOTED_VBL> ['] {
- return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
-}
-
-
-// paired escaped double quotes
-<ST_JSP_DQUOTED_EL> \\\" ([^\\]|\\[^"}]+)* \\\" {
- return JSP_EL_QUOTED_CONTENT;
-}
-// everything else EL
-<ST_JSP_DQUOTED_EL> ([^\\}"]|\\[^"])+ {
- return JSP_EL_CONTENT;
-}
-<ST_JSP_DQUOTED_EL> \\\" {
- return JSP_EL_CONTENT;
-}
-// paired escaped quotes
-<ST_JSP_SQUOTED_EL> \\\' ([^\\]|\\[^'}]+)* \\\' {
- return JSP_EL_QUOTED_CONTENT;
-}
-// everything else EL
-<ST_JSP_SQUOTED_EL> ([^\\}']|\\[^'])+ {
- return JSP_EL_CONTENT;
-}
-<ST_JSP_SQUOTED_EL> \\\' {
- return JSP_EL_CONTENT;
-}
-<ST_JSP_DQUOTED_EL,ST_JSP_SQUOTED_EL> } {
- return JSP_EL_CLOSE;
-}
-
-
-// paired escaped quotes
-<ST_JSP_DQUOTED_VBL> \\\" ([^\\]|\\[^"}]+)* \\\" {
- return JSP_VBL_QUOTED_CONTENT;
-}
-// everything else VBL
-<ST_JSP_DQUOTED_VBL> ([^\\}"]|\\[^"])+ {
- return JSP_VBL_CONTENT;
-}
-<ST_JSP_DQUOTED_VBL> \\\" {
- return JSP_VBL_CONTENT;
-}
-// paired escaped quotes
-<ST_JSP_SQUOTED_VBL> \\\' ([^\\]|\\[^'}]+)* \\\' {
- return JSP_VBL_QUOTED_CONTENT;
-}
-// everything else VBL
-<ST_JSP_SQUOTED_VBL> ([^\\}']|\\[^'])+ {
- return JSP_VBL_CONTENT;
-}
-<ST_JSP_SQUOTED_VBL> \\\' {
- return JSP_VBL_CONTENT;
-}
-
-<ST_JSP_DQUOTED_VBL,ST_JSP_SQUOTED_VBL> } {
- return JSP_VBL_CLOSE;
-}
-
-
-// XML content area EL
-<YYINITIAL> \x24\x7b[^\x7d]*/\x7d {
- yybegin(ST_JSP_EL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
-}
-// XML attribute name EL
-<ST_XML_ATTRIBUTE_NAME> \x24\x7b[^\x7d]*/\x7d {
- yybegin(ST_JSP_EL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
-}
-<ST_JSP_EL> \x24\x7b {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_EL_OPEN;
- }
-}
-// XML content area VBL
-<YYINITIAL> \x23\x7b[^\x7d]*/\x7d {
- yybegin(ST_JSP_VBL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_CONTENT;
- fEmbeddedPostState = YYINITIAL;
- assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
- fEmbeddedHint = XML_CONTENT;
- yybegin(YYINITIAL);
- return PROXY_CONTEXT;
-}
-<ST_JSP_VBL> \x23\x7b {
- fELlevel++;
- if(fELlevel == 1) {
- return JSP_VBL_OPEN;
- }
-}
-// XML attribute name VBL
-<ST_XML_ATTRIBUTE_NAME> \x23\x7b[^\x7d]*/\x7d {
- yybegin(ST_JSP_VBL);
- if(yylength() > 2)
- yypushback(yylength() - 2);
- fELlevel++;
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return PROXY_CONTEXT;
-}
-// return anything not starting quotes or ending the VBL as content
-<ST_JSP_VBL> [^\x7d\x22\x27]* {
- return JSP_VBL_CONTENT;
-}
-// return anything not starting quotes or ending the EL as content
-<ST_JSP_EL> [^\x7d\x22\x27]* {
- return JSP_EL_CONTENT;
-}
-
-
-// quotes
-<ST_JSP_EL> \x22 {
- yybegin(ST_JSP_EL_DQUOTES);
- return JSP_EL_DQUOTE;
-}
-<ST_JSP_EL_DQUOTES> \x22 {
- yybegin(ST_JSP_EL);
- return JSP_EL_DQUOTE;
-}
-<ST_JSP_EL_DQUOTES> [^\x22]+/\x22 {
- yybegin(ST_JSP_EL_DQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
-}
-<ST_JSP_EL_DQUOTES_END> \x22 {
- yybegin(ST_JSP_EL);
- return JSP_EL_DQUOTE;
-}
-<ST_JSP_EL> \x27 {
- yybegin(ST_JSP_EL_SQUOTES);
- return JSP_EL_SQUOTE;
-}
-<ST_JSP_EL_SQUOTES> \x27 {
- yybegin(ST_JSP_EL);
- return JSP_EL_SQUOTE;
-}
-<ST_JSP_EL_SQUOTES> [^\x27]+/\x27 {
- yybegin(ST_JSP_EL_SQUOTES_END);
- return JSP_EL_QUOTED_CONTENT;
-}
-<ST_JSP_EL_SQUOTES_END> \x27 {
- yybegin(ST_JSP_EL);
- return JSP_EL_SQUOTE;
-}
-// quotes
-<ST_JSP_VBL> \x22 {
- yybegin(ST_JSP_VBL_DQUOTES);
- return JSP_VBL_DQUOTE;
-}
-<ST_JSP_VBL_DQUOTES> \x22 {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_DQUOTE;
-}
-<ST_JSP_VBL_DQUOTES> [^\x22]+/\x22 {
- yybegin(ST_JSP_VBL_DQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
-}
-<ST_JSP_VBL_DQUOTES_END> \x22 {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_DQUOTE;
-}
-<ST_JSP_VBL> \x27 {
- yybegin(ST_JSP_VBL_SQUOTES);
- return JSP_VBL_SQUOTE;
-}
-<ST_JSP_VBL_SQUOTES> \x27 {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_SQUOTE;
-}
-<ST_JSP_VBL_SQUOTES> [^\x27]+/\x27 {
- yybegin(ST_JSP_VBL_SQUOTES_END);
- return JSP_VBL_QUOTED_CONTENT;
-}
-<ST_JSP_VBL_SQUOTES_END> \x27 {
- yybegin(ST_JSP_VBL);
- return JSP_VBL_SQUOTE;
-}
-
-// unquoted content
-<ST_JSP_EL> ([^}\x27\x22\x24]|\x24[^\x7b\x27\x22])+ {
- //System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
- return JSP_EL_CONTENT;
-}
-<ST_JSP_EL> } {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_EL_CLOSE;
- }
- return JSP_EL_CONTENT;
-}
-<ST_JSP_VBL> } {
- fELlevel--;
- if(fELlevel == 0) {
- yybegin(YYINITIAL);
- return JSP_VBL_CLOSE;
- }
- return JSP_VBL_CONTENT;
-}
-// EL unquoted in tag (section 2.1 declares it as valid in template text (XML_CONTENT) or attribute values
-<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x24\x7b[^\x7d]+/\x7d {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("EL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_EL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
-}
-// VBL unquoted in tag or attribute values
-<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {
- if (Debug.debugTokenizer) {
- System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$
- }
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- fStateStack.push(yystate());
- if(yylength() > 2)
- yypushback(yylength() -2);
- if(Debug.debugTokenizer)
- dump("VBL in attr value");//$NON-NLS-1$
- yybegin(ST_JSP_VBL);
- fELlevel++;
- assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE});
- fStateStack.pop();
- yybegin(ST_XML_ATTRIBUTE_NAME);
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- return PROXY_CONTEXT;
-}
-
-<ST_JSP_COMMENT> .|\r|\n {
- if(Debug.debugTokenizer)
- dump("\nJSP comment text");//$NON-NLS-1$
- return scanJSPCommentText();
-}
-<ST_JSP_COMMENT_END> {jspCommentEnd} {
- if(Debug.debugTokenizer)
- dump("\nJSP comment close");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return JSP_COMMENT_CLOSE;
-}
-
-// XML misc
-
-{CDStart} {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
-}
-<ST_CDATA_TEXT> .|\r|\n {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- fEmbeddedPostState = ST_CDATA_TEXT;
- fEmbeddedHint = XML_CDATA_TEXT;
- String returnedContext = doScan("]]>", false, true, true, XML_CDATA_TEXT, ST_CDATA_END, ST_CDATA_END);//$NON-NLS-1$
- if(returnedContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return returnedContext;
-}
-<ST_CDATA_END> {CDEnd} {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
-}
-
-<YYINITIAL> {PEReference} {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
-}
-<YYINITIAL> {CharRef} {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
-}
-<YYINITIAL> {EntityRef} {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
-}
-
-<YYINITIAL> {PIstart} {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
-}
-// the next four are order dependent
-<ST_PI> ((X|x)(M|m)(L|l)) {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> ([iI][mM][pP][oO][rR][tT]) {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> xml-stylesheet {
- if(Debug.debugTokenizer)
- dump("XSL processing instruction target");//$NON-NLS-1$
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> {Name} {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- fEmbeddedHint = XML_CONTENT;
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
-}
-<ST_PI_WS> {S}+ {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
-}
-<ST_PI, ST_PI_WS> \?> {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-<ST_PI_CONTENT> . {
- // block scan until close is found
- return doScan("?>", false, false, false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
-}
-<ST_PI_CONTENT,ST_XML_PI_TAG_CLOSE> \?> {
- // ended with nothing inside
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-
-<ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_XML_PI_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_PI_ATTRIBUTE_VALUE> {AttValue} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* the PI's close was found */
-<ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE> {PIend} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-// DHTML
-<ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_DHTML_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
- fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_DHTML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
- fEmbeddedPostState = ST_XML_EQUALS;
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* The DHTML PI's close was found */
-<ST_DHTML_EQUALS, ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_ATTRIBUTE_VALUE> [/]*> {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-
-// XML declarations
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagOpen}! {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
-}
-<ST_XML_DECLARATION> [Ee][Ll][Ee][Mm][Ee][Nn][Tt] {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
-}
-<ST_XML_DECLARATION> [Dd][Oo][Cc][Tt][Yy][Pp][Ee] {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
-}
-<ST_XML_DECLARATION> [Aa][Tt][Tt][Ll][Ii][Ss][Tt] {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
-}
-
-// begin DOCTYPE handling procedure
-<ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DECLARATION_CLOSE> \[[^\]]*\] {
- return XML_DOCTYPE_INTERNAL_SUBSET;
-}
-
-<ST_XML_DOCTYPE_DECLARATION> {Name} {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Pp][Uu][Bb][Ll][Ii][Cc] {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Ss][Yy][Ss][Tt][Ee][Mm] {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
-}
-<ST_XML_DOCTYPE_ID_PUBLIC> {AttValue}|{PubidLiteral} {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-}
-<ST_XML_DOCTYPE_ID_SYSTEM> {AttValue}|{SystemLiteral} {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-}
-// end DOCTYPE handling
-
-// begin ELEMENT handling procedure
-<ST_XML_ELEMENT_DECLARATION> {AttValue}|{PubidLiteral} {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
-}
-<ST_XML_ELEMENT_DECLARATION_CONTENT> [^>]* {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
-}
-
-<ST_XML_ELEMENT_DECLARATION_CONTENT> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end ELEMENT handling
-
-// begin ATTLIST handling procedure
-<ST_XML_ATTLIST_DECLARATION> {AttValue}|{PubidLiteral} {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- fEmbeddedHint = UNDEFINED;
- fEmbeddedPostState = YYINITIAL;
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
-}
-<ST_XML_ATTLIST_DECLARATION_CONTENT> [^>]* {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
-}
-
-<ST_XML_ATTLIST_DECLARATION_CONTENT> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end ATTLIST handling
-
-<ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_ATTLIST_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end DECLARATION handling
-
-<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%][^<&%\x24\x23]*|\\[\x24\x23][\x7b]|[&%]{Name}([^;&%<]*|{S}+;*)) {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
-}
-
-<YYINITIAL> (%)+ {
- if(Debug.debugTokenizer)
- dump("non-reference %");//$NON-NLS-1$
- return XML_CONTENT;
-}
-
-<ST_BLOCK_TAG_SCAN> .|\r|\n {
- return doBlockTagScan();
- }
-
-. {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
-}
-
-\040 {
- if(Debug.debugTokenizer)
- dump("SPACE");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\011 {
- if(Debug.debugTokenizer)
- dump("0x9");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\015
-{
- if(Debug.debugTokenizer)
- dump("CARRIAGE RETURN");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\012 {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java
deleted file mode 100644
index b4607a28d6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java
+++ /dev/null
@@ -1,1937 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 10/17/07 4:27 AM */
-
-/*******************************************************************************
- * 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.xml.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 10/17/07 4:27 AM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex</tt>
- */
-public class XMLTokenizer implements BlockTokenizer, DOMRegionContext {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 23;
- final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 27;
- final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
- final public static int ST_XML_PI_TAG_CLOSE = 11;
- final public static int ST_XML_DECLARATION_CLOSE = 21;
- final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
- final public static int ST_DHTML_EQUALS = 13;
- final public static int ST_XML_TAG_NAME = 16;
- final public static int ST_XML_ATTRIBUTE_VALUE = 19;
- final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
- final public static int ST_XML_DOCTYPE_ID_SYSTEM = 25;
- final public static int ST_XML_ATTRIBUTE_NAME = 17;
- final public static int ST_XML_ELEMENT_DECLARATION = 26;
- final public static int ST_XML_DOCTYPE_DECLARATION = 22;
- final public static int ST_XML_ATTLIST_DECLARATION = 28;
- final public static int ST_XML_COMMENT_END = 4;
- final public static int ST_CDATA_TEXT = 1;
- final public static int ST_DHTML_TAG_CLOSE = 15;
- final public static int ST_XML_COMMENT = 3;
- final public static int ST_PI_CONTENT = 7;
- final public static int ST_PI_WS = 6;
- final public static int ST_CDATA_END = 2;
- final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 29;
- final public static int ST_BLOCK_TAG_SCAN = 30;
- final public static int ST_XML_PI_EQUALS = 9;
- final public static int ST_XML_DECLARATION = 20;
- final public static int YYINITIAL = 0;
- final public static int ST_XML_DOCTYPE_ID_PUBLIC = 24;
- final public static int ST_XML_EQUALS = 18;
- final public static int ST_PI = 5;
- final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\5\1\22\2\0\1\14\22\0\1\14\1\21\1\11\1\55"+
- "\1\16\1\17\1\12\1\13\1\16\1\16\1\16\1\16\1\16\1\7"+
- "\1\6\1\3\12\15\1\10\1\61\1\1\1\45\1\2\1\4\1\16"+
- "\1\34\1\62\1\32\1\33\1\50\1\57\1\36\1\36\1\42\1\36"+
- "\1\36\1\27\1\25\1\44\1\43\1\47\1\36\1\40\1\56\1\35"+
- "\1\60\2\36\1\23\1\46\1\36\1\31\1\0\1\20\1\0\1\10"+
- "\1\0\1\52\1\62\1\63\1\53\1\37\1\57\1\36\1\66\1\42"+
- "\2\36\1\30\1\26\1\44\1\43\1\47\1\36\1\40\1\41\1\51"+
- "\1\60\1\36\1\36\1\24\1\54\1\36\1\0\1\0\72\0\1\65"+
- "\10\0\27\64\1\0\37\64\1\0\72\64\2\0\13\64\2\0\10\64"+
- "\1\0\65\64\1\0\104\64\11\0\44\64\3\0\2\64\4\0\36\64"+
- "\70\0\131\64\22\0\7\64\16\0\2\65\56\0\106\65\32\0\2\65"+
- "\44\0\1\64\1\65\3\64\1\0\1\64\1\0\24\64\1\0\54\64"+
- "\1\0\7\64\3\0\1\64\1\0\1\64\1\0\1\64\1\0\1\64"+
- "\1\0\22\64\15\0\14\64\1\0\102\64\1\0\14\64\1\0\44\64"+
- "\1\0\4\65\11\0\65\64\2\0\2\64\2\0\2\64\3\0\34\64"+
- "\2\0\10\64\2\0\2\64\67\0\46\64\2\0\1\64\7\0\46\64"+
- "\12\0\21\65\1\0\27\65\1\0\3\65\1\0\1\65\1\0\2\65"+
- "\1\0\1\65\13\0\33\64\5\0\3\64\56\0\32\64\5\0\1\65"+
- "\12\64\10\65\15\0\12\65\6\0\1\65\107\64\2\0\5\64\1\0"+
- "\17\64\1\0\4\64\1\0\1\64\17\65\2\64\2\65\1\0\4\65"+
- "\2\0\12\65\u0207\0\3\65\1\0\65\64\2\0\1\65\1\64\20\65"+
- "\3\0\4\65\3\0\12\64\2\65\2\0\12\65\21\0\3\65\1\0"+
- "\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0\1\64\3\0"+
- "\4\64\2\0\1\65\1\0\7\65\2\0\2\65\2\0\3\65\11\0"+
- "\1\65\4\0\2\64\1\0\3\64\2\65\2\0\12\65\2\64\20\0"+
- "\1\65\2\0\6\64\4\0\2\64\2\0\26\64\1\0\7\64\1\0"+
- "\2\64\1\0\2\64\1\0\2\64\2\0\1\65\1\0\5\65\4\0"+
- "\2\65\2\0\3\65\13\0\4\64\1\0\1\64\7\0\12\65\2\65"+
- "\3\64\14\0\3\65\1\0\7\64\1\0\1\64\1\0\3\64\1\0"+
- "\26\64\1\0\7\64\1\0\2\64\1\0\5\64\2\0\1\65\1\64"+
- "\10\65\1\0\3\65\1\0\3\65\22\0\1\64\5\0\12\65\21\0"+
- "\3\65\1\0\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0"+
- "\2\64\2\0\4\64\2\0\1\65\1\64\6\65\3\0\2\65\2\0"+
- "\3\65\10\0\2\65\4\0\2\64\1\0\3\64\4\0\12\65\22\0"+
- "\2\65\1\0\6\64\3\0\3\64\1\0\4\64\3\0\2\64\1\0"+
- "\1\64\1\0\2\64\3\0\2\64\3\0\3\64\3\0\10\64\1\0"+
- "\3\64\4\0\5\65\3\0\3\65\1\0\4\65\11\0\1\65\17\0"+
- "\11\65\21\0\3\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
- "\12\64\1\0\5\64\4\0\7\65\1\0\3\65\1\0\4\65\7\0"+
- "\2\65\11\0\2\64\4\0\12\65\22\0\2\65\1\0\10\64\1\0"+
- "\3\64\1\0\27\64\1\0\12\64\1\0\5\64\4\0\7\65\1\0"+
- "\3\65\1\0\4\65\7\0\2\65\7\0\1\64\1\0\2\64\4\0"+
- "\12\65\22\0\2\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
- "\20\64\4\0\6\65\2\0\3\65\1\0\4\65\11\0\1\65\10\0"+
- "\2\64\4\0\12\65\221\0\56\64\1\0\1\64\1\65\2\64\7\65"+
- "\5\0\6\64\1\65\10\65\1\0\12\65\47\0\2\64\1\0\1\64"+
- "\2\0\2\64\1\0\1\64\2\0\1\64\6\0\4\64\1\0\7\64"+
- "\1\0\3\64\1\0\1\64\1\0\1\64\2\0\2\64\1\0\2\64"+
- "\1\0\1\64\1\65\2\64\6\65\1\0\2\65\1\64\2\0\5\64"+
- "\1\0\1\65\1\0\6\65\2\0\12\65\76\0\2\65\6\0\12\65"+
- "\13\0\1\65\1\0\1\65\1\0\1\65\4\0\2\65\10\64\1\0"+
- "\41\64\7\0\24\65\1\0\6\65\4\0\6\65\1\0\1\65\1\0"+
- "\25\65\3\0\7\65\1\0\1\65\346\0\46\64\12\0\47\64\11\0"+
- "\1\64\1\0\2\64\1\0\3\64\1\0\1\64\1\0\2\64\1\0"+
- "\5\64\51\0\1\64\1\0\1\64\1\0\1\64\13\0\1\64\1\0"+
- "\1\64\1\0\1\64\3\0\2\64\3\0\1\64\5\0\3\64\1\0"+
- "\1\64\1\0\1\64\1\0\1\64\1\0\1\64\3\0\2\64\3\0"+
- "\2\64\1\0\1\64\50\0\1\64\11\0\1\64\2\0\1\64\2\0"+
- "\2\64\7\0\2\64\1\0\1\64\1\0\7\64\50\0\1\64\4\0"+
- "\1\64\10\0\1\64\u0c06\0\234\64\4\0\132\64\6\0\26\64\2\0"+
- "\6\64\2\0\46\64\2\0\6\64\2\0\10\64\1\0\1\64\1\0"+
- "\1\64\1\0\1\64\1\0\37\64\2\0\65\64\1\0\7\64\1\0"+
- "\1\64\3\0\3\64\1\0\7\64\3\0\4\64\2\0\6\64\4\0"+
- "\15\64\5\0\3\64\1\0\7\64\323\0\15\65\4\0\1\65\104\0"+
- "\1\64\3\0\2\64\2\0\1\64\121\0\3\64\u0e82\0\1\65\1\0"+
- "\1\64\31\0\11\64\6\65\1\0\5\65\13\0\124\64\4\0\2\65"+
- "\2\0\2\65\2\0\132\64\1\0\3\65\6\0\50\64\u1cd3\0\u51a6\64"+
- "\u0c5a\0\u2ba4\64\134\0\u0800\0\u1ffe\0\2\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
- /**
- * Translates a state to a row index in the transition table
- */
- final private static int yy_rowMap [] = {
- 0, 55, 110, 165, 220, 275, 330, 385, 440, 495,
- 550, 605, 660, 715, 770, 825, 880, 935, 990, 1045,
- 1100, 1155, 1210, 1265, 1320, 1375, 1430, 1485, 1540, 1595,
- 1650, 1705, 1760, 1815, 1870, 1925, 1980, 1925, 1980, 2035,
- 1925, 1925, 1980, 2090, 2145, 2200, 2255, 2310, 2365, 2420,
- 2475, 1925, 1980, 2530, 2585, 2640, 1925, 2695, 2695, 2750,
- 2805, 2860, 2530, 1925, 2915, 2970, 1925, 3025, 3080, 3135,
- 3190, 3245, 3300, 1925, 3355, 3410, 3465, 3520, 1925, 3575,
- 3630, 3685, 3740, 3795, 1925, 3850, 3905, 3960, 4015, 4070,
- 4125, 4180, 4235, 4235, 4290, 4345, 4400, 4455, 4455, 4510,
- 4565, 4620, 4675, 4675, 4730, 4785, 4840, 4895, 1925, 4950,
- 4950, 5005, 5060, 5115, 5170, 1925, 1925, 1980, 1925, 1925,
- 5225, 5280, 5335, 5390, 5445, 5500, 5555, 5610, 1925, 5665,
- 5720, 5775, 1925, 1925, 2695, 5830, 2805, 1925, 5885, 2860,
- 2915, 3025, 3080, 5940, 3135, 1925, 5995, 3190, 1925, 3575,
- 6050, 3685, 1925, 6105, 3740, 5225, 6160, 6215, 6270, 4015,
- 1925, 6325, 6380, 4235, 6435, 4290, 1925, 6490, 6545, 6600,
- 6600, 6655, 6710, 4400, 4235, 4455, 6765, 4510, 1925, 6820,
- 4565, 4620, 4455, 4675, 6875, 4730, 1925, 6930, 6985, 7040,
- 7040, 7095, 7150, 7205, 4950, 7260, 5005, 1925, 7315, 7370,
- 7425, 7425, 7480, 7535, 7590, 7645, 7700, 7755, 7810, 1925,
- 7865, 7920, 1925, 1925, 1925, 2255, 7975, 8030, 8085, 8140,
- 8195, 8250, 8305, 6490, 8360, 8360, 6930, 8415, 8415, 8470,
- 7315, 8525, 8525, 8580, 1925, 8635, 8690, 1925, 8745, 8800,
- 8855, 8910, 8965, 9020, 9075, 9130, 6655, 7095, 9185, 7480,
- 9240, 9295, 9350, 9405, 9460, 9515, 9570, 9625, 9680, 9735,
- 9790, 9845, 9900, 9955, 10010, 10065, 10120, 1925, 1925, 10175,
- 10230, 10285, 10340, 10395, 1925, 1925, 1925, 10450, 10505, 10560,
- 10615, 10670, 10725, 1925, 10780, 4840, 5115, 10835, 10890, 10945,
- 11000, 2255
- };
-
- /**
- * The packed transition table of the DFA
- */
- final private static String yy_packed =
- "\1\40\1\41\10\40\1\42\4\40\1\43\47\40\1\44"+
- "\1\45\65\44\1\46\1\47\16\46\1\50\1\46\1\51"+
- "\44\46\1\52\1\53\65\52\1\46\1\47\5\46\1\54"+
- "\12\46\1\51\45\46\1\47\2\46\1\55\1\56\2\46"+
- "\1\57\3\46\1\56\5\46\1\56\1\60\1\61\4\57"+
- "\1\46\10\57\1\62\2\57\1\46\7\57\1\46\3\57"+
- "\1\46\3\57\1\46\1\57\1\46\1\47\2\46\1\55"+
- "\1\63\6\46\1\63\5\46\1\63\44\46\1\64\1\65"+
- "\2\64\1\66\15\64\1\51\44\64\1\46\1\47\2\46"+
- "\1\67\1\56\2\46\1\70\3\46\1\56\5\46\1\56"+
- "\6\70\1\46\13\70\1\46\7\70\1\46\3\70\1\46"+
- "\3\70\1\46\1\70\1\46\1\47\2\46\1\67\1\56"+
- "\2\46\1\70\3\46\1\56\5\46\1\56\6\70\1\46"+
- "\13\70\1\71\7\70\1\46\3\70\1\46\3\70\1\46"+
- "\1\70\1\72\1\47\1\46\1\73\1\74\1\56\3\72"+
- "\1\75\1\72\1\76\1\56\5\72\1\56\44\72\1\46"+
- "\1\47\2\46\1\77\15\46\1\51\45\46\1\47\1\100"+
- "\1\101\1\46\1\56\2\46\1\102\3\46\1\56\5\46"+
- "\1\56\6\102\1\46\13\102\1\46\7\102\1\46\3\102"+
- "\1\46\3\102\1\46\1\102\1\46\1\47\1\100\1\101"+
- "\1\46\1\56\2\46\1\102\3\46\1\56\5\46\1\56"+
- "\6\102\1\46\13\102\1\103\7\102\1\46\3\102\1\46"+
- "\3\102\1\46\1\102\1\104\1\47\1\100\1\105\1\104"+
- "\1\56\3\104\1\106\1\104\1\107\1\56\5\104\1\56"+
- "\44\104\1\46\1\47\3\46\1\56\6\46\1\56\5\46"+
- "\1\56\44\46\1\110\1\111\1\112\1\113\4\110\1\114"+
- "\12\110\6\115\1\110\13\115\1\110\7\115\1\110\3\115"+
- "\1\110\3\115\1\110\1\115\1\46\1\111\1\112\1\113"+
- "\1\46\1\56\2\46\1\116\3\46\1\56\5\46\1\56"+
- "\6\116\1\46\13\116\1\46\7\116\1\46\3\116\1\46"+
- "\3\116\1\46\1\116\1\46\1\111\1\112\1\113\1\46"+
- "\1\56\2\46\1\116\3\46\1\56\5\46\1\56\6\116"+
- "\1\46\13\116\1\117\7\116\1\46\3\116\1\46\3\116"+
- "\1\46\1\116\1\120\1\111\1\112\1\121\1\120\1\56"+
- "\3\120\1\122\1\120\1\123\1\56\5\120\1\56\44\120"+
- "\1\46\1\124\1\125\2\46\1\56\6\46\1\56\5\46"+
- "\1\56\10\46\1\126\1\127\2\46\1\130\10\46\1\130"+
- "\1\46\1\127\1\126\14\46\1\47\1\125\2\46\1\56"+
- "\6\46\1\56\5\46\1\56\6\46\1\131\36\46\1\47"+
- "\1\125\2\46\1\56\2\46\1\132\3\46\1\56\5\46"+
- "\1\56\6\132\1\131\13\132\1\46\7\132\1\46\3\132"+
- "\1\46\3\132\1\46\1\132\1\46\1\47\1\125\2\46"+
- "\1\56\6\46\1\56\5\46\1\56\6\46\1\131\7\46"+
- "\1\133\5\46\1\134\6\46\1\133\10\46\1\135\1\47"+
- "\1\125\1\136\1\135\1\56\3\135\1\137\1\135\1\140"+
- "\1\56\5\135\1\56\6\135\1\141\35\135\1\142\1\47"+
- "\1\125\1\143\1\142\1\56\3\142\1\144\1\142\1\145"+
- "\1\56\5\142\1\56\6\142\1\146\35\142\1\147\1\47"+
- "\1\125\1\150\1\147\1\56\3\147\1\151\1\147\1\152"+
- "\1\56\5\147\1\56\44\147\1\153\1\154\1\155\64\153"+
- "\1\156\1\47\1\125\1\157\1\156\1\56\3\156\1\160"+
- "\1\156\1\161\1\56\5\156\1\56\44\156\1\162\1\163"+
- "\1\164\64\162\1\165\1\166\65\165\1\40\1\0\10\40"+
- "\1\0\4\40\1\0\47\40\3\0\1\167\1\170\14\0"+
- "\1\171\52\0\1\172\2\0\1\173\3\0\1\172\5\0"+
- "\1\172\6\173\1\0\13\173\1\0\7\173\1\174\3\173"+
- "\1\0\3\173\1\0\1\173\5\0\1\172\2\0\1\175"+
- "\3\0\1\172\5\0\1\172\6\175\1\0\13\175\1\0"+
- "\7\175\1\0\3\175\1\0\3\175\1\0\1\175\110\0"+
- "\1\176\65\0\1\177\55\0\1\200\61\0\1\201\71\0"+
- "\1\56\6\0\1\56\5\0\1\56\52\0\3\57\4\0"+
- "\1\57\5\0\6\57\1\0\13\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
- "\2\57\2\202\2\57\1\0\13\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
- "\2\57\1\202\1\203\2\57\1\0\13\57\1\0\7\57"+
- "\1\0\3\57\1\0\5\57\6\0\3\57\4\0\1\57"+
- "\5\0\2\57\2\204\2\57\1\0\13\57\1\0\7\57"+
- "\1\0\3\57\1\0\5\57\5\0\1\63\6\0\1\63"+
- "\5\0\1\63\46\0\1\205\66\0\1\206\72\0\3\70"+
- "\4\0\1\70\5\0\6\70\1\0\13\70\1\0\7\70"+
- "\1\0\3\70\1\0\5\70\1\72\2\0\1\207\1\72"+
- "\1\0\3\72\1\0\1\72\2\0\5\72\1\0\45\72"+
- "\1\0\1\206\1\207\1\72\1\0\3\72\1\0\1\72"+
- "\2\0\5\72\1\0\44\72\1\75\1\0\1\210\1\211"+
- "\1\75\1\210\3\75\1\212\1\75\2\210\5\75\1\210"+
- "\44\75\1\76\1\0\1\213\1\214\1\76\1\213\3\76"+
- "\1\213\1\76\1\212\1\213\5\76\1\213\44\76\2\0"+
- "\1\100\1\215\71\0\3\102\4\0\1\102\5\0\6\102"+
- "\1\0\13\102\1\0\7\102\1\0\3\102\1\0\5\102"+
- "\1\104\2\0\1\216\1\104\1\0\3\104\1\0\1\104"+
- "\2\0\5\104\1\0\45\104\1\0\1\100\1\217\1\104"+
- "\1\0\3\104\1\0\1\104\2\0\5\104\1\0\44\104"+
- "\1\106\1\0\1\220\1\221\1\106\1\220\3\106\1\222"+
- "\1\106\2\220\5\106\1\220\44\106\1\107\1\0\1\223"+
- "\1\224\1\107\1\223\3\107\1\223\1\107\1\222\1\223"+
- "\5\107\1\223\44\107\1\110\3\0\17\110\6\0\1\110"+
- "\13\0\1\110\7\0\1\110\3\0\1\110\3\0\1\110"+
- "\4\0\1\167\15\0\1\171\47\0\1\225\64\0\1\110"+
- "\3\0\2\110\3\114\4\110\1\114\5\110\6\115\1\110"+
- "\13\115\1\110\7\115\1\110\3\115\1\110\3\115\1\114"+
- "\1\115\6\0\3\115\4\0\1\115\5\0\6\115\1\0"+
- "\13\115\1\0\7\115\1\0\3\115\1\0\5\115\6\0"+
- "\3\116\4\0\1\116\5\0\6\116\1\0\13\116\1\0"+
- "\7\116\1\0\3\116\1\0\5\116\1\120\2\0\1\226"+
- "\1\120\1\0\3\120\1\0\1\120\2\0\5\120\1\0"+
- "\45\120\1\0\1\225\1\226\1\120\1\0\3\120\1\0"+
- "\1\120\2\0\5\120\1\0\44\120\1\122\1\0\1\227"+
- "\1\230\1\122\1\227\3\122\1\231\1\122\2\227\5\122"+
- "\1\227\44\122\1\123\1\0\1\232\1\233\1\123\1\232"+
- "\3\123\1\232\1\123\1\231\1\232\5\123\1\232\44\123"+
- "\3\0\1\167\15\0\1\234\110\0\1\235\60\0\1\236"+
- "\13\0\1\236\44\0\2\237\36\0\20\240\1\241\46\240"+
- "\6\0\3\132\4\0\1\132\5\0\6\132\1\0\13\132"+
- "\1\0\7\132\1\0\3\132\1\0\5\132\46\0\1\242"+
- "\5\0\1\242\72\0\1\243\6\0\1\135\2\0\1\244"+
- "\1\135\1\0\3\135\1\0\1\135\2\0\5\135\1\0"+
- "\44\135\1\137\1\0\1\245\1\246\1\137\1\245\3\137"+
- "\1\247\1\137\2\245\5\137\1\245\44\137\1\250\1\0"+
- "\1\251\1\252\1\253\1\251\3\253\1\251\1\250\1\254"+
- "\1\255\3\253\1\250\1\253\1\255\6\253\1\250\32\253"+
- "\2\250\1\253\1\141\2\240\1\256\1\141\1\240\3\141"+
- "\1\240\1\141\2\240\3\141\1\257\1\141\1\240\44\141"+
- "\1\142\2\0\1\260\1\142\1\0\3\142\1\0\1\142"+
- "\2\0\5\142\1\0\44\142\1\144\2\261\1\262\1\144"+
- "\1\261\3\144\1\263\1\144\2\261\5\144\1\261\44\144"+
- "\1\145\2\264\1\265\1\145\1\264\3\145\1\264\1\145"+
- "\1\263\1\264\5\145\1\264\44\145\1\146\2\240\1\266"+
- "\1\146\1\240\3\146\1\240\1\146\2\240\3\146\1\267"+
- "\1\146\1\240\44\146\1\147\2\0\1\270\1\147\1\0"+
- "\3\147\1\0\1\147\2\0\5\147\1\0\44\147\1\151"+
- "\1\0\1\271\1\272\1\151\1\271\3\151\1\273\1\151"+
- "\2\271\5\151\1\271\44\151\1\274\1\0\1\275\1\276"+
- "\1\277\1\275\3\277\1\275\1\274\1\300\1\301\3\277"+
- "\1\274\1\277\1\301\6\277\1\274\32\277\2\274\1\277"+
- "\2\153\1\0\66\153\1\0\16\153\1\302\45\153\1\156"+
- "\2\0\1\303\1\156\1\0\3\156\1\0\1\156\2\0"+
- "\5\156\1\0\44\156\1\160\1\0\1\304\1\305\1\160"+
- "\1\304\3\160\1\306\1\160\2\304\5\160\1\304\44\160"+
- "\1\307\1\0\1\310\1\311\1\312\1\310\3\312\1\310"+
- "\1\307\1\313\1\314\3\312\1\307\1\312\1\314\6\312"+
- "\1\307\32\312\2\307\1\312\2\162\1\0\66\162\1\0"+
- "\16\162\1\315\45\162\7\0\1\316\21\0\1\317\42\0"+
- "\1\172\2\0\1\40\3\0\1\172\5\0\1\172\6\40"+
- "\1\0\13\40\1\0\7\40\1\0\3\40\1\0\3\40"+
- "\1\0\1\40\1\320\1\0\3\320\1\321\3\173\1\320"+
- "\1\0\1\320\1\321\1\173\1\320\1\0\2\320\1\321"+
- "\6\173\1\320\13\173\1\320\7\173\1\320\3\173\1\322"+
- "\5\173\15\0\1\323\6\0\1\324\42\0\1\320\1\0"+
- "\3\320\1\321\3\175\1\320\1\0\1\320\1\321\1\175"+
- "\1\320\1\0\2\320\1\321\6\175\1\320\13\175\1\320"+
- "\7\175\1\320\3\175\1\325\5\175\31\0\1\317\37\0"+
- "\1\326\66\0\1\327\72\0\3\57\4\0\1\57\5\0"+
- "\4\57\2\330\1\0\13\57\1\0\7\57\1\0\3\57"+
- "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\4\57"+
- "\1\330\1\331\1\0\13\57\1\0\7\57\1\0\3\57"+
- "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
- "\1\0\13\57\1\0\1\57\1\332\5\57\1\0\3\57"+
- "\1\0\5\57\1\210\1\0\7\210\1\212\55\210\1\213"+
- "\1\0\11\213\1\212\53\213\1\220\1\0\7\220\1\222"+
- "\55\220\1\223\1\0\11\223\1\222\53\223\1\227\1\0"+
- "\7\227\1\231\55\227\1\232\1\0\11\232\1\231\53\232"+
- "\32\0\1\333\30\0\1\333\40\0\1\334\13\0\1\334"+
- "\54\0\1\335\10\0\1\335\57\0\1\336\14\0\1\336"+
- "\72\0\1\337\4\0\1\245\1\0\7\245\1\247\55\245"+
- "\1\250\1\0\1\251\1\340\1\250\1\251\3\250\1\251"+
- "\1\250\1\247\1\251\5\250\1\251\44\250\1\251\1\0"+
- "\11\251\1\247\53\251\1\250\1\0\1\251\1\340\1\250"+
- "\1\251\3\250\1\251\1\250\1\341\1\251\5\250\1\251"+
- "\44\250\13\0\1\342\53\0\1\251\1\0\11\251\1\341"+
- "\53\251\11\261\1\263\55\261\13\264\1\263\53\264\1\271"+
- "\1\0\7\271\1\273\55\271\1\274\1\0\1\275\1\343"+
- "\1\274\1\275\3\274\1\275\1\274\1\273\1\275\5\274"+
- "\1\275\44\274\1\275\1\0\11\275\1\273\53\275\1\274"+
- "\1\0\1\275\1\343\1\274\1\275\3\274\1\275\1\274"+
- "\1\344\1\275\5\274\1\275\44\274\13\0\1\345\53\0"+
- "\1\275\1\0\11\275\1\344\53\275\2\153\1\0\26\153"+
- "\1\346\35\153\1\304\1\0\7\304\1\306\55\304\1\307"+
- "\1\0\1\310\1\347\1\307\1\310\3\307\1\310\1\307"+
- "\1\306\1\310\5\307\1\310\44\307\1\310\1\0\11\310"+
- "\1\306\53\310\1\307\1\0\1\310\1\347\1\307\1\310"+
- "\3\307\1\310\1\307\1\350\1\310\5\307\1\310\44\307"+
- "\13\0\1\351\53\0\1\310\1\0\11\310\1\350\53\310"+
- "\2\162\1\0\26\162\1\352\35\162\7\0\1\353\111\0"+
- "\1\354\34\0\1\320\1\0\10\320\1\0\4\320\1\0"+
- "\41\320\1\0\6\320\1\0\3\320\1\321\4\320\1\0"+
- "\1\320\1\321\2\320\1\0\2\320\1\321\36\320\1\355"+
- "\5\320\15\0\1\323\43\0\1\356\22\0\1\357\14\0"+
- "\3\357\2\0\1\357\10\0\1\357\1\0\2\357\3\0"+
- "\1\357\2\0\2\357\11\0\1\57\1\360\1\57\4\0"+
- "\1\57\5\0\6\57\1\0\13\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
- "\6\57\1\0\11\57\1\361\1\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\35\0\1\362\13\0\1\362\44\0"+
- "\2\363\63\0\2\364\75\0\1\365\13\0\1\365\44\0"+
- "\2\366\41\0\2\367\1\0\3\367\2\0\1\254\4\367"+
- "\1\0\10\367\1\0\32\367\2\0\1\367\3\0\2\370"+
- "\1\0\3\370\2\0\1\300\4\370\1\0\10\370\1\0"+
- "\32\370\2\0\1\370\2\153\1\0\27\153\1\371\34\153"+
- "\3\0\2\372\1\0\3\372\2\0\1\313\4\372\1\0"+
- "\10\372\1\0\32\372\2\0\1\372\2\162\1\0\27\162"+
- "\1\373\34\162\33\0\1\374\114\0\1\355\22\0\1\357"+
- "\14\0\3\357\2\0\1\357\10\0\1\357\1\0\2\357"+
- "\3\0\1\357\1\0\1\356\2\357\11\0\3\57\4\0"+
- "\1\57\5\0\6\57\1\0\7\57\1\375\3\57\1\0"+
- "\7\57\1\0\3\57\1\0\5\57\6\0\3\57\4\0"+
- "\1\57\5\0\6\57\1\0\6\57\1\376\4\57\1\0"+
- "\7\57\1\0\3\57\1\0\5\57\46\0\1\377\5\0"+
- "\1\377\54\0\1\u0100\63\0\1\u0101\10\0\1\u0101\55\0"+
- "\1\u0102\10\0\1\u0102\60\0\1\u0103\24\0\2\153\1\0"+
- "\30\153\1\u0104\33\153\2\162\1\0\30\162\1\u0105\33\162"+
- "\34\0\1\u0106\40\0\3\57\4\0\1\57\5\0\6\57"+
- "\1\0\13\57\1\0\3\57\1\u0107\3\57\1\0\3\57"+
- "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
- "\1\0\3\57\1\u0108\7\57\1\0\3\57\1\u0108\3\57"+
- "\1\0\3\57\1\0\5\57\47\0\1\u0109\60\0\1\u010a"+
- "\14\0\1\u010a\54\0\1\u010b\47\0\2\u010c\72\0\1\u010d"+
- "\30\0\1\u010d\3\0\2\153\1\0\31\153\1\u010e\32\153"+
- "\2\162\1\0\31\162\1\u010f\32\162\35\0\1\u0110\37\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\13\57\1\0"+
- "\6\57\1\u0111\1\0\3\57\1\0\5\57\5\0\1\u0112"+
- "\3\57\3\0\1\u0112\1\57\4\0\1\u0112\6\57\1\0"+
- "\13\57\1\0\7\57\1\0\3\57\1\0\5\57\37\0"+
- "\1\u0113\10\0\1\u0113\53\0\1\u0114\13\0\1\u0114\52\0"+
- "\1\u0115\13\0\1\u0115\15\0\2\153\1\0\32\153\1\u0116"+
- "\31\153\2\162\1\0\32\162\1\u0117\31\162\34\0\1\u0118"+
- "\40\0\3\57\4\0\1\57\5\0\5\57\1\u0119\1\0"+
- "\13\57\1\0\7\57\1\0\3\57\1\0\5\57\5\0"+
- "\1\u0112\6\0\1\u0112\5\0\1\u0112\44\0\2\153\1\0"+
- "\31\153\1\u011a\32\153\2\162\1\0\31\162\1\u011b\32\162"+
- "\31\0\1\u011c\43\0\3\57\4\0\1\57\5\0\6\57"+
- "\1\0\5\57\1\u011d\5\57\1\0\7\57\1\0\3\57"+
- "\1\0\5\57\2\153\1\0\26\153\1\u011e\35\153\2\162"+
- "\1\0\26\162\1\u011f\35\162\6\0\3\57\4\0\1\57"+
- "\5\0\6\57\1\0\7\57\1\u0120\3\57\1\0\7\57"+
- "\1\0\3\57\1\0\5\57\6\0\3\57\4\0\1\57"+
- "\5\0\6\57\1\0\13\57\1\0\7\57\1\0\3\57"+
- "\1\0\4\57\1\u0121\6\0\3\57\4\0\1\57\5\0"+
- "\6\57\1\0\5\57\1\u0122\5\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
- "\6\57\1\0\5\57\1\u0123\5\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\6\0\3\57\4\0\1\57\5\0"+
- "\6\57\1\0\13\57\1\0\3\57\1\u0124\3\57\1\0"+
- "\3\57\1\0\5\57";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans [] = yy_unpack(yy_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- // final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {
- 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
- 1, 1, 1, 9, 1, 9, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 9, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 9, 1,
- 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1,
- 1, 1, 1, 9, 9, 1, 9, 9, 1, 0, 1, 0, 1, 0, 0, 0,
- 9, 1, 1, 1, 9, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0,
- 0, 9, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
- 9, 0, 0, 0, 0, 0, 9, 1, 0, 0, 1, 1, 0, 0, 1, 0,
- 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 9, 1, 0, 0, 1, 1,
- 0, 1, 0, 0, 0, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
- 1, 9, 0, 0, 9, 9, 9, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 9, 0, 1, 9, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0,
- 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 9, 9, 1, 1, 0,
- 1, 1, 9, 9, 9, 1, 1, 0, 1, 1, 1, 9, 1, 1, 1, 1,
- 1, 1, 1, 1
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- // private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- // private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList();
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private XMLParserRegionFactory fRegionFactory = new XMLParserRegionFactory();
-/**
- * user method
- */
-public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
-}
-/* user method */
-public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
-}
-/* user method */
-public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
-}
-/* user method */
-public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
-}
-/* user method */
-public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
-}
-/* user method */
-public List getBlockMarkers() {
- return fBlockMarkers;
-}
-/* user method */
-public final int getOffset() {
- return fOffset + yychar;
-}
-private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
-}
-private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
-}
-/**
- * user method
- */
-public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
-}
-/**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
-public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
-}
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
-
- // safety check for array accesses (yy_currentPos is the *last* character we can check against)
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength; i++) {
- if(same && fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else if(same && !fIsCaseSensitiveBlocking)
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
-}
-/**
- * user method
- *
- * A generic lookahead-like operation
- */
-private final String doBlockScan(String target, String targetContext, int immediateFallbackState) throws IOException {
- return doScan(target, false, targetContext, immediateFallbackState, immediateFallbackState);
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
-/**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
-public final ITextRegion getNextToken() throws IOException {
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- }
- else {
- context = primGetNextToken();
- if (context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
-}
-/* user method */
-public XMLTokenizer(){
- super();
-}
-/* user method */
-public XMLTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
-}
-/* user method */
-public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
-}
-/* user method */
-public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
-}
-/* user method */
-public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
-}
-/* user method */
-public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
-}
-/* user method */
-public void reset(java.io.Reader in) {
- reset(in, 0);
-}
-/**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
-public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-}
-
- /**
- * user method
- *
- */
- public BlockTokenizer newInstance() {
- XMLTokenizer newInstance = new XMLTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- return newInstance;
- }
-/* user method */
-private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-}
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public XMLTokenizer(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 XMLTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed the packed transition table
- * @return the unpacked transition table
- */
- private static int [] yy_unpack(String packed) {
- int [] trans = new int[11055];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 3734) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do trans[j++] = value; while (--count > 0);
- }
- return trans;
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 1372) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
- /**
- * user method - skeleton.sed
- */
- protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
- for(int j = 0; j < fBlockMarkers.size(); j++) {
- BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
- if(marker.getTagName().length() == tagnameLength) {
- boolean matchesSoFar = true;
- for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().charAt(i) != markerTagName[i + offset])
- matchesSoFar = false;
- }
- else {
- if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
- matchesSoFar = false;
- }
- }
- if(matchesSoFar)
- return true;
- }
- }
- return false;
- }
-
- /**
- * user method - skeleton.sed
- *
- * Return ALL of the regions scannable within the remaining text
- * Note: for verification use
- */
- public final List getRegions() {
- List tokens = new ArrayList();
- ITextRegion region = null;
- try {
- region = getNextToken();
- while(region != null) {
- if (region != null) {
- tokens.add(region);
- }
- region = getNextToken();
- }
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- // Since this is convenience method and NOT the recommended
- // way of getting tokens, many errors are simply hidden
- Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
- }
- return tokens;
- }
- /**
- * user method - skeleton.sed
- */
- private final void dump(String s) {
- if (Debug.debugTokenizer) {
- System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
- (yylength() + yychar) + "):\'" +//$NON-NLS-1$
- StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
- }
- }
- /* user method - skeleton.sed */
- public final boolean isEOF() {
- return yy_atEOF;
- }
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
- Iterator blocks = fBlockMarkers.iterator();
- while(blocks.hasNext()) {
- BlockMarker marker = (BlockMarker)blocks.next();
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().equals(markerTagName))
- return true;
- }
- else {
- if(marker.getTagName().equalsIgnoreCase(markerTagName))
- return true;
- }
- }
- return false;
-}
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- // do nothing, this is the downstream parser's job
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- boolean yy_counted = false;
- for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos;
- yy_currentPos++) {
- switch (yy_buffer[yy_currentPos]) {
- case '\r':
- yyline++;
- yy_counted = true;
- break;
- case '\n':
- if (yy_counted)
- yy_counted = false;
- else {
- yyline++;
- }
- break;
- default:
- yy_counted = false;
- }
- }
-
- if (yy_counted) {
- if ( yy_advance() == '\n' ) yyline--;
- if ( !yy_atEOF ) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- yy_state = yy_lexical_state;
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
- if (yy_next == -1) break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = YY_ATTRIBUTE[yy_state];
- if ( (yy_attributes & 1) > 0 ) {
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( (yy_attributes & 8) > 0 ) break yy_forAction;
- }
-
- }
- }
-
-
- switch (yy_action) {
-
- case 291:
- {
- if(Debug.debugTokenizer)
- dump("XSL processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 293: break;
- case 283:
- case 285:
- case 286:
- {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
- }
- case 294: break;
- case 276:
- {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
- }
- case 295: break;
- case 275:
- {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
- }
- case 296: break;
- case 274:
- {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
- }
- case 297: break;
- case 268:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
- case 298: break;
- case 267:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
- case 299: break;
- case 263:
- case 273:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 300: break;
- case 237:
- {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
- }
- case 301: break;
- case 234:
- {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
- }
- case 302: break;
- case 215:
- case 216:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 303: break;
- case 214:
- {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
- }
- case 304: break;
- case 213:
- {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
- }
- case 305: break;
- case 212:
- {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
- }
- case 306: break;
- case 209:
- {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
- }
- case 307: break;
- case 160:
- case 174:
- case 182:
- {
- return XML_DOCTYPE_INTERNAL_SUBSET;
- }
- case 308: break;
- case 148:
- {
- yybegin(YYINITIAL);
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
- return XML_EMPTY_TAG_CLOSE;
- }
- case 309: break;
- case 133:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 310: break;
- case 132:
- {
- // ended with nothing inside
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 311: break;
- case 128:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 312: break;
- case 120:
- {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
- }
- case 313: break;
- case 119:
- {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
- }
- case 314: break;
- case 63:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 315: break;
- case 57:
- case 59:
- case 60:
- case 61:
- case 137:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 316: break;
- case 56:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 317: break;
- case 55:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 318: break;
- case 51:
- case 52:
- case 53:
- {
- // block scan until close is found
- return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
- case 319: break;
- case 50:
- {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
- }
- case 320: break;
- case 46:
- case 47:
- case 48:
- case 49:
- case 129:
- case 130:
- case 131:
- case 217:
- case 239:
- case 240:
- case 252:
- case 253:
- case 262:
- case 272:
- case 280:
- case 284:
- case 287:
- case 288:
- case 289:
- case 290:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
- }
- case 321: break;
- case 41:
- case 42:
- {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
- }
- case 322: break;
- case 40:
- {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 323: break;
- case 0:
- case 31:
- case 122:
- case 124:
- case 207:
- case 208:
- case 236:
- {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
- }
- case 324: break;
- case 5:
- case 8:
- case 9:
- case 10:
- case 12:
- case 13:
- case 14:
- case 15:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 28:
- case 45:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 325: break;
- case 16:
- case 71:
- {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_CONTENT;
- }
- case 326: break;
- case 27:
- case 106:
- case 107:
- case 193:
- case 229:
- case 248:
- case 259:
- case 269:
- case 277:
- case 281:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
- }
- case 327: break;
- case 29:
- case 113:
- case 114:
- case 204:
- case 233:
- case 250:
- case 260:
- case 270:
- case 278:
- case 282:
- {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
- }
- case 328: break;
- case 32:
- case 72:
- case 83:
- {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- case 329: break;
- case 33:
- case 34:
- case 37:
- case 38:
- case 39:
- case 43:
- case 44:
- case 54:
- case 58:
- case 62:
- case 64:
- case 68:
- case 74:
- case 80:
- case 85:
- case 86:
- case 87:
- case 88:
- case 90:
- case 91:
- case 93:
- case 98:
- case 103:
- case 110:
- {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
- }
- case 330: break;
- case 35:
- case 36:
- {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- String blockContext = doBlockScan("]]>", XML_CDATA_TEXT, ST_CDATA_END);//$NON-NLS-1$
- if(blockContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return blockContext;
- }
- case 331: break;
- case 65:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 332: break;
- case 66:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 333: break;
- case 67:
- case 69:
- case 70:
- case 145:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 334: break;
- case 73:
- {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- if(isBlockMarker()) {
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
- return XML_TAG_CLOSE;
- }
- case 335: break;
- case 75:
- case 76:
- {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 336: break;
- case 77:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 337: break;
- case 78:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 338: break;
- case 79:
- case 81:
- case 82:
- case 152:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 339: break;
- case 84:
- {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 340: break;
- case 89:
- {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
- }
- case 341: break;
- case 92:
- case 94:
- case 95:
- case 96:
- case 166:
- case 167:
- case 170:
- case 171:
- case 224:
- {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
- case 342: break;
- case 97:
- case 99:
- case 100:
- case 101:
- case 178:
- {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
- case 343: break;
- case 102:
- case 104:
- case 105:
- case 186:
- case 187:
- case 190:
- case 191:
- case 227:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
- }
- case 344: break;
- case 108:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 345: break;
- case 109:
- case 111:
- case 112:
- case 197:
- case 198:
- case 201:
- case 202:
- case 231:
- {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
- }
- case 346: break;
- case 115:
- {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 347: break;
- case 118:
- {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
- }
- case 348: break;
- case 116:
- case 117:
- {
- return doBlockTagScan();
- }
- case 349: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- return null;
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
deleted file mode 100644
index 020e3e72a1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
+++ /dev/null
@@ -1,1332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.xml.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-%%
-
-%{
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList();
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private XMLParserRegionFactory fRegionFactory = new XMLParserRegionFactory();
-/**
- * user method
- */
-public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
-}
-/* user method */
-public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
-}
-/* user method */
-public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
-}
-/* user method */
-public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
-}
-/* user method */
-public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
-}
-/* user method */
-public List getBlockMarkers() {
- return fBlockMarkers;
-}
-/* user method */
-public final int getOffset() {
- return fOffset + yychar;
-}
-private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
-}
-private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
-}
-/**
- * user method
- */
-public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
-}
-/**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
-public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
-}
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
-
- // safety check for array accesses (yy_currentPos is the *last* character we can check against)
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength; i++) {
- if(same && fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else if(same && !fIsCaseSensitiveBlocking)
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
-}
-/**
- * user method
- *
- * A generic lookahead-like operation
- */
-private final String doBlockScan(String target, String targetContext, int immediateFallbackState) throws IOException {
- return doScan(target, false, targetContext, immediateFallbackState, immediateFallbackState);
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
-/**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
-public final ITextRegion getNextToken() throws IOException {
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- }
- else {
- context = primGetNextToken();
- if (context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
-}
-/* user method */
-public XMLTokenizer(){
- super();
-}
-/* user method */
-public XMLTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
-}
-/* user method */
-public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
-}
-/* user method */
-public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
-}
-/* user method */
-public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
-}
-/* user method */
-public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
-}
-/* user method */
-public void reset(java.io.Reader in) {
- reset(in, 0);
-}
-/**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
-public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- //yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- //yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-}
-
- /**
- * user method
- *
- */
- public BlockTokenizer newInstance() {
- XMLTokenizer newInstance = new XMLTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- return newInstance;
- }
-/* user method */
-private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-}
-%}
-
-%eof{
-// do nothing, this is the downstream parser's job
-%eof}
-
-%public
-%class XMLTokenizer
-%implements BlockTokenizer, DOMRegionContext
-%function primGetNextToken
-%type String
-%char
-%unicode
-%pack
-
-%state ST_CDATA_TEXT
-%state ST_CDATA_END
-%state ST_XML_COMMENT
-%state ST_XML_COMMENT_END
-%state ST_PI
-%state ST_PI_WS
-%state ST_PI_CONTENT
-%state ST_XML_PI_ATTRIBUTE_NAME
-%state ST_XML_PI_EQUALS
-%state ST_XML_PI_ATTRIBUTE_VALUE
-%state ST_XML_PI_TAG_CLOSE
-%state ST_DHTML_ATTRIBUTE_NAME
-%state ST_DHTML_EQUALS
-%state ST_DHTML_ATTRIBUTE_VALUE
-%state ST_DHTML_TAG_CLOSE
-
-// normal tag states
-%state ST_XML_TAG_NAME
-%state ST_XML_ATTRIBUTE_NAME
-%state ST_XML_EQUALS
-%state ST_XML_ATTRIBUTE_VALUE
-
-// declaration (DTD) states
-%state ST_XML_DECLARATION
-%state ST_XML_DECLARATION_CLOSE
-
-%state ST_XML_DOCTYPE_DECLARATION
-%state ST_XML_DOCTYPE_EXTERNAL_ID
-%state ST_XML_DOCTYPE_ID_PUBLIC
-%state ST_XML_DOCTYPE_ID_SYSTEM
-
-%state ST_XML_ELEMENT_DECLARATION
-%state ST_XML_ELEMENT_DECLARATION_CONTENT
-
-%state ST_XML_ATTLIST_DECLARATION
-%state ST_XML_ATTLIST_DECLARATION_CONTENT
-
-%state ST_BLOCK_TAG_SCAN
-
-// Letter = ([A-Za-z])
-// Digit = ([0-9])
-
-/**
- * smaller tokens
- */
-genericTagOpen = <
-genericTagClose = >
-genericEndTagOpen = <\/
-genericEmptyTagClose = \/>
-
-PIstart = <\?
-PIend = \?>
-
-
-// [1] document ::= prolog element Misc*
-document = ({prolog} {element} {Misc}*)
-
-// [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //Char = (.)
-Char = [\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]+
-
-// [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
-NameChar = ({Letter} | {Digit} | \. | \- | _ | : | {CombiningChar} | {Extender})
-
-// [5] Name ::= (Letter | '_' | ':') NameChar*
-//Name = ({NameChar}{NameChar}*)
-Name = ({Letter} | _ | :){NameChar}*
-
-// [6] Names ::= {Name} ({S} {Name})*
-Names = ({Name} ({S} {Name})*)
-
-// [7] Nmtoken ::= (NameChar)+
-Nmtoken = ({NameChar}+)
-
-// [8] Nmtokens ::= Nmtoken (S Nmtoken)*
-Nmtokens = ({Nmtoken} ({S} {Nmtoken})*)
-
-// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
-EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" | \' ([^%&\'] | {PEReference} | {Reference})* \')
-
-// [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
-AttValue = ( \" ([^\"] | {Reference})* \" | \' ([^\'] | {Reference})* \' | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )
-
-// [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
-SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \'))
-
-// [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
-PubidLiteral = (\" {PubidChar}* \" | \' ({PubidChar}\')* "'")
-
-// [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
-PubidChar = ([\040\015\012] | [a-zA-Z0-9] | [\-\'()\+,.\/:=?;!\*#@\$_%])
-
-// [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
-// implement lookahead behavior during action definition
-CharData = ([^<&(\]\]>)]*)
-
-// [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
-CommentStart = (<!\-\-)
-CommentEnd = (\-\->)
-Comment = ({CommentStart}.*{CommentEnd})
-
-// [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
-PI = (<\?{PITarget} {Char}* \?>)
-
-// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
-PITarget = ({Name}((X|x)(M|m)(L|l)))
-
-// [18] CDSect ::= CDStart CData CDEnd
-CDSect = ({CDStart}{CData}{CDEnd})
-
-// [19] CDStart ::= '<![CDATA['
-CDStart = <!\[CDATA\[
-
-// [20] CData ::= (Char* - (Char* ']]>' Char*))
-// implement lookahead behavior during action definition
-CData = ([^(\]\]>)]*)
-
-// [21] CDEnd ::= ']]>'
-CDEnd = (\]\]>)
-
-// [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
-prolog = ({XMLDecl}? {Misc}* ({doctypedecl} {Misc}*)?)
-
-// [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
-XMLDecl = (<\?xml {VersionInfo} {EncodingDecl}? {SDDecl}? {S}? \?>)
-
-// [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
-VersionInfo = ({S}version{Eq}(\'{VersionNum}\' | \"{VersionNum}\"))
-
-// [25] Eq ::= S? '=' S?
-Eq = (\=)
-
-// [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
-VersionNum = (([a-zA-Z0-9_.:]|\-)+)
-
-// [27] Misc ::= Comment | PI | S
-Misc = ({Comment} | {PI} | {S})
-
-// [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
-doctypedecl = (<\!DOCTYPE{S}{Name} ({S}{ExternalID})? {S}? (\[ ({markupdecl}|{PEReference}|{S})* \]{S}?)?>)
-
-// [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
-markupdecl = ({elementdecl} | {AttlistDecl} | {EntityDecl} | {NotationDecl} | {PI} | {Comment})
-
-// [30] extSubset ::= TextDecl? extSubsetDecl
-extSubset = ({TextDecl}? {extSubsetDecl})
-
-// [31] extSubsetDecl ::= ( markupdecl | conditionalSect | PEReference | S )*
-extSubsetDecl = (( {markupdecl} | {conditionalSect} | {PEReference} | {S} )*)
-
-// [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
-SDDecl = ({S}standalone{Eq}{S}*((\'(yes|no)\')|(\"(yes|no)\")))
-
-// [33] LanguageID ::= Langcode ('-' Subcode)*
-LanguageID = ({Langcode}(\-{Subcode})*)
-
-// [34] Langcode ::= ISO639Code | IanaCode | UserCode
-Langcode = ({ISO639Code} | {IanaCode} | {UserCode})
-
-// [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
-ISO639Code = (([a-z]|[A-Z])([a-z]|[A-Z]))
-
-// [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
-IanaCode = ((i|I)\-([a-z]|[A-Z])+)
-
-// [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
-UserCode = ((x|X)\-([a-z]|[A-Z])+)
-
-// [38] Subcode ::= ([a-z] | [A-Z])+
-Subcode = (([a-z]|[A-Z])+)
-
-// [39] element ::= EmptyElemTag | STag content ETag
-element = ({EmptyElemTag} | {STag} {content} {ETag})
-
-// [40] STag ::= '<' Name (S Attribute)* S? '>'
-STag = (<{Name}({S}{Attribute})*{S}?>)
-
-// [41] Attribute ::= Name Eq AttValue
-Attribute = ({Name}{S}*{Eq}{S}*{AttValue})
-
-// [42] ETag ::= 'Name S? '>'
-ETag = (<\/{Name}{S}?>)
-
-// [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
-content = (({element} | {CharData} | {Reference} | {CDSect} | {PI} | {Comment})*)
-
-// [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
-EmptyElemTag = (<{Name}({S}{Attribute})*{S}?\/>)
-
-// [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
-elementdecl = (<\!ELEMENT{S}{Name}{S}{contentspec}{S}?>)
-
-// [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
-contentspec = (EMPTY|ANY|{Mixed}|{children})
-
-// [47] children ::= (choice | seq) ('?' | '*' | '+')?
-children = (({choice}|{seq})(\?|\*|\+)?)
-
-// CAUSES LOOP THROUGH DEFS OF CHOICE AND SEQ
-// [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
-cp = (({Name} | {choice} | {seq}) (\?|\*|\+)?)
-
-// [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
-// choice = \({S}?{cp}({S}?\|{S}?{cp})*{S}?\)
-choice = \({S}?{Name}({S}?\|{S}?{Name})*{S}?\)
-
-// [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
-// seq = (\({S}?{cp}({S}?\,{S}?{cp})*{S}?\))
-seq = (\({S}?{Name}({S}?\,{S}?{Name})*{S}?\))
-
-// [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'
-Mixed = ({S}?\#PCDATA({S}?\|{S}?{Name})*{S}?)*\|({S}?\#PCDATA{S}?)
-
-// [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
-AttlistDecl = (<\!ATTLIST{S}{Name}{AttDef}*{S}?>)
-
-// [53] AttDef ::= S Name S AttType S DefaultDecl
-AttDef = ({S}{Name}{S}{AttType}{S}{DefaultDecl})
-
-// [54] AttType ::= StringType | TokenizedType | EnumeratedType
-AttType = ({StringType} | {TokenizedType} | {EnumeratedType})
-
-// [55] StringType ::= 'CDATA'
-StringType = (CDATA)
-
-// [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
-TokenizedType = (ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS)
-
-// [57] EnumeratedType ::= NotationType | Enumeration
-EnumeratedType = ({NotationType} | {Enumeration})
-
-// [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
-NotationType = (NOTATION{S}\({S}?{Name}({S}?\|{S}?{Name})*{S}?\))
-
-// [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
-Enumeration = (\({S}?{Nmtoken}({S}?\|{S}?{Nmtoken})*{S}?\))
-
-// [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
-DefaultDecl = (\#REQUIRED|\#IMPLIED|((\#FIXED{S})?{AttValue}))
-
-// [61] conditionalSect ::= includeSect | ignoreSect
-conditionalSect = ({includeSect} | {ignoreSect})
-
-// [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
-includeSect = (<\!\[{S}?INCLUDE{S}?\[{extSubsetDecl}\]\]>)
-
-// [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
-ignoreSect = (<\!\[{S}?IGNORE{S}?\[{ignoreSectContents}*\]\]>)
-
-// [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
-ignoreSectContents = ({Ignore}(<\!\[{ignoreSectContents}\]\]>{Ignore})*)
-
-// [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
-Ignore = ([^(\<\!\[|\]\]\>)]*)
-
-// [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
-CharRef = (&#[0-9]+;|&#x[0-9a-fA-F]+;)
-
-// [67] Reference ::= EntityRef | CharRef
-Reference = ({EntityRef} | {CharRef})
-
-// [68] EntityRef = '&' Name ';'
-EntityRef = (&{Name};)
-
-// [69] PEReference ::= '%' Name ';'
-PEReference = (%{Name};)
-
-// [70] EntityDecl ::= GEDecl | PEDecl
-EntityDecl = ({GEDecl} | {PEDecl})
-
-// [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
-GEDecl = (<\!ENTITY{S}{Name}{S}{EntityDef}{S}?>)
-
-// [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
-PEDecl = (<\!ENTITY{S}\%{S}{Name}{S}{PEDef}{S}?>)
-
-// [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
-EntityDef = ({EntityValue} | ({ExternalID}{NDataDecl}?))
-
-// [74] PEDef ::= EntityValue | ExternalID
-PEDef = ({EntityValue} | {ExternalID})
-
-// [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
-ExternalID = (SYSTEM{S}{SystemLiteral}|PUBLIC{S}{PubidLiteral}{S}{SystemLiteral} )
-
-// [76] NDataDecl ::= S 'NDATA' S Name
-NDataDecl = ({S}NDATA{S}{Name})
-
-// [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
-TextDecl = (<\?xml{VersionInfo}?{EncodingDecl}{S}?\?>)
-
-// [78] extParsedEnt ::= TextDecl? content
-extParsedEnt = ({TextDecl}?{content})
-
-// [79] extPE ::= TextDecl? extSubsetDecl
-extPE = ({TextDecl}?{extSubsetDecl})
-
-// [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
-EncodingDecl = ({S}encoding{S}*{Eq}{S}*(\"{EncName}\"|\'{EncName}\'))
-
-// [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
-EncName = ([A-Za-z]([A-Za-z0-9._]|\-)*)
-
-// [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
-NotationDecl = (<\!NOTATION{S}{Name}{S}({ExternalID}|{PublicID}){S}?>)
-
-// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-PublicID = (PUBLIC{S}{PubidLiteral})
-
-// [84] Letter ::= BaseChar | Ideographic
-Letter = ({BaseChar} | {Ideographic})
-
-// [85] BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6]
-// | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131]
-// | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
-// | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5]
-// | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386
-// | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE]
-// | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0
-// | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F]
-// | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4]
-// | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB]
-// | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559
-// | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2]
-// | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7]
-// | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5
-// | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961]
-// | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8]
-// | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD]
-// | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A]
-// | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30]
-// | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]
-// | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B]
-// | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0]
-// | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0
-// | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28]
-// | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D
-// | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
-// | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C
-// | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA]
-// | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C]
-// | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33]
-// | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C]
-// | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3]
-// | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C]
-// | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39]
-// | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
-// | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88]
-// | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F]
-// | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
-// | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD
-// | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69]
-// | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103]
-// | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112]
-// | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150
-// | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165
-// | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175
-// | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8]
-// | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9
-// | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15]
-// | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D]
-// | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D]
-// | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4]
-// | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB]
-// | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126
-// | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094]
-// | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]
-BaseChar = [\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-// [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-// [87] CombiningChar ::= [#x0300-#x0345] | [#x0360-#x0361]
-// | [#x0483-#x0486] | [#x0591-#x05A1] | [#x05A3-#x05B9]
-// | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4
-// | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF]
-// | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED]
-// | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D
-// | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC
-// | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8]
-// | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C
-// | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48]
-// | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC
-// | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD]
-// | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48]
-// | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83]
-// | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD] | #x0BD7
-// | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48]
-// | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83]
-// | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD]
-// | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43]
-// | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] | #x0D57 | #x0E31
-// | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9]
-// | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35
-// | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84]
-// | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD]
-// | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1
-// | [#x302A-#x302F] | #x3099 | #x309A
-CombiningChar = [\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-// [88] Digit ::= [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9]
-// | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F]
-// | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF]
-// | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F]
-// | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]
-Digit = [\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-// [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46
-// | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E]
-// | [#x30FC-#x30FE]
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-%%
-
-
-/* white space within a tag */
-<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-
-// BEGIN REGULAR XML
-/* handle opening a new tag almost anywhere */
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_DECLARATION, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
-}
-
-/* unquoted */
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
-}
-/* the tag's name was found, start scanning for attributes */
-<ST_XML_TAG_NAME> {Name} {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-/* another attribute name was found, resume looking for the equals sign */
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-/* an equal sign was found, what's next is the value */
-<ST_XML_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-/* allow for unbalanced quotes, mostly a duplicate of the AttValue rule */
-<ST_XML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-
-
-/* the tag's close was found */
-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- if(isBlockMarker()) {
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
- return XML_TAG_CLOSE;
-}
-/* the tag's close was found, but the tag doesn't need a matching end tag */
-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericEmptyTagClose} {
- yybegin(YYINITIAL);
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
- return XML_EMPTY_TAG_CLOSE;
-}
-
-<ST_XML_TAG_NAME> [^</>\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029]* {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_CONTENT;
-}
-
-// END REGULAR XML
-
-
-// XML Comments
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {CommentStart} {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
-}
-<ST_XML_COMMENT> .|\r|\n {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
-}
-
-<ST_XML_COMMENT_END> {CommentEnd} {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
-}
-
-// XML misc
-
-{CDStart} {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
-}
-<ST_CDATA_TEXT> .|\r|\n {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- String blockContext = doBlockScan("]]>", XML_CDATA_TEXT, ST_CDATA_END);//$NON-NLS-1$
- if(blockContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return blockContext;
-}
-<ST_CDATA_END> {CDEnd} {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
-}
-
-<YYINITIAL> {PEReference} {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
-}
-<YYINITIAL> {CharRef} {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
-}
-<YYINITIAL> {EntityRef} {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
-}
-
-<YYINITIAL> {PIstart} {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
-}
-// the next four are order dependent
-<ST_PI> ((X|x)(M|m)(L|l)) {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> ([iI][mM][pP][oO][rR][tT]{S}*) {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> xml-stylesheet {
- if(Debug.debugTokenizer)
- dump("XSL processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
-}
-<ST_PI> {Name} {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
-}
-<ST_PI_WS> {S}+ {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
-}
-<ST_PI, ST_PI_WS> \?> {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-<ST_PI_CONTENT> . {
- // block scan until close is found
- return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
-}
-<ST_PI_CONTENT,ST_XML_PI_TAG_CLOSE> \?> {
- // ended with nothing inside
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-<ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_XML_PI_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_PI_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* the PI's close was found */
-<ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE> {PIend} {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-// DHTML
-<ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_EQUALS> {Name} {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_DHTML_EQUALS> {Eq} {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_DHTML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* The DHTML PI's close was found */
-<ST_DHTML_EQUALS, ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_ATTRIBUTE_VALUE> [/]*> {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
-}
-
-// XML declarations
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen}! {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
-}
-<ST_XML_DECLARATION> [Ee][Ll][Ee][Mm][Ee][Nn][Tt] {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
-}
-<ST_XML_DECLARATION> [Dd][Oo][Cc][Tt][Yy][Pp][Ee] {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
-}
-<ST_XML_DECLARATION> [Aa][Tt][Tt][Ll][Ii][Ss][Tt] {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
-}
-
-// begin DOCTYPE handling procedure
-<ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DECLARATION_CLOSE> \[[^\]]*\] {
- return XML_DOCTYPE_INTERNAL_SUBSET;
-}
-
-<ST_XML_DOCTYPE_DECLARATION> {Name} {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Pp][Uu][Bb][Ll][Ii][Cc] {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Ss][Yy][Ss][Tt][Ee][Mm] {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
-}
-<ST_XML_DOCTYPE_ID_PUBLIC> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-}
-<ST_XML_DOCTYPE_ID_SYSTEM> {AttValue}|{SystemLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-}
-// end DOCTYPE handling
-
-// begin ELEMENT handling procedure
-<ST_XML_ELEMENT_DECLARATION> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
-}
-<ST_XML_ELEMENT_DECLARATION_CONTENT> [^>]* {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
-}
-
-<ST_XML_ELEMENT_DECLARATION_CONTENT> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end ELEMENT handling
-
-// begin ATTLIST handling procedure
-<ST_XML_ATTLIST_DECLARATION> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
-}
-<ST_XML_ATTLIST_DECLARATION_CONTENT> [^>]* {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
-}
-
-<ST_XML_ATTLIST_DECLARATION_CONTENT> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end ATTLIST handling
-
-<ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_ATTLIST_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID> {genericTagClose} {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
-}
-// end DECLARATION handling
-
-<YYINITIAL> [^<&%]*|[&%]{S}+{Name}[^&%<]*|[&%]{Name}([^;&%<]*|{S}+;*) {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
-}
-
-<YYINITIAL> (%)+ {
- if(Debug.debugTokenizer)
- dump("non-reference %");//$NON-NLS-1$
- return XML_CONTENT;
-}
-
-<ST_BLOCK_TAG_SCAN> .|\r|\n {
- return doBlockTagScan();
- }
-
-. {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
-}
-
-\040 {
- if(Debug.debugTokenizer)
- dump("SPACE");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\011 {
- if(Debug.debugTokenizer)
- dump("0x9");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\015
-{
- if(Debug.debugTokenizer)
- dump("CARRIAGE RETURN");//$NON-NLS-1$
- return WHITE_SPACE;
-}
-\012 {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd
deleted file mode 100644
index 59e811c813..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-cmd /c flexx.cmd
-cmd /c flexj.cmd
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh
deleted file mode 100644
index 5cb6e3bbe6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-export PATH=$PATH:/opt/IBMJava2-131/bin/:/opt/IBMJava2-13/bin/:/opt/jdk1.4
-java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main JSPTokenizer.jflex -skel skeleton.sse
-java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main XMLTokenizer.jflex -skel skeleton.sse
-rm -f JSPTokenizer.java~ JSPTokenizer~ XMLTokenizer.java~ XMLTokenizer~
-cp -v XMLTokenizer.java ../../../../sedmodel/com/ibm/sed/parser/internal
-cp -v JSPTokenizer.java ../../../../sedmodel/com/ibm/sed/parser/internal
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd
deleted file mode 100644
index e010e35530..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-PATH=%PATH%;d:\jdk6_01\bin
-java -Xmx470000000 -cp d:\JFlex\1.2.2\lib\JFlex.jar;. JFlex.Main JSPTokenizer.jflex -skel skeleton.sse && rm -f JSPTokenizer.java~ JSPTokenizer~ && copy JSPTokenizer.java ..\..\..\..\..\org.eclipse.jst.jsp.core\src\org\eclipse\jst\jsp\core\internal\parser\\internal\JSPTokenizer.java
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd
deleted file mode 100644
index fcb1f810cf..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-PATH=%PATH%;c:\jdk1.4.2_08\bin
-java -Xmx470000000 -cp d:\JFlex\1.2.2\lib\JFlex.jar;. JFlex.Main XMLTokenizer.jflex -skel skeleton.sse && rm -f XMLTokenizer.java~ XMLTokenizer~ && copy XMLTokenizer.java ..\..\..\..\..\org.eclipse.wst.xml.core\src\org\eclipse\wst\xml\core\internal\parser\XMLTokenizer.java
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
deleted file mode 100644
index 3e1d3c484d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
+++ /dev/null
@@ -1,351 +0,0 @@
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
---- lexical states, charmap
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- // final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
---- isFinal list
- /** 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;
-
---- user class code
-
- /**
- * 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.
- */
---- constructor declaration
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
- /**
- * user method - skeleton.sed
- */
- protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
- for(int j = 0; j < fBlockMarkers.size(); j++) {
- BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
- if(marker.getTagName().length() == tagnameLength) {
- boolean matchesSoFar = true;
- for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().charAt(i) != markerTagName[i + offset])
- matchesSoFar = false;
- }
- else {
- if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
- matchesSoFar = false;
- }
- }
- if(matchesSoFar)
- return true;
- }
- }
- return false;
- }
-
- /**
- * user method - skeleton.sed
- *
- * Return ALL of the regions scannable within the remaining text
- * Note: for verification use
- */
- public final List getRegions() {
- List tokens = new ArrayList();
- ITextRegion region = null;
- try {
- region = getNextToken();
- while(region != null) {
- if (region != null) {
- tokens.add(region);
- }
- region = getNextToken();
- }
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- // Since this is convenience method and NOT the recommended
- // way of getting tokens, many errors are simply hidden
- Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
- }
- return tokens;
- }
- /**
- * user method - skeleton.sed
- */
- private final void dump(String s) {
- if (Debug.debugTokenizer) {
- System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
- (yylength() + yychar) + "):\'" +//$NON-NLS-1$
- StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
- }
- }
- /* user method - skeleton.sed */
- public final boolean isEOF() {
- return yy_atEOF;
- }
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
- Iterator blocks = fBlockMarkers.iterator();
- while(blocks.hasNext()) {
- BlockMarker marker = (BlockMarker)blocks.next();
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().equals(markerTagName))
- return true;
- }
- else {
- if(marker.getTagName().equalsIgnoreCase(markerTagName))
- return true;
- }
- }
- return false;
-}
-
---- yy_doEof
- /**
- * 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
- */
---- yylex declaration
- int yy_input;
- int yy_action;
-
---- local declarations
-
- while (true) {
-
---- start admin (line, char, col count)
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
---- start admin (lexstate etc)
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
---- line, col, char count, next transition, isFinal action
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
---- line count update
- }
-
- }
- }
-
---- char count update
-
- switch (yy_action) {
-
---- actions
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
---- eofvalue
- }
- else {
---- no match
- }
- }
- }
- }
-
---- main
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme
deleted file mode 100644
index eb89700a6d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme
+++ /dev/null
@@ -1,6 +0,0 @@
-The skeleton.sed file contains the modified JFlex 1.2.2 skeleton file with
-changes for use with the tokenizers within the org.eclipse.wst.sse.core.xml and
-org.eclipse.wst.sse.core.jsp plugins.
-
-The skeleton file's method definitions are copied into the generated output
-directly.
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml
deleted file mode 100644
index bfd83de19f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="CSSTokenizer">
- <target name="init" depends="properties">
- <property name="workspace.dir" value="../.."/>
- <property name="jflex.jar" value="/DevTimeSupport/JFlex/lib/sed-jflex.jar"/>
- <property name="jflex.maxmemory" value="470000000"/>
- <property name="jflex.opt" value="-skel SedModel/HTMLTokenizer/devel/skeleton.sse"/>
- </target>
-
- <target name="properties" if="eclipse.running">
- <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
- </target>
-
- <target name="CSSTokenizer" depends="init">
- <property name="src.dir" value="SedModel/CSSTokenizer/devel"/>
- <property name="src.file" value="CSSTokenizer.jflex"/>
- <property name="dest.dir" value="org.eclipse.wst.sse.core.css/src/com/ibm/sse/model/css/internal/parser"/>
- <property name="finaldest.dir" value="org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser"/>
- <antcall target="build-tokenizer">
- <param name="jflex.opt" value=""/>
- </antcall>
- </target>
-
- <target name="XMLTokenizer" depends="init">
- <property name="src.dir" value="SedModel/HTMLTokenizer/devel"/>
- <property name="src.file" value="XMLTokenizer"/>
- <property name="dest.dir" value="org.eclipse.wst.sse.core.xml/src/com/ibm/sse/model/xml/internal/parser"/>
- <antcall target="build-tokenizer"/>
- </target>
-
- <target name="JSPTokenizer" depends="init">
- <property name="src.dir" value="SedModel/HTMLTokenizer/devel"/>
- <property name="src.file" value="JSPTokenizer.jflex"/>
- <property name="dest.dir" value="org.eclipse.wst.sse.core.jsp/src/com/ibm/sse/model/jsp/parser/internal"/>
- <antcall target="build-tokenizer"/>
- </target>
-
- <target name="build-tokenizer" depends="init">
- <antcall target="run-jflex"/>
- <antcall target="copy"/>
- <antcall target="clean"/>
- </target>
-
- <target name="run-jflex" depends="init">
- <java classname="JFlex.Main" maxmemory="${jflex.maxmemory}" fork="yes" >
- <arg line="${src.dir}/${src.file} ${jflex.opt}"/>
- <classpath>
- <pathelement location="${jflex.jar}"/>
- </classpath>
- </java>
- </target>
-
- <target name="copy" depends="init">
- <copy todir="${workspace.dir}/${dest.dir}" overwrite="true" verbose="true">
- <fileset dir="${src.dir}">
- <include name="*.java"/>
- </fileset>
- </copy>
- <copy todir="${workspace.dir}/${finaldest.dir}" overwrite="true" verbose="true">
- <fileset dir="${src.dir}">
- <include name="*.java"/>
- </fileset>
- </copy>
- </target>
-
- <target name="clean" depends="init">
- <delete verbose="true">
- <fileset dir="${src.dir}" defaultexcludes="no">
- <include name="*~"/>
- </fileset>
- </delete>
- </target>
-
-
-</project> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/devTimeSupportInfo.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/devTimeSupportInfo.txt
deleted file mode 100644
index d8c776e97d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/devTimeSupportInfo.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-This directory, DevTimeSupport, normally contains
-the source for some of our parser generators.
-
-See :pserver:dev.eclipse.org:/cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.core/DevTimeSupport
-
-This particular text file you are reading
-is the only one shipped
-with an SDK build, since the other files
-are seldom needed during development or debugging,
-and some of those files cause problems with long
-filename or paths that end up being too long for
-some platforms, and some unzip programs.
-
diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
deleted file mode 100644
index bee3db0438..0000000000
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,54 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.602.qualifier
-Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.core,
- org.eclipse.wst.sse.core.indexing,
- org.eclipse.wst.sse.core.internal;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.cleanup;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.encoding;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.encoding.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.exceptions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.filebuffers;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.format;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.ltk.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.ltk.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.model;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.modelhandler;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.parser;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.preferences;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.document;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.events;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.exceptions;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.model;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.provisional.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.tasks;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.text;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.text.rules;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.undo;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.util;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.internal.validate;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.core.text,
- org.eclipse.wst.sse.core.utils,
- org.eclipse.wst.sse.internal.contentproperties;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui"
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.text;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
- org.eclipse.core.jobs;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.emf.common;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)";resolution:=optional,
- org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)",
- org.eclipse.osgi.services;bundle-version="3.2.0"
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.sse.core.internal.propertytester"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.sse.core/README.txt b/bundles/org.eclipse.wst.sse.core/README.txt
deleted file mode 100644
index 4eb3ccf1e1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The core model of the sse framework. It provides the base document classes,
-builders and parsers. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/about.html b/bundles/org.eclipse.wst.sse.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/build.properties b/bundles/org.eclipse.wst.sse.core/build.properties
deleted file mode 100644
index 37541b2ec9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/build.properties
+++ /dev/null
@@ -1,34 +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
-#
-###############################################################################
-source.. = src-encoding/,\
- src/,\
- src-tasktags/,\
- src-contentproperties/
-bin.includes = plugin.xml,\
- plugin.properties,\
- .options,\
- config/,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = schema/,\
- doc/,\
- component.xml,\
- DevTimeSupport/
-output.. = bin/
-src.excludes = DevTimeSupport/build.xml,\
- DevTimeSupport/SedModel/,\
- DevTimeSupport/HeadParsers/
diff --git a/bundles/org.eclipse.wst.sse.core/component.xml b/bundles/org.eclipse.wst.sse.core/component.xml
deleted file mode 100644
index dae223c4c2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/component.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.sse">
- <description url="http://eclipse.org/webtools/wst/components/sse/overview.html"></description>
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.sse.core" fragment="false" />
- <plugin id="org.eclipse.wst.sse.doc.user" fragment="false" />
- <plugin id="org.eclipse.wst.sse.ui" fragment="false" />
- <package name="org.eclipse.wst.sse.ui.views.properties" api="false">
- <type name="PropertySheetConfiguration" subclass="true" instantiate="true" />
- <type name="IPropertySourceExtension" implement="true" />
- </package>
- <package name="org.eclipse.wst.sse.ui" api="false">
- <type name="StructuredTextEditor" subclass="false" instantiate="true" />
- <type name="StructuredTextViewerConfiguration" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.sse.ui.views.contentoutline" api="false">
- <type name="ContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.sse.ui.infopop" fragment="false" />
-</component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/config/charset.properties b/bundles/org.eclipse.wst.sse.core/config/charset.properties
deleted file mode 100644
index 881c97e460..0000000000
--- a/bundles/org.eclipse.wst.sse.core/config/charset.properties
+++ /dev/null
@@ -1,100 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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 number of codeset names
-totalnumber=26
-
-! Only translate the xx.label strings. Do not translate the xx.iana, xx.prefName or xx.java strings.
-
-codeset.0.label=ISO 10646/Unicode(UTF-8)
-codeset.0.iana=UTF-8
-
-codeset.1.label=ISO 10646/Unicode(UTF-16) Big Endian
-codeset.1.iana=UTF-16
-
-codeset.2.label=ISO 10646/Unicode(UTF-16BE) Big Endian
-codeset.2.iana=UTF-16BE
-
-codeset.3.label=ISO 10646/Unicode(UTF-16LE) Little Endian
-codeset.3.iana=UTF-16LE
-
-codeset.4.label=US ASCII
-codeset.4.iana=US-ASCII
-
-codeset.5.label=ISO Latin-1
-codeset.5.iana=ISO-8859-1
-
-codeset.6.label=ISO Latin-9
-codeset.6.iana=ISO-8859-15
-
-! (Slavic: Czech, Croat, German, Hungarian, Polish, Romanian, Slovak, Slovenian)
-codeset.7.label=Central/East European (Slavic)
-codeset.7.iana=ISO-8859-2
-
-! (Esperanto, Galician, Maltese, Turkish)
-codeset.8.label=Southern European
-codeset.8.iana=ISO-8859-3
-
-codeset.9.label=Arabic, Logical
-codeset.9.iana=ISO-8859-6
-
-codeset.10.label=Arabic
-codeset.10.iana=windows-1256
-
-codeset.11.label=Chinese, National Standard
-codeset.11.iana=GB18030
-
-codeset.12.label=Traditional Chinese, Big5
-codeset.12.iana=BIG5
-
-! (Estonian, Latvian, Lithuanian)
-codeset.13.label=Cyrillic, ISO-8859-4
-codeset.13.iana=ISO-8859-4
-
-! (Bulgarian, Byelorussian, Macedonian, Serbian, Ukrainian)
-codeset.14.label=Cyrillic, ISO-8859-5
-codeset.14.iana=ISO-8859-5
-
-codeset.15.label=Greek
-codeset.15.iana=ISO-8859-7
-
-codeset.16.label=Hebrew, Visual
-codeset.16.iana=ISO-8859-8
-
-! label=Hebrew, Logical
-! iana=ISO-8859-8-I
-
-codeset.17.label=Hebrew
-codeset.17.iana=windows-1255
-
-codeset.18.label=Japanese, EUC-JP
-codeset.18.iana=EUC-JP
-
-codeset.19.label=Japanese, ISO 2022
-codeset.19.iana=ISO-2022-JP
-
-codeset.20.label=Japanese, Shift-JIS
-codeset.20.iana=Shift_JIS
-
-codeset.21.label=Japanese, Windows-31J
-codeset.21.iana=Windows-31J
-codeset.21.prefName=windows-31j
-
-codeset.22.label=Korean, EUC-KR
-codeset.22.iana=EUC-KR
-
-codeset.23.label=Korean, ISO 2022
-codeset.23.iana=ISO-2022-KR
-
-codeset.24.label=Thai, TISI
-codeset.24.iana=TIS-620
-
-codeset.25.label=Turkish
-codeset.25.iana=ISO-8859-9
diff --git a/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties b/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties
deleted file mode 100644
index f47ed6ea86..0000000000
--- a/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# This file lists charset mappings between an encoding and its default
-# equivalent encoding listed in charset.properties
-# format: anyname=iana name listed in charset.properties
-
-# No translation necessary
-windows-1252=ISO-8859-1
-windows-932=Shift_JIS
-x-euc-jp-linux=EUC-JP
-windows-949=EUC-KR
-x-windows-949=EUC-KR
-windows-950=BIG5
-x-windows-950=BIG5
-windows-936=GB18030
-x-mswin-936=GB18030
-GB2312=GB18030
-x-EUC-CN=GB18030
diff --git a/bundles/org.eclipse.wst.sse.core/config/override.properties b/bundles/org.eclipse.wst.sse.core/config/override.properties
deleted file mode 100644
index ae703babb1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/config/override.properties
+++ /dev/null
@@ -1,24 +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
-#
-###############################################################################
-# This file lists charset mappings which supplement or override those
-# provided by the VM. There are few cases where this should be required.
-# Note: there is no integrety checking to see if the validCharsetName is indeed
-# valid for a given VM, so errors would only show up when attempted to
-# be used.
-
-# No translation necessary
-
-# format: anyname=validjavaCharsetName
-ISO-8859-8-I=ISO-8859-8
-X-SJIS=Shift_JIS
-X-EUC-JP=Shift_JIS
diff --git a/bundles/org.eclipse.wst.sse.core/doc/book.css b/bundles/org.eclipse.wst.sse.core/doc/book.css
deleted file mode 100644
index 9278cd8a18..0000000000
--- a/bundles/org.eclipse.wst.sse.core/doc/book.css
+++ /dev/null
@@ -1,106 +0,0 @@
-P.Code {
- display: block;
- text-align: left;
- text-indent: 0.00pt;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 15pt;
- font-size: 10.000000pt;
- font-weight: medium;
- font-style: Regular;
- color: #4444CC;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Courier New";
-}
-H6.CaptionFigColumn {
- display: block;
- text-align: left;
- text-indent: 0.000000pt;
- margin-top: 3.000000pt;
- margin-bottom: 11.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
- font-size: 9.000000pt;
- font-weight: medium;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Arial";
-}
-P.Note {
- display: block;
- text-align: left;
- text-indent: 0pt;
- margin-top: 19.500000pt;
- margin-bottom: 19.500000pt;
- margin-right: 0.000000pt;
- margin-left: 30pt;
- font-size: 11.000000pt;
- font-weight: medium;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Arial";
-}
-EM.UILabel {
- font-weight: Bold;
- font-style: Regular;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
-}
-EM.CodeName {
- font-weight: Bold;
- font-style: Regular;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family:"Courier New";
-}
-
-
-
-
-/* following font face declarations need to be removed for DBCS */
-
-body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000}
-pre { font-family: Courier, monospace}
-
-/* end font face declarations */
-
-/* following font size declarations should be OK for DBCS */
-body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; }
-pre { font-size: 10pt}
-
-/* end font size declarations */
-
-body { background: #FFFFFF}
-h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 }
-h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 }
-h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 }
-h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic }
-p { margin-top: 10px; margin-bottom: 10px }
-pre { margin-left: 6; font-size: 9pt }
-a:link { color: #0000FF }
-a:hover { color: #000080 }
-a:visited { text-decoration: underline }
-ul { margin-top: 0; margin-bottom: 10 }
-li { margin-top: 0; margin-bottom: 0 }
-li p { margin-top: 0; margin-bottom: 0 }
-ol { margin-top: 0; margin-bottom: 10 }
-dl { margin-top: 0; margin-bottom: 10 }
-dt { margin-top: 0; margin-bottom: 0; font-weight: bold }
-dd { margin-top: 0; margin-bottom: 0 }
-strong { font-weight: bold}
-em { font-style: italic}
-var { font-style: italic}
-div.revision { border-left-style: solid; border-left-width: thin;
- border-left-color: #7B68EE; padding-left:5 }
-th { font-weight: bold }
diff --git a/bundles/org.eclipse.wst.sse.core/doc/schema.css b/bundles/org.eclipse.wst.sse.core/doc/schema.css
deleted file mode 100644
index 4efbf26728..0000000000
--- a/bundles/org.eclipse.wst.sse.core/doc/schema.css
+++ /dev/null
@@ -1,66 +0,0 @@
-H6.CaptionFigColumn#header {
- font-size:16px;
- display:inline
-}
-
-P.Note#copyright {
- font-size: smaller;
- font-style: normal;
- color: #336699;
- display:inline;
- margin-top: 3.000000pt;
- margin-bottom: 11.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
-}
-
-P.Code#dtd {
- color: #800000;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 10.000000pt;
-}
-
-P.Code#dtdAttlist {
- color: #800000;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 20.000000pt;
-}
-
-P.Code#tag {
- color: #000080;
- display:inline;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
-}
-
-P.Code#cstring {
- color: #008000;
- display:inline;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
-}
-
-.ConfigMarkup#elementDesc {
- color: black;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 10.000000pt;
-}
-
-.ConfigMarkup#attlistDesc {
- color: black;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 32.000000pt;
-}
-
diff --git a/bundles/org.eclipse.wst.sse.core/handyStuff.jpage b/bundles/org.eclipse.wst.sse.core/handyStuff.jpage
deleted file mode 100644
index 6447b4e26a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/handyStuff.jpage
+++ /dev/null
@@ -1 +0,0 @@
- java.util.Enumeration enum = System.getProperties().keys(); String key = null; while (enum.hasMoreElements()){ key = (String)enum.nextElement(); System.out.print(key); for (int i =0;i<(30-key.length());i++)System.out.print(" "); System.out.println("->"+System.getProperty(key)); } \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.properties b/bundles/org.eclipse.wst.sse.core/plugin.properties
deleted file mode 100644
index 1e23274418..0000000000
--- a/bundles/org.eclipse.wst.sse.core/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source Model
-# extension names
-Adapt_On_Create_Factory_Extension.name=Adapt On Create Factory Extension
-Document_Types_Extension.name=Document Types Extension
-JSP_Embedded_Content_Type_Handler_Extension.name=JSP Embedded Content Type Handler Extension
-Content_Type_Factory_Contribution_Extension.name=Content Type Factory Contribution Extension
-CSS_Profile_Extension.name=CSS Profile Extension
-Comment_Element_Handler_Extension.name=Comment Element Handler Extension
-Model_Handler_Extension.name=Model Handler Extension
-Format_Processors_Extension_Point.name=Format Processors Extension Point
-Task_Scanner_Extension_Point.name=Task Scanner Extension Point
-Structured_Sources_Task_Extension.name=Detected Task
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.xml b/bundles/org.eclipse.wst.sse.core/plugin.xml
deleted file mode 100644
index 1b9d769e92..0000000000
--- a/bundles/org.eclipse.wst.sse.core/plugin.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
- <!-- deprecated -->
- <extension-point id="adaptOnCreateFactory" name="%Adapt_On_Create_Factory_Extension.name" schema="schema/adaptOnCreateFactory.exsd"/>
- <!-- not for use by clients (internal)-->
- <extension-point id="documentTypes" name="%Document_Types_Extension.name" schema="schema/documentTypes.exsd"/>
- <!-- not for use by clients (internal)-->
- <extension-point id="embeddedTypeHandler" name="%JSP_Embedded_Content_Type_Handler_Extension.name" schema="schema/embeddedTypeHandler.exsd"/>
- <!-- deprecated -->
- <extension-point id="contentTypeFactoryContribution" name="%Content_Type_Factory_Contribution_Extension.name" schema="schema/contentTypeFactoryContribution.exsd"/>
- <!-- I commented out ... clients should just use the normal platform way of registering these
- adapterFactories. At worst, they'd need a small plugin with 'startup' specified ... but that's
- better than us getting hit with the performance impact (of loading plugins and pre-reqs, etc.).
- <extension-point id="uriResolverAdapterFactory" name="Resource Adapter Factory for Creating URIResolvers"/>
- -->
- <!-- not for use by clients (internal)-->
- <extension-point id="cssprofile" name="%CSS_Profile_Extension.name" schema="schema/cssprofile.exsd"/>
- <!-- not for use by clients (internal)-->
- <extension-point id="commentElementHandler" name="%Comment_Element_Handler_Extension.name" schema="schema/commentElementHandler.exsd"/>
-
- <!-- not for use by clients (internal)-->
- <extension-point id="modelHandler" name="%Model_Handler_Extension.name" schema="schema/modelHandler.exsd"/>
- <!-- not for use by clients (internal)-->
- <extension-point
- id="formatProcessors"
- name="%Format_Processors_Extension_Point.name"
- schema="schema/formatProcessors.exsd" />
-
- <!-- not for use by clients (internal)-->
- <extension-point id="taskscanner" name="%Task_Scanner_Extension_Point.name" schema="schema/taskscanner.exsd"/>
-
- <!-- Make sure default preference values are set at runtime -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.sse.core.internal.preferences.PreferenceInitializer" />
- </extension>
-
- <extension point="org.eclipse.wst.validation.validatorGroup">
- <group id="structuredModelGroup">
- <listener class="org.eclipse.wst.sse.core.internal.validate.ValidatorGroupListener"/>
- </group>
- </extension>
-
- <!-- Define the StructuredFilePropertyTester as it will handle tracing the entire -->
- <!-- content type hierarchy for a file. Only operates on IFiles -->
- <!-- Deprecated, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216 -->
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.wst.sse.core.internal.propertytester.StructuredFilePropertyTester"
- id="org.eclipse.wst.sse.core.expressions.propertyTester.StructuredFilePropertyTester"
- namespace="org.eclipse.wst.sse.core.resources"
- properties="contentTypeId"
- type="org.eclipse.core.resources.IFile">
- </propertyTester>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd b/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd
deleted file mode 100644
index ddbf8996ee..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="adaptOnCreateFactory" name="Adapt On Create Factory Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
deleted file mode 100644
index 633c80cec7..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="commentElementHandler" name="Comment Element Handler Extension Point"/>
- </appinfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="handler-custom"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="handler-custom">
- <complexType>
- <sequence>
- <element ref="startwith"/>
- </sequence>
- <attribute name="commenttype" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="startwith">
- <complexType>
- <attribute name="prefix" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2005, 2008 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd b/bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd
deleted file mode 100644
index cf8418e165..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="contentTypeFactoryContribution" name="Content Type Factory Contribution Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd b/bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd
deleted file mode 100644
index 923e853c58..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="cssprofile" name="CSS Profile Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="profile" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="profile">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="default" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="uri" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd b/bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd
deleted file mode 100644
index b90f35f9af..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="documentTypes" name="Document Types Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="documentType" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="documentType">
- <complexType>
- <attribute name="elementName" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="displayName" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="namespaceURI" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isXHTML" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="hasFrameset" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="publicID" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="systemID" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="defaultXHTML" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isWML" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="defaultWML" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd
deleted file mode 100644
index bbcde8dd91..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="embeddedTypeHandler" name="JSP Embedded Content Type Handler Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="embeddedTypeHandler"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="embeddedTypeHandler">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd b/bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd
deleted file mode 100644
index 8ed7304439..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="formatProcessors" name="Format Processors Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="processor"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="processor">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="contentTypeId" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.sse.core.formatProcessors&quot;&gt;
- &lt;processor
- class=&quot;org.eclipse.wst.sse.core.xml.format.FormatProcessorXML&quot;
- contentTypeId=&quot;org.eclipse.core.runtime.xml&quot;&gt;
- &lt;/processor&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005, 2007 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
deleted file mode 100644
index ea31dfa6cb..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="modelHandler" name="Model Handler Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
- <element ref="modelHandler"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="modelHandler">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler:"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="associatedContentTypeId" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="default" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005, 2009 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
deleted file mode 100644
index 1f80a829b0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.core" id="taskscanner" name="Task Scanner Extension Point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element internal="true" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="scanner"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="scanner">
- <complexType>
- <attribute name="contentTypeIds" type="string" use="required">
- <annotation>
- <documentation>
- Content type identifiers for which this scanner applies, separated by commas.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Scanner implementation.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
deleted file mode 100644
index 420e3a0174..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
+++ /dev/null
@@ -1,83 +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.sse.internal.contentproperties;
-
-import org.eclipse.core.resources.IResourceDelta;
-
-/**
- * @deprecated This is package protected so no one cares anyways.
- */
-abstract class AbstractContentSettingsHandler implements IContentSettingsHandler {
-
-
- private IContentSettings contentSettings = ContentSettingsCreator.create();
- private IResourceDelta fDelta;
-
- private void commonWithRespectToKind() {
- getContentSettings().releaseCache();
- }
-
- protected final IContentSettings getContentSettings() {
- return contentSettings;
- }
-
- protected final IResourceDelta getDelta() {
- return fDelta;
- }
-
-
- /*
- * @see IContentSettingsHandler#handle(IResourceDelta)
- */
- public void handle(final IResourceDelta delta) {
- this.fDelta = delta;
- // get Resource delta kind
- final int kind = delta.getKind();
- // never used!?
- //IResource resource = delta.getResource();
-
-
- switch (kind) {
- case IResourceDelta.CHANGED : {
- handleChanged();
- }
- break;
- case IResourceDelta.REMOVED : {
- handleRemoved();
- }
- break;
- case IResourceDelta.ADDED : {
- handleAdded();
- }
- break;
-
-
- }
-
-
-
- }
-
- protected void handleAdded() {
- commonWithRespectToKind();
- }
-
- protected void handleChanged() {
- commonWithRespectToKind();
- }
-
- protected void handleRemoved() {
- commonWithRespectToKind();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
deleted file mode 100644
index fcc98bcfb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
+++ /dev/null
@@ -1,54 +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.sse.internal.contentproperties;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public abstract class AbstractSubject implements INotify, ISubject {
-
-
-
- private static Map listenerList = new Hashtable();
-
- public synchronized void addListener(IContentSettingsListener listener) {
- listenerList.put(listener, listener);
- }
-
- /*
- * @see IContentSettingsEventSubject#notifyContentSettingsListeners(Object)
- */
- public synchronized void notifyListeners(org.eclipse.core.resources.IResource changedResource) {
-
- Set keys = listenerList.keySet();
- Iterator iter = keys.iterator();
-
- while (iter.hasNext()) {
- IContentSettingsListener csl = (IContentSettingsListener) iter.next();
- csl.contentSettingsChanged(changedResource);
- }
- }
-
- public synchronized void removeListener(IContentSettingsListener listener) {
- listenerList.remove(listener);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
deleted file mode 100644
index 8dca387fae..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300443 - some constants aren't static final
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.internal.contentproperties;
-
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public class ContentSettings implements IContentSettings {
- private static final String contentSettingsName = ".contentsettings";//$NON-NLS-1$
-
- private static SimpleNodeOperator domOperator;
-
- private static IProject preProject;
-
- private static final IContentSettings singleton = new ContentSettings();
-
- public static final String getContentSettingsName() {
- return contentSettingsName;
- }
-
- public synchronized static IContentSettings getInstance() {
- return singleton;
- }
-
- private String contentSettingsPath;
- private IProject currProject;
- private static final String fileElementName = "file";//$NON-NLS-1$
- private static final String PATHATTR = "path"; //$NON-NLS-1$
- private static final String projectElementName = "project";//$NON-NLS-1$
-
-
-
- private static final String rootElementName = "contentsettings";//$NON-NLS-1$
-
-
-
- private ContentSettings() {
- currProject = null;
- contentSettingsPath = null;
- }
-
-
- private void _setProperties(final IResource resource, final Map properties) {
- if (resource == null || properties == null || properties.isEmpty())
- return;
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return;
-
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return;
-
- try {
-
- if (!existsContentSettings()) {
- // create DOM tree for new XML Document
- createNewDOMTree();
- }
- else {
- // create DOM tree from existing contentsettings.
- createDOMTree();
- }
-
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
- Logger.logException(e);
- try {
- createNewDOMTree();
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
-
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
- Logger.logException(e);
- preProject = currProject;
- return;
- }
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT) {
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- if (e == null) {
- // create project Element and add it into tree
- e = (Element) domOperator.addElementUnderRoot(projectElementName);
- }
- }
- else if (resource.getType() == IResource.FILE) {
- // check exists file Element
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
- if (e == null) {
- // create file Element and add path into it.
- e = (Element) domOperator.addElementUnderRoot(fileElementName);
- domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
- }
- }
-
- // check exists propertyName attribute
- Map attrList = domOperator.getAttributesOf(e);
- boolean hasAttr = true;
- if (attrList == null || attrList.isEmpty())
- hasAttr = false;
- Set keys = properties.keySet();
- Iterator ii = keys.iterator();
- while (ii.hasNext()) {
- String propertyName = (String) ii.next();
- String propertyValue = (String) properties.get(propertyName);
-
-
- if (!hasAttr || (String) attrList.get(propertyName) == null)
- // create propertyName attribute and add
- domOperator.addAttributeAt(e, propertyName, propertyValue);
- else
- // set attribute value
- domOperator.updateAttributeAt(e, propertyName, propertyValue);
- }
-
- // write dom tree into .contentsettings
- try {
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
- Logger.logException(ex);
- preProject = currProject;
- return;
- }
-
- preProject = currProject;
-
-
- }
-
-
- private void _setProperty(final IResource resource, final String propertyName, final String propertyValue) {
- if (resource == null || propertyName == null)
- return;
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return;
-
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return;
-
- try {
-
- if (!existsContentSettings()) {
- // create DOM tree for new XML Document
- createNewDOMTree();
- }
- else {
- // create DOM tree from existing contentsettings.
- createDOMTree();
- }
-
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
- Logger.logException(e);
- try {
- createNewDOMTree();
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
-
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
- Logger.logException(e);
- preProject = currProject;
- return;
- }
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT) {
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- if (e == null) {
- // create project Element and add it into tree
- e = (Element) domOperator.addElementUnderRoot(projectElementName);
- }
- }
- else if (resource.getType() == IResource.FILE) {
- // check exists file Element
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
- if (e == null) {
- // create file Element and add path into it.
- e = (Element) domOperator.addElementUnderRoot(fileElementName);
- domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
- }
- }
-
- // check exists propertyName attribute
-
- Map attrList = domOperator.getAttributesOf(e);
- if (attrList == null || attrList.isEmpty() || (String) attrList.get(propertyName) == null)
- // create propertyName attribute and add
- domOperator.addAttributeAt(e, propertyName, propertyValue);
- else
- // set attribute value
- domOperator.updateAttributeAt(e, propertyName, propertyValue);
-
-
- // write dom tree into .contentsettings
- try {
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
- Logger.logException(ex);
- preProject = currProject;
- return;
- }
-
- preProject = currProject;
-
-
- }
-
-
- private void createDOMTree() throws SimpleNodeOperator.ReadContentSettingsFailureException {
- if (domOperator == null || (currProject != null && (!currProject.equals(preProject)) && contentSettingsPath != null))
- domOperator = new SimpleNodeOperator(contentSettingsPath);
-
-
- }
-
- /*
- * private void createNewDOMTree() throws
- * SimpleNodeOperator.CreateContentSettingsFailureException{ // create New
- * document when no file exists. DOMImplementation impl =
- * DOMImplementationImpl.getDOMImplementation(); Document document =
- * impl.createDocument(null,rootElementName,null); domOperator = new
- * SimpleNodeOperator(document); }
- */
- private void createNewDOMTree() throws SimpleNodeOperator.CreateContentSettingsFailureException {
- Document document = null;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- }
- catch (ParserConfigurationException e) {
- Logger.logException("exception creating document", e); //$NON-NLS-1$
- }
- catch (FactoryConfigurationError e) {
- Logger.logException("exception creating document", e); //$NON-NLS-1$
- }
- if (document != null) {
- document.appendChild(document.createElement(rootElementName));
- domOperator = new SimpleNodeOperator(document);
- }
- }
-
-
- /**
- *
- */
- public synchronized void deleteAllProperties(final IResource deletedFile) {
- if (deletedFile == null)
- return;
- // if (deletedFile.exists()) return;
- if ((deletedFile).getType() != IResource.FILE && (deletedFile).getType() != IResource.PROJECT)
- return;
-
-
- contentSettingsPath = getContentSettingsPath(deletedFile);// getProjectOf((IResource)deletedFile)
- // +
- // IPath.SEPARATOR
- // +
- // contentSettingsName;
- if (contentSettingsPath == null)
- return;
- if (!existsContentSettings())
- return;
-
- try {
- createDOMTree();
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
- Logger.logException(e);
- return;
- }
-
- Element e = null;
- if (deletedFile.getType() == IResource.PROJECT)
- // select project element and get attribute
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- else if (deletedFile.getType() == IResource.FILE)
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(deletedFile));
- if (e == null) {
- preProject = currProject;
- return;
- }
-
-
- // when deletedFile entry exists.
- if (deletedFile.getType() == IResource.PROJECT)
- domOperator.removeElementWith(projectElementName);
- else if (deletedFile.getType() == IResource.FILE)
- domOperator.removeElementWith(getPathAttr(), getRelativePathFromProject(deletedFile));
-
-
- // write dom tree into .contentsettings
- try {
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
- Logger.logException(ex);
- preProject = currProject;
- return;
- }
-
- preProject = currProject;
-
-
- }
-
- public synchronized void deleteProperty(final IResource resource, final String propertyName) {
- if (resource == null)
- return;
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return;
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return;
-
- if (!existsContentSettings()) {
- return; // when .contentsettings.xml is NOT exist.
- }
- try {
- createDOMTree();
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
- Logger.logException(e);
- try {
- createNewDOMTree();
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return;
- }
- }
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT)
- // select project element and get attribute
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- else if (resource.getType() == IResource.FILE)
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
- if (e != null) {
- domOperator.removeAttributeAt(e, propertyName);
- // write dom tree into .contentsettings
- try {
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
- Logger.logException(ex);
- preProject = currProject;
- return;
- }
- }
-
- preProject = currProject;
-
- }
-
-
- private boolean existsContentSettings() {
- if (contentSettingsPath == null)
- return false;
-
- IResource file = currProject.getFile(contentSettingsName);
- if (file == null)
- return false;
- if (file.isAccessible())
- return true;
- else
- return false;
-
- }
-
- public boolean existsProperties(IResource resource) {
- if (resource == null)
- return false;
-
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return false;
-
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return false;
-
- if (!existsContentSettings())
- return false; // when .contentsettings.xml is NOT exist.
-
- try {
- createDOMTree();
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
- return false;
- }
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT)
- // select project element and get attribute
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- else if (resource.getType() == IResource.FILE)
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
- preProject = currProject;
- if (e == null)
- return false;
-
- Map properties = domOperator.getAttributesOf(e);
- if (properties == null)
- return false;
- properties.remove(getPathAttr());// if IFile,removed
- if (properties.isEmpty())
- return false;
- return true;
-
- }
-
- private String getContentSettingsPath(IResource resource) {
- IProject project = null;
- if (resource.getType() == IResource.PROJECT)
- project = (IProject) resource;
- else
- project = resource.getProject();
-
- IPath projectLocation = project.getLocation();
- if (projectLocation == null) {
- /**
- * As a deprecated class, perfect operation in new scenarios such
- * as with EFS is not promised.
- */
- return SSECorePlugin.getDefault().getStateLocation().append(rootElementName).append(project.getName()).toString();
- }
-
- return projectLocation.addTrailingSeparator().append(contentSettingsName).toString();
- }
-
- public final String getPathAttr() {
- return PATHATTR;
- }
-
- public synchronized Map getProperties(final IResource resource) {
- if (resource == null)
- return null;
-
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return null;
-
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return null;
-
- if (!existsContentSettings()) {
- return null; // when .contentsettings.xml is NOT exist.
- }
-
-
- try {
- createDOMTree();
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
- Logger.logException(e1);
- // create DOM tree for new XML Document
- try {
- createNewDOMTree();
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return null;
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return null;
- }
-
- }
-
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT)
- // select project element and get attribute
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- else if (resource.getType() == IResource.FILE)
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
- if (e != null) {
-
- Map properties = domOperator.getAttributesOf(e);
- preProject = currProject;
- if (properties == null)
- return null;
- if (properties.isEmpty())
- return null;
- properties.remove(getPathAttr());
- return properties;
- }
- else {
- preProject = currProject;
- return null;// when project or file element is NOT exist.
- }
- }
-
- public synchronized String getProperty(final IResource resource, final String propertyName) {
- if (resource == null)
- return null;
-
- if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
- return null;
-
- contentSettingsPath = getContentSettingsPath(resource);
- if (contentSettingsPath == null)
- return null;
-
- if (!existsContentSettings()) {
- return null; // when .contentsettings.xml is NOT exist.
- }
-
-
- try {
- createDOMTree();
- }
- catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
- Logger.logException(e1);
- // create DOM tree for new XML Document
- try {
- createNewDOMTree();
- writeDOMDocument();
- }
- catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return null;
- }
- catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
- Logger.logException(e2);
- preProject = currProject;
- return null;
- }
-
- }
-
-
- Element e = null;
- if (resource.getType() == IResource.PROJECT)
- // select project element and get attribute
- e = (Element) domOperator.getElementWithNodeName(projectElementName);
- else if (resource.getType() == IResource.FILE)
- e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
- if (e != null) {
- String result = e.getAttribute(propertyName);
- preProject = currProject;
- return result;
- }
- else {
- preProject = currProject;
- return null;// when project or file element is NOT exist.
- }
- }
-
- private String getRelativePathFromProject(IResource resource) {
- if (resource == null)
- return null;
-
- IPath path = resource.getProjectRelativePath();
- if (path == null)
- return null; // if resource is project or workspace root
- String resourcePath = path.toString();
-
- return resourcePath;
-
- }
-
- public synchronized void releaseCache() {
- domOperator = null;
- }
-
- public synchronized void setProperties(final IResource resource, final Map properties) {
- // deny to set "path" attribute value.
- Set keys = properties.keySet();
- Iterator ii = keys.iterator();
- while (ii.hasNext()) {
- if (this.getPathAttr().equals(ii.next()))
- return;
- }
- this._setProperties(resource, properties);
- }
-
- public synchronized void setProperty(final IResource resource, final String propertyName, final String propertyValue) {
- // deny to set "path" attribute value.
- if (this.getPathAttr().equals(propertyName))
- return;
- this._setProperty(resource, propertyName, propertyValue);
- }
-
- private void writeDOMDocument() throws SimpleNodeOperator.WriteContentSettingsFailureException {
- try {
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- domOperator.writeDocument(outputStream);
- outputStream.flush();
- outputStream.close();
-
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-
- IFile outputFile = currProject.getFile(contentSettingsName);
- if (outputFile.exists())
- outputFile.setContents(inputStream, true, true, null);
- else
- outputFile.create(inputStream, true, null);
-
- inputStream.close();
- }
- catch (CoreException e) {
- Logger.logException(e);
- throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputFile in writeDOMDocument()");//$NON-NLS-1$
- }
- catch (IOException e) {
- Logger.logException(e);
- throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputStream or inputStream in writeDOMDocument()");//$NON-NLS-1$
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
deleted file mode 100644
index 7bc580b0af..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
+++ /dev/null
@@ -1,62 +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.sse.internal.contentproperties;
-
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public class ContentSettingsChangeSubject extends AbstractSubject {
-
-
- private static INotify notify;
- private static ISubject subject;
-
- protected static INotify getNotify() {
- if (notify == null && subject == null) {
- synchronized (ContentSettingsChangeSubject.class) {
- if (notify == null && subject == null) {
- notify = new ContentSettingsChangeSubject();
- subject = (ISubject) notify;
- }
- }
- }
-
- return notify;
- }
-
- public static ISubject getSubject() {
- if (subject == null && notify == null) {
- synchronized (ContentSettingsChangeSubject.class) {
- if (subject == null && notify == null) {
- subject = new ContentSettingsChangeSubject();
- notify = (INotify) subject;
- }
- }
- }
- return subject;
- }
-
- public synchronized void addListener(IContentSettingsListener listener) {
- super.addListener(listener);
- }
-
- public synchronized void notifyListeners(org.eclipse.core.resources.IResource changedResource) {
- super.notifyListeners(changedResource);
- }
-
- public synchronized void removeListener(IContentSettingsListener listener) {
- super.removeListener(listener);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
deleted file mode 100644
index 9dd355c664..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
+++ /dev/null
@@ -1,26 +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.sse.internal.contentproperties;
-
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public class ContentSettingsCreator {
-
- public final static IContentSettings create() {
- return ContentSettings.getInstance();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
deleted file mode 100644
index 0c526049da..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
+++ /dev/null
@@ -1,147 +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.sse.internal.contentproperties;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
-class ContentSettingsFileHandler extends AbstractContentSettingsHandler {
-
-
-
- private Map properties;
-
-
- private void getProperties(IResource file) {
- properties = getContentSettings().getProperties(file);
- }
-
- /*
- * @see AbstractContentSettingsHandler#handleAdded()
- */
- protected void handleAdded() {
- super.handleAdded();
-
- if (super.getDelta().getFlags() == 0) {
- // pulldown memu->copy->create file without override, new file,
- // import without override
- // copy,new,import has same kind(=1) and flag(=0).
-
- } else if ((getDelta().getFlags() & IResourceDelta.MOVED_FROM) != 0) {
- // pulldown menu-> rename without override,pulldown menu->move
- // without override
- // instead of this method,handleRemoved() works for this delta
-
- }
-
- }
-
-
- /*
- * @see AbstractContentSettingsHandler#handleChanged()
- */
- protected void handleChanged() {
- // edit
- if (getDelta().getFlags() == IResourceDelta.CONTENT && (getDelta().getFlags() & IResourceDelta.REPLACED) == 0) {
- super.handleChanged();
-
- } else if (getDelta().getFlags() == IResourceDelta.CONTENT && (getDelta().getFlags() & IResourceDelta.REPLACED) != 0) {
- // override as a result of copy or import
- // in Web project, copy with override doesn't happen
-
- // override as move or rename
- // handleRemoved() works for this delta
- super.handleChanged();
-
- }
-
-
- }
-
- /*
- * @see AbstractContentSettingsHandler#handleRemoved()
- */
- protected void handleRemoved() {
- super.handleRemoved();
- IFile deletedFile = null;
-
- // if entry exists then remove it.
- if (getDelta().getFlags() == 0) {
- // pulldown menu->delete
- deletedFile = (IFile) getDelta().getResource();
-
- if (deletedFile == null)
- return;
- getContentSettings().deleteAllProperties(deletedFile);
-
- getContentSettings().releaseCache();
- }
-
- else if ((getDelta().getFlags() & IResourceDelta.MOVED_TO) != 0) {
-
- // pulldown menu-> rename, pulldown menu->move
- deletedFile = (IFile) getDelta().getResource();
- getProperties(deletedFile);
-
- // get destination IResource
- IPath targetPath = getDelta().getMovedToPath();
- IWorkspaceRoot iwr = ResourcesPlugin.getWorkspace().getRoot();
- IResource targetFile = iwr.getFile(targetPath);//iwr.findMember(targetPath);
-
- // set property of destination file
- getContentSettings().deleteAllProperties(targetFile);
- setProperties(targetFile);
- if (properties != null)
- properties.clear();
- properties = null;
- }
-
- if (deletedFile == null)
- return;
- getContentSettings().deleteAllProperties(deletedFile);
-
- getContentSettings().releaseCache();
-
- }
-
- private void setProperties(IResource file) {
- if (file.getFileExtension() == null)
- return;
- if (!(file.getFileExtension().equalsIgnoreCase("shtml")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("htm")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("html")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("jhtml")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("xhtml")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("jsp")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("css")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("jsf")//$NON-NLS-1$
- || file.getFileExtension().equalsIgnoreCase("jspf")))//$NON-NLS-1$
- return;
- if (properties == null || properties.isEmpty())
- return;
- getContentSettings().setProperties(file, properties);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
deleted file mode 100644
index 27aa2b80f6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
+++ /dev/null
@@ -1,93 +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.sse.internal.contentproperties;
-
-
-
-import org.eclipse.core.resources.IResourceDelta;
-
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
-final class ContentSettingsSelfHandler extends AbstractContentSettingsHandler {
-
- private static INotify notify;// = new ContentSettingsChangedSubject();
-
-
- private final void getSubject() {
- notify = ContentSettingsChangeSubject.getNotify();
- }
-
- /*
- * @see AbstractContentSettingsHandler#handleAdded()
- */
- protected void handleAdded() {
- getSubject();
- if (super.getDelta().getFlags() == 0) {
- // pulldown memu->copy->create file without override, new file,
- // property page create .contentsettings
- super.handleAdded();
- notify.notifyListeners(getDelta().getResource());
-
- } else if ((getDelta().getFlags() & IResourceDelta.MOVED_FROM) != 0) {
- // pulldown menu-> rename without override,pulldown menu->move
- // without override
- super.handleAdded();
- notify.notifyListeners(getDelta().getResource());
-
- }
-
- }
-
-
- /*
- * @see AbstractContentSettingsHandler#handleChanged()
- */
- protected void handleChanged() {
- getSubject();
- if ((getDelta().getFlags() & IResourceDelta.CONTENT) != 0 && (getDelta().getFlags() & IResourceDelta.REPLACED) == 0) {
- // result of edit, property page operate setProperty(apply or ok
- // button) in .contentsettings
- super.handleChanged();
-
- notify.notifyListeners(getDelta().getResource());
-
- } else if ((getDelta().getFlags() & IResourceDelta.CONTENT) != 0 && (getDelta().getFlags() & IResourceDelta.REPLACED) != 0) {
- super.handleChanged();
- notify.notifyListeners(getDelta().getResource());
-
- }
-
-
- }
-
- /*
- * @see AbstractContentSettingsHandler#handleRemoved()
- */
- protected void handleRemoved() {
- getSubject();
- if (getDelta().getFlags() == 0) {
- // pulldown menu->delete
- super.handleRemoved();
- notify.notifyListeners(getDelta().getResource());
-
- } else if ((getDelta().getFlags() & IResourceDelta.MOVED_TO) != 0) {
- // pulldown menu-> rename, pulldown menu->move
- super.handleRemoved();
- notify.notifyListeners(getDelta().getResource());
-
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
deleted file mode 100644
index e698b6551c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possible
- *******************************************************************************/
-package org.eclipse.wst.sse.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public class ContentSettingsSynchronizer implements IResourceChangeListener {
- static class ContentSettingsVisitor implements IResourceDeltaVisitor {
- // redefinition in ContentSettings.java
- private String contentSettingsName = ContentSettings.getContentSettingsName(); //$NON-NLS-1$
- private IResourceChangeEvent fEvent;
- private IContentSettingsHandler handler;
-
- public ContentSettingsVisitor(IResourceChangeEvent event) {
- this.fEvent = event;
- }
-
- /**
- * @see IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- if (delta == null)
- return false;
- IResource resource = delta.getResource();
- if (resource == null)
- return false;
- // parent folder or project
- if (delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() == 0)
- return true;
- final int resourceType = resource.getType();
- switch (resourceType) {
- case IResource.PROJECT :
- return false;
- case IResource.FILE :
- // whether resource is .contentsettings file or not
- IProject project = delta.getResource().getProject();
- if (this.fEvent.getType() == IResourceChangeEvent.POST_CHANGE && resource.equals(project.getFile(this.contentSettingsName))) {
- // new object for .contentsettings
- handler = new ContentSettingsSelfHandler();
- }
- else if (this.fEvent.getType() == IResourceChangeEvent.PRE_BUILD && resource.getFileExtension() != null) {
- // TODO change to content type!
- if (resource.getFileExtension().equalsIgnoreCase("shtml") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("htm") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("html") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("jhtml") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("xhtml") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("jsp") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("css") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("jsf") //$NON-NLS-1$
- || resource.getFileExtension().equalsIgnoreCase("jspf")) { //$NON-NLS-1$
- // new object for IFile
- handler = new ContentSettingsFileHandler();
- handler.handle(delta);
- handler = null;
- return true;
- }
- }
- else
- return false; // true or false;motomoto true;
- break;
- case IResource.FOLDER :
- return true;
- default :
- return true;
- }
-// final IResourceDelta fDelta = delta;
-// final IContentSettingsHandler deltaHandler = this.handler;
- // XXX FIXME
- // I commented out following to move this to "model"
- // packages. Since wasnt't hooked up/working anyway, I think
- // ok for now, but need to re-work as Job, once we do implement
- // settings for resources again.
-// Display display = getDisplay();
-// if (display != null && !display.isDisposed()) {
-// display.asyncExec(new Runnable() {
-// public void run() {
-// if (deltaHandler != null) {
-// deltaHandler.handle(fDelta);
-// }
-// }
-// });
-// }
-// else if (deltaHandler != null) {
-// deltaHandler.handle(fDelta);
-// }
- handler = null;
- return true; // true or false;motomoto true;
- }
- }
-
- private static ContentSettingsSynchronizer instance = null;
-
- public synchronized static ContentSettingsSynchronizer getInstance() {
- if (instance == null)
- instance = new ContentSettingsSynchronizer();
- return instance;
- }
-
- private ContentSettingsVisitor csVisitor;
- private boolean fListening = false;
- private IProject fProject;
-
-
- private final IProject getProject() {
- return fProject;
- }
-
- private final IWorkspace getWorkspace() {
- if (getProject() == null)
- return ResourcesPlugin.getWorkspace();
- return getProject().getWorkspace();
- }
-
- public synchronized void install() {
- if (!fListening) {
- getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_CHANGE);
- fListening = true;
- }
- }
-
- /**
- * @return
- */
- public synchronized boolean isListening() {
- return fListening;
- }
-
- /*
- * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta != null) {
- try {
- if (csVisitor == null)
- csVisitor = new ContentSettingsVisitor(event);
- delta.accept(csVisitor);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- csVisitor = null;
- }
-
- public synchronized void unInstall() {
- getWorkspace().removeResourceChangeListener(this);
- fListening = false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
deleted file mode 100644
index 058dd5c3a6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
+++ /dev/null
@@ -1,83 +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.sse.internal.contentproperties;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public interface IContentSettings {
- /**
- *
- */
- public final String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
- /**
- *
- */
- public final String DEVICE_PROFILE = "target-device"; //$NON-NLS-1$
-
- /**
- *
- */
- public final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
- /**
- *
- */
- public final String HTML_DOCUMENT_TYPE = "html-document-type"; //$NON-NLS-1$
-
- /**
- *
- */
- public void deleteAllProperties(final IResource deletedFile);
-
- /**
- *
- */
- public void deleteProperty(final IResource resource, final String propertyName);
-
- /**
- *
- */
- public boolean existsProperties(IResource resource);
-
- /**
- *
- */
- public Map getProperties(final IResource resource);
-
- /**
- *
- */
- public String getProperty(final IResource resource, final String propertyName);
-
- /**
- * release cache of DOM tree in .contentsettings
- */
- public void releaseCache();
-
- /**
- *
- */
- public void setProperties(final IResource resource, final Map properties);
-
- /**
- *
- */
- public void setProperty(final IResource resource, final String propertyName, final String propertyValue);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
deleted file mode 100644
index 8ef8b45964..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
+++ /dev/null
@@ -1,25 +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.sse.internal.contentproperties;
-
-
-
-import org.eclipse.core.resources.IResourceDelta;
-
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
-interface IContentSettingsHandler {
-
- public void handle(final IResourceDelta delta);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
deleted file mode 100644
index 41151f88a3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
+++ /dev/null
@@ -1,22 +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.sse.internal.contentproperties;
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public interface IContentSettingsListener {
-
- void contentSettingsChanged(org.eclipse.core.resources.IResource e);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
deleted file mode 100644
index 4dcf5fecea..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
+++ /dev/null
@@ -1,22 +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.sse.internal.contentproperties;
-
-
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
-interface INotify {
-
- void notifyListeners(org.eclipse.core.resources.IResource resource);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
deleted file mode 100644
index 4ff403063a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
+++ /dev/null
@@ -1,26 +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.sse.internal.contentproperties;
-
-
-/**
- * @deprecated See
- * org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
- */
-public interface ISubject {
-
- void addListener(IContentSettingsListener listener);
-
- void removeListener(IContentSettingsListener listener);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
deleted file mode 100644
index ace7a384e8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possible
- *******************************************************************************/
-package org.eclipse.wst.sse.internal.contentproperties;
-
-
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.SAXException;
-
-/**
-* @deprecated This is package protected so no one cares anyways.
-*/
-class SimpleNodeOperator {
-
- static class CreateContentSettingsFailureException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public CreateContentSettingsFailureException(String reason) {
- super(reason);
- }
- }
-
-
- static class ReadContentSettingsFailureException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public ReadContentSettingsFailureException(String reason) {
- super(reason);
- }
- }
-
- static class WriteContentSettingsFailureException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public WriteContentSettingsFailureException(String reason) {
- super(reason);
- }
- }
-
- // writer class for .contentSettings.
- static class XMLDocumentWriter {
- OutputStream fOut;
-
- protected XMLDocumentWriter(OutputStream out) {
- this.fOut = out;
- }
-
- protected final void close() {
- try {
- fOut.close();
- } catch (IOException e) {
- // do nothing, shouldn't matter
- }
- }
-
- protected void serialize(Document sourceDocument) throws WriteContentSettingsFailureException {
- // JAXP transformation
- Source domSource = new DOMSource(sourceDocument);
- try {
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- try {
- serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (IllegalArgumentException e) {
- // unsupported properties
- }
- serializer.transform(domSource, new StreamResult(fOut));
- } catch (TransformerConfigurationException e) {
- throw new WriteContentSettingsFailureException(e.getMessage());
- } catch (TransformerFactoryConfigurationError e) {
- throw new WriteContentSettingsFailureException(e.getMessage());
- } catch (TransformerException e) {
- throw new WriteContentSettingsFailureException(e.getMessage());
- }
- }
- }
-
- public static void main(String[] args) {
- SimpleNodeOperator a = null;
- try {
- a = new SimpleNodeOperator("workspace/org.eclipse.examples.contentsettings/.contentsettings.xml");//$NON-NLS-1$
- } catch (Exception e) {
- System.exit(0);
- }
-
- // print all Elements
- //a.printTree(iter);
-
- // add Element
- Map attMap = new Hashtable();
- attMap.put("path", "hogepath");//$NON-NLS-1$ //$NON-NLS-2$
- attMap.put("fDocument-type", "documenthogehoge");//$NON-NLS-1$ //$NON-NLS-2$
- a.addElementUnderRoot("file", attMap);//$NON-NLS-1$
-
- try {
- a.writeDocument(System.out);
- } catch (Exception e) {
- System.err.println(e.toString());
- }
-
- }
-
- //never used
- //private DOMParser parser;
- private Document fDocument;
- private Node root;
-
- private String settingsFileName;
-
-
- public SimpleNodeOperator(Document doc) throws CreateContentSettingsFailureException {
-
- if (doc == null)
- throw new CreateContentSettingsFailureException("Document doc==null");//$NON-NLS-1$
- fDocument = doc;
- root = fDocument.getLastChild();
- if (root == null)
- throw new CreateContentSettingsFailureException("Node root==null");//$NON-NLS-1$
- }
-
- public SimpleNodeOperator(String fullPath) throws ReadContentSettingsFailureException {
- this.settingsFileName = fullPath;
- createObjectOfDocument();
- }
-
- // add attribute(attName=attValue) of ele without checking overlapping of
- // another attributes of ele.
- // if overlapping ,override
- protected Node addAttributeAt(Element ele, String attName, String attValue) {
- Attr att = fDocument.createAttribute(attName);
- att.setValue(attValue);
- if (ele != null)
- ele.setAttributeNode(att);
- return ele;
- }
-
- protected Node addElementUnder(Node parent, String tagName, Map attMap) {
- if (parent == null || tagName == null)
- return null;
- Element e = fDocument.createElement(tagName);
- if (attMap != null) {
- if (!attMap.isEmpty()) {
- Set attKeys = attMap.keySet();
- Iterator iter = attKeys.iterator();
- while (iter.hasNext()) {
- String key = (String) iter.next();
- e.setAttribute(key, (String) attMap.get(key));
- }
- }
- }
- parent.appendChild(e);
- return e;
- }
-
- protected final Node addElementUnderRoot(String tagName) {
- return addElementUnder(root, tagName, null);
- }
-
- // add element with attMap as attribute without checking overlapping.
- protected final Node addElementUnderRoot(String tagName, Map attMap) {
- return addElementUnder(root, tagName, attMap);
- }
-
- private void createObjectOfDocument() throws ReadContentSettingsFailureException {
- try {
- fDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(settingsFileName));
- } catch (SAXException e) {
- Logger.logException("exception parsing" + settingsFileName, e); //$NON-NLS-1$
- } catch (IOException e) {
- Logger.logException("I/O exception parsing" + settingsFileName, e); //$NON-NLS-1$
- } catch (ParserConfigurationException e) {
- Logger.logException("exception accessing DOMImplementation", e); //$NON-NLS-1$
- } catch (FactoryConfigurationError e) {
- Logger.logException("exception accessing DOMImplementation", e); //$NON-NLS-1$
- }
- //get the root of the XML fDocument
- root = fDocument.getLastChild();
- if (root == null) {
- throw new ReadContentSettingsFailureException("Error: Node root==null");//$NON-NLS-1$
- }
- }
-
- protected Map getAttributesOf(Node node) {
- if (!node.hasAttributes())
- return null;
- Map map = new HashMap();
- NamedNodeMap attrs = node.getAttributes();
- int size = attrs.getLength();
- for (int i = 0; i < size; i++) {
- Attr attr = (Attr) attrs.item(i);
- map.put(attr.getName(), attr.getValue());
- }
- return (map);
- }
-
- private Node getElementWithAttribute(Node first, String attName, String attValue) {
- Node navpoint = first;
- while (navpoint != null) {
- if (navpoint.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap m = navpoint.getAttributes();
- if (m == null)
- continue;
- if (m.getNamedItem(attName) != null) {
- if (attValue.equals(((Attr) m.getNamedItem(attName)).getNodeValue()))
- return navpoint;
- }
- NodeList childNodes = navpoint.getChildNodes();
- if (childNodes != null && childNodes.getLength() > 0) {
- Node holdNode = getElementWithAttribute(navpoint.getFirstChild(), attName, attValue);
- if (holdNode != null) {
- return holdNode;
- }
- }
- }
- navpoint = navpoint.getNextSibling();
- }
- return null;
- }
-
-
- // return a (first) Element with attr(attName=attValue) it if exists,
- // otherwise return null
- protected Node getElementWithAttribute(String attName, String attValue) {
- if (attName == null || attValue == null || !fDocument.hasChildNodes())
- return null;
- return getElementWithAttribute(fDocument.getFirstChild(), attName, attValue);
- }
-
- // retrun Element which has nodeName as Node Name
- protected Node getElementWithNodeName(String nodeName) {
- if (nodeName == null)
- return null;
- NodeList nodes = fDocument.getElementsByTagName(nodeName);
- if (nodes.getLength() > 0) {
- return nodes.item(0);
- }
- return null;
- }
-
- public void printTree(NodeIterator iter) {
- Node n;
- while ((n = iter.nextNode()) != null) {
- System.out.println(n.getNodeName() + ":");//$NON-NLS-1$
- NamedNodeMap m = n.getAttributes();
- if (m == null)
- continue;
- for (int i = 0; i < m.getLength(); i++) {
- String attName = m.item(i).getNodeName();
- System.out.print(" " + attName + "=" + m.item(i).getNodeValue());//$NON-NLS-1$ //$NON-NLS-2$
- }
- System.out.println("");//$NON-NLS-1$
- }
- }
-
-
- // remove attribute(attName) at ele.
- protected Attr removeAttributeAt(Element ele, String attName) {
- if (ele == null || attName == null)
- return null;
- Attr att = ele.getAttributeNode(attName);
- ele.removeAttribute(attName);
- return att;
- }
-
- protected Element removeElementWith(String nodeName) {
- NodeList nodes = fDocument.getElementsByTagName(nodeName);
- for (int i = 0; i < nodes.getLength(); i++) {
- nodes.item(i).getParentNode().removeChild(nodes.item(i));
- }
- return null;
- }
-
- // remove a (first) Element with attr(attName=attValue) and return it if
- // exists, otherwise return null
- protected Element removeElementWith(String attName, String attValue) {
- if (fDocument.hasChildNodes()) {
- Node element = getElementWithAttribute(attName, attValue);
- if (element != null && element.getNodeType() == Node.ELEMENT_NODE) {
- element.getParentNode().removeChild(element);
- return (Element) element;
- }
- }
- return null;
-
- }
-
- // update attribute(attName=newValue) at ele if both ele and attribute of
- // ele exist
- protected void updateAttributeAt(Element ele, String attName, String newValue) {
- Attr att = null;
- if (ele != null)
- if ((att = ele.getAttributeNode(attName)) != null)
- att.setValue(newValue);
- }
-
- protected void writeDocument(OutputStream out) throws WriteContentSettingsFailureException {
- XMLDocumentWriter writer = new XMLDocumentWriter(out);
- try {
- writer.serialize(fDocument);
- } finally {
- writer.close();
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
deleted file mode 100644
index 1f318294a4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
+++ /dev/null
@@ -1,259 +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.wst.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.osgi.framework.Bundle;
-
-
-public abstract class CodedIO {
-
- private final boolean DEBUG = false;
-
- public static final int MAX_BUF_SIZE = 1024 * 8;
-
- public static final int MAX_MARK_SIZE = MAX_BUF_SIZE;
-
- public static final String NO_SPEC_DEFAULT = "NoSpecDefault"; //$NON-NLS-1$
-
- private static Properties overridenCharsets = null;
-
- /**
- * <p>
- * There are two well known understood cases where the standard/default
- * Java Mappings are not sufficient. (Thanks to Hirotaka Matsumoto for
- * providing these two). I believe there are others that individual
- * customers have requested to override on a case by case basis, but I've
- * lost the details. TODO-future: document some of those use-cases.
- * </p>
- * <ul>
- * <li>ISO-8859-8-I</li>
- * <p>
- * In the code conversion point of view, ISO-9959-8 and ISO-8859-8-I are
- * the same. However. the representation on the browser is different. (
- * It's very very hard to explain this into the words, but once you will
- * see, you will understand it :) Many BiDi HTML/JSPs use ISO-8859-8-I in
- * META/page directive. So WSAD needs to support this encoding.
- * </p>
- * <li>X-SJIS</li>
- * <p>
- * Because Mosaic/Navigator 2.0 supported only X-SJIS/X-EUC-JP, lots of
- * old HTML files used X-SJIS/X-EUC-JP so that the customers still want us
- * to support this code conversion for HTML files.
- * </p>
- * </ul>
- *
- * @param detectedCharsetName
- * @return the detectedCharsetName, if no overrides, otherwise the charset
- * name that should be used instead of detectedCharsetName
- */
- /**
- * This method is deliberatly 'default access' since clients should not
- * need to access this information directly.
- */
- static public String checkMappingOverrides(String detectedCharsetName) {
- // This method MUST return what was passed in, if
- // there are no
- // overrides.
- String result = detectedCharsetName;
- String newResult = getOverridenCharsets().getProperty(detectedCharsetName);
- if (newResult != null) {
- result = newResult;
- }
- return result;
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- public static EncodingMemento createEncodingMemento(byte[] detectedBom, String javaCharsetName, String detectedCharsetName, String unSupportedName, String specDefaultEncoding, String reason) {
- EncodingMemento result = new EncodingMemento();
- result.setJavaCharsetName(javaCharsetName);
- result.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- if (specDefaultEncoding == null)
- result.setAppropriateDefault(NO_SPEC_DEFAULT);
- else
- result.setAppropriateDefault(specDefaultEncoding);
- if (unSupportedName != null) {
- result.setInvalidEncoding(unSupportedName);
- }
- // check if valid
- try {
- Charset.isSupported(javaCharsetName);
- } catch (IllegalCharsetNameException e) {
- result.setInvalidEncoding(javaCharsetName);
- }
-
- // check UTF83ByteBOMUsed and UnicodeStream
- if (detectedBom != null) {
- if (detectedBom.length == 2)
- result.setUnicodeStream(true);
- else if (detectedBom.length == 3)
- result.setUTF83ByteBOMUsed(true);
- result.setUnicodeBOM(detectedBom);
- }
- return result;
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- public static EncodingMemento createEncodingMemento(String detectedCharsetName) {
- return createEncodingMemento(detectedCharsetName, null);
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- public static EncodingMemento createEncodingMemento(String detectedCharsetName, String reason) {
- return createEncodingMemento(detectedCharsetName, reason, null);
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- public static EncodingMemento createEncodingMemento(String detectedCharsetName, String reason, String specDefaultEncoding) {
- EncodingMemento result = new EncodingMemento();
- result = new EncodingMemento();
- String javaCharset = getAppropriateJavaCharset(detectedCharsetName);
- result.setJavaCharsetName(javaCharset);
- result.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- if (specDefaultEncoding == null)
- result.setAppropriateDefault(NO_SPEC_DEFAULT);
- else
- result.setAppropriateDefault(specDefaultEncoding);
- // check if valid
- try {
- Charset.isSupported(javaCharset);
- } catch (IllegalCharsetNameException e) {
- result.setInvalidEncoding(javaCharset);
- }
-
- return result;
- }
-
- /**
- * 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
- */
- public static String getAppropriateJavaCharset(String detectedCharsetName) {
- // we don't allow null argument (or risk NPE or
- // IllegalArgumentException later at several
- // points.
- Assert.isNotNull(detectedCharsetName, "illegal charset argument. it can not be null"); //$NON-NLS-1$
- String result = detectedCharsetName;
- // 1. Check explicit mapping overrides from
- // property file
- 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;
- // Note: this will immediatly throw
- // "UnsuppotedCharsetException" if it
- // invalid. Issue: Is it more client friendly to
- // eat that exception and return null?
- javaCharset = Charset.forName(result);
- if (javaCharset != null) {
- result = javaCharset.name();
- }
- return result;
- }
-
- /**
- * @return Returns the overridenCharsets.
- */
- private static Properties getOverridenCharsets() {
- if (overridenCharsets == null) {
- overridenCharsets = new Properties();
- Bundle keyBundle = Platform.getBundle(ICodedResourcePlugin.ID);
- IPath keyPath = new Path("config/override.properties"); //$NON-NLS-1$
- URL location = Platform.find(keyBundle, keyPath);
- InputStream propertiesInputStream = null;
- try {
- propertiesInputStream = location.openStream();
- overridenCharsets.load(propertiesInputStream);
- } catch (IOException e) {
- // if can't read, just assume there's no
- // overrides
- // and repeated attempts will not occur,
- // since they
- // will be represented by an empty
- // Properties object
- }
- }
- return overridenCharsets;
- }
-
- /**
- * This class need not be instantiated (though its subclasses can be).
- */
- protected CodedIO() {
- super();
- }
-
- protected EncodingMemento createMemento(IContentDescription contentDescription) {
- EncodingMemento result;
- String appropriateDefault = contentDescription.getContentType().getDefaultCharset();
- String detectedCharset = (String) contentDescription.getProperty(IContentDescriptionExtended.DETECTED_CHARSET);
- String unSupportedCharset = (String) contentDescription.getProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET);
- String javaCharset = contentDescription.getCharset();
- // integrity checks for debugging
- if (javaCharset == null) {
- Logger.log(Logger.INFO_DEBUG, "charset equaled null!"); //$NON-NLS-1$
- } else if (javaCharset.length() == 0) {
- Logger.log(Logger.INFO_DEBUG, "charset equaled emptyString!"); //$NON-NLS-1$
- }
- byte[] BOM = (byte[]) contentDescription.getProperty(IContentDescription.BYTE_ORDER_MARK);
- //result = (EncodingMemento)
- // contentDescription.getProperty(IContentDescriptionExtended.ENCODING_MEMENTO);
- result = createEncodingMemento(BOM, javaCharset, detectedCharset, unSupportedCharset, appropriateDefault, null);
- if (!result.isValid()) {
- result.setAppropriateDefault(appropriateDefault);
- // integrity check for debugging "invalid" cases.
- // the apprriate default we have, should equal what's in the
- // detected field. (not sure this is always required)
- if (DEBUG && appropriateDefault != null && !appropriateDefault.equals(detectedCharset)) {
- Logger.log(Logger.INFO_DEBUG, "appropriate did not equal detected, as expected for invalid charset case"); //$NON-NLS-1$
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
deleted file mode 100644
index 155ccdb55f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
+++ /dev/null
@@ -1,542 +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.wst.sse.core.internal.encoding;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.BufferedLimitedStream;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.eclipse.wst.sse.core.internal.encoding.util.NullInputStream;
-import org.eclipse.wst.sse.core.internal.encoding.util.UnicodeBOMEncodingDetector;
-import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
-
-
-/**
- * The purpose of this class is to centralize analysis of a file to determine
- * the most appropriate rules of decoding it. The intended use is to set the
- * input, then get the reader for that input which will have its encoding set
- * appropriately. Additionally, there is an EncodingMemento provided, which
- * will be required, in some cases, to later determine the most appropriate
- * form of encoded output.
- */
-public class CodedReaderCreator extends CodedIO {
-
-
- private boolean fClientSuppliedStream;
-
-
- private EncodingMemento fEncodingMemento;
-
- private EncodingRule fEncodingRule;
-
- private String fFilename;
-
- private IFile fIFile;
-
-
- private InputStream fInputStream;
-
- private static final String CHARSET_UTF_16= "UTF-16"; //$NON-NLS-1$
-
- private static final String CHARSET_UTF_16LE= "UTF-16LE"; //$NON-NLS-1$
-
- public CodedReaderCreator() {
-
- super();
- }
-
- public CodedReaderCreator(IFile file) throws CoreException, IOException {
-
- this();
- set(file);
- setEncodingRule(EncodingRule.CONTENT_BASED);
- }
-
- public CodedReaderCreator(IFile file, EncodingRule encodingRule) throws CoreException, IOException {
-
- this();
- set(file);
- setEncodingRule(encodingRule);
- }
-
- public CodedReaderCreator(String filename, InputStream inputStream) {
-
- this();
- set(filename, inputStream);
- setEncodingRule(EncodingRule.CONTENT_BASED);
- }
-
- public CodedReaderCreator(String filename, InputStream inputStream, EncodingRule encodingRule) {
-
- this();
- set(filename, inputStream);
- setEncodingRule(encodingRule);
- }
-
- private EncodingMemento checkForEncodingInContents(InputStream limitedStream) throws CoreException, IOException {
- EncodingMemento result = null;
-
- // if encoding memento already set, then iFile must
- // have been set, and no need to get again.
- if (fEncodingMemento != null) {
- result = fEncodingMemento;
- }
- else {
- if (fClientSuppliedStream) {
- try {
- limitedStream.reset();
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- IContentDescription contentDescription = contentTypeManager.getDescriptionFor(limitedStream, fFilename, IContentDescription.ALL);
- if (contentDescription != null) {
- fEncodingMemento = createMemento(contentDescription);
- }
- result = fEncodingMemento;
- }
- finally {
- limitedStream.reset();
- }
- }
- else {
- // throw new IllegalStateException("unexpected state:
- // encodingMemento was null but no input stream supplied by
- // client"); //$NON-NLS-1$
- result = null;
- }
- }
-
- if (result != null && !result.isValid() && !forceDefault()) {
- throw new UnsupportedCharsetExceptionWithDetail(result);
- }
-
- return result;
- }
-
- /**
- * @param resettableLimitedStream
- */
- private EncodingMemento checkStreamForBOM(InputStream resettableLimitedStream) {
- EncodingMemento result = null;
- UnicodeBOMEncodingDetector unicodeBOMEncodingDetector = new UnicodeBOMEncodingDetector();
- unicodeBOMEncodingDetector.set(resettableLimitedStream);
- result = unicodeBOMEncodingDetector.getEncodingMemento();
- return result;
- }
-
- /**
- * @param iFile
- * @throws CoreException
- * @throws IOException
- */
- private EncodingMemento findMementoFromFileCase() throws CoreException, IOException {
- EncodingMemento result = null;
- IContentDescription contentDescription = null;
- try {
- // This method provides possible improved performance at the
- // cost of sometimes returning null
- if (fIFile.exists())
- contentDescription = fIFile.getContentDescription();
- }
- catch (CoreException e) {
- // Assume if core exception occurs, we can still try more
- // expensive
- // discovery options.
- Logger.logException(e);
- }
- if (contentDescription == null && fIFile.isAccessible()) {
- InputStream contents = null;
- try {
- contents = fIFile.getContents();
- contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, fIFile.getName(), IContentDescription.ALL);
- }
- catch (CoreException e1) {
- // Assume if core exception occurs, we can't really do much
- // with
- // determining encoding, etc.
- Logger.logException(e1);
- throw e1;
- }
- catch (IOException e2) {
- // We likely couldn't get the contents of the file, something
- // is really wrong
- Logger.logException(e2);
- throw e2;
- }
- if (contents != null) {
- try {
- contents.close();
- }
- catch (IOException e2) {
- Logger.logException(e2);
- }
- }
- }
- if (contentDescription != null) {
- result = createMemento(contentDescription);
- }
-
- return result;
- }
-
- /**
- * The primary method which contains the highest level rules for how to
- * decide appropriate decoding rules: 1. first check for unicode stream 2.
- * then looked for encoding specified in content (according to the type of
- * content that is it ... xml, html, jsp, etc. 3. then check for various
- * settings: file settings first, if null check project settings, if null,
- * check user preferences. 4. lastly (or, what is the last user
- * preference) is to use "workbench defaults".
- *
- * @throws IOException
- * @throws CoreException
- */
- private EncodingMemento findMementoFromStreamCase() throws CoreException, IOException {
-
- EncodingMemento result = null;
- InputStream resettableLimitedStream = null;
- try {
- resettableLimitedStream = getLimitedStream(getResettableStream());
- if (resettableLimitedStream != null) {
- // first check for unicode stream
- result = checkStreamForBOM(resettableLimitedStream);
- // if not that, then check contents
- if (result == null) {
- resettableLimitedStream.reset();
- result = checkForEncodingInContents(resettableLimitedStream);
- }
-
- }
- else {
- // stream null, may name's not.
- if (fFilename != null) {
- // filename not null
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- IContentDescription contentDescription = contentTypeManager.getDescriptionFor(new NullInputStream(), fFilename, IContentDescription.ALL);
- if (contentDescription != null) {
- result = createMemento(contentDescription);
- }
- }
- }
- }
- finally {
- if (resettableLimitedStream != null) {
- handleStreamClose(resettableLimitedStream);
- }
- }
- return result;
- }
-
- private boolean forceDefault() {
-
- boolean result = false;
- if (fEncodingRule != null && fEncodingRule == EncodingRule.FORCE_DEFAULT)
- result = true;
- return result;
- }
-
- public Reader getCodedReader() throws CoreException, IOException {
-
- Reader result = null;
- // we make a local copy of encoding memento so
- // stream won't
- // be accessed simultaneously.
- EncodingMemento encodingMemento = getEncodingMemento();
- Assert.isNotNull(encodingMemento, "Appears reader requested before file or stream set"); //$NON-NLS-1$
- InputStream streamToReturn = getResettableStream();
- streamToReturn.reset();
- // if UTF 3 byte BOM is used (or UTF-16LE), the
- // built in converters
- // don't
- // correct skip all three bytes ... so skip
- // remaining one to leave
- // stream transparently ready for client.
- // see ... TODO look up bug number
- if (encodingMemento.isUnicodeStream()) {
- streamToReturn.skip(2);
- }
- else if (encodingMemento.isUTF83ByteBOMUsed()) {
- streamToReturn.skip(3);
- }
- String charsetName = encodingMemento.getJavaCharsetName();
- if (charsetName == null) {
- charsetName = encodingMemento.getDetectedCharsetName();
- }
- if (!encodingMemento.isValid() && !forceDefault()) {
- throw new UnsupportedCharsetExceptionWithDetail(encodingMemento);
- }
-
- if (fEncodingRule == EncodingRule.FORCE_DEFAULT) {
- charsetName = encodingMemento.getAppropriateDefault();
- }
-
- // [228366] For files that have a unicode BOM, and a charset name of UTF-16, the charset decoder needs "UTF-16LE"
- if(CHARSET_UTF_16.equals(charsetName) && encodingMemento.getUnicodeBOM() == IContentDescription.BOM_UTF_16LE)
- charsetName = CHARSET_UTF_16LE;
-
- Charset charset = Charset.forName(charsetName);
- CharsetDecoder charsetDecoder = charset.newDecoder();
- if (fEncodingRule == EncodingRule.IGNORE_CONVERSION_ERROR) {
- charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);
- charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
- }
- else {
- charsetDecoder.onMalformedInput(CodingErrorAction.REPORT);
- charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPORT);
- }
- // more efficient to be buffered, and I know of no
- // reason not to return
- // that directly.
- result = new BufferedReader(new InputStreamReader(streamToReturn, charsetDecoder), CodedIO.MAX_BUF_SIZE);
- result.mark(CodedIO.MAX_BUF_SIZE);
- return result;
- }
-
- public EncodingMemento getEncodingMemento() throws CoreException, IOException {
- // figure out encoding memento from encoding strategy
- if (fEncodingMemento == null) {
- if (fClientSuppliedStream) {
- fEncodingMemento = findMementoFromStreamCase();
- }
- else if (fIFile != null) {
- fEncodingMemento = findMementoFromFileCase();
- }
- }
-
- // if encoding stratagy doesn't provide answer,
- // then try file settings, project settings,
- // user preferences, and
- // finally workbench default.
- //
- if (fEncodingMemento == null || fEncodingMemento.getDetectedCharsetName() == null) {
- fEncodingMemento = getEncodingMementoFromResourceAndPreference();
- }
-
- // use DefaultNameRules from NonContentBasedEncodingRules as the final
- // default
- if (fEncodingMemento == null) {
- fEncodingMemento = handleNotProvidedFromContentCase();
- }
-
- return fEncodingMemento;
- }
-
- /*
- * This method is called only when encoding is not detected in the file.
- *
- * Here is encoding lookup order we will try: - try resource content
- * description (Eclipse Text file encoding) - try resource content
- * properties (for JSP only) - try content type encoding preferences (for
- * HTML only) - try resource content description (Eclipse Text file
- * encoding, implicit check)
- *
- * Note: This method appears in both CodedReaderCreator and
- * CodedStreamCreator (with just a minor difference). They should be kept
- * the same.
- */
- private EncodingMemento getEncodingMementoFromResourceAndPreference() throws IOException, CoreException {
- EncodingMemento encodingMemento = fEncodingMemento;
-
- // Follow Eclipse Platform's direction. Get the charset from IFile.
- if (fIFile != null) {
- String charset = fIFile.getCharset();
- encodingMemento = CodedIO.createEncodingMemento(charset);
- }
-
- return encodingMemento;
- }
-
- /**
- * Ensures that an InputStream has mark/reset support, is readlimit is
- * set, and that the stream is "limitable" (that is, reports "end of
- * input" rather than allow going past mark). This is very specialized
- * stream introduced to overcome
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67211. See also
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68565
- */
- private InputStream getLimitedStream(InputStream original) {
- if (original == null)
- return null;
- if (original instanceof BufferedLimitedStream)
- return original;
- InputStream s = new BufferedLimitedStream(original, CodedIO.MAX_MARK_SIZE);
- s.mark(CodedIO.MAX_MARK_SIZE);
- return s;
- }
-
- private InputStream getResettableStream() throws CoreException, IOException {
-
- InputStream resettableStream = null;
-
- if (fIFile != null) {
- InputStream inputStream = null;
- try {
- // note we always get contents, even if out of synch
- inputStream = fIFile.getContents(true);
- }
- catch (CoreException e) {
- // SHOULD actually check for existence of
- // fIStorage, but
- // for now will just assume core exception
- // means it
- // doesn't exist on file system, yet.
- // and we'll log, just in case its a noteable error
- Logger.logException(e);
- inputStream = new NullInputStream();
- }
- resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- }
- else {
- if (fInputStream != null) {
- if (fInputStream.markSupported()) {
- resettableStream = fInputStream;
- // try {
- resettableStream.reset();
- // }
- // catch (IOException e) {
- // // assumed just hasn't been marked yet, so ignore
- // }
- }
- else {
- resettableStream = new BufferedInputStream(fInputStream, CodedIO.MAX_BUF_SIZE);
- }
- }
- }
-
- if (resettableStream == null) {
- resettableStream = new NullInputStream();
- }
-
- // mark this once, stream at "zero" position
- resettableStream.mark(MAX_MARK_SIZE);
- return resettableStream;
- }
-
- private EncodingMemento handleNotProvidedFromContentCase() {
-
- EncodingMemento result = null;
- String specDefault = null;
- // try {
- // specDefault = getEncodingDetector().getSpecDefaultEncoding();
- // }
- // catch (CoreException e) {
- // // If this exception occurs, assumes there is
- // // no specDefault
- // }
- // catch (IOException e) {
- // // If this exception occurs, assumes there is
- // // no specDefault
- // }
- // finally {
- // try {
- // handleStreamClose(fEncodingDetectorStream);
- // }
- // catch (IOException e1) {
- // // severe error, not much to do here
- // }
- // }
- // this logic should be moved to 'detection' if not already
- String charset = NonContentBasedEncodingRules.useDefaultNameRules(specDefault);
- Assert.isNotNull(charset, "post condition failed"); //$NON-NLS-1$
- result = CodedIO.createEncodingMemento(charset);
- return result;
- }
-
- /**
- * @param resettableInputStream
- * @throws IOException
- */
- private void handleStreamClose(InputStream resettableInputStream) throws IOException {
-
- if (resettableInputStream != null) {
- if (fClientSuppliedStream) {
- resettableInputStream.reset();
- }
- else {
-
- resettableInputStream.close();
- }
- }
- }
-
- // TODO We just copy the content properties encoding to current resource's
- // encoding for now. May improve the UI later by setting an informational
- // message and/or disable the content properties encoding field.
- // TODO: remake private else remove
- void migrateContentPropertiesEncoding(String encoding) throws CoreException {
- final IFile file = fIFile;
- final String charset = encoding;
- // TODO: externalize string later
- Job migrater = new Job(SSECoreMessages.Migrate_Charset) { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (file != null) {
- try {
- file.setCharset(charset, null);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- return Status.OK_STATUS;
- }
- };
- migrater.setSystem(true);
- migrater.schedule();
- }
-
- private void resetAll() {
-
- fEncodingRule = null;
- fIFile = null;
- fFilename = null;
- fInputStream = null;
- fEncodingMemento = null;
- fClientSuppliedStream = false;
- }
-
- public void set(IFile iFile) throws CoreException, IOException {
- Assert.isNotNull(iFile, "illegal argument"); //$NON-NLS-1$
- resetAll();
- fIFile = iFile;
- }
-
- public void set(String filename, InputStream inputStream) {
-
- resetAll();
- fFilename = filename;
- fInputStream = inputStream;
- fClientSuppliedStream = true;
- }
-
- public void setEncodingRule(EncodingRule encodingRule) {
-
- fEncodingRule = encodingRule;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java
deleted file mode 100644
index ac1224c631..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java
+++ /dev/null
@@ -1,509 +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.sse.core.internal.encoding;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.StringReader;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.UnmappableCharacterException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.eclipse.wst.sse.core.internal.exceptions.CharConversionErrorWithDetail;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedOutputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
-
-
-public class CodedStreamCreator extends CodedIO {
-
- private final static int INITIAL_BUFFER_SIZE = 1024 * 16;
-
- // the 32 bytes used by default by ByteOutputStream is
- // a little small
- private static final String PROGRAM_ERROR__FAILED_TO_FIND_ANY_CHARSET_ANYWHERE_ = "Program error: failed to find any charset anywhere!"; //$NON-NLS-1$
-
- private static final String UTF_16BE_CHARSET_NAME = "UTF-16BE"; //$NON-NLS-1$
- private static final String UTF_16LE_CHARSET_NAME = "UTF-16LE"; //$NON-NLS-1$
- // private static final String UTF_16_CHARSET_NAME = "UTF-16";
- // //$NON-NLS-1$
-
- private static final String UTF_8_CHARSET_NAME = "UTF-8"; //$NON-NLS-1$
-
- private boolean fClientSuppliedReader;
-
- // future_TODO: this 'checkConversion' can be a little
- // pricey for large
- // files, chould be a user preference, or something.
- // private static final boolean checkConversion = true;
- private EncodingMemento fCurrentEncodingMemento;
-
- private EncodingMemento fEncodingMemento;
-
- private String fFilename;
-
- private boolean fHasBeenAnalyzed;
-
- private IFile fIFile;
-
- private EncodingMemento fPreviousEncodingMemento;
-
- private Reader fReader;
-
- private Reader fResettableReader;
- private byte[] UTF16BEBOM = new byte[]{(byte) 0xFE, (byte) 0xFF};
-
- private byte[] UTF16LEBOM = new byte[]{(byte) 0xFF, (byte) 0xFE};
- private byte[] UTF3BYTEBOM = new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
-
- public CodedStreamCreator() {
- super();
- }
-
- public CodedStreamCreator(String filename, char[] characterArray) {
- super();
- fFilename = filename;
- fReader = new CharArrayReader(characterArray);
- }
-
- public CodedStreamCreator(String filename, Reader reader) {
- super();
- fFilename = filename;
- fReader = reader;
- }
-
- public CodedStreamCreator(String filename, String textString) {
- super();
- fFilename = filename;
- fReader = new StringReader(textString);
- }
-
- /**
- * The primary method which contains the highest level rules for how to
- * decide appropriate decoding rules: 1. first check for unicode stream 2.
- * then looked for encoding specified in content (according to the type of
- * content that is it ... xml, html, jsp, etc. 3. then check for various
- * settings: file settings first, if null check project settings, if null,
- * check user preferences. 4. lastly (or, what is the last user
- * preference) is to use "workbench defaults".
- */
- private void analyze() throws CoreException, IOException {
- Reader resettableReader = getResettableReader();
- try {
- if (fCurrentEncodingMemento == null) {
- resettableReader.reset();
- fCurrentEncodingMemento = checkForEncodingInContents();
- }
- // if encoding stratagy doesn't provide answer,
- // then try file settings, project settings,
- // user preferences, and
- // finally workbench default.
- //
- if (fCurrentEncodingMemento == null || fCurrentEncodingMemento.getDetectedCharsetName() == null) {
- resettableReader.reset();
- fCurrentEncodingMemento = getEncodingMementoFromResourceAndPreference();
- }
-
- // use DefaultNameRules from NonContentBasedEncodingRules as the
- // final default
- if (fEncodingMemento == null) {
- handleNotProvidedFromContentCase();
- }
-
- fHasBeenAnalyzed = true;
- } finally {
- if (resettableReader != null) {
- resettableReader.reset();
- }
- }
- }
-
- /**
- * Need to check conversion early on. There's some danger than old
- * contents of a file are set to empty, if an exception occurs.
- *
- * @param allText
- * @param encoding
- * @param encodingRule
- * @throws java.io.UnsupportedEncodingException
- * @throws MalformedOutputExceptionWithDetail
- * @deprecated - we need to find "cheaper" way to to this functionality so
- * likely to go away in future
- */
- private void checkConversion(EncodingMemento memento, EncodingRule encodingRule) throws IOException {
- String javaEncoding = memento.getJavaCharsetName();
- String detectedEncoding = memento.getDetectedCharsetName();
- Charset charset = Charset.forName(javaEncoding);
- CharsetEncoder charsetEncoder = charset.newEncoder();
- charsetEncoder.onMalformedInput(CodingErrorAction.REPORT);
- charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPORT);
- Reader reader = getResettableReader();
- reader.reset();
- int currentChar = reader.read();
- int currentPos = 1;
- try {
- while (currentChar != -1) {
- // note: this can probably be made more
- // efficient later to
- // check buffer by buffer, instead of
- // character by character.
- try {
- boolean canConvert = charsetEncoder.canEncode((char) currentChar);
- if (!canConvert) {
- if (encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR) {
- // if we're told to ignore the
- // encoding conversion
- // error,
- // notice we still want to detect
- // and log it. We simply
- // don't throw the exception, and
- // we do continue with
- // the
- // save.
- Logger.log(Logger.ERROR, "Encoding Conversion Error during save"); //$NON-NLS-1$
- } else {
- throw new MalformedOutputExceptionWithDetail(javaEncoding, detectedEncoding, currentPos);
- }
- }
- currentChar = reader.read();
- currentPos++;
- }
- // IBM's JRE seems to throw NPE when DBCS char is given to
- // SBCS charsetEncoder
- catch (NullPointerException e) {
- throw new CharConversionErrorWithDetail(javaEncoding); //$NON-NLS-1$
- }
- }
- // if we get all the way through loop without throwing exception,
- // then there must
- // be an error not detectable when going character by character.
- throw new CharConversionErrorWithDetail(javaEncoding); //$NON-NLS-1$
- } finally {
- reader.reset();
- }
- }
-
- private EncodingMemento checkForEncodingInContents() throws CoreException, IOException {
- EncodingMemento result = null;
-
- // if encoding memento already set, and no need to get again.
- if (fEncodingMemento != null) {
- result = fEncodingMemento;
- } else {
- if (fClientSuppliedReader) {
- fReader.reset();
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- try {
- IContentDescription contentDescription = contentTypeManager.getDescriptionFor(fReader, fFilename, IContentDescription.ALL);
- if (contentDescription != null) {
- fEncodingMemento = createMemento(contentDescription);
- } else {
- fEncodingMemento = CodedIO.createEncodingMemento("UTF-8"); //$NON-NLS-1$
- }
- } catch (NullPointerException e) {
- // TODO: work around for 5/14 bug in base, should be
- // removed when move up to 5/21
- // just created a simple default one
- fEncodingMemento = CodedIO.createEncodingMemento("UTF-8"); //$NON-NLS-1$
- }
- result = fEncodingMemento;
- } else {
- throw new IllegalStateException("unexpected state: encodingMemento was null but no input stream supplied"); //$NON-NLS-1$
- }
- }
- // try {
- // result = getEncodingDetector().getEncodingMemento();
- // if (result != null && !result.isValid() && !forceDefault()) {
- // throw new UnsupportedCharsetExceptionWithDetail(result);
- // }
- // }
- // finally {
- // handleStreamClose(fEncodingDetectorStream);
- // }
- return result;
- }
-
-
- private void dump(OutputStream outputStream, EncodingRule encodingRule, boolean use3ByteBOMifUTF8) throws CoreException, IOException {
- getCurrentEncodingMemento();
- String javaEncodingName = null;
- if (encodingRule == EncodingRule.CONTENT_BASED) {
- if (fCurrentEncodingMemento.isValid()) {
- javaEncodingName = fCurrentEncodingMemento.getJavaCharsetName();
- } else {
- throw new UnsupportedCharsetExceptionWithDetail(fCurrentEncodingMemento);
- }
- } else if (encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR)
- javaEncodingName = fCurrentEncodingMemento.getJavaCharsetName();
- else if (encodingRule == EncodingRule.FORCE_DEFAULT)
- javaEncodingName = fCurrentEncodingMemento.getAppropriateDefault();
- // write appropriate "header" unicode BOM bytes
- // Note: Java seems to write appropriate header for
- // UTF-16, but not
- // UTF-8 nor UTF-16BE. This
- // may vary by JRE version, so need to test well.
- // Note: javaEncodingName can be null in invalid
- // cases, so we no hard
- // to skip whole check if that's the case.
- if (javaEncodingName != null) {
- if ((javaEncodingName.equals(UTF_8_CHARSET_NAME) && use3ByteBOMifUTF8) || (javaEncodingName.equals(UTF_8_CHARSET_NAME) && fCurrentEncodingMemento.isUTF83ByteBOMUsed())) {
- outputStream.write(UTF3BYTEBOM);
- } else if (javaEncodingName.equals(UTF_16LE_CHARSET_NAME)) {
- outputStream.write(UTF16LEBOM);
- } else if (javaEncodingName.equals(UTF_16BE_CHARSET_NAME)) {
- outputStream.write(UTF16BEBOM);
- }
- }
- // TODO add back in line delimiter handling the
- // "right" way (updating
- // markers, not requiring string, etc. .. may need
- // to move to document
- // level)
- //allTextBuffer =
- // handleLineDelimiter(allTextBuffer, document);
- Reader reader = getResettableReader();
- // be sure to test large "readers" ... we'll need
- // to make sure they all
- // can reset to initial position (StringReader,
- // CharArrayReader, and
- // DocumentReader should all work ok).
- reader.reset();
- // There must be cleaner logic somehow, but the
- // idea is that
- // javaEncodingName can be null
- // if original detected encoding is not valid (and
- // if FORCE_DEFAULT was
- // not specified). Hence, we WANT the first
- // Charset.forName to
- // throw appropriate exception.
- Charset charset = null;
-
- // this call checks "override" properties file
- javaEncodingName = CodedIO.getAppropriateJavaCharset(javaEncodingName);
-
- if (javaEncodingName == null) {
- charset = Charset.forName(fCurrentEncodingMemento.getDetectedCharsetName());
- } else {
- charset = Charset.forName(javaEncodingName);
- }
- CharsetEncoder charsetEncoder = charset.newEncoder();
- if (!(encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR)) {
- charsetEncoder.onMalformedInput(CodingErrorAction.REPORT);
- charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPORT);
- } else {
- charsetEncoder.onMalformedInput(CodingErrorAction.REPLACE);
- charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
-
- }
- OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, charsetEncoder);
- //TODO: this may no longer be needed (and is at
- // least wrong spot for
- // it).
- // if (checkConversion && (!(encodingRule ==
- // EncodingRule.IGNORE_CONVERSION_ERROR))) {
- // checkConversion(fCurrentEncodingMemento,
- // encodingRule);
- // }
- char[] charbuf = new char[CodedIO.MAX_BUF_SIZE];
- int nRead = 0;
- try {
- while (nRead != -1) {
- nRead = reader.read(charbuf, 0, MAX_BUF_SIZE);
- if (nRead > 0) {
- outputStreamWriter.flush();
- outputStreamWriter.write(charbuf, 0, nRead);
- }
- }
- } catch (UnmappableCharacterException e) {
- checkConversion(fCurrentEncodingMemento, encodingRule);
- } finally {
- // since we don't own the original output stream, we
- // won't close it ours.
- // the caller who passed it to us must close original one
- // when appropriate.
- // (but we do flush to be sure all up-to-date)
- outputStreamWriter.flush();
- }
- }
-
- private boolean get3ByteBOMPreference() {
- return SSECorePlugin.getDefault().getPluginPreferences().getBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
- }
-
- public ByteArrayOutputStream getCodedByteArrayOutputStream() throws CoreException, IOException {
- return getCodedByteArrayOutputStream(EncodingRule.CONTENT_BASED);
- }
-
- public ByteArrayOutputStream getCodedByteArrayOutputStream(EncodingRule encodingRule) throws CoreException, IOException {
- //Assert.isNotNull(fPreviousEncodingMemento,
- // "previousEncodingMemento
- // needs to be set first");
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(INITIAL_BUFFER_SIZE);
- dump(byteArrayOutputStream, encodingRule, get3ByteBOMPreference());
- return byteArrayOutputStream;
- }
-
- public EncodingMemento getCurrentEncodingMemento() throws CoreException, IOException {
- //Assert.isNotNull(fPreviousEncodingMemento,
- // "previousEncodingMemento
- // needs to be set first");
- if (!fHasBeenAnalyzed) {
- analyze();
- }
- // post condition
- Assert.isNotNull(fCurrentEncodingMemento, "illegal post condition state"); //$NON-NLS-1$
- // be sure to carry over appropriate encoding
- // "state" that may be
- // relevent.
- if (fPreviousEncodingMemento != null) {
- fCurrentEncodingMemento.setUTF83ByteBOMUsed(fPreviousEncodingMemento.isUTF83ByteBOMUsed());
- }
- return fCurrentEncodingMemento;
- }
-
- /*
- * This method is called only when encoding is not detected in the file.
- *
- * Here is encoding lookup order we will try: - try resource content
- * description (Eclipse Text file encoding) - try resource content
- * properties (for JSP only) - try content type encoding preferences (for
- * HTML only) - try resource content description (Eclipse Text file
- * encoding, implicit check)
- *
- * Note: This method appears in both CodedReaderCreator and
- * CodedStreamCreator (with just a minor difference). They should be kept
- * the same.
- */
- private EncodingMemento getEncodingMementoFromResourceAndPreference() throws IOException, CoreException {
- EncodingMemento encodingMemento = fEncodingMemento;
-
- // Follow Eclipse Platform's direction. Get the charset from IFile.
- if (fIFile != null) {
- String charset = fIFile.getCharset();
- encodingMemento = CodedIO.createEncodingMemento(charset);
- }
-
- return encodingMemento;
- }
-
- private Reader getResettableReader() {
- if (fResettableReader == null) {
- if (fReader.markSupported()) {
- fResettableReader = fReader;
- } else {
- fResettableReader = new BufferedReader(fReader);
- try {
- fResettableReader.mark(MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossible, since we just checked if
- // markable
- throw new Error(e);
- }
-
- }
- }
- return fResettableReader;
- }
-
- protected void handleNotProvidedFromContentCase() {
- // move to "detectors" if not already
- String specDefault = null;
- //specDefault = getEncodingDetector().getSpecDefaultEncoding();
- String charset = NonContentBasedEncodingRules.useDefaultNameRules(specDefault);
- Assert.isNotNull(charset, PROGRAM_ERROR__FAILED_TO_FIND_ANY_CHARSET_ANYWHERE_);
- fCurrentEncodingMemento = CodedIO.createEncodingMemento(charset);
- }
-
- // TODO We just copy the content properties encoding to current resource's
- // encoding for now. May improve the UI later by setting an informational
- // message and/or disable the content properties encoding field.
- // TODO make priviate if needed, else remove
- void migrateContentPropertiesEncoding(String encoding) throws CoreException {
- if (fIFile != null)
- fIFile.setCharset(encoding, null);
- final IFile file = fIFile;
- final String charset = encoding;
- // TODO: externalize string later
- Job migrater = new Job(SSECoreMessages.Migrate_Charset) { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (file != null) {
- try {
- file.setCharset(charset, null);
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
- return Status.OK_STATUS;
- }
- };
- migrater.setSystem(true);
- migrater.schedule();
-
- }
-
- /**
- *
- */
- private void resetAll() {
- fFilename = null;
- fReader = null;
- fPreviousEncodingMemento = null;
- fCurrentEncodingMemento = null;
- fHasBeenAnalyzed = false;
- fClientSuppliedReader = false;
- }
-
- public void set(IFile file, Reader reader) {
- fIFile = file;
- set(file.getName(), reader);
- }
-
- public void set(String filename, char[] characterArray) {
- resetAll();
- fFilename = filename;
- fReader = new CharArrayReader(characterArray);
- }
-
- public void set(String filename, Reader reader) {
- resetAll();
- fFilename = filename;
- fReader = reader;
- fClientSuppliedReader = true;
- }
-
- public void set(String filename, String textString) {
- set(filename, new StringReader(textString));
- }
-
- public void setPreviousEncodingMemento(EncodingMemento previousEncodingMemento) {
- fPreviousEncodingMemento = previousEncodingMemento;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java
deleted file mode 100644
index b563a28845..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.osgi.framework.Bundle;
-
-/**
- * CommonCharsets is a utility class to provide a central place to map some
- * IANA charset name to a Java charset name. In 1.4 JRE's this mostly is a
- * thin wrapper of existing Charset functionality. It does, however, allow
- * some "overriding" of the built in JRE mappings in the event they are
- * necessary. See CodedIO.checkMappingOverrides.
- * <p>
- * This class also provides some convenient human readable description for the
- * charset names which can be used in user interfaces. The description is NL
- * aware based on locale. The data is populated via the charset.properties
- * file only once, based on static initialization of the hashtables.
- * <p>
- * The IANA tags are based on reference information found at the
- * http://www.iana.org site. Specifically see
- * http://www.iana.org/assignments/character-sets
- */
-public final class CommonCharsetNames {
-
- private static Properties defaultIANAmappings = null;
-
- private static ArrayList encodings = null;
-
- private static Hashtable supportedEncodingDisplayNames = null;
-
- private static Map prefNames = null;
-
- /**
- * Returns list of commonly available encoding names. Suitable for
- * populating a UI dialog or drop down. This list would be a subset of all
- * possible charsets the VM supports (which can get into the hundreds).
- * For the VM supported charsets, use
- * <code>Charset.availableCharsets()</code>
- *
- * @return String[]
- */
- public static String[] getCommonCharsetNames() {
- String[] enc = new String[getEncodings().size()];
- getEncodings().toArray(enc);
- return enc;
- }
-
- /**
- * @return Returns the defaultIANAmappings.
- */
- private static Properties getDefaultIANAMappings() {
- if (defaultIANAmappings == null) {
- defaultIANAmappings = new Properties();
- Bundle keyBundle = Platform.getBundle(ICodedResourcePlugin.ID);
- IPath keyPath = new Path("config/defaultIANA.properties"); //$NON-NLS-1$
- URL location = Platform.find(keyBundle, keyPath);
- InputStream propertiesInputStream = null;
- try {
- propertiesInputStream = location.openStream();
- defaultIANAmappings.load(propertiesInputStream);
- }
- catch (IOException e) {
- // if can't read, just assume there's no
- // default IANA mappings
- // and repeated attempts will not occur,
- // since they
- // will be represented by an empty
- // Properties object
- }
- }
- return defaultIANAmappings;
- }
-
- /**
- * Returns display (translated) string for encoding name. If there is no
- * "custom" translated version available, it defers to ther VM's Charset
- * support. It will return null if no display name is available.
- *
- * @param String
- * charset name
- * @return Human friendly display name
- */
- public static String getDisplayString(String charsetName) {
- if (charsetName == null)
- return null;
- String result = (String) getSupportedEncodingDisplayNames().get(charsetName);
- if (result == null) {
- // if we don't have a special one, just return
- // what's provided by Charset
-
- try {
- Charset charset = Charset.forName(charsetName);
- result = charset.displayName();
- }
- catch (UnsupportedCharsetException e) {
- // if not supported, the display name is
- // the least of clients concerns :)
- }
- }
- return result;
- }
-
- public static String getPreferenceName(String charsetName) {
- if (charsetName == null)
- return null;
-
- String result = (String) getPreferenceNames().get(charsetName);
- if (result == null) {
- return charsetName;
- }
-
- return result;
- }
- /**
- * @return Returns the javaEncodings.
- */
- private static ArrayList getEncodings() {
- if (encodings == null) {
- initHashTables();
- }
- return encodings;
- }
-
- public static String getIanaPreferredCharsetName(String charsetName) {
- String preferredName = charsetName;
-
- try {
- Charset charset = Charset.forName(charsetName);
- if (charset.name() != null) {
- preferredName = charset.name();
- }
- }
- catch (IllegalCharsetNameException e) {
- // just return input if illegal
- }
- catch (UnsupportedCharsetException e) {
- // just return input if illegal
- }
- return preferredName;
- }
-
- /**
- * Returns a default IANA name that is listed in CommonCharsetNames. Here
- * is how it checks: 1. check to see if charsetName is in the
- * CommonCharsetNames list and if so, just return it. 2. check to see if
- * charsetName is listed in defaultIANAmappings which contains a mapping
- * of more common encodings and the default IANA name they should map to.
- * 3. return defaultIanaName if all else fails
- */
- public static String getPreferredDefaultIanaName(String charsetName, String defaultIanaName) {
- String preferredName = defaultIanaName;
- String guessedName = charsetName;
- try {
- guessedName = CodedIO.getAppropriateJavaCharset(charsetName);
- }
- catch (IllegalCharsetNameException e) {
- // just ignore if illegal
- }
- catch (UnsupportedCharsetException e) {
- // just ignore if illegal
- }
- if (getEncodings().contains(guessedName))
- preferredName = guessedName;
- else {
- preferredName = getDefaultIANAMappings().getProperty(guessedName, preferredName);
- }
-
- return preferredName;
- }
-
- /**
- * @return
- */
- private static Hashtable getSupportedEncodingDisplayNames() {
- if (supportedEncodingDisplayNames == null) {
- initHashTables();
- }
- return supportedEncodingDisplayNames;
- }
-
- private static Map getPreferenceNames() {
- if (prefNames == null) {
- initHashTables();
- }
- return prefNames;
- }
-
- private static void initHashTables() {
- if (supportedEncodingDisplayNames == null) {
- // Initialize hash table for encoding table
- supportedEncodingDisplayNames = new Hashtable();
- encodings = new ArrayList();
- prefNames = new HashMap();
-
- ResourceBundle bundle = null;
- InputStream bundleStream = null;
- try {
- URL bundleURL = Platform.find(Platform.getBundle(ICodedResourcePlugin.ID), Path.fromOSString("$nl$/config/charset.properties")); //$NON-NLS-1$
- if (bundleURL != null) {
- bundleStream = bundleURL.openStream();
- bundle = new PropertyResourceBundle(bundleStream);
- }
-
- String totalNumString = bundle.getString("totalnumber");//$NON-NLS-1$
- int totalNum = 0;
- if (totalNumString.length() != 0) {
- try {
- totalNum = Integer.valueOf(totalNumString).intValue();
- }
- catch (NumberFormatException e) {
- totalNum = 0;
- }
- }
-
- for (int i = 0; i < totalNum; i++) {
- String iana = bundle.getString("codeset." + i + ".iana");//$NON-NLS-2$//$NON-NLS-1$
- String displayName = bundle.getString("codeset." + i + ".label");//$NON-NLS-2$//$NON-NLS-1$
- String prefName = null;
- try {
- prefName = bundle.getString("codeset." + i + ".prefName"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (MissingResourceException e) {
- }
-
- encodings.add(iana);
- supportedEncodingDisplayNames.put(iana, displayName);
- if (prefName != null)
- prefNames.put(prefName, iana);
- }
- }
- catch (IOException e) {
- Logger.logException("invalid install or configuration", e); //$NON-NLS-1$
- }
- finally {
- try {
- if (bundleStream != null)
- bundleStream.close();
- }
- catch (IOException x) {
- }
- }
- }
- }
-
- public static void main(String[] args) {
- // unit test only
- String test = "Cp1252"; //$NON-NLS-1$
- String result = CommonCharsetNames.getIanaPreferredCharsetName(test);
- System.out.println(test + " --> " + result); //$NON-NLS-1$
-
- test = "MS932"; //$NON-NLS-1$
- result = CommonCharsetNames.getIanaPreferredCharsetName(test);
- System.out.println(test + " --> " + result); //$NON-NLS-1$
-
- }
-
- public CommonCharsetNames() {
- super();
- initHashTables();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java
deleted file mode 100644
index 087e03accc..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java
+++ /dev/null
@@ -1,81 +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.sse.core.internal.encoding;
-
-/**
- * Common preference keys used to specify encoding and end of line.
- */
-public class CommonEncodingPreferenceNames {
-
- private CommonEncodingPreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * Constant to be used when referring to CR/MAC line delimiter
- * @deprecated - no longer used
- */
- public static final String CR = "EOL_Mac"; //$NON-NLS-1$
- /**
- * Constant to be used when referring to CRLF/WINDOWS line delimiter
- * @deprecated - no longer used
- */
- public static final String CRLF = "EOL_Windows"; //$NON-NLS-1$
- /**
- * The end-of-line character(s) to use.
- * @deprecated - no longer used
- */
- public static final String END_OF_LINE_CODE = "endOfLineCode";//$NON-NLS-1$
- /**
- * The character code to use when reading a file.
- */
- public static final String INPUT_CODESET = "inputCodeset";//$NON-NLS-1$
-
- /**
- * Constant to be used when referring to LF/UNIX line delimiter
- * @deprecated - no longer used
- */
- public static final String LF = "EOL_Unix"; //$NON-NLS-1$
- /**
- * Constant to be used when referring to No translation of line delimiters
- * @deprecated - no longer used
- */
- public static final String NO_TRANSLATION = ""; //$NON-NLS-1$
- /**
- * The character code to use when writing a file.
- */
- public static final String OUTPUT_CODESET = "outputCodeset";//$NON-NLS-1$
-
- /**
- * String representation of CR/MAC line delimiter
- * @deprecated - no longer used
- */
- public static final String STRING_CR = "\r";//$NON-NLS-1$
-
- /**
- * String representation of CRLF/WINDOWS line delimiter
- * @deprecated - no longer used
- */
- public static final String STRING_CRLF = "\r\n";//$NON-NLS-1$
-
- /**
- * String representation of LF/UNIX line delimiter
- * @deprecated - no longer used
- */
- public static final String STRING_LF = "\n";//$NON-NLS-1$
-
- /**
- * String Use 3 byte BOM (Byte Order Mark) when saving UTF-8 encoded files
- */
- public static final String USE_3BYTE_BOM_WITH_UTF8 = "Use3ByteBOMWithUTF8"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
deleted file mode 100644
index cd28db3745..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
+++ /dev/null
@@ -1,165 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.Preferences;
-
-
-public class ContentBasedPreferenceGateway {
- private static String DEFAULT_LOCATION = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- private static String RUNTIME_XML_ID = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
- private static String SSE_XML_ID = "org.eclipse.wst.xml.core.xmlsource"; //$NON-NLS-1$
-
- /**
- * @param pluginId
- * @return
- */
- private static boolean bundleExists(String pluginId) {
-
- // this just verifies there's really a plugin with this ID in "stack"
- Bundle bundle = Platform.getBundle(pluginId);
- return (!(bundle == null));
- }
-
- /**
- * @param contentType
- * @return
- */
- private static String getContributorPluginId(IContentType contentType) {
- // TODO: need to have registration info here, but for now, we'll use
- // simple heuristic to cover the cases we know about.
- String fullId = null;
- if (contentType == null) {
- fullId = DEFAULT_LOCATION;
- } else {
- fullId = contentType.getId();
- }
- // only one known case, so far, of hard coded re-direction
- // (not sure this is even needed, but just in case).
- // We don't want to store/change runtime.xml preferences
- if (RUNTIME_XML_ID.equals(fullId)) {
- fullId = SSE_XML_ID;
- }
- String pluginId = inferPluginId(fullId);
- return pluginId;
- }
-
- private static Preferences getDefaultPreferences(IContentType contentType) {
- IEclipsePreferences eclipsePreferences = Platform.getPreferencesService().getRootNode();
- // TODO: eventaully need extension mechanism to avoid these hard coded
- // mechanism.
- // The idea is to load/store based on plugin's preferences, where the
- // content type was contributed
- // Eventually, too, we could do more "dynamic lookup" to get parent
- // types for defaults, etc.
-
- // Get default plugin preferences
- String pluginPreferenceLocation = DefaultScope.SCOPE + IPath.SEPARATOR + getContributorPluginId(contentType);
- Preferences pluginPreferences = eclipsePreferences.node(pluginPreferenceLocation);
-
- // the below code does not work at this time because content type
- // preferences are stored in the place as plugin preferences
-
- // Preferences contentPreferences = null;
- // if (contentType != null) {
- // contentPreferences = pluginPreferences.node(contentType.getId());
- // }
- // else {
- // contentPreferences = pluginPreferences.node(DEFAULT_LOCATION );
- // }
- //
- // return contentPreferences;
-
- return pluginPreferences;
-
- }
-
- private static Preferences getDefaultPreferences(String contentTypeId) {
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
- return getDefaultPreferences(contentType);
- }
-
- public static Preferences getPreferences(IContentType contentType) {
- IEclipsePreferences eclipsePreferences = Platform.getPreferencesService().getRootNode();
- // TODO: eventaully need extension mechanism to avoid these hard coded
- // mechanism.
- // The idea is to load/store based on plugin's preferences, where the
- // content type was contributed
- // Eventually, too, we could do more "dynamic lookup" to get parent
- // types for defaults, etc.
-
- // Get instance plugin preferences
- String pluginPreferenceLocation = Plugin.PLUGIN_PREFERENCE_SCOPE + IPath.SEPARATOR + getContributorPluginId(contentType);
- Preferences pluginPreferences = eclipsePreferences.node(pluginPreferenceLocation);
-
- // the below code does not work at this time because content type
- // preferences are stored in the place as plugin preferences
-
- // Preferences contentPreferences = null;
- // if (contentType != null) {
- // contentPreferences = pluginPreferences.node(contentType.getId());
- // }
- // else {
- // contentPreferences = pluginPreferences.node(DEFAULT_LOCATION );
- // }
- //
- // return contentPreferences;
- return pluginPreferences;
-
- }
-
- public static Preferences getPreferences(String contentTypeId) {
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
- return getPreferences(contentType);
- }
-
- public static String getPreferencesString(IContentType contentType, String key) {
- Preferences preferences = getPreferences(contentType);
- String value = preferences.get(key, getDefaultPreferences(contentType).get(key, null));
- return value;
- }
-
- public static String getPreferencesString(String contentTypeId, String key) {
- Preferences preferences = getPreferences(contentTypeId);
- String value = preferences.get(key, getDefaultPreferences(contentTypeId).get(key, null));
- return value;
- }
-
- /**
- * @param fullId
- * @return
- */
- private static String inferPluginId(String fullId) {
- // simply trim off last "segment" from full ID.
- int lastSegmentPos = fullId.lastIndexOf('.');
- String pluginId = null;
- if (lastSegmentPos != -1) {
- pluginId = fullId.substring(0, lastSegmentPos);
- } else {
- // weird case? We'll at least put/get them somewhere
- pluginId = DEFAULT_LOCATION;
- }
- if (!bundleExists(pluginId)) {
- // use default location
- pluginId = DEFAULT_LOCATION;
- }
- return pluginId;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java
deleted file mode 100644
index 4c82676e67..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java
+++ /dev/null
@@ -1,179 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-
-
-/**
- * A convenience class to statically get preferenences.
- */
-
-public abstract class ContentTypeEncodingPreferences {
-
- // actually a null/empty string also means use workbench default so this
- // constant might not really be necessary
- public static final String WORKBENCH_DEFAULT = "WORKBENCH_DEFAULT"; //$NON-NLS-1$
-
-
- private static final String getJavaPlatformDefaultEncoding() {
- // note: its important to use this system property,
- // instead
- // of
- // ByteToCharConverter.getDefault().getCharacterEncoding()
- // inorder to handle changes "on the fly". the
- // ByteToCharConverter
- // default is apparently set only when VM starts.
- // There's not really any "cusomter scnererios"
- // that change the
- // default encoding "on the fly", but its at least
- // used during
- // our automated tests.
- String enc = System.getProperty("file.encoding"); //$NON-NLS-1$
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
-
- public static final String getPreferredNewLineDelimiter(String contentTypeId) {
- String result = null;
- String newLineCode = null;
- newLineCode = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.END_OF_LINE_CODE);
- if (newLineCode == null)
- result = null;
- else if (newLineCode.equals(CommonEncodingPreferenceNames.CR))
- result = CommonEncodingPreferenceNames.STRING_CR;
- else if (newLineCode.equals(CommonEncodingPreferenceNames.LF))
- result = CommonEncodingPreferenceNames.STRING_LF;
- else if (newLineCode.equals(CommonEncodingPreferenceNames.CRLF))
- result = CommonEncodingPreferenceNames.STRING_CRLF;
- return result;
- }
-
- /**
- * Returns current output encoding preference for contentTypeIdentifier
- * (unique IANA encoding)
- */
- public static final String getUserPreferredCharsetName(String contentTypeId) {
- String prefEncoding = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.OUTPUT_CODESET);
- String encoding = prefEncoding;
- // get workbench encoding preference if preference
- // requests it
- if (prefEncoding == null || prefEncoding.trim().length() == 0 || prefEncoding.equals(ContentTypeEncodingPreferences.WORKBENCH_DEFAULT)) {
- encoding = ContentTypeEncodingPreferences.getWorkbenchPreferredCharsetName();
- }
- return encoding;
- }
-
- /**
- * Utility method to get specified preference. Subclasses can't override,
- * since we expect this to work in a consistent way. Note: this is
- * specific to HTML and CSS and is intended to supply a "default spec"
- * other than the workbench platform's default, only for those cases where
- * there is no encoding specified anywhere else, e.g. in the file, or as a
- * file or folder property.
- */
- public static final String getUserSpecifiedDefaultEncodingPreference() {
- String ContentTypeID_HTML = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
- return getUserSpecifiedDefaultEncodingPreference(ContentTypeID_HTML);
- }
-
- public static final String getUserSpecifiedDefaultEncodingPreference(String contentTypeID) {
- String enc = null;
-
- // first try to get base's default encoding for content type
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
- if (contentType != null) {
- enc = contentType.getDefaultCharset();
- }
-
- // next try to get sse's default encoding for content type
- if (enc == null || enc.trim().length() == 0) {
- enc = ContentBasedPreferenceGateway.getPreferencesString(contentTypeID, CommonEncodingPreferenceNames.INPUT_CODESET);
- }
-
- // next, just try and use workbench encoding
- if (enc == null || enc.trim().length() == 0) {
- enc = getWorkbenchSpecifiedDefaultEncoding();
- }
-
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
- /**
- * Returns Workbench encoding preference. Note: if workbench encoding is
- * null, platform encoding will be returned.
- */
- private static final String getWorkbenchPreferredCharsetName() {
- String charset = ResourcesPlugin.getEncoding();
- charset = CommonCharsetNames.getIanaPreferredCharsetName(charset);
- return charset;
- }
-
- /**
- * Returns Workbench encoding preference. Will return null if none
- * specified.
- */
- private static final String getWorkbenchSpecifiedDefaultEncoding() {
- ResourcesPlugin resourcePlugin = ResourcesPlugin.getPlugin();
- String enc = resourcePlugin.getPluginPreferences().getString(ResourcesPlugin.PREF_ENCODING);
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
- public static final String useDefaultNameRules(IResourceCharsetDetector encodingProvider) {
- String result = null;
- String enc = null;
- enc = encodingProvider.getSpecDefaultEncoding();
- if (enc != null) {
- result = enc;
- } else {
- enc = getUserSpecifiedDefaultEncodingPreference();
- if (enc != null && enc.trim().length() > 0) {
- result = enc;
- } else {
- if (enc == null || enc.trim().length() == 0) {
- enc = getWorkbenchSpecifiedDefaultEncoding();
- if (enc != null) {
- result = enc;
- }
- }
- if (enc == null || enc.trim().length() == 0) {
- enc = getJavaPlatformDefaultEncoding();
- // enc should never be null (but we'll
- // check anyway)
- if (enc != null) {
- result = enc;
- }
- }
- }
- }
- Assert.isNotNull(enc, "post condition invalid"); //$NON-NLS-1$
- result = CodedIO.checkMappingOverrides(enc);
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
deleted file mode 100644
index c195a845b4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
+++ /dev/null
@@ -1,247 +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.wst.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.content.IContentDescription;
-
-
-/**
- * This class is to simply hold information and data about the type of
- * encoding found for a resource. It not only includes names, etc., but also
- * gives hints about the algorithm, or rule, that the encodng was determined.
- * Having all this info in a central object, associated with the Document
- * (technically, IStructuredDocument), allows for better user error messages,
- * and better handling of knowing how to dump a file, given we know how it was
- * loaded.
- *
- * Note: the data in this class is only valid if its has actually gone through
- * the loading or dumping sequence. It is not accurate, for example, if a
- * structuredDocument is simply created and then setText called. In this type
- * of case, accuracy for loading and dumping is not required, since its all
- * re-discovered. One limitation is that structuredDocument's created "from
- * scratch" this way, don't have any encoding information to count on, and
- * would have to arrange the processing to be done. (And it is done,
- * automatically if going through loader or dumper, but perhaps not in future
- * new uses. TODO: this can be inproved in future versions.)
- *
- * isInitialized is set when the loader or dumper processes have been used,
- * but even this can't be counted on 100% if the document has been modified
- * since.
- *
- */
-public class EncodingMemento implements Cloneable {
-
- public final static String CLONED = "cloned"; //$NON-NLS-1$
- public final static String DEFAULTS_ASSUMED_FOR_EMPTY_INPUT = "DefaultsAssumedForEmptyInput"; //$NON-NLS-1$
- public final static String DEFAULTS_USED_DUE_TO_SMALL_STREAM = "defaultsUsedDueToSmallStream"; //$NON-NLS-1$
-
-
- /*
- * Strings to be used for tracing. TODO: need to clean this up, we no
- * longer use all of them
- */
- public final static String DETECTED_STANDARD_UNICODE_BYTES = "detectedStandardUnicodeBytes"; //$NON-NLS-1$
- public final static String FOUND_ENCODING_IN_CONTENT = "foundEncodingInContent"; //$NON-NLS-1$
- public final static String FOUND_ENCODING_IN_STREAM = "foundEncodingInStream"; //$NON-NLS-1$
- public final static String FOUND_ENCODING_IN_STRUCTURED_DOCUMENT = "foundEncodingInStructuredDocument"; //$NON-NLS-1$
- public final static String GUESSED_ENCODING_FROM_STREAM = "GuessEncodingFromStream"; //$NON-NLS-1$
- public final static String JAVA_NAME_FOUND_AS_IANA_NAME = "noMappingFoundButJavaNameFoundToBeIANAName"; //$NON-NLS-1$
- public final static String JAVA_NAME_FOUND_IN_ALIAS_NAME = "noMappingFoundButJavaNameFoundInAliasTable"; //$NON-NLS-1$
- public final static String NO_IANA_NAME_FOUND = "noMappingFoundFromJavaNameToIANAName"; //$NON-NLS-1$
- public final static String USED_CONTENT_TYPE_DEFAULT = "UsedContentTypeDefault"; //$NON-NLS-1$
- public final static String USED_JAVA_DEFAULT = "UsedJavaDefault"; //$NON-NLS-1$
- public final static String USED_MEMENTO_FROM_LOAD = "usedMementoFromLoad"; //$NON-NLS-1$
- public final static String USED_PROPERTY_SETTINGS = "USED_PROPERTY_SETTINGS"; //$NON-NLS-1$
- public final static String USED_USER_SPECIFIED_PREFERENCE = "UsedUserSpecifiedPreference"; //$NON-NLS-1$
- public final static String USED_WORKSPACE_DEFAULT = "UsedWorkspaceDefault"; //$NON-NLS-1$
- public final static String USER_IS_USING_JAVA_ENCODING = "UserIsUsingJavaEncoding"; //$NON-NLS-1$
- private String fAppropriateDefault;
- private String fDetectedCharsetName;
- private String fInvalidEncoding;
-
-
- private String fJavaCharsetName;
- private boolean fUnicodeStream;
- private boolean fUTF83ByteBOMUsed;
-
- private byte[] fBOM;
-
- public EncodingMemento() {
- super();
- }
-
- /**
- * Returns a clone of this object.
- */
- public Object clone() {
- EncodingMemento object = null;
- try {
- object = (EncodingMemento) super.clone();
- }
- catch (CloneNotSupportedException e) {
- // impossible, since we're implementing here
- }
-
- return object;
-
- }
-
- /**
- * Returns the appropriateDefault. This is only set if an invalid encoding
- * was found, and contains an charset appropriate to use as a default
- * value, if, for example, the user decides to load the document anyway,
- * even though the charset was found to be invalid.
- *
- * @return String
- */
- public String getAppropriateDefault() {
- if (fAppropriateDefault == null) {
- fAppropriateDefault = NonContentBasedEncodingRules.useDefaultNameRules(null);
- }
- return fAppropriateDefault;
- }
-
- /**
- * Returns the charset name, if it is different from the charset name
- * found in getJavaCharsetName. This can happen, for example, if there are
- * differences in case. This method might return SHIFT_JIS, and the the
- * getJavaCharsetName might return Shift_JIS -- if SHIFT_JIS was detected
- * in file/document. If the original file contained the correct case, then
- * this method would return null. The getJavaCharsetName is typically the
- * one that should always be used, and this one only used for certain
- * error conditions, or or if when creating a "duplicate" resource, it was
- * desired to use exactly the charset name as in the original document. As
- * an example of this later case, the original document might contain
- * ISO-8859-9, but the detected charset name might contain ISO-8859-9-I.
- *
- * @return String
- */
- public String getDetectedCharsetName() {
- return fDetectedCharsetName;
- }
-
- /**
- * Returns a charset name that was detected, but not found to be a charset
- * suppoorted by the VM.
- *
- * @return String
- */
- public String getInvalidEncoding() {
- return fInvalidEncoding;
- }
-
- /**
- * Returns the java cononical charset name.
- *
- * @return String
- */
- public String getJavaCharsetName() {
- return fJavaCharsetName;
- }
-
- /**
- * Note: we may be able to remove this method, if it turns out this work
- * is done by "text" type.
- *
- * @deprecated -
- */
- public byte[] getUnicodeBOM() {
- byte[] bom = null;
- if (isUTF83ByteBOMUsed())
- bom = IContentDescription.BOM_UTF_8;
- else if (isUnicodeStream())
- bom = fBOM;
- return bom;
- }
-
- /**
- * Note: in our implementation, the stream is a unicode stream if the
- * charset is UTF-16, UTF-16LE, or UTF-16BE. A stream with 3 byte BOM is
- * not considered unicode stream here.
- *
- * @return returns true if is a unicode (UTF-16) stream
- */
- public boolean isUnicodeStream() {
- return fUnicodeStream;
- }
-
- /**
- * Note: in our implementation, the stream is a unicode stream if the
- * charset is UTF-16, UTF-16LE, or UTF-16BE. A stream with 3 byte BOM is
- * not considered unicode stream here.
- *
- * Set during load, can be used by dumper to write 3 byte BOM, which Java
- * does not normally do. This helps maintain compatibility with other
- * programs (those that wrote the 3 byte BOM there to begin with.
- *
- * @return boolean
- */
- public boolean isUTF83ByteBOMUsed() {
- return fUTF83ByteBOMUsed;
- }
-
- public boolean isValid() {
- return getInvalidEncoding() == null;
- }
-
- /**
- * Sets the appropriateDefault.
- *
- * @param appropriateDefault
- * The appropriateDefault to set
- */
- public void setAppropriateDefault(String appropriateDefault) {
- fAppropriateDefault = appropriateDefault;
- }
-
-
- public void setDetectedCharsetName(String detectedCharsetName) {
- fDetectedCharsetName = detectedCharsetName;
- }
-
- public void setInvalidEncoding(String invalidEncoding) {
- fInvalidEncoding = invalidEncoding;
- }
-
- /**
- * Sets the javaEncodingName.
- *
- * @param javaEncodingName
- * The javaEncodingName to set
- */
- public void setJavaCharsetName(String javaCharsetName) {
- fJavaCharsetName = javaCharsetName;
- }
-
- /**
- * @param b
- */
- public void setUnicodeStream(boolean unicodeStream) {
- fUnicodeStream = unicodeStream;
-
- }
-
- /**
- * Sets the uTF83ByteBOMfound.
- *
- * @param uTF83ByteBOMfound
- * The uTF83ByteBOMfound to set
- */
- public void setUTF83ByteBOMUsed(boolean uTF83ByteBOMUsed) {
- fUTF83ByteBOMUsed = uTF83ByteBOMUsed;
- }
-
- public void setUnicodeBOM(byte[] bom) {
- fBOM = bom;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java
deleted file mode 100644
index 2d2988fa2e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java
+++ /dev/null
@@ -1,59 +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.sse.core.internal.encoding;
-
-
-/**
- * Class to provided "enumerated types" for encoding rule parameter. This is
- * to be used by client to have some control over how encoding is determined.
- */
-public class EncodingRule {
- /**
- * CONTENT_BASED means the class which uses the parameter (such as
- * contentType Loaders) should use what ever rules it normally would.
- * (Note, some content type loaders may not always literally use the file
- * content to determine encoding, but the point is they should use what
- * ever rules they normally would.)
- */
- public static final EncodingRule CONTENT_BASED = new EncodingRule("CONTENT_BASED"); //$NON-NLS-1$
- /**
- * FORCE_DEFAULT means the class which uses the parameter (such as
- * contentType Loaders) should use what ever it defines as the default
- * encoding.
- */
- public static final EncodingRule FORCE_DEFAULT = new EncodingRule("FORCE_DEFAULT"); //$NON-NLS-1$
-
- /**
- * IGNORE_CONVERSION_ERROR means that the save operation should save even
- * if it encounters conversion errors. This will result in some data loss,
- * so should only be used after the user confirms that is indeed what they
- * want to do.
- */
- public static final EncodingRule IGNORE_CONVERSION_ERROR = new EncodingRule("IGNORE_CONVERSION_ERROR"); //$NON-NLS-1$
-
-
- private final String encodingRule;
-
- /**
- * Constructor for EncodingRule is private, so no one can instantiate
- * except this class itself.
- */
- private EncodingRule(String ruleName) {
- super();
- encodingRule = ruleName;
- }
-
- public String toString() {
- return encodingRule;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java
deleted file mode 100644
index 4b4900f06c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java
+++ /dev/null
@@ -1,19 +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.sse.core.internal.encoding;
-
-
-public interface ICodedResourcePlugin {
- String ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java
deleted file mode 100644
index db2e0a4db9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java
+++ /dev/null
@@ -1,42 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-
-public interface IContentDescriptionExtended {
- /**
- * The APPROPRIATE_DEFAULT field is used only when the
- * IContentType.getDefaultCharset returns null. Its typically set from
- * user preferences. Known uses cases are HTML and CSS, where there is no
- * "spec default" for those content types.
- */
- public static final QualifiedName APPROPRIATE_DEFAULT = new QualifiedName(ICodedResourcePlugin.ID, "appropriateDefault"); //$NON-NLS-1$
- /**
- * The DETECTED_CHARSET property should be set when the "detected" charset
- * is different from the java charset, even though functionally
- * equivelent. This can occur, for example, when the cases are different,
- * or when an alias name is used instead of the conanical name.
- */
- public final static QualifiedName DETECTED_CHARSET = new QualifiedName(ICodedResourcePlugin.ID, "detectedCharset"); //$NON-NLS-1$
- /**
- * The UNSUPPORTED_CHARSET property holds the charset value, if its been
- * found to be an unsuppoted charset. This is helpful in error messages,
- * or in cases when even though the charset is invalid, the java charset
- * is assumed to be the default.
- */
- public final static QualifiedName UNSUPPORTED_CHARSET = new QualifiedName(ICodedResourcePlugin.ID, "unsupportedCharset"); //$NON-NLS-1$
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java
deleted file mode 100644
index 20dcbbff12..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java
+++ /dev/null
@@ -1,21 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-
-public interface IResourceCharsetDetector extends IStreamCharsetDetector {
- void set(IStorage iStorage) throws CoreException;
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java
deleted file mode 100644
index a2508f19a1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-public interface IStreamCharsetDetector {
- String getEncoding() throws IOException;
-
- String getSpecDefaultEncoding();
-
- void set(InputStream inputStream);
-
- void set(Reader reader);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java
deleted file mode 100644
index dd7158df74..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java
+++ /dev/null
@@ -1,139 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-
-public class NonContentBasedEncodingRules {
-
- private static final String getJavaPlatformDefaultEncoding() {
- String enc = System.getProperty("file.encoding"); //$NON-NLS-1$
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
-
- public static String getUserSpecifiedDefaultForContentType(IFile iFile) {
- String enc = null;
-
- IContentType contentType = null;
- try {
- contentType = iFile.getContentDescription().getContentType();
-
- // first try to get base's default encoding for content type
- if (contentType != null) {
- enc = contentType.getDefaultCharset();
- }
-
- // next try to get sse's default encoding for content type
- if (enc == null || enc.trim().length() == 0) {
- enc = ContentBasedPreferenceGateway.getPreferencesString(contentType, CommonEncodingPreferenceNames.INPUT_CODESET);
- }
-
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- } catch (CoreException e) {
- // if core exception occurs, assume no preference!
- enc = null;
- }
- return enc;
- }
-
- public static String getUserSpecifiedDefaultForContentType(String contentTypeId) {
- String enc = null;
-
- // first try to get base's default encoding for content type
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
- if (contentType != null) {
- enc = contentType.getDefaultCharset();
- }
-
- // next try to get sse's default encoding for content type
- if (enc == null || enc.trim().length() == 0) {
- enc = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.INPUT_CODESET);
- }
-
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
- private static final String getWorkbenchSpecifiedDefaultEncoding() {
- ResourcesPlugin resourcePlugin = ResourcesPlugin.getPlugin();
- String enc = resourcePlugin.getPluginPreferences().getString(ResourcesPlugin.PREF_ENCODING);
- // return blank as null
- if (enc != null && enc.trim().length() == 0) {
- enc = null;
- }
- return enc;
- }
-
- /**
- * @param specDefault
- * This is the default charset name that would ordinarily be
- * used for a particular type of content. Null may be
- * specififed for those types with no spec default. If the spec
- * default is known (and passed in), then it will be returned
- * after being checked to see if there's be any user specified
- * "override" for that charset (which would be rare). In other
- * words, if the spec is known, there's little reason to use
- * this method.
- * @return the charset that should be used according to the rules
- * established by this class.
- */
- public static final String useDefaultNameRules(String specDefault) {
- String enc = null;
- String result = null;
- enc = specDefault;
- if (enc != null) {
- result = enc;
- } else {
- enc = ContentTypeEncodingPreferences.getUserSpecifiedDefaultEncodingPreference();
- if (enc != null && enc.trim().length() > 0) {
- result = enc.trim();
- } else {
- if (enc == null || enc.trim().length() == 0) {
- enc = getWorkbenchSpecifiedDefaultEncoding();
- if (enc != null) {
- result = enc.trim();
- }
- }
- if (enc == null || enc.trim().length() == 0) {
- enc = getJavaPlatformDefaultEncoding();
- // enc should never be null (but we'll
- // check anyway)
- if (enc != null) {
- result = enc;
- }
- }
- }
- }
- result = CodedIO.checkMappingOverrides(result);
- return result;
- }
-
- private NonContentBasedEncodingRules() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java
deleted file mode 100644
index 4e1b370e40..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java
+++ /dev/null
@@ -1,120 +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.sse.core.internal.encoding.util;
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
- /**
- * <code>AssertionFailedException</code> is a runtime exception thrown
- * by some of the methods in <code>Assert</code>.
- * <p>
- * This class is not declared public to prevent some misuses; programs
- * that catch or otherwise depend on assertion failures are susceptible to
- * unexpected breakage when assertions in the code are added or removed.
- * </p>
- */
- static class AssertionFailedException extends RuntimeException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructs a new exception.
- */
- public AssertionFailedException() {
- super();
- }
-
- /**
- * Constructs a new exception with the given message.
- */
- public AssertionFailedException(String detail) {
- super(detail);
- }
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is not
- * <code>true</code>, an <code>IllegalArgumentException</code> is
- * thrown. The given message is included in that exception, to aid
- * debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- * @exception IllegalArgumentException
- * if the legality test failed
- */
- public static boolean isLegal(boolean expression, String message) {
- if (!expression)
- throw new AssertionFailedException(message);
- return expression;
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this is
- * not the case, some kind of unchecked exception is thrown. The given
- * message is included in that exception, to aid debugging.
- *
- * @param object
- * the value to test
- * @param message
- * the message to include in the exception
- * @exception IllegalArgumentException
- * if the object is <code>null</code>
- */
- public static void isNotNull(Object object, String message) {
- if (object == null) {
- throw new AssertionFailedException();
- }
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this is not
- * the case, some kind of unchecked exception is thrown. The given message
- * is included in that exception, to aid debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- */
- public static boolean isTrue(boolean expression, String message) {
- if (!expression) {
- throw new AssertionFailedException();
- }
- return expression;
- }
-
- /* This class is not intended to be instantiated. */
- private Assert() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java
deleted file mode 100644
index f026bdab4b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.wst.sse.core.internal.encoding.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * This is a pretty limited implementation, sort of specific
- * to the way its used by tokenizers (JFlex). To really
- * be general purpose, would need more work.
- *
- */
-
-
-public class BufferedLimitedReader extends BufferedReader {
- private int limitedCount;
- private int nRead;
-
- public BufferedLimitedReader(Reader reader, int size) {
- super(reader, size);
- if (reader.markSupported()) {
- try {
- mark(size);
- }
- catch (IOException e) {
- // impossible
- e.printStackTrace();
- }
- }
- limitedCount = size;
- }
-
- public int read() throws IOException {
- int result = 0;
- nRead++;
- if (nRead > limitedCount) {
- result = -1;
- }
- else {
- result = super.read();
- }
- return result;
-
- }
-
- public int read(char cbuf[], int off, int len) throws IOException {
- int result = 0;
- if (nRead + len > limitedCount) {
- result = -1;
- }
- else {
- result = super.read(cbuf, off, len);
- nRead = nRead + result;
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java
deleted file mode 100644
index 8928655363..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java
+++ /dev/null
@@ -1,79 +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.sse.core.internal.encoding.util;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class BufferedLimitedStream extends BufferedInputStream {
-
- private int limitedCount;
-
- public BufferedLimitedStream(InputStream inStream, int size) {
- super(inStream, size);
- mark(size);
- try {
- limitedCount = Math.min(size, inStream.available());
- } catch (IOException e) {
- // unlikely
- limitedCount = 0;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#available()
- */
- public synchronized int available() throws IOException {
-
- return limitedCount - pos;
- }
-
- /**
- * copied down from super class
- */
- private void ensureOpen() throws IOException {
- if (in == null)
- throw new IOException("Stream closed"); //$NON-NLS-1$
- }
-
- /**
- * copied down from super class then, changed to simiulate EOF if goes
- * beyond buffered amount
- */
- public synchronized int read() throws IOException {
- ensureOpen();
- // for this special stream, indicate "end of file" when buffer is
- // full
- if (pos >= limitedCount) {
- return -1;
- }
- return super.read();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#read(byte[], int, int)
- */
- public synchronized int read(byte[] b, int off, int len) throws IOException {
- // for this special stream, indicate "end of file" when buffer is
- // full
- if (pos >= limitedCount) {
- return -1;
- }
- return super.read(b, off, len);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java
deleted file mode 100644
index 35046e2846..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java
+++ /dev/null
@@ -1,109 +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.sse.core.internal.encoding.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- *
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
-
- public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
- protected byte[] fBuffer;
-
- protected InputStream fInputStream;
-
- protected ByteReader() {
- super();
- }
-
- public ByteReader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE);
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- }
-
- public ByteReader(InputStream inputStream, int size) {
- this.fInputStream = inputStream;
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- this.fBuffer = new byte[size];
-
- }
-
- public void close() throws IOException {
- this.fInputStream.close();
- }
-
- public void mark(int readAheadLimit) {
- this.fInputStream.mark(readAheadLimit);
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public int read() throws IOException {
- int b0 = this.fInputStream.read();
- return (b0 & 0x00FF);
- }
-
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > this.fBuffer.length) {
- length = this.fBuffer.length;
- }
-
- int count = this.fInputStream.read(this.fBuffer, 0, length);
-
- for (int i = 0; i < count; i++) {
- int b0 = this.fBuffer[i];
- // the 0x00FF is to "lose" the negative bits filled in the byte to
- // int conversion
- // (and which would be there if cast directly from byte to char).
- char c0 = (char) (b0 & 0x00FF);
- ch[offset + i] = c0;
- }
- return count;
- }
-
- public boolean ready() throws IOException {
- return this.fInputStream.available() > 0;
- }
-
- public void reset() throws IOException {
- this.fInputStream.reset();
- }
-
- public long skip(long n) throws IOException {
- return this.fInputStream.skip(n);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java
deleted file mode 100644
index 0c928cd5f7..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java
+++ /dev/null
@@ -1,55 +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.sse.core.internal.encoding.util;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CodedResourcePlugin extends Plugin implements ICodedResourcePlugin {
- //The shared instance.
- private static CodedResourcePlugin plugin;
-
- /**
- * Returns the shared instance.
- */
- public static CodedResourcePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * The constructor.
- */
- public CodedResourcePlugin() {
- super();
- plugin = this;
- }
-
- protected void initializeDefaultPluginPreferences() {
- Preferences prefs = getPluginPreferences();
- prefs.setDefault(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, false);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java
deleted file mode 100644
index 9e911b9b48..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.encoding.util;
-
-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.sse.core.internal.encoding"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java
deleted file mode 100644
index 6b44f2f1b1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java
+++ /dev/null
@@ -1,69 +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.sse.core.internal.encoding.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-
-public class NullInputStream extends InputStream {
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#mark(int)
- */
- public synchronized void mark(int readlimit) {
- // nothing to do
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#markSupported()
- */
- public boolean markSupported() {
- // we can mark nothing.
- // and, we are using this Null class specifically for
- // a "fake" resettable stream.
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#read()
- */
- public int read() throws IOException {
-
- return -1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#reset()
- */
- public synchronized void reset() throws IOException {
- // nothing to do
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#skip(long)
- */
- public long skip(long n) throws IOException {
- return 0;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java
deleted file mode 100644
index 14aaa1f2a6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java
+++ /dev/null
@@ -1,61 +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.sse.core.internal.encoding.util;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-
-//TODO: rework this with new platform/runtime APIs (if still needed).
-
-public class ResourceBundleHelper {
-
- public static ResourceBundle getResourceBundle(String resourceURI) throws MalformedURLException, IOException {
- return getResourceBundle(resourceURI, Locale.getDefault());
- }
-
- public static ResourceBundle getResourceBundle(String resourceURI, Locale targetLocale) throws MalformedURLException, IOException {
- // try to load bundle from the location specified in the resourceURI
- // we make the assumption that the resourceURI points to the local
- // file system
-
- int index = resourceURI.lastIndexOf("/"); //$NON-NLS-1$
- if (index == -1) {
- throw new IllegalArgumentException("Invalid resourceURI"); //$NON-NLS-1$
- }
-
- // Below we set 'resourceDirectory' so that it ends with a '/'.
- // Here's an excerpt from the ClassLoader Javadoc ...
- // Any URL that ends with a '/' is assumed to refer to a directory.
- // Otherwise, the URL is assumed
- // to refer to a JAR file which will be opened as needed.
- //
- String resourceDirectory = resourceURI.substring(0, index + 1);
- String resourceBundleName = resourceURI.substring(index + 1);
-
- // create a class loader with a class path that points to the resource
- // bundle's location
- //
- URL[] classpath = new URL[1];
- classpath[0] = Platform.resolve(new URL(resourceDirectory));
- ClassLoader resourceLoader = new URLClassLoader(classpath, null);
-
- return ResourceBundle.getBundle(resourceBundleName, targetLocale, resourceLoader);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java
deleted file mode 100644
index e3c9d995d4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java
+++ /dev/null
@@ -1,213 +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.sse.core.internal.encoding.util;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-/**
- * This is a "common function" class to decide if an input stream, is a
- * unicode stream.
- */
-public class UnicodeBOMEncodingDetector implements IResourceCharsetDetector {
-
- //private static final String UTF_16_CHARSET_NAME = "UTF-16";
- // //$NON-NLS-1$
-
- public static class NotEnoughInputForBOMException extends IOException {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public NotEnoughInputForBOMException() {
- super();
- }
-
- public NotEnoughInputForBOMException(String s) {
- super(s);
- }
-
- }
-
- private final static byte BB = (byte) 0xBB;
- private final static byte BF = (byte) 0xBF;
- private final static byte EF = (byte) 0xEF;
- private final static byte FE = (byte) -2;
-
- private final static byte FF = (byte) -1;
- private static final String UTF_16BE_CHARSET_NAME = "UTF-16BE"; //$NON-NLS-1$
- private static final String UTF_16LE_CHARSET_NAME = "UTF-16LE"; //$NON-NLS-1$
-
- private static final String UTF_8_CHARSET_NAME = "UTF-8"; //$NON-NLS-1$
-
- private InputStream fInputStream = null;
- private boolean fNoBOMPossible;
-
- private EncodingMemento checkForBOM(InputStream inputStream) {
- EncodingMemento result = null;
-
- try {
- byte b1 = getNextByte(inputStream);
- byte b2 = getNextByte(inputStream);
- if (b1 == FE && b2 == FF) {
- result = createEncodingMemento(UTF_16BE_CHARSET_NAME);
- result.setUnicodeStream(true);
- } else {
- if (b1 == FF && b2 == FE) {
- result = createEncodingMemento(UTF_16LE_CHARSET_NAME);
- result.setUnicodeStream(true);
- } else {
- byte b3 = getNextByte((inputStream));
- if (b1 == EF && b2 == BB && b3 == BF) {
- result = createEncodingMemento(UTF_8_CHARSET_NAME);
- result.setUTF83ByteBOMUsed(true);
- }
- }
- }
- } catch (NotEnoughInputForBOMException e) {
- // This is sort of unexpected for normal cases, but can occur for
- // empty
- // streams. And, this can occur "normally" for non-BOM streams
- // that
- // have only two
- // bytes, and for which those two bytes match the first two bytes
- // of UTF-8
- // BOM In any case, we'll simply return null;
- result = null;
- } catch (IOException e) {
- // other errors should be impossible
- throw new Error(e);
- }
-
- return result;
- }
-
- private EncodingMemento createEncodingMemento(String javaEncodingName) {
- EncodingMemento encodingMemento = new EncodingMemento();
- encodingMemento.setJavaCharsetName(javaEncodingName);
- String ianaName = Charset.forName(javaEncodingName).name();
- encodingMemento.setDetectedCharsetName(ianaName);
- if (javaEncodingName.equals(UTF_8_CHARSET_NAME)) {
- encodingMemento.setUTF83ByteBOMUsed(true);
- }
- return encodingMemento;
- }
-
- public String getEncoding() throws IOException {
-
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- /**
- * Returns IANA encoding name if BOM detected in stream. If a BOM is
- * detected, the stream is left positioned after readying the BOM. If a
- * BOM is not detected, the steam is reset.
- *
- * 0xFEFF UTF-16, big-endian 0xFFFE UTF-16, little-endian 0xEFBBBF UTF-8
- * (BOM is optional)
- *
- * @param inputStream -
- * must be a resetable (mark supported) stream so it can be
- * reset, if not BOM encoded stream
- * @return String - IANA encodingname (may not work well on 1.3, but 1.4
- * seems to have good support for IANA names)
- */
- public EncodingMemento getEncodingMemento() {
-
- EncodingMemento result = null;
- if (!fNoBOMPossible) {
-
- if (fInputStream == null)
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
-
- if (!fInputStream.markSupported()) {
- throw new IllegalArgumentException("inputStream must be resetable"); //$NON-NLS-1$
- }
-
- result = checkForBOM(fInputStream);
- }
-
- return result;
-
- }
-
- private byte getNextByte(InputStream inputStream) throws IOException {
-
- int byteCharAsInt = -1;
- // be sure we won't block
- if (inputStream.available() > 0) {
- byteCharAsInt = inputStream.read();
- byteCharAsInt = byteCharAsInt & 0XFF;
- }
- // to avoid confustion over meaning of returned byte,
- // throw exception if EOF reached.
- if (byteCharAsInt == -1)
- throw new NotEnoughInputForBOMException("typically not an error"); //$NON-NLS-1$
- return (byte) byteCharAsInt;
- }
-
- /**
- *
- */
-
- public String getSpecDefaultEncoding() {
- // There is no default for this case
- return null;
- }
-
- /**
- *
- */
- private void resetAll() {
- fNoBOMPossible = false;
- fInputStream = null;
-
- }
-
- /**
- *
- */
-
- public void set(InputStream inputStream) {
- resetAll();
- fInputStream = inputStream;
- }
-
- public void set(IStorage iStorage) throws CoreException {
- set(new BufferedInputStream(iStorage.getContents(), CodedIO.MAX_BUF_SIZE));
-
- }
-
- public void set(Reader reader) {
- if (reader instanceof ByteReader) {
- ByteReader byteReader = (ByteReader) reader;
- fInputStream = byteReader.fInputStream;
- } else {
- fNoBOMPossible = true;
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java
deleted file mode 100644
index 1f194441eb..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.exceptions;
-
-import java.nio.charset.CharacterCodingException;
-
-
-public class CharConversionErrorWithDetail extends CharacterCodingException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- private String fCharsetName;
-
- public CharConversionErrorWithDetail() {
- super();
- }
-
- /**
- * @param s
- */
- public CharConversionErrorWithDetail(String charsetName) {
- super();
- fCharsetName = charsetName;
- }
-
- /**
- * @return Returns the fCharsetName.
- */
- public String getCharsetName() {
- return fCharsetName;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java
deleted file mode 100644
index ff31bbd20d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java
+++ /dev/null
@@ -1,103 +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.sse.core.internal.exceptions;
-
-import java.nio.charset.CharacterCodingException;
-
-
-/**
- * Intended to be a more precise form of the MalformedInputException, where
- * character position and attempted encoding can be attempted.
- */
-public class MalformedInputExceptionWithDetail extends CharacterCodingException {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- private int fCharPosition;
- private String fDetectedCharsetName;
- private boolean fExceededMax = false;
- private String fJavaCharsetName;
- private int fMaxBuffer;
-
- /**
- * Disallow default constructor. If attemptedEncoding and charPostion can
- * not be provided, use one of java's MalformedException.
- */
- protected MalformedInputExceptionWithDetail() {
- // Nothing to do
- }
-
- public MalformedInputExceptionWithDetail(String encodingName, int charPostion) {
- this.fJavaCharsetName = encodingName;
- this.fDetectedCharsetName = encodingName;
- this.fCharPosition = charPostion;
- }
-
- public MalformedInputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion) {
- this.fJavaCharsetName = attemptedJavaEncoding;
- this.fDetectedCharsetName = attemptedIANAEncoding;
- this.fCharPosition = charPostion;
- }
-
- /**
- * If charPosition = -1 this could be because the character position
- * exceeded the maximum buffer size, maxBuffer, then exceededMax = true.
- */
- public MalformedInputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion, boolean exceededMax, int maxBuffer) {
- this.fJavaCharsetName = attemptedJavaEncoding;
- this.fDetectedCharsetName = attemptedIANAEncoding;
- this.fCharPosition = charPostion;
- this.fExceededMax = exceededMax;
- this.fMaxBuffer = maxBuffer;
- }
-
- /**
- */
- public java.lang.String getAttemptedIANAEncoding() {
- return fDetectedCharsetName;
- }
-
- /**
- */
- public java.lang.String getAttemptedJavaEncoding() {
- return fJavaCharsetName;
- }
-
- /**
- * @return int
- */
- public int getCharPosition() {
- return fCharPosition;
- }
-
- /**
- * Returns the maxBuffer.
- *
- * @return int
- */
- public int getMaxBuffer() {
- return fMaxBuffer;
- }
-
- /**
- * Returns the exceededMax.
- *
- * @return boolean
- */
- public boolean isExceededMax() {
- return fExceededMax;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java
deleted file mode 100644
index 6eec680796..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.exceptions;
-
-
-public class MalformedOutputExceptionWithDetail extends MalformedInputExceptionWithDetail {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Constructor for MalformedOutputExceptionWithDetail. If attemptedEncoding and charPostion can
- * not be provided, use sun.io.MalformedException.
- *
- * @param attemptedJavaEncoding
- * @param attemptedIANAEncoding
- * @param charPostion
- */
- public MalformedOutputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion) {
- super(attemptedJavaEncoding, attemptedIANAEncoding, charPostion);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java
deleted file mode 100644
index 123af87190..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.exceptions;
-
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-
-
-/**
- * This is intended for same purpose as it super class, but simply provides
- * more information about than the name in error. This is especially useful
- * for "UIs" which can present users with the error, and the
- * "appropriateDefault" that can be used for a particular input.
- */
-public class UnsupportedCharsetExceptionWithDetail extends UnsupportedCharsetException {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- private EncodingMemento fEncodingMementio;
-
- public UnsupportedCharsetExceptionWithDetail(EncodingMemento encodingMemento) {
- this(encodingMemento.getDetectedCharsetName());
- fEncodingMementio = encodingMemento;
- }
-
- protected UnsupportedCharsetExceptionWithDetail(String charsetName) {
- super(charsetName);
- }
-
- public EncodingMemento getEncodingMemento() {
- return fEncodingMementio;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java
deleted file mode 100644
index d1655b2d5c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java
+++ /dev/null
@@ -1,84 +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.wst.sse.core.internal.provisional.tasks;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-/**
- * Scanners for the main Task Scanner. Scanners may be contributed using the
- * org.eclipse.wst.sse.core.taskscanner extension point. For resources and
- * resource deltas with matching content types, the main scanner will first
- * call the startup() method, scan(), and then shutdown() in sequence. Scanner
- * instances will be reused across projects but are not shared per content
- * type. Scanners should not hold on to references to models or resources
- * after shutdown() and should take care not to leak memory or resources.
- */
-public interface IFileTaskScanner {
- /**
- * Default marker type ID of task markers that are created.
- */
- String TASK_MARKER_ID = SSECorePlugin.ID + ".task"; //$NON-NLS-1$;
-
- /**
- * @return the task marker type that should be removed each time tasks are
- * rescanned and used by default when creating task markers.
- * Children of this marker type will be removed automatically.
- */
- String getMarkerType();
-
- /**
- * Requests that the list of automatically discovered tasks for the given
- * file be updated. Once completed, the list of tasks should correspond
- * exactly to the file's contents.
- *
- * @param file -
- * the file to be scanned
- * @param taskTags -
- * the list of task tags for which to scan
- * @param monitor -
- * a progress monitor
- * @return an array of maps containing the attributes of task markers to
- * be created
- * <p>
- * The reserved attribute name
- * <b>org.eclipse.core.resources.taskmarker</b> may be used to
- * specify a type to use when creating the task marker.
- * </p>
- */
- Map[] scan(IFile file, TaskTag[] taskTags, IProgressMonitor monitor);
-
- /**
- * Notifies the scanner that scanning is done for now. Resources held from
- * startup should now be released.
- *
- * @param project -
- * the project that was just scanned
- */
- void shutdown(IProject project);
-
- /**
- * Notifies the scanner that a sequence of scans is about to be requested.
- * Ideally the time to load preferences and perform any expensive
- * configuration for the given project.
- *
- * @param project -
- * the project that is about to be scanned
- *
- */
- void startup(IProject project);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java
deleted file mode 100644
index cab72588db..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.tasks;
-
-import org.eclipse.core.resources.IMarker;
-
-/**
- * Simple representation of the values that make up a Task Tag
- */
-public final class TaskTag {
-
- public static final int PRIORITY_HIGH = IMarker.PRIORITY_HIGH;
- public static final int PRIORITY_LOW = IMarker.PRIORITY_LOW;
- public static final int PRIORITY_NORMAL = IMarker.PRIORITY_NORMAL;
-
- /**
- * this task tag's priority
- */
- private int fPriority = PRIORITY_NORMAL;
-
- /**
- * this task tag's "tagging" text
- */
- private String fTag = null;
-
- public TaskTag(String tag, int priority) {
- super();
- fTag = tag;
- fPriority = priority;
- }
-
- public int getPriority() {
- return fPriority;
- }
-
- public String getTag() {
- return fTag;
- }
-
- public String toString() {
- return getTag() + ":" + getPriority(); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
deleted file mode 100644
index 34b9c0790d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possibl *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class FileTaskScannerRegistryReader {
- private static class ScannerInfo {
- String fId;
- IFileTaskScanner fScanner;
-
- ScannerInfo(String id, IFileTaskScanner scanner) {
- super();
- fId = id;
- fScanner = scanner;
- }
-
- public boolean equals(Object obj) {
- return obj instanceof ScannerInfo && fId.equals(((ScannerInfo) obj).fId);
- }
-
- public IFileTaskScanner getScanner() {
- return fScanner;
- }
- }
-
- private static FileTaskScannerRegistryReader _instance = null;
-
- public static FileTaskScannerRegistryReader getInstance() {
- if (_instance == null) {
- _instance = new FileTaskScannerRegistryReader();
- }
- return _instance;
- }
-
- private String ATT_CLASS = "class"; //$NON-NLS-1$
-
- private String ATT_CONTENT_TYPES = "contentTypeIds"; //$NON-NLS-1$
-
- private String ATT_ID = "id"; //$NON-NLS-1$
-
- private IConfigurationElement[] fScannerElements;
-
- // a mapping from content types to ScannerInfo instances
- private Map fScannerInfos = null;
-
- private String NAME_SCANNER = "scanner"; //$NON-NLS-1$
-
- private String SCANNER_EXTENSION_POINT_ID = SSECorePlugin.ID + ".taskscanner"; //$NON-NLS-1$
-
- private FileTaskScannerRegistryReader() {
- super();
- }
-
- IFileTaskScanner[] getFileTaskScanners(IContentType[] contentTypes) {
- if (fScannerElements == null) {
- readRegistry();
- }
-
- List scannerInfos = new ArrayList(1);
-
- for (int i = 0; i < contentTypes.length; i++) {
- ScannerInfo[] scannerInfosForContentType = (ScannerInfo[]) fScannerInfos.get(contentTypes[i].getId());
- if (scannerInfosForContentType == null) {
- scannerInfosForContentType = loadScanners(contentTypes[i]);
- }
- // only add non-duplicate scanners
- for (int j = 0; j < scannerInfosForContentType.length; j++) {
- if (!scannerInfos.contains(scannerInfosForContentType[j])) {
- scannerInfos.add(scannerInfosForContentType[j]);
- }
- }
- }
- IFileTaskScanner[] scanners = new IFileTaskScanner[scannerInfos.size()];
- for (int i = 0; i < scanners.length; i++) {
- scanners[i] = ((ScannerInfo) scannerInfos.get(i)).getScanner();
- }
- return scanners;
- }
-
- public String[] getSupportedContentTypeIds() {
- if (fScannerElements == null) {
- readRegistry();
- }
-
- // find the relevant extensions
- List types = new ArrayList(0);
- IConfigurationElement[] scannerElements = fScannerElements;
- for (int j = 0; j < scannerElements.length; j++) {
- if (!scannerElements[j].getName().equals(NAME_SCANNER))
- continue;
- String[] contentTypeIds = StringUtils.unpack(scannerElements[j].getAttribute(ATT_CONTENT_TYPES));
- for (int i = 0; i < contentTypeIds.length; i++) {
- if (!types.contains(contentTypeIds[i])) {
- types.add(contentTypeIds[i]);
- }
- }
- }
-
- return (String[]) types.toArray(new String[types.size()]);
- }
-
- private ScannerInfo[] loadScanners(IContentType contentType) {
- List elements = new ArrayList(0);
- ScannerInfo[] scannerInfos = null;
- IConfigurationElement[] delegateElements = fScannerElements;
- if (contentType != null) {
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- for (int j = 0; j < delegateElements.length; j++) {
- if (!delegateElements[j].getName().equals(NAME_SCANNER))
- continue;
- String[] supportedContentTypeIds = StringUtils.unpack(delegateElements[j].getAttribute(ATT_CONTENT_TYPES));
- IContentType[] supportedContentTypes = new IContentType[supportedContentTypeIds.length];
- for (int k = 0; k < supportedContentTypeIds.length; k++) {
- supportedContentTypes[k] = contentTypeManager.getContentType(supportedContentTypeIds[k].trim());
- }
- for (int k = 0; k < supportedContentTypeIds.length; k++) {
- // allow subtypes to be returned as well
- if (supportedContentTypes[k] != null && contentType.isKindOf(supportedContentTypes[k])) {
- elements.add(delegateElements[j]);
- }
- }
- }
- // instantiate and save the scanners
- List scannerInfoList = new ArrayList(elements.size());
- for (int i = 0; i < elements.size(); i++) {
- try {
- IFileTaskScanner scanner = (IFileTaskScanner) ((IConfigurationElement) elements.get(i)).createExecutableExtension(ATT_CLASS);
- if (scanner != null) {
- scannerInfoList.add(new ScannerInfo(((IConfigurationElement) elements.get(i)).getAttribute(ATT_ID), scanner));
- }
- }
- catch (CoreException e) {
- Logger.logException("Non-fatal exception creating task scanner for " + contentType.getId(), e); //$NON-NLS-1$
- }
- }
- scannerInfos = (ScannerInfo[]) scannerInfoList.toArray(new ScannerInfo[scannerInfoList.size()]);
- fScannerInfos.put(contentType.getId(), scannerInfos);
- if (Logger.DEBUG_TASKSREGISTRY) {
- System.out.println("Created " + scannerInfos.length + " task scanner for " + contentType.getId()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return scannerInfos;
- }
-
- private void readRegistry() {
- fScannerInfos = new HashMap();
- // Just remember the elements, so plugins don't have to be activated,
- // unless extension attributes match those of interest
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(SCANNER_EXTENSION_POINT_ID);
- if (point != null) {
- fScannerElements = point.getConfigurationElements();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java
deleted file mode 100644
index 42271b486c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java
+++ /dev/null
@@ -1,329 +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.wst.sse.core.internal.tasks;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.CharacterCodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-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.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-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;
-
-/**
- * A delegate to create IMarker.TASKs for "todos" and similar comments.
- */
-public abstract class StructuredFileTaskScanner implements IFileTaskScanner, IExecutableExtension {
- // the list of attributes for the new tasks for the current file
- protected List fNewMarkerAttributeMaps = null;
-
- List oldMarkers = null;
- private long time0;
- private String runtimeMarkerType;
-
- public StructuredFileTaskScanner() {
- super();
- fNewMarkerAttributeMaps = new ArrayList();
- if (Logger.DEBUG_TASKS) {
- System.out.println(getClass().getName() + " instance created"); //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the attributes with which a newly created marker will be
- * initialized. Modified from the method in MarkerRulerAction
- *
- * @return the initial marker attributes
- */
- protected Map createInitialMarkerAttributes(String text, int documentLine, int startOffset, int length, int priority) {
- Map attributes = new HashMap(6);
- // marker line numbers are 1-based
- attributes.put(IMarker.LINE_NUMBER, new Integer(documentLine + 1));
- attributes.put(IMarker.TASK, getMarkerType());
- attributes.put(IMarker.CHAR_START, new Integer(startOffset));
- attributes.put(IMarker.CHAR_END, new Integer(startOffset + length));
- attributes.put(IMarker.MESSAGE, text);
- attributes.put(IMarker.USER_EDITABLE, Boolean.FALSE);
-
- switch (priority) {
- case IMarker.PRIORITY_HIGH : {
- attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_HIGH));
- }
- break;
- case IMarker.PRIORITY_LOW : {
- attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_LOW));
- }
- break;
- default : {
- attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL));
- }
- }
-
- return attributes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner#getMarkerType()
- */
- public String getMarkerType() {
- if (runtimeMarkerType != null)
- return runtimeMarkerType;
-
- return org.eclipse.core.resources.IMarker.TASK;
- }
-
- private String detectCharset(IFile file) {
- if (file.getType() == IResource.FILE && file.isAccessible()) {
- try {
- return file.getCharset(true);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- return ResourcesPlugin.getEncoding();
- }
-
- /**
- * @param document
- * @param documentRegion
- * @param comment
- */
- protected void findTasks(IDocument document, TaskTag[] taskTags, IStructuredDocumentRegion documentRegion, ITextRegion comment) {
- if (isCommentRegion(documentRegion, comment)) {
- int startOffset = documentRegion.getStartOffset(comment);
- int endOffset = documentRegion.getTextEndOffset(comment);
- try {
- int startLine = document.getLineOfOffset(startOffset);
- int endLine = document.getLineOfOffset(endOffset);
- for (int lineNumber = startLine; lineNumber <= endLine; lineNumber++) {
- IRegion line = document.getLineInformation(lineNumber);
- int begin = Math.max(startOffset, line.getOffset());
- int end = Math.min(endOffset, line.getOffset() + line.getLength());
- int length = end - begin;
-
- /* XXX: This generates a lot of garbage objects */
-
- String commentedText = getCommentedText(document, begin, length);
- String comparisonText = commentedText.toLowerCase(Locale.ENGLISH);
-
- for (int i = 0; i < taskTags.length; i++) {
- int tagIndex = comparisonText.indexOf(taskTags[i].getTag().toLowerCase(Locale.ENGLISH));
- if (tagIndex >= 0) {
- String markerDescription = commentedText.substring(tagIndex);
- int markerOffset = begin + tagIndex;
- int markerLength = end - markerOffset;
- fNewMarkerAttributeMaps.add(createInitialMarkerAttributes(markerDescription, lineNumber, markerOffset, markerLength, taskTags[i].getPriority()));
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- }
-
- private void findTasks(IFile file, final TaskTag[] taskTags, final IProgressMonitor monitor) {
- try {
- IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerFor(file);
-
- // records if the optimized streamish parse was possible
- boolean didStreamParse = false;
- final IEncodedDocument defaultDocument = handler.getDocumentLoader().createNewStructuredDocument();
- if (defaultDocument instanceof IStructuredDocument) {
- RegionParser parser = ((IStructuredDocument) defaultDocument).getParser();
- if (parser instanceof StructuredDocumentRegionParser) {
- didStreamParse = true;
- String charset = detectCharset(file);
- StructuredDocumentRegionParser documentParser = (StructuredDocumentRegionParser) parser;
- final IDocument textDocument = new Document();
- setDocumentContent(textDocument, file.getContents(true), charset);
- monitor.beginTask("", textDocument.getLength());
- documentParser.reset(new DocumentReader(textDocument));
- documentParser.addStructuredDocumentRegionHandler(new StructuredDocumentRegionHandler() {
- public void nodeParsed(IStructuredDocumentRegion documentRegion) {
- ITextRegionList regions = documentRegion.getRegions();
- for (int j = 0; j < regions.size(); j++) {
- ITextRegion comment = regions.get(j);
- findTasks(textDocument, taskTags, documentRegion, comment);
- }
- // disconnect the document regions
- if (documentRegion.getPrevious() != null) {
- documentRegion.getPrevious().setPrevious(null);
- documentRegion.getPrevious().setNext(null);
- }
- if (monitor.isCanceled()) {
- textDocument.set(""); //$NON-NLS-1$
- }
- monitor.worked(documentRegion.getLength());
- }
-
- public void resetNodes() {
- }
- });
- documentParser.getDocumentRegions();
- }
- }
- if (!didStreamParse) {
- // Use a StructuredDocument
- IEncodedDocument document = handler.getDocumentLoader().createNewStructuredDocument(file);
- monitor.beginTask("", document.getLength());
- if (document instanceof IStructuredDocument) {
- IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getFirstStructuredDocumentRegion();
- while (documentRegion != null) {
- ITextRegionList regions = documentRegion.getRegions();
- for (int j = 0; j < regions.size(); j++) {
- ITextRegion comment = regions.get(j);
- findTasks(document, taskTags, documentRegion, comment);
- }
- monitor.worked(documentRegion.getLength());
- documentRegion = documentRegion.getNext();
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException("Exception with " + file.getFullPath().toString(), e); //$NON-NLS-1$
- }
- catch (CharacterCodingException e) {
- Logger.log(Logger.INFO, "StructuredFileTaskScanner encountered CharacterCodingException reading " + file.getFullPath()); //$NON-NLS-1$
- }
- catch (Exception e) {
- Logger.logException("Exception with " + file.getFullPath().toString(), e); //$NON-NLS-1$
- }
- monitor.done();
- }
-
- protected String getCommentedText(IDocument document, int begin, int length) throws BadLocationException {
- return document.get(begin, length);
- }
-
- protected abstract boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion);
-
- public synchronized Map[] scan(IFile file, TaskTag[] taskTags, IProgressMonitor monitor) {
- fNewMarkerAttributeMaps.clear();
- if (monitor.isCanceled() || !shouldScan(file)) {
- return new Map[0];
- }
- if (Logger.DEBUG_TASKSPERF) {
- time0 = System.currentTimeMillis();
- }
- if (taskTags.length > 0) {
- findTasks(file, taskTags, monitor);
- }
- if (Logger.DEBUG_TASKSPERF) {
- System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + file.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return (Map[]) fNewMarkerAttributeMaps.toArray(new Map[fNewMarkerAttributeMaps.size()]);
- }
-
- /**
- * Sets the document content from this stream and closes the stream
- */
- protected void setDocumentContent(IDocument document, InputStream contentStream, String charset) {
- Reader in = null;
- try {
- in = new BufferedReader(new InputStreamReader(contentStream, charset), 2048);
- StringBuffer buffer = new StringBuffer(2048);
- char[] readBuffer = new char[2048];
- int n = in.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n = in.read(readBuffer);
- }
- document.set(buffer.toString());
- }
- catch (IOException x) {
- }
- finally {
- if (in != null) {
- try {
- in.close();
- }
- catch (IOException x) {
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @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 {
- if (data != null && data instanceof String) {
- runtimeMarkerType = data.toString();
- }
- }
-
- boolean shouldScan(IResource r) {
- // skip "dot" files
- String s = r.getName();
- return s.length() == 0 || s.charAt(0) != '.';
- }
-
- public void shutdown(IProject project) {
- if (Logger.DEBUG_TASKS) {
- System.out.println(this + " shutdown for " + project.getName()); //$NON-NLS-1$
- }
- }
-
- public void startup(IProject project) {
- if (Logger.DEBUG_TASKS) {
- System.out.println(this + " startup for " + project.getName()); //$NON-NLS-1$
- }
- if (Logger.DEBUG_TASKSPERF) {
- time0 = System.currentTimeMillis();
- }
- if (Logger.DEBUG_TASKSPERF) {
- System.out.println("" + (System.currentTimeMillis() - time0) + "ms loading prefs for " + project.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
deleted file mode 100644
index 92fda63dbe..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver (Intalio) - bug 300443 - some constants aren't static final
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ProjectScope;
-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.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.osgi.framework.Bundle;
-
-/**
- * Queueing Job for processing deltas and projects.
- */
-class TaskScanningJob extends Job {
- static final int JOB_DELAY_DELTA = 1000;
- private static final int JOB_DELAY_PROJECT = 5000;
- static final String TASK_TAG_PROJECTS_ALREADY_SCANNED = "task-tag-projects-already-scanned"; //$NON-NLS-1$
- private List fQueue = null;
-
- /** symbolic name for OSGI framework */
- private static final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
-
- TaskScanningJob() {
- super(SSECoreMessages.TaskScanner_0);
- fQueue = new ArrayList();
- setPriority(Job.DECORATE);
- setSystem(true);
- setUser(false);
-
- SSECorePlugin.getDefault().getPluginPreferences().setDefault(TASK_TAG_PROJECTS_ALREADY_SCANNED, ""); //$NON-NLS-1$
- }
-
- synchronized void addProjectDelta(IResourceDelta delta) {
- IResource projectResource = delta.getResource();
-
- if (projectResource.getType() == IResource.PROJECT) {
- if (isEnabledOnProject((IProject) projectResource)) {
- fQueue.add(delta);
- if (Logger.DEBUG_TASKSJOB) {
- String kind = null;
- switch (delta.getKind()) {
- case IResourceDelta.ADDED :
- kind = " [IResourceDelta.ADDED]"; //$NON-NLS-1$
- break;
- case IResourceDelta.CHANGED :
- kind = " [IResourceDelta.CHANGED]"; //$NON-NLS-1$
- break;
- case IResourceDelta.REMOVED :
- kind = " [IResourceDelta.REMOVED]"; //$NON-NLS-1$
- break;
- case IResourceDelta.ADDED_PHANTOM :
- kind = " [IResourceDelta.ADDED_PHANTOM]"; //$NON-NLS-1$
- break;
- case IResourceDelta.REMOVED_PHANTOM :
- kind = " [IResourceDelta.REMOVED_PHANTOM]"; //$NON-NLS-1$
- break;
- }
- System.out.println("Adding delta " + delta.getFullPath() + kind); //$NON-NLS-1$
- }
- schedule(JOB_DELAY_DELTA);
- }
- }
- }
-
- synchronized void addProject(IProject project) {
- if (projectHasNotBeenFullyScanned(project)) {
- fQueue.add(project);
- if (Logger.DEBUG_TASKSJOB) {
- System.out.println("Adding project " + project.getName()); //$NON-NLS-1$
- }
- schedule(JOB_DELAY_PROJECT);
- }
- }
-
- /**
- * A check to see if the OSGI framework is shutting down.
- *
- * @return true if the System Bundle is stopped (ie. the framework is
- * shutting down)
- */
- boolean frameworkIsShuttingDown() {
- // in the Framework class there's a note:
- // set the state of the System Bundle to STOPPING.
- // this must be done first according to section 4.19.2 from the OSGi
- // R3 spec.
- boolean shuttingDown = !Platform.isRunning() || Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
- if (Logger.DEBUG_TASKSJOB && shuttingDown) {
- System.out.println("TaskScanningJob: system is shutting down!"); //$NON-NLS-1$
- }
- return shuttingDown;
- }
-
- private boolean isEnabledOnProject(IProject p) {
- IPreferencesService preferencesService = Platform.getPreferencesService();
- IScopeContext[] lookupOrder = new IScopeContext[]{new ProjectScope(p), new InstanceScope(), new DefaultScope()};
- return preferencesService.getBoolean(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, lookupOrder);
- }
-
- private boolean projectHasNotBeenFullyScanned(IResource project) {
- String[] projectsScanned = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TASK_TAG_PROJECTS_ALREADY_SCANNED));
-
- boolean shouldScan = true;
- String name = project.getName();
- for (int j = 0; shouldScan && j < projectsScanned.length; j++) {
- if (projectsScanned[j].equals(name)) {
- if (Logger.DEBUG_TASKSJOB)
- System.out.println("Scanning Job skipping " + project.getName()); //$NON-NLS-1$
- shouldScan = false;
- }
- }
- return shouldScan;
- }
-
- synchronized List retrieveQueue() {
- List queue = fQueue;
- fQueue = new ArrayList();
- return queue;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- if (frameworkIsShuttingDown())
- return Status.CANCEL_STATUS;
-
- cleanupRememberedProjectList(TASK_TAG_PROJECTS_ALREADY_SCANNED);
-
- IStatus status = null;
- List currentQueue = retrieveQueue();
-
- try {
- Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
- }
- catch (SecurityException e) {
- // not a critical problem
- }
-
- List errors = null;
- int ticks = currentQueue.size();
- String taskName = null;
- if (Logger.DEBUG_TASKSJOB) {
- taskName = SSECoreMessages.TaskScanningJob_0 + " (" + ticks + " work items)"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- taskName = SSECoreMessages.TaskScanningJob_0;
- }
- monitor.beginTask(taskName, ticks);
-
- IProgressMonitor scanMonitor = null;
- while (!currentQueue.isEmpty()) {
- Object o = currentQueue.remove(0);
- if (frameworkIsShuttingDown() || monitor.isCanceled())
- return Status.CANCEL_STATUS;
- try {
- scanMonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
- if (o instanceof IResourceDelta) {
- WorkspaceTaskScanner.getInstance().scan((IResourceDelta) o, scanMonitor);
- }
- else if (o instanceof IProject) {
- WorkspaceTaskScanner.getInstance().scan((IProject) o, scanMonitor);
- if(!scanMonitor.isCanceled() ) {
- String[] projectsPreviouslyScanned = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TASK_TAG_PROJECTS_ALREADY_SCANNED));
- String[] updatedProjects = new String[projectsPreviouslyScanned.length + 1];
- updatedProjects[projectsPreviouslyScanned.length] = ((IResource) o).getName();
- System.arraycopy(projectsPreviouslyScanned, 0, updatedProjects, 0, projectsPreviouslyScanned.length);
- SSECorePlugin.getDefault().getPluginPreferences().setValue(TASK_TAG_PROJECTS_ALREADY_SCANNED, StringUtils.pack(updatedProjects));
- }
- }
- }
- catch (Exception e) {
- if (errors == null) {
- errors = new ArrayList();
- }
- errors.add(new Status(IStatus.ERROR, SSECorePlugin.ID, IStatus.ERROR, "", e)); //$NON-NLS-1$
- }
- }
- monitor.done();
-
- if (errors == null || errors.isEmpty()) {
- status = Status.OK_STATUS;
- }
- else {
- if (errors.size() == 1) {
- status = (IStatus) errors.get(0);
- }
- else {
- IStatus[] statii = (IStatus[]) errors.toArray(new IStatus[errors.size()]);
- status = new MultiStatus(SSECorePlugin.ID, IStatus.ERROR, statii, SSECoreMessages.TaskScanningJob_1, null);
- }
- }
-
- SSECorePlugin.getDefault().savePluginPreferences();
- return status;
- }
-
- private void cleanupRememberedProjectList(String preferenceName) {
- String[] rememberedProjectNames = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(preferenceName));
- IResource[] workspaceProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- String[] projectNames = new String[workspaceProjects.length];
- for (int i = 0; i < projectNames.length; i++) {
- projectNames[i] = workspaceProjects[i].getName();
- }
-
- List projectNamesToRemember = new ArrayList(rememberedProjectNames.length);
- for (int i = 0; i < rememberedProjectNames.length; i++) {
- boolean rememberedProjectExists = false;
- for (int j = 0; !rememberedProjectExists && j < projectNames.length; j++) {
- if (rememberedProjectNames[i].equals(projectNames[j])) {
- rememberedProjectExists = true;
- }
- }
- if (rememberedProjectExists) {
- projectNamesToRemember.add(rememberedProjectNames[i]);
- }
- else if (Logger.DEBUG_TASKSJOB) {
- System.out.println("Removing " + rememberedProjectNames[i] + " removed from " + preferenceName); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- if (projectNamesToRemember.size() != rememberedProjectNames.length) {
- SSECorePlugin.getDefault().getPluginPreferences().setValue(preferenceName, StringUtils.pack((String[]) projectNamesToRemember.toArray(new String[projectNamesToRemember.size()])));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
deleted file mode 100644
index 6095a6d940..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class TaskScanningScheduler {
- class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta.getResource() != null) {
- int resourceType = delta.getResource().getType();
- if (resourceType == IResource.PROJECT || resourceType == IResource.ROOT) {
- try {
- delta.accept(this);
- }
- catch (CoreException e) {
- Logger.logException("Exception handling resource change", e); //$NON-NLS-1$
- }
- }
- }
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException {
- if ((delta.getKind() & IResourceDelta.MARKERS) > 0 || (delta.getKind() & IResourceDelta.ENCODING) > 0 || (delta.getKind() & IResourceDelta.NO_CHANGE) > 0)
- return false;
-
- IResource resource = delta.getResource();
- if (resource != null) {
- if (resource.getType() == IResource.ROOT)
- return true;
- else if (resource.getType() == IResource.PROJECT) {
- fJob.addProjectDelta(delta);
- return false;
- }
- }
- return false;
- }
-
- }
-
- private static TaskScanningScheduler scheduler;
-
- public static void refresh() {
- SSECorePlugin.getDefault().getPluginPreferences().setValue(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED, ""); //$NON-NLS-1$
- scheduler.enqueue(ResourcesPlugin.getWorkspace().getRoot());
- }
-
- public static void refresh(IProject project) {
- String[] projectNames = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED)); //$NON-NLS-1$
- List freshProjectList = new ArrayList();
- for (int i = 0; i < projectNames.length; i++) {
- if (!projectNames[i].equals(project.getName())) {
- freshProjectList.add(projectNames[i]);
- }
- }
- String freshProjects = StringUtils.pack((String[]) freshProjectList.toArray(new String[freshProjectList.size()]));
- SSECorePlugin.getDefault().getPluginPreferences().setValue(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED, freshProjects); //$NON-NLS-1$
-
- scheduler.enqueue(project);
- }
-
-
- /**
- * Only for use by SSECorePlugin class
- */
- public static void shutdown() {
- if (scheduler != null) {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(scheduler.visitor);
- scheduler.fJob.cancel();
- try {
- scheduler.fJob.join();
- }
- catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
- }
-
- /**
- * Only for use by SSEUIPlugin class, UI by nature of its output being meant for the user
- */
- public static void startup() {
- scheduler = new TaskScanningScheduler();
-
- /*
- * According to
- * http://www.eclipse.org/eclipse/development/performance/bloopers.html,
- * POST_CHANGE listeners add a trivial performance cost.
- *
- * Always add listener since we might be enabled per-project even if disabled workspace-wide.
- */
- ResourcesPlugin.getWorkspace().addResourceChangeListener(scheduler.visitor, IResourceChangeEvent.POST_CHANGE);
-
- scheduler.enqueue(ResourcesPlugin.getWorkspace().getRoot());
- }
-
- TaskScanningJob fJob = null;
-
- ListenerVisitor visitor = null;
-
- private TaskScanningScheduler() {
- super();
- fJob = new TaskScanningJob();
- visitor = new ListenerVisitor();
- }
-
- void enqueue(IProject project) {
- fJob.addProject(project);
- }
-
- void enqueue(IWorkspaceRoot root) {
- IProject[] allProjects = root.getProjects();
- for (int i = 0; i < allProjects.length; i++) {
- fJob.addProject(allProjects[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java
deleted file mode 100644
index bb3e305a84..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.tasks;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-public final class TaskTagPreferenceKeys {
- public static final String TASK_TAG_CONTENTTYPES_IGNORED = "ignored-contentTypes"; //$NON-NLS-1$
- public static final String TASK_TAG_ENABLE = "enabled"; //$NON-NLS-1$
- public static final String TASK_TAG_NODE = SSECorePlugin.ID + IPath.SEPARATOR + "task-tags"; //$NON-NLS-1$
- public static final String TASK_TAG_PER_PROJECT = "use-project-settings"; //$NON-NLS-1$
- public static final String TASK_TAG_PRIORITIES = "taskPriorities"; //$NON-NLS-1$
- public static final String TASK_TAG_TAGS = "taskTags"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
deleted file mode 100644
index 3f3ffa61b0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300443 - some constants aren't static final
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-/**
- * Dispatcher for scanning based on deltas and requested projects
- */
-class WorkspaceTaskScanner {
- private static WorkspaceTaskScanner _instance = null;
- static final String SYNTHETIC_TASK = "org.eclipse.wst.sse.task-synthetic";
- static final String MODIFICATION_STAMP = "org.eclipse.wst.sse.modification-stamp";
- private boolean proceed = false;
-
- static synchronized WorkspaceTaskScanner getInstance() {
- if (_instance == null) {
- _instance = new WorkspaceTaskScanner();
- }
- return _instance;
- }
-
- static final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
- private List fActiveScanners = null;
- private IContentType[] fCurrentIgnoreContentTypes = null;
- private TaskTag[] fCurrentTaskTags = null;
-
- private FileTaskScannerRegistryReader registry = null;
-
- private long time0;
-
- /**
- *
- */
- private WorkspaceTaskScanner() {
- super();
- registry = FileTaskScannerRegistryReader.getInstance();
- fActiveScanners = new ArrayList();
- fCurrentTaskTags = new TaskTag[0];
- fCurrentIgnoreContentTypes = new IContentType[0];
- }
-
- private IContentType[] detectContentTypes(IResource resource) {
- IContentType[] types = null;
- if (resource.getType() == IResource.FILE && resource.isAccessible()) {
- types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
- if (types.length == 0) {
- 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
- */
- }
- }
- if (types == null) {
- types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
- }
- if (Logger.DEBUG_TASKSCONTENTTYPE) {
- if (types.length > 0) {
- if (types.length > 1) {
- System.out.println(resource.getFullPath() + ": " + "multiple based on name (probably hierarchical)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- for (int i = 0; i < types.length; i++) {
- System.out.println(resource.getFullPath() + " matched: " + types[i].getId()); //$NON-NLS-1$
- }
- }
- }
- }
- return types;
- }
-
- /**
- * @param resource
- * @return
- */
- private IProject getProject(IResource resource) {
- IProject project = null;
- if (resource.getType() == IResource.PROJECT) {
- project = (IProject) resource;
- }
- else {
- project = resource.getProject();
- }
- return project;
- }
-
- private boolean init(IResource resource) {
- IProject project = getProject(resource);
-
- IPreferencesService preferencesService = Platform.getPreferencesService();
- IScopeContext[] lookupOrder = new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
-
- boolean proceed = preferencesService.getBoolean(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, lookupOrder);
-
- if (Logger.DEBUG_TASKSPREFS) {
- System.out.println(getClass().getName() + " scan of " + resource.getFullPath() + ":" + proceed); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (proceed) {
- String[] tags = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, null, lookupOrder));
- String[] priorities = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null, lookupOrder));
- String[] currentIgnoreContentTypeIDs = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, lookupOrder));
- if (Logger.DEBUG_TASKSPREFS) {
- System.out.print(getClass().getName() + " tags: "); //$NON-NLS-1$
- for (int i = 0; i < tags.length; i++) {
- if (i > 0) {
- System.out.print(","); //$NON-NLS-1$
- }
- System.out.print(tags[i]);
- }
- System.out.println();
- System.out.print(getClass().getName() + " priorities: "); //$NON-NLS-1$
- for (int i = 0; i < priorities.length; i++) {
- if (i > 0) {
- System.out.print(","); //$NON-NLS-1$
- }
- System.out.print(priorities[i]);
- }
- System.out.println();
- System.out.print(getClass().getName() + " ignored content types: "); //$NON-NLS-1$
- for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
- if (i > 0) {
- System.out.print(","); //$NON-NLS-1$
- }
- System.out.print(currentIgnoreContentTypeIDs[i]);
- }
- System.out.println();
- }
- fCurrentIgnoreContentTypes = new IContentType[currentIgnoreContentTypeIDs.length];
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
- fCurrentIgnoreContentTypes[i] = contentTypeManager.getContentType(currentIgnoreContentTypeIDs[i]);
- }
- int max = Math.min(tags.length, priorities.length);
- fCurrentTaskTags = new TaskTag[max];
- for (int i = 0; i < max; i++) {
- int priority = TaskTag.PRIORITY_NORMAL;
- try {
- priority = Integer.parseInt(priorities[i]);
- }
- catch (NumberFormatException e) {
- // default to normal priority
- }
- fCurrentTaskTags[i] = new TaskTag(tags[i], priority);
- }
- }
- return proceed;
- }
-
- void internalScan(final IProject project, final IResource resource, final IProgressMonitor scanMonitor) {
- if (scanMonitor.isCanceled())
- return;
- try {
- String name = resource.getName();
- if (resource.isAccessible() && !resource.isDerived() && !resource.isPhantom() && !resource.isTeamPrivateMember() && name.length() != 0 && name.charAt(0) != '.') {
- if ((resource.getType() & IResource.FOLDER) > 0 || (resource.getType() & IResource.PROJECT) > 0) {
- IResource[] children = ((IContainer) resource).members();
- scanMonitor.beginTask("", children.length); //$NON-NLS-1$
- for (int i = 0; i < children.length; i++) {
- internalScan(project, children[i], new SubProgressMonitor(scanMonitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- }
- scanMonitor.done();
- }
- else if ((resource.getType() & IResource.FILE) > 0) {
- scanFile(project, fCurrentTaskTags, (IFile) resource, scanMonitor);
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
-
- void internalScan(IResourceDelta delta, final IProgressMonitor monitor) {
- if (monitor.isCanceled())
- return;
- try {
- String name = delta.getFullPath().lastSegment();
- IResource resource = delta.getResource();
- if (!resource.isDerived() && !resource.isPhantom() && !resource.isTeamPrivateMember() && name.length() != 0 && name.charAt(0) != '.') {
- if ((resource.getType() & IResource.FOLDER) > 0 || (resource.getType() & IResource.PROJECT) > 0) {
- IResourceDelta[] children = delta.getAffectedChildren();
- monitor.beginTask("", children.length);
- if (name.length() != 0 && name.charAt(0) != '.' && children.length > 0) {
- for (int i = children.length - 1; i >= 0; i--) {
- internalScan(children[i], new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- }
- }
- monitor.done();
- }
- else if ((resource.getType() & IResource.FILE) > 0) {
- if ((delta.getKind() & IResourceDelta.ADDED) > 0 || ((delta.getKind() & IResourceDelta.CHANGED) > 0 && (delta.getFlags() & IResourceDelta.CONTENT) > 0)) {
- IFile file = (IFile) resource;
- scanFile(file.getProject(), fCurrentTaskTags, file, monitor);
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
-
- private void replaceTaskMarkers(final IFile file, final String[] markerTypes, final Map markerAttributeMaps[], IProgressMonitor monitor) {
- final IFile finalFile = file;
- if (file.isAccessible()) {
- try {
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor progressMonitor) throws CoreException {
- progressMonitor.beginTask("", 2);//$NON-NLS-1$
- try {
- /*
- * Delete old Task markers (don't delete regular
- * Tasks since that includes user-defined ones)
- */
- for (int i = 0; i < markerTypes.length; i++) {
- if (IMarker.TASK.equals(markerTypes[i])) {
- // only remove if synthetic
- IMarker[] foundMarkers = file.findMarkers(markerTypes[i], true, IResource.DEPTH_ZERO);
- for (int j = 0; j < foundMarkers.length; j++) {
- if (foundMarkers[j].getAttribute(SYNTHETIC_TASK) != null) {
- foundMarkers[j].delete();
- }
- }
- }
- else {
- file.deleteMarkers(markerTypes[i], true, IResource.DEPTH_ZERO);
- }
- }
- }
- catch (CoreException e) {
- Logger.logException("exception deleting old tasks", e); //$NON-NLS-1$
- }
- finally {
- progressMonitor.worked(1);
- }
- if (proceed && markerAttributeMaps != null && markerAttributeMaps.length > 0) {
- if (Logger.DEBUG_TASKS) {
- System.out.println("" + markerAttributeMaps.length + " tasks for " + file.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- for (int i = 0; i < markerAttributeMaps.length; i++) {
- String specifiedMarkerType = (String) markerAttributeMaps[i].get(IMarker.TASK);
- IMarker marker = finalFile.createMarker(specifiedMarkerType);
- marker.setAttributes(markerAttributeMaps[i]);
- marker.setAttribute(IMarker.USER_EDITABLE, Boolean.FALSE);
- marker.setAttribute(MODIFICATION_STAMP, Long.toString(file.getModificationStamp()));
- if (IMarker.TASK.equals(specifiedMarkerType)) {
- // set to synthetic and make user editable
- marker.setAttribute(SYNTHETIC_TASK, true);
- }
- }
- }
- progressMonitor.worked(1);
- progressMonitor.done();
- }
- };
- if (file.isAccessible()) {
- finalFile.getWorkspace().run(r, ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file), IWorkspace.AVOID_UPDATE, monitor);
- }
- }
- catch (CoreException e1) {
- Logger.logException(e1);
- }
- catch(OperationCanceledException e) {
- // not an error condition
- }
- }
- }
-
- void scan(final IProject project, final IProgressMonitor scanMonitor) {
- if (scanMonitor.isCanceled())
- return;
- if (Logger.DEBUG_TASKS) {
- System.out.println(getClass().getName() + " scanning project " + project.getName()); //$NON-NLS-1$
- }
- if (!project.isAccessible()) {
- if (Logger.DEBUG_TASKS) {
- System.out.println(getClass().getName() + " skipping inaccessible project " + project.getName()); //$NON-NLS-1$
- }
- return;
- }
-
- if (Logger.DEBUG_TASKSOVERALLPERF) {
- time0 = System.currentTimeMillis();
- }
- proceed = init(project);
- internalScan(project, project, scanMonitor);
- shutdownDelegates(project);
-
- if (Logger.DEBUG_TASKSOVERALLPERF) {
- System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + project.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-
- void scan(IResourceDelta delta, final IProgressMonitor monitor) {
- if (monitor.isCanceled())
- return;
- if (Logger.DEBUG_TASKSOVERALLPERF) {
- time0 = System.currentTimeMillis();
- }
- if (init(delta.getResource())) {
- internalScan(delta, monitor);
- shutdownDelegates(delta.getResource().getProject());
- }
- if (Logger.DEBUG_TASKSOVERALLPERF) {
- System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + delta.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- void scanFile(IProject project, TaskTag[] taskTags, IFile file, IProgressMonitor monitor) {
- if (monitor.isCanceled())
- return;
-
- // 3 "stages"
- monitor.beginTask("", 8);//$NON-NLS-1$
- monitor.subTask(file.getFullPath().toString().substring(1));
-
- final List markerAttributes = new ArrayList();
- IContentType[] types = detectContentTypes(file);
- Set markerTypes = new HashSet(3);
- // Always included for safety and migration
- markerTypes.add(DEFAULT_MARKER_TYPE);
- monitor.worked(1);
-
- IFileTaskScanner[] fileScanners = null;
- IFileTaskScanner[] ignoredFileScanners = null;
- if (types != null) {
- if (fCurrentIgnoreContentTypes.length == 0) {
- fileScanners = registry.getFileTaskScanners(types);
- }
- else {
- List validTypes = new ArrayList();
- // obtain a filtered list of delegates
- for (int i = 0; i < types.length; i++) {
- boolean ignoreContentType = false;
- for (int j = 0; j < fCurrentIgnoreContentTypes.length; j++) {
- ignoreContentType = ignoreContentType || types[i].isKindOf(fCurrentIgnoreContentTypes[j]);
- }
- if (!ignoreContentType) {
- validTypes.add(types[i]);
- }
- else {
- ignoredFileScanners = registry.getFileTaskScanners(new IContentType[] {types[i]});
- }
- }
- fileScanners = registry.getFileTaskScanners((IContentType[]) validTypes.toArray(new IContentType[validTypes.size()]));
- }
- monitor.worked(1);
- if (ignoredFileScanners != null && ignoredFileScanners.length > 0) {
- for (int i = 0; i < ignoredFileScanners.length; i++)
- markerTypes.add(ignoredFileScanners[i].getMarkerType());
- }
-
- if (fileScanners.length > 0) {
- IProgressMonitor scannerMonitor = new SubProgressMonitor(monitor, 3, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
- scannerMonitor.beginTask("", fileScanners.length); //$NON-NLS-1$
- for (int j = 0; fileScanners != null && j < fileScanners.length; j++) {
- if (monitor.isCanceled())
- continue;
- try {
- if (!fActiveScanners.contains(fileScanners[j]) && !monitor.isCanceled()) {
- fileScanners[j].startup(file.getProject());
- fActiveScanners.add(fileScanners[j]);
- }
- markerTypes.add(fileScanners[j].getMarkerType());
- Map[] taskMarkerAttributes = fileScanners[j].scan(file, taskTags, new SubProgressMonitor(scannerMonitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- /*
- * TODO: pool the marker results so there's only one
- * operation creating them
- */
- for (int i = 0; i < taskMarkerAttributes.length; i++) {
- if (!taskMarkerAttributes[i].containsKey(IMarker.TASK)) {
- taskMarkerAttributes[i].put(IMarker.TASK, fileScanners[j].getMarkerType());
- }
- taskMarkerAttributes[i].put(IMarker.SOURCE_ID, fileScanners[j].getClass().getName());
- markerAttributes.add(taskMarkerAttributes[i]);
- }
- }
- catch (Exception e) {
- Logger.logException(file.getFullPath().toString(), e);
- }
- }
- scannerMonitor.done();
- }
- }
- else {
- monitor.worked(4);
- }
-
- if (monitor.isCanceled())
- return;
- // only update markers if we ran a scanner on this file
- if (fileScanners != null && fileScanners.length > 0 ||
- ignoredFileScanners != null && ignoredFileScanners.length > 0) {
- IProgressMonitor markerUpdateMonitor = new SubProgressMonitor(monitor, 3, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
- if (markerAttributes != null)
- replaceTaskMarkers(file, (String[]) markerTypes.toArray(new String[markerTypes.size()]), (Map[]) markerAttributes.toArray(new Map[markerAttributes.size()]), markerUpdateMonitor);
- }
- else {
- monitor.worked(3);
- }
- monitor.done();
- }
-
- private void shutdownDelegates(IProject project) {
- for (int j = 0; j < fActiveScanners.size(); j++) {
- try {
- ((IFileTaskScanner) fActiveScanners.get(j)).shutdown(project);
- }
- catch (Exception e) {
- Logger.logException(project.getFullPath().toString(), e);
- }
- }
- fActiveScanners = new ArrayList(1);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
deleted file mode 100644
index ecb0ece8c9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.osgi.framework.Bundle;
-
-/**
- * Class to allow access to properly configured implementors of IModelManager.
- *
- * @since 1.5 org.eclipse.wst.sse.core
- */
-final public class StructuredModelManager {
- /**
- * Do not allow instances to be created.
- */
- private StructuredModelManager() {
- super();
- }
-
- /**
- * Provides access to the instance of IModelManager. Returns null if model
- * manager can not be created or is not valid (such as, when workbench is
- * shutting down).
- *
- * @return IModelManager - returns the one model manager for structured
- * models or null if the owning bundle is neither active nor
- * starting.
- */
- public static IModelManager getModelManager() {
- boolean isReady = false;
- IModelManager modelManager = null;
- boolean interrupted = false;
- try {
- while (!isReady) {
- Bundle localBundle = Platform.getBundle(SSECorePlugin.ID);
- int state = localBundle.getState();
- if (state == Bundle.ACTIVE) {
- isReady = true;
- // getInstance is a synchronized static method.
- modelManager = ModelManagerImpl.getInstance();
- }
- else if (state == Bundle.STARTING) {
- try {
- Thread.sleep(100);
- }
- catch (InterruptedException e) {
- // ignore, just loop again
- interrupted = true;
- }
- }
- else if (state == Bundle.STOPPING || state == Bundle.UNINSTALLED) {
- isReady = true;
- modelManager = null;
- }
- else {
- // not sure about other states, 'resolved', 'installed'
- isReady = true;
- modelManager = null;
- }
- }
- }
- finally {
- if (interrupted) {
- Thread.currentThread().interrupt();
- }
- }
- return modelManager;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/indexing/AbstractIndexManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/indexing/AbstractIndexManager.java
deleted file mode 100644
index f553b585ea..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/indexing/AbstractIndexManager.java
+++ /dev/null
@@ -1,1990 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.indexing;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-
-/**
- * <p>
- * A generic class for implementing a resource index manager. It is important
- * to note that this only provides the framework for managing an index, not
- * actually indexing. The subtle difference is that the manager is in charge
- * of paying attention to all of the resource actions that take place in the
- * workspace and filtering those actions down to simple actions that need to
- * be performed on whatever index this manager is managing.
- * </p>
- *
- * <p>
- * The manager does its very best to make sure the index is always consistent,
- * even if resource events take place when the manager is not running. In the
- * event that the manager determines it has missed, lost, or corrupted any
- * resource change events that have occurred before, during, or after its
- * activation or deactivation then the manager will inspect the entire
- * workspace to insure the index it is managing is consistent.
- * </p>
- *
- */
-public abstract class AbstractIndexManager {
-
- /** Used to encode path bytes in case they contain double byte characters */
- private static final String ENCODING_UTF16 = "utf16"; //$NON-NLS-1$
-
- /** Default time to wait for other tasks to finish */
- private static final int WAIT_TIME = 300;
-
- /**
- * <p>
- * Used to report progress on jobs where the total work to complete is
- * unknown. The created effect is a progress bar that moves but that will
- * never complete.
- * </p>
- */
- private static final int UNKNOWN_WORK = 100;
-
- /**
- * The amount of events to batch up before sending them off to the
- * processing job
- */
- private static final int BATCH_UP_AMOUNT = 100;
-
- /** If this file exists then a full workspace re-processing is needed */
- private static final String RE_PROCESS_FILE_NAME = ".re-process"; //$NON-NLS-1$
-
- /** Common error message to log */
- private static final String LOG_ERROR_INDEX_INVALID = "Index may become invalid, incomplete, or enter some other inconsistent state."; //$NON-NLS-1$
-
- /** State: manager is stopped */
- private static final byte STATE_DISABLED = 0;
-
- /** State: manager is running */
- private static final byte STATE_ENABLED = 1;
-
- /** Action: add to index */
- protected static final byte ACTION_ADD = 0;
-
- /** Action: remove from index */
- protected static final byte ACTION_REMOVE = 1;
-
- /** Action: add to index caused by move operation */
- protected static final byte ACTION_ADD_MOVE_FROM = 2;
-
- /** Action: remove from index caused by move operation */
- protected static final byte ACTION_REMOVE_MOVE_TO = 3;
-
- /** Source: action originated from resource change event */
- protected static final byte SOURCE_RESOURCE_CHANGE = 0;
-
- /** Source: action originated from workspace scan */
- protected static final byte SOURCE_WORKSPACE_SCAN = 1;
-
- /** Source: action originated from saved state */
- protected static final byte SOURCE_SAVED_STATE = 2;
-
- /** Source: preserved resources to index */
- protected static final byte SOURCE_PRESERVED_RESOURCES_TO_INDEX = 3;
-
- /** the name of this index manager */
- private String fName;
-
- /** {@link IResourceChangeListener} to listen for file changes */
- private ResourceChangeListener fResourceChangeListener;
-
- /** The {@link Job} that does all of the indexing */
- private ResourceEventProcessingJob fResourceEventProcessingJob;
-
- /** A {@link Job} to search the workspace for all files */
- private Job fWorkspaceVisitorJob;
-
- /**
- * <p>
- * Current state of the manager
- * </p>
- *
- * @see #STATE_DISABLED
- * @see #STATE_ENABLED
- */
- private volatile byte fState;
-
- /** used to prevent manager from starting and stopping at the same time */
- private Object fStartStopLock = new Object();
-
- /**
- * <code>true</code> if the manager is currently starting,
- * <code>false</code> otherwise
- */
- private boolean fStarting;
-
- /**
- * <p>
- * Creates the manager with a given name.
- * </p>
- *
- * @param name
- * This will be pre-pended to progress reporting messages and
- * thus should be translated
- */
- protected AbstractIndexManager(String name) {
- this.fName = name;
- this.fState = STATE_DISABLED;
- this.fResourceChangeListener = new ResourceChangeListener();
- this.fResourceEventProcessingJob = new ResourceEventProcessingJob();
- this.fStarting = false;
- }
-
- /**
- * <p>
- * Creates the manager with a given name.
- * </p>
- *
- * @param name
- * This will be pre-pended to progress reporting messages and
- * thus should be translated
- *
- * @param messageRunning
- * ignored
- * @param messageInitializing
- * ignored
- * @param messageProcessingFiles
- * ignored
- *
- * @deprecated This constructor ignores the last three parameters.
- * @see #AbstractIndexManager(String)
- */
-
- protected AbstractIndexManager(String name, String messageRunning, String messageInitializing, String messageProcessingFiles) {
- this(name);
- }
-
- /**
- * <p>
- * Starts up the {@link AbstractIndexManager}. If a {@link IResourceDelta}
- * is provided then it is assumed that all other files in the workspace
- * have already been index and thus only those in the provided
- * {@link IResourceDelta} will be processed. Else if the provided
- * {@link IResourceDelta} is <code>null</code> it is assumed no files have
- * been indexed yet so the entire workspace will be searched for files to
- * be indexed.
- * </p>
- *
- * <p>
- * If {@link IResourceDelta} is provided this will block until that delta
- * has finished processing. If no {@link IResourceDelta} provided then a
- * separate job will be created to process the entire workspace and this
- * method will return without waiting for that job to complete
- * </p>
- *
- * <p>
- * Will block until {@link #stop()} has finished running if it is
- * currently running
- * </p>
- *
- * @param savedStateDelta
- * the delta from a saved state, if <code>null</code> then the
- * entire workspace will be searched for files to index, else
- * only files in this {@link IResourceDelta} will be indexed
- * @param monitor
- * This action can not be canceled but this monitor will be
- * used to report progress
- */
- public final void start(IResourceDelta savedStateDelta, IProgressMonitor monitor) {
- SubMonitor progress = SubMonitor.convert(monitor);
- synchronized (this.fStartStopLock) {
- this.fStarting = true;
-
- try {
- if (this.fState == STATE_DISABLED) {
- // report status
- progress.beginTask(NLS.bind(SSECoreMessages.IndexManager_0_starting, this.fName), 2);
-
- // start listening for resource change events
- this.fResourceChangeListener.start();
-
- // check to see if a full re-index is required
- boolean forcedFullReIndexNeeded = this.isForcedFullReIndexNeeded();
-
- /*
- * start the indexing job only loading preserved state if
- * not doing full index if failed loading preserved state
- * then force full re-index
- */
- forcedFullReIndexNeeded = !this.fResourceEventProcessingJob.start(!forcedFullReIndexNeeded, progress.newChild(1));
- progress.setWorkRemaining(1);
-
- // don't bother processing saved delta if forced full
- // re-index is needed
- if (!forcedFullReIndexNeeded) {
- /*
- * if there is a delta attempt to process it else need
- * to do a full workspace index
- */
- if (savedStateDelta != null) {
- forcedFullReIndexNeeded = false;
- try {
- // deal with reporting progress
- SubMonitor savedStateProgress = progress.newChild(1, SubMonitor.SUPPRESS_NONE);
-
- savedStateProgress.setTaskName(NLS.bind(SSECoreMessages.IndexManager_0_starting_1, new String[]{this.fName, SSECoreMessages.IndexManager_processing_deferred_resource_changes}));
-
- // process delta
- ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(savedStateProgress, AbstractIndexManager.SOURCE_SAVED_STATE);
- savedStateDelta.accept(visitor);
-
- // process any remaining batched up resources
- // to index
- visitor.processBatchedResourceEvents();
- }
- catch (CoreException e) {
- forcedFullReIndexNeeded = true;
- Logger.logException(this.fName + ": Could not process saved state. " + //$NON-NLS-1$
- "Forced to do a full workspace re-index.", e); //$NON-NLS-1$
- }
- }
- else {
- forcedFullReIndexNeeded = true;
- }
- }
- progress.worked(1);
-
- // if need to process the entire workspace do so in
- // another job
- if (forcedFullReIndexNeeded) {
- this.fWorkspaceVisitorJob = new WorkspaceVisitorJob();
- this.fWorkspaceVisitorJob.schedule();
- }
-
- // update state
- this.fState = STATE_ENABLED;
- }
- }
- finally {
- this.fStarting = false;
- progress.done();
- }
- }
- }
-
- /**
- * <p>
- * Safely shuts down the manager.
- * </p>
- *
- * <p>
- * This will block until the
- * {@link #start(IResourceDelta, IProgressMonitor)} has finished (if
- * running). Also until the current resource event has finished being
- * processed. Finally it will block until the events still to be processed
- * by the processing job have been preserved to be processed on the next
- * call to {@link #start(IResourceDelta, IProgressMonitor)}.
- * </p>
- *
- * <p>
- * If at any point during this shut down processes something goes wrong
- * the manager will be sure that on the next call to
- * {@link #start(IResourceDelta, IProgressMonitor)} the entire workspace
- * will be re-processed.
- * </p>
- *
- * @throws InterruptedException
- */
- public final void stop() throws InterruptedException {
- synchronized (this.fStartStopLock) {
- if (this.fState != STATE_DISABLED) {
-
- // stop listening for events, and wait for the current event
- // to finish
- this.fResourceChangeListener.stop();
-
- // if currently visiting entire workspace, give up and try
- // again next load
- boolean forceFullReIndexNextStart = false;
- if (this.fWorkspaceVisitorJob != null) {
- if (this.fWorkspaceVisitorJob.getState() != Job.NONE) {
- this.fWorkspaceVisitorJob.cancel();
-
- this.forceFullReIndexNextStart();
- forceFullReIndexNextStart = true;
- }
- }
-
- // stop the indexing job, only preserve if not already forcing
- // a re-index
- forceFullReIndexNextStart = !this.fResourceEventProcessingJob.stop(!forceFullReIndexNextStart);
-
- // if preserving failed, then force re-index
- if (forceFullReIndexNextStart) {
- this.forceFullReIndexNextStart();
- }
-
- // update status
- this.fState = STATE_DISABLED;
- }
- }
- }
-
- /**
- * @return the name of this indexer
- */
- protected String getName() {
- return this.fName;
- }
-
- /**
- * <p>
- * Should be called by a client of the index this manager manages before
- * the index is accessed, assuming the client wants an index consistent
- * with the latest resource changes.
- * </p>
- *
- * <p>
- * The supplied monitor will be used to supply user readable progress as
- * the manager insures the index has been given all the latest resource
- * events. This monitor may be canceled, but if it is the state of the
- * index is not guaranteed to be consistent with the latest resource
- * change events.
- * </p>
- *
- * @param monitor
- * Used to report user readable progress as the manager insures
- * the index is consistent with the latest resource events.
- * This monitor can be canceled to stop waiting for consistency
- * but then no guaranty is made about the consistency of the
- * index in relation to unprocessed resource changes
- *
- * @return <code>true</code> if the wait finished successfully and the
- * manager is consistent, <code>false</code> otherwise, either an
- * error occurred while waiting for the manager or the monitor was
- * canceled
- *
- * @throws InterruptedException
- * This can happen when waiting for other jobs
- */
- public final boolean waitForConsistent(IProgressMonitor monitor) {
- boolean success = true;
- boolean interupted = false;
- SubMonitor progress = SubMonitor.convert(monitor);
-
- // set up the progress of waiting
- int remainingWork = 4;
- progress.beginTask(NLS.bind(SSECoreMessages.IndexManager_Waiting_for_0, this.fName), remainingWork);
-
- // wait for start up
- if (this.fStarting && !monitor.isCanceled()) {
- SubMonitor startingProgress = progress.newChild(1);
- startingProgress.subTask(NLS.bind(SSECoreMessages.IndexManager_0_starting, this.fName));
- while (this.fStarting && !monitor.isCanceled()) {
- // this creates a never ending progress that still moves
- // forward
- startingProgress.setWorkRemaining(UNKNOWN_WORK);
- startingProgress.newChild(1).worked(1);
- try {
- Thread.sleep(WAIT_TIME);
- }
- catch (InterruptedException e) {
- interupted = true;
- }
- }
- }
- progress.setWorkRemaining(--remainingWork);
-
- // wait for workspace visiting job
- if (this.fWorkspaceVisitorJob != null && this.fWorkspaceVisitorJob.getState() != Job.NONE && !monitor.isCanceled()) {
- SubMonitor workspaceVisitorProgress = progress.newChild(1);
- workspaceVisitorProgress.subTask(SSECoreMessages.IndexManager_Processing_entire_workspace_for_the_first_time);
- while (this.fWorkspaceVisitorJob.getState() != Job.NONE && !monitor.isCanceled()) {
- // this creates a never ending progress that still moves
- // forward
- workspaceVisitorProgress.setWorkRemaining(UNKNOWN_WORK);
- workspaceVisitorProgress.newChild(1).worked(1);
- try {
- Thread.sleep(WAIT_TIME);
- }
- catch (InterruptedException e) {
- interupted = true;
- }
- }
- }
- progress.setWorkRemaining(--remainingWork);
-
- // wait for the current resource event
- if (this.fResourceChangeListener.isProcessingEvents() && !monitor.isCanceled()) {
- SubMonitor workspaceVisitorProgress = progress.newChild(1);
- workspaceVisitorProgress.subTask(SSECoreMessages.IndexManager_processing_recent_resource_changes);
- while (this.fResourceChangeListener.isProcessingEvents() && !monitor.isCanceled()) {
- workspaceVisitorProgress.setWorkRemaining(UNKNOWN_WORK);
- workspaceVisitorProgress.newChild(1).worked(1);
- try {
- this.fResourceChangeListener.waitForCurrentEvent(WAIT_TIME);
- }
- catch (InterruptedException e) {
- interupted = true;
- }
- }
- }
- progress.setWorkRemaining(--remainingWork);
-
- // wait for all files to be indexed
- if (this.fResourceEventProcessingJob.getNumResourceEventsToProcess() != 0 && !monitor.isCanceled()) {
- SubMonitor indexingProgress = progress.newChild(1);
- int prevNumResources;
- int numResources = this.fResourceEventProcessingJob.getNumResourceEventsToProcess();
- while (numResources != 0 && !monitor.isCanceled()) {
- // update the progress indicator
- indexingProgress.subTask(NLS.bind(SSECoreMessages.IndexManager_0_Indexing_1_Files, new Object[]{AbstractIndexManager.this.fName, "" + numResources})); //$NON-NLS-1$
- indexingProgress.setWorkRemaining(numResources);
- prevNumResources = numResources;
- numResources = this.fResourceEventProcessingJob.getNumResourceEventsToProcess();
- int numProcessed = prevNumResources - numResources;
- indexingProgress.worked(numProcessed > 0 ? numProcessed : 0);
-
- // give the index some time to do some indexing
- try {
- this.fResourceEventProcessingJob.waitForConsistant(WAIT_TIME);
- }
- catch (InterruptedException e) {
- interupted = true;
- }
- }
- }
- progress.setWorkRemaining(--remainingWork);
-
- if (monitor.isCanceled()) {
- success = false;
- }
-
- // reset the interrupted flag if we were interrupted
- if (interupted) {
- Thread.currentThread().interrupt();
- }
-
- progress.done();
- return success;
- }
-
- /**
- * <p>
- * Called for each {@link IResource} given in a resource delta. If the
- * resource type is a file then used to determine if that file should be
- * processed by the manager, if the resource type is a project or
- * directory then it is used to determine if the children of the project
- * or directory should be processed looking for file resources.
- * </p>
- *
- * <p>
- * <b>NOTE:</b> Even if <code>true</code> is returned for a directory
- * resource that only means the children of the directory should be
- * inspected for possible files to index. Directories themselves can not
- * be managed in order to add to an index.
- * </p>
- *
- * @param type
- * the {@link IResource#getType()} result of the resource to
- * possibly index
- * @param path
- * the full {@link IPath} to the resource to possibly index
- * @return <code>true</code> If the resource with the given
- * <code>type</code> and <code>path</code> should either itself be
- * indexed, or its children should be indexed, <code>false</code>
- * if neither the described resource or any children should be
- * indexed
- */
- protected abstract boolean isResourceToIndex(int type, IPath path);
-
- /**
- * <p>
- * Called for each {@link ResourceEvent} gathered by the various sources
- * and processed by the {@link ResourceEventProcessingJob}. The
- * implementation of this method should use the given information to
- * update the index this manager is managing.
- * </p>
- *
- * @param source
- * The source that reported this resource event
- * @param action
- * The action to be taken on the given <code>resource</code>
- * @param resource
- * The index should perform the given <code>action</code> on
- * this resource
- * @param movePath
- * If the given <code>action</code> is
- * {@link AbstractIndexManager#ACTION_ADD_MOVE_FROM} or
- * {@link AbstractIndexManager#ACTION_REMOVE_MOVE_TO} then this
- * field will not be null and reports the path the given
- * <code>resource</code> was either moved from or moved to
- * respectively.
- *
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- * @see AbstractIndexManager#SOURCE_WORKSPACE_SCAN
- * @see AbstractIndexManager#SOURCE_PRESERVED_RESOURCES_TO_INDEX
- *
- * @see AbstractIndexManager#ACTION_ADD
- * @see AbstractIndexManager#ACTION_REMOVE
- * @see AbstractIndexManager#ACTION_ADD_MOVE_FROM
- * @see AbstractIndexManager#ACTION_REMOVE_MOVE_TO
- */
- protected abstract void performAction(byte source, byte action, IResource resource, IPath movePath);
-
- /**
- * <p>
- * Gets the working location of the manager. This is where any relevant
- * state can be persisted.
- * </p>
- *
- * @return the working location of the manager
- */
- protected abstract IPath getWorkingLocation();
-
- /**
- * <p>
- * Next time the manager starts up force a full workspace index
- * </p>
- */
- private void forceFullReIndexNextStart() {
- IPath reIndexPath = AbstractIndexManager.this.getWorkingLocation().append(RE_PROCESS_FILE_NAME);
- File file = new File(reIndexPath.toOSString());
- try {
- file.createNewFile();
- }
- catch (IOException e) {
- Logger.logException(this.fName + ": Could not create file to tell manager to" + " do a full re-index on next load. " + AbstractIndexManager.LOG_ERROR_INDEX_INVALID, e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @return <code>true</code> if a full workspace index is needed as
- * dictated by a previous call to
- * {@link #forceFullReIndexNextStart()}, <code>false</code>
- * otherwise
- */
- private boolean isForcedFullReIndexNeeded() {
- boolean forcedFullReIndexNeeded = false;
- IPath reIndexPath = AbstractIndexManager.this.getWorkingLocation().append(RE_PROCESS_FILE_NAME);
- File file = new File(reIndexPath.toOSString());
- if (file.exists()) {
- forcedFullReIndexNeeded = true;
- file.delete();
- }
-
- return forcedFullReIndexNeeded;
- }
-
- /**
- * <p>
- * A system {@link Job} used to visit all of the files in the workspace
- * looking for files to index.
- * </p>
- *
- * <p>
- * This should only have to be done once per workspace on the first load,
- * but if it fails or a SavedState can not be retrieved on a subsequent
- * workspace load then this will have to be done again.
- * </p>
- */
- private class WorkspaceVisitorJob extends Job {
- /**
- * <p>
- * Default constructor that sets up this job as a system job
- * </p>
- */
- protected WorkspaceVisitorJob() {
- super(NLS.bind(SSECoreMessages.IndexManager_0_Processing_entire_workspace_for_the_first_time, AbstractIndexManager.this.fName));
-
- this.setUser(false);
- this.setSystem(true);
- this.setPriority(Job.LONG);
- }
-
- /**
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- try {
- // update status
- monitor.beginTask(NLS.bind(SSECoreMessages.IndexManager_0_Processing_entire_workspace_for_the_first_time, AbstractIndexManager.this.fName), IProgressMonitor.UNKNOWN);
-
- // visit the workspace
- WorkspaceVisitor visitor = new WorkspaceVisitor(monitor);
- ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.NONE);
-
- // process any remaining batched up resources to index
- visitor.processBatchedResourceEvents();
- }
- catch (CoreException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Failed visiting entire workspace for initial index. " + AbstractIndexManager.LOG_ERROR_INDEX_INVALID, e); //$NON-NLS-1$
- }
-
- IStatus status;
- if (monitor.isCanceled()) {
- status = Status.CANCEL_STATUS;
- }
- else {
- status = Status.OK_STATUS;
- }
-
- monitor.done();
- return status;
- }
-
- /**
- * <p>
- * An {@link IResourceProxyVisitor} used to visit all of the files in
- * the workspace looking for files to add to the index.
- * </p>
- *
- * <p>
- * <b>NOTE: </b>After this visitor is used
- * {@link WorkspaceVisitor#processBatchedResourceEvents() must be
- * called to flush out the last of the {@link ResourceEvent}s produced
- * by this visitor.
- * </p>
- */
- private class WorkspaceVisitor implements IResourceProxyVisitor {
- /**
- * {@link IProgressMonitor} used to report status and check for
- * cancellation
- */
- private SubMonitor fProgress;
-
- /**
- * {@link Map}&lt{@link IResource}, {@link ResourceEvent}&gt
- * <p>
- * Map of resources events created and batched up by this visitor.
- * These events are periodical be sent off to the
- * {@link ResourceEventProcessingJob} but need to be sent off one
- * final time after this visitor finishes it work.
- * </p>
- *
- * @see #processBatchedResourceEvents()
- */
- private Map fBatchedResourceEvents;
-
- /**
- * <p>
- * Default constructor
- * </p>
- *
- * @param monitor
- * used to report status and allow this visitor to be
- * canceled
- */
- protected WorkspaceVisitor(IProgressMonitor monitor) {
- this.fProgress = SubMonitor.convert(monitor);
- this.fBatchedResourceEvents = new LinkedHashMap(BATCH_UP_AMOUNT);
- }
-
- /**
- * <p>
- * As long as the monitor is not canceled visit each file in the
- * workspace that should be visited.
- * </p>
- *
- * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy)
- * @see AbstractIndexManager#shouldVisit(String)
- */
- public boolean visit(IResourceProxy proxy) throws CoreException {
- this.fProgress.subTask(proxy.getName());
-
- boolean visitChildren = false;
-
- /*
- * if not canceled or a hidden resource then process file else
- * don't visit children
- */
- if (!this.fProgress.isCanceled()) {
- if (proxy.isDerived()) {
- /*
- * Do not include derived resources
- */
- visitChildren = false;
- }
- else if (proxy.requestFullPath().isRoot()) {
- visitChildren = true;
- }
- else if (isResourceToIndex(proxy.getType(), proxy.requestFullPath())) {
- if (proxy.getType() == IResource.FILE) {
- // add the file to be indexed
- IFile file = (IFile) proxy.requestResource();
- if (file.exists()) {
- this.fBatchedResourceEvents.put(file, new ResourceEvent(AbstractIndexManager.SOURCE_WORKSPACE_SCAN, AbstractIndexManager.ACTION_ADD, null));
- }
- }
- visitChildren = true;
- }
- }
-
- // batch up resource changes before sending them out
- if (this.fBatchedResourceEvents.size() >= BATCH_UP_AMOUNT) {
- this.processBatchedResourceEvents();
- }
-
- return visitChildren;
- }
-
- /**
- * <p>
- * Sends any batched up resource events created by this visitor to
- * the {@link ResourceEventProcessingJob}.
- * <p>
- *
- * <p>
- * <b>NOTE:</b> This will be called every so often as the visitor
- * is visiting resources but needs to be called a final time by
- * the user of this visitor to be sure the final events are sent
- * off
- * </p>
- */
- protected void processBatchedResourceEvents() {
- AbstractIndexManager.this.fResourceEventProcessingJob.addResourceEvents(this.fBatchedResourceEvents);
- this.fBatchedResourceEvents.clear();
- }
- }
- }
-
- /**
- * <p>
- * Used to listen to resource change events in the workspace. These events
- * are batched up and then passed onto the
- * {@link ResourceEventProcessingJob}.
- * </p>
- */
- private class ResourceChangeListener implements IResourceChangeListener {
- /**
- * <p>
- * The number of events currently being processed by this listener.
- * </p>
- * <p>
- * Use the {@link #fEventsBeingProcessedLock} when reading or writing
- * this field
- * </p>
- *
- * @see #fEventsBeingProcessedLock
- */
- private volatile int fEventsBeingProcessed;
-
- /**
- * Lock to use when reading or writing {@link #fEventsBeingProcessed}
- *
- * @see #fEventsBeingProcessed
- */
- private final Object fEventsBeingProcessedLock = new Object();
-
- /**
- * <p>
- * Current state of this listener
- * </p>
- *
- * @see AbstractIndexManager#STATE_DISABLED
- * @see AbstractIndexManager#STATE_ENABLED
- */
- private volatile byte fState;
-
- /**
- * <p>
- * Default constructor
- * </p>
- */
- protected ResourceChangeListener() {
- this.fState = STATE_DISABLED;
- this.fEventsBeingProcessed = 0;
- }
-
- /**
- * <p>
- * Start listening for resource change events
- * </p>
- */
- protected void start() {
- this.fState = STATE_ENABLED;
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- }
-
- /**
- * <p>
- * Stop listening for resource change events and if already processing
- * an event then wait for that processing to finish
- * </p>
- *
- * @throws InterruptedException
- * waiting for a current event to finish processing could
- * be interrupted
- */
- protected void stop() throws InterruptedException {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
-
- // wait indefinitely for current event to finish processing
- this.waitForCurrentEvent(0);
-
- this.fState = STATE_DISABLED;
- }
-
- /**
- * <p>
- * Blocks until either the current resource event has been processed
- * or until the given timeout has passed.
- * </p>
- *
- * @param timeout
- * block until either this timeout elapses (0 means never
- * to timeout) or the current resource change event
- * finishes being processed
- *
- * @throws InterruptedException
- * This can happen when waiting for a lock
- */
- protected void waitForCurrentEvent(int timeout) throws InterruptedException {
- synchronized (this.fEventsBeingProcessedLock) {
- if (this.fEventsBeingProcessed != 0) {
- this.fEventsBeingProcessedLock.wait(timeout);
- }
- }
- }
-
- /**
- * @return <code>true</code> if this listener is currently processing
- * any events, <code>false</code> otherwise.
- */
- protected boolean isProcessingEvents() {
- return this.fEventsBeingProcessed != 0;
- }
-
- /**
- * <p>
- * Process a resource change event. If it is a pre-close or pre-delete
- * then the {@link ResourceEventProcessingJob} is paused so it does
- * not try to process resources that are about to be deleted. The
- * {@link ResourceDeltaVisitor} is used to actually process the event.
- * </p>
- *
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- * @see ResourceDeltaVisitor
- */
- public void resourceChanged(IResourceChangeEvent event) {
- try {
- // update the number of events being processed
- synchronized (this.fEventsBeingProcessedLock) {
- ++this.fEventsBeingProcessed;
- }
-
- if (this.fState == STATE_ENABLED) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE : {
- /*
- * pause the persister job so it does not
- * interfere
- */
- AbstractIndexManager.this.fResourceEventProcessingJob.pause();
- break;
- }
- case IResourceChangeEvent.POST_BUILD :
- case IResourceChangeEvent.POST_CHANGE : {
- // post change start up the indexer job and
- // process the delta
- AbstractIndexManager.this.fResourceEventProcessingJob.unPause();
-
- // only analyze the full (starting at root) delta
- // hierarchy
- IResourceDelta delta = event.getDelta();
- if (delta != null && delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
- try {
- // use visitor to visit all children
- ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(AbstractIndexManager.SOURCE_RESOURCE_CHANGE);
- delta.accept(visitor, false);
-
- // process any remaining batched up
- // resources to index
- visitor.processBatchedResourceEvents();
- }
- catch (CoreException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Failed visiting resource change delta. " + AbstractIndexManager.LOG_ERROR_INDEX_INVALID, e); //$NON-NLS-1$
- }
- }
- break;
- }
- }
- }
- else {
- Logger.log(Logger.ERROR, "A resource change event came in after " + //$NON-NLS-1$
- AbstractIndexManager.this.fName + " shut down. This should never " + //$NON-NLS-1$
- "ever happen, but if it does the index may now be inconsistant."); //$NON-NLS-1$
- }
- }
- finally {
- // no matter how we exit be sure to update the number of
- // events being processed
- synchronized (this.fEventsBeingProcessedLock) {
- --this.fEventsBeingProcessed;
-
- // if currently not events being processed, then notify
- if (this.fEventsBeingProcessed == 0) {
- this.fEventsBeingProcessedLock.notifyAll();
- }
- }
- }
- }
- }
-
- /**
- * <p>
- * Used to visit {@link IResourceDelta}s from both the
- * {@link IResourceChangeListener} and from a {@link ISaveParticipant}
- * given to
- * {@link AbstractIndexManager#start(IResourceDelta, IProgressMonitor)}.
- * The resource events are batched into groups of
- * {@link AbstractIndexManager#BATCH_UP_AMOUNT} before being passed onto
- * the {@link ResourceEventProcessingJob}.
- * </p>
- *
- * <p>
- * <b>NOTE 1: </b> This class is intended for one time use, thus a new
- * instance should be instantiated each time this visitor is needed to
- * process a new {@link IResourceDelta}.
- * </p>
- *
- * <p>
- * <b>NOTE 2: </b> Be sure to call
- * {@link ResourceDeltaVisitor#processBatchedResourceEvents()} after using
- * this visitor to be sure any remaining events get passed onto the
- * {@link ResourceEventProcessingJob}.
- * </p>
- *
- * @see ResourceDeltaVisitor#processBatchedResourceEvents()
- */
- private class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- /** {@link IProgressMonitor} used to report status */
- private SubMonitor fProgress;
-
- /**
- * <p>
- * The source that should be used when sending resource events to the
- * {@link ResourceEventProcessingJob}.
- * </p>
- *
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- */
- private byte fSource;
-
- /**
- * <p>
- * Due to the nature of a visitor it has no way of knowing the total
- * amount of work it has to do but it can start to predict it based on
- * the number of children of each event it processes and whether it
- * plans on visiting those children
- * </p>
- */
- private int fPredictedWorkRemaining;
-
- /**
- * {@link Map}&lt{@link IResource}, {@link ResourceEvent}&gt
- * <p>
- * Map of resources events created and batched up by this visitor.
- * These events are periodical be sent off to the
- * {@link ResourceEventProcessingJob} but need to be sent off one
- * final time after this visitor finishes it work.
- * </p>
- *
- * @see #processBatchedResourceEvents()
- */
- private Map fBatchedResourceEvents;
-
- /**
- * <p>
- * Creates a visitor that will create resource events based on the
- * resources it visits and using the given source as the source of the
- * events.
- * </p>
- *
- * @param source
- * The source of the events that should be used when
- * creating resource events from visited resources
- *
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- */
- protected ResourceDeltaVisitor(byte source) {
- this(SubMonitor.convert(null), source);
- }
-
- /**
- * <p>
- * Creates a visitor that will create resource events based on the
- * resources it visits and using the given source as the source of the
- * events and report its status to the given progress as best it can
- * as it visits resources.
- * </p>
- *
- * <p>
- * <b>NOTE:</b> While the {@link SubMonitor} is provided to report
- * status the visitor will not honor any cancellation requests.
- * </p>
- *
- * @param progress
- * Used to report status. This visitor can <b>not</b> be
- * canceled
- * @param source
- * The source of the events that should be used when
- * creating resource events from visited resources
- *
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- */
- protected ResourceDeltaVisitor(SubMonitor progress, byte source) {
- this.fProgress = progress;
- this.fSource = source;
- this.fBatchedResourceEvents = new LinkedHashMap(BATCH_UP_AMOUNT);
- this.fPredictedWorkRemaining = 1;
- }
-
- /**
- * <p>
- * Transforms each {@link IResourceDelta} into a {@link ResourceEvent}
- * . Batches up these {@link ResourceEvent}s and then passes them onto
- * the {@link ResourceEventProcessingJob}.
- * </p>
- *
- * <p>
- * <b>NOTE 1: </b> Be sure to call
- * {@link ResourceDeltaVisitor#processBatchedResourceEvents()} after
- * using this visitor to be sure any remaining events get passed onto
- * the {@link ResourceEventProcessingJob}.
- * </p>
- *
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- * @see #processBatchedResourceEvents()
- */
- public boolean visit(IResourceDelta delta) throws CoreException {
- // report status
- this.fProgress.subTask(NLS.bind(SSECoreMessages.IndexManager_0_resources_to_go_1, new Object[]{"" + fPredictedWorkRemaining, delta.getFullPath().toString()})); //$NON-NLS-1$
-
- // process delta if resource not hidden
- boolean visitChildren = false;
-
- /*
- * if root node always visit its children else ask manager
- * implementation if resource and its children should be visited
- */
- if (delta.getResource().isDerived()) { // Do not include derived
- // resources
- visitChildren = false;
- }
- else if (delta.getFullPath().isRoot()) { //$NON-NLS-1$
- visitChildren = true;
- }
- else {
- IResource resource = delta.getResource();
-
- // check if should index resource or its children
- if (isResourceToIndex(resource.getType(), resource.getFullPath())) {
- if (resource.getType() == IResource.FILE) {
-
- switch (delta.getKind()) {
- case IResourceDelta.CHANGED : {
- /*
- * ignore any change that is not a CONTENT,
- * REPLACED, TYPE, or MOVE_FROM change
- */
- if (!((delta.getFlags() & IResourceDelta.CONTENT) != 0) && !((delta.getFlags() & IResourceDelta.REPLACED) != 0) && !((delta.getFlags() & IResourceDelta.TYPE) != 0) && !(((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0))) {
-
- break;
- }
- }
- /*
- * it is intended that sometimes a change will
- * fall through to add
- */
- //$FALL-THROUGH$
- case IResourceDelta.ADDED : {
- if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
- // create add move from action
- this.fBatchedResourceEvents.put(resource, new ResourceEvent(this.fSource, AbstractIndexManager.ACTION_ADD_MOVE_FROM, delta.getMovedFromPath()));
-
- }
- else {
- // create add action
- this.fBatchedResourceEvents.put(resource, new ResourceEvent(this.fSource, AbstractIndexManager.ACTION_ADD, null));
- }
-
- break;
- }
- case IResourceDelta.REMOVED : {
- if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
- // create remove move to action
- this.fBatchedResourceEvents.put(resource, new ResourceEvent(this.fSource, AbstractIndexManager.ACTION_REMOVE_MOVE_TO, delta.getMovedToPath()));
- }
- else {
- // create remove action
- this.fBatchedResourceEvents.put(resource, new ResourceEvent(this.fSource, AbstractIndexManager.ACTION_REMOVE, null));
- }
- break;
- }
- }
- }// end is file
-
- visitChildren = true;
- }
- else {
- visitChildren = false;
- }
-
-
-
- // deal with trying to report progress
- if (visitChildren) {
- this.fPredictedWorkRemaining += delta.getAffectedChildren().length;
- }
- this.fProgress.setWorkRemaining(this.fPredictedWorkRemaining);
- this.fProgress.worked(1);
- --this.fPredictedWorkRemaining;
-
- // batch up resource changes before sending them out
- if (this.fBatchedResourceEvents.size() >= BATCH_UP_AMOUNT) {
- this.processBatchedResourceEvents();
- }
- }
-
- return visitChildren;
- }
-
- /**
- * <p>
- * Sends any batched up resource events created by this visitor to the
- * {@link ResourceEventProcessingJob}.
- * <p>
- *
- * <p>
- * <b>NOTE:</b> This will be called every so often as the visitor is
- * visiting resources but needs to be called a final time by the user
- * of this visitor to be sure the final events are sent off
- * </p>
- */
- protected void processBatchedResourceEvents() {
- AbstractIndexManager.this.fResourceEventProcessingJob.addResourceEvents(this.fBatchedResourceEvents);
- this.fBatchedResourceEvents.clear();
- }
- }
-
- /**
- * <p>
- * Collects {@link ResourceEvent}s from the different sources and then
- * processes each one by calling
- * {@link AbstractIndexManager#performAction(byte, byte, IResource, IPath)}
- * for each {@link ResourceEvent}.
- * </p>
- *
- * @see AbstractIndexManager#performAction(byte, byte, IResource, IPath)
- */
- private class ResourceEventProcessingJob extends Job {
- /** Length to delay when scheduling job */
- private static final int DELAY = 500;
-
- /**
- * <p>
- * Name of the file where resource events still to index will be
- * preserved for the next start up.
- * </p>
- */
- private static final String PRESERVED_RESOURCE_EVENTS_TO_PROCESS_FILE_NAME = ".preservedResourceEvents"; //$NON-NLS-1$
-
- /**
- * <p>
- * This needs to be updated if
- * {@link #preserveReceivedResourceEvents()} ever changes how it
- * persists resource events so that
- * {@link #loadPreservedReceivedResourceEvents(SubMonitor)} knows when
- * opening a file that the format is of the current version and if not
- * knows it does not know how to read the older version.
- * </p>
- *
- * @see #preserveReceivedResourceEvents()
- * @see #loadPreservedReceivedResourceEvents(SubMonitor)
- */
- private static final long serialVersionUID = 1L;
-
- /** Whether this job has been paused or not */
- private volatile boolean fIsPaused;
-
- /**
- * {@link Map}&lt{@link IResource}, {@link ResourceEvent}&gt
- * <p>
- * The list of resources events to be processed
- * </p>
- */
- private Map fResourceEvents;
-
- /** Lock used when accessing {@link #fBatchedResourceEvents} */
- private final Object fResourceEventsLock = new Object();
-
- /**
- * Locked used for allowing other jobs to wait on this job. This job
- * will notify those waiting on this lock whenever it is done
- * processing all resource events it currently knows about.
- *
- * @see #waitForConsistant(int)
- */
- private final Object fToNotifyLock = new Object();
-
- /**
- * <p>
- * Sets up this job as a long running system job
- * </p>
- */
- protected ResourceEventProcessingJob() {
- super(NLS.bind(SSECoreMessages.IndexManager_0_Processing_resource_events, AbstractIndexManager.this.fName));
-
- // set this up as a long running system job
- this.setUser(false);
- this.setSystem(true);
- this.setPriority(Job.LONG);
-
- this.fIsPaused = false;
- this.fResourceEvents = new LinkedHashMap();
- }
-
- /**
- * <p>
- * Loads any preserved {@link ResourceEvent}s from the last time
- * {@link #stop(boolean)} was invoked and schedules the job to be run
- * </p>
- *
- * <p>
- * <b>NOTE: </b>Should be used instead of of calling
- * {@link Job#schedule()} because this method also takes care of
- * loading preserved state.
- * </p>
- *
- * @param loadPreservedResourceEvents
- * <code>true</code> if should load any preserved
- * {@link ResourceEvent}s from the last time
- * {@link #stop(boolean)} was invoked
- *
- * @return <code>true</code> if either
- * <code>loadPreservedResourceEvents</code> was false or there
- * was success in loading the preserved {@link ResourceEvent}
- * s. If <code>false</code> then some {@link ResourceEvent}s
- * may have been loosed and to insure index consistency with
- * the workspace a full workspace re-index is needed.
- *
- * @see #stop(boolean)
- */
- protected synchronized boolean start(boolean loadPreservedResourceEvents, SubMonitor progress) {
-
- boolean successLoadingPreserved = true;
-
- // attempt to load preserved resource events if requested
- if (!loadPreservedResourceEvents) {
- File preservedResourceEventsFile = this.getPreservedResourceEventsFile();
- preservedResourceEventsFile.delete();
- }
- else {
- successLoadingPreserved = this.loadPreservedReceivedResourceEvents(progress);
- }
-
- // start up the job
- this.schedule();
-
- return successLoadingPreserved;
- }
-
- /**
- * <p>
- * Immediately stops the job and preserves any {@link ResourceEvent}s
- * in the queue to be processed by not yet processed if requested
- * </p>
- *
- * @param preserveResourceEvents
- * <code>true</code> to preserve any {@link ResourceEvent}s
- * in the queue yet to be processed, <code>false</code>
- * otherwise
- *
- * @return <code>true</code> if either
- * <code>preserveResourceEvents</code> is <code>false</code>
- * or if there was success in preserving the
- * {@link ResourceEvent}s yet to be processed. If
- * <code>false</code> then the preserving failed and a full
- * workspace re-processing is needed the next time the manager
- * is started
- *
- * @throws InterruptedException
- * This could happen when trying to cancel or join the job
- * in progress, but it really shouldn't
- *
- * @see #start(boolean, SubMonitor)
- */
- protected synchronized boolean stop(boolean preserveResourceEvents) throws InterruptedException {
- // this will not block indefinitely because it is known this job
- // can be canceled
- this.cancel();
- this.join();
-
- // preserve if requested, else be sure no preserve file is left
- // over for next start
- boolean success = true;
- if (preserveResourceEvents && this.hasResourceEventsToProcess()) {
- success = this.preserveReceivedResourceEvents();
- }
- else {
- this.getPreservedResourceEventsFile().delete();
- }
-
- return success;
- }
-
- /**
- * @return <code>true</code> if job is currently running or paused
- *
- * @see #pause()
- * @see #unPause()
- */
- protected synchronized boolean isProcessing() {
- return this.getState() != Job.NONE || this.fIsPaused;
- }
-
- /**
- * <p>
- * Un-pauses this job. This has no effect if the job is already
- * running.
- * </p>
- * <p>
- * This should be used in place of {@link Job#schedule()} to reset
- * state caused by calling {@link #pause()}
- * </p>
- *
- * @see #pause()
- */
- protected synchronized void unPause() {
- this.fIsPaused = false;
-
- // get the job running again depending on its current state
- if (this.getState() == Job.SLEEPING) {
- this.wakeUp(DELAY);
- }
- else {
- this.schedule(DELAY);
- }
- }
-
- /**
- * <p>
- * Pauses this job, even if it is running
- * </p>
- * <p>
- * This should be used in place of {@link Job#sleep()} because
- * {@link Job#sleep()} will not pause a job that is already running
- * but calling this will pause this job even if it is running.
- * {@link #unPause()} must be used to start this job again
- * </p>
- *
- * @see #unPause()
- */
- protected synchronized void pause() {
- // if job is already running this will force it to pause
- this.fIsPaused = true;
-
- // this only works if the job is not running
- this.sleep();
- }
-
- /**
- * <p>
- * Adds a batch of {@link ResourceEvent}s to the queue of events to be
- * processed. Will also un-pause the job if it is not already running
- * </p>
- *
- * @param resourceEvents
- * {@link Map}&lt{@link IResource}, {@link ResourceEvent}
- * &gt A batch of {@link ResourceEvent}s to be processed
- *
- * @see #addResourceEvent(ResourceEvent)
- * @see #unPause()
- */
- protected void addResourceEvents(Map resourceEvents) {
- Iterator iter = resourceEvents.keySet().iterator();
- while (iter.hasNext()) {
- IResource resource = (IResource) iter.next();
- ResourceEvent resourceEvent = (ResourceEvent) resourceEvents.get(resource);
- addResourceEvent(resource, resourceEvent);
- }
-
- // un-pause the processor if it is not already running
- if (!isProcessing()) {
- this.unPause();
- }
- }
-
- /**
- * <p>
- * Gets the number of {@link ResourceEvent}s left to process by this
- * job. This count is only valid for the exact moment it is returned
- * because events are constantly being added and removed from the
- * queue of events to process
- * </p>
- *
- * @return the number of {@link ResourceEvent}s left to process
- */
- protected int getNumResourceEventsToProcess() {
- return this.fResourceEvents.size();
- }
-
- /**
- * <p>
- * Blocks until either the given timeout elapses (0 means never to
- * timeout), or there are currently no {@link ResourceEvent}s to
- * process or being processed by this job
- * </p>
- *
- * @param timeout
- * block until either this timeout elapses (0 means never
- * to timeout) or there are currently no
- * {@link ResourceEvent}s to process or being processed by
- * this job
- *
- * @throws InterruptedException
- * This can happen when waiting for a lock
- */
- protected void waitForConsistant(int timeout) throws InterruptedException {
- if (hasResourceEventsToProcess() || isProcessing()) {
- synchronized (this.fToNotifyLock) {
- this.fToNotifyLock.wait(timeout);
- }
- }
- }
-
- /**
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- try {
- // report status
- SubMonitor progress = SubMonitor.convert(monitor);
-
- while (!this.fIsPaused && !monitor.isCanceled() && this.hasResourceEventsToProcess()) {
- // report status
- progress.setTaskName(NLS.bind(SSECoreMessages.IndexManager_0_Indexing_1_Files, new Object[]{AbstractIndexManager.this.fName, "" + getNumResourceEventsToProcess()})); //$NON-NLS-1$
- progress.setWorkRemaining(getNumResourceEventsToProcess());
-
- // get the next event to process
- ResourceEvent resourceEvent = null;
- IResource resource = null;
- synchronized (this.fResourceEventsLock) {
- resource = (IResource) this.fResourceEvents.keySet().iterator().next();
- resourceEvent = (ResourceEvent) this.fResourceEvents.remove(resource);
- }
-
- // report status
- monitor.subTask(resource.getName());
-
- // perform action safely
- final byte source = resourceEvent.fSource;
- final byte action = resourceEvent.fAction;
- final IResource finResource = resource;
- final IPath movePath = resourceEvent.fMovePath;
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- AbstractIndexManager.this.performAction(source, action, finResource, movePath);
- }
-
- public void handleException(Throwable e) {
- Logger.logException("Error while performing an update to the index. " + //$NON-NLS-1$
- AbstractIndexManager.LOG_ERROR_INDEX_INVALID, e);
- }
- });
-
- // report progress
- progress.worked(1);
-
- // avoid dead locks
- Job.getJobManager().currentJob().yieldRule(monitor);
- }
-
- // done work
- monitor.done();
- }
- finally {
- // want to be sure we notify no matter how we exit
- this.notifyIfConsistant();
- }
-
- /*
- * if canceled then return CANCEL, else if done or paused return
- * OK
- */
- IStatus exitStatus;
- if (monitor.isCanceled()) {
- exitStatus = Status.CANCEL_STATUS;
- }
- else {
- exitStatus = Status.OK_STATUS;
- }
-
- return exitStatus;
- }
-
- /**
- * <p>
- * If resource not already scheduled to be processed, schedule it else
- * if resource already scheduled to be processed, update the action
- * only if the new action comes from a resource change event.
- * </p>
- *
- * <p>
- * Ignore other sources for updating existing resource events because
- * all other sources are "start-up" type sources and thus only
- * {@link ResourceEvent} with a source of a resource change event
- * trump existing events.
- * </p>
- *
- * @param resourceEvent
- * {@link ResourceEvent} to be processed by this job
- */
- private void addResourceEvent(IResource resource, ResourceEvent resourceEvent) {
-
- synchronized (this.fResourceEventsLock) {
- /*
- * if resource not already scheduled to be processed, schedule
- * it else if resource already scheduled to be processed,
- * update the action only if the new action comes from a
- * resource change event
- */
- if (!this.fResourceEvents.containsKey(resource)) {
- this.fResourceEvents.put(resource, resourceEvent);
- }
- else if (resourceEvent.fSource == AbstractIndexManager.SOURCE_RESOURCE_CHANGE) {
- ((ResourceEvent) this.fResourceEvents.get(resource)).fAction = resourceEvent.fAction;
- }
- else {
- // Purposely ignoring all other resource events
- }
- }
- }
-
- /**
- * @return <code>true</code> if there are any resources to process,
- * <code>false</code> otherwise
- */
- private boolean hasResourceEventsToProcess() {
- return !this.fResourceEvents.isEmpty();
- }
-
- /**
- * <p>
- * Preserves all of the resource events that have been received by
- * this manager but not yet processed
- * </p>
- *
- * <p>
- * If this operation was successful then the next time the manager
- * starts it can load these events and process them. If it was not
- * successful then a full re-processing of the entire workspace will
- * need to take place to be sure the index is consistent.
- * </p>
- *
- * <p>
- * <b>NOTE:</b> If this method changes how it preserves these events
- * then {@link #serialVersionUID} will need to be incremented so that
- * the manager does not attempt to load an old version of the file
- * that may exist in a users workspace. Also
- * {@link #loadPreservedReceivedResourceEvents(SubMonitor)} will have
- * to be updated to load the new file structure.
- * </p>
- *
- * @return <code>true</code> if successfully preserved the resource
- * events that have been received by not yet processed,
- * <code>false</code> otherwise
- *
- * @see #serialVersionUID
- * @see #loadPreservedReceivedResourceEvents(SubMonitor)
- */
- private boolean preserveReceivedResourceEvents() {
- File preservedResourceEventsFile = this.getPreservedResourceEventsFile();
- boolean success = true;
-
- synchronized (this.fResourceEventsLock) {
- DataOutputStream dos = null;
- try {
- // if file already exists delete it
- if (preservedResourceEventsFile.exists()) {
- preservedResourceEventsFile.delete();
- preservedResourceEventsFile.createNewFile();
- }
-
- // create output objects
- FileOutputStream fos = new FileOutputStream(preservedResourceEventsFile);
- BufferedOutputStream bos = new BufferedOutputStream(fos);
- dos = new DataOutputStream(bos);
-
- // write serial version
- dos.writeLong(serialVersionUID);
-
- // write size
- dos.writeInt(this.getNumResourceEventsToProcess());
-
- // write out all the information needed to restore the
- // resource events to process
- Iterator iter = this.fResourceEvents.keySet().iterator();
- while (iter.hasNext()) {
- IResource resource = (IResource) iter.next();
- ResourceEvent resourceEvent = (ResourceEvent) this.fResourceEvents.get(resource);
-
- if (resourceEvent.fSource != AbstractIndexManager.SOURCE_WORKSPACE_SCAN) {
- // write out information
- dos.writeByte(resourceEvent.fAction);
- dos.writeByte(resource.getType());
- byte[] pathBytes = resource.getFullPath().toString().getBytes(ENCODING_UTF16);
- dos.write(pathBytes);
- dos.writeByte('\0');
- if (resourceEvent.fMovePath != null) {
- dos.writeBytes(resourceEvent.fMovePath.toPortableString());
- }
- dos.writeByte('\0');
- }
- }
-
- this.fResourceEvents.clear();
-
- dos.flush();
- }
- catch (FileNotFoundException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while opening file to preserve resources to index.", //$NON-NLS-1$
- e);
- success = false;
- }
- catch (IOException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while writing to file to preserve resources to index.", //$NON-NLS-1$
- e);
- success = false;
- }
- finally {
- // be sure to close output
- if (dos != null) {
- try {
- dos.close();
- }
- catch (IOException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while closing file with preserved resources to index.", //$NON-NLS-1$
- e);
- success = false;
- }
- }
- }
-
- // if failed, for consistency must do a full re-process next
- // workspace load
- if (!success) {
- preservedResourceEventsFile.delete();
- }
- }
-
- return success;
- }
-
- /**
- * <p>
- * Loads the received resource events that were preserved during the
- * manager's last shut down so they can be processed now
- * </p>
- *
- * <p>
- * If this operation is not successful then a full re-processing of
- * the entire workspace is needed to be sure the index is consistent.
- * </p>
- *
- * @param progress
- * used to report status of loading the preserved received
- * resource events
- * @return <code>true</code> if the loading of the preserved received
- * resource events was successful, <code>false</code>
- * otherwise.
- *
- * @see #serialVersionUID
- * @see #preserveReceivedResourceEvents()
- */
- private boolean loadPreservedReceivedResourceEvents(SubMonitor progress) {
- progress.subTask(SSECoreMessages.IndexManager_processing_deferred_resource_changes);
-
- boolean success = true;
- File preservedResourceEventsFile = this.getPreservedResourceEventsFile();
-
- if (preservedResourceEventsFile.exists()) {
- Map preservedResourceEvents = null;
-
- DataInputStream dis = null;
- try {
- FileInputStream fis = new FileInputStream(preservedResourceEventsFile);
- BufferedInputStream bis = new BufferedInputStream(fis);
- dis = new DataInputStream(bis);
-
- // check serial version first
- long preservedSerialVersionUID = dis.readLong();
- if (preservedSerialVersionUID == serialVersionUID) {
-
- // read each record
- int numberOfRecords = dis.readInt();
- preservedResourceEvents = new LinkedHashMap(numberOfRecords);
- progress.setWorkRemaining(numberOfRecords);
- for (int i = 0; i < numberOfRecords; ++i) {
- // action is first byte
- byte action = dis.readByte();
-
- // file type is the next byte
- byte fileType = dis.readByte();
-
- // resource location are the next bytes
- ByteArrayOutputStream resourceLocationStream = new ByteArrayOutputStream();
- byte b = dis.readByte();
- while (b != '\0') {
- resourceLocationStream.write(b);
- b = dis.readByte();
- }
-
- // move path are the next bytes
- ByteArrayOutputStream movePathBOS = new ByteArrayOutputStream();
- b = dis.readByte();
- while (b != '\0') {
- movePathBOS.write(b);
- b = dis.readByte();
- }
-
- // get the resource
- IResource resource = null;
- IPath resourcePath = new Path(new String(resourceLocationStream.toByteArray(), ENCODING_UTF16));
- if (!resourcePath.isRoot() && resourcePath.segmentCount() > 1) {
- if (fileType == IResource.FILE) {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFile(resourcePath);
- }
- else {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFolder(resourcePath);
- }
- }
- else {
- Logger.log(Logger.WARNING, "The AbstractIndexManager " + AbstractIndexManager.this.fName + " attempted to load an invlaid preserved resource event:\n" + "(" + resourcePath + ")");
- }
-
- // get the move path
- IPath movePath = null;
- if (movePathBOS.size() != 0) {
- movePath = new Path(new String(movePathBOS.toByteArray(), ENCODING_UTF16));
- }
-
- // add the object to the list of of preserved
- // resources
- preservedResourceEvents.put(resource, new ResourceEvent(AbstractIndexManager.SOURCE_PRESERVED_RESOURCES_TO_INDEX, action, movePath));
-
- progress.worked(1);
- }
- }
- else {
- success = false;
- }
- }
- catch (FileNotFoundException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while opening file to read preserved resources to index. Index manager will recover by re-indexing workspace.", //$NON-NLS-1$
- e);
- success = false;
- }
- catch (IOException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while reading from file of preserved resources to index. Index manager will recover by re-indexing workspace.", //$NON-NLS-1$
- e);
- success = false;
- }
- catch (Exception e) {
- // Purposely catching all exceptions here so that index
- // manager can recover gracefully
- Logger.logException(AbstractIndexManager.this.fName + ": Unexpected exception while reading from file of preserved resources to index. Index manager will recover by re-indexing workspace.", //$NON-NLS-1$
- e);
- success = false;
- }
- finally {
- if (dis != null) {
- try {
- dis.close();
- }
- catch (IOException e) {
- Logger.logException(AbstractIndexManager.this.fName + ": Exception while closing file of preserved resources" + //$NON-NLS-1$
- " to index that was just read. This should have no" + //$NON-NLS-1$
- " effect on the consistency of the index.", //$NON-NLS-1$
- e);
- }
- }
- }
-
- // if success loading preserved then add to master list
- if (success && preservedResourceEvents != null) {
- synchronized (this.fResourceEventsLock) {
- Iterator iter = preservedResourceEvents.keySet().iterator();
- while (iter.hasNext()) {
- IResource resource = (IResource) iter.next();
- ResourceEvent event = (ResourceEvent) preservedResourceEvents.get(resource);
- this.fResourceEvents.put(resource, event);
- }
- }
- }
- else {
- // failed reading file, so delete it
- preservedResourceEventsFile.delete();
- }
- }
-
- progress.done();
- return success;
- }
-
- /**
- * @return {@link File} that contains any resource events received but
- * not processed by this manager the last time it shutdown.
- * This file may or may not actually exist.
- *
- * @see #preserveReceivedResourceEvents()
- * @see #loadPreservedReceivedResourceEvents(SubMonitor)
- */
- private File getPreservedResourceEventsFile() {
- IPath preservedResourcesToIndexPath = AbstractIndexManager.this.getWorkingLocation().append(PRESERVED_RESOURCE_EVENTS_TO_PROCESS_FILE_NAME);
- return new File(preservedResourcesToIndexPath.toOSString());
- }
-
- /**
- * <p>
- * If all resource events have been processed
- */
- private void notifyIfConsistant() {
- if (!this.hasResourceEventsToProcess()) {
- synchronized (this.fToNotifyLock) {
- this.fToNotifyLock.notifyAll();
- }
- }
- }
- }
-
- /**
- * <p>
- * Represents a resource that was discovered by this manager. Contains all
- * the information this manager and the index needs to know about this
- * resource. Such has how the manager was notified about this resource and
- * the type of action occurring on the resource.
- * </p>
- */
- private static class ResourceEvent {
- /**
- * <p>
- * The source of this resource event
- * </p>
- *
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- * @see AbstractIndexManager#SOURCE_WORKSPACE_SCAN
- * @see AbstractIndexManager#SOURCE_PRESERVED_RESOURCES_TO_INDEX
- */
- protected byte fSource;
-
- /**
- * <p>
- * The action that the index should take with this resource
- * </p>
- *
- * @see AbstractIndexManager#ACTION_ADD
- * @see AbstractIndexManager#ACTION_REMOVE
- * @see AbstractIndexManager#ACTION_ADD_MOVE_FROM
- * @see AbstractIndexManager#ACTION_REMOVE_MOVE_TO
- */
- protected byte fAction;
-
- /**
- *
- * <p>
- * If the {@link #fAction} is
- * {@link AbstractIndexManager#ACTION_ADD_MOVE_FROM} or
- * {@link AbstractIndexManager#ACTION_REMOVE_MOVE_TO} then this field
- * will have the path the resource was moved from or moved to. Else
- * this field will be <code>null</code>
- * </p>
- *
- * <p>
- * <b>NOTE: </b>Maybe <code>null</code>.
- * </p>
- *
- * @see AbstractIndexManager#ACTION_ADD_MOVE_FROM
- * @see AbstractIndexManager#ACTION_REMOVE_MOVE_TO
- */
- protected IPath fMovePath;
-
- /**
- * <p>
- * Creates a resource event that the index needs to react to in some
- * way
- * </p>
- *
- * @param source
- * source that the manager used to learn of this resource
- * @param action
- * action the index should take on this resource
- * @param resource
- * resource that the index should know about
- * @param movePath
- * if action is
- * {@link AbstractIndexManager#ACTION_ADD_MOVE_FROM} or
- * {@link AbstractIndexManager#ACTION_REMOVE_MOVE_TO} then
- * this should be the path the resource was moved from or
- * moved to respectively, else should be <code>null</code>
- *
- * @see AbstractIndexManager#SOURCE_RESOURCE_CHANGE
- * @see AbstractIndexManager#SOURCE_SAVED_STATE
- * @see AbstractIndexManager#SOURCE_WORKSPACE_SCAN
- * @see AbstractIndexManager#SOURCE_PRESERVED_RESOURCES_TO_INDEX
- *
- * @see AbstractIndexManager#ACTION_ADD
- * @see AbstractIndexManager#ACTION_REMOVE
- * @see AbstractIndexManager#ACTION_ADD_MOVE_FROM
- * @see AbstractIndexManager#ACTION_REMOVE_MOVE_TO
- */
- protected ResourceEvent(byte source, byte action, IPath movePath) {
- this.fSource = source;
- this.fAction = action;
- this.fMovePath = movePath;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
deleted file mode 100644
index 6ae82d5c14..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
+++ /dev/null
@@ -1,838 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possible
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.IFileBufferListener;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-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.util.URIResolver;
-
-/**
- * Not intended to be subclassed, referenced or instantiated by clients.
- *
- * This class is responsible for coordinating the creation and disposal of
- * structured models built on structured documents found in FileBuffers. It
- * allows the SSE Model Manager to act as a client to the
- * TextFileBufferManager.
- */
-public class FileBufferModelManager {
-
- static class DocumentInfo {
- /**
- * The ITextFileBuffer
- */
- ITextFileBuffer buffer = null;
-
- /**
- * The platform content-type ID of this document
- */
- String contentTypeID = null;
-
- /**
- * The IStructureModel containing this document; might be null at
- * points in the ITextFileBuffer's lifecycle
- */
- IStructuredModel model = null;
-
- /**
- * Whether FileBufferModelManager called connect() for this
- * DocumentInfo's text filebuffer
- */
- boolean selfConnected = false;
-
- int bufferReferenceCount = 0;
- int modelReferenceCount = 0;
-
- /**
- * The default value is the "compatibility" kind from before there was
- * a LocationKind hint object--this is expected to be overridden at
- * runtime.
- */
- LocationKind locationKind = LocationKind.NORMALIZE;
- }
-
- /**
- * A URIResolver instance of models built on java.io.Files
- */
- static class ExternalURIResolver implements URIResolver {
- IPath fLocation;
-
- ExternalURIResolver(IPath location) {
- fLocation = location;
- }
-
- public String getFileBaseLocation() {
- if (fLocation == null)
- return null;
- else
- return fLocation.toString();
- }
-
- public String getLocationByURI(String uri) {
- return getLocationByURI(uri, getFileBaseLocation(), false);
- }
-
- public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
- }
-
- public String getLocationByURI(String uri, String baseReference) {
- return getLocationByURI(uri, baseReference, false);
- }
-
- public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
- // ignore resolveCrossProjectLinks value
- if (uri == null)
- return null;
- if (uri.startsWith("file:")) { //$NON-NLS-1$
- try {
- URL url = new URL(uri);
- return url.getFile();
- }
- catch (MalformedURLException e) {
- }
- }
- return URIHelper.normalize(uri, baseReference, Path.ROOT.toString());
- }
-
- public IProject getProject() {
- return null;
- }
-
- public IContainer getRootLocation() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- public InputStream getURIStream(String uri) {
- return null;
- }
-
- public void setFileBaseLocation(String newLocation) {
- if (newLocation != null)
- fLocation = new Path(newLocation);
- else
- fLocation = null;
- }
-
- public void setProject(IProject newProject) {
- }
- }
-
- /**
- * A URIResolver instance of models built on the extensible WST URI
- * resolver
- */
- static class CommonURIResolver implements URIResolver {
- String fLocation;
- IPath fPath;
- private IProject fProject;
- final static String SEPARATOR = "/"; //$NON-NLS-1$
- final static String FILE_PREFIX = "file://"; //$NON-NLS-1$
-
- CommonURIResolver(IFile workspaceFile) {
- fPath = workspaceFile.getFullPath();
- fProject = workspaceFile.getProject();
- }
-
- public String getFileBaseLocation() {
- return fLocation;
- }
-
- public String getLocationByURI(String uri) {
- return getLocationByURI(uri, getFileBaseLocation(), false);
- }
-
- public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
- }
-
- public String getLocationByURI(String uri, String baseReference) {
- return getLocationByURI(uri, baseReference, false);
- }
-
- public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
- boolean baseHasPrefix = baseReference != null && baseReference.startsWith(FILE_PREFIX);
- String reference = null;
- if (baseHasPrefix) {
- reference = baseReference;
- }
- else {
- reference = FILE_PREFIX + baseReference;
- }
- String result = URIResolverPlugin.createResolver().resolve(reference, null, uri);
- // Logger.log(Logger.INFO_DEBUG,
- // "URIResolverPlugin.createResolver().resolve("
- // + reference + ", null, " +uri+") = " + result);
- if (!baseHasPrefix && result.startsWith(FILE_PREFIX) && result.length() > FILE_PREFIX.length()) {
- result = result.substring(FILE_PREFIX.length());
- }
- return result;
- }
-
- public IProject getProject() {
- return fProject;
- }
-
- public IContainer getRootLocation() {
- String root = URIResolverPlugin.createResolver().resolve(FILE_PREFIX + getFileBaseLocation(), null, SEPARATOR);
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(root));
- for (int i = 0; i < files.length; i++) {
- if ((files[i].getType() & IResource.FOLDER) == IResource.FOLDER) {
- if (fPath.isPrefixOf(((IFolder) files[i]).getFullPath())) {
- return (IFolder) files[i];
- }
- }
- }
- return getProject();
- }
-
- public InputStream getURIStream(String uri) {
- return null;
- }
-
- public void setFileBaseLocation(String newLocation) {
- fLocation = newLocation;
- }
-
- public void setProject(IProject newProject) {
- fProject = newProject;
- }
- }
-
- /**
- * Maps interesting documents in file buffers to those file buffers.
- * Required to allow us to go from the document instances to complete
- * models.
- */
- class FileBufferMapper implements IFileBufferListener {
- public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
- }
-
- public void bufferContentReplaced(IFileBuffer buffer) {
- }
-
- public void bufferCreated(IFileBuffer buffer) {
- if (buffer instanceof ITextFileBuffer) {
- ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
- if (!(textBuffer.getDocument() instanceof IStructuredDocument))
- return;
-
- if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, "Learned new buffer: " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- DocumentInfo info = new DocumentInfo();
- info.buffer = textBuffer;
- info.contentTypeID = detectContentType(buffer.getLocation()).getId();
- info.bufferReferenceCount++;
- fDocumentMap.put(textBuffer.getDocument(), info);
- }
- }
-
- public void bufferDisposed(IFileBuffer buffer) {
- if (buffer instanceof ITextFileBuffer) {
- ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
- if (!(textBuffer.getDocument() instanceof IStructuredDocument))
- return;
- if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, "Discarded buffer: " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
- if (info != null) {
- info.bufferReferenceCount--;
- checkReferenceCounts(info, textBuffer.getDocument());
- }
- }
- }
-
- public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
- if (buffer instanceof ITextFileBuffer) {
- if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, "Buffer dirty state changed: (" + isDirty + ") " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
- if (!(textBuffer.getDocument() instanceof IStructuredDocument))
- return;
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
- if (info != null && info.model != null) {
- String msg = "Updating model dirty state for" + info.buffer.getLocation(); //$NON-NLS-1$
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT || Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, msg);
- }
- info.model.setDirtyState(isDirty);
-
- IFile workspaceFile = FileBuffers.getWorkspaceFileAtLocation(info.buffer.getLocation());
- if (!isDirty && workspaceFile != null) {
- info.model.resetSynchronizationStamp(workspaceFile);
- }
- }
- }
- }
-
- public void stateChangeFailed(IFileBuffer buffer) {
- }
-
- public void stateChanging(IFileBuffer buffer) {
- }
-
- public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
- }
-
- public void underlyingFileDeleted(IFileBuffer buffer) {
- if (buffer instanceof ITextFileBuffer) {
- if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, "Deleted buffer: " + buffer.getLocation().toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- public void underlyingFileMoved(IFileBuffer buffer, IPath path) {
- if (buffer instanceof ITextFileBuffer) {
- if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
- Logger.log(Logger.INFO, "Moved buffer from: " + buffer.getLocation().toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
- Logger.log(Logger.INFO, "Moved buffer to: " + path.toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
-
- private static FileBufferModelManager instance = new FileBufferModelManager();
-
- public static FileBufferModelManager getInstance() {
- return instance;
- }
-
- static synchronized final void shutdown() {
- FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
-
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT || Logger.DEBUG_FILEBUFFERMODELLEAKS) {
- IDocument[] danglingDocuments = (IDocument[]) instance.fDocumentMap.keySet().toArray(new IDocument[0]);
- for (int i = 0; i < danglingDocuments.length; i++) {
- DocumentInfo info = (DocumentInfo) instance.fDocumentMap.get(danglingDocuments[i]);
- if (info.modelReferenceCount > 0)
- System.err.println("LEAKED MODEL: " + info.buffer.getLocation() + " " + (info.model != null ? info.model.getId() : null)); //$NON-NLS-1$ //$NON-NLS-2$
- if (info.bufferReferenceCount > 0)
- System.err.println("LEAKED BUFFER: " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- static synchronized final void startup() {
- FileBuffers.getTextFileBufferManager().addFileBufferListener(getInstance().fFileBufferListener);
- }
-
- // a map of IStructuredDocuments to DocumentInfo objects
- Map fDocumentMap = null;
-
- FileBufferMapper fFileBufferListener = new FileBufferMapper();
-
- FileBufferModelManager() {
- super();
- fDocumentMap = new Hashtable(4);
- }
-
- public String calculateId(IFile file) {
- if (file == null) {
- Exception iae = new IllegalArgumentException("can not calculate a model ID without an IFile"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- String id = null;
- IPath path = file.getFullPath();
- if (path != null) {
- /*
- * The ID of models must be the same as the normalized paths
- * stored in the underlying FileBuffers to retrieve them by common
- * ID later on. We chose the FileBuffer normalized path over the
- * previously used absolute IFile path because the buffers should
- * already exist before we build a model and we can't retrieve a
- * FileBuffer using the ID of a model that doesn't yet exist.
- */
- id = FileBuffers.normalizeLocation(path).toString();
- }
- return id;
-
- }
-
-
- public String calculateId(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not calculate a model ID without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- String id = null;
- ITextFileBuffer buffer = getBuffer(document);
- if (buffer != null) {
- id = buffer.getLocation().toString();
- }
- return id;
- }
-
- /**
- * Registers "interest" in a document, or rather the file buffer that
- * backs it. Intentionally used to alter the reference count of the file
- * buffer so it is not accidentally disposed of while we have a model open
- * on top of it.
- */
- public boolean connect(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not connect() without a document"); //$NON-NLS-1$
- Logger.logException(iae);
- return false;
- }
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info == null)
- return false;
- ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
- IPath bufferLocation = info.buffer.getLocation();
- boolean isOK = true;
- try {
- bufferManager.connect(bufferLocation, info.locationKind, null);
- }
- catch (CoreException e) {
- Logger.logException(e);
- isOK = false;
- }
- return isOK;
- }
-
- URIResolver createURIResolver(ITextFileBuffer buffer) {
- IPath location = buffer.getLocation();
- IFile workspaceFile = FileBuffers.getWorkspaceFileAtLocation(location);
- URIResolver resolver = null;
- if (workspaceFile != null) {
- IProject project = workspaceFile.getProject();
- resolver = (URIResolver) project.getAdapter(URIResolver.class);
- if (resolver == null) {
- resolver = new CommonURIResolver(workspaceFile);
- }
-
- String baseLocation = null;
- if (workspaceFile.getLocation() != null) {
- baseLocation = workspaceFile.getLocation().toString();
- }
- if (baseLocation == null && workspaceFile.getLocationURI() != null) {
- baseLocation = workspaceFile.getLocationURI().toString();
- }
- if (baseLocation == null) {
- baseLocation = workspaceFile.getFullPath().toString();
- }
- resolver.setFileBaseLocation(baseLocation);
- }
- else {
- resolver = new ExternalURIResolver(location);
- }
- return resolver;
- }
-
-
- IContentType detectContentType(IPath location) {
- IContentType type = null;
-
- IResource resource = FileBuffers.getWorkspaceFileAtLocation(location);
- if (resource != null) {
- if (resource.getType() == IResource.FILE && resource.isAccessible()) {
- IContentDescription d = null;
- try {
- // Optimized description lookup, might not succeed
- d = ((IFile) resource).getContentDescription();
- if (d != null) {
- type = d.getContentType();
- }
- }
- catch (CoreException e) {
- // Should not be possible given the accessible and file
- // type check above
- }
- if (type == null) {
- type = Platform.getContentTypeManager().findContentTypeFor(resource.getName());
- }
- }
- }
- else {
- File file = FileBuffers.getSystemFileAtLocation(location);
- if (file != null) {
- InputStream input = null;
- try {
- input = new FileInputStream(file);
- type = Platform.getContentTypeManager().findContentTypeFor(input, file.getName());
- }
- catch (FileNotFoundException e) {
- }
- catch (IOException e) {
- }
- finally {
- if (input != null) {
- try {
- input.close();
- }
- catch (IOException e1) {
- }
- }
- }
- if (type == null) {
- type = Platform.getContentTypeManager().findContentTypeFor(file.getName());
- }
- }
- }
- if (type == null) {
- type = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT);
- }
- return type;
- }
-
- /**
- * Deregisters "interest" in a document, or rather the file buffer that
- * backs it. Intentionally used to alter the reference count of the file
- * buffer so that it knows it can safely be disposed of.
- */
- public boolean disconnect(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not disconnect() without a document"); //$NON-NLS-1$
- Logger.logException(iae);
- return false;
- }
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if( info == null)
- return false;
- ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
- IPath bufferLocation = info.buffer.getLocation();
- boolean isOK = true;
- try {
- bufferManager.disconnect(bufferLocation, info.locationKind, null);
- }
- catch (CoreException e) {
- Logger.logException(e);
- isOK = false;
- }
- return isOK;
- }
-
- public ITextFileBuffer getBuffer(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not get a buffer without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info != null)
- return info.buffer;
- return null;
- }
-
- String getContentTypeID(IDocument document) {
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info != null)
- return info.contentTypeID;
- return null;
- }
-
- IStructuredModel getModel(File file) {
- if (file == null) {
- Exception iae = new IllegalArgumentException("can not get/create a model without a java.io.File"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- IStructuredModel model = null;
- ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
- try {
- IPath location = new Path(file.getAbsolutePath());
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
- Logger.log(Logger.INFO, "FileBufferModelManager connecting to File " + location); //$NON-NLS-1$
- }
- bufferManager.connect(location, LocationKind.LOCATION, getProgressMonitor());
- ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location, LocationKind.LOCATION);
- if (buffer != null) {
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
- if (info != null) {
- /*
- * Note: "info" being null at this point is a slight
- * error.
- *
- * The connect call from above (or at some time earlier in
- * the session) would have notified the FileBufferMapper
- * of the creation of the corresponding text buffer and
- * created the DocumentInfo object for
- * IStructuredDocuments.
- */
- info.locationKind = LocationKind.LOCATION;
- info.selfConnected = true;
- }
- /*
- * Check the document type. Although returning null for
- * unknown documents would be fair, try to get a model if
- * the document is at least a valid type.
- */
- IDocument bufferDocument = buffer.getDocument();
- if (bufferDocument instanceof IStructuredDocument) {
- model = getModel((IStructuredDocument) bufferDocument);
- }
- else {
- /*
- * 190768 - Quick diff marks do not disappear in the
- * vertical ruler of JavaScript editor and
- *
- * 193805 - Changes are not thrown away when close
- * with no save for files with no structured model
- * associated with them (text files, javascript files,
- * etc) in web project
- */
- bufferManager.disconnect(location, LocationKind.IFILE, getProgressMonitor());
- }
- }
- }
- catch (CoreException e) {
- Logger.logException("Error getting model for " + file.getPath(), e); //$NON-NLS-1$
- }
- return model;
- }
-
- public IStructuredModel getModel(IFile file) {
- if (file == null) {
- Exception iae = new IllegalArgumentException("can not get/create a model without an IFile"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- IStructuredModel model = null;
- ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
- try {
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
- Logger.log(Logger.INFO, "FileBufferModelManager connecting to IFile " + file.getFullPath()); //$NON-NLS-1$
- }
- // see TextFileDocumentProvider#createFileInfo about why we use
- // IFile#getFullPath
- // here, not IFile#getLocation.
- IPath location = file.getFullPath();
- if (location != null) {
- bufferManager.connect(location, LocationKind.IFILE, getProgressMonitor());
- ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location, LocationKind.IFILE);
- if (buffer != null) {
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
- if (info != null) {
- /*
- * Note: "info" being null at this point is a slight
- * error.
- *
- * The connect call from above (or at some time
- * earlier in the session) would have notified the
- * FileBufferMapper of the creation of the
- * corresponding text buffer and created the
- * DocumentInfo object for IStructuredDocuments.
- */
- info.selfConnected = true;
- info.locationKind = LocationKind.IFILE;
- }
- /*
- * Check the document type. Although returning null for
- * unknown documents would be fair, try to get a model if
- * the document is at least a valid type.
- */
- IDocument bufferDocument = buffer.getDocument();
- if (bufferDocument instanceof IStructuredDocument) {
- model = getModel((IStructuredDocument) bufferDocument);
- }
- else {
- /*
- * 190768 - Quick diff marks do not disappear in the
- * vertical ruler of JavaScript editor and
- *
- * 193805 - Changes are not thrown away when close
- * with no save for files with no structured model
- * associated with them (text files, javascript files,
- * etc) in web project
- */
- bufferManager.disconnect(location, LocationKind.IFILE, getProgressMonitor());
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException("Error getting model for " + file.getFullPath(), e); //$NON-NLS-1$
- }
- return model;
- }
-
- public IStructuredModel getModel(IStructuredDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not get/create a model without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return null;
- }
-
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info != null && info.model == null) {
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
- Logger.log(Logger.INFO, "FileBufferModelManager creating model for " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- info.modelReferenceCount++;
-
- IStructuredModel model = null;
- IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(info.contentTypeID);
- IModelLoader loader = handler.getModelLoader();
- model = loader.createModel(document, info.buffer.getLocation().toString(), handler);
- try {
- info.model = model;
- model.setId(info.buffer.getLocation().toString());
- // handler now set by loader, for now
- // model.setModelHandler(handler);
- if (model instanceof AbstractStructuredModel) {
- ((AbstractStructuredModel) model).setContentTypeIdentifier(info.contentTypeID);
- }
- model.setResolver(createURIResolver(getBuffer(document)));
- if (info.buffer.isDirty()) {
- model.setDirtyState(true);
- }
- }
- catch (ResourceInUse e) {
- Logger.logException("attempted to create new model with existing ID", e); //$NON-NLS-1$
- model = null;
- }
- }
- if (info != null) {
- return info.model;
- }
- return null;
- }
-
- /**
- * @return
- */
- private IProgressMonitor getProgressMonitor() {
- return new NullProgressMonitor();
- }
-
- /**
- * Will remove the entry corresponding to <code>document</code> if both
- * there are no more buffer or model reference counts for <code>info</code>
- *
- * @param info the document info to check for reference counts
- * @param document the key to remove from the document map if there are no more
- * references
- */
- private void checkReferenceCounts(DocumentInfo info, IDocument document) {
- if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
- fDocumentMap.remove(document);
- }
-
- public boolean isExistingBuffer(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not check for an existing buffer without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return false;
- }
-
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- return info != null;
- }
-
- public void releaseModel(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not release a model without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return;
- }
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info != null) {
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
- Logger.log(Logger.INFO, "FileBufferModelManager noticed full release of model for " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- info.model = null;
- info.modelReferenceCount--;
- if (info.selfConnected) {
- if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
- Logger.log(Logger.INFO, "FileBufferModelManager disconnecting from " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IPath location = info.buffer.getLocation();
- try {
- FileBuffers.getTextFileBufferManager().disconnect(location, info.locationKind, getProgressMonitor());
- }
- catch (CoreException e) {
- Logger.logException("Error releasing model for " + location, e); //$NON-NLS-1$
- }
- }
- // [265899]
- // In some scenarios, a model can be held onto after the editor has been disposed even if the lifecycle is
- // maintained properly (e.g., an editor being closed before a DirtyRegionProcessor has a chance to complete). Because of this,
- // the manager cannot be reliant upon the FileBufferMapper having the sole responsibility of the fDocumentMap cleanup
- checkReferenceCounts(info, document);
- }
- }
-
- public void revert(IDocument document) {
- if (document == null) {
- Exception iae = new IllegalArgumentException("can not release a model without a document reference"); //$NON-NLS-1$
- Logger.logException(iae);
- return;
- }
- DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
- if (info == null) {
- Logger.log(Logger.ERROR, "FileBufferModelManager was asked to revert a document but was not being managed"); //$NON-NLS-1$
- }
- else {
- // get path just for potential error message
- IPath location = info.buffer.getLocation();
- try {
- // ISSUE: in future, clients should provide progress monitor
- info.buffer.revert(getProgressMonitor());
- }
- catch (CoreException e) {
- // ISSUE: shoudl we not be re-throwing CoreExceptions? Or
- // not catch them at all?
- Logger.logException("Error reverting model for " + location, e); //$NON-NLS-1$
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
deleted file mode 100644
index 63c5894a52..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.core.internal;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-
-/**
- * An abstraction that allows even processing to be performed in a different
- * context, e.g. a different Thread, if needed.
- *
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IExecutionDelegate {
-
- void execute(ISafeRunnable runnable);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java
deleted file mode 100644
index c8aa5005af..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java
+++ /dev/null
@@ -1,30 +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.sse.core.internal;
-
-import org.eclipse.core.runtime.jobs.ILock;
-
-/**
- *
- * Not API: not to be used or implemented by clients. This is a special
- * purpose interface to help guard some threading issues betweeen model and
- * document. Will be changed soon.
- *
- */
-
-public interface ILockable {
-
- ILock getLockObject();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java
deleted file mode 100644
index a9e229254b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java
+++ /dev/null
@@ -1,22 +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.sse.core.internal;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-public interface JSPAwareAdapterFactory extends INodeAdapterFactory {
-
- void initializeWith(EmbeddedTypeHandler embeddedContentType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
deleted file mode 100644
index f826867a1e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
+++ /dev/null
@@ -1,219 +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.sse.core.internal;
-
-
-
-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.sse.core"; //$NON-NLS-1$
- /**
- * true if both platform and this plugin are in debug mode
- */
- public static final boolean DEBUG = Platform.inDebugMode() && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/debug")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging adapter
- * notification time
- */
- public static final boolean DEBUG_ADAPTERNOTIFICATIONTIME = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/dom/adapter/notification/time")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging structured
- * document
- */
- public static final boolean DEBUG_DOCUMENT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structureddocument")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging file buffer
- * model management
- */
- public static final boolean DEBUG_FILEBUFFERMODELMANAGEMENT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/modelmanagement")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging file buffer
- * models not being released on shutdown
- */
- public static final boolean DEBUG_FILEBUFFERMODELLEAKS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/leaks")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging formatting
- */
- public static final boolean DEBUG_FORMAT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/format")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging text buffer
- * lifecycle
- */
- public static final boolean DEBUG_TEXTBUFFERLIFECYCLE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/lifecycle")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging model
- * lifecycle
- */
- public static final boolean DEBUG_LIFECYCLE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/lifecycle")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging model state
- */
- public static final boolean DEBUG_MODELSTATE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/state")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging model lock
- * state
- */
- public static final boolean DEBUG_MODELLOCK = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/locks")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging model
- * manager
- */
- public static final boolean DEBUG_MODELMANAGER = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/modelmanager")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- */
- public static final boolean DEBUG_TASKS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * content type detection
- */
- public static final boolean DEBUG_TASKSCONTENTTYPE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/detection")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * jobs
- */
- public static final boolean DEBUG_TASKSJOB = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/job")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * overall performance
- */
- public static final boolean DEBUG_TASKSOVERALLPERF = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/overalltime")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * performance
- */
- public static final boolean DEBUG_TASKSPERF = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/time")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * preferences
- */
- public static final boolean DEBUG_TASKSPREFS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
- /**
- * true if platform and plugin are in debug mode and debugging task tags
- * registry
- */
- public static final boolean DEBUG_TASKSREGISTRY = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/registry")); //$NON-NLS-1$ //$NON-NLS-2$
-
- /*
- * Keep our own copy in case we want to add other severity levels
- */
- public static final int OK = IStatus.OK;
- public static final int INFO = IStatus.INFO;
- public static final int WARNING = IStatus.WARNING;
- public static final int ERROR = IStatus.ERROR;
- 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;
-
- /**
- * @return true if the platform is debugging
- */
- private static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- private 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 : ""; //$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);
- }
-
- /**
- * Write a message to the log with the given severity level
- *
- * @param level
- * ERROR, WARNING, INFO, OK
- * @param message
- * message to add to the log
- */
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- /**
- * Writes a message and exception to the log with the given severity level
- *
- * @param level
- * ERROR, WARNING, INFO, OK
- * @param message
- * message to add to the log
- * @param exception
- * exception to add to the log
- */
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- /**
- * Writes the exception as an error in the log along with an accompanying
- * message
- *
- * @param message
- * message to add to the log
- * @param exception
- * exception to add to the log
- */
- public static void logException(String message, Throwable exception) {
- _log(IStatus.ERROR, message, exception);
- }
-
- /**
- * Writes the exception as an error in the log
- *
- * @param exception
- * exception to add to the log
- */
- public static void logException(Throwable exception) {
- _log(IStatus.ERROR, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java
deleted file mode 100644
index 2b9025fdd2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java
+++ /dev/null
@@ -1,198 +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.sse.core.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.osgi.framework.Bundle;
-
-
-public class ModelManagerPluginRegistryReader {
- private static ModelManagerPluginRegistryReader reader = null;
-
- public synchronized static ModelManagerPluginRegistryReader getInstance() {
- if (reader == null) {
- reader = new ModelManagerPluginRegistryReader();
- }
- return reader;
- }
-
- protected final String ATTR_ADAPTERKEY = "adapterKeyClass"; //$NON-NLS-1$
- protected final String ATTR_CLASS = "class"; //$NON-NLS-1$
- protected final String ATTR_CONTENTTYPE = "type"; //$NON-NLS-1$
- protected final String ATTR_REGISTERADAPTER = "registerAdapters"; //$NON-NLS-1$
-
- protected final String EXTENSION_POINT_ID = "adaptOnCreateFactory"; //$NON-NLS-1$
- protected final String TAG_NAME = "AdaptOnCreateFactory"; //$NON-NLS-1$
-
- /**
- * XMLEditorPluginRegistryReader constructor comment.
- */
- protected ModelManagerPluginRegistryReader() {
- super();
- }
-
- public List getFactories(IDocumentTypeHandler handler) {
- return loadRegistry(handler.getId());
- }
-
- public List getFactories(String type) {
- return loadRegistry(type);
- }
-
- protected INodeAdapterFactory loadFactoryFromConfigurationElement(IConfigurationElement element, Object requesterType) {
- INodeAdapterFactory factory = null;
- if (element.getName().equals(TAG_NAME)) {
- String contentType = element.getAttribute(ATTR_CONTENTTYPE);
- if (!contentType.equals(requesterType))
- return null;
- String className = element.getAttribute(ATTR_CLASS);
- String adapterKeyClass = element.getAttribute(ATTR_ADAPTERKEY);
- String registerAdapters = element.getAttribute(ATTR_REGISTERADAPTER);
-
- // if className is null, then no one defined the extension point
- // for adapter factories
- if (className != null) {
- String name = element.getDeclaringExtension().getNamespace();
- Bundle bundle = null;
- try {
- bundle = Platform.getBundle(name);
- }
- catch (Exception e) {
- // if an error occurs here, its probably that the plugin
- // could not be found/loaded
- Logger.logException("Could not find bundle: " + name, e); //$NON-NLS-1$
-
- }
- if (bundle != null) {
- boolean useExtendedConstructor = false;
- boolean doRegisterAdapters = false;
- Object adapterKey = null;
-
- if (registerAdapters != null && registerAdapters.length() > 0 && Boolean.valueOf(registerAdapters).booleanValue()) {
- doRegisterAdapters = true;
- }
- if (adapterKeyClass != null) {
- try {
- Class aClass = null;
- // aClass = classLoader != null ?
- // classLoader.loadClass(adapterKeyClass) :
- // Class.forName(adapterKeyClass);
- if (bundle.getState() != Bundle.UNINSTALLED) {
- aClass = bundle.loadClass(adapterKeyClass);
- }
- else {
- aClass = Class.forName(adapterKeyClass);
- }
- if (aClass != null) {
- useExtendedConstructor = true;
- adapterKey = aClass;
- }
- else {
- adapterKey = adapterKeyClass;
- }
- }
- catch (Exception anyErrors) {
- adapterKey = adapterKeyClass;
- }
- }
-
- try {
- Class theClass = null;
- // Class theClass = classLoader != null ?
- // classLoader.loadClass(className) :
- // Class.forName(className);
- if (bundle.getState() != Bundle.UNINSTALLED) {
- theClass = bundle.loadClass(className);
- }
- else {
- theClass = Class.forName(className);
- }
- if (useExtendedConstructor) {
- java.lang.reflect.Constructor[] ctors = theClass.getConstructors();
- for (int i = 0; i < ctors.length; i++) {
- Class[] paramTypes = ctors[i].getParameterTypes();
- if (ctors[i].isAccessible() && paramTypes.length == 2 && paramTypes[0].equals(Object.class) && paramTypes[1].equals(boolean.class)) {
- try {
- factory = (INodeAdapterFactory) ctors[i].newInstance(new Object[]{adapterKey, new Boolean(doRegisterAdapters)});
- }
- catch (IllegalAccessException e) {
- // log for now, unless we find reason
- // not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (IllegalArgumentException e) {
- // log for now, unless we find reason
- // not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (InstantiationException e) {
- // log for now, unless we find reason
- // not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (InvocationTargetException e) {
- // log for now, unless we find reason
- // not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (ExceptionInInitializerError e) {
- // log or now, unless we find reason
- // not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
- if (factory == null) {
- factory = (INodeAdapterFactory) element.createExecutableExtension(ATTR_CLASS);
- }
- }
- catch (ClassNotFoundException e) {
- // log or now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (CoreException e) {
- // log or now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
- return factory;
- }
-
- protected List loadRegistry(Object contentType) {
- List factoryList = new Vector();
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(SSECorePlugin.ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- INodeAdapterFactory factory = loadFactoryFromConfigurationElement(elements[i], contentType);
- if (factory != null)
- factoryList.add(factory);
- }
- }
- return factoryList;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java
deleted file mode 100644
index c9f129f5e6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.core.internal;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-
-public class NoCancelProgressMonitor extends NullProgressMonitor {
-
-
- public NoCancelProgressMonitor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
- */
- public boolean isCanceled() {
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java
deleted file mode 100644
index 3a0b985c13..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal;
-
-
-public class NotImplementedException extends RuntimeException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public NotImplementedException() {
- super();
- }
-
- public NotImplementedException(String message) {
- super(message);
- }
-
- public NotImplementedException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public NotImplementedException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java
deleted file mode 100644
index 9da4305f3d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java
+++ /dev/null
@@ -1,37 +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.sse.core.internal;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java
deleted file mode 100644
index 401c484773..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java
+++ /dev/null
@@ -1,38 +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.sse.core.internal;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-public interface PropagatingAdapter extends INodeAdapter {
-
- void addAdaptOnCreateFactory(INodeAdapterFactory factory);
-
- List getAdaptOnCreateFactories();
-
- /**
- * This method should be called immediately after adding a factory,
- * typically on the document (top level) node, so all nodes can be
- * adapted, if needed. This is needed for those occasions when a factory
- * is addeded after some nodes may have already been created at the time
- * the factory is added.
- */
- void initializeForFactory(INodeAdapterFactory factory, INodeNotifier node);
-
- // dmw: should have getFactoryFor?
- void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java
deleted file mode 100644
index 70c84dafb9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java
+++ /dev/null
@@ -1,29 +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.sse.core.internal;
-
-
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-
-public interface PropagatingAdapterFactory extends INodeAdapterFactory {
-
- void addContributedFactories(INodeAdapterFactory factory);
-
- void setContributedFactories(ArrayList list);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java
deleted file mode 100644
index 4546839af9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 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 - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.sse.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by SSE Core
- *
- * @plannedfor 1.0
- */
-public class SSECoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.sse.core.internal.SSECorePluginResources";//$NON-NLS-1$
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SSECoreMessages.class);
- }
-
- private SSECoreMessages() {
- // cannot create new instance
- }
-
- public static String A_model_s_id_can_not_be_nu_EXC_;
- public static String Program_Error__ModelManage_EXC_;
- public static String Original_Error__UI_;
- public static String Text_Change_UI_;
- public static String TaskScanner_0;
- public static String TaskScanningJob_0;
- public static String TaskScanningJob_1;
- public static String Migrate_Charset;
-
- public static String IndexManager_0_starting;
- public static String IndexManager_0_starting_1;
- public static String IndexManager_0_Indexing_1_Files;
- public static String IndexManager_processing_deferred_resource_changes;
- public static String IndexManager_Processing_entire_workspace_for_the_first_time;
- public static String IndexManager_0_Processing_entire_workspace_for_the_first_time;
- public static String IndexManager_processing_recent_resource_changes;
- public static String IndexManager_0_resources_to_go_1;
- public static String IndexManager_Waiting_for_0;
- public static String IndexManager_0_Processing_resource_events;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
deleted file mode 100644
index 15e32bb35a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
+++ /dev/null
@@ -1,107 +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.sse.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * SSE Core Plugin.
- */
-public class SSECorePlugin extends Plugin {
- static SSECorePlugin instance = null;
-
- public static final String ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
- public static SSECorePlugin getDefault() {
- return instance;
- }
-
- public SSECorePlugin() {
- super();
- instance = this;
- }
-
- /**
- * Set default non-UI
- */
- protected void initializeDefaultPluginPreferences() {
- Preferences prefs = getDefault().getPluginPreferences();
- // set model preference defaults
-
- prefs.setDefault(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, false);
-
- prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_ENABLE, false);
- prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_TAGS, "TODO,FIXME,XXX"); //$NON-NLS-1$
- prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_PRIORITIES, "1,2,1"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- savePluginPreferences();
-
- TaskScanningScheduler.shutdown();
-
- FileBufferModelManager.shutdown();
-
- super.stop(context);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- // initialize FileBuffer handling
- FileBufferModelManager.startup();
-
- /**
- * If the user starts the workbench with
- * -Dorg.eclipse.wst.sse.core.taskscanner=off, the scanner should be
- * disabled
- */
- String scan = System.getProperty("org.eclipse.wst.sse.core.taskscanner"); //$NON-NLS-1$
- if (scan == null || !scan.equalsIgnoreCase("off")) { //$NON-NLS-1$
- TaskScanningScheduler.startup();
- }
- }
-
- /**
- * @deprecated
- */
- public ModelHandlerRegistry getModelHandlerRegistry() {
- return ModelHandlerRegistry.getInstance();
- }
-
- /**
- * @deprecated - use StructuredModelManager.getModelManager();
- */
- public IModelManager getModelManager() {
- return StructuredModelManager.getModelManager();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties
deleted file mode 100644
index 971c0f7509..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-A_model_s_id_can_not_be_nu_EXC_=A model's id can not be null
-Program_Error__ModelManage_EXC_=Program Error: ModelManagerImpl::saveModel. Model should be in the cache
-Original_Error__UI_=Original Error:
-Text_Change_UI_=Text Change
-TaskScanner_0=Scanning for Tasks
-TaskScanningJob_0=Scanning
-TaskScanningJob_1=Errors while detecting Tasks
-###############################################################################
-Migrate_Charset=Migrate Charset
-
-IndexManager_0_starting={0}: Starting
-IndexManager_0_starting_1={0}: Starting: {1}
-IndexManager_0_Indexing_1_Files={0}: Indexing {1} Files
-IndexManager_processing_deferred_resource_changes=Processing deferred resource changes
-IndexManager_Processing_entire_workspace_for_the_first_time=Processing entire workspace for the first time
-IndexManager_0_Processing_entire_workspace_for_the_first_time={0}: Processing entire workspace for the first time
-IndexManager_processing_recent_resource_changes=Processing recent resource changes
-IndexManager_0_resources_to_go_1={0} resources to index: {1}
-IndexManager_Waiting_for_0=Waiting for {0}
-IndexManager_0_Processing_resource_events={0}: Processing Resource Events \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
deleted file mode 100644
index f525d5f211..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.cleanup;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractStructuredCleanupProcessor implements IStructuredCleanupProcessor {
- public boolean refreshCleanupPreferences = true; // special flag for JUnit
-
- // tests to skip refresh
- // of cleanup preferences
- // when it's set to false
-
- public String cleanupContent(String input) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- try {
- // setup structuredModel
- inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
- String id = inputStream.toString() + getContentType();
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
- // cleanup
- cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
- // return output
- return structuredModel.getStructuredDocument().get();
- } finally {
- ensureClosed(null, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public String cleanupContent(String input, int start, int length) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- try {
- // setup structuredModel
- inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
- String id = inputStream.toString() + getContentType();
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
- // cleanup
- cleanupModel(structuredModel, start, length);
-
- // return output
- return structuredModel.getStructuredDocument().get();
- } finally {
- ensureClosed(null, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public void cleanupDocument(IDocument document) throws IOException, CoreException {
- if (document == null)
- return;
-
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-
- // cleanup
- cleanupModel(structuredModel);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- } finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
-
- public void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException {
- if (document == null)
- return;
-
- if (start >= 0 && length >= 0 && start + length <= document.getLength()) {
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if
- // model changed.
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-
- // cleanup
- cleanupModel(structuredModel, start, length);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- } finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
- }
-
- public void cleanupFile(IFile file) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(file);
-
- // cleanup
- cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
- // save output to file
- // outputStream = new
- // FileOutputStream(file.getLocation().toString());
- structuredModel.save(file);
- } finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public void cleanupFile(IFile file, int start, int length) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(file);
-
- // cleanup
- cleanupModel(structuredModel, start, length);
-
- // save output to file
- // outputStream = new
- // FileOutputStream(file.getLocation().toString());
- structuredModel.save(file);
- } finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public void cleanupFileName(String fileName) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- inputStream = new FileInputStream(fileName);
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(fileName, inputStream, null);
-
- // cleanup
- cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
- // save output to file
- // outputStream = new FileOutputStream(fileName);
- structuredModel.save();
- } finally {
- // ensureClosed(outputStream, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public void cleanupFileName(String fileName, int start, int length) throws IOException, CoreException {
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- inputStream = new FileInputStream(fileName);
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(fileName, inputStream, null);
-
- // cleanup
- cleanupModel(structuredModel, start, length);
-
- // save output to file
- // outputStream = new FileOutputStream(fileName);
- structuredModel.save();
- } finally {
- // ensureClosed(outputStream, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public void cleanupModel(IStructuredModel structuredModel) {
-
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
- cleanupModel(structuredModel, start, length);
- }
-
- public void cleanupModel(IStructuredModel structuredModel, int start, int length) {
-
- if (structuredModel != null) {
- if ((start >= 0) && (length <= structuredModel.getStructuredDocument().getLength())) {
- Vector activeNodes = getActiveNodes(structuredModel, start, length);
- if (activeNodes.size() > 0) {
- Node firstNode = (Node) activeNodes.firstElement();
- Node lastNode = (Node) activeNodes.lastElement();
- boolean done = false;
- Node eachNode = firstNode;
- Node nextNode = null;
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=123621
- // if doing any sort of cleanup, set up rewrite session/modelchanged
- IDocumentExtension4 docExt4 = null;
- if (structuredModel.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4) structuredModel.getStructuredDocument();
- }
- DocumentRewriteSession rewriteSession = null;
-
- try {
- // whenever formatting model, fire
- // abouttochange/modelchanged
- structuredModel.aboutToChangeModel();
- rewriteSession = (docExt4 == null || docExt4.getActiveRewriteSession() != null) ? null : docExt4.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
-
- while (!done) {
- // update "done"
- done = (eachNode == lastNode);
-
- // get next sibling before cleanup because eachNode
- // may
- // be deleted,
- // for example when it's an empty text node
- nextNode = eachNode.getNextSibling();
-
- // cleanup selected node(s)
- cleanupNode(eachNode);
-
- // update each node
- if (nextNode != null && nextNode.getParentNode() == null)
- // nextNode is deleted during cleanup
- eachNode = eachNode.getNextSibling();
- else
- eachNode = nextNode;
-
- // This should not be needed, but just in case
- // something went wrong with with eachNode.
- // We don't want an infinite loop here.
- if (eachNode == null)
- done = true;
- }
-
- // format source
- if (getFormatSourcePreference(structuredModel)) {
- // format the document
- IStructuredFormatProcessor formatProcessor = getFormatProcessor();
- formatProcessor.formatModel(structuredModel);
- }
- }
- finally {
- // we need two finally's, just in case first fails
- try {
- if ((docExt4 != null) && (rewriteSession != null))
- docExt4.stopRewriteSession(rewriteSession);
- }
- finally {
- // always make sure to fire changedmodel when done
- structuredModel.changedModel();
- }
- }
- }
- }
- }
- }
-
- public void cleanupNode(Node node) {
- if (node != null) {
- Node cleanupNode = node;
-
- // cleanup the owner node if it's an attribute node
- if (cleanupNode.getNodeType() == Node.ATTRIBUTE_NODE)
- cleanupNode = ((Attr) cleanupNode).getOwnerElement();
-
- // refresh cleanup preferences before getting cleanup handler
- if (refreshCleanupPreferences)
- refreshCleanupPreferences();
-
- // get cleanup handler
- IStructuredCleanupHandler cleanupHandler = getCleanupHandler(cleanupNode);
- if (cleanupHandler != null) {
- // cleanup each node
- cleanupHandler.cleanup(cleanupNode);
- }
- }
- }
-
- protected void convertLineDelimiters(IDocument document, String newDelimiter) {
- final int lineCount = document.getNumberOfLines();
- Map partitioners = TextUtilities.removeDocumentPartitioners(document);
- try {
- for (int i = 0; i < lineCount; i++) {
- final String delimiter = document.getLineDelimiter(i);
- if (delimiter != null && delimiter.length() > 0 && !delimiter.equals(newDelimiter)) {
- IRegion region = document.getLineInformation(i);
- document.replace(region.getOffset() + region.getLength(), delimiter.length(), newDelimiter);
- }
- }
- } catch (BadLocationException e) {
- Logger.logException(e);
- } finally {
- TextUtilities.addDocumentPartitioners(document, partitioners);
- }
- }
-
- protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- } catch (IOException e) {
- Logger.logException(e); // hopeless
- }
- try {
- if (outputStream != null) {
- outputStream.close();
- }
- } catch (IOException e) {
- Logger.logException(e); // hopeless
- }
- }
-
- protected Vector getActiveNodes(IStructuredModel structuredModel, int startNodeOffset, int length) {
- Vector activeNodes = new Vector();
-
- if (structuredModel != null) {
- Node startNode = (Node) structuredModel.getIndexedRegion(startNodeOffset);
- Node endNode = (Node) structuredModel.getIndexedRegion(startNodeOffset + length);
-
- // make sure it's an non-empty document
- if (startNode != null) {
- while (isSiblingOf(startNode, endNode) == false) {
- if (endNode != null)
- endNode = endNode.getParentNode();
- if (endNode == null) {
- startNode = startNode.getParentNode();
- endNode = (Node) structuredModel.getIndexedRegion(startNodeOffset + length);
- }
- }
-
- while (startNode != endNode) {
- activeNodes.addElement(startNode);
- startNode = startNode.getNextSibling();
- }
- if (startNode != null)
- activeNodes.addElement(startNode);
- }
- }
-
- return activeNodes;
- }
-
- abstract protected IStructuredCleanupHandler getCleanupHandler(Node node);
-
- abstract protected String getContentType();
-
- protected boolean getConvertEOLCodesPreference(IStructuredModel structuredModel) {
-
- boolean convertEOLCodes = true;
- IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
- if (cleanupHandler != null) {
- IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
- convertEOLCodes = cleanupPreferences.getConvertEOLCodes();
- }
- return convertEOLCodes;
- }
-
- protected String getEOLCodePreference(IStructuredModel structuredModel) {
-
- IScopeContext[] scopeContext = new IScopeContext[]{new InstanceScope()};
- String eolCode = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
-
- IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
- if (cleanupHandler != null) {
- IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
- eolCode = cleanupPreferences.getEOLCode();
- }
- return eolCode;
- }
-
- abstract protected IStructuredFormatProcessor getFormatProcessor();
-
- protected boolean getFormatSourcePreference(IStructuredModel structuredModel) {
-
- boolean formatSource = true;
- IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
- if (cleanupHandler != null) {
- IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
- formatSource = cleanupPreferences.getFormatSource();
- }
- return formatSource;
- }
-
- protected boolean isSiblingOf(Node node, Node endNode) {
- if (endNode == null) {
- return true;
- } else {
- Node siblingNode = node;
- while (siblingNode != null) {
- if (siblingNode == endNode)
- return true;
- else
- siblingNode = siblingNode.getNextSibling();
- }
- return false;
- }
- }
-
- abstract protected void refreshCleanupPreferences();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java
deleted file mode 100644
index 4f98956ed3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java
+++ /dev/null
@@ -1,23 +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.sse.core.internal.cleanup;
-
-import org.w3c.dom.Node;
-
-public interface IStructuredCleanupHandler {
- Node cleanup(Node node);
-
- IStructuredCleanupPreferences getCleanupPreferences();
-
- void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java
deleted file mode 100644
index 7f5058da91..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java
+++ /dev/null
@@ -1,56 +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.sse.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-
-public interface IStructuredCleanupPreferences {
-
- int getAttrNameCase();
-
- boolean getCompressEmptyElementTags();
-
- boolean getConvertEOLCodes();
-
- String getEOLCode();
-
- boolean getFormatSource();
-
- boolean getInsertMissingTags();
-
- boolean getInsertRequiredAttrs();
-
- boolean getQuoteAttrValues();
-
- int getTagNameCase();
-
- void setAttrNameCase(int attrNameCase);
-
- void setCompressEmptyElementTags(boolean compressEmptyElementTags);
-
- void setConvertEOLCodes(boolean convertEOLCodes);
-
- void setEOLCode(String EOLCode);
-
- void setFormatSource(boolean formatSource);
-
- void setInsertMissingTags(boolean insertMissingTags);
-
- void setInsertRequiredAttrs(boolean insertRequiredAttrs);
-
- void setPreferences(Preferences preferences);
-
- void setQuoteAttrValues(boolean quoteAttrValues);
-
- void setTagNameCase(int tagNameCase);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java
deleted file mode 100644
index 27bce4cb0d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java
+++ /dev/null
@@ -1,114 +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.sse.core.internal.cleanup;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-/**
- * This interface and related classes are 'internal' and should not
- * be treated as API, even though used across components in WTP.
- * Consider it a work in progress.
- */
-
-public interface IStructuredCleanupProcessor {
- /**
- * This form of the CleanupProcessor takes an input string as input,
- * creates an InputStream from the input string, create a temporary model
- * of the content type specified, cleanups the whole model, then returns
- * the cleaned up input string.
- */
- String cleanupContent(String content) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes an input string as input,
- * creates an InputStream from the input string, create a temporary model
- * of the content type specified, cleanups the model within start and
- * length, then returns the cleaned up input string.
- */
- String cleanupContent(String content, int start, int length) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes an IDocument as input, creates
- * a temporary model of content type calculated using the IDocument's file
- * extension, cleanups the whole model, then releases the model.
- */
- void cleanupDocument(IDocument document) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes an IDocument as input, creates
- * a temporary model of content type calculated using the IDocument's file
- * extension, cleanups the model within start and length, then releases
- * the model.
- */
- void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes an IFile as input, creates a
- * temporary model of content type calculated using the IFile's file
- * extension, cleanups the whole model, then releases the model. The IFile
- * is updated when the last reference of the model is released in the
- * model manager.
- */
- void cleanupFile(IFile file) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes an IFile as input, creates a
- * temporary model of content type calculated using the IFile's file
- * extension, cleanups the model within start and length, then releases
- * the model. The IFile is updated when the last reference of the model is
- * released in the model manager.
- */
- void cleanupFile(IFile file, int start, int length) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes a file name as input,creates an
- * InputStream from the file, create a temporary model of content type
- * calculated using the file name's file extension, cleanups the whole
- * model, then releases the model. The file is updated when the last
- * reference of the model is released in the model manager.
- */
- void cleanupFileName(String fileName) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes a file name as input,creates an
- * InputStream from the file, create a temporary model of content type
- * calculated using the file name's file extension, cleanups the model
- * within start and length, then releases the model. The file is updated
- * when the last reference of the model is released in the model manager.
- */
- void cleanupFileName(String fileName, int start, int length) throws IOException, CoreException;
-
- /**
- * This form of the CleanupProcessor takes a model as input, and cleanups
- * the whole model.
- */
- void cleanupModel(IStructuredModel structuredModel);
-
- /**
- * This form of the CleanupProcessor takes a model as input, and cleanups
- * the model within start and length.
- */
- void cleanupModel(IStructuredModel structuredModel, int start, int length);
-
- /**
- * This form of the CleanupProcessor takes a node as input, and formats
- * the node and all its children.
- */
- void cleanupNode(Node node);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java
deleted file mode 100644
index a83441804c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java
+++ /dev/null
@@ -1,135 +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.sse.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-
-public class StructuredCleanupPreferences implements IStructuredCleanupPreferences {
- private int fAttrNameCase;
- private boolean fCompressEmptyElementTags;
- private boolean fConvertEOLCodes;
- private String fEOLCode;
- private boolean fFormatSource;
- private boolean fInsertMissingTags;
- private boolean fInsertRequiredAttrs;
- //private IPreferenceStore fPreferenceStore = null;
- private Preferences fPreferences = null;
- private boolean fQuoteAttrValues;
-
- private int fTagNameCase;
-
- public int getAttrNameCase() {
-
- return fAttrNameCase;
- }
-
- public boolean getCompressEmptyElementTags() {
-
- return fCompressEmptyElementTags;
- }
-
- public boolean getConvertEOLCodes() {
-
- return fConvertEOLCodes;
- }
-
- public String getEOLCode() {
-
- return fEOLCode;
- }
-
- public boolean getFormatSource() {
-
- return fFormatSource;
- }
-
- public boolean getInsertMissingTags() {
-
- return fInsertMissingTags;
- }
-
- public boolean getInsertRequiredAttrs() {
-
- return fInsertRequiredAttrs;
- }
-
- public Preferences getPreferences() {
-
- if (fPreferences == null) {
- fPreferences = SSECorePlugin.getDefault().getPluginPreferences();
- }
- return fPreferences;
- }
-
- public boolean getQuoteAttrValues() {
-
- return fQuoteAttrValues;
- }
-
- public int getTagNameCase() {
-
- return fTagNameCase;
- }
-
- public void setAttrNameCase(int attrNameCase) {
-
- fAttrNameCase = attrNameCase;
- }
-
- public void setCompressEmptyElementTags(boolean compressEmptyElementTags) {
-
- fCompressEmptyElementTags = compressEmptyElementTags;
- }
-
- public void setConvertEOLCodes(boolean convertEOLCodes) {
-
- fConvertEOLCodes = convertEOLCodes;
- }
-
- public void setEOLCode(String EOLCode) {
-
- fEOLCode = EOLCode;
- }
-
- public void setFormatSource(boolean formatSource) {
-
- fFormatSource = formatSource;
- }
-
- public void setInsertMissingTags(boolean insertMissingTags) {
-
- fInsertMissingTags = insertMissingTags;
- }
-
- public void setInsertRequiredAttrs(boolean insertRequiredAttrs) {
-
- fInsertRequiredAttrs = insertRequiredAttrs;
- }
-
- public void setPreferences(Preferences prefs) {
-
- fPreferences = prefs;
- }
-
- public void setQuoteAttrValues(boolean quoteAttrValues) {
-
- fQuoteAttrValues = quoteAttrValues;
- }
-
- public void setTagNameCase(int tagNameCase) {
-
- fTagNameCase = tagNameCase;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java
deleted file mode 100644
index 6c06ca0169..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.cleanup;
-
-public interface StructuredContentCleanupHandler {
-
- IStructuredCleanupProcessor getCleanupProcessor(String contentType);
-
- void setCleanupProcessor(IStructuredCleanupProcessor cleanupProcessor, String contentType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
deleted file mode 100644
index 27a6246787..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.cleanup;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.text.Assert;
-
-public class StructuredContentCleanupHandlerImpl implements StructuredContentCleanupHandler {
- protected Map fCleanupProcessors;
-
- public IStructuredCleanupProcessor getCleanupProcessor(String contentType) {
- Assert.isNotNull(contentType);
-
- if (fCleanupProcessors == null)
- return null;
-
- return (IStructuredCleanupProcessor) fCleanupProcessors.get(contentType);
- }
-
- public void setCleanupProcessor(IStructuredCleanupProcessor cleanupProcessor, String contentType) {
- Assert.isNotNull(contentType);
-
- if (fCleanupProcessors == null)
- fCleanupProcessors = new HashMap();
-
- if (fCleanupProcessors == null)
- fCleanupProcessors.remove(contentType);
- else
- fCleanupProcessors.put(contentType, cleanupProcessor);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java
deleted file mode 100644
index ea9959e8c0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java
+++ /dev/null
@@ -1,438 +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.sse.core.internal.document;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.MalformedInputException;
-import java.nio.charset.UnmappableCharacterException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.CodedReaderCreator;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-
-
-
-/**
- * This class reads a file and creates an Structured Model.
- */
-public abstract class AbstractDocumentLoader implements IDocumentLoader {
-
- private CodedReaderCreator fCodedReaderCreator;
- protected IDocumentCharsetDetector fDocumentEncodingDetector;
- // private boolean fPropertiesObtained;
-
- protected EncodingMemento fEncodingMemento;
- protected Reader fFullPreparedReader;
-
- /**
- * AbstractLoader constructor also initializes encoding converter/mapper
- */
- public AbstractDocumentLoader() {
- super();
- }
-
- protected final StringBuffer convertLineDelimiters(StringBuffer allTextBuffer, String lineDelimiterToUse) {
- // TODO: avoid use of String instance
- String allText = allTextBuffer.toString();
- IDocument tempDoc = new Document(allText);
- if (lineDelimiterToUse == null)
- lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
- StringBuffer newText = new StringBuffer();
- int lineCount = tempDoc.getNumberOfLines();
- for (int i = 0; i < lineCount; i++) {
- try {
- org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
- int lineStartOffset = lineInfo.getOffset();
- int lineLength = lineInfo.getLength();
- int lineEndOffset = lineStartOffset + lineLength;
- newText.append(allText.substring(lineStartOffset, lineEndOffset));
- if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
- newText.append(lineDelimiterToUse);
- }
- catch (org.eclipse.jface.text.BadLocationException exception) {
- // should fix up to either throw nothing, or the right thing,
- // but
- // in the course of refactoring, this was easiest "quick fix".
- throw new RuntimeException(exception);
- }
- }
- return newText;
- }
-
- /**
- * This method must return a new instance of IEncodedDocument, that has
- * been initialized with appropriate parser. For many loaders, the
- * (default) parser used is known for any input. For others, the correct
- * parser (and its initialization) is normally dependent on the content of
- * the file. This no-argument method should assume "empty input" and would
- * therefore return the default parser for the default contentType.
- */
- public IEncodedDocument createNewStructuredDocument() {
- IEncodedDocument structuredDocument = newEncodedDocument();
- // Make sure every structuredDocument has an Encoding Memento,
- // which is the default one for "empty" structuredDocuments
- String charset = ContentTypeEncodingPreferences.useDefaultNameRules(getDocumentEncodingDetector());
- String specDefaultCharset = getDocumentEncodingDetector().getSpecDefaultEncoding();
- structuredDocument.setEncodingMemento(CodedIO.createEncodingMemento(charset, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT, specDefaultCharset));
-
- String lineDelimiter = getPreferredNewLineDelimiter(null);
- if (lineDelimiter != null)
- structuredDocument.setPreferredLineDelimiter(lineDelimiter);
-
- IDocumentPartitioner defaultPartitioner = getDefaultDocumentPartitioner();
- if (structuredDocument instanceof IDocumentExtension3) {
- ((IDocumentExtension3) structuredDocument).setDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, defaultPartitioner);
- }
- else {
- structuredDocument.setDocumentPartitioner(defaultPartitioner);
- }
- defaultPartitioner.connect(structuredDocument);
-
- return structuredDocument;
- }
-
- /**
- * This abstract version should handle most cases, but won't if
- * contentType is sensitive to encoding, and/or embedded types
- */
- public IEncodedDocument createNewStructuredDocument(IFile iFile) throws IOException, CoreException {
- IEncodedDocument structuredDocument = createNewStructuredDocument();
-
- String lineDelimiter = getPreferredNewLineDelimiter(iFile);
- if (lineDelimiter != null)
- structuredDocument.setPreferredLineDelimiter(lineDelimiter);
-
- try {
-
- CodedReaderCreator creator = getCodedReaderCreator();
- creator.set(iFile);
- fEncodingMemento = creator.getEncodingMemento();
- structuredDocument.setEncodingMemento(fEncodingMemento);
- fFullPreparedReader = getCodedReaderCreator().getCodedReader();
-
- setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
- }
- finally {
- if (fFullPreparedReader != null) {
- fFullPreparedReader.close();
- }
- }
- return structuredDocument;
- }
-
- public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream) throws UnsupportedEncodingException, IOException {
- return createNewStructuredDocument(filename, inputStream, EncodingRule.CONTENT_BASED);
- }
-
- public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException {
- if (filename == null && inputStream == null) {
- throw new IllegalArgumentException("can not have both null filename and inputstream"); //$NON-NLS-1$
- }
- IEncodedDocument structuredDocument = createNewStructuredDocument();
- CodedReaderCreator codedReaderCreator = getCodedReaderCreator();
- try {
- codedReaderCreator.set(filename, inputStream);
- codedReaderCreator.setEncodingRule(encodingRule);
- fEncodingMemento = codedReaderCreator.getEncodingMemento();
- fFullPreparedReader = codedReaderCreator.getCodedReader();
- structuredDocument.setEncodingMemento(fEncodingMemento);
- setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
- }
- catch (CoreException e) {
- // impossible in this context
- throw new Error(e);
- }
- finally {
- if (fFullPreparedReader != null) {
- fFullPreparedReader.close();
- }
- }
-
- return structuredDocument;
- }
-
- private int getCharPostionOfFailure(BufferedReader inputStream) {
- int charPosition = 1;
- int charRead = -1;
- boolean errorFound = false;
- do {
- try {
- charRead = inputStream.read();
- charPosition++;
- }
- catch (IOException e) {
- // this is expected, since we're expecting failure,
- // so no need to do anything.
- errorFound = true;
- break;
- }
- }
- while (!(charRead == -1 || errorFound));
-
- if (errorFound)
- // dmw, blindly modified to +1 to get unit tests to work, moving
- // from Java 1.3, to 1.4
- // not sure how/why this behavior would have changed. (Its as if
- // 'read' is reporting error
- // one character early).
- return charPosition + 1;
- else
- return -1;
- }
-
- /**
- * @return Returns the codedReaderCreator.
- */
- protected CodedReaderCreator getCodedReaderCreator() {
- if (fCodedReaderCreator == null) {
- fCodedReaderCreator = new CodedReaderCreator();
- }
- return fCodedReaderCreator;
- }
-
- /**
- * Creates the partitioner to be used with the
- * IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING partitioning
- *
- * @return IDocumentPartitioner
- */
- public abstract IDocumentPartitioner getDefaultDocumentPartitioner();
-
- /**
- * Returns the encodingMemento.
- *
- * @return EncodingMemento
- */
- public EncodingMemento getEncodingMemento() {
- if (fEncodingMemento == null) {
- throw new IllegalStateException("Program Error: encodingMemento was accessed before it was set"); //$NON-NLS-1$
- }
- return fEncodingMemento;
- }
-
- /**
- * @return Returns the fullPreparedReader.
- */
- protected Reader getFullPreparedReader() throws UnsupportedEncodingException, CoreException, IOException {
- if (fFullPreparedReader == null) {
- fFullPreparedReader = getCodedReaderCreator().getCodedReader();
- }
- return fFullPreparedReader;
- }
-
- /**
- * Returns the default line delimiter preference for the given file.
- *
- * @param file
- * the file
- * @return the default line delimiter
- * @since 3.1
- */
- private String getPlatformLineDelimiterPreference(IFile file) {
- IScopeContext[] scopeContext;
- if (file != null && file.getProject() != null) {
- // project preference
- scopeContext = new IScopeContext[]{new ProjectScope(file.getProject())};
- String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
- if (lineDelimiter != null)
- return lineDelimiter;
- }
- // workspace preference
- scopeContext = new IScopeContext[]{new InstanceScope()};
- return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
- }
-
- /**
- * @deprecated use getPreferredNewLineDelimiter(IFile) instead
- */
- protected String getPreferredNewLineDelimiter() {
- return getPreferredNewLineDelimiter(null);
- }
-
- /**
- * If subclass doesn't implement, return platform default
- */
- protected String getPreferredNewLineDelimiter(IFile file) {
- return getPlatformLineDelimiterPreference(file);
- }
-
- /**
- * A utility method, but depends on subclasses to impliment the preferred
- * end of line for a particular content type. Note: subclasses should not
- * re-implement this method (there's no reason to, even though its part of
- * interface). This method not only converts end-of-line characters, if
- * needed, but sets the correct end-of-line delimiter in
- * structuredDocument. Minor note: can't use this exact method in dumpers,
- * since the decision to change or not is a little different, and since
- * there we have to change text of structuredDocument if found to need
- * conversion. (Where as for loading, we assume we haven't yet set text in
- * structuredDocument, but will be done by other method just a tiny biy
- * later). Needs to be public to handle interface. It is in the interface
- * just so ModelManagerImpl can use it in a special circumstance.
- */
- public StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theFlatModel) {
- // TODO: need to handle line delimiters so Marker Positions are
- // updated
- StringBuffer convertedText = null;
- // based on text, make a guess on what's being used as
- // line delimiter
- String probableLineDelimiter = TextUtilities.determineLineDelimiter(originalString, theFlatModel.getLegalLineDelimiters(), System.getProperty("line.separator")); //$NON-NLS-1$
- String preferredLineDelimiter = getPreferredNewLineDelimiter(null);
- if (preferredLineDelimiter == null) {
- // when preferredLineDelimiter is null, it means "leave alone"
- // so no conversion needed.
- // set here, only if null (should already be set, but if not,
- // we'll set so any subsequent editing inserts what we're
- // assuming)
- if (!theFlatModel.getPreferredLineDelimiter().equals(probableLineDelimiter)) {
- theFlatModel.setPreferredLineDelimiter(probableLineDelimiter);
- }
- convertedText = originalString;
- }
- else {
- if (!preferredLineDelimiter.equals(probableLineDelimiter)) {
- // technically, wouldn't have to convert line delimiters
- // here at beginning, but when we save, if the preferred
- // line delimter is "leave alone" then we do leave alone,
- // so best to be right from beginning.
- convertedText = convertLineDelimiters(originalString, preferredLineDelimiter);
- theFlatModel.setPreferredLineDelimiter(preferredLineDelimiter);
- }
- else {
- // they are already the same, no conversion needed
- theFlatModel.setPreferredLineDelimiter(preferredLineDelimiter);
- convertedText = originalString;
- }
- }
- return convertedText;
- }
-
- protected abstract IEncodedDocument newEncodedDocument();
-
- /**
- * Very mechanical method, just to read the characters, once the reader is
- * correctly created. Can throw MalFormedInputException.
- */
- private StringBuffer readInputStream(Reader reader) throws IOException {
-
- int fBlocksRead = 0;
- StringBuffer buffer = new StringBuffer();
- int numRead = 0;
- try {
- char tBuff[] = new char[CodedIO.MAX_BUF_SIZE];
- while (numRead != -1) {
- numRead = reader.read(tBuff, 0, tBuff.length);
- if (numRead > 0) {
- buffer.append(tBuff, 0, numRead);
- fBlocksRead++;
- }
- }
- }
- catch (MalformedInputException e) {
- throw new MalformedInputExceptionWithDetail(fEncodingMemento.getJavaCharsetName(), fBlocksRead * CodedIO.MAX_BUF_SIZE + numRead + e.getInputLength());
- }
- catch (UnmappableCharacterException e) {
- throw new MalformedInputExceptionWithDetail(fEncodingMemento.getJavaCharsetName(), fBlocksRead * CodedIO.MAX_BUF_SIZE + numRead + e.getInputLength());
-
- }
- return buffer;
- }
-
- public void reload(IEncodedDocument encodedDocument, Reader inputStreamReader) throws IOException {
- if (inputStreamReader == null) {
- throw new IllegalArgumentException("stream reader can not be null"); //$NON-NLS-1$
- }
- int READ_BUFFER_SIZE = 8192;
- int MAX_BUFFERED_SIZE_FOR_RESET_MARK = 200000;
- // temp .... eventually we'lll only read as needed
- BufferedReader bufferedReader = new BufferedReader(inputStreamReader, MAX_BUFFERED_SIZE_FOR_RESET_MARK);
- bufferedReader.mark(MAX_BUFFERED_SIZE_FOR_RESET_MARK);
- StringBuffer buffer = new StringBuffer();
- try {
- int numRead = 0;
- char tBuff[] = new char[READ_BUFFER_SIZE];
- while ((numRead = bufferedReader.read(tBuff, 0, tBuff.length)) != -1) {
- buffer.append(tBuff, 0, numRead);
- }
- // remember -- we didn't open stream ... so we don't close it
- }
- catch (MalformedInputException e) {
- // int pos = e.getInputLength();
- EncodingMemento localEncodingMemento = getEncodingMemento();
- boolean couldReset = true;
- String encodingNameInError = localEncodingMemento.getJavaCharsetName();
- if (encodingNameInError == null) {
- encodingNameInError = localEncodingMemento.getDetectedCharsetName();
- }
- try {
- bufferedReader.reset();
- }
- catch (IOException resetException) {
- // the only errro that can occur during reset is an
- // IOException
- // due to already being past the rest mark. In that case, we
- // throw more generic message
- couldReset = false;
- }
- // -1 can be used by UI layer as a code that "position could not
- // be
- // determined"
- int charPostion = -1;
- if (couldReset) {
-
- charPostion = getCharPostionOfFailure(bufferedReader);
- // getCharPostionOfFailure(new InputStreamReader(inStream,
- // javaEncodingNameInError));
- }
- // all of that just to throw more accurate error
- // note: we do the conversion to ianaName, instead of using the
- // local
- // variable,
- // because this is ultimately only for the user error message
- // (that
- // is,
- // the error occurred
- // in context of javaEncodingName no matter what ianaEncodingName
- // is
- throw new MalformedInputExceptionWithDetail(encodingNameInError, CodedIO.getAppropriateJavaCharset(encodingNameInError), charPostion, !couldReset, MAX_BUFFERED_SIZE_FOR_RESET_MARK);
- }
- StringBuffer stringbuffer = buffer;
- encodedDocument.set(stringbuffer.toString());
-
- }
-
- protected void setDocumentContentsFromReader(IEncodedDocument structuredDocument, Reader reader) throws IOException {
-
- StringBuffer allText = readInputStream(reader);
- structuredDocument.set(allText.toString());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java
deleted file mode 100644
index ae28004885..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java
+++ /dev/null
@@ -1,131 +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.sse.core.internal.document;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.jface.text.IDocument;
-
-/**
- * A java.io.Reader that can operate off of an IDocument.
- */
-public class DocumentReader extends Reader {
- private IDocument fDocument = null;
- private int mark = 0;
- private int position = 0;
-
- public DocumentReader() {
- super();
- }
-
- public DocumentReader(IDocument document) {
- this(document, 0);
- }
-
- public DocumentReader(IDocument document, int initialPosition) {
- super();
- fDocument = document;
- position = initialPosition;
- }
-
- public void close() throws IOException {
- fDocument = null;
- }
-
- /**
- * @return
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Reader#mark(int)
- */
- public void mark(int readAheadLimit) throws IOException {
- mark = position;
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public int read(char[] cbuf, int off, int len) throws IOException {
- if(fDocument == null)
- return -1;
-
- char[] readChars = null;
- try {
- if (position >= fDocument.getLength())
- return -1;
- // the IDocument is likely using a GapTextStore, so we can't
- // retrieve a char[] directly
- if (position + len > fDocument.getLength())
- readChars = fDocument.get(position, fDocument.getLength() - position).toCharArray();
- else
- readChars = fDocument.get(position, len).toCharArray();
- System.arraycopy(readChars, 0, cbuf, off, readChars.length);
- // System.out.println("" + position + ":" + readChars.length + " "
- // + StringUtils.escape(new String(readChars)));
- position += readChars.length;
- return readChars.length;
- } catch (Exception e) {
- throw new IOException("Exception while reading from IDocument: " + e); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Reader#reset()
- */
- public void reset() throws IOException {
- position = mark;
- }
-
- public void reset(IDocument document, int initialPosition) {
- fDocument = document;
- position = initialPosition;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Reader#reset()
- */
- public void reset(int pos) throws IOException {
- position = pos;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Reader#skip(long)
- */
- public long skip(long n) throws IOException {
- if(fDocument == null)
- return 0;
-
- long skipped = n;
- if (position + n > fDocument.getLength()) {
- skipped = fDocument.getLength() - position;
- position = fDocument.getLength();
- } else {
- position += n;
- }
- return skipped;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java
deleted file mode 100644
index 4ea8b04d4e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java
+++ /dev/null
@@ -1,22 +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.sse.core.internal.document;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-
-public interface IDocumentCharsetDetector extends IResourceCharsetDetector {
- void set(IDocument document);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
deleted file mode 100644
index b7eff1e3f4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
+++ /dev/null
@@ -1,82 +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.sse.core.internal.document;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-
-
-/**
- * Provides methods for the creation of an IStructuredDocument correctly
- * prepared to work with a particular type of content.
- */
-public interface IDocumentLoader {
-
- /**
- * @return a new IStructuredDocument prepared by this loader
- */
- IEncodedDocument createNewStructuredDocument();
-
- /**
- * This API is like createNewStructuredDocument, except it should populate
- * the structuredDocument with the contents of IFile. Also, those
- * StructuredDocuments which are sensitive to the input (that is, the
- * parser or parser initialization my require the input) should
- * additionally initialize the parser, etc., appropriate to the input.
- *
- * As always, the appropriate decoding should be used.
- */
- IEncodedDocument createNewStructuredDocument(IFile iFile) throws java.io.IOException, CoreException;
-
- /**
- * This method must return a new instance of IEncodedDocument, that has
- * been initialized with appropriate parser. For many loaders, the
- * (default) parser used is known for any input. For others, the correct
- * parser (and its initialization) is normally dependent on the content of
- * the file. This no-argument method should assume "empty input" and would
- * therefore return the default parser for the default contentType.
- */
- IEncodedDocument createNewStructuredDocument(String filename, InputStream istream) throws java.io.IOException;
-
- IEncodedDocument createNewStructuredDocument(String filename, InputStream istream, EncodingRule encodingRule) throws java.io.IOException;
-
- /**
- * @return the document partitioner
- */
- IDocumentPartitioner getDefaultDocumentPartitioner();
-
- IDocumentCharsetDetector getDocumentEncodingDetector();
-
- /**
- * A utility method, but depends on subclasses to implement the preferred
- * end of line for a particular content type. Note: subclasses should not
- * re-implement this method (there's no reason to, even though its part of
- * interface). This method not only converts end-of-line characters, if
- * needed, but sets the correct end-of-line delimiter in
- * structuredDocument. The returned value is either the original string,
- * if no conversion is needed, or a new string with end-of-lines
- * converted.
- *
- * @deprecated - the content's line delimiters should be preserved
- */
- StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theStructuredDocument);
-
- void reload(IEncodedDocument document, Reader reader) throws IOException;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java
deleted file mode 100644
index 41618fac2a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.document;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument;
-
-
-/**
- * At the moment, this is primarily intended as a convenience to help switch
- * between various types of threading models in the document, all in a central
- * piece of code.
- */
-public class StructuredDocumentFactory {
- private static final int WRITE_SYNCHRONIZED = 3;
- private static final int DEFAULT = WRITE_SYNCHRONIZED;
- private static final int UNSYNCHRONIZED = 1;
-
- private static IStructuredDocument getNewStructuredDocumentInstance(int type, RegionParser parser) {
- IStructuredDocument result = null;
- switch (type) {
- case UNSYNCHRONIZED :
- result = new BasicStructuredDocument(parser);
- break;
- case WRITE_SYNCHRONIZED :
- result = new JobSafeStructuredDocument(parser);
- break;
-
- default :
- throw new IllegalArgumentException("request document type was not known"); //$NON-NLS-1$
-
- }
- return result;
- }
-
- /**
- * Provides the (system default) structured document initialized with the
- * parser.
- *
- * @param parser
- * @return
- */
- public static IStructuredDocument getNewStructuredDocumentInstance(RegionParser parser) {
- return getNewStructuredDocumentInstance(DEFAULT, parser);
- }
-
- /**
- * Not intended to be instantiated
- *
- */
- private StructuredDocumentFactory() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java
deleted file mode 100644
index 91ec59830d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.document;
-
-
-/**
- * Collection of text functions.
- *
- * @deprecated - marked as deprecated to remind us to phase this out (and/or
- * move to "finished" version).
- */
-public class TextUtilities {
-
- /**
- * @deprecated if possible, its best to use
- * IDocument.getLegalLineDelimiters()
- */
- public final static String[] fgDelimiters = new String[]{"\n", "\r", "\r\n"};//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-
- /**
- * Determines which one of fgDelimiters appears first in the text. If none
- * of them the hint is returned.
- */
- public static String determineLineDelimiter(StringBuffer textBuffer, String[] possibles, String hint) {
- try {
- // TODO: avoid use of String instance
- String text = textBuffer.toString();
- int[] info = indexOf(possibles, text, 0);
- return possibles[info[1]];
- } catch (ArrayIndexOutOfBoundsException x) {
- }
- return hint;
- }
-
- /**
- * Returns the position in the string greater than offset of the longest
- * matching search string.
- */
- private static int[] indexOf(String[] searchStrings, String text, int offset) {
-
- int[] result = {-1, -1};
-
- for (int i = 0; i < searchStrings.length; i++) {
- int index = text.indexOf(searchStrings[i], offset);
- if (index >= 0) {
-
- if (result[0] == -1) {
- result[0] = index;
- result[1] = i;
- } else if (index < result[0]) {
- result[0] = index;
- result[1] = i;
- } else if (index == result[0] && searchStrings[i].length() > searchStrings[result[1]].length()) {
- result[0] = index;
- result[1] = i;
- }
- }
- }
-
- return result;
-
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java
deleted file mode 100644
index 16467b6d00..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java
+++ /dev/null
@@ -1,91 +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.sse.core.internal.filebuffers;
-
-import org.eclipse.core.filebuffers.IDocumentFactory;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument;
-
-
-/**
- * Generic IDocumentFactory for IStructuredDocuments to be used by the
- * org.eclipse.core.filebuffers.documentCreation extension point. This class
- * is not meant to be subclassed.
- *
- * @plannedfor 1.0
- */
-public class BasicStructuredDocumentFactory implements IDocumentFactory, IExecutableExtension {
-
- /*
- * The content type ID used to declare this factory; it is used to find
- * the corresponding support for creating the document
- */
- private String fContentTypeIdentifier = null;
-
- /**
- * Constructor, only to be used by the
- * org.eclipse.core.filebuffers.documentCreation extension point.
- */
- public BasicStructuredDocumentFactory() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
- */
- public IDocument createDocument() {
- IDocument document = null;
- IContentType contentType = Platform.getContentTypeManager().getContentType(getContentTypeIdentifier());
- IModelHandler handler = null;
- while (handler == null && !IContentTypeManager.CT_TEXT.equals(contentType.getId())) {
- handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(contentType.getId());
- contentType = contentType.getBaseType();
- }
- if (handler != null) {
- document = handler.getDocumentLoader().createNewStructuredDocument();
- }
- else {
- document = new JobSafeStructuredDocument();
- }
- return document;
- }
-
- private String getContentTypeIdentifier() {
- return fContentTypeIdentifier;
- }
-
- /*
- * Loads the content type ID to be used when creating the Structured Document.
- *
- * @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 {
- fContentTypeIdentifier = config.getAttribute("contentTypeId"); //$NON-NLS-1$
- if (data != null) {
- if (data instanceof String && data.toString().length() > 0) {
- fContentTypeIdentifier = (String) data;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
deleted file mode 100644
index 1e8d6902a1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Møller - initial IDocumentExtension4 support - #102822
- * David Carver (Intalio) - bug 300443 - some constants aren't static final
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.format;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractStructuredFormatProcessor implements IStructuredFormatProcessor {
- protected IStructuredFormatContraints fFormatContraints = null;
- protected IProgressMonitor fProgressMonitor = null;
- public boolean refreshFormatPreferences = true; // special flag for JUnit
- /*
- * Max length of text to be formatted to be considered a "small change"
- * Used for document rewrite session type.
- */
- private static final int MAX_SMALL_FORMAT_SIZE = 1000;
-
- protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
-
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- }
- catch (IOException e) {
- Logger.logException(e); // hopeless
- }
- try {
- if (outputStream != null) {
- outputStream.close();
- }
- }
- catch (IOException e) {
- Logger.logException(e); // hopeless
- }
- }
-
- public String formatContent(String input) throws IOException, CoreException {
- if (input == null)
- return input;
-
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for read. Will return formatted
- // string and NOT save model.
- inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
- String id = inputStream.toString() + "." + getFileExtension(); //$NON-NLS-1$
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
- // format
- formatModel(structuredModel);
-
- // return output
- return structuredModel.getStructuredDocument().get();
- }
- finally {
- ensureClosed(null, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
-
- public String formatContent(String input, int start, int length) throws IOException, CoreException {
- if (input == null)
- return input;
-
- if ((start >= 0) && (length >= 0) && (start + length <= input.length())) {
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for read. Will return formatted
- // string and NOT save model.
- inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
- String id = inputStream.toString() + "." + getFileExtension(); //$NON-NLS-1$
- structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
- // format
- formatModel(structuredModel, start, length);
-
- // return output
- return structuredModel.getStructuredDocument().get();
- }
- finally {
- ensureClosed(null, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
- else
- return input;
- }
-
- public void formatDocument(IDocument document) throws IOException, CoreException {
- if (document == null)
- return;
-
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-
- // format
- formatModel(structuredModel);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
-
- public void formatDocument(IDocument document, int start, int length) throws IOException, CoreException {
- if (document == null)
- return;
-
- if ((start >= 0) && (length >= 0) && (start + length <= document.getLength())) {
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if
- // model changed.
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-
- if (structuredModel != null) {
- // format
- formatModel(structuredModel, start, length);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- }
- finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
- }
-
- public void formatFile(IFile file) throws IOException, CoreException {
- if (file == null)
- return;
-
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-
- // format
- formatModel(structuredModel);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null) {
- structuredModel.releaseFromEdit();
- }
-
- }
- }
-
- public void formatFile(IFile file, int start, int length) throws IOException, CoreException {
- if (file == null)
- return;
-
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-
- // format
- formatModel(structuredModel, start, length);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
-
- public void formatFileName(String fileName) throws IOException, CoreException {
- if (fileName == null)
- return;
-
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- inputStream = new FileInputStream(fileName);
- structuredModel = StructuredModelManager.getModelManager().getModelForEdit(fileName, inputStream, null);
-
- // format
- formatModel(structuredModel);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
-
- public void formatFileName(String fileName, int start, int length) throws IOException, CoreException {
- if (fileName == null)
- return;
-
- IStructuredModel structuredModel = null;
- InputStream inputStream = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- inputStream = new FileInputStream(fileName);
- structuredModel = StructuredModelManager.getModelManager().getModelForEdit(fileName, inputStream, null);
-
- // format
- formatModel(structuredModel, start, length);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, inputStream);
- // release from model manager
- if (structuredModel != null)
- structuredModel.releaseFromEdit();
- }
- }
-
- public void formatModel(IStructuredModel structuredModel) {
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
-
- formatModel(structuredModel, start, length);
- }
-
- public void formatModel(IStructuredModel structuredModel, int start, int length) {
- if (structuredModel != null) {
- // for debugging purposes
- long startTime = System.currentTimeMillis();
-
- IDocumentExtension4 docExt4 = null;
- if (structuredModel.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4) structuredModel.getStructuredDocument();
- }
- DocumentRewriteSession rewriteSession = null;
-
- try {
- // whenever formatting model, fire abouttochange/modelchanged
- structuredModel.aboutToChangeModel();
- DocumentRewriteSessionType rewriteType = (length > MAX_SMALL_FORMAT_SIZE) ? DocumentRewriteSessionType.UNRESTRICTED : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
- rewriteSession = (docExt4 == null || docExt4.getActiveRewriteSession() != null) ? null : docExt4.startRewriteSession(rewriteType);
-
- if ((start == 0) && (length == structuredModel.getStructuredDocument().getLength()))
- setFormatWithSiblingIndent(structuredModel, false);
- else
- setFormatWithSiblingIndent(structuredModel, true);
-
- if ((start >= 0) && (length >= 0) && (start + length <= structuredModel.getStructuredDocument().getLength())) {
- List activeNodes = getAllActiveNodes(structuredModel, start, length);
- if (activeNodes.size() > 0) {
- Node firstNode = (Node) activeNodes.get(0);
- Node lastNode = (Node) activeNodes.get(activeNodes.size() - 1);
-
- boolean done = false;
- Node eachNode = firstNode;
- Node nextNode = null;
- while (!done) {
- // update "done"
- done = (eachNode == lastNode);
-
- /*
- * get next sibling before format because eachNode
- * may be deleted, for example when it's an empty
- * text node
- */
- nextNode = eachNode.getNextSibling();
-
- // format each node
- formatNode(eachNode);
-
- // update each node
- if ((nextNode != null) && (nextNode.getParentNode() == null))
- // nextNode is deleted during format
- eachNode = eachNode.getNextSibling();
- else
- eachNode = nextNode;
-
- // This should not be needed, but just in case
- // something went wrong with with eachNode.
- // We don't want an infinite loop here.
- if (eachNode == null)
- done = true;
- }
-
- }
- }
- }
- finally {
- // we need two finally's, just in case first fails
- try {
- if ((docExt4 != null) && (rewriteSession != null))
- docExt4.stopRewriteSession(rewriteSession);
- }
- finally {
- // always make sure to fire changedmodel when done
- structuredModel.changedModel();
- }
- }
-
- if (Logger.DEBUG_FORMAT) {
- long endTime = System.currentTimeMillis();
- System.out.println("formatModel time: " + (endTime - startTime)); //$NON-NLS-1$
- }
- }
- }
-
- public void formatNode(Node node) {
- if (node != null) {
- Node newNode = node;
-
- // format the owner node if it's an attribute node
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- newNode = ((Attr) node).getOwnerElement();
-
- // refresh format preferences before getting formatter
- if (refreshFormatPreferences)
- refreshFormatPreferences();
-
- // get formatter and format contraints
- IStructuredFormatter formatter = getFormatter(newNode);
- // TODO_future: added assert to replace "redundant null check".
- // if formatter is ever null, we should provide some
- // default formatter to serve as place holder.
- Assert.isNotNull(formatter, "formatter was null for a node, "); //$NON-NLS-1$
- IStructuredFormatContraints formatContraints = formatter.getFormatContraints();
- formatContraints.setFormatWithSiblingIndent(true);
- // format each node
- formatter.format(newNode, formatContraints);
- }
- }
-
- /**
- * @deprecated Use getAllActiveNodes instead
- */
- protected Vector getActiveNodes(IStructuredModel structuredModel, int startNodeOffset, int length) {
- List allActiveNodes = getAllActiveNodes(structuredModel, startNodeOffset, length);
- return new Vector(allActiveNodes);
- }
-
- protected List getAllActiveNodes(IStructuredModel structuredModel, int startNodeOffset, int length) {
- List activeNodes = new ArrayList();
-
- if (structuredModel != null) {
- Node startNode = (Node) structuredModel.getIndexedRegion(startNodeOffset);
- // see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4711
- //
- // We have to watch for selection boundary conditions. Use this as
- // an example: <a>text</a><b>text</b>,
- // If the whole <a> node is selected, like:
- // |<a>text</a>|<b>text</b>, we need to substract the length by 1
- // to find
- // the node at the end of the selection:
- // structuredModel.getIndexedRegion(startNodeOffset + length - 1),
- // or else
- // we'd find the next adjacent node.
- //
- // However, when the selection length is 0 (meaning no text is
- // selected), the cursor is at the beginning
- // of the node we want to format: |<a>text</a><b>text</b>, the
- // node at the end of the selection is:
- // structuredModel.getIndexedRegion(startNodeOffset + length).
- int endNodeOffset = length > 0 ? startNodeOffset + length - 1 : startNodeOffset + length;
- Node endNode = (Node) structuredModel.getIndexedRegion(endNodeOffset);
-
- // make sure it's an non-empty document
- if (startNode != null) {
- while (isSiblingOf(startNode, endNode) == false) {
- if (endNode != null)
- endNode = endNode.getParentNode();
- if (endNode == null) {
- startNode = startNode.getParentNode();
- // see
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4711
- // and notes above
- endNodeOffset = length > 0 ? startNodeOffset + length - 1 : startNodeOffset + length;
- endNode = (Node) structuredModel.getIndexedRegion(endNodeOffset);
- }
- }
-
- while (startNode != endNode) {
- activeNodes.add(startNode);
- startNode = startNode.getNextSibling();
- }
- if (startNode != null)
- activeNodes.add(startNode);
- }
- }
-
- return activeNodes;
- }
-
- abstract protected String getFileExtension();
-
- protected IStructuredFormatContraints getFormatContraints(IStructuredModel structuredModel) {
- // 262135 - NPE during format of empty document
- if ((fFormatContraints == null) && (structuredModel != null)) {
- Node node = (Node) structuredModel.getIndexedRegion(0);
-
- if (node != null) {
- IStructuredFormatter formatter = getFormatter(node);
- if (formatter != null) {
- fFormatContraints = formatter.getFormatContraints();
- }
- }
- }
-
- return fFormatContraints;
- }
-
- abstract protected IStructuredFormatter getFormatter(Node node);
-
- protected boolean isSiblingOf(Node node, Node endNode) {
- if (endNode == null)
- return true;
- else {
- Node siblingNode = node;
- while (siblingNode != null) {
- if (siblingNode == endNode)
- return true;
- else
- siblingNode = siblingNode.getNextSibling();
- }
- return false;
- }
- }
-
- abstract protected void refreshFormatPreferences();
-
- protected void setFormatWithSiblingIndent(IStructuredModel structuredModel, boolean formatWithSiblingIndent) {
- // 262135 - NPE during format of empty document
- IStructuredFormatContraints formatContraints = getFormatContraints(structuredModel);
-
- if (formatContraints != null)
- formatContraints.setFormatWithSiblingIndent(formatWithSiblingIndent);
- }
-
- public void setProgressMonitor(IProgressMonitor monitor) {
- fProgressMonitor = monitor;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
deleted file mode 100644
index 2730043e60..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
+++ /dev/null
@@ -1,39 +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.sse.core.internal.format;
-
-/**
- * These are items that change from element to element.
- * Passed from node to node in a recursive call.
- * eg. current indent is 2 deep, but for the next node might be 3...
- */
-public interface IStructuredFormatContraints {
- boolean getClearAllBlankLines();
-
- String getCurrentIndent();
-
- boolean getFormatWithSiblingIndent();
-
- boolean getInPreserveSpaceElement();
-
- /**
- * some special elements can ignore clearing blank lines
- * */
- void setClearAllBlankLines(boolean clearAllBlankLines);
-
- void setCurrentIndent(String currentIndent);
-
- void setFormatWithSiblingIndent(boolean formatWithSiblingIndent);
-
- void setInPreserveSpaceElement(boolean inPreserveSpaceElement);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java
deleted file mode 100644
index 2cef142eb1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java
+++ /dev/null
@@ -1,33 +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.sse.core.internal.format;
-
-/**
- * These are items that do not change from element to element.
- * Passed from node to node in a recursive call because sometimes
- * child nodes don't have access to the preferences
- */
-public interface IStructuredFormatPreferences {
-
- boolean getClearAllBlankLines();
-
- String getIndent();
-
- int getLineWidth();
-
- void setClearAllBlankLines(boolean clearAllBlankLines);
-
- void setIndent(String indent);
-
- void setLineWidth(int lineWidth);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java
deleted file mode 100644
index b83aac34f8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java
+++ /dev/null
@@ -1,70 +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.sse.core.internal.format;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-/**
- * The main formatting engine.
- * Loops through all the nodes in an IStructuredModel.
- */
-public interface IStructuredFormatProcessor {
-
- /**
- * This form of the FormatProcessor takes an IDocument as input, creates a
- * temporary model of content type calculated using the IDocument's file
- * extension, formats the model within start and length, then releases the
- * model.
- */
- void formatDocument(IDocument document, int start, int length) throws IOException, CoreException;
-
- /**
- * This form of the FormatProcessor takes an IFile as input, creates a
- * temporary model of content type calculated using the IFile's file
- * extension, formats the whole model, then releases the model.
- */
- void formatFile(IFile file) throws IOException, CoreException;
-
- /**
- * This form of the FormatProcessor takes a model as input, and formats
- * the whole model.
- */
- void formatModel(IStructuredModel structuredModel);
-
- /**
- * This form of the FormatProcessor takes a model as input, and formats
- * the model within start and length.
- */
- void formatModel(IStructuredModel structuredModel, int start, int length);
-
- /**
- * This form of the FormatProcessor takes a node as input, and formats the
- * node and all its children.
- */
- void formatNode(Node node);
-
- /**
- * Sets the progress monitor for this <code>IStructuredFormatProcessor</code>.
- * The monitor is used to display progress or cancel if the formatter is run
- * in a background job.
- * @param monitor
- */
- void setProgressMonitor(IProgressMonitor monitor);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java
deleted file mode 100644
index 6c23d12b5b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java
+++ /dev/null
@@ -1,36 +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.sse.core.internal.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.w3c.dom.Node;
-
-/**
- * Knows how to format a particular node.
- *
- * eg. generic node, text node, document node, comment, etc...
- */
-public interface IStructuredFormatter {
-
- void format(Node node);
-
- void format(Node node, IStructuredFormatContraints formatContraints);
-
- IStructuredFormatContraints getFormatContraints();
-
- IStructuredFormatPreferences getFormatPreferences();
-
- void setFormatPreferences(IStructuredFormatPreferences formatPreferences);
-
- void setProgressMonitor(IProgressMonitor monitor);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
deleted file mode 100644
index ca47e41dfe..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
+++ /dev/null
@@ -1,53 +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
- * Jesper Steen Møller - xml:space='preserve' support
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.format;
-
-public class StructuredFormatContraints implements IStructuredFormatContraints {
- private boolean fClearAllBlankLines;
- private String fCurrentIndent = ""; //$NON-NLS-1$
- private boolean fFormatWithSiblingIndent = false;
- private boolean fInPreserveSpaceElement = false;
-
- public boolean getClearAllBlankLines() {
- return fClearAllBlankLines;
- }
-
- public String getCurrentIndent() {
- return fCurrentIndent;
- }
-
- public boolean getFormatWithSiblingIndent() {
- return fFormatWithSiblingIndent;
- }
-
- public void setClearAllBlankLines(boolean clearAllBlankLines) {
- fClearAllBlankLines = clearAllBlankLines;
- }
-
- public void setCurrentIndent(String currentIndent) {
- fCurrentIndent = currentIndent;
- }
-
- public void setFormatWithSiblingIndent(boolean formatWithSiblingIndent) {
- fFormatWithSiblingIndent = formatWithSiblingIndent;
- }
-
- public boolean getInPreserveSpaceElement() {
- return fInPreserveSpaceElement;
- }
-
- public void setInPreserveSpaceElement(boolean inPreserveSpaceElement) {
- fInPreserveSpaceElement = inPreserveSpaceElement;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java
deleted file mode 100644
index 96f1b92baf..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.format;
-
-public class StructuredFormatPreferences implements IStructuredFormatPreferences {
- private boolean fClearAllBlankLines;
- private String fIndent;
- private int fLineWidth;
-
- public boolean getClearAllBlankLines() {
- return fClearAllBlankLines;
- }
-
- public String getIndent() {
- return fIndent;
- }
-
- public int getLineWidth() {
- return fLineWidth;
- }
-
- public void setClearAllBlankLines(boolean clearAllBlankLines) {
- fClearAllBlankLines = clearAllBlankLines;
- }
-
- public void setIndent(String indent) {
- fIndent = indent;
- }
-
- public void setLineWidth(int lineWidth) {
- fLineWidth = lineWidth;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java
deleted file mode 100644
index 6c45577def..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java
+++ /dev/null
@@ -1,72 +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.sse.core.internal.ltk.modelhandler;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.modelhandler.PluginContributedFactoryReader;
-
-/**
- * ISSUE: need to provide this functionality in improved API.
- */
-
-public abstract class AbstractModelHandler implements IModelHandler {
- private String associatedContentTypeId;
- private boolean defaultSetting;
- private String modelHandlerID;
-
- public AbstractModelHandler() {
- super();
- }
-
- /**
- * These factories are added automatically by model manager
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- Collection holdFactories = PluginContributedFactoryReader.getInstance().getFactories(this);
- if (holdFactories != null) {
- result.addAll(holdFactories);
- }
- return result;
- }
-
- public String getAssociatedContentTypeId() {
- return associatedContentTypeId;
- }
-
- public abstract IDocumentCharsetDetector getEncodingDetector();
-
- public String getId() {
- return modelHandlerID;
- }
-
- public boolean isDefault() {
- return defaultSetting;
- }
-
- protected void setAssociatedContentTypeId(String contentTypeId) {
- associatedContentTypeId = contentTypeId;
- }
-
- public void setDefault(boolean defaultParam) {
- defaultSetting = defaultParam;
- }
-
- protected void setId(String id) {
- modelHandlerID = id;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
deleted file mode 100644
index b5511909e3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.ltk.modelhandler;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-
-
-/**
- */
-public interface EmbeddedTypeHandler {
-
- /**
- * These AdapterFactories are NOT added to IStructuredModel's
- * IAdapterFactory Registry, but instead expected to be consulted as
- * needed by functionality aware of embedded content types. Additions
- * to the model's own factory registry should be done in
- * {@link #initializeFactoryRegistry(FactoryRegistry)}
- */
- List getAdapterFactories();
-
- /**
- * Returns the unique identifier for the content type family this
- * ContentTypeDescription belongs to.
- */
- String getFamilyId();
-
- /**
- * Returns a list of mime types (as Strings) this handler is appropriate
- * for
- */
- List getSupportedMimeTypes();
-
- /**
- * If this hander can handle a given mimeType.
- *
- * This is a looser check than simply checking if a give mimeType
- * in the list of supported types, so it should be used with that
- * in mind. That is, the supported mimeType list should ideally be
- * checked first.
- *
- * eg. if a mime type ends with "+xml", like voice+xml
- * the EmbeddedXML handler should be able to handle it
- *
- * @return true if this handler thinks can handle the given mimeType
- */
- boolean canHandleMimeType(String mimeType);
-
- /**
- * This method is to give the EmbeddedContentType an opportunity to add
- * factories directly to the IStructuredModel's IAdapterFactory registry.
- */
- void initializeFactoryRegistry(FactoryRegistry registry);
-
- /**
- * initializeParser, for example, setting up a "block" tags list using an
- * extended interface
- */
- void initializeParser(RegionParser parser);
-
- boolean isDefault();
-
- EmbeddedTypeHandler newInstance();
-
- void uninitializeFactoryRegistry(FactoryRegistry registry);
-
- void uninitializeParser(RegionParser parser);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
deleted file mode 100644
index aa629639a8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.ltk.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-
-/**
- * Responsible for providing the mechanisms used in the correct loading of an
- * IStructuredDocument's contents and determine its self-described encoding.
- */
-public interface IDocumentTypeHandler {
-
- /**
- * The Loader is reponsible for decoding the Resource,
- */
- IDocumentLoader getDocumentLoader();
-
- /**
- * @deprecated - likely to go away, so I marked as deprecated to
- * discoursage use
- */
- IDocumentCharsetDetector getEncodingDetector();
-
- /**
- * Must return unique ID that is the same as identified in plugin registry
- */
- String getId();
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
deleted file mode 100644
index 588f39e598..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.ltk.modelhandler;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-
-
-/**
- * Responsible for providing the mechanisms used in the correct loading of an
- * IStructuredModel's contents and initialization of its adapter factories.
- */
-public interface IModelHandler extends IDocumentTypeHandler {
- /**
- * This method should return Factories which are added automatically by
- * IModelManager. This can and will often be an empty List (or null),
- * since some AdapterFactories must be added by Loader directly, and most
- * should be added by Editors. FormatAdapterFactory is an example of one
- * that can be returned here, since the timing of adding it is not
- * critical, but it may be needed even when an editor is not being used.
- */
- List getAdapterFactories();
-
- /**
- * Returns the ID for the associated ContentTypeHandler But is needed for
- * now.
- */
- String getAssociatedContentTypeId();
-
- /**
- * The Loader is reponsible for decoding the Resource,
- */
- IModelLoader getModelLoader();
-
- boolean isDefault();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java
deleted file mode 100644
index 468b360da1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.ltk.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-/**
- * ISSUE: need to provide functionality in improved API.
- */
-public class BlockMarker extends TagMarker {
-
- // allow for JSP expressions within the block
- protected boolean fAllowJSP = true;
-
- protected boolean fCaseSensitive = false;
-
- // the context for the contents of this tag (BLOCK_TEXT, JSP_CONTENT,
- // etc.)
- protected String fContext;
-
- public BlockMarker(String tagName, ITextRegion marker, String context) {
- this(tagName, marker, context, true);
- }
-
- public BlockMarker(String tagName, ITextRegion marker, String context, boolean caseSensitive) {
- this(tagName, marker, context, caseSensitive, true);
- }
-
- public BlockMarker(String tagName, ITextRegion marker, String context, boolean caseSensitive, boolean allowJSP) {
- super(tagName, marker);
- setContext(context);
- setCaseSensitive(caseSensitive);
- setAllowJSP(allowJSP);
- }
-
- public BlockMarker(String tagName, String regionContext, boolean caseSensitive) {
- this(tagName, null, regionContext, caseSensitive, false);
- }
-
- /**
- * Gets the allowJSP.
- *
- * @return Returns a boolean
- */
- public boolean allowsJSP() {
- return fAllowJSP;
- }
-
- /**
- * Gets the context.
- *
- * @return Returns a String
- */
- public String getContext() {
- return fContext;
- }
-
- /**
- *
- * @return boolean
- */
- public final boolean isCaseSensitive() {
- return fCaseSensitive;
- }
-
- /**
- * Sets the allowJSP.
- *
- * @param allowJSP
- * The allowJSP to set
- */
- public void setAllowJSP(boolean allowJSP) {
- fAllowJSP = allowJSP;
- }
-
- public final void setCaseSensitive(boolean sensitive) {
- fCaseSensitive = sensitive;
- }
-
- /**
- * Sets the context.
- *
- * @param context
- * The context to set
- */
- public void setContext(String context) {
- fContext = context;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java
deleted file mode 100644
index 6bd6b70086..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java
+++ /dev/null
@@ -1,32 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.util.List;
-
-public interface BlockTagParser {
-
- void addBlockMarker(BlockMarker marker);
-
- void beginBlockScan(String tagName);
-
- BlockMarker getBlockMarker(String tagName);
-
- List getBlockMarkers();
-
- void removeBlockMarker(BlockMarker marker);
-
- void removeBlockMarker(String tagName);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java
deleted file mode 100644
index b5ad5347d1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java
+++ /dev/null
@@ -1,58 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public interface BlockTokenizer {
-
- void addBlockMarker(BlockMarker marker);
-
- void beginBlockMarkerScan(String newTagName, String context);
-
- void beginBlockTagScan(String newTagName);
-
- List getBlockMarkers();
-
- ITextRegion getNextToken() throws IOException;
-
- int getOffset();
-
- boolean isEOF();
-
- BlockTokenizer newInstance();
-
- void removeBlockMarker(BlockMarker marker);
-
- void removeBlockMarker(String tagname);
-
- void reset(char[] charArray);
-
- void reset(char[] charArray, int newOffset);
-
- void reset(InputStream in);
-
- void reset(InputStream in, int newOffset);
-
- void reset(Reader in);
-
- void reset(Reader in, int newOffset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java
deleted file mode 100644
index 30eab0c70e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java
+++ /dev/null
@@ -1,41 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * IBlockedStructuredDocumentRegion is just like an IStructuredDocumentRegion
- * except results from parsing a "block tag" (such as SCRIPT or STYLE).
- * Because these are "variable" partition types, its often handy (efficient)
- * to keep track of the partition type.
- *
- * @plannedfor 1.0
- */
-public interface IBlockedStructuredDocumentRegion extends IStructuredDocumentRegion {
- /**
- * Return the partion type for this region.
- *
- * @return the partion type.
- */
- String getPartitionType();
-
- /**
- * Sets the partion type.
- *
- * For use by parsers and re-parsers only.
- *
- * @param partitionType
- */
- void setPartitionType(String partitionType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java
deleted file mode 100644
index 3d55973a07..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-import java.util.List;
-
-public interface JSPCapableParser extends RegionParser, BlockTagParser {
- void addNestablePrefix(TagMarker marker);
-
- /**
- * returns the TagMarkers for prefixes that are allowed to be nestable
- *
- * @return
- */
- List getNestablePrefixes();
-
- void removeNestablePrefix(String tagName);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java
deleted file mode 100644
index 628dfc6ad6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java
+++ /dev/null
@@ -1,52 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.io.Reader;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public interface RegionParser {
-
- IStructuredDocumentRegion getDocumentRegions();
-
- List getRegions();
-
- /**
- * The 'newInstance' method is similar to 'clone', but does not include
- * the copying of any content. For a pure RegionParser itself, there would
- * be little state to "clone", but for some subtypes, such as
- * StructuredDocumentRegionParser and JSPCapableParser, there could the
- * more internal data to "clone", such as the internal tokenizer should be
- * cloned (including block tags, etc).
- */
- RegionParser newInstance();
-
- void reset(Reader reader);
-
- /**
- * An additional offset for use with any position-dependant parsing rules
- */
- void reset(Reader reader, int offset);
-
- void reset(String input);
-
- /**
- * An additional offset for use with any position-dependant parsing rules
- */
- void reset(String input, int offset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java
deleted file mode 100644
index 31e5cba8f3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public interface StructuredDocumentRegionHandler {
-
- // Sent when a IStructuredDocumentRegion is first parsed
- public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion);
-
- // Sent when the calling parser's model undergoes a full reset
- // and any information based upon the old model should be
- // cleared
- public void resetNodes();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java
deleted file mode 100644
index 85f2d7b58d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public interface StructuredDocumentRegionHandlerExtension extends StructuredDocumentRegionHandler {
- void setStructuredDocument(IStructuredDocument newDocument);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java
deleted file mode 100644
index d4bbe5dac0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.ltk.parser;
-
-
-
-public interface StructuredDocumentRegionParser extends RegionParser {
-
- void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler);
-
- void removeStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler);
-
- void resetHandlers();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java
deleted file mode 100644
index 474950e5a8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-import java.util.List;
-
-
-
-public interface StructuredDocumentRegionParserExtension extends StructuredDocumentRegionParser {
- /**
- * Returns the current list of StructuredDocumentRegionHandlers listening
- * to this parser.
- *
- * @return List - the list of listeners, the list may not be null and each
- * element in it must implement StructuredDocumentRegionHandler
- */
- List getStructuredDocumentRegionHandlers();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java
deleted file mode 100644
index 3de225d699..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java
+++ /dev/null
@@ -1,80 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-/**
- * ISSUE: need to provide functionality in improved API.
- */
-
-public class TagMarker {
-
- // a ITextRegion (meant to be updated with the model) marking the position
- // where this tagname becomes effective
- protected ITextRegion fMarker = null;
-
- // the tagname
- protected String fTagName = null;
-
- /**
- *
- */
- public TagMarker() {
- super();
- }
-
- public TagMarker(String tagname) {
- super();
- setTagName(tagname);
- }
-
- public TagMarker(String tagname, ITextRegion marker) {
- super();
- setTagName(tagname);
- setMarker(marker);
- }
-
- public final ITextRegion getMarker() {
- return fMarker;
- }
-
- /**
- * @return java.lang.String
- */
- public final String getTagName() {
- return fTagName;
- }
-
- /**
- * @return boolean
- */
- public boolean isGlobal() {
- return fMarker == null;
- }
-
- /**
- * @param newMarker
- */
- public final void setMarker(ITextRegion newMarker) {
- fMarker = newMarker;
- }
-
- /**
- * @param newTagname
- * java.lang.String
- */
- public final void setTagName(String newTagName) {
- fTagName = newTagName;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
deleted file mode 100644
index caafaaf7e3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
+++ /dev/null
@@ -1,545 +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.wst.sse.core.internal.model;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandlerExtension;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParserExtension;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-
-/**
- * This class reads a file and creates an Structured Model.
- */
-public abstract class AbstractModelLoader implements IModelLoader {
- protected static final int encodingNameSearchLimit = 1000;
-
- private static long computeMem() {
- for (int i = 0; i < 5; i++) {
- System.gc();
- System.runFinalization();
- }
- return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
- }
-
- private boolean DEBUG = false;
- protected IDocumentLoader documentLoaderInstance;
-
- /**
- * AbstractLoader constructor also initializes encoding converter/mapper
- */
- public AbstractModelLoader() {
- super();
- }
-
- protected void addFactories(IStructuredModel model, List factoryList) {
- Assert.isNotNull(model);
- FactoryRegistry registry = model.getFactoryRegistry();
- Assert.isNotNull(registry, "IStructuredModel " + model.getId() + " has a null FactoryRegistry"); //$NON-NLS-1$ //$NON-NLS-2$
- if (factoryList != null) {
- Iterator iterator = factoryList.iterator();
- while (iterator.hasNext()) {
- INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
- registry.addFactory(factory);
- }
- }
- }
-
- /**
- * This method should perform all the model initialization required before
- * it contains content, namely, it should call newModel, the
- * createNewStructuredDocument(), then add those adapter factories which
- * must be set before content is applied. This method should be called by
- * "load" method. (this is tentative API)
- */
- public IStructuredModel createModel() {
- documentLoaderInstance = null;
- IStructuredModel model = newModel();
- IEncodedDocument structuredDocument = getDocumentLoader().createNewStructuredDocument();
- if (structuredDocument instanceof IStructuredDocument) {
- model.setStructuredDocument((IStructuredDocument) structuredDocument);
- addFactories(model, getAdapterFactories());
- //
- initEmbeddedTypePre(model, (IStructuredDocument) structuredDocument);
- initEmbeddedTypePost(model);
- // For types with propagating adapters, its important
- // that the propagating adapter be in place before the contents
- // are set.
- preLoadAdapt(model);
- }
- return model;
- }
-
- public IStructuredModel createModel(IStructuredDocument structuredDocument, String baseLocation, IModelHandler handler) {
- documentLoaderInstance = null;
- IStructuredModel model = newModel();
- model.setBaseLocation(baseLocation);
-
- // handler must be set early, incase a re-init is
- // required during creation.
- model.setModelHandler(handler);
-
- addFactories(model, getAdapterFactories());
- // For types with propagating adapters, it's important
- // that the propagating adapter be in place before the contents
- // are set.
- preLoadAdapt(model);
- initEmbeddedTypePre(model, structuredDocument);
-
- model.setStructuredDocument(structuredDocument);
- //
- initEmbeddedTypePost(model);
-
- return model;
- }
-
- /**
- * This method is used for cloning models.
- */
- public IStructuredModel createModel(IStructuredModel oldModel) {
- documentLoaderInstance = null;
- IStructuredModel newModel = newModel();
- IStructuredDocument oldStructuredDocument = oldModel.getStructuredDocument();
- IStructuredDocument newStructuredDocument = oldStructuredDocument.newInstance();
- newModel.setStructuredDocument(newStructuredDocument);
- // NOTE: we DO NOT simply add the standard ones to the new model
- // addFactories(newModel, getAdapterFactories());
- // Now, we take the opportunity to add Factories from the oldModel's
- // registry to the new model's registry .. if they do not already
- // exist there.
- duplicateFactoryRegistry(newModel, oldModel);
- if (newModel instanceof AbstractStructuredModel) {
- ((AbstractStructuredModel) newModel).setContentTypeIdentifier(oldModel.getContentTypeIdentifier());
- }
- // addFactories(newModel, oldModel);
- initEmbeddedType(oldModel, newModel);
- // For types with propagating adapters, its important
- // that the propagating adapter be in place before the contents
- // are set.
- preLoadAdapt(newModel);
- return newModel;
- }
-
- private void duplicateFactoryRegistry(IStructuredModel newModel, IStructuredModel oldModel) {
- List oldAdapterFactories = oldModel.getFactoryRegistry().getFactories();
- List newAdapterFactories = new ArrayList();
- Iterator oldListIterator = oldAdapterFactories.iterator();
- while (oldListIterator.hasNext()) {
- INodeAdapterFactory oldAdapterFactory = (INodeAdapterFactory) oldListIterator.next();
- // now "clone" the adapterfactory
- newAdapterFactories.add(oldAdapterFactory.copy());
- }
- // now that we have the "cloned" list, add to new model
- addFactories(newModel, newAdapterFactories);
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- // abstract method returns none
- return new ArrayList(0);
- }
-
- abstract public IDocumentLoader getDocumentLoader();
-
- /**
- * Method initEmbeddedType, "pre"-stage. Nothing to do here in super class.
- *
- * @param model
- */
- protected void initEmbeddedTypePre(IStructuredModel model) {
- }
-
- /**
- * Method initEmbeddedType, "pre"-stage. By default simply calls the
- * version of this method that uses only the structured model.
- *
- * @param model
- * the model for which to initialize
- * @param structuredDocument
- * The structured document containing the text content for the
- * model, which may be a different instance than what is in the
- * model at this stage.
- */
- protected void initEmbeddedTypePre(IStructuredModel model, IStructuredDocument structuredDocument) {
- initEmbeddedTypePre(model);
- }
-
- protected void initEmbeddedTypePost(IStructuredModel model) {
- }
-
- /**
- * Method initEmbeddedType. Nothing to do here in super class.
- *
- * @param oldModel
- * @param newModel
- */
- protected void initEmbeddedType(IStructuredModel oldModel, IStructuredModel newModel) {
- }
-
- public void load(IFile file, IStructuredModel model) throws IOException, CoreException {
- IEncodedDocument structuredDocument = model.getStructuredDocument();
- if (file == null)
- structuredDocument = getDocumentLoader().createNewStructuredDocument();
- else
- structuredDocument = getDocumentLoader().createNewStructuredDocument(file);
-
- // TODO: need to straighten out IEncodedDocument mess
- if (structuredDocument instanceof IStructuredDocument)
- transformInstance(model.getStructuredDocument(), (IStructuredDocument) structuredDocument);
- else
- model.getStructuredDocument().set(structuredDocument.get());
-
- // original hack
- // model.setStructuredDocument((IStructuredDocument)
- // structuredDocument);
- // ((IStructuredDocument) structuredDocument).fireNewDocument(this);
- documentLoaderInstance = null;
- // technicq of future
- // model.setStructuredDocument((IStructuredDocument)
- // structuredDocument);
- // documentLoaderInstance = null;
- }
-
- public void load(InputStream inputStream, IStructuredModel model, EncodingRule encodingRule) throws UnsupportedEncodingException, java.io.IOException {
- // note we don't open the stream, so we don't close it
- IEncodedDocument structuredDocument = model.getStructuredDocument();
- if (inputStream == null) {
- structuredDocument = getDocumentLoader().createNewStructuredDocument();
- }
- else {
- // assume's model has been initialized already with base location
- structuredDocument = getDocumentLoader().createNewStructuredDocument(model.getBaseLocation(), inputStream, encodingRule);
- // TODO: model's not designed for this!
- // we want to move to this "set" method, but the 'fire' was needed
- // as
- // a work around for strucutredModel not handling 'set' right, but
- // that 'fireNewDocument' method was causing unbalance
- // "aboutToChange" and "changed"
- // events.
- // model.setStructuredDocument((IStructuredDocument)
- // structuredDocument);
- // ((IStructuredDocument)
- // structuredDocument).fireNewDocument(this);
- model.getStructuredDocument().set(structuredDocument.get());
-
- }
- documentLoaderInstance = null;
-
- }
-
- /**
- * deprecated -- use EncodingRule form
- */
- synchronized public void load(InputStream inputStream, IStructuredModel model, String encodingName, String lineDelimiter) throws UnsupportedEncodingException, java.io.IOException {
- // note we don't open the stream, so we don't close it
- // TEMP work around to maintain previous function,
- // until everyone can change to EncodingRule.FORCE_DEFAULT
- if (encodingName != null && encodingName.trim().length() == 0) {
- // redirect to new method
- load(inputStream, model, EncodingRule.FORCE_DEFAULT);
- }
- else {
- load(inputStream, model, EncodingRule.CONTENT_BASED);
- }
- }
-
- public void load(String filename, InputStream inputStream, IStructuredModel model, String junk, String dummy) throws UnsupportedEncodingException, java.io.IOException {
-
- long memoryUsed = 0;
- if (DEBUG) {
- memoryUsed = computeMem();
- System.out.println("measuring heap memory for " + filename); //$NON-NLS-1$
- // System.out.println("heap memory used before load: " +
- // memoryUsed);
- }
-
- // during an initial load, we expect the olddocument to be empty
- // during re-load, however, it would be full.
- IEncodedDocument newstructuredDocument = null;
- IEncodedDocument oldStructuredDocument = model.getStructuredDocument();
-
- // get new document
- if (inputStream == null) {
- newstructuredDocument = getDocumentLoader().createNewStructuredDocument();
- }
- else {
- newstructuredDocument = getDocumentLoader().createNewStructuredDocument(filename, inputStream);
- }
- if (DEBUG) {
- long memoryAtEnd = computeMem();
- // System.out.println("heap memory used after loading new
- // document: " + memoryAtEnd);
- System.out.println(" heap memory implied used by document: " + (memoryAtEnd - memoryUsed)); //$NON-NLS-1$
- }
-
-
- // TODO: need to straighten out IEncodedDocument mess
- if (newstructuredDocument instanceof IStructuredDocument) {
- transformInstance((IStructuredDocument) oldStructuredDocument, (IStructuredDocument) newstructuredDocument);
- }
- else {
- // we don't really expect this case, just included for safety
- oldStructuredDocument.set(newstructuredDocument.get());
- }
- // original hack
- // model.setStructuredDocument((IStructuredDocument)
- // structuredDocument);
- // ((IStructuredDocument) structuredDocument).fireNewDocument(this);
- documentLoaderInstance = null;
- // technicq of future
- // model.setStructuredDocument((IStructuredDocument)
- // structuredDocument);
- // documentLoaderInstance = null;
- if (DEBUG) {
- long memoryAtEnd = computeMem();
- // System.out.println("heap memory used after setting to model: "
- // + memoryAtEnd);
- System.out.println(" heap memory implied used by document and model: " + (memoryAtEnd - memoryUsed)); //$NON-NLS-1$
- }
-
- }
-
- /**
- * required by interface, being declared here abstractly just as another
- * reminder.
- */
- abstract public IStructuredModel newModel();
-
- /**
- * There's nothing to do here in abstract class for initializing adapters.
- * Subclasses can and should override this method and provide proper
- * intialization (For example, to get DOM document and 'getAdapter' on it,
- * so that the first node/notifier has the adapter on it.)
- */
- protected void preLoadAdapt(IStructuredModel structuredModel) {
-
-
- }
-
- /**
- * Normally, here in the abstact class, there's nothing to do, but we will
- * reset text, since this MIGHT end up being called to recover from error
- * conditions (e.g. IStructuredDocument exceptions) And, can be called by
- * subclasses.
- */
- public IStructuredModel reinitialize(IStructuredModel model) {
- // Note: the "minimumization" routines
- // of 'replaceText' allow many old nodes to pass through, when
- // really its assumed they are created anew.
- // so we need to use 'setText' (I think "setText' ends up
- // throwing a 'newModel' event though, that may have some
- // implications.
- model.getStructuredDocument().setText(this, model.getStructuredDocument().get());
- return model;
- }
-
- /**
- * This method gets a fresh copy of the data, and repopulates the models
- * ... by a call to setText on the structuredDocument. This method is
- * needed in some cases where clients are sharing a model and then changes
- * canceled. Say for example, one editor and several "displays" are
- * sharing a model, if the editor is closed without saving changes, then
- * the displays still need a model, but they should revert to the original
- * unsaved version.
- */
- synchronized public void reload(InputStream inputStream, IStructuredModel structuredModel) {
- documentLoaderInstance = null;
- try {
- // temp solution ... we should be able to do better (more
- // efficient) in future.
- // Adapters will (probably) need to be sensitive to the fact that
- // the document instance changed
- // (by being life cycle listeners)
- load(inputStream, structuredModel, EncodingRule.CONTENT_BASED);
-
- // // Note: we apparently read the data (and encoding) correctly
- // // before, we just need to make sure we followed the same rule
- // as
- // // before.
- // EncodingMemento previousMemento =
- // structuredModel.getStructuredDocument().getEncodingMemento();
- // EncodingRule previousRule = previousMemento.getEncodingRule();
- // //IFile file = ResourceUtil.getFileFor(structuredModel);
- // // Note: there's opportunity here for some odd behavior, if the
- // // settings have changed from the first load to the reload.
- // But,
- // // hopefully,
- // // will result in the intended behavior.
- // Reader allTextReader =
- // getDocumentLoader().readInputStream(inputStream, previousRule);
- //
- // // TODO: avoid use of String instance
- // getDocumentLoader().reload(structuredModel.getStructuredDocument(),
- // allTextReader);
- // // and now "reset" encoding memento to keep it current with the
- // // one
- // // that was just determined.
- // structuredModel.getStructuredDocument().setEncodingMemento(getDocumentLoader().getEncodingMemento());
- // structuredModel.setDirtyState(false);
- // StructuredTextUndoManager undoMgr =
- // structuredModel.getUndoManager();
- // if (undoMgr != null) {
- // undoMgr.reset();
- // }
- }
- catch (UnsupportedEncodingException e) {
- // couldn't happen. The program has apparently
- // read the model once, and there'd be no reason the encoding
- // could not be used again.
- Logger.logException("Warning: XMLLoader::reload. This exception really should not have happened!! But will attemp to continue after dumping stack trace", e); //$NON-NLS-1$
- throw new Error("Program Error", e); //$NON-NLS-1$
- }
- catch (IOException e) {
- // couldn't happen. The program has apparently
- // read the model once, and there'd be no (common) reason it
- // couldn't be loaded again.
- Logger.logException("Warning: XMLLoader::reload. This exception really should not have happened!! But will attemp to continue after dumping stack trace", e); //$NON-NLS-1$
- throw new Error("Program Error", e); //$NON-NLS-1$
- }
- }
-
- /**
- * this work is done better elsewhere, but done here for this version to
- * reduce changes. especially since the need for it should go away once we
- * no longer need to re-use old document instance.
- */
- private void transformInstance(IStructuredDocument oldInstance, IStructuredDocument newInstance) {
- /**
- * https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4920
- *
- * JSP taglib support broken, correct by duplicating extended setup
- * information (BlockTagParser extension,
- * StructuredDocumentRegionParser extensions)
- */
- RegionParser oldParser = oldInstance.getParser();
- RegionParser newParser = newInstance.getParser().newInstance();
- // Register all of the old StructuredDocumentRegionHandlers on the new
- // parser
- if (oldParser instanceof StructuredDocumentRegionParserExtension && newParser instanceof StructuredDocumentRegionParserExtension) {
- List oldHandlers = ((StructuredDocumentRegionParserExtension) oldParser).getStructuredDocumentRegionHandlers();
- for (int i = 0; i < oldHandlers.size(); i++) {
- StructuredDocumentRegionHandler handler = ((StructuredDocumentRegionHandler) oldHandlers.get(i));
- if (handler instanceof StructuredDocumentRegionHandlerExtension) {
- /**
- * Skip the transferring here, the handler will do this
- * after everything else but the source is transferred.
- */
- }
- else {
- ((StructuredDocumentRegionParser) oldParser).removeStructuredDocumentRegionHandler(handler);
- ((StructuredDocumentRegionParser) newParser).addStructuredDocumentRegionHandler(handler);
- handler.resetNodes();
- }
- }
- }
- // Add any global BlockMarkers to the new parser
- if (oldParser instanceof BlockTagParser && newParser instanceof BlockTagParser) {
- List oldBlockMarkers = ((BlockTagParser) oldParser).getBlockMarkers();
- for (int i = 0; i < oldBlockMarkers.size(); i++) {
- BlockMarker blockMarker = ((BlockMarker) oldBlockMarkers.get(i));
- if (blockMarker.isGlobal()) {
- ((BlockTagParser) newParser).addBlockMarker(blockMarker);
- }
- }
- }
-
- ((BasicStructuredDocument) oldInstance).setParser(newParser);
-
- ((BasicStructuredDocument) oldInstance).setReParser(newInstance.getReParser().newInstance());
-
- if (newInstance.getDocumentPartitioner() instanceof StructuredTextPartitioner) {
- StructuredTextPartitioner partitioner = null;
- if (oldInstance instanceof IDocumentExtension3 && newInstance instanceof IDocumentExtension3) {
- partitioner = ((StructuredTextPartitioner) ((IDocumentExtension3) newInstance).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING));
- if (partitioner != null) {
- partitioner = (StructuredTextPartitioner) partitioner.newInstance();
- }
- ((IDocumentExtension3) oldInstance).setDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, partitioner);
- }
- if (partitioner == null) {
- partitioner = (StructuredTextPartitioner) ((StructuredTextPartitioner) newInstance.getDocumentPartitioner()).newInstance();
- oldInstance.setDocumentPartitioner(partitioner);
- }
- if (partitioner != null) {
- partitioner.connect(oldInstance);
- }
- }
-
- String existingLineDelimiter = null;
- try {
- existingLineDelimiter = newInstance.getLineDelimiter(0);
- }
- catch (BadLocationException e) {
- // if empty file, assume platform default
- // TODO: should be using user set preference, per content type?
- existingLineDelimiter = System.getProperty("line.separator"); //$NON-NLS-1$
- }
-
- oldInstance.setLineDelimiter(existingLineDelimiter); //$NON-NLS-1$);
- if (newInstance.getEncodingMemento() != null) {
- oldInstance.setEncodingMemento((EncodingMemento) newInstance.getEncodingMemento().clone());
- }
-
- /**
- * https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4920
- *
- * JSP taglib support broken, correct by duplicating extended setup
- * information (BlockTagParser extension,
- * StructuredDocumentRegionParser extensions)
- */
- if (oldParser instanceof StructuredDocumentRegionParserExtension && newParser instanceof StructuredDocumentRegionParserExtension) {
- List oldHandlers = ((StructuredDocumentRegionParserExtension) oldParser).getStructuredDocumentRegionHandlers();
- for (int i = 0; i < oldHandlers.size(); i++) {
- StructuredDocumentRegionHandler handler = ((StructuredDocumentRegionHandler) oldHandlers.get(i));
- if (handler instanceof StructuredDocumentRegionHandlerExtension) {
- StructuredDocumentRegionHandlerExtension handlerExtension = (StructuredDocumentRegionHandlerExtension) handler;
- handlerExtension.setStructuredDocument(oldInstance);
- }
- }
- }
- String holdString = newInstance.get();
- newInstance = null;
- oldInstance.set(holdString);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
deleted file mode 100644
index a5a653d835..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
+++ /dev/null
@@ -1,1517 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.DocumentChanged;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-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.AboutToBeChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
-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.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public abstract class AbstractStructuredModel implements IStructuredModel {
-
- private static final String MODEL_MANAGER_NULL = "Warning: AbstractStructuredModel::close: model manager was null during a close of a model (which should be impossible)"; //$NON-NLS-1$
-
- class DirtyStateWatcher implements IStructuredDocumentListener {
-
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
-
- // I don't think its safe to assume a new model
- // is always "fresh", so we'll leave dirty state
- // unchanged;
- // but we'll tell everyone about it.
- setDirtyState(fDirtyState);
- }
-
- public void noChange(NoChangeEvent structuredDocumentEvent) {
-
- // don't change dirty state
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
- setDirtyState(true);
- // no need to listen any more
- if (fStructuredDocument != null) {
- fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
- }
- }
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-
- setDirtyState(true);
- // no need to listen any more
- if (fStructuredDocument != null) {
- fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
- }
- }
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
- setDirtyState(true);
- // no need to listen any more
- if (fStructuredDocument != null) {
- fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
- }
- }
- }
-
- class DocumentToModelNotifier implements IStructuredDocumentListener, IModelAboutToBeChangedListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IModelAboutToBeChangedListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.events.AboutToBeChangedEvent)
- */
- public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent) {
- // If we didn't originate the change, take note we are about to
- // change based on our underlying document changing.
- // If we did originate the change, we, or client, should have
- // already called aboutToChangeModel.
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- aboutToChangeModel();
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#newModel(org.eclipse.wst.sse.core.events.NewDocumentEvent)
- */
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- // if we didn't originate the change, take note we have changed
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- changedModel();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#noChange(org.eclipse.wst.sse.core.events.NoChangeEvent)
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- // if we didn't originate the change, take note we have changed
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- changedModel();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#nodesReplaced(org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent)
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- // if we didn't originate the change, take note we have changed
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- changedModel();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionChanged(org.eclipse.wst.sse.core.events.RegionChangedEvent)
- */
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- // if we didn't originate the change, take note we have changed
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- changedModel();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionsReplaced(org.eclipse.wst.sse.core.events.RegionsReplacedEvent)
- */
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- // if we didn't originate the change, take note we have changed
- if (structuredDocumentEvent.getOriginalRequester() != this) {
- changedModel();
- }
- }
-
- }
-
- private FactoryRegistry factoryRegistry;
- private String fBaseLocation;
- boolean fDirtyState;
- DirtyStateWatcher fDirtyStateWatcher;
- DocumentToModelNotifier fDocumentToModelNotifier;
- private String fExplicitContentTypeIdentifier;
- private String fId;
-
- private LifecycleNotificationManager fLifecycleNotificationManager;
-
- private final Object fListenerLock = new byte[0];
- protected ILock fLockObject;
- // private String fLineDelimiter;
- // private Object fType;
- private IModelHandler fModelHandler;
- // issue: we should not "hold on" to model manager, can
- // easily get with StructuredModelManager.getModelManager();
- // but will need to add more null checks.
- private IModelManager fModelManager;
- private int fModelStateChanging;
- private Object[] fModelStateListeners;
- private boolean fNewState = false;
- private URIResolver fResolver;
- protected IStructuredDocument fStructuredDocument;
- /**
- * The time stamp of the underlying resource's modification date, at the
- * time this model was created, or the last time it was saved. Note: for
- * this version, this variable is not set automatically, be needs to be
- * managed by client. The FileModelProvider does this for most cases, but
- * if client do not use FileModelProvider, they must set this variable
- */
- public long fSynchronizationStamp = IResource.NULL_STAMP;
- private boolean reinitializationNeeded;
- private Object reinitializeStateData;
-
- /**
- * AbstractStructuredModel constructor comment.
- */
- public AbstractStructuredModel() {
-
- super();
- fDirtyStateWatcher = new DirtyStateWatcher();
- fDocumentToModelNotifier = new DocumentToModelNotifier();
- }
-
-
- /**
- * This method is just for getting an instance of the model manager of the
- * right Impl type, to be used "internally" for making protected calls
- * directly to the impl class.
- */
- private ModelManagerImpl _getModelManager() {
- // TODO_future: redesign so we don't need this 'Impl' version
- if (fModelManager == null) {
- fModelManager = StructuredModelManager.getModelManager();
- }
-
- return (ModelManagerImpl) fModelManager;
- }
-
- /**
- * This API allows clients to declare that they are about to make a
- * "large" change to the model. This change might be in terms of content
- * or it might be in terms of the model id or base location. Note that in
- * the case of embedded calls, notification to listeners is sent only
- * once. Note that the client who is making these changes has the
- * responsibility to restore the models state once finished with the
- * changes. See getMemento and restoreState. The method
- * isModelStateChanging can be used by a client to determine if the model
- * is already in a change sequence.
- */
- public void aboutToChangeModel() {
-
-
- // notice this is just a public avenue to our protected method
- internalAboutToBeChanged();
- }
-
-
- public void aboutToReinitializeModel() {
-
-
-
- // notice this is just a public avenue to our protected method
- fireModelAboutToBeReinitialized();
- }
-
-
- public void addModelLifecycleListener(IModelLifecycleListener listener) {
-
- synchronized (fListenerLock) {
- if (fLifecycleNotificationManager == null) {
- fLifecycleNotificationManager = new LifecycleNotificationManager();
- }
- fLifecycleNotificationManager.addListener(listener);
- }
- }
-
- public void addModelStateListener(IModelStateListener listener) {
-
- synchronized (fListenerLock) {
-
- if (!Utilities.contains(fModelStateListeners, listener)) {
- int oldSize = 0;
- if (fModelStateListeners != null) {
- // normally won't be null, but we need to be sure, for
- // first
- // time through
- oldSize = fModelStateListeners.length;
- }
- int newSize = oldSize + 1;
- Object[] newListeners = new Object[newSize];
- if (fModelStateListeners != null) {
- System.arraycopy(fModelStateListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fModelStateListeners = newListeners;
- }
- }
- }
-
- /**
- * This lock to lock the small bits of data and operations in the models
- * themselves. this lock is "shared" with document, so, eventually,
- * changes can be made safely from either side.
- *
- * @deprecated
- */
- protected final void beginLock() {
- }
-
- public void beginRecording(Object requester) {
-
- beginRecording(requester, null, null);
- }
-
- public void beginRecording(Object requester, int cursorPosition, int selectionLength) {
-
- beginRecording(requester, null, null, cursorPosition, selectionLength);
- }
-
- public void beginRecording(Object requester, String label) {
-
- beginRecording(requester, label, null);
- }
-
- public void beginRecording(Object requester, String label, int cursorPosition, int selectionLength) {
-
- beginRecording(requester, label, null, cursorPosition, selectionLength);
- }
-
- public void beginRecording(Object requester, String label, String description) {
-
- if (getUndoManager() != null)
- getUndoManager().beginRecording(requester, label, description);
- }
-
- public void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength) {
-
- if (getUndoManager() != null)
- getUndoManager().beginRecording(requester, label, description, cursorPosition, selectionLength);
- }
-
- /**
- * This API allows a client controlled way of notifying all ModelEvent
- * listners that the model has been changed. This method is a matched pair
- * to aboutToChangeModel, and *must* be called after aboutToChangeModel
- * ... or some listeners could be left waiting indefinitely for the
- * changed event. So, its suggested that changedModel always be in a
- * finally clause. Likewise, a client should never call changedModel
- * without calling aboutToChangeModel first. In the case of embedded
- * calls, the notification is just sent once.
- */
- public void changedModel() {
-
-
- // notice this is just a public avenue to our protected method
- internalModelChanged();
- // also note!
- // if we've been "changed" by a client, we might still need
- // to be re-initialized, so we'll check and handle that here.
- // Note only does this provide a solution to some "missed"
- // re-inits, in provides a built in way for clients to
- // "force" the model to handle itself, by bracketing any
- // changes with aboutToChange and changed, the model itself
- // will check. But only call re-init if all other pending
- // modelChanged states have been handled.
- if (fModelStateChanging == 0 && isReinitializationNeeded()) {
- reinit();
- }
- }
-
-
- /**
- * Based on similar method in FileDocumentProvider. It will provide what
- * the modificationStamp would be if resetSynchronzationStamp(resource)
- * were used, although for this 'compute' API, no changes to the instance
- * are made.
- */
- public long computeModificationStamp(IResource resource) {
-
-
- long modificationStamp = resource.getModificationStamp();
- IPath path = resource.getLocation();
- if (path == null) {
- return modificationStamp;
- }
- // Note: checking existence of file is a little different than
- // impl in
- // the FileDocumentProvider. See defect number 223790.
- File file = path.toFile();
- if (!file.exists()) {
- return modificationStamp;
- }
- modificationStamp = file.lastModified();
- return modificationStamp;
- }
-
-
- /**
- * Provides a copy of the model, but a new ID must be provided. The
- * principle of this copy is not to copy fields, etc., as is typically
- * done in a clone method, but to return a model with the same content in
- * the structuredDocument. Note: It is the callers responsibility to
- * setBaseLocation, listners, etc., as appropriate. Type and Encoding are
- * the only fields set by this method. If the newId provided already exist
- * in the model manager, a ResourceInUse exception is thrown.
- */
- public IStructuredModel copy(String newId) throws ResourceInUse {
-
-
- IStructuredModel newModel = null;
- // this first one should fail, if not, its treated as an error
- // If the caller wants to use an existing one, they can call
- // getExisting
- // after this failure
- newModel = getModelManager().getExistingModelForEdit(newId);
- if (newModel != null) {
- // be sure to release the reference we got "by accident" (and
- // no
- // longer need)
- newModel.releaseFromEdit();
- throw new ResourceInUse();
- }
- newModel = getModelManager().copyModelForEdit(getId(), newId);
- return newModel;
- }
-
-
- /**
- * Disable undo management.
- */
- public void disableUndoManagement() {
-
- if (getUndoManager() != null)
- getUndoManager().disableUndoManagement();
- }
-
- /**
- * Enable undo management.
- */
- public void enableUndoManagement() {
-
- if (getUndoManager() != null)
- getUndoManager().enableUndoManagement();
- }
-
- /**
- * endLock is protected only for a very special purpose. So subclasses can
- * call it to end the lock after updates have been made, but before
- * notifications are sent
- *
- * @deprecated
- */
- protected final void endLock() {
- }
-
- public void endRecording(Object requester) {
-
- if (getUndoManager() != null)
- getUndoManager().endRecording(requester);
- }
-
- public void endRecording(Object requester, int cursorPosition, int selectionLength) {
-
- if (getUndoManager() != null)
- getUndoManager().endRecording(requester, cursorPosition, selectionLength);
- }
-
- /**
- * Informs all registered model state listeners that the the model is
- * about to under go a change. This change might be in terms of contents
- * or might be in terms of the model's id or base location.
- */
- private void fireModelAboutToBeChanged() {
-
- // we must assign listeners to local variable, since the add and
- // remove listner
- // methods can change the actual instance of the listener array
- // from another thread
- if (fModelStateListeners != null) {
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- ((IModelStateListener) holdListeners[i]).modelAboutToBeChanged(this);
- }
- }
-
- }
-
- protected void fireModelAboutToBeReinitialized() {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (fModelStateListeners != null) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelAboutToBeReinitialized"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- // NOTE: trick for transition. We actual use the same
- // listeners
- // as modelState, but only send this to those that have
- // implemented ModelStateExtended.
- IModelStateListener listener = (IModelStateListener) holdListeners[i];
- listener.modelAboutToBeReinitialized(this);
- }
- }
- }
-
- private void fireModelChanged() {
- // we must assign listeners
- // to local variable, since the add
- // and remove listner
- // methods can change the actual instance of the listener
- // array from another thread
- if (fModelStateListeners != null) {
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- try {
- ((IModelStateListener) holdListeners[i]).modelChanged(this);
- }
- // its so criticial that the begin/end arrive in
- // pairs,
- // if there happends to be an error in one of the
- // modelChanged,
- // they we want to be sure rest complete ok.
- catch (Exception e) {
- Logger.logException(e);
- }
- }
-
- }
- }
-
- /**
- * Informs all registered model state listeners about a change in the
- * dirty state of the model. The dirty state is entirely about changes in
- * the content of the model (not, for example, about changes to id, or
- * base location -- see modelMoved).
- */
- protected void fireModelDirtyStateChanged(IStructuredModel element, boolean isDirty) {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (fModelStateListeners != null) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelDirtyStateChanged"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- ((IModelStateListener) holdListeners[i]).modelDirtyStateChanged(element, isDirty);
- }
- }
- }
-
- protected void fireModelReinitialized() {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (fModelStateListeners != null) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelReinitialized"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- IModelStateListener listener = (IModelStateListener) holdListeners[i];
- listener.modelReinitialized(this);
- }
- }
- }
-
- /**
- * Informs all registered model state listeners about the deletion of a
- * model's underlying resource.
- */
- protected void fireModelResourceDeleted(IStructuredModel element) {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (fModelStateListeners != null) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelResourceDeleted"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- ((IModelStateListener) holdListeners[i]).modelResourceDeleted(element);
- }
- }
- }
-
- /**
- * Informs all registered model state listeners that the resource
- * underlying a model has been moved. This is typically reflected in a
- * change to the id, baseLocation, or both.
- */
- protected void fireModelResourceMoved(IStructuredModel originalElement, IStructuredModel movedElement) {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (fModelStateListeners != null) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelResourceMoved"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Object[] holdListeners = fModelStateListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- ((IModelStateListener) holdListeners[i]).modelResourceMoved(originalElement, movedElement);
- }
- }
- }
-
- public Object getAdapter(Class adapter) {
-
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getBaseLocation() {
-
- return fBaseLocation;
- }
-
- /**
- * @see org.eclipse.wst.sse.core.internal.provisional.IStructuredModel#getContentTypeIdentifier()
- */
- public String getContentTypeIdentifier() {
- if (fExplicitContentTypeIdentifier != null)
- return fExplicitContentTypeIdentifier;
- return fModelHandler.getAssociatedContentTypeId();
- }
-
- /**
- *
- */
- public FactoryRegistry getFactoryRegistry() {
- if (factoryRegistry == null) {
- factoryRegistry = new FactoryRegistry();
- }
- return factoryRegistry;
- }
-
- /**
- * The id is the id that the model manager uses to identify this model
- *
- * @ISSUE - no one should need to know ID, so this should be default access eventually.
- * If clients believe they do need ID, be sure to let us know (open a bug).
- */
- public String getId() {
-
- return fId;
- }
-
- public abstract IndexedRegion getIndexedRegion(int offset);
-
- /**
- * Gets the contentTypeDescription.
- *
- * @return Returns a ContentTypeDescription
- */
- public IModelHandler getModelHandler() {
-
- return fModelHandler;
- }
-
-
- public IModelManager getModelManager() {
-
- return _getModelManager();
- }
-
- /**
- * This function returns the reference count of underlying model.
- */
- // TODO: try to refine the design not to use this function
- public int getReferenceCount() {
-
-
- if (getModelManager() == null)
- return 0;
- return getModelManager().getReferenceCount(getId());
- }
-
-
- /**
- * This function returns the reference count of underlying model.
- */
- // TODO: try to refine the design not to use this function
- public int getReferenceCountForEdit() {
-
-
-
- if (getModelManager() == null)
- return 0;
- return getModelManager().getReferenceCountForEdit(getId());
- }
-
-
- /**
- * This function returns the reference count of underlying model.
- */
- // TODO: try to refine the design not to use this function
- public int getReferenceCountForRead() {
-
-
-
- if (getModelManager() == null)
- return 0;
- return getModelManager().getReferenceCountForRead(getId());
- }
-
- public Object getReinitializeStateData() {
-
- return reinitializeStateData;
- }
-
-
-
- public URIResolver getResolver() {
-
- return fResolver;
- }
-
-
- public IStructuredDocument getStructuredDocument() {
-
- IStructuredDocument result = null;
- result = fStructuredDocument;
- return result;
- }
-
- /**
- * Insert the method's description here. Creation date: (9/7/2001 2:30:26
- * PM)
- *
- * @return long
- */
- public long getSynchronizationStamp() {
-
- return fSynchronizationStamp;
- }
-
- public IStructuredTextUndoManager getUndoManager() {
-
- IStructuredTextUndoManager structuredTextUndoManager = null;
- IStructuredDocument structuredDocument = getStructuredDocument();
- if (structuredDocument == null) {
- structuredTextUndoManager = null;
- }
- else {
- structuredTextUndoManager = structuredDocument.getUndoManager();
- }
- return structuredTextUndoManager;
- }
-
- public void initId(String id) {
- fId = id;
- }
-
- private final Object STATE_LOCK = new Object();
-
- final protected void internalAboutToBeChanged() {
- int state = 0;
- // we always increment counter, for every request (so *must* receive
- // corresponding number of 'changedModel' requests)
- synchronized (STATE_LOCK) {
- state = fModelStateChanging++;
- }
-
- // notice we only fire this event if we are not
- // already in a model state changing sequence
- if (state == 0) {
-
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelAboutToBeChanged"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- try {
- fireModelAboutToBeChanged();
- }
- catch (Exception e) {
- Logger.logException("Exception while notifying model state listers of about to change", e); //$NON-NLS-1$
- }
-
- }
-
- }
-
- /**
- * Informs all registered model state listeners that an impending change
- * is now complete. This method must only be called by 'modelChanged'
- * since it keeps track of counts.
- */
- final protected void internalModelChanged() {
- int state = 0;
- // always decrement
- synchronized (STATE_LOCK) {
- state = --fModelStateChanging;
- }
-
- // Check integrity
- // to be less than zero is a programming error,
- // but we'll reset to zero
- // and try to continue
- if (state < 0) {
- state = 0;
- throw new IllegalStateException("Program Error: modelStateChanging was less than zero"); //$NON-NLS-1$
- }
-
-
- // We only fire this event if all pending requests are done.
- // That is, if we've received the same number of modelChanged as
- // we have aboutToChangeModel.
- if (state == 0) {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelChanged"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- fireModelChanged();
- }
- }
-
- public boolean isDirty() {
-
- return fDirtyState;
- }
-
- /**
- * This method has very special purpose, its used in subclass
- * 'changedModel' to know when to do "ending" sorts of things, right
- * before a call to super.ChangedModel would in deed put the model in
- * 'end' state. Put another way, at the beginning of the subclasses's
- * changedModel, the isModelStateChanging is true, but at end, it will be
- * false. So, this method allows a small "peek ahead".
- */
- protected boolean isModelChangeStateOnVergeOfEnding() {
-
-
- return fModelStateChanging == 1;
- }
-
- /**
- * This method can be called to determine if the model is within a
- * "aboutToChange" and "changed" sequence.
- */
- public boolean isModelStateChanging() {
-
-
- return fModelStateChanging > 0;
- }
-
- public boolean isNew() {
-
- return fNewState;
- }
-
- public boolean isReinitializationNeeded() {
-
- return reinitializationNeeded;
- }
-
- public boolean isSaveNeeded() {
-
-
- if (!isSharedForEdit())
- return isDirty();
- else
- return false;
- }
-
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isShared() {
- if (getModelManager() == null)
- return false;
- return getModelManager().isShared(getId());
- }
-
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isSharedForEdit() {
-
-
- if (getModelManager() == null)
- return false;
- return getModelManager().isSharedForEdit(getId());
- }
-
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isSharedForRead() {
-
-
- if (getModelManager() == null)
- return false;
- return getModelManager().isSharedForRead(getId());
- }
-
-
- public void modelReinitialized() {
-
-
- // notice this is just a public avenue to our protected method
- fireModelReinitialized();
- }
-
- public IStructuredModel newInstance() throws IOException {
-
- IStructuredModel newModel = null;
- // we delegate to the model manager, so loader, etc., can be
- // used.
- newModel = getModelManager().createNewInstance(this);
- return newModel;
- }
-
- public IStructuredModel reinit() {
-
-
- IStructuredModel result = null;
- if (fModelStateChanging == 0) {
- try {
- aboutToChangeModel();
- aboutToReinitializeModel();
- result = _getModelManager().reinitialize(this);
- }
- finally {
- setReinitializeNeeded(false);
- setReinitializeStateData(null);
- modelReinitialized();
- changedModel();
- }
- }
- else {
- if (Logger.DEBUG_MODELSTATE) {
- Logger.log(Logger.INFO, "indeed!!!"); //$NON-NLS-1$
- }
- }
- return result;
- }
-
-
- /**
- * This function allows the model to free up any resources it might be
- * using. In particular, itself, as stored in the IModelManager.
- */
- public void releaseFromEdit() {
-
-
- if (getModelManager() == null) {
- throw new IllegalStateException(MODEL_MANAGER_NULL); //$NON-NLS-1$
- }
- else {
- /*
- * Be sure to check the shared state before releasing. (Since
- * isShared assumes a count of 1 means not shared ... and we want
- * our '1' to be that one.) The problem, of course, is that
- * between pre-cycle notification and post-release notification,
- * the model could once again have become shared, rendering the
- * release notification incorrect.
- */
- boolean isShared = isShared();
-
- if (!isShared) {
- signalPreLifeCycleEventRelease(this);
- }
-
- _getModelManager().releaseFromEdit(this);
- if (!isShared) {
- signalPostLifeCycleListenerRelease(this);
- }
- }
-
- }
-
- /**
- * This function allows the model to free up any resources it might be
- * using. In particular, itself, as stored in the IModelManager.
- */
- public void releaseFromRead() {
-
- if (getModelManager() == null) {
- throw new IllegalStateException(MODEL_MANAGER_NULL); //$NON-NLS-1$
- }
- else {
- /*
- * Be sure to check the shared state before releasing. (Since
- * isShared assumes a count of 1 means not shared ... and we want
- * our '1' to be that one.) The problem, of course, is that
- * between pre-cycle notification and post-release notification,
- * the model could once again have become shared, rendering the
- * release notification incorrect.
- */
- boolean isShared = isShared();
-
- if (!isShared) {
- signalPreLifeCycleEventRelease(this);
- }
-
- _getModelManager().releaseFromRead(this);
-
- if (!isShared) {
- signalPostLifeCycleListenerRelease(this);
- }
- }
- }
-
-
- /**
- * This function replenishes the model with the resource without saving
- * any possible changes. It is used when one editor may be closing, and
- * specifially says not to save the model, but another "display" of the
- * model still needs to hang on to some model, so needs a fresh copy.
- */
- public IStructuredModel reload(InputStream inputStream) throws IOException {
- IStructuredModel result = null;
- try {
- aboutToChangeModel();
- result = _getModelManager().reloadModel(getId(), inputStream);
- }
- catch (UnsupportedEncodingException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- finally {
- changedModel();
- }
- return result;
- }
-
- public void removeModelLifecycleListener(IModelLifecycleListener listener) {
-
- // if manager is null, then none have been added, so
- // no need to remove any
- if (fLifecycleNotificationManager == null)
- return;
- synchronized (fListenerLock) {
- fLifecycleNotificationManager.removeListener(listener);
- }
- }
-
-
- public void removeModelStateListener(IModelStateListener listener) {
-
- if (listener == null)
- return;
- if (fModelStateListeners == null)
- return;
- // if its not in the listeners, we'll ignore the request
- synchronized (fListenerLock) {
- if (Utilities.contains(fModelStateListeners, listener)) {
- int oldSize = fModelStateListeners.length;
- int newSize = oldSize - 1;
- Object[] newListeners = new Object[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fModelStateListeners[i] == listener) { // ignore
- }
- else {
- // copy old to new if its not the one we are
- // removing
- newListeners[index++] = fModelStateListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the
- // old
- // one
- fModelStateListeners = newListeners;
- }
- }
- }
-
-
- /**
- * A method that modifies the model's synchronization stamp to match the
- * resource. Turns out there's several ways of doing it, so this ensures a
- * common algorithm.
- */
- public void resetSynchronizationStamp(IResource resource) {
-
-
- setSynchronizationStamp(computeModificationStamp(resource));
- }
-
-
- /**
- * This API allows a client to initiate notification to all interested
- * parties that a model's underlying resource has been deleted.
- */
- public void resourceDeleted() {
-
-
- // notice this is just a public avenue to our protected method
- fireModelResourceDeleted(this);
- }
-
-
- /**
- * This method allows a model client to initiate notification to all
- * interested parties that a model's underlying resource location has
- * changed. Note: we assume caller has already changed baseLocation, Id,
- * etc., since its really up to the client to determine what's "new" about
- * a moved model. Caution: 'this' and 'newModel' may be the same object.
- * This is the case for current working with FileModelProvider, but have
- * left the dual argument for future possibilities.
- */
- public void resourceMoved(IStructuredModel newModel) {
-
-
- // notice this is just a public avenue to our protected method
- fireModelResourceMoved(this, newModel);
- }
-
-
- public void save() throws UnsupportedEncodingException, IOException, CoreException {
-
- int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
- try {
- String stringId = getId();
- _getModelManager().saveModel(stringId, EncodingRule.CONTENT_BASED);
- }
-
- finally {
- // we put end notification in finally block, so even if
- // error occurs during save, listeners are still notified,
- // since their code could depend on receiving, to clean up
- // some state, or coordinate other resources.
- type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
-
- public void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
- int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
- try {
- String stringId = getId();
- _getModelManager().saveModel(stringId, encodingRule);
- }
- finally {
- // we put end notification in finally block, so even if
- // error occurs during save, listeners are still notified,
- // since their code could depend on receiving, to clean up
- // some state, or coordinate other resources.
- type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
-
- public void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException {
-
- int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
- try {
- String stringId = getId();
- _getModelManager().saveModel(iFile, stringId, EncodingRule.CONTENT_BASED);
- }
-
- finally {
- // we put end notification in finally block, so even if
- // error occurs during save, listeners are still notified,
- // since their code could depend on receiving, to clean up
- // some state, or coordinate other resources.
- type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
-
- public void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
- int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
- try {
- String stringId = getId();
- _getModelManager().saveModel(iFile, stringId, encodingRule);
- }
- finally {
- // we put end notificatioon in finally block, so even if
- // error occurs during save, listeners are still notified,
- // since their code could depend on receiving, to clean up
- // some state, or coordinate other resources.
- type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
-
- public void save(OutputStream outputStream) throws UnsupportedEncodingException, CoreException, IOException {
-
- int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
- try {
- String stringId = getId();
- _getModelManager().saveModel(stringId, outputStream, EncodingRule.CONTENT_BASED);
- }
-
- finally {
- // we put end notification in finally block, so even if
- // error occurs during save, listeners are still notified,
- // since their code could depend on receiving, to clean up
- // some state, or coordinate other resources.
- type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
-
- /**
- * This attribute is typically used to denote the model's underlying
- * resource.
- */
- public void setBaseLocation(java.lang.String newBaseLocation) {
- fBaseLocation = newBaseLocation;
- if (fResolver != null) {
- fResolver.setFileBaseLocation(newBaseLocation);
- }
- }
-
- public void setContentTypeIdentifier(String contentTypeIdentifier) {
- fExplicitContentTypeIdentifier = contentTypeIdentifier;
- }
-
- /**
- *
- */
- public void setDirtyState(boolean dirtyState) {
-
- // no need to process (set or fire event), if same value
- if (fDirtyState != dirtyState) {
- // pre-change notification
- int type = ModelLifecycleEvent.MODEL_DIRTY_STATE | ModelLifecycleEvent.PRE_EVENT;
- ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
-
-
- // the actual change
- fDirtyState = dirtyState;
-
- // old notification
- // TODO: C3 remove old notification
- if (fDirtyState == false) {
- // if we are being set to not dirty (such as just been saved)
- // then we need to start listening for changes
- // again to know when to set state to true;
- getStructuredDocument().addDocumentChangedListener(fDirtyStateWatcher);
- }
- fireModelDirtyStateChanged(this, dirtyState);
-
-
- // post change notification
- type = ModelLifecycleEvent.MODEL_DIRTY_STATE | ModelLifecycleEvent.POST_EVENT;
- modelLifecycleEvent = new ModelLifecycleEvent(this, type);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
- /**
- * @deprecated - will likely be deprecated soon, in favor of direct 'adds'
- * ... but takes some redesign.
- */
- public void setFactoryRegistry(FactoryRegistry factoryRegistry) {
- this.factoryRegistry = factoryRegistry;
- }
-
- /**
- * The id is the id that the model manager uses to identify this model. If
- * it is being set here, it means the model manger is already managing the
- * model with another id, so we have to keep it in sync. This method calls
- * notifies listners, if they haven't been notified already, that a "model
- * state change" is about to occur.
- */
- public void setId(String newId) throws ResourceInUse {
-
-
- // It makes no sense, I don't think, to have an id of null, so
- // we'll throw an illegal argument exception if someone trys. Note:
- // the IModelManager could not manage a model with an id of null,
- // since it uses hashtables, and you can't have a null id for a
- // hashtable.
- if (newId == null)
- throw new IllegalArgumentException(SSECoreMessages.A_model_s_id_can_not_be_nu_EXC_); //$NON-NLS-1$ = "A model's id can not be null"
- // To guard against throwing a spurious ResourceInUse exception,
- // which can occur when two pieces of code both want to change the id,
- // so the second request is spurious, we'll ignore any requests that
- // attempt to change the id to what it already is ... note, we use
- // 'equals', not identity ('==') so that things like
- // strings can be used. This is the same criteria that ids are
- // found in model manager -- well, actually, I just checked, and for
- // the hashtable impl, the criteria uses .equals AND the condition
- // that the hash values be identical (I'm assuming this is always
- // true, if equals is true, for now, I'm not sure
- // we can assume that hashtable will always be used, but in
- // general, should match.)
- //
- if (newId.equals(fId))
- return;
- // we must guard against reassigning an id to one that we already
- // are managing.
- if (getModelManager() != null) {
- boolean inUse = ((ModelManagerImpl)getModelManager()).isIdInUse(newId);
- if (inUse) {
- throw new ResourceInUse();
- }
- }
- try {
- // normal code path
- aboutToChangeModel();
- String oldId = fId;
- fId = newId;
- if (getModelManager() != null) {
- // if managed and the id has changed, notify to
- // IModelManager
- // TODO: try to refine the design not to do that
- if (oldId != null && newId != null && !newId.equals(oldId)) {
- getModelManager().moveModel(oldId, newId);
- }
- }
- }
- finally {
- // make sure this finally is only executed if 'about to Change
- // model' has
- // been executed.
- changedModel();
- }
- }
-
- /**
- * Sets the contentTypeDescription.
- *
- * @param contentTypeDescription
- * The contentTypeDescription to set
- */
- public void setModelHandler(IModelHandler modelHandler) {
-
- // no need to fire events if modelHandler has been null
- // for this model --
- // this is an attempt at initialization optimization and may need
- // to change in future.
- boolean trueChange = false;
- if (fModelHandler != null)
- trueChange = true;
- if (trueChange) {
- internalAboutToBeChanged();
- }
- fModelHandler = modelHandler;
- if (trueChange) {
- internalModelChanged();
- }
- }
-
-
-
- public void setModelManager(IModelManager newModelManager) {
-
- fModelManager = newModelManager;
- }
-
- /**
- *
- */
- public void setNewState(boolean newState) {
-
- fNewState = newState;
- }
-
- /**
- * Sets a "flag" that reinitialization is needed.
- */
- public void setReinitializeNeeded(boolean needed) {
-
- reinitializationNeeded = needed;
- }
-
- /**
- * Holds any data that the reinit procedure might find useful in
- * reinitializing the model. This is handy, since the reinitialization may
- * not take place at once, and some "old" data may be needed to properly
- * undo previous settings. Note: the parameter was intentionally made to
- * be of type 'Object' so different models can use in different ways.
- */
- public void setReinitializeStateData(Object object) {
-
- reinitializeStateData = object;
- }
-
-
- public void setResolver(URIResolver newResolver) {
-
- fResolver = newResolver;
- }
-
-
- public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
- boolean lifeCycleNotification = false;
- if (fStructuredDocument != null) {
- fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
- fStructuredDocument.removeDocumentAboutToChangeListener(fDocumentToModelNotifier);
- fStructuredDocument.removeDocumentChangedListener(fDocumentToModelNotifier);
- // prechange notification
- lifeCycleNotification = true;
- ModelLifecycleEvent modelLifecycleEvent = new DocumentChanged(ModelLifecycleEvent.PRE_EVENT, this, fStructuredDocument, newStructuredDocument);
- signalLifecycleEvent(modelLifecycleEvent);
- }
-
- // hold for life cycle notification
- IStructuredDocument previousDocument = fStructuredDocument;
- // the actual change
- fStructuredDocument = newStructuredDocument;
-
-
- // at the super class level, we'll listen for structuredDocument
- // changes
- // so we can set our dirty state flag
- if (fStructuredDocument != null) {
- fStructuredDocument.addDocumentChangedListener(fDirtyStateWatcher);
- fStructuredDocument.addDocumentAboutToChangeListener(fDocumentToModelNotifier);
- fStructuredDocument.addDocumentChangedListener(fDocumentToModelNotifier);
- }
-
- if (lifeCycleNotification) {
- // post change notification
- ModelLifecycleEvent modelLifecycleEvent = new DocumentChanged(ModelLifecycleEvent.POST_EVENT, this, previousDocument, newStructuredDocument);
- signalLifecycleEvent(modelLifecycleEvent);
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (9/7/2001 2:30:26
- * PM)
- *
- * @param newSynchronizationStamp
- * long
- */
- protected void setSynchronizationStamp(long newSynchronizationStamp) {
-
- fSynchronizationStamp = newSynchronizationStamp;
- }
-
- public void setUndoManager(IStructuredTextUndoManager undoManager) {
-
- IStructuredDocument structuredDocument = getStructuredDocument();
- if (structuredDocument == null) {
- throw new IllegalStateException("document was null when undo manager set on model"); //$NON-NLS-1$
- }
- structuredDocument.setUndoManager(undoManager);
- }
-
- /**
- * To be called only by "friendly" classes, such as ModelManager, and
- * subclasses.
- */
- void signalLifecycleEvent(ModelLifecycleEvent event) {
- if (fLifecycleNotificationManager == null)
- return;
- fLifecycleNotificationManager.signalLifecycleEvent(event);
- }
-
- private void signalPostLifeCycleListenerRelease(IStructuredModel structuredModel) {
- int type = ModelLifecycleEvent.MODEL_RELEASED | ModelLifecycleEvent.POST_EVENT;
- // what's wrong with this design that a cast is needed here!?
- ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
- ((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
- }
-
- private void signalPreLifeCycleEventRelease(IStructuredModel structuredModel) {
- int type = ModelLifecycleEvent.MODEL_RELEASED | ModelLifecycleEvent.PRE_EVENT;
- // what's wrong with this design that a cast is needed here!?
- ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
- ((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java
deleted file mode 100644
index d030390362..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java
+++ /dev/null
@@ -1,179 +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.sse.core.internal.model;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-/**
- * This class simply maintains the list of factories and returns singleton
- * instances of them. Some "built in" types are automatically created form
- * FactoryConfig, if not found registerd, but normally clients can/should
- * register their own factories.
- *
- * Not intended for clients to subclass or instantiate.
- *
- */
-public final class FactoryRegistry {
-
- private List factories;
-
- /**
- * intentionally default access
- */
- FactoryRegistry() {
- super();
-
- }
-
- private List _getFactories() {
-
- if (factories == null) {
- // may need to use java.util.Collections.synchronizedList() if
- // syncronization becomes
- // necessary (and if so, remember to synchronize on factories)
- factories = new ArrayList();
- }
- return factories;
-
- }
-
- public void addFactory(INodeAdapterFactory factory) {
- _getFactories().add(factory);
- }
-
- public void clearFactories() {
- factories.clear();
- }
-
- /*
- * @see FactoryRegistry#contains(Object)
- */
- public boolean contains(Object type) {
- boolean result = false;
- // note: we're not using cloned list, so strictly speaking
- // is not thread safe.
- List internalList = _getFactories();
- for (int i = 0; i < internalList.size(); i++) {
- INodeAdapterFactory factory = (INodeAdapterFactory) internalList.get(i);
- if (factory.isFactoryForType(type)) {
- result = true;
- break;
- }
- }
- return result;
- }
-
- /**
- * Returns a shallow copy of the list of factories in the registry. Note:
- * this can not be used to add/remove factories. Its primarily provided
- * for those few cases where a list of factories must be copied from one
- * model and added to another.
- */
- public List getFactories() {
- // note: for object integrity, we don't let anyone get
- // our main list (so they have to add through addFactory),
- // but we will return a shallow "cloned" list.
- List factoryList = new ArrayList(_getFactories());
- return factoryList;
- }
-
- /**
- * This method is a not a pure resistry. Factories retrieved based on
- * their response to "isFactoryForType(type)". Note that if there is more
- * than one factory that can answer 'true' that the most recently added
- * factory is used.
- */
- public INodeAdapterFactory getFactoryFor(Object type) {
-
- INodeAdapterFactory result = null;
- if (factories == null)
- return null;
- int listSize = factories.size();
- for (int i = listSize - 1; i >= 0; i--) {
- // It is the adapter factories responsibility to answer
- // isFactoryForType so it gets choosen.
- // Notice we are going through the list backwards to get the
- // factory added last.
- INodeAdapterFactory a = (INodeAdapterFactory) factories.get(i);
- if (a.isFactoryForType(type)) {
- result = a;
- break;
- }
- }
- return result;
-
- }
-
- /**
- *
- */
- public void release() {
- // modified to work on copy of list, for V5PTF1
- // send release to local copy of list
- // of factories, since some factories, during
- // their release function, may remove
- // themselves from the registry.
- List localList = getFactories();
- for (int i = 0; i < localList.size(); i++) {
- INodeAdapterFactory a = (INodeAdapterFactory) localList.get(i);
- // To help bullet proof code, we'll catch and log
- // any messages thrown by factories during release,
- // but we'll attempt to keep going.
- // In nearly all cases, though, such errors are
- // severe for product/client, and need to be fixed.
- try {
- a.release();
- }
- catch (Exception e) {
- Logger.logException("Program problem releasing factory" + a, e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Removes a factory if it can be retrieved by getFactoryFor(type). If
- * there is more than one, all are removed. If there is none, the call
- * simply returns (that is, it is not considered an error).
- */
- public void removeFactoriesFor(java.lang.Object type) {
- if (factories != null) {
- int listSize = factories.size();
- // we'll go backwards through list, since we're removing, so
- // 'size' change won't matter.
- // Note: I'm assuming other items in the collection do not change
- // position
- // simply because another was removed.
- for (int i = listSize - 1; i >= 0; i--) {
- // It is the adapter factories responsibility to answer
- // isFactoryForType so it gets choosen.
- INodeAdapterFactory a = (INodeAdapterFactory) factories.get(i);
- if (a.isFactoryForType(type)) {
- factories.remove(a);
- }
- }
- }
- }
-
- public void removeFactory(INodeAdapterFactory factory) {
- _getFactories().remove(factory);
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java
deleted file mode 100644
index adcf010f0a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java
+++ /dev/null
@@ -1,119 +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.sse.core.internal.model;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * For "internal use" only by AbstractStructuredModel
- */
-
-class LifecycleNotificationManager {
- private Object[] fListeners;
-
- LifecycleNotificationManager() {
- super();
- }
-
- /**
- * Adds a new copy of the given listener to the list of Life Cycle
- * Listeners.
- *
- * Multiple copies of the same listener are allowed. This is required to
- * support threaded listener management properly and for model-driven move
- * to work. For example, two adds and a single remove should result in the
- * listener still listening for events.
- *
- * @param listener
- */
- void addListener(IModelLifecycleListener listener) {
- if (Logger.DEBUG && Utilities.contains(fListeners, listener)) {
- Logger.log(Logger.WARNING, "IModelLifecycleListener " + listener + " listening more than once"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- int oldSize = 0;
- if (fListeners != null) {
- // normally won't be null, but we need to be sure, for first
- // time through
- oldSize = fListeners.length;
- }
- int newSize = oldSize + 1;
- Object[] newListeners = new Object[newSize];
- if (fListeners != null) {
- System.arraycopy(fListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fListeners = newListeners;
- }
-
- /**
- * Removes a single copy of the given listener from the list of Life Cycle
- * Listeners.
- *
- * @param listener
- */
- void removeListener(IModelLifecycleListener listener) {
- if (Utilities.contains(fListeners, listener)) {
- // if its not in the listeners, we'll ignore the request
- int oldSize = fListeners.length;
- int newSize = oldSize - 1;
- Object[] newListeners = new Object[newSize];
- int index = 0;
- boolean removedOnce = false;
- for (int i = 0; i < oldSize; i++) {
- if (fListeners[i] == listener && !removedOnce) {
- // ignore on the first match
- removedOnce = true;
- } else {
- // copy old to new if it's not the one we are removing
- newListeners[index++] = fListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the old
- // one
- fListeners = newListeners;
- }
- if (Logger.DEBUG && Utilities.contains(fListeners, listener)) {
- Logger.log(Logger.WARNING, "IModelLifecycleListener " + listener + " removed once but still listening"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- void signalLifecycleEvent(ModelLifecycleEvent event) {
- if (Logger.DEBUG_LIFECYCLE) {
- Logger.log(Logger.INFO, "ModelLifecycleEvent fired for " + event.getModel().getId() + ": " + event.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("ModelLifecycleEvent fired for " + event.getModel().getId() + ": " + event.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // We must assign listeners to local variable, since the add and
- // remove listener methods can change the actual instance of the
- // listener array from another thread
- if (fListeners != null) {
- Object[] holdListeners = fListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- IModelLifecycleListener listener = (IModelLifecycleListener) holdListeners[i];
- // only one type of listener for now ... this could become
- // more complex
- if ((event.getInternalType() & ModelLifecycleEvent.PRE_EVENT) == ModelLifecycleEvent.PRE_EVENT) {
- listener.processPreModelEvent(event);
- }
- if ((event.getInternalType() & ModelLifecycleEvent.POST_EVENT) == ModelLifecycleEvent.POST_EVENT) {
- listener.processPostModelEvent(event);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java
deleted file mode 100644
index def66d069d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java
+++ /dev/null
@@ -1,117 +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.sse.core.internal.model;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * This is an early version of a class that may change over the next few
- * milestones.
- */
-
-
-public class ModelLifecycleEvent {
-
-
- // this list is for "public" consumption
- public static final int MODEL_SAVED = 0x0001;
- public static final int MODEL_RELEASED = 0x00002;
- public static final int MODEL_DOCUMENT_CHANGED = 0x0003;
- public static final int MODEL_DIRTY_STATE = 0x0004;
- public static final int MODEL_REVERT= 0x0005;
-
- // TODO: finish support for these
- // following not implemented yet
- public static final int MODEL_REINITIALIZED = 0x0006;
- //public static final int ADAPTERS_NOTIFIED = 0x0007;
- //public static final int MODEL_RESOURCE_MOVED = 0x0008;
- //public static final int MODEL_RESOURCE_DELETED = 0x0009;
-
- // This list (upper two bytes) is for only internal mechanisms and
- // subclasses
- // For simplicity they are "masked out" when client calls getType()
- protected static final int PRE_EVENT = 0x0100;
- private final static int MASK = 0x00FF;
- protected static final int POST_EVENT = 0x0200;
-
-
- private IStructuredModel fModel;
- private int fType;
-
- public ModelLifecycleEvent() {
- super();
- }
-
- public ModelLifecycleEvent(int type) {
- this();
- fType = type;
- }
-
- public ModelLifecycleEvent(IStructuredModel structuredModel, int type) {
- this(type);
- fModel = structuredModel;
- }
-
- private String debugString(int type) {
- String result = null;
- switch (type & MASK) {
- case MODEL_SAVED :
- result = "MODEL_SAVED"; //$NON-NLS-1$
- break;
- case MODEL_RELEASED :
- result = "MODEL_RELEASED"; //$NON-NLS-1$
- break;
- case MODEL_DOCUMENT_CHANGED :
- result = "MODEL_DOCUMENT_CHANGED"; //$NON-NLS-1$
- break;
- case MODEL_DIRTY_STATE :
- result = "MODEL_DIRTY_STATE"; //$NON-NLS-1$
- break;
- /*
- * case MODEL_REINITIALIZED : result = "MODEL_REINITIALIZED";
- * break; case MODEL_RELOADED : result = "MODEL_RELOADED"; break;
- * case ADAPTERS_NOTIFIED : result = "ADAPTERS_NOTIFIED"; break;
- * case MODEL_RESOURCE_MOVED : result = "MODEL_RESOURCE_MOVED";
- * break; case MODEL_RESOURCE_DELETED : result =
- * "MODEL_RESOURCE_DELETED"; break;
- */
- default :
- throw new IllegalStateException("ModelLifecycleEvent did not have valid type"); //$NON-NLS-1$
- }
- return result;
- }
-
- protected int getInternalType() {
-
- return fType;
- }
-
- public IStructuredModel getModel() {
-
- return fModel;
- }
-
- public int getType() {
-
- // for now, we'll mask type to "public" ones this easy
- // way ... but I know there must be a better way
- return fType & MASK;
- }
-
- public String toString() {
- String result = null;
- result = "ModelLifecycleEvent: " + debugString(fType); //$NON-NLS-1$
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
deleted file mode 100644
index 82c1854175..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
+++ /dev/null
@@ -1,2160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * * Frank Zigler/Web Performance, Inc. - 288196 - Deadlock in ModelManagerImpl after IOException
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.NullMemento;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.ContentBasedPreferenceGateway;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedOutputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-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.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-/**
- * <p>Not intended to be subclassed, referenced or instantiated by clients.
- * Clients should obtain an instance of the IModelManager interface through
- * {@link StructuredModelManager#getModelManager()}.</p>
- *
- * <p>This class is responsible for creating, retrieving, and caching
- * StructuredModels It retrieves the cached objects by an id which is
- * typically a String representing the resources URI. Note: Its important that
- * all clients that share a resource do so using <b>identical </b>
- * identifiers, or else different instances will be created and retrieved,
- * even if they all technically point to the same resource on the file system.
- * This class also provides a convenient place to register Model Loaders and
- * Dumpers based on 'type'.</p>
- */
-public class ModelManagerImpl implements IModelManager {
-
-
-
- static class ReadEditType {
- ReadEditType(String type) {
- }
- }
-
- class SharedObject {
- int referenceCountForEdit;
- int referenceCountForRead;
- volatile IStructuredModel theSharedModel;
- final ILock LOAD_LOCK = Job.getJobManager().newLock();
- volatile boolean initializing = true;
- volatile boolean doWait = true;
- // The field 'id' is only meant for debug
- final String id;
-
- SharedObject(String id) {
- this.id=id;
- // be aware, this lock will leak and cause the deadlock detector to be horrible if we never release it
- LOAD_LOCK.acquire();
- }
-
- /**
- * Waits until this shared object has been attempted to be loaded. The
- * load is "attempted" because not all loads result in a model. However,
- * upon leaving this method, theShareModel variable is up-to-date.
- */
- public void waitForLoadAttempt() {
- final boolean allowInterrupt = PrefUtil.ALLOW_INTERRUPT_WAITING_THREAD;
- final long timeLimit = (PrefUtil.WAIT_DELAY==0) ? Long.MAX_VALUE : PrefUtil.now() + PrefUtil.WAIT_DELAY;
- final Job current = Job.getJobManager().currentJob();
- boolean interrupted = false;
- try {
- while (initializing) {
- if (current!=null) {
- current.yieldRule(null);
- }
- try {
- loop();
- } catch (InterruptedException e) {
- if (allowInterrupt) {
- throw new OperationCanceledException("Waiting thread interrupted while waiting for model id: "+id + " to load");
- } else {
- interrupted=true;
- }
- }
- if (PrefUtil.now() >= timeLimit )
- throw new OperationCanceledException("Waiting thread timeout exceeded while waiting for model id: "+id + " to load");
- }
- }
- finally {
- if (interrupted) {
- Thread.currentThread().interrupt();
- }
- }
- }
-
- private void loop() throws InterruptedException {
- if (initializing) {
- if (LOAD_LOCK.acquire(PrefUtil.WAIT_INTERVAL_MS)) {
- // if we got the lock, but initializing is still not true the deadlock detector gave us
- // the lock and caused reentrancy into this critical section. This is invalid and the
- // sign of a cyclical load attempt. In this case, we through an
- // OperationCanceledException in lew of entering a spin-loop.
- if (initializing) {
- LOAD_LOCK.release();
- throw new OperationCanceledException("Aborted cyclic load attempt for model with id: "+ id );
- } else {
- LOAD_LOCK.release();
- }
- }
- }
- }
-
- /**
- * Flags this model as loaded. All waiting methods on
- * {@link #waitForLoadAttempt()} will proceed after this method returns.
- */
- public void setLoaded() {
- initializing = false;
- LOAD_LOCK.release();
- }
- }
-
- private Exception debugException = null;
-
- /**
- * Our singleton instance
- */
- private static ModelManagerImpl instance;
- private final static int READ_BUFFER_SIZE = 4096;
-
- /**
- * Not to be called by clients, will be made restricted access.
- *
- * @return
- */
- public synchronized static IModelManager getInstance() {
-
- if (instance == null) {
- instance = new ModelManagerImpl();
- }
- return instance;
- }
-
- /**
- * Our cache of managed objects
- */
- private Map fManagedObjects;
-
- private ModelHandlerRegistry fModelHandlerRegistry;
- private final ReadEditType READ = new ReadEditType("read"); //$NON-NLS-1$
- private final ReadEditType EDIT = new ReadEditType("edit"); //$NON-NLS-1$
-
- private final ILock SYNC = Job.getJobManager().newLock();
- /**
- * Intentionally default access only.
- *
- */
- ModelManagerImpl() {
- super();
- fManagedObjects = new HashMap();
- // To prevent deadlocks: always acquire multiple locks in this order: SYNC, sharedObject.
- // DO NOT acquire a SYNC within a sharedObject lock, unless you already own the SYNC lock
- // Tip: Try to hold the smallest number of locks you can
- }
-
- private IStructuredModel _commonCreateModel(IFile file, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, EncodingRule encodingRule) throws IOException,CoreException {
- SharedObject sharedObject = null;
-
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
-
- while(true) {
- if (sharedObject!=null) {
- sharedObject.waitForLoadAttempt();
- }
- SYNC.acquire();
- // we know this object's model has passed the load, however, we don't know
- // it's reference count status. It might have already been disposed. Or it could have
- // been disposed and a concurrent thread has already begun loading it, in which case
- // we should use the sharedobject they are loading.
- // NOTE: This pattern is applied 3 times in this class, but only doc'd once. The logic is
- // exactly the same.
- SharedObject testObject = (SharedObject) fManagedObjects.get(id);
- if (testObject==null) {
- // null means it's been disposed, we need to do the work to reload it.
- sharedObject = new SharedObject(id);
- fManagedObjects.put(id, sharedObject);
- SYNC.release();
- _doCommonCreateModel(file, id, handler, resolver, rwType, encodingRule,
- sharedObject);
- break;
- } else if (sharedObject == testObject) {
- // if nothing happened, just increment the could and return the shared model
- synchronized(sharedObject) {
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, rwType);
- }
- }
- SYNC.release();
- break;
- } else {
- // sharedObject != testObject which means the object we were waiting on has been disposed
- // a replacement has already been placed in the managedObjects table. Through away our
- // stale sharedObject and continue on with the one we got from the queue. Note: We don't know its
- // state, so continue the waitForLoad-check loop.
- SYNC.release();
- sharedObject = testObject;
- }
- }
-
- // we expect to always return something
- if (sharedObject == null) {
- debugException = new Exception("instance only for stack trace"); //$NON-NLS-1$
- Logger.logException("Program Error: no model recorded for id " + id, debugException); //$NON-NLS-1$
- }
-
- // note: clients must call release for each time they call get.
- return sharedObject==null ? null : sharedObject.theSharedModel;
- }
-
- private void _decrCount(SharedObject sharedObject, ReadEditType type) {
- if (type == READ) {
- sharedObject.referenceCountForRead--;
- FileBufferModelManager.getInstance().disconnect(sharedObject.theSharedModel.getStructuredDocument());
- }
- else if (type == EDIT) {
- sharedObject.referenceCountForEdit--;
- FileBufferModelManager.getInstance().disconnect(sharedObject.theSharedModel.getStructuredDocument());
- }
- else
- throw new IllegalArgumentException();
- }
-
- private void _doCommonCreateModel(IFile file, String id, IModelHandler handler,
- URIResolver resolver, ReadEditType rwType, EncodingRule encodingRule,
- SharedObject sharedObject) throws CoreException, IOException {
- // XXX: Does not integrate with FileBuffers
- boolean doRemove = true;
- try {
- synchronized(sharedObject) {
- InputStream inputStream = null;
- IStructuredModel model = null;
- try {
- model = _commonCreateModel(id, handler, resolver);
- IModelLoader loader = handler.getModelLoader();
- inputStream = Utilities.getMarkSupportedStream(file.getContents(true));
- loader.load(Utilities.getMarkSupportedStream(inputStream), model, encodingRule);
- }
- catch (ResourceInUse e) {
- // impossible, since we've already found
- handleProgramError(e);
- } finally {
- if (inputStream!=null) {
- try {
- inputStream.close();
- } catch(IOException e) {
- }
- }
- }
- if (model != null) {
- // add to our cache
- sharedObject.theSharedModel=model;
- _initCount(sharedObject, rwType);
- doRemove = false;
- }
- }
- }
- finally{
- if (doRemove) {
- SYNC.acquire();
- fManagedObjects.remove(id);
- SYNC.release();
- }
- sharedObject.setLoaded();
- }
- }
-
- private IStructuredModel _commonCreateModel(InputStream inputStream, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException {
-
- if (id == null) {
- throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
- }
- SharedObject sharedObject = null;
-
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
-
- while(true) {
- if (sharedObject!=null) {
- sharedObject.waitForLoadAttempt();
- }
- SYNC.acquire();
- SharedObject testObject = (SharedObject) fManagedObjects.get(id);
- if (testObject==null) {
- // it was removed ,so lets create it
- sharedObject = new SharedObject(id);
- fManagedObjects.put(id, sharedObject);
- SYNC.release();
- _doCommonCreateModel(inputStream, id, handler, resolver, rwType,
- encoding, lineDelimiter, sharedObject);
- break;
- } else if (sharedObject == testObject) {
- synchronized(sharedObject) {
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, rwType);
- }
- }
- SYNC.release();
- break;
- } else {
- SYNC.release();
- sharedObject = testObject;
- }
- }
-
- // we expect to always return something
- Assert.isNotNull(sharedObject, "Program Error: no model recorded for id " + id); //$NON-NLS-1$
- // note: clients must call release for each time they call get.
- return sharedObject.theSharedModel;
-
- }
-
- private void _doCommonCreateModel(InputStream inputStream, String id, IModelHandler handler,
- URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter,
- SharedObject sharedObject) throws IOException {
- boolean doRemove = true;
- try {
- synchronized(sharedObject) {
- IStructuredModel model = null;
- try {
- model = _commonCreateModel(id, handler, resolver);
- IModelLoader loader = handler.getModelLoader();
- if (inputStream == null) {
- Logger.log(Logger.WARNING, "model was requested for id " + id + " without a content InputStream"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- loader.load(id, Utilities.getMarkSupportedStream(inputStream), model, encoding, lineDelimiter);
- }
- catch (ResourceInUse e) {
- // impossible, since we've already found
- handleProgramError(e);
- }
- if (model != null) {
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=264228
- *
- * Ensure that the content type identifier field of the model
- * is properly set. This is normally handled by the
- * FileBufferModelManager when working with files as it knows
- * the content type in advance; here is where we handle it for
- * streams.
- */
- if (model instanceof AbstractStructuredModel) {
- DocumentReader reader = new DocumentReader(model.getStructuredDocument());
- IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(reader, id, new QualifiedName[0]);
- reader.close();
- if (description != null && description.getContentType() != null) {
- ((AbstractStructuredModel) model).setContentTypeIdentifier(description.getContentType().getId());
- }
- }
-
- sharedObject.theSharedModel = model;
- _initCount(sharedObject, rwType);
- doRemove = false;
- }
- }
- }
- finally {
- if (doRemove) {
- SYNC.acquire();
- // remove it if we didn't get one back
- fManagedObjects.remove(id);
- SYNC.release();
- }
- sharedObject.setLoaded();
- }
- }
-
- private IStructuredModel _commonCreateModel(String id, IModelHandler handler, URIResolver resolver) throws ResourceInUse {
-
- IModelLoader loader = handler.getModelLoader();
- IStructuredModel result = loader.createModel();
- // in the past, id was null for "unmanaged" case, so we won't
- // try and set it
- if (id != null) {
- result.setId(id);
- }
- result.setModelHandler(handler);
- result.setResolver(resolver);
- // some obvious redunancy here that maybe could be improved
- // in future, but is necessary for now
- result.setBaseLocation(id);
- if (resolver != null) {
- resolver.setFileBaseLocation(id);
- }
- addFactories(result, handler);
- return result;
- }
-
- private IStructuredModel _commonGetModel(IFile iFile, ReadEditType rwType, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- IStructuredModel model = null;
-
- if (iFile != null && iFile.exists()) {
- String id = calculateId(iFile);
- IModelHandler handler = calculateType(iFile);
- URIResolver resolver = calculateURIResolver(iFile);
- model = _commonCreateModel(iFile, id, handler, resolver, rwType, encodingRule);
- }
-
- return model;
- }
-
- private IStructuredModel _commonGetModel(IFile iFile, ReadEditType rwType, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException {
- String id = calculateId(iFile);
- IStructuredModel model = _commonGetModel(iFile, id, rwType, encoding, lineDelimiter);
-
- return model;
- }
-
- private IStructuredModel _commonGetModel(IFile file, String id, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException, CoreException {
- if (id == null)
- throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
-
- SharedObject sharedObject = null;
- if (file != null && file.exists()) {
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
-
- while(true) {
- if (sharedObject!=null) {
- sharedObject.waitForLoadAttempt();
- }
- SYNC.acquire();
- SharedObject testObject = (SharedObject) fManagedObjects.get(id);
- if (testObject==null) {
- // it was removed ,so lets create it
- sharedObject = new SharedObject(id);
- fManagedObjects.put(id, sharedObject);
-
- SYNC.release();
- _doCommonGetModel(file, id, sharedObject,rwType);
- break;
- } else if (sharedObject == testObject) {
- synchronized(sharedObject) {
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, rwType);
- }
- }
- SYNC.release();
- break;
- } else {
- // we got a different object than what we were expecting
- SYNC.release();
- // two threads were interested in models for the same id.
- // The other thread one, so lets back off and try again.
- sharedObject = testObject;
- }
- }
- }
-
- // if we don't know how to create a model
- // for this type of file, return null
-
- // note: clients must call release for each time they call
- // get.
-
- return sharedObject==null ? null : sharedObject.theSharedModel;
- }
-
- private void _doCommonGetModel(IFile file, String id, SharedObject sharedObject,ReadEditType rwType) {
- boolean doRemove = true;
- try {
- synchronized(sharedObject) {
- sharedObject.doWait=false;
- IStructuredModel model = null;
- try {
- model = FileBufferModelManager.getInstance().getModel(file);
- }
- finally {
- sharedObject.doWait=true;
- }
- if (model != null) {
- sharedObject.theSharedModel=model;
- _initCount(sharedObject, rwType);
- doRemove = false;
- }
- }
- }
- finally {
- if (doRemove) {
- SYNC.acquire();
- fManagedObjects.remove(id);
- SYNC.release();
- }
- sharedObject.setLoaded();
- }
- }
-
- private SharedObject _commonNewModel(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
- IStructuredModel aSharedModel = null;
- // First, check if resource already exists on file system.
- // if is does, then throw Resource in Use iff force==false
-
- if (iFile.exists() && !force) {
- throw new ResourceAlreadyExists();
- }
-
- SharedObject sharedObject = null;
- String id = calculateId(iFile);
- try {
- SYNC.acquire();
-
- sharedObject = (SharedObject) fManagedObjects.get(id);
-
- if (sharedObject != null && !force) {
- // if in cache already, and force is not true, then this is an
- // error
- // in call
- throw new ResourceInUse();
- }
-
- sharedObject = new SharedObject(id);
- fManagedObjects.put(id, sharedObject);
-
- } finally {
- SYNC.release();
- }
-
- // if we get to here without above exceptions, then all is ok
- // to get model like normal, but set 'new' attribute (where the
- // 'new' attribute means this is a model without a corresponding
- // underlying resource.
- aSharedModel = FileBufferModelManager.getInstance().getModel(iFile);
- aSharedModel.setNewState(true);
-
- sharedObject.theSharedModel=aSharedModel;
- // when resource is provided, we can set
- // synchronization stamp ... otherwise client should
- // Note: one client which does this is FileModelProvider.
- aSharedModel.resetSynchronizationStamp(iFile);
- return sharedObject;
- }
-
- public IStructuredModel _getModelFor(IStructuredDocument document, ReadEditType accessType) {
-
- String id = FileBufferModelManager.getInstance().calculateId(document);
- if (id == null) {
- if (READ == accessType)
- return getExistingModelForRead(document);
- if (EDIT == accessType)
- return getExistingModelForEdit(document);
- Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
- }
-
- SharedObject sharedObject = null;
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
-
- while(true) {
- if (sharedObject!=null) {
- sharedObject.waitForLoadAttempt();
- }
- SYNC.acquire();
- SharedObject testObject = (SharedObject) fManagedObjects.get(id);
- if (testObject==null) {
- sharedObject = new SharedObject(id);
- fManagedObjects.put(id, sharedObject);
- SYNC.release();
- synchronized(sharedObject) {
- sharedObject.theSharedModel = FileBufferModelManager.getInstance().getModel(document);
- _initCount(sharedObject, accessType);
- sharedObject.setLoaded();
- }
- break;
- } else if (sharedObject == testObject) {
- synchronized(sharedObject) {
- Assert.isTrue(sharedObject.referenceCountForEdit + sharedObject.referenceCountForRead > 0, "reference count was less than zero");
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, accessType);
- }
- }
- SYNC.release();
- break;
- } else {
- SYNC.release();
- sharedObject = testObject;
- }
- }
-
- return sharedObject==null ? null : sharedObject.theSharedModel;
- }
-
- private void _incrCount(SharedObject sharedObject, ReadEditType type) {
- synchronized(sharedObject) {
- if (type == READ) {
- sharedObject.referenceCountForRead++;
- FileBufferModelManager.getInstance().connect(sharedObject.theSharedModel.getStructuredDocument());
- }
- else if (type == EDIT) {
- sharedObject.referenceCountForEdit++;
- FileBufferModelManager.getInstance().connect(sharedObject.theSharedModel.getStructuredDocument());
- }
- else
- throw new IllegalArgumentException();
- }
- }
-
- private void _initCount(SharedObject sharedObject, ReadEditType type) {
- synchronized(sharedObject) {
- if (type == READ) {
- FileBufferModelManager.getInstance().connect(sharedObject.theSharedModel.getStructuredDocument());
- sharedObject.referenceCountForRead = 1;
- }
- else if (type == EDIT) {
- FileBufferModelManager.getInstance().connect(sharedObject.theSharedModel.getStructuredDocument());
- sharedObject.referenceCountForEdit = 1;
- }
- else
- throw new IllegalArgumentException();
- }
- }
-
- private void addFactories(IStructuredModel model, IModelHandler handler) {
- Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
- FactoryRegistry registry = model.getFactoryRegistry();
- Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
- List factoryList = handler.getAdapterFactories();
- addFactories(model, factoryList);
- }
-
- private void addFactories(IStructuredModel model, List factoryList) {
- Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
- FactoryRegistry registry = model.getFactoryRegistry();
- Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
- // Note: we add all of them from handler, even if
- // already exists. May need to reconsider this.
- if (factoryList != null) {
- Iterator iterator = factoryList.iterator();
- while (iterator.hasNext()) {
- INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
- registry.addFactory(factory);
- }
- }
- }
-
-
- /**
- * Calculate id provides a common way to determine the id from the input
- * ... needed to get and save the model. It is a simple class utility, but
- * is an instance method so can be accessed via interface.
- */
- public String calculateId(IFile file) {
- return FileBufferModelManager.getInstance().calculateId(file);
- }
-
- private IModelHandler calculateType(IFile iFile) throws CoreException {
- // IModelManager mm = ((ModelManagerPlugin)
- // Platform.getPlugin(ModelManagerPlugin.ID)).getModelManager();
- ModelHandlerRegistry cr = getModelHandlerRegistry();
- IModelHandler cd = cr.getHandlerFor(iFile);
- return cd;
- }
-
- private IModelHandler calculateType(String filename, InputStream inputStream) throws IOException {
- ModelHandlerRegistry cr = getModelHandlerRegistry();
- IModelHandler cd = cr.getHandlerFor(filename, inputStream);
- return cd;
- }
-
- /**
- *
- */
- private URIResolver calculateURIResolver(IFile file) {
- // Note: see comment in plugin.xml for potentially
- // breaking change in behavior.
-
- IProject project = file.getProject();
- URIResolver resolver = (URIResolver) project.getAdapter(URIResolver.class);
- if (resolver == null)
- resolver = new ProjectResolver(project);
- Object location = file.getLocation();
- if (location == null)
- location = file.getLocationURI();
- if (location != null)
- resolver.setFileBaseLocation(location.toString());
- return resolver;
- }
-
- /*
- * Note: This method appears in both ModelManagerImpl and JSEditor (with
- * just a minor difference). They should be kept the same.
- *
- * @deprecated - handled by platform
- */
- private void convertLineDelimiters(IDocument document, IFile iFile) throws CoreException {
- // Note: calculateType(iFile) returns a default xml model handler if
- // content type is null.
- String contentTypeId = calculateType(iFile).getAssociatedContentTypeId();
- String endOfLineCode = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.END_OF_LINE_CODE);
- // endOfLineCode == null means the content type does not support this
- // function (e.g. DTD)
- // endOfLineCode == "" means no translation
- if (endOfLineCode != null && endOfLineCode.length() > 0) {
- String lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
- if (endOfLineCode.equals(CommonEncodingPreferenceNames.CR))
- lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_CR;
- else if (endOfLineCode.equals(CommonEncodingPreferenceNames.LF))
- lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_LF;
- else if (endOfLineCode.equals(CommonEncodingPreferenceNames.CRLF))
- lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_CRLF;
-
- TextEdit multiTextEdit = new MultiTextEdit();
- int lineCount = document.getNumberOfLines();
- try {
- for (int i = 0; i < lineCount; i++) {
- IRegion lineInfo = document.getLineInformation(i);
- int lineStartOffset = lineInfo.getOffset();
- int lineLength = lineInfo.getLength();
- int lineEndOffset = lineStartOffset + lineLength;
-
- if (i < lineCount - 1) {
- String currentLineDelimiter = document.getLineDelimiter(i);
- if (currentLineDelimiter != null && currentLineDelimiter.compareTo(lineDelimiterToUse) != 0)
- multiTextEdit.addChild(new ReplaceEdit(lineEndOffset, currentLineDelimiter.length(), lineDelimiterToUse));
- }
- }
-
- if (multiTextEdit.getChildrenSize() > 0)
- multiTextEdit.apply(document);
- }
- catch (BadLocationException exception) {
- // just adding generic runtime here, until whole method
- // deleted.
- throw new RuntimeException(exception.getMessage());
- }
- }
- }
-
- /**
- * this used to be in loader, but has been moved here
- */
- private IStructuredModel copy(IStructuredModel model, String newId) throws ResourceInUse {
- IStructuredModel newModel = null;
- IStructuredModel oldModel = model;
- IModelHandler modelHandler = oldModel.getModelHandler();
- IModelLoader loader = modelHandler.getModelLoader();
- // newModel = loader.newModel();
- newModel = loader.createModel(oldModel);
- // newId, oldModel.getResolver(), oldModel.getModelManager());
- newModel.setModelHandler(modelHandler);
- // IStructuredDocument oldStructuredDocument =
- // oldModel.getStructuredDocument();
- // IStructuredDocument newStructuredDocument =
- // oldStructuredDocument.newInstance();
- // newModel.setStructuredDocument(newStructuredDocument);
- newModel.setResolver(oldModel.getResolver());
- newModel.setModelManager(oldModel.getModelManager());
- // duplicateFactoryRegistry(newModel, oldModel);
- newModel.setId(newId);
- // set text of new one after all initialization is done
- String contents = oldModel.getStructuredDocument().getText();
- newModel.getStructuredDocument().setText(this, contents);
- return newModel;
- }
-
- /**
- */
- public IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse {
- IStructuredModel newModel = null;
- // get the existing model associated with this id
- IStructuredModel model = getExistingModel(oldId);
- // if it doesn't exist, ignore request (though this would normally
- // be a programming error.
- if (model == null)
- return null;
- SharedObject sharedObject = null;
- try {
- SYNC.acquire();
- // now be sure newModel does not exist
- sharedObject = (SharedObject) fManagedObjects.get(newId);
- if (sharedObject != null) {
- throw new ResourceInUse();
- }
- sharedObject = new SharedObject(newId);
- fManagedObjects.put(newId,sharedObject);
- } finally {
- SYNC.release();
- }
- // get loader based on existing type (note the type assumption)
- // Object type = ((IStructuredModel) model).getType();
- // IModelHandler type = model.getModelHandler();
- // IModelLoader loader = (IModelLoader) getModelLoaders().get(type);
- // IModelLoader loader = (IModelLoader) getModelLoaders().get(type);
- // ask the loader to copy
- synchronized(sharedObject) {
- sharedObject.doWait = false;
- newModel = copy(model, newId);
- sharedObject.doWait = true;
- }
- if (newModel != null) {
- // add to our cache
- synchronized(sharedObject) {
- sharedObject.theSharedModel=newModel;
- sharedObject.referenceCountForEdit = 1;
- trace("copied model", newId, sharedObject.referenceCountForEdit); //$NON-NLS-1$
- }
- } else {
- SYNC.acquire();
- fManagedObjects.remove(newId);
- SYNC.release();
- }
- sharedObject.setLoaded();
- return newModel;
- }
-
- /**
- * Similar to clone, except the new instance has no content. Note: this
- * produces an unmanaged model, for temporary use. If a true shared model
- * is desired, use "copy".
- */
- public IStructuredModel createNewInstance(IStructuredModel oldModel) throws IOException {
- IModelHandler handler = oldModel.getModelHandler();
- IModelLoader loader = handler.getModelLoader();
- IStructuredModel newModel = loader.createModel(oldModel);
- newModel.setModelHandler(handler);
- if (newModel instanceof AbstractStructuredModel) {
- ((AbstractStructuredModel) newModel).setContentTypeIdentifier(oldModel.getContentTypeIdentifier());
- }
- URIResolver oldResolver = oldModel.getResolver();
- newModel.setResolver(oldResolver);
- try {
- newModel.setId(DUPLICATED_MODEL);
- }
- catch (ResourceInUse e) {
- // impossible, since this is an unmanaged model
- }
- // base location should be null, but we'll set to
- // null to be sure.
- newModel.setBaseLocation(null);
- return newModel;
- }
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. Note: its assume that IFile does not actually exist as
- * a resource yet. If it does, ResourceAlreadyExists exception is thrown.
- * If the resource does already exist, then createStructuredDocumentFor is
- * the right API to use.
- *
- * @throws ResourceInUse
- *
- */
- public IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException {
- if (iFile.exists()) {
- throw new ResourceAlreadyExists(iFile.getFullPath().toOSString());
- }
- // Will reconsider in future version
- // String id = calculateId(iFile);
- // if (isResourceInUse(id)) {
- // throw new ResourceInUse(iFile.getFullPath().toOSString());
- // }
- IDocumentLoader loader = null;
- IModelHandler handler = calculateType(iFile);
- loader = handler.getDocumentLoader();
- // for this API, "createNew" we assume the IFile does not exist yet
- // as checked above, so just create empty document.
- IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
- return result;
- }
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. Note: clients should verify IFile exists before using
- * this method. If this IFile does not exist, then
- * createNewStructuredDocument is the correct API to use.
- *
- * @throws ResourceInUse
- */
- public IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException {
- if (!iFile.exists()) {
- throw new FileNotFoundException(iFile.getFullPath().toOSString());
- }
- // Will reconsider in future version
- // String id = calculateId(iFile);
- // if (isResourceInUse(id)) {
- // throw new ResourceInUse(iFile.getFullPath().toOSString());
- // }
- IDocumentLoader loader = null;
- IModelHandler handler = calculateType(iFile);
- loader = handler.getDocumentLoader();
- IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument(iFile);
- return result;
- }
-
- /**
- * Conveience method, since a proper IStructuredDocument must have a
- * proper parser assigned. It should only be used when an empty
- * structuredDocument is needed. Otherwise, use IFile form.
- *
- * @deprecated - TODO: to be removed by C4 do we really need this? I
- * recommend to - use createStructuredDocumentFor(filename,
- * null, null) - the filename does not need to represent a
- * real - file, but can take for form of dummy.jsp, test.xml,
- * etc. - That way we don't hard code the handler, but specify
- * we - want the handler that "goes with" a certain type of -
- * file.
- */
- public IStructuredDocument createStructuredDocumentFor(String contentTypeId) {
- IDocumentLoader loader = null;
- ModelHandlerRegistry cr = getModelHandlerRegistry();
- IModelHandler handler = cr.getHandlerForContentTypeId(contentTypeId);
- if (handler == null)
- Logger.log(Logger.ERROR, "Program error: no model handler found for " + contentTypeId); //$NON-NLS-1$
- loader = handler.getDocumentLoader();
- IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
- return result;
- }
-
- /**
- * Conveience method, since a proper IStructuredDocument must have a
- * proper parser assigned.
- *
- * @deprecated -- - TODO: to be removed by C4 I marked as deprecated to
- * discouage use of this method. It does not really work for
- * JSP fragments, since JSP Fragments need an IFile to
- * correctly look up the content settings. Use IFile form
- * instead.
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver) throws IOException {
- IDocumentLoader loader = null;
- InputStream istream = Utilities.getMarkSupportedStream(inputStream);
- if (istream != null) {
- istream.reset();
- }
- IModelHandler handler = calculateType(filename, istream);
- loader = handler.getDocumentLoader();
- IStructuredDocument result = null;
- if (inputStream == null) {
- result = (IStructuredDocument) loader.createNewStructuredDocument();
- }
- else {
- result = (IStructuredDocument) loader.createNewStructuredDocument(filename, istream);
- }
- return result;
- }
-
- /**
- * Special case method. This method was created for the special case where
- * there is an encoding for input stream that should override all the
- * normal rules for encoding. For example, if there is an encoding
- * (charset) specified in HTTP response header, then that encoding is used
- * to translate the input stream to a string, but then the normal encoding
- * rules are ignored, so that the string is not translated twice (for
- * example, if its an HTML "file", then even if it contains a charset in
- * meta tag, its ignored since its assumed its all correctly decoded by
- * the HTTP charset.
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String encoding) throws IOException {
- String content = readInputStream(inputStream, encoding);
- IStructuredDocument result = createStructuredDocumentFor(filename, content, resolver);
- return result;
- }
-
- /**
- * Convenience method. This method can be used when the resource does not
- * really exist (e.g. when content is being created, but hasn't been
- * written to disk yet). Note that since the content is being provided as
- * a String, it is assumed to already be decoded correctly so no
- * transformation is done.
- */
- public IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException {
- // TODO: avoid all these String instances
- StringBuffer contentBuffer = new StringBuffer(content);
- IDocumentLoader loader = null;
- IModelHandler handler = calculateType(filename, null);
- loader = handler.getDocumentLoader();
- IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
- StringBuffer convertedContent = loader.handleLineDelimiter(contentBuffer, result);
- result.setEncodingMemento(new NullMemento());
- result.setText(this, convertedContent.toString());
- return result;
- }
-
- /**
- * @param iFile
- * @param result
- * @return
- * @throws CoreException
- */
- private IStructuredModel createUnManagedEmptyModelFor(IFile iFile) throws CoreException {
- IStructuredModel result = null;
- IModelHandler handler = calculateType(iFile);
- String id = calculateId(iFile);
- URIResolver resolver = calculateURIResolver(iFile);
-
- try {
- result = _commonCreateModel(id, handler, resolver);
- }
- catch (ResourceInUse e) {
- // impossible, since we're not sharing
- // (even if it really is in use ... we don't care)
- // this may need to be re-examined.
- if (Logger.DEBUG_MODELMANAGER)
- Logger.log(Logger.INFO, "ModelMangerImpl::createUnManagedStructuredModelFor. Model unexpectedly in use."); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return result;
- }
-
- /**
- * Conveience method. It depends on the loaders newModel method to return
- * an appropriate StrucuturedModel appropriately initialized.
- */
- public IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException {
- IStructuredModel result = null;
- result = createUnManagedEmptyModelFor(iFile);
-
- IDocumentLoader loader = result.getModelHandler().getDocumentLoader();
- IEncodedDocument document = loader.createNewStructuredDocument(iFile);
-
- result.getStructuredDocument().setText(this, document.get());
-
- return result;
- }
-
- /**
- * Conveience method. It depends on the loaders newModel method to return
- * an appropriate StrucuturedModel appropriately initialized.
- */
- public IStructuredModel createUnManagedStructuredModelFor(String contentTypeId) {
- return createUnManagedStructuredModelFor(contentTypeId, null);
- }
-
- /**
- * Conveience method. It depends on the loaders newModel method to return
- * an appropriate StrucuturedModel appropriately initialized.
- */
- public IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver) {
- IStructuredModel result = null;
- ModelHandlerRegistry cr = getModelHandlerRegistry();
- IModelHandler handler = cr.getHandlerForContentTypeId(contentTypeId);
- try {
- result = _commonCreateModel(UNMANAGED_MODEL, handler, resolver); //$NON-NLS-1$
- }
- catch (ResourceInUse e) {
- // impossible, since we're not sharing
- // (even if it really is in use ... we don't care)
- // this may need to be re-examined.
- if (Logger.DEBUG_MODELMANAGER)
- Logger.log(Logger.INFO, "ModelMangerImpl::createUnManagedStructuredModelFor. Model unexpectedly in use."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return result;
- }
-
- private IStructuredModel getExistingModel(Object id) {
- IStructuredModel result = null;
-
- SYNC.acquire();
- /**
- * While a good check in theory, it's possible for an event fired to
- * cause a listener to access a method that calls this one.
- */
- //Assert.isTrue(SYNC.getDepth()==1, "depth not equal to 1");
- // let's see if we already have it in our cache
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- // if not, then we'll simply return null
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- result = sharedObject.theSharedModel;
- } else {
- SYNC.release();
- }
-
- return result;
- }
-
- /**
- * Note: users of this 'model' must still release it when finished.
- * Returns null if there's not a model corresponding to document.
- */
- public IStructuredModel getExistingModelForEdit(IDocument document) {
- IStructuredModel result = null;
-
- SYNC.acquire();
- // create a snapshot
- Set ids = new HashSet(fManagedObjects.keySet());
- SYNC.release();
- for (Iterator iterator = ids.iterator(); iterator.hasNext();) {
- Object potentialId = iterator.next();
- SYNC.acquire();
- if (fManagedObjects.containsKey(potentialId)) {
- // check to see if still valid
- SYNC.release();
- IStructuredModel tempResult = getExistingModel(potentialId);
- if (tempResult!=null && document == tempResult.getStructuredDocument()) {
- result = getExistingModelForEdit(potentialId);
- break;
- }
- } else {
- SYNC.release();
- }
- }
-
- return result;
- }
-
- /**
- * This is similar to the getModel method, except this method does not
- * create a model. This method does increment the reference count (if it
- * exists). If the model does not already exist in the cache of models,
- * null is returned.
- */
- public IStructuredModel getExistingModelForEdit(IFile iFile) {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- Object id = calculateId(iFile);
- IStructuredModel result = getExistingModelForEdit(id);
- return result;
- }
-
- /**
- * This is similar to the getModel method, except this method does not
- * create a model. This method does increment the reference count (if it
- * exists). If the model does not already exist in the cache of models,
- * null is returned.
- *
- * @deprecated use IFile form - this one will become protected or private
- */
- public IStructuredModel getExistingModelForEdit(Object id) {
-
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- IStructuredModel result = null;
- boolean doRelease = true;
- // let's see if we already have it in our cache
- try {
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- // if not, then we'll simply return null
- if (sharedObject != null) {
- // if shared object is in our cache, then simply increment its ref
- // count,
- // and return the object.
- SYNC.release();
- doRelease=false;
- synchronized(sharedObject) {
- if (sharedObject.doWait) {
- sharedObject.waitForLoadAttempt();
- }
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, EDIT);
- }
- result = sharedObject.theSharedModel;
- }
- trace("got existing model for Edit: ", id); //$NON-NLS-1$
- trace(" incremented referenceCountForEdit ", id, sharedObject.referenceCountForEdit); //$NON-NLS-1$
- }
- } finally {
- if (doRelease) {
- SYNC.release();
- }
- }
-
- return result;
- }
-
- /**
- * Note: users of this 'model' must still release it when finished.
- * Returns null if there's not a model corresponding to document.
- */
- public IStructuredModel getExistingModelForRead(IDocument document) {
- IStructuredModel result = null;
-
- SYNC.acquire();
- // create a snapshot
- Set ids = new HashSet(fManagedObjects.keySet());
- SYNC.release();
- for (Iterator iterator = ids.iterator(); iterator.hasNext();) {
- Object potentialId = iterator.next();
- SYNC.acquire();
- if (fManagedObjects.containsKey(potentialId)) {
- // check to see if still valid
- SYNC.release();
- IStructuredModel tempResult = getExistingModel(potentialId);
- if (tempResult!=null && document == tempResult.getStructuredDocument()) {
- result = getExistingModelForRead(potentialId);
- break;
- }
- } else {
- SYNC.release();
- }
- }
-
- return result;
- }
-
- public IStructuredModel getExistingModelForRead(IFile iFile) {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- Object id = calculateId(iFile);
- IStructuredModel result = getExistingModelForRead(id);
- return result;
- }
-
- /**
- * This is similar to the getModel method, except this method does not
- * create a model. This method does increment the reference count (if it
- * exists). If the model does not already exist in the cache of models,
- * null is returned.
- *
- * @deprecated use IFile form - this one will become protected or private
- */
- public IStructuredModel getExistingModelForRead(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- IStructuredModel result = null;
- boolean doRelease = true;
- // let's see if we already have it in our cache
- try {
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- // if not, then we'll simply return null
- if (sharedObject != null) {
- // if shared object is in our cache, then simply increment its ref
- // count,
- // and return the object.
- SYNC.release();
- doRelease=false;
-
- synchronized(sharedObject) {
- if (sharedObject.doWait) {
- sharedObject.waitForLoadAttempt();
- }
- if (sharedObject.theSharedModel!=null) {
- _incrCount(sharedObject, READ);
- }
- result = sharedObject.theSharedModel;
- }
- }
- } finally {
- if (doRelease)
- SYNC.release();
- }
- return result;
- }
-
- /**
- * @deprecated DMW: Tom, this is "special" for links builder Assuming its
- * still needed, wouldn't it be better to change to
- * getExistingModels()? -- will be removed. Its not thread
- * safe for one thread to get the Enumeration, when underlying
- * data could be changed in another thread.
- */
- public Enumeration getExistingModelIds() {
- try {
- SYNC.acquire();
- // create a copy
- Vector keys = new Vector( fManagedObjects.keySet() );
- return keys.elements();
- } finally {
- SYNC.release();
- }
- }
-
- // TODO: replace (or supplement) this is a "model info" association to the
- // IFile that created the model
- private IFile getFileFor(IStructuredModel model) {
- if (model == null)
- return null;
- String path = model.getBaseLocation();
- if (path == null || path.length() == 0) {
- Object id = model.getId();
- if (id == null)
- return null;
- path = id.toString();
- }
- // TOODO needs rework for linked resources
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFileForLocation(new Path(path));
- return file;
- }
-
- /**
- * One of the primary forms to get a managed model
- */
- public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException {
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, EDIT, null, null);
- }
-
- public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, EDIT, encodingRule);
- }
-
- public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws java.io.UnsupportedEncodingException, IOException, CoreException {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, EDIT, encoding, lineDelimiter);
- }
-
- public IStructuredModel getModelForEdit(IStructuredDocument document) {
- return _getModelFor(document, EDIT);
- }
-
- /**
- * @see IModelManager
- * @deprecated use IFile or String form
- */
- public IStructuredModel getModelForEdit(Object id, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
-
- Assert.isNotNull(id, "requested model id can not be null"); //$NON-NLS-1$
- String stringId = id.toString();
- return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
- }
-
- /**
- * @see IModelManager
- * @deprecated - use IFile or String form
- */
- public IStructuredModel getModelForEdit(Object id, Object modelType, String encodingName, String lineDelimiter, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
-
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- String stringId = id.toString();
- return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
- }
-
- public IStructuredModel getModelForEdit(String id, InputStream inputStream, URIResolver resolver) throws IOException {
- if (id == null) {
- throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
- }
- IStructuredModel result = null;
-
- InputStream istream = Utilities.getMarkSupportedStream(inputStream);
- IModelHandler handler = calculateType(id, istream);
- if (handler != null) {
- result = _commonCreateModel(istream, id, handler, resolver, EDIT, null, null);
- }
- else {
- Logger.log(Logger.INFO, "no model handler found for id"); //$NON-NLS-1$
- }
- return result;
- }
-
- /**
- * One of the primary forms to get a managed model
- */
- public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, READ, null, null);
- }
-
- public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, READ, encodingRule);
- }
-
- public IStructuredModel getModelForRead(IFile iFile, String encodingName, String lineDelimiter) throws java.io.UnsupportedEncodingException, IOException, CoreException {
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- return _commonGetModel(iFile, READ, encodingName, lineDelimiter);
- }
-
- public IStructuredModel getModelForRead(IStructuredDocument document) {
- return _getModelFor(document, READ);
- }
-
- /**
- * @see IModelManager
- * @deprecated use IFile or String form
- */
- public IStructuredModel getModelForRead(Object id, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- String stringId = id.toString();
- return getModelForRead(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
- }
-
- /**
- * @see IModelManager
- * @deprecated use IFile form
- */
- public IStructuredModel getModelForRead(Object id, Object modelType, String encodingName, String lineDelimiter, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- String stringId = id.toString();
- return getModelForRead(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
- }
-
- public IStructuredModel getModelForRead(String id, InputStream inputStream, URIResolver resolver) throws IOException {
- InputStream istream = Utilities.getMarkSupportedStream(inputStream);
- IModelHandler handler = calculateType(id, istream);
- IStructuredModel result = null;
- result = _commonCreateModel(istream, id, handler, resolver, READ, null, null);
- return result;
- }
-
- /**
- * @deprecated - only temporarily visible
- */
- public ModelHandlerRegistry getModelHandlerRegistry() {
- if (fModelHandlerRegistry == null) {
- fModelHandlerRegistry = ModelHandlerRegistry.getInstance();
- }
- return fModelHandlerRegistry;
- }
-
- /**
- * @see IModelManager#getNewModelForEdit(IFile, boolean)
- */
- public IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- SharedObject sharedObject = _commonNewModel(iFile, force);
- synchronized(sharedObject) {
- sharedObject.referenceCountForEdit = 1;
- }
- sharedObject.setLoaded();
- return sharedObject.theSharedModel;
- }
-
- /**
- * @see IModelManager#getNewModelForRead(IFile, boolean)
- */
- public IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
-
- Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
- SharedObject sharedObject = _commonNewModel(iFile, force);
- SYNC.acquire();
- synchronized(sharedObject) {
- if (sharedObject.theSharedModel!=null) {
- sharedObject.referenceCountForRead = 1;
- }
- }
- SYNC.release();
- sharedObject.setLoaded();
- return sharedObject.theSharedModel;
- }
-
- /**
- * This function returns the reference count of underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- */
- public int getReferenceCount(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
-
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized (sharedObject) {
- count = sharedObject.referenceCountForRead + sharedObject.referenceCountForEdit;
- }
- } else {
- SYNC.release();
- }
- return count;
- }
-
- /**
- * This function returns the reference count of underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- */
- public int getReferenceCountForEdit(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- count = sharedObject.referenceCountForEdit;
- }
- } else {
- SYNC.release();
- }
- return count;
- }
-
- /**
- * This function returns the reference count of underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- */
- public int getReferenceCountForRead(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- count = sharedObject.referenceCountForRead;
- }
- } else {
- SYNC.release();
- }
- return count;
- }
-
- private void handleConvertLineDelimiters(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule, EncodingMemento encodingMemento) throws CoreException, MalformedOutputExceptionWithDetail, UnsupportedEncodingException {
- if (structuredDocument.getNumberOfLines() > 1) {
- convertLineDelimiters(structuredDocument, iFile);
- }
- }
-
- private void handleProgramError(Throwable t) {
-
- Logger.logException("Impossible Program Error", t); //$NON-NLS-1$
- }
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isShared(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
- boolean result = false;
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- count = sharedObject.referenceCountForRead + sharedObject.referenceCountForEdit;
- }
- } else {
- SYNC.release();
- }
- result = count > 1;
- return result;
- }
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- *
- * @param id
- * Object The id of the model
- */
- public boolean isSharedForEdit(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
- boolean result = false;
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- count = sharedObject.referenceCountForEdit;
- }
- } else {
- SYNC.release();
- }
- result = count > 1;
- return result;
- }
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- *
- * @param id
- * Object The id of the model
- */
- public boolean isSharedForRead(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- int count = 0;
- boolean result = false;
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject != null) {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- count = sharedObject.referenceCountForRead;
- }
- } else {
- SYNC.release();
- }
- result = count > 1;
- return result;
- }
-
- /**
- * This method can be called to determine if the model manager is within a
- * "aboutToChange" and "changed" sequence.
- *
- * @deprecated the manager does not otherwise interact with these states
- * @return false
- */
- public boolean isStateChanging() {
- // doesn't seem to be used anymore
- return false;
- }
-
- /**
- * This method changes the id of the model. TODO: try to refine the design
- * not to use this function
- */
- public void moveModel(Object oldId, Object newId) {
- Assert.isNotNull(oldId, "old id parameter can not be null"); //$NON-NLS-1$
- Assert.isNotNull(newId, "new id parameter can not be null"); //$NON-NLS-1$
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(oldId);
- // if not found in cache, ignore request.
- // this would normally be a program error
- if (sharedObject != null) {
- fManagedObjects.remove(oldId);
- fManagedObjects.put(newId, sharedObject);
- }
- SYNC.release();
- }
-
- private String readInputStream(InputStream inputStream, String ianaEncodingName) throws UnsupportedEncodingException, IOException {
-
- String allText = null;
- if ((ianaEncodingName != null) && (ianaEncodingName.length() != 0)) {
- String enc = CodedIO.getAppropriateJavaCharset(ianaEncodingName);
- if (enc == null) {
- // if no conversion was possible, let's assume that
- // the encoding is already a java encoding name, so we'll
- // proceed with that assumption. This is the case, for
- // example,
- // for the reload() procedure.
- // If in fact it is not a valid java encoding, then
- // the "allText=" line will cause an
- // UnsupportedEncodingException
- enc = ianaEncodingName;
- }
- allText = readInputStream(new InputStreamReader(inputStream, enc));
- }
- else {
- // we normally assume encoding is provided for this method, but if
- // not,
- // we'll use platform default
- allText = readInputStream(new InputStreamReader(inputStream));
- }
- return allText;
- }
-
- private String readInputStream(InputStreamReader inputStream) throws IOException {
-
- int numRead = 0;
- StringBuffer buffer = new StringBuffer();
- char tBuff[] = new char[READ_BUFFER_SIZE];
- while ((numRead = inputStream.read(tBuff, 0, tBuff.length)) != -1) {
- buffer.append(tBuff, 0, numRead);
- }
- // remember -- we didn't open stream ... so we don't close it
- return buffer.toString();
- }
-
- /*
- * @see IModelManager#reinitialize(IStructuredModel)
- */
- public IStructuredModel reinitialize(IStructuredModel model) {
-
- // getHandler (assume its the "new one")
- IModelHandler handler = model.getModelHandler();
- // getLoader for that new one
- IModelLoader loader = handler.getModelLoader();
- // ask it to reinitialize
- model = loader.reinitialize(model);
- // the loader should check to see if the one it received
- // is the same type it would normally create.
- // if not, it must "start from scratch" and create a whole
- // new one.
- // if it is of the same type, it should just 'replace text'
- // replacing all the existing text with the new text.
- // the important one is the JSP loader ... it should go through
- // its embedded content checking and initialization
- return model;
- }
-
- void releaseFromEdit(IStructuredModel structuredModel) {
- Object id = structuredModel.getId();
- if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
- cleanupDiscardedModel(structuredModel);
- }
- else {
- releaseFromEdit(id);
- }
-
- }
-
- void releaseFromRead(IStructuredModel structuredModel) {
- Object id = structuredModel.getId();
- if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
- cleanupDiscardedModel(structuredModel);
- }
- else {
- releaseFromRead(id);
- }
-
- }
- /**
- * default for use in same package, not subclasses
- *
- */
- private void releaseFromEdit(Object id) {
- // ISSUE: many of these asserts should be changed to "logs"
- // and continue to limp along?
-
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- SharedObject sharedObject = null;
-
- // ISSUE: here we need better "spec" what to do with
- // unmanaged or duplicated models. Release still needs
- // to be called on them, for now, but the model manager
- // doesn't need to do anything.
- if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
- throw new IllegalArgumentException("Ids of UNMANAGED_MODEL or DUPLICATED_MODEL are illegal here");
- }
- else {
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
-
- Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
- sharedObject.waitForLoadAttempt();
- SYNC.acquire();
- synchronized(sharedObject) {
- _decrCount(sharedObject, EDIT);
- if ((sharedObject.referenceCountForRead == 0) && (sharedObject.referenceCountForEdit == 0)) {
- discardModel(id, sharedObject);
- }
- }
- SYNC.release();
- // if edit goes to zero, but still open for read,
- // then we should reload here, so we are in synch with
- // contents on disk.
- // ISSUE: should we check isDirty here?
- // ANSWER: here, for now now. model still has its own dirty
- // flag for some reason.
- // we need to address * that * too.
-
- synchronized(sharedObject) {
- if ((sharedObject.referenceCountForRead > 0) && (sharedObject.referenceCountForEdit == 0) && sharedObject.theSharedModel.isDirty()) {
- signalPreLifeCycleListenerRevert(sharedObject.theSharedModel);
- revertModel(id, sharedObject);
- /*
- * Because model events are fired to notify about the
- * revert's changes, and listeners can still get/release
- * the model from this thread (locking prevents it being
- * done from other threads), the reference counts could
- * have changed since we entered this if block, and the
- * model could have been discarded. Check the counts again.
- */
- if (sharedObject.referenceCountForRead > 0 && sharedObject.referenceCountForEdit == 0) {
- sharedObject.theSharedModel.setDirtyState(false);
- }
- signalPostLifeCycleListenerRevert(sharedObject.theSharedModel);
- }
- }
-
- }
- }
-
- // private for now, though public forms have been requested, in past.
- private void revertModel(Object id, SharedObject sharedObject) {
- IStructuredDocument structuredDocument = sharedObject.theSharedModel.getStructuredDocument();
- FileBufferModelManager.getInstance().revert(structuredDocument);
- }
-
- private void signalPreLifeCycleListenerRevert(IStructuredModel structuredModel) {
- int type = ModelLifecycleEvent.MODEL_REVERT | ModelLifecycleEvent.PRE_EVENT;
- // what's wrong with this design that a cast is needed here!?
- ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
- ((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
- }
-
- private void signalPostLifeCycleListenerRevert(IStructuredModel structuredModel) {
- int type = ModelLifecycleEvent.MODEL_REVERT | ModelLifecycleEvent.POST_EVENT;
- // what's wrong with this design that a cast is needed here!?
- ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
- ((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
- }
-
- private void discardModel(Object id, SharedObject sharedObject) {
- SYNC.acquire();
- fManagedObjects.remove(id);
- SYNC.release();
- IStructuredDocument structuredDocument = sharedObject.theSharedModel.getStructuredDocument();
-
- if (structuredDocument == null) {
- Platform.getLog(SSECorePlugin.getDefault().getBundle()).log(new Status(IStatus.ERROR, SSECorePlugin.ID, IStatus.ERROR, "Attempted to discard a structured model but the underlying document has already been set to null: " + sharedObject.theSharedModel.getBaseLocation(), null));
- }
-
- cleanupDiscardedModel(sharedObject.theSharedModel);
- }
-
- private void cleanupDiscardedModel(IStructuredModel structuredModel) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- /*
- * This call (and setting the StructuredDocument to null) were
- * previously done within the model itself, but for concurrency it
- * must be done here during a synchronized release.
- */
- structuredModel.getFactoryRegistry().release();
-
- /*
- * For structured documents originating from file buffers, disconnect
- * us from the file buffer, now.
- */
- FileBufferModelManager.getInstance().releaseModel(structuredDocument);
-
- /*
- * Setting the document to null is required since some subclasses of
- * model might have "cleanup" of listeners, etc., to remove, which
- * were initialized during the initial setStructuredDocument.
- *
- * The model itself in particular may have internal listeners used to
- * coordinate the document with its own "structure".
- */
- structuredModel.setStructuredDocument(null);
- }
-
-
- /**
- * default for use in same package, not subclasses
- *
- */
- private void releaseFromRead(Object id) {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
- SharedObject sharedObject = null;
-
- if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
- throw new IllegalArgumentException("Ids of UNMANAGED_MODEL or DUPLICATED_MODEL are illegal here");
- }
- else {
- SYNC.acquire();
- sharedObject = (SharedObject) fManagedObjects.get(id);
- SYNC.release();
- Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
- sharedObject.waitForLoadAttempt();
- }
- SYNC.acquire();
- synchronized(sharedObject) {
- _decrCount(sharedObject, READ);
- if ((sharedObject.referenceCountForRead == 0) && (sharedObject.referenceCountForEdit == 0)) {
- discardModel(id, sharedObject);
- }
- }
- SYNC.release();
- }
-
- /**
- * This is similar to the getModel method, except this method does not use
- * the cached version, but forces the cached version to be replaced with a
- * fresh, unchanged version. Note: this method does not change any
- * reference counts. Also, if there is not already a cached version of the
- * model, then this call is essentially ignored (that is, it does not put
- * a model in the cache) and returns null.
- *
- * @deprecated - will become protected, use reload directly on model
- */
- public IStructuredModel reloadModel(Object id, java.io.InputStream inputStream) throws java.io.UnsupportedEncodingException {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-
- // get the existing model associated with this id
- IStructuredModel structuredModel = getExistingModel(id);
- // for the model to be null is probably an error (that is,
- // reload should not have been called, but we'll guard against
- // a null pointer example and return null if we are no longer managing
- // that model.
- if (structuredModel != null) {
- // get loader based on existing type
- // dmwTODO evaluate when reload should occur
- // with potentially new type (e.g. html 'save as' jsp).
- IModelHandler handler = structuredModel.getModelHandler();
- IModelLoader loader = handler.getModelLoader();
- // ask the loader to re-load
- loader.reload(Utilities.getMarkSupportedStream(inputStream), structuredModel);
- trace("re-loading model", id); //$NON-NLS-1$
- }
- return structuredModel;
- }
-
- public void saveModel(IFile iFile, String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-
- // let's see if we already have it in our cache
-
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject == null || sharedObject.theSharedModel == null) {
- SYNC.release();
- throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
- }
- else {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=221610
- *
- * Sync removed from here to prevent deadlock. Although the model
- * instance may disappear or be made invalid while the save is
- * happening, the document itself still has the contents we're
- * trying to save. Simultaneous saves should be throttled by
- * resource locking without our intervention.
- */
- boolean saved = false;
- // if this model was based on a File Buffer and we're writing back
- // to the same location, use the buffer to do the writing
- if (FileBufferModelManager.getInstance().isExistingBuffer(sharedObject.theSharedModel.getStructuredDocument())) {
- ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(sharedObject.theSharedModel.getStructuredDocument());
- IPath fileLocation = FileBuffers.normalizeLocation(iFile.getFullPath());
- if (fileLocation.equals(buffer.getLocation())) {
- buffer.commit(new NullProgressMonitor(), true);
- saved = true;
- }
- }
- if (!saved) {
- IStructuredModel model = sharedObject.theSharedModel;
- IStructuredDocument document = model.getStructuredDocument();
- saveStructuredDocument(document, iFile, encodingRule);
- trace("saving model", id); //$NON-NLS-1$
- }
- sharedObject.theSharedModel.setDirtyState(false);
- sharedObject.theSharedModel.setNewState(false);
- }
- }
-
- /**
- * Saving the model really just means to save it's structured document.
- *
- * @param id
- * @param outputStream
- * @param encodingRule
- * @throws UnsupportedEncodingException
- * @throws IOException
- * @throws CoreException
- */
- public void saveModel(String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-
- // let's see if we already have it in our cache
-
- SYNC.acquire();
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject == null) {
- SYNC.release();
- throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
- }
- else {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=221610
- *
- * Sync removed from here to prevent deadlock. Although the model
- * instance may disappear or be made invalid while the save is
- * happening, the document itself still has the contents we're
- * trying to save. Simultaneous saves should be throttled by
- * resource locking without our intervention.
- */
- /*
- * if this model was based on a File Buffer and we're writing back
- * to the same location, use the buffer to do the writing
- */
- if (FileBufferModelManager.getInstance().isExistingBuffer(sharedObject.theSharedModel.getStructuredDocument())) {
- ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(sharedObject.theSharedModel.getStructuredDocument());
- buffer.commit(new NullProgressMonitor(), true);
- }
- else {
- IFile iFile = getFileFor(sharedObject.theSharedModel);
- IStructuredModel model = sharedObject.theSharedModel;
- IStructuredDocument document = model.getStructuredDocument();
- saveStructuredDocument(document, iFile);
- trace("saving model", id); //$NON-NLS-1$
- }
- sharedObject.theSharedModel.setDirtyState(false);
- sharedObject.theSharedModel.setNewState(false);
- }
- }
-
- /**
- * @deprecated - this method is less efficient than IFile form, since it
- * requires an extra "copy" of byte array, and should be avoid
- * in favor of the IFile form.
- */
- public void saveModel(String id, OutputStream outputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
- Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-
- SYNC.acquire();
- // let's see if we already have it in our cache
- SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
- if (sharedObject == null) {
- SYNC.release();
- throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
- }
- else {
- SYNC.release();
- sharedObject.waitForLoadAttempt();
- synchronized(sharedObject) {
- CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
- codedStreamCreator.set(sharedObject.theSharedModel.getId(), new DocumentReader(sharedObject.theSharedModel.getStructuredDocument()));
- codedStreamCreator.setPreviousEncodingMemento(sharedObject.theSharedModel.getStructuredDocument().getEncodingMemento());
- ByteArrayOutputStream byteArrayOutputStream = codedStreamCreator.getCodedByteArrayOutputStream(encodingRule);
- byte[] outputBytes = byteArrayOutputStream.toByteArray();
- outputStream.write(outputBytes);
- trace("saving model", id); //$NON-NLS-1$
- sharedObject.theSharedModel.setDirtyState(false);
- sharedObject.theSharedModel.setNewState(false);
- }
- }
- }
-
- public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, CoreException, IOException {
- saveStructuredDocument(structuredDocument, iFile, EncodingRule.CONTENT_BASED);
- }
-
- public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
- Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
- if (FileBufferModelManager.getInstance().isExistingBuffer(structuredDocument)) {
- ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(structuredDocument);
- if (buffer.getLocation().equals(iFile.getFullPath()) || buffer.getLocation().equals(iFile.getLocation())) {
- buffer.commit(new NullProgressMonitor(), true);
- }
- }
- else {
- // IModelHandler handler = calculateType(iFile);
- // IDocumentDumper dumper = handler.getDocumentDumper();
- CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
- Reader reader = new DocumentReader(structuredDocument);
- codedStreamCreator.set(iFile, reader);
- codedStreamCreator.setPreviousEncodingMemento(structuredDocument.getEncodingMemento());
- EncodingMemento encodingMemento = codedStreamCreator.getCurrentEncodingMemento();
-
- // be sure document's is updated, in case exception is thrown in
- // getCodedByteArrayOutputStream
- structuredDocument.setEncodingMemento(encodingMemento);
-
- // Convert line delimiters after encoding memento is figured out,
- // but
- // before writing to output stream.
- handleConvertLineDelimiters(structuredDocument, iFile, encodingRule, encodingMemento);
-
- ByteArrayOutputStream codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream(encodingRule);
- InputStream codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
- if (iFile.exists())
- iFile.setContents(codedStream, true, true, null);
- else
- iFile.create(codedStream, false, null);
- codedByteStream.close();
- codedStream.close();
- }
- }
-
- /**
- * Common trace method
- */
- private void trace(String msg, Object id) {
- if (Logger.DEBUG_MODELMANAGER) {
- Logger.log(Logger.INFO, msg + " " + Utilities.makeShortId(id)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Common trace method
- */
- private void trace(String msg, Object id, int value) {
- if (Logger.DEBUG_MODELMANAGER) {
- Logger.log(Logger.INFO, msg + Utilities.makeShortId(id) + " (" + value + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- boolean isIdInUse(String newId) {
- boolean inUse = false;
- SYNC.acquire();
- SharedObject object =(SharedObject) fManagedObjects.get(newId);
- if (object!=null) {
- inUse = object.theSharedModel!=null;
- }
- SYNC.release();
- return inUse;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
deleted file mode 100644
index ee29ad3375..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
+++ /dev/null
@@ -1,146 +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.wst.sse.core.internal.model;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.osgi.service.prefs.Preferences;
-
-class PrefUtil {
-
- static long WAIT_INTERVAL_MS = 500;
- static int WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");
- static boolean ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");
-
- /** Base of millisecond timings, to avoid wrapping */
- private static final long MILLI_ORIGIN = System.currentTimeMillis();
-
- /**
- * Returns millisecond time offset by origin
- */
- static final long now() {
- return System.currentTimeMillis() - MILLI_ORIGIN;
- }
-
- private static IEclipsePreferences.IPreferenceChangeListener LISTENER;
- static {
- InstanceScope scope = new InstanceScope();
- IEclipsePreferences instancePrefs = scope.getNode(SSECorePlugin.ID);
- LISTENER = new IEclipsePreferences.IPreferenceChangeListener() {
-
- public void preferenceChange(PreferenceChangeEvent event) {
-
- if ("modelmanager.maxWaitDuringConcurrentLoad".equals(event.getKey())) {
- WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");
- }
- else if ("modelmanager.allowInterruptsDuringConcurrentLoad".equals(event.getKey())) {
- ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");
- }
- }
- };
- instancePrefs.addPreferenceChangeListener(LISTENER);
- }
-
- private static String getProperty(String property) {
- // Importance order is:
- // default-default < instanceScope < configurationScope < systemProperty
- // < envVar
- String value = null;
-
- if (value == null) {
- value = System.getenv(property);
- }
- if (value == null) {
- value = System.getProperty(property);
- }
- if (value == null) {
- IPreferencesService preferencesService = Platform.getPreferencesService();
-
- String key = property;
- if (property != null && property.startsWith(SSECorePlugin.ID)) {
- // +1, include the "."
- key = property.substring(SSECorePlugin.ID.length() + 1, property.length());
- }
- InstanceScope instance = new InstanceScope();
- ConfigurationScope config = new ConfigurationScope();
-
- Preferences instanceNode = instance.getNode(SSECorePlugin.ID);
- Preferences configNode = config.getNode(SSECorePlugin.ID);
- value = preferencesService.get(key, getDefault(property), new Preferences[]{configNode,instanceNode});
- }
-
- return value;
- }
-
- private static String getDefault(String property) {
- // this is the "default-default"
- if ("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad".equals(property)) {
- return "0";
- }
- else if ("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad".equals(property)) {
- return "false";
- }
- return null;
- }
-
- private static boolean getBoolean(String key) {
- String property = getProperty(key);
- // if (property != null) {
- // System.out.println("Tweak: " + key + "=" + Boolean.parseBoolean(property)); //$NON-NLS-1$ //$NON-NLS-2$
- // }
- return (property != null ? Boolean.valueOf(property) : Boolean.valueOf(getDefault(key)))
- .booleanValue();
- }
-
- private static int getInt(String key) {
- String property = getProperty(key);
- int size = 0;
- if (property != null) {
- try {
- size = Integer.parseInt(property);
- // System.out.println("Tweak: " + key + "=" + size); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (NumberFormatException e) {
- size = getDefaultInt(key, property, size);
- }
- }
- else {
- size = getDefaultInt(key, property, size);
- }
- return size;
- }
-
- private static int getDefaultInt(String key, String property, int size) {
- // ignored
- try {
- size = Integer.parseInt(getDefault(key));
- }
- catch (NumberFormatException e1) {
- handleIntParseException(key, property, e1);
- size = 0;
- }
- return size;
- }
-
- private static void handleIntParseException(String key, String property, NumberFormatException e1) {
- Exception n = new Exception(NLS.bind(
- "Exception during parse of default value for key ''{0}'' value was ''{1}''. Using 0 instead", //$NON-NLS-1$
- key, property), e1);
- n.printStackTrace();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java
deleted file mode 100644
index 60a10a886f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-
-/**
- * The entries in this registry are, conceptually, singleton's Since only one
- * instance is created in the registry, and then that instance returned when
- * required.
- *
- * Note that there is intentionally no 'remove' method, Since the registry
- * itself is read it when once, from the platform's plugin registry, and is
- * not intended to be modified after that. A change in an extenstion in a
- * plugin.xml will only take effect when the workbench is re-started.
- *
- */
-public interface EmbeddedTypeRegistry {
-
- /**
- * Method to return the specific type for the specific mimetype.
- */
- public EmbeddedTypeHandler getTypeFor(String mimeType);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java
deleted file mode 100644
index 8aa890f59b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java
+++ /dev/null
@@ -1,132 +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.sse.core.internal.modelhandler;
-
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-
-/**
- *
- */
-public class EmbeddedTypeRegistryImpl implements EmbeddedTypeRegistry {
-
- private static EmbeddedTypeRegistry instance = null;
-
- public synchronized static EmbeddedTypeRegistry getInstance() {
- if (instance == null) {
- instance = new EmbeddedTypeRegistryImpl();
- }
- return instance;
- }
-
- private HashSet hashSet = null;
- private EmbeddedTypeHandler registryDefaultHandler = null;
-
- /*
- * @see ContentTypeRegistry#getTypeFor(String)
- */
- /**
- * Constructor for ContentTypeRegistryImpl.
- */
- private EmbeddedTypeRegistryImpl() {
- super();
- hashSet = new HashSet();
- new EmbeddedTypeRegistryReader().readRegistry(hashSet);
- }
-
- /**
- * @see ContentTypeRegistry#add(ContentTypeDescription)
- */
- void add(IDocumentTypeHandler contentTypeDescription) {
- hashSet.add(contentTypeDescription);
- }
-
- private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
- return getTypeFor("text/html"); //$NON-NLS-1$
- }
-
- /**
- * Method getRegistryDefault. We cache the default handler, since can't
- * change once plugin descriptors are loaded.
- *
- * @return EmbeddedTypeHandler
- */
- private EmbeddedTypeHandler getRegistryDefault() {
- if (registryDefaultHandler == null) {
- Iterator it = hashSet.iterator();
- while ((registryDefaultHandler == null) && (it.hasNext())) { // safe
- // cast
- // since
- // 'add'
- // requires
- // EmbeddedContentTypeDescription
- EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
- if ((item != null) && (item.isDefault())) {
- registryDefaultHandler = item;
- break;
- }
- }
- }
- return registryDefaultHandler;
- }
-
- /**
- * Finds the contentTypeDescription based on literal id. Its basically a
- * "first found first returned". Note the order is fairly unpredictable,
- * so non-unique ids would cause problems.
- */
- public EmbeddedTypeHandler getTypeFor(String mimeType) {
- // Note: the reason we have this precondition is that the
- // default is different inside the registry than when called,
- // for example, from the JSPLoader. For the JSPLoader, if there
- // is no mimetype, the default should be HTML. Here, if there is
- // some mimetype, but it is not recognized, we return a default
- // for XML. This is required for various voice xml types, etc.
- EmbeddedTypeHandler found = null;
- if (mimeType == null || mimeType.trim().length() == 0) {
- found = getJSPDefaultEmbeddedType();
- } else {
- Iterator it = hashSet.iterator();
- while ((found == null) && (it.hasNext())) { // safe cast since
- // 'add' requires
- // EmbeddedContentTypeDescription
- EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
- if ((item != null) && (item.getSupportedMimeTypes().contains(mimeType))) {
- found = item;
- break;
- }
- }
- // if no exact match, do the "looser" check
- if(found == null) {
- it = hashSet.iterator();
- while ((found == null) && (it.hasNext())) {
- EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
- if ((item != null) && (item.canHandleMimeType(mimeType))) {
- found = item;
- break;
- }
- }
- }
- }
- // no matches, use default
- if (found == null) {
- found = getRegistryDefault();
- }
- return found;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java
deleted file mode 100644
index 698f7a134f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java
+++ /dev/null
@@ -1,71 +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.sse.core.internal.modelhandler;
-
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-
-public class EmbeddedTypeRegistryReader {
- protected String ATT_CLASS = "class"; //$NON-NLS-1$
- protected String EXTENSION_POINT_ID = "embeddedTypeHandler"; //$NON-NLS-1$
-
-
- protected String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- protected String TAG_NAME = "embeddedTypeHandler"; //$NON-NLS-1$
-
- EmbeddedTypeRegistryReader() {
- super();
- }
-
- protected EmbeddedTypeHandler readElement(IConfigurationElement element) {
-
- EmbeddedTypeHandler contentTypeDescription = null;
- if (element.getName().equals(TAG_NAME)) {
- try {
- contentTypeDescription = (EmbeddedTypeHandler) element.createExecutableExtension(ATT_CLASS);
- } catch (Exception e) {
- Logger.logException(e);
- }
- }
- Assert.isNotNull(contentTypeDescription, "Error reading content type description"); //$NON-NLS-1$
- return contentTypeDescription;
- }
-
- /**
- * We simply require an 'add' method, of what ever it is we are to read
- * into
- */
- void readRegistry(Set set) {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- EmbeddedTypeHandler embeddedContentType = readElement(elements[i]);
- // null can be returned if there's an error reading the
- // element
- if (embeddedContentType != null) {
- set.add(embeddedContentType);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
deleted file mode 100644
index 72bfa13e49..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.modelhandler;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public class ModelHandlerRegistry {
- private static ModelHandlerRegistry instance = null;
- static final String INTERNAL_DEFAULT_EXTENSION = "org.eclipse.wst.xml.core.internal.modelhandler"; //$NON-NLS-1$
-
- public synchronized static ModelHandlerRegistry getInstance() {
- if (instance == null) {
- instance = new ModelHandlerRegistry();
- }
- return instance;
- }
-
- private IModelHandler defaultHandler = null;
- private ModelHandlerRegistryReader reader = new ModelHandlerRegistryReader();
-
- private ModelHandlerRegistry() {
- super();
- reader = new ModelHandlerRegistryReader().readRegistry();
- }
-
- /**
- * Finds the default model handler. Note: we still go through the registry
- * to be sure to get the existing instance, but then we do remember it, so
- * subsequent requests will be faster. The first time through, we do check
- * the whole list, to be sure there is only one.
- *
- */
- final public IModelHandler getDefault() {
- if (defaultHandler == null) {
- IConfigurationElement[] elements = reader.elements;
- for (int i = 0; i < elements.length; i++) {
- boolean ofInterest = reader.isElementDefault(elements[i]);
- if (ofInterest) {
- /*
- * If, here within the search loop we've already found one
- * defaultHandler, then something is wrong!
- */
- if (defaultHandler == null) {
- defaultHandler = reader.getInstance(elements[i]);
- }
- else {
- String errorString = "Program or configuration error. More than one default content handler found"; //$NON-NLS-1$
- Logger.log(Logger.ERROR, errorString);
- throw new IllegalStateException(errorString);
- }
- }
- }
- }
- if (defaultHandler == null) {
- String errorString = "Program or configuration error. No default content type handler found."; //$NON-NLS-1$
- Logger.log(Logger.ERROR, errorString);
- throw new IllegalStateException(errorString);
- }
- return defaultHandler;
- }
-
- /**
- * Finds a ModelHandler based on literal extension id. It's basically a
- * "first found first returned". No specific order is guaranteed and the
- * uniqueness of IDs is not considered.
- *
- * @param extensionId
- * @return the given extension, or null
- */
- private IModelHandler getHandlerExtension(String extensionId) {
- IModelHandler found = null;
- IConfigurationElement[] elements = reader.elements;
- if (elements != null) {
- for (int i = 0; i < elements.length; i++) {
- String currentId = reader.getId(elements[i]);
- if (extensionId.equals(currentId)) {
- IModelHandler item = reader.getInstance(elements[i]);
- found = item;
- }
- }
- }
- else if (Logger.DEBUG){
- Logger.log(Logger.WARNING, "There were no Model Handler found in registry"); //$NON-NLS-1$
- }
- return found;
- }
-
- /**
- * Finds the registered IModelHandler for a given named file's content
- * type.
- *
- * @param file
- * @param provideDefault should the default extension be used in the absence of other methods
- * @return The IModelHandler registered for the content type of the given
- * file. If an exact match is not found, the most-specific match
- * according to IContentType.isKindOf() will be returned. If none
- * are found, either a default or null will be returned.
- * @throws CoreException
- */
- public IModelHandler getHandlerFor(IFile file, boolean provideDefault) throws CoreException {
- IModelHandler modelHandler = null;
- IContentDescription contentDescription = null;
- IContentType contentType = null;
- boolean accessible = file.isAccessible();
- if (accessible) {
- /* Try the optimized method first as the description may be cached */
- contentDescription = file.getContentDescription();
- if (contentDescription != null) {
- // use the provided description
- contentType = contentDescription.getContentType();
- }
- else {
- /* use the more thorough discovery method to get a description */
- InputStream contents = null;
- try {
- contents = file.getContents(false);
- contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), IContentDescription.ALL);
- if (contentDescription != null) {
- contentType = contentDescription.getContentType();
- }
- }
- catch (IOException e) {
- // nothing further can be done, but will log for debugging
- Logger.logException(e);
- }
- finally {
- if (contents != null) {
- try {
- contents.close();
- }
- catch (IOException e1) {
- // nothing can be done
- }
- }
- }
- }
- }
-
- /*
- * If we couldn't get the content type from a description, try basing
- * it on just the filename
- */
- if (contentType == null) {
- contentType = Platform.getContentTypeManager().findContentTypeFor(file.getName());
- }
-
- if (contentType != null) {
- modelHandler = getHandlerForContentType(contentType);
- }
- else if (contentType == null && provideDefault) {
- // hard coding for null content type
- modelHandler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
- }
-
- return modelHandler;
- }
-
- /**
- * Finds the registered IModelHandler for a given named file's content
- * type. Will check for a default.
- *
- * @param file
- * @return The IModelHandler registered for the content type of the given
- * file. If an exact match is not found, the most-specific match
- * according to IContentType.isKindOf() will be returned. If none
- * are found, either a default or null will be returned.
- * @throws CoreException
- */
- public IModelHandler getHandlerFor(IFile file) throws CoreException {
- return getHandlerFor(file, true);
- }
-
-
- /**
- * Finds the registered IModelHandler for a given named InputStream.
- *
- * @param inputName
- * @param inputStream
- * @return The IModelHandler registered for the content type of the given
- * input. If an exact match is not found, the most-specific match
- * according to IContentType.isKindOf() will be returned. If none
- * are found, either a default or null will be returned.
- * @throws IOException
- */
- public IModelHandler getHandlerFor(String inputName, InputStream inputStream) throws IOException {
- InputStream iStream = Utilities.getMarkSupportedStream(inputStream);
- IModelHandler modelHandler = null;
- IContentType contentType = null;
- if (inputStream != null) {
- try {
- iStream.mark(CodedIO.MAX_MARK_SIZE);
- contentType = Platform.getContentTypeManager().findContentTypeFor(Utilities.getLimitedStream(iStream), inputName);
- }
- finally {
- if (iStream != null && iStream.markSupported()) {
- iStream.reset();
- }
- }
-
- }
- if (contentType == null) {
- contentType = Platform.getContentTypeManager().findContentTypeFor(inputName);
- }
- // if all else failed, try to detect solely on contents; done last for
- // performance reasons
- if (contentType == null) {
- contentType = Platform.getContentTypeManager().findContentTypeFor(Utilities.getLimitedStream(iStream), null);
- }
- modelHandler = getHandlerForContentType(contentType);
- return modelHandler;
- }
-
- /**
- * Finds the registered IModelHandler for a given IContentType.
- *
- * @param contentType
- * @return The IModelHandler registered for the given content type. If an
- * exact match is not found, the most-specific match according to
- * IContentType.isKindOf() will be returned. If none are found,
- * either a default or null will be returned.
- */
- private IModelHandler getHandlerForContentType(IContentType contentType) {
- IModelHandler handler = null;
- if (contentType != null) {
- IConfigurationElement exactContentTypeElement = null;
- IConfigurationElement kindOfContentTypeElement = null;
- int kindOfContentTypeDepth = 0;
- IConfigurationElement[] elements = reader.elements;
- if (elements != null) {
- for (int i = 0; i < elements.length && exactContentTypeElement == null; i++) {
- String currentId = reader.getAssociatedContentTypeId(elements[i]);
- IContentType associatedContentType = Platform.getContentTypeManager().getContentType(currentId);
- if (contentType.equals(associatedContentType)) {
- exactContentTypeElement = elements[i];
- }
- else if (contentType.isKindOf(associatedContentType)) {
- /*
- * Update the kindOfElement variable only if this
- * element's content type is "deeper" (depth test
- * ensures the first content type is remembered)
- */
- IContentType testContentType = associatedContentType;
- int testDepth = 0;
- while (testContentType != null) {
- testDepth++;
- testContentType = testContentType.getBaseType();
- }
- if (testDepth > kindOfContentTypeDepth) {
- kindOfContentTypeElement = elements[i];
- kindOfContentTypeDepth = testDepth;
- }
- }
- }
- }
- else if (Logger.DEBUG){
- Logger.log(Logger.WARNING, "There were no Model Handler found in registry"); //$NON-NLS-1$
- }
- if (exactContentTypeElement != null) {
- handler = reader.getInstance(exactContentTypeElement);
- }
- else if (kindOfContentTypeElement != null) {
- handler = reader.getInstance(kindOfContentTypeElement);
- }
- }
-
- if (handler == null) {
- // temp hard coding for null content type arguments
- handler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
- }
- return handler;
- }
-
- /**
- * Finds the registered IModelHandler for a given content type ID. No
- * specific order is guaranteed and the uniqueness of IDs is not
- * considered.
- *
- * @param contentType
- * @return The IModelHandler registered for the given content type ID. If
- * an exact match is not found, the most-specific match according
- * to IContentType.isKindOf() will be returned. If none are found,
- * either a default or null will be returned.
- */
- public IModelHandler getHandlerForContentTypeId(String contentTypeId) {
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
- return getHandlerForContentType(contentType);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java
deleted file mode 100644
index c6d611f255..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java
+++ /dev/null
@@ -1,106 +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.sse.core.internal.modelhandler;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-
-
-/**
- * This class just converts what's in the plugins registry into a form more
- * easily useable by others, the ContentTypeRegistry.
- */
-class ModelHandlerRegistryReader {
- private HashMap allReadyCreateInstances = new HashMap();
- protected String ATT_ASSOCIATED_CONTENT_TYPE = "associatedContentTypeId"; //$NON-NLS-1$
- protected String ATT_CLASS = "class"; //$NON-NLS-1$
- protected String ATT_DEFAULT = "default"; //$NON-NLS-1$
- protected String ATT_ID = "id"; //$NON-NLS-1$
- IConfigurationElement[] elements;
- protected String EXTENSION_POINT_ID = "modelHandler"; //$NON-NLS-1$
- //
- protected String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- protected String TAG_NAME = "modelHandler"; //$NON-NLS-1$
-
- //
- /**
- * ContentTypeRegistryReader constructor comment.
- */
- ModelHandlerRegistryReader() {
- super();
- }
-
- String getAssociatedContentTypeId(IConfigurationElement element) {
- String value = element.getAttribute(ATT_ASSOCIATED_CONTENT_TYPE);
- return value;
- }
-
- String getId(IConfigurationElement element) {
- String idValue = element.getAttribute(ATT_ID);
- return idValue;
- }
-
- synchronized IModelHandler getInstance(IConfigurationElement element) {
- // May need to reconsider, but for now, we'll assume all clients must
- // subclass AbstractContentTypeIdentifier. Its easier and safer, for
- // this
- // low level "system" object. (That is, we can check and set "package
- // protected"
- // attributes.
- AbstractModelHandler modelHandler = (AbstractModelHandler) allReadyCreateInstances.get(getId(element));
- if (modelHandler == null) {
- try {
- modelHandler = (AbstractModelHandler) element.createExecutableExtension(ATT_CLASS);
- if (modelHandler != null) {
- allReadyCreateInstances.put(getId(element), modelHandler);
- String defaultValue = element.getAttribute(ATT_DEFAULT);
- if (defaultValue != null && "true".equals(defaultValue)) //$NON-NLS-1$
- modelHandler.setDefault(true);
- else
- modelHandler.setDefault(false);
- // TODO -- set and check attributes vs. created instance
- //contentTypeIdentifier.setOrCheckId(element.getAttribute(ATT_ID));
- }
- } catch (CoreException e) {
- org.eclipse.wst.sse.core.internal.Logger.logException(e);
- }
- }
- return modelHandler;
- }
-
- public boolean isElementDefault(IConfigurationElement element) {
- String defaultValue = element.getAttribute(ATT_DEFAULT);
- if (defaultValue != null && "true".equals(defaultValue)) //$NON-NLS-1$
- return true;
- else
- return false;
- }
-
- ModelHandlerRegistryReader readRegistry() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- // just remember the elements, so plugins don't have to
- // be activated, unless extension matches those "of interest".
- elements = point.getConfigurationElements();
- }
- return this;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java
deleted file mode 100644
index f0b2a4bb87..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java
+++ /dev/null
@@ -1,50 +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.sse.core.internal.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-/**
- *
- * Likely a temporary class to be replaced by plugin, eventually.
- */
-public class ModelHandlerUtility {
-
- private static ModelHandlerRegistry contentTypeRegistry;
-
- public static IDocumentTypeHandler getContentTypeFor(String string) {
- return getContentTypeRegistry().getHandlerForContentTypeId(string);
- }
-
- private static ModelHandlerRegistry getContentTypeRegistry() {
- if (contentTypeRegistry == null) {
- contentTypeRegistry = ModelHandlerRegistry.getInstance();
- }
- return contentTypeRegistry;
- }
-
- public static EmbeddedTypeHandler getDefaultEmbeddedType() {
- return getEmbeddedContentTypeFor("text/html"); //$NON-NLS-1$
- }
-
- public static EmbeddedTypeHandler getEmbeddedContentTypeFor(String string) {
- EmbeddedTypeHandler instance = null;
- instance = EmbeddedTypeRegistryImpl.getInstance().getTypeFor(string);
- return instance;
- }
-
- public ModelHandlerUtility() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java
deleted file mode 100644
index 7d2e2dd23a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java
+++ /dev/null
@@ -1,126 +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.sse.core.internal.modelhandler;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-/**
- *
- * Clients can make use of IExecutableExtension to handle the optional adapter
- * class and key. Typically, many clients use a typical pattern of providing
- * an adapter class and key in their null argument constructor anyway, so
- * they'd only have to use IExecutableExtension if the factory was for more
- * than one.
- */
-public class PluginContributedFactoryReader {
- // protected final String ATTR_ADAPTERKEY = "adapterKeyClass";
- // //$NON-NLS-1$
- // protected final String ATTR_REGISTERADAPTER = "registerAdapters";
- // //$NON-NLS-1$
- private static PluginContributedFactoryReader reader = null;
-
- public synchronized static PluginContributedFactoryReader getInstance() {
- if (reader == null) {
- reader = new PluginContributedFactoryReader();
- }
- return reader;
- }
-
- protected final String ATTR_CLASS = "class"; //$NON-NLS-1$
- protected final String ATTR_CONTENTTYPE = "contentTypeIdentiferId"; //$NON-NLS-1$
-
- protected final String EXTENSION_POINT_ID = "contentTypeFactoryContribution"; //$NON-NLS-1$
- protected final String TAG_NAME = "factory"; //$NON-NLS-1$
-
- protected PluginContributedFactoryReader() {
- super();
- }
-
- public List getFactories(IDocumentTypeHandler handler) {
- return loadRegistry(handler.getId());
- }
-
- public List getFactories(String type) {
- return loadRegistry(type);
- }
-
- protected INodeAdapterFactory loadFactoryFromConfigurationElement(IConfigurationElement element, Object requesterType) {
- INodeAdapterFactory factory = null;
- if (element.getName().equals(TAG_NAME)) {
- String contentType = element.getAttribute(ATTR_CONTENTTYPE);
- if (!requesterType.equals(contentType))
- return null;
- String className = element.getAttribute(ATTR_CLASS);
- // String adapterKeyClass = element.getAttribute(ATTR_ADAPTERKEY);
- // String registerAdapters =
- // element.getAttribute(ATTR_REGISTERADAPTER);
-
- // if className is null, then no one defined the extension point
- // for adapter factories
- if (className != null) {
- try {
- factory = (INodeAdapterFactory) element.createExecutableExtension(ATTR_CLASS);
- } catch (CoreException e) {
- // if an error occurs here, its probably that the plugin
- // could not be found/loaded
- org.eclipse.wst.sse.core.internal.Logger.logException("Could not find class: " + className, e); //$NON-NLS-1$
- } catch (Exception e) {
- // if an error occurs here, its probably that the plugin
- // could not be found/loaded -- but in any case we just
- // want
- // to log the error and continue running and best we can.
- org.eclipse.wst.sse.core.internal.Logger.logException("Could not find class: " + className, e); //$NON-NLS-1$
- }
- // if (plugin != null) {
- // factory = oldAttributesCode(element, factory, className,
- // plugin);
- //
- }
- }
-
- return factory;
- }
-
- protected List loadRegistry(Object contentType) {
- List factoryList = null; // new Vector();
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(SSECorePlugin.ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- if (elements.length > 0) {
- // this is called a lot, so don't create vector unless really
- // needed
- // TODO: could eventually cache in a hashtable, or something,
- // to avoid repeat processing
- factoryList = new Vector();
- for (int i = 0; i < elements.length; i++) {
- INodeAdapterFactory factory = loadFactoryFromConfigurationElement(elements[i], contentType);
- if (factory != null)
- factoryList.add(factory);
- }
- }
- }
- return factoryList;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java
deleted file mode 100644
index caaafd544f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java
+++ /dev/null
@@ -1,197 +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.sse.core.internal.parser;
-
-
-
-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.ITextRegion;
-
-
-/**
- * Regions of this class are intended specifically for XML/HTML/JSPs. Other
- * languages may need their own subclasses. (See the updateModel method).
- */
-public class ContextRegion implements ITextRegion {
- protected int fLength;
-
- protected int fStart;
- protected int fTextLength;
- protected String fType;
-
- protected ContextRegion() {
- super();
- }
-
- public ContextRegion(String newContext, int newStart, int newTextLength, int newLength) {
- fType = newContext;
- fStart = newStart;
- fTextLength = newTextLength;
- fLength = newLength;
- }
-
-
- public void adjust(int i) {
- fStart += i;
-
- }
-
- public void adjustLength(int i) {
- fLength += i;
- }
-
- public void adjustStart(int i) {
- fStart += i;
- }
-
- public void adjustTextLength(int i) {
- fTextLength += i;
-
- }
-
- boolean allLetterOrDigit(String changes) {
- boolean result = true;
- for (int i = 0; i < changes.length(); i++) {
- // TO_DO_FUTURE: check that a Java Letter or Digit is
- // the same thing as an XML letter or digit
- if (!(Character.isLetterOrDigit(changes.charAt(i)))) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- boolean allWhiteSpace(String changes) {
- boolean result = true;
- for (int i = 0; i < changes.length(); i++) {
- if (!Character.isWhitespace(changes.charAt(i))) {
- result = false;
- break;
- }
- }
-
- return result;
- }
-
- boolean canHandleAsLetterOrDigit(String changes, int requestStart, int lengthToReplace) {
- boolean result = false;
- // Make sure we are in a non-white space area
- if ((requestStart <= (getTextEnd())) && (allLetterOrDigit(changes))) {
- result = true;
- }
- return result;
- }
-
- boolean canHandleAsWhiteSpace(String changes, int requestStart, int lengthToReplace) {
- boolean result = false;
- // if we are in the "white space" area of a region, then
- // we don't want to handle, a reparse is needed.
- // the white space region is consider anywhere that would
- // leave whitespace between this character and the text part.
- // and of course, we can insert whitespace in whitespace region
- //
- // if there is no whitespace in this region, no need to look further
- if (getEnd() > getTextEnd()) {
- // no need to add one to end of text, as we used to, since we
- // change definition of length to equate to offset plus one.
- if (requestStart > getTextEnd()) {
- // ok, we are in the whitespace region, so we can't handle,
- // unless
- // we are just inserting whitespace.
- if (allWhiteSpace(changes)) {
- result = true;
- }
- else {
- result = false;
- }
-
- }
- }
-
- return result;
- }
-
- public boolean contains(int position) {
-
- return fStart <= position && position < fStart + fLength;
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public void setLength(int i) {
- fLength = i;
- }
-
- public void setStart(int i) {
- fStart = i;
- }
-
- public void setTextLength(int i) {
- fTextLength = i;
- }
-
- public void setType(String string) {
- fType = string;
- }
-
- public String toString() {
- String className = getClass().getName();
- String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
- String result = shortClassName + "--> " + getType() + ": " + getStart() + "-" + getTextEnd() + (getTextEnd() != getEnd() ? ("/" + getEnd()) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- // NOTE: if the document held by any region has been updated and the
- // region offsets have not
- // yet been updated, the output from this method invalid.
- return result;
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // the four types we used to handle here, have all been moved to
- // specific region classes.
- // XML_TAG_ATTRIBUTE_VALUE
- // XML_TAG_ATTRIBUTE_NAME
- // XML_CONTENT
- // XML_CDATA_TEXT
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java
deleted file mode 100644
index 9bb5a3671e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public class ForeignRegion extends ContextRegion {
-
- private String language = null;
- private String surroundingTag = null;
-
- public ForeignRegion(String newContext, int newStart, int newTextLength, int newLength) {
- super(newContext, newStart, newTextLength, newLength);
- }
-
- public ForeignRegion(String newContext, int newStart, int newTextLength, int newLength, String newLanguage) {
- super(newContext, newStart, newTextLength, newLength);
- setLanguage(newLanguage);
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String getLanguage() {
- return language;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getSurroundingTag() {
- return surroundingTag;
- }
-
- /**
- *
- * @param newLanguage
- * java.lang.String
- */
- public void setLanguage(java.lang.String newLanguage) {
- language = newLanguage;
- }
-
- /**
- * @param newSurroundingTag
- * java.lang.String
- */
- public void setSurroundingTag(java.lang.String newSurroundingTag) {
- surroundingTag = newSurroundingTag;
- }
-
- public String toString() {
- return "FOREIGN: " + super.toString();//$NON-NLS-1$
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int requestStart, int lengthToReplace) {
- org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent result = null;
- int lengthDifference = org.eclipse.wst.sse.core.internal.util.Utilities.calculateLengthDifference(changes, lengthToReplace);
- fLength += lengthDifference;
- fTextLength += lengthDifference;
- result = new RegionChangedEvent(flatnode.getParentDocument(), requester, flatnode, this, changes, requestStart, lengthToReplace);
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java
deleted file mode 100644
index a7ef2780eb..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java
+++ /dev/null
@@ -1,76 +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.sse.core.internal.preferences;
-
-/**
- * @deprecated CommonModelPreferenceNames are now managed by each individual
- * content type. (XXCorePreferenceNames)
- *
- */
-public interface CommonModelPreferenceNames {
- String TAB_WIDTH = "tabWidth";//$NON-NLS-1$
- String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
- String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
- String INDENT_USING_TABS = "indentUsingTabs";//$NON-NLS-1$
- String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
- String TAG_NAME_CASE = "tagNameCase";//$NON-NLS-1$
- String ATTR_NAME_CASE = "attrNameCase";//$NON-NLS-1$
-
- String FORMATTING_SUPPORTED = "formattingSupported";//$NON-NLS-1$
-
- String PREFERRED_MARKUP_CASE_SUPPORTED = "preferredMarkupCaseSupported";//$NON-NLS-1$
-
- String TASK_TAG_TAGS = "task-tag-tags"; //$NON-NLS-1$
- String TASK_TAG_PRIORITIES = "task-tag-priorities"; //$NON-NLS-1$
- String TASK_TAG_ENABLE = "task-tags"; //$NON-NLS-1$
- String TASK_TAG_PROJECTS_IGNORED = "task-tag-projects-toIgnore"; //$NON-NLS-1$
-
-
- /**
- * these are preferences that should be inherited from the "embedded
- * preference store" for example: if you ask for th OVERVIEW_RULER
- * preference for JSP, you will automatically get the preference from the
- * HTML preference store.
- */
- String EMBEDDED_CONTENT_TYPE_PREFERENCES[] = {TAB_WIDTH, LINE_WIDTH, SPLIT_MULTI_ATTRS, INDENT_USING_TABS, CLEAR_ALL_BLANK_LINES, TAG_NAME_CASE, ATTR_NAME_CASE,};
-
- String FORMATTING_PREFERENCES[] = {TAB_WIDTH, LINE_WIDTH, SPLIT_MULTI_ATTRS, INDENT_USING_TABS, CLEAR_ALL_BLANK_LINES,};
-
- String AUTO = "Auto";//$NON-NLS-1$
- String UTF_8 = "UTF-8";//$NON-NLS-1$
- String ISO_8859_1 = "ISO-8859-1";//$NON-NLS-1$
-
- int ASIS = 0;
- int LOWER = 1;
- int UPPER = 2;
-
- // cleanup preference names
- String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
- String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
- String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
- String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
- String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
- String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
- String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
- String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
- String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
- String LAST_ACTIVE_PAGE = "lastActivePage";//$NON-NLS-1$
-
- // need to put default tab width preference here so it is accessible by
- // both model and editor
- // this way, editor does not need to query model's default tab width
- // preference
- int DEFAULT_TAB_WIDTH = 4;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java
deleted file mode 100644
index 7505633dc3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.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.sse.core.internal.tasks.TaskTagPreferenceKeys;
-
-public class PreferenceInitializer extends AbstractPreferenceInitializer {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IEclipsePreferences taskTagDefaults = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- taskTagDefaults.putBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
- taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_TAGS, "TODO,FIXME,XXX"); //$NON-NLS-1$
- taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, "1,2,1"); //$NON-NLS-1$
- taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, ""); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
deleted file mode 100644
index 184bc03107..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.wst.sse.core.internal.propertytester;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-/**
- * A Property Tester that operates on IFiles and validates
- * that the expected content type id matches that of the content
- * type of the file, or any of the base content types.
- *
- * Based on org.eclipse.core.internal.propertytester.FilePropertyTester
- *
- * @deprecated use org.eclipse.core.resources.contentTypeId instead
- *
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216
- */
-public class StructuredFilePropertyTester extends PropertyTester {
-
- /**
- * A property indicating that we are looking to verify that the file matches
- * the content type matching the given identifier. The identifier is
- * provided as the expected value.
- */
- private static final String PROPERTY_CONTENT_TYPE_ID = "contentTypeId"; //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if(PROPERTY_CONTENT_TYPE_ID.equals(property) && (expectedValue != null) && (receiver instanceof IFile) && ((IFile) receiver).exists())
- return testContentType((IFile) receiver, expectedValue.toString());
- return false;
- }
-
- /**
- * Tests whether the content type for <code>file</code> (or any base content types)
- * matches the <code>contentTypeId</code>. It is possible that this method call could
- * cause the file to be read. It is also possible (through poor plug-in
- * design) for this method to load plug-ins.
- *
- * @param file
- * The file for which the content type should be determined; must
- * not be <code>null</code>.
- * @param contentTypeId
- * The expected content type; must not be <code>null</code>.
- * @return <code>true</code> if the file's content type (or base content types)
- * has an identifier that matches <code>contentTypeId</code>;
- * <code>false</code> otherwise.
- */
- private boolean testContentType(final IFile file, String contentTypeId) {
- final String expectedValue = contentTypeId.trim();
-
- try {
- IContentDescription contentDescription = file.getContentDescription();
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- while (contentType != null) {
- if (expectedValue.equals(contentType.getId()))
- return true;
- contentType = contentType.getBaseType();
- }
- }
- }
- catch (Exception e) {
- // [232831] - Log messages only when debugging
- if(Logger.DEBUG)
- Logger.logException(e);
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java
deleted file mode 100644
index 4aa9c807d9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.provisional;
-
-/**
- * An abstract implementation of IAdapterFactory. All implementers of
- * IAdapterFactory should subclass this class. The default constructor uses
- * itself (this) as the key. Subclasses need to provide a way to create the
- * adapter, and can override or call other methods.
- */
-abstract public class AbstractAdapterFactory implements INodeAdapterFactory {
-
-
-
- private Object fAdapterKey;
-
- private boolean fShouldRegisterAdapter;
-
- /**
- * If this default constructor used, setAdapterKey and setShouldRegister
- * should be used to properly initialize.
- */
- protected AbstractAdapterFactory() {
- super();
-
- }
-
-
- public AbstractAdapterFactory(Object adapterKey) {
- this(adapterKey, true);
- }
-
- /**
- * Suclasses may extended this constructor, if needed.
- */
-
- public AbstractAdapterFactory(Object adapterKey, boolean registerAdapters) {
-
- super();
- fAdapterKey = adapterKey;
- fShouldRegisterAdapter = registerAdapters;
-
- }
-
- /**
- * ISSUE: should be final. See those that implement it
- * for complicating details and "unknowns".
- */
- public INodeAdapter adapt(INodeNotifier target) {
- INodeAdapter adapter = null;
- if (target != null) {
- adapter = target.getExistingAdapter(fAdapterKey);
- if (adapter == null) {
- adapter = adaptNew(target);
- }
- }
- return adapter;
- }
-
- /**
- * Subclasses should normally implement their own 'copy' method. By
- * default, we'll return the same instance, for convenience of those using
- * singleton factories (which have no state, and so need to do anything on
- * 'release').
- *
- */
- public INodeAdapterFactory copy() {
- return this;
- }
-
- /**
- * This method needs to return true of this factory is for adapters of
- * type 'type'. It is required that it return true if 'equals' and this
- * default behavior is provided by this super class. Clients may extend
- * this behavior if more complex logic is required.
- */
- public boolean isFactoryForType(Object type) {
- return type.equals(fAdapterKey);
- }
-
- /**
- * Subclasses may need to "cleanup" their adapter factory, release
- * adapters, resources, etc. Subclasses may extend this method if such
- * clean up is required. Note: while current behavior is to do nothing,
- * subclasses should not assume this would always be true, so should
- * always call super.release at the end of their method.
- */
- public void release() {
- // default for superclass is to do nothing
- }
-
- /**
- * Only for special cases there the adapter key can be set in the
- * constructor. It can be set here. If it is set more than, and
- */
- final protected void setAdapterKey(Object key) {
- if (fAdapterKey != null && !(fAdapterKey.equals(key)))
- throw new IllegalStateException("INodeAdapter Key cannot be changed."); //$NON-NLS-1$
- fAdapterKey = key;
- }
-
- /**
- * Can be called by subclasses during 'adapt' process, but must not be
- * overridden or reimplemented by subclasses.
- *
- * @param target
- * @return
- */
- protected final INodeAdapter adaptNew(INodeNotifier target) {
- INodeAdapter adapter = createAdapter(target);
- if (adapter != null) {
- if (fShouldRegisterAdapter) {
- target.addAdapter(adapter);
- }
- }
- return adapter;
- }
-
- /**
- * Subclasses must implement this method. It is called by infrastructure
- * when an instance is needed. It is provided the node notifier, which may
- * or may not be relevent when creating the adapter. Note: the adapter
- * does not have to literally be a new intance and is actually recommended
- * to typically be a singleton for performance reasons.
- *
- * @param target
- * @return
- */
- abstract protected INodeAdapter createAdapter(INodeNotifier target);
-
-
- protected final boolean isShouldRegisterAdapter() {
- return fShouldRegisterAdapter;
- }
-
-
- protected final void setShouldRegisterAdapter(boolean shouldRegisterAdapter) {
- // ISSUE: technically we probably should not allow this value to
- // change, after initialization, but is not so easy to do,
- // and I'm not sure its "worth" the protection.
- fShouldRegisterAdapter = shouldRegisterAdapter;
- }
-
-
- protected final Object getAdapterKey() {
- return fAdapterKey;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
deleted file mode 100644
index 6f18471e5d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-
-
-
-/**
- * AbstractNotifier is similar to (and based on) the EMF NotifierImpl class,
- * but is not related to EMF per se. This class is simpler (that is, not as
- * many functions).
- *
- * Implementers of this INodeNotifier must subclass this class.
- */
-public abstract class AbstractNotifier implements INodeNotifier {
- private final static int growthConstant = 3;
- private int adapterCount = 0;
-
- private INodeAdapter[] fAdapters;
-
- /**
- * AbstractNotifier constructor comment.
- */
- public AbstractNotifier() {
- super();
- }
-
- /**
- * addAdapter method comment.
- */
- public synchronized void addAdapter(INodeAdapter adapter) {
-
- if (adapter == null)
- return;
- ensureCapacity(adapterCount + 1);
- fAdapters[adapterCount++] = adapter;
- }
-
- private synchronized void ensureCapacity(int needed) {
- if (fAdapters == null) {
- // first time
- fAdapters = new INodeAdapter[needed + growthConstant];
- return;
- }
- int oldLength = fAdapters.length;
- if (oldLength < needed) {
- INodeAdapter[] oldAdapters = fAdapters;
- INodeAdapter[] newAdapters = new INodeAdapter[needed + growthConstant];
- System.arraycopy(oldAdapters, 0, newAdapters, 0, adapterCount);
- fAdapters = newAdapters;
- }
- }
-
- /**
- * NOT API: used only for testing.
- *
- * @return int
- */
- public int getAdapterCount() {
- return adapterCount;
- }
-
- /**
- * Default behavior for getting an adapter.
- */
- public synchronized INodeAdapter getAdapterFor(Object type) {
- // first, we'll see if we already have one
- INodeAdapter result = getExistingAdapter(type);
- // if we didn't find one in our list already,
- // let's create it
- if (result == null) {
- FactoryRegistry reg = getFactoryRegistry();
- if (reg != null) {
- INodeAdapterFactory factory = reg.getFactoryFor(type);
- if (factory != null) {
- result = factory.adapt(this);
- }
- }
- // We won't prevent null from being returned, but it would be
- // unusual.
- // It might be because Factory is not working correctly, or
- // not installed, so we'll allow warning message.
- if ((result == null) && (org.eclipse.wst.sse.core.internal.util.Debug.displayWarnings)) {
- System.out.println("Warning: no adapter was found or created for " + type); //$NON-NLS-1$
- }
- }
- return result;
- }
-
- /**
- * Returns a shallow clone of list, since clients should not manipulate
- * our list directly. Instead, they should use add/removeAdapter.
- */
- public synchronized Collection getAdapters() {
- if (fAdapters != null) {
- if (adapterCount == 0) {
- fAdapters = null;
- return Collections.EMPTY_LIST;
- }
- else {
- // we need to make a new array, to be sure
- // it doesn't contain nulls at end, which may be
- // present there for "growth".
- INodeAdapter[] tempAdapters = new INodeAdapter[adapterCount];
- System.arraycopy(fAdapters, 0, tempAdapters, 0, adapterCount);
- // EMF uses the unmodifiableCollection. Its a bit of a
- // performance
- // drain, but may want to leave in since
- // it would "fail fast" if someone was trying to modify the
- // list.
- return Collections.unmodifiableCollection(Arrays.asList(tempAdapters));
- // return Arrays.asList(newAdapters);
- }
- }
- else
- return Collections.EMPTY_LIST;
- }
-
- private long getAdapterTimeCriteria() {
- // to "re-get" the property each time is a little awkward, but we
- // do it that way to avoid adding instance variable just for
- // debugging.
- // This method should only be called if debugAdapterNotifcationTime
- // is true.
- final String criteriaStr = Platform.getDebugOption("org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria"); //$NON-NLS-1$
- long criteria = -1;
- if (criteriaStr != null) {
- try {
- criteria = Long.parseLong(criteriaStr);
- }
- catch (NumberFormatException e) {
- // catch to be sure we don't burb in notification loop,
- // but ignore, since just a debug aid
- }
- }
- return criteria;
- }
-
- public synchronized INodeAdapter getExistingAdapter(Object type) {
- INodeAdapter result = null;
- for (int i = 0; i < adapterCount; i++) {
- INodeAdapter a = fAdapters[i];
- if (a != null && a.isAdapterForType(type)) {
- result = a;
- break;
- }
- }
- // if we didn't find one in our list,
- // return the null result
- return result;
- }
-
- abstract public FactoryRegistry getFactoryRegistry();
-
- public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-
- int localAdapterCount = 0;
- INodeAdapter[] localAdapters = null;
-
- // lock object while making local assignments
- synchronized (this) {
- if (fAdapters != null) {
- localAdapterCount = adapterCount;
- localAdapters = new INodeAdapter[localAdapterCount];
- System.arraycopy(fAdapters, 0, localAdapters, 0, localAdapterCount);
- }
- }
-
- for (int i = 0; i < localAdapterCount; i++) {
- INodeAdapter a = localAdapters[i];
-
- if (Logger.DEBUG_ADAPTERNOTIFICATIONTIME) {
- long getAdapterTimeCriteria = getAdapterTimeCriteria();
- long startTime = System.currentTimeMillis();
- // ** keep this line identical with non-debug version!!
- a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
- long notifyDuration = System.currentTimeMillis() - startTime;
- if (getAdapterTimeCriteria >= 0 && notifyDuration > getAdapterTimeCriteria) {
- System.out.println("adapter notifyDuration: " + notifyDuration + " class: " + a.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- try {
- // ** keep this line identical with debug version!!
- a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
- }
- catch (Exception e) {
- // Its important to "keep going", since notifications
- // occur between an
- // aboutToChange event and a changed event -- the
- // changed event typically being require
- // to restore state, etc. So, we just log message, do
- // not re-throw it, but
- // typically the exception does indicate a serious
- // program error.
- Logger.logException("A structured model client, " + a + " threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- }
- }
-
- public synchronized void removeAdapter(INodeAdapter a) {
- if (fAdapters == null || a == null)
- return;
- int newIndex = 0;
- INodeAdapter[] newAdapters = new INodeAdapter[fAdapters.length];
- int oldAdapterCount = adapterCount;
- boolean found = false;
- for (int oldIndex = 0; oldIndex < oldAdapterCount; oldIndex++) {
- INodeAdapter candidate = fAdapters[oldIndex];
- if (a == candidate) {
- adapterCount--;
- found = true;
- }
- else
- newAdapters[newIndex++] = fAdapters[oldIndex];
- }
- if (found)
- fAdapters = newAdapters;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java
deleted file mode 100644
index 6d7a4ecfeb..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java
+++ /dev/null
@@ -1,61 +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.sse.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public class DocumentChanged extends ModelLifecycleEvent {
- private IStructuredDocument fNewDocument;
-
- private IStructuredDocument fOldDocument;
-
- protected DocumentChanged() {
-
- super(ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED);
-
- }
-
- protected DocumentChanged(int additionalType, IStructuredModel model) {
-
- super(model, ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED | additionalType);
-
- }
-
- public DocumentChanged(int additionalType, IStructuredModel model, IStructuredDocument oldDocument, IStructuredDocument newDocument) {
-
- this(additionalType, model);
- fOldDocument = oldDocument;
- fNewDocument = newDocument;
- }
-
- public IStructuredDocument getNewDocument() {
-
- return fNewDocument;
- }
-
- public IStructuredDocument getOldDocument() {
-
- return fOldDocument;
- }
-
- void setNewDocument(IStructuredDocument newDocument) {
-
- fNewDocument = newDocument;
- }
-
- void setOldDocument(IStructuredDocument oldDocument) {
-
- fOldDocument = oldDocument;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java
deleted file mode 100644
index 87f83535b9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java
+++ /dev/null
@@ -1,27 +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.sse.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-
-/**
- * This is an early version of a class that may change over the next few
- * milestones.
- */
-
-public interface IModelLifecycleListener {
-
- void processPostModelEvent(ModelLifecycleEvent event);
-
- void processPreModelEvent(ModelLifecycleEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
deleted file mode 100644
index 53308f0ced..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
+++ /dev/null
@@ -1,87 +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.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * Responsible for creating a new Model from a resource, or as a new, empty
- * instance.
- *
- */
-public interface IModelLoader {
- /**
- * This method should perform all the model initialization required before
- * it contains content, namely, it should call newModel, the
- * createNewStructuredDocument(), then setAdapterFactories. (this is
- * tentative)
- */
- IStructuredModel createModel();
-
- /**
- * Method createModel. Creates a new model based on old one.
- *
- * @param oldModel
- * @return IStructuredModel
- */
- IStructuredModel createModel(IStructuredModel oldModel);
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- List getAdapterFactories();
-
- void load(IFile file, IStructuredModel model) throws IOException, CoreException;
-
- void load(InputStream inputStream, IStructuredModel model, EncodingRule encodingRule) throws IOException;
-
- void load(String filename, InputStream inputStream, IStructuredModel model, String encodingName, String lineDelimiter) throws IOException;
-
- IModelLoader newInstance();
-
- /**
- * This method should always return an new, empty Structured Model
- * appropriate for itself.
- */
- IStructuredModel newModel();
-
- IStructuredModel reinitialize(IStructuredModel model);
-
- /**
- * This method should get a fresh copy of the data, and repopulate the
- * models ... normally by a call to setText on the structuredDocument, for
- * StructuredModels. This method is needed in some cases where clients are
- * sharing a model and then changes canceled. Say for example, one editor
- * and several "displays" are sharing a model, if the editor is closed
- * without saving changes, then the displays still need a model, but they
- * should revert to the original unsaved version.
- */
- void reload(InputStream inputStream, IStructuredModel model);
-
- /**
- * Create a Structured Model with the given StructuredDocument instance as
- * its document (instead of a new document instance as well)
- */
- IStructuredModel createModel(IStructuredDocument document, String baseLocation, IModelHandler handler);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
deleted file mode 100644
index b23d0fa9a1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-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.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
-/**
- * <p>
- * Provides APIs for managing (get, release, save, and save as) SSE Structured
- * Models.
- * </p>
- * <p>
- * Structured Models created from an implementor of this interface can be
- * either managed or unmanaged. Managed models are shared using reference
- * counts, so until that count has been decremented to zero, the model will
- * continue to exist in memory. When managed, models can be looked up using
- * their IDs or their IStructuredDocuments, which can be advantageous when
- * building on APIs that aren't specifically designed for SSE (such as those
- * revolving around IDocuments). Unmanaged models offer no such features, and
- * are largely used for tasks where their contents are ephemeral, such as for
- * populating a source viewer with syntax-colored content.
- * </p>
- * <p>
- * There are two types of access used when retrieving a model from the model
- * manager: READ and EDIT. The contents of a model can be modified regardless
- * of which access type is used, but any client who gets a model for EDIT is
- * explicitly declaring that they are interested in saving those changed
- * contents. The EDIT and READ reference counts are visible to everyone, as
- * are convenience methods for determining whether a managed model is shared
- * among multiple clients accessing it for READ or EDIT.
- * </p>
- * <p>
- * Managed models whose contents are "dirty" with READ and EDIT counts above
- * zero will be reverted to the on-disk content if the EDIT count drops to
- * zero while the READ count remains above zero.
- * </p>
- * <p>
- * Shared models for which the read and edit counts have both dropped to zero
- * are no longer valid for use, regardless of whether they have been garbage
- * collected or not. It is possible, but not guaranteed, that the underlying
- * structured document is still valid and may even be used in constructing a
- * new shared model.
- * </p>
- * <p>
- *
- * @noimplement This interface is not intended to be implemented by clients.
- * Clients should obtain an instance of the IModelManager interface through
- * {@link StructuredModelManager#getModelManager()}.</p>
- * </p>
- * <p>
- * @see {@link StructuredModelManager}</p>
- */
-public interface IModelManager {
-
- /**
- * A fixed ID used for models which were created as duplicates of existing
- * models
- */
- public final static String DUPLICATED_MODEL = "org.eclipse.wst.sse.core.IModelManager.DUPLICATED_MODEL"; //$NON-NLS-1$
-
- /**
- * A fixed ID used for unmanaged models
- */
- public final static String UNMANAGED_MODEL = "org.eclipse.wst.sse.core.IModelManager.UNMANAGED_MODEL"; //$NON-NLS-1$
-
- /**
- * Calculate id provides a common way to determine the id from the input
- * ... needed to get and save the model. It is a simple class utility, but
- * is an instance method so can be accessed via interface.
- */
- public String calculateId(IFile file);
-
- /**
- * Copies a model with the old id
- * @param oldId - the old model's ID
- * @param newId - the new model's ID
- * @return the new model
- * @throws ResourceInUse if the given new ID is already in use by a managed model
- */
- IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse;
-
- /**
- * Creates a new, but empty, unmanaged model of the same kind as the one
- * given. For a managed model with the same contents, use "copy".
- *
- * @param model
- * @return the model, or null of one could not be created
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- public IStructuredModel createNewInstance(IStructuredModel model) throws IOException;
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. If the resource does already exist, then
- * createStructuredDocumentFor is the right API to use.
- *
- * @param iFile
- * @return the document, or null if one could not be created
- * @throws ResourceAlreadyExists
- * if the IFile already exists
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- * @throws ResourceAlreadyExists if the give file already exists
- */
- IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException;
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. Note: clients should verify IFile exists before using
- * this method. If this IFile does not exist, then
- * {@link #createNewStructuredDocumentFor(IFile)} is the correct API to use.
- *
- * @param iFile - the file
- * @return the document, or null if one could not be created
- *
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException;
-
- /**
- * Convenience method, since a proper IStructuredDocument must have a
- * proper parser assigned. It should only be used when an empty
- * structuredDocument is needed. Otherwise, use IFile form.
- *
- * @param contentTypeId
- * @return a structured document with the correct parsing setup for the
- * given content type ID, or null if one could not be created or
- * the given content type ID is unknown or unsupported
- */
- IStructuredDocument createStructuredDocumentFor(String contentTypeId);
-
- /**
- * @deprecated - use IFile form instead as the correct encoding and content rules may not be applied otherwise
- *
- * Creates and returns a properly configured structured document for the given contents with the given name
- *
- * @param filename - the filename, which may be used to guess the content type
- * @param contents - the contents to load
- * @param resolver - the URIResolver to use for locating any needed resources
- * @return the IStructuredDocument or null of one could not be created
- * @throws IOException if the file's contents can not be read or its content type can not be determined
- */
- IStructuredDocument createStructuredDocumentFor(String filename, InputStream contents, URIResolver resolver) throws IOException;
-
- /**
- * Creates and returns a properly configured structured document for the given contents with the given name
- *
- * @param filename - the filename, which may be used to guess the content type
- * @param inputStream - the contents to load
- * @param resolver - the URIResolver to use for locating any needed resources
- * @param ianaEncodingName - the IANA specified encoding to use when reading the contents
- * @return the IStructuredDocument or null if one could not be created
- * @throws IOException if the file's contents can not be read or its content type can not be determined
- * @deprecated - clients should convert the InputStream into text themselves
- * and then use the version of this method taking a String for its
- * content
- */
- IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String ianaEncodingName) throws IOException;
-
- /**
- * Creates and returns a properly configured structured document for the given contents with the given name
- *
- * @param filename - the filename, which may be used to guess the content type
- * @param content - the contents to load
- * @param resolver - the URIResolver to use for locating any referenced resources
- * @return a structured document with the correct parsing setup for the
- * given filename, or null if one could not be created
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException;
-
- /**
- * Creates and returns an unmanaged model populated with the given IFile's
- * contents
- *
- * @param iFile
- * @return a structured model, or null if one could not be created
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException;
-
- /**
- * Convenience method. It depends on the loader's newModel method to return
- * an appropriate StrucuturedModel appropriately initialized.
- *
- * @param contentTypeId
- * @return a structured model for the given content type, or null if one could not be created or the content type is unsupported
- */
- IStructuredModel createUnManagedStructuredModelFor(String contentTypeId);
-
- /**
- * @deprecated
- */
- IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver);
-
- /**
- * Note: callers of this method must still release the model when finished.
- *
- * @param document
- * @return the structured model containing the give document, incrementing
- * its edit count, or null if there is not a model corresponding
- * to this document.
- */
- IStructuredModel getExistingModelForEdit(IDocument document);
-
- /**
- * @param file
- * @return the structured model for the given file, incrementing its edit
- * count, or null if one does not already exist for this file.
- */
- IStructuredModel getExistingModelForEdit(IFile file);
-
- /**
- * @param id
- * @return the structured model with the given ID, incrementing its edit
- * count, or null if one does not already exist for this ID
- */
- public IStructuredModel getExistingModelForEdit(Object id);
-
- /**
- * Note: callers of this method must still release the model when finished.
- *
- * @param document
- * @return the structured model containing the give document, incrementing
- * its read count, or null if there is not a model corresponding
- * to this document.
- */
- IStructuredModel getExistingModelForRead(IDocument document);
-
- /**
- * @param file
- * @return the structured model for the given file, incrementing its read
- * count, or null if one does not already exist for this file.
- */
- public IStructuredModel getExistingModelForRead(IFile iFile);
-
- /**
- * @param id
- * @return the structured model with the given ID, incrementing its edit
- * count, or null if one does not already exist for this ID
- */
- public IStructuredModel getExistingModelForRead(Object id);
-
- /**
- * @deprecated - internal information
- */
- public Enumeration getExistingModelIds();
-
- /**
- * Returns a structured model for the given file. If one does not already
- * exists, one will be created with an edit count of 1. If one already
- * exists, its edit count will be incremented before it is returned.
- *
- * @param iFile
- * @return a structured model for the given file, or null if one could not
- * be found or created
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException;
-
- /**
- * Returns a structured model for the given file. If one does not already
- * exists, one will be created with an edit count of 1. If one already
- * exists, its edit count will be incremented before it is returned.
- *
- * @param iFile
- * @param encodingRule the rule for handling encoding
- * @return a structured model for the given file, or null if one could not
- * be found or created
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- * @deprecated - encoding is handled automatically based on the file's
- * contents or user preferences
- */
- public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * @deprecated - Encoding and the line delimiter used are handled
- * automatically based on the file's contents or user
- * preferences.
- */
- public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * Returns a structured model for the given document. If one does not
- * already exists, one will be created with an edit count of 1. If one
- * already exists, its edit count will be incremented before it is
- * returned. This method is intended only to interact with documents
- * contained within File Buffers.
- *
- * @param textFileBufferDocument
- * @return a structured model for the given document, or null if there is
- * insufficient information known about the document instance to
- * do so
- */
- public IStructuredModel getModelForEdit(IStructuredDocument textFileBufferDocument);
-
- /**
- * Returns a structured model for the given contents using the given ID.
- * If one does not already exist, one will be created with an edit count
- * of 1. If one already exists, its edit count will be incremented before
- * it is returned.
- *
- * @param id
- * - the id for the model
- * @param inStream
- * - the initial contents of the model
- * @param resolver
- * - the URIResolver to use for locating any needed resources
- * @return a structured model for the given content, or null if one could
- * not be found or created
- * @throws UnsupportedEncodingException
- * @throws IOException
- * if the contents can not be read or its detected encoding
- * does not support its contents
- * @deprecated - a URI resolver should be automatically created when
- * needed
- */
- public IStructuredModel getModelForEdit(String id, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
-
- /**
- * Returns a structured model for the given file. If one does not already
- * exists, one will be created with a read count of 1. If one already
- * exists, its read count will be incremented before it is returned.
- *
- * @param iFile
- * @return a structured model for the given file, or null if one could not
- * be found or created
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException;
-
- /**
- * @deprecated - encoding is handled automatically based on the file's
- * contents or user preferences
- */
- public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * @deprecated - Encoding and the line delimiter used are handled
- * automatically based on the file's contents or user
- * preferences.
- */
- public IStructuredModel getModelForRead(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * Returns a structured model for the given document. If one does not
- * already exists, one will be created with a read count of 1. If one
- * already exists, its read count will be incremented before it is
- * returned. This method is intended only to interact with documents
- * contained within File Buffers.
- *
- * @param textFileBufferDocument
- * @return a structured model for the given document, or null if there is
- * insufficient information known about the document instance to
- * do so
- */
- public IStructuredModel getModelForRead(IStructuredDocument textFileBufferDocument);
-
- /**
- * Returns a structured model for the given contents using the given ID.
- * If one does not already exist, one will be created with an read count
- * of 1. If one already exists, its read count will be incremented before
- * it is returned.
- *
- * @param id
- * - the id for the model
- * @param inStream
- * - the initial contents of the model
- * @param resolver
- * - the URIResolver to use for locating any needed resources
- * @return a structured model for the given content, or null if one could
- * not be found or created
- * @throws UnsupportedEncodingException
- * @throws IOException
- * if the contents can not be read or its detected encoding
- * does not support its contents
- * @deprecated - a URI resolver should be automatically created when
- * needed
- */
- public IStructuredModel getModelForRead(String filename, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
-
- /**
- * This method will not create a new model if it already exists ... if
- * force is false. The idea is that a client should call this method once
- * with force set to false. If the exception is thrown, then prompt client
- * if they want to overwrite.
- *
- * @param iFile
- * @param force
- * @return the new structured model, or
- * @throws ResourceInUse if the given new ID is already in use by a managed model
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- * @throws ResourceAlreadyExists if the give file already exists
- */
- IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
- /**
- * This method will not create a new model if it already exists ... if
- * force is false. The idea is that a client should call this method once
- * with force set to false. If the exception is thrown, then prompt client
- * if they want to overwrite.
- *
- * @param iFile
- * @param force
- * @return the new structured model, or
- * @throws ResourceInUse if the given new ID is already in use by a managed model
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- * @throws ResourceAlreadyExists if the give file already exists
- */
- IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
- /**
- * This function returns the combined "read" and "edit" reference counts
- * of underlying model.
- *
- * @param id
- * Object The id of the model
- * @deprecated - internal information that can be obtained from the model
- * itself
- */
- int getReferenceCount(Object id);
-
- /**
- * This function returns the "edit" reference count of underlying model.
- *
- * @param id
- * Object The id of the model
- * @deprecated - internal information that can be obtained from the model itself
- */
- int getReferenceCountForEdit(Object id);
-
- /**
- * This function returns the "read" reference count of underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- * @deprecated - internal information that can be obtained from the model itself
- */
- int getReferenceCountForRead(Object id);
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- *
- * @param id
- * Object The id of the model
- */
- boolean isShared(Object id);
-
- /**
- * This function returns true if there are other "edit" references to the
- * underlying model.
- *
- * @param id
- * Object The id of the model
- */
- boolean isSharedForEdit(Object id);
-
- /**
- * This function returns true if there are other "read" references to the
- * underlying model.
- *
- * @param id
- * Object The id of the model
- */
- boolean isSharedForRead(Object id);
-
- /**
- * @deprecated - not granular enough
- *
- * This method can be called to determine if the model manager is within a
- * "aboutToChange" and "changed" sequence.
- */
- public boolean isStateChanging();
-
- /**
- * This method changes the id of the model.
- *
- * TODO: try to refine the design
- * not to use this function
- *
- * @deprecated
- */
- void moveModel(Object oldId, Object newId);
-
- /**
- * This method can be called when the content type of a model changes. It's
- * assumed the contentType has already been changed, and this method uses
- * the text of the old one, to repopulate the text of the new one. In
- * theory, the actual instance could change, (e.g. using 'saveAs' to go
- * from xml to dtd), but in practice, the intent of this API is to return
- * the same instance, just using different handlers, adapter factories,
- * etc.
- */
- IStructuredModel reinitialize(IStructuredModel model) throws IOException;
-
- /**
- * This is similar to the getModel method, except this method does not use
- * the cached version, but forces the cached version to be replaced with a
- * fresh, unchanged version. Note: this method does not change any
- * reference counts. Also, if there is not already a cached version of the
- * model, then this call is essentially ignored (that is, it does not put
- * a model in the cache) and returns null.
- *
- * @deprecated
- */
- IStructuredModel reloadModel(Object id, InputStream inStream) throws UnsupportedEncodingException;
-
- /**
- * Saves the contents of the given structured document to the given file. If
- * the document belongs to a managed model, that model will be saved and
- * marked as non-dirty.
- *
- * @param structuredDocument
- * - the structured document
- * @param iFile
- * - the file to save to
- * @throws UnsupportedEncodingException
- * @throws CoreException if the file's contents or description can not be read
- * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
- */
- void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java
deleted file mode 100644
index b14e473736..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java
+++ /dev/null
@@ -1,64 +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.sse.core.internal.provisional;
-
-
-
-/**
- * Interface for those wanting to listen to a model's state changing.
- */
-public interface IModelStateListener {
-
- /**
- * A model is about to be changed. This typically is initiated by one
- * client of the model, to signal a large change and/or a change to the
- * model's ID or base Location. A typical use might be if a client might
- * want to suspend processing until all changes have been made.
- */
- void modelAboutToBeChanged(IStructuredModel model);
-
- /**
- * Signals that the changes foretold by modelAboutToBeChanged have been
- * made. A typical use might be to refresh, or to resume processing that
- * was suspended as a result of modelAboutToBeChanged.
- */
- void modelChanged(IStructuredModel model);
-
- /**
- * Notifies that a model's dirty state has changed, and passes that state
- * in isDirty. A model becomes dirty when any change is made, and becomes
- * not-dirty when the model is saved.
- */
- void modelDirtyStateChanged(IStructuredModel model, boolean isDirty);
-
- /**
- * A modelDeleted means the underlying resource has been deleted. The
- * model itself is not removed from model management until all have
- * released it. Note: baseLocation is not (necessarily) changed in this
- * event, but may not be accurate.
- */
- void modelResourceDeleted(IStructuredModel model);
-
- /**
- * A model has been renamed or copied (as in saveAs..). In the renamed
- * case, the two paramenters are the same instance, and only contain the
- * new info for id and base location.
- */
- void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel);
-
- void modelAboutToBeReinitialized(IStructuredModel structuredModel);
-
- void modelReinitialized(IStructuredModel structuredModel);
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java
deleted file mode 100644
index e88a24f5bd..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.provisional;
-
-/**
- * This interface allows nodes to be adapted.
- *
- * The main difference between this type of adapter (IAdaptable) and base
- * adapter is that these adapters are notified of changes.
- *
- * @plannedfor 1.0
- */
-
-public interface INodeAdapter {
-
- /**
- * The infrastructure calls this method to determine if the adapter is
- * appropriate for 'type'. Typically, adapters return true based on
- * identity comparison to 'type', but this is not required, that is, the
- * decision can be based on complex logic.
- *
- */
- boolean isAdapterForType(Object type);
-
- /**
- * Sent to adapter when notifier changes. Each notifier is responsible for
- * defining specific eventTypes, feature changed, etc.
- *
- * ISSUE: may be more evolvable if the argument was one big 'notifier
- * event' instance.
- */
- void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java
deleted file mode 100644
index d6a25062ae..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java
+++ /dev/null
@@ -1,76 +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.sse.core.internal.provisional;
-
-/**
- * INodeNotifiers can be adapted by INodeAdapters. This factory interface
- * provides a way to provide factories which are invoked by the infrastructure
- * to manage this process, from creating, to adapting, to releasing, if
- * required.
- *
- * @plannedfor 1.0
- *
- */
-public interface INodeAdapterFactory {
-
- /**
- * The primary purpose of an adapter factory is to create an adapter and
- * associate it with an INodeNotifier. This adapt method Method that
- * returns the adapter associated with the given object. The
- * implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter, if appropriate.
- *
- * Note: the instance of the adapter returned may be a singleton or not
- * ... depending on the needs of the INodeAdapter ... but in general it is
- * recommended for an adapter to be stateless, so the efficiencies of a
- * singleton can be gained.
- *
- * @param object
- * the node notifier to be adapted
- */
- INodeAdapter adapt(INodeNotifier object);
-
- /**
- * Unlike clone, this method may or may not return the same instance, such
- * as in the case where the IAdapterFactory is intended to be a singleton.
- *
- * @return an instance of this adapter factory.
- */
- public INodeAdapterFactory copy();
-
- /**
- * isFactoryForType is called by infrastructure to decide if this adapter
- * factory is apporiate to use for an adapter request that specifies
- * 'type'.
- *
- * @param type -
- * same object used to identify/request adapters.
- * @return true if factory is appropriate for type, false otherwise.
- */
- boolean isFactoryForType(Object type);
-
- /**
- * release is called by infrastructure when the factory registry is
- * released (which is done when a structured model is released). This
- * intened for the factory to be allowed to clean up any state information
- * it may have.
- *
- * Note: while not recommended, due to performance reasons, if individual
- * adapters need some cleanup (or need to be released) it is (typically)
- * the responsibility of the adapter factory to track them, and initiate
- * what ever clean up is needed. In other works, cleanup at the adatper
- * level is not provided by infrastructure.
- */
- public void release();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
deleted file mode 100644
index a76fe75b74..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-
-
-import java.util.Collection;
-
-/**
- * INodeNotifiers and INodeAdapters form a collaboration that allows clients
- * to use the typical adapter pattern but with notification added, that is,
- * client's adapters will be notified when the nodeNotifier changes.
- *
- * @plannedfor 1.0
- */
-
-public interface INodeNotifier {
-
- /**
- * The change represents a non-structural change, sent to node notifier's
- * parent.
- */
- static final int CHANGE = 1;
- /**
- * The change represents an add event.
- */
- static final int ADD = 2;
-
- /**
- * The change represents a remove event.
- */
- static final int REMOVE = 3;
-
- /**
- * The change represents a structural change, sent to least-common parent
- * of node notifiers involved in the structural change
- */
- static final int STRUCTURE_CHANGED = 4;
-
- /**
- * The change represents a notification to parent notifier than its
- * contents have changed.
- */
- static final int CONTENT_CHANGED = 5;
-
-
- /**
- * NOT API: these strings are for printing, such as during debugging
- */
- static final String[] EVENT_TYPE_STRINGS = new String[]{"undefined", "CHANGE", "ADD", "REMOVE", "STRUCTURE_CHANGED", "CONTENT_CHANGED"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
-
- /**
- * Add an adapter of this notifier.
- *
- * @param adapter
- * the adapter to be added
- *
- */
- void addAdapter(INodeAdapter adapter);
-
- /**
- * Return an exisiting adapter of type "type" or if none found create a
- * new adapter using a registered adapter factory
- */
- INodeAdapter getAdapterFor(Object type);
-
- /**
- * Return a read-only Collection of the Adapters to this notifier.
- *
- * @return collection of adapters.
- */
- Collection getAdapters();
-
- /**
- * Return an exisiting adapter of type "type" or null if none found
- */
- INodeAdapter getExistingAdapter(Object type);
-
- /**
- * sent to adapter when its nodeNotifier changes.
- */
- void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos);
-
- /**
- * Remove an adapter of this notifier. If the adapter does not exist for
- * this node notifier, this request is ignored.
- *
- * @param adapter
- * the adapter to remove
- */
- void removeAdapter(INodeAdapter adapter);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
deleted file mode 100644
index 86690199d5..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
-
-/**
- * IStructuredModels are mainly interesting by their extensions and
- * implementers. The main purposed of this abstraction is to provide a common
- * means to manage models that have an associated structured document.
- *
- * <p>
- * TODO: this interface needs ton of cleanup!
- * </p>
- *
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IStructuredModel extends IAdaptable {
-
-
- /**
- * This API allows clients to declare that they are about to make a
- * "large" change to the model. This change might be in terms of content
- * or it might be in terms of the model id or base location.
- *
- * Note that in the case of embedded calls, notification to listeners is
- * sent only once.
- *
- * Note that the client who is making these changes has the responsibility
- * to restore the model's state once finished with the changes. See
- * getMemento and restoreState.
- *
- * The method isModelStateChanging can be used by a client to determine if
- * the model is already in a change sequence.
- *
- * This method is a matched pair to changedModel, and must be called
- * before changedModel. A client should never call changedModel without
- * calling aboutToChangeModel first nor call aboutToChangeModel without
- * calling changedModel later from the same Thread.
- */
- void aboutToChangeModel();
-
- void addModelLifecycleListener(IModelLifecycleListener listener);
-
- void addModelStateListener(IModelStateListener listener);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, int cursorPosition, int selectionLength);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, int cursorPosition, int selectionLength);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, String description);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength);
-
- /**
- * This API allows a client controlled way of notifying all ModelEvent
- * listeners that the model has been changed. This method is a matched
- * pair to aboutToChangeModel, and must be called after aboutToChangeModel
- * ... or some listeners could be left waiting indefinitely for the
- * changed event. So, its suggested that changedModel always be in a
- * finally clause. Likewise, a client should never call changedModel
- * without calling aboutToChangeModel first.
- *
- * In the case of embedded calls, the notification is just sent once.
- *
- */
- void changedModel();
-
- long computeModificationStamp(IResource resource);
-
- /**
- * @deprecated
- * @see IModelManager#copyModelForEdit(String, String)
- */
- IStructuredModel copy(String id) throws ResourceInUse, ResourceAlreadyExists;
-
- /**
- * Disable undo management.
- *
- * @deprecated - the ability to enable and disable Undo management for the
- * model cannot be guaranteed as it implicitly requires
- * knowledge of the underlying undo/redo implementation
- */
- void disableUndoManagement();
-
- /**
- * Enable undo management.
- *
- * @deprecated - the ability to enable and disable Undo management for the
- * model cannot be guaranteed as it implicitly requires
- * knowledge of the underlying undo/redo implementation
- */
- void enableUndoManagement();
-
- /**
- * End recording undo transactions.
- */
- void endRecording(Object requester);
-
- /**
- * End recording undo transactions.
- */
- void endRecording(Object requester, int cursorPosition, int selectionLength);
-
- /**
- * This is a client-defined value for what that client (and/or loader)
- * considers the "base" of the structured model. Frequently the location
- * is either a workspace root-relative path of a workspace resource or an
- * absolute location in the local file system.
- *
- * @return the base location of the model or <code>null</code> when one
- * has not been set, such as in models resulting from calling
- * {@link IModelManager#createNewInstance(IStructuredModel)}
- */
- String getBaseLocation();
-
- /**
- * @return The associated content type identifier (String) for this model.
- * This value may be more accurate than the content type against
- * which the model handler was registered.
- *
- * @see IModelHandler#getAssociatedContentTypeId()
- */
- String getContentTypeIdentifier();
-
- /**
- *
- * @return The model's FactoryRegistry. A model is not valid without one.
- */
- FactoryRegistry getFactoryRegistry();
-
- /**
- * The id is the id that the model manager uses to identify this model
- */
- String getId();
-
- /**
- * @param offset
- * a text offset within the structured document
- * @return an IndexedRegion containing this offset or null if one could
- * not be found
- */
- IndexedRegion getIndexedRegion(int offset);
-
- /**
- * @return the model's handler
- */
- IModelHandler getModelHandler();
-
- IModelManager getModelManager();
-
- /**
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- *
- * @return the reference count of underlying model
- */
- int getReferenceCount();
-
- /**
- * This function returns the edit-responsible reference count of
- * underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- */
- int getReferenceCountForEdit();
-
- /**
- * This function returns the reader reference count of underlying model.
- *
- * @param id
- * Object The id of the model TODO: try to refine the design
- * not to use this function
- */
- int getReferenceCountForRead();
-
- Object getReinitializeStateData();
-
- /**
- * Get URI resolution helper
- *
- * @deprecated - use org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin.createResolver(*) instead
- */
- URIResolver getResolver();
-
- IStructuredDocument getStructuredDocument();
-
- /**
- * modification date of underlying resource, when this model was open, or
- * last saved. (Note: for this version, the client must manage the
- * accuracy of this data)
- */
- long getSynchronizationStamp();
-
- /**
- * Get undo manager.
- */
- IStructuredTextUndoManager getUndoManager();
-
- /**
- *
- */
- boolean isDirty();
-
- /**
- * This method can be called to determine if the model is within a
- * "aboutToChange" and "changed" sequence.
- */
- public boolean isModelStateChanging();
-
- /**
- *
- */
- boolean isNew();
-
- boolean isReinitializationNeeded();
-
- /**
- * This is a combination of if the model is dirty and if the model is
- * shared for write access. The last writer as the responsibility to be
- * sure the user is prompted to save.
- */
- public boolean isSaveNeeded();
-
- /**
- * This function returns true if either isSharedForRead or isSharedForEdit
- * is true.
- */
- boolean isShared();
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- boolean isSharedForEdit();
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- boolean isSharedForRead();
-
- /**
- * newInstance is similar to clone, except that the newInstance contains
- * no content. Its purpose is so clients can get a temporary, unmanaged,
- * model of the same "type" as the original. Note: the client may still
- * need to do some initialization of the model returned by newInstance,
- * depending on desired use. For example, the only factories in the
- * newInstance are those that would be normally be created for a model of
- * the given contentType. Others are not copied automatically, and if
- * desired, should be added by client.
- */
- IStructuredModel newInstance() throws IOException;
-
- /**
- * Performs a reinitialization procedure. For this model. Note for future:
- * there may be a day where the model returned from this method is a
- * different instance than the instance it was called on. This will occur
- * when there is full support for "save as" type functions, where the
- * model could theoretically change completely.
- */
- IStructuredModel reinit() throws IOException;
-
- /**
- * This function allows the model to free up any resources it might be
- * using. In particular, itself, as stored in the IModelManager.
- *
- */
- void releaseFromEdit();
-
- /**
- * This function allows the model to free up any resources it might be
- * using. In particular, itself, as stored in the IModelManager.
- *
- */
- void releaseFromRead();
-
- /**
- * This function replenishes the model with the resource without saving
- * any possible changes. It is used when one editor may be closing, and
- * specifically says not to save the model, but another "display" of the
- * model still needs to hang on to some model, so needs a fresh copy.
- *
- * Only valid for use with managed models.
- */
- IStructuredModel reload(InputStream inputStream) throws IOException;
-
- void removeModelLifecycleListener(IModelLifecycleListener listener);
-
- void removeModelStateListener(IModelStateListener listener);
-
- /**
- * A method that modifies the model's synchronization stamp to match the
- * resource. Turns out there's several ways of doing it, so this ensures a
- * common algorithm.
- */
- void resetSynchronizationStamp(IResource resource);
-
- void resourceDeleted();
-
- void resourceMoved(IStructuredModel newModel);
-
- void save() throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * @deprecated - will save according to the encoding priorities specified for the IFile
- */
- void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
- void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * @deprecated - will save according to the encoding priorities specified for the IFile
- */
- void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
- void save(OutputStream outputStream) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * Sets the base location of this model to the new value, also updating
- * the value in its URI resolution helper if one is present.
- *
- * @param newBaseLocation
- */
- void setBaseLocation(String newBaseLocation);
-
- public void setDirtyState(boolean dirtyState);
-
- void setFactoryRegistry(FactoryRegistry registry);
-
- /**
- * The id is the id that the model manager uses to identify this model
- */
- void setId(String id) throws ResourceInUse;
-
- void setModelHandler(IModelHandler modelHandler);
-
- void setModelManager(IModelManager modelManager);
-
- public void setNewState(boolean newState);
-
- /**
- * Sets a "flag" that reinitialization is needed.
- */
- void setReinitializeNeeded(boolean b);
-
- /**
- * Holds any data that the reinitialization procedure might find useful in
- * reinitializing the model. This is handy, since the reinitialization may
- * not take place at once, and some "old" data may be needed to properly
- * undo previous settings. Note: the parameter was intentionally made to
- * be of type 'Object' so different models can use in different ways.
- */
- void setReinitializeStateData(Object object);
-
- /**
- * Set the URI resolution helper
- */
- void setResolver(URIResolver uriResolver);
-
- void setStructuredDocument(IStructuredDocument structuredDocument);
-
- /**
- * Set undo manager.
- */
- void setUndoManager(IStructuredTextUndoManager undoManager);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
deleted file mode 100644
index a9e953861b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-
-
-/**
- * This type is used to indicate positions and lengths in source. Notice that
- * while getEndOffset and getLength are redundant, given that
- *
- * <pre>
- * <code>
- * getEndOffset() == getStartOffset() + getLength();
- * </code>
- * </pre>
- *
- * we provide (require) both since in some cases implementors may be able to
- * provide one or the other more efficiently.
- *
- * Note: it is not part of the API contract that implementors of IndexedRegion --
- * as a whole collection for a particular source -- must completely cover the
- * original source. They currently often do, so thought I'd mention explicitly
- * this may not always be true.
- *
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IndexedRegion {
-
- /**
- * Can be used to test if the indexed regions contains the test position.
- *
- * @param testPosition
- * @return true if test position is greater than or equal to start offset
- * and less than start offset plus length.
- */
- boolean contains(int testPosition);
-
- /**
- * Can be used to get end offset of source text, relative to beginning of
- * documnt. Implementers should return -1 if, or some reason, the region
- * is not valid.
- *
- * @return endoffset
- */
- int getEndOffset();
-
- /**
- * Can be used to get source postion of beginning of indexed region.
- * Implementers should return -1 if, or some reason, the region is not
- * valid.
- *
- * @return int position of start of index region.
- */
- int getStartOffset();
-
- /**
- * Can be used to get the length of the source text. Implementers should
- * return -1 if, or some reason, the region is not valid.
- *
- * @return int position of length of index region.
- */
- int getLength();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
deleted file mode 100644
index 61e071834a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
-import org.osgi.framework.Bundle;
-
-/**
- * Class to allow access to ModelManager. Not intended to be subclassed.
- *
- * @deprecated - use {@link org.eclipse.wst.sse.core.StructuredModelManager} instead
- */
-final public class StructuredModelManager {
- /**
- * Do not allow instances to be created.
- */
- private StructuredModelManager() {
- super();
- }
-
- /**
- * Provides access to the instance of IModelManager. Returns null if model
- * manager can not be created or is not valid (such as, when workbench is
- * shutting down).
- *
- * @return IModelManager - returns the one model manager for structured
- * model
- * @deprecated - use the one that is in
- * org.eclipse.wst.sse.core.StructuredModelManager
- */
- public static IModelManager getModelManager() {
- boolean isReady = false;
- IModelManager modelManager = null;
- while (!isReady) {
- Bundle localBundle = Platform.getBundle(SSECorePlugin.ID);
- int state = localBundle.getState();
- if (state == Bundle.ACTIVE) {
- isReady = true;
- // getInstance is a synchronized static method.
- modelManager = ModelManagerImpl.getInstance();
- }
- else if (state == Bundle.STARTING) {
- try {
- Thread.sleep(100);
- }
- catch (InterruptedException e) {
- // ignore, just loop again
- }
- }
- else if (state == Bundle.STOPPING || state == Bundle.UNINSTALLED) {
- isReady = true;
- modelManager = null;
- }
- else {
- // not sure about other states, 'resolved', 'installed'
- isReady = true;
- modelManager = null;
- }
- }
- return modelManager;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java
deleted file mode 100644
index 2d64715749..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java
+++ /dev/null
@@ -1,58 +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.sse.core.internal.provisional.document;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-
-/**
- * This interface is strictly to define important "document properties" not
- * found in IDocument, but not central to "StructuredDocument".
- *
- * Its not to be be implmented by clients.
- *
- * @plannedfor 1.0
- */
-
-public interface IEncodedDocument extends IDocument {
-
- /**
- * Returns the encoding memento for this document.
- *
- * @return the encoding memento for this document.
- */
- EncodingMemento getEncodingMemento();
-
- /**
- * Returns the preferred line delimiter for this document.
- */
- String getPreferredLineDelimiter();
-
- /**
- * Sets the encoding memento for this document.
- *
- * Is not to be called by clients, only document creation classes.
- *
- * @param localEncodingMemento
- */
- void setEncodingMemento(EncodingMemento localEncodingMemento);
-
- /**
- * Sets the preferredLineDelimiter. Is not to be called by clients, only
- * document creation classes.
- *
- * @param probableLineDelimiter
- */
- void setPreferredLineDelimiter(String probableLineDelimiter);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
deleted file mode 100644
index 0c0f47d18f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
+++ /dev/null
@@ -1,223 +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.sse.core.internal.provisional.document;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-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.IStructuredDocumentRegionList;
-
-
-/**
- * A IStructuredDocument is a collection of StructuredDocumentRegions. It's
- * often called a "flat model" because its does contain some structural
- * information, but not very much, usually, at most, a few levels of
- * containment.
- *
- * Clients should not implement.
- *
- * @deprecated - was never used
- */
-public interface IStructuredDocumentProposed extends IDocument, IDocumentExtension, IAdaptable {
-
- /**
- * The document changing listeners receives the same events as the
- * document listeners, but the difference is the timing and
- * synchronization of data changes and notifications.
- */
- void addDocumentChangingListener(IDocumentListener listener);
-
- /**
- * this API ensures that any portion of the document within startOff to
- * length is not readonly (that is, that its editable). Note that if the
- * range overlaps with other readonly regions, those other readonly
- * regions will be adjusted.
- *
- * @param startOffset
- * @param length
- */
- void clearReadOnly(int startOffset, int length);
-
- /**
- * returns true if any portion of startOffset to length is readonly
- *
- * @param startOffset
- * @param length
- * @return
- */
- boolean containsReadOnly(int startOffset, int length);
-
- /**
- * Returns the region contained by offset.
- *
- * @param offset
- * @return
- */
- IStructuredDocumentRegion getRegionAtCharacterOffset(int offset);
-
- /**
- * Resturns a list of the structured document regions.
- *
- * Note: possibly expensive call, not to be used casually.
- *
- * @return a list of the structured document regions.
- */
- IStructuredDocumentRegionList getRegionList();
-
-
- /**
- * Returns the text of this document.
- *
- * Same as 'get' in super class, added for descriptiveness.
- *
- * @return the text of this document.
- */
- String getText();
-
- /**
- * causes that portion of the document from startOffset to length to be
- * marked as readonly. Note that if this range overlaps with some other
- * region with is readonly, the regions are effectivly combined.
- *
- * @param startOffset
- * @param length
- */
- void makeReadOnly(int startOffset, int length);
-
- /**
- * newInstance is similar to clone, except it contains no data. One
- * important thing to duplicate is the parser, with the parser correctly
- * "cloned", including its tokeninzer, block tags, etc.
- *
- * NOTE: even after obtaining a 'newInstance' the client may have to do
- * some initialization, for example, it may need to add its own model
- * listeners. Or, as another example, if the IStructuredDocument has a
- * parser of type StructuredDocumentRegionParser, then the client may need
- * to add its own StructuredDocumentRegionHandler to that parser, if it is
- * in fact needed.
- */
- IStructuredDocumentProposed newInstance();
-
- /**
- * The document changing listeners receives the same events as the
- * document listeners, but the difference is the timing and
- * synchronization of data changes and notifications.
- */
- void removeDocumentChangingListener(IDocumentListener listener);
-
- /**
- * One of the APIs to manipulate the IStructuredDocument.
- *
- * replaceText replaces the text from oldStart to oldEnd with the new text
- * found in the requestedChange string. If oldStart and oldEnd are equal,
- * it is an insertion request. If requestedChange is null (or empty) it is
- * a delete request. Otherwise it is a replace request.
- *
- * Similar to 'replace' in super class.
- */
- StructuredDocumentEvent replaceText(Object requester, int oldStart, int replacementLength, String requestedChange);
-
- /**
- * Note, same as replaceText API, but will allow readonly areas to be
- * replaced. This method is not to be called by clients, only
- * infrastructure. For example, one case where its ok is with undo
- * operations (since, presumably, if user just did something that
- * happended to involve some inserting readonly text, they should normally
- * be allowed to still undo that operation. There might be other cases
- * where its used to give the user a choice, e.g. "you are about to
- * overwrite read only portions, do you want to continue".
- */
- StructuredDocumentEvent overrideReadOnlyreplaceText(Object requester, int oldStart, int replacementLength, String requestedChange);
-
- /**
- * One of the APIs to manipulate the IStructuredDocument in terms of Text.
- *
- * The setText method replaces all text in the model.
- *
- * @param requester -
- * the object requesting the document be created.
- * @param allText -
- * all the text of the document.
- * @return NewDocumentEvent - besides causing this event to be sent to
- * document listeners, the event is returned.
- */
- NewDocumentEvent setText(Object requester, String allText);
-
- /**
- * Returns the encoding memento for this document.
- *
- * @return the encoding memento for this document.
- */
- EncodingMemento getEncodingMemento();
-
- /**
- * Returns the line delimiter detected when this document was read from
- * storage.
- *
- * @return line delimiter detected when this document was read from
- * storage.
- */
- String getDetectedLineDelimiter();
-
- /**
- * Sets the encoding memento for this document.
- *
- * Is not to be called by clients, only document creation classes.
- *
- * @param localEncodingMemento
- */
- void setEncodingMemento(EncodingMemento localEncodingMemento);
-
- /**
- * Sets the detected line delimiter when the document was read. Is not to
- * be called by clients, only document creation classes.
- *
- * @param probableLineDelimiter
- */
- void setDetectedLineDelimiter(String probableLineDelimiter);
-
- /**
- * This function provides a way for clients to compare a string with a
- * region of the documnet, without having to retrieve (create) a string
- * from the document, thus more efficient of lots of comparisons being
- * done.
- *
- * @param ignoreCase -
- * if true the characters are compared based on identity. If
- * false, the string are compared with case accounted for.
- * @param testString -
- * the string to compare.
- * @param documentOffset -
- * the document in the offset to start the comparison.
- * @param length -
- * the length in the document to compare (Note: technically,
- * clients could just provide the string, and we could infer
- * the length from the string supplied, but this leaves every
- * client to correctly not even ask us if the the string length
- * doesn't match the expected length, so this is an effort to
- * maximize performance with correct code.
- * @return true if matches, false otherwise.
- */
- boolean stringMatches(boolean ignoreCase, String testString, int documentOffset, int length);
-
- Position createPosition(int offset, String category, String type);
-
- Position createPosition(int offset, int length, String category, String type);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.java
deleted file mode 100644
index e549692688..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This event is send to structured document listeners. It is perfectly
- * analagous to its corresponding jface DocumentEvent and is provided simply
- * to allow clients to distinguish the source of the event.
- *
- * @plannedfor 1.0
- */
-public class AboutToBeChangedEvent extends StructuredDocumentEvent {
-
-
- /**
- * Creates an instance of this event.
- *
- * @param document
- * document involved in the change
- * @param originalRequester
- * source of original request
- * @param changes
- * the text changes
- * @param offset
- * offset of request
- * @param lengthToReplace
- * amount, if any, of replaced text
- */
- public AboutToBeChangedEvent(IStructuredDocument document, Object originalRequester, String changes, int offset, int lengthToReplace) {
- super(document, originalRequester, changes, offset, lengthToReplace);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java
deleted file mode 100644
index df44547d51..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java
+++ /dev/null
@@ -1,26 +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.sse.core.internal.provisional.events;
-
-
-
-/**
- * Clients can implement this interface, and register with the
- * structuredDocument using addAboutToBeChangedListner to be notified that the
- * structuredDocument is about to be changed, but hasn't been changed at the
- * time this event is fired.
- */
-public interface IModelAboutToBeChangedListener {
-
- void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java
deleted file mode 100644
index 26535af336..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java
+++ /dev/null
@@ -1,30 +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.sse.core.internal.provisional.events;
-
-/**
- * @deprecated will be removed since we now subclass DocumentEvent.
- */
-
-public interface IStructuredDocumentListener {
-
- public void newModel(NewDocumentEvent structuredDocumentEvent);
-
- public void noChange(NoChangeEvent structuredDocumentEvent);
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent);
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent);
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java
deleted file mode 100644
index 038db7707e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * The NewDocumentContentEvent is fired when an instance of a
- * IStructuredDocument replaces all of its text.
- *
- * ISSUE: not currently used, but there's still some efficiencies to be had so
- * plan to implement.
- *
- * @plannedfor 1.0
- */
-public class NewDocumentContentEvent extends NewDocumentEvent {
- /**
- * Creates an instance of this event.
- *
- * @param document
- * the document being changed
- * @param originalRequester
- * the original requester of the change
- */
- public NewDocumentContentEvent(IStructuredDocument document, Object originalRequester) {
- super(document, originalRequester);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java
deleted file mode 100644
index fe9a73ae0d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java
+++ /dev/null
@@ -1,68 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * The NewDocumentEvent is fired when an instance of a IStructuredDocument
- * sets or replaces all of its text.
- *
- * ISSUE: need to change so this is used for 'set' only.
- *
- * @plannedfor 1.0
- */
-public class NewDocumentEvent extends StructuredDocumentEvent {
-
-
- /**
- * Creates a new instance of the NewDocumentEvent.
- *
- * @param document
- * being changed
- * @param originalRequester
- * source of request
- */
- public NewDocumentEvent(IStructuredDocument document, Object originalRequester) {
- super(document, originalRequester);
- }
-
- /**
- * This returns the length of the new document.
- *
- * @return int returns the length of the new document.
- */
- public int getLength() {
- return getStructuredDocument().getLength();
- }
-
- /**
- * This doesn't mean quite the same thing as the IStructuredDocument
- * Events in the super class. It always will return zero.
- *
- * @return int for a newDocument, the offset of is always 0
- */
- public int getOffset() {
- return 0;
- }
-
- /**
- * For a new document, the text involved is the complete text.
- *
- * @return String the text that is the complete text of the documnet.
- */
- public String getText() {
- String results = getStructuredDocument().getText();
- return results;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java
deleted file mode 100644
index d5004bcdc9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This event is sent if, after analysis, it is found there is no reason to
- * change the structuredDocument. This might occur, for example, if someone
- * pastes in the exact same text that they are replacing, or if someone tries
- * to change a read-only region.
- *
- * This might be important, for example, if some state variables are set on an
- * "about the change" event. then if there is no change (i.e.no other event is
- * fired), those state variables could reset, or whatever, upon receiving this
- * event.
- *
- * @plannedfor 1.0
- */
-public class NoChangeEvent extends StructuredDocumentEvent {
- /**
- * NO_CONTENT_CHANGE means that a some text was requested to be replaced
- * with identical text, so no change is actually done.
- */
- public final static int NO_CONTENT_CHANGE = 2;
- /**
- * NO_EVENT is used in rare error conditions, when, basically, a request
- * to change the document is made before the previous request has
- * completed. This event to used so aboutToChange/Changed cycles can
- * complete as required, but the document is most likely not modified as
- * expected.
- */
- public final static int NO_EVENT = 8;
- /**
- * READ_ONLY_STATE_CHANGE means that the "read only" state of the text was
- * changed, not the content itself.
- */
- public final static int READ_ONLY_STATE_CHANGE = 4;
-
- /**
- * set to one of the above detailed reasons for why no change was done.
- */
- public int reason = 0;
-
- /**
- * NoChangeEvent constructor. This event can occur if there was a request
- * to modify a document or its properties, but there as not really is no
- * change to a document's content.
- *
- * @param source
- * @param originalSource
- * java.lang.Object
- * @param changes
- * java.lang.String
- * @param offset
- * int
- * @param lengthToReplace
- * int
- */
- public NoChangeEvent(IStructuredDocument source, Object originalSource, String changes, int offset, int lengthToReplace) {
- super(source, originalSource, changes, offset, lengthToReplace);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java
deleted file mode 100644
index 29d4381ef6..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java
+++ /dev/null
@@ -1,80 +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.sse.core.internal.provisional.events;
-
-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;
-
-/**
- * This event is used when a document region changes in a non-structural way.
- * Non-structural, that is, as far as the IStructuredDocument is concerned.
- * The whole region, along with the new text is sent, just in case a listener
- * (e.g. a tree model) might make its own determination of what to do, and
- * needs the whole region to act appropriately.
- *
- * Note: users should not make assumptions about whether the region is
- * literally the same instance or not -- it is currently a different instance
- * that is identical to the old except for the changed region, but this
- * implementation may change.
- *
- * @plannedfor 1.0
- */
-public class RegionChangedEvent extends StructuredDocumentEvent {
- private ITextRegion fChangedRegion;
- private IStructuredDocumentRegion fStructuredDocumentRegion;
-
- /**
- * Creates instance of a RegionChangedEvent.
- *
- * @param document
- * the document being changed.
- * @param originalRequester
- * the object making the request for the change.
- * @param structuredDocumentRegion
- * the containing region
- * @param changedRegion
- * the region that has changed.
- * @param changes
- * the string representing the change.
- * @param offset
- * the offset of the change.
- * @param lengthToReplace
- * the length specified to be replaced.
- */
- public RegionChangedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegion structuredDocumentRegion, ITextRegion changedRegion, String changes, int offset, int lengthToReplace) {
- super(document, originalRequester, changes, offset, lengthToReplace);
- fStructuredDocumentRegion = structuredDocumentRegion;
- fChangedRegion = changedRegion;
- }
-
-
- /**
- * Returns the text region changed.
- *
- * @return the text region changed
- */
- public ITextRegion getRegion() {
- return fChangedRegion;
- }
-
-
- /**
- * Returns the document region changed.
- *
- * @return the document region changed
- */
- public IStructuredDocumentRegion getStructuredDocumentRegion() {
- return fStructuredDocumentRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java
deleted file mode 100644
index 21a2e4f76a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java
+++ /dev/null
@@ -1,85 +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.sse.core.internal.provisional.events;
-
-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;
-
-/**
- * This event is used when a node's regions change, but the document region
- * itself doesn't. This says nothing about the semantics of the document
- * region, that may still have changed. Also, its assumed/required that all
- * the regions are replaced (even those that may not have changed).
- *
- * @plannedfor 1.0
- */
-public class RegionsReplacedEvent extends StructuredDocumentEvent {
- private ITextRegionList fNewRegions;
- private ITextRegionList fOldRegions;
- private IStructuredDocumentRegion fStructuredDocumentRegion;
-
- /**
- * Creates an instance of the RegionsReplacedEvent.
- *
- * @param document -
- * document being changed.
- * @param originalRequester -
- * requester of the change.
- * @param structuredDocumentRegion -
- * the region containing the change.
- * @param oldRegions -
- * the old Regions being replaced.
- * @param newRegions -
- * the new regions being added.
- * @param changes -
- * the String representing the change.
- * @param offset -
- * the offset of the change.
- * @param lengthToReplace -
- * the length of text to replace.
- */
- public RegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegion structuredDocumentRegion, ITextRegionList oldRegions, ITextRegionList newRegions, String changes, int offset, int lengthToReplace) {
- super(document, originalRequester, changes, offset, lengthToReplace);
- fStructuredDocumentRegion = structuredDocumentRegion;
- fOldRegions = oldRegions;
- fNewRegions = newRegions;
- }
-
- /**
- * Returns the new text regions.
- *
- * @return the new text regions.
- */
- public ITextRegionList getNewRegions() {
- return fNewRegions;
- }
-
- /**
- * Returns the old text regions.
- *
- * @return the old text regions.
- */
- public ITextRegionList getOldRegions() {
- return fOldRegions;
- }
-
- /**
- * Returns the structured document region.
- *
- * @return the structured document region.
- */
- public IStructuredDocumentRegion getStructuredDocumentRegion() {
- return fStructuredDocumentRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java
deleted file mode 100644
index e3930ff991..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.events;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * IStructuredDocument events are generated by the IStructuredDocument, after
- * the IStructuredDocument acts on a request. Not intended to be instantiated,
- * except by subclasses in infrastructure. Not intended to be subclassed by
- * clients.
- *
- * @plannedfor 1.0
- */
-public abstract class StructuredDocumentEvent extends DocumentEvent {
- private String fDeletedText;
- private Object fOriginalRequester;
-
- /**
- * There is no public null-arg version of this constructor.
- */
- private StructuredDocumentEvent() {
- super();
- }
-
- /**
- * We assume (and require) that an IStructuredDocument's are always the
- * source of StructuredDocument events.
- *
- * @param document -
- * the document being changed
- */
- private StructuredDocumentEvent(IStructuredDocument document) {
- this();
- if (document == null)
- throw new IllegalArgumentException("null source"); //$NON-NLS-1$
- fDocument = document;
- fOriginalRequester = document;
- }
-
- /**
- * We assume (and require) that an IStructuredDocument's are always the
- * source of StructuredDocument events.
- *
- * @param document -
- * the document being changed.
- * @param originalRequester -
- * the original requester of the change.
- */
- StructuredDocumentEvent(IStructuredDocument document, Object originalRequester) {
- this(document);
- fOriginalRequester = originalRequester;
- }
-
- /**
- * We assume (and require) that an IStructuredDocument's are always the
- * source of StructuredDocument events.
- *
- * @param document -
- * the document being changed.
- * @param originalRequester -
- * the requester of the change.
- * @param changes -
- * the String representing the new text
- * @param offset -
- * the offset of the change.
- * @param lengthToReplace -
- * the length of text to replace.
- */
- StructuredDocumentEvent(IStructuredDocument document, Object originalRequester, String changes, int offset, int lengthToReplace) {
- this(document);
- fOriginalRequester = originalRequester;
- fText = changes;
- fOffset = offset;
- fLength = lengthToReplace;
- }
-
- /**
- * Provides the text that is being deleted.
- *
- * @return the text that is being deleted, or null if none is being
- * deleted.
- */
- public String getDeletedText() {
- return fDeletedText;
- }
-
- /**
- * This method returns the object that originally caused the event to
- * fire. This is typically not the object that created the event (the
- * IStructuredDocument) but instead the object that made a request to the
- * IStructuredDocument.
- *
- * @return the object that made the request to the document
- */
- public Object getOriginalRequester() {
- return fOriginalRequester;
- }
-
- /**
- * This method is equivalent to 'getDocument' except it returns an object
- * of the appropriate type (namely, a IStructuredDocument, instead of
- * IDocument).
- *
- * @return IStructuredDocumnt - the document being changed
- */
- public IStructuredDocument getStructuredDocument() {
- // a safe case, since constructor can only be called with a
- // IStructuredDocument
- return (IStructuredDocument) fDocument;
- }
-
- /**
- * Not to be called by clients, only parsers and reparsers. (will
- * eventually be moved to an SPI package).
- *
- * @param newDeletedText -
- * the text that has been deleted.
- */
- public void setDeletedText(String newDeletedText) {
- fDeletedText = newDeletedText;
- }
-
- /**
- * for debugging only
- *
- * @deprecated - need to fix unit tests which depend on this exact format,
- * then delete this
- */
- public String toString() {
- // return getClass().getName() + "[source=" + source + "]";
- return getClass().getName();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
deleted file mode 100644
index 8f08b88887..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.events;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-/**
- * This event is used when a IStructuredDocumentRegion is deleted, or replaced
- * with more than one IStructuredDocumentRegion, or when simply more than one
- * IStructuredDocumentRegion changes.
- *
- * @plannedfor 1.0
- */
-public class StructuredDocumentRegionsReplacedEvent extends StructuredDocumentEvent {
-
- private IStructuredDocumentRegionList fNewStructuredDocumentRegions;
- private IStructuredDocumentRegionList fOldStructuredDocumentRegions;
-
- private boolean fIsEntireDocumentReplaced;
-
- /**
- * Creates an instance of StructuredDocumentRegionsReplacedEvent
- *
- * @param document -
- * the document being changed.
- * @param originalRequester -
- * the requester of the change.
- * @param oldStructuredDocumentRegions -
- * the old document regions removed.
- * @param newStructuredDocumentRegions -
- * the new document regions added.
- * @param changes -
- * a string representing the text change.
- * @param offset -
- * the offset of the change.
- * @param lengthToReplace -
- * the length of text requested to be replaced.
- */
- public StructuredDocumentRegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegionList oldStructuredDocumentRegions, IStructuredDocumentRegionList newStructuredDocumentRegions, String changes, int offset, int lengthToReplace) {
- super(document, originalRequester, changes, offset, lengthToReplace);
- fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
- fNewStructuredDocumentRegions = newStructuredDocumentRegions;
- }
-
- public StructuredDocumentRegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegionList oldStructuredDocumentRegions, IStructuredDocumentRegionList newStructuredDocumentRegions, String changes, int offset, int lengthToReplace, boolean entireDocumentReplaced) {
- this(document, originalRequester, oldStructuredDocumentRegions, newStructuredDocumentRegions, changes, offset, lengthToReplace);
- fIsEntireDocumentReplaced = entireDocumentReplaced;
- }
-
- /**
- * Returns the new structured document regions.
- *
- * @return the new structured document regions.
- */
- public IStructuredDocumentRegionList getNewStructuredDocumentRegions() {
- return fNewStructuredDocumentRegions;
- }
-
- /**
- * Returns the old structured document regions.
- *
- * @return the old structured document regions.
- */
- public IStructuredDocumentRegionList getOldStructuredDocumentRegions() {
- return fOldStructuredDocumentRegions;
- }
-
- public boolean isEntireDocumentReplaced() {
- return fIsEntireDocumentReplaced;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
deleted file mode 100644
index 79ff0e67de..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.exceptions;
-
-
-
-/**
- * Indicates that a Resource which a model or document was expected to create
- * already exists.
- */
-public class ResourceAlreadyExists extends Exception {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * ResourceAlreadyExists constructor comment.
- */
- public ResourceAlreadyExists() {
- super();
- }
-
- /**
- * ResourceAlreadyExists constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public ResourceAlreadyExists(String s) {
- super(s);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
deleted file mode 100644
index 5ecbfad60e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.exceptions;
-
-
-
-/**
- * Indicates that a model with a particular ID already exists
- */
-public class ResourceInUse extends Exception {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * ResourceAlreadyExists constructor comment.
- */
- public ResourceInUse() {
- super();
- }
-
- /**
- * ResourceAlreadyExists constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public ResourceInUse(String s) {
- super(s);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
deleted file mode 100644
index ace9420a04..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
+++ /dev/null
@@ -1,338 +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.sse.core.internal.provisional.model;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-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.provisional.text.IStructuredDocument;
-
-/**
- * Responsible for managing IStructuredModels.
- *
- * This allows clients to share models, so they do not have to be re-created
- * or passed around from one client to another. Clients should internally
- * enforce that models are gotten and released from locations close to each
- * other to prevent model leaks.
- *
- * There are three ways to get a model based on usage and responsibility: for
- * 'MODIFY', just for 'SHARED', and 'UNSHARED'. Contrary to their names, a
- * model can technically be modified, and all modifications directly affect
- * the commonly shared version of the model. It is part of the API contract,
- * however, that clients who get a model for SHARED do not modify it. The
- * significance of the 'MODIFY' model is that the client is registering their
- * interest in saving changes to the model.
- *
- * Clients can reference this interface, but should not implement.
- *
- * @see org.eclipse.wst.sse.core.StructuredModelManager
- * @plannedfor 1.0
- */
-public interface IModelManagerProposed {
-
- /**
- * AccessType is used internally as a JRE 1.4 compatible enumerated type.
- * Not intended to be referenced by clients.
- */
- static class AccessType {
- private String fType;
-
- /**
- * default access contructor we use to create our specific constants.
- *
- * @param type
- */
- AccessType(String type) {
- super();
- fType = type;
- }
-
- /**
- * For debug purposes only.
- */
- public String toString() {
- return "Model Access Type: " + fType; //$NON-NLS-1$
- }
- }
-
- /**
- * Constant to provide compile time safe parameter. <code>NOTSHARED</code>signifies
- * the client intentially wants a model that is not shared with other
- * clients. NOTSHARED models can not be saved.
- */
- final AccessType NOTSHARED = new AccessType("NOTSHARED"); //$NON-NLS-1$
-
- /**
- * Constant to provide compile-time safe parameter. <code>SHARED</code>signifies
- * the client is not intending to make changes and does not care whether
- * the model accessed is saved.
- */
- final AccessType SHARED = new AccessType("SHARED"); //$NON-NLS-1$
-
- /**
- * Constant to provide compile-time safe parameter. <code>MODIFY</code>signifies
- * the client is intending to make changes and is responsible for saving
- * changes (or not) if they are the last one holding MODIFY access to the
- * model before it's released.
- */
- final AccessType MODIFY = new AccessType("MODIFY"); //$NON-NLS-1$
-
- /**
- * copyModel is similar to a deep clone. The resulting model is shared,
- * according to the value of ReadEditType. If a model already is being
- * managed for 'newLocation' then a ResourceInUse exception is thrown,
- * unless the ReadEditType is NOTSHARED, in which case the resulting model
- * can not be saved.
- *
- * @param oldLocation
- * @param newLocation
- * @param type
- * @return
- * @throws ResourceInUse
- *
- * ISSUE: is this important enough to be API, or can clients solve
- * themselves
- */
- IStructuredModel copyModel(IPath oldLocation, IPath newLocation, AccessType type) throws ResourceInUse;
-
- /**
- * createNewInstance is similar to clone, except the new instance has no
- * text content. Note: this produces an UNSHARED model, for temporary use,
- * that has the same characteristics as original model. If a true shared
- * model is desired, use "copy".
- *
- * ISSUE: still needed?
- *
- * @param requester
- * @param model
- * @return
- * @throws IOException
- */
- public IStructuredModel createNewInstance(Object requester, IStructuredModel model) throws IOException;
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. Note: its assume that IPath does not actually exist as
- * a resource yet. If it does, ResourceAlreadyExists exception is thrown.
- * If the resource does already exist, then createStructuredDocumentFor is
- * the right API to use.
- *
- * ISSUE: do we want to support this via model manager, or else where?
- * ISSUE: do we need two of these? What's legacy use case?
- *
- * @param location
- * @param progressMonitor
- * @return
- * @throws ResourceAlreadyExists
- * @throws IOException
- * @throws CoreException
- */
- IStructuredDocument createNewStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, IOException, CoreException;
-
- /**
- * Factory method, since a proper IStructuredDocument must have a proper
- * parser assigned. Note: clients should verify that the resource
- * identified by the IPath exists before using this method. If this IFile
- * does not exist, then createNewStructuredDocument is the correct API to
- * use.
- *
- * ISSUE: do we want to support this via model manager, or else where?
- * ISSUE: do we need two of these? What's legacy use case?
- *
- * @param location
- * @param progressMonitor
- * @return
- * @throws IOException
- * @throws CoreException
- */
- IStructuredDocument createStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws IOException, CoreException;
-
- /**
- * Note: callers of this method must still release the model when
- * finished. Returns the model for this document if it already exists and
- * is being shared. Returns null if this is not the case. The ReadEditType
- * must be either MODIFY or SHARED.
- *
- * ISSUE: should we accept IDocument on parameter for future evolution,
- * and constrain to StructuredDocuments at runtime?
- *
- * @param requester
- * @param type
- * @param document
- * @return
- */
- IStructuredModel getExistingModel(Object requester, AccessType type, IDocument document);
-
- /**
- * Callers of this method must still release the model when finished.
- * Returns the model for this location if it already exists and is being
- * shared. Returns null if this is not the case. The ReadEditType must be
- * either MODIFY or SHARED.
- *
- * @param requester
- * @param type
- * @param location
- * @return
- */
- public IStructuredModel getExistingModel(Object requester, AccessType type, IPath location);
-
- /**
- * Returns the model that has the specified document as its structured
- * document.
- *
- * @param requester
- * @param type
- * @param progressMonitor
- * @param document
- * @return
- */
- public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IDocument document);
-
- /**
- * Returns the model based on the content at the specified location.
- *
- * Note: if the ModelManager does not know how to create a model for
- * such a file for content, null is return.
- * ISSUE: should we throw some special, meaningful, checked
- * exception instead?
- *
- * @param requester
- * @param type
- * @param progressMonitor
- * @param location
- * @return
- * @throws IOException
- * @throws CoreException
- */
- public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IPath location) throws IOException, CoreException;
-
- /**
- * This method will not create a new model if it already exists ... if
- * force is false. The idea is that a client should call this method once
- * with force set to false. If the exception is thrown, then prompt client
- * if they want to overwrite.
- *
- * @param requester
- * @param location
- * @param force
- * @param type
- * @param progressMonitor
- * @return
- * @throws ResourceAlreadyExists
- * @throws ResourceInUse
- * @throws IOException
- * @throws CoreException
- */
- IStructuredModel getNewModel(Object requester, IPath location, boolean force, AccessType type, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- *
- * @param location
- * @return
- */
- boolean isShared(IPath location);
-
- /**
- * This function returns true if there are other references to the
- * underlying model, shared in the specified way. The ReadEditType must be
- * either MODIFY or SHARED.
- *
- * @param location
- * @param type
- * @return
- */
- boolean isShared(IPath location, AccessType type);
-
- /**
- * This method can be called when the content type of a model changes. Its
- * assumed the contentType has already been changed, and this method uses
- * the text of the old one, to repopulate the text of the new one.
- *
- * @param model
- * @return
- * @throws IOException
- */
- IStructuredModel reinitialize(IStructuredModel model) throws IOException;
-
-
- /**
- * This is used by clients to signify that they are finished with a model
- * and will no longer access it or any of its underlying data (such as its
- * structured document). The ReadEditType must match what ever the client
- * used in the corresponding 'get' method.
- *
- * This method must be called for every 'get'. Clients should use the
- * try/finally pattern to ensure the release is called even if there is an
- * unexpected exception.
- *
- * @param requester
- * @param structuredModel
- * @param type
- */
- void releaseModel(Object requester, IStructuredModel structuredModel, AccessType type);
-
- /**
- * Writes the underlying document to the IPath.
- *
- * ISSUE: we want to just "dump" contents to location, but need to spec.
- * all the different cases of shared, etc.
- *
- * ?If to same location as 'get', then same instance of model, If to
- * different location (esp. if shared) then need to leave old instance of
- * model, create new model, and save to new location. ?
- *
- * Cases: IPath is null, write to IPath created with IPath specificed and
- * equals IPath created with, write to IPath IPath specified and not
- * equals IPath created with, dumps to new IPath, no change in current
- * model state.
- *
- * ISSUE: think through 'normalization' cases
- *
- *
- * @param structuredModel
- * @param location - already normalized?
- * @param progressMonitor
- * @throws UnsupportedEncodingException
- * @throws IOException
- * @throws CoreException
- *
- * ISSUE: resource aleady exists? veto override
- */
- void saveModel(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;
-
- /**
- * Writes the underlying document to the IPath if the model is only shared
- * for EDIT by one client. This is the recommended way for 'background
- * jobs' to save models, in case the model is being shared by an editor,
- * or other client that might desire user intervention to save a resource.
- *
- * @param structuredModel
- * @param location - already normalized?
- * @param progressMonitor
- * @throws UnsupportedEncodingException
- * @throws IOException
- * @throws CoreException
- *
- * ISSUE: is locaiton needed in this case, or just use the one it was
- * created with
- */
- void saveModelIfNotShared(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java
deleted file mode 100644
index 484fc70496..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java
+++ /dev/null
@@ -1,36 +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.sse.core.internal.provisional.model;
-
-
-/**
- * Interface for those wanting to listen to a model's state changing.
- *
- * @plannedfor 1.0
- */
-public interface IModelStateListenerProposed {
-
- /**
- * A model is about to be changed. The event object itself signifies which
- * model, and any pertinent information.
- */
- void modelAboutToBeChanged(IStructuredModelEvent event);
-
- /**
- * Signals that the changes foretold by modelAboutToBeChanged have been
- * made. A typical use might be to refresh, or to resume processing that
- * was suspended as a result of modelAboutToBeChanged.
- */
- void modelChanged(IStructuredModelEvent event);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java
deleted file mode 100644
index 6c2d165167..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.core.internal.provisional.model;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-/**
- * Provides a means for clients to register IAdapterFactories for use
- * by infrastructure when StructuredModels are created.
- */
-public interface INodeAdapterFactoryManager {
-
- /**
- *
- * @param factory
- * @param contentType
- */
- void addAdapterFactory(INodeAdapterFactory factory, IContentType contentType);
-
- void removeAdapterFactory(INodeAdapterFactory factory, IContentType contentType);
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java
deleted file mode 100644
index 73bc3bef54..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.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.sse.core.internal.provisional.model;
-
-public interface IStructuredModelEvent {
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java
deleted file mode 100644
index 7d984daed2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.model;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * IStructuredModel's are mainly interesting by their extensions and
- * implementers. The main purposed of this abstraction it to provide a common
- * way to manage models that have an associated structured documnet.
- *
- * @plannedfor 1.0
- *
- */
-public interface IStructuredModelProposed extends IAdaptable {
-
-
- /**
- * This API allows clients to declare that they are about to make a
- * "large" change to the model. This change might be in terms of content
- * or it might be in terms of the model id or base location.
- *
- * Note that in the case of embedded calls, notification to listeners is
- * sent only once.
- *
- * Note that the client who is making these changes has the responsibility
- * to restore the model's state once finished with the changes. See
- * getMemento and restoreState.
- *
- * The method isModelStateChanging can be used by a client to determine if
- * the model is already in a change sequence.
- *
- * This method is a matched pair to changedModel, and must be called
- * before changedModel. A client should never call changedModel without
- * calling aboutToChangeModel first nor call aboutToChangeModel without
- * calling changedModel later from the same Thread.
- */
- void aboutToChangeModel();
-
- void addModelStateListener(IModelStateListener listener);
-
- /**
- * This API allows a client controlled way of notifying all ModelEvent
- * listners that the model has been changed. This method is a matched pair
- * to aboutToChangeModel, and must be called after aboutToChangeModel ...
- * or some listeners could be left waiting indefinitely for the changed
- * event. So, its suggested that changedModel always be in a finally
- * clause. Likewise, a client should never call changedModel without
- * calling aboutToChangeModel first.
- *
- * In the case of embedded calls, the notification is just sent once.
- *
- */
- void changedModel();
-
- /**
- * This is a client-defined value for what that client (and/or loader)
- * considers the "base" of the structured model. Frequently the location
- * is either a workspace root-relative path of a workspace resource or an
- * absolute path in the local file system.
- */
- IPath getLocation();
-
- /**
- * @return The associated content type identifier (String) for this model.
- */
- IContentType getContentType() throws CoreException;
-
- /**
- *
- * @return The model's FactoryRegistry. A model is not valid without one.
- */
- FactoryRegistry getFactoryRegistry();
-
- /**
- * Return the index region at offset. Returns null if there is no
- * IndexedRegion that contains offset.
- */
- IndexedRegion getIndexedRegion(int offset);
-
- /**
- * ISSUE: do we want to provide this? How to ensure job/thread safety
- *
- * @return
- */
- IndexedRegion[] getIndexedRegions();
-
- /**
- * Rreturns the IStructuredDocument that underlies this model
- *
- * @return
- */
- IStructuredDocument getStructuredDocument();
-
- /**
- *
- */
- boolean isDirty();
-
- /**
- * This method can be called to determine if the model is within a
- * "aboutToChange" and "changed" sequence.
- */
- public boolean isModelStateChanging();
-
- /**
- *
- */
- boolean isNew();
-
- boolean isReinitializationNeeded();
-
- /**
- * This is a combination of if the model is dirty and if the model is
- * shared for write access. The last writer as the responsibility to be
- * sure the user is prompted to save.
- */
- public boolean isSaveNeeded();
-
- /**
- * newInstance is similar to clone, except that the newInstance contains
- * no content. Its purpose is so clients can get a temporary, unmanaged,
- * model of the same "type" as the original. Note: the client may still
- * need to do some intialization of the model returned by newInstance,
- * depending on desired use. For example, the only factories in the
- * newInstance are those that would be normally be created for a model of
- * the given contentType. Others are not copied automatically, and if
- * desired, should be added by client.
- */
- IStructuredModelProposed newInstance() throws IOException;
-
- void removeModelStateListener(IModelStateListener listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java
deleted file mode 100644
index 97d4ef68a3..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java
+++ /dev/null
@@ -1,218 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-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.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-
-
-/**
- * A IStructuredDocument is a collection of StructuredDocumentRegions. It's
- * often called "flat" because its contents by design do not contain much
- * structural information beyond containment. Clients should not implement.
- */
-public interface IStructuredDocument extends IEncodedDocument, IDocumentExtension, IAdaptable {
-
- void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener);
-
- /**
- * The StructuredDocumentListeners and ModelChangedListeners are very
- * similar. They both receive identical events. The difference is the
- * timing. The "pure" StructuredDocumentListeners are notified after the
- * structuredDocument has been changed, but before other, related models
- * may have been changed such as the Structural Model. The Structural
- * model is in fact itself a "pure" StructuredDocumentListner. The
- * ModelChangedListeners can rest assured that all models and data have
- * been updated from the change by the tiem they are notified. This is
- * especially important for the text widget, for example, which may rely
- * on both structuredDocument and structural model information.
- */
- void addDocumentChangedListener(IStructuredDocumentListener listener);
-
- /**
- * The StructuredDocumentListeners and ModelChangedListeners are very
- * similar. They both receive identical events. The difference is the
- * timing. The "pure" StructuredDocumentListeners are notified after the
- * structuredDocument has been changed, but before other, related models
- * may have been changed such as the Structural Model. The Structural
- * model is in fact itself a "pure" StructuredDocumentListner. The
- * ModelChangedListeners can rest assured that all models and data have
- * been updated from the change by the tiem they are notified. This is
- * especially important for the text widget, for example, which may rely
- * on both structuredDocument and structural model information.
- */
- void addDocumentChangingListener(IStructuredDocumentListener listener);
-
- /**
- * this API ensures that any portion of the document within startOff to
- * length is not readonly (that is, that its editable). Note that if the
- * range overlaps with other readonly regions, those other readonly
- * regions will be adjusted.
- *
- * @param startOffset
- * @param length
- */
- void clearReadOnly(int startOffset, int length);
-
- /**
- * returns true if any portion of startOffset to length is readonly
- *
- * @param startOffset
- * @param length
- * @return
- */
- boolean containsReadOnly(int startOffset, int length);
-
- /**
- * This method is to remember info about the encoding When the resource
- * was last loaded or saved. Note: it is not kept "current", that is, can
- * not be depended on blindly to reflect what encoding to use. For that,
- * must go through the normal rules expressed in Loaders and Dumpers.
- */
-
- EncodingMemento getEncodingMemento();
-
- org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getFirstStructuredDocumentRegion();
-
- org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getLastStructuredDocumentRegion();
-
- /**
- * This can be considered the preferred delimiter.
- */
- public String getLineDelimiter();
-
- int getLineOfOffset(int offset); // throws SourceEditingException;
-
- /**
- * The parser is now required on constructor, so there are occasions it
- * needs to be retrieved, such as to be initialized by EmbeddedContentType
- */
- RegionParser getParser();
-
- /**
- * @deprecated use getStructuredDocumentRegions()
- * @return
- */
- IStructuredDocumentRegionList getRegionList();
-
- /**
- * Returns the <code>IStructuredDocumentRegion</code> at the given character offset.
- * @param offset
- * @return the <code>IStructuredDocumentRegion</code> at the given character offset.
- */
- IStructuredDocumentRegion getRegionAtCharacterOffset(int offset);
-
- /**
- * Returns <code>IStructuredDocumentRegion</code>s in the specified range.
- * @param offset
- * @param length
- * @return <code>IStructuredDocumentRegion</code>s in the specified range.
- */
- IStructuredDocumentRegion[] getStructuredDocumentRegions(int offset, int length);
-
- /**
- * Returns all <code>IStructuredDocumentRegion</code>s in the document.
- * @return all <code>IStructuredDocumentRegion</code>s in the document.
- */
- IStructuredDocumentRegion[] getStructuredDocumentRegions();
-
- /**
- * Note: this method was made public, and part of the interface, for
- * easier testing. Clients normally never manipulate the reparser directly
- * (nor should they need to).
- */
- IStructuredTextReParser getReParser();
-
- String getText();
-
- IStructuredTextUndoManager getUndoManager();
-
- /**
- * causes that portion of the document from startOffset to length to be
- * marked as readonly. Note that if this range overlaps with some other
- * region with is readonly, the regions are effectivly combined.
- *
- * @param startOffset
- * @param length
- */
- void makeReadOnly(int startOffset, int length);
-
- /**
- * newInstance is similar to clone, except it contains no data. One
- * important thing to duplicate is the parser, with the parser correctly
- * "cloned", including its tokeninzer, block tags, etc.
- *
- * NOTE: even after obtaining a 'newInstance' the client may have to do
- * some initialization, for example, it may need to add its own model
- * listeners. Or, as another example, if the IStructuredDocument has a
- * parser of type StructuredDocumentRegionParser, then the client may need
- * to add its own StructuredDocumentRegionHandler to that parser, if it is
- * in fact needed.
- */
- IStructuredDocument newInstance();
-
- void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener);
-
- void removeDocumentChangedListener(IStructuredDocumentListener listener);
-
- void removeDocumentChangingListener(IStructuredDocumentListener listener);
-
- /**
- * One of the APIs to manipulate the IStructuredDocument.
- *
- * replaceText replaces the text from oldStart to oldEnd with the new text
- * found in the requestedChange string. If oldStart and oldEnd are equal,
- * it is an insertion request. If requestedChange is null (or empty) it is
- * a delete request. Otherwise it is a replace request.
- */
- StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange);
-
- /**
- * Note, same as replaceText API, but will allow readonly areas to be
- * replaced. This should seldom be called with a value of "true" for
- * ignoreReadOnlySetting. One case where its ok is with undo operations
- * (since, presumably, if user just did something that happended to
- * involve some inserting readonly text, they should normally be allowed
- * to still undo that operation. Otherwise, I can't think of a single
- * example, unless its to give the user a choice, e.g. "you are about to
- * overwrite read only portions, do you want to continue".
- */
- StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange, boolean ignoreReadOnlySetting);
-
- /**
- * This method is to remember info about the encoding When the resource
- * was last loaded or saved. Note: it is not kept "current", that is, can
- * not be depended on blindly to reflect what encoding to use. For that,
- * must go through the normal rules expressed in Loaders and Dumpers.
- */
- void setEncodingMemento(EncodingMemento encodingMemento);
-
- public void setLineDelimiter(String delimiter);
-
- /**
- * One of the APIs to manipulate the IStructuredDocument in terms of Text.
- *
- * The setText method replaces all text in the model.
- */
- StructuredDocumentEvent setText(Object requester, String allText);
-
- void setUndoManager(IStructuredTextUndoManager undoManager);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java
deleted file mode 100644
index 8b03b2ac92..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java
+++ /dev/null
@@ -1,163 +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.sse.core.internal.provisional.text;
-
-/**
- * A ITextRegionCollection is a collection of ITextRegions. It is a structural
- * unit, but a minimal one. For example, in might consist of a "start tag" but
- * not a whole XML element.
- */
-public interface IStructuredDocumentRegion extends ITextRegionCollection {
-
- /**
- * Adds a text region to the end of the collection of regions contained by
- * this region. It is the parsers responsibility to make sure its a
- * correct region (that is, its start offset is one greater than previous
- * regions end offset)
- *
- * For use by parsers and reparsers only.
- */
- void addRegion(ITextRegion aRegion);
-
- /**
- * Returns the structured document region that follows this one or null if
- * at end of document.
- *
- * @return the structured document region that follows this one.
- *
- * ISSUE: for thread safety, this should be more restrictive.
- */
- IStructuredDocumentRegion getNext();
-
- /**
- * Returns this regions parent document.
- *
- * @return this regions parent document.
- */
- IStructuredDocument getParentDocument();
-
- /**
- * Returns the structured document region that preceeds this one or null
- * if at beginning of document.
- *
- * @return the structured document region that follows this one.
- *
- * ISSUE: for thread safety, this should be more restrictive.
- */
- IStructuredDocumentRegion getPrevious();
-
- /**
- * Returns true if this document has been deleted, and is no longer part
- * of the actual structured document. This field can be used in
- * multi-threaded operations, which may retrieve a long list of regions
- * and be iterating through them at the same time the document is
- * modified, and regions deleted.
- *
- * @return true if this region is no longer part of document.
- */
- boolean isDeleted();
-
- /**
- * Returns true if this structured document region was ended "naturally"
- * by syntactic rules, or if simply assumed to end so another could be
- * started.
- *
- * @return true if region has syntactic end.
- */
- boolean isEnded();
-
- /**
- * Tests is region is equal to this one, ignoring position offsets of
- * shift.
- *
- * For use by parsers and reparsers only.
- *
- * @param region
- * @param shift
- * @return
- */
- boolean sameAs(IStructuredDocumentRegion region, int shift);
-
- /**
- * Tests if <code>oldRegion</code> is same as <code>newRegion</code>,
- * ignoring position offsets of <code>shift</code>.
- *
- * ISSUE: which document region are old and new in?
- *
- * For use by parsers and reparsers only.
- *
- * @param oldRegion
- * @param documentRegion
- * @param newRegion
- * @param shift
- * @return
- */
- boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift);
-
- /**
- * Set to true if/when this region is removed from a document, during the
- * process of re-parsing.
- *
- * For use by parsers and reparsers only.
- *
- * @param deleted
- */
- void setDeleted(boolean deleted);
-
- /**
- * Set to true by parser/reparser if region deemed to end syntactically.
- *
- * For use by parsers and reparsers only.
- *
- * @param hasEnd
- */
- void setEnded(boolean hasEnd);
-
- /**
- * Sets length of region.
- *
- * For use by parsers and reparsers only.
- */
- void setLength(int newLength);
-
- /**
- * Assigns pointer to next region, or null if last region.
- *
- * For use by parsers and reparsers only.
- */
- void setNext(IStructuredDocumentRegion newNext);
-
- /**
- * Assigns parent documnet.
- *
- * For use by parsers and reparsers only.
- */
- void setParentDocument(IStructuredDocument document);
-
- /**
- * Assigns pointer to previous region, or null if first region.
- *
- * For use by parsers and reparsers only.
- */
- void setPrevious(IStructuredDocumentRegion newPrevious);
-
- /**
- * Sets start offset of region, relative to beginning of document.
- *
- * For use by parsers and reparsers only.
- */
- void setStart(int newStart);
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java
deleted file mode 100644
index 734431e416..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java
+++ /dev/null
@@ -1,52 +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.sse.core.internal.provisional.text;
-
-import java.util.Enumeration;
-
-/**
- * This is a class used to provide a list of StructuredDocumentRegions, so the
- * implementation of how the list is formed can be hidden (encapsulated by
- * this class).
- *
- * ISSUE: should extend ITextRegionList instead?
- *
- * @plannedfor 1.0
- *
- */
-public interface IStructuredDocumentRegionList {
-
- /**
- * Returns enumeration.
- *
- * @return enumeration.
- */
- Enumeration elements();
-
- /**
- * Returns size of list.
- *
- * @return size of list.
- */
- int getLength();
-
- /**
- * Returns the structured document region at index i.
- *
- * @param i
- * index of region to return
- * @return the region at specified offset.
- */
- IStructuredDocumentRegion item(int i);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
deleted file mode 100644
index 17c2019980..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.provisional.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partitioning for StructuredDocuments.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @deprecated use org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitions
- */
-public interface IStructuredPartitionTypes {
-
- String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$
- String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java
deleted file mode 100644
index f7e940c2d4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.wst.sse.core.internal.provisional.text;
-
-/**
- * Identifies the way that Documents are partitioned.
- *
- * @plannedfor 1.0
- */
-public interface IStructuredPartitioning {
-
- /** String to identify default partitioning*/
- String DEFAULT_STRUCTURED_PARTITIONING = "org.eclipse.wst.sse.core.default_structured_text_partitioning"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
deleted file mode 100644
index 9e53f8f26f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
+++ /dev/null
@@ -1,86 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
-
-
-/**
- * A partitioner interface required for handling the embedded content type
- * properly.
- *
- * ISSUE: need to investigate necessity of these methods
- *
- * @plannedfor 1.0
- */
-
-public interface IStructuredTextPartitioner extends IDocumentPartitioner {
-
- /**
- * Used by JSP partitioner to ensure that the partitioner of the
- * embedded content type gets to create the partition in case the specific
- * classes are important.
- *
- * ISSUE: investigate if we really need this...
- */
- IStructuredTypedRegion createPartition(int offset, int length, String partitionType);
-
- /**
- * Returns the Default partition type for this partitioner.
- * <p>
- * eg:
- * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code>
- * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code>
- * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code>
- * </p>
- * @see org.eclipse.wst.sse.core.text.IStructuredPartitions
- * @see org.eclipse.wst.xml.core.text.IXMLPartitions
- * @see org.eclipse.wst.html.core.text.IHTMLPartitions
- * @see org.eclipse.wst.jsp.core.text.IJSPPartitions
- *
- * @return the Default partition type for this partitioner.
- */
- String getDefaultPartitionType();
-
- /**
- * Returns the particular partition type for the given region/offset.
- * <p>
- * eg:
- * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code>
- * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code>
- * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code>
- * </p>
- *
- * @param region of the IStructuredDocument
- * @param offset in the IStructuredDoucment
- * @return the particular partition type for the given region/offset.
- */
- String getPartitionType(ITextRegion region, int offset);
-
- /**
- * Returns the partition type String of the IStructuredDocumentRegion
- * between the 2 region parameters.
- * Useful for finding the partition type of a 0 length region.
- * eg.
- * <pre>
- * <script type="text/javascript">|</script>
- * </pre>
- * @param previousNode
- * @param nextNode
- * @return the partition type of the node between previousNode and nextNode
- * @deprecated move to IDocumentPartitionerExtension2 ->
- * String getContentType(int offset, boolean preferOpenPartitions);
- */
- String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java
deleted file mode 100644
index 5acdfa1e2f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java
+++ /dev/null
@@ -1,72 +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.sse.core.internal.provisional.text;
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-
-/**
- * IStructuredTextReParser describes the characteristics and responsibilities
- * for reparsing a structured document.
- *
- * @plannedfor 1.0
- */
-public interface IStructuredTextReParser {
-
- /**
- * Begins the process of reparsing, by providing the information needed
- * for the reparse. The reparse is actually performed when the reparse
- * method is called. Will through an IllegalStateException if document as
- * not be set.
- *
- * @param requester
- * @param start
- * @param lengthToReplace
- * @param changes
- */
- void initialize(Object requester, int start, int lengthToReplace, String changes);
-
- /**
- * This method is provided to enable multiple threads to reparse a
- * document. This is needed since the intialize method sets state
- * variables that must be "in sync" with the structuredDocument.
- */
- public boolean isParsing();
-
- /**
- * Returns a new instance of this reparser, used when cloning documents.
- *
- * @return a new instance of this reparser.
- */
- public IStructuredTextReParser newInstance();
-
- /**
- * An entry point for reparsing. It needs to calculates the dirty start
- * and dirty end in terms of structured document regions based on the
- * start point and length of the changes, which are provided by the
- * initialize method. Will through an IllegalStateException if document as
- * not be set.
- *
- */
- public StructuredDocumentEvent reparse();
-
-
-
- /**
- * The reparser is initialized with its document, either in or shortly
- * after its constructed is called.
- *
- * @param structuredDocument
- */
- public void setStructuredDocument(IStructuredDocument newStructuredDocument);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java
deleted file mode 100644
index b1281ab82c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-
-/**
- * A simple description of a bit of text (technically, a bit of a text buffer)
- * that has a "type" associated with it. For example, for the XML text
- * "&LT;IMG&GT;", the ' <' might form a region of type "open bracket" where as
- * the text "IMG" might form a region of type "tag name".
- *
- * Note that there are three positions associated with a region, the start,
- * the end, and the end of the text. The end of the region should always be
- * greater than or equal to the end of the text, because the end of the text
- * simply includes any white space that might follow the non-whitespace
- * portion of the region. This whitespace is assumed to be ignorable except
- * for reasons of maintaining it in the original document for formatting,
- * appearance, etc.
- *
- * Follows the Prime Directives:
- *
- * getEnd() == getStart() + getLength()
- *
- * getTextEnd() == getStart() + getTextLength();
- *
- * Event though 'end' and 'length' are redundant (given start), both methods
- * are provided, since some parsers/implementations favor one or the other for
- * efficiency.
- *
- * @plannedfor 1.0
- */
-public interface ITextRegion {
-
- /**
- * Changes length of region. May be less than, equal to, or greater than
- * zero. It may not, however, cause the length of the region to be less
- * than or equal to zero, or an illegal argument acception may be thrown
- * at runtime.
- *
- * For use by parsers and reparsers only.
- */
- void adjustLength(int i);
-
- /**
- * Changes start offset of region. May be less than, equal to, or greater
- * than zero. It may not, however, cause the offset of the region to be
- * less than zero, or an illegal argument acception may be thrown at
- * runtime.
- *
- * For use by parsers and reparsers only.
- */
- void adjustStart(int i);
-
- /**
- * Changes text length of region.
- *
- * May be less than, equal to, or greater than zero. It may not, however,
- * cause the text length of the region to be greater than the length of a
- * region, or an illegal argument acception may be thrown at runtime.
- *
- * For use by parsers and reparsers only.
- */
- void adjustTextLength(int i);
-
- /**
- * Makes this regions start, length, and text length equal to the
- * paremter's start, length, and text length.
- *
- * @param region
- */
- void equatePositions(ITextRegion region);
-
- /**
- * Returns the end offset of this region. Whether is relative to the
- * document, or another region depends on the subtype.
- *
- * Follows the Prime Directive: getEnd() == getStart() + getLength()
- *
- * @return the end offset of this region.
- */
- int getEnd();
-
- /**
- * Returns the length of the region.
- *
- * Follows the Prime Directive: getEnd() == getStart() + getLength()
- *
- * @return the length of the region.
- */
- int getLength();
-
- /**
- * Returns the start of the region. Whether is relative to the document,
- * or another region depends on the subtype.
- *
- * Follows the Prime Directive: getEnd() == getStart() + getLength()
- *
- * @return the start of the region.
- */
- int getStart();
-
- /**
- * Returns the end offset of the text of this region.
- *
- * In some implementations, the "end" of the region (accessible via
- * getEnd()) also contains any and all white space that may or may not be
- * present after the "token" (read: relevant) part of the region. This
- * method, getTextEnd(), is specific for the "token" part of the region,
- * without the whitespace.
- *
- * @return the end offset of the text of this region.
- */
- int getTextEnd();
-
- /**
- * Returns the length of the text of this region.
- *
- * The text length is equal to length if there is no white space at the
- * end of a region. Otherwise it is smaller than length.
- *
- * @return the length of the text of this region.
- */
- int getTextLength();
-
- /**
- * Returns the type of this region.
- *
- * @see regiontypes, structureddocumentregiontypes
- * @return the type of this region.
- */
- String getType();
-
- /**
- * Allows the region itself to participate in reparsing process.
- *
- * The region itself can decide if it can determine the appropriate event
- * to return, based on the requested change. If it can not, this method
- * must return null, so a "higher level" reparsing process will be given
- * the oppurtunity to decide. If it returns an Event, that's it, not other
- * reparsing process will get an oppurtunity to reparse.
- *
- * For use by parsers and reparsers only.
- *
- */
- StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java
deleted file mode 100644
index 08890ae4e1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java
+++ /dev/null
@@ -1,178 +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.sse.core.internal.provisional.text;
-
-/**
- * ITextRegionCollection, as its name implies, is a collection of
- * ITextRegions.
- *
- * @plannedfor 1.0
- */
-public interface ITextRegionCollection extends ITextRegion {
-
- /**
- * Used to determine if a region contains a particular offset, where
- * offset is relative to the beginning of a document.
- *
- * @param offset
- * @return true if offset is greater than or equal to regions start and
- * less than its end offset.
- */
- boolean containsOffset(int offset);
-
- /**
- * Used to determine if a region contains a particular offset.
- *
- * ISSUE: I need to figure out what this is really for! (that is, how to
- * describe it, or if still needed).
- *
- * @param offset
- * @return true if offset is greater than or equal to regions start and
- * less than its end offset.
- */
- boolean containsOffset(ITextRegion region, int offset);
-
- /**
- * Returns the end offset of this region, relative to beginning of
- * document.
- *
- * For some subtypes, but not all, it is equivilent to getEnd().
- *
- * @return the end offset of this region.
- */
- int getEndOffset();
-
- /**
- * Returns the end offset, relative to the beginning of the document of
- * the contained region.
- *
- * @param containedRegion
- * @return the end offset of the contained region.
- */
- int getEndOffset(ITextRegion containedRegion);
-
- /**
- * Returns the first region of those contained by this region collection.
- *
- * @return the first region.
- */
- ITextRegion getFirstRegion();
-
- /**
- * Returns the full text of this region, including whitespace.
- *
- * @return the full text of this region, including whitespace.
- */
- String getFullText();
-
- /**
- * Returns the full text of the contained region, including whitespace.
- *
- * @return the full text of the contained region, including whitespace.
- */
- String getFullText(ITextRegion containedRegion);
-
- /**
- * Returns the last region of those contained by this region collection.
- *
- * @return the last region.
- */
- ITextRegion getLastRegion();
-
- /**
- * Returns the number of regions contained by this region.
- *
- * @return the number of regions contained by this region.
- */
- int getNumberOfRegions();
-
- /**
- * Returns the region that contains offset. In the case of "nested"
- * regions, returns the top most region.
- *
- * @param offset
- * relative to beginning of document.
- * @return the region that contains offset. In the case of "nested"
- * regions, returns the top most region.
- */
- ITextRegion getRegionAtCharacterOffset(int offset);
-
- /**
- * Returns the regions contained by this region.
- *
- * Note: no assumptions should be made about the object identity of the
- * regions returned. Put another way, due to memory use optimizations,
- * even if the underlying text has not changed, the regions may or may not
- * be the same ones returned from one call to the next.
- *
- * @return the regions contained by this region.
- */
- ITextRegionList getRegions();
-
- /**
- * Returns the start offset of this region, relative to the beginning of
- * the document.
- *
- * @return the start offset of this region
- */
- int getStartOffset();
-
- /**
- * Returns the start offset of the contained region, relative to the
- * beginning of the document.
- *
- * @return the start offset of the contained region
- */
- int getStartOffset(ITextRegion containedRegion);
-
- /**
- * Returns the text of this region, not including white space.
- *
- * @return the text of this region, not including white space.
- */
- String getText();
-
- /**
- * Returns the text of the contained region, not including white space.
- *
- * @return the text of the contained region, not including white space.
- */
- String getText(ITextRegion containedRegion);
-
- /**
- * Returns the end offset of the text of this region, not including white
- * space.
- *
- * @return the end offset of the text of this region, not including white
- * space.
- */
- int getTextEndOffset();
-
- /**
- * Returns the end offset of the text of the contained region, not
- * including white space.
- *
- * @return the end offset of the text of the contained region, not
- * including white space.
- */
- int getTextEndOffset(ITextRegion containedRegion);
-
- /**
- * Assigns the collection contained in this region.
- *
- * For use by parsers and reparsers only.
- *
- * @param containedRegions
- */
- void setRegions(ITextRegionList containedRegions);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java
deleted file mode 100644
index 654ca8116e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.text;
-
-/**
- * ITextRegionContainer contains other regions, like a ITextRegionCollection
- * but is itself a region in an ITextRegionCollection, so its "parent" region
- * is maintained.
- *
- * @plannedfor 1.0
- */
-public interface ITextRegionContainer extends ITextRegionCollection {
-
- /**
- * Returns the parent region.
- *
- * @return the parent region.
- */
- ITextRegionCollection getParent();
-
- /**
- * Sets the parent region.
- *
- * For use by parsers and reparsers only.
- *
- * @param parent
- * the ITextRegionCollection this region is contained in.
- */
- void setParent(ITextRegionCollection parent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
deleted file mode 100644
index 594d3e8167..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional.text;
-
-import java.util.Iterator;
-
-/**
- * ITextRegionList is to provide a list of regions. It can be used so clients
- * do not need to be aware of underlying implementation.
- */
-public interface ITextRegionList {
-
- /**
- * Adds region to the list.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- * @param region
- * @return
- */
- public boolean add(ITextRegion region);
-
- /**
- * Adds new regions to the list.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- * @param insertPos
- * @param newRegions
- * @return whether the contents of this list were modified
- */
- public boolean addAll(int insertPos, ITextRegionList newRegions);
-
- /**
- * Removes all regions from the list.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- */
- public void clear();
-
-
- /**
- * Returns the region at <code>index</code>, where 0 is first one in
- * the list. Throws an <code>ArrayIndexOutOfBoundsException</code> if
- * list is empty, or if index is out of range.
- *
- * @param index
- * @return
- */
- public ITextRegion get(int index);
-
- /**
- * Returns the index of <code>region</code> or -1 if <code>region</code>
- * is not in the list.
- *
- * @param region
- * @return
- */
- public int indexOf(ITextRegion region);
-
- /**
- * Returns true if list has no regions.
- *
- * @return true if list has no regions.
- */
- public boolean isEmpty();
-
-
- /**
- * Returns an iterator for this list.
- *
- * @return an iterator for this list.
- */
- public Iterator iterator();
-
- /**
- * Removes the region at index.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- */
- public ITextRegion remove(int index);
-
- /**
- * Removes the region.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- */
- public void remove(ITextRegion region);
-
-
- /**
- * Removes all regionList from this list.
- *
- * For use by parsers and reparsers only, while list is being created.
- *
- */
- public void removeAll(ITextRegionList regionList);
-
- /**
- * Returns the size of the list.
- *
- * @return the size of the list.
- */
- public int size();
-
-
- /**
- * Creates and returns the regions in an array. No assumptions should be
- * made if the regions in the array are clones are same instance of
- * original region.
- *
- * ISSUE: do we need to specify if cloned copies or not?
- *
- * @return an array of regions.
- */
- public ITextRegion[] toArray();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
deleted file mode 100644
index c4821c1e8f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
+++ /dev/null
@@ -1,2979 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * Jesper Steen Møller - initial IDocumentExtension4 support - #102822
- * (see also #239115)
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possible
- * David Carver (Intalio) - bug 300443 - some constants aren't static final
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import java.io.Reader;
-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.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPartitioningException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.DocumentPartitioningChangedEvent;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionEvent;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IDocumentPartitionerExtension;
-import org.eclipse.jface.text.IDocumentPartitionerExtension2;
-import org.eclipse.jface.text.IDocumentPartitionerExtension3;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension2;
-import org.eclipse.jface.text.IDocumentRewriteSessionListener;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.ILineTrackerExtension;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextStore;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-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.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.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * The standard implementation of structured document.
- */
-public class BasicStructuredDocument implements IStructuredDocument, IDocumentExtension, IDocumentExtension3, IDocumentExtension4, CharSequence, IRegionComparible {
-
- /**
- * This ThreadLocal construct is used so each thread can maintain its only
- * pointer to the double linked list that manages the documents regions.
- * The only thing we "gaurd" for is that a previously cached region has
- * been deleted.
- *
- * The object that is kept in the thread local's map, is just a pointer to
- * an array position. That's because the object there needs to be "free"
- * from references to other objects, or it will not be garbage collected.
- */
- private class CurrentDocumentRegionCache {
- // I'm assuming for now there would never be so many threads that
- // this arrayList needs to be bounded, or 'cleaned up'.
- // this assumption should be tested in practice and long running
- // jobs -- found not to be a good assumption. See below.
- private List cachedRegionPositionArray = Collections.synchronizedList(new ArrayList());
- private final boolean DEBUG = false;
- private static final int MAX_SIZE = 50;
-
-
- private ThreadLocal threadLocalCachePosition = new ThreadLocal();
-
- IStructuredDocumentRegion get() {
- IStructuredDocumentRegion region = null;
- int pos = getThreadLocalPosition();
- try {
- region = (IStructuredDocumentRegion) cachedRegionPositionArray.get(pos);
- }
- catch (IndexOutOfBoundsException e) {
- // even though the cachedRegionPosition is synchronized,
- // that just means each access is syncronized, its
- // still possible for another thread to cause it to
- // be cleared, after this thread gets it position.
- // So, if that happens, all we can do is reset to beginning.
- // This should be extremely rare (in other words, probably
- // not worth using synchronized blocks
- // to access cachedRegionPositionArray.
- reinitThreadLocalPosition();
- resetToInitialState();
- }
- if (region == null) {
- region = resetToInitialState();
- }
- else
- // region not null
- if (region.isDeleted()) {
- region = resetToInitialState();
- }
- return region;
- }
-
- private int getThreadLocalPosition() {
- Object threadLocalObject = threadLocalCachePosition.get();
- int pos = -1;
- if (threadLocalObject == null) {
-
- pos = reinitThreadLocalPosition();
- }
- else {
- pos = ((Integer) threadLocalObject).intValue();
- }
- return pos;
- }
-
- /**
- * @return
- */
- private int reinitThreadLocalPosition() {
- Integer position;
- int pos;
- // TODO_future: think of a better solution that doesn't
- // require this kludge. This is especially required because
- // some infrasture, such as reconciler, actually null out
- // their thread object and recreate it, 500 msecs later
- // (approximately).
- // Note: the likely solution in future is to clear after every
- // heavy use of getCachedRegion, such as in creating node
- // lists, or reparsing or partioning.
- if (cachedRegionPositionArray.size() > MAX_SIZE) {
- cachedRegionPositionArray.clear();
- if (DEBUG) {
- System.out.println("cachedRegionPositionArray cleared at size " + MAX_SIZE); //$NON-NLS-1$
- }
- }
- position = new Integer(cachedRegionPositionArray.size());
- threadLocalCachePosition.set(position);
- cachedRegionPositionArray.add(position.intValue(), null);
- pos = position.intValue();
- return pos;
- }
-
- private IStructuredDocumentRegion resetToInitialState() {
- IStructuredDocumentRegion region;
- region = getFirstStructuredDocumentRegion();
- set(region);
- return region;
- }
-
- void set(IStructuredDocumentRegion region) {
- try {
- int pos = getThreadLocalPosition();
- cachedRegionPositionArray.set(pos, region);
- }
- catch (IndexOutOfBoundsException e) {
- // even though the cachedRegionPosition is synchronized,
- // that just means each access is syncronized, its
- // still possible for another thread to cause it to
- // be cleared, after this thread gets it position.
- // So, if that happens, all we can do is reset to beginning.
- // This should be extremely rare (in other words, probably
- // not worth using synchronized blocks
- // to access cachedRegionPositionArray.
- reinitThreadLocalPosition();
- resetToInitialState();
- }
- }
- }
-
- /**
- * This NullDocumentEvent is used to complete the "aboutToChange" and
- * "changed" cycle, when in fact the original change is no longer valid.
- * The only known (valid) case of this is when a model re-initialize takes
- * place, which causes setText to be called in the middle of some previous
- * change. [This architecture will be improved in future].
- */
- public class NullDocumentEvent extends DocumentEvent {
- public NullDocumentEvent() {
- this(BasicStructuredDocument.this, 0, 0, ""); //$NON-NLS-1$
- }
-
- private NullDocumentEvent(IDocument doc, int offset, int length, String text) {
- super(doc, offset, length, text);
- }
- }
-
- static class RegisteredReplace {
- /** The owner of this replace operation. */
- IDocumentListener fOwner;
- /** The replace operation */
- IDocumentExtension.IReplace fReplace;
-
- /**
- * Creates a new bundle object.
- *
- * @param owner
- * the document listener owning the replace operation
- * @param replace
- * the replace operation
- */
- RegisteredReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) {
- fOwner = owner;
- fReplace = replace;
- }
- }
-
- /**
- * these control variable isn't mark as 'final' since there's some unit
- * tests that manipulate it. For final product, it should be.
- */
-
- private static boolean USE_LOCAL_THREAD = true;
-
- /**
- * purely for debugging/performance measurements In practice, would always
- * be 'true'. (and should never be called by called by clients). Its not
- * 'final' or private just so it can be varied during
- * debugging/performance measurement runs.
- *
- * @param use_local_thread
- */
- public static void setUSE_LOCAL_THREAD(final boolean use_local_thread) {
- USE_LOCAL_THREAD = use_local_thread;
- }
-
- private IStructuredDocumentRegion cachedDocumentRegion;
- private EncodingMemento encodingMemento;
- private boolean fAcceptPostNotificationReplaces = true;
- private CurrentDocumentRegionCache fCurrentDocumentRegionCache;
- private DocumentEvent fDocumentEvent;
- private IDocumentListener[] fDocumentListeners;
-
- /**
- * The registered document partitioners.
- */
- private Map fDocumentPartitioners;
- /** The registered document partitioning listeners */
- private List fDocumentPartitioningListeners;
- private IStructuredDocumentRegion firstDocumentRegion;
- private RegionParser fParser;
- private GenericPositionManager fPositionManager;
- private List fPostNotificationChanges;
- private IDocumentListener[] fPrenotifiedDocumentListeners;
- private int fReentranceCount = 0;
- private IStructuredTextReParser fReParser;
- private int fStoppedCount = 0;
-
- private ITextStore fStore;
- private Object[] fStructuredDocumentAboutToChangeListeners;
- private Object[] fStructuredDocumentChangedListeners;
- private Object[] fStructuredDocumentChangingListeners;
-
- private List fDocumentRewriteSessionListeners;
-
- private ILineTracker fTracker;
- private IStructuredTextUndoManager fUndoManager;
- private IStructuredDocumentRegion lastDocumentRegion;
-
- private byte[] listenerLock = new byte[0];
- private NullDocumentEvent NULL_DOCUMENT_EVENT;
-
- /**
- * Theoretically, a document can contain mixed line delimiters, but the
- * user's preference is usually to be internally consistent.
- */
- private String fInitialLineDelimiter;
- private static final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
- /**
- * Current rewrite session, or none if not presently rewriting.
- */
- private DocumentRewriteSession fActiveRewriteSession;
- /**
- * Last modification stamp, automatically updated on change.
- */
- private long fModificationStamp;
- /**
- * Keeps track of next modification stamp.
- */
- private long fNextModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
- /**
- * debug variable only
- *
- * @param parser
- */
- private long startStreamTime;
- /**
- * debug variable only
- *
- * @param parser
- */
- private long startTime;
-
- public BasicStructuredDocument() {
- super();
- fCurrentDocumentRegionCache = new CurrentDocumentRegionCache();
- setTextStore(new StructuredDocumentTextStore(50, 300));
- setLineTracker(new DefaultLineTracker());
- NULL_DOCUMENT_EVENT = new NullDocumentEvent();
-
- internal_addPositionCategory(READ_ONLY_REGIONS_CATEGORY);
- internal_addPositionUpdater(new DeleteEqualPositionUpdater(READ_ONLY_REGIONS_CATEGORY));
-
- }
-
- /**
- * This is the primary way to get a new structuredDocument. Its best to
- * use the factory methods in ModelManger to create a new
- * IStructuredDocument, since it will get and initialize the parser
- * according to the desired content type.
- */
- public BasicStructuredDocument(RegionParser parser) {
- this();
- Assert.isNotNull(parser, "Program Error: IStructuredDocument can not be created with null parser"); //$NON-NLS-1$
- // go through setter in case there is side effects
- internal_setParser(parser);
- }
-
- private void _clearDocumentEvent() {
- // no hard and fast requirement to null out ... just seems like
- // a good idea, since we are done with it.
- fDocumentEvent = null;
- }
-
- private void _fireDocumentAboutToChange(Object[] listeners) {
- // most DocumentAboutToBeChanged listeners do not anticipate
- // DocumentEvent == null. So make sure documentEvent is not
- // null. (this should never happen, yet it does sometimes)
- if (fDocumentEvent == null) {
- fDocumentEvent = new NullDocumentEvent();
- }
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- // Note: the docEvent is created in replaceText API
- // fire
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IDocumentListener) holdListeners[i]).documentAboutToBeChanged(fDocumentEvent);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void notifyDocumentPartitionersAboutToChange(DocumentEvent documentEvent) {
- if (fDocumentPartitioners != null) {
- Iterator e = fDocumentPartitioners.values().iterator();
- while (e.hasNext()) {
- IDocumentPartitioner p = (IDocumentPartitioner) e.next();
- // safeguard from listeners that throw exceptions
- try {
- p.documentAboutToBeChanged(documentEvent);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- }
- }
- }
-
- private void _fireDocumentChanged(Object[] listeners, StructuredDocumentEvent event) {
-
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- // NOTE: document event is created in replace Text API and setText
- // API
- // now fire
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
-
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- // Notes: fDocumentEvent can be "suddenly" null, if one of
- // the
- // previous changes
- // caused a "setText" to be called. The only known case of
- // this
- // is a model reset
- // due to page directive changing. Eventually we should
- // change
- // archetecture to have
- // event que and be able to "cancel" pending events, but
- // for
- // now, we'll just pass a
- // NullDocumentEvent. By the way, it is important to send
- // something, since clients might
- // have indeterminant state due to "aboutToChange" being
- // sent
- // earlier.
- if (fDocumentEvent == null) {
- ((IDocumentListener) holdListeners[i]).documentChanged(NULL_DOCUMENT_EVENT);
- }
- else {
- ((IDocumentListener) holdListeners[i]).documentChanged(fDocumentEvent);
- }
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void notifyDocumentPartitionersDocumentChanged(DocumentEvent documentEvent) {
- if (fDocumentPartitioners != null) {
- Iterator e = fDocumentPartitioners.values().iterator();
- while (e.hasNext()) {
- IDocumentPartitioner p = (IDocumentPartitioner) e.next();
- // safeguard from listeners that throw exceptions
- try {
- if (p instanceof IDocumentPartitionerExtension) {
- // IRegion changedPartion =
- ((IDocumentPartitionerExtension) p).documentChanged2(documentEvent);
- }
- else {
- p.documentChanged(documentEvent);
- }
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- }
- }
- }
-
-
- private void _fireEvent(Object[] listeners, NoChangeEvent event) {
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IStructuredDocumentListener) holdListeners[i]).noChange(event);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void _fireEvent(Object[] listeners, RegionChangedEvent event) {
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IStructuredDocumentListener) holdListeners[i]).regionChanged(event);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void _fireEvent(Object[] listeners, RegionsReplacedEvent event) {
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IStructuredDocumentListener) holdListeners[i]).regionsReplaced(event);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void _fireEvent(Object[] listeners, StructuredDocumentRegionsReplacedEvent event) {
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IStructuredDocumentListener) holdListeners[i]).nodesReplaced(event);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- private void _fireStructuredDocumentAboutToChange(Object[] listeners) {
- // we must assign listeners to local variable, since the add and
- // remove
- // listner
- // methods can change the actual instance of the listener array from
- // another thread
- if (listeners != null) {
- Object[] holdListeners = listeners;
- // Note: the docEvent is created in replaceText API
- // fire
- for (int i = 0; i < holdListeners.length; i++) {
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- startTime = System.currentTimeMillis();
- }
- // safeguard from listeners that throw exceptions
- try {
- // notice the AboutToBeChangedEvent is created from the
- // DocumentEvent, since it is (nearly)
- // the same information. ?What to do about
- // originalRequester?
- if (fDocumentEvent == null) {
- fDocumentEvent = new NullDocumentEvent();
- }
- AboutToBeChangedEvent aboutToBeChangedEvent = new AboutToBeChangedEvent(this, null, fDocumentEvent.getText(), fDocumentEvent.getOffset(), fDocumentEvent.getLength());
- // this is a safe cast, since addListners requires a
- // IStructuredDocumentListener
- ((IModelAboutToBeChangedListener) holdListeners[i]).modelAboutToBeChanged(aboutToBeChangedEvent);
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
- long stopTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
- }
-
- protected void acquireLock() {
- // do nothing here in super class
- }
-
- /**
- * addModelAboutToBeChangedListener method comment.
- */
- public void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
- synchronized (listenerLock) {
-
- // make sure listener is not already in listening
- // (and if it is, print a warning to aid debugging, if needed)
- if (!Utilities.contains(fStructuredDocumentAboutToChangeListeners, listener)) {
- int oldSize = 0;
- if (fStructuredDocumentAboutToChangeListeners != null) {
- // normally won't be null, but we need to be sure, for
- // first
- // time through
- oldSize = fStructuredDocumentAboutToChangeListeners.length;
- }
- int newSize = oldSize + 1;
- Object[] newListeners = new Object[newSize];
- if (fStructuredDocumentAboutToChangeListeners != null) {
- System.arraycopy(fStructuredDocumentAboutToChangeListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fStructuredDocumentAboutToChangeListeners = newListeners;
- //
- }
- }
- }
-
- /**
- * The StructuredDocumentListners and ModelChagnedListeners are very
- * similar. They both receive identical events. The difference is the
- * timing. The "pure" StructuredDocumentListners are notified after the
- * structuredDocument has been changed, but before other, related models
- * may have been changed such as the Structural Model. The Structural
- * model is in fact itself a "pure" StructuredDocumentListner. The
- * ModelChangedListeners can rest assured that all models and data have
- * been updated from the change by the tiem they are notified. This is
- * especially important for the text widget, for example, which may rely
- * on both structuredDocument and structural model information.
- */
- public void addDocumentChangedListener(IStructuredDocumentListener listener) {
- synchronized (listenerLock) {
-
- if (Debug.debugStructuredDocument) {
- System.out.println("IStructuredDocument::addModelChangedListener. Request to add an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
- }
- // make sure listener is not already in listening
- // (and if it is, print a warning to aid debugging, if needed)
- if (Utilities.contains(fStructuredDocumentChangedListeners, listener)) {
- if (Debug.displayWarnings) {
- System.out.println("IStructuredDocument::addModelChangedListener. listener " + listener + " was addeded more than once. "); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- if (Debug.debugStructuredDocument) {
- System.out.println("IStructuredDocument::addModelChangedListener. Adding an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
- }
- int oldSize = 0;
- if (fStructuredDocumentChangedListeners != null) {
- // normally won't be null, but we need to be sure, for
- // first
- // time through
- oldSize = fStructuredDocumentChangedListeners.length;
- }
- int newSize = oldSize + 1;
- Object[] newListeners = new Object[newSize];
- if (fStructuredDocumentChangedListeners != null) {
- System.arraycopy(fStructuredDocumentChangedListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fStructuredDocumentChangedListeners = newListeners;
- //
- // when a listener is added,
- // send the new model event to that one particular listener,
- // so it
- // can initialize itself with the current state of the model
- // listener.newModel(new NewModelEvent(this, listener));
- }
- }
- }
-
- public void addDocumentChangingListener(IStructuredDocumentListener listener) {
- synchronized (listenerLock) {
-
- if (Debug.debugStructuredDocument) {
- System.out.println("IStructuredDocument::addStructuredDocumentListener. Request to add an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
- }
- // make sure listener is not already in listening
- // (and if it is, print a warning to aid debugging, if needed)
- if (Utilities.contains(fStructuredDocumentChangingListeners, listener)) {
- if (Debug.displayWarnings) {
- System.out.println("IStructuredDocument::addStructuredDocumentListener. listener " + listener + " was addeded more than once. "); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- if (Debug.debugStructuredDocument) {
- System.out.println("IStructuredDocument::addStructuredDocumentListener. Adding an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
- }
- int oldSize = 0;
- if (fStructuredDocumentChangingListeners != null) {
- // normally won't be null, but we need to be sure, for
- // first
- // time through
- oldSize = fStructuredDocumentChangingListeners.length;
- }
- int newSize = oldSize + 1;
- Object[] newListeners = new Object[newSize];
- if (fStructuredDocumentChangingListeners != null) {
- System.arraycopy(fStructuredDocumentChangingListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fStructuredDocumentChangingListeners = newListeners;
- //
- // when a listener is added,
- // send the new model event to that one particular listener,
- // so it
- // can initialize itself with the current state of the model
- // listener.newModel(new NewModelEvent(this, listener));
- }
- }
- }
-
- /**
- * We manage our own document listners, instead of delegating to our
- * parentDocument, so we can fire at very end (and not when the
- * parentDocument changes).
- *
- */
- public void addDocumentListener(IDocumentListener listener) {
- synchronized (listenerLock) {
-
- // make sure listener is not already in listening
- // (and if it is, print a warning to aid debugging, if needed)
- if (!Utilities.contains(fDocumentListeners, listener)) {
- int oldSize = 0;
- if (fDocumentListeners != null) {
- // normally won't be null, but we need to be sure, for
- // first
- // time through
- oldSize = fDocumentListeners.length;
- }
- int newSize = oldSize + 1;
- IDocumentListener[] newListeners = null;
- newListeners = new IDocumentListener[newSize];
- if (fDocumentListeners != null) {
- System.arraycopy(fDocumentListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- // now switch new for old
- fDocumentListeners = newListeners;
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
- *
- * Registers the document partitioning listener with the document. After
- * registration the IDocumentPartitioningListener is informed about each
- * partition change cause by a document manipulation. If a document
- * partitioning listener is also a document listener, the following
- * notification sequence is guaranteed if a document manipulation changes
- * the document partitioning: 1)
- * listener.documentAboutToBeChanged(DocumentEvent); 2)
- * listener.documentPartitioningChanged(); 3)
- * listener.documentChanged(DocumentEvent); If the listener is already
- * registered nothing happens.
- *
- * @see IDocumentPartitioningListener
- */
-
- public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
- synchronized (listenerLock) {
-
- Assert.isNotNull(listener);
- if (fDocumentPartitioningListeners == null) {
- fDocumentPartitioningListeners = new ArrayList(1);
- }
- if (!fDocumentPartitioningListeners.contains(listener))
- fDocumentPartitioningListeners.add(listener);
- }
- }
-
- /**
- * Adds the position to the document's default position category. The
- * default category must be specified by the implementer. A position that
- * has been added to a position category is updated at each change applied
- * to the document.
- *
- * @exception BadLocationException
- * If position is not a valid range in the document
- */
- public void addPosition(Position position) throws BadLocationException {
- getPositionManager().addPosition(position);
- }
-
- /**
- * @see IDocument#addPosition
- * @exception BadLocationException
- * If position is not a valid range in the document
- * @exception BadPositionCategoryException
- * If the category is not defined for the document
- */
- public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
- getPositionManager().addPosition(category, position);
- }
-
- /**
- * @see IDocument#addPositionCategory
- */
- public void addPositionCategory(String category) {
- internal_addPositionCategory(category);
- }
-
- /**
- * @see IDocument#addPositionUpdater
- */
- public void addPositionUpdater(IPositionUpdater updater) {
- internal_addPositionUpdater(updater);
- }
-
- /**
- * Adds the given document listener as one which is notified before those
- * document listeners added with <code>addDocumentListener</code> are
- * notified. If the given listener is also registered using
- * <code>addDocumentListener</code> it will be notified twice. If the
- * listener is already registered nothing happens.
- * <p>
- *
- * This method is not for public use, it may only be called by
- * implementers of <code>IDocumentAdapter</code> and only if those
- * implementers need to implement <code>IDocumentListener</code>.
- *
- * @param documentAdapter
- * the listener to be added as prenotified document listener
- */
- public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
- synchronized (listenerLock) {
-
- if (fPrenotifiedDocumentListeners != null) {
- int previousSize = fPrenotifiedDocumentListeners.length;
- IDocumentListener[] listeners = new IDocumentListener[previousSize + 1];
- System.arraycopy(fPrenotifiedDocumentListeners, 0, listeners, 0, previousSize);
- listeners[previousSize] = documentAdapter;
- fPrenotifiedDocumentListeners = listeners;
- }
- else {
- fPrenotifiedDocumentListeners = new IDocumentListener[1];
- fPrenotifiedDocumentListeners[0] = documentAdapter;
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#charAt(int)
- */
- public char charAt(int arg0) {
- try {
- return getChar(0);
- }
- catch (BadLocationException e) {
- throw new IndexOutOfBoundsException();
- }
- }
-
- /**
- * This form of the API removes all read only positions, as should be done
- * we 'setText' is called. Note: an alternative algorithm may simply
- * remove the category (and it would get added back in later, if/when
- * readonly regions added.
- */
- private void clearReadOnly() {
- Position[] positions = null;
- try {
- positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
- }
- catch (BadPositionCategoryException e) {
- Logger.logException("program error: should never occur", e); //$NON-NLS-1$
- }
- for (int i = 0; i < positions.length; i++) {
- Position position = positions[i];
- // note we don't fire the "about to change" or "changed" events,
- // since presumably, text is all going away and being replaced
- // anyway.
- position.delete();
- }
- }
-
-
- public void clearReadOnly(int startOffset, int length) {
- // TODO DW I still need to implement smarter algorithm that
- // adust existing RO regions, if needed. For now, I'll just
- // remove any that overlap.
- try {
- Position[] positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
- for (int i = 0; i < positions.length; i++) {
- Position position = positions[i];
- if (position.overlapsWith(startOffset, length)) {
- String effectedText = this.get(startOffset, length);
- // fDocumentEvent = new DocumentEvent(this, startOffset,
- // length, effectedText);
- fireReadOnlyAboutToBeChanged();
- position.delete();
- NoChangeEvent noChangeEvent = new NoChangeEvent(this, null, effectedText, startOffset, length);
- noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
- fireReadOnlyStructuredDocumentEvent(noChangeEvent);
- }
- }
- }
- catch (BadPositionCategoryException e) {
- // just means no readonly regions been defined yet
- // so nothing to do.
- }
- }
-
- /**
- * Computes the index at which a <code>Position</code> with the
- * specified offset would be inserted into the given category. As the
- * ordering inside a category only depends on the offset, the index must
- * be choosen to be the first of all positions with the same offset.
- *
- * @param category
- * the category in which would be added
- * @param offset
- * the position offset to be considered
- * @return the index into the category
- * @exception BadLocationException
- * if offset is invalid in this document
- * @exception BadPositionCategoryException
- * if category is undefined in this document
- */
- public int computeIndexInCategory(String category, int offset) throws org.eclipse.jface.text.BadPositionCategoryException, org.eclipse.jface.text.BadLocationException {
- return getPositionManager().computeIndexInCategory(category, offset);
- }
-
- /**
- * Computes the number of lines in the given text. For a given implementer
- * of this interface this method returns the same result as
- * <code>set(text); getNumberOfLines()</code>.
- *
- * @param text
- * the text whose number of lines should be computed
- * @return the number of lines in the given text
- */
- public int computeNumberOfLines(String text) {
- return getTracker().computeNumberOfLines(text);
- }
-
- /**
- * Computes the partitioning of the given document range using the
- * document's partitioner.
- *
- * @param offset
- * the document offset at which the range starts
- * @param length
- * the length of the document range
- * @return a specification of the range's partitioning
- * @throws BadLocationException
- * @throws BadPartitioningException
- */
- public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
- ITypedRegion[] typedRegions = null;
- try {
- typedRegions = computePartitioning(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, length, false);
- }
- catch (BadPartitioningException e) {
- // impossible in this context
- throw new Error(e);
- }
- if (typedRegions == null) {
- typedRegions = new ITypedRegion[0];
- }
- return typedRegions;
- }
-
-
- public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, boolean includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException {
- if ((0 > offset) || (0 > length) || (offset + length > getLength()))
- throw new BadLocationException();
-
- IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
- if (partitioner instanceof IDocumentPartitionerExtension2)
- return ((IDocumentPartitionerExtension2) partitioner).computePartitioning(offset, length, includeZeroLengthPartitions);
- else if (partitioner != null)
- return partitioner.computePartitioning(offset, length);
- else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
- return new TypedRegion[]{new TypedRegion(offset, length, DEFAULT_CONTENT_TYPE)};
- else
- throw new BadPartitioningException();
- }
-
- /**
- * @see IDocument#containsPosition
- */
- public boolean containsPosition(String category, int offset, int length) {
- return getPositionManager().containsPosition(category, offset, length);
- }
-
- /**
- * @see IDocument#containsPositionCategory
- */
- public boolean containsPositionCategory(String category) {
- return getPositionManager().containsPositionCategory(category);
- }
-
- public boolean containsReadOnly(int startOffset, int length) {
- boolean result = false;
- try {
- Position[] positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
- for (int i = 0; i < positions.length; i++) {
- Position position = positions[i];
- if (position.overlapsWith(startOffset, length)) {
- result = true;
- break;
- }
- }
- }
- catch (BadPositionCategoryException e) {
- // just means no readonly regions been defined yet
- // so obviously false
- result = false;
- }
- return result;
- }
-
- private void executePostNotificationChanges() {
- if (fStoppedCount > 0)
- return;
- while (fPostNotificationChanges != null) {
- List changes = fPostNotificationChanges;
- fPostNotificationChanges = null;
- Iterator e = changes.iterator();
- while (e.hasNext()) {
- RegisteredReplace replace = (RegisteredReplace) e.next();
- replace.fReplace.perform(this, replace.fOwner);
- }
- }
- }
-
- private void fireDocumentAboutToChanged() {
- // most DocumentAboutToBeChanged listeners do not anticipate
- // DocumentEvent == null. So make sure documentEvent is not
- // null. (this should never happen, yet it does sometimes)
- if (fDocumentEvent == null) {
- fDocumentEvent = new NullDocumentEvent();
- }
-
- _fireStructuredDocumentAboutToChange(fStructuredDocumentAboutToChangeListeners);
- // Note: the docEvent is created in replaceText API! (or set Text)
- _fireDocumentAboutToChange(fPrenotifiedDocumentListeners);
- notifyDocumentPartitionersAboutToChange(fDocumentEvent);
- _fireDocumentAboutToChange(fDocumentListeners);
- }
-
- /**
- * Fires the document partitioning changed notification to all registered
- * document partitioning listeners. Uses a robust iterator.
- *
- * @param event
- * the document partitioning changed event
- *
- * @see IDocumentPartitioningListenerExtension2
- */
- protected void fireDocumentPartitioningChanged(DocumentPartitioningChangedEvent event) {
- if (fDocumentPartitioningListeners == null || fDocumentPartitioningListeners.size() == 0)
- return;
-
- List list = new ArrayList(fDocumentPartitioningListeners);
- Iterator e = list.iterator();
- while (e.hasNext()) {
- IDocumentPartitioningListener l = (IDocumentPartitioningListener) e.next();
- if (l instanceof IDocumentPartitioningListenerExtension2) {
- IDocumentPartitioningListenerExtension2 extension2 = (IDocumentPartitioningListenerExtension2) l;
- extension2.documentPartitioningChanged(event);
- }
- else if (l instanceof IDocumentPartitioningListenerExtension) {
- IDocumentPartitioningListenerExtension extension = (IDocumentPartitioningListenerExtension) l;
- extension.documentPartitioningChanged(this, event.getCoverage());
- }
- else {
- l.documentPartitioningChanged(this);
- }
- }
-
- }
-
- private void fireReadOnlyAboutToBeChanged() {
- _fireStructuredDocumentAboutToChange(fStructuredDocumentAboutToChangeListeners);
- // Note: the docEvent is created in replaceText API! (or set Text)
- // _fireDocumentAboutToChange(fPrenotifiedDocumentListeners);
- // _fireDocumentAboutToChange(fDocumentListeners);
- }
-
- private void fireReadOnlyStructuredDocumentEvent(NoChangeEvent event) {
- _fireEvent(fStructuredDocumentChangingListeners, event);
- _fireEvent(fStructuredDocumentChangedListeners, event);
- // _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
- // _fireDocumentChanged(fDocumentListeners, event);
- // _clearDocumentEvent();
- }
-
- private void fireStructuredDocumentEvent(NoChangeEvent event) {
- _fireEvent(fStructuredDocumentChangingListeners, event);
- _fireEvent(fStructuredDocumentChangedListeners, event);
- _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
- notifyDocumentPartitionersDocumentChanged(event);
- _fireDocumentChanged(fDocumentListeners, event);
- _clearDocumentEvent();
- }
-
- private void fireStructuredDocumentEvent(RegionChangedEvent event) {
- _fireEvent(fStructuredDocumentChangingListeners, event);
- _fireEvent(fStructuredDocumentChangedListeners, event);
- _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
- notifyDocumentPartitionersDocumentChanged(event);
- _fireDocumentChanged(fDocumentListeners, event);
- _clearDocumentEvent();
- }
-
- private void fireStructuredDocumentEvent(RegionsReplacedEvent event) {
- _fireEvent(fStructuredDocumentChangingListeners, event);
- _fireEvent(fStructuredDocumentChangedListeners, event);
- _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
- notifyDocumentPartitionersDocumentChanged(event);
- _fireDocumentChanged(fDocumentListeners, event);
- _clearDocumentEvent();
- }
-
- private void fireStructuredDocumentEvent(StructuredDocumentRegionsReplacedEvent event) {
- _fireEvent(fStructuredDocumentChangingListeners, event);
- _fireEvent(fStructuredDocumentChangedListeners, event);
- _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
- notifyDocumentPartitionersDocumentChanged(event);
- _fireDocumentChanged(fDocumentListeners, event);
- _clearDocumentEvent();
- }
-
- /**
- * Returns the document's complete text.
- */
- public String get() {
- return getStore().get(0, getLength());
- }
-
- /**
- * Returns length characters from the document's text starting from the
- * specified position.
- *
- * @throws BadLocationException
- *
- * @exception BadLocationException
- * If the range is not valid in the document
- */
- public String get(int offset, int length) {
- String result = null;
- int myLength = getLength();
- if (0 > offset)
- offset = 0;
- if (0 > length)
- length = 0;
- if (offset + length > myLength) {
- // first try adjusting length to fit
- int lessLength = myLength - offset;
- if ((lessLength >= 0) && (offset + lessLength == myLength)) {
- length = lessLength;
- }
- else {
- // second, try offset
- int moreOffset = myLength - length;
- if ((moreOffset >= 0) && (moreOffset + length == myLength)) {
- offset = moreOffset;
- }
- else {
- // can happen if myLength is 0.
- // no adjustment possible.
- result = new String();
- }
- }
-
- }
- if (result == null) {
- result = getStore().get(offset, length);
- }
- return result;
- }
-
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- IStructuredDocumentRegion getCachedDocumentRegion() {
- IStructuredDocumentRegion result = null;
- if (USE_LOCAL_THREAD) {
- result = fCurrentDocumentRegionCache.get();
- }
- else {
- result = cachedDocumentRegion;
- }
- return result;
- }
-
- /**
- * @see IDocument#getChar
- * @exception BadLocationException
- * If position is not a valid range in the document
- */
- public char getChar(int pos) throws BadLocationException {
- char result = 0x00;
- try {
- result = getStore().get(pos);
- }
- catch (IndexOutOfBoundsException e) {
- throw new BadLocationException(e.getLocalizedMessage());
- }
- return result;
- }
-
- /**
- * Returns the type of the document partition containing the given
- * character position.
- */
- public String getContentType(int offset) throws BadLocationException {
- return getDocumentPartitioner().getContentType(offset);
- }
-
-
- public String getContentType(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException {
- if ((0 > offset) || (offset > getLength()))
- throw new BadLocationException();
-
- IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
- if (partitioner instanceof IDocumentPartitionerExtension2)
- return ((IDocumentPartitionerExtension2) partitioner).getContentType(offset, preferOpenPartitions);
- else if (partitioner != null)
- return partitioner.getContentType(offset);
- else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
- return DEFAULT_CONTENT_TYPE;
- else
- throw new BadPartitioningException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#getDefaultLineDelimiter()
- */
- public String getDefaultLineDelimiter() {
-
- String lineDelimiter= null;
-
- try {
- lineDelimiter= getLineDelimiter(0);
- } catch (BadLocationException x) {
- }
-
- if (lineDelimiter != null)
- return lineDelimiter;
-
- if (fInitialLineDelimiter != null)
- return fInitialLineDelimiter;
-
- String sysLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$
- String[] delimiters= getLegalLineDelimiters();
- Assert.isTrue(delimiters.length > 0);
- for (int i= 0; i < delimiters.length; i++) {
- if (delimiters[i].equals(sysLineDelimiter)) {
- lineDelimiter= sysLineDelimiter;
- break;
- }
- }
-
- if (lineDelimiter == null)
- lineDelimiter= delimiters[0];
-
- return lineDelimiter;
-
- }
-
- /**
- * Returns the document's partitioner.
- *
- * @see IDocumentPartitioner
- */
- public IDocumentPartitioner getDocumentPartitioner() {
- return getDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING);
- }
-
-
- public IDocumentPartitioner getDocumentPartitioner(String partitioning) {
-
- IDocumentPartitioner documentPartitioner = null;
- if (fDocumentPartitioners != null) {
- documentPartitioner = (IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
- }
- return documentPartitioner;
- }
-
- public EncodingMemento getEncodingMemento() {
- return encodingMemento;
- }
-
- public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- // should we update cachedNode?
- // We should to keep consistent philosophy of remembering last
- // requested position,
- // for efficiency.
- setCachedDocumentRegion(firstDocumentRegion);
- return firstDocumentRegion;
- }
-
- public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- // should we update cachedNode?
- // We should to keep consistent philosophy of remembering last
- // requested position,
- // for efficiency.
- setCachedDocumentRegion(lastDocumentRegion);
- return lastDocumentRegion;
- }
-
- /*
- * -------------------------- partitions
- * ----------------------------------
- */
- public String[] getLegalContentTypes() {
- String[] result = null;
- try {
- result = getLegalContentTypes(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
- }
- catch (BadPartitioningException e) {
- // impossible in this context
- throw new Error(e);
- }
- return result;
- }
-
- public String[] getLegalContentTypes(String partitioning) throws BadPartitioningException {
- IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
- if (partitioner != null)
- return partitioner.getLegalContentTypes();
- if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
- return new String[]{DEFAULT_CONTENT_TYPE};
- throw new BadPartitioningException();
- }
-
- /*
- * ------------------ line delimiter conversion
- * ---------------------------
- */
- public String[] getLegalLineDelimiters() {
- return getTracker().getLegalLineDelimiters();
- }
-
- /**
- * @see IDocument#getLength
- */
- public int getLength() {
- return getStore().getLength();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#getLineDelimiter()
- */
- public String getLineDelimiter() {
- return getDefaultLineDelimiter();
- }
-
- /**
- * Returns the line delimiter of that line
- *
- * @exception BadLocationException
- * If the line number is invalid in the document
- */
- public String getLineDelimiter(int line) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getLineDelimiter(line);
- }
-
- /**
- * Returns a description of the specified line. The line is described by
- * its offset and its length excluding the line's delimiter.
- *
- * @param line
- * the line of interest
- * @return a line description
- * @exception BadLocationException
- * if the line number is invalid in this document
- */
- public org.eclipse.jface.text.IRegion getLineInformation(int line) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getLineInformation(line);
- }
-
- /**
- * Returns a description of the line at the given offset. The description
- * contains the offset and the length of the line excluding the line's
- * delimiter.
- *
- * @param offset
- * the offset whose line should be described
- * @return a region describing the line
- * @exception BadLocationException
- * if offset is invalid in this document
- */
- public org.eclipse.jface.text.IRegion getLineInformationOfOffset(int offset) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getLineInformationOfOffset(offset);
- }
-
- /*
- * ---------------------- line information
- * --------------------------------
- */
- public int getLineLength(int line) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getLineLength(line);
- }
-
- /**
- * Determines the offset of the first character of the given line.
- *
- * @param line
- * the line of interest
- * @return the document offset
- * @exception BadLocationException
- * if the line number is invalid in this document
- */
- public int getLineOffset(int line) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getLineOffset(line);
- }
-
- public int getLineOfOffset(int offset) {
- int result = -1;
- try {
- result = getTracker().getLineNumberOfOffset(offset);
- }
- catch (BadLocationException e) {
- if (Logger.DEBUG_DOCUMENT)
- Logger.log(Logger.INFO, "Dev. Program Info Only: IStructuredDocument::getLineOfOffset: offset out of range, zero assumed. offset = " + offset, e); //$NON-NLS-1$ //$NON-NLS-2$
- result = 0;
- }
- return result;
- }
-
- /**
- * Returns the number of lines in this document
- *
- * @return the number of lines in this document
- */
- public int getNumberOfLines() {
- return getTracker().getNumberOfLines();
- }
-
- /**
- * Returns the number of lines which are occupied by a given text range.
- *
- * @param offset
- * the offset of the specified text range
- * @param length
- * the length of the specified text range
- * @return the number of lines occupied by the specified range
- * @exception BadLocationException
- * if specified range is invalid in this tracker
- */
- public int getNumberOfLines(int offset, int length) throws org.eclipse.jface.text.BadLocationException {
- return getTracker().getNumberOfLines(offset, length);
- }
-
- /**
- * This is public, temporarily, for use by tag lib classes.
- */
- public RegionParser getParser() {
- if (fParser == null) {
- throw new IllegalStateException("IStructuredDocument::getParser. Parser needs to be set before use"); //$NON-NLS-1$
- }
- return fParser;
- }
-
- /**
- * Returns the document partition in which the position is located. The
- * partition is specified as typed region.
- */
- public ITypedRegion getPartition(int offset) throws BadLocationException {
- ITypedRegion partition = null;
- try {
- partition = getPartition(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
- }
- catch (BadPartitioningException e) {
- throw new Error(e);
- }
- if (partition == null) {
- throw new Error();
- }
- return partition;
- }
-
-
- public ITypedRegion getPartition(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException {
- if ((0 > offset) || (offset > getLength()))
- throw new BadLocationException();
- ITypedRegion result = null;
-
- IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
- if (partitioner instanceof IDocumentPartitionerExtension2) {
- result = ((IDocumentPartitionerExtension2) partitioner).getPartition(offset, preferOpenPartitions);
- }
- else if (partitioner != null) {
- result = partitioner.getPartition(offset);
- }
- else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning)) {
- result = new TypedRegion(0, getLength(), DEFAULT_CONTENT_TYPE);
- }
- else
- throw new BadPartitioningException();
- return result;
- }
-
-
- public String[] getPartitionings() {
- if (fDocumentPartitioners == null)
- return new String[0];
- String[] partitionings = new String[fDocumentPartitioners.size()];
- fDocumentPartitioners.keySet().toArray(partitionings);
- return partitionings;
- }
-
- /**
- * Returns all position categories added to this document.
- */
- public String[] getPositionCategories() {
- return getPositionManager().getPositionCategories();
- }
-
- /**
- * @return Returns the positionManager.
- */
- private GenericPositionManager getPositionManager() {
- if (fPositionManager == null) {
- fPositionManager = new GenericPositionManager(this);
- }
- return fPositionManager;
- }
-
- /**
- * Returns all Positions of the given position category.
- *
- * @exception BadPositionCategoryException
- * If category is not defined for the document
- */
- public Position[] getPositions(String category) throws org.eclipse.jface.text.BadPositionCategoryException {
- return getPositionManager().getPositions(category);
- }
-
- /**
- * @see IDocument#getPositionUpdaters
- */
- public IPositionUpdater[] getPositionUpdaters() {
- return getPositionManager().getPositionUpdaters();
- }
-
- /**
- * This method can return null, which is the case if the offset is just
- * before or just after the existing text. Compare with
- * getNodeAtCharacterOffset.
- */
- public IStructuredDocumentRegion getRegionAtCharacterOffset(int offset) {
- IStructuredDocumentRegion result = null;
-
- // FIXME: need to synch on 'cachedRegion' (but since that's a
- // constantly changing object, we
- // can't, so need to add a "region_lock" object, and use it here, and
- // in re-parser.
- // Oh, and need to make sure, after synch, that the region is not
- // deleted, and if so, I guess go back
- // to the beginning!
-
- // cached node can be null when document is empty
- IStructuredDocumentRegion potentialCachedRegion = getCachedDocumentRegion();
- if (potentialCachedRegion != null) {
-
- //
-
- // if we already have the right node, return that.
- if (potentialCachedRegion.containsOffset(offset)) {
- result = potentialCachedRegion;
- }
- else {
- // first, find out what direction to go, relative to
- // cachedNode.
- // negative means "towards the front" of the file,
- // postitive
- // means
- // towards the end.
- int direction = offset - potentialCachedRegion.getStart();
- if (direction < 0) {
- // search towards beginning
- while (!potentialCachedRegion.containsOffset(offset)) {
- IStructuredDocumentRegion tempNode = potentialCachedRegion.getPrevious();
- if (tempNode == null) {
- break;
- }
- else {
- potentialCachedRegion = tempNode;
- }
- }
- }
- else {
- // search towards end
- // There is a legitamat condition where the
- // offset will not be contained in any node,
- // which is if the offset is just past the last
- // character of text.
- // And, we must gaurd against setting cachedNode to
- // null!
- while (!potentialCachedRegion.containsOffset(offset)) {
- IStructuredDocumentRegion tempNode = potentialCachedRegion.getNext();
- if (tempNode == null)
- break;
- else
- potentialCachedRegion = tempNode;
- }
- }
- }
- result = potentialCachedRegion;
- }
- // just to be doubly sure we never assign null to an already valid
- // cachedRegion.
- // I believe any time 'result' is null at this point, that just means
- // we have an
- // empty document, and the cachedRegion is already null, but we check
- // and print
- // warning, just so during development we be sure we never accidently
- // break this assumption.
- if (result != null)
- setCachedDocumentRegion(result);
- else if (getCachedDocumentRegion() != null) {
- throw new IllegalStateException("Program Error: no region could be found to cache, but cache was non null. Indicates corrupted model or region list"); //$NON-NLS-1$
- }
-
- return result;
- }
-
- public IStructuredDocumentRegionList getRegionList() {
- CoreNodeList result = null;
- if (getCachedDocumentRegion() == null)
- result = new CoreNodeList(null);
- else
- result = new CoreNodeList(getFirstStructuredDocumentRegion());
-
- return result;
- }
-
-
- public IStructuredDocumentRegion[] getStructuredDocumentRegions() {
- return getStructuredDocumentRegions(0, getLength());
- }
-
- /**
- * <p>
- * In the case of 0 length, the <code>IStructuredDocumentRegion</code>
- * at the character offset is returened. In other words, the region to the
- * right of the caret is returned. except for at the end of the document,
- * then the last region is returned.
- * </p>
- * <p>
- * Otherwise all the regions "inbetween" the indicated range are returned,
- * including the regions which overlap the region.
- * </p>
- *
- * <br>
- * eg.
- * <p>
- * <br>
- * eg.
- *
- * <pre>
- * &lt;html&gt;[&lt;head&gt;&lt;/head&gt;]&lt;/html&gt; returns &lt;head&gt;,&lt;/head&gt;
- * </pre>
- * <pre>
- * &lt;ht[ml&gt;&lt;head&gt;&lt;/he]ad&gt;&lt;/html&gt; returns &lt;html&gt;,&lt;head&gt;,&lt;/head&gt;
- * </pre>
- *
- * <pre>
- * &lt;html&gt;[&lt;head&gt;&lt;/head&gt;]&lt;/html&gt; returns &lt;head&gt;,&lt;/head&gt;
- * </pre>
- * <pre>
- * &lt;ht[ml&gt;&lt;head&gt;&lt;/he]ad&gt;&lt;/html&gt; returns &lt;html&gt;,&lt;head&gt;,&lt;/head&gt;
- * </pre>
- *
- * </p>
- */
- public IStructuredDocumentRegion[] getStructuredDocumentRegions(int start, int length) {
-
- if (length < 0)
- throw new IllegalArgumentException("can't have negative length"); //$NON-NLS-1$
-
- // this will make the right edge of the range point into the selection
- // eg. <html>[<head></head>]</html>
- // will return <head>,</head> instead of <head>,</head>,</html>
- if (length > 0)
- length--;
-
- List results = new ArrayList();
-
- // start thread safe block
- try {
- acquireLock();
-
- IStructuredDocumentRegion currentRegion = getRegionAtCharacterOffset(start);
- IStructuredDocumentRegion endRegion = getRegionAtCharacterOffset(start + length);
- while (currentRegion != endRegion && currentRegion != null) {
- results.add(currentRegion);
- currentRegion = currentRegion.getNext();
- }
- // need to add that last end region
- // can be null in the case of an empty document
- if (endRegion != null)
- results.add(endRegion);
- }
- finally {
- releaseLock();
- }
- // end thread safe block
-
- return (IStructuredDocumentRegion[]) results.toArray(new IStructuredDocumentRegion[results.size()]);
- }
-
- /**
- * was made public for easier testing. Normally should never be used by
- * client codes.
- */
- public IStructuredTextReParser getReParser() {
- if (fReParser == null) {
- fReParser = new StructuredDocumentReParser();
- fReParser.setStructuredDocument(this);
- }
- return fReParser;
- }
-
- private ITextStore getStore() {
- return fStore;
- }
-
- public String getText() {
- String result = get();
- return result;
- }
-
- /**
- * Returns the document's line tracker. Assumes that the document has been
- * initialized with a line tracker.
- *
- * @return the document's line tracker
- */
- private ILineTracker getTracker() {
- return fTracker;
- }
-
- public IStructuredTextUndoManager getUndoManager() {
- if (fUndoManager == null) {
- fUndoManager = new StructuredTextUndoManager();
- }
- return fUndoManager;
- }
-
- void initializeFirstAndLastDocumentRegion() {
- // cached Node must also be first, at the initial point. Only
- // valid
- // to call this method right after the first parse.
- //
- // when starting afresh, our cachedNode should be our firstNode,
- // so be sure to initialize the firstNode
- firstDocumentRegion = getCachedDocumentRegion();
- // be sure to use 'getNext' for this initial finding of the last
- // node,
- // since the implementation of node.getLastNode may simply call
- // structuredDocument.getLastStructuredDocumentRegion!
- IStructuredDocumentRegion aNode = firstDocumentRegion;
- if (aNode == null) {
- // defect 254607: to handle empty documents right, if
- // firstnode is
- // null, make sure last node is null too
- lastDocumentRegion = null;
- }
- else {
- while (aNode != null) {
- lastDocumentRegion = aNode;
- aNode = aNode.getNext();
- }
- }
- }
-
- /**
- * @see IDocument#insertPositionUpdater
- */
- public void insertPositionUpdater(IPositionUpdater updater, int index) {
- getPositionManager().insertPositionUpdater(updater, index);
- }
-
- private void internal_addPositionCategory(String category) {
- getPositionManager().addPositionCategory(category);
- }
-
- private void internal_addPositionUpdater(IPositionUpdater updater) {
- getPositionManager().addPositionUpdater(updater);
- }
-
- private void internal_setParser(RegionParser newParser) {
- fParser = newParser;
- }
-
- String internalGet(int offset, int length) {
- String result = null;
- // int myLength = getLength();
- // if ((0 > offset) || (0 > length) || (offset + length > myLength))
- // throw new BadLocationException();
- result = getStore().get(offset, length);
- return result;
- }
-
- /**
- * @param requester
- * @param start
- * @param replacementLength
- * @param changes
- * @param modificationStamp
- * @param ignoreReadOnlySettings
- * @return
- */
- private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
- StructuredDocumentEvent result = null;
-
- stopPostNotificationProcessing();
- if (changes == null)
- changes = ""; //$NON-NLS-1$
- //
- if (Debug.debugStructuredDocument)
- System.out.println(getClass().getName() + "::replaceText(" + start + "," + replacementLength + "," + changes + ")"); //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- if (Debug.perfTestStructuredDocumentOnly || Debug.perfTest || Debug.perfTestRawStructuredDocumentOnly) {
- startStreamTime = System.currentTimeMillis();
- }
- try {
- // Note: event must be computed before 'fire' method called
- fDocumentEvent = new DocumentEvent(this, start, replacementLength, changes);
- fireDocumentAboutToChanged();
-
- try {
- acquireLock();
-
- if (!ignoreReadOnlySettings && (containsReadOnly(start, replacementLength))) {
- NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
- noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
- result = noChangeEvent;
- }
- else {
- result = updateModel(requester, start, replacementLength, changes);
- }
- }
- finally {
- releaseLock();
- }
-
-
- if (Debug.perfTestRawStructuredDocumentOnly || Debug.perfTest) {
- long stopStreamTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t Time for IStructuredDocument raw replaceText: " + (stopStreamTime - startStreamTime)); //$NON-NLS-1$
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("event type returned by replaceTextWithNoDebuggingThread: " + result); //$NON-NLS-1$
- }
- }
- finally {
- // FUTURE_TO_DO: implement callback mechanism? to avoid instanceof
- // and casting
- // fireStructuredDocumentEvent must be called in order to end
- // documentAboutToBeChanged state
-
-
- // increment modification stamp if modifications were made
- if (result != null && !(result instanceof NoChangeEvent)) {
- fModificationStamp= modificationStamp;
- fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
- fDocumentEvent.fModificationStamp = fModificationStamp;
- }
-
- if (result == null) {
- // result should not be null, but if an exception was thrown,
- // it will be
- // so send a noChangeEvent and log the problem
- NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
- noChangeEvent.reason = NoChangeEvent.NO_EVENT;
- fireStructuredDocumentEvent(noChangeEvent);
- Logger.log(Logger.ERROR, "Program Error: invalid structured document event"); //$NON-NLS-1$
- }
- else {
- if (result instanceof RegionChangedEvent) {
- fireStructuredDocumentEvent((RegionChangedEvent) result);
- }
- else {
- if (result instanceof RegionsReplacedEvent) {
- fireStructuredDocumentEvent((RegionsReplacedEvent) result);
- }
- else {
- if (result instanceof StructuredDocumentRegionsReplacedEvent) {
- // probably more efficient to mark old regions as
- // 'deleted' at the time
- // that are determined to be deleted, but I'll do
- // here
- // in then central spot
- // for programming ease.
- updateDeletedFields((StructuredDocumentRegionsReplacedEvent) result);
- fireStructuredDocumentEvent((StructuredDocumentRegionsReplacedEvent) result);
- }
- else {
- if (result instanceof NoChangeEvent) {
- fireStructuredDocumentEvent((NoChangeEvent) result);
- }
- else {
- // if here, this means a new event was created
- // and not handled here
- // just send a no event until this issue is
- // resolved.
- NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
- noChangeEvent.reason = NoChangeEvent.NO_EVENT;
- fireStructuredDocumentEvent(noChangeEvent);
- Logger.log(Logger.INFO, "Program Error: unexpected structured document event: " + result); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- if (Debug.perfTest || Debug.perfTestStructuredDocumentOnly) {
- long stopStreamTime = System.currentTimeMillis();
- System.out.println("\n\t\t\t\t Total Time for IStructuredDocument event signaling/processing in replaceText: " + (stopStreamTime - startStreamTime)); //$NON-NLS-1$
- }
- resumePostNotificationProcessing();
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#length()
- */
- public int length() {
-
- return getLength();
- }
-
- public void makeReadOnly(int startOffset, int length) {
- makeReadOnly(startOffset, length, false, false);
- }
-
- public void makeReadOnly(int startOffset, int length, boolean canInsertBefore, boolean canInsertAfter) {
- // doesn't make sense to have a readonly region of 0 length,
- // so we'll ignore those requests
- if (length <= 0)
- return;
- String affectedText = this.get(startOffset, length);
- // a document event for "read only" change ... must
- // be followed by "no change" structuredDocument event
- // fDocumentEvent = new DocumentEvent(this, startOffset, length,
- // affectedText);
- fireReadOnlyAboutToBeChanged();
- // if (containsReadOnly(startOffset, length)) {
- // adjustReadOnlyRegions(startOffset, length);
- // } else {
- // we can blindly add category, since no harm done if already
- // exists.
- addPositionCategory(READ_ONLY_REGIONS_CATEGORY);
- Position newPosition = new ReadOnlyPosition(startOffset, length, canInsertBefore);
- try {
- addPosition(READ_ONLY_REGIONS_CATEGORY, newPosition);
- // FIXME: need to change API to pass in requester, so this event
- // can be
- // created correctly, instead of using null.
- NoChangeEvent noChangeEvent = new NoChangeEvent(this, null, affectedText, startOffset, length);
- noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
- fireReadOnlyStructuredDocumentEvent(noChangeEvent);
- }
- catch (BadLocationException e) {
- // for now, log and ignore. Perhaps later we
- // could adjust to handle some cases?
- Logger.logException(("could not create readonly region at " + startOffset + " to " + length), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (BadPositionCategoryException e) {
- // should never occur, since we add category
- Logger.logException(e);
- }
- }
-
- public IStructuredDocument newInstance() {
- IStructuredDocument newInstance = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser().newInstance());
- ((BasicStructuredDocument) newInstance).setReParser(getReParser().newInstance());
- if (getDocumentPartitioner() instanceof StructuredTextPartitioner) {
- newInstance.setDocumentPartitioner(((StructuredTextPartitioner) getDocumentPartitioner()).newInstance());
- newInstance.getDocumentPartitioner().connect(newInstance);
- }
- newInstance.setLineDelimiter(getLineDelimiter());
- if (getEncodingMemento() != null) {
- newInstance.setEncodingMemento((EncodingMemento) getEncodingMemento().clone());
- }
- return newInstance;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.text.IRegionComparible#regionMatches(int,
- * int, java.lang.String)
- */
- public boolean regionMatches(int offset, int length, String stringToCompare) {
- boolean result = false;
- ITextStore store = getStore();
- if (store instanceof IRegionComparible) {
- result = ((IRegionComparible) store).regionMatches(offset, length, stringToCompare);
- }
- else {
- result = get(offset, length).equals(stringToCompare);
- }
- return result;
- }
-
- public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
- boolean result = false;
- ITextStore store = getStore();
- if (store instanceof IRegionComparible) {
- result = ((IRegionComparible) store).regionMatchesIgnoreCase(offset, length, stringToCompare);
- }
- else {
- result = get(offset, length).equalsIgnoreCase(stringToCompare);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#registerPostNotificationReplace(org.eclipse.jface.text.IDocumentListener,
- * org.eclipse.jface.text.IDocumentExtension.IReplace)
- */
- public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) {
- if (fAcceptPostNotificationReplaces) {
- if (fPostNotificationChanges == null)
- fPostNotificationChanges = new ArrayList(1);
- fPostNotificationChanges.add(new RegisteredReplace(owner, replace));
- }
- }
-
- protected void releaseLock() {
- // do nothing here in super class
- }
-
- public void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
- synchronized (listenerLock) {
-
- if ((fStructuredDocumentAboutToChangeListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the request
- if (Utilities.contains(fStructuredDocumentAboutToChangeListeners, listener)) {
- int oldSize = fStructuredDocumentAboutToChangeListeners.length;
- int newSize = oldSize - 1;
- Object[] newListeners = new Object[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fStructuredDocumentAboutToChangeListeners[i] == listener) { // ignore
- }
- else {
- // copy old to new if its not the one we are
- // removing
- newListeners[index++] = fStructuredDocumentAboutToChangeListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the
- // old
- // one
- fStructuredDocumentAboutToChangeListeners = newListeners;
- }
- }
- }
- }
-
- /**
- * removeModelChangedListener method comment.
- */
- public void removeDocumentChangedListener(IStructuredDocumentListener listener) {
- synchronized (listenerLock) {
-
- if ((fStructuredDocumentChangedListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the request
- if (Utilities.contains(fStructuredDocumentChangedListeners, listener)) {
- int oldSize = fStructuredDocumentChangedListeners.length;
- int newSize = oldSize - 1;
- Object[] newListeners = new Object[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fStructuredDocumentChangedListeners[i] == listener) { // ignore
- }
- else {
- // copy old to new if its not the one we are
- // removing
- newListeners[index++] = fStructuredDocumentChangedListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the
- // old
- // one
- fStructuredDocumentChangedListeners = newListeners;
- }
- }
- }
- }
-
- public void removeDocumentChangingListener(IStructuredDocumentListener listener) {
- synchronized (listenerLock) {
-
- if ((fStructuredDocumentChangingListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the request
- if (Utilities.contains(fStructuredDocumentChangingListeners, listener)) {
- int oldSize = fStructuredDocumentChangingListeners.length;
- int newSize = oldSize - 1;
- Object[] newListeners = new Object[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fStructuredDocumentChangingListeners[i] == listener) { // ignore
- }
- else {
- // copy old to new if its not the one we are
- // removing
- newListeners[index++] = fStructuredDocumentChangingListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the
- // old
- // one
- fStructuredDocumentChangingListeners = newListeners;
- }
- }
- }
- }
-
- public void removeDocumentListener(IDocumentListener listener) {
- synchronized (listenerLock) {
-
- if ((fDocumentListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the request
- if (Utilities.contains(fDocumentListeners, listener)) {
- int oldSize = fDocumentListeners.length;
- int newSize = oldSize - 1;
- IDocumentListener[] newListeners = new IDocumentListener[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fDocumentListeners[i] == listener) { // ignore
- }
- else {
- // copy old to new if its not the one we are
- // removing
- newListeners[index++] = fDocumentListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the
- // old
- // one
- fDocumentListeners = newListeners;
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
- */
- public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
- synchronized (listenerLock) {
-
- Assert.isNotNull(listener);
- if (fDocumentPartitioningListeners != null)
- fDocumentPartitioningListeners.remove(listener);
- }
- }
-
- /**
- * Removes the given <code>Position</code> from the document's default
- * position category. The default position category is to be defined by
- * the implementers. If the position is not part of the document's default
- * category nothing happens.
- */
- public void removePosition(Position position) {
- getPositionManager().removePosition(position);
- }
-
- /**
- * @see IDocument#removePosition
- * @exception BadPositionCategoryException
- * If the category is not defined for the document
- */
- public void removePosition(String category, Position position) throws BadPositionCategoryException {
- getPositionManager().removePosition(category, position);
- }
-
- /**
- * @see IDocument#removePositionCategory
- * @exception BadPositionCategoryException
- * If the category is not defined for the document
- */
- public void removePositionCategory(String category) throws BadPositionCategoryException {
- getPositionManager().removePositionCategory(category);
- }
-
- /**
- * @see IDocument#removePositionUpdater
- */
- public void removePositionUpdater(IPositionUpdater updater) {
- getPositionManager().removePositionUpdater(updater);
- }
-
- /**
- * Removes the given document listener from teh document's list of
- * prenotified document listeners. If the listener is not registered with
- * the document nothing happens.
- * <p>
- *
- * This method is not for public use, it may only be called by
- * implementers of <code>IDocumentAdapter</code> and only if those
- * implementers need to implement <code>IDocumentListener</code>.
- *
- * @param documentAdapter
- * the listener to be removed
- *
- * @see #addPrenotifiedDocumentListener(IDocumentListener)
- */
- public void removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter) {
- synchronized (listenerLock) {
-
- if (Utilities.contains(fPrenotifiedDocumentListeners, documentAdapter)) {
- int previousSize = fPrenotifiedDocumentListeners.length;
- if (previousSize > 1) {
- IDocumentListener[] listeners = new IDocumentListener[previousSize - 1];
- int previousIndex = 0;
- int newIndex = 0;
- while (previousIndex < previousSize) {
- if (fPrenotifiedDocumentListeners[previousIndex] != documentAdapter)
- listeners[newIndex++] = fPrenotifiedDocumentListeners[previousIndex];
- previousIndex++;
- }
- fPrenotifiedDocumentListeners = listeners;
- }
- else {
- fPrenotifiedDocumentListeners = null;
- }
- }
- }
- }
-
- /**
- * This method is for INTERNAL USE ONLY and is NOT API.
- *
- * Rebuilds the StructuredDocumentRegion chain from the existing text.
- * FileBuffer support does not allow clients to know the document's
- * location before the text contents are set.
- *
- * @see set(String)
- */
- public void reparse(Object requester) {
- // check if we're already making document-wide changes on this thread
- if (fStoppedCount > 0)
- return;
-
- stopPostNotificationProcessing();
- clearReadOnly();
-
- try {
- acquireLock();
-
- CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) getStore(), 0, getStore().getLength());
- resetParser(subSetTextStoreReader, 0);
- //
- setCachedDocumentRegion(getParser().getDocumentRegions());
- // when starting afresh, our cachedNode should be our firstNode,
- // so be sure to initialize the firstNode and lastNode
- initializeFirstAndLastDocumentRegion();
- StructuredDocumentRegionIterator.setParentDocument(getCachedDocumentRegion(), this);
- }
- finally {
- releaseLock();
- }
-
- resumePostNotificationProcessing();
- }
-
- /**
- * @see IDocument#replace
- * @exception BadLocationException
- * If position is not a valid range in the document
- */
- public void replace(int offset, int length, String text) throws BadLocationException {
- if (Debug.displayWarnings) {
- System.out.println("Note: IStructuredDocument::replace(int, int, String) .... its better to use replaceText(source, string, int, int) API for structuredDocument updates"); //$NON-NLS-1$
- }
- replaceText(this, offset, length, text);
- }
-
- /**
- * Replace the text with "newText" starting at position "start" for a
- * length of "replaceLength".
- * <p>
- *
- * @param pos
- * start offset of text to replace None of the offsets include
- * delimiters of preceeding lines. Offset 0 is the first
- * character of the document.
- * @param length
- * start offset of text to replace
- * @param text
- * start offset of text to replace
- * <p>
- * Implementors have to notify TextChanged listeners after the
- * content has been updated. The TextChangedEvent should be set
- * as follows:
- *
- * event.type = SWT.TextReplaced event.start = start of the replaced text
- * event.numReplacedLines = number of replaced lines event.numNewLines =
- * number of new lines event.replacedLength = length of the replaced text
- * event.newLength = length of the new text
- *
- * NOTE: numNewLines is the number of inserted lines and numReplacedLines
- * is the number of deleted lines based on the change that occurs
- * visually. For example:
- *
- * replacedText newText numReplacedLines numNewLines "" "\n" 0 1 "\n\n"
- * "a" 2 0 "a" "\n\n" 0 2
- */
- /**
- * One of the APIs to manipulate the IStructuredDocument in terms of text.
- */
- public StructuredDocumentEvent replaceText(Object requester, int pos, int length, String text) {
- if (length == 0 && (text == null || text.length() == 0))
- return replaceText(requester, pos, length, text, getModificationStamp(), true);
- else
- return replaceText(requester, pos, length, text, getNextModificationStamp(), true);
- }
-
- public StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
- long modificationStamp;
-
- if (replacementLength == 0 && (changes == null || changes.length() == 0))
- modificationStamp = getModificationStamp();
- else
- modificationStamp = getNextModificationStamp();
-
- return replaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
- }
-
- private StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
- StructuredDocumentEvent event = internalReplaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
- return event;
- }
-
- void resetParser(int startOffset, int endOffset) {
-
- RegionParser parser = getParser();
- ITextStore textStore = getStore();
- if (textStore instanceof CharSequence) {
- CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) textStore, startOffset, endOffset - startOffset);
- parser.reset(subSetTextStoreReader, startOffset);
- }
- else {
- String newNodeText = get(startOffset, endOffset - startOffset);
- parser.reset(newNodeText, startOffset);
-
- }
-
- }
-
- void resetParser(Reader reader, int startOffset) {
- RegionParser parser = getParser();
- parser.reset(reader, startOffset);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#resumePostNotificationProcessing()
- */
- public void resumePostNotificationProcessing() {
- --fStoppedCount;
- if (fStoppedCount == 0 && fReentranceCount == 0)
- executePostNotificationChanges();
- }
-
- /**
- * @deprecated in superclass in 3.0 - use a FindReplaceDocumentAdapter
- * directly
- * @see IDocument#search
- */
- public int search(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException {
- // (dmw) I added this warning, to know if still being used. I'm not
- // sure it
- // works as expected any longer.
- // but the warning should be removed, once know.
- Logger.log(Logger.INFO, "WARNING: using unsupported deprecated method 'search'"); //$NON-NLS-1$
- int offset = -1;
- IRegion match = new FindReplaceDocumentAdapter(this).find(startPosition, findString, forwardSearch, caseSensitive, wholeWord, false);
- if (match != null) {
- offset = match.getOffset();
- }
- return offset;
- }
-
- /**
- * @see IDocument#setText
- */
- public void set(String string) {
- if (Debug.displayInfo) {
- System.out.println("Note: IStructuredDocument::setText(String) .... its better to use setText(source, string) API for structuredDocument updates"); //$NON-NLS-1$
- }
- setText(null, string);
- }
-
- /**
- * This may be marked public, but should be packaged protected, once
- * refactoring is complete (in other words, not for client use).
- */
- public void setCachedDocumentRegion(IStructuredDocumentRegion structuredRegion) {
- if (USE_LOCAL_THREAD) {
- fCurrentDocumentRegionCache.set(structuredRegion);
- }
- else {
- cachedDocumentRegion = structuredRegion;
- }
- }
-
- /**
- * Sets the document's partitioner.
- *
- * @see IDocumentPartitioner
- */
- public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
- setDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING, partitioner);
- }
-
-
- public void setDocumentPartitioner(String partitioning, IDocumentPartitioner partitioner) {
- if (partitioner == null) {
- if (fDocumentPartitioners != null) {
- fDocumentPartitioners.remove(partitioning);
- if (fDocumentPartitioners.size() == 0)
- fDocumentPartitioners = null;
- }
- }
- else {
- if (fDocumentPartitioners == null)
- fDocumentPartitioners = new HashMap();
- fDocumentPartitioners.put(partitioning, partitioner);
- }
- DocumentPartitioningChangedEvent event = new DocumentPartitioningChangedEvent(this);
- event.setPartitionChange(partitioning, 0, getLength());
- fireDocumentPartitioningChanged(event);
- }
-
- public void setEncodingMemento(EncodingMemento encodingMemento) {
- this.encodingMemento = encodingMemento;
- }
-
- void setFirstDocumentRegion(IStructuredDocumentRegion region) {
- firstDocumentRegion = region;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#setInitialLineDelimiter(java.lang.String)
- */
- public void setInitialLineDelimiter(String lineDelimiter) {
- // make sure our preferred delimiter is
- // one of the legal ones
- if (Utilities.containsString(getLegalLineDelimiters(), lineDelimiter)) {
- fInitialLineDelimiter= lineDelimiter;
- }
- else {
- if (Logger.DEBUG_DOCUMENT)
- Logger.log(Logger.INFO, "Attempt to set linedelimiter to non-legal delimiter"); //$NON-NLS-1$ //$NON-NLS-2$
- fInitialLineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] { new InstanceScope() });//$NON-NLS-1$
- }
- }
-
- void setLastDocumentRegion(IStructuredDocumentRegion region) {
- lastDocumentRegion = region;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#setLineDelimiter(java.lang.String)
- */
- public void setLineDelimiter(String delimiter) {
- setInitialLineDelimiter(delimiter);
- }
-
- /**
- * Sets the document's line tracker. Must be called at the beginning of
- * the constructor.
- *
- * @param tracker
- * the document's line tracker
- */
- private void setLineTracker(ILineTracker tracker) {
- Assert.isNotNull(tracker);
- fTracker = tracker;
- }
-
- public void setParser(RegionParser newParser) {
- internal_setParser(newParser);
- }
-
- /**
- * @param positionManager
- * The positionManager to set.
- */
- // TODO: make private is needed, else remove
- void setPositionManager(GenericPositionManager positionManager) {
- fPositionManager = positionManager;
- }
-
- /**
- *
- */
- public void setReParser(IStructuredTextReParser newReParser) {
- fReParser = newReParser;
- if (fReParser != null) {
- fReParser.setStructuredDocument(this);
- }
- }
-
- /**
- * One of the APIs to manipulate the IStructuredDocument in terms of text.
- */
- public StructuredDocumentEvent setText(Object requester, String theString) {
- StructuredDocumentEvent result = null;
- result = replaceText(requester, 0, getLength(), theString, getNextModificationStamp(), true);
- return result;
- }
-
- /**
- * Sets the document's text store. Must be called at the beginning of the
- * constructor.
- *
- * @param store
- * the document's text store
- */
- private void setTextStore(ITextStore store) {
- Assert.isNotNull(store);
- fStore = store;
- }
-
- public void setUndoManager(IStructuredTextUndoManager undoManager) {
-
- // if the undo manager has already been set, then
- // fail fast, since changing the undo manager will lead
- // to unusual results (or at least loss of undo stack).
- if (fUndoManager != null && fUndoManager != undoManager) {
- throw new IllegalArgumentException("can not change undo manager once its been set"); //$NON-NLS-1$
- }
- else {
- fUndoManager = undoManager;
- }
- }
-
-
- /*
- * {@inheritDoc}
- */
- public void startSequentialRewrite(boolean normalized) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#stopPostNotificationProcessing()
- */
- public void stopPostNotificationProcessing() {
- ++fStoppedCount;
- }
-
-
- /*
- * {@inheritDoc}
- */
- public void stopSequentialRewrite() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#subSequence(int, int)
- */
- public CharSequence subSequence(int arg0, int arg1) {
- return get(arg0, arg1);
- }
-
- /**
- * @param result
- */
- private void updateDeletedFields(StructuredDocumentRegionsReplacedEvent event) {
- IStructuredDocumentRegionList oldRegions = event.getOldStructuredDocumentRegions();
- for (int i = 0; i < oldRegions.getLength(); i++) {
- IStructuredDocumentRegion structuredDocumentRegion = oldRegions.item(i);
- structuredDocumentRegion.setDeleted(true);
- }
-
- }
-
- /**
- * Called by re-parser. Note: this method may be "public" but should only
- * be called by re-parsers in the right circumstances.
- */
- public void updateDocumentData(int start, int lengthToReplace, String changes) {
- stopPostNotificationProcessing();
- getStore().replace(start, lengthToReplace, changes);
- try {
- getTracker().replace(start, lengthToReplace, changes);
- }
-
- catch (BadLocationException e) {
- // should be impossible here, but will log for now
- Logger.logException(e);
- }
- if (fPositionManager != null) {
- fPositionManager.updatePositions(new DocumentEvent(this, start, lengthToReplace, changes));
- }
- fModificationStamp++;
- fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
- resumePostNotificationProcessing();
- }
-
- private StructuredDocumentEvent updateModel(Object requester, int start, int lengthToReplace, String changes) {
- StructuredDocumentEvent result = null;
- IStructuredTextReParser reParser = getReParser();
- // initialize the IStructuredTextReParser with the standard data
- // that's
- // always needed
- reParser.initialize(requester, start, lengthToReplace, changes);
- result = reParser.reparse();
- // if result is null at this point, then there must be an error, since
- // even if there
- // was no change (either disallow due to readonly, or a person pasted
- // the same thing
- // they had selected) then a "NoChange" event should have been fired.
- Assert.isNotNull(result, "no structuredDocument event was created in IStructuredDocument::updateStructuredDocument"); //$NON-NLS-1$
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument#getPreferredLineDelimiter()
- */
- public String getPreferredLineDelimiter() {
- return getDefaultLineDelimiter();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument#setPreferredLineDelimiter(java.lang.String)
- */
- public void setPreferredLineDelimiter(String probableLineDelimiter) {
- setInitialLineDelimiter(probableLineDelimiter);
-
- }
-
-
- /**
- * Class which implements the rewritable session for the SSE.
- *
- */
- static class StructuredDocumentRewriteSession extends DocumentRewriteSession {
-
- /**
- * Creates a new session.
- *
- * @param sessionType
- * the type of this session
- */
- protected StructuredDocumentRewriteSession(DocumentRewriteSessionType sessionType) {
- super(sessionType);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#startRewriteSession(org.eclipse.jface.text.DocumentRewriteSessionType)
- */
- public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) throws IllegalStateException {
- // delegate to sub-class, so UI threading is handled correctly
- return internalStartRewriteSession(sessionType);
- }
-
- /**
- * NOT-API. Final protected so clients may call this method if needed, but
- * cannot override.
- *
- * @param sessionType
- * @return
- * @throws IllegalStateException
- */
- final protected DocumentRewriteSession internalStartRewriteSession(DocumentRewriteSessionType sessionType) throws IllegalStateException {
- if (getActiveRewriteSession() != null)
- throw new IllegalStateException("already in a rewrite session");
-
- DocumentRewriteSession session = new StructuredDocumentRewriteSession(sessionType);
- DocumentRewriteSessionEvent event = new DocumentRewriteSessionEvent(this, session, DocumentRewriteSessionEvent.SESSION_START);
- fireDocumentRewriteSessionEvent(event);
-
- ILineTracker tracker = getTracker();
- if (tracker instanceof ILineTrackerExtension) {
- ILineTrackerExtension extension = (ILineTrackerExtension) tracker;
- extension.startRewriteSession(session);
- }
-
- startRewriteSessionOnPartitioners(session);
-
- if (DocumentRewriteSessionType.SEQUENTIAL == sessionType)
- startSequentialRewrite(false);
- else if (DocumentRewriteSessionType.STRICTLY_SEQUENTIAL == sessionType)
- startSequentialRewrite(true);
-
- fActiveRewriteSession = session;
- return session;
- }
-
- /**
- * Starts the given rewrite session.
- *
- * @param session the rewrite session
- * @since 2.0
- */
- final void startRewriteSessionOnPartitioners(DocumentRewriteSession session) {
- if (fDocumentPartitioners != null) {
- Iterator e= fDocumentPartitioners.values().iterator();
- while (e.hasNext()) {
- Object partitioner= e.next();
- if (partitioner instanceof IDocumentPartitionerExtension3) {
- IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner;
- extension.startRewriteSession(session);
- }
- }
- }
- }
-
-
- public void stopRewriteSession(DocumentRewriteSession session) {
- // delegate to sub-class, so UI threading is handled correctly
- internalStopRewriteSession(session);
- }
-
- /**
- * NOT-API. Final protected so clients may call this method if needed, but
- * cannot override.
- *
- * @param session
- */
- final protected void internalStopRewriteSession(DocumentRewriteSession session) {
- if (fActiveRewriteSession == session) {
- DocumentRewriteSessionType sessionType = session.getSessionType();
- if (DocumentRewriteSessionType.SEQUENTIAL == sessionType || DocumentRewriteSessionType.STRICTLY_SEQUENTIAL == sessionType)
- stopSequentialRewrite();
-
- stopRewriteSessionOnPartitioners(session);
-
- ILineTracker tracker = getTracker();
- if (tracker instanceof ILineTrackerExtension) {
- ILineTrackerExtension extension = (ILineTrackerExtension) tracker;
- extension.stopRewriteSession(session, get());
- }
-
- fActiveRewriteSession = null;
- DocumentRewriteSessionEvent event = new DocumentRewriteSessionEvent(this, session, DocumentRewriteSessionEvent.SESSION_STOP);
- fireDocumentRewriteSessionEvent(event);
- }
- }
-
- /**
- * Stops the given rewrite session.
- *
- * @param session the rewrite session
- * @since 2.0
- */
- final void stopRewriteSessionOnPartitioners(DocumentRewriteSession session) {
- if (fDocumentPartitioners != null) {
- DocumentPartitioningChangedEvent event= new DocumentPartitioningChangedEvent(this);
- Iterator e= fDocumentPartitioners.keySet().iterator();
- while (e.hasNext()) {
- String partitioning= (String) e.next();
- IDocumentPartitioner partitioner= (IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
- if (partitioner instanceof IDocumentPartitionerExtension3) {
- IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner;
- extension.stopRewriteSession(session);
- event.setPartitionChange(partitioning, 0, getLength());
- }
- }
- if (!event.isEmpty())
- fireDocumentPartitioningChanged(event);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#getActiveRewriteSession()
- */
- public DocumentRewriteSession getActiveRewriteSession() {
- return fActiveRewriteSession;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#addDocumentRewriteSessionListener(org.eclipse.jface.text.IDocumentRewriteSessionListener)
- */
- public void addDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener) {
- synchronized (listenerLock) {
- Assert.isNotNull(listener);
- if (fDocumentRewriteSessionListeners == null) {
- fDocumentRewriteSessionListeners = new ArrayList(1);
- }
- if (!fDocumentRewriteSessionListeners.contains(listener))
- fDocumentRewriteSessionListeners.add(listener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#removeDocumentRewriteSessionListener(org.eclipse.jface.text.IDocumentRewriteSessionListener)
- */
- public void removeDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener) {
- synchronized (listenerLock) {
-
- Assert.isNotNull(listener);
- if (fDocumentRewriteSessionListeners != null)
- fDocumentRewriteSessionListeners.remove(listener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#replace(int, int,
- * java.lang.String, long)
- */
- public void replace(int offset, int length, String text, long modificationStamp) throws BadLocationException {
- replaceText(this, offset, length, text, modificationStamp, true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#set(java.lang.String,
- * long)
- */
- public void set(String text, long modificationStamp) {
- // bug 151069 - overwrite read only regions when setting entire document
- replaceText(null, 0, getLength(), text, modificationStamp, true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension4#getModificationStamp()
- */
- public long getModificationStamp() {
- return fModificationStamp;
- }
-
- private long getNextModificationStamp() {
- if (fNextModificationStamp == Long.MAX_VALUE || fNextModificationStamp == IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP)
- fNextModificationStamp= 0;
- else
- fNextModificationStamp= fNextModificationStamp + 1;
-
- return fNextModificationStamp;
- }
-
- /**
- * Fires an event, as specified, to the associated listeners.
- *
- * @param event
- * The event to fire, either a start or stop event.
- */
- private void fireDocumentRewriteSessionEvent(final DocumentRewriteSessionEvent event) {
- if (fDocumentRewriteSessionListeners == null || fDocumentRewriteSessionListeners.size() == 0)
- return;
-
- Object[] listeners = fDocumentRewriteSessionListeners.toArray();
- for (int i = 0; i < listeners.length; i++) {
- final IDocumentRewriteSessionListener l = (IDocumentRewriteSessionListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- l.documentRewriteSessionChanged(event);
- }
- public void handleException(Throwable exception) {
- // logged for us
- }
- });
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
deleted file mode 100644
index 7fba9b36ba..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
+++ /dev/null
@@ -1,622 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300430 - String concatenation
- * David Carver (Intalio) - bug 300427 - Comparison of String Objects == or !=
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public class BasicStructuredDocumentRegion implements IStructuredDocumentRegion {
- private static final String TEXT_STORE_NOT_ASSIGNED = "text store not assigned yet"; //$NON-NLS-1$
- private static final String UNDEFINED = "org.eclipse.wst.sse.core.structuredDocument.UNDEFINED"; //$NON-NLS-1$
-
- private ITextRegionList _regions;
- /**
- * has this region been removed from its document
- */
- private static final byte MASK_IS_DELETED = 1;
- /**
- * was this region terminated normally
- */
- private static final byte MASK_IS_ENDED = 1 << 1;
-
- private byte fIsDeletedOrEnded = 0;
-
- /**
- * allow a pointer back to this nodes model
- */
- private IStructuredDocument fParentDocument;
-
- protected int fLength;
- private IStructuredDocumentRegion next = null;
- private IStructuredDocumentRegion previous = null;
- protected int start;
-
- public BasicStructuredDocumentRegion() {
- super();
- _regions = new TextRegionListImpl();
-
- }
-
- /**
- * Even inside-this class uses of 'regions' should use this method, as
- * this is where (soft) memory management/reparsing, etc., will be
- * centralized.
- */
- private ITextRegionList _getRegions() {
-
- return _regions;
- }
-
- public void addRegion(ITextRegion aRegion) {
- _getRegions().add(aRegion);
- }
-
- public void adjust(int i) {
- start += i;
- }
-
- public void adjustLength(int i) {
- fLength += i;
- }
-
- public void adjustStart(int i) {
- start += i;
- }
-
- public void adjustTextLength(int i) {
- // not supported
-
- }
-
- public boolean containsOffset(int i) {
-
- return getStartOffset() <= i && i < getEndOffset();
- }
-
- public boolean containsOffset(ITextRegion containedRegion, int offset) {
- return getStartOffset(containedRegion) <= offset && offset < getEndOffset(containedRegion);
- }
-
- public void equatePositions(ITextRegion region) {
- start = region.getStart();
- fLength = region.getLength();
- }
-
- /**
- * getEnd and getEndOffset are the same only for
- * IStructuredDocumentRegions
- */
- public int getEnd() {
- return start + fLength;
- }
-
- /**
- * getEnd and getEndOffset are the same only for
- * IStructuredDocumentRegions
- */
- public int getEndOffset() {
- return getEnd();
- }
-
- public int getEndOffset(ITextRegion containedRegion) {
- return getStartOffset(containedRegion) + containedRegion.getLength();
- }
-
- public ITextRegion getFirstRegion() {
- if (_getRegions() == null)
- return null;
- return _getRegions().get(0);
- }
-
- public String getFullText() {
- String result = ""; //$NON-NLS-1$
- try {
- result = getParentDocument().get(start, fLength);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- return result;
- }
-
- public String getFullText(ITextRegion aRegion) {
- String result = ""; //$NON-NLS-1$
- try {
- int regionStart = aRegion.getStart();
- int regionLength = aRegion.getLength();
- result = fParentDocument.get(start + regionStart, regionLength);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- return result;
- }
-
- public String getFullText(String context) {
- // DMW: looping is faster than enumeration,
- // so switched around 2/12/03
- // Enumeration e = getRegions().elements();
- ITextRegion region = null;
- String result = ""; //$NON-NLS-1$
- int length = getRegions().size();
- StringBuffer sb = new StringBuffer(result);
- for (int i = 0; i < length; i++) {
- region = getRegions().get(i);
- if (region.getType().equals(context))
- sb.append(getFullText(region));
- }
- result = sb.toString();
- return result;
- }
-
- public ITextRegion getLastRegion() {
- if (_getRegions() == null)
- return null;
- return _getRegions().get(_getRegions().size() - 1);
- }
-
- public int getLength() {
- return fLength;
- }
-
- public IStructuredDocumentRegion getNext() {
- return next;
- }
-
- public int getNumberOfRegions() {
- return _getRegions().size();
- }
-
- public IStructuredDocument getParentDocument() {
-
- return fParentDocument;
- }
-
- public IStructuredDocumentRegion getPrevious() {
- return previous;
- }
-
- /**
- * The parameter offset refers to the overall offset in the document.
- */
- public ITextRegion getRegionAtCharacterOffset(int offset) {
- if (_getRegions() != null) {
- int thisStartOffset = getStartOffset();
- if (offset < thisStartOffset)
- return null;
- int thisEndOffset = getStartOffset() + getLength();
- if (offset > thisEndOffset)
- return null;
- // transform the requested offset to the "scale" that
- // regions are stored in, which are all relative to the
- // start point.
- // int transformedOffset = offset - getStartOffset();
- //
- ITextRegionList regions = getRegions();
- int length = regions.size();
- int low = 0;
- int high = length;
- int mid = 0;
- // Binary search for the region
- while (low < high) {
- mid = low + ((high - low) >> 1);
- ITextRegion region = regions.get(mid);
- if (Debug.debugStructuredDocument) {
- System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
- System.out.println(" requested offset: " + offset); //$NON-NLS-1$
- // System.out.println(" transformedOffset: " +
- // transformedOffset); //$NON-NLS-1$
- System.out.println(" region start: " + region.getStart()); //$NON-NLS-1$
- System.out.println(" region end: " + region.getEnd()); //$NON-NLS-1$
- System.out.println(" region type: " + region.getType()); //$NON-NLS-1$
- System.out.println(" region class: " + region.getClass()); //$NON-NLS-1$
-
- }
- // Region is before this one
- if (offset < region.getStart() + thisStartOffset)
- high = mid;
- else if (offset > (region.getEnd() + thisStartOffset - 1))
- low = mid + 1;
- else
- return region;
- }
- }
- return null;
- }
-
- public ITextRegionList getRegions() {
- return _getRegions();
- }
-
- /**
- * getStart and getStartOffset are the same only for
- * IStrucutredDocumentRegions
- */
- public int getStart() {
- return start;
- }
-
- /**
- * getStart and getStartOffset are the same only for
- * IStrucutredDocumentRegions
- */
- public int getStartOffset() {
- return getStart();
- }
-
- public int getStartOffset(ITextRegion containedRegion) {
- // assert: containedRegion can not be null
- // (might be performance hit if literally put in assert call,
- // but containedRegion can not be null). Needs to be checked
- // by calling code.
- return getStartOffset() + containedRegion.getStart();
- }
-
- public String getText() {
- String result = null;
- try {
- if (fParentDocument == null) {
- // likely to happen during inspecting
- result = TEXT_STORE_NOT_ASSIGNED;
- }
- else {
- result = fParentDocument.get(start, fLength);
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- return result;
- }
-
- public String getText(ITextRegion aRegion) {
- // assert: aRegion can not be null
- // (might be performance hit if literally put in assert call,
- // but aRegion can not be null). Needs to be checked
- // by calling code.
- try {
- return fParentDocument.get(this.getStartOffset(aRegion), aRegion.getTextLength());
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the text of the first region with the matching context type
- */
- public String getText(String context) {
- // DMW: looping is faster than enumeration,
- // so switched around 2/12/03
- // Enumeration e = getRegions().elements();
- ITextRegion region = null;
- String result = ""; //$NON-NLS-1$
- int length = getRegions().size();
- for (int i = 0; i < length; i++) {
- region = getRegions().get(i);
- if (region.getType().equals(context)) {
- result = getText(region);
- break;
- }
- }
- return result;
- }
-
- public int getTextEnd() {
- return start + fLength;
- }
-
- /**
- * @return int
- */
- public int getTextEndOffset() {
- ITextRegion region = _getRegions().get(_getRegions().size() - 1);
- return getStartOffset() + region.getTextEnd();
- }
-
- public int getTextEndOffset(ITextRegion containedRegion) {
- return getStartOffset(containedRegion) + containedRegion.getTextLength();
- }
-
- public int getTextLength() {
- return fLength;
- }
-
- /**
- * Provides the type of IStructuredDocumentRegion ... not to be confused
- * with type of XML node! This is subclassed, if something other than type
- * of first region is desired.
- *
- */
- public String getType() {
- String result = UNDEFINED;
- ITextRegionList subregions = getRegions();
- if (subregions != null && subregions.size() > 0) {
- ITextRegion firstRegion = subregions.get(0);
- if (firstRegion != null) {
- result = firstRegion.getType();
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#isDeleted()
- */
- public boolean isDeleted() {
- return (fIsDeletedOrEnded & MASK_IS_DELETED) != 0 || (fParentDocument == null);
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isEnded() {
- return (fIsDeletedOrEnded & MASK_IS_ENDED) != 0;
- }
-
- public boolean sameAs(IStructuredDocumentRegion region, int shift) {
- boolean result = false;
- // if region == null, we return false;
- if (region != null) {
- // if the regions are the same instance, they are equal
- if (this == region) {
- result = true;
- }
- else {
- // this is the non-trivial part
- // note: we change for type first, then start offset and end
- // offset,
- // since that would decide many cases right away and avoid the
- // text comparison
- if (getType().equals(region.getType())) {
- if (sameOffsetsAs(region, shift) && sameTextAs(region, shift)) {
- result = true;
- }
- }
-
- }
- }
- return result;
- }
-
- public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion newDocumentRegion, ITextRegion newRegion, int shift) {
- boolean result = false;
- // if any region is null, we return false (even if both are!)
- if ((oldRegion != null) && (newRegion != null)) {
- // if the regions are the same instance, they are equal
- if (oldRegion == newRegion) {
- result = true;
- }
- else {
- // this is the non-trivial part
- // note: we change for type first, then start offset and end
- // offset,
- // since that would decide many cases right away and avoid the
- // text comparison
- if (oldRegion.getType().equals(newRegion.getType())) {
- if (sameOffsetsAs(oldRegion, newDocumentRegion, newRegion, shift)) {
- if (sameTextAs(oldRegion, newDocumentRegion, newRegion, shift)) {
- result = true;
- }
- }
- }
- }
-
- }
-
- return result;
- }
-
- private boolean sameOffsetsAs(IStructuredDocumentRegion region, int shift) {
- if (getStartOffset() == region.getStartOffset() - shift) {
- if (getEndOffset() == region.getEndOffset() - shift) {
- return true;
- }
- }
- return false;
- }
-
- private boolean sameOffsetsAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
- if (getStartOffset(oldRegion) == documentRegion.getStartOffset(newRegion) - shift) {
- if (getEndOffset(oldRegion) == documentRegion.getEndOffset(newRegion) - shift) {
- return true;
- }
- }
- return false;
- }
-
- private boolean sameTextAs(IStructuredDocumentRegion region, int shift) {
- boolean result = false;
- try {
- if (getText().equals(region.getText())) {
- result = true;
- }
- }
- // ISSUE: we should not need this
- catch (StringIndexOutOfBoundsException e) {
- result = false;
- }
-
- return result;
- }
-
- private boolean sameTextAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
- boolean result = false;
-
- if (getText(oldRegion).equals(documentRegion.getText(newRegion))) {
- result = true;
- }
-
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#setDelete(boolean)
- */
- public void setDeleted(boolean isDeleted) {
- if (isDeleted)
- fIsDeletedOrEnded |= MASK_IS_DELETED;
- else
- fIsDeletedOrEnded &= ~MASK_IS_DELETED;
- }
-
- /**
- *
- * @param newHasEnd
- * boolean
- */
- public void setEnded(boolean newHasEnd) {
- if (newHasEnd)
- fIsDeletedOrEnded |= MASK_IS_ENDED;
- else
- fIsDeletedOrEnded &= ~MASK_IS_ENDED;
- }
-
- public void setLength(int newLength) {
- // textLength = newLength;
- fLength = newLength;
- }
-
- public void setNext(IStructuredDocumentRegion newNext) {
- next = newNext;
- }
-
- public void setParentDocument(IStructuredDocument document) {
- fParentDocument = document;
-
- }
-
- public void setPrevious(IStructuredDocumentRegion newPrevious) {
- previous = newPrevious;
- }
-
- public void setRegions(ITextRegionList containedRegions) {
- _regions = containedRegions;
- }
-
- public void setStart(int newStart) {
- start = newStart;
- }
-
- public String toString() {
- // NOTE: if the document held by any region has been updated and the
- // region offsets have not
- // yet been updated, the output from this method invalid.
- // Also note, this method can not be changed, without "breaking"
- // unit tests, since some of them compare current results to previous
- // results.
- String result = null;
- result = "[" + getStart() + ", " + getEnd() + "] (" + getText() + ")"; //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- return result;
- }
-
- private void updateDownStreamRegions(ITextRegion changedRegion, int lengthDifference) {
- int listLength = _getRegions().size();
- int startIndex = 0;
- // first, loop through to find index of where to start
- for (int i = 0; i < listLength; i++) {
- ITextRegion region = _getRegions().get(i);
- if (region == changedRegion) {
- startIndex = i;
- break;
- }
- }
- // now, beginning one past the one that was changed, loop
- // through to end of list, adjusting the start postions.
- startIndex++;
- for (int j = startIndex; j < listLength; j++) {
- ITextRegion region = _getRegions().get(j);
- region.adjustStart(lengthDifference);
- }
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion structuredDocumentRegion, String changes, int requestStart, int lengthToReplace) {
- StructuredDocumentEvent result = null;
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Get the region pointed to by the requestStart postion, and give
- // that region a chance to effect
- // the update.
- ITextRegion region = getRegionAtCharacterOffset(requestStart);
- // if there is no region, then the requested changes must come right
- // after the
- // node (and right after the last region). This happens, for example,
- // when someone
- // types something at the end of the document, or more commonly, when
- // they are right
- // at the beginning of one node, and the dirty start is therefore
- // calculated to be the
- // previous node.
- // So, in this case, we'll give the last region a chance to see if it
- // wants to
- // swallow the requested changes -- but only for inserts -- deletes
- // and "replaces"
- // should be reparsed if they are in these border regions, and only if
- // the
- if ((region == null) && (lengthToReplace == 0)) {
- region = _getRegions().get(_getRegions().size() - 1);
- // make sure the region is contiguous
- if (getEndOffset(region) == requestStart) {
- result = region.updateRegion(requester, this, changes, requestStart, lengthToReplace);
- }
- }
- else {
- if (region != null) {
- //
- // If the requested change spans more than one region, then
- // we don't give the region a chance to update.
- if ((containsOffset(region, requestStart)) && (containsOffset(region, requestStart + lengthToReplace))) {
- result = region.updateRegion(requester, this, changes, requestStart, lengthToReplace);
- }
- }
- }
- // if result is not null, then we need to update the start and end
- // postions of the regions that follow this one
- // if result is null, then apply the flatnode specific checks on what
- // it can change
- // (i.e. more than one region, but no change to the node itself)
- if (result != null) {
- // That is, a region decided it could handle the change and
- // created
- // a region changed event.
- Assert.isTrue(result instanceof RegionChangedEvent, "Program Error"); //$NON-NLS-1$
- updateDownStreamRegions(((RegionChangedEvent) result).getRegion(), lengthDifference);
- // PLUS, we need to update our own node end point (length)
- setLength(getLength() + lengthDifference);
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java
deleted file mode 100644
index 6ab29b5549..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import java.io.IOException;
-import java.io.Reader;
-
-public class CharSequenceReader extends Reader {
- private int fCurrentPosition;
- private int fMaximumReadOffset;
-
- private CharSequence fOriginalSource;
-
- /**
- *
- */
- CharSequenceReader() {
- super();
- }
-
-
- public CharSequenceReader(CharSequence originalSource, int offset, int length) {
- // ISSUE: should we "fail fast" if requested length is more than there
- // is?
- fOriginalSource = originalSource;
- int startOffset = offset;
- int maxRequestedOffset = startOffset + length;
- int maxPossibleOffset = 0 + originalSource.length();
- fMaximumReadOffset = Math.min(maxRequestedOffset, maxPossibleOffset);
-
- fCurrentPosition = startOffset;
-
- }
-
- /**
- * @param lockObject
- */
- CharSequenceReader(Object lockObject) {
- super(lockObject);
- // for thread safety, may need to add back locking mechanism
- // in our custom constructor. This constructor left here just
- // for a reminder.
- }
-
- public void close() throws IOException {
- // nothing to do when we close
- // (may be to eventually "unlock" or null out some varibles
- // just for hygene.
- // or, perhaps if already closed once throw IOException? for
- // consistency?
- }
-
- /**
- * @return Returns the originalSource.
- * @deprecated - only temporarily public, should be 'default' eventually
- * or go away altogether.
- */
- public CharSequence getOriginalSource() {
- return fOriginalSource;
- }
-
- public int read() {
- int result = -1;
- if (fCurrentPosition < fMaximumReadOffset) {
- result = fOriginalSource.charAt(fCurrentPosition++);
- }
- return result;
- }
-
- /**
- * Read characters into a portion of an array. This method will block
- * until some input is available, an I/O error occurs, or the end of the
- * stream is reached.
- *
- * @param cbuf
- * Destination buffer
- * @param off
- * Offset at which to start storing characters
- * @param len
- * Maximum number of characters to read
- *
- * @return The number of characters read, or -1 if the end of the stream
- * has been reached
- *
- * @exception IOException
- * If an I/O error occurs
- */
-
- public int read(char[] cbuf, int off, int len) throws IOException {
- int charsToRead = -1;
- // if already over max, just return -1
- // remember, currentPosition is what is getting ready to be read
- // (that is, its already been incremented in read()).
- if (fCurrentPosition < fMaximumReadOffset) {
-
-
- int buffMaxToRead = cbuf.length - off;
- int minRequested = Math.min(buffMaxToRead, len);
- int lengthRemaining = fMaximumReadOffset - fCurrentPosition;
- charsToRead = Math.min(minRequested, lengthRemaining);
-
-
- CharSequence seq = fOriginalSource.subSequence(fCurrentPosition, fCurrentPosition + charsToRead);
- // for now, hard assumption that original is a String since source
- // is assumed to be document, or text store
- String seqString = (String) seq;
- seqString.getChars(0, seqString.length(), cbuf, off);
-
-
-
- fCurrentPosition = fCurrentPosition + charsToRead;
-
-
- }
- return charsToRead;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java
deleted file mode 100644
index 6acd927143..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java
+++ /dev/null
@@ -1,130 +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.sse.core.internal.text;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-
-public class CoreNodeList implements IStructuredDocumentRegionList {
- int countedLength;
- int currentIndex = -1;
-
- IStructuredDocumentRegion[] flatNodes;
- IStructuredDocumentRegion head;
-
- /**
- * CoreNodeList constructor comment.
- */
- public CoreNodeList() {
- super();
- // create an array, even if zero length
- flatNodes = new IStructuredDocumentRegion[0];
- }
-
- public CoreNodeList(IStructuredDocumentRegion newHead) {
- super();
- // save head
- head = newHead;
- int count = 0;
- IStructuredDocumentRegion countNode = newHead;
- // we have to go through the list once, to get its
- // length in order to create the array
- while (countNode != null) {
- count++;
- countNode = countNode.getNext();
- }
- // create an array, even if zero length
- flatNodes = new IStructuredDocumentRegion[count];
- // start countNode over again, so to speak.
- countNode = newHead;
- count = 0;
- while (countNode != null) {
- flatNodes[count++] = countNode;
- countNode = countNode.getNext();
- }
- if (count > 0) {
- currentIndex = 0;
- // else it stays at -1 initialized at object creation
- //
- // save length
- countedLength = count;
- }
- }
-
- public CoreNodeList(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
- super();
- // save head
- head = start;
- int count = 0;
- IStructuredDocumentRegion countNode = start;
- if ((start == null) || (end == null)) {
- // error condition
- //throw new IllegalArgumentException("Must provide start and end
- // nodes to construct CoreNodeList");
- } else {
- count = 1;
- while ((countNode != null) && (countNode != end)) {
- count++;
- countNode = countNode.getNext();
- }
- }
- // if we ended because the last one was null,
- // backup one.
- if (countNode == null)
- count--;
- if (count < 0) {
- count = 0;
- }
- flatNodes = new IStructuredDocumentRegion[count];
- if (count > 0) {
- flatNodes[0] = countNode = start;
- for (int i = 1; i < count; i++) {
- flatNodes[i] = flatNodes[i - 1].getNext();
- }
-
- }
- currentIndex = 0;
- countedLength = count;
- }
-
- public Enumeration elements() {
- StructuredDocumentRegionEnumeration result = null;
- if ((flatNodes != null) && (flatNodes.length > 0))
- result = new StructuredDocumentRegionEnumeration(flatNodes[0], flatNodes[flatNodes.length - 1]);
- else
- result = new StructuredDocumentRegionEnumeration(null);
- return result;
- }
-
- public int getLength() {
- return flatNodes.length;
- }
-
- public boolean includes(Object o) {
- if (flatNodes == null)
- return false;
- for (int i = 0; i < flatNodes.length; i++)
- if (flatNodes[i] == o)
- return true;
- return false;
- }
-
- public IStructuredDocumentRegion item(int i) {
- return flatNodes[i];
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java
deleted file mode 100644
index e33783e542..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.text;
-
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-
-/**
- * Follows the behavior of DefaultPositionUpdater except in addition to
- * deleting/overwriting text which completely contains the position deletes
- * the position, deleting text that equals the text in position also deletes
- * the position.
- *
- * @see org.eclipse.jface.text.DefaultPositionUpdater
- */
-public class DeleteEqualPositionUpdater extends DefaultPositionUpdater {
-
- /**
- * @param category
- */
- public DeleteEqualPositionUpdater(String category) {
- super(category);
- }
-
- /**
- * Determines whether the currently investigated position has been deleted
- * by the replace operation specified in the current event. If so, it
- * deletes the position and removes it from the document's position
- * category.
- *
- * NOTE: position is deleted if current event completely overwrites
- * position OR if current event deletes the area surrounding/including the
- * position
- *
- * @return <code>true</code> if position has been deleted
- */
- protected boolean notDeleted() {
- // position is deleted if current event completely overwrites position
- // OR if
- // current event deletes the area surrounding/including the position
- if ((fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) || (fOffset <= fPosition.offset && (fPosition.offset + fPosition.length <= fOffset + fLength) && fReplaceLength == 0)) {
-
- fPosition.delete();
-
- try {
- fDocument.removePosition(getCategory(), fPosition);
- } catch (BadPositionCategoryException x) {
- }
-
- return false;
- }
-
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java
deleted file mode 100644
index 0a422a3835..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java
+++ /dev/null
@@ -1,409 +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.wst.sse.core.internal.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-/**
- * Based on the Position management methods from
- * org.eclipse.jface.text.AbstractDocument
- */
-
-public class GenericPositionManager {
- private CharSequence fCharSequence;
-
-
-
- private Map fPositions;
- /** All registered document position updaters */
- private List fPositionUpdaters;
-
- /**
- * don't allow instantiation with out document pointer
- *
- */
- private GenericPositionManager() {
- super();
- }
-
- /**
- *
- */
- public GenericPositionManager(CharSequence charSequence) {
- this();
- // we only use charSequence for "length", to
- // made more generic than "document" even "text store"
- fCharSequence = charSequence;
- completeInitialization();
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
- */
- public void addPosition(Position position) throws BadLocationException {
- try {
- addPosition(IDocument.DEFAULT_CATEGORY, position);
- }
- catch (BadPositionCategoryException e) {
- }
- }
-
-
-
- /*
- * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String,
- * org.eclipse.jface.text.Position)
- */
- public synchronized void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
-
- if ((0 > position.offset) || (0 > position.length) || (position.offset + position.length > getDocumentLength()))
- throw new BadLocationException();
-
- if (category == null)
- throw new BadPositionCategoryException();
-
- List list = (List) fPositions.get(category);
- if (list == null)
- throw new BadPositionCategoryException();
-
- list.add(computeIndexInPositionList(list, position.offset), position);
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
- */
- public void addPositionCategory(String category) {
-
- if (category == null)
- return;
-
- if (!containsPositionCategory(category))
- fPositions.put(category, new ArrayList());
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
- */
- public void addPositionUpdater(IPositionUpdater updater) {
- insertPositionUpdater(updater, fPositionUpdaters.size());
- }
-
-
- /**
- * Initializes document listeners, positions, and position updaters. Must
- * be called inside the constructor after the implementation plug-ins have
- * been set.
- */
- protected void completeInitialization() {
-
- fPositions = new HashMap();
- fPositionUpdaters = new ArrayList();
-
- addPositionCategory(IDocument.DEFAULT_CATEGORY);
- addPositionUpdater(new DefaultPositionUpdater(IDocument.DEFAULT_CATEGORY));
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String,
- * int)
- */
- public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException {
-
- if (0 > offset || offset > getDocumentLength())
- throw new BadLocationException();
-
- List c = (List) fPositions.get(category);
- if (c == null)
- throw new BadPositionCategoryException();
-
- return computeIndexInPositionList(c, offset);
- }
-
-
- /**
- * Computes the index in the list of positions at which a position with
- * the given offset would be inserted. The position is supposed to become
- * the first in this list of all positions with the same offset.
- *
- * @param positions
- * the list in which the index is computed
- * @param offset
- * the offset for which the index is computed
- * @return the computed index
- *
- * @see IDocument#computeIndexInCategory(String, int)
- */
- protected synchronized int computeIndexInPositionList(List positions, int offset) {
-
- if (positions.size() == 0)
- return 0;
-
- int left = 0;
- int right = positions.size() - 1;
- int mid = 0;
- Position p = null;
-
- while (left < right) {
-
- mid = (left + right) / 2;
-
- p = (Position) positions.get(mid);
- if (offset < p.getOffset()) {
- if (left == mid)
- right = left;
- else
- right = mid - 1;
- }
- else if (offset > p.getOffset()) {
- if (right == mid)
- left = right;
- else
- left = mid + 1;
- }
- else if (offset == p.getOffset()) {
- left = right = mid;
- }
-
- }
-
- int pos = left;
- p = (Position) positions.get(pos);
- if (offset > p.getOffset()) {
- // append to the end
- pos++;
- }
- else {
- // entry will became the first of all entries with the same
- // offset
- do {
- --pos;
- if (pos < 0)
- break;
- p = (Position) positions.get(pos);
- }
- while (offset == p.getOffset());
- ++pos;
- }
-
- Assert.isTrue(0 <= pos && pos <= positions.size());
-
- return pos;
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String,
- * int, int)
- */
- public boolean containsPosition(String category, int offset, int length) {
-
- if (category == null)
- return false;
-
- List list = (List) fPositions.get(category);
- if (list == null)
- return false;
-
- int size = list.size();
- if (size == 0)
- return false;
-
- int index = computeIndexInPositionList(list, offset);
- if (index < size) {
- Position p = (Position) list.get(index);
- while (p != null && p.offset == offset) {
- if (p.length == length)
- return true;
- ++index;
- p = (index < size) ? (Position) list.get(index) : null;
- }
- }
-
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
- */
- public boolean containsPositionCategory(String category) {
- if (category != null)
- return fPositions.containsKey(category);
- return false;
- }
-
-
-
- public int getDocumentLength() {
- return fCharSequence.length();
- }
-
- /**
- * Returns all positions managed by the document grouped by category.
- *
- * @return the document's positions
- */
- protected Map getDocumentManagedPositions() {
- return fPositions;
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#getPositionCategories()
- */
- public String[] getPositionCategories() {
- String[] categories = new String[fPositions.size()];
- Iterator keys = fPositions.keySet().iterator();
- for (int i = 0; i < categories.length; i++)
- categories[i] = (String) keys.next();
- return categories;
- }
-
-
- public Position[] getPositions(String category) throws BadPositionCategoryException {
-
- if (category == null)
- throw new BadPositionCategoryException();
-
- List c = (List) fPositions.get(category);
- if (c == null)
- throw new BadPositionCategoryException();
-
- Position[] positions = new Position[c.size()];
- c.toArray(positions);
- return positions;
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
- */
- public IPositionUpdater[] getPositionUpdaters() {
- IPositionUpdater[] updaters = new IPositionUpdater[fPositionUpdaters.size()];
- fPositionUpdaters.toArray(updaters);
- return updaters;
- }
-
-
-
- /*
- * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater,
- * int)
- */
- public synchronized void insertPositionUpdater(IPositionUpdater updater, int index) {
-
- for (int i = fPositionUpdaters.size() - 1; i >= 0; i--) {
- if (fPositionUpdaters.get(i) == updater)
- return;
- }
-
- if (index == fPositionUpdaters.size())
- fPositionUpdaters.add(updater);
- else
- fPositionUpdaters.add(index, updater);
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
- */
- public void removePosition(Position position) {
- try {
- removePosition(IDocument.DEFAULT_CATEGORY, position);
- }
- catch (BadPositionCategoryException e) {
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String,
- * org.eclipse.jface.text.Position)
- */
- public synchronized void removePosition(String category, Position position) throws BadPositionCategoryException {
-
- if (position == null)
- return;
-
- if (category == null)
- throw new BadPositionCategoryException();
-
- List c = (List) fPositions.get(category);
- if (c == null)
- throw new BadPositionCategoryException();
-
- // remove based on identity not equality
- int size = c.size();
- for (int i = 0; i < size; i++) {
- if (position == c.get(i)) {
- c.remove(i);
- return;
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
- */
- public void removePositionCategory(String category) throws BadPositionCategoryException {
-
- if (category == null)
- return;
-
- if (!containsPositionCategory(category))
- throw new BadPositionCategoryException();
-
- fPositions.remove(category);
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
- */
- public synchronized void removePositionUpdater(IPositionUpdater updater) {
- for (int i = fPositionUpdaters.size() - 1; i >= 0; i--) {
- if (fPositionUpdaters.get(i) == updater) {
- fPositionUpdaters.remove(i);
- return;
- }
- }
- }
-
-
- /**
- * Updates all positions of all categories to the change described by the
- * document event. All registered document updaters are called in the
- * sequence they have been arranged. Uses a robust iterator.
- *
- * @param event
- * the document event describing the change to which to adapt
- * the positions
- */
- protected synchronized void updatePositions(DocumentEvent event) {
- List list = new ArrayList(fPositionUpdaters);
- Iterator e = list.iterator();
- while (e.hasNext()) {
- IPositionUpdater u = (IPositionUpdater) e.next();
- u.update(event);
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java
deleted file mode 100644
index 03ed2675ef..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-
-public interface IExecutionDelegatable {
-
- void setExecutionDelegate(IExecutionDelegate executionDelegate);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java
deleted file mode 100644
index 3230439abb..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-public interface IRegionComparible {
- boolean regionMatches(int offset, int length, String stringToCompare);
-
- boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
deleted file mode 100644
index 502b5081b9..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import java.util.Stack;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-import org.eclipse.wst.sse.core.internal.ILockable;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-
-/**
- * An IStructuredDocument that performs most of its computation and event
- * notification through an IExecutionDelegate.
- *
- * If the delegate has not been set, we execute on current thread, like
- * "normal". This is the case for normal non-editor use (which should still,
- * ultimately, be protected by a scheduling rule). For every operation, a
- * runnable is created, even if later (in the execution delegate instance) it
- * is decided nothing special is needed (that is, in fact being called from an
- * editor's display thread, in which case its just executed) in the UI.
- */
-public class JobSafeStructuredDocument extends BasicStructuredDocument implements IExecutionDelegatable, ILockable {
-
- private static abstract class JobSafeRunnable implements ISafeRunnable {
- public void handleException(Throwable exception) {
- // logged in SafeRunner
- }
- }
-
- private Stack fExecutionDelegates = new Stack();
- private ILock fLockable = Job.getJobManager().newLock();
-
- public JobSafeStructuredDocument() {
- super();
- }
-
-
- public JobSafeStructuredDocument(RegionParser parser) {
- super(parser);
- }
-
-
- /**
- *
- */
- protected final void acquireLock() {
- getLockObject().acquire();
- }
-
- private IExecutionDelegate getExecutionDelegate() {
- if (!fExecutionDelegates.isEmpty())
- return (IExecutionDelegate) fExecutionDelegates.peek();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.ILockable#getLock()
- */
-
- public ILock getLockObject() {
- return fLockable;
- }
-
-
- /**
- *
- */
- protected final void releaseLock() {
- getLockObject().release();
- }
-
- /*
- * @see org.eclipse.jface.text.IDocument.replace(int, int, String)
- */
- public void replace(final int offset, final int length, final String text) throws BadLocationException {
- IExecutionDelegate delegate = getExecutionDelegate();
- if (delegate == null) {
- super.replace(offset, length, text);
- }
- else {
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- JobSafeStructuredDocument.super.replace(offset, length, text);
- }
- };
- delegate.execute(runnable);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentExtension4.replace(int, int, String, long)
- */
- public void replace(final int offset, final int length, final String text, final long modificationStamp) throws BadLocationException {
- IExecutionDelegate delegate = getExecutionDelegate();
- if (delegate == null) {
- super.replace(offset, length, text, modificationStamp);
- }
- else {
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- JobSafeStructuredDocument.super.replace(offset, length, text, modificationStamp);
- }
- };
- delegate.execute(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String)
- */
- public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes) {
- StructuredDocumentEvent event = null;
- IExecutionDelegate delegate = getExecutionDelegate();
- if (delegate == null) {
- event = super.replaceText(requester, start, replacementLength, changes);
- }
- else {
- final Object[] resultSlot = new Object[1];
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes);
- }
- };
- delegate.execute(runnable);
- event = (StructuredDocumentEvent) resultSlot[0];
- }
- return event;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String, boolean)
- */
- public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes, final boolean ignoreReadOnlySettings) {
- StructuredDocumentEvent event = null;
- IExecutionDelegate delegate = getExecutionDelegate();
- if (delegate == null) {
- event = super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
- }
- else {
- final Object[] resultSlot = new Object[1];
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
- }
-
- public void handleException(Throwable exception) {
- resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, changes, start, replacementLength);
- super.handleException(exception);
- }
- };
- delegate.execute(runnable);
- event = (StructuredDocumentEvent) resultSlot[0];
- }
- return event;
- }
-
- public void setExecutionDelegate(IExecutionDelegate delegate) {
- if (delegate != null)
- fExecutionDelegates.push(delegate);
- else if (!fExecutionDelegates.isEmpty())
- fExecutionDelegates.pop();
- }
-
- public StructuredDocumentEvent setText(final Object requester, final String theString) {
- StructuredDocumentEvent event = null;
- IExecutionDelegate executionDelegate = getExecutionDelegate();
- if (executionDelegate == null) {
- event = super.setText(requester, theString);
- }
- else {
- final Object[] resultSlot = new Object[1];
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- resultSlot[0] = JobSafeStructuredDocument.super.setText(requester, theString);
- }
- public void handleException(Throwable exception) {
- resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, theString, 0, 0);
- super.handleException(exception);
- }
- };
- executionDelegate.execute(runnable);
- event = (StructuredDocumentEvent) resultSlot[0];
- }
- return event;
- }
-
- public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) throws IllegalStateException {
- DocumentRewriteSession session = null;
- IExecutionDelegate executionDelegate = getExecutionDelegate();
- if (executionDelegate == null) {
- session = internalStartRewriteSession(sessionType);
- }
- else {
- final Object[] resultSlot = new Object[1];
- final DocumentRewriteSessionType finalSessionType = sessionType;
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- resultSlot[0] = internalStartRewriteSession(finalSessionType);
- }
- };
- executionDelegate.execute(runnable);
- if (resultSlot[0] instanceof Throwable) {
- throw new RuntimeException((Throwable) resultSlot[0]);
- }
- else {
- session = (DocumentRewriteSession) resultSlot[0];
- }
- }
- return session;
- }
-
- public void stopRewriteSession(DocumentRewriteSession session) {
- IExecutionDelegate executionDelegate = getExecutionDelegate();
- if (executionDelegate == null) {
- internalStopRewriteSession(session);
- }
- else {
- final DocumentRewriteSession finalSession = session;
- JobSafeRunnable runnable = new JobSafeRunnable() {
- public void run() throws Exception {
- internalStopRewriteSession(finalSession);
- }
- };
- executionDelegate.execute(runnable);
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
deleted file mode 100644
index de3ff23f39..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
+++ /dev/null
@@ -1,445 +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.sse.core.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.NotImplementedException;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-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.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-
-
-/**
- * Purely a dummy "marker" instance for StructuredDocumentRegions which are
- * created temorarily in the course of re-parsing. Primarily a place holder,
- * but can be needed to get text from.
- */
-public class MinimalDocument implements IStructuredDocument {
- private SubSetTextStore data;
-
- /**
- * Marked private to be sure never created without data being initialized.
- *
- */
- private MinimalDocument() {
- super();
- }
-
- public MinimalDocument(SubSetTextStore initialContents) {
- this();
- data = initialContents;
- }
-
- public void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addDocumentChangedListener(IStructuredDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addDocumentChangingListener(IStructuredDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addDocumentListener(IDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addPosition(Position position) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addPositionCategory(String category) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addPositionUpdater(IPositionUpdater updater) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void clearReadOnly(int startOffset, int length) {
- // TODO: this is called from notifier loop inappropriately
- // throw new NotImplementedException("intentionally not implemented");
- }
-
- public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int computeNumberOfLines(String text) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public boolean containsPosition(String category, int offset, int length) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public boolean containsPositionCategory(String category) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public boolean containsReadOnly(int startOffset, int length) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void fireNewDocument(Object requester) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String get() {
- String result = null;
- result = data.get(0, data.getLength());
- return result;
- }
-
- public String get(int offset, int length) throws BadLocationException {
- String result = null;
- try {
- result = data.get(offset, length);
- } catch (StringIndexOutOfBoundsException e) {
- throw new BadLocationException("offset: " + offset + " length: " + length + "\ndocument length: " + data.getLength());
- }
- return result;
- }
-
- public Object getAdapter(Class adapter) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public char getChar(int offset) throws BadLocationException {
- return data.get(offset);
- }
-
- public String getContentType(int offset) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IDocumentPartitioner getDocumentPartitioner() {
- // temp fix
- return null;
- // throw new NotImplementedException("intentionally not implemented");
- }
-
- public EncodingMemento getEncodingMemento() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String[] getLegalContentTypes() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String[] getLegalLineDelimiters() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getLength() {
- return data.getLength();
- }
-
- public String getPreferedLineDelimiter() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String getLineDelimiter(int line) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IRegion getLineInformation(int line) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getLineLength(int line) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getLineOffset(int line) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getLineOfOffset(int offset) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getNumberOfLines() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int getNumberOfLines(int offset, int length) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public RegionParser getParser() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public ITypedRegion getPartition(int offset) throws BadLocationException {
- Logger.log(Logger.WARNING, "An instance of MinimalDocument was asked for its partition, sometime indicating a deleted region was being accessed."); //$NON-NLS-1$
- return new TypedRegion(0,0, "undefined"); //$NON-NLS-1$
- //throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String[] getPositionCategories() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public Position[] getPositions(String category) throws BadPositionCategoryException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IPositionUpdater[] getPositionUpdaters() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegion getRegionAtCharacterOffset(int offset) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegionList getRegionList() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredTextReParser getReParser() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String getText() {
- return data.get(0, data.getLength());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.IStructuredDocument#getUndoManager()
- */
- public IStructuredTextUndoManager getUndoManager() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void insertPositionUpdater(IPositionUpdater updater, int index) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void makeReadOnly(int startOffset, int length) {
- // TODO: this is called from notifier loop inappropriately
- // throw new NotImplementedException("intentionally not implemented");
- }
-
- public IStructuredDocument newInstance() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#registerPostNotificationReplace(org.eclipse.jface.text.IDocumentListener,
- * org.eclipse.jface.text.IDocumentExtension.IReplace)
- */
- public void registerPostNotificationReplace(IDocumentListener owner, IReplace replace) throws UnsupportedOperationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removeDocumentChangedListener(IStructuredDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removeDocumentChangingListener(IStructuredDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removeDocumentListener(IDocumentListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removePosition(Position position) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removePosition(String category, Position position) throws BadPositionCategoryException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removePositionCategory(String category) throws BadPositionCategoryException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removePositionUpdater(IPositionUpdater updater) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void replace(int offset, int length, String text) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- // data.replace(offset, length, text);
- }
-
- public StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.IStructuredDocument#replaceText(java.lang.Object,
- * int, int, java.lang.String, boolean)
- */
- public StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange, boolean ignoreReadOnlySetting) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#resumePostNotificationProcessing()
- */
- public void resumePostNotificationProcessing() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public int search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void set(String text) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- // data.set(text);
- }
-
- public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void setEncodingMemento(EncodingMemento encodingMemento) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public void setPreferredLineDelimiter(String delimiter) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public StructuredDocumentEvent setText(Object requester, String allText) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.IStructuredDocument#setUndoManager(org.eclipse.wst.sse.core.undo.StructuredTextUndoManager)
- */
- public void setUndoManager(IStructuredTextUndoManager undoManager) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#startSequentialRewrite(boolean)
- */
- public void startSequentialRewrite(boolean normalize) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#stopPostNotificationProcessing()
- */
- public void stopPostNotificationProcessing() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentExtension#stopSequentialRewrite()
- */
- public void stopSequentialRewrite() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public String getLineDelimiter() {
- return null;
- }
-
- public String getPreferredLineDelimiter() {
- return null;
- }
-
- public void setLineDelimiter(String delimiter) {
-
- }
-
- public IStructuredDocumentRegion[] getStructuredDocumentRegions() {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegion[] getStructuredDocumentRegions(int start, int length) {
- throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/ReadOnlyPosition.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/ReadOnlyPosition.java
deleted file mode 100644
index 4c4bccfeb1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/ReadOnlyPosition.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.sse.core.internal.text;
-
-import org.eclipse.jface.text.Position;
-
-class ReadOnlyPosition extends Position {
- private boolean fIncludeStartOffset = false;
-
- public ReadOnlyPosition(int newOffset, int newLength, boolean includeStart) {
- super(newOffset, newLength);
- fIncludeStartOffset = includeStart;
- }
-
- public boolean overlapsWith(int newOffset, int newLength) {
- boolean overlapsWith = super.overlapsWith(newOffset, newLength);
- if (overlapsWith) {
- /*
- * BUG157526 If at the start of the read only region and length =
- * 0 most likely asking to insert and want to all inserting before
- * read only region
- */
- if (fIncludeStartOffset && (newLength == 0) && (this.length != 0) && (newOffset == this.offset)) {
- overlapsWith = false;
- }
- }
- return overlapsWith;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
deleted file mode 100644
index 1cad185b98..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
+++ /dev/null
@@ -1,1700 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * David Carver (Intalio) - bug 300427 - Comparison of String Objects using == or !=
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-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.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.IStructuredTextReParser;
-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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-
-/**
- * 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 StructuredDocumentReParser implements IStructuredTextReParser {
- protected IStructuredDocumentRegion dirtyEnd = null;
- protected IStructuredDocumentRegion dirtyStart = null;
- final private String doubleQuote = new String(new char[]{'\"'});
- protected final CoreNodeList EMPTY_LIST = new CoreNodeList();
- protected String fChanges;
- protected String fDeletedText;
- protected boolean fIsEntireDocument;
-
- private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter = null;
- protected int fLengthDifference;
- protected int fLengthToReplace;
- protected Object fRequester;
- protected int fStart;
- // note: this is the impl class of IStructuredDocument, not the interface
- // FUTURE_TO_DO: I believe some of these can be made private now.?
- protected BasicStructuredDocument fStructuredDocument;
-
- /**
- * variable used in anticiapation of multithreading
- */
- protected boolean isParsing;
- final private String singleQuote = new String(new char[]{'\''});
-
- public StructuredDocumentReParser() {
- super();
- }
-
- public StructuredDocumentEvent _checkBlockNodeList(List blockTagList) {
- StructuredDocumentEvent result = null;
- if (blockTagList != null) {
- for (int i = 0; i < blockTagList.size(); i++) {
- org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker blockTag = (org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) blockTagList.get(i);
- String tagName = blockTag.getTagName();
- final String tagStart = "<" + tagName; //$NON-NLS-1$
- result = checkForCriticalName(tagStart); //$NON-NLS-1$
- if (result != null)
- break;
- result = checkForCriticalName("</" + tagName); //$NON-NLS-1$
- if (result != null)
- break;
- result = checkForSelfClosing(tagStart);
- if (result != null)
- break;
- result = checkForTransitionToOpen(tagStart);
- if (result != null)
- break;
- }
- }
- return result;
- }
-
- /**
- * Checks if the start region has become self-closing. e.g., &lt;style&gt; -&gt; &lt;style/&gt;
- */
- private StructuredDocumentEvent checkForSelfClosing(String tagName) {
- StructuredDocumentEvent result = null;
- if (dirtyStart.getText().toLowerCase().indexOf(tagName.toLowerCase()) >= 0) { // within a start-tag
- final int documentLength = fStructuredDocument.getLength();
- int end = fStart + fLengthToReplace + fChanges.length() + 1;
- if (end > documentLength)
- end = documentLength - 1;
- final String oldText = fStructuredDocument.get(fStart, 1);
- final String peek = StringUtils.paste(oldText, fChanges, 0, fLengthToReplace);
- if ("/>".equals(peek)) { // Reparse afterwards if the tag became self-closing
- result = reparse(dirtyStart.getStart(), documentLength - 1);
- }
- }
- return result;
- }
-
- /**
- * Checks if the start region has become self-closing. e.g., &lt;style/&gt; -&gt; &lt;style&gt;
- */
- private StructuredDocumentEvent checkForTransitionToOpen(String tagName) {
- StructuredDocumentEvent result = null;
- if (dirtyStart.getText().toLowerCase().indexOf(tagName.toLowerCase()) >= 0) { // within a start-tag
- final int documentLength = fStructuredDocument.getLength();
- int end = fStart + fLengthToReplace + fChanges.length() + 1;
- if (end > documentLength)
- end = documentLength - 1;
- final String oldText = fStructuredDocument.get(fStart, 2);
- final String peek = StringUtils.paste(oldText, fChanges, 0, fLengthToReplace);
- if ("/>".equals(oldText) && ">".equals(peek)) { // Reparse afterwards if the block tag went from self-closing to open
- result = reparse(dirtyStart.getStart(), documentLength - 1);
- }
- }
- return result;
- }
-
- /**
- * Common utility for checking for critical word such as " <SCRIPT>"
- */
- private StructuredDocumentEvent _checkForCriticalWord(String criticalTarget, boolean checkEnd) {
- StructuredDocumentEvent result = null;
- int documentLength = fStructuredDocument.getLength();
- int propLen = fLengthToReplace;
- if (propLen > documentLength)
- propLen = documentLength;
- int startNeighborhood = fStart - criticalTarget.length();
- int adjustInsert = 0;
- if (startNeighborhood < 0) {
- adjustInsert = 0 - startNeighborhood;
- startNeighborhood = 0;
- }
- int endNeighborhood = fStart + fLengthToReplace + criticalTarget.length() - 1;
- if (endNeighborhood > documentLength)
- endNeighborhood = documentLength - 1;
- int oldlen = endNeighborhood - startNeighborhood; // + 1;
- if (oldlen + startNeighborhood > documentLength) {
- oldlen = documentLength - startNeighborhood;
- }
- String oldText = fStructuredDocument.get(startNeighborhood, oldlen);
- String peek = StringUtils.paste(oldText, fChanges, criticalTarget.length() - adjustInsert, fLengthToReplace);
- boolean isCriticalString = checkTagNames(oldText, criticalTarget, checkEnd);
- boolean toBeCriticalString = checkTagNames(peek, criticalTarget, checkEnd);
- if ((isCriticalString != toBeCriticalString) || // OR if both are
- // critical and there's
- // a change in the end
- // tag ('>')
- ((isCriticalString && toBeCriticalString) && (changeInIsEndedState(oldText, peek)))) {
- // if it involves a change of a critical string (making one where
- // there wasn't, or removing
- // one where there was one) then reparse everthing.
- result = reparse(0, documentLength - 1);
- }
- return result;
- }
-
- private int _computeStartOfDifferences(CoreNodeList oldNodes, CoreNodeList newNodes) {
- int startOfDifferences = -1;
- int newNodesLength = newNodes.getLength();
- boolean foundDifference = false;
- boolean done = false;
- // we'll control our loop based on the old List length
- int oldNodesLength = oldNodes.getLength();
- // be sure to check 'done' first, so startOfDifferences isn't
- // icremented if done is true
- done : while ((!done) && (++startOfDifferences < oldNodesLength)) {
- IStructuredDocumentRegion oldNode = oldNodes.item(startOfDifferences);
- // this lessThanEffectedRegion is to check to be sure the node is
- // infact a candidate
- // to be considered as "old". This check is important for the case
- // where some
- // text is replaceing text that
- // appears identical, but is a different instance. For example, if
- // the text
- // is <P><B></B></P> and <B></B> is inserted at postion 3,
- // resulting in <P><B></B><B></B></P>
- // we do not want the
- // first <B> to be considered old ... it is the new one, the
- // second
- // <B> is the old one.
- if (_lessThanEffectedRegion(oldNode)) {
- // be sure to check that we have new nodes to compare against.
- if (startOfDifferences > newNodesLength) {
- foundDifference = false;
- done = true;
- continue done;
- } else {
- //
- IStructuredDocumentRegion newNode = newNodes.item(startOfDifferences);
- // note: shift is 0 while at beginning of list, before the
- // insertion (or deletion) point. After that, it is
- // fStart+fLengthDifference
- if (!(oldNode.sameAs(newNode, 0))) {
- foundDifference = true;
- done = true;
- continue done;
- } else { // if they are equal, then we will be keeping the
- // old one, so
- // we need to be sure its parentDocument is set back
- // to
- // the right instance
- oldNode.setParentDocument(fStructuredDocument);
- }
- }
- } else {
- // we didn't literally find a difference, but we count it as
- // such by implication
- foundDifference = true;
- done = true;
- continue done;
- }
- }
- // if we literally found a difference, then all is ok and we can
- // return
- // it.
- // if we did not literally find one, then we have to decide why.
- if (!foundDifference) {
- if (newNodesLength == oldNodesLength) { // then lists are
- // identical
- // (and may be of zero
- // length)
- startOfDifferences = -1;
- } else {
- if (newNodesLength > oldNodesLength) { // then lists are
- // identical except for
- // newNodes added
- startOfDifferences = oldNodesLength;
- } else {
- if (newNodesLength < oldNodesLength) { // then lists are
- // identical except
- // for old Nodes
- // deleted
- startOfDifferences = newNodesLength;
- }
- }
- }
- }
- return startOfDifferences;
- }
-
- private int _computeStartOfDifferences(IStructuredDocumentRegion oldNodeParam, ITextRegionList oldRegions, IStructuredDocumentRegion newNodeParam, ITextRegionList newRegions) {
- int startOfDifferences = -1;
- int newRegionsLength = newRegions.size();
- boolean foundDifference = false;
- boolean done = false;
- // we'll control our loop based on the old List length
- int oldRegionsLength = oldRegions.size();
- // be sure to check 'done' first, so startOfDifferences isn't
- // icremented if done is true
- done : while ((!done) && (++startOfDifferences < oldRegionsLength)) {
- ITextRegion oldRegion = oldRegions.get(startOfDifferences);
- // this lessThanEffectedRegion is to check to be sure the node is
- // infact a candidate
- // to be considered as "old". This check is important for the case
- // where some
- // text is replaceing text that
- // appears identical, but is a different instance. For example, if
- // the text
- // is <P><B></B></P> and <B></B> is inserted at postion 3,
- // resulting in <P><B></B><B></B></P>
- // we do not want the
- // first <B> to be considered old ... it is the new one, the
- // second
- // <B> is the old one.
- if (_lessThanEffectedRegion(oldNodeParam, oldRegion)) {
- // be sure to check that we have new nodes to compare against.
- if (startOfDifferences > newRegionsLength) {
- foundDifference = false;
- done = true;
- continue done;
- } else {
- //
- ITextRegion newRegion = newRegions.get(startOfDifferences);
- // note: shift is 0 while at beginning of list, before the
- // insertion (or deletion) point. After that, it is
- // fStart+fLengthDifference
- if (!(oldNodeParam.sameAs(oldRegion, newNodeParam, newRegion, 0))) {
- foundDifference = true;
- done = true;
- continue done;
- } else {
- // if they are equal, then we will be keeping the old
- // one.
- // unlike the flatnode case, there is no reason to
- // update
- // the textstore, since its the same text store in
- // either case
- // (since its the same flatnode)
- //oldRegion.setTextStore(fStructuredDocument.parentDocument);
- }
- }
- } else {
- // we didn't literally find a difference, but we count it as
- // such by implication
- foundDifference = true;
- done = true;
- continue done;
- }
- }
- // if we literally found a difference, then all is ok and we can
- // return
- // it.
- // if we did not literally find one, then we have to decide why.
- if (!foundDifference) {
- if (newRegionsLength == oldRegionsLength) { // then lists are
- // identical (and may
- // be of zero length)
- startOfDifferences = -1;
- } else {
- if (newRegionsLength > oldRegionsLength) { // then lists are
- // identical except
- // for newRegions
- // added
- startOfDifferences = oldRegionsLength;
- } else {
- if (newRegionsLength < oldRegionsLength) { // then lists
- // are identical
- // except for
- // old Nodes
- // deleted
- startOfDifferences = newRegionsLength;
- }
- }
- }
- }
- return startOfDifferences;
- }
-
- /**
- * Part 1 of 2 steps to do a core_reparse
- *
- * Parses a portion of the current text in the IStructuredDocument and
- * returns the raw result
- */
- private IStructuredDocumentRegion _core_reparse_text(int rescanStart, int rescanEnd) {
- fStructuredDocument.resetParser(rescanStart, rescanEnd);
- return fStructuredDocument.getParser().getDocumentRegions();
- }
-
- /**
- * Part 2 of 2 steps to do a core_reparse
- *
- * Integrates a list of StructuredDocumentRegions based on the current
- * text contents of the IStructuredDocument into the IStructuredDocument
- * data structure
- */
- private StructuredDocumentEvent _core_reparse_update_model(IStructuredDocumentRegion newNodesHead, int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
- StructuredDocumentEvent result = null;
- CoreNodeList newNodes = null;
- // rescan
- newNodes = new CoreNodeList(newNodesHead);
- // adjust our newNode chain so the offset positions match
- // our text store (not the simple string of text reparsed)
- StructuredDocumentRegionIterator.adjustStart(newNodesHead, rescanStart);
- // initialize the parentDocument variable of each instance in the new
- // chain
- StructuredDocumentRegionIterator.setParentDocument(newNodesHead, fStructuredDocument);
- // initialize the structuredDocument variable of each instance in the
- // new chain
- //StructuredDocumentRegionIterator.setStructuredDocument(newNodesHead,
- // fStructuredDocument);
- //
- if (firstTime) {
- fStructuredDocument.setCachedDocumentRegion(newNodesHead);
- fStructuredDocument.initializeFirstAndLastDocumentRegion();
- // note: since we are inserting nodes, for the first time, there
- // is
- // no adjustments
- // to downstream stuff necessary.
- result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
- } else {
- // note: integrates changes into model as a side effect
- result = minimumEvent(oldNodes, newNodes);
- }
- result.setDeletedText(fDeletedText);
- return result;
- }
-
- private CoreNodeList _formMinimumList(CoreNodeList flatnodes, int startOfDifferences, int endOfDifferences) {
- CoreNodeList minimalNodes = null;
- // if startOfDifferces is still its initial value, then we have an
- // empty document
- if (startOfDifferences == -1) {
- minimalNodes = EMPTY_LIST;
- } else {
- // if we do not have any flatnode in our flatnode list, then
- // simply
- // return our standard empty list
- if (flatnodes.getLength() == 0) {
- minimalNodes = EMPTY_LIST;
- } else {
- // if startOfDifferences is greater than endOfDifferences,
- // then
- // that means the calculations "crossed" each other, and
- // hence,
- // there really is no differences, so, again, return the empty
- // list
- if (startOfDifferences > endOfDifferences) {
- minimalNodes = EMPTY_LIST;
- } else {
- // the last check be sure we have some differnces
- if ((endOfDifferences > -1)) {
- minimalNodes = new CoreNodeList(flatnodes.item(startOfDifferences), flatnodes.item(endOfDifferences));
- } else {
- // there were no differences, the list wasn't
- // minimized, so simply return it.
- minimalNodes = flatnodes;
- }
- }
- }
- }
- return minimalNodes;
- }
-
- private boolean _greaterThanEffectedRegion(IStructuredDocumentRegion oldNode) {
- boolean result = false;
- int nodeStart = oldNode.getStartOffset();
- int changedRegionEnd = fStart + fLengthToReplace - 1;
- result = nodeStart > changedRegionEnd;
- return result;
- }
-
- private boolean _greaterThanEffectedRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion) {
- boolean result = false;
- int regionStartOffset = oldNode.getStartOffset(oldRegion);
- int effectedRegionEnd = fStart + fLengthToReplace - 1;
- result = regionStartOffset > effectedRegionEnd;
- return result;
- }
-
- private boolean _lessThanEffectedRegion(IStructuredDocumentRegion oldNode) {
- boolean result = false;
- int nodeEnd = oldNode.getEndOffset() - 1;
- result = nodeEnd < fStart;
- return result;
- }
-
- private boolean _lessThanEffectedRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion) {
- boolean result = false;
- int nodeEnd = oldNode.getEndOffset(oldRegion) - 1;
- result = nodeEnd < fStart;
- return result;
- }
-
- private boolean _regionsSameKind(ITextRegion newRegion, ITextRegion oldRegion) {
- boolean result = false;
- // if one region is a container region, and the other not, always
- // return false
- // else, just check their type.
- // DW druing refactoring, looks like a "typo" here, using 'old' in
- // both.
- // if (isContainerRegion(oldRegion) != isContainerRegion(oldRegion))
- if (isCollectionRegion(oldRegion) != isCollectionRegion(newRegion))
- result = false;
- else if (oldRegion.getType().equals(newRegion.getType()))
- result = true;
- return result;
- }
-
- // private boolean hasCollectionRegions(ITextRegion aRegion) {
- // boolean result = false;
- // if (aRegion instanceof ITextRegionCollection) {
- // ITextRegionCollection regionContainter = (ITextRegionCollection)
- // aRegion;
- // ITextRegionList regions = regionContainter.getRegions();
- // Iterator iterator = regions.iterator();
- // while (iterator.hasNext()) {
- // if (aRegion instanceof ITextRegionCollection) {
- // result = true;
- // break;
- // }
- // }
- // }
- // return result;
- // }
- /**
- * This method is specifically to detect changes in 'isEnded' state,
- * although it still does so with heuristics. If number of '>' changes,
- * assume the isEnded state has changed.
- */
- private boolean changeInIsEndedState(String oldText, String newText) {
- int nOld = StringUtils.occurrencesOf(oldText, '>');
- int nNew = StringUtils.occurrencesOf(newText, '>');
- return !(nOld == nNew);
- }
-
- private void checkAndAssignParent(IStructuredDocumentRegion oldNode, ITextRegion region) {
- if (region instanceof ITextRegionContainer) {
- ((ITextRegionContainer) region).setParent(oldNode);
- return;
- }
- if (region instanceof ITextRegionCollection) {
- ITextRegionCollection textRegionCollection = (ITextRegionCollection) region;
- ITextRegionList regionList = textRegionCollection.getRegions();
- for (int i = 0; i < regionList.size(); i++) {
- ITextRegion innerRegion = regionList.get(i);
- checkAndAssignParent(oldNode, innerRegion);
- }
- }
- }
-
- /**
- * A change to a CDATA tag can result in all being reparsed.
- */
- private StructuredDocumentEvent checkForCDATA() {
- StructuredDocumentEvent result = null;
- result = checkForCriticalKey("<![CDATA["); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("]]>"); //$NON-NLS-1$
- return result;
- }
-
- /**
- * If a comment start or end tag is being added or deleted, we'll rescan
- * the whole document. The reason is that content that is revealed or
- * commented out can effect the interpretation of the rest of the
- * document. Note: for now this is very XML specific, can refactor/improve
- * later.
- */
- protected StructuredDocumentEvent checkForComments() {
- StructuredDocumentEvent result = null;
- result = checkForCriticalKey("<!--"); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("-->"); //$NON-NLS-1$
- // we'll also check for these degenerate cases
- if (result == null)
- result = checkForCriticalKey("<!--->"); //$NON-NLS-1$
- return result;
- }
-
- /**
- * Common utility for checking for critical word such as " <SCRIPT>"
- */
- protected StructuredDocumentEvent checkForCriticalKey(String criticalTarget) {
- return _checkForCriticalWord(criticalTarget, false);
- }
-
- /**
- * Common utility for checking for critical word such as " <SCRIPT>"
- */
- private StructuredDocumentEvent checkForCriticalName(String criticalTarget) {
- return _checkForCriticalWord(criticalTarget, true);
- }
-
- // /**
- // * Currently this method is pretty specific to ?ML
- // * @deprecated - not really deprecated, but plan to make
- // * protected ... I'm not sure why its public or misspelled?
- // */
- protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
- StructuredDocumentEvent result = null;
- // Case 1: See if the language's syntax requires that multiple
- // StructuredDocumentRegions be rescanned
- if (result == null) {
- result = checkForCrossStructuredDocumentRegionSyntax();
- }
- // Case 2: "block tags" whose content is left unparsed
- if (result == null) {
- Object parser = fStructuredDocument.getParser();
- if (parser instanceof BlockTagParser) {
- List blockTags = ((BlockTagParser) parser).getBlockMarkers();
- result = _checkBlockNodeList(blockTags);
- }
- }
- // FUTURE_TO_DO: is there a better place to do this?
- // or! do we already do it some other more central place?
- if (result != null) {
- result.setDeletedText(fDeletedText);
- }
- return result;
- }
-
- /**
- * Allow a reparser to check for extra syntactic cases that require
- * parsing beyond the flatNode boundary.
- *
- * This implementation is very XML-centric.
- */
- protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionSyntax() {
- StructuredDocumentEvent result;
- // Case 1: Quote characters are involved
- result = checkForQuotes();
- if (result == null) {
- // Case 2: The input forms or undoes a comment beginning or
- // comment
- // end
- result = checkForComments();
- }
- if (result == null) {
- // Case 3: The input forms or undoes a processing instruction
- result = checkForPI();
- }
- if (result == null) {
- // Case 4: The input forms or undoes a CDATA section
- result = checkForCDATA();
- }
- return result;
- }
-
- /**
- * Checks to see if change request exactly matches the text it would be
- * replacing. (In future, this, or similar method is where to check for
- * "read only" attempted change.)
- */
- private StructuredDocumentEvent checkForNoChange() {
- StructuredDocumentEvent result = null;
- // don't check equals unless lengths match
- // should be a tiny bit faster, since usually not
- // of equal lengths (I'm surprised String's equals method
- // doesn't do this.)
- if ((fChanges != null) && (fDeletedText != null) && (fChanges.length() == fDeletedText.length()) && (fChanges.equals(fDeletedText))) {
- result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
- ((NoChangeEvent)result).reason = NoChangeEvent.NO_CONTENT_CHANGE;
- }
- return result;
- }
-
- /**
- * A change to a PI tag can result in all being reparsed.
- */
- private StructuredDocumentEvent checkForPI() {
- StructuredDocumentEvent result = null;
- result = checkForCriticalKey("<?"); //$NON-NLS-1$
- if (result == null)
- result = checkForCriticalKey("?>"); //$NON-NLS-1$
- return result;
- }
-
- /*
- * For simplicity, if either text to be deleted, or text to be inserted
- * contains at least one quote, we'll search for previous quote in
- * document, if any, and use that document region as a dirty start, and we'll use
- * end of document as dirty end. We need to assume either \" or \' is an
- * acceptable quote. (NOTE: this is, loosely, an XML assumption -- other
- * languages would differ, but we'll "hard code" for XML for now.
- *
- * future_TODO: this is a really bad heuristic ... we should be looking
- * for odd number of quotes within a structuredDocumentRegion (or
- * something!) This causes way too much reparsing on simple cases, like
- * deleting a tag with a quoted attribute!
- */
- private StructuredDocumentEvent checkForQuotes() {
- // routine is supported with null or empty string meaning the same
- // thing: deletion
- if (fChanges == null)
- fChanges = ""; //$NON-NLS-1$
- //
- StructuredDocumentEvent result = null;
- try {
- int dirtyStartPos = -1;
- String proposedDeletion = fStructuredDocument.get(fStart, fLengthToReplace);
- if (fStart < fStructuredDocument.getLength()) {
- if ((fChanges.indexOf(singleQuote) > -1) || (proposedDeletion.indexOf(singleQuote) > -1)) {
- IRegion singleQuoteRegion = getFindReplaceDocumentAdapter().find(fStart, singleQuote, false, false, false, false);
- if (singleQuoteRegion != null) {
- dirtyStartPos = singleQuoteRegion.getOffset();
- }
- } else if ((fChanges.indexOf(doubleQuote) > -1) || (proposedDeletion.indexOf(doubleQuote) > -1)) {
- IRegion doubleQuoteRegion = getFindReplaceDocumentAdapter().find(fStart, doubleQuote, false, false, false, false);
- if (doubleQuoteRegion != null) {
- dirtyStartPos = doubleQuoteRegion.getOffset();
- }
- }
- }
- if (dirtyStartPos > -1) {
- // then we found one, do create new structuredDocument event
- // based on the previous quote to end of document
- // except, we need to be positive that the previous quote is
- // in a "safe start" region (e.g. if in JSP content, we need
- // to
- // backup till we include the whole JSP region, in order for
- // it
- // to be correctly re-parsed. The backing up is done in the
- // reparse/find dirty start from hint
- // method.
- result = reparse(dirtyStartPos, fStructuredDocument.getLength() - 1);
- }
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- if (result != null) {
- result.setDeletedText(fDeletedText);
- }
- return result;
- }
-
- private StructuredDocumentEvent checkHeuristics() {
- StructuredDocumentEvent result = null;
- result = checkForNoChange();
- if (result == null) {
- result = checkForCrossStructuredDocumentRegionBoundryCases();
- if (result == null) {
- result = quickCheck();
- }
- }
- return result;
- }
-
- /**
- * Takes into account "tag name" rules for comparisons; case-insensitive.
- */
- private boolean checkTagNames(String compareText, String criticalTarget, boolean checkEnd) {
- boolean result = false;
- if ((compareText == null) || (criticalTarget == null))
- return false;
- int posOfCriticalWord = compareText.toLowerCase().indexOf(criticalTarget.toLowerCase());
- result = posOfCriticalWord > -1;
- if (checkEnd && result) {
- // instead of returning true right away, we'll only return true
- // the
- // potentially matched tag is indeed a tag, for example, if
- // <SCRIPT
- // becomes <SCRIPTS we don't want to say the latter is a critical
- // tag
- int lastPos = posOfCriticalWord + criticalTarget.length();
- if (lastPos < compareText.length()) {
- char lastChar = compareText.charAt(lastPos);
- // Future: check formal definition of this java method, vs.
- // XML
- // parsing rules
- result = (!Character.isLetterOrDigit(lastChar));
- }
- }
- return result;
- }
-
- /**
- * The core reparsing method ... after the dirty start and dirty end have
- * been calculated elsewhere, and the text updated.
- */
- protected StructuredDocumentEvent core_reparse(int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
- IStructuredDocumentRegion newNodesHead = null;
- StructuredDocumentEvent result = null;
- newNodesHead = _core_reparse_text(rescanStart, rescanEnd);
- result = _core_reparse_update_model(newNodesHead, rescanStart, rescanEnd, oldNodes, firstTime);
- return result;
- }
-
- /**
- * Resets state to "not parsing"
- */
- private synchronized void endReParse() {
- isParsing = false;
- dirtyStart = null;
- dirtyEnd = null;
- fChanges = null;
- fDeletedText = null;
- fIsEntireDocument = false;
- }
-
- protected IStructuredDocumentRegion findDirtyEnd(int end) {
- // Caution: here's one place we have to cast
- IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(end);
- // if not well formed, get one past, if there is something there
- if ((result != null) && (!result.isEnded())) {
- if (result.getNext() != null) {
- result = result.getNext();
- }
- }
- // also, get one past if exactly equal to the end (this was needed
- // as a simple fix to when a whole exact region is deleted.
- // there's probably a better way.
- if ((result != null) && (end == result.getEnd())) {
- if (result.getNext() != null) {
- result = result.getNext();
- }
- }
- // moved to subclass for quick transition
- // 12/6/2001 - Since we've changed the parser/scanner to allow a lone
- // '<' without
- // always interpretting it as start of a tag name, we need to be a
- // little fancier, in order
- // to "skip" over any plain 'ol content between the lone '<' and any
- // potential meating
- // regions past plain 'ol content.
- // if (isLoneOpenFollowedByContent(result) && (result.getNext() !=
- // null)) {
- // result = result.getNext();
- // }
- if (result != null)
- fStructuredDocument.setCachedDocumentRegion(result);
- dirtyEnd = result;
- return dirtyEnd;
- }
-
- protected void findDirtyStart(int start) {
- IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(start);
- // heuristic: if the postion is exactly equal to the start, then
- // go back one more, if it exists. This prevents problems with
- // insertions
- // of text that should be merged with the previous node instead of
- // simply hung
- // off of it as a separate node (ex.: XML content inserted right
- // before
- // an open
- // bracket should become part of the previous content node)
- if (result != null) {
- IStructuredDocumentRegion previous = result.getPrevious();
- if ((previous != null) && ((!(previous.isEnded())) || (start == result.getStart()))) {
- result = previous;
- }
- // If we are now at the end of a "tag dependent" content area (or
- // JSP area)
- // then we need to back up all the way to the beginning of that.
- IStructuredDocumentRegion potential = result;
- // moved to subclass to speed transition
- // while (isPartOfBlockRegion(potential)) {
- // potential = potential.getPrevious();
- // }
- if (potential != null) {
- result = potential;
- fStructuredDocument.setCachedDocumentRegion(result);
- }
- }
- dirtyStart = result;
- }
-
- protected CoreNodeList formOldNodes(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
- CoreNodeList oldNodes = new CoreNodeList(dirtyStart, dirtyEnd);
- // Now save the old text, that "goes with" the old nodes and regions.
- // Notice we are getting it directly from the text store
- String oldText = null;
- int oldStart = -1;
- int oldEnd = -1;
- // make sure there is some text, if not, use empty string
- // (if one node is not null, the other should ALWAYS be not null too,
- // since it
- // would at least be equal to it.)
- if (dirtyStart != null) {
- oldStart = dirtyStart.getStart();
- oldEnd = dirtyEnd.getEnd();
- oldText = fStructuredDocument.get(oldStart, oldEnd - oldStart);
- } else {
- oldStart = 0;
- oldEnd = 0;
- oldText = ""; //$NON-NLS-1$
- }
- // create a temporary text store for this text
- SubSetTextStore subTextStore = new SubSetTextStore(oldText, oldStart, oldEnd, fStructuredDocument.getLength());
- // Now update the text store of the oldNodes
- StructuredDocumentRegionIterator.setParentDocument(oldNodes, new MinimalDocument(subTextStore));
- return oldNodes;
- }
-
- /**
- * @return Returns the findReplaceDocumentAdapter.
- */
- public FindReplaceDocumentAdapter getFindReplaceDocumentAdapter() {
- if (fFindReplaceDocumentAdapter == null) {
- fFindReplaceDocumentAdapter = new FindReplaceDocumentAdapter(fStructuredDocument);
- }
- return fFindReplaceDocumentAdapter;
- }
-
- // Note: if thead safety is needed, this and all the other public methods
- // of this class
- // should be synchronized.
- public void initialize(Object requester, int start, int lengthToReplace, String changes) {
- isParsing = true;
- fRequester = requester;
- fStart = start;
- fLengthToReplace = lengthToReplace;
- fChanges = changes;
- // notice this one is derived
- fLengthDifference = Utilities.calculateLengthDifference(fChanges, fLengthToReplace);
- fDeletedText = fStructuredDocument.get(fStart, fLengthToReplace);
- int docLength = fStructuredDocument.getLength();
- fIsEntireDocument = lengthToReplace >= docLength && docLength > 0;
- }
-
- protected void insertNodes(IStructuredDocumentRegion previousOldNode, IStructuredDocumentRegion nextOldNode, CoreNodeList newNodes) {
- //
- IStructuredDocumentRegion firstNew = null;
- IStructuredDocumentRegion lastNew = null;
- //
- IStructuredDocumentRegion oldPrevious = previousOldNode;
- IStructuredDocumentRegion oldNext = nextOldNode;
- //
- if (newNodes.getLength() > 0) {
- // get pointers
- firstNew = newNodes.item(0);
- lastNew = newNodes.item(newNodes.getLength() - 1);
- // switch surrounding StructuredDocumentRegions' references to
- // lists
- if (oldPrevious != null)
- oldPrevious.setNext(firstNew);
- if (oldNext != null) {
- oldNext.setPrevious(lastNew);
- } else {
- // SIDE EFFECT
- // if oldNext is null, that means we are replaceing the
- // lastNode in the chain,
- // so we need to update the structuredDocuments lastNode as
- // the
- // last of the new nodes.
- fStructuredDocument.setLastDocumentRegion(newNodes.item(newNodes.getLength() - 1));
- }
- if (firstNew != null)
- firstNew.setPrevious(oldPrevious);
- if (lastNew != null)
- lastNew.setNext(oldNext);
- }
- // else nothing to insert
- }
-
- /**
- * @param oldRegion
- */
- private boolean isCollectionRegion(ITextRegion aRegion) {
- return (aRegion instanceof ITextRegionCollection);
- }
-
- /**
- * @return boolean
- */
- public boolean isParsing() {
- return isParsing;
- }
-
- /**
- * The minimization algorithm simply checks the old nodes to see if any of
- * them "survived" the rescan and are unchanged. If so, the instance of
- * the old node is used instead of the new node. Before the requested
- * change, need to check type, offsets, and text to determine if the same.
- * After the requested change, need to check type and text, but adjust the
- * offsets to what ever the change was.
- */
- protected StructuredDocumentEvent minimumEvent(CoreNodeList oldNodes, CoreNodeList newNodes) {
- StructuredDocumentEvent event = null;
- CoreNodeList minimalOldNodes = null;
- CoreNodeList minimalNewNodes = null;
- // To minimize nodes, we'll collect all those
- // that are not equal into old and new lists
- // Note: we assume that old and new nodes
- // are basically contiguous -- and we force it to be so,
- // by starting at the beginning to
- // find first difference, and then starting at the end to find
- // last difference. Everything in between we assume is different.
- //
- //
- //
- // startOfDifferences is the index into the core node list where the
- // first difference
- // occurs. But it may point into the old or the new list.
- int startOfDifferences = _computeStartOfDifferences(oldNodes, newNodes);
- int endOfDifferencesOld = -1;
- int endOfDifferencesNew = -1;
- // if one of the lists are shorter than where the differences start,
- // then
- // then some portion of the lists are identical
- if ((startOfDifferences >= oldNodes.getLength()) || (startOfDifferences >= newNodes.getLength())) {
- if (oldNodes.getLength() < newNodes.getLength()) {
- // Then there are new regions to add
- // these lengths will cause the vector of old ones to not
- // have any elements, and the vector of new regions to have
- // just the new ones not in common with the old ones
- //startOfDifferences should equal oldNodes.getLength(),
- // calculated above on _computeStartOfDifferences
- minimalOldNodes = EMPTY_LIST;
- endOfDifferencesNew = newNodes.getLength() - 1;
- minimalNewNodes = _formMinimumList(newNodes, startOfDifferences, endOfDifferencesNew);
- } else {
- if (oldNodes.getLength() > newNodes.getLength()) {
- // delete old
- // then there are old regions to delete
- // these lengths will cause the vector of old regions to
- // contain the ones to delete, and the vector of new
- // regions
- // not have any elements
- //startOfDifferences should equal newNodes.getLength(),
- // calculated above on _computeStartOfDifferences
- endOfDifferencesOld = oldNodes.getLength() - 1;
- minimalOldNodes = _formMinimumList(oldNodes, startOfDifferences, endOfDifferencesOld);
- minimalNewNodes = EMPTY_LIST;
- } else
- // unlikely event
- event = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
- }
- } else {
- // We found a normal startOfDiffernces, but have not yet found the
- // ends.
- // We'll look for the end of differences by going backwards down
- // the two lists.
- // Here we need a seperate index for each array, since they may be
- // (and
- // probably are) of different lengths.
- int indexOld = oldNodes.getLength() - 1;
- int indexNew = newNodes.getLength() - 1;
- // The greaterThanEffectedRegion is important to gaurd against
- // incorrect counting
- // when something identical is inserted to what's already there
- // (see minimization test case 5)
- // Note: the indexOld > startOfDifferences keeps indexOld from
- // getting too small,
- // so that the subsequent oldNodes.item(indexOld) is always valid.
- while ((indexOld >= startOfDifferences) && (_greaterThanEffectedRegion(oldNodes.item(indexOld)))) {
- if (!(oldNodes.item(indexOld).sameAs(newNodes.item(indexNew), fLengthDifference))) {
- break;
- } else {
- // if they are equal, then we will be keeping the old one,
- // so
- // we need to be sure its parentDocument is set back to
- // the
- // right instance
- oldNodes.item(indexOld).setParentDocument(fStructuredDocument);
- }
- indexOld--;
- indexNew--;
- }
- endOfDifferencesOld = indexOld;
- endOfDifferencesNew = indexNew;
- minimalOldNodes = _formMinimumList(oldNodes, startOfDifferences, endOfDifferencesOld);
- minimalNewNodes = _formMinimumList(newNodes, startOfDifferences, endOfDifferencesNew);
- } /////////////////////////////////////////
- //
- IStructuredDocumentRegion firstDownStreamNode = null;
- event = regionCheck(minimalOldNodes, minimalNewNodes);
- if (event != null) {
- firstDownStreamNode = minimalOldNodes.item(0).getNext();
- if (firstDownStreamNode != null && fLengthDifference != 0) { // if
- // firstDownStream
- // is
- // null,
- // then
- // we're
- // at
- // the
- // end
- // of
- // the
- // document
- StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
- } //
- } else {
- event = nodesReplacedCheck(minimalOldNodes, minimalNewNodes);
- // now splice the new chain of nodes to where the old chain is (or
- // was)
- // the firstDownStreamNode (the first of those after the new
- // nodes)
- // is
- // remembered as a tiny optimization.
- if (minimalOldNodes.getLength() == 0 && minimalNewNodes.getLength() > 0) {
- // if no old nodes are being deleted, then use the
- // the newNodes offset (minus one) to find the point to
- // update downstream nodes, and after updating downstream
- // nodes postions, insert the new ones.
- int insertOffset = minimalNewNodes.item(0).getStartOffset();
- IStructuredDocumentRegion lastOldUnchangedNode = null;
- if (insertOffset > 0) {
- lastOldUnchangedNode = fStructuredDocument.getRegionAtCharacterOffset(insertOffset - 1);
- firstDownStreamNode = lastOldUnchangedNode.getNext();
- } else {
- // we're inserting at very beginning
- firstDownStreamNode = fStructuredDocument.getFirstStructuredDocumentRegion();
- // SIDE EFFECT: change the firstNode pointer if we're
- // inserting at beginning
- fStructuredDocument.setFirstDocumentRegion(minimalNewNodes.item(0));
- }
- StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
- insertNodes(lastOldUnchangedNode, firstDownStreamNode, minimalNewNodes);
- // this (nodes replaced) is the only case where we need to
- // update the cached Node
- reSetCachedNode(minimalOldNodes, minimalNewNodes);
- } else {
- firstDownStreamNode = switchNodeLists(minimalOldNodes, minimalNewNodes);
- // no need to adjust the length of the new nodes themselves,
- // they
- // are already correct, but we do need to
- // adjust all "down stream" nodes with the length of the
- // insertion or deletion
- // --- adjustment moved to calling method.
- if (firstDownStreamNode != null) {
- // && event != null
- StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
- } //
- // this (nodes replaced) is the only case where we need to
- // update the cached Node
- reSetCachedNode(minimalOldNodes, minimalNewNodes);
- }
- }
- return event;
- }
-
- // TODO: This should be abstract.
- public IStructuredTextReParser newInstance() {
- return new StructuredDocumentReParser();
- }
-
- protected StructuredDocumentEvent nodesReplacedCheck(CoreNodeList oldNodes, CoreNodeList newNodes) {
- // actually, nothing to check here, since (and assuming) we've already
- // minimized the number of nodes, and ruled out mere region changes
- StructuredDocumentEvent result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
- return result;
- }
-
- /**
- * A method to allow any heuristic "quick checks" that might cover many
- * many cases, before expending the time on a full reparse.
- *
- */
- public StructuredDocumentEvent quickCheck() {
- StructuredDocumentEvent result = null;
- // if the dirty start is null, then we have an empty document.
- // in which case we'll return null so everything can be
- // reparsed "from scratch" . If its not null, we'll give the flatnode
- // a
- // chance
- // to handle, but only if there is one flatnode involved.
- if (dirtyStart != null && dirtyStart == dirtyEnd) {
- IStructuredDocumentRegion targetNode = dirtyStart;
- result = dirtyStart.updateRegion(fRequester, targetNode, fChanges, fStart, fLengthToReplace);
- if (result != null) {
- // at this point only, we need to update the text store and
- // and downstream nodes.
- // FUTURE_TO_DO: can this dependency on structuredDocument
- // method be eliminated?
- fStructuredDocument.updateDocumentData(fStart, fLengthToReplace, fChanges);
- IStructuredDocumentRegion firstDownStreamNode = targetNode.getNext();
- // then flatnode must have been the last one, so need to
- // update
- // any downstream ones
- if (firstDownStreamNode != null) {
- StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
- }
- }
- }
- if (result != null) {
- result.setDeletedText(fDeletedText);
- }
- return result;
- }
-
- /**
- * If only one node is involved, sees how many regions are changed. If
- * only one, then its a 'regionChanged' event ... if more than one, its a
- * 'regionsReplaced' event.
- */
- protected StructuredDocumentEvent regionCheck(CoreNodeList oldNodes, CoreNodeList newNodes) {
- if (Debug.debugStructuredDocument)
- System.out.println("IStructuredDocument::regionsReplacedCheck"); //$NON-NLS-1$
- //$NON-NLS-1$
- //$NON-NLS-1$
- // the "regionsReplaced" event could only be true if and only if the
- // nodelists
- // are each only "1" in length.
- StructuredDocumentEvent result = null;
- int oldLength = oldNodes.getLength();
- int newLength = newNodes.getLength();
- if ((oldLength != 1) || (newLength != 1)) {
- result = null;
- } else {
- IStructuredDocumentRegion oldNode = oldNodes.item(0);
- IStructuredDocumentRegion newNode = newNodes.item(0);
- result = regionCheck(oldNode, newNode);
- }
- return result;
- }
-
- /**
- * If only one node is involved, sees how many regions are changed. If
- * only one, then its a 'regionChanged' event ... if more than one, its a
- * 'regionsReplaced' event.
- */
- protected StructuredDocumentEvent regionCheck(IStructuredDocumentRegion oldNode, IStructuredDocumentRegion newNode) {
- //
- StructuredDocumentEvent result = null;
- ITextRegionList oldRegions = oldNode.getRegions();
- ITextRegionList newRegions = newNode.getRegions();
- ITextRegion[] oldRegionsArray = oldRegions.toArray();
- ITextRegion[] newRegionsArray = newRegions.toArray();
- //
- // for the 'regionsReplaced' event, we don't care if
- // the regions changed due to type, or text,
- // we'll just collect all those that are not equal
- // into the old and new region lists.
- // Note: we, of course, assume that old and new regions
- // are basically contiguous -- and we force it to be so,
- // even if not literally so, by starting at beginning to
- // find first difference, and then starting at end to find
- // last difference. Everything in between we assume is different.
- //
- // going up is easy, we start at zero in each, and continue
- // till regions are not the same.
- int startOfDifferences = _computeStartOfDifferences(oldNode, oldRegions, newNode, newRegions);
- int endOfDifferencesOld = -1;
- int endOfDifferencesNew = -1;
- //
- //
- // if one of the lists are shorter than where the differences start,
- // then
- // then some portion of the lists are identical
- if ((startOfDifferences >= oldRegions.size()) || (startOfDifferences >= newRegions.size())) {
- if (oldRegions.size() < newRegions.size()) {
- // INSERT CASE
- // then there are new regions to add
- // these lengths will cause the vector of old ones to not
- // have any elements, and the vector of new regions to have
- // just the new ones.
- startOfDifferences = oldRegionsArray.length;
- endOfDifferencesOld = oldRegionsArray.length - 1;
- endOfDifferencesNew = newRegionsArray.length - 1;
- } else {
- if (oldRegions.size() > newRegions.size()) {
- // DELETE CASE
- // then there are old regions to delete
- // these lengths will cause the vector of old regions to
- // contain the ones to delete, and the vector of new
- // regions
- // not have any elements
- startOfDifferences = newRegionsArray.length;
- endOfDifferencesOld = oldRegionsArray.length - 1;
- endOfDifferencesNew = newRegionsArray.length - 1;
- } else {
- // else the lists are identical!
- // unlikely event, probably error in current design, since
- // we check for identity at the very beginning of
- // reparsing.
- result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
- }
- }
- } else {
- if ((startOfDifferences > -1) && (endOfDifferencesOld < 0) && (endOfDifferencesNew < 0)) {
- // We found a normal startOfDiffernces, but have not yet found
- // the ends.
- // We'll look for the end of differences by going backwards
- // down the two lists.
- // Here we need a seperate index for each array, since they
- // may
- // be (and
- // probably are) of different lengths.
- int indexOld = oldRegionsArray.length - 1;
- int indexNew = newRegionsArray.length - 1;
- while ((indexOld >= startOfDifferences) && (_greaterThanEffectedRegion(oldNode, oldRegionsArray[indexOld]))) {
- if ((!(oldNode.sameAs(oldRegionsArray[indexOld], newNode, newRegionsArray[indexNew], fLengthDifference)))) {
- //endOfDifferencesOld = indexOne;
- //endOfDifferencesNew = indexTwo;
- break;
- }
- indexOld--;
- indexNew--;
- }
- endOfDifferencesOld = indexOld;
- endOfDifferencesNew = indexNew;
- }
- }
- //
- // result != null means the impossible case above occurred
- if (result == null) {
- // Now form the two vectors of different regions
- ITextRegionList holdOldRegions = new TextRegionListImpl();
- ITextRegionList holdNewRegions = new TextRegionListImpl();
- if (startOfDifferences > -1 && endOfDifferencesOld > -1) {
- for (int i = startOfDifferences; i <= endOfDifferencesOld; i++) {
- holdOldRegions.add(oldRegionsArray[i]);
- }
- }
- if (startOfDifferences > -1 && endOfDifferencesNew > -1) {
- for (int i = startOfDifferences; i <= endOfDifferencesNew; i++) {
- holdNewRegions.add(newRegionsArray[i]);
- }
- }
- if (holdOldRegions.size() == 0 && holdNewRegions.size() == 0) {
- // then this means the regions were identical, which means
- // someone
- // pasted exactly the same thing they had selected, or !!!
- // someone deleted the end bracket of the tag. !!!?
- result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
- } else {
- //If both holdOldRegions and holdNewRegions are of length 1,
- // then its
- // a "region changed" event, else a "regions replaced" event.
- // so we want the new instance of region to become part of the
- // old instance of old node
- if ((holdOldRegions.size() == 1) && (holdNewRegions.size() == 1) && _regionsSameKind((holdNewRegions.get(0)), (holdOldRegions.get(0)))) {
- ITextRegion newOldRegion = swapNewForOldRegion(oldNode, holdOldRegions.get(0), newNode, holdNewRegions.get(0));
- // -- need to update any down stream regions, within this
- // 'oldNode'
- updateDownStreamRegions(oldNode, newOldRegion);
- result = new RegionChangedEvent(fStructuredDocument, fRequester, oldNode, newOldRegion, fChanges, fStart, fLengthToReplace);
- } else {
- replaceRegions(oldNode, holdOldRegions, newNode, holdNewRegions);
- // -- need to update any down stream regions, within this
- // 'oldNode'
- // don't need with the way replaceRegions is implemented.
- // It handles.
- //if(holdNewRegions.size() > 0)
- //updateDownStreamRegions(oldNode, (ITextRegion)
- // holdNewRegions.lastElement());
- result = new RegionsReplacedEvent(fStructuredDocument, fRequester, oldNode, holdOldRegions, holdNewRegions, fChanges, fStart, fLengthToReplace);
- }
- }
- }
- return result;
- }
-
- /**
- * An entry point for reparsing. It calculates the dirty start and dirty
- * end flatnodes based on the start point and length of the changes.
- *
- */
- public StructuredDocumentEvent reparse() {
- StructuredDocumentEvent result = null;
- // if we do not have a cachedNode, then the document
- // must be empty, so simply use 'null' as the dirtyStart and dirtyEnd
- // otherwise, find them.
- if (fStructuredDocument.getCachedDocumentRegion() != null) {
- findDirtyStart(fStart);
- int end = fStart + fLengthToReplace;
- findDirtyEnd(end);
- }
- if (fStructuredDocument.getCachedDocumentRegion() != null) {
- result = checkHeuristics();
- }
- if (result == null) {
- result = reparse(dirtyStart, dirtyEnd);
- }
- endReParse();
- return result;
- }
-
- /**
- * An entry point for reparsing. It calculates the dirty start and dirty
- * end flatnodes based on suggested positions to begin and end. This is
- * needed for cases where parsing must go beyond the immediate node and
- * its direct neighbors.
- *
- */
- protected StructuredDocumentEvent reparse(int reScanStartHint, int reScanEndHint) {
- StructuredDocumentEvent result = null;
- // if we do not have a cachedNode, then the document
- // must be empty, so simply use 'null' as the dirtyStart and dirtyEnd
- if (fStructuredDocument.getCachedDocumentRegion() != null) {
- findDirtyStart(reScanStartHint);
- findDirtyEnd(reScanEndHint);
- }
- result = reparse(dirtyStart, dirtyEnd);
- isParsing = false;
- // debug
- //verifyStructured(result);
- return result;
- }
-
- /**
- * The core reparsing method ... after the dirty start and dirty end have
- * been calculated elsewhere.
- */
- protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
- StructuredDocumentEvent result = null;
- int rescanStart = -1;
- int rescanEnd = -1;
- boolean firstTime = false;
- //
- // "save" the oldNodes (that may be replaced) in a list
- CoreNodeList oldNodes = formOldNodes(dirtyStart, dirtyEnd);
- if (dirtyStart == null || dirtyEnd == null) {
- // dirtyStart or dirty end are null, then that means we didn't
- // have
- // a
- // cached node, which means we have an empty document, so we
- // just need to rescan the changes
- rescanStart = 0;
- rescanEnd = fChanges.length();
- firstTime = true;
- } else {
- // set the start of the text to rescan
- rescanStart = dirtyStart.getStart();
- //
- // set the end of the text to rescan
- // notice we use the same rationale as for the rescanStart,
- // with the added caveat that length has to be added to it,
- // to compensate for the new text which has been added or deleted.
- // If changes has zero length, then "length" will be negative,
- // since
- // we are deleting text. Otherwise, use the difference between
- // what's selected to be replaced and the length of the new text.
- rescanEnd = dirtyEnd.getEnd() + fLengthDifference;
- }
- // now that we have the old stuff "saved" away, update the document
- // with the changes.
- // FUTURE_TO_DO -- don't fire "document changed" event till later
- fStructuredDocument.updateDocumentData(fStart, fLengthToReplace, fChanges);
- // ------------------ now the real work
- result = core_reparse(rescanStart, rescanEnd, oldNodes, firstTime);
- //
- // event is returned to the caller, incase there is
- // some opitmization they can do
- return result;
- }
-
- protected void replaceRegions(IStructuredDocumentRegion oldNode, ITextRegionList oldRegions, IStructuredDocumentRegion newNode, ITextRegionList newRegions) {
- int insertPos = -1;
- ITextRegionList regions = oldNode.getRegions();
- // make a fake flatnode to be new parent of oldRegions, so their text
- // will be right.
- //IStructuredDocumentRegion holdOldStructuredDocumentRegion = new
- // BasicStructuredDocumentRegion(oldNode);
- //
- // need to reset the parent of the new to-be-inserted regions to be
- // the
- // same oldNode that is the one having its regions changed
- // DW, 4/16/2003, removed since ITextRegion no longer has parent.
- // ITextRegionContainer oldParent = oldNode;
- // for (int i = 0; i < newRegions.size(); i++) {
- // AbstractRegion region = (AbstractRegion) newRegions.elementAt(i);
- // region.setParent(oldParent);
- // }
- // if there are no old regions, insert the new regions according to
- // offset
- if (oldRegions.size() == 0) {
- ITextRegion firstNewRegion = newRegions.get(0);
- int firstOffset = newNode.getStartOffset(firstNewRegion);
- // if at beginning, insert there
- if (firstOffset == 0) {
- insertPos = 0;
- } else {
- //
- ITextRegion regionAtOffset = oldNode.getRegionAtCharacterOffset(firstOffset);
- if (regionAtOffset == null)
- insertPos = regions.size();
- else
- insertPos = regions.indexOf(regionAtOffset);
- }
- } else {
- // else, delete old ones before inserting new ones in their place
- ITextRegion firstOldRegion = oldRegions.get(0);
- insertPos = regions.indexOf(firstOldRegion);
- regions.removeAll(oldRegions);
- }
- regions.addAll(insertPos, newRegions);
- // now regions vector of each node should be of equal length,
- // so go through each, and make sure the old regions
- // offsets matches the new regions offsets
- // (we'll just assign them all, but could be slightly more effiecient)
- ITextRegionList allNewRegions = newNode.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion nextOldishRegion = regions.get(i);
- ITextRegion nextNewRegion = allNewRegions.get(i);
- nextOldishRegion.equatePositions(nextNewRegion);
- checkAndAssignParent(oldNode, nextOldishRegion);
- }
- oldNode.setLength(newNode.getLength());
- oldNode.setEnded(newNode.isEnded());
- oldNode.setParentDocument(newNode.getParentDocument());
- // removed concept of part of these regions, so no longer need to do.
- // for (int i = 0; i < oldRegions.size(); i++) {
- // ITextRegion region = (ITextRegion) oldRegions.elementAt(i);
- // region.setParent(holdOldStructuredDocumentRegion);
- // }
- }
-
- private void reSetCachedNode(CoreNodeList oldNodes, CoreNodeList newNodes) {
- // use the last newNode as the new cachedNode postion, unless its null
- // (e.g. when nodes are deleted) in which case, assign
- // it to a "safe" node so we don't lose reference to the
- // structuredDocument!
- if (newNodes.getLength() > 0) {
- // use last new node as the cache
- fStructuredDocument.setCachedDocumentRegion(newNodes.item(newNodes.getLength() - 1));
- } else {
- // if cachedNode is an old node, then we're in trouble:
- // we can't leave it as the cached node! and its already
- // been disconnected from the model, so we can't do getNext
- // or getPrevious, so we'll get one that is right before
- // (or right after) the offset of the old nodes that are being
- // deleted.
- //
- // if newNodesHead and cachedNode are both null, then
- // it means we were asked to insert an empty string into
- // an empty document. So we have nothing to do here
- // (that is, we have no node to cache)
- // similarly if there are no new nodes and no old nodes then
- // nothing to do (but that should never happen ... we shouldn't
- // get there if there is no event to generate).
- if ((fStructuredDocument.getCachedDocumentRegion() != null) && (oldNodes.getLength() > 0)) {
- // note: we can't simple use nodeAtCharacterOffset, since it
- // depends on cachedNode.
- if (oldNodes.includes(fStructuredDocument.getCachedDocumentRegion()))
- fStructuredDocument.setCachedDocumentRegion(fStructuredDocument.getFirstStructuredDocumentRegion());
- }
- if ((fStructuredDocument.getCachedDocumentRegion() == null) && (Debug.displayWarnings)) {
- // this will happen now legitamately when all text is deleted
- // from a document
- System.out.println("Warning: StructuredDocumentReParser::reSetCachedNode: could not find a node to cache! (its ok if all text deleted)"); //$NON-NLS-1$
- }
- }
- }
-
- public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
- // NOTE: this method (and class) depend on being able to
- // do the following cast (i.e. references some fields directly)
- fStructuredDocument = (BasicStructuredDocument) newStructuredDocument;
- fFindReplaceDocumentAdapter = null;
- }
-
- private IStructuredDocumentRegion splice(CoreNodeList oldNodes, CoreNodeList newNodes) {
- //
- IStructuredDocumentRegion firstOld = null;
- IStructuredDocumentRegion firstNew = null;
- IStructuredDocumentRegion lastOld = null;
- IStructuredDocumentRegion lastNew = null;
- //
- IStructuredDocumentRegion oldPrevious = null;
- IStructuredDocumentRegion oldNext = null;
- IStructuredDocumentRegion newPrevious = null;
- IStructuredDocumentRegion newNext = null;
- //
- // if called with both arguments empty lists, we can disregard.
- // this happens, for example, when some text is replaced with the
- // identical text.
- if ((oldNodes.getLength() == 0) && (newNodes.getLength() == 0)) {
- return null;
- }
- // get pointers
- if (newNodes.getLength() > 0) {
- firstNew = newNodes.item(0);
- lastNew = newNodes.item(newNodes.getLength() - 1);
- }
- //
- if (oldNodes.getLength() > 0) {
- firstOld = oldNodes.item(0);
- lastOld = oldNodes.item(oldNodes.getLength() - 1);
- if (firstOld != null)
- oldPrevious = firstOld.getPrevious();
- if (lastOld != null)
- oldNext = lastOld.getNext();
- }
- // handle switch
- if (newNodes.getLength() > 0) {
- // switch surrounding StructuredDocumentRegions' references to
- // lists
- if (oldPrevious != null)
- oldPrevious.setNext(firstNew);
- if (newPrevious != null)
- newPrevious.setNext(firstOld);
- if (oldNext != null)
- oldNext.setPrevious(lastNew);
- if (newNext != null)
- newNext.setPrevious(lastOld);
- // switch list pointers to surrounding StructuredDocumentRegions
- if (firstOld != null)
- firstOld.setPrevious(newPrevious);
- if (lastOld != null)
- lastOld.setNext(newNext);
- if (firstNew != null)
- firstNew.setPrevious(oldPrevious);
- if (lastNew != null)
- lastNew.setNext(oldNext);
- } else {
- // short circuit when there are no new nodes
- if (oldPrevious != null)
- oldPrevious.setNext(oldNext);
- if (oldNext != null)
- oldNext.setPrevious(oldPrevious);
- }
- //
- // SIDE EFFECTs
- // if we have oldNodes, and if oldNext or oldPrevious is null,
- // that means we are replacing
- // the lastNode or firstNode the structuredDocuments's chain of nodes,
- // so we need to update the structuredDocuments last or first Node
- // as the last or first of the new nodes.
- // (and sometimes even these will be null! such as when deleting all
- // text in a document).
- if ((oldNext == null) && (oldNodes.getLength() > 0)) {
- if (newNodes.getLength() > 0) {
- fStructuredDocument.setLastDocumentRegion(lastNew);
- } else {
- // in this case, the last node is being deleted, but not
- // replaced
- // with anything. In this case, we can just back up one
- // from the first old node
- fStructuredDocument.setLastDocumentRegion(firstOld.getPrevious());
- }
- }
- if ((oldPrevious == null) && (oldNodes.getLength() > 0)) {
- if (newNodes.getLength() > 0) {
- fStructuredDocument.setFirstDocumentRegion(firstNew);
- } else {
- // in this case the first node is being deleted, but not
- // replaced
- // with anything. So, we just go one forward past the last old
- // node.
- fStructuredDocument.setFirstDocumentRegion(lastOld.getNext());
- }
- }
- // as a tiny optimization, we return the first of the downstream
- // nodes,
- // if any
- return oldNext;
- }
-
- /**
- * The purpose of this method is to "reuse" the old container region, when
- * found to be same (so same instance doesn't change). The goal is to
- * "transform" the old region, so its equivelent to the newly parsed one.
- *
- */
- private ITextRegion swapNewForOldRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion, IStructuredDocumentRegion newNode, ITextRegion newRegion) {
- // makes the old region instance the correct size.
- oldRegion.equatePositions(newRegion);
- // adjusts old node instance appropriately
- oldNode.setLength(newNode.getLength());
- oldNode.setEnded(newNode.isEnded());
- // we do have to set the parent document, since the oldNode's
- // were set to a temporary one, then newNode's have the
- // right one.
- oldNode.setParentDocument(newNode.getParentDocument());
- // if we're transforming a container region, we need to be sure to
- // transfer the new embedded regions, to the old parent
- // Note: if oldRegion hasEmbeddedRegions, then we know the
- // newRegion does too, since we got here because they were the
- // same type.
- if (isCollectionRegion(oldRegion)) { // ||
- // hasContainerRegions(oldRegion))
- // {
- transferEmbeddedRegions(oldNode, (ITextRegionContainer) oldRegion, (ITextRegionContainer) newRegion);
- }
- return oldRegion;
- }
-
- private IStructuredDocumentRegion switchNodeLists(CoreNodeList oldNodes, CoreNodeList newNodes) {
- IStructuredDocumentRegion result = splice(oldNodes, newNodes);
- // ensure that the old nodes hold no references to the existing model
- if (oldNodes.getLength() > 0) {
- IStructuredDocumentRegion firstItem = oldNodes.item(0);
- firstItem.setPrevious(null);
- IStructuredDocumentRegion lastItem = oldNodes.item(oldNodes.getLength() - 1);
- lastItem.setNext(null);
- }
- return result;
- }
-
- /**
- * The purpose of this method is to "reuse" the old container region, when
- * found to be same (so same instance doesn't change). The goal is to
- * "transform" the old region, so its equivelent to the newly parsed one.
- *
- */
- private void transferEmbeddedRegions(IStructuredDocumentRegion oldNode, ITextRegionContainer oldRegion, ITextRegionContainer newRegion) {
- // the oldRegion should already have the right parent, since
- // we got here because all's equivelent except the region
- // postions have changed.
- //oldRegion.setParent(newRegion.getParent());
- // but we should check if there's "nested" embedded regions, and if
- // so, we can just move them over. setting their parent as this old
- // region.
- ITextRegionList newRegionsToTransfer = newRegion.getRegions();
- oldRegion.setRegions(newRegionsToTransfer);
- Iterator newRegionsInOldOne = newRegionsToTransfer.iterator();
- while (newRegionsInOldOne.hasNext()) {
- ITextRegion newOne = (ITextRegion) newRegionsInOldOne.next();
- if (isCollectionRegion(newOne)) { // ||
- // hasContainerRegions(newOne)) {
- //((ITextRegionContainer) newOne).setParent(oldRegion);
- oldRegion.setRegions(newRegion.getRegions());
- }
- }
- }
-
- private void updateDownStreamRegions(IStructuredDocumentRegion flatNode, ITextRegion lastKnownRegion) {
- // so all regions after the last known region (last known to be ok)
- // have to have their start and end values adjusted.
- ITextRegionList regions = flatNode.getRegions();
- int listLength = regions.size();
- int startIndex = 0;
- // first, loop through to find where to start
- for (int i = 0; i < listLength; i++) {
- ITextRegion region = regions.get(i);
- if (region == lastKnownRegion) {
- startIndex = i;
- break;
- }
- }
- // now, beginning one past the last known one, loop
- // through to end of list, adjusting the start and end postions.
- startIndex++;
- for (int j = startIndex; j < listLength; j++) {
- ITextRegion region = regions.get(j);
- region.adjustStart(fLengthDifference);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java
deleted file mode 100644
index 11911984e7..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java
+++ /dev/null
@@ -1,87 +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.sse.core.internal.text;
-
-
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-
-
-public class StructuredDocumentRegionEnumeration implements Enumeration {
-
- private int count;
- private IStructuredDocumentRegion head;
- private IStructuredDocumentRegion oldHead;
-
- /**
- * StructuredDocumentRegionEnumeration constructor comment.
- */
- public StructuredDocumentRegionEnumeration(IStructuredDocumentRegion newHead) {
- super();
- IStructuredDocumentRegion countNode = head = newHead;
- while (countNode != null) {
- count++;
- countNode = countNode.getNext();
- }
- if (Debug.DEBUG > 5) {
- System.out.println("N Nodes in StructuredDocumentRegionEnumeration Contructor: " + count); //$NON-NLS-1$
- }
- }
-
- /**
- * StructuredDocumentRegionEnumeration constructor comment.
- */
- public StructuredDocumentRegionEnumeration(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
- super();
- IStructuredDocumentRegion countNode = head = start;
- if ((start == null) || (end == null)) {
- // error condition
- count = 0;
- return;
- }
- //If both nodes are non-null, we assume there is always at least one
- // item
- count = 1;
- while (countNode != end) {
- count++;
- countNode = countNode.getNext();
- }
- if (org.eclipse.wst.sse.core.internal.util.Debug.DEBUG > 5) {
- System.out.println("N Nodes in StructuredDocumentRegionEnumeration Contructor: " + count); //$NON-NLS-1$
- }
- }
-
- /**
- * hasMoreElements method comment.
- */
- public synchronized boolean hasMoreElements() {
- return count > 0;
- }
-
- /**
- * nextElement method comment.
- */
- public synchronized Object nextElement() {
- if (count > 0) {
- count--;
- oldHead = head;
- head = head.getNext();
- return oldHead;
- }
- throw new NoSuchElementException("StructuredDocumentRegionEnumeration"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java
deleted file mode 100644
index c121b31ad0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java
+++ /dev/null
@@ -1,115 +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.sse.core.internal.text;
-
-
-
-import java.util.Vector;
-
-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.Assert;
-
-
-public class StructuredDocumentRegionIterator {
-
- public final static IStructuredDocumentRegion adjustStart(IStructuredDocumentRegion headNode, int adjustment) {
- IStructuredDocumentRegion aNode = headNode;
- while (aNode != null) {
- aNode.adjustStart(adjustment);
- aNode = aNode.getNext();
- }
- return headNode;
- }
-
- public final static int countRegions(IStructuredDocumentRegionList flatNodes) {
- int result = 0;
- if (flatNodes != null) {
- int length = flatNodes.getLength();
- for (int i = 0; i < length; i++) {
- IStructuredDocumentRegion node = flatNodes.item(i);
- // don't know why, but we're getting null pointer exceptions
- // in this method
- if (node != null) {
- result = result + node.getNumberOfRegions();
- }
- }
- }
- return result;
- }
-
- public final static String getText(CoreNodeList flatNodes) {
- String result = null;
- if (flatNodes == null) {
- result = ""; //$NON-NLS-1$
- } else {
- StringBuffer buff = new StringBuffer();
- //IStructuredDocumentRegion aNode = null;
- int length = flatNodes.getLength();
- for (int i = 0; i < length; i++) {
- buff.append(flatNodes.item(i).getText());
- }
- result = buff.toString();
- }
- return result;
- }
-
- public final static CoreNodeList setParentDocument(CoreNodeList nodelist, IStructuredDocument textStore) {
- Assert.isNotNull(nodelist, "nodelist was null in CoreNodeList::setTextStore(CoreNodeList, StructuredTextStore)"); //$NON-NLS-1$
- int len = nodelist.getLength();
- for (int i = 0; i < len; i++) {
- IStructuredDocumentRegion node = nodelist.item(i);
- //Assert.isNotNull(node, "who's putting null in the node list? in
- // CoreNodeList::setTextStore(CoreNodeList,
- // StructuredTextStore)"); //$NON-NLS-1$
- node.setParentDocument(textStore);
- }
- return nodelist;
- }
-
- // public final static IStructuredDocumentRegion
- // setStructuredDocument(IStructuredDocumentRegion headNode,
- // BasicStructuredDocument structuredDocument) {
- // IStructuredDocumentRegion aNode = headNode;
- // while (aNode != null) {
- // aNode.setParentDocument(structuredDocument);
- // aNode = (IStructuredDocumentRegion) aNode.getNext();
- // }
- // return headNode;
- // }
- public final static IStructuredDocumentRegion setParentDocument(IStructuredDocumentRegion headNode, IStructuredDocument document) {
- IStructuredDocumentRegion aNode = headNode;
- while (aNode != null) {
- aNode.setParentDocument(document);
- aNode = aNode.getNext();
- }
- return headNode;
- }
-
- public final static Vector toVector(IStructuredDocumentRegion headNode) {
- IStructuredDocumentRegion aNode = headNode;
- Vector v = new Vector();
- while (aNode != null) {
- v.addElement(aNode);
- aNode = aNode.getNext();
- }
- return v;
- }
-
- /**
- *
- */
- private StructuredDocumentRegionIterator() {
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java
deleted file mode 100644
index 5c31aa8094..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import org.eclipse.jface.text.ITextStore;
-import org.eclipse.jface.text.SequentialRewriteTextStore;
-
-public class StructuredDocumentSequentialRewriteTextStore extends SequentialRewriteTextStore implements CharSequence, IRegionComparible {
-
- /**
- * @param source
- */
- public StructuredDocumentSequentialRewriteTextStore(ITextStore source) {
- super(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#charAt(int)
- */
- public char charAt(int index) {
- return get(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#length()
- */
- public int length() {
- return getLength();
- }
-
- /**
- * @param c
- * @param d
- * @return
- */
- private boolean matchesIgnoreCase(char c1, char c2) {
- // we check both case conversions to handle those few cases,
- // in languages such as Turkish, which have some characters
- // which sort of have 3 cases.
- boolean result = false;
- if (Character.toUpperCase(c1) == Character.toUpperCase(c2))
- result = true;
- else if (Character.toLowerCase(c1) == Character.toLowerCase(c2))
- result = true;
- return result;
- }
-
- public boolean regionMatches(int offset, int length, String stringToCompare) {
- boolean result = false;
- int compareLength = stringToCompare.length();
- if (compareLength == length) {
- int endOffset = offset + length;
- if (endOffset <= length()) {
- result = regionMatches(offset, stringToCompare);
- }
- }
-
- return result;
- }
-
- /**
- * This method assumes all lengths have been checked and fall withint
- * exceptable limits
- *
- * @param offset
- * @param stringToCompare
- * @return
- */
- private boolean regionMatches(int offset, String stringToCompare) {
- boolean result = true;
- int stringOffset = 0;
- int len = stringToCompare.length();
- for (int i = offset; i < len; i++) {
- if (charAt(i) != stringToCompare.charAt(stringOffset++)) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
- boolean result = false;
- int compareLength = stringToCompare.length();
- if (compareLength == length) {
- int endOffset = offset + length;
- if (endOffset <= length()) {
- result = regionMatchesIgnoreCase(offset, stringToCompare);
- }
- }
-
- return result;
- }
-
- private boolean regionMatchesIgnoreCase(int offset, String stringToCompare) {
- boolean result = true;
- int stringOffset = 0;
- int len = stringToCompare.length();
- for (int i = offset; i < len; i++) {
- if (!matchesIgnoreCase(charAt(i), stringToCompare.charAt(stringOffset++))) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#subSequence(int, int)
- */
- public CharSequence subSequence(int start, int end) {
-
- return get(start, end - start);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java
deleted file mode 100644
index e825e72054..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java
+++ /dev/null
@@ -1,191 +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
- * Viacheslav Kabanovich/Exadel 97817 Wrong algoritm in class StructuredDocumentTextStore
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=97817
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import org.eclipse.jface.text.GapTextStore;
-import org.eclipse.jface.text.ITextStore;
-
-public class StructuredDocumentTextStore implements ITextStore, CharSequence, IRegionComparible {
-
- private GapTextStore fInternalStore;
-
- /**
- *
- */
- public StructuredDocumentTextStore() {
- this(50, 300);
- }
-
- /**
- * @param lowWatermark
- * @param highWatermark
- */
- public StructuredDocumentTextStore(int lowWatermark, int highWatermark) {
- super();
- fInternalStore = new GapTextStore(lowWatermark, highWatermark);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#charAt(int)
- */
- public char charAt(int index) {
- return fInternalStore.get(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextStore#get(int)
- */
- public char get(int offset) {
-
- return fInternalStore.get(offset);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextStore#get(int, int)
- */
- public String get(int offset, int length) {
-
- return fInternalStore.get(offset, length);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextStore#getLength()
- */
- public int getLength() {
-
- return fInternalStore.getLength();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#length()
- */
- public int length() {
-
- return fInternalStore.getLength();
- }
-
- private boolean matchesIgnoreCase(char c1, char c2) {
- // we check both case conversions to handle those few cases,
- // in languages such as Turkish, which have some characters
- // which sort of have 3 cases.
- boolean result = false;
- if (Character.toUpperCase(c1) == Character.toUpperCase(c2))
- result = true;
- else if (Character.toLowerCase(c1) == Character.toLowerCase(c2))
- result = true;
- return result;
- }
-
- public boolean regionMatches(int offset, int length, String stringToCompare) {
- boolean result = false;
- int compareLength = stringToCompare.length();
- if (compareLength == length) {
- int endOffset = offset + length;
- if (endOffset <= length()) {
- result = regionMatches(offset, stringToCompare);
- }
- }
-
- return result;
- }
-
- /**
- * This method assumes all lengths have been checked and fall withint
- * exceptable limits
- *
- * @param offset
- * @param stringToCompare
- * @return
- */
- private boolean regionMatches(int offset, String stringToCompare) {
- boolean result = true;
- int stringOffset = 0;
- int end = offset + stringToCompare.length();
- for (int i = offset; i < end; i++) {
- if (charAt(i) != stringToCompare.charAt(stringOffset++)) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
- boolean result = false;
- int compareLength = stringToCompare.length();
- if (compareLength == length) {
- int endOffset = offset + length;
- if (endOffset <= length()) {
- result = regionMatchesIgnoreCase(offset, stringToCompare);
- }
- }
-
- return result;
- }
-
- private boolean regionMatchesIgnoreCase(int offset, String stringToCompare) {
- boolean result = true;
- int stringOffset = 0;
- int end = offset + stringToCompare.length();
- for (int i = offset; i < end; i++) {
- if (!matchesIgnoreCase(charAt(i), stringToCompare.charAt(stringOffset++))) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextStore#replace(int, int,
- * java.lang.String)
- */
- public void replace(int offset, int length, String text) {
- fInternalStore.replace(offset, length, text);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
- */
- public void set(String text) {
- fInternalStore.set(text);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.CharSequence#subSequence(int, int)
- */
- public CharSequence subSequence(int start, int end) {
- // convert 'end' to 'length'
- return fInternalStore.get(start, end - start);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java
deleted file mode 100644
index caca8b9284..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-/**
- * This is a convience or utility class that allows you to make a copy of a
- * part of a larger text store, but have the copy behave as if it was the
- * larger text store.
- *
- * In other words, it provides a subset of a larger document, that "looks like"
- * the orginal document. That is, "looks like" in terms of offsets and lengths.
- * Valid access can only be made to data between the orignal offsets, even
- * though those offsets are in the same units at the original, and even though
- * the length appears to be long.
- *
- * For example, if a subsettext store is created for the def part of abcdefgh,
- * then get(3,5) is valid, getLength is 8. Any other access, such as
- * getChar(2), would be invalid.
- */
-import org.eclipse.jface.text.ITextStore;
-
-/**
- * Similar to basics of IDocument, but the offsets are mapped from coordinates
- * of underlying storage to a "virtual" document.
- */
-public class SubSetTextStore implements ITextStore {
- private int pseudoBeginOffset; // maps to "zero" postion of new text
- //private int pseudoEndOffset;
- private int pseudoLength; // length of old/original document
- private StringBuffer stringBuffer = new StringBuffer();
-
- /**
- * SubSetTextStore constructor comment.
- *
- * @param initialContent
- * java.lang.String
- */
- public SubSetTextStore(String initialContent, int beginOffset, int endOffset, int originalDocumentLength) {
- super();
- pseudoBeginOffset = beginOffset;
- //pseudoEndOffset = endOffset;
- // used to be originalDocument.getLength ... not sure if used, or
- // which
- // is right
- pseudoLength = originalDocumentLength;
- stringBuffer = new StringBuffer(initialContent);
- //set(initialContent);
- }
-
- // this is our "private" get, which methods in this class should
- // use to get using "real" coordinates of underlying representation.
- private String _get(int begin, int length) {
- char[] chars = new char[length];
- int srcEnd = begin + length;
- stringBuffer.getChars(begin, srcEnd, chars, 0);
- return new String(chars);
- }
-
- public char get(int offset) {
- return stringBuffer.charAt(offset - pseudoBeginOffset);
- }
-
- /**
- * @return java.lang.String
- * @param begin
- * int
- * @param end
- * int
- */
- public String get(int begin, int length) {
- // remap the begin and end to "appear" to be in the
- // same coordinates of the original parentDocument
- return _get(begin - pseudoBeginOffset, length);
- }
-
- /**
- * @return java.lang.String
- * @param begin
- * int
- * @param end
- * int
- */
- public char getChar(int pos) {
- // remap the begin and end to "appear" to be in the
- // same coordinates of the original parentDocument
- return get(pos - pseudoBeginOffset);
- }
-
- /**
- * We redefine getLength so its not the true length of this sub-set
- * document, but the length of the original. This is needed, as a simple
- * example, if you want to see if the pseudo end is equal the last
- * position of the original document.
- */
- public int getLength() {
- return pseudoLength;
- }
-
- /**
- * Returns the length as if considered a true, standalone document
- */
- public int getTrueLength() {
- return stringBuffer.length();
- }
-
- public void replace(int begin, int length, String changes) {
- // remap the begin and end to "appear" to be in the
- // same coordinates of the original parentDocument
- int end = begin + length;
- stringBuffer.replace(begin - pseudoBeginOffset, end, changes);
- }
-
- public void set(String text) {
- stringBuffer.setLength(0);
- stringBuffer.append(text);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
deleted file mode 100644
index 9f62b78323..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300434 - Make inner classes static where possible
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public class TextRegionListImpl implements ITextRegionList {
-
- static private class NullIterator implements Iterator {
- public NullIterator() {
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
- }
-
- }
-
- private static class RegionIterator implements Iterator {
- private ITextRegion[] fIteratorRegions;
- private int index = -1;
- private int maxindex = -1;
-
- public RegionIterator(ITextRegion[] regions) {
- fIteratorRegions = regions;
- maxindex = fIteratorRegions.length - 1;
- }
-
- public boolean hasNext() {
- return index < maxindex;
- }
-
- public Object next() {
- if (!(index < maxindex))
- throw new NoSuchElementException();
- return fIteratorRegions[++index];
- }
-
- public void remove() {
- if (index < 0) {
- // next() has never been called
- throw new IllegalStateException("can not remove regions without prior invocation of next()"); //$NON-NLS-1$
- }
- throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
- }
-
- }
-
- private final static int growthConstant = 2;
-
- private ITextRegion[] fRegions;
- private int fRegionsCount = 0;
-
- public TextRegionListImpl() {
- super();
- }
-
- public TextRegionListImpl(ITextRegionList regionList) {
- this();
- fRegions = (ITextRegion[]) regionList.toArray().clone();
- fRegionsCount = fRegions.length;
- }
-
- public boolean add(ITextRegion region) {
- if (region == null)
- return false;
- ensureCapacity(fRegionsCount + 1);
- fRegions[fRegionsCount++] = region;
- return true;
- }
-
- public boolean addAll(int insertPos, ITextRegionList newRegionList) {
- // beginning of list is 0 to insertPos-1
- // remainder of list is insertPos to fRegionsCount
- // resulting total will be be fRegionsCount + newRegions.size()
- if (insertPos < 0 || insertPos > fRegionsCount) {
- throw new ArrayIndexOutOfBoundsException(insertPos);
- }
-
- int newRegionListSize = newRegionList.size();
-
- ensureCapacity(fRegionsCount + newRegionListSize);
-
- int numMoved = fRegionsCount - insertPos;
- if (numMoved > 0)
- System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionListSize, numMoved);
-
- if (newRegionList instanceof TextRegionListImpl && ((TextRegionListImpl) newRegionList).fRegions != null) {
- System.arraycopy(((TextRegionListImpl) newRegionList).fRegions, 0, fRegions, insertPos, newRegionListSize);
- }
- else {
- for (int i = 0; i < newRegionListSize; i++) {
- fRegions[insertPos++] = newRegionList.get(i);
- }
- }
- fRegionsCount += newRegionListSize;
- return newRegionListSize != 0;
- }
-
- public void clear() {
- // note: size of array is not reduced!
- fRegionsCount = 0;
- }
-
- private void ensureCapacity(int needed) {
- if (fRegions == null) {
- // first time
- fRegions = new ITextRegion[needed];
- return;
- }
- int oldLength = fRegions.length;
- if (oldLength < needed) {
- ITextRegion[] oldAdapters = fRegions;
- ITextRegion[] newAdapters = new ITextRegion[needed + growthConstant];
- System.arraycopy(oldAdapters, 0, newAdapters, 0, fRegionsCount);
- fRegions = newAdapters;
- }
- }
-
- public ITextRegion get(int index) {
- // fRegionCount may not equal fRegions.length
- if (index < 0 || index >= fRegionsCount) {
- throw new ArrayIndexOutOfBoundsException(index);
- }
- return fRegions[index];
- }
-
- public int indexOf(ITextRegion region) {
- int result = -1;
- if (region != null) {
- if (fRegions != null) {
- for (int i = 0; i < fRegions.length; i++) {
- if (region.equals(fRegions[i])) {
- result = i;
- break;
- }
- }
- }
- }
- return result;
- }
-
- public boolean isEmpty() {
- return fRegionsCount == 0;
- }
-
- public Iterator iterator() {
- if (size() == 0) {
- return new NullIterator();
- } else {
- return new RegionIterator(toArray());
- }
- }
-
- public ITextRegion remove(int index) {
- // much more efficient ways to implement this, but
- // I doubt if called often
- ITextRegion oneToRemove = get(index);
- remove(oneToRemove);
- return oneToRemove;
- }
-
- public void remove(ITextRegion a) {
- if (fRegions == null || a == null)
- return;
- int newIndex = 0;
- ITextRegion[] newRegions = new ITextRegion[fRegionsCount];
- int oldRegionCount = fRegionsCount;
- boolean found = false;
- for (int oldIndex = 0; oldIndex < oldRegionCount; oldIndex++) {
- ITextRegion candidate = fRegions[oldIndex];
- if (a == candidate) {
- fRegionsCount--;
- found = true;
- } else
- newRegions[newIndex++] = fRegions[oldIndex];
- }
- if (found)
- fRegions = newRegions;
- }
-
- public void removeAll(ITextRegionList regionList) {
- // much more efficient ways to implement this, but
- // I doubt if called often
- if (regionList != null) {
- for (int i = 0; i < regionList.size(); i++) {
- this.remove(regionList.get(i));
- }
- }
-
- }
-
- public int size() {
- return fRegionsCount;
- }
-
- public ITextRegion[] toArray() {
- // return "clone" of internal array
- ITextRegion[] newArray = new ITextRegion[fRegionsCount];
- System.arraycopy(fRegions, 0, newArray, 0, fRegionsCount);
- return newArray;
- }
-
- public void trimToSize() {
- if (fRegions.length > fRegionsCount) {
- ITextRegion[] newRegions = new ITextRegion[fRegionsCount];
- System.arraycopy(fRegions, 0, newRegions, 0, fRegionsCount);
- fRegions = newRegions;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java
deleted file mode 100644
index f12b76ab49..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java
+++ /dev/null
@@ -1,27 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.IRegion;
-
-/**
- * Like super class except allows length and offset to be modified. This is
- * convenient for some algorithms, and allows region objects to be reused.
- * Note: There MIGHT be some code that assumes regions are immutable. This
- * class would not be appropriate for those uses.
- */
-public interface IStructuredRegion extends IRegion {
- void setLength(int length);
-
- void setOffset(int offset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java
deleted file mode 100644
index 1ea21a9851..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.ITypedRegion;
-
-/**
- * Similar to extended interface, except it allows the length, offset, and
- * type to be set. This is useful when iterating through a number of "small"
- * regions, that all map to the the same partion regions.
- */
-public interface IStructuredTypedRegion extends IStructuredRegion, ITypedRegion {
- void setType(String partitionType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java
deleted file mode 100644
index 4ca1ded47b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java
+++ /dev/null
@@ -1,91 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.IRegion;
-
-
-
-/**
- * Similar to jface region except we wanted a setting on length
- */
-public class SimpleStructuredRegion implements IStructuredRegion {
- /** The region length */
- private int fLength;
-
- /** The region offset */
- private int fOffset;
-
- /**
- * Create a new region.
- *
- * @param offset
- * the offset of the region
- * @param length
- * the length of the region
- */
- public SimpleStructuredRegion(int offset, int length) {
- fOffset = offset;
- fLength = length;
- }
-
- /**
- * Two regions are equal if they have the same offset and length.
- *
- * @see Object#equals
- */
- public boolean equals(Object o) {
- if (o instanceof IRegion) {
- IRegion r = (IRegion) o;
- return r.getOffset() == fOffset && r.getLength() == fLength;
- }
- return false;
- }
-
- /*
- * @see IRegion#getLength
- */
- public int getLength() {
- return fLength;
- }
-
- /*
- * @see IRegion#getOffset
- */
- public int getOffset() {
- return fOffset;
- }
-
- /**
- * @see Object#hashCode hascode is overridden since we provide our own
- * equals.
- */
- public int hashCode() {
- return (fOffset << 24) | (fLength << 16);
- }
-
- /**
- * Sets the length.
- *
- * @param length
- * The length to set
- */
- public void setLength(int length) {
- fLength = length;
- }
-
- public void setOffset(int offset) {
- fOffset = offset;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java
deleted file mode 100644
index 1822a8a4d8..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java
+++ /dev/null
@@ -1,88 +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.sse.core.internal.text.rules;
-
-
-
-
-/**
- * Similar jace TypedRegion, but had to subclass our version which allowed
- * length to be set.
- */
-public class SimpleStructuredTypedRegion extends SimpleStructuredRegion implements IStructuredTypedRegion {
-
- /** The region's type */
- private String fType;
-
- /**
- * Creates a typed region based on the given specification.
- *
- * @param offset
- * the region's offset
- * @param length
- * the region's length
- * @param type
- * the region's type
- */
- public SimpleStructuredTypedRegion(int offset, int length, String type) {
- super(offset, length);
- fType = type;
- }
-
- /**
- * Two typed positions are equal if they have the same offset, length, and
- * type.
- *
- * @see Object#equals
- */
- public boolean equals(Object o) {
- if (o instanceof SimpleStructuredTypedRegion) {
- SimpleStructuredTypedRegion r = (SimpleStructuredTypedRegion) o;
- return super.equals(r) && ((fType == null && r.getType() == null) || fType.equals(r.getType()));
- }
- return false;
- }
-
- /*
- * @see ITypedRegion#getType()
- */
- public String getType() {
- return fType;
- }
-
- /*
- * @see Object#hashCode
- */
- public int hashCode() {
- int type = fType == null ? 0 : fType.hashCode();
- return super.hashCode() | type;
- }
-
- public void setType(String type) {
- fType = type;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer s = new StringBuffer();
- s.append(getOffset());
- s.append(":"); //$NON-NLS-1$
- s.append(getLength());
- s.append(" - "); //$NON-NLS-1$
- s.append(getType());
- return s.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
deleted file mode 100644
index 445e5f27f5..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text.rules;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.ltk.parser.IBlockedStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-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.IStructuredTextPartitioner;
-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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-
-
-/**
- * Base Document partitioner for StructuredDocuments. BLOCK_TEXT ITextRegions
- * have a partition type of BLOCK or BLOCK:TAGNAME if a surrounding tagname
- * was recorded.
- *
- * Subclasses should synchronize access to <code>internalReusedTempInstance</code> using the lock
- * <code>PARTITION_LOCK</code>.
- */
-public class StructuredTextPartitioner implements IDocumentPartitioner, IStructuredTextPartitioner {
-
- static class CachedComputedPartitions {
- int fLength;
- int fOffset;
- ITypedRegion[] fPartitions;
- boolean isInValid;
-
- CachedComputedPartitions(int offset, int length, ITypedRegion[] partitions) {
- fOffset = offset;
- fLength = length;
- fPartitions = partitions;
- isInValid = true;
- }
- }
-
- private CachedComputedPartitions cachedPartitions = new CachedComputedPartitions(-1, -1, null);
- protected String[] fSupportedTypes = null;
- protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitions.DEFAULT_PARTITION);
- protected IStructuredDocument fStructuredDocument;
-
- protected final Object PARTITION_LOCK = new Object();
-
- /**
- * StructuredTextPartitioner constructor comment.
- */
- public StructuredTextPartitioner() {
- super();
- }
-
- /**
- * Returns the partitioning of the given range of the connected document.
- * There must be a document connected to this partitioner.
- *
- * Note: this shouldn't be called directly by clients, unless they control
- * the threading that includes modifications to the document. Otherwise
- * the document could be modified while partitions are being computed. We
- * advise that clients use the computePartitions API directly from the
- * document, so they won't have to worry about that.
- *
- * @param offset
- * the offset of the range of interest
- * @param length
- * the length of the range of interest
- * @return the partitioning of the range
- */
- public ITypedRegion[] computePartitioning(int offset, int length) {
- if (fStructuredDocument == null) {
- throw new IllegalStateException("document partitioner is not connected"); //$NON-NLS-1$
- }
- ITypedRegion[] results = null;
-
- synchronized (cachedPartitions) {
- if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength))
- results = cachedPartitions.fPartitions;
- }
-
- if (results == null) {
- if (length == 0) {
- results = new ITypedRegion[]{getPartition(offset)};
- } else {
- List list = new ArrayList();
- int endPos = offset + length;
- if (endPos > fStructuredDocument.getLength()) {
- // This can occur if the model instance is being
- // changed
- // and everyone's not yet up to date
- return new ITypedRegion[]{createPartition(offset, length, getUnknown())};
- }
- int currentPos = offset;
- IStructuredTypedRegion previousPartition = null;
- while (currentPos < endPos) {
- IStructuredTypedRegion partition = null;
- synchronized (PARTITION_LOCK) {
- internalGetPartition(currentPos, false);
- currentPos += internalReusedTempInstance.getLength();
-
- // check if this partition just continues last one
- // (type is the same),
- // if so, just extend length of last one, not need to
- // create new
- // instance.
- if (previousPartition != null && internalReusedTempInstance.getType().equals(previousPartition.getType())) {
- // same partition type
- previousPartition.setLength(previousPartition.getLength() + internalReusedTempInstance.getLength());
- }
- else {
- // not the same, so add to list
- partition = createNewPartitionInstance();
- }
- }
- if (partition != null) {
- list.add(partition);
- // and make current, previous
- previousPartition = partition;
- }
- }
- results = new ITypedRegion[list.size()];
- list.toArray(results);
- }
- if (results.length > 0) {
- // truncate returned results to requested range
- if (results[0].getOffset() < offset && results[0] instanceof IStructuredRegion) {
- ((IStructuredRegion) results[0]).setOffset(offset);
- }
- int lastEnd = results[results.length - 1].getOffset() + results[results.length - 1].getLength();
- if (lastEnd > offset + length && results[results.length - 1] instanceof IStructuredRegion) {
- ((IStructuredRegion) results[results.length - 1]).setLength(offset + length - results[results.length - 1].getOffset());
- }
- }
- synchronized (cachedPartitions) {
- cachedPartitions.fLength = length;
- cachedPartitions.fOffset = offset;
- cachedPartitions.fPartitions = results;
- cachedPartitions.isInValid = false;
- }
- }
- return results;
- }
-
- private void invalidatePartitionCache() {
- synchronized (cachedPartitions) {
- cachedPartitions.isInValid = true;
- }
- }
-
- /**
- * Connects the document to the partitioner, i.e. indicates the begin of
- * the usage of the receiver as partitioner of the given document.
- */
- public synchronized void connect(IDocument document) {
- if (document instanceof IStructuredDocument) {
- invalidatePartitionCache();
- this.fStructuredDocument = (IStructuredDocument) document;
- } else {
- throw new IllegalArgumentException("This class and API are for Structured Documents only"); //$NON-NLS-1$
- }
- }
-
- /**
- * Determines if the given ITextRegionContainer itself contains another
- * ITextRegionContainer
- *
- * @param ITextRegionContainer
- * @return boolean
- */
- protected boolean containsEmbeddedRegion(IStructuredDocumentRegion container) {
- boolean containsEmbeddedRegion = false;
-
- ITextRegionList regions = container.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region instanceof ITextRegionContainer) {
- containsEmbeddedRegion = true;
- break;
- }
- }
- return containsEmbeddedRegion;
- }
-
- private IStructuredTypedRegion createNewPartitionInstance() {
- synchronized (PARTITION_LOCK) {
- return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
- }
- }
-
- /**
- * Creates the concrete partition from the given values. Returns a new
- * instance for each call.
- *
- * Subclasses may override.
- *
- * @param offset
- * @param length
- * @param type
- * @return ITypedRegion
- *
- * TODO: should be protected
- */
- public IStructuredTypedRegion createPartition(int offset, int length, String type) {
- return new SimpleStructuredTypedRegion(offset, length, type);
- }
-
- /**
- * Disconnects the document from the partitioner, i.e. indicates the end
- * of the usage of the receiver as partitioner of the given document.
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
- */
- public synchronized void disconnect() {
- invalidatePartitionCache();
- this.fStructuredDocument = null;
- }
-
- /**
- * Informs about a forthcoming document change.
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- invalidatePartitionCache();
- }
-
- /**
- * The document has been changed. The partitioner updates the set of
- * regions and returns whether the structure of the document partitioning
- * has been changed, i.e. whether partitions have been added or removed.
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(DocumentEvent)
- */
- public boolean documentChanged(DocumentEvent event) {
- boolean result = false;
- if (event instanceof StructuredDocumentRegionsReplacedEvent) {
- // partitions don't always change while document regions do,
- // but that's the only "quick check" we have.
- // I'm not sure if something more sophisticated will be needed
- // in the future. (dmw, 02/18/04).
- result = true;
- }
- return result;
- }
-
- protected boolean doParserSpecificCheck(int offset, boolean partitionFound, IStructuredDocumentRegion sdRegion, IStructuredDocumentRegion previousStructuredDocumentRegion, ITextRegion next, ITextRegion previousStart) {
- // this (conceptually) abstract method is not concerned with
- // specific region types
- return false;
- }
-
- protected IStructuredDocumentRegion getParserSpecificPreviousRegion(IStructuredDocumentRegion currentRegion) {
- return currentRegion != null ? currentRegion.getPrevious() : null;
- }
-
- /**
- * Returns the content type of the partition containing the given
- * character position of the given document. The document has previously
- * been connected to the partitioner.
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
- */
- public String getContentType(int offset) {
- return getPartition(offset).getType();
- }
-
- /**
- * To be used by default!
- */
- public String getDefaultPartitionType() {
-
- return IStructuredPartitions.DEFAULT_PARTITION;
- }
-
- /**
- * Returns the set of all possible content types the partitioner supports.
- * I.e. Any result delivered by this partitioner may not contain a content
- * type which would not be included in this method's result.
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
- */
- public java.lang.String[] getLegalContentTypes() {
- if (fSupportedTypes == null) {
- initLegalContentTypes();
- }
- return fSupportedTypes;
- }
-
- /**
- * Returns the partition containing the given character position of the
- * given document. The document has previously been connected to the
- * partitioner.
- *
- * Note: this shouldn't be called directly by clients, unless they control
- * the threading that includes modifications to the document. Otherwise
- * the document could be modified while partitions are being computed. We
- * advise that clients use the getPartition API directly from the
- * document, so they won't have to worry about that.
- *
- *
- *
- * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
- */
- public ITypedRegion getPartition(int offset) {
- internalGetPartition(offset, true);
- return createNewPartitionInstance();
- }
-
- protected String getPartitionFromBlockedText(ITextRegion region, int offset, String result) {
- // parser sensitive code was moved to subclass for quick transition
- // this (conceptually) abstract version isn't concerned with blocked
- // text
-
- return result;
- }
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- String tagname = region.getSurroundingTag();
- String result = null;
- if (tagname != null) {
- result = "BLOCK:" + tagname.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
- } else {
- result = "BLOCK"; //$NON-NLS-1$
- }
- return result;
- }
-
-
- protected String getPartitionType(IBlockedStructuredDocumentRegion blockedStructuredDocumentRegion, int offset) {
- String result = null;
- ITextRegionList regions = blockedStructuredDocumentRegion.getRegions();
-
- // regions should never be null, or hold zero regions, but just in
- // case...
- if (regions != null && regions.size() > 0) {
- if (regions.size() == 1) {
- // if only one, then its a "pure" blocked note.
- // if more than one, then must contain some embedded region
- // container
- ITextRegion blockedRegion = regions.get(0);
- // double check for code safefy, though should always be true
- if (blockedRegion instanceof ForeignRegion) {
- result = getPartitionType((ForeignRegion) blockedRegion, offset);
- }
- } else {
- // must have some embedded region container, so we'll make
- // sure we'll get the appropriate one
- result = getReleventRegionType(blockedStructuredDocumentRegion, offset);
- }
- }
- return result;
- }
-
- /**
- * Method getPartitionType.
- *
- * @param region
- * @return String
- */
- private String getPartitionType(ITextRegion region) {
- // if it get's to this "raw" level, then
- // must be default.
- return getDefaultPartitionType();
- }
-
- /**
- * Returns the partition based on region type. This basically maps from
- * one region-type space to another, higher level, region-type space.
- *
- * @param region
- * @param offset
- * @return String
- */
- public String getPartitionType(ITextRegion region, int offset) {
- String result = getDefaultPartitionType();
- // if (region instanceof ContextRegionContainer) {
- // result = getPartitionType((ITextRegionContainer) region, offset);
- // } else {
- if (region instanceof ITextRegionContainer) {
- result = getPartitionType((ITextRegionContainer) region, offset);
- }
-
- result = getPartitionFromBlockedText(region, offset, result);
-
- return result;
-
- }
-
- /**
- * Similar to method with 'ITextRegion' as argument, except for
- * RegionContainers, if it has embedded regions, then we need to drill
- * down and return DocumentPartition based on "lowest level" region type.
- * For example, in <body id=" <%= object.getID() %>" > The text between
- * <%= and %> would be a "java region" not an "HTML region".
- */
- protected String getPartitionType(ITextRegionContainer region, int offset) {
- // TODO this method needs to be 'cleaned up' after refactoring
- // its instanceof logic seems messed up now.
- String result = null;
- if (region != null) {
- ITextRegion coreRegion = region;
- if (coreRegion instanceof ITextRegionContainer) {
- result = getPartitionType((ITextRegionContainer) coreRegion, ((ITextRegionContainer) coreRegion).getRegions(), offset);
- } else {
- result = getPartitionType(region);
- }
- } else {
- result = getPartitionType((ITextRegion) region, offset);
- }
-
- return result;
- }
-
- private String getPartitionType(ITextRegionContainer coreRegion, ITextRegionList regions, int offset) {
- String result = null;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (coreRegion.containsOffset(region, offset)) {
- result = getPartitionType(region, offset);
- break;
- }
- }
- return result;
- }
-
- /**
- * Computes the partition type for the zero-length partition between a
- * start tag and end tag with the given name regions.
- *
- * @param previousStartTagNameRegion
- * @param nextEndTagNameRegion
- * @return String
- */
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
- return getDefaultPartitionType();
- }
-
- /**
- * Return the ITextRegion at the given offset. For most cases, this will
- * be the flatNode itself. Should it contain an embedded
- * ITextRegionContainer, will return the internal region at the offset
- *
- *
- * @param flatNode
- * @param offset
- * @return ITextRegion
- */
- private String getReleventRegionType(IStructuredDocumentRegion flatNode, int offset) {
- // * Note: the original form of this method -- which returned "deep"
- // region, isn't that
- // * useful, after doing parent elimination refactoring,
- // * since once the deep region is returned, its hard to get its text
- // or offset without
- // * proper parent.
- ITextRegion resultRegion = null;
- if (containsEmbeddedRegion(flatNode)) {
- resultRegion = flatNode.getRegionAtCharacterOffset(offset);
- if (resultRegion instanceof ITextRegionContainer) {
- resultRegion = flatNode.getRegionAtCharacterOffset(offset);
- ITextRegionList regions = ((ITextRegionContainer) resultRegion).getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (flatNode.getStartOffset(region) <= offset && offset < flatNode.getEndOffset(region)) {
- resultRegion = region;
- break;
- }
- }
- }
- } else {
- resultRegion = flatNode;
- }
- return resultRegion.getType();
- }
-
- /**
- * To be used, instead of default, when there is some thing surprising
- * about are attempt to partition
- */
- protected String getUnknown() {
- return IStructuredPartitions.UNKNOWN_PARTITION;
- }
-
- /**
- * to be abstract eventually
- */
- protected void initLegalContentTypes() {
- fSupportedTypes = new String[]{IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
- }
-
- /**
- * Returns the partition containing the given character position of the
- * given document. The document has previously been connected to the
- * partitioner. If the checkBetween parameter is true, an offset between a
- * start and end tag will return a zero-length region.
- */
- private void internalGetPartition(int offset, boolean checkBetween) {
- if (fStructuredDocument == null) {
- throw new IllegalStateException("document partitioner is not connected"); //$NON-NLS-1$
- }
-
- boolean partitionFound = false;
- int docLength = fStructuredDocument.getLength();
- // get document region type and map to partition type :
- // Note: a partion can be smaller than a flatnode, if that flatnode
- // contains a region container.
- // That's why we need to get "relevent region".
- IStructuredDocumentRegion structuredDocumentRegion = fStructuredDocument.getRegionAtCharacterOffset(offset);
- // flatNode is null if empty document
- // this is king of a "normal case" for empty document
- if (structuredDocumentRegion == null) {
- if (docLength == 0) {
- /*
- * In order to prevent infinite error loops, this partition
- * must never have a zero length unless the document is also
- * zero length
- */
- setInternalPartition(offset, 0, getDefaultPartitionType());
- partitionFound = true;
- }
- else {
- /*
- * This case is "unusual". When would region be null, and
- * document longer than 0. I think this means something's "out
- * of sync". And we may want to "flag" that fact and just
- * return one big region of 'unknown', instead of one
- * character at a time.
- */
- setInternalPartition(offset, 1, getUnknown());
- partitionFound = true;
- }
- }
- else if (checkBetween) {
- // dmw: minimizes out to the first if test above
- // if (structuredDocumentRegion == null && docLength == 0) {
- // // known special case for an empty document
- // setInternalPartition(offset, 0, getDefault());
- // partitionFound = true;
- // }
- // else
- if (structuredDocumentRegion.getStartOffset() == offset) {
- IStructuredDocumentRegion previousStructuredDocumentRegion = getParserSpecificPreviousRegion(structuredDocumentRegion);
- if (previousStructuredDocumentRegion != null) {
- ITextRegion next = structuredDocumentRegion.getRegionAtCharacterOffset(offset);
- ITextRegion previousStart = previousStructuredDocumentRegion.getRegionAtCharacterOffset(previousStructuredDocumentRegion.getStartOffset());
- partitionFound = doParserSpecificCheck(offset, partitionFound, structuredDocumentRegion, previousStructuredDocumentRegion, next, previousStart);
- }
- }
- }
-
- if (!partitionFound && structuredDocumentRegion != null) {
- /* We want the actual ITextRegion and not a possible ITextRegionCollection that
- * could be returned by IStructuredDocumentRegion#getRegionAtCharacterOffset
- * This allows for correct syntax highlighting and content assist.
- */
- DeepRegion resultRegion = getDeepRegionAtCharacterOffset(structuredDocumentRegion, offset);
- partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion.region, offset);
- if (!partitionFound) {
- if (resultRegion.region != null) {
- String type = getPartitionType(resultRegion.region, offset);
- setInternalPartition(offset, resultRegion.end - offset, type);
- } else {
- // can happen at EOF
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=224886
- // The unknown type was causing problems with content assist in JSP documents
- setInternalPartition(offset, 1, getDefaultPartitionType());
- }
- }
- }
- }
-
- private static class DeepRegion {
- int end;
- ITextRegion region;
- DeepRegion(ITextRegion r, int e) {
- region = r;
- end = e;
- }
- }
-
- /**
- * <p>Unlike {@link IStructuredDocumentRegion#getRegionAtCharacterOffset(int)} this will dig
- * into <code>ITextRegionCollection</code> to find the region containing the given offset</p>
- *
- * @param region the containing region of the given <code>offset</code>
- * @param offset to the overall offset in the document.
- * @return the <code>ITextRegion</code> containing the given <code>offset</code>, will never be
- * a <code>ITextRegionCollextion</code>
- */
- private DeepRegion getDeepRegionAtCharacterOffset(IStructuredDocumentRegion region, int offset) {
- ITextRegion text = region.getRegionAtCharacterOffset(offset);
- int end = region.getStartOffset();
- if (text != null)
- end += text.getStart();
- while (text instanceof ITextRegionCollection) {
- text = ((ITextRegionCollection) text).getRegionAtCharacterOffset(offset);
- end += text.getStart();
- }
- if (text != null)
- end += text.getLength();
- return new DeepRegion(text, end);
- }
-
- /**
- * Provides for a per-StructuredDocumentRegion override selecting the
- * partition type using more than just a single ITextRegion.
- *
- * @param structuredDocumentRegion
- * the StructuredDocumentRegion
- * @param containedChildRegion
- * an ITextRegion within the given StructuredDocumentRegion
- * that would normally determine the partition type by itself
- * @param offset
- * the document offset
- * @return true if the partition type will be overridden, false to
- * continue normal processing
- */
- protected boolean isDocumentRegionBasedPartition(IStructuredDocumentRegion structuredDocumentRegion, ITextRegion containedChildRegion, int offset) {
- return false;
- }
-
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitioner();
- }
-
- protected void setInternalPartition(int offset, int length, String type) {
- synchronized (PARTITION_LOCK) {
- internalReusedTempInstance.setOffset(offset);
- internalReusedTempInstance.setLength(length);
- internalReusedTempInstance.setType(type);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java
deleted file mode 100644
index 439cf5264e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.undo;
-
-
-
-public interface CommandCursorPosition {
-
- /**
- * Returns the cursor position to be set to after this command is redone.
- *
- * @return int
- */
- int getRedoCursorPosition();
-
- /**
- * Returns the length of text to be selected after this command is redone.
- *
- * @return int
- */
- int getRedoSelectionLength();
-
- /**
- * Returns the cursor position to be set to after this command is undone.
- *
- * @return int
- */
- int getUndoCursorPosition();
-
- /**
- * Returns the length of text to be selected after this command is undone.
- *
- * @return int
- */
- int getUndoSelectionLength();
-
- /**
- * Sets the cursor position to be used after this command is redone.
- */
- void setRedoCursorPosition(int cursorPosition);
-
- /**
- * Sets the length of text to be selected after this command is redone.
- */
- void setRedoSelectionLength(int selectionLength);
-
- /**
- * Sets the cursor position to be used after this command is undone.
- */
- void setUndoCursorPosition(int cursorPosition);
-
- /**
- * Sets the length of text to be selected after this command is undone.
- */
- void setUndoSelectionLength(int selectionLength);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java
deleted file mode 100644
index 56328844b0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal.undo;
-
-import org.eclipse.jface.text.IDocument;
-
-
-public interface IDocumentSelectionMediator {
- /**
- * Returns the document selection mediator's input document.
- *
- * @return the document selection mediator's input document
- */
- IDocument getDocument();
-
- /**
- * Sets a new selection in the document as a result of an undo operation.
- *
- * UndoDocumentEvent contains the requester of the undo operation, and the
- * offset and length of the new selection. Implementation of
- * IDocumentSelectionMediator can check if it's the requester that caused
- * the new selection, and decide if the new selection should be applied.
- */
- void undoOperationSelectionChanged(UndoDocumentEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java
deleted file mode 100644
index 80351ba5e5..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java
+++ /dev/null
@@ -1,155 +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.sse.core.internal.undo;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-
-public interface IStructuredTextUndoManager {
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, int cursorPosition, int selectionLength);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, int cursorPosition, int selectionLength);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, String description);
-
- /**
- * Begin recording undo transactions.
- */
- void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength);
-
- /**
- * Connect the mediator to the undo manager.
- */
- void connect(IDocumentSelectionMediator mediator);
-
- /**
- * Disable undo management.
- */
- void disableUndoManagement();
-
- /**
- * Disconnect the mediator from the undo manager.
- */
- void disconnect(IDocumentSelectionMediator mediator);
-
- /**
- * Enable undo management.
- */
- void enableUndoManagement();
-
- /**
- * End recording undo transactions.
- */
- void endRecording(Object requester);
-
- /**
- * End recording undo transactions.
- */
- void endRecording(Object requester, int cursorPosition, int selectionLength);
-
- /**
- * <p>
- * Normally, the undo manager can figure out the best times when to end a
- * pending command and begin a new one ... to the structure of a structued
- * document. There are times, however, when clients may wish to override
- * those algorithms and end one earlier than normal. The one known case is
- * for multipage editors. If a user is on one page, and type '123' as
- * attribute value, then click around to other parts of page, or different
- * pages, then return to '123|' and type 456, then "undo" they typically
- * expect the undo to just undo what they just typed, the 456, not the
- * whole attribute value.
- * <p>
- * If there is no pending command, the request is ignored.
- */
- public void forceEndOfPendingCommand(Object requester, int currentPosition, int length);
-
- /**
- * Some clients need to do complicated things with undo stack. Plus, in
- * some cases, if clients setCommandStack temporarily, they have
- * reponsibility to set back to original one when finished.
- */
- public CommandStack getCommandStack();
-
- /**
- * Get the redo command even if it's not committed yet.
- */
- Command getRedoCommand();
-
- /**
- * Get the undo command even if it's not committed yet.
- */
- Command getUndoCommand();
-
- /**
- * Redo the last command in the undo manager.
- */
- void redo();
-
- /**
- * Redo the last command in the undo manager and notify the requester
- * about the new selection.
- */
- void redo(IDocumentSelectionMediator requester);
-
- /**
- * Returns whether at least one text change can be repeated. A text change
- * can be repeated only if it was executed and rolled back.
- *
- * @return <code>true</code> if at least on text change can be repeated
- */
- boolean redoable();
-
- /**
- * Set the command stack.
- */
- void setCommandStack(CommandStack commandStack);
-
- /**
- * Undo the last command in the undo manager.
- */
- void undo();
-
- /**
- * Undo the last command in the undo manager and notify the requester
- * about the new selection.
- */
- void undo(IDocumentSelectionMediator requester);
-
- /**
- * Returns whether at least one text change can be rolled back.
- *
- * @return <code>true</code> if at least one text change can be rolled
- * back
- */
- boolean undoable();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java
deleted file mode 100644
index b085f5bc8b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java
+++ /dev/null
@@ -1,34 +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.sse.core.internal.undo;
-
-
-
-public interface StructuredTextCommand {
-
- String getTextDeleted();
-
- int getTextEnd();
-
- String getTextInserted();
-
- int getTextStart();
-
- void setTextDeleted(String textDeleted);
-
- void setTextEnd(int textEnd);
-
- void setTextInserted(String textInserted);
-
- void setTextStart(int textStart);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java
deleted file mode 100644
index 70f2bc2d32..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java
+++ /dev/null
@@ -1,137 +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.sse.core.internal.undo;
-
-
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public class StructuredTextCommandImpl extends AbstractCommand implements StructuredTextCommand {
-
- protected IDocument fDocument = null; // needed for updating the text
- protected String fTextDeleted = null;
- protected int fTextEnd = -1;
- protected String fTextInserted = null;
- protected int fTextStart = -1;
-
- /**
- * We have no-arg constructor non-public to force document to be specfied.
- *
- */
- protected StructuredTextCommandImpl() {
- super();
- }
-
- public StructuredTextCommandImpl(IDocument document) {
- this();
- fDocument = document; // needed for updating the text
- }
-
- public void execute() {
- }
-
- /**
- * getTextDeleted method comment.
- */
- public java.lang.String getTextDeleted() {
- return fTextDeleted;
- }
-
- /**
- * textEnd is the same as (textStart + textInserted.length())
- */
- public int getTextEnd() {
- return fTextEnd;
- }
-
- /**
- * getTextInserted method comment.
- */
- public java.lang.String getTextInserted() {
- return fTextInserted;
- }
-
- /**
- * getTextStart method comment.
- */
- public int getTextStart() {
- return fTextStart;
- }
-
- protected boolean prepare() {
- return true;
- }
-
- public void redo() {
- if (fDocument instanceof IStructuredDocument) {
- // note: one of the few places we programatically ignore read-only
- // settings
- ((IStructuredDocument) fDocument).replaceText(this, fTextStart, fTextDeleted.length(), fTextInserted, true);
- } else {
- try {
- fDocument.replace(fTextStart, fTextDeleted.length(), fTextInserted);
- } catch (BadLocationException e) {
- // assumed impossible, for now
- Logger.logException(e);
- }
- }
- }
-
- /**
- * setTextDeleted method comment.
- */
- public void setTextDeleted(java.lang.String textDeleted) {
- fTextDeleted = textDeleted;
- }
-
- /**
- * setTextEnd method comment.
- */
- public void setTextEnd(int textEnd) {
- fTextEnd = textEnd;
- }
-
- /**
- * setTextInserted method comment.
- */
- public void setTextInserted(java.lang.String textInserted) {
- fTextInserted = textInserted;
- }
-
- /**
- * setTextStart method comment.
- */
- public void setTextStart(int textStart) {
- fTextStart = textStart;
- }
-
- public void undo() {
- if (fDocument instanceof IStructuredDocument) {
- // note: one of the few places we programatically ignore read-only
- // settings
- ((IStructuredDocument) fDocument).replaceText(this, fTextStart, fTextInserted.length(), fTextDeleted, true);
- } else {
- try {
- fDocument.replace(fTextStart, fTextInserted.length(), fTextDeleted);
- } catch (BadLocationException e) {
- // assumed impossible, for now
- Logger.logException(e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java
deleted file mode 100644
index ddf76362b2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java
+++ /dev/null
@@ -1,260 +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.sse.core.internal.undo;
-
-
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-
-
-
-public class StructuredTextCompoundCommandImpl extends CompoundCommand implements CommandCursorPosition {
- protected int fRedoCursorPosition = -1;
- protected int fRedoSelectionLength = 0;
-
- protected int fUndoCursorPosition = -1;
- protected int fUndoSelectionLength = 0;
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- */
- public StructuredTextCompoundCommandImpl() {
- super();
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- */
- public StructuredTextCompoundCommandImpl(int resultIndex) {
- super(resultIndex);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(int resultIndex, java.util.List commandList) {
- super(resultIndex, commandList);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- */
- public StructuredTextCompoundCommandImpl(int resultIndex, String label) {
- super(resultIndex, label);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(int resultIndex, String label, java.util.List commandList) {
- super(resultIndex, label, commandList);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public StructuredTextCompoundCommandImpl(int resultIndex, String label, String description) {
- super(resultIndex, label, description);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(int resultIndex, String label, String description, java.util.List commandList) {
- super(resultIndex, label, description, commandList);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(java.util.List commandList) {
- super(commandList);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param label
- * java.lang.String
- */
- public StructuredTextCompoundCommandImpl(String label) {
- super(label);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param label
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(String label, java.util.List commandList) {
- super(label, commandList);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public StructuredTextCompoundCommandImpl(String label, String description) {
- super(label, description);
- }
-
- /**
- * StructuredTextCompoundCommandImpl constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public StructuredTextCompoundCommandImpl(String label, String description, java.util.List commandList) {
- super(label, description, commandList);
- }
-
- /**
- * Returns the cursor position to be set to after this command is redone.
- *
- * @return int
- */
- public int getRedoCursorPosition() {
- int cursorPosition = -1;
-
- if (fRedoCursorPosition != -1)
- cursorPosition = fRedoCursorPosition;
- else if (!commandList.isEmpty()) {
- int commandListSize = commandList.size();
- Command lastCommand = (Command) commandList.get(commandListSize - 1);
-
- if (lastCommand instanceof CommandCursorPosition)
- cursorPosition = ((CommandCursorPosition) lastCommand).getRedoCursorPosition();
- }
-
- return cursorPosition;
- }
-
- /**
- * Returns the length of text to be selected after this command is redone.
- *
- * @return int
- */
- public int getRedoSelectionLength() {
- return fRedoSelectionLength;
- }
-
- /**
- * Returns the cursor position to be set to after this command is undone.
- *
- * @return int
- */
- public int getUndoCursorPosition() {
- int cursorPosition = -1;
-
- if (fUndoCursorPosition != -1)
- cursorPosition = fUndoCursorPosition;
- else if (!commandList.isEmpty()) {
- // never used
- //int commandListSize = commandList.size();
- Command firstCommand = (Command) commandList.get(0);
-
- if (firstCommand instanceof CommandCursorPosition)
- cursorPosition = ((CommandCursorPosition) firstCommand).getUndoCursorPosition();
- }
-
- return cursorPosition;
- }
-
- /**
- * Returns the length of text to be selected after this command is undone.
- *
- * @return int
- */
- public int getUndoSelectionLength() {
- return fUndoSelectionLength;
- }
-
- /**
- * Sets the cursor position to be used after this command is redone.
- */
- public void setRedoCursorPosition(int cursorPosition) {
- fRedoCursorPosition = cursorPosition;
- }
-
- /**
- * Sets the length of text to be selected after this command is redone.
- */
- public void setRedoSelectionLength(int selectionLength) {
- fRedoSelectionLength = selectionLength;
- }
-
- /**
- * Sets the cursor position to be used after this command is undone.
- */
- public void setUndoCursorPosition(int cursorPosition) {
- fUndoCursorPosition = cursorPosition;
- }
-
- /**
- * Sets the length of text to be selected after this command is undone.
- */
- public void setUndoSelectionLength(int selectionLength) {
- fUndoSelectionLength = selectionLength;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
deleted file mode 100644
index 93a9b91b52..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Møller - initial IDocumentExtension4 support - #102822
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.undo;
-
-import java.util.EventObject;
-
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.command.CommandStackListener;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-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.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.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.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-public class StructuredTextUndoManager implements IStructuredTextUndoManager {
-
- class InternalCommandStackListener implements CommandStackListener {
- public void commandStackChanged(EventObject event) {
- resetInternalCommands();
- }
- }
-
- class InternalStructuredDocumentListener implements IStructuredDocumentListener {
-
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- // Do nothing. Do not push the new model's structuredDocument
- // changes
- // onto the undo command stack, or else the user may be able to
- // undo
- // an existing file to an empty file.
- }
-
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- // Since "no change", do nothing.
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- processStructuredDocumentEvent(structuredDocumentEvent);
- }
-
- private void processStructuredDocumentEvent(String textDeleted, String textInserted, int textStart, int textEnd) {
- if (fTextCommand != null && textStart == fTextCommand.getTextEnd()) {
- // append to the text command
- fTextCommand.setTextDeleted(fTextCommand.getTextDeleted().concat(textDeleted));
- fTextCommand.setTextInserted(fTextCommand.getTextInserted().concat(textInserted));
- fTextCommand.setTextEnd(textEnd);
- }
- else if (fTextCommand != null && textStart == fTextCommand.getTextStart() - 1 && textEnd <= fTextCommand.getTextEnd() - 1 && textDeleted.length() == 1 && textInserted.length() == 0 && fTextCommand.getTextDeleted().length() > 0) {
- // backspace pressed
- // erase a character in the file
- fTextCommand.setTextDeleted(textDeleted.concat(fTextCommand.getTextDeleted()));
- fTextCommand.setTextStart(textStart);
- }
- else {
- createNewTextCommand(textDeleted, textInserted, textStart, textEnd);
- }
-
- // save cursor position
- fCursorPosition = textEnd;
- }
-
- private void processStructuredDocumentEvent(StructuredDocumentEvent structuredDocumentEvent) {
- // Note: fListening tells us if we should listen to the
- // StructuredDocumentEvent.
- // fListening is set to false right before the undo/redo process
- // and
- // then set to true again
- // right after the undo/redo process to block out and ignore all
- // StructuredDocumentEvents generated
- // by the undo/redo process.
-
- // Process StructuredDocumentEvent if fListening is true.
- //
- // We are executing a command from the command stack if the
- // requester
- // is a command (for example, undo/redo).
- // We should not process the flat model event when we are
- // executing a
- // command from the command stack.
- if (fUndoManagementEnabled && !(structuredDocumentEvent.getOriginalRequester() instanceof Command)) {
- // check requester if not recording
- if (!fRecording)
- checkRequester(structuredDocumentEvent.getOriginalRequester());
-
- // process the structuredDocumentEvent
- String textDeleted = structuredDocumentEvent.getDeletedText();
- String textInserted = structuredDocumentEvent.getText();
- int textStart = structuredDocumentEvent.getOffset();
- int textEnd = textStart + textInserted.length();
- processStructuredDocumentEvent(textDeleted, textInserted, textStart, textEnd);
- }
- }
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- processStructuredDocumentEvent(structuredDocumentEvent);
- }
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- processStructuredDocumentEvent(structuredDocumentEvent);
- }
-
- }
-
- private static final String TEXT_CHANGE_TEXT = SSECoreMessages.Text_Change_UI_; //$NON-NLS-1$
- private CommandStack fCommandStack = null;
- private StructuredTextCompoundCommandImpl fCompoundCommand = null;
- private String fCompoundCommandDescription = null;
- private String fCompoundCommandLabel = null;
- int fCursorPosition = 0;
- // private IStructuredModel fStructuredModel = null;
- private IDocument fDocument;
- private InternalCommandStackListener fInternalCommandStackListener;
- // private Map fTextViewerToListenerMap = new HashMap();
- private IStructuredDocumentListener fInternalStructuredDocumentListener;
- private IDocumentSelectionMediator[] fMediators = null;
- private boolean fRecording = false;
- private int fRecordingCount = 0;
- private Object fRequester;
- StructuredTextCommandImpl fTextCommand = null;
- private int fUndoCursorPosition = -1;
- boolean fUndoManagementEnabled = true;
- private int fUndoSelectionLength = 0;
-
- public StructuredTextUndoManager() {
- this(new BasicCommandStack());
- }
-
- public StructuredTextUndoManager(CommandStack commandStack) {
- setCommandStack(commandStack);
- }
-
- private void addDocumentSelectionMediator(IDocumentSelectionMediator mediator) {
- if (!Utilities.contains(fMediators, mediator)) {
- int oldSize = 0;
-
- if (fMediators != null) {
- // normally won't be null, but we need to be sure, for first
- // time through
- oldSize = fMediators.length;
- }
-
- int newSize = oldSize + 1;
- IDocumentSelectionMediator[] newMediators = new IDocumentSelectionMediator[newSize];
- if (fMediators != null) {
- System.arraycopy(fMediators, 0, newMediators, 0, oldSize);
- }
-
- // add the new undo mediator to last position
- newMediators[newSize - 1] = mediator;
-
- // now switch new for old
- fMediators = newMediators;
- }
- else {
- removeDocumentSelectionMediator(mediator);
- addDocumentSelectionMediator(mediator);
- }
- }
-
- public void beginRecording(Object requester) {
- beginRecording(requester, null, null);
- }
-
- public void beginRecording(Object requester, int cursorPosition, int selectionLength) {
- beginRecording(requester, null, null);
-
- fUndoCursorPosition = cursorPosition;
- fUndoSelectionLength = selectionLength;
- }
-
- public void beginRecording(Object requester, String label) {
- beginRecording(requester, label, null);
- }
-
- public void beginRecording(Object requester, String label, int cursorPosition, int selectionLength) {
- beginRecording(requester, label, null);
-
- fUndoCursorPosition = cursorPosition;
- fUndoSelectionLength = selectionLength;
- }
-
- public void beginRecording(Object requester, String label, String description) {
- // save the requester
- fRequester = requester;
-
- // update label and desc only on the first level when recording is
- // nested
- if (fRecordingCount == 0) {
- fCompoundCommandLabel = label;
- if (fCompoundCommandLabel == null)
- fCompoundCommandLabel = TEXT_CHANGE_TEXT;
-
- fCompoundCommandDescription = description;
- if (fCompoundCommandDescription == null)
- fCompoundCommandDescription = TEXT_CHANGE_TEXT;
-
- // clear commands
- fTextCommand = null;
- fCompoundCommand = null;
- }
-
- // update counter and flag
- fRecordingCount++;
- fRecording = true;
-
- // no undo cursor position and undo selection length specified
- // reset undo cursor position and undo selection length
- fUndoCursorPosition = -1;
- fUndoSelectionLength = 0;
- }
-
- public void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength) {
- beginRecording(requester, label, description);
-
- fUndoCursorPosition = cursorPosition;
- fUndoSelectionLength = selectionLength;
- }
-
- void checkRequester(Object requester) {
- if (fRequester != null && !fRequester.equals(requester)) {
- // Force restart of recording so the last compound command is
- // closed.
- //
- // However, we should not force restart of recording when the
- // request came from StructuredDocumentToTextAdapter or
- // XMLModelImpl
- // because cut/paste requests and character inserts to the
- // textViewer are from StructuredDocumentToTextAdapter,
- // and requests to delete a node in the XMLTableTreeViewer are
- // from XMLModelImpl (which implements IStructuredModel).
-
- if (!(requester instanceof IStructuredModel || requester instanceof IStructuredDocument)) {
- resetInternalCommands();
- }
- }
- }
-
-
-
- public void connect(IDocumentSelectionMediator mediator) {
- Assert.isNotNull(mediator);
- if (fDocument == null) {
- // add this undo manager as structured document listener
- fDocument = mediator.getDocument();
- // future_TODO: eventually we want to refactor or allow either
- // type of document, but for now, we'll do instanceof check, and
- // fail
- // if not right type
- if (fDocument instanceof IStructuredDocument) {
- ((IStructuredDocument) fDocument).addDocumentChangedListener(getInternalStructuredDocumentListener());
- }
- else {
- throw new IllegalArgumentException("only meditator with structured documents currently handled"); //$NON-NLS-1$
- }
- }
- else {
- // if we've already had our document set, we'll just do this fail
- // fast integrity check
- if (!fDocument.equals(mediator.getDocument()))
- throw new IllegalStateException("Connection to undo manager failed. Document for document selection mediator inconistent with undo manager."); //$NON-NLS-1$
- }
-
- addDocumentSelectionMediator(mediator);
- }
-
- void createNewTextCommand(String textDeleted, String textInserted, int textStart, int textEnd) {
- StructuredTextCommandImpl textCommand = new StructuredTextCommandImpl(fDocument);
- textCommand.setLabel(TEXT_CHANGE_TEXT);
- textCommand.setDescription(TEXT_CHANGE_TEXT);
- textCommand.setTextStart(textStart);
- textCommand.setTextEnd(textEnd);
- textCommand.setTextDeleted(textDeleted);
- textCommand.setTextInserted(textInserted);
-
- if (fRecording) {
- if (fCompoundCommand == null) {
- StructuredTextCompoundCommandImpl compoundCommand = new StructuredTextCompoundCommandImpl();
- compoundCommand.setUndoCursorPosition(fUndoCursorPosition);
- compoundCommand.setUndoSelectionLength(fUndoSelectionLength);
-
- compoundCommand.setLabel(fCompoundCommandLabel);
- compoundCommand.setDescription(fCompoundCommandDescription);
- compoundCommand.append(textCommand);
-
- fCompoundCommand = compoundCommand;
- }
- else {
- fCompoundCommand.append(textCommand);
- }
- }
- else {
- fCommandStack.execute(textCommand);
- }
-
- fTextCommand = textCommand;
- }
-
- /**
- * Disable undo management.
- */
- public void disableUndoManagement() {
- fUndoManagementEnabled = false;
- }
-
- public void disconnect(IDocumentSelectionMediator mediator) {
- removeDocumentSelectionMediator(mediator);
-
- if (fMediators != null && fMediators.length == 0 && fDocument != null) {
- // remove this undo manager as structured document listener
- // future_TODO: eventually we want to refactor or allow either
- // type of document, but for now, we'll do instanceof check, and
- // fail
- // if not right type
- if (fDocument instanceof IStructuredDocument) {
- ((IStructuredDocument) fDocument).removeDocumentChangedListener(getInternalStructuredDocumentListener());
- }
- else {
- throw new IllegalArgumentException("only meditator with structured documents currently handled"); //$NON-NLS-1$
- }
- // if no longer listening to document, then dont even track it
- // anymore
- // (this allows connect to reconnect to document again)
- fDocument = null;
- }
- }
-
- public void enableUndoManagement() {
- fUndoManagementEnabled = true;
- }
-
- public void endRecording(Object requester) {
- int cursorPosition = (fTextCommand != null) ? fTextCommand.getTextEnd() : -1;
- int selectionLength = 0;
-
- endRecording(requester, cursorPosition, selectionLength);
- }
-
- public void endRecording(Object requester, int cursorPosition, int selectionLength) {
- // Recording could be stopped by forceEndOfPendingCommand(). Make sure
- // we are still recording before proceeding, or else fRecordingCount
- // may not be balanced.
- if (fRecording) {
- if (fCompoundCommand != null) {
- fCompoundCommand.setRedoCursorPosition(cursorPosition);
- fCompoundCommand.setRedoSelectionLength(selectionLength);
- }
-
- // end recording is a logical stopping point for text command,
- // even when fRecordingCount > 0 (in nested beginRecording)
- fTextCommand = null;
-
- // update counter and flag
- if (fRecordingCount > 0)
- fRecordingCount--;
- if (fRecordingCount == 0) {
-
- // Finally execute the commands accumulated in the compound command.
-
- if (fCompoundCommand != null) {
- fCommandStack.execute(fCompoundCommand);
- }
-
- fRecording = false;
-
- // reset compound command only when fRecordingCount ==
- // 0
- fCompoundCommand = null;
- fCompoundCommandLabel = null;
- fCompoundCommandDescription = null;
-
- // Also reset fRequester
- fRequester = null;
- }
- }
- }
-
- /**
- * Utility method to find model given document
- */
- private IStructuredModel findStructuredModel(IDocument document) {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IStructuredModel structuredModel = modelManager.getExistingModelForRead(document);
- return structuredModel;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager#forceEndOfPendingCommand(java.lang.Object,
- * int, int)
- */
- public void forceEndOfPendingCommand(Object requester, int currentPosition, int length) {
- if (fRecording)
- endRecording(requester, currentPosition, length);
- else
- resetInternalCommands();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager#getCommandStack()
- */
- public CommandStack getCommandStack() {
- return fCommandStack;
- }
-
- /**
- * @return
- */
- private CommandStackListener getInternalCommandStackListener() {
- if (fInternalCommandStackListener == null) {
- fInternalCommandStackListener = new InternalCommandStackListener();
- }
- return fInternalCommandStackListener;
- }
-
- /**
- * @return
- */
- private IStructuredDocumentListener getInternalStructuredDocumentListener() {
- if (fInternalStructuredDocumentListener == null) {
- fInternalStructuredDocumentListener = new InternalStructuredDocumentListener();
- }
- return fInternalStructuredDocumentListener;
- }
-
- public Command getRedoCommand() {
- return fCommandStack.getRedoCommand();
- }
-
- public Command getUndoCommand() {
- return fCommandStack.getUndoCommand();
- }
-
- public void redo() {
- redo(null);
- }
-
- public void redo(IDocumentSelectionMediator requester) {
- IStructuredModel model = findStructuredModel(fDocument);
-
- if (redoable()) {
- IDocumentExtension4 docExt4 = null;
- DocumentRewriteSession rewriteSession = null;
- try {
- if (model != null)
- model.aboutToChangeModel();
-
- Command redoCommand = getRedoCommand();
- if (redoCommand instanceof CompoundCommand &&
- model.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4)model.getStructuredDocument();
- }
- rewriteSession = (docExt4 == null) ? null :
- docExt4.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
-
- // make sure to redo before setting document selection
- fCommandStack.redo();
-
- // set document selection
- setRedoDocumentSelection(requester, redoCommand);
- }
- finally {
- if (docExt4 != null && rewriteSession != null)
- docExt4.stopRewriteSession(rewriteSession);
- if (model != null) {
- model.changedModel();
- model.releaseFromRead();
- }
- }
- }
- }
-
- public boolean redoable() {
- return fCommandStack.canRedo();
- }
-
- private void removeDocumentSelectionMediator(IDocumentSelectionMediator mediator) {
- if (fMediators != null && mediator != null) {
- // if its not in the array, we'll ignore the request
- if (Utilities.contains(fMediators, mediator)) {
- int oldSize = fMediators.length;
- int newSize = oldSize - 1;
- IDocumentSelectionMediator[] newMediators = new IDocumentSelectionMediator[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fMediators[i] == mediator) { // ignore
- }
- else {
- // copy old to new if its not the one we are removing
- newMediators[index++] = fMediators[i];
- }
- }
- // now that we have a new array, let's switch it for the old
- // one
- fMediators = newMediators;
- }
- }
- }
-
- void resetInternalCommands() {
- // Either the requester of the structured document change event is
- // changed, or the command stack is changed. Need to reset internal
- // commands so we won't continue to append changes.
- fCompoundCommand = null;
- fTextCommand = null;
-
- // Also reset fRequester
- fRequester = null;
- }
-
- public void setCommandStack(CommandStack commandStack) {
- if (fCommandStack != null)
- fCommandStack.removeCommandStackListener(getInternalCommandStackListener());
-
- fCommandStack = commandStack;
-
- if (fCommandStack != null)
- fCommandStack.addCommandStackListener(getInternalCommandStackListener());
- }
-
- private void setRedoDocumentSelection(IDocumentSelectionMediator requester, Command command) {
- int cursorPosition = -1;
- int selectionLength = 0;
-
- if (command instanceof CommandCursorPosition) {
- CommandCursorPosition commandCursorPosition = (CommandCursorPosition) command;
- cursorPosition = commandCursorPosition.getRedoCursorPosition();
- selectionLength = commandCursorPosition.getRedoSelectionLength();
- }
- else if (command instanceof StructuredTextCommand) {
- StructuredTextCommand structuredTextCommand = (StructuredTextCommand) command;
- cursorPosition = structuredTextCommand.getTextStart();
- selectionLength = structuredTextCommand.getTextInserted().length();
- }
-
- if (cursorPosition > -1 && fMediators != null && fMediators.length > 0) {
- for (int i = 0; i < fMediators.length; i++) {
- IDocument document = fMediators[i].getDocument();
- fMediators[i].undoOperationSelectionChanged(new UndoDocumentEvent(requester, document, cursorPosition, selectionLength));
- }
- }
- }
-
- private void setUndoDocumentSelection(IDocumentSelectionMediator requester, Command command) {
- int cursorPosition = -1;
- int selectionLength = 0;
-
- if (command instanceof CommandCursorPosition) {
- CommandCursorPosition commandCursorPosition = (CommandCursorPosition) command;
- cursorPosition = commandCursorPosition.getUndoCursorPosition();
- selectionLength = commandCursorPosition.getUndoSelectionLength();
- }
- else if (command instanceof StructuredTextCommand) {
- StructuredTextCommand structuredTextCommand = (StructuredTextCommand) command;
- cursorPosition = structuredTextCommand.getTextStart();
- selectionLength = structuredTextCommand.getTextDeleted().length();
- }
-
- if (cursorPosition > -1 && fMediators != null && fMediators.length > 0) {
- for (int i = 0; i < fMediators.length; i++) {
- IDocument document = fMediators[i].getDocument();
- fMediators[i].undoOperationSelectionChanged(new UndoDocumentEvent(requester, document, cursorPosition, selectionLength));
- }
- }
- }
-
- public void undo() {
- undo(null);
- }
-
- public void undo(IDocumentSelectionMediator requester) {
- // Force an endRecording before undo.
- //
- // For example, recording was turned on on the Design Page of
- // PageDesigner.
- // Then undo is invoked on the Source Page. Recording should be
- // stopped before we undo.
- // Note that redo should not be available when we switch to the Source
- // Page.
- // Therefore, this force ending of recording is not needed in redo.
- if (fRecording)
- endRecording(this);
-
- if (undoable()) {
- IStructuredModel model = findStructuredModel(fDocument);
- IDocumentExtension4 docExt4 = null;
- DocumentRewriteSession rewriteSession = null;
-
- try {
- if (model != null)
- model.aboutToChangeModel();
-
- Command undoCommand = getUndoCommand();
- if (undoCommand instanceof CompoundCommand &&
- model.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4)model.getStructuredDocument();
- }
- rewriteSession = (docExt4 == null) ? null :
- docExt4.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
-
- // make sure to undo before setting document selection
- fCommandStack.undo();
-
- // set document selection
- setUndoDocumentSelection(requester, undoCommand);
- }
- finally {
- if (docExt4 != null && rewriteSession != null)
- docExt4.stopRewriteSession(rewriteSession);
- if (model != null) {
- model.changedModel();
- model.releaseFromRead();
- }
- }
- }
- }
-
- public boolean undoable() {
- return fCommandStack.canUndo();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java
deleted file mode 100644
index 0fee467220..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java
+++ /dev/null
@@ -1,45 +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.sse.core.internal.undo;
-
-import org.eclipse.jface.text.IDocument;
-
-public class UndoDocumentEvent {
- private IDocument fDocument;
- private int fLength;
- private int fOffset;
- private IDocumentSelectionMediator fRequester;
-
- public UndoDocumentEvent(IDocumentSelectionMediator requester, IDocument document, int offset, int length) {
- fRequester = requester;
- fDocument = document;
- fOffset = offset;
- fLength = length;
- }
-
- public IDocument getDocument() {
- return fDocument;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getOffset() {
- return fOffset;
- }
-
- public IDocumentSelectionMediator getRequester() {
- return fRequester;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
deleted file mode 100644
index 46c60a85e4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
+++ /dev/null
@@ -1,205 +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.wst.sse.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventAdmin;
-import org.osgi.service.event.EventConstants;
-import org.osgi.service.event.EventHandler;
-
-/**
- * This responds to memory events.
- *
- * Create an instance of a child of this class with the events you are interested in.
- * Then call connect() to start listening. To stop listening call disconnect();
- */
-public abstract class AbstractMemoryListener implements EventHandler {
- /**
- * The event that indicates that memory is running low at the lowest severity.
- * Listeners are requested to release caches that can easily be recomputed.
- * The Java VM is not seriously in trouble, but process size is getting higher than
- * is deemed acceptable.
- */
- public static final String SEV_NORMAL = "org/eclipse/equinox/events/MemoryEvent/NORMAL"; //$NON-NLS-1$
-
- /**
- * The event that indicates that memory is running low at medium severity.
- * Listeners are requested to release intermediate build results, complex models, etc.
- * Memory is getting low and may cause operating system level stress, such as swapping.
- */
- public static final String SEV_SERIOUS = "org/eclipse/equinox/events/MemoryEvent/SERIOUS"; //$NON-NLS-1$
-
- /**
- * The event that indicates that memory is running low at highest severity.
- * Listeners are requested to do things like close editors and perspectives, close database connections, etc.
- * Restoring these resources and caches constitutes lots of work, but memory is so low that
- * drastic measures are required.
- */
- public static final String SEV_CRITICAL = "org/eclipse/equinox/events/MemoryEvent/CRITICAL"; //$NON-NLS-1$
-
- /**
- * All of the valid memory severities
- */
- public static final String[] SEV_ALL = { SEV_NORMAL, SEV_SERIOUS, SEV_CRITICAL };
-
- /**
- * Used to register the {@link EventAdmin} listener
- */
- private static BundleContext CONTEXT =
- (SSECorePlugin.getDefault() != null) ?
- SSECorePlugin.getDefault().getBundle().getBundleContext() : null;
-
- /**
- * the severities that will be reacted to
- */
- private final List fSeverities;
-
- /**
- * service used to register this listener
- */
- private ServiceRegistration fRegisterService;
-
- /**
- * Will listen to all memory events
- */
- public AbstractMemoryListener() {
- this(AbstractMemoryListener.SEV_ALL);
- }
-
- /**
- * Will listen to memory events of the given <code>severity</code>
- *
- * @param severity listen for memory events of this severity
- */
- public AbstractMemoryListener(String severity) {
- Assert.isNotNull(severity, "Severity can not be null"); //$NON-NLS-1$
-
- List severities = new ArrayList(1);
- severities.add(severity);
- fSeverities = severities;
- }
-
- /**
- * Will listen to memory events of the given <code>severities</code>
- *
- * @param severities listen for memory events for any of these severities
- */
- public AbstractMemoryListener(String[] severities) {
- Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$
- Assert.isLegal(severities.length > 0, "Severities must specify at least one severity"); //$NON-NLS-1$
-
- fSeverities = Arrays.asList(severities);
- }
-
- /**
- * Will listen to memory events of the given <code>severities</code>
- *
- * @param severities listen for memory events for any of these severities
- */
- public AbstractMemoryListener(List severities) {
- Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$
- Assert.isLegal(!severities.isEmpty(), "Severities must specify at least one severity"); //$NON-NLS-1$
- fSeverities = severities;
- }
-
- /**
- * Connect this listener to the {@link EventAdmin}
- */
- public final void connect() {
- if (CONTEXT != null) {
- // NOTE: This is TEMPORARY CODE needed to load the plugin
- // until its done automatically by the product
- // TODO: Remove me
- Bundle b = Platform.getBundle("org.eclipse.equinox.event"); //$NON-NLS-1$
- if (b != null && b.getState() == Bundle.RESOLVED) {
- try {
- b.start(Bundle.START_TRANSIENT);
- }
- catch (BundleException e) {
- e.printStackTrace();
- }
- }
- // end remove me
-
- //register this handler
- String[] severities = (String[])fSeverities.toArray(new String[fSeverities.size()]);
- Hashtable prop = new Hashtable(1);
- prop.put(EventConstants.EVENT_TOPIC, severities);
- fRegisterService = CONTEXT.registerService(EventHandler.class.getName(), this, prop);
-
- //call any implementer specific connect code
- doConnect();
- } else {
- Logger.log(Logger.WARNING, "Error accessing bundle context. Is Platform running? Not tracking memory events. "); //$NON-NLS-1$
- }
- }
-
- /**
- * Disconnect this listener to the {@link EventAdmin}
- */
- public final void disconnect() {
- if (fRegisterService != null) {
- fRegisterService.unregister();
- fRegisterService = null;
- }
-
- //call any implementer specific disconnect code
- doDisconnect();
- }
-
- /**
- * <p>Filter out any events that are not of the type that this listener handles</p>
- *
- * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
- */
- public final void handleEvent(Event event) {
- if (fSeverities.contains(event.getTopic())) {
- handleMemoryEvent(event);
- }
- }
-
- /**
- * Implementing child classes may assume that only {@link Event}s of the types
- * given to the constructor will be given to this method.
- *
- * @param event the {@link Event} with a topic equal to one of the memory
- * severities that this listener is listening for
- */
- protected abstract void handleMemoryEvent(Event event);
-
- /**
- * Implementers may overrun this method to do setup after connection of this listener
- */
- protected void doConnect() {
- //do nothing by default
- }
-
- /**
- * Implementers may overrun this method to do tear down after disconnection of this listener
- */
- protected void doDisconnect() {
- //do nothing by default
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java
deleted file mode 100644
index f3d1ee04ab..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java
+++ /dev/null
@@ -1,164 +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.sse.core.internal.util;
-
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
- /**
- * <code>AssertionFailedException</code> is a runtime exception thrown
- * by some of the methods in <code>Assert</code>.
- * <p>
- * This class is not declared public to prevent some misuses; programs
- * that catch or otherwise depend on assertion failures are susceptible to
- * unexpected breakage when assertions in the code are added or removed.
- * </p>
- */
- class AssertionFailedException extends RuntimeException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructs a new exception.
- */
- public AssertionFailedException() {
- super();
- }
-
- /**
- * Constructs a new exception with the given message.
- */
- public AssertionFailedException(String detail) {
- super(detail);
- }
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is not
- * <code>true</code>, an <code>IllegalArgumentException</code> is
- * thrown.
- *
- * @param expression
- * the outcode of the check
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- * @exception IllegalArgumentException
- * if the legality test failed
- */
- public static boolean isLegal(boolean expression) {
- return isLegal(expression, ""); //$NON-NLS-1$
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is not
- * <code>true</code>, an <code>IllegalArgumentException</code> is
- * thrown. The given message is included in that exception, to aid
- * debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- * @exception IllegalArgumentException
- * if the legality test failed
- */
- public static boolean isLegal(boolean expression, String message) {
- if (!expression)
- throw new IllegalArgumentException();
- return expression;
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this is
- * not the case, some kind of unchecked exception is thrown.
- *
- * @param object
- * the value to test
- * @exception IllegalArgumentException
- * if the object is <code>null</code>
- */
- public static void isNotNull(Object object) {
- isNotNull(object, ""); //$NON-NLS-1$
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this is
- * not the case, some kind of unchecked exception is thrown. The given
- * message is included in that exception, to aid debugging.
- *
- * @param object
- * the value to test
- * @param message
- * the message to include in the exception
- * @exception IllegalArgumentException
- * if the object is <code>null</code>
- */
- public static void isNotNull(Object object, String message) {
- if (object == null) {
- //Logger.log(Logger.ERROR, "null_argument: " + message); //$NON-NLS-1$
- throw new Assert().new AssertionFailedException(message);
- }
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this is not
- * the case, some kind of unchecked exception is thrown.
- *
- * @param expression
- * the outcode of the check
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- */
- public static boolean isTrue(boolean expression) {
- return isTrue(expression, ""); //$NON-NLS-1$
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this is not
- * the case, some kind of unchecked exception is thrown. The given message
- * is included in that exception, to aid debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- */
- public static boolean isTrue(boolean expression, String message) {
- if (!expression) {
- throw new Assert().new AssertionFailedException(message);
- }
- return expression;
- }
-
- /* This class is not intended to be instantiated. */
- private Assert() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
deleted file mode 100644
index 3df89548da..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300430 - String concatenation
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-
-
-import java.util.Enumeration;
-
-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.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public final class Debug {
- public static final boolean checkForMemoryLeaks = false;
-
- public static final boolean collectStats = false;
-
- public static final int DEBUG = 0;
-
- public static final boolean DEBUG_THREADLOCAL = false;
-
- public static final boolean debugBreakpoints = false;
- public static final boolean debugCaretMediator = false;
- public static final boolean debugDisplayTreePositions = false;
- //
- public static final boolean debugMediator = false;
- //
- public static final boolean debugNotification = false;
- public static final boolean debugNotificationAndEvents = false;
-
- public static final boolean debugNotifyDeferred = false;
- public static final boolean debugReconciling = false;
- //
- public static final boolean debugRtfFormatProvider = false;
- //
- public static final boolean debugStructuredDocument = false;
- public static final boolean debugTaglibs = false;
- //
- public static final boolean debugTokenizer = false;
- //
- public static final boolean debugTreeModel = false;
- public static final boolean debugUpdateTreePositions = false;
- public static final boolean displayInfo = false;
-
- /** effects output of Logger */
- public static final boolean displayToConsole = true;
- public static final boolean displayWarnings = false;
- //
- public static final boolean headParsing = false;
- public static final boolean jsDebugContextAssist = false;
- //
- public static final boolean jsDebugSyntaxColoring = false;
-
- public static final boolean LOCKS = false;
- //
- public static final boolean perfTest = false;
- public static final boolean perfTestAdapterClassLoading = false;
- public static final boolean perfTestFormat = false;
- public static final boolean perfTestRawStructuredDocumentOnly = false;
- public static final boolean perfTestStructuredDocumentEventOnly = false;
- public static final boolean perfTestStructuredDocumentOnly = false;
-
- //
- public static final boolean syntaxHighlighting = false;
- //
- public static final boolean useStandardEolInWidget = false;
-
- /**
- * For tests and debug only
- */
-
- public static final void dump(IStructuredDocument structuredDocument) {
- dump(structuredDocument, false);
- }
-
- public static final void dump(IStructuredDocument structuredDocument, boolean verbose) {
- ITextRegionCollection flatNode = null;
- System.out.println("Dump of structuredDocument:"); //$NON-NLS-1$
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- Enumeration structuredDocumentRegions = flatNodes.elements();
- while (structuredDocumentRegions.hasMoreElements()) {
- flatNode = (ITextRegionCollection) structuredDocumentRegions.nextElement();
- if (!verbose) {
- String outString = flatNode.toString();
- outString = org.eclipse.wst.sse.core.utils.StringUtils.escape(outString);
- System.out.println(outString);
- } else {
- dump(flatNode, verbose);
- }
- }
- System.out.println();
- System.out.println("= = = = = ="); //$NON-NLS-1$
- System.out.println();
- }
-
- /**
- * @param flatNode
- * @param verbose
- */
- public static final void dump(ITextRegionCollection region, boolean verbose) {
- if (region == null)
- return;
- if (verbose) {
- printParent(region);
- }
- printChildRegions(region, 0);
- }
-
- private static void printChildRegions(ITextRegionCollection region, int depth) {
- if (region != null) {
- // ==> // ITextRegionCollection regionCollection = region;
- System.out.println(region);
- ITextRegionList regionList = region.getRegions();
- for (int i = 0; i < regionList.size(); i++) {
- ITextRegion r = regionList.get(i);
- if (r instanceof ITextRegionCollection) {
- ITextRegionCollection rc = (ITextRegionCollection) r;
- printChildRegions(rc, depth++);
- } else {
- System.out.println(space(depth) + r);
- depth--;
- }
- }
- }
- }
-
- /**
- * Simple utility to make sure println's are some what in order
- */
- public static final synchronized void println(String msg) {
- System.out.println(System.currentTimeMillis() + "\t" + msg); //$NON-NLS-1$
- }
-
- private static void printParent(IStructuredDocumentRegion region) {
- System.out.println(" [parent document: " + toStringUtil(region.getParentDocument()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static void printParent(ITextRegionCollection region) {
- if (region instanceof IStructuredDocumentRegion) {
- printParent((IStructuredDocumentRegion) region);
- } else if (region instanceof ITextRegionContainer) {
- printParent((ITextRegionContainer) region);
- } else
- System.out.println(" [parent document: " + "(na)" + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- private static void printParent(ITextRegionContainer region) {
- System.out.println(" [parent document: " + toStringUtil(region.getParent()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @param depth
- * @return
- */
- private static String space(int depth) {
- String result = " "; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer(result);
- for (int i = 0; i < depth; i++) {
- sb.append(" "); //$NON-NLS-1$
- }
- result = sb.toString();
- return result;
- }
-
- public static final String toStringUtil(IStructuredDocument object) {
- String className = object.getClass().getName();
- String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
- String result = shortClassName;
- // NOTE: if the document held by any region has been updated and the
- // region offsets have not
- // yet been updated, the output from this method invalid.
- return result;
-
- }
-
- public static final String toStringUtil(ITextRegionCollection object) {
- String className = object.getClass().getName();
- String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
- String result = shortClassName;
- // NOTE: if the document held by any region has been updated and the
- // region offsets have not
- // yet been updated, the output from this method invalid.
- return result;
-
- }
-
- /**
- * Debug constructor comment.
- */
- public Debug() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java
deleted file mode 100644
index fad095102a..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java
+++ /dev/null
@@ -1,108 +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.sse.core.internal.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-
-public class DocumentInputStream extends InputStream {
- private IDocument fDocument;
- private int fMark = -1;
- private int fPosition = 0;
-
- public DocumentInputStream(IDocument source) {
- super();
- fDocument = source;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#available()
- */
- public int available() throws IOException {
- return fDocument.getLength() - fPosition;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#close()
- */
- public void close() throws IOException {
- this.fDocument = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#mark(int)
- */
- public synchronized void mark(int readlimit) {
- fMark = fPosition;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#markSupported()
- */
- public boolean markSupported() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#read()
- */
- public int read() throws IOException {
- try {
- if (fPosition < fDocument.getLength())
- return fDocument.getChar(fPosition++);
- else
- return -1;
- } catch (BadLocationException e) {
- throw new IOException(e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#reset()
- */
- public synchronized void reset() throws IOException {
- fPosition = fMark;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#skip(long)
- */
- public long skip(long n) throws IOException {
- long skipped = n;
- if (n < fDocument.getLength() - fPosition) {
- skipped = n;
- fPosition += skipped;
- } else {
- skipped = fDocument.getLength() - fPosition;
- fPosition = fDocument.getLength();
- }
- return skipped;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
deleted file mode 100644
index d2bedbb921..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.JarURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-
-public class JarUtilities {
-
- /**
- * @see http://java.sun.com/products/jsp/errata_1_1_a_042800.html, Issues
- * 8 & 9
- *
- * "There are two cases. In both cases the TLD_URI is to be
- * interpreted relative to the root of the Web Application. In the
- * first case the TLD_URI refers to a TLD file directly. In the
- * second case, the TLD_URI refers to a JAR file. If so, that JAR
- * file should have a TLD at location META-INF/taglib.tld."
- */
- public static final String JSP11_TAGLIB = "META-INF/taglib.tld"; //$NON-NLS-1$
-
- public static void closeJarFile(ZipFile file) {
- if (file == null)
- return;
- try {
- file.close();
- }
- catch (IOException ioe) {
- // no cleanup can be done
- }
- }
-
- /**
- * Provides a stream to a local copy of the input or null if not possible
- */
- protected static InputStream getCachedInputStream(String jarFilename, String entryName) {
- File testFile = new File(jarFilename);
- if (!testFile.exists())
- return getInputStream(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(jarFilename)), entryName);
-
- InputStream cache = null;
- ZipFile jarfile = null;
- try {
- jarfile = new ZipFile(jarFilename);
- }
- catch (IOException ioExc) {
- closeJarFile(jarfile);
- }
-
- if (jarfile != null) {
- try {
- ZipEntry zentry = jarfile.getEntry(entryName);
- if (zentry != null) {
- InputStream entryInputStream = null;
- try {
- entryInputStream = jarfile.getInputStream(zentry);
- }
- catch (IOException ioExc) {
- // no cleanup can be done
- }
-
- if (entryInputStream != null) {
- int c;
- ByteArrayOutputStream buffer = null;
- if (zentry.getSize() > 0) {
- buffer = new ByteArrayOutputStream((int) zentry.getSize());
- }
- else {
- buffer = new ByteArrayOutputStream();
- }
- // array dim restriction?
- byte bytes[] = new byte[2048];
- try {
- while ((c = entryInputStream.read(bytes)) >= 0) {
- buffer.write(bytes, 0, c);
- }
- cache = new ByteArrayInputStream(buffer.toByteArray());
- closeJarFile(jarfile);
- }
- catch (IOException ioe) {
- // no cleanup can be done
- }
- finally {
- try {
- entryInputStream.close();
- }
- catch (IOException e) {
- // no cleanup can be done
- }
- }
- }
- }
- }
- finally {
- closeJarFile(jarfile);
- }
- }
- return cache;
- }
-
- private static InputStream copyAndCloseStream(InputStream original) {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- InputStream cachedCopy = null;
-
- if (original != null) {
- int c;
- // array dim restriction?
- byte bytes[] = new byte[2048];
- try {
- while ((c = original.read(bytes)) >= 0) {
- buffer.write(bytes, 0, c);
- }
- cachedCopy = new ByteArrayInputStream(buffer.toByteArray());
- closeStream(original);
- }
- catch (IOException ioe) {
- // no cleanup can be done
- }
- }
- return cachedCopy;
- }
-
- /**
- * @param jarResource
- * the zip file
- * @return a string array containing the entry paths to every file in this
- * zip resource, excluding directories
- */
- public static String[] getEntryNames(IResource jarResource) {
- if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
- return new String[0];
-
- try {
- return getEntryNames(jarResource.getFullPath().toString(), new ZipInputStream(((IFile) jarResource).getContents()), true);
- }
- catch (CoreException e) {
- // no cleanup can be done
- }
-
- IPath location = jarResource.getLocation();
- if (location != null)
- return getEntryNames(location.toString());
- return new String[0];
- }
-
- /**
- * @param jarFilename
- * the location of the zip file
- * @return a string array containing the entry paths to every file in the
- * zip file at this location, excluding directories
- */
- public static String[] getEntryNames(String jarFilename) {
- return getEntryNames(jarFilename, true);
- }
-
- private static String[] getEntryNames(String filename, ZipInputStream jarInputStream, boolean excludeDirectories) {
- List entryNames = new ArrayList();
- try {
- ZipEntry z = jarInputStream.getNextEntry();
- while (z != null) {
- if (!(z.isDirectory() && excludeDirectories))
- entryNames.add(z.getName());
- z = jarInputStream.getNextEntry();
- }
- }
- catch (ZipException zExc) {
- Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (IOException ioExc) {
- // no cleanup can be done
- }
- finally {
- closeStream(jarInputStream);
- }
- String[] names = (String[]) entryNames.toArray(new String[0]);
- return names;
- }
-
- private static void closeStream(InputStream inputStream) {
- try {
- inputStream.close();
- }
- catch (IOException e) {
- // no cleanup can be done
- }
- }
-
- /**
- * @param jarFilename
- * the location of the zip file
- * @param excludeDirectories
- * whether to not include directories in the results
- * @return a string array containing the entry paths to every file in the
- * zip file at this location, excluding directories if indicated
- */
- public static String[] getEntryNames(String jarFilename, boolean excludeDirectories) {
- ZipFile jarfile = null;
- List entryNames = new ArrayList();
- File f = new File(jarFilename);
- if (f.exists() && f.canRead()) {
- try {
- jarfile = new ZipFile(f);
- Enumeration entries = jarfile.entries();
- while (entries.hasMoreElements()) {
- ZipEntry z = (ZipEntry) entries.nextElement();
- if (!(z.isDirectory() && excludeDirectories))
- entryNames.add(z.getName());
- }
- }
- catch (ZipException zExc) {
- Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: " + jarFilename + " " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (IOException ioExc) {
- // no cleanup can be done
- }
- finally {
- closeJarFile(jarfile);
- }
- }
- String[] names = (String[]) entryNames.toArray(new String[0]);
- return names;
- }
-
- /**
- * @param jarResource
- * the zip file
- * @param entryName
- * the entry's path in the zip file
- * @return an InputStream to the contents of the given entry or null if
- * not possible
- */
- public static InputStream getInputStream(IResource jarResource, String entryName) {
- if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
- return null;
-
- try {
- InputStream zipStream = ((IFile) jarResource).getContents();
- return getInputStream(jarResource.getFullPath().toString(), new ZipInputStream(zipStream), entryName);
- }
- catch (CoreException e) {
- // no cleanup can be done, probably out of sync
- }
-
- IPath location = jarResource.getLocation();
- if (location != null) {
- return getInputStream(location.toString(), entryName);
- }
- return null;
- }
-
- private static InputStream getInputStream(String filename, ZipInputStream zip, String entryName) {
- InputStream result = null;
- try {
- ZipEntry z = zip.getNextEntry();
- while (z != null && !z.getName().equals(entryName)) {
- z = zip.getNextEntry();
- }
- if (z != null) {
- result = copyAndCloseStream(zip);
- }
- }
- catch (ZipException zExc) {
- Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (IOException ioExc) {
- // no cleanup can be done
- }
- finally {
- closeStream(zip);
- }
- return result;
- }
-
- /**
- * @param jarFilename
- * the location of the zip file
- * @param entryName
- * the entry's path in the zip file
- * @return an InputStream to the contents of the given entry or null if
- * not possible
- */
- public static InputStream getInputStream(String jarFilename, String entryName) {
- // check sanity
- if (jarFilename == null || jarFilename.length() < 1 || entryName == null || entryName.length() < 1)
- return null;
-
- // JAR files are not allowed to have leading '/' in member names
- String internalName = null;
- if (entryName.startsWith("/")) //$NON-NLS-1$
- internalName = entryName.substring(1);
- else
- internalName = entryName;
-
- return getCachedInputStream(jarFilename, internalName);
- }
-
- /**
- * @param url
- * a URL pointint to a zip file
- * @return a cached copy of the contents at this URL, opening it as a file
- * if it is a jar:file: URL, and using a URLConnection otherwise,
- * or null if it could not be read. All sockets and file handles
- * are closed as quickly as possible.
- */
- public static InputStream getInputStream(URL url) {
- String urlString = url.toString();
- if (urlString.length() > 12 && urlString.startsWith("jar:file:") && urlString.indexOf("!/") > 9) { //$NON-NLS-1$ //$NON-NLS-2$
- int fileIndex = urlString.indexOf("!/"); //$NON-NLS-1$
- String jarFileName = urlString.substring(9, fileIndex);
- if (fileIndex < urlString.length()) {
- String jarPath = urlString.substring(fileIndex + 1);
- return getInputStream(jarFileName, jarPath);
- }
- }
-
- InputStream input = null;
- JarURLConnection jarUrlConnection = null;
- try {
- URLConnection openConnection = url.openConnection();
- openConnection.setDefaultUseCaches(false);
- openConnection.setUseCaches(false);
- if (openConnection instanceof JarURLConnection) {
- jarUrlConnection = (JarURLConnection) openConnection;
- JarFile jarFile = jarUrlConnection.getJarFile();
- input = jarFile.getInputStream(jarUrlConnection.getJarEntry());
- }
- else {
- input = openConnection.getInputStream();
- }
- if (input != null) {
- return copyAndCloseStream(input);
- }
- }
- catch (FileNotFoundException e) {
- // May be a file URL connection, do not log
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- if (jarUrlConnection != null) {
- try {
- jarUrlConnection.getJarFile().close();
- }
- catch (IOException e) {
- // ignore
- }
- catch (IllegalStateException e) {
- /*
- * ignore. Can happen in case the stream.close() did close
- * the jar file see
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140750
- */
- }
-
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
deleted file mode 100644
index b83508559c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300430 - String concatenation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-
-
-import java.io.File;
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Collection of helper methods to manage and convert links Originally part of
- * the LinksManager
- */
-public class PathHelper {
- public static final String BACKWARD_SLASH = "\\";//$NON-NLS-1$
-
- public static final String FORWARD_SLASH = "/";//$NON-NLS-1$
- public static final String RELATIVE_PATH_SIG = "../";//$NON-NLS-1$
-
- /**
- * adjust relative path isside the absolute path
- */
- public static String adjustPath(String path) {
- int i = 0;
- while ((i = path.indexOf(RELATIVE_PATH_SIG)) > 0) {
- // split the string into two
- String part1 = path.substring(0, i - 1);
- String part2 = path.substring(i + RELATIVE_PATH_SIG.length() - 1);
- // strip one path seg from part1
- int j = part1.lastIndexOf(FORWARD_SLASH);
- if (j == -1) {
- // can't resolve. passed path is like
- // E:/eclipseproject/../../sample.css.
- return "";//$NON-NLS-1$
- }
- part1 = part1.substring(0, j);
- path = part1 + part2;
- }
- return path;
- }
-
- /**
- * Append trailing url slash if needed
- */
- public static String appendTrailingURLSlash(String input) {
- // check to see already a slash
- if (!input.endsWith(FORWARD_SLASH)) {
- input += FORWARD_SLASH;
- }
- return input;
- }
-
- /**
- * Convert to relative url based on base
- */
- public static String convertToRelative(String input, String base) {
- // tokenize the strings
- StringTokenizer inputTokenizer = new StringTokenizer(input, FORWARD_SLASH);
- StringTokenizer baseTokenizer = new StringTokenizer(base, FORWARD_SLASH);
- String token1 = "", token2 = "";//$NON-NLS-2$//$NON-NLS-1$
- //
- // Go through until equls
- while (true) {
- if (!inputTokenizer.hasMoreTokens() || !baseTokenizer.hasMoreTokens())
- break;
- token1 = baseTokenizer.nextToken();
- token2 = inputTokenizer.nextToken();
- if (!token1.equals(token2))
- break;
- }
- // now generate the backs
- String output = "";//$NON-NLS-1$
- StringBuffer sb = new StringBuffer(output);
- while (baseTokenizer.hasMoreTokens()) {
- baseTokenizer.nextToken();
- sb.append("../"); //$NON-NLS-1$
- }
- sb.append(token2);
- // generate the rest
- while (inputTokenizer.hasMoreTokens()) {
- sb.append(FORWARD_SLASH);
- sb.append(inputTokenizer.nextToken());
- }
- output = sb.toString();
- return output;
- }
-
- /**
- * Return the containing folder path. Will handle both url and file path
- */
- public static String getContainingFolderPath(String path) {
- String retValue = path;
-
- int urlSlashIndex = path.lastIndexOf(FORWARD_SLASH);
- int filePathSlashIndex = path.lastIndexOf(File.separator);
- int index = filePathSlashIndex;
- if (urlSlashIndex > filePathSlashIndex)
- index = urlSlashIndex;
- if (index >= 0)
- retValue = path.substring(0, index);
- return retValue;
- }
-
- /**
- * Remove leading path separator
- */
- public static String removeLeadingPathSeparator(String path) {
- if (path.startsWith(File.separator))
- path = path.substring(File.separator.length());
- return path;
- }
-
- /**
- * Remove leading path separator
- */
- public static String removeLeadingSeparator(String path) {
- if (path.startsWith(File.separator))
- path = path.substring(File.separator.length());
- else if (path.startsWith(FORWARD_SLASH) || path.startsWith(BACKWARD_SLASH))
- path = path.substring(FORWARD_SLASH.length());
- return path;
- }
-
- /**
- * Switch to file path slashes
- */
- public static String switchToFilePathSlashes(String path) {
- path = path.replace(FORWARD_SLASH.charAt(0), File.separatorChar);
- path = path.replace(BACKWARD_SLASH.charAt(0), File.separatorChar);
- return path;
- }
-
- /**
- * Switch to file path slashes
- */
- public static String switchToForwardSlashes(String path) {
- path = path.replace(File.separatorChar, FORWARD_SLASH.charAt(0));
- path = path.replace(BACKWARD_SLASH.charAt(0), FORWARD_SLASH.charAt(0));
- return path;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java
deleted file mode 100644
index 0a21f95409..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * @deprecated The URIResolver interface is deprecated. Use the resolver from
- * org.eclipse.wst.common.uriresolver.
- */
-public class ProjectResolver implements URIResolver {
- private String fFileBaseLocation = null;
- private IProject fProject = null;
-
- /**
- * It is strongly recommended that clients use
- * project.getAdapter(URIResolver.class) to obtain a URIResolver aware of
- * the Project's special requirements. Note that a URIResolver may not be
- * returned at all so manually creating this object may still be required.
- */
- public ProjectResolver(IProject project) {
- super();
- fProject = project;
- }
-
- public String getFileBaseLocation() {
- return fFileBaseLocation;
- }
-
- public String getLocationByURI(String uri) {
- return getLocationByURI(uri, getFileBaseLocation());
- }
-
- // defect 244817 end
- /**
- * Resolve the (possibly relative) URI acording to RFC1808 using the
- * default file base location. Resolves resource references into absolute
- * resource locations without ensuring that the resource actually exists.
- *
- * Note: currently resolveCrossProjectLinks is ignored in this
- * implementation.
- */
- public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
- }
-
- public String getLocationByURI(String uri, String baseReference) {
- if (uri == null)
- return null;
- /*
- * defect 244817 try { URL aURL = new URL(uri);
- */
- /**
- * An actual URL was given, but only the "file:///" protocol is
- * supported. Resolve the URI by finding the file to which it points.
- */
- /*
- * defect 244817 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$ return aURL.getFile(); } return
- * uri; } } catch (MalformedURLException mfuExc) { }
- */
- // defect 244817 start
- if (isFileURL(uri)) {
- try {
- URL url = new URL(uri);
- return getPath(url);
- }
- catch (MalformedURLException e) {
- }
- }
- // defect 244817 end
-
- // which of the serveral are we suppose to use here?
- //
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=71223
- // Workaround for problem in URIHelper; uris starting with '/' are
- // returned as-is.
- String location = null;
- if (uri.startsWith("/")) { //$NON-NLS-1$
- IProject p = getProject();
- if (p != null && p.isAccessible()) {
- IFile file = p.getFile(uri);
-
- if (file.getLocation() != null) {
- location = file.getLocation().toString();
- }
- if (location == null && file.getLocationURI() != null) {
- location = file.getLocationURI().toString();
- }
- if (location == null) {
- location = file.getFullPath().toString();
- }
- }
- }
- if(location == null) {
- location = URIHelper.normalize(uri, baseReference, getRootLocationString());
- }
- return location;
- }
-
- /**
- * Perform the getLocationByURI action using the baseReference as the
- * point of reference instead of the default for this resolver
- *
- * Note: currently resolveCrossProjectLinks is ignored in this
- * implementation.
- */
- public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, baseReference);
- }
-
- /**
- *
- * @param path
- * @param host
- * @return String
- */
- private String getPath(IPath path, String host) {
- IPath newPath = path;
- // They are potentially for only Windows operating system.
- // a.) if path has a device, and if it begins with IPath.SEPARATOR,
- // remove it
- final String device = path.getDevice();
- if ((device != null) && (device.length() > 0)) {
- if (device.charAt(0) == IPath.SEPARATOR) {
- final String newDevice = device.substring(1);
- newPath = path.setDevice(newDevice);
- }
- }
- // b.) if it has a hostname, it is UNC name... Any java or eclipse api
- // helps it ??
- if (path != null && host != null && host.length() != 0) {
- IPath uncPath = new Path(host);
- uncPath = uncPath.append(path);
- newPath = uncPath.makeUNC(true);
- }
- return newPath.toString();
- }
-
- /**
- *
- * @param url
- * @return String
- */
- private String getPath(URL url) {
- String ref = url.getRef() == null ? "" : "#" + url.getRef(); //$NON-NLS-1$ //$NON-NLS-2$
- String strPath = url.getFile() + ref;
- IPath path;
- if (strPath.length() == 0) {
- path = Path.ROOT;
- }
- else {
- path = new Path(strPath);
- String query = null;
- StringTokenizer parser = new StringTokenizer(strPath, "?"); //$NON-NLS-1$
- int tokenCount = parser.countTokens();
- if (tokenCount == 2) {
- path = new Path((String) parser.nextElement());
- query = (String) parser.nextElement();
- }
- if (query == null) {
- parser = new StringTokenizer(path.toString(), "#"); //$NON-NLS-1$
- tokenCount = parser.countTokens();
- if (tokenCount == 2) {
- path = new Path((String) parser.nextElement());
- }
- }
- }
- return getPath(path, url.getHost());
- }
-
- public org.eclipse.core.resources.IProject getProject() {
- return fProject;
- }
-
- public org.eclipse.core.resources.IContainer getRootLocation() {
- return fProject;
- }
-
- protected String getRootLocationString() {
- String location = null;
- if (fProject == null)
- return null;
- if (fProject.getLocation() != null) {
- location = fProject.getLocation().toString();
- }
- if (location == null && fProject.getLocationURI() != null) {
- location = fProject.getLocationURI().toString();
- }
- if (location == null) {
- location = fProject.getFullPath().toString();
- }
- return location;
- }
-
- public InputStream getURIStream(String uri) {
- return null;
- }
-
- // defect 244817 start
- /**
- *
- * @param passedSpec
- * @return boolean
- */
- private boolean isFileURL(String passedSpec) {
- if (passedSpec == null) {
- return false;
- }
- final String spec = passedSpec.trim();
- if (spec.length() == 0) {
- return false;
- }
- final int limit = spec.length();
- String newProtocol = null;
- for (int index = 0; index < limit; index++) {
- final char p = spec.charAt(index);
- if (p == '/') { //$NON-NLS-1$
- break;
- }
- if (p == ':') { //$NON-NLS-1$
- newProtocol = spec.substring(0, index);
- break;
- }
- }
- return (newProtocol != null && newProtocol.compareToIgnoreCase("file") == 0); //$NON-NLS-1$
- }
-
- public void setFileBaseLocation(String newFileBaseLocation) {
- fFileBaseLocation = newFileBaseLocation;
- }
-
- public void setProject(IProject newProject) {
- fProject = newProject;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java
deleted file mode 100644
index ab59ecbbc5..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java
+++ /dev/null
@@ -1,79 +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.sse.core.internal.util;
-
-import org.eclipse.core.resources.IFile;
-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.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-/**
- * @deprecated - makes assumptions on behalf of the requester
- */
-public class ResourceUtil {
-
- /**
- * Obtains the IFile for a model
- *
- * @param model
- * the model to use
- * @return the IFile used to create the model, if it came from an IFile,
- * null otherwise
- */
- public static IFile getFileFor(IStructuredModel model) {
- if (model == null)
- return null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = null;
- IPath location = new Path(model.getBaseLocation());
- // if the path is not a path in the file system and there are at least
- // 2 segments, it might be in the workspace
- IFile[] files = root.findFilesForLocation(location);
- if (files.length > 0) {
- file = files[0];
- }
- else if (location.segmentCount() > 1) {
- // remember, this IFile isn't guaranteed to exist
- file = root.getFile(location);
- }
- return file;
- }
-
- /**
- * Obtain IFiles from IStructuredModel (includes linkedResources)
- *
- * @return the corresponding files in the workspace, or an empty array if
- * none
- */
- public static IFile[] getFilesFor(IStructuredModel model) {
- if (model == null)
- return null;
-
- IFile[] files = null;
- IPath location = new Path(model.getBaseLocation());
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- // if the path is not a path in the file system and there are at least
- // 2 segments, it might be in the workspace
- if (!location.toFile().exists() && location.segmentCount() > 1) {
- // remember, this IFile isn't guaranteed to exist
- files = new IFile[]{root.getFile(location)};
- }
- else {
- files = root.findFilesForLocation(location);
- }
- return files;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java
deleted file mode 100644
index d886ba2ffe..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-/**
- * Contains list of script languages and mime types
- */
-public interface ScriptLanguageKeys {
-
- public static final String JAVA = "java"; //$NON-NLS-1$
-
- public static final String[] JAVA_LANGUAGE_KEYS = new String[]{"java"}; //$NON-NLS-1$
-
- public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
- public static final String[] JAVASCRIPT_LANGUAGE_KEYS = {"javascript", //$NON-NLS-1$
- "ecmascript", //$NON-NLS-1$
- "javascript1.0", //$NON-NLS-1$
- "javascript1.1", //$NON-NLS-1$
- "javascript1.2", //$NON-NLS-1$
- "javascript1.3", //$NON-NLS-1$
- "javascript1.4", //$NON-NLS-1$
- "javascript1.5", //$NON-NLS-1$
- "javascript1.6", //$NON-NLS-1$
- "jscript", //$NON-NLS-1$
- "sashscript"}; //$NON-NLS-1$
-
- public static final String[] JAVASCRIPT_MIME_TYPE_KEYS = {"text/javascript", //$NON-NLS-1$
- "application/ecmascript", //$NON-NLS-1$
- "application/javascript", //$NON-NLS-1$
- "application/x-ecmascript", //$NON-NLS-1$
- "application/x-javascript", //$NON-NLS-1$
- "text/ecmascript", //$NON-NLS-1$
- "text/javascript1.0", //$NON-NLS-1$
- "text/javascript1.1", //$NON-NLS-1$
- "text/javascript1.2", //$NON-NLS-1$
- "text/javascript1.3", //$NON-NLS-1$
- "text/javascript1.4", //$NON-NLS-1$
- "text/javascript1.5", //$NON-NLS-1$
- "text/jscript", //$NON-NLS-1$
- "text/livescript", //$NON-NLS-1$
- "text/x-ecmascript", //$NON-NLS-1$
- "text/x-javascript", //$NON-NLS-1$
- "text/sashscript"}; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
deleted file mode 100644
index 41cdf33265..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.util;
-
-
-
-/**
- * The SortOperation takes a collection of objects and returns a sorted
- * collection of these objects. Concrete instances of this class provide the
- * criteria for the sorting of the objects based on the type of the objects.
- */
-public abstract class Sorter {
-
- /**
- * Returns true iff elementTwo is 'greater than' elementOne. This is the
- * 'ordering' method of the sort operation. Each subclass overrides this
- * method with the particular implementation of the 'greater than' concept
- * for the objects being sorted. If elementOne and elementTwo are
- * equivalent in terms of their sorting order, this method must return
- * 'false'.
- */
- public abstract boolean compare(Object elementOne, Object elementTwo);
-
- /**
- * Sort the objects in the array and return the array.
- */
- private Object[] quickSort(Object[] array, int left, int right) {
- int originalLeft = left;
- int originalRight = right;
- Object mid = array[(left + right) / 2];
-
- do {
- while (compare(array[left], mid))
- left++;
- while (compare(mid, array[right]))
- right--;
- if (left <= right) {
- Object tmp = array[left];
- array[left] = array[right];
- array[right] = tmp;
- left++;
- right--;
- }
- } while (left <= right);
-
- if (originalLeft < right)
- array = quickSort(array, originalLeft, right);
- if (left < originalRight)
- array = quickSort(array, left, originalRight);
-
- return array;
- }
-
- /**
- * Return a new (quick)sorted array from this unsorted array. The original
- * array is not modified.
- */
- public Object[] sort(Object[] unSortedCollection) {
- int size = unSortedCollection.length;
- Object[] sortedCollection = new Object[size];
-
- //copy the array so can return a new sorted collection
- System.arraycopy(unSortedCollection, 0, sortedCollection, 0, size);
- if (size > 1)
- quickSort(sortedCollection, 0, size - 1);
-
- return sortedCollection;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java
deleted file mode 100644
index 423fa49d4f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java
+++ /dev/null
@@ -1,63 +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.sse.core.internal.util;
-
-
-
-/**
- * Collection of text functions.
- * @deprecated - the JFace class is public in 3.1
- */
-// This class was originally copied from org.eclipse.jface.text, and made
-// public
-public class TextUtilities {
- /**
- * Returns whether the text ends with one of the given search strings.
- */
- public static boolean endsWith(String[] searchStrings, String text) {
- for (int i = 0; i < searchStrings.length; i++) {
- if (text.endsWith(searchStrings[i]))
- return true;
- }
- return false;
- }
-
- /**
- * Returns the position in the string greater than offset of the longest
- * matching search string.
- */
- public static int[] indexOf(String[] searchStrings, String text, int offset) {
-
- int[] result = {-1, -1};
-
- for (int i = 0; i < searchStrings.length; i++) {
- int index = text.indexOf(searchStrings[i], offset);
- if (index >= 0) {
-
- if (result[0] == -1) {
- result[0] = index;
- result[1] = i;
- } else if (index < result[0]) {
- result[0] = index;
- result[1] = i;
- } else if (index == result[0] && searchStrings[i].length() > searchStrings[result[1]].length()) {
- result[0] = index;
- result[1] = i;
- }
- }
- }
-
- return result;
-
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java
deleted file mode 100644
index e2259eb4fd..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java
+++ /dev/null
@@ -1,81 +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.sse.core.internal.util;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-
-
-/**
- * @deprecated
- *
- * Should use extensible URIResolver from org.eclipse.wst.common.uriresolver
- * instead.
- */
-
-public interface URIResolver {
-
- String getFileBaseLocation();
-
- /**
- * Resolve the (possibly relative) URI acording to RFC1808 using the
- * default file base location. Resolves resource references into absolute
- * resource locations without ensuring that the resource actually exists.
- */
- String getLocationByURI(String uri);
-
- /**
- * Resolve the (possibly relative) URI acording to RFC1808 using the
- * default file base location. Resolves resource references into absolute
- * resource locations without ensuring that the resource actually exists.
- *
- * If resolveCrossProjectLinks is set to true, then this method will
- * properly resolve the URI if it is a valid URI to another (appropriate)
- * project.
- */
- String getLocationByURI(String uri, boolean resolveCrossProjectLinks);
-
- /**
- * Perform the getLocationByURI action using the baseReference as the
- * point of reference instead of the default for this resolver
- */
- String getLocationByURI(String uri, String baseReference);
-
- /**
- * Perform the getLocationByURI action using the baseReference as the
- * point of reference instead of the default for this resolver
- *
- * If resolveCrossProjectLinks is set to true, then this method will
- * properly resolve the URI if it is a valid URI to another (appropriate)
- * project.
- */
- String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks);
-
- IProject getProject();
-
- IContainer getRootLocation();
-
- /**
- * Attempts to return a direct inputstream to the given URI which must be
- * relative to the default point of reference.
- *
- */
- InputStream getURIStream(String uri);
-
- void setFileBaseLocation(String newLocation);
-
- void setProject(IProject newProject);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java
deleted file mode 100644
index 911c5e921c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java
+++ /dev/null
@@ -1,140 +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.sse.core.internal.util;
-
-
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.util.BufferedLimitedStream;
-
-
-
-public class Utilities {
-
- /**
- * a common calculation in some of the parsing methods (e.g. in
- * ContextRegion and IStructuredDocumentRegion)
- */
- public static int calculateLengthDifference(String changes, int lengthToReplace) {
- // determine the length by the text itself, or, if there is no text to
- // insert (i.e. we are doing a delete) then calculate the length as
- // a negative number to denote the amount to delete.
- // For a straight insert, the selection Length will be zero.
- int lengthDifference = 0;
- if (changes == null) {
- // the delete case
- lengthDifference = 0 - lengthToReplace;
- }
- else {
- lengthDifference = changes.length() - lengthToReplace;
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("lengthDifference: " + lengthDifference);//$NON-NLS-1$
- }
- return lengthDifference;
- }
-
- /**
- * Returns true iff both parameters are not null and the object is within
- * the array. Careful, this uses identity. Not good for basic strings.
- */
- public static boolean contains(Object[] objectArray, Object object) {
- boolean result = false;
- // if object or objectArray is null, return false
- if ((objectArray != null) && (object != null)) {
- for (int i = 0; i < objectArray.length; i++) {
- if (objectArray[i] == object) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
-
- public static boolean containsString(String[] objectArray, String object) {
- boolean result = false;
- // if object or objectArray is null, return false
- if ((objectArray != null) && (object != null)) {
- for (int i = 0; i < objectArray.length; i++) {
- if (objectArray[i].equals(object)) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Ensures that an InputStream has mark/reset support, is readlimit is
- * set, and that the stream is "limitable" (that is, reports "end of
- * input" rather than allow going past mark). This is very specialized
- * stream introduced to overcome
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67211. See also
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68565
- */
- public static InputStream getLimitedStream(InputStream original) {
- if (original == null)
- return null;
- if (original instanceof BufferedLimitedStream)
- return original;
- return new BufferedLimitedStream(original, CodedIO.MAX_BUF_SIZE);
- }
-
- /**
- * <p>
- * Ensures that an InputStream has mark/reset support.
- * </p>
- * <p>
- * It's vital that a BufferedInputStream <b>not</b> be wrapped in another
- * BufferedInputStream as each can preemptively consume <i>n</i> bytes
- * (e.g. 2048) from the parent stream before any requests are made. The
- * cascading effect is that the second/inner BufferedInputStream can never
- * rewind itself to the first <i>n</i> bytes since they were already
- * consumed by its parent.
- * </p>
- */
- public static InputStream getMarkSupportedStream(InputStream original) {
- if (original == null)
- return null;
- if (original.markSupported())
- return original;
- InputStream buffered = new BufferedInputStream(original, CodedIO.MAX_BUF_SIZE);
- buffered.mark(CodedIO.MAX_MARK_SIZE);
- return buffered;
- }
-
- /**
- * Used for log/trace messages. Id is assumed to be some form of a
- * filename. See IModelManager.
- */
- public static String makeShortId(Object id) {
- if (id == null)
- id = "NOID";//$NON-NLS-1$
- String whole = id.toString();
- String part = whole.substring(whole.lastIndexOf("/") + 1); //$NON-NLS-1$
- return "..." + part; //$NON-NLS-1$
- }
-
-
- /**
- * Utilities constructor comment.
- */
- public Utilities() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ErrorInfo.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ErrorInfo.java
deleted file mode 100644
index d36b92cb9b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ErrorInfo.java
+++ /dev/null
@@ -1,26 +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.sse.core.internal.validate;
-
-
-
-public interface ErrorInfo {
-
- public String getHint();
-
- public int getLength();
-
- public int getOffset();
-
- public int getState();
-
- public short getTargetType();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java
deleted file mode 100644
index 336020ee36..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java
+++ /dev/null
@@ -1,31 +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.sse.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-/**
- */
-public interface ValidationAdapter extends INodeAdapter {
-
- /**
- */
- void setReporter(ValidationReporter reporter);
-
- /**
- */
- void validate(IndexedRegion node);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java
deleted file mode 100644
index 5f2f6057a4..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java
+++ /dev/null
@@ -1,70 +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.wst.sse.core.internal.validate;
-
-
-
-/**
- */
-public class ValidationMessage {
- public static final int IGNORE = -1;
- public static final int ERROR = 1;
- public static final int INFORMATION = 3;
- public static final int WARNING = 2;
- private int length;
-
- private String message;
- private int offset;
- private int severity;
-
- /**
- */
- public ValidationMessage(String message, int offset, int severity) {
- this(message, offset, 0, severity);
- }
-
- /**
- */
- public ValidationMessage(String message, int offset, int length, int severity) {
- super();
-
- this.message = message;
- this.offset = offset;
- this.length = length;
- this.severity = severity;
- }
-
- /**
- */
- public int getLength() {
- return this.length;
- }
-
- /**
- */
- public String getMessage() {
- return this.message;
- }
-
- /**
- */
- public int getOffset() {
- return this.offset;
- }
-
- /**
- */
- public int getSeverity() {
- return this.severity;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java
deleted file mode 100644
index 82a06b576d..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.validate;
-
-
-
-
-/**
- */
-public interface ValidationReporter {
-
- /**
- */
- void report(ValidationMessage message);
-
- void report(ErrorInfo info);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
deleted file mode 100644
index c34c2718dc..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.sse.core.internal.validate;
-
-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.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.validation.IValidatorGroupListener;
-import org.eclipse.wst.validation.ValidationState;
-
-public class ValidatorGroupListener implements IValidatorGroupListener {
-
- Map fDiagnosticMap = new HashMap();
- private static final boolean _debug = false;
-
- public ValidatorGroupListener() {
- }
-
- protected void finalize() throws Throwable {
- super.finalize();
- if (fDiagnosticMap != null && !fDiagnosticMap.isEmpty()) {
- Object[] paths = fDiagnosticMap.keySet().toArray();
- for (int i = 0; i < paths.length; i++) {
- Logger.log(Logger.ERROR, "Leaked model: " + paths[i]);
- validationFinishing(ResourcesPlugin.getWorkspace().getRoot().getFile((IPath) paths[i]), new NullProgressMonitor(), null);
- }
- }
- }
-
- public void validationFinishing(IResource resource, IProgressMonitor monitor, ValidationState state) {
- if (_debug)
- System.out.println("Finishing:" + resource.getFullPath());
- if (resource.getType() != IResource.FILE)
- return;
-
- IStructuredModel model = (IStructuredModel) fDiagnosticMap.remove(resource.getFullPath());
- if (model != null) {
- model.releaseFromRead();
- }
- }
-
- public void validationStarting(IResource resource, IProgressMonitor monitor, ValidationState state) {
- if (_debug)
- System.out.println("Starting: " + resource.getFullPath());
- try {
- if (monitor != null && !monitor.isCanceled()) {
- if (resource.getType() != IResource.FILE)
- return;
-
- IModelManager modelManager = StructuredModelManager.getModelManager();
- // possible when shutting down
- if (modelManager != null) {
- IStructuredModel model = modelManager.getModelForRead((IFile) resource);
- if (model != null) {
- fDiagnosticMap.put(resource.getFullPath(), model);
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java
deleted file mode 100644
index e1cfc2461c..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java
+++ /dev/null
@@ -1,24 +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.sse.core.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partitioning for StructuredDocuments.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @since 1.1
- */
-public interface IStructuredPartitions {
-
- String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$
- String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
deleted file mode 100644
index 72dca7d6ac..0000000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
+++ /dev/null
@@ -1,751 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalio) - bug 300430 - String concatenation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.core.utils;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-
-public class StringUtils {
- protected static final String AMPERSTAND = "&"; //$NON-NLS-1$
- protected static final String AMPERSTAND_ENTITY = "&&;"; //$NON-NLS-1$
- protected static final String CARRIAGE_RETURN = "\r"; //$NON-NLS-1$
- protected static final String CARRIAGE_RETURN_ENTITY = "\\r"; //$NON-NLS-1$
- protected static final String CR = "\r"; //$NON-NLS-1$
- protected static final String CRLF = "\r\n"; //$NON-NLS-1$
- protected static final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
- protected static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$
- protected static final char DOUBLE_QUOTE_CHAR = '\"'; //$NON-NLS-1$
- protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
-
- protected static final String EQUAL_SIGN = "="; //$NON-NLS-1$
- protected static final String EQUAL_SIGN_ENTITY = "&#61;"; //$NON-NLS-1$
- private static final String FALSE = "false"; //$NON-NLS-1$
- protected static final String GREATER_THAN = ">"; //$NON-NLS-1$
- protected static final String GREATER_THAN_ENTITY = "&gt;"; //$NON-NLS-1$
- protected static final String LESS_THAN = "<"; //$NON-NLS-1$
- protected static final String LESS_THAN_ENTITY = "&lt;"; //$NON-NLS-1$
- protected static final String LF = "\n"; //$NON-NLS-1$
- protected static final String LINE_FEED = "\n"; //$NON-NLS-1$
- protected static final String LINE_FEED_ENTITY = "\\n"; //$NON-NLS-1$
- protected static final String LINE_FEED_TAG = "<dl>"; //$NON-NLS-1$
- protected static final String LINE_TAB = "\t"; //$NON-NLS-1$
- protected static final String LINE_TAB_ENTITY = "\\t"; //$NON-NLS-1$
- protected static final String LINE_TAB_TAG = "<dd>"; //$NON-NLS-1$
- protected static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
- protected static final char SINGLE_QUOTE_CHAR = '\''; //$NON-NLS-1$
- protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
- protected static final String SPACE = " "; //$NON-NLS-1$
- protected static final String SPACE_ENTITY = "&nbsp;"; //$NON-NLS-1$
- private static final String TRUE = "true"; //$NON-NLS-1$
-
- /**
- * Append appendString to the end of aString only if aString does not end
- * with the insertString.
- */
- public static String appendIfNotEndWith(String aString, String appendString) {
- if ((aString != null) && (appendString != null))
- if (aString.endsWith(appendString))
- return aString;
- else
- return aString + appendString;
- else
- return aString;
- }
-
- /**
- * Breaks out space-separated words into an array of words. For example:
- * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
- * <code>a[1]= "comment"</code>.
- *
- * @param value
- * the string to be converted
- * @return the list of words
- */
- public static String[] asArray(String value) {
- ArrayList list = new ArrayList();
- StringTokenizer stok = new StringTokenizer(value);
- while (stok.hasMoreTokens()) {
- list.add(stok.nextToken());
- }
- String result[] = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- /**
- * Breaks out delim-separated words into an array of words. For example:
- * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
- * <code>a[1]= "comment"</code>.
- *
- * @param value
- * the string to be converted
- * @return the list of words
- */
- public static String[] asArray(String value, String delim) {
- return asArray(value, delim, false);
- }
-
- /**
- * Breaks out delim-separated words into an array of words. For example:
- * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
- * <code>a[1]= "comment"</code>.
- *
- * @param value
- * the string to be converted
- * @return the list of words
- */
- public static String[] asArray(String value, String delim, boolean returnTokens) {
- ArrayList list = new ArrayList();
- StringTokenizer stok = new StringTokenizer(value, delim, returnTokens);
- while (stok.hasMoreTokens()) {
- list.add(stok.nextToken());
- }
- String result[] = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- /**
- * Breaks out delim-separated words into an array of words. For example:
- * <code>"abc,,def"</code> into an array <code>a[0]="abc"</code>,
- * <code>a[1]=null</code>, and <code>a[2]= "def"</code> where "," is
- * the delim.
- *
- * @param value
- * the string to be converted
- * @return the list of words
- */
- public static String[] asFixedArray(String value, String delim) {
- String array[] = asArray(value, delim, true);
- int arrayLength = array.length;
- boolean stringFound = false;
- ArrayList list = new ArrayList();
-
- for (int i = 0; i < arrayLength; i++) {
- String token = array[i];
- if (token.compareTo(delim) == 0) {
- if (!stringFound)
- list.add(null);
- stringFound = false;
- }
- else {
- list.add(token);
- stringFound = true;
- }
- }
- // add one more null if last token is the delim
- if (!stringFound)
- list.add(null);
-
- String result[] = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- public static String chop(String source) {
- return chop(source, "/"); //$NON-NLS-1$
- }
-
- public static String chop(String source, String delimiter) {
- return source.substring(0, source.lastIndexOf(delimiter));
- }
-
- public static boolean contains(String[] arrayOfStrings, String needle, boolean caseSensitive) {
- boolean result = false;
- if (needle == null)
- return false;
- if (arrayOfStrings == null)
- return false;
-
- if (caseSensitive) {
- for (int i = 0; i < arrayOfStrings.length; i++) {
- if (needle.equals(arrayOfStrings[i])) {
- result = true;
- break;
- }
- }
- }
- else {
- for (int i = 0; i < arrayOfStrings.length; i++) {
- if (needle.equalsIgnoreCase(arrayOfStrings[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
-
- public static boolean containsLetters(String fullValue) {
-
- if (fullValue == null || fullValue.length() == 0)
- return false;
-
- char[] chars = fullValue.toCharArray();
- for (int i = 0; i < fullValue.length(); i++)
- if (Character.isLetter(chars[i]))
- return true;
-
- return false;
- }
-
- public static boolean containsLineDelimiter(String aString) {
- return indexOfLineDelimiter(aString) != -1;
- }
-
- public static String convertLineDelimiters(String allText, String lineDelimiterToUse) {
- IDocument tempDoc = new Document(allText);
-
- if (lineDelimiterToUse == null)
- lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
-
- String newText = ""; //$NON-NLS-1$
- int lineCount = tempDoc.getNumberOfLines();
- StringBuffer sb = new StringBuffer(newText);
- for (int i = 0; i < lineCount; i++) {
- try {
- org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
- int lineStartOffset = lineInfo.getOffset();
- int lineLength = lineInfo.getLength();
- int lineEndOffset = lineStartOffset + lineLength;
- sb.append(allText.substring(lineStartOffset, lineEndOffset));
-
- if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null)) {
- sb.append(lineDelimiterToUse);
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- newText = sb.toString();
-
- return newText;
- }
-
- /**
- * Replaces all instances of special HTML characters with the appropriate
- * HTML entity equivalent. WARNING only use this method for strings that
- * dont already have HTML-specific items such as tags and entities.
- *
- * @param String
- * content String to convert
- *
- * @return String the converted string
- * @see HTMLPrinter#convertToHTMLContent(String content)
- */
- public static String convertToHTMLContent(String content) {
- content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
- content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
- content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
- content = replace(content, LINE_FEED, LINE_FEED_TAG);
- content = replace(content, LINE_TAB, LINE_TAB_TAG);
- content = replace(content, SINGLE_QUOTE, SINGLE_QUOTE_ENTITY);
- content = replace(content, DOUBLE_QUOTE, DOUBLE_QUOTE_ENTITY);
- content = replace(content, SPACE + SPACE, SPACE_ENTITY + SPACE_ENTITY); // replacing
- // every
- // space
- // would
- // be
- // too
- // much
- return content;
- }
-
- /**
- * Converts a string into a form that will not conflict with saving it
- * into an INI file
- */
- public static String escape(String normalString) {
- if (normalString == null)
- return null;
- StringBuffer escapedBuffer = new StringBuffer();
- StringTokenizer toker = new StringTokenizer(normalString, EQUAL_SIGN + LINE_FEED + CARRIAGE_RETURN + LINE_TAB, true);
- String chunk = null;
- while (toker.hasMoreTokens()) {
- chunk = toker.nextToken();
- if (chunk.equals(EQUAL_SIGN)) {
- escapedBuffer.append(EQUAL_SIGN_ENTITY);
- }
- else if (chunk.equals(LINE_FEED)) {
- escapedBuffer.append(LINE_FEED_ENTITY);
- }
- else if (chunk.equals(CARRIAGE_RETURN)) {
- escapedBuffer.append(CARRIAGE_RETURN_ENTITY);
- }
- else if (chunk.equals(LINE_TAB)) {
- escapedBuffer.append(LINE_TAB_ENTITY);
- }
- else {
- escapedBuffer.append(chunk);
- }
- }
- return escapedBuffer.toString();
- }
-
- /**
- * Returns the first line of the given text without a trailing delimiter
- *
- * @param text
- * @return
- */
- public static String firstLineOf(String text) {
- if (text == null || text.length() < 1) {
- return text;
- }
- IDocument doc = new Document(text);
- try {
- int lineNumber = doc.getLineOfOffset(0);
- IRegion line = doc.getLineInformation(lineNumber);
- return doc.get(line.getOffset(), line.getLength());
- }
- catch (BadLocationException e) {
- // do nothing
- }
- return text;
- }
-
- public static int indexOfLastLineDelimiter(String aString) {
- return indexOfLastLineDelimiter(aString, aString.length());
- }
-
- public static int indexOfLastLineDelimiter(String aString, int offset) {
- int index = -1;
-
- if (aString != null && aString.length() > 0) {
- index = aString.lastIndexOf(CRLF, offset);
- if (index == -1) {
- index = aString.lastIndexOf(CR, offset);
- if (index == -1)
- index = aString.lastIndexOf(LF, offset);
- }
- }
-
- return index;
- }
-
- public static int indexOfLineDelimiter(String aString) {
- return indexOfLineDelimiter(aString, 0);
- }
-
- public static int indexOfLineDelimiter(String aString, int offset) {
- int index = -1;
-
- if (aString != null && aString.length() > 0) {
- index = aString.indexOf(CRLF, offset);
- if (index == -1) {
- index = aString.indexOf(CR, offset);
- if (index == -1)
- index = aString.indexOf(LF, offset);
- }
- }
-
- return index;
- }
-
- public static int indexOfNonblank(String aString) {
- return indexOfNonblank(aString, 0);
- }
-
- public static int indexOfNonblank(String aString, int offset) {
- int index = -1;
-
- if (aString != null && aString.length() > 0) {
- for (int i = offset; i < aString.length(); i++) {
- if (DELIMITERS.indexOf(aString.substring(i, i + 1)) == -1) {
- index = i;
- break;
- }
- }
- }
-
- return index;
- }
-
- /**
- * Insert insertString to the beginning of aString only if aString does
- * not start with the insertString.
- */
- public static String insertIfNotStartWith(String aString, String insertString) {
- if ((aString != null) && (insertString != null))
- if (aString.startsWith(insertString))
- return aString;
- else
- return insertString + aString;
- else
- return aString;
- }
-
- public static boolean isQuoted(String string) {
- if ((string == null) || (string.length() < 2))
- return false;
-
- int lastIndex = string.length() - 1;
- char firstChar = string.charAt(0);
- char lastChar = string.charAt(lastIndex);
-
- return (((firstChar == SINGLE_QUOTE_CHAR) && (lastChar == SINGLE_QUOTE_CHAR)) || ((firstChar == DOUBLE_QUOTE_CHAR) && (lastChar == DOUBLE_QUOTE_CHAR)));
- }
-
- /**
- * Unit tests.
- *
- * @param args
- * java.lang.String[]
- */
- public static void main(String[] args) {
- // testPaste();
- testStripNonLetterDigits();
- }
-
- /*
- * Returns the merged form of both strings
- */
- public static String merge(String newStart, String newEnd) {
- String[] regions = overlapRegions(newStart, newEnd);
- return regions[0] + regions[1] + regions[2];
- }
-
- public static int occurrencesOf(String searchString, char targetChar) {
- int result = 0;
- int len = searchString.length();
- for (int i = 0; i < len; i++) {
- if (targetChar == searchString.charAt(i))
- result++;
- }
- return result;
- }
-
- /**
- *
- * @return java.lang.String[]
- * @param start
- * java.lang.String
- * @param end
- * java.lang.String
- *
- * Returns a 3 String array containing unique text from the start,
- * duplicated text that overlaps the start and end, and the unique text
- * from the end.
- */
- private static String[] overlapRegions(String start, String end) {
- String[] results = null;
- if (start != null && end == null) {
- results = new String[]{start, "", ""}; //$NON-NLS-2$//$NON-NLS-1$
- }
- else if (start == null && end != null) {
- results = new String[]{"", "", end}; //$NON-NLS-2$//$NON-NLS-1$
- }
- else if (start == null && end == null) {
- results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
- else if (start != null && end != null) {
-
- int startLength = start.length();
- int endLength = end.length();
-
- if (startLength == 0 || endLength == 0) {
- results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
- else {
- results = new String[3];
- String testStart = ""; //$NON-NLS-1$
- String testEnd = ""; //$NON-NLS-1$
- int mergeLength = Math.min(startLength, endLength);
- boolean finished = false;
- while (mergeLength > 0 && !finished) {
- testStart = start.substring(startLength - mergeLength);
- testEnd = end.substring(0, mergeLength);
- // case sensitive
- if (testStart.equals(testEnd)) {
- finished = true;
- results[0] = start.substring(0, startLength - mergeLength);
- results[1] = start.substring(startLength - mergeLength);
- results[2] = end.substring(mergeLength);
- }
- mergeLength--;
- }
- if (!finished) {
- results[0] = start;
- results[1] = ""; //$NON-NLS-1$
- results[2] = end;
- }
- }
- }
- return results;
- }
-
- /**
- * Packs an array of Strings into a single comma delimited String.
- *
- * @param strings
- * @return
- * @todo Generated comment
- */
- public static String pack(String[] strings) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < strings.length; i++) {
- buf.append(StringUtils.replace(strings[i], ",", "&comma;")); //$NON-NLS-1$ //$NON-NLS-2$
- if (i < strings.length - 1)
- buf.append(","); //$NON-NLS-1$
- }
- return buf.toString();
- }
-
- /*
- * Pastes the new text into the old at the start position, replacing text
- * implied by length.
- */
- public static String paste(String oldText, String newText, int start, int length) {
- String result = null;
- StringBuffer sb = new StringBuffer();
- int startIndex = start;
- int endIndex = start + length;
- if (startIndex > oldText.length()) {
- startIndex = oldText.length();
- }
- sb.append(oldText.substring(0, startIndex));
- // null or empty new text accompliches a delete
- if (newText != null) {
- sb.append(newText);
- }
- if (endIndex < oldText.length()) {
-
- sb.append(oldText.substring(endIndex));
- }
- result = sb.toString();
- return result;
- }
-
- /**
- * Replace matching literal portions of a string with another string
- */
- public static String replace(String aString, String source, String target) {
- if (aString == null)
- return null;
- String normalString = ""; //$NON-NLS-1$
- int length = aString.length();
- int position = 0;
- int previous = 0;
- int spacer = source.length();
- StringBuffer sb = new StringBuffer(normalString);
- while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
- position = aString.indexOf(source, previous);
- sb.append(normalString);
- sb.append(aString.substring(previous, position));
- sb.append(target);
- position += spacer;
- previous = position;
- }
- sb.append(aString.substring(position, aString.length()));
- normalString = sb.toString();
-
- return normalString;
- }
-
- /**
- * Restore the entity references for markup delimiters in text where they
- * have been replaced by the proper Unicode values through a DOM text
- * parser.
- */
- public static String restoreMarkers(String text) {
- String content = text;
- content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
- content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
- content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
- return content;
- }
-
- /**
- * Removes extra whitespace characters and quotes
- */
- public static String strip(String quotedString) {
- if (quotedString == null || quotedString.length() == 0)
- return quotedString;
- String trimmed = quotedString.trim();
- if (trimmed.length() < 2)
- return quotedString;
-
- char first = trimmed.charAt(0);
- char nextToLast = trimmed.charAt(trimmed.length() - 2);
- char last = trimmed.charAt(trimmed.length() - 1);
-
- if ((first == '\"' && last == '\"' && nextToLast != '\\') || (first == '\'' && last == '\'' && nextToLast != '\\')) {
- return trimmed.substring(1, trimmed.length() - 1);
- }
- return trimmed;
- }
-
- /**
- * This method strips anything from the beginning and end of a string that
- * is not a letter or digit. It is used by some encoding detectors to come
- * up with the encoding name from illformed input (e.g in <?xml
- * encoding="abc?> -- where final quote is left off, the '>' is returned
- * with the rest of the attribute value 'abc').
- */
- public static String stripNonLetterDigits(String fullValue) {
- if (fullValue == null || fullValue.length() == 0)
- return fullValue;
- int fullValueLength = fullValue.length();
- int firstPos = 0;
- while (firstPos < fullValueLength && !Character.isLetterOrDigit(fullValue.charAt(firstPos))) {
- firstPos++;
- }
- int lastPos = fullValueLength - 1;
- while (lastPos > firstPos && !Character.isLetterOrDigit(fullValue.charAt(lastPos))) {
- lastPos--;
- }
- String result = fullValue;
- if (firstPos != 0 || lastPos != fullValueLength) {
- result = fullValue.substring(firstPos, lastPos + 1);
- }
- return result;
- }
-
- /**
- * Similar to strip, except quotes don't need to match such as "UTF' is
- * still stripped of both quotes. (Plus, this one does not detect escaped
- * quotes)
- */
- public static String stripQuotes(String quotedValue) {
- if (quotedValue == null)
- return null;
- // normally will never have leading or trailing blanks,
- // but if it does, we'll do lenient interpretation
- return stripQuotesLeaveInsideSpace(quotedValue).trim();
- }
-
- /**
- * Like strip quotes, except leaves the start and end space inside the
- * quotes
- *
- * @param quotedValue
- * @return
- */
- public static String stripQuotesLeaveInsideSpace(String quotedValue) {
- if (quotedValue == null)
- return null;
- // nomally will never have leading or trailing blanks ... but just in
- // case.
- String result = quotedValue.trim();
- int len = result.length();
- if (len > 0) {
- char firstChar = result.charAt(0);
- if ((firstChar == SINGLE_QUOTE_CHAR) || (firstChar == DOUBLE_QUOTE_CHAR)) {
- result = result.substring(1, len);
- }
- len = result.length();
- if (len > 0) {
- char lastChar = result.charAt(len - 1);
- if ((lastChar == SINGLE_QUOTE_CHAR) || (lastChar == DOUBLE_QUOTE_CHAR)) {
- result = result.substring(0, len - 1);
- }
- }
- }
- return result;
- }
-
- public static void testPaste() {
- String testString = "The quick brown fox ..."; //$NON-NLS-1$
- System.out.println(paste(testString, null, 4, 5));
- System.out.println(paste(testString, null, 4, 6));
- System.out.println(paste(testString, "", 4, 6)); //$NON-NLS-1$
- System.out.println(paste(testString, "fast", 4, 6)); //$NON-NLS-1$
- System.out.println(paste(testString, "fast ", 4, 6)); //$NON-NLS-1$
- System.out.println(paste(testString, "But ", 0, 0)); //$NON-NLS-1$
- System.out.println(paste("", "burp", 4, 6)); //$NON-NLS-2$//$NON-NLS-1$
- }
-
- public static void testStripNonLetterDigits() {
- String testString = "abc"; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = ""; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = "\"abc\""; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = "\"ab-c1?"; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = "+++"; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = "abc="; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
- testString = "abc "; //$NON-NLS-1$
- System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- public static String toString(boolean booleanValue) {
- if (booleanValue)
- return TRUE;
- else
- return FALSE;
- }
-
- /**
- * Remove "escaped" chars from a string.
- */
- public static String unescape(String aString) {
- if (aString == null)
- return null;
- String normalString = replace(aString, EQUAL_SIGN_ENTITY, EQUAL_SIGN);
- normalString = replace(normalString, LINE_FEED_ENTITY, LINE_FEED);
- normalString = replace(normalString, CARRIAGE_RETURN_ENTITY, CARRIAGE_RETURN);
- normalString = replace(normalString, LINE_TAB_ENTITY, LINE_TAB);
- return normalString;
- }
-
- public static String uniqueEndOf(String newStart, String newEnd) {
- String[] regions = overlapRegions(newStart, newEnd);
- return regions[2];
- }
-
- /**
- * Unpacks a comma delimited String into an array of Strings
- *
- * @param s
- * @return
- * @todo Generated comment
- */
- public static String[] unpack(String s) {
- if (s == null)
- return new String[0];
- StringTokenizer toker = new StringTokenizer(s, ","); //$NON-NLS-1$
- List list = new ArrayList();
- while (toker.hasMoreTokens()) {
- // since we're separating the values with ',', escape ',' in the
- // values
- list.add(StringUtils.replace(toker.nextToken(), "&comma;", ",").trim()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return (String[]) list.toArray(new String[0]);
- }
-
- /**
- * StringUtils constructor comment.
- */
- private StringUtils() {
- super();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/.classpath b/bundles/org.eclipse.wst.sse.ui/.classpath
deleted file mode 100644
index 3a7715ca8b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-extensions"/>
- <classpathentry kind="src" path="src-encoding"/>
- <classpathentry kind="src" path="src-tasktags"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/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/validation/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.sse.ui/.cvsignore b/bundles/org.eclipse.wst.sse.ui/.cvsignore
deleted file mode 100644
index 2b6bc40b23..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-editor.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.ui_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.sse.ui/.options b/bundles/org.eclipse.wst.sse.ui/.options
deleted file mode 100644
index cfbecf34f1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.options
+++ /dev/null
@@ -1,73 +0,0 @@
-org.eclipse.wst.sse.ui/debug=true
-org.eclipse.wst.sse.ui/debug/tracefilter=
-
-#org.eclipse.wst.sse.ui.edit.util.ActionContributer._showDebugStatus
-org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields=true
-
-
-#org.eclipse.wst.sse.ui.extension.TransferBuilder.debugTime
-org.eclipse.wst.sse.ui/transferbuilder/time=false
-
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder=false
-#org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder.debugTime
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time=false
-
-
-org.eclipse.wst.sse.ui/extendededitoractionbuilder=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugReadTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugContributeTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime=false
-
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugMenu
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugPopup
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugToolbar
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar=false
-
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugOperations
-org.eclipse.wst.sse.ui/filemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugLifecyclelistener
-org.eclipse.wst.sse.ui/filemodelprovider/lifecyclelistener=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugModelStatelistener
-org.eclipse.wst.sse.ui/filemodelprovider/modelstatelistener=false
-
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugOperations
-org.eclipse.wst.sse.ui/storagemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugElementStatelistener
-org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener=false
-
-org.eclipse.wst.sse.ui/contentOutline=false
-org.eclipse.wst.sse.ui/propertySheet=false
-
-#org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateActionContributionItem.debug
-org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerjob=false
-
-#org.eclipse.wst.sse.ui.internal.GotoAnnotationAction._debug
-org.eclipse.wst.sse.ui/gotoNextAnnotation=false
-
-org.eclipse.wst.sse.ui/preferences-properties=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerSpelling=false
-org.eclipse.wst.sse.ui/debug/reconcilerSpelling/showProblems=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerValidators=false
-#org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy
-org.eclipse.wst.sse.ui/debug/reconcilerValidatorSupported=false
-org.eclipse.wst.sse.ui/debug/reconcilerValidatorEnablement=false
-
-org.eclipse.wst.sse.ui/structuredPresentationReconciler=false
-org.eclipse.wst.sse.ui/structuredPresentationReconciler/time=false
diff --git a/bundles/org.eclipse.wst.sse.ui/.project b/bundles/org.eclipse.wst.sse.ui/.project
deleted file mode 100644
index 78bd94c674..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.ui</name>
- <comment></comment>
- <projects></projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.sse.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.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 26b0cde4e0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,91 +0,0 @@
-#Wed Apr 30 02:03:18 EDT 2008
-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.fatalOptionalError=enabled
-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.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=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.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-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.unusedParameterIncludeDocCommentReference=enabled
-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.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 6ad0dd808e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu Nov 16 00:51:27 EST 2006
-eclipse.preferences.version=1
-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.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 52ce9daca3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,25 +0,0 @@
-#Thu Aug 14 03:59:55 EDT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.illegal-att-value=0
-compilers.p.internal=1
-compilers.p.missing-packages=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=1
-compilers.p.unknown-element=0
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index e4c61fa9d0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,70 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.3.2.qualifier
-Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.ui.contentassist,
- org.eclipse.wst.sse.ui.internal;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.actions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentassist;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentoutline;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentproperties.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.correction;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.debug;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.derived;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.edit.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.editor;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.encoding.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.extension;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.format;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.handlers;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.hyperlink;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.openon;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.projection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.properties;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.registry;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.style;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile.validator;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.search;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.selection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.spelling;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.taginfo;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.text;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.view.events;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.preferences,
- org.eclipse.wst.sse.ui.quickoutline,
- org.eclipse.wst.sse.ui.reconcile,
- org.eclipse.wst.sse.ui.typing,
- org.eclipse.wst.sse.ui.views.contentoutline,
- org.eclipse.wst.sse.ui.views.properties
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
- org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.emf.common;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.sse.ui/README.txt b/bundles/org.eclipse.wst.sse.ui/README.txt
deleted file mode 100644
index efe452223f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The base editor of the sse framework. It provides the hooks for content assist,
-breakpoints, debugging, open-on, quickfix, spell checking and a content outline. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/about.html b/bundles/org.eclipse.wst.sse.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>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.sse.ui/build.properties b/bundles/org.eclipse.wst.sse.ui/build.properties
deleted file mode 100644
index a080c98d8b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/build.properties
+++ /dev/null
@@ -1,30 +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
-#
-###############################################################################
-bin.includes = plugin.xml,\
- .options,\
- .,\
- icons/,\
- plugin.properties,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = toc.xml,\
- testToc.xml,\
- schema/,\
- html/
-source.. = src/,\
- src-extensions/,\
- src-encoding/,\
- src-tasktags/
diff --git a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html b/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
deleted file mode 100644
index a476078ace..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Main Topic</title>
-</head>
-
-<body>
-<h1>Main Topic</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html b/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
deleted file mode 100644
index 8a61c501d6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Sub Topic</title>
-</head>
-
-<body>
-<h1>Sub Topic</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/toc.html b/bundles/org.eclipse.wst.sse.ui/html/toc.html
deleted file mode 100644
index 326f0a9ff3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/toc.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Table of Contents</title>
-</head>
-
-<body>
-<h1>Table of Contents</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
deleted file mode 100644
index c71de32fce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
deleted file mode 100644
index 7dc0de5130..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
deleted file mode 100644
index 2e197c25e8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
deleted file mode 100644
index 4b9e567edd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
deleted file mode 100644
index a4cf55ffe9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
deleted file mode 100644
index a2d80a9044..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
deleted file mode 100644
index 0ae6decd03..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/filter_ps.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/filter_ps.gif
deleted file mode 100644
index a4c9e60e25..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/filter_ps.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
deleted file mode 100644
index 05cefef687..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
deleted file mode 100644
index c71de32fce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
deleted file mode 100644
index 9e033dea5f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
deleted file mode 100644
index 4c07fea144..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
deleted file mode 100644
index 3aec64dbdd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties
deleted file mode 100644
index 56f1e2a03e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.properties
+++ /dev/null
@@ -1,122 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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
-# David Carver - bug 212330 - migrate to org.eclipse.ui.menus extension point
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source Editor
-Standalone_Structured_Source_Editor.name=Standalone Structured Source Editor
-# Names on preferences pages
-Structured_Text_Editor.name=Structured Text Editors
-Task_Tags_Preferences.name=Task Tags
-
-#
-sourceEditorFontDefiniton.label=Structured Text Editor Text Font
-sourceEditorFontDefintion.description=The Structured text editor text font is used by Structured text editors.
-
-Adapter_Factory_Description_Extension.name=Adapter Factory Description Extension
-Extended_Editor_Actions_Extension.name=Extended Editor Actions Extension
-Drop_Target_Transfers_Extension.name=Drop Target Transfers Extension
-Extended_Editor_Configuration_Extension.name=Extended Editor Configuration Extension
-quickFixProcessor=Quick Fix Processor Extension
-Semantic_Highlighting_Extension.name=Semantic Highlighting Extension
-Character_Pairing.name=Character Pairing Extension
-Completion_Proposal.name=Completion Proposal
-Completion_Proposal_Categories_Configuration.name=Completion Proposal Categories Configuration
-Commenting_Strategy_Extension.name=Commenting Strategy Extension
-##########################################################################
-# These strings are used in Workbench Keys Preferences
-##########################################################################
-scope.structuredTextEditor.name=Editing in Structured Text Editors
-scope.structuredTextEditor.description=Editing in Structured Text Editors
-scope.structuredTextEditor.comments.description=Source Comments in Structured Text Editors
-scope.structuredTextEditor.comments.name=Source Comments in Structured Text Editors
-command.toggle.comment.name=Toggle Comment
-command.toggle.comment.description=Toggle Comment
-command.toggle.comment.mnemonic=T
-command.add.block.comment.name=Add Block Comment
-command.add.block.comment.description=Add Block Comment
-command.add.block.comment.mnemonic=A
-command.remove.block.comment.name=Remove Block Comment
-command.remove.block.comment.description=Remove Block Comment
-command.remove.block.comment.mnemonic=R
-command.cleanup.document.name=Cleanup Document...
-command.cleanup.document.description=Cleanup document
-command.cleanup.document.mnemonic=C
-command.format.document.name=Format
-command.format.document.description=Format selection
-command.format.document.mnemonic=F
-command.format.active.elements.name=Format Active Elements
-command.format.active.elements.description=Format active elements
-command.format.active.elements.mnemonic=i
-command.open.file.from.source.name=Open Selection
-command.open.file.from.source.description=Open an editor on the selected link
-command.open.file.from.source.mnemonic=O
-command.search.find.occurrences.name=Occurrences in File
-command.search.find.occurrences.description=Find occurrences of the selection in the file
-command.search.find.occurrences.mnemonic=O
-command.information.quick_outline.name=Quick Outline
-command.information.quick_outline.description=Show the quick outline for the editor input
-ActionDefinition.selectEnclosing.name=Select Enclosing Element
-ActionDefinition.selectEnclosing.description=Expand selection to include enclosing element
-ActionDefinition.selectNext.name=Select Next Element
-ActionDefinition.selectNext.description=Expand selection to include next sibling
-ActionDefinition.selectPrevious.name=Select Previous Element
-ActionDefinition.selectPrevious.description=Expand selection to include previous sibling
-ActionDefinition.selectLast.name=Restore Last Selection
-ActionDefinition.selectLast.description=Restore last selection
-ActionDefinition.quickFix.name=Quick Fix
-ActionDefinition.quickFix.description=Quick Fix
-ActionDefinition.gotoMatchingBracket.name=Matching Bracket
-ActionDefinition.gotoMatchingBracket.description=Go to Matching Bracket
-
-
-#
-AddBookmark.label=Add Boo&kmark...
-SelectRuler.label=Select Ruler
-#
-##########################################################################
-# These strings are used in file and container resource popup menu
-##########################################################################
-Source=&Source
-FormatDocument=&Format
-Refactor=Refac&tor
-##
-Breakpoint_Extension_Point.name=Breakpoint Extension Point
-Source_Validation_Extension_Point.name=Reconcile Validator Extension Point
-###############################################################################
-# The following property keys maybe unused. Commented out on 4/12/2005. Uncomment if needed.
-#Bean_Info_Provider_Extension.name=Bean Info Provider Extension
-#SpellCheck_Extension_Point.name=SpellCheck Extension Point
-#Open_On_Extension_Point.name=Open On Extension Point
-#Spell_Check_label=Spell Check
-#Spell_Check_tooltip=Spell Check
-preferenceKeywords.todo=case sensitive task tag todo xxx fix fixme project specific projectspecific comments
-preferenceKeywords.sseeditor=structured text editor source xml html jsp appearance highlight matching brackets report problems type validation inform unsupported content folding color hovers modifier semantic
-ExpandSelectionTo=Expand Selection To
-SmartInsert_label=Sma&rt Insert Mode
-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
-
-Colors.content_assist_proposals_background=Content Assist Proposals Background
-Colors.content_assist_proposals_foreground=Content Assist Proposals Foreground
-Colors.content_assist_parameters_background=Content Assist Parameters Background
-Colors.content_assist_parameters_foreground=Content Assist Parameters Foreground
-
-#outline filter
-outlineFiltersName=Outline Filters
-
-command.outline.customFilter=&Filters \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml
deleted file mode 100644
index e50b9eb176..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.xml
+++ /dev/null
@@ -1,877 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.3"?>
-<plugin>
-
- <extension-point
- id="adapterFactoryDescription"
- name="%Adapter_Factory_Description_Extension.name" ></extension-point>
- <extension-point
- id="extendedEditorActions"
- name="%Extended_Editor_Actions_Extension.name" ></extension-point>
- <extension-point
- id="dropTargetTransfers"
- name="%Drop_Target_Transfers_Extension.name" ></extension-point>
- <extension-point
- id="editorConfiguration"
- name="%Extended_Editor_Configuration_Extension.name"
- schema="schema/editorconfiguration.exsd" ></extension-point>
- <extension-point
- id="semanticHighlighting"
- name="%Semantic_Highlighting_Extension.name"
- schema="schema/semanticHighlighting.exsd" ></extension-point>
- <extension-point
- id="characterPairing"
- name="%Character_Pairing.name"
- schema="schema/characterPairing.exsd" ></extension-point>
- <extension-point
- id="outlineFilters"
- name="%outlineFiltersName"
- schema="schema/outlineFilters.exsd">
- </extension-point>
-
- <!-- Make sure default preference values are set at runtime -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.sse.ui.internal.PreferenceInitializer" />
- </extension>
-
-
- <!-- reusable extensions -->
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration"
- target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.sse.ui.preferences.editor"
- target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
- </extension>
- <!-- associate the NavigateActionSet with various parts of the XML perspective-->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.sse.ui.StructuredTextEditor">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part
- id="org.eclipse.wst.sse.ui.StructuredTextEditor">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.debug.ui.launchActionSet">
- <part id="org.eclipse.wst.sse.ui.StructuredTextEditor"/>
- </actionSetPartAssociation>
- </extension>
-
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.todo"
- id="org.eclipse.wst.sse.ui.todo"/>
- <keyword
- label="%preferenceKeywords.sseeditor"
- id="org.eclipse.wst.sse.ui.sseeditor"/>
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
- <!-- Source Editor Preference page under Workbench->Editors -->
- <page
- name="%Structured_Text_Editor.name"
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.StructuredTextEditorPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.editor">
- <keywordReference id="org.eclipse.wst.sse.ui.sseeditor"/>
- </page>
-
- <!-- SSE task tags preference page under that-->
- <page
- name="%Task_Tags_Preferences.name"
- category="org.eclipse.wst.sse.ui.preferences.editor"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.tasktags">
- <keywordReference id="org.eclipse.wst.sse.ui.todo"/>
- </page>
- </extension>
- <!-- ================================================================================================ -->
- <!-- common task tags property page -->
- <!-- ================================================================================================ -->
- <extension point="org.eclipse.ui.propertyPages">
- <page
- id="org.eclipse.wst.sse.ui.project.properties.tasktags"
- name="%Task_Tags_Preferences.name"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- </adapt>
- </and>
- </enabledWhen>
- <keywordReference id="org.eclipse.wst.sse.ui.todo"/>
- </page>
- </extension>
-
- <!--
- <extension-point id="dragSourceTransfers" name="Drag Source Transfers"/>
- -->
- <extension point="org.eclipse.ui.commands">
- <!-- Edit commands -->
- <command
- name="%ActionDefinition.selectEnclosing.name"
- description="%ActionDefinition.selectEnclosing.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.enclosing">
- </command>
- <command
- name="%ActionDefinition.selectNext.name"
- description="%ActionDefinition.selectNext.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.next">
- </command>
- <command
- name="%ActionDefinition.selectPrevious.name"
- description="%ActionDefinition.selectPrevious.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.previous">
- </command>
- <command
- name="%ActionDefinition.selectLast.name"
- description="%ActionDefinition.selectLast.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.last">
- </command>
- <!-- Source commands -->
- <command
- name="%command.toggle.comment.name"
- description="%command.toggle.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.toggle.comment">
- </command>
- <command
- name="%command.add.block.comment.name"
- description="%command.add.block.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.add.block.comment">
- </command>
- <command
- name="%command.remove.block.comment.name"
- description="%command.remove.block.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.remove.block.comment">
- </command>
- <command
- name="%command.cleanup.document.name"
- description="%command.cleanup.document.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.cleanup.document">
- </command>
- <command
- name="%command.format.document.name"
- description="%command.format.document.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.format.document">
- </command>
- <command
- name="%command.format.active.elements.name"
- description="%command.format.active.elements.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.format.active.elements">
- </command>
- <!-- Navigate commands -->
- <command
- name="%command.open.file.from.source.name"
- description="%command.open.file.from.source.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.open.file.from.source">
- </command>
- <command
- name="%ActionDefinition.gotoMatchingBracket.name"
- description="%ActionDefinition.gotoMatchingBracket.description"
- categoryId="org.eclipse.ui.category.navigate"
- id="org.eclipse.wst.sse.ui.goto.matching.bracket">
- </command>
- <!-- Find Occurrences -->
- <command
- name="%command.search.find.occurrences.name"
- description="%command.search.find.occurrences.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.search.find.occurrences">
- </command>
- <command
- name="%command.information.quick_outline.name"
- description="%command.information.quick_outline.description"
- categoryId="org.eclipse.ui.category.navigate"
- id="org.eclipse.wst.sse.ui.quick_outline">
- </command>
- </extension>
- <!-- Keybinding scope for source editor -->
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structuredTextEditor.name"
- parentId="org.eclipse.ui.textEditorScope"
- description="%scope.structuredTextEditor.description"
- id="org.eclipse.wst.sse.ui.structuredTextEditorScope">
- </context>
- <context
- name="%scope.structuredTextEditor.comments.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structuredTextEditor.comments.description"
- id="org.eclipse.wst.sse.comments">
- </context>
- </extension>
- <!-- Keybindings for source editor -->
- <extension point="org.eclipse.ui.bindings">
- <!-- win32: M1=CTRL, M2=SHIFT, M3=ALT -->
- <!-- Edit commands -->
- <key
- sequence="M2+M3+ARROW_UP"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_RIGHT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.next"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_RIGHT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId=""
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M2+M4+ARROW_RIGHT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.next"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M2+M3+ARROW_LEFT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.previous"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_LEFT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId=""
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M2+M4+ARROW_LEFT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.previous"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M2+M3+ARROW_DOWN"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.last"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <!-- Source commands -->
- <key
- sequence="M1+M2+C"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.toggle.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+O"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.quick_outline"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+M2+/"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.add.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+/"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.add.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M1+M2+\"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.remove.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+\"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.remove.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- platform="carbon">
- </key>
- <key
- sequence="M1+M2+F"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.format.document"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+I"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.format.active.elements"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <!-- Navigate commands -->
- <key
- sequence="F3"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.open.file.from.source"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+M2+P"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.goto.matching.bracket"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <!-- Find Occurrences -->
- <key
- sequence="M1+M2+A"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.search.find.occurrences"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- </extension>
- <!-- Font and colors contributions -->
- <extension point="org.eclipse.ui.themes">
- <themeElementCategory
- label="%Structured_Text_Editor.name"
- id="org.eclipse.wst.sse.ui">
- </themeElementCategory>
- <fontDefinition
- label="%sourceEditorFontDefiniton.label"
- categoryId="org.eclipse.wst.sse.ui"
- defaultsTo="org.eclipse.jface.textfont"
- id="org.eclipse.wst.sse.ui.textfont">
- <description>
- %sourceEditorFontDefintion.description
- </description>
- </fontDefinition>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.dropTargetTransfers">
- <dropTargetContribution
- targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
- id="org.eclipse.wst.sse.ui.extension.ExtendedTransfers">
- <transfer
- priority="mid"
- singleton="true"
- class="org.eclipse.swt.dnd.FileTransfer"
- method="getInstance"
- id="org.eclipse.swt.dnd.FileTransfer">
- </transfer>
- <dropAction
- class="org.eclipse.wst.sse.ui.internal.FileDropAction"
- transferID="org.eclipse.swt.dnd.FileTransfer"
- id="org.eclipse.wst.sse.ui.internal.FileDropAction">
- </dropAction>
- <transfer
- priority="low"
- singleton="true"
- class="org.eclipse.swt.dnd.TextTransfer"
- method="getInstance"
- id="org.eclipse.swt.dnd.TextTransfer">
- </transfer>
- <dropAction
- class="org.eclipse.wst.sse.ui.internal.TextDropAction"
- transferID="org.eclipse.swt.dnd.TextTransfer"
- id="org.eclipse.wst.sse.ui.internal.TextDropAction">
- </dropAction>
- </dropTargetContribution>
- </extension>
-
- <extension point="org.eclipse.ui.editors.annotationTypes">
- <type
- super="org.eclipse.ui.workbench.texteditor.error"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.error"
- markerSeverity="2">
- </type>
- <type
- super="org.eclipse.ui.workbench.texteditor.warning"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.warning"
- markerSeverity="1">
- </type>
-
- <type
- super="org.eclipse.ui.workbench.texteditor.info"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.info"
- markerSeverity="0">
- </type>
- </extension>
- <extension
- point="org.eclipse.ui.editors.markerAnnotationSpecification">
-
- <!--================================================================================================-->
- <!-- same as eclipse text ui (including preference keys), except for vertical ruler & preference page -->
- <!--================================================================================================-->
- <specification
- annotationType="org.eclipse.wst.sse.ui.temp.error"
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- verticalRulerPreferenceValue="true"
- verticalRulerPreferenceKey="sseErrorIndicationInVerticalRuler"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationType="org.eclipse.wst.sse.ui.temp.warning"
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- verticalRulerPreferenceValue="false"
- verticalRulerPreferenceKey="sseWarningIndicationInVerticalRuler"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- annotationType="org.eclipse.wst.sse.ui.temp.info">
- </specification>
- </extension>
-<!-- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IContainer"
- id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions">
- <menu
- label="%Source"
- path="additions"
- id="source">
- <groupMarker name="sourceGroup"></groupMarker>
- </menu>
- <action
- label="%FormatDocument"
- class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
- menubarPath="source/sourceGroup"
- enablesFor="+"
- id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions.Format">
- </action>
- </objectContribution>
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- id="org.eclipse.wst.sse.ui.actions.FileSourceActions">
- <menu
- label="%Source"
- path="additions"
- id="source">
- <groupMarker name="sourceGroup"></groupMarker>
- </menu>
- <action
- label="%FormatDocument"
- class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
- menubarPath="source/sourceGroup"
- enablesFor="+"
- id="org.eclipse.wst.sse.ui.actions.FileSourceActions.Format">
- </action>
- </objectContribution>
- </extension>
- -->
- <!--
- <extension
- point="org.eclipse.ui.editorActions">
- <editorContribution
- targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
- id="org.eclipse.wst.sse.ui.StructuredTextEditor.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction">
- </action>
- </editorContribution>
- </extension>
- -->
-
- <!--================================================================================================-->
- <!-- contribute a SearchResultViewPage for Occurrences in file -->
- <!--================================================================================================-->
- <extension
- id="Occurrences search page"
- point="org.eclipse.search.searchResultViewPages">
- <viewPage
- id="org.eclipse.wst.sse.ui.search.OccurrencesSearchResultPage"
- searchResultClass="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult"
- class="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchViewPage">
- </viewPage>
- </extension>
-
- <!-- extension point for toggling breakpoints -->
- <extension-point
- id="breakpoint"
- name="%Breakpoint_Extension_Point.name"
- schema="schema/org.eclipse.wst.sse.ui.breakpoint.exsd" />
- <!-- extension point for source validation -->
- <!-- interfaces for this extension point can be found in org.eclipse.wst.validation -->
- <extension-point
- id="sourcevalidation"
- name="%Source_Validation_Extension_Point.name"
- schema="schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd" />
- <extension-point
- id="quickFixProcessor"
- name="%quickFixProcessor"
- schema="schema/quickFixProcessor.exsd"/>
- <extension-point id="commentingStrategy" name="%Commenting_Strategy_Extension.name" schema="schema/commentingStrategy.exsd"/>
- <extension-point id="completionProposal" name="%Completion_Proposal.name" schema="schema/completionProposal.exsd"/>
- <extension-point id="completionProposalCategoriesConfiguration" name="%Completion_Proposal_Categories_Configuration.name" schema="schema/completionProposalCategoriesConfiguration.exsd"/>
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=edit">
- <menu id="sourceMenuId" label="%Source"></menu>
- </menuContribution>
- <menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=sourceMenuId">
- <menu id="refactorMenuId" label="%Refactor"></menu>
- </menuContribution>
- <menuContribution locationURI="menu:edit?after=additions">
- <menu id="expandSelectionToMenuId" label="%ExpandSelectionTo"></menu>
- </menuContribution>
- <menuContribution locationURI="menu:sourceMenuId">
- <separator name="sourceBegin" visible="false"></separator>
- <separator name="shiftBegin" visible="true"></separator>
- <separator name="shiftEnd" visible="true"></separator>
- <separator name="additions" visible="true"></separator>
- <separator name="sourceEnd" visible="false"></separator>
- </menuContribution>
-
- <menuContribution locationURI="menu:goTo?after=additions">
- <separator name="matchingBegin" visible="false"></separator>
- <command commandId="org.eclipse.wst.sse.ui.goto.matching.bracket" id="org.eclipse.wst.sse.ui.goto.matching.bracket" label="%ActionDefinition.gotoMatchingBracket.name" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <separator name="matchingEnd" visible="false"></separator>
- </menuContribution>
- <!-- Contribute a Source menu for containers -->
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
- <menu
- id="sourceMenuId"
- label="%Source">
- <command
- commandId="org.eclipse.wst.sse.ui.format"
- id="sourceFormat"
- style="push">
- <!-- Check to make sure that the handler is enabled before making visible -->
- <visibleWhen checkEnabled="true" />
- </command>
- </menu>
- </menuContribution>
- <menuContribution locationURI="menu:sourceMenuId?after=additions">
- <command commandId="org.eclipse.wst.sse.ui.search.find.occurrences" id="OccurencesFile" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>
- <!--<menuContribution locationURI="menu:edit?after=additions">
- <command commandId="org.eclipse.ui.edit.text.toggleInsertMode" id="ToggleInsertMode" label="%SmartInsert_label" style="toggle">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution> -->
- <menuContribution locationURI="menu:expandSelectionToMenuId">
- <command commandId="org.eclipse.wst.sse.ui.structure.select.enclosing" id="org.eclipse.wst.sse.ui.structure.select.enclosing" label="%StructureSelectEnclosing_label" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.sse.ui.structure.select.next" id="org.eclipse.wst.sse.ui.structure.select.next" label="%StructureSelectNext_label" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.sse.ui.structure.select.previous" id="org.eclipse.wst.sse.ui.structure.select.previous" label="%StructureSelectPrevious_label" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.sse.ui.structure.select.last" id="org.eclipse.wst.sse.ui.structure.select.last" label="%StructureSelectHistory_label" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>
-
-
- <menuContribution locationURI="menu:sourceMenuId?after=shiftBegin">
- <command commandId="org.eclipse.ui.edit.text.shiftLeft"
- id="ShiftLeft"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.ui.edit.text.shiftRight"
- id="ShiftRight"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </visibleWhen>
- </command>
- </menuContribution>
-
- <menuContribution locationURI="menu:sourceMenuId?after=shiftEnd">
- <command
- commandId="org.eclipse.wst.sse.ui.cleanup.document"
- id="CleanupDocument"
- mnemonic="%command.cleanup.document.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.format.document"
- id="FormatDocument"
- mnemonic="%command.format.document.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.format.active.elements"
- id="FormatElements"
- mnemonic="%command.format.active.elements.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>
-
- <menuContribution
- locationURI="popup:sourcePopupMenuId?after=sourceBegin">
- <command
- commandId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <separator name="format" visible="true"></separator>
- <command
- commandId="org.eclipse.wst.sse.ui.cleanup.document"
- id="CleanupDocument"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.format.document"
- id="FormatDocument"
- mnemonic="%command.format.document.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.sse.ui.format.active.elements"
- id="FormatElements"
- mnemonic="%command.format.active.elements.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
-
- </menuContribution>
- <menuContribution locationURI="menu:sourceMenuId?after=sourceBegin">
- <command commandId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- mnemonic="%command.toggle.comment.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"/>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- mnemonic="%command.add.block.comment.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"/>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- mnemonic="%command.remove.block.comment.mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.commentingActiveContext.definition"/>
- </visibleWhen>
- </command>
- </menuContribution>
- <!-- content outline -->
- <menuContribution locationURI="menu:org.eclipse.ui.views.ContentOutline?after=additions">
- <command
- commandId="org.eclipse.wst.sse.ui.outline.customFilter"
- id="org.eclipse.wst.sse.ui.outline.customFilter"
- label="%command.outline.customFilter"
- icon ="icons/full/elcl16/filter_ps.gif"
- style="push">
- <visibleWhen checkEnabled="false">
- <with variable="activeEditor">
- <test property="org.eclipse.wst.sse.ui.outline.isConfigurableOutlinePage" />
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.eclipse.wst.sse.ui.outline.customFilter"
- name="%command.outline.customFilter">
- </command>
- <command
- id="org.eclipse.wst.sse.ui.format"
- name="%command.format.document.name">
- </command>
- </extension>
-
- <!-- Enable the FormatHandler for Containers -->
- <extension point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
- commandId="org.eclipse.wst.sse.ui.format">
- <activeWhen>
- <iterate ifEmpty="false">
- <adapt
- type="org.eclipse.core.resources.IContainer">
- </adapt>
- </iterate>
- </activeWhen>
- <enabledWhen>
- <iterate ifEmpty="false">
- <adapt
- type="org.eclipse.core.resources.IContainer">
- </adapt>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- class="org.eclipse.wst.sse.ui.internal.handlers.CustomFilterHandler"
- commandId="org.eclipse.wst.sse.ui.outline.customFilter">
- </handler>
-
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.sse.ui.sseActiveContext.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.sse.ui.structuredTextEditorScope"/>
- </iterate>
- </with>
- </definition>
- <definition
- id="org.eclipse.wst.sse.ui.commentingActiveContext.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.sse.comments"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <!-- Define theme -->
- <extension
- point="org.eclipse.ui.themes">
- <theme
- id="org.eclipse.ui.ide.systemDefault">
- <colorOverride
- id="content_assist_proposals_background"
- value="COLOR_LIST_BACKGROUND">
- </colorOverride>
- <colorOverride
- id="content_assist_proposals_foreground"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="content_assist_parameters_background"
- value="COLOR_LIST_BACKGROUND">
- </colorOverride>
- <colorOverride
- id="content_assist_parameters_foreground"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- </theme>
- <colorDefinition
- id="content_assist_proposals_background"
- isEditable="false"
- label="%Colors.content_assist_proposals_background"
- value="255,255,255">
- </colorDefinition>
- <colorDefinition
- id="content_assist_proposals_foreground"
- isEditable="false"
- label="%Colors.content_assist_proposals_foreground"
- value="0,0,0">
- </colorDefinition>
- <colorDefinition
- id="content_assist_parameters_background"
- isEditable="false"
- label="%Colors.content_assist_parameters_background"
- value="255,255,255">
- </colorDefinition>
- <colorDefinition
- id="content_assist_parameters_foreground"
- isEditable="false"
- label="%Colors.content_assist_parameters_foreground"
- value="0,0,0">
- </colorDefinition>
- </extension>
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.wst.sse.ui.internal.CustomFilterPropertyTester"
- id="org.eclipse.wst.sse.ui.internal.handlers.CustomFilterPropertyTester"
- namespace="org.eclipse.wst.sse.ui.outline"
- properties="isConfigurableOutlinePage"
- type="org.eclipse.ui.IEditorPart">
- </propertyTester>
- </extension>
-</plugin>
-
diff --git a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt b/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
deleted file mode 100644
index 9c8c7c70da..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-we reexport eclipse.ui.editors
-since one of our APIs, StructuredSourceViewerConfiguration
-requires it.
-
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd b/bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd
deleted file mode 100644
index f6b731ede5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="characterPairing" name="Character Pairing"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="inserter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="inserter">
- <complexType>
- <sequence>
- <element ref="contentTypeIdentifier" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.AbstractCharacterPairInserter:"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentTypeIdentifier">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="partitions" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/commentingStrategy.exsd b/bundles/org.eclipse.wst.sse.ui/schema/commentingStrategy.exsd
deleted file mode 100644
index 57b4d68cc2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/commentingStrategy.exsd
+++ /dev/null
@@ -1,260 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="commentingStrategy" name="Commenting Strategy"/>
- </appInfo>
- <documentation>
- This extension point allows the contribution of commenting strategy&apos;s to participate in the commenting actions, such as adding and removing commenting blocks and toggling line comments.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <choice minOccurs="1" maxOccurs="unbounded">
- <element ref="blockCommentingStrategy" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="lineCommentingStrategy" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="blockCommentingStrategy">
- <annotation>
- <documentation>
- Defines a block commenting strategy
- </documentation>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="contentType"/>
- </sequence>
- <attribute name="prefix" type="string" use="required">
- <annotation>
- <documentation>
- The prefix of the block comment this strategy impliments
- </documentation>
- </annotation>
- </attribute>
- <attribute name="suffix" type="string" use="required">
- <annotation>
- <documentation>
- The suffix of the block comment this strategy impliments
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="lineCommentingStrategy">
- <annotation>
- <documentation>
- Deefines a line commenting strategy
- </documentation>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="contentType"/>
- </sequence>
- <attribute name="prefix" type="string" use="required">
- <annotation>
- <documentation>
- The prefix of the block comment this strategy impliments
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentType">
- <annotation>
- <documentation>
- A content type that the strategy is applicable for
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <choice>
- <element ref="requiredPartitionTypes"/>
- <element ref="allowablePartitionTypes"/>
- <sequence>
- <element ref="requiredPartitionTypes"/>
- <element ref="allowablePartitionTypes"/>
- </sequence>
- </choice>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the content type
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="associatedCommentPartitionTypeID" type="string">
- <annotation>
- <documentation>
- The partition type ID of the comment partition that is associated with the strategy in this content type
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="requiredPartitionTypes">
- <annotation>
- <documentation>
- List of partition types in the associated content type that are requried for the strategy to be applicable. Only one of these partition types must be present in a selection for the strategy to be applicable.
- </documentation>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="partitionType"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="allowablePartitionTypes">
- <annotation>
- <documentation>
- The partition types that are allowed in a user selection for the strategy to be valid. It is assumed that any partition types listed in the &lt;code&gt;requiredPartitionTypes&lt;/code&gt; are also allowable. This list is ignored if the value of &lt;code&gt;anyPartitionType&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;. If this list is not provided then it is assumed the value of &lt;code&gt;anyPartitionType&lt;/code&gt; is false.
- </documentation>
- </annotation>
- <complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
- <element ref="partitionType"/>
- </sequence>
- <attribute name="anyPartitionType" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- If &lt;code&gt;true&lt;/code&gt; then the strategy is valid for any partition type in the associated &lt;code&gt;contentType&lt;/code&gt;, this means that any &lt;code&gt;partionType&lt;/code&gt;s listed here would be ignored. If &lt;code&gt;false&lt;/code&gt; then only the &lt;code&gt;partitionType&lt;/code&gt;s listed here are allowed in a user selection (allong with any specified requried partition types) for the strategy to be valid.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="partitionType">
- <annotation>
- <documentation>
- A partition type associated with the parenting content type
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the partition type.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;p&gt;&lt;b&gt;Example 1:&lt;/b&gt; A simple example for block comments on XML documents&lt;/p&gt;&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.commentingStrategy&quot;&gt;
- &lt;blockCommentingStrategy
- prefix=&quot;&amp;lt;!--&quot;
- suffix=&quot;--&amp;gt;&quot;&gt;
- &lt;contentType
- id=&quot;org.eclipse.core.runtime.xml&quot;
- associatedCommentPartitionTypeID=&quot;org.eclipse.wst.xml.XML_COMMENT&quot;&gt;
- &lt;allowablePartitionTypes
- anyPartitionType=&quot;true&quot;&gt;
- &lt;/allowablePartitionTypes&gt;
- &lt;/contentType&gt;
- &lt;/blockCommentingStrategy&gt;
-&lt;/extension&gt;&lt;/pre&gt;
-
-&lt;p&gt;&lt;b&gt;Example 2:&lt;/b&gt; A more complex example for adding CSS comenting to both CSS and HTML documents&lt;/p&gt;&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.commentingStrategy&quot;&gt;
- &lt;blockCommentingStrategy
- prefix=&quot;/*&quot;
- suffix=&quot;*/&quot;&gt;
- &lt;contentType
- associatedCommentPartitionTypeID=&quot;org.eclipse.wst.css.COMMENT&quot;
- id=&quot;org.eclipse.wst.css.core.csssource&quot;&gt;
- &lt;allowablePartitionTypes
- anyPartitionType=&quot;true&quot;&gt;
- &lt;/allowablePartitionTypes&gt;
- &lt;/contentType&gt;
- &lt;contentType
- id=&quot;org.eclipse.wst.html.core.htmlsource&quot;&gt;
- &lt;allowablePartitionTypes
- anyPartitionType=&quot;false&quot;&gt;
- &lt;/allowablePartitionTypes&gt;
- &lt;requiredPartitionTypes
- requireAll=&quot;true&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.css.STYLE&quot;&gt;
- &lt;/partitionType&gt;
- &lt;/requiredPartitionTypes&gt;
- &lt;/contentType&gt;
- &lt;/blockCommentingStrategy&gt;
-&lt;/extension&gt;&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- The user of this extension point does not need to impliment any classes themselves but for their contributions to work in any given content type then the following handlers must be registered for the content type in question by using the &lt;code&gt;org.eclipse.ui.handlers&lt;/code&gt; extension point.
-&lt;ul&gt;
-&lt;li&gt;&lt;code&gt;org.eclipse.wst.sse.ui.handlers.AddBlockCommentHandler&lt;/code&gt;&lt;/li&gt;
-&lt;li&gt;&lt;code&gt;org.eclipse.wst.sse.ui.handlers.RemoveBlockCommentHandler&lt;/code&gt;&lt;/li&gt;
-&lt;li&gt;&lt;code&gt;org.eclipse.wst.sse.ui.handlers.ToggleLineCommentHandler&lt;/code&gt;&lt;/li&gt;
-&lt;/ul&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd b/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd
deleted file mode 100644
index e361555984..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd
+++ /dev/null
@@ -1,292 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="completionProposal" name="SSE Completion Proposal"/>
- </appInfo>
- <documentation>
- This extension point allows the contribution of SSE completion proposal computers and categories to participate in the content assist process of SSE editors.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="proposalCategory" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="proposalComputer" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="proposalComputerExtendedActivation" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="proposalCategory">
- <annotation>
- <documentation>
- A proposal category contribution defines categories of proposals used to group them in the UI.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique ID of the proposal category
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- The name of the proposal category. If a name is not provided the proposal category ID will be used as the name.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- An optional icon of the category, which can be displayed in the user preferences
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="proposalComputer">
- <annotation>
- <documentation>
- A proposal computer contribution which is associated with at least one content type.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="contentType" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique ID of the proposal computer.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- The human readable name of the proposal computer. If none is given the ID of the proposal computer will be used.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- An optional icon of the computer, which will be used when creating the proposals suggested by this computer. This preference can be programicly overwriten by the implimentation of &lt;code&gt;org.eclipse.wst.sse.ui.internal.provisional.contentassist.ICompletionProposalComputer&lt;/code&gt; specified by the &lt;tt&gt;class&lt;/tt&gt; attribute.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements the contributed computer. The
-class must be public and implement
-&lt;code&gt;org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer&lt;/code&gt;
-and must have a public 0-argument constructor.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="activate" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- If the attribute is set to &lt;code&gt;true&lt;/code&gt; it will force this plug-in to be loaded on content assist invocation
- </documentation>
- </annotation>
- </attribute>
- <attribute name="categoryId" type="string" use="default" value="org.eclipse.wst.sse.ui.defaultProposalCategory">
- <annotation>
- <documentation>
- The id of a &lt;tt&gt;proposalCategory&lt;/tt&gt; that this proposal computer should be a part of
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentType">
- <annotation>
- <documentation>
- A SSE content type. If no partition types are provided then computer will be associated with all partition types in the content type.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="partitionType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the content type
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="partitionType">
- <annotation>
- <documentation>
- A SSE partition type.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the partition type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="autoActivationDelegate" type="string">
- <annotation>
- <documentation>
- Identifies a class that is responsible for identifying auto-activation characters for the associated content and partition type.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="proposalComputerExtendedActivation">
- <annotation>
- <documentation>
- Used to extended the activation context of an already existing proposal computer. Use this if there is a plugin A that has defined a proposal comptuer that should be activated for a content type defined in plugin B.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="contentType" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the &lt;tt&gt;proposalComputer&lt;/tt&gt; whos activation context should be extended.
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.wst.sse.ui.completionProposal/proposalComputer/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;p&gt;The following are examples of SSE completion proposal contributions:&lt;/p&gt;
-
-&lt;b&gt;Plugin A:&lt;/b&gt;&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.completionProposal&quot;&gt;
- &lt;proposalCategory
- icon=&quot;icons/full/obj16/tag-macro.gif&quot;
- id=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;
- name=&quot;XML Templates&quot;&gt;
- &lt;/proposalCategory&gt;
- &lt;proposalComputer
- activate=&quot;false&quot;
- categoryId=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;
- class=&quot;org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer&quot;
- id=&quot;org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates&quot;&gt;
- &lt;contentType
- id=&quot;org.eclipse.core.runtime.xml&quot;&gt;
- &lt;/contentType&gt;
- &lt;/proposalComputer&gt;
-&lt;/extension&gt;&lt;/pre&gt;
-&lt;b&gt;Plugin B:&lt;/b&gt; (extending the activation context of an existing computer)&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.completionProposal&quot;&gt;
- &lt;proposalComputerExtendedActivation
- id=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;&gt;
- &lt;contentType
- id=&quot;org.eclipse.jst.jsp.core.jspsource&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.xml.XML_DEFAULT&quot;&gt;
- &lt;/partitionType&gt;
- &lt;/contentType&gt;
- &lt;/proposalComputerExtendedActivation&gt;
-&lt;/extension&gt;&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- The contributed class must impliment &lt;code&gt;org.eclipse.wst.sse.ui.internal.provisional.contentassist.ICompletionProposalComputer&lt;/code&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd
deleted file mode 100644
index c8f40f4083..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="completionProposalCategoriesConfiguration" name="Completion Proposal Categories Configuration"/>
- </appInfo>
- <documentation>
- This extension point allows the contribution of completion proposal category configuration readers. These are used to determine which completion categories contributed by &lt;tt&gt;org.eclipse.wst.sse.ui.completionProposal&lt;/tt&gt; extensions are turned on by preference (either programatic or user). If a completion proposal category configuration reader exists for a given content type the reader will be consulted to determine which completion categories to use when generating completion proposals.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="categoriesConfiguration" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="categoriesConfiguration">
- <complexType>
- <attribute name="contentTypeID" type="string" use="required">
- <annotation>
- <documentation>
- The ID of the content type
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The class that impliments the contributed completion proposal categories configuration. The class must be public and impliment either &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader&lt;/code&gt; or &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;p&gt;The following are examples of a SSE completion proposal computer contribution:&lt;/p&gt;
-&lt;pre&gt;&lt;extension
- point=&quot;org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration&quot;&gt;
- &lt;categoriesConfiguration
- class=&quot;org.eclipse.wst.xml.ui.internal.preferences.XMLCompletionProposalCategoriesConfiguration&quot;
- contentTypeID=&quot;org.eclipse.core.runtime.xml&quot;&gt;
- &lt;/categoriesConfiguration&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- &lt;p&gt;The contributed class must impliment either &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader&lt;/code&gt; or &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter&lt;/code&gt;.&lt;/p&gt;
-
-&lt;p&gt;A reader implimentation should be used if the preferences can not be set by the user, if the preferences will be modified by the user then a writer implimentation should be used.&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- &lt;p&gt;See &lt;code&gt;org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration&lt;/code&gt; which if implimented by an adopter provides a usefull framework for reading and writing completion proposal categories configuration information to a preference store.&lt;/p&gt;
-
-&lt;p&gt;For a useful user interface for modifing completion proposal categories configurations see &lt;code&gt;org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock&lt;/code&gt; which can easly be included on a preference page.&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
deleted file mode 100644
index 0f83484602..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
+++ /dev/null
@@ -1,341 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="editorConfiguration" name="Editor Configuration"/>
- </appInfo>
- <documentation>
- The SSE StructuredTextEditor is intended to be as flexible as possible. Much of its design centers around the notion of defining and redefining its behavior and appearance based on the content type of its input. This extension point allows clients to provide an editor configuration to the StructuredTextEditor without having to subclass the editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="sourceViewerConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="contentOutlineConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="propertySheetConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="documentationTextHover" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="doubleClickStrategy" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="provisionalConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="provisionalDefinition" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="quickOutlineConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="sourceViewerConfiguration">
- <annotation>
- <documentation>
- Defines the source viewer configuration, affecting syntax highlighting, content assist, hover help, and more in the current editor.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentOutlineConfiguration">
- <annotation>
- <documentation>
- Defines how the current editor&apos;s input maps to elements with in a Tree control, as well as selection filtering, toolbar and menu contributions, etc in the Outline view.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertySheetConfiguration">
- <annotation>
- <documentation>
- Defines how the current editor&apos;s input maps to properties in a Table control, as well as toolbar contributions, etc in the Properties view.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="documentationTextHover">
- <annotation>
- <documentation>
- Defines the text hover processor to use to display documentation information in a text hover. Note, in the event more than one documentation text hover is contributed for the same target partition type, the first one loaded will be the one used and all other contributions will be ignored.
-&lt;br /&gt;
-&lt;i&gt;Since 3.0&lt;/i&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension. Must be a partition type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must implement org.eclipse.jface.text.ITextHover
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jface.text.ITextHover"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="doubleClickStrategy">
- <annotation>
- <documentation>
- Defines the doubleclick strategy to use when the user performs a mouse doubleclick. Note, in the event more than one doubleclick strategy is contributed for the same target partition type, the first one loaded will be the one used and all other contributions will be ignored.
-&lt;br /&gt;
-&lt;i&gt;Since 3.0&lt;/i&gt;
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension. Must be a partition type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must implement org.eclipse.jface.text.ITextDoubleClickStrategy
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jface.text.ITextDoubleClickStrategy"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provisionalConfiguration">
- <annotation>
- <documentation>
- Declares a class fulfilling the requirements of a type to be used for the given target(s).
-Note: this is not API and is only used for provisional configuration types.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The type of configuration to find.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Implementation class for this type.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provisionalDefinition">
- <annotation>
- <documentation>
- Defines a value for a type to be used for the given target(s).
-Note: this is not API and is only used for provisional configuration types.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The type of definition to find.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
- The value of this definition.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="quickOutlineConfiguration">
- <annotation>
- <documentation>
- Defines the configuration to be used when displaying editor input in the Tree layout for an editor&apos;s Quick Outline.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that provides implementation of the quick outline configuration.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.AbstractQuickOutlineConfiguration:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.sse.ui.editorConfiguration&quot;&gt;
- &lt;!-- associating a source viewer configuration to an input&apos;s content type--&gt;
- &lt;sourceViewerConfiguration
- class=&quot;org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML&quot;
- target=&quot;org.eclipse.wst.html.core.htmlsource&quot;/&gt;
- &lt;!-- associating an outline configuration to an input&apos;s content type --&gt;
- &lt;contentOutlineConfiguration
- class=&quot;org.eclipse.wst.sse.xml.ui.views.contentoutline.XMLContentOutlineConfiguration&quot;
- target=&quot;org.eclipse.core.runtime.xml&quot;/&gt;
- &lt;!-- associating a property sheet configuration to multiple content types --&gt;
- &lt;propertySheetConfiguration
- class=&quot;org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration&quot;
- target=&quot;org.eclipse.wst.sse.contenttype.xml, org.eclipse.wst.html.core.htmlsource, org.eclipse.jst.jsp.core.jspsource&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- see &lt;code&gt;org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.properties.StructuredPropertySheetConfiguration&lt;/code&gt;.
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd
deleted file mode 100644
index 0221b5354f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="breakpoint" name="Breakpoint Providers"/>
- </appInfo>
- <documentation>
- This extension point is provided to allow clients to provide support for adding their own breakpoint line markers with the StructuredTextEditor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="breakpointContribution" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provider">
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the provider instance
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- An implementor of org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider .
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="contentTypes" type="string" use="required">
- <annotation>
- <documentation>
- A comma separated list of content type IDs for which this provider should be used.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="breakpointContribution">
- <complexType>
- <choice>
- <element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
- </choice>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the contribution
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Example demonstrating how Java stratum breakpoints are contributed when editing JSPs and tag files.
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.wst.sse.ui.breakpoint&quot;&gt;
- &lt;breakpointContribution id=&quot;org.eclipse.jst.jsp.ui.providers&quot;&gt;
- &lt;provider
- contentTypes=&quot;org.eclipse.jst.jsp.core.jspsource, org.eclipse.jst.jsp.core.tagsource&quot;
- id=&quot;org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider&quot;&gt;
- class=&quot;org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider&quot;/&gt;
- &lt;/breakpointContribution&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- A full implementation is available in org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2009 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd
deleted file mode 100644
index ee02eba6cc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="sourcevalidation" name="Source Validation"/>
- </appInfo>
- <documentation>
- This extension point is provided to allow clients to contribute a validator (&lt;code&gt;org.eclipse.wst.validation.internal.provisional.core.IValidator&lt;/code&gt;)
-for as-you-type (source) validation.&lt;br&gt;
-
-If your validator can handle &quot;partial document&quot; validation, it should also implement ISourceValidator. The validate call on ISourceValidator gets passed an IRegion representation of the part of the document that&apos;s dirty.&lt;br&gt;
-
-This should be much more efficient than validating the entire file each time someone types.&lt;br&gt;
-
-The validator is enabled for specific content type/partition combinations.&lt;br&gt;
-
-Required plugins are:&lt;br&gt;
- org.eclipse.wst.sse.ui&lt;br&gt;
- org.eclipse.wst.validation
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="validator"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="validator">
- <complexType>
- <sequence>
- <element ref="contentTypeIdentifier" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="scope" type="string" use="required">
- <annotation>
- <documentation>
- Either &quot;total&quot; or &quot;partial&quot;, depending on whether all or just some of the document should be revalidated on changes.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="partitionType">
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentTypeIdentifier">
- <complexType>
- <sequence>
- <element ref="partitionType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Example demonstrating how HTMLValidator contributes to as-you-type validation in the source editor.
-
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.sse.ui.extensions.sourcevalidation&quot;&gt;
- &lt;validator
- scope=&quot;total&quot;
- class=&quot;org.eclipse.wst.validation.html.HTMLValidator&quot;
- id=&quot;org.eclipse.wst.validation.htmlsourcevalidator&quot;&gt;
- &lt;contentTypeIdentifier
- id=&quot;org.eclipse.wst.html.core.htmlsource&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
- &lt;/contentTypeIdentifier&gt;
- &lt;contentTypeIdentifier
- id=&quot;org.eclipse.jst.jsp.core.jspsource&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
- &lt;/contentTypeIdentifier&gt;
- &lt;/validator&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-Using ISourceValidator
-&lt;/p&gt;
-&lt;p&gt;
-If your validator can handle &quot;partial document&quot; validation, it should implement ISourceValidator.
-&lt;/p&gt;
-&lt;p&gt;
-The validate call on ISourceValidator gets passed an IRegion of the document which represents just the part that&apos;s dirty. This should be much more efficient than validating the entire file each time someone types.
-&lt;/p&gt;
-&lt;p&gt;
-ISourceValidator has its &quot;connect(IDocument doc)&quot; method called when it&apos;s hooked up to the document (when the editor is opened), and &quot;disconnect(IDocument doc)&quot; called when the editor is closed, where any &quot;unhooking&quot; should take place.
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- Currently there is no supplied implementation for IValidator.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/outlineFilters.exsd b/bundles/org.eclipse.wst.sse.ui/schema/outlineFilters.exsd
deleted file mode 100644
index 8574ae2ea5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/outlineFilters.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="outlineFilters" name="%outlineFiltersName"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="filter" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="filter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- a unique id that will be used to identify this filter
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- a unique name that allows to identify this filter in the UI. This attribute should be a translated string. Though this attribute is not required for pattern filters (i.e. those using the &lt;samp&gt;pattern&lt;/samp&gt; attribute) we suggest to provide a name anyway, otherwise the pattern string itself would be used to represent the filter in the UI.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- a short description for this filter
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="targetId" type="string">
- <annotation>
- <documentation>
- the id of the target where this filter is contributed. If this attribute is missing, then the filter will
-be contributed to all views which use the &lt;code&gt;org.eclipse.wst.sse.ui.actions.CustomFiltersAction&lt;/code&gt;.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="enabled" type="boolean">
- <annotation>
- <documentation>
- the filter will be enabled if this attribute is &quot;true&quot; or if this attribute is not present. Most likely the user will be able to override this setting in the UI.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- the name of the class used to filter the view. The class must extend &lt;code&gt;org.eclipse.jface.viewers.ViewerFilter&lt;/code&gt;. If this attribute is here
-then the pattern attribute must not provided.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.ViewerFilter"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Works similar to javaElementFilter definition with targetId as &quot;org.wst.sse.ui.OutlinePage&quot;.
- Target id can be changed for different content types to provide their own filters
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2010 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/quickFixProcessor.exsd b/bundles/org.eclipse.wst.sse.ui/schema/quickFixProcessor.exsd
deleted file mode 100644
index 188711c1f5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/quickFixProcessor.exsd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="quickFixProcessor" name="Quick Fix Processor"/>
- </appinfo>
- <documentation>
- This extension point is used to associate a quick assist processor in Structured Text Editors with a specific &quot;kind&quot; of problem (a marker or annotation of a certain type or having certain attribute values).
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="quickFixProcessor" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="quickFixProcessor">
- <complexType>
- <sequence>
- <element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="problemType" type="string">
- <annotation>
- <documentation>
- the problem type for which this quick fix processor applies to. To set the problem type for an annotation or marker, create a &quot;problemType&quot; attribute for the annotation/marker and set a value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the name of the class implementing IQuickAssistProcessor
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jface.text.quickassist.IQuickAssistProcessor"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="attribute">
- <complexType>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- the name of the attribute whose value is being specified.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
- the specified value of the attribute.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br /&gt;
-&amp;lt;extension point=&quot;org.eclipse.wst.sse.ui.quickFixProcessor&quot;&amp;gt;&lt;br /&gt;
-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;quickFixProcessor&lt;br /&gt;
-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;class=&quot;org.eclipse.wst.sse.ui.examples.quickfixes.ExampleQuickAssistProcessor&quot;&lt;br /&gt;
-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;problemType=&quot;org.eclipse.wst.sse.ui.examples.quickfixes.problem&quot;&amp;gt;&lt;br /&gt;
-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;attribute name=&quot;anAttributeKey&quot; value=&quot;attribute value&quot;/&amp;gt;&lt;br /&gt;
-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/quickFixProcessor&amp;gt;&lt;br /&gt;
- &amp;lt;/extension&amp;gt;&lt;br /&gt;
-
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd b/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd
deleted file mode 100644
index b14a843ad2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="semanticHighlighting" name="Semantic Highlighting"/>
- </appInfo>
- <documentation>
- The Semantic Highlighting extension point allows plug-ins to contribute rules to the Structured Source Editor&apos;s semantic highlighting framework. Semantic highlighting is performed as a second pass after syntax highlighting.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="highlighting" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="highlighting">
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension. It is the content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must implement org.eclipse.wst.sse.ui.ISemanticHighlighting to provide basic semantic highlighting information.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.ISemanticHighlighting"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="styleStringKey" type="string">
- <annotation>
- <documentation>
- The preference key that controls the style of the semantic highlighting. The style&apos;s value should be in the form: RGB foreground (#rrggbb) | RGB background (#rrggbb) | bold (true/false) | italic (true/false) | strikethrough (true/false) | underline (true/false)
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.1
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is the declaration of a semantic highlighting that is effective on org.eclipse.core.runtime.xml and org.eclipse.wst.xml.core.xmlsource content types. The &lt;code&gt;org.eclipse.wst.xml.ui.internal.style.NamespaceHighlighting&lt;/code&gt; determines the consumable regions of the document.
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.wst.sse.ui.semanticHighlighting&quot;&gt;
- &lt;highlighting
- class=&quot;org.eclipse.wst.xml.ui.internal.style.NamespaceHighlighting&quot;
- target=&quot;org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource&quot;&gt;
- &lt;/highlighting&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- See &lt;code&gt;org.eclipse.wst.sse.ui.ISemanticHighlighting&lt;/code&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
deleted file mode 100644
index 78e416265e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.encoding.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.util.CodedResourcePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * @deprecated - this should not be handled by the platform and not WTP
- */
-
-public class EncodingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- Button fUse3ByteBOMWithUTF8CheckBox = null;
-
- private Button createCheckBox(Composite parent, String label) {
- Button button = new Button(parent, SWT.CHECK | SWT.LEFT | SWT.WRAP);
- button.setText(label);
-
- boolean selection = CodedResourcePlugin.getDefault().getPluginPreferences().getBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
- button.setSelection(selection);
-
- return button;
- }
-
- private Composite createComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-
- //GridLayout
- GridLayout layout = new GridLayout(1, true);
- composite.setLayout(layout);
-
- //GridData
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
-
- return composite;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite composite = createComposite(parent);
-
- String description = SSEUIMessages.EncodingPreferencePage_0; //$NON-NLS-1$
-
- // ISSUE: the following to lines look redundant,
- // not sure what was trying to be accomplished.
- // May be dead code.
- createLabel(composite, description);
- createLabel(composite, ""); //$NON-NLS-1$
-
- String checkBoxLabel = SSEUIMessages.EncodingPreferencePage_1; //$NON-NLS-1$
- fUse3ByteBOMWithUTF8CheckBox = createCheckBox(composite, checkBoxLabel);
-
- return composite;
- }
-
- private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- return label;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- public void performDefaults() {
- boolean defaultSelection = CodedResourcePlugin.getDefault().getPluginPreferences().getDefaultBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
- fUse3ByteBOMWithUTF8CheckBox.setSelection(defaultSelection);
- }
-
- public boolean performOk() {
- CodedResourcePlugin.getDefault().getPluginPreferences().setValue(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, fUse3ByteBOMWithUTF8CheckBox.getSelection());
- CodedResourcePlugin.getDefault().savePluginPreferences();
-
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
deleted file mode 100644
index 854c71e4d5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.part.MultiPageEditorSite;
-
-public class ConfigurationPointCalculator {
- public static final String DESIGN = ".design"; //$NON-NLS-1$
- public static final String SOURCE = ".source"; //$NON-NLS-1$
-
- public static String[] getConfigurationPoints(IEditorPart part, String contentType, String subContext, Class rootClass) {
- ConfigurationPointCalculator calculator = new ConfigurationPointCalculator();
- calculator.setContentType(contentType);
- calculator.setPart(part);
- calculator.setRootClass(rootClass);
- calculator.setSubContext(subContext);
- return calculator.getConfigurationPoints();
- }
-
- protected String fContentType = null;
- protected IWorkbenchPart fPart = null;
-
- protected Class fRootClass = null;
- protected String fSubContext = null;
-
- /**
- *
- */
- public ConfigurationPointCalculator() {
- super();
- }
-
- public String[] getConfigurationPoints() {
- List points = new ArrayList(2);
-
- IWorkbenchPartSite site = null;
- if (fPart != null) {
- site = fPart.getSite();
- if (site != null) {
- String id = site.getId();
- if (id != null && id.length() > 0 && !id.equals(fRootClass.getName()))
- points.add(id);
- }
- if (site instanceof MultiPageEditorSite) {
- String multipageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId();
- if (!points.contains(multipageID))
- points.add(multipageID);
- String sourcePageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId() + ".source"; //$NON-NLS-1$
- if (!points.contains(sourcePageID))
- points.add(sourcePageID);
- }
- if (site instanceof MultiPageEditorSite) {
- String multipageClassName = ((MultiPageEditorSite) site).getMultiPageEditor().getClass().getName();
- if (!points.contains(multipageClassName))
- points.add(multipageClassName);
- }
- Class editorClass = fPart.getClass();
- while (editorClass != null && fRootClass != null && !editorClass.equals(fRootClass)) {
- if (!points.contains(editorClass.getName()))
- points.add(editorClass.getName());
- editorClass = editorClass.getSuperclass();
- }
- }
-
- if (fContentType != null) {
- IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
- while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
- if (!points.contains(contentType.getId()))
- points.add(contentType.getId());
- contentType = contentType.getBaseType();
- }
- }
-
- if (fRootClass != null && !points.contains(fRootClass.getName()))
- points.add(fRootClass.getName());
- return (String[]) points.toArray(new String[0]);
- }
-
- /**
- * @return Returns the contentType.
- */
- public String getContentType() {
- return fContentType;
- }
-
- /**
- * @return Returns the part.
- */
- public IWorkbenchPart getPart() {
- return fPart;
- }
-
- /**
- * @return Returns the rootClass.
- */
- public Class getRootClass() {
- return fRootClass;
- }
-
- /**
- * @return Returns the subContext.
- */
- public String getSubContext() {
- return fSubContext;
- }
-
- /**
- * @param contentType
- * The contentType to set.
- */
- public void setContentType(String contentType) {
- fContentType = contentType;
- }
-
- /**
- * @param part
- * The part to set.
- */
- public void setPart(IWorkbenchPart part) {
- fPart = part;
- }
-
- /**
- * @param rootClass
- * The rootClass to set.
- */
- public void setRootClass(Class rootClass) {
- fRootClass = rootClass;
- }
-
- /**
- * @param subContext
- * The subContext to set.
- */
- public void setSubContext(String subContext) {
- fSubContext = subContext;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
deleted file mode 100644
index 13dac00277..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions;
-
-
-
-/**
- * This is a marker interface to control ValidateEdit call Usually framework
- * calls IExtendedSimpleEditor#validateEdit() before calling
- * IExtendedEditorAction's run() method. However, if the action implements
- * this interface, framework won't call validateEdit() method.
- *
- * The action should call validateEdit() at their own appropriate timing.
- */
-public interface ISelfValidateEditAction {
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java
deleted file mode 100644
index d60a96fe8a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions;
-
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Interface to provide convenient functions for editors that may not be
- * ITextEditors, but need to expose properties usually found in text editors
- */
-public interface ISourceEditingTextTools {
-
- /**
- * @return the document offset at which the Caret is located
- */
- public int getCaretOffset();
-
- /**
- * @return the IDocument being edited. If this editor supports multiple
- * documents, the document currently possessing the caret will be
- * returned.
- */
- public IDocument getDocument();
-
- /**
- * @return The IEditorPart instance for this editor that is known to the
- * workbench.
- */
- public IEditorPart getEditorPart();
-
- /**
- * @return The current selection within the editor. Implementors may
- * support other types of selection.
- */
- public ITextSelection getSelection();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
deleted file mode 100644
index bf6c9aee76..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;
-
-/**
- * @author pavery
- */
-public interface IBreakpointConstants {
- String ATTR_HIDDEN = "hidden"; //$NON-NLS-1$
- /**
- * Setters of this attribute should use '/'for segment separators when
- * representing paths.
- */
- String RESOURCE_PATH = "org.eclipse.wst.sse.ui.extensions.breakpoint.path"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
deleted file mode 100644
index b10cdf1399..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
+++ /dev/null
@@ -1,63 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-/**
- * Interface to provide breakpoint creation
- */
-public interface IBreakpointProvider {
-
- /**
- * Adds breakpoint to specified position
- *
- * @param document
- * IDocument object
- * @param input
- * current editor input, not necessarily an IFileEditorInput or
- * linked to a resource in any way
- * @param lineNumber
- * current line number
- * @param offset
- * current caret offset
- * @throws CoreException
- * @return IStatus the status after being asked to add a breakpoint. The
- * Severity of ERROR should only be used if the location
- * information is both valid for a breakpoint and one could not be
- * added. Any severity greater than INFO will be logged, and if
- * no breakpoints were created, shown to the user.
- */
- IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException;
-
- /**
- * Returns corresponding resource from editor input
- *
- * @param input
- * @return IResource
- */
- IResource getResource(IEditorInput input);
-
- /**
- * Set ISourceEditingTextTools object
- *
- * @param tool
- * ISourceEditingTextTools object
- */
- void setSourceEditingTextTools(ISourceEditingTextTools tool);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
deleted file mode 100644
index 5e5d7f50ae..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.texteditor.IElementStateListener;
-
-public interface IExtendedStorageEditorInput extends IStorageEditorInput {
- /**
- * Adds the given element state listener to this input. Has no effect if
- * an identical listener is already registered. Typically used by the
- * IDocumentProvider to register itself for change notification.
- *
- * @param listener
- * the listener
- */
- void addElementStateListener(IElementStateListener listener);
-
- /**
- * Removes the given element state listener from this input. Has no affect
- * if an identical listener is not registered.
- *
- * @param listener
- * the listener
- */
- void removeElementStateListener(IElementStateListener listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java
deleted file mode 100644
index ff34c7058f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;
-
-
-public interface NodeLocation {
- /**
- * Returns the document end offset of the end tag, -1 of there is no end
- * tag
- *
- * @return
- */
- int getEndTagEndOffset();
-
- /**
- * Returns the document start offset of the end tag, -1 of there is no end
- * tag
- *
- * @return
- */
- int getEndTagStartOffset();
-
- /**
- * Returns the document end offset of the start tag, -1 of there is no
- * start tag
- *
- * @return
- */
- int getStartTagEndOffset();
-
- /**
- * Returns the document start offset of the start tag, -1 of there is no
- * start tag
- *
- * @return
- */
- int getStartTagStartOffset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java
deleted file mode 100644
index a926fa7681..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-public class NullSourceEditingTextTools implements ISourceEditingTextTools {
- public static final String ID = "sourceeditingtexttools"; //$NON-NLS-1$
- private ITextEditor fTextEditor;
-
- /**
- * @return
- */
- public synchronized static ISourceEditingTextTools getInstance() {
- return new NullSourceEditingTextTools();
- }
-
- private NullSourceEditingTextTools() {
- super();
- }
-
- public int getCaretOffset() {
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- if (sel instanceof ITextSelection) {
- return ((ITextSelection) sel).getOffset();
- }
- return -1;
- }
-
- public IDocument getDocument() {
- return fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
- }
-
- public IEditorPart getEditorPart() {
- return fTextEditor;
- }
-
- public ITextSelection getSelection() {
- if (fTextEditor != null)
- return (ITextSelection) fTextEditor.getSelectionProvider().getSelection();
- return TextSelection.emptySelection();
- }
-
- public void setTextEditor(ITextEditor editor) {
- fTextEditor = editor;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
deleted file mode 100644
index 5440c76ebc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.tasks.FileTaskScannerRegistryReader;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.Sorter;
-
-import com.ibm.icu.text.Collator;
-
-class ExclusionsTab implements IPreferenceTab {
- private class ArrayTreeContentProvider implements ITreeContentProvider {
- public ArrayTreeContentProvider() {
- super();
- }
-
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Object[])
- return fContentTypeSorter.sort((Object[]) parentElement);
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- private class ContentTypeLabelProvider extends LabelProvider {
- public String getText(Object element) {
- if (element != null) {
- Object o = element;
- if (o instanceof String) {
- o = fContentTypeManager.getContentType(o.toString());
- }
- if (o instanceof IContentType) {
- return ((IContentType) o).getName();
- }
- }
- return super.getText(element);
- }
- }
-
- /**
- * A QuickSorter that sorts and returns a IContentType-typed array
- */
- private class ContentTypeSorter extends Sorter {
- private Collator collator = Collator.getInstance(Locale.ENGLISH);
-
- public boolean compare(Object elementOne, Object elementTwo) {
- return (collator.compare(((IContentType) elementOne).getName(), ((IContentType) elementTwo).getName())) < 0;
- }
-
- public Object[] sort(Object[] unSortedCollection) {
- Object[] types = super.sort(unSortedCollection);
- IContentType[] sortedTypes = new IContentType[types.length];
- if (types.length > 0) {
- System.arraycopy(types, 0, sortedTypes, 0, sortedTypes.length);
- }
- return sortedTypes;
- }
- }
-
- private class ContentTypeTreeProvider implements ITreeContentProvider {
- public ContentTypeTreeProvider() {
- super();
- }
-
- public void dispose() {
- }
-
- boolean equals(Object left, Object right) {
- return left == null ? right == null : ((right != null) && left.equals(right));
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Object[]) {
- return (Object[]) parentElement;
- }
- if (parentElement instanceof IContentType) {
- List elements = new ArrayList(0);
- IContentType[] allTypes = fContentTypeManager.getAllContentTypes();
- for (int i = 0; i < allTypes.length; i++) {
- if (!fSupportedContentTypes.contains(allTypes[i]) && equals(allTypes[i].getBaseType(), parentElement)) {
- elements.add(allTypes[i]);
- }
- }
- return fContentTypeSorter.sort(elements.toArray());
- }
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- Object parent = null;
- if (element instanceof IContentType) {
- parent = ((IContentType) element).getBaseType();
- }
- return parent;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- /**
- * A QuickSorter that sorts and returns a String-typed array
- */
- private class StringSorter extends Sorter {
- Collator collator = Collator.getInstance(Locale.ENGLISH);
-
- public boolean compare(Object elementOne, Object elementTwo) {
- return (collator.compare(elementOne.toString(), elementTwo.toString()) < 0);
- }
-
- public Object[] sort(Object[] unSortedCollection) {
- Object[] sortedCollection = super.sort(unSortedCollection);
- String[] strings = new String[sortedCollection.length];
- // copy the array so can return a new sorted collection
- if (strings.length > 0) {
- System.arraycopy(sortedCollection, 0, strings, 0, strings.length);
- }
- return strings;
- }
- }
-
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private CheckboxTreeViewer fContentTypeList;
-
- private IContentTypeManager fContentTypeManager = null;
-
- ContentTypeSorter fContentTypeSorter = new ContentTypeSorter();
-
- private IContentType[] fIgnoreContentTypes = null;
-
- private IContentType[] fOriginalIgnoreContentTypes = null;
-
- private TaskTagPreferencePage fOwner = null;
-
- private IScopeContext[] fPreferencesLookupOrder = null;
-
- private IPreferencesService fPreferencesService = null;
-
- private List fSupportedContentTypes = null;
-
- public ExclusionsTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
- super();
- fOwner = parent;
- fPreferencesLookupOrder = lookupOrder;
- fPreferencesService = preferencesService;
- fContentTypeManager = Platform.getContentTypeManager();
-
- String[] supportedContentTypeIDs = FileTaskScannerRegistryReader.getInstance().getSupportedContentTypeIds();
- fSupportedContentTypes = new ArrayList(supportedContentTypeIDs.length);
- for (int i = 0; i < supportedContentTypeIDs.length; i++) {
- IContentType type = fContentTypeManager.getContentType(supportedContentTypeIDs[i]);
- if (type != null) {
- fSupportedContentTypes.add(type);
- }
- }
- String[] ignoreContentTypes = StringUtils.unpack(fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, SSECorePlugin.getDefault().getPluginPreferences().getDefaultString(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED), fPreferencesLookupOrder));
- List contentTypes = new ArrayList();
- for (int i = 0; i < ignoreContentTypes.length; i++) {
- IContentType type = fContentTypeManager.getContentType(ignoreContentTypes[i]);
- if (type != null) {
- contentTypes.add(type);
- }
- }
- fOriginalIgnoreContentTypes = fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
- }
-
- public Control createContents(Composite tabFolder) {
- SashForm sash = new SashForm(tabFolder, SWT.VERTICAL);
- Composite composite = new Composite(sash, SWT.NONE);
- composite.setLayout(new GridLayout(2, true));
- Label description = new Label(composite, SWT.NONE);
- description.setText(SSEUIMessages.TaskTagExclusionTab_02);
-// description.setBackground(composite.getBackground());
-
- fContentTypeList = new CheckboxTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- fContentTypeList.setLabelProvider(new ContentTypeLabelProvider());
- fContentTypeList.setContentProvider(new ArrayTreeContentProvider());
-
- fContentTypeList.setInput(fSupportedContentTypes.toArray());
- fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
- fContentTypeList.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
- for (int i = 0; i < fIgnoreContentTypes.length; i++) {
- fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
- }
-
- Button selectAll = new Button(composite, SWT.PUSH);
- selectAll.setText(SSEUIMessages.TaskTagPreferenceTab_17);
- selectAll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
- selectAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
- }
- });
-
- Button selectNone = new Button(composite, SWT.PUSH);
- selectNone.setText(SSEUIMessages.TaskTagPreferenceTab_18);
- selectNone.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
- selectNone.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fContentTypeList.setCheckedElements(new Object[0]);
- }
- });
-
- composite = new Composite(sash, SWT.NONE);
- composite.setLayout(new GridLayout(2, true));
- new Label(composite, SWT.NONE).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-
- Label affectedTypesLabel = new Label(composite, SWT.NONE);
- affectedTypesLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-// affectedTypesLabel.setBackground(composite.getBackground());
- affectedTypesLabel.setText(SSEUIMessages.TaskTagExclusionTab_03);
-
- final TreeViewer contentTypeTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- contentTypeTreeViewer.setLabelProvider(new ContentTypeLabelProvider());
- contentTypeTreeViewer.setContentProvider(new ContentTypeTreeProvider());
- contentTypeTreeViewer.setInput(new Object[0]);
- contentTypeTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
- fContentTypeList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection) {
- Object[] o = ((IStructuredSelection) event.getSelection()).toArray();
- contentTypeTreeViewer.setInput(o);
- contentTypeTreeViewer.expandAll();
- if (o.length > 0) {
- contentTypeTreeViewer.reveal(o[0]);
- }
- }
- }
- });
-
- return sash;
- }
-
- public String getTitle() {
- return SSEUIMessages.TaskTagExclusionTab_01;
- }
-
- public void performApply() {
- save();
- }
-
- public void performDefaults() {
- if (_debugPreferences) {
- System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
- }
- IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
- for (int i = 1; i < defaultPreferences.length; i++) {
- defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- }
- String[] defaultIgnoreTypes = StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, defaultPreferences)); //$NON-NLS-1$
-
- List contentTypes = new ArrayList();
- for (int i = 0; i < defaultIgnoreTypes.length; i++) {
- IContentType type = fContentTypeManager.getContentType(defaultIgnoreTypes[i]);
- if (type != null) {
- contentTypes.add(type);
- }
- }
- fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
- fContentTypeList.setCheckedElements(fContentTypeManager.getAllContentTypes());
- for (int i = 0; i < fIgnoreContentTypes.length; i++) {
- fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
- }
- }
-
- public void performOk() {
- List ignoredIds = save();
- String[] ignoreIDs = (String[]) new StringSorter().sort(ignoredIds.toArray());
- fIgnoreContentTypes = new IContentType[ignoreIDs.length];
- for (int i = 0; i < ignoreIDs.length; i++) {
- fIgnoreContentTypes[i] = fContentTypeManager.getContentType(ignoreIDs[i]);
- }
-
- if (!Arrays.equals(fOriginalIgnoreContentTypes, fIgnoreContentTypes)) {
- fOwner.requestRedetection();
- }
- fOriginalIgnoreContentTypes = fIgnoreContentTypes;
- }
-
- private List save() {
- List ignoredIds = new ArrayList();
- List checked = Arrays.asList(fContentTypeList.getCheckedElements());
- for (int i = 0; i < fSupportedContentTypes.size(); i++) {
- if (!checked.contains(fSupportedContentTypes.get(i))) {
- ignoredIds.add(((IContentType) fSupportedContentTypes.get(i)).getId());
- }
- }
- IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
- for (int i = 1; i < defaultPreferences.length; i++) {
- defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- }
-
- String defaultIgnoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, "", defaultPreferences)))); //$NON-NLS-1$
- String ignoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(ignoredIds.toArray()));
- if (ignoredContentTypeIds.equals(defaultIgnoredContentTypeIds)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED);
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " \"" + ignoredContentTypeIds + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, ignoredContentTypeIds);
- }
- return ignoredIds;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
deleted file mode 100644
index 864fd02d70..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.wst.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-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.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-import com.ibm.icu.util.StringTokenizer;
-
-class MainTab implements IPreferenceTab {
- public class TaskTagDialog extends Dialog {
- public TaskTag taskTag = null;
-
- Combo priorityCombo = null;
- Text tagText = null;
-
- public TaskTagDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(SSEUIMessages.TaskTagPreferenceTab_5); //$NON-NLS-1$
- }
-
- protected Control createButtonBar(Composite parent) {
- Control c = super.createButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(taskTag == null || taskTag.getTag().length() > 0);
- return c;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.widthHint = parent.getDisplay().getClientArea().width / 5;
- composite.setLayoutData(gridData);
- Label label = new Label(composite, SWT.NONE);
- label.setText(SSEUIMessages.TaskTagPreferenceTab_6); //$NON-NLS-1$
- label.setLayoutData(new GridData());
- tagText = new Text(composite, SWT.BORDER);
- tagText.setText(taskTag != null ? taskTag.getTag() : ""); //$NON-NLS-1$
- tagText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- tagText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String testTag = tagText.getText();
- String[] tags = new String[fTaskTags.length];
- for (int i = 0; i < tags.length; i++) {
- tags[i] = fTaskTags[i].getTag();
- }
- getButton(IDialogConstants.OK_ID).setEnabled(tagText.getText().length() > 0 && !Arrays.asList(tags).contains(testTag));
- taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
- }
- });
-
- label = new Label(composite, SWT.NONE);
- label.setText(SSEUIMessages.TaskTagPreferenceTab_7); //$NON-NLS-1$
- label.setLayoutData(new GridData());
- priorityCombo = new Combo(composite, SWT.READ_ONLY | SWT.SINGLE);
- priorityCombo.setItems(new String[]{SSEUIMessages.TaskTagPreferenceTab_0, SSEUIMessages.TaskTagPreferenceTab_1, SSEUIMessages.TaskTagPreferenceTab_2});
- priorityCombo.select(taskTag != null ? taskTag.getPriority() : TaskTag.PRIORITY_NORMAL);
- priorityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- priorityCombo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- taskTag = new TaskTag(taskTag.getTag(), priorityCombo.getSelectionIndex());
- }
- });
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
- super.okPressed();
- }
- }
-
- public class TaskTagTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public TaskTagTableLabelProvider() {
- super();
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex < 1)
- return ((TaskTag) element).getTag();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (fTaskTags[i].equals(element)) {
- if (fTaskTags[i].getPriority() == IMarker.PRIORITY_LOW) {
- return SSEUIMessages.TaskTagPreferenceTab_0; //$NON-NLS-1$
- }
- else if (fTaskTags[i].getPriority() == IMarker.PRIORITY_HIGH) {
- return SSEUIMessages.TaskTagPreferenceTab_2; //$NON-NLS-1$
- }
- else {
- return SSEUIMessages.TaskTagPreferenceTab_1; //$NON-NLS-1$
- }
- }
- }
- return SSEUIMessages.TaskTagPreferenceTab_3; //$NON-NLS-1$
- }
- }
-
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private Control fControl;
-
- private TaskTag[] fOriginalTaskTags;
- private TaskTagPreferencePage fOwner = null;
- private IScopeContext[] fPreferencesLookupOrder = null;
-
- private IPreferencesService fPreferencesService = null;
-
- private TaskTag[] fTaskTags;
-
- private TableViewer valueTable = null;
-
-
- public MainTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
- super();
- fOwner = parent;
- fPreferencesLookupOrder = lookupOrder;
- fPreferencesService = preferencesService;
- }
-
-
- private void addTag() {
- TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
- int result = dlg.open();
- if (result == Window.OK) {
- TaskTag newTag = dlg.taskTag;
- List newTags = new ArrayList(Arrays.asList(fTaskTags));
- newTags.add(newTag);
- fTaskTags = (TaskTag[]) newTags.toArray(new TaskTag[newTags.size()]);
- valueTable.setInput(fTaskTags);
- valueTable.getTable().setSelection(fTaskTags.length - 1);
- }
- }
-
- public Control createContents(Composite tabFolder) {
- loadPreferenceValues();
- fOriginalTaskTags = fTaskTags;
-
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- fControl = composite;
-
- Label description = new Label(composite, SWT.NONE);
- description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$
-// description.setBackground(composite.getBackground());
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403
- Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.widthHint = sizeHint.x;
- description.setLayoutData(gd);
-
- valueTable = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- valueTable.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- TableColumn textColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 0);
- textColumn.setText(SSEUIMessages.TaskTagPreferenceTab_12); //$NON-NLS-1$
- TableColumn priorityColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 1);
- priorityColumn.setText(SSEUIMessages.TaskTagPreferenceTab_13); //$NON-NLS-1$
- valueTable.setContentProvider(new ArrayContentProvider());
- valueTable.setLabelProvider(new TaskTagTableLabelProvider());
- valueTable.getTable().setLinesVisible(true);
- valueTable.getTable().setHeaderVisible(true);
- TableLayout layout = new TableLayout();
- layout.addColumnData(new ColumnWeightData(1, 140, true));
- layout.addColumnData(new ColumnWeightData(1, 140, true));
- valueTable.getTable().setLayout(layout);
-
- Composite buttons = new Composite(composite, SWT.NONE);
- buttons.setLayout(new GridLayout());
- buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
- final Button addButton = new Button(buttons, SWT.PUSH);
- addButton.setText(SSEUIMessages.TaskTagPreferenceTab_14); //$NON-NLS-1$
- addButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- final Button editButton = new Button(buttons, SWT.PUSH);
- editButton.setText(SSEUIMessages.TaskTagPreferenceTab_15); //$NON-NLS-1$
- editButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- final Button removeButton = new Button(buttons, SWT.PUSH);
- removeButton.setText(SSEUIMessages.TaskTagPreferenceTab_16); //$NON-NLS-1$
- removeButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- editButton.setEnabled(false);
- removeButton.setEnabled(false);
-
- Label warning = new Label(composite, SWT.NONE);
- warning.setLayoutData(new GridData());
- warning.setText(SSEUIMessages.TaskTagPreferenceTab_19); //$NON-NLS-1$
-
- final ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = valueTable.getSelection();
- editButton.setEnabled(((IStructuredSelection) selection).size() == 1);
- removeButton.setEnabled(!selection.isEmpty());
- }
- };
- valueTable.addPostSelectionChangedListener(selectionChangedListener);
- addButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- addTag();
- valueTable.getTable().setSelection(fTaskTags.length - 1);
- selectionChangedListener.selectionChanged(null);
- }
- });
- editButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int i = valueTable.getTable().getSelectionIndex();
- editTag(i);
- if (i >= 0) {
- valueTable.getTable().setSelection(i);
- selectionChangedListener.selectionChanged(null);
- }
- }
- });
- removeButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int i = valueTable.getTable().getSelectionIndex();
- removeTags(valueTable.getSelection());
- if (i >= 0 && i < fTaskTags.length) {
- valueTable.getTable().setSelection(i);
- }
- }
- });
- valueTable.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- int i = valueTable.getTable().getSelectionIndex();
- editTag(i);
- if (i >= 0) {
- valueTable.getTable().setSelection(i);
- selectionChangedListener.selectionChanged(null);
- }
- }
- });
-
- valueTable.setInput(fTaskTags);
-
- return composite;
- }
-
- /**
- * @param selection
- */
- private void editTag(int i) {
- if (i < 0) {
- return;
- }
-
- int selection = valueTable.getTable().getSelectionIndex();
- TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
- dlg.taskTag = fTaskTags[selection];
- int result = dlg.open();
- if (result == Window.OK) {
- fTaskTags[selection] = dlg.taskTag;
- valueTable.refresh();
- }
- }
-
- public String getTitle() {
- return SSEUIMessages.TaskTagPreferenceTab_20;
- }
-
- private void loadPreferenceValues() {
- String tags = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, "", fPreferencesLookupOrder); //$NON-NLS-1$
- String priorities = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, "", fPreferencesLookupOrder); //$NON-NLS-1$
- loadTagsAndPrioritiesFrom(tags, priorities);
- }
-
- /**
- * @param tags
- * @param priorities
- */
- private void loadTagsAndPrioritiesFrom(String tagString, String priorityString) {
- String[] tags = StringUtils.unpack(tagString);
-
- StringTokenizer toker = null;
- List list = new ArrayList();
-
- toker = new StringTokenizer(priorityString, ","); //$NON-NLS-1$
- while (toker.hasMoreTokens()) {
- Integer number = null;
- try {
- number = Integer.valueOf(toker.nextToken());
- }
- catch (NumberFormatException e) {
- number = new Integer(IMarker.PRIORITY_NORMAL);
- }
- list.add(number);
- }
- Integer[] priorities = (Integer[]) list.toArray(new Integer[0]);
-
- fTaskTags = new TaskTag[Math.min(tags.length, priorities.length)];
- for (int i = 0; i < fTaskTags.length; i++) {
- fTaskTags[i] = new TaskTag(tags[i], priorities[i].intValue());
- }
- }
-
- public void performApply() {
- save();
-
- if (!Arrays.equals(fOriginalTaskTags, fTaskTags)) {
- fOwner.requestRedetection();
- }
- fOriginalTaskTags = fTaskTags;
- }
-
- public void performDefaults() {
- if (_debugPreferences) {
- System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
- }
- final IEclipsePreferences defaultPreferences = fPreferencesLookupOrder.length > 0 ? fPreferencesLookupOrder[fPreferencesLookupOrder.length - 1].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE) : null;
- String tags = null;
- String priorities = null;
- if (defaultPreferences != null) {
- tags = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null);
- priorities = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null);
- }
- loadTagsAndPrioritiesFrom(tags, priorities);
- int selection = valueTable.getTable().getSelectionIndex();
- valueTable.setInput(fTaskTags);
- valueTable.getTable().setSelection(selection);
- }
-
- public void performOk() {
- performApply();
- }
-
- /**
- * @param selection
- */
- private void removeTags(ISelection selection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- List taskTags = new ArrayList(Arrays.asList(fTaskTags));
- taskTags.removeAll(structuredSelection.toList());
- fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]);
- valueTable.setInput(fTaskTags);
- }
-
- private void save() {
- IEclipsePreferences defaultPreferences = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- String defaultTags = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null);
- String defaultPriorities = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null);
-
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (i > 0) {
- buf.append(","); //$NON-NLS-1$
- }
- buf.append(fTaskTags[i].getTag());
- }
- String currentTags = buf.toString();
- if (currentTags.equals(defaultTags) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_TAGS);
- }
- else {
- fOwner.requestRedetection();
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " \"" + currentTags + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_TAGS, currentTags);
- }
-
- StringBuffer buf2 = new StringBuffer();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (i > 0) {
- buf2.append(","); //$NON-NLS-1$
- }
- buf2.append(String.valueOf(fTaskTags[i].getPriority()));
- }
- String priorities = buf2.toString();
-
- if (priorities.equals(defaultPriorities) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES);
- }
- else {
- fOwner.requestRedetection();
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " \"" + priorities + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, priorities);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
deleted file mode 100644
index 3aefbf811c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.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 loosley on org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage
- */
-abstract class PropertyPreferencePage extends PropertyPage implements IWorkbenchPreferencePage {
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/preferences-properties")); //$NON-NLS-1$ //$NON-NLS-2$
- /*
- * Disable link data, prevents the display of a "workspace" or "project"
- * settings link to prevent recursive dialog launching
- */
- private static final Object DISABLE_LINK = "DISABLE_LINK"; //$NON-NLS-1$
-
- private Map fData = null;
-
- private Button fEnableProjectSettings;
-
- private Link fProjectSettingsLink;
-
- private Control fCommon;
-
- private ControlEnableState fEnablements;
-
- public PropertyPreferencePage() {
- super();
- }
-
- public final void applyData(Object data) {
- super.applyData(data);
- if (data instanceof Map) {
- fData = (Map) data;
- updateLinkEnablement();
- }
- }
-
- protected abstract Control createCommonContents(Composite composite);
-
- public final Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
-
- Composite checkLinkComposite = new Composite(composite, SWT.NONE);
- checkLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- checkLinkComposite.setLayout(new GridLayout(2, false));
-
- if (getProject() != null) {
- fEnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
- fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings); //$NON-NLS-1$//$NON-NLS-2$
- fEnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
- fEnableProjectSettings.setSelection(enabledForProject);
- }
- else {
- Label spacer = new Label(checkLinkComposite, SWT.CHECK);
- spacer.setLayoutData(new GridData());
- }
-
- fProjectSettingsLink = new Link(checkLinkComposite, SWT.NONE);
- fProjectSettingsLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
-
- /*
- * "element" should be a project, if null, link to per-project
- * properties
- */
- if (getProject() != null) {
- fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureWorkspaceSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
- else {
- fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureProjectSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- updateLinkEnablement();
-
- fProjectSettingsLink.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (getProject() == null) {
- openProjectSettings();
- }
- else {
- openWorkspaceSettings();
- }
- }
-
- });
-
- if (getProject() != null) {
- Label line = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- line.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- }
-
- 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;
- }
-
- public void createControl(Composite parent) {
- if (getProject() != null) {
- noDefaultAndApplyButton();
- }
- super.createControl(parent);
- }
-
- protected IScopeContext[] createPreferenceScopes() {
- IProject project = getProject();
- if (project != null) {
- return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
- }
- return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- }
-
- protected abstract String getPreferenceNodeQualifier();
-
- protected abstract String getPreferencePageID();
-
- protected IProject getProject() {
- if (getElement() != null) {
- 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();
- }
-
- /**
- * 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);
- }
- }
-
- private void updateLinkEnablement() {
- if (fData != null && fProjectSettingsLink != null) {
- fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
deleted file mode 100644
index cb1be0f66b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class TaskTagPreferencePage extends PropertyPreferencePage {
-
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
- // Remember the last displayed tab for convenience
- private static final String TASK_TAG_LAST_TAB = "task-tag-last-tab"; //$NON-NLS-1$
-
- private int detectionRequested = 0;
-
- private Button fEnableCheckbox = null;
-
- private boolean fEnableTaskTags = true;
-
- private boolean fOriginalEnableTaskTags = true;
-
- private IPreferencesService fPreferencesService = null;
-
- private Button fRedetectButton;
-
- private SelectionListener fTabEnablementListener;
-
- private TabFolder fTabFolder;
- private IPreferenceTab[] fTabs = null;
-
- public TaskTagPreferencePage() {
- super();
- fPreferencesService = Platform.getPreferencesService();
- }
-
- protected void contributeButtons(Composite parent) {
- if (getElement() == null) {
- ((GridLayout) parent.getLayout()).numColumns += 2;
- fRedetectButton = new Button(parent, SWT.PUSH);
- fRedetectButton.setText(SSEUIMessages.TaskTagPreferencePage_32); //$NON-NLS-1$
- fRedetectButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL));
- fRedetectButton.setEnabled(true);
- fRedetectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Job redetectJob = new Job(SSEUIMessages.TaskTagPreferenceTab_27) { //$NON-NLS-1$
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- TaskScanningScheduler.refresh();
- return Status.OK_STATUS;
- }
- };
- redetectJob.schedule();
- }
- });
- Label spacer = new Label(parent, SWT.NONE);
- spacer.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER));
- }
- super.contributeButtons(parent);
- }
-
- protected Control createCommonContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout compositeLayout = new GridLayout();
- compositeLayout.marginLeft = 0;
- compositeLayout.marginRight = 0;
- composite.setLayout(compositeLayout);
-
- IScopeContext[] preferenceScopes = createPreferenceScopes();
- fOriginalEnableTaskTags = fEnableTaskTags = fPreferencesService.getBoolean(getPreferenceNodeQualifier(), TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, preferenceScopes);
- fEnableCheckbox = new Button(composite, SWT.CHECK);
- fEnableCheckbox.setSelection(fEnableTaskTags);
- fEnableCheckbox.setText(SSEUIMessages.TaskTagPreferenceTab_31); //$NON-NLS-1$
- fEnableCheckbox.setSelection(fEnableTaskTags);
- fEnableCheckbox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_END, false, false, 1, 1));
-
- fTabFolder = new TabFolder(composite, SWT.NONE);
- fTabFolder.setLayout(new TabFolderLayout());
- fTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
- TabItem taskItem = new TabItem(fTabFolder, SWT.NONE);
- MainTab mainTab = new MainTab(this, fPreferencesService, preferenceScopes);
- taskItem.setText(mainTab.getTitle());
- final Control taskTagsControl = mainTab.createContents(fTabFolder);
- taskItem.setControl(taskTagsControl);
-
- TabItem exclusionItem = new TabItem(fTabFolder, SWT.NONE);
- ExclusionsTab exclusionsTab = new ExclusionsTab(this, fPreferencesService, preferenceScopes);
- exclusionItem.setText(exclusionsTab.getTitle());
- final Control exclusionControl = exclusionsTab.createContents(fTabFolder);
- exclusionItem.setControl(exclusionControl);
-
- fTabs = new IPreferenceTab[]{mainTab, exclusionsTab};
-
- fTabEnablementListener = new SelectionAdapter() {
- ControlEnableState[] lastEnableStates = null;
-
- public void widgetSelected(SelectionEvent e) {
- fEnableTaskTags = fEnableCheckbox.getSelection();
- if (fEnableTaskTags) {
- if (lastEnableStates != null) {
- for (int i = 0; i < lastEnableStates.length; i++) {
- if (lastEnableStates[i] != null) {
- lastEnableStates[i].restore();
- }
- }
- lastEnableStates = null;
- fTabFolder.redraw();
- }
- }
- else if (lastEnableStates == null) {
- lastEnableStates = new ControlEnableState[fTabs.length + 1];
- lastEnableStates[0] = ControlEnableState.disable(taskTagsControl);
- lastEnableStates[1] = ControlEnableState.disable(exclusionControl);
- if (fRedetectButton != null) {
- lastEnableStates[2] = ControlEnableState.disable(fRedetectButton);
- }
- }
- }
- };
- fTabEnablementListener.widgetSelected(null);
- fEnableCheckbox.addSelectionListener(fTabEnablementListener);
-
- // restore last selected tab
- int activeTab = new DefaultScope().getNode(getPreferenceNodeQualifier()).getInt(TASK_TAG_LAST_TAB, 0);
- if (activeTab > 0) {
- fTabFolder.setSelection(activeTab);
- }
-
- SSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PREFWEBX_TASKTAGS_HELPID);
- return composite;
- }
-
- protected String getPreferenceNodeQualifier() {
- return TaskTagPreferenceKeys.TASK_TAG_NODE;
- }
-
- protected String getPreferencePageID() {
- return "org.eclipse.wst.sse.ui.preferences.tasktags";//$NON-NLS-1$
-
- }
-
- protected String getProjectSettingsKey() {
- return TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT;
- }
-
- protected String getPropertyPageID() {
- return "org.eclipse.wst.sse.ui.project.properties.tasktags";//$NON-NLS-1$
- }
-
- public String getTitle() {
- return SSEUIMessages.TaskTagPreferenceTab_20; //$NON-NLS-1$
- }
-
- public void init(IWorkbench workbench) {
- }
-
- public void performApply() {
- super.performApply();
- save();
-
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performApply();
- }
-
- promptForRedetectIfNecessary();
- }
-
- public void performDefaults() {
- super.performDefaults();
- IEclipsePreferences defaultPreferences = createPreferenceScopes()[1].getNode(getPreferenceNodeQualifier());
- fEnableTaskTags = defaultPreferences.getBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
- fEnableCheckbox.setSelection(fEnableTaskTags);
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performDefaults();
- }
- fTabEnablementListener.widgetSelected(null);
- if (_debugPreferences) {
- System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
- }
- }
-
- public boolean performOk() {
- boolean ok = super.performOk();
- save();
-
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performOk();
- }
-
- promptForRedetectIfNecessary();
-
- // save last tab (use Default scope since it won't be persisted)
- new DefaultScope().getNode(getPreferenceNodeQualifier()).putInt(TASK_TAG_LAST_TAB, fTabFolder.getSelectionIndex());
-
- IScopeContext[] contexts = createPreferenceScopes();
- // remove project-specific information if it's not enabled
- if (getProject() != null && !isElementSettingsEnabled()) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT);
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED);
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES);
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_TAGS);
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_ENABLE);
- }
- for (int i = 0; i < contexts.length; i++) {
- try {
- contexts[i].getNode(getPreferenceNodeQualifier()).flush();
- }
- catch (BackingStoreException e) {
- Logger.logException("problem saving preference settings to scope " + contexts[i].getName(), e); //$NON-NLS-1$
- }
- }
-
- return ok;
- }
-
-
- private void promptForRedetectIfNecessary() {
- if (detectionRequested > 0) {
- MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SSEUIMessages.TaskTagPreferenceTab_22, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImage(), SSEUIMessages.TaskTagPreferenceTab_23, MessageDialog.QUESTION, new String[]{SSEUIMessages.TaskTagPreferenceTab_24, SSEUIMessages.TaskTagPreferenceTab_25, SSEUIMessages.TaskTagPreferenceTab_26}, 2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- int button = dialog.open();
- if (button == 0) {
- Job redetectJob = new Job(SSEUIMessages.TaskTagPreferenceTab_27) { //$NON-NLS-1$
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- if (getProject() == null) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + ": rescanning all"); //$NON-NLS-1$
- }
- TaskScanningScheduler.refresh();
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + ": rescanning " + getProject()); //$NON-NLS-1$
- }
- TaskScanningScheduler.refresh(getProject());
- }
- return Status.OK_STATUS;
- }
- };
- redetectJob.schedule(500);
- }
- detectionRequested = 0;
- }
- }
-
- void requestRedetection() {
- detectionRequested++;
- }
-
- private void save() {
- if (fEnableTaskTags != fOriginalEnableTaskTags) {
- requestRedetection();
- }
- fOriginalEnableTaskTags = fEnableTaskTags;
-
- IScopeContext[] preferenceScopes = createPreferenceScopes();
- IEclipsePreferences defaultPreferences = preferenceScopes[1].getNode(getPreferenceNodeQualifier());
- boolean defaultEnable = defaultPreferences.getBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
- if (fEnableTaskTags == defaultEnable) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_ENABLE);
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " \"" + fEnableTaskTags + "\" 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(TaskTagPreferenceKeys.TASK_TAG_ENABLE, fEnableTaskTags);
- }
- if (getProject() != null && 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(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT, true);
- }
- 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(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT);
- }
- try {
- fPreferencesService.getRootNode().flush();
- }
- catch (BackingStoreException e) {
- // log it, there is no recovery
- Logger.logException(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
deleted file mode 100644
index b40d9a5bc0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-class EditorExecutionContext implements IExecutionDelegate {
-
- /**
- * Reusable runnable for the Display execution queue to cut down on
- * garbage creation. Will make use of the progress service if possible.
- */
- private static class ReusableUIRunner implements Runnable, IRunnableWithProgress {
- private StructuredTextEditor editor;
- private ISafeRunnable fRunnable = null;
-
- ReusableUIRunner(StructuredTextEditor part) {
- super();
- editor = part;
- }
-
- /*
- * Expected to only be run by Display queue in the UI Thread
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- IWorkbenchPartSite site = editor.getEditorPart().getSite();
- final IWorkbenchWindow workbenchWindow = (site == null) ? null : site.getWorkbenchWindow();
- final IWorkbenchSiteProgressService jobService = (IWorkbenchSiteProgressService) ((site == null) ? null : site.getAdapter(IWorkbenchSiteProgressService.class));
- /*
- * Try to use the progress service so the workbench can give more
- * feedback to the user (although editors seem to make less use of
- * the service than views -
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86221 .
- */
- if (workbenchWindow != null && jobService != null) {
- /*
- * Doc is ambiguous, but it must be run from the UI thread -
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=165180
- */
- try {
- jobService.runInUI(workbenchWindow, this, (ISchedulingRule) editor.getEditorPart().getEditorInput().getAdapter(IResource.class));
- }
- catch (InvocationTargetException e) {
- Logger.logException(e);
- }
- catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
- else {
- /*
- * Run it directly and direct the UI of the editor. See
- * StructuredTextEditor's begin/end background job for other
- * activities to best accommodate (for example, there is a
- * "timed delay" before the editor itself leaves
- * background-update mode). NOTE: this execute method itself
- * is always called from inside of an ILock block, so another
- * block is not not needed here for all these sycnExec's.
- */
- IWorkbench workbench = SSEUIPlugin.getInstance().getWorkbench();
- final Display display = workbench.getDisplay();
- if (display != null && !display.isDisposed()) {
- editor.beginBackgroundOperation();
- try {
- /*
- * Here's where the document update/modification
- * occurs
- */
- SafeRunner.run(fRunnable);
- }
- finally {
- /*
- * This 'end' is just a signal to editor that this
- * particular update is done. Its up to the editor to
- * decide exactly when to leave its "background mode"
- */
- editor.endBackgroundOperation();
- }
- }
- fRunnable = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse
- * .core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (fRunnable != null)
- SafeRunner.run(fRunnable);
- }
-
- void setRunnable(ISafeRunnable r) {
- fRunnable = r;
- }
- }
-
- StructuredTextEditor fEditor;
- private ReusableUIRunner fReusableRunner;
-
- public EditorExecutionContext(StructuredTextEditor editor) {
- super();
- fEditor = editor;
- fReusableRunner = new ReusableUIRunner(fEditor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.sse.core.internal.IExecutionDelegate#execute(java.lang
- * .Runnable)
- */
- public void execute(final ISafeRunnable runnable) {
- IWorkbench workbench = SSEUIPlugin.getInstance().getWorkbench();
- final Display display = workbench.getDisplay();
- if (display.getThread() == Thread.currentThread()) {
- // *If already in display thread, we can simply run, "as usual"*/
- SafeRunner.run(runnable);
- }
- else {
- // *otherwise run through the reusable runner */
- fReusableRunner.setRunnable(runnable);
- display.syncExec(fReusableRunner);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java
deleted file mode 100644
index fd054ef577..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui;
-
-import org.eclipse.ui.editors.text.DefaultEncodingSupport;
-import org.eclipse.ui.editors.text.IEncodingSupport;
-import org.eclipse.ui.texteditor.StatusTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-
-/**
- * An implementation that will try to use a <b>provisional</b> configuration
- * if IEncodingSupport.class as a delegate. A delegate, if found, will be
- * asked for encoding information before defaulting to the superclass
- * implementation, but will be told to set the encoding after the superclass
- * has. Delegates should not duplicate any functionality in the
- * DefaultEncodingSupport implementation as they may be executed in addition
- * to the default behavior.
- */
-class EncodingSupport extends DefaultEncodingSupport {
- private String[] fConfigurationPoints = null;
- /** The editor this support is associated with. */
- private StatusTextEditor fStatusTextEditor;
-
- IEncodingSupport fSupportDelegate = null;
-
- EncodingSupport(String[] configurationPoints) {
- super();
- fConfigurationPoints = configurationPoints;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#dispose()
- */
- public void dispose() {
- super.dispose();
-
- if (fSupportDelegate instanceof DefaultEncodingSupport) {
- ((DefaultEncodingSupport) fSupportDelegate).dispose();
- }
- fSupportDelegate = null;
- fStatusTextEditor = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.ui.editors.text.DefaultEncodingSupport#
- * getDefaultEncoding()
- */
- public String getDefaultEncoding() {
- IEncodingSupport delegate = getEncodingSupportDelegate();
- if (delegate != null) {
- return delegate.getDefaultEncoding();
- }
-
- return super.getDefaultEncoding();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#getEncoding ()
- */
- public String getEncoding() {
- IEncodingSupport delegate = getEncodingSupportDelegate();
- if (delegate != null) {
- return delegate.getEncoding();
- }
-
- return super.getEncoding();
- }
-
- IEncodingSupport getEncodingSupportDelegate() {
- if (fSupportDelegate == null) {
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- for (int i = 0; fSupportDelegate == null && i < fConfigurationPoints.length; i++) {
- fSupportDelegate = (IEncodingSupport) builder.getConfiguration(IEncodingSupport.class.getName(), fConfigurationPoints[i]);
- }
- }
- return fSupportDelegate;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.editors.text.DefaultEncodingSupport#initialize(org.eclipse
- * .ui.texteditor.StatusTextEditor)
- */
- public void initialize(StatusTextEditor textEditor) {
- super.initialize(textEditor);
- fStatusTextEditor = textEditor;
-
- IEncodingSupport encodingSupportDelegate = getEncodingSupportDelegate();
- if (encodingSupportDelegate instanceof DefaultEncodingSupport) {
- ((DefaultEncodingSupport) encodingSupportDelegate).initialize(textEditor);
- }
- }
-
- void reinitialize(String[] configurationPoints) {
- if (fSupportDelegate instanceof DefaultEncodingSupport) {
- ((DefaultEncodingSupport) fSupportDelegate).dispose();
- }
- fSupportDelegate = null;
-
- fConfigurationPoints = configurationPoints;
-
- IEncodingSupport encodingSupportDelegate = getEncodingSupportDelegate();
- if (encodingSupportDelegate instanceof DefaultEncodingSupport) {
- ((DefaultEncodingSupport) encodingSupportDelegate).initialize(fStatusTextEditor);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#setEncoding
- * (java.lang.String, boolean)
- */
- protected void setEncoding(String encoding, boolean overwrite) {
- super.setEncoding(encoding, overwrite);
-
- IEncodingSupport delegate = getEncodingSupportDelegate();
- if (delegate != null && overwrite) {
- delegate.setEncoding(encoding);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
deleted file mode 100644
index 04222353ed..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.sse.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.editors.text.IFoldingCommandIds;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.ui.texteditor.ResourceAction;
-import org.eclipse.ui.texteditor.TextOperationAction;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-
-class FoldingActionGroup extends ActionGroup {
- private static abstract class PreferenceAction extends ResourceAction implements IUpdate {
- PreferenceAction(ResourceBundle bundle, String prefix, int style) {
- super(bundle, prefix, style);
- }
- }
-
- private ProjectionViewer fViewer;
-
- private final PreferenceAction fToggle;
- private final TextOperationAction fExpand;
- private final TextOperationAction fExpandAll;
- private final IProjectionListener fProjectionListener;
- private final TextOperationAction fCollapse;
- private final TextOperationAction fCollapseAll;
-
-
- /**
- * Creates a new projection action group for <code>editor</code>. If
- * the supplied viewer is not an instance of <code>ProjectionViewer</code>,
- * the action group is disabled.
- *
- * @param editor
- * the text editor to operate on
- * @param viewer
- * the viewer of the editor
- */
- public FoldingActionGroup(final ITextEditor editor, ITextViewer viewer) {
- if (!(viewer instanceof ProjectionViewer)) {
- fToggle = null;
- fExpand = null;
- fExpandAll = null;
- fCollapse = null;
- fCollapseAll = null;
- fProjectionListener = null;
- return;
- }
-
- fViewer = (ProjectionViewer) viewer;
-
- fProjectionListener = new IProjectionListener() {
-
- public void projectionEnabled() {
- update();
- }
-
- public void projectionDisabled() {
- update();
- }
- };
-
- fViewer.addProjectionListener(fProjectionListener);
-
- fToggle = new PreferenceAction(SSEUIMessages.getResourceBundle(), "Projection_Toggle_", IAction.AS_CHECK_BOX) { //$NON-NLS-1$
- public void run() {
- IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
- boolean current = store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED);
- store.setValue(AbstractStructuredFoldingStrategy.FOLDING_ENABLED, !current);
- }
-
- public void update() {
- ITextOperationTarget target = (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class);
-
- boolean isEnabled = (target != null && target.canDoOperation(ProjectionViewer.TOGGLE));
- setEnabled(isEnabled);
- }
- };
-
- IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
- boolean checked = store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED);
- fToggle.setChecked(checked);
- fToggle.setActionDefinitionId(IFoldingCommandIds.FOLDING_TOGGLE);
- editor.setAction("FoldingToggle", fToggle); //$NON-NLS-1$
-
- fExpand = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Expand_", editor, ProjectionViewer.EXPAND, true); //$NON-NLS-1$
- fExpand.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND);
- editor.setAction("FoldingExpand", fExpand); //$NON-NLS-1$
-
- fExpandAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_ExpandAll_", editor, ProjectionViewer.EXPAND_ALL, true); //$NON-NLS-1$
- fExpandAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND_ALL);
- editor.setAction("FoldingExpandAll", fExpandAll); //$NON-NLS-1$
-
- fCollapse = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Collapse_", editor, ProjectionViewer.COLLAPSE, true); //$NON-NLS-1$
- fCollapse.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE);
- editor.setAction("FoldingCollapse", fCollapse); //$NON-NLS-1$
-
- fCollapseAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_CollapseAll_", editor, ProjectionViewer.COLLAPSE_ALL, true); //$NON-NLS-1$
- fCollapseAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE_ALL);
- editor.setAction("FoldingCollapseAll", fCollapseAll); //$NON-NLS-1$
- }
-
- /**
- * Returns <code>true</code> if the group is enabled.
- *
- * <pre>
- * Invariant: isEnabled() &lt;=&gt; fViewer and all actions are != null.
- * </pre>
- *
- * @return <code>true</code> if the group is enabled
- */
- protected boolean isEnabled() {
- return fViewer != null;
- }
-
- /*
- * @see org.eclipse.ui.actions.ActionGroup#dispose()
- */
- public void dispose() {
- if (isEnabled()) {
- fViewer.removeProjectionListener(fProjectionListener);
- fViewer = null;
- }
- super.dispose();
- }
-
- /**
- * Updates the actions.
- */
- protected void update() {
- if (isEnabled()) {
- fToggle.update();
- fToggle.setChecked(fViewer.isProjectionMode());
- fExpand.update();
- fExpandAll.update();
- fCollapse.update();
- fCollapseAll.update();
- }
- }
-
- /**
- * Fills the menu with all folding actions.
- *
- * @param manager
- * the menu manager for the folding submenu
- */
- public void fillMenu(IMenuManager manager) {
- if (isEnabled()) {
- update();
- manager.add(fToggle);
- manager.add(fExpand);
- manager.add(fExpandAll);
- manager.add(fCollapse);
- manager.add(fCollapseAll);
- }
- }
-
- /*
- * @see org.eclipse.ui.actions.ActionGroup#updateActionBars()
- */
- public void updateActionBars() {
- update();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java
deleted file mode 100644
index 84ab1917fc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.wst.sse.ui;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- * Allows contributors to redefine a selection when provided with the current
- * selection.
- *
- */
-public interface IContentSelectionProvider {
- ISelection getSelection(TreeViewer viewer, ISelection selection);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java
deleted file mode 100644
index 40d6f8ca6e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * This interface defines preferences and consumability for semantic highlighting.
- * The preference keys provided by the implementation are stored within the preference store
- * provided by the implementation. When a region is consumable by the semantic highlighting,
- * the implementation provides an array of positions to style.
- *
- * @since 3.1
- *
- */
-public interface ISemanticHighlighting {
-
- /**
- * The preference key that controls the text's bold attribute for the semantic highlighting
- * @return the bold preference key
- */
- public String getBoldPreferenceKey();
-
- /**
- * The preference key that controls the text's underline attribute for the semantic highlighting
- * @return the underline preference key
- */
- public String getUnderlinePreferenceKey();
-
- /**
- * The preference key that controls the text's strikethrough attribute for the semantic highlighting
- * @return the strikethrough preference key
- */
- public String getStrikethroughPreferenceKey();
-
- /**
- * The preference key that controls the text's italic attribute for the semantic highlighting
- * @return the italic preference key
- */
- public String getItalicPreferenceKey();
-
- /**
- * The preference key that controls the text's color attribute for the semantic highlighting
- * @return the foreground color preference key
- */
- public String getColorPreferenceKey();
-
- /**
- * The preference store that maintains the preferences for the semantic highlighting
- * @return the preference store for the semantic highlighting
- */
- public IPreferenceStore getPreferenceStore();
-
- /**
- * The preference key that controls if the semantic highlighting is enabled
- * @return the enabled state preference key
- */
- public String getEnabledPreferenceKey();
-
- /**
- * @return the display name
- */
- public String getDisplayName();
-
- /**
- * Returns an array of positions iff the semantic highlighting consumes any part of the structured document region.
- * <p>
- * NOTE: Implementors are not allowed to keep a reference on the region or on any object
- * retrieved from the region.
- * </p>
- *
- * @param region the structured document region
- * @return an array of positions to consume iff the semantic highlighting consumes any part of the structured document region, otherwise null
- */
- public Position[] consumes(IStructuredDocumentRegion region);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java
deleted file mode 100644
index fdaef10916..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java
+++ /dev/null
@@ -1,39 +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.wst.sse.ui;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * Extends {@link org.eclipse.wst.sse.ui.ISemanticHighlighting} allowing clients to
- * define consumability with respect to indexed regions containing the structured
- * document region.
- *
- * @since 3.2
- */
-public interface ISemanticHighlightingExtension {
-
- /**
- * Returns an array of positions iff the semantic highlighting consumes any part of the structured document region
- *
- * <p>
- * NOTE: Implementors are not allowed to keep a reference on the either regions or on any object
- * retrieved from the regions.
- * </p>
- *
- * @param documentRegion the structured document region
- * @param indexedRegion the indexed region that contains the <code>documentRegion</code>
- * @return an array of positions to consume iff the semantic highlighting consumes any part of the structured document region, otherwise null
- */
- public Position[] consumes(IStructuredDocumentRegion documentRegion, IndexedRegion indexedRegion);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension2.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension2.java
deleted file mode 100644
index 4277e7e8ab..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension2.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-/**
- * This interface defines extends {@link ISemanticHighlighting} to provide a preference
- * key for background styling when not using a <code>styleString</code> associated with
- * the semantic highlighting
- *
- * @since 3.3
- *
- */
-public interface ISemanticHighlightingExtension2 {
- /**
- * The preference key that controls the text's background color attribute for the semantic highlighting
- * @return the background color preference key
- */
- String getBackgroundColorPreferenceKey();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredSourceViewerDecorationSupport.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredSourceViewerDecorationSupport.java
deleted file mode 100644
index 72486bdc4a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredSourceViewerDecorationSupport.java
+++ /dev/null
@@ -1,46 +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.wst.sse.ui;
-
-import org.eclipse.jface.text.source.AnnotationPainter;
-import org.eclipse.jface.text.source.IAnnotationAccess;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.ISharedTextColors;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-
-class StructuredSourceViewerDecorationSupport extends SourceViewerDecorationSupport {
- public StructuredSourceViewerDecorationSupport(ISourceViewer sourceViewer, IOverviewRuler overviewRuler, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors) {
- super(sourceViewer, overviewRuler, annotationAccess, sharedTextColors);
- }
-
- protected AnnotationPainter createAnnotationPainter() {
- /*
- * The new squiggly drawer depends on the presentation reconciler to
- * draw its squiggles. Unfortunately, StructuredTextEditors cannot use
- * the presentation reconciler because it conflicts with its
- * highlighter. Overriding createAnnotationPainter so that it is
- * forced to use the old squiggly painter instead of the new one. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=201928
- */
- AnnotationPainter painter = super.createAnnotationPainter();
- // dont use new squiggly painter
- painter.addTextStyleStrategy(AnnotationPreference.STYLE_SQUIGGLES, null);
- // use old one
- painter.addDrawingStrategy(AnnotationPreference.STYLE_SQUIGGLES, new AnnotationPainter.SquigglesStrategy());
- // dont use new problem underline painter
- painter.addTextStyleStrategy(AnnotationPreference.STYLE_PROBLEM_UNDERLINE, null);
- // use old one
- painter.addDrawingStrategy(AnnotationPreference.STYLE_PROBLEM_UNDERLINE, new AnnotationPainter.SquigglesStrategy());
- return painter;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
deleted file mode 100644
index e6010d5142..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
+++ /dev/null
@@ -1,3689 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.AbstractInformationControlManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IBlockTextSelection;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ISelectionValidator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.contentassist.ContentAssistEvent;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ICompletionListener;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.InformationPresenter;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.ContentAssistantFacade;
-import org.eclipse.jface.text.source.DefaultCharacterPairMatcher;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.LineChangeHover;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.source.projection.ProjectionSupport;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.VerifyKeyListener;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.ITextEditorHelpContextIds;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.ui.texteditor.DefaultRangeIndicator;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IStatusField;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-import org.eclipse.ui.texteditor.ITextEditorExtension2;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.ui.texteditor.ITextEditorExtension4;
-import org.eclipse.ui.texteditor.ITextEditorExtension5;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-import org.eclipse.ui.texteditor.TextOperationAction;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.IExecutionDelegatable;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorDropTargetAdapter;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.IModelProvider;
-import org.eclipse.wst.sse.ui.internal.IPopupMenuContributor;
-import org.eclipse.wst.sse.ui.internal.IStructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.StorageModelProvider;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.UnknownContentTypeDialog;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction;
-import org.eclipse.wst.sse.ui.internal.debug.EditBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ManageBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointsTarget;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor;
-import org.eclipse.wst.sse.ui.internal.editor.StructuredModelDocumentProvider;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.handlers.AddBlockCommentHandler;
-import org.eclipse.wst.sse.ui.internal.handlers.RemoveBlockCommentHandler;
-import org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler;
-import org.eclipse.wst.sse.ui.internal.hyperlink.OpenHyperlinkAction;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage;
-import org.eclipse.wst.sse.ui.internal.properties.ShowPropertiesAction;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NullSourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.quickoutline.QuickOutlineHandler;
-import org.eclipse.wst.sse.ui.internal.quickoutline.QuickOutlinePopupDialog;
-import org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.sse.ui.internal.text.SourceInfoProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
-import org.eclipse.wst.sse.ui.reconcile.ISourceReconcilingListener;
-import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
-
-/**
- * A Text Editor for editing structured models and structured documents.
- * <p>This class is not meant to be subclassed.</p>
- * <p>
- * New content types may associate source viewer, content outline, and
- * property sheet configurations to extend the existing functionality.
- * </p>
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- *
- * @since 1.0
- */
-
-public class StructuredTextEditor extends TextEditor {
- private class GotoMatchingBracketHandler extends AbstractHandler {
- public Object execute(ExecutionEvent arg0) throws ExecutionException {
- gotoMatchingBracket();
- return null;
- }
- }
-
- private class InternalModelStateListener implements IModelStateListener {
- public void modelAboutToBeChanged(IStructuredModel model) {
- if (getTextViewer() != null) {
- // getTextViewer().setRedraw(false);
- }
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- if (getTextViewer() != null) {
- // getTextViewer().setRedraw(false);
- getTextViewer().unconfigure();
- setStatusLineMessage(null);
- }
- }
-
- public void modelChanged(IStructuredModel model) {
- if (getSourceViewer() != null) {
- // getTextViewer().setRedraw(true);
- // Since the model can be changed on a background
- // thread, we will update menus on display thread,
- // if we are not already on display thread,
- // and if there is not an update already pending.
- // (we can get lots of 'modelChanged' events in rapid
- // succession, so only need to do one.
- if (!fUpdateMenuTextPending) {
- runOnDisplayThreadIfNeededed(new Runnable() {
- public void run() {
- updateMenuText();
- fUpdateMenuTextPending = false;
- }
- });
- }
-
- }
- }
-
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- // do nothing
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- try {
- if (getSourceViewer() != null) {
- SourceViewerConfiguration cfg = getSourceViewerConfiguration();
- getSourceViewer().configure(cfg);
- }
- }
- catch (Exception e) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=1166
- // investigate each error case post beta
- Logger.logException("problem trying to configure after model change", e); //$NON-NLS-1$
- }
- finally {
- // so we don't freeze workbench (eg. during page language or
- // content type change)
- ((ITextViewerExtension) getSourceViewer()).setRedraw(true);
-
- IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getService(IWorkbenchSiteProgressService.class);
- if (service != null) {
- service.warnOfContentChange();
- }
- }
- }
-
- // Note: this one should probably be used to
- // control viewer
- // instead of viewer having its own listener
- public void modelResourceDeleted(IStructuredModel model) {
- // do nothing
- }
-
- public void modelResourceMoved(IStructuredModel originalmodel, IStructuredModel movedmodel) {
- // do nothing
- }
-
- /**
- * This 'Runnable' should be very brief, and should not "call out" to
- * other code especially if it depends on the state of the model.
- *
- * @param r
- */
- private void runOnDisplayThreadIfNeededed(Runnable r) {
- // if there is no Display at all (that is, running headless),
- // or if we are already running on the display thread, then
- // simply execute the runnable.
- if (getDisplay() == null || (Thread.currentThread() == getDisplay().getThread())) {
- r.run();
- }
- else {
- // otherwise force the runnable to run on the display thread.
- getDisplay().asyncExec(r);
- }
- }
- }
-
- /**
- * Listens to double-click and selection from the outline page
- */
- private class OutlinePageListener implements IDoubleClickListener, ISelectionChangedListener {
- public void doubleClick(DoubleClickEvent event) {
- if (event.getSelection().isEmpty())
- return;
-
- int start = -1;
- int length = 0;
- if (event.getSelection() instanceof IStructuredSelection) {
- ISelection currentSelection = getSelectionProvider().getSelection();
- if (currentSelection instanceof IStructuredSelection) {
- Object current = ((IStructuredSelection) currentSelection).toArray();
- Object newSelection = ((IStructuredSelection) event.getSelection()).toArray();
- if (!current.equals(newSelection)) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object o = selection.getFirstElement();
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o).getStartOffset();
- length = ((IndexedRegion) o).getEndOffset() - start;
- }
- else if (o instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- length = ((ITextRegion) o).getEnd() - start;
- }
- else if (o instanceof IRegion) {
- start = ((ITextRegion) o).getStart();
- length = ((ITextRegion) o).getLength();
- }
- }
- }
- }
- else if (event.getSelection() instanceof ITextSelection) {
- start = ((ITextSelection) event.getSelection()).getOffset();
- length = ((ITextSelection) event.getSelection()).getLength();
- }
- if (start > -1) {
- getSourceViewer().setRangeIndication(start, length, false);
- selectAndReveal(start, length);
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- /*
- * Do not allow selection from other parts to affect selection in
- * the text widget if it has focus, or if we're still firing a
- * change of selection. Selection events "bouncing" off of other
- * parts are all that we can receive if we have focus (since we
- * forwarded our selection to the service just a moment ago), and
- * only the user should affect selection if we have focus.
- */
-
- /* The isFiringSelection check only works if a selection listener */
- if (event.getSelection().isEmpty() || fStructuredSelectionProvider.isFiringSelection())
- return;
-
- if (getSourceViewer() != null && getSourceViewer().getTextWidget() != null && !getSourceViewer().getTextWidget().isDisposed() && !getSourceViewer().getTextWidget().isFocusControl()) {
- int start = -1;
- int length = 0;
- if (event.getSelection() instanceof IStructuredSelection) {
- ISelection current = getSelectionProvider().getSelection();
- if (current instanceof IStructuredSelection) {
- Object[] currentSelection = ((IStructuredSelection) current).toArray();
- Object[] newSelection = ((IStructuredSelection) event.getSelection()).toArray();
- if (!Arrays.equals(currentSelection, newSelection)) {
- if (newSelection.length > 0) {
- /*
- * No ordering is guaranteed for multiple
- * selection
- */
- Object o = newSelection[0];
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o).getStartOffset();
- int end = ((IndexedRegion) o).getEndOffset();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math.min(start, ((IndexedRegion) newSelection[i]).getStartOffset());
- end = Math.max(end, ((IndexedRegion) newSelection[i]).getEndOffset());
- }
- length = end - start;
- }
- }
- else if (o instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- int end = ((ITextRegion) o).getEnd();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math.min(start, ((ITextRegion) newSelection[i]).getStart());
- end = Math.max(end, ((ITextRegion) newSelection[i]).getEnd());
- }
- length = end - start;
- }
- }
- else if (o instanceof IRegion) {
- start = ((IRegion) o).getOffset();
- int end = start + ((IRegion) o).getLength();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math.min(start, ((IRegion) newSelection[i]).getOffset());
- end = Math.max(end, ((IRegion) newSelection[i]).getOffset() + ((IRegion) newSelection[i]).getLength());
- }
- length = end - start;
- }
- }
- }
- }
- }
- }
- else if (event.getSelection() instanceof ITextSelection) {
- start = ((ITextSelection) event.getSelection()).getOffset();
- }
- if (start > -1) {
- updateRangeIndication(event.getSelection());
- selectAndReveal(start, length);
- }
- }
- }
- }
-
- private class ShowInTargetListAdapter implements IShowInTargetList {
- /**
- * Array of ID Strings that define the default show in targets for
- * this editor.
- *
- * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
- * @return the array of ID Strings that define the default show in
- * targets for this editor.
- */
- public String[] getShowInTargetIds() {
- return fShowInTargetIds;
- }
- }
-
- /**
- * A post selection provider that wraps the provider implemented in
- * AbstractTextEditor to provide a StructuredTextSelection to post
- * selection listeners. Listens to selection changes from the source
- * viewer.
- */
- private static class StructuredSelectionProvider implements IPostSelectionProvider, ISelectionValidator {
- /**
- * A "hybrid" text and structured selection class containing the text
- * selection and a list of selected model objects. The determination
- * of which model objects matches the text selection is responsibility
- * of the StructuredSelectionProvider which created this selection
- * object.
- */
- private static class StructuredTextSelection extends TextSelection implements IStructuredSelection {
- private Object[] selectedStructured;
-
- StructuredTextSelection(IDocument document, int offset, int length, Object[] selectedObjects) {
- super(document, offset, length);
- selectedStructured = selectedObjects;
- }
-
- StructuredTextSelection(IDocument document, ITextSelection selection, Object[] selectedObjects) {
- this(document, selection.getOffset(), selection.getLength(), selectedObjects);
- }
-
- public Object getFirstElement() {
- Object[] selectedStructures = getSelectedStructures();
- return selectedStructures.length > 0 ? selectedStructures[0] : null;
- }
-
- private Object[] getSelectedStructures() {
- return (selectedStructured != null) ? selectedStructured : new Object[0];
- }
-
- public boolean isEmpty() {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=191327
- return super.isEmpty() || getSelectedStructures().length == 0;
- }
-
- public Iterator iterator() {
- return toList().iterator();
- }
-
- public int size() {
- return (selectedStructured != null) ? selectedStructured.length : 0;
- }
-
- public Object[] toArray() {
- return getSelectedStructures();
- }
-
- public List toList() {
- return Arrays.asList(getSelectedStructures());
- }
-
- public String toString() {
- return getOffset() + ":" + getLength() + "@" + getSelectedStructures(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private ISelectionProvider fParentProvider = null;
- private boolean isFiringSelection = false;
- private ListenerList listeners = new ListenerList();
- private ListenerList postListeners = new ListenerList();
- private ISelection fLastSelection = null;
- private ISelectionProvider fLastSelectionProvider = null;
- private SelectionChangedEvent fLastUpdatedSelectionChangedEvent = null;
- private StructuredTextEditor fEditor;
- /*
- * Responsible for finding the selected objects within a text
- * selection. Set/reset by the StructuredTextEditor based on a
- * per-model adapter on input.
- */
- SelectionConvertor selectionConvertor = new SelectionConvertor();
-
- StructuredSelectionProvider(ISelectionProvider parentProvider, StructuredTextEditor structuredTextEditor) {
- fParentProvider = parentProvider;
- fEditor = structuredTextEditor;
- fParentProvider.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged(event);
- }
- });
- if (fParentProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) fParentProvider).addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handlePostSelectionChanged(event);
- }
- });
- }
- }
-
- public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
- postListeners.add(listener);
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.add(listener);
- }
-
- public void dispose() {
- fEditor = null;
- listeners.clear();
- postListeners.clear();
- selectionConvertor = null;
- }
-
- private void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
- Object[] listeners = listenerList.getListeners();
- isFiringSelection = true;
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- SafeRunner.run(new SafeRunnable() {
- public void run() {
- l.selectionChanged(event);
- }
- });
- }
- isFiringSelection = false;
- }
-
- private ISelectionProvider getParentProvider() {
- return fParentProvider;
- }
-
- public ISelection getSelection() {
- fLastSelection = null;
- fLastSelectionProvider = null;
- fLastUpdatedSelectionChangedEvent = null;
-
- /*
- * When a client explicitly asks for selection, provide the hybrid
- * result.
- */
- ISelection selection = getParentProvider().getSelection();
- if (!(selection instanceof IStructuredSelection) && selection instanceof ITextSelection) {
- IStructuredModel structuredModel = null;
- StructuredTextEditor localEditor = getStructuredTextEditor();
- if (localEditor != null) {
- structuredModel = localEditor.getInternalModel();
- if (structuredModel != null) {
- if (localEditor.isBlockSelectionModeEnabled()) {
- /*
- * Block selection handling - find the overlapping
- * objects on each line, keeping in mind that the
- * selected block may not overlap actual lines or
- * columns of the document.
- * IBlockTextSelection.getRegions() should handle
- * that for us...
- */
- IBlockTextSelection blockSelection = (IBlockTextSelection) selection;
- IRegion[] regions = blockSelection.getRegions();
- Set blockObjects = new LinkedHashSet();
- for (int i = 0; i < regions.length; i++) {
- Object[] objects = selectionConvertor.getElements(structuredModel, regions[i].getOffset(), regions[i].getLength());
- for (int j = 0; j < objects.length; j++) {
- blockObjects.add(objects[j]);
- }
- }
- selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, blockObjects.toArray());
- }
- else {
- int start = ((ITextSelection) selection).getOffset();
- int end = start + ((ITextSelection) selection).getLength();
- selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, selectionConvertor.getElements(structuredModel, start, end));
- }
- }
- }
- if (selection == null) {
- selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, new Object[0]);
- }
- }
-
- return selection;
- }
-
- private StructuredTextEditor getStructuredTextEditor() {
- return fEditor;
- }
-
- void handlePostSelectionChanged(SelectionChangedEvent event) {
- SelectionChangedEvent updatedEvent = null;
- if (fLastSelection == event.getSelection() && fLastSelectionProvider == event.getSelectionProvider()) {
- updatedEvent = fLastUpdatedSelectionChangedEvent;
- }
- else {
- updatedEvent = updateEvent(event);
- }
- // only update the range indicator on post selection
- StructuredTextEditor localEditor = fEditor;
-
- if (localEditor != null) {
- localEditor.updateRangeIndication(updatedEvent.getSelection());
- fireSelectionChanged(updatedEvent, postListeners);
- }
- }
-
- void handleSelectionChanged(SelectionChangedEvent event) {
- SelectionChangedEvent updatedEvent = event;
- if (fLastSelection != event.getSelection() || fLastSelectionProvider != event.getSelectionProvider()) {
- fLastSelection = event.getSelection();
- fLastSelectionProvider = event.getSelectionProvider();
- fLastUpdatedSelectionChangedEvent = updatedEvent = updateEvent(event);
- }
- fireSelectionChanged(updatedEvent, listeners);
- }
-
- IDocument getDocument() {
- return fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
- }
-
-
- boolean isFiringSelection() {
- return isFiringSelection;
- }
-
- public boolean isValid(ISelection selection) {
- // ISSUE: is not clear default behavior should be true?
- // But not clear is this default would apply for our editor.
- boolean result = true;
- // if editor is "gone", can not be valid
- StructuredTextEditor e = getStructuredTextEditor();
- if (e == null || e.fEditorDisposed) {
- result = false;
- }
- // else defer to parent
- else if (getParentProvider() instanceof ISelectionValidator) {
- result = ((ISelectionValidator) getParentProvider()).isValid(selection);
- }
- return result;
- }
-
- public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
- postListeners.remove(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.remove(listener);
- }
-
- public void setSelection(ISelection selection) {
- if (isFiringSelection()) {
- return;
- }
-
- fLastSelection = null;
- fLastSelectionProvider = null;
- fLastUpdatedSelectionChangedEvent = null;
-
- ISelection textSelection = updateSelection(selection);
- getParentProvider().setSelection(textSelection);
- StructuredTextEditor localEditor = getStructuredTextEditor();
- if (localEditor != null) {
- localEditor.updateRangeIndication(textSelection);
- }
- }
-
- /**
- * Create a corresponding event that contains a
- * StructuredTextselection
- *
- * @param event
- * @return
- */
- private SelectionChangedEvent updateEvent(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof ITextSelection && !(selection instanceof IStructuredSelection)) {
- IStructuredModel structuredModel = null;
- StructuredTextEditor localEditor = getStructuredTextEditor();
- if (localEditor != null) {
- structuredModel = localEditor.getInternalModel();
- if (structuredModel != null) {
- int start = ((ITextSelection) selection).getOffset();
- int end = start + ((ITextSelection) selection).getLength();
- selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), selectionConvertor.getElements(structuredModel, start, end));
- }
- }
- if (selection == null)
- selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), new Object[0]);
- }
- SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
- return newEvent;
- }
-
- /**
- * Create a corresponding StructuredTextselection
- *
- * @param selection
- * @return
- */
- private ISelection updateSelection(ISelection selection) {
- ISelection updated = selection;
- if (selection instanceof IStructuredSelection && !(selection instanceof ITextSelection) && !selection.isEmpty()) {
- Object[] selectedObjects = ((IStructuredSelection) selection).toArray();
- if (selectedObjects.length > 0) {
- int start = -1;
- int length = 0;
-
- // no ordering is guaranteed for multiple selection
- Object o = selectedObjects[0];
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o).getStartOffset();
- int end = ((IndexedRegion) o).getEndOffset();
- if (selectedObjects.length > 1) {
- for (int i = 1; i < selectedObjects.length; i++) {
- start = Math.min(start, ((IndexedRegion) selectedObjects[i]).getStartOffset());
- end = Math.max(end, ((IndexedRegion) selectedObjects[i]).getEndOffset());
- }
- length = end - start;
- }
- }
- else if (o instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- int end = ((ITextRegion) o).getEnd();
- if (selectedObjects.length > 1) {
- for (int i = 1; i < selectedObjects.length; i++) {
- start = Math.min(start, ((ITextRegion) selectedObjects[i]).getStart());
- end = Math.max(end, ((ITextRegion) selectedObjects[i]).getEnd());
- }
- length = end - start;
- }
- }
-
- if (start > -1) {
- updated = new StructuredTextSelection(getDocument(), start, length, selectedObjects);
- }
- }
- }
- return updated;
- }
- }
-
- class TimeOutExpired extends TimerTask {
- public void run() {
- final byte[] result = new byte[1]; // Did the busy state end successfully?
- getDisplay().syncExec(new Runnable() {
- public void run() {
- if (getDisplay() != null && !getDisplay().isDisposed())
- endBusyStateInternal(result);
- }
- });
- if (result[0] == 1) {
- fBusyTimer.cancel();
- }
- }
-
- }
-
- private class ConfigurationAndTarget {
- private String fTargetId;
- private StructuredTextViewerConfiguration fConfiguration;
-
- public ConfigurationAndTarget(String targetId, StructuredTextViewerConfiguration config) {
- fTargetId = targetId;
- fConfiguration = config;
- }
-
- public String getTargetId() {
- return fTargetId;
- }
-
- public StructuredTextViewerConfiguration getConfiguration() {
- return fConfiguration;
- }
- }
-
- private class CharacterPairListener implements VerifyKeyListener {
- private CharacterPairing[] fInserters = new CharacterPairing[0];
- private ICompletionListener fCompletionListener;
- private boolean fIsCompleting = false;
-
- public void installCompletionListener() {
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof StructuredTextViewer) {
- fCompletionListener = new ICompletionListener() {
-
- public void assistSessionStarted(ContentAssistEvent event) {
- fIsCompleting = true;
- }
-
- public void assistSessionEnded(ContentAssistEvent event) {
- fIsCompleting = false;
- }
-
- public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {
- }
-
- };
- ContentAssistantFacade facade = ((StructuredTextViewer) viewer).getContentAssistFacade();
- if (facade != null)
- facade.addCompletionListener(fCompletionListener);
- }
- }
-
- /**
- * Add the pairing to the list of inserters
- * @param pairing
- */
- void addInserter(CharacterPairing pairing) {
- List pairings = new ArrayList(Arrays.asList(fInserters));
- pairings.add(pairing);
- fInserters = (CharacterPairing[]) pairings.toArray(new CharacterPairing[pairings.size()]);
- }
-
- void prioritize() {
- Arrays.sort(fInserters);
- }
-
- /**
- * Perform cleanup on the character pair inserters
- */
- void dispose() {
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof StructuredTextViewer) {
- ContentAssistantFacade facade = ((StructuredTextViewer) viewer).getContentAssistFacade();
- if (facade != null)
- facade.removeCompletionListener(fCompletionListener);
- }
-
- for (int i = 0; i < fInserters.length; i++) {
- final AbstractCharacterPairInserter inserter = fInserters[i].inserter;
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // rely on default logging
- }
-
- public void run() throws Exception {
- inserter.dispose();
- }
- });
- }
- }
-
- public void verifyKey(final VerifyEvent event) {
- if (!event.doit || getInsertMode() != SMART_INSERT || fIsCompleting || isBlockSelectionModeEnabled() && isMultilineSelection())
- return;
- final boolean[] paired = { false };
- for (int i = 0; i < fInserters.length; i++) {
- final CharacterPairing pairing = fInserters[i];
- // use a SafeRunner -- this is a critical function (typing)
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- final AbstractCharacterPairInserter inserter = pairing.inserter;
- if (inserter.hasPair(event.character)) {
- if (pair(event, inserter, pairing.partitions))
- paired[0] = true;
- }
- }
-
- public void handleException(Throwable exception) {
- // rely on default logging
- }
- });
- if (paired[0])
- return;
- }
- }
-
- private boolean pair(VerifyEvent event, AbstractCharacterPairInserter inserter, Set partitions) {
- final ISourceViewer viewer = getSourceViewer();
- final IDocument document = getSourceViewer().getDocument();
- if (document != null) {
- try {
- final Point selection = viewer.getSelectedRange();
- final int offset = selection.x;
- final ITypedRegion partition = document.getPartition(offset);
- if (partitions.contains(partition.getType())) {
- // Don't modify if the editor input cannot be changed
- if (!validateEditorInputState())
- return false;
- event.doit = !inserter.pair(viewer, event.character);
- return true;
- }
- } catch (BadLocationException e) {
- }
- }
- return false;
- }
-
- private boolean isMultilineSelection() {
- ISelection selection = getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection) {
- ITextSelection ts = (ITextSelection) selection;
- return ts.getStartLine() != ts.getEndLine();
- }
- return false;
- }
- }
-
- /**
- * Representation of a character pairing that includes its priority based on
- * its content type and how close it is to the content type of the file
- * in the editor.
- */
- private class CharacterPairing implements Comparable {
- int priority;
- AbstractCharacterPairInserter inserter;
- Set partitions;
- public int compareTo(Object o) {
- if (o == this)
- return 0;
- return this.priority - ((CharacterPairing) o).priority;
- }
- }
-
- private class PartListener implements IPartListener {
-
- private ITextEditor fEditor;
-
- public PartListener(ITextEditor editor) {
- fEditor = editor;
- }
-
- public void partActivated(IWorkbenchPart part) {
- if (part.getAdapter(ITextEditor.class) == fEditor) {
- IReconciler reconciler = getSourceViewerConfiguration().getReconciler(getSourceViewer());
- if (reconciler instanceof DocumentRegionProcessor) {
- ((DocumentRegionProcessor) reconciler).forceReconciling();
- }
- }
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
- }
-
- public void partClosed(IWorkbenchPart part) {
- }
-
- public void partDeactivated(IWorkbenchPart part) {
- }
-
- public void partOpened(IWorkbenchPart part) {
- }
-
- }
-
- /**
- * Not API. May be removed in the future.
- */
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
- private static final long BUSY_STATE_DELAY = 1000;
- /**
- * Not API. May be removed in the future.
- */
- protected static final String DOT = "."; //$NON-NLS-1$
- private static final String EDITOR_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.EditorContext"; //$NON-NLS-1$
- private static final String EDITOR_CONTEXT_MENU_SUFFIX = ".source.EditorContext"; //$NON-NLS-1$
-
- /** Non-NLS strings */
- private static final String EDITOR_KEYBINDING_SCOPE_ID = "org.eclipse.wst.sse.ui.structuredTextEditorScope"; //$NON-NLS-1$
- /**
- * Not API. May be removed in the future.
- */
- public static final String GROUP_NAME_ADDITIONS = IWorkbenchActionConstants.MB_ADDITIONS; //$NON-NLS-1$
-
- private static final String REDO_ACTION_DESC = SSEUIMessages.Redo___0___UI_; //$NON-NLS-1$ = "Redo: {0}."
- private static final String REDO_ACTION_DESC_DEFAULT = SSEUIMessages.Redo_Text_Change__UI_; //$NON-NLS-1$ = "Redo Text Change."
- private static final String REDO_ACTION_TEXT = SSEUIMessages._Redo__0___Ctrl_Y_UI_; //$NON-NLS-1$ = "&Redo {0} @Ctrl+Y"
- private static final String REDO_ACTION_TEXT_DEFAULT = SSEUIMessages._Redo_Text_Change__Ctrl_Y_UI_; //$NON-NLS-1$ = "&Redo Text Change @Ctrl+Y"
- private static final String RULER_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.RulerContext"; //$NON-NLS-1$
- private static final String RULER_CONTEXT_MENU_SUFFIX = ".source.RulerContext"; //$NON-NLS-1$
-
- private final static String UNDERSCORE = "_"; //$NON-NLS-1$
- /** Translatable strings */
- private static final String UNDO_ACTION_DESC = SSEUIMessages.Undo___0___UI_; //$NON-NLS-1$ = "Undo: {0}."
-
- private static final String UNDO_ACTION_DESC_DEFAULT = SSEUIMessages.Undo_Text_Change__UI_; //$NON-NLS-1$ = "Undo Text Change."
- private static final String UNDO_ACTION_TEXT = SSEUIMessages._Undo__0___Ctrl_Z_UI_; //$NON-NLS-1$ = "&Undo {0} @Ctrl+Z"
- private static final String UNDO_ACTION_TEXT_DEFAULT = SSEUIMessages._Undo_Text_Change__Ctrl_Z_UI_; //$NON-NLS-1$ = "&Undo Text Change @Ctrl+Z"
- // development time/debug variables only
- private int adapterRequests;
-
- private long adapterTime;
- private boolean fBackgroundJobEnded;
- private boolean fBusyState;
- private Timer fBusyTimer;
- boolean fDirtyBeforeDocumentEvent = false;
- int validateEditCount = 0;
- private ExtendedEditorDropTargetAdapter fDropAdapter;
- private DropTarget fDropTarget;
- boolean fEditorDisposed = false;
- private IEditorPart fEditorPart;
- private InternalModelStateListener fInternalModelStateListener;
- private IContentOutlinePage fOutlinePage;
-
- private OutlinePageListener fOutlinePageListener = null;
- /** This editor's projection support */
- private ProjectionSupport fProjectionSupport;
- private IPropertySheetPage fPropertySheetPage;
-
- private ISourceReconcilingListener[] fReconcilingListeners = new ISourceReconcilingListener[0];
- private IPartListener fPartListener;
-
- /** The ruler context menu to be disposed. */
- private Menu fRulerContextMenu;
- /** The ruler context menu manager to be disposed. */
- private MenuManager fRulerContextMenuManager;
-
- String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV, IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_OUTLINE};
-
- private IAction fShowPropertiesAction = null;
- private IStructuredModel fStructuredModel;
- StructuredSelectionProvider fStructuredSelectionProvider = null;
- /** The text context menu to be disposed. */
- private Menu fTextContextMenu;
- /** The text context menu manager to be disposed. */
- private MenuManager fTextContextMenuManager;
- private String fViewerConfigurationTargetId;
- /** The selection history of the editor */
- private SelectionHistory fSelectionHistory;
- /** The information presenter. */
- private InformationPresenter fInformationPresenter;
- private boolean fUpdateMenuTextPending;
- /** The quick outline handler */
- private QuickOutlineHandler fOutlineHandler;
-
- private boolean shouldClose = false;
- private long startPerfTime;
- private boolean fisReleased;
- /**
- * The action group for folding.
- */
- private FoldingActionGroup fFoldingGroup;
-
- private ILabelProvider fStatusLineLabelProvider;
-
- private SemanticHighlightingManager fSemanticManager;
-
- private boolean fSelectionChangedFromGoto = false;
-
- private final CharacterPairListener fPairInserter = new CharacterPairListener();
-
- /**
- * Creates a new Structured Text Editor.
- */
- public StructuredTextEditor() {
- super();
- initializeDocumentProvider(null);
- }
-
- private IStructuredModel aboutToSaveModel() {
- IStructuredModel model = getInternalModel();
- if (model != null) {
- model.aboutToChangeModel();
- }
- return model;
- }
-
- protected void addSourceMenuActions(IMenuManager menu) {
- IMenuManager subMenu= new MenuManager(SSEUIMessages.SourceMenu_label, IStructuredTextEditorActionConstants.SOURCE_CONTEXT_MENU_ID);
- subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_BEGIN));
- subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_ADDITIONS));
- subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_END));
- menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, subMenu);
- }
-
- protected void addRefactorMenuActions(IMenuManager menu) {
- IMenuManager subMenu = new MenuManager(SSEUIMessages.RefactorMenu_label, IStructuredTextEditorActionConstants.REFACTOR_CONTEXT_MENU_ID);
- menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, subMenu);
- }
-
- protected void addContextMenuActions(IMenuManager menu) {
- // Only offer actions that affect the text if the viewer allows
- // modification and supports any of these operations
-
- // Some Design editors (DTD) rely on this view for their own uses
- menu.appendToGroup(IWorkbenchActionConstants.GROUP_ADD, fShowPropertiesAction);
- }
-
- private void addExtendedContextMenuActions(IMenuManager menu) {
- IEditorActionBarContributor c = getEditorSite().getActionBarContributor();
- if (c instanceof IPopupMenuContributor) {
- ((IPopupMenuContributor) c).contributeToPopupMenu(menu);
- }
- else {
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- IExtendedContributor pmc = builder.readActionExtensions(getConfigurationPoints());
- if (pmc != null) {
- pmc.setActiveEditor(this);
- pmc.contributeToPopupMenu(menu);
- }
- }
- }
-
- protected void addExtendedRulerContextMenuActions(IMenuManager menu) {
- // none at this level
- }
-
-
-
- /**
- * Starts background mode.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- */
- void beginBackgroundOperation() {
- fBackgroundJobEnded = false;
- // if already in busy state, no need to do anything
- // and, we only start, or reset, the timed busy
- // state when we get the "endBackgroundOperation" call.
- if (!inBusyState()) {
- beginBusyStateInternal();
- }
- }
-
- private void beginBusyStateInternal() {
-
- fBusyState = true;
- startBusyTimer();
-
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof StructuredTextViewer) {
- ((StructuredTextViewer) viewer).beginBackgroundUpdate();
-
- }
- showBusy(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.ITextEditor#close(boolean)
- */
- public void close(final boolean save) {
- /*
- * Instead of us closing directly, we have to close with our
- * containing (multipage) editor, if it exists.
- */
- if (getSite() == null) {
- // if site hasn't been set yet, then we're not
- // completely open
- // so set a flag not to open
- shouldClose = true;
- }
- else {
- if (getEditorPart() != null) {
- Display display = getSite().getShell().getDisplay();
- display.asyncExec(new Runnable() {
-
- public void run() {
- getSite().getPage().closeEditor(getEditorPart(), save);
- }
- });
- }
- else {
- super.close(save);
- }
- }
- }
-
- private void activateContexts(IContextService service) {
- if(service == null)
- return;
-
- String[] definitions = getDefinitions(getConfigurationPoints());
-
- if(definitions != null) {
- String[] contexts = null;
- for(int i = 0; i < definitions.length; i++) {
- contexts = StringUtils.unpack(definitions[i]);
- for(int j = 0; j < contexts.length; j++)
- service.activateContext(contexts[j].trim());
- }
- }
-
- }
-
- private String[] getDefinitions(String[] ids) {
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] definitions = null;
-
- /* Iterate through the configuration ids until one is found that has
- * an activecontexts definition
- */
- for(int i = 0; i < ids.length; i++) {
- definitions = builder.getDefinitions("activecontexts", ids[i]); //$NON-NLS-1$
- if(definitions != null && definitions.length > 0)
- return definitions;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
- */
- protected String[] collectContextMenuPreferencePages() {
- List allIds = new ArrayList(0);
-
- // get contributed preference pages
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] configurationIds = getConfigurationPoints();
- for (int i = 0; i < configurationIds.length; i++) {
- String[] definitions = builder.getDefinitions("preferencepages", configurationIds[i]); //$NON-NLS-1$
- for (int j = 0; j < definitions.length; j++) {
- String someIds = definitions[j];
- if (someIds != null && someIds.length() > 0) {
- // supports multiple comma-delimited page IDs in one
- // element
- String[] ids = StringUtils.unpack(someIds);
- for (int k = 0; k < ids.length; k++) {
- // trim, just to keep things clean
- String id = ids[k].trim();
- if (!allIds.contains(id)) {
- allIds.add(id);
- }
- }
- }
- }
- }
-
- // add pages contributed by super
- String[] superPages = super.collectContextMenuPreferencePages();
- for (int m = 0; m < superPages.length; m++) {
- // trim, just to keep things clean
- String id = superPages[m].trim();
- if (!allIds.contains(id)) {
- allIds.add(id);
- }
- }
-
- return (String[]) allIds.toArray(new String[0]);
- }
-
- /**
- * Compute and set double-click action for the vertical ruler
- */
- private void computeAndSetDoubleClickAction() {
- /*
- * Make double-clicking on the ruler toggle a breakpoint instead of
- * toggling a bookmark. For lines where a breakpoint won't be created,
- * create a bookmark through the contributed RulerDoubleClick action.
- */
- setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, new ToggleBreakpointAction(this, getVerticalRuler(), getAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK)));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.ExtendedTextEditor#configureSourceViewerDecorationSupport(org.eclipse.ui.texteditor.SourceViewerDecorationSupport)
- */
- protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
- support.setCharacterPairMatcher(createCharacterPairMatcher());
- support.setMatchingCharacterPainterPreferenceKeys(EditorPreferenceNames.MATCHING_BRACKETS, EditorPreferenceNames.MATCHING_BRACKETS_COLOR);
-
- super.configureSourceViewerDecorationSupport(support);
- }
-
- protected void createActions() {
- super.createActions();
- ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle();
- IWorkbenchHelpSystem helpSystem = SSEUIPlugin.getDefault().getWorkbench().getHelpSystem();
- // TextView Action - moving the selected text to
- // the clipboard
- // override the cut/paste/delete action to make
- // them run on read-only
- // files
- Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT); //$NON-NLS-1$
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
- setAction(ITextEditorActionConstants.CUT, action);
- helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.CUT_ACTION);
- // TextView Action - inserting the clipboard
- // content at the current
- // position
- // override the cut/paste/delete action to make
- // them run on read-only
- // files
- action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE); //$NON-NLS-1$
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
- setAction(ITextEditorActionConstants.PASTE, action);
- helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.PASTE_ACTION);
- // TextView Action - deleting the selected text or
- // if selection is
- // empty the character at the right of the current
- // position
- // override the cut/paste/delete action to make
- // them run on read-only
- // files
- action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE); //$NON-NLS-1$
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
- setAction(ITextEditorActionConstants.DELETE, action);
- helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.DELETE_ACTION);
- // SourceView Action - requesting content assist to
- // show completetion
- // proposals for the current insert position
- action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS);
- helpSystem.setHelp(action, IHelpContextIds.CONTMNU_CONTENTASSIST_HELPID);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, action);
- markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, true);
- // SourceView Action - requesting content assist to
- // show the content
- // information for the current insert position
- action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, action);
- markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, true);
- // StructuredTextViewer Action - requesting format
- // of the whole
- // document
- action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT + UNDERSCORE, this, StructuredTextViewer.FORMAT_DOCUMENT);
- helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_DOC_HELPID);
- action.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, action);
- markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
- markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
- // StructuredTextViewer Action - requesting format
- // of the active
- // elements
- action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS + UNDERSCORE, this, StructuredTextViewer.FORMAT_ACTIVE_ELEMENTS);
- helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_ELEMENTS_HELPID);
- action.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, action);
- markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
- markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
-
- // StructuredTextEditor Action - add breakpoints (falling back to the
- // current double-click if they can't be added)
- action = new ToggleBreakpointAction(this, getVerticalRuler());
- setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
- // StructuredTextEditor Action - manage breakpoints
- action = new ManageBreakpointAction(this, getVerticalRuler());
- setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
- // StructuredTextEditor Action - edit breakpoints
- action = new EditBreakpointAction(this, getVerticalRuler());
- setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
- // StructuredTextViewer Action - open file on selection
- action = new OpenHyperlinkAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE + UNDERSCORE, this, getSourceViewer());
- action.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);
-
- computeAndSetDoubleClickAction();
-
- //add handlers to handler service
- IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
- if (handlerService != null) {
-
- IHandler gotoHandler = new GotoMatchingBracketHandler();
- handlerService.activateHandler(ActionDefinitionIds.GOTO_MATCHING_BRACKET, gotoHandler);
-
- fOutlineHandler = new QuickOutlineHandler();
- handlerService.activateHandler(ActionDefinitionIds.SHOW_OUTLINE, fOutlineHandler);
-
- IHandler toggleCommentHandler = new ToggleLineCommentHandler();
- handlerService.activateHandler(ActionDefinitionIds.TOGGLE_COMMENT, toggleCommentHandler);
-
- IHandler addCommentBlockHandler = new AddBlockCommentHandler();
- handlerService.activateHandler(ActionDefinitionIds.ADD_BLOCK_COMMENT, addCommentBlockHandler);
-
- IHandler removeCommentBlockHandler = new RemoveBlockCommentHandler();
- handlerService.activateHandler(ActionDefinitionIds.REMOVE_BLOCK_COMMENT, removeCommentBlockHandler);
- }
-
- fShowPropertiesAction = new ShowPropertiesAction(getEditorPart(), getSelectionProvider());
- fFoldingGroup = new FoldingActionGroup(this, getSourceViewer());
- }
-
- protected LineChangeHover createChangeHover() {
- return super.createChangeHover(); //new StructuredLineChangeHover();
- }
-
- protected ICharacterPairMatcher createCharacterPairMatcher() {
- ICharacterPairMatcher matcher = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; matcher == null && i < ids.length; i++) {
- matcher = (ICharacterPairMatcher) builder.getConfiguration(DocumentRegionEdgeMatcher.ID, ids[i]);
- }
- if (matcher == null) {
- matcher = new DefaultCharacterPairMatcher(new char[]{'(', ')', '{', '}', '[', ']', '<', '>', '"', '"', '\'', '\''});
- }
- return matcher;
- }
-
- /**
- * Create a preference store that combines the source editor preferences
- * with the base editor's preferences.
- *
- * @return IPreferenceStore
- */
- private IPreferenceStore createCombinedPreferenceStore() {
- IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
- IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
- return new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
- }
-
- private ContentOutlineConfiguration createContentOutlineConfiguration() {
- ContentOutlineConfiguration cfg = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; cfg == null && i < ids.length; i++) {
- cfg = (ContentOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.CONTENTOUTLINECONFIGURATION, ids[i]);
- }
- return cfg;
- }
-
- protected void createModelDependentFields() {
- if (fStructuredSelectionProvider != null) {
- SelectionConvertor convertor = (SelectionConvertor) fStructuredModel.getAdapter(SelectionConvertor.class);
- if (convertor != null)
- fStructuredSelectionProvider.selectionConvertor = convertor;
- else
- fStructuredSelectionProvider.selectionConvertor = new SelectionConvertor();
- }
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * Use StructuredTextViewerConfiguration if a viewerconfiguration has not
- * already been set. Also initialize StructuredTextViewer.
- * </p>
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- IContextService contextService = (IContextService) getSite().getService(IContextService.class);
- if (contextService != null)
- contextService.activateContext(EDITOR_KEYBINDING_SCOPE_ID);
-
- if (getSourceViewerConfiguration() == null) {
- ConfigurationAndTarget cat = createSourceViewerConfiguration();
- fViewerConfigurationTargetId = cat.getTargetId();
- StructuredTextViewerConfiguration newViewerConfiguration = cat.getConfiguration();
- setSourceViewerConfiguration(newViewerConfiguration);
- }
-
- super.createPartControl(parent);
-
- // instead of calling setInput twice, use initializeSourceViewer() to
- // handle source viewer initialization previously handled by setInput
- initializeSourceViewer();
-
- // update editor context menu, vertical ruler context menu, infopop
- if (getInternalModel() != null) {
- updateEditorControlsForContentType(getInternalModel().getContentTypeIdentifier());
- }
- else {
- updateEditorControlsForContentType(null);
- }
-
- // used for Show Tooltip Description
- IInformationControlCreator informationControlCreator = new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell shell) {
- boolean cutDown = false;
- int style = cutDown ? SWT.NONE : (SWT.V_SCROLL | SWT.H_SCROLL);
- return new DefaultInformationControl(shell, SWT.RESIZE | SWT.TOOL, style, new HTMLTextPresenter(cutDown));
- }
- };
-
- fInformationPresenter = new InformationPresenter(informationControlCreator);
- fInformationPresenter.setSizeConstraints(60, 10, true, true);
- fInformationPresenter.install(getSourceViewer());
- addReconcilingListeners(getSourceViewerConfiguration(), getTextViewer());
- fPartListener = new PartListener(this);
- getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener);
- installSemanticHighlighting();
- if (fOutlineHandler != null) {
- IInformationPresenter presenter = configureOutlinePresenter(getSourceViewer(), getSourceViewerConfiguration());
- if (presenter != null) {
- presenter.install(getSourceViewer());
- fOutlineHandler.configure(presenter);
- }
- }
- installCharacterPairing();
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof ITextViewerExtension) {
- ((ITextViewerExtension) viewer).appendVerifyKeyListener(fPairInserter);
- fPairInserter.installCompletionListener();
- }
-
- if (Platform.getProduct() != null) {
- String viewID = Platform.getProduct().getProperty("idPerspectiveHierarchyView"); //$NON-NLS-1$);
- if (viewID != null) {
- // make sure the specified view ID is known
- if (PlatformUI.getWorkbench().getViewRegistry().find(viewID) != null) {
- fShowInTargetIds = new String[]{viewID, IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_RES_NAV, IPageLayout.ID_OUTLINE};
- }
- }
- }
- }
-
- protected PropertySheetConfiguration createPropertySheetConfiguration() {
- PropertySheetConfiguration cfg = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; cfg == null && i < ids.length; i++) {
- cfg = (PropertySheetConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.PROPERTYSHEETCONFIGURATION, ids[i]);
- }
- return cfg;
- }
-
- /**
- * Loads the Show In Target IDs from the Extended Configuration extension
- * point.
- *
- * @return
- */
- private String[] createShowInTargetIds() {
- List allIds = new ArrayList(0);
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] configurationIds = getConfigurationPoints();
- for (int i = 0; i < configurationIds.length; i++) {
- String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]); //$NON-NLS-1$
- for (int j = 0; j < definitions.length; j++) {
- String someIds = definitions[j];
- if (someIds != null && someIds.length() > 0) {
- String[] ids = StringUtils.unpack(someIds);
- for (int k = 0; k < ids.length; k++) {
- // trim, just to keep things clean
- String id = ids[k].trim();
- if (!allIds.contains(id)) {
- allIds.add(id);
- }
- }
- }
- }
- }
-
- if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
- allIds.add(IPageLayout.ID_RES_NAV);
- }
- if (!allIds.contains(IPageLayout.ID_PROJECT_EXPLORER)) {
- allIds.add(IPageLayout.ID_PROJECT_EXPLORER);
- }
- if (!allIds.contains(IPageLayout.ID_OUTLINE)) {
- allIds.add(IPageLayout.ID_OUTLINE);
- }
- return (String[]) allIds.toArray(new String[0]);
- }
-
- /**
- * @return
- */
- private ISourceEditingTextTools createSourceEditingTextTools() {
- ISourceEditingTextTools tools = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; tools == null && i < ids.length; i++) {
- tools = (ISourceEditingTextTools) builder.getConfiguration(NullSourceEditingTextTools.ID, ids[i]);
- }
- if (tools == null) {
- tools = NullSourceEditingTextTools.getInstance();
- ((NullSourceEditingTextTools) tools).setTextEditor(this);
- }
- Method method = null; //$NON-NLS-1$
- try {
- method = tools.getClass().getMethod("setTextEditor", new Class[]{StructuredTextEditor.class}); //$NON-NLS-1$
- }
- catch (NoSuchMethodException e) {
- }
- if (method == null) {
- try {
- method = tools.getClass().getMethod("setTextEditor", new Class[]{ITextEditor.class}); //$NON-NLS-1$
- }
- catch (NoSuchMethodException e) {
- }
- }
- if (method == null) {
- try {
- method = tools.getClass().getMethod("setTextEditor", new Class[]{IEditorPart.class}); //$NON-NLS-1$
- }
- catch (NoSuchMethodException e) {
- }
- }
- if (method != null) {
- if (!method.isAccessible()) {
- method.setAccessible(true);
- }
- try {
- method.invoke(tools, new Object[]{this});
- }
- catch (Exception e) {
- Logger.logException("Problem creating ISourceEditingTextTools implementation", e); //$NON-NLS-1$
- }
- }
-
- return tools;
- }
-
- /**
- * Creates the source viewer to be used by this editor
- */
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
- fAnnotationAccess = createAnnotationAccess();
- fOverviewRuler = createOverviewRuler(getSharedColors());
- StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles);
- initSourceViewer(sourceViewer);
- return sourceViewer;
- }
-
- private ConfigurationAndTarget createSourceViewerConfiguration() {
- ConfigurationAndTarget cat = null;
- StructuredTextViewerConfiguration cfg = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; cfg == null && i < ids.length; i++) {
- cfg = (StructuredTextViewerConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.SOURCEVIEWERCONFIGURATION, ids[i]);
- cat = new ConfigurationAndTarget(ids[i], cfg);
- }
- if (cfg == null) {
- cfg = new StructuredTextViewerConfiguration();
- String targetid = getClass().getName() + "#default"; //$NON-NLS-1$
- cat = new ConfigurationAndTarget(targetid, cfg);
- }
- return cat;
- }
-
- protected StructuredTextViewer createStructedTextViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
- return new StructuredTextViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles);
- }
-
- protected void createUndoRedoActions() {
- // overridden to add icons to actions
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=111877
- super.createUndoRedoActions();
- IAction action = getAction(ITextEditorActionConstants.UNDO);
- if (action != null) {
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- }
-
- action = getAction(ITextEditorActionConstants.REDO);
- if (action != null) {
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- Logger.trace("Source Editor", "StructuredTextEditor::dispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
- if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
- System.out.println("Total calls to getAdapter: " + adapterRequests); //$NON-NLS-1$
- System.out.println("Total time in getAdapter: " + adapterTime); //$NON-NLS-1$
- System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
- }
-
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof ITextViewerExtension)
- ((ITextViewerExtension) viewer).removeVerifyKeyListener(fPairInserter);
-
- // dispose of information presenter
- if (fInformationPresenter != null) {
- fInformationPresenter.dispose();
- fInformationPresenter = null;
- }
-
- if (fOutlineHandler != null) {
- fOutlineHandler.dispose();
- }
- // dispose of selection history
- if (fSelectionHistory != null) {
- fSelectionHistory.dispose();
- fSelectionHistory = null;
- }
-
- if (fProjectionSupport != null) {
- fProjectionSupport.dispose();
- fProjectionSupport = null;
- }
-
- if (fFoldingGroup != null) {
- fFoldingGroup.dispose();
- fFoldingGroup = null;
- }
-
- // dispose of menus that were being tracked
- if (fTextContextMenu != null) {
- fTextContextMenu.dispose();
- }
- if (fRulerContextMenu != null) {
- fRulerContextMenu.dispose();
- }
- if (fTextContextMenuManager != null) {
- fTextContextMenuManager.removeMenuListener(getContextMenuListener());
- fTextContextMenuManager.removeAll();
- fTextContextMenuManager.dispose();
- }
- if (fRulerContextMenuManager != null) {
- fRulerContextMenuManager.removeMenuListener(getContextMenuListener());
- fRulerContextMenuManager.removeAll();
- fRulerContextMenuManager.dispose();
- }
-
- // added this 2/20/2004 based on probe results --
- // seems should be handled by setModel(null), but
- // that's a more radical change.
- // and, technically speaking, should not be needed,
- // but makes a memory leak
- // less severe.
- if (fStructuredModel != null) {
- fStructuredModel.removeModelStateListener(getInternalModelStateListener());
- }
-
- // BUG155335 - if there was no document provider, there was nothing
- // added
- // to document, so nothing to remove
- if (getDocumentProvider() != null) {
- IDocument doc = getDocumentProvider().getDocument(getEditorInput());
- if (doc != null) {
- if (doc instanceof IExecutionDelegatable) {
- ((IExecutionDelegatable) doc).setExecutionDelegate(null);
- }
- }
- }
-
- // some things in the configuration need to clean
- // up after themselves
- if (fOutlinePage != null) {
- if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlinePageListener != null) {
- ((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlinePageListener);
- }
- if (fOutlinePageListener != null) {
- fOutlinePage.removeSelectionChangedListener(fOutlinePageListener);
- }
- }
-
- fEditorDisposed = true;
- disposeModelDependentFields();
-
- if (fDropTarget != null)
- fDropTarget.dispose();
-
- if (fPartListener != null) {
- getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener);
- fPartListener = null;
- }
-
- uninstallSemanticHighlighting();
-
- if (fPairInserter != null)
- fPairInserter.dispose();
-
-
- setPreferenceStore(null);
-
- /*
- * Strictly speaking, but following null outs should not be needed,
- * but in the event of a memory leak, they make the memory leak less
- * severe
- */
- fDropAdapter = null;
- fDropTarget = null;
-
- if (fStructuredSelectionProvider != null) {
- fStructuredSelectionProvider.dispose();
- }
-
- setStatusLineMessage(null);
-
- super.dispose();
-
- Logger.trace("Source Editor", "StructuredTextEditor::dispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#disposeDocumentProvider()
- */
- protected void disposeDocumentProvider() {
- if (fStructuredModel != null && !fisReleased && !(getDocumentProvider() instanceof IModelProvider)) {
- fStructuredModel.releaseFromEdit();
- fisReleased = true;
- }
- super.disposeDocumentProvider();
- }
-
- /**
- * Disposes model specific editor helpers such as statusLineHelper.
- * Basically any code repeated in update() & dispose() should be placed
- * here.
- */
- private void disposeModelDependentFields() {
- if(fStructuredSelectionProvider != null)
- fStructuredSelectionProvider.selectionConvertor = new SelectionConvertor();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.ITextEditor#doRevertToSaved()
- */
- public void doRevertToSaved() {
- super.doRevertToSaved();
- if (fOutlinePage != null && fOutlinePage instanceof IUpdate) {
- ((IUpdate) fOutlinePage).update();
- }
- // reset undo
- IDocument doc = getDocumentProvider().getDocument(getEditorInput());
- if (doc instanceof IStructuredDocument) {
- ((IStructuredDocument) doc).getUndoManager().getCommandStack().flush();
- }
-
- // update menu text
- updateMenuText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor progressMonitor) {
- IStructuredModel model = null;
- try {
- model = aboutToSaveModel();
- updateEncodingMemento();
- super.doSave(progressMonitor);
- }
- finally {
- savedModel(model);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
- */
- protected void doSetInput(IEditorInput input) throws CoreException {
- IEditorInput oldInput = getEditorInput();
- if (oldInput != null) {
- IDocument olddoc = getDocumentProvider().getDocument(oldInput);
- if (olddoc != null && olddoc instanceof IExecutionDelegatable) {
- ((IExecutionDelegatable) olddoc).setExecutionDelegate(null);
- }
- }
-
- if (fStructuredModel != null && !(getDocumentProvider() instanceof IModelProvider)) {
- fStructuredModel.releaseFromEdit();
- }
-
- //attempt to get the model for the given input
- super.doSetInput(input);
- IStructuredModel model = tryToGetModel(input);
-
- /* if could not get the model prompt user to update content type
- * if preferences allow, then try to get model again
- */
- if(model == null && SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) {
- // display a dialog informing user of unknown content type giving them chance to update preferences
- UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG);
- dialog.open();
-
- //try to get model again in hopes user updated preferences
- super.doSetInput(input);
- model = tryToGetModel(input);
-
- //still could not get the model to open this editor so log
- if(model == null) {
- logUnexpectedDocumentKind(input);
- }
- }
-
- if (fStructuredModel != null || model != null) {
- setModel(model);
- }
-
- if (getInternalModel() != null) {
- updateEditorControlsForContentType(getInternalModel().getContentTypeIdentifier());
- }
- else {
- updateEditorControlsForContentType(null);
- }
-
- // start editor with smart insert mode
- setInsertMode(SMART_INSERT);
- }
-
- /**
- * <p>Attempts to get the {@link IStructuredModel} for the given {@link IEditorInput}</p>
- *
- * @param input the {@link IEditorInput} to try and get the {@link IStructuredModel} for
- *
- * @return The {@link IStructuredModel} associated with the given {@link IEditorInput} or
- * <code>null</code> if no associated {@link IStructuredModel} could be found.
- */
- private IStructuredModel tryToGetModel(IEditorInput input) {
- IStructuredModel model = null;
-
- IDocument newDocument = getDocumentProvider().getDocument(input);
- if (newDocument instanceof IExecutionDelegatable) {
- ((IExecutionDelegatable) newDocument).setExecutionDelegate(new EditorExecutionContext(this));
- }
-
- // if we have a Model provider, get the model from it
- if (getDocumentProvider() instanceof IModelProvider) {
- model = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
- if (!model.isShared()) {
- EditorModelUtil.addFactoriesTo(model);
- }
- }
- else if (newDocument instanceof IStructuredDocument) {
- // corresponding releaseFromEdit occurs in dispose()
- model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) newDocument);
- EditorModelUtil.addFactoriesTo(model);
- }
-
- return model;
- }
-
- /**
- * Sets up this editor's context menu before it is made visible.
- * <p>
- * Not API. May be reduced to protected method in the future.
- * </p>
- *
- * @param menu
- * the menu
- */
- public void editorContextMenuAboutToShow(IMenuManager menu) {
- /*
- * To be consistent with the Java Editor, we want to remove ShiftRight
- * and ShiftLeft from the context menu.
- */
- super.editorContextMenuAboutToShow(menu);
- menu.remove(ITextEditorActionConstants.SHIFT_LEFT);
- menu.remove(ITextEditorActionConstants.SHIFT_RIGHT);
-
- addContextMenuActions(menu);
- addSourceMenuActions(menu);
- addRefactorMenuActions(menu);
- addExtendedContextMenuActions(menu);
- }
-
- /**
- * End background mode.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- */
- void endBackgroundOperation() {
- fBackgroundJobEnded = true;
- // note, we don't immediately end our 'internal busy' state,
- // since we may get many calls in a short period of
- // time. We always wait for the time out.
- resetBusyState();
- }
-
- /**
- * Note this method can be called indirectly from background job operation
- * ... but expected to be gaurded there with ILock, plus, can be called
- * directly from timer thread, so the timer's run method guards with ILock
- * too.
- *
- * Set result[0] to 1 if the busy state was ended successfully
- */
- private void endBusyStateInternal(byte[] result) {
- if (fBackgroundJobEnded) {
- result[0] = 1;
- showBusy(false);
-
- ISourceViewer viewer = getSourceViewer();
- if (viewer instanceof StructuredTextViewer) {
- ((StructuredTextViewer) viewer).endBackgroundUpdate();
- }
- fBusyState = false;
- }
- else {
- // we will only be in this branch for a back ground job that is
- // taking
- // longer than our normal time-out period (meaning we got notified
- // of
- // the timeout "inbetween" calls to 'begin' and
- // 'endBackgroundOperation'.
- // (which, remember, can only happen since there are many calls to
- // begin/end in a short period of time, and we only "reset" on the
- // 'ends').
- // In this event, there's really nothing to do, we're still in
- // "busy state"
- // and should start a new reset cycle once endBackgroundjob is
- // called.
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
- startPerfTime = System.currentTimeMillis();
- }
- Object result = null;
- // text editor
- IStructuredModel internalModel = getInternalModel();
- if (ITextEditor.class.equals(required) || ITextEditorExtension5.class.equals(required) || ITextEditorExtension4.class.equals(required) || ITextEditorExtension3.class.equals(required) || ITextEditorExtension2.class.equals(required) || ITextEditorExtension.class.equals(required)) {
- result = this;
- }
- else if (IWorkbenchSiteProgressService.class.equals(required)) {
- return getEditorPart().getSite().getAdapter(IWorkbenchSiteProgressService.class);
- }
- // content outline page
- else if (IContentOutlinePage.class.equals(required)) {
- if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed()) {
- ContentOutlineConfiguration cfg = createContentOutlineConfiguration();
- if (cfg != null) {
- ConfigurableContentOutlinePage outlinePage = new ConfigurableContentOutlinePage();
- outlinePage.setConfiguration(cfg);
- if (internalModel != null) {
- outlinePage.setInputContentTypeIdentifier(internalModel.getContentTypeIdentifier());
- outlinePage.setInput(internalModel);
- }
-
- if (fOutlinePageListener == null) {
- fOutlinePageListener = new OutlinePageListener();
- }
-
- outlinePage.addSelectionChangedListener(fOutlinePageListener);
- outlinePage.addDoubleClickListener(fOutlinePageListener);
-
- fOutlinePage = outlinePage;
- }
- }
- result = fOutlinePage;
- }
- // property sheet page, but only if the input's editable
- else if (IPropertySheetPage.class.equals(required) && isEditable()) {
- if (fPropertySheetPage == null || fPropertySheetPage.getControl() == null || fPropertySheetPage.getControl().isDisposed()) {
- PropertySheetConfiguration cfg = createPropertySheetConfiguration();
- if (cfg != null) {
- ConfigurablePropertySheetPage propertySheetPage = new ConfigurablePropertySheetPage();
- propertySheetPage.setConfiguration(cfg);
- fPropertySheetPage = propertySheetPage;
- }
- }
- result = fPropertySheetPage;
- }
- else if (IDocument.class.equals(required)) {
- result = getDocumentProvider().getDocument(getEditorInput());
- }
- else if (ISourceEditingTextTools.class.equals(required)) {
- result = createSourceEditingTextTools();
- }
- else if (IToggleBreakpointsTarget.class.equals(required)) {
- result = ToggleBreakpointsTarget.getInstance();
- }
- else if (ITextEditorExtension4.class.equals(required)) {
- result = this;
- }
- else if (IShowInTargetList.class.equals(required)) {
- result = new ShowInTargetListAdapter();
- }
- else if (IVerticalRuler.class.equals(required)) {
- return getVerticalRuler();
- }
- else if (SelectionHistory.class.equals(required)) {
- if (fSelectionHistory == null)
- fSelectionHistory = new SelectionHistory(this);
- result = fSelectionHistory;
- }
- else if (IResource.class.equals(required)) {
- IEditorInput input = getEditorInput();
- if (input != null) {
- result = input.getAdapter(required);
- }
- }
- else {
- if (result == null && internalModel != null) {
- result = internalModel.getAdapter(required);
- }
- // others
- if (result == null)
- result = super.getAdapter(required);
- }
- if (result == null) {
-// Logger.log(Logger.INFO_DEBUG, "StructuredTextEditor.getAdapter returning null for " + required); //$NON-NLS-1$
- }
- if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
- long stop = System.currentTimeMillis();
- adapterRequests++;
- adapterTime += (stop - startPerfTime);
- }
- if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
- System.out.println("Total calls to getAdapter: " + adapterRequests); //$NON-NLS-1$
- System.out.println("Total time in getAdapter: " + adapterTime); //$NON-NLS-1$
- System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
- }
- return result;
- }
-
- private String[] getConfigurationPoints() {
- String contentTypeIdentifierID = null;
- if (getInternalModel() != null) {
- contentTypeIdentifierID = getInternalModel().getContentTypeIdentifier();
- }
- return ConfigurationPointCalculator.getConfigurationPoints(this, contentTypeIdentifierID, ConfigurationPointCalculator.SOURCE, StructuredTextEditor.class);
- }
-
- /**
- * added checks to overcome bug such that if we are shutting down in an
- * error condition, then viewer will have already been disposed.
- */
- protected String getCursorPosition() {
- String result = null;
- // this may be too expensive in terms of
- // performance, to do this check
- // every time, just to gaurd against error
- // condition.
- // perhaps there's a better way?
- if (getSourceViewer() != null && getSourceViewer().getTextWidget() != null && !getSourceViewer().getTextWidget().isDisposed()) {
- result = super.getCursorPosition();
- }
- else {
- result = "0:0"; //$NON-NLS-1$
- }
- return result;
- }
-
-
- Display getDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * Returns this editor part.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- *
- * @return this editor part
- */
- public IEditorPart getEditorPart() {
- if (fEditorPart == null)
- return this;
- return fEditorPart;
- }
-
- IStructuredModel getInternalModel() {
- return fStructuredModel;
- }
-
- private InternalModelStateListener getInternalModelStateListener() {
- if (fInternalModelStateListener == null) {
- fInternalModelStateListener = new InternalModelStateListener();
- }
- return fInternalModelStateListener;
- }
-
- /**
- * Returns this editor's StructuredModel.
- * <p>
- * Not API. Will be removed in the future.
- * </p>
- *
- * @return returns this editor's IStructuredModel
- * @deprecated - This method allowed for uncontrolled access to the model
- * instance and will be removed in the future. It is
- * recommended that the current document provider be asked for
- * the current document and the IModelManager then asked for
- * the corresponding model with
- * getExistingModelFor*(IDocument). Supported document
- * providers ensure that the document maps to a shared
- * structured model.
- */
- public IStructuredModel getModel() {
- IDocumentProvider documentProvider = getDocumentProvider();
-
- if (documentProvider == null) {
- // this indicated an error in startup sequence
- Logger.trace(getClass().getName(), "Program Info Only: document provider was null when model requested"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Remember if we entered this method without a model existing
- boolean initialModelNull = (fStructuredModel == null);
-
- if (fStructuredModel == null && documentProvider != null) {
- // lazily set the model instance, although this is an ABNORMAL
- // CODE PATH
- if (documentProvider instanceof IModelProvider) {
- fStructuredModel = ((IModelProvider) documentProvider).getModel(getEditorInput());
- fisReleased = false;
- }
- else {
- IDocument doc = documentProvider.getDocument(getEditorInput());
- if (doc instanceof IStructuredDocument) {
- /*
- * Called in this manner because getExistingModel can skip
- * some calculations always performed in getModelForEdit
- */
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
- if (model == null) {
- model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
- }
- fStructuredModel = model;
- fisReleased = false;
- }
- }
-
- EditorModelUtil.addFactoriesTo(fStructuredModel);
-
- if (initialModelNull && fStructuredModel != null) {
- /*
- * DMW: 9/1/2002 -- why is update called here? No change has
- * been indicated? I'd like to remove, but will leave for now
- * to avoid breaking this hack. Should measure/breakpoint to
- * see how large the problem is. May cause performance
- * problems.
- *
- * DMW: 9/8/2002 -- not sure why this was here initially, but
- * the intent/hack must have been to call update if this was
- * the first time fStructuredModel was set. So, I added the
- * logic to check for that "first time" case. It would appear
- * we don't really need. may remove in future when can test
- * more.
- */
- update();
- }
- }
- return fStructuredModel;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.IWorkbenchPartOrientation#getOrientation()
- */
- public int getOrientation() {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714
- return SWT.LEFT_TO_RIGHT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.ITextEditor#getSelectionProvider()
- */
- public ISelectionProvider getSelectionProvider() {
- if (fStructuredSelectionProvider == null) {
- ISelectionProvider parentProvider = super.getSelectionProvider();
- if (parentProvider != null) {
- fStructuredSelectionProvider = new StructuredSelectionProvider(parentProvider, this);
- fStructuredSelectionProvider.addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateStatusLine(event.getSelection());
- }
- });
- if (fStructuredModel != null) {
- SelectionConvertor convertor = (SelectionConvertor) fStructuredModel.getAdapter(SelectionConvertor.class);
- if (convertor != null) {
- fStructuredSelectionProvider.selectionConvertor = convertor;
- }
- }
- }
- }
- if (fStructuredSelectionProvider == null) {
- return super.getSelectionProvider();
- }
- return fStructuredSelectionProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#getStatusLineManager()
- *
- * Overridden to use the top-level editor part's status line
- */
- protected IStatusLineManager getStatusLineManager() {
- return getEditorPart().getEditorSite().getActionBars().getStatusLineManager();
- }
-
- /**
- * Returns the editor's source viewer. This method was created to expose
- * the protected final getSourceViewer() method.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- *
- * @return the editor's source viewer
- */
- public StructuredTextViewer getTextViewer() {
- return (StructuredTextViewer) getSourceViewer();
- }
-
- /**
- * Jumps to the matching bracket.
- */
- void gotoMatchingBracket() {
- ICharacterPairMatcher matcher = createCharacterPairMatcher();
- if (matcher == null)
- return;
-
- ISourceViewer sourceViewer = getSourceViewer();
- IDocument document = sourceViewer.getDocument();
- if (document == null)
- return;
-
- IRegion selection = getSignedSelection(sourceViewer);
-
- int selectionLength = Math.abs(selection.getLength());
- if (selectionLength > 1) {
- setStatusLineErrorMessage(SSEUIMessages.GotoMatchingBracket_error_invalidSelection);
- sourceViewer.getTextWidget().getDisplay().beep();
- return;
- }
-
- int sourceCaretOffset = selection.getOffset() + selection.getLength();
- IRegion region = matcher.match(document, sourceCaretOffset);
- if (region == null) {
- setStatusLineErrorMessage(SSEUIMessages.GotoMatchingBracket_error_noMatchingBracket);
- sourceViewer.getTextWidget().getDisplay().beep();
- return;
- }
-
- int offset = region.getOffset();
- int length = region.getLength();
-
- if (length < 1)
- return;
-
- int anchor = matcher.getAnchor();
-
- // go to after the match if matching to the right
- int targetOffset = (ICharacterPairMatcher.RIGHT == anchor) ? offset : offset + length;
-
- boolean visible = false;
- if (sourceViewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer;
- visible = (extension.modelOffset2WidgetOffset(targetOffset) > -1);
- }
- else {
- IRegion visibleRegion = sourceViewer.getVisibleRegion();
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=34195
- visible = (targetOffset >= visibleRegion.getOffset() && targetOffset <= visibleRegion.getOffset() + visibleRegion.getLength());
- }
-
- if (!visible) {
- setStatusLineErrorMessage(SSEUIMessages.GotoMatchingBracket_error_bracketOutsideSelectedElement);
- sourceViewer.getTextWidget().getDisplay().beep();
- return;
- }
-
- if (selection.getLength() < 0)
- targetOffset -= selection.getLength();
-
- if (sourceViewer != null) {
- sourceViewer.setSelectedRange(targetOffset, selection.getLength());
- sourceViewer.revealRange(targetOffset, selection.getLength());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#handleCursorPositionChanged()
- */
- protected void handleCursorPositionChanged() {
- super.handleCursorPositionChanged();
- updateStatusField(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET);
- }
-
- protected void handleElementContentReplaced() {
- super.handleElementContentReplaced();
-
- // queue a full revalidation of content
- IDocument document = getDocumentProvider().getDocument(getEditorInput());
- SourceViewerConfiguration sourceViewerConfiguration = getSourceViewerConfiguration();
- if (document != null && sourceViewerConfiguration != null && sourceViewerConfiguration.getReconciler(getSourceViewer()) instanceof DirtyRegionProcessor) {
- ((DirtyRegionProcessor) sourceViewerConfiguration.getReconciler(getSourceViewer())).processDirtyRegion(new DirtyRegion(0, document.getLength(), DirtyRegion.INSERT, document.get()));
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=129906 - update
- * selection to listeners
- */
- ISelectionProvider selectionProvider = getSelectionProvider();
- ISelection originalSelection = selectionProvider.getSelection();
- if (selectionProvider instanceof StructuredSelectionProvider && originalSelection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) originalSelection;
- // make sure the old selection is actually still valid
- if (!textSelection.isEmpty() && (document == null || textSelection.getOffset() + textSelection.getLength() <= document.getLength())) {
- SelectionChangedEvent syntheticEvent = new SelectionChangedEvent(selectionProvider, new TextSelection(textSelection.getOffset(), textSelection.getLength()));
- ((StructuredSelectionProvider) selectionProvider).handleSelectionChanged(syntheticEvent);
- ((StructuredSelectionProvider) selectionProvider).handlePostSelectionChanged(syntheticEvent);
- }
- else {
- SelectionChangedEvent syntheticEvent = new SelectionChangedEvent(selectionProvider, new TextSelection(0, 0));
- ((StructuredSelectionProvider) selectionProvider).handleSelectionChanged(syntheticEvent);
- ((StructuredSelectionProvider) selectionProvider).handlePostSelectionChanged(syntheticEvent);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
- */
- protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
- String property = event.getProperty();
-
- if (EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS.equals(property)) {
- updateHoverBehavior();
- }
-
- //enable or disable as you type validation
- else if(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS.equals(property)) {
- IReconciler reconciler = this.getSourceViewerConfiguration().getReconciler(this.getSourceViewer());
- if (reconciler instanceof DocumentRegionProcessor) {
- ((DocumentRegionProcessor) reconciler).setValidatorStrategyEnabled(isValidationEnabled());
- }
- }
-
- else if (AbstractStructuredFoldingStrategy.FOLDING_ENABLED.equals(property)) {
- if (getSourceViewer() instanceof ProjectionViewer) {
- // install projection support if it has not even been
- // installed yet
- if (isFoldingEnabled() && (fProjectionSupport == null)) {
- installProjectionSupport();
- }
- ProjectionViewer pv = (ProjectionViewer) getSourceViewer();
- if (pv.isProjectionMode() != isFoldingEnabled()) {
- if (pv.canDoOperation(ProjectionViewer.TOGGLE)) {
- pv.doOperation(ProjectionViewer.TOGGLE);
- }
- }
- }
- }
-
- // update content assist preferences
- else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND.equals(property)) {
- ISourceViewer sourceViewer = getSourceViewer();
- if (sourceViewer != null) {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- if (configuration != null) {
- IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
- if (contentAssistant instanceof ContentAssistant) {
- ContentAssistant assistant = (ContentAssistant) contentAssistant;
- RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
- Color color = EditorUtility.getColor(rgb);
- assistant.setProposalSelectorBackground(color);
- }
- }
- }
- }
-
- // update content assist preferences
- else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND.equals(property)) {
- ISourceViewer sourceViewer = getSourceViewer();
- if (sourceViewer != null) {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- if (configuration != null) {
- IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
- if (contentAssistant instanceof ContentAssistant) {
- ContentAssistant assistant = (ContentAssistant) contentAssistant;
- RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
- Color color = EditorUtility.getColor(rgb);
- assistant.setProposalSelectorForeground(color);
- }
- }
- }
- }
-
- // update content assist preferences
- else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND.equals(property)) {
- ISourceViewer sourceViewer = getSourceViewer();
- if (sourceViewer != null) {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- if (configuration != null) {
- IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
- if (contentAssistant instanceof ContentAssistant) {
- ContentAssistant assistant = (ContentAssistant) contentAssistant;
- RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND);
- Color color = EditorUtility.getColor(rgb);
- assistant.setContextInformationPopupBackground(color);
- assistant.setContextSelectorBackground(color);
- }
- }
- }
- }
-
- // update content assist preferences
- else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND.equals(property)) {
- ISourceViewer sourceViewer = getSourceViewer();
- if (sourceViewer != null) {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- if (configuration != null) {
- IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
- if (contentAssistant instanceof ContentAssistant) {
- ContentAssistant assistant = (ContentAssistant) contentAssistant;
- RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND);
- Color color = EditorUtility.getColor(rgb);
- assistant.setContextInformationPopupForeground(color);
- assistant.setContextSelectorForeground(color);
- }
- }
- }
- }
-
- super.handlePreferenceStoreChanged(event);
- }
-
- private boolean inBusyState() {
- return fBusyState;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- // if we've gotten an error elsewhere, before
- // we've actually opened, then don't open.
- if (shouldClose) {
- setSite(site);
- close(false);
- }
- else {
- super.init(site, input);
- }
- }
-
- /**
- * Set the document provider for this editor.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- *
- * @param documentProvider
- * documentProvider to initialize
- */
- public void initializeDocumentProvider(IDocumentProvider documentProvider) {
- if (documentProvider != null) {
- setDocumentProvider(documentProvider);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#initializeDragAndDrop(org.eclipse.jface.text.source.ISourceViewer)
- */
- protected void initializeDragAndDrop(ISourceViewer viewer) {
- IPreferenceStore store = getPreferenceStore();
- if (store != null && store.getBoolean(PREFERENCE_TEXT_DRAG_AND_DROP_ENABLED))
- initializeDrop(viewer);
- }
-
- protected void initializeDrop(ITextViewer textViewer) {
- int operations = DND.DROP_COPY | DND.DROP_MOVE;
- fDropTarget = new DropTarget(textViewer.getTextWidget(), operations);
- fDropAdapter = new ReadOnlyAwareDropTargetAdapter(true);
- fDropAdapter.setTargetEditor(this);
- fDropAdapter.setTargetIDs(getConfigurationPoints());
- fDropAdapter.setTextViewer(textViewer);
- fDropTarget.setTransfer(fDropAdapter.getTransfers());
- fDropTarget.addDropListener(fDropAdapter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor()
- */
- protected void initializeEditor() {
- super.initializeEditor();
-
- setPreferenceStore(createCombinedPreferenceStore());
-
- setRangeIndicator(new DefaultRangeIndicator());
- setEditorContextMenuId(EDITOR_CONTEXT_MENU_ID);
- initializeDocumentProvider(null);
- // set the infopop for source viewer
- String helpId = getHelpContextId();
- // no infopop set or using default text editor help, use default
- if (helpId == null || ITextEditorHelpContextIds.TEXT_EDITOR.equals(helpId))
- helpId = IHelpContextIds.XML_SOURCE_VIEW_HELPID;
- setHelpContextId(helpId);
- // defect 203158 - disable ruler context menu for
- // beta
- // setRulerContextMenuId(RULER_CONTEXT_MENU_ID);
- configureInsertMode(SMART_INSERT, true);
-
- // enable the base source editor activity when editor opens
- try {
- // FIXME: - commented out to avoid minor dependancy during
- // transition to org.eclipse
- // WTPActivityBridge.getInstance().enableActivity(CORE_SSE_ACTIVITY_ID,
- // true);
- }
- catch (Exception t) {
- // if something goes wrong with enabling activity, just log the
- // error but dont
- // have it break the editor
- Logger.log(Logger.WARNING_DEBUG, t.getMessage(), t);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes()
- */
- protected void initializeKeyBindingScopes() {
- setKeyBindingScopes(new String[]{EDITOR_KEYBINDING_SCOPE_ID});
- }
-
- /**
- * Initializes the editor's source viewer and other items that were source
- * viewer-dependent.
- */
- private void initializeSourceViewer() {
- IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
- if (openHyperlinkAction instanceof OpenHyperlinkAction) {
- ((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
- }
-
- // do not even install projection support until folding is actually
- // enabled
- if (isFoldingEnabled()) {
- installProjectionSupport();
- }
- }
-
- protected void initSourceViewer(StructuredTextViewer sourceViewer) {
- // ensure decoration support is configured
- getSourceViewerDecorationSupport(sourceViewer);
- }
-
- protected void installTextDragAndDrop(ISourceViewer viewer) {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.TextEditor#installEncodingSupport()
- */
- protected void installEncodingSupport() {
- fEncodingSupport = new EncodingSupport(getConfigurationPoints());
- fEncodingSupport.initialize(this);
- }
-
- /**
- * Install everything necessary to get document folding working and enable
- * document folding
- */
- private void installProjectionSupport() {
- ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
-
- fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
- fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent);
- }
- });
- fProjectionSupport.install();
-
- if (isFoldingEnabled())
- projectionViewer.doOperation(ProjectionViewer.TOGGLE);
- }
-
- /**
- * Return whether document folding should be enabled according to the
- * preference store settings.
- *
- * @return <code>true</code> if document folding should be enabled
- */
- private boolean isFoldingEnabled() {
- IPreferenceStore store = getPreferenceStore();
- // check both preference store and vm argument
- return (store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED));
- }
-
- /**
- * Determine if the user preference for as you type validation is enabled or not
- */
- private boolean isValidationEnabled() {
- return getPreferenceStore().getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
- }
-
- /**
- * <p>Logs a warning about how this {@link StructuredTextEditor} just opened an {@link IEditorInput}
- * it was not designed to open.</p>
- *
- * @param input the {@link IEditorInput} this {@link StructuredTextEditor} was not designed to open
- * to log the message about.
- */
- private void logUnexpectedDocumentKind(IEditorInput input) {
- Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$
- String name = null;
- if (input != null) {
- name = input.getName();
- }
- else {
- name = "input was null"; //$NON-NLS-1$
- }
- Logger.log(Logger.WARNING, " Input Name: " + name); //$NON-NLS-1$
- String implClass = null;
- IDocument document = getDocumentProvider().getDocument(input);
- if (document != null) {
- implClass = document.getClass().getName();
- }
- else {
- implClass = "document was null"; //$NON-NLS-1$
- }
- Logger.log(Logger.WARNING, " Unexpected IDocumentProvider implementation: " + getDocumentProvider().getClass().getName()); //$NON-NLS-1$
- Logger.log(Logger.WARNING, " Unexpected IDocument implementation: " + implClass); //$NON-NLS-1$
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert()
- */
- protected void performRevert() {
- ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
- projectionViewer.setRedraw(false);
- try {
-
- boolean projectionMode = projectionViewer.isProjectionMode();
- if (projectionMode) {
- projectionViewer.disableProjection();
- }
-
- super.performRevert();
-
- if (projectionMode) {
- projectionViewer.enableProjection();
- }
-
- }
- finally {
- projectionViewer.setRedraw(true);
- }
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * Not API. May be reduced to protected method in the future.
- * </p>
- */
- public void rememberSelection() {
- /*
- * This method was made public for use by editors that use
- * StructuredTextEditor (like some clients)
- */
- super.rememberSelection();
- }
-
-
- /**
- * both starts and resets the busy state timer
- */
- private void resetBusyState() {
- // reset the "busy" timeout
- if (fBusyTimer != null) {
- fBusyTimer.cancel();
- }
- startBusyTimer();
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * Not API. May be reduced to protected method in the future.
- * </p>
- */
- public void restoreSelection() {
- /*
- * This method was made public for use by editors that use
- * StructuredTextEditor (like some clients)
- */
- // catch odd case where source viewer has no text
- // widget (defect
- // 227670)
- if ((getSourceViewer() != null) && (getSourceViewer().getTextWidget() != null))
- super.restoreSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#rulerContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
- */
- protected void rulerContextMenuAboutToShow(IMenuManager menu) {
- super.rulerContextMenuAboutToShow(menu);
-
- IMenuManager foldingMenu = new MenuManager(SSEUIMessages.Folding, "projection"); //$NON-NLS-1$
- menu.appendToGroup(ITextEditorActionConstants.GROUP_RULERS, foldingMenu);
-
- IAction action = getAction("FoldingToggle"); //$NON-NLS-1$
- foldingMenu.add(action);
- action = getAction("FoldingExpandAll"); //$NON-NLS-1$
- foldingMenu.add(action);
- action = getAction("FoldingCollapseAll"); //$NON-NLS-1$
- foldingMenu.add(action);
-
- IStructuredModel internalModel = getInternalModel();
- if (internalModel != null) {
- boolean debuggingAvailable = BreakpointProviderBuilder.getInstance().isAvailable(internalModel.getContentTypeIdentifier(), BreakpointRulerAction.getFileExtension(getEditorInput()));
- if (debuggingAvailable) {
- // append actions to "debug" group (created in
- // AbstractDecoratedTextEditor.rulerContextMenuAboutToShow(IMenuManager)
- menu.appendToGroup("debug", getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS)); //$NON-NLS-1$
- menu.appendToGroup("debug", getAction(ActionDefinitionIds.MANAGE_BREAKPOINTS)); //$NON-NLS-1$
- menu.appendToGroup("debug", getAction(ActionDefinitionIds.EDIT_BREAKPOINTS)); //$NON-NLS-1$
- }
- addExtendedRulerContextMenuActions(menu);
- }
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * Overridden to expose part activation handling for multi-page editors.
- * </p>
- * <p>
- * Not API. May be reduced to protected method in the future.
- * </p>
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#safelySanityCheckState(org.eclipse.ui.IEditorInput)
- */
- public void safelySanityCheckState(IEditorInput input) {
- super.safelySanityCheckState(input);
- }
-
- protected void sanityCheckState(IEditorInput input) {
- try {
- ++validateEditCount;
- super.sanityCheckState(input);
- }
- finally {
- --validateEditCount;
- }
- }
-
- private void savedModel(IStructuredModel model) {
- if (model != null) {
- model.changedModel();
- }
- }
-
- /**
- * Ensure that the correct IDocumentProvider is used. For direct models, a
- * special provider is used. For StorageEditorInputs, use a custom
- * provider that creates a usable ResourceAnnotationModel. For everything
- * else, use the base support.
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#setDocumentProvider(org.eclipse.ui.IEditorInput)
- */
- protected void setDocumentProvider(IEditorInput input) {
- if (input instanceof IStructuredModel) {
- // largely untested
- setDocumentProvider(StructuredModelDocumentProvider.getInstance());
- }
- else if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput)) {
- setDocumentProvider(StorageModelProvider.getInstance());
- }
- else {
- super.setDocumentProvider(input);
- }
- }
-
- /**
- * Set editor part associated with this editor.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- *
- * @param editorPart
- * editor part associated with this editor
- */
- public void setEditorPart(IEditorPart editorPart) {
- fEditorPart = editorPart;
- }
-
- /**
- * Sets the model field within this editor.
- *
- * @deprecated - can eventually be eliminated
- */
- private void setModel(IStructuredModel newModel) {
- Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); //$NON-NLS-1$
- if (fStructuredModel != null) {
- fStructuredModel.removeModelStateListener(getInternalModelStateListener());
- }
- fStructuredModel = newModel;
- if (fStructuredModel != null) {
- fStructuredModel.addModelStateListener(getInternalModelStateListener());
- }
- // update() should be called whenever the model is
- // set or changed
- update();
- }
-
- /**
- * Sets the editor's source viewer configuration which it uses to
- * configure it's internal source viewer. This method was overwritten so
- * that viewer configuration could be set after editor part was created.
- */
- protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
- SourceViewerConfiguration oldSourceViewerConfiguration = getSourceViewerConfiguration();
- super.setSourceViewerConfiguration(config);
- StructuredTextViewer stv = getTextViewer();
- if (stv != null) {
- /*
- * There should be no need to unconfigure before configure because
- * configure will also unconfigure before configuring
- */
- removeReconcilingListeners(oldSourceViewerConfiguration, stv);
- stv.unconfigure();
- setStatusLineMessage(null);
- stv.configure(config);
- addReconcilingListeners(config, stv);
- }
- }
-
- private void removeReconcilingListeners(SourceViewerConfiguration config, StructuredTextViewer stv) {
- IReconciler reconciler = config.getReconciler(stv);
- if (reconciler instanceof DocumentRegionProcessor) {
- for (int i = 0; i < fReconcilingListeners.length; i++) {
- ((DocumentRegionProcessor) reconciler).removeReconcilingListener(fReconcilingListeners[i]);
- }
- }
- }
-
- private void addReconcilingListeners(SourceViewerConfiguration config, StructuredTextViewer stv) {
- try {
- List reconcilingListeners = new ArrayList(fReconcilingListeners.length);
- String[] ids = getConfigurationPoints();
- for (int i = 0; i < ids.length; i++) {
- reconcilingListeners.addAll(ExtendedConfigurationBuilder.getInstance().getConfigurations("sourceReconcilingListener", ids[i])); //$NON-NLS-1$
- }
- fReconcilingListeners = (ISourceReconcilingListener[]) reconcilingListeners.toArray(new ISourceReconcilingListener[reconcilingListeners.size()]);
- }
- catch (ClassCastException e) {
- Logger.log(Logger.ERROR, "Configuration has a reconciling listener that does not implement ISourceReconcilingListener."); //$NON-NLS-1$
- }
-
- IReconciler reconciler = config.getReconciler(stv);
- if (reconciler instanceof DocumentRegionProcessor) {
- for (int i = 0; i < fReconcilingListeners.length; i++)
- ((DocumentRegionProcessor) reconciler).addReconcilingListener(fReconcilingListeners[i]);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
- */
- public void showBusy(boolean busy) {
- // no-op
- super.showBusy(busy);
- }
-
- private void startBusyTimer() {
- // TODO: we need a resettable timer, so not so
- // many are created
- fBusyTimer = new Timer(true);
- fBusyTimer.schedule(new TimeOutExpired(), BUSY_STATE_DELAY);
- }
-
- protected void uninstallTextDragAndDrop(ISourceViewer viewer) {
- // do nothing
- }
-
- /**
- * Update should be called whenever the model is set or changed (as in
- * swapped)
- * <p>
- * Not API. May be removed in the future.
- * </p>
- */
- public void update() {
- if (fOutlinePage != null && fOutlinePage instanceof ConfigurableContentOutlinePage) {
- ContentOutlineConfiguration cfg = createContentOutlineConfiguration();
- ((ConfigurableContentOutlinePage) fOutlinePage).setConfiguration(cfg);
- IStructuredModel internalModel = getInternalModel();
- ((ConfigurableContentOutlinePage) fOutlinePage).setInputContentTypeIdentifier(internalModel.getContentTypeIdentifier());
- ((ConfigurableContentOutlinePage) fOutlinePage).setInput(internalModel);
- }
- if (fPropertySheetPage != null && fPropertySheetPage instanceof ConfigurablePropertySheetPage) {
- PropertySheetConfiguration cfg = createPropertySheetConfiguration();
- ((ConfigurablePropertySheetPage) fPropertySheetPage).setConfiguration(cfg);
- }
- disposeModelDependentFields();
-
- fShowInTargetIds = createShowInTargetIds();
-
- if (getSourceViewerConfiguration() instanceof StructuredTextViewerConfiguration && fStatusLineLabelProvider != null) {
- fStatusLineLabelProvider.dispose();
- }
-
- String configurationId = fViewerConfigurationTargetId;
- updateSourceViewerConfiguration();
-
- /* Only reinstall if the configuration id has changed */
- if (configurationId != null && !configurationId.equals(fViewerConfigurationTargetId)) {
- uninstallSemanticHighlighting();
- installSemanticHighlighting();
- }
-
- if (getSourceViewerConfiguration() instanceof StructuredTextViewerConfiguration) {
- fStatusLineLabelProvider = ((StructuredTextViewerConfiguration) getSourceViewerConfiguration()).getStatusLineLabelProvider(getSourceViewer());
- updateStatusLine(null);
- }
-
- if (fEncodingSupport != null && fEncodingSupport instanceof EncodingSupport) {
- ((EncodingSupport) fEncodingSupport).reinitialize(getConfigurationPoints());
- }
-
- createModelDependentFields();
- }
-
- /**
- * Updates all content dependent actions.
- */
- protected void updateContentDependentActions() {
- super.updateContentDependentActions();
- // super.updateContentDependentActions only updates
- // the enable/disable
- // state of all
- // the content dependent actions.
- // StructuredTextEditor's undo and redo actions
- // have a detail label and
- // description.
- // They needed to be updated.
- if (!fEditorDisposed)
- updateMenuText();
- }
-
-
- /**
- * Updates the editor context menu by creating a new context menu with the
- * given menu id
- *
- * @param contextMenuId
- * Cannot be null
- */
- private void updateEditorContextMenuId(String contextMenuId) {
- // update editor context menu id if updating to a new id or if context
- // menu is not already set up
- if (!contextMenuId.equals(getEditorContextMenuId()) || (fTextContextMenu == null)) {
- setEditorContextMenuId(contextMenuId);
-
- if (getSourceViewer() != null) {
- StyledText styledText = getSourceViewer().getTextWidget();
- if (styledText != null) {
- // dispose of previous context menu
- if (fTextContextMenu != null) {
- fTextContextMenu.dispose();
- }
- if (fTextContextMenuManager != null) {
- fTextContextMenuManager.removeMenuListener(getContextMenuListener());
- fTextContextMenuManager.removeAll();
- fTextContextMenuManager.dispose();
- }
-
- fTextContextMenuManager = new MenuManager(getEditorContextMenuId(), getEditorContextMenuId());
- fTextContextMenuManager.setRemoveAllWhenShown(true);
- fTextContextMenuManager.addMenuListener(getContextMenuListener());
-
- fTextContextMenu = fTextContextMenuManager.createContextMenu(styledText);
- styledText.setMenu(fTextContextMenu);
-
- getSite().registerContextMenu(getEditorContextMenuId(), fTextContextMenuManager, getSelectionProvider());
-
- // also register this menu for source page part and
- // structured text editor ids
- String partId = getSite().getId();
- if (partId != null) {
- getSite().registerContextMenu(partId + EDITOR_CONTEXT_MENU_SUFFIX, fTextContextMenuManager, getSelectionProvider());
- }
- getSite().registerContextMenu(EDITOR_CONTEXT_MENU_ID, fTextContextMenuManager, getSelectionProvider());
- }
- }
- }
- }
-
- /**
- * Updates editor context menu, vertical ruler menu, help context id for
- * new content type
- *
- * @param contentType
- */
- private void updateEditorControlsForContentType(String contentType) {
- if (contentType == null) {
- updateEditorContextMenuId(EDITOR_CONTEXT_MENU_ID);
- updateRulerContextMenuId(RULER_CONTEXT_MENU_ID);
- updateHelpContextId(ITextEditorHelpContextIds.TEXT_EDITOR);
- }
- else {
- updateEditorContextMenuId(contentType + EDITOR_CONTEXT_MENU_SUFFIX);
- updateRulerContextMenuId(contentType + RULER_CONTEXT_MENU_SUFFIX);
- updateHelpContextId(contentType + "_source_HelpId"); //$NON-NLS-1$
-
- /* Activate the contexts defined for this editor */
- activateContexts((IContextService) getSite().getService(IContextService.class));
- }
- }
-
- private void updateEncodingMemento() {
- boolean failed = false;
- IStructuredModel internalModel = getInternalModel();
- if (internalModel != null) {
- IStructuredDocument doc = internalModel.getStructuredDocument();
- EncodingMemento memento = doc.getEncodingMemento();
- IDocumentCharsetDetector detector = internalModel.getModelHandler().getEncodingDetector();
- if (memento != null && detector != null) {
- detector.set(doc);
- try {
- String newEncoding = detector.getEncoding();
- if (newEncoding != null) {
- memento.setDetectedCharsetName(newEncoding);
- }
- }
- catch (IOException e) {
- failed = true;
- }
- }
- /**
- * Be sure to use the new value but only if no exception
- * occurred. (we may find cases we need to do more error recovery
- * there) should be near impossible to get IOException from
- * processing the _document_
- */
- if (!failed) {
- doc.setEncodingMemento(memento);
- }
- }
- }
-
- /**
- * Updates the help context of the editor with the given help context id
- *
- * @param helpContextId
- * Cannot be null
- */
- private void updateHelpContextId(String helpContextId) {
- if (!helpContextId.equals(getHelpContextId())) {
- setHelpContextId(helpContextId);
-
- if (getSourceViewer() != null) {
- StyledText styledText = getSourceViewer().getTextWidget();
- if (styledText != null) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- helpSystem.setHelp(styledText, getHelpContextId());
- }
- }
- }
- }
-
- /*
- * Update the hovering behavior depending on the preferences.
- */
- private void updateHoverBehavior() {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- String[] types = configuration.getConfiguredContentTypes(getSourceViewer());
-
- for (int i = 0; i < types.length; i++) {
-
- String t = types[i];
-
- ISourceViewer sourceViewer = getSourceViewer();
- if (sourceViewer instanceof ITextViewerExtension2) {
- // Remove existing hovers
- ((ITextViewerExtension2) sourceViewer).removeTextHovers(t);
-
- int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t);
-
- if (stateMasks != null) {
- for (int j = 0; j < stateMasks.length; j++) {
- int stateMask = stateMasks[j];
- ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask);
- ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask);
- }
- }
- else {
- ITextHover textHover = configuration.getTextHover(sourceViewer, t);
- ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
- }
- }
- else
- sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t);
- }
- }
-
- private void updateMenuText() {
- ITextViewer viewer = getTextViewer();
- StyledText widget = null;
- if (viewer != null)
- widget = viewer.getTextWidget();
-
- if (fStructuredModel != null && !fStructuredModel.isModelStateChanging() && viewer != null && widget != null && !widget.isDisposed()) {
- // performance: don't force an update of the action bars unless
- // required as it is expensive
- String previousUndoText = null;
- String previousUndoDesc = null;
- String previousRedoText = null;
- String previousRedoDesc = null;
- boolean updateActions = false;
- IAction undoAction = getAction(ITextEditorActionConstants.UNDO);
- IAction redoAction = getAction(ITextEditorActionConstants.REDO);
- if (undoAction != null) {
- previousUndoText = undoAction.getText();
- previousUndoDesc = undoAction.getDescription();
- updateActions = updateActions || previousUndoText == null || previousUndoDesc == null;
- undoAction.setText(UNDO_ACTION_TEXT_DEFAULT);
- undoAction.setDescription(UNDO_ACTION_DESC_DEFAULT);
- }
- if (redoAction != null) {
- previousRedoText = redoAction.getText();
- previousRedoDesc = redoAction.getDescription();
- updateActions = updateActions || previousRedoText == null || previousRedoDesc == null;
- redoAction.setText(REDO_ACTION_TEXT_DEFAULT);
- redoAction.setDescription(REDO_ACTION_DESC_DEFAULT);
- }
- if (fStructuredModel.getUndoManager() != null) {
- IStructuredTextUndoManager undoManager = fStructuredModel.getUndoManager();
- // get undo command
- Command undoCommand = undoManager.getUndoCommand();
- // set undo label and description
- if (undoAction != null) {
- undoAction.setEnabled(undoManager.undoable());
- if (undoCommand != null) {
- String label = undoCommand.getLabel();
- if (label != null) {
- String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
- updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
- undoAction.setText(customText);
- }
- String desc = undoCommand.getDescription();
- if (desc != null) {
- String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
- updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
- undoAction.setDescription(customDesc);
- }
- }
- }
- // get redo command
- Command redoCommand = undoManager.getRedoCommand();
- // set redo label and description
- if (redoAction != null) {
- redoAction.setEnabled(undoManager.redoable());
- if (redoCommand != null) {
- String label = redoCommand.getLabel();
- if (label != null) {
- String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
- updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
- redoAction.setText(customText);
- }
- String desc = redoCommand.getDescription();
- if (desc != null) {
- String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
- updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
- redoAction.setDescription(customDesc);
- }
- }
- }
- }
- // tell the action bars to update
- if (updateActions) {
- if (getEditorSite().getActionBars() != null) {
- getEditorSite().getActionBars().updateActionBars();
- }
- else if (getEditorPart() != null && getEditorPart().getEditorSite().getActionBars() != null) {
- getEditorPart().getEditorSite().getActionBars().updateActionBars();
- }
- }
- }
- }
-
- void updateRangeIndication(ISelection selection) {
- boolean rangeUpdated = false;
- if (selection instanceof IStructuredSelection && !((IStructuredSelection) selection).isEmpty()) {
- Object[] objects = ((IStructuredSelection) selection).toArray();
- if (objects.length > 0 && objects[0] instanceof IndexedRegion) {
- int start = ((IndexedRegion) objects[0]).getStartOffset();
- int end = ((IndexedRegion) objects[0]).getEndOffset();
- if (objects.length > 1) {
- for (int i = 1; i < objects.length; i++) {
- start = Math.min(start, ((IndexedRegion) objects[i]).getStartOffset());
- end = Math.max(end, ((IndexedRegion) objects[i]).getEndOffset());
- }
- }
- getSourceViewer().setRangeIndication(start, end - start, false);
- rangeUpdated = true;
- }
- }
- if (!rangeUpdated && getSourceViewer() != null) {
- if (selection instanceof ITextSelection) {
- getSourceViewer().setRangeIndication(((ITextSelection) selection).getOffset(), ((ITextSelection) selection).getLength(), false);
- }
- else {
- getSourceViewer().removeRangeIndication();
- }
- }
- }
-
-
- /**
- * Updates the editor vertical ruler menu by creating a new vertical ruler
- * context menu with the given menu id
- *
- * @param rulerMenuId
- * Cannot be null
- */
- private void updateRulerContextMenuId(String rulerMenuId) {
- // update ruler context menu id if updating to a new id or if context
- // menu is not already set up
- if (!rulerMenuId.equals(getRulerContextMenuId()) || (fRulerContextMenu == null)) {
- setRulerContextMenuId(rulerMenuId);
-
- if (getVerticalRuler() != null) {
- // dispose of previous ruler context menu
- if (fRulerContextMenu != null) {
- fRulerContextMenu.dispose();
- }
- if (fRulerContextMenuManager != null) {
- fRulerContextMenuManager.removeMenuListener(getContextMenuListener());
- fRulerContextMenuManager.removeAll();
- fRulerContextMenuManager.dispose();
- }
-
- fRulerContextMenuManager = new MenuManager(getRulerContextMenuId(), getRulerContextMenuId());
- fRulerContextMenuManager.setRemoveAllWhenShown(true);
- fRulerContextMenuManager.addMenuListener(getContextMenuListener());
-
- Control rulerControl = getVerticalRuler().getControl();
- fRulerContextMenu = fRulerContextMenuManager.createContextMenu(rulerControl);
- rulerControl.setMenu(fRulerContextMenu);
-
- getSite().registerContextMenu(getRulerContextMenuId(), fRulerContextMenuManager, getSelectionProvider());
-
- // also register this menu for source page part and structured
- // text editor ids
- String partId = getSite().getId();
- if (partId != null) {
- getSite().registerContextMenu(partId + RULER_CONTEXT_MENU_SUFFIX, fRulerContextMenuManager, getSelectionProvider());
- }
- getSite().registerContextMenu(RULER_CONTEXT_MENU_ID, fRulerContextMenuManager, getSelectionProvider());
- }
- }
- }
-
- private void updateSourceViewerConfiguration() {
- SourceViewerConfiguration configuration = getSourceViewerConfiguration();
- // no need to update source viewer configuration if one does not exist
- // yet
- if (configuration == null) {
- return;
- }
- // do not configure source viewer configuration twice
- boolean configured = false;
-
- // structuredtextviewer only works with
- // structuredtextviewerconfiguration
- if (!(configuration instanceof StructuredTextViewerConfiguration)) {
- ConfigurationAndTarget cat = createSourceViewerConfiguration();
- fViewerConfigurationTargetId = cat.getTargetId();
- configuration = cat.getConfiguration();
- setSourceViewerConfiguration(configuration);
- configured = true;
- }
- else {
- ConfigurationAndTarget cat = createSourceViewerConfiguration();
- StructuredTextViewerConfiguration newViewerConfiguration = cat.getConfiguration();
- if (!(cat.getTargetId().equals(fViewerConfigurationTargetId))) {
- // d282894 use newViewerConfiguration
- fViewerConfigurationTargetId = cat.getTargetId();
- configuration = newViewerConfiguration;
- setSourceViewerConfiguration(configuration);
- configured = true;
- }
- }
-
- if (getSourceViewer() != null) {
- // not sure if really need to reconfigure when input changes
- // (maybe only need to reset viewerconfig's document)
- if (!configured)
- getSourceViewer().configure(configuration);
- IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
- if (openHyperlinkAction instanceof OpenHyperlinkAction) {
- ((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
- }
- }
- }
-
- protected void updateStatusField(String category) {
- super.updateStatusField(category);
-
- if (category == null)
- return;
-
- if (StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET.equals(category)) {
- IStatusField field = getStatusField(category);
- ISourceViewer sourceViewer = getSourceViewer();
- if (field != null && sourceViewer != null) {
- Point selection = sourceViewer.getTextWidget().getSelection();
- int offset1 = widgetOffset2ModelOffset(sourceViewer, selection.x);
- int offset2 = widgetOffset2ModelOffset(sourceViewer, selection.y);
- String text = null;
- if (offset1 != offset2)
- text = "[" + offset1 + "-" + offset2 + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else
- text = "[ " + offset1 + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
- field.setText(text == null ? fErrorLabel : text);
- }
- }
- }
-
- public Annotation gotoAnnotation(boolean forward) {
- Annotation result = super.gotoAnnotation(forward);
- if(result != null)
- fSelectionChangedFromGoto = true;
- return result;
- }
-
- void updateStatusLine(ISelection selection) {
- // Bug 210481 - Don't update the status line if the selection
- // was caused by go to navigation
- if(fSelectionChangedFromGoto) {
- fSelectionChangedFromGoto = false;
- return;
- }
- IStatusLineManager statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
- if (fStatusLineLabelProvider != null && statusLineManager != null) {
- String text = null;
- Image image = null;
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- if (firstElement != null) {
- text = fStatusLineLabelProvider.getText(firstElement);
- image = fStatusLineLabelProvider.getImage((firstElement));
- }
- }
- if (image == null) {
- statusLineManager.setMessage(text);
- }
- else {
- statusLineManager.setMessage(image, text);
- }
- }
- }
-
- /**
- * Returns the signed current selection.
- * The length will be negative if the resulting selection
- * is right-to-left (RtoL).
- * <p>
- * The selection offset is model based.
- * </p>
- *
- * @param sourceViewer the source viewer
- * @return a region denoting the current signed selection, for a resulting RtoL selections length is < 0
- */
- IRegion getSignedSelection(ISourceViewer sourceViewer) {
- StyledText text= sourceViewer.getTextWidget();
- Point selection= text.getSelectionRange();
-
- if (text.getCaretOffset() == selection.x) {
- selection.x= selection.x + selection.y;
- selection.y= -selection.y;
- }
-
- selection.x= widgetOffset2ModelOffset(sourceViewer, selection.x);
-
- return new Region(selection.x, selection.y);
- }
-
- protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer) {
- /* Removed workaround for Bug [206913] source annotations are not painting in source editors.
- * With the new presentation reconciler, we no longer need to force the painting. This
- * actually caused Bug [219776] Wrong annotation display on macs. We forced the
- * Squiggles strategy, even when the native problem underline was specified for annotations */
- return super.getSourceViewerDecorationSupport(viewer);
- }
-
- private void installCharacterPairing() {
- IStructuredModel model = getInternalModel();
- if (model != null) {
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, "characterPairing"); //$NON-NLS-1$
- IContentTypeManager mgr = Platform.getContentTypeManager();
- IContentType type = mgr.getContentType(model.getContentTypeIdentifier());
- if (type != null) {
- for (int i = 0; i < elements.length; i++) {
- // Create the inserter
- IConfigurationElement element = elements[i];
- try {
- IConfigurationElement[] contentTypes = element.getChildren("contentTypeIdentifier");
- for (int j = 0; j < contentTypes.length; j++) {
- String id = contentTypes[j].getAttribute("id");
- if (id != null) {
- IContentType targetType = mgr.getContentType(id);
- int priority = calculatePriority(type, targetType, 0);
- if (priority >= 0) {
- final CharacterPairing pairing = new CharacterPairing();
- pairing.priority = priority;
- String[] partitions = StringUtils.unpack(contentTypes[j].getAttribute("partitions"));
- pairing.partitions = new HashSet(partitions.length);
- // Only add the inserter if there is at least one partition for the content type
- for (int k = 0; k < partitions.length; k++) {
- pairing.partitions.add(partitions[k]);
- }
-
- pairing.inserter = (AbstractCharacterPairInserter) element.createExecutableExtension("class");
- if (pairing.inserter != null && partitions.length > 0) {
- fPairInserter.addInserter(pairing);
- /* use a SafeRunner since this method is also invoked during Part creation */
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- pairing.inserter.initialize();
- }
-
- public void handleException(Throwable exception) {
- // rely on default logging
- }
- });
- }
- }
- }
- }
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
- fPairInserter.prioritize();
- }
- }
- }
-
- /**
- * Calculates the priority of the target content type. The closer <code>targetType</code>
- * is to <code>type</code> the higher its priority.
- *
- * @param type
- * @param targetType
- * @param priority
- * @return
- */
- private int calculatePriority(IContentType type, IContentType targetType, int priority) {
- if (type == null || targetType == null)
- return -1;
- if (type.getId().equals(targetType.getId()))
- return priority;
- return calculatePriority(type.getBaseType(), targetType, ++priority);
- }
-
- /**
- * Installs semantic highlighting on the editor
- */
- private void installSemanticHighlighting() {
- IStructuredModel model = getInternalModel();
- if (fSemanticManager == null && model != null) {
- fSemanticManager = new SemanticHighlightingManager();
- fSemanticManager.install(getSourceViewer(), getPreferenceStore(), getSourceViewerConfiguration(), model.getContentTypeIdentifier());
- }
- }
-
- /**
- * Uninstalls semantic highlighting on the editor and performs cleanup
- */
- private void uninstallSemanticHighlighting() {
- if (fSemanticManager != null) {
- fSemanticManager.uninstall();
- fSemanticManager = null;
- }
- }
-
- private IInformationPresenter configureOutlinePresenter(ISourceViewer sourceViewer, SourceViewerConfiguration config) {
- InformationPresenter presenter = null;
-
- // Get the quick outline configuration
- AbstractQuickOutlineConfiguration cfg = null;
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] ids = getConfigurationPoints();
- for (int i = 0; cfg == null && i < ids.length; i++) {
- cfg = (AbstractQuickOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.QUICKOUTLINECONFIGURATION, ids[i]);
- }
-
- if (cfg != null) {
- presenter = new InformationPresenter(getOutlinePresenterControlCreator(cfg));
- presenter.setDocumentPartitioning(config.getConfiguredDocumentPartitioning(sourceViewer));
- presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
- IInformationProvider provider = new SourceInfoProvider(this);
- String[] contentTypes = config.getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < contentTypes.length; i++) {
- presenter.setInformationProvider(provider, contentTypes[i]);
- }
- presenter.setSizeConstraints(50, 20, true, false);
- }
- return presenter;
- }
-
- /**
- * Returns the outline presenter control creator. The creator is a
- * factory creating outline presenter controls for the given source viewer.
- *
- * @param sourceViewer the source viewer to be configured by this configuration
- * @return an information control creator
- */
- private IInformationControlCreator getOutlinePresenterControlCreator(final AbstractQuickOutlineConfiguration config) {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- int shellStyle = SWT.RESIZE;
- return new QuickOutlinePopupDialog(parent, shellStyle, getInternalModel(), config);
- }
- };
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextInvocationContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextInvocationContext.java
deleted file mode 100644
index 241265c248..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextInvocationContext.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.TextInvocationContext;
-
-/**
- * Provisional API: This class/interface is part of an interim API that is
- * still under development and expected to change significantly before
- * reaching stability. It is being made available at this early stage to
- * solicit feedback from pioneering adopters on the understanding that any
- * code that uses this API will almost certainly be broken (repeatedly) as the
- * API evolves.
- *
- * This class is not intended to be instantiated by clients.
- *
- * Structured Text quick assist invocation context.
- */
-public final class StructuredTextInvocationContext extends TextInvocationContext {
- private Map fAttributes;
-
- /**
- * @param sourceViewer
- * @param offset
- * @param length
- * @param attributes
- */
- public StructuredTextInvocationContext(ISourceViewer sourceViewer, int offset, int length, Map attributes) {
- super(sourceViewer, offset, length);
- fAttributes = attributes;
- }
-
- /**
- * @param attributeName
- * @return the value of this attribute, or <tt>null</tt> when no such
- * attribute is defined or that attribute's value has been set to
- * <tt>null</tt>
- */
- public Object getAttribute(String attributeName) {
- return (fAttributes != null ? fAttributes.get(attributeName) : null);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextMultiPassContentFormatter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextMultiPassContentFormatter.java
deleted file mode 100644
index 88d48e5c97..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextMultiPassContentFormatter.java
+++ /dev/null
@@ -1,123 +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.wst.sse.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TypedPosition;
-import org.eclipse.jface.text.formatter.FormattingContextProperties;
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-
-/**
- * Extends the MultiPassContentFormatter to allow clients to contribute
- * additional slave formatting strategies via the
- * <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension point
- */
-class StructuredTextMultiPassContentFormatter extends MultiPassContentFormatter {
- /**
- * The value of "type" attribute in the provisionalConfiguration element
- */
- private static final String SLAVE_FORMATTING_STRATEGY_EXTENDED_ID = "slaveformattingstrategy"; //$NON-NLS-1$
- /**
- * list of partition types that already have a formatting strategy
- */
- private List fInstalledPartitionTypes;
-
- /**
- * Creates a new content formatter.
- *
- * @param partitioning
- * the document partitioning for this formatter
- * @param type
- * the default content type
- */
- public StructuredTextMultiPassContentFormatter(final String partitioning, final String type) {
- super(partitioning, type);
- }
-
- protected void formatMaster(IFormattingContext context, IDocument document, int offset, int length) {
- // for debugging purposes
- long startTime = System.currentTimeMillis();
-
- super.formatMaster(context, document, offset, length);
-
- if (Logger.DEBUG_FORMAT) {
- long endTime = System.currentTimeMillis();
- System.out.println("formatModel time: " + (endTime - startTime)); //$NON-NLS-1$
- }
- }
-
- /*
- * Overwritten to check for additional slave formatting strategies
- * contributed via the editorConfiguration extension point.
- */
- protected void formatSlave(IFormattingContext context, IDocument document, int offset, int length, String type) {
- List installedTypes = getInstalledPartitionTypes();
- if (installedTypes.contains(type)) {
- // we've already set the slave formatter strategy so just perform
- // as normal
- super.formatSlave(context, document, offset, length, type);
- }
- else {
- boolean findExtendedSlaveFormatter = true;
-
- // need to figure out if there's already a slave formatter set, so
- // just attempt to format as normal
- super.formatSlave(context, document, offset, length, type);
-
- // now, determine if slave formatter was already set by checking
- // context (it would be set if there's already one)
- Object contextPartition = context.getProperty(FormattingContextProperties.CONTEXT_PARTITION);
- if (contextPartition instanceof TypedPosition) {
- String contextType = ((TypedPosition) contextPartition).getType();
- if (contextType == type) {
- // there's already a slave formatter set, so just add it
- // to the list of installed partition types for future
- // reference
- installedTypes.add(type);
- findExtendedSlaveFormatter = false;
- }
- }
- // no slave formatter is set yet, so try to find one contributed
- // via the editorConfiguration extension point
- if (findExtendedSlaveFormatter) {
- Object configuration = ExtendedConfigurationBuilder.getInstance().getConfiguration(SLAVE_FORMATTING_STRATEGY_EXTENDED_ID, type);
- if (configuration instanceof IFormattingStrategy) {
- // found a formatter, so add it in
- setSlaveStrategy((IFormattingStrategy) configuration, type);
- // try to format slave again now that one is set
- super.formatSlave(context, document, offset, length, type);
- }
- // note that we've already checked this partition type for
- // future reference
- installedTypes.add(type);
- }
- }
- }
-
- /**
- * Get the list of partition types that have already been evaluated for
- * slave formatting strategies for this formatter.
- *
- * @return List
- */
- private List getInstalledPartitionTypes() {
- if (fInstalledPartitionTypes == null)
- fInstalledPartitionTypes = new ArrayList();
- return fInstalledPartitionTypes;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
deleted file mode 100644
index 65d733d67c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ /dev/null
@@ -1,719 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.IUndoManager;
-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.hyperlink.IHyperlinkPresenter;
-import org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.InformationPresenter;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
-import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.StructuredTextAnnotationHover;
-import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
-import org.eclipse.wst.sse.ui.internal.correction.CompoundQuickAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer;
-import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
-import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-
-/**
- * Configuration for the source viewer used by StructuredTextEditor.<br />
- * Note: While ISourceViewer is passed in for each get configuration, clients
- * should create a new viewer configuration instance for each instance of
- * source viewer as some methods return the same instance of an object,
- * regardless of the sourceviewer.
- * <p>
- * Clients should subclass and override just those methods which must be
- * specific to their needs.
- * </p>
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor
- * @see org.eclipse.wst.sse.ui.internal.StructuredTextViewer
- * @since 1.0
- */
-public class StructuredTextViewerConfiguration extends TextSourceViewerConfiguration {
- /**
- * One instance per configuration because creating a second assistant that
- * is added to a viewer can cause odd key-eating by the wrong one.
- */
- private StructuredContentAssistant fContentAssistant = null;
-
- /*
- * One instance per configuration because it's just like content assistant
- */
- private IQuickAssistAssistant fQuickAssistant = null;
- /*
- * One instance per configuration
- */
- private IReconciler fReconciler;
- /**
- * Extended configuration provisionalConfiguration type to contribute
- * additional auto edit strategies
- */
- private final String AUTOEDITSTRATEGY = "autoeditstrategy"; //$NON-NLS-1$
-
- private final String CONTENT_ASSIST_SIZE = "contentassistsize";
-
- private ReconcilerHighlighter fHighlighter = null;
-
- /**
- * Creates a structured text viewer configuration.
- */
- public StructuredTextViewerConfiguration() {
- super();
- // initialize fPreferenceStore with same preference store used in
- // StructuredTextEditor
- fPreferenceStore = createCombinedPreferenceStore();
- }
-
- /**
- * Create a preference store that combines the source editor preferences
- * with the base editor's preferences.
- *
- * @return IPreferenceStore
- */
- private IPreferenceStore createCombinedPreferenceStore() {
- IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
- IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
- return new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
- }
-
- /**
- * Note: Clients cannot override this method because this method returns a
- * specially configured Annotation Hover for the StructuredTextViewer
- *
- * (non-Javadoc)
- * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
- */
- final public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
- return new StructuredTextAnnotationHover() {
- protected boolean isIncluded(Annotation annotation) {
- return isShowInVerticalRuler(annotation);
- }
- };
- }
-
- /**
- * Get color for the preference key. Assumes fPreferenceStore is not null.
- *
- * @param key
- * @return Color for preference key or null if none found
- */
- private Color getColor(String key) {
- RGB rgb = PreferenceConverter.getColor(fPreferenceStore, key);
- return EditorUtility.getColor(rgb);
- }
-
- /* (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) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- // add auto edit strategies contributed by clients
- List extendedAutoEdits = ExtendedConfigurationBuilder.getInstance().getConfigurations(AUTOEDITSTRATEGY, contentType);
- if (!extendedAutoEdits.isEmpty()) {
- allStrategies.addAll(extendedAutoEdits);
- }
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
-
- /**
- * Returns the configured partitioning for the given source viewer. The
- * partitioning is used when the querying content types from the source
- * viewer's input document.<br />
- * Note: Clients cannot override this method at this time.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return the configured partitioning
- * @see #getConfiguredContentTypes(ISourceViewer)
- */
- final public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
- /*
- * This implementation returns default structured text partitioning
- */
- return IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
- }
-
- public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) {
- /*
- * This implementation returns configured text hover state masks for
- * StructuredTextViewers
- */
- TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
- int stateMasks[] = new int[hoverDescs.length];
- int stateMasksLength = 0;
- for (int i = 0; i < hoverDescs.length; i++) {
- if (hoverDescs[i].isEnabled()) {
- int j = 0;
- int stateMask = computeStateMask(hoverDescs[i].getModifierString());
- while (j < stateMasksLength) {
- if (stateMasks[j] == stateMask)
- break;
- j++;
- }
- if (j == stateMasksLength)
- stateMasks[stateMasksLength++] = stateMask;
- }
- }
- if (stateMasksLength == hoverDescs.length)
- return stateMasks;
-
- int[] shortenedStateMasks = new int[stateMasksLength];
- System.arraycopy(stateMasks, 0, shortenedStateMasks, 0, stateMasksLength);
- return shortenedStateMasks;
- }
-
- /**
- * Returns the content assistant ready to be used with the given source
- * viewer.<br />
- * Note: The same instance of IContentAssistant is returned regardless of
- * the source viewer passed in.
- * <p>
- * Clients should generally not override this method. Instead, clients
- * wanting to add their own processors should override
- * <code>getContentAssistProcessors(ISourceViewer, String)</code>
- * </p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return a content assistant
- * @see #getContentAssistProcessors(ISourceViewer, String)
- */
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- /*
- * Note: This method was made final so that StructuredContentAssist is
- * always used and content assist extension point always works.
- */
- if (fContentAssistant == null) {
- fContentAssistant = new StructuredContentAssistant();
-
- // content assistant configurations
- fContentAssistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
- fContentAssistant.enableAutoActivation(true);
- fContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
- fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
- fContentAssistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
- fContentAssistant.enableColoredLabels(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS));
-
- // set content assist preferences
- if (fPreferenceStore != null) {
- int delay = fPreferenceStore.getInt(EditorPreferenceNames.CODEASSIST_AUTOACTIVATION_DELAY);
- fContentAssistant.setAutoActivationDelay(delay);
-
- Color color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
- fContentAssistant.setProposalSelectorBackground(color);
-
- color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
- fContentAssistant.setProposalSelectorForeground(color);
-
- color = getColor(EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND);
- fContentAssistant.setContextInformationPopupBackground(color);
- fContentAssistant.setContextSelectorBackground(color);
-
- color = getColor(EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND);
- fContentAssistant.setContextInformationPopupForeground(color);
- fContentAssistant.setContextSelectorForeground(color);
- }
-
- // add content assist processors for each partition type
- String[] types = getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < types.length; i++) {
- String type = types[i];
-
- // add all content assist processors for current partiton type
- IContentAssistProcessor[] processors = getContentAssistProcessors(sourceViewer, type);
- if (processors != null) {
- for (int j = 0; j < processors.length; j++) {
- fContentAssistant.setContentAssistProcessor(processors[j], type);
- }
- }
- }
- IDialogSettings dialogSettings = SSEUIPlugin.getInstance().getDialogSettings();
- if(dialogSettings != null) {
- IDialogSettings section = dialogSettings.getSection(CONTENT_ASSIST_SIZE);
- if(section == null) {
- section = dialogSettings.addNewSection(CONTENT_ASSIST_SIZE);
- }
- fContentAssistant.setRestoreCompletionProposalSize(section);
- }
- }
- return fContentAssistant;
- }
-
- /**
- * <p>Returns a {@link StructuredContentAssistProcessor} which can be contributed to through
- * the <tt>org.eclipse.wst.sse.ui.completionProposal</tt> extension point.</p>
- *
- * <p>If an extender of this class overrides this method and does not include an
- * implementation of a {@link StructuredContentAssistProcessor} in their returned
- * processors then all of the contributions by the aforementioned extension point
- * will be left out.</p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @param partitionType
- * the partition type for which the content assist processors
- * are applicable
- * @return IContentAssistProcessors or null if should not be supported
- */
- protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor processor = new StructuredContentAssistProcessor(
- fContentAssistant, partitionType, sourceViewer, null);
- return new IContentAssistProcessor[]{processor};
- }
-
- /**
- * Returns the content formatter ready to be used with the given source
- * viewer.
- * <p>
- * It is not recommended that clients override this method as it may
- * become <code>final</code> in the future and replaced by an extensible
- * framework.
- * </p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return a content formatter or <code>null</code> if formatting should
- * not be supported
- */
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- // try to use the StructuredTextMultiPassContentFormatter so that it
- // picks up any additional formatting strategies contributed via the
- // editorConfiguration extension point
- IContentFormatter formatter = null;
- if (sourceViewer != null) {
- IDocument document = sourceViewer.getDocument();
- if (document instanceof IDocumentExtension3) {
- String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
- IDocumentPartitioner partitioner = ((IDocumentExtension3) document).getDocumentPartitioner(partitioning);
- if (partitioner instanceof StructuredTextPartitioner) {
- String defaultPartitionType = ((StructuredTextPartitioner) partitioner).getDefaultPartitionType();
- formatter = new StructuredTextMultiPassContentFormatter(partitioning, defaultPartitionType);
- }
- }
- }
-
- return formatter;
- }
-
- /**
- * Returns the double-click strategy ready to be used in this viewer when
- * double clicking onto text of the given content type. Note that if
- * clients want to contribute their own doubleclick strategy, they should
- * use <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension
- * point's <code>doubleClickStrategy</code> element instead of
- * overriding this method. If clients do override this method, please
- * remember to call <code>super.getDoubleClickStrategy()</code>.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @param contentType
- * the content type for which the strategy is applicable
- * @return a double-click strategy or <code>null</code> if double
- * clicking should not be supported
- */
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- ITextDoubleClickStrategy strategy = null;
- Object extendedStrategy = ExtendedConfigurationBuilder.getInstance().getConfiguration(ExtendedConfigurationBuilder.DOUBLECLICKSTRATEGY, contentType);
- if (extendedStrategy instanceof ITextDoubleClickStrategy) {
- strategy = (ITextDoubleClickStrategy) extendedStrategy;
- }
- else {
- strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
- }
- return strategy;
- }
-
- /**
- * Returns the hyperlink presenter for the given source viewer.<br />
- * Note: Clients cannot override this method, and although it's no longer
- * necessary, it must remain for binary compatibility.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return a hyperlink presenter specially configured for
- * StructuredTextViewer
- */
- final public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
- if (fPreferenceStore == null) {
- return super.getHyperlinkPresenter(sourceViewer);
- }
- return new MultipleHyperlinkPresenter(fPreferenceStore);
- }
-
- /**
- * Returns the information control creator. The creator is a factory
- * creating information controls for the given source viewer.<br />
- * Note: Clients cannot override this method at this time.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return the information control creator
- */
- final public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
- // used by hover help
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
- }
- };
- }
-
- /**
- * Returns the information presenter ready to be used with the given
- * source viewer.
- * <p>
- * Clients cannot override this method. Instead, clients wanting to add
- * their own information providers should override
- * <code>getInformationProvider(ISourceViewer, String)</code>
- * </p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return a content assistant
- * @see #getInformationProvider(ISourceViewer, String)
- */
- final public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
- InformationPresenter presenter = new InformationPresenter(getInformationPresenterControlCreator(sourceViewer));
-
- // information presenter configurations
- presenter.setSizeConstraints(60, 10, true, true);
- presenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- // add information providers for each partition type
- String[] types = getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < types.length; i++) {
- String type = types[i];
-
- IInformationProvider provider = getInformationProvider(sourceViewer, type);
- if (provider != null) {
- presenter.setInformationProvider(provider, type);
- }
- }
-
- return presenter;
- }
-
- /**
- * Returns the information provider that will be used for information
- * presentation in the given source viewer and for the given partition
- * type.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @param partitionType
- * the partition type for which the information provider is
- * applicable
- * @return IInformationProvider or null if should not be supported
- * @deprecated instead of overriding this method to provide documentation
- * information, adopters should use the
- * <code>documentationTextHover</code> element in the
- * <code>org.eclipse.wst.sse.ui.editorConfiguration</code>
- * extension point
- */
- protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
- ITextHover bestMatchHover = new BestMatchHover(partitionType);
- return new TextHoverInformationProvider(bestMatchHover);
- }
-
- /**
- * Returns the information presenter control creator. The creator is a
- * factory creating the presenter controls for the given source viewer.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return an information control creator
- */
- private IInformationControlCreator getInformationPresenterControlCreator(ISourceViewer sourceViewer) {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- int shellStyle = SWT.RESIZE | SWT.TOOL;
- int style = SWT.V_SCROLL | SWT.H_SCROLL;
- return new DefaultInformationControl(parent, shellStyle, style, new HTMLTextPresenter(false));
- }
- };
- }
-
- /**
- * Returns the line style providers that will be used for syntax
- * highlighting in the given source viewer.
- * <p>
- * Not fully API since return type LineStyleProvider is not API.
- * </p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @param partitionType
- * the partition type for which the lineStyleProviders are
- * applicable
- * @return LineStyleProvders or null if should not be supported
- */
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return null;
- }
-
- /**
- * See <code>getLineStyleProviders(ISourceViewer, String)</code> for
- * alternative way to provide highlighting information.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return always returns null
- * @see #getLineStyleProviders(ISourceViewer, String)
- */
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- StructuredPresentationReconciler reconciler = new StructuredPresentationReconciler();
- reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- String[] contentTypes = getConfiguredContentTypes(sourceViewer);
-
- if(contentTypes != null) {
- StructuredDocumentDamagerRepairer dr = null;
-
- for (int i = 0; i < contentTypes.length; i++) {
- if (fHighlighter != null) {
- LineStyleProvider provider = fHighlighter.getProvider(contentTypes[i]);
- if (provider == null)
- continue;
-
- dr = new StructuredDocumentDamagerRepairer(provider);
- dr.setDocument(sourceViewer.getDocument());
- reconciler.setDamager(dr, contentTypes[i]);
- reconciler.setRepairer(dr, contentTypes[i]);
- }
- }
- }
-
- return reconciler;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getOverviewRulerAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
- return new StructuredTextAnnotationHover(true) {
- protected boolean isIncluded(Annotation annotation) {
- return isShowInOverviewRuler(annotation);
- }
- };
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
- if (fQuickAssistant == null) {
- IQuickAssistAssistant assistant = new QuickAssistAssistant();
- assistant.setQuickAssistProcessor(new CompoundQuickAssistProcessor());
- assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
-
- // Waiting for color preferences, see:
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=133731
- // set content assist preferences
- if (fPreferenceStore != null) {
- Color color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
- assistant.setProposalSelectorBackground(color);
-
- color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
- assistant.setProposalSelectorForeground(color);
- }
- fQuickAssistant = assistant;
- }
- return fQuickAssistant;
- }
-
- /**
- * Returns the information control creator for the quick assist assistant.
- *
- * @return the information control creator
- */
- private IInformationControlCreator getQuickAssistAssistantInformationControlCreator() {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
- }
- };
- }
-
- /**
- * Returns the reconciler ready to be used with the given source viewer.<br />
- * Note: The same instance of IReconciler is returned regardless of the
- * source viewer passed in.
- * <p>
- * Clients cannot override this method. Instead, clients wanting to add
- * their own reconciling strategy should use the
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
- * extension point.
- * </p>
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return a reconciler
- */
- final public IReconciler getReconciler(ISourceViewer sourceViewer) {
- IReconciler reconciler = null;
-
- if (sourceViewer != null) {
- //Only create reconciler if sourceViewer is present
- if (fReconciler == null && sourceViewer != null) {
- StructuredRegionProcessor newReconciler = new StructuredRegionProcessor();
-
- // reconciler configurations
- newReconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- fReconciler = newReconciler;
- }
- reconciler = fReconciler;
- }
-
- return reconciler;
- }
-
- /**
- * @since 2.0
- * @param treeViewer
- * @return a label provider providing the status line contents
- */
- public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
- return null;
- }
-
- /**
- * Create documentation hovers based on hovers contributed via
- * <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension
- * point
- *
- * @param partitionType
- * @return
- */
- private ITextHover[] createDocumentationHovers(String partitionType) {
- List extendedTextHover = ExtendedConfigurationBuilder.getInstance().getConfigurations(ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER, partitionType);
- ITextHover[] hovers = (ITextHover[]) extendedTextHover.toArray(new ITextHover[extendedTextHover.size()]);
- return hovers;
- }
-
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- ITextHover textHover = null;
-
- /*
- * Returns a default problem, annotation, and best match hover
- * depending on stateMask
- */
- TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
- int i = 0;
- while (i < hoverDescs.length && textHover == null) {
- if (hoverDescs[i].isEnabled() && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- textHover = new ProblemAnnotationHoverProcessor();
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
- textHover = new AnnotationHoverProcessor();
- else if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
- textHover = new BestMatchHover(contentType);
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
- ITextHover[] hovers = createDocumentationHovers(contentType);
- if (hovers.length > 0) {
- textHover = hovers[0];
- }
- }
- }
- i++;
- }
- return textHover;
- }
-
- /**
- * Returns the undo manager for the given source viewer.<br />
- * Note: Clients cannot override this method because this method returns a
- * specially configured undo manager for the StructuredTextViewer.
- *
- * @param sourceViewer
- * the source viewer to be configured by this configuration
- * @return an undo manager specially configured for StructuredTextViewer
- */
- final public IUndoManager getUndoManager(ISourceViewer sourceViewer) {
- /*
- * This implementation returns an UndoManager that is used exclusively
- * in StructuredTextViewer
- */
- return new StructuredTextViewerUndoManager();
- }
-
- public void setHighlighter(ReconcilerHighlighter highlighter) {
- fHighlighter = highlighter;
- }
-
- /**
- * @return the associated content assistnat
- */
- protected StructuredContentAssistant getContentAssistant() {
- return this.fContentAssistant;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java
deleted file mode 100644
index 1564bc57da..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java
+++ /dev/null
@@ -1,200 +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.sse.ui;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-
-/**
- * Undo manager exclusively for StructuredTextViewers ONLY. This undo manager
- * is aware that structured documents have their own undo manager. This
- * handles communication between IUndoManager and IStructuredTextUndoManager.
- */
-class StructuredTextViewerUndoManager implements IUndoManager {
- class UndoNotifier implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- if ((fUndoManager != null) && (event != null)) {
- if (event.getSelection() instanceof ITextSelection) {
- fUndoManager.forceEndOfPendingCommand(this, ((ITextSelection) event.getSelection()).getOffset(), ((ITextSelection) event.getSelection()).getLength());
- }
- }
- }
-
- }
-
- private StructuredTextViewer fTextViewer = null;
- private IStructuredTextUndoManager fUndoManager = null;
- private ISelectionChangedListener fUndoNotifier = new UndoNotifier();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#beginCompoundChange()
- */
- public void beginCompoundChange() {
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- fUndoManager.beginRecording(fTextViewer);
- }
-
- /**
- * Associates a viewer to this undo manager and also attempts to get the
- * correct document-specific undo manager.
- *
- * @param viewer -
- * Assumes viewer instanceof StructuredTextViewer
- */
- public void connect(ITextViewer viewer) {
- // future_TODO could probably optimize this to check if already
- // connected to same viewer/undo manager, dont do anything
-
- // disconnect from any old manager/viewer
- disconnect();
-
- // connect to new viewer/undo manager
- fTextViewer = (StructuredTextViewer) viewer;
- IDocument doc = fTextViewer.getDocument();
- if (doc instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) doc;
- setDocument(structuredDocument);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#disconnect()
- */
- public void disconnect() {
- // disconnect the viewer from the undo manager
- if (fUndoManager != null) {
- fTextViewer.removeSelectionChangedListener(fUndoNotifier);
- fUndoManager.disconnect(fTextViewer);
- }
-
- // null out the viewer and undo manager
- fTextViewer = null;
- fUndoManager = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#endCompoundChange()
- */
- public void endCompoundChange() {
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- fUndoManager.endRecording(fTextViewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#redo()
- */
- public void redo() {
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- fUndoManager.redo(fTextViewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#redoable()
- */
- public boolean redoable() {
- boolean canRedo = false;
-
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- canRedo = fUndoManager.redoable();
-
- return canRedo;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#reset()
- */
- public void reset() {
- // cannot really reset model-based undo manager because other clients
- // will be affected
- }
-
- /**
- * Disconnect from the old undo manager and connect to the undo manager
- * associated with the new document.
- *
- * @param document -
- * assumes document is not null
- */
- public void setDocument(IStructuredDocument document) {
- if (fUndoManager != null) {
- fTextViewer.removeSelectionChangedListener(fUndoNotifier);
- fUndoManager.disconnect(fTextViewer);
- }
-
- fUndoManager = document.getUndoManager();
- if (fUndoManager != null) {
- fUndoManager.connect(fTextViewer);
- fTextViewer.addSelectionChangedListener(fUndoNotifier);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#setMaximalUndoLevel(int)
- */
- public void setMaximalUndoLevel(int undoLevel) {
- // cannot really set maximal undo level on model-based undo manager
- // because other clients will be affected
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#undo()
- */
- public void undo() {
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- fUndoManager.undo(fTextViewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IUndoManager#undoable()
- */
- public boolean undoable() {
- boolean canUndo = false;
-
- // forward the request to the model-based undo manager
- if (fUndoManager != null)
- canUndo = fUndoManager.undoable();
-
- return canUndo;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/TextHoverInformationProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/TextHoverInformationProvider.java
deleted file mode 100644
index b6e2c1f564..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/TextHoverInformationProvider.java
+++ /dev/null
@@ -1,43 +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.wst.sse.ui;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-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.jface.text.information.IInformationProviderExtension2;
-
-class TextHoverInformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
- private ITextHover fTextHover;
-
- public TextHoverInformationProvider(ITextHover hover) {
- fTextHover = hover;
- }
-
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-
- public IInformationControlCreator getInformationPresenterControlCreator() {
- return null;
- }
-
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java
deleted file mode 100644
index 932db6163e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java
+++ /dev/null
@@ -1,24 +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.wst.sse.ui.contentassist;
-
-public abstract class AutoActivationDelegate {
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- public abstract void dispose();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java
deleted file mode 100644
index 9ac2f0cb39..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java
+++ /dev/null
@@ -1,131 +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.wst.sse.ui.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * <p>Helpful class for passing around information about the invocation context
- * of a content assist request</p>
- *
- * @base org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext
- */
-public class CompletionProposalInvocationContext {
- /** the viewer that was used to invoke content assist */
- private final ITextViewer fViewer;
-
- /** the character offset where content assist was invoked in the viewer */
- private final int fInvocationOffset;
-
- /** the partition type where content assist was invoked */
- private String fPartitionType;
-
- /**
- * <p>Create a new context</p>
- *
- * @param viewer {@link ITextViewer} that was used to invoke content assist
- * @param invocationOffset character offset where content assist was invoked in the viewer
- */
- public CompletionProposalInvocationContext(ITextViewer viewer, int invocationOffset) {
- fViewer = viewer;
- fInvocationOffset = invocationOffset;
- fPartitionType = null;
- }
-
- /**
- * @return {@link IDocument} that content assist was invoked on
- */
- public IDocument getDocument() {
- return fViewer.getDocument();
- }
-
- /**
- * @return {@link ITextViewer} that was used to invoke content assist
- */
- public ITextViewer getViewer() {
- return fViewer;
- }
-
- /**
- * @return character offset where content assist was invoked in the viewer
- */
- public int getInvocationOffset() {
- return fInvocationOffset;
- }
-
- /**
- * @return the partition type where content assist was invoked
- */
- public String getInvocationPartitionType() {
- if(fPartitionType == null) {
- fPartitionType = ""; //$NON-NLS-1$
- try {
- fPartitionType = this.getDocument().getPartition(this.fInvocationOffset).getType();
- } catch (BadLocationException e) {
- // should never happen, nothing we can do about it if it does
- Logger.logException("Could not get the partition type at content assist invocation offset", e); //$NON-NLS-1$
- }
- }
- return fPartitionType;
- }
-
- /**
- * <p>Invocation contexts are equal if they describe the same context and are of the same type.
- * This implementation checks for <code>null</code> values and class equality. Subclasses
- * should extend this method by adding checks for their context relevant fields (but not
- * necessarily cached values).</p>
- * <p>
- * Example:
- *
- * <pre>
- * class MyContext extends ContentAssistInvocationContext {
- * private final Object fState;
- * private Object fCachedInfo;
- *
- * ...
- *
- * public boolean equals(Object obj) {
- * if (!super.equals(obj))
- * return false;
- * MyContext other= (MyContext) obj;
- * return fState.equals(other.fState);
- * }
- * }
- * </pre>
- *
- * </p>
- * <p>
- * Subclasses should also extend {@link Object#hashCode()}.
- * </p>
- *
- * @param obj {@inheritDoc}
- * @return {@inheritDoc}
- */
- public boolean equals(Object obj) {
- boolean equal = false;
- if(obj instanceof CompletionProposalInvocationContext) {
- CompletionProposalInvocationContext other = (CompletionProposalInvocationContext) obj;
- equal = (fViewer == null && other.fViewer == null || fViewer != null && fViewer.equals(other.fViewer)) &&
- fInvocationOffset == other.fInvocationOffset;
- }
- return equal;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return 23459213 << 5 | (fViewer == null ? 0 : fViewer.hashCode() << 3) | fInvocationOffset;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java
deleted file mode 100644
index b4f608a5ce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java
+++ /dev/null
@@ -1,72 +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.wst.sse.ui.contentassist;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-
-/**
- * <p>Computes completions and context information displayed by the SSE editor content assistant.
- * Contributions to the <tt>org.eclipse.wst.sse.ui.completionProposal</tt> extension point
- * must implement this interface.</p>
- *
- * @base org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
- */
-public interface ICompletionProposalComputer {
- /**
- * Informs the computer that a content assist session has started. This call will always be
- * followed by a {@link #sessionEnded()} call, but not necessarily by calls to
- * {@link #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor) computeCompletionProposals}
- * or
- * {@link #computeContextInformation(CompletionProposalInvocationContext, IProgressMonitor) computeContextInformation}.
- */
- void sessionStarted();
-
- /**
- * Returns a list of completion proposals valid at the given invocation context.
- *
- * @param context the context of the content assist invocation
- * @param monitor a progress monitor to report progress. The monitor is private to this
- * invocation, i.e. there is no need for the receiver to spawn a sub monitor.
- * @return a list of completion proposals (element type: {@link ICompletionProposal})
- */
- List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor);
-
- /**
- * Returns context information objects valid at the given invocation context.
- *
- * @param context the context of the content assist invocation
- * @param monitor a progress monitor to report progress. The monitor is private to this
- * invocation, i.e. there is no need for the receiver to spawn a sub monitor.
- * @return a list of context information objects (element type: {@link IContextInformation})
- */
- List computeContextInformation(CompletionProposalInvocationContext context, IProgressMonitor monitor);
-
- /**
- * Returns the reason why this computer was unable to produce any completion proposals or
- * context information.
- *
- * @return an error message or <code>null</code> if no error occurred
- */
- String getErrorMessage();
-
- /**
- * Informs the computer that a content assist session has ended. This call will always be after
- * any calls to
- * {@linkplain #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor) computeCompletionProposals}
- * and
- * {@linkplain #computeContextInformation(CompletionProposalInvocationContext, IProgressMonitor) computeContextInformation}.
- */
- void sessionEnded();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java
deleted file mode 100644
index 78efc28069..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java
+++ /dev/null
@@ -1,943 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.LegacyActionTools;
-import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.bindings.keys.KeySequence;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistEvent;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ICompletionListener;
-import org.eclipse.jface.text.contentassist.ICompletionListenerExtension;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistantExtension2;
-import org.eclipse.jface.text.contentassist.IContentAssistantExtension3;
-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.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-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.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalComputerRegistry;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompoundContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContextInformationValidator;
-import org.eclipse.wst.sse.ui.internal.contentassist.OptionalMessageDialog;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-
-
-/**
- * <p>A content assist processor that aggregates the proposals of the
- * {@link org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer}s contributed via the
- * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.</p>
- * <p>
- * Extenders may extend:
- * <ul>
- * <li>{@link #propertyChange(PropertyChangeEvent)}to react to property change events
- * that occur in the {@link IPreferenceStore} given to the constructor in case the behavior
- * of the processor needs to change according to user preferences</li>
- * <li>{@link #getCompletionProposalAutoActivationCharacters()}</li>
- * <li>{@link #getContextInformationAutoActivationCharacters()}</li>
- * <li>{@link #filterAndSortProposals(List, IProgressMonitor, CompletionProposalInvocationContext)}
- * to add sorting and filtering</li>
- * <li>{@link #filterAndSortContextInformation(List, IProgressMonitor)} to add sorting and filtering</li>
- * <li>{@link #createProgressMonitor()} to change the way progress is reported</li>
- * <li>{@link #createContext(ITextViewer, int)} to provide the context object
- * passed to the computers</li>
- * <li>{@link #getContextInformationValidator()} to add context validation (needed if any
- * contexts are provided)</li>
- * <li>{@link #getErrorMessage()} to change error reporting</li>
- * </ul>
- * </p>
- *
- * @base org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor
- */
-public class StructuredContentAssistProcessor implements IContentAssistProcessor, IPropertyChangeListener, IReleasable {
-
- /** Legacy editor configuration extension point. */
- private static final String CONTENT_ASSIST_PROCESSOR_EXTENDED_ID = "contentassistprocessor"; //$NON-NLS-1$
-
- /** Content assist processors added through the now legacy editor configuration extension point */
- private List fLegacyExtendedContentAssistProcessors;
-
- /**
- * Dialog settings key for the "all categories are disabled" warning dialog. See
- * {@link OptionalMessageDialog}.
- */
- private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY= "EmptyDefaultAssistCategory"; //$NON-NLS-1$
-
- /**
- * Used to sort categories by their page order so they are cycled in the correct order
- */
- private final Comparator PAGE_ORDER_COMPARATOR = new Comparator() {
- public int compare(Object o1, Object o2) {
- CompletionProposalCategory d1= (CompletionProposalCategory) o1;
- CompletionProposalCategory d2= (CompletionProposalCategory) o2;
-
- return d1.getPageSortRank(fContentTypeID) - d2.getPageSortRank(fContentTypeID);
- }
- };
-
- /**
- * Used to sort categories by their default page order so they are
- * ordered correctly on the default page
- */
- private final Comparator DEFAULT_PAGE_ORDER_COMPARATOR = new Comparator() {
- public int compare(Object o1, Object o2) {
- CompletionProposalCategory d1= (CompletionProposalCategory) o1;
- CompletionProposalCategory d2= (CompletionProposalCategory) o2;
-
- return d1.getDefaultPageSortRank(fContentTypeID) - d2.getDefaultPageSortRank(fContentTypeID);
- }
- };
-
- /** List of {@link CompletionProposalCategory}s supported by this processor */
- private List fCategories;
-
- /** content type ID this processor is associated with */
- String fContentTypeID;
-
- /** partition type ID this processor is associated with */
- private final String fPartitionTypeID;
-
- /** Content assistant used for giving the user status messages and listening to completion results*/
- private ContentAssistant fAssistant;
-
- /* cycling stuff */
- private int fRepetition= -1;
- private List fCategoryIteration = null;
- private String fIterationGesture = null;
- private int fNumberOfComputedResults = 0;
- private String fErrorMessage;
-
- /** Optionally specified preference store for listening to property change events */
- private IPreferenceStore fPreferenceStore;
-
- /** The viewer this processor is associated with */
- private ITextViewer fViewer;
-
- /**
- * the {@link ITextInputListener} used to set the content type when
- * a document is set for this processors associated viewer.
- */
- private ITextInputListener fTextInputListener;
-
- private CompletionListener fCompletionListener;
-
- /** the context information validator for this processor */
- private IContextInformationValidator fContextInformationValidator;
-
- private AutoActivationDelegate fAutoActivation;
-
- /**
- * <p>Create a new content assist processor for a specific partition type.
- * The content type will be determined when a document is set on the viewer</p>
- *
- * <p>If the given {@link IPreferenceStore} is not <code>null</code> then this
- * processor will be registered as a {@link IPropertyChangeListener} on the given store
- * so that implementers of this class can change the way the processor acts based on
- * user preferences</p>
- *
- * @param assistant {@link ContentAssistant} to use
- * @param partitionTypeID the partition type this processor is for
- * @param viewer {@link ITextViewer} this processor is acting in
- * @param preferenceStore This processor will be registered as a {@link IPropertyChangeListener}
- * on this store and the processor itself will take care of removing itself as a listener, if
- * <code>null</code> then will not be registered as a {@link IPropertyChangeListener}
- */
- public StructuredContentAssistProcessor(ContentAssistant assistant, String partitionTypeID,
- ITextViewer viewer, IPreferenceStore preferenceStore) {
-
- Assert.isNotNull(partitionTypeID);
- Assert.isNotNull(assistant);
-
- //be sure the registry has been loaded, none blocking
- CompletionProposalComputerRegistry.getDefault().initialize();
-
- //register on the preference store
- this.fPreferenceStore = preferenceStore;
- if(this.fPreferenceStore != null) {
- this.fPreferenceStore.addPropertyChangeListener(this);
- }
-
- //The content type can not be determined until a document has been set
- this.fContentTypeID = null;
- this.fViewer = viewer;
- if(viewer != null) {
- this.fTextInputListener = new TextInputListener();
- viewer.addTextInputListener(this.fTextInputListener);
-
- if(viewer.getDocument() != null) {
- /* it is highly unlike the document has already been set, but check
- * just for sanity
- */
- this.fTextInputListener.inputDocumentChanged(null, viewer.getDocument());
- }
- }
-
- //set the associated partition type
- this.fPartitionTypeID = partitionTypeID;
-
- //add completion listener
- fAssistant = assistant;
- fCompletionListener = new CompletionListener();
- fAssistant.addCompletionListener(fCompletionListener);
-
- //lazy load these to speed up initial editor opening
- fLegacyExtendedContentAssistProcessors = null;
- fCategories = null;
- }
-
- /**
- * <p>Collect the proposals using the extension points</p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
- */
- public final ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- clearState();
-
- IProgressMonitor monitor= createProgressMonitor();
- monitor.beginTask(SSEUIMessages.ContentAssist_computing_proposals, getProposalCategories().size() + 1);
-
- CompletionProposalInvocationContext context = createContext(viewer, offset);
-
- monitor.subTask(SSEUIMessages.ContentAssist_collecting_proposals);
- List proposals = collectProposals(viewer, offset, monitor, context);
-
- monitor.subTask(SSEUIMessages.ContentAssist_sorting_proposals);
- List filtered = filterAndSortProposals(proposals, monitor, context);
- fNumberOfComputedResults= filtered.size();
-
- ICompletionProposal[] result= (ICompletionProposal[]) filtered.toArray(new ICompletionProposal[filtered.size()]);
- monitor.done();
-
- return result;
- }
-
- /**
- * <p>Collect the context information using the extension points</p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- clearState();
-
- IProgressMonitor monitor= createProgressMonitor();
- monitor.beginTask(SSEUIMessages.ContentAssist_computing_contexts, getProposalCategories().size() + 1);
-
- monitor.subTask(SSEUIMessages.ContentAssist_collecting_contexts);
- List proposals= collectContextInformation(viewer, offset, monitor);
-
- monitor.subTask(SSEUIMessages.ContentAssist_sorting_contexts);
- List filtered= filterAndSortContextInformation(proposals, monitor);
- fNumberOfComputedResults= filtered.size();
-
- IContextInformation[] result= (IContextInformation[]) filtered.toArray(new IContextInformation[filtered.size()]);
- monitor.done();
- return result;
- }
-
- /**
- * <p>Default implementation is to return <code>null</code></p>
- * <p>Extenders may override</p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return (fAutoActivation != null) ? fAutoActivation.getCompletionProposalAutoActivationCharacters() : null;
- }
-
- /**
- * <p>Default implementation is to return <code>null</code></p>
- * <p>Extenders may override</p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return (fAutoActivation != null) ? fAutoActivation.getContextInformationAutoActivationCharacters() : null;
- }
-
- /**
- * <p>Extenders may override this function to change error reporting</p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- if (fErrorMessage != null)
- return fErrorMessage;
- if (fNumberOfComputedResults > 0)
- return null;
- return SSEUIMessages.ContentAssist_no_completions;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- if (this.fContextInformationValidator == null) {
- this.fContextInformationValidator = new ContextInformationValidator();
- }
- return this.fContextInformationValidator;
- }
-
- public void install(ITextViewer viewer) {
- if (fPreferenceStore != null) {
- fPreferenceStore.addPropertyChangeListener(this);
- }
- if (fViewer != null) {
- fViewer.removeTextInputListener(fTextInputListener);
- }
- fViewer = viewer;
- if (fViewer != null) {
- fViewer.addTextInputListener(fTextInputListener);
- }
- if (fAssistant != null) {
- fAssistant.addCompletionListener(fCompletionListener);
- }
- }
-
- /**
- * <p>Extenders may override, but should always be sure to call the super implementation</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
- */
- public void release() {
- if (fAutoActivation != null) {
- fAutoActivation.dispose();
- fAutoActivation = null;
- }
- if(this.fPreferenceStore != null) {
- this.fPreferenceStore.removePropertyChangeListener(this);
- }
-
- if(this.fViewer != null) {
- this.fViewer.removeTextInputListener(this.fTextInputListener);
- this.fViewer = null;
- }
- if (this.fAssistant != null) {
- this.fAssistant.removeCompletionListener(fCompletionListener);
- }
- }
-
- /**
- * <p>Intended to be overridden by extenders wishing to change the behavior
- * of the processor based on user preferences from the store optionally
- * associated with this processor. If no store was given to the constructor
- * when creating this assistant then this method will never be invoked.</p>
- *
- * <p>The default implementation does not react to the events in any way</p>
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- }
-
- /**
- * <p>Filters and sorts the proposals. The passed list may be modified
- * and returned, or a new list may be created and returned.</p>
- *
- * <p>The default implementation does not do any sorting or filtering.</p>
- * <p>Extenders may override this function.</p>
- *
- * @param proposals the list of collected proposals (element type:
- * {@link ICompletionProposal})
- * @param monitor a progress monitor
- * @param context TODO
- * @return the list of filtered and sorted proposals, ready for
- * display (element type: {@link ICompletionProposal})
- */
- protected List filterAndSortProposals(List proposals, IProgressMonitor monitor, CompletionProposalInvocationContext context) {
- return proposals;
- }
-
- /**
- * <p>Filters and sorts the context information objects. The passed
- * list may be modified and returned, or a new list may be created
- * and returned.</p>
- *
- * <p>The default implementation does not do any sorting or filtering</p>
- * <p>Extenders may override this method</p>
- *
- * @param contexts the list of collected proposals (element type:
- * {@link IContextInformation})
- * @param monitor a progress monitor
- * @return the list of filtered and sorted proposals, ready for
- * display (element type: {@link IContextInformation})
- */
- protected List filterAndSortContextInformation(List contexts, IProgressMonitor monitor) {
- return contexts;
- }
-
- /**
- * <p>Creates a progress monitor.</p>
- * <p>The default implementation creates a {@link NullProgressMonitor}.</p>
- *
- * <p>Extenders may override this method</p>
- *
- * @return a progress monitor
- */
- protected IProgressMonitor createProgressMonitor() {
- return new NullProgressMonitor();
- }
-
- /**
- * <p>Creates the context that is passed to the completion proposal
- * computers.</p>
- *
- * <p>Extenders may override this method</p>
- *
- * @param viewer the viewer that content assist is invoked on
- * @param offset the content assist offset
- * @return the context to be passed to the computers
- */
- protected CompletionProposalInvocationContext createContext(ITextViewer viewer, int offset) {
- return new CompletionProposalInvocationContext(viewer, offset);
- }
-
- /**
- * @return the associated preference store
- */
- protected IPreferenceStore getPreferenceStore() {
- return this.fPreferenceStore;
- }
-
- /**
- * Clears the state
- */
- private void clearState() {
- fErrorMessage=null;
- fNumberOfComputedResults= 0;
- }
-
- /**
- * <p>Collects the proposals from the extensions.</p>
- *
- * @param viewer the text viewer
- * @param offset the offset
- * @param monitor the progress monitor
- * @param context the code assist invocation context
- * @return the list of proposals
- */
- private List collectProposals(ITextViewer viewer, int offset, IProgressMonitor monitor, CompletionProposalInvocationContext context) {
- List proposals = new ArrayList();
- List categories = getCategories();
- for (Iterator it = categories.iterator(); it.hasNext();) {
- CompletionProposalCategory cat = (CompletionProposalCategory) it.next();
- List computed = cat.computeCompletionProposals(context, this.fContentTypeID, this.fPartitionTypeID, new SubProgressMonitor(monitor, 1));
- proposals.addAll(computed);
- if (fErrorMessage == null) {
- fErrorMessage= cat.getErrorMessage();
- }
- }
-
- // if default page
- // Deal with adding in proposals from processors added through the legacy extension
- if (isFirstPage() && getLegacyExtendedContentAssistProcessors() != null &&
- !getLegacyExtendedContentAssistProcessors().isEmpty()) {
-
- Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
- while (iter.hasNext()) {
- IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
- ICompletionProposal[] legacyComputed = legacyProcessor.computeCompletionProposals(viewer, offset);
- if (legacyComputed != null) {
- proposals.addAll(Arrays.asList(legacyComputed));
- }
- }
- }
-
- return proposals;
- }
-
- /**
- * <p>Collects the context information from the extensions.</p>
- *
- * @param viewer
- * @param offset
- * @param monitor
- * @return
- */
- private List collectContextInformation(ITextViewer viewer, int offset, IProgressMonitor monitor) {
- List proposals = new ArrayList();
- CompletionProposalInvocationContext context= createContext(viewer, offset);
-
- List providers= getCategories();
- for (Iterator it= providers.iterator(); it.hasNext();) {
- CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
- List computed= cat.computeContextInformation(context, this.fContentTypeID, this.fPartitionTypeID, new SubProgressMonitor(monitor, 1));
- proposals.addAll(computed);
- if (fErrorMessage == null) {
- fErrorMessage= cat.getErrorMessage();
- }
- }
-
- // Deal with adding in contexts from processors added through the legacy extension
- if (getLegacyExtendedContentAssistProcessors() != null &&
- !getLegacyExtendedContentAssistProcessors().isEmpty()) {
-
- Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
- while (iter.hasNext()) {
- IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
- IContextInformation[] legacyComputed = legacyProcessor.computeContextInformation(viewer, offset);
- if(legacyComputed != null) {
- proposals.addAll(Arrays.asList(legacyComputed));
- }
- }
- }
-
- return proposals;
- }
-
- /**
- * @return the next set of categories
- */
- private List getCategories() {
- List categories;
- if (fCategoryIteration == null) {
- categories = getProposalCategories();
- } else {
- int iteration= fRepetition % fCategoryIteration.size();
- fAssistant.setStatusMessage(createIterationMessage());
- fAssistant.setEmptyMessage(createEmptyMessage());
- fRepetition++;
-
- categories = (List) fCategoryIteration.get(iteration);
- }
-
- return categories;
- }
-
- /**
- * This may show the warning dialog if all categories are disabled
- */
- private void resetCategoryIteration() {
- fCategoryIteration = getCategoryIteration();
- }
-
- /**
- * @return {@link List} of {@link List}s of {@link CompletionProposalCategory}s, this is
- * the ordered list of the completion categories to cycle through
- */
- private List getCategoryIteration() {
- List sequence= new ArrayList();
- sequence.add(getDefaultCategories());
- for (Iterator it= getSortedOwnPageCategories().iterator(); it.hasNext();) {
- CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
- sequence.add(Collections.singletonList(cat));
- }
- return sequence;
- }
-
- /**
- * @return the sorted categories for the default page
- */
- private List getDefaultCategories() {
- // default mix - enable all included computers
- List included= getDefaultCategoriesUnchecked();
-
- if (included.size() == 0 && CompletionProposalComputerRegistry.getDefault().hasUninstalledComputers()) {
- if (informUserAboutEmptyDefaultCategory()) {
- // preferences were restored - recompute the default categories
- included= getDefaultCategoriesUnchecked();
- }
- CompletionProposalComputerRegistry.getDefault().resetUnistalledComputers();
- }
-
- Collections.sort(included, DEFAULT_PAGE_ORDER_COMPARATOR);
-
- return included;
- }
-
- /**
- * <p>Gets the default categories with no error checking.</p>
- *
- * @return the default {@link CompletionProposalCategory}s
- */
- private List getDefaultCategoriesUnchecked() {
- List included = new ArrayList();
- for (Iterator it = getProposalCategories().iterator(); it.hasNext();) {
- CompletionProposalCategory category = (CompletionProposalCategory) it.next();
- if (category.isIncludedOnDefaultPage(this.fContentTypeID) && category.hasComputers(fContentTypeID, fPartitionTypeID))
- included.add(category);
- }
- return included;
- }
-
- /**
- * <p>Informs the user about the fact that there are no enabled categories in the default content
- * assist set and shows a link to the preferences.</p>
- *
- * @return <code>true</code> if the default should be restored
- */
- private boolean informUserAboutEmptyDefaultCategory() {
- /*If warn about empty default category and there are associated properties for this
- * processors content type and those properties have an associated properties page then
- * display warning message to user.
- */
- ICompletionProposalCategoriesConfigurationReader properties = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(this.fContentTypeID);
- if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY) &&
- properties instanceof ICompletionProposalCategoriesConfigurationWriter &&
- ((ICompletionProposalCategoriesConfigurationWriter)properties).hasAssociatedPropertiesPage()) {
-
- ICompletionProposalCategoriesConfigurationWriter propertiesExtension = (ICompletionProposalCategoriesConfigurationWriter)properties;
-
- final Shell shell= SSEUIPlugin.getActiveWorkbenchShell();
- String title= SSEUIMessages.ContentAssist_all_disabled_title;
- String message= SSEUIMessages.ContentAssist_all_disabled_message;
- // see PreferencePage#createControl for the 'defaults' label
- final String restoreButtonLabel= JFaceResources.getString("defaults"); //$NON-NLS-1$
- final String linkMessage= NLS.bind(SSEUIMessages.ContentAssist_all_disabled_preference_link, LegacyActionTools.removeMnemonics(restoreButtonLabel));
- final int restoreId= IDialogConstants.CLIENT_ID + 10;
- final int settingsId= IDialogConstants.CLIENT_ID + 11;
- final OptionalMessageDialog dialog= new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
- /*
- * @see org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createCustomArea(Composite composite) {
- // wrap link and checkbox in one composite without space
- Composite parent= new Composite(composite, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.verticalSpacing= 0;
- parent.setLayout(layout);
-
- Composite linkComposite= new Composite(parent, SWT.NONE);
- layout= new GridLayout();
- layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- linkComposite.setLayout(layout);
-
- Link link= new Link(linkComposite, SWT.NONE);
- link.setText(linkMessage);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setReturnCode(settingsId);
- close();
- }
- });
- GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
- gridData.widthHint= this.getMinimumMessageWidth();
- link.setLayoutData(gridData);
-
- // create checkbox and "don't show this message" prompt
- super.createCustomArea(parent);
-
- return parent;
- }
-
- /*
- * @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- Button[] buttons= new Button[2];
- buttons[0]= createButton(parent, restoreId, restoreButtonLabel, false);
- buttons[1]= createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
- setButtons(buttons);
- }
- };
- int returnValue = dialog.open();
-
- //based on user actions either reset defaults or open preference dialog
- if (restoreId == returnValue || settingsId == returnValue) {
- if (restoreId == returnValue) {
- propertiesExtension.loadDefaults();
- propertiesExtension.saveConfiguration();
- }
- if (settingsId == returnValue) {
- PreferencesUtil.createPreferenceDialogOn(shell,
- propertiesExtension.getPropertiesPageID(), null, null).open();
- }
-
- return true;
- }
- }
- return false;
- }
-
- /**
- * @return a sorted {@link List} of {@link CompletionProposalCategory}s that
- * should be displayed on their own content assist page
- */
- private List getSortedOwnPageCategories() {
- ArrayList sorted= new ArrayList();
- for (Iterator it= getProposalCategories().iterator(); it.hasNext();) {
- CompletionProposalCategory category= (CompletionProposalCategory) it.next();
- if (category.isDisplayedOnOwnPage(this.fContentTypeID) &&
- category.hasComputers(fContentTypeID, fPartitionTypeID)) {
-
- sorted.add(category);
- }
- }
- Collections.sort(sorted, PAGE_ORDER_COMPARATOR);
- return sorted;
- }
-
- /**
- * @return a user message describing that there are no content assist suggestions for the current page
- */
- private String createEmptyMessage() {
- return NLS.bind(SSEUIMessages.ContentAssist_no_message, new String[]{getCategoryLabel(fRepetition)});
- }
-
- /**
- * @return user message describing what the next page of content assist holds
- */
- private String createIterationMessage() {
- return NLS.bind(SSEUIMessages.ContentAssist_toggle_affordance_update_message,
- new String[]{ getCategoryLabel(fRepetition), fIterationGesture, getCategoryLabel(fRepetition + 1) });
- }
-
- /**
- * @param repetition which category to get the label for
- * @return the label of the category
- */
- private String getCategoryLabel(int repetition) {
- int iteration= (fCategoryIteration != null ? repetition % fCategoryIteration.size() : 0);
- if (iteration == 0)
- return SSEUIMessages.ContentAssist_defaultProposalCategory_title;
- return ((CompletionProposalCategory) ((List) fCategoryIteration.get(iteration)).get(0)).getDisplayName();
- }
-
- /**
- * @return {@link String} representing the user command to iterate to the next page
- */
- private String getIterationGesture() {
- TriggerSequence binding= getIterationBinding();
- return binding != null ?
- NLS.bind(SSEUIMessages.ContentAssist_press, new Object[] { binding.format() })
- : SSEUIMessages.ContentAssist_click;
- }
-
- /**
- * @return {@link KeySequence} used by user to iterate to the next page
- */
- private KeySequence getIterationBinding() {
- final IBindingService bindingSvc= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
- TriggerSequence binding= bindingSvc.getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- if (binding instanceof KeySequence)
- return (KeySequence) binding;
- return null;
- }
-
- /**
- * @return <code>true</code> if displaying first page, <code>false</code> otherwise
- */
- private boolean isFirstPage() {
- return fCategoryIteration == null || fCategoryIteration.size() == 1 || fRepetition % fCategoryIteration.size() == 1;
- }
-
- /**
- * <p><b>NOTE: </b>This method should be used over accessing the
- * {@link #fLegacyExtendedContentAssistProcessors} field directly so as to
- * facilitate the lazy initialization of the field.</p>
- *
- * @return the legacy extended content assist processors
- */
- private List getLegacyExtendedContentAssistProcessors() {
- if(fLegacyExtendedContentAssistProcessors == null) {
- fLegacyExtendedContentAssistProcessors =
- ExtendedConfigurationBuilder.getInstance().getConfigurations(
- CONTENT_ASSIST_PROCESSOR_EXTENDED_ID, fPartitionTypeID);
- }
-
- return fLegacyExtendedContentAssistProcessors;
- }
-
- /**
- * <p><b>NOTE: </b>This method should be used over accessing the {@link #fCategories}
- * field directly so as to facilitate the lazy initialization of the field.</p>
- *
- * @return the categories associated with the content type this processor is associated with
- */
- private List getProposalCategories() {
- if(fCategories == null) {
- fCategories =
- CompletionProposalComputerRegistry.getDefault().getProposalCategories(fContentTypeID);
- }
-
- return fCategories;
- }
-
- /**
- * The completion listener class for this processor.
- */
- private final class CompletionListener implements ICompletionListener, ICompletionListenerExtension {
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
- */
- public void assistSessionStarted(ContentAssistEvent event) {
- if (event.processor == StructuredContentAssistProcessor.this ||
- (event.processor instanceof CompoundContentAssistProcessor &&
- ((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {
-
- fIterationGesture= getIterationGesture();
- KeySequence binding= getIterationBinding();
-
- // This may show the warning dialog if all categories are disabled
- resetCategoryIteration();
- for (Iterator it= StructuredContentAssistProcessor.this.getProposalCategories().iterator(); it.hasNext();) {
- CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
- cat.sessionStarted();
- }
-
- fRepetition= 0;
- if (event.assistant instanceof IContentAssistantExtension2) {
- IContentAssistantExtension2 extension= (IContentAssistantExtension2) event.assistant;
-
- if (fCategoryIteration.size() == 1) {
- extension.setRepeatedInvocationMode(false);
- extension.setShowEmptyList(false);
- } else {
- extension.setRepeatedInvocationMode(true);
- extension.setStatusLineVisible(true);
- extension.setStatusMessage(createIterationMessage());
- extension.setShowEmptyList(true);
- if (extension instanceof IContentAssistantExtension3) {
- IContentAssistantExtension3 ext3= (IContentAssistantExtension3) extension;
- ((ContentAssistant) ext3).setRepeatedInvocationTrigger(binding);
- }
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent)
- */
- public void assistSessionEnded(ContentAssistEvent event) {
- if (event.processor == StructuredContentAssistProcessor.this || (event.processor instanceof CompoundContentAssistProcessor && ((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {
- for (Iterator it= StructuredContentAssistProcessor.this.getProposalCategories().iterator(); it.hasNext();) {
- CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
- cat.sessionEnded();
- }
-
- fCategoryIteration= null;
- fRepetition= -1;
- fIterationGesture= null;
- if (event.assistant instanceof IContentAssistantExtension2) {
- IContentAssistantExtension2 extension= (IContentAssistantExtension2) event.assistant;
- extension.setShowEmptyList(false);
- extension.setRepeatedInvocationMode(false);
- extension.setStatusLineVisible(false);
- if (extension instanceof IContentAssistantExtension3) {
- IContentAssistantExtension3 ext3= (IContentAssistantExtension3) extension;
- ((ContentAssistant) ext3).setRepeatedInvocationTrigger(null);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionListener#selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)
- */
- public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {
- //ignore
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionListenerExtension#assistSessionRestarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
- */
- public void assistSessionRestarted(ContentAssistEvent event) {
- fRepetition= 0;
- }
- }
-
- /**
- *
- */
- private class TextInputListener implements ITextInputListener {
-
- /**
- * <p>Set the content type based on the new document if it has not already been
- * set yet.</p>
- *
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- if(fContentTypeID == null) {
- if(newInput instanceof IStructuredDocument) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)newInput);
- if(model != null) {
- fContentTypeID = model.getContentTypeIdentifier();
- if (fAutoActivation != null) {
- fAutoActivation.dispose();
- }
- fAutoActivation = CompletionProposalComputerRegistry.getDefault().getActivator(fContentTypeID, fPartitionTypeID);
- }
- } finally {
- if(model != null) {
- model.releaseFromRead();
- }
- }
- }
- }
- }
-
- /**
- * <p>Ignored</p>
- *
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentAboutToBeChanged(IDocument oldInput,
- IDocument newInput) {
- //ignore
- }
- }
-
- protected void setAutoActivationDelay(int delay) {
- fAssistant.setAutoActivationDelay(delay);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java
deleted file mode 100644
index cd54849831..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java
+++ /dev/null
@@ -1,94 +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.sse.ui.internal;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-/**
- */
-public abstract class AbstractDropAction implements IDropAction {
-
- /*
- * Replaces targetEditor's current selection by "text"
- */
- protected boolean insert(String text, IEditorPart targetEditor) {
- if (text == null || text.length() == 0) {
- return true;
- }
-
- ITextSelection textSelection = null;
- IDocument doc = null;
- ISelection selection = null;
-
- ISourceEditingTextTools tools = (ISourceEditingTextTools) targetEditor.getAdapter(ISourceEditingTextTools.class);
- if (tools != null) {
- doc = tools.getDocument();
- selection = tools.getSelection();
- }
-
- ITextEditor textEditor = null;
- if (targetEditor instanceof ITextEditor) {
- textEditor = (ITextEditor) targetEditor;
- }
- if (textEditor == null) {
- textEditor = (ITextEditor) ((IAdaptable) targetEditor).getAdapter(ITextEditor.class);
- }
- if (textEditor == null && tools != null && tools.getEditorPart() instanceof ITextEditor) {
- textEditor = (ITextEditor) tools.getEditorPart();
- }
- if (textEditor == null && tools != null && tools.getEditorPart() != null) {
- textEditor = (ITextEditor) tools.getEditorPart().getAdapter(ITextEditor.class);
- }
-
- if (selection == null && textEditor != null) {
- selection = textEditor.getSelectionProvider().getSelection();
- }
- if (doc == null && textEditor != null) {
- doc = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- }
-
- if (selection instanceof ITextSelection) {
- textSelection = (ITextSelection) selection;
- try {
- doc.replace(textSelection.getOffset(), textSelection.getLength(), text);
- }
- catch (BadLocationException e) {
- return false;
- }
- }
- if (textEditor != null && textSelection != null) {
- ISelectionProvider sp = textEditor.getSelectionProvider();
- ITextSelection sel = new TextSelection(textSelection.getOffset(), text.length());
- sp.setSelection(sel);
- textEditor.selectAndReveal(sel.getOffset(), sel.getLength());
- }
-
- return true;
- }
-
- public boolean isSupportedData(Object data) {
- return true;
- }
-
- public abstract boolean run(DropTargetEvent event, IEditorPart targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java
deleted file mode 100644
index 33f0311667..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java
+++ /dev/null
@@ -1,284 +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.sse.ui.internal;
-
-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.swt.SWT;
-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.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.view.events.CaretEvent;
-import org.eclipse.wst.sse.ui.internal.view.events.ICaretListener;
-
-/**
- * Has the responsibility of listening for key events, and mouse events,
- * deciding if the caret has moved (without a text change), and if so, will
- * notify CaretListeners that the caret has moved. Objects which are
- * interested in ALL caret postion changes will also have to listen for
- * textChanged events.
- *
- * @deprecated - use base selection notification
- */
-public class CaretMediator implements Listener {
-
- class CaretMediatorListener implements KeyListener, MouseListener {
- public void keyPressed(KeyEvent e) {
- internalKeyPressed(e);
- }
-
- public void keyReleased(KeyEvent e) {
- internalKeyReleased(e);
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- internalMouseDown(e);
- }
-
- public void mouseUp(MouseEvent e) {
- internalMouseUp(e);
- }
- }
-
- class RefreshDelayJob extends Job {
- private int fDelay = 0;
- RefreshDelayJob(int delay) {
- super(SSEUIMessages.caret_update); //$NON-NLS-1$
- setSystem(true);
- fDelay = delay;
- }
-
- /**
- * Setup a delayed CaretEvent firing
- */
- void touch() {
- cancel();
- schedule(fDelay);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- handleEvent(null);
- return Status.OK_STATUS;
- }
- }
-
- RefreshDelayJob fDelayer = null;
- private static final int DELAY = 300;
-
- /** used just for debug print outs */
- private long endTime;
- private long startTime;
-
- protected ICaretListener[] fCaretListeners;
- protected CaretMediatorListener internalListener;
- protected StyledText textWidget;
-
- /**
- * CaretMediator constructor comment.
- */
- public CaretMediator() {
- super();
- }
-
- /**
- * CaretMediator constructor comment. Must always provide the widget its
- * supposed to listen to.
- */
- public CaretMediator(StyledText styledTextWidget) {
- this();
- setTextWidget(styledTextWidget);
- }
-
- public synchronized void addCaretListener(ICaretListener listener) {
- if (Debug.debugStructuredDocument) {
- System.out.println("CaretMediator::addCaretListener. Request to add an instance of " + listener.getClass() + " as a listener on caretlistner.");//$NON-NLS-2$//$NON-NLS-1$
- }
- // make sure listener is not already in listening array
- // (and if it is, print a warning to aid debugging, if needed)
-
- if (Utilities.contains(fCaretListeners, listener)) {
- if (Debug.displayWarnings) {
- System.out.println("CaretMediator::addCaretListener. listener " + listener + " was added more than once. ");//$NON-NLS-2$//$NON-NLS-1$
- }
- } else {
- if (Debug.debugStructuredDocument) {
- System.out.println("CaretMediator::addCaretListener. Adding an instance of " + listener.getClass() + " as a listener on caret mediator.");//$NON-NLS-2$//$NON-NLS-1$
- }
- int oldSize = 0;
- if (fCaretListeners != null) {
- // normally won't be null, but we need to be sure, for first
- // time through
- oldSize = fCaretListeners.length;
- }
- int newSize = oldSize + 1;
- ICaretListener[] newListeners = new ICaretListener[newSize];
- if (fCaretListeners != null) {
- System.arraycopy(fCaretListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fCaretListeners = newListeners;
-
- }
- }
-
- protected void fireCaretEvent(CaretEvent event) {
- if (fCaretListeners != null) {
- // we must assign listeners to local variable to be thread safe,
- // since the add and remove listner methods
- // can change this object's actual instance of the listener array
- // from another thread
- // (and since object assignment is atomic, we don't need to
- // synchronize
- ICaretListener[] holdListeners = fCaretListeners;
- //
- for (int i = 0; i < holdListeners.length; i++) {
- holdListeners[i].caretMoved(event);
- }
- }
- }
-
- public void handleEvent(Event e) {
- Display display = null;
-
- if (Debug.debugCaretMediator) {
- endTime = System.currentTimeMillis();
- System.out.println("Timer fired: " + (endTime - startTime)); //$NON-NLS-1$
- }
-
- // check if 'okToUse'
- if (textWidget != null && !textWidget.isDisposed()) {
- display = textWidget.getDisplay();
- if ((display != null) && (!display.isDisposed())) {
- display.asyncExec(new Runnable() {
- public void run() {
- if (textWidget != null && !textWidget.isDisposed()) {
- fireCaretEvent(new CaretEvent(textWidget, textWidget.getCaretOffset()));
- }
- }
- });
- }
- }
- }
-
- protected void internalKeyPressed(KeyEvent e) {
- fDelayer.cancel();
- }
-
- protected void internalKeyReleased(KeyEvent e) {
- switch (e.keyCode) {
- case SWT.ARROW_DOWN :
- case SWT.ARROW_UP :
- case SWT.ARROW_LEFT :
- case SWT.ARROW_RIGHT :
- case SWT.HOME :
- case SWT.END :
- case SWT.PAGE_DOWN :
- case SWT.PAGE_UP : {
- fDelayer.touch();
- break;
- }
- default : {
- // always update cursor postion, even during normal typing
- // (the logic may look funny, since we always to the same
- // thing, but we haven't always done the same thing, so I
- // wanted to leave that fact documented via code.)
- fDelayer.touch();
- }
- }
- }
-
- protected void internalMouseDown(MouseEvent e) {
- fDelayer.cancel();
- }
-
- protected void internalMouseUp(MouseEvent e) {
- // Note, even during a swipe select, when the mouse button goes up,
- // and the widget is
- // queried for the current caret postion, it always returns the
- // beginning of the selection,
- // which is desirable (at least for the known use of this feature,
- // which is to signal
- // that the property sheet can update itself.
- fDelayer.touch();
- }
-
- public void release() {
- fDelayer.cancel();
- if (textWidget != null && !textWidget.isDisposed()) {
- textWidget.removeKeyListener(internalListener);
- textWidget.removeMouseListener(internalListener);
- textWidget = null;
- }
- }
-
- public synchronized void removeCaretListener(ICaretListener listener) {
- if ((fCaretListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the request
- if (Utilities.contains(fCaretListeners, listener)) {
- int oldSize = fCaretListeners.length;
- int newSize = oldSize - 1;
- ICaretListener[] newListeners = new ICaretListener[newSize];
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fCaretListeners[i] == listener) { // ignore
- } else {
- // copy old to new if its not the one we are removing
- newListeners[index++] = fCaretListeners[i];
- }
- }
- // now that we have a new array, let's switch it for the old
- // one
- fCaretListeners = newListeners;
- }
- }
- }
-
- public void setTextWidget(StyledText newTextWidget) {
- if(fDelayer == null) {
- fDelayer = new RefreshDelayJob(DELAY);
- }
-
- // unhook from previous, if any
- if (this.textWidget != null) {
- fDelayer.cancel();
- this.textWidget.removeKeyListener(internalListener);
- this.textWidget.removeMouseListener(internalListener);
- }
-
- this.textWidget = newTextWidget;
-
- if (internalListener == null) {
- internalListener = new CaretMediatorListener();
- }
-
- if (this.textWidget != null) {
- this.textWidget.addKeyListener(internalListener);
- this.textWidget.addMouseListener(internalListener);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CustomFilterPropertyTester.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CustomFilterPropertyTester.java
deleted file mode 100644
index d646039df5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CustomFilterPropertyTester.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-
-public class CustomFilterPropertyTester extends PropertyTester {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object,
- * java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof IEditorPart){
- return ((IEditorPart) receiver).getAdapter(IContentOutlinePage.class) instanceof ConfigurableContentOutlinePage;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
deleted file mode 100644
index 8ec6fa861a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Simple generic ID to class to mapping. Loads a specified class defined in a
- * configuration element with the matching type and target ID. Example
- * plugin.xml section:
- *
- * &lt;extension
- * point=&quot;org.eclipse.wst.sse.ui.editorConfiguration&quot;&gt;contentoutlineconfiguration
- * target=&quot;org.eclipse.wst.sse.dtd.core.dtdsource&quot;
- * class=&quot;org.eclipse.wst.sse.ui.dtd.views.contentoutline.DTDContentOutlineConfiguration&quot;/&gt;
- * &lt;/extension&gt;
- *
- * Used in code by getConfiguration(&quot;contentoutlineconfiguration&quot;,
- * &quot;org.eclipse.wst.dtd.ui.StructuredTextEditorDTD&quot;);
- *
- */
-public class ExtendedConfigurationBuilder extends RegistryReader {
- /**
- * Extension type to pass into getConfigurations to get content outline
- * configuration
- */
- public static final String CONTENTOUTLINECONFIGURATION = "contentOutlineConfiguration"; //$NON-NLS-1$
- /**
- * Extension type to pass into getConfigurations to get property sheet
- * configuration
- */
- public static final String PROPERTYSHEETCONFIGURATION = "propertySheetConfiguration"; //$NON-NLS-1$
- /**
- * Extension type to pass into getConfigurations to get source viewer
- * configuration
- */
- public static final String SOURCEVIEWERCONFIGURATION = "sourceViewerConfiguration"; //$NON-NLS-1$
- /**
- * Extension type to pass into getConfigurations to get documentation text
- * hover
- */
- public static final String DOCUMENTATIONTEXTHOVER = "documentationTextHover"; //$NON-NLS-1$
- /**
- * Extension type to pass into getConfigurations to get double click
- * strategy
- */
- public static final String DOUBLECLICKSTRATEGY = "doubleClickStrategy"; //$NON-NLS-1$
- /**
- * Extension type to pass into getConfigurations to get quick outline
- * configuration
- */
- public static final String QUICKOUTLINECONFIGURATION = "quickOutlineConfiguration"; //$NON-NLS-1$
-
- private static final String ATT_CLASS = "class"; //$NON-NLS-1$
- private static final String ATT_TARGET = "target"; //$NON-NLS-1$
- private static final String ATT_TYPE = "type"; //$NON-NLS-1$
- private static final String CONFIGURATION = "provisionalConfiguration"; //$NON-NLS-1$
- private static Map configurationMap = null;
- private final static boolean debugTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time")); //$NON-NLS-1$ //$NON-NLS-2$
- private static final String DEFINITION = "provisionalDefinition"; //$NON-NLS-1$
- private static final String EP_EXTENDEDCONFIGURATION = "editorConfiguration"; //$NON-NLS-1$
- private static ExtendedConfigurationBuilder instance = null;
- public static final String VALUE = "value"; //$NON-NLS-1$
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param element
- * the config element defining the extension
- * @param classAttribute
- * the name of the attribute carrying the class
- * @returns the extension object if successful. If an error occurs when
- * createing executable extension, the exception is logged, and
- * null returned.
- */
- static Object createExtension(final IConfigurationElement element, final String classAttribute, final String targetID) {
- final Object[] result = new Object[1];
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- result[0] = element.createExecutableExtension(classAttribute);
- }
- catch (Exception e) {
- // catch and log ANY exception while creating the extension
- Logger.logException("error loading class " + classAttribute + " for " + targetID, e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = element.createExecutableExtension(classAttribute);
- }
- catch (Exception e) {
- // catch and log ANY exception from extension point
- Logger.logException("error loading class " + classAttribute + " for " + targetID, e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- });
- }
- return result[0];
- }
-
- public synchronized static ExtendedConfigurationBuilder getInstance() {
- if (instance == null)
- instance = new ExtendedConfigurationBuilder();
- return instance;
- }
-
- long time0 = 0;
-
- private ExtendedConfigurationBuilder() {
- super();
- }
-
- private List createConfigurations(List configurations, String extensionType, String targetID) {
- if (configurations == null)
- return new ArrayList(0);
- List result = new ArrayList(1);
- for (int i = 0; i < configurations.size(); i++) {
- IConfigurationElement element = (IConfigurationElement) configurations.get(i);
- if ((element.getName().equals(extensionType) || (element.getName().equals(CONFIGURATION) && extensionType.equals(element.getAttribute(ATT_TYPE))))) {
- String[] targets = StringUtils.unpack(element.getAttribute(ATT_TARGET));
- for (int j = 0; j < targets.length; j++) {
- if (targetID.equals(targets[j].trim())) {
- Object o = createExtension(element, ATT_CLASS, targetID);
- if (o != null) {
- result.add(o);
- }
- }
- }
- }
- }
- return result;
- }
-
- private IConfigurationElement[] findConfigurationElements(List configurations, String extensionType, String targetID) {
- if (configurations == null)
- return new IConfigurationElement[0];
- List result = new ArrayList(1);
- for (int i = 0; i < configurations.size(); i++) {
- IConfigurationElement element = (IConfigurationElement) configurations.get(i);
- if ((element.getName().equals(extensionType) || (element.getName().equals(DEFINITION) && extensionType.equals(element.getAttribute(ATT_TYPE))))) {
- String[] targets = StringUtils.unpack(element.getAttribute(ATT_TARGET));
- for (int j = 0; j < targets.length; j++) {
- if (targetID.equals(targets[j].trim())) {
- result.add(element);
- }
- }
- }
- }
- return (IConfigurationElement[]) result.toArray(new IConfigurationElement[0]);
- }
-
- /**
- * Returns a configuration for the given extensionType matching the
- * targetID, if one is available. If more than one configuration is
- * defined, the first one found is returned.
- *
- * @param extensionType
- * @param targetID
- * @return a configuration object, if one was defined
- */
- public Object getConfiguration(String extensionType, String targetID) {
- if (targetID == null || targetID.length() == 0)
- return null;
- List configurations = getConfigurations(extensionType, targetID);
- if (configurations.isEmpty())
- return null;
- return configurations.get(0);
- }
-
- /**
- * Returns all configurations for the given extensionType matching the
- * targetID, if any are available.
- *
- * @param extensionType
- * @param targetID
- * @return a List of configuration objects, which may or may not be empty
- */
- public List getConfigurations(String extensionType, String targetID) {
- if (targetID == null || targetID.length() == 0)
- return new ArrayList(0);
- if (configurationMap == null) {
- configurationMap = new HashMap(0);
- synchronized (configurationMap) {
- readRegistry(Platform.getExtensionRegistry(), SSEUIPlugin.ID, EP_EXTENDEDCONFIGURATION);
- if (debugTime) {
- System.out.println(getClass().getName() + "#readRegistry(): " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- time0 = System.currentTimeMillis();
- }
- }
- }
- List extensions = (List) configurationMap.get(extensionType);
- List configurations = createConfigurations(extensions, extensionType, targetID);
- if (debugTime) {
- if (!configurations.isEmpty())
- System.out.println(getClass().getName() + "#getConfiguration(" + extensionType + ", " + targetID + "): configurations loaded in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- else
- System.out.println(getClass().getName() + "#getConfiguration(" + extensionType + ", " + targetID + "): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return configurations;
- }
-
- /**
- * Returns all declared definitions for the given extensionType matching
- * the targetID, if any are available.
- *
- * @param extensionType
- * @param targetID
- * @return An array containing the definitions, empty if none were
- * declared
- */
- public String[] getDefinitions(String extensionType, String targetID) {
- if (targetID == null || targetID.length() == 0)
- return new String[0];
- if (debugTime) {
- time0 = System.currentTimeMillis();
- }
- if (configurationMap == null) {
- configurationMap = new HashMap(0);
- synchronized (configurationMap) {
- readRegistry(Platform.getExtensionRegistry(), SSEUIPlugin.ID, EP_EXTENDEDCONFIGURATION);
- if (debugTime) {
- System.out.println(getClass().getName() + "#readRegistry(): " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- time0 = System.currentTimeMillis();
- }
- }
- }
- List definitions = (List) configurationMap.get(extensionType);
- IConfigurationElement[] elements = findConfigurationElements(definitions, extensionType, targetID);
- String[] values = new String[elements.length];
- for (int i = 0; i < values.length; i++) {
- values[i] = elements[i].getAttribute(VALUE);
- }
- if (debugTime) {
- if (values.length > 0)
- System.out.println(getClass().getName() + "#getDefinitions(" + extensionType + ", " + targetID + "): definition loaded in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- else
- System.out.println(getClass().getName() + "#getDefinitions(" + extensionType + ", " + targetID + "): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return values;
- }
-
- protected boolean readElement(IConfigurationElement element) {
- String name = element.getName();
- if (name.equals(CONFIGURATION) || name.equals(DEFINITION))
- name = element.getAttribute(ATT_TYPE);
- List configurations = (List) configurationMap.get(name);
- if (configurations == null) {
- configurations = new ArrayList(1);
- configurationMap.put(name, configurations);
- }
- configurations.add(element);
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java
deleted file mode 100644
index 0277646c12..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java
+++ /dev/null
@@ -1,789 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.part.MultiPageEditorSite;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.ui.internal.extension.ActionDescriptor;
-import org.eclipse.wst.sse.ui.internal.extension.IExtendedEditorActionProxyForDelayLoading;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-
-/**
- * This class reads the registry for extensions that plug into 'editorActions'
- * extension point.
- */
-
-public class ExtendedEditorActionBuilder extends RegistryReader {
-
- public class ExtendedContributor implements IExtendedContributor, IMenuListener {
- private IExtendedSimpleEditor activeExtendedEditor = null;
-
- private List cache;
- private Map map = new HashMap();
- private IMenuManager menuBar = null;
-
- private Set menus = new HashSet();
-
- public ExtendedContributor(List cache) {
- this.cache = cache;
- }
-
- private IExtendedSimpleEditor computeExtendedEditor(final IEditorPart editor) {
- IExtendedSimpleEditor simpleEditor = null;
- if (editor instanceof IExtendedSimpleEditor) {
- simpleEditor = (IExtendedSimpleEditor) editor;
- }
- if (editor != null && simpleEditor == null) {
- final ISourceEditingTextTools tools = (ISourceEditingTextTools) editor.getAdapter(ISourceEditingTextTools.class);
- if (tools != null) {
- simpleEditor = new IExtendedSimpleEditor() {
- public int getCaretPosition() {
- return tools.getCaretOffset();
- }
-
- public IDocument getDocument() {
- return tools.getDocument();
- }
-
- public IEditorPart getEditorPart() {
- return tools.getEditorPart();
- }
-
- public Point getSelectionRange() {
- ITextSelection selection = tools.getSelection();
- return new Point(selection.getOffset(), selection.getOffset() + selection.getLength());
- }
-
- };
- }
- }
- return simpleEditor;
- }
-
- public void contributeToMenu(IMenuManager menu) {
- menuBar = menu;
- long time0 = System.currentTimeMillis();
- for (int i = 0; i < cache.size(); i++) {
- Object obj = cache.get(i);
- if (obj instanceof IConfigurationElement) {
- IConfigurationElement menuElement = (IConfigurationElement) obj;
- if ((menuElement.getName()).equals(TAG_MENU)) {
- contributeMenu(menuElement, menu, true);
- if (debugMenu)
- System.out.println(getClass().getName() + "#contributeToMenu() added: " + menuElement.getAttribute(ATT_ID)); //$NON-NLS-1$
- }
- }
- else if (obj instanceof ActionDescriptor) {
- try {
- ActionDescriptor ad = (ActionDescriptor) obj;
- IMenuManager mm = contributeMenuAction(ad, menu, true, false);
- if (mm != null) {
- map.put(ad.getContributionItem(), mm);
- mm.addMenuListener(this);
- menus.add(mm);
- if (debugMenu)
- System.out.println(getClass().getName() + "#contributeToMenu() added: " + ad.getId()); //$NON-NLS-1$
- }
- }
- catch (Exception e) {
- Logger.logException("contributing to menu", e); //$NON-NLS-1$
- }
- }
- }
- if (debugContributeTime)
- System.out.println(getClass().getName() + "#contributeToMenu(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void contributeToPopupMenu(IMenuManager menu) {
- long time0 = System.currentTimeMillis();
- for (int i = 0; i < cache.size(); i++) {
- Object obj = cache.get(i);
- if (obj instanceof IConfigurationElement) {
- IConfigurationElement menuElement = (IConfigurationElement) obj;
- if ((menuElement.getName()).equals(TAG_POPUPMENU)) {
- contributeMenu(menuElement, menu, true);
- }
- }
- else if (obj instanceof ActionDescriptor) {
- try {
- ActionDescriptor ad = (ActionDescriptor) obj;
- IAction a = ad.getAction();
- if (a instanceof IExtendedEditorAction) {
- // uncaught exceptions could cause the menu to not
- // be shown
- try {
- if (((ad.getPopupMenuPath() != null) || (ad.getPopupMenuGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
- ((IExtendedEditorActionProxyForDelayLoading)a).realize();
- }
-
- IExtendedEditorAction eea = (IExtendedEditorAction) a;
- eea.setActiveExtendedEditor(activeExtendedEditor);
- eea.update();
- if (eea.isVisible()) {
- IMenuManager parent = contributeMenuAction(ad, menu, true, true);
- if (debugPopup && parent != null)
- System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
-
- }
- else {
- IMenuManager parent = contributeMenuAction(ad, menu, true, true);
- if (debugPopup && parent != null)
- System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
- }
- }
- catch (Exception e) {
- Logger.logException("contributing to popup", e); //$NON-NLS-1$
- }
- }
- }
- if (debugContributeTime)
- System.out.println(getClass().getName() + "#contributeToPopupMenu(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void contributeToStatusLine(IStatusLineManager manager) {
- // nothing from here
- }
-
- public void contributeToToolBar(IToolBarManager manager) {
- long time0 = System.currentTimeMillis();
- for (int i = 0; i < cache.size(); i++) {
- Object obj = cache.get(i);
- if (obj instanceof ActionDescriptor) {
- try {
- ActionDescriptor ad = (ActionDescriptor) obj;
- IAction a = ad.getAction();
- if (a instanceof IExtendedEditorAction) {
- if (((ad.getToolbarPath() != null) || (ad.getToolbarGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
- ((IExtendedEditorActionProxyForDelayLoading)a).realize();
- }
- IExtendedEditorAction eea = (IExtendedEditorAction) a;
- eea.setActiveExtendedEditor(activeExtendedEditor);
- eea.update();
- if (eea.isVisible()) {
- boolean contributed = contributeToolbarAction(ad, manager, true);
- if (debugToolbar && contributed)
- System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
- }
- else {
- if (debugToolbar)
- System.out.println(getClass().getName() + "#contributeToToolBar(): [skipped] " + ad.getId()); //$NON-NLS-1$
- }
- }
- else {
- boolean contributed = contributeToolbarAction(ad, manager, true);
- if (debugToolbar && contributed)
- System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
- }
- }
- catch (Exception e) {
- Logger.logException("contributing to toolbar", e); //$NON-NLS-1$
- }
- }
- }
- if (debugContributeTime)
- System.out.println(getClass().getName() + "#contributeToToolBar(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void dispose() {
- Iterator it = menus.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (o instanceof IMenuManager) {
- ((IMenuManager) o).removeMenuListener(this);
- }
- }
- }
-
- public void init(IActionBars bars, IWorkbenchPage page) {
- // nothing from here
- }
-
- public void menuAboutToShow(IMenuManager menu) {
- // slows down the menu and interferes with it for other editors;
- // optimize on visibility
- IEditorSite site = null;
- boolean activeEditorIsVisible = false;
-
- if (activeExtendedEditor != null && activeExtendedEditor.getEditorPart() != null)
- site = activeExtendedEditor.getEditorPart().getEditorSite();
- if (site == null)
- return;
-
- // Eclipse bug 48784 - [MPE] ClassCast exception Workbench page
- // isPartVisiable for MultiPageSite
- if (site instanceof MultiPageEditorSite) {
- Object multiPageEditor = ((MultiPageEditorSite) site).getMultiPageEditor();
- activeEditorIsVisible = multiPageEditor.equals(site.getPage().getActiveEditor()) || multiPageEditor.equals(site.getPage().getActivePart());
- }
- else {
- activeEditorIsVisible = site.getWorkbenchWindow().getPartService().getActivePart().equals(activeExtendedEditor.getEditorPart());
- }
- // due to a delay class loading, don't return now
-// if (!activeEditorIsVisible)
-// return;
-
- IContributionItem[] items = menu.getItems();
- if (items == null || items.length == 0)
- return;
-
- for (int i = 0; i < items.length; ++i) {
- // add menu listener to submenu
- if (items[i] instanceof IMenuManager) {
- ((IMenuManager) items[i]).addMenuListener(this);
- menus.add(items[i]);
- }
- }
-
- Set keys = map.keySet();
- Iterator it = keys.iterator();
- boolean needActionContributionItemUpdate = false;
- while (it.hasNext()) {
- IContributionItem item = (IContributionItem) it.next();
- IMenuManager mm = (IMenuManager) map.get(item);
- if (menu.getId() != null && menu.getId().equals(mm.getId()) && item instanceof ActionContributionItem) {
- try {
- IAction action = ((ActionContributionItem) item).getAction();
-
- if (action instanceof IExtendedEditorActionProxyForDelayLoading) {
- IExtendedEditorActionProxyForDelayLoading eea = (IExtendedEditorActionProxyForDelayLoading)action;
- if (eea.isBundleActive() == true && eea.isRealized() == false) {
- eea.realize();
- needActionContributionItemUpdate = true;
- }
- }
-
- if (activeEditorIsVisible || needActionContributionItemUpdate) {
- if (action instanceof IUpdate) {
- ((IUpdate) action).update();
- }
- }
-
- if (activeEditorIsVisible || needActionContributionItemUpdate) {
- boolean visible = true;
- if (action instanceof IExtendedEditorAction) {
- visible = ((IExtendedEditorAction) action).isVisible();
- }
- item.setVisible(visible);
- }
-
- if (needActionContributionItemUpdate) {
- ((ActionContributionItem)item).update();
- }
-
- }
- catch (Exception e) {
- Logger.logException("updating actions", e); //$NON-NLS-1$
- }
- }
- }
- if (activeEditorIsVisible || needActionContributionItemUpdate) {
- if (needActionContributionItemUpdate) {
- // the action is realized so that need to update the menu w/
- // force set to true
- menu.update(true);
- } else {
- menu.update(false);
- }
- }
- }
-
- public void setActiveEditor(IEditorPart editor) {
- activeExtendedEditor = computeExtendedEditor(editor);
- IKeyBindingService svc = (editor != null) ? editor.getEditorSite().getKeyBindingService() : null;
- for (int i = 0; i < cache.size(); i++) {
- Object obj = cache.get(i);
- if (obj instanceof ActionDescriptor) {
- ActionDescriptor ad = (ActionDescriptor) obj;
- try {
- IAction action = ad.getAction();
- if (action instanceof IExtendedEditorAction) {
- ((IExtendedEditorAction) action).setActiveExtendedEditor(activeExtendedEditor);
- ((IExtendedEditorAction) action).update();
- // update visibility right now so that the menu
- // will show/hide properly
- if (!((IExtendedEditorAction) action).isVisible() && ad.getContributionItem() != null)
- ad.getContributionItem().setVisible(false);
- if (svc != null && action.getActionDefinitionId() != null) {
- svc.registerAction(action);
- }
- }
- }
- catch (Exception e) {
- Logger.logException("setting active editor on actions", e); //$NON-NLS-1$
- }
- }
- }
-
- if (menuBar != null && editor != null) {
- // Class clz = editor.getClass();
- // while (clz != null) {
- // if (clz.getName().equals(targetID)) {
- // contributeToMenu(menuBar);
- // break;
- // }
- // clz = clz.getSuperclass();
- // }
- if (targetIDs.contains(editor.getEditorSite().getId())) {
- contributeToMenu(menuBar);
- }
- }
-
- updateToolbarActions();
- }
-
- public void updateToolbarActions() {
- for (int i = 0; i < cache.size(); i++) {
- Object obj = cache.get(i);
- if (obj instanceof ActionDescriptor) {
- try {
- ActionDescriptor ad = (ActionDescriptor) obj;
- if (ad.getToolbarPath() != null) {
- IAction action = ad.getAction();
- if (action instanceof IUpdate) {
- ((IUpdate) action).update();
- }
- }
- }
- catch (Exception e) {
- Logger.logException("updating toolbar actions", e); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_LABEL = "label"; //$NON-NLS-1$
- public static final String ATT_NAME = "name"; //$NON-NLS-1$
- public static final String ATT_PATH = "path"; //$NON-NLS-1$
-
- public static final String ATT_TARGET_ID = "targetID"; //$NON-NLS-1$
- protected final static boolean debugContributeTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime")); //$NON-NLS-1$ //$NON-NLS-2$
-
- protected final static boolean debugMenu = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu")); //$NON-NLS-1$ //$NON-NLS-2$;
- protected final static boolean debugPopup = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup")); //$NON-NLS-1$ //$NON-NLS-2$;
- protected final static boolean debugReadTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime")); //$NON-NLS-1$ //$NON-NLS-2$
- protected final static boolean debugToolbar = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar")); //$NON-NLS-1$ //$NON-NLS-2$;
-
- private static final String EXTENDED_EDITOR = "extendedEditor"; //$NON-NLS-1$
-
- public static final String PL_EXTENDED_EDITOR_ACTIONS = "extendedEditorActions"; //$NON-NLS-1$
-
- public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
- public static final String TAG_ACTION = "action"; //$NON-NLS-1$
-
- public static final String TAG_CONTRIBUTION_TYPE = "editorContribution"; //$NON-NLS-1$
-
- public static final String TAG_MENU = "menu"; //$NON-NLS-1$
- public static final String TAG_POPUPMENU = "popupmenu"; //$NON-NLS-1$
- public static final String TAG_RULERMENU = "rulermenu"; //$NON-NLS-1$
- public static final String TAG_SEPARATOR = "separator"; //$NON-NLS-1$
-
- protected List readingCache;
-
- protected String targetContributionTag;
- protected List targetIDs;
-
- /**
- * The constructor.
- */
- public ExtendedEditorActionBuilder() {
- super();
- }
-
- /**
- * Creates a menu from the information in the menu configuration element
- * and adds it into the provided menu manager. If 'appendIfMissing' is
- * true, and menu path slot is not found, it will be created and menu will
- * be added into it. Otherwise, add operation will fail.
- */
- protected void contributeMenu(IConfigurationElement menuElement, IMenuManager mng, boolean appendIfMissing) {
- // Get config data.
- String id = menuElement.getAttribute(ATT_ID);
- String label = menuElement.getAttribute(ATT_LABEL);
- String path = menuElement.getAttribute(ATT_PATH);
- if (label == null) {
- Logger.log(Logger.ERROR, "Invalid Menu Extension (label == null): " + id); //$NON-NLS-1$
- return;
- }
-
- // Calculate menu path and group.
- String group = null;
- if (path != null) {
- int loc = path.lastIndexOf('/');
- if (loc != -1) {
- group = path.substring(loc + 1);
- path = path.substring(0, loc);
- }
- else {
- // assume that path represents a slot
- // so actual path portion should be null
- group = path;
- path = null;
- }
- }
-
- // Find parent menu.
- IMenuManager parent = mng;
- if (path != null) {
- parent = mng.findMenuUsingPath(path);
- if (parent == null) {
- // Logger.log("Invalid Menu Extension (Path is invalid): " +
- // id);//$NON-NLS-1$
- return;
- }
- // IMenuManager.findMenuUsingPath() returns invisible menu item if
- // the manager can't find
- // the specified path and create new MenuManager for it.
- // I don't know this is a specification or bug.
- // Anyway, to ensure the menu can be visible, setVisible(true)
- // needs to be called.
- parent.setVisible(true);
- }
-
- // Find reference group.
- if (group == null)
- group = IWorkbenchActionConstants.MB_ADDITIONS;
- IContributionItem sep = parent.find(group);
- if (sep == null) {
- if (appendIfMissing)
- parent.add(new Separator(group));
- else {
- Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is invalid): " + id); //$NON-NLS-1$
- return;
- }
- }
-
- // If the menu does not exist create it.
- IMenuManager newMenu = parent.findMenuUsingPath(id);
- if (newMenu == null)
- newMenu = new MenuManager(label, id);
-
- // Create separators.
- IConfigurationElement[] children = menuElement.getChildren(TAG_SEPARATOR);
- for (int i = 0; i < children.length; i++) {
- contributeSeparator(newMenu, children[i]);
- }
-
- // Add new menu
- try {
- parent.insertAfter(group, newMenu);
- }
- catch (IllegalArgumentException e) {
- Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is missing): " + id); //$NON-NLS-1$
- }
- }
-
- /**
- * Contributes action from action descriptor into the provided menu
- * manager.
- */
- protected IMenuManager contributeMenuAction(ActionDescriptor ad, IMenuManager menu, boolean appendIfMissing, boolean popupmenu) {
- if (ad.getContributionItem() == null || ad.getAction() == null)
- return null;
-
- // Get config data.
- String mpath = popupmenu ? ad.getPopupMenuPath() : ad.getMenuPath();
- String mgroup = popupmenu ? ad.getPopupMenuGroup() : ad.getMenuGroup();
- if (mpath == null && mgroup == null)
- return null;
-
- // Find parent menu.
- IMenuManager parent = menu;
- if (mpath != null) {
- parent = parent.findMenuUsingPath(mpath);
- if (parent == null) {
- // Logger.log("Invalid Menu Extension (Path is invalid): " +
- // ad.getId()); //$NON-NLS-1$
- return null;
- }
- // IMenuManager.findMenuUsingPath() returns invisible menu item if
- // the manager can't find
- // the specified path and create new MenuManager for it.
- // I don't know this is a specification or bug.
- // Anyway, to ensure the menu can be visible, setVisible(true)
- // needs to be called.
- parent.setVisible(true);
- }
-
- // First remove existing menu item
- IContributionItem item = parent.find(ad.getId());
- if (item != null) {
- parent.remove(ad.getId());
- }
-
- // Find reference group.
- if (mgroup == null)
- mgroup = IWorkbenchActionConstants.MB_ADDITIONS;
- IContributionItem sep = parent.find(mgroup);
- if (sep == null) {
- if (appendIfMissing)
- parent.add(sep = new Separator(mgroup));
- else {
- Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is invalid): " + ad.getId()); //$NON-NLS-1$
- return null;
- }
- }
-
- // Add action.
- try {
- if (popupmenu) {
- // Context menu need a newly created contribution item
- if (sep != null && sep.isGroupMarker())
- parent.appendToGroup(sep.getId(), ad.getAction());
- else
- parent.insertAfter(mgroup, ad.getAction());
- }
- else {
- // Normal menu need to add existing contribution item to
- // remove it from menu listener
- if (sep != null && sep.isGroupMarker())
- parent.appendToGroup(sep.getId(), ad.getContributionItem());
- else
- parent.insertAfter(mgroup, ad.getContributionItem());
- }
- }
- catch (IllegalArgumentException e) {
- Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is missing): " + ad.getId()); //$NON-NLS-1$
- parent = null;
- }
-
- return parent;
- }
-
- /**
- * Creates a named menu separator from the information in the
- * configuration element. If the separator already exists do not create a
- * second.
- */
- protected boolean contributeSeparator(IMenuManager menu, IConfigurationElement element) {
- String id = element.getAttribute(ATT_NAME);
- if (id == null || id.length() <= 0)
- return false;
- IContributionItem sep = menu.find(id);
- if (sep != null)
- return false;
- menu.add(new Separator(id));
- return true;
- }
-
- /**
- * Contributes action from the action descriptor into the provided tool
- * bar manager.
- */
- protected boolean contributeToolbarAction(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing) {
- if (ad.getContributionItem() == null || ad.getAction() == null)
- return false;
-
- // Get config data.
- String tpath = ad.getToolbarPath();
- String tgroup = ad.getToolbarGroup();
- if (tpath == null && tgroup == null)
- return false;
-
- // First remove existing toolbar item
- IContributionItem item = toolbar.find(ad.getId());
- if (item != null) {
- toolbar.remove(ad.getId());
- }
-
- // Find reference group.
- if (tgroup == null)
- tgroup = IWorkbenchActionConstants.MB_ADDITIONS;
- IContributionItem sep = toolbar.find(tgroup);
- if (sep == null) {
- if (appendIfMissing)
- toolbar.add(new Separator(tgroup));
- else {
- Logger.log(Logger.ERROR, "Invalid Toolbar Extension (Group is invalid): " + ad.getId()); //$NON-NLS-1$
- return false;
- }
- }
-
- // Add action to tool bar.
- try {
- if (sep != null && sep.isGroupMarker())
- toolbar.appendToGroup(sep.getId(), ad.getAction());
- else
- toolbar.insertAfter(tgroup, ad.getAction());
- }
- catch (IllegalArgumentException e) {
- Logger.log(Logger.ERROR, "Invalid Toolbar Extension (Group is missing): " + ad.getId()); //$NON-NLS-1$
- return false;
- }
- return true;
- }
-
- /**
- * This factory method returns a new ActionDescriptor for the
- * configuration element. It should be implemented by subclasses.
- */
- protected ActionDescriptor createActionDescriptor(IConfigurationElement element) {
- ActionDescriptor ad = null;
- try {
- ad = new ActionDescriptor(element);
- // these cases like "class not found" are handled
- // at lower level, so no action if formed. In that
- // case, we also don't want to form an action descriptor.
- if ((ad != null) && (ad.getAction() == null)) {
- ad = null;
- }
- }
- catch (Exception e) {
- Logger.traceException(EXTENDED_EDITOR, e);
- ad = null;
- }
- return ad;
- }
-
- /**
- * Returns the name of the part ID attribute that is expected in the
- * target extension.
- */
- protected String getTargetID(IConfigurationElement element) {
- String value = element.getAttribute(ATT_TARGET_ID);
- return value != null ? value : "???"; //$NON-NLS-1$
- }
-
- /**
- * Reads editor contributor if specified directly in the 'editor'
- * extension point, and all external contributions for this editor's ID
- * registered in 'editorActions' extension point.
- */
- public IExtendedContributor readActionExtensions(String editorId) {
- return readActionExtensions(new String[]{editorId});
- }
-
- /**
- * Reads editor contributor if specified directly in the 'editor'
- * extension point, and all external contributions for this editor's ID
- * registered in 'editorActions' extension point.
- */
- public IExtendedContributor readActionExtensions(String[] ids) {
- long time0 = System.currentTimeMillis();
- ExtendedContributor ext = null;
- readContributions(ids, TAG_CONTRIBUTION_TYPE, PL_EXTENDED_EDITOR_ACTIONS);
- if (debugReadTime) {
- String idlist = ""; //$NON-NLS-1$
- if (ids.length > 0) {
- for (int i = 0; i < ids.length; i++) {
- idlist += ids[i];
- if (i < ids.length - 1)
- idlist += ","; //$NON-NLS-1$
- }
- }
- System.out.println(getClass().getName() + "#readActionExtensions(" + idlist + "): read in " + (System.currentTimeMillis() - time0) + "ms [" + (readingCache != null ? readingCache.size() : 0) + " contributions]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- if (readingCache != null) {
- ext = new ExtendedContributor(readingCache);
- readingCache = null;
- }
- return ext;
- }
-
- /**
- * Reads the contributions from the registry for the provided workbench
- * part and the provided extension point IDs.
- */
- protected void readContributions(String[] ids, String tag, String extensionPoint) {
- readingCache = null;
- targetIDs = Arrays.asList(ids);
- targetContributionTag = tag;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- readRegistry(registry, PLUGIN_ID, extensionPoint);
- }
-
- /**
- * Implements abstract method to handle the provided XML element in the
- * registry.
- */
- protected boolean readElement(IConfigurationElement element) {
- String tag = element.getName();
- if (tag.equals(targetContributionTag)) {
- String id = getTargetID(element);
- if (id == null || !targetIDs.contains(id)) {
- // This is not of interest to us - don't go deeper
- return true;
- }
- }
- else if (tag.equals(TAG_MENU)) {
- if (readingCache == null)
- readingCache = new ArrayList();
- readingCache.add(element);
- return true; // just cache the element - don't go into it
- }
- else if (tag.equals(TAG_POPUPMENU)) {
- if (readingCache == null)
- readingCache = new ArrayList();
- readingCache.add(element);
- return true; // just cache the element - don't go into it
- }
- else if (tag.equals(TAG_RULERMENU)) {
- if (readingCache == null)
- readingCache = new ArrayList();
- readingCache.add(element);
- return true; // just cache the element - don't go into it
- }
- else if (tag.equals(TAG_ACTION)) {
- if (readingCache == null)
- readingCache = new ArrayList();
- ActionDescriptor ad = createActionDescriptor(element);
- if (ad != null)
- readingCache.add(ad);
- return true; // just cache the action - don't go into
- }
- else {
- return false;
- }
-
- readElementChildren(element);
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
deleted file mode 100644
index bf0b04ef20..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetAdapter;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.TransferBuilder.TransferProxyForDelayLoading;
-
-/**
- * ExtendedEditorDropTargetAdapter
- */
-public class ExtendedEditorDropTargetAdapter extends DropTargetAdapter {
- private String[] editorIds;
- private Point originalRange = null;
- private IEditorPart targetEditor = null;
- private ITextViewer textViewer = null;
-
- private Transfer[] transfers = null;
-
- private boolean useProxy;
-
- /**
- * @deprecated use ExtendedEditorDropTargetAdapter(boolean useProxy) for
- * the performance
- */
- public ExtendedEditorDropTargetAdapter() {
- this(false);
- }
-
- public ExtendedEditorDropTargetAdapter(boolean useProxy) {
- super();
- this.useProxy = useProxy;
- }
-
- protected boolean doDrop(Transfer transfer, DropTargetEvent event) {
- TransferBuilder tb = new TransferBuilder(useProxy);
-
- IDropAction[] as = null;
- if (editorIds != null && editorIds.length > 0)
- as = tb.getDropActions(editorIds, transfer);
- else
- as = tb.getDropActions(getTargetEditor().getClass().getName(), transfer);
-
- for (int i = 0; i < as.length; ++i) {
- IDropAction da = as[i];
- Transfer actualTransfer;
- if (transfer instanceof TransferProxyForDelayLoading) {
- actualTransfer = ((TransferProxyForDelayLoading) transfer).getTransferClass();
- }
- else {
- actualTransfer = transfer;
- }
- if (actualTransfer instanceof FileTransfer) {
- if (event.data == null) {
- Logger.log(Logger.ERROR, "No data in DropTargetEvent from " + event.widget); //$NON-NLS-1$
- return false;
- }
- String[] strs = (String[]) event.data;
- boolean[] bs = new boolean[strs.length];
- int c = 0;
- for (int j = 0; j < strs.length; ++j) {
- bs[j] = false;
- if (da.isSupportedData(strs[j])) {
- event.data = new String[]{strs[j]};
- if (!da.run(event, targetEditor)) {
- bs[j] = true;
- c++;
- }
- }
- else {
- bs[j] = true;
- c++;
- }
- }
- if (c == 0) {
- return true;
- }
-
- int k = 0;
- String[] rests = new String[c];
- for (int j = 0; j < strs.length; ++j) {
- if (bs[j])
- rests[k++] = strs[j];
- }
- event.data = rests;
- }
- else if (da.isSupportedData(event.data)) {
- if (da.run(event, targetEditor)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- */
- public void dragEnter(DropTargetEvent event) {
- TransferData data = null;
- Transfer[] ts = getTransfers();
- for (int i = 0; i < ts.length; i++) {
- for (int j = 0; j < event.dataTypes.length; j++) {
- if (ts[i].isSupportedType(event.dataTypes[j])) {
- data = event.dataTypes[j];
- break;
- }
- }
- if (data != null) {
- event.currentDataType = data;
- break;
- }
- }
-
- if (textViewer != null) {
- originalRange = textViewer.getSelectedRange();
- }
- }
-
- public void dragLeave(DropTargetEvent event) {
- if (textViewer != null) {
- textViewer.setSelectedRange(originalRange.x, originalRange.y);
- }
- else {
- originalRange = null;
- }
- }
-
- /**
- * Scroll the visible area as needed
- */
- public void dragOver(DropTargetEvent event) {
- event.operations &= ~DND.DROP_MOVE;
- event.detail = DND.DROP_COPY;
- event.feedback |= DND.FEEDBACK_SCROLL;
- }
-
- /**
- */
- public void drop(DropTargetEvent event) {
- if (event.operations == DND.DROP_NONE)
- return;
-
- Transfer[] ts = getTransfers();
- for (int i = 0; i < ts.length; i++) {
- if (ts[i].isSupportedType(event.currentDataType)) {
- if (doDrop(ts[i], event)) {
- IEditorPart part = targetEditor;
- if (targetEditor instanceof StructuredTextEditor){
- part = ((StructuredTextEditor) targetEditor).getEditorPart();
- }
- targetEditor.getSite().getPage().activate(part);
- break;
- }
- }
- }
- }
-
- public IEditorPart getTargetEditor() {
- return targetEditor;
- }
-
- public ITextViewer getTextViewer() {
- return textViewer;
- }
-
- /**
- * @return org.eclipse.swt.dnd.Transfer[]
- */
- public Transfer[] getTransfers() {
- if (transfers == null) {
- TransferBuilder tb = new TransferBuilder(useProxy);
- if (editorIds == null || editorIds.length == 0)
- transfers = tb.getDropTargetTransfers(getTargetEditor().getClass().getName());
- else
- transfers = tb.getDropTargetTransfers(editorIds);
- }
- return transfers;
- }
-
- /**
- */
- public void setTargetEditor(IEditorPart targetEditor) {
- this.targetEditor = targetEditor;
- }
-
- public void setTargetIDs(String[] ids) {
- editorIds = ids;
- }
-
- public void setTextViewer(ITextViewer textViewer) {
- this.textViewer = textViewer;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java
deleted file mode 100644
index a68de9ef38..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-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.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Action for file drop
- */
-public class FileDropAction extends AbstractDropAction {
- public boolean run(DropTargetEvent event, IEditorPart targetEditor) {
- String[] strs = (String[]) event.data;
- if (strs == null || strs.length == 0) {
- return false;
- }
-
- String str = ""; //$NON-NLS-1$
- for (int i = 0; i < strs.length; ++i) {
- IPath path = new Path(strs[i]);
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFileForLocation(path);
- if (file != null) {
- path = file.getProjectRelativePath();
- }
-
- str += "\"" + path.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return insert(str, targetEditor);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java
deleted file mode 100644
index a8f10aba1f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java
+++ /dev/null
@@ -1,102 +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.sse.ui.internal;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-public class FormatProcessorsExtensionReader extends RegistryReader {
- private static FormatProcessorsExtensionReader instance;
-
- public synchronized static FormatProcessorsExtensionReader getInstance() {
- if (instance == null) {
- instance = new FormatProcessorsExtensionReader();
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- instance.readRegistry(registry, "org.eclipse.wst.sse.core", "formatProcessors"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return instance;
- }
-
- private Map map = new HashMap();
-// TODO: private field never read locally
- String processorClassName;
-
- public IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
- if (contentTypeId == null)
- return null;
-
- IStructuredFormatProcessor formatProcessor = null;
- if (map.containsKey(contentTypeId)) {
- formatProcessor = (IStructuredFormatProcessor) map.get(contentTypeId);
- } else {
- IContentTypeManager manager = Platform.getContentTypeManager();
- IContentType queryContentType = manager.getContentType(contentTypeId);
- boolean found = false;
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
- String elementContentTypeId = (String) iter.next();
- IContentType elementContentType = manager.getContentType(elementContentTypeId);
- if (queryContentType.isKindOf(elementContentType)) {
- formatProcessor = (IStructuredFormatProcessor) map.get(elementContentTypeId);
- map.put(contentTypeId, formatProcessor);
- found = true;
- break;
- }
- }
-
- if (!found)
- map.put(contentTypeId, null);
- }
-
- return formatProcessor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.extension.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- protected boolean readElement(IConfigurationElement element) {
- if (element.getName().equals("processor")) { //$NON-NLS-1$
- String contentTypeId = element.getAttribute("contentTypeId"); //$NON-NLS-1$
- String processorClassName = element.getAttribute("class"); //$NON-NLS-1$
- String pluginID = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginID);
-
- try {
- IStructuredFormatProcessor processor = (IStructuredFormatProcessor)bundle.loadClass(processorClassName).newInstance();
- map.put(contentTypeId, processor);
-
- return true;
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
deleted file mode 100644
index 67de28a3ba..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.IEditorStatusLine;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-/**
- * Based on org.eclipse.jdt.internal.ui.javaeditor.GotoAnnotationAction and
- * the org.eclipse.jdt.internal.ui.JavaEditor's gotoError() method. Rewritten
- * based on 3.0M7 version to operate generically.
- *
- * @deprecated - use org.eclipse.ui.texteditor.GotoAnnotationAction
- *
- */
-public class GotoAnnotationAction extends TextEditorAction {
-
- private static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/gotoNextAnnotation")); //$NON-NLS-1$ //$NON-NLS-2$
-
- /**
- * Clears the status line on selection changed.
- */
- protected class StatusLineClearer implements ISelectionChangedListener {
- IStatusLineManager fStatusLineManager = null;
-
- protected StatusLineClearer(IStatusLineManager mgr) {
- super();
- fStatusLineManager = mgr;
- }
-
- /*
- * @see ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- getTextEditor().getSelectionProvider().removeSelectionChangedListener(StatusLineClearer.this);
-
- fStatusLineManager.setErrorMessage(null, null);
- fStatusLineManager.setMessage(null, null);
- }
- }
-
- private boolean fForward;
- private String fLabel;
-
- private String fPrefix;
-
- /**
- * @param prefix
- * @param editor
- */
- public GotoAnnotationAction(String prefix, boolean forward) {
- super(SSEUIMessages.getResourceBundle(), prefix, null);
- fForward = forward;
- fPrefix = prefix;
- fLabel = SSEUIMessages.getResourceBundle().getString(fPrefix);
- }
-
- /*
- * This is the default label used for description
- */
- public String getDefaultLabel() {
- return fLabel;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#getDescription()
- */
- public String getDescription() {
- return getDefaultLabel();
- }
-
- /**
- * Returns the annotation closest to the given range respecting the given
- * direction. If an annotation is found, the annotations current position
- * is copied into the provided annotation position.
- *
- * @param offset
- * the region offset
- * @param length
- * the region length
- * @param forward
- * <code>true</code> for forwards, <code>false</code> for
- * backward
- * @param annotationPosition
- * the position of the found annotation
- * @return the found annotation
- */
- protected Annotation getNextAnnotation(final int offset, final int length, boolean forward, Position annotationPosition) {
- Annotation nextAnnotation = null;
- Position nextAnnotationPosition = null;
- Annotation containingAnnotation = null;
- Position containingAnnotationPosition = null;
- boolean currentAnnotation = false;
-
- IDocument document = getTextEditor().getDocumentProvider().getDocument(getTextEditor().getEditorInput());
- int endOfDocument = document.getLength();
- int distance = Integer.MAX_VALUE;
-
- IAnnotationModel model = getTextEditor().getDocumentProvider().getAnnotationModel(getTextEditor().getEditorInput());
- // external files may not have an annotation model
- if (model != null) {
- Iterator e = model.getAnnotationIterator();
- while (e.hasNext()) {
- Annotation a = (Annotation) e.next();
- if (!isNavigationTarget(a))
- continue;
-
- Position p = model.getPosition(a);
- if (p == null)
- continue;
-
- if (forward && p.offset == offset || !forward && p.offset + p.getLength() == offset + length) {
- if (containingAnnotation == null || (forward && p.length >= containingAnnotationPosition.length || !forward && p.length >= containingAnnotationPosition.length)) {
- containingAnnotation = a;
- containingAnnotationPosition = p;
- currentAnnotation = p.length == length;
- }
- }
- else {
- int currentDistance = 0;
-
- if (forward) {
- currentDistance = p.getOffset() - offset;
- if (currentDistance < 0) {
- currentDistance = endOfDocument + currentDistance;
- }
-
- if (currentDistance < distance || currentDistance == distance && p.length < nextAnnotationPosition.length) {
- distance = currentDistance;
- nextAnnotation = a;
- nextAnnotationPosition = p;
- }
- }
- else {
- currentDistance = offset + length - (p.getOffset() + p.length);
- if (currentDistance < 0)
- currentDistance = endOfDocument + currentDistance;
-
- if (currentDistance < distance || currentDistance == distance && p.length < nextAnnotationPosition.length) {
- distance = currentDistance;
- nextAnnotation = a;
- nextAnnotationPosition = p;
- }
- }
- }
- }
- }
- if (containingAnnotationPosition != null && (!currentAnnotation || nextAnnotation == null)) {
- annotationPosition.setOffset(containingAnnotationPosition.getOffset());
- annotationPosition.setLength(containingAnnotationPosition.getLength());
- return containingAnnotation;
- }
- if (nextAnnotationPosition != null) {
- annotationPosition.setOffset(nextAnnotationPosition.getOffset());
- annotationPosition.setLength(nextAnnotationPosition.getLength());
- }
-
- return nextAnnotation;
- }
-
- private IStatusLineManager getStatusLineManager() {
- // The original JavaEditor M7 implementation made use of an adapter,
- // but that approach
- // fails with a MultiPageEditorSite
-
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
- return null;
- IWorkbenchPage page = window.getActivePage();
- if (page == null)
- return null;
- IEditorPart editor = page.getActiveEditor();
- if (editor == null)
- return null;
- IEditorActionBarContributor contributor = editor.getEditorSite().getActionBarContributor();
- if (contributor instanceof EditorActionBarContributor) {
- return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager();
- }
- return null;
- }
-
- public String getText() {
- return getDefaultLabel();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return getDefaultLabel();
- }
-
- /**
- * Jumps to the error next according to the given direction based off
- * JavaEditor#gotoAnnotation()
- *
- * @param forward
- * is the direction
- */
- public void gotoAnnotation(boolean forward) {
- ITextSelection selection = (ITextSelection) getTextEditor().getSelectionProvider().getSelection();
- Position position = new Position(0, 0);
- if (false /* delayed - see bug 18316 */) {
- getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
- getTextEditor().selectAndReveal(position.getOffset(), position.getLength());
- }
- else /* no delay - see bug 18316 */{
- Annotation annotation = getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
- IEditorStatusLine editorStatusLine = (IEditorStatusLine) getTextEditor().getAdapter(IEditorStatusLine.class);
- if (editorStatusLine != null) {
- editorStatusLine.setMessage(true, null, null);
- editorStatusLine.setMessage(false, null, null);
- }
- else {
- IStatusLineManager mgr = getStatusLineManager();
- if (mgr != null) {
- mgr.setErrorMessage(null);
- mgr.setMessage(null, null);
- }
- }
- if (annotation != null) {
- updateAnnotationViews(annotation);
- if (_debug) {
- System.out.println("select and reveal " + annotation.getType() + "@" + position.getOffset() + ":" + position.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- getTextEditor().selectAndReveal(position.getOffset(), position.getLength());
- if (editorStatusLine != null) {
- editorStatusLine.setMessage(true, null, null);
- editorStatusLine.setMessage(false, annotation.getText(), null);
- }
- else {
- IStatusLineManager mgr = getStatusLineManager();
- if (mgr != null) {
- mgr.setErrorMessage(null);
- mgr.setMessage(null, annotation.getText());
- }
- getTextEditor().getSelectionProvider().addSelectionChangedListener(new StatusLineClearer(mgr));
- }
- }
- }
- }
-
- /**
- * Returns whether the given annotation is configured as a target for the
- * "Go to Next/Previous Annotation" actions
- *
- * @param annotation
- * the annotation
- * @return <code>true</code> if this is a target, <code>false</code>
- * otherwise
- * @see Eclipse 3.0
- */
- protected boolean isNavigationTarget(Annotation annotation) {
- Preferences preferences = EditorsUI.getPluginPreferences();
- AnnotationPreference preference = EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
- // See bug 41689
- // String key= forward ? preference.getIsGoToNextNavigationTargetKey()
- // : preference.getIsGoToPreviousNavigationTargetKey();
- String key = preference == null ? null : preference.getIsGoToNextNavigationTargetKey();
- return (key != null && preferences.getBoolean(key));
- }
-
- public void run() {
- gotoAnnotation(fForward);
- }
-
- public void setEditor(ITextEditor editor) {
- super.setEditor(editor);
- update();
- }
-
- /**
- * Updates the annotation views that show the given annotation.
- *
- * @param annotation
- * the annotation
- */
- protected void updateAnnotationViews(Annotation annotation) {
- IMarker marker = null;
- if (annotation instanceof SimpleMarkerAnnotation)
- marker = ((SimpleMarkerAnnotation) annotation).getMarker();
-
- if (marker != null) {
- try {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IViewPart view = null;
- if (marker.isSubtypeOf(IMarker.PROBLEM)) {
- view = page.findView(IPageLayout.ID_PROBLEM_VIEW);
- }
- else if (marker.isSubtypeOf(IMarker.TASK)) {
- view = page.findView(IPageLayout.ID_TASK_LIST);
- }
- else if (marker.isSubtypeOf(IMarker.BOOKMARK)) {
- view = page.findView(IPageLayout.ID_BOOKMARKS);
- }
-// else if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
-// view = page.findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
-// }
-
- if (view == null) {
- view = page.findView("org.eclipse.ui.views.AllMarkersView");
- }
- // If the view isn't open on this perspective, don't
- // interact with it
- if (view != null) {
- Method method = view.getClass().getMethod("setSelection", new Class[]{IStructuredSelection.class, boolean.class}); //$NON-NLS-1$
- if (method != null) {
- method.invoke(view, new Object[]{new StructuredSelection(marker), Boolean.TRUE});
- page.bringToTop(view);
- }
- }
- }
- }
- }
- // ignore exceptions, don't update any of the lists, just set
- // statusline
- catch (CoreException x) {
- //
- }
- catch (NoSuchMethodException x) {
- //
- }
- catch (IllegalAccessException x) {
- //
- }
- catch (InvocationTargetException x) {
- //
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java
deleted file mode 100644
index 7995be73d0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java
+++ /dev/null
@@ -1,17 +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.sse.ui.internal;
-
-public interface IActionValidator {
- boolean isValidAction();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java
deleted file mode 100644
index 7c751bb22f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java
+++ /dev/null
@@ -1,37 +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.sse.ui.internal;
-
-
-
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- */
-public interface IDropAction {
-
-
- /**
- * @param data
- * DropTargetEvent.data will be passed.
- * @return boolean true for supported data type
- */
- public boolean isSupportedData(Object data);
-
- /**
- * @return boolean true for the action is actually processed false for the
- * action is not processed.
- */
- public boolean run(DropTargetEvent event, IEditorPart targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java
deleted file mode 100644
index e178a360a6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java
+++ /dev/null
@@ -1,30 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IEditorActionBarContributor;
-
-public interface IExtendedContributor extends IEditorActionBarContributor, IPopupMenuContributor {
- public void contributeToMenu(IMenuManager menu);
-
- public void contributeToStatusLine(IStatusLineManager manager);
-
- public void contributeToToolBar(IToolBarManager manager);
-
- public void updateToolbarActions();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java
deleted file mode 100644
index 1bfe47cb93..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java
+++ /dev/null
@@ -1,38 +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.sse.ui.internal;
-
-
-
-import org.eclipse.ui.texteditor.IUpdate;
-
-public interface IExtendedEditorAction extends IUpdate {
-
- /**
- * Returns whether this action item is visible
- *
- * @return <code>true</code> if this item is visible, and
- * <code>false</code> otherwise
- */
- public boolean isVisible();
-
- /**
- * Sets the active editor for the action. Implementors should disconnect
- * from the old editor, connect to the new editor, and update the action
- * to reflect the new editor.
- *
- * @param targetEditor
- * the new editor target
- */
- public void setActiveExtendedEditor(IExtendedSimpleEditor targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java
deleted file mode 100644
index 4f646d3910..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-
-
-import java.util.List;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * IExtendedMarkupEditor
- *
- * @deprecated use the editor's ISourceEditingTextTools adapter and cast to
- * IDOMSourceEditingTextTools when appropriate
- */
-public interface IExtendedMarkupEditor {
-
- /**
- * @deprecated - use the IDOMSourceEditingTextTools.getNode(int) method
- * with ISourceEditingTextTools.getCaretOffset()
- * @return
- */
- public Node getCaretNode();
-
- /**
- * @deprecated - use method on IDOMSourceEditingTextTools
- */
- public Document getDOMDocument();
-
- /**
- * @deprecated - some editors will provide the list of selected nodes as
- * part of ISourceEditingTextTools.getSelection()
- */
- public List getSelectedNodes();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java
deleted file mode 100644
index b187827576..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java
+++ /dev/null
@@ -1,33 +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.sse.ui.internal;
-
-/**
- * @deprecated, obtain a ISourceEditingTextTools adapter from the editor part
- */
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-
-public interface IExtendedSimpleEditor {
-
- public int getCaretPosition();
-
- public IDocument getDocument();
-
- public IEditorPart getEditorPart();
-
- public Point getSelectionRange();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java
deleted file mode 100644
index f25e2884d8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java
+++ /dev/null
@@ -1,21 +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.sse.ui.internal;
-
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public interface IModelProvider extends IDocumentProvider {
- IStructuredModel getModel(Object element);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java
deleted file mode 100644
index 964720427a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.action.IMenuManager;
-
-public interface IPopupMenuContributor {
-
- public void contributeToPopupMenu(IMenuManager menu);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java
deleted file mode 100644
index 44a599d3c2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal;
-
-public interface IReleasable {
- /**
- * Generic catch-all for releasing resources and other references
- */
- void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java
deleted file mode 100644
index 228a96823a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java
+++ /dev/null
@@ -1,29 +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.sse.ui.internal;
-
-
-
-import org.eclipse.ui.IEditorActionBarContributor;
-
-public interface ISourceViewerActionBarContributor extends IEditorActionBarContributor {
-
- /**
- * Enables disables actions that are specific to the source viewer (and
- * should only work when the source viewer is enabled)
- *
- * @param enabled
- * true if source viewer is currently enabled, false otherwise
- */
- public void setViewerSpecificContributionsEnabled(boolean enabled);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java
deleted file mode 100644
index d4b131c60a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java
+++ /dev/null
@@ -1,21 +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.wst.sse.ui.internal;
-
-public interface IStructuredTextEditorActionConstants {
- String SOURCE_CONTEXT_MENU_ID = "sourcePopupMenuId"; //$NON-NLS-1$
- String SOURCE_BEGIN = "sourceBegin"; //$NON-NLS-1$
- String SOURCE_ADDITIONS = "additions"; //$NON-NLS-1$
- String SOURCE_END = "sourceEnd"; //$NON-NLS-1$
-
- String REFACTOR_CONTEXT_MENU_ID = "refactorPopupMenuId"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java
deleted file mode 100644
index 68f6441d5f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java
+++ /dev/null
@@ -1,17 +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.sse.ui.internal;
-
-public interface ITemporaryAnnotation {
- Object getKey();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
deleted file mode 100644
index 906e3f2529..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * 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.sse.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- _log(statusObj);
-
- }
-
- /**
- * Adds {@link IStatus} to the log.
- *
- * @param statusObj {@link IStatus} to add to the log
- */
- protected static void _log(IStatus statusObj) {
- 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);
- }
-
- /**
- * <p>Allows an already constructed status to be logged</p>
- *
- * @param status {@link IStatus} to log.
- */
- public static void log(IStatus status) {
- _log(status);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
deleted file mode 100644
index 20c8cca6ea..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.sse.ui.internal;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-
-
-public class PreferenceInitializer extends AbstractPreferenceInitializer {
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- // use the base annotation & quick diff preference page
- EditorsUI.useAnnotationsPreferencePage(store);
- EditorsUI.useQuickDiffPreferencePage(store);
-
- // let annotations show up in the vertical ruler if that's what the
- // preference is
- // // these annotation preferences have a different default value than
- // the one the base provides
- // store.setDefault("errorIndicationInVerticalRuler", false);
- // //$NON-NLS-1$
- // store.setDefault("warningIndicationInVerticalRuler", false);
- // //$NON-NLS-1$
-
- // these annotation preferences are not part of base text editor
- // preference
- store.setDefault(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, true);
-
- setMatchingBracketsPreferences(store, registry);
-
- // hover help preferences are not part of base text editor preference
- String mod2Name = Action.findModifierString(SWT.MOD2); // SWT.COMMAND
- // on Mac;
- // SWT.CONTROL
- // elsewhere
- store.setDefault(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS, "combinationHover|true|0;problemHover|false|0;documentationHover|false|0;annotationHover|true|" + mod2Name); //$NON-NLS-1$
-
- // set default read-only foreground color scale value
- store.setDefault(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE, 30);
-
- // set default enable folding value
- store.setDefault(AbstractStructuredFoldingStrategy.FOLDING_ENABLED, true);
-
- // set default for show message dialog when unknown content type in editor
- store.setDefault(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, true);
-
- // set content assist defaults
- store.setDefault(EditorPreferenceNames.CODEASSIST_AUTOACTIVATION_DELAY, 500);
- PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND, new RGB(255, 255, 255)));
- PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0)));
- PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255)));
- PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0)));
-
- store.setDefault(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING, true);
- }
-
- private void setMatchingBracketsPreferences(IPreferenceStore store, ColorRegistry registry) {
- // matching brackets is not part of base text editor preference
- store.setDefault(EditorPreferenceNames.MATCHING_BRACKETS, true);
- PreferenceConverter.setDefault(store, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, ColorHelper.findRGB(registry, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192)));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java
deleted file mode 100644
index 69a968bf53..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java
+++ /dev/null
@@ -1,52 +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.wst.sse.ui.internal;
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public class ReadOnlyAwareDropTargetAdapter extends ExtendedEditorDropTargetAdapter {
-
- /**
- * @deprecated - use ReadOnlyAwareDropTargetAdapter(boolean useProxy) for
- * the performance
- */
- public ReadOnlyAwareDropTargetAdapter() {
- super();
- }
-
- public ReadOnlyAwareDropTargetAdapter(boolean useProxy) {
- super(useProxy);
- }
-
- public void drop(DropTargetEvent event) {
- IDocument document = getTextViewer().getDocument();
- if (document instanceof IStructuredDocument) {
- Point range = getTextViewer().getSelectedRange();
- if (((IStructuredDocument) document).containsReadOnly(range.x, range.y)) {
- event.operations = DND.DROP_NONE;
- event.detail = DND.DROP_NONE;
- getTextViewer().getTextWidget().redraw();
- getTextViewer().getTextWidget().update();
- getTextViewer().getTextWidget().getDisplay().beep();
- }
- }
- super.drop(event);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
deleted file mode 100644
index 114cee3f00..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * 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.sse.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by SSE UI
- *
- * @plannedfor 1.0
- */
-public class SSEUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.sse.ui.internal.SSEUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- private SSEUIMessages() {
- // cannot create new instance
- }
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SSEUIMessages.class);
- }
-
- public static String Error_opening_file_UI_;
- public static String _UI_File_is_read_only;
- public static String _32concat_EXC_;
- public static String Multiple_errors;
- public static String _Undo_Text_Change__Ctrl_Z_UI_;
- public static String Undo_Text_Change__UI_;
- public static String _Undo__0___Ctrl_Z_UI_;
- public static String Undo___0___UI_;
- public static String _Redo_Text_Change__Ctrl_Y_UI_;
- public static String Redo_Text_Change__UI_;
- public static String _Redo__0___Ctrl_Y_UI_;
- public static String Redo___0___UI_;
- public static String Format_Document_UI_;
- public static String Format_Active_Elements_UI_;
- public static String Text_Cut_UI_;
- public static String Text_Paste_UI_;
-
- public static String Cleanup_Document_UI_;
-
- public static String Editor_Cut_label;
- public static String Editor_Cut_tooltip;
- public static String Editor_Cut_image;
- public static String Editor_Cut_description;
- public static String Editor_Copy_label;
- public static String Editor_Copy_tooltip;
- public static String Editor_Copy_image;
- public static String Editor_Copy_description;
- public static String Editor_Paste_label;
- public static String Editor_Paste_tooltip;
- public static String Editor_Paste_image;
- public static String Editor_Paste_description;
- public static String Editor_Delete_label;
- public static String Editor_Delete_tooltip;
- public static String Editor_Delete_image;
- public static String Editor_Delete_description;
-
- public static String ContentAssistProposals_label;
- public static String ContentAssistProposals_tooltip;
- public static String ContentAssistProposals_description;
- public static String QuickFix_label;
- public static String QuickFix_tooltip;
- public static String QuickFix_image;
- public static String QuickFix_description;
- public static String ToggleComment_label;
- public static String ToggleComment_tooltip;
- public static String ToggleComment_image;
- public static String ToggleComment_description;
- public static String ToggleComment_progress;
- public static String AddBlockComment_label;
- public static String AddBlockComment_tooltip;
- public static String AddBlockComment_image;
- public static String AddBlockComment_description;
- public static String RemoveBlockComment_label;
- public static String RemoveBlockComment_tooltip;
- public static String RemoveBlockComment_image;
- public static String RemoveBlockComment_description;
- public static String CleanupDocument_label;
- public static String CleanupDocument_tooltip;
- public static String CleanupDocument_image;
- public static String CleanupDocument_description;
- public static String FormatDocument_label;
- public static String FormatDocument_tooltip;
- public static String FormatDocument_image;
- public static String FormatDocument_description;
- public static String FormatActiveElements_label;
- public static String FormatActiveElements_tooltip;
- public static String FormatActiveElements_image;
- public static String FormatActiveElements_description;
- public static String OpenFileFromSource_label;
- public static String OpenFileFromSource_tooltip;
- public static String OpenFileFromSource_image;
- public static String OpenFileFromSource_description;
- public static String StructureSelectEnclosing_label;
- public static String StructureSelectEnclosing_tooltip;
- public static String StructureSelectEnclosing_description;
- public static String StructureSelectNext_label;
- public static String StructureSelectNext_tooltip;
- public static String StructureSelectNext_description;
- public static String StructureSelectPrevious_label;
- public static String StructureSelectPrevious_tooltip;
- public static String StructureSelectPrevious_description;
- public static String StructureSelectHistory_label;
- public static String StructureSelectHistory_tooltip;
- public static String StructureSelectHistory_description;
- public static String Text_Shift_Right_UI_;
- public static String Text_Shift_Left_UI_;
-
- public static String _4concat;
- public static String Content_type__UI_;
- public static String Foreground_UI_;
- public static String Foreground_Color_Selector_Button;
- public static String Background_UI_;
- public static String Background_Color_Selector_Button;
- public static String Bold_UI_;
- public static String Italics_UI;
- public static String Restore_Default_UI_;
- public static String Sample_text__UI_;
-
- public static String AddBreakpoint_label;
- public static String AddBreakpoint_tooltip;
- public static String AddBreakpoint_description;
- public static String AddBreakpoint_error_dialog_title;
- public static String AddBreakpoint_error_dialog_message;
- public static String ToggleBreakpoint_label;
- public static String ToggleBreakpoint_tooltip;
- public static String ToggleBreakpoint_description;
- public static String EnableBreakpoint_label;
- public static String EnableBreakpoint_tooltip;
- public static String EnableBreakpoint_description;
- public static String DisableBreakpoint_label;
- public static String DisableBreakpoint_tooltip;
- public static String DisableBreakpoint_description;
- public static String ManageBreakpoints_add_label;
- public static String ManageBreakpoints_remove_label;
- public static String ManageBreakpoints_tooltip;
- public static String ManageBreakpoints_error_adding_title1;
- public static String ManageBreakpoints_error_adding_message1;
-
- public static String AbstractColorPageDescription;
- public static String SyntaxColoring_Link;
- public static String SyntaxColoring_Description;
- public static String EditorModelUtil_0;
- public static String EditorModelUtil_1;
-
- // TODO: These should be removed when ContentSettingsPropertyPage is
- // deleted
- // web content settings
- public static String UI_Default_HTML_DOCTYPE_ID___1;
- public static String UI_CSS_profile___2;
- public static String UI_Target_Device___3;
-
- public static String Editor_ToggleInsertMode_label;
-
- //
- // These strings are used in Workbench menu bar
- //
- public static String ExpandSelectionToMenu_label;
- public static String SourceMenu_label;
- public static String RefactorMenu_label;
-
- public static String FindOccurrencesActionProvider_0;
- public static String RemoveAction_0;
- public static String ShowPropertiesAction_0;
- public static String ContentOutlineConfiguration_0;
- public static String ContentOutlineConfiguration_1;
- public static String AbstractOpenOn_0;
- public static String FormatActionDelegate_jobName;
- public static String FormatActionDelegate_errorStatusMessage;
- public static String FormatActionDelegate_3;
- public static String FormatActionDelegate_4;
- public static String FormatActionDelegate_5;
-
- public static String TranslucencyPreferenceTab_0;
- public static String TranslucencyPreferenceTab_1;
- public static String StructuredTextEditorPreferencePage_2;
- public static String StructuredTextEditorPreferencePage_6;
- public static String StructuredTextEditorPreferencePage_20;
- public static String StructuredTextEditorPreferencePage_23;
- public static String StructuredTextEditorPreferencePage_24;
- public static String StructuredTextEditorPreferencePage_30;
- public static String StructuredTextEditorPreferencePage_37;
- public static String StructuredTextEditorPreferencePage_38;
- public static String StructuredTextEditorPreferencePage_40;
- public static String StructuredTextEditorPreferencePage_41;
- public static String StructuredTextEditorPreferencePage_42;
- public static String StructuredTextEditorPreferencePage_43;
- public static String StructuredTextEditorPreferencePage_44;
- public static String TaskTagPreferenceTab_0;
- public static String TaskTagPreferenceTab_1;
- public static String TaskTagPreferenceTab_2;
- public static String TaskTagPreferenceTab_3;
- public static String TaskTagPreferenceTab_5;
- public static String TaskTagPreferenceTab_6;
- public static String TaskTagPreferenceTab_7;
- public static String TaskTagPreferenceTab_12;
- public static String TaskTagPreferenceTab_13;
- public static String TaskTagPreferenceTab_14;
- public static String TaskTagPreferenceTab_15;
- public static String TaskTagPreferenceTab_16;
- public static String TaskTagPreferenceTab_17;
- public static String TaskTagPreferenceTab_18;
- public static String TaskTagPreferenceTab_19;
- public static String TaskTagPreferenceTab_20;
- public static String TaskTagPreferenceTab_22;
- public static String TaskTagPreferenceTab_23;
- public static String TaskTagPreferenceTab_24;
- public static String TaskTagPreferenceTab_25;
- public static String TaskTagPreferenceTab_26;
- public static String TaskTagPreferenceTab_27;
- public static String TaskTagPreferenceTab_28;
- public static String TaskTagPreferenceTab_29;
- public static String TaskTagPreferenceTab_30;
- public static String TaskTagPreferenceTab_31;
- public static String TaskTagPreferencePage_32;
- public static String TaskTagPreferenceTab_33;
- public static String TaskTagExclusionTab_01;
- public static String TaskTagExclusionTab_02;
- public static String TaskTagExclusionTab_03;
-
- public static String PropertyPreferencePage_01;
- public static String PropertyPreferencePage_02;
-
- public static String FilePreferencePage_0;
- public static String NoModificationCompletionProposal_0;
- public static String ToggleBreakpointAction_0;
- public static String ManageBreakpointAction_0;
- public static String ManageBreakpointAction_1;
- public static String EditBreakpointAction_0;
- // Used in Structured Text Editor Preference Page / Hovers Tab
- public static String TextHoverPreferenceTab_title;
- public static String TextHoverPreferenceTab_hoverPreferences;
- public static String TextHoverPreferenceTab_keyModifier;
- public static String TextHoverPreferenceTab_description;
- public static String TextHoverPreferenceTab_modifierIsNotValid;
- public static String TextHoverPreferenceTab_modifierIsNotValidForHover;
- public static String TextHoverPreferenceTab_duplicateModifier;
- public static String TextHoverPreferenceTab_nameColumnTitle;
- public static String TextHoverPreferenceTab_modifierColumnTitle;
- public static String TextHoverPreferenceTab_delimiter;
- public static String TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter;
- public static String TextHoverPreferenceTab_insertModifierAndDelimiter;
- public static String TextHoverPreferenceTab_insertDelimiterAndModifier;
-
- // used dynamically
- public static String combinationHover_label;
- public static String combinationHover_desc;
- public static String problemHover_label;
- public static String problemHover_desc;
- public static String documentationHover_label;
- public static String documentationHover_desc;
- public static String annotationHover_label;
- public static String annotationHover_desc;
-
- public static String EditStructuredTextEditorPreferencesAction_0;
- public static String StructuredTextEditorPreferencePage_0;
- public static String StructuredTextEditorPreferencePage_1;
- public static String PreferenceManager_0;
-
- public static String OccurrencesSearchQuery_0;
- public static String OccurrencesSearchQuery_2;
- public static String ShowView_errorTitle;
- public static String proc_dirty_regions_0;
-
- public static String textHoverMakeStickyHint;
-
- // Encoding
- public static String EncodingPreferencePage_0;
- public static String EncodingPreferencePage_1;
-
- public static String caret_update;
- public static String EmptyFilePreferencePage_0;
-
- public static String OffsetStatusLineContributionItem_0;
- public static String OffsetStatusLineContributionItem_2;
- public static String OffsetStatusLineContributionItem_3;
- public static String OffsetStatusLineContributionItem_4;
- public static String OffsetStatusLineContributionItem_5;
- public static String OffsetStatusLineContributionItem_6;
- public static String OffsetStatusLineContributionItem_7;
- public static String OffsetStatusLineContributionItem_8;
- public static String OffsetStatusLineContributionItem_9;
- public static String OffsetStatusLineContributionItem_10;
- public static String OffsetStatusLineContributionItem_11;
- public static String OffsetStatusLineContributionItem_12;
- public static String OffsetStatusLineContributionItem_13;
- public static String OffsetStatusLineContributionItem_14;
- public static String OffsetStatusLineContributionItem_15;
- public static String OffsetStatusLineContributionItem_16;
- public static String OffsetStatusLineContributionItem_17;
- public static String OffsetStatusLineContributionItem_18;
- public static String OffsetStatusLineContributionItem_19;
- public static String OffsetStatusLineContributionItem_20;
-
- /*
- * *****Below are possibly unused strings that may be removed *****
- */
- public static String Save_label;
- public static String An_error_has_occurred_when_ERROR_;
- public static String Problems_During_Save_As_UI_;
- public static String Save_could_not_be_complete_UI_;
- public static String SemanticHighlightingReconciler_0;
- public static String ManageBreakpoints_error_removing_title1;
- public static String ManageBreakpoints_error_removing_message1;
- public static String ManageBreakpoints_error_retrieving_message;
- public static String JSPSourcePreferencePageDescription;
- public static String Editor_error_save_message;
- public static String Editor_error_save_title;
- public static String Editor_warning_save_delete;
-
- public static String Previous_annotation;
- public static String Next_annotation;
-
- public static String AnnotationTypes_Errors;
- public static String AnnotationTypes_Warnings;
- public static String AnnotationTypes_Tasks;
- public static String AnnotationTypes_SearchResults;
- public static String AnnotationTypes_Bookmarks;
- public static String AnnotationTypes_Others;
-
- public static String Editor_ConvertToWindows_label;
- public static String Editor_ConvertToWindows_tooltip;
- public static String Editor_ConvertToWindows_image;
- public static String Editor_ConvertToWindows_description;
-
- public static String Editor_ConvertToUNIX_label;
- public static String Editor_ConvertToUNIX_tooltip;
- public static String Editor_ConvertToUNIX_image;
- public static String Editor_ConvertToUNIX_description;
-
- public static String Editor_ConvertToMac_label;
- public static String Editor_ConvertToMac_tooltip;
- public static String Editor_ConvertToMac_image;
- public static String Editor_ConvertToMac_description;
- public static String ConvertLineDelimitersMenu_label;
- public static String FindOccurrences_label;
-
- public static String ConvertLineDelimitersToCRLFActionDelegate_jobName;
- public static String ConvertLineDelimitersToCRLFActionDelegate_errorStatusMessage;
- public static String ConvertLineDelimitersToCRLFActionDelegate_3;
- public static String ConvertLineDelimitersToCRLFActionDelegate_4;
-
- public static String TextHoverPreferenceTab_annotationRollover;
- public static String TextHoverPreferenceTab_showAffordance;
- public static String TextHoverPreferenceTab_enabled;
-
- public static String BasicFindOccurrencesAction_0;
- public static String BasicSearchLabelProvider_0;
- public static String NavigationPreferenceTab_0;
- public static String OccurrencesSearchQuery_1;
- public static String FileModelProvider_0;
- public static String JFaceNodeAdapter_0;
-
- public static String ConfigureProjectSettings;
- public static String ConfigureWorkspaceSettings;
- public static String EnableProjectSettings;
-
- public static String GotoMatchingBracket_label;
- public static String GotoMatchingBracket_description;
- public static String GotoMatchingBracket_tooltip;
- public static String GotoMatchingBracket_error_invalidSelection;
- public static String GotoMatchingBracket_error_noMatchingBracket;
- public static String GotoMatchingBracket_error_bracketOutsideSelectedElement;
-
- public static String LoadingReferencedGrammars;
-
- public static String Folding;
- public static String StructuredTextEditorPreferencePage_3;
- public static String Projection_Toggle_label;
- public static String Projection_Toggle_tooltip;
- public static String Projection_Toggle_description;
- public static String Projection_Toggle_image;
- public static String Projection_ExpandAll_label;
- public static String Projection_ExpandAll_tooltip;
- public static String Projection_ExpandAll_description;
- public static String Projection_ExpandAll_image;
- public static String Projection_CollapseAll_label;
- public static String Projection_CollapseAll_tooltip;
- public static String Projection_CollapseAll_description;
- public static String Projection_CollapseAll_image;
-
- // These strings are accessed using resource bundle and in properties
- // file, need to use '.' instead of '_' in some keys
- public static String Editor_ManageBookmarks_tooltip;
- public static String Editor_ManageBookmarks_image;
- public static String Editor_ManageBookmarks_description;
- public static String Editor_ManageBookmarks_add_label;
- public static String Editor_ManageBookmarks_remove_label;
- public static String Editor_ManageBookmarks_add_dialog_title;
- public static String Editor_ManageBookmarks_add_dialog_message;
- public static String Editor_ManageBookmarks_error_dialog_title;
- public static String Editor_ManageBookmarks_error_dialog_message;
- public static String Editor_ManageTasks_tooltip;
- public static String Editor_ManageTasks_image;
- public static String Editor_ManageTasks_description;
- public static String Editor_ManageTasks_add_label;
- public static String Editor_ManageTasks_remove_label;
- public static String Editor_ManageTasks_add_dialog_title;
- public static String Editor_ManageTasks_add_dialog_message;
- public static String Editor_ManageTasks_error_dialog_title;
- public static String Editor_ManageTasks_error_dialog_message;
- /*
- * *****Above are possibly unused strings that may be removed*****
- */
-
- public static String StructuredTextEditorPreferencePage_39;
- public static String StructuredTextEditor_0;
- public static String UnknownContentTypeDialog_0;
- public static String UnknownContentTypeDialog_1;
- public static String UnknownContentTypeDialog_2;
- public static String StyledTextColorPicker_0;
-
- public static String TextSearchLabelProvider_matchCountFormat;
-
- //content assist messages
- public static String ContentAssist_computing_proposals;
- public static String ContentAssist_collecting_proposals;
- public static String ContentAssist_sorting_proposals;
- public static String ContentAssist_collecting_contexts;
- public static String ContentAssist_computing_contexts;
- public static String ContentAssist_sorting_contexts;
- public static String ContentAssist_no_completions;
- public static String ContentAssist_all_disabled_title;
- public static String ContentAssist_all_disabled_message;
- public static String ContentAssist_all_disabled_preference_link;
- public static String ContentAssist_no_message;
- public static String ContentAssist_toggle_affordance_update_message;
- public static String ContentAssist_defaultProposalCategory_title;
- public static String ContentAssist_press;
- public static String ContentAssist_click;
- public static String OptionalMessageDialog_dontShowAgain;
-
- //content assist preference messages
- public static String CodeAssistAdvancedConfigurationBlock_page_description;
- public static String CodeAssistAdvancedConfigurationBlock_no_shortcut;
- public static String CodeAssistAdvancedConfigurationBlock_Up;
- public static String CodeAssistAdvancedConfigurationBlock_Down;
- public static String CodeAssistAdvancedConfigurationBlock_separate_table_description;
- public static String CodeAssistAdvancedConfigurationBlock_default_table_description;
- public static String CodeAssistAdvancedConfigurationBlock_default_table_category_column_title;
- public static String CodeAssistAdvancedConfigurationBlock_PagesDown;
- public static String CodeAssistAdvancedConfigurationBlock_PagesUp;
- public static String CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title;
-
- // Validation
- public static String Validation_Title;
- public static String Validation_Workspace;
- public static String Validation_Project;
- public static String Validation_jobName;
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
deleted file mode 100644
index d46cf03352..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-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;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.osgi.framework.BundleContext;
-
-
-public class SSEUIPlugin extends AbstractUIPlugin {
-
- public final static String ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
- static SSEUIPlugin instance = null;
-
- private FormToolkit fDialogsFormToolkit;
-
- public static SSEUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static SSEUIPlugin getInstance() {
- return instance;
- }
-
- private TextHoverManager fTextHoverManager;
-
- public SSEUIPlugin() {
- super();
- instance = this;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * Return text hover manager
- *
- * @return TextHoverManager
- */
- public TextHoverManager getTextHoverManager() {
- if (fTextHoverManager == null) {
- fTextHoverManager = new TextHoverManager();
- }
- return fTextHoverManager;
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- public FormToolkit getDialogsFormToolkit() {
- if (fDialogsFormToolkit == null) {
- FormColors colors= new FormColors(Display.getCurrent());
- colors.setBackground(null);
- colors.setForeground(null);
- fDialogsFormToolkit= new FormToolkit(colors);
- }
- return fDialogsFormToolkit;
- }
-
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- /**
- * <p>A utility function for getting the active workbench shell.</p>
- *
- * @return the active workbench {@link Shell}
- */
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- return window.getShell();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
deleted file mode 100644
index 64765db3ce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
+++ /dev/null
@@ -1,450 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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
-#
-###############################################################################
-Error_opening_file_UI_=Error opening file
-_UI_File_is_read_only=File {0} is read-only.
-_32concat_EXC_=Editor could not be open on {0}
-Multiple_errors=Multiple annotations found at this line:
-_Undo_Text_Change__Ctrl_Z_UI_=&Undo Text Change
-Undo_Text_Change__UI_=Undo Text Change.
-_Undo__0___Ctrl_Z_UI_=&Undo {0}
-Undo___0___UI_=Undo: {0}.
-_Redo_Text_Change__Ctrl_Y_UI_=&Redo Text Change
-Redo_Text_Change__UI_=Redo Text Change.
-_Redo__0___Ctrl_Y_UI_=&Redo {0}
-Redo___0___UI_=Redo: {0}.
-Format_Document_UI_=Format
-Format_Active_Elements_UI_=Format Active Elements
-Text_Cut_UI_=Text Cut
-Text_Paste_UI_=Text Paste
-###############################################################################
-Cleanup_Document_UI_=Cleanup Document
-
-Editor_Cut_label=Cu&t
-Editor_Cut_tooltip=Cut
-Editor_Cut_image=
-Editor_Cut_description=Cut
-
-Editor_Copy_label=&Copy
-Editor_Copy_tooltip=Copy
-Editor_Copy_image=
-Editor_Copy_description=Copy
-
-Editor_Paste_label=&Paste
-Editor_Paste_tooltip=Paste
-Editor_Paste_image=
-Editor_Paste_description=Paste
-
-Editor_Delete_label=&Delete@Delete
-Editor_Delete_tooltip=Delete
-Editor_Delete_image=
-Editor_Delete_description=Delete
-
-ContentAssistProposals_label=Con&tent Assist
-ContentAssistProposals_tooltip=Content Assist
-ContentAssistProposals_description=Content Assist
-
-QuickFix_label=&Quick Fix
-QuickFix_tooltip=Quick Fix
-QuickFix_image=
-QuickFix_description=Quick Fix
-
-ToggleComment_label=Togg&le Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_image=
-ToggleComment_description=Toggle Comment
-ToggleComment_progress=Toggling line comments...
-AddBlockComment_label=Add &Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_image=
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Bloc&k Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_image=
-RemoveBlockComment_description=Remove Block Comment
-CleanupDocument_label=C&leanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_image=
-CleanupDocument_description=Cleanup Document
-FormatDocument_label=&Format
-FormatDocument_tooltip=Format
-FormatDocument_image=
-FormatDocument_description=Format
-FormatActiveElements_label=Format Act&ive Elements
-FormatActiveElements_tooltip=Format Active Elements
-FormatActiveElements_image=
-FormatActiveElements_description=Format Active Elements
-OpenFileFromSource_label=Op&en Selection
-OpenFileFromSource_tooltip=Open an editor on the selected link
-OpenFileFromSource_image=
-OpenFileFromSource_description=Open an editor on the selected link
-StructureSelectEnclosing_label=&Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=&Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=&Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-StructureSelectHistory_label=&Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
-StructureSelectHistory_description=Restore last selection
-Text_Shift_Right_UI_=Text Shift Right
-Text_Shift_Left_UI_=Text Shift Left
-
-_4concat=''{0}'' is not a valid input
-## The following strings are for "XML->XML Source->XML Style" Preferences, "Web Tools->Source->HTML Style" Preferences, and "Web Tools->Source->JavaScript Style" Preferences
-Content_type__UI_=Co&ntent type:
-Foreground_UI_=&Foreground:
-Foreground_Color_Selector_Button=Foreground Color Selector
-Background_UI_=Backgr&ound:
-Background_Color_Selector_Button=Background Color Selector
-Bold_UI_=B&old
-Italics_UI=Italics
-Restore_Default_UI_=&Restore Default
-Sample_text__UI_=&Sample text:
-##
-AddBreakpoint_label=Add &Breakpoint
-AddBreakpoint_tooltip=Add Breakpoint
-AddBreakpoint_description=Add Breakpoint
-AddBreakpoint_error_dialog_title=Add Breakpoint
-AddBreakpoint_error_dialog_message=Cannot add breakpoint
-##
-ToggleBreakpoint_label=Toggle Breakpoint
-ToggleBreakpoint_tooltip=Toggle Breakpoint
-ToggleBreakpoint_description=Toggle Breakpoint
-##
-EnableBreakpoint_label=Enable Breakpoint
-EnableBreakpoint_tooltip=Enable Breakpoint
-EnableBreakpoint_description=Enable Breakpoint
-##
-DisableBreakpoint_label=Disable Breakpoint
-DisableBreakpoint_tooltip=Disable Breakpoint
-DisableBreakpoint_description=Disable Breakpoint
-##
-ManageBreakpoints_add_label=Add &Breakpoint
-ManageBreakpoints_remove_label=Remove Breakpoint
-ManageBreakpoints_tooltip=Add/Remove Breakpoint
-ManageBreakpoints_error_adding_title1=Add Breakpoint
-ManageBreakpoints_error_adding_message1=Cannot add breakpoint
-
-AbstractColorPageDescription=Customize the syntax highlighting by selecting the type of text whose style you want to customize from either the combo box or the sample text area
-##
-EditorModelUtil_0=model in invalid state
-EditorModelUtil_1=There was a problem adding adapter factories
-
-# web content settings
-UI_Default_HTML_DOCTYPE_ID___1=&Document type:
-UI_CSS_profile___2=&CSS profile:
-UI_Target_Device___3=&Target device:
-
-Editor_ToggleInsertMode_label=Sma&rt Insert Mode
-
-##########################################################################
-# These strings are used in Workbench menu bar
-##########################################################################
-ExpandSelectionToMenu_label=E&xpand Selection To
-SourceMenu_label=&Source
-RefactorMenu_label=Refac&tor
-#
-FindOccurrencesActionProvider_0=Current selection does not resolve to a searchable element
-RemoveAction_0=Remove Property
-ShowPropertiesAction_0=P&roperties
-ContentOutlineConfiguration_0=Collapse All
-ContentOutlineConfiguration_1=&Link with Editor
-AbstractOpenOn_0=Current text selection does not resolve to a file
-FormatActionDelegate_jobName=Formatting...
-FormatActionDelegate_errorStatusMessage=Exceptions occurred while formatting documents
-FormatActionDelegate_3=Formatting {0}
-FormatActionDelegate_4=Exception occurred while formatting document {0}
-FormatActionDelegate_5=MalformedInputException occurred while formatting document {0}
-TranslucencyPreferenceTab_0=Read-Only text style
-TranslucencyPreferenceTab_1=Read-Only contrast percentage:
-StructuredTextEditorPreferencePage_2=Matching brackets highlight
-StructuredTextEditorPreferencePage_6=The following preferences apply to the HTML, JSP, XML, and other source editors.
-StructuredTextEditorPreferencePage_20=Highlight &matching brackets
-StructuredTextEditorPreferencePage_23=Appearance co&lor options:
-StructuredTextEditorPreferencePage_24=C&olor:
-StructuredTextEditorPreferencePage_30=&Report problems as you type
-StructuredTextEditorPreferencePage_37=Empty input
-StructuredTextEditorPreferencePage_38=is not a valid input.
-StructuredTextEditorPreferencePage_39=Inform when &unsupported content type is in editor
-StructuredTextEditorPreferencePage_40=Also see the <a>''{0}''</a> preferences.
-StructuredTextEditorPreferencePage_41=Completion proposal background
-StructuredTextEditorPreferencePage_42=Completion proposal foreground
-StructuredTextEditorPreferencePage_43=Parameter hints background
-StructuredTextEditorPreferencePage_44=Parameter hints foreground
-TaskTagPreferenceTab_0=Low
-TaskTagPreferenceTab_1=Normal
-TaskTagPreferenceTab_2=High
-TaskTagPreferenceTab_3=N/A
-TaskTagPreferenceTab_5=Task Tag
-TaskTagPreferenceTab_6=Tag:
-TaskTagPreferenceTab_7=Priority:
-TaskTagPreferenceTab_12=Tag
-TaskTagPreferenceTab_13=Priority
-TaskTagPreferenceTab_14=&New...
-TaskTagPreferenceTab_15=Ed&it...
-TaskTagPreferenceTab_16=&Remove
-TaskTagPreferenceTab_17=&Select All
-TaskTagPreferenceTab_18=Deselect A&ll
-TaskTagPreferenceTab_19=Note: tags are case insensitive
-TaskTagPreferenceTab_20=&Task Tags
-TaskTagPreferenceTab_22=Task Tags Settings Changed
-TaskTagPreferenceTab_23=The task tags settings have changed. Make these changes effective now?
-TaskTagPreferenceTab_24=Yes
-TaskTagPreferenceTab_25=No
-TaskTagPreferenceTab_26=Cancel
-TaskTagPreferenceTab_27=Scanning files for tasks
-TaskTagPreferenceTab_28=detection aborted
-TaskTagPreferenceTab_29=detection completed
-TaskTagPreferenceTab_30=detection encountered errors
-TaskTagPreferenceTab_31=&Enable searching for Task Tags
-TaskTagPreferencePage_32=&Clean and redetect Tasks
-TaskTagPreferenceTab_33=Ta&gs in comments indicating Tasks:
-TaskTagExclusionTab_01=&Filters
-TaskTagExclusionTab_02=Sca&n the selected Content Types:
-TaskTagExclusionTab_03=Affected Content T&ypes:
-
-PropertyPreferencePage_01=Project Specific Configuration
-PropertyPreferencePage_02=Select the project to configure:
-
-FilePreferencePage_0=Expand the tree to edit preferences for a specific content type.
-NoModificationCompletionProposal_0=No corrections available
-ToggleBreakpointAction_0=Toggle &Breakpoints
-ManageBreakpointAction_0=&Enable Breakpoints
-ManageBreakpointAction_1=&Disable Breakpoints
-EditBreakpointAction_0=Breakpoint &Properties...
-## Used in Structured Text Editor Preference Page / Hovers Tab
-TextHoverPreferenceTab_title=Hovers
-TextHoverPreferenceTab_hoverPreferences=Text &Hover key modifier preferences:
-TextHoverPreferenceTab_keyModifier=Pressed key &modifier while hovering:
-TextHoverPreferenceTab_description=Description:
-TextHoverPreferenceTab_modifierIsNotValid=Modifier ''{0}'' is not valid.
-TextHoverPreferenceTab_modifierIsNotValidForHover=Modifier ''{0}'' for ''{1}'' hover is not valid.
-TextHoverPreferenceTab_duplicateModifier=''{0}'' hover uses the same modifier as ''{1}'' hover.
-TextHoverPreferenceTab_nameColumnTitle=Text Hover Name
-TextHoverPreferenceTab_modifierColumnTitle=Pressed Key Modifier While Hovering
-TextHoverPreferenceTab_delimiter=+
-TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter=\ + {0} +
-TextHoverPreferenceTab_insertModifierAndDelimiter=\ {0} +
-TextHoverPreferenceTab_insertDelimiterAndModifier=\ + {0}
-combinationHover_label=Combined Hover
-combinationHover_desc=Tries the hovers in the sequence listed in the table below this one and uses the one which fits best for the selected element and the current context.
-problemHover_label=Problem Description
-problemHover_desc=Shows the description of the selected problem.
-documentationHover_label=Documentation Description
-documentationHover_desc=Shows the documentation of the selected element.
-annotationHover_label=Annotation Description
-annotationHover_desc=Shows the description of the selected annotation.
-EditStructuredTextEditorPreferencesAction_0=Editor Preferences
-StructuredTextEditorPreferencePage_0=Appearance
-StructuredTextEditorPreferencePage_1=Enable &semantic highlighting
-PreferenceManager_0=Original Error:
-
-OccurrencesSearchQuery_0={0} - {1} occurrences in {2}
-OccurrencesSearchQuery_2=file
-ShowView_errorTitle=Problems Showing View
-proc_dirty_regions_0 = Processing Dirty Regions
-
-textHoverMakeStickyHint=Press ''{0}'' for focus.
-
-## Encoding
-EncodingPreferencePage_0=Encoding settings for Web and XML files:
-EncodingPreferencePage_1=Use 3 byte BOM (Byte Order Mark) when saving UTF-8 encoded files
-caret_update=caret update
-EmptyFilePreferencePage_0=This category ID has been replaced by 'org.eclipse.wst.xml.ui.preferences.xml' and 'org.eclipse.wst.html.ui.preferences.web'
-OffsetStatusLineContributionItem_0=Selection Information:
-OffsetStatusLineContributionItem_2=Partitions
-OffsetStatusLineContributionItem_3=ITextRegions
-OffsetStatusLineContributionItem_4=Structured Model Content-Type:
-OffsetStatusLineContributionItem_5=Model Handler:
-OffsetStatusLineContributionItem_6=Document Class:
-OffsetStatusLineContributionItem_7=Document Provider Class:
-OffsetStatusLineContributionItem_8=Partitionings:
-OffsetStatusLineContributionItem_9=Start
-OffsetStatusLineContributionItem_10=Length
-OffsetStatusLineContributionItem_11=Type
-OffsetStatusLineContributionItem_12=Input Type:
-OffsetStatusLineContributionItem_13=Partitioner:
-OffsetStatusLineContributionItem_14=Structured Selection
-OffsetStatusLineContributionItem_15=Start
-OffsetStatusLineContributionItem_16=Length
-OffsetStatusLineContributionItem_17=Text Length
-OffsetStatusLineContributionItem_18=Context
-OffsetStatusLineContributionItem_19=Workbench Selection
-OffsetStatusLineContributionItem_20=Indexed Regions
-
-StructuredTextEditor_0=Unsupported content type warning
-UnknownContentTypeDialog_0=Unsupported Content Type
-UnknownContentTypeDialog_1=Do not show this message again
-UnknownContentTypeDialog_2=Unsupported content type in editor.\nTo associate file extension with a supported content type,\nplease see <a>Content Types Preference Page</a>
-
-################################################################################
-## Below are possibly unused strings that may be removed
-################################################################################
-Save_label=&Save
-An_error_has_occurred_when_ERROR_=An error has occurred when retrieving resources for the source editor. The Eclipse Workbench installation may have been corrupted.
-## save as problems (next two) should match what is in workbench
-Problems_During_Save_As_UI_=Problems During Save As...
-Save_could_not_be_complete_UI_=Save could not be completed.
-SemanticHighlightingReconciler_0=Semantic Highlighting Job
-ManageBreakpoints_error_removing_title1=Remove Breakpoint
-ManageBreakpoints_error_removing_message1=Cannot remove breakpoint
-ManageBreakpoints_error_retrieving_message=Retrieving markers failed:
-JSPSourcePreferencePageDescription=Embedded content type\'s source preferences will be used. Select the file type for customization
-# The following lines copied from org\eclipse\ui\editors\text\TextEditorMessages.properties in org.eclipse.ui plugin
-Editor_error_save_message=Save could not be completed. {0}
-Editor_error_save_title=Problems During Save As...
-Editor_warning_save_delete=The original file ''{0}'' has been deleted.
-
-# actions
-Previous_annotation=Previous Annotation
-Next_annotation=Next Annotation
-# Annotation Types
-AnnotationTypes_Errors=Errors
-AnnotationTypes_Warnings=Warnings
-AnnotationTypes_Tasks=Tasks
-AnnotationTypes_SearchResults=Search Results
-AnnotationTypes_Bookmarks=Bookmarks
-AnnotationTypes_Others=Others
-
-Editor_ConvertToWindows_label=&Windows
-Editor_ConvertToWindows_tooltip=Converts line delimiters to Windows
-Editor_ConvertToWindows_image=
-Editor_ConvertToWindows_description=Converts line delimiters to Windows
-
-Editor_ConvertToUNIX_label=&UNIX
-Editor_ConvertToUNIX_tooltip=Converts line delimiters to UNIX
-Editor_ConvertToUNIX_image=
-Editor_ConvertToUNIX_description=Converts line delimiters to UNIX
-
-Editor_ConvertToMac_label=&Mac
-Editor_ConvertToMac_tooltip=Converts line delimiters to Mac
-Editor_ConvertToMac_image=
-Editor_ConvertToMac_description=Converts line delimiters to Mac
-ConvertLineDelimitersMenu_label=Co&nvert Line Delimiters to
-FindOccurrences_label=O&ccurrences in File
-
-ConvertLineDelimitersToCRLFActionDelegate_jobName=Converting line delimiters
-ConvertLineDelimitersToCRLFActionDelegate_errorStatusMessage=Exceptions occurred while converting line delimiters
-ConvertLineDelimitersToCRLFActionDelegate_3=Converting line delimiters for {0}
-ConvertLineDelimitersToCRLFActionDelegate_4=Exception occurred while converting line delimiters for document {0}
-TextHoverPreferenceTab_annotationRollover=&Enable annotation roll-over (on new editors)
-TextHoverPreferenceTab_showAffordance=&Show affordance in hover on how to make it sticky
-TextHoverPreferenceTab_enabled=&Enabled
-
-BasicFindOccurrencesAction_0=region match:
-BasicSearchLabelProvider_0=line
-NavigationPreferenceTab_0=Modifier ''{0}'' is not valid.
-OccurrencesSearchQuery_1={0} - 1 Occurrence in {1}
-FileModelProvider_0=Error reloading {0}
-JFaceNodeAdapter_0=Update Outline
-
-ConfigureProjectSettings=Configure Project Specific Settings...
-ConfigureWorkspaceSettings=Configure Workspace Settings...
-EnableProjectSettings=Enable &project specific settings
-
-LoadingReferencedGrammars=Loading referenced grammars
-
-## Folding
-Folding=Folding
-StructuredTextEditorPreferencePage_3=Enable &folding
-Projection_Toggle_label= &Enable Folding
-Projection_Toggle_tooltip= Toggles Folding
-Projection_Toggle_description= Toggles folding for the current editor
-Projection_Toggle_image=
-Projection_ExpandAll_label= Expand &All
-Projection_ExpandAll_tooltip= Expands All Collapsed Regions
-Projection_ExpandAll_description= Expands any collapsed regions in the current editor
-Projection_ExpandAll_image=
-Projection_CollapseAll_label= Collapse A&ll
-Projection_CollapseAll_tooltip= Collapses All Expanded Regions
-Projection_CollapseAll_description= Collapse any expanded regions in the current editor
-Projection_CollapseAll_image=
-
-## These are copied from org.eclipse.ui.texteditor.EditorMessages.properties
-## They are needed temporarily until CMVC defect 203158 / Bugzilla defect 20054 is fixed
-Editor_ManageBookmarks_tooltip=Adds and Removes Bookmarks
-Editor_ManageBookmarks_image=
-Editor_ManageBookmarks_description=Adds and removes Bookmarks
-Editor_ManageBookmarks_add_label=Add Boo&kmark...
-Editor_ManageBookmarks_remove_label=Remove Boo&kmark
-Editor_ManageBookmarks_add_dialog_title=Add Bookmark
-Editor_ManageBookmarks_add_dialog_message=Enter Bookmark name
-Editor_ManageBookmarks_error_dialog_title=Managing Bookmarks
-Editor_ManageBookmarks_error_dialog_message=Problems managing bookmarks
-
-Editor_ManageTasks_tooltip=Adds and Removes Tasks
-Editor_ManageTasks_image=
-Editor_ManageTasks_description=Adds and removes Tasks
-Editor_ManageTasks_add_label=Add &Task...
-Editor_ManageTasks_remove_label=Remove &Task
-Editor_ManageTasks_add_dialog_title=Add Task
-Editor_ManageTasks_add_dialog_message=Enter Task description
-Editor_ManageTasks_error_dialog_title=Managing Tasks
-Editor_ManageTasks_error_dialog_message=Problems managing tasks
-################################################################################
-## Above are possibly unused strings that may be removed
-###############################################################################
-StyledTextColorPicker_0=Pick a color
-SyntaxColoring_Link=Default colors and font can be configured on the <a href=\"org.eclipse.ui.preferencePages.GeneralTextEditor\">Text Editors</a> and on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">Colors and Fonts</a> preference pages. Decorations for annotations can be configured on the <a href=\"org.eclipse.ui.editors.preferencePages.Annotations\">Annotations</a> preference page.
-SyntaxColoring_Description=Customize the syntax highlighting by selecting the type of text whose style you want to customize from either the list or the example text area.
-
-GotoMatchingBracket_label= Matching &Bracket
-GotoMatchingBracket_tooltip=Go to Matching Bracket
-GotoMatchingBracket_description=Go to Matching Bracket
-GotoMatchingBracket_error_invalidSelection=No bracket selected
-GotoMatchingBracket_error_noMatchingBracket=No matching bracket found
-GotoMatchingBracket_error_bracketOutsideSelectedElement=Matching bracket is outside the selected element
-
-TextSearchLabelProvider_matchCountFormat=({0} matches)
-
-
-##################################################
-## Content Assist Strings
-##################################################
-ContentAssist_computing_proposals=Computing completion proposals
-ContentAssist_collecting_proposals=Collecting completion proposals
-ContentAssist_sorting_proposals=Sorting completion proposals
-ContentAssist_collecting_contexts=Collecting context information
-ContentAssist_computing_contexts=Computing context information
-ContentAssist_sorting_contexts=Sorting context information
-ContentAssist_no_completions=No completions available.
-ContentAssist_all_disabled_title=Content Assist Problem
-ContentAssist_all_disabled_message=Some content proposal kinds have been uninstalled. It is recommended to review the content assist settings.
-ContentAssist_all_disabled_preference_link=Change the settings on the <a>Content Assist preference page</a> or click ''{0}'' to restore the default behavior.
-ContentAssist_no_message= No {0}
-ContentAssist_toggle_affordance_update_message={1} to show {2}
-ContentAssist_defaultProposalCategory_title=Default Proposals
-ContentAssist_press=Press ''{0}''
-ContentAssist_click=Click
-OptionalMessageDialog_dontShowAgain= Do not show this &message again
-
-##################################################
-## Content Assist Properties page Strings
-##################################################
-CodeAssistAdvancedConfigurationBlock_page_description=Configure the behavior of the content assist ({0}) command.
-CodeAssistAdvancedConfigurationBlock_no_shortcut=no shortcut
-CodeAssistAdvancedConfigurationBlock_Up=&Up
-CodeAssistAdvancedConfigurationBlock_Down=D&own
-CodeAssistAdvancedConfigurationBlock_default_table_description=Select the proposal &categories contained in the 'default' content assist list:
-CodeAssistAdvancedConfigurationBlock_default_table_category_column_title=Default Proposal Categories
-CodeAssistAdvancedConfigurationBlock_PagesDown=Do&wn
-CodeAssistAdvancedConfigurationBlock_PagesUp=U&p
-CodeAssistAdvancedConfigurationBlock_separate_table_description=Select the &enablement and order of proposal categories that are cycled through when repeatedly invoking content assist:
-CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title=Content Assist Pages
-Validation_Title=Validation Settings Changed
-Validation_Workspace=The validation settings have changed. A full validation is required for changes to take effect. Validate now?
-Validation_Project=The validation settings have changed. A validation of the project is required for changes to take effect. Validate the project now?
-Validation_jobName=Validating... \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java
deleted file mode 100644
index 6e3aa6392c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.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.sse.ui.internal;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Surfaces a View.
- *
- * @author Nitin Dahyabhai
- */
-public abstract class ShowViewAction extends Action {
- /**
- *
- */
- public ShowViewAction() {
- super();
- }
-
- /**
- * @param text
- */
- public ShowViewAction(String text) {
- super(text);
- }
-
- /**
- * @param text
- * @param image
- */
- public ShowViewAction(String text, ImageDescriptor image) {
- super(text, image);
- }
-
- /**
- * @param text
- * @param style
- */
- public ShowViewAction(String text, int style) {
- super(text, style);
- }
-
- /**
- * @return
- */
- protected abstract String getViewID();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- super.run();
- showView();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- super.runWithEvent(event);
- showView();
- }
-
- /**
- *
- */
- private void showView() {
- IWorkbenchWindow window = SSEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- try {
- page.showView(getViewID());
- } catch (PartInitException e) {
- ErrorDialog.openError(window.getShell(), SSEUIMessages.ShowView_errorTitle, //$NON-NLS-1$
- e.getMessage(), e.getStatus());
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
deleted file mode 100644
index 18815a78ed..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
+++ /dev/null
@@ -1,764 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IEncodedStorage;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.editors.text.StorageDocumentProvider;
-import org.eclipse.ui.texteditor.DocumentProviderRegistry;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.CodedReaderCreator;
-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.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction;
-import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IExtendedStorageEditorInput;
-
-/**
- * A StorageDocumentProvider that is IStructuredModel aware
- */
-public class StorageModelProvider extends StorageDocumentProvider implements IModelProvider {
-
- private class InternalElementStateListener implements IElementStateListener {
- public void elementContentAboutToBeReplaced(Object element) {
- if (debugElementStatelistener) {
- System.out.println("StorageModelProvider: elementContentAboutToBeReplaced: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
- }
- // we just forward the event
- StorageModelProvider.this.fireElementContentAboutToBeReplaced(element);
- }
-
- public void elementContentReplaced(Object element) {
- if (debugElementStatelistener) {
- System.out.println("StorageModelProvider: elementContentReplaced: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
- }
-
- StorageInfo info = (StorageInfo) getElementInfo(element);
-
- if (info == null)
- return;
-
- /**
- * Force a reload of the markers into annotations since their
- * previous Positions have been deleted. Disconnecting and
- * reconnecting forces a call to the private catchupWithMarkers
- * method.
- */
- if (info.fModel != null) {
- info.fModel.disconnect(info.fDocument);
- }
-
- Reader reader = null;
- IStructuredDocument innerdocument = null;
- try {
- // update document from input's contents
- CodedReaderCreator codedReaderCreator = new CodedReaderCreator(calculateID((IStorageEditorInput) element), Utilities.getMarkSupportedStream(((IStorageEditorInput) element).getStorage().getContents()));
- reader = codedReaderCreator.getCodedReader();
-
- innerdocument = (IStructuredDocument) info.fDocument;
-
- int originalLengthToReplace = innerdocument.getLength();
-
- StringBuffer stringBuffer = new StringBuffer();
- int bufferSize = 2048;
- char[] buffer = new char[bufferSize];
- int nRead = 0;
- boolean eof = false;
- while (!eof) {
- nRead = reader.read(buffer, 0, bufferSize);
- if (nRead == -1) {
- eof = true;
- }
- else {
- stringBuffer.append(buffer, 0, nRead);
- }
- }
- innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- if (reader != null) {
- try {
- reader.close();
- }
- catch (IOException e1) {
- // would be highly unusual
- Logger.logException(e1);
- }
- }
- }
-
- // forward the event
- if (info.fCanBeSaved) {
- info.fCanBeSaved = false;
- addUnchangedElementListeners(element, info);
- }
- fireElementContentReplaced(element);
- fireElementDirtyStateChanged(element, false);
-
- if (info != null && info.fModel != null) {
- info.fModel.connect(info.fDocument);
- }
- }
-
- public void elementDeleted(Object element) {
- if (debugElementStatelistener) {
- System.out.println("StorageModelProvider: elementDeleted: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
- }
- // we just forward the event
- StorageModelProvider.this.fireElementDeleted(element);
- }
-
- public void elementDirtyStateChanged(Object element, boolean isDirty) {
- if (debugElementStatelistener) {
- System.out.println("StorageModelProvider: elementDirtyStateChanged: " + ((IEditorInput) element).getName() + " (" + isDirty + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- // we just forward the event
- StorageModelProvider.this.fireElementDirtyStateChanged(element, isDirty);
- }
-
- public void elementMoved(Object originalElement, Object movedElement) {
- if (debugElementStatelistener) {
- System.out.println("StorageModelProvider: elementMoved " + originalElement + " --> " + movedElement); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // we just forward the event
- StorageModelProvider.this.fireElementMoved(originalElement, movedElement);
- }
- }
-
- /**
- * Collection of info that goes with a model.
- */
- private class ModelInfo {
- public IEditorInput fElement;
- public boolean fShouldReleaseOnInfoDispose;
- public IStructuredModel fStructuredModel;
-
- public ModelInfo(IStructuredModel structuredModel, IEditorInput element, boolean selfCreated) {
- fElement = element;
- fStructuredModel = structuredModel;
- fShouldReleaseOnInfoDispose = selfCreated;
- }
- }
-
- static final boolean debugElementStatelistener = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener")); //$NON-NLS-1$ //$NON-NLS-2$
- static final boolean debugOperations = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/storagemodelprovider/operations")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private static StorageModelProvider fInstance = null;
-
- public synchronized static StorageModelProvider getInstance() {
- if (fInstance == null)
- fInstance = new StorageModelProvider();
- return fInstance;
- }
-
- private IElementStateListener fInternalListener;
- /** IStructuredModel information of all connected elements */
- private Map fModelInfoMap = new HashMap();
- private boolean fReuseModelDocument = true;
-
- private StorageModelProvider() {
- super();
- fInternalListener = new InternalElementStateListener();
- }
-
- String calculateBaseLocation(IStorageEditorInput input) {
- String location = null;
- if (input instanceof IPathEditorInput) {
- IPath path = ((IPathEditorInput) input).getPath();
- if (path != null) {
- location = path.toString();
- }
- }
- if (location == null && input instanceof ILocationProvider) {
- IPath path = ((ILocationProvider) input).getPath(input);
- if (path != null) {
- location = path.toString();
- }
- }
- if (location == null) {
- try {
- IStorage storage = input.getStorage();
- if (storage != null) {
- IPath storagePath = storage.getFullPath();
- String name = storage.getName();
- if (storagePath != null) {
- /*
- * If the path's last segment and the name are
- * different, the IStorage contract is not being
- * honored
- * (https://bugs.eclipse.org/bugs/show_bug.cgi?
- * id=73098). Favor the name
- */
- if (!storagePath.lastSegment().equals(name)) {
- IPath workingPath = storagePath.addTrailingSeparator();
- location = workingPath.append(name).toString();
- }
- else {
- location = storagePath.makeAbsolute().toString();
- }
- }
- if (location == null)
- location = name;
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- if (location == null)
- location = input.getName();
- }
- }
- return location;
- }
-
- String calculateID(IStorageEditorInput input) {
- /**
- * Typically CVS will return a path of "filename.ext" and the input's
- * name will be "filename.ext version". The path must be used to load
- * the model so that the suffix will be available to compute the
- * contentType properly. The editor input name can then be set as the
- * base location for display on the editor title bar.
- *
- */
- String path = null;
- if (input instanceof ILocationProvider) {
- IPath ipath = ((ILocationProvider) input).getPath(input);
- if (ipath != null) {
- path = ipath.toString();
- }
- }
- if (path == null) {
- try {
- IStorage storage = input.getStorage();
- if (storage != null) {
- IPath storagePath = storage.getFullPath();
- String name = storage.getName();
- if (storagePath != null) {
- // If they are different, the IStorage contract is not
- // being honored
- // (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
- // Favor the name.
- if (!storagePath.lastSegment().equals(name)) {
- IPath workingPath = storagePath.addTrailingSeparator();
- path = workingPath.append(name).toString();
- }
- else {
- path = storagePath.makeAbsolute().toString();
- }
- }
- if (path == null)
- path = name;
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- if (path == null)
- path = input.getName(); //$NON-NLS-1$
- }
- }
- /*
- * Prepend the hash to the path value so that we have a 1:1:1 match
- * between editor inputs, element info, and models. The editor manager
- * should help prevent needlessly duplicated models as long as two
- * editor inputs from the same storage indicate they're equals().
- */
- path = input.hashCode() + "#" + path; //$NON-NLS-1$
- return path;
- }
-
- // public boolean canSaveDocument(Object element) {
- // return false;
- // }
-
- protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
- IAnnotationModel model = null;
- if (debugOperations) {
- if (element instanceof IStorageEditorInput)
- System.out.println("StorageModelProvider: createAnnotationModel for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
- else
- System.out.println("StorageModelProvider: createAnnotationModel for " + element); //$NON-NLS-1$
- }
- if (element instanceof IStorageEditorInput) {
- IStorageEditorInput input = (IStorageEditorInput) element;
- String contentType = (getModel(input) != null ? getModel(input).getContentTypeIdentifier() : null);
- String ext = BreakpointRulerAction.getFileExtension((IEditorInput) element);
- IResource res = BreakpointProviderBuilder.getInstance().getResource(input, contentType, ext);
- String id = input.getName();
- if (input.getStorage() != null && input.getStorage().getFullPath() != null) {
- id = input.getStorage().getFullPath().toString();
- }
- // we can only create a resource marker annotationmodel off of a
- // valid resource
- if (res != null)
- model = new StructuredResourceMarkerAnnotationModel(res, id);
- else
- model = new AnnotationModel();
- }
- if (model == null) {
- model = super.createAnnotationModel(element);
- }
- return model;
- }
-
- protected IDocument createDocument(Object element) {
- if (debugOperations) {
- if (element instanceof IStorageEditorInput)
- try {
- System.out.println("StorageModelProvider: createDocument for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: createDocument for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- System.out.println("StorageModelProvider: createDocument for " + element); //$NON-NLS-1$
- }
- }
-
- // The following is largely copied from FileModelProvider
-
- IDocument document = null;
- if (element instanceof IEditorInput) {
- // create a new IDocument for the element; should always reflect
- // the contents of the resource
- ModelInfo info = getModelInfoFor((IEditorInput) element);
- if (info == null) {
- throw new IllegalArgumentException("no corresponding model info found"); //$NON-NLS-1$
- }
- IStructuredModel model = info.fStructuredModel;
- if (model != null) {
- if (!fReuseModelDocument && element instanceof IStorageEditorInput) {
- Reader reader = null;
- IStructuredDocument innerdocument = null;
- try {
- // update document from input's contents
-
- CodedReaderCreator codedReaderCreator = new CodedReaderCreator(calculateID((IStorageEditorInput) element), Utilities.getMarkSupportedStream(((IStorageEditorInput) element).getStorage().getContents()));
- reader = codedReaderCreator.getCodedReader();
-
- innerdocument = model.getStructuredDocument();
-
- int originalLengthToReplace = innerdocument.getLength();
-
- /*
- * TODO_future: we could implement with sequential
- * rewrite, if we don't pickup automatically from
- * FileBuffer support, so not so much has to be pulled
- * into memory (as an extra big string), but we need
- * to carry that API through so that StructuredModel
- * is not notified until done.
- */
-
- // innerdocument.startSequentialRewrite(true);
- // innerdocument.replaceText(this, 0,
- // innerdocument.getLength(), "");
- StringBuffer stringBuffer = new StringBuffer();
- int bufferSize = 2048;
- char[] buffer = new char[bufferSize];
- int nRead = 0;
- boolean eof = false;
- while (!eof) {
- nRead = reader.read(buffer, 0, bufferSize);
- if (nRead == -1) {
- eof = true;
- }
- else {
- stringBuffer.append(buffer, 0, nRead);
- // innerdocument.replaceText(this,
- // innerdocument.getLength(), 0, new
- // String(buffer, 0, nRead));
- }
- }
- // ignore read-only settings if reverting whole
- // document
- innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
- model.setDirtyState(false);
-
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- if (reader != null) {
- try {
- reader.close();
- }
- catch (IOException e1) {
- // would be highly unusual
- Logger.logException(e1);
- }
- }
- // if (innerdocument != null) {
- // innerdocument.stopSequentialRewrite();
- // }
- }
-
- }
- document = model.getStructuredDocument();
- }
- }
- return document;
- }
-
- /**
- * Also create ModelInfo - extra resource synchronization classes should
- * be stored within the ModelInfo
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- // create the corresponding ModelInfo if necessary
- if (debugOperations) {
- if (element instanceof IStorageEditorInput)
- try {
- System.out.println("StorageModelProvider: createElementInfo for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: createElementInfo for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- System.out.println("storageModelProvider: createElementInfo for " + element); //$NON-NLS-1$
- }
-
- if (getModelInfoFor((IEditorInput) element) == null) {
- createModelInfo((IEditorInput) element);
- }
-
- ElementInfo info = super.createElementInfo(element);
- return info;
- }
-
- public void createModelInfo(IEditorInput input) {
- if (getModelInfoFor(input) == null) {
- IStructuredModel structuredModel = selfCreateModel(input);
- if (structuredModel != null) {
- createModelInfo(input, structuredModel, true);
- }
- }
- }
-
- /**
- * To be used when model is provided to us, ensures that when setInput is
- * used on this input, the given model will be used.
- */
- public void createModelInfo(IEditorInput input, IStructuredModel structuredModel, boolean releaseModelOnDisconnect) {
- // we have to make sure factories are added, whether we created or
- // not.
- if (getModelInfoFor(input) != null || getModelInfoFor(structuredModel) != null) {
- if (debugOperations) {
- if (input instanceof IStorageEditorInput) {
-
- try {
- System.out.println("StorageModelProvider: DUPLICATE createModelInfo for " + ((IStorageEditorInput) input).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: DUPLICATE createModelInfo for " + input + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- System.out.println("storageModelProvider: DUPLICATE createModelInfo for " + input); //$NON-NLS-1$
- }
- }
- return;
- }
-
- if (debugOperations) {
- if (input instanceof IStorageEditorInput) {
- try {
- System.out.println("StorageModelProvider: createModelInfo for " + ((IStorageEditorInput) input).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: createModelInfo for " + input + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- System.out.println("StorageModelProvider: createModelInfo for " + input); //$NON-NLS-1$
- }
- }
-
-
- if (input instanceof IExtendedStorageEditorInput) {
- ((IExtendedStorageEditorInput) input).addElementStateListener(fInternalListener);
- }
-
- EditorModelUtil.addFactoriesTo(structuredModel);
-
- ModelInfo modelInfo = new ModelInfo(structuredModel, input, releaseModelOnDisconnect);
- fModelInfoMap.put(input, modelInfo);
- }
-
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if (debugOperations) {
- if (element instanceof IStorageEditorInput) {
- try {
- System.out.println("StorageModelProvider: disposeElementInfo for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: disposeElementInfo for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- System.out.println("StorageModelProvider: disposeElementInfo for " + element); //$NON-NLS-1$
- }
- }
-
- if (element instanceof IEditorInput) {
- IEditorInput input = (IEditorInput) element;
- ModelInfo modelInfo = getModelInfoFor(input);
- disposeModelInfo(modelInfo);
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * disconnect from this model info
- *
- * @param info
- */
- public void disposeModelInfo(ModelInfo info) {
- if (debugOperations) {
- if (info.fElement instanceof IStorageEditorInput) {
- try {
- System.out.println("StorageModelProvider: disposeModelInfo for " + ((IStorageEditorInput) info.fElement).getStorage().getFullPath()); //$NON-NLS-1$
- }
- catch (CoreException e) {
- System.out.println("StorageModelProvider: disposeModelInfo for " + info.fElement + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else {
- System.out.println("StorageModelProvider: disposeModelInfo for " + info.fElement); //$NON-NLS-1$
- }
- }
-
- if (info.fElement instanceof IStorageEditorInput) {
- if (info.fElement instanceof IExtendedStorageEditorInput) {
- ((IExtendedStorageEditorInput) info.fElement).removeElementStateListener(fInternalListener);
- }
- if (info.fShouldReleaseOnInfoDispose) {
- info.fStructuredModel.releaseFromEdit();
- }
- }
- fModelInfoMap.remove(info.fElement);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doResetDocument(java.lang.Object,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void doResetDocument(Object element, IProgressMonitor monitor) throws CoreException {
- fReuseModelDocument = false;
- super.doResetDocument(element, monitor);
- fReuseModelDocument = true;
- }
-
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor,
- * java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- IDocumentProvider provider = null;
- // BUG119211 - try to use registered document provider if possible
- if (element instanceof IEditorInput) {
- provider = DocumentProviderRegistry.getDefault().getDocumentProvider((IEditorInput) element);
- }
- if (provider == null)
- provider = new FileDocumentProvider();
- provider.saveDocument(monitor, element, document, overwrite);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.editors.text.StorageDocumentProvider#getPersistedEncoding(java.lang.Object)
- */
- protected String getPersistedEncoding(Object element) {
- String charset = super.getPersistedEncoding(element);
- if (charset == null && element instanceof IStorageEditorInput) {
- IStorage storage;
- try {
- storage = ((IStorageEditorInput) element).getStorage();
- if (storage != null && !(storage instanceof IEncodedStorage)) {
- InputStream contents = null;
- try {
- contents = storage.getContents();
- if (contents != null) {
- QualifiedName[] detectionOptions = new QualifiedName[]{IContentDescription.BYTE_ORDER_MARK, IContentDescription.CHARSET};
- IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(contents, storage.getName(), detectionOptions);
- if (description != null) {
- charset = description.getCharset();
- }
- }
-
- }
- catch (IOException e) {
- }
- finally {
- if (contents != null)
- try {
- contents.close();
- }
- catch (IOException e) {
- // do nothing
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- return charset;
- }
-
- public IStructuredModel getModel(IEditorInput element) {
- IStructuredModel result = null;
- ModelInfo info = getModelInfoFor(element);
- if (info != null) {
- result = info.fStructuredModel;
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.IModelProvider#getModel(java.lang.Object)
- */
- public IStructuredModel getModel(Object element) {
- if (element instanceof IEditorInput)
- return getModel((IEditorInput) element);
- return null;
- }
-
- private ModelInfo getModelInfoFor(IEditorInput element) {
- ModelInfo result = (ModelInfo) fModelInfoMap.get(element);
- return result;
- }
-
- private ModelInfo getModelInfoFor(IStructuredModel structuredModel) {
- ModelInfo result = null;
- if (structuredModel != null) {
- ModelInfo[] modelInfos = (ModelInfo[]) fModelInfoMap.values().toArray(new ModelInfo[0]);
- for (int i = 0; i < modelInfos.length; i++) {
- ModelInfo info = modelInfos[i];
- if (structuredModel.equals(info.fStructuredModel)) {
- result = info;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Method loadModel.
- *
- * @param input
- * @return IStructuredModel
- */
- public IStructuredModel loadModel(IStorageEditorInput input) {
- return loadModel(input, false);
- }
-
- /**
- * Method loadModel.
- *
- * @param input
- * @param logExceptions
- * @return IStructuredModel
- */
- public IStructuredModel loadModel(IStorageEditorInput input, boolean logExceptions) {
- String id = calculateID(input);
- if (id == null) {
- return null;
- }
-
- InputStream contents = null;
- try {
- contents = input.getStorage().getContents();
- }
- catch (CoreException noStorageExc) {
- if (logExceptions)
- Logger.logException(NLS.bind(SSEUIMessages._32concat_EXC_, new Object[]{input.getName()}), noStorageExc);
- }
-
- IStructuredModel model = null;
- try {
- // first parameter must be unique
- model = StructuredModelManager.getModelManager().getModelForEdit(id, contents, null);
- model.setBaseLocation(calculateBaseLocation(input));
- }
- catch (IOException e) {
- if (logExceptions)
- Logger.logException(NLS.bind(SSEUIMessages._32concat_EXC_, new Object[]{input}), e);
- }
- finally {
- if (contents != null) {
- try {
- contents.close();
- }
- catch (IOException e) {
- // nothing
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
- }
- return model;
- }
-
- /**
- * @param input
- * @return
- */
- private IStructuredModel selfCreateModel(IEditorInput input) {
- return loadModel((IStorageEditorInput) input);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java
deleted file mode 100644
index 4a276fd591..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java
+++ /dev/null
@@ -1,1332 +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.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.jface.text.AbstractDocument;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentAdapter;
-import org.eclipse.jface.text.IDocumentAdapterExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.IRepairableDocument;
-import org.eclipse.jface.text.ITextStore;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.projection.ProjectionDocument;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.TextChangeListener;
-import org.eclipse.swt.custom.TextChangedEvent;
-import org.eclipse.swt.custom.TextChangingEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.ILockable;
-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.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.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * Adapts IStructuredDocument events and methods to StyledTextContent events
- * and methods
- */
-public class StructuredDocumentToTextAdapter implements IDocumentAdapter, IDocumentAdapterExtension {
-
- private class DocumentClone extends AbstractDocument {
-
-
- /**
- * Creates a new document clone with the given content.
- *
- * @param content
- * the content
- * @param lineDelimiters
- * the line delimiters
- */
- public DocumentClone(String content, String[] lineDelimiters) {
- super();
- setTextStore(new StringTextStore(content));
- ConfigurableLineTracker tracker = new ConfigurableLineTracker(lineDelimiters);
- setLineTracker(tracker);
- getTracker().set(content);
- completeInitialization();
- }
- }
-
- // A pre-notification listener for the viewer's Document
- class DocumentListener implements IDocumentListener {
- protected boolean allTextChanged = false;
-
- protected DocumentEvent currentEvent;
-
- synchronized public void documentAboutToBeChanged(DocumentEvent event) {
- if (isStoppedForwardingChanges())
- return;
-
- pendingDocumentChangedEvent = true;
- allTextChanged = event.getOffset() <= 0 && event.getLength() >= StructuredDocumentToTextAdapter.this.getDocument().getLength();
- currentEvent = event;
-
- StructuredDocumentToTextAdapter.this.relayTextChanging(event.getOffset(), event.getLength(), event.getText());
- }
-
- synchronized public void documentChanged(DocumentEvent event) {
- if (isStoppedForwardingChanges())
- return;
-
- if (currentEvent != null && event == currentEvent) {
- if (allTextChanged) {
- StructuredDocumentToTextAdapter.this.relayTextSet();
- }
- else {
- // temp work around for immediate thread
- // problem.
- // should have more general solution
- // soon. 'syncExec' are rumored to be
- // prone to hang.
- StructuredDocumentToTextAdapter.this.relayTextChanged();
- }
- }
-
- currentEvent = null;
- pendingDocumentChangedEvent = false;
- handlePendingEvents();
- lastEvent = null;
-
- }
- }
-
- private static class StringTextStore implements ITextStore {
-
- private String fContent;
-
- /**
- * Creates a new string text store with the given content.
- *
- * @param content
- * the content
- */
- public StringTextStore(String content) {
- Assert.isNotNull(content, "content can not be null when setting text store"); //$NON-NLS-1$
- fContent = content;
- }
-
- /*
- * @see org.eclipse.jface.text.ITextStore#get(int)
- */
- public char get(int offset) {
- return fContent.charAt(offset);
- }
-
- /*
- * @see org.eclipse.jface.text.ITextStore#get(int, int)
- */
- public String get(int offset, int length) {
- return fContent.substring(offset, offset + length);
- }
-
- /*
- * @see org.eclipse.jface.text.ITextStore#getLength()
- */
- public int getLength() {
- return fContent.length();
- }
-
- /*
- * @see org.eclipse.jface.text.ITextStore#replace(int, int,
- * java.lang.String)
- */
- public void replace(int offset, int length, String text) {
- }
-
- /*
- * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
- */
- public void set(String text) {
- }
-
- }
-
- /**
- * Changes to the Document/IStructuredDocument can extend beyond the text
- * change area and require more redrawing to keep the hilighting correct.
- * The event must be saved so that the redraw is only sent after a
- * textChanged event is received.
- */
- class StructuredDocumentListener implements IStructuredDocumentListener {
-
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges()) {
- // if
- // (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
- // {
- if (Debug.debugStructuredDocument) {
- System.out.println("skipped relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- return;
- }
- // should use textSet when all contents have
- // changed
- // otherwise need to use the pair of
- // textChanging and
- // textChanged.
- StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
- }
-
- public void noChange(final NoChangeEvent structuredDocumentEvent) {
-
- if (Debug.debugStructuredDocument) {
- System.out.println("skipped relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- if (structuredDocumentEvent.reason == NoChangeEvent.READ_ONLY_STATE_CHANGE) {
- if (pendingDocumentChangedEvent) {
- if (lastEventQueue == null) {
- lastEventQueue = new ArrayList();
- }
- lastEventQueue.add(structuredDocumentEvent);
- }
- else {
- StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
- }
- }
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges()) {
- // if
- // (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
- // {
- if (Debug.debugStructuredDocument) {
- System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- return;
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
- }
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges()) {
- // if
- // (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
- // {
- if (Debug.debugStructuredDocument) {
- System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- return;
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
- }
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges()) {
- // if
- // (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
- // {
- if (Debug.debugStructuredDocument) {
- System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- return;
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
- }
- StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
- }
- }
-
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- private final static boolean redrawBackground = true;
-
- /** The visible child document. */
- private ProjectionDocument fChildDocument;
-
- /** The master document */
- private IDocument fDocument;
- /** The document clone for the non-forwarding case. */
- private IDocument fDocumentClone;
-
- // only use this temp work around if on GTK
- // it causes funny "cursor blinking" if used on windows
- private final boolean forceRedrawOnRegionChanged = Platform.getWS().equals("gtk"); //$NON-NLS-1$
- /** The original content */
- private String fOriginalContent;
- /** The original line delimiters */
- private String[] fOriginalLineDelimiters;
-
- private int fStopRelayingChangesRequests = 0;
-
- private StyledText fStyledTextWidget;
-
- /** The registered text changed listeners */
- TextChangeListener[] fTextChangeListeners;
- protected DocumentListener internalDocumentListener;
-
- // The listeners for relaying DocumentEvents and
- // requesting repaints
- // after modification
- private IStructuredDocumentListener internalStructuredDocumentListener;
-
- protected StructuredDocumentEvent lastEvent = null;
- List lastEventQueue;
- boolean pendingDocumentChangedEvent;
-
- private static final boolean DEBUG = false;
-
- /**
- * TEST ONLY - TEST ONLY - TEST ONLY NOT API use this constructor only for
- * tests. Creates a new document adapter which is initiallly not connected
- * to any document.
- */
- public StructuredDocumentToTextAdapter() {
-
- internalStructuredDocumentListener = new StructuredDocumentListener();
- internalDocumentListener = new DocumentListener();
- // for testing only
- // setDocument(getModelManager().createStructuredDocumentFor(ContentTypeIdentifierForXML.ContentTypeID_XML));
- }
-
- /**
- * Creates a new document adapter which is initiallly not connected to any
- * document.
- */
- public StructuredDocumentToTextAdapter(StyledText styledTextWidget) {
-
- // do not use 'this()' in this case
- super();
- internalStructuredDocumentListener = new StructuredDocumentListener();
- internalDocumentListener = new DocumentListener();
- fStyledTextWidget = styledTextWidget;
- }
-
- private void _setDocument(IDocument newDoc) {
- if (fDocument instanceof IStructuredDocument) {
- ((IStructuredDocument) fDocument).removeDocumentChangedListener(internalStructuredDocumentListener);
- }
- fDocument = newDoc;
- if (!isStoppedForwardingChanges()) {
- fDocumentClone = null;
- fOriginalContent = getDocument() != null ? getDocument().get() : null;
- fOriginalLineDelimiters = getDocument() != null ? getDocument().getLegalLineDelimiters() : null;
- }
-
- if (DEBUG && fDocument != null && !(fDocument instanceof ILockable)) {
-
- System.out.println("Warning: non ILockable document used in StructuredDocumentToTextAdapter"); //$NON-NLS-1$
- System.out.println(" document updates on non-display thread will not be safe if editor open"); //$NON-NLS-1$
- }
- if (fDocument instanceof IStructuredDocument) {
- ((IStructuredDocument) fDocument).addDocumentChangedListener(internalStructuredDocumentListener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.custom.StyledTextContent#addTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
- */
- public synchronized void addTextChangeListener(TextChangeListener listener) {
-
- // make sure listener is not already in listening
- // (and if it is, print a warning to aid debugging,
- // if needed)
-
- if (Utilities.contains(fTextChangeListeners, listener)) {
- if (Debug.displayWarnings) {
- System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. listener " + listener + " was added more than once. "); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- if (Debug.debugStructuredDocument) {
- System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. Adding an instance of " + listener.getClass() + " as a listener on text adapter."); //$NON-NLS-2$//$NON-NLS-1$
- }
- int oldSize = 0;
- if (fTextChangeListeners != null) {
- // normally won't be null, but we need to be
- // sure, for first time through
- oldSize = fTextChangeListeners.length;
- }
- int newSize = oldSize + 1;
- TextChangeListener[] newListeners = new TextChangeListener[newSize];
- if (fTextChangeListeners != null) {
- System.arraycopy(fTextChangeListeners, 0, newListeners, 0, oldSize);
- }
- // add listener to last position
- newListeners[newSize - 1] = listener;
- //
- // now switch new for old
- fTextChangeListeners = newListeners;
- //
- }
- }
-
- /*
- * @see org.eclipse.swt.custom.StyledTextContent#getCharCount()
- */
- public int getCharCount() {
-
- // getDocument can sometimes be null during startup
- // and dispose
- int result = 0;
- IDocument doc = getDocument();
- if (doc != null) {
- result = getSafeDocument().getLength();
- }
- return result;
- }
-
- private IDocument getClonedDocument() {
- if (fDocumentClone == null) {
- String content = fOriginalContent == null ? "" : fOriginalContent; //$NON-NLS-1$
- String[] delims = fOriginalLineDelimiters == null ? DefaultLineTracker.DELIMITERS : fOriginalLineDelimiters;
- fDocumentClone = new DocumentClone(content, delims);
- }
- return fDocumentClone;
- }
-
- Display getDisplay() {
-
- // Note: the workbench should always have a display
- // (unless running headless), whereas Display.getCurrent()
- // only returns the display if the currently executing thread
- // has one.
- if (PlatformUI.isWorkbenchRunning())
- return PlatformUI.getWorkbench().getDisplay();
- else
- return null;
- }
-
- /**
- * Returns the visible document.
- *
- * @return IDocument
- */
- protected IDocument getDocument() {
-
- if (fChildDocument == null)
- return fDocument;
- return fChildDocument;
- }
-
- /**
- * Returns region in master document of given region (should be region in
- * projection document)
- *
- * @return region if no projection document exists, region of master
- * document if possible, null otherwise
- */
- private IRegion getProjectionToMasterRegion(IRegion region) {
- IRegion originalRegion = region;
- if (fChildDocument != null) {
- try {
- originalRegion = fChildDocument.getProjectionMapping().toOriginRegion(region);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- return originalRegion;
- }
-
- /**
- * Returns offset in projection document of given offset (should be offset
- * in master document)
- *
- * @return offset if no projection document exists, offset of projection
- * document if possible, -1 otherwise
- */
- private int getMasterToProjectionOffset(int offset) {
- int originalOffset = offset;
- if (fChildDocument != null) {
- try {
- originalOffset = fChildDocument.getProjectionMapping().toImageOffset(offset);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- return originalOffset;
- }
-
- /**
- * Return the line at the given character offset without delimiters.
- * <p>
- *
- * @param offset
- * offset of the line to return. Does not include delimiters of
- * preceeding lines. Offset 0 is the first character of the
- * document.
- * @return the line text without delimiters
- */
- public java.lang.String getLine(int lineNumber) {
-
- String result = null;
- if (lineNumber >= getLineCount()) {
- if (Debug.displayWarnings) {
- System.out.println("Development Debug: IStructuredDocument:getLine() error. lineNumber requested (" + lineNumber + ") was greater than number of lines(" + getLineCount() + "). EmptyString returned"); //$NON-NLS-1$//$NON-NLS-3$//$NON-NLS-2$
- }
- result = EMPTY_STRING;
- }
- else {
- IDocument doc = getSafeDocument();
- if (doc == null) {
- result = EMPTY_STRING;
- }
- else {
- try {
- IRegion r = doc.getLineInformation(lineNumber);
- if (r.getLength() > 0) {
- result = doc.get(r.getOffset(), r.getLength());
- }
- else {
- result = EMPTY_STRING;
- }
- }
- catch (BadLocationException e) {
- result = EMPTY_STRING;
- }
- }
- }
- return result;
- }
-
- /**
- * Tries to repair the line information.
- *
- * @param document
- * the document
- * @see IRepairableDocument#repairLineInformation()
- * @see Eclipse 3.0
- */
- private void repairLineInformation(IDocument document) {
- if (document instanceof IRepairableDocument) {
- IRepairableDocument repairable = (IRepairableDocument) document;
- repairable.repairLineInformation();
- }
- }
-
- /**
- * Return the line index at the given character offset.
- * <p>
- *
- * @param offset
- * offset of the line to return. The first character of the
- * document is at offset 0. An offset of getLength() is valid
- * and should answer the number of lines.
- * @return the line index. The first line is at index 0. If the character
- * at offset is a delimiter character, answer the line index of
- * the line that is delimited. For example, text = "\r\n\r\n",
- * delimiter = "\r\n", then: getLineAtOffset(0) == 0
- * getLineAtOffset(1) == 0 getLineAtOffset(2) == 1
- * getLineAtOffset(3) == 1 getLineAtOffset(4) == 2
- */
- public int getLineAtOffset(int offset) {
-
- int result = 0;
- IDocument doc = getSafeDocument();
- if (doc != null) {
- try {
- result = doc.getLineOfOffset(offset);
- }
- catch (BadLocationException x) {
- repairLineInformation(doc);
- try {
- result = doc.getLineOfOffset(offset);
- }
- catch (BadLocationException x2) {
- // should not occur, but seems to for projection
- // documents, related to repainting overview ruler
- result = 0;
- }
- }
- }
- return result;
- }
-
- public int getLineCount() {
- int result = 0;
- IDocument doc = getSafeDocument();
- if (doc != null) {
- result = doc.getNumberOfLines();
- }
- return result;
- }
-
- /*
- * @see org.eclipse.swt.custom.StyledTextContent#getLineDelimiter
- */
- public String getLineDelimiter() {
- String result = null;
- if (getParentDocument() instanceof IStructuredDocument) {
- result = ((IStructuredDocument) getParentDocument()).getLineDelimiter();
- }
- else {
- IDocument doc = getSafeDocument();
- result = TextUtilities.getDefaultLineDelimiter(doc);
- }
- return result;
- }
-
- /**
- * Return the character offset of the first character of the given line.
- * <p>
- *
- * @param lineIndex
- * index of the line. The first line is at index 0.
- * @return offset offset of the first character of the line. The first
- * character of the document is at offset 0. The return value
- * should include line delimiters. For example, text =
- * "\r\ntest\r\n", delimiter = "\r\n", then: getOffsetAtLine(0) ==
- * 0 getOffsetAtLine(1) == 2 getOffsetAtLine(2) == 8 NOTE: When
- * there is no text (i.e., no lines), getOffsetAtLine(0) is a
- * valid call that should return 0.
- */
- public int getOffsetAtLine(int lineIndex) {
-
- int result = 0;
- IDocument doc = getSafeDocument();
- if (doc != null) {
- try {
- result = doc.getLineOffset(lineIndex);
- }
- catch (BadLocationException e) {
- result = 0;
- }
- }
- return result;
- }
-
- /**
- * Returns the parent document
- *
- * @return the parent document
- */
- private IDocument getParentDocument() {
- return fDocument;
- }
-
- /**
- * This is the document to use for request from the StyledText widget. Its
- * either the live documnet or a clone of it, depending on stop/resume
- * state.
- */
- private IDocument getSafeDocument() {
- IDocument result = null;
- if (isStoppedForwardingChanges()) {
- result = getClonedDocument();
- }
- else {
- // note, this document can be normal structured text document,
- // or the projection/child document
- result = getDocument();
- }
- return result;
- }
-
- /**
- * @return org.eclipse.swt.custom.StyledText
- */
- StyledText getStyledTextWidget() {
- return fStyledTextWidget;
- }
-
- /**
- * Returns a string representing the content at the given range.
- * <p>
- *
- * @param start
- * the start offset of the text to return. Offset 0 is the
- * first character of the document.
- * @param length
- * the length of the text to return
- * @return the text at the given range
- */
- public String getTextRange(int start, int length) {
- String result = null;
- try {
- IDocument doc = getSafeDocument();
- result = doc.get(start, length);
- }
- catch (BadLocationException e) {
- result = EMPTY_STRING;
- }
- return result;
- }
-
- /**
- * assume only for "no change" events, for now
- */
- protected void handlePendingEvents() {
-
- if (lastEventQueue == null)
- return;
-
- Iterator iterator = lastEventQueue.iterator();
- while (iterator.hasNext()) {
- NoChangeEvent noChangeEvent = (NoChangeEvent) iterator.next();
- redrawNoChange(noChangeEvent);
- }
-
- lastEventQueue = null;
- lastEvent = null;
- }
-
- boolean isStoppedForwardingChanges() {
- return fStopRelayingChangesRequests > 0;
- }
-
- /**
- * this method is assumed to be called only for read only region changes.
- */
- protected void redrawNoChange(NoChangeEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges())
- return;
- if (Debug.debugStructuredDocument) {
- System.out.println("maybe redraw stuff"); //$NON-NLS-1$
- }
-
- int startOffset = structuredDocumentEvent.getOffset();
- int length = structuredDocumentEvent.getLength();
- redrawRangeWithLength(startOffset, length);
-
- }
-
- /**
- * Request a redraw of the text range occupied by the given
- * StructuredDocumentRegionsReplacedEvent
- *
- * @param structuredDocumentEvent
- */
- protected void redrawNodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges())
- return;
- if (Debug.debugStructuredDocument) {
- System.out.println("maybe redraw stuff"); //$NON-NLS-1$
- }
- // just the new stuff
- IStructuredDocumentRegionList newStructuredDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
-
- int nNewNodes = newStructuredDocumentRegions.getLength();
- if (nNewNodes > 0) {
- IStructuredDocumentRegion firstNode = newStructuredDocumentRegions.item(0);
- IStructuredDocumentRegion lastNode = newStructuredDocumentRegions.item(nNewNodes - 1);
- redrawRange(firstNode.getStartOffset(), lastNode.getEndOffset());
- }
- }
-
- /**
- * Redraws the give offsets in terms of the StructuredDocument. If only
- * part of the model is visible, ensures that only the visible portion of
- * the given range is redrawn.
- *
- * @param startModelOffset
- * @param endModelOffset
- */
- private void redrawRange(final int startModelOffset, final int endModelOffset) {
-
- if (getDocument() == null)
- return;
- if (Debug.debugStructuredDocument) {
- System.out.println("redraw stuff: " + startModelOffset + "-" + endModelOffset); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fChildDocument == null) {
- Runnable runnable = new Runnable() {
- public void run() {
- getStyledTextWidget().redrawRange(startModelOffset, endModelOffset - startModelOffset, redrawBackground);
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
-
- }
- else {
- int high = getDocument().getLength();
- int startOffset = getMasterToProjectionOffset(startModelOffset);
-
- int endOffset = getMasterToProjectionOffset(endModelOffset);
-
- // if offsets were not visible, just try to redraw everything in
- // the child document
- // // not visible
- // if (endOffset < 0 || startOffset > high)
- // return;
- // restrict lower bound
- if (startOffset < 0) {
- startOffset = 0;
- }
- // restrict upper bound
- // if (endOffset > high) {
- // endOffset = high;
- // }
- if (endOffset < 0) {
- endOffset = high;
- }
-
- int length = endOffset - startOffset;
- // redrawBackground with false would be faster
- // but assumes background (or font) is not
- // changing
- final int finalStartOffset = startOffset;
- final int finallength = length;
-
- Runnable runnable = new Runnable() {
- public void run() {
- getStyledTextWidget().redrawRange(finalStartOffset, finallength, redrawBackground);
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
-
- }
- }
-
- /**
- * Redraws the give offsets in terms of the Flat Node model. If only part
- * of the model is visible, ensures that only the visible portion of the
- * given range is redrawn.
- *
- * @param startModelOffset
- * @param endModelOffset
- */
- private void redrawRangeWithLength(final int startModelOffset, final int length) {
-
- if (getDocument() == null)
- return;
- if (Debug.debugStructuredDocument) {
- System.out.println("redraw stuff: " + startModelOffset + "-" + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fChildDocument == null) {
- Runnable runnable = new Runnable() {
- public void run() {
- getStyledTextWidget().redrawRange(startModelOffset, length, redrawBackground);
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- }
- else {
- int high = getDocument().getLength();
- // TODO need to take into account segmented visible regions
- int startOffset = getMasterToProjectionOffset(startModelOffset);
- // not visible
- if (startOffset > high || length < 1)
- return;
- // restrict lower bound
- if (startOffset < 0) {
- startOffset = 0;
- }
- int endOffset = startOffset + length - 1;
- // restrict upper bound
- if (endOffset > high) {
- endOffset = high;
- }
-
- // note: length of the child documnet should be
- // updated,
- // need to investigate why its not at this
- // point, but is
- // probably just because the document event
- // handling is not
- // completely finished.
- int newLength = endOffset - startOffset; // d283007
-
- // redrawBackground with false would be faster
- // but assumes background (or font) is not
- // changing
- final int finalStartOffset = startOffset;
- final int finalNewLength = newLength;
- Runnable runnable = new Runnable() {
- public void run() {
- getStyledTextWidget().redrawRange(finalStartOffset, finalNewLength, redrawBackground);
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- }
- }
-
- /**
- * Request a redraw of the text range occupied by the given
- * RegionChangedEvent for certain (not all) ITextRegion contexts
- *
- * @param structuredDocumentEvent
- */
- protected void redrawRegionChanged(RegionChangedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges()) {
- return;
- }
- if (Debug.debugStructuredDocument) {
- System.out.println("maybe redraw stuff"); //$NON-NLS-1$
- }
-
-
- // (nsd) TODO: try to make this reliable somehow
- // without being directly content dependent
- // if ((region instanceof ITextRegionContainer) ||
- // (type == XMLJSPRegionContexts.BLOCK_TEXT) ||
- // (type == XMLJSPRegionContexts.JSP_CONTENT)) {
- // IStructuredDocumentRegion flatNode =
- // structuredDocumentEvent.getStructuredDocumentRegion();
- // // redraw background of false is faster,
- // // but assumes background (or font) is not
- // changing
- // redrawRange(flatNode.getStartOffset(region),
- // flatNode.getEndOffset(region));
- // }
- if (forceRedrawOnRegionChanged) {
- // workaround for redrawing problems on Linux-GTK
- int startOffset = structuredDocumentEvent.getOffset();
- int endOffset = structuredDocumentEvent.getOffset() + structuredDocumentEvent.getLength();
- try {
- IRegion startLine = structuredDocumentEvent.fDocument.getLineInformationOfOffset(startOffset);
- IRegion endLine = structuredDocumentEvent.fDocument.getLineInformationOfOffset(endOffset);
- if (startLine != null && endLine != null) {
- redrawRange(startLine.getOffset(), endLine.getOffset() + endLine.getLength());
- }
- }
- catch (BadLocationException e) {
- // nothing for now
- }
- }
- }
-
- /**
- * Request a redraw of the text range occupied by the given
- * RegionsReplacedEvent
- *
- * @param structuredDocumentEvent
- */
- protected void redrawRegionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
- if (isStoppedForwardingChanges())
- return;
- if (Debug.debugStructuredDocument) {
- System.out.println("maybe redraw stuff"); //$NON-NLS-1$
- }
- ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
- int nRegions = newRegions.size();
- if (nRegions > 0) {
- ITextRegion firstRegion = newRegions.get(0);
- ITextRegion lastRegion = newRegions.get(nRegions - 1);
- IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
- redrawRange(flatNode.getStartOffset(firstRegion), flatNode.getEndOffset(lastRegion));
- }
- }
-
- protected void redrawTextChanged() {
-
- if (lastEvent != null) {
- // update display, since some cases can effect
- // highlighting beyond the changed text area.
- if (lastEvent instanceof StructuredDocumentRegionsReplacedEvent)
- redrawNodesReplaced((StructuredDocumentRegionsReplacedEvent) lastEvent);
- if (lastEvent instanceof RegionsReplacedEvent)
- redrawRegionsReplaced((RegionsReplacedEvent) lastEvent);
- if (lastEvent instanceof RegionChangedEvent)
- redrawRegionChanged((RegionChangedEvent) lastEvent);
- // moved following line to 'document changed' so
- // the "last event" can be
- // re-drawn after pending re-draws
- // lastEvent = null;
- }
- }
-
- /**
- * Sends a text replace event to all registered listeners.
- */
- protected void relayTextChanged() {
-
- if (isStoppedForwardingChanges()) {
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("NOT relaying text changed (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return;
- }
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("relaying text changed (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- final TextChangedEvent textChangedEvent = new TextChangedEvent(this);
-
- // we must assign listeners to local variable, since
- // the add and remove listener
- // methods can change the actual instance of the
- // listener array from another thread
-
- Runnable runnable = new Runnable() {
- public void run() {
- if (fTextChangeListeners != null) {
- Object[] holdListeners = fTextChangeListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- // this is a safe cast, since addListeners
- // requires a IStructuredDocumentListener
- ((TextChangeListener) holdListeners[i]).textChanged(textChangedEvent);
- }
- }
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- redrawTextChanged();
- }
-
- /**
- * Sends a text change to all registered listeners
- */
- protected void relayTextChanging(int requestedStart, int requestedLength, String requestedChange) {
-
- if (getDocument() == null)
- return;
- if (isStoppedForwardingChanges()) {
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("NOT relaying text changing: " + requestedStart + ":" + getDocument().getLength()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return;
- }
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("relaying text changing: " + requestedStart + ":" + getDocument().getLength()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- lastEvent = null;
- try {
- final TextChangingEvent textChangingEvent = new TextChangingEvent(this);
-
- textChangingEvent.start = requestedStart;
- textChangingEvent.replaceCharCount = requestedLength;
- textChangingEvent.newCharCount = (requestedChange == null ? 0 : requestedChange.length());
- textChangingEvent.replaceLineCount = getDocument().getNumberOfLines(requestedStart, requestedLength) - 1;
- textChangingEvent.newText = requestedChange;
- textChangingEvent.newLineCount = (requestedChange == null ? 0 : getDocument().computeNumberOfLines(requestedChange));
-
- // we must assign listeners to local variable,
- // since the add and remove listner
- // methods can change the actual instance of the
- // listener array from another thread
- Runnable runnable = new Runnable() {
- public void run() {
- if (fTextChangeListeners != null) {
- TextChangeListener[] holdListeners = fTextChangeListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- // this is a safe cast, since
- // addListeners requires a
- // IStructuredDocumentListener
- holdListeners[i].textChanging(textChangingEvent);
- }
- }
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /**
- * Sends a text set event to all registered listeners. Widget should
- * redraw itself automatically.
- */
- protected void relayTextSet() {
-
- if (isStoppedForwardingChanges()) {
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("NOT relaying text set (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return;
- }
- if (Debug.debugStructuredDocument && getDocument() != null) {
- System.out.println("relaying text set (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- lastEvent = null;
- final TextChangedEvent textChangedEvent = new TextChangedEvent(this);
-
- // we must assign listeners to local variable, since
- // the add and remove listner
- // methods can change the actual instance of the
- // listener array from another thread
- Runnable runnable = new Runnable() {
- public void run() {
- if (fTextChangeListeners != null) {
- TextChangeListener[] holdListeners = fTextChangeListeners;
- for (int i = 0; i < holdListeners.length; i++) {
- holdListeners[i].textSet(textChangedEvent);
- }
- }
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.custom.StyledTextContent#removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
- */
- public synchronized void removeTextChangeListener(final TextChangeListener listener) {
-
- if ((fTextChangeListeners != null) && (listener != null)) {
- // if its not in the listeners, we'll ignore the
- // request
- if (!Utilities.contains(fTextChangeListeners, listener)) {
- if (Debug.displayWarnings) {
- System.out.println("StructuredDocumentToTextAdapter::removeTextChangedListeners. listener " + listener + " was not present. "); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- if (Debug.debugStructuredDocument) {
- System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. Removing an instance of " + listener.getClass() + " as a listener on text adapter."); //$NON-NLS-2$//$NON-NLS-1$
- }
- final int oldSize = fTextChangeListeners.length;
- int newSize = oldSize - 1;
- final TextChangeListener[] newListeners = new TextChangeListener[newSize];
-
- Runnable runnable = new Runnable() {
- public void run() {
- int index = 0;
- for (int i = 0; i < oldSize; i++) {
- if (fTextChangeListeners[i] != listener) {
- // copy old to new if its not the
- // one we are removing
- newListeners[index++] = fTextChangeListeners[i];
- }
- }
- }
- };
- runOnDisplayThreadIfNeedede(runnable);
- // now that we have a new array, let's
- // switch it for the old one
- fTextChangeListeners = newListeners;
- }
- }
- }
-
- /**
- * Replace the text with "newText" starting at position "start" for a
- * length of "replaceLength".
- * <p>
- * Implementors have to notify TextChanged listeners after the content has
- * been updated. The TextChangedEvent should be set as follows:
- * <ul>
- * <li>event.type = SWT.TextReplaced
- * <li>event.start = start of the replaced text
- * <li>event.numReplacedLines = number of replaced lines
- * <li>event.numNewLines = number of new lines
- * <li>event.replacedLength = length of the replaced text
- * <li>event.newLength = length of the new text
- * </ul>
- * <b>NOTE: </b> numNewLines is the number of inserted lines and
- * numReplacedLines is the number of deleted lines based on the change
- * that occurs visually. For example:
- * <ul>
- * <li>(replacedText, newText) ==> (numReplacedLines, numNewLines)
- * <li>("", "\n") ==> (0, 1)
- * <li>("\n\n", "a") ==> (2, 0)
- * <li>("a", "\n\n") ==> (0, 2)
- * <li>("\n", "") ==> (1, 0)
- * </ul>
- * </p>
- *
- * @param start
- * start offset of text to replace, none of the offsets include
- * delimiters of preceeding lines, offset 0 is the first
- * character of the document
- * @param replaceLength
- * start offset of text to replace
- * @param newText
- * start offset of text to replace
- */
- public void replaceTextRange(int start, int replaceLength, String text) {
-
- if (getParentDocument() instanceof IStructuredDocument) {
- // the structuredDocument initiates the "changing"
- // and "changed" events.
- // they are both fired by the time this method
- // returns.
- IRegion region = getProjectionToMasterRegion(new Region(start, replaceLength));
- if (region != null) {
- ((IStructuredDocument) getParentDocument()).replaceText(this, region.getOffset(), region.getLength(), text);
- return;
- }
- }
- // default is to just try and replace text range in current document
- try {
- getDocument().replace(start, replaceLength, text);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentAdapterExtension#resumeForwardingDocumentChanges()
- */
- public void resumeForwardingDocumentChanges() {
-
- // from re-reading the textSet API in StyledText, we
- // must call
- // textSet if all the contents changed. If all the
- // contents did
- // not change, we need to call the pair of APIs,
- // textChanging and
- // textChanged. So, if we ever keep careful track of
- // changes
- // during stop forwarding and resume forwarding, we
- // can
- // investigate change make use of the pair of APIs.
- fStopRelayingChangesRequests--;
- if (fStopRelayingChangesRequests == 0) {
- // fIsForwarding= true;
- fDocumentClone = null;
- fOriginalContent = null;
- fOriginalLineDelimiters = null;
- // fireTextSet();
- relayTextSet();
- }
- }
-
- /**
- * This 'Runnable' should be very brief, and should not "call out" to
- * other code which itself might call syncExec, or deadlock might occur.
- *
- * @param r
- */
- private void runOnDisplayThreadIfNeedede(Runnable r) {
- // if there is no Display at all (that is, running headless),
- // or if we are already running on the display thread, then
- // simply execute the runnable.
- if (getDisplay() == null || (Thread.currentThread() == getDisplay().getThread())) {
- r.run();
- }
- else {
- // otherwise force the runnable to run on the display thread.
- //
- // Its unclear if we need this at all, once
- // we "force" document update to always take place on display
- // thread.
- IDocument doc = getDocument();
- if (doc instanceof ILockable) {
-
- ILock lock = null;
- try {
- lock = ((ILockable) doc).getLockObject();
- lock.acquire();
- getDisplay().syncExec(r);
- }
- finally {
- if (lock != null) {
- lock.release();
- }
- }
- }
- else {
- // else, ignore!, since risk of deadlock
- throw new IllegalStateException("non lockable document used for structuredDocumentToTextAdapter"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * @param newModel
- */
- public void setDocument(IDocument document) {
-
- if (getDocument() != null) {
- getDocument().removePrenotifiedDocumentListener(internalDocumentListener);
- }
- lastEvent = null;
- if (document instanceof ProjectionDocument) {
- fChildDocument = (ProjectionDocument) document;
- _setDocument(fChildDocument.getMasterDocument());
- }
- else {
- fChildDocument = null;
- _setDocument(document);
- }
- if (getDocument() != null) {
- getDocument().addPrenotifiedDocumentListener(internalDocumentListener);
- }
- }
-
- /**
- * @see IDocument#setText
- */
- public void setText(String string) {
-
- if (isStoppedForwardingChanges()) {
- fDocumentClone = null;
- fOriginalContent = getDocument().get();
- fOriginalLineDelimiters = getDocument().getLegalLineDelimiters();
- }
- else if (getParentDocument() instanceof IStructuredDocument) {
- ((IStructuredDocument) getDocument()).setText(this, string);
- }
- else {
- getDocument().set(string);
- }
- relayTextSet();
- }
-
- /**
- * This method was added to make testing easier. Normally, the widget is
- * specified on the constructor.
- */
- public void setWidget(StyledText widget) {
-
- fStyledTextWidget = widget;
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentAdapterExtension#stopForwardingDocumentChanges()
- */
- public void stopForwardingDocumentChanges() {
-
- fStopRelayingChangesRequests++;
- // only need to take snapshot on first request
- if (fStopRelayingChangesRequests == 1) {
- fDocumentClone = null;
- fOriginalContent = getDocument().get();
- fOriginalLineDelimiters = getDocument().getLegalLineDelimiters();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
deleted file mode 100644
index 69d5d280e1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
+++ /dev/null
@@ -1,48 +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.sse.ui.internal;
-
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.source.LineChangeHover;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Escapes diff hover presentation text (converts < to &lt; > to &gt; etc...)
- * so that html in the diff file (displayed in hover) isn't presented as style
- * (bold, italic, colors, etc...)
- *
- * @deprecated
- */
-public class StructuredLineChangeHover extends LineChangeHover {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverControlCreator()
- */
- public IInformationControlCreator getHoverControlCreator() {
- // use the default information control creator that just displays text
- // as text, not html content
- // because there is no special html that should be presented when just
- // showing diff
- // in the future, sourceviewer should be used instead of this plain
- // text control like java uses
- // SourceViewerInformationControl
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent);
- }
- };
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
deleted file mode 100644
index 2a725b5e7e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.source.IAnnotationPresentation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-
-/**
- * This is overridden to get around the problem of being registered as a
- * org.eclipse.wst.validation.core.problemmarker rather than a
- * org.eclipse.core.resource.problemmarker causing all problems to be skipped
- * in the OverviewRuler
- */
-public class StructuredMarkerAnnotation extends MarkerAnnotation implements IAnnotationPresentation {
- // controls if icon should be painted gray
- private boolean fIsGrayed = false;
- String fAnnotationType = null;
-
- StructuredMarkerAnnotation(IMarker marker) {
- super(marker);
- }
-
- public final String getAnnotationType() {
- if (fAnnotationType==null){
- initAnnotationType();
- }
- return fAnnotationType;
- }
-
- /**
- * Eventually will have to use IAnnotationPresentation &
- * IAnnotationExtension
- *
- * @see org.eclipse.ui.texteditor.MarkerAnnotation#getImage(org.eclipse.swt.widgets.Display)
- */
- protected Image getImage(Display display) {
- Image image = null;
- String annotationType = getAnnotationType();
- if (annotationType == TemporaryAnnotation.ANNOT_ERROR) {
- image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
- }
- else if (annotationType == TemporaryAnnotation.ANNOT_WARNING) {
- image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
- }
- else if (annotationType == TemporaryAnnotation.ANNOT_INFO) {
- image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
- }
-
- if (image != null && isGrayed())
- setImage(getGrayImage(display, image));
- else
- setImage(image);
-
- return super.getImage(display);
- }
-
- private Image getGrayImage(Display display, Image image) {
- if (image != null) {
- String key = Integer.toString(image.hashCode());
- // make sure we cache the gray image
- Image grayImage = JFaceResources.getImageRegistry().get(key);
- if (grayImage == null) {
- grayImage = new Image(display, image, SWT.IMAGE_GRAY);
- JFaceResources.getImageRegistry().put(key, grayImage);
- }
- image = grayImage;
- }
- return image;
- }
-
- public final boolean isGrayed() {
- return fIsGrayed;
- }
-
- public final void setGrayed(boolean grayed) {
- fIsGrayed = grayed;
- }
-
- /**
- * Initializes the annotation's icon representation and its drawing layer
- * based upon the properties of the underlying marker.
- */
- protected void initAnnotationType() {
-
- IMarker marker = getMarker();
- fAnnotationType = TemporaryAnnotation.ANNOT_UNKNOWN;
- try {
- if (marker.exists() && marker.isSubtypeOf(IMarker.PROBLEM)) {
- int severity = marker.getAttribute(IMarker.SEVERITY, -1);
- switch (severity) {
- case IMarker.SEVERITY_ERROR :
- fAnnotationType = TemporaryAnnotation.ANNOT_ERROR;
- break;
- case IMarker.SEVERITY_WARNING :
- fAnnotationType = TemporaryAnnotation.ANNOT_WARNING;
- break;
- case IMarker.SEVERITY_INFO :
- fAnnotationType = TemporaryAnnotation.ANNOT_INFO;
- break;
- }
- }
-
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java
deleted file mode 100644
index 73d6babd46..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.Position;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointConstants;
-
-
-/**
- * Source editor resource marker annotation model implementation
- */
-public class StructuredResourceMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
- /**
- * Loading of markers when working with non-IResources is accomplished by
- * adding the markers to the workspace root with an additional key, whose
- * value uses '/' for segment separators when representing paths,
- * determining whether they're added into the annotation model.
- *
- * Setters of this attribute should use '/'for segment separators when
- * representing paths.
- */
- public final static String SECONDARY_ID_KEY = IBreakpointConstants.RESOURCE_PATH;
-
- protected IResource fMarkerResource;
- protected String fSecondaryMarkerAttributeValue;
-
- /**
- * Constructor
- *
- * @param resource
- */
- public StructuredResourceMarkerAnnotationModel(IResource resource) {
- super(resource);
- fMarkerResource = resource;
- }
-
- public StructuredResourceMarkerAnnotationModel(IResource resource, String secondaryID) {
- super(resource);
- fMarkerResource = resource;
- fSecondaryMarkerAttributeValue = secondaryID;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#createMarkerAnnotation(org.eclipse.core.resources.IMarker)
- */
- protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
- /*
- * We need to do some special processing if marker is a validation
- * (aka problem) marker or if marker is a breakpoint marker so create
- * a special marker annotation for those markers. Otherwise, use
- * default.
- */
- if (MarkerUtilities.isMarkerType(marker, IMarker.PROBLEM)) {
- return new StructuredMarkerAnnotation(marker);
- }
- return super.createMarkerAnnotation(marker);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#getMarkerPosition(org.eclipse.core.resources.IMarker)
- */
- public Position getMarkerPosition(IMarker marker) {
- Position pos = super.getMarkerPosition(marker);
-
- // if ((pos == null || pos.getLength() == 0) && marker.getType() ==
- // IInternalDebugUIConstants.ANN_INSTR_POINTER_CURRENT) {
- if (pos == null || pos.getLength() == 0) {
- // We probably should create position from marker if marker
- // attributes specify a valid position
- pos = createPositionFromMarker(marker);
- }
-
- return pos;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#isAcceptable(org.eclipse.core.resources.IMarker)
- */
- protected boolean isAcceptable(IMarker marker) {
- try {
- Object attr = marker.getAttribute(IBreakpointConstants.ATTR_HIDDEN);
- if (attr != null && Boolean.TRUE.equals(attr))
- return false;
- }
- catch (CoreException e) {
- // ignore
- }
-
- if (fSecondaryMarkerAttributeValue == null)
- return super.isAcceptable(marker);
- String markerSecondaryMarkerAttributeValue = marker.getAttribute(SECONDARY_ID_KEY, ""); //$NON-NLS-1$
- boolean isSameFile = fSecondaryMarkerAttributeValue.equalsIgnoreCase(markerSecondaryMarkerAttributeValue);
- return super.isAcceptable(marker) && isSameFile;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java
deleted file mode 100644
index 6e5b235d84..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java
+++ /dev/null
@@ -1,49 +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.sse.ui.internal;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory;
-
-/**
- *
- * @author nsd
- *
- * Used by the org.eclipse.core.filebuffers.annotationModelCreation extension
- * point
- */
-public class StructuredResourceMarkerAnnotationModelFactory extends ResourceMarkerAnnotationModelFactory {
-
- public StructuredResourceMarkerAnnotationModelFactory() {
- super();
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IAnnotationModelFactory#createAnnotationModel(org.eclipse.core.runtime.IPath)
- */
- public IAnnotationModel createAnnotationModel(IPath location) {
- IAnnotationModel model = null;
- IFile file = FileBuffers.getWorkspaceFileAtLocation(location);
- if (file != null) {
- model = new StructuredResourceMarkerAnnotationModel(file);
- }
- else {
- model = new StructuredResourceMarkerAnnotationModel(ResourcesPlugin.getWorkspace().getRoot(), location.toString());
- }
- return model;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
deleted file mode 100644
index 624a3f7d36..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
+++ /dev/null
@@ -1,81 +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.wst.sse.ui.internal;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.internal.text.html.HTMLPrinter;
-import org.eclipse.jface.text.source.DefaultAnnotationHover;
-
-/**
- * Determines all messages for the given line and collects, concatenates, and
- * formats them in HTML. Use of the internal HTMLPrinter was observed in
- * org.eclipse.jdt.internal.ui.text.HTMLAnnotationHover .
- */
-public class StructuredTextAnnotationHover extends DefaultAnnotationHover {
-
- public StructuredTextAnnotationHover() {
- super();
- }
-
- public StructuredTextAnnotationHover(boolean showLineNumber) {
- super(showLineNumber);
- }
-
- /*
- * Formats a message as HTML text.
- */
- protected String formatSingleMessage(String message) {
- StringBuffer buffer = new StringBuffer();
- HTMLPrinter.addPageProlog(buffer);
- HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
- HTMLPrinter.addPageEpilog(buffer);
- return buffer.toString();
- }
-
- /*
- * Formats several message as HTML text.
- */
- protected String formatMultipleMessages(List messages) {
- StringBuffer buffer = new StringBuffer();
- HTMLPrinter.addPageProlog(buffer);
- HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(SSEUIMessages.Multiple_errors));
-
- HTMLPrinter.startBulletList(buffer);
- Set collectedMessages = new HashSet();
- Iterator e = messages.iterator();
- while (e.hasNext()) {
- String converted = HTMLPrinter.convertToHTMLContent((String) e.next());
- collectedMessages.add(converted);
- }
- e = collectedMessages.iterator();
- while (e.hasNext()) {
- HTMLPrinter.addBullet(buffer, e.next().toString());
- }
- HTMLPrinter.endBulletList(buffer);
-
- HTMLPrinter.addPageEpilog(buffer);
- return buffer.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.IReleasable#release()
- */
- public void release() {
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java
deleted file mode 100644
index 7fe3debf01..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java
+++ /dev/null
@@ -1,114 +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.sse.ui.internal;
-
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.swt.graphics.GC;
-
-/*
- * Not a real reader. Could change if requested
- */
-public class StructuredTextLineBreakingReader {
- private GC fGC;
- private int fIndex;
- private String fLine;
- private int fMaxWidth;
-
- private BufferedReader fReader;
-
- /**
- * Creates a reader that breaks an input text to fit in a given width.
- *
- * @param reader
- * Reader of the input text
- * @param gc
- * The graphic context that defines the currently used font
- * sizes
- * @param maxLineWidth
- * The max width (pixes) where the text has to fit in
- */
- public StructuredTextLineBreakingReader(Reader reader, GC gc, int maxLineWidth) {
- fReader = new BufferedReader(reader);
- fGC = gc;
- fMaxWidth = maxLineWidth;
- fLine = null;
- fIndex = 0;
- }
-
- private int findNextBreakIndex(int currIndex) {
- int currWidth = 0;
- int lineLength = fLine.length();
-
- while (currIndex < lineLength) {
- char ch = fLine.charAt(currIndex);
- int nextIndex = currIndex + 1;
- // leading whitespaces are counted to the following word
- if (Character.isWhitespace(ch)) {
- while (nextIndex < lineLength && Character.isWhitespace(fLine.charAt(nextIndex))) {
- nextIndex++;
- }
- }
- while (nextIndex < lineLength && !Character.isWhitespace(fLine.charAt(nextIndex))) {
- nextIndex++;
- }
- String word = fLine.substring(currIndex, nextIndex);
- int wordWidth = fGC.textExtent(word).x;
- int nextWidth = wordWidth + currWidth;
- if (nextWidth > fMaxWidth && wordWidth < fMaxWidth) {
- return currIndex;
- }
- currWidth = nextWidth;
- currIndex = nextIndex;
- }
- return currIndex;
- }
-
- private int findWordBegin(int idx) {
- while (idx < fLine.length() && Character.isWhitespace(fLine.charAt(idx))) {
- idx++;
- }
- return idx;
- }
-
- /**
- * Reads the next line. The lengths of the line will not exceed the gived
- * maximum width.
- */
- public String readLine() throws IOException {
- if (fLine == null) {
- String line = fReader.readLine();
- if (line == null) {
- return null;
- }
- int lineLen = fGC.textExtent(line).x;
- if (lineLen < fMaxWidth) {
- return line;
- }
- fLine = line;
- fIndex = 0;
- }
- int breakIdx = findNextBreakIndex(fIndex);
- String res = fLine.substring(fIndex, breakIdx);
- if (breakIdx < fLine.length()) {
- fIndex = findWordBegin(breakIdx);
- } else {
- fLine = null;
- }
- return res;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java
deleted file mode 100644
index bb8dc2d953..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * This event is used by the SourceEditorTreeViewer to tell the
- * ViewerSelectionManager that the selection really came from a user click on
- * the content outliner, instead of being set programatically.
- */
-public class StructuredTextSelectionChangedEvent extends org.eclipse.jface.viewers.SelectionChangedEvent {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- public StructuredTextSelectionChangedEvent(ISelectionProvider source, ISelection selection) {
- super(source, selection);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
deleted file mode 100644
index 73150612b7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
+++ /dev/null
@@ -1,971 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentAdapter;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextPresentationListener;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistantExtension2;
-import org.eclipse.jface.text.contentassist.IContentAssistantExtension4;
-import org.eclipse.jface.text.formatter.FormattingContext;
-import org.eclipse.jface.text.formatter.FormattingContextProperties;
-import org.eclipse.jface.text.formatter.IContentFormatterExtension;
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.projection.ProjectionDocument;
-import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.ContentAssistantFacade;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredContentCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.undo.UndoDocumentEvent;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.CompatibleHighlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
- * <p>
- * Like {@link org.eclipse.wst.sse.ui.StructuredTextEditor}, this class is not
- * meant to be subclassed.<br />
- */
-public class StructuredTextViewer extends ProjectionViewer implements IDocumentSelectionMediator {
- /** Text operation codes */
- private static final int BASE = ProjectionViewer.COLLAPSE_ALL; // see
- // ProjectionViewer.COLLAPSE_ALL
- private static final int CLEANUP_DOCUMENT = BASE + 4;
- public static final int FORMAT_ACTIVE_ELEMENTS = BASE + 3;
-
- private static final String FORMAT_ACTIVE_ELEMENTS_TEXT = SSEUIMessages.Format_Active_Elements_UI_; //$NON-NLS-1$
- public static final int FORMAT_DOCUMENT = BASE + 2;
- private static final String FORMAT_DOCUMENT_TEXT = SSEUIMessages.Format_Document_UI_; //$NON-NLS-1$
- private static final String TEXT_CUT = SSEUIMessages.Text_Cut_UI_; //$NON-NLS-1$
- private static final String TEXT_PASTE = SSEUIMessages.Text_Paste_UI_; //$NON-NLS-1$
- private static final String TEXT_SHIFT_LEFT = SSEUIMessages.Text_Shift_Left_UI_; //$NON-NLS-1$ = "Text Shift Left"
- private static final String TEXT_SHIFT_RIGHT = SSEUIMessages.Text_Shift_Right_UI_; //$NON-NLS-1$ = "Text Shift Right"
- private static final boolean TRACE_EXCEPTIONS = true;
-
- /*
- * Max length of chars to format before it is considered a "big format"
- * This is used to indication a small unrestricted rewrite session.
- */
- private final int MAX_SMALL_FORMAT_LENGTH = 1000;
- private boolean fBackgroundupdateInProgress;
- private StructuredContentCleanupHandler fContentCleanupHandler = null;
- //private IDocumentAdapter fDocAdapter;
-
- private Highlighter fHighlighter;
-
- private ReconcilerHighlighter fRecHighlighter = null;
-
- // private ViewerSelectionManager fViewerSelectionManager;
- private SourceViewerConfiguration fConfiguration;
- /*
- * True if formatter has been set
- */
- private boolean fFormatterSet = false;
-
- private ContentAssistantFacade fContentAssistantFacade;
-
- /**
- * @see org.eclipse.jface.text.source.SourceViewer#SourceViewer(Composite,
- * IVerticalRuler, IOverviewRuler, boolean, int)
- */
- public StructuredTextViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles) {
- super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
- }
-
- /**
- *
- */
- private void beep() {
- getTextWidget().getDisplay().beep();
- }
-
- public void beginBackgroundUpdate() {
- fBackgroundupdateInProgress = true;
- setRedraw(false);
- }
-
- protected void createControl(Composite parent, int styles) {
- // Forces LEFT_TO_RIGHT orientation unless otherwise suggested
- if ((styles & SWT.LEFT_TO_RIGHT) == 0 && (styles & SWT.RIGHT_TO_LEFT) == 0)
- styles |= SWT.LEFT_TO_RIGHT;
- super.createControl(parent, styles);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextOperationTarget#canDoOperation(int)
- */
- public boolean canDoOperation(int operation) {
- if (fBackgroundupdateInProgress) {
- return false;
- }
- switch (operation) {
- case CONTENTASSIST_PROPOSALS : {
- // (pa) if position isn't READ_ONLY (containsReadOnly()
- // returns false),
- // Otherwise, you DO want content assist (return true)
- IDocument doc = getDocument();
- if (doc != null && doc instanceof IStructuredDocument) {
- return isEditable() && (!((IStructuredDocument) doc).containsReadOnly(getSelectedRange().x, 0));
- }
- break;
- }
- case CLEANUP_DOCUMENT : {
- return (fContentCleanupHandler != null && isEditable());
- }
- case FORMAT_DOCUMENT :
- case FORMAT_ACTIVE_ELEMENTS : {
- // if formatter not set yet, contentformatter can be null
- return ((fContentFormatter != null || !fFormatterSet) && isEditable());
- }
- }
- return super.canDoOperation(operation);
- }
-
- /**
- * Should be identical to superclass version. Plus, we get our own special
- * Highlighter. Plus we uninstall before installing.
- */
- public void configure(SourceViewerConfiguration configuration) {
-
- if (getTextWidget() == null)
- return;
-
- setDocumentPartitioning(configuration.getConfiguredDocumentPartitioning(this));
-
- // always uninstall highlighter and null it out on new configuration
- if (fHighlighter != null) {
- fHighlighter.uninstall();
- fHighlighter = null;
- }
-
- if(fRecHighlighter != null) {
- fRecHighlighter.uninstall();
- fRecHighlighter = null;
- }
-
- // Bug 230297 - Uninstall presentation reconciler in preparation of a new one
- if(fPresentationReconciler != null) {
- fPresentationReconciler.uninstall();
- fPresentationReconciler = null;
- }
-
- IReconciler newReconciler = configuration.getReconciler(this);
-
- if (newReconciler != fReconciler || newReconciler == null || fReconciler == null) {
-
- if (fReconciler != null) {
- fReconciler.uninstall();
- }
-
- fReconciler = newReconciler;
-
- if (fReconciler != null) {
- fReconciler.install(this);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3858
- // still need set document on the reconciler (strategies)
- if (fReconciler instanceof StructuredRegionProcessor)
- ((StructuredRegionProcessor) fReconciler).setDocument(getDocument());
- }
- }
-
- IContentAssistant newAssistant = configuration.getContentAssistant(this);
- if (newAssistant != fContentAssistant || newAssistant == null || fContentAssistant == null) {
- if (fContentAssistant != null)
- fContentAssistant.uninstall();
-
- fContentAssistant = newAssistant;
-
- if (fContentAssistant != null) {
- fContentAssistant.install(this);
- if (fContentAssistant instanceof IContentAssistantExtension2 && fContentAssistant instanceof IContentAssistantExtension4)
- fContentAssistantFacade= new ContentAssistantFacade(fContentAssistant);
- fContentAssistantInstalled = true;
- }
- else {
- // 248036
- // disable the content assist operation if no content
- // assistant
- enableOperation(CONTENTASSIST_PROPOSALS, false);
- fContentAssistantInstalled = false;
- }
- }
-
- IQuickAssistAssistant quickAssistant = configuration.getQuickAssistAssistant(this);
- if (quickAssistant != fQuickAssistAssistant || quickAssistant == null || fQuickAssistAssistant == null) {
- if (fQuickAssistAssistant != null)
- fQuickAssistAssistant.uninstall();
-
- fQuickAssistAssistant = quickAssistant;
-
- if (fQuickAssistAssistant != null) {
- fQuickAssistAssistant.install(this);
- fQuickAssistAssistantInstalled = true;
- }
- else {
- // 248036
- // disable the content assist operation if no content
- // assistant
- enableOperation(QUICK_ASSIST, false);
- fQuickAssistAssistantInstalled = false;
- }
- }
-
- fContentFormatter = configuration.getContentFormatter(this);
-
- // do not uninstall old information presenter if it's the same
- IInformationPresenter newInformationPresenter = configuration.getInformationPresenter(this);
- if (newInformationPresenter == null || fInformationPresenter == null || !(newInformationPresenter.equals(fInformationPresenter))) {
- if (fInformationPresenter != null)
- fInformationPresenter.uninstall();
- fInformationPresenter = newInformationPresenter;
- if (fInformationPresenter != null)
- fInformationPresenter.install(this);
- }
-
- // disconnect from the old undo manager before setting the new one
- if (fUndoManager != null) {
- fUndoManager.disconnect();
- }
- setUndoManager(configuration.getUndoManager(this));
-
- // release old annotation hover before setting new one
- if (fAnnotationHover instanceof StructuredTextAnnotationHover) {
- ((StructuredTextAnnotationHover) fAnnotationHover).release();
- }
- setAnnotationHover(configuration.getAnnotationHover(this));
-
- // release old annotation hover before setting new one
- if (fOverviewRulerAnnotationHover instanceof StructuredTextAnnotationHover) {
- ((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
- }
- setOverviewRulerAnnotationHover(configuration.getOverviewRulerAnnotationHover(this));
-
- getTextWidget().setTabs(configuration.getTabWidth(this));
- setHoverControlCreator(configuration.getInformationControlCreator(this));
-
- // if hyperlink manager has already been created, uninstall it
- if (fHyperlinkManager != null) {
- setHyperlinkDetectors(null, SWT.NONE);
- }
- setHyperlinkPresenter(configuration.getHyperlinkPresenter(this));
- IHyperlinkDetector[] hyperlinkDetectors = configuration.getHyperlinkDetectors(this);
- int eventStateMask = configuration.getHyperlinkStateMask(this);
- setHyperlinkDetectors(hyperlinkDetectors, eventStateMask);
-
- String[] types = configuration.getConfiguredContentTypes(this);
-
- // clear autoindent/autoedit strategies
- fAutoIndentStrategies = null;
-
- for (int i = 0; i < types.length; i++) {
- String t = types[i];
- setAutoEditStrategies(configuration.getAutoEditStrategies(this, t), t);
- setTextDoubleClickStrategy(configuration.getDoubleClickStrategy(this, t), t);
-
- int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(this, t);
- if (stateMasks != null) {
- for (int j = 0; j < stateMasks.length; j++) {
- int stateMask = stateMasks[j];
- setTextHover(configuration.getTextHover(this, t, stateMask), t, stateMask);
- }
- }
- else {
- setTextHover(configuration.getTextHover(this, t), t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
- }
-
- String[] prefixes = configuration.getIndentPrefixes(this, t);
- if (prefixes != null && prefixes.length > 0)
- setIndentPrefixes(prefixes, t);
-
- prefixes = configuration.getDefaultPrefixes(this, t);
- if (prefixes != null && prefixes.length > 0)
- setDefaultPrefixes(prefixes, t);
-
- // Bug 230297 - Add LineStyleProviders from the new configuration if
- // the document is set
- if(getDocument() != null) {
- // add highlighter/linestyleprovider
- LineStyleProvider[] providers = ((StructuredTextViewerConfiguration) configuration).getLineStyleProviders(this, t);
- if (providers != null) {
- for (int j = 0; j < providers.length; ++j) {
-
- if(fRecHighlighter == null) {
- fRecHighlighter = new ReconcilerHighlighter();
- ((StructuredTextViewerConfiguration) configuration).setHighlighter(fRecHighlighter);
- }
- if (providers[j] instanceof AbstractLineStyleProvider) {
- ((AbstractLineStyleProvider) providers[j]).init((IStructuredDocument) getDocument(), fRecHighlighter);
- fRecHighlighter.addProvider(t, providers[j]);
- }
- else {
- // init with compatibility instance
- if (fHighlighter == null) {
- fHighlighter = new CompatibleHighlighter();
- }
- Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + providers[j].getClass()); //$NON-NLS-1$
- providers[j].init((IStructuredDocument) getDocument(), fHighlighter);
- fHighlighter.addProvider(t, providers[j]);
- }
- }
- }
- }
- }
-
- // initialize highlighter after linestyleproviders were added
- if (fHighlighter != null) {
- fHighlighter.setDocumentPartitioning(configuration.getConfiguredDocumentPartitioning(this));
- fHighlighter.setDocument((IStructuredDocument) getDocument());
- fHighlighter.install(this);
- }
-
- if (fRecHighlighter != null)
- fRecHighlighter.install(this);
-
- activatePlugins();
-
- fConfiguration = configuration;
-
- // Update the viewer's presentation reconciler
- fPresentationReconciler = configuration.getPresentationReconciler(this);
-
- if(fPresentationReconciler != null)
- fPresentationReconciler.install(this);
- }
-
- /**
- * @param document
- * @param startOffset
- * @param endOffset
- * @return
- */
- private boolean containsReadOnly(IDocument document, int startOffset, int endOffset) {
-
- int start = startOffset;
- int end = endOffset;
- IStructuredDocument structuredDocument = null;
- if (document instanceof IStructuredDocument) {
- structuredDocument = (IStructuredDocument) document;
- }
- else {
- if (document instanceof ProjectionDocument) {
- IDocument doc = ((ProjectionDocument) document).getMasterDocument();
- if (doc instanceof IStructuredDocument) {
- structuredDocument = (IStructuredDocument) doc;
- int adjust = ((ProjectionDocument) document).getProjectionMapping().getCoverage().getOffset();
- start = adjust + start;
- end = adjust + end;
- }
- }
- }
- if (structuredDocument == null) {
- return false;
- }
- else {
- int length = end - start;
- return structuredDocument.containsReadOnly(start, length);
- }
- }
-
- /**
- * @deprecated - present for compatibility only
- */
- protected IDocumentAdapter createDocumentAdapter() {
- return super.createDocumentAdapter();
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextOperationTarget#doOperation(int)
- */
- public void doOperation(int operation) {
-
- Point selection = getTextWidget().getSelection();
- int cursorPosition = selection.x;
- int selectionLength = selection.y - selection.x;
- switch (operation) {
- case CUT :
- beginRecording(TEXT_CUT, TEXT_CUT, cursorPosition, selectionLength);
- super.doOperation(operation);
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- break;
- case PASTE :
- beginRecording(TEXT_PASTE, TEXT_PASTE, cursorPosition, selectionLength);
- super.doOperation(operation);
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- break;
- case CONTENTASSIST_PROPOSALS :
- // maybe not configured?
- if (fContentAssistant != null && isEditable()) {
- // CMVC 263269
- // need an explicit check here because the
- // contentAssistAction is no longer being updated on
- // cursor
- // position
- if (canDoOperation(CONTENTASSIST_PROPOSALS)) {
- String err = fContentAssistant.showPossibleCompletions();
- if (err != null) {
- // don't wanna beep if there is no error
- PlatformStatusLineUtil.displayTemporaryErrorMessage(this, err);
- }
- }
- else
- beep();
- }
- break;
- case CONTENTASSIST_CONTEXT_INFORMATION :
- if (fContentAssistant != null) {
- String err = fContentAssistant.showContextInformation();
- if (err != null) {
- // don't wanna beep if there is no error
- PlatformStatusLineUtil.displayTemporaryErrorMessage(this, err);
- }
- }
- break;
- case SHIFT_RIGHT :
- beginRecording(TEXT_SHIFT_RIGHT, TEXT_SHIFT_RIGHT, cursorPosition, selectionLength);
- updateIndentationPrefixes();
- super.doOperation(SHIFT_RIGHT);
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- break;
- case SHIFT_LEFT :
- beginRecording(TEXT_SHIFT_LEFT, TEXT_SHIFT_LEFT, cursorPosition, selectionLength);
- updateIndentationPrefixes();
- super.doOperation(SHIFT_LEFT);
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- break;
- case FORMAT_DOCUMENT :
- DocumentRewriteSession rewriteSession = null;
- IDocument document = getDocument();
- try {
- /*
- * This command will actually format selection if text is
- * selected, otherwise format entire document
- */
- // begin recording
- beginRecording(FORMAT_DOCUMENT_TEXT, FORMAT_DOCUMENT_TEXT, cursorPosition, selectionLength);
- boolean formatDocument = false;
- IRegion region = null;
- Point s = getSelectedRange();
- if (s.y > 0) {
- // only format currently selected text
- region = new Region(s.x, s.y);
- }
- else {
- // no selection, so format entire document
- region = getModelCoverage();
- formatDocument = true;
- }
-
- if (document instanceof IDocumentExtension4) {
- IDocumentExtension4 extension = (IDocumentExtension4) document;
- DocumentRewriteSessionType type = (selection.y == 0 || selection.y > MAX_SMALL_FORMAT_LENGTH) ? DocumentRewriteSessionType.UNRESTRICTED : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
- rewriteSession = (extension.getActiveRewriteSession() != null) ? null : extension.startRewriteSession(type);
- }
- else {
- setRedraw(false);
- }
-
- if (fContentFormatter instanceof IContentFormatterExtension) {
- IContentFormatterExtension extension = (IContentFormatterExtension) fContentFormatter;
- IFormattingContext context = new FormattingContext();
- context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(formatDocument));
- context.setProperty(FormattingContextProperties.CONTEXT_REGION, region);
- extension.format(document, context);
- }
- else {
- fContentFormatter.format(document, region);
- }
- }
- finally {
- try {
- if (rewriteSession != null) {
- IDocumentExtension4 extension = (IDocumentExtension4) document;
- extension.stopRewriteSession(rewriteSession);
- }
- else {
- setRedraw(true);
- }
- }
- finally {
- // end recording
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- }
- }
- break;
- case FORMAT_ACTIVE_ELEMENTS :
- rewriteSession = null;
- document = getDocument();
- try {
- /*
- * This command will format the node at cursor position
- * (and all its children)
- */
- // begin recording
- beginRecording(FORMAT_ACTIVE_ELEMENTS_TEXT, FORMAT_ACTIVE_ELEMENTS_TEXT, cursorPosition, selectionLength);
- IRegion region = null;
- Point s = getSelectedRange();
- if (s.y > -1) {
- // only format node at cursor position
- region = new Region(s.x, s.y);
- }
-
- if (document instanceof IDocumentExtension4) {
- IDocumentExtension4 extension = (IDocumentExtension4) document;
- DocumentRewriteSessionType type = (selection.y == 0 || selection.y > MAX_SMALL_FORMAT_LENGTH) ? DocumentRewriteSessionType.UNRESTRICTED : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
- rewriteSession = (extension.getActiveRewriteSession() != null) ? null : extension.startRewriteSession(type);
- }
- else {
- setRedraw(false);
- }
-
- if (fContentFormatter instanceof IContentFormatterExtension) {
- IContentFormatterExtension extension = (IContentFormatterExtension) fContentFormatter;
- IFormattingContext context = new FormattingContext();
- context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.FALSE);
- context.setProperty(FormattingContextProperties.CONTEXT_REGION, region);
- extension.format(getDocument(), context);
- }
- else {
- fContentFormatter.format(getDocument(), region);
- }
- }
- finally {
- try {
- if (rewriteSession != null) {
- IDocumentExtension4 extension = (IDocumentExtension4) document;
- extension.stopRewriteSession(rewriteSession);
- }
- else {
- setRedraw(true);
- }
- }
- finally {
- // end recording
- selection = getTextWidget().getSelection();
- cursorPosition = selection.x;
- selectionLength = selection.y - selection.x;
- endRecording(cursorPosition, selectionLength);
- }
- }
- break;
- default :
- super.doOperation(operation);
- }
- }
-
- private void endRecording(int cursorPosition, int selectionLength) {
- IDocument doc = getDocument();
- if (doc instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) doc;
- IStructuredTextUndoManager undoManager = structuredDocument.getUndoManager();
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198617
- // undo after paste in document with folds - wrong behavior
- IRegion widgetSelection = new Region(cursorPosition, selectionLength);
- IRegion documentSelection = widgetRange2ModelRange(widgetSelection);
- if (documentSelection == null)
- documentSelection = widgetSelection;
- undoManager.endRecording(this, documentSelection.getOffset(), documentSelection.getLength());
- }
- else {
- // TODO: how to handle other document types?
- }
- }
-
- private void beginRecording(String label, String description, int cursorPosition, int selectionLength) {
- IDocument doc = getDocument();
- if (doc instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) doc;
- IStructuredTextUndoManager undoManager = structuredDocument.getUndoManager();
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198617
- // undo after paste in document with folds - wrong behavior
- IRegion widgetSelection = new Region(cursorPosition, selectionLength);
- IRegion documentSelection = widgetRange2ModelRange(widgetSelection);
- if (documentSelection == null)
- documentSelection = widgetSelection;
- undoManager.beginRecording(this, label, description, documentSelection.getOffset(), documentSelection.getLength());
- }
- else {
- // TODO: how to handle other document types?
- }
- }
-
- public void endBackgroundUpdate() {
- fBackgroundupdateInProgress = false;
- setRedraw(true);
- }
-
- protected void handleDispose() {
- Logger.trace("Source Editor", "StructuredTextViewer::handleDispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // before we dispose, we set a special "empty" selection, to prevent
- // the "leak one document" that
- // otherwise occurs when editor closed (since last selection stays in
- // SelectedResourceManager.
- // the occurance of the "leak" isn't so bad, but makes debugging other
- // leaks very hard.
- setSelection(TextSelection.emptySelection());
-
- if (fHighlighter != null) {
- fHighlighter.uninstall();
- fHighlighter = null;
- }
-
- if (fRecHighlighter != null) {
- fRecHighlighter.uninstall();
- fRecHighlighter = null;
- }
- super.handleDispose();
-
- Logger.trace("Source Editor", "StructuredTextViewer::handleDispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * Overridden for special support of background update and read-only
- * regions
- */
- protected void handleVerifyEvent(VerifyEvent e) {
- IRegion modelRange = event2ModelRange(e);
- if (exposeModelRange(modelRange)) {
- e.doit = false;
- return;
- }
-
- if (fEventConsumer != null) {
- fEventConsumer.processEvent(e);
- if (!e.doit)
- return;
- }
- if (fBackgroundupdateInProgress) {
- e.doit = false;
- beep();
- return;
- }
-
- // for read-only support
- if (containsReadOnly(getVisibleDocument(), e.start, e.end)) {
- e.doit = false;
- beep();
- return;
- }
-
- try {
- super.handleVerifyEvent(e);
- }
- catch (Exception x) {
- /*
- * Note, we catch and log any exception, since an otherwise can
- * actually prevent typing! see
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
- */
-
- if (TRACE_EXCEPTIONS)
- Logger.logException("StructuredTextViewer.exception.verifyText", x); //$NON-NLS-1$
- }
- }
-
- public int modelLine2WidgetLine(int modelLine) {
- /**
- * need to override this method as a workaround for Bug 85709
- */
- if (fInformationMapping == null) {
- IDocument document = getDocument();
- if (document != null) {
- try {
- IRegion modelLineRegion = getDocument().getLineInformation(modelLine);
- IRegion region = getModelCoverage();
- if (modelLineRegion != null && region != null) {
- int modelEnd = modelLineRegion.getOffset() + modelLineRegion.getLength();
- int regionEnd = region.getOffset() + region.getLength();
- // returns -1 if modelLine is invalid
- if ((modelLineRegion.getOffset() < region.getOffset()) || (modelEnd > regionEnd))
- return -1;
- }
- }
- catch (BadLocationException e) {
- // returns -1 if modelLine is invalid
- return -1;
- }
- }
- }
- return super.modelLine2WidgetLine(modelLine);
- }
-
- public int modelOffset2WidgetOffset(int modelOffset) {
- /**
- * need to override this method as a workaround for Bug 85709
- */
- if (fInformationMapping == null) {
- IRegion region = getModelCoverage();
- if (region != null) {
- // returns -1 if modelOffset is invalid
- if (modelOffset < region.getOffset() || modelOffset > (region.getOffset() + region.getLength()))
- return -1;
- }
- }
- return super.modelOffset2WidgetOffset(modelOffset);
- }
-
- public IRegion modelRange2WidgetRange(IRegion modelRange) {
- // need to override this method as workaround for Bug85709
- if (fInformationMapping == null) {
- IRegion region = getModelCoverage();
- if (region != null && modelRange != null) {
- int modelEnd = modelRange.getOffset() + modelRange.getLength();
- int regionEnd = region.getOffset() + region.getLength();
- // returns null if modelRange is invalid
- if ((modelRange.getOffset() < region.getOffset()) || (modelEnd > regionEnd))
- return null;
- }
- }
- return super.modelRange2WidgetRange(modelRange);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ISourceViewer#setDocument(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.source.IAnnotationModel, int, int)
- */
- public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) {
- // partial fix for:
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=1970
- // when our document is set, especially to null during close,
- // immediately uninstall the reconciler.
- // this is to avoid an unnecessary final "reconcile"
- // that blocks display thread
- if (document == null) {
- if (fReconciler != null) {
- fReconciler.uninstall();
- }
- }
-
- super.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength);
-
- if (document instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) document;
-
- // notify highlighter
- updateHighlighter(structuredDocument);
-
- // set the formatter again now that document has been set
- if (!fFormatterSet && fConfiguration != null) {
- fContentFormatter = fConfiguration.getContentFormatter(this);
- fFormatterSet = true;
- }
-
- // set document in the viewer-based undo manager
- if (fUndoManager != null) {
- fUndoManager.disconnect();
- fUndoManager.connect(this);
- }
- // CaretEvent is not sent to ViewerSelectionManager after Save As.
- // Need to notify ViewerSelectionManager here.
- // notifyViewerSelectionManager(getSelectedRange().x,
- // getSelectedRange().y);
- }
- }
-
- public ContentAssistantFacade getContentAssistFacade() {
- return fContentAssistantFacade;
- }
-
- /**
- * Uninstalls anything that was installed by configure
- */
- public void unconfigure() {
- Logger.trace("Source Editor", "StructuredTextViewer::unconfigure entry"); //$NON-NLS-1$ //$NON-NLS-2$
- if (fHighlighter != null) {
- fHighlighter.uninstall();
- fHighlighter = null;
- }
-
- if (fRecHighlighter != null) {
- fRecHighlighter.uninstall();
- fRecHighlighter = null;
- }
-
- if (fAnnotationHover instanceof StructuredTextAnnotationHover) {
- ((StructuredTextAnnotationHover) fAnnotationHover).release();
- }
-
- if (fOverviewRulerAnnotationHover instanceof StructuredTextAnnotationHover) {
- ((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
- }
-
- super.unconfigure();
- fConfiguration = null;
- Logger.trace("Source Editor", "StructuredTextViewer::unconfigure exit"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.undo.IDocumentSelectionMediator#undoOperationSelectionChanged(org.eclipse.wst.sse.core.undo.UndoDocumentEvent)
- */
- public void undoOperationSelectionChanged(UndoDocumentEvent event) {
- if (event.getRequester() != null && event.getRequester().equals(this) && event.getDocument().equals(getDocument())) {
- // BUG107687: Undo/redo do not scroll editor
- ITextSelection selection = new TextSelection(event.getOffset(), event.getLength());
- setSelection(selection, true);
- }
- }
-
- private void updateHighlighter(IStructuredDocument document) {
- boolean documentSet = false;
-
- // if highlighter has not been created yet, initialize and install it
- if (fRecHighlighter == null && fConfiguration instanceof StructuredTextViewerConfiguration) {
- String[] types = fConfiguration.getConfiguredContentTypes(this);
- for (int i = 0; i < types.length; i++) {
- String t = types[i];
-
- // add highlighter/linestyleprovider
- LineStyleProvider[] providers = ((StructuredTextViewerConfiguration) fConfiguration).getLineStyleProviders(this, t);
- if (providers != null) {
- for (int j = 0; j < providers.length; ++j) {
-
- if(fRecHighlighter == null) {
- fRecHighlighter = new ReconcilerHighlighter();
- ((StructuredTextViewerConfiguration) fConfiguration).setHighlighter(fRecHighlighter);
- }
- if (providers[j] instanceof AbstractLineStyleProvider) {
- ((AbstractLineStyleProvider) providers[j]).init(document, fRecHighlighter);
- fRecHighlighter.addProvider(t, providers[j]);
- }
- else {
- // init with compatibility instance
- if (fHighlighter == null) {
- fHighlighter = new CompatibleHighlighter();
- }
- Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + providers[j].getClass()); //$NON-NLS-1$
- providers[j].init(document, fHighlighter);
- fHighlighter.addProvider(t, providers[j]);
- }
- }
- }
- }
-
- if(fRecHighlighter != null)
- fRecHighlighter.install(this);
- if(fHighlighter != null) {
- fHighlighter.setDocumentPartitioning(fConfiguration.getConfiguredDocumentPartitioning(this));
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=203347
- // make sure to set document before install
- fHighlighter.setDocument(document);
- fHighlighter.install(this);
- documentSet = true;
- }
- }
- if (fHighlighter != null && !documentSet)
- fHighlighter.setDocument(document);
-
- // install content type independent plugins
- if (fPresentationReconciler != null)
- fPresentationReconciler.uninstall();
- // 228847 - XSL Content Assist tests fail with Null Pointer on Highlighter
- if(fConfiguration != null)
- fPresentationReconciler = fConfiguration.getPresentationReconciler(this);
-
- if (fPresentationReconciler != null)
- fPresentationReconciler.install(this);
-
- }
-
- /**
- * Make sure indentation is correct before using.
- */
- private void updateIndentationPrefixes() {
- SourceViewerConfiguration configuration = fConfiguration;
- if (fConfiguration != null) {
- String[] types = configuration.getConfiguredContentTypes(this);
- for (int i = 0; i < types.length; i++) {
- String[] prefixes = configuration.getIndentPrefixes(this, types[i]);
- if (prefixes != null && prefixes.length > 0)
- setIndentPrefixes(prefixes, types[i]);
- }
- }
- }
-
- /**
- * Prepends the text presentation listener at the beginning of the viewer's
- * list of text presentation listeners. If the listener is already registered
- * with the viewer this call moves the listener to the beginning of
- * the list.
- *
- * @param listener the text presentation listener
- * @since 3.1
- */
- public void prependTextPresentationListener(ITextPresentationListener listener) {
-
- Assert.isNotNull(listener);
-
- if (fTextPresentationListeners == null)
- fTextPresentationListeners= new ArrayList();
-
- fTextPresentationListeners.remove(listener);
- fTextPresentationListeners.add(0, listener);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java
deleted file mode 100644
index 82bc336d46..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal;
-
-
-
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * TextDropAction
- */
-public class TextDropAction extends AbstractDropAction {
- public boolean run(DropTargetEvent event, IEditorPart targetEditor) {
- return insert((String) event.data, targetEditor);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java
deleted file mode 100644
index 1d7d64a3eb..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.wst.sse.ui.internal.extension.DropActionProxy;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Builds drop target transfers, drag source transfers, and drop actions
- */
-public class TransferBuilder extends RegistryReader {
-
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_METHOD = "method"; //$NON-NLS-1$
- public static final String ATT_PRIORITY = "priority"; //$NON-NLS-1$
- public static final String ATT_SINGLETON = "singleton"; //$NON-NLS-1$
- public static final String ATT_TARGET_ID = "targetID"; //$NON-NLS-1$
- public static final String ATT_TRANSFER_ID = "transferID"; //$NON-NLS-1$
-
- private final static boolean debugTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/transferbuilder/time")); //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String PL_DRAG_SOURCE_TRANSFERS = "dragSourceTransfers"; //$NON-NLS-1$
- public static final String PL_DROP_TARGET_TRANSFERS = "dropTargetTransfers"; //$NON-NLS-1$
-
- public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
- public static final String[] PRIORITIES = {"highest", "high", "mid", "low", "lowest"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
- public static final String TAG_DRAG_SOURCE_CONTRIBUTION = "dragSourceContribution"; //$NON-NLS-1$
- public static final String TAG_DROP_ACTION = "dropAction"; //$NON-NLS-1$
- public static final String TAG_DROP_TARGET_CONTRIBUTION = "dropTargetContribution"; //$NON-NLS-1$
-
- public static final String TAG_TRANSFER = "transfer"; //$NON-NLS-1$
-
- public static final String TRUE = "true"; //$NON-NLS-1$
-
- private boolean useProxy;
-
- class TransferProxyForDelayLoading extends Transfer {
- private IConfigurationElement element;
- private String classAttribute;
- private Transfer proxy;
- private Method getTypeIdsMethod, getTypeNamesMethod, javaToNativeMethod, nativeToJavaMethod;
-
- TransferProxyForDelayLoading() {
- super();
- }
-
- TransferProxyForDelayLoading(IConfigurationElement elm, String clsAttr) {
- super();
- this.element = elm;
- this.classAttribute = clsAttr;
- }
-
- private Transfer newInstance() {
- if ((element != null) && (classAttribute != null)) {
- Object o = createExtension(element, classAttribute);
- if (o instanceof Transfer) {
- element = null;
- classAttribute = null;
- return (Transfer)o;
- }
- }
- return null;
- }
-
- public TransferData[] getSupportedTypes() {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- return proxy.getSupportedTypes();
- }
- return new TransferData[0];
- }
- protected int[] getTypeIds() {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- if (getTypeIdsMethod == null) {
- Class runtimeClass = proxy.getClass();
- NoSuchMethodException e = null;
- while (runtimeClass != null) {
- try {
- getTypeIdsMethod = runtimeClass.getDeclaredMethod("getTypeIds", new Class[0]);//$NON-NLS-1$
- getTypeIdsMethod.setAccessible(true);
- break;
- } catch (NoSuchMethodException e1) {
- e = e1;
- runtimeClass = runtimeClass.getSuperclass();
- } catch (SecurityException e2) {
- runtimeClass = runtimeClass.getSuperclass();
- }
- }
- if ((getTypeIdsMethod == null) && (e != null)) {
- Logger.logException(e);
- }
- }
- if (getTypeIdsMethod != null) {
- try {
- // changed Integer[] return type to int[]
- int[] r = (int[])getTypeIdsMethod.invoke(proxy, new Object[0]);
- if ((r != null) && (r.length > 0)) {
- int[] ret = new int[r.length];
- for(int i = 0; i < r.length; i++) {
- ret[i] = r[i];
- }
- return ret;
- }
- } catch (IllegalAccessException e2) {
- Logger.logException(e2);
- } catch (InvocationTargetException e3) {
- Logger.logException(e3);
- }
- }
- }
- return new int[0];
- }
- protected String[] getTypeNames() {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- if (getTypeNamesMethod == null) {
- Class runtimeClass = proxy.getClass();
- NoSuchMethodException e = null;
- while (runtimeClass != null) {
- try {
- getTypeNamesMethod = runtimeClass.getDeclaredMethod("getTypeNames", new Class[0]);//$NON-NLS-1$
- getTypeNamesMethod.setAccessible(true);
- break;
- } catch (NoSuchMethodException e1) {
- e = e1;
- runtimeClass = runtimeClass.getSuperclass();
- } catch (SecurityException e2) {
- runtimeClass = runtimeClass.getSuperclass();
- }
- }
- if ((getTypeNamesMethod == null) && (e != null)) {
- Logger.logException(e);
- }
- }
- if (getTypeNamesMethod != null) {
- try {
- return (String[])getTypeNamesMethod.invoke(proxy, new Object[0]);
- } catch (IllegalAccessException e2) {
- Logger.logException(e2);
- } catch (InvocationTargetException e3) {
- Logger.logException(e3);
- }
- }
- }
- return new String[0];
- }
- public boolean isSupportedType(TransferData transferData) {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- return proxy.isSupportedType(transferData);
- }
- return false;
- }
- protected void javaToNative(Object object, TransferData transferData) {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- if (javaToNativeMethod == null) {
- Class runtimeClass = proxy.getClass();
- NoSuchMethodException e = null;
- while (runtimeClass != null) {
- try {
- javaToNativeMethod = runtimeClass.getDeclaredMethod("javaToNative", new Class[]{object.getClass(), transferData.getClass()});//$NON-NLS-1$
- javaToNativeMethod.setAccessible(true);
- break;
- } catch (NoSuchMethodException e1) {
- e = e1;
- runtimeClass = runtimeClass.getSuperclass();
- } catch (SecurityException e2) {
- runtimeClass = runtimeClass.getSuperclass();
- }
- }
- if ((javaToNativeMethod == null) && (e != null)) {
- Logger.logException(e);
- }
- }
- if (javaToNativeMethod != null) {
- try {
- javaToNativeMethod.invoke(proxy, new Object[]{object, transferData});
- } catch (IllegalAccessException e2) {
- Logger.logException(e2);
- } catch (InvocationTargetException e3) {
- Logger.logException(e3);
- }
- }
- }
- }
- protected Object nativeToJava(TransferData transferData) {
- if (proxy == null) {
- proxy = newInstance();
- }
- if (proxy != null) {
- if (nativeToJavaMethod == null) {
- Class runtimeClass = proxy.getClass();
- NoSuchMethodException e = null;
- while (runtimeClass != null) {
- try {
- nativeToJavaMethod = runtimeClass.getDeclaredMethod("nativeToJava", new Class[]{transferData.getClass()});//$NON-NLS-1$
- nativeToJavaMethod.setAccessible(true);
- break;
- } catch (NoSuchMethodException e1) {
- e = e1;
- runtimeClass = runtimeClass.getSuperclass();
- } catch (SecurityException e2) {
- runtimeClass = runtimeClass.getSuperclass();
- }
- }
- if ((nativeToJavaMethod == null) && (e != null)) {
- Logger.logException(e);
- }
- }
- if (nativeToJavaMethod != null) {
- try {
- return nativeToJavaMethod.invoke(proxy, new Object[]{transferData});
- } catch (IllegalAccessException e2) {
- Logger.logException(e2);
- } catch (InvocationTargetException e3) {
- Logger.logException(e3);
- }
- }
- }
- return new Object();
- }
- Transfer getTransferClass() {
- if (proxy == null) {
- proxy = newInstance();
- }
- return proxy;
- }
-
- public String toString() {
- String clazz = element.getAttribute(classAttribute);
- return clazz != null ? clazz : super.toString();
- }
- }
- /**
- * @param element
- * @param classAttribute
- * @return Object
- * @throws CoreException
- */
- static Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
-
- Object obj = null;
-
- String singleton = element.getAttribute(ATT_SINGLETON);
- String method = element.getAttribute(ATT_METHOD);
- if (TRUE.equalsIgnoreCase(singleton) && method != null) {
- try {
- String name = element.getAttribute(ATT_CLASS);
- String pluginId = element.getDeclaringExtension().getNamespace();
- Class cls = Platform.getBundle(pluginId).loadClass(name);
- Method mtd = cls.getMethod(method, new Class[]{});
-
- obj = mtd.invoke(null, null);
- } catch (ClassNotFoundException e) {
- obj = null;
- } catch (NoSuchMethodException e) {
- obj = null;
- } catch (IllegalAccessException e) {
- obj = null;
- } catch (InvocationTargetException e) {
- obj = null;
- }
- } else {
- obj = element.createExecutableExtension(classAttribute);
- }
-
- return obj;
- }
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param element
- * @param classAttribute
- * @return Object
- * @throws CoreException
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- final Object[] result = new Object[1];
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- return createExecutableExtension(element, classAttribute);
- } catch (CoreException e) {
- handleCreateExecutableException(result, e);
- }
- } else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = createExecutableExtension(element, classAttribute);
- } catch (Exception e) {
- handleCreateExecutableException(result, e);
- }
- }
- });
- }
- return result[0];
- }
-
- /**
- * @param result
- * @param e
- */
- protected static void handleCreateExecutableException(Object[] result, Throwable e) {
- Logger.logException(e);
- result[0] = null;
-
- }
-
- protected List cache;
- protected String targetContributionTag;
-
- protected List targetIDs;
-
- /**
- * @param element
- * @return IDropAction
- */
- protected IDropAction createDropAction(IConfigurationElement element) {
- Object obj = null;
- obj = createExtension(element, ATT_CLASS);
- if (obj == null)
- return null;
- return (obj instanceof IDropAction) ? (IDropAction) DropActionProxy.newInstance(obj) : null;
- }
-
- /**
- * @param transferId
- * @return IDropAction[]
- */
- protected IDropAction[] createDropActions(String transferId) {
- if (cache == null)
- return new IDropAction[0];
-
- final int num = cache.size();
- if (num == 0)
- return new IDropAction[0];
-
- IDropAction[] as = new IDropAction[num];
- int j = 0;
- for (int p = 0; p < PRIORITIES.length; p++) {
- for (int i = 0; i < num; i++) {
- Object obj = cache.get(i);
- if (!(obj instanceof IConfigurationElement))
- continue;
-
- IConfigurationElement element = (IConfigurationElement) obj;
- if (!(TAG_DROP_ACTION.equals(element.getName())) || !(transferId.equals(element.getAttribute(ATT_TRANSFER_ID))))
- continue;
-
- if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
- IDropAction a = createDropAction(element);
- if (a != null) {
- as[j] = a;
- j++;
- }
- }
- }
- }
-
- if (num == j)
- return as;
-
- IDropAction[] as2 = new IDropAction[j];
- for (int i = 0; i < j; i++) {
- as2[i] = as[i];
- }
-
- return as2;
- }
-
- /**
- * @param element
- * @return Transfer
- */
- protected Transfer createTransfer(IConfigurationElement element) {
- Object obj = null;
- if (useProxy) {
- obj = new TransferProxyForDelayLoading(element, ATT_CLASS);
- } else {
- obj = createExtension(element, ATT_CLASS);
- }
- if (obj == null)
- return null;
- return (obj instanceof Transfer) ? (Transfer) obj : null;
- }
-
- /**
- * @return Transfer[]
- */
- protected Transfer[] createTransfers() {
- if (cache == null)
- return new Transfer[0];
-
- final int num = cache.size();
- if (num == 0)
- return new Transfer[0];
-
- Transfer[] ts = new Transfer[num];
- int j = 0;
- for (int p = 0; p < PRIORITIES.length; p++) {
- for (int i = 0; i < num; i++) {
- Object obj = cache.get(i);
- if (!(obj instanceof IConfigurationElement))
- continue;
-
- IConfigurationElement element = (IConfigurationElement) obj;
- if (!TAG_TRANSFER.equals(element.getName()))
- continue;
-
- if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
- Transfer t = createTransfer(element);
- if (t != null) {
- ts[j] = t;
- j++;
- }
- }
- }
- }
-
- if (num == j)
- return ts;
-
- Transfer[] ts2 = new Transfer[j];
- for (int i = 0; i < j; i++) {
- ts2[i] = ts[i];
- }
-
- return ts2;
- }
-
- /**
- * @param editorId
- * @return Transfer[]
- */
- public Transfer[] getDragSourceTransfers(String editorId) {
- return getDragSourceTransfers(new String[]{editorId});
- }
-
- /**
- * @param editorIds
- * @return Transfer[]
- */
- public Transfer[] getDragSourceTransfers(String[] editorIds) {
- long time0 = System.currentTimeMillis();
- readContributions(editorIds, TAG_DRAG_SOURCE_CONTRIBUTION, PL_DRAG_SOURCE_TRANSFERS);
- Transfer[] transfers = createTransfers();
- if (debugTime)
- System.out.println(getClass().getName() + "#getDragSourceTransfers(" + editorIds + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return transfers;
- }
-
- /**
- * @deprecated use getDropActions(String editorId, Transfer transfer) for the performance
- * @param editorId
- * @param className
- * @return IDropAction[]
- */
- public IDropAction[] getDropActions(String editorId, String transferClassName) {
- return getDropActions(new String[]{editorId}, transferClassName);
- }
-
- /**
- * @param editorId
- * @param class
- * @return IDropAction[]
- */
- public IDropAction[] getDropActions(String editorId, Transfer transfer) {
- return getDropActions(new String[]{editorId}, transfer);
- }
- /**
- * @deprecated use getDropActions(String[] editorIds, Transfer transfer) for the performance
- * @param editorId
- * @param className
- * @return IDropAction[]
- */
- public IDropAction[] getDropActions(String[] editorIds, String transferClassName) {
- long time0 = System.currentTimeMillis();
- readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
- String transferId = getTransferIdOfClassName(transferClassName);
- IDropAction[] actions = createDropActions(transferId);
- if (debugTime)
- System.out.println(getClass().getName() + "#getDropActions(" + editorIds + "): " + actions.length + " drop actions created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return actions;
- }
-
- /**
- * @param editorId
- * @param class
- * @return IDropAction[]
- */
- public IDropAction[] getDropActions(String[] editorIds, Transfer transfer) {
- String transferClassName;
- if (transfer instanceof TransferProxyForDelayLoading) {
- transferClassName = ((TransferProxyForDelayLoading)transfer).getTransferClass().getClass().getName();
- } else {
- transferClassName = transfer.getClass().getName();
- }
- return getDropActions(editorIds, transferClassName);
- }
- /**
- * @param editorId
- * @return Transfer[]
- */
- public Transfer[] getDropTargetTransfers(String editorId) {
- return getDropTargetTransfers(new String[]{editorId});
- }
-
- /**
- * @param editorIds
- * @return Transfer[]
- */
- public Transfer[] getDropTargetTransfers(String[] editorIds) {
- long time0 = System.currentTimeMillis();
- readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
- Transfer[] transfers = createTransfers();
- if (debugTime) {
- String idlist = ""; //$NON-NLS-1$
- if (editorIds.length > 0) {
- for (int i = 0; i < editorIds.length; i++) {
- idlist += editorIds[i];
- if (i < editorIds.length - 1)
- idlist += ","; //$NON-NLS-1$
- }
- }
- System.out.println(getClass().getName() + "#getDropTargetTransfers(" + idlist + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return transfers;
- }
-
- /**
- * Returns the name of the part ID attribute that is expected in the
- * target extension.
- *
- * @param element
- * @return String
- */
- protected String getTargetID(IConfigurationElement element) {
- String value = element.getAttribute(ATT_TARGET_ID);
- return value != null ? value : "???"; //$NON-NLS-1$
- }
-
- /**
- * @param className
- * @return String
- */
- private String getTransferIdOfClassName(String className) {
- String id = ""; //$NON-NLS-1$
- final int num = cache.size();
- if (className == null || cache == null || num == 0)
- return id;
-
- for (int i = 0; i < num; i++) {
- Object obj = cache.get(i);
- if (obj instanceof IConfigurationElement) {
- IConfigurationElement element = (IConfigurationElement) obj;
- if (className.equals(element.getAttribute(ATT_CLASS))) {
- id = element.getAttribute(ATT_ID);
- break;
- }
- }
- }
-
- return (id.length() != 0 ? id : className);
- }
-
- /**
- * Reads the contributions from the registry for the provided workbench
- * part and the provided extension point ID.
- *
- * @param id
- * @param tag
- * @param extensionPoint
- */
- protected void readContributions(String[] ids, String tag, String extensionPoint) {
- cache = null;
- targetIDs = Arrays.asList(ids);
- targetContributionTag = tag;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- readRegistry(registry, PLUGIN_ID, extensionPoint);
- }
-
- protected boolean readElement(IConfigurationElement element) {
- String tag = element.getName();
- if (tag.equals(targetContributionTag)) {
- String id = getTargetID(element);
- if (id == null || !targetIDs.contains(id)) {
- // This is not of interest to us - don't go deeper
- return true;
- }
- } else if (tag.equals(TAG_TRANSFER)) {
- if (cache == null)
- cache = new ArrayList();
- cache.add(element);
- return true; // just cache the element - don't go into it
- } else if (tag.equals(TAG_DROP_ACTION)) {
- if (cache == null)
- cache = new ArrayList();
- //cache.add(createActionDescriptor(element));
- cache.add(element);
- return true; // just cache the action - don't go into
- } else {
- return false;
- }
-
- readElementChildren(element);
- return true;
- }
- /**
- * @deprecated - use TransferBuilder(boolean useProxy) for the performance
- */
- public TransferBuilder() {
- this(false);
- }
-
- public TransferBuilder(boolean useProxy) {
- super();
- this.useProxy = useProxy;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java
deleted file mode 100644
index 9bd2f8982f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-/**
- * Message dialog informing user that an editor was open on unsupported
- * content type
- */
-public class UnknownContentTypeDialog extends MessageDialogWithToggle {
-
- public UnknownContentTypeDialog(Shell parent, IPreferenceStore store, String key) {
- // set message to null in super so that message does not appear twice
- super(parent, SSEUIMessages.UnknownContentTypeDialog_0, null, null, INFORMATION, new String[]{IDialogConstants.OK_LABEL}, 0, SSEUIMessages.UnknownContentTypeDialog_1, false);
- setPrefStore(store);
- setPrefKey(key);
- }
-
- protected void buttonPressed(int buttonId) {
- super.buttonPressed(buttonId);
-
- // overwritten so that value stored is boolean, not string
- if (buttonId != IDialogConstants.CANCEL_ID && getToggleState() && getPrefStore() != null && getPrefKey() != null) {
- switch (buttonId) {
- case IDialogConstants.YES_ID :
- case IDialogConstants.YES_TO_ALL_ID :
- case IDialogConstants.PROCEED_ID :
- case IDialogConstants.OK_ID :
- getPrefStore().setValue(getPrefKey(), false);
- break;
- case IDialogConstants.NO_ID :
- case IDialogConstants.NO_TO_ALL_ID :
- getPrefStore().setValue(getPrefKey(), true);
- break;
- }
- }
-
- }
-
- protected Control createMessageArea(Composite composite) {
- super.createMessageArea(composite);
- Link messageLink = new Link(composite, SWT.NONE);
- messageLink.setText(SSEUIMessages.UnknownContentTypeDialog_2);
- messageLink.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
- return composite;
- }
-
- private void linkClicked() {
- String pageId = "org.eclipse.ui.preferencePages.ContentTypes"; //$NON-NLS-1$
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
- dialog.open();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
deleted file mode 100644
index 5002931362..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver/STAR - [212330] can't contribute to the XML or any SSE based menu
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.actions;
-
-//import java.util.ResourceBundle;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.editors.text.TextEditorActionContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.GotoAnnotationAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.ui.OffsetStatusLineContributionItem;
-
-/**
- * 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 ActionContributor extends TextEditorActionContributor implements ISourceViewerActionBarContributor, IExtendedContributor {
-
- public static final boolean _showDebugStatus = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields")) || Platform.inDebugMode() || Platform.inDevelopmentMode(); //$NON-NLS-1$ //$NON-NLS-2$
-
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$
-
- protected IExtendedContributor extendedContributor;
- protected RetargetTextEditorAction fAddBlockComment = null;
-
- protected Separator fCommandsSeparator = null;
-
- private OffsetStatusLineContributionItem fDebugStatusOffset = null;
- protected MenuManager fExpandSelectionToMenu = null;
- protected GroupMarker fMenuAdditionsGroupMarker = null;
- protected GotoAnnotationAction fNextAnnotation = null;
-
- protected GotoAnnotationAction fPreviousAnnotation = null;
- protected RetargetTextEditorAction fRemoveBlockComment = null;
- protected RetargetTextEditorAction fShiftLeft = null;
- protected RetargetTextEditorAction fShiftRight = null;
- protected RetargetTextEditorAction fStructureSelectEnclosingAction = null;
- protected RetargetTextEditorAction fStructureSelectHistoryAction = null;
- protected RetargetTextEditorAction fStructureSelectNextAction = null;
- protected RetargetTextEditorAction fStructureSelectPreviousAction = null;
-
- protected RetargetTextEditorAction fToggleComment = null;
- protected RetargetTextEditorAction fToggleInsertModeAction;
- protected GroupMarker fToolbarAdditionsGroupMarker = null;
- protected Separator fToolbarSeparator = null;
-
- protected RetargetTextEditorAction fGotoMatchingBracketAction = null;
-
- public ActionContributor() {
- super();
-
- ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle();
-
- fCommandsSeparator = new Separator();
-
- // edit commands
- fStructureSelectEnclosingAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_ENCLOSING + StructuredTextEditorActionConstants.UNDERSCORE);
- fStructureSelectEnclosingAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_ENCLOSING);
-
- fStructureSelectNextAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_NEXT + StructuredTextEditorActionConstants.UNDERSCORE);
- fStructureSelectNextAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_NEXT);
-
- fStructureSelectPreviousAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_PREVIOUS + StructuredTextEditorActionConstants.UNDERSCORE);
- fStructureSelectPreviousAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_PREVIOUS);
-
- fStructureSelectHistoryAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY + StructuredTextEditorActionConstants.UNDERSCORE);
- fStructureSelectHistoryAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_HISTORY);
-
- fExpandSelectionToMenu = new MenuManager(SSEUIMessages.ExpandSelectionToMenu_label); //$NON-NLS-1$
- fExpandSelectionToMenu.add(fStructureSelectEnclosingAction);
- fExpandSelectionToMenu.add(fStructureSelectNextAction);
- fExpandSelectionToMenu.add(fStructureSelectPreviousAction);
- fExpandSelectionToMenu.add(fStructureSelectHistoryAction);
-
- // source commands
- fShiftRight = new RetargetTextEditorAction(resourceBundle, ITextEditorActionConstants.SHIFT_RIGHT + StructuredTextEditorActionConstants.UNDERSCORE);
- fShiftRight.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_RIGHT);
-
- fShiftLeft = new RetargetTextEditorAction(resourceBundle, ITextEditorActionConstants.SHIFT_LEFT + StructuredTextEditorActionConstants.UNDERSCORE);
- fShiftLeft.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_LEFT);
-
- fToggleComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT + StructuredTextEditorActionConstants.UNDERSCORE);
- fToggleComment.setActionDefinitionId(ActionDefinitionIds.TOGGLE_COMMENT);
-
- fAddBlockComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT + StructuredTextEditorActionConstants.UNDERSCORE);
- fAddBlockComment.setActionDefinitionId(ActionDefinitionIds.ADD_BLOCK_COMMENT);
-
- fRemoveBlockComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT + StructuredTextEditorActionConstants.UNDERSCORE);
- fRemoveBlockComment.setActionDefinitionId(ActionDefinitionIds.REMOVE_BLOCK_COMMENT);
-
- // goto prev/next error
- // CMVC 249017 for JavaEditor consistancy
- fPreviousAnnotation = new GotoAnnotationAction("Previous_annotation", false); //$NON-NLS-1$
- fPreviousAnnotation.setActionDefinitionId("org.eclipse.ui.navigate.previous"); //$NON-NLS-1$
-
- fNextAnnotation = new GotoAnnotationAction("Next_annotation", true); //$NON-NLS-1$
- fNextAnnotation.setActionDefinitionId("org.eclipse.ui.navigate.next"); //$NON-NLS-1$
-
- fGotoMatchingBracketAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_GOTO_MATCHING_BRACKET + StructuredTextEditorActionConstants.UNDERSCORE);
- fGotoMatchingBracketAction.setActionDefinitionId(ActionDefinitionIds.GOTO_MATCHING_BRACKET);
-
- // Read action extensions.
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- extendedContributor = builder.readActionExtensions(getExtensionIDs());
-
- fMenuAdditionsGroupMarker = new GroupMarker(StructuredTextEditorActionConstants.GROUP_NAME_MENU_ADDITIONS);
- fToolbarSeparator = new Separator();
- fToolbarAdditionsGroupMarker = new GroupMarker(StructuredTextEditorActionConstants.GROUP_NAME_TOOLBAR_ADDITIONS);
-
- fToggleInsertModeAction = new RetargetTextEditorAction(resourceBundle, "Editor.ToggleInsertMode.", IAction.AS_CHECK_BOX); //$NON-NLS-1$
- fToggleInsertModeAction.setActionDefinitionId(ITextEditorActionDefinitionIds.TOGGLE_INSERT_MODE);
-
- if (_showDebugStatus) {
- fDebugStatusOffset = new OffsetStatusLineContributionItem(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET, true, 20);
- }
- }
-
- protected void addToMenu(IMenuManager menu) {
- // edit commands
-/* IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(fCommandsSeparator);
- editMenu.add(fToggleInsertModeAction);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fExpandSelectionToMenu);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fMenuAdditionsGroupMarker);
- }
-
- // source commands
- String sourceMenuLabel = SSEUIMessages.SourceMenu_label; //$NON-NLS-1$
- String sourceMenuId = "sourceMenuId"; // This is just a menu id. No //$NON-NLS-1$
- // need to translate.
- // //$NON-NLS-1$
- IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
- if (sourceMenu != null) {
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fToggleComment);
- sourceMenu.add(fAddBlockComment);
- sourceMenu.add(fRemoveBlockComment);
- sourceMenu.add(fShiftRight);
- sourceMenu.add(fShiftLeft);
- }
-
- IMenuManager gotoMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
- if (gotoMenu != null) {
- gotoMenu.add(fGotoMatchingBracketAction);
- }
-*/
- }
-
- protected void addToPopupMenu(IMenuManager menu) {
- // add nothing
- }
-
- protected void addToStatusLine(IStatusLineManager manager) {
- if (_showDebugStatus) {
- manager.add(fDebugStatusOffset);
- }
- }
-
- protected void addToToolBar(IToolBarManager toolBarManager) {
-/* toolBarManager.add(fToolbarSeparator);
- toolBarManager.add(fToolbarAdditionsGroupMarker);
-*/ }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public void contributeToMenu(IMenuManager menu) {
- super.contributeToMenu(menu);
-
- IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, fToggleInsertModeAction);
- }
-/*
- addToMenu(menu);
-*/
- if (extendedContributor != null) {
- extendedContributor.contributeToMenu(menu);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.extension.IPopupMenuContributor#contributeToPopupMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void contributeToPopupMenu(IMenuManager menu) {
-/*
- addToPopupMenu(menu);
-*/
- if (extendedContributor != null) {
- extendedContributor.contributeToPopupMenu(menu);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager)
- */
- public void contributeToStatusLine(IStatusLineManager manager) {
- super.contributeToStatusLine(manager);
-
- addToStatusLine(manager);
-
- if (extendedContributor != null) {
- extendedContributor.contributeToStatusLine(manager);
- }
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- super.contributeToToolBar(toolBarManager);
-
-/* addToToolBar(toolBarManager);
-*/
- if (extendedContributor != null) {
- extendedContributor.contributeToToolBar(toolBarManager);
- }
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#dispose()
- */
- public void dispose() {
- // need to call setActiveEditor before super.dispose because in both
- // setActiveEditor & super.setActiveEditor if getEditorPart ==
- // activeEditor,
- // the method is just returned. so to get both methods to run,
- // setActiveEditor
- // needs to be called so that it correctly calls super.setActiveEditor
- setActiveEditor(null);
-
- super.dispose();
-
- if (extendedContributor != null)
- extendedContributor.dispose();
- }
-
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
- /**
- * @param editor
- * @return
- */
- protected ITextEditor getTextEditor(IEditorPart editor) {
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- if (textEditor == null && editor != null)
- textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- return textEditor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IEditorActionBarContributor#init(org.eclipse.ui.IActionBars,
- * org.eclipse.ui.IWorkbenchPage)
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- }
-
- /**
- * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart activeEditor) {
- if (getActiveEditorPart() == activeEditor)
- return;
- super.setActiveEditor(activeEditor);
-
- ITextEditor textEditor = getTextEditor(activeEditor);
-
-/* IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation);
- actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation);
- actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAnnotation);
- actionBars.setGlobalActionHandler(ActionFactory.NEXT.getId(), fNextAnnotation);
-
- if (textEditor != null) {
- actionBars.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(), getAction(textEditor, IDEActionFactory.ADD_TASK.getId()));
- actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(textEditor, IDEActionFactory.BOOKMARK.getId()));
- }
- }
-
- fStructureSelectEnclosingAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_ENCLOSING));
- fStructureSelectNextAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_NEXT));
- fStructureSelectPreviousAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_PREVIOUS));
- fStructureSelectHistoryAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY));
-
- fShiftRight.setAction(getAction(textEditor, ITextEditorActionConstants.SHIFT_RIGHT));
- fShiftLeft.setAction(getAction(textEditor, ITextEditorActionConstants.SHIFT_LEFT));
-
- fToggleComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT));
- fAddBlockComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT));
- fRemoveBlockComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT));
-
- // go to prev/next error
- // CMVC 249017 for JavaEditor consistancy
- fPreviousAnnotation.setEditor(textEditor);
- fNextAnnotation.setEditor(textEditor);
- fGotoMatchingBracketAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_GOTO_MATCHING_BRACKET));
-*/
- fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
-
- if (extendedContributor != null) {
- extendedContributor.setActiveEditor(activeEditor);
- }
-
- if (_showDebugStatus && textEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) textEditor).setStatusField(fDebugStatusOffset, StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET);
- fDebugStatusOffset.setActiveEditor(textEditor);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
- */
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
- fToggleInsertModeAction.setEnabled(enabled);
-/* fShiftRight.setEnabled(enabled);
- fShiftLeft.setEnabled(enabled);
- fNextAnnotation.setEnabled(enabled);
- fPreviousAnnotation.setEnabled(enabled);
-*/
- /*
- * fComment.setEnabled(enabled); fUncomment.setEnabled(enabled);
- */
-/*
- fToggleComment.setEnabled(enabled);
- fAddBlockComment.setEnabled(enabled);
- fRemoveBlockComment.setEnabled(enabled);
-*/
- // convert line delimiters are not source viewer-specific
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.extension.IExtendedContributor#updateToolbarActions()
- */
- public void updateToolbarActions() {
- if (extendedContributor != null) {
- extendedContributor.updateToolbarActions();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
deleted file mode 100644
index ae26969be3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
+++ /dev/null
@@ -1,58 +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.wst.sse.ui.internal.actions;
-
-
-
-/*******************************************************************************
- * 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
- *
- *******************************************************************************/
-
-/**
- * Defines the definitions ids for editor actions.
- */
-public interface ActionDefinitionIds {
- // TODO: Can these be better defined with a "plugin prefix" to be more
- // portable?
- public final static String ADD_BLOCK_COMMENT = "org.eclipse.wst.sse.ui.add.block.comment";//$NON-NLS-1$
-
- public final static String CLEANUP_DOCUMENT = "org.eclipse.wst.sse.ui.cleanup.document";//$NON-NLS-1$
- public final static String COMMENT = "org.eclipse.wst.sse.ui.comment";//$NON-NLS-1$
- public final static String EDIT_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.edit";//$NON-NLS-1$
- public final static String FIND_OCCURRENCES = "org.eclipse.wst.sse.ui.search.find.occurrences";//$NON-NLS-1$
- public final static String FORMAT_ACTIVE_ELEMENTS = "org.eclipse.wst.sse.ui.format.active.elements";//$NON-NLS-1$
- public final static String FORMAT_DOCUMENT = "org.eclipse.wst.sse.ui.format.document";//$NON-NLS-1$
- public final static String MANAGE_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.manage";//$NON-NLS-1$
- public final static String OPEN_FILE = "org.eclipse.wst.sse.ui.open.file.from.source";//$NON-NLS-1$
- public final static String REMOVE_BLOCK_COMMENT = "org.eclipse.wst.sse.ui.remove.block.comment";//$NON-NLS-1$
- public final static String STRUCTURE_SELECT_ENCLOSING = "org.eclipse.wst.sse.ui.structure.select.enclosing";//$NON-NLS-1$
- public final static String STRUCTURE_SELECT_HISTORY = "org.eclipse.wst.sse.ui.structure.select.last";//$NON-NLS-1$
- public final static String STRUCTURE_SELECT_NEXT = "org.eclipse.wst.sse.ui.structure.select.next";//$NON-NLS-1$
- public final static String STRUCTURE_SELECT_PREVIOUS = "org.eclipse.wst.sse.ui.structure.select.previous";//$NON-NLS-1$
- public final static String TOGGLE_COMMENT = "org.eclipse.wst.sse.ui.toggle.comment";//$NON-NLS-1$
- public final static String TOGGLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.toggle";//$NON-NLS-1$
- public final static String UNCOMMENT = "org.eclipse.wst.sse.ui.uncomment";//$NON-NLS-1$
- public final static String SHOW_OUTLINE = "org.eclipse.wst.sse.ui.quick_outline";//$NON-NLS-1$
-
- // registered command IDs, so we pick up the declared key bindings
- public static final String GOTO_MATCHING_BRACKET= "org.eclipse.wst.sse.ui.goto.matching.bracket"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java
deleted file mode 100644
index 54586eb3ad..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java
+++ /dev/null
@@ -1,286 +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.sse.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @deprecated actions are not properly activated with this handler so do not
- * use
- */
-public class ActiveEditorActionHandler implements IAction {
-
- private String fActionId;
- private IWorkbenchSite fSite;
- private IAction fTargetAction;
-
- public ActiveEditorActionHandler(IWorkbenchSite site, String id) {
- super();
- fActionId = id;
- fSite = site;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getAccelerator()
- */
- public int getAccelerator() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getAccelerator() : 0);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getActionDefinitionId()
- */
- public String getActionDefinitionId() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getActionDefinitionId() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getDescription()
- */
- public String getDescription() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getDescription() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getDisabledImageDescriptor() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getHelpListener()
- */
- public HelpListener getHelpListener() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getHelpListener() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getHoverImageDescriptor() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getId()
- */
- public String getId() {
- return getClass().getName() + hashCode();
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getImageDescriptor() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getMenuCreator()
- */
- public IMenuCreator getMenuCreator() {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getStyle()
- */
- public int getStyle() {
- return IAction.AS_PUSH_BUTTON;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getText()
- */
- public String getText() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getText() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#getToolTipText()
- */
- public String getToolTipText() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.getToolTipText() : null);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#isChecked()
- */
- public boolean isChecked() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.isChecked() : true);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.isEnabled() : false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isHandled()
- */
- public boolean isHandled() {
- updateTargetAction();
- return (fTargetAction != null ? fTargetAction.isHandled() : false);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- updateTargetAction();
- if (fTargetAction != null)
- fTargetAction.run();
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- updateTargetAction();
- if (fTargetAction != null)
- fTargetAction.runWithEvent(event);
- }
-
- /**
- * NOT SUPPORTED
- *
- * @see org.eclipse.jface.action.IAction#setAccelerator(int)
- */
- public void setAccelerator(int keycode) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setActionDefinitionId(java.lang.String)
- */
- public void setActionDefinitionId(String id) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setChecked(boolean)
- */
- public void setChecked(boolean checked) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setDescription(java.lang.String)
- */
- public void setDescription(String text) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setDisabledImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setDisabledImageDescriptor(ImageDescriptor newImage) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setHelpListener(org.eclipse.swt.events.HelpListener)
- */
- public void setHelpListener(HelpListener listener) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setHoverImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setHoverImageDescriptor(ImageDescriptor newImage) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setId(java.lang.String)
- */
- public void setId(String id) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setImageDescriptor(ImageDescriptor newImage) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setMenuCreator(org.eclipse.jface.action.IMenuCreator)
- */
- public void setMenuCreator(IMenuCreator creator) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setText(java.lang.String)
- */
- public void setText(String text) {
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#setToolTipText(java.lang.String)
- */
- public void setToolTipText(String text) {
- }
-
- private void updateTargetAction() {
- if (fSite != null && fSite.getWorkbenchWindow() != null && fSite.getWorkbenchWindow().getActivePage() != null) {
- IEditorPart part = fSite.getWorkbenchWindow().getActivePage().getActiveEditor();
- ITextEditor editor = null;
- if (part instanceof ITextEditor)
- editor = (ITextEditor) part;
- else
- editor = (ITextEditor) (part != null ? part.getAdapter(ITextEditor.class) : null);
- if (editor != null) {
- fTargetAction = editor.getAction(fActionId);
- } else {
- fTargetAction = null;
- }
- } else
- fTargetAction = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java
deleted file mode 100644
index 804df2cef5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java
+++ /dev/null
@@ -1,85 +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.sse.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public abstract class CleanupAction extends TextEditorAction {
- protected Dialog fCleanupDialog;
-
- public CleanupAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- protected abstract Dialog getCleanupDialog(Shell shell);
-
- protected abstract IStructuredCleanupProcessor getCleanupProcessor();
-
- public void run() {
- if (getTextEditor() instanceof StructuredTextEditor) {
- final StructuredTextEditor editor = (StructuredTextEditor) getTextEditor();
- Dialog cleanupDialog = getCleanupDialog(editor.getSite().getShell());
- if (cleanupDialog != null) {
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null)
- cleanupProcessor.cleanupModel(editor.getModel());
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = editor.getModel();
- if (model != null) {
- try {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(editor.getTextViewer().getControl().getDisplay(), runnable);
- } finally {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- }
- }
- }
-
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java
deleted file mode 100644
index ed11b90c5d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java
+++ /dev/null
@@ -1,248 +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.wst.sse.ui.internal.actions;
-
-import java.io.IOException;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.FormatProcessorsExtensionReader;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-public class FormatActionDelegate extends ResourceActionDelegate {
-
- class FormatJob extends Job {
-
- public FormatJob(String name) {
- super(name);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
-
- Object[] elements = fSelection.toArray();
- monitor.beginTask("", elements.length); //$NON-NLS-1$
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IResource) {
- process(new SubProgressMonitor(monitor, 1), (IResource) elements[i]);
- }
- else {
- monitor.worked(1);
- }
- }
- monitor.done();
-
- if (fErrorStatus.getChildren().length > 0) {
- status = fErrorStatus;
- fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
- }
-
- return status;
- }
-
- }
-
- private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
-
- protected void format(IProgressMonitor monitor, IFile file) {
- if(monitor == null || monitor.isCanceled())
- return;
-
- try {
- monitor.beginTask("", 100);
- IContentDescription contentDescription = file.getContentDescription();
- monitor.worked(5);
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
- if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString().substring(1)}); monitor.subTask(message);
- formatProcessor.setProgressMonitor(monitor);
- formatProcessor.formatFile(file);
- }
- }
- monitor.worked(95);
- monitor.done();
- } catch (MalformedInputExceptionWithDetail e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_5, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- } catch (IOException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- }
-
- private Display getDisplay() {
-
- // Note: the workbench should always have a display
- // (unless running headless), whereas Display.getCurrent()
- // only returns the display if the currently executing thread
- // has one.
- if (PlatformUI.isWorkbenchRunning())
- return PlatformUI.getWorkbench().getDisplay();
- else
- return null;
- }
-
- protected void format(final IProgressMonitor monitor, IResource resource) {
- if (resource instanceof IFile) {
- final IFile file = (IFile) resource;
-
- // BUG 178598 - If the resource is shared, and it's possible to
- // get the workbench Display, the UI thread is asked to execute the
- // format of the file when it can
- try {
- ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- ITextFileBuffer buffer = null;
-
- try {
- if(manager != null) {
- manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
- buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
- }
-
- if(buffer != null && buffer.isShared()) {
- Display display = getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- format(monitor, file);
- }
- });
- }
- else
- format(monitor, file);
- }
- finally {
- if(manager != null)
- manager.disconnect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
- }
- }
- catch(CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- finally {
- if(monitor != null)
- monitor.done();
- }
-
- } else if (resource instanceof IContainer) {
- IContainer container = (IContainer) resource;
-
- try {
- IResource[] members = container.members();
- monitor.beginTask("", members.length);
- for (int i = 0; i < members.length; i++) {
- if (monitor != null && !monitor.isCanceled())
- format(new SubProgressMonitor(monitor, 1), members[i]);
- }
- monitor.done();
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- }
- }
-
- protected IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
- return FormatProcessorsExtensionReader.getInstance().getFormatProcessor(contentTypeId);
- }
-
- protected Job getJob() {
- return new FormatJob(SSEUIMessages.FormatActionDelegate_jobName); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.edit.util.ResourceActionDelegate#process(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.resources.IResource)
- */
- protected void process(IProgressMonitor monitor, IResource resource) {
- monitor.beginTask("", 100);
- format(new SubProgressMonitor(monitor, 98), resource);
-
- try {
- resource.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 2));
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- monitor.done();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.actions.ResourceActionDelegate#processorAvailable(org.eclipse.core.resources.IResource)
- */
- protected boolean processorAvailable(IResource resource) {
- boolean result = false;
- if (resource.isAccessible()) {
- try {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
-
- IStructuredFormatProcessor formatProcessor = null;
- IContentDescription contentDescription = file.getContentDescription();
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- formatProcessor = getFormatProcessor(contentType.getId());
- }
- if (formatProcessor != null)
- result = true;
- }
- else if (resource instanceof IContainer) {
- IContainer container = (IContainer) resource;
- IResource[] members;
- members = container.members();
- for (int i = 0; i < members.length; i++) {
- boolean available = processorAvailable(members[i]);
-
- if (available) {
- result = true;
- break;
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java
deleted file mode 100644
index 290792808e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java
+++ /dev/null
@@ -1,104 +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.sse.ui.internal.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-
-public class ResourceActionDelegate implements IActionDelegate {
- protected IStructuredSelection fSelection;
-
- private IWorkbenchSiteProgressService getActiveProgressService() {
- IWorkbenchSiteProgressService service = null;
- if (PlatformUI.isWorkbenchRunning()) {
- IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null) {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if (activePage != null) {
- IWorkbenchPart activePart = activePage.getActivePart();
- if (activePart != null) {
- service = (IWorkbenchSiteProgressService) activePart.getSite().getAdapter(IWorkbenchSiteProgressService.class);
- }
- }
- }
- }
- return service;
- }
-
- protected Job getJob() {
- // ResourceActionDelegate does not create background job
- // subclass creates the background job for the action
- return null;
- }
-
- protected boolean processorAvailable(IResource resource) {
- // ResourceActionDelegate returns false by default
- // subclass returns true if processor is available; false otherwise
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fSelection != null && !fSelection.isEmpty()) {
- Job job = getJob();
- if (job != null) {
- IWorkbenchSiteProgressService progressService = getActiveProgressService();
- if (progressService != null) {
- progressService.schedule(job);
- }
- else {
- job.schedule();
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- fSelection = (IStructuredSelection) selection;
- boolean available = false;
-
- Object[] elements = fSelection.toArray();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IResource) {
- available = processorAvailable((IResource) elements[i]);
-
- if (available)
- break;
- }
- }
-
- action.setEnabled(available);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
deleted file mode 100644
index 286d8cc604..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
+++ /dev/null
@@ -1,48 +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.wst.sse.ui.internal.actions;
-
-
-
-public interface StructuredTextEditorActionConstants {
- public final static String ACTION_NAME_ADD_BLOCK_COMMENT = "AddBlockComment";//$NON-NLS-1$
- public final static String ACTION_NAME_CLEANUP_DOCUMENT = "CleanupDocument";//$NON-NLS-1$
- public final static String ACTION_NAME_COMMENT = "Comment";//$NON-NLS-1$
- public final static String ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION = "ContentAssistContextInformation";//$NON-NLS-1$
- public final static String ACTION_NAME_CONTENTASSIST_PROPOSALS = "ContentAssistProposals";//$NON-NLS-1$
- public final static String ACTION_NAME_FIND_OCCURRENCES = "FindOccurrences"; //$NON-NLS-1$
- public final static String ACTION_NAME_FORMAT_ACTIVE_ELEMENTS = "FormatActiveElements";//$NON-NLS-1$
- public final static String ACTION_NAME_FORMAT_DOCUMENT = "FormatDocument";//$NON-NLS-1$
- public final static String ACTION_NAME_MANAGE_BREAKPOINTS = "ManageBreakpoints";//$NON-NLS-1$
- public final static String ACTION_NAME_OPEN_FILE = "OpenFileFromSource";//$NON-NLS-1$
- public final static String ACTION_NAME_REMOVE_BLOCK_COMMENT = "RemoveBlockComment";//$NON-NLS-1$
- public final static String ACTION_NAME_STRUCTURE_SELECT_ENCLOSING = "StructureSelectEnclosing";//$NON-NLS-1$
- public final static String ACTION_NAME_STRUCTURE_SELECT_HISTORY = "StructureSelectHistory";//$NON-NLS-1$
- public final static String ACTION_NAME_STRUCTURE_SELECT_NEXT = "StructureSelectNext";//$NON-NLS-1$
- public final static String ACTION_NAME_STRUCTURE_SELECT_PREVIOUS = "StructureSelectPrevious";//$NON-NLS-1$
- public final static String ACTION_NAME_TOGGLE_COMMENT = "ToggleComment";//$NON-NLS-1$
- public final static String ACTION_NAME_UNCOMMENT = "Uncomment";//$NON-NLS-1$
- public final static String ACTION_NAME_GOTO_MATCHING_BRACKET = "GotoMatchingBracket";//$NON-NLS-1$
- public final static String ACTION_NAME_SHOW_OUTLINE = "ShowQuickOutline"; //$NON-NLS-1$
-
- /**
- * @deprecated use UNDERSCORE instead
- */
- public final static String DOT = ".";//$NON-NLS-1$
- public final static String UNDERSCORE = "_"; //$NON-NLS-1$
-
- public final static String GROUP_NAME_MENU_ADDITIONS = "MenuAdditions";//$NON-NLS-1$
- public final static String GROUP_NAME_TOOLBAR_ADDITIONS = "ToolbarAdditions";//$NON-NLS-1$
-
- public final static String STATUS_CATEGORY_OFFSET = "Offset";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/BlockCommentingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/BlockCommentingStrategy.java
deleted file mode 100644
index 5dade3e41b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/BlockCommentingStrategy.java
+++ /dev/null
@@ -1,138 +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.wst.sse.ui.internal.comment;
-
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-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.ui.internal.Logger;
-
-/**
- * <p>Represents a Block Comment commenting strategy</p>
- */
-public class BlockCommentingStrategy extends CommentingStrategy {
- /** the prefix of the block comment associated with this strategy */
- private String fPrefix;
-
- /** the suffix of the block comment associated with this strategy */
- private String fSuffix;
-
- /**
- * @param prefix the prefix of the block comment associated with this strategy
- * @param suffix the suffix of the block comment associated with this strategy
- */
- public BlockCommentingStrategy(String prefix, String suffix) {
- super();
- this.fPrefix = prefix;
- this.fSuffix = suffix;
- }
-
- /**
- * <p>When applying a block comment it also removes any block comments associated
- * with this strategy that would now be enclosed by the new block comment</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#apply(
- * org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)
- */
- public void apply(IStructuredDocument document, int offset, int length) throws BadLocationException {
- int commentPrefixOffset = offset;
- int commentSuffixOffset = commentPrefixOffset + length;
-
- try {
- document.replace(commentSuffixOffset, 0, " " + this.fSuffix); //$NON-NLS-1$
- this.remove(document, commentPrefixOffset + this.fPrefix.length(), length, false);
- document.replace(commentPrefixOffset, 0, this.fPrefix + " "); //$NON-NLS-1$
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#remove(
- * org.eclipse.jface.text.IDocument, int, int)
- */
- public void remove(IStructuredDocument document, int offset, int length, boolean removeEnclosing) throws BadLocationException {
- IRegion region = new Region(offset, length);
- ITypedRegion[] typedRegions = document.computePartitioning(region.getOffset(), region.getLength());
- List commentRegions = this.getAssociatedCommentedRegions(typedRegions);
-
- //remove in reverse order as to not effect offset of other regions
- for(int i = commentRegions.size()-1; i >= 0; --i) {
- try {
- //get the comment region
- ITypedRegion typedRegion = (ITypedRegion)commentRegions.get(i);
- IRegion commentRegion = new Region(typedRegion.getOffset(), typedRegion.getLength());
-
- /* because of the nature of structured regions the comment region could actually be a
- * sub region that needs to be drilled down too
- */
- if(!this.alreadyCommenting(document, commentRegion)) {
- IStructuredDocumentRegion structuredRegion =
- document.getRegionAtCharacterOffset(commentRegion.getOffset());
-
- commentRegion = new Region(structuredRegion.getStartOffset(), structuredRegion.getLength());
-
- if(!this.alreadyCommenting(document, commentRegion)) {
- ITextRegion enclosedRegion = structuredRegion.getRegionAtCharacterOffset(typedRegion.getOffset());
- int enclosedOffset = structuredRegion.getStartOffset(enclosedRegion);
- commentRegion = new Region(enclosedOffset, structuredRegion.getTextEndOffset(enclosedRegion)-enclosedOffset);
- }
- }
-
- //at this point should have found the comment region, if not there is an issue
- if(this.alreadyCommenting(document, commentRegion)) {
- String regionContent = document.get(commentRegion.getOffset(), commentRegion.getLength());
-
- //if found the comment prefix and suffix then uncomment, otherwise log error
- int commentPrefixOffset = commentRegion.getOffset() + regionContent.indexOf(this.fPrefix);
- int commentSuffixOffset = commentRegion.getOffset();
- commentSuffixOffset += regionContent.lastIndexOf(this.fSuffix);
-
- //remove comment block depending on if its an enclosing comment block and weather that is allowed
- if(removeEnclosing || (commentPrefixOffset >= offset && commentSuffixOffset <= offset+length)) {
- uncomment(document, commentPrefixOffset, this.fPrefix, commentSuffixOffset, this.fSuffix);
- }
- } else {
- Logger.log(Logger.ERROR,
- "BlockCommentingStrategy#remove could not find the commenting region to remove"); //$NON-NLS-1$
- }
- } catch(BadLocationException e) {
- Logger.logException("This should only ever happen if something has gone wrong with the partitioning", e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * <p>A region is already commented by this strategy if it starts with the strategy's associated
- * prefix and ends with its associated suffix, ignoring any trailing or leading whitespace</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#alreadyCommenting(
- * org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IRegion)
- */
- public boolean alreadyCommenting(IStructuredDocument document, IRegion region) throws BadLocationException {
- String regionContent = document.get(region.getOffset(), region.getLength()).trim();
- return regionContent.startsWith(this.fPrefix) && regionContent.endsWith(this.fSuffix);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#clone()
- */
- public Object clone() {
- return new BlockCommentingStrategy(this.fPrefix, this.fSuffix);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategy.java
deleted file mode 100644
index c46248c4fd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategy.java
+++ /dev/null
@@ -1,355 +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.wst.sse.ui.internal.comment;
-
-import java.util.ArrayList;
-import java.util.Collections;
-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.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * <p>Defines a commenting strategy defined by the <code>org.eclipse.wst.sse.ui.commentinStrategy</code>
- * extension point and tracked by the {@link CommentingStrategyRegistry}. Though it is important to
- * note it is not a one to one relationship of {@link CommentingStrategy}s to extensions, there is actually
- * one {@link CommentingStrategy} for each content type defined for each
- * <code>org.eclipse.wst.sse.ui.commentinStrategy</code> extension.<p>
- *
- * <p>The expected use case is that a {@link CommentingStrategy} is created off the basic configuration
- * of the extension point and then cloned for each associated content type and then each clone has
- * its partition information set using {@link #setPartitionInformation}.
- * Then the {@link CommentingStrategyRegistry} can be used to retrieve applicable {@link CommentingStrategy}s
- * and apply them to documents.</p>
- *
- * <p>It is important to note that any instance of a {@link CommentingStrategy} is only valid for a specific
- * content type ID but this relationship is tracked by the {@link CommentingStrategyRegistry} and not by
- * the strategy itself. Thus any reference to the strategy being valid for specific or general partition
- * types is implying it is already only valid for a specific content type</p>
- */
-public abstract class CommentingStrategy {
- /** <code>true</code> if this strategy has any required partition types, <code>false</code> otherwise */
- private boolean fHasRequiredPartitionTypes;
-
- /**
- * <p>required partition type IDs that must be seen for this strategy to be valid, the number of them
- * that must be seen for the strategy to be valid is determined by {@link #fRequireAllRequiredPartitionTypes}
- * this requirement is waved if the optional {@link #fAssociatedCommentPartitionTypeID} is specified and
- * present because this strategy must be valid if its {@link #fAssociatedCommentPartitionTypeID} is present</p>
- *
- * @see #fRequireAllRequiredPartitionTypes
- * @see #fAssociatedCommentPartitionTypeID
- */
- private List fRequriedPartitionTypeIDs;
-
- /**
- * <p>if <code>true</code> then {@link #fAllowablePartitionTypeIDs} is ignored because
- * this strategy is valid for any partition type, if <code>false</code> then this
- * strategy is only valid for those partition types listed in {@link #fAllowablePartitionTypeIDs}</p>
- *
- * @see #fAllowablePartitionTypeIDs
- */
- private boolean fAllPartitionTypesAllowable;
-
- /**
- * <p>the partition types that this strategy is valid for, it is also automatically valid for
- * any partition types listed in {@link #fRequriedPartitionTypeIDs} and the optionally
- * specified {@link #fAssociatedCommentPartitionTypeID}</p>
- *
- * @see #fAllPartitionTypesAllowable
- * @see #fRequriedPartitionTypeIDs
- * @see #fAssociatedCommentPartitionTypeID
- */
- private List fAllowablePartitionTypeIDs;
-
- /**
- * an optional associated comment partition type ID, if this partition type is seen then the
- * the {@link #fRequriedPartitionTypeIDs} requirement is waved as to weather this strategy is
- * valid or not
- *
- * @see #fRequriedPartitionTypeIDs
- */
- private String fAssociatedCommentPartitionTypeID;
-
- /**
- * <p>Default constructor, the specific initialization is done by
- * {@link #setPartitionInformation}</p>
- */
- public CommentingStrategy() {
- this.fAssociatedCommentPartitionTypeID = null;
- this.fRequriedPartitionTypeIDs = Collections.EMPTY_LIST;
- this.fAllowablePartitionTypeIDs = Collections.EMPTY_LIST;
- this.fHasRequiredPartitionTypes = false;
- this.fAllPartitionTypesAllowable = false;
- }
-
- /**
- * <p>Used to set up the partition information for this strategy</p>
- * <p>This information is used to determine if a strategy is valid for a set of
- * {@link ITypedRegion}s.</p>
- *
- * @param allowablePartitionTypeIDs the partition types this strategy is valid for, the strategy will also
- * be considered valid for any of the required partition types
- * @param allPartitionTypesAllowable if <code>true</code> then this strategy is valid for any partition types
- * thus ignoring the <code>allowablePartitionTypeIDs</code>, <code>false</code> otherwise
- * @param requiredPartitionTypeIDs partition type IDs that must be seen for this strategy to be valid, there
- * are exceptions to this rule, see {@link #isApplicableFor(ITypedRegion[])}
- * @param requireAllRequiredPartitionTypes <code>true</code> if all of the <code>requiredPartitionTypeIDs must
- * be seen for this strategy to be valid, <code>false</code> otherwise, there are exceptions to these rules, see
- * {@link #isApplicableFor(ITypedRegion[])}
- * @param associatedCommentPartitionTypeID optional comment partition type associated with this strategy,
- * maybe <code>null</code>
- *
- * @see #isApplicableFor(ITypedRegion[])
- */
- protected final void setPartitionInformation(List allowablePartitionTypeIDs, boolean allPartitionTypesAllowable,
- List requiredPartitionTypeIDs, String associatedCommentPartitionTypeID) {
-
- this.fAllPartitionTypesAllowable = allPartitionTypesAllowable;
-
- this.fRequriedPartitionTypeIDs = requiredPartitionTypeIDs;
- if(this.fRequriedPartitionTypeIDs == null) {
- this.fRequriedPartitionTypeIDs = Collections.EMPTY_LIST;
- }
-
- this.fHasRequiredPartitionTypes = this.fRequriedPartitionTypeIDs.size() != 0;
-
- this.fAllowablePartitionTypeIDs = allowablePartitionTypeIDs;
- if(this.fAllowablePartitionTypeIDs == null) {
- this.fAllowablePartitionTypeIDs = Collections.EMPTY_LIST;
- }
-
- this.fAssociatedCommentPartitionTypeID = associatedCommentPartitionTypeID;
- }
-
- /**
- * <p>Applies this strategy to the given model starting at the given offset for the given length</p>
- *
- * @param document {@link IStructuredDocument} to apply this strategy too
- * @param offset the offset to start this comment at
- * @param length the length of the region to apply this comment too
- *
- * @throws BadLocationException it is not the fault of the strategy if callers passes a bad
- * <code>offset</code> and/or <code>length</code> for the given <code>model</code>
- */
- public abstract void apply(IStructuredDocument document, int offset, int length) throws BadLocationException;
-
- /**
- * <p>Remove any comments associated with this strategy from the given model for the given offset to
- * the given length. Weather a comment surrounding the given range should be removed can also be
- * specified</p>
- *
- * @param document {@link IStructuredDocument} to remove comments associated with this strategy from
- * @param offset the location to start removing comments associated with this strategy from
- * @param length the length of the region to remove associated comments from
- * @param removeEnclosing weather a comment should be removed if it incloses the region specified
- * by the given <code>offset</code> and <code>length</code>
- *
- * @throws BadLocationException it is not the fault of the strategy if callers passes a bad
- * <code>offset</code> and/or <code>length</code> for the given <code>model</code>
- */
- public abstract void remove(IStructuredDocument document, int offset, int length, boolean removeEnclosing) throws BadLocationException;
-
- /**
- * <p>Determines if the given region is a comment region commented by this strategy.</p>
- *
- * @param document {@link IStructuredDocument} containing the given <code>region</code>
- * @param region determine if this region is a comment region commented by this strategy
- * @return <code>true</code> if the given <code>region</code> has already been
- * commented by this strategy, <code>false</code> otherwise
- *
- * @throws BadLocationException it is not the fault of the strategy if callers passes a bad
- * <code>offset</code> and/or <code>length</code> for the given <code>model</code>
- */
- public abstract boolean alreadyCommenting(IStructuredDocument document, IRegion region) throws BadLocationException;
-
- /**
- * <p>Implementers should return a copy of themselves</p>
- * <p>Allows the {@link CommentingStrategyRegistry} to create a {@link CommentingStrategy} for
- * each of its associated content types.</p>
- *
- * @return implementers should return an object of type {@link CommentingStrategy}
- *
- * @see java.lang.Object#clone()
- */
- public abstract Object clone();
-
- /**
- * <p>Determines if this strategy is applicable for the given regions for either commenting or un-commenting.
- * For this strategy to be applicable the given regions must contain at least one or all of the
- * {@link #fRequriedPartitionTypeIDs} (depending on the value of {@link #fRequireAllRequiredPartitionTypes})
- * or contain at least one region of type {@link #fAssociatedCommentPartitionTypeID}. Also if the value of
- * {@link #fAllPartitionTypesAllowable} is <code>false</code> the given regions must all be of type
- * {@link #fAllowablePartitionTypeIDs} and/or {@link #fRequriedPartitionTypeIDs} and/or
- * {@link #fAssociatedCommentPartitionTypeID} otherwise the regions can be of any type except for they still
- * must beet the required partition type requirements</p>
- *
- * @param regions determine if this strategy is applicable for these regions
- * @return <code>true</code> if this strategy is applicable for the given <code>regions</code>
- * <code>false</code> otherwise.
- */
- public final boolean isApplicableFor(ITypedRegion[] regions) {
- List partitionTypeIDs = getPartitionTypeIDs(regions);
-
- boolean foundAssociatedCommentPartitions = false;
- if(this.fAssociatedCommentPartitionTypeID != null) {
- foundAssociatedCommentPartitions = partitionTypeIDs.contains(this.fAssociatedCommentPartitionTypeID);
- if(foundAssociatedCommentPartitions) {
- //remove all instances of the comment partition type
- boolean removed;
- do {
- removed = partitionTypeIDs.remove(this.fAssociatedCommentPartitionTypeID);
- } while(removed);
- }
- }
-
- //determine if required partitions requirements are met
- boolean requiredPartitionsRequirementsMet = !this.fHasRequiredPartitionTypes ||
- partitionTypeIDs.removeAll(this.fRequriedPartitionTypeIDs);
-
- //determine if allowable partitions requirements are met
- boolean allowablePartitionsRequirementsMet = false;
- if(this.fAllPartitionTypesAllowable) {
- allowablePartitionsRequirementsMet = true;
- } else {
- partitionTypeIDs.removeAll(this.fAllowablePartitionTypeIDs);
-
- //at this point all required partitions and allowable partitions have been removed
- allowablePartitionsRequirementsMet = partitionTypeIDs.size() == 0;
- }
-
- return (requiredPartitionsRequirementsMet || foundAssociatedCommentPartitions) && allowablePartitionsRequirementsMet;
- }
-
- /**
- * <p>Convenience method to take a list of regions and create one encompassing region to pass to
- * {@link #alreadyCommenting(IDocument, IRegion)}</p>
- *
- * @param document {@link IDocument} that contains the given <code>regions</code>
- * @param regions {@link IRegion}s to combine into one region and pass onto
- * {@link #alreadyCommenting(IDocument, IRegion)}
- *
- * @return the result of a call to {@link #alreadyCommenting(IDocument, IRegion)} combining
- * all of the given <code>regions</code> into one region
- *
- * @throws BadLocationException it is not the fault of the strategy if callers passes a bad
- * <code>offset</code> and/or <code>length</code> for the given <code>model</code>
- */
- public final boolean alreadyCommenting(IStructuredDocument document, IRegion[] regions) throws BadLocationException {
- boolean alreadyCommenting = false;
- if(regions != null && regions.length > 0) {
- //create one region spanning all the given regions
- int offset = regions[0].getOffset();
- int length = regions[regions.length-1].getOffset() +
- regions[regions.length-1].getLength() - offset;
-
- IRegion region = new Region(offset, length);
- alreadyCommenting = this.alreadyCommenting(document, region);
- }
-
- return alreadyCommenting;
- }
- /**
- * <p>Given a list of {@link ITypedRegion}s returns the sub set of that list that
- * are of the comment region type associated with this strategy</p>
- *
- * @param typedRegions {@link ITypedRegion}s to filter down to only the comment regions
- * associated with this strategy
- *
- * @return {@link List} of {@link ITypedRegion}s from the given <code>typedRegions</code>
- * that are of the comment partition type associated with this strategy
- */
- protected List getAssociatedCommentedRegions(ITypedRegion[] typedRegions) {
- List commentedRegions = new ArrayList();
-
- for(int i = 0; i < typedRegions.length; ++i) {
- if(typedRegions[i].getType().equals(this.fAssociatedCommentPartitionTypeID)) {
- commentedRegions.add(typedRegions[i]);
- }
- }
-
- return commentedRegions;
- }
-
- /**
- * <p>Given a list of {@link ITypedRegion}s returns a list of the partition
- * type IDs taken from the given regions.</p>
- *
- * @param regions {@link ITypedRegion}s to get the partition type IDs from
- * @return {@link List} of the partition type IDs taken from the given <code>regions</code>
- */
- private static List getPartitionTypeIDs(ITypedRegion[] regions) {
- List partitionTypes = new ArrayList(regions.length);
- for(int i = 0; i < regions.length; ++i) {
- partitionTypes.add(regions[i].getType());
- }
-
- return partitionTypes;
- }
-
- /**
- * <p>This method modifies the given document to remove the given comment
- * prefix at the given comment prefix offset and the given comment
- * suffix at the given comment suffix offset. In the case of removing
- * a line comment that does not have a suffix, pass <code>null</code>
- * for the comment suffix and it and its associated offset will
- * be ignored.</p>
- *
- * <p><b>NOTE:</b> it is a good idea if a model is at hand when calling this to
- * warn the model of an impending update</p>
- *
- * @param document the document to remove the comment from
- * @param commentPrefixOffset the offset of the comment prefix
- * @param commentSuffixOffset the offset of the comment suffix
- * (ignored if <code>commentSuffix</code> is <code>null</code>)
- * @param commentPrefix the prefix of the comment to remove from its associated given offset
- * @param commentSuffix the suffix of the comment to remove from its associated given offset,
- * or null if there is not suffix to remove for this comment
- */
- protected static void uncomment(IDocument document, int commentPrefixOffset, String commentPrefix,
- int commentSuffixOffset, String commentSuffix) {
-
- try {
- //determine if there is a space after the comment prefix that should also be removed
- int commentPrefixLength = commentPrefix.length();
- String postCommentPrefixChar = document.get(commentPrefixOffset + commentPrefix.length(), 1);
- if(postCommentPrefixChar.equals(" ")) {
- commentPrefixLength++;
- }
-
- //remove the comment prefix
- document.replace(commentPrefixOffset, commentPrefixLength, ""); //$NON-NLS-1$
-
- if(commentSuffix != null) {
- commentSuffixOffset -= commentPrefixLength;
-
- //determine if there is a space before the comment suffix that should also be removed
- int commentSuffixLength = commentSuffix.length();
- String preCommentSuffixChar = document.get(commentSuffixOffset-1, 1);
- if(preCommentSuffixChar.equals(" ")) {
- commentSuffixLength++;
- commentSuffixOffset--;
- }
-
- //remove the comment suffix
- document.replace(commentSuffixOffset, commentSuffixLength, ""); //$NON-NLS-1$
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategyRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategyRegistry.java
deleted file mode 100644
index dbc9582541..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/CommentingStrategyRegistry.java
+++ /dev/null
@@ -1,351 +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.wst.sse.ui.internal.comment;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * <p>The registry of {@link CommentingStrategy}s defined by the <code>org.eclipse.wst.sse.ui.commentinStrategy</code>
- * extension point.</p>
- */
-public class CommentingStrategyRegistry {
- /** The extension schema name of the extension point */
- private static final String EXTENSION_POINT = "commentingStrategy"; //$NON-NLS-1$
-
- /** The extension schema name of proposal block comment child elements. */
- private static final String ELEM_PROPOSAL_BLOCK_COMMENTING_STRATEGY = "blockCommentingStrategy"; //$NON-NLS-1$
-
- /** The extension schema name of proposal line comment child elements. */
- private static final String ELEM_PROPOSAL_LINE_COMMENTING_STRATEGY = "lineCommentingStrategy"; //$NON-NLS-1$
-
- /** The extension schema name of the content type child elements. */
- private static final String ELEM_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
-
- /** The extension schema name of the required partition types child elements */
- private static final String ELEM_REQUIRED_PARTITION_TYPES= "requiredPartitionTypes"; //$NON-NLS-1$
-
- /** The extension schema name of the allowable partition types child elements */
- private static final String ELEM_ALLOWABLE_PARTITION_TYPES= "allowablePartitionTypes"; //$NON-NLS-1$
-
- /** The extension schema name of partition type child elements */
- private static final String ELEM_PARTITION_TYPE= "partitionType"; //$NON-NLS-1$
-
- /** The extension schema name of the prefix attribute */
- private static final String ATTR_PREFIX = "prefix"; //$NON-NLS-1$
-
- /** The extension schema name of the suffix attribute */
- private static final String ATTR_SUFFIX = "suffix"; //$NON-NLS-1$
-
- /** The extension schema name of the associatedCommentPartitionTypeID attribute */
- private static final String ATTR_ASSOCIATED_COMMENT_PARTITION_TPYPE_ID = "associatedCommentPartitionTypeID"; //$NON-NLS-1$
-
- /** The extension schema name of the anyPartitionType attribute */
- private static final String ATTR_ANY_PARTITION_TYPE = "anyPartitionType"; //$NON-NLS-1$
-
- /** The extension schema name for ID attribute */
- private static final String ATTR_ID= "id"; //$NON-NLS-1$
-
- /** the singleton instance of the registry */
- private static CommentingStrategyRegistry fSingleton = null;
-
- /** <code>true</code> if this registry has been loaded. */
- private boolean fLoaded;
-
- /**
- * <p>Registry of content type IDs to {@link BlockCommentingStrategy}s</p>
- *
- * <code>{@link Map}&lt{@link String}, {@link List}&lt{@link BlockContentType}&gt&gt</code>
- * <ul>
- * <li><b>key:</b> content type ID</li>
- * <li><b>value:</b> {@link List} of associated {@link BlockContentType}s</li>
- * <ul>
- */
- private Map fBlockCommentTypes;
-
- /**
- * <p>Registry of content type IDs to {@link LineCommentingStrategy}s</p>
- *
- * <code>{@link Map}&lt{@link String}, {@link List}&lt{@link LineContentType}&gt&gt</code>
- * <ul>
- * <li><b>key:</b> content type ID</li>
- * <li><b>value:</b> {@link List} of associated {@link LineContentType}s</li>
- * <ul>
- */
- private Map fLineCommentTypes;
-
- /**
- * @return the single instance of the {@link CommentingStrategyRegistry}
- */
- public static synchronized CommentingStrategyRegistry getDefault() {
- if(fSingleton == null) {
- fSingleton = new CommentingStrategyRegistry();
- }
-
- return fSingleton;
- }
-
- /**
- * Singleton constructor for the registry
- */
- private CommentingStrategyRegistry() {
- this.fLoaded = false;
- this.fBlockCommentTypes = new HashMap();
- this.fLineCommentTypes = new HashMap();
- }
-
- /**
- * @param contentTypeID get only {@link BlockCommentingStrategy}s associated with this content type
- * @param regions get only {@link BlockCommentingStrategy}s associated with these types of regions
- * @return all the {@link BlockCommentingStrategy}s associated with the given content type and regions
- */
- public CommentingStrategy getBlockCommentingStrategy(String contentTypeID, ITypedRegion[] regions) {
- return getCommentingStrategy(contentTypeID, regions, this.fBlockCommentTypes);
- }
-
- /**
- * @param contentTypeID get only {@link LineCommentingStrategy}s associated with this content type
- * @param regions get only {@link LineCommentingStrategy}s associated with these types of regions
- * @return all the {@link LineCommentingStrategy}s associated with the given content type and regions
- */
- public CommentingStrategy getLineCommentingStrategy(String contentTypeID, ITypedRegion[] regions) {
- return getCommentingStrategy(contentTypeID, regions, this.fLineCommentTypes);
- }
-
- /**
- * <p>get all the {@link CommentingStrategy}s associated with the given content type and regions
- * from the given registry</p>
- *
- * @param contentTypeID get only {@link CommentingStrategy}s associated with this content type
- * @param regions get only {@link CommentingStrategy}s associated with these types of regions
- * @param registry get the {@link CommentingStrategy}s from this registry
- * @return all the {@link CommentingStrategy}s associated with the given content type and regions
- * from the given registry
- */
- private CommentingStrategy getCommentingStrategy(String contentTypeID, ITypedRegion[] regions, Map registry) {
- ensureExtensionPointRead();
-
- CommentingStrategy match = null;
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-
- /* get all the commenting strategies for the given content type id,
- * including those registered for parent content types
- */
- List possibleCommentingStrategies = new ArrayList();
- while(contentType != null) {
- List contentTypeCommentingStrategies = (List)registry.get(contentType.getId());
- if(contentTypeCommentingStrategies != null && contentTypeCommentingStrategies.size() > 0) {
- possibleCommentingStrategies.addAll(contentTypeCommentingStrategies);
- }
- contentType = contentType.getBaseType();
- }
-
- /* find the commenting strategy applicable for the given regions,
- * because strategies were added starting from the most specific
- * content type first, the most specific strategy will always be chosen
- */
- for(int i = 0; i < possibleCommentingStrategies.size() && match == null; ++i) {
- CommentingStrategy commentType = (CommentingStrategy)possibleCommentingStrategies.get(i);
- if(commentType.isApplicableFor(regions)) {
- match = commentType;
- }
- }
-
- return match;
- }
-
- /**
- * <p>Ensures that the extensions are read and this registry is built</p>
- */
- private void ensureExtensionPointRead() {
- if(!fLoaded) {
- load();
- fLoaded = true;
- }
- }
-
- /**
- * <p>Load the extension points into the registry</p>
- */
- private void load() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- List extensionElements = new ArrayList(Arrays.asList(extensionRegistry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT)));
-
- //for each extension
- for (Iterator iter= extensionElements.iterator(); iter.hasNext();) {
- IConfigurationElement element = (IConfigurationElement) iter.next();
- try {
- CommentingStrategy newCommentingStrategy = null;
- Map commentingStrategyRegistry = null;
- //either a block or line commenting strategy
- if(element.getName().equals(ELEM_PROPOSAL_BLOCK_COMMENTING_STRATEGY)) {
- String prefix = element.getAttribute(ATTR_PREFIX);
- checkExtensionAttributeNotNull(prefix, ATTR_PREFIX, element);
-
- String suffix = element.getAttribute(ATTR_SUFFIX);
- checkExtensionAttributeNotNull(suffix, ATTR_SUFFIX, element);
-
- if(prefix != null && suffix != null) {
- newCommentingStrategy = new BlockCommentingStrategy(prefix, suffix);
- commentingStrategyRegistry = this.fBlockCommentTypes;
- }
- } else if(element.getName().equals(ELEM_PROPOSAL_LINE_COMMENTING_STRATEGY)) {
- String prefix = element.getAttribute(ATTR_PREFIX);
- checkExtensionAttributeNotNull(prefix, ATTR_PREFIX, element);
-
- if(prefix != null) {
- newCommentingStrategy = new LineCommentingStrategy(prefix);
- commentingStrategyRegistry = this.fLineCommentTypes;
- }
- }
-
- //add the new strategy to the registry
- if(commentingStrategyRegistry != null && newCommentingStrategy != null) {
- addCommentingStrategyToRegistry(element, commentingStrategyRegistry, newCommentingStrategy);
- } else {
- Logger.log(Logger.WARNING, "Invalid CommentingStrategy extension: " + element); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- Logger.logException(e);
- } catch (InvalidRegistryObjectException x) {
- /* Element is not valid any longer as the contributing plug-in was unloaded or for
- * some other reason. Do not include the extension in the list and log it
- */
- String message = "The extension ''" + element.toString() + "'' is invalid."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.WARNING, message, x);
- Logger.log(status);
- }
- }
- }
-
- /**
- * <p>Checks that the given attribute value is not <code>null</code>.</p>
- *
- * @param value the object to check if not null
- * @param attribute the attribute
- *
- * @throws InvalidRegistryObjectException if the registry element is no longer valid
- * @throws CoreException if <code>value</code> is <code>null</code>
- */
- private static void checkExtensionAttributeNotNull(Object value, String attribute,
- IConfigurationElement element) throws InvalidRegistryObjectException, CoreException {
-
- if (value == null) {
- String message = "The extension \"" + element.getDeclaringExtension().getUniqueIdentifier() + //$NON-NLS-1$
- "\" from plug-in \"" + element.getContributor().getName() + //$NON-NLS-1$
- "\" did not specify a value for the required \"" + attribute + //$NON-NLS-1$
- "\" attribute for the element \"" + element.getName() + "\". Disabling the extension."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, null);
- throw new CoreException(status);
- }
- }
-
- /**
- * <p>Using the content type element children of the given element add a copy of the given
- * base commenting strategy to the given registry</p>
- *
- * @param element a {@link IConfigurationElement} with contentType element children
- * @param commentingStrategyRegistry {@link Map} of content type ids to {@link CommentingStrategy}s to register
- * the given {@link CommentingStrategy} with based on the <code>element</code>
- * @param baseCommentingStrategy {@link CommentingStrategy} that will be cloned and configured for each
- * content type in the given <code>element</code>
- */
- private static void addCommentingStrategyToRegistry(IConfigurationElement element,
- Map commentingStrategyRegistry, CommentingStrategy baseCommentingStrategy) {
-
- //get all the content type elements
- IConfigurationElement[] contentTypeElements = element.getChildren(ELEM_CONTENT_TYPE);
- if(contentTypeElements.length > 0) {
- for(int contentTypeIndex = 0; contentTypeIndex < contentTypeElements.length; ++contentTypeIndex) {
- try {
- String contentTypeID = contentTypeElements[contentTypeIndex].getAttribute(ATTR_ID);
- checkExtensionAttributeNotNull(contentTypeID, ATTR_ID, contentTypeElements[contentTypeIndex]);
-
- List commentTypes = (List)commentingStrategyRegistry.get(contentTypeID);
- if(commentTypes == null) {
- commentTypes = new ArrayList();
- commentingStrategyRegistry.put(contentTypeID, commentTypes);
- }
-
- //this element is required
- List allowablePartitionTypeIDs = new ArrayList();
- IConfigurationElement[] allowablePartitionTypes =
- contentTypeElements[contentTypeIndex].getChildren(ELEM_ALLOWABLE_PARTITION_TYPES);
- boolean anyPartitionType = false;
- //determine anyPartitionType attribute value
- String anyPartitionTypeValue = allowablePartitionTypes[0].getAttribute(ATTR_ANY_PARTITION_TYPE);
- if(anyPartitionTypeValue != null) {
- anyPartitionType = Boolean.valueOf(anyPartitionTypeValue).booleanValue();
- }
-
- //get the optional partition types
- allowablePartitionTypes = allowablePartitionTypes[0].getChildren(ELEM_PARTITION_TYPE);
- if(allowablePartitionTypes.length > 0) {
- for (int partitionTypeIndex = 0; partitionTypeIndex < allowablePartitionTypes.length; ++partitionTypeIndex) {
- String partitionTypeID = allowablePartitionTypes[partitionTypeIndex].getAttribute(ATTR_ID);
- checkExtensionAttributeNotNull(partitionTypeID, ATTR_ID, allowablePartitionTypes[partitionTypeIndex]);
-
- allowablePartitionTypeIDs.add(partitionTypeID);
- }
- }
-
- //this element is optional
- List requiredPartitionTypeIDs = new ArrayList();
- IConfigurationElement[] requiredPartitionTypes =
- contentTypeElements[contentTypeIndex].getChildren(ELEM_REQUIRED_PARTITION_TYPES);
- if(requiredPartitionTypes.length > 0) {
- //get the required partition types
- requiredPartitionTypes = requiredPartitionTypes[0].getChildren(ELEM_PARTITION_TYPE);
- if(requiredPartitionTypes.length > 0) {
- for (int partitionTypeIndex = 0; partitionTypeIndex < requiredPartitionTypes.length; ++partitionTypeIndex) {
- String partitionTypeID = requiredPartitionTypes[partitionTypeIndex].getAttribute(ATTR_ID);
- checkExtensionAttributeNotNull(partitionTypeID, ATTR_ID, requiredPartitionTypes[partitionTypeIndex]);
-
- requiredPartitionTypeIDs.add(partitionTypeID);
- }
- }
- }
-
- //get the optional associated comment partition type ID
- String associatedCommentPartitionTypeID =
- contentTypeElements[contentTypeIndex].getAttribute(ATTR_ASSOCIATED_COMMENT_PARTITION_TPYPE_ID);
-
- //register the strategy
- CommentingStrategy newCommentingStrategy = (CommentingStrategy)baseCommentingStrategy.clone();
- newCommentingStrategy.setPartitionInformation(allowablePartitionTypeIDs, anyPartitionType,
- requiredPartitionTypeIDs, associatedCommentPartitionTypeID);
- commentTypes.add(newCommentingStrategy);
- } catch(CoreException e) {
- Logger.logException(e);
- }
- }
- } else {
- Logger.log(Logger.WARNING, "The commmenting strategy element: " + element +//$NON-NLS-1$
- " does not contain any required " + ELEM_CONTENT_TYPE + "s"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/LineCommentingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/LineCommentingStrategy.java
deleted file mode 100644
index b8d8697076..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/comment/LineCommentingStrategy.java
+++ /dev/null
@@ -1,83 +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.wst.sse.ui.internal.comment;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * <p>Represents a Line Comment commenting strategy</p>
- */
-public class LineCommentingStrategy extends CommentingStrategy {
- /** the prefix of the line comment associated with this strategy */
- private String fPrefix;
-
- /**
- * @param prefix the prefix of the line comment associated with this strategy
- */
- public LineCommentingStrategy(String prefix) {
- super();
- this.fPrefix = prefix;
- }
-
- /**
- * <p>Assumes that the given offset is at the begining of a line and adds the line
- * comment prefix there</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#apply(
- * org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)
- */
- public void apply(IStructuredDocument document, int offset, int length)
- throws BadLocationException {
-
- document.replace(offset, 0, this.fPrefix + " ");
- }
-
- /**
- * <p>Assumes that the given offset is at the beginning of a line that is commented and removes
- * the comment prefix from the beginning of the line, leading whitespace on the line will not
- * prevent this method from finishing correctly</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#remove(
- * org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int, boolean)
- */
- public void remove(IStructuredDocument document, int offset, int length, boolean removeEnclosing) throws BadLocationException{
- String content = document.get(offset, length);
- int innerOffset = content.indexOf(this.fPrefix);
- if(innerOffset > 0) {
- offset += innerOffset;
- }
-
- uncomment(document, offset, this.fPrefix, -1, null);
- }
-
- /**
- * <p>A region is already commented if it begins with the the associated prefix ignoring any
- * leading whitespace</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#alreadyCommenting(
- * org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IRegion)
- */
- public boolean alreadyCommenting(IStructuredDocument document, IRegion region)
- throws BadLocationException {
-
- String regionContent = document.get(region.getOffset(), region.getLength()).trim();
- return regionContent.startsWith(this.fPrefix);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy#clone()
- */
- public Object clone() {
- return new LineCommentingStrategy(this.fPrefix);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java
deleted file mode 100644
index 83abfa3cbc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java
+++ /dev/null
@@ -1,374 +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.wst.sse.ui.internal.contentassist;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.LegacyActionTools;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
-import org.osgi.framework.Bundle;
-
-/**
- * Describes a category extension to the
- * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.
- */
-public final class CompletionProposalCategory {
- /** The extension schema name of the icon attribute. */
- private static final String ICON= "icon"; //$NON-NLS-1$
-
- /** The extension schema name of the ID attribute. */
- private static final String ID= "id"; //$NON-NLS-1$
-
- /** The extension schema name of the name attribute. */
- private static final String NAME= "name"; //$NON-NLS-1$
-
- /** ID of this completion category */
- private final String fId;
-
- /** Name of this completion category */
- private final String fName;
-
- /** The image descriptor for this category, or <code>null</code> if none specified. */
- private final ImageDescriptor fImage;
-
- /** The last error reported by this category */
- private String fLastError = null;
-
- /**
- * <p>Construct the category by parsing the given element.</p>
- *
- * @param element {@link IConfigurationElement} containing the configuration of this category
- * @throws CoreException if the given {@link IConfigurationElement} does not contain the correct
- * elements and attributes.
- */
- CompletionProposalCategory(IConfigurationElement element) throws CoreException {
- Assert.isLegal(element != null);
-
- //get & verify ID
- fId = element.getAttribute(ID);
- ContentAssistUtils.checkExtensionAttributeNotNull(fId, ID, element);
-
- //get & verify optional name
- String name= element.getAttribute(NAME);
- if (name == null) {
- fName = fId;
- } else {
- fName= name;
- }
-
- //get & verify optional icon
- String icon= element.getAttribute(ICON);
- ImageDescriptor img= null;
- if (icon != null) {
- Bundle bundle= ContentAssistUtils.getBundle(element);
- if (bundle != null) {
- Path path= new Path(icon);
- URL url= FileLocator.find(bundle, path, null);
- img= ImageDescriptor.createFromURL(url);
- }
- }
- fImage= img;
- }
-
- /**
- * <p>Creates a category with the given name and ID</p>
- *
- * @param id the unique ID of the new category
- * @param name the name of the new category
- */
- CompletionProposalCategory(String id, String name) {
- fId= id;
- fName= name;
- fImage= null;
- }
-
- /**
- * <p>Returns the unique identifier of the category</p>
- *
- * @return Returns the id
- */
- public String getId() {
- return fId;
- }
-
- /**
- * <p>Returns the human readable name of the category.
- * It may contain mnemonics.</p>
- *
- * @return Returns the name
- */
- public String getName() {
- return fName;
- }
-
- /**
- * <p>Returns the human readable name of the category
- * without mnemonic hint in order to be displayed
- * in a message.</p>
- *
- * @return Returns the name
- */
- public String getDisplayName() {
- return LegacyActionTools.removeMnemonics(fName);
- }
-
- /**
- * <p>Returns the image descriptor of the category.</p>
- *
- * @return the image descriptor of the category
- */
- public ImageDescriptor getImageDescriptor() {
- return fImage;
- }
-
- /**
- * @return <code>true</code> if this category should be displayed on
- * its own content assist page, <code>false</code> otherwise
- */
- public boolean isDisplayedOnOwnPage(String contentTypeID) {
- boolean displayOnOwnPage = ICompletionProposalCategoriesConfigurationReader.DEFAULT_DISPLAY_ON_OWN_PAGE;
-
- ICompletionProposalCategoriesConfigurationReader properties =
- CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
- if(properties != null) {
- displayOnOwnPage = properties.shouldDisplayOnOwnPage(this.fId);
- }
-
- return displayOnOwnPage;
- }
-
- /**
- * @return <code>true</code> if this category should be displayed in
- * the default content assist page, <code>false</code> otherwise
- */
- public boolean isIncludedOnDefaultPage(String contentTypeID) {
- boolean includeOnDefaultPage = ICompletionProposalCategoriesConfigurationReader.DEFAULT_INCLUDE_ON_DEFAULTS_PAGE;
-
- ICompletionProposalCategoriesConfigurationReader properties =
- CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
- if(properties != null) {
- includeOnDefaultPage = properties.shouldDisplayOnDefaultPage(this.fId);
- }
-
- return includeOnDefaultPage;
- }
-
- /**
- * <p>Given a content type ID determines the rank of this
- * category for sorting the content assist pages</p>
- *
- * @return the sort rank of this category
- */
- public int getPageSortRank(String contentTypeID) {
- int sortOrder = ICompletionProposalCategoriesConfigurationReader.DEFAULT_SORT_ORDER;
-
- ICompletionProposalCategoriesConfigurationReader properties =
- CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
- if(properties != null) {
- sortOrder = properties.getPageSortOrder(this.fId);
- }
-
- return sortOrder;
- }
-
- /**
- * <p>Given a content type ID determines the rank of this
- * category for sorting on the default content assist page
- * with other categories</p>
- *
- * @return the sort rank of this category
- */
- public int getDefaultPageSortRank(String contentTypeID) {
- int sortOrder = ICompletionProposalCategoriesConfigurationReader.DEFAULT_SORT_ORDER;
-
- ICompletionProposalCategoriesConfigurationReader properties =
- CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
- if(properties != null) {
- sortOrder = properties.getDefaultPageSortOrder(this.fId);
- }
-
- return sortOrder;
- }
-
- /**
- * <p><b>NOTE: </b> enablement is not the same as weather a category
- * should be displayed on its own page or the default page, it describes
- * if the category should be used at all. Currently categories are always
- * enabled. There maybe cases in the future where a category should be
- * disabled entirely though.</p>
- *
- * @return <code>true</code> if this category is enabled,
- * <code>false</code> otherwise
- */
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @return <code>true</code> if the category contains any computers, <code>false</code>
- * otherwise
- */
- public boolean hasComputers() {
- List descriptors= CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors();
- for (Iterator it= descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param contentTypeID the content type ID
- * @param partitionTypeID the partition
- * @return <code>true</code> if the category contains any computers, in the given partition type
- * in the given content type, <code>false</code> otherwise
- */
- public boolean hasComputers(String contentTypeID, String partitionTypeID) {
- List descriptors = CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID);
- for (Iterator it = descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param contentTypeID the content type ID
- * @return <code>true</code> if the category contains any computers, in the given partition type
- * in the given content type, <code>false</code> otherwise
- */
- public boolean hasComputers(String contentTypeID) {
- List descriptors = CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID);
- for (Iterator it = descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * <p>Safely computes completion proposals of all computers of this category through their
- * extension.</p>
- *
- * @param context the invocation context passed on to the extension
- * @param contentTypeID the content type ID where the invocation occurred
- * @param partitionTypeID the partition type where the invocation occurred
- * @param monitor the progress monitor passed on to the extension
- * @return the list of computed completion proposals (element type:
- * {@link org.eclipse.jface.text.contentassist.ICompletionProposal})
- */
- public List computeCompletionProposals(CompletionProposalInvocationContext context,
- String contentTypeID, String partitionTypeID, SubProgressMonitor monitor) {
-
- fLastError = null;
- List result = new ArrayList();
- List descriptors = new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID));
- for (Iterator it = descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc = (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this) {
- result.addAll(desc.computeCompletionProposals(context, monitor));
- }
-
- if (fLastError == null && desc.getErrorMessage() != null) {
- fLastError = desc.getErrorMessage();
- }
- }
- return result;
- }
-
- /**
- * <p>Safely computes context information objects of all computers of this category through their
- * extension.</p>
- *
- * @param context the invocation context passed on to the extension
- * @param contentTypeID the content type ID where the invocation occurred
- * @param partitionTypeID the partition type where the invocation occurred
- * @param monitor the progress monitor passed on to the extension
- * @return the list of computed context information objects (element type:
- * {@link org.eclipse.jface.text.contentassist.IContextInformation})
- */
- public List computeContextInformation(CompletionProposalInvocationContext context,
- String contentTypeID, String partitionTypeID, SubProgressMonitor monitor) {
-
- fLastError= null;
- List result= new ArrayList();
- List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID));
- for (Iterator it= descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this && (isIncludedOnDefaultPage(contentTypeID) || isDisplayedOnOwnPage(contentTypeID))) {
- result.addAll(desc.computeContextInformation(context, monitor));
- }
- if (fLastError == null) {
- fLastError= desc.getErrorMessage();
- }
- }
- return result;
- }
-
- /**
- * @return the last error message reported by a computer in this category
- */
- public String getErrorMessage() {
- return fLastError;
- }
-
- /**
- * <p>Notifies the computers in this category of a proposal computation session start.</p>
- */
- public void sessionStarted() {
- List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors());
- for (Iterator it= descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this)
- desc.sessionStarted();
- if (fLastError == null)
- fLastError= desc.getErrorMessage();
- }
- }
-
- /**
- * <p>Notifies the computers in this category of a proposal computation session end.</p>
- */
- public void sessionEnded() {
- List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors());
- for (Iterator it= descriptors.iterator(); it.hasNext();) {
- CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
- if (desc.getCategory() == this)
- desc.sessionEnded();
- if (fLastError == null)
- fLastError= desc.getErrorMessage();
- }
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fId + ": " + fName; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java
deleted file mode 100644
index d36cca04a3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java
+++ /dev/null
@@ -1,648 +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.wst.sse.ui.internal.contentassist;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IContributor;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.PerformanceStats;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.osgi.framework.Bundle;
-
-/**
- * Wraps an {@link ICompletionProposalComputer} provided by an extension to the
- * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.
- * Instances are immutable. Instances can be obtained from a
- * {@link CompletionProposalComputerRegistry}.
- *
- * @see CompletionProposalComputerRegistry
- */
-final class CompletionProposalComputerDescriptor {
- /** The default category id. */
- private static final String DEFAULT_CATEGORY_ID= "org.eclipse.wst.sse.ui.defaultProposalCategory"; //$NON-NLS-1$
-
- /** The extension schema name of the category id attribute. */
- private static final String ATTR_CATEGORY_ID= "categoryId"; //$NON-NLS-1$
-
- /** The extension schema name for element ID attributes */
- private static final String ATTR_ID= "id"; //$NON-NLS-1$
-
- /** The extension schema name for element name attributes */
- private static final String ATTR_NAME= "name"; //$NON-NLS-1$
-
- /** The extension schema name of the class attribute. */
- private static final String ATTR_CLASS= "class"; //$NON-NLS-1$
-
- /** The extension schema name of the activate attribute. */
- private static final String ATTRACTIVATE= "activate"; //$NON-NLS-1$
-
- /** The extension schema name of the content type child elements. */
- private static final String ELEM_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
-
- /** The extension schema name of the partition type child elements. */
- private static final String ELEM_PARTITION_TYPE= "partitionType"; //$NON-NLS-1$
-
- /** The name of the performance event used to trace extensions. */
- private static final String PERFORMANCE_EVENT= SSEUIPlugin.ID + "/perf/content_assist/extensions"; //$NON-NLS-1$
-
- /**
- * If <code>true</code>, execution time of extensions is measured and the data forwarded to
- * core's {@link PerformanceStats} service.
- */
- private static final boolean MEASURE_PERFORMANCE= PerformanceStats.isEnabled(PERFORMANCE_EVENT);
-
- /**
- * Independently of the {@link PerformanceStats} service, any operation that takes longer than
- * {@value} milliseconds will be flagged as an violation. This timeout does not apply to the
- * first invocation, as it may take longer due to plug-in initialization etc. See also
- * {@link #fIsReportingDelay}.
- */
- private static final long MAX_DELAY= 500000;
-
- /* log constants */
- private static final String COMPUTE_COMPLETION_PROPOSALS= "computeCompletionProposals()"; //$NON-NLS-1$
- private static final String COMPUTE_CONTEXT_INFORMATION= "computeContextInformation()"; //$NON-NLS-1$
- private static final String SESSION_STARTED= "sessionStarted()"; //$NON-NLS-1$
- private static final String SESSION_ENDED= "sessionEnded()"; //$NON-NLS-1$
-
- /** The identifier of the extension. */
- private final String fId;
-
- /** The name of the extension. */
- private final String fName;
-
- /** The class name of the provided <code>ISSECompletionProposalComputer</code>. */
- private final String fClass;
-
- /** The activate attribute value. */
- private final boolean fActivate;
-
- /** The configuration element of this extension. */
- private final IConfigurationElement fElement;
-
- /** The computer, if instantiated, <code>null</code> otherwise. */
- private ICompletionProposalComputer fComputer;
-
- /** The UI category. */
- private final CompletionProposalCategory fCategory;
-
- /** The first error message in the most recent operation, or <code>null</code>. */
- private String fLastError;
-
- /**
- * Tells whether to inform the user when <code>MAX_DELAY</code> has been exceeded.
- * We start timing execution after the first session because the first may take
- * longer due to plug-in activation and initialization.
- */
- private boolean fIsReportingDelay = false;
-
- /** The start of the last operation. */
- private long fStart;
-
- /**
- * Tells whether we tried to load the computer.
- * @since 3.4
- */
- boolean fTriedLoadingComputer = false;
-
- /**
- * <p>Creates a new descriptor.</p>
- * <p><b>NOTE: </b> This will not add this new descriptor to the given
- * {@link CompletionProposalComputerRegistry}. That can not be done
- * until this descriptor is done being constructed. Therefore be sure
- * to call {@link #addToRegistry()} after creating a new descriptor.</p>
- *
- * @param element the configuration element to read
- * @param categories the categories
- *
- * @throws InvalidRegistryObjectException if this extension is no longer valid
- * @throws CoreException if the extension contains invalid values
- */
- CompletionProposalComputerDescriptor(IConfigurationElement element, List categories) throws InvalidRegistryObjectException, CoreException {
- Assert.isLegal(element != null);
- fElement = element;
-
- //get & verify ID
- fId = fElement.getAttribute(ATTR_ID);
- ContentAssistUtils.checkExtensionAttributeNotNull(fId, ATTR_ID, fElement);
-
- //get & verify optional name
- String name= fElement.getAttribute(ATTR_NAME);
- if (name == null) {
- fName= fId;
- } else {
- fName= name;
- }
-
- //get & verify activate plugin attribute
- String activateAttribute= fElement.getAttribute(ATTRACTIVATE);
- fActivate = Boolean.valueOf(activateAttribute).booleanValue();
-
- //get & verify class
- fClass= fElement.getAttribute(ATTR_CLASS);
- ContentAssistUtils.checkExtensionAttributeNotNull(fClass, ATTR_CLASS, fElement);
-
- //get & verify optional category id
- String categoryId= fElement.getAttribute(ATTR_CATEGORY_ID);
- if (categoryId == null) {
- categoryId= DEFAULT_CATEGORY_ID;
- }
-
- //find the category with the determined category id
- CompletionProposalCategory category= null;
- for (Iterator it= categories.iterator(); it.hasNext();) {
- CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
- if (cat.getId().equals(categoryId)) {
- category= cat;
- break;
- }
- }
-
- /* create a category if it does not exist
- * else just set the category
- */
- if (category == null) {
- fCategory = new CompletionProposalCategory(categoryId, fName);
-
- /* will add the new category to the registers list of categories,
- * by the magic of object references
- */
- categories.add(fCategory);
- } else {
- fCategory = category;
- }
- }
-
- /**
- * <p>Adds this descriptor to the {@link CompletionProposalComputerRegistry}.</p>
- * <p><b>NOTE: </b>Must be done after descriptor creation or the descriptor will
- * not be added to the registry. Can not be done in constructor because
- * descriptor must be constructed before it can be added to the registry</p>
- *
- *
- * @throws InvalidRegistryObjectException
- * @throws CoreException
- */
- void addToRegistry() throws InvalidRegistryObjectException, CoreException {
- parseActivationAndAddToRegistry(this.fElement, this);
- }
-
- /**
- * @return the category that the wrapped {@link ICompletionProposalComputer} is
- * associated with.
- */
- CompletionProposalCategory getCategory() {
- return fCategory;
- }
-
- /**
- * @return the contributor of the described {@link ICompletionProposalComputer}
- */
- IContributor getContributor() {
- try {
- return fElement.getContributor();
- } catch (InvalidRegistryObjectException e) {
- return null;
- }
- }
-
- /**
- * @return Returns the id of the described {@link ICompletionProposalComputer}
- */
- public String getId() {
- return fId;
- }
-
- /**
- * @return the name of the described {@link ICompletionProposalComputer}
- */
- public String getName() {
- return fName;
- }
-
- /**
- * Returns a new instance of the computer as described in the
- * extension's xml. Note that the safest way to access the computer
- * is by using the
- * {@linkplain #computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) computeCompletionProposals}
- * and
- * {@linkplain #computeContextInformation(ContentAssistInvocationContext, IProgressMonitor) computeContextInformation}
- * methods. These delegate the functionality to the contributed
- * computer, but handle instance creation and any exceptions thrown.
- *
- * @return a new instance of the completion proposal computer as
- * described by this descriptor
- *
- * @throws CoreException if the creation fails
- * @throws InvalidRegistryObjectException if the extension is not
- * valid any longer (e.g. due to plug-in unloading)
- */
- public ICompletionProposalComputer createComputer() throws CoreException, InvalidRegistryObjectException {
- return (ICompletionProposalComputer) fElement.createExecutableExtension(ATTR_CLASS);
- }
-
- /**
- * <p>Safely computes completion proposals through the described extension.</p>
- *
- * @param context the invocation context passed on to the extension
- * @param monitor the progress monitor passed on to the extension
- * @return the list of computed completion proposals (element type:
- * {@link org.eclipse.jface.text.contentassist.ICompletionProposal})
- */
- public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
- List completionProposals = Collections.EMPTY_LIST;
- if (isEnabled()) {
- IStatus status = null;
- try {
- // plugin must be active to get computer
- ICompletionProposalComputer computer = getComputer(true);
- if (computer != null) {
- try {
- PerformanceStats stats= startMeter(context, computer);
- //ask the computer for the proposals
- List proposals = computer.computeCompletionProposals(context, monitor);
- stopMeter(stats, COMPUTE_COMPLETION_PROPOSALS);
-
- if (proposals != null) {
- fLastError = computer.getErrorMessage();
- completionProposals = proposals;
- } else {
- status = createAPIViolationStatus(COMPUTE_COMPLETION_PROPOSALS);
- }
- } finally {
- fIsReportingDelay = true;
- }
- }
- } catch (InvalidRegistryObjectException x) {
- status= createExceptionStatus(x);
- } catch (CoreException x) {
- status= createExceptionStatus(x);
- } catch (RuntimeException x) {
- status= createExceptionStatus(x);
- } finally {
- monitor.done();
- }
-
- if(status != null) {
- Logger.log(status);
- }
- }
-
- return completionProposals;
- }
-
- /**
- * <p>Safely computes context information objects through the described extension.</p>
- *
- * @param context the invocation context passed on to the extension
- * @param monitor the progress monitor passed on to the extension
- * @return the list of computed context information objects (element type:
- * {@link org.eclipse.jface.text.contentassist.IContextInformation})
- */
- public List computeContextInformation(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
- List contextInformation = Collections.EMPTY_LIST;
- if (isEnabled()) {
- IStatus status = null;
- try {
- // plugin must be active to get computer
- ICompletionProposalComputer computer = getComputer(true);
- if (computer != null) {
- PerformanceStats stats= startMeter(context, computer);
- List proposals= computer.computeContextInformation(context, monitor);
- stopMeter(stats, COMPUTE_CONTEXT_INFORMATION);
-
- if (proposals != null) {
- fLastError= computer.getErrorMessage();
- contextInformation = proposals;
- } else {
- status = createAPIViolationStatus(COMPUTE_CONTEXT_INFORMATION);
- }
- }
- } catch (InvalidRegistryObjectException x) {
- status= createExceptionStatus(x);
- } catch (CoreException x) {
- status= createExceptionStatus(x);
- } catch (RuntimeException x) {
- status= createExceptionStatus(x);
- } finally {
- monitor.done();
- }
-
- if(status != null) {
- Logger.log(status);
- }
- }
-
- return contextInformation;
- }
-
- /**
- * <p>Notifies the described extension of a proposal computation session start.</p>
- *
- * <p><b>Note: </b>This method is called every time code assist is invoked and
- * is <strong>not</strong> filtered by content type or partition type.</p>
- */
- public void sessionStarted() {
- if (isEnabled()) {
- IStatus status = null;
- try {
- // plugin must be active to get computer
- ICompletionProposalComputer computer = getComputer(true);
- if (computer != null) {
- PerformanceStats stats = startMeter(SESSION_STARTED, computer);
- computer.sessionStarted();
- stopMeter(stats, SESSION_ENDED);
- }
- } catch (InvalidRegistryObjectException x) {
- status= createExceptionStatus(x);
- } catch (CoreException x) {
- status= createExceptionStatus(x);
- } catch (RuntimeException x) {
- status= createExceptionStatus(x);
- }
-
- if(status != null) {
- Logger.log(status);
- }
- }
- }
-
- /**
- * <p>Notifies the described extension of a proposal computation session end.</p>
- *
- * <p><b>Note: </b>This method is called every time code assist is invoked and
- * is <strong>not</strong> filtered by content type or partition type.</p>
- */
- public void sessionEnded() {
- if (isEnabled()) {
- IStatus status = null;
- try {
- // plugin must be active to get computer
- ICompletionProposalComputer computer = getComputer(true);
- if (computer != null) {
- PerformanceStats stats= startMeter(SESSION_ENDED, computer);
- computer.sessionEnded();
- stopMeter(stats, SESSION_ENDED);
- }
- } catch (InvalidRegistryObjectException x) {
- status= createExceptionStatus(x);
- } catch (CoreException x) {
- status= createExceptionStatus(x);
- } catch (RuntimeException x) {
- status= createExceptionStatus(x);
- }
-
- if(status != null) {
- Logger.log(status);
- }
- }
- }
-
- /**
- * @return the error message from the described {@link ICompletionProposalComputer}
- */
- public String getErrorMessage() {
- return fLastError;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fId + ": " + fName; //$NON-NLS-1$
- }
-
- /**
- * <p>Parses the given configuration element for its activation context,
- * that is to say the content types and partiton types and updates the registry
- * to associated the given computer descriptor with the parsed activation contexts.</P>
- *
- * <p>This is useful for parsing both <tt>proposalComputer</tt> elements and
- * <tt>proposalComputerExtendedActivation</tt> elements.</p>
- *
- * @param element {@link IConfigurationElement} containing the activation context
- * @param desc {@link CompletionProposalComputerDescriptor} to associate with the parsed activation context
- *
- * @throws InvalidRegistryObjectException
- * @throws CoreException
- */
- protected static void parseActivationAndAddToRegistry(IConfigurationElement element,
- CompletionProposalComputerDescriptor desc) throws InvalidRegistryObjectException, CoreException {
-
- /* if this descriptor is specific to a content type/s add it to the registry as such
- * else add to registry for all content types
- */
- IConfigurationElement[] contentTypes = element.getChildren(ELEM_CONTENT_TYPE);
- if(contentTypes.length > 0) {
- for(int contentTypeIndex = 0; contentTypeIndex < contentTypes.length; ++contentTypeIndex) {
- String contentTypeID = contentTypes[contentTypeIndex].getAttribute(ATTR_ID);
- ContentAssistUtils.checkExtensionAttributeNotNull(contentTypeID, ATTR_ID, contentTypes[contentTypeIndex]);
-
- /* if this descriptor is for specific partition types in the content type
- * add it to the registry as such
- * else add to the registry for all partition types in the content type
- */
- IConfigurationElement[] partitionTypes = contentTypes[contentTypeIndex].getChildren(ELEM_PARTITION_TYPE);
- if(partitionTypes.length > 0) {
- for (int partitionTypeIndex = 0; partitionTypeIndex < partitionTypes.length; ++partitionTypeIndex) {
- String partitionTypeID = partitionTypes[partitionTypeIndex].getAttribute(ATTR_ID);
- ContentAssistUtils.checkExtensionAttributeNotNull(partitionTypeID, ATTR_ID, partitionTypes[partitionTypeIndex]);
-
- CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, partitionTypeID, desc);
- CompletionProposalComputerRegistry.getDefault().putAutoActivator(contentTypeID, partitionTypeID, partitionTypes[partitionTypeIndex]);
- }
- } else {
- CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, null, desc);
- }
- }
- } else {
- Logger.log(Logger.WARNING, "The configuration element: " + element + " does not contain any content types."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @return <code>true</code> if the plugin that contains the {@link IConfigurationElement}
- * associated with this descriptor is loaded, <code>false</code> otherwise.
- */
- private boolean isPluginLoaded() {
- Bundle bundle= getBundle();
- return bundle != null && bundle.getState() == Bundle.ACTIVE;
- }
-
- /**
- * @return the {@link Bundle} that contains the {@link IConfigurationElement} associated
- * with this descriptor
- */
- private Bundle getBundle() {
- String namespace= fElement.getDeclaringExtension().getContributor().getName();
- Bundle bundle= Platform.getBundle(namespace);
- return bundle;
- }
-
- /**
- * <p>Returns a cached instance of the computer as described in the
- * extension's xml. If the computer is not yet created and
- * <code>canCreate</code> is <code>true</code> then {@link #createComputer()}
- * is called and the result cached.</p>
- *
- * @param canCreate <code>true</code> if the proposal computer can be created
- * @return a new instance of the completion proposal computer as
- * described by this descriptor
- *
- * @throws CoreException if the creation fails
- * @throws InvalidRegistryObjectException if the extension is not
- * valid any longer (e.g. due to plug-in unloading)
- */
- private synchronized ICompletionProposalComputer getComputer(boolean canCreate) throws CoreException, InvalidRegistryObjectException {
- if (fComputer == null && canCreate && !fTriedLoadingComputer && (fActivate || isPluginLoaded())) {
- fTriedLoadingComputer= true;
- fComputer= createComputer();
- }
- return fComputer;
- }
-
- /**
- * @return the enablement state of the category this describer is associated with
- */
- private boolean isEnabled() {
- return fCategory.isEnabled();
- }
-
- /**
- * <p>Starts the meter for measuring the computers performance</p>
- *
- * @param context
- * @param computer
- * @return
- */
- private PerformanceStats startMeter(Object context, ICompletionProposalComputer computer) {
- final PerformanceStats stats;
- if (MEASURE_PERFORMANCE) {
- stats= PerformanceStats.getStats(PERFORMANCE_EVENT, computer);
- stats.startRun(context.toString());
- } else {
- stats= null;
- }
-
- if (fIsReportingDelay) {
- fStart= System.currentTimeMillis();
- }
-
- return stats;
- }
-
- /**
- * <p>Stops the meter for measuring the computers performance</p>
- *
- * @param context
- * @param computer
- * @return
- */
- private void stopMeter(final PerformanceStats stats, String operation) {
- if (MEASURE_PERFORMANCE) {
- stats.endRun();
- if (stats.isFailure()) {
- IStatus status= createPerformanceStatus(operation);
- Logger.log(status);
- return;
- }
- }
-
- if (fIsReportingDelay) {
- long current= System.currentTimeMillis();
- if (current - fStart > MAX_DELAY) {
- IStatus status= createPerformanceStatus(operation);
- Logger.log(status);
- }
- }
- }
-
- /**
- * @return A message explaining that the described {@link ICompletionProposalComputer} failed in some way
- */
- private String createBlameMessage() {
- return "The ''" + getName() + "'' proposal computer from the ''" + //$NON-NLS-1$ //$NON-NLS-2$
- fElement.getDeclaringExtension().getContributor().getName() + "'' plug-in did not complete normally."; //$NON-NLS-1$
- }
-
- /**
- * <p>Create a status message describing that the extension has become invalid</p>
- *
- * @param x the associated {@link InvalidRegistryObjectException}
- * @return the created {@link IStatus}
- */
- private IStatus createExceptionStatus(InvalidRegistryObjectException x) {
- String blame= createBlameMessage();
- String reason= "The extension has become invalid."; //$NON-NLS-1$
- return new Status(IStatus.INFO, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
- }
-
- /**
- * <p>create a status message explaining that the extension could not be instantiated</p>
- *
- * @param x the associated {@link CoreException}
- * @return the created {@link IStatus}
- */
- private IStatus createExceptionStatus(CoreException x) {
- String blame = createBlameMessage();
- String reason = "Unable to instantiate the extension."; //$NON-NLS-1$
- return new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
- }
-
- /**
- * <p>Create a status message explaining the extension has thrown a runtime exception</p>
- *
- * @param x the associated {@link RuntimeException}
- * @return the created {@link IStatus}
- */
- private IStatus createExceptionStatus(RuntimeException x) {
- String blame= createBlameMessage();
- String reason= "The extension has thrown a runtime exception."; //$NON-NLS-1$
- return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
- }
-
- /**
- * <p>Create a status message explaining the extension has violated the API of the extension point</p>
- *
- * @param operation the operation that created the API violation
- * @return the created {@link IStatus}
- */
- private IStatus createAPIViolationStatus(String operation) {
- String blame = createBlameMessage();
- String reason = "The extension violated the API contract of the ''" + operation + "'' operation."; //$NON-NLS-1$ //$NON-NLS-2$
- return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, null); //$NON-NLS-1$
- }
-
- /**
- * <p>Create a status message explaining that the extension took to long during an operation</p>
- *
- * @param operation the operation that took to long
- * @return the created {@link IStatus}
- */
- private IStatus createPerformanceStatus(String operation) {
- String blame= createBlameMessage();
- String reason = "The extension took too long to return from the ''" + operation + "'' operation."; //$NON-NLS-1$ //$NON-NLS-2$
- return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, null); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java
deleted file mode 100644
index f3189a58a8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java
+++ /dev/null
@@ -1,559 +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.wst.sse.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-
-/**
- * <p>A registry for all extensions to the
- * <code>org.eclipse.wst.sse.ui.completionProposal</code>
- * extension point.</p>
- */
-public final class CompletionProposalComputerRegistry {
-
- /** The extension schema name of the extension point */
- private static final String EXTENSION_POINT = "completionProposal"; //$NON-NLS-1$
-
- /** The extension schema name of proposal category child elements. */
- private static final String ELEM_PROPOSAL_CATEGORY = "proposalCategory"; //$NON-NLS-1$
-
- /** The extension schema name of proposal computer child elements. */
- private static final String ELEM_PROPOSAL_COMPUTER = "proposalComputer"; //$NON-NLS-1$
-
- /** The extension schema name of proposal computer activation child elements. */
- private static final String ELEM_PROPOSAL_COMPUTER_EXTENDED_ACTIVATION = "proposalComputerExtendedActivation"; //$NON-NLS-1$
-
- /** The extension schema name for element ID attributes */
- private static final String ATTR_ID= "id"; //$NON-NLS-1$
-
- /** The extension schema name for the partition's auto-activation class */
- private static final String ATTR_AUTO_ACTIVATION_CLASS = "autoActivationDelegate"; //$NON-NLS-1$
-
- /** preference key to keep track of the last known number of content assist computers */
- private static final String NUM_COMPUTERS_PREF_KEY = "content_assist_number_of_computers"; //$NON-NLS-1$
-
- /**
- * A fake partition type ID stating used to say a {@link CompletionProposalComputerDescriptor} should
- * be associated with all partition types in a given content type.
- */
- private static final String ALL_PARTITION_TYPES_ID = "all_partition_types_fake_ID"; //$NON-NLS-1$
-
- /** State where in the registry has not yet been loaded */
- private static final byte NONE = 0;
-
- /** State where the registry is being initialized */
- private static final byte INITIALIZING = 1;
-
- /** State where in the registry is currently being loaded */
- private static final byte LOADING = 2;
-
- /** State where in the registry has been loaded */
- private static final byte LOADED = 3;
-
- /** The singleton instance. */
- private static CompletionProposalComputerRegistry fgSingleton= null;
-
- /**
- * @return the singleton instance of the registry
- */
- public static synchronized CompletionProposalComputerRegistry getDefault() {
- if (fgSingleton == null) {
- fgSingleton= new CompletionProposalComputerRegistry();
- }
-
- return fgSingleton;
- }
-
- /**
- * <code>{@link Map}&lt{@link String}, {@link CompletionProposalContentTypeContext}&gt</code>
- * <ul>
- * <li><b>key:</b> content type ID</li>
- * <li><b>value:</b> the context for the associated content type ID</li>
- * <ul>
- */
- private final Map fActivationContexts;
-
- /**
- * <code>{@link Map}&lt{@link String}, {@link CompletionProposalComputerDescriptor}&gt</code>
- * <ul>
- * <li><b>key:</b> descriptor ID</li>
- * <li><b>value:</b> descriptor</li>
- * <ul>
- */
- private final Map fDescriptors = new HashMap();
-
- /** A map maintaining the relationship between content types, partition types and their associated {@link AutoActivationDelegate}s*/
- private Map fAutoActivators = new HashMap();
-
- /** The {@link CompletionProposalCategory}s tracked by this registry */
- private final List fCategories = new ArrayList();
-
- /** Unmodifiable public list of the {@link CompletionProposalCategory}s tracked by this registry */
- private final List fPublicCategories = Collections.unmodifiableList(fCategories);
-
- /**
- * <p>The current state of the registry</p>
- *
- * @see #NONE
- * @see #LOADING
- * @see #LOADED
- */
- private byte fState;
-
- /**
- * Lock that is held while loading, operations waiting for
- * load to finish can lock on this as well
- */
- private final Object fLoadingLock;
-
- /** <code>true</code> if computers have been uninstalled since last load */
- private boolean fHasUninstalledComputers= false;
-
- /**
- * Creates a new instance.
- */
- private CompletionProposalComputerRegistry() {
- this.fActivationContexts = new HashMap();
- this.fState = CompletionProposalComputerRegistry.NONE;
- this.fLoadingLock = new Object();
- }
-
- /**
- * <p>Calling this when the registry has not yet been loaded will start a
- * {@link Thread} to start loading the registry. All other operations on
- * the registry will be blocked until the loading has completed. If
- * the registry has already been loaded or is loading then this
- * method does nothing.</p>
- */
- public synchronized void initialize() {
- if(fState == CompletionProposalComputerRegistry.NONE) {
- fState = CompletionProposalComputerRegistry.INITIALIZING;
- new Thread() {
- public void run() {
- CompletionProposalComputerRegistry.this.load();
- }
- }.start();
- }
- }
-
- /**
- * <p><b>NOTE: </b>The returned list is read-only and is sorted in the order that the
- * extensions were read in. There are no duplicate elements in the returned list.
- * The returned list may change if plug-ins are loaded or unloaded while the
- * application is running.</p>
- *
- * @return the list of proposal categories contributed to the
- * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point (element type:
- * {@link CompletionProposalCategory})
- */
- public List getProposalCategories() {
- internalEnsureLoaded();
- return fPublicCategories;
- }
-
- /**
- * <p><b>NOTE: </b>The returned list is read-only and is sorted in the order that the
- * extensions were read in. There are no duplicate elements in the returned list.
- * The returned list may change if plug-ins are loaded or unloaded while the
- * application is running.</p>
- *
- * @param contentTypeID get the {@link CompletionProposalCategory}s associated with this ID
- * @return the {@link CompletionProposalCategory}s associated with the given content type ID
- */
- public List getProposalCategories(String contentTypeID) {
- internalEnsureLoaded();
- List result = new ArrayList();
- for(int i = 0; i < fCategories.size(); ++i) {
- CompletionProposalCategory category = ((CompletionProposalCategory)fCategories.get(i));
- if(category.hasComputers(contentTypeID)) {
- result.add(category);
- }
- }
-
- return Collections.unmodifiableList(result);
- }
-
- /**
- * @return <code>true</code> if the registry detected that computers got uninstalled since the last run
- * <code>false</code> otherwise or if {@link #resetUnistalledComputers()} has been called
- */
- public boolean hasUninstalledComputers() {
- return fHasUninstalledComputers;
- }
-
- /**
- * <p>Clears the setting that uninstalled computers have been detected.
- * This setting is used to decide weather a helpful message should be
- * displayed to the user</p>
- */
- public void resetUnistalledComputers() {
- fHasUninstalledComputers = false;
- }
-
- /**
- * <p>Adds the given {@link CompletionProposalComputerDescriptor} to the registry.</p>
- *
- * @param contentTypeID the ID of the content type to associated the descriptor with
- * @param partitionTypeID the ID of the partition type in the content type to associate
- * the descriptor with, or <code>null</code> to associate with all partition types in
- * the content type.
- * @param descriptor the {@link CompletionProposalComputerDescriptor} to associate with
- * the given content type and partition type
- */
- void putDescription(String contentTypeID, String partitionTypeID,
- CompletionProposalComputerDescriptor descriptor) {
-
- if(partitionTypeID == null) {
- partitionTypeID = ALL_PARTITION_TYPES_ID;
- }
-
- CompletionProposalContentTypeContext context = getContext(contentTypeID);
- context.putDescriptor(partitionTypeID, descriptor);
- }
-
- void putAutoActivator(String contentTypeID, String partitionTypeID, IConfigurationElement element) {
- String autoActivationClass = element.getAttribute(ATTR_AUTO_ACTIVATION_CLASS);
- if (autoActivationClass == null)
- return;
-
- Map partitionMap = (Map) fAutoActivators.get(contentTypeID);
- if (partitionMap == null) {
- partitionMap = new HashMap();
- fAutoActivators.put(contentTypeID, partitionMap);
- }
- partitionMap.put(partitionTypeID, new Activator(element));
- }
-
- public AutoActivationDelegate getActivator(String contentTypeID, String partitionTypeID) {
- Map partitionMap = (Map) fAutoActivators.get(contentTypeID);
- if (partitionMap != null) {
- Activator activator = (Activator) partitionMap.get(partitionTypeID);
- if (activator != null) {
- return activator.createAutoActivation();
- }
- }
- return null;
- }
-
- /**
- * @param contentTypeID get only descriptors associated with this content type
- * @param partitionTypeID get only descriptors associated with this partition type as well
- * as describers associated with any partition type in the given content type
- * @return all of the {@link CompletionProposalComputerDescriptor}s associated with the
- * given content type and partition type (including any describers associated with all
- * partition types in the given content type)
- */
- List getProposalComputerDescriptors(String contentTypeID, String partitionTypeID) {
- internalEnsureLoaded();
-
- Set descriptorsSet = new HashSet();
- List contexts = this.getContexts(contentTypeID);
- for(int i = 0; i < contexts.size(); ++i) {
- CompletionProposalContentTypeContext contentSpecificContext =
- (CompletionProposalContentTypeContext)contexts.get(i);
-
- //add all descriptors specific to the given content type and the given partition type
- descriptorsSet.addAll(contentSpecificContext.getDescriptors(partitionTypeID));
-
- //add all descriptors specific to the given content type but not specific to a partition type
- descriptorsSet.addAll(contentSpecificContext.getDescriptors(ALL_PARTITION_TYPES_ID));
- }
-
- List descriptors = new ArrayList(descriptorsSet);
- return descriptors != null ? Collections.unmodifiableList(descriptors) : Collections.EMPTY_LIST;
- }
-
- /**
- * @param contentTypeID get only descriptors associated with this content type
- * @return all of the {@link CompletionProposalComputerDescriptor}s associated with the
- * given content type
- */
- List getProposalComputerDescriptors(String contentTypeID) {
- internalEnsureLoaded();
-
- Set descriptorsSet = new HashSet();
-
- List contexts = this.getContexts(contentTypeID);
- for(int i = 0; i < contexts.size(); ++i) {
- CompletionProposalContentTypeContext contentSpecificContext =
- (CompletionProposalContentTypeContext)contexts.get(i);
-
- //add all descriptors specific to the given content type
- descriptorsSet.addAll(contentSpecificContext.getDescriptors());
- }
-
- List descriptors = new ArrayList(descriptorsSet);
- return descriptors != null ? Collections.unmodifiableList(descriptors) : Collections.EMPTY_LIST;
- }
-
- /**
- * @return Unmodifiable list of all of the {@link CompletionProposalComputerDescriptor}s associated with
- * this registry
- */
- List getProposalComputerDescriptors() {
- internalEnsureLoaded();
- return Collections.unmodifiableList( new ArrayList(fDescriptors.values()));
- }
-
- /**
- * <p>This method performs differently depending on the state of the registry</p>
- * <ul>
- * <li>{@link #NONE} - forces the registry to load now on the current thread</li>
- * <li>{@link #LOADING} - blocks until the registry has finished loading on
- * whichever thread it is being loaded on</li>
- * <li>{@link #LOADED} - immediately returns</li>
- * </ul>
- */
- private void internalEnsureLoaded() {
- switch (fState) {
- case CompletionProposalComputerRegistry.NONE:
- case CompletionProposalComputerRegistry.INITIALIZING: {
- load();
- break;
- }
- case CompletionProposalComputerRegistry.LOADING: {
- //as soon as this lock is released the loading process is done
- synchronized (fLoadingLock) {
- //sanity check
- Assert.isTrue(fState == CompletionProposalComputerRegistry.LOADED,
- "The state of the registry should be guaranteed to be LOADED " + //$NON-NLS-1$
- " once the loading lock has been released."); //$NON-NLS-1$
- }
- break;
- }
- }
- }
-
- /**
- * <p>Loads the completion proposal extension points if they
- * have not been loaded already</p>
- */
- private void load() {
- /* hold this lock while loading, others waiting for load to
- * finish can synchronize on this lock to be guaranteed the load
- * will be done when the lock is released
- */
- synchronized (fLoadingLock) {
- if(fState == CompletionProposalComputerRegistry.NONE || fState == CompletionProposalComputerRegistry.INITIALIZING) {
- //update the state
- fState = CompletionProposalComputerRegistry.LOADING;
-
- IExtensionRegistry registry= Platform.getExtensionRegistry();
- List extensionElements= new ArrayList(Arrays.asList(registry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT)));
-
- Map loadedDescriptors = new HashMap();
- List extendedComputerActivations = new ArrayList();
-
- //get the categories and remove them from the extension elements
- List categories= getCategories(extensionElements);
-
- //deal with the proposal computers and set aside the proposal computer activation extensions
- for (Iterator iter= extensionElements.iterator(); iter.hasNext();) {
- IConfigurationElement element= (IConfigurationElement) iter.next();
- try {
- if (element.getName().equals(ELEM_PROPOSAL_COMPUTER)) {
- //create the descriptor and add it to the registry
- CompletionProposalComputerDescriptor desc = new CompletionProposalComputerDescriptor(element, categories);
- desc.addToRegistry();
- loadedDescriptors.put(desc.getId(), desc);
- } else if(element.getName().equals(ELEM_PROPOSAL_COMPUTER_EXTENDED_ACTIVATION)) {
- extendedComputerActivations.add(element);
- }
-
- } catch (InvalidRegistryObjectException x) {
- /*
- * Element is not valid any longer as the contributing plug-in was unloaded or for
- * some other reason. Do not include the extension in the list and log it
- */
- String message = "The extension ''" + element.toString() + "'' is invalid."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
- Logger.log(status);
- } catch (CoreException x) {
- Logger.log(x.getStatus());
- }
- }
-
- //deal with extended computer activations
- for(int i = 0; i < extendedComputerActivations.size(); ++i) {
- IConfigurationElement element = (IConfigurationElement)extendedComputerActivations.get(i);
- String proposalComputerID = element.getAttribute(ATTR_ID);
- CompletionProposalComputerDescriptor descriptor =
- (CompletionProposalComputerDescriptor)loadedDescriptors.get(proposalComputerID);
- if(descriptor != null) {
- try {
- //add the extra activation contexts to the registry
- CompletionProposalComputerDescriptor.parseActivationAndAddToRegistry(element, descriptor);
- } catch (InvalidRegistryObjectException x) {
- /*
- * Element is not valid any longer as the contributing plug-in was unloaded or for
- * some other reason. Do not include the extension in the list and log it
- */
- String message = "The extension ''" + element.toString() + "'' is invalid."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
- Logger.log(status);
- } catch (CoreException x) {
- Logger.log(x.getStatus());
- }
-
- } else {
- //activation extension has invalid computer ID
- Logger.log(Logger.WARNING, "Configuration element " + element + //$NON-NLS-1$
- " intented to extend an existing completion proposal computer" + //$NON-NLS-1$
- " specified an invalid completion proposal computer ID " + //$NON-NLS-1$
- proposalComputerID);
- }
- }
-
- fCategories.clear();
- fCategories.addAll(categories);
-
- fDescriptors.clear();
- fDescriptors.putAll(loadedDescriptors);
-
- updateUninstalledComputerCount();
-
- //update the state
- fState = CompletionProposalComputerRegistry.LOADED;
- }
- }
- }
-
- /**
- * <p>Updates the uninstalled computer count</p>
- */
- private void updateUninstalledComputerCount() {
- IPreferenceStore preferenceStore = SSEUIPlugin.getDefault().getPreferenceStore();
- int lastNumberOfComputers= preferenceStore.getInt(NUM_COMPUTERS_PREF_KEY);
- int currNumber= fDescriptors.size();
- fHasUninstalledComputers= lastNumberOfComputers > currNumber;
- preferenceStore.putValue(NUM_COMPUTERS_PREF_KEY, Integer.toString(currNumber));
- }
-
- /**
- * <p>Configures the categories found in the given {@link IConfigurationElement}s
- * and removes them from the given list.</p>
- *
- * @param extensionElements {@link IConfigurationElement}s that include proposal
- * category extensions
- * @return {@link CompletionProposalCategory}s created from the given
- * {@link IConfigurationElement}s that defined new proposal categories.
- */
- private List getCategories(List extensionElements) {
- List categories= new ArrayList();
- for (Iterator iter= extensionElements.iterator(); iter.hasNext();) {
- IConfigurationElement element= (IConfigurationElement) iter.next();
- try {
- if (element.getName().equals(ELEM_PROPOSAL_CATEGORY)) {
- iter.remove(); // remove from list to leave only computers
-
- CompletionProposalCategory category= new CompletionProposalCategory(element);
- categories.add(category);
- }
- } catch (InvalidRegistryObjectException x) {
- /* Element is not valid any longer as the contributing plug-in was unloaded or for
- * some other reason. Do not include the extension in the list and log it
- */
- String message = "The extension ''" + element.toString() + "'' has become invalid."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
- Logger.log(status);
- } catch (CoreException x) {
- Logger.log(x.getStatus());
- }
- }
-
- return categories;
- }
-
- /**
- * <p>Gets the {@link CompletionProposalContentTypeContext} associated with the given content type,
- * if one does not already exist then one is created</p>
- *
- * @param contentTypeID get the {@link CompletionProposalContentTypeContext} associated with this content type
- * @return the existing or new {@link CompletionProposalContentTypeContext} associated with the given content type
- */
- private CompletionProposalContentTypeContext getContext(String contentTypeID) {
- CompletionProposalContentTypeContext context = (CompletionProposalContentTypeContext)this.fActivationContexts.get(contentTypeID);
- if(context == null) {
- context = new CompletionProposalContentTypeContext(contentTypeID);
- this.fActivationContexts.put(contentTypeID, context);
- }
-
- return context;
- }
-
- /**
- * <p>Gets all of the {@link CompletionProposalContentTypeContext}s associated with
- * the given content type ID. A context is considered associated if its associated content type ID
- * is either the given content type ID or is a base content type ID of the given content type ID.</p>
- *
- * @param contentTypeID get the contexts for this content type ID
- * @return {@link List} of {@link CompletionProposalContentTypeContext}s associated with the given
- * content type ID
- */
- private List getContexts(String contentTypeID) {
- List contexts = new ArrayList();
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-
- while(contentType != null) {
- Object context = this.fActivationContexts.get(contentType.getId());
- if(context != null) {
- contexts.add(context);
- }
-
- contentType = contentType.getBaseType();
- }
-
- return contexts;
- }
-
- private static class Activator {
- IConfigurationElement fElement;
-
- public Activator(IConfigurationElement element) {
- fElement = element;
- }
-
- AutoActivationDelegate createAutoActivation() {
- AutoActivationDelegate activation = null;
- if (fElement != null) {
- try {
- activation = (AutoActivationDelegate) fElement.createExecutableExtension(ATTR_AUTO_ACTIVATION_CLASS);
- } catch (CoreException e) {
- }
- }
- return activation;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java
deleted file mode 100644
index 75ffdf0d4e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java
+++ /dev/null
@@ -1,147 +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.wst.sse.ui.internal.contentassist;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * <p>There should be one context for each content type. It keeps track
- * of the describers associated with different partition types for its unique
- * content type.</p>
- */
-public class CompletionProposalContentTypeContext {
-
- /** the content type this context is associated with */
- private final String fContentTypeID;
-
- /**
- *
- * <code>{@link Map}&lt{@link String}, {@link Set}&lt{@link CompletionProposalComputerDescriptor}&gt&gt</code>
- * <ul>
- * <li><b>key:</b> partition type ID</li>
- * <li><b>value:</b> {@link Set} of associated computer descriptors</li>
- * </ul>
- */
- private Map fPartitionTypesToDescriptors;
-
- /**
- * <p>Create a new context for the given content type ID.</p>
- * <p>There should only ever be one context for any unique content type</p>
- * @param contentTypeID the content type this context is for
- */
- public CompletionProposalContentTypeContext(String contentTypeID) {
- this.fContentTypeID = contentTypeID;
- this.fPartitionTypesToDescriptors = new HashMap();
- }
-
- /**
- * <p>Adds a describer to this context for a given partition type. There
- * can be more then one describer for one partition type.</p>
- *
- * @param partitionTypeID the partition type to associate the given descriptor with
- * @param descriptor {@link CompletionProposalComputerDescriptor} to associate with the given
- * partition type in this context
- */
- public void putDescriptor(String partitionTypeID, CompletionProposalComputerDescriptor descriptor) {
- Set descriptors = (Set)this.fPartitionTypesToDescriptors.get(partitionTypeID);
- if(descriptors != null) {
- descriptors.add(descriptor);
- } else {
- descriptors = new HashSet();
- descriptors.add(descriptor);
- this.fPartitionTypesToDescriptors.put(partitionTypeID, descriptors);
- }
- }
-
- /**
- * @return All of the {@link CompletionProposalComputerDescriptor}s associated with
- * any partition type in this context
- */
- public Set getDescriptors() {
- Set allDescriptors = new HashSet();
- Collection descriptorSets = this.fPartitionTypesToDescriptors.values();
- Iterator iter = descriptorSets.iterator();
- while(iter.hasNext()) {
- Set descriptorSet = (Set)iter.next();
- allDescriptors.addAll(descriptorSet);
- }
-
- return Collections.unmodifiableSet(allDescriptors);
- }
-
- /**
- * @param partitionTypeID get {@link CompletionProposalComputerDescriptor}s for only this partition type
- * for this context
- * @return {@link CompletionProposalComputerDescriptor}s assoicated with the given partition type
- * in this context
- */
- public Set getDescriptors(String partitionTypeID) {
- Set descriptors = (Set)this.fPartitionTypesToDescriptors.get(partitionTypeID);
- return descriptors != null ? Collections.unmodifiableSet(descriptors) : Collections.EMPTY_SET;
- }
-
- /**
- * @return the content type this context is for
- */
- public String getContentTypeID() {
- return fContentTypeID;
- }
-
- /**
- * @return the hash code of the content type ID
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fContentTypeID.hashCode();
- }
-
- /**
- * <p>Two {@link CompletionProposalContentTypeContext} are equal if they have the
- * same content type ID.</p>
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- boolean equal = false;
- if(obj instanceof CompletionProposalContentTypeContext) {
- equal = this.fContentTypeID.equals(((CompletionProposalContentTypeContext)obj).fContentTypeID);
- }
-
- return equal;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buff = new StringBuffer(this.fContentTypeID);
- Set partitions = this.fPartitionTypesToDescriptors.keySet();
- Iterator partitionsIter = partitions.iterator();
- while(partitionsIter.hasNext()) {
- String partitionType = (String)partitionsIter.next();
- buff.append("\n\t" + partitionType); //$NON-NLS-1$
- List descriptors = (List)this.fPartitionTypesToDescriptors.get(partitionType);
- for(int i = 0; i < descriptors.size(); ++i) {
- buff.append("\n\t\t" + descriptors.get(i).toString()); //$NON-NLS-1$
- }
- }
-
- return buff.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java
deleted file mode 100644
index a84944a4a5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java
+++ /dev/null
@@ -1,175 +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.wst.sse.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-
-/**
- * <p>A registry for all extensions to the
- * <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
- * extension point.</p>
- */
-public final class CompletionProposoalCatigoriesConfigurationRegistry {
- /** The extension schema name of the extension point */
- private static final String EXTENSION_POINT = "completionProposalCategoriesConfiguration"; //$NON-NLS-1$
-
- /** The extension schema name of categories properties child elements */
- private static final String ELEM_CATEGORIES_PROPERTIES = "categoriesConfiguration"; //$NON-NLS-1$
-
- /** The extension schema name of the content type id attribute */
- private static final String ATTR_CONTENT_TYPE_ID = "contentTypeID"; //$NON-NLS-1$
-
- /** The extension schema name of the class attribute */
- private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
- /** The singleton instance. */
- private static CompletionProposoalCatigoriesConfigurationRegistry fgSingleton = null;
-
- /** <code>true</code> if this registry has been loaded. */
- private boolean fLoaded;
-
- /**
- * <code>{@link Map}<{@link String}, {@link ICompletionProposalCategoriesConfigurationReader}></code>
- * <ul>
- * <li><b>key:</b> Content Type ID</li>
- * <li><b>value:</b> Categories Properties</li>
- */
- private Map fPropertiesByContentTypeID;
-
- /**
- * @return the singleton instance of this registry
- */
- public static synchronized CompletionProposoalCatigoriesConfigurationRegistry getDefault() {
- if (fgSingleton == null) {
- fgSingleton = new CompletionProposoalCatigoriesConfigurationRegistry();
- }
-
- return fgSingleton;
- }
-
- /**
- * Private constructor to create singleton instance
- */
- private CompletionProposoalCatigoriesConfigurationRegistry() {
- this.fLoaded = false;
- this.fPropertiesByContentTypeID = new HashMap();
- }
-
- /**
- * @param contentTypeID get the {@link ICompletionProposalCategoriesConfigurationReader} associated
- * with the given content type
- * @return the {@link ICompletionProposalCategoriesConfigurationReader} associated
- * with the given content type, or <code>null</code> if one does not exist.
- */
- public ICompletionProposalCategoriesConfigurationReader getReadableConfiguration(String contentTypeID) {
- this.ensureLoaded();
- return (ICompletionProposalCategoriesConfigurationReader)this.fPropertiesByContentTypeID.get(contentTypeID);
- }
-
- /**
- * @param contentTypeID get the {@link ICompletionProposalCategoriesConfigurationWriter} associated
- * with the given content type
- * @return the {@link ICompletionProposalCategoriesConfigurationWriter} associated
- * with the given content type, or <code>null</code> if one does not exist.
- */
- public ICompletionProposalCategoriesConfigurationWriter getWritableConfiguration(String contentTypeID) {
- this.ensureLoaded();
-
- ICompletionProposalCategoriesConfigurationReader reader = getReadableConfiguration(contentTypeID);
- ICompletionProposalCategoriesConfigurationWriter writer = null;
- if(reader instanceof ICompletionProposalCategoriesConfigurationWriter) {
- writer = (ICompletionProposalCategoriesConfigurationWriter)reader;
- }
-
- return writer;
- }
-
- /**
- * Ensures the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
- * extensions have been loaded
- */
- private void ensureLoaded() {
- if(!this.fLoaded) {
- this.load();
- this.fLoaded = true;
- }
- }
-
- /**
- * Loads the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code> extensions
- */
- private void load() {
- //get the extensions
- IExtensionRegistry registry= Platform.getExtensionRegistry();
- List extensionElements= new ArrayList(Arrays.asList(registry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT)));
-
- //for each element get its attributes and add it to the map of properties
- Iterator elementsIter = extensionElements.iterator();
- while(elementsIter.hasNext()) {
- IConfigurationElement element = (IConfigurationElement)elementsIter.next();
-
- try {
- if(element.getName().equals(ELEM_CATEGORIES_PROPERTIES)) {
- String contentTypeID = element.getAttribute(ATTR_CONTENT_TYPE_ID);
- ContentAssistUtils.checkExtensionAttributeNotNull(contentTypeID, ATTR_CONTENT_TYPE_ID, element);
-
- String pageClass = element.getAttribute(ATTR_CLASS);
- ContentAssistUtils.checkExtensionAttributeNotNull(pageClass, ATTR_CLASS, element);
-
- ICompletionProposalCategoriesConfigurationReader props =
- (ICompletionProposalCategoriesConfigurationReader)element.createExecutableExtension(ATTR_CLASS);
-
- if(!this.fPropertiesByContentTypeID.containsKey(contentTypeID)){
- this.fPropertiesByContentTypeID.put(contentTypeID, props);
- } else {
- Logger.log(Logger.ERROR, "Extension " + element.getDeclaringExtension() + //$NON-NLS-1$
- " is attempting to to define itself as the proposal cateigories" + //$NON-NLS-1$
- " configuration for content type " + contentTypeID + " when another" + //$NON-NLS-1$ //$NON-NLS-2$
- " extensions has already done so."); //$NON-NLS-1$
- }
- } else {
- //extension specified element that is not valid for this extension
- Logger.log(Logger.WARNING, "The element " + element + " is not valid for the" + //$NON-NLS-1$ //$NON-NLS-2$
- "org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration" + //$NON-NLS-1$
- " extension point. Only " + ELEM_CATEGORIES_PROPERTIES + //$NON-NLS-1$
- " elements are valid."); //$NON-NLS-1$
- }
- } catch (InvalidRegistryObjectException x) {
- /*
- * Element is not valid any longer as the contributing plug-in was unloaded
- * or for some other reason.
- */
- String message = "The extension ''" + element.toString() + "'' has become invalid."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
- Logger.log(status);
- } catch (CoreException x) {
- Logger.log(x.getStatus());
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
deleted file mode 100644
index 7e89b4395e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
+++ /dev/null
@@ -1,570 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
-import org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor;
-import org.eclipse.jface.contentassist.ISubjectControlContextInformationPresenter;
-import org.eclipse.jface.contentassist.ISubjectControlContextInformationValidator;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextPresentation;
-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.IContextInformationExtension;
-import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * <p>A processor that aggregates the proposals of multiple other processors.
- * When proposals are requested, the contained processors are queried in the
- * order they were added to the compound object. Copied from
- * org.eclipse.jdt.internal.ui.text.CompoundContentAssistProcessor.
- * Modification was made to add a dispose() method.</p>
- */
-public class CompoundContentAssistProcessor implements IContentAssistProcessor, ISubjectControlContentAssistProcessor, IReleasable {
-
- /** the compound processors */
- private final Set fProcessors = new LinkedHashSet();
-
- /** Aggregated error message from the compound processors */
- private String fErrorMessage;
-
- /**
- * Creates a new instance.
- */
- public CompoundContentAssistProcessor() {
- }
-
- /**
- * Creates a new instance with one child processor.
- *
- * @param processor
- * the processor to add
- */
- public CompoundContentAssistProcessor(IContentAssistProcessor processor) {
- add(processor);
- }
-
- /**
- * Adds a processor to this compound processor.
- *
- * @param processor
- * the processor to add
- */
- public void add(IContentAssistProcessor processor) {
- Assert.isNotNull(processor);
- fProcessors.add(processor);
- }
-
- /**
- * @param processor check to see if this {@link IContentAssistProcessor} is one
- * in this compound processor.
- *
- * @return <code>true</code> if this compound processor contains the given processor,
- * <code>false</code> otherwise
- */
- public boolean containsProcessor(IContentAssistProcessor processor) {
- return fProcessors.contains(processor);
- }
-
- /**
- * Removes a processor from this compound processor.
- *
- * @param processor
- * the processor to remove
- */
- public void remove(IContentAssistProcessor processor) {
- fProcessors.remove(processor);
- }
-
- /**
- * Creates a new instance and adds all specified processors.
- *
- * @param processors
- */
- public CompoundContentAssistProcessor(IContentAssistProcessor[] processors) {
- for (int i = 0; i < processors.length; i++) {
- add(processors[i]);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- fErrorMessage = null;
- List ret = new LinkedList();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- try {
- // isolate calls to each processor
- ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
- if (proposals != null && proposals.length > 0) {
- ret.addAll(Arrays.asList(proposals));
- fErrorMessage = null; // Hide previous errors
- }
- else {
- if (fErrorMessage == null && ret.isEmpty()) {
- String errorMessage = p.getErrorMessage();
- if (errorMessage != null) {
- fErrorMessage = errorMessage;
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
- return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * The returned objects are wrapper objects around the real information
- * containers.
- * </p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- fErrorMessage = null;
- List ret = new LinkedList();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- IContextInformation[] informations = p.computeContextInformation(viewer, documentOffset);
- if (informations != null && informations.length > 0) {
- for (int i = 0; i < informations.length; i++)
- ret.add(new WrappedContextInformation(informations[i], p));
- fErrorMessage = null; // Hide previous errors
- } else {
- if (fErrorMessage == null && ret.isEmpty()) {
- String errorMessage = p.getErrorMessage();
- if (errorMessage != null) {
- fErrorMessage = errorMessage;
- }
- }
- }
- }
- return (IContextInformation[]) ret.toArray(new IContextInformation[ret.size()]);
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- Set ret = new LinkedHashSet();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- char[] chars = p.getCompletionProposalAutoActivationCharacters();
- if (chars != null)
- for (int i = 0; i < chars.length; i++)
- ret.add(new Character(chars[i]));
- }
-
- char[] chars = new char[ret.size()];
- int i = 0;
- for (Iterator it = ret.iterator(); it.hasNext(); i++) {
- Character ch = (Character) it.next();
- chars[i] = ch.charValue();
- }
- return chars;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- Set ret = new LinkedHashSet();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- char[] chars = p.getContextInformationAutoActivationCharacters();
- if (chars != null)
- for (int i = 0; i < chars.length; i++)
- ret.add(new Character(chars[i]));
- }
-
- char[] chars = new char[ret.size()];
- int i = 0;
- for (Iterator it = ret.iterator(); it.hasNext(); i++) {
- Character ch = (Character) it.next();
- chars[i] = ch.charValue();
- }
- return chars;
- }
-
- /**
- * Returns the error message of one of
- * contained processor if any, or <code>null</code> if no processor has an
- * error message.
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- * @return {@inheritDoc}
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * The returned validator is a wrapper around the validators provided by
- * the child processors.
- * </p>
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- boolean hasValidator = false;
- boolean hasPresenter = false;
- boolean hasExtension = false;
-
- Iterator itp = fProcessors.iterator();
- while (itp.hasNext() && (!hasPresenter || !hasExtension)) {
- IContentAssistProcessor p = (IContentAssistProcessor) itp.next();
- IContextInformationValidator v = p.getContextInformationValidator();
- if (v != null) {
- hasValidator = true;
- if (v instanceof IContextInformationPresenter) {
- hasPresenter = true;
- }
- if (v instanceof ISubjectControlContextInformationPresenter || v instanceof ISubjectControlContextInformationValidator) {
- hasExtension = true;
- }
- }
- }
-
- CompoundContentAssistValidator validator = null;
- if (hasPresenter && hasExtension)
- validator = new CompoundContentAssistValidatorPresenterEx();
- else if (hasPresenter)
- validator = new CompoundContentAssistValidatorPresenter();
- else if (hasExtension)
- validator = new CompoundContentAssistValidatorEx();
- else if (hasValidator)
- validator = new CompoundContentAssistValidator();
-
- if (validator != null)
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- IContextInformationValidator v = p.getContextInformationValidator();
- if (v != null)
- validator.add(v);
- }
-
- return validator;
- }
-
- /*
- * @see ISubjectControlContentAssistProcessor#computeCompletionProposals(IContentAssistSubjectControl,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
- fErrorMessage = null;
- List ret = new LinkedList();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- Object o = it.next();
- if (o instanceof ISubjectControlContentAssistProcessor) {
- ISubjectControlContentAssistProcessor p = (ISubjectControlContentAssistProcessor) o;
- ICompletionProposal[] proposals = p.computeCompletionProposals(contentAssistSubjectControl, documentOffset);
- if (proposals != null && proposals.length > 0) {
- ret.addAll(Arrays.asList(proposals));
- fErrorMessage = null; // Hide previous errors
- } else {
- if (fErrorMessage == null && ret.isEmpty()) {
- String errorMessage = p.getErrorMessage();
- if (errorMessage != null) {
- fErrorMessage = errorMessage;
- }
- }
- }
- }
- }
-
- return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * The returned objects are wrapper objects around the real information
- * containers.
- * </p>
- *
- * @see org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.contentassist.IContentAssistSubject,
- * int)
- */
- public IContextInformation[] computeContextInformation(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
- fErrorMessage = null;
- List ret = new LinkedList();
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- Object o = it.next();
- if (o instanceof ISubjectControlContentAssistProcessor) {
- ISubjectControlContentAssistProcessor p = (ISubjectControlContentAssistProcessor) o;
- IContextInformation[] informations = p.computeContextInformation(contentAssistSubjectControl, documentOffset);
- if (informations != null && informations.length > 0) {
- for (int i = 0; i < informations.length; i++)
- ret.add(new WrappedContextInformation(informations[i], p));
- fErrorMessage = null; // Hide previous errors
- } else {
- if (fErrorMessage == null && ret.isEmpty()) {
- String errorMessage = p.getErrorMessage();
- if (errorMessage != null) {
- fErrorMessage = errorMessage;
- }
- }
- }
- }
- }
- return (IContextInformation[]) ret.toArray(new IContextInformation[ret.size()]);
- }
-
- /**
- * Dispose of any content assist processors that need disposing
- * @deprecated use {@link #release()}
- */
- public void dispose() {
- this.release();
- }
-
- public void install(ITextViewer viewer) {
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- if (p instanceof StructuredContentAssistProcessor) {
- ((StructuredContentAssistProcessor) p).install(viewer);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
- */
- public void release() {
- // go through list of content assist processors and dispose
- for (Iterator it = fProcessors.iterator(); it.hasNext();) {
- IContentAssistProcessor p = (IContentAssistProcessor) it.next();
- if (p instanceof IReleasable) {
- ((IReleasable) p).release();
- }
- }
- }
-
- private static class WrappedContextInformation implements IContextInformation, IContextInformationExtension {
- private IContextInformation fInfo;
- private IContentAssistProcessor fProcessor;
-
- WrappedContextInformation(IContextInformation info, IContentAssistProcessor processor) {
- fInfo = info;
- fProcessor = processor;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return fInfo.equals(obj);
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
- */
- public String getContextDisplayString() {
- return fInfo.getContextDisplayString();
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
- */
- public Image getImage() {
- return fInfo.getImage();
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
- */
- public String getInformationDisplayString() {
- return fInfo.getInformationDisplayString();
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fInfo.hashCode();
- }
-
- /*
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fInfo.toString();
- }
-
- IContentAssistProcessor getProcessor() {
- return fProcessor;
- }
-
- IContextInformation getContextInformation() {
- return fInfo;
- }
-
- public int getContextInformationPosition() {
- int position = -1;
- if (fInfo instanceof IContextInformationExtension)
- position = ((IContextInformationExtension)fInfo).getContextInformationPosition();
- return position;
- }
- }
-
- private static class CompoundContentAssistValidator implements IContextInformationValidator {
- List fValidators = new ArrayList();
- IContextInformationValidator fValidator;
-
- void add(IContextInformationValidator validator) {
- fValidators.add(validator);
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
- * org.eclipse.jface.text.ITextViewer, int)
- */
- public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
- // install either the validator in the info, or all validators
- fValidator = getValidator(info);
- IContextInformation realInfo = getContextInformation(info);
- if (fValidator != null)
- fValidator.install(realInfo, viewer, documentPosition);
- else {
- for (Iterator it = fValidators.iterator(); it.hasNext();) {
- IContextInformationValidator v = (IContextInformationValidator) it.next();
- v.install(realInfo, viewer, documentPosition);
- }
- }
- }
-
- IContextInformationValidator getValidator(IContextInformation info) {
- if (info instanceof WrappedContextInformation) {
- WrappedContextInformation wrap = (WrappedContextInformation) info;
- return wrap.getProcessor().getContextInformationValidator();
- }
-
- return null;
- }
-
- IContextInformation getContextInformation(IContextInformation info) {
- IContextInformation realInfo = info;
- if (info instanceof WrappedContextInformation) {
- WrappedContextInformation wrap = (WrappedContextInformation) info;
- realInfo = wrap.getContextInformation();
- }
-
- return realInfo;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
- */
- public boolean isContextInformationValid(int documentPosition) {
- // use either the validator in the info, or all validators
- boolean isValid = false;
- if (fValidator != null)
- isValid = fValidator.isContextInformationValid(documentPosition);
- else {
- for (Iterator it = fValidators.iterator(); it.hasNext();) {
- IContextInformationValidator v = (IContextInformationValidator) it.next();
- isValid |= v.isContextInformationValid(documentPosition);
- }
- }
- return isValid;
- }
-
- }
-
- private static class CompoundContentAssistValidatorPresenter extends CompoundContentAssistValidator implements IContextInformationPresenter {
- public boolean updatePresentation(int offset, TextPresentation presentation) {
- // use either the validator in the info, or all validators
- boolean presentationUpdated = false;
- if (fValidator instanceof IContextInformationPresenter)
- presentationUpdated = ((IContextInformationPresenter) fValidator).updatePresentation(offset, presentation);
- else {
- for (Iterator it = fValidators.iterator(); it.hasNext();) {
- IContextInformationValidator v = (IContextInformationValidator) it.next();
- if (v instanceof IContextInformationPresenter)
- presentationUpdated |= ((IContextInformationPresenter) v).updatePresentation(offset, presentation);
- }
- }
- return presentationUpdated;
- }
- }
-
- private static class CompoundContentAssistValidatorEx extends CompoundContentAssistValidator implements ISubjectControlContextInformationValidator {
- /*
- * @see ISubjectControlContextInformationValidator#install(IContextInformation,
- * IContentAssistSubjectControl, int)
- */
- public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
- // install either the validator in the info, or all validators
- fValidator = getValidator(info);
- IContextInformation realInfo = getContextInformation(info);
- if (fValidator instanceof ISubjectControlContextInformationValidator)
- ((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
- else {
- for (Iterator it = fValidators.iterator(); it.hasNext();) {
- if (it.next() instanceof ISubjectControlContextInformationValidator)
- ((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
- }
- }
- }
-
- }
-
- private static class CompoundContentAssistValidatorPresenterEx extends CompoundContentAssistValidatorPresenter implements ISubjectControlContextInformationPresenter, ISubjectControlContextInformationValidator {
- /*
- * @see ISubjectControlContextInformationPresenter#install(IContextInformation,
- * IContentAssistSubjectControl, int)
- */
- public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
- // install either the validator in the info, or all validators
- fValidator = getValidator(info);
- IContextInformation realInfo = getContextInformation(info);
-
- if (fValidator instanceof ISubjectControlContextInformationValidator)
- ((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
- else {
- for (Iterator it = fValidators.iterator(); it.hasNext();) {
- if (it.next() instanceof ISubjectControlContextInformationValidator)
- ((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
- }
- }
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
deleted file mode 100644
index 9b1fa9299e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.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.ui.internal.SSEUIPlugin;
-import org.osgi.framework.Bundle;
-
-
-/**
- * @author pavery
- *
- */
-public class ContentAssistUtils {
-
- /**
- * Returns the closest IndexedRegion for the offset and viewer allowing
- * for differences between viewer offsets and model positions. note: this
- * method returns an IndexedRegion for read only
- *
- * @param viewer
- * the viewer whose document is used to compute the proposals
- * @param documentOffset
- * an offset within the document for which completions should
- * be computed
- * @return an IndexedRegion
- */
- public static IndexedRegion getNodeAt(ITextViewer viewer, int documentOffset) {
-
- if (viewer == null)
- return null;
-
- IndexedRegion node = null;
- IModelManager mm = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- if (mm != null)
- model = mm.getExistingModelForRead(viewer.getDocument());
- try {
- if (model != null) {
- int lastOffset = documentOffset;
- node = model.getIndexedRegion(documentOffset);
- while (node == null && lastOffset >= 0) {
- lastOffset--;
- node = model.getIndexedRegion(lastOffset);
- }
- }
- } finally {
- if (model != null)
- model.releaseFromRead();
- }
- return node;
- }
-
- /**
- * Returns the closest IStructuredDocumentRegion for the offest and
- * viewer.
- *
- * @param viewer
- * @param documentOffset
- * @return the closest IStructuredDocumentRegion for the offest and
- * viewer.
- */
- public static IStructuredDocumentRegion getStructuredDocumentRegion(ITextViewer viewer, int documentOffset) {
- IStructuredDocumentRegion sdRegion = null;
- if (viewer == null || viewer.getDocument() == null)
- return null;
-
- int lastOffset = documentOffset;
- IStructuredDocument doc = (IStructuredDocument) viewer.getDocument();
- sdRegion = doc.getRegionAtCharacterOffset(documentOffset);
- while (sdRegion == null && lastOffset >= 0) {
- lastOffset--;
- sdRegion = doc.getRegionAtCharacterOffset(lastOffset);
- }
- return sdRegion;
- }
-
- /**
- * @return the bundle that defined the {@link IConfigurationElement} that defines
- * this category.
- */
- public static Bundle getBundle(IConfigurationElement element) {
- String namespace= element.getDeclaringExtension().getContributor().getName();
- Bundle bundle= Platform.getBundle(namespace);
- return bundle;
- }
-
- /**
- * <p>Checks that the given attribute value is not <code>null</code>.</p>
- *
- * @param value the object to check if not null
- * @param attribute the attribute
- *
- * @throws InvalidRegistryObjectException if the registry element is no longer valid
- * @throws CoreException if <code>value</code> is <code>null</code>
- */
- public static void checkExtensionAttributeNotNull(Object value, String attribute,
- IConfigurationElement element) throws InvalidRegistryObjectException, CoreException {
-
- if (value == null) {
- String message = "The extension \"" + element.getDeclaringExtension().getUniqueIdentifier() + //$NON-NLS-1$
- "\" from plug-in \"" + element.getContributor().getName() + //$NON-NLS-1$
- "\" did not specify a value for the required \"" + attribute + //$NON-NLS-1$
- "\" attribute for the element \"" + element.getName() + "\". Disabling the extension."; //$NON-NLS-1$ //$NON-NLS-2$
- IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, null);
- throw new CoreException(status);
- }
- }
-
- /**
- * @param textViewer check to see if this viewer is empty
- * @return <code>true</code> if there is no text or it's all white space,
- * <code>false</code> otherwise
- */
- public static boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if ((text == null) || ((text != null) && text.trim().equals(""))) { //$NON-NLS-1$
- isEmpty = true;
- }
- return isEmpty;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java
deleted file mode 100644
index cbaf65f465..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java
+++ /dev/null
@@ -1,90 +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.wst.sse.ui.internal.contentassist;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-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.IStructuredDocument;
-
-/**
- * <p>A {@link IContextInformationValidator} for structured documents</p>
- */
-public class ContextInformationValidator implements IContextInformationValidator {
-
- /** the installed document position */
- private int fDocumentPosition;
-
- /** the installed document */
- private IStructuredDocument fDocument;
-
- /** the installed region start*/
- private IndexedRegion fRegion;
-
- /**
- * <p>Default constructor</p>
- */
- public ContextInformationValidator() {
- fDocumentPosition = -1;
- fDocument = null;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
- * org.eclipse.jface.text.ITextViewer, int)
- */
- public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
- fDocumentPosition = documentPosition;
- fDocument = (IStructuredDocument)viewer.getDocument();
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
- */
- public boolean isContextInformationValid(int documentPosition) {
- /*
- * determine whether or not this context info should still be
- * showing... if cursor still within the same region then it's valid
- */
- boolean result = false;
-
- calculateInstalledIndexedRegion();
-
- if (fRegion != null) {
- int start = fRegion.getStartOffset();
- int end = fRegion.getEndOffset();
- result = (documentPosition < end) && (documentPosition > start + 1);
- }
- return result;
- }
-
- /**
- * @return {@link IndexedRegion} that this validator was installed on
- */
- private void calculateInstalledIndexedRegion() {
- if (fRegion == null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead(fDocument);
- if (model != null) {
- fRegion = model.getIndexedRegion(fDocumentPosition);
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
deleted file mode 100644
index f39ba52bd8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-
-/**
- * An implementation of ICompletionProposal whose values can be read after
- * creation.
- */
-public class CustomCompletionProposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, IRelevanceCompletionProposal {
-
- private String fAdditionalProposalInfo;
-
- private IContextInformation fContextInformation;
-
- private int fCursorPosition = 0;
-
- private String fDisplayString;
-
- private String fAlternateMatch;
-
- private Image fImage;
-
- private int fRelevance = IRelevanceConstants.R_NONE;
-
- private int fReplacementLength = 0;
-
- private int fReplacementOffset = 0;
-
- private String fReplacementString = null;
-
- private boolean fUpdateLengthOnValidate;
-
- private char[] fTriggers;
-
- /**
- * Constructor with relevance and replacement length update flag.
- *
- * If the <code>updateReplacementLengthOnValidate</code> flag is true,
- * then when the user types, the replacement length will be incremented by
- * the number of new characters inserted from the original position.
- * Otherwise the replacement length will not change on validate.
- *
- * ex.
- *
- * <tag |name="attr"> - the replacement length is 4 <tag i|name="attr"> -
- * the replacement length is now 5 <tag id|name="attr"> - the replacement
- * length is now 6 <tag |name="attr"> - the replacementlength is now 4
- * again <tag |name="attr"> - the replacment length remains 4
- *
- */
- public CustomCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
- this(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, null, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
- }
-
- public CustomCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance) {
- this(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, true);
- }
-
- public CustomCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, String alternateMatch, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
- fReplacementString = replacementString;
- fReplacementOffset = replacementOffset;
- fReplacementLength = replacementLength;
- fCursorPosition = cursorPosition;
- fImage = image;
- fDisplayString = displayString;
- fAlternateMatch = alternateMatch;
- fContextInformation = contextInformation;
- fAdditionalProposalInfo = additionalProposalInfo;
- fRelevance = relevance;
- fUpdateLengthOnValidate = updateReplacementLengthOnValidate;
- }
-
- public void apply(IDocument document) {
- CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(), getContextInformation(), getAdditionalProposalInfo());
- proposal.apply(document);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#apply(org.eclipse.jface.text.IDocument,
- * char, int)
- */
- public void apply(IDocument document, char trigger, int offset) {
- CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(), getContextInformation(), getAdditionalProposalInfo());
- // we currently don't do anything special for which character
- // selected the proposal, and where the cursor offset is
- // but we might in the future...
- proposal.apply(document);
- // we want to ContextInformationPresenter.updatePresentation() here
- }
-
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- IDocument document = viewer.getDocument();
- // CMVC 252634 to compensate for "invisible" initial region
- int caretOffset = viewer.getTextWidget().getCaretOffset();
- if (viewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
- caretOffset = extension.widgetOffset2ModelOffset(caretOffset);
- }
- else {
- caretOffset = viewer.getTextWidget().getCaretOffset() + viewer.getVisibleRegion().getOffset();
- }
-
- if (caretOffset == getReplacementOffset()) {
- apply(document);
- }
- else {
- // replace the text without affecting the caret Position as this
- // causes the cursor to move on its own
- try {
- int endOffsetOfChanges = getReplacementString().length() + getReplacementOffset();
- // Insert the portion of the new text that comes after the
- // current caret position
- if (endOffsetOfChanges >= caretOffset) {
- int postCaretReplacementLength = getReplacementOffset() + getReplacementLength() - caretOffset;
- int preCaretReplacementLength = getReplacementString().length() - (endOffsetOfChanges - caretOffset);
- if (postCaretReplacementLength < 0) {
- if (Debug.displayWarnings) {
- System.out.println("** postCaretReplacementLength was negative: " + postCaretReplacementLength); //$NON-NLS-1$
- }
- // This is just a quick fix while I figure out what
- // replacement length is supposed to be
- // in each case, otherwise we'll get negative
- // replacment length sometimes
- postCaretReplacementLength = 0;
- }
- document.replace(caretOffset, postCaretReplacementLength, getReplacementString().substring(preCaretReplacementLength));
- }
- // Insert the portion of the new text that comes before the
- // current caret position
- // Done second since offsets would change for the post text
- // otherwise
- // Outright insertions are handled here
- if (caretOffset > getReplacementOffset()) {
- int preCaretTextLength = caretOffset - getReplacementOffset();
- document.replace(getReplacementOffset(), preCaretTextLength, getReplacementString().substring(0, preCaretTextLength));
- }
- }
- catch (BadLocationException x) {
- apply(document);
- }
- catch (StringIndexOutOfBoundsException e) {
- apply(document);
- }
- }
- }
-
- public String getAdditionalProposalInfo() {
- // return fProposal.getAdditionalProposalInfo();
- return fAdditionalProposalInfo;
- }
-
- public IContextInformation getContextInformation() {
- // return fProposal.getContextInformation();
- return fContextInformation;
- }
-
- public void setContextInformation(IContextInformation contextInfo) {
- fContextInformation = contextInfo;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getContextInformationPosition()
- */
- public int getContextInformationPosition() {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=110355
- // return getCursorPosition();
- if (getContextInformation() == null)
- return getReplacementOffset() - 1;
- return getReplacementOffset() + getCursorPosition();
- }
-
- public int getCursorPosition() {
- return fCursorPosition;
- }
-
- public void setCursorPosition(int pos) {
- fCursorPosition = pos;
- }
-
- public void setDisplayString(String newDisplayString) {
- fDisplayString = newDisplayString;
- }
-
- public String getDisplayString() {
- // return fProposal.getDisplayString();
- return fDisplayString;
- }
-
- public Image getImage() {
- // return fProposal.getImage();
- return fImage;
- }
-
- public int getRelevance() {
- return fRelevance;
- }
-
- public void setReplacementLength(int newReplacementLength) {
- fReplacementLength = newReplacementLength;
- }
-
- public int getReplacementLength() {
- return fReplacementLength;
- }
-
- public int getReplacementOffset() {
- return fReplacementOffset;
- }
-
- public String getReplacementString() {
- return fReplacementString;
- }
-
- public Point getSelection(IDocument document) {
- // return fProposal.getSelection(document);
- CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(), getContextInformation(), getAdditionalProposalInfo());
- return proposal.getSelection(document);
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getTriggerCharacters()
- */
-
- public char[] getTriggerCharacters() {
- return fTriggers;
- }
-
- public void setTriggerCharacters(char[] triggers) {
- fTriggers = triggers;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#isValidFor(org.eclipse.jface.text.IDocument,
- * int)
- */
- public boolean isValidFor(IDocument document, int offset) {
- return validate(document, offset, null);
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
- * boolean)
- */
- public void selected(ITextViewer viewer, boolean smartToggle) {
- }
-
- // code is borrowed from JavaCompletionProposal
- protected boolean startsWith(IDocument document, int offset, String word) {
-
- int wordLength = word == null ? 0 : word.length();
- if (offset > fReplacementOffset + wordLength)
- return false;
-
- try {
- int length = offset - fReplacementOffset;
- String start = document.get(fReplacementOffset, length);
-
- return (word != null && word.substring(0, length).equalsIgnoreCase(start)) || (fAlternateMatch != null && length <= fAlternateMatch.length() && fAlternateMatch.substring(0, length).equalsIgnoreCase(start));
- }
- catch (BadLocationException x) {
- }
-
- return false;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
- */
- public void unselected(ITextViewer viewer) {
- }
-
- /**
- * borrowed from JavaCompletionProposal
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
- * int, org.eclipse.jface.text.DocumentEvent)
- */
- public boolean validate(IDocument document, int offset, DocumentEvent event) {
- if (offset < fReplacementOffset)
- return false;
- boolean validated = startsWith(document, offset, fDisplayString);
-
- if (fUpdateLengthOnValidate && event != null) {
- fReplacementLength += event.fText.length() - event.fLength; //adjust the replacement length by the event's text replacement
- }
- return validated;
- }
-
- /**
- * @param replacementOffset
- * The fReplacementOffset to set.
- */
- public void setReplacementOffset(int replacementOffset) {
- fReplacementOffset = replacementOffset;
- }
-
- /**
- * @param replacementString
- * The fReplacementString to set.
- */
- public void setReplacementString(String replacementString) {
- fReplacementString = replacementString;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java
deleted file mode 100644
index 7e3f7a6df5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java
+++ /dev/null
@@ -1,28 +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.sse.ui.internal.contentassist;
-
-
-/**
- * CompletionProposal with a relevance value. The relevance value is used to
- * sort the completion proposals. Proposals with higher relevance should be
- * listed before proposals with lower relevance.
- *
- * @author pavery
- */
-public interface IRelevanceCompletionProposal {
- /**
- * Returns the relevance of the proposal.
- */
- int getRelevance();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java
deleted file mode 100644
index ba5a16ed30..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-public interface IRelevanceConstants {
- int R_NONE = 0;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java
deleted file mode 100644
index 04cde16639..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java
+++ /dev/null
@@ -1,145 +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.wst.sse.ui.internal.contentassist;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Shell;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * <p>This is a <code>MessageDialog</code> which allows the user
- * to choose that the dialog isn't shown again the next time.</p>
- *
- * @base org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog
- */
-public class OptionalMessageDialog extends MessageDialog {
-
- // String constants for widgets
- private static final String CHECKBOX_TEXT = SSEUIMessages.OptionalMessageDialog_dontShowAgain;
-
- // Dialog store id constants
- private static final String STORE_ID = "ContentAssist_OptionalMessageDialog.hide."; //$NON-NLS-1$
-
- public static final int NOT_SHOWN = IDialogConstants.CLIENT_ID + 1;
-
- private final String fId;
- private final String fCheckBoxText;
-
- private Button fHideDialogCheckBox;
-
-
- /**
- * Opens the dialog but only if the user hasn't chosen to hide it.
- *
- * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed
- * without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not
- * shown
- */
- public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
- return open(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT);
- }
-
- /**
- * Opens the dialog but only if the user hasn't chosen to hide it.
- *
- * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed
- * without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not
- * shown
- */
- public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkboxText) {
- if (!isDialogEnabled(id))
- return OptionalMessageDialog.NOT_SHOWN;
-
- MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, checkboxText);
- return dialog.open();
- }
-
- protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
- this(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT);
- }
-
- protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkBoxText) {
- super(parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
- fId= id;
- fCheckBoxText= checkBoxText;
- }
-
- protected Control createCustomArea(Composite parent) {
- Composite composite= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
- fHideDialogCheckBox.setText(fCheckBoxText);
- fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setDialogEnabled(fId, !((Button)e.widget).getSelection());
- }
- });
- applyDialogFont(fHideDialogCheckBox);
- return fHideDialogCheckBox;
- }
-
- //--------------- Configuration handling --------------
-
- /**
- * Returns this dialog
- *
- * @return the settings to be used
- */
- private static IDialogSettings getDialogSettings() {
- IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings();
- settings= settings.getSection(STORE_ID);
- if (settings == null)
- settings= SSEUIPlugin.getDefault().getDialogSettings().addNewSection(STORE_ID);
- return settings;
- }
-
- /**
- * Answers whether the optional dialog is enabled and should be shown.
- */
- public static boolean isDialogEnabled(String key) {
- IDialogSettings settings= getDialogSettings();
- return !settings.getBoolean(key);
- }
-
- /**
- * Sets whether the optional dialog is enabled and should be shown.
- */
- public static void setDialogEnabled(String key, boolean isEnabled) {
- IDialogSettings settings= getDialogSettings();
- settings.put(key, !isEnabled);
- }
-
- /**
- * Clears all remembered information about hidden dialogs
- */
- public static void clearAllRememberedStates() {
- IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings();
- settings.addNewSection(STORE_ID);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
deleted file mode 100644
index 8d124cebd9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-
-/**
- * <p>Content assistant that uses {@link CompoundContentAssistProcessor}s so that multiple
- * processors can be registered for each partition type</p>
- */
-public class StructuredContentAssistant extends ContentAssistant {
- /** need to retain copy of all releasable processors so they can be released on uninstall */
- private List fReleasableProcessors;
-
- /**
- * <code>true</code> if a content assist processor has been added to this assistant,
- * <code>false</code> otherwise
- */
- private boolean fIsInitalized;
-
- private boolean fProcessorsReleased = false;
-
- /**
- * <p>Construct the assistant</p>
- */
- public StructuredContentAssistant() {
- this.fIsInitalized = false;
- this.fReleasableProcessors = new ArrayList();
- }
-
- /**
- * <p>Each set content assist processor is placed inside a
- * CompoundContentAssistProcessor which allows multiple processors per
- * partition type</p>
- *
- * @param processor
- * the content assist processor to register, or
- * <code>null</code> to remove an existing one
- * @param contentType
- * the content type under which to register
- *
- * @see org.eclipse.jface.text.contentassist.ContentAssistant#setContentAssistProcessor(org.eclipse.jface.text.contentassist.IContentAssistProcessor, java.lang.String)
- */
- public void setContentAssistProcessor(IContentAssistProcessor processor, String partitionType) {
- this.fIsInitalized = true;
-
- CompoundContentAssistProcessor compoundProcessor = getExistingContentAssistProcessor(partitionType);
- if(compoundProcessor == null) {
- compoundProcessor = new CompoundContentAssistProcessor();
- this.fReleasableProcessors.add(compoundProcessor);
- }
-
- compoundProcessor.add(processor);
- super.setContentAssistProcessor(compoundProcessor, partitionType);
- }
-
- /**
- * Returns true if content assist has been initialized with some content
- * assist processors. False otherwise.
- *
- * @return true if content assistant has been initialized
- */
- public boolean isInitialized() {
- return this.fIsInitalized;
- }
-
- /**
- *
- * @param partitionType
- * @return
- */
- private CompoundContentAssistProcessor getExistingContentAssistProcessor(String partitionType) {
- CompoundContentAssistProcessor compoundContentAssistProcessor = null;
- IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
- if (processor != null) {
- if (processor instanceof CompoundContentAssistProcessor) {
- compoundContentAssistProcessor = (CompoundContentAssistProcessor) processor;
- }
- }
- return compoundContentAssistProcessor;
- }
-
- public void install(ITextViewer textViewer) {
- if (fProcessorsReleased) {
- if (this.fReleasableProcessors != null && !this.fReleasableProcessors.isEmpty()) {
- for(int i = 0; i < this.fReleasableProcessors.size(); ++i) {
- ((CompoundContentAssistProcessor)this.fReleasableProcessors.get(i)).install(textViewer);
- }
- }
- fProcessorsReleased = false;
- }
- super.install(textViewer);
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.ContentAssistant#uninstall()
- */
- public void uninstall() {
- // dispose of all content assist processors
- if (this.fReleasableProcessors != null && !this.fReleasableProcessors.isEmpty()) {
- for(int i = 0; i < this.fReleasableProcessors.size(); ++i) {
- ((IReleasable)this.fReleasableProcessors.get(i)).release();
- }
- }
- fProcessorsReleased = true;
- super.uninstall();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
deleted file mode 100644
index a55306a21a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
+++ /dev/null
@@ -1,762 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.util.DelegatingDragAdapter;
-import org.eclipse.jface.util.DelegatingDropAdapter;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSource;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTarget;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineFilterProcessor;
-
-
-public class ConfigurableContentOutlinePage extends ContentOutlinePage implements IAdaptable {
- /*
- * Menu listener to create the additions group and add any menu items
- * contributed by the configuration; required since the context menu is
- * cleared every time it is shown
- */
- class AdditionGroupAdder implements IMenuListener {
- public void menuAboutToShow(IMenuManager manager) {
- IContributionItem[] items = manager.getItems();
- if (items.length > 0 && items[items.length - 1].getId() != null) {
- manager.insertAfter(items[items.length - 1].getId(), new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- else {
- manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- // add configuration's menu items
- IMenuListener listener = getConfiguration().getMenuListener(getTreeViewer());
- if (listener != null) {
- listener.menuAboutToShow(manager);
- }
- }
- }
-
- /**
- * Provides double-click registration so it can be done before the Control
- * is created.
- */
- class DoubleClickProvider implements IDoubleClickListener {
- private IDoubleClickListener[] listeners = null;
-
- void addDoubleClickListener(IDoubleClickListener newListener) {
- if (listeners == null) {
- listeners = new IDoubleClickListener[]{newListener};
- }
- else {
- IDoubleClickListener[] newListeners = new IDoubleClickListener[listeners.length + 1];
- System.arraycopy(listeners, 0, newListeners, 0, listeners.length);
- newListeners[listeners.length] = newListener;
- listeners = newListeners;
- }
- }
-
- public void doubleClick(DoubleClickEvent event) {
- fireDoubleClickEvent(event);
- }
-
- private void fireDoubleClickEvent(final DoubleClickEvent event) {
- IDoubleClickListener[] firingListeners = listeners;
- for (int i = 0; i < firingListeners.length; ++i) {
- final IDoubleClickListener l = firingListeners[i];
- SafeRunner.run(new SafeRunnable() {
- public void run() {
- l.doubleClick(event);
- }
- });
- }
- }
-
- void removeDoubleClickListener(IDoubleClickListener oldListener) {
- if (listeners != null) {
- if (listeners.length == 1 && listeners[0].equals(oldListener)) {
- listeners = null;
- }
- else {
- List newListeners = new ArrayList(Arrays.asList(listeners));
- newListeners.remove(oldListener);
- listeners = (IDoubleClickListener[]) newListeners.toArray(new IDoubleClickListener[listeners.length - 1]);
- }
- }
- }
- }
-
- /**
- * Listens to post selection from the selection service, applying it to
- * the tree viewer.
- */
- class PostSelectionServiceListener implements ISelectionListener {
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- // from selection service
- if (_DEBUG) {
- _DEBUG_TIME = System.currentTimeMillis();
- } /*
- * Bug 136310, unless this page is that part's
- * IContentOutlinePage, ignore the selection change
- */
- if (part == null || part.getAdapter(IContentOutlinePage.class) == ConfigurableContentOutlinePage.this) {
- ISelection validContentSelection = getConfiguration().getSelection(getTreeViewer(), selection);
-
- boolean isLinked = getConfiguration().isLinkedWithEditor(getTreeViewer());
- if (isLinked) {
- if (!getTreeViewer().getSelection().equals(validContentSelection)) {
- try {
- fIsReceivingSelection = true;
- getTreeViewer().setSelection(validContentSelection, true);
- }
- finally {
- fIsReceivingSelection = false;
- }
- }
- }
- }
- if (_DEBUG) {
- System.out.println("(O:" + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + selection); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- }
-
- /**
- * Forwards post-selection from the tree viewer to the listeners while
- * acting as this page's selection provider.
- */
- private class SelectionProvider implements IPostSelectionProvider {
- private class PostSelectionChangedListener implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- if (!isFiringSelection() && !fIsReceivingSelection) {
- fireSelectionChanged(event, postListeners);
- updateStatusLine(getSite().getActionBars().getStatusLineManager(), event.getSelection());
- }
- }
- }
-
- private class SelectionChangedListener implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- if (!isFiringSelection() && !fIsReceivingSelection) {
- fireSelectionChanged(event, listeners);
- }
- }
- }
-
- private boolean isFiringSelection = false;
- private ListenerList listeners = new ListenerList();
- private ListenerList postListeners = new ListenerList();
- private ISelectionChangedListener postSelectionChangedListener = new PostSelectionChangedListener();
- private ISelectionChangedListener selectionChangedListener = new SelectionChangedListener();
-
- public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
- postListeners.add(listener);
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.add(listener);
- }
-
- public void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
- isFiringSelection = true;
- Object[] listeners = listenerList.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- SafeRunner.run(new SafeRunnable() {
- public void run() {
- l.selectionChanged(event);
- }
- });
- }
- isFiringSelection = false;
- }
-
- public ISelectionChangedListener getPostSelectionChangedListener() {
- return postSelectionChangedListener;
- }
-
- public ISelection getSelection() {
- if (getTreeViewer() != null) {
- return getTreeViewer().getSelection();
- }
- return StructuredSelection.EMPTY;
- }
-
- public ISelectionChangedListener getSelectionChangedListener() {
- return selectionChangedListener;
- }
-
- public boolean isFiringSelection() {
- return isFiringSelection;
- }
-
- public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
- postListeners.remove(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.remove(listener);
- }
-
- public void setSelection(ISelection selection) {
- if (!isFiringSelection) {
- getTreeViewer().setSelection(selection);
- }
- }
- }
-
- private class ShowInTarget implements IShowInTarget {
- /*
- * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
- */
- public boolean show(ShowInContext context) {
- setSelection(context.getSelection());
- return getTreeViewer().getSelection().equals(context.getSelection());
- }
- }
-
- protected static final ContentOutlineConfiguration NULL_CONFIGURATION = new ContentOutlineConfiguration() {
- public IContentProvider getContentProvider(TreeViewer viewer) {
- return new ITreeContentProvider() {
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- return null;
- }
-
- public Object[] getElements(Object inputElement) {
- return null;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
- }
- };
-
- private static final String OUTLINE_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.OutlineContext"; //$NON-NLS-1$
-
- private static final String OUTLINE_CONTEXT_MENU_SUFFIX = ".source.OutlineContext"; //$NON-NLS-1$
- private static final boolean _DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/contentOutline")); //$NON-NLS-1$ //$NON-NLS-2$;
-
- private long _DEBUG_TIME = 0;
-
- private TransferDragSourceListener[] fActiveDragListeners;
- private TransferDropTargetListener[] fActiveDropListeners;
- private ContentOutlineConfiguration fConfiguration;
-
- private Menu fContextMenu;
- private String fContextMenuId;
-
- private MenuManager fContextMenuManager;
- private DoubleClickProvider fDoubleClickProvider = null;
-
- private DelegatingDragAdapter fDragAdapter;
- private DragSource fDragSource;
- private DelegatingDropAdapter fDropAdapter;
- private DropTarget fDropTarget;
- private IEditorPart fEditor;
- private IMenuListener fGroupAdder = null;
- private Object fInput = null;
-
- private String fInputContentTypeIdentifier = null;
- private ISelectionListener fSelectionListener = null;
-
- SelectionProvider fSelectionProvider = null;
-
- boolean fIsReceivingSelection;
-
- /**
- * A ContentOutlinePage that abstract as much behavior as possible away
- * from the Controls and varies it by content type.
- */
- public ConfigurableContentOutlinePage() {
- super();
- fGroupAdder = new AdditionGroupAdder();
- fSelectionProvider = new SelectionProvider();
- }
-
- /**
- * Adds a listener to a list of those notified when someone double-clicks
- * in the page.
- *
- * @param newListener - the listener to add
- */
- public void addDoubleClickListener(IDoubleClickListener newListener) {
- if (fDoubleClickProvider == null) {
- fDoubleClickProvider = new DoubleClickProvider();
- }
- fDoubleClickProvider.addDoubleClickListener(newListener);
- }
-
- private String computeContextMenuID() {
- String id = null;
- if (fInputContentTypeIdentifier != null) {
- id = fInputContentTypeIdentifier + OUTLINE_CONTEXT_MENU_SUFFIX;
- }
- return id;
- }
-
- /**
- * @see ContentOutlinePage#createControl
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- ColumnViewerToolTipSupport.enableFor(getTreeViewer());
-
- IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
- if (page != null) {
- fEditor = page.getActiveEditor();
- }
-
- fDragAdapter = new DelegatingDragAdapter();
- fDragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
- fDropAdapter = new DelegatingDropAdapter();
- fDropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
-
- setConfiguration(getConfiguration());
-
- /*
- * ContentOutlinePage only implements ISelectionProvider while the
- * tree viewer implements both ISelectionProvider and
- * IPostSelectionProvider. Use an ISelectionProvider that listens to
- * post selection from the tree viewer and forward only post selection
- * to the selection service.
- */
- getTreeViewer().addPostSelectionChangedListener(fSelectionProvider.getPostSelectionChangedListener());
- getTreeViewer().addSelectionChangedListener(fSelectionProvider.getSelectionChangedListener());
- if (fDoubleClickProvider == null) {
- fDoubleClickProvider = new DoubleClickProvider();
- }
- getTreeViewer().addDoubleClickListener(fDoubleClickProvider);
- getSite().setSelectionProvider(fSelectionProvider);
- }
-
- public void dispose() {
- getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(getSelectionServiceListener());
- if (fDoubleClickProvider != null) {
- getTreeViewer().removeDoubleClickListener(fDoubleClickProvider);
- }
-
- // dispose menu controls
- if (fContextMenu != null) {
- fContextMenu.dispose();
- }
- if (fContextMenuManager != null) {
- fContextMenuManager.removeMenuListener(fGroupAdder);
- fContextMenuManager.removeAll();
- fContextMenuManager.dispose();
- }
-
- fDropTarget.dispose();
- fDragSource.dispose();
-
- IStatusLineManager statusLineManager = getSite().getActionBars().getStatusLineManager();
- if (statusLineManager != null) {
- statusLineManager.setMessage(null);
- }
- setConfiguration(NULL_CONFIGURATION);
- super.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class key) {
- Object adapter = null;
- if (key.equals(IShowInTarget.class)) {
- adapter = new ShowInTarget();
- }
- final IEditorPart editor = fEditor;
-
- if (key.equals(IShowInSource.class) && editor != null) {
- adapter = new IShowInSource() {
- public ShowInContext getShowInContext() {
- return new ShowInContext(editor.getEditorInput(), editor.getEditorSite().getSelectionProvider().getSelection());
- }
- };
- }
- else if (key.equals(IShowInTargetList.class) && editor != null) {
- adapter = editor.getAdapter(key);
- }
- return adapter;
- }
-
- /**
- * @return the currently used ContentOutlineConfiguration
- */
- public ContentOutlineConfiguration getConfiguration() {
- if (fConfiguration == null) {
- fConfiguration = NULL_CONFIGURATION;
- }
- return fConfiguration;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- return fSelectionProvider.getSelection();
- }
-
- ISelectionListener getSelectionServiceListener() {
- if (fSelectionListener == null) {
- fSelectionListener = new PostSelectionServiceListener();
- }
- return fSelectionListener;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite
- * )
- */
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.getWorkbenchWindow().getSelectionService().addPostSelectionListener(getSelectionServiceListener());
- }
-
- /**
- * Removes a listener to a list of those notified when someone
- * double-clicks in the page.
- *
- * @param oldListener - the listener to remove
- */
- public void removeDoubleClickListener(IDoubleClickListener oldListener) {
- if (fDoubleClickProvider != null) {
- fDoubleClickProvider.removeDoubleClickListener(oldListener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (!fIsReceivingSelection)
- super.selectionChanged(event);
- }
-
- /**
- * Configures (or reconfigures) the page according to the given
- * configuration.
- *
- * @param configuration
- */
- public void setConfiguration(ContentOutlineConfiguration configuration) {
- // intentionally do not check to see if the new configuration != old
- // configuration
- if (getTreeViewer() != null) {
- // remove the key listeners
- if (getControl() != null && !getControl().isDisposed()) {
- KeyListener[] listeners = getConfiguration().getKeyListeners(getTreeViewer());
- if (listeners != null) {
- for (int i = 0; i < listeners.length; i++) {
- getControl().removeKeyListener(listeners[i]);
- }
- }
- }
-
- IContributionManager toolbar = getSite().getActionBars().getToolBarManager();
- if (toolbar != null) {
- IContributionItem[] toolbarItems = getConfiguration().getToolbarContributions(getTreeViewer());
- if (toolbarItems != null && toolbarItems.length > 0) {
- for (int i = 0; i < toolbarItems.length; i++) {
- toolbar.remove(toolbarItems[i]);
- }
- toolbar.update(false);
- }
- }
-
- IContributionManager menubar = getSite().getActionBars().getMenuManager();
- if (menubar != null) {
- IContributionItem[] menuItems = getConfiguration().getMenuContributions(getTreeViewer());
- if (menuItems != null && menuItems.length > 0) {
- for (int i = 0; i < menuItems.length; i++) {
- menubar.remove(menuItems[i]);
- }
- menubar.remove(IWorkbenchActionConstants.MB_ADDITIONS);
- menubar.update(false);
- }
- }
- // clear the DnD listeners and transfer types
- if (fDragAdapter != null && !fDragAdapter.isEmpty() && fDragSource != null && !fDragSource.isDisposed() && fDragSource.getTransfer().length > 0) {
- if (fActiveDragListeners != null) {
- for (int i = 0; i < fActiveDragListeners.length; i++) {
- fDragAdapter.removeDragSourceListener(fActiveDragListeners[i]);
- }
- }
- fActiveDragListeners = null;
- fDragSource.removeDragListener(fDragAdapter);
- fDragSource.setTransfer(new Transfer[0]);
- }
- if (fDropAdapter != null && !fDropAdapter.isEmpty() && fDropTarget != null && !fDropTarget.isDisposed() && fDropTarget.getTransfer().length > 0) {
- if (fActiveDropListeners != null) {
- for (int i = 0; i < fActiveDropListeners.length; i++) {
- fDropAdapter.removeDropTargetListener(fActiveDropListeners[i]);
- }
- }
- fActiveDropListeners = null;
- fDropTarget.removeDropListener(fDropAdapter);
- fDropTarget.setTransfer(new Transfer[0]);
- }
- getConfiguration().getContentProvider(getTreeViewer()).inputChanged(getTreeViewer(), fInput, null);
- // release any ties to this tree viewer
- getConfiguration().unconfigure(getTreeViewer());
- }
-
- fConfiguration = configuration;
-
- if (getTreeViewer() != null && getControl() != null && !getControl().isDisposed()) {
- // (re)set the providers
- getTreeViewer().setLabelProvider(getConfiguration().getLabelProvider(getTreeViewer()));
- getTreeViewer().setContentProvider(getConfiguration().getContentProvider(getTreeViewer()));
-
- // view toolbar
- IContributionManager toolbar = getSite().getActionBars().getToolBarManager();
- if (toolbar != null) {
- IContributionItem[] toolbarItems = getConfiguration().getToolbarContributions(getTreeViewer());
- if (toolbarItems != null) {
- for (int i = 0; i < toolbarItems.length; i++) {
- toolbar.add(toolbarItems[i]);
- }
- toolbar.update(true);
- }
- }
- // view menu
- IContributionManager menu = getSite().getActionBars().getMenuManager();
- if (menu != null) {
- IContributionItem[] menuItems = getConfiguration().getMenuContributions(getTreeViewer());
- if (menuItems != null) {
- for (int i = 0; i < menuItems.length; i++) {
- menuItems[i].setVisible(true);
- menu.add(menuItems[i]);
- menuItems[i].update();
- }
- menu.update(true);
- }
- }
- // add the allowed DnD listeners and types
- TransferDragSourceListener[] dragListeners = getConfiguration().getTransferDragSourceListeners(getTreeViewer());
- if (fDragAdapter != null && dragListeners.length > 0) {
- for (int i = 0; i < dragListeners.length; i++) {
- fDragAdapter.addDragSourceListener(dragListeners[i]);
- }
- fActiveDragListeners = dragListeners;
- fDragSource.addDragListener(fDragAdapter);
- fDragSource.setTransfer(fDragAdapter.getTransfers());
- }
- TransferDropTargetListener[] dropListeners = getConfiguration().getTransferDropTargetListeners(getTreeViewer());
- if (fDropAdapter != null && dropListeners.length > 0) {
- for (int i = 0; i < dropListeners.length; i++) {
- fDropAdapter.addDropTargetListener(dropListeners[i]);
- }
- fActiveDropListeners = dropListeners;
- fDropTarget.addDropListener(fDropAdapter);
- fDropTarget.setTransfer(fDropAdapter.getTransfers());
- }
- // add the key listeners
- KeyListener[] listeners = getConfiguration().getKeyListeners(getTreeViewer());
- if (listeners != null) {
- for (int i = 0; i < listeners.length; i++) {
- getControl().addKeyListener(listeners[i]);
- }
- }
- }
-
- if (fInput != null) {
- setInput(fInput);
- }
- }
-
- /**
- * @param editor
- * The IEditorPart that "owns" this page. Used to support the
- * "Show In..." menu.
- */
- public void setEditorPart(IEditorPart editor) {
- fEditor = editor;
- }
-
- /**
- * @param newInput
- * The input for the page's viewer. Should only be set after a
- * configuration has been applied.
- */
- public void setInput(Object newInput) {
- fInput = newInput;
- /*
- * Intentionally not optimized for checking new input vs. old input so
- * that any existing content providers can be updated
- */
- if (getControl() != null && !getControl().isDisposed()) {
- getTreeViewer().setInput(fInput);
- updateContextMenuId();
- }
- }
-
- /**
- * @param id - the content type identifier to use for further extension
- */
- public void setInputContentTypeIdentifier(String id) {
- fInputContentTypeIdentifier = id;
- }
-
- /**
- * Updates the outline page's context menu for the current input
- */
- private void updateContextMenuId() {
- String computedContextMenuId = null;
- // update outline view's context menu control and ID
-
- if (fEditor == null) {
- IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
- if (page != null) {
- fEditor = page.getActiveEditor();
- }
- }
-
- computedContextMenuId = computeContextMenuID();
-
- if (computedContextMenuId == null) {
- computedContextMenuId = OUTLINE_CONTEXT_MENU_ID;
- }
-
- /*
- * Update outline context menu id if updating to a new id or if
- * context menu is not already set up
- */
- if (!computedContextMenuId.equals(fContextMenuId) || (fContextMenu == null)) {
- fContextMenuId = computedContextMenuId;
-
- if (getControl() != null && !getControl().isDisposed()) {
- // dispose of previous context menu
- if (fContextMenu != null) {
- fContextMenu.dispose();
- }
- if (fContextMenuManager != null) {
- fContextMenuManager.removeMenuListener(fGroupAdder);
- fContextMenuManager.removeAll();
- fContextMenuManager.dispose();
- }
-
- fContextMenuManager = new MenuManager(fContextMenuId, fContextMenuId);
- fContextMenuManager.setRemoveAllWhenShown(true);
-
- fContextMenuManager.addMenuListener(fGroupAdder);
-
- fContextMenu = fContextMenuManager.createContextMenu(getControl());
- getControl().setMenu(fContextMenu);
-
- getSite().registerContextMenu(fContextMenuId, fContextMenuManager, this);
-
- /*
- * also register this menu for source page part and structured
- * text outline view ids
- */
- if (fEditor != null) {
- String partId = fEditor.getSite().getId();
- if (partId != null) {
- getSite().registerContextMenu(partId + OUTLINE_CONTEXT_MENU_SUFFIX, fContextMenuManager, this);
- }
- }
- getSite().registerContextMenu(OUTLINE_CONTEXT_MENU_ID, fContextMenuManager, this);
- }
- }
- }
-
- void updateStatusLine(IStatusLineManager mgr, ISelection selection) {
- String text = null;
- Image image = null;
- ILabelProvider statusLineLabelProvider = getConfiguration().getStatusLineLabelProvider(getTreeViewer());
- if (statusLineLabelProvider != null && selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- text = statusLineLabelProvider.getText(firstElement);
- image = statusLineLabelProvider.getImage(firstElement);
- }
- if (image == null) {
- mgr.setMessage(text);
- }
- else {
- mgr.setMessage(image, text);
- }
- }
-
- public ContentOutlineFilterProcessor getOutlineFilterProcessor() {
- return getConfiguration().getOutlineFilterProcessor(getTreeViewer());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
deleted file mode 100644
index 4789341493..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
+++ /dev/null
@@ -1,57 +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.wst.sse.ui.internal.contentoutline;
-
-
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-/**
- * Adapter interface to provide JFace-style children and property information.
- * The factory returning this adapter is expected to implement
- * IJFaceNodeAdapterFactory
- *
- */
-public interface IJFaceNodeAdapter extends INodeAdapter {
-
- /**
- * Returns the child elements of the given parent element.
- * The result is not modified by the viewer.
- *
- * @param node the parent object
- * @return an array of child elements
- */
- public Object[] getChildren(Object node);
-
- /**
- * Returns an enumeration with the elements belonging to the passed
- * element. These are the top level items in a list, tree, table, etc...
- */
- public Object[] getElements(Object node);
-
- /**
- * Fetches the label image specific to this object instance.
- */
- public Image getLabelImage(Object node);
-
- /**
- * Fetches the label text specific to this object instance.
- */
- public String getLabelText(Object node);
-
- public Object getParent(Object node);
-
- public boolean hasChildren(Object node);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java
deleted file mode 100644
index cf7a53ed63..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java
+++ /dev/null
@@ -1,26 +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.sse.ui.internal.contentoutline;
-
-import java.util.Collection;
-
-public interface IJFaceNodeAdapterFactory {
- public void addListener(Object listener);
-
- /**
- * returns "copy" so no one can modify our list. Its is a shallow copy.
- */
- public Collection getListeners();
-
- public void removeListener(Object listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java
deleted file mode 100644
index fef880b8b2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java
+++ /dev/null
@@ -1,80 +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.sse.ui.internal.contentoutline;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * An IAction.AS_CHECK_BOX action that sets and gets its checked state along
- * with a value from a preference store. Should be used with
- * PropertyChangeUpdateActionContributionItem to listen to changes in the
- * store and update the checked state from PropertyChangeEvents.
- */
-public class PropertyChangeUpdateAction extends Action implements IUpdate {
- private String fPreferenceKey;
- private IPreferenceStore fStore;
- private boolean fUpdateFromPropertyChange = true;
-
- public PropertyChangeUpdateAction(String text, IPreferenceStore store, String preferenceKey, boolean defaultValue) {
- super(text, IAction.AS_CHECK_BOX);
- fPreferenceKey = preferenceKey;
- fStore = store;
- fStore.setDefault(getPreferenceKey(), defaultValue);
- setId(getPreferenceKey());
- setChecked(getPreferenceStore().getBoolean(getPreferenceKey()));
- }
-
- /**
- * @return Returns the orderPreferenceKey.
- */
- public String getPreferenceKey() {
- return fPreferenceKey;
- }
-
- /**
- * @return Returns the store.
- */
- public IPreferenceStore getPreferenceStore() {
- return fStore;
- }
-
- /**
- * @return Returns the updateFromPropertyChange.
- */
- public boolean isUpdateFromPropertyChange() {
- return fUpdateFromPropertyChange;
- }
-
- public final void run() {
- super.run();
- fStore.setValue(getPreferenceKey(), isChecked());
- if (!isUpdateFromPropertyChange())
- update();
- }
-
- /**
- * @param updateFromPropertyChange
- * The updateFromPropertyChange to set.
- */
- public void setUpdateFromPropertyChange(boolean updateFromPropertyChange) {
- fUpdateFromPropertyChange = updateFromPropertyChange;
- }
-
- public void update() {
- setChecked(fStore.getBoolean(getPreferenceKey()));
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
deleted file mode 100644
index 67d0aec21f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
+++ /dev/null
@@ -1,85 +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.sse.ui.internal.contentoutline;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * A listener on the given action's PreferenceStore. It calls .update() on the
- * action when the given key changes value.
- */
-public class PropertyChangeUpdateActionContributionItem extends ActionContributionItem {
-
- private class PreferenceUpdateListener implements IPropertyChangeListener {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(fProperty)) {
- if (debug) {
- System.out.println(fProperty + " preference changed, updating " + getAction()); //$NON-NLS-1$
- }
- ((IUpdate) getAction()).update();
- }
- }
- }
-
- static final boolean debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem")); //$NON-NLS-1$ //$NON-NLS-2$;
-
- private IPropertyChangeListener fListener = null;
-
- protected String fProperty = null;
- private IPreferenceStore fStore;
-
- public PropertyChangeUpdateActionContributionItem(PropertyChangeUpdateAction action) {
- super(action);
- fProperty = action.getPreferenceKey();
- fStore = action.getPreferenceStore();
- fListener = new PreferenceUpdateListener();
- connect();
- }
-
- public void connect() {
- if (debug) {
- System.out.println("PropertyChangeUpdateActionContributionItem started listening for " + fProperty); //$NON-NLS-1$
- }
- if (fStore != null) {
- fStore.addPropertyChangeListener(fListener);
- }
- }
-
- public void disconnect() {
- if (debug) {
- System.out.println("PropertyChangeUpdateActionContributionItem stopped listening for " + fProperty); //$NON-NLS-1$
- }
- if (fStore != null) {
- fStore.removePropertyChangeListener(fListener);
- }
- }
-
- public void dispose() {
- super.dispose();
- disconnect();
- fProperty = null;
- fStore = null;
- }
-
- public String toString() {
- if (getAction().getId() != null)
- return super.toString();
- else
- return getClass().getName() + "(text=" + getAction().getText() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
deleted file mode 100644
index 8b8eb59087..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
+++ /dev/null
@@ -1,287 +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.sse.ui.internal.contentproperties.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * @deprecated People should manage their own combo/list
- */
-public class ComboList {
- private Combo combo;
-
-
- private List list;
-
- public ComboList(Composite parent, int style) {
- combo = new Combo(parent, style);
- list = new ArrayList();
- }
-
-
- /*
- * following methods is original method of Combo class.
- */
- public void add(String key) {
- checkError();
- combo.add(key);
- list.add(key);
- }
-
- public void add(String key, int index) {
- checkError();
- combo.add(key, index);
- list.add(index, key);
- }
-
- public void add(String key, String value) {
- checkError();
- combo.add(key);
- list.add(value);
- }
-
- public void add(String key, String value, int index) {
- checkError();
- combo.add(key, index);
- list.add(index, value);
- }
-
- public void addFocusListener(FocusListener listener) {
- combo.addFocusListener(listener);
- }
-
- public void addModifyListener(org.eclipse.swt.events.ModifyListener listener) {
- combo.addModifyListener(listener);
- }
-
- public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener) {
- combo.addSelectionListener(listener);
-
- }
-
- private void checkError() {
- if (!isConsistency()) {
- Logger.log(Logger.WARNING, "Difference between the number of keys[" + combo.getItemCount() + "] and the number of values[" + list.size() + "] in ComboList"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint) {
- return combo.computeSize(wHint, hHint);
- }
-
- public Map createHashtable() {
- checkError();
- Map m = new Hashtable();
- for (int i = 0; i < list.size(); i++)
- m.put(combo.getItem(i), list.get(i));
- return m;
- }
-
- public void deselect(int i) {
- combo.deselect(i);
- }
-
- public void deselectAll() {
- combo.deselectAll();
- }
-
- public boolean equals(Object obj) {
- return combo.equals(obj);
- }
-
- private void exchangePosition(int i, int j) {
- String tmpKey = getItem(i);
- Object tmpValue = list.remove(i);
-
- combo.setItem(i, getItem(j));
- list.add(i, list.remove(j - 1));
-
- combo.setItem(j, tmpKey);
- list.add(j, tmpValue);
- }
-
- public boolean existsAsKey(String str) {
- if (combo.indexOf(str) >= 0)
- return true;
- else
- return false;
- }
-
- public boolean existsAsValue(String str) {
- if (list.indexOf(str) >= 0)
- return true;
- else
- return false;
- }
-
- public boolean getEnabled() {
- return combo.getEnabled();
- }
-
- public String getItem(int index) {
- return combo.getItem(index);
- }
-
- public int getItemCount() {
- return combo.getItemCount();
- }
-
- public String getKey(String value) {
- if (value == null)
- return null;
- int index = -1;
- checkError();
- for (int i = 0; i < list.size(); i++) {
- if (!list.get(i).equals(value))
- continue;
- index = i;
- break;
- }
- if (index != -1)
- return combo.getItem(index);
- else
- return null;
- }
-
- public Object getLayoutData() {
- return combo.getLayoutData();
- }
-
- public String getSelectedValue() {
- checkError();
- int index = getSelectionIndex();
- if (index < 0)
- return null;
- return getValue(getItem(index));
- }
-
- public int getSelectionIndex() {
- return combo.getSelectionIndex();
- }
-
- public String getText() {
- return combo.getText();
- }
-
- public String getValue(String key) {
- if (key == null)
- return null;
- int index = -1;
- checkError();
- for (int i = 0; i < combo.getItemCount(); i++) {
- if (!combo.getItem(i).equals(key))
- continue;
- index = i;
- break;
- }
- if (index != -1)
- return (String) list.get(index);
- else
- return null;
- }
-
- public int indexOf(String str) {
- return combo.indexOf(str);
- }
-
-
- public boolean isConsistency() {
-
- if (list.size() == combo.getItemCount())
- return true;
- else
- return false;
- }
-
-
- public void remove(int index) {
- checkError();
- combo.remove(index);
- list.remove(index);
- }
-
- public void remove(String str) {
- checkError();
- combo.remove(str);
- list.remove(str);
- }
-
- public void select(int index) {
- combo.select(index);
- }
-
- public void setEnabled(boolean enabled) {
- combo.setEnabled(enabled);
- }
-
- public boolean setFocus() {
- return combo.setFocus();
- }
-
- public void setItem(int index, String str) {
- checkError();
- combo.setItem(index, str);
- list.remove(index);
- list.add(index, str);
- }
-
- public void setItem(String[] strArray) {
- checkError();
- combo.setItems(strArray);
- for (int i = 0; i < strArray.length; i++)
- list.add(strArray[i]);
- }
-
- public void setLayout(org.eclipse.swt.widgets.Layout lo) {
- combo.setLayout(lo);
- }
-
- public void setLayoutData(Object layoutData) {
- combo.setLayoutData(layoutData);
- }
-
- public void setSelection(Point point) {
- combo.setSelection(point);
- }
-
- public void setText(String str) {
- combo.setText(str);
- }
-
- public void sortByKey(int offset) {
- if (offset < 0 || offset > this.combo.getItemCount() - 1)
- return;
- checkError();
- //
- for (int i = offset; i < combo.getItemCount() - 1; i++) {
- for (int j = i + 1; j < combo.getItemCount(); j++) {
- if (getItem(i).compareTo(getItem(j)) > 0) {
- exchangePosition(i, j);
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
deleted file mode 100644
index f46c5177af..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
+++ /dev/null
@@ -1,39 +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.sse.ui.internal.contentproperties.ui;
-
-
-
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @deprecated People should manage their own combo/list
- */
-public final class ComboListOnPropertyPage extends ComboList {
-
-
- private String currentApplyValue;
-
- public ComboListOnPropertyPage(Composite parent, int style) {
- super(parent, style);
- }
-
- public final String getApplyValue() {
- return currentApplyValue;
- }
-
- public final void setApplyValue(String currentApplyValue) {
- this.currentApplyValue = currentApplyValue;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
deleted file mode 100644
index f937860171..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,297 +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.sse.ui.internal.contentproperties.ui;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-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.Shell;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettings;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsCreator;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * @deprecated Please use
- * org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage
- * or
- * eclipse.wst.css.ui.internal.contentproperties.ui.CSSWebContentSettingsPropertyPage
- * instead
- */
-public abstract class ContentSettingsPropertyPage extends PropertyPage {
- private static final IStatus STATUS_ERROR = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.INFO, "ERROR", null); //$NON-NLS-1$
-
- // for validateEdit()
- private static final IStatus STATUS_OK = new Status(IStatus.OK, SSEUIPlugin.ID, IStatus.OK, "OK", null); //$NON-NLS-1$
-
- /**
- * Method validateEdit.
- *
- * @param file
- * org.eclipse.core.resources.IFile
- * @param context
- * org.eclipse.swt.widgets.Shell
- * @return IStatus
- */
- private static IStatus validateEdit(IFile file, Shell context) {
- if (file == null || !file.exists())
- return STATUS_ERROR;
- if (!(file.isReadOnly()))
- return STATUS_OK;
-
- IPath location = file.getLocation();
-
- final long beforeModifiedFromJavaIO = (location != null) ? location.toFile().lastModified() : IResource.NULL_STAMP;
- final long beforeModifiedFromIFile = file.getModificationStamp();
-
- IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{file}, context);
- if (!status.isOK())
- return status;
-
- final long afterModifiedFromJavaIO = (location != null) ? location.toFile().lastModified() : IResource.NULL_STAMP;
- final long afterModifiedFromIFile = file.getModificationStamp();
-
- if (beforeModifiedFromJavaIO != afterModifiedFromJavaIO || beforeModifiedFromIFile != afterModifiedFromIFile) {
- IModelManager manager = StructuredModelManager.getModelManager();
- IStructuredModel model = manager.getExistingModelForRead(file);
- if (model != null) {
- if (!model.isDirty()) {
- try {
- file.refreshLocal(IResource.DEPTH_ONE, null);
- }
- catch (CoreException e) {
- return STATUS_ERROR;
- }
- finally {
- model.releaseFromRead();
- }
- }
- else {
- model.releaseFromRead();
- }
- }
- }
-
- if ((beforeModifiedFromJavaIO != afterModifiedFromJavaIO) || (beforeModifiedFromIFile != afterModifiedFromIFile)) {
- // the file is replaced. Modification cannot be
- // applied.
- return STATUS_ERROR;
- }
- return STATUS_OK;
- }
-
- protected ComboListOnPropertyPage[] combo;
- protected Composite composite;
-
- protected IContentSettings contentSettings;
- protected final String CSS_LABEL = SSEUIMessages.UI_CSS_profile___2; //$NON-NLS-1$
- protected final String DEVICE_LABEL = SSEUIMessages.UI_Target_Device___3; //$NON-NLS-1$
-
- protected final String DOCUMENT_LABEL = SSEUIMessages.UI_Default_HTML_DOCTYPE_ID___1; //$NON-NLS-1$
- protected int numberOfCombo;
- protected int numCols = 1;
- protected int numRows = 1;
- protected Composite propertyPage;
-
- public ContentSettingsPropertyPage() {
- super();
- }
-
- private void cleanUp() {
- // Are There any way to guarantee to call cleanUp() to re-load
- // downloaded .contentsettings file
- // after ContentSettings.releaseCache() in ContentSettingSelfHandler
- // class, which is called by resourceChangeEvent
- }
-
-
- protected ComboListOnPropertyPage createComboBoxOf(String title) {
-
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(title);
- if (title != null && title.startsWith(SSEUIMessages.UI_Default_HTML_DOCTYPE_ID___1)) { //$NON-NLS-1$
- GridData data = new GridData();
- data.horizontalIndent = 10;
- label.setLayoutData(data);
- }
- ComboListOnPropertyPage combo = new ComboListOnPropertyPage(propertyPage, SWT.READ_ONLY);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- // data.horizontalAlignment= GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- return combo;
- }
-
-
-
- protected Composite createComposite(Composite parent, int numColumns, int numRows) {
- Composite composite = new Composite(parent, SWT.NONE);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- // data.horizontalSpan=numColumns;
- // data.verticalSpan=numRows;
-
- composite.setLayoutData(data);
- return composite;
- }
-
-
- protected Control createContents(Composite parent) {
-
- contentSettings = ContentSettingsCreator.create();
-
- propertyPage = createComposite(parent, numCols, numRows);
-
- createSettingsPageGUI();
-
- return propertyPage;
-
-
- }
-
- protected abstract void createSettingsPageGUI();
-
- // protected abstract void applySelectedPropertyValue(String str,int
- // index);
- protected abstract void deleteNoneProperty(int index);
-
-
-
- protected boolean isInitValueChanged(String before, String after) {
- if (before == null && after == null)
- return false;
- if (before != null && before.equals(after))
- return false;
- return true;
- }
-
-
-
- protected void performDefaults() {
- super.performDefaults();
- // selected(applied) item is restored.
- for (int i = 0; i < numberOfCombo; i++) {
- // String appliedValue = combo[i].getApplyValue();
- // setSelectionItem(combo[i],appliedValue);
- combo[i].select(0); // select none.
-
- }
-
- }
-
- public boolean performOk() {
- Map properties = new Hashtable();
- if (validateState() == false) {
- cleanUp();
- return true;
- }
- for (int i = 0; i < numberOfCombo; i++) {
- // get selected item in Combo box.
- String str = combo[i].getSelectedValue();
- if (str == null)
- continue;
- // if no change, skip setProperty
- if (!isInitValueChanged(combo[i].getApplyValue(), str))
- continue;
- // if NONE is selected, delete attr instance (and write
- // .contentsettings.)
- if (str != null && str.length() == 0)
- deleteNoneProperty(i);
- else
- putSelectedPropertyInto(properties, str, i);
- // applySelectedPropertyValue(str,i);
-
- // set apply value in ComboListOnPropertyPage.
- combo[i].setApplyValue(str);
- }
- if (properties != null && !properties.isEmpty())
- contentSettings.setProperties((IResource) super.getElement(), properties);
- if (properties != null)
- properties.clear();
- properties = null;
- if (!contentSettings.existsProperties((IResource) super.getElement()))
- contentSettings.deleteAllProperties((IResource) super.getElement());
- return true;
- }
-
- protected abstract void putSelectedPropertyInto(Map properties, String str, int i);
-
-
- protected void setSelectionItem(ComboListOnPropertyPage combo, String value) {
- if (combo.getItemCount() <= 0)
- return;
- combo.setApplyValue(value);
- String item = combo.getKey(value);
- if (item != null)
- combo.select(combo.indexOf(item));
- else
- combo.select(0);
-
- }
-
- /*
- * Validate Edit. Similar function will be in HTMLCommand.java
- * ContentSettingsPropertyPage.java CSSActionManager.java
- * DesignRedoAction.java DesignUndoAction.java
- * HTMLConversionProcessor.java
- */
- private boolean validateState() {
-
- // get IFile of .contentsettings
- final String name = ContentSettings.getContentSettingsName();
- final IResource resource = (IResource) super.getElement();
- final IProject project = resource.getProject();
- IFile file = project.getFile(name);
-
- if (file != null && !file.exists())
- return true; // Is this really OK?
- // If false should be returned,
- // This statemant can be removed,
- // since ModelManagerUtil.validateEdit()
- // returns error to this case.
-
- Shell shell = getControl().getShell();
- IStatus status = validateEdit(file, shell);
- return status.isOK() ? true : false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
deleted file mode 100644
index b8d1936614..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-/*
- * Copied from org.eclipse.ui.internal.ide.registry.MarkerQuery
- */
-class AnnotationQuery {
- /**
- * The annotation type targetted by this query. May be <code>null</code>.
- */
- private String type;
-
- /**
- * A sorted list of the attributes targetted by this query. The list is
- * sorted from least to greatest according to <code>Sting.compare</code>
- */
- private String[] attributes;
-
- /**
- * Cached hash code value
- */
- private int hashCode;
-
- /**
- * Creates a new annotation query with the given type and attributes.
- * <p>
- * The type may be <code>null</code>. The attributes may be empty, but
- * not <code>null</code>.
- * </p>
- *
- * @param problemType
- * the targeted annotation type
- * @param markerAttributes
- * the targeted annotation attributes
- */
- public AnnotationQuery(String annotationType, String[] annotationAttributes) {
- if (annotationAttributes == null) {
- throw new IllegalArgumentException();
- }
-
- type = annotationType;
- attributes = annotationAttributes;
- computeHashCode();
- }
-
- /**
- * Performs a query against the given annotation.
- * <p>
- * Returns a <code>AnnotationQueryResult</code> if the marker is
- * appropriate for this query (correct type and has all of the query
- * attributes), otherwise <code>null</code> is returned.
- *
- * @param annotation
- * the annotation to perform the query against
- * @return a annotation query result or <code>null</code>
- */
- public AnnotationQueryResult performQuery(Annotation anno) {
- if (!(anno instanceof TemporaryAnnotation))
- return null;
-
- Map annoAttributes = ((TemporaryAnnotation) anno).getAttributes();
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=243660
- *
- * May be null if the original validation IMessage contained no
- * attributes or this annotation was not based on a validation
- * IMessage
- */
- if (annoAttributes == null) {
- return null;
- }
-
- // Check type
- if (type != null) {
- String problemType = (String) annoAttributes.get("problemType"); //$NON-NLS-1$;
- if (!type.equals(problemType))
- return null;
- }
-
- String[] values = new String[attributes.length];
- for (int i = 0; i < attributes.length; i++) {
- Object value = annoAttributes.get(attributes[i]);
- if (value == null) {
- return null;
- }
- values[i] = value.toString();
- }
- // Create and return the result
- return new AnnotationQueryResult(values);
- }
-
- /*
- * (non-Javadoc) Method declared on Object.
- */
- public boolean equals(Object o) {
- if (!(o instanceof AnnotationQuery)) {
- return false;
- }
-
- if (o == this) {
- return true;
- }
-
- AnnotationQuery mq = (AnnotationQuery) o;
- if (!(type == null ? mq.type == null : type.equals(mq.type))) {
- return false;
- }
-
- if (attributes.length != mq.attributes.length) {
- return false;
- }
-
- for (int i = 0; i < attributes.length; i++) {
- if (!(attributes[i].equals(mq.attributes[i]))) {
- return false;
- }
- }
-
- return true;
- }
-
- /*
- * (non-Javadoc) Method declared on Object.
- */
- public int hashCode() {
- return hashCode;
- }
-
- /**
- * Computes the hash code for this instance.
- */
- public void computeHashCode() {
- hashCode = 19;
-
- if (type != null) {
- hashCode = hashCode * 37 + type.hashCode();
- }
-
- for (int i = 0; i < attributes.length; i++) {
- hashCode = hashCode * 37 + attributes[i].hashCode();
- }
- }
-
- /**
- * Returns the targetted marker type. May be <code>null</code>
- *
- * @return the targetted marker type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Returns the targetted attributes. The array may be empty.
- *
- * @return the targetted attributes
- */
- public String[] getAttributes() {
- return attributes;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQueryResult.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQueryResult.java
deleted file mode 100644
index 51d1675952..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQueryResult.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-/*
- * Copied from rg.eclipse.ui.internal.ide.registr.MarkerQueryResult
- */
-class AnnotationQueryResult {
- /**
- * An ordered collection of annotation attribute values.
- */
- private String[] values;
-
- /**
- * Cached hash code value
- */
- private int hashCode;
-
- /**
- * Creates a new annotation query result with the given values.
- * <p>
- * The values may not be empty.
- * </p>
- *
- * @param annotationAttributeValues
- * the target annotation's attribute values
- */
- public AnnotationQueryResult(String[] annotationAttributeValues) {
- if (annotationAttributeValues == null) {
- throw new IllegalArgumentException();
- }
- values = annotationAttributeValues;
- computeHashCode();
- }
-
- /*
- * (non-Javadoc) Method declared on Object.
- */
- public boolean equals(Object o) {
- if (!(o instanceof AnnotationQueryResult)) {
- return false;
- }
-
- if (o == this) {
- return true;
- }
-
- AnnotationQueryResult mqr = (AnnotationQueryResult) o;
- if (values.length != mqr.values.length) {
- return false;
- }
-
- for (int i = 0; i < values.length; i++) {
- if (!(values[i].equals(mqr.values[i]))) {
- return false;
- }
- }
-
- return true;
- }
-
- /*
- * (non-Javadoc) Method declared on Object.
- */
- public int hashCode() {
- return hashCode;
- }
-
- /**
- * Computes the hash code for this instance.
- */
- public void computeHashCode() {
- hashCode = 19;
-
- for (int i = 0; i < values.length; i++) {
- hashCode = hashCode * 37 + values[i].hashCode();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CompoundQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CompoundQuickAssistProcessor.java
deleted file mode 100644
index 7e410d49a6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CompoundQuickAssistProcessor.java
+++ /dev/null
@@ -1,211 +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.wst.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * A quick assist processor that will allow for more than one quick assist
- * processor. It includes quick assist processors contributed via the
- * quickAssistProcessor extended configuration extension point. It also
- * includes quick assist processors contributed via validators.
- */
-public class CompoundQuickAssistProcessor implements IQuickAssistProcessor {
- private final String QUICK_ASSIST_PROCESSOR_EXTENDED_ID = IQuickAssistProcessor.class.getName();
- private Map fProcessors;
- private IQuickAssistProcessor fQuickFixProcessor;
- /**
- * list of partition types where extended processors have been installed
- */
- private List fInstalledExtendedContentTypes;
-
- private Set getQuickAssistProcessors(String partitionType) {
- if (fInstalledExtendedContentTypes == null || !fInstalledExtendedContentTypes.contains(partitionType)) {
- // get extended quick assist processors that have not already
- // been set
- List processors = ExtendedConfigurationBuilder.getInstance().getConfigurations(QUICK_ASSIST_PROCESSOR_EXTENDED_ID, partitionType);
- if (processors != null && !processors.isEmpty()) {
- Iterator iter = processors.iterator();
- while (iter.hasNext()) {
- IQuickAssistProcessor processor = (IQuickAssistProcessor) iter.next();
- setQuickAssistProcessor(partitionType, processor);
- }
- }
- // add partition type to list of extended partition types
- // installed (regardless of whether or not any extended content
- // assist processors were installed because dont want to look it
- // up every time)
- if (fInstalledExtendedContentTypes == null)
- fInstalledExtendedContentTypes = new ArrayList();
- fInstalledExtendedContentTypes.add(partitionType);
- }
-
- Set processors = null;
- if (fProcessors != null)
- processors = (Set) fProcessors.get(partitionType);
-
- return processors;
- }
-
- /**
- * Gets all the quick assist processors relevant to the partion which is
- * calcuated from the given document and offset.
- *
- * @param invocationContext
- * @return Set of quick assist processors or null if none exist
- */
- private Set getQuickAssistProcessors(IQuickAssistInvocationContext invocationContext) {
- Set processsors = null;
-
- ISourceViewer sourceViewer = invocationContext.getSourceViewer();
- if (sourceViewer != null) {
- IDocument document = sourceViewer.getDocument();
- try {
- String partitionType;
- if (document != null)
- partitionType = TextUtilities.getContentType(document, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, invocationContext.getOffset(), true);
- else
- partitionType = IDocument.DEFAULT_CONTENT_TYPE;
-
- processsors = getQuickAssistProcessors(partitionType);
- }
- catch (BadLocationException x) {
- Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
- }
- }
-
- return processsors;
- }
-
- /**
- * Gets the quick assist processor for validator contributed quick fixes
- *
- * @return IQuickAssistProcessor
- */
- private IQuickAssistProcessor getQuickFixProcessor() {
- if (fQuickFixProcessor == null)
- fQuickFixProcessor = new SourceValidationQuickAssistProcessor();
-
- return fQuickFixProcessor;
- }
-
- /**
- * Associates a quick assist processor to a partition type and adds it to
- * the list of processors in this compound processor.
- *
- * @param partitionType
- * @param processor
- */
- private void setQuickAssistProcessor(String partitionType, IQuickAssistProcessor processor) {
- if (fProcessors == null)
- fProcessors = new HashMap();
-
- Set processors = (Set) fProcessors.get(partitionType);
-
- if (processor == null && processors != null) {
- // removing quick assist processor for this partition type
- processors.clear();
- // check if it's the only
- fProcessors.remove(partitionType);
- }
- else {
- if (processors == null) {
- processors = new LinkedHashSet();
- }
- processors.add(processor);
- fProcessors.put(partitionType, processors);
- }
- }
-
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- Set processors = getQuickAssistProcessors(invocationContext);
- if (processors != null) {
- // iterate through list of processors until one processor says
- // canAssist
- for (Iterator it = processors.iterator(); it.hasNext();) {
- IQuickAssistProcessor p = (IQuickAssistProcessor) it.next();
- if (p.canAssist(invocationContext))
- return true;
- }
- }
- return false;
- }
-
- public boolean canFix(Annotation annotation) {
- // only quick fix processor contributes fixes so just check it
- IQuickAssistProcessor processor = getQuickFixProcessor();
- return processor.canFix(annotation);
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
- List proposalsList = new ArrayList();
-
- // first get list of fixes
- IQuickAssistProcessor processor = getQuickFixProcessor();
- ICompletionProposal[] proposals = processor.computeQuickAssistProposals(invocationContext);
- if (proposals != null && proposals.length > 0) {
- proposalsList.addAll(Arrays.asList(proposals));
- }
-
- // no fixes, so try adding assists
- if (proposalsList.isEmpty()) {
- Set processors = getQuickAssistProcessors(invocationContext);
- if (processors != null) {
- // iterate through list of processors until one processor says
- // canAssist
- for (Iterator it = processors.iterator(); it.hasNext();) {
- IQuickAssistProcessor assistProcessor = (IQuickAssistProcessor) it.next();
- ICompletionProposal[] assistProposals = assistProcessor.computeQuickAssistProposals(invocationContext);
- if (assistProposals != null && assistProposals.length > 0) {
- proposalsList.addAll(Arrays.asList(assistProposals));
- }
- }
- }
- }
-
- /*
- * Java editor currently returns a no modification completion proposal
- * but it seems better to just return null so user does not get
- * annoying proposal popup
- */
- if (proposalsList.isEmpty()) {
- // proposalsList.add(new NoModificationCompletionProposal());
- return null;
- }
-
- return (ICompletionProposal[]) proposalsList.toArray(new ICompletionProposal[proposalsList.size()]);
- }
-
- public String getErrorMessage() {
- // never have error messages
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java
deleted file mode 100644
index d64572a0d2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class ContributedProcessorDescriptor {
- private static final String CLASS = "class"; //$NON-NLS-1$
-
- private IConfigurationElement fConfigurationElement;
- private Object fProcessorInstance;
-
- public ContributedProcessorDescriptor(IConfigurationElement element) {
- fConfigurationElement = element;
- fProcessorInstance = null;
- }
-
- public Object getProcessor() throws CoreException {
- if (fProcessorInstance == null && fConfigurationElement != null) {
- fProcessorInstance = fConfigurationElement.createExecutableExtension(CLASS);
- }
- return fProcessorInstance;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java
deleted file mode 100644
index e044939d70..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java
+++ /dev/null
@@ -1,34 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-/**
- * Provides the appropriate correction assistant for a given source viewer.
- * This class should only be a placeholder until the base implements a common
- * way for quickfix/quick assist.
- *
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-abstract public class CorrectionAssistantProvider {
- /**
- * Returns the correction assistant for the given sourceviewer.
- *
- * @param sourceViewer
- * @return
- */
- abstract public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java
deleted file mode 100644
index 6720223719..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public interface IQuickAssistProcessor {
- /**
- * Returns true if the processor can assist at the given offset. This test
- * should be an optimistic guess and be extremly cheap.
- */
- boolean canAssist(StructuredTextViewer viewer, int offset);
-
- /**
- * Collects proposals for assistant at the given offset.
- */
- ICompletionProposal[] getProposals(StructuredTextViewer viewer, int offset) throws CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java
deleted file mode 100644
index c93d21e05c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.source.Annotation;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public interface IQuickFixProcessor {
- /**
- * Returns true if the processor can fix the given problem. This test
- * should be an optimistic guess and be extremly cheap.
- */
- boolean canFix(Annotation annnotation);
-
- /**
- * Collects proposals for fixing the given problem.
- */
- ICompletionProposal[] getProposals(Annotation annnotation) throws CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java
deleted file mode 100644
index babb1a8158..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java
+++ /dev/null
@@ -1,77 +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.sse.ui.internal.correction;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public class NoModificationCompletionProposal implements ICompletionProposal {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
- */
- public void apply(IDocument document) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
- */
- public IContextInformation getContextInformation() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- return SSEUIMessages.NoModificationCompletionProposal_0; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
- */
- public Image getImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
- */
- public Point getSelection(IDocument document) {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
deleted file mode 100644
index 2be196f602..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-public class QuickFixRegistry {
- private static QuickFixRegistry instance;
-
- public synchronized static QuickFixRegistry getInstance() {
- if (instance == null) {
- instance = new QuickFixRegistry();
- new QuickFixRegistryReader().addHelp(instance);
- }
- return instance;
- }
-
- /**
- * Table of queries for marker resolutions
- */
- private Map resolutionQueries = new HashMap();
- /**
- * Resolution class attribute name in configuration element
- */
- private static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- /**
- * Adds a resolution query to the registry.
- *
- * @param query
- * a marker query
- * @param result
- * a result for the given query
- * @param element
- * the configuration element defining the result
- */
- void addResolutionQuery(AnnotationQuery query, AnnotationQueryResult result, IConfigurationElement element) {
- addQuery(resolutionQueries, query, result, element);
- }
-
- /**
- * Adds a query to the given table.
- *
- * @param table
- * the table to which the query is added
- * @param query
- * a marker query
- * @param result
- * a result for the given query
- * @param element
- * the configuration element defining the result
- */
- private void addQuery(Map table, AnnotationQuery query, AnnotationQueryResult result, IConfigurationElement element) {
-
- // See if the query is already in the table
- Map results = (Map) table.get(query);
- if (results == null) {
- // Create a new results table
- results = new HashMap();
-
- // Add the query to the table
- table.put(query, results);
- }
-
- if (results.containsKey(result)) {
- Collection currentElements = (Collection) results.get(result);
- currentElements.add(element);
- }
- else {
- Collection elements = new HashSet();
- elements.add(element);
-
- // Add the new result
- results.put(result, elements);
- }
- }
-
- public IQuickAssistProcessor[] getQuickFixProcessors(Annotation anno) {
- // Collect all matches
- List processors = new ArrayList();
- for (Iterator iter = resolutionQueries.keySet().iterator(); iter.hasNext();) {
- AnnotationQuery query = (AnnotationQuery) iter.next();
- AnnotationQueryResult result = null;
- try {
- /* AnnotationQuery objects are contributed by extension point */
- result = query.performQuery(anno);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- if (result != null) {
- // See if a matching result is registered
- Map resultsTable = (Map) resolutionQueries.get(query);
-
- if (resultsTable.containsKey(result)) {
-
- Iterator elements = ((Collection) resultsTable.get(result)).iterator();
- while (elements.hasNext()) {
- IConfigurationElement element = (IConfigurationElement) elements.next();
-
- IQuickAssistProcessor processor = null;
- try {
- processor = (IQuickAssistProcessor) element.createExecutableExtension(ATT_CLASS);
- }
- catch (CoreException e) {
- }
- if (processor != null) {
- processors.add(processor);
- }
-
- }
- }
- }
- }
- return (IQuickAssistProcessor[]) processors.toArray(new IQuickAssistProcessor[processors.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistryReader.java
deleted file mode 100644
index 4341bde6d4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistryReader.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-
-public class QuickFixRegistryReader extends RegistryReader {
- private static final String QUICKFIXPROCESSOR = "quickFixProcessor"; //$NON-NLS-1$
- private static final String ATT_PROBLEMTYPE = "problemType"; //$NON-NLS-1$
-
- private static final String ATTRIBUTE = "attribute"; //$NON-NLS-1$
- private static final String ATT_NAME = "name"; //$NON-NLS-1$
- private static final String ATT_VALUE = "value"; //$NON-NLS-1$
-
- private ArrayList currentAttributeNames;
-
- private ArrayList currentAttributeValues;
-
- private QuickFixRegistry quickFixProcessorRegistry;
-
- protected boolean readElement(IConfigurationElement element) {
- if (element.getName().equals(QUICKFIXPROCESSOR)) {
- readQuickFixProcessorElement(element);
- return true;
- }
- if (element.getName().equals(ATTRIBUTE)) {
- readAttributeElement(element);
- return true;
- }
- return false;
- }
-
- /**
- * Processes a resolution configuration element.
- */
- private void readQuickFixProcessorElement(IConfigurationElement element) {
- // read type
- String type = element.getAttribute(ATT_PROBLEMTYPE);
-
- // read attributes and values
- currentAttributeNames = new ArrayList();
- currentAttributeValues = new ArrayList();
- readElementChildren(element);
- String[] attributeNames = (String[]) currentAttributeNames.toArray(new String[currentAttributeNames.size()]);
- String[] attributeValues = (String[]) currentAttributeValues.toArray(new String[currentAttributeValues.size()]);
-
- // add query to the registry
- AnnotationQuery query = new AnnotationQuery(type, attributeNames);
- AnnotationQueryResult result = new AnnotationQueryResult(attributeValues);
- quickFixProcessorRegistry.addResolutionQuery(query, result, element);
- }
-
- /**
- * Get the marker help that is defined in the plugin registry and add it
- * to the given marker help registry.
- * <p>
- * Warning: The marker help registry must be passed in because this method
- * is called during the process of setting up the marker help registry and
- * at this time it has not been safely setup with the plugin.
- * </p>
- */
- public void addHelp(QuickFixRegistry registry) {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- quickFixProcessorRegistry = registry;
- readRegistry(extensionRegistry, SSEUIPlugin.ID, QUICKFIXPROCESSOR);
- }
-
- /**
- * Processes an attribute sub element.
- */
- private void readAttributeElement(IConfigurationElement element) {
- String name = element.getAttribute(ATT_NAME);
- String value = element.getAttribute(ATT_VALUE);
- if (name != null && value != null) {
- currentAttributeNames.add(name);
- currentAttributeValues.add(value);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java
deleted file mode 100644
index 9033fd531b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java
+++ /dev/null
@@ -1,118 +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.wst.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension2;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.StructuredTextInvocationContext;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-/**
- * This quick assist processor will provide quick fixes for source validation
- * errors (Temporary Annotation)
- */
-public class SourceValidationQuickAssistProcessor implements IQuickAssistProcessor {
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- return false;
- }
-
- public boolean canFix(Annotation annotation) {
- if (annotation instanceof IQuickFixableAnnotation) {
- if (((IQuickFixableAnnotation) annotation).isQuickFixableStateSet()) {
- return ((IQuickFixableAnnotation) annotation).isQuickFixable();
- }
- }
- return false;
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext quickAssistContext) {
- ISourceViewer viewer = quickAssistContext.getSourceViewer();
- int documentOffset = quickAssistContext.getOffset();
- int length = viewer != null ? viewer.getSelectedRange().y : 0;
-
- IAnnotationModel model = viewer.getAnnotationModel();
- if (model == null)
- return null;
-
- List allProposals = new ArrayList();
- if (model instanceof IAnnotationModelExtension2) {
- Iterator iter = ((IAnnotationModelExtension2) model).getAnnotationIterator(documentOffset, length, true, true);
- while (iter.hasNext()) {
- List processors = new ArrayList();
- Annotation anno = (Annotation) iter.next();
- if (canFix(anno)) {
- // first check to see if annotation already has a quick
- // fix processor attached to it
- if (anno instanceof TemporaryAnnotation) {
- Object o = ((TemporaryAnnotation) anno).getAdditionalFixInfo();
- if (o instanceof IQuickAssistProcessor) {
- processors.add(o);
- }
- }
-
- // get all relevant quick fixes for this annotation
- QuickFixRegistry registry = QuickFixRegistry.getInstance();
- processors.addAll(Arrays.asList(registry.getQuickFixProcessors(anno)));
-
- // set up context
- Map attributes = null;
- if (anno instanceof TemporaryAnnotation) {
- attributes = ((TemporaryAnnotation) anno).getAttributes();
- }
- Position pos = model.getPosition(anno);
- StructuredTextInvocationContext sseContext = new StructuredTextInvocationContext(viewer, pos.getOffset(), pos.getLength(), attributes);
-
- // call each processor
- for (int i = 0; i < processors.size(); ++i) {
- List proposals = new ArrayList();
- collectProposals((IQuickAssistProcessor) processors.get(i), anno, sseContext, proposals);
-
- if (proposals.size() > 0) {
- allProposals.addAll(proposals);
- }
- }
-
- }
- }
- }
-
- if (allProposals.isEmpty())
- return null;
-
- return (ICompletionProposal[]) allProposals.toArray(new ICompletionProposal[allProposals.size()]);
- }
-
- private void collectProposals(IQuickAssistProcessor processor, Annotation annotation, IQuickAssistInvocationContext invocationContext, List proposalsList) {
- ICompletionProposal[] proposals = processor.computeQuickAssistProposals(invocationContext);
- if (proposals != null && proposals.length > 0) {
- proposalsList.addAll(Arrays.asList(proposals));
- }
- }
-
-
- public String getErrorMessage() {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java
deleted file mode 100644
index d19427cbae..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-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.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class StructuredCorrectionProcessor implements IContentAssistProcessor {
- protected IAnnotationModel fAnnotationModel;
- protected IQuickAssistProcessor fQuickAssistProcessor;
- protected IQuickFixProcessor fQuickFixProcessor;
-
- public StructuredCorrectionProcessor(ISourceViewer sourceViewer) {
- fAnnotationModel = sourceViewer.getAnnotationModel();
- }
-
- protected void addQuickAssistProposals(StructuredTextViewer viewer, ArrayList proposals, int documentOffset) {
- try {
- IQuickAssistProcessor processor = getQuickAssistProcessor();
- if (processor != null && processor.canAssist(viewer, documentOffset)) {
- ICompletionProposal[] res = processor.getProposals(viewer, documentOffset);
- if (res != null) {
- for (int k = 0; k < res.length; k++) {
- proposals.add(res[k]);
- }
- }
- }
- } catch (CoreException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- protected void addQuickFixProposals(StructuredTextViewer viewer, ArrayList proposals, int documentOffset) {
- Iterator iter = fAnnotationModel.getAnnotationIterator();
- while (iter.hasNext()) {
- Annotation annotation = (Annotation) iter.next();
- Position pos = fAnnotationModel.getPosition(annotation);
- if (pos != null && documentOffset >= pos.offset && documentOffset <= pos.offset + pos.length) {
- IQuickFixProcessor processor = getQuickFixProcessor();
- if (processor != null && processor.canFix(annotation)) {
- try {
- ICompletionProposal[] res = processor.getProposals(annotation);
- if (res != null) {
- for (int k = 0; k < res.length; k++) {
- proposals.add(res[k]);
- }
- }
- } catch (CoreException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- ArrayList proposals = new ArrayList();
-
- if (viewer instanceof StructuredTextViewer) {
- addQuickFixProposals((StructuredTextViewer) viewer, proposals, documentOffset);
-
- if (proposals.isEmpty()) {
- addQuickAssistProposals((StructuredTextViewer) viewer, proposals, documentOffset);
- }
- }
-
- if (proposals.isEmpty())
- proposals.add(new NoModificationCompletionProposal());
-
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- return null;
- }
-
- protected IQuickAssistProcessor getQuickAssistProcessor() {
- return null;
- }
-
- protected IQuickFixProcessor getQuickFixProcessor() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
deleted file mode 100644
index 7da59b4645..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Pete Carapetyan/Genuitec - 244835 - Enable/Disable breakpoint action does not refresh its label
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.core.runtime.IPath;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-
-public abstract class BreakpointRulerAction extends Action implements IUpdate {
-
- protected class MouseUpdater implements MouseListener {
- public void mouseDoubleClick(MouseEvent e) {
- // do nothing (here)
- }
-
- public void mouseDown(MouseEvent e) {
- update();
- }
-
- public void mouseUp(MouseEvent e) {
- // do nothing
- }
- }
-
- public static final String getFileExtension(IEditorInput input) {
- IPath path = null;
- if (input instanceof IStorageEditorInput) {
- try {
- path = ((IStorageEditorInput) input).getStorage().getFullPath();
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
- if (path != null) {
- return path.getFileExtension();
- }
- String name = input.getName();
- int index = name.lastIndexOf('.');
- if (index == -1)
- return null;
- if (index == (name.length() - 1))
- return ""; //$NON-NLS-1$
- return name.substring(index + 1);
- }
-
- public static final IResource getResource(IEditorInput input) {
- IResource resource = null;
-
- if (input instanceof IFileEditorInput)
- resource = ((IFileEditorInput) input).getFile();
- if (resource == null)
- resource = (IResource) input.getAdapter(IFile.class);
- if (resource == null)
- resource = (IResource) input.getAdapter(IResource.class);
-
- IEditorPart editorPart = null;
- if (resource == null) {
- IWorkbench workbench = SSEUIPlugin.getDefault().getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window != null) {
- IPartService service = window.getPartService();
- if (service != null) {
- Object part = service.getActivePart();
- if (part != null && part instanceof IEditorPart) {
- editorPart = (IEditorPart) part;
- if (editorPart != null) {
- IStructuredModel model = null;
- ITextEditor textEditor = null;
- try {
- if (editorPart instanceof ITextEditor) {
- textEditor = (ITextEditor) editorPart;
- }
- if (textEditor == null) {
- textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
- }
- if (textEditor != null) {
- IDocument textDocument = textEditor.getDocumentProvider().getDocument(input);
- model = StructuredModelManager.getModelManager().getExistingModelForRead(textDocument);
- if (model != null) {
- resource = BreakpointProviderBuilder.getInstance().getResource(input, model.getContentTypeIdentifier(), getFileExtension(input));
- }
- }
- if (resource == null) {
- IBreakpointProvider[] providers = BreakpointProviderBuilder.getInstance().getBreakpointProviders(editorPart, null, getFileExtension(input));
- for (int i = 0; i < providers.length && resource == null; i++) {
- resource = providers[i].getResource(input);
- }
- }
- } catch (Exception e) {
- Logger.logException(e);
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
-
- }
- }
- }
-
- }
- }
- return resource;
- }
-
- protected MouseListener fMouseListener = null;
-
- protected IVerticalRulerInfo fRulerInfo = null;
- protected ITextEditor fTextEditor = null;
-
- private IMenuListener menuListener;
-
- public BreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- super();
- fTextEditor = editor;
- if (rulerInfo != null) {
- fRulerInfo = rulerInfo;
- fMouseListener = new MouseUpdater();
- rulerInfo.getControl().addMouseListener(fMouseListener);
- }
- if (editor instanceof ITextEditorExtension) {
- ITextEditorExtension extension = (ITextEditorExtension) editor;
- menuListener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- update();
- }
- };
- extension.addRulerContextMenuListener(menuListener);
- }
- }
-
- /**
- * Returns the <code>AbstractMarkerAnnotationModel</code> of the
- * editor's input.
- *
- * @return the marker annotation model
- */
- protected AbstractMarkerAnnotationModel getAnnotationModel() {
- IDocumentProvider provider = fTextEditor.getDocumentProvider();
- IAnnotationModel model = provider.getAnnotationModel(fTextEditor.getEditorInput());
- if (model instanceof AbstractMarkerAnnotationModel)
- return (AbstractMarkerAnnotationModel) model;
- return null;
- }
-
- protected IBreakpoint[] getBreakpoints(IMarker[] markers) {
- IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
- List breakpoints = new ArrayList(markers.length);
- for (int i = 0; i < markers.length; i++) {
- IBreakpoint breakpoint = manager.getBreakpoint(markers[i]);
- if (breakpoint != null) {
- breakpoints.add(breakpoint);
- }
- }
- return (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[0]);
- }
-
- /**
- * Returns the <code>IDocument</code> of the editor's input.
- *
- * @return the document of the editor's input
- */
- protected IDocument getDocument() {
- IDocumentProvider provider = fTextEditor.getDocumentProvider();
- return provider.getDocument(fTextEditor.getEditorInput());
- }
-
- /**
- * Returns all breakpoint markers which include the ruler's line of activity.
- *
- * @return an array of markers which include the ruler's line of activity
- */
- protected IMarker[] getMarkers() {
- List markers = new ArrayList();
-
- IResource resource = getResource();
- IDocument document = getDocument();
- AbstractMarkerAnnotationModel annotationModel = getAnnotationModel();
-
- if (resource != null && annotationModel != null && resource.exists()) {
- try {
- IMarker[] allMarkers = resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
- if (allMarkers != null) {
- for (int i = 0; i < allMarkers.length; i++) {
- if (includesRulerLine(annotationModel.getMarkerPosition(allMarkers[i]), document)) {
- markers.add(allMarkers[i]);
- }
- }
- }
- } catch (CoreException x) {
- //
- }
- }
-
- return (IMarker[]) markers.toArray(new IMarker[0]);
- }
-
- protected IResource getResource() {
- IEditorInput input = getTextEditor().getEditorInput();
- IResource resource = getResource(input);
- return resource;
- }
-
- /**
- * @return Returns the rulerInfo.
- */
- public IVerticalRulerInfo getRulerInfo() {
- return fRulerInfo;
- }
-
- /**
- * @return Returns the textEditor.
- */
- public ITextEditor getTextEditor() {
- return fTextEditor;
- }
-
- protected boolean hasMarkers() {
- IResource resource = getResource();
- IDocument document = getDocument();
- AbstractMarkerAnnotationModel model = getAnnotationModel();
-
- if (resource != null && model != null && resource.exists()) {
- try {
- IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
- if (allMarkers != null) {
- for (int i = 0; i < allMarkers.length; i++) {
- if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
- return true;
- }
- }
- }
- } catch (CoreException x) {
- //
- }
- }
- return false;
- }
-
- /**
- * Checks whether a position includes the ruler's line of activity.
- *
- * @param position
- * the position to be checked
- * @param document
- * the document the position refers to
- * @return <code>true</code> if the line is included by the given
- * position
- */
- protected boolean includesRulerLine(Position position, IDocument document) {
- if (position != null && fRulerInfo != null) {
- try {
- int markerLine = document.getLineOfOffset(position.getOffset());
- int line = getRulerInfo().getLineOfLastMouseButtonActivity();
- if (line == markerLine)
- return true;
- // commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI
- // for
- // multiline Bookmarks and Tasks"
- // return (markerLine <= line && line <=
- // document.getLineOfOffset(position.getOffset() +
- // position.getLength()));
- } catch (BadLocationException x) {
- //
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
deleted file mode 100644
index c733782029..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
+++ /dev/null
@@ -1,438 +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.sse.ui.internal.debug;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.editors.text.StorageDocumentProvider;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.MarkerRulerAction;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.IPopupMenuContributor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IExtendedStorageEditorInput;
-
-
-/**
- * @author nitin
- *
- * A text editor capable of using the IBreakpointProvider framework.
- *
- * This class is intended to be used by clients who wish to use the
- * IBreakpointProvider framework but not the StructuredTextEditor, e.g. VBS
- * source editors. It is provided AS-IS and marked internal as it is
- * unsupported and subject to change at any time.
- */
-public class DebugTextEditor extends TextEditor {
-
- private class ShowInTargetLister implements IShowInTargetList {
- public String[] getShowInTargetIds() {
- return fShowInTargetIds;
- }
- }
-
- /**
- * DocumentProvider for IStorageEditorInputs - supports
- * IExtendedStorageEditorInput notifications and assigning breakpoint
- * markers.
- */
- class StorageInputDocumentProvider extends StorageDocumentProvider implements IElementStateListener {
- protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
- IAnnotationModel model = null;
- IStorageEditorInput storageInput = (IStorageEditorInput) element;
- String ext = BreakpointRulerAction.getFileExtension(storageInput);
- IContentType[] types = getEditorInputContentTypes(storageInput);
- IResource res = null;
- for (int i = 0; res == null && i < types.length; i++) {
- res = BreakpointProviderBuilder.getInstance().getResource(storageInput, types[i].getId(), ext);
- }
- String id = storageInput.getName();
- if (storageInput.getStorage() != null) {
- IPath fullPath = storageInput.getStorage().getFullPath();
- if (fullPath != null)
- id = fullPath.toString();
- else
- id = storageInput.getName();
- }
- if (res != null)
- model = new StructuredResourceMarkerAnnotationModel(res, id);
- else
- model = new StructuredResourceMarkerAnnotationModel(ResourcesPlugin.getWorkspace().getRoot(), id);
-
- return model;
- }
-
- protected AbstractDocumentProvider.ElementInfo createElementInfo(Object element) throws CoreException {
- if (element instanceof IExtendedStorageEditorInput) {
- ((IExtendedStorageEditorInput) element).addElementStateListener(this);
- }
- return super.createElementInfo(element);
- }
-
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if (element instanceof IExtendedStorageEditorInput) {
- ((IExtendedStorageEditorInput) element).removeElementStateListener(this);
- }
- super.disposeElementInfo(element, info);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.StorageDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor,
- * java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- // untested
- new FileDocumentProvider().saveDocument(monitor, element, document, overwrite);
- }
-
- public void elementContentAboutToBeReplaced(Object element) {
- fireElementContentAboutToBeReplaced(element);
- }
-
- public void elementContentReplaced(Object element) {
- fireElementContentReplaced(element);
- }
-
- public void elementDeleted(Object element) {
- fireElementDeleted(element);
- }
-
- public void elementDirtyStateChanged(Object element, boolean isDirty) {
- fireElementDirtyStateChanged(element, isDirty);
- }
-
- public void elementMoved(Object originalElement, Object movedElement) {
- fireElementMoved(originalElement, movedElement);
- }
- }
-
- String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV};
- private IShowInTargetList fShowInTargetListAdapter = new ShowInTargetLister();
-
- IDocumentProvider fStorageInputDocumentProvider = null;
-
- public DebugTextEditor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.TextEditor#createActions()
- */
- protected void createActions() {
- super.createActions();
-
- // StructuredTextEditor Action - toggle breakpoints
- IAction action = new ToggleBreakpointAction(this, getVerticalRuler()) {
- protected String getContentType(IDocument document) {
- ILocationProvider provider = (ILocationProvider) getEditorInput().getAdapter(ILocationProvider.class);
- if (provider != null) {
- IPath location = provider.getPath(getEditorInput());
- return detectContentType(location).getId();
- }
- else if (getEditorInput() instanceof IPathEditorInput) {
- IPath location = ((IPathEditorInput) getEditorInput()).getPath();
- return detectContentType(location).getId();
- }
- return IContentTypeManager.CT_TEXT;
- }
- };
- setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
- // StructuredTextEditor Action - manage breakpoints
- action = new ManageBreakpointAction(this, getVerticalRuler());
- setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
- // StructuredTextEditor Action - edit breakpoints
- action = new EditBreakpointAction(this, getVerticalRuler());
- setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
- }
-
- /**
- * Loads the Show In Target IDs from the Extended Configuration extension
- * point.
- *
- * @return
- */
- protected String[] createShowInTargetIds() {
- List allIds = new ArrayList(0);
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
- String[] configurationIds = getConfigurationPoints();
- for (int i = 0; i < configurationIds.length; i++) {
- String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]); //$NON-NLS-1$
- for (int j = 0; j < definitions.length; j++) {
- String someIds = definitions[j];
- if (someIds != null && someIds.length() > 0) {
- String[] ids = StringUtils.unpack(someIds);
- for (int k = 0; k < ids.length; k++) {
- // trim, just to keep things clean
- String id = ids[k].trim();
- if (!allIds.contains(id)) {
- allIds.add(id);
- }
- }
- }
- }
- }
-
- if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
- allIds.add(IPageLayout.ID_RES_NAV);
- }
- return (String[]) allIds.toArray(new String[0]);
- }
-
- IContentType detectContentType(IPath location) {
- IContentType type = null;
-
- IResource resource = FileBuffers.getWorkspaceFileAtLocation(location);
- if (resource != null) {
- if (resource.getType() == IResource.FILE && resource.isAccessible()) {
- IContentDescription d = null;
- try {
- // Optimized description lookup, might not succeed
- d = ((IFile) resource).getContentDescription();
- if (d != null) {
- type = d.getContentType();
- }
- }
- catch (CoreException e) {
- // Should not be possible given the accessible and file
- // type check above
- }
- if (type == null) {
- type = Platform.getContentTypeManager().findContentTypeFor(resource.getName());
- }
- }
- }
- else {
- File file = FileBuffers.getSystemFileAtLocation(location);
- if (file != null) {
- InputStream input = null;
- try {
- input = new FileInputStream(file);
- type = Platform.getContentTypeManager().findContentTypeFor(input, location.toOSString());
- }
- catch (FileNotFoundException e) {
- }
- catch (IOException e) {
- }
- finally {
- if (input != null) {
- try {
- input.close();
- }
- catch (IOException e1) {
- }
- }
- }
- if (type == null) {
- type = Platform.getContentTypeManager().findContentTypeFor(file.getName());
- }
- }
- }
- if (type == null) {
- type = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT);
- }
- return type;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
- */
- protected void editorContextMenuAboutToShow(IMenuManager menu) {
- super.editorContextMenuAboutToShow(menu);
-
- IEditorActionBarContributor c = getEditorSite().getActionBarContributor();
- if (c instanceof IPopupMenuContributor) {
- ((IPopupMenuContributor) c).contributeToPopupMenu(menu);
- }
- else {
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- IExtendedContributor pmc = builder.readActionExtensions(getConfigurationPoints());
- if (pmc != null) {
- pmc.setActiveEditor(this);
- pmc.contributeToPopupMenu(menu);
- }
- }
- }
-
- /**
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- // Navigate action set menu
- if (IShowInTargetList.class.equals(required))
- return fShowInTargetListAdapter;
- return super.getAdapter(required);
- }
-
-
- protected String[] getConfigurationPoints() {
- return ConfigurationPointCalculator.getConfigurationPoints(this, getInputContentType(getEditorInput()), ConfigurationPointCalculator.SOURCE, DebugTextEditor.class);
- }
-
- IContentType[] getEditorInputContentTypes(IEditorInput input) {
- IContentType[] types = null;
- IResource resource = null;
-
- if (input.getAdapter(IFile.class) != null) {
- resource = (IFile) input.getAdapter(IFile.class);
- }
- else if (input.getAdapter(IFile.class) != null) {
- resource = (IResource) input.getAdapter(IResource.class);
- }
- if (resource.getType() == IResource.FILE && resource.isAccessible()) {
- 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
- }
- }
- if (types == null) {
- types = Platform.getContentTypeManager().findContentTypesFor(input.getName());
- }
- return types;
- }
-
- /**
- * @param editorInput
- * @return
- */
- private String getInputContentType(IEditorInput editorInput) {
- IContentType[] types = getEditorInputContentTypes(editorInput);
- if (types != null) {
- return types[0].getId();
- }
- return null;
- }
-
- /**
- *
- * @return
- */
- private boolean isDebuggingAvailable() {
- boolean debuggingAvailable = false;
- IContentType[] types = getEditorInputContentTypes(getEditorInput());
- for (int i = 0; !debuggingAvailable && i < types.length; i++) {
- debuggingAvailable = debuggingAvailable || BreakpointProviderBuilder.getInstance().isAvailable(types[i].getId(), BreakpointRulerAction.getFileExtension(getEditorInput()));
- }
- return debuggingAvailable;
- }
-
- protected void rulerContextMenuAboutToShow(IMenuManager menu) {
- if (isDebuggingAvailable()) {
- menu.add(getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS));
- menu.add(getAction(ActionDefinitionIds.MANAGE_BREAKPOINTS));
- menu.add(getAction(ActionDefinitionIds.EDIT_BREAKPOINTS));
- menu.add(new Separator());
- }
- else {
- Logger.log(Logger.INFO, getClass().getName() + " could not enable debugging actions"); //$NON-NLS-1$
- }
- super.rulerContextMenuAboutToShow(menu);
- }
-
- /**
- * Ensure that the correct IDocumentProvider is used. For IFile and Files,
- * the default provider with a specified AnnotationModelFactory is used.
- * For StorageEditorInputs, use a custom provider that creates a usable
- * ResourceAnnotationModel
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#setDocumentProvider(org.eclipse.ui.IEditorInput)
- */
- protected void setDocumentProvider(IEditorInput input) {
- if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput)) {
- if (fStorageInputDocumentProvider == null) {
- fStorageInputDocumentProvider = new StorageInputDocumentProvider();
- }
- setDocumentProvider(fStorageInputDocumentProvider);
- }
- else {
- super.setDocumentProvider(input);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#updateContentDependentActions()
- */
- protected void updateContentDependentActions() {
- super.updateContentDependentActions();
- if (isDebuggingAvailable()) {
- setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS));
- }
- else {
- // The Default Text Editor uses editorContribution to perform this
- // mapping, but since it relies on the IEditorSite ID, it can't be
- // relied on for MultiPageEditorParts. Instead, force the action
- // registration manually.
- setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, new MarkerRulerAction(SSEUIMessages.getResourceBundle(), "Editor.ManageBookmarks.", this, getVerticalRuler(), IMarker.BOOKMARK, true)); //$NON-NLS-1$
- }
- fShowInTargetIds = createShowInTargetIds();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java
deleted file mode 100644
index 15b988d3dd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java
+++ /dev/null
@@ -1,63 +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.sse.ui.internal.debug;
-
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public class EditBreakpointAction extends BreakpointRulerAction {
- protected IBreakpoint[] breakpoints = null;
-
- /**
- * @param editor
- * @param rulerInfo
- */
- public EditBreakpointAction(ITextEditor editor, IVerticalRuler rulerInfo) {
- super(editor, rulerInfo);
- setText(SSEUIMessages.EditBreakpointAction_0); //$NON-NLS-1$
- }
-
- public void run() {
- PropertyDialogAction action = new PropertyDialogAction(getTextEditor().getEditorSite(), new ISelectionProvider() {
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
-
- public ISelection getSelection() {
- return new StructuredSelection(breakpoints);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- // do nothing
- }
-
- public void setSelection(ISelection selection) {
- // do nothing
- }
- });
- action.run();
- }
-
- public void update() {
- boolean enableThisAction = hasMarkers();
- setEnabled(enableThisAction);
- breakpoints = getBreakpoints(getMarkers());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java
deleted file mode 100644
index 8d7ff2d262..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java
+++ /dev/null
@@ -1,90 +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.sse.ui.internal.debug;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * ManageBreakpointAction - Enables and Disables
- */
-public class ManageBreakpointAction extends BreakpointRulerAction {
-
- protected IBreakpoint[] breakpoints = null;
- private boolean doEnable = true;
-
- /**
- * @param editor
- * @param rulerInfo
- */
- public ManageBreakpointAction(ITextEditor editor, IVerticalRuler rulerInfo) {
- super(editor, rulerInfo);
- setEnabled(true);
- }
-
- /**
- *
- */
- protected void disableBreakpoints(IBreakpoint[] breakpoints) {
- for (int i = 0; i < breakpoints.length; i++) {
- try {
- breakpoints[i].setEnabled(false);
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- protected void enableBreakpoints(IBreakpoint[] breakpoints) {
- for (int i = 0; i < breakpoints.length; i++) {
- try {
- breakpoints[i].setEnabled(true);
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- public void run() {
- if (doEnable)
- enableBreakpoints(breakpoints);
- else
- disableBreakpoints(breakpoints);
- }
-
- public void update() {
- // doEnable means "enable" instead of "disable"
- doEnable = true;
- breakpoints = getBreakpoints(getMarkers());
- for (int i = 0; doEnable && i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- try {
- if (breakpoint.isEnabled()) {
- doEnable = false;
- }
- } catch (CoreException e) {
- Logger.logException("breakpoint not responding to isEnabled: " + breakpoint, e); //$NON-NLS-1$
- }
- }
- setEnabled(breakpoints != null && breakpoints.length > 0);
- if (doEnable)
- setText(SSEUIMessages.ManageBreakpointAction_0); //$NON-NLS-1$
- else
- setText(SSEUIMessages.ManageBreakpointAction_1); //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
deleted file mode 100644
index 8cdb84fc5b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension4;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.util.Debug;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-/**
- * ToggleBreakpointAction
- */
-public class ToggleBreakpointAction extends BreakpointRulerAction {
- IAction fFallbackAction;
-
- /**
- * @param editor
- * @param rulerInfo
- */
- public ToggleBreakpointAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- super(editor, rulerInfo);
- setText(SSEUIMessages.ToggleBreakpointAction_0); //$NON-NLS-1$
- }
-
- public ToggleBreakpointAction(ITextEditor editor, IVerticalRulerInfo rulerInfo, IAction fallbackAction) {
- this(editor, rulerInfo);
- fFallbackAction = fallbackAction;
- }
-
- protected boolean createBreakpoints(int lineNumber) {
- /*
- * Note: we'll always allow processing to continue, even for a "read
- * only" IStorageEditorInput, for the ActiveScript debugger. But this
- * means sometimes the ActiveScript provider might get an input from
- * CVS or something that is not related to debugging.
- */
-
- ITextEditor editor = getTextEditor();
- IEditorInput input = editor.getEditorInput();
- IDocument document = editor.getDocumentProvider().getDocument(input);
- if (document == null)
- return false;
-
- String contentType = getContentType(document);
- IBreakpointProvider[] providers = BreakpointProviderBuilder.getInstance().getBreakpointProviders(editor, contentType, getFileExtension(input));
-
- int pos = -1;
- ISourceEditingTextTools tools = (ISourceEditingTextTools) editor.getAdapter(ISourceEditingTextTools.class);
- if (tools != null) {
- pos = tools.getCaretOffset();
- }
-
- final int n = providers.length;
- List errors = new ArrayList(0);
- for (int i = 0; i < n; i++) {
- try {
- if (Debug.debugBreakpoints)
- System.out.println(providers[i].getClass().getName() + " adding breakpoint to line " + lineNumber); //$NON-NLS-1$
- IStatus status = providers[i].addBreakpoint(document, input, lineNumber, pos);
- if (status != null && !status.isOK()) {
- errors.add(status);
- }
- }
- catch (CoreException e) {
- errors.add(e.getStatus());
- }
- catch (Exception t) {
- Logger.logException("exception while adding breakpoint", t); //$NON-NLS-1$
- }
- }
-
- IStatus status = null;
- if (errors.size() > 0) {
- Shell shell = editor.getSite().getShell();
- if (errors.size() > 1) {
- status = new MultiStatus(SSEUIPlugin.ID, IStatus.OK, (IStatus[]) errors.toArray(new IStatus[0]), SSEUIMessages.ManageBreakpoints_error_adding_message1, null); //$NON-NLS-1$
- }
- else {
- status = (IStatus) errors.get(0);
- }
- if ((status.getSeverity() > IStatus.INFO) || (Platform.inDebugMode() && !status.isOK())) {
- Platform.getLog(SSEUIPlugin.getDefault().getBundle()).log(status);
- }
- /*
- * Show for conditions more severe than INFO or when no
- * breakpoints were created
- */
- if (status.getSeverity() > IStatus.INFO && getBreakpoints(getMarkers()).length < 1) {
- ErrorDialog.openError(shell, SSEUIMessages.ManageBreakpoints_error_adding_title1, status.getMessage(), status); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- }
- /*
- * Although no errors were reported, no breakpoints exist on this line
- * after having run the existing providers. Run the fallback action.
- */
- if ((status == null || status.getSeverity() < IStatus.WARNING) && fFallbackAction != null && !hasMarkers()) {
- if (fFallbackAction instanceof ISelectionListener) {
- ((ISelectionListener) fFallbackAction).selectionChanged(null, null);
- }
- fFallbackAction.run();
- }
- return true;
- }
-
- protected String getContentType(IDocument document) {
- IModelManager mgr = StructuredModelManager.getModelManager();
- String contentType = null;
-
- IDocumentProvider provider = fTextEditor.getDocumentProvider();
- if (provider instanceof IDocumentProviderExtension4) {
- try {
- IContentType type = ((IDocumentProviderExtension4) provider).getContentType(fTextEditor.getEditorInput());
- if (type != null)
- contentType = type.getId();
- }
- catch (CoreException e) {
- /*
- * A failure accessing the underlying store really isn't
- * interesting, although it can be a problem for
- * IStorageEditorInputs.
- */
- }
- }
-
- if (contentType == null) {
- IStructuredModel model = null;
- try {
- model = mgr.getExistingModelForRead(document);
- if (model != null) {
- contentType = model.getContentTypeIdentifier();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return contentType;
- }
-
- protected void removeBreakpoints(int lineNumber) {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- IBreakpoint[] breakpoints = getBreakpoints(getMarkers());
- for (int i = 0; i < breakpoints.length; i++) {
- try {
- breakpointManager.removeBreakpoint(breakpoints[i], true);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- public void run() {
- int lineNumber = fRulerInfo.getLineOfLastMouseButtonActivity() + 1;
- boolean doAdd = !hasMarkers();
- if (doAdd)
- createBreakpoints(lineNumber);
- else
- removeBreakpoints(lineNumber);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- * overriding for lazy loading
- */
- public ImageDescriptor getImageDescriptor() {
-
- ImageDescriptor image = super.getImageDescriptor();
- if (image == null){
- image = DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_BREAKPOINT);
- setImageDescriptor(image);
- }
- return image;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java
deleted file mode 100644
index 57c8c5ef72..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author nsd
- */
-public class ToggleBreakpointsTarget implements IToggleBreakpointsTarget {
- static final IToggleBreakpointsTarget instance = new ToggleBreakpointsTarget();
-
- public static IToggleBreakpointsTarget getInstance() {
- return instance;
- }
-
- /**
- *
- */
- private ToggleBreakpointsTarget() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) {
- ITextEditor editor = (ITextEditor) part.getAdapter(ITextEditor.class);
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) selection;
- IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- if (document != null && textSelection.getOffset() > -1) {
- int lineNumber = -1;
- try {
- lineNumber = document.getLineOfOffset(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- }
- if (lineNumber >= 0) {
- ToggleBreakpointAction toggler = new ToggleBreakpointAction(editor, null);
- toggler.update();
- return toggler.isEnabled();
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
- return false;
- }
-
- private IBreakpoint[] getBreakpoints(IResource resource, IDocument document, AbstractMarkerAnnotationModel model, int lineNumber) {
- List markers = new ArrayList();
- if (resource != null && model != null && resource.exists()) {
- try {
- IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
- if (allMarkers != null) {
- for (int i = 0; i < allMarkers.length; i++) {
- Position p = model.getMarkerPosition(allMarkers[i]);
- int markerLine = -1;
- try {
- markerLine = document.getLineOfOffset(p.getOffset());
- }
- catch (BadLocationException e1) {
- }
- if (markerLine == lineNumber) {
- markers.add(allMarkers[i]);
- }
- }
- }
- }
- catch (CoreException x) {
- }
- }
- IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
- List breakpoints = new ArrayList(markers.size());
- for (int i = 0; i < markers.size(); i++) {
- IBreakpoint breakpoint = manager.getBreakpoint((IMarker) markers.get(i));
- if (breakpoint != null) {
- breakpoints.add(breakpoint);
- }
- }
- return (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[0]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- ITextEditor editor = (ITextEditor) part.getAdapter(ITextEditor.class);
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) selection;
- IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- int lineNumber = -1;
- try {
- lineNumber = document.getLineOfOffset(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- }
- if (lineNumber >= 0) {
- ToggleBreakpointAction toggler = new ToggleBreakpointAction(editor, null);
- toggler.update();
- if (toggler.isEnabled()) {
- IResource resource = toggler.getResource();
- AbstractMarkerAnnotationModel model = toggler.getAnnotationModel();
- IBreakpoint[] breakpoints = getBreakpoints(resource, document, model, lineNumber);
- if (breakpoints.length > 0) {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- for (int i = 0; i < breakpoints.length; i++) {
- breakpoints[i].getMarker().delete();
- breakpointManager.removeBreakpoint(breakpoints[i], true);
- }
- }
- else {
- toggler.createBreakpoints(lineNumber + 1);
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java
deleted file mode 100644
index 434c37c8e6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.PushbackReader;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.HTML2TextReader Modifications
- * were made to add br/ tag and fix warnings
- */
-/**
- * Reads the text contents from a reader of HTML contents and translates the
- * tags or cut them out.
- */
-public class HTML2TextReader extends SubstitutionTextReader {
-
- private static final String EMPTY_STRING= ""; //$NON-NLS-1$
- private static final Map fgEntityLookup;
- private static final Set fgTags;
-
- static {
-
- fgTags= new HashSet();
- fgTags.add("b"); //$NON-NLS-1$
- fgTags.add("br"); //$NON-NLS-1$
- fgTags.add("br/");//$NON-NLS-1$
- fgTags.add("h1"); //$NON-NLS-1$
- fgTags.add("h2"); //$NON-NLS-1$
- fgTags.add("h3"); //$NON-NLS-1$
- fgTags.add("h4"); //$NON-NLS-1$
- fgTags.add("h5"); //$NON-NLS-1$
- fgTags.add("h6"); //$NON-NLS-1$
- fgTags.add("hr"); //$NON-NLS-1$
- fgTags.add("p"); //$NON-NLS-1$
- fgTags.add("dl"); //$NON-NLS-1$
- fgTags.add("dt"); //$NON-NLS-1$
- fgTags.add("dd"); //$NON-NLS-1$
- fgTags.add("li"); //$NON-NLS-1$
- fgTags.add("ul"); //$NON-NLS-1$
- fgTags.add("pre"); //$NON-NLS-1$
- fgTags.add("html"); //$NON-NLS-1$
- fgTags.add("head"); //$NON-NLS-1$
- fgTags.add("body"); //$NON-NLS-1$
- fgTags.add("code"); //$NON-NLS-1$
- fgTags.add("font"); //$NON-NLS-1$
- fgTags.add("blockquote"); //$NON-NLS-1$
- fgTags.add("a"); //$NON-NLS-1$
- fgTags.add("tt"); //$NON-NLS-1$
- fgTags.add("tl"); //$NON-NLS-1$
- fgTags.add("em"); //$NON-NLS-1$
- fgTags.add("i"); //$NON-NLS-1$
-
- fgEntityLookup= new HashMap(7);
- fgEntityLookup.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("circ", "^"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("tilde", "~"); //$NON-NLS-2$ //$NON-NLS-1$
- fgEntityLookup.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private int fCounter= 0;
- private TextPresentation fTextPresentation;
- private int fBold= 0;
- private int fStartOffset= -1;
- private boolean fInParagraph= false;
- private boolean fIsPreformattedText= false;
- private boolean fIgnore= false;
- private boolean fHeaderDetected= false;
-
- /**
- * Transforms the html text from the reader to formatted text.
- * @param presentation If not <code>null</code>, formattings will be applied to
- * the presentation.
- */
- public HTML2TextReader(Reader reader, TextPresentation presentation) {
- super(new PushbackReader(reader));
- fTextPresentation= presentation;
- }
-
- public int read() throws IOException {
- int c= super.read();
- if (c != -1)
- ++ fCounter;
- return c;
- }
-
- protected void startBold() {
- if (fBold == 0)
- fStartOffset= fCounter;
- ++ fBold;
- }
-
- protected void startPreformattedText() {
- fIsPreformattedText= true;
- setSkipWhitespace(false);
- }
-
- protected void stopPreformattedText() {
- fIsPreformattedText= false;
- setSkipWhitespace(true);
- }
-
- protected void stopBold() {
- -- fBold;
- if (fBold == 0) {
- if (fTextPresentation != null) {
- fTextPresentation.addStyleRange(new StyleRange(fStartOffset, fCounter - fStartOffset, null, null, SWT.BOLD));
- }
- fStartOffset= -1;
- }
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
- */
- protected String computeSubstitution(int c) throws IOException {
-
- if (c == '<')
- return processHTMLTag();
- else if (fIgnore)
- return EMPTY_STRING;
- else if (c == '&')
- return processEntity();
- else if (fIsPreformattedText)
- return processPreformattedText(c);
-
- return null;
- }
-
- private String html2Text(String html) {
-
- if (html == null || html.length() == 0)
- return EMPTY_STRING;
-
- String tag= html;
- if ('/' == tag.charAt(0))
- tag= tag.substring(1);
-
- final int ws = tag.indexOf(' ');
- if (ws > 0) {
- tag = tag.substring(0, ws);
- }
-
- if ("head".equals(html) && !fHeaderDetected) { //$NON-NLS-1$
- fHeaderDetected= true;
- fIgnore= true;
- return EMPTY_STRING;
- }
-
- if ("/head".equals(html) && fHeaderDetected && fIgnore) { //$NON-NLS-1$
- fIgnore= false;
- return EMPTY_STRING;
- }
-
- if (fIgnore)
- return EMPTY_STRING;
-
- if (!fgTags.contains(tag))
- return '<' + html + '>';
-
- if ("pre".equals(html)) { //$NON-NLS-1$
- startPreformattedText();
- return EMPTY_STRING;
- }
-
- if ("/pre".equals(html)) { //$NON-NLS-1$
- stopPreformattedText();
- return EMPTY_STRING;
- }
-
- if (fIsPreformattedText)
- return EMPTY_STRING;
-
- if ("b".equals(html)) { //$NON-NLS-1$
- startBold();
- return EMPTY_STRING;
- }
-
- if ("h5".equals(html) || "dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$
- startBold();
- return EMPTY_STRING;
- }
-
- if ("dl".equals(html)) //$NON-NLS-1$
- return LINE_DELIM;
-
- if ("dd".equals(html)) //$NON-NLS-1$
- return "\t"; //$NON-NLS-1$
-
- if ("li".equals(html)) //$NON-NLS-1$
- return LINE_DELIM + "\t" + "- "; //$NON-NLS-1$ //$NON-NLS-2$
-
- if ("/b".equals(html)) { //$NON-NLS-1$
- stopBold();
- return EMPTY_STRING;
- }
-
- if ("p".equals(html)) { //$NON-NLS-1$
- fInParagraph= true;
- return LINE_DELIM;
- }
-
- if ("br".equals(html) || "br/".equals(html)) //$NON-NLS-1$ //$NON-NLS-2$
- return LINE_DELIM;
-
- if ("/p".equals(html)) { //$NON-NLS-1$
- boolean inParagraph= fInParagraph;
- fInParagraph= false;
- return inParagraph ? EMPTY_STRING : LINE_DELIM;
- }
-
- if ("/h5".equals(html) || "/dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$
- stopBold();
- return LINE_DELIM;
- }
-
- if ("/dd".equals(html)) //$NON-NLS-1$
- return LINE_DELIM;
-
- return EMPTY_STRING;
- }
-
- /*
- * A '<' has been read. Process a html tag
- */
- private String processHTMLTag() throws IOException {
-
- StringBuffer buf= new StringBuffer();
- int ch;
- do {
-
- ch= nextChar();
-
- while (ch != -1 && ch != '>') {
- buf.append(Character.toLowerCase((char) ch));
- ch= nextChar();
- if (ch == '"'){
- buf.append(Character.toLowerCase((char) ch));
- ch= nextChar();
- while (ch != -1 && ch != '"'){
- buf.append(Character.toLowerCase((char) ch));
- ch= nextChar();
- }
- }
- if (ch == '<'){
- unread(ch);
- return '<' + buf.toString();
- }
- }
-
- if (ch == -1)
- return null;
-
- int tagLen= buf.length();
- // needs special treatment for comments
- if ((tagLen >= 3 && "!--".equals(buf.substring(0, 3))) //$NON-NLS-1$
- && !(tagLen >= 5 && "--".equals(buf.substring(tagLen - 2)))) { //$NON-NLS-1$
- // unfinished comment
- buf.append(ch);
- } else {
- break;
- }
- } while (true);
-
- return html2Text(buf.toString());
- }
-
- private String processPreformattedText(int c) {
- if (c == '\r' || c == '\n')
- fCounter++;
- return null;
- }
-
-
- private void unread(int ch) throws IOException {
- ((PushbackReader) getReader()).unread(ch);
- }
-
- protected String entity2Text(String symbol) {
- if (symbol.length() > 1 && symbol.charAt(0) == '#') {
- int ch;
- try {
- if (symbol.charAt(1) == 'x') {
- ch= Integer.parseInt(symbol.substring(2), 16);
- } else {
- ch= Integer.parseInt(symbol.substring(1), 10);
- }
- return EMPTY_STRING + (char)ch;
- } catch (NumberFormatException e) {
- // log problem?
- }
- } else {
- String str= (String) fgEntityLookup.get(symbol);
- if (str != null) {
- return str;
- }
- }
- return "&" + symbol; // not found //$NON-NLS-1$
- }
-
- /*
- * A '&' has been read. Process a entity
- */
- private String processEntity() throws IOException {
- StringBuffer buf= new StringBuffer();
- int ch= nextChar();
- while (Character.isLetterOrDigit((char)ch) || ch == '#') {
- buf.append((char) ch);
- ch= nextChar();
- }
-
- if (ch == ';')
- return entity2Text(buf.toString());
-
- buf.insert(0, '&');
- if (ch != -1)
- buf.append((char) ch);
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java
deleted file mode 100644
index d56b2d58a3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Iterator;
-
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.Drawable;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.HTMLTextPresenter
- * Modifications were made to use own Logger to log exception, and the
- * ellipses constant
- */
-public class HTMLTextPresenter implements DefaultInformationControl.IInformationPresenter, DefaultInformationControl.IInformationPresenterExtension {
- private static final String ELLIPSES = "..."; //$NON-NLS-1$
- private static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
- private int fCounter;
- private boolean fEnforceUpperLineLimit;
-
- public HTMLTextPresenter(boolean enforceUpperLineLimit) {
- super();
- fEnforceUpperLineLimit = enforceUpperLineLimit;
- }
-
- public HTMLTextPresenter() {
- this(true);
- }
-
- protected Reader createReader(String hoverInfo, TextPresentation presentation) {
- return new HTML2TextReader(new StringReader(hoverInfo), presentation);
- }
-
- protected void adaptTextPresentation(TextPresentation presentation, int offset, int insertLength) {
-
- int yoursStart = offset;
- int yoursEnd = offset + insertLength - 1;
- yoursEnd = Math.max(yoursStart, yoursEnd);
-
- Iterator e = presentation.getAllStyleRangeIterator();
- while (e.hasNext()) {
-
- StyleRange range = (StyleRange) e.next();
-
- int myStart = range.start;
- int myEnd = range.start + range.length - 1;
- myEnd = Math.max(myStart, myEnd);
-
- if (myEnd < yoursStart)
- continue;
-
- if (myStart < yoursStart)
- range.length += insertLength;
- else
- range.start += insertLength;
- }
- }
-
- private void append(StringBuffer buffer, String string, TextPresentation presentation) {
-
- int length = string.length();
- buffer.append(string);
-
- if (presentation != null)
- adaptTextPresentation(presentation, fCounter, length);
-
- fCounter += length;
- }
-
- private String getIndent(String line) {
- int length = line.length();
-
- int i = 0;
- while (i < length && Character.isWhitespace(line.charAt(i)))
- ++i;
-
- return (i == length ? line : line.substring(0, i)) + " "; //$NON-NLS-1$
- }
-
- /**
- * @see IHoverInformationPresenter#updatePresentation(Display display,
- * String, TextPresentation, int, int)
- * @deprecated Use {@link #updatePresentation(Drawable, String, TextPresentation, int, int)}
- * instead
- */
- public String updatePresentation(Display display, String hoverInfo, TextPresentation presentation, int maxWidth, int maxHeight) {
- return updatePresentation((Drawable)display, hoverInfo, presentation, maxWidth, maxHeight);
- }
-
- /*
- * @see IHoverInformationPresenterExtension#updatePresentation(Drawable drawable, String, TextPresentation, int, int)
- * @since 3.2
- */
- public String updatePresentation(Drawable drawable, String hoverInfo, TextPresentation presentation, int maxWidth, int maxHeight) {
-
- if (hoverInfo == null)
- return null;
-
- GC gc = new GC(drawable);
- try {
-
- StringBuffer buffer = new StringBuffer();
- int maxNumberOfLines = Math.round(maxHeight / gc.getFontMetrics().getHeight());
-
- fCounter = 0;
- LineBreakingReader reader = new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth);
-
- boolean lastLineFormatted = false;
- String lastLineIndent = null;
-
- String line = reader.readLine();
- boolean lineFormatted = reader.isFormattedLine();
- boolean firstLineProcessed = false;
-
- while (line != null) {
-
- if (fEnforceUpperLineLimit && maxNumberOfLines <= 0)
- break;
-
- if (firstLineProcessed) {
- if (!lastLineFormatted)
- append(buffer, LINE_DELIM, null);
- else {
- append(buffer, LINE_DELIM, presentation);
- if (lastLineIndent != null)
- append(buffer, lastLineIndent, presentation);
- }
- }
-
- append(buffer, line, null);
- firstLineProcessed = true;
-
- lastLineFormatted = lineFormatted;
- if (!lineFormatted)
- lastLineIndent = null;
- else if (lastLineIndent == null)
- lastLineIndent = getIndent(line);
-
- line = reader.readLine();
- lineFormatted = reader.isFormattedLine();
-
- maxNumberOfLines--;
- }
-
- if (line != null && buffer.length() > 0) {
- append(buffer, LINE_DELIM, lineFormatted ? presentation : null);
- append(buffer, ELLIPSES, presentation);
- }
-
- return trim(buffer, presentation);
-
- } catch (IOException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- return null;
-
- } finally {
- gc.dispose();
- }
- }
-
- private String trim(StringBuffer buffer, TextPresentation presentation) {
-
- int length = buffer.length();
-
- int end = length - 1;
- while (end >= 0 && Character.isWhitespace(buffer.charAt(end)))
- --end;
-
- if (end == -1)
- return ""; //$NON-NLS-1$
-
- if (end < length - 1)
- buffer.delete(end + 1, length);
- else
- end = length;
-
- int start = 0;
- while (start < end && Character.isWhitespace(buffer.charAt(start)))
- ++start;
-
- buffer.delete(0, start);
- presentation.setResultWindow(new Region(start, buffer.length()));
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
deleted file mode 100644
index cea5449f96..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
+++ /dev/null
@@ -1,124 +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.wst.sse.ui.internal.derived;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-import com.ibm.icu.text.BreakIterator;
-
-import org.eclipse.swt.graphics.GC;
-
-/**
- * Copied from org.eclipse.jdt.internal.ui.text.LineBreakingReader.
- * Modifications were made to fix warnings.
- */
-/*
- * Not a real reader. Could change if requested
- */
-public class LineBreakingReader {
- private GC fGC;
-
- private String fLine;
-
- private BreakIterator fLineBreakIterator;
- private int fMaxWidth;
- private int fOffset;
-
-
- private BufferedReader fReader;
-
- /**
- * Creates a reader that breaks an input text to fit in a given width.
- *
- * @param reader
- * Reader of the input text
- * @param gc
- * The graphic context that defines the currently used font
- * sizes
- * @param maxLineWidth
- * The max width (pixes) where the text has to fit in
- */
- public LineBreakingReader(Reader reader, GC gc, int maxLineWidth) {
- fReader = new BufferedReader(reader);
- fGC = gc;
- fMaxWidth = maxLineWidth;
- fOffset = 0;
- fLine = null;
- fLineBreakIterator = BreakIterator.getLineInstance();
- }
-
- private int findNextBreakOffset(int currOffset) {
- int currWidth = 0;
- int nextOffset = fLineBreakIterator.following(currOffset);
- while (nextOffset != BreakIterator.DONE) {
- String word = fLine.substring(currOffset, nextOffset);
- int wordWidth = fGC.textExtent(word).x;
- int nextWidth = wordWidth + currWidth;
- if (nextWidth > fMaxWidth) {
- if (currWidth > 0) {
- return currOffset;
- }
- return nextOffset;
- }
- currWidth = nextWidth;
- currOffset = nextOffset;
- nextOffset = fLineBreakIterator.next();
- }
- return nextOffset;
- }
-
- private int findWordBegin(int idx) {
- while (idx < fLine.length() && Character.isWhitespace(fLine.charAt(idx))) {
- idx++;
- }
- return idx;
- }
-
- public boolean isFormattedLine() {
- return fLine != null;
- }
-
- /**
- * Reads the next line. The lengths of the line will not exceed the gived
- * maximum width.
- */
- public String readLine() throws IOException {
- if (fLine == null) {
- String line = fReader.readLine();
- if (line == null)
- return null;
-
- int lineLen = fGC.textExtent(line).x;
- if (lineLen < fMaxWidth) {
- return line;
- }
- fLine = line;
- fLineBreakIterator.setText(line);
- fOffset = 0;
- }
- int breakOffset = findNextBreakOffset(fOffset);
- String res;
- if (breakOffset != BreakIterator.DONE) {
- res = fLine.substring(fOffset, breakOffset);
- fOffset = findWordBegin(breakOffset);
- if (fOffset == fLine.length()) {
- fLine = null;
- }
- } else {
- res = fLine.substring(fOffset);
- fLine = null;
- }
- return res;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index 56945ff660..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/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.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
- * Modification was made to fix statement unnecessarily nested within else
- * clause warning in read(..).
- */
-public abstract class SingleCharReader extends Reader {
-
- /**
- * @see Reader#read()
- */
- public abstract int read() throws IOException;
-
- /**
- * @see Reader#read(char[],int,int)
- */
- public int read(char cbuf[], int off, int len) throws IOException {
- int end = off + len;
- for (int i = off; i < end; i++) {
- int ch = read();
- if (ch == -1) {
- if (i == off) {
- return -1;
- }
- return i - off;
- }
- cbuf[i] = (char) ch;
- }
- return len;
- }
-
- /**
- * @see Reader#ready()
- */
- public boolean ready() throws IOException {
- return true;
- }
-
- /**
- * Gets the content as a String
- */
- public String getString() throws IOException {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = read()) != -1) {
- buf.append((char) ch);
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java
deleted file mode 100644
index 4d2a78f252..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java
+++ /dev/null
@@ -1,158 +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.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.SubstitutionTextReader.
- * Modifications were made to read() to allow whitespaces and fixed statement
- * unnecessarily nested within else clause warning in nextChar()
- */
-/**
- * Reads the text contents from a reader and computes for each character a
- * potential substitution. The substitution may eat more characters than only
- * the one passed into the computation routine.
- */
-public abstract class SubstitutionTextReader extends SingleCharReader {
-
- protected static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
- private Reader fReader;
- protected boolean fWasWhiteSpace;
- private int fCharAfterWhiteSpace;
-
- /**
- * Tells whether white space characters are skipped.
- */
- private boolean fSkipWhiteSpace = true;
-
- private boolean fReadFromBuffer;
- private StringBuffer fBuffer;
- private int fIndex;
-
-
- protected SubstitutionTextReader(Reader reader) {
- fReader = reader;
- fBuffer = new StringBuffer();
- fIndex = 0;
- fReadFromBuffer = false;
- fCharAfterWhiteSpace = -1;
- fWasWhiteSpace = true;
- }
-
- /**
- * Implement to compute the substitution for the given character and if
- * necessary subsequent characters. Use <code>nextChar</code> to read
- * subsequent characters.
- */
- protected abstract String computeSubstitution(int c) throws IOException;
-
- /**
- * Returns the internal reader.
- */
- protected Reader getReader() {
- return fReader;
- }
-
- /**
- * Returns the next character.
- */
- protected int nextChar() throws IOException {
- fReadFromBuffer = (fBuffer.length() > 0);
- if (fReadFromBuffer) {
- char ch = fBuffer.charAt(fIndex++);
- if (fIndex >= fBuffer.length()) {
- fBuffer.setLength(0);
- fIndex = 0;
- }
- return ch;
- }
- int ch = fCharAfterWhiteSpace;
- if (ch == -1) {
- ch = fReader.read();
- }
- if (fSkipWhiteSpace && Character.isWhitespace((char) ch)) {
- do {
- ch = fReader.read();
- } while (Character.isWhitespace((char) ch));
- if (ch != -1) {
- fCharAfterWhiteSpace = ch;
- return ' ';
- }
- } else {
- fCharAfterWhiteSpace = -1;
- }
- return ch;
- }
-
- /**
- * @see Reader#read()
- */
- public int read() throws IOException {
- int c;
- do {
-
- c = nextChar();
- while (!fReadFromBuffer) {
- String s = computeSubstitution(c);
- if (s == null)
- break;
- if (s.length() > 0)
- fBuffer.insert(0, s);
- c = nextChar();
- }
-
- } while (fSkipWhiteSpace && fWasWhiteSpace && ((c == ' ') && !fReadFromBuffer));
- /*
- * SSE: For above and below check, if whitespace is read from buffer,
- * do not skip
- */
- fWasWhiteSpace = ((c == ' ' && !fReadFromBuffer) || c == '\r' || c == '\n');
- return c;
- }
-
- /**
- * @see Reader#ready()
- */
- public boolean ready() throws IOException {
- return fReader.ready();
- }
-
- /**
- * @see Reader#close()
- */
- public void close() throws IOException {
- fReader.close();
- }
-
- /**
- * @see Reader#reset()
- */
- public void reset() throws IOException {
- fReader.reset();
- fWasWhiteSpace = true;
- fCharAfterWhiteSpace = -1;
- fBuffer.setLength(0);
- fIndex = 0;
- }
-
- protected final void setSkipWhitespace(boolean state) {
- fSkipWhiteSpace = state;
- }
-
- protected final boolean isSkippingWhitespace() {
- return fSkipWhiteSpace;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java
deleted file mode 100644
index 3a9b0c9448..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java
+++ /dev/null
@@ -1,58 +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.sse.ui.internal.edit.util;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-
-public class SharedEditorPluginImageHelper {
- public static final String IMG_DLCL_COLLAPSEALL = EditorPluginImages.IMG_DLCL_COLLAPSEALL;
- public static final String IMG_DLCL_DELETE = EditorPluginImages.IMG_DLCL_DELETE;
- public static final String IMG_DLCL_SYNCED = EditorPluginImages.IMG_DLCL_SYNCED;
- public static final String IMG_ELCL_COLLAPSEALL = EditorPluginImages.IMG_ELCL_COLLAPSEALL;
- public static final String IMG_ELCL_DELETE = EditorPluginImages.IMG_ELCL_DELETE;
- public static final String IMG_ELCL_SYNCED = EditorPluginImages.IMG_ELCL_SYNCED;
-
- /**
- * Retrieves the specified image from the source editor plugin's image
- * registry. Note: The returned <code>Image</code> is managed by the
- * workbench; clients must <b>not </b> dispose of the returned image.
- *
- * @param symbolicName
- * the symbolic name of the image; there are constants declared
- * in this class for build-in images that come with the source
- * editor
- * @return the image, or <code>null</code> if not found
- */
- public static Image getImage(String symbolicName) {
- return EditorPluginImageHelper.getInstance().getImage(symbolicName);
- }
-
- /**
- * Retrieves the image descriptor for specified image from the source
- * editor plugin's image registry. Unlike <code>Image</code>s, image
- * descriptors themselves do not need to be disposed.
- *
- * @param symbolicName
- * the symbolic name of the image; there are constants declared
- * in this interface for build-in images that come with the
- * source editor
- * @return the image descriptor, or <code>null</code> if not found
- */
- public static ImageDescriptor getImageDescriptor(String symbolicName) {
- return EditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
deleted file mode 100644
index 93d620a3da..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
+++ /dev/null
@@ -1,80 +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.sse.ui.internal.editor;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryExtension;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * INTERNAL USAGE ONLY
- *
- * Adds adapter factories intended solely for use when the model is
- * interacting with a UI.
- *
- * @author nsd
- */
-public class EditorModelUtil {
-
- public static void addFactoriesTo(final IStructuredModel structuredModel) {
- if (structuredModel == null)
- return;
-
- AdapterFactoryRegistry adapterRegistry = SSEUIPlugin.getDefault().getAdapterFactoryRegistry();
- String contentTypeId = structuredModel.getContentTypeIdentifier();
-
- Iterator adapterFactoryProviders = null;
- if (adapterRegistry instanceof AdapterFactoryRegistryExtension) {
- adapterFactoryProviders = ((AdapterFactoryRegistryExtension) adapterRegistry).getAdapterFactories(contentTypeId);
- }
- else {
- adapterFactoryProviders = adapterRegistry.getAdapterFactories();
- }
-
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, SSEUIMessages.EditorModelUtil_0); //$NON-NLS-1$
- // Add all those appropriate for this particular type of content
- while (adapterFactoryProviders.hasNext()) {
- try {
- final AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterFactoryProviders.next();
- /*
- * ContentType might have already been checked above, this
- * check is here for backwards compatability for those that
- * don't specify a content type
- */
- if (provider.isFor(structuredModel.getModelHandler())) {
- SafeRunner.run(new SafeRunnable(SSEUIMessages.EditorModelUtil_1) { //$NON-NLS-1$
- public void run() {
- provider.addAdapterFactories(structuredModel);
- }
- });
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java
deleted file mode 100644
index f78633f744..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-
-/**
- * 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 EditorPluginImageHelper {
- private static EditorPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a EditorPluginImageHelper
- */
- public synchronized static EditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new EditorPluginImageHelper();
- return instance;
- }
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
- private final String PLUGINID = SSEUIPlugin.ID;
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
- getImageRegistry().put(resource, image);
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- } else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- //create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- } else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java
deleted file mode 100644
index 7b388440f2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.editor;
-
-/**
- * Bundle of most images used by the Source Editor plug-in.
- */
-public class EditorPluginImages {
-
- public static final String IMG_CTOOL16_SPELLCHECK = "icons/full/ctool16/spellcheck.gif"; //$NON-NLS-1$
- public static final String IMG_DLCL_COLLAPSEALL = "icons/full/dlcl16/collapseall.gif"; //$NON-NLS-1$
- public static final String IMG_DLCL_DELETE = "icons/full/dlcl16/delete.gif"; //$NON-NLS-1$
- public static final String IMG_DLCL_SYNCED = "icons/full/dlcl16/synced.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL16_SPELLCHECK = "icons/full/dtool16/spellcheck.gif"; //$NON-NLS-1$
- public static final String IMG_ELCL_COLLAPSEALL = "icons/full/elcl16/collapseall.gif"; //$NON-NLS-1$
- public static final String IMG_ELCL_DELETE = "icons/full/elcl16/delete.gif"; //$NON-NLS-1$
- public static final String IMG_ELCL_SYNCED = "icons/full/elcl16/synced.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL16_SPELLCHECK = "icons/full/etool16/spellcheck.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_OCC_MATCH = "icons/full/obj16/occ_match.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_PREFERENCES = "icons/full/obj16/preferences.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_PROP_PS = "icons/full/obj16/prop_ps.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 3ce54608af..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,58 +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.sse.ui.internal.editor;
-
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Help context ids for the Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
-
- // org.eclipse.wst.sse.ui.
- public static final String PREFIX = SSEUIPlugin.ID + "."; //$NON-NLS-1$
- // Abstract Source Editor Context Menu
- // Content Assist
- public static final String CONTMNU_CONTENTASSIST_HELPID = PREFIX + "xmlm1010"; //$NON-NLS-1$
- // Format Document
- public static final String CONTMNU_FORMAT_DOC_HELPID = PREFIX + "xmlm1030"; //$NON-NLS-1$
- // Format Active Elements
- public static final String CONTMNU_FORMAT_ELEMENTS_HELPID = PREFIX + "xmlm1040"; //$NON-NLS-1$
- // Cleanup Document
- // public static final String CONTMNU_CLEANUP_DOC_HELPID = PREFIX +
- // "xmlm1050"; //$NON-NLS-1$
-
- // Properties
- public static final String CONTMNU_PROPERTIES_HELPID = PREFIX + "xmlm1070"; //$NON-NLS-1$
-
- // Structured Text Editor Preference Page
- // Appearance
- public static final String PREFSTE_APPEARANCE_HELPID = PREFIX + "sted0001"; //$NON-NLS-1$
- // Hovers
- public static final String PREFSTE_HOVERS_HELPID = PREFIX + "sted0003"; //$NON-NLS-1$
-
-// // Read-Only Text Style
-// public static final String PREFWEBX_READONLY_HELPID = PREFIX + "webx0001"; //$NON-NLS-1$
-
- // Web and XML Preference Page
- // Task Tags
- public static final String PREFWEBX_TASKTAGS_HELPID = PREFIX + "webx0000"; //$NON-NLS-1$
-
- // Source Editor View
- public static final String XML_SOURCE_VIEW_HELPID = PREFIX + "xmlm2000"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java
deleted file mode 100644
index b6f5601b79..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-/**
- * This class/interface is part of an experimental API that is still under
- * development and expected to change significantly before reaching stability.
- * It is being made available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class SelectionConvertor {
- /**
- * @param model
- * @param start
- * @param end
- * @return the most specific mapping of this text selection to
- * implementors of IndexedRegion
- */
- public Object[] getElements(IStructuredModel model, int start, int end) {
- Object[] localSelectedStructures = null;
- if (model != null) {
- IndexedRegion region = model.getIndexedRegion(start);
- if (region != null) {
- if (end <= region.getEndOffset()) {
- // single selection
- localSelectedStructures = new Object[1];
- localSelectedStructures[0] = region;
- }
- else {
- // multiple selection
- int maxLength = model.getStructuredDocument().getLength();
- List structures = new ArrayList(2);
- while (region != null && region.getEndOffset() <= end && region.getEndOffset() < maxLength) {
- structures.add(region);
- region = model.getIndexedRegion(region.getEndOffset() + 1);
- }
- localSelectedStructures = structures.toArray();
- }
- }
- }
- if (localSelectedStructures == null) {
- localSelectedStructures = new Object[0];
- }
- return localSelectedStructures;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java
deleted file mode 100644
index 91069ec442..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java
+++ /dev/null
@@ -1,263 +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.sse.ui.internal.editor;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension4;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-/**
- * @author nitin
- */
-public class StructuredModelDocumentProvider implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension4 {
- private static StructuredModelDocumentProvider _instance = null;
-
- /**
- * @return Returns the instance.
- */
- public static StructuredModelDocumentProvider getInstance() {
- return _instance;
- }
-
- {
- _instance = new StructuredModelDocumentProvider();
- }
-
- private StructuredModelDocumentProvider() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#aboutToChange(java.lang.Object)
- */
- public void aboutToChange(Object element) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#addElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void addElementStateListener(IElementStateListener listener) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#canSaveDocument(java.lang.Object)
- */
- public boolean canSaveDocument(Object element) {
- return ((IStructuredModel) element).isDirty();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#changed(java.lang.Object)
- */
- public void changed(Object element) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
- */
- public void connect(Object element) throws CoreException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
- */
- public void disconnect(Object element) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getAnnotationModel(java.lang.Object)
- */
- public IAnnotationModel getAnnotationModel(Object element) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getDocument(java.lang.Object)
- */
- public IDocument getDocument(Object element) {
- return ((IStructuredModel) element).getStructuredDocument();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getModificationStamp(java.lang.Object)
- */
- public long getModificationStamp(Object element) {
- return ((IStructuredModel) element).getSynchronizationStamp();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#getStatus(java.lang.Object)
- */
- public IStatus getStatus(Object element) {
- return Status.OK_STATUS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getSynchronizationStamp(java.lang.Object)
- */
- public long getSynchronizationStamp(Object element) {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#isDeleted(java.lang.Object)
- */
- public boolean isDeleted(Object element) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isModifiable(java.lang.Object)
- */
- public boolean isModifiable(Object element) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isReadOnly(java.lang.Object)
- */
- public boolean isReadOnly(Object element) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isStateValidated(java.lang.Object)
- */
- public boolean isStateValidated(Object element) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#mustSaveDocument(java.lang.Object)
- */
- public boolean mustSaveDocument(Object element) {
- return ((IStructuredModel) element).isDirty();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#removeElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void removeElementStateListener(IElementStateListener listener) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#resetDocument(java.lang.Object)
- */
- public void resetDocument(Object element) throws CoreException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProvider#saveDocument(org.eclipse.core.runtime.IProgressMonitor,
- * java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- */
- public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- try {
- ((IStructuredModel) element).save();
- }
- catch (UnsupportedEncodingException e) {
- }
- catch (IOException e) {
- }
- catch (CoreException e) {
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#setCanSaveDocument(java.lang.Object)
- */
- public void setCanSaveDocument(Object element) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#synchronize(java.lang.Object)
- */
- public void synchronize(Object element) throws CoreException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#updateStateCache(java.lang.Object)
- */
- public void updateStateCache(Object element) throws CoreException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#validateState(java.lang.Object,
- * java.lang.Object)
- */
- public void validateState(Object element, Object computationContext) throws CoreException {
- }
-
- public IContentType getContentType(Object element) throws CoreException {
- return Platform.getContentTypeManager().getContentType(((IStructuredModel) element).getContentTypeIdentifier());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java
deleted file mode 100644
index 50108ff6a2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java
+++ /dev/null
@@ -1,378 +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.sse.ui.internal.extension;
-
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.IActionValidator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-
-/**
- * When 'action' tag is found in the registry, an object of this class is
- * created. It creates the appropriate action object and captures information
- * that is later used to add this action object into menu/tool bar. This class
- * is reused for global (workbench) menu/tool bar, popup menu actions, as well
- * as view's pulldown and local tool bar.
- */
-public class ActionDescriptor {
- public static final String ATT_ACCELERATOR = "accelerator"; //$NON-NLS-1$
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String ATT_DEFINITION_ID = "definitionId"; //$NON-NLS-1$
- public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
- public static final String ATT_DISABLEDICON = "disabledIcon"; //$NON-NLS-1$
- public static final String ATT_HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$
- public static final String ATT_HOVERICON = "hoverIcon"; //$NON-NLS-1$
- public static final String ATT_ICON = "icon"; //$NON-NLS-1$
-
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_LABEL = "label"; //$NON-NLS-1$
- public static final String ATT_MENUBAR_PATH = "menubarPath"; //$NON-NLS-1$
- public static final String ATT_POPUPMENU_PATH = "popupmenuPath"; //$NON-NLS-1$
- public static final String ATT_STATE = "state"; //$NON-NLS-1$
- public static final String ATT_TOOLBAR_PATH = "toolbarPath"; //$NON-NLS-1$
- public static final String ATT_TOOLTIP = "tooltip"; //$NON-NLS-1$
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param element
- * the config element defining the extension
- * @param classAttribute
- * the name of the attribute carrying the class
- * @returns the extension object if successful. If an error occurs when
- * createing executable extension, the exception is logged, and
- * null returned.
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
- final Object[] result = new Object[1];
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- result[0] = element.createExecutableExtension(classAttribute);
- } catch (Exception e) {
- // catch and log ANY exception from extension point
- handleCreateExecutableException(result, e);
- }
- } else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = element.createExecutableExtension(classAttribute);
- } catch (Exception e) {
- // catch and log ANY exception from extension point
- handleCreateExecutableException(result, e);
- }
- }
- });
- }
- return result[0];
- }
-
- private static void handleCreateExecutableException(final Object[] result, Throwable e) {
- Logger.logException(e);
- result[0] = null;
- }
-
- private String id;
-
- private ActionContributionItem item;
- private String menuGroup;
- private String menuPath;
- private String popupmenuGroup;
- private String popupmenuPath;
- private String toolbarGroup;
- private String toolbarPath;
-
- /**
- * Creates a new descriptor with the targetType
- */
- public ActionDescriptor(IConfigurationElement actionElement) throws CoreException {
-
- // Calculate menu and toolbar paths.
- String mpath = actionElement.getAttribute(ATT_MENUBAR_PATH);
- String mgroup = null;
- if (mpath != null) {
- int loc = mpath.lastIndexOf('/');
- if (loc != -1) {
- mgroup = mpath.substring(loc + 1);
- mpath = mpath.substring(0, loc);
- } else {
- mgroup = mpath;
- mpath = null;
- }
- }
- menuPath = mpath;
- menuGroup = mgroup;
-
- String ppath = actionElement.getAttribute(ATT_POPUPMENU_PATH);
- String pgroup = null;
- if (ppath != null) {
- int loc = ppath.lastIndexOf('/');
- if (loc != -1) {
- pgroup = ppath.substring(loc + 1);
- ppath = ppath.substring(0, loc);
- } else {
- pgroup = ppath;
- ppath = null;
- }
- }
- popupmenuPath = ppath;
- popupmenuGroup = pgroup;
-
- String tpath = actionElement.getAttribute(ATT_TOOLBAR_PATH);
- String tgroup = null;
- if (tpath != null) {
- int loc = tpath.lastIndexOf('/');
- if (loc != -1) {
- tgroup = tpath.substring(loc + 1);
- tpath = tpath.substring(0, loc);
- } else {
- tgroup = tpath;
- tpath = null;
- }
- }
- toolbarPath = tpath;
- toolbarGroup = tgroup;
-
- // Create action.
- IAction action = createAction(actionElement);
- if (action == null)
- return;
-
- String label = actionElement.getAttribute(ATT_LABEL);
- if (label != null)
- action.setText(label);
-
- id = actionElement.getAttribute(ATT_ID);
- if (id == null) {
- id = actionElement.getAttribute(ATT_CLASS);
- }
- if (id != null)
- action.setId(id);
-
- String defId = actionElement.getAttribute(ATT_DEFINITION_ID);
- if (defId != null && defId.length() != 0) {
- action.setActionDefinitionId(defId);
- }
-
- String tooltip = actionElement.getAttribute(ATT_TOOLTIP);
- if (tooltip != null)
- action.setToolTipText(tooltip);
-
- String helpContextId = actionElement.getAttribute(ATT_HELP_CONTEXT_ID);
- if (helpContextId != null) {
- String fullID = helpContextId;
- if (helpContextId.indexOf(".") == -1) //$NON-NLS-1$
- // For backward compatibility we auto qualify the id if it is
- // not qualified)
- fullID = actionElement.getDeclaringExtension().getNamespace() + "." + helpContextId; //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, fullID);
- }
-
- String description = actionElement.getAttribute(ATT_DESCRIPTION);
- if (description != null)
- action.setDescription(description);
-
- String state = actionElement.getAttribute(ATT_STATE);
- if (state != null) {
- action.setChecked(state.equals("true")); //$NON-NLS-1$
- }
-
- String icon = actionElement.getAttribute(ATT_ICON);
- if (icon != null) {
- action.setImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), icon));
- }
-
- String hoverIcon = actionElement.getAttribute(ATT_HOVERICON);
- if (hoverIcon != null) {
- action.setHoverImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), hoverIcon));
- }
-
- String disabledIcon = actionElement.getAttribute(ATT_DISABLEDICON);
- if (disabledIcon != null) {
- action.setDisabledImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), disabledIcon));
- }
-
- String accelerator = actionElement.getAttribute(ATT_ACCELERATOR);
- if (accelerator != null)
- processAccelerator(action, accelerator);
-
- item = new ActionContributionItem(action);
- }
-
- /**
- * Parses the given accelerator text, and converts it to an accelerator
- * key code.
- *
- * @param acceleratorText
- * the accelerator text
- * @result the SWT key code, or 0 if there is no accelerator
- */
- private int convertAccelerator(String acceleratorText) {
- int accelerator = 0;
- StringTokenizer stok = new StringTokenizer(acceleratorText, "+"); //$NON-NLS-1$
-
- int keyCode = -1;
-
- boolean hasMoreTokens = stok.hasMoreTokens();
- while (hasMoreTokens) {
- String token = stok.nextToken();
- hasMoreTokens = stok.hasMoreTokens();
- // Every token except the last must be one of the modifiers
- // Ctrl, Shift, or Alt.
- if (hasMoreTokens) {
- int modifier = Action.findModifier(token);
- if (modifier != 0) {
- accelerator |= modifier;
- } else { //Leave if there are none
- return 0;
- }
- } else {
- keyCode = Action.findKeyCode(token);
- }
- }
- if (keyCode != -1) {
- accelerator |= keyCode;
- }
- return accelerator;
- }
-
- /**
- */
- private IAction createAction(IConfigurationElement actionElement) {
- Object action = new ExtendedEditorActionProxyForDelayLoading(actionElement, ATT_CLASS);
- if (action == null)
- return null;
- if (action instanceof IActionValidator) {
- if (!((IActionValidator) action).isValidAction())
- return null;
- }
- return (action instanceof IAction ? (IAction) ExtendedEditorActionProxy.newInstance(action) : null);
- }
-
- /**
- * Returns the action object held in this descriptor.
- */
- public IAction getAction() {
- return (item != null ? item.getAction() : null);
- }
-
- /**
- * Returns the IContributionItem object held in this descriptor.
- */
- public IContributionItem getContributionItem() {
- return item;
- }
-
- /**
- * Returns action's id as defined in the registry.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns named slot (group) in the menu where this action should be
- * added.
- */
- public String getMenuGroup() {
- return menuGroup;
- }
-
- /**
- * Returns menu path where this action should be added. If null, the
- * action will not be added into the menu.
- */
-
- public String getMenuPath() {
- return menuPath;
- }
-
- /**
- * Returns named slot (group) in the popup menu where this action should
- * be added.
- */
- public String getPopupMenuGroup() {
- return popupmenuGroup;
- }
-
- /**
- * Returns popup menu path where this action should be added. If null, the
- * action will not be added into the popup menu.
- */
-
- public String getPopupMenuPath() {
- return popupmenuPath;
- }
-
- /**
- * Returns the named slot (group) in the tool bar where this action should
- * be added.
- */
-
- public String getToolbarGroup() {
- return toolbarGroup;
- }
-
- /**
- * Returns path in the tool bar where this action should be added. If
- * null, action will not be added to the tool bar.
- */
- public String getToolbarPath() {
- return toolbarPath;
- }
-
- /**
- * Process the accelerator definition. If it is a number then process the
- * code directly - if not then parse it and create the code
- */
- private void processAccelerator(IAction action, String acceleratorText) {
-
- if (acceleratorText.length() == 0)
- return;
-
- //Is it a numeric definition?
- if (Character.isDigit(acceleratorText.charAt(0))) {
- try {
- action.setAccelerator(Integer.valueOf(acceleratorText).intValue());
- } catch (NumberFormatException exception) {
- Logger.log(Logger.ERROR, "Invalid accelerator declaration: " + id); //$NON-NLS-1$
- }
- } else
- action.setAccelerator(convertAccelerator(acceleratorText));
- }
-
- /**
- * For debugging only.
- */
- public String toString() {
- return "ActionDescriptor(" + id + ")"; //$NON-NLS-2$//$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java
deleted file mode 100644
index 2a6f9b2c10..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java
+++ /dev/null
@@ -1,405 +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.sse.ui.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Reads breakpoint extension registory and returns breakpoint provider
- * instances
- */
-public class BreakpointProviderBuilder extends RegistryReader {
-
- private static final String ATT_CLASS = "class"; //$NON-NLS-1$
- // private static final String ATT_ID = "id"; //$NON-NLS-1$
- private static final String ATT_CONTENT_TYPES = "contentTypes"; //$NON-NLS-1$
- private static final String ATT_EXTENSIONS = "extensions"; //$NON-NLS-1$
- private static BreakpointProviderBuilder instance;
- private static final String PL_BREAKPOINT = "breakpoint"; //$NON-NLS-1$
-
- private static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
- private static final String TAG_BREAKPOINT_CONTRIBUTION = "breakpointContribution"; //$NON-NLS-1$
- private static final String TAG_PROVIDER = "provider"; //$NON-NLS-1$
-
- /*
- * Creates an executable extension. @param element the config element
- * defining the extension @param classAttribute the name of the attribute
- * carrying the class @return the extension object @throws CoreException
- */
- static Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
- return element.createExecutableExtension(classAttribute);
- }
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param element
- * the config element defining the extension
- * @param classAttribute
- * the name of the attribute carrying the class
- * @return the extension object
- * @throws CoreException
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- final Object[] result = new Object[1];
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- result[0] = createExecutableExtension(element, classAttribute);
- }
- catch (Exception e) {
- handleCreateExecutableException(result, e);
- }
- }
- else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = createExecutableExtension(element, classAttribute);
- }
- catch (CoreException e) {
- handleCreateExecutableException(result, e);
- }
- }
- });
-
- }
- return result[0];
- }
-
- /**
- * returns singleton instance of BreakpointProviderBuilder
- *
- * @return BreakpointProviderBuilder
- */
- public synchronized static BreakpointProviderBuilder getInstance() {
- if (instance == null) {
- instance = new BreakpointProviderBuilder();
- }
- return instance;
- }
-
- /**
- * @param result
- * @param e
- */
- private static void handleCreateExecutableException(Object[] result, Throwable e) {
- Logger.logException(e);
- result[0] = null;
-
- }
-
- protected List cache;
- private Map map = new HashMap();
-
- protected String targetContributionTag;
-
- /*
- * Constructor
- */
- private BreakpointProviderBuilder() {
- super();
- }
-
- /*
- * Creates a breakpoint provider object to given element @param element
- * configuration element object @return IBreakpointProvider
- */
- protected IBreakpointProvider createBreakpointProvider(IConfigurationElement element) {
- Object obj = createExtension(element, ATT_CLASS);
- if (obj == null)
- return null;
- return (obj instanceof IBreakpointProvider) ? (IBreakpointProvider) obj : null;
- }
-
- /*
- * Creates an array of breakpoint providers matching the given key to the
- * value of the IConfigurationElement attribute "attrName" @return
- * IBreakpointProvider[]
- */
- protected IBreakpointProvider[] createBreakpointProviders(String attrName, String key) {
- if (cache == null)
- return new IBreakpointProvider[0];
-
- final int num = cache.size();
- if (num == 0)
- return new IBreakpointProvider[0];
-
- IBreakpointProvider[] bp = new IBreakpointProvider[num];
- int j = 0;
- for (int i = 0; i < num; i++) {
- Object obj = cache.get(i);
- if (!(obj instanceof IConfigurationElement))
- continue;
-
- IConfigurationElement element = (IConfigurationElement) obj;
- if (!TAG_PROVIDER.equals(element.getName()))
- continue;
-
- boolean doCreate = false;
-
- String attrValues = element.getAttribute(attrName);
-
- if (attrValues != null) {
- StringTokenizer tokenizer = new StringTokenizer(attrValues, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String type = tokenizer.nextToken();
- if (type.trim().equalsIgnoreCase(key.trim())) {
- doCreate = true;
- break;
- }
- }
- }
-
- if (doCreate) {
- IBreakpointProvider b = createBreakpointProvider(element);
- if (b != null) {
- bp[j] = b;
- j++;
- }
- }
- }
-
- IBreakpointProvider[] bp2 = new IBreakpointProvider[j];
- for (int i = 0; i < j; i++) {
- bp2[i] = bp[i];
- }
-
- return bp2;
- }
-
- /*
- * Returns a matching array of extension points matching this key. Doesn't
- * cause instantiation of providers. @return IBreakpointProvider[]
- */
- protected IConfigurationElement[] findElements(String key) {
- initCache();
-
- if (cache == null || cache.size() == 0)
- return new IConfigurationElement[0];
-
- int num = cache.size();
- List elements = new ArrayList(1);
- for (int i = 0; i < num; i++) {
- Object obj = cache.get(i);
- if (!(obj instanceof IConfigurationElement))
- continue;
-
- IConfigurationElement element = (IConfigurationElement) obj;
- if (!TAG_PROVIDER.equals(element.getName()))
- continue;
-
- boolean add = false;
- String types = element.getAttribute(ATT_CONTENT_TYPES);
- String exts = element.getAttribute(ATT_EXTENSIONS);
-
- if (types == null && exts == null) {
- add = true;
- }
-
- if (!add && types != null && types.length() > 0) {
- IContentType testType = Platform.getContentTypeManager().getContentType(key);
- StringTokenizer tokenizer = new StringTokenizer(types, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String type = tokenizer.nextToken();
- IContentType contentType = Platform.getContentTypeManager().getContentType(type);
- if (contentType != null && testType != null && testType.isKindOf(contentType)) {
- add = true;
- break;
- }
- }
- }
-
- if (!add && exts != null) {
- StringTokenizer tokenizer = new StringTokenizer(exts, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String ext = tokenizer.nextToken();
- if (ext.trim().equals(key.trim())) {
- add = true;
- break;
- }
- }
- }
-
- if (add) {
- elements.add(element);
- }
- }
- return (IConfigurationElement[]) elements.toArray(new IConfigurationElement[0]);
- }
-
- /**
- * Returns an array of breakpoint providers for a specified content type
- * handler
- *
- * @param handler
- * a content type handler
- * @param ext
- * file extension
- * @return IBreakpointProvider[]
- */
- public IBreakpointProvider[] getBreakpointProviders(IEditorPart editorpart, String contentTypeID, String ext) {
- initCache();
-
- // Get breakpoint providers for this content type handler
- IBreakpointProvider[] providers1 = new IBreakpointProvider[0];
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
- List holdProviders = new ArrayList(2);
- while (contentType != null) {
- IBreakpointProvider[] providers = (IBreakpointProvider[]) map.get(contentType.getId());
- if (providers == null) {
- providers = createBreakpointProviders(ATT_CONTENT_TYPES, contentType.getId());
- if (providers != null) {
- map.put(contentType.getId(), providers);
- }
- }
- // providers were retrieved from cache or newly created
- if(providers != null) {
- holdProviders.addAll(Arrays.asList(providers));
- }
- contentType = contentType.getBaseType();
- }
- providers1 = (IBreakpointProvider[]) holdProviders.toArray(new IBreakpointProvider[holdProviders.size()]);
-
- // Get breakpoint providers for this extension
- IBreakpointProvider[] providers2 = new IBreakpointProvider[0];
- if (ext != null) {
- providers2 = (IBreakpointProvider[]) map.get(ext);
- if (providers2 == null) {
- providers2 = createBreakpointProviders(ATT_EXTENSIONS, ext);
- if (providers2 != null) {
- map.put(ext, providers2);
- }
- }
- }
-
- // create single hash set to remove duplication
- Set s = new HashSet();
- s.addAll(Arrays.asList(providers1));
- s.addAll(Arrays.asList(providers2));
-
- // create IBreakpointProvider[] to return
- IBreakpointProvider[] providers = new IBreakpointProvider[s.size()];
- Iterator itr = s.iterator();
- int i = 0;
- ISourceEditingTextTools tools = null;
- if (editorpart != null && itr.hasNext())
- tools = (ISourceEditingTextTools) editorpart.getAdapter(ISourceEditingTextTools.class);
- while (itr.hasNext()) {
- providers[i] = (IBreakpointProvider) itr.next();
- providers[i].setSourceEditingTextTools(tools);
- i++;
- }
- return providers;
- }
-
- /**
- * Returns corresponding resource from given parameters
- *
- * @param input
- * @param handler
- * @param ext
- * @return IResource
- */
- public IResource getResource(IEditorInput input, String contentType, String ext) {
- IBreakpointProvider[] providers = getBreakpointProviders(null, contentType, ext);
- IResource res = null;
- for (int i = 0; i < providers.length; i++) {
- res = providers[i].getResource(input);
- if (res != null) {
- break;
- }
- }
- return res;
- }
-
- private void initCache() {
- if (cache == null) {
- cache = new ArrayList();
- readContributions(TAG_BREAKPOINT_CONTRIBUTION, PL_BREAKPOINT);
- }
- }
-
- /**
- * Returns an array of breakpoint providers for a specified content type
- * handler
- *
- * @param contentType
- * a content type ID or null
- * @param ext
- * a filename extension or null
- * @return boolean
- */
- public boolean isAvailable(String contentType, String ext) {
- boolean available = false;
- if (ext != null)
- available = findElements(ext).length > 0;
- if (!available && contentType != null)
- available = findElements(contentType).length > 0;
- return available;
- }
-
- /**
- * Reads the contributions from the registry for the provided workbench
- * part and the provided extension point ID.
- *
- * @param tag
- * @param extensionPoint
- */
- protected void readContributions(String tag, String extensionPoint) {
- targetContributionTag = tag;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- readRegistry(registry, PLUGIN_ID, extensionPoint);
- }
-
- protected boolean readElement(IConfigurationElement element) {
- String tag = element.getName();
- if (tag.equals(targetContributionTag)) {
- readElementChildren(element);
- return true;
- }
- else if (tag.equals(TAG_PROVIDER)) {
- cache.add(element);
- return true; // just cache the element - don't go into it
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
deleted file mode 100644
index 104f49abb1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.extension;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension2;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISelfValidateEditAction;
-
-
-/**
- */
-public class DropActionProxy implements InvocationHandler {
- public static Object newInstance(Object obj) {
- Object instance = null;
- try {
- Set set = new HashSet();
- Class clazz = obj.getClass();
- while (clazz != null) {
- Class[] interfaces = clazz.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- set.add(interfaces[i]);
- }
- clazz = clazz.getSuperclass();
- }
- Class[] classes = new Class[set.size()];
- Iterator itr = set.iterator();
- int i = 0;
- while (itr.hasNext()) {
- classes[i] = (Class) itr.next();
- i++;
- }
- instance = Proxy.newProxyInstance(obj.getClass().getClassLoader(), classes, new DropActionProxy(obj));
- } catch (Error e) {
- Logger.logException("Exception while proxying a drop action", e); //$NON-NLS-1$
- instance = obj;
- }
- return instance;
- }
-
- private IExtendedSimpleEditor editor = null;
- private IStructuredModel fRecorder;
- private Object obj;
-
- private DropActionProxy(Object obj) {
- this.obj = obj;
- }
-
- private void beginRecording() {
- IDocument document = null;
- if (editor != null) {
- document = editor.getDocument();
- if (document != null)
- fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
- // Prepare for Undo
- if (fRecorder != null) {
- IStructuredTextUndoManager um = fRecorder.getUndoManager();
- if (um != null) {
- if (this.obj instanceof IAction)
- um.beginRecording(this, ((IAction) this.obj).getText(), ((IAction) this.obj).getDescription());
- else
- um.beginRecording(this);
- }
- }
- }
- }
-
- private void endRecording() {
- if (fRecorder != null) {
- IStructuredTextUndoManager um = fRecorder.getUndoManager();
- if (um != null)
- um.endRecording(this);
- fRecorder.releaseFromEdit();
- fRecorder = null;
- }
- }
-
- /**
- * @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
- * Object[])
- */
- public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
- Object result;
- String name = m.getName();
- try {
- if (name.equals("equals")) { //$NON-NLS-1$
- // Workaround for JDK's bug 4652876
- // "equals" always returns false even if both
- // InvocationHandler
- // class
- // hold the same objects
- // See
- // http://developer.java.sun.com/developer/bugParade/bugs/4652876.html
- // This problem is in the IBM SDK 1.3.1
- // but I don't see the bug in Sun's JDK 1.4.1 (beta)
- Object arg = args[0];
- return (proxy.getClass() == arg.getClass() && equals(Proxy.getInvocationHandler(arg))) ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equals("run")) { //$NON-NLS-1$
- if (args[1] instanceof IExtendedSimpleEditor) {
- editor = (IExtendedSimpleEditor) args[1];
- }
- beginRecording();
- if ((args[1] instanceof ITextEditor) && !(obj instanceof ISelfValidateEditAction) && !isEditable((ITextEditor) args[1])) {
- return Boolean.FALSE;
- }
- }
- result = m.invoke(obj, args);
- } catch (InvocationTargetException e) {
- throw e.getTargetException();
- } catch (Exception e) {
- throw new RuntimeException(e.getMessage());
- } finally {
- if (name.equals("run")) { //$NON-NLS-1$
- endRecording();
- }
- }
- return result;
- }
-
- private boolean isEditable(ITextEditor editor) {
- if (editor instanceof ITextEditorExtension2)
- return ((ITextEditorExtension2) editor).validateEditorInputState();
- return editor.isEditable();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
deleted file mode 100644
index b11c7b901d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
+++ /dev/null
@@ -1,149 +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.sse.ui.internal.extension;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISelfValidateEditAction;
-
-
-/**
- * Begins and ends UndoManager recording around run() and runWithEvent(...)
- */
-public class ExtendedEditorActionProxy implements InvocationHandler {
- public static Object newInstance(Object obj) {
- Set set = new HashSet();
- Class clazz = obj.getClass();
- while (clazz != null) {
- Class[] interfaces = clazz.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- set.add(interfaces[i]);
- }
- clazz = clazz.getSuperclass();
- }
- Class[] classes = new Class[set.size()];
- Iterator itr = set.iterator();
- int i = 0;
- while (itr.hasNext()) {
- classes[i] = (Class) itr.next();
- i++;
- }
- return Proxy.newProxyInstance(obj.getClass().getClassLoader(), classes, new ExtendedEditorActionProxy(obj));
- }
-
- private IExtendedSimpleEditor editor = null;
- private IStructuredModel fRecorder;
- private Object obj;
-
- private ExtendedEditorActionProxy(Object obj) {
- this.obj = obj;
- }
-
- private void beginRecording() {
- IDocument document = null;
- if (editor != null) {
- document = editor.getDocument();
- if (document != null)
- fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
- // Prepare for Undo
- if (fRecorder != null) {
- IStructuredTextUndoManager um = fRecorder.getUndoManager();
- if (um != null) {
- um.beginRecording(this, ((IAction) this.obj).getText(), ((IAction) this.obj).getDescription());
- }
- }
- }
- }
-
- private void endRecording() {
- if (fRecorder != null) {
- IStructuredTextUndoManager um = fRecorder.getUndoManager();
- if (um != null) {
- um.endRecording(this);
- }
- fRecorder.releaseFromEdit();
- fRecorder = null;
- }
- }
-
- /**
- * @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
- * Object[])
- */
- public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
- Object result = null;
- String name = m.getName();
- try {
- if (name.equals("equals")) { //$NON-NLS-1$
- // Workaround for JDK's bug 4652876
- // "equals" always returns false even if both
- // InvocationHandler
- // class
- // hold the same objects
- // See
- // http://developer.java.sun.com/developer/bugParade/bugs/4652876.html
- // This problem is in the IBM SDK 1.3.1
- // but I don't see the bug in Sun's JDK 1.4.1 (beta)
- Object arg = args[0];
- return (proxy.getClass() == arg.getClass() && equals(Proxy.getInvocationHandler(arg))) ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$ //$NON-NLS-2$
- beginRecording();
- if ((editor != null) && !(this.obj instanceof ISelfValidateEditAction)) {
-
- // TODO: cleanup validateEdit
- // just leaving this check and following code here for transition.
- // I assume we'll remove all need for 'validateEdit'
- // or move to platform editor's validateState
-
-// IStatus status = editor.validateEdit(getDisplay().getActiveShell());
-// if (!status.isOK()) {
-// return null;
-// }
- }
- } else if (name.equals("setActiveExtendedEditor")) { //$NON-NLS-1$
- if (args[0] instanceof IExtendedSimpleEditor) {
- editor = (IExtendedSimpleEditor) args[0];
- }
- }
- result = m.invoke(this.obj, args);
- } catch (InvocationTargetException e) {
- Logger.logException(e.getTargetException());
- //throw e.getTargetException();
- } catch (Exception e) {
- Logger.logException(e);
- if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$ //$NON-NLS-2$
- // only expose user-driven exceptions from "running" to the
- // user
- throw new RuntimeException(e.getMessage());
- }
- } finally {
- if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$ //$NON-NLS-2$
- endRecording();
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java
deleted file mode 100644
index 067629271f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java
+++ /dev/null
@@ -1,771 +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.wst.sse.ui.internal.extension;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.ui.internal.IExtendedEditorAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-public class ExtendedEditorActionProxyForDelayLoading implements IExtendedEditorAction, IExtendedEditorActionProxyForDelayLoading, IAction {
- private IAction proxy;
- private IAction dummy = new Action() { // this is for mainly its property change notify...
- };
- // proxy'ed properties
- private String p_id;
- private boolean set_p_id;
- private String p_text;
- private String p_description;
- private boolean set_p_text;
- private boolean set_p_description;
- private String p_toolTipText;
- private boolean set_p_toolTipText;
- private String p_actionDefinitionId;
- private boolean set_p_actionDefinitionId;
- private ImageDescriptor p_image;
- private boolean set_p_image;
- private ImageDescriptor p_hoverImage;
- private boolean set_p_hoverImage;
- private ImageDescriptor p_disabledImage;
- private boolean set_p_disabledImage;
- private int p_accelerator;
- private boolean set_p_accelerator;
- private int p_style = AS_PUSH_BUTTON;
- //private boolean set_p_style;
- private HelpListener p_helpListener;
- private boolean set_p_helpListener;
- private boolean p_enabled = true; // should be same as what is done in
- private boolean set_p_enabled;
- private ListenerList p_listeners = new ListenerList(3);
- private boolean set_p_listeners;
- private boolean p_checked;
- private boolean set_p_checked;
- private IExtendedSimpleEditor p_targetEditor;
- private boolean set_p_targetEditor;
- private boolean p_isvisible = true; // should be true
-
- private IConfigurationElement element;
- private String classAttribute;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- p_listeners.add(listener);
- set_p_listeners = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.addPropertyChangeListener(listener);
- } else {
- dummy.addPropertyChangeListener(listener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getAccelerator()
- */
- public int getAccelerator() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getAccelerator();
- }
- return p_accelerator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getActionDefinitionId()
- */
- public String getActionDefinitionId() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getActionDefinitionId();
- }
- return p_actionDefinitionId;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getDescription()
- */
- public String getDescription() {
- // System.out.println(p_id + ": getDescription");
- // System.out.flush();
- if (proxy != null) {
- return proxy.getDescription();
- }
- return p_description;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getDisabledImageDescriptor();
- }
- return p_disabledImage;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getHelpListener()
- */
- public HelpListener getHelpListener() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getHelpListener();
- }
- return p_helpListener;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getHoverImageDescriptor();
- }
- return p_hoverImage;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getId()
- */
- public String getId() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getId();
- }
- return p_id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getImageDescriptor();
- }
- return p_image;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getMenuCreator()
- */
- public IMenuCreator getMenuCreator() {
- // System.out.println(p_id + ": getMenuCreator");
- // System.out.flush();
- realize();
- if (proxy != null) {
- return proxy.getMenuCreator();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getStyle()
- */
- public int getStyle() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getStyle();
- }
- return p_style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getText()
- */
- public String getText() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getText();
- }
- if (p_text != null) {
- return p_text;
- }
- return "";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getToolTipText()
- */
- public String getToolTipText() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.getToolTipText();
- }
- return p_toolTipText;
- }
-
- /**
- * Check if the contributing bundle is active
- */
- public boolean isBundleActive() {
- Bundle bundle = Platform.getBundle(element.getDeclaringExtension().getNamespace());
- if (bundle != null && bundle.getState() != Bundle.ACTIVE) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isChecked()
- */
- public boolean isChecked() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.isChecked();
- }
- return p_checked;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- // don't realize class.
- // realize();
- if (proxy != null) {
- return proxy.isEnabled();
- }
- return p_enabled;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- p_listeners.remove(listener);
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.removePropertyChangeListener(listener);
- }
- dummy.removePropertyChangeListener(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- realize();
- if (proxy != null) {
- // if this has a key accelerator, first update this action and to
- // see if this action is enabled or not.
- if ((proxy.getAccelerator() > 0) || (proxy.getActionDefinitionId() != null)) {
- update();
- if (isEnabled() == true) {
- proxy.run();
- }
- } else {
- proxy.run();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- realize();
- if (proxy != null) {
- // same as run()
- if ((proxy.getAccelerator() > 0) || (proxy.getActionDefinitionId() != null)) {
- update();
- if (isEnabled() == true) {
- proxy.runWithEvent(event);
- }
- } else {
- proxy.runWithEvent(event);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setActionDefinitionId(java.lang.String)
- */
- public void setActionDefinitionId(String id) {
- p_actionDefinitionId = id;
- set_p_actionDefinitionId = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setActionDefinitionId(id);
- } else {
- dummy.setActionDefinitionId(id);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setChecked(boolean)
- */
- public void setChecked(boolean checked) {
- p_checked = checked;
- set_p_checked = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setChecked(checked);
- } else {
- dummy.setChecked(checked);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setDescription(java.lang.String)
- */
- public void setDescription(String description) {
- p_description = description;
- set_p_description = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setDescription(description);
- } else {
- dummy.setDescription(description);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setDisabledImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setDisabledImageDescriptor(ImageDescriptor newImage) {
- p_disabledImage = newImage;
- set_p_disabledImage = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setDisabledImageDescriptor(newImage);
- } else {
- dummy.setDisabledImageDescriptor(newImage);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- p_enabled = enabled;
- set_p_enabled = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setEnabled(enabled);
- } else {
- dummy.setEnabled(enabled);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setHelpListener(org.eclipse.swt.events.HelpListener)
- */
- public void setHelpListener(HelpListener listener) {
- p_helpListener = listener;
- set_p_helpListener = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setHelpListener(listener);
- } else {
- dummy.setHelpListener(listener);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setHoverImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setHoverImageDescriptor(ImageDescriptor newImage) {
- p_hoverImage = newImage;
- set_p_hoverImage = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setHoverImageDescriptor(newImage);
- } else {
- dummy.setHoverImageDescriptor(newImage);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setId(java.lang.String)
- */
- public void setId(String id) {
- p_id = id;
- set_p_id = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setId(id);
- } else {
- dummy.setId(id);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setImageDescriptor(ImageDescriptor newImage) {
- p_image = newImage;
- set_p_image = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setImageDescriptor(newImage);
- } else {
- dummy.setImageDescriptor(newImage);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setMenuCreator(org.eclipse.jface.action.IMenuCreator)
- */
- public void setMenuCreator(IMenuCreator creator) {
- // System.out.println(p_id + ": setMenuCreator");
- // System.out.flush();
- realize();
- if (proxy != null) {
- proxy.setMenuCreator(creator);
- } else {
- dummy.setMenuCreator(creator);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setText(java.lang.String)
- */
- public void setText(String text) {
- p_text = text;
- set_p_text = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setText(text);
- } else {
- dummy.setText(text);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setToolTipText(java.lang.String)
- */
- public void setToolTipText(String text) {
- p_toolTipText = text;
- set_p_toolTipText = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setToolTipText(text);
- } else {
- dummy.setToolTipText(text);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#setAccelerator(int)
- */
- public void setAccelerator(int keycode) {
- p_accelerator = keycode;
- set_p_accelerator = true;
- // don't realize class.
- // realize();
- if (proxy != null) {
- proxy.setAccelerator(keycode);
- } else {
- dummy.setAccelerator(keycode);
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.IExtendedEditorAction#setActiveExtendedEditor(com.ibm.sse.editor.extension.IExtendedSimpleEditor)
- */
- public void setActiveExtendedEditor(IExtendedSimpleEditor targetEditor) {
- p_targetEditor = targetEditor;
- set_p_targetEditor = true;
- // don't realize class.
- // realize();
- if ((proxy != null) && (proxy instanceof IExtendedEditorAction)) {
- ((IExtendedEditorAction)proxy).setActiveExtendedEditor(targetEditor);
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.extension.IExtendedEditorAction#isVisible()
- */
- public boolean isVisible() {
- // don't realize class.
- // realize();
- if ((proxy != null) && (proxy instanceof IExtendedEditorAction)) {
- return ((IExtendedEditorAction)proxy).isVisible();
- }
- return p_isvisible;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isHandled
- */
- public boolean isHandled() {
- return false;
- }
-
- // see ActionDescriptor#createExtension
- private static IAction newInstance(final IConfigurationElement elm, final String cla) {
- final Object[] result = new Object[1];
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- Bundle bundle= Platform.getBundle(elm.getDeclaringExtension().getNamespace());
- if (bundle != null && bundle.getState() == Bundle.ACTIVE) {
- try {
- result[0] = elm.createExecutableExtension(cla);
- }
- catch (Exception e) {
- // catch and log ANY exception from extension point
- handleCreateExecutableException(result, e, elm.getAttribute(cla));
- }
- }
- else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = elm.createExecutableExtension(cla);
- }
- catch (Exception e) {
- // catch and log ANY exception from extension point
- handleCreateExecutableException(result, e, elm.getAttribute(cla));
- }
- }
- });
- }
- if ((result[0] != null) && (result[0] instanceof IAction)) {
- return (IAction)result[0];
- }
- return null;
- }
-
- private static void handleCreateExecutableException(final Object[] result, Throwable e, String classname) {
- Logger.logException("Unable to create proxy action for " + classname, e);
- result[0] = null;
- }
-
- /**
- * Instantiate a real class here
- */
- public void realize() {
- if ((proxy == null) && (element != null) && (classAttribute != null)) {
- proxy = newInstance(element, classAttribute);
- if (proxy != null) {
- // propagate proxy'ed properties
- if (set_p_listeners == true) {
- if (p_listeners.size() > 0) {
- Object[] l = p_listeners.getListeners();
- int ls = l.length;
- for (int i = 0; i < ls; i++) {
- IPropertyChangeListener pl = (IPropertyChangeListener) l[i];
- proxy.addPropertyChangeListener(pl);
- dummy.removePropertyChangeListener(pl); // remove listener from dymmy so that we don't send notifications twice anymore
- }
- }
- }
- if (set_p_accelerator == true) {
- proxy.setAccelerator(p_accelerator);
- }
- if (set_p_actionDefinitionId == true) {
- if (p_actionDefinitionId != null) {
- proxy.setActionDefinitionId(p_actionDefinitionId);
- }
- }
- if (set_p_checked == true) {
- proxy.setChecked(p_checked);
- }
- if (set_p_disabledImage == true) {
- if (p_disabledImage != null) {
- proxy.setDisabledImageDescriptor(p_disabledImage);
- }
- }
- if (set_p_enabled == true) {
- proxy.setEnabled(p_enabled);
- }
- if (set_p_helpListener == true) {
- if (p_helpListener != null) {
- proxy.setHelpListener(p_helpListener);
- }
- }
- if (set_p_hoverImage == true) {
- if (p_hoverImage != null) {
- proxy.setHoverImageDescriptor(p_hoverImage);
- }
- }
- if (set_p_id == true) {
- if (p_id != null) {
- proxy.setId(p_id);
- }
- }
- if (set_p_image == true) {
- if (p_image != null) {
- proxy.setImageDescriptor(p_image);
- }
- }
- if (set_p_text == true) {
- if (p_text != null) {
- proxy.setText(p_text);
- }
- }
- if (set_p_description == true) {
- if (p_description != null) {
- proxy.setDescription(p_description);
- }
- }
- if (set_p_toolTipText == true) {
- if (p_toolTipText != null) {
- proxy.setToolTipText(p_toolTipText);
- }
- }
- if (set_p_targetEditor == true) {
- if (p_targetEditor != null) {
- if (proxy instanceof IExtendedEditorAction) {
- ((IExtendedEditorAction)proxy).setActiveExtendedEditor(p_targetEditor);
- }
- }
- }
- }
- }
- }
-
- public boolean isRealized() {
- return (proxy != null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- // don't realize class.
- // realize();
- if ((proxy != null) && (proxy instanceof IUpdate)) {
- ((IUpdate) proxy).update();
- }
- }
-
- /**
- * get a real action class
- */
- public IAction getAction() {
- realize();
- return proxy;
- }
-
-
- /**
- * These are Actions's constructors
- */
- ExtendedEditorActionProxyForDelayLoading() {
- super();
- }
- public ExtendedEditorActionProxyForDelayLoading(final IConfigurationElement element, final String classAttribute) {
- super();
- this.element = element;
- this.classAttribute = classAttribute;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java
deleted file mode 100644
index 773858b295..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.extension;
-
-import org.eclipse.jface.action.IAction;
-
-/**
- * @deprecated
- */
-public interface IExtendedEditorActionProxyForDelayLoading {
- public IAction getAction();
- public boolean isRealized();
- public void realize();
- boolean isBundleActive();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java
deleted file mode 100644
index aefc562c41..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java
+++ /dev/null
@@ -1,84 +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.sse.ui.internal.extension;
-
-
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.osgi.framework.Bundle;
-
-public class ImageUtil {
-
-
- /**
- * Convenience Method. Returns an ImageDescriptor whose path, relative to
- * the plugin containing the <code>extension</code> is
- * <code>subdirectoryAndFilename</code>. If there isn't any value
- * associated with the name then <code>null
- * </code> is returned.
- *
- * This method is convenience and only intended for use by the workbench
- * because it explicitly uses the workbench's registry for
- * caching/retrieving images from other extensions -- other plugins must
- * user their own registry. This convenience method is subject to removal.
- *
- * Note: subdirectoryAndFilename must not have any leading "." or path
- * separators / or \ ISV's should use icons/mysample.gif and not
- * ./icons/mysample.gif
- *
- * Note: This consults the plugin for extension and obtains its
- * installation location. all requested images are assumed to be in a
- * directory below and relative to that plugins installation directory.
- */
- public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
- String pluginId = extension.getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- return getImageDescriptorFromBundle(bundle, subdirectoryAndFilename);
- }
-
- /**
- * Convenience Method. Return an ImageDescriptor whose path relative to
- * the plugin described by <code>bundle</code> is
- * <code>subdirectoryAndFilename</code>. Returns <code>null</code> if
- * no image could be found.
- *
- * This method is convenience and only intended for use by the workbench
- * because it explicitly uses the workbench's registry for
- * caching/retrieving images from other extensions -- other plugins must
- * user their own registry. This convenience method is subject to removal.
- *
- * Note: subdirectoryAndFilename must not have any leading "." or path
- * separators / or \ ISV's should use icons/mysample.gif and not
- * ./icons/mysample.gif
- *
- * Note: This consults the plugin for extension and obtains its
- * installation location. all requested images are assumed to be in a
- * directory below and relative to that plugins installation directory.
- */
- public static ImageDescriptor getImageDescriptorFromBundle(Bundle bundle, String subdirectoryAndFilename) {
-
- URL path = bundle.getEntry("/"); //$NON-NLS-1$
- URL fullPathString = null;
- try {
- fullPathString = new URL(path, subdirectoryAndFilename);
- return ImageDescriptor.createFromURL(fullPathString);
- } catch (MalformedURLException e) {
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java
deleted file mode 100644
index a36e8ba1dc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java
+++ /dev/null
@@ -1,176 +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.sse.ui.internal.extension;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.util.Sorter;
-
-
-/**
- * Template implementation of a registry reader that creates objects
- * representing registry contents. Typically, an extension contains one
- * element, but this reader handles multiple elements per extension.
- *
- * To start reading the extensions from the registry for an extension point,
- * call the method <code>readRegistry</code>.
- *
- * To read children of an IConfigurationElement, call the method
- * <code>readElementChildren</code> from your implementation of the method
- * <code>readElement</code>, as it will not be done by default.
- */
-public abstract class RegistryReader {
-
-
- protected static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- protected RegistryReader() {
- }
-
- /**
- * This method extracts description as a subelement of the given element.
- *
- * @return description string if defined, or empty string if not.
- */
- protected String getDescription(IConfigurationElement config) {
- IConfigurationElement[] children = config.getChildren(TAG_DESCRIPTION);
- if (children.length >= 1) {
- return children[0].getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Logs the error in the workbench log using the provided text and the
- * information in the configuration element.
- */
- protected void logError(IConfigurationElement element, String text) {
- IExtension extension = element.getDeclaringExtension();
- StringBuffer buf = new StringBuffer();
- buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-2$//$NON-NLS-1$
- buf.append("\n" + text); //$NON-NLS-1$
- Logger.log(Logger.ERROR, buf.toString());
- }
-
- /**
- * Logs a very common registry error when a required attribute is missing.
- */
- protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-2$//$NON-NLS-1$
- }
-
- /**
- * Logs a registry error when the configuration element is unknown.
- */
- protected void logUnknownElement(IConfigurationElement element) {
- logError(element, "Unknown extension tag found: " + element.getName()); //$NON-NLS-1$
- }
-
- /**
- * Apply a reproducable order to the list of extensions provided, such
- * that the order will not change as extensions are added or removed.
- */
- protected IExtension[] orderExtensions(IExtension[] extensions) {
- // By default, the order is based on plugin id sorted
- // in ascending order. The order for a plugin providing
- // more than one extension for an extension point is
- // dependent in the order listed in the XML file.
- Sorter sorter = new Sorter() {
- public boolean compare(Object extension1, Object extension2) {
- String s1 = ((IExtension) extension1).getNamespace().toUpperCase();
- String s2 = ((IExtension) extension2).getNamespace().toUpperCase();
- //Return true if elementTwo is 'greater than' elementOne
- return s2.compareTo(s1) > 0;
- }
- };
-
- Object[] sorted = sorter.sort(extensions);
- IExtension[] sortedExtension = new IExtension[sorted.length];
- System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
- return sortedExtension;
- }
-
- /**
- * Implement this method to read element's attributes. If children should
- * also be read, then implementor is responsible for calling
- * <code>readElementChildren</code>. Implementor is also responsible
- * for logging missing attributes.
- *
- * @return true if element was recognized, false if not.
- */
- protected abstract boolean readElement(IConfigurationElement element);
-
- /**
- * Read the element's children. This is called by the subclass'
- * readElement method when it wants to read the children of the element.
- */
- protected void readElementChildren(IConfigurationElement element) {
- readElements(element.getChildren());
- }
-
- /**
- * Read each element one at a time by calling the subclass implementation
- * of <code>readElement</code>.
- *
- * Logs an error if the element was not recognized.
- */
- protected void readElements(IConfigurationElement[] elements) {
- for (int i = 0; i < elements.length; i++) {
- if (!readElement(elements[i]))
- logUnknownElement(elements[i]);
- }
- }
-
- /**
- * Read one extension by looping through its configuration elements.
- */
- protected void readExtension(IExtension extension) {
- readElements(extension.getConfigurationElements());
- }
-
- /**
- * @deprecated use readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
- */
- protected void readRegistry(IPluginRegistry registry, String pluginId, String extensionPoint) {
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- extensions = orderExtensions(extensions);
- for (int i = 0; i < extensions.length; i++)
- readExtension(extensions[i]);
- }
- }
-
- /**
- * Start the registry reading process using the supplied plugin ID and
- * extension point.
- */
- protected void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint) {
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- extensions = orderExtensions(extensions);
- for (int i = 0; i < extensions.length; i++)
- readExtension(extensions[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineCustomFiltersDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineCustomFiltersDialog.java
deleted file mode 100644
index 714c68010e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineCustomFiltersDialog.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.filter;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.graphics.Image;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.util.SWTUtil;
-
-
-public class OutlineCustomFiltersDialog extends SelectionDialog {
-
- private static final String SEPARATOR= ","; //$NON-NLS-1$
-
- private String fViewId;
- private boolean fEnablePatterns;
- private String[] fPatterns;
- private String[] fEnabledFilterIds;
-
- private OutlineFilterDescriptor[] fBuiltInFilters;
-
- private CheckboxTableViewer fCheckBoxList;
- private Button fEnableUserDefinedPatterns;
- private Text fUserDefinedPatterns;
-
- private Stack fFilterDescriptorChangeHistory;
-
-
- /**
- * Creates a dialog to customize Java element filters.
- *
- * @param shell the parent shell
- * @param viewId the id of the view
- * @param enablePatterns <code>true</code> if pattern filters are enabled
- * @param patterns the filter patterns
- * @param enabledFilterIds the Ids of the enabled filters
- */
- public OutlineCustomFiltersDialog(
- Shell shell,
- String viewId,
- boolean enablePatterns,
- String[] patterns,
- String[] enabledFilterIds) {
-
- super(shell);
- Assert.isNotNull(viewId);
- Assert.isNotNull(patterns);
- Assert.isNotNull(enabledFilterIds);
-
- fViewId= viewId;
- fPatterns= patterns;
- fEnablePatterns= enablePatterns;
- fEnabledFilterIds= enabledFilterIds;
-
- fBuiltInFilters= OutlineFilterDescriptor.getFilterDescriptors(fViewId);
- fFilterDescriptorChangeHistory= new Stack();
- }
- public static final String CUSTOM_FILTERS_DIALOG= SSEUIPlugin.ID + "." + "open_custom_filters_dialog_context"; //$NON-NLS-1$
- protected void configureShell(Shell shell) {
- setTitle(OutlineFilterMessages.CustomFiltersDialog_title);
- setMessage(OutlineFilterMessages.CustomFiltersDialog_filterList_label);
- super.configureShell(shell);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, CUSTOM_FILTERS_DIALOG);
- }
-
- /**
- * Overrides method in Dialog
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
- */
- protected Control createDialogArea(Composite parent) {
- initializeDialogUnits(parent);
- // create a composite with standard margins and spacing
- Composite composite= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- Composite group= composite;
-
- // Checkbox
- fEnableUserDefinedPatterns= new Button(group, SWT.CHECK);
- fEnableUserDefinedPatterns.setFocus();
- fEnableUserDefinedPatterns.setText(OutlineFilterMessages.CustomFiltersDialog_enableUserDefinedPattern);
-
- // Pattern field
- fUserDefinedPatterns= new Text(group, SWT.SINGLE | SWT.BORDER);
- GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- data.widthHint= convertWidthInCharsToPixels(59);
- fUserDefinedPatterns.setLayoutData(data);
- String patterns= convertToString(fPatterns, SEPARATOR);
- fUserDefinedPatterns.setText(patterns);
- SWTUtil.setAccessibilityText(fUserDefinedPatterns, OutlineFilterMessages.CustomFiltersDialog_name_filter_pattern_description);
-
- // Info text
- final Label info= new Label(group, SWT.LEFT);
- info.setText(OutlineFilterMessages.CustomFiltersDialog_patternInfo);
-
- // Enabling / disabling of pattern group
- fEnableUserDefinedPatterns.setSelection(fEnablePatterns);
- fUserDefinedPatterns.setEnabled(fEnablePatterns);
- info.setEnabled(fEnablePatterns);
- fEnableUserDefinedPatterns.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- boolean state= fEnableUserDefinedPatterns.getSelection();
- fUserDefinedPatterns.setEnabled(state);
- info.setEnabled(fEnableUserDefinedPatterns.getSelection());
- if (state)
- fUserDefinedPatterns.setFocus();
- }
- });
-
- // Filters provided by extension point
- if (fBuiltInFilters.length > 0)
- createCheckBoxList(group);
-
- applyDialogFont(parent);
- return parent;
- }
-
- private void createCheckBoxList(Composite parent) {
- // Filler
- new Label(parent, SWT.NONE);
-
- Label info= new Label(parent, SWT.LEFT);
- info.setText(OutlineFilterMessages.CustomFiltersDialog_filterList_label);
-
- fCheckBoxList= CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.heightHint= fCheckBoxList.getTable().getItemHeight() * 10;
- fCheckBoxList.getTable().setLayoutData(data);
-
- fCheckBoxList.setLabelProvider(createLabelPrivder());
- fCheckBoxList.setContentProvider(new ArrayContentProvider());
- Arrays.sort(fBuiltInFilters);
- fCheckBoxList.setInput(fBuiltInFilters);
- setInitialSelections(getEnabledFilterDescriptors());
-
- List initialSelection= getInitialElementSelections();
- if (initialSelection != null && !initialSelection.isEmpty())
- checkInitialSelections();
-
- // Description
- info= new Label(parent, SWT.LEFT);
- info.setText(OutlineFilterMessages.CustomFiltersDialog_description_label);
- final Text description= new Text(parent, SWT.LEFT | SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint= convertHeightInCharsToPixels(3);
- description.setLayoutData(data);
- fCheckBoxList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection= event.getSelection();
- if (selection instanceof IStructuredSelection) {
- Object selectedElement= ((IStructuredSelection)selection).getFirstElement();
- if (selectedElement instanceof OutlineFilterDescriptor)
- description.setText(((OutlineFilterDescriptor)selectedElement).getDescription());
- }
- }
- });
- fCheckBoxList.addCheckStateListener(new ICheckStateListener() {
- /*
- * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- Object element= event.getElement();
- if (element instanceof OutlineFilterDescriptor) {
- // renew if already touched
- if (fFilterDescriptorChangeHistory.contains(element))
- fFilterDescriptorChangeHistory.remove(element);
- fFilterDescriptorChangeHistory.push(element);
- }
- }});
-
- addSelectionButtons(parent);
- }
-
- private void addSelectionButtons(Composite composite) {
- Composite buttonComposite= new Composite(composite, SWT.RIGHT);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- buttonComposite.setLayout(layout);
- GridData data= new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace= true;
- composite.setData(data);
-
- // Select All button
- String label= OutlineFilterMessages.CustomFiltersDialog_SelectAllButton_label;
- Button selectButton= createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, label, false);
- SWTUtil.setButtonDimensionHint(selectButton);
- SelectionListener listener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fCheckBoxList.setAllChecked(true);
- fFilterDescriptorChangeHistory.clear();
- for (int i= 0; i < fBuiltInFilters.length; i++)
- fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]);
- }
- };
- selectButton.addSelectionListener(listener);
-
- // De-select All button
- label= OutlineFilterMessages.CustomFiltersDialog_DeselectAllButton_label;
- Button deselectButton= createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, label, false);
- SWTUtil.setButtonDimensionHint(deselectButton);
- listener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fCheckBoxList.setAllChecked(false);
- fFilterDescriptorChangeHistory.clear();
- for (int i= 0; i < fBuiltInFilters.length; i++)
- fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]);
- }
- };
- deselectButton.addSelectionListener(listener);
- }
-
- private void checkInitialSelections() {
- Iterator itemsToCheck= getInitialElementSelections().iterator();
- while (itemsToCheck.hasNext())
- fCheckBoxList.setChecked(itemsToCheck.next(),true);
- }
-
- protected void okPressed() {
- if (fBuiltInFilters != null) {
- ArrayList result= new ArrayList();
- for (int i= 0; i < fBuiltInFilters.length; ++i) {
- if (fCheckBoxList.getChecked(fBuiltInFilters[i]))
- result.add(fBuiltInFilters[i]);
- }
- setResult(result);
- }
- super.okPressed();
- }
-
- private ILabelProvider createLabelPrivder() {
- return
- new LabelProvider() {
- public Image getImage(Object element) {
- return null;
- }
- public String getText(Object element) {
- if (element instanceof OutlineFilterDescriptor)
- return ((OutlineFilterDescriptor)element).getName();
- else
- return null;
- }
- };
- }
-
- // ---------- result handling ----------
-
- protected void setResult(List newResult) {
- super.setResult(newResult);
- if (fUserDefinedPatterns.getText().length() > 0) {
- fEnablePatterns= fEnableUserDefinedPatterns.getSelection();
- fPatterns= convertFromString(fUserDefinedPatterns.getText(), SEPARATOR);
- } else {
- fEnablePatterns= false;
- fPatterns= new String[0];
- }
- }
-
-
- /**
- * @return the patterns which have been entered by the user
- */
- public String[] getUserDefinedPatterns() {
- return fPatterns;
- }
-
- /**
- * @return the Ids of the enabled built-in filters
- */
- public String[] getEnabledFilterIds() {
- Object[] result= getResult();
- Set enabledIds= new HashSet(result.length);
- for (int i= 0; i < result.length; i++)
- enabledIds.add(((OutlineFilterDescriptor)result[i]).getId());
- return (String[]) enabledIds.toArray(new String[enabledIds.size()]);
- }
-
- /**
- * @return <code>true</code> if the user-defined patterns are disabled
- */
- public boolean areUserDefinedPatternsEnabled() {
- return fEnablePatterns;
- }
-
- /**
- * @return a stack with the filter descriptor check history
- */
- public Stack getFilterDescriptorChangeHistory() {
- return fFilterDescriptorChangeHistory;
- }
-
- private OutlineFilterDescriptor[] getEnabledFilterDescriptors() {
- OutlineFilterDescriptor[] filterDescs= fBuiltInFilters;
- List result= new ArrayList(filterDescs.length);
- List enabledFilterIds= Arrays.asList(fEnabledFilterIds);
- for (int i= 0; i < filterDescs.length; i++) {
- String id= filterDescs[i].getId();
- if (enabledFilterIds.contains(id))
- result.add(filterDescs[i]);
- }
- return (OutlineFilterDescriptor[])result.toArray(new OutlineFilterDescriptor[result.size()]);
- }
-
-
- public static String[] convertFromString(String patterns, String separator) {
- StringTokenizer tokenizer= new StringTokenizer(patterns, separator, true);
- int tokenCount= tokenizer.countTokens();
- List result= new ArrayList(tokenCount);
- boolean escape= false;
- boolean append= false;
- while (tokenizer.hasMoreTokens()) {
- String token= tokenizer.nextToken().trim();
- if (separator.equals(token)) {
- if (!escape)
- escape= true;
- else {
- addPattern(result, separator);
- append= true;
- }
- } else {
- if (!append)
- result.add(token);
- else
- addPattern(result, token);
- append= false;
- escape= false;
- }
- }
- return (String[])result.toArray(new String[result.size()]);
- }
-
- private static void addPattern(List list, String pattern) {
- if (list.isEmpty())
- list.add(pattern);
- else {
- int index= list.size() - 1;
- list.set(index, ((String)list.get(index)) + pattern);
- }
- }
-
- public static String convertToString(String[] patterns, String separator) {
- int length= patterns.length;
- StringBuffer strBuf= new StringBuffer();
- if (length > 0)
- strBuf.append(escapeSeparator(patterns[0], separator));
- else
- return ""; //$NON-NLS-1$
- int i= 1;
- while (i < length) {
- strBuf.append(separator);
- strBuf.append(" "); //$NON-NLS-1$
- strBuf.append(escapeSeparator(patterns[i++], separator));
- }
- return strBuf.toString();
- }
-
- private static String escapeSeparator(String pattern, String separator) {
- int length= pattern.length();
- StringBuffer buf= new StringBuffer(length);
- for (int i= 0; i < length; i++) {
- char ch= pattern.charAt(i);
- if (separator.equals(String.valueOf(ch)))
- buf.append(ch);
- buf.append(ch);
- }
- return buf.toString();
-
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java
deleted file mode 100644
index fd6b24e21e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterDescriptor.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.filter;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import com.ibm.icu.text.Collator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-import org.eclipse.ui.IPluginContribution;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-
-
-/**
- * Represents a custom filter which is provided by the
- * "org.eclipse.sse.ui.outlineFilters" extension point.
- *
- */
-public class OutlineFilterDescriptor implements Comparable, IPluginContribution {
-
- private static String PATTERN_FILTER_ID_PREFIX= "_patternFilterId_"; //$NON-NLS-1$
-
-
- private static final String EXTENSION_POINT_NAME= "outlineFilters"; //$NON-NLS-1$
-
- private static final String FILTER_TAG= "filter"; //$NON-NLS-1$
-
- private static final String PATTERN_ATTRIBUTE= "pattern"; //$NON-NLS-1$
- private static final String ID_ATTRIBUTE= "id"; //$NON-NLS-1$
- private static final String TARGET_ID_ATTRIBUTE= "targetId"; //$NON-NLS-1$
- private static final String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$
- private static final String NAME_ATTRIBUTE= "name"; //$NON-NLS-1$
- private static final String ENABLED_ATTRIBUTE= "enabled"; //$NON-NLS-1$
- private static final String DESCRIPTION_ATTRIBUTE= "description"; //$NON-NLS-1$
-
- private static OutlineFilterDescriptor[] fgFilterDescriptors;
-
-
- private IConfigurationElement fElement;
-
- /**
- * Returns all contributed Java element filters.
- * @return all contributed Java element filters
- */
- public static OutlineFilterDescriptor[] getFilterDescriptors() {
- if (fgFilterDescriptors == null) {
- IExtensionRegistry registry= Platform.getExtensionRegistry();
- IConfigurationElement[] elements= registry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT_NAME);
- fgFilterDescriptors= createFilterDescriptors(elements);
- }
- return fgFilterDescriptors;
- }
- /**
- * Returns all Java element filters which
- * are contributed to the given view.
- * @param targetId the target id
- * @return all contributed Java element filters for the given view
- */
- public static OutlineFilterDescriptor[] getFilterDescriptors(String targetId) {
- OutlineFilterDescriptor[] filterDescs= OutlineFilterDescriptor.getFilterDescriptors();
- List result= new ArrayList(filterDescs.length);
- for (int i= 0; i < filterDescs.length; i++) {
- String tid= filterDescs[i].getTargetId();
- if (WorkbenchActivityHelper.filterItem(filterDescs[i]))
- continue;
- if (tid == null || tid.equals(targetId))
- result.add(filterDescs[i]);
- }
- return (OutlineFilterDescriptor[])result.toArray(new OutlineFilterDescriptor[result.size()]);
- }
-
- /**
- * Creates a new filter descriptor for the given configuration element.
- * @param element configuration element
- */
- private OutlineFilterDescriptor(IConfigurationElement element) {
- fElement= element;
- // it is either a pattern filter or a custom filter
- Assert.isTrue(isPatternFilter() ^ isCustomFilter(), "An extension for extension-point org.eclipse.sse.ui.outlineFilters does not specify a correct filter"); //$NON-NLS-1$
- Assert.isNotNull(getId(), "An extension for extension-point org.eclipse.sse.ui.outlineFilters does not provide a valid ID"); //$NON-NLS-1$
- Assert.isNotNull(getName(), "An extension for extension-point org.eclipse.sse.ui.outlineFilters does not provide a valid name"); //$NON-NLS-1$
- }
-
- /**
- * Creates a new <code>ViewerFilter</code>.
- * This method is only valid for viewer filters.
- * @return a new <code>ViewerFilter</code>
- */
- public ViewerFilter createViewerFilter() {
- if (!isCustomFilter())
- return null;
-
- final ViewerFilter[] result= new ViewerFilter[1];
- String message = OutlineFilterMessages.FilterDescriptor_filterCreationError_message;
- ISafeRunnable code= new SafeRunnable(message) {
- /*
- * @see org.eclipse.core.runtime.ISafeRunnable#run()
- */
- public void run() throws Exception {
- result[0]= (ViewerFilter)fElement.createExecutableExtension(CLASS_ATTRIBUTE);
- }
-
- };
- SafeRunner.run(code);
- return result[0];
- }
-
- //---- XML Attribute accessors ---------------------------------------------
-
- /**
- * Returns the filter's id.
- * <p>
- * This attribute is mandatory for custom filters.
- * The ID for pattern filters is
- * PATTERN_FILTER_ID_PREFIX plus the pattern itself.
- * </p>
- * @return the filter id
- */
- public String getId() {
- if (isPatternFilter()) {
- String targetId= getTargetId();
- if (targetId == null)
- return PATTERN_FILTER_ID_PREFIX + getPattern();
- else
- return targetId + PATTERN_FILTER_ID_PREFIX + getPattern();
- } else
- return fElement.getAttribute(ID_ATTRIBUTE);
- }
-
- /**
- * Returns the filter's name.
- * <p>
- * If the name of a pattern filter is missing
- * then the pattern is used as its name.
- * </p>
- * @return the filter's name
- */
- public String getName() {
- String name= fElement.getAttribute(NAME_ATTRIBUTE);
- if (name == null && isPatternFilter())
- name= getPattern();
- return name;
- }
-
- /**
- * Returns the filter's pattern.
- *
- * @return the pattern string or <code>null</code> if it's not a pattern filter
- */
- public String getPattern() {
- return fElement.getAttribute(PATTERN_ATTRIBUTE);
- }
-
- /**
- * Returns the filter's viewId.
- *
- * @return the view ID or <code>null</code> if the filter is for all views
- */
- public String getTargetId() {
- String tid= fElement.getAttribute(TARGET_ID_ATTRIBUTE);
-
- if (tid != null)
- return tid;
-
- // Backwards compatibility code
- return null;
-
- }
-
- /**
- * Returns the filter's description.
- *
- * @return the description or <code>null</code> if no description is provided
- */
- public String getDescription() {
- String description= fElement.getAttribute(DESCRIPTION_ATTRIBUTE);
- if (description == null)
- description= ""; //$NON-NLS-1$
- return description;
- }
-
- /**
- * @return <code>true</code> if this filter is a custom filter.
- */
- public boolean isPatternFilter() {
- return getPattern() != null;
- }
-
- /**
- * @return <code>true</code> if this filter is a pattern filter.
- */
- public boolean isCustomFilter() {
- return fElement.getAttribute(CLASS_ATTRIBUTE) != null;
- }
-
- /**
- * Returns <code>true</code> if the filter
- * is initially enabled.
- *
- * This attribute is optional and defaults to <code>true</code>.
- * @return returns <code>true</code> if the filter is initially enabled
- */
- public boolean isEnabled() {
- String strVal= fElement.getAttribute(ENABLED_ATTRIBUTE);
- return strVal == null || Boolean.valueOf(strVal).booleanValue();
- }
-
- /*
- * Implements a method from IComparable
- */
- public int compareTo(Object o) {
- if (o instanceof OutlineFilterDescriptor)
- return Collator.getInstance().compare(getName(), ((OutlineFilterDescriptor)o).getName());
- else
- return Integer.MIN_VALUE;
- }
-
- //---- initialization ---------------------------------------------------
-
- /**
- * Creates the filter descriptors.
- * @param elements the configuration elements
- * @return new filter descriptors
- */
- private static OutlineFilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) {
- List result= new ArrayList(5);
- Set descIds= new HashSet(5);
- for (int i= 0; i < elements.length; i++) {
- final IConfigurationElement element= elements[i];
- if (FILTER_TAG.equals(element.getName())) {
-
- final OutlineFilterDescriptor[] desc= new OutlineFilterDescriptor[1];
- SafeRunner.run(new SafeRunnable(OutlineFilterMessages.FilterDescriptor_filterDescriptionCreationError_message) {
- public void run() throws Exception {
- desc[0]= new OutlineFilterDescriptor(element);
- }
- });
-
- if (desc[0] != null && !descIds.contains(desc[0].getId())) {
- result.add(desc[0]);
- descIds.add(desc[0].getId());
- }
- }
- }
- return (OutlineFilterDescriptor[])result.toArray(new OutlineFilterDescriptor[result.size()]);
- }
-
- public String getLocalId() {
- return fElement.getAttribute(ID_ATTRIBUTE);
- }
-
- public String getPluginId() {
- return fElement.getContributor().getName();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.java
deleted file mode 100644
index 9926e00e12..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.filter;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class OutlineFilterMessages extends NLS {
-
- private static final String BUNDLE_NAME= "org.eclipse.wst.sse.ui.internal.filter.OutlineFilterMessages";//$NON-NLS-1$
-
- private OutlineFilterMessages() {
- // Do not instantiate
- }
-
- public static String CustomFiltersDialog_title;
- public static String CustomFiltersDialog_patternInfo;
- public static String CustomFiltersDialog_enableUserDefinedPattern;
- public static String CustomFiltersDialog_filterList_label;
- public static String CustomFiltersDialog_description_label;
- public static String CustomFiltersDialog_SelectAllButton_label;
- public static String CustomFiltersDialog_DeselectAllButton_label;
- public static String CustomFiltersDialog_name_filter_pattern_description;
- public static String OpenCustomFiltersDialogAction_text;
- public static String FilterDescriptor_filterDescriptionCreationError_message;
- public static String FilterDescriptor_filterCreationError_message;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, OutlineFilterMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.properties
deleted file mode 100644
index 9ebc024134..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineFilterMessages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-CustomFiltersDialog_title= Outline Element Filters
-CustomFiltersDialog_patternInfo= The patterns are separated by a comma, where\n* = any string, ? = any character, ,, = ,
-CustomFiltersDialog_enableUserDefinedPattern= &Name filter patterns (matching names will be hidden):
-CustomFiltersDialog_filterList_label= S&elect the elements to exclude from the view:
-CustomFiltersDialog_description_label= Filter description:
-CustomFiltersDialog_SelectAllButton_label= &Select All
-CustomFiltersDialog_DeselectAllButton_label= &Deselect All
-CustomFiltersDialog_name_filter_pattern_description=Name filter patterns. The patterns are separated by a comma, where star is any string
-
-OpenCustomFiltersDialogAction_text= &Filters...
-
-FilterDescriptor_filterDescriptionCreationError_message= One of the extensions for extension-point org.eclipse.wst.sse.ui.outlineFilters is incorrect.
-FilterDescriptor_filterCreationError_message= The org.eclipse.wst.sse.ui.outlineFilters plug-in extension "{0}" specifies a viewer filter class which does not exist.
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineNamePatternFilter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineNamePatternFilter.java
deleted file mode 100644
index 37ba7d5f48..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/OutlineNamePatternFilter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.filter;
-
-import org.eclipse.jface.viewers.ContentViewer;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * The NamePatternFilter selects the elements which
- * match the given string patterns.
- * <p>
- * The following characters have special meaning:
- * ? => any character
- * * => any string
- * </p>
- *
- */
-public class OutlineNamePatternFilter extends ViewerFilter {
- private String[] fPatterns;
- private StringMatcher[] fMatchers;
-
-
- /**
- * Gets the patterns for the receiver.
- * @return returns the patterns to be filtered for
- */
- public String[] getPatterns() {
- return fPatterns;
- }
-
-
- /* (non-Javadoc)
- * Method declared on ViewerFilter.
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (getPatterns().length == 0) {
- return true;
- }
- String matchName= null;
- if (viewer instanceof ContentViewer){
- final IBaseLabelProvider labelProvider = ((ContentViewer) viewer).getLabelProvider();
- if (labelProvider instanceof ILabelProvider) {
- matchName = ((ILabelProvider) labelProvider).getText(element);
- }
- }
- if (matchName != null && matchName.length() > 0) {
- String[] fPatterns = getPatterns();
- for (int i = 0; i < fPatterns.length; i++) {
- if (new StringMatcher(fPatterns[i], true, false).match(matchName))
- return false;
- }
- return true;
- }
- return true;
- }
-
- /**
- * Sets the patterns to filter out for the receiver.
- * <p>
- * The following characters have special meaning:
- * ? => any character
- * * => any string
- * </p>
- * @param newPatterns the new patterns
- */
- public void setPatterns(String[] newPatterns) {
- fPatterns = newPatterns;
- fMatchers = new StringMatcher[newPatterns.length];
- for (int i = 0; i < newPatterns.length; i++) {
- //Reset the matchers to prevent constructor overhead
- fMatchers[i]= new StringMatcher(newPatterns[i], true, false);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/StringMatcher.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/StringMatcher.java
deleted file mode 100644
index d7dfdd696e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/filter/StringMatcher.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.filter;
-
-import java.util.Vector;
-
-/**
- * A string pattern matcher. Supports '*' and '?' wildcards.
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound= 0;
-
-
- protected static final char fSingleWildCard= '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start= start;
- this.end= end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern. The pattern may contain '*' for 0 and many characters and
- * '?' for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern the pattern to match text against
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase= ignoreCase;
- fIgnoreWildCards= ignoreWildCards;
- fPattern= pattern;
- fLength= pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
- /**
- * Find the first occurrence of the pattern between <code>start</code)(inclusive)
- * and <code>end</code>(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null)
- throw new IllegalArgumentException();
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x= posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount= fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos= start;
- int matchStart= -1;
- int i;
- for (i= 0; i < segCount && curPos < end; ++i) {
- String current= fSegments[i];
- int nextMatch= regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart= nextMatch;
- curPos= nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
- /**
- * match the given <code>text</code> with the pattern
- * @return true if matched eitherwise false
- * @param text a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in the
- * <code>text</code>, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param text a String object that contains the substring to match
- * @param start marks the starting position (inclusive) of the substring
- * @param end marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- } else {
- ++i;
- tCurPos= tCurPos + segLength;
- }
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
-
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments= new String[1];
- fSegments[0]= fPattern;
- fBound= fLength;
- }
- /**
- * Parses the given pattern into segments seperated by wildcard '*' characters.
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar= true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar= true;
- }
- }
-
- Vector temp= new Vector();
-
- int pos= 0;
- StringBuffer buf= new StringBuffer();
- while (pos < fLength) {
- char c= fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next= fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments= new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param text a string which contains no wildcard
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max= end - fLength;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param text a simple regular expression that may only contain '?'(s)
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen= p.length();
-
- int max= end - plen;
- for (int i= start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
-
-
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar= text.charAt(tStart++);
- char pchar= p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar))
- continue;
- // comparing after converting to upper case doesn't handle all cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar))
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param text the string to match
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen= p.length();
- int max= end - plen;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java
deleted file mode 100644
index 40e5d7deca..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java
+++ /dev/null
@@ -1,91 +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.sse.ui.internal.format;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-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.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-public class StructuredFormattingStrategy extends ContextBasedFormattingStrategy {
-
- /** Documents to be formatted by this strategy */
- private final LinkedList fDocuments = new LinkedList();
- private IStructuredFormatProcessor fFormatProcessor;
- /** Partitions to be formatted by this strategy */
- private final LinkedList fPartitions = new LinkedList();
- private IRegion fRegion;
-
- /**
- * @param formatProcessor
- */
- public StructuredFormattingStrategy(IStructuredFormatProcessor formatProcessor) {
- super();
-
- fFormatProcessor = formatProcessor;
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
- */
- public void format() {
- super.format();
-
- final IDocument document = (IDocument) fDocuments.removeFirst();
- final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
-
- if (document != null && partition != null && fRegion != null && fFormatProcessor != null) {
- try {
- fFormatProcessor.formatDocument(document, fRegion.getOffset(), fRegion.getLength());
- }
- catch (IOException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (CoreException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
-
- /*
- * @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));
- fRegion = (IRegion) context.getProperty(FormattingContextProperties.CONTEXT_REGION);
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
- */
- public void formatterStops() {
- super.formatterStops();
-
- fPartitions.clear();
- fDocuments.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractCommentHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractCommentHandler.java
deleted file mode 100644
index eab9187962..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractCommentHandler.java
+++ /dev/null
@@ -1,96 +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.wst.sse.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This class contains all of the shared functionality for comment handlers
- */
-public abstract class AbstractCommentHandler extends AbstractHandler {
-
- /**
- * <p>Default constructor must exist because sub classes are created by java reflection</p>
- */
- public AbstractCommentHandler() {
- super();
- }
-
- /**
- * <p>Gets the important information out of the event and passes it onto
- * the internal method {@link #processAction}</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.handlers.CommentHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public final Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null && document instanceof IStructuredDocument) {
- // get current text selection
- ITextSelection textSelection = getCurrentSelection(textEditor);
- if (!textSelection.isEmpty()) {
- //call the implementers code to deal with the event
- processAction(textEditor, (IStructuredDocument)document, textSelection);
- }
- }
- }
- return null;
- }
-
- /**
- * <p>This method is called by the public {@link #execute} method whenever
- * the comment handler is invoked. This method should be used for the
- * logic of handling the structured comment event.</p>
- *
- * @param textEditor the text editor the initiating event was caused in
- * @param document the document the text editor is editing
- * @param textSelection the user selection when the event was caused
- */
- protected abstract void processAction(ITextEditor textEditor, IStructuredDocument document, ITextSelection textSelection);
-
- /**
- * <p>Gets the current user selection in the given {@link ITextEditor}</p>
- *
- * @param textEditor get the user selection from here
- * @return the current user selection in <code>textEdtior</code>
- */
- private static ITextSelection getCurrentSelection(ITextEditor textEditor) {
- ISelectionProvider provider = textEditor.getSelectionProvider();
- if (provider != null) {
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection) {
- return (ITextSelection) selection;
- }
- }
- return TextSelection.emptySelection();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractStructuredSelectHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractStructuredSelectHandler.java
deleted file mode 100644
index 4579700cf3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AbstractStructuredSelectHandler.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-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.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-
-abstract public class AbstractStructuredSelectHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- // determine current text selection
- if (selection instanceof ITextSelection && document != null) {
- ITextSelection textSelection = (ITextSelection) selection;
-
- if (textSelection.getLength() < document.getLength()) {
- // get current indexed region
- IndexedRegion cursorIndexedRegion = getCursorIndexedRegion(document, textSelection);
-
- // determine new selection based on current indexed region
- Region newSelectionRegion = getNewSelectionRegion(cursorIndexedRegion, textSelection);
-
- // select new selection
- if (newSelectionRegion != null) {
- SelectionHistory history = (SelectionHistory) editor.getAdapter(SelectionHistory.class);
- if (history != null) {
- history.remember(new Region(textSelection.getOffset(), textSelection.getLength()));
- try {
- history.ignoreSelectionChanges();
- textEditor.selectAndReveal(newSelectionRegion.getOffset(), newSelectionRegion.getLength());
- }
- finally {
- history.listenToSelectionChanges();
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * This method will probably be removed and replaced by using new
- * selection provider
- *
- * @param document
- * @param offset
- * @return
- */
- protected IndexedRegion getIndexedRegion(IDocument document, int offset) {
- IndexedRegion indexedRegion = null;
-
- int lastOffset = offset;
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- try {
- indexedRegion = model.getIndexedRegion(lastOffset);
- while (indexedRegion == null && lastOffset >= 0) {
- lastOffset--;
- indexedRegion = model.getIndexedRegion(lastOffset);
- }
- }
- finally {
- model.releaseFromRead();
- }
- }
-
- return indexedRegion;
- }
-
- abstract protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection);
-
- abstract protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AddBlockCommentHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AddBlockCommentHandler.java
deleted file mode 100644
index 97f999ebc3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/AddBlockCommentHandler.java
+++ /dev/null
@@ -1,80 +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.wst.sse.ui.internal.handlers;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-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.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategyRegistry;
-
-/**
- * <p>A comment handler to add block comments</p>
- */
-public final class AddBlockCommentHandler extends
- AbstractCommentHandler {
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.handlers.AbstractCommentHandler#processAction(
- * org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.IDocument, org.eclipse.jface.text.ITextSelection)
- */
- protected void processAction(ITextEditor textEditor, IStructuredDocument document, ITextSelection textSelection) {
- IStructuredModel model = null;
- boolean changed = false;
- DocumentRewriteSession session = null;
-
- try {
- model = StructuredModelManager.getModelManager().getModelForEdit(document);
- if(model != null) {
- //makes it so one undo will undo all the edits to the document
- model.beginRecording(this, SSEUIMessages.AddBlockComment_label, SSEUIMessages.AddBlockComment_description);
-
- //keeps listeners from doing anything until updates are all done
- model.aboutToChangeModel();
- if(document instanceof IDocumentExtension4) {
- session = ((IDocumentExtension4)document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
- }
- changed = true;
-
- ITypedRegion[] typedRegions = document.computePartitioning(textSelection.getOffset(), textSelection.getLength());
- CommentingStrategy commentType = CommentingStrategyRegistry.getDefault().getBlockCommentingStrategy(model.getContentTypeIdentifier(), typedRegions);
-
- if(commentType != null) {
- commentType.apply(document, textSelection.getOffset(), textSelection.getLength());
- }
- }
- } catch (BadLocationException e) {
- Logger.logException("The given selection " + textSelection + " must be invalid", e); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- //clean everything up
- if(session != null && document instanceof IDocumentExtension4) {
- ((IDocumentExtension4)document).stopRewriteSession(session);
- }
-
- if(model != null) {
- model.endRecording(this);
- if(changed) {
- model.changedModel();
- }
- model.releaseFromEdit();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/CustomFilterHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/CustomFilterHandler.java
deleted file mode 100644
index baaa020b0b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/CustomFilterHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-
-public class CustomFilterHandler extends AbstractHandler {
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ConfigurableContentOutlinePage page = (ConfigurableContentOutlinePage) editor.getAdapter(IContentOutlinePage.class);
- if (page != null) {
- page.getOutlineFilterProcessor().openDialog();
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java
deleted file mode 100644
index e8a5add803..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.wst.sse.ui.internal.handlers;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-public abstract class FindOccurrencesHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editorPart instanceof ITextEditor)
- textEditor = (ITextEditor) editorPart;
- else {
- Object o = editorPart.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- boolean okay = false;
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null) {
- ITextSelection textSelection = getTextSelection(textEditor);
- FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
- if (findOccurrenceProcessor != null) {
- if (textEditor.getEditorInput() instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
- okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
- }
- }
- }
- }
- if (okay) {
- // clear status message
- PlatformStatusLineUtil.clearStatusLine();
- }
- else {
- String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
- if (textEditor instanceof StructuredTextEditor) {
- PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
-
- }
- else {
- PlatformStatusLineUtil.displayErrorMessage(errorMessage);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
- return null;
- }
-
- /**
- * Get the appropriate find occurrences processor
- *
- * @param document -
- * assumes not null
- * @param textSelection
- * @return
- */
- private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
- // check if we have an action that's enabled on the current partition
- ITypedRegion tr = getPartition(document, textSelection);
- String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
-
- Iterator it = getProcessors().iterator();
- FindOccurrencesProcessor processor = null;
- while (it.hasNext()) {
- processor = (FindOccurrencesProcessor) it.next();
- // we just choose the first action that can handle the partition
- if (processor.enabledForParitition(partition))
- return processor;
- }
-
- List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
- for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
- Object o = extendedFindOccurrencesProcessors.get(i);
- if (o instanceof FindOccurrencesProcessor) {
- /*
- * We just choose the first registered processor that
- * explicitly says it can handle the partition
- */
- processor = (FindOccurrencesProcessor) o;
- if (processor.enabledForParitition(partition))
- return processor;
- }
- }
- return null;
- }
-
- private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
- ITypedRegion region = null;
- if (textSelection != null) {
- try {
- region = document.getPartition(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- region = null;
- }
- }
- return region;
- }
-
- private ITextSelection getTextSelection(ITextEditor textEditor) {
- ITextSelection textSelection = null;
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection && !selection.isEmpty()) {
- textSelection = (ITextSelection) selection;
- }
- return textSelection;
- }
-
- abstract protected List getProcessors();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java
deleted file mode 100644
index 6b1b815528..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation - bug 212330 -
- * Based off FormatActionDelegate.java
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.handlers;
-
-import java.io.IOException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.FormatProcessorsExtensionReader;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-public class FormatHandler extends AbstractHandler implements IHandler {
-
- protected IStructuredSelection fSelection;
-
- public void dispose() {
- // nulling out just in case
- }
-
- private IWorkbenchSiteProgressService getActiveProgressService() {
- IWorkbenchSiteProgressService service = null;
- if (PlatformUI.isWorkbenchRunning()) {
- IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null) {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if (activePage != null) {
- IWorkbenchPart activePart = activePage.getActivePart();
- if (activePart != null) {
- service = (IWorkbenchSiteProgressService) activePart.getSite().getAdapter(IWorkbenchSiteProgressService.class);
- }
- }
- }
- }
- return service;
- }
-
-
-
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getSelectionService().getSelection();
-
- if (selection instanceof IStructuredSelection) {
- fSelection = (IStructuredSelection) selection;
- boolean available = false;
-
- Object[] elements = fSelection.toArray();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IResource) {
- available = processorAvailable((IResource) elements[i]);
-
- if (available)
- break;
- }
- }
- }
-
- if (fSelection != null && !fSelection.isEmpty()) {
- Job job = getJob();
- if (job != null) {
- IWorkbenchSiteProgressService progressService = getActiveProgressService();
- if (progressService != null) {
- progressService.schedule(job);
- }
- else {
- job.schedule();
- }
- }
- }
-
- return null;
- }
-
-
- class FormatJob extends Job {
-
- public FormatJob(String name) {
- super(name);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
-
- Object[] elements = fSelection.toArray();
- monitor.beginTask("", elements.length); //$NON-NLS-1$
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IResource) {
- process(new SubProgressMonitor(monitor, 1), (IResource) elements[i]);
- }
- else {
- monitor.worked(1);
- }
- }
- monitor.done();
-
- if (fErrorStatus.getChildren().length > 0) {
- status = fErrorStatus;
- fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
- }
-
- return status;
- }
-
- }
-
- private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
-
- protected void format(IProgressMonitor monitor, IFile file) {
- if(monitor == null || monitor.isCanceled())
- return;
-
- try {
- monitor.beginTask("", 100);
- IContentDescription contentDescription = file.getContentDescription();
- monitor.worked(5);
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
- if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString().substring(1)}); monitor.subTask(message);
- formatProcessor.setProgressMonitor(new SubProgressMonitor(monitor, 95));
- formatProcessor.formatFile(file);
- }
- }
- monitor.done();
- } catch (MalformedInputExceptionWithDetail e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_5, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- } catch (IOException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- }
-
- protected void format(final IProgressMonitor monitor, IResource resource) {
- if (resource instanceof IFile) {
- final IFile file = (IFile) resource;
-
- // BUG 178598 - If the resource is shared, and it's possible to
- // get the workbench Display, the UI thread is asked to execute the
- // format of the file when it can
- monitor.beginTask("", 20); //$NON-NLS-1$
- try {
- ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- ITextFileBuffer buffer = null;
-
- try {
- if(manager != null) {
- manager.connect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
- buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
- }
-
- if(buffer != null && buffer.isShared()) {
- Display display = getDisplay();
- if (display != null) {
- display.syncExec(new Runnable() {
- public void run() {
- format(new SubProgressMonitor(monitor, 18), file);
- }
- });
- }
- }
- else
- format(new SubProgressMonitor(monitor, 18), file);
- }
- finally {
- if(manager != null)
- manager.disconnect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
- }
- monitor.done();
- }
- catch(CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- finally {
- if(monitor != null)
- monitor.done();
- }
-
-
- } else if (resource instanceof IContainer) {
- IContainer container = (IContainer) resource;
-
- try {
- IResource[] members = container.members();
- monitor.beginTask("", members.length); //$NON-NLS-1$
- for (int i = 0; i < members.length; i++) {
- if (monitor != null && !monitor.isCanceled())
- format(new SubProgressMonitor(monitor, 1), members[i]);
- }
- monitor.done();
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- }
- }
-
- private Display getDisplay() {
-
- // Note: the workbench should always have a display
- // (unless running headless), whereas Display.getCurrent()
- // only returns the display if the currently executing thread
- // has one.
- if (PlatformUI.isWorkbenchRunning())
- return PlatformUI.getWorkbench().getDisplay();
- else
- return null;
- }
-
- protected IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
- return FormatProcessorsExtensionReader.getInstance().getFormatProcessor(contentTypeId);
- }
-
- protected Job getJob() {
- return new FormatJob(SSEUIMessages.FormatActionDelegate_jobName); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.edit.util.ResourceActionDelegate#process(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.resources.IResource)
- */
- protected void process(IProgressMonitor monitor, IResource resource) {
- monitor.beginTask("", 100);
- format(new SubProgressMonitor(monitor, 98), resource);
-
- try {
- resource.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 2));
- } catch (CoreException e) {
- String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
- fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
- }
- monitor.done();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.actions.ResourceActionDelegate#processorAvailable(org.eclipse.core.resources.IResource)
- */
- protected boolean processorAvailable(IResource resource) {
- boolean result = false;
- if (resource.isAccessible()) {
- try {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
-
- IStructuredFormatProcessor formatProcessor = null;
- IContentDescription contentDescription = file.getContentDescription();
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- formatProcessor = getFormatProcessor(contentType.getId());
- }
- if (formatProcessor != null)
- result = true;
- }
- else if (resource instanceof IContainer) {
- IContainer container = (IContainer) resource;
- IResource[] members;
- members = container.members();
- for (int i = 0; i < members.length; i++) {
- boolean available = processorAvailable(members[i]);
-
- if (available) {
- result = true;
- break;
- }
- }
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/RemoveBlockCommentHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/RemoveBlockCommentHandler.java
deleted file mode 100644
index 5cf0beb99b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/RemoveBlockCommentHandler.java
+++ /dev/null
@@ -1,84 +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.wst.sse.ui.internal.handlers;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-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.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategyRegistry;
-
-/**
- * <p>A comment handler to remove block comments</p>
- */
-public final class RemoveBlockCommentHandler extends
- AbstractCommentHandler {
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.handlers.AbstractCommentHandler#processAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.IDocument, org.eclipse.jface.text.ITextSelection)
- */
- protected void processAction(ITextEditor textEditor, IStructuredDocument document, ITextSelection textSelection) {
-
- IStructuredModel model = null;
- boolean changed = false;
- DocumentRewriteSession session = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForEdit(document);
-
- if(model != null) {
- //makes it so one undo will undo all the edits to the document
- model.beginRecording(this, SSEUIMessages.RemoveBlockComment_label,
- SSEUIMessages.RemoveBlockComment_label);
-
- //keeps listeners from doing anything until updates are all done
- model.aboutToChangeModel();
- if(document instanceof IDocumentExtension4) {
- session = ((IDocumentExtension4)document).startRewriteSession(
- DocumentRewriteSessionType.UNRESTRICTED);
- }
- changed = true;
-
- ITypedRegion[] typedRegions = document.computePartitioning(
- textSelection.getOffset(), textSelection.getLength());
- CommentingStrategy commentType = CommentingStrategyRegistry.getDefault().getBlockCommentingStrategy(
- model.getContentTypeIdentifier(), typedRegions);
-
- if(commentType != null) {
- commentType.remove(document, textSelection.getOffset(), textSelection.getLength(), true);
- }
- }
- } catch (BadLocationException e) {
- Logger.logException("The given selection " + textSelection + " must be invalid", e); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- //clean everything up
- if(session != null && document instanceof IDocumentExtension4) {
- ((IDocumentExtension4)document).stopRewriteSession(session);
- }
-
- if(model != null) {
- model.endRecording(this);
- if(changed) {
- model.changedModel();
- }
- model.releaseFromEdit();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/StructuredSelectHistoryHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/StructuredSelectHistoryHandler.java
deleted file mode 100644
index 13c552864a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/StructuredSelectHistoryHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-
-public class StructuredSelectHistoryHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- SelectionHistory history = (SelectionHistory) editor.getAdapter(SelectionHistory.class);
- if (history != null) {
- IRegion old = history.getLast();
- if (old != null) {
- try {
- history.ignoreSelectionChanges();
-
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null)
- textEditor.selectAndReveal(old.getOffset(), old.getLength());
- }
- finally {
- history.listenToSelectionChanges();
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/ToggleLineCommentHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/ToggleLineCommentHandler.java
deleted file mode 100644
index 7ab64bd157..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/ToggleLineCommentHandler.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.handlers;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.swt.widgets.Display;
-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.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.comment.BlockCommentingStrategy;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategy;
-import org.eclipse.wst.sse.ui.internal.comment.CommentingStrategyRegistry;
-import org.eclipse.wst.sse.ui.internal.comment.LineCommentingStrategy;
-
-/**
- * <p>A comment handler to toggle line comments, this means that if a
- * comment already exists on a line then toggling it will remove the comment,
- * if the line in question is not already commented then it will not be commented.
- * If multiple lines are selected each will be commented separately. The handler
- * first attempts to find a {@link LineCommentingStrategy} for a line, if it can
- * not find one then it will try and find a {@link BlockCommentingStrategy} to
- * wrap just that line in.</p>
- *
- * <p>If a great number of lines are being toggled then a progress dialog will be
- * displayed because this can be a timely process</p>
- */
-public final class ToggleLineCommentHandler extends AbstractCommentHandler {
- /** if toggling more then this many lines then use a busy indicator */
- private static final int TOGGLE_LINES_MAX_NO_BUSY_INDICATOR = 10;
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.handlers.AbstractCommentHandler#processAction(
- * org.eclipse.ui.texteditor.ITextEditor, org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument,
- * org.eclipse.jface.text.ITextSelection)
- */
- protected void processAction(ITextEditor textEditor,
- final IStructuredDocument document, ITextSelection textSelection) {
-
- IStructuredModel model = null;
- DocumentRewriteSession session = null;
- boolean changed = false;
-
- try {
- // get text selection lines info
- int selectionStartLine = textSelection.getStartLine();
- int selectionEndLine = textSelection.getEndLine();
-
- int selectionEndLineOffset = document.getLineOffset(selectionEndLine);
- int selectionEndOffset = textSelection.getOffset() + textSelection.getLength();
-
- // adjust selection end line
- if ((selectionEndLine > selectionStartLine) && (selectionEndLineOffset == selectionEndOffset)) {
- selectionEndLine--;
- }
-
- // save the selection position since it will be changing
- Position selectionPosition = null;
- selectionPosition = new Position(textSelection.getOffset(), textSelection.getLength());
- document.addPosition(selectionPosition);
-
-
- model = StructuredModelManager.getModelManager().getModelForEdit(document);
- if (model != null) {
- //makes it so one undo will undo all the edits to the document
- model.beginRecording(this, SSEUIMessages.ToggleComment_label, SSEUIMessages.ToggleComment_description);
-
- //keeps listeners from doing anything until updates are all done
- model.aboutToChangeModel();
- if(document instanceof IDocumentExtension4) {
- session = ((IDocumentExtension4)document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
- }
- changed = true;
-
- //get the display for the editor if we can
- Display display = null;
- if(textEditor instanceof StructuredTextEditor) {
- StructuredTextViewer viewer = ((StructuredTextEditor)textEditor).getTextViewer();
- if(viewer != null) {
- display = viewer.getControl().getDisplay();
- }
- }
-
- //create the toggling operation
- IRunnableWithProgress toggleCommentsRunnable = new ToggleLinesRunnable(
- model.getContentTypeIdentifier(), document, selectionStartLine, selectionEndLine, display);
-
- //if toggling lots of lines then use progress monitor else just run the operation
- if((selectionEndLine - selectionStartLine) > TOGGLE_LINES_MAX_NO_BUSY_INDICATOR && display != null) {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(display.getActiveShell());
- dialog.run(false, true, toggleCommentsRunnable);
- } else {
- toggleCommentsRunnable.run(new NullProgressMonitor());
- }
- }
- } catch (InvocationTargetException e) {
- Logger.logException("Problem running toggle comment progess dialog.", e); //$NON-NLS-1$
- } catch (InterruptedException e) {
- Logger.logException("Problem running toggle comment progess dialog.", e); //$NON-NLS-1$
- } catch (BadLocationException e) {
- Logger.logException("The given selection " + textSelection + " must be invalid", e); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- //clean everything up
- if(session != null && document instanceof IDocumentExtension4) {
- ((IDocumentExtension4)document).stopRewriteSession(session);
- }
-
- if(model != null) {
- model.endRecording(this);
- if(changed) {
- model.changedModel();
- }
- model.releaseFromEdit();
- }
- }
- }
-
- /**
- * <p>The actual line toggling takes place in a runnable so it can be
- * run as part of a progress dialog if there are many lines to toggle
- * and thus the operation will take a noticeable amount of time the user
- * should be aware of, this also allows for the operation to be canceled
- * by the user</p>
- *
- */
- private static class ToggleLinesRunnable implements IRunnableWithProgress {
- /** the content type for the document being commented */
- private String fContentType;
-
- /** the document that the lines will be toggled on */
- private IStructuredDocument fDocument;
-
- /** the first line in the document to toggle */
- private int fSelectionStartLine;
-
- /** the last line in the document to toggle */
- private int fSelectionEndLine;
-
- /** the display, so that it can be updated during a long operation */
- private Display fDisplay;
-
- /**
- * @param model {@link IStructuredModel} that the lines will be toggled on
- * @param document {@link IDocument} that the lines will be toggled on
- * @param selectionStartLine first line in the document to toggle
- * @param selectionEndLine last line in the document to toggle
- * @param display {@link Display}, so that it can be updated during a long operation
- */
- protected ToggleLinesRunnable(String contentTypeIdentifier, IStructuredDocument document,
- int selectionStartLine, int selectionEndLine, Display display) {
-
- this.fContentType = contentTypeIdentifier;
- this.fDocument = document;
- this.fSelectionStartLine = selectionStartLine;
- this.fSelectionEndLine = selectionEndLine;
- this.fDisplay = display;
- }
-
- /**
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) {
- //start work
- monitor.beginTask(SSEUIMessages.ToggleComment_progress,
- this.fSelectionEndLine-this.fSelectionStartLine);
- try {
- final CommentingStrategy[] strategies = new CommentingStrategy[fSelectionEndLine - fSelectionStartLine + 1];
- final int[] regions = new int[fSelectionEndLine - fSelectionStartLine + 1];
- boolean shouldComment = false;
- int strategyCount = 0;
- //toggle each line so long as task not canceled
- for (int line = this.fSelectionStartLine;
- line <= this.fSelectionEndLine && !monitor.isCanceled(); ++line) {
-
- //allows the user to be able to click the cancel button
- readAndDispatch(this.fDisplay);
-
- //get the line region
- IRegion lineRegion = this.fDocument.getLineInformation(line);
-
- //don't toggle empty lines
- String content = this.fDocument.get(lineRegion.getOffset(), lineRegion.getLength());
- if (content.trim().length() > 0) {
- //try to get a line comment type
- ITypedRegion[] lineTypedRegions =
- this.fDocument.computePartitioning(lineRegion.getOffset(), lineRegion.getLength());
- CommentingStrategy commentType = CommentingStrategyRegistry.getDefault().getLineCommentingStrategy(
- this.fContentType, lineTypedRegions);
-
- //could not find line comment type so find block comment type to use on line
- if(commentType == null) {
- commentType = CommentingStrategyRegistry.getDefault().getBlockCommentingStrategy(
- this.fContentType, lineTypedRegions);
- }
-
- //toggle the comment on the line
- if(commentType != null) {
- strategies[strategyCount] = commentType;
- regions[strategyCount++] = line;
- if (!shouldComment && !commentType.alreadyCommenting(this.fDocument, lineTypedRegions)) {
- shouldComment = true;
- }
- }
- }
- monitor.worked(1);
- }
- for (int i = 0; i < strategyCount; i++) {
- final IRegion lineRegion = fDocument.getLineInformation( regions[i] );
- if (shouldComment) {
- strategies[i].apply(this.fDocument, lineRegion.getOffset(), lineRegion.getLength());
- }
- else {
- strategies[i].remove(this.fDocument, lineRegion.getOffset(), lineRegion.getLength(), true);
- }
- monitor.worked(1);
- }
- } catch(BadLocationException e) {
- Logger.logException("Bad location while toggling comments.", e); //$NON-NLS-1$
- }
- //done work
- monitor.done();
- }
-
- /**
- * <p>When calling {@link Display#readAndDispatch()} the game is off as to whose code you maybe
- * calling into because of event handling/listeners/etc. The only important thing is that
- * the UI has been given a chance to react to user clicks. Thus the logging of most {@link Exception}s
- * and {@link Error}s as caused by {@link Display#readAndDispatch()} because they are not caused
- * by this code and do not effect it.</p>
- *
- * @param display the {@link Display} to call <code>readAndDispatch</code>
- * on with exception/error handling.
- */
- private void readAndDispatch(Display display) {
- try {
- display.readAndDispatch();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING,
- "Exception caused by readAndDispatch, not caused by or fatal to caller", e);
- }
- catch (LinkageError e) {
- Logger.log(Logger.WARNING,
- "LinkageError caused by readAndDispatch, not caused by or fatal to caller", e);
- }
- catch (VirtualMachineError e) {
- // re-throw these
- throw e;
- }
- catch (ThreadDeath e) {
- // re-throw these
- throw e;
- }
- catch (Error e) {
- // catch every error, except for a few that we don't want to handle
- Logger.log(Logger.WARNING,
- "Error caused by readAndDispatch, not caused by or fatal to caller", e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
deleted file mode 100644
index 5085fa4c43..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
+++ /dev/null
@@ -1,468 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.hyperlink;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * The is almost an exact copy of DefaultHyperlinkPresenter. However this
- * hyperlink presenter works with the StructuredTextEditor's Highlighter
- * instead of TextPresentation.
- *
- * The main difference is <code>text.redrawRange(offset, length, true);</code>
- * is called instead of passing false for clearBackground. Also all mention of
- * TextPresentation was removed since it does not really apply.
- *
- * @see org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter
- */
-public class HighlighterHyperlinkPresenter implements IHyperlinkPresenter, PaintListener, ITextInputListener, IDocumentListener, IPropertyChangeListener {
-
- /**
- * A named preference that holds the color used for hyperlinks.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- *
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- */
- public final static String HYPERLINK_COLOR = "hyperlinkColor"; //$NON-NLS-1$
-
-
- /** The text viewer. */
- private ITextViewer fTextViewer;
- /** The hand cursor. */
- private Cursor fCursor;
- /** The link color. */
- private Color fColor;
- /** Tells whether to dispose the color on uninstall. */
- private boolean fDisposeColor;
- /** The currently active region. */
- private IRegion fActiveRegion;
- /** The currently active style range as position. */
- private Position fRememberedPosition;
- /** The optional preference store */
- private IPreferenceStore fPreferenceStore;
-
-
- /**
- * Creates a new default hyperlink presenter which uses
- * {@link #HYPERLINK_COLOR}to read the color from the given preference
- * store.
- *
- * @param store
- * the preference store
- */
- public HighlighterHyperlinkPresenter(IPreferenceStore store) {
- fPreferenceStore = store;
- fDisposeColor = true;
- }
-
- /**
- * Creates a new default hyperlink presenter.
- *
- * @param color
- * the hyperlink color, to be disposed by the caller
- */
- public HighlighterHyperlinkPresenter(Color color) {
- fDisposeColor = false;
- fColor = color;
- }
-
- public boolean canShowMultipleHyperlinks() {
- return false;
- }
-
- public void showHyperlinks(IHyperlink[] hyperlinks) {
- Assert.isLegal(hyperlinks != null && hyperlinks.length == 1);
- highlightRegion(hyperlinks[0].getHyperlinkRegion());
- activateCursor();
- }
-
- public void hideHyperlinks() {
- repairRepresentation();
- fRememberedPosition = null;
- }
-
- public void install(ITextViewer textViewer) {
- Assert.isNotNull(textViewer);
- fTextViewer = textViewer;
- fTextViewer.addTextInputListener(this);
-
- StyledText text = fTextViewer.getTextWidget();
- if (text != null && !text.isDisposed()) {
- text.addPaintListener(this);
- if (fPreferenceStore != null)
- fColor = createColor(fPreferenceStore, HYPERLINK_COLOR, text.getDisplay());
- }
-
- if (fPreferenceStore != null)
- fPreferenceStore.addPropertyChangeListener(this);
- }
-
- public void uninstall() {
- fTextViewer.removeTextInputListener(this);
-
- if (fColor != null) {
- if (fDisposeColor)
- fColor.dispose();
- fColor = null;
- }
-
- if (fCursor != null) {
- fCursor.dispose();
- fCursor = null;
- }
-
- StyledText text = fTextViewer.getTextWidget();
- if (text != null && !text.isDisposed())
- text.removePaintListener(this);
-
- fTextViewer = null;
-
- if (fPreferenceStore != null)
- fPreferenceStore.removePropertyChangeListener(this);
- }
-
- public void setColor(Color color) {
- Assert.isNotNull(fTextViewer);
- fColor = color;
- }
-
- private void highlightRegion(IRegion region) {
-
- if (region.equals(fActiveRegion))
- return;
-
- repairRepresentation();
-
- StyledText text = fTextViewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
-
- // Underline
- int offset = 0;
- int length = 0;
- if (fTextViewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
- IRegion widgetRange = extension.modelRange2WidgetRange(region);
- if (widgetRange == null)
- return;
-
- offset = widgetRange.getOffset();
- length = widgetRange.getLength();
-
- }
- else {
- offset = region.getOffset() - fTextViewer.getVisibleRegion().getOffset();
- length = region.getLength();
- }
-
- // needs to clean background due to StructuredTextEditor's highlighter
- text.redrawRange(offset, length, true);
-
- // Invalidate region ==> apply text presentation
- fActiveRegion = region;
-
- if (fTextViewer instanceof ITextViewerExtension2)
- ((ITextViewerExtension2) fTextViewer).invalidateTextPresentation(region.getOffset(), region.getLength());
- else
- fTextViewer.invalidateTextPresentation();
- }
-
- private void activateCursor() {
- StyledText text = fTextViewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
- Display display = text.getDisplay();
- if (fCursor == null)
- fCursor = new Cursor(display, SWT.CURSOR_HAND);
- text.setCursor(fCursor);
- }
-
- private void resetCursor() {
- StyledText text = fTextViewer.getTextWidget();
- if (text != null && !text.isDisposed())
- text.setCursor(null);
-
- if (fCursor != null) {
- fCursor.dispose();
- fCursor = null;
- }
- }
-
- private void repairRepresentation() {
-
- if (fActiveRegion == null)
- return;
-
- int offset = fActiveRegion.getOffset();
- int length = fActiveRegion.getLength();
- fActiveRegion = null;
-
- resetCursor();
-
- // Invalidate ==> remove applied text presentation
- if (fTextViewer instanceof ITextViewerExtension2)
- ((ITextViewerExtension2) fTextViewer).invalidateTextPresentation(offset, length);
- else
- fTextViewer.invalidateTextPresentation();
-
- // Remove underline
- if (fTextViewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
- offset = extension.modelOffset2WidgetOffset(offset);
- }
- else {
- offset -= fTextViewer.getVisibleRegion().getOffset();
- }
- try {
- StyledText text = fTextViewer.getTextWidget();
-
- // needs to clean background due to StructuredTextEditor's
- // highlighter
- text.redrawRange(offset, length, true);
-
- }
- catch (IllegalArgumentException x) {
- // ignore - do not log
- }
- }
-
- /*
- * @see PaintListener#paintControl(PaintEvent)
- */
- public void paintControl(PaintEvent event) {
- if (fActiveRegion == null)
- return;
-
- StyledText text = fTextViewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
- int offset = 0;
- int length = 0;
-
- if (fTextViewer instanceof ITextViewerExtension5) {
-
- ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
- IRegion widgetRange = extension.modelRange2WidgetRange(fActiveRegion);
- if (widgetRange == null)
- return;
-
- offset = widgetRange.getOffset();
- length = widgetRange.getLength();
-
- }
- else {
-
- IRegion region = fTextViewer.getVisibleRegion();
- if (!includes(region, fActiveRegion))
- return;
-
- offset = fActiveRegion.getOffset() - region.getOffset();
- length = fActiveRegion.getLength();
- }
-
- // support for BIDI
- Point minLocation = getMinimumLocation(text, offset, length);
- Point maxLocation = getMaximumLocation(text, offset, length);
-
- int x1 = minLocation.x;
- int x2 = maxLocation.x - 1;
- int y = minLocation.y + text.getLineHeight() - 1;
-
- GC gc = event.gc;
- if (fColor != null && !fColor.isDisposed())
- gc.setForeground(fColor);
- else if (fColor == null && !(offset < 0 && offset >= text.getCharCount())) {
- StyleRange style = text.getStyleRangeAtOffset(offset);
- if (style != null)
- gc.setForeground(style.foreground);
- }
- gc.drawLine(x1, y, x2, y);
- }
-
- private Point getMinimumLocation(StyledText text, int offset, int length) {
- int max = text.getCharCount();
- Rectangle bounds = text.getBounds();
- Point minLocation = new Point(bounds.width, bounds.height);
- for (int i = 0; i <= length; i++) {
- int k = offset + i;
- if (k < 0 || k > max)
- break;
-
- Point location = text.getLocationAtOffset(k);
- if (location.x < minLocation.x)
- minLocation.x = location.x;
- if (location.y < minLocation.y)
- minLocation.y = location.y;
- }
-
- return minLocation;
- }
-
- private Point getMaximumLocation(StyledText text, int offset, int length) {
- Point maxLocation = new Point(0, 0);
-
- for (int i = 0; i <= length; i++) {
- int k = offset + i;
- if (k < 0 || k > text.getCharCount())
- break;
-
- Point location = text.getLocationAtOffset(k);
- if (location.x > maxLocation.x)
- maxLocation.x = location.x;
- if (location.y > maxLocation.y)
- maxLocation.y = location.y;
- }
-
- return maxLocation;
- }
-
- private boolean includes(IRegion region, IRegion position) {
- return position.getOffset() >= region.getOffset() && position.getOffset() + position.getLength() <= region.getOffset() + region.getLength();
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- if (fActiveRegion != null) {
- fRememberedPosition = new Position(fActiveRegion.getOffset(), fActiveRegion.getLength());
- try {
- event.getDocument().addPosition(fRememberedPosition);
- }
- catch (BadLocationException x) {
- fRememberedPosition = null;
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- if (fRememberedPosition != null) {
- if (!fRememberedPosition.isDeleted()) {
-
- event.getDocument().removePosition(fRememberedPosition);
- fActiveRegion = new Region(fRememberedPosition.getOffset(), fRememberedPosition.getLength());
- fRememberedPosition = null;
-
- StyledText widget = fTextViewer.getTextWidget();
- if (widget != null && !widget.isDisposed()) {
- widget.getDisplay().asyncExec(new Runnable() {
- public void run() {
- hideHyperlinks();
- }
- });
- }
-
- }
- else {
- fActiveRegion = null;
- fRememberedPosition = null;
- hideHyperlinks();
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- if (oldInput == null)
- return;
- hideHyperlinks();
- oldInput.removeDocumentListener(this);
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- if (newInput == null)
- return;
- newInput.addDocumentListener(this);
- }
-
- /**
- * Creates a color from the information stored in the given preference
- * store.
- *
- * @param store
- * the preference store
- * @param key
- * the key
- * @param display
- * the display
- * @return the color or <code>null</code> if there is no such
- * information available
- */
- private Color createColor(IPreferenceStore store, String key, Display display) {
-
- RGB rgb = null;
-
- if (store.contains(key)) {
-
- if (store.isDefault(key))
- rgb = PreferenceConverter.getDefaultColor(store, key);
- else
- rgb = PreferenceConverter.getColor(store, key);
-
- if (rgb != null)
- return new Color(display, rgb);
- }
-
- return null;
- }
-
- /*
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (!HYPERLINK_COLOR.equals(event.getProperty()))
- return;
-
- if (fDisposeColor && fColor != null && !fColor.isDisposed())
- fColor.dispose();
- fColor = null;
-
- StyledText textWidget = fTextViewer.getTextWidget();
- if (textWidget != null && !textWidget.isDisposed())
- fColor = createColor(fPreferenceStore, HYPERLINK_COLOR, textWidget.getDisplay());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
deleted file mode 100644
index 35a6e555f8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.hyperlink;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.SafeRunner;
-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.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-/**
- * Open hyperlink action
- */
-public class OpenHyperlinkAction extends TextEditorAction {
- private IHyperlinkDetector[] fHyperlinkDetectors;
- private ITextViewer fTextViewer;
-
- public OpenHyperlinkAction(ResourceBundle bundle, String prefix, ITextEditor editor, ITextViewer viewer) {
- super(bundle, prefix, editor);
- fTextViewer = viewer;
- }
-
- public void setHyperlinkDetectors(IHyperlinkDetector[] detectors) {
- fHyperlinkDetectors = detectors;
- }
-
- public void run() {
- if (fHyperlinkDetectors == null)
- return;
- ISelection selection = getTextEditor().getSelectionProvider().getSelection();
- if (selection == null || !(selection instanceof ITextSelection)) {
- return;
- }
-
- ITextSelection textSelection = (ITextSelection) selection;
- final IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
- IHyperlink hyperlink = null;
-
- synchronized (fHyperlinkDetectors) {
- for (int i = 0, length = fHyperlinkDetectors.length; i < length && hyperlink == null; i++) {
- final IHyperlinkDetector detector = fHyperlinkDetectors[i];
- if (detector == null)
- continue;
-
- /* The array is final, but its contents aren't */
- final IHyperlink[][] hyperlinks = new IHyperlink[1][];
-
- /*
- * Detect from within a SafeRunnable since the list of
- * detectors is extensible
- */
- SafeRunnable detectorRunnable = new SafeRunnable() {
- public void run() throws Exception {
- hyperlinks[0] = detector.detectHyperlinks(fTextViewer, region, false);
- }
- };
- SafeRunner.run(detectorRunnable);
-
- if (hyperlinks[0] == null)
- continue;
-
- if (hyperlinks.length > 0)
- hyperlink = hyperlinks[0][0];
- }
- }
- if (hyperlink != null) {
- /**
- * Force the highlight range to change when the hyperlink is
- * opened by altering the highlighted range beforehand.
- */
- getTextEditor().setHighlightRange(Math.max(0, region.getOffset() - 1), 0, false);
- hyperlink.open();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
deleted file mode 100644
index 72fb2a68b0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
+++ /dev/null
@@ -1,271 +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.sse.ui.internal.openon;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.swt.program.Program;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-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.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-
-/**
- * This action class retrieves the link/file selected by the cursor and
- * attempts to open the link/file in the default editor or web browser
- *
- * @deprecated Use base support for hyperlink navigation
- */
-abstract public class AbstractOpenOn implements IOpenOn {
- protected final String CANNOT_OPEN = SSEUIMessages.AbstractOpenOn_0; //$NON-NLS-1$
- // document currently associated with open
- private IDocument fDocument;
- protected final String FILE_PROTOCOL = "file:/";//$NON-NLS-1$
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
-
- abstract protected IRegion doGetOpenOnRegion(int offset);
-
- abstract protected void doOpenOn(IRegion region);
-
- /**
- * Returns the current document associated with open on
- *
- * @return IDocument
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /**
- * Determines the editor associated with the given file name
- *
- * @param filename
- * @return editor id of the editor associated with the given file name
- */
- private String getEditorId(String filename) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IEditorRegistry editorRegistry = workbench.getEditorRegistry();
- IEditorDescriptor descriptor = editorRegistry.getDefaultEditor(filename);
- if (descriptor != null)
- return descriptor.getId();
- return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
- }
-
- /**
- * 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
- */
- protected IFile getFile(String fileString) {
- IStructuredModel model = null;
- IFile file = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- if (model != null) {
- // use the base location to obtain the in-workspace IFile
- IFile modelFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- if (modelFile != null) {
- // find the referenced file's location on disk
- URIResolver resolver = model.getResolver();
- if (resolver != null) {
- String filesystemLocation = resolver.getLocationByURI(fileString);
- if (filesystemLocation != null) {
- IFile[] workspaceFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(filesystemLocation));
- // favor a workspace file in the same project
- for (int i = 0; i < workspaceFiles.length && file == null; i++) {
- if (workspaceFiles[i].getProject().equals(modelFile.getProject())) {
- file = workspaceFiles[i];
- }
- }
- // if none were in the same project, just pick one
- if (file == null && workspaceFiles.length > 0) {
- file = workspaceFiles[0];
- }
- }
- }
- }
- }
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING, e.getMessage());
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- if (file == null && fileString.startsWith("/")) { //$NON-NLS-1$
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileString));
- }
- return file;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.IOpenOn#getOpenOnRegion(org.eclipse.jface.text.IDocument,
- * int)
- */
- public IRegion getOpenOnRegion(IDocument doc, int offset) {
- IRegion region;
- // set the document for this action
- setDocument(doc);
- region = doGetOpenOnRegion(offset);
- // reset the document back to null for this action
- setDocument(null);
- return region;
- }
-
- /**
- * Try to open the external file, fileString in its default editor
- *
- * @param fileString
- * @return IEditorPart editor opened or null if editor could not be opened
- */
- protected IEditorPart openExternalFile(String fileString) {
- // file does not exist in workspace so try to open using system editor
- File file = new File(fileString);
- // try to open existing external file if it exists
- if (file.exists()) {
- IEditorInput input = new ExternalFileEditorInput(file);
- String editorId = getEditorId(fileString);
-
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return page.openEditor(input, editorId, true);
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- return null;
- }
-
- /**
- * Notifies user that open on selection action could not successfully open
- * the selection (writes message on status bar and beeps)
- */
- protected void openFileFailed() {
- PlatformStatusLineUtil.displayErrorMessage(CANNOT_OPEN);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
-
- /**
- * Opens the IFile, input in its default editor, if possible, and returns
- * the editor opened. Possible reasons for failure: input cannot be found,
- * input does not exist in workbench, editor cannot be opened.
- *
- * @return IEditorPart editor opened or null if input == null or does not
- * exist, external editor was opened, editor could not be opened
- */
- protected IEditorPart openFileInEditor(IFile input) {
- if (input != null && input.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return IDE.openEditor(page, input, true);
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- return null;
- }
-
- // on
-
- /**
- * Opens the appropriate editor for fileString
- *
- * @param fileString
- */
- protected void openFileInEditor(String fileString) {
- IEditorPart editor = null;
- if (fileString != null) {
- // open web browser if this is a web address
- String temp = fileString.toLowerCase();
- if (temp.startsWith(HTTP_PROTOCOL)) {
- Program.launch(fileString); // launches web browser/executable
- // associated with uri
- return;
- }
- // chop off the file protocol
- if (temp.startsWith(FILE_PROTOCOL)) {
- fileString = fileString.substring(FILE_PROTOCOL.length());
- }
-
- // try to locate the file in the workspace and return an IFile if
- // found
- IFile file = getFile(fileString);
- if (file != null) {
- // file exists in workspace
- editor = openFileInEditor(file);
- }
- else {
- // file does not exist in workspace
- editor = openExternalFile(fileString);
- }
- }
- // no editor was opened
- if (editor == null) {
- openFileFailed();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.IOpenOn#openOn(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.IRegion)
- */
- public void openOn(IDocument doc, IRegion region) {
- // set the document for this action
- setDocument(doc);
- // if no region was given this action fails
- if (region == null)
- openFileFailed();
- else
- doOpenOn(region);
- // reset the document back to null for this action
- setDocument(null);
- }
-
- /**
- * Sets current document associated with open on
- *
- * @param document
- */
- public void setDocument(IDocument document) {
- fDocument = document;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java
deleted file mode 100644
index 51d0a83ebf..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,116 +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.wst.sse.ui.internal.openon;
-
-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.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-
-/**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- *
- * @deprecated Use org.eclipse.ui.ide.FileStoreEditorInput and EFS.getLocalFileSystem().fromLocalFile()
- */
-public class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
-
- private File fFile;
-
- public ExternalFileEditorInput(File file) {
- super();
- fFile = file;
- }
-
- /*
- * @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);
- }
-
- return false;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (ILocationProvider.class.equals(adapter))
- return this;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @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.editors.text.ILocationProvider#getPath(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) element;
- return new Path(input.fFile.getAbsolutePath());
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java
deleted file mode 100644
index fb67c386c4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.openon;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-
-/**
- * Interface for Open On... navigation
- *
- * @author amywu
- */
-public interface IOpenOn {
- /**
- * Returns the entire region relevant to the current offset where an
- * openable source region is found. null if offset does not contain an
- * openable source.
- *
- * @param document
- * IDocument
- * @param offset
- * int
- * @return IRegion entire region of openable source
- */
- public IRegion getOpenOnRegion(IDocument document, int offset);
-
- /**
- * Opens the file/source relevant to region if possible.
- *
- * @param viewer
- * ITextViewer
- * @param region
- * Region to examine
- */
- public void openOn(IDocument document, IRegion region);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java
deleted file mode 100644
index 372a62008c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java
+++ /dev/null
@@ -1,660 +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.sse.ui.internal.openon;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-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.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-
-/**
- * @deprecated Use org.eclipse.jface.text.hyperlink.HyperlinkManager
- */
-public class OpenFileHyperlinkTracker implements KeyListener, MouseListener, MouseMoveListener, FocusListener, PaintListener, IPropertyChangeListener, IDocumentListener, ITextInputListener {
-
- /** The session is active. */
- private boolean fActive;
-
- /** The currently active style range. */
- private IRegion fActiveRegion;
- /** Preference key for browser-like links to be enabled */
- private String fBrowserLikeLinksKeyModifierKey;
-
- /** The link color. */
- private Color fColor;
- /** The hand cursor. */
- private Cursor fCursor;
- /** The key modifier mask. */
- private int fKeyModifierMask;
- /** Preference key for hyperlink underline color */
- private String fLinkColorKey;
- /** The preference store */
- private IPreferenceStore fPreferenceStore;
- /** The currently active style range as position. */
- private Position fRememberedPosition;
-
- /** The text viewer this hyperlink tracker is associated with */
- private ITextViewer fTextViewer;
-
- /**
- *
- */
- public OpenFileHyperlinkTracker(ITextViewer textViewer) {
- fTextViewer = textViewer;
- }
-
- private void activateCursor(ITextViewer viewer) {
- StyledText text = viewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
- Display display = text.getDisplay();
- if (fCursor == null)
- fCursor = new Cursor(display, SWT.CURSOR_HAND);
- text.setCursor(fCursor);
- }
-
- private int computeStateMask(String modifiers) {
- if (modifiers == null)
- return -1;
-
- if (modifiers.length() == 0)
- return SWT.NONE;
-
- int stateMask = 0;
- StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* "); //$NON-NLS-1$
- while (modifierTokenizer.hasMoreTokens()) {
- int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
- if (modifier == 0 || (stateMask & modifier) == modifier)
- return -1;
- stateMask = stateMask | modifier;
- }
- return stateMask;
- }
-
- /**
- * Creates a color from the information stored in the given preference
- * store. Returns <code>null</code> if there is no such information
- * available.
- */
- private Color createColor(IPreferenceStore store, String key, Display display) {
-
- RGB rgb = null;
-
- if (store.contains(key)) {
-
- if (store.isDefault(key))
- rgb = PreferenceConverter.getDefaultColor(store, key);
- else
- rgb = PreferenceConverter.getColor(store, key);
- }
-
- return EditorUtility.getColor(rgb);
- }
-
- public void deactivate() {
- deactivate(false);
- }
-
- public void deactivate(boolean redrawAll) {
- if (!fActive)
- return;
-
- repairRepresentation(redrawAll);
- fActive = false;
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- if (fActive && fActiveRegion != null) {
- fRememberedPosition = new Position(fActiveRegion.getOffset(), fActiveRegion.getLength());
- try {
- event.getDocument().addPosition(fRememberedPosition);
- } catch (BadLocationException x) {
- fRememberedPosition = null;
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- if (fRememberedPosition != null) {
- if (!fRememberedPosition.isDeleted()) {
-
- event.getDocument().removePosition(fRememberedPosition);
- fActiveRegion = new Region(fRememberedPosition.getOffset(), fRememberedPosition.getLength());
- fRememberedPosition = null;
-
- ITextViewer viewer = getTextViewer();
- if (viewer != null) {
- StyledText widget = viewer.getTextWidget();
- if (widget != null && !widget.isDisposed()) {
- widget.getDisplay().asyncExec(new Runnable() {
- public void run() {
- deactivate();
- }
- });
- }
- }
-
- } else {
- fActiveRegion = null;
- fRememberedPosition = null;
- deactivate();
- }
- }
- }
-
- /*
- * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
- */
- public void focusGained(FocusEvent e) {
- }
-
- /*
- * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
- */
- public void focusLost(FocusEvent event) {
- deactivate();
- }
-
- private int getCurrentTextOffset() {
- try {
- StyledText text = getTextViewer().getTextWidget();
- if (text == null || text.isDisposed())
- return -1;
-
- Display display = text.getDisplay();
- Point absolutePosition = display.getCursorLocation();
- Point relativePosition = text.toControl(absolutePosition);
-
- int widgetOffset = text.getOffsetAtLocation(relativePosition);
- if (getTextViewer() instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) getTextViewer();
- return extension.widgetOffset2ModelOffset(widgetOffset);
- } else {
- return widgetOffset + getTextViewer().getVisibleRegion().getOffset();
- }
-
- } catch (IllegalArgumentException e) {
- return -1;
- }
- }
-
- private Point getMaximumLocation(StyledText text, int offset, int length) {
- Point maxLocation = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
-
- for (int i = 0; i <= length; i++) {
- Point location = text.getLocationAtOffset(offset + i);
-
- if (location.x > maxLocation.x)
- maxLocation.x = location.x;
- if (location.y > maxLocation.y)
- maxLocation.y = location.y;
- }
-
- return maxLocation;
- }
-
- private Point getMinimumLocation(StyledText text, int offset, int length) {
- Point minLocation = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
-
- for (int i = 0; i <= length; i++) {
- Point location = text.getLocationAtOffset(offset + i);
-
- if (location.x < minLocation.x)
- minLocation.x = location.x;
- if (location.y < minLocation.y)
- minLocation.y = location.y;
- }
-
- return minLocation;
- }
-
- private IPreferenceStore getNewPreferenceStore() {
- return fPreferenceStore;
- }
-
- private ITextViewer getTextViewer() {
- return fTextViewer;
- }
-
- private void highlightRegion(ITextViewer viewer, IRegion region) {
-
- if (region.equals(fActiveRegion))
- return;
-
- repairRepresentation();
-
- StyledText text = viewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
-
- // Underline
- int offset = 0;
- int length = 0;
- if (viewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
- IRegion widgetRange = extension.modelRange2WidgetRange(new Region(region.getOffset(), region.getLength()));
- if (widgetRange == null)
- return;
-
- offset = widgetRange.getOffset();
- length = widgetRange.getLength();
-
- } else {
- offset = region.getOffset() - viewer.getVisibleRegion().getOffset();
- length = region.getLength();
- }
- // need clearBackground to be true for paint event to be fired
- text.redrawRange(offset, length, true);
-
- fActiveRegion = region;
- }
-
- private boolean includes(IRegion region, IRegion position) {
- return position.getOffset() >= region.getOffset() && position.getOffset() + position.getLength() <= region.getOffset() + region.getLength();
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- if (oldInput == null)
- return;
- deactivate();
- oldInput.removeDocumentListener(this);
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument,
- * org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- if (newInput == null)
- return;
- newInput.addDocumentListener(this);
- }
-
- public void install(IPreferenceStore store) {
- fPreferenceStore = store;
- ITextViewer textViewer = getTextViewer();
- if (textViewer == null)
- return;
-
- StyledText text = textViewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
- updateColor(textViewer);
-
- textViewer.addTextInputListener(this);
-
- IDocument document = textViewer.getDocument();
- if (document != null)
- document.addDocumentListener(this);
-
- text.addKeyListener(this);
- text.addMouseListener(this);
- text.addMouseMoveListener(this);
- text.addFocusListener(this);
- text.addPaintListener(this);
-
- updateKeyModifierMask();
-
- fPreferenceStore.addPropertyChangeListener(this);
- }
-
- /*
- * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)
- */
- public void keyPressed(KeyEvent event) {
-
- if (fActive) {
- deactivate();
- return;
- }
-
- if (event.keyCode != fKeyModifierMask) {
- deactivate();
- return;
- }
-
- fActive = true;
-
- // removed for #25871
- //
- // ISourceViewer viewer= getSourceViewer();
- // if (viewer == null)
- // return;
- //
- // IRegion region= getCurrentTextRegion(viewer);
- // if (region == null)
- // return;
- //
- // highlightRegion(viewer, region);
- // activateCursor(viewer);
- }
-
- /*
- * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent)
- */
- public void keyReleased(KeyEvent event) {
-
- if (!fActive)
- return;
-
- deactivate();
- }
-
- /*
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- /*
- * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDown(MouseEvent event) {
-
- if (!fActive)
- return;
-
- if (event.stateMask != fKeyModifierMask) {
- deactivate();
- return;
- }
-
- if (event.button != 1) {
- deactivate();
- return;
- }
- }
-
- /*
- * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseMove(MouseEvent event) {
-
- if (event.widget instanceof Control && !((Control) event.widget).isFocusControl()) {
- deactivate();
- return;
- }
-
- if (!fActive) {
- if (event.stateMask != fKeyModifierMask)
- return;
- // modifier was already pressed
- fActive = true;
- }
-
- ITextViewer viewer = getTextViewer();
- if (viewer == null) {
- deactivate();
- return;
- }
-
- StyledText text = viewer.getTextWidget();
- if (text == null || text.isDisposed()) {
- deactivate();
- return;
- }
-
- if ((event.stateMask & SWT.BUTTON1) != 0 && text.getSelectionCount() != 0) {
- deactivate();
- return;
- }
-
- IRegion region = null;
- int offset = getCurrentTextOffset();
- IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(getTextViewer().getDocument(), offset);
- if (openOn != null) {
- region = openOn.getOpenOnRegion(getTextViewer().getDocument(), offset);
- }
- if (region == null || region.getLength() == 0) {
- repairRepresentation();
- return;
- }
-
- highlightRegion(viewer, region);
- activateCursor(viewer);
- }
-
- /*
- * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseUp(MouseEvent e) {
-
- if (!fActive)
- return;
-
- if (e.button != 1) {
- deactivate();
- return;
- }
-
- boolean wasActive = fCursor != null;
- IRegion previousRegion = fActiveRegion;
-
- deactivate();
-
- if (wasActive) {
- IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(getTextViewer().getDocument(), previousRegion.getOffset());
- if (openOn != null) {
- openOn.openOn(getTextViewer().getDocument(), previousRegion);
- }
- }
- }
-
- /*
- * @see PaintListener#paintControl(PaintEvent)
- */
- public void paintControl(PaintEvent event) {
- if (fActiveRegion == null)
- return;
-
- ITextViewer viewer = getTextViewer();
- if (viewer == null)
- return;
-
- StyledText text = viewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
-
- int offset = 0;
- int length = 0;
-
- if (viewer instanceof ITextViewerExtension5) {
-
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
- IRegion widgetRange = extension.modelRange2WidgetRange(fActiveRegion);
- if (widgetRange == null)
- return;
-
- offset = widgetRange.getOffset();
- length = widgetRange.getLength();
-
- } else {
-
- IRegion region = viewer.getVisibleRegion();
- if (!includes(region, fActiveRegion))
- return;
-
- offset = fActiveRegion.getOffset() - region.getOffset();
- length = fActiveRegion.getLength();
- }
-
- // support for bidi
- Point minLocation = getMinimumLocation(text, offset, length);
- Point maxLocation = getMaximumLocation(text, offset, length);
-
- int x1 = minLocation.x;
- int x2 = minLocation.x + maxLocation.x - minLocation.x - 1;
- int y = minLocation.y + text.getLineHeight() - 1;
-
- GC gc = event.gc;
- if (fColor != null && !fColor.isDisposed())
- gc.setForeground(fColor);
- gc.drawLine(x1, y, x2, y);
- }
-
- /*
- * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(fLinkColorKey)) {
- ITextViewer viewer = getTextViewer();
- if (viewer != null)
- updateColor(viewer);
- } else if (event.getProperty().equals(fBrowserLikeLinksKeyModifierKey)) {
- updateKeyModifierMask();
- }
- }
-
- private void repairRepresentation() {
- repairRepresentation(false);
- }
-
- private void repairRepresentation(boolean redrawAll) {
-
- if (fActiveRegion == null)
- return;
-
- int offset = fActiveRegion.getOffset();
- int length = fActiveRegion.getLength();
- fActiveRegion = null;
-
- ITextViewer viewer = getTextViewer();
- if (viewer != null) {
-
- resetCursor(viewer);
-
- // Remove underline
- if (viewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
- offset = extension.modelOffset2WidgetOffset(offset);
- } else {
- offset -= viewer.getVisibleRegion().getOffset();
- }
- try {
- StyledText text = viewer.getTextWidget();
-
- // need clearBackground to be true for paint event to be fired
- text.redrawRange(offset, length, true);
- } catch (IllegalArgumentException x) {
- Logger.logException(x);
- }
- }
- }
-
- private void resetCursor(ITextViewer viewer) {
- StyledText text = viewer.getTextWidget();
- if (text != null && !text.isDisposed())
- text.setCursor(null);
-
- if (fCursor != null) {
- fCursor.dispose();
- fCursor = null;
- }
- }
-
- public void setHyperlinkPreferenceKeys(String linkColorKey, String browserLikeLinksKeyModifierKey) {
- fLinkColorKey = linkColorKey;
- fBrowserLikeLinksKeyModifierKey = browserLikeLinksKeyModifierKey;
- }
-
- public void uninstall() {
- if (fCursor != null) {
- fCursor.dispose();
- fCursor = null;
- }
-
- ITextViewer textViewer = getTextViewer();
- if (textViewer == null)
- return;
-
- textViewer.removeTextInputListener(this);
-
- IDocument document = textViewer.getDocument();
- if (document != null)
- document.removeDocumentListener(this);
-
- IPreferenceStore preferenceStore = getNewPreferenceStore();
- if (preferenceStore != null)
- preferenceStore.removePropertyChangeListener(this);
-
- StyledText text = textViewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
- text.removeKeyListener(this);
- text.removeMouseListener(this);
- text.removeMouseMoveListener(this);
- text.removeFocusListener(this);
- text.removePaintListener(this);
- }
-
- private void updateColor(ITextViewer viewer) {
- StyledText text = viewer.getTextWidget();
- if (text == null || text.isDisposed())
- return;
-
- Display display = text.getDisplay();
- fColor = createColor(getNewPreferenceStore(), fLinkColorKey, display);
- }
-
- private void updateKeyModifierMask() {
- String modifiers = getNewPreferenceStore().getString(fBrowserLikeLinksKeyModifierKey);
- fKeyModifierMask = computeStateMask(modifiers);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java
deleted file mode 100644
index fe7702c7ce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java
+++ /dev/null
@@ -1,74 +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.sse.ui.internal.openon;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-
-/**
- * Determines the appropriate IOpenFileAction to call based on current
- * partition.
- *
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnAction extends TextEditorAction {
- public OpenOnAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- BusyIndicator.showWhile(getTextEditor().getEditorSite().getShell().getDisplay(), new Runnable() {
- public void run() {
- ITextEditor editor = getTextEditor();
-
- // figure out current offset
- int offset = -1;
- ISourceEditingTextTools textTools = (ISourceEditingTextTools) getTextEditor().getAdapter(ISourceEditingTextTools.class);
- if (textTools != null) {
- offset = textTools.getCaretOffset();
- }
- else if (editor instanceof IExtendedSimpleEditor) {
- offset = ((IExtendedSimpleEditor) editor).getCaretPosition();
- }
- else {
- if (editor.getSelectionProvider() != null) {
- ISelection sel = editor.getSelectionProvider().getSelection();
- if (sel instanceof ITextSelection) {
- offset = ((ITextSelection) sel).getOffset();
- }
- }
- }
- IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(document, offset);
- if (openOn != null) {
- openOn.openOn(document, new Region(offset, 0));
- }
- }
- });
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java
deleted file mode 100644
index 3e02958bbb..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java
+++ /dev/null
@@ -1,267 +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.sse.ui.internal.openon;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-
-
-/**
- * Reads extensions for open on extension point,
- * org.eclipse.wst.sse.ui.extensions.openon
- *
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnBuilder extends RegistryReader {
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- public static final String ATT_ID = "id"; //$NON-NLS-1$
-
- private static OpenOnBuilder fInstance;
- // extension point ID
- public static final String PL_OPENON = "openon"; //$NON-NLS-1$
-
- public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
- public static final String TAG_CONTENT_TYPE_IDENTIFIER = "contenttypeidentifier"; //$NON-NLS-1$
-
- public static final String TAG_OPENON = "openon"; //$NON-NLS-1$
- public static final String TAG_PARTITION_TYPE = "partitiontype"; //$NON-NLS-1$
-
- /**
- * returns singleton instance of OpenOnBuilder
- *
- * @return OpenOnBuilder
- */
- public synchronized static OpenOnBuilder getInstance() {
- if (fInstance == null) {
- fInstance = new OpenOnBuilder();
- }
- return fInstance;
- }
-
- private String fCurrentContentType;
- private OpenOnDefinition fCurrentOpenOnDefinition = null;
-
- private List fOpenOnDefs = null;
-
- protected String targetContributionTag;
-
- /**
- * Returns the name of the part ID attribute that is expected in the
- * target extension.
- *
- * @param element
- * @return String
- */
- protected String getId(IConfigurationElement element) {
- String value = element.getAttribute(ATT_ID);
- return value;
- }
-
- protected String getOpenOnClass(IConfigurationElement element) {
- String value = element.getAttribute(ATT_CLASS);
- return value;
- }
-
- /**
- * Returns all the open on definition objects
- *
- * @return
- */
- public OpenOnDefinition[] getOpenOnDefinitions() {
- initCache();
- return (OpenOnDefinition[]) fOpenOnDefs.toArray(new OpenOnDefinition[fOpenOnDefs.size()]);
- }
-
- /**
- * Returns all the open on definition objects valid for
- * contentType/partitionType
- *
- * @param contentType
- * @param partitionType
- * @return if either contentType or partitionType is null, null is
- * returned
- */
- public OpenOnDefinition[] getOpenOnDefinitions(String contentType, String partitionType) {
- if (contentType == null || partitionType == null) {
- // should not be able to define an openon without a content type
- // but if it were possible then would need to search all openon
- // definitions for
- // definitions with empty contentType list
- return null;
- }
-
- // entire list of openon definition objects
- OpenOnDefinition[] allDefs = getOpenOnDefinitions();
- // current list of open on definitions valid for
- // contentType/partitionType
- List defs = new ArrayList();
- // default definitions that should be added to end of list of open on
- // definitions
- List lastDefs = new ArrayList();
-
- for (int i = 0; i < allDefs.length; ++i) {
- // for each one check if it contains contentType
- List partitions = (List) allDefs[i].getContentTypes().get(contentType);
- if (partitions != null) {
- // this openon definition is valid for all partition types for
- // this content type
- if (partitions.isEmpty()) {
- // this will be added to end of list because this is
- // considered a default openon
- lastDefs.add(allDefs[i]);
- } else {
- // examine the partition types of this openon
- int j = 0; // current index in list of partitions
- boolean added = false; // openon has been added to list
- while (j < partitions.size() && !added) {
- // this openon definition applies to partitionType so
- // add to list of valid openons
- if (partitionType.equals(partitions.get(j))) {
- defs.add(allDefs[i]);
- added = true;
- } else {
- // continue checking to see if this openon
- // definition is valid for current partitionType
- ++j;
- }
- }
- }
- }
- }
- // append the default openon definitions
- defs.addAll(lastDefs);
-
- // return the list
- return (OpenOnDefinition[]) defs.toArray(new OpenOnDefinition[defs.size()]);
- }
-
- private void initCache() {
- if (fOpenOnDefs == null) {
- fOpenOnDefs = new ArrayList(0);
- readContributions(TAG_OPENON, PL_OPENON);
- }
- }
-
- /**
- * Processes element which should be a configuration element specifying a
- * content type for the current open on tag. Assumes that there is a valid
- * current open on definition object.
- *
- * @param element
- * contenttypeidentifier configuration element
- */
- private void processContentTypeTag(IConfigurationElement element) {
- // add to current openOnDefinition
- String theId = getId(element);
-
- if (theId != null) {
- fCurrentContentType = theId;
- fCurrentOpenOnDefinition.addContentTypeId(fCurrentContentType);
- } else {
- fCurrentContentType = null;
- }
- }
-
- /**
- * Processes element which should be a configuration element specifying an
- * open on object. Creates a new open on definition object and adds it to
- * the list of open on definition objects
- *
- * @param element
- * openon configuration element
- */
- private void processOpenOnTag(IConfigurationElement element) {
- String theId = getId(element);
- String theClass = getOpenOnClass(element);
-
- if (theId != null && theClass != null) {
- // start building new OpenOnDefinition
- fCurrentOpenOnDefinition = new OpenOnDefinition(theId, theClass, element);
- fOpenOnDefs.add(fCurrentOpenOnDefinition);
- } else {
- fCurrentOpenOnDefinition = null;
- }
- }
-
- /**
- * Processes element which should be a configuration element specifying a
- * partition type for the current open on/content type tag. Assumes that
- * there is a valid current open on/content type tag.
- *
- * @param element
- * partitiontype configuration element
- */
- private void processPartitionTypeTag(IConfigurationElement element) {
- // add to current openOnDefinition/contentType
- String theId = getId(element);
-
- if (theId != null) {
- fCurrentOpenOnDefinition.addPartitionType(fCurrentContentType, theId);
- }
- }
-
- /**
- * Reads the contributions from the registry for the provided workbench
- * part and the provided extension point ID.
- *
- * @param tag
- * @param extensionPoint
- */
- protected void readContributions(String tag, String extensionPoint) {
- targetContributionTag = tag;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- readRegistry(registry, PLUGIN_ID, extensionPoint);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.extension.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- protected boolean readElement(IConfigurationElement element) {
- String tag = element.getName();
-
- if (tag.equals(targetContributionTag)) {
- processOpenOnTag(element);
-
- // make sure processing of current open on tag resulted in a
- // current open on definition
- // before continue reading the children
- if (fCurrentOpenOnDefinition != null) {
- readElementChildren(element);
- }
- return true;
- } else if (tag.equals(TAG_CONTENT_TYPE_IDENTIFIER)) {
- processContentTypeTag(element);
-
- // make sure processing of current content type resulted in a
- // valid content type
- // before reading the children
- if (fCurrentContentType != null) {
- readElementChildren(element);
- }
- return true;
- } else if (tag.equals(TAG_PARTITION_TYPE)) {
- processPartitionTypeTag(element);
- return true;
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java
deleted file mode 100644
index 5a60d601d8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java
+++ /dev/null
@@ -1,157 +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.sse.ui.internal.openon;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Open on definition object
- *
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnDefinition {
- private String fClassName = null;
-
- private IConfigurationElement fConfigurationElement = null;
-
- // a hash map of content type Ids (String) that points to lists of
- // parition types (List of Strings)
- // contentTypeId -> List(paritionType, paritionType, partitionType, ...)
- // contentTypeId2 -> List(partitionType, partitionType, ...)
- // ...
- private HashMap fContentTypes = null;
- private String fId = null;
-
- /**
- * @param id
- * @param class1
- * @param configurationElement
- */
- public OpenOnDefinition(String id, String class1, IConfigurationElement configurationElement) {
- super();
- fId = id;
- fClassName = class1;
- fConfigurationElement = configurationElement;
- fContentTypes = new HashMap();
- }
-
- public void addContentTypeId(String contentTypeId) {
- if (!fContentTypes.containsKey(contentTypeId))
- fContentTypes.put(contentTypeId, new ArrayList());
- }
-
- public void addPartitionType(String contentTypeId, String partitionType) {
- if (!fContentTypes.containsKey(contentTypeId))
- fContentTypes.put(contentTypeId, new ArrayList());
-
- List partitionList = (List) fContentTypes.get(contentTypeId);
- partitionList.add(partitionType);
- }
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param propertyName
- * @return Object
- */
- private Object createExtension(String propertyName) {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- final IConfigurationElement element = getConfigurationElement();
- final String name = propertyName;
-
- final Object[] result = new Object[1];
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- return element.createExecutableExtension(name);
- } catch (CoreException e) {
- handleCreateExecutableException(result, e);
- }
- } else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = element.createExecutableExtension(name);
- } catch (Exception e) {
- handleCreateExecutableException(result, e);
- }
- }
- });
- }
- return result[0];
- }
-
- /**
- * @return IOpenOn for this definition
- */
- public IOpenOn createOpenOn() {
- IOpenOn openOn = null;
-
- if (getClassName() != null) {
- openOn = (IOpenOn) createExtension(OpenOnBuilder.ATT_CLASS);
- }
-
- return openOn;
- }
-
- /**
- * @return Returns the fClass.
- */
- public String getClassName() {
- return fClassName;
- }
-
- /**
- * @return Returns the fConfigurationElement.
- */
- public IConfigurationElement getConfigurationElement() {
- return fConfigurationElement;
- }
-
- /**
- * @return Returns the fContentTypes.
- */
- public HashMap getContentTypes() {
- return fContentTypes;
- }
-
- /**
- * @return Returns the fId.
- */
- public String getId() {
- return fId;
- }
-
- /**
- * @param result
- * @param e
- */
- private void handleCreateExecutableException(Object[] result, Throwable e) {
- Logger.logException("Unable to create open on: " + getId(), e); //$NON-NLS-1$
- e.printStackTrace();
- result[0] = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
deleted file mode 100644
index 4609ff9d98..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
+++ /dev/null
@@ -1,143 +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.sse.ui.internal.openon;
-
-
-
-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.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-
-
-/**
- * Determines the appropriate IOpenOn to call based on current partition.
- *
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnProvider {
- private static OpenOnProvider fInstance;
-
- /**
- * returns singleton instance of OpenOnProvider
- *
- * @return OpenOnProvider
- */
- public synchronized static OpenOnProvider getInstance() {
- if (fInstance == null) {
- fInstance = new OpenOnProvider();
- }
- return fInstance;
- }
-
-
- /**
- * Returns the content type of document
- *
- * @param document -
- * assumes document is not null
- * @return String content type of given document
- */
- protected String getContentType(IDocument document) {
- String type = null;
-
- IModelManager mgr = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- try {
- model = mgr.getExistingModelForRead(document);
- if (model != null) {
- type = model.getContentTypeIdentifier();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return type;
- }
-
- /**
- * Returns the appropriate IOpenOn for the current partition
- *
- * @return
- */
- public IOpenOn getOpenOn(IDocument document, int offset) {
- IOpenOn openOn = null;
-
- // determine the current partition
- if (document != null) {
- String contentTypeID = getContentType(document);
- String partitionType = getPartitionType(document, offset);
-
- IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-
- while (openOn == null && contentType != null) {
- // Query OpenOnBuilder and get the list of OpenOns for the
- // current partition
- OpenOnDefinition[] defs = OpenOnBuilder.getInstance().getOpenOnDefinitions(contentType.getId(), partitionType);
- contentType = contentType.getBaseType();
-
- // If more than 1 openon is returned, need to further check
- // which OpenOn is the appropriate one to return
- // for now just returning the first one
- if (defs != null && defs.length > 0) {
- openOn = defs[0].createOpenOn();
- }
- }
- }
-
- return openOn;
- }
-
- /**
- * Returns the partition type located at offset in the document
- *
- * @param document -
- * assumes document is not null
- * @param offset
- * @return String partition type
- */
- protected String getPartitionType(IDocument document, int offset) {
- String type = null;
- try {
- // TODO: provide partitioning information so we're not using a default like this
- if (document instanceof IStructuredDocument) {
- type = TextUtilities.getContentType(document, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
- }
- }
- catch (BadLocationException e1) {
- }
- finally {
- if (type == null) {
- try {
- ITypedRegion region = document.getPartition(offset);
- if (region != null) {
- type = region.getType();
- }
- }
- catch (BadLocationException e) {
- type = null;
- }
- }
- }
- return type;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
deleted file mode 100644
index 5ce3447929..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
+++ /dev/null
@@ -1,156 +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.wst.sse.ui.internal.preferences;
-
-
-/**
- * Preference keys for SSE UI
- */
-public class EditorPreferenceNames {
- /**
- * A named preference that controls on-the-fly validation
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String EVALUATE_TEMPORARY_PROBLEMS = getEvaluateTemporaryProblemsKey();
-
- private static String getEvaluateTemporaryProblemsKey() {
- return "evaluateTemporaryProblems"; //$NON-NLS-1$
- }
-
- /**
- * A named preference that controls whether bracket matching highlighting
- * is turned on or off.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public final static String MATCHING_BRACKETS = getMatchingBracketsKey();
-
- private static String getMatchingBracketsKey() {
- return "matchingBrackets"; //$NON-NLS-1$
- }
-
- /**
- * A named preference that holds the color used to highlight matching
- * brackets.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- */
- public final static String MATCHING_BRACKETS_COLOR = getMatchingBracketsColorKey();
-
- private static String getMatchingBracketsColorKey() {
- return "matchingBracketsColor"; //$NON-NLS-1$
- }
-
- /**
- * A named preference that defines the key for the hover modifiers.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String EDITOR_TEXT_HOVER_MODIFIERS = getTextHoverModifiersKey();
-
- private static String getTextHoverModifiersKey() {
- return "hoverModifiers"; //$NON-NLS-1$
- }
-
- /**
- * A named preference that defines read only contrast scale.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String READ_ONLY_FOREGROUND_SCALE = getReadOnlyForegroundScaleKey();
-
- private static String getReadOnlyForegroundScaleKey() {
- return "readOnlyForegroundScale"; //$NON-NLS-1$
- }
-
- /**
- * A named preference that defines whether or not to show a message dialog
- * informing user of unknown content type in editor.
- */
- public static final String SHOW_UNKNOWN_CONTENT_TYPE_MSG = "showUnknownContentTypeMsg"; //$NON-NLS-1$
-
- /**
- * A name preference that holds the auto activation delay time in
- * milliseconds.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public final static String CODEASSIST_AUTOACTIVATION_DELAY = "content_assist_autoactivation_delay"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the background color used in the code
- * assist selection dialog.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- *
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- */
- public final static String CODEASSIST_PROPOSALS_BACKGROUND = "content_assist_proposals_background"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the foreground color used in the code
- * assist selection dialog.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- *
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- */
- public final static String CODEASSIST_PROPOSALS_FOREGROUND = "content_assist_proposals_foreground"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the background color used for parameter
- * hints.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- *
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- */
- public final static String CODEASSIST_PARAMETERS_BACKGROUND = "content_assist_parameters_background"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the foreground color used in the code
- * assist selection dialog.
- * <p>
- * Value is of type <code>String</code>. A RGB color value encoded as a
- * string using class <code>PreferenceConverter</code>
- * </p>
- *
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- */
- public final static String CODEASSIST_PARAMETERS_FOREGROUND = "content_assist_parameters_foreground"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether semantic highlighting is turned on or off
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public final static String SEMANTIC_HIGHLIGHTING = "semanticHighlighting"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
deleted file mode 100644
index 16eb14cde7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
+++ /dev/null
@@ -1,486 +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.sse.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * An overlaying preference store. copied from JDT
- */
-public class OverlayPreferenceStore implements IPreferenceStore {
-
- public static class OverlayKey {
-
- TypeDescriptor fDescriptor;
- String fKey;
-
- public OverlayKey(TypeDescriptor descriptor, String key) {
- fDescriptor = descriptor;
- fKey = key;
- }
- }
-
- private class PropertyListener implements IPropertyChangeListener {
-
- /*
- * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- OverlayKey key = findOverlayKey(event.getProperty());
- if (key != null)
- propagateProperty(fParent, key, fStore);
- }
- }
-
-
- public static final class TypeDescriptor {
- private TypeDescriptor() {
- }
- }
-
- public static final TypeDescriptor BOOLEAN = new TypeDescriptor();
- public static final TypeDescriptor DOUBLE = new TypeDescriptor();
- public static final TypeDescriptor FLOAT = new TypeDescriptor();
- public static final TypeDescriptor INT = new TypeDescriptor();
- public static final TypeDescriptor LONG = new TypeDescriptor();
- public static final TypeDescriptor STRING = new TypeDescriptor();
- private boolean fLoaded;
- private OverlayKey[] fOverlayKeys;
-
-
- IPreferenceStore fParent;
-
- private PropertyListener fPropertyListener;
- IPreferenceStore fStore;
-
-
- public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) {
- fParent = parent;
- fOverlayKeys = overlayKeys;
- fStore = new PreferenceStore();
- }
-
- /**
- * The keys to add to the list of overlay keys.
- * <p>
- * Note: This method must be called before {@link #load()}is called.
- * </p>
- *
- * @param keys
- * @plannedfor 3.0
- */
- public void addKeys(OverlayKey[] keys) {
- Assert.isTrue(!fLoaded);
- Assert.isNotNull(keys);
-
- int overlayKeysLength = fOverlayKeys.length;
- OverlayKey[] result = new OverlayKey[keys.length + overlayKeysLength];
-
- for (int i = 0, length = overlayKeysLength; i < length; i++)
- result[i] = fOverlayKeys[i];
-
- for (int i = 0, length = keys.length; i < length; i++)
- result[overlayKeysLength + i] = keys[i];
-
- fOverlayKeys = result;
-
- if (fLoaded)
- load();
- }
-
- /*
- * @see IPreferenceStore#addPropertyChangeListener(IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- fStore.addPropertyChangeListener(listener);
- }
-
- /*
- * @see IPreferenceStore#contains(String)
- */
- public boolean contains(String name) {
- return fStore.contains(name);
- }
-
- private boolean covers(String key) {
- return (findOverlayKey(key) != null);
- }
-
- OverlayKey findOverlayKey(String key) {
- for (int i = 0; i < fOverlayKeys.length; i++) {
- if (fOverlayKeys[i].fKey.equals(key))
- return fOverlayKeys[i];
- }
- return null;
- }
-
- /*
- * @see IPreferenceStore#firePropertyChangeEvent(String, Object, Object)
- */
- public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
- fStore.firePropertyChangeEvent(name, oldValue, newValue);
- }
-
- /*
- * @see IPreferenceStore#getBoolean(String)
- */
- public boolean getBoolean(String name) {
- return fStore.getBoolean(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultBoolean(String)
- */
- public boolean getDefaultBoolean(String name) {
- return fStore.getDefaultBoolean(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultDouble(String)
- */
- public double getDefaultDouble(String name) {
- return fStore.getDefaultDouble(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultFloat(String)
- */
- public float getDefaultFloat(String name) {
- return fStore.getDefaultFloat(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultInt(String)
- */
- public int getDefaultInt(String name) {
- return fStore.getDefaultInt(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultLong(String)
- */
- public long getDefaultLong(String name) {
- return fStore.getDefaultLong(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultString(String)
- */
- public String getDefaultString(String name) {
- return fStore.getDefaultString(name);
- }
-
- /*
- * @see IPreferenceStore#getDouble(String)
- */
- public double getDouble(String name) {
- return fStore.getDouble(name);
- }
-
- /*
- * @see IPreferenceStore#getFloat(String)
- */
- public float getFloat(String name) {
- return fStore.getFloat(name);
- }
-
- /*
- * @see IPreferenceStore#getInt(String)
- */
- public int getInt(String name) {
- return fStore.getInt(name);
- }
-
- /*
- * @see IPreferenceStore#getLong(String)
- */
- public long getLong(String name) {
- return fStore.getLong(name);
- }
-
- /*
- * @see IPreferenceStore#getString(String)
- */
- public String getString(String name) {
- return fStore.getString(name);
- }
-
- /*
- * @see IPreferenceStore#isDefault(String)
- */
- public boolean isDefault(String name) {
- return fStore.isDefault(name);
- }
-
- public void load() {
- for (int i = 0; i < fOverlayKeys.length; i++)
- loadProperty(fParent, fOverlayKeys[i], fStore, true);
-
- fLoaded = true;
-
- }
-
- public void loadDefaults() {
- for (int i = 0; i < fOverlayKeys.length; i++)
- setToDefault(fOverlayKeys[i].fKey);
- }
-
- private void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target, boolean forceInitialization) {
- TypeDescriptor d = key.fDescriptor;
- if (BOOLEAN == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, true);
- target.setValue(key.fKey, orgin.getBoolean(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));
-
- } else if (DOUBLE == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1.0D);
- target.setValue(key.fKey, orgin.getDouble(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));
-
- } else if (FLOAT == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1.0F);
- target.setValue(key.fKey, orgin.getFloat(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));
-
- } else if (INT == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1);
- target.setValue(key.fKey, orgin.getInt(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));
-
- } else if (LONG == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1L);
- target.setValue(key.fKey, orgin.getLong(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));
-
- } else if (STRING == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, "1"); //$NON-NLS-1$
- target.setValue(key.fKey, orgin.getString(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));
-
- }
- }
-
- /*
- * @see IPreferenceStore#needsSaving()
- */
- public boolean needsSaving() {
- return fStore.needsSaving();
- }
-
- public void propagate() {
- for (int i = 0; i < fOverlayKeys.length; i++)
- propagateProperty(fStore, fOverlayKeys[i], fParent);
- }
-
- void propagateProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) {
-
- if (orgin.isDefault(key.fKey)) {
- if (!target.isDefault(key.fKey))
- target.setToDefault(key.fKey);
- return;
- }
-
- TypeDescriptor d = key.fDescriptor;
- if (BOOLEAN == d) {
-
- boolean originValue = orgin.getBoolean(key.fKey);
- boolean targetValue = target.getBoolean(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (DOUBLE == d) {
-
- double originValue = orgin.getDouble(key.fKey);
- double targetValue = target.getDouble(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (FLOAT == d) {
-
- float originValue = orgin.getFloat(key.fKey);
- float targetValue = target.getFloat(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (INT == d) {
-
- int originValue = orgin.getInt(key.fKey);
- int targetValue = target.getInt(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (LONG == d) {
-
- long originValue = orgin.getLong(key.fKey);
- long targetValue = target.getLong(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (STRING == d) {
-
- String originValue = orgin.getString(key.fKey);
- String targetValue = target.getString(key.fKey);
- if (targetValue != null && originValue != null && !targetValue.equals(originValue))
- target.setValue(key.fKey, originValue);
-
- }
- }
-
- /*
- * @see IPreferenceStore#putValue(String, String)
- */
- public void putValue(String name, String value) {
- if (covers(name))
- fStore.putValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#removePropertyChangeListener(IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- fStore.removePropertyChangeListener(listener);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, boolean)
- */
- public void setDefault(String name, boolean value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, double)
- */
- public void setDefault(String name, double value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, float)
- */
- public void setDefault(String name, float value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, int)
- */
- public void setDefault(String name, int value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, long)
- */
- public void setDefault(String name, long value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, String)
- */
- public void setDefault(String name, String value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setToDefault(String)
- */
- public void setToDefault(String name) {
- fStore.setToDefault(name);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, boolean)
- */
- public void setValue(String name, boolean value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, double)
- */
- public void setValue(String name, double value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, float)
- */
- public void setValue(String name, float value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, int)
- */
- public void setValue(String name, int value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, long)
- */
- public void setValue(String name, long value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, String)
- */
- public void setValue(String name, String value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- public void start() {
- if (fPropertyListener == null) {
- fPropertyListener = new PropertyListener();
- fParent.addPropertyChangeListener(fPropertyListener);
- }
- }
-
- public void stop() {
- if (fPropertyListener != null) {
- fParent.removePropertyChangeListener(fPropertyListener);
- fPropertyListener = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java
deleted file mode 100644
index b1b8903bea..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-/**
- * Copied from JDT
- *
- * @author pavery
- */
-public class TabFolderLayout extends Layout {
-
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
-
- Control[] children = composite.getChildren();
- int count = children.length;
- int maxWidth = 0, maxHeight = 0;
- for (int i = 0; i < count; i++) {
- Control child = children[i];
- Point pt = child.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
- maxWidth = Math.max(maxWidth, pt.x);
- maxHeight = Math.max(maxHeight, pt.y);
- }
-
- if (wHint != SWT.DEFAULT)
- maxWidth = wHint;
- if (hHint != SWT.DEFAULT)
- maxHeight = hHint;
-
- return new Point(maxWidth, maxHeight);
-
- }
-
- protected void layout(Composite composite, boolean flushCache) {
- Rectangle rect = composite.getClientArea();
-
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
- }
-}
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java
deleted file mode 100644
index 14e3b06a8b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-
-/**
- * @deprecated
- */
-public abstract class AbstractColorPage extends org.eclipse.jface.preference.PreferencePage implements org.eclipse.ui.IWorkbenchPreferencePage {
- protected OverlayPreferenceStore fOverlayStore;
- protected StyledTextColorPicker fPicker = null;
-
- /**
- * Creates the coloring group used in createContents This method can be
- * overwritten to set the text of the group or provide an infopop
- */
- protected Composite createColoringComposite(Composite parent) {
- Composite coloringComposite = createComposite(parent, 1);
- return coloringComposite;
- }
-
- /**
- * Creates composite control and sets the default layout data.
- */
- protected Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- // create scrollbars for this preference page when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite pageComponent = createComposite(sc1, 1);
- sc1.setContent(pageComponent);
- setSize(pageComponent);
-
- Label descLabel = createDescriptionLabel(pageComponent, SSEUIMessages.AbstractColorPageDescription); //$NON-NLS-1$
- Composite coloringComposite = createColoringComposite(pageComponent);
- createContentsForPicker(coloringComposite);
-
- GridData gd = (GridData) descLabel.getLayoutData();
- gd.widthHint = (coloringComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)).x;
- setSize(pageComponent);
- return pageComponent;
- }
-
- /**
- * Creates the StyledTextColorPicker used in createContents This method
- * can be overwritten to set up StyledTextColorPicker differently
- */
- protected void createContentsForPicker(Composite parent) {
- // create the color picker
- fPicker = new StyledTextColorPicker(parent, SWT.NULL);
- GridData data = new GridData(GridData.FILL_BOTH);
- fPicker.setLayoutData(data);
-
- fPicker.setPreferenceStore(fOverlayStore);
- setupPicker(fPicker);
-
- fPicker.setText(getSampleText());
- }
-
- /**
- * Create description label displayed at top of preference page. This
- * method/label is used instead of PreferencePage's description label
- * because the ScrolledComposite contained in this page will not fully
- * work (horizontal scrolling) with PreferencePage's description label.
- */
- protected Label createDescriptionLabel(Composite parent, String description) {
- Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
- label.setText(description);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- label.setLayoutData(data);
-
- return label;
- }
-
- /**
- * Creates composite control and sets the default layout data.
- */
-
- protected Group createGroup(Composite parent, int numColumns) {
- Group group = new Group(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- return group;
- }
-
- /**
- * Utility method that creates a label instance and sets the default
- * layout data.
- */
- protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData(GridData.FILL);
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- protected OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
- return null;
- }
-
- protected Button createPushButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- GridData data = new GridData(GridData.FILL);
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
- }
-
- /**
- * Utility method that creates a text instance and sets the default layout
- * data.
- */
- protected Text createTextField(Composite parent, String text) {
- Text textfield = new Text(parent, SWT.LEFT);
- textfield.setText(text);
- GridData data = new GridData(GridData.FILL);
- data.horizontalAlignment = GridData.FILL;
- textfield.setLayoutData(data);
- return textfield;
- }
-
- public void dispose() {
- super.dispose();
- if (fPicker != null && !fPicker.isDisposed())
- fPicker.releasePickerResources();
- if (fOverlayStore != null) {
- fOverlayStore.stop();
- }
- }
-
- public StyledTextColorPicker getPicker() {
- return fPicker;
- }
-
- public abstract String getSampleText();
-
- /**
- * Initializes this preference page for the given workbench.
- * <p>
- * This method is called automatically as the preference page is being
- * created and initialized. Clients must not call this method.
- * </p>
- *
- * @param workbench
- * the workbench
- */
- public void init(IWorkbench workbench) {
- fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
- fOverlayStore.load();
- fOverlayStore.start();
- }
-
- /**
- * Initializes states of the controls using default values in the
- * preference store.
- */
- protected void performDefaults() {
- fOverlayStore.loadDefaults();
- fPicker.refresh();
- }
-
- public boolean performOk() {
- fOverlayStore.propagate();
- savePreferences();
- return true;
- }
-
- protected void savePreferences() {
- // save plugin preferences here
- }
-
- /**
- * Sets the size of composite to the default value
- */
- protected void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-
- protected abstract void setupPicker(StyledTextColorPicker picker);
-
- public void setVisible(boolean visible) {
- boolean doShrink = false;
- // limiter, for the really huge fonts
- if (visible) {
- getPicker().refresh();
- int x = Math.min(getControl().getShell().getSize().x, getControl().getDisplay().getClientArea().width * 9 / 10);
- int y = Math.min(getControl().getShell().getSize().y, getControl().getDisplay().getClientArea().height * 9 / 10);
- boolean shrinkWidth = (x != getControl().getShell().getSize().x);
- boolean shrinkHeight = (y != getControl().getShell().getSize().y);
- doShrink = shrinkWidth || shrinkHeight;
- if (doShrink) {
- // modify just the height
- if (shrinkHeight && !shrinkWidth)
- getShell().setBounds(getShell().getLocation().x, 0, getShell().getSize().x, getControl().getDisplay().getClientArea().height);
- // modify just the width
- else if (!shrinkHeight && shrinkWidth)
- getShell().setBounds(0, getShell().getLocation().y, getControl().getDisplay().getClientArea().width, getShell().getSize().y);
- // change the entire shell size to only fill the display, and
- // move it to the origin
- else
- getShell().setBounds(0, 0, getControl().getDisplay().getClientArea().width, getControl().getDisplay().getClientArea().height);
- }
- }
- super.setVisible(visible);
- if (doShrink) {
- getControl().getShell().redraw();
- getControl().getShell().update();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
deleted file mode 100644
index 0e69c18b91..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
+++ /dev/null
@@ -1,296 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-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.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * (pa) why is this class abstract if there are no abstract methods?
- */
-public abstract class AbstractPreferencePage extends PreferencePage implements ModifyListener, SelectionListener, IWorkbenchPreferencePage {
-
- protected final static int WIDTH_VALIDATION_LOWER_LIMIT = 0; //$NON-NLS-1$
- protected final static int WIDTH_VALIDATION_UPPER_LIMIT = 999; //$NON-NLS-1$
-
- protected Button createCheckBox(Composite group, String label) {
- Button button = new Button(group, SWT.CHECK | SWT.LEFT);
- button.setText(label);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- protected void initCheckbox(Button box, String key) {
- if(box != null && key != null) {
- box.setSelection(getPreferenceStore().getBoolean(key));
- }
- }
-
- protected void defaultCheckbox(Button box, String key) {
- if(box != null && key != null) {
- box.setSelection(getPreferenceStore().getDefaultBoolean(key));
- }
- }
-
- protected 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;
- }
-
- protected Control createContents(Composite parent) {
- return createScrolledComposite(parent);
- }
-
- protected Combo createDropDownBox(Composite parent) {
- Combo comboBox = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- comboBox.setLayoutData(data);
-
- return comboBox;
- }
-
- protected Group createGroup(Composite parent, int numColumns) {
- Group group = new Group(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- return group;
- }
-
- protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- return label;
- }
-
- protected Button createRadioButton(Composite group, String label) {
- Button button = new Button(group, SWT.RADIO);
- button.setText(label);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- protected Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1, 1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- protected Label createSeparator(Composite parent, int columnSpan) {
- // Create a spacer line
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = columnSpan;
-
- separator.setLayoutData(data);
- return separator;
- }
-
- protected Text createTextField(Composite parent) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- text.setLayoutData(data);
-
- return text;
- }
-
- protected void enableValues() {
- }
-
- protected Preferences getModelPreferences() {
- return SSECorePlugin.getDefault().getPluginPreferences();
- }
-
- public void init(IWorkbench workbench) {
- }
-
- protected void initializeValues() {
- }
-
- protected boolean loadPreferences() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- initializeValues();
- validateValues();
- enableValues();
- }
- });
- return true;
- }
-
- public void modifyText(ModifyEvent e) {
- // If we are called too early, i.e. before the controls are created
- // then return
- // to avoid null pointer exceptions
- if (e.widget != null && e.widget.isDisposed())
- return;
-
- validateValues();
- enableValues();
- }
-
- protected void performDefaults() {
- super.performDefaults();
- }
-
- public boolean performOk() {
- savePreferences();
- return true;
- }
-
- protected boolean savePreferences() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- storeValues();
- }
- });
- return true;
- }
-
- protected void setInvalidInputMessage(String widthText) {
- String msg = NLS.bind(SSEUIMessages._4concat, (new Object[]{widthText}));
- setErrorMessage(msg);
- }
-
- protected void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-
- protected void storeValues() {
- SSEUIPlugin.getDefault().savePluginPreferences();
- }
-
- protected void validateValues() {
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- // If we are called too early, i.e. before the controls are created
- // then return
- // to avoid null pointer exceptions
- if (e.widget != null && e.widget.isDisposed())
- return;
-
- validateValues();
- enableValues();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java
deleted file mode 100644
index 4af18ad307..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java
+++ /dev/null
@@ -1,266 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-
-/**
- * Generic preference tab page that contains helpful methods
- *
- * @author amywu
- */
-abstract public class AbstractPreferenceTab implements IPreferenceTab {
-
- Map fCheckBoxes = new HashMap();
- private SelectionListener fCheckBoxListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
- }
- };
- private PreferencePage fMainPreferencePage;
- private ModifyListener fNumberFieldListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- numberFieldChanged((Text) e.widget);
- }
- };
- private ArrayList fNumberFields = new ArrayList();
- OverlayPreferenceStore fOverlayStore;
- private ModifyListener fTextFieldListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- Text text = (Text) e.widget;
- fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
- }
- };
- Map fTextFields = new HashMap();
-
- protected Button addCheckBox(Composite parent, String label, String key, int indentation) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText(label);
-
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent = indentation;
- gd.horizontalSpan = 2;
- checkBox.setLayoutData(gd);
- checkBox.addSelectionListener(fCheckBoxListener);
-
- fCheckBoxes.put(checkBox, key);
-
- return checkBox;
- }
-
- /**
- * Returns an array of size 2: - first element is of type
- * <code>Label</code>- second element is of type <code>Text</code>
- * Use <code>getLabelControl</code> and <code>getTextControl</code> to
- * get the 2 controls.
- */
- private Control[] addLabelledTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
- Label labelControl = new Label(composite, SWT.NONE);
- labelControl.setText(label);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent = indentation;
- labelControl.setLayoutData(gd);
-
- Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.widthHint = convertWidthInCharsToPixels(textControl, textLimit + 1);
- textControl.setLayoutData(gd);
- textControl.setTextLimit(textLimit);
- fTextFields.put(textControl, key);
- if (isNumber) {
- fNumberFields.add(textControl);
- textControl.addModifyListener(fNumberFieldListener);
- } else {
- textControl.addModifyListener(fTextFieldListener);
- }
-
- return new Control[]{labelControl, textControl};
- }
-
- protected Text addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
- return getTextControl(addLabelledTextField(composite, label, key, textLimit, indentation, isNumber));
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- */
- private void applyToStatusLine(IStatus status) {
- String message = status.getMessage();
- switch (status.getSeverity()) {
- case IStatus.OK :
- fMainPreferencePage.setMessage(message, IMessageProvider.NONE);
- fMainPreferencePage.setErrorMessage(null);
- break;
- case IStatus.WARNING :
- fMainPreferencePage.setMessage(message, IMessageProvider.WARNING);
- fMainPreferencePage.setErrorMessage(null);
- break;
- case IStatus.INFO :
- fMainPreferencePage.setMessage(message, IMessageProvider.INFORMATION);
- fMainPreferencePage.setErrorMessage(null);
- break;
- default :
- if (message.length() == 0) {
- message = null;
- }
- fMainPreferencePage.setMessage(null);
- fMainPreferencePage.setErrorMessage(message);
- break;
- }
- }
-
- /**
- * Returns the number of pixels corresponding to the width of the given
- * number of characters. This method was copied from
- * org.eclipse.jface.dialogs.DialogPage
- * <p>
- *
- * @param a
- * control in the page
- * @param chars
- * the number of characters
- * @return the number of pixels
- */
- private int convertWidthInCharsToPixels(Control testControl, int chars) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- FontMetrics fontMetrics = gc.getFontMetrics();
- gc.dispose();
-
- // test for failure to initialize for backward compatibility
- if (fontMetrics == null)
- return 0;
- return Dialog.convertWidthInCharsToPixels(fontMetrics, chars);
- }
-
- /**
- * @return Returns the fMainPreferencePage.
- */
- protected PreferencePage getMainPreferencePage() {
- return fMainPreferencePage;
- }
-
- /**
- * @return Returns the fOverlayStore.
- */
- protected OverlayPreferenceStore getOverlayStore() {
- return fOverlayStore;
- }
-
- private Text getTextControl(Control[] labelledTextField) {
- return (Text) labelledTextField[1];
- }
-
- protected void initializeFields() {
- Iterator e = fCheckBoxes.keySet().iterator();
- while (e.hasNext()) {
- Button b = (Button) e.next();
- String key = (String) fCheckBoxes.get(b);
- b.setSelection(fOverlayStore.getBoolean(key));
- }
-
- e = fTextFields.keySet().iterator();
- while (e.hasNext()) {
- Text t = (Text) e.next();
- String key = (String) fTextFields.get(t);
- t.setText(fOverlayStore.getString(key));
- }
- }
-
- void numberFieldChanged(Text textControl) {
- String number = textControl.getText();
- IStatus status = validatePositiveNumber(number);
- if (!status.matches(IStatus.ERROR))
- fOverlayStore.setValue((String) fTextFields.get(textControl), number);
- updateStatus(status);
- }
-
- /**
- * @param mainPreferencePage
- * The fMainPreferencePage to set.
- */
- protected void setMainPreferencePage(PreferencePage mainPreferencePage) {
- fMainPreferencePage = mainPreferencePage;
- }
-
- /**
- * @param overlayStore
- * The fOverlayStore to set.
- */
- protected void setOverlayStore(OverlayPreferenceStore overlayStore) {
- fOverlayStore = overlayStore;
- }
-
- /**
- * Update status of main preference page
- *
- * @param status
- */
- protected void updateStatus(IStatus status) {
- if (!status.matches(IStatus.ERROR)) {
- for (int i = 0; i < fNumberFields.size(); i++) {
- Text text = (Text) fNumberFields.get(i);
- IStatus s = validatePositiveNumber(text.getText());
- status = s.getSeverity() > status.getSeverity() ? s : status;
- }
- }
-
- fMainPreferencePage.setValid(!status.matches(IStatus.ERROR));
- applyToStatusLine(status);
- }
-
- private IStatus validatePositiveNumber(String number) {
- StatusInfo status = new StatusInfo();
- if (number.length() == 0) {
- status.setError(SSEUIMessages.StructuredTextEditorPreferencePage_37);
- } else {
- try {
- int value = Integer.parseInt(number);
- if (value < 0)
- status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
- } catch (NumberFormatException e) {
- status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
- }
- }
- return status;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractSyntaxColoringPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractSyntaxColoringPage.java
deleted file mode 100644
index ea182194f6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractSyntaxColoringPage.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-
-public abstract class AbstractSyntaxColoringPage extends PreferencePage {
-
- private Color fForegroundColor;
- private Color fBackgroundColor;
- private Color fSelectionForegroundColor;
- private Color fSelectionBackgroundColor;
-
- final private IPropertyChangeListener fListener = new IPropertyChangeListener() {
-
- public void propertyChange(PropertyChangeEvent event) {
- final String property = event.getProperty();
- if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT.equals(property)) {
- initializeSourcePreviewColors(getSourcePreviewViewer());
- }
- }
- };
-
- public AbstractSyntaxColoringPage() {
- final IPreferenceStore store = EditorsUI.getPreferenceStore();
- if (store != null) {
- store.addPropertyChangeListener(fListener);
- }
- }
-
- /**
- * Initializes the colors of the source preview window based on the values in the Editors' UI preference store
- *
- * @param viewer the {@link ISourceViewer} used as the source preview
- */
- protected void initializeSourcePreviewColors(ISourceViewer viewer) {
- final IPreferenceStore store = EditorsUI.getPreferenceStore();
- if (store != null && viewer != null) {
-
- final StyledText styledText = viewer.getTextWidget();
-
- // ----------- foreground color --------------------
- Color color = store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT) ? null : createColor(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay());
- styledText.setForeground(color);
-
- if (fForegroundColor != null)
- fForegroundColor.dispose();
-
- fForegroundColor = color;
-
- // ---------- background color ----------------------
- color = store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) ? null : createColor(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
- styledText.setBackground(color);
-
- if (fBackgroundColor != null)
- fBackgroundColor.dispose();
-
- fBackgroundColor = color;
-
- // ----------- selection foreground color --------------------
- color = store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT) ? null : createColor(store, AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay());
- styledText.setSelectionForeground(color);
-
- if (fSelectionForegroundColor != null)
- fSelectionForegroundColor.dispose();
-
- fSelectionForegroundColor = color;
-
- // ---------- selection background color ----------------------
- color = store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT) ? null : createColor(store, AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay());
- styledText.setSelectionBackground(color);
-
- if (fSelectionBackgroundColor != null)
- fSelectionBackgroundColor.dispose();
-
- fSelectionBackgroundColor = color;
- }
- }
-
- /**
- * Provides the {@link ISourceViewer} that is acting as the source preview
- * @return
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- if (fForegroundColor != null) {
- fForegroundColor.dispose();
- fForegroundColor = null;
- }
- if (fBackgroundColor != null) {
- fBackgroundColor.dispose();
- fBackgroundColor = null;
- }
- if (fSelectionForegroundColor != null) {
- fSelectionForegroundColor.dispose();
- fSelectionForegroundColor = null;
- }
- if (fSelectionBackgroundColor != null) {
- fSelectionBackgroundColor.dispose();
- fSelectionBackgroundColor = null;
- }
- if (fListener != null) {
- final IPreferenceStore store = EditorsUI.getPreferenceStore();
- if (store != null) {
- store.removePropertyChangeListener(fListener);
- }
- }
- super.dispose();
- }
-
- /**
- * Creates a color from the information stored in the given preference
- * store. Returns <code>null</code> if there is no such information
- * available.
- *
- * @param store
- * the store to read from
- * @param key
- * the key used for the lookup in the preference store
- * @param display
- * the display used create the color
- * @return the created color according to the specification in the
- * preference store
- * @since 2.0
- */
- private Color createColor(IPreferenceStore store, String key, Display display) {
-
- RGB rgb = null;
-
- if (store.contains(key)) {
-
- if (store.isDefault(key))
- rgb = PreferenceConverter.getDefaultColor(store, key);
- else
- rgb = PreferenceConverter.getColor(store, key);
-
- if (rgb != null)
- return new Color(display, rgb);
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
deleted file mode 100644
index 32fbb58198..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.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.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Based on org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock
- */
-public abstract class AbstractValidationSettingsPage extends PropertyPreferencePage {
-
- private List fCombos;
- protected 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) {
- fIndex = i;
- return;
- }
- }
-
- fIndex = -1;
- }
-
- public int getSeverity() {
- return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
- }
-
- boolean isChanged() {
- return fSeverities[fIndex] != originalSeverity;
- }
- }
-
- public 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);
- }
- }
-
- protected 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(SSEUIMessages.Validation_Title);
- /* Choose which message to use based on if its project or workspace settings */
- String msg = (getProject() == null) ? SSEUIMessages.Validation_Workspace : SSEUIMessages.Validation_Project;
- mb.setMessage(msg);
- switch(mb.open()) {
- case SWT.CANCEL:
- return false;
- case SWT.YES:
- storeValues();
- ValidateJob job = new ValidateJob(SSEUIMessages.Validation_jobName);
- job.schedule();
- case SWT.NO:
- storeValues();
- 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.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java
deleted file mode 100644
index fc1d168202..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A "button" of a certain color determined by the color picker.
- */
-public class ColorEditor {
- Button fButton;
- Color fColor;
- RGB fColorValue;
-
- private Point fExtent;
- Image fImage;
-
- public ColorEditor(Composite parent) {
-
- fButton = new Button(parent, SWT.PUSH);
- fExtent = computeImageSize(parent);
- fImage = new Image(parent.getDisplay(), fExtent.x, fExtent.y);
-
- GC gc = new GC(fImage);
- gc.setBackground(fButton.getBackground());
- gc.fillRectangle(0, 0, fExtent.x, fExtent.y);
- gc.dispose();
-
- fButton.setImage(fImage);
-
- // bug2541 - associate color value to button's value field
- fButton.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
- /**
- * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
- */
- public void getValue(AccessibleControlEvent e) {
- if (e.childID == ACC.CHILDID_SELF) {
- if (getColorValue() != null)
- e.result = getColorValue().toString();
- else
- e.result = null;
- }
- }
- });
-
- fButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- ColorDialog colorDialog = new ColorDialog(fButton.getShell());
- colorDialog.setRGB(fColorValue);
- RGB newColor = colorDialog.open();
- if (newColor != null) {
- fColorValue = newColor;
- updateColorImage();
- }
- }
- });
-
- fButton.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- if (fImage != null) {
- fImage.dispose();
- fImage = null;
- }
- if (fColor != null) {
- fColor.dispose();
- fColor = null;
- }
- }
- });
- }
-
- protected Point computeImageSize(Control window) {
- GC gc = new GC(window);
- Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
- gc.setFont(f);
- int height = gc.getFontMetrics().getHeight();
- gc.dispose();
- Point p = new Point(height * 3 - 6, height);
- return p;
- }
-
- public Button getButton() {
- return fButton;
- }
-
- public RGB getColorValue() {
- return fColorValue;
- }
-
- public void setColorValue(RGB rgb) {
- fColorValue = rgb;
- updateColorImage();
- }
-
- protected void updateColorImage() {
-
- Display display = fButton.getDisplay();
-
- GC gc = new GC(fImage);
- gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
-
- if (fColor != null)
- fColor.dispose();
-
- fColor = new Color(display, fColorValue);
- gc.setBackground(fColor);
- gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
- gc.dispose();
-
- fButton.setImage(fImage);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
deleted file mode 100644
index 684da7b995..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
+++ /dev/null
@@ -1,230 +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.wst.sse.ui.internal.preferences.ui;
-
-
-
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-public class ColorHelper {
- public final static String BACKGROUND = "background";//$NON-NLS-1$
- public final static String BOLD = "bold";//$NON-NLS-1$
- public final static String FOREGROUND = "foreground";//$NON-NLS-1$
- public final static String NAME = "name";//$NON-NLS-1$
- private final static String STYLE_SEPARATOR = "|"; //$NON-NLS-1$
- private final static String NULL = "null"; //$NON-NLS-1$
-
- /**
- * Return an RGB String given the int r, g, b values
- */
- public static String getColorString(int r, int g, int b) {
- return "#" + getHexString(r, 2) + getHexString(g, 2) + getHexString(b, 2);//$NON-NLS-1$
- }
-
- private static String getHexString(int value, int minWidth) {
- String hexString = Integer.toHexString(value);
- for (int i = hexString.length(); i < minWidth; i++) {
- hexString = "0" + hexString;//$NON-NLS-1$
- }
- return hexString;
- }
-
- /**
- * Generates a preference string to be placed in preferences from the
- * given String array.
- *
- * @param stylePrefs
- * assumes not null and should be in the form of String[0] =
- * Foreground RGB String, String[1] = Background RGB String,
- * String[2] = Bold true/false
- *
- * @return String in the form of Foreground RGB String | Background RGB
- * String | Bold true/false
- */
- public static String packStylePreferences(String[] stylePrefs) {
- StringBuffer styleString = new StringBuffer();
-
- for (int i = 0; i < stylePrefs.length; ++i) {
- String s = stylePrefs[i];
- if (i < 2) {
- if (s != null) {
- styleString.append(s);
- }
- else {
- styleString.append(NULL);
- }
- }
- else {
- styleString.append(Boolean.valueOf(s));
- }
-
- // add in the separator (except on last iteration)
- if (i < stylePrefs.length - 1) {
- styleString.append(" " + STYLE_SEPARATOR + " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- return styleString.toString();
- }
-
- /**
- * @return org.eclipse.swt.graphics.RGB
- * @param anRGBString
- * java.lang.String
- */
- public static RGB toRGB(String anRGBString) {
- RGB result = null;
- if (anRGBString.length() > 6 && anRGBString.charAt(0) == '#') {
- int r = 0;
- int g = 0;
- int b = 0;
- try {
- r = Integer.valueOf(anRGBString.substring(1, 3), 16).intValue();
- g = Integer.valueOf(anRGBString.substring(3, 5), 16).intValue();
- b = Integer.valueOf(anRGBString.substring(5, 7), 16).intValue();
- result = new RGB(r, g, b);
- } catch (NumberFormatException nfExc) {
- Logger.logException("Could not load highlighting preference for color " + anRGBString, nfExc);//$NON-NLS-1$
- }
- }
- return result;
- }
-
- /**
- * @return java.lang.String
- * @param anRGB
- * org.eclipse.swt.graphics.RGB
- */
- public static String toRGBString(RGB anRGB) {
- if (anRGB == null)
- return "#000000";//$NON-NLS-1$
- String red = Integer.toHexString(anRGB.red);
- while (red.length() < 2)
- red = "0" + red;//$NON-NLS-1$
- String green = Integer.toHexString(anRGB.green);
- while (green.length() < 2)
- green = "0" + green;//$NON-NLS-1$
- String blue = Integer.toHexString(anRGB.blue);
- while (blue.length() < 2)
- blue = "0" + blue;//$NON-NLS-1$
- return "#" + red + green + blue;//$NON-NLS-1$
- }
-
- /**
- * Extracts the foreground (RGB String), background (RGB String), bold
- * (boolean String) from the given preference string.
- *
- * @param preference
- * should be in the form of Foreground RGB String | Background
- * RGB String | Bold true/false | Italic true/false | Strikethrough true/false | Underline true/false
- * @return String[] where String[0] = Foreground RGB String, String[1] =
- * Background RGB String, String[2] = Bold true/false, 3 = Italic
- * true/false, 4 = Strikethrough true/false, 5 = Underline
- * true/false; indexes 2-4 may be null if we ran into problems
- * extracting
- */
- public static String[] unpackStylePreferences(String preference) {
- String[] stylePrefs = new String[6];
- if (preference != null) {
- StringTokenizer st = new StringTokenizer(preference, STYLE_SEPARATOR);
- if (st.hasMoreTokens()) {
- String foreground = st.nextToken().trim();
- stylePrefs[0] = foreground;
- }
- else {
- stylePrefs[0] = NULL;
- }
- if (st.hasMoreTokens()) {
- String background = st.nextToken().trim();
- stylePrefs[1] = background;
- }
- else {
- stylePrefs[1] = NULL;
- }
-
- if (st.hasMoreTokens()) {
- String bold = st.nextToken().trim();
- stylePrefs[2] = Boolean.valueOf(bold).toString();
- }
- else {
- stylePrefs[2] = Boolean.FALSE.toString();
- }
- if (st.hasMoreTokens()) {
- String italic = st.nextToken().trim();
- stylePrefs[3] = Boolean.valueOf(italic).toString();
- }
- else {
- stylePrefs[3] = Boolean.FALSE.toString();
- }
- if (st.hasMoreTokens()) {
- String strikethrough = st.nextToken().trim();
- stylePrefs[4] = Boolean.valueOf(strikethrough).toString();
- }
- else {
- stylePrefs[4] = Boolean.FALSE.toString();
- }
- if (st.hasMoreTokens()) {
- String underline = st.nextToken().trim();
- stylePrefs[5] = Boolean.valueOf(underline).toString();
- }
- else {
- stylePrefs[5] = Boolean.FALSE.toString();
- }
- }
-
- return stylePrefs;
- }
-
- /**
- * Attempts to lookup the RGB value for <code>key</code> from the color
- * registry. If one is not found, the <code>defaultRGB</code> is used.
- * @param registry The ColorRegistry to search for the RGB value
- * @param key The key that the RGB value is stored under in the registry
- * @param defaultRGB The default RGB value to return in the absence of one
- * from the color registry
- *
- * @return The RGB value from the color registry for a given key, if it exists.
- * Otherwise, return the default RGB value.
- */
- public static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) {
- if(registry.hasValueFor(key))
- return registry.getRGB(key);
- return defaultRGB;
- }
-
- /**
- * Attempts to find the RGB string for <code>key</code> from the color registry.
- * If one is not found, an RGB string is generated from the parameters <code>r,g,b</code>.
- *
- * @param registry The ColorRegistry to search for the RGB value
- * @param key The key that the RGB value is stored under in the registry
- * @param r The default red value
- * @param g The default green value
- * @param b The default blue value
- *
- * @return The String RGB value from the color registry for a given key, if it exists.
- * Otherwise, return the string RGB value created from the default r,g,b parameters.
- *
- */
- public static String findRGBString(ColorRegistry registry, String key, int r, int g, int b) {
- if(registry.hasValueFor(key))
- return toRGBString(registry.getRGB(key));
- return getColorString(r, g, b);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java
deleted file mode 100644
index 2d0c99344b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal.preferences.ui;
-
-
-
-public interface ColorNames {
- String BACKGROUND = "background"; //$NON-NLS-1$
- String BOLD = "bold"; //$NON-NLS-1$
- String COLOR = "color"; //$NON-NLS-1$
-
- String COLORS = "colors"; //$NON-NLS-1$
- String FOREGROUND = "foreground"; //$NON-NLS-1$
- String ITALIC = "italic"; //$NON-NLS-1$
-
- String NAME = "name"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java
deleted file mode 100644
index 6536e9a5d9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java
+++ /dev/null
@@ -1,100 +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.wst.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public class EmptyFilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private Composite createComposite(Composite parent, int numColumns) {
- noDefaultAndApplyButton();
-
- 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;
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createScrolledComposite(parent);
-
- String description = SSEUIMessages.EmptyFilePreferencePage_0; //$NON-NLS-1$
- Text text = new Text(composite, SWT.READ_ONLY);
- // some themes on GTK have different background colors for Text and Labels
- text.setBackground(composite.getBackground());
- text.setText(description);
-
- setSize(composite);
- return composite;
- }
-
- private Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1, 1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- public void init(IWorkbench workbench) {
- }
-
- private void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java
deleted file mode 100644
index 6c86535850..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java
+++ /dev/null
@@ -1,132 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-
-public class FilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private IPreferenceTab[] fTabs = null;
-
- protected 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_VERTICAL;
- data.horizontalAlignment = GridData.FILL_HORIZONTAL;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createComposite(parent, 1);
-
- String description = SSEUIMessages.FilePreferencePage_0; //$NON-NLS-1$
- createLabel(composite, description);
- createLabel(composite, ""); //$NON-NLS-1$
-
- TabFolder folder = new TabFolder(composite, SWT.NONE);
- folder.setLayout(new TabFolderLayout());
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-// TabItem taskItem = new TabItem(folder, SWT.NONE);
-// IPreferenceTab tasksTab = new TaskTagPreferenceTab();
-// taskItem.setText(tasksTab.getTitle());
-// Control taskTags = tasksTab.createContents(folder);
-// taskItem.setControl(taskTags);
-
- TabItem translucenceItem = new TabItem(folder, SWT.NONE);
- IPreferenceTab translucenceTab = new TranslucencyPreferenceTab(this);
- translucenceItem.setText(translucenceTab.getTitle());
- Control translucenceControl = translucenceTab.createContents(folder);
- translucenceItem.setControl(translucenceControl);
-
- fTabs = new IPreferenceTab[]{/*tasksTab,*/ translucenceTab};
-
- return composite;
- }
-
- protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
- label.setLayoutData(data);
-
- return label;
- }
-
- public void init(IWorkbench desktop) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performApply()
- */
- protected void performApply() {
- super.performApply();
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performApply();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performDefaults();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performOk();
- }
- SSECorePlugin.getDefault().savePluginPreferences();
- return ok;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java
deleted file mode 100644
index 2ccb563c9d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java
+++ /dev/null
@@ -1,29 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public interface IPreferenceTab {
-
- Control createContents(Composite tabFolder);
-
- String getTitle();
-
- void performApply();
-
- void performDefaults();
-
- void performOk();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ScrolledPageContent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ScrolledPageContent.java
deleted file mode 100644
index e1f9c43514..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ScrolledPageContent.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-public class ScrolledPageContent extends SharedScrolledComposite {
-
- private FormToolkit fToolkit;
-
- public ScrolledPageContent(Composite parent) {
- this(parent, SWT.V_SCROLL | SWT.H_SCROLL);
- }
-
- public ScrolledPageContent(Composite parent, int style) {
- super(parent, style);
-
- setExpandHorizontal(true);
- setExpandVertical(true);
-
- fToolkit = SSEUIPlugin.getInstance().getDialogsFormToolkit();
-
- Composite body= new Composite(this, SWT.NONE);
- body.setFont(parent.getFont());
- setContent(body);
- }
-
- public void adaptChild(Control childControl) {
- fToolkit.adapt(childControl, true, true);
- }
-
- public Composite getBody() {
- return (Composite) getContent();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
deleted file mode 100644
index c783131970..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
+++ /dev/null
@@ -1,202 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ui.editors.text.EditorsUI;
-
-/**
- * A settable IStatus. Can be an error, warning, info or ok. For error, info
- * and warning states, a message describes the problem.
- *
- * This class was copied from other StatusInfo classes that are located in
- * internal packages
- */
-class StatusInfo implements IStatus {
- /** The severity of this status. */
- private int fSeverity;
-
- /** The message of this status. */
- private String fStatusMessage;
-
- /**
- * Creates a status set to OK (no message).
- */
- public StatusInfo() {
- this(OK, null);
- }
-
- /**
- * Creates a status with the given severity and message.
- *
- * @param severity
- * the severity of this status: ERROR, WARNING, INFO and OK.
- * @param message
- * the message of this status. Applies only for ERROR, WARNING
- * and INFO.
- */
- public StatusInfo(int severity, String message) {
- fStatusMessage = message;
- fSeverity = severity;
- }
-
- /**
- * Returns always <code>null</code>.
- *
- * @see IStatus#getChildren()
- */
- public IStatus[] getChildren() {
- return new IStatus[0];
- }
-
- /**
- * Returns always the error severity.
- *
- * @see IStatus#getCode()
- */
- public int getCode() {
- return fSeverity;
- }
-
- /**
- * Returns always <code>null</code>.
- *
- * @see IStatus#getException()
- */
- public Throwable getException() {
- return null;
- }
-
- /*
- * @see IStatus#getMessage()
- */
- public String getMessage() {
- return fStatusMessage;
- }
-
- /*
- * @see IStatus#getPlugin()
- */
- public String getPlugin() {
- return EditorsUI.PLUGIN_ID;
- }
-
- /*
- * @see IStatus#getSeverity()
- */
- public int getSeverity() {
- return fSeverity;
- }
-
- /**
- * Returns whether this status indicates an error.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#ERROR}and <code>false</code> otherwise
- */
- public boolean isError() {
- return fSeverity == IStatus.ERROR;
- }
-
- /**
- * Returns whether this status indicates an info.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#INFO}and <code>false</code> otherwise
- */
- public boolean isInfo() {
- return fSeverity == IStatus.INFO;
- }
-
- /**
- * Returns always <code>false</code>.
- *
- * @see IStatus#isMultiStatus()
- */
- public boolean isMultiStatus() {
- return false;
- }
-
- /*
- * @see org.eclipse.core.runtime.IStatus#isOK()
- */
- public boolean isOK() {
- return fSeverity == IStatus.OK;
- }
-
- /**
- * Returns whether this status indicates a warning.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#WARNING}and <code>false</code> otherwise
- */
- public boolean isWarning() {
- return fSeverity == IStatus.WARNING;
- }
-
- /*
- * @see IStatus#matches(int)
- */
- public boolean matches(int severityMask) {
- return (fSeverity & severityMask) != 0;
- }
-
- /**
- * Sets the status to ERROR.
- *
- * @param errorMessage
- * the error message which can be an empty string, but not
- * <code>null</code>
- */
- public void setError(String errorMessage) {
- Assert.isNotNull(errorMessage);
- fStatusMessage = errorMessage;
- fSeverity = IStatus.ERROR;
- }
-
- /**
- * Sets the status to INFO.
- *
- * @param infoMessage
- * the info message which can be an empty string, but not
- * <code>null</code>
- */
- public void setInfo(String infoMessage) {
- Assert.isNotNull(infoMessage);
- fStatusMessage = infoMessage;
- fSeverity = IStatus.INFO;
- }
-
- /**
- * Sets the status to OK.
- */
- public void setOK() {
- fStatusMessage = null;
- fSeverity = IStatus.OK;
- }
-
- /**
- * Sets the status to WARNING.
- *
- * @param warningMessage
- * the warning message which can be an empty string, but not
- * <code>null</code>
- */
- public void setWarning(String warningMessage) {
- Assert.isNotNull(warningMessage);
- fStatusMessage = warningMessage;
- fSeverity = IStatus.WARNING;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
deleted file mode 100644
index dd9ee295ea..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.preference.PreferencePage;
-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.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.List;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-
-/**
- * Gutted version of JavaEditorPreferencePage
- *
- * @author pavery
- */
-public class StructuredTextEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- private ColorEditor fAppearanceColorEditor;
- private List fAppearanceColorList;
-
- private final String[][] fAppearanceColorListModel = new String[][]{{SSEUIMessages.StructuredTextEditorPreferencePage_2, EditorPreferenceNames.MATCHING_BRACKETS_COLOR}, {SSEUIMessages.StructuredTextEditorPreferencePage_41, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND}, {SSEUIMessages.StructuredTextEditorPreferencePage_42, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND}, {SSEUIMessages.StructuredTextEditorPreferencePage_43, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND}, {SSEUIMessages.StructuredTextEditorPreferencePage_44, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND}}; //$NON-NLS-1$
- private Map fCheckBoxes = new HashMap();
- private SelectionListener fCheckBoxListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
- }
- };
-
- private Map fColorButtons = new HashMap();
-
- private ArrayList fNumberFields = new ArrayList();
- private OverlayPreferenceStore fOverlayStore;
- /** Button controlling default setting of the selected reference provider. */
- // TODO: private field never read locally
- Button fSetDefaultButton;
- private IPreferenceTab[] fTabs = null;
- private Map fTextFields = new HashMap();
-
- public StructuredTextEditorPreferencePage() {
- setDescription(SSEUIMessages.StructuredTextEditorPreferencePage_6); //$NON-NLS-1$
- setPreferenceStore(SSEUIPlugin.getDefault().getPreferenceStore());
-
- fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
- }
-
- private Button addCheckBox(Composite parent, String label, String key, int indentation) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText(label);
-
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent = indentation;
- gd.horizontalSpan = 2;
- checkBox.setLayoutData(gd);
- checkBox.addSelectionListener(fCheckBoxListener);
-
- fCheckBoxes.put(checkBox, key);
-
- return checkBox;
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- */
- public void applyToStatusLine(DialogPage page, IStatus status) {
- String message = status.getMessage();
- switch (status.getSeverity()) {
- case IStatus.OK :
- page.setMessage(message, IMessageProvider.NONE);
- page.setErrorMessage(null);
- break;
- case IStatus.WARNING :
- page.setMessage(message, IMessageProvider.WARNING);
- page.setErrorMessage(null);
- break;
- case IStatus.INFO :
- page.setMessage(message, IMessageProvider.INFORMATION);
- page.setErrorMessage(null);
- break;
- default :
- if (message.length() == 0) {
- message = null;
- }
- page.setMessage(null);
- page.setErrorMessage(message);
- break;
- }
- }
-
- private Control createAppearancePage(Composite parent) {
- Composite appearanceComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- appearanceComposite.setLayout(layout);
-
- String label = SSEUIMessages.StructuredTextEditorPreferencePage_20; //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, EditorPreferenceNames.MATCHING_BRACKETS, 0);
-
- label = SSEUIMessages.StructuredTextEditorPreferencePage_30; //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, 0);
-
- PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(appearanceComposite, SWT.NONE, "ValidationPreferencePage", SSEUIMessages.StructuredTextEditorPreferencePage_40, (IWorkbenchPreferenceContainer) getContainer(), null); //$NON-NLS-1$
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- data.horizontalIndent = 20;
- contentTypeArea.getControl().setLayoutData(data);
-
- label = SSEUIMessages.StructuredTextEditorPreferencePage_39;
- addCheckBox(appearanceComposite, label, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, 0);
-
- label = SSEUIMessages.StructuredTextEditorPreferencePage_3;
- addCheckBox(appearanceComposite, label, AbstractStructuredFoldingStrategy.FOLDING_ENABLED, 0);
-
- label = SSEUIMessages.StructuredTextEditorPreferencePage_1;
- addCheckBox(appearanceComposite, label, EditorPreferenceNames.SEMANTIC_HIGHLIGHTING, 0);
-
- Label l = new Label(appearanceComposite, SWT.LEFT);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- gd.heightHint = convertHeightInCharsToPixels(1) / 2;
- l.setLayoutData(gd);
-
- l = new Label(appearanceComposite, SWT.LEFT);
- l.setText(SSEUIMessages.StructuredTextEditorPreferencePage_23); //$NON-NLS-1$
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- l.setLayoutData(gd);
-
- Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- editorComposite.setLayout(layout);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- gd.horizontalSpan = 2;
- editorComposite.setLayoutData(gd);
-
- fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- gd.heightHint = convertHeightInCharsToPixels(7);
- fAppearanceColorList.setLayoutData(gd);
-
- Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 2;
- stylesComposite.setLayout(layout);
- stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- l = new Label(stylesComposite, SWT.LEFT);
- // needs to be made final so label can be set in
- // foregroundcolorbutton's acc listener
- final String buttonLabel = SSEUIMessages.StructuredTextEditorPreferencePage_24; //$NON-NLS-1$
- l.setText(buttonLabel);
- gd = new GridData();
- gd.horizontalAlignment = GridData.BEGINNING;
- l.setLayoutData(gd);
-
- fAppearanceColorEditor = new ColorEditor(stylesComposite);
- Button foregroundColorButton = fAppearanceColorEditor.getButton();
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment = GridData.BEGINNING;
- foregroundColorButton.setLayoutData(gd);
-
- fAppearanceColorList.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- handleAppearanceColorListSelection();
- }
- });
- foregroundColorButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i = fAppearanceColorList.getSelectionIndex();
- String key = fAppearanceColorListModel[i][1];
-
- PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue());
- }
- });
-
- // bug2541 - associate color label to button's label field
- foregroundColorButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- if (e.childID == ACC.CHILDID_SELF)
- e.result = buttonLabel;
- }
- });
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(appearanceComposite, IHelpContextIds.PREFSTE_APPEARANCE_HELPID);
- return appearanceComposite;
- }
-
- /*
- * @see PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- // need to create tabs before loading/starting overlaystore in case
- // tabs also add values
- IPreferenceTab hoversTab = new TextHoverPreferenceTab(this, fOverlayStore);
-
- fOverlayStore.load();
- fOverlayStore.start();
-
- TabFolder folder = new TabFolder(parent, SWT.NONE);
- folder.setLayout(new TabFolderLayout());
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- TabItem item = new TabItem(folder, SWT.NONE);
- item.setText(SSEUIMessages.StructuredTextEditorPreferencePage_0); //$NON-NLS-1$
- item.setControl(createAppearancePage(folder));
-
- item = new TabItem(folder, SWT.NONE);
- item.setText(hoversTab.getTitle());
- item.setControl(hoversTab.createContents(folder));
-
- fTabs = new IPreferenceTab[]{hoversTab};
-
- initialize();
-
- Dialog.applyDialogFont(folder);
- return folder;
- }
-
- /*
- * @see PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- // WorkbenchHelp.setHelp(getControl(),
- // IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
- }
-
- private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.MATCHING_BRACKETS_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.MATCHING_BRACKETS));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractStructuredFoldingStrategy.FOLDING_ENABLED));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SEMANTIC_HIGHLIGHTING));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND));
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- /*
- * @see DialogPage#dispose()
- */
- public void dispose() {
- if (fOverlayStore != null) {
- fOverlayStore.stop();
- fOverlayStore = null;
- }
-
- super.dispose();
- }
-
- private void handleAppearanceColorListSelection() {
- int i = fAppearanceColorList.getSelectionIndex();
- String key = fAppearanceColorListModel[i][1];
- RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
- fAppearanceColorEditor.setColorValue(rgb);
- }
-
- /*
- * @see IWorkbenchPreferencePage#init()
- */
- public void init(IWorkbench workbench) {
- // nothing to do
- }
-
- private void initialize() {
- initializeFields();
-
- for (int i = 0; i < fAppearanceColorListModel.length; i++)
- fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
- fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
- fAppearanceColorList.select(0);
- handleAppearanceColorListSelection();
- }
- }
- });
- }
-
- private void initializeFields() {
- Iterator e = fColorButtons.keySet().iterator();
- while (e.hasNext()) {
- ColorEditor c = (ColorEditor) e.next();
- String key = (String) fColorButtons.get(c);
- RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
- c.setColorValue(rgb);
- }
-
- e = fCheckBoxes.keySet().iterator();
- while (e.hasNext()) {
- Button b = (Button) e.next();
- String key = (String) fCheckBoxes.get(b);
- b.setSelection(fOverlayStore.getBoolean(key));
- }
-
- e = fTextFields.keySet().iterator();
- while (e.hasNext()) {
- Text t = (Text) e.next();
- String key = (String) fTextFields.get(t);
- t.setText(fOverlayStore.getString(key));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performApply()
- */
- protected void performApply() {
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performApply();
- }
- super.performApply();
- }
-
- /*
- * @see PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- fOverlayStore.loadDefaults();
-
- initializeFields();
-
- handleAppearanceColorListSelection();
-
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performDefaults();
- }
-
- super.performDefaults();
-
- // there is currently no need for a viewer
- // fPreviewViewer.invalidateTextPresentation();
- }
-
- /*
- * @see PreferencePage#performOk()
- */
- public boolean performOk() {
- for (int i = 0; i < fTabs.length; i++) {
- fTabs[i].performOk();
- }
-
- fOverlayStore.propagate();
- SSEUIPlugin.getDefault().savePluginPreferences();
-
- // tab width is also a model-side preference so need to set it
- // TODO need to handle tab width for formatter somehow
- // int tabWidth =
- // getPreferenceStore().getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
- // ModelPlugin.getDefault().getPluginPreferences().setValue(CommonModelPreferenceNames.TAB_WIDTH,
- // tabWidth);
- // ModelPlugin.getDefault().savePluginPreferences();
-
- return true;
- }
-
- void updateStatus(IStatus status) {
- if (!status.matches(IStatus.ERROR)) {
- for (int i = 0; i < fNumberFields.size(); i++) {
- Text text = (Text) fNumberFields.get(i);
- IStatus s = validatePositiveNumber(text.getText());
- status = s.getSeverity() > status.getSeverity() ? s : status;
- }
- }
-
- setValid(!status.matches(IStatus.ERROR));
- applyToStatusLine(this, status);
- }
-
- private IStatus validatePositiveNumber(String number) {
- StatusInfo status = new StatusInfo();
- if (number.length() == 0) {
- status.setError(SSEUIMessages.StructuredTextEditorPreferencePage_37);
- }
- else {
- try {
- int value = Integer.parseInt(number);
- if (value < 0)
- status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
- }
- catch (NumberFormatException e) {
- status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
- }
- }
- return status;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
deleted file mode 100644
index e69bf0d4db..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
+++ /dev/null
@@ -1,905 +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.sse.ui.internal.preferences.ui;
-
-import java.io.CharArrayReader;
-import java.util.Dictionary;
-import java.util.List;
-
-import org.eclipse.jface.preference.ColorSelector;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleControlListener;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-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.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.Font;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-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;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.w3c.dom.Node;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * This class is configurable by setting 3 properties: 1) an array of Strings
- * as the styleNames; one unique entry for every style type meant to be
- * configurable by the user 2) a Dictionary of descriptions, mapping the
- * styleNames to unique descriptions - meant for use within the selection
- * ComboBox TODO (pa) this should probably be working off document partitions
- * now (2.1+) 3) a Dictionary mapping parsed ITextRegion contexts (strings) to
- * the locally defined styleNames
- *
- */
-public class StyledTextColorPicker extends Composite {
- protected class DescriptionSorter extends org.eclipse.wst.sse.ui.internal.util.Sorter {
- Collator collator = Collator.getInstance();
-
- public boolean compare(Object elementOne, Object elementTwo) {
- /**
- * Returns true if elementTwo is 'greater than' elementOne This is
- * the 'ordering' method of the sort operation. Each subclass
- * overides this method with the particular implementation of the
- * 'greater than' concept for the objects being sorted.
- */
- return (collator.compare(elementOne.toString(), elementTwo.toString())) < 0;
- }
- }
-
- public static final String BACKGROUND = "background"; //$NON-NLS-1$
- public static final String BOLD = "bold"; //$NON-NLS-1$
- public static final String COLOR = "color"; //$NON-NLS-1$
-
- // names for preference elements ... non-NLS
- public static final String FOREGROUND = "foreground"; //$NON-NLS-1$
- public static final String ITALIC = "italic"; //$NON-NLS-1$
- public static final String NAME = "name"; //$NON-NLS-1$
-
- protected static final boolean showItalic = false;
- protected AccessibleControlListener backgroundAccListener = new AccessibleControlAdapter() {
- /**
- * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
- */
- public void getValue(AccessibleControlEvent e) {
- if (e.childID == ACC.CHILDID_SELF) {
- e.result = fBackground.getColorValue().toString();
- }
- }
- };
- protected SelectionListener buttonListener = new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- String namedStyle = getStyleName(fStyleCombo.getItem(fStyleCombo.getSelectionIndex()));
- if (namedStyle == null)
- return;
- if (e.widget == fBold) {
- // get current (newly old) style
- String prefString = getPreferenceStore().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);
- getPreferenceStore().setValue(namedStyle, newPrefString);
- refresh();
- }
- }
- } else if (showItalic && e.widget == fItalic) {
- // get current (newly old) style
- String prefString = getPreferenceStore().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);
- getPreferenceStore().setValue(namedStyle, newPrefString);
- refresh();
- }
- }
- } else if (e.widget == fClearStyle) {
- getPreferenceStore().setToDefault(namedStyle);
- refresh();
- }
- }
- };
-
- protected SelectionListener comboListener = new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- int selectedIndex = fStyleCombo.getSelectionIndex();
- String description = selectedIndex >= 0 ? fStyleCombo.getItem(selectedIndex) : null;
- activate(getStyleName(description));
- }
- };
- protected ColorSelector fBackground;
- protected Label fBackgroundLabel;
- protected Button fBold;
- protected Button fClearStyle;
- // Dictionary mapping the ITextRegion types above to color names, which
- // are, in turn, attributes
- protected Dictionary fContextStyleMap = null;
- protected Color fDefaultBackground = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-
- protected Color fDefaultForeground = getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- // Dictionary mapping the ITextRegion types above to display strings, for
- // use in the combo box
- protected Dictionary fDescriptions = null;
- protected ColorSelector fForeground;
- protected Label fForegroundLabel;
-// private String fGeneratorKey;
- protected String fInput = ""; //$NON-NLS-1$
- protected Button fItalic;
-
- private IStructuredDocumentRegion fNodes = null;
- // defect 200764 - ACC:display values for color buttons
- protected AccessibleControlListener foregroundAccListener = new AccessibleControlAdapter() {
- /**
- * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
- */
- public void getValue(AccessibleControlEvent e) {
- if (e.childID == ACC.CHILDID_SELF) {
- e.result = fForeground.getColorValue().toString();
- }
- }
- };
- // A RegionParser, which will turn the input into
- // IStructuredDocumentRegion(s) and Regions
- protected RegionParser fParser = null;
-
- private IPreferenceStore fPreferenceStore;
- protected Combo fStyleCombo = null;
- // The list of supported ITextRegion types [Strings]
- protected List fStyleList = null;
-
- // controls in picker
- protected StyledText fText = null;
-
- /**
- * XMLTextColorPicker constructor comment.
- *
- * @param parent
- * org.eclipse.swt.widgets.Composite
- * @param style
- * int
- */
- public StyledTextColorPicker(Composite parent, int style) {
- super(parent, style);
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- setLayout(layout);
- createControls(this);
- }
-
- // activate controls based on the given local color type
- protected void activate(String namedStyle) {
- if (namedStyle == null) {
- fForeground.setEnabled(false);
- fBackground.setEnabled(false);
- fClearStyle.setEnabled(false);
- fBold.setEnabled(false);
- if (showItalic)
- fItalic.setEnabled(false);
- fForegroundLabel.setEnabled(false);
- fBackgroundLabel.setEnabled(false);
- }
- else {
- fForeground.setEnabled(true);
- fBackground.setEnabled(true);
- fClearStyle.setEnabled(true);
- fBold.setEnabled(true);
- if (showItalic)
- fItalic.setEnabled(true);
- fForegroundLabel.setEnabled(true);
- fBackgroundLabel.setEnabled(true);
-
- }
- TextAttribute attribute = getAttribute(namedStyle);
- Color color = attribute.getForeground();
- if (color == null) {
- color = fDefaultForeground;
- }
- fForeground.setColorValue(color.getRGB());
-
- color = attribute.getBackground();
- if (color == null) {
- color = fDefaultBackground;
- }
- fBackground.setColorValue(color.getRGB());
-
- fBold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
- if (showItalic)
- fItalic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
- }
-
- protected void applyStyles() {
- if (fText == null || fText.isDisposed() || fInput == null || fInput.length() == 0)
- return;
- // List regions = fParser.getRegions();
- IStructuredDocumentRegion node = fNodes;
- while (node != null) {
- ITextRegionList regions = node.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) getContextStyleMap().get(currentRegion.getType());
- if (namedStyle == null)
- continue;
- TextAttribute attribute = getAttribute(namedStyle);
- if (attribute == null)
- continue;
- StyleRange style = new StyleRange(node.getStartOffset(currentRegion), currentRegion.getLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
- fText.setStyleRange(style);
- }
- node = node.getNext();
- }
- }
-
- protected void close() {
- }
-
- /**
- * Creates an new checkbox instance and sets the default layout data.
- *
- * @param group
- * the composite in which to create the checkbox
- * @param label
- * the string to set into the checkbox
- * @return the new checkbox
- */
- private Button createCheckBox(Composite group, String label) {
- Button button = new Button(group, SWT.CHECK | SWT.CENTER);
- if (label != null)
- button.setText(label);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
- // data.verticalAlignment = GridData.VERTICAL_ALIGN_FILL;
- button.setLayoutData(data);
- return button;
- }
-
- private Combo createCombo(Composite parent, String[] labels, int selectedItem) {
- Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(labels);
- if (selectedItem >= 0)
- combo.select(selectedItem);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
- combo.setLayoutData(data);
- return combo;
- }
-
- /**
- * 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.horizontalSpacing = 5;
- layout.makeColumnsEqualWidth = false;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData(GridData.FILL_VERTICAL);
- data.grabExcessVerticalSpace = false;
- data.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
- composite.setLayoutData(data);
- return composite;
- }
-
- protected void createControls(Composite parent) {
- Composite styleRow = createComposite(parent, 3);
- // row 1 - content type label, combo box, restore defaults
- createLabel(styleRow, SSEUIMessages.Content_type__UI_); //$NON-NLS-1$ = "Content type:"
- // Contexts combo box
- fStyleCombo = createCombo(styleRow, new String[0], -1);
- fClearStyle = createPushButton(styleRow, SSEUIMessages.Restore_Default_UI_); //$NON-NLS-1$ = "Restore Default"
- Composite styleRow2;
- if (showItalic)
- styleRow2 = createComposite(parent, 7);
- else
- styleRow2 = createComposite(parent, 6);
- // row 2 - foreground label, button, background label, button, bold,
- // italics?
- fForegroundLabel = createLabel(styleRow2, SSEUIMessages.Foreground_UI_); //$NON-NLS-1$ = "Foreground"
- fForeground = new ColorSelector(styleRow2);
- fForeground.getButton().setLayoutData(new GridData());
- setAccessible(fForeground.getButton(), fForegroundLabel.getText());
- fForeground.getButton().getAccessible().addAccessibleControlListener(foregroundAccListener); // defect
- // 200764
- // -
- // ACC:display
- // values
- // for
- // color
- // buttons
- ((GridData) fForeground.getButton().getLayoutData()).minimumWidth = 20;
- fBackgroundLabel = createLabel(styleRow2, SSEUIMessages.Background_UI_); //$NON-NLS-1$ = "Background"
- fBackground = new ColorSelector(styleRow2);
- fBackground.getButton().setLayoutData(new GridData());
- setAccessible(fBackground.getButton(), fBackgroundLabel.getText());
- fBackground.getButton().getAccessible().addAccessibleControlListener(backgroundAccListener); // defect
- // 200764
- // -
- // ACC:display
- // values
- // for
- // color
- // buttons
- ((GridData) fBackground.getButton().getLayoutData()).minimumWidth = 20;
- createLabel(styleRow2, ""); //$NON-NLS-1$
- fBold = createCheckBox(styleRow2, SSEUIMessages.Bold_UI_);
- if (showItalic)
- fItalic = createCheckBox(styleRow2, SSEUIMessages.Italics_UI);
- // // Defaults checkbox
- fForeground.setEnabled(false);
- fBackground.setEnabled(false);
- fClearStyle.setEnabled(false);
- fBold.setEnabled(false);
- if (showItalic)
- fItalic.setEnabled(false);
- fForegroundLabel.setEnabled(false);
- fBackgroundLabel.setEnabled(false);
- Composite sample = createComposite(parent, 1);
- createLabel(sample, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
- // BUG141089 - make sure text is left-aligned
- fText = new StyledText(sample, SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.READ_ONLY);
- GridData data = new GridData(GridData.FILL_BOTH);
- fText.setLayoutData(data);
- fText.setEditable(false);
- fText.setBackground(fDefaultBackground);
- fText.setFont(JFaceResources.getTextFont());
- fText.addKeyListener(getTextKeyListener());
- fText.addSelectionListener(getTextSelectionListener());
- fText.addMouseListener(getTextMouseListener());
- fText.addTraverseListener(getTraverseListener()); // defect 220377 -
- // Provide tab
- // traversal for
- // fText widget
- setAccessible(fText, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
- fForeground.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- // get current (newly old) style
- String namedStyle = getStyleName(fStyleCombo.getItem(fStyleCombo.getSelectionIndex()));
- String prefString = getPreferenceStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[0];
- String newValue = "null"; //$NON-NLS-1$
- Object newValueObject = event.getNewValue();
- if (newValueObject instanceof RGB) {
- newValue = ColorHelper.toRGBString((RGB)newValueObject);
- }
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[0] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getPreferenceStore().setValue(namedStyle, newPrefString);
- refresh();
- }
- }
- }
- }
- });
- fBackground.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- // get current (newly old) style
- String namedStyle = getStyleName(fStyleCombo.getItem(fStyleCombo.getSelectionIndex()));
- String prefString = getPreferenceStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[1];
-
- String newValue = "null"; //$NON-NLS-1$
- Object newValueObject = event.getNewValue();
- if (newValueObject instanceof RGB) {
- newValue = ColorHelper.toRGBString((RGB)newValueObject);
- }
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[1] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getPreferenceStore().setValue(namedStyle, newPrefString);
- refresh();
- }
- }
- }
- }
- });
-
- fClearStyle.addSelectionListener(buttonListener);
- fBold.addSelectionListener(buttonListener);
- if (showItalic)
- fItalic.addSelectionListener(buttonListener);
- fStyleCombo.addSelectionListener(comboListener);
- }
-
- /**
- * Utility method that creates a label instance and sets the default
- * layout data.
- */
- private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- private Button createPushButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- GridData data = new GridData(GridData.FILL_BOTH);
- // data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
- }
-
- protected TextAttribute getAttribute(String namedStyle) {
- TextAttribute ta = new TextAttribute(getDefaultForeground(), getDefaultBackground(), SWT.NORMAL);
-
- if (namedStyle != null && getPreferenceStore() != null) {
- String prefString = getPreferenceStore().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;
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- if (bold)
- fontModifier = fontModifier | SWT.BOLD;
-
- if (showItalic) {
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- if (italic)
- fontModifier = fontModifier | SWT.ITALIC;
- }
-
- ta = new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, fontModifier);
- }
- }
- return ta;
- }
-
- // defect 200764 - ACC:display values for color buttons
- /**
- * @return String - color Button b's current RBG value
- */
-// private String getColorButtonValue(Button b) {
-// if ((b == null) || (b.getImage() == null) || (b.getImage().getImageData() == null) || (b.getImage().getImageData().getRGBs() == null) || (b.getImage().getImageData().getRGBs()[0] == null))
-// return null;
-// String val = b.getImage().getImageData().getRGBs()[0].toString();
-// return val;
-// }
-
- /**
- * @deprecated use getPreferenceStore instead left for legacy clients,
- * delete by WTP M4
- */
- public Node getColorsNode() {
- //return fColorsNode;
- return null;
- }
-
- /**
- * @return java.util.Dictionary
- */
- public Dictionary getContextStyleMap() {
- return fContextStyleMap;
- }
-
- /**
- * @return org.eclipse.swt.graphics.Color
- */
- public Color getDefaultBackground() {
- return fDefaultBackground;
- }
-
- /**
- * @return org.eclipse.swt.graphics.Color
- */
- public Color getDefaultForeground() {
- return fDefaultForeground;
- }
-
- /**
- * @return java.util.Dictionary
- */
- public Dictionary getDescriptions() {
- return fDescriptions;
- }
-
- public Font getFont() {
- return fText.getFont();
- }
-
- protected String getNamedStyleAtOffset(int offset) {
- // ensure the offset is clean
- if (offset >= fInput.length())
- return getNamedStyleAtOffset(fInput.length() - 1);
- else if (offset < 0)
- return getNamedStyleAtOffset(0);
- // find the ITextRegion at this offset
- if (fNodes == null)
- return null;
- IStructuredDocumentRegion aNode = fNodes;
- while (aNode != null && !aNode.containsOffset(offset))
- aNode = aNode.getNext();
- if (aNode != null) {
- // find the ITextRegion's Context at this offset
- ITextRegion interest = aNode.getRegionAtCharacterOffset(offset);
- if (interest == null)
- return null;
- if (offset > aNode.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) getContextStyleMap().get(regionContext);
- if (namedStyle != null) {
- return namedStyle;
- }
- }
- return null;
- }
-
-
- public RegionParser getParser() {
- return fParser;
- }
-
- private IPreferenceStore getPreferenceStore() {
- return fPreferenceStore;
- }
-
- /**
- * @return String[]
- */
- public List getStyleList() {
- return fStyleList;
- }
-
- private String getStyleName(String description) {
- if (description == null)
- return null;
- String styleName = null;
- java.util.Enumeration keys = getDescriptions().keys();
- while (keys.hasMoreElements()) {
- String test = keys.nextElement().toString();
- if (getDescriptions().get(test).equals(description)) {
- styleName = test;
- break;
- }
- }
- return styleName;
- }
-
- public String getText() {
- return fInput;
- }
-
- 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);
- }
- }
-
-// Commented out when moving to RC2 to remove "unused" error/warning
-// public void widgetDoubleSelected(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);
- }
- }
- };
- }
-
- // defect 220377 - Provide tab traversal for fText widget
- 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;
- }
- }
- };
- }
-
- // refresh the GUI after a color change
- public void refresh() {
- fText.setRedraw(false);
- int selectedIndex = fStyleCombo.getSelectionIndex();
- String description = selectedIndex >= 0 ? fStyleCombo.getItem(selectedIndex) : null;
- activate(getStyleName(description));
- // update Font
- fText.setFont(JFaceResources.getTextFont());
- // reapplyStyles
- applyStyles();
- fText.setRedraw(true);
- }
-
- public void releasePickerResources() {
-// if (fForeground != null && !fForeground.isDisposed() && fForeground.getImage() != null)
-// fForeground.getImage().dispose();
-// if (fBackground != null && !fBackground.isDisposed() && fBackground.getImage() != null)
-// fBackground.getImage().dispose();
- }
-
- private void selectColorAtOffset(int offset) {
- String namedStyle = getNamedStyleAtOffset(offset);
- if (namedStyle == null) {
- fStyleCombo.deselectAll();
- activate(null);
- return;
- }
- String description = (String) getDescriptions().get(namedStyle);
- if (description == null)
- return;
- int itemCount = fStyleCombo.getItemCount();
- for (int i = 0; i < itemCount; i++) {
- if (fStyleCombo.getItem(i).equals(description)) {
- fStyleCombo.select(i);
- break;
- }
- }
- 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;
- }
- });
- }
-
- /**
- * @deprecated use setPreferenceStore instead left for legacy clients,
- * delete by WTP M4
- */
- public void setColorsNode(Node newColorsNode) {
- //fColorsNode = newColorsNode;
- }
-
- /**
- * @param newContextStyleMap
- * java.util.Dictionary
- */
- public void setContextStyleMap(Dictionary newContextStyleMap) {
- fContextStyleMap = newContextStyleMap;
- }
-
- /**
- * @param newDefaultBackground
- * org.eclipse.swt.graphics.Color
- */
- public void setDefaultBackground(Color newDefaultBackground) {
- fDefaultBackground = newDefaultBackground;
- }
-
- /**
- * @deprecated use setPreferenceStore instead left for legacy clients,
- * delete by WTP M4
- */
- public void setDefaultColorsNode(Node newDefaultColorsNode) {
- //fDefaultColorsNode = newDefaultColorsNode;
- }
-
- /**
- * @param newDefaultForeground
- * org.eclipse.swt.graphics.Color
- */
- public void setDefaultForeground(Color newDefaultForeground) {
- fDefaultForeground = newDefaultForeground;
- }
-
- /**
- * @param newDescriptions
- * java.util.Dictionary
- */
- public void setDescriptions(Dictionary newDescriptions) {
- fDescriptions = newDescriptions;
- updateStyleList();
- }
-
- public void setFont(Font font) {
- fText.setFont(font);
- fText.redraw();
- }
-
- /**
- * @deprecated generator key should no longer be needed
- */
- public void setGeneratorKey(String key) {
-// fGeneratorKey = key;
- }
-
- /**
- * @param newParser
- */
- public void setParser(RegionParser newParser) {
- fParser = newParser;
- }
-
- public void setPreferenceStore(IPreferenceStore store) {
- fPreferenceStore = store;
- }
-
- /**
- * @param newStyleList
- * String[]
- */
- public void setStyleList(List newStyleList) {
- fStyleList = newStyleList;
- updateStyleList();
- }
-
- public void setText(String s) {
- fInput = s;
- getParser().reset(new CharArrayReader(fInput.toCharArray()));
- fNodes = getParser().getDocumentRegions();
- if (Debug.displayInfo)
- System.out.println("Length of input: " //$NON-NLS-1$
- //$NON-NLS-1$
- + s.length() + ", " //$NON-NLS-1$
- + getParser().getRegions().size() + " regions."); //$NON-NLS-1$
- if (fText != null)
- fText.setText(s);
- applyStyles();
- }
-
-
-
- /**
- * @return org.eclipse.swt.graphics.RGB
- * @param anRGBString
- * java.lang.String
- * @param defaultRGB
- * org.eclipse.swt.graphics.RGB
- */
- // TODO: never used
- RGB toRGB(String anRGBString, RGB defaultRGB) {
- RGB result = ColorHelper.toRGB(anRGBString);
- if (result == null)
- return defaultRGB;
- return result;
- }
-
- private void updateStyleList() {
- if (fStyleList == null || fDescriptions == null)
- return;
- String[] descriptions = new String[fStyleList.size()];
- for (int i = 0; i < fStyleList.size(); i++) {
- if (fStyleList.get(i) != null)
- descriptions[i] = (String) getDescriptions().get(fStyleList.get(i));
- else
- descriptions[i] = (String) fStyleList.get(i);
- }
- Object[] sortedObjects = new DescriptionSorter().sort(descriptions);
- String[] sortedDescriptions = new String[descriptions.length];
- for (int i = 0; i < descriptions.length; i++) {
- sortedDescriptions[i] = sortedObjects[i].toString();
- }
- fStyleCombo.setItems(sortedDescriptions);
- fStyleCombo.select(0); //defect 219855 - initially select first item
- // in comboBox
- // fStyleCombo.deselectAll();
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java
deleted file mode 100644
index 100904a54b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java
+++ /dev/null
@@ -1,453 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager.TextHoverDescriptor;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * Preference tab for Structured text editor hover help preferences
- *
- * @author amywu
- */
-public class TextHoverPreferenceTab extends AbstractPreferenceTab {
-
- private class InternalTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public InternalTableLabelProvider() {
- super();
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case 0 : // text hover label
- return ((TextHoverManager.TextHoverDescriptor) element).getLabel();
-
- case 1 : // text hover state mask
- return ((TextHoverManager.TextHoverDescriptor) element).getModifierString();
-
- default :
- break;
- }
-
- return null;
- }
- }
-
- private static final String DELIMITER = SSEUIMessages.TextHoverPreferenceTab_delimiter; //$NON-NLS-1$
- private Text fDescription;
- private Table fHoverTable;
- private TableViewer fHoverTableViewer;
- private TableColumn fModifierColumn;
- // for this preference page
- private Text fModifierEditor;
- private TableColumn fNameColumn;
-
- private TextHoverDescriptor[] fTextHovers; // current list of text hovers
-
- public TextHoverPreferenceTab(PreferencePage mainPreferencePage, OverlayPreferenceStore store) {
- Assert.isNotNull(mainPreferencePage);
- Assert.isNotNull(store);
- setMainPreferencePage(mainPreferencePage);
- setOverlayStore(store);
- getOverlayStore().addKeys(createOverlayStoreKeys());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#createContents(org.eclipse.swt.widgets.Composite)
- */
- public Control createContents(Composite tabFolder) {
- Composite hoverComposite = new Composite(tabFolder, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- hoverComposite.setLayout(layout);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- hoverComposite.setLayoutData(gd);
-
- // commented out until these preferences are actually handled in some
- // way
- // String rollOverLabel=
- // ResourceHandler.getString("TextHoverPreferenceTab.annotationRollover");
- // //$NON-NLS-1$
- // addCheckBox(hoverComposite, rollOverLabel,
- // CommonEditorPreferenceNames.EDITOR_ANNOTATION_ROLL_OVER, 0);
- //
- // // Affordance checkbox
- // String showAffordanceLabel =
- // ResourceHandler.getString("TextHoverPreferenceTab.showAffordance");
- // //$NON-NLS-1$
- // addCheckBox(hoverComposite, showAffordanceLabel,
- // CommonEditorPreferenceNames.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, 0);
-
- Label label = new Label(hoverComposite, SWT.NONE);
- label.setText(SSEUIMessages.TextHoverPreferenceTab_hoverPreferences); //$NON-NLS-1$
- gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- gd.horizontalAlignment = GridData.BEGINNING;
- label.setLayoutData(gd);
-
- fHoverTableViewer = CheckboxTableViewer.newCheckList(hoverComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
- // Hover table
- fHoverTable = fHoverTableViewer.getTable();
- fHoverTable.setHeaderVisible(true);
- fHoverTable.setLinesVisible(true);
-
- gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104507
- GC gc = new GC(fHoverTable);
- gc.setFont(fHoverTable.getFont());
- FontMetrics fontMetrics = gc.getFontMetrics();
- gc.dispose();
- int heightHint = Dialog.convertHeightInCharsToPixels(fontMetrics, 7);
- gd.heightHint = heightHint;
-
- fHoverTable.setLayoutData(gd);
-
- TableLayout tableLayout = new TableLayout();
- tableLayout.addColumnData(new ColumnWeightData(1, 140, true));
- tableLayout.addColumnData(new ColumnWeightData(1, 140, true));
- fHoverTable.setLayout(tableLayout);
-
- fHoverTable.addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- handleHoverListSelection();
- }
- });
-
- fNameColumn = new TableColumn(fHoverTable, SWT.NONE);
- fNameColumn.setText(SSEUIMessages.TextHoverPreferenceTab_nameColumnTitle); //$NON-NLS-1$
- fNameColumn.setResizable(true);
-
- fModifierColumn = new TableColumn(fHoverTable, SWT.NONE);
- fModifierColumn.setText(SSEUIMessages.TextHoverPreferenceTab_modifierColumnTitle); //$NON-NLS-1$
- fModifierColumn.setResizable(true);
-
- fHoverTableViewer.setUseHashlookup(true);
- fHoverTableViewer.setContentProvider(new ArrayContentProvider());
- fHoverTableViewer.setLabelProvider(new InternalTableLabelProvider());
- ((CheckboxTableViewer) fHoverTableViewer).addCheckStateListener(new ICheckStateListener() {
- /*
- * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- String id = ((TextHoverDescriptor) event.getElement()).getId();
- if (id == null)
- return;
-
- TextHoverManager.TextHoverDescriptor[] descriptors = getTextHoverManager().getTextHovers();
- TextHoverManager.TextHoverDescriptor hoverConfig = null;
- int i = 0, length = fTextHovers.length;
- while (i < length) {
- if (id.equals(descriptors[i].getId())) {
- hoverConfig = fTextHovers[i];
- hoverConfig.setEnabled(event.getChecked());
- fModifierEditor.setEnabled(event.getChecked());
- fHoverTableViewer.setSelection(new StructuredSelection(descriptors[i]));
- }
- i++;
- }
-
- handleHoverListSelection();
- updateStatus(hoverConfig);
- }
- });
-
- // Text field for modifier string
- label = new Label(hoverComposite, SWT.LEFT);
- label.setText(SSEUIMessages.TextHoverPreferenceTab_keyModifier); //$NON-NLS-1$
- fModifierEditor = new Text(hoverComposite, SWT.BORDER);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- fModifierEditor.setLayoutData(gd);
-
- fModifierEditor.addKeyListener(new KeyListener() {
- private boolean isModifierCandidate;
-
- public void keyPressed(KeyEvent e) {
- isModifierCandidate = e.keyCode > 0 && e.character == 0 && e.stateMask == 0;
- }
-
- public void keyReleased(KeyEvent e) {
- if (isModifierCandidate && e.stateMask > 0 && e.stateMask == e.stateMask && e.character == 0) {// &&
- // e.time
- // -time
- // <
- // 1000)
- // {
- String text = fModifierEditor.getText();
- Point selection = fModifierEditor.getSelection();
- int i = selection.x - 1;
- while (i > -1 && Character.isWhitespace(text.charAt(i))) {
- i--;
- }
- boolean needsPrefixDelimiter = i > -1 && !String.valueOf(text.charAt(i)).equals(DELIMITER);
-
- i = selection.y;
- while (i < text.length() && Character.isWhitespace(text.charAt(i))) {
- i++;
- }
- boolean needsPostfixDelimiter = i < text.length() && !String.valueOf(text.charAt(i)).equals(DELIMITER);
-
- String insertString;
-
- if (needsPrefixDelimiter && needsPostfixDelimiter)
- insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter, new String[]{Action.findModifierString(e.stateMask)});
- else if (needsPrefixDelimiter)
- insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertDelimiterAndModifier, new String[]{Action.findModifierString(e.stateMask)});
- else if (needsPostfixDelimiter)
- insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertModifierAndDelimiter, new String[]{Action.findModifierString(e.stateMask)});
- else
- insertString = Action.findModifierString(e.stateMask);
-
- if (insertString != null)
- fModifierEditor.insert(insertString);
- }
- }
- });
-
- fModifierEditor.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- handleModifierModified();
- }
- });
-
- // Description
- Label descriptionLabel = new Label(hoverComposite, SWT.LEFT);
- descriptionLabel.setText(SSEUIMessages.TextHoverPreferenceTab_description); //$NON-NLS-1$
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 2;
- descriptionLabel.setLayoutData(gd);
- fDescription = new Text(hoverComposite, SWT.LEFT | SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.BORDER);
- gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
- gd.horizontalSpan = 2;
- fDescription.setLayoutData(gd);
-
- initialize();
-
- Dialog.applyDialogFont(hoverComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(hoverComposite, IHelpContextIds.PREFSTE_HOVERS_HELPID);
- return hoverComposite;
- }
-
- private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS));
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- private String generateTextHoverString() {
- StringBuffer buf = new StringBuffer();
-
- for (int i = 0; i < fTextHovers.length; i++) {
- buf.append(fTextHovers[i].getId());
- buf.append(TextHoverManager.HOVER_ATTRIBUTE_SEPARATOR);
- buf.append(Boolean.toString(fTextHovers[i].isEnabled()));
- buf.append(TextHoverManager.HOVER_ATTRIBUTE_SEPARATOR);
- String modifier = fTextHovers[i].getModifierString();
- if (modifier == null || modifier.length() == 0)
- modifier = TextHoverManager.NO_MODIFIER;
- buf.append(modifier);
- buf.append(TextHoverManager.HOVER_SEPARATOR);
- }
- return buf.toString();
- }
-
- private TextHoverManager getTextHoverManager() {
- return SSEUIPlugin.getDefault().getTextHoverManager();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#getTitle()
- */
- public String getTitle() {
- return SSEUIMessages.TextHoverPreferenceTab_title; //$NON-NLS-1$
- }
-
- void handleHoverListSelection() {
- int i = fHoverTable.getSelectionIndex();
-
- if (i == -1) {
- if (fHoverTable.getSelectionCount() == 0)
- fModifierEditor.setEnabled(false);
- return;
- }
-
- boolean enabled = fTextHovers[i].isEnabled();
- fModifierEditor.setEnabled(enabled);
- fModifierEditor.setText(fTextHovers[i].getModifierString());
- String description = fTextHovers[i].getDescription();
- if (description == null)
- description = ""; //$NON-NLS-1$
- fDescription.setText(description);
- }
-
- private void handleModifierModified() {
- int i = fHoverTable.getSelectionIndex();
- if (i == -1)
- return;
-
- String modifiers = fModifierEditor.getText();
- fTextHovers[i].setModifierString(modifiers);
-
- // update table
- fHoverTableViewer.refresh(fTextHovers[i]);
-
- updateStatus(fTextHovers[i]);
- }
-
- private void initialize() {
- restoreFromOverlay();
- fHoverTableViewer.setInput(fTextHovers);
-
- initializeFields();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferenceTab#initializeFields()
- */
- protected void initializeFields() {
- super.initializeFields();
-
- fModifierEditor.setEnabled(false);
- // initialize checkboxes in hover table
- for (int i = 0; i < fTextHovers.length; i++)
- fHoverTable.getItem(i).setChecked(fTextHovers[i].isEnabled());
- fHoverTableViewer.refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performApply()
- */
- public void performApply() {
- performOk();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performDefaults()
- */
- public void performDefaults() {
- initialize();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performOk()
- */
- public void performOk() {
- String textHoverString = generateTextHoverString();
- getOverlayStore().setValue(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS, textHoverString);
- getTextHoverManager().resetTextHovers(); // notify text hover manager
- // it should reset to get
- // latest preferences
- }
-
- /**
- * Populates fTextHovers with text hover description from the overlay
- * store (which is the preferences)
- */
- private void restoreFromOverlay() {
- String descriptorsString = getOverlayStore().getString(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS);
- fTextHovers = getTextHoverManager().generateTextHoverDescriptors(descriptorsString);
- }
-
- void updateStatus(TextHoverManager.TextHoverDescriptor hoverConfig) {
- IStatus status = new StatusInfo();
-
- if (hoverConfig != null && hoverConfig.isEnabled() && EditorUtility.computeStateMask(hoverConfig.getModifierString()) == -1)
- status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_modifierIsNotValid, new String[]{hoverConfig.getModifierString()}));
-
- int i = 0;
- HashMap stateMasks = new HashMap(fTextHovers.length);
- while (status.isOK() && i < fTextHovers.length) {
- if (fTextHovers[i].isEnabled()) {
- String label = fTextHovers[i].getLabel();
- Integer stateMask = new Integer(EditorUtility.computeStateMask(fTextHovers[i].getModifierString()));
- if (stateMask.intValue() == -1)
- status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_modifierIsNotValidForHover, new String[]{fTextHovers[i].getModifierString(), label}));
- else if (stateMasks.containsKey(stateMask))
- status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_duplicateModifier, new String[]{label, (String) stateMasks.get(stateMask)}));
- else
- stateMasks.put(stateMask, label);
- }
- i++;
- }
-
- updateStatus(status);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
deleted file mode 100644
index 808a99b183..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
+++ /dev/null
@@ -1,149 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-public class TranslucencyPreferenceTab implements IPreferenceTab {
-
- private PreferencePage fMainPreferencePage;
- private IntegerFieldEditor fTranslucencyScale = null;
- private final int MAX_PERCENTAGE = 100;
-
- private IPropertyChangeListener validityChangeListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(FieldEditor.IS_VALID))
- updateValidState();
- }
- };
-
- /**
- *
- */
- public TranslucencyPreferenceTab() {
- super();
- }
-
- public TranslucencyPreferenceTab(PreferencePage mainPreferencePage) {
- Assert.isNotNull(mainPreferencePage);
- setMainPreferencePage(mainPreferencePage);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#createContents(org.eclipse.swt.widgets.Composite)
- */
- public Control createContents(Composite tabFolder) {
- Composite composite = new Composite(tabFolder, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- composite.setLayout(layout);
-
- String text = SSEUIMessages.TranslucencyPreferenceTab_1; //$NON-NLS-1$
- fTranslucencyScale = new IntegerFieldEditor(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE, text, composite);
-
- fTranslucencyScale.setErrorMessage(JFaceResources.getString("StringFieldEditor.errorMessage"));//$NON-NLS-1$
- fTranslucencyScale.setPreferenceStore(getPreferenceStore());
- fTranslucencyScale.setPreferencePage(getMainPreferencePage());
- fTranslucencyScale.setTextLimit(Integer.toString(MAX_PERCENTAGE).length());
- fTranslucencyScale.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
- fTranslucencyScale.setValidRange(0, MAX_PERCENTAGE);
- fTranslucencyScale.load();
- fTranslucencyScale.setPropertyChangeListener(validityChangeListener);
-
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PREFWEBX_READONLY_HELPID);
- return composite;
- }
-
- /**
- * @return Returns the fMainPreferencePage.
- */
- private PreferencePage getMainPreferencePage() {
- return fMainPreferencePage;
- }
-
- /**
- * @return Returns the preference store used in this tab
- */
- private IPreferenceStore getPreferenceStore() {
- return SSEUIPlugin.getDefault().getPreferenceStore();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#getTitle()
- */
- public String getTitle() {
- return SSEUIMessages.TranslucencyPreferenceTab_0; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performApply()
- */
- public void performApply() {
- fTranslucencyScale.store();
- SSEUIPlugin.getDefault().savePluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performDefaults()
- */
- public void performDefaults() {
- fTranslucencyScale.loadDefault();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performOk()
- */
- public void performOk() {
- performApply();
- }
-
- /**
- * @param mainPreferencePage
- * The fMainPreferencePage to set.
- */
- private void setMainPreferencePage(PreferencePage mainPreferencePage) {
- fMainPreferencePage = mainPreferencePage;
- }
-
- private void updateValidState() {
- if (getMainPreferencePage() != null) {
- getMainPreferencePage().setValid(fTranslucencyScale.isValid());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java
deleted file mode 100644
index f34665319a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java
+++ /dev/null
@@ -1,130 +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.wst.sse.ui.internal.projection;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.projection.IProjectionPosition;
-
-/**
- * Represents a folding position for an XML comment
- */
-public abstract class AbstractStructuredCommentFoldingPosition extends Position implements IProjectionPosition {
-
- /**
- * Default constructor
- *
- * @param offset the offset of the folding position
- * @param length the length of the folidng position
- */
- public AbstractStructuredCommentFoldingPosition(int offset, int length) {
- super(offset, length);
- }
-
- /**
- * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeCaptionOffset(org.eclipse.jface.text.IDocument)
- */
- public int computeCaptionOffset(IDocument document) throws BadLocationException {
- return findFirstContent(document.get(offset, length));
- }
-
- /**
- * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeProjectionRegions(org.eclipse.jface.text.IDocument)
- */
- public IRegion[] computeProjectionRegions(IDocument document) throws BadLocationException {
- //get the content of the comment
- String content = document.get(offset, length);
- int contentStart = findFirstContent(content);
-
- //find the start line of the comment
- //find the end line of the comment
- //find the first line of text in the comment
- int startLineNum = document.getLineOfOffset(getStartOffset());
- IRegion startLine = document.getLineInformation(startLineNum);
- int endLineNum = document.getLineOfOffset(getEndOffset()) +1;
- IRegion endLine = document.getLineInformation(endLineNum);
- int captionLineNum = document.getLineOfOffset(getStartOffset() + contentStart);
-
- int foldOffset;
- int foldEndOffset;
-
- synchronized (this) {
- foldOffset = startLine.getOffset();
- if(foldOffset < offset) {
- offset = foldOffset;
- }
-
- foldEndOffset = endLine.getOffset();
-
- if((foldEndOffset-offset) > length) {
- length = foldEndOffset-offset;
- }
- }
-
- //fold before the first line of text in the comment
- IRegion preRegion = null;
- IRegion postRegion = null;
- if(startLineNum < captionLineNum) {
- IRegion captionLine = document.getLineInformation(captionLineNum);
- preRegion = new Region(foldOffset, captionLine.getOffset()-foldOffset);
- }
-
- //fold after the first line of text in the comment
- if(captionLineNum < endLineNum) {
- int postRegionOffset = document.getLineOffset(captionLineNum+1);
- postRegion = new Region(postRegionOffset, foldEndOffset-postRegionOffset);
- }
-
- IRegion[] regions = null;
- if(preRegion != null && postRegion != null) {
- regions = new IRegion[] {preRegion, postRegion};
- } else if(preRegion != null) {
- regions = new IRegion[] {preRegion};
- } else if(postRegion != null) {
- regions = new IRegion[] {postRegion};
- }
-
- return regions;
- }
-
- /**
- * Finds the offset of the first identifier part within <code>content</code>.
- * Returns 0 if none is found.
- *
- * @param content the content to search
- * @param prefixEnd the end of the prefix
- * @return the first index of a unicode identifier part, or zero if none can
- * be found
- */
- private int findFirstContent(final CharSequence content) {
- int lenght= content.length();
- for (int i= 0; i < lenght; i++) {
- if (Character.isUnicodeIdentifierPart(content.charAt(i)))
- return i;
- }
- return 0;
- }
-
- /**
- * @return the start offset of the folding position
- */
- protected abstract int getStartOffset();
-
- /**
- * @return the end offset of the folding position
- */
- protected abstract int getEndOffset();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java
deleted file mode 100644
index 3ddb47a7d4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java
+++ /dev/null
@@ -1,82 +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.wst.sse.ui.internal.projection;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.projection.IProjectionPosition;
-
-/**
- * Represents a single folding position in an <code>IStructuredDocument</code>
- */
-public abstract class AbstractStructuredFoldingPosition extends Position implements IProjectionPosition {
-
- /**
- * Default constructor
- *
- * @param offset the offset of the folding position
- * @param length the length of the folidng position
- */
- public AbstractStructuredFoldingPosition(int offset, int length) {
- super(offset, length);
- }
-
- /**
- * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeCaptionOffset(org.eclipse.jface.text.IDocument)
- */
- public int computeCaptionOffset(IDocument document) throws BadLocationException {
-
- return 0;
- }
-
- /**
- * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeProjectionRegions(org.eclipse.jface.text.IDocument)
- */
- public IRegion[] computeProjectionRegions(IDocument document) throws BadLocationException {
-
- int startLineNum = document.getLineOfOffset(getStartOffset()) + 1;
- IRegion startLine = document.getLineInformation(startLineNum);
- int endLineNum = document.getLineOfOffset(getEndOffset()) + 1;
- IRegion endLine = document.getLineInformation(endLineNum);
-
- int foldOffset;
- int foldEndOffset;
-
- synchronized (this) {
- foldOffset = startLine.getOffset();
- if(foldOffset < offset) {
- offset = foldOffset;
- }
-
- foldEndOffset = endLine.getOffset();
-
- if((foldEndOffset-offset) > length) {
- length = foldEndOffset-offset;
- }
- }
-
- return new IRegion[] {new Region(foldOffset, foldEndOffset-foldOffset)};
- }
-
- /**
- * @return the start offset of the folding position
- */
- protected abstract int getStartOffset();
-
- /**
- * @return the end offset of the folding position
- */
- protected abstract int getEndOffset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java
deleted file mode 100644
index f71629ae35..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-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.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.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.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-
-/**
- * <p>This class has the default implementation for a structured editor folding strategy.
- * Each content type that the structured editor supports should create an extension point
- * specifying a child class of this class as its folding strategy, if that content type
- * should have folding.</p>
- *
- * <p>EX:<br />
- * <code>&lt;extension point="org.eclipse.wst.sse.ui.editorConfiguration"&gt;<br />
- * &lt;provisionalConfiguration<br />
- * type="foldingstrategy"<br />
- * class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"<br />
- * target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" /&gt;<br />
- * &lt;/extension&gt;</code></p>
- *
- * <p>Different content types can use the same folding strategy if it makes sense to do so,
- * such as with HTML/XML/JSP.</p>
- *
- * <p>This strategy is based on the Reconciler paradigm and thus runs in the background,
- * this means that even for very large documents requiring the calculation of 1000s of
- * folding annotations the user will not be effected except for the annotations may take
- * some time to first appear.</p>
- */
-public abstract class AbstractStructuredFoldingStrategy
- extends AbstractStructuredTextReconcilingStrategy implements IProjectionListener {
-
- /**
- * The org.eclipse.wst.sse.ui.editorConfiguration provisionalConfiguration type
- */
- public static final String ID = "foldingstrategy"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether folding is enabled in the
- * Structured Text editor.
- */
- public final static String FOLDING_ENABLED = "foldingEnabled"; //$NON-NLS-1$
-
- /**
- * The annotation model associated with this folding strategy
- */
- protected ProjectionAnnotationModel fProjectionAnnotationModel;
-
- /**
- * The structured text viewer this folding strategy is associated with
- */
- private ProjectionViewer fViewer;
-
- /**
- * these are not used but needed to implement abstract methods
- */
- private IReconcileStep fFoldingStep;
-
- /**
- * Default constructor for the folding strategy, can not take any parameters
- * because subclasses instances of this class are created using reflection
- * based on plugin settings
- */
- public AbstractStructuredFoldingStrategy() {
- super();
- }
-
- /**
- * The folding strategy must be associated with a viewer for it to function
- *
- * @param viewer the viewer to associate this folding strategy with
- */
- public void setViewer(ProjectionViewer viewer) {
- super.setViewer(viewer);
-
- if(fViewer != null) {
- fViewer.removeProjectionListener(this);
- }
- fViewer = viewer;
- fViewer.addProjectionListener(this);
- fProjectionAnnotationModel = fViewer.getProjectionAnnotationModel();
- }
-
- public void uninstall() {
- setDocument(null);
-
- if(fViewer != null) {
- fViewer.removeProjectionListener(this);
- fViewer = null;
- }
-
- fFoldingStep = null;
-
- projectionDisabled();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
- */
- public void setDocument(IDocument document) {
- super.setDocument(document);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled()
- */
- public void projectionDisabled() {
- fProjectionAnnotationModel = null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled()
- */
- public void projectionEnabled() {
- if(fViewer != null) {
- fProjectionAnnotationModel = fViewer.getProjectionAnnotationModel();
- }
- }
-
- /**
- * <p><b>NOTE 1:</b> This implementation of reconcile ignores the given {@link IRegion} and instead gets all of the
- * structured document regions effected by the range of the given {@link DirtyRegion}.</p>
- *
- * <p><b>NOTE 2:</b> In cases where multiple {@link IRegion} maybe dirty it is more efficient to pass one
- * {@link DirtyRegion} contain all of the {@link IRegion}s then one {@link DirtyRegion} for each IRegion.
- * Case in point, when processing the entire document it is <b>recommended</b> that this function be
- * called only <b>once</b> with one {@link DirtyRegion} that spans the entire document.</p>
- *
- * @param dirtyRegion the region that needs its folding annotations processed
- * @param subRegion ignored
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion, org.eclipse.jface.text.IRegion)
- */
- public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
- IStructuredModel model = null;
- if(fProjectionAnnotationModel != null) {
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- if(model != null) {
- //use the structured doc to get all of the regions effected by the given dirty region
- IStructuredDocument structDoc = model.getStructuredDocument();
- IStructuredDocumentRegion[] structRegions = structDoc.getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
- Set indexedRegions = getIndexedRegions(model, structRegions);
-
- //these are what are passed off to the annotation model to
- //actually create and maintain the annotations
- List modifications = new ArrayList();
- List deletions = new ArrayList();
- Map additions = new HashMap();
- boolean isInsert = dirtyRegion.getType().equals(DirtyRegion.INSERT);
- boolean isRemove = dirtyRegion.getType().equals(DirtyRegion.REMOVE);
-
- //find and mark all folding annotations with length 0 for deletion
- markInvalidAnnotationsForDeletion(dirtyRegion, deletions);
-
- //reconcile each effected indexed region
- Iterator indexedRegionsIter = indexedRegions.iterator();
- while(indexedRegionsIter.hasNext() && fProjectionAnnotationModel != null) {
- IndexedRegion indexedRegion = (IndexedRegion)indexedRegionsIter.next();
-
- //only try to create an annotation if the index region is a valid type
- if(indexedRegionValidType(indexedRegion)) {
- FoldingAnnotation annotation = new FoldingAnnotation(indexedRegion, false);
-
- // if INSERT calculate new addition position or modification
- // else if REMOVE add annotation to the deletion list
- if(isInsert) {
- Annotation existingAnno = getExistingAnnotation(indexedRegion);
- //if projection has been disabled the iter could be null
- //if annotation does not already exist for this region create a new one
- //else modify an old one, which could include deletion
- if(existingAnno == null) {
- Position newPos = calcNewFoldPosition(indexedRegion);
-
- if(newPos != null && newPos.length > 0) {
- additions.put(annotation, newPos);
- }
- } else {
- updateAnnotations(existingAnno, indexedRegion, additions, modifications, deletions);
- }
- } else if (isRemove) {
- deletions.add(annotation);
- }
- }
- }
-
- //be sure projection has not been disabled
- if(fProjectionAnnotationModel != null) {
- //send the calculated updates to the annotations to the annotation model
- fProjectionAnnotationModel.modifyAnnotations((Annotation[])deletions.toArray(new Annotation[1]), additions, (Annotation[])modifications.toArray(new Annotation[0]));
- }
- }
- } finally {
- if(model != null) {
- model.releaseFromRead();
- }
- }
- }
- }
-
- /**
- * <p>Every implementation of the folding strategy calculates the position for a given
- * IndexedRegion differently. Also this calculation often relies on casting to internal classes
- * only available in the implementing classes plugin</p>
- *
- * @param indexedRegion the IndexedRegion to calculate a new annotation position for
- * @return the calculated annotation position or NULL if none can be calculated based on the given region
- */
- abstract protected Position calcNewFoldPosition(IndexedRegion indexedRegion);
-
- /**
- * This is the default behavior for updating a dirtied IndexedRegion. This function
- * can be overridden if slightly different functionality is required in a specific instance
- * of this class.
- *
- * @param existingAnnotationsIter the existing annotations that need to be updated
- * based on the given dirtied IndexRegion
- * @param dirtyRegion the IndexedRegion that caused the annotations need for updating
- * @param modifications the list of annotations to be modified
- * @param deletions the list of annotations to be deleted
- */
- protected void updateAnnotations(Annotation existingAnnotation, IndexedRegion dirtyRegion, Map additions, List modifications, List deletions) {
- if(existingAnnotation instanceof FoldingAnnotation) {
- FoldingAnnotation foldingAnnotation = (FoldingAnnotation)existingAnnotation;
- Position newPos = calcNewFoldPosition(foldingAnnotation.getRegion());
-
- //if a new position can be calculated then update the position of the annotation,
- //else the annotation needs to be deleted
- if(newPos != null && newPos.length > 0 && fProjectionAnnotationModel != null) {
- Position oldPos = fProjectionAnnotationModel.getPosition(foldingAnnotation);
- //only update the position if we have to
- if(!newPos.equals(oldPos)) {
- oldPos.setOffset(newPos.offset);
- oldPos.setLength(newPos.length);
- modifications.add(foldingAnnotation);
- }
- } else {
- deletions.add(foldingAnnotation);
- }
- }
- }
-
- /**
- * <p>Searches the given {@link DirtyRegion} for annotations that now have a length of 0.
- * This is caused when something that was being folded has been deleted. These {@link FoldingAnnotation}s
- * are then added to the {@link List} of {@link FoldingAnnotation}s to be deleted</p>
- *
- * @param dirtyRegion find the now invalid {@link FoldingAnnotation}s in this {@link DirtyRegion}
- * @param deletions the current list of {@link FoldingAnnotation}s marked for deletion that the
- * newly found invalid {@link FoldingAnnotation}s will be added to
- */
- protected void markInvalidAnnotationsForDeletion(DirtyRegion dirtyRegion, List deletions) {
- Iterator iter = getAnnotationIterator(dirtyRegion);
- if (iter != null) {
- while(iter.hasNext()) {
- Annotation anno = (Annotation)iter.next();
- if(anno instanceof FoldingAnnotation) {
- Position pos = fProjectionAnnotationModel.getPosition(anno);
- if(pos.length == 0) {
- deletions.add(anno);
- }
- }
- }
- }
- }
-
- /**
- * Should return true if the given IndexedRegion is one that this strategy pays attention to
- * when calculating new and updated annotations
- *
- * @param indexedRegion the IndexedRegion to check the type of
- * @return true if the IndexedRegion is of a valid type, false otherwise
- */
- abstract protected boolean indexedRegionValidType(IndexedRegion indexedRegion);
-
- /**
- * Steps are not used in this strategy
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#containsStep(org.eclipse.jface.text.reconciler.IReconcileStep)
- */
- protected boolean containsStep(IReconcileStep step) {
- return fFoldingStep.equals(step);
- }
-
- /**
- * Steps are not used in this strategy
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#createReconcileSteps()
- */
- public void createReconcileSteps() {
- fFoldingStep = new StructuredReconcileStep() { };
- }
-
- /**
- * A FoldingAnnotation is a ProjectionAnnotation in a structured document.
- * Its extended functionality include storing the <code>IndexedRegion</code> it is folding
- * and overriding the paint method (in a hacky type way) to prevent one line folding
- * annotations to be drawn.
- */
- protected class FoldingAnnotation extends ProjectionAnnotation {
- private boolean fIsVisible; /* workaround for BUG85874 */
-
- /**
- * The IndexedRegion this annotation is folding
- */
- private IndexedRegion fRegion;
-
- /**
- * Creates a new FoldingAnnotation that is associated with the given IndexedRegion
- *
- * @param region the IndexedRegion this annotation is associated with
- * @param isCollapsed true if this annotation should be collapsed, false otherwise
- */
- public FoldingAnnotation(IndexedRegion region, boolean isCollapsed) {
- super(isCollapsed);
-
- fIsVisible = false;
- fRegion = region;
- }
-
- /**
- * Returns the IndexedRegion this annotation is associated with
- *
- * @return the IndexedRegion this annotation is associated with
- */
- public IndexedRegion getRegion() {
- return fRegion;
- }
-
- public void setRegion(IndexedRegion region) {
- fRegion = region;
- }
-
- /**
- * 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);
- }
-
- /**
- * @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();
- }
-
- /**
- * Two FoldingAnnotations are equal if their IndexedRegions are equal
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- boolean equal = false;
-
- if(obj instanceof FoldingAnnotation) {
- equal = fRegion.equals(((FoldingAnnotation)obj).fRegion);
- }
-
- return equal;
- }
-
- /**
- * Returns the hash code of the IndexedRegion this annotation is associated with
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fRegion.hashCode();
- }
-
- /**
- * Returns the toString of the aIndexedRegion this annotation is associated with
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fRegion.toString();
- }
- }
-
- /**
- * Given a {@link DirtyRegion} returns an {@link Iterator} of the already existing
- * annotations in that region.
- *
- * @param dirtyRegion the {@link DirtyRegion} to check for existing annotations in
- *
- * @return an {@link Iterator} over the annotations in the given {@link DirtyRegion}.
- * The iterator could have no annotations in it. Or <code>null</code> if projection has
- * been disabled.
- */
- private Iterator getAnnotationIterator(DirtyRegion dirtyRegion) {
- Iterator annoIter = null;
- //be sure project has not been disabled
- if(fProjectionAnnotationModel != null) {
- //workaround for Platform Bug 299416
- int offset = dirtyRegion.getOffset();
- if(offset > 0) {
- offset--;
- }
- annoIter = fProjectionAnnotationModel.getAnnotationIterator(offset, dirtyRegion.getLength(), false, false);
- }
- return annoIter;
- }
-
- /**
- * <p>Gets the first {@link Annotation} at the start offset of the given {@link IndexedRegion}.</p>
- *
- * @param indexedRegion get the first {@link Annotation} at this {@link IndexedRegion}
- * @return the first {@link Annotation} at the start offset of the given {@link IndexedRegion}
- */
- private Annotation getExistingAnnotation(IndexedRegion indexedRegion) {
- Iterator iter = fProjectionAnnotationModel.getAnnotationIterator(indexedRegion.getStartOffset(), 1, false, true);
- Annotation anno = null;
- if(iter.hasNext()) {
- anno = (Annotation)iter.next();
- }
-
- return anno;
- }
-
- /**
- * <p>Gets all of the {@link IndexedRegion}s from the given {@link IStructuredModel} spanned by the given
- * {@link IStructuredDocumentRegion}s.</p>
- *
- * @param model the {@link IStructuredModel} used to get the {@link IndexedRegion}s
- * @param structRegions get the {@link IndexedRegion}s spanned by these {@link IStructuredDocumentRegion}s
- * @return the {@link Set} of {@link IndexedRegion}s from the given {@link IStructuredModel} spanned by the
- * given {@link IStructuredDocumentRegion}s.
- */
- private Set getIndexedRegions(IStructuredModel model, IStructuredDocumentRegion[] structRegions) {
- Set indexedRegions = new HashSet(structRegions.length);
-
- //for each text region in each structured document region find the indexed region it spans/is in
- for (int structRegionIndex = 0; structRegionIndex < structRegions.length && fProjectionAnnotationModel != null; ++structRegionIndex) {
- IStructuredDocumentRegion structuredDocumentRegion = structRegions[structRegionIndex];
-
- int offset = structuredDocumentRegion.getStartOffset();
- IndexedRegion indexedRegion = model.getIndexedRegion(offset);
- indexedRegions.add(indexedRegion);
- if (structuredDocumentRegion.getEndOffset() <= indexedRegion.getEndOffset())
- continue;
-
- ITextRegionList textRegions = structuredDocumentRegion.getRegions();
- int textRegionCount = textRegions.size();
- for (int textRegionIndex = 1; textRegionIndex < textRegionCount; ++textRegionIndex) {
- offset = structuredDocumentRegion.getStartOffset(textRegions.get(textRegionIndex));
- indexedRegion = model.getIndexedRegion(offset);
- indexedRegions.add(indexedRegion);
- }
- }
-
- return indexedRegions;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java
deleted file mode 100644
index 18f919c3f7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java
+++ /dev/null
@@ -1,51 +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.sse.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-public class AdapterPropertySheetEntryLabelProvider extends LabelProvider {
- public Image getImage(Object element) {
- if (element == null)
- return null;
- if (element instanceof IPropertySheetEntry) {
- return ((IPropertySheetEntry) element).getImage();
- }
- if (element instanceof INodeNotifier) {
- IPropertySheetEntry entry = (IPropertySheetEntry) ((INodeNotifier) element).getAdapterFor(IPropertySheetEntry.class);
- if (entry != null)
- return entry.getImage();
- }
- return super.getImage(element);
- }
-
- public String getText(Object element) {
- if (element == null)
- return null;
- if (element instanceof IPropertySheetEntry) {
- return ((IPropertySheetEntry) element).getValueAsString();
- }
- if (element instanceof INodeNotifier) {
- IPropertySheetEntry entry = (IPropertySheetEntry) ((INodeNotifier) element).getAdapterFor(IPropertySheetEntry.class);
- if (entry != null)
- return entry.getValueAsString();
- }
- return super.getText(element);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
deleted file mode 100644
index 881cb2faee..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
+++ /dev/null
@@ -1,207 +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.wst.sse.ui.internal.properties;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-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.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
-
-
-/**
- * A configurable IPropertySheetPage since the standard PropertySheetPage does
- * not expose its viewer field.
- */
-
-public class ConfigurablePropertySheetPage extends PropertySheetPage {
- private class NullPropertySheetConfiguration extends PropertySheetConfiguration {
- public IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page) {
- return null;
- }
- }
-
- private static final boolean _DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/propertySheet")); //$NON-NLS-1$ //$NON-NLS-2$;;
-
- private long _DEBUG_TIME = 0;
-
- private PropertySheetConfiguration fConfiguration;
- private Object[] fSelectedEntries = null;
- private ISelection fInput = null;
- private IMenuManager fMenuManager;
-
- private RemoveAction fRemoveAction;
-
- private IStatusLineManager fStatusLineManager;
-
- private IToolBarManager fToolBarManager;
-
- private final PropertySheetConfiguration NULL_CONFIGURATION = new NullPropertySheetConfiguration();
-
- public ConfigurablePropertySheetPage() {
- super();
- }
-
- public void createControl(Composite parent) {
- setPropertySourceProvider(getConfiguration().getPropertySourceProvider(this));
- super.createControl(parent);
- }
-
- public void dispose() {
- setConfiguration(null);
- getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
- fSelectedEntries = null;
- fInput = null;
- super.dispose();
- }
-
- public PropertySheetConfiguration getConfiguration() {
- if (fConfiguration == null)
- fConfiguration = NULL_CONFIGURATION;
- return fConfiguration;
- }
-
- public void handleEntrySelection(ISelection selection) {
- if (getControl() != null && !getControl().isDisposed() && selection != null) {
- super.handleEntrySelection(selection);
- if (selection instanceof IStructuredSelection) {
- fSelectedEntries = ((IStructuredSelection) selection).toArray();
- }
- else {
- fSelectedEntries = null;
- }
- fRemoveAction.setEnabled(!selection.isEmpty());
- }
- }
-
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
- }
-
- public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
- super.makeContributions(menuManager, toolBarManager, statusLineManager);
- fMenuManager = menuManager;
- fToolBarManager = toolBarManager;
- fStatusLineManager = statusLineManager;
-
- fRemoveAction = new RemoveAction(this);
- toolBarManager.add(fRemoveAction);
- menuManager.add(fRemoveAction);
- getConfiguration().addContributions(menuManager, toolBarManager, statusLineManager);
-
- menuManager.update(true);
- }
-
- void remove() {
- if (fSelectedEntries != null) {
- Object[] entries = fSelectedEntries;
- ISelection selection = fInput;
- boolean needsRefresh = false;
- if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
- IPropertySource source = getConfiguration().getPropertySourceProvider(this).getPropertySource(((IStructuredSelection) selection).getFirstElement());
- if (source != null && source instanceof IPropertySourceExtension) {
- for (int i = 0; i < entries.length; i++) {
- if (entries[i] instanceof IPropertySheetEntry) {
- IPropertySheetEntry entry = (IPropertySheetEntry) entries[i];
- needsRefresh = true;
- ((IPropertySourceExtension) source).removeProperty(entry.getDisplayName());
- }
- }
- }
- }
- if (needsRefresh) {
- refresh();
- }
- }
- }
-
- /*
- * Filter the selection through the current Configuration. Not every
- * selection received is a Structured selection nor are the Structured
- * selection's elements all to be displayed.
- *
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (_DEBUG) {
- _DEBUG_TIME = System.currentTimeMillis();
- }
- // skip if we're the source of this selection
- if (part != null && part instanceof PageBookView) {
- if (((PageBookView) part).getCurrentPage() == this)
- return;
- }
- if (getControl() != null && getControl().isVisible()) {
- ISelection preferredSelection = getConfiguration().getInputSelection(part, selection);
- /*
- * Do some minor caching of the selection.
- *
- * As a PropertySheetPage, we've always notified of selection
- * changes, but we've also subscribed to post selection
- * notification so we can track caret movements in source viewers.
- * When selecting a block of text, we're thus notified of the new
- * selection twice. Remembering what our last *effective*
- * selection was allows us to cut out most of the
- * double-notification penalty.
- */
- if (!preferredSelection.equals(fInput)) {
- fInput = preferredSelection;
- fSelectedEntries = null;
- super.selectionChanged(part, preferredSelection);
- }
-
- if (_DEBUG) {
- System.out.println("(P:service " + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + ((IStructuredSelection) preferredSelection).getFirstElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- else if (_DEBUG) {
- System.out.println("[skipped] (P:" + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + selection); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- /**
- * @param configuration
- * The configuration to set.
- */
- public void setConfiguration(PropertySheetConfiguration configuration) {
- if (fConfiguration != null) {
- fConfiguration.removeContributions(fMenuManager, fToolBarManager, fStatusLineManager);
- fConfiguration.unconfigure();
- }
-
- fConfiguration = configuration;
-
- if (fConfiguration != null) {
- setPropertySourceProvider(fConfiguration.getPropertySourceProvider(this));
- fConfiguration.addContributions(fMenuManager, fToolBarManager, fStatusLineManager);
- }
- }
-
- public void setFocus() {
- super.setFocus();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java
deleted file mode 100644
index 154861b1e6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java
+++ /dev/null
@@ -1,89 +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.sse.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class CustomPropertyDescriptor extends PropertyDescriptor {
-
- protected Class cellEditorClass = null;
-
- /**
- * Returns a property descriptor with a unique name and a display name.
- *
- * @param id
- * the id for the property
- * @param displayName
- * the name to display for the property
- */
- public CustomPropertyDescriptor(Object id, String newDisplayName, Class editorClass) {
- super(id, newDisplayName);
- setDescription((String) id);
- setCellEditorClass(editorClass);
- }
-
- /**
- * Returns a property descriptor with a unique name and a display name.
- *
- * @param uniqueName
- * the unique name of the property
- * @param displayName
- * the name to display for the property
- */
- public CustomPropertyDescriptor(String uniqueName, String newDisplayName) {
- this(uniqueName, newDisplayName, TextCellEditor.class);
- }
-
- public CellEditor createPropertyEditor(Composite parent) {
- return getPropertyEditor(parent);
- }
-
- public Class getCellEditorClass() {
- return cellEditorClass;
- }
-
- /**
- * Returns the editor used to edit the property.
- *
- * @return an editor for the property
- */
- protected CellEditor getPropertyEditor(Composite parent) {
- if (getCellEditorClass() == null)
- return null;
-
- java.lang.reflect.Constructor constructor = null;
- try {
- constructor = getCellEditorClass().getDeclaredConstructor(new Class[]{Composite.class});
- } catch (NoSuchMethodException nsme) {
- return new TextCellEditor(parent);
- }
- if (constructor != null) {
- try {
- return (CellEditor) constructor.newInstance(new Object[]{parent});
- } catch (InstantiationException ie) {
- } catch (java.lang.reflect.InvocationTargetException ite) {
- } catch (IllegalAccessException iae) {
- }
- }
- return new TextCellEditor(parent);
- }
-
- public void setCellEditorClass(Class newCellEditorClass) {
- cellEditorClass = newCellEditorClass;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java
deleted file mode 100644
index a02a1209e3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java
+++ /dev/null
@@ -1,45 +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.sse.ui.internal.properties;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-public class RemoveAction extends Action {
- private ConfigurablePropertySheetPage fPage;
-
- public RemoveAction(ConfigurablePropertySheetPage page) {
- super();
- fPage = page;
- setText(getText());
- setToolTipText(getText());
- setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_DELETE));
- setDisabledImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_DELETE));
- }
-
- /**
- * @see org.eclipse.jface.action.Action#getText()
- */
- public String getText() {
- return SSEUIMessages.RemoveAction_0; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fPage.remove();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
deleted file mode 100644
index 38b0551b0c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
+++ /dev/null
@@ -1,69 +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.wst.sse.ui.internal.properties;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.ShowViewAction;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-
-/**
- * Surfaces the Properties view
- */
-public class ShowPropertiesAction extends ShowViewAction {
- private final static String VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
- private ISelectionProvider fSelectionProvider;
- private IWorkbenchPart fPart;
-
- public ShowPropertiesAction() {
- super(SSEUIMessages.ShowPropertiesAction_0, EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS)); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IHelpContextIds.CONTMNU_PROPERTIES_HELPID);
- }
-
- public ShowPropertiesAction(IWorkbenchPart part, ISelectionProvider provider) {
- this();
- fSelectionProvider = provider;
- fPart = part;
- }
-
- protected String getViewID() {
- return VIEW_ID;
- }
-
- public void run() {
- super.run();
-
- if (fSelectionProvider != null) {
- IWorkbenchWindow window = SSEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IViewPart findView = page.findView(getViewID());
- if (findView instanceof ISelectionListener && fPart != null) {
- ((ISelectionListener) findView).selectionChanged(fPart, fSelectionProvider.getSelection());
- }
- else {
- findView.getViewSite().getSelectionProvider().setSelection(fSelectionProvider.getSelection());
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java
deleted file mode 100644
index 3eaa30d143..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.provisional.preferences;
-
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-/**
- * Common editor preference keys used by the Structured Text Editor.
- *
- * @plannedfor 1.0
- */
-public class CommonEditorPreferenceNames {
- private CommonEditorPreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * A named preference that controls as-you-type validation
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String EVALUATE_TEMPORARY_PROBLEMS = EditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java
deleted file mode 100644
index e2bf0d49c9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java
+++ /dev/null
@@ -1,33 +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.sse.ui.internal.provisional.registry;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public interface AdapterFactoryProvider {
-
- public void addAdapterFactories(IStructuredModel structuredModel);
-
- // TODO_issue: IDocumentTypeHandler doesn't seem correct in this API.
- // reexamine and see if should be ModelHandler, or ContentTypeIdentifer
- // instead.
- public boolean isFor(IDocumentTypeHandler contentTypeDescription);
-
- /**
- * This method should only add those factories related to embedded content
- * type
- */
- public void reinitializeFactories(IStructuredModel structuredModel);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java
deleted file mode 100644
index 0a04339f39..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java
+++ /dev/null
@@ -1,32 +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.sse.ui.internal.provisional.registry;
-
-import java.util.Iterator;
-
-/**
- * This is basically a "factory for factories". It is to used to associate
- * "edit time" AdapterFactories with a StructuredModel, based on the
- * IStructuredModel's ContentTypeDescription. In plugin.xml files, there
- * should be an AdapterFactoryProvider defined for every definition of
- * ContentTypeDescription.
- */
-public interface AdapterFactoryRegistry {
-
- /**
- * Returns an Iterator over a Collection of AdapterFactoryProviders
- *
- * @return
- */
- public Iterator getAdapterFactories();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java
deleted file mode 100644
index bc47269fd4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal.provisional.registry;
-
-import java.util.Iterator;
-import java.util.List;
-
-public interface AdapterFactoryRegistryExtension {
- Iterator getAdapterFactories(String contentTypeID);
-
- List getAdapterFactoriesAsList(String contentTypeID);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java
deleted file mode 100644
index 78ebf475bc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java
+++ /dev/null
@@ -1,210 +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.sse.ui.internal.provisional.registry;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-public class AdapterFactoryRegistryImpl implements AdapterFactoryRegistry, AdapterFactoryRegistryExtension {
-
- protected final static String ATT_CLASS = "class"; //$NON-NLS-1$
-
- private static AdapterFactoryRegistry instance = null;
-
- static synchronized public AdapterFactoryRegistry getInstance() {
- if (instance == null) {
- instance = new AdapterFactoryRegistryImpl();
- }
- return instance;
- }
-
- // this map exists so there is only one provider
- // instance not duplicate providers for different content types
- private HashMap adapterProviders = null;
-
- private boolean DEBUG = false;
- /**
- * This HashMap contains: [contentTypeId -> element2providerMap] | V
- * [configurationElement -> AdapterFactoryProvider]
- *
- */
- private HashMap hashMap = null;
-
- // providers with no content type associated
- // just added through the add(...) method
- private HashSet unassociatedProviders = null;
-
- private AdapterFactoryRegistryImpl() {
- super();
- this.hashMap = new HashMap();
- this.unassociatedProviders = new HashSet();
- this.adapterProviders = new HashMap();
-
- // doesn't instantiate classes, just stores configuration elements
- AdapterFactoryRegistryReader.readRegistry(hashMap);
- }
-
- void add(AdapterFactoryProvider adapterFactoryProvider) {
- this.unassociatedProviders.add(adapterFactoryProvider);
- }
-
- public Iterator getAdapterFactories() {
- if (DEBUG) {
- System.out.println("===================================================================================="); //$NON-NLS-1$
- System.out.println("GETTING ALL ADAPTER FACTORIES"); //$NON-NLS-1$
- }
-
- List results = new ArrayList();
-
- // add providers that have no content type specification
- results.addAll(this.unassociatedProviders);
- Iterator it = this.hashMap.keySet().iterator();
- String contentTypeId = null;
- while (it.hasNext()) {
- contentTypeId = (String) it.next();
-
- if (DEBUG)
- System.out.println(" + for: " + contentTypeId); //$NON-NLS-1$
-
- results.addAll(getAdapterFactoriesAsList(contentTypeId));
- }
-
- if (DEBUG) {
- System.out.println("===================================================================================="); //$NON-NLS-1$
- }
-
- return results.iterator();
- }
-
- public Iterator getAdapterFactories(String contentTypeID) {
- if (DEBUG) {
- System.out.println("===================================================================================="); //$NON-NLS-1$
- System.out.println("GETTING ADAPTER FACTORIES for: " + contentTypeID); //$NON-NLS-1$
- }
-
- List results = new ArrayList();
-
- // add providers that have no content type specification
- results.addAll(unassociatedProviders);
-
- // add unknown content type providers (for backwards compatability)
- results.addAll(getAdapterFactoriesAsList(AdapterFactoryRegistryReader.UNKNOWN_CONTENT_TYPE));
-
- // add providers for specific content type
- results.addAll(getAdapterFactoriesAsList(Platform.getContentTypeManager().getContentType(contentTypeID)));
-
-
- if (DEBUG) {
- System.out.println("===================================================================================="); //$NON-NLS-1$
- }
-
- return results.iterator();
- }
-
- public List getAdapterFactoriesAsList(IContentType contentType) {
- IContentType type = contentType;
- List results = new ArrayList();
- while (type != null && !type.getId().equals(IContentTypeManager.CT_TEXT)) {
- results.addAll(getAdapterFactoriesAsList(type.getId()));
- type = type.getBaseType();
- }
- return results;
- }
-
- /**
- * Using this new API, only AdapterFactoryProviders for a certain content
- * type are instantiated. This will allow for the minimum number of
- * plugins to be loaded rather than all that implement the adapter factory
- * extension point.
- *
- * @param contentTypeID
- * @return
- */
- public List getAdapterFactoriesAsList(String contentTypeID) {
-
- List results = new ArrayList();
-
- // get element2Provider map for specified content type
- Object o = hashMap.get(contentTypeID);
- if (o != null) {
- // instantiate if necessary from
- // element2adapterFactoryProvider
- // map
- Map element2Provider = (Map) o;
- Iterator it = element2Provider.keySet().iterator();
- IConfigurationElement element = null;
- String classname = null;
- Object existing = null;
- AdapterFactoryProvider p = null;
- while (it.hasNext()) {
- element = (IConfigurationElement) it.next();
- o = element2Provider.get(element);
- if (o != null) {
- // this provider has already been created
- if (DEBUG)
- System.out.println("already created: " + element.getAttribute(ATT_CLASS)); //$NON-NLS-1$
-
- results.add(o);
- }
- else {
- // need to create the provider
- try {
- classname = element.getAttribute(ATT_CLASS);
-
- if (DEBUG)
- System.out.println("about to create: " + classname); //$NON-NLS-1$
-
- // check if we created one already
- existing = this.adapterProviders.get(classname);
- if (existing == null) {
- // this is the only place
- // AdapterFactoryProviders
- // are created
- p = (AdapterFactoryProvider) element.createExecutableExtension(ATT_CLASS); // $NON-NLS-1$
- this.adapterProviders.put(classname, p);
- }
- else {
- p = (AdapterFactoryProvider) existing;
- }
-
- // add to element2Provider for this contentType
- element2Provider.put(element, p);
- // add to results to return for this method
- results.add(p);
-
- }
- catch (CoreException e) {
- // if the provider throws any exception, just log
- // and
- // continue
- Logger.logException(e);
- }
- }
- }
- }
-
- return results;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java
deleted file mode 100644
index 383e5e0b48..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.provisional.registry;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * This class just converts what's in the plugins registry into a form more
- * easily useable by others, the ContentTypeRegistry.
- */
-class AdapterFactoryRegistryReader {
- protected final static String ATT_CLASS = "class"; //$NON-NLS-1$
-
- protected final static String ATT_ID = "id"; //$NON-NLS-1$
-
- private static boolean DEBUG = false;
- protected final static String EXTENSION_POINT_ID = "adapterFactoryDescription"; //$NON-NLS-1$
- //
- protected final static String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
- protected final static String TAG_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
-
- protected final static String TAG_NAME = "adapterFactoryDescription"; //$NON-NLS-1$
-
- public final static String UNKNOWN_CONTENT_TYPE = "unknown"; //$NON-NLS-1$
-
- /**
- * adds configuration element to contentTypeId map [contentTypeId ->
- * element2providerMap] | V [element -> provider]
- *
- * NOTE: this doesn't create the provider yet, that must be done on demand
- * and stored in the appropriate element2provider
- *
- * @param map
- * @param contentTypeId
- * @param element
- */
- private static void addElementForContentType(HashMap map, String contentTypeId, IConfigurationElement element) {
-
- Object o = map.get(contentTypeId);
- if (o == null) {
- HashMap element2provider = new HashMap();
- // don't create the executable extension yet
- element2provider.put(element, null);
- map.put(contentTypeId, element2provider);
-
- if (DEBUG)
- System.out.println("added " + element.getAttribute(ATT_CLASS) + ", but didn't create exec extension"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- // add element to unknown list (not executable ext yet...)
- HashMap element2provider = (HashMap) o;
- element2provider.put(element, null);
-
- if (DEBUG)
- System.out.println("added " + element.getAttribute(ATT_CLASS) + " to unknown list, but didn't create exec extension"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * the map passed in: [contentTypeId -> element2providerMap] | V [element ->
- * provider]
- *
- * @param element
- * @param map
- * @return
- */
- protected static AdapterFactoryProvider readElement(IConfigurationElement element, HashMap map) {
-
- AdapterFactoryProvider adapterFactoryProvider = null;
- if (element.getName().equals(TAG_NAME)) {
- try {
- IConfigurationElement[] children = element.getChildren();
- boolean specifiedContentType = false;
- if (children != null && children.length > 0) {
- // content types are specified
- for (int i = 0; i < children.length; i++) {
- if (children[i].getName().equals(TAG_CONTENT_TYPE)) {
- // it's possible to have non-contentType childrent
- specifiedContentType = true;
- String contentType = children[i].getAttribute(ATT_ID);
- addElementForContentType(map, contentType, element);
- }
- }
- }
- if (!specifiedContentType) {
- // no content type association
- addElementForContentType(map, UNKNOWN_CONTENT_TYPE, element);
- }
- } catch (Exception e) {
- // if the provider throws any exception, just log and continue
- Logger.logException(e);
- }
- }
- return adapterFactoryProvider;
- }
-
- /**
- * We simply require an 'add' method, of what ever it is we are to read
- * into
- */
- static void readRegistry(HashMap map) {
- 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++) {
- readElement(elements[i], map);
- }
- }
- }
-
- protected IConfigurationElement configElement = null;
-
- // protected final static String ADAPTER_CLASS = "adapterClass";
- // //$NON-NLS-1$
- // protected final static String DOC_TYPE_ID = "docTypeId"; //$NON-NLS-1$
- // protected final static String MIME_TYPE_LIST = "mimeTypeList";
- // //$NON-NLS-1$
- //
- /**
- * ContentTypeRegistryReader constructor comment.
- */
- AdapterFactoryRegistryReader() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
deleted file mode 100644
index 2b80125bf4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
+++ /dev/null
@@ -1,405 +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.wst.sse.ui.internal.provisional.style;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.RGB;
-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.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-
-public abstract class AbstractLineStyleProvider {
- private class PropertyChangeListener implements IPropertyChangeListener {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // have to do it this way so others can override the method
- handlePropertyChange(event);
- }
- }
-
- protected IStructuredDocument fDocument;
- protected Highlighter fHighlighter;
- private boolean fInitialized;
- protected PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
-
- //private ISourceViewer fSourceViewer = null;
- protected ReconcilerHighlighter fRecHighlighter = null;
-
- /** Contains all text attributes pertaining to this line style provider */
- private HashMap fTextAttributes = null;
-
- // we keep track of LogMessage to avoid writing hundreds of messages,
- // but still give a hint that something is wrong with attributeProviders
- // and/or regions.
- // It's only written in the case of a program error, but there's no use
- // adding
- // salt to the wound.
- // private boolean wroteOneLogMessage;
- /**
- */
- protected AbstractLineStyleProvider() {
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- protected void addTextAttribute(String colorKey) {
- if (getColorPreferences() != null) {
- String prefString = getColorPreferences().getString(colorKey);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
- boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italic) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
- getTextAttributes().put(colorKey, createTextAttribute);
- }
- }
- }
-
- protected void commonInit(IStructuredDocument document, Highlighter highlighter) {
-
- fDocument = document;
- fHighlighter = highlighter;
- }
-
- /**
- * this version does "trim" regions to match request
- */
- private StyleRange createStyleRange(ITextRegionCollection flatNode, ITextRegion region, TextAttribute attr, int startOffset, int length) {
- int start = flatNode.getStartOffset(region);
- if (start < startOffset)
- start = startOffset;
-
- // Base the text end offset off of the, possibly adjusted, start
- int textEnd = start + region.getTextLength();
- int maxOffset = startOffset + length;
-
- int end = flatNode.getEndOffset(region);
- // Use the end of the text in the region to avoid applying background color to trailing whitespace
- if(textEnd < end)
- end = textEnd;
- // instead of end-start?
- if (end > maxOffset)
- end = maxOffset;
- StyleRange result = new StyleRange(start, end - start, attr.getForeground(), attr.getBackground(), attr.getStyle());
- if((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
- result.strikeout = true;
- }
- if((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
- result.underline = true;
- }
- return result;
-
- }
-
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
- }
-
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
- abstract protected TextAttribute getAttributeFor(ITextRegion region);
-
- protected TextAttribute getAttributeFor(ITextRegionCollection collection, ITextRegion region) {
- return getAttributeFor(region);
- }
-
- abstract protected IPreferenceStore getColorPreferences();
-
- protected IStructuredDocument getDocument() {
- return fDocument;
- }
-
- public void setDocument(IStructuredDocument document) {
- fDocument = document;
- }
-
- /**
- */
- protected Highlighter getHighlighter() {
- return fHighlighter;
- }
-
- /**
- * Returns the hashtable containing all the text attributes for this line
- * style provider. Lazily creates a hashtable if one has not already been
- * created.
- *
- * @return
- */
- protected HashMap getTextAttributes() {
- if (fTextAttributes == null) {
- fTextAttributes = new HashMap();
- loadColors();
- }
- return fTextAttributes;
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- // force a full update of the text viewer
- if(fRecHighlighter != null)
- fRecHighlighter.refreshDisplay();
- }
-
- public void init(IStructuredDocument structuredDocument, Highlighter highlighter) {
-
- commonInit(structuredDocument, highlighter);
-
- if (isInitialized())
- return;
-
- registerPreferenceManager();
-
- setInitialized(true);
- }
-
- public void init(IStructuredDocument structuredDocument, ISourceViewer sourceViewer) {
- init(structuredDocument, (Highlighter) null);
- }
-
- public void init(IStructuredDocument structuredDocument, ReconcilerHighlighter highlighter) {
- fDocument = structuredDocument;
- fRecHighlighter = highlighter;
-
- if(isInitialized())
- return;
-
- registerPreferenceManager();
-
- setInitialized(true);
- }
-
- /**
- * @deprecated - left because it's public, but we aren't adapters any more
- */
- public boolean isAdapterForType(java.lang.Object type) {
- return type == LineStyleProvider.class;
- }
-
- /**
- * Returns the initialized.
- *
- * @return boolean
- */
- public boolean isInitialized() {
- return fInitialized;
- }
-
- abstract protected void loadColors();
-
- public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
- final int partitionStartOffset = typedRegion.getOffset();
- final int partitionLength = typedRegion.getLength();
- IStructuredDocumentRegion structuredDocumentRegion = getDocument().getRegionAtCharacterOffset(partitionStartOffset);
- boolean handled = false;
-
- handled = prepareTextRegions(structuredDocumentRegion, partitionStartOffset, partitionLength, holdResults);
-
- return handled;
- }
-
- /**
- * @param region
- * @param start
- * @param length
- * @param holdResults
- * @return
- */
- private boolean prepareTextRegion(ITextRegionCollection blockedRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
- boolean handled = false;
- final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
- ITextRegion region = null;
- ITextRegionList regions = blockedRegion.getRegions();
- int nRegions = regions.size();
- StyleRange styleRange = null;
- for (int i = 0; i < nRegions; i++) {
- region = regions.get(i);
- TextAttribute attr = null;
- TextAttribute previousAttr = null;
- if (blockedRegion.getStartOffset(region) > partitionEndOffset)
- break;
- if (blockedRegion.getEndOffset(region) <= partitionStartOffset)
- continue;
-
- if (region instanceof ITextRegionCollection) {
- handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
- } else {
-
- attr = getAttributeFor(blockedRegion, region);
- if (attr != null) {
- handled = true;
- // if this region's attr is the same as previous one, then
- // just adjust the previous style range
- // instead of creating a new instance of one
- // note: to use 'equals' in this case is important, since
- // sometimes
- // different instances of attributes are associated with a
- // region, even the
- // the attribute has the same values.
- // TODO: this needs to be improved to handle readonly
- // regions correctly
- if ((styleRange != null) && (previousAttr != null) && (previousAttr.equals(attr))) {
- styleRange.length += region.getLength();
- } else {
- styleRange = createStyleRange(blockedRegion, region, attr, partitionStartOffset, partitionLength);
- holdResults.add(styleRange);
- // technically speaking, we don't need to update
- // previousAttr
- // in the other case, because the other case is when
- // it hasn't changed
- previousAttr = attr;
- }
- } else {
- previousAttr = null;
- }
- }
- }
- return handled;
- }
-
- private boolean prepareTextRegions(IStructuredDocumentRegion structuredDocumentRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
- boolean handled = false;
- final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
- while (structuredDocumentRegion != null && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
- ITextRegion region = null;
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- int nRegions = regions.size();
- StyleRange styleRange = null;
- for (int i = 0; i < nRegions; i++) {
- region = regions.get(i);
- TextAttribute attr = null;
- TextAttribute previousAttr = null;
- if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)
- break;
- if (structuredDocumentRegion.getEndOffset(region) <= partitionStartOffset)
- continue;
-
- if (region instanceof ITextRegionCollection) {
- boolean handledCollection = (prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults));
- handled = (!handled) ? handledCollection : handled;
- } else {
-
- attr = getAttributeFor(structuredDocumentRegion, region);
- if (attr != null) {
- handled = true;
- // if this region's attr is the same as previous one,
- // then just adjust the previous style range
- // instead of creating a new instance of one
- // note: to use 'equals' in this case is important,
- // since sometimes
- // different instances of attributes are associated
- // with a region, even the
- // the attribute has the same values.
- // TODO: this needs to be improved to handle readonly
- // regions correctly
- if ((styleRange != null) && (previousAttr != null) && (previousAttr.equals(attr))) {
- styleRange.length += region.getLength();
- } else {
- styleRange = createStyleRange(structuredDocumentRegion, region, attr, partitionStartOffset, partitionLength);
- holdResults.add(styleRange);
- // technically speaking, we don't need to update
- // previousAttr
- // in the other case, because the other case is
- // when it hasn't changed
- previousAttr = attr;
- }
- } else {
- previousAttr = null;
- }
- }
-
- if (Debug.syntaxHighlighting && !handled) {
- System.out.println("not handled in prepareRegions"); //$NON-NLS-1$
- }
- }
- structuredDocumentRegion = structuredDocumentRegion.getNext();
- }
- return handled;
- }
-
- protected void registerPreferenceManager() {
- IPreferenceStore pref = getColorPreferences();
- if (pref != null) {
- pref.addPropertyChangeListener(fPreferenceListener);
- }
- }
-
- public void release() {
- unRegisterPreferenceManager();
- if (fTextAttributes != null) {
- fTextAttributes.clear();
- fTextAttributes = null;
- }
- setInitialized(false);
- }
-
- /**
- * Sets the initialized.
- *
- * @param initialized
- * The initialized to set
- */
- private void setInitialized(boolean initialized) {
- this.fInitialized = initialized;
- }
-
- protected void unRegisterPreferenceManager() {
- IPreferenceStore pref = getColorPreferences();
- if (pref != null) {
- pref.removePropertyChangeListener(fPreferenceListener);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java
deleted file mode 100644
index a54398bf78..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.style;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.LineStyleEvent;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=224209
- *
- * Created to provide compatibility with refreshDisplay() and getTextViewer()
- * methods on the superclass that might be called by LineStyleProviders.
- */
-public final class CompatibleHighlighter extends Highlighter {
-
- private ITextViewer textViewer;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#addProvider(java.lang.String,
- * org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)
- */
- public void addProvider(String partitionType, LineStyleProvider provider) {
- super.addProvider(partitionType, provider);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#getTextViewer()
- */
- public ITextViewer getTextViewer() {
- return super.getTextViewer();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#install(org.eclipse.jface.text.ITextViewer)
- */
- public void install(ITextViewer newTextViewer) {
- textViewer = newTextViewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#lineGetStyle(int,
- * int)
- */
- public StyleRange[] lineGetStyle(int eventLineOffset, int eventLineLength) {
- return new StyleRange[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent)
- */
- public void lineGetStyle(LineStyleEvent event) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#refreshDisplay()
- */
- public void refreshDisplay() {
- if (textViewer != null)
- textViewer.invalidateTextPresentation();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#refreshDisplay(int,
- * int)
- */
- public void refreshDisplay(int start, int length) {
- refreshDisplay();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#removeProvider(java.lang.String)
- */
- public void removeProvider(String partitionType) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#setDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)
- */
- public void setDocument(IStructuredDocument structuredDocument) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#setDocumentPartitioning(java.lang.String)
- */
- public void setDocumentPartitioning(String partitioning) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#uninstall()
- */
- public void uninstall() {
- super.uninstall();
- textViewer = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java
deleted file mode 100644
index b47107d67c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java
+++ /dev/null
@@ -1,904 +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.sse.ui.internal.provisional.style;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.LineStyleEvent;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * This class is to directly mediate between the Structured Document data
- * structure and the text widget's text and events. It assumes there only the
- * model is interested in text events, and all other views will work from that
- * model. Changes to the text widgets input can cause changes in the model,
- * which in turn cause changes to the widget's display.
- *
- */
-public class Highlighter implements IHighlighter {
-
- /**
- * A utility class to do various color manipulations
- */
- private class YUV_RGBConverter {
- /**
- * This class "holds" the YUV values corresponding to RGB color
- */
- private class YUV {
-
- class NormalizedRGB {
- double blue;
- double green;
- private final double maxRGB = 256.0;
- double red;
-
- public NormalizedRGB(RGB rgb) {
- // first normalize to between 0 - 1
- red = rgb.red / maxRGB;
- green = rgb.green / maxRGB;
- blue = rgb.blue / maxRGB;
-
- red = gammaNormalized(red);
- green = gammaNormalized(green);
- blue = gammaNormalized(blue);
-
- }
- }
-
- private NormalizedRGB normalizedRGB;
-
- private double u = -1;
- private double v = -1;
- private double y = -1;
-
- private YUV() {
- super();
- }
-
- public YUV(double y, double u, double v) {
- this();
- this.y = y;
- this.u = u;
- this.v = v;
- }
-
- public YUV(RGB rgb) {
- this();
- normalizedRGB = new NormalizedRGB(rgb);
- // force calculations
- getY();
- getV();
- getU();
- }
-
- /**
- * normalize to "average" gamma 2.2222 or 1/0.45
- */
- double gammaNormalized(double colorComponent) {
- if (colorComponent < 0.018) {
- return colorComponent * 0.45;
- }
- else {
- return 1.099 * Math.pow(colorComponent, 0.45) - 0.099;
- }
- }
-
- /**
- * @return RGB based on original RGB and current YUV values;
- */
- public RGB getRGB() {
- RGB result = null;
- double r = getY() + 1.14 * getV();
- double g = getY() - 0.395 * getU() - 0.58 * getV();
- double b = getY() + 2.032 * getU();
-
- int red = (int) (inverseGammaNormalized(r) * 256);
- int green = (int) (inverseGammaNormalized(g) * 256);
- int blue = (int) (inverseGammaNormalized(b) * 256);
- if (red < 0)
- red = 0;
- else if (red > 255)
- red = 255;
- if (green < 0)
- green = 0;
- else if (green > 255)
- green = 255;
- if (blue < 0)
- blue = 0;
- else if (blue > 255)
- blue = 255;
-
- result = new RGB(red, green, blue);
- return result;
- }
-
- public double getU() {
- if (u == -1) {
- u = 0.4949 * (normalizedRGB.blue - getY());
- }
- return u;
-
- }
-
- public double getV() {
- if (v == -1) {
- v = 0.877 * (normalizedRGB.red - getY());
- }
- return v;
- }
-
- public double getY() {
- if (y == -1) {
- y = 0.299 * normalizedRGB.red + 0.587 * normalizedRGB.green + 0.114 * normalizedRGB.blue;
- }
- return y;
- }
-
- double inverseGammaNormalized(double colorComponent) {
- if (colorComponent < 0.018) {
- return colorComponent * .222;
- }
- else {
- return Math.pow(((.9099 * colorComponent + 0.09)), 2.22);
- }
- }
-
- }
-
- public YUV_RGBConverter() {
- super();
- }
-
- public double calculateYComponent(Color targetColor) {
- return new YUV(targetColor.getRGB()).getY();
- }
-
- public RGB transformRGB(RGB originalRGB, double scaleFactor, double target) {
- RGB transformedRGB = null;
- // CCIR601 yuv = new CCIR601(originalRGB);
- YUV yuv = new YUV(originalRGB);
- double y = yuv.getY();
- // zero is black, one is white
- if (y < target) {
- // is "dark" make lighter
- y = y + ((target - y) * scaleFactor);
- }
- else {
- // is "light" make darker
- y = y - ((y - target) * scaleFactor);
- }
- // yuv.setY(y);
- YUV newYUV = new YUV(y, yuv.getU(), yuv.getV());
- // CCIR601 newYUV = new CCIR601(y, yuv.getCb601(),
- // yuv.getCr601());
- transformedRGB = newYUV.getRGB();
- return transformedRGB;
- }
-
- public RGB transformRGBToGrey(RGB originalRGB, double scaleFactor, double target) {
- RGB transformedRGB = null;
- // we left the "full" API method signature, but this
- // version does not take into account originalRGB, though
- // it might someday.
- // for now, we'll simply make the new RGB grey, either a little
- // lighter, or a little darker than background.
- double y = 0;
- double mid = 0.5;
- // zero is black, one is white
- if (target < mid) {
- // is "dark" make lighter
- y = target + scaleFactor;
- }
- else {
- // is "light" make darker
- y = target - scaleFactor;
- }
- int c = (int) Math.round(y * 255);
- // just to gaurd against mis-use, or scale's values greater
- // than mid point (and possibly rounding error)
- if (c > 255)
- c = 255;
- if (c < 0)
- c = 0;
- transformedRGB = new RGB(c, c, c);
- return transformedRGB;
- }
- }
-
- private final boolean DEBUG = false;
- private final StyleRange[] EMPTY_STYLE_RANGE = new StyleRange[0];
- static final String LINE_STYLE_PROVIDER_EXTENDED_ID = "linestyleprovider"; //$NON-NLS-1$
- private static final int MAX_NUMBER_STYLES = 500;
- private static final int LEFT_STYLES_SIZE = 200;
- private static final int RIGHT_STYLES_SIZE = 200;
- private static final int MIDDLE_STYLES_SIZE = 1;
-
- private IPropertyChangeListener fForegroundScaleListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE.equals(event.getProperty())) {
- IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
- readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
- disposeColorTable();
- refreshDisplay();
- }
- }
- };
- private List fHoldStyleResults;
- private String fPartitioning = IDocumentExtension3.DEFAULT_PARTITIONING;
-
- private int fSavedLength = -1;
- private int fSavedOffset = -1;
- private StyleRange[] fSavedRanges = null;
-
- private IStructuredDocument fStructuredDocument;
- private Map fTableOfProviders;
-
- private Map fExtendedProviders;
-
- protected final LineStyleProvider NOOP_PROVIDER = new LineStyleProviderForNoOp();
-
- private double readOnlyBackgroundScaleFactor = 10;
- private Hashtable readOnlyColorTable;
- double readOnlyForegroundScaleFactor = 30;
-
- private YUV_RGBConverter rgbConverter;
- private ITextViewer textViewer;
- private StyledText textWidget;
-
- public Highlighter() {
- super();
-
- // in the 'limitSize' method, we make this strong assumption, so, will check here,
- // so if tweaked in future, we'll get a quick reminder.
- if (LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE + RIGHT_STYLES_SIZE > MAX_NUMBER_STYLES) {
- throw new IllegalStateException("Highligher constants are not defined correctly"); //$NON-NLS-1$
- }
- }
-
- protected void addEmptyRange(int start, int length, Collection holdResults) {
- StyleRange result = new StyleRange();
- result.start = start;
- result.length = length;
- holdResults.add(result);
- }
-
- /**
- * Registers a given line style provider for a particular partition type.
- * If there is already a line style provider registered for this type, the
- * new line style provider is registered instead of the old one.
- *
- * @param partitionType
- * the partition type under which to register
- * @param the
- * line style provider to register, or <code>null</code> to
- * remove an existing one
- */
- public void addProvider(String partitionType, LineStyleProvider provider) {
- getTableOfProviders().put(partitionType, provider);
- }
-
- /**
- * Adjust the style ranges' start and length so that they refer to the
- * textviewer widget's range instead of the textviewer's document range.
- *
- * @param ranges
- * @param adjustment
- */
- protected void adjust(StyleRange[] ranges, int adjustment) {
- ITextViewer viewer = getTextViewer();
-
- if (adjustment != 0) {
- // just use the adjustment value
- // convert document regions back to widget regions
- for (int i = 0; i < ranges.length; i++) {
- // just adjust the range using the given adjustment
- ranges[i].start += adjustment;
- }
- }
- else if (viewer instanceof ITextViewerExtension5) {
- // use ITextViewerExtension5
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-
- // convert document regions back to widget regions
- for (int i = 0; i < ranges.length; i++) {
- // get document range, taking into account folding
- // regions in viewer
- IRegion region = extension.modelRange2WidgetRange(new Region(ranges[i].start, ranges[i].length));
- if (region != null) {
- ranges[i].start = region.getOffset();
- ranges[i].length = region.getLength();
- } // else what happens if region is not found?!
- }
- }
- }
-
-
- /**
- * @deprecated - Read Only areas have unchanged background colors
- */
- void adjustBackground(StyleRange styleRange) {
- RGB oldRGB = null;
- Color oldColor = styleRange.background;
- if (oldColor == null) {
- oldColor = getTextWidget().getBackground();
- }
- oldRGB = oldColor.getRGB();
- Color newColor = getCachedColorFor(oldRGB);
- if (newColor == null) {
- double target = getRGBConverter().calculateYComponent(oldColor);
- // if background is "light" make it darker, and vice versa
- if (target < 0.5)
- target = 1.0;
- else
- target = 0.0;
- RGB newRGB = getRGBConverter().transformRGB(oldRGB, readOnlyBackgroundScaleFactor / 100.0, target);
-
- cacheColor(oldRGB, newRGB);
- newColor = getCachedColorFor(oldRGB);
- }
- styleRange.background = newColor;
- }
-
- private void adjustForeground(StyleRange styleRange) {
- RGB oldRGB = null;
- // Color oldColor = styleRange.foreground;
- Color oldColor = styleRange.background;
- if (oldColor == null) {
- // oldRGB = getTextWidget().getForeground().getRGB();
- oldColor = getTextWidget().getBackground();
- oldRGB = oldColor.getRGB();
- }
- else {
- oldRGB = oldColor.getRGB();
- }
- Color newColor = getCachedColorFor(oldRGB);
- if (newColor == null) {
- // make text "closer to" background lumanence
- double target = getRGBConverter().calculateYComponent(oldColor);
- RGB newRGB = getRGBConverter().transformRGBToGrey(oldRGB, readOnlyForegroundScaleFactor / 100.0, target);
-
- // save conversion, so calculations only need to be done once
- cacheColor(oldRGB, newRGB);
- newColor = getCachedColorFor(oldRGB);
- }
- styleRange.foreground = newColor;
- }
-
- /**
- * Cache read-only color.
- *
- * @param oldRGB
- * @param newColor
- */
- private void cacheColor(RGB oldRGB, RGB newColor) {
- if (readOnlyColorTable == null) {
- readOnlyColorTable = new Hashtable();
- }
- readOnlyColorTable.put(oldRGB, newColor);
- }
-
- /**
- * @param result
- * @return
- */
- private StyleRange[] convertReadOnlyRegions(StyleRange[] result, int start, int length) {
- IStructuredDocument structuredDocument = getDocument();
-
- /**
- * (dmw) For client/provider simplicity (and consistent look and feel)
- * we'll handle readonly regions in one spot, here in the Highlighter.
- * Currently it is a fair assumption that each readonly region will be
- * on an ITextRegion boundary, so we combine consecutive styles when
- * found to be equivalent. Plus, for now, we'll just adjust
- * foreground. Eventually will use a "dimming" algrorithm to adjust
- * color's satuation/brightness.
- */
- if (structuredDocument.containsReadOnly(start, length)) {
- // something is read-only in the line, so go through each style,
- // and adjust
- for (int i = 0; i < result.length; i++) {
- StyleRange styleRange = result[i];
- if (structuredDocument.containsReadOnly(styleRange.start, styleRange.length)) {
- adjustForeground(styleRange);
- }
- }
- }
- return result;
- }
-
- /**
- * Clear out the readOnlyColorTable
- */
- void disposeColorTable() {
- if (readOnlyColorTable != null) {
- readOnlyColorTable.clear();
- }
- readOnlyColorTable = null;
- }
-
- /**
- * This method is just to get existing read-only colors.
- */
- private Color getCachedColorFor(RGB oldRGB) {
- Color result = null;
-
- if (readOnlyColorTable != null) {
- RGB readOnlyRGB = (RGB) readOnlyColorTable.get(oldRGB);
- result = EditorUtility.getColor(readOnlyRGB);
- }
-
- return result;
- }
-
- protected IStructuredDocument getDocument() {
- return fStructuredDocument;
- }
-
- /**
- * Adjust the given widget offset and length so that they are the
- * textviewer document's offset and length, taking into account what is
- * actually visible in the document.
- *
- * @param offset
- * @param length
- * @return a region containing the offset and length within the
- * textviewer's document or null if the offset is not within the
- * document
- */
- private IRegion getDocumentRangeFromWidgetRange(int offset, int length) {
- IRegion styleRegion = null;
- ITextViewer viewer = getTextViewer();
- if (viewer instanceof ITextViewerExtension5) {
- // get document range, taking into account folding regions in
- // viewer
- ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
- styleRegion = extension.widgetRange2ModelRange(new Region(offset, length));
- }
- else {
- // get document range, taking into account viewer visible region
- // get visible region in viewer
- IRegion vr = null;
- if (viewer != null)
- vr = viewer.getVisibleRegion();
- else
- vr = new Region(0, getDocument().getLength());
-
- // if offset is not within visible region, then we don't really
- // care
- if (offset <= vr.getLength()) {
- // Adjust the offset to be within visible region
- styleRegion = new Region(offset + vr.getOffset(), length);
- }
- }
- return styleRegion;
- }
-
-
- private Map getExtendedProviders() {
- if (fExtendedProviders == null) {
- fExtendedProviders = new HashMap(3);
- }
- return fExtendedProviders;
- }
-
- /**
- * Method getProviderFor.
- *
- * @param typedRegion
- * @return LineStyleProvider
- */
- private LineStyleProvider getProviderFor(ITypedRegion typedRegion) {
- String type = typedRegion.getType();
- LineStyleProvider result = (LineStyleProvider) fTableOfProviders.get(type);
- if (result == null) {
- // NOT YET FINALIZED - DO NOT CONSIDER AS API
- synchronized (getExtendedProviders()) {
- if (!getExtendedProviders().containsKey(type)) {
- LineStyleProvider provider = (LineStyleProvider) ExtendedConfigurationBuilder.getInstance().getConfiguration(LINE_STYLE_PROVIDER_EXTENDED_ID, type);
- getExtendedProviders().put(type, provider);
- if (provider != null) {
- provider.init(getDocument(), this);
- }
- result = provider;
- }
- else {
- result = (LineStyleProvider) getExtendedProviders().get(type);
- }
- }
- }
- if (result == null) {
- result = NOOP_PROVIDER;
- }
- return result;
- }
-
- private YUV_RGBConverter getRGBConverter() {
- if (rgbConverter == null) {
- rgbConverter = new YUV_RGBConverter();
- }
- return rgbConverter;
- }
-
- private Map getTableOfProviders() {
- if (fTableOfProviders == null) {
- fTableOfProviders = new HashMap();
- }
- return fTableOfProviders;
- }
-
- /**
- * Returns the textViewer.
- *
- * @return ITextViewer
- */
- public ITextViewer getTextViewer() {
- return textViewer;
- }
-
- /**
- * @return
- */
- protected StyledText getTextWidget() {
- return textWidget;
- }
-
- /**
- * Installs highlighter support on the given text viewer.
- *
- * @param textViewer
- * the text viewer on which content assist will work
- */
- public void install(ITextViewer newTextViewer) {
- this.textViewer = newTextViewer;
-
- IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
- editorStore.addPropertyChangeListener(fForegroundScaleListener);
- readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
-
- if (textWidget != null) {
- textWidget.removeLineStyleListener(this);
- }
- textWidget = newTextViewer.getTextWidget();
- if (textWidget != null) {
- textWidget.addLineStyleListener(this);
- }
-
- refreshDisplay();
- }
-
- public StyleRange[] lineGetStyle(int eventLineOffset, int eventLineLength) {
- StyleRange[] eventStyles = EMPTY_STYLE_RANGE;
- try {
- if (getDocument() == null || eventLineLength == 0) {
- // getDocument() == null
- // during initialization, this is sometimes called before our
- // structured
- // is set, in which case we set styles to be the empty style
- // range
- // (event.styles can not be null)
-
- // eventLineLength == 0
- // we sometimes get odd requests from the very last CRLF in
- // the
- // document
- // it has no length, and there is no node for it!
- eventStyles = EMPTY_STYLE_RANGE;
- }
- else {
- /*
- * LineStyleProviders work using absolute document offsets. To
- * support visible regions, adjust the requested range up to
- * the full document offsets.
- */
- IRegion styleRegion = getDocumentRangeFromWidgetRange(eventLineOffset, eventLineLength);
- if (styleRegion != null) {
- int start = styleRegion.getOffset();
- int length = styleRegion.getLength();
-
- ITypedRegion[] partitions = TextUtilities.computePartitioning(getDocument(), fPartitioning, start, length, false);
- eventStyles = prepareStyleRangesArray(partitions, start, length);
-
- /*
- * If there is a subtext offset, the style ranges must be
- * adjusted to the expected offsets just check if
- * eventLineOffset is different than start then adjust,
- * otherwise u can leave it alone unless there is special
- * handling for itextviewerextension5?
- */
- if (start != eventLineOffset) {
- int offset = 0;
- // figure out visible region to use for adjustment
- // only adjust if need to
- if (!(getTextViewer() instanceof ITextViewerExtension5)) {
- IRegion vr = getTextViewer().getVisibleRegion();
- if (vr != null) {
- offset = vr.getOffset();
- }
- }
- adjust(eventStyles, -offset);
- }
-
- eventStyles = limitSize(eventStyles);
-
- // for debugging only
- if (DEBUG) {
- if (!valid(eventStyles, eventLineOffset, eventLineLength)) {
- Logger.log(Logger.WARNING, "Highlighter::lineGetStyle found invalid styles at offset " + eventLineOffset); //$NON-NLS-1$
- }
- }
- }
-
- }
-
- }
- catch (Exception e) {
- // if ANY exception occurs during highlighting,
- // just return "no highlighting"
- eventStyles = EMPTY_STYLE_RANGE;
- if (Debug.syntaxHighlighting) {
- System.out.println("Exception during highlighting!"); //$NON-NLS-1$
- }
- }
-
- return eventStyles;
- }
-
- /**
- * This method is to centralize the logic in limiting the overall number of style ranges
- * that make it to the styled text widget.
- *
- * Too many styles sent to StyledText results in apparent, but not real,
- * hangs of Eclipse Display thread. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=108806
- *
- * @param eventStyles
- * @return
- */
- private StyleRange[] limitSize(StyleRange[] eventStyles) {
-
- // quick return with same object if not modification needed
- if (eventStyles.length < MAX_NUMBER_STYLES) {
- return eventStyles;
- }
- else {
- // we could just take the easy way out and truncate, but will
- // be much better appearing if both the start of the line and the
- // end of the line are displayed with styles. Since these are both
- // the parts of the line a user is likely to look at. The middle of the
- // line will still be "plain". Presumably, the user would re-format the
- // file to avoid long lines, so unlikely to see the middle.
- StyleRange[] newRanges = new StyleRange[LEFT_STYLES_SIZE + RIGHT_STYLES_SIZE + MIDDLE_STYLES_SIZE];
- System.arraycopy(eventStyles, 0, newRanges, 0, LEFT_STYLES_SIZE);
- //
- // do end, before we do middle
- System.arraycopy(eventStyles, eventStyles.length-RIGHT_STYLES_SIZE, newRanges, LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE, RIGHT_STYLES_SIZE);
- //
- // technically, we should compute the exact middle as one big style range,
- // with default colors and styles, so if someone does actually type or work with
- // documnet as is, will still be correct.
- //
- StyleRange allBlank = new StyleRange();
- StyleRange lastKnown = newRanges[LEFT_STYLES_SIZE - 1];
- allBlank.start = lastKnown.start + lastKnown.length;
- StyleRange nextKnown = newRanges[LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE + 1];
- allBlank.length = nextKnown.start - allBlank.start;
- newRanges[LEFT_STYLES_SIZE] = allBlank;
- return newRanges;
- }
- }
-
- /**
- * A passthrough method that extracts relevant data from the
- * LineStyleEvent and passes it along. This method was separated for
- * performance testing purposes.
- *
- * @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(LineStyleEvent)
- */
- public void lineGetStyle(LineStyleEvent event) {
- int offset = event.lineOffset;
- int length = event.lineText.length();
-
- /*
- * For some reason, we are sometimes asked for the same style range
- * over and over again. This was found to happen during 'revert' of a
- * file with one line in it that is 40K long! So, while we don't know
- * root cause, caching the styled ranges in case the exact same
- * request is made multiple times seems like cheap insurance.
- */
- if (offset == fSavedOffset && length == fSavedLength && fSavedRanges != null) {
- event.styles = fSavedRanges;
- }
- else {
- // need to assign this array here, or else the field won't get
- // updated
- event.styles = lineGetStyle(offset, length);
- // now saved "cached data" for repeated requests which are exaclty
- // same
- fSavedOffset = offset;
- fSavedLength = length;
- fSavedRanges = event.styles;
- }
- }
-
- /**
- * Note: its very important this method never return null, which is why
- * the final null check is in a finally clause
- */
-
- protected StyleRange[] prepareStyleRangesArray(ITypedRegion[] partitions, int start, int length) {
-
- StyleRange[] result = EMPTY_STYLE_RANGE;
-
- if (fHoldStyleResults == null) {
- fHoldStyleResults = new ArrayList(partitions.length);
- }
- else {
- fHoldStyleResults.clear();
- }
-
- // TODO: make some of these instance variables to prevent creation on
- // stack
- LineStyleProvider currentLineStyleProvider = null;
- boolean handled = false;
- for (int i = 0; i < partitions.length; i++) {
- ITypedRegion currentPartition = partitions[i];
- currentLineStyleProvider = getProviderFor(currentPartition);
- currentLineStyleProvider.init(getDocument(), this);
- handled = currentLineStyleProvider.prepareRegions(currentPartition, currentPartition.getOffset(), currentPartition.getLength(), fHoldStyleResults);
- if (Debug.syntaxHighlighting && !handled) {
- System.out.println("Did not handle highlighting in Highlighter inner while"); //$NON-NLS-1$
- }
- }
-
- int resultSize = fHoldStyleResults.size();
- if (resultSize > 0) {
- result = (StyleRange[]) fHoldStyleResults.toArray(new StyleRange[fHoldStyleResults.size()]);
- }
- else {
- result = EMPTY_STYLE_RANGE;
- }
- result = convertReadOnlyRegions(result, start, length);
- return result;
- }
-
- public void refreshDisplay() {
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.redraw();
- }
-
- /**
- */
- public void refreshDisplay(int start, int length) {
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.redrawRange(start, length, true);
- }
-
- public void removeProvider(String partitionType) {
- getTableOfProviders().remove(partitionType);
- }
-
- public void setDocument(IStructuredDocument structuredDocument) {
- fStructuredDocument = structuredDocument;
- }
-
- public void setDocumentPartitioning(String partitioning) {
- if (partitioning != null) {
- fPartitioning = partitioning;
- }
- else {
- fPartitioning = IDocumentExtension3.DEFAULT_PARTITIONING;
- }
- }
-
- /**
- * Uninstalls highlighter support from the text viewer it has previously
- * be installed on.
- */
- public void uninstall() {
- if (textWidget != null && !textWidget.isDisposed()) {
- textWidget.removeLineStyleListener(this);
- }
- textWidget = null;
-
- Collection providers = getTableOfProviders().values();
- Iterator iterator = providers.iterator();
- while (iterator.hasNext()) {
- LineStyleProvider lineStyleProvider = (LineStyleProvider) iterator.next();
- lineStyleProvider.release();
- // this remove probably isn't strictly needed, since
- // typically highlighter instance as a whole will go
- // away ... but in case that ever changes, this seems like
- // a better style.
- iterator.remove();
- }
-
- synchronized (getExtendedProviders()) {
- providers = new ArrayList(getExtendedProviders().values());
- getExtendedProviders().clear();
- }
- iterator = providers.iterator();
- while (iterator.hasNext()) {
- LineStyleProvider lineStyleProvider = (LineStyleProvider) iterator.next();
- if (lineStyleProvider != null) {
- lineStyleProvider.release();
- iterator.remove();
- }
- }
-
- IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
- editorStore.removePropertyChangeListener(fForegroundScaleListener);
- disposeColorTable();
-
- // clear out cached variables (d282894)
- fSavedOffset = -1;
- fSavedLength = -1;
- fSavedRanges = null;
- }
-
- /**
- * Purely a debugging aide.
- */
- private boolean valid(StyleRange[] eventStyles, int startOffset, int lineLength) {
- boolean result = false;
- if (eventStyles != null) {
- if (eventStyles.length > 0) {
- StyleRange first = eventStyles[0];
- StyleRange last = eventStyles[eventStyles.length - 1];
- if (startOffset > first.start) {
- result = false;
- }
- else {
- int lineEndOffset = startOffset + lineLength;
- int lastOffset = last.start + last.length;
- if (lastOffset > lineEndOffset) {
- result = false;
- }
- else {
- result = true;
- }
- }
- }
- else {
- // a zero length array is ok
- result = true;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java
deleted file mode 100644
index caf37d0b22..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java
+++ /dev/null
@@ -1,34 +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.sse.ui.internal.provisional.style;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.LineStyleListener;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * @author davidw
- *
- */
-public interface IHighlighter extends LineStyleListener {
- void addProvider(String partitionType, LineStyleProvider provider);
-
- void install(ITextViewer viewer);
-
- void removeProvider(String partitionType);
-
- void setDocument(IStructuredDocument structuredDocument);
-
- void uninstall();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
deleted file mode 100644
index ff81827d98..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
+++ /dev/null
@@ -1,59 +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.wst.sse.ui.internal.provisional.style;
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This interface is not intended to be implemented by clients. Clients
- * should instead subclass AbstractLineStyleProvider
- *
- */
-public interface LineStyleProvider {
-
- /**
- * Initializes this provider for the given Highlighter and document. This
- * method will be called at least once before prepareRegions is called.
- *
- * @param document
- * @param highlighter
- */
- void init(IStructuredDocument document, Highlighter highlighter);
-
- /**
- * Optionally appends StyleRanges to the styleRanges Collection, in order,
- * and only covering the given range within the document. StyleRanges added
- * to the collection should not expand outside of the range of the currentRegion
- * ITypedRegion.
- *
- * @param currentRegion -
- * the current document partition
- * @param start
- * @param length
- * @param styleRanges
- * @return whether this LineStyleProvider handled the request; handling
- * includes not adding StyleRanges if that is still the correct
- * behavior
- */
- boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection styleRanges);
-
- /**
- * Instructs this provider to free up any "resources" it might be holding
- * on to (such as listening for preference changes). It is only called
- * once in the lifetime of this provider.
- */
- void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java
deleted file mode 100644
index 3d609293be..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java
+++ /dev/null
@@ -1,48 +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.sse.ui.internal.provisional.style;
-
-
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This class can be used by default, if no attribute provider is found for a
- * certain region type. Its probably an error in a factory somewhere if an
- * adapter is not found, but this class allows the logic to proceed basically
- * simply providing default colored syntax highlighting.
- *
- * Not to be subclassed.
- */
-final public class LineStyleProviderForNoOp implements LineStyleProvider {
-
- public void init(IStructuredDocument document, Highlighter highlighter) {
- // nothing to do
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider#prepareRegions(org.eclipse.jface.text.ITypedRegion,
- * int, int, java.util.Collection)
- */
- public boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection holdResults) {
- // add nothing, but say handled.
- return true;
- }
-
- public void release() {
- // nothing to do
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java
deleted file mode 100644
index 1a39d4b7ae..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.provisional.style;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-public class ReconcilerHighlighter {
-
- private static final String LINE_STYLE_PROVIDER_EXTENDED_ID = Highlighter.LINE_STYLE_PROVIDER_EXTENDED_ID;
-
- private Map fTableOfProviders = null;
-
- private Map fExtendedProviders = null;
-
- private ITextViewer fTextViewer = null;
-
- private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler")).booleanValue(); //$NON-NLS-1$
- private final static String TRACE_PREFIX = "StructuredPresentationReconciler: "; //$NON-NLS-1$
- private long time0;
-
- /**
- * instance for older LineStyleProviders loaded by extension point,
- * created if needed
- */
- private CompatibleHighlighter fCompatibleHighlighter = null;
-
- public void refreshDisplay() {
- if (_trace) {
- time0 = System.currentTimeMillis();
- }
- if (fTextViewer != null)
- fTextViewer.invalidateTextPresentation();
- if (_trace) {
- System.out.println(TRACE_PREFIX + "ReconcilerHighlighter refreshDisplay took " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- /**
- * Registers a given line style provider for a particular partition type.
- * If there is already a line style provider registered for this type, the
- * new line style provider is registered instead of the old one.
- *
- * @param partitionType
- * the partition type under which to register
- * @param the
- * line style provider to register, or <code>null</code> to
- * remove an existing one
- */
- public void addProvider(String partitionType, LineStyleProvider provider) {
- getTableOfProviders().put(partitionType, provider);
- }
-
- public void removeProvider(String partitionType) {
- getTableOfProviders().remove(partitionType);
- }
-
- public LineStyleProvider getProvider(String partitionType) {
- LineStyleProvider result = (LineStyleProvider) getTableOfProviders().get(partitionType);
-
- // The provider was not within the default set of providers. Use the
- // extended configuration
- // to look up additional providers
- if (result == null) {
- // NOT YET FINALIZED - DO NOT CONSIDER AS API
- synchronized (getExtendedProviders()) {
- if (!getExtendedProviders().containsKey(partitionType)) {
- result = (LineStyleProvider) ExtendedConfigurationBuilder.getInstance().getConfiguration(LINE_STYLE_PROVIDER_EXTENDED_ID, partitionType);
- getExtendedProviders().put(partitionType, result);
-
- if (result != null && fTextViewer != null && fTextViewer.getDocument() instanceof IStructuredDocument) {
- if (result instanceof AbstractLineStyleProvider) {
- ((AbstractLineStyleProvider) result).init((IStructuredDocument) fTextViewer.getDocument(), this);
- }
- else {
- Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + result.getClass()); //$NON-NLS-1$
- if (fCompatibleHighlighter == null) {
- fCompatibleHighlighter = new CompatibleHighlighter();
- fCompatibleHighlighter.install(fTextViewer);
- }
- result.init((IStructuredDocument) fTextViewer.getDocument(), fCompatibleHighlighter);
- }
- }
- }
- else {
- result = (LineStyleProvider) getExtendedProviders().get(partitionType);
- }
- }
- }
- return result;
- }
-
- private Map getTableOfProviders() {
- if (fTableOfProviders == null) {
- fTableOfProviders = new HashMap();
- }
- return fTableOfProviders;
- }
-
- private Map getExtendedProviders() {
- if (fExtendedProviders == null) {
- fExtendedProviders = new HashMap(3);
- }
- return fExtendedProviders;
- }
-
- public void install(ITextViewer textViewer) {
- fTextViewer = textViewer;
- if (fCompatibleHighlighter != null) {
- fCompatibleHighlighter.uninstall();
- fCompatibleHighlighter.install(fTextViewer);
- }
- refreshDisplay();
- }
-
- public void uninstall() {
- Iterator it = getTableOfProviders().values().iterator();
-
- while (it.hasNext()) {
- LineStyleProvider provider = (LineStyleProvider) it.next();
- if (provider != null)
- provider.release();
- }
-
- it = getExtendedProviders().values().iterator();
- while (it.hasNext()) {
- LineStyleProvider provider = (LineStyleProvider) it.next();
- if (provider != null)
- provider.release();
- }
-
- getTableOfProviders().clear();
- getExtendedProviders().clear();
- fTableOfProviders = null;
- if (fCompatibleHighlighter != null) {
- fCompatibleHighlighter.uninstall();
- }
- fTextViewer = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java
deleted file mode 100644
index 1001ad5b9c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java
+++ /dev/null
@@ -1,934 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.sse.ui.internal.provisional.style;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.DocumentPartitioningChangedEvent;
-import org.eclipse.jface.text.DocumentRewriteSessionEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension2;
-import org.eclipse.jface.text.IDocumentRewriteSessionListener;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextEvent;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedPosition;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.IPresentationReconcilerExtension;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-public class StructuredPresentationReconciler implements IPresentationReconciler, IPresentationReconcilerExtension {
-
- /** Prefix of the name of the position category for tracking damage regions. */
- final static String TRACKED_PARTITION= "__reconciler_tracked_partition"; //$NON-NLS-1$
-
- private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler")).booleanValue(); //$NON-NLS-1$
- private final static boolean _traceTime = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler/time")).booleanValue(); //$NON-NLS-1$
- private static final String TRACE_PREFIX = "StructuredPresentationReconciler: ";
- private long time0;
- private long time1;
-
- /**
- * Internal listener class.
- */
- class InternalListener implements
- ITextInputListener, IDocumentListener, ITextListener, IStructuredDocumentListener,
- IDocumentPartitioningListener, IDocumentPartitioningListenerExtension, IDocumentPartitioningListenerExtension2, IDocumentRewriteSessionListener {
-
- /** Set to <code>true</code> if between a document about to be changed and a changed event. */
- private boolean fDocumentChanging= false;
-
- /** Flag for the document being in a rewrite session */
- private boolean fInRewriteSession = false;
-
- /** Flag for some kind of changes being applied during a document rewrite session */
- private boolean fHasIncomingChanges = false;
-
- /**
- * The cached redraw state of the text viewer.
- * @since 3.0
- */
- private boolean fCachedRedrawState= true;
-
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- if (_trace) {
- time1 = System.currentTimeMillis();
- }
- int length = structuredDocumentEvent.getLength();
- recordDamage(new Region(0, length), structuredDocumentEvent.getDocument());
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "calculated damage for NewDocumentEvent: (length=" + length + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "calculated damage for NewDocumentEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- if (_trace) {
- time1 = System.currentTimeMillis();
- }
- if (structuredDocumentEvent.reason == NoChangeEvent.NO_CONTENT_CHANGE ) {
- IRegion damage = new Region(structuredDocumentEvent.fOffset, structuredDocumentEvent.fLength);
- recordDamage(damage, structuredDocumentEvent.fDocument);
- }
- if (_trace && _traceTime) {
- System.out.println("\n" + TRACE_PREFIX + "calculated damage for NoChangeEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- if (_trace) {
- time1 = System.currentTimeMillis();
- }
- IRegion damage;
- IStructuredDocumentRegionList newDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
- if (newDocumentRegions.getLength() > 0) {
- int startOffset = newDocumentRegions.item(0).getStartOffset();
- int length = newDocumentRegions.item(newDocumentRegions.getLength() - 1).getEndOffset() - startOffset;
- damage = new Region(startOffset, length);
-
- }
- else {
- damage = new Region(structuredDocumentEvent.fOffset, structuredDocumentEvent.getLength());
- }
- recordDamage(damage, structuredDocumentEvent.fDocument);
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "calculated damage for StructuredDocumentRegionsReplacedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
- System.out.flush();
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "calculated damage for StructuredDocumentRegionsReplacedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- if (_trace) {
- time1 = System.currentTimeMillis();
- }
- IStructuredDocumentRegion documentRegion = structuredDocumentEvent.getStructuredDocumentRegion();
- ITextRegion changedRegion = structuredDocumentEvent.getRegion();
- int startOffset = documentRegion.getStartOffset(changedRegion);
- int length = changedRegion.getLength();
- IRegion damage = new Region(startOffset, length);
-
- recordDamage(damage, structuredDocumentEvent.fDocument);
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "calculated damage for RegionChangedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
- System.out.flush();
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "calculated damage for RegionChangedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- if (_trace) {
- time1 = System.currentTimeMillis();
- }
- IRegion damage;
- IStructuredDocumentRegion documentRegion = structuredDocumentEvent.getStructuredDocumentRegion();
- ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
- if (newRegions.size() > 0) {
- ITextRegion firstChangedRegion = newRegions.get(0);
- ITextRegion lastChangedRegion = newRegions.get(newRegions.size() - 1);
- int startOffset = documentRegion.getStartOffset(firstChangedRegion);
- int length = documentRegion.getEndOffset(lastChangedRegion) - startOffset;
- damage = new Region(startOffset, length);
- }
- else {
- damage = new Region(documentRegion.getStartOffset(), documentRegion.getLength());
- }
- recordDamage(damage, structuredDocumentEvent.fDocument);
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "calculated damage for RegionsReplacedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
- System.out.flush();
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "calculated damage for RegionsReplacedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- /*
- * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument)
- */
- public void inputDocumentAboutToBeChanged(IDocument oldDocument, IDocument newDocument) {
- if (oldDocument != null) {
- try {
-
- fViewer.removeTextListener(this);
- oldDocument.removeDocumentListener(this);
- oldDocument.removeDocumentPartitioningListener(this);
- if (oldDocument instanceof IStructuredDocument) {
- ((IStructuredDocument) oldDocument).removeDocumentChangedListener(this);
- }
-
- oldDocument.removePositionUpdater(fPositionUpdater);
- oldDocument.removePositionCategory(fPositionCategory);
-
- } catch (BadPositionCategoryException x) {
- // should not happened for former input documents;
- }
- }
- }
-
- /*
- * @see ITextInputListener#inputDocumenChanged(IDocument, IDocument)
- */
- public void inputDocumentChanged(IDocument oldDocument, IDocument newDocument) {
- if (_trace || _traceTime) {
- time1 = System.currentTimeMillis();
- }
-
- fDocumentChanging= false;
- fCachedRedrawState= true;
-
- if (newDocument != null) {
- newDocument.addPositionCategory(fPositionCategory);
- newDocument.addPositionUpdater(fPositionUpdater);
-
- if (newDocument instanceof IStructuredDocument) {
- newDocument.addDocumentPartitioningListener(this);
- newDocument.addDocumentListener(this);
- ((IStructuredDocument)newDocument).addDocumentChangedListener(this);
- }
- fViewer.addTextListener(this);
-
- if (newDocument instanceof IStructuredDocument) {
- setDocumentToDamagers(newDocument);
- setDocumentToRepairers(newDocument);
- processDamage(new Region(0, newDocument.getLength()), newDocument);
- }
- }
- if (_trace) {
- System.out.println(TRACE_PREFIX + "processed damage for inputDocumentChanged in " + (System.currentTimeMillis() - time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /*
- * @see IDocumentPartitioningListener#documentPartitioningChanged(IDocument)
- */
- public void documentPartitioningChanged(IDocument document) {
- if (_traceTime) {
- time0 = System.currentTimeMillis();
- }
- if (!fDocumentChanging && fCachedRedrawState)
- processDamage(new Region(0, document.getLength()), document);
- else
- fDocumentPartitioningChanged= true;
- if (_trace) {
- System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged [full document]"); //$NON-NLS-1$
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /*
- * @see IDocumentPartitioningListenerExtension#documentPartitioningChanged(IDocument, IRegion)
- * @since 2.0
- */
- public void documentPartitioningChanged(IDocument document, IRegion changedRegion) {
- if (_traceTime) {
- time0 = System.currentTimeMillis();
- }
- if (!fDocumentChanging && fCachedRedrawState) {
- processDamage(new Region(changedRegion.getOffset(), changedRegion.getLength()), document);
- } else {
- fDocumentPartitioningChanged= true;
- fChangedDocumentPartitions= changedRegion;
- }
- if (_trace) {
- System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged [" + changedRegion.getOffset() + ":" + changedRegion.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentPartitioningListenerExtension2#documentPartitioningChanged(org.eclipse.jface.text.DocumentPartitioningChangedEvent)
- * @since 3.0
- */
- public void documentPartitioningChanged(DocumentPartitioningChangedEvent event) {
- IRegion changedRegion= event.getChangedRegion(getDocumentPartitioning());
- if (changedRegion != null)
- documentPartitioningChanged(event.getDocument(), changedRegion);
- }
-
- /*
- * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent e) {
-
- fDocumentChanging= true;
- if (fCachedRedrawState) {
- try {
- int offset= e.getOffset() + e.getLength();
- ITypedRegion region= getPartition(e.getDocument(), offset);
- fRememberedPosition= new TypedPosition(region);
- e.getDocument().addPosition(fPositionCategory, fRememberedPosition);
- } catch (BadLocationException x) {
- // can not happen
- } catch (BadPositionCategoryException x) {
- // should not happen on input elements
- }
- }
- }
-
- /*
- * @see IDocumentListener#documentChanged(DocumentEvent)
- */
- public void documentChanged(DocumentEvent e) {
- if (fCachedRedrawState) {
- try {
- e.getDocument().removePosition(fPositionCategory, fRememberedPosition);
- } catch (BadPositionCategoryException x) {
- // can not happen on input documents
- }
- }
- fDocumentChanging= false;
- }
-
- /*
- * @see ITextListener#textChanged(TextEvent)
- */
- public void textChanged(TextEvent e) {
- if(fInRewriteSession) {
- fHasIncomingChanges = true;
- return;
- }
- fCachedRedrawState= e.getViewerRedrawState();
- if (!fCachedRedrawState) {
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "returned early from textChanged(TextEvent)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return;
- }
- if (_trace) {
- System.out.println("\n" + TRACE_PREFIX + "entering textChanged(TextEvent)"); //$NON-NLS-1$ //$NON-NLS-2$
- time0 = System.currentTimeMillis();
- }
-
- IRegion damage= null;
- IDocument document= null;
-
- if (e.getDocumentEvent() == null) {
- document= fViewer.getDocument();
- if (document != null) {
- if (e.getOffset() == 0 && e.getLength() == 0 && e.getText() == null) {
- // redraw state change, damage the whole document
- damage= new Region(0, document.getLength());
- } else {
- IRegion region= widgetRegion2ModelRegion(e);
- try {
- String text= document.get(region.getOffset(), region.getLength());
- DocumentEvent de= new DocumentEvent(document, region.getOffset(), region.getLength(), text);
- damage= getDamage(de, false);
- } catch (BadLocationException x) {
- /* ignored in platform PresentationReconciler, too */
- }
- }
- }
- } else {
- DocumentEvent de= e.getDocumentEvent();
- document= de.getDocument();
- damage= getDamage(de, true);
- }
- if(_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "calculated simple text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
-
- boolean damageOverlaps = processRecordedDamages(damage, document);
- if(_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "processed recorded structured text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (damage != null && document != null && !damageOverlaps) {
- processDamage(damage, document);
- if(_trace && _traceTime) {
- System.out.println(TRACE_PREFIX + "processed simple text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.flush();
- }
- }
-
- fDocumentPartitioningChanged= false;
- fChangedDocumentPartitions= null;
- if(_trace) {
- System.out.println(TRACE_PREFIX + "finished textChanged(TextEvent) in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Translates the given text event into the corresponding range of the viewer's document.
- *
- * @param e the text event
- * @return the widget region corresponding the region of the given event
- * @since 2.1
- */
- protected IRegion widgetRegion2ModelRegion(TextEvent e) {
-
- String text= e.getText();
- int length= text == null ? 0 : text.length();
-
- if (fViewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension= (ITextViewerExtension5) fViewer;
- return extension.widgetRange2ModelRange(new Region(e.getOffset(), length));
- }
-
- IRegion visible= fViewer.getVisibleRegion();
- IRegion region= new Region(e.getOffset() + visible.getOffset(), length);
- return region;
- }
-
- public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
- fInRewriteSession = (event != null && event.fChangeType == DocumentRewriteSessionEvent.SESSION_START);
- if(!fInRewriteSession && fHasIncomingChanges && event != null) {
- if (_trace)
- time0 = System.currentTimeMillis();
- processDamage(new Region(0, event.fDocument.getLength()), event.fDocument);
- if(_trace && _traceTime)
- System.out.println(TRACE_PREFIX + " processed damaged after ending document rewrite session at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- fHasIncomingChanges = false;
- }
- }
-
- }
-
- private static class RecordedDamage {
- IRegion damage;
- IDocument document;
- RecordedDamage(IRegion damage, IDocument document) {
- this.damage = damage;
- this.document = document;
- }
- }
-
- /** The map of presentation damagers. */
- private Map fDamagers;
- /** The map of presentation repairers. */
- private Map fRepairers;
- /** The target viewer. */
- private ITextViewer fViewer;
- /** The internal listener. */
- private InternalListener fInternalListener= new InternalListener();
- /** The name of the position category to track damage regions. */
- private String fPositionCategory;
- /** The position updated for the damage regions' position category. */
- private IPositionUpdater fPositionUpdater;
- /** The positions representing the damage regions. */
- private TypedPosition fRememberedPosition;
- /** Flag indicating the receipt of a partitioning changed notification. */
- private boolean fDocumentPartitioningChanged= false;
- /** The range covering the changed partitioning. */
- private IRegion fChangedDocumentPartitions= null;
-
- /**
- * Because structured document events fire before textChanged(), it's
- * possible the widget isn't fully aware of the changes to its contents.
- * "Record" the damage to process after textChanged() has been fired.
- */
- private List fRecordedDamages = new ArrayList(2);
-
- /**
- * The partitioning used by this presentation reconciler.
- * @since 3.0
- */
- private String fPartitioning;
-
- private IDocument fLastDocument;
-
- /**
- * Creates a new presentation reconciler. There are no damagers or repairers
- * registered with this reconciler by default. The default partitioning
- * <code>IDocumentExtension3.DEFAULT_PARTITIONING</code> is used.
- */
- public StructuredPresentationReconciler() {
- super();
- fPartitioning= IDocumentExtension3.DEFAULT_PARTITIONING;
- fPositionCategory= TRACKED_PARTITION + hashCode();
- fPositionUpdater= new DefaultPositionUpdater(fPositionCategory);
- }
-
- /**
- * Sets the document partitioning for this presentation reconciler.
- *
- * @param partitioning the document partitioning for this presentation reconciler.
- * @since 3.0
- */
- public void setDocumentPartitioning(String partitioning) {
- Assert.isNotNull(partitioning);
- fPartitioning= partitioning;
- }
-
- /*
- * @see org.eclipse.jface.text.presentation.IPresentationReconcilerExtension#geDocumenttPartitioning()
- * @since 3.0
- */
- public String getDocumentPartitioning() {
- return fPartitioning;
- }
-
- /**
- * Registers the given presentation damager for a particular content type.
- * If there is already a damager registered for this type, the old damager
- * is removed first.
- *
- * @param damager the presentation damager to register, or <code>null</code> to remove an existing one
- * @param contentType the content type under which to register
- */
- public void setDamager(IPresentationDamager damager, String contentType) {
-
- Assert.isNotNull(contentType);
-
- if (fDamagers == null)
- fDamagers= new HashMap();
-
- if (damager == null)
- fDamagers.remove(contentType);
- else
- fDamagers.put(contentType, damager);
- }
-
- /**
- * Registers the given presentation repairer for a particular content type.
- * If there is already a repairer registered for this type, the old repairer
- * is removed first.
- *
- * @param repairer the presentation repairer to register, or <code>null</code> to remove an existing one
- * @param contentType the content type under which to register
- */
- public void setRepairer(IPresentationRepairer repairer, String contentType) {
-
- Assert.isNotNull(contentType);
-
- if (fRepairers == null)
- fRepairers= new HashMap();
-
- if (repairer == null)
- fRepairers.remove(contentType);
- else
- fRepairers.put(contentType, repairer);
- }
-
- /*
- * @see IPresentationReconciler#install(ITextViewer)
- */
- public void install(ITextViewer viewer) {
- if(_trace) {
- time0 = System.currentTimeMillis();
- }
- Assert.isNotNull(viewer);
-
- fViewer= viewer;
- fViewer.addTextInputListener(fInternalListener);
-
- IDocument document= viewer.getDocument();
- if (document != null) {
- fInternalListener.inputDocumentChanged(null, document);
- if(document instanceof IStructuredDocument) {
- ((IStructuredDocument) document).addDocumentChangedListener(fInternalListener);
- }
- if(document instanceof IDocumentExtension4) {
- ((IDocumentExtension4) document).addDocumentRewriteSessionListener(fInternalListener);
- }
- }
- if(_trace) {
- System.out.println(TRACE_PREFIX + "installed to text viewer in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /*
- * @see IPresentationReconciler#uninstall()
- */
- public void uninstall() {
- if(_trace) {
- time0 = System.currentTimeMillis();
- }
- fViewer.removeTextInputListener(fInternalListener);
-
- IDocument document = null;
- if(( document = fViewer.getDocument()) instanceof IStructuredDocument) {
- ((IStructuredDocument) document).removeDocumentChangedListener(fInternalListener);
- }
- if(document instanceof IDocumentExtension4) {
- ((IDocumentExtension4) document).removeDocumentRewriteSessionListener(fInternalListener);
- }
- // Ensure we uninstall all listeners
- fInternalListener.inputDocumentAboutToBeChanged(fViewer.getDocument(), null);
- if(_trace) {
- System.out.println(TRACE_PREFIX + "uninstalled from text viewer in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /*
- * @see IPresentationReconciler#getDamager(String)
- */
- public IPresentationDamager getDamager(String contentType) {
-
- if (fDamagers == null)
- return null;
-
- return (IPresentationDamager) fDamagers.get(contentType);
- }
-
- /*
- * @see IPresentationReconciler#getRepairer(String)
- */
- public IPresentationRepairer getRepairer(String contentType) {
-
- if (fRepairers == null)
- return null;
-
- return (IPresentationRepairer) fRepairers.get(contentType);
- }
-
- /**
- * Informs all registered damagers about the document on which they will work.
- *
- * @param document the document on which to work
- */
- protected void setDocumentToDamagers(IDocument document) {
- if (fDamagers != null) {
- Iterator e= fDamagers.values().iterator();
- while (e.hasNext()) {
- IPresentationDamager damager= (IPresentationDamager) e.next();
- damager.setDocument(document);
- }
- }
- }
-
- /**
- * Informs all registered repairers about the document on which they will work.
- *
- * @param document the document on which to work
- */
- protected void setDocumentToRepairers(IDocument document) {
- if (fRepairers != null) {
- Iterator e= fRepairers.values().iterator();
- while (e.hasNext()) {
- IPresentationRepairer repairer= (IPresentationRepairer) e.next();
- repairer.setDocument(document);
- }
- }
- }
-
- /**
- * Constructs a "repair description" for the given damage and returns this
- * description as a text presentation. For this, it queries the partitioning
- * of the damage region and asks the appropriate presentation repairer for
- * each partition to construct the "repair description" for this partition.
- *
- * @param damage the damage to be repaired
- * @param document the document whose presentation must be repaired
- * @return the presentation repair description as text presentation or
- * <code>null</code> if the partitioning could not be computed
- */
- protected TextPresentation createPresentation(IRegion damage, IDocument document) {
- try {
- int validLength = Math.min(damage.getLength(), document.getLength() - damage.getOffset());
-
- if (fRepairers == null || fRepairers.isEmpty()) {
- TextPresentation presentation= new TextPresentation(damage, 1);
- presentation.setDefaultStyleRange(new StyleRange(damage.getOffset(), validLength, null, null));
- return presentation;
- }
-
- TextPresentation presentation= new TextPresentation(damage, 1000);
-
- ITypedRegion[] partitions= TextUtilities.computePartitioning(document, getDocumentPartitioning(), damage.getOffset(), validLength, false);
- for (int i= 0; i < partitions.length; i++) {
- ITypedRegion r= partitions[i];
- IPresentationRepairer repairer= getRepairer(r.getType());
- if (repairer != null)
- repairer.createPresentation(presentation, r);
- }
-
- return presentation;
-
- } catch (BadLocationException x) {
- /* ignored in platform PresentationReconciler, too */
- }
-
- return null;
- }
-
-
- /**
- * Checks for the first and the last affected partition affected by a
- * document event and calls their damagers. Invalidates everything from the
- * start of the damage for the first partition until the end of the damage
- * for the last partition.
- *
- * @param e the event describing the document change
- * @param optimize <code>true</code> if partition changes should be
- * considered for optimization
- * @return the damaged caused by the change or <code>null</code> if
- * computing the partitioning failed
- * @since 3.0
- */
- IRegion getDamage(DocumentEvent e, boolean optimize) {
- int length= e.getText() == null ? 0 : e.getText().length();
-
- if (fDamagers == null || fDamagers.isEmpty()) {
- length= Math.max(e.getLength(), length);
- length= Math.min(e.getDocument().getLength() - e.getOffset(), length);
- return new Region(e.getOffset(), length);
- }
-
- boolean isDeletion= length == 0;
- IRegion damage= null;
- try {
- int offset= e.getOffset();
- if (isDeletion)
- offset= Math.max(0, offset - 1);
- ITypedRegion partition= getPartition(e.getDocument(), offset);
- IPresentationDamager damager= getDamager(partition.getType());
- if (damager == null)
- return null;
-
- IRegion r= damager.getDamageRegion(partition, e, fDocumentPartitioningChanged);
-
- if (!fDocumentPartitioningChanged && optimize && !isDeletion) {
- damage= r;
- } else {
-
- int damageEnd= getDamageEndOffset(e);
-
- int parititionDamageEnd= -1;
- if (fChangedDocumentPartitions != null)
- parititionDamageEnd= fChangedDocumentPartitions.getOffset() + fChangedDocumentPartitions.getLength();
-
- int end= Math.max(damageEnd, parititionDamageEnd);
-
- damage= end == -1 ? r : new Region(r.getOffset(), end - r.getOffset());
- }
-
- } catch (BadLocationException x) {
- /* ignored in platform PresentationReconciler, too */
- }
-
- return damage;
- }
-
- /**
- * Returns the end offset of the damage. If a partition has been split by
- * the given document event also the second half of the original
- * partition must be considered. This is achieved by using the remembered
- * partition range.
- *
- * @param e the event describing the change
- * @return the damage end offset (excluding)
- * @exception BadLocationException if method accesses invalid offset
- */
- int getDamageEndOffset(DocumentEvent e) throws BadLocationException {
-
- IDocument d= e.getDocument();
-
- int length= 0;
- if (e.getText() != null) {
- length= e.getText().length();
- if (length > 0)
- -- length;
- }
-
- ITypedRegion partition= getPartition(d, e.getOffset() + length);
- int endOffset= partition.getOffset() + partition.getLength();
- if (endOffset == e.getOffset())
- return -1;
-
- int end= fRememberedPosition == null ? -1 : fRememberedPosition.getOffset() + fRememberedPosition.getLength();
- if (endOffset < end && end < d.getLength())
- partition= getPartition(d, end);
-
- //if there is not damager for the partition then use the endOffset of the partition
- IPresentationDamager damager= getDamager(partition.getType());
- if (damager != null) {
- IRegion r= damager.getDamageRegion(partition, e, fDocumentPartitioningChanged);
- endOffset = r.getOffset() + r.getLength();
- }
-
- return endOffset;
- }
-
- void processRecordedDamages() {
- processRecordedDamages(null, null);
- }
-
- boolean processRecordedDamages(IRegion damage, IDocument document) {
- RecordedDamage[] recordings = null;
- boolean recordingOverlaps = false;
- synchronized (fRecordedDamages) {
- recordings = (RecordedDamage[]) fRecordedDamages.toArray(new RecordedDamage[fRecordedDamages.size()]);
- fRecordedDamages.clear();
- }
- for (int i = 0; i < recordings.length; i++) {
- if (isOverlappingRegion(damage, recordings[i].damage) && document == recordings[i].document)
- recordingOverlaps = true;
- processDamage(recordings[i].damage, recordings[i].document);
- }
- return recordingOverlaps;
- }
-
- private boolean isOverlappingRegion(IRegion base, IRegion damage) {
- if(base == null || damage == null)
- return false;
-
- int baseEnd = base.getOffset() + base.getLength();
- int damageEnd = damage.getOffset() + damage.getLength();
-
- return damage.getOffset() <= base.getOffset() && (damageEnd >= baseEnd);
- }
-
- /**
- * Processes the given damage.
- * @param damage the damage to be repaired
- * @param document the document whose presentation must be repaired
- */
- void processDamage(IRegion damage, IDocument document) {
- if (damage != null && damage.getLength() > 0) {
- TextPresentation p = createPresentation(damage, document);
- if (p != null) {
- /**
- * 229749 - Read-Only highlighting support missing
- * 272981 - Read-only highlighting moved to semantic highlighting
- */
- applyTextRegionCollection(p);
- }
- }
- }
-
- /**
- * Processes the given damage.
- * @param damage the damage to be repaired
- * @param document the document whose presentation must be repaired
- */
- void recordDamage(IRegion damage, IDocument document) {
- if (damage != null && damage.getLength() > 0) {
- synchronized (fRecordedDamages) {
- fRecordedDamages.add(new RecordedDamage(damage, document));
- }
- }
- }
-
- /**
- * Applies the given text presentation to the text viewer the presentation
- * reconciler is installed on.
- *
- * @param presentation the text presentation to be applied to the text viewer
- */
- void applyTextRegionCollection(TextPresentation presentation) {
- fViewer.changeTextPresentation(presentation, false);
- }
-
- /**
- * Returns the partition for the given offset in the given document.
- *
- * @param document the document
- * @param offset the offset
- * @return the partition
- * @throws BadLocationException if offset is invalid in the given document
- * @since 3.0
- */
- ITypedRegion getPartition(IDocument document, int offset) throws BadLocationException {
- return TextUtilities.getPartition(document, getDocumentPartitioning(), offset, false);
- }
-
- /**
- * Constructs a "repair description" for the given damage and returns this
- * description as a text presentation, essentially making
- * {@link #createPresentation(IRegion, IDocument)} publicly callable.
- * <p>
- * NOTE: Should not be used if this reconciler is installed on a viewer.
- * This method is considered EXPERIMENTAL and may not be available in
- * subsequent versions.
- * </p>
- *
- * @param damage
- * the damage to be repaired
- * @param document
- * the document whose presentation must be repaired
- * @return the presentation repair description as text presentation
- */
- public TextPresentation createRepairDescription(IRegion damage, IDocument document) {
- if (document != fLastDocument) {
- setDocumentToDamagers(document);
- setDocumentToRepairers(document);
- fLastDocument= document;
- }
- return createPresentation(damage, document);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java
deleted file mode 100644
index 1fa7e13775..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java
+++ /dev/null
@@ -1,42 +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.wst.sse.ui.internal.quickoutline;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.text.information.IInformationPresenter;
-
-public class QuickOutlineHandler extends AbstractHandler {
-
- IInformationPresenter fPresenter;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- if (fPresenter != null)
- fPresenter.showInformation();
- return null;
- }
-
- public void configure(IInformationPresenter presenter) {
- fPresenter = presenter;
- }
-
- public void dispose() {
- super.dispose();
- if (fPresenter != null) {
- fPresenter.uninstall();
- fPresenter = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
deleted file mode 100644
index f5db0f4da1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.quickoutline;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlExtension;
-import org.eclipse.jface.text.IInformationControlExtension2;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.filter.StringMatcher;
-import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
-
-/**
- * Popup dialog that contains the filtering input and the outline
- * view of the editor's input.
- *
- * <p>
- * Based on {@link org.eclipse.jdt.internal.ui.text.AbstractInformationControl}
- * </p>
- *
- */
-public class QuickOutlinePopupDialog extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener {
-
- /** Section used for storing the dialog's size and position settings */
- private static final String DIALOG_SECTION = "org.eclipse.wst.sse.ui.quick_outline"; //$NON-NLS-1$
-
- /** Text field for entering filter patterns */
- private Text fFilterText;
-
- /** Tree for presenting the information outline */
- private TreeViewer fTreeViewer;
-
- /** The model to be outlined */
- private IStructuredModel fModel;
-
- private ILabelProvider fLabelProvider;
- private ITreeContentProvider fContentProvider;
-
- private IContentSelectionProvider fSelectionProvider;
-
- private StringPatternFilter fFilter;
-
- public QuickOutlinePopupDialog(Shell parent, int shellStyle, IStructuredModel model, AbstractQuickOutlineConfiguration configuration) {
- super(parent, shellStyle, true, true, true, true, true, null, null);
- fContentProvider = configuration.getContentProvider();
- fLabelProvider = configuration.getLabelProvider();
- fSelectionProvider = configuration.getContentSelectionProvider();
- fModel = model;
- create();
- }
-
- protected Control createDialogArea(Composite parent) {
- createTreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- addListeners(fTreeViewer.getTree());
-
- installFilter();
- return fTreeViewer.getControl();
- }
-
- protected Control createTitleControl(Composite parent) {
- createFilterText(parent);
-
- return fFilterText;
- }
-
- protected void createTreeViewer(Composite parent, int style) {
- Tree tree = new Tree(parent, style);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = tree.getItemHeight() * 12;
- tree.setLayoutData(gd);
-
- fTreeViewer = new TreeViewer(tree);
- fTreeViewer.setContentProvider(fContentProvider);
- fTreeViewer.setLabelProvider(fLabelProvider);
- fTreeViewer.setAutoExpandLevel(2);
- fTreeViewer.setUseHashlookup(true);
- fTreeViewer.setInput(fModel);
- }
-
- protected void createFilterText(Composite parent) {
- fFilterText = new Text(parent, SWT.NONE);
- Dialog.applyDialogFont(fFilterText);
-
- GridData data= new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalAlignment= GridData.FILL;
- data.verticalAlignment= GridData.CENTER;
- fFilterText.setLayoutData(data);
- fFilterText.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == 0x0D) // return
- gotoSelectedElement();
- if (e.keyCode == SWT.ARROW_DOWN)
- fTreeViewer.getTree().setFocus();
- if (e.keyCode == SWT.ARROW_UP)
- fTreeViewer.getTree().setFocus();
- if (e.character == 0x1B) // ESC
- dispose();
- }
- public void keyReleased(KeyEvent e) {
- // do nothing
- }
- });
- }
-
- protected void installFilter() {
- fFilter = new StringPatternFilter();
- fTreeViewer.addFilter(fFilter);
- fFilterText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String text = ((Text) e.widget).getText();
- int length = text.length();
- if (length > 0 && text.charAt(length -1 ) != '*') {
- text = text + '*';
- }
- setMatcherString(text, true);
- }
- });
- }
-
- protected void setMatcherString(String pattern, boolean update) {
- fFilter.updatePattern(pattern);
- if (update)
- stringMatcherUpdated();
- }
- /**
- * The string matcher has been modified. The default implementation
- * refreshes the view and selects the first matched element
- */
- protected void stringMatcherUpdated() {
- // refresh viewer to re-filter
- fTreeViewer.getControl().setRedraw(false);
- fTreeViewer.refresh();
- fTreeViewer.expandAll();
- selectFirstMatch();
- fTreeViewer.getControl().setRedraw(true);
- }
-
- private void selectFirstMatch() {
- TreeItem item = findItem(fTreeViewer.getTree().getItems(), fFilter.getStringMatcher());
- if (item != null) {
- fTreeViewer.getTree().setSelection(item);
- }
- else {
- fTreeViewer.setSelection(StructuredSelection.EMPTY);
- }
- }
-
- private TreeItem findItem(TreeItem[] items, StringMatcher matcher) {
- if (matcher == null)
- return items.length > 0 ? items[0] : null;
- int length = items.length;
- TreeItem result = null;
- for (int i = 0; i < length; i++) {
- if (matcher.match(items[i].getText()))
- return items[i];
- if (items[i].getItemCount() > 0) {
- result = findItem(items[i].getItems(), matcher);
- if (result != null)
- return result;
- }
-
- }
- return result;
- }
-
- protected IDialogSettings getDialogSettings() {
- IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings().getSection(DIALOG_SECTION);
- if (settings == null)
- settings = SSEUIPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SECTION);
-
- return settings;
- }
-
- private void gotoSelectedElement() {
- Object element = getSelectedElement();
- dispose();
- ITextEditor editor = getActiveTextEditor();
- if (editor != null) {
- editor.selectAndReveal(((IndexedRegion) element).getStartOffset(), ((IndexedRegion) element).getEndOffset() - ((IndexedRegion) element).getStartOffset());
- }
- }
-
- private ITextEditor getActiveTextEditor() {
- IWorkbench wb = PlatformUI.getWorkbench();
- ITextEditor editor = null;
- if (wb != null) {
- IWorkbenchWindow ww = wb.getActiveWorkbenchWindow();
- IWorkbenchPage page = ww.getActivePage();
- if (page != null) {
- IEditorPart part = page.getActiveEditor();
- if (part instanceof ITextEditor)
- editor = (ITextEditor) part;
- else
- editor = part != null ? (ITextEditor) part.getAdapter(ITextEditor.class) : null;
- }
- }
- return editor;
- }
-
- private Object getSelectedElement() {
- if (fTreeViewer == null)
- return null;
-
- return ((IStructuredSelection) fTreeViewer.getSelection()).getFirstElement();
- }
-
- private void addListeners(final Tree tree) {
- tree.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.character == 0x1B) // ESC
- dispose();
- }
- public void keyReleased(KeyEvent e) {
- // do nothing
- }
- });
-
- tree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- // do nothing
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- gotoSelectedElement();
- }
- });
-
- /* Mouse hover */
- tree.addMouseMoveListener(new MouseMoveListener() {
- TreeItem fLastItem= null;
- public void mouseMove(MouseEvent e) {
- if (tree.equals(e.getSource())) {
- Object o= tree.getItem(new Point(e.x, e.y));
- if (o instanceof TreeItem) {
- Rectangle clientArea = tree.getClientArea();
- if (!o.equals(fLastItem)) {
- fLastItem= (TreeItem)o;
- tree.setSelection(new TreeItem[] { fLastItem });
- } else if (e.y - clientArea.y < tree.getItemHeight() / 4) {
- // Scroll up
- Point p= tree.toDisplay(e.x, e.y);
- Item item= fTreeViewer.scrollUp(p.x, p.y);
- if (item instanceof TreeItem) {
- fLastItem= (TreeItem)item;
- tree.setSelection(new TreeItem[] { fLastItem });
- }
- } else if (clientArea.y + clientArea.height - e.y < tree.getItemHeight() / 4) {
- // Scroll down
- Point p= tree.toDisplay(e.x, e.y);
- Item item= fTreeViewer.scrollDown(p.x, p.y);
- if (item instanceof TreeItem) {
- fLastItem= (TreeItem)item;
- tree.setSelection(new TreeItem[] { fLastItem });
- }
- }
- }
- }
- }
- });
-
- tree.addMouseListener(new MouseAdapter() {
- public void mouseUp(MouseEvent e) {
-
- if (tree.getSelectionCount() < 1)
- return;
-
- if (e.button != 1)
- return;
-
- if (tree.equals(e.getSource())) {
- Object o= tree.getItem(new Point(e.x, e.y));
- TreeItem selection= tree.getSelection()[0];
- if (selection.equals(o))
- gotoSelectedElement();
- }
- }
- });
- }
- public void addDisposeListener(DisposeListener listener) {
- getShell().addDisposeListener(listener);
- }
-
- public void addFocusListener(FocusListener listener) {
- getShell().addFocusListener(listener);
- }
-
- public Point computeSizeHint() {
- return getShell().getSize();
- }
-
- public void dispose() {
- close();
- }
-
- public boolean isFocusControl() {
- return getShell().getDisplay().getActiveShell() == getShell();
- }
-
- public void removeDisposeListener(DisposeListener listener) {
- getShell().removeDisposeListener(listener);
- }
-
- public void removeFocusListener(FocusListener listener) {
- getShell().removeFocusListener(listener);
- }
-
- public void setBackgroundColor(Color background) {
- applyBackgroundColor(background, getContents());
- }
-
- public void setFocus() {
- getShell().forceFocus();
- fFilterText.setFocus();
- }
-
- public void setForegroundColor(Color foreground) {
- applyForegroundColor(foreground, getContents());
- }
-
- public void setInformation(String information) {
- // nothing to do
- }
-
- public void setLocation(Point location) {
- /*
- * If the location is persisted, it gets managed by PopupDialog - fine. Otherwise, the location is
- * computed in Window#getInitialLocation, which will center it in the parent shell / main
- * monitor, which is wrong for two reasons:
- * - we want to center over the editor / subject control, not the parent shell
- * - the center is computed via the initalSize, which may be also wrong since the size may
- * have been updated since via min/max sizing of AbstractInformationControlManager.
- * In that case, override the location with the one computed by the manager. Note that
- * the call to constrainShellSize in PopupDialog.open will still ensure that the shell is
- * entirely visible.
- */
- if (!getPersistLocation() || getDialogSettings() == null)
- getShell().setLocation(location);
- }
-
- public void setSize(int width, int height) {
- getShell().setSize(width, height);
- }
-
- public void setSizeConstraints(int maxWidth, int maxHeight) {
- }
-
- public void setVisible(boolean visible) {
- if (visible) {
- open();
- } else {
- saveDialogBounds(getShell());
- getShell().setVisible(false);
- }
- }
-
- public boolean hasContents() {
- return fTreeViewer != null && fTreeViewer.getInput() != null;
- }
-
- public void setInput(Object input) {
- if (!(input instanceof ISelection)) {
- fTreeViewer.setSelection(new StructuredSelection(input));
- }
- else {
- if (fSelectionProvider != null) {
- ISelection selection = fSelectionProvider.getSelection(fTreeViewer, (ISelection) input);
- fTreeViewer.setSelection(selection);
- }
- else {
- fTreeViewer.setSelection((ISelection) input);
- }
- }
- }
-
- public void widgetDisposed(DisposeEvent e) {
- fTreeViewer = null;
- fFilterText = null;
- fModel = null;
- }
-
- protected void fillDialogMenu(IMenuManager dialogMenu) {
- // Add custom actions
- super.fillDialogMenu(dialogMenu);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java
deleted file mode 100644
index fb191eb4bf..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.quickoutline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.wst.sse.ui.internal.filter.StringMatcher;
-
-/**
- * Default Viewer Filter to be used by the {@link QuickOutlinePopupDialog}
- * <p>
- * Based on {@link org.eclipse.jdt.internal.ui.text.AbstractInformationControl.NamePatternFilter}
- * </p>
- */
-public class StringPatternFilter extends ViewerFilter {
-
- private StringMatcher fStringMatcher;
-
- /*
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- StringMatcher matcher = fStringMatcher;
- if (matcher == null || !(viewer instanceof TreeViewer))
- return true;
- TreeViewer treeViewer = (TreeViewer) viewer;
-
- String matchName = ((ILabelProvider) treeViewer.getLabelProvider()).getText(element);
- matchName = TextProcessor.deprocess(matchName);
- if (matchName != null && matcher.match(matchName))
- return true;
-
- return hasUnfilteredChild(treeViewer, element);
- }
-
- private boolean hasUnfilteredChild(TreeViewer viewer, Object element) {
- Object[] children= ((ITreeContentProvider) viewer.getContentProvider()).getChildren(element);
- for (int i= 0; i < children.length; i++)
- if (select(viewer, element, children[i]))
- return true;
- return false;
- }
-
- public void updatePattern(String pattern) {
- if (pattern.length() == 0) {
- fStringMatcher = null;
- }
- else {
- fStringMatcher = new StringMatcher(pattern, pattern.toLowerCase().equals(pattern), false);
- }
-
- }
-
- public StringMatcher getStringMatcher() {
- return fStringMatcher;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
deleted file mode 100644
index d5cc519334..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
+++ /dev/null
@@ -1,543 +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.sse.ui.internal.reconcile;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.StructuredMarkerAnnotation;
-
-
-/**
- * A base ReconcilingStrategy. Subclasses must implement
- * createReconcileSteps(). This class should not know about
- * IStructuredDocument, only IDocument.
- *
- * @author pavery
- */
-public abstract class AbstractStructuredTextReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension, IReleasable {
-
- /** debug flag */
- protected static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- // these limits are safetys for "runaway" validation cases
- // should be used to safeguard potentially dangerous loops or potentially
- // long annotations
- // (since the painter seems to affect performance when painting long
- // annotations)
- public static final int ANNOTATION_LENGTH_LIMIT = 25;
- public static final int ELEMENT_ERROR_LIMIT = 25;
-
- private IDocument fDocument = null;
- private IProgressMonitor fProgressMonitor = null;
- private ISourceViewer fSourceViewer = null;
-
- // list of "validator" annotations
- // for gray/un-gray capability
- private HashSet fMarkerAnnotations = null;
-
- /**
- * Creates a new strategy. The source viewer must be set manually
- * after creation before a reconciler using this constructor will work.
- */
- public AbstractStructuredTextReconcilingStrategy() {
- init();
- }
-
- /**
- * Creates a new strategy.
- *
- * @param editor
- */
- public AbstractStructuredTextReconcilingStrategy(ISourceViewer sourceViewer) {
- fSourceViewer = sourceViewer;
- init();
- }
-
- /**
- * This is where we add results to the annotationModel, doing any special
- * "extra" processing.
- */
- protected void addResultToAnnotationModel(IReconcileResult result) {
- if (!(result instanceof TemporaryAnnotation))
- return;
- // can be null when closing the editor
- if (getAnnotationModel() != null) {
- TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) result;
-
- StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(tempAnnotation);
- if (sma != null) {
- // un-gray out the marker annotation
- sma.setGrayed(false);
- }
-
- getAnnotationModel().addAnnotation(tempAnnotation, tempAnnotation.getPosition());
- }
- }
-
- /**
- * @param object
- * @return if this strategy is responisble for adding this type of key
- */
- protected boolean canHandlePartition(String partition) {
- // String[] haystack = getPartitionTypes();
- // for (int i = 0; i < haystack.length; i++) {
- // if (haystack[i].equals(partition))
- // return true;
- // }
- // return false;
- return false;
- }
-
- // /**
- // * @param step
- // * @return
- // */
- // protected boolean containsStep(IReconcileStep step) {
- // if (fFirstStep instanceof StructuredReconcileStep)
- // return ((StructuredReconcileStep) fFirstStep).isSiblingStep(step);
- // return false;
- // }
-
- /**
- * This is where you should create the steps for this strategy
- */
- abstract public void createReconcileSteps();
-
- /**
- * Remove ALL temporary annotations that this strategy can handle.
- */
- protected TemporaryAnnotation[] getAllAnnotationsToRemove() {
- List removals = new ArrayList();
- IAnnotationModel annotationModel = getAnnotationModel();
- if (annotationModel != null) {
- Iterator i = annotationModel.getAnnotationIterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (!(obj instanceof ITemporaryAnnotation))
- continue;
-
- ITemporaryAnnotation annotation = (ITemporaryAnnotation) obj;
- ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
- // then if this strategy knows how to add/remove this
- // partition type
- if (canHandlePartition(key.getPartitionType()) /*
- * &&
- * containsStep(key.getStep())
- */)
- removals.add(annotation);
- }
- }
- return (TemporaryAnnotation[]) removals.toArray(new TemporaryAnnotation[removals.size()]);
- }
-
- protected IAnnotationModel getAnnotationModel() {
- IAnnotationModel model = null;
- if (fSourceViewer != null) {
- model = fSourceViewer.getAnnotationModel();
- }
- return model;
- }
-
- protected TemporaryAnnotation[] getAnnotationsToRemove(DirtyRegion dr, List stepsRun) {
-
- List remove = new ArrayList();
- IAnnotationModel annotationModel = getAnnotationModel();
- // can be null when closing the editor
- if (getAnnotationModel() != null) {
-
- // clear validator annotations
- getMarkerAnnotations().clear();
-
- Iterator i = annotationModel.getAnnotationIterator();
- while (i.hasNext()) {
-
- Object obj = i.next();
-
- // check if it's a validator marker annotation
- // if it is save it for comparision later (to "gray" icons)
- if (obj instanceof StructuredMarkerAnnotation) {
- StructuredMarkerAnnotation sma = (StructuredMarkerAnnotation) obj;
-
- if (sma.getAnnotationType() == TemporaryAnnotation.ANNOT_ERROR || sma.getAnnotationType() == TemporaryAnnotation.ANNOT_WARNING)
- fMarkerAnnotations.add(sma);
- }
-
- if (!(obj instanceof TemporaryAnnotation))
- continue;
-
- TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
- ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-
- // then if this strategy knows how to add/remove this
- // partition type
- if (canHandlePartition(key.getPartitionType()) && stepsRun.contains(key.getStep())) {
- if (key.getScope() == ReconcileAnnotationKey.PARTIAL && annotation.getPosition().overlapsWith(dr.getOffset(), dr.getLength())) {
- remove.add(annotation);
- }
- else if (key.getScope() == ReconcileAnnotationKey.TOTAL) {
- remove.add(annotation);
- }
- }
- }
- }
- return (TemporaryAnnotation[]) remove.toArray(new TemporaryAnnotation[remove.size()]);
- }
-
-
- protected abstract boolean containsStep(IReconcileStep step);
-
- /**
- * Gets partition types from all steps in this strategy.
- *
- * @return parition types from all steps
- */
- // public String[] getPartitionTypes() {
- // if (fFirstStep instanceof StructuredReconcileStep)
- // return ((StructuredReconcileStep) fFirstStep).getPartitionTypes();
- // return new String[0];
- // }
- public void init() {
- createReconcileSteps();
- }
-
- /**
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#initialReconcile()
- */
- public void initialReconcile() {
- // do nothing
- }
-
- /**
- * @return
- */
- protected boolean isCanceled() {
- if (DEBUG && (fProgressMonitor != null && fProgressMonitor.isCanceled()))
- System.out.println("** STRATEGY CANCELED **:" + this.getClass().getName()); //$NON-NLS-1$
- return fProgressMonitor != null && fProgressMonitor.isCanceled();
- }
-
- /**
- * Process the results from the reconcile steps in this strategy.
- *
- * @param results
- */
- private void process(final IReconcileResult[] results) {
- if (DEBUG)
- System.out.println("[trace reconciler] > STARTING PROCESS METHOD with (" + results.length + ") results"); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (results == null)
- return;
-
- for (int i = 0; i < results.length && i < ELEMENT_ERROR_LIMIT && !isCanceled(); i++) {
-
- if (isCanceled()) {
- if (DEBUG)
- System.out.println("[trace reconciler] >** PROCESS (adding) WAS CANCELLED **"); //$NON-NLS-1$
- return;
- }
- addResultToAnnotationModel(results[i]);
- }
-
- if (DEBUG) {
- StringBuffer traceString = new StringBuffer();
- for (int j = 0; j < results.length; j++)
- traceString.append("\n (+) :" + results[j] + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("[trace reconciler] > PROCESSING (" + results.length + ") results in AbstractStructuredTextReconcilingStrategy " + traceString); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion,
- * org.eclipse.jface.text.IRegion)
- */
- public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
- // not used
- // we only have validator strategy now
-
- // // external files may be null
- // if (isCanceled() || fFirstStep == null)
- // return;
- //
- // TemporaryAnnotation[] annotationsToRemove = new
- // TemporaryAnnotation[0];
- // IReconcileResult[] annotationsToAdd = new IReconcileResult[0];
- // StructuredReconcileStep structuredStep = (StructuredReconcileStep)
- // fFirstStep;
- //
- // annotationsToRemove = getAnnotationsToRemove(dirtyRegion);
- // annotationsToAdd = structuredStep.reconcile(dirtyRegion,
- // subRegion);
- //
- // smartProcess(annotationsToRemove, annotationsToAdd);
- }
-
- /**
- * @param partition
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
- */
- public void reconcile(IRegion partition) {
- // not used, we use:
- // reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
- }
-
- /**
- * Calls release() on all the steps in this strategy. Currently done in
- * StructuredRegionProcessor.SourceWidgetDisposeListener#widgetDisposed(...)
- */
- public void release() {
- // release steps (each step calls release on the next)
- // if (fFirstStep != null && fFirstStep instanceof IReleasable)
- // ((IReleasable) fFirstStep).release();
- // we don't to null out the steps, in case
- // it's reconfigured later
- }
-
- private void removeAnnotations(TemporaryAnnotation[] annotationsToRemove) {
-
- IAnnotationModel annotationModel = getAnnotationModel();
- // can be null when closing the editor
- if (annotationModel != null) {
- for (int i = 0; i < annotationsToRemove.length; i++) {
- if (isCanceled()) {
- if (DEBUG)
- System.out.println("[trace reconciler] >** REMOVAL WAS CANCELLED **"); //$NON-NLS-1$
- return;
- }
- StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(annotationsToRemove[i]);
- if (sma != null) {
- // gray out the marker annotation
- sma.setGrayed(true);
- }
- // remove the temp one
- annotationModel.removeAnnotation(annotationsToRemove[i]);
-
- }
- }
-
- if (DEBUG) {
- StringBuffer traceString = new StringBuffer();
- for (int i = 0; i < annotationsToRemove.length; i++)
- traceString.append("\n (-) :" + annotationsToRemove[i] + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("[trace reconciler] > REMOVED (" + annotationsToRemove.length + ") annotations in AbstractStructuredTextReconcilingStrategy :" + traceString); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private StructuredMarkerAnnotation getCorrespondingMarkerAnnotation(TemporaryAnnotation tempAnnotation) {
-
- Iterator it = getMarkerAnnotations().iterator();
- while (it.hasNext()) {
- StructuredMarkerAnnotation markerAnnotation = (StructuredMarkerAnnotation) it.next();
- String message = ""; //$NON-NLS-1$
- try {
- message = (String) markerAnnotation.getMarker().getAttribute(IMarker.MESSAGE);
- }
- catch (CoreException e) {
- if (DEBUG)
- Logger.logException(e);
- }
- // it would be nice to check line number here...
- if (message != null && message.equals(tempAnnotation.getText()))
- return markerAnnotation;
- }
- return null;
- }
-
- private void removeAllAnnotations() {
- removeAnnotations(getAllAnnotationsToRemove());
- }
-
- /**
- * The user needs to manually set the viewer if the default
- * constructor was used.
- *
- * @param viewer
- */
- public void setViewer(SourceViewer viewer) {
- fSourceViewer = viewer;
- }
-
- /**
- * Set the document for this strategy.
- *
- * @param document
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
- */
- public void setDocument(IDocument document) {
-
- // remove all old annotations since it's a new document
- removeAllAnnotations();
-
- if (document == null)
- release();
-
- // if (getFirstStep() != null)
- // getFirstStep().setInputModel(new DocumentAdapter(document));
-
- fDocument = document;
- }
-
- public IDocument getDocument() {
- return fDocument;
- }
-
- /**
- * @param monitor
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void setProgressMonitor(IProgressMonitor monitor) {
- // fProgressMonitor = monitor;
- // if (fFirstStep != null)
- // fFirstStep.setProgressMonitor(fProgressMonitor);
- }
-
- /**
- * Check if the annotation is already there, if it is, no need to remove
- * or add again. This will avoid a lot of "flickering" behavior.
- *
- * @param annotationsToRemove
- * @param annotationsToAdd
- */
- protected void smartProcess(TemporaryAnnotation[] annotationsToRemove, IReconcileResult[] annotationsToAdd) {
-// Comparator comp = getTemporaryAnnotationComparator();
-// List sortedRemovals = Arrays.asList(annotationsToRemove);
-// Collections.sort(sortedRemovals, comp);
-//
-// List sortedAdditions = Arrays.asList(annotationsToAdd);
-// Collections.sort(sortedAdditions, comp);
-//
-// List filteredRemovals = new ArrayList(sortedRemovals);
-// List filteredAdditions = new ArrayList(sortedAdditions);
-//
-// boolean ignore = false;
-// int lastFoundAdded = 0;
-// for (int i = 0; i < sortedRemovals.size(); i++) {
-// TemporaryAnnotation removal = (TemporaryAnnotation) sortedRemovals.get(i);
-// for (int j = lastFoundAdded; j < sortedAdditions.size(); j++) {
-// TemporaryAnnotation addition = (TemporaryAnnotation) sortedAdditions.get(j);
-// // quick position check here
-// if (removal.getPosition().equals(addition.getPosition())) {
-// lastFoundAdded = j;
-// // remove performs TemporaryAnnotation.equals()
-// // which checks text as well
-// filteredAdditions.remove(addition);
-// ignore = true;
-// if (DEBUG)
-// System.out.println(" ~ smart process ignoring: " + removal.getPosition().getOffset()); //$NON-NLS-1$
-// break;
-// }
-// }
-// if (ignore) {
-// filteredRemovals.remove(removal);
-// }
-// ignore = false;
-// }
- if (getAnnotationModel() instanceof IAnnotationModelExtension) {
-// TemporaryAnnotation[] filteredRemovalArray = (TemporaryAnnotation[]) filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]);
-// // apply "grey"-ness
-// for (int i = 0; i < filteredRemovalArray.length; i++) {
-// if (isCanceled()) {
-// if (DEBUG)
-// System.out.println("[trace reconciler] >** replacing WAS CANCELLED **"); //$NON-NLS-1$
-// return;
-// }
-// StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(filteredRemovalArray[i]);
-// if (sma != null) {
-// // gray out the marker annotation
-// sma.setGrayed(true);
-// }
-// }
-// Map annotationsToAddMap = new HashMap();
-// for (int i = 0; i < filteredAdditions.size(); i++) {
-// TemporaryAnnotation temporaryAnnotation = (TemporaryAnnotation) filteredAdditions.get(i);
-// annotationsToAddMap.put(temporaryAnnotation, temporaryAnnotation.getPosition());
-// }
-// if (isCanceled()) {
-// if (DEBUG)
-// System.out.println("[trace reconciler] >** PROCESS (replacing) WAS CANCELLED **"); //$NON-NLS-1$
-// return;
-// }
-// /*
-// * Using the extension means we can't enforce the
-// * ELEMENT_ERROR_LIMIT limit.
-// */
-// ((IAnnotationModelExtension) getAnnotationModel()).replaceAnnotations(filteredRemovalArray, annotationsToAddMap);
-
- Map annotationsToAddMap = new HashMap();
- for (int i = 0; i < annotationsToAdd.length; i++) {
- TemporaryAnnotation temporaryAnnotation = (TemporaryAnnotation) annotationsToAdd[i];
- annotationsToAddMap.put(temporaryAnnotation, temporaryAnnotation.getPosition());
- }
- if (isCanceled()) {
- if (DEBUG)
- System.out.println("[trace reconciler] >** PROCESS (replacing) WAS CANCELLED **"); //$NON-NLS-1$
- return;
- }
- ((IAnnotationModelExtension) getAnnotationModel()).replaceAnnotations(annotationsToRemove, annotationsToAddMap);
- }
- else {
-// removeAnnotations((TemporaryAnnotation[]) filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]));
-// process((IReconcileResult[]) filteredAdditions.toArray(new IReconcileResult[filteredAdditions.size()]));
- removeAnnotations(annotationsToRemove);
- process(annotationsToAdd);
- }
- }
-
-// private Comparator getTemporaryAnnotationComparator() {
-// if (fComparator == null) {
-// fComparator = new Comparator() {
-// public int compare(Object arg0, Object arg1) {
-// TemporaryAnnotation ta1 = (TemporaryAnnotation) arg0;
-// TemporaryAnnotation ta2 = (TemporaryAnnotation) arg1;
-// int result = ta1.getPosition().getOffset() - ta2.getPosition().getOffset();
-// if(result != 0)
-// return result;
-// return Collator.getInstance().compare(ta1.getText(), ta2.getText());
-// }
-// };
-// }
-// return fComparator;
-// }
-
- public HashSet getMarkerAnnotations() {
- if (fMarkerAnnotations == null)
- fMarkerAnnotations = new HashSet();
- return fMarkerAnnotations;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
deleted file mode 100644
index 2a1cf02051..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
+++ /dev/null
@@ -1,847 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-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.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.DocumentRewriteSessionEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentRewriteSessionListener;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilerExtension;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * This Job holds a queue of updates from the editor (DirtyRegions) to
- * process. When a new request comes in, the current run is canceled, the new
- * request is added to the queue, then the job is re-scheduled.
- *
- * @author pavery
- */
-public class DirtyRegionProcessor implements IReconciler, IReconcilerExtension, IConfigurableReconciler {
- class DocumentListener implements IDocumentListener {
- public void documentAboutToBeChanged(DocumentEvent event) {
- /*
- * if in rewrite session and already going to reprocess entire
- * document after rewrite session, do nothing
- */
- if (isInRewriteSession() && fReprocessAfterRewrite)
- return;
- // save partition type (to see if it changes in documentChanged())
- fLastPartitions = getPartitionRegions(event.getOffset(), event.getLength());
- }
-
- public void documentChanged(DocumentEvent event) {
- /*
- * if in rewrite session and already going to reprocess entire
- * document after rewrite session, do nothing
- */
- if (isInRewriteSession() && fReprocessAfterRewrite)
- return;
-
- if (partitionsChanged(event)) {
- // pa_TODO
- // this is a simple way to ensure old
- // annotations are removed when partition changes
-
- // it might be a performance hit though
- setEntireDocumentDirty(getDocument());
- }
- else {
- /*
- * Note that creating DirtyRegions *now* means that the wrong
- * text may be included
- */
- DirtyRegion dr = null;
- if (event.getLength() == 0) {
- /*
- * It's an insert-- we use text length though so that the
- * new region gets validated...
- */
- dr = createDirtyRegion(event.getOffset(), 0, DirtyRegion.INSERT);
- }
- else {
- if ("".equals(event.getText())) { //$NON-NLS-1$
- // it's a delete
- dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.REMOVE);
- }
- else {
- // it's a replace
- dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.INSERT);
- }
- }
- if (isInRewriteSession()) {
- /*
- * while in rewrite session, found a dirty region, so flag
- * that entire document needs to be reprocesed after
- * rewrite session
- */
- if (!fReprocessAfterRewrite && (dr != null)) {
- fReprocessAfterRewrite = true;
- }
- }
- else {
- processDirtyRegion(dr);
- }
- }
- }
-
- /**
- * Checks previous partitions from the span of the event w/ the new
- * partitions from the span of the event. If partitions changed,
- * return true, else return false
- *
- * @param event
- * @return
- */
- private boolean partitionsChanged(DocumentEvent event) {
- boolean changed = false;
- int length = event.getLength();
-
- if (event.getLength() == 0 && event.getText().length() > 0) {
- // it's an insert, we want partitions of the new text
- length = event.getText().length();
- }
-
- ITypedRegion[] newPartitions = getPartitionRegions(event.getOffset(), length);
- if (fLastPartitions != null) {
- if (fLastPartitions.length != newPartitions.length) {
- changed = true;
- }
- else {
- for (int i = 0; i < fLastPartitions.length; i++) {
- if (!fLastPartitions[i].getType().equals(newPartitions[i].getType())) {
- changed = true;
- break;
- }
- }
- }
- }
- return changed;
- }
-
-
- }
-
- /**
- * Reconciles the entire document when the document in the viewer is
- * changed. This happens when the document is initially opened, as well as
- * after a save-as.
- *
- * Also see processPostModelEvent(...) for similar behavior when document
- * for the model is changed.
- */
- class TextInputListener implements ITextInputListener {
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- // do nothing
- }
-
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- handleInputDocumentChanged(oldInput, newInput);
-
- startReconciling();
- }
- }
-
- class DocumentRewriteSessionListener implements IDocumentRewriteSessionListener {
- long time0 = 0;
-
- public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
- boolean oldValue = fInRewriteSession;
- fInRewriteSession = event != null && event.getChangeType().equals(DocumentRewriteSessionEvent.SESSION_START);
-
- if (event.getChangeType().equals(DocumentRewriteSessionEvent.SESSION_START)) {
- if (DEBUG) {
- time0 = System.currentTimeMillis();
- }
- // bug 235446 - source validation annotations lost after rewrite session
- if (!getDirtyRegionQueue().isEmpty()) {
- flushDirtyRegionQueue();
- fReprocessAfterRewrite = true;
- } else {
- fReprocessAfterRewrite = false;
- }
- }
- else if (event.getChangeType().equals(DocumentRewriteSessionEvent.SESSION_STOP)) {
- if (fInRewriteSession ^ oldValue && fDocument != null) {
- if (DEBUG) {
- Logger.log(Logger.INFO, "Rewrite session lasted " + (System.currentTimeMillis() - time0) + "ms");
- time0 = System.currentTimeMillis();
- }
- if (fReprocessAfterRewrite) {
- DirtyRegion entireDocument = createDirtyRegion(0, fDocument.getLength(), DirtyRegion.INSERT);
- processDirtyRegion(entireDocument);
- }
- if (DEBUG) {
- Logger.log(Logger.INFO, "Full document reprocess took " + (System.currentTimeMillis() - time0) + "ms");
- }
- fReprocessAfterRewrite = false;
- }
- }
- }
- }
-
- /** debug flag */
- protected static final boolean DEBUG;
- private static final long UPDATE_DELAY = 500;
-
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private long fDelay;
-
-
- /** local queue of dirty regions (created here) to be reconciled */
- private List fDirtyRegionQueue = Collections.synchronizedList(new ArrayList());
-
- /** document that this reconciler works on */
- private IDocument fDocument = null;
-
- private IDocumentListener fDocumentListener = new DocumentListener();
- private IDocumentRewriteSessionListener fDocumentRewriteSessionListener = new DocumentRewriteSessionListener();
-
- /**
- * set true after first install to prevent duplicate work done in the
- * install method (since install gets called multiple times)
- */
- private boolean fIsInstalled = false;
-
- /**
- * so we can tell if a partition changed after the last edit
- */
- ITypedRegion[] fLastPartitions;
-
- List fNonIncrementalStrategiesAlreadyProcessed = new ArrayList(1);
-
- /**
- * The partitioning this reconciler uses.
- */
- private String fPartitioning;
-
- Map fReconcilingStrategies = null;
-
- /** for initial reconcile when document is opened */
- private TextInputListener fTextInputListener = null;
- /** the text viewer */
- private ITextViewer fViewer;
- boolean fInRewriteSession = false;
- /**
- * true if entire document needs to be reprocessed after rewrite session
- */
- boolean fReprocessAfterRewrite = false;
-
- /** The job should be reset because of document changes */
- private boolean fReset = false;
- private boolean fIsCanceled = false;
- private boolean fHasReconciled = false;
- private Object LOCK = new Object();
-
- private BackgroundThread fThread;
-
- /**
- * Creates a new StructuredRegionProcessor
- */
- public DirtyRegionProcessor() {
- // init reconciler stuff
- setDelay(UPDATE_DELAY);
- fReconcilingStrategies = new HashMap();
- }
-
- /**
- * Adds the given resource to the set of resources that need refreshing.
- * Synchronized in order to protect the collection during add.
- *
- * @param resource
- */
- private synchronized void addRequest(DirtyRegion newDirtyRegion) {
- // NOTE: This method is called a lot so make sure it's fast
- List dirtyRegionQueue = getDirtyRegionQueue();
- synchronized (dirtyRegionQueue) {
- for (Iterator it = dirtyRegionQueue.iterator(); it.hasNext();) {
- // go through list of existing dirty regions and check if any
- // dirty regions need to be discarded
- DirtyRegion currentExisting = (DirtyRegion) it.next();
- DirtyRegion outer = getOuterRegion(currentExisting, newDirtyRegion);
- // if we already have a request which contains the new request,
- // discard the new request
- if (outer == currentExisting)
- return;
- // if new request contains any existing requests,
- // remove those
- if (outer == newDirtyRegion)
- it.remove();
- }
- dirtyRegionQueue.add(newDirtyRegion);
- }
- }
-
- /**
- * Notifies subclasses that processing of multiple dirty regions has begun
- */
- protected void beginProcessing() {
- // do nothing by default
- }
-
- /**
- * @param dirtyRegion
- * @return
- */
- protected ITypedRegion[] computePartitioning(DirtyRegion dirtyRegion) {
- int drOffset = dirtyRegion.getOffset();
- int drLength = dirtyRegion.getLength();
-
- return computePartitioning(drOffset, drLength);
- }
-
- protected ITypedRegion[] computePartitioning(int drOffset, int drLength) {
- ITypedRegion[] tr = new ITypedRegion[0];
- IDocument doc = getDocument();
- if (doc != null){
- int docLength = doc.getLength();
-
- if (drOffset > docLength) {
- drOffset = docLength;
- drLength = 0;
- }
- else if (drOffset + drLength > docLength) {
- drLength = docLength - drOffset;
- }
-
- try {
- // dirty region may span multiple partitions
- tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
- }
- catch (BadLocationException e) {
- String info = "dr: [" + drOffset + ":" + drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Logger.logException(info, e);
- tr = new ITypedRegion[0];
- }
- }
- return tr;
- }
-
- /**
- * Used to determine if one dirty region contains the other and if so,
- * which is the one that contains it.
- *
- * @param root
- * @param possible
- * @return the outer dirty region if it contains the other dirty region,
- * null otherwise
- */
- protected DirtyRegion getOuterRegion(DirtyRegion root, DirtyRegion possible) {
- DirtyRegion outer = null;
- if (isContained(root, possible))
- outer = root;
- else if (isContained(possible, root))
- outer = possible;
- return outer;
- }
-
- /**
- * Used to determine of a "possible" dirty region can be discarded in
- * favor of using just the "root" dirty region.
- *
- * @return if the root dirty region contains possible, return true,
- * otherwise return false
- */
- private boolean isContained(DirtyRegion root, DirtyRegion possible) {
- int rootStart = root.getOffset();
- int rootEnd = rootStart + root.getLength();
- int possStart = possible.getOffset();
- int possEnd = possStart + possible.getLength();
- if (rootStart <= possStart && rootEnd >= possEnd)
- return true;
- return false;
- }
-
- protected DirtyRegion createDirtyRegion(int offset, int length, String type) {
- DirtyRegion durty = null;
- IDocument doc = getDocument();
-
- if (doc != null) {
- // safety for BLE
- int docLen = doc.getLength();
- if (offset > docLen) {
- offset = docLen;
- length = 0;
- }
- else if (offset + length >= docLen)
- length = docLen - offset;
- try {
- durty = new DirtyRegion(offset, length, type, doc.get(offset, length));
- }
- catch (BadLocationException e) {
- String info = "dr: [" + offset + ":" + length + "] doc: [" + docLen + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Logger.logException(info, e);
- }
- }
- return durty;
- }
-
- protected DirtyRegion createDirtyRegion(ITypedRegion tr, String type) {
- return createDirtyRegion(tr.getOffset(), tr.getLength(), type);
- }
-
- protected void flushDirtyRegionQueue() {
- synchronized (fDirtyRegionQueue) {
- fDirtyRegionQueue.clear();
- }
- }
-
- /**
- * Notifies subclasses that processing of multiple dirty regions has
- * ended, for now
- */
- protected void endProcessing() {
- // do nothing by default
- }
-
- /**
- * Delay between processing of DirtyRegions.
- *
- * @return
- */
- long getDelay() {
- return fDelay;
- }
-
- List getDirtyRegionQueue() {
- return fDirtyRegionQueue;
- }
-
- /**
- * The IDocument on which this reconciler operates
- *
- * @return
- */
- protected IDocument getDocument() {
- return fDocument;
- }
-
- public String getDocumentPartitioning() {
- if (fPartitioning == null)
- return IDocumentExtension3.DEFAULT_PARTITIONING;
- return fPartitioning;
- }
-
- protected String[] getPartitions(int drOffset, int drLength) {
-
- ITypedRegion[] regions = new ITypedRegion[0];
- int docLength = getDocument().getLength();
-
- if (drOffset > docLength) {
- drOffset = docLength;
- drLength = 0;
- }
- else if (drOffset + drLength > docLength) {
- drLength = docLength - drOffset;
- }
-
- try {
- regions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), drOffset, drLength, true);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- regions = new ITypedRegion[0];
- }
- String[] partitions = new String[regions.length];
- for (int i = 0; i < regions.length; i++)
- partitions[i] = regions[i].getType();
- return partitions;
- }
-
- ITypedRegion[] getPartitionRegions(int drOffset, int drLength) {
- ITypedRegion[] regions = new ITypedRegion[0];
- int docLength = getDocument().getLength();
-
- if (drOffset > docLength) {
- drOffset = docLength;
- drLength = 0;
- }
- else if (drOffset + drLength > docLength) {
- drLength = docLength - drOffset;
- }
-
- try {
- regions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), drOffset, drLength, true);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- regions = new ITypedRegion[0];
- }
- return regions;
- }
-
-
- /**
- * Returns the reconciling strategy registered with the reconciler for the
- * specified partition type.
- *
- * @param partitionType
- * the partition type for which to determine the reconciling
- * strategy
- *
- * @return the reconciling strategy registered for the given partition
- * type, or <code>null</code> if there is no such strategy
- *
- * @see org.eclipse.jface.text.reconciler.IReconciler#getReconcilingStrategy(java.lang.String)
- */
- public IReconcilingStrategy getReconcilingStrategy(String partitionType) {
- if (partitionType == null)
- return null;
- return (IReconcilingStrategy) fReconcilingStrategies.get(partitionType);
- }
-
- /**
- * This method also synchronized because it accesses the fRequests queue
- *
- * @return an array of the currently requested Nodes to refresh
- */
- private synchronized DirtyRegion[] getRequests() {
- synchronized (fDirtyRegionQueue) {
- DirtyRegion[] toRefresh = (DirtyRegion[]) fDirtyRegionQueue.toArray(new DirtyRegion[fDirtyRegionQueue.size()]);
- flushDirtyRegionQueue();
- return toRefresh;
- }
- }
-
- /**
- * Returns the text viewer this reconciler is installed on.
- *
- * @return the text viewer this reconciler is installed on
- */
- protected ITextViewer getTextViewer() {
- return fViewer;
- }
-
- /**
- *
- * @param oldInput
- * @param newInput
- */
- void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
- // don't bother if reconciler not installed
- if (isInstalled()) {
- setDocument(newInput);
- }
- }
-
- /**
- * @see org.eclipse.jface.text.reconciler.IReconciler#install(ITextViewer)
- */
- public void install(ITextViewer textViewer) {
- // we might be called multiple times with the same viewe.r,
- // maybe after being uninstalled as well, so track separately
- if (!isInstalled()) {
- fViewer = textViewer;
- fTextInputListener = new TextInputListener();
- textViewer.addTextInputListener(fTextInputListener);
- setInstalled(true);
- }
- synchronized (this) {
- if (fThread == null)
- fThread = new BackgroundThread(getClass().getName());
- }
- }
-
- /**
- * The viewer has been set on this Reconciler.
- *
- * @return true if the viewer has been set on this Reconciler, false
- * otherwise.
- */
- public boolean isInstalled() {
- return fIsInstalled;
- }
-
- boolean isInRewriteSession() {
- return fInRewriteSession;
- }
-
- /**
- * Subclasses should implement for specific handling of dirty regions. The
- * method is invoked for each dirty region in the Job's queue.
- *
- * @param dirtyRegion
- */
- protected void process(DirtyRegion dirtyRegion) {
- if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null || fIsCanceled) {
- return;
- }
- /*
- * Break the dirty region into a sequence of partitions and find the
- * corresponding strategy to reconcile those partitions. If a strategy
- * implements INonIncrementalReconcilingStrategy, only call it once
- * regardless of the number and types of partitions.
- */
- ITypedRegion[] partitions = computePartitioning(dirtyRegion);
- for (int i = 0; i < partitions.length && !fIsCanceled; i++) {
- IReconcilingStrategy strategy = getReconcilingStrategy(partitions[i].getType());
- if (strategy != null) {
- strategy.reconcile(partitions[i]);
- }
- }
- }
-
- /**
- * Invoke dirty region processing.
- *
- * @param node
- */
- public final void processDirtyRegion(DirtyRegion dr) {
- if (dr == null || !isInstalled())
- return;
-
- addRequest(dr);
- synchronized (LOCK) {
- fReset = true;
- }
-
- if (DEBUG) {
- System.out.println("added request for: [" + dr.getText() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("queue size is now: " + getDirtyRegionQueue().size()); //$NON-NLS-1$
- }
- }
-
- /**
- * Based on {@link org.eclipse.jface.text.reconciler.AbstractReconciler.BackgroundThread}
- *
- */
- class BackgroundThread extends Thread {
-
- public BackgroundThread(String name) {
- super(name);
- setPriority(Thread.MIN_PRIORITY);
- setDaemon(true);
- }
-
- public void cancel() {
- synchronized (fDirtyRegionQueue) {
- fDirtyRegionQueue.notifyAll();
- }
- }
-
- public void run() {
- synchronized (fDirtyRegionQueue) {
- try {
- fDirtyRegionQueue.wait(getDelay());
- } catch (InterruptedException e) {}
- }
-
- if (fIsCanceled)
- return;
-
- if (!fHasReconciled) {
- initialReconcile();
- fHasReconciled = true;
- }
-
- while (!fIsCanceled) {
- synchronized (fDirtyRegionQueue) {
- try {
- fDirtyRegionQueue.wait(getDelay());
- } catch (InterruptedException e) {}
- }
-
- if (fIsCanceled)
- return;
-
- synchronized (LOCK) {
- if (fReset) {
- fReset = false;
- continue;
- }
- }
-
- boolean processed = false;
- try {
- DirtyRegion[] toRefresh = getRequests();
- if (toRefresh.length > 0) {
- processed = true;
- beginProcessing();
- }
-
- for (int i = 0; i < toRefresh.length && fDocument != null; i++) {
- if (fIsCanceled)
- return;
- process(toRefresh[i]);
- }
- }
- finally {
- if (processed)
- endProcessing();
- }
-
- }
- }
- }
-
- public void setDelay(long delay) {
- fDelay = delay;
- }
-
- public void setDocument(IDocument doc) {
- if (fDocument != null) {
- // unhook old document listener
- fDocument.removeDocumentListener(fDocumentListener);
- if (fDocument instanceof IDocumentExtension4) {
- ((IDocumentExtension4) fDocument).removeDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
- }
- }
-
- fDocument = doc;
-
- if (fDocument != null) {
- if (fDocument instanceof IDocumentExtension4) {
- ((IDocumentExtension4) fDocument).addDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
- }
- // hook up new document listener
- fDocument.addDocumentListener(fDocumentListener);
-
- setEntireDocumentDirty(doc);
- }
- }
-
- /**
- * This method is called before the initial reconciling of the document.
- */
- protected void initialReconcile() {
- }
-
- /**
- * Sets the document partitioning for this reconciler.
- *
- * @param partitioning
- * the document partitioning for this reconciler
- */
- public void setDocumentPartitioning(String partitioning) {
- fPartitioning = partitioning;
- }
-
- /**
- * Forces reconciling of the entire document.
- */
- protected void forceReconciling() {
- if (!fHasReconciled)
- return;
-
- setEntireDocumentDirty(getDocument());
- }
-
- /**
- * Basically means process the entire document.
- *
- * @param document
- */
- protected void setEntireDocumentDirty(IDocument document) {
-
- // make the entire document dirty
- // this also happens on a "save as"
- if (document != null && isInstalled()) {
-
- // since we're marking the entire doc dirty
- flushDirtyRegionQueue();
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053
- *
- * Process the strategies for the last known-good partitions to
- * ensure all problem annotations are cleared if needed.
- */
- if (fLastPartitions != null && document.getLength() == 0) {
- for (int i = 0; i < fLastPartitions.length; i++) {
- IReconcilingStrategy strategy = getReconcilingStrategy(fLastPartitions[i].getType());
- if (strategy != null) {
- strategy.reconcile(fLastPartitions[i]);
- }
- }
- }
- else {
- DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT);
- processDirtyRegion(entireDocument);
- }
- }
- }
-
- /**
- * @param isInstalled
- * The isInstalled to set.
- */
- void setInstalled(boolean isInstalled) {
- fIsInstalled = isInstalled;
- }
-
- public void setReconcilingStrategy(String partitionType, IReconcilingStrategy strategy) {
- if (partitionType == null) {
- throw new IllegalArgumentException();
- }
-
- if (strategy == null) {
- fReconcilingStrategies.remove(partitionType);
- }
- else {
- fReconcilingStrategies.put(partitionType, strategy);
- }
- }
-
- /**
- * @see org.eclipse.jface.text.reconciler.IReconciler#uninstall()
- */
- public void uninstall() {
- if (isInstalled()) {
- // removes widget listener
- getTextViewer().removeTextInputListener(fTextInputListener);
- setInstalled(false);
- fIsCanceled = true;
- synchronized (this) {
- BackgroundThread bt = fThread;
- fThread= null;
- bt.cancel();
- }
- }
- synchronized (fDirtyRegionQueue) {
- fDirtyRegionQueue.clear();
- }
- setDocument(null);
- }
-
- protected synchronized void startReconciling() {
- if (fThread == null)
- return;
- if (!fThread.isAlive()) {
- try {
- fThread.start();
- } catch (IllegalThreadStateException e) { }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java
deleted file mode 100644
index d2557462a1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-
-/**
- * Adapts an <code>IDocument</code> to a <code>IReconcilableModel</code>.
- *
- */
-public class DocumentAdapter implements IReconcilableModel {
-
- private IDocument fDocument;
-
- /**
- * Creates a text model adapter for the given document.
- *
- * @param document
- */
- public DocumentAdapter(IDocument document) {
- fDocument = document;
- }
-
- /**
- * Returns this model's document.
- *
- * @return the model's input document
- */
- public IDocument getDocument() {
- return fDocument;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
deleted file mode 100644
index 5f4bd9f30f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver (Intalio) - bug 307323 - remove extraneous call to spell check strategy
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser;
-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.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorBuilder;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorMetaData;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy;
-import org.eclipse.wst.sse.ui.internal.spelling.SpellcheckStrategy;
-import org.eclipse.wst.sse.ui.reconcile.ISourceReconcilingListener;
-
-/**
- * Adds to DirtyRegionProcessor Job: - IDocumentListener - ValidatorStrategy -
- * Text viewer(dispose, input changed) listeners. - default, spelling, and
- * validator strategies - DirtyRegion processing logic.
- */
-public class DocumentRegionProcessor extends DirtyRegionProcessor {
- private static final boolean DEBUG_VALIDATORS = Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidators")); //$NON-NLS-1$
-
- /**
- * Marks the entire document dirty when a parser-level change is notified
- * that might affect the entire document
- */
- class DirtyRegionParseHandler implements StructuredDocumentRegionHandler {
- public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion) {
- }
-
- public void resetNodes() {
- setEntireDocumentDirty(getDocument());
- }
- }
- private DirtyRegionParseHandler fResetHandler = new DirtyRegionParseHandler();
- /**
- * A strategy to use the defined default Spelling service.
- */
- private IReconcilingStrategy fSpellcheckStrategy;
-
- /**
- * The strategy that runs validators contributed via
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
- * extension point
- */
- private ValidatorStrategy fValidatorStrategy;
-
- private ISourceReconcilingListener[] fReconcileListeners = new ISourceReconcilingListener[0];
-
- private IReconcilingStrategy fSemanticHighlightingStrategy;
-
- /**
- * The folding strategy for this processor
- */
- private AbstractStructuredFoldingStrategy fFoldingStrategy;
-
- private final String SSE_UI_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
- /**
- * true if as you type validation is enabled,
- * false otherwise
- */
- private boolean fValidationEnabled;
-
- public void addReconcilingListener(ISourceReconcilingListener listener) {
- Set listeners = new HashSet(Arrays.asList(fReconcileListeners));
- listeners.add(listener);
- fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
- }
-
- protected void beginProcessing() {
- super.beginProcessing();
- ValidatorStrategy validatorStrategy = getValidatorStrategy();
- if (validatorStrategy != null) {
- validatorStrategy.beginProcessing();
- }
- if ((getTextViewer() instanceof ISourceViewer)) {
- for (int i = 0; i < fReconcileListeners.length; i++) {
- fReconcileListeners[i].aboutToBeReconciled();
- }
- }
- }
-
- protected void endProcessing() {
- super.endProcessing();
- ValidatorStrategy validatorStrategy = getValidatorStrategy();
- if (validatorStrategy != null) {
- validatorStrategy.endProcessing();
- }
- /* single spell-check for everything to ensure that SpellingProblem offsets are correct */
- IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
- IDocument document = getDocument();
- if (spellingStrategy != null && document != null) {
- spellingStrategy.reconcile(new Region(0, document.getLength()));
- }
-
- IReconcilingStrategy semanticHighlightingStrategy = getSemanticHighlightingStrategy();
- if (semanticHighlightingStrategy != null && document != null) {
- semanticHighlightingStrategy.reconcile(new Region(0, document.getLength()));
- }
-
- if ((getTextViewer() instanceof ISourceViewer)) {
- ISourceViewer sourceViewer = (ISourceViewer) getTextViewer();
- IAnnotationModel annotationModel = sourceViewer.getAnnotationModel();
- for (int i = 0; i < fReconcileListeners.length; i++) {
- fReconcileListeners[i].reconciled(document, annotationModel, false, new NullProgressMonitor());
- }
- }
- }
-
- public void forceReconciling() {
- super.forceReconciling();
- }
-
- protected String getContentType(IDocument doc) {
- if (doc == null)
- return null;
-
- String contentTypeId = null;
-
- IContentType ct = null;
- try {
- IContentDescription desc = Platform.getContentTypeManager().getDescriptionFor(new StringReader(doc.get()), null, IContentDescription.ALL);
- if (desc != null) {
- ct = desc.getContentType();
- if (ct != null)
- contentTypeId = ct.getId();
- }
- }
- catch (IOException e) {
- // just bail
- }
- return contentTypeId;
- }
-
- protected IReconcilingStrategy getSpellcheckStrategy() {
- if (fSpellcheckStrategy == null && getDocument() != null) {
- String contentTypeId = getContentType(getDocument());
- if (contentTypeId == null) {
- contentTypeId = IContentTypeManager.CT_TEXT;
- }
- if (getTextViewer() instanceof ISourceViewer) {
- ISourceViewer viewer = (ISourceViewer) getTextViewer();
- fSpellcheckStrategy = new SpellcheckStrategy(viewer, contentTypeId);
- fSpellcheckStrategy.setDocument(getDocument());
- }
- }
- return fSpellcheckStrategy;
- }
-
- /**
- * <p>Get the folding strategy for this processor. Retrieved from the
- * extended configuration builder. The processor chosen is set by the plugin.</p>
- *
- * <p>EX:<br />
- * <code>&lt;extension point="org.eclipse.wst.sse.ui.editorConfiguration"&gt;<br />
- * &lt;provisionalConfiguration<br />
- * type="foldingstrategy"<br />
- * class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"<br />
- * target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" /&gt;<br />
- * &lt;/extension&gt;</code></p>
- *
- * <p>The type must be equal to <code>AbstractFoldingStrategy.ID</code> (AKA: foldingstrategy)
- * and the class must extend <code>org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy</code>
- * and the target must be a structured editor content type ID</p>
- *
- * @return the requested folding strategy or null if none can be found
- */
- protected IReconcilingStrategy getFoldingStrategy() {
- if(fFoldingStrategy == null && getDocument() != null) {
- String contentTypeId = getContentType(getDocument());
- if (contentTypeId == null) {
- contentTypeId = IContentTypeManager.CT_TEXT;
- }
-
- ITextViewer viewer = getTextViewer();
- if(viewer instanceof ProjectionViewer) {
- ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-
- IContentType type = Platform.getContentTypeManager().getContentType(contentTypeId);
- while(fFoldingStrategy == null && type != null) {
- fFoldingStrategy =(AbstractStructuredFoldingStrategy) builder.getConfiguration(
- AbstractStructuredFoldingStrategy.ID, type.getId());
-
- type = type.getBaseType();
- }
-
- if(fFoldingStrategy != null) {
- fFoldingStrategy.setViewer((ProjectionViewer)viewer);
- fFoldingStrategy.setDocument(getDocument());
- }
- }
- }
-
- return fFoldingStrategy;
- }
-
- /**
- * Enable or disable as you type validation. Typically set by a user preference
- *
- * @param enable true to enable as you type validation, false to disable
- */
- public void setValidatorStrategyEnabled(boolean enable) {
- fValidationEnabled = enable;
- }
-
- /**
- * @return Returns the ValidatorStrategy.
- */
- protected ValidatorStrategy getValidatorStrategy() {
- ValidatorStrategy validatorStrategy = null;
- if (fValidatorStrategy == null && fValidationEnabled) {
- if (getTextViewer() instanceof ISourceViewer) {
- ISourceViewer viewer = (ISourceViewer) getTextViewer();
- String contentTypeId = null;
-
- IDocument doc = viewer.getDocument();
- contentTypeId = getContentType(doc);
-
- if (contentTypeId != null) {
- validatorStrategy = new ValidatorStrategy(viewer, contentTypeId);
- ValidatorBuilder vBuilder = new ValidatorBuilder();
- ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_UI_ID);
- List enabledValidators = new ArrayList(1);
- /* if any "must" handle this content type, just add them */
- boolean foundSpecificContentTypeValidators = false;
- for (int i = 0; i < vmds.length; i++) {
- if (vmds[i].mustHandleContentType(contentTypeId)) {
- if (DEBUG_VALIDATORS)
- Logger.log(Logger.INFO, contentTypeId + " using specific validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
- foundSpecificContentTypeValidators = true;
- enabledValidators.add(vmds[i]);
- }
- }
- if (!foundSpecificContentTypeValidators) {
- for (int i = 0; i < vmds.length; i++) {
- if (vmds[i].canHandleContentType(contentTypeId)) {
- if (DEBUG_VALIDATORS)
- Logger.log(Logger.INFO, contentTypeId + " using inherited(?) validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
- enabledValidators.add(vmds[i]);
- }
- }
- }
- for (int i = 0; i < enabledValidators.size(); i++) {
- validatorStrategy.addValidatorMetaData((ValidatorMetaData) enabledValidators.get(i));
- }
- }
- }
- fValidatorStrategy = validatorStrategy;
- } else if(fValidatorStrategy != null && fValidationEnabled) {
- validatorStrategy = fValidatorStrategy;
- }
- return validatorStrategy;
- }
-
- public void setSemanticHighlightingStrategy(IReconcilingStrategy semanticHighlightingStrategy) {
- fSemanticHighlightingStrategy = semanticHighlightingStrategy;
- fSemanticHighlightingStrategy.setDocument(getDocument());
- }
-
- protected IReconcilingStrategy getSemanticHighlightingStrategy() {
- return fSemanticHighlightingStrategy;
- }
-
- /**
- * @param dirtyRegion
- */
- protected void process(DirtyRegion dirtyRegion) {
- if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null)
- return;
-
- super.process(dirtyRegion);
-
- ITypedRegion[] partitions = computePartitioning(dirtyRegion);
-
- // call the validator strategy once for each effected partition
- DirtyRegion dirty = null;
- for (int i = 0; i < partitions.length; i++) {
- dirty = createDirtyRegion(partitions[i], DirtyRegion.INSERT);
-
- // [source]validator (extension) for this partition
- if (getValidatorStrategy() != null) {
- getValidatorStrategy().reconcile(partitions[i], dirty);
- }
- }
-
- /* if there is a folding strategy then reconcile it for the
- * entire dirty region.
- * NOTE: the folding strategy does not care about the sub regions.
- */
- if(getFoldingStrategy() != null) {
- getFoldingStrategy().reconcile(dirtyRegion, null);
- }
- }
-
- public void removeReconcilingListener(ISourceReconcilingListener listener) {
- Set listeners = new HashSet(Arrays.asList(fReconcileListeners));
- listeners.remove(listener);
- fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
- }
-
-
- public void setDocument(IDocument doc) {
- if (getDocument() instanceof IStructuredDocument) {
- RegionParser parser = ((IStructuredDocument) getDocument()).getParser();
- if (parser instanceof StructuredDocumentRegionParser) {
- ((StructuredDocumentRegionParser) parser).removeStructuredDocumentRegionHandler(fResetHandler);
- }
- }
-
- super.setDocument(doc);
-
- IReconcilingStrategy validatorStrategy = getValidatorStrategy();
- if (validatorStrategy != null) {
- validatorStrategy.setDocument(doc);
- }
- if (fSemanticHighlightingStrategy != null) {
- fSemanticHighlightingStrategy.setDocument(doc);
- }
-
- fSpellcheckStrategy = null;
- if(fFoldingStrategy != null) {
- fFoldingStrategy.uninstall();
- }
- fFoldingStrategy = null;
-
- if (getDocument() instanceof IStructuredDocument) {
- RegionParser parser = ((IStructuredDocument) doc).getParser();
- if (parser instanceof StructuredDocumentRegionParser) {
- ((StructuredDocumentRegionParser) parser).addStructuredDocumentRegionHandler(fResetHandler);
- }
- }
- }
-
- protected void setEntireDocumentDirty(IDocument document) {
- super.setEntireDocumentDirty(document);
-
- // make the entire document dirty
- // this also happens on a "save as"
- if (document != null && isInstalled() && fLastPartitions != null && document.getLength() == 0) {
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053
- *
- * Process the strategies for the last known-good partitions.
- */
- for (int i = 0; i < fLastPartitions.length; i++) {
- ValidatorStrategy validatorStrategy = getValidatorStrategy();
- if (validatorStrategy != null) {
- validatorStrategy.reconcile(fLastPartitions[i], createDirtyRegion(fLastPartitions[i], DirtyRegion.REMOVE));
- }
- }
- IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
- if (spellingStrategy != null) {
- spellingStrategy.reconcile(new Region(0, document.getLength()));
- }
-
- //if there is a folding strategy then reconcile it
- if(getFoldingStrategy() != null) {
- getFoldingStrategy().reconcile(new Region(0, document.getLength()));
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#install(org.eclipse.jface.text.ITextViewer)
- */
- public void install(ITextViewer textViewer) {
- super.install(textViewer);
-
- //determine if validation is enabled
- this.fValidationEnabled = SSEUIPlugin.getInstance().getPreferenceStore().getBoolean(
- CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
- */
- public void uninstall() {
- if (isInstalled()) {
-
- IReconcilingStrategy validatorStrategy = getValidatorStrategy();
-
- if (validatorStrategy != null) {
- if (validatorStrategy instanceof IReleasable)
- ((IReleasable) validatorStrategy).release();
- }
-
- if (fSpellcheckStrategy != null) {
- fSpellcheckStrategy.setDocument(null);
- fSpellcheckStrategy = null;
- }
-
- fReconcileListeners = new ISourceReconcilingListener[0];
-
- if (getDocument() instanceof IStructuredDocument) {
- RegionParser parser = ((IStructuredDocument) getDocument()).getParser();
- if (parser instanceof StructuredDocumentRegionParser) {
- ((StructuredDocumentRegionParser) parser).removeStructuredDocumentRegionHandler(fResetHandler);
- }
- }
- }
- super.uninstall();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java
deleted file mode 100644
index 6f8b28f06d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-
-/**
- * A reconciler that allows IReconcilingStrategies to be assigned to partition
- * types. The reconciler will call the registered IReconcilingStrategy when
- * dirty regions which contain partitions of a specific type need to be
- * reconciled.
- *
- * @since 1.1
- */
-public interface IConfigurableReconciler {
- /**
- * Sets the reconciling strategy for the reconciler to use for the
- * specified content type.
- *
- * @param partitionType
- * the partition type
- * @param strategy
- * the reconciling strategy
- */
- void setReconcilingStrategy(String partitionType, IReconcilingStrategy strategy);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java
deleted file mode 100644
index e3b02b23e7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-/**
- * Defines an annotation key that the
- * <code>AbstractStructuredTextReconcilingStrategy</code> knows how to
- * remove appropriately.
- *
- * @deprecated not API, this will probably just become an abstract class
- *
- * @author pavery
- */
-public interface IReconcileAnnotationKey {
- static final int PARTIAL = 1;
- static final int TOTAL = 0;
-
- String getPartitionType();
-
- //int getScope();
-
- IReconcileStep getStep();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java
deleted file mode 100644
index d51bc9931e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java
+++ /dev/null
@@ -1,66 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-/**
- * @author pavery
- * @deprecated still working out API (or if anything here should be API)
- *
- * Interface for a step in StructuredRegionProcessor framework.
- */
-public interface IStructuredReconcileStep extends IReconcileStep {
- /**
- * Partitions for which this step can add/remove annotions
- *
- * @return an array of the partitions for which this step can add/remove
- * annotions
- */
- String[] getPartitionTypes();
-
- /**
- * Returns the scope for which this step adds annotations.
- *
- * @return the scope for which this step adds annotations
- */
- //int getScope();
-
- /**
- * Tells you if the step is equal to this step or any of the sibling
- * steps.
- *
- * @return
- */
- boolean isSiblingStep(IReconcileStep step);
-
- /**
- * Adds awareness that the Reconciler is reconciling the entire document
- * this call.
- *
- * @param dirtyRegion
- * @param subRegion
- * @param refreshAll
- * @return
- */
- IReconcileResult[] reconcile(DirtyRegion dirtyRegion, IRegion subRegion, boolean refreshAll);
-
- /**
- * Used to reset the state of the Strategy. For example: any flags that
- * need to be reset after a long running operation like processAll().
- */
- void reset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java
deleted file mode 100644
index 5b02f88117..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-
-
-/**
- * Interface for structured reconciling strategies.
- *
- * @deprecated doesn't need to be API and might go away
- *
- * @author pavery
- */
-public interface IStructuredReconcilingStrategy extends IReconcilingStrategy {
- /**
- * Adds awareness that the reconciler is processing the entire document
- * via refreshAll flag.
- *
- * @param dirtyRegion
- * @param subRegion
- * @param refreshAll
- */
- public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion, boolean refreshAll);
-
- /**
- * Used to reset the state of the Strategy. For example: any flags that
- * need to be reset after a long running operation like processAll().
- */
- public void reset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java
deleted file mode 100644
index e9284a3db7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-
-/**
- * Implementation of <code>IReconcileAnnotationKey</code> note: clients
- * should use the method StructuredReconcileStep#createKey(String
- * partitionType, int scope)
- *
- * @author pavery
- */
-public class ReconcileAnnotationKey {
-
- public static final int PARTIAL = 1;
- public static final int TOTAL = 0;
-
- private String fPartitionType = null;
-
- private IReconcileStep fReconcileStep = null;
- private int fScope;
-
- public ReconcileAnnotationKey(IReconcileStep step, String partitionType, int scope) {
- fReconcileStep = step;
- fPartitionType = partitionType;
- fScope = scope;
- }
-
- public String getPartitionType() {
- return fPartitionType;
- }
-
- public int getScope() {
- return fScope;
- }
-
- public IReconcileStep getStep() {
- return fReconcileStep;
- }
-
- public String toString() {
- return this.getClass() + "\r\nid: " + fPartitionType; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
deleted file mode 100644
index bd8b0b7813..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
+++ /dev/null
@@ -1,193 +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.sse.ui.internal.reconcile;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.AbstractReconcileStep;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-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.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * ReconcileStep that knows about the annotation that it adds to the
- * AnnotationModel. It knows how to create an annotation key (for smart
- * removal later) It knows the partition types on which it can operate. It
- * knows the scope on which it operates (for short circuiting) It knows if the
- * Reconciler is reconciling the entire document.
- *
- * Clients must subclass this class.
- *
- * @author pavery
- */
-public abstract class StructuredReconcileStep extends AbstractReconcileStep implements IReleasable {
-
- /** debug flag */
- protected static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- protected final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0];
-
- /**
- * It's possible for a partial step to get called on the same area twice
- * (as w/ a full document reconcile) this list keeps track of area already
- * covered. Should be reset() after the "batch" of reconciling is
- * finished.
- */
- private HashSet fPartitionTypes = null;
-
- public StructuredReconcileStep() {
- super();
- fPartitionTypes = new HashSet();
- }
-
- public ReconcileAnnotationKey createKey(IStructuredDocumentRegion sdRegion, int scope) {
-
- ITypedRegion tr = getPartition(sdRegion);
- String partitionType = (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION;
- return createKey(partitionType, scope);
- }
-
- /**
- * @param sdRegion
- * @return
- */
- protected ITypedRegion getPartition(IStructuredDocumentRegion sdRegion) {
- ITypedRegion tr = null;
- if (!sdRegion.isDeleted())
- tr = getPartition(sdRegion.getParentDocument(), sdRegion.getStartOffset());
- return tr;
- }
-
- private ITypedRegion getPartition(IDocument doc, int offset) {
- ITypedRegion tr = null;
- // not sure why document would ever be null, but put in this
- // guard for
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86069
- if (doc != null) {
- try {
- tr = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
- } catch (BadLocationException e) {
- if (DEBUG)
- Logger.logException("problem getting partition at: " + offset, e); //$NON-NLS-1$
- }
- }
- return tr;
- }
-
- /**
- * Clients should use this method to create annotation keys as it
- * registers the key for removal later.
- *
- * @param partitionType
- * @param scope
- * @return
- */
- public ReconcileAnnotationKey createKey(String partitionType, int scope) {
- fPartitionTypes.add(partitionType);
- return new ReconcileAnnotationKey(this, partitionType, scope);
- }
-
- protected IDocument getDocument() {
- IDocument doc = null;
- IReconcilableModel rModel = getModel();
- if (rModel instanceof DocumentAdapter) {
- doc = ((DocumentAdapter) rModel).getDocument();
- }
- return doc;
- }
-
- public IReconcilableModel getModel() {
- return getInputModel();
- }
-
- public String getPartitionType(IDocument doc, int offset) {
- ITypedRegion tr = getPartition(doc, offset);
- return (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION;
- }
-
- public String[] getPartitionTypes() {
- // using hash set to automatically get rid of dupes
- HashSet tempResults = new HashSet();
- // add these partition types
- tempResults.addAll(fPartitionTypes);
- return (String[]) tempResults.toArray(new String[tempResults.size()]);
- }
-
- protected IStructuredDocument getStructuredDocument() {
- IStructuredDocument sDoc = null;
- IDocument doc = getDocument();
- if (doc instanceof IStructuredDocument)
- sDoc = (IStructuredDocument) getDocument();
- return sDoc;
- }
-
- /**
- * Removes duplicates.
- *
- * @param results1
- * @param results2
- * @return
- */
- protected IReconcileResult[] merge(IReconcileResult[] results1, IReconcileResult[] results2) {
- if (results1 == null)
- return results2;
- if (results2 == null)
- return results1;
-
- List results = new ArrayList();
- results.addAll(Arrays.asList(results1));
- for (int i = 0; i < results2.length; i++) {
- results.add(results2[i]);
- }
- return (IReconcileResult[]) results.toArray(new IReconcileResult[results.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.reconciler.AbstractReconcileStep#reconcileModel(org.eclipse.jface.text.reconciler.DirtyRegion,
- * org.eclipse.jface.text.IRegion)
- */
- protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion, IRegion subRegion) {
- return EMPTY_RECONCILE_RESULT_SET;
- }
-
- /**
- * Release resources used by the step here as needed. Be sure to call
- * super.release() when you override this method as to propagate the
- * release through all steps.
- */
- public void release() {
- //
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
deleted file mode 100644
index 03b2dde56d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-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;
-
-/**
- * An IStructuredModel aware Region Processor. Adds ModelLifecycle listener.
- * ModelLifecycle listener notifies us that some reinitialization needs to
- * take place.
- *
- * Model aware "process()" Implements a IndexedRegion-based "contains()"
- * method using IStructuredModel.
- *
- */
-public class StructuredRegionProcessor extends DocumentRegionProcessor {
- class ModelLifecycleListener implements IModelLifecycleListener {
- IStructuredModel changing = null;
- /**
- * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
- */
- public void processPostModelEvent(ModelLifecycleEvent event) {
-
- // if underlying StructuredDocument changed, need to reconnect it
- // here...
- // ex. file is modified outside the workbench
- if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
- if (changing != null && event.getModel() == changing) {
- IStructuredDocument sDoc = event.getModel().getStructuredDocument();
-
- if (DEBUG) {
- System.out.println("======================================================"); //$NON-NLS-1$
- System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
- System.out.println(sDoc.get());
- System.out.println("======================================================"); //$NON-NLS-1$
- }
- setDocument(sDoc);
- }
- changing = null;
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
- */
- public void processPreModelEvent(ModelLifecycleEvent event) {
- if(fCurrentDoc != null) {
- IStructuredModel model = null;
- try {
- model = getStructuredModelForRead(fCurrentDoc);
- if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED && event.getModel() == model) {
- changing = event.getModel();
- flushDirtyRegionQueue();
- // note: old annotations are removed via the strategies on
- // AbstractStructuredTextReconcilingStrategy#setDocument(...)
- }
- } finally {
- if(model != null) {
- model.releaseFromRead();
- }
- }
- }
- }
- }
-
- /**
- * The life cycle listener used to listen to the current documents model even though
- * this class does not hold onto a reference to the model.
- */
- private IModelLifecycleListener fLifeCycleListener = new ModelLifecycleListener();
- /** Used to get the current model on demand so a model does not need to be held by permanently */
- private IDocument fCurrentDoc = null;
-
- /** Only to be used for content type and IModelLifecycleListener registration. All other uses should "get" the model. */
- private IStructuredModel fCurrentModel = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#getOuterRegion(org.eclipse.jface.text.reconciler.DirtyRegion,
- * org.eclipse.jface.text.reconciler.DirtyRegion)
- */
- protected DirtyRegion getOuterRegion(DirtyRegion root, DirtyRegion possible) {
- // first try simple region check if one region contains the other
- DirtyRegion outer = super.getOuterRegion(root, possible);
- if (outer == null && fCurrentDoc != null) {
- IStructuredModel sModel = null;
- try {
- sModel = getStructuredModelForRead(fCurrentDoc);
- if (sModel != null) {
- // now compare nodes
- IndexedRegion rootRegion = sModel.getIndexedRegion(root.getOffset());
- IndexedRegion possRegion = sModel.getIndexedRegion(possible.getOffset());
- if (rootRegion != null && possRegion != null) {
- int rootStart = rootRegion.getStartOffset();
- int possStart = possRegion.getStartOffset();
- // first just check if rootregion starts before
- // possregion
- if (rootStart <= possStart) {
- // check if possregion is inside rootregion
- outer = _getOuterRegion(root, possible, sModel, rootStart, possStart);
- }
- else {
- // otherwise if rootregion is inside possregion
- outer = _getOuterRegion(possible, root, sModel, possStart, rootStart);
- }
- }
- }
-
- } finally {
- if(sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
- return outer;
- }
-
- /**
- * Assumes that when this method is called, region1's node start offset >=
- * region2's node start offset. Determines if region1 contains region2 or
- * vice versa. Returns region1 if:
- * <ul>
- * <li>region1's node region == region2's node region</li>
- * <li>region1's node region contains region2's node region</li>
- * </ul>
- * Returns region2 if:
- * <ul>
- * <li>region1's node region and region2's node region starts at same
- * offset but region2's node region is longer</li>
- * </ul>
- * Returns null otherwise.
- *
- * @param region1
- * @param region2
- * @param sModel
- * @param region1NodeStart
- * @param region2NodeStart
- * @return outer dirty region or null if none exists.
- */
- private DirtyRegion _getOuterRegion(DirtyRegion region1, DirtyRegion region2, IStructuredModel sModel, int region1NodeStart, int region2NodeStart) {
- DirtyRegion outer = null;
- int region1NodeEnd = -1;
- int region2NodeEnd = -1;
- // then check if region1's end appears after
- // region2's end
- IndexedRegion region1EndNode = sModel.getIndexedRegion(region1.getOffset() + region1.getLength());
- if (region1EndNode == null) {
- // if no end, just assume region spans all the
- // way to the end so it includes other region
- outer = region1;
- }
- else {
- region1NodeEnd = region1EndNode.getEndOffset();
- IndexedRegion region2EndNode = sModel.getIndexedRegion(region2.getOffset() + region2.getLength());
- region2NodeEnd = region2EndNode != null ? region2EndNode.getEndOffset() : getDocument().getLength();
- if (region1NodeEnd >= region2NodeEnd) {
- // root contains or is equal to possible
- outer = region1;
- }
- else if (region1NodeStart == region2NodeStart && region2NodeEnd >= region1NodeEnd) {
- // possible contains root because they
- // both start at same place but possible
- // is longer
- outer = region2;
- }
- }
- if (DEBUG) {
- if (outer != null)
- System.out.println("checking if [" + region1NodeStart + ":" + region1NodeEnd + "] contains [" + region2NodeStart + ":" + region2NodeEnd + "] ... " + outer.toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- else
- System.out.println("checking if [" + region1NodeStart + ":" + region1NodeEnd + "] contains [" + region2NodeStart + ":" + region2NodeEnd + "] ... NO CONTAIN"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- return outer;
- }
-
- /**
- * We already know content type from when we created the model, so just
- * use that.
- */
- protected String getContentType(IDocument doc) {
- if (fCurrentModel != null && doc == fCurrentModel.getStructuredDocument()) {
- /*
- * Avoid "get"ting a model if we can, it may require lock
- * acquisition
- */
- return fCurrentModel.getContentTypeIdentifier();
- }
-
- String contentTypeId = null;
- IStructuredModel sModel = null;
- try {
- sModel = getStructuredModelForRead(doc);
- if (sModel != null) {
- contentTypeId = sModel.getContentTypeIdentifier();
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return contentTypeId;
- }
-
-
- /**
- * Remember to release model after use!!
- *
- * @return
- */
- private IStructuredModel getStructuredModelForRead(IDocument doc) {
- IStructuredModel sModel = null;
- if (doc != null && doc instanceof IStructuredDocument)
- sModel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument) doc);
- return sModel;
- }
-
- protected void process(DirtyRegion dirtyRegion) {
- if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null)
- return;
-
- // unhook old lifecycle listener
- if(fCurrentDoc != null) {
- IStructuredModel sModel = null;
- try {
- sModel = getStructuredModelForRead(fCurrentDoc);
-
- // use structured model to determine area to process
- if (sModel != null) {
- int start = dirtyRegion.getOffset();
- int end = start + dirtyRegion.getLength();
- IndexedRegion irStart = sModel.getIndexedRegion(start);
- IndexedRegion irEnd = sModel.getIndexedRegion(end);
-
- if (irStart != null) {
- start = Math.min(start, irStart.getStartOffset());
- }
- if (irEnd != null) {
- end = Math.max(end, irEnd.getEndOffset());
- }
- super.process(createDirtyRegion(start, end - start, DirtyRegion.INSERT));
- } else {
- super.process(dirtyRegion);
- }
- } finally {
- if(sModel != null) {
- sModel.releaseFromRead();
- }
- }
- } else {
- super.process(dirtyRegion);
- }
- }
-
- /**
- * Reinitializes listeners and sets new document onall strategies.
- *
- * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
- */
- protected void reconcilerDocumentChanged(IDocument newDocument) {
- setDocument(newDocument);
- }
-
- public void setDocument(IDocument newDocument) {
- /*
- * unhook old lifecycle listener; it is important not to re-get the
- * model at this point as we may be shutting down
- */
- if (fCurrentModel != null) {
- fCurrentModel.removeModelLifecycleListener(fLifeCycleListener);
- fCurrentModel = null;
- }
-
- // set the new document
- super.setDocument(newDocument);
- fCurrentDoc = newDocument;
-
- // add new lifecycle listener
- if (fCurrentDoc != null) {
- try {
- fCurrentModel = getStructuredModelForRead(fCurrentDoc);
- if (fCurrentModel != null) {
- fCurrentModel.addModelLifecycleListener(fLifeCycleListener);
- }
- }
- finally {
- if (fCurrentModel != null) {
- fCurrentModel.releaseFromRead();
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
deleted file mode 100644
index f995d23d38..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
+++ /dev/null
@@ -1,75 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.ISourceViewer;
-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;
-
-/**
- * Uses IStructuredModel nodes to check "overlaps()" when getting annotations to remove.
- */
-public abstract class StructuredTextReconcilingStrategy extends AbstractStructuredTextReconcilingStrategy {
-
-
- public StructuredTextReconcilingStrategy(ISourceViewer sourceViewer) {
- super(sourceViewer);
- }
-
- /**
- * Checks if this position overlaps any of the StructuredDocument regions'
- * correstponding IndexedRegion.
- *
- * @param pos
- * @param dr
- * @return true if the position overlaps any of the regions, otherwise
- * false.
- */
- protected boolean overlaps(Position pos, IStructuredDocumentRegion[] sdRegions) {
- int start = -1;
- int end = -1;
- for (int i = 0; i < sdRegions.length; i++) {
- if(!sdRegions[i].isDeleted()) {
- IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
- if(corresponding != null) {
- if (start == -1 || start > corresponding.getStartOffset())
- start = corresponding.getStartOffset();
- if (end == -1 || end < corresponding.getEndOffset())
- end = corresponding.getEndOffset();
- }
- }
- }
- return pos.overlapsWith(start, end - start);
- }
-
- /**
- * Returns the corresponding node for the StructuredDocumentRegion.
- *
- * @param sdRegion
- * @return the corresponding node for sdRegion
- */
- protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- IndexedRegion indexedRegion = null;
- try {
- if (sModel != null)
- indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());
- } finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return indexedRegion;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
deleted file mode 100644
index 4f7ea9b0de..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
+++ /dev/null
@@ -1,258 +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.sse.ui.internal.reconcile;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationAccessExtension;
-import org.eclipse.jface.text.source.IAnnotationPresentation;
-import org.eclipse.jface.text.source.ImageUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-
-
-/**
- * An implementation of ITemporaryAnnotation @
- * @author pavery
- */
-public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotation, IReconcileResult, IAnnotationPresentation, IQuickFixableAnnotation {
- // remember to change these if it changes in the extension point
- // may need a different home for them in the future, but they're here for
- // now
- public final static String ANNOT_ERROR = "org.eclipse.wst.sse.ui.temp.error"; //$NON-NLS-1$
- public final static String ANNOT_INFO = "org.eclipse.wst.sse.ui.temp.info"; //$NON-NLS-1$
-
- // pa_TODO what should the ID be for this?
- public final static String ANNOT_UNKNOWN = Annotation.TYPE_UNKNOWN;
- public final static String ANNOT_WARNING = "org.eclipse.wst.sse.ui.temp.warning"; //$NON-NLS-1$
-
- // copied from CompilationUnitDocumentProvider.ProblemAnnotation
- //XXX: To be fully correct these constants should be non-static
-
- private static final int INFO_LAYER;
-
- private static final int WARNING_LAYER;
-
- private static final int ERROR_LAYER;
-
- static {
- AnnotationPreferenceLookup lookup= EditorsUI.getAnnotationPreferenceLookup();
- INFO_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.info", lookup); //$NON-NLS-1$
- WARNING_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.warning", lookup); //$NON-NLS-1$
- ERROR_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.error", lookup); //$NON-NLS-1$
- }
-
- private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) {
- Annotation annotation= new Annotation(annotationType, false, null);
- AnnotationPreference preference= lookup.getAnnotationPreference(annotation);
- if (preference != null)
- return preference.getPresentationLayer() + 1;
- else
- return IAnnotationAccessExtension.DEFAULT_LAYER + 1;
- }
-
-
- private Object fAdditionalFixInfo = null;
-
- private Object fKey = null;
- private Position fPosition = null;
- private Map fAttributes = null;
- private boolean fIsQuickFixable = false;
- private boolean fIsQuickFixableStateSet = false;
-
- private int fProblemID;
-
- private int fLayer = DEFAULT_LAYER;
-
- private Image fImage = null;
-
- public TemporaryAnnotation(Position p, String type, String message, ReconcileAnnotationKey key) {
- super();
- fPosition = p;
- setType(type);
- fKey = key;
- setText(message);
- initLayer();
- initImage();
- }
-
- public TemporaryAnnotation(Position p, String type, String message, ReconcileAnnotationKey key, int problemId) {
- super();
- fPosition = p;
- fKey = key;
- setType(type);
- setText(message);
- fProblemID = problemId;
- initLayer();
- initImage();
- }
-
- private void initLayer() {
-
- String type = getType();
- if(type.equals(ANNOT_ERROR)) {
- fLayer = ERROR_LAYER;
- }
- else if(type.equals(ANNOT_WARNING)) {
- fLayer = WARNING_LAYER;
- }
- else if(type.equals(ANNOT_INFO)) {
- fLayer = INFO_LAYER;
- }
- }
-
- private void initImage() {
- // later we can add support for quick fix images.
- String type = getType();
- if(type.equals(ANNOT_ERROR)) {
- fImage = null;
- }
- else if(type.equals(ANNOT_WARNING)) {
- fImage = null;
- }
- else if(type.equals(ANNOT_INFO)) {
- fImage = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- // this check doesn't take into consideration that annotation
- // positions that change from a text edit before it
- // we should be checking if the annotation is still on the same line,
- // and the distance from the start of the line is the same
- if (obj instanceof TemporaryAnnotation) {
-
- TemporaryAnnotation ta = (TemporaryAnnotation) obj;
-
- boolean samePosition = ta.getPosition().equals(this.getPosition());
- boolean sameText = false;
-
- if(ta.getText() != null && this.getText() != null && ta.getText().equals(this.getText()))
- sameText = true;
- else if(ta.getText( )== null && this.getText() == null)
- sameText = true;
-
- return sameText && samePosition;
- }
- return super.equals(obj);
- }
-
- /**
- * Additional info required to fix this problem.
- *
- * @return an Object that contains additional info on how to fix this
- * problem, or null if there is none
- */
- public Object getAdditionalFixInfo() {
- return fAdditionalFixInfo;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.ITemporaryAnnotation#getDescription()
- */
- public String getDescription() {
- return getText();
- }
-
- public Object getKey() {
- return fKey;
- }
-
- public Position getPosition() {
- return fPosition;
- }
-
- /**
- * @return Returns the problemID.
- */
- public int getProblemID() {
- return fProblemID;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.Annotation#isPersistent()
- */
- public boolean isPersistent() {
- return false;
- }
-
- /**
- * Sets additional information useful to fixing this problem.
- *
- * @param an
- * Object that contains additional info on how to fix this
- * problem
- */
- public void setAdditionalFixInfo(Object info) {
- fAdditionalFixInfo = info;
- setQuickFixable(true);
- }
-
- public int getLayer() {
- return fLayer;
- }
-
- /*
- * @see Annotation#paint
- */
- public void paint(GC gc, Canvas canvas, Rectangle r) {
- //initializeImages();
- if (fImage != null)
- ImageUtilities.drawImage(fImage, gc, canvas, r, SWT.CENTER, SWT.TOP);
- }
-
- public String toString() {
- return "" + fPosition.getOffset() + ':' + fPosition.getLength() + ": " + getText(); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public Map getAttributes() {
- return fAttributes;
- }
-
- public void setAttributes(Map attributes) {
- fAttributes = attributes;
- }
-
- public boolean isQuickFixable() {
- return fIsQuickFixable;
- }
-
- public void setQuickFixable(boolean state) {
- fIsQuickFixable = state;
- fIsQuickFixableStateSet = true;
- }
-
- public boolean isQuickFixableStateSet() {
- return fIsQuickFixableStateSet;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java
deleted file mode 100644
index 609420e136..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Holds info to create a TemporaryAnnotation.
- *
- * @since 1.0
- */
-public class AnnotationInfo {
-
- public static final int NO_PROBLEM_ID = -1;
- private IMessage fMessage = null;
- private Object fAdditionalFixInfo = null;
- private int fProblemId = NO_PROBLEM_ID;
-
- public AnnotationInfo(IMessage message) {
- fMessage = message;
-
- }
- public AnnotationInfo(IMessage message, int problemId, Object additionalFixInfo) {
- this(message);
- fProblemId = problemId;
- fAdditionalFixInfo = additionalFixInfo;
- }
-
- public final IMessage getMessage() {
- return fMessage;
- }
-
- public final Object getAdditionalFixInfo() {
- return fAdditionalFixInfo;
- }
-
- public final int getProblemId() {
- return fProblemId;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java
deleted file mode 100644
index 1e09976ca9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-/**
- * Interface to allow for "partial document" as you type validation.
- *
- */
-public interface ISourceValidator {
-
- /**
- * As you type validation is getting "hooked up" to this IDocument.
- * This is the instance of IDocument that the validator should
- * operate on for each validate call.
- *
- * @param document
- */
- void connect(IDocument document);
-
- /**
- * The same IDocument passed in from the connect() method.
- * This indicates that as you type validation is "shutting down"
- * for this IDocument.
- *
- * @param document
- */
- void disconnect(IDocument document);
-
- /**
- * Like IValidator#validate(IValidationContext helper, IReporter reporter)
- * except passes the dirty region, so document validation can be better
- * optimized.
- *
- * @param dirtyRegion
- * @param helper
- * @param reporter
- */
- void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
deleted file mode 100644
index 9615163b08..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
+++ /dev/null
@@ -1,57 +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.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-
-
-public class IncrementalHelper implements IValidationContext {
- private IProject fProject;
-
- private String fURI = null;
-
- public IncrementalHelper(IDocument sourceDocument, IProject project) {
- super();
- fProject = project;
- }
-
- public String getPortableName(IResource resource) {
- return resource.getProjectRelativePath().toString();
- }
-
- public IProject getProject() {
- return fProject;
- }
-
- public Object loadModel(String symbolicName) {
- return null;
- }
-
- public Object loadModel(String symbolicName, Object[] parms) {
- return null;
- }
-
- public void setURI(String uri) {
- fURI = uri;
- }
-
- public String[] getURIs() {
- if(fURI != null)
- return new String[]{fURI};
- return new String[0];
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java
deleted file mode 100644
index d1c8e2cb5e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java
+++ /dev/null
@@ -1,111 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-
-/**
- * Right now we'll only use one reporter per validator.
- */
-public class IncrementalReporter implements IReporter {
- private IProgressMonitor fProgressMonitor;
- private HashMap messages = new HashMap();
-
- public IncrementalReporter(IProgressMonitor progressMonitor) {
- super();
- fProgressMonitor = progressMonitor;
- }
-
- public void addMessage(IValidator validator, IMessage message) {
- AnnotationInfo info = new AnnotationInfo(message);
- addAnnotationInfo(validator, info);
- }
-
- public final void addAnnotationInfo(IValidator validator, AnnotationInfo info) {
- Object existingValue = messages.get(validator);
- if (existingValue != null) {
- ((HashSet) existingValue).add(info);
- }
- else {
- HashSet newValue = new HashSet(1);
- newValue.add(info);
- messages.put(validator, newValue);
- }
- }
-
- public void displaySubtask(IValidator validator, IMessage message) {
- if ((message == null) || (message.equals(""))) { //$NON-NLS-1$
- return;
- }
- if (fProgressMonitor != null) {
- fProgressMonitor.subTask(message.getText(validator.getClass().getClassLoader()));
- }
- }
-
- public List getMessages() {
- List result = new ArrayList();
- // messages is a list of:
- // validators => HashSet(AnnotationInfo1, AnnotationInfo2, ...)
- // (one HashSet per validator...)
- Object[] lists = messages.values().toArray();
- for (int i = 0; i < lists.length; i++) {
- Iterator it = ((HashSet)lists[i]).iterator();
- while (it.hasNext()) {
- AnnotationInfo info = (AnnotationInfo) it.next();
- result.add(info.getMessage());
- }
- }
- return result;
- }
-
- public AnnotationInfo[] getAnnotationInfo() {
- List result = new ArrayList();
- Object[] infos = messages.values().toArray();
- for (int i = 0; i < infos.length; i++) {
- result.addAll((HashSet)infos[i]);
- }
- return (AnnotationInfo[])result.toArray(new AnnotationInfo[result.size()]);
- }
-
- public boolean isCancelled() {
- if (fProgressMonitor == null)
- return false;
- return fProgressMonitor.isCanceled();
- }
-
- public void removeAllMessages(IValidator validator) {
- Object o = messages.get(validator);
- if(o != null && o instanceof HashSet) {
- ((HashSet)o).clear();
- }
- }
-
- public void removeAllMessages(IValidator validator, Object object) {
- removeAllMessages(validator);
- }
-
- // group names are unsupported
- public void removeMessageSubset(IValidator validator, Object obj, String groupName) {
- removeAllMessages(validator);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
deleted file mode 100644
index 9aad1c6054..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.IReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-
-/**
- * A reconcile step for an IValidator for reconcile. Used the reconcile
- * framework to create TemporaryAnnotations from the validator messages.
- *
- * @author pavery
- */
-public class ReconcileStepForValidator extends StructuredReconcileStep {
-
- /** debug flag */
- protected static final boolean DEBUG;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0];
- private IncrementalHelper fHelper = null;
- private IncrementalReporter fReporter = null;
-
- /**
- * Declared scope of this validator, either ReconcileAnnotationKey.TOTAL
- * or ReconcileAnnotationKey.PARTIAL
- */
- private int fScope = -1;
- private IValidator fValidator = null;
- private final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
-
-
- public ReconcileStepForValidator(IValidator v, int scope) {
- super();
-
- if (v == null)
- throw new IllegalArgumentException("validator cannot be null"); //$NON-NLS-1$
-
- fValidator = v;
- fScope = scope;
- }
-
- /**
- * Converts a map of IValidatorForReconcile to List to annotations based
- * on those messages
- *
- * @param messages
- * @return
- */
- // protected IReconcileResult[] createAnnotations(List messageList) {
- // List annotations = new ArrayList();
- // for (int i = 0; i < messageList.size(); i++) {
- // IMessage validationMessage = (IMessage) messageList.get(i);
- //
- // int offset = validationMessage.getOffset();
- //
- // if (offset < 0)
- // continue;
- //
- // String messageText = null;
- // try {
- // messageText =
- // validationMessage.getText(validationMessage.getClass().getClassLoader());
- // }
- // catch (Exception t) {
- // Logger.logException("exception reporting message from validator", t);
- // //$NON-NLS-1$
- // continue;
- // }
- //
- // String type = getSeverity(validationMessage);
- // // this position seems like it would be possibly be the wrong
- // // length
- // int length = validationMessage.getLength();
- // if (length >= 0) {
- // Position p = new Position(offset, length);
- // ReconcileAnnotationKey key = createKey(getPartitionType(getDocument(),
- // offset), getScope());
- // annotations.add(new TemporaryAnnotation(p, type, messageText, key));
- // }
- // }
- //
- // return (IReconcileResult[]) annotations.toArray(new
- // IReconcileResult[annotations.size()]);
- // }
- /**
- * Converts a map of IValidatorForReconcile to List to annotations based
- * on those messages
- *
- * @param messages
- * @return
- */
- protected IReconcileResult[] createAnnotations(AnnotationInfo[] infos) {
-
-
- List annotations = new ArrayList();
- for (int i = 0; i < infos.length; i++) {
-
- AnnotationInfo info = infos[i];
-
- IMessage validationMessage = info.getMessage();
- int offset = validationMessage.getOffset();
- if (offset < 0)
- continue;
-
- String messageText = null;
- try {
- messageText = validationMessage.getText(validationMessage.getClass().getClassLoader());
- }
- catch (Exception t) {
- Logger.logException("exception reporting message from validator", t); //$NON-NLS-1$
- continue;
- }
- String type = getSeverity(validationMessage);
- // this position seems like it would be possibly be the wrong
- // length
- int length = validationMessage.getLength();
- if (length >= 0) {
-
- Position p = new Position(offset, length);
- ReconcileAnnotationKey key = createKey(getPartitionType(getDocument(), offset), getScope());
-
- // create an annotation w/ problem ID and fix info
- TemporaryAnnotation annotation = new TemporaryAnnotation(p, type, messageText, key);
- Object extraInfo = info.getAdditionalFixInfo();
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=170988
- // add quick fix information
- if (extraInfo == null) {
- extraInfo = validationMessage.getAttribute(QUICKASSISTPROCESSOR);
- }
- annotation.setAdditionalFixInfo(extraInfo);
- annotation.setAttributes(validationMessage.getAttributes());
- annotations.add(annotation);
- }
- }
- return (IReconcileResult[]) annotations.toArray(new IReconcileResult[annotations.size()]);
- }
-
- private String getSeverity(IMessage validationMessage) {
- String type = TemporaryAnnotation.ANNOT_INFO;
- switch (validationMessage.getSeverity()) {
- case IMessage.HIGH_SEVERITY :
- type = TemporaryAnnotation.ANNOT_ERROR;
- break;
- case IMessage.NORMAL_SEVERITY :
- type = TemporaryAnnotation.ANNOT_WARNING;
- break;
- case IMessage.LOW_SEVERITY :
- type = TemporaryAnnotation.ANNOT_WARNING;
- break;
- case IMessage.ERROR_AND_WARNING :
- type = TemporaryAnnotation.ANNOT_WARNING;
- break;
- }
- return type;
- }
-
- private IFile getFile() {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- IFile file = null;
- if(modelManager != null) {
- try {
- model = modelManager.getExistingModelForRead(getDocument());
- 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 && !basePath.toFile().exists()) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return file;
- }
-
- private IncrementalHelper getHelper(IProject project) {
- if (fHelper == null)
- fHelper = new IncrementalHelper(getDocument(), project);
- return fHelper;
- }
-
- private IncrementalReporter getReporter() {
- if (fReporter == null)
- fReporter = new IncrementalReporter(getProgressMonitor());
- return fReporter;
- }
-
- /**
- * If this validator is partial or total
- *
- * @return
- */
- public int getScope() {
- return fScope;
- }
-
- public void initialReconcile() {
- // do nothing
- }
-
- protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion, IRegion subRegion) {
- if (DEBUG)
- System.out.println("[trace reconciler] > reconciling model in VALIDATOR step w/ dirty region: [" + dirtyRegion.getText() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
- IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
- if (dirtyRegion != null) {
- try {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=247714
- if (fValidator instanceof ISourceValidator && getScope() == ReconcileAnnotationKey.PARTIAL) {
- results = validate(dirtyRegion, subRegion);
- }
- else {
- results = validate();
- }
- }
- catch (Exception ex) {
- Logger.logException("EXEPTION IN RECONCILE STEP FOR VALIDATOR", ex); //$NON-NLS-1$
- }
- }
-
- if (DEBUG)
- System.out.println("[trace reconciler] > VALIDATOR step done"); //$NON-NLS-1$
-
- return results;
- }
-
- public String toString() {
- StringBuffer debugString = new StringBuffer("ValidatorStep: "); //$NON-NLS-1$
- if (fValidator != null)
- debugString.append(fValidator.toString());
- return debugString.toString();
- }
-
- protected IReconcileResult[] validate() {
- IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
-
- IFile file = getFile();
- IncrementalReporter reporter = null;
-
- try {
- IncrementalHelper helper = getHelper(file != null ? file.getProject() : null);
-
- if (file != null && file.isAccessible()) {
- helper.setURI(file.getFullPath().toString());
- }
- else {
- String uri = getURI();
- if (uri != null) {
- helper.setURI(uri);
- }
- }
-
- reporter = getReporter();
- fValidator.validate(helper, reporter);
-
- // results = createAnnotations(reporter.getMessages());
- results = createAnnotations(reporter.getAnnotationInfo());
- reporter.removeAllMessages(fValidator);
-
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- finally {
- fValidator.cleanup(reporter);
- }
- return results;
- }
-
- /**
- * @return
- */
- private String getURI() {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- if (model != null && !(IModelManager.UNMANAGED_MODEL.equals(model.getBaseLocation()))) {
- return model.getBaseLocation();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return null;
- }
-
- public void setInputModel(IReconcilableModel inputModel) {
- if (inputModel instanceof DocumentAdapter) {
- IDocument document = ((DocumentAdapter) inputModel).getDocument();
- if (document != null) {
- if (fValidator instanceof ISourceValidator) {
- // notify that document connecting
- ((ISourceValidator) fValidator).connect(document);
- }
- }
- }
- super.setInputModel(inputModel);
- }
-
- public void release() {
- if (fValidator instanceof ISourceValidator) {
- IDocument document = getDocument();
- if (document != null) {
- // notify that document disconnecting
- ((ISourceValidator) fValidator).disconnect(document);
- }
- fValidator.cleanup(getReporter());
- }
- super.release();
- }
-
- protected IReconcileResult[] validate(DirtyRegion dirtyRegion, IRegion subRegion) {
- IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
-
- IFile file = getFile();
-
- try {
- IncrementalHelper helper = getHelper(file != null ? file.getProject() : null);
- /*
- * Setting the URI isn't necessary for all source validators, we
- * can still continue without it
- */
- if (file != null && file.exists()) {
- helper.setURI(file.getFullPath().toString());
- }
-
- if (fValidator instanceof ISourceValidator) {
- IncrementalReporter reporter = getReporter();
- if (getScope() == IReconcileAnnotationKey.PARTIAL)
- ((ISourceValidator) fValidator).validate(dirtyRegion, helper, reporter);
- else
- ((ISourceValidator) fValidator).validate(new Region(0, getDocument().getLength()), helper, reporter);
- /*
- * call IValidator.cleanup() during release() because this
- * validator might be called again on a different region
- */
- // results = createAnnotations(reporter.getMessages());
- results = createAnnotations(reporter.getAnnotationInfo());
- reporter.removeAllMessages(fValidator);
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- return results;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java
deleted file mode 100644
index e1f6ccee48..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java
+++ /dev/null
@@ -1,139 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-
-
-/**
- * Based off of TransferBuilder. Reads the extension point for
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
- */
-public class ValidatorBuilder extends RegistryReader {
-
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_SCOPE = "scope"; //$NON-NLS-1$
-
- public static final ValidatorMetaData[] EMTPY_VMD_ARRAY = new ValidatorMetaData[0];
-
- // extension point ID
- public static final String PL_SOURCE_VALIDATION = "sourcevalidation"; //$NON-NLS-1$
-
- public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
- public static final String TAG_CONTENT_TYPE_IDENTIFIER = "contentTypeIdentifier"; //$NON-NLS-1$
- public static final String TAG_PARTITION_TYPE = "partitionType"; //$NON-NLS-1$
-
- public static final String TAG_VALIDATOR = "validator"; //$NON-NLS-1$
-
- public static final String TRACE_FILTER = "reconcile_validator"; //$NON-NLS-1$
-
- public static final String TRUE = "true"; //$NON-NLS-1$
- private String fCurrentCTID;
- private ValidatorMetaData fCurrentVMD = null;
- private List fVmds = new ArrayList();
- protected String targetContributionTag;
- protected String targetID;
-
- private final String UNKNOWN = "???"; //$NON-NLS-1$
-
- /**
- * Returns the name of the part ID attribute that is expected in the
- * target extension.
- *
- * @param element
- * @return String
- */
- protected String getID(IConfigurationElement element) {
- String value = element.getAttribute(ATT_ID);
- return value != null ? value : UNKNOWN; //$NON-NLS-1$
- }
-
- protected String getValidatorClass(IConfigurationElement element) {
- String value = element.getAttribute(ATT_CLASS);
- return value != null ? value : UNKNOWN; //$NON-NLS-1$
- }
-
- /**
- * @param editorId
- * @return Transfer[]
- */
- public ValidatorMetaData[] getValidatorMetaData(String editorId) {
- readContributions(editorId, TAG_VALIDATOR, PL_SOURCE_VALIDATION);
- return (ValidatorMetaData[]) fVmds.toArray(new ValidatorMetaData[fVmds.size()]);
- }
-
- protected String getValidatorScope(IConfigurationElement element) {
- String value = element.getAttribute(ATT_SCOPE);
- return value != null ? value : UNKNOWN; //$NON-NLS-1$
- }
-
- /**
- * Reads the contributions from the registry for the provided workbench
- * part and the provided extension point ID.
- *
- * @param id
- * @param tag
- * @param extensionPoint
- */
- protected void readContributions(String id, String tag, String extensionPoint) {
- targetID = id;
- targetContributionTag = tag;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- readRegistry(registry, PLUGIN_ID, extensionPoint);
- }
-
- protected boolean readElement(IConfigurationElement element) {
- String tag = element.getName();
- //ie. targetContributionTag == validator
- if (tag.equals(targetContributionTag)) {
- String vId = getID(element);
- String vClass = getValidatorClass(element);
- String vScope = getValidatorScope(element);
-
- if (vId == null) {
- // This is not of interest to us - don't go deeper
- return true;
- }
- // start building a VMD
- fCurrentVMD = new ValidatorMetaData(element, vId, vClass, vScope);
- fVmds.add(fCurrentVMD);
-
- if (Logger.isTracing(ValidatorBuilder.TRACE_FILTER))
- System.out.println("added reconcile validator: " + vId + ":" + vClass + ":" + vScope); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else if (tag.equals(TAG_CONTENT_TYPE_IDENTIFIER)) {
- // add to current VMD
- fCurrentCTID = getID(element);
- fCurrentVMD.addContentTypeId(fCurrentCTID);
- } else if (tag.equals(TAG_PARTITION_TYPE)) {
- // add to current VMD
- String partitionType = getID(element);
- fCurrentVMD.addParitionType(fCurrentCTID, partitionType);
-
- return true;
- } else {
- return false;
- }
-
- readElementChildren(element);
- return true;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
deleted file mode 100644
index 8a412c1d54..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
+++ /dev/null
@@ -1,241 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Object that holds information relevant to the creation of a validator for
- * the reconciling framework.
- *
- * @author pavery,nitind
- */
-public class ValidatorMetaData {
- private String fClass = null;
- private IConfigurationElement fConfigurationElement = null;
- private String fId = null;
- private String fScope;
-
- // a hash map of explicitly declared content type Ids (String) that points to lists of
- // partition types (List of Strings)
- // contentTypeId -> List(paritionType, paritionType, partitionType, ...)
- // contentTypeId2 -> List(partitionType, partitionType, ...)
- // ...
- private HashMap fMatrix = null;
-
- public ValidatorMetaData(IConfigurationElement element, String vId, String vClass, String vScope) {
- fId = vId;
- fClass = vClass;
- fConfigurationElement = element;
- fScope = vScope;
- fMatrix = new HashMap();
- }
-
- /**
- * TODO: This exact method is also in ValidatorStrategy. Should be in a common place.
- *
- * @param contentTypeId
- * @return
- */
- private String[] calculateParentContentTypeIds(String contentTypeId) {
-
- Set parentTypes = new HashSet();
-
- IContentTypeManager ctManager = Platform.getContentTypeManager();
- IContentType ct = ctManager.getContentType(contentTypeId);
- String id = contentTypeId;
-
- while(ct != null && id != null) {
-
- parentTypes.add(id);
- ct = ctManager.getContentType(id);
- if(ct != null) {
- IContentType baseType = ct.getBaseType();
- id = (baseType != null) ? baseType.getId() : null;
- }
- }
- return (String[])parentTypes.toArray(new String[parentTypes.size()]);
- }
-
- public void addContentTypeId(String contentTypeId) {
- if (!fMatrix.containsKey(contentTypeId))
- fMatrix.put(contentTypeId, new ArrayList());
- }
-
- public void addParitionType(String contentTypeId, String partitionType) {
- if (!fMatrix.containsKey(contentTypeId))
- fMatrix.put(contentTypeId, new ArrayList());
-
- List partitionList = (List) fMatrix.get(contentTypeId);
- partitionList.add(partitionType);
- }
-
- /**
- * @param contentType
- * @return whether this validator explicitly declared that it could handle
- * this content type or any of its parent content types
- */
- public boolean canHandleContentType(String contentType) {
- // need to iterate hierarchy
- String[] contentHierarchy = calculateParentContentTypeIds(contentType);
- for (int i = 0; i < contentHierarchy.length; i++) {
- if(fMatrix.containsKey(contentHierarchy[i]))
- return true;
- }
- return false;
- }
-
- /**
- * @param contentType
- * @return whether this validator explicitly declared that it could handle
- * this content type
- */
- public boolean mustHandleContentType(String contentType) {
- return fMatrix.containsKey(contentType);
- }
-
- /**
- * @param contentTypeIds
- * @param partitionType
- * @return whether this validator declared that it could handle this
- * content type, or one of its parent content types, and partition
- * type
- */
- public boolean canHandlePartitionType(String contentTypeIds[], String paritionType) {
- for(int i=0; i<contentTypeIds.length; i++) {
- List partitions = (List) fMatrix.get(contentTypeIds[i]);
- if (partitions != null) {
- for (int j = 0; j < partitions.size(); j++) {
- if (paritionType.equals(partitions.get(j)))
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @param element
- * @param classAttribute
- * @return Object
- * @throws CoreException
- */
- Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
- Object obj = null;
- obj = element.createExecutableExtension(classAttribute);
- return obj;
- }
-
- /**
- * Creates an extension. If the extension plugin has not been loaded a
- * busy cursor will be activated during the duration of the load.
- *
- * @param element
- * @param classAttribute
- * @return Object
- * @throws CoreException
- */
- public Object createExtension() {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- final IConfigurationElement element = getConfigurationElement();
- final Object[] result = new Object[1];
- String pluginId = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
- return createExecutableExtension(element, "class"); //$NON-NLS-1$
- } catch (CoreException e) {
- handleCreateExecutableException(result, e);
- }
- } else {
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- result[0] = createExecutableExtension(element, "class"); //$NON-NLS-1$
- } catch (Exception e) {
- handleCreateExecutableException(result, e);
- }
- }
- });
- }
- return result[0];
- }
-
- /**
- * @return a validator instance based on this ValidatorMetaData instance
- */
- public IValidator createValidator() {
- Object obj = null;
- obj = createExtension();
- if (obj == null) {
- return null;
- }
- return (obj instanceof IValidator) ? (IValidator) obj : null;
- }
-
- public IConfigurationElement getConfigurationElement() {
- return fConfigurationElement;
- }
-
- public String getValidatorClass() {
- return fClass;
- }
-
- public String getValidatorId() {
- return fId;
- }
-
- /**
- * @param result
- * @param e
- */
- void handleCreateExecutableException(Object[] result, Throwable e) {
- Logger.logException(e);
- e.printStackTrace();
- result[0] = null;
- }
- /**
- * ReconcileAnnotationKey.TOTAL or ReconcileAnnotationKey.PARTIAL
- * @return
- */
- public int getValidatorScope() {
- return fScope.equalsIgnoreCase("total") ? ReconcileAnnotationKey.TOTAL : ReconcileAnnotationKey.PARTIAL; //$NON-NLS-1$
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer debugString = new StringBuffer("ValidatorMetaData:"); //$NON-NLS-1$
- if (fId != null)
- debugString.append(" [id:" + fId + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- return debugString.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
deleted file mode 100644
index 6ce02c0f58..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-
-/**
- * Special validator strategy. Runs validator steps contributed via the
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> extension
- * point
- *
- * @author pavery
- */
-public class ValidatorStrategy extends StructuredTextReconcilingStrategy {
-
- private static final boolean DEBUG_VALIDATION_CAPABLE_BUT_DISABLED = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidatorEnablement")).booleanValue();
- private static final boolean DEBUG_VALIDATION_UNSUPPORTED = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidatorSupported")).booleanValue();
- private static final Object NO_FILE = new Object();
-
- private String[] fContentTypeIds = null;
- private List fMetaData = null;
- /** validator id (as declared in ext point) -> ReconcileStepForValidator * */
- private HashMap fVidToVStepMap = null;
-
- /*
- * List of ValidatorMetaDatas of total scope validators that have been run
- * since beginProcessing() was called.
- */
- private List fTotalScopeValidatorsAlreadyRun = new ArrayList();
-
- /*
- * Whether the Validation Framework has indicated that validation is
- * suspended for the current resource
- */
- private boolean fValidatorsSuspended = false;
- private Object fFile;
- private boolean fIsCancelled = false;
-
- public ValidatorStrategy(ISourceViewer sourceViewer, String contentType) {
- super(sourceViewer);
- fMetaData = new ArrayList();
- fContentTypeIds = calculateParentContentTypeIds(contentType);
- fVidToVStepMap = new HashMap();
- }
-
- public void addValidatorMetaData(ValidatorMetaData vmd) {
- fMetaData.add(vmd);
- }
-
- public void beginProcessing() {
- fTotalScopeValidatorsAlreadyRun.clear();
- }
-
- /**
- * The content type passed in should be the most specific one. TODO: This
- * exact method is also in ValidatorMetaData. Should be in a common place.
- *
- * @param contentType
- * @return
- */
- private String[] calculateParentContentTypeIds(String contentTypeId) {
-
- Set parentTypes = new HashSet();
-
- IContentTypeManager ctManager = Platform.getContentTypeManager();
- IContentType ct = ctManager.getContentType(contentTypeId);
- String id = contentTypeId;
-
- while (ct != null && id != null) {
-
- parentTypes.add(id);
- ct = ctManager.getContentType(id);
- if (ct != null) {
- IContentType baseType = ct.getBaseType();
- id = (baseType != null) ? baseType.getId() : null;
- }
- }
- return (String[]) parentTypes.toArray(new String[parentTypes.size()]);
- }
-
- protected boolean canHandlePartition(String partitionType) {
- ValidatorMetaData vmd = null;
- for (int i = 0; i < fMetaData.size(); i++) {
- vmd = (ValidatorMetaData) fMetaData.get(i);
- if (vmd.canHandlePartitionType(getContentTypeIds(), partitionType))
- return true;
- }
- return false;
- }
-
- protected boolean containsStep(IReconcileStep step) {
- return fVidToVStepMap.containsValue(step);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.provisional.reconcile.AbstractStructuredTextReconcilingStrategy#createReconcileSteps()
- */
- public void createReconcileSteps() {
- // do nothing, steps are created
- }
-
- public void endProcessing() {
- fTotalScopeValidatorsAlreadyRun.clear();
- }
-
- /**
- * All content types on which this ValidatorStrategy can run
- *
- * @return
- */
- public String[] getContentTypeIds() {
- return fContentTypeIds;
- }
-
- /**
- * @param tr
- * Partition of the region to reconcile.
- * @param dr
- * Dirty region representation of the typed region
- */
- public void reconcile(ITypedRegion tr, DirtyRegion dr) {
- /*
- * Abort if no workspace file is known (new validation framework does
- * not support that scenario) or no validators have been specified
- */
- if (isCanceled() || fMetaData.isEmpty() || fValidatorsSuspended)
- return;
-
- IDocument doc = getDocument();
- // for external files, this can be null
- if (doc == null)
- return;
-
- String partitionType = tr.getType();
-
- ValidatorMetaData vmd = null;
- List annotationsToAdd = new ArrayList();
- List stepsRanOnThisDirtyRegion = new ArrayList(1);
-
- /*
- * Keep track of the disabled validators by source id for the V2
- * validators.
- */
- Set disabledValsBySourceId = new HashSet(20);
-
- /*
- * Keep track of the disabled validators by class id for the v1
- * validators.
- */
- Set disabledValsByClass = new HashSet(20);
- IFile file = getFile();
- if (file != null) {
- if(!file.isAccessible())
- return;
-
- Collection disabledValidators = null;
- try {
- /*
- * Take extra care when calling this external code, as it
- * can indirectly cause bundles to start
- */
- disabledValidators = ValidationFramework.getDefault().getDisabledValidatorsFor(file);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
-
- if (disabledValidators != null) {
- for (Iterator it = disabledValidators.iterator(); it.hasNext();) {
- Validator v = (Validator) it.next();
- Validator.V1 v1 = null;
- try {
- v1 = v.asV1Validator();
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- if (v1 != null)
- disabledValsByClass.add(v1.getId());
- // not a V1 validator
- else if (v.getSourceId() != null) {
- //could be more then one sourceid per batch validator
- String[] sourceIDs = StringUtils.unpack(v.getSourceId());
- disabledValsBySourceId.addAll(Arrays.asList(sourceIDs));
- }
- }
- }
- }
-
- /*
- * Loop through all of the relevant validator meta data to find
- * supporting validators for this partition type. Don't check
- * this.canHandlePartition() before-hand since it just loops through
- * and calls vmd.canHandlePartitionType()...which we're already doing
- * here anyway to find the right vmd.
- */
- for (int i = 0; i < fMetaData.size() && !isCanceled(); i++) {
- vmd = (ValidatorMetaData) fMetaData.get(i);
- if (vmd.canHandlePartitionType(getContentTypeIds(), partitionType)) {
- /*
- * Check if validator is enabled according to validation
- * preferences before attempting to create/use it
- */
- if (!disabledValsBySourceId.contains(vmd.getValidatorId()) && !disabledValsByClass.contains(vmd.getValidatorClass())) {
- if (DEBUG_VALIDATION_UNSUPPORTED) {
- Logger.log(Logger.INFO, "Source validator "+vmd.getValidatorId()+" handling (content types:[" + StringUtils.pack(getContentTypeIds()) + "] partition type:" + partitionType);
- }
- int validatorScope = vmd.getValidatorScope();
- ReconcileStepForValidator validatorStep = null;
- // get step for partition type
- Object o = fVidToVStepMap.get(vmd.getValidatorId());
- if (o != null) {
- validatorStep = (ReconcileStepForValidator) o;
- }
- else {
- // if doesn't exist, create one
- IValidator validator = vmd.createValidator();
-
- validatorStep = new ReconcileStepForValidator(validator, validatorScope);
- validatorStep.setInputModel(new DocumentAdapter(doc));
-
- fVidToVStepMap.put(vmd.getValidatorId(), validatorStep);
- }
-
- if (!fTotalScopeValidatorsAlreadyRun.contains(vmd) && !fIsCancelled) {
- annotationsToAdd.addAll(Arrays.asList(validatorStep.reconcile(dr, dr)));
- stepsRanOnThisDirtyRegion.add(validatorStep);
-
- if (validatorScope == ReconcileAnnotationKey.TOTAL) {
- // mark this validator as "run"
- fTotalScopeValidatorsAlreadyRun.add(vmd);
- }
- }
- }
- else if (DEBUG_VALIDATION_CAPABLE_BUT_DISABLED) {
- String message = "Source validator able (id:" + vmd.getValidatorId() + " class:" + vmd.getValidatorClass() + " but skipped because it was reported as disabled";
- Logger.log(Logger.INFO, message);
- }
- }
- else if (DEBUG_VALIDATION_UNSUPPORTED) {
- Logger.log(Logger.INFO, "Source validator "+vmd.getValidatorId()+" can not handle (content types:[" + StringUtils.pack(getContentTypeIds()) + "] partition type:" + partitionType);
- }
- }
-
- TemporaryAnnotation[] annotationsToRemove = getAnnotationsToRemove(dr, stepsRanOnThisDirtyRegion);
- if (annotationsToRemove.length + annotationsToAdd.size() > 0 && !fIsCancelled)
- smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
- }
-
- public void release() {
- super.release();
- fIsCancelled = true;
- Iterator it = fVidToVStepMap.values().iterator();
- IReconcileStep step = null;
- while (it.hasNext()) {
- step = (IReconcileStep) it.next();
- if (step instanceof IReleasable)
- ((IReleasable) step).release();
- }
- fFile = null;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
- */
- public void setDocument(IDocument document) {
- super.setDocument(document);
-
- fFile = null;
-
- try {
- fValidatorsSuspended = false;
- if (document != null) {
- IFile file = getFile();
- if (file != null) {
- // Validation is suspended for this resource, do nothing
- fValidatorsSuspended = !file.isAccessible() || ValidationFramework.getDefault().isSuspended(file.getProject()) || ValidationFramework.getDefault().getProjectSettings(file.getProject()).getSuspend();
- }
- }
- }
- catch (Exception e) {
- fValidatorsSuspended = true;
- Logger.logException(e);
- }
-
- // validator steps are in "fVIdToVStepMap" (as opposed to fFirstStep >
- // next step etc...)
- Iterator it = fVidToVStepMap.values().iterator();
- IReconcileStep step = null;
- while (it.hasNext()) {
- step = (IReconcileStep) it.next();
- step.setInputModel(new DocumentAdapter(document));
- }
- }
-
- /**
- * Gets IFile from current document
- *
- * @return IFile the IFile, null if no such file exists
- */
- private IFile getFile() {
- if (fFile == null) {
- fFile = NO_FILE;
- ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(getDocument());
- if (buffer != null && buffer.getLocation() != null) {
- IPath path = buffer.getLocation();
- if (path.segmentCount() > 1) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file.isAccessible()) {
- fFile = file;
- }
- }
- }
- }
-
- if (fFile != NO_FILE)
- return (IFile) fFile;
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java
deleted file mode 100644
index e79a989ff4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.rules;
-
-import java.util.AbstractCollection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * Passed to LineStyleProviders as the Collection for which StyleRanges are to
- * be added. This class provides additional sanity checks on the incoming
- * StyleRanges so that we do not rely upon SWT to report Errors with no record
- * of the StyleRange or contributing LineStyleProvider, as well as a slight
- * performance increase by not allocating a redundant collection for the
- * StyleRanges.
- *
- * This class intentionally violates the contract for java.util.Collection.
- */
-
-class PresentationCollector extends AbstractCollection {
- private final TextPresentation fPresentation;
- private int lastOffset;
-
- /**
- * @param presentation
- * - the Presentation being added to
- * @param applyOnAdd
- */
- PresentationCollector(TextPresentation presentation) {
- super();
- Assert.isNotNull(presentation);
- fPresentation = presentation;
- lastOffset = 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.Collection#add(java.lang.Object)
- */
- public boolean add(Object o) {
- StyleRange range = (StyleRange) o;
- if (lastOffset > range.start) {
- Logger.log(Logger.ERROR, "Overlapping start in StyleRange " + range.start + ":" + range.length); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- else if (range.length < 0) {
- Logger.log(Logger.ERROR, "StyleRange with negative length" + range.start + ":" + range.length); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- lastOffset = range.start + range.length;
- fPresentation.addStyleRange(range);
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.AbstractCollection#iterator()
- */
- public Iterator iterator() {
- return fPresentation.getNonDefaultStyleRangeIterator();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.AbstractCollection#size()
- */
- public int size() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java
deleted file mode 100644
index f5973d8858..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.sse.ui.internal.rules;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-
-/**
- * An implementation of a presentation damager and presentation repairer.
- * It uses a LineStyleProvider to retrieve the style ranges associated with
- * the calculated damaged region.
- *
- * @see LineStyleProvider
- */
-public class StructuredDocumentDamagerRepairer extends DefaultDamagerRepairer {
-
- private LineStyleProvider fProvider = null;
-
- public StructuredDocumentDamagerRepairer(LineStyleProvider provider) {
- super(new RuleBasedScanner());
- Assert.isNotNull(provider);
- fProvider = provider;
- }
-
- public void createPresentation(TextPresentation presentation, ITypedRegion region) {
- PresentationCollector collector = new PresentationCollector(presentation);
- fProvider.prepareRegions(region, region.getOffset(), region.getLength(), collector);
- }
-
- public void setProvider(LineStyleProvider provider) {
- fProvider = provider;
- }
-
- public void setDocument(IDocument document) {
- super.setDocument(document);
- if (fProvider instanceof AbstractLineStyleProvider)
- ((AbstractLineStyleProvider) fProvider).setDocument( (IStructuredDocument) document);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
deleted file mode 100644
index c20f38ae65..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.sse.ui.internal.search;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
-import org.eclipse.jface.viewers.StyledString.Styler;
-import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * <p>The label provider designed for use with <code>BasicSearchMatchElement</code><p>
- *
- * <p>Displays in the format of:<br/>
- * lineNum: Message (# matches)</br>
- * 1: <a></a> (2 matches)</p>
- */
-public class BasicSearchLabelProvider extends LabelProvider implements IStyledLabelProvider {
- /**
- * ID of match highlighting background color
- */
- private static final String MATCH_BG_ID = "org.eclipse.wst.sse.ui.search.MATCH_BG";
-
- //register the match highlighting background color once
- static {
- JFaceResources.getColorRegistry().put(MATCH_BG_ID, new RGB(206, 204, 247));
- }
-
- /**
- * Match highlighting background color styler
- */
- private static final Styler HIGHLIGHT_WRITE_STYLE= StyledString.createColorRegistryStyler(null, MATCH_BG_ID);
-
-
- /**
- * Need the page if want to determine the number of matches, but this can be <code>null</code>
- */
- private AbstractTextSearchViewPage fPage;
-
- /**
- * <p>Construct the provider without a <code>AbstractTextSearchViewPage</code><p>
- * <p><b>NOTE:</b>If this constructor is used then the provider will not be able to determine
- * the number of matches that are all on the same line for a given element</p>
- */
- public BasicSearchLabelProvider() {
- this(null);
- }
-
- /**
- * <p>Construct the provider with a <code>AbstractTextSearchViewPage</code> so that the
- * number of matches that are all on the same line for a given element can be determined.</p>
- *
- * @param page Will be used to determine the number of matches that are all on the same line
- */
- public BasicSearchLabelProvider(AbstractTextSearchViewPage page) {
- fPage= page;
- }
-
- /**
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return EditorPluginImageHelper.getInstance().getImage(EditorPluginImages.IMG_OBJ_OCC_MATCH);
- }
-
- /**
- * <p><b>Note:</b> Because this class implements <code>IStyledLabelProvider</code> the <code>getStyledText</code>
- * function should be being called and not this one, but better save then sorry</p>
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider#getStyledText(Object)
- */
- public final String getText(Object element) {
- return getStyledText(element).getString();
- }
-
- /**
- * <p>Given a <code>Match</code> object containing a <code>BasicSearchMatchElement</code> element
- * returns a <code>StyledString</code> in the form of:</p>
- *
- * <p>lineNum: Message (# matches)</br>
- * 1: <a></a> (2 matches)</p>
- *
- * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
- */
- public StyledString getStyledText(Object obj) {
- StyledString styledText = new StyledString();
- BasicSearchMatchElement element = null;
- if (obj instanceof Match) {
- Match match = (Match) obj;
-
- if(match.getElement() instanceof BasicSearchMatchElement) {
- element = (BasicSearchMatchElement) match.getElement();
- }
- } else if(obj instanceof BasicSearchMatchElement) {
- element = (BasicSearchMatchElement)obj;
- }
-
- //get the match count if possible
- int matchCount = 0;
- Match[] matches = new Match[0];
- if(fPage != null) {
- matches = fPage.getInput().getMatches(obj);
- matchCount = matches.length;
- }
-
- //if everything was of the right type create our formated message,
- //else use the toString of the given object for the message
- if(element != null) {
- String message = element.getLine().trim(); //$NON-NLS-1$
- int trimedAmount = element.getLine().indexOf(message);
- String lineNum = element.getLineNum() + 1 + ": "; //$NON-NLS-1$
-
- styledText.append(lineNum, StyledString.QUALIFIER_STYLER);
- styledText.append(message);
-
- //get the match count if possible
- for(int i = 0; i < matchCount; ++i) {
- int offset = matches[i].getOffset() - element.geLineOffset() + lineNum.length() - trimedAmount;
- styledText.setStyle(offset, matches[i].getLength(), HIGHLIGHT_WRITE_STYLE);
- }
-
- } else {
- styledText.append(obj.toString());
- }
-
- //append the match count if its worth appending
- if (matchCount > 1) {
- String matchesMsg = " " + MessageFormat.format(
- SSEUIMessages.TextSearchLabelProvider_matchCountFormat,
- new Object[] { new Integer(matchCount) });
- styledText.append(matchesMsg, StyledString.COUNTER_STYLER);
- }
-
- return styledText;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java
deleted file mode 100644
index 425c06ae4e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java
+++ /dev/null
@@ -1,116 +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.wst.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-
-/**
- * This is used as the element for a <code>Match</code> object by
- * <code>BasicSearchQuery</code>. It contains all the needed information
- * for use by the query, result providers, and label providers.
- *
- * @see org.eclipse.search.ui.text.Match
- * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery
- */
-public class BasicSearchMatchElement {
- /**
- * The file this element is a match on
- */
- private IFile fFile;
-
- /**
- * The line number this element is a match on
- */
- private int fLineNumber;
-
- /**
- * The offset of the line in the file
- */
- private int fLineOffset;
-
- /**
- * The line this match is on
- */
- private String fLine;
-
- /**
- * Constructor
- *
- * @param file The file this element is a match on
- * @param lineNumber The line number this element is a match on
- * @param lineOffset The offset of the line in the file
- * @param message The message associated with this element
- */
- public BasicSearchMatchElement(IFile file, int lineNumber, int lineOffset, String message) {
- this.fFile = file;
- this.fLineNumber = lineNumber;
- this.fLineOffset = lineOffset;
- this.fLine = message;
- }
-
- /**
- * @return The file this element is a match on
- */
- public IFile getFile() {
- return this.fFile;
- }
-
- /**
- * @return The line number this element is a match on
- */
- public int getLineNum() {
- return this.fLineNumber;
- }
-
- /**
- * @return the offset of the line the match is on in the file
- */
- public int geLineOffset() {
- return this.fLineOffset;
- }
-
- /**
- * @return The line this match is on
- */
- public String getLine() {
- return this.fLine;
- }
-
- /**
- * <p>Two <code>BasicSearchMatchElement</code> are equal if they are
- * both on the same line. This helps with determining how many matches
- * are all on the same line which is automatically taken care of by
- * internal Eclipse search APIs so long as this equal method is structured
- * thusly.</p>
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- boolean equal = false;
-
- if(obj instanceof BasicSearchMatchElement) {
- equal = getLineNum() == ((BasicSearchMatchElement)obj).getLineNum();
- }
-
- return equal;
- }
-
- /**
- * Like the <code>#equals</code> method this function is needed so
- * that the internal Eclipse search APIs can keep track of matches
- * that are on the same line.
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getLineNum() + getLine().hashCode();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
deleted file mode 100644
index 008eb336c4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.search.ui.text.AbstractTextSearchResult;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * Defines a basic search query. This query does not do anything, it needs to be extended
- * and the <code>{@link #doQuery()}</code> method needs to be overridden to make the query
- * actually be functional.
- *
- */
-public class BasicSearchQuery implements ISearchQuery {
- /**
- * the file we're searching
- */
- private IFile fFile = null;
-
- /**
- * The result of this query
- */
- private AbstractTextSearchResult fResult = null;
-
- /**
- * The progress monitor for the query
- */
- private IProgressMonitor fProgressMonitor = null;
-
- /**
- * <p>Construct a new basic query.</p>
- *
- * <p><b>IMPORTANT: </b>It is very important that after
- * creating the query and <b>before</b> running the query
- * that you call {@link #setResult(AbstractTextSearchResult)}.
- * This is not a parameter because typically a search result needs
- * a reference to its query and thus the query needs to be constructed
- * before its result object can be set.</p>
- *
- * @param file the file this query will take place on
- */
- public BasicSearchQuery(IFile file) {
- this.fFile = file;
- }
-
- /**
- * Runs the query
- *
- * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus run(IProgressMonitor monitor) {
- fProgressMonitor = monitor;
- return doQuery();
- }
-
- /**
- * public to avoid synthetic method access from inner class
- *
- * @return
- */
- public IFile getFile() {
- return this.fFile;
- }
-
- /**
- * There is no default label for a basic query,
- * this should be overridden by implementing classes
- *
- * @see org.eclipse.search.ui.ISearchQuery#getLabel()
- */
- public String getLabel() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * <p>This will be <code>null</code> if {@link #setResult(AbstractTextSearchResult)}
- * has not been called yet.</p>
- *
- * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
- */
- public ISearchResult getSearchResult() {
- return fResult;
- }
-
- /**
- * Adds a match to the results of this query.
- *
- * <p><b>IMPORTANT: </b>It is very important that after
- * creating the query and <b>before</b> running the query
- * that you call {@link #setResult(AbstractTextSearchResult)}.
- * This is not a parameter because typically a search result needs
- * a reference to its query and thus the query needs to be constructed
- * before its result object can be set.</p>
- *
- * @param document the document the match is being added too
- * @param matchStart the start character of the match
- * @param matchEnd the end character of the match
- */
- public void addMatch(IDocument document, int matchStart, int matchEnd) {
-
- try {
- int lineNumber = document.getLineOfOffset(matchStart);
- int lineStart = document.getLineOffset(lineNumber);
- int lineLength = document.getLineLength(lineNumber);
-
- String elementMessage = document.get().substring(lineStart, lineStart + lineLength);
-
- //add the match to the result
- BasicSearchMatchElement element = new BasicSearchMatchElement(fFile, lineNumber, lineStart, elementMessage);
- fResult.addMatch(new Match(element, Match.UNIT_CHARACTER, matchStart, matchEnd - matchStart));
-
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * <p><i>Note: </i> as of yet no testing has gone into whether this query
- * can be re-run or not or what that even entails.<p>
- *
- * @see org.eclipse.search.ui.ISearchQuery#canRerun()
- */
- public boolean canRerun() {
- return false;
- }
-
- /**
- * <p>This query can be run in the background</p>
- *
- * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
- */
- public boolean canRunInBackground() {
- return true;
- }
-
- /**
- * <p>The actual work of the query, called by {@link #run(IProgressMonitor)}</p>
- * <p><i>Note: </i>This method should be overridden by implementers so that their query
- * will actually do something</p>
- *
- * @return the status of the query when it has finished
- *
- * @deprecated use {@link #doQuery(IProgressMonitor)} so that the operation is cancelable
- */
- protected IStatus doQuery() {
- return doQuery(fProgressMonitor);
- }
-
- /**
- * <p>The actual work of the query, called by {@link #run(IProgressMonitor)}</p>
- * <p><i>Note: </i>This method should be overridden by implementers so that their query
- * will actually do something</p>
- *
- * @param monitor {@link IProgressMonitor} used to track progress and cancel the operation
- *
- * @return the status of the query when it has finished
- */
- protected IStatus doQuery(IProgressMonitor monitor) {
- return Status.OK_STATUS;
- }
-
- /**
- * @return the total number of matches this query found
- */
- protected int getMatchCount() {
- return fResult.getMatchCount();
- }
-
- /**
- * <p>used in search result display labels, should be overridden by implementers</p>
- *
- * @return
- */
- protected String getSearchText() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * <p>This <b>needs</b> to be called after constructing
- * the query but before running it, see note on {@link #BasicSearchQuery(IFile)}</p>
- *
- * @param result the result this query will use to store its results
- */
- protected void setResult(AbstractTextSearchResult result) {
- this.fResult = result;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
deleted file mode 100644
index ebc74e4d8f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.sse.ui.internal.search;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.viewers.ISelection;
-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.IFileEditorInput;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
- * Performs the appropriate FindOccurrencesProcessor action call based on
- * selection. Clients can add processors for different partitions via
- * <code>getProcessors</code>
- *
- */
-abstract public class FindOccurrencesActionDelegate 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(SSEUIMessages.FindOccurrences_label);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void run(IAction action) {
- boolean okay = false;
- if (fEditor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor) fEditor;
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null) {
- ITextSelection textSelection = getTextSelection(textEditor);
- FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
- if (findOccurrenceProcessor != null) {
- if (textEditor.getEditorInput() instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
- okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
- }
- }
- }
- }
- if (okay) {
- // clear status message
- PlatformStatusLineUtil.clearStatusLine();
- }
- else {
- String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
- if (fEditor instanceof StructuredTextEditor) {
- PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) fEditor).getTextViewer(), errorMessage);
-
- }
- else {
- PlatformStatusLineUtil.displayErrorMessage(errorMessage);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // clear status message
- PlatformStatusLineUtil.clearStatusLine();
- }
-
- /**
- * Get the appropriate find occurrences processor
- *
- * @param document -
- * assumes not null
- * @param textSelection
- * @return
- */
- private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
- // check if we have an action that's enabled on the current partition
- ITypedRegion tr = getPartition(document, textSelection);
- String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
-
- Iterator it = getProcessors().iterator();
- FindOccurrencesProcessor processor = null;
- while (it.hasNext()) {
- processor = (FindOccurrencesProcessor) it.next();
- // we just choose the first action that can handle the partition
- if (processor.enabledForParitition(partition))
- return processor;
- }
- List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
- for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
- Object o = extendedFindOccurrencesProcessors.get(i);
- if (o instanceof FindOccurrencesProcessor) {
- /*
- * We just choose the first registered processor that
- * explicitly says it can handle the partition
- */
- processor = (FindOccurrencesProcessor) o;
- if (processor.enabledForParitition(partition))
- return processor;
- }
- }
- return null;
- }
-
- private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
- ITypedRegion region = null;
- if (textSelection != null) {
- try {
- region = document.getPartition(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- region = null;
- }
- }
- return region;
- }
-
- private ITextSelection getTextSelection(ITextEditor textEditor) {
- ITextSelection textSelection = null;
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection && !selection.isEmpty()) {
- textSelection = (ITextSelection) selection;
- }
- return textSelection;
- }
-
- abstract protected List getProcessors();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
deleted file mode 100644
index dfe0917007..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.NewSearchUI;
-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;
-
-/**
- * <p>
- * Finds occurrences of a specified region type w/ region text in an
- * IStructuredDocument. Clients must implement getPartitionTypes() and
- * getRegionTypes() to indicate which partition types and region types it can
- * operate on.
- * </p>
- *
- * <p>
- * Clients should override <code>getSearchQuery()</code> in order to provide
- * their own type of "search" (eg. searching for XML start tags, searching for
- * Java elements, etc...)
- * </p>
- *
- */
-abstract public class FindOccurrencesProcessor {
- public boolean findOccurrences(IDocument document, ITextSelection textSelection, IFile file) {
- boolean findOccurrences = false;
-
- // determine if action should be enabled or not
- if (document instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) document;
- IStructuredDocumentRegion sdRegion = structuredDocument.getRegionAtCharacterOffset(textSelection.getOffset());
- if (sdRegion != null) {
- ITextRegion r = sdRegion.getRegionAtCharacterOffset(textSelection.getOffset());
- if (r != null) {
- String type = r.getType();
- if (enabledForRegionType(type)) {
- String matchText = sdRegion.getText(r);
-
- // first of all activate the view
- NewSearchUI.activateSearchResultView();
-
- if (matchText != null && type != null) {
- ISearchQuery searchQuery = getSearchQuery(file, structuredDocument, matchText, type, textSelection);
- if (searchQuery != null) {
- if (searchQuery.canRunInBackground())
- NewSearchUI.runQueryInBackground(searchQuery);
- else
- NewSearchUI.runQueryInForeground(null, searchQuery);
- }
- findOccurrences = true;
- }
- }
- }
- }
- }
- return findOccurrences;
- }
-
- /**
- * @param regionType
- * @return <code>true</code> if this action can operate on this region
- * type (ITextRegion), otherwise false.
- */
- protected boolean enabledForRegionType(String regionType) {
-
- String[] accept = getRegionTypes();
- for (int i = 0; i < accept.length; i++) {
- if (regionType.equals(accept[i]))
- return true;
- }
- return false;
- }
-
- /**
- * Clients should override this to enable find occurrences on certain
- * partition(s).
- */
- abstract protected String[] getPartitionTypes();
-
- /**
- * Clients should override this to enable find occurrences on different
- * region type(s).
- */
- abstract protected String[] getRegionTypes();
-
- /**
- * Clients should override to provide their own search for the file.
- */
- protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
- return new OccurrencesSearchQuery(file, document, regionText, regionType);
- }
-
- /**
- * @param partitionType
- * @return <code>true</code> if this action can operate on this type of
- * partition, otherwise <code>false</code>.
- */
- public boolean enabledForParitition(String partitionType) {
- String[] accept = getPartitionTypes();
- for (int i = 0; i < accept.length; i++) {
- if (partitionType.equals(accept[i]))
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
deleted file mode 100644
index 7a8f26a607..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.search;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * @author pavery
- */
-public class OccurrencesContentProvider implements IStructuredContentProvider {
-
- protected final Object[] EMPTY_ARRAY = new Object[0];
- private OccurrencesSearchResult fResult = null;
- private TableViewer fTableViewer = null;
-
- public void clear() {
- if (this.fTableViewer != null)
- this.fTableViewer.refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- // do nothing
- }
-
- public void elementsChanged(Object[] updatedElements) {
-
- //TODO: copied from JavaSearchTableContentProvider
- for (int i = 0; i < updatedElements.length; i++) {
- if (this.fResult.getMatchCount(updatedElements[i]) > 0) {
- if (this.fTableViewer.testFindItem(updatedElements[i]) != null)
- this.fTableViewer.refresh(updatedElements[i]);
- else
- this.fTableViewer.add(updatedElements[i]);
- } else {
- this.fTableViewer.remove(updatedElements[i]);
- }
- }
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
-
- this.fResult = (OccurrencesSearchResult) inputElement;
- return this.fResult.getElements();
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- if (viewer instanceof TableViewer)
- this.fTableViewer = (TableViewer) viewer;
- this.fResult = (OccurrencesSearchResult) newInput;
- }
-
- public void refresh() {
-
- if (this.fTableViewer != null)
- this.fTableViewer.refresh();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
deleted file mode 100644
index d5c8e0fa83..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.search;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-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.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Basic ISearchQuery that finds matches of region type and region text.
- *
- * @author pavery
- */
-public class OccurrencesSearchQuery extends BasicSearchQuery {
-
- /**
- * We need a runnable so that the search markers show up in the live
- * document.
- */
- private class FindRegions implements IWorkspaceRunnable {
-
- private IStructuredDocument fFindRegionsDocument = null;
- private String fMatchName = null;
- private String fMatchRegionType = null;
-
- public FindRegions(IStructuredDocument document, String matchText, String matchRegionType) {
-
- this.fFindRegionsDocument = document;
- this.fMatchName = matchText;
- this.fMatchRegionType = matchRegionType;
- }
-
- private void findOccurrences(IProgressMonitor monitor) {
-
- if (!isCanceled(monitor)) {
-
- int matchStart = -1;
- int matchEnd = -1;
- String findRegionText = ""; //$NON-NLS-1$
-
- ITextRegion r = null;
- ITextRegionList regions = null;
- IStructuredDocumentRegion current = this.fFindRegionsDocument.getFirstStructuredDocumentRegion();
-
- // this is the main loop that iterates the document
- while (current != null && !isCanceled(monitor)) {
- regions = current.getRegions();
- for (int i = 0; i < regions.size() && !isCanceled(monitor); i++) {
-
- r = regions.get(i);
-
- // maybe this is the equals check where some valid
- // matches are failing (like searching on end tag)
- if (r.getType().equals(this.fMatchRegionType) && current.getText(r).equals(this.fMatchName)) {
-
- findRegionText = current.getText(r);
-
- // region found
- matchStart = current.getStartOffset(r);
- matchEnd = matchStart + findRegionText.trim().length();
-
- addMatch(this.fFindRegionsDocument, matchStart, matchEnd);
- }
- }
- current = current.getNext();
- }
- }
- }
-
- private boolean isCanceled(IProgressMonitor monitor) {
- return monitor != null && monitor.isCanceled();
- }
-
- public void run(IProgressMonitor monitor) throws CoreException {
-
- try {
- findOccurrences(monitor);
- } catch (Exception e) {
- Logger.logException(e);
- }
- }
- }// end inner class FindRegions
-
-
- private IStructuredDocument fDocument = null;
- private String fRegionText = null;
- private String fRegionType = null;
-
- public OccurrencesSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType) {
- super(file);
- super.setResult(new OccurrencesSearchResult(this));
- this.fDocument = document;
- this.fRegionText = regionText;
- this.fRegionType = regionType;
- }
-
- /**
- * <p><i>Note: </i>Some investigation needs to be put into how to do this safely</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#canRunInBackground()
- */
- public boolean canRunInBackground() {
- return false;
- }
-
- /**
- * <p>The label format is:<br/>
- * searchText - # occurrences in file</p>
- *
- * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#getLabel()
- */
- public String getLabel() {
- String label = SSEUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
- String[] args = {getSearchText(), "" + super.getMatchCount(), getFilename()};
- return MessageFormat.format(label, args);
- }
-
- /**
- * This query looks for all occurrences of the selected string
- *
- * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#doQuery()
- */
- protected IStatus doQuery(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- FindRegions findRegions = new FindRegions(this.fDocument, this.fRegionText, this.fRegionType);
- try {
- // BUG158846 - deadlock if lock up entire workspace, so only lock
- // up the file we are searching on
- ISchedulingRule markerRule = ResourcesPlugin.getWorkspace().getRuleFactory().markerRule(getFile());
- ResourcesPlugin.getWorkspace().run(findRegions, markerRule, IWorkspace.AVOID_UPDATE, monitor);
- } catch (CoreException e) {
- status = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, "", null); //$NON-NLS-1$
- }
- return status;
- }
-
- protected String getSearchText() {
- return this.fRegionText;
- }
-
- private String getFilename() {
- String filename = SSEUIMessages.OccurrencesSearchQuery_2; //$NON-NLS-1$ "file"
- if (getFile() != null)
- filename = getFile().getName().toString();
- return filename;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
deleted file mode 100644
index 8082773c7f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.text.AbstractTextSearchResult;
-import org.eclipse.search.ui.text.IEditorMatchAdapter;
-import org.eclipse.search.ui.text.IFileMatchAdapter;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-
-/**
- * @author pavery
- */
-public class OccurrencesSearchResult extends AbstractTextSearchResult implements IEditorMatchAdapter, IFileMatchAdapter {
-
- private ISearchQuery fQuery = null;
- private final Match[] NO_MATCHES = new Match[0];
-
- public OccurrencesSearchResult(ISearchQuery query) {
- this.fQuery = query;
- }
-
- /**
- * @see org.eclipse.search.ui.text.IEditorMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult,
- * org.eclipse.ui.IEditorPart)
- */
- public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) {
-
- IEditorInput editorInput = editor.getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- return computeContainedMatches(result, fileEditorInput.getFile());
- }
- return this.NO_MATCHES;
- }
-
- /**
- * @see org.eclipse.search.ui.text.IFileMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult,
- * org.eclipse.core.resources.IFile)
- */
- public Match[] computeContainedMatches(AbstractTextSearchResult result, IFile file) {
- Match[] matches = this.getMatches();
- Match[] containedMatches = new Match[0];
-
- /* only contains matches if the file for one of the matches is the
- * same as the given file.
- * Note: all matches in a result are related to the same file
- */
- if(matches.length > 0 &&
- matches[0].getElement() instanceof BasicSearchMatchElement &&
- ((BasicSearchMatchElement)matches[0].getElement()).getFile().equals(file)) {
-
- containedMatches = matches;
- }
- return containedMatches;
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter()
- */
- public IEditorMatchAdapter getEditorMatchAdapter() {
- return this;
- }
-
- /**
- * @see org.eclipse.search.ui.text.IFileMatchAdapter#getFile(java.lang.Object)
- */
- public IFile getFile(Object element) {
- // return the file for the match
- IFile file = null;
- //System.out.println("get file for:"+element);
- if (element instanceof IMarker) {
- IResource r = ((IMarker) element).getResource();
- if (r instanceof IFile) {
- file = (IFile) r;
- }
- }
- return file;
- }
-
- public IFileMatchAdapter getFileMatchAdapter() {
- return this;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_OCC_MATCH);
- }
-
- /**
- * This label shows up in the search history
- */
- public String getLabel() {
- return getQuery().getLabel();
- }
-
- /**
- * @return the matches associated with this result
- */
- public Match[] getMatches() {
- return collectMatches(getElements());
- }
-
- public ISearchQuery getQuery() {
- return this.fQuery;
- }
-
- public String getTooltip() {
- return getLabel();
- }
-
- /**
- * @see org.eclipse.search.ui.text.IEditorMatchAdapter#isShownInEditor(org.eclipse.search.ui.text.Match,
- * org.eclipse.ui.IEditorPart)
- */
- public boolean isShownInEditor(Match match, IEditorPart editor) {
- return true;
- }
-
- /**
- * <p>Taken from {@link org.eclipse.jdt.internal.ui.search.OccurrencesSearchResult#collectMatches}</p>
- *
- * @param elements get the matches for these elements
- * @return the matches associated with this result
- */
- private Match[] collectMatches(Object[] elements) {
- Match[] matches= new Match[getMatchCount()];
- int writeIndex= 0;
- for (int i= 0; i < elements.length; i++) {
- Match[] perElement= getMatches(elements[i]);
- for (int j= 0; j < perElement.length; j++) {
- matches[writeIndex++]= perElement[j];
- }
- }
- return matches;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
deleted file mode 100644
index 2e619804d4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.search;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * Base page for Occurrences in file search results.
- *
- * @author pavery
- */
-public class OccurrencesSearchViewPage extends AbstractTextSearchViewPage {
-
- private OccurrencesContentProvider fContentProvider = null;
-
- public OccurrencesSearchViewPage() {
- super(AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT);
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
- */
- protected void clear() {
- if (this.fContentProvider != null)
- this.fContentProvider.clear();
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer)
- */
- protected void configureTableViewer(TableViewer viewer) {
-
- //sort results by line number, low to high
- viewer.setComparator(new ViewerComparator() {
- public int compare(Viewer v, Object obj1, Object obj2) {
- BasicSearchMatchElement elem1= (BasicSearchMatchElement) obj1;
- BasicSearchMatchElement elem2= (BasicSearchMatchElement) obj2;
- return elem1.getLineNum() - elem2.getLineNum();
- }
- });
-
- //allow for formated labels
- viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new BasicSearchLabelProvider(this)));
- this.fContentProvider = new OccurrencesContentProvider();
- viewer.setContentProvider(this.fContentProvider);
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
- */
- protected void configureTreeViewer(TreeViewer viewer) {
- // not supported at the moment
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#elementsChanged(java.lang.Object[])
- */
- protected void elementsChanged(Object[] objects) {
- if (this.fContentProvider != null) {
- this.fContentProvider.elementsChanged(objects);
- }
- }
-
- public void forceRefresh() {
- this.fContentProvider.refresh();
- }
-
- private IWorkbenchPage getActivePage() {
-
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- if (window == null)
- return null;
- return workbench.getActiveWorkbenchWindow().getActivePage();
- }
-
- /**
- * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match,
- * int, int)
- */
- protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
- BasicSearchMatchElement element = (BasicSearchMatchElement) match.getElement();
-
- IWorkbenchPage activePage = getActivePage();
- try {
- if (activePage != null) {
- // open editor if needed
- IDE.openEditor(getActivePage(), element.getFile());
- //set the selection in the open editor
- IEditorPart editor = activePage.getActiveEditor();
- if (activate)
- editor.getSite().getPage().activate(editor);
- editor.getEditorSite().getSelectionProvider().setSelection(
- new TextSelection(currentOffset, currentLength));
- }
- } catch (PartInitException e) {
- // possible exception trying to open editor
- Logger.logException(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
deleted file mode 100644
index 79a8857923..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
+++ /dev/null
@@ -1,117 +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.sse.ui.internal.selection;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class SelectionHistory {
- private ITextEditor fEditor;
- private List fHistory;
- private List fHistoryActions;
- private int fSelectionChangeListenerCounter;
- private ISelectionChangedListener fSelectionListener;
-
- public SelectionHistory(ITextEditor editor) {
- Assert.isNotNull(editor);
- fEditor = editor;
- fHistory = new ArrayList(3);
- fSelectionListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (fSelectionChangeListenerCounter == 0)
- flush();
- }
- };
- fEditor.getSelectionProvider().addSelectionChangedListener(fSelectionListener);
- }
-
- public void dispose() {
- fEditor.getSelectionProvider().removeSelectionChangedListener(fSelectionListener);
- fEditor = null;
- if (fHistory != null && !fHistory.isEmpty()) {
- fHistory.clear();
- }
- if (fHistoryActions != null && !fHistoryActions.isEmpty()) {
- fHistoryActions.clear();
- }
- }
-
- public void flush() {
- if (fHistory.isEmpty())
- return;
- fHistory.clear();
- updateHistoryAction();
- }
-
- public IRegion getLast() {
- if (isEmpty())
- return null;
- int size = fHistory.size();
- IRegion result = (IRegion) fHistory.remove(size - 1);
- updateHistoryAction();
- return result;
- }
-
- public void ignoreSelectionChanges() {
- fSelectionChangeListenerCounter++;
- }
-
- public boolean isEmpty() {
- return fHistory.isEmpty();
- }
-
- public void listenToSelectionChanges() {
- fSelectionChangeListenerCounter--;
- }
-
- public void remember(IRegion region) {
- fHistory.add(region);
- updateHistoryAction();
- }
-
- public void setHistoryAction(IAction action) {
- Assert.isNotNull(action);
-
- if (fHistoryActions == null)
- fHistoryActions = new ArrayList();
- if (!fHistoryActions.contains(action))
- fHistoryActions.add(action);
-
- // update action
- if (fHistory != null && !fHistory.isEmpty())
- action.setEnabled(true);
- else
- action.setEnabled(false);
- }
-
- private void updateHistoryAction() {
- if (fHistoryActions != null && !fHistoryActions.isEmpty()) {
- boolean enabled = false;
- if (fHistory != null && !fHistory.isEmpty())
- enabled = true;
-
- Iterator iter = fHistoryActions.iterator();
- while (iter.hasNext()) {
- ((IAction)iter.next()).setEnabled(enabled);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
deleted file mode 100644
index fc27d39906..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
+++ /dev/null
@@ -1,110 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.Assert;
-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.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated use StructuredSelectActionDelegate instead
- */
-
-public abstract class StructureSelectAction extends Action {
- protected StructuredTextEditor fEditor = null;
- protected SelectionHistory fHistory;
- protected IStructuredModel fModel = null;
- protected StructuredTextViewer fViewer = null;
-
- public StructureSelectAction(StructuredTextEditor editor) {
- super();
-
- Assert.isNotNull(editor);
- fEditor = editor;
- fHistory = (SelectionHistory) editor.getAdapter(SelectionHistory.class);
- fViewer = editor.getTextViewer();
- fModel = editor.getModel();
- Assert.isNotNull(fViewer);
- }
-
- abstract protected IndexedRegion getCursorIndexedRegion();
-
- protected IndexedRegion getIndexedRegion(int offset) {
- IndexedRegion indexedRegion = null;
-
- int lastOffset = offset;
- IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- try {
- indexedRegion = model.getIndexedRegion(lastOffset);
- while (indexedRegion == null && lastOffset >= 0) {
- lastOffset--;
- indexedRegion = model.getIndexedRegion(lastOffset);
- }
- }
- finally {
- model.releaseFromRead();
- }
- }
-
- return indexedRegion;
- }
-
- abstract protected Region getNewSelectionRegion(Node node, Region region);
-
- public void run() {
- Region currentRegion = new Region(fViewer.getSelectedRange().x, fViewer.getSelectedRange().y);
- if (currentRegion.getLength() == fViewer.getDocument().getLength())
- return;
-
- IndexedRegion cursorIndexedRegion = getCursorIndexedRegion();
- if (cursorIndexedRegion instanceof Node) {
- Node cursorNode = (Node) cursorIndexedRegion;
-
- // use parent node for empty text node
- if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion)
- cursorIndexedRegion = (IndexedRegion) cursorNode;
- }
-
- Region cursorNodeRegion = new Region(cursorIndexedRegion.getStartOffset(), cursorIndexedRegion.getEndOffset() - cursorIndexedRegion.getStartOffset());
-
- Region newRegion = null;
- if (cursorNodeRegion.getOffset() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() <= currentRegion.getOffset() + currentRegion.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentRegion.getOffset() + currentRegion.getLength())
- newRegion = getNewSelectionRegion(cursorNode, currentRegion);
- else
- newRegion = cursorNodeRegion;
-
- if (newRegion != null) {
- fHistory.remember(currentRegion);
- try {
- fHistory.ignoreSelectionChanges();
- fEditor.selectAndReveal(newRegion.getOffset(), newRegion.getLength());
- }
- finally {
- fHistory.listenToSelectionChanges();
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java
deleted file mode 100644
index 8037c527b8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.w3c.dom.Node;
-
-public class StructureSelectHistoryAction extends StructureSelectAction implements IUpdate {
- public StructureSelectHistoryAction(StructuredTextEditor editor) {
- super(editor);
- setText(SSEUIMessages.StructureSelectHistory_label); //$NON-NLS-1$
- setToolTipText(SSEUIMessages.StructureSelectHistory_tooltip); //$NON-NLS-1$
- setDescription(SSEUIMessages.StructureSelectHistory_description); //$NON-NLS-1$
-
- update();
- }
-
- protected IndexedRegion getCursorIndexedRegion() {
- return null;
- }
-
- protected Region getNewSelectionRegion(Node node, Region region) {
- return null;
- }
-
- public void run() {
- IRegion old = fHistory.getLast();
- if (old != null) {
- try {
- fHistory.ignoreSelectionChanges();
- fEditor.selectAndReveal(old.getOffset(), old.getLength());
- } finally {
- fHistory.listenToSelectionChanges();
- }
- }
- }
-
- public void update() {
- setEnabled(!fHistory.isEmpty());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
deleted file mode 100644
index dbdf4ae1f4..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
+++ /dev/null
@@ -1,124 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-abstract public class StructuredSelectActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private SelectionHistory fHistory;
-
- public void dispose() {
- fEditor = null;
- fHistory = null;
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor) fEditor;
-
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- // determine current text selection
- if (selection instanceof ITextSelection && document != null) {
- ITextSelection textSelection = (ITextSelection) selection;
-
- if (textSelection.getLength() < document.getLength()) {
- // get current indexed region
- IndexedRegion cursorIndexedRegion = getCursorIndexedRegion(document, textSelection);
-
- // determine new selection based on current indexed region
- Region newSelectionRegion = getNewSelectionRegion(cursorIndexedRegion, textSelection);
-
- // select new selection
- if (newSelectionRegion != null) {
- fHistory.remember(new Region(textSelection.getOffset(), textSelection.getLength()));
- try {
- fHistory.ignoreSelectionChanges();
- textEditor.selectAndReveal(newSelectionRegion.getOffset(), newSelectionRegion.getLength());
- }
- finally {
- fHistory.listenToSelectionChanges();
- }
- }
- }
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- if (fEditor != null)
- fHistory = (SelectionHistory) fEditor.getAdapter(SelectionHistory.class);
- else
- fHistory = null;
- }
-
- abstract protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection);
-
- abstract protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection);
-
- /**
- * This method will probably be removed and replaced by using new selection provider
- * @param document
- * @param offset
- * @return
- */
- protected IndexedRegion getIndexedRegion(IDocument document, int offset) {
- IndexedRegion indexedRegion = null;
-
- int lastOffset = offset;
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- try {
- indexedRegion = model.getIndexedRegion(lastOffset);
- while (indexedRegion == null && lastOffset >= 0) {
- lastOffset--;
- indexedRegion = model.getIndexedRegion(lastOffset);
- }
- }
- finally {
- model.releaseFromRead();
- }
- }
-
- return indexedRegion;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java
deleted file mode 100644
index 47dc5c8964..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * Selection history action delegate. Keeps track of selection within editor.
- */
-public class StructuredSelectHistoryActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private SelectionHistory fHistory;
-
- public void dispose() {
- fEditor = null;
- fHistory = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(SSEUIMessages.StructureSelectHistory_label);
- action.setToolTipText(SSEUIMessages.StructureSelectHistory_tooltip);
- action.setDescription(SSEUIMessages.StructureSelectHistory_description);
- }
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- IRegion old = fHistory.getLast();
- if (old != null) {
- try {
- fHistory.ignoreSelectionChanges();
- if (fEditor instanceof ITextEditor)
- ((ITextEditor) fEditor).selectAndReveal(old.getOffset(), old.getLength());
- }
- finally {
- fHistory.listenToSelectionChanges();
- }
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- if (fEditor != null)
- fHistory = (SelectionHistory) fEditor.getAdapter(SelectionHistory.class);
- else
- fHistory = null;
- if (fHistory != null) {
- fHistory.setHistoryAction(action);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java
deleted file mode 100644
index ce55c8fa2d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java
+++ /dev/null
@@ -1,32 +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.wst.sse.ui.internal.spelling;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * <p>Defines an interface for deciding if an offset in an <code>IStructuredModel</code>
- * should be spell checked. Created so that content type specific decisions
- * could be made as to whether a region should be spell-checked or not.
- * This is done using the <code>IAdapterFactory</code> framework.</p>
- */
-public interface ISpellcheckDelegate {
-
- /**
- * Decide if the <code>offset</code> in <code>model</code> should be spell checked or not.
- *
- * @param offset decide if this offset in the given <code>model</code> should be spell-checked
- * @param model used to decide if the given <code>offset</code> should be spell-checked
- * @return <code>true</code> if the given <code>offset</code> in the given <code>model</code>
- * should be spell checked, <code>false</code> otherwise.
- */
- public boolean shouldSpellcheck(int offset, IStructuredModel model);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
deleted file mode 100644
index d95c9c3bad..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.sse.ui.internal.spelling;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.IAnnotationModelExtension2;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector;
-import org.eclipse.ui.texteditor.spelling.SpellingAnnotation;
-import org.eclipse.ui.texteditor.spelling.SpellingContext;
-import org.eclipse.ui.texteditor.spelling.SpellingProblem;
-import org.eclipse.ui.texteditor.spelling.SpellingService;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-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.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-/**
- * A reconciling strategy that queries the SpellingService using its default
- * engine. Results are show as temporary annotations.
- *
- * @since 1.1
- */
-public class SpellcheckStrategy extends StructuredTextReconcilingStrategy {
-
- class SpellCheckPreferenceListener implements IPropertyChangeListener {
- private boolean isInterestingProperty(Object property) {
- return SpellingService.PREFERENCE_SPELLING_ENABLED.equals(property) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(property);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (isInterestingProperty(event.getProperty())) {
- if (event.getOldValue() == null || event.getNewValue() == null || !event.getNewValue().equals(event.getOldValue())) {
- reconcile();
- }
- }
- }
- }
-
- private class SpellingProblemCollector implements ISpellingProblemCollector {
- List annotations = new ArrayList();
-
- public void accept(SpellingProblem problem) {
- if (isInterestingProblem(problem)) {
- TemporaryAnnotation annotation = new TemporaryAnnotation(new Position(problem.getOffset(), problem.getLength()), SpellingAnnotation.TYPE, problem.getMessage(), fReconcileAnnotationKey);
-
- SpellingQuickAssistProcessor quickAssistProcessor = new SpellingQuickAssistProcessor();
- quickAssistProcessor.setSpellingProblem(problem);
- annotation.setAdditionalFixInfo(quickAssistProcessor);
- annotations.add(annotation);
- if (_DEBUG_SPELLING_PROBLEMS) {
- Logger.log(Logger.INFO, problem.getMessage());
- }
- }
- }
-
- public void beginCollecting() {
- }
-
- void clear() {
- annotations.clear();
- }
-
- public void endCollecting() {
- }
-
- Annotation[] getAnnotations() {
- return (Annotation[]) annotations.toArray(new Annotation[annotations.size()]);
- }
- }
-
- private static final boolean _DEBUG_SPELLING = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerSpelling")).booleanValue(); //$NON-NLS-1$
- private static final boolean _DEBUG_SPELLING_PROBLEMS = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerSpelling/showProblems")).booleanValue(); //$NON-NLS-1$
-
- private static final String EXTENDED_BUILDER_TYPE_CONTEXTS = "spellingregions"; //$NON-NLS-1$
- private static final String KEY_CONTENT_TYPE = "org.eclipse.wst.sse.ui.temp.spelling"; //$NON-NLS-1$
-
- private String fContentTypeId = null;
-
- private SpellingProblemCollector fProblemCollector = new SpellingProblemCollector();
-
- IStructuredModel structuredModel = null;
-
- /*
- * Keying our Temporary Annotations based on the partition doesn't help
- * this strategy to only remove its own TemporaryAnnotations since it's
- * possibly run on all partitions. Instead, set the key to use an
- * arbitrary partition type that we can check for using our own
- * implementation of getAnnotationsToRemove(DirtyRegion).
- */
- ReconcileAnnotationKey fReconcileAnnotationKey;
-
- private IPropertyChangeListener fSpellCheckPreferenceListener;
-
- private SpellingContext fSpellingContext;
-
- private String[] fSupportedTextRegionContexts;
- private IReconcileStep fSpellingStep = new StructuredReconcileStep() {
- };
-
- public SpellcheckStrategy(ISourceViewer viewer, String contentTypeId) {
- super(viewer);
- fContentTypeId = contentTypeId;
-
- fSpellingContext = new SpellingContext();
- IContentType contentType = Platform.getContentTypeManager().getContentType(fContentTypeId);
- fSpellingContext.setContentType(contentType);
- fReconcileAnnotationKey = new ReconcileAnnotationKey(fSpellingStep, KEY_CONTENT_TYPE, ReconcileAnnotationKey.PARTIAL);
-
- /**
- * Inherit spelling region rules
- */
- List contexts = new ArrayList();
- IContentType testType = contentType;
- while (testType != null) {
- String[] textRegionContexts = ExtendedConfigurationBuilder.getInstance().getDefinitions(EXTENDED_BUILDER_TYPE_CONTEXTS, testType.getId());
- for (int j = 0; j < textRegionContexts.length; j++) {
- contexts.addAll(Arrays.asList(StringUtils.unpack(textRegionContexts[j])));
- }
- testType = testType.getBaseType();
- }
- fSupportedTextRegionContexts = (String[]) contexts.toArray(new String[contexts.size()]);
-
- fSpellCheckPreferenceListener = new SpellCheckPreferenceListener();
- }
-
- protected boolean containsStep(IReconcileStep step) {
- return fSpellingStep.equals(step);
- }
-
- public void createReconcileSteps() {
-
- }
-
- private TemporaryAnnotation[] getSpellingAnnotationsToRemove(IRegion region) {
- List toRemove = new ArrayList();
- IAnnotationModel annotationModel = getAnnotationModel();
- // can be null when closing the editor
- if (annotationModel != null) {
- Iterator i = null;
- boolean annotationOverlaps = false;
- if (annotationModel instanceof IAnnotationModelExtension2) {
- i = ((IAnnotationModelExtension2) annotationModel).getAnnotationIterator(region.getOffset(), region.getLength(), true, true);
- annotationOverlaps = true;
- }
- else {
- i = annotationModel.getAnnotationIterator();
- }
-
- while (i.hasNext()) {
- Object obj = i.next();
- if (!(obj instanceof TemporaryAnnotation))
- continue;
-
- TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
- ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-
- // then if this strategy knows how to add/remove this
- // partition type
- if (key != null && key.equals(fReconcileAnnotationKey)) {
- if (key.getScope() == ReconcileAnnotationKey.PARTIAL && (annotationOverlaps || annotation.getPosition().overlapsWith(region.getOffset(), region.getLength()))) {
- toRemove.add(annotation);
- }
- else if (key.getScope() == ReconcileAnnotationKey.TOTAL) {
- toRemove.add(annotation);
- }
- }
- }
- }
-
- return (TemporaryAnnotation[]) toRemove.toArray(new TemporaryAnnotation[toRemove.size()]);
- }
-
- /**
- * Judge whether a spelling problem is "interesting". Accept any regions
- * that are explicitly allowed, and since valid prose areas are rarely in
- * a complicated document region, accept any document region with more
- * than one text region and reject any document regions containing foreign
- * text regions.
- *
- * @param problem
- * a SpellingProblem
- * @return whether the collector should accept the given SpellingProblem
- */
- protected boolean isInterestingProblem(SpellingProblem problem) {
- IDocument document = getDocument();
- if (document instanceof IStructuredDocument) {
- /*
- * If the error is in a read-only section, ignore it. The user
- * won't be able to correct it.
- */
- if (((IStructuredDocument) document).containsReadOnly(problem.getOffset(), problem.getLength()))
- return false;
-
- IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(problem.getOffset());
- if (documentRegion != null) {
- ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(problem.getOffset());
- //if the region is not null, and is a supported context and is not a collection of regions,
- // and it should be spell-checked, then spell check it.
- if (textRegion != null && isSupportedContext(textRegion.getType()) && !(textRegion instanceof ITextRegionCollection) && shouldSpellcheck(problem.getOffset())) {
- return true;
- }
- if (documentRegion.getFirstRegion() instanceof ForeignRegion)
- return false;
-// [192572] Simple regions were being spellchecked just for the sake of them being simple
-// if (documentRegion.getRegions().size() == 1)
-// return true;
- return false;
- }
- }
- return true;
- }
-
-
- private boolean isSupportedContext(String type) {
- boolean isSupported = false;
- if (fSupportedTextRegionContexts.length > 0) {
- for (int i = 0; i < fSupportedTextRegionContexts.length; i++) {
- if (type.equals(fSupportedTextRegionContexts[i])) {
- isSupported = true;
- break;
- }
- }
- }
- else {
- isSupported = true;
- }
- return isSupported;
- }
-
- public void reconcile() {
- IDocument document = getDocument();
- if (document != null) {
- IAnnotationModel annotationModel = getAnnotationModel();
- if (annotationModel != null) {
- IRegion documentRegion = new Region(0, document.getLength());
- spellCheck(documentRegion, documentRegion, annotationModel);
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion,
- * org.eclipse.jface.text.IRegion)
- */
- public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
- if (isCanceled())
- return;
-
- IAnnotationModel annotationModel = getAnnotationModel();
-
- IDocument document = getDocument();
- if (document != null) {
- long time0 = 0;
- if (_DEBUG_SPELLING) {
- time0 = System.currentTimeMillis();
- }
- /**
- * Apparently the default spelling engine has noticeable overhead
- * when called multiple times in rapid succession. It's faster to
- * check the entire dirty region at once since we know that we're
- * not differentiating by partition.
- *
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=192530
- */
- if (_DEBUG_SPELLING) {
- Logger.log(Logger.INFO, "Spell Checking [" + dirtyRegion.getOffset() + ":" + dirtyRegion.getLength() + "] : " + (System.currentTimeMillis() - time0));
- }
- if (annotationModel != null) {
- spellCheck(dirtyRegion, dirtyRegion, annotationModel);
- }
- }
- }
-
- private void spellCheck(IRegion dirtyRegion, IRegion regionToBeChecked, IAnnotationModel annotationModel) {
- if (annotationModel == null)
- return;
-
- TemporaryAnnotation[] annotationsToRemove;
- Annotation[] annotationsToAdd;
- annotationsToRemove = getSpellingAnnotationsToRemove(regionToBeChecked);
-
- if (_DEBUG_SPELLING_PROBLEMS) {
- Logger.log(Logger.INFO, "Spell checking [" + regionToBeChecked.getOffset() + "-" + (regionToBeChecked.getOffset() + regionToBeChecked.getLength()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (getDocument() != null) {
- try {
- EditorsUI.getSpellingService().check(getDocument(), new IRegion[]{regionToBeChecked}, fSpellingContext, fProblemCollector, null);
- }
- finally {
- // corresponding "get" is in #shouldSpellCheck(int)
- if (structuredModel != null) {
- structuredModel.releaseFromRead();
- structuredModel = null;
- }
- }
- }
- annotationsToAdd = fProblemCollector.getAnnotations();
- fProblemCollector.clear();
-
-
- if (annotationModel instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension modelExtension = (IAnnotationModelExtension) annotationModel;
- Map annotationsToAddMap = new HashMap();
- for (int i = 0; i < annotationsToAdd.length; i++) {
- annotationsToAddMap.put(annotationsToAdd[i], ((TemporaryAnnotation) annotationsToAdd[i]).getPosition());
- }
- modelExtension.replaceAnnotations(annotationsToRemove, annotationsToAddMap);
- }
-
- else {
- for (int j = 0; j < annotationsToAdd.length; j++) {
- annotationModel.addAnnotation(annotationsToAdd[j], ((TemporaryAnnotation) annotationsToAdd[j]).getPosition());
- }
- for (int j = 0; j < annotationsToRemove.length; j++) {
- annotationModel.removeAnnotation(annotationsToRemove[j]);
- }
- }
- }
-
- /**
- * @param partition
- * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
- */
-
- public void reconcile(IRegion partition) {
- IDocument document = getDocument();
- if (document != null) {
- IAnnotationModel annotationModel = getAnnotationModel();
- if (annotationModel != null) {
- spellCheck(partition, partition, annotationModel);
- }
- }
- }
-
- public void setDocument(IDocument document) {
- if (getDocument() != null) {
- EditorsUI.getPreferenceStore().removePropertyChangeListener(fSpellCheckPreferenceListener);
- }
-
- super.setDocument(document);
-
- if (getDocument() != null) {
- EditorsUI.getPreferenceStore().addPropertyChangeListener(fSpellCheckPreferenceListener);
- }
- }
-
- /**
- * Decides if the given offset should be spell-checked using an <code>IAdapterFactory</code>
- *
- * @param offset Decide if this offset should be spell-checked
- * @return <code>true</code> if the given <code>offset</code> should be spell-checked,
- * <code>false</code> otherwise.
- */
- private boolean shouldSpellcheck(int offset) {
- boolean decision = true;
-
- if (structuredModel == null)
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-
- if (structuredModel != null) {
- /*
- * use an an adapter factory to get a spell-check decision maker,
- * and ask it if the offset should be spell-checked. It is done
- * this way so content type specific decisions can be made without
- * this plugin being aware of any content type specifics.
- */
- ISpellcheckDelegate delegate = (ISpellcheckDelegate) Platform.getAdapterManager().getAdapter(structuredModel, ISpellcheckDelegate.class);
- if (delegate != null) {
- decision = delegate.shouldSpellcheck(offset, structuredModel);
- }
- }
-
- return decision;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java
deleted file mode 100644
index f8e4ddd2c0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.sse.ui.internal.spelling;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.ui.texteditor.spelling.SpellingProblem;
-
-/**
- * Spelling correction processor used to show quick fixes for spelling
- * problems.
- *
- * @since 2.0
- */
-class SpellingQuickAssistProcessor implements IQuickAssistProcessor {
- private SpellingProblem fSpellingProblem = null;
-
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- return false;
- }
-
- public boolean canFix(Annotation annotation) {
- return !annotation.isMarkedDeleted();
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext quickAssistContext) {
- ICompletionProposal[] proposals = null;
-
- if (fSpellingProblem != null) {
- proposals = fSpellingProblem.getProposals(quickAssistContext);
- }
- return proposals;
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- void setSpellingProblem(SpellingProblem spellingProblem) {
- fSpellingProblem = spellingProblem;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java
deleted file mode 100644
index edd6877559..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java
+++ /dev/null
@@ -1,771 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.style;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.ISemanticHighlighting;
-import org.eclipse.wst.sse.ui.ISemanticHighlightingExtension2;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * Semantic highlighting manager. Responsible for maintaining the semantic highlightings
- * and the associated styles. Semantic highlighting preference changes are handled
- * through listeners in this class. Based on org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingManager
- *
- * @since 3.1
- */
-public class SemanticHighlightingManager implements IPropertyChangeListener {
-
- /**
- * HighlightingStyle.
- */
- static class HighlightingStyle {
-
- /** Text attribute */
- private TextAttribute fTextAttribute;
- /** Enabled state */
- private boolean fIsEnabled;
-
- /**
- * Initialize with the given text attribute.
- * @param textAttribute The text attribute
- * @param isEnabled the enabled state
- */
- public HighlightingStyle(TextAttribute textAttribute, boolean isEnabled) {
- setTextAttribute(textAttribute);
- setEnabled(isEnabled);
- }
-
- /**
- * @return Returns the text attribute.
- */
- public TextAttribute getTextAttribute() {
- return fTextAttribute;
- }
-
- /**
- * @param textAttribute The background to set.
- */
- public void setTextAttribute(TextAttribute textAttribute) {
- fTextAttribute = textAttribute;
- }
-
- /**
- * @return the enabled state
- */
- public boolean isEnabled() {
- return fIsEnabled;
- }
-
- /**
- * @param isEnabled the new enabled state
- */
- public void setEnabled(boolean isEnabled) {
- fIsEnabled = isEnabled;
- }
- }
-
- /**
- * Highlighted Positions.
- */
- static class HighlightedPosition extends Position {
-
- /** Highlighting of the position */
- private HighlightingStyle fStyle;
-
- private boolean fReadOnly;
-
- /** Lock object */
- private Object fLock;
-
- /**
- * Initialize the styled positions with the given offset, length and foreground color.
- *
- * @param offset The position offset
- * @param length The position length
- * @param highlighting The position's highlighting
- * @param lock The lock object
- */
- public HighlightedPosition(int offset, int length, HighlightingStyle highlighting, Object lock, boolean isReadOnly) {
- super(offset, length);
- fStyle = highlighting;
- fLock = lock;
- fReadOnly = isReadOnly;
- }
-
- public HighlightedPosition(int offset, int length, HighlightingStyle highlighting, Object lock) {
- this(offset, length, highlighting, lock, false);
- }
-
- public HighlightedPosition(Position position, HighlightingStyle highlighting, Object lock) {
- this(position.offset, position.length, highlighting, lock, false);
- }
-
- public HighlightedPosition(Position position, HighlightingStyle highlighting, Object lock, boolean isReadOnly) {
- this(position.offset, position.length, highlighting, lock, isReadOnly);
- }
-
- /**
- * @return Returns a corresponding style range.
- */
- public StyleRange createStyleRange() {
- int len= 0;
- if (fStyle.isEnabled())
- len= getLength();
-
- TextAttribute textAttribute = fStyle.getTextAttribute();
- int style = textAttribute.getStyle();
- int fontStyle = style & (SWT.ITALIC | SWT.BOLD | SWT.NORMAL);
- StyleRange styleRange = new StyleRange(getOffset(), len, textAttribute.getForeground(), textAttribute.getBackground(), fontStyle);
- styleRange.strikeout = (style & TextAttribute.STRIKETHROUGH) != 0;
- styleRange.underline = (style & TextAttribute.UNDERLINE) != 0;
-
- return styleRange;
- }
-
- /**
- * Uses reference equality for the highlighting.
- *
- * @param off The offset
- * @param len The length
- * @param highlighting The highlighting
- * @return <code>true</code> iff the given offset, length and highlighting are equal to the internal ones.
- */
- public boolean isEqual(int off, int len, HighlightingStyle highlighting) {
- synchronized (fLock) {
- return !isDeleted() && getOffset() == off && getLength() == len && fStyle == highlighting;
- }
- }
-
- /**
- * Uses reference equality for the highlighting.
- *
- * @param pos The position
- * @param highlighting The highlighting
- * @return <code>true</code> iff the given offset, length and highlighting are equal to the internal ones.
- */
- public boolean isEqual(Position pos, HighlightingStyle highlighting) {
- synchronized (fLock) {
- return !isDeleted() && getOffset() == pos.getOffset() && getLength() == pos.getLength() && fStyle == highlighting;
- }
- }
-
- /**
- * Is this position contained in the given range (inclusive)? Synchronizes on position updater.
- *
- * @param off The range offset
- * @param len The range length
- * @return <code>true</code> iff this position is not delete and contained in the given range.
- */
- public boolean isContained(int off, int len) {
- synchronized (fLock) {
- return !isDeleted() && off <= getOffset() && off + len >= getOffset() + getLength();
- }
- }
-
- public void update(int off, int len) {
- synchronized (fLock) {
- super.setOffset(off);
- super.setLength(len);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.Position#setLength(int)
- */
- public void setLength(int length) {
- synchronized (fLock) {
- super.setLength(length);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.Position#setOffset(int)
- */
- public void setOffset(int offset) {
- synchronized (fLock) {
- super.setOffset(offset);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.Position#delete()
- */
- public void delete() {
- synchronized (fLock) {
- super.delete();
- }
- }
-
- /*
- * @see org.eclipse.jface.text.Position#undelete()
- */
- public void undelete() {
- synchronized (fLock) {
- super.undelete();
- }
- }
-
- /**
- * @return Returns the highlighting.
- */
- public HighlightingStyle getHighlighting() {
- return fStyle;
- }
-
- public boolean isReadOnly() {
- return fReadOnly;
- }
- }
-
- /**
- * Highlighted ranges.
- */
- public static class HighlightedRange extends Region {
- /** The highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}. */
- private String fKey;
-
- /**
- * Initialize with the given offset, length and highlighting key.
- *
- * @param offset
- * @param length
- * @param key the highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}
- */
- public HighlightedRange(int offset, int length, String key) {
- super(offset, length);
- fKey = key;
- }
-
- /**
- * @return the highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}
- */
- public String getKey() {
- return fKey;
- }
-
- /*
- * @see org.eclipse.jface.text.Region#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- return super.equals(o) && o instanceof HighlightedRange && fKey.equals(((HighlightedRange)o).getKey());
- }
-
- /*
- * @see org.eclipse.jface.text.Region#hashCode()
- */
- public int hashCode() {
- return super.hashCode() | fKey.hashCode();
- }
- }
-
- private static final String SEMANTIC_HIGHLIGHTING_EXTENSION_POINT = "semanticHighlighting"; //$NON-NLS-1$
- private static final String TARGET_ATTR = "target"; //$NON-NLS-1$
- private static final String CLASS_ATTR = "class"; //$NON-NLS-1$
- private static final String STYLE_KEY_ATTR = "styleStringKey"; //$NON-NLS-1$
-
- private ISourceViewer fSourceViewer;
- private IPreferenceStore fPreferenceStore;
- private SourceViewerConfiguration fConfiguration;
- private StructuredPresentationReconciler fPresentationReconciler;
- private String fContentTypeId;
-
- private SemanticHighlightingPresenter fPresenter;
- private SemanticHighlightingReconciler fReconciler;
-
- /** The semantic highlightings for the content type */
- private ISemanticHighlighting[] fHighlightings;
- /** The semantic highlighting styles associated with the semantic highlightings */
- private HighlightingStyle[] fHighlightingStyles;
- /** The semantic highlighting style string preference keys. null of the highlighting doesn't support it */
- private String[] fHighlightingStyleStringKeys;
-
- private IPropertyChangeListener fHighlightingChangeListener = new IPropertyChangeListener() {
-
- public void propertyChange(PropertyChangeEvent event) {
- handleHighlightingPropertyChange(event);
- }
- };
-
- public void propertyChange(PropertyChangeEvent event) {
- handlePropertyChange(event);
- }
-
- public void install(ISourceViewer sourceViewer, IPreferenceStore preferenceStore, SourceViewerConfiguration configuration, String contentTypeId) {
- fSourceViewer = sourceViewer;
- fPreferenceStore = preferenceStore;
- fConfiguration = configuration;
- fContentTypeId = contentTypeId;
-
- fPreferenceStore.addPropertyChangeListener(this);
- fPresentationReconciler = (StructuredPresentationReconciler) fConfiguration.getPresentationReconciler(fSourceViewer);
-
- if (isEnabled()) {
- enable();
- }
- }
-
- /**
- * Load the semantic highlightings defined for this content type.
- */
- private void loadSemanticHighlightings() {
- List semantics = new ArrayList(0);
-
- ISemanticHighlighting highlighting = null;
- String styleKey = null;
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, SEMANTIC_HIGHLIGHTING_EXTENSION_POINT);
-
- IContentType contentType = Platform.getContentTypeManager().getContentType(fContentTypeId);
-
- for (int i = 0; i < elements.length; i++) {
- String[] targets = StringUtils.unpack(elements[i].getAttribute(TARGET_ATTR));
- for (int j = 0; j < targets.length; j++) {
- IContentType targetContentType = Platform.getContentTypeManager().getContentType(targets[j]);
- /* Apply semantic highlighting to kinds of targetContentType */
- if (contentType.isKindOf(targetContentType)) {
- try {
- highlighting = (ISemanticHighlighting) elements[i].createExecutableExtension(CLASS_ATTR);
- styleKey = elements[i].getAttribute(STYLE_KEY_ATTR);
- } catch (CoreException e) {
- Logger.logException(e);
- }
- if (highlighting != null)
- semantics.add(new SemanticContent(targetContentType, highlighting, styleKey));
-
- break;
- }
- }
- }
- /* Sort the semantics, so that styles will be applied from general to specific */
- Collections.sort(semantics);
- fHighlightings = new ISemanticHighlighting[semantics.size()];
- fHighlightingStyles = new HighlightingStyle[semantics.size()];
- fHighlightingStyleStringKeys = new String[semantics.size()];
-
- for (int i = 0; i < semantics.size(); i++) {
- fHighlightings[i] = ((SemanticContent) semantics.get(i)).getHighlighting();
- styleKey = ((SemanticContent) semantics.get(i)).getStyleKey();
- fHighlightingStyles[i] = createHighlightingStyle(((SemanticContent) semantics.get(i)).getHighlighting(), styleKey);
- fHighlightingStyleStringKeys[i] = styleKey;
- }
- }
-
- /**
- * This class is used for relating a semantic highlighting to a content type.
- * The content type is used in the sorting algorithm. Content types that are more specific
- * to the file's content type will cause styles to be applied from general to specific
- */
- private class SemanticContent implements Comparable {
- public IContentType type;
- public ISemanticHighlighting highlighting;
- public String styleKey;
-
- public SemanticContent(IContentType type, ISemanticHighlighting highlighting, String styleKey) {
- this.type = type;
- this.highlighting = highlighting;
- this.styleKey = styleKey;
- }
-
- public int compareTo(Object arg0) {
- SemanticContent other = (SemanticContent) arg0;
- /* Equal weighting for the same types */
- if (this.type.equals(other.type))
- return 0;
- /* Subtypes have more weight than base types */
- if (this.type.isKindOf(other.type))
- return 1;
- return -1;
- }
-
- public ISemanticHighlighting getHighlighting() {
- return highlighting;
- }
-
- public String getStyleKey() {
- return styleKey;
- }
- }
-
- /**
- * Creates a highlighting style based on the preferences defined in the semantic highlighting
- * @param highlighting the semantic highlighting
- * @return a highlighting style based on the preferences of the semantic highlighting
- */
- private HighlightingStyle createHighlightingStyle(ISemanticHighlighting highlighting, String styleKey) {
- IPreferenceStore store = highlighting.getPreferenceStore();
- HighlightingStyle highlightingStyle = null;
- if (store != null) {
- TextAttribute attribute = null;
- // A style string is used instead of separate attribute keys
- if (styleKey != null) {
- attribute = createTextAttribute(store.getString(styleKey));
- }
- else {
- int style = getBoolean(store, highlighting.getBoldPreferenceKey()) ? SWT.BOLD : SWT.NORMAL;
-
- if (getBoolean(store, highlighting.getItalicPreferenceKey()))
- style |= SWT.ITALIC;
- if (getBoolean(store, highlighting.getStrikethroughPreferenceKey()))
- style |= TextAttribute.STRIKETHROUGH;
- if (getBoolean(store, highlighting.getUnderlinePreferenceKey()))
- style |= TextAttribute.UNDERLINE;
-
- String rgbString = getString(store, highlighting.getColorPreferenceKey());
- Color color = null;
- Color bgColor = null;
-
- if (rgbString != null)
- color = EditorUtility.getColor(ColorHelper.toRGB(rgbString));
- if (highlighting instanceof ISemanticHighlightingExtension2) {
- rgbString = getString(store, ((ISemanticHighlightingExtension2) highlighting).getBackgroundColorPreferenceKey());
- if (rgbString != null) {
- bgColor = EditorUtility.getColor(ColorHelper.toRGB(rgbString));
- }
- }
- attribute = new TextAttribute(color, bgColor, style);
- }
-
- store.addPropertyChangeListener(fHighlightingChangeListener);
- boolean isEnabled = getBoolean(store, highlighting.getEnabledPreferenceKey());
- highlightingStyle = new HighlightingStyle(attribute, isEnabled);
- }
- return highlightingStyle;
- }
-
- /**
- * Creates a text attribute from the style string
- *
- * @param styleValue style string in the form: <code>RGB foreground (#rrggbb) | RGB background (#rrggbb) | bold (true/false) | italic (true/false) | strikethrough (true/false) | underline (true/false)</code>
- * @return text attribute created from the <code>styleValue</code> or null if the <code>styleValue</code> is invalid
- */
- private TextAttribute createTextAttribute(String styleValue) {
- String[] values = ColorHelper.unpackStylePreferences(styleValue);
- if (values.length < 6)
- return null;
-
- RGB foreground = ColorHelper.toRGB(values[0]);
- RGB background = ColorHelper.toRGB(values[1]);
- boolean bold = Boolean.valueOf(values[2]).booleanValue();
- boolean italic = Boolean.valueOf(values[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(values[4]).booleanValue();
- boolean underline = Boolean.valueOf(values[5]).booleanValue();
-
- int style = SWT.NORMAL;
- if (bold)
- style = style | SWT.BOLD;
- if (italic)
- style = style | SWT.ITALIC;
- if (strikethrough)
- style = style | TextAttribute.STRIKETHROUGH;
- if (underline)
- style = style | TextAttribute.UNDERLINE;
-
- return createTextAttribute(foreground, background, style);
- }
-
- private TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
- /**
- * Looks up a boolean preference by <code>key</code> from the preference store
- * @param store the preference store to lookup the preference from
- * @param key the key the preference is stored under
- * @return the preference value from the preference store iff key is not null
- */
- private boolean getBoolean(IPreferenceStore store, String key) {
- return (key == null) ? false : store.getBoolean(key);
- }
-
- /**
- * Looks up a String preference by <code>key</code> from the preference store
- * @param store the preference store to lookup the preference from
- * @param key the key the preference is stored under
- * @return the preference value from the preference store iff key is not null
- */
- private String getString(IPreferenceStore store, String key) {
- return (key == null) ? null : store.getString(key);
- }
-
- /**
- * Enable semantic highlighting.
- */
- private void enable() {
-
- loadSemanticHighlightings();
-
- fPresenter = new SemanticHighlightingPresenter();
- fPresenter.install(fSourceViewer, fPresentationReconciler);
-// if (fEditor != null) {
- fReconciler = new SemanticHighlightingReconciler();
- fReconciler.install(fSourceViewer, fPresenter, fHighlightings, fHighlightingStyles);
- IReconciler reconciler = fConfiguration.getReconciler(fSourceViewer);
- if (reconciler instanceof DocumentRegionProcessor)
- ((DocumentRegionProcessor) reconciler).setSemanticHighlightingStrategy(fReconciler);
-// } else {
-// fPresenter.updatePresentation(null, createHardcodedPositions(), new HighlightedPosition[0]);
-// }
- }
-
- /**
- * Disable semantic highlighting
- */
- private void disable() {
- if (fReconciler != null) {
- fReconciler.uninstall();
- fReconciler = null;
- }
-
- if (fPresenter != null) {
- fPresenter.uninstall();
- fPresenter = null;
- }
-
- if (fHighlightings != null)
- disposeHighlightings();
- }
-
- private void disposeHighlightings() {
- /* Remove the property change listener before clearing the lists */
- if (fHighlightings != null) {
- for (int i = 0; i < fHighlightings.length; i++) {
- IPreferenceStore store = fHighlightings[i].getPreferenceStore();
- if (store != null)
- store.removePropertyChangeListener(fHighlightingChangeListener);
- }
- }
-
- fHighlightings = null;
- fHighlightingStyles = null;
- fHighlightingStyleStringKeys = null;
- }
-
- /**
- * Handles property change events for individual semantic highlightings.
- * @param event
- */
- private void handleHighlightingPropertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property == null)
- return;
-
- boolean refreshRequired = false;
-
- for (int i = 0; i < fHighlightings.length; i++) {
- ISemanticHighlighting highlighting = fHighlightings[i];
-
- if (fHighlightingStyleStringKeys[i] != null) {
- if (property.equals(fHighlightingStyleStringKeys[i])) {
- adaptToStyleChange(fHighlightingStyles[i], event);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
- }
-
- if (property.equals(highlighting.getBoldPreferenceKey())) {
- adaptToTextStyleChange(fHighlightingStyles[i], event, SWT.BOLD);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (property.equals(highlighting.getColorPreferenceKey())) {
- adaptToTextForegroundChange(fHighlightingStyles[i], event);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (property.equals(highlighting.getEnabledPreferenceKey())) {
- adaptToEnablementChange(fHighlightingStyles[i], event);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (property.equals(highlighting.getItalicPreferenceKey())) {
- adaptToTextStyleChange(fHighlightingStyles[i], event, SWT.ITALIC);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (property.equals(highlighting.getStrikethroughPreferenceKey())) {
- adaptToTextStyleChange(fHighlightingStyles[i], event, TextAttribute.STRIKETHROUGH);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (property.equals(highlighting.getUnderlinePreferenceKey())) {
- adaptToTextStyleChange(fHighlightingStyles[i], event, TextAttribute.UNDERLINE);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
-
- if (highlighting instanceof ISemanticHighlightingExtension2 && property.equals(((ISemanticHighlightingExtension2) highlighting).getBackgroundColorPreferenceKey())) {
- adaptToTextBackgroundChange(fHighlightingStyles[i], event);
- fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
- refreshRequired = true;
- continue;
- }
- }
-
- if (refreshRequired && fReconciler != null)
- fReconciler.refresh();
- }
-
- /**
- * Handles property changes for enabling and disabling semantic highlighting for
- * Structured Source Editors
- * @param event
- */
- private void handlePropertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property == null || !property.equals(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING))
- return;
-
- Object newValue = event.getNewValue();
- if (newValue instanceof Boolean) {
- if (((Boolean) newValue).booleanValue())
- enable();
- else
- disable();
- }
-
- if (fReconciler != null)
- fReconciler.refresh();
- }
-
- private void adaptToEnablementChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
- Object value = event.getNewValue();
- boolean eventValue;
- if (value instanceof Boolean)
- eventValue = ((Boolean) value).booleanValue();
- else if (IPreferenceStore.TRUE.equals(value))
- eventValue = true;
- else
- eventValue = false;
- highlighting.setEnabled(eventValue);
- }
-
- private void adaptToTextForegroundChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
- RGB rgb = null;
-
- Object value = event.getNewValue();
- if (value instanceof RGB)
- rgb= (RGB) value;
- else if (value instanceof String)
- rgb= ColorHelper.toRGB( (String) value);
-
- if (rgb != null) {
- Color color= EditorUtility.getColor(rgb);
- TextAttribute oldAttr= highlighting.getTextAttribute();
- highlighting.setTextAttribute(new TextAttribute(color, oldAttr.getBackground(), oldAttr.getStyle()));
- }
- }
-
- private void adaptToTextBackgroundChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
- RGB rgb = null;
-
- Object value = event.getNewValue();
- if (value instanceof RGB)
- rgb = (RGB) value;
- else if (value instanceof String)
- rgb = ColorHelper.toRGB( (String) value);
-
- if (rgb != null) {
- Color color= EditorUtility.getColor(rgb);
- TextAttribute oldAttr= highlighting.getTextAttribute();
- highlighting.setTextAttribute(new TextAttribute(oldAttr.getForeground(), color, oldAttr.getStyle()));
- }
- }
-
- private void adaptToTextStyleChange(HighlightingStyle highlighting, PropertyChangeEvent event, int styleAttribute) {
- boolean eventValue = false;
- Object value = event.getNewValue();
- if (value instanceof Boolean)
- eventValue = ((Boolean) value).booleanValue();
- else if (IPreferenceStore.TRUE.equals(value))
- eventValue = true;
-
- TextAttribute oldAttr = highlighting.getTextAttribute();
- boolean activeValue = (oldAttr.getStyle() & styleAttribute) == styleAttribute;
-
- if (activeValue != eventValue)
- highlighting.setTextAttribute(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(), eventValue ? oldAttr.getStyle() | styleAttribute : oldAttr.getStyle() & ~styleAttribute));
- }
-
- /**
- * Adapts to a style string change
- *
- * @param highlighting the highlighting style to update
- * @param event the event that triggered the change
- */
- private void adaptToStyleChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
- Object value = event.getNewValue();
- if (value instanceof String) {
- TextAttribute attr = createTextAttribute((String) value);
- if (attr != null)
- highlighting.setTextAttribute(attr);
- }
- }
-
- /**
- * @return <code>true</code> iff semantic highlighting is enabled in the preferences
- */
- private boolean isEnabled() {
- return (fPreferenceStore != null) ? fPreferenceStore.getBoolean(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING) : false;
- }
-
- public void uninstall() {
- disable();
-
- if (fPreferenceStore != null) {
- fPreferenceStore.removePropertyChangeListener(this);
- fPreferenceStore = null;
- }
-
- fSourceViewer = null;
- fConfiguration = null;
- fPresentationReconciler = null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java
deleted file mode 100644
index 093ec05b77..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java
+++ /dev/null
@@ -1,1067 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.style;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ISynchronizable;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextPresentationListener;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension4;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
-import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition;
-import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightingStyle;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * Semantic highlighting presenter - UI thread implementation. Based on
- * org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingPresenter
- *
- * @since 3.1
- */
-public class SemanticHighlightingPresenter implements ITextPresentationListener, ITextInputListener, IDocumentListener {
-
- /**
- * Semantic highlighting position updater.
- */
- private class HighlightingPositionUpdater implements IPositionUpdater {
-
- /** The position category. */
- private final String fCategory;
-
- /**
- * Creates a new updater for the given <code>category</code>.
- *
- * @param category the new category.
- */
- public HighlightingPositionUpdater(String category) {
- fCategory= category;
- }
-
- /*
- * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent)
- */
- public void update(DocumentEvent event) {
-
- int eventOffset= event.getOffset();
- int eventOldLength= event.getLength();
- int eventEnd= eventOffset + eventOldLength;
-
- try {
- Position[] positions= event.getDocument().getPositions(fCategory);
-
- for (int i= 0; i != positions.length; i++) {
-
- HighlightedPosition position= (HighlightedPosition) positions[i];
-
- // Also update deleted positions because they get deleted by the background thread and removed/invalidated only in the UI runnable
-// if (position.isDeleted())
-// continue;
-
- int offset= position.getOffset();
- int length= position.getLength();
- int end= offset + length;
-
- if (offset > eventEnd)
- updateWithPrecedingEvent(position, event);
- else if (end < eventOffset) {
- // do nothing
- // updateWithSucceedingEvent(position, event);
- }
- else if (offset <= eventOffset && end >= eventEnd) {
- // Previous region updated to overlap the beginning of this one; just bump the start.
- if (i > 0 && positions[i - 1].offset + positions[i - 1].length > offset)
- updateWithPrecedingEvent(position, event);
- else
- updateWithIncludedEvent(position, event);
- }
- else if (offset <= eventOffset)
- updateWithOverEndEvent(position, event);
- else if (end >= eventEnd)
- updateWithOverStartEvent(position, event);
- else
- updateWithIncludingEvent(position, event);
- }
- } catch (BadPositionCategoryException e) {
- // ignore and return
- }
- }
-
- /**
- * Update the given position with the given event. The event precedes the position.
- *
- * @param position The position
- * @param event The event
- */
- private void updateWithPrecedingEvent(HighlightedPosition position, DocumentEvent event) {
- String newText= event.getText();
- int eventNewLength= newText != null ? newText.length() : 0;
- int deltaLength= eventNewLength - event.getLength();
-
- position.setOffset(position.getOffset() + deltaLength);
- }
-
- /**
- * Update the given position with the given event. The event succeeds the position.
- *
- * @param position The position
- * @param event The event
- */
-// private void updateWithSucceedingEvent(HighlightedPosition position, DocumentEvent event) {
-// }
-
- /**
- * Update the given position with the given event. The event is included by the position.
- *
- * @param position The position
- * @param event The event
- */
- private void updateWithIncludedEvent(HighlightedPosition position, DocumentEvent event) {
- int eventOffset= event.getOffset();
- String newText= event.getText();
- if (newText == null)
- newText= ""; //$NON-NLS-1$
- int eventNewLength= newText.length();
-
- int deltaLength= eventNewLength - event.getLength();
-
- int offset= position.getOffset();
- int length= position.getLength();
- int end= offset + length;
-
- int includedLength= 0;
- while (includedLength < eventNewLength && !Character.isWhitespace(newText.charAt(includedLength)))
- includedLength++;
- if (includedLength == eventNewLength)
- position.setLength(length + deltaLength);
- else {
- int newLeftLength= eventOffset - offset + includedLength;
-
- int excludedLength= eventNewLength;
- while (excludedLength > 0 && !Character.isWhitespace(newText.charAt(excludedLength - 1)))
- excludedLength--;
- int newRightOffset= eventOffset + excludedLength;
- int newRightLength= end + deltaLength - newRightOffset;
-
- if (newRightLength == 0) {
- position.setLength(newLeftLength);
- } else {
- if (newLeftLength == 0) {
- position.update(newRightOffset, newRightLength);
- } else {
- position.setLength(newLeftLength);
- addPositionFromUI(position);
- }
- }
- }
- }
-
- /**
- * Update the given position with the given event. The event overlaps with the end of the position.
- *
- * @param position The position
- * @param event The event
- */
- private void updateWithOverEndEvent(HighlightedPosition position, DocumentEvent event) {
- String newText= event.getText();
- if (newText == null)
- newText= ""; //$NON-NLS-1$
- int eventNewLength= newText.length();
-
- int includedLength= 0;
- while (includedLength < eventNewLength && !Character.isWhitespace(newText.charAt(includedLength)))
- includedLength++;
- position.setLength(event.getOffset() - position.getOffset() + includedLength);
- }
-
- /**
- * Update the given position with the given event. The event overlaps with the start of the position.
- *
- * @param position The position
- * @param event The event
- */
- private void updateWithOverStartEvent(HighlightedPosition position, DocumentEvent event) {
- int eventOffset= event.getOffset();
- int eventEnd= eventOffset + event.getLength();
-
- String newText= event.getText();
- if (newText == null)
- newText= ""; //$NON-NLS-1$
- int eventNewLength= newText.length();
-
- int excludedLength= eventNewLength;
- while (excludedLength > 0 && !Character.isWhitespace(newText.charAt(excludedLength - 1)))
- excludedLength--;
- int deleted= eventEnd - position.getOffset();
- int inserted= eventNewLength - excludedLength;
- position.update(eventOffset + excludedLength, position.getLength() - deleted + inserted);
- }
-
- /**
- * Update the given position with the given event. The event includes the position.
- *
- * @param position The position
- * @param event The event
- */
- private void updateWithIncludingEvent(HighlightedPosition position, DocumentEvent event) {
- position.delete();
- position.update(event.getOffset(), 0);
- }
- }
-
- /** Position updater */
- private IPositionUpdater fPositionUpdater= new HighlightingPositionUpdater(getPositionCategory());
-
- /** The source viewer this semantic highlighting reconciler is installed on */
- private ISourceViewer fSourceViewer;
- /** The background presentation reconciler */
- private StructuredPresentationReconciler fPresentationReconciler;
-
- /** UI's current highlighted positions - can contain <code>null</code> elements */
- private List fPositions= new ArrayList();
- /** UI position lock */
- private Object fPositionLock= new Object();
-
- /** <code>true</code> iff the current reconcile is canceled. */
- private boolean fIsCanceled= false;
-
- /** Read-only color support */
- private YUV_RGBConverter rgbConverter;
- private Map readOnlyColorTable;
- double readOnlyForegroundScaleFactor = 30;
-
- public SemanticHighlightingPresenter() {
- // no listener for now since there's no UI to change the value
- IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
- readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
- }
-
- /**
- * Creates and returns a new highlighted position with the given offset, length and highlighting.
- * <p>
- * NOTE: Also called from background thread.
- * </p>
- *
- * @param offset The offset
- * @param length The length
- * @param highlighting The highlighting
- * @return The new highlighted position
- */
- public HighlightedPosition createHighlightedPosition(int offset, int length, HighlightingStyle highlighting) {
- // TODO: reuse deleted positions
- return new HighlightedPosition(offset, length, highlighting, fPositionUpdater);
- }
-
- /**
- * Creates and returns a new highlighted position from the given position and highlighting.
- * <p>
- * NOTE: Also called from background thread.
- * </p>
- *
- * @param position The position
- * @param highlighting The highlighting
- * @return The new highlighted position
- */
- public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting) {
- // TODO: reuse deleted positions
- return new HighlightedPosition(position, highlighting, fPositionUpdater);
- }
-
- /**
- * Creates and returns a new highlighted position from the given position and highlighting.
- * <p>
- * NOTE: Also called from background thread.
- * </p>
- *
- * @param position The position
- * @param highlighting The highlighting
- * @param isReadOnly Is this a read-only position
- * @return The new highlighted position
- */
- public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
- // TODO: reuse deleted positions
- return new HighlightedPosition(position, highlighting, fPositionUpdater, isReadOnly);
- }
-
- /**
- * Adds all current positions to the given list.
- * <p>
- * NOTE: Called from background thread.
- * </p>
- *
- * @param list The list
- */
- public void addAllPositions(List list) {
- synchronized (fPositionLock) {
- list.addAll(fPositions);
- }
- }
-
- /**
- * Create a text presentation in the background.
- * <p>
- * NOTE: Called from background thread.
- * </p>
- *
- * @param addedPositions the added positions
- * @param removedPositions the removed positions
- * @return the text presentation or <code>null</code>, if reconciliation should be canceled
- */
- public TextPresentation createPresentation(List addedPositions, List removedPositions) {
- ISourceViewer sourceViewer= fSourceViewer;
- StructuredPresentationReconciler presentationReconciler= fPresentationReconciler;
- if (sourceViewer == null || presentationReconciler == null)
- return null;
-
- if (isCanceled())
- return null;
-
- IDocument document= sourceViewer.getDocument();
- if (document == null)
- return null;
-
- int minStart= Integer.MAX_VALUE;
- int maxEnd= Integer.MIN_VALUE;
- for (int i= 0, n= removedPositions.size(); i < n; i++) {
- Position position= (Position) removedPositions.get(i);
- int offset= position.getOffset();
- minStart= Math.min(minStart, offset);
- maxEnd= Math.max(maxEnd, offset + position.getLength());
- }
- for (int i= 0, n= addedPositions.size(); i < n; i++) {
- Position position= (Position) addedPositions.get(i);
- int offset= position.getOffset();
- minStart= Math.min(minStart, offset);
- maxEnd= Math.max(maxEnd, offset + position.getLength());
- }
-
- if (minStart < maxEnd)
- try {
- return presentationReconciler.createRepairDescription(new Region(minStart, maxEnd - minStart), document);
- } catch (RuntimeException e) {
- // Assume concurrent modification from UI thread
- }
-
- return null;
- }
-
- /**
- * Create a runnable for updating the presentation.
- * <p>
- * NOTE: Called from background thread.
- * </p>
- * @param textPresentation the text presentation
- * @param addedPositions the added positions
- * @param removedPositions the removed positions
- * @return the runnable or <code>null</code>, if reconciliation should be canceled
- */
- public Runnable createUpdateRunnable(final TextPresentation textPresentation, List addedPositions, List removedPositions) {
- if (fSourceViewer == null || textPresentation == null)
- return null;
-
- // TODO: do clustering of positions and post multiple fast runnables
- final HighlightedPosition[] added= new SemanticHighlightingManager.HighlightedPosition[addedPositions.size()];
- addedPositions.toArray(added);
- final SemanticHighlightingManager.HighlightedPosition[] removed= new SemanticHighlightingManager.HighlightedPosition[removedPositions.size()];
- removedPositions.toArray(removed);
-
- if (isCanceled())
- return null;
-
- Runnable runnable= new Runnable() {
- public void run() {
- updatePresentation(textPresentation, added, removed);
- }
- };
- return runnable;
- }
-
- /**
- * Invalidate the presentation of the positions based on the given added positions and the existing deleted positions.
- * Also unregisters the deleted positions from the document and patches the positions of this presenter.
- * <p>
- * NOTE: Indirectly called from background thread by UI runnable.
- * </p>
- * @param textPresentation the text presentation or <code>null</code>, if the presentation should computed in the UI thread
- * @param addedPositions the added positions
- * @param removedPositions the removed positions
- */
- public void updatePresentation(TextPresentation textPresentation, HighlightedPosition[] addedPositions, HighlightedPosition[] removedPositions) {
- if (fSourceViewer == null)
- return;
-
-// checkOrdering("added positions: ", Arrays.asList(addedPositions)); //$NON-NLS-1$
-// checkOrdering("removed positions: ", Arrays.asList(removedPositions)); //$NON-NLS-1$
-// checkOrdering("old positions: ", fPositions); //$NON-NLS-1$
-
- // TODO: double-check consistency with document.getPositions(...)
- // TODO: reuse removed positions
- if (isCanceled())
- return;
-
- IDocument document= fSourceViewer.getDocument();
- if (document == null)
- return;
-
- String positionCategory= getPositionCategory();
-
- List removedPositionsList= Arrays.asList(removedPositions);
-
- try {
- synchronized (fPositionLock) {
- List oldPositions= fPositions;
- int newSize= Math.max(fPositions.size() + addedPositions.length - removedPositions.length, 10);
-
- /*
- * The following loop is a kind of merge sort: it merges two List<Position>, each
- * sorted by position.offset, into one new list. The first of the two is the
- * previous list of positions (oldPositions), from which any deleted positions get
- * removed on the fly. The second of two is the list of added positions. The result
- * is stored in newPositions.
- */
- List newPositions= new ArrayList(newSize);
- Position position= null;
- Position addedPosition= null;
- for (int i= 0, j= 0, n= oldPositions.size(), m= addedPositions.length; i < n || position != null || j < m || addedPosition != null;) {
- // loop variant: i + j < old(i + j)
-
- // a) find the next non-deleted Position from the old list
- while (position == null && i < n) {
- position= (Position) oldPositions.get(i++);
- if (position.isDeleted() || contain(removedPositionsList, position)) {
- document.removePosition(positionCategory, position);
- position= null;
- }
- }
-
- // b) find the next Position from the added list
- if (addedPosition == null && j < m) {
- addedPosition= addedPositions[j++];
- document.addPosition(positionCategory, addedPosition);
- }
-
- // c) merge: add the next of position/addedPosition with the lower offset
- if (position != null) {
- if (addedPosition != null)
- if (position.getOffset() <= addedPosition.getOffset()) {
- newPositions.add(position);
- position= null;
- } else {
- newPositions.add(addedPosition);
- addedPosition= null;
- }
- else {
- newPositions.add(position);
- position= null;
- }
- } else if (addedPosition != null) {
- newPositions.add(addedPosition);
- addedPosition= null;
- }
- }
- fPositions= newPositions;
- Collections.sort(fPositions, new Comparator() {
-
- public int compare(Object arg0, Object arg1) {
- Position p1 = (Position) arg0;
- Position p2 = (Position) arg1;
- return p1.offset - p2.offset;
- }
- });
- }
- } catch (BadPositionCategoryException e) {
- // Should not happen
- Logger.logException(e);
- } catch (BadLocationException e) {
- // Should not happen
- Logger.logException(e);
- }
-// checkOrdering("new positions: ", fPositions); //$NON-NLS-1$
-
- if (textPresentation != null)
- fSourceViewer.changeTextPresentation(textPresentation, false);
- else
- fSourceViewer.invalidateTextPresentation();
- }
-
-// private void checkOrdering(String s, List positions) {
-// Position previous= null;
-// for (int i= 0, n= positions.size(); i < n; i++) {
-// Position current= (Position) positions.get(i);
-// if (previous != null && previous.getOffset() + previous.getLength() > current.getOffset())
-// return;
-// }
-// }
-
- /**
- * Returns <code>true</code> iff the positions contain the position.
- * @param positions the positions, must be ordered by offset but may overlap
- * @param position the position
- * @return <code>true</code> iff the positions contain the position
- */
- private boolean contain(List positions, Position position) {
- return indexOf(positions, position) != -1;
- }
-
- /**
- * Returns index of the position in the positions, <code>-1</code> if not found.
- * @param positions the positions, must be ordered by offset but may overlap
- * @param position the position
- * @return the index
- */
- private int indexOf(List positions, Position position) {
- int index= computeIndexAtOffset(positions, position.getOffset());
- int size= positions.size();
- while (index < size) {
- if (positions.get(index) == position)
- return index;
- index++;
- }
- return -1;
- }
-
- /**
- * Insert the given position in <code>fPositions</code>, s.t. the offsets remain in linear order.
- *
- * @param position The position for insertion
- */
- private void insertPosition(Position position) {
- int i= computeIndexAfterOffset(fPositions, position.getOffset());
- fPositions.add(i, position);
- }
-
- /**
- * Returns the index of the first position with an offset greater than the given offset.
- *
- * @param positions the positions, must be ordered by offset and must not overlap
- * @param offset the offset
- * @return the index of the last position with an offset greater than the given offset
- */
- private int computeIndexAfterOffset(List positions, int offset) {
- int i= -1;
- int j= positions.size();
- while (j - i > 1) {
- int k= (i + j) >> 1;
- Position position= (Position) positions.get(k);
- if (position.getOffset() > offset)
- j= k;
- else
- i= k;
- }
- return j;
- }
-
- /**
- * Returns the index of the first position with an offset equal or greater than the given offset.
- *
- * @param positions the positions, must be ordered by offset and must not overlap
- * @param offset the offset
- * @return the index of the last position with an offset equal or greater than the given offset
- */
- private int computeIndexAtOffset(List positions, int offset) {
- int i= -1;
- int j= positions.size();
- while (j - i > 1) {
- int k= (i + j) >> 1;
- Position position= (Position) positions.get(k);
- if (position.getOffset() >= offset)
- j= k;
- else
- i= k;
- }
- return j;
- }
-
- /*
- * @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
- */
- public void applyTextPresentation(TextPresentation textPresentation) {
- IRegion region= textPresentation.getExtent();
- int minStart= Integer.MAX_VALUE;
- int maxEnd= Integer.MIN_VALUE;
- int i= computeIndexAtOffset(fPositions, region.getOffset()), n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
- if (n - i > 2) {
- List ranges= new ArrayList(n - i);
- for (; i < n; i++) {
- HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
- if (!position.isDeleted()) {
- if (!position.isReadOnly())
- ranges.add(position.createStyleRange());
- else {
- int offset= position.getOffset();
- minStart= Math.min(minStart, offset);
- maxEnd= Math.max(maxEnd, offset + position.getLength());
- }
-
- }
- }
- StyleRange[] array= new StyleRange[ranges.size()];
- array= (StyleRange[]) ranges.toArray(array);
- textPresentation.replaceStyleRanges(array);
- } else {
- for (; i < n; i++) {
- HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
- if (!position.isDeleted()) {
- if (!position.isReadOnly())
- textPresentation.replaceStyleRange(position.createStyleRange());
- else {
- int offset= position.getOffset();
- minStart= Math.min(minStart, offset);
- maxEnd= Math.max(maxEnd, offset + position.getLength());
- }
- }
- }
- }
- if (minStart < maxEnd) {
- IStructuredDocument document = (IStructuredDocument) fSourceViewer.getDocument();
- if (document.containsReadOnly(minStart, maxEnd)) {
- Iterator nonDefaultStyleRangeIterator = textPresentation.getNonDefaultStyleRangeIterator();
- while (nonDefaultStyleRangeIterator.hasNext()) {
- StyleRange styleRange = (StyleRange) nonDefaultStyleRangeIterator.next();
- if (document.containsReadOnly(styleRange.start, styleRange.length)) {
- adjustForeground(styleRange);
- }
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- setCanceled(true);
- releaseDocument(oldInput);
- resetState();
- }
-
- /*
- * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
- */
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- manageDocument(newInput);
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- setCanceled(true);
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- }
-
- /**
- * @return Returns <code>true</code> iff the current reconcile is canceled.
- * <p>
- * NOTE: Also called from background thread.
- * </p>
- */
- public boolean isCanceled() {
- IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null;
- if (document == null)
- return fIsCanceled;
-
- synchronized (getLockObject(document)) {
- return fIsCanceled;
- }
- }
-
- /**
- * Set whether or not the current reconcile is canceled.
- *
- * @param isCanceled <code>true</code> iff the current reconcile is canceled
- */
- public void setCanceled(boolean isCanceled) {
- IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null;
- if (document == null) {
- fIsCanceled= isCanceled;
- return;
- }
-
- synchronized (getLockObject(document)) {
- fIsCanceled= isCanceled;
- }
- }
-
- /**
- * @param document the document
- * @return the document's lock object
- */
- private Object getLockObject(IDocument document) {
- if (document instanceof ISynchronizable) {
- Object lock= ((ISynchronizable)document).getLockObject();
- if (lock != null)
- return lock;
- }
- return document;
- }
-
- /**
- * Install this presenter on the given source viewer and background presentation
- * reconciler.
- *
- * @param sourceViewer the source viewer
- * @param backgroundPresentationReconciler the background presentation reconciler,
- * can be <code>null</code>, in that case {@link SemanticHighlightingPresenter#createPresentation(List, List)}
- * should not be called
- */
- public void install(ISourceViewer sourceViewer, StructuredPresentationReconciler backgroundPresentationReconciler) {
- fSourceViewer= sourceViewer;
- fPresentationReconciler= backgroundPresentationReconciler;
-
- if (fSourceViewer instanceof StructuredTextViewer)
- ((StructuredTextViewer) fSourceViewer).prependTextPresentationListener(this);
- else if(fSourceViewer instanceof ITextViewerExtension4)
- ((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(this);
-
- fSourceViewer.addTextInputListener(this);
- manageDocument(fSourceViewer.getDocument());
- }
-
- /**
- * Uninstall this presenter.
- */
- public void uninstall() {
- setCanceled(true);
-
- if (fSourceViewer != null) {
- if (fSourceViewer instanceof ITextViewerExtension4)
- ((ITextViewerExtension4) fSourceViewer).addTextPresentationListener(this);
- releaseDocument(fSourceViewer.getDocument());
- invalidateTextPresentation();
- resetState();
-
- fSourceViewer.removeTextInputListener(this);
- fSourceViewer= null;
- }
- }
-
- /**
- * Invalidate text presentation of positions with the given highlighting.
- *
- * @param highlighting The highlighting
- */
- public void highlightingStyleChanged(HighlightingStyle highlighting) {
- for (int i= 0, n= fPositions.size(); i < n; i++) {
- HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
- if (position.getHighlighting() == highlighting && fSourceViewer instanceof ITextViewerExtension2)
- ((ITextViewerExtension2) fSourceViewer).invalidateTextPresentation(position.getOffset(), position.getLength());
- else
- fSourceViewer.invalidateTextPresentation();
- }
- }
-
- /**
- * Invalidate text presentation of all positions.
- */
- private void invalidateTextPresentation() {
- if (fSourceViewer instanceof ITextViewerExtension2) {
- for (int i = 0, n = fPositions.size(); i < n; i++) {
- Position position = (Position) fPositions.get(i);
- ((ITextViewerExtension2) fSourceViewer).invalidateTextPresentation(position.getOffset(), position.getLength());
- }
- }
- else {
- fSourceViewer.invalidateTextPresentation();
- }
- }
-
- /**
- * Add a position with the given range and highlighting unconditionally, only from UI thread.
- * The position will also be registered on the document. The text presentation is not invalidated.
- *
- * @param uiPosition the highlighted position to add from the UI
- */
- private void addPositionFromUI(HighlightedPosition uiPosition) {
- Position position= createHighlightedPosition(uiPosition, uiPosition.getHighlighting(), uiPosition.isReadOnly());
- synchronized (fPositionLock) {
- insertPosition(position);
- }
-
- IDocument document= fSourceViewer.getDocument();
- if (document == null)
- return;
- String positionCategory= getPositionCategory();
- try {
- document.addPosition(positionCategory, position);
- } catch (BadLocationException e) {
- // Should not happen
- Logger.logException(e);
- } catch (BadPositionCategoryException e) {
- // Should not happen
- Logger.logException(e);
- }
- }
-
- /**
- * Reset to initial state.
- */
- private void resetState() {
- synchronized (fPositionLock) {
- fPositions.clear();
- }
- }
-
- /**
- * Start managing the given document.
- *
- * @param document The document
- */
- private void manageDocument(IDocument document) {
- if (document != null) {
- document.addPositionCategory(getPositionCategory());
- document.addPositionUpdater(fPositionUpdater);
- document.addDocumentListener(this);
- }
- }
-
- /**
- * Stop managing the given document.
- *
- * @param document The document
- */
- private void releaseDocument(IDocument document) {
- if (document != null) {
- document.removeDocumentListener(this);
- document.removePositionUpdater(fPositionUpdater);
- try {
- document.removePositionCategory(getPositionCategory());
- } catch (BadPositionCategoryException e) {
- // Should not happen
- Logger.logException(e);
- }
- }
- }
-
- /**
- * @return The semantic reconciler position's category.
- */
- private String getPositionCategory() {
- return toString();
- }
-
- private void adjustForeground(StyleRange styleRange) {
- RGB oldRGB = null;
- // Color oldColor = styleRange.foreground;
- Color oldColor = styleRange.background;
- if (oldColor == null) {
- // oldRGB = getTextWidget().getForeground().getRGB();
- oldColor = fSourceViewer.getTextWidget().getBackground();
- oldRGB = oldColor.getRGB();
- }
- else {
- oldRGB = oldColor.getRGB();
- }
- Color newColor = getCachedColorFor(oldRGB);
- if (newColor == null) {
- // make text "closer to" background lumanence
- double target = getRGBConverter().calculateYComponent(oldColor);
- RGB newRGB = getRGBConverter().transformRGBToGrey(oldRGB, readOnlyForegroundScaleFactor / 100.0, target);
-
- // save conversion, so calculations only need to be done once
- cacheColor(oldRGB, newRGB);
- newColor = getCachedColorFor(oldRGB);
- }
- styleRange.foreground = newColor;
- }
-
- private YUV_RGBConverter getRGBConverter() {
- if (rgbConverter == null) {
- rgbConverter = new YUV_RGBConverter();
- }
- return rgbConverter;
- }
-
- /**
- * Cache read-only color.
- *
- * @param oldRGB
- * @param newColor
- */
- private void cacheColor(RGB oldRGB, RGB newColor) {
- if (readOnlyColorTable == null) {
- readOnlyColorTable = new HashMap();
- }
- readOnlyColorTable.put(oldRGB, newColor);
- }
-
- /**
- * This method is just to get existing read-only colors.
- */
- private Color getCachedColorFor(RGB oldRGB) {
- Color result = null;
-
- if (readOnlyColorTable != null) {
- RGB readOnlyRGB = (RGB) readOnlyColorTable.get(oldRGB);
- result = EditorUtility.getColor(readOnlyRGB);
- }
-
- return result;
- }
-
- /**
- * A utility class to do various color manipulations
- */
- private class YUV_RGBConverter {
- /**
- * This class "holds" the YUV values corresponding to RGB color
- */
- private class YUV {
-
- class NormalizedRGB {
- double blue;
- double green;
- private final double maxRGB = 256.0;
- double red;
-
- public NormalizedRGB(RGB rgb) {
- // first normalize to between 0 - 1
- red = rgb.red / maxRGB;
- green = rgb.green / maxRGB;
- blue = rgb.blue / maxRGB;
-
- red = gammaNormalized(red);
- green = gammaNormalized(green);
- blue = gammaNormalized(blue);
-
- }
- }
-
- private NormalizedRGB normalizedRGB;
-
- private double u = -1;
- private double v = -1;
- private double y = -1;
-
- private YUV() {
- super();
- }
-
- public YUV(RGB rgb) {
- this();
- normalizedRGB = new NormalizedRGB(rgb);
- // force calculations
- getY();
- getV();
- getU();
- }
-
- /**
- * normalize to "average" gamma 2.2222 or 1/0.45
- */
- double gammaNormalized(double colorComponent) {
- if (colorComponent < 0.018) {
- return colorComponent * 0.45;
- }
- else {
- return 1.099 * Math.pow(colorComponent, 0.45) - 0.099;
- }
- }
-
- /**
- * @return RGB based on original RGB and current YUV values;
- */
-
- public double getU() {
- if (u == -1) {
- u = 0.4949 * (normalizedRGB.blue - getY());
- }
- return u;
-
- }
-
- public double getV() {
- if (v == -1) {
- v = 0.877 * (normalizedRGB.red - getY());
- }
- return v;
- }
-
- public double getY() {
- if (y == -1) {
- y = 0.299 * normalizedRGB.red + 0.587 * normalizedRGB.green + 0.114 * normalizedRGB.blue;
- }
- return y;
- }
-
- }
-
- public YUV_RGBConverter() {
- super();
- }
-
- public double calculateYComponent(Color targetColor) {
- return new YUV(targetColor.getRGB()).getY();
- }
-
- public RGB transformRGBToGrey(RGB originalRGB, double scaleFactor, double target) {
- RGB transformedRGB = null;
- // we left the "full" API method signature, but this
- // version does not take into account originalRGB, though
- // it might someday.
- // for now, we'll simply make the new RGB grey, either a little
- // lighter, or a little darker than background.
- double y = 0;
- double mid = 0.5;
- // zero is black, one is white
- if (target < mid) {
- // is "dark" make lighter
- y = target + scaleFactor;
- }
- else {
- // is "light" make darker
- y = target - scaleFactor;
- }
- int c = (int) Math.round(y * 255);
- // just to gaurd against mis-use, or scale's values greater
- // than mid point (and possibly rounding error)
- if (c > 255)
- c = 255;
- if (c < 0)
- c = 0;
- transformedRGB = new RGB(c, c, c);
- return transformedRGB;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java
deleted file mode 100644
index 8318c97b90..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.style;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
-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.sse.ui.ISemanticHighlighting;
-import org.eclipse.wst.sse.ui.ISemanticHighlightingExtension;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition;
-import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightingStyle;
-
-/**
- * Semantic highlighting reconciler for Structured Source Editors. Based on
- * org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler
- *
- * @since 3.1
- */
-public class SemanticHighlightingReconciler implements IReconcilingStrategy, IReconcilingStrategyExtension {
-
- private IDocument fDocument;
-
- private ITextViewer fViewer;
- private SemanticHighlightingPresenter fPresenter;
- private ISemanticHighlighting[] fSemanticHighlightings;
- private HighlightingStyle[] fHighlightings;
-
- private List fAddedPositions = new ArrayList();
- private List fRemovedPositions = new ArrayList();
- /** Number of removed positions */
- private int fNOfRemovedPositions;
-
- /** Background job */
- private Job fJob;
- /** Background job lock */
- private final Object fJobLock = new Object();
-
- /** Reconcile operation lock. */
- private final Object fReconcileLock = new Object();
- private boolean fIsReconciling = false;
- /** The semantic highlighting presenter - cache for background thread, only valid during {@link #reconcile(IRegion)} */
- private SemanticHighlightingPresenter fJobPresenter;
- /** Semantic highlightings - cache for background thread, only valid during {@link #reconcile(IRegion)} */
- private ISemanticHighlighting[] fJobSemanticHighlightings;
- /** HighlightingStyle - cache for background thread, only valid during {@link #reconcile(IRegion)} */
- private HighlightingStyle[] fJobHighlightings;
-
- private boolean fIsInstalled;
-
- public void install(ITextViewer sourceViewer, SemanticHighlightingPresenter presenter, ISemanticHighlighting[] semanticHighlightings, HighlightingStyle[] highlightings) {
- fViewer = sourceViewer;
- fPresenter = presenter;
- fSemanticHighlightings = semanticHighlightings;
- fHighlightings = highlightings;
- fIsInstalled = true;
- }
-
- public void uninstall() {
- fIsInstalled = false;
- fViewer = null;
- fPresenter = null;
- fSemanticHighlightings = null;
- fHighlightings = null;
- }
-
- public void reconcile(IRegion partition) {
- // ensure at most one thread can be reconciling at any time
- synchronized (fReconcileLock) {
- if (fIsReconciling)
- return;
- else
- fIsReconciling= true;
- }
- fJobPresenter = fPresenter;
- fJobSemanticHighlightings = fSemanticHighlightings;
- fJobHighlightings = fHighlightings;
- IStructuredModel model = null;
- try {
- if (fJobPresenter == null || fJobSemanticHighlightings == null || fJobHighlightings == null || fDocument == null)
- return;
-
- fJobPresenter.setCanceled(false);
-
- startReconcilingPositions();
- IStructuredDocument document = (IStructuredDocument) fDocument;
- model = ModelManagerImpl.getInstance().getModelForRead(document);
- IStructuredDocumentRegion[] regions = document.getStructuredDocumentRegions(partition.getOffset(), partition.getLength());
- for (int i = 0; i < regions.length && fIsInstalled; i++) {
- if (document.containsReadOnly(regions[i].getStartOffset(), regions[i].getLength()))
- addPosition(new Position(regions[i].getStartOffset(), regions[i].getLength()), null, true);
- else {
- for (int j = 0; j < fJobSemanticHighlightings.length && fIsInstalled; j++) {
- if (fJobHighlightings[j].isEnabled()) {
- Position[] consumes = null;
- if (fJobSemanticHighlightings[j] instanceof ISemanticHighlightingExtension && model != null) {
- consumes = ((ISemanticHighlightingExtension) fJobSemanticHighlightings[j]).consumes(regions[i], model.getIndexedRegion(regions[i].getStartOffset()));
- }
- else {
- consumes = fJobSemanticHighlightings[j].consumes(regions[i]);
- }
- if (consumes != null) {
- for (int k = 0; k < consumes.length; k++)
- addPosition(consumes[k], fJobHighlightings[j]);
- }
- }
- }
- }
- }
-
- if (fIsInstalled) {
- List oldPositions = fRemovedPositions;
- List newPositions = new ArrayList(fNOfRemovedPositions);
- for (int i = 0, n = oldPositions.size(); i < n && fIsInstalled; i++) {
- Object current = oldPositions.get(i);
- if (current != null)
- newPositions.add(current);
- }
- fRemovedPositions = newPositions;
-
- TextPresentation presentation = null;
- if (!fJobPresenter.isCanceled())
- presentation = fJobPresenter.createPresentation(fAddedPositions, fRemovedPositions);
- if (!fJobPresenter.isCanceled())
- updatePresentation(presentation, fAddedPositions, fRemovedPositions);
- }
- stopReconcilingPositions();
- }
- finally {
- fJobPresenter= null;
- fJobSemanticHighlightings= null;
- fJobHighlightings= null;
- if (model != null)
- model.releaseFromRead();
- synchronized (fReconcileLock) {
- fIsReconciling= false;
- }
- }
- }
-
- private void addPosition(Position position, HighlightingStyle highlighting) {
- addPosition(position, highlighting, false);
- }
-
- private void addPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
- boolean isExisting = false;
- // TODO: use binary search
- for (int i = 0, n = fRemovedPositions.size(); i < n; i++) {
- HighlightedPosition highlightedPosition = (HighlightedPosition) fRemovedPositions.get(i);
- if (highlightedPosition == null)
- continue;
- if (highlightedPosition.isEqual(position, highlighting)) {
- isExisting = true;
- fRemovedPositions.set(i, null);
- fNOfRemovedPositions--;
- break;
- }
- }
- if (!isExisting) {
- fAddedPositions.add(fJobPresenter.createHighlightedPosition(position, highlighting, isReadOnly));
- }
- }
-
- /**
- * Update the presentation.
- *
- * @param textPresentation
- * the text presentation
- * @param addedPositions
- * the added positions
- * @param removedPositions
- * the removed positions
- */
- private void updatePresentation(TextPresentation textPresentation, List addedPositions, List removedPositions) {
- Runnable runnable = fJobPresenter.createUpdateRunnable(textPresentation, addedPositions, removedPositions);
- if (runnable == null)
- return;
-
- if (fViewer == null)
- return;
-
- Control viewerControl = fViewer.getTextWidget();
- if (viewerControl == null)
- return;
-
- Display display = viewerControl.getDisplay();
- if (display == null || display.isDisposed())
- return;
-
- display.asyncExec(runnable);
- }
-
- /**
- * Start reconciling positions.
- */
- private void startReconcilingPositions() {
- fJobPresenter.addAllPositions(fRemovedPositions);
- fNOfRemovedPositions = fRemovedPositions.size();
- }
-
- /**
- * Stop reconciling positions.
- */
- private void stopReconcilingPositions() {
- fRemovedPositions.clear();
- fNOfRemovedPositions = 0;
- fAddedPositions.clear();
- }
-
- public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
- reconcile(dirtyRegion);
- }
-
- public void setDocument(IDocument document) {
- fDocument = document;
-// refresh();
- }
-
- public void initialReconcile() {
- // Do nothing
- }
-
- public void setProgressMonitor(IProgressMonitor monitor) {
- }
-
- /**
- * Schedule a background job for reconciling the Semantic Highlighting model.
- */
- private void scheduleJob() {
- synchronized (fJobLock) {
- final Job oldJob= fJob;
- if (fJob != null) {
- fJob.cancel();
- fJob= null;
- }
-
- fJob= new Job("Semantic Highlighting Job") {
- protected IStatus run(IProgressMonitor monitor) {
- if (oldJob != null) {
- try {
- oldJob.join();
- } catch (InterruptedException e) {
- Logger.logException(e);
- return Status.CANCEL_STATUS;
- }
- }
- if (monitor.isCanceled())
- return Status.CANCEL_STATUS;
-
- reconcile(new Region(0, fDocument.getLength()));
- synchronized (fJobLock) {
- // allow the job to be gc'ed
- if (fJob == this)
- fJob= null;
- }
- return Status.OK_STATUS;
- }
- };
- fJob.setSystem(true);
- fJob.setPriority(Job.DECORATE);
- fJob.schedule();
- }
- }
-
- public void refresh() {
- if (fDocument != null)
- scheduleJob();
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java
deleted file mode 100644
index 6f330615f0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java
+++ /dev/null
@@ -1,44 +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.wst.sse.ui.internal.taginfo;
-
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-
-/**
- * Abstract class for providing hover information for Source editor. Includes
- * a hover control creator which has the "Press F2 for focus" message built
- * in.
- *
- * @since WTP 1.5
- */
-abstract public class AbstractHoverProcessor implements ITextHover, ITextHoverExtension {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator()
- */
- public IInformationControlCreator getHoverControlCreator() {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true), EditorsUI.getTooltipAffordanceString());
- }
- };
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
deleted file mode 100644
index 39082c923a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.taginfo;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Hover help that displays annotations shown in text of editor. Currently,
- * this text hover is used in conjunction with AbstractTextHoverProcessor.
- *
- * @author amywu
- */
-public class AnnotationHoverProcessor extends AbstractHoverProcessor {
- private final static String LIST_BEGIN = "<ul>"; //$NON-NLS-1$
- private final static String LIST_ELEMENT = "<li>"; //$NON-NLS-1$
- private final static String PARAGRAPH_END = "</p>"; //$NON-NLS-1$
- private final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
-
- private IPreferenceStore fPreferenceStore = null;
-
- /**
- *
- */
- public AnnotationHoverProcessor() {
- super();
- }
-
- /**
- * Formats a msg to a proper html message
- *
- * @param msg -
- * assumes msg is neither null nor empty string
- * @return
- */
- private String formatMessage(String msg) {
- StringBuffer buf = new StringBuffer();
- buf.append(PARAGRAPH_START);
- buf.append(StringUtils.convertToHTMLContent(msg));
- buf.append(PARAGRAPH_END);
- return buf.toString();
- }
-
- /**
- * Formats multiple messages into proper html message
- *
- * @param messages
- * @return
- */
- private String formatMessages(List messages) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(PARAGRAPH_START);
- buffer.append(SSEUIMessages.Multiple_errors); //$NON-NLS-1$
- buffer.append(LIST_BEGIN);
-
- Iterator e = messages.iterator();
- while (e.hasNext()) {
- buffer.append(LIST_ELEMENT);
- buffer.append(StringUtils.convertToHTMLContent((String) e.next()));
- }
- buffer.append(PARAGRAPH_END);
- return buffer.toString();
- }
-
- /**
- * Returns the annotation preference for the given annotation. (copied
- * from org.eclipse.jdt.internal.ui.text.java.hover.AnnotationHover)
- *
- * @param annotation
- * the annotation
- * @return the annotation preference or <code>null</code> if none
- */
- private AnnotationPreference getAnnotationPreference(Annotation annotation) {
-
- if (annotation.isMarkedDeleted())
- return null;
- return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
- }
-
- public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
- IAnnotationModel model = ((SourceViewer) viewer).getAnnotationModel();
- if (model != null) {
- List messages = new ArrayList();
- Iterator e = model.getAnnotationIterator();
- while (e.hasNext()) {
- Annotation a = (Annotation) e.next();
- if (!isAnnotationValid(a))
- continue;
-
- Position p = model.getPosition(a);
- // check if this is an annotation in the region we are
- // concerned with
- if (p.overlapsWith(hoverRegion.getOffset(), hoverRegion.getLength())) {
- String msg = a.getText();
- if ((msg != null) && msg.trim().length() > 0) {
- // it is possible for temporary annotations to
- // duplicate other annotations so make sure not to add
- // dups
- if (a instanceof ITemporaryAnnotation) {
- boolean duplicated = false;
- int j = 0;
- while (j < messages.size() && !duplicated) {
- duplicated = messages.get(j).equals(msg);
- ++j;
- }
- if (!duplicated) {
- messages.add(msg);
- }
- }
- else {
- messages.add(msg);
- }
- }
- }
- }
- if (messages.size() > 1) {
- return formatMessages(messages);
- }
- else if (messages.size() > 0) {
- return formatMessage(messages.get(0).toString());
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
- IAnnotationModel model = ((SourceViewer) textViewer).getAnnotationModel();
- Region hoverRegion = null;
-
- if (model != null) {
- Iterator e = model.getAnnotationIterator();
- while (e.hasNext()) {
- Annotation a = (Annotation) e.next();
- if (!isAnnotationValid(a))
- continue;
- Position p = model.getPosition(a);
- if (p != null && p.includes(offset)) {
- // find the smallest region containing offset
- if ((hoverRegion == null) || (hoverRegion.getLength() > p.getLength())) {
- hoverRegion = new Region(p.getOffset(), p.getLength());
- }
- }
- }
- }
- return hoverRegion;
- }
-
- /**
- * Retreives the preference store If no preference store is currently
- * stored, retreive the appropriate preference store
- */
- private IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null) {
- IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
- IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
- fPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
- }
- return fPreferenceStore;
- }
-
- boolean isAnnotationValid(Annotation a) {
- AnnotationPreference preference = getAnnotationPreference(a);
- if (preference == null)
- return false;
- String textPreferenceKey = preference.getTextPreferenceKey();
- String highlightPreferenceKey = preference.getHighlightPreferenceKey();
- if (textPreferenceKey == null || !(getPreferenceStore().getBoolean(textPreferenceKey)) || highlightPreferenceKey == null || getPreferenceStore().getBoolean(highlightPreferenceKey))
- return false;
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
deleted file mode 100644
index d105f91e7e..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.taginfo;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextHoverExtension;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * Provides the best hover help documentation (by using other hover help
- * processors) Priority of hover help processors is: ProblemHoverProcessor,
- * TagInfoProcessor, AnnotationHoverProcessor
- */
-public class BestMatchHover implements ITextHover, ITextHoverExtension {
- /** Current best match text hover */
- private ITextHover fBestMatchHover;
- /**
- * Documentation / Information hovers
- */
- private ITextHover[] fTagInfoHovers;
- /** List of text hovers to consider in best match */
- private List fTextHovers;
- /**
- * Partition type for which to create text hovers (when deferred for
- * performance)
- */
- private String fPartitionType;
-
- public BestMatchHover(ITextHover infoTagHover) {
- this(new ITextHover[]{infoTagHover});
- }
-
- public BestMatchHover(ITextHover[] infoTagHovers) {
- fTagInfoHovers = infoTagHovers;
- }
-
- public BestMatchHover(String partitionType) {
- fPartitionType = partitionType;
- }
-
- /**
- * Create a list of text hovers applicable to this best match hover
- * processor
- *
- * @return List of ITextHover - in abstract class this is empty list
- */
- private List createTextHoversList() {
- List hoverList = new ArrayList();
- // if currently debugging, then add the debug hover to the list of
- // best match
- if (Logger.isTracing(DebugInfoHoverProcessor.TRACEFILTER)) {
- hoverList.add(new DebugInfoHoverProcessor());
- }
-
- hoverList.add(new ProblemAnnotationHoverProcessor());
-
- if (fPartitionType != null && fTagInfoHovers == null) {
- List extendedTextHover = ExtendedConfigurationBuilder.getInstance().getConfigurations(ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER, fPartitionType);
- fTagInfoHovers = (ITextHover[]) extendedTextHover.toArray(new ITextHover[extendedTextHover.size()]);
- }
- if (fTagInfoHovers != null) {
- for (int i = 0; i < fTagInfoHovers.length; i++) {
- hoverList.add(fTagInfoHovers[i]);
- }
- }
- hoverList.add(new AnnotationHoverProcessor());
- return hoverList;
- }
-
- public IInformationControlCreator getHoverControlCreator() {
- IInformationControlCreator creator = null;
-
- if (fBestMatchHover instanceof ITextHoverExtension) {
- creator = ((ITextHoverExtension) fBestMatchHover).getHoverControlCreator();
- }
- return creator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
- String displayText = null;
-
- // already have a best match hover picked out from getHoverRegion call
- if (fBestMatchHover != null) {
- displayText = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
- }
- // either had no best match hover or best match hover returned null
- if (displayText == null) {
- // go through list of text hovers and return first display string
- Iterator i = getTextHovers().iterator();
- while ((i.hasNext()) && (displayText == null)) {
- ITextHover hover = (ITextHover) i.next();
- displayText = hover.getHoverInfo(viewer, hoverRegion);
- }
- }
- return displayText;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getHoverRegion(ITextViewer viewer, int offset) {
- IRegion hoverRegion = null;
-
- // go through list of text hovers and return first hover region
- ITextHover hover = null;
- Iterator i = getTextHovers().iterator();
- while ((i.hasNext()) && (hoverRegion == null)) {
- hover = (ITextHover) i.next();
- hoverRegion = hover.getHoverRegion(viewer, offset);
- }
-
- // store the text hover processor that found region
- if (hoverRegion != null)
- fBestMatchHover = hover;
- else
- fBestMatchHover = null;
-
- return hoverRegion;
- }
-
- private List getTextHovers() {
- if (fTextHovers == null) {
- fTextHovers = createTextHoversList();
- }
- return fTextHovers;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
deleted file mode 100644
index ea9db05d4b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
+++ /dev/null
@@ -1,94 +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.sse.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-
-/**
- * Provides debug hover help
- *
- * @see org.eclipse.jface.text.ITextHover
- */
-public class DebugInfoHoverProcessor extends AbstractHoverProcessor {
- public static final String TRACEFILTER = "debuginfohover"; //$NON-NLS-1$
- protected IPreferenceStore fPreferenceStore = null;
-
- public DebugInfoHoverProcessor() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
- String displayText = null;
- if ((hoverRegion == null) || (viewer == null) || (viewer.getDocument() == null)) {
- displayText = null;
- }
- else {
- int offset = hoverRegion.getOffset();
-
- ITypedRegion region;
- try {
- region = viewer.getDocument().getPartition(offset);
- if (region != null) {
- displayText = region.getType();
- }
- else {
- displayText = "Null Region was returned?!"; //$NON-NLS-1$
- }
- }
- catch (BadLocationException e) {
- displayText = "BadLocationException Occurred!?"; //$NON-NLS-1$
- }
-
- }
- return displayText;
- }
-
- /**
- * Returns the region to hover the text over based on the offset.
- *
- * @param textViewer
- * @param offset
- *
- * @return IRegion region to hover over if offset is not over invalid
- * whitespace. otherwise, returns <code>null</code>
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(ITextViewer, int)
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
- ITypedRegion region = null;
- if ((textViewer == null) || (textViewer.getDocument() == null)) {
- region = null;
- }
- else {
-
- try {
- region = textViewer.getDocument().getPartition(offset);
- }
- catch (BadLocationException e) {
- region = null;
- }
- }
- return region;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java
deleted file mode 100644
index d601231ef8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.taginfo;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
-
-/**
- * Hover help that displays problem annotations when shown in text of editor.
- *
- * @author amywu
- */
-public class ProblemAnnotationHoverProcessor extends AnnotationHoverProcessor {
-
- // these strings are derived from the annotationTypes extension in
- // org.eclipse.ui.editors plugin
- // if those strings change, then these strings need to change as well
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198584
- final private String ANNOTATION_ERROR = "org.eclipse.ui.workbench.texteditor.error"; //$NON-NLS-1$
- final private String ANNOTATION_WARNING = "org.eclipse.ui.workbench.texteditor.warning"; //$NON-NLS-1$
- private DefaultMarkerAnnotationAccess fAnnotationAccess = new DefaultMarkerAnnotationAccess();
-
- /**
- *
- */
- public ProblemAnnotationHoverProcessor() {
- super();
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor#isAnnotationValid(org.eclipse.jface.text.source.Annotation)
- */
- protected boolean isAnnotationValid(Annotation a) {
- String type = a.getType();
- if (fAnnotationAccess.isSubtype(type, ANNOTATION_ERROR) || fAnnotationAccess.isSubtype(type, ANNOTATION_WARNING))
- return super.isAnnotationValid(a);
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java
deleted file mode 100644
index 428b1a0209..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java
+++ /dev/null
@@ -1,243 +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.sse.ui.internal.taginfo;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Manages text hovers for Structured Text editors
- */
-public class TextHoverManager {
- /**
- * Contains description of a text hover
- */
- public class TextHoverDescriptor {
- private String fDescription;
- private boolean fEnabled;
- private String fId;
- private String fLabel;
- private String fModifierString;
-
- /**
- * @param id
- * @param label
- * @param desc
- */
- public TextHoverDescriptor(String id, String label, String desc) {
- fId = id;
- fLabel = label;
- fDescription = desc;
- }
-
- /**
- * @param id
- * @param label
- * @param desc
- * @param enabled
- * @param modifierString
- */
- public TextHoverDescriptor(String id, String label, String desc, boolean enabled, String modifierString) {
- fId = id;
- fLabel = label;
- fDescription = desc;
- fEnabled = enabled;
- fModifierString = modifierString;
- }
-
- /**
- * @return Returns the fDescription.
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * @return Returns the fId.
- */
- public String getId() {
- return fId;
- }
-
- /**
- * @return Returns the fLabel
- */
- public String getLabel() {
- return fLabel;
- }
-
- /**
- * @return Returns the fModifierString.
- */
- public String getModifierString() {
- return fModifierString;
- }
-
- /**
- * @return Returns the fEnabled.
- */
- public boolean isEnabled() {
- return fEnabled;
- }
-
- /**
- * @param enabled
- * The fEnabled to set.
- */
- public void setEnabled(boolean enabled) {
- fEnabled = enabled;
- }
-
- /**
- * @param modifierString
- * The fModifierString to set.
- */
- public void setModifierString(String modifierString) {
- fModifierString = modifierString;
- }
- }
-
- public static final String ANNOTATION_HOVER = "annotationHover"; //$NON-NLS-1$
-
- // list of different types of Source editor hovers
- public static final String COMBINATION_HOVER = "combinationHover"; //$NON-NLS-1$
- // hover descriptions are in .properties file with the key in the form of
- // "[id]_desc"
- private static final String DESCRIPTION_KEY = "_desc"; //$NON-NLS-1$
- public static final String DOCUMENTATION_HOVER = "documentationHover"; //$NON-NLS-1$
- public static final String HOVER_ATTRIBUTE_SEPARATOR = "|"; //$NON-NLS-1$
- public static final String HOVER_SEPARATOR = ";"; //$NON-NLS-1$
-
- // hover labels are in .properties file with the key in the form of
- // "[id]_label"
- private static final String LABEL_KEY = "_label"; //$NON-NLS-1$
-
- public static final String NO_MODIFIER = "0"; //$NON-NLS-1$
- public static final String PROBLEM_HOVER = "problemHover"; //$NON-NLS-1$
- public static final String[] TEXT_HOVER_IDS = new String[]{COMBINATION_HOVER, PROBLEM_HOVER, DOCUMENTATION_HOVER, ANNOTATION_HOVER};
- /**
- * Current list of Structured Text editor text hovers
- */
- private TextHoverDescriptor[] fTextHovers;
-
- public TextHoverManager() {
- super();
- }
-
- /**
- * Create a best match hover with the give text hover as the documentation
- * hover
- *
- * @param infoHover
- * @return ITextHover
- * @deprecated as of WTP 3.0 M3
- */
- public ITextHover createBestMatchHover(ITextHover infoHover) {
- return new BestMatchHover(infoHover);
- }
-
- /**
- * Generate a list of text hover descriptors from the given delimited
- * string
- *
- * @param textHoverStrings
- * @return
- */
- public TextHoverDescriptor[] generateTextHoverDescriptors(String textHoverStrings) {
- StringTokenizer st = new StringTokenizer(textHoverStrings, HOVER_SEPARATOR);
-
- // read from preference and load id-descriptor mapping to a hash table
- HashMap idToModifier = new HashMap(st.countTokens());
- while (st.hasMoreTokens()) {
- String textHoverString = st.nextToken();
- StringTokenizer st2 = new StringTokenizer(textHoverString, HOVER_ATTRIBUTE_SEPARATOR);
- if (st2.countTokens() == 3) {
- String id = st2.nextToken();
- boolean enabled = Boolean.valueOf(st2.nextToken()).booleanValue();
- String modifierString = st2.nextToken();
- if (modifierString.equals(NO_MODIFIER))
- modifierString = ""; //$NON-NLS-1$
-
- String label = null;
- String description = null;
- try {
- label = SSEUIMessages.getResourceBundle().getString(id + LABEL_KEY);
- description = SSEUIMessages.getResourceBundle().getString(id + DESCRIPTION_KEY);
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- TextHoverDescriptor descriptor = new TextHoverDescriptor(id, label, description, enabled, modifierString);
- // should check to see if ids appear more than once
- idToModifier.put(id, descriptor);
- }
- }
-
- // go through all defined text hovers and match with their preference
- TextHoverDescriptor[] descriptors = new TextHoverDescriptor[TEXT_HOVER_IDS.length];
- for (int i = 0; i < TEXT_HOVER_IDS.length; i++) {
- TextHoverDescriptor desc = (TextHoverDescriptor) idToModifier.get(TEXT_HOVER_IDS[i]);
- if (desc != null) {
- descriptors[i] = desc;
- }
- else {
- String label = null;
- String description = null;
- try {
- label = SSEUIMessages.getResourceBundle().getString(TEXT_HOVER_IDS[i] + LABEL_KEY);
- description = SSEUIMessages.getResourceBundle().getString(TEXT_HOVER_IDS[i] + DESCRIPTION_KEY);
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- descriptors[i] = new TextHoverDescriptor(TEXT_HOVER_IDS[i], label, description);
- }
- }
- return descriptors;
- }
-
- private IPreferenceStore getPreferenceStore() {
- return SSEUIPlugin.getDefault().getPreferenceStore();
- }
-
-
- /**
- * Returns the text hovers for Structured Text editor. If fTextHover has
- * not been initialied, it will be initialized.
- *
- * @return Returns the fTextHovers.
- */
- public TextHoverDescriptor[] getTextHovers() {
- if (fTextHovers == null) {
- String textHoverStrings = getPreferenceStore().getString(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS);
- fTextHovers = generateTextHoverDescriptors(textHoverStrings);
- }
- return fTextHovers;
- }
-
- /**
- * Sets fTextHovers to null so that next time getTextHovers is called,
- * fTextHovers will be populated with the latest preferences.
- */
- public void resetTextHovers() {
- fTextHovers = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java
deleted file mode 100644
index 6cc018d5ec..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.text;
-
-import java.util.Arrays;
-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.Region;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-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;
-
-
-/**
- * Matches the start and ending characters of IStructuredDocumentRegions with
- * the given allowed types. Note that Eclipse R3M8 only paints single
- * character-wide matches and this isn't true pair matching behavior. See RFE
- * #56836 at https://bugs.eclipse.org/bugs/show_bug.cgi?id=56836.
- */
-public class DocumentRegionEdgeMatcher implements ICharacterPairMatcher {
-
- public static final String ID = "characterpairmatcher"; //$NON-NLS-1$
-
- protected int fAnchor;
-
- protected ICharacterPairMatcher fNextMatcher;
-
- protected List fRegionTypes;
-
- public DocumentRegionEdgeMatcher(String[] validContexts, ICharacterPairMatcher nextMatcher) {
- fRegionTypes = Arrays.asList(validContexts);
- fNextMatcher = nextMatcher;
- }
-
- /*
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- if (fNextMatcher != null)
- fNextMatcher.clear();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- if (fNextMatcher != null)
- fNextMatcher.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- if (fAnchor < 0 && fNextMatcher != null)
- return fNextMatcher.getAnchor();
- return fAnchor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument,
- * int)
- */
- public IRegion match(IDocument document, int offset) {
- if (offset < 0 || offset >= document.getLength())
- return null;
-
- IRegion match = null;
- if (!fRegionTypes.isEmpty() && document instanceof IStructuredDocument) {
- IStructuredDocumentRegion docRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(offset);
- if (docRegion != null) {
- // look at the previous document region first since its end ==
- // this one's start
- if (docRegion.getPrevious() != null && docRegion.getPrevious().getEndOffset() == offset && fRegionTypes.contains(docRegion.getPrevious().getType())) {
- fAnchor = ICharacterPairMatcher.RIGHT;
- match = new Region(docRegion.getPrevious().getStartOffset(), 1);
- }
- // check for offset in the last text region for a match to
- // document region start offset
- else if (fRegionTypes.contains(docRegion.getType()) && docRegion.getStartOffset(docRegion.getLastRegion()) <= offset && offset <= docRegion.getEndOffset(docRegion.getLastRegion())) {
- fAnchor = ICharacterPairMatcher.RIGHT;
- match = new Region(docRegion.getStartOffset(), 1);
- }
- // check for offset in the first text region for a match to
- // document region end offset
- else if (fRegionTypes.contains(docRegion.getType())) {
- if (docRegion.getStartOffset(docRegion.getFirstRegion()) <= offset && offset <= docRegion.getEndOffset(docRegion.getFirstRegion())) {
- fAnchor = ICharacterPairMatcher.LEFT;
- match = new Region(docRegion.getEndOffset() - 1, 1);
- }
- }
-
- if (match == null) {
- /* Now check the text region */
- ITextRegion currentTextRegion = docRegion.getRegionAtCharacterOffset(offset);
- if (currentTextRegion != null && currentTextRegion.getTextLength() > 1) {
- int offsetAtNearEdge = offset;
- if (offset == docRegion.getTextEndOffset(currentTextRegion)) {
- offsetAtNearEdge = offset-1;
- }
- else if (offset == docRegion.getStartOffset(currentTextRegion)+1) {
- offsetAtNearEdge = offset-1;
- }
-
- if (offsetAtNearEdge == docRegion.getStartOffset(currentTextRegion)) {
- int end = docRegion.getTextEndOffset(currentTextRegion);
- try {
- if (!Character.isWhitespace(document.getChar(offsetAtNearEdge)) && document.getChar(offsetAtNearEdge) == document.getChar(end - 1)) {
- fAnchor = ICharacterPairMatcher.LEFT;
- match = new Region(end - 1, 1);
- }
- }
- catch (BadLocationException e) {
- // nothing, not important enough
- }
- }
- else if (offsetAtNearEdge == docRegion.getTextEndOffset(currentTextRegion)-1) {
- int start = docRegion.getStartOffset(currentTextRegion);
- try {
- if (!Character.isWhitespace(document.getChar(offsetAtNearEdge)) && (document.getChar(offsetAtNearEdge) == document.getChar(start))) {
- fAnchor = ICharacterPairMatcher.RIGHT;
- match = new Region(start, 1);
- }
- }
- catch (BadLocationException e) {
- // nothing, not important enough
- }
- }
- }
- }
- }
- }
- if (match == null && fNextMatcher != null) {
- fAnchor = -1;
- match = fNextMatcher.match(document, offset);
- }
- return match;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java
deleted file mode 100644
index 0b7a4f9410..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.text;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class SourceInfoProvider implements IInformationProvider, IInformationProviderExtension {
-
- private ITextEditor fEditor;
-
- public SourceInfoProvider(ITextEditor editor) {
- fEditor = editor;
- }
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return getInformation2(textViewer, subject).toString();
- }
-
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- if (textViewer != null && fEditor != null) {
- IRegion region= WordFinder.findWord(textViewer.getDocument(), offset);
- if (region != null)
- return region;
- else
- return new Region(offset, 0);
- }
- return null;
- }
-
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- if (fEditor == null)
- return null;
-
- Object selection = fEditor.getSelectionProvider().getSelection();
- if (selection == null)
- selection = new Object();
- return selection;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java
deleted file mode 100644
index 4e708c59bf..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-
-public class WordFinder {
-
- /* Copied from org.eclipse.jdt.internal.ui.text.JavaWordFinder */
- public static IRegion findWord(IDocument document, int offset) {
-
- int start= -2;
- 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.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
deleted file mode 100644
index 22504ddb5b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
+++ /dev/null
@@ -1,1235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.sse.ui.internal.ui;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-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.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
-import org.eclipse.ui.texteditor.StatusLineContributionItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.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.ITextRegionCollection;
-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.internal.util.Utilities;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-import com.ibm.icu.text.NumberFormat;
-
-/**
- * @author nsd A Status Line contribution intended to display the selected
- * offsets in an editor. Double-clicking shows information about
- * partitions, document regions, annotations, and selection.
- */
-public class OffsetStatusLineContributionItem extends StatusLineContributionItem {
-
- class AnnotationPropertySource implements IPropertySource {
- Annotation fAnnotation = null;
- IPropertyDescriptor[] fDescriptors = null;
- String[] TEMPORARY_ANNOTATION_KEYS = new String[]{"Partition Type", "Step", "Scope", "Offset", "Length", "Description"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
- public AnnotationPropertySource(Annotation annotation) {
- super();
- fAnnotation = annotation;
- }
-
- public Object getEditableValue() {
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (fDescriptors == null) {
- try {
- if (fAnnotation instanceof SimpleMarkerAnnotation) {
- Map attrs = ((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes();
- Object[] keys = attrs.keySet().toArray();
-
- fDescriptors = new IPropertyDescriptor[keys.length];
- for (int i = 0; i < keys.length; i++) {
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
- fDescriptors[i] = descriptor;
- }
- }
- else if (fAnnotation instanceof TemporaryAnnotation) {
- Object key = ((TemporaryAnnotation) fAnnotation).getKey();
- if (key != null && key instanceof ReconcileAnnotationKey) {
- String[] keys = TEMPORARY_ANNOTATION_KEYS;
- fDescriptors = new IPropertyDescriptor[keys.length];
- for (int i = 0; i < keys.length; i++) {
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
- fDescriptors[i] = descriptor;
- }
- }
- }
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- }
- if (fDescriptors == null)
- fDescriptors = new IPropertyDescriptor[0];
- return fDescriptors;
- }
-
- public Object getPropertyValue(Object id) {
- String value = null;
- if (fAnnotation instanceof SimpleMarkerAnnotation) {
- Object o;
- try {
- o = ((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes().get(id);
- if (o != null) {
- value = o.toString();
- }
- }
- catch (CoreException e) {
- }
- }
- else if (fAnnotation instanceof TemporaryAnnotation) {
- if (TEMPORARY_ANNOTATION_KEYS[0].equals(id)) {
- Object key = ((TemporaryAnnotation) fAnnotation).getKey();
- if (key != null && key instanceof ReconcileAnnotationKey) {
- value = ((ReconcileAnnotationKey) key).getPartitionType();
- }
- }
- else if (TEMPORARY_ANNOTATION_KEYS[1].equals(id)) {
- Object key = ((TemporaryAnnotation) fAnnotation).getKey();
- if (key != null && key instanceof ReconcileAnnotationKey) {
- IReconcileStep step = ((ReconcileAnnotationKey) key).getStep();
- if (step != null) {
- value = step.toString();
- }
- }
- }
- else if (TEMPORARY_ANNOTATION_KEYS[2].equals(id)) {
- Object key = ((TemporaryAnnotation) fAnnotation).getKey();
- if (key != null && key instanceof ReconcileAnnotationKey) {
- int scope = ((ReconcileAnnotationKey) key).getScope();
- if (scope == ReconcileAnnotationKey.PARTIAL) {
- value = "PARTIAL"; //$NON-NLS-1$
- }
- if (scope == ReconcileAnnotationKey.TOTAL) {
- value = "TOTAL"; //$NON-NLS-1$
- }
- }
- }
- else if (TEMPORARY_ANNOTATION_KEYS[3].equals(id)) {
- IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
- Position p = annotationModel.getPosition(fAnnotation);
- if (p != null) {
- value = String.valueOf(p.getOffset());
- }
- }
- else if (TEMPORARY_ANNOTATION_KEYS[4].equals(id)) {
- IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
- Position p = annotationModel.getPosition(fAnnotation);
- if (p != null) {
- value = String.valueOf(p.getLength());
- }
- }
- else if (TEMPORARY_ANNOTATION_KEYS[5].equals(id)) {
- value = ((TemporaryAnnotation) fAnnotation).getDescription();
- }
- }
- return value;
- }
-
- public boolean isPropertySet(Object id) {
- return false;
- }
-
- public void resetPropertyValue(Object id) {
- try {
- if (fAnnotation instanceof SimpleMarkerAnnotation) {
- ((SimpleMarkerAnnotation) fAnnotation).getMarker().getAttributes().remove(id);
- }
- else if (fAnnotation instanceof TemporaryAnnotation) {
- }
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public void setPropertyValue(Object id, Object value) {
- try {
- if (fAnnotation instanceof SimpleMarkerAnnotation) {
- ((MarkerAnnotation) fAnnotation).getMarker().setAttribute(id.toString(), value);
- }
- else if (fAnnotation instanceof TemporaryAnnotation) {
- }
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- }
- }
-
- class InformationDialog extends Dialog {
-
- IDocument fDocument = fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
-
- public InformationDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- private void createAnnotationTabContents(Composite annotationsTabComposite) {
- annotationsTabComposite.setLayout(new GridLayout());
- annotationsTabComposite.setLayoutData(new GridData());
-
- final Composite annotationsComposite = new Composite(annotationsTabComposite, SWT.NONE);
- annotationsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- final TableViewer annotationsTable = new TableViewer(annotationsComposite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- annotationsTable.setComparator(new ViewerComparator(new Comparator() {
- public int compare(Object o1, Object o2) {
- Annotation annotation1 = (Annotation) o1;
- Annotation annotation2 = (Annotation) o2;
- String line1 = getLineNumber(annotation1);
- String line2 = getLineNumber(annotation2);
- return Integer.parseInt(line1) - Integer.parseInt(line2);
- }
- }));
- annotationsTable.setContentProvider(new ArrayContentProvider());
- annotationsTable.getTable().setHeaderVisible(true);
- annotationsTable.getTable().setLinesVisible(true);
- String[] columns = new String[]{"Line", "Owner", "Type", "Class", "Message"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- annotationsTable.setLabelProvider(new ITableLabelProvider() {
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- Annotation annotation = (Annotation) element;
- String text = null;
- switch (columnIndex) {
- case 0 :
- text = getLineNumber(annotation);
- break;
- case 1 :
- text = getOwner(annotation);
- break;
- case 2 :
- text = getType(annotation); //$NON-NLS-1$
- break;
- case 3 :
- text = annotation.getClass().getName();
- break;
- case 4 :
- text = annotation.getText();
- break;
- }
- if (text == null)
- text = ""; //$NON-NLS-1$
- return text;
- }
-
-
- private String getOwner(Annotation annotation) {
- String owner = null;
- if (annotation instanceof MarkerAnnotation) {
- owner = ((MarkerAnnotation) annotation).getMarker().getAttribute("owner", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- else if (annotation instanceof TemporaryAnnotation) {
- Object key = ((TemporaryAnnotation) annotation).getKey();
- if (key != null) {
- if (key instanceof ReconcileAnnotationKey) {
- key = key.getClass().getName();
- }
- if (key != null)
- owner = key.toString();
- }
- }
- return owner;
- }
-
- private String getType(Annotation annotation) {
- String type = null;
- if (annotation instanceof MarkerAnnotation) {
- type = "M:"+MarkerUtilities.getMarkerType(((MarkerAnnotation) annotation).getMarker()); //$NON-NLS-1$
- }
- else {
- type = "A:"+annotation.getType(); //$NON-NLS-1$
- }
- if (type == null)
- type = ""; //$NON-NLS-1$
- return type;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
- });
-
- TableLayout tlayout = new TableLayout();
- CellEditor[] cellEditors = new CellEditor[columns.length];
- int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7};
- for (int i = 0; i < columns.length; i++) {
- tlayout.addColumnData(new ColumnWeightData(1));
- TableColumn tc = new TableColumn(annotationsTable.getTable(), SWT.NONE);
- tc.setText(columns[i]);
- tc.setResizable(true);
- tc.setWidth(columnWidths[i]);
- }
- annotationsTable.setCellEditors(cellEditors);
- annotationsTable.setColumnProperties(columns);
- List matchingAnnotations = new ArrayList(0);
- if (fTextEditor != null) {
- IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
- if (annotationModel != null) {
- Iterator iterator = annotationModel.getAnnotationIterator();
- while (iterator.hasNext()) {
- Annotation element = (Annotation) iterator.next();
- if (true) {
- matchingAnnotations.add(element);
- }
- }
- }
- }
- annotationsTable.setSorter(new ViewerSorter());
- annotationsTable.setInput(matchingAnnotations);
-
- final Sash sash = new Sash(annotationsComposite, SWT.HORIZONTAL);
-
- final PropertySheetPage propertySheet = new PropertySheetPage();
- propertySheet.createControl(annotationsComposite);
- propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
- public IPropertySource getPropertySource(Object object) {
- if (object instanceof Annotation) {
- IPropertySource annotationPropertySource = new AnnotationPropertySource(((Annotation) object));
- return annotationPropertySource;
- }
- return null;
- }
- });
-
- annotationsTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- propertySheet.selectionChanged(null, event.getSelection());
- }
- });
-
- final FormLayout form = new FormLayout();
- annotationsComposite.setLayout(form);
-
- FormData tableData = new FormData();
- tableData.top = new FormAttachment(0, 0);
- tableData.bottom = new FormAttachment(sash, 2);
- tableData.left = new FormAttachment(0, 0);
- tableData.right = new FormAttachment(100, 0);
- annotationsTable.getControl().setLayoutData(tableData);
-
- FormData propertiesData = new FormData();
- propertiesData.top = new FormAttachment(sash, 2);
- propertiesData.left = new FormAttachment(0, 0);
- propertiesData.right = new FormAttachment(100, 0);
- propertiesData.bottom = new FormAttachment(100, 0);
- propertySheet.getControl().setLayoutData(propertiesData);
-
- final FormData sashData = new FormData();
- sashData.top = new FormAttachment(60, 0);
- sashData.left = new FormAttachment(0, 0);
- sashData.right = new FormAttachment(100, 0);
- sash.setLayoutData(sashData);
- sash.addListener(SWT.Selection, new org.eclipse.swt.widgets.Listener() {
- public void handleEvent(Event e) {
- sashData.top = new FormAttachment(0, e.y);
- annotationsComposite.layout();
- }
- });
- annotationsComposite.pack(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- ISelection selection = fTextEditor.getSelectionProvider().getSelection();
- ITextSelection textSelection = (ITextSelection) selection;
- IStructuredSelection structuredSelection = null;
- if (selection instanceof IStructuredSelection)
- structuredSelection = (IStructuredSelection) selection;
-
- parent.getShell().setText(SSEUIMessages.OffsetStatusLineContributionItem_0 + textSelection.getOffset() + "-" + (textSelection.getOffset() + textSelection.getLength())); //$NON-NLS-1$ //$NON-NLS-2$
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Text documentTypeLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- documentTypeLabel.setLayoutData(gd);
- documentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_6 + fDocument.getClass().getName()); //$NON-NLS-1$
-
- Text documentProviderLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- documentProviderLabel.setLayoutData(gd);
- documentProviderLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_7 + fTextEditor.getDocumentProvider().getClass().getName()); //$NON-NLS-1$
-
- Text editorInputLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- editorInputLabel.setLayoutData(gd);
- editorInputLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_12 + fTextEditor.getEditorInput().getClass().getName()); //$NON-NLS-1$
-
- final Text bomLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- bomLabel.setLayoutData(gd);
- bomLabel.setEnabled(false);
- bomLabel.setText("Byte Order Mark: ");
-
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model != null) {
- Text modelIdLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- modelIdLabel.setLayoutData(gd);
- modelIdLabel.setText("ID: " + model.getId()); //$NON-NLS-1$
-
- Text modelBaseLocationLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- modelBaseLocationLabel.setLayoutData(gd);
- modelBaseLocationLabel.setText("Base Location: " + model.getBaseLocation()); //$NON-NLS-1$
-
- Text modelContentTypeLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- modelContentTypeLabel.setLayoutData(gd);
- modelContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_4 + model.getContentTypeIdentifier()); //$NON-NLS-1$
-
- Text modelHandlerContentTypeLabel = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- modelHandlerContentTypeLabel.setLayoutData(gd);
- modelHandlerContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_5 + model.getModelHandler().getAssociatedContentTypeId() + " (" + model.getModelHandler() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- final Text counts = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- counts.setLayoutData(gd);
- counts.setText("Counting...");
- counts.setEnabled(false);
- final IStructuredModel finalModel = model;
- final Display display = Display.getCurrent();
- Job counter = new Job("Counting regions") {
- protected IStatus run(IProgressMonitor monitor) {
- IStructuredDocumentRegion[] structuredDocumentRegions = finalModel.getStructuredDocument().getStructuredDocumentRegions();
- int length = finalModel.getStructuredDocument().getLength();
- int regionCount = 0;
- for (int i = 0; i < structuredDocumentRegions.length; i++) {
- regionCount += structuredDocumentRegions[i].getNumberOfRegions();
- }
- NumberFormat formatter = NumberFormat.getIntegerInstance();
- final String regioncount = "Count: " + formatter.format(structuredDocumentRegions.length) + " document regions containing " + formatter.format(regionCount) + " text regions representing " + formatter.format(length) + " characters";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- display.asyncExec(new Runnable() {
- public void run() {
- if (!counts.isDisposed()) {
- counts.setText(regioncount);
- counts.setEnabled(true);
- }
- if (!bomLabel.isDisposed()) {
- bomLabel.setText("Byte Order Mark: " + getBOMText(fTextEditor.getEditorInput())); //$NON-NLS-1$
- bomLabel.setEnabled(true);
- }
- }
- });
- return Status.OK_STATUS;
- }
- };
- counter.schedule(1000);
-
- Label blankRow = new Label(composite, SWT.NONE);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- blankRow.setLayoutData(gd);
- }
- if (model != null) {
- model.releaseFromRead();
- }
-
- TabFolder tabfolder = new TabFolder(composite, SWT.NONE);
- tabfolder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- TabItem partitionTab = new TabItem(tabfolder, SWT.BORDER);
- partitionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_2); //$NON-NLS-1$
- SashForm partitions = new SashForm(tabfolder, SWT.NONE);
- partitions.setOrientation(SWT.VERTICAL);
- partitionTab.setControl(partitions);
- createPartitionTabContents(partitions);
- partitions.setWeights(new int[]{2, 1});
-
- TabItem annotationsTab = new TabItem(tabfolder, SWT.BORDER);
- annotationsTab.setText("Annotations"); //$NON-NLS-1$
- Composite annotations = new Composite(tabfolder, SWT.NONE);
- annotationsTab.setControl(annotations);
- createAnnotationTabContents(annotations);
-
- // only create the ITextRegions tab for IStructuredDocuments
- if (fDocument instanceof IStructuredDocument) {
- TabItem regionTab = new TabItem(tabfolder, SWT.BORDER);
- regionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_3); //$NON-NLS-1$
- SashForm regions = new SashForm(tabfolder, SWT.NONE);
- regions.setOrientation(SWT.HORIZONTAL);
- regionTab.setControl(regions);
- createRegionTabContents(regions);
- regions.setWeights(new int[]{3, 2});
- }
-
- if (structuredSelection != null) {
- TabItem editorSelectionTab = new TabItem(tabfolder, SWT.BORDER);
- editorSelectionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_14);
- Composite editorSelectionComposite = new Composite(tabfolder, SWT.NONE);
- editorSelectionTab.setControl(editorSelectionComposite);
- fillSelectionTabContents(editorSelectionComposite, structuredSelection.toList(), "Class: " + structuredSelection.getClass().getName()); //$NON-NLS-1$
- }
-
- model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model != null) {
- TabItem overlappingIndexedRegionsTab = new TabItem(tabfolder, SWT.BORDER);
- overlappingIndexedRegionsTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_20);
- Composite overlappingIndexedRegionsTabComposite = new Composite(tabfolder, SWT.NONE);
- overlappingIndexedRegionsTab.setControl(overlappingIndexedRegionsTabComposite);
- fillSelectionTabContents(overlappingIndexedRegionsTabComposite, getIndexedRegions(textSelection), "All IndexedRegions overlapping text selection"); //$NON-NLS-1$
- model.releaseFromRead();
- }
-
- IEditorSite site = fTextEditor.getEditorSite();
- if (site != null) {
- IWorkbenchWindow window = site.getWorkbenchWindow();
- if (window != null) {
- ISelectionService service = window.getSelectionService();
- ISelection selectionFromService = service.getSelection();
- if (service != null && !selectionFromService.equals(structuredSelection) && selectionFromService instanceof IStructuredSelection) {
- TabItem selectionServiceTab = new TabItem(tabfolder, SWT.BORDER);
- selectionServiceTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_19);
- Composite selectionServiceComposite = new Composite(tabfolder, SWT.NONE);
- selectionServiceTab.setControl(selectionServiceComposite);
- fillSelectionTabContents(selectionServiceComposite, ((IStructuredSelection) selectionFromService).toList(), "Class: " + selectionFromService.getClass().getName()); //$NON-NLS-1$
- }
- }
- }
-
- return composite;
- }
-
- /**
- * @param editorInput
- * @return
- */
- private String getBOMText(IEditorInput editorInput) {
- IFile file = (IFile) editorInput.getAdapter(IFile.class);
- String detectedBOM = "none"; //$NON-NLS-1$
- if (file != null) {
- InputStream s = null;
- try {
- s = file.getContents(true);
- if (s != null) {
- int b1 = s.read() & 0xFF;
- int b2 = s.read() & 0xFF;
- if (b1 == 0xFE && b2 == 0xFF) {
- detectedBOM = "FE FF (UTF-16BE)"; //$NON-NLS-1$
- }
- else if (b1 == 0xFF && b2 == 0xFE) {
- detectedBOM = "FF FE (UTF-16LE)"; //$NON-NLS-1$
- }
- else {
- int b3 = s.read() & 0xFF;
- if (b1 == 0xEF && b2 == 0xBB && b3 == 0xBF) {
- detectedBOM = "EF BB BF (UTF-8)"; //$NON-NLS-1$
- }
- }
- }
- }
- catch (Exception e) {
- detectedBOM = e.getMessage();
- }
- finally {
- if (s != null)
- try {
- s.close();
- }
- catch (IOException e) {
- }
- }
- }
- else {
- detectedBOM = "N/A"; //$NON-NLS-1$
- }
- return detectedBOM;
- }
-
- private List getIndexedRegions(ITextSelection textSelection) {
- Set overlappingIndexedRegions = new HashSet(2);
- int start = textSelection.getOffset();
- int end = start + textSelection.getLength();
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model != null) {
- for (int i = start; i <= end; i++) {
- IndexedRegion r = model.getIndexedRegion(i);
- if (r != null) {
- overlappingIndexedRegions.add(r);
- }
- }
- model.releaseFromRead();
- }
-
- return Arrays.asList(overlappingIndexedRegions.toArray());
- }
-
- /**
- * @param sash
- */
- private void createPartitionTabContents(SashForm sash) {
- Composite partioningComposite = new Composite(sash, SWT.NONE);
- partioningComposite.setLayout(new GridLayout(2, false));
- partioningComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Label label = new Label(partioningComposite, SWT.SINGLE);
- label.setText(SSEUIMessages.OffsetStatusLineContributionItem_8); //$NON-NLS-1$
- label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- final Combo partitioningCombo = new Combo(partioningComposite, SWT.READ_ONLY);
- partitioningCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
- final Label partitionerInstanceLabel = new Label(partioningComposite, SWT.SINGLE);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- partitionerInstanceLabel.setLayoutData(gd);
-
- final TableViewer fPartitionTable = new TableViewer(partioningComposite, SWT.FULL_SELECTION);
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.horizontalSpan = 2;
- fPartitionTable.getControl().setLayoutData(gd);
- fPartitionTable.setContentProvider(new ArrayContentProvider());
- fPartitionTable.getTable().setHeaderVisible(true);
- fPartitionTable.getTable().setLinesVisible(true);
- String[] columns = new String[]{SSEUIMessages.OffsetStatusLineContributionItem_9, SSEUIMessages.OffsetStatusLineContributionItem_10, SSEUIMessages.OffsetStatusLineContributionItem_11}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- fPartitionTable.setLabelProvider(new ITableLabelProvider() {
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- ITypedRegion partition = (ITypedRegion) element;
- String text = null;
- switch (columnIndex) {
- case 0 :
- text = Integer.toString(partition.getOffset());
- break;
- case 1 :
- text = Integer.toString(partition.getLength());
- break;
- case 2 :
- text = partition.getType();
- break;
- }
- if (text == null)
- text = ""; //$NON-NLS-1$
- return text;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
- });
- TableLayout tlayout = new TableLayout();
- CellEditor[] cellEditors = new CellEditor[columns.length];
- int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 5};
- for (int i = 0; i < columns.length; i++) {
- tlayout.addColumnData(new ColumnWeightData(1));
- TableColumn tc = new TableColumn(fPartitionTable.getTable(), SWT.NONE);
- tc.setText(columns[i]);
- tc.setResizable(true);
- tc.setWidth(columnWidths[i]);
- }
- fPartitionTable.setCellEditors(cellEditors);
- fPartitionTable.setColumnProperties(columns);
- final String[] partitionings = (fDocument instanceof IDocumentExtension3) ? ((IDocumentExtension3) fDocument).getPartitionings() : new String[]{IDocumentExtension3.DEFAULT_PARTITIONING};
- partitioningCombo.setItems(partitionings);
- partitioningCombo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- ITextSelection textSelection = (ITextSelection) sel;
- try {
- String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
- partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
- fPartitionTable.setInput(TextUtilities.computePartitioning(fDocument, partitioningCombo.getItem(partitioningCombo.getSelectionIndex()), textSelection.getOffset(), textSelection.getLength(), true));
- }
- catch (BadLocationException e1) {
- fPartitionTable.setInput(new ITypedRegion[0]);
- }
- }
- });
- try {
- if (partitionings.length > 0) {
- String selectedPartitioning = partitioningCombo.getItem(0);
- if (Utilities.contains(partitionings, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
- selectedPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
- for (int i = 0; i < partitionings.length; i++) {
- if (partitionings[i].equals(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
- partitioningCombo.select(i);
- }
- }
- }
- else {
- partitioningCombo.select(0);
- }
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- ITextSelection textSelection = (ITextSelection) sel;
- ITypedRegion[] partitions = TextUtilities.computePartitioning(fDocument, selectedPartitioning, textSelection.getOffset(), textSelection.getLength(), true);
- fPartitionTable.setInput(partitions);
- String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
- partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
- }
- else {
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- ITextSelection textSelection = (ITextSelection) sel;
- fPartitionTable.setInput(fDocument.computePartitioning(textSelection.getOffset(), textSelection.getLength()));
- }
- }
- catch (BadLocationException e1) {
- fPartitionTable.setInput(new ITypedRegion[0]);
- }
- partitioningCombo.setFocus();
-
-
- final StyledText text = new StyledText(sash, SWT.MULTI | SWT.READ_ONLY);
- fPartitionTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection) {
- IRegion partition = (IRegion) ((IStructuredSelection) event.getSelection()).getFirstElement();
- IDocument document = fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
- String source;
- try {
- source = document.get(partition.getOffset(), partition.getLength());
- text.setEnabled(true);
- text.setText(source);
- }
- catch (BadLocationException e) {
- e.printStackTrace();
- }
- }
- }
- });
- text.setEnabled(false);
- }
-
- /**
- * @param composite
- * @return
- */
- private Composite createRegionTabContents(SashForm sashForm) {
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- final ITextSelection textSelection = (ITextSelection) sel;
- final List documentRegions = new ArrayList();
- if (fDocument instanceof IStructuredDocument) {
- IStructuredDocument structuredDocument = (IStructuredDocument) fDocument;
- int pos = textSelection.getOffset();
- int end = textSelection.getOffset() + textSelection.getLength();
- IStructuredDocumentRegion docRegion = structuredDocument.getRegionAtCharacterOffset(pos);
- IStructuredDocumentRegion endRegion = structuredDocument.getRegionAtCharacterOffset(end);
- if (pos < end) {
- while (docRegion != endRegion) {
- documentRegions.add(docRegion);
- docRegion = docRegion.getNext();
- }
- }
- documentRegions.add(docRegion);
- }
-
- final TreeViewer tree = new TreeViewer(sashForm, SWT.V_SCROLL | SWT.H_SCROLL);
- final String START = SSEUIMessages.OffsetStatusLineContributionItem_15; //$NON-NLS-1$
- final String LENGTH = SSEUIMessages.OffsetStatusLineContributionItem_16; //$NON-NLS-1$
- final String TEXTLENGTH = SSEUIMessages.OffsetStatusLineContributionItem_17; //$NON-NLS-1$
- final String CONTEXT = SSEUIMessages.OffsetStatusLineContributionItem_18; //$NON-NLS-1$
- tree.setContentProvider(new ITreeContentProvider() {
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- List children = new ArrayList(0);
- if (parentElement instanceof ITextSelection) {
- children.addAll(documentRegions);
- }
- if (parentElement instanceof ITextRegionCollection) {
- children.add(((ITextRegionCollection) parentElement).getRegions().toArray());
- }
- if (parentElement instanceof ITextRegion) {
- children.add(new KeyValuePair(CONTEXT, ((ITextRegion) parentElement).getType()));
- children.add(new KeyValuePair(START, Integer.toString(((ITextRegion) parentElement).getStart())));
- children.add(new KeyValuePair(TEXTLENGTH, Integer.toString(((ITextRegion) parentElement).getTextLength())));
- children.add(new KeyValuePair(LENGTH, Integer.toString(((ITextRegion) parentElement).getLength())));
- }
- if (parentElement instanceof ITextRegionList) {
- children.add(Arrays.asList(((ITextRegionList) parentElement).toArray()));
- }
- if (parentElement instanceof Collection) {
- children.addAll((Collection) parentElement);
- }
- if (parentElement instanceof Object[]) {
- children.addAll(Arrays.asList((Object[]) parentElement));
- }
- return children.toArray();
- }
-
- public Object[] getElements(Object inputElement) {
- return documentRegions.toArray();
- }
-
- public Object getParent(Object element) {
- if (element instanceof IStructuredDocumentRegion)
- return ((IStructuredDocumentRegion) element).getParentDocument();
- if (element instanceof ITextRegionContainer) {
- return ((ITextRegionContainer) element).getParent();
- }
- return fDocument;
- }
-
- public boolean hasChildren(Object element) {
- return !(element instanceof KeyValuePair);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
- tree.setLabelProvider(new LabelProvider() {
- public String getText(Object element) {
- if (element instanceof KeyValuePair)
- return ((KeyValuePair) element).fKey.toString().toLowerCase() + ": " + ((KeyValuePair) element).fValue; //$NON-NLS-1$
- if (element instanceof IStructuredDocumentRegion) {
- IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) element;
- int packageNameLength = documentRegion.getClass().getPackage().getName().length();
- if (packageNameLength > 0)
- packageNameLength++;
- String name = documentRegion.getClass().getName().substring(packageNameLength);
- String text = "[" + documentRegion.getStartOffset() + "-" + documentRegion.getEndOffset() + "] " + name + "@" + element.hashCode() + " " + documentRegion.getType(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return text;
- }
- if (element instanceof ITextRegion) {
- ITextRegion textRegion = (ITextRegion) element;
- int packageNameLength = textRegion.getClass().getPackage().getName().length();
- if (packageNameLength > 0)
- packageNameLength++;
- String name = textRegion.getClass().getName().substring(packageNameLength);
- String text = "[" + textRegion.getStart() + "-" + textRegion.getEnd() + "] " + name + "@" + element.hashCode() + " " + textRegion.getType(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return text;
- }
- return super.getText(element);
- }
- });
- tree.setInput(fDocument);
-
-
- final Text displayText = new Text(sashForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY | SWT.BORDER);
- displayText.setBackground(sashForm.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- tree.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection) {
- Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
- if (o instanceof KeyValuePair)
- displayText.setText(((KeyValuePair) o).fValue.toString());
- else if (o instanceof ITextSelection) {
- ITextSelection text = (ITextSelection) o;
- try {
- displayText.setText(fDocument.get(text.getOffset(), text.getLength()));
- }
- catch (BadLocationException e) {
- displayText.setText(""); //$NON-NLS-1$
- }
- }
- else if (o instanceof ITextRegionCollection) {
- ITextRegionCollection region = (ITextRegionCollection) o;
- displayText.setText(region.getFullText());
- }
- else
- displayText.setText("" + o); //$NON-NLS-1$
- }
- }
- });
- return sashForm;
- }
-
- private void fillSelectionTabContents(Composite area, List selection, String description) {
- area.setLayout(new GridLayout());
- area.setLayoutData(new GridData());
-
- Label typeName = new Label(area, SWT.WRAP);
- typeName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- typeName.setText(description); //$NON-NLS-1$
-
- (new Label(area, SWT.NONE)).setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- SashForm structuredSashForm = new SashForm(area, SWT.NONE);
- structuredSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- structuredSashForm.setOrientation(SWT.VERTICAL);
-
- final TableViewer structuredSelectionTable = new TableViewer(structuredSashForm, SWT.FULL_SELECTION | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-
- structuredSelectionTable.getTable().setHeaderVisible(true);
- structuredSelectionTable.getTable().setLinesVisible(true);
- structuredSelectionTable.setSorter(new ViewerSorter() {
- public int category(Object element) {
- if (element instanceof IndexedRegion)
- return ((IndexedRegion) element).getStartOffset();
- return super.category(element);
- }
- });
-
- structuredSelectionTable.setLabelProvider(new ITableLabelProvider() {
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- if (element instanceof INodeNotifier) {
- INodeAdapter adapterFor = ((INodeNotifier) element).getAdapterFor(IJFaceNodeAdapter.class);
- if (columnIndex == 2 && adapterFor != null && adapterFor instanceof IJFaceNodeAdapter) {
- IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) adapterFor;
- return adapter.getLabelImage((element));
- }
- }
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- String text = null;
- if (element != null) {
- switch (columnIndex) {
- case 0 : {
- text = String.valueOf(((List) structuredSelectionTable.getInput()).indexOf(element));
- }
- break;
- case 1 : {
- text = element.getClass().getName();
- }
- break;
- case 2 : {
- text = StringUtils.firstLineOf(element.toString());
- }
- break;
- default :
- text = ""; //$NON-NLS-1$
- }
- }
- return text;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
- });
-
- TableLayout tlayout = new TableLayout();
- tlayout.addColumnData(new ColumnWeightData(7, true));
- tlayout.addColumnData(new ColumnWeightData(28, true));
- tlayout.addColumnData(new ColumnWeightData(50, true));
- structuredSelectionTable.getTable().setLayout(tlayout);
-
- TableColumn tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
- tc.setText("Item"); //$NON-NLS-1$
- tc.setResizable(true);
- tc.setWidth(40);
-
- tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
- tc.setText("Class"); //$NON-NLS-1$
- tc.setResizable(true);
- tc.setWidth(40);
-
- tc = new TableColumn(structuredSelectionTable.getTable(), SWT.NONE);
- tc.setText("Value"); //$NON-NLS-1$
- tc.setResizable(true);
- tc.setWidth(40);
-
- structuredSelectionTable.setContentProvider(new ArrayContentProvider());
- final List input = selection;
- structuredSelectionTable.setInput(input);
-
- final TreeViewer infoTree = new TreeViewer(structuredSashForm, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- infoTree.setLabelProvider(new LabelProvider() {
- public Image getImage(Object element) {
- if (element instanceof TreeViewer && infoTree.getInput() instanceof INodeNotifier) {
- INodeAdapter adapterFor = ((INodeNotifier) infoTree.getInput()).getAdapterFor(IJFaceNodeAdapter.class);
- if (adapterFor != null && adapterFor instanceof IJFaceNodeAdapter) {
- IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) adapterFor;
- return adapter.getLabelImage((infoTree.getInput()));
- }
- }
- return super.getImage(element);
- }
-
- public String getText(Object element) {
- if (element instanceof Class) {
- return "Class: " + ((Class) element).getName(); //$NON-NLS-1$
- }
- if (element instanceof Collection) {
- return "Registered Adapters:"; //$NON-NLS-1$
- }
- if (element instanceof IRegion) {
- return "Indexed Region offset span: [" + ((IRegion) element).getOffset() + "-" + ((IRegion) element).getLength() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (element instanceof TreeViewer && infoTree.getInput() instanceof INodeNotifier) {
- IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) ((INodeNotifier) infoTree.getInput()).getAdapterFor(IJFaceNodeAdapter.class);
- if (adapter != null) {
- return adapter.getLabelText((infoTree.getInput()));
- }
- }
- return super.getText(element);
- }
- });
- infoTree.setContentProvider(new ITreeContentProvider() {
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Collection)
- return ((Collection) parentElement).toArray();
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- List elements = new ArrayList(4);
- if (inputElement != null) {
- if (inputElement instanceof INodeNotifier && ((INodeNotifier) inputElement).getAdapterFor(IJFaceNodeAdapter.class) != null) {
- elements.add(infoTree);
- }
- elements.add(inputElement.getClass());
- if (inputElement instanceof IndexedRegion) {
- elements.add(new Region(((IndexedRegion) inputElement).getStartOffset(), ((IndexedRegion) inputElement).getEndOffset()));
- }
- if (inputElement instanceof INodeNotifier) {
- elements.add(((INodeNotifier) inputElement).getAdapters());
- }
- }
- return elements.toArray();
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return element instanceof Collection;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
-
- structuredSelectionTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- int selectionIndex = structuredSelectionTable.getTable().getSelectionIndex();
- if (selectionIndex != -1) {
- infoTree.setInput(structuredSelectionTable.getElementAt(selectionIndex));
- }
- else {
- infoTree.setInput(event.getSelectionProvider().getSelection());
- }
- infoTree.expandToLevel(2);
- }
- });
-
- structuredSashForm.setWeights(new int[]{3, 2});
- }
-
- private String getLineNumber(Annotation annotation) {
- int line = -1;
- if (annotation instanceof MarkerAnnotation) {
- line = MarkerUtilities.getLineNumber(((MarkerAnnotation) annotation).getMarker());//$NON-NLS-1$
- }
- else {
- IAnnotationModel annotationModel = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput());
- Position p = annotationModel.getPosition(annotation);
- if (p != null && !p.isDeleted()) {
- try {
- // don't forget the +1
- line = fDocument.getLineOfOffset(p.getOffset()) + 1;
- }
- catch (BadLocationException e) {
- return e.getMessage();
- }
- }
- }
- return Integer.toString(line);
- }
- }
-
- static class KeyValuePair {
- Object fKey;
- String fValue;
-
- public KeyValuePair(Object key, String value) {
- fKey = key;
- fValue = value;
- }
- }
-
- class ShowEditorInformationAction extends Action {
- public ShowEditorInformationAction() {
- super();
- }
-
- public void run() {
- /**
- * TODO: Provide a more useful control, maybe a table where the
- * selection shows you the partition's text in a StyledText pane
- * beneath it.
- */
- super.run();
- new InformationDialog(((Control) fTextEditor.getAdapter(Control.class)).getShell()).open();
- }
- }
-
- IAction fShowEditorInformationAction = new ShowEditorInformationAction();
-
- ITextEditor fTextEditor = null;
-
- /**
- * @param id
- */
- public OffsetStatusLineContributionItem(String id) {
- super(id);
- setToolTipText("Double-click for more information");
- }
-
- /**
- * @param id
- * @param visible
- * @param widthInChars
- */
- public OffsetStatusLineContributionItem(String id, boolean visible, int widthInChars) {
- super(id, visible, widthInChars);
- setToolTipText("Double-click for more information");
- }
-
- public void setActiveEditor(ITextEditor textEditor) {
- fTextEditor = textEditor;
- setActionHandler(fShowEditorInformationAction);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java
deleted file mode 100644
index 4d4923ac4c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-
-/**
- * Image provider for structured text editor annotations.
- *
- * @author pavery
- */
-public class StructuredTextAnnotationImageProvider implements IAnnotationImageProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
- */
- public ImageDescriptor getImageDescriptor(String imageDescritporId) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
- */
- public String getImageDescriptorId(Annotation annotation) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
- */
- public Image getManagedImage(Annotation annotation) {
- // future return different types of managed images as JDT does
- // eg. overlay icon images, "grayed" images, quick fixable, etc...
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java
deleted file mode 100644
index d04eaed87f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java
+++ /dev/null
@@ -1,120 +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.sse.ui.internal.util;
-
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
- /**
- * <code>AssertionFailedException</code> is a runtime exception thrown
- * by some of the methods in <code>Assert</code>.
- * <p>
- * This class is not declared public to prevent some misuses; programs
- * that catch or otherwise depend on assertion failures are susceptible to
- * unexpected breakage when assertions in the code are added or removed.
- * </p>
- */
- class AssertionFailedException extends RuntimeException {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructs a new exception.
- */
- public AssertionFailedException() {
- super();
- }
-
- /**
- * Constructs a new exception with the given message.
- */
- public AssertionFailedException(String detail) {
- super(detail);
- }
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is not
- * <code>true</code>, an <code>IllegalArgumentException</code> is
- * thrown. The given message is included in that exception, to aid
- * debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- * @exception IllegalArgumentException
- * if the legality test failed
- */
- public static boolean isLegal(boolean expression, String message) {
- if (!expression)
- throw new IllegalArgumentException(message);
- return expression;
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this is
- * not the case, some kind of unchecked exception is thrown. The given
- * message is included in that exception, to aid debugging.
- *
- * @param object
- * the value to test
- * @param message
- * the message to include in the exception
- * @exception IllegalArgumentException
- * if the object is <code>null</code>
- */
- public static void isNotNull(Object object, String message) {
- if (object == null) {
- throw new Assert().new AssertionFailedException(message);
- }
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this is not
- * the case, some kind of unchecked exception is thrown. The given message
- * is included in that exception, to aid debugging.
- *
- * @param expression
- * the outcode of the check
- * @param message
- * the message to include in the exception
- * @return <code>true</code> if the check passes (does not return if the
- * check fails)
- */
- public static boolean isTrue(boolean expression, String message) {
- if (!expression) {
- throw new Assert().new AssertionFailedException(message);
- }
- return expression;
- }
-
- /* This class is not intended to be instantiated. */
- private Assert() {
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java
deleted file mode 100644
index 8a26343395..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.util;
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Helpful methods to be used with the Source Editor
- */
-public class EditorUtility {
-
- /**
- * Appends to modifier string of the given SWT modifier bit to the given
- * modifierString.
- *
- * @param modifierString
- * the modifier string
- * @param modifier
- * an int with SWT modifier bit
- * @return the concatenated modifier string
- */
- private static String appendModifierString(String modifierString, int modifier) {
- if (modifierString == null)
- modifierString = ""; //$NON-NLS-1$
- String newModifierString = Action.findModifierString(modifier);
- if (modifierString.length() == 0)
- return newModifierString;
- return modifierString + " + " + newModifierString; //$NON-NLS-1$
- }
-
- /**
- * Computes the state mask for the given modifier string.
- *
- * @param modifiers
- * the string with the modifiers, separated by '+', '-', ';',
- * ',' or '.'
- * @return the state mask or -1 if the input is invalid
- */
- public static int computeStateMask(String modifiers) {
- if (modifiers == null)
- return -1;
-
- if (modifiers.length() == 0)
- return SWT.NONE;
-
- int stateMask = 0;
- StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* "); //$NON-NLS-1$
- while (modifierTokenizer.hasMoreTokens()) {
- int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
- if (modifier == 0 || (stateMask & modifier) == modifier)
- return -1;
- stateMask = stateMask | modifier;
- }
- return stateMask;
- }
-
- /**
- * Maps the localized modifier name to a code in the same manner as
- * #findModifier.
- *
- * @return the SWT modifier bit, or <code>0</code> if no match was found
- * @see findModifier
- */
- public static int findLocalizedModifier(String token) {
- if (token == null)
- return 0;
-
- if (token.equalsIgnoreCase(Action.findModifierString(SWT.CTRL)))
- return SWT.CTRL;
- if (token.equalsIgnoreCase(Action.findModifierString(SWT.SHIFT)))
- return SWT.SHIFT;
- if (token.equalsIgnoreCase(Action.findModifierString(SWT.ALT)))
- return SWT.ALT;
- if (token.equalsIgnoreCase(Action.findModifierString(SWT.COMMAND)))
- return SWT.COMMAND;
-
- return 0;
- }
-
- /**
- * Temporary method to help migrate from using StructuredTextColors to
- * using base ColorRegistry. Instead of using symbolic names in the color
- * registry, we are currently mapping the rgb.toString value to
- * corresponding color.
- *
- * @param rgb
- * @return Color
- */
- public static Color getColor(RGB rgb) {
- if (rgb == null)
- return null;
-
- // get the color from the platform color registry
- Color color = JFaceResources.getColorRegistry().get(rgb.toString());
-
- // if the platform color registry does not have this color yet, add to
- // the registry
- if (color == null) {
- JFaceResources.getColorRegistry().put(rgb.toString(), rgb);
- color = JFaceResources.getColorRegistry().get(rgb.toString());
- }
- return color;
- }
-
- /**
- * Returns the modifier string for the given SWT modifier modifier bits.
- *
- * @param stateMask
- * the SWT modifier bits
- * @return the modifier string
- */
- public static String getModifierString(int stateMask) {
- String modifierString = ""; //$NON-NLS-1$
- if ((stateMask & SWT.CTRL) == SWT.CTRL)
- modifierString = appendModifierString(modifierString, SWT.CTRL);
- if ((stateMask & SWT.ALT) == SWT.ALT)
- modifierString = appendModifierString(modifierString, SWT.ALT);
- if ((stateMask & SWT.SHIFT) == SWT.SHIFT)
- modifierString = appendModifierString(modifierString, SWT.SHIFT);
- if ((stateMask & SWT.COMMAND) == SWT.COMMAND)
- modifierString = appendModifierString(modifierString, SWT.COMMAND);
-
- return modifierString;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java
deleted file mode 100644
index a12e28cebc..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.sse.ui.internal.util;
-
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * @deprecated - use {@link org.eclipse.jface.layout.PixelConverter}
- */
-public class PixelConverter extends org.eclipse.jface.layout.PixelConverter {
-
- public PixelConverter(Control control) {
- super(control);
- }
-
- public PixelConverter(Font font) {
- super(font);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
deleted file mode 100644
index c71017e837..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.util;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.VerifyKeyListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.widgets.Control;
-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.wst.sse.ui.StructuredTextEditor;
-
-/**
- * Utility to display (and/or clear) messages on the status line.
- *
- * @author pavery
- */
-public class PlatformStatusLineUtil {
-
- private static class ClearMessage implements Runnable {
- public void run() {
- displayMessage(null);
- }
- }
-
- private static class ClearStatusLine implements Runnable {
- private IStatusLineManager fManager;
- private boolean fIsError;
-
- ClearStatusLine(IStatusLineManager statusLineManager, boolean isError) {
- fManager = statusLineManager;
- fIsError = isError;
- }
-
- public void run() {
- if (fIsError) {
- fManager.setErrorMessage(null);
- }
- else {
- fManager.setMessage(null);
- }
- }
- }
-
- /**
- * Used to clear message on focus loss, change of selection, key type,
- * etc...
- */
- private static class OneTimeListener extends FocusAdapter implements VerifyKeyListener, SelectionListener, MouseListener {
- private Runnable fRunner = null;
- private StyledText fStyledText;
-
- OneTimeListener(StyledText target, Runnable r) {
- fStyledText = target;
- fRunner = r;
- fStyledText.addVerifyKeyListener(this);
- fStyledText.addFocusListener(this);
- fStyledText.addSelectionListener(this);
- fStyledText.addMouseListener(this);
- }
-
- public void focusLost(FocusEvent e) {
- unhookAndRun();
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- unhookAndRun();
- }
-
- public void mouseDown(MouseEvent e) {
- unhookAndRun();
- }
-
- public void mouseUp(MouseEvent e) {
- //
- }
-
- private void unhookAndRun() {
- fStyledText.removeVerifyKeyListener(this);
- fStyledText.removeFocusListener(this);
- fStyledText.removeSelectionListener(this);
- fStyledText.removeMouseListener(this);
- fStyledText.getDisplay().asyncExec(fRunner);
- }
-
- public void verifyKey(VerifyEvent event) {
- unhookAndRun();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- unhookAndRun();
- }
-
- public void widgetSelected(SelectionEvent e) {
- unhookAndRun();
- }
- }
-
- /**
- * Status line error message will be cleared w/ key type or selection change
- *
- * @deprecated
- */
- public static void addOneTimeClearListener() {
- IEditorPart editor = getActiveEditor();
- boolean added = false;
- if (editor != null) {
- Control control = (Control) editor.getAdapter(Control.class);
- if (control instanceof StyledText) {
- new OneTimeListener((StyledText) control, new ClearMessage());
- added = true;
- }
- }
- if (!added) {
- // clear the error message immediately
- displayMessage(null);
- }
- }
-
- /**
- * Clears the status line immediately
- * @deprecated
- */
- public static void clearStatusLine() {
- displayMessage(null);
- }
-
- /**
- * Display a message on the status line (with a beep)
- * @deprecated
- * @param msg
- */
- public static void displayErrorMessage(String msg) {
- displayMessage(msg);
- PlatformUI.getWorkbench().getDisplay().beep();
- }
-
- /**
- * Display a message on the status line (no beep)
- * @deprecated
- * @param msg
- */
- public static void displayMessage(String msg) {
- IEditorPart editor = getActiveEditor();
- if (editor != null) {
- editor.getEditorSite().getActionBars().getStatusLineManager().setErrorMessage(msg);
- }
-
- }
-
- private static IEditorPart getActiveEditor() {
- IEditorPart editor = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- if (windows.length > 0) {
- window = windows[0];
- }
- }
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null)
- editor = page.getActiveEditor();
- }
- return editor;
- }
-
- private PlatformStatusLineUtil() {
- // force use of singleton
- }
-
- /**
- * Display an error message on the status line
- *
- * @param viewer
- * @param msg
- */
- public static boolean displayTemporaryErrorMessage(ITextViewer viewer, String msg) {
- return _displayTemporaryMessage(viewer, msg, true);
- }
-
- /**
- * Display a message on the status line
- *
- * @param viewer
- * @param msg
- */
- public static boolean displayTemporaryMessage(ITextViewer viewer, String msg) {
- return _displayTemporaryMessage(viewer, msg, false);
- }
-
- static boolean _displayTemporaryMessage(ITextViewer viewer, String msg, boolean isError) {
- boolean messageShown = false;
- IEditorPart editor = getActiveEditor();
- if (editor != null) {
- ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- if (textEditor != null && textEditor instanceof StructuredTextEditor) {
- if (((StructuredTextEditor) textEditor).getTextViewer() == viewer) {
- IStatusLineManager statusLineManager = editor.getEditorSite().getActionBars().getStatusLineManager();
- if (isError)
- statusLineManager.setErrorMessage(msg);
- else
- statusLineManager.setMessage(msg);
- new OneTimeListener(viewer.getTextWidget(), new ClearStatusLine(statusLineManager, isError));
- messageShown = true;
- }
- }
- }
-
- if (!messageShown) {
- displayErrorMessage(msg);
- addOneTimeClearListener();
- }
-
- return messageShown;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java
deleted file mode 100644
index 6fc895b29c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java
+++ /dev/null
@@ -1,175 +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.sse.ui.internal.util;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * Template implementation of a registry reader that creates objects
- * representing registry contents. Typically, an extension contains one
- * element, but this reader handles multiple elements per extension.
- *
- * To start reading the extensions from the registry for an extension point,
- * call the method <code>readRegistry</code>.
- *
- * To read children of an IConfigurationElement, call the method
- * <code>readElementChildren</code> from your implementation of the method
- * <code>readElement</code>, as it will not be done by default.
- */
-public abstract class RegistryReader {
-
-
- protected static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- protected RegistryReader() {
- }
-
- /**
- * This method extracts description as a subelement of the given element.
- *
- * @return description string if defined, or empty string if not.
- */
- protected String getDescription(IConfigurationElement config) {
- IConfigurationElement[] children = config.getChildren(TAG_DESCRIPTION);
- if (children.length >= 1) {
- return children[0].getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Logs the error in the workbench log using the provided text and the
- * information in the configuration element.
- */
- protected void logError(IConfigurationElement element, String text) {
- IExtension extension = element.getDeclaringExtension();
- StringBuffer buf = new StringBuffer();
- buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-2$//$NON-NLS-1$
- buf.append("\n" + text); //$NON-NLS-1$
- Logger.log(Logger.ERROR, buf.toString());
- }
-
- /**
- * Logs a very common registry error when a required attribute is missing.
- */
- protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-2$//$NON-NLS-1$
- }
-
- /**
- * Logs a registry error when the configuration element is unknown.
- */
- protected void logUnknownElement(IConfigurationElement element) {
- logError(element, "Unknown extension tag found: " + element.getName()); //$NON-NLS-1$
- }
-
- /**
- * Apply a reproducable order to the list of extensions provided, such
- * that the order will not change as extensions are added or removed.
- */
- protected IExtension[] orderExtensions(IExtension[] extensions) {
- // By default, the order is based on plugin id sorted
- // in ascending order. The order for a plugin providing
- // more than one extension for an extension point is
- // dependent in the order listed in the XML file.
- Sorter sorter = new Sorter() {
- public boolean compare(Object extension1, Object extension2) {
- String s1 = ((IExtension) extension1).getNamespace().toUpperCase();
- String s2 = ((IExtension) extension2).getNamespace().toUpperCase();
- //Return true if elementTwo is 'greater than' elementOne
- return s2.compareTo(s1) > 0;
- }
- };
-
- Object[] sorted = sorter.sort(extensions);
- IExtension[] sortedExtension = new IExtension[sorted.length];
- System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
- return sortedExtension;
- }
-
- /**
- * Implement this method to read element's attributes. If children should
- * also be read, then implementor is responsible for calling
- * <code>readElementChildren</code>. Implementor is also responsible
- * for logging missing attributes.
- *
- * @return true if element was recognized, false if not.
- */
- protected abstract boolean readElement(IConfigurationElement element);
-
- /**
- * Read the element's children. This is called by the subclass'
- * readElement method when it wants to read the children of the element.
- */
- protected void readElementChildren(IConfigurationElement element) {
- readElements(element.getChildren());
- }
-
- /**
- * Read each element one at a time by calling the subclass implementation
- * of <code>readElement</code>.
- *
- * Logs an error if the element was not recognized.
- */
- protected void readElements(IConfigurationElement[] elements) {
- for (int i = 0; i < elements.length; i++) {
- if (!readElement(elements[i]))
- logUnknownElement(elements[i]);
- }
- }
-
- /**
- * Read one extension by looping through its configuration elements.
- */
- protected void readExtension(IExtension extension) {
- readElements(extension.getConfigurationElements());
- }
-
- /**
- * @deprecated use readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
- */
- protected void readRegistry(IPluginRegistry registry, String pluginId, String extensionPoint) {
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- extensions = orderExtensions(extensions);
- for (int i = 0; i < extensions.length; i++)
- readExtension(extensions[i]);
- }
- }
-
- /**
- * Start the registry reading process using the supplied plugin ID and
- * extension point.
- */
- protected void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint) {
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- extensions = orderExtensions(extensions);
- for (int i = 0; i < extensions.length; i++)
- readExtension(extensions[i]);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java
deleted file mode 100644
index aeb7dd77c3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.dnd.DragSource;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * <p>Utility class to simplify access to some SWT resources.</p>
- *
- * @base org.eclipse.jdt.internal.ui.util.SWTUtil
- */
-public class SWTUtil {
-
-
- public static final int COMBO_VISIBLE_ITEM_COUNT= 30;
-
- /**
- * Returns the standard display to be used. The method first checks, if
- * the thread calling this method has an associated display. If so, this
- * display is returned. Otherwise the method returns the default display.
- * @return returns the standard display to be used
- */
- public static Display getStandardDisplay() {
- Display display;
- display= Display.getCurrent();
- if (display == null)
- display= Display.getDefault();
- return display;
- }
-
- /**
- * Returns the shell for the given widget. If the widget doesn't represent
- * a SWT object that manage a shell, <code>null</code> is returned.
- * @param widget the widget
- *
- * @return the shell for the given widget
- */
- public static Shell getShell(Widget widget) {
- if (widget instanceof Control)
- return ((Control)widget).getShell();
- if (widget instanceof Caret)
- return ((Caret)widget).getParent().getShell();
- if (widget instanceof DragSource)
- return ((DragSource)widget).getControl().getShell();
- if (widget instanceof DropTarget)
- return ((DropTarget)widget).getControl().getShell();
- if (widget instanceof Menu)
- return ((Menu)widget).getParent().getShell();
- if (widget instanceof ScrollBar)
- return ((ScrollBar)widget).getParent().getShell();
-
- return null;
- }
-
-
- /**
- * Returns a width hint for a button control.
- * @param button the button
- * @return the width hint
- */
- public static int getButtonWidthHint(Button button) {
- button.setFont(JFaceResources.getDialogFont());
- PixelConverter converter= new PixelConverter(button);
- int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- /**
- * Sets width and height hint for the button control.
- * <b>Note:</b> This is a NOP if the button's layout data is not
- * an instance of <code>GridData</code>.
- *
- * @param button the button for which to set the dimension hint
- */
- public static void setButtonDimensionHint(Button button) {
- Assert.isNotNull(button);
- Object gd= button.getLayoutData();
- if (gd instanceof GridData) {
- ((GridData)gd).widthHint= getButtonWidthHint(button);
- ((GridData)gd).horizontalAlignment = GridData.FILL;
- }
- }
-
- public static int getTableHeightHint(Table table, int rows) {
- if (table.getFont().equals(JFaceResources.getDefaultFont()))
- table.setFont(JFaceResources.getDialogFont());
- int result= table.getItemHeight() * rows + table.getHeaderHeight();
- if (table.getLinesVisible())
- result+= table.getGridLineWidth() * (rows - 1);
- return result;
- }
-
- /**
- * Adds an accessibility listener returning the given fixed name.
- *
- * @param control the control to add the accessibility support to
- * @param text the name
- */
- public static void setAccessibilityText(Control control, final String text) {
- control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result= text;
- }
- });
- }
-
- /**
- *
- * @param combo the combo
- *
- * @see Combo#setVisibleItemCount(int)
- * @see #COMBO_VISIBLE_ITEM_COUNT
- *
- */
- public static void setDefaultVisibleItemCount(Combo combo) {
- combo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT);
- }
-
- public static GridLayout newLayoutNoMargins(int columns) {
- GridLayout layout= new GridLayout(columns, false);
- layout.marginWidth= 0;
- layout.marginHeight= 0;
- return layout;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java
deleted file mode 100644
index 3a895d3d1b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java
+++ /dev/null
@@ -1,77 +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.sse.ui.internal.util;
-
-
-
-/**
- * The SortOperation takes a collection of objects and returns a sorted
- * collection of these objects. Concrete instances of this class provide the
- * criteria for the sorting of the objects based on the type of the objects.
- */
-public abstract class Sorter {
-
- /**
- * Returns true if elementTwo is 'greater than' elementOne This is the
- * 'ordering' method of the sort operation. Each subclass overides this
- * method with the particular implementation of the 'greater than' concept
- * for the objects being sorted.
- */
- public abstract boolean compare(Object elementOne, Object elementTwo);
-
- /**
- * Sort the objects in sorted collection and return that collection.
- */
- private Object[] quickSort(Object[] sortedCollection, int left, int right) {
- int originalLeft = left;
- int originalRight = right;
- Object mid = sortedCollection[(left + right) / 2];
-
- do {
- while (compare(sortedCollection[left], mid))
- left++;
- while (compare(mid, sortedCollection[right]))
- right--;
- if (left <= right) {
- Object tmp = sortedCollection[left];
- sortedCollection[left] = sortedCollection[right];
- sortedCollection[right] = tmp;
- left++;
- right--;
- }
- } while (left <= right);
-
- if (originalLeft < right)
- sortedCollection = quickSort(sortedCollection, originalLeft, right);
- if (left < originalRight)
- sortedCollection = quickSort(sortedCollection, left, originalRight);
-
- return sortedCollection;
- }
-
- /**
- * Return a new sorted collection from this unsorted collection. Sort
- * using quick sort.
- */
- public Object[] sort(Object[] unSortedCollection) {
- int size = unSortedCollection.length;
- Object[] sortedCollection = new Object[size];
-
- //copy the array so can return a new sorted collection
- System.arraycopy(unSortedCollection, 0, sortedCollection, 0, size);
- if (size > 1)
- quickSort(sortedCollection, 0, size - 1);
-
- return sortedCollection;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java
deleted file mode 100644
index e9078342ee..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java
+++ /dev/null
@@ -1,52 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- *
- * Simply holds data to be passed to CaretEventListeners
- */
-public class CaretEvent extends java.util.EventObject {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- // initialize to impossible location
- int fPosition = -1;
-
- /**
- * doesnt't make sense to have a CaretEvent without the Caret postion, so
- * use other constructor
- */
- protected CaretEvent(Object source) {
- super(source);
- }
-
- /**
- * This is the preferred constructor.
- */
- public CaretEvent(Object source, int position) {
- super(source);
- setPosition(position);
- }
-
- public int getPosition() {
- return fPosition;
- }
-
- void setPosition(int newPosition) {
- fPosition = newPosition;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java
deleted file mode 100644
index 695e72b051..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public interface ICaretListener extends java.util.EventListener {
- public void caretMoved(CaretEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java
deleted file mode 100644
index 94fd9a6789..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal.view.events;
-
-
-/**
- * @deprecated - use base selection notification
- */
-
-public interface INodeSelectionListener {
- void nodeSelectionChanged(NodeSelectionChangedEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java
deleted file mode 100644
index f241bfb687..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public interface ITextSelectionListener {
- void textSelectionChanged(TextSelectionChangedEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java
deleted file mode 100644
index 579d753baa..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.view.events;
-
-import java.util.List;
-
-/**
- * @deprecated - use base selection notification
- */
-public class NodeSelectionChangedEvent extends java.util.EventObject {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- int fCaretPosition;
-
- List fSelectedNodes;
-
- public NodeSelectionChangedEvent(Object source, List selectedNodes, int caretPosition) {
- super(source);
- fSelectedNodes = selectedNodes;
- fCaretPosition = caretPosition;
- }
-
- public int getCaretPosition() {
- return fCaretPosition;
- }
-
- public List getSelectedNodes() {
- return fSelectedNodes;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java
deleted file mode 100644
index d7807e5cca..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java
+++ /dev/null
@@ -1,41 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public class TextSelectionChangedEvent extends java.util.EventObject {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- int fTextSelectionEnd;
-
- int fTextSelectionStart;
-
- public TextSelectionChangedEvent(Object source, int textSelectionStart, int textSelectionEnd) {
- super(source);
- fTextSelectionStart = textSelectionStart;
- fTextSelectionEnd = textSelectionEnd;
- }
-
- public int getTextSelectionEnd() {
- return fTextSelectionEnd;
- }
-
- public int getTextSelectionStart() {
- return fTextSelectionStart;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java
deleted file mode 100644
index b6c171f8db..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java
+++ /dev/null
@@ -1,392 +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.wst.sse.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * <p>Implements a completion proposal categories configuration
- * reader and writer using an {@link IPreferenceStore}</p>
- *
- * <p>This class is meant to be subclasses by implementers of the
- * <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
- * extension point as a convince rather then implementing
- * {@link ICompletionProposalCategoriesConfigurationReader} and
- * {@link ICompletionProposalCategoriesConfigurationWriter} from scratch.</p>
- */
-public abstract class AbstractCompletionProposalCategoriesConfiguration
- implements ICompletionProposalCategoriesConfigurationReader,
- ICompletionProposalCategoriesConfigurationWriter {
-
- /** Separator used between preferences stored in the same key */
- private static final String PREFERENCE_CATEGORY_SEPERATOR = "\0"; //$NON-NLS-1$
-
- /**
- * <p>{@link CompletionProposalCategory} IDs sorted by the order they should
- * be listed on the default page if they are being displayed there</p>
- *
- * <code>{@link List}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- private List fDefaultPageSortOrder;
-
- /**
- * <p>{@link CompletionProposalCategory} IDs sorted by the order they should
- * be cycled through</p>
- *
- * <code>{@link List}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- private List fOwnPageSortOrder;
-
- /**
- * <p>{@link CompletionProposalCategory} IDs that should not be displayed on
- * their own page</p>
- *
- * <code>{@link Set}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- private Set fShouldNotDisplayOnOwnPage;
-
- /**
- * <p>{@link CompletionProposalCategory} IDs that should not be displayed on
- * on the default page</p>
- *
- * <code>{@link Set}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- private Set fShouldNotDisplayOnDefaultPage;
-
- /**
- * <p>Create a new configuration by loading from the associated {@link IPreferenceStore}</p>
- */
- public AbstractCompletionProposalCategoriesConfiguration() {
- this.fOwnPageSortOrder = new ArrayList();
- this.fDefaultPageSortOrder = new ArrayList();
- this.fShouldNotDisplayOnOwnPage = new HashSet();
- this.fShouldNotDisplayOnDefaultPage = new HashSet();
-
- this.loadUserConfiguration();
- }
-
- /**
- * @return {@link IPreferenceStore} to read and write the configuration to and from
- */
- protected abstract IPreferenceStore getPreferenceStore();
-
- /**
- * @return Preference key to use in the {@link IPreferenceStore} for the category sort order
- * when cycling through the pages
- */
- protected abstract String getPageSortOrderPrefKey();
-
- /**
- * @return Preference key to use in the {@link IPreferenceStore} for the category sort order
- * on the default page
- */
- protected abstract String getDefaultPageSortOrderPrefKey();
-
- /**
- * @return Preference key to use in the {@link IPreferenceStore} for which
- * categories not to display on their own page
- */
- protected abstract String getShouldNotDisplayOnOwnPagePrefKey();
-
- /**
- * @return Preference key to use in the {@link IPreferenceStore} for which
- * categories not to display on the default page
- */
- protected abstract String getShouldNotDisplayOnDefaultPagePrefKey();
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#getPageSortOrder(java.lang.String)
- */
- public int getPageSortOrder(String categoryID) {
- int sortOrder = this.fOwnPageSortOrder.indexOf(categoryID);
- if(sortOrder == -1) {
- sortOrder = DEFAULT_SORT_ORDER;
- }
-
- return sortOrder;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#getDefaultPageSortOrder(java.lang.String)
- */
- public int getDefaultPageSortOrder(String categoryID) {
- int sortOrder = this.fDefaultPageSortOrder.indexOf(categoryID);
- if(sortOrder == -1) {
- sortOrder = DEFAULT_SORT_ORDER;
- }
-
- return sortOrder;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#shouldDisplayOnDefaultPage(java.lang.String)
- */
- public boolean shouldDisplayOnDefaultPage(String categoryID) {
- return !fShouldNotDisplayOnDefaultPage.contains(categoryID);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#shouldDisplayOnOwnPage(java.lang.String)
- */
- public boolean shouldDisplayOnOwnPage(String categoryID) {
- return !this.fShouldNotDisplayOnOwnPage.contains(categoryID);
- }
-
- /**
- * <p> Loads defaults from the associated {@link IPreferenceStore}</p>
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#loadDefaults()
- */
- public void loadDefaults() {
- this.loadDefaultPagePreference(true);
- this.loadPageSortOrder(true);
- this.loadDefaultPageSortOrder(true);
- this.loadShouldNotDisplayOnOwnPage(true);
- }
-
- /**
- * <p>Saves to the associated {@link IPreferenceStore}</p>
- *
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#saveConfiguration()
- */
- public boolean saveConfiguration() {
- this.saveShouldDisplayOnDefaultPageConfiguration();
- this.saveShouldDisplayOnOwnPageConfiguration();
- this.saveDefaultPageSortOrderConfiguration();
- this.savePageSortOrderConfiguration();
-
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setShouldDisplayOnDefaultPage(java.lang.String, boolean)
- */
- public void setShouldDisplayOnDefaultPage(String categoryID,
- boolean shouldDisplay) {
-
- if(shouldDisplay) {
- this.fShouldNotDisplayOnDefaultPage.remove(categoryID);
- } else {
- this.fShouldNotDisplayOnDefaultPage.add(categoryID);
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setShouldDisplayOnOwnPage(java.lang.String, boolean)
- */
- public void setShouldDisplayOnOwnPage(String categoryID, boolean shouldDisplay) {
-
- if(shouldDisplay) {
- this.fShouldNotDisplayOnOwnPage.remove(categoryID);
- } else {
- this.fShouldNotDisplayOnOwnPage.add(categoryID);
- }
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setPageOrder(java.util.List)
- */
- public void setPageOrder(List order) {
- this.fOwnPageSortOrder = order;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setDefaultPageOrder(java.util.List)
- */
- public void setDefaultPageOrder(List order) {
- this.fDefaultPageSortOrder = order;
- }
-
- /**
- * <p>Loads the user configuration from the associated {@link IPreferenceStore}</p>
- */
- private void loadUserConfiguration() {
- this.loadDefaultPagePreference(false);
- this.loadPageSortOrder(false);
- this.loadDefaultPageSortOrder(false);
- this.loadShouldNotDisplayOnOwnPage(false);
- }
-
- /**
- * <p>Loads the user preferences for which categories to
- * display on the default content assist page</p>
- *
- * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
- * otherwise use the user specified preferences
- */
- private void loadDefaultPagePreference(boolean useDefaults) {
- //clear the current display on default page configuration
- this.fShouldNotDisplayOnDefaultPage.clear();
-
- //parse either the default or user configuration preference
- String displayOnDefaultPage;
- if(useDefaults) {
- displayOnDefaultPage = getPreferenceStore().getDefaultString(getShouldNotDisplayOnDefaultPagePrefKey());
- } else {
- displayOnDefaultPage = getPreferenceStore().getString(getShouldNotDisplayOnDefaultPagePrefKey());
- }
- StringTokenizer defaultPageTokenizer = new StringTokenizer(displayOnDefaultPage, PREFERENCE_CATEGORY_SEPERATOR);
- while (defaultPageTokenizer.hasMoreTokens()) {
- fShouldNotDisplayOnDefaultPage.add(defaultPageTokenizer.nextToken());
- }
- }
-
- /**
- * <p>Loads the user preferences for the sort order of the content assist pages</p>
- *
- * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
- * otherwise use the user specified preferences
- */
- private void loadPageSortOrder(boolean useDefaults){
- //clear the current sort order
- this.fOwnPageSortOrder.clear();
-
- //parse either the default or user configuration preference
- String sortOrder;
- if(useDefaults) {
- sortOrder = getPreferenceStore().getDefaultString(getPageSortOrderPrefKey());
- } else {
- sortOrder = getPreferenceStore().getString(getPageSortOrderPrefKey());
- }
- StringTokenizer tokenizer = new StringTokenizer(sortOrder, PREFERENCE_CATEGORY_SEPERATOR);
- while (tokenizer.hasMoreTokens()) {
- String categoryID = tokenizer.nextToken();
- this.fOwnPageSortOrder.add(categoryID);
- }
- }
-
- /**
- * <p>Loads the user preferences for the sort order of the content assist pages</p>
- *
- * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
- * otherwise use the user specified preferences
- */
- private void loadDefaultPageSortOrder(boolean useDefaults){
- //clear the current sort order
- this.fDefaultPageSortOrder.clear();
-
- //parse either the default or user configuration preference
- String sortOrder;
- if(useDefaults) {
- sortOrder = getPreferenceStore().getDefaultString(getDefaultPageSortOrderPrefKey());
- } else {
- sortOrder = getPreferenceStore().getString(getDefaultPageSortOrderPrefKey());
- }
- StringTokenizer tokenizer = new StringTokenizer(sortOrder, PREFERENCE_CATEGORY_SEPERATOR);
- while (tokenizer.hasMoreTokens()) {
- String categoryID = tokenizer.nextToken();
- this.fDefaultPageSortOrder.add(categoryID);
- }
- }
-
- /**
- * <p>Loads the user preferences for which categories should not be displayed on their own
- * content assist page</p>
- *
- * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
- * otherwise use the user specified preferences
- */
- private void loadShouldNotDisplayOnOwnPage(boolean useDefaults){
- //clear the current sort order
- this.fShouldNotDisplayOnOwnPage.clear();
-
- //parse either the default or user configuration preference
- String preference;
- if(useDefaults) {
- preference = getPreferenceStore().getDefaultString(getShouldNotDisplayOnOwnPagePrefKey());
- } else {
- preference = getPreferenceStore().getString(getShouldNotDisplayOnOwnPagePrefKey());
- }
- StringTokenizer tokenizer = new StringTokenizer(preference, PREFERENCE_CATEGORY_SEPERATOR);
- while (tokenizer.hasMoreTokens()) {
- String categoryID = tokenizer.nextToken();
- this.fShouldNotDisplayOnOwnPage.add(categoryID);
- }
- }
-
- /**
- * <p>Saves the user preferences for which categories to
- * display on the default content assist page</p>
- */
- private void saveShouldDisplayOnDefaultPageConfiguration() {
- //create the preference string
- StringBuffer defaultPageBuff = new StringBuffer();
- Iterator defaultPageIter = this.fShouldNotDisplayOnDefaultPage.iterator();
- while(defaultPageIter.hasNext()) {
- String categoryID = (String)defaultPageIter.next();
- defaultPageBuff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR);
- }
-
- //save the preference
- this.getPreferenceStore().setValue(this.getShouldNotDisplayOnDefaultPagePrefKey(), defaultPageBuff.toString());
- }
-
- /**
- * <p>Saves the user preferences for the sort order of the content assist pages</p>
- */
- private void savePageSortOrderConfiguration() {
- //create the preference string
- StringBuffer orderBuff = new StringBuffer();
- for(int i = 0; i < this.fOwnPageSortOrder.size(); ++i) {
- if(this.fOwnPageSortOrder.get(i) != null) {
- orderBuff.append(this.fOwnPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR);
- }
- }
-
- //save the preference
- this.getPreferenceStore().setValue(this.getPageSortOrderPrefKey(), orderBuff.toString());
- }
-
- /**
- * <p>Saves the user preferences for the sort order of the categories on the default page</p>
- */
- private void saveDefaultPageSortOrderConfiguration() {
- //create the preference string
- StringBuffer orderBuff = new StringBuffer();
- for(int i = 0; i < this.fDefaultPageSortOrder.size(); ++i) {
- if(this.fDefaultPageSortOrder.get(i) != null) {
- orderBuff.append(this.fDefaultPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR);
- }
- }
-
- //save the preference
- this.getPreferenceStore().setValue(this.getDefaultPageSortOrderPrefKey(), orderBuff.toString());
- }
-
- /**
- * <p>Saves the user preferences for which categories should not be displayed on their own
- * content assist page</p>
- */
- private void saveShouldDisplayOnOwnPageConfiguration() {
- //create the preference string
- StringBuffer buff = new StringBuffer();
- Iterator iter = this.fShouldNotDisplayOnOwnPage.iterator();
- while(iter.hasNext()) {
- String categoryID = (String)iter.next();
- buff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR);
- }
-
- //save the preference
- this.getPreferenceStore().setValue(this.getShouldNotDisplayOnOwnPagePrefKey(), buff.toString());
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java
deleted file mode 100644
index e1cfeadda0..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java
+++ /dev/null
@@ -1,891 +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.wst.sse.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.CommandManager;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.contexts.ContextManager;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.bindings.BindingManager;
-import org.eclipse.jface.bindings.Scheme;
-import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-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.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalComputerRegistry;
-import org.eclipse.wst.sse.ui.internal.util.SWTUtil;
-
-
-/**
- * <p>A helpful preference configuration block implementation for allowing a user to
- * set their preferences for which content assist categories to show on the default
- * content assist page as well as on their own separate page and page ordering for
- * a specific content type</p>
- *
- * @base org.eclipse.jdt.internal.ui.preferences.CodeAssistAdvancedConfigurationBlock
- */
-public final class CodeAssistCyclingConfigurationBlock {
-
- /**
- * <p>Used to compare categories based on their assigned page rank</p>
- */
- private final Comparator fCategoryPageComparator = new Comparator() {
- private int getRank(Object o) {
- return ((ModelElement) o).getOwnPageRank();
- }
-
- public int compare(Object o1, Object o2) {
- int result = getRank(o1) - getRank(o2);
- if(result == 0) {
- result = ((ModelElement) o1).getId().compareTo(((ModelElement) o2).getId());
- }
- return result;
- }
- };
-
- /**
- * <p>Used to compare categories based on their assigned default page rank</p>
- */
- private final Comparator fCategoryDefaultPageComparator = new Comparator() {
- private int getRank(Object o) {
- return ((ModelElement) o).getDefaultPageRank();
- }
-
- public int compare(Object o1, Object o2) {
- int result = getRank(o1) - getRank(o2);
- if(result == 0) {
- result = ((ModelElement) o1).getId().compareTo(((ModelElement) o2).getId());
- }
- return result;
- }
- };
-
- /** the preference model for this block */
- private final PreferenceModel fModel;
-
- /**
- * <code>{@link Map}<{@link ImageDescriptor}, {@link Image}></code>
- */
- private final Map fImages= new HashMap();
-
- /** table viewer to configure which categories are displayed on the default page */
- private CheckboxTableViewer fDefaultPageViewer;
-
- /**
- * table viewer to configure which categories are displayed
- * on their own page, as well as their ordering
- */
- private CheckboxTableViewer fOwnPageViewer;
-
- /** categories pages sort order up button */
- private Button fPageOrderUpButton;
-
- /** categories pages sort order down button */
- private Button fPageOrderDownButton;
-
- /** categories default page sort order up button */
- private Button fDefaultPageOrderUpButton;
-
- /** categories default page sort order down button */
- private Button fDefaultPageOrderDownButton;
-
- /** The content type ID this configuration block is for */
- private String fContentTypeID;
-
- /** The writable categories configuration */
- private ICompletionProposalCategoriesConfigurationWriter fConfigurationWriter;
-
- /**
- * <p>Creates a new content assist preference block for the given content type
- * using the given configuration writer</p>
- *
- * @param contentTypeID content type this content assist preference block is for
- * @param configurationWriter {@link ICompletionProposalCategoriesConfigurationWriter} used
- * to read and write the user preferences
- */
- public CodeAssistCyclingConfigurationBlock(String contentTypeID, ICompletionProposalCategoriesConfigurationWriter configurationWriter) {
- this.fContentTypeID = contentTypeID;
- this.fConfigurationWriter = configurationWriter;
-
- List categories = CompletionProposalComputerRegistry.getDefault().getProposalCategories(this.fContentTypeID);
- this.fModel = new PreferenceModel(categories);
- }
-
- /**
- * <p>Saves the user configuration</p>
- * @return <code>true</code> if store was successful, <code>false</code> otherwise
- */
- public boolean storeValues() {
- return this.fConfigurationWriter.saveConfiguration();
- }
-
- /**
- * <p>Loads the preference defaults</p>
- */
- public void performDefaults() {
- this.fConfigurationWriter.loadDefaults();
- this.initializeValues();
- this.fModel.performDefaults();
- }
-
- /**
- * <p>Disposes of this preference block</p>
- */
- public void dispose() {
- for (Iterator it= fImages.values().iterator(); it.hasNext();) {
- Image image= (Image) it.next();
- image.dispose();
- }
- }
-
- /**
- * <p>Creates the contents of this configuration block using a {@link Group} if
- * the given <code>groupTitle</code> is not <code>null</code> else creates it
- * as a composite and in either case adds itself to the given parent</p>
- *
- * @param parent {@link Composite} parent to add this configuration block to
- * @param groupTitle Title to use for the configuration block group, if
- * <code>null</code> then a {@link Composite} will be used instead of a
- * {@link Group}
- *
- * @return the created configuration block that has already been added to the parent
- */
- public Control createContents(Composite parent, String groupTitle) {
- Composite container;
- if(groupTitle != null) {
- container = new Group(parent, SWT.NULL);
- ((Group)container).setText(groupTitle);
- } else {
- container = new Composite(parent, SWT.NULL);
- }
- int columns= 2;
- GridLayout layout= new GridLayout(columns, false);
- container.setLayout(layout);
-
- GridData data = new GridData(GridData.FILL);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- container.setLayoutData(data);
-
- createDefaultPageLabel(container, columns);
- createDefaultPageSection(container);
-
- createFiller(container, columns);
-
- createOwnPageLabel(container, columns);
- createOwnPageSection(container);
-
- createFiller(container, columns);
-
- if (fModel.pageElements.size() > 0) {
- fDefaultPageViewer.getTable().select(0);
- fOwnPageViewer.getTable().select(0);
- handleOwnPageTableSelection();
- handleDefaultPageTableSelection();
- }
-
- return container;
- }
-
- /**
- * <p>Initialize the values of the configuration block</p>
- */
- public void initializeValues() {
- updateCheckedState();
- fDefaultPageViewer.refresh();
- fOwnPageViewer.refresh();
- handleOwnPageTableSelection();
- handleDefaultPageTableSelection();
- }
-
- private void createDefaultPageSection(Composite composite) {
- createDefaultPageViewer(composite);
- createDefaultPageButtonList(composite);
- }
-
- private void createDefaultPageLabel(Composite composite, int h_span) {
- final ICommandService commandSvc= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);
- final Command command= commandSvc.getCommand(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- ParameterizedCommand pCmd= new ParameterizedCommand(command, null);
- String key= getKeyboardShortcut(pCmd);
- if (key == null) {
- key= SSEUIMessages.CodeAssistAdvancedConfigurationBlock_no_shortcut;
- }
-
- PixelConverter pixelConverter= new PixelConverter(composite);
- int width= pixelConverter.convertWidthInCharsToPixels(40);
-
- Label label= new Label(composite, SWT.NONE | SWT.WRAP);
- label.setText(NLS.bind(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_page_description, new Object[] { key }));
- GridData gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1);
- gd.widthHint= width;
- label.setLayoutData(gd);
-
- createFiller(composite, h_span);
-
- label= new Label(composite, SWT.NONE | SWT.WRAP);
- label.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_default_table_description);
- gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1);
- gd.widthHint= width;
- label.setLayoutData(gd);
- }
-
- private void createDefaultPageViewer(Composite composite) {
- fDefaultPageViewer= CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER);
- Table table= fDefaultPageViewer.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(false);
- table.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 1, 1));
-
- TableColumn nameColumn= new TableColumn(table, SWT.NONE);
- nameColumn.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_default_table_category_column_title);
- nameColumn.setResizable(false);
-
- fDefaultPageViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- boolean checked= event.getChecked();
- ModelElement element= (ModelElement) event.getElement();
- element.setShouldDisplayOnDefaultPage(checked);
- }
- });
-
- fDefaultPageViewer.setContentProvider(new ArrayContentProvider());
-
- DefaultPageTableLabelProvider labelProvider= new DefaultPageTableLabelProvider();
- fDefaultPageViewer.setLabelProvider(labelProvider);
- fDefaultPageViewer.setInput(fModel.defaultPageElements);
- fDefaultPageViewer.setComparator(new ModelViewerComparator(fCategoryDefaultPageComparator));
-
- final int ICON_AND_CHECKBOX_WITH= 50;
- final int HEADER_MARGIN= 20;
- int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
- for (int i= 0; i < fModel.defaultPageElements.size(); i++) {
- minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.defaultPageElements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
- }
-
- nameColumn.setWidth(minNameWidth);
-
- table.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleDefaultPageTableSelection();
- }
- });
- }
-
- /**
- * <p>Create the Up and Down buttons for the default page viewer</p>
- * @param parent {@link Composite} to add the button list to
- */
- private void createDefaultPageButtonList(Composite parent) {
- Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
-
- GridLayout layout= new GridLayout();
- layout.marginWidth= 0;
- layout.marginHeight= 0;
- composite.setLayout(layout);
-
- fDefaultPageOrderUpButton= new Button(composite, SWT.PUSH | SWT.CENTER);
- fDefaultPageOrderUpButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_Up);
- fDefaultPageOrderUpButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int index = fDefaultPageViewer.getTable().getSelectionIndex();
- if (index != -1) {
- fModel.moveDefaultPageCategoryUp(index);
- fDefaultPageViewer.refresh();
- handleDefaultPageTableSelection();
- }
- }
- });
- fDefaultPageOrderUpButton.setLayoutData(new GridData());
-
- SWTUtil.setButtonDimensionHint(fDefaultPageOrderUpButton);
-
- fDefaultPageOrderDownButton= new Button(composite, SWT.PUSH | SWT.CENTER);
- fDefaultPageOrderDownButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_Down);
- fDefaultPageOrderDownButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int index= fDefaultPageViewer.getTable().getSelectionIndex();
- if (index != -1) {
- fModel.moveDefaultPageCategoryDown(index);
- fDefaultPageViewer.refresh();
- handleDefaultPageTableSelection();
- }
- }
- });
- fDefaultPageOrderDownButton.setLayoutData(new GridData());
- SWTUtil.setButtonDimensionHint(fDefaultPageOrderDownButton);
- }
-
- private void createFiller(Composite composite, int h_span) {
- Label filler= new Label(composite, SWT.NONE);
- filler.setVisible(false);
- filler.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, h_span, 1));
- }
-
- private void createOwnPageLabel(Composite composite, int h_span) {
- PixelConverter pixelConverter= new PixelConverter(composite);
- int width= pixelConverter.convertWidthInCharsToPixels(40);
-
- Label label= new Label(composite, SWT.NONE | SWT.WRAP);
- label.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_separate_table_description);
- GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1);
- gd.widthHint= width;
- label.setLayoutData(gd);
- }
-
- private void createOwnPageSection(Composite composite) {
- createOwnPageViewer(composite);
- createOwnPageButtonList(composite);
- }
-
- private void createOwnPageViewer(Composite composite) {
- fOwnPageViewer= CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER);
- Table table= fOwnPageViewer.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(false);
- table.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false, 1, 1));
-
- TableColumn nameColumn= new TableColumn(table, SWT.NONE);
- nameColumn.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title);
- nameColumn.setResizable(false);
-
- fOwnPageViewer.setContentProvider(new ArrayContentProvider());
-
- ITableLabelProvider labelProvider= new OwnPageTableLabelProvider();
- fOwnPageViewer.setLabelProvider(labelProvider);
- fOwnPageViewer.setInput(fModel.pageElements);
- fOwnPageViewer.setComparator(new ModelViewerComparator(fCategoryPageComparator));
-
- final int ICON_AND_CHECKBOX_WITH= 50;
- final int HEADER_MARGIN= 20;
- int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
- for (int i= 0; i < fModel.pageElements.size(); i++) {
- minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.pageElements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
- }
-
- nameColumn.setWidth(minNameWidth);
-
- fOwnPageViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- boolean checked= event.getChecked();
- ModelElement element= (ModelElement) event.getElement();
- element.setShouldDisplayOnOwnPage(checked);
- }
- });
-
- table.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleOwnPageTableSelection();
- }
- });
-
- }
-
- /**
- * <p>Create the Up and Down buttons for the own page viewer</p>
- * @param parent {@link Composite} to add the button list to
- */
- private void createOwnPageButtonList(Composite parent) {
- Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
-
- GridLayout layout= new GridLayout();
- layout.marginWidth= 0;
- layout.marginHeight= 0;
- composite.setLayout(layout);
-
- fPageOrderUpButton= new Button(composite, SWT.PUSH | SWT.CENTER);
- fPageOrderUpButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_PagesUp);
- fPageOrderUpButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int index = fOwnPageViewer.getTable().getSelectionIndex();
- if (index != -1) {
- fModel.movePageUp(index);
- fOwnPageViewer.refresh();
- handleOwnPageTableSelection();
- }
- }
- });
- fPageOrderUpButton.setLayoutData(new GridData());
-
- SWTUtil.setButtonDimensionHint(fPageOrderUpButton);
-
- fPageOrderDownButton= new Button(composite, SWT.PUSH | SWT.CENTER);
- fPageOrderDownButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_PagesDown);
- fPageOrderDownButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int index= fOwnPageViewer.getTable().getSelectionIndex();
- if (index != -1) {
- fModel.movePageDown(index);
- fOwnPageViewer.refresh();
- handleOwnPageTableSelection();
- }
- }
- });
- fPageOrderDownButton.setLayoutData(new GridData());
- SWTUtil.setButtonDimensionHint(fPageOrderDownButton);
- }
-
- /**
- * <p>Update the enablement of the Up and Down buttons for the own page table viewer</p>
- */
- private void handleOwnPageTableSelection() {
- ModelElement item= (ModelElement) ((IStructuredSelection) fOwnPageViewer.getSelection()).getFirstElement();
- if (item != null) {
- int index= fOwnPageViewer.getTable().getSelectionIndex();
- fPageOrderUpButton.setEnabled(index > 0);
- fPageOrderDownButton.setEnabled(index < fModel.pageElements.size() - 1);
- } else {
- fPageOrderUpButton.setEnabled(false);
- fPageOrderDownButton.setEnabled(false);
- }
- }
-
- /**
- * <p>Update the enablement of the Up and Down buttons for the default page table viewer</p>
- */
- private void handleDefaultPageTableSelection() {
- ModelElement item= (ModelElement) ((IStructuredSelection) fDefaultPageViewer.getSelection()).getFirstElement();
- if (item != null) {
- int index = fDefaultPageViewer.getTable().getSelectionIndex();
- fDefaultPageOrderUpButton.setEnabled(index > 0);
- fDefaultPageOrderDownButton.setEnabled(index < fModel.defaultPageElements.size() - 1);
- } else {
- fDefaultPageOrderUpButton.setEnabled(false);
- fDefaultPageOrderDownButton.setEnabled(false);
- }
- }
-
- private void updateCheckedState() {
- /* does not matter which set of elements we use here
- * because order does not matter in this case
- */
- final int size= fModel.pageElements.size();
- List defaultChecked= new ArrayList(size);
- List separateChecked= new ArrayList(size);
-
- for (Iterator it= fModel.pageElements.iterator(); it.hasNext();) {
- ModelElement element= (ModelElement) it.next();
- if (element.shouldDisplayOnDefaultPage())
- defaultChecked.add(element);
- if (element.shouldDisplayOnOwnPage())
- separateChecked.add(element);
- }
-
- fDefaultPageViewer.setCheckedElements(defaultChecked.toArray(new Object[defaultChecked.size()]));
- fOwnPageViewer.setCheckedElements(separateChecked.toArray(new Object[separateChecked.size()]));
- }
-
- private int computeWidth(Control control, String name) {
- if (name == null)
- return 0;
- GC gc= new GC(control);
- try {
- gc.setFont(JFaceResources.getDialogFont());
- return gc.stringExtent(name).x + 10;
- } finally {
- gc.dispose();
- }
- }
-
- private static BindingManager fgLocalBindingManager;
- static {
- fgLocalBindingManager= new BindingManager(new ContextManager(), new CommandManager());
- final IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getService(IBindingService.class);
- final Scheme[] definedSchemes= bindingService.getDefinedSchemes();
- if (definedSchemes != null) {
- try {
- for (int i = 0; i < definedSchemes.length; i++) {
- final Scheme scheme= definedSchemes[i];
- final Scheme copy= fgLocalBindingManager.getScheme(scheme.getId());
- copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId());
- }
- } catch (final NotDefinedException e) {
- Logger.logException(e);
- }
- }
- fgLocalBindingManager.setLocale(bindingService.getLocale());
- fgLocalBindingManager.setPlatform(bindingService.getPlatform());
- }
-
- private static String getKeyboardShortcut(ParameterizedCommand command) {
- IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
- fgLocalBindingManager.setBindings(bindingService.getBindings());
- try {
- Scheme activeScheme= bindingService.getActiveScheme();
- if (activeScheme != null)
- fgLocalBindingManager.setActiveScheme(activeScheme);
- } catch (NotDefinedException e) {
- Logger.logException(e);
- }
-
- TriggerSequence[] bindings= fgLocalBindingManager.getActiveBindingsDisregardingContextFor(command);
- if (bindings.length > 0)
- return bindings[0].format();
- return null;
- }
-
- /**
- * <p>Gets and image based on an image descriptor, and stores the image so it
- * does not have to be created more then once</p>
- *
- * @param imgDesc {@link ImageDescriptor} to get the {@link Image} for
- * @return {@link Image} created from the {@link ImageDescriptor}, or stored
- * {@link Image} associated with the given {@link ImageDescriptor} if an
- * {@link Image} had already been created for the given {@link ImageDescriptor}
- */
- private Image getImage(ImageDescriptor imgDesc) {
- if (imgDesc == null)
- return null;
-
- Image img= (Image) fImages.get(imgDesc);
- if (img == null) {
- img= imgDesc.createImage(false);
- fImages.put(imgDesc, img);
- }
- return img;
- }
-
- /**
- * <p>Label provider for the table for configuring which categories should be displayed on the
- * default assist page</p>
- */
- private final class DefaultPageTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0)
- return ((ModelElement) element).getImage();
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case 0:
- return ((ModelElement) element).getName();
- default:
- Assert.isTrue(false);
- return null;
- }
- }
-
- /**
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- return getColumnText(element, 0); // needed to make the sorter work
- }
- }
-
- /**
- * <p>Label provider for the table for configuring which categories should be displayed on their
- * own content assist page</p>
- */
- private final class OwnPageTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0)
- return ((ModelElement) element).getImage();
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case 0:
- return ((ModelElement) element).getName();
- default:
- Assert.isTrue(false);
- return null;
- }
- }
- }
-
- /**
- * <p>PreferenceModel used to read and write the user preferences
- * using the {@link ICompletionProposalCategoriesConfigurationWriter}</p>
- */
- private final class PreferenceModel {
- /** private modifiable page element list */
- private final List fPageElements;
-
- /** public unmodifiable page element list */
- final List pageElements;
-
- /** private modifiable default page element list */
- private final List fDefaultPageElements;
-
- /** public unmodifiable default page element list */
- final List defaultPageElements;
-
- /**
- * <p>Create the preference model for the given categories</p>
- *
- * @param categories <code>{@link List}<{@link CompletionProposalCategory}></code>
- */
- public PreferenceModel(List categories) {
- //need separate lists because they will be ordered differently
- this.fPageElements = new ArrayList();
- this.fDefaultPageElements = new ArrayList();
- for (Iterator it= categories.iterator(); it.hasNext();) {
- CompletionProposalCategory category= (CompletionProposalCategory) it.next();
- if (category.hasComputers()) {
- ModelElement elem = new ModelElement(category);
- fPageElements.add(elem);
- fDefaultPageElements.add(elem);
- }
- }
- //sort the lists
- this.performDefaults();
-
- pageElements = Collections.unmodifiableList(fPageElements);
- defaultPageElements = Collections.unmodifiableList(fDefaultPageElements);
- }
-
- /**
- * <p>Move the model element specified by the given index
- * up in the content assist page order</p>
- *
- * @param elementIndex the index of the model element to move up
- */
- public void movePageUp(int elementIndex) {
- Object removed = fPageElements.remove(elementIndex);
- fPageElements.add(elementIndex-1, removed);
-
- fConfigurationWriter.setPageOrder(getPageOrderedCategoryIDs());
- }
-
- /**
- * <p>Move the model element specified by the given index
- * down in the content assist page order</p>
- *
- * @param elementIndex the index of the model element to move up
- */
- public void movePageDown(int elementIndex) {
- Object removed = fPageElements.remove(elementIndex);
- fPageElements.add(elementIndex+1, removed);
-
- fConfigurationWriter.setPageOrder(getPageOrderedCategoryIDs());
- }
-
- /**
- * <p>Move the model element specified by the given index
- * up in the content assist page order</p>
- *
- * @param elementIndex the index of the model element to move up
- */
- public void moveDefaultPageCategoryUp(int elementIndex) {
- Object removed = fDefaultPageElements.remove(elementIndex);
- fDefaultPageElements.add(elementIndex-1, removed);
-
- fConfigurationWriter.setDefaultPageOrder(getDefaultPageOrderedCategoryIDs());
- }
-
- /**
- * <p>Move the model element specified by the given index
- * down in the content assist page order</p>
- *
- * @param elementIndex the index of the model element to move up
- */
- public void moveDefaultPageCategoryDown(int elementIndex) {
- Object removed = fDefaultPageElements.remove(elementIndex);
- fDefaultPageElements.add(elementIndex+1, removed);
-
- fConfigurationWriter.setDefaultPageOrder(getDefaultPageOrderedCategoryIDs());
- }
-
- /**
- * @return <code>{@link List}<{@link String}></code> -
- * List of category IDs by page order
- */
- private List getPageOrderedCategoryIDs() {
- List ordered = new ArrayList(pageElements.size());
- for(int i = 0; i < pageElements.size(); ++i) {
- ordered.add(((ModelElement)pageElements.get(i)).getId());
- }
-
- return ordered;
- }
-
- /**
- * @return <code>{@link List}<{@link String}></code> -
- * List of category IDs by default page order
- */
- private List getDefaultPageOrderedCategoryIDs() {
- List ordered = new ArrayList(defaultPageElements.size());
- for(int i = 0; i < defaultPageElements.size(); ++i) {
- ordered.add(((ModelElement)defaultPageElements.get(i)).getId());
- }
-
- return ordered;
- }
-
- /**
- * <p>need to re-sort the lists after performing defaults</p>
- */
- public void performDefaults() {
- Collections.sort(fPageElements, fCategoryPageComparator);
- Collections.sort(fDefaultPageElements, fCategoryDefaultPageComparator);
- }
- }
-
- /**
- * <p>Wraps a {@link CompletionProposalCategory} for use in the {@link PreferenceModel}</p>
- */
- private final class ModelElement {
- /** The wrapped category */
- private final CompletionProposalCategory fCategory;
-
- /**
- * <p>Create a new model element wrapping the given category</p>
- *
- * @param category {@link CompletionProposalCategory} to be wrapped by this model element
- * for use in the {@link PreferenceModel}
- */
- ModelElement(CompletionProposalCategory category) {
- fCategory= category;
- }
-
- /**
- * @return {@link Image} associated with the wrapped category
- */
- Image getImage() {
- return CodeAssistCyclingConfigurationBlock.this.getImage(fCategory.getImageDescriptor());
- }
-
- /**
- * @return name of the wrapped category
- */
- String getName() {
- return fCategory.getDisplayName();
- }
-
- String getId() {
- return fCategory.getId();
- }
-
- /**
- * @return <code>true</code> if the wrapped category should be displayed on the
- * default content assist page, <code>false</code> otherwise
- */
- boolean shouldDisplayOnDefaultPage() {
- return fConfigurationWriter.shouldDisplayOnDefaultPage(this.getId());
- }
-
- /**
- * @param included <code>true</code> if the wrapped category should be displayed on the
- * default content assist page, <code>false</code> otherwise
- */
- void setShouldDisplayOnDefaultPage(boolean included) {
- fConfigurationWriter.setShouldDisplayOnDefaultPage(this.getId(), included);
- }
-
- /**
- * @return <code>true</code> if the wrapped category should be displayed on the
- * its own content assist page, <code>false</code> otherwise
- */
- boolean shouldDisplayOnOwnPage() {
- return fConfigurationWriter.shouldDisplayOnOwnPage(this.getId());
- }
-
- /**
- * @param shouldDisplay <code>true</code> if the wrapped category should be displayed on the
- * its own content assist page, <code>false</code> otherwise
- */
- void setShouldDisplayOnOwnPage(boolean shouldDisplay) {
- fConfigurationWriter.setShouldDisplayOnOwnPage(this.getId(), shouldDisplay);
- }
-
- /**
- * @return the wrapped categories content assist page sort rank compared to the
- * other categories
- */
- int getOwnPageRank() {
- return fConfigurationWriter.getPageSortOrder(this.getId());
- }
-
- /**
- * @return the wrapped categories content assist page sort rank compared to the
- * other categories
- */
- int getDefaultPageRank() {
- return fConfigurationWriter.getDefaultPageSortOrder(this.getId());
- }
- }
-
- private class ModelViewerComparator extends ViewerComparator {
- /**
- *
- */
- public ModelViewerComparator(Comparator comparator) {
- super(comparator);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public int compare(Viewer viewer, Object e1, Object e2) {
- return this.getComparator().compare(e1, e2);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java
deleted file mode 100644
index 74c95df1cf..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java
+++ /dev/null
@@ -1,82 +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.wst.sse.ui.preferences;
-
-/**
- * <p>Implementers of the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
- * extension will need an implementation of this interface for their extension</p>
- *
- * <p><b>NOTE: </b>Implementers must have a 0 argument constructor so class can be instantiated by
- * extension.</p>
- *
- * @see ICompletionProposalCategoriesConfigurationWriter
- */
-public interface ICompletionProposalCategoriesConfigurationReader {
- /**
- * The default is to display a category on its own page
- * if not otherwise defined by a property.
- */
- boolean DEFAULT_DISPLAY_ON_OWN_PAGE = true;
-
- /** The default is to display a category on the default content assist page. */
- boolean DEFAULT_INCLUDE_ON_DEFAULTS_PAGE = true;
-
- /** the default sort order if none is defined by a properties extension */
- int DEFAULT_SORT_ORDER = Integer.MAX_VALUE;
-
- /**
- * <p>Determines if the given category should be displayed on its own content
- * assist page</p>
- *
- * @param categoryID determine if this category should be displayed on its own
- * content assist page
- *
- * @return <code>true</code> if the given category should be displayed on its
- * own content assist page, <code>false</code> otherwise
- */
- boolean shouldDisplayOnOwnPage(String categoryID);
-
- /**
- * <p>Determines if the given category should be displayed on the default
- * content assist page</p>
- *
- * @param categoryID determine if this category should be displayed on the
- * default content assist page
- *
- * @return <code>true</code> if the given category should be displayed on the
- * default content assist page, <code>false</code> otherwise
- */
- boolean shouldDisplayOnDefaultPage(String categoryID);
-
- /**
- * <p>Determines the sort order ranking of the given category when compared
- * to the other categories, this is used to determine the order in which
- * the separate content assist pages should be displayed</p>
- *
- * @param categoryID determine the sort order ranking of this category
- *
- * @return the sort order ranking of the given category when compared
- * to the other categories
- */
- int getPageSortOrder(String categoryID);
-
- /**
- * <p>Determines the sort order ranking of the given category when compared
- * to the other categories, this is used to determine the order in which
- * categories should be listed on the default page</p>
- *
- * @param categoryID determine the sort order ranking of this category
- *
- * @return the sort order ranking of the given category when compared
- * to the other categories
- */
- int getDefaultPageSortOrder(String categoryID);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java
deleted file mode 100644
index 0462819a28..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java
+++ /dev/null
@@ -1,119 +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.wst.sse.ui.preferences;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
-
-/**
- * <p>Implementers of the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
- * extension can implement this interface if their configuration should be user edible and thus
- * needs writing capabilities</p>
- *
- * <p><b>NOTE: </b>Implementers must have a 0 argument constructor so class can be instantiated by
- * extension.</p>
- *
- * @see ICompletionProposalCategoriesConfigurationReader
- */
-public interface ICompletionProposalCategoriesConfigurationWriter extends
- ICompletionProposalCategoriesConfigurationReader {
-
- /**
- * <p>If a writer has a known associated properties page then that properties
- * page ID can be used so that error messages during the content assist process
- * can link to that preference page to allow the user to change the settings</p>
- *
- * @return <code>true</code> if this writer has a known associated properties
- * preference page, <code>false</code> otherwise
- */
- boolean hasAssociatedPropertiesPage();
-
- /**
- * @return If {@link #hasAssociatedPropertiesPage()} returns <code>true</code> then
- * this method must return a valid properties page ID where the user can edit the
- * content assist configuration, else it can return <code>null</code>
- */
- String getPropertiesPageID();
-
- /**
- * <p>Sets whether or not the given category should be displayed on its own content
- * assist page.<p>
- *
- * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
- * should wait until {@link #saveConfiguration()} is called</p>
- *
- * @param categoryID the category that should either be displayed on its own content
- * assist page or not
- * @param shouldDisplay <code>true</code> if the given category should be displayed
- * on its own content assist page, <code>false</code> otherwise
- */
- void setShouldDisplayOnDefaultPage(String categoryID, boolean shouldDisplay);
-
- /**
- * <p>Sets whether or not the given category should be displayed on the default content
- * assist page.<p>
- *
- * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
- * should wait until {@link #saveConfiguration()} is called</p>
- *
- * @param categoryID the category that should either be displayed on the default content
- * assist page or not
- * @param shouldDisplay <code>true</code> if the given category should be displayed
- * on the default content assist page, <code>false</code> otherwise
- */
- void setShouldDisplayOnOwnPage(String categoryID, boolean shouldDisplay);
-
- /**
- * <p>Sets the order in which the categories should be cycled when invoking content
- * assist multiple times. Event categories that are not activated to display on their
- * own content assist page can be listed here so that when activated to display on their
- * own page they have a rank. The entire order needs to be re-set each time one category
- * moves because the writer has no way of knowing how to move just one category in the order</p>
- *
- * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
- * should wait until {@link #saveConfiguration()} is called</p>
- *
- * @param order <code>{@link List}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- void setPageOrder(List order);
-
- /**
- * <p>Sets the order in which the categories should be listed on the default page.
- * Event categories that are not activated to display on the default content assist
- * page can be listed here so that when activated to display on the default page
- * they have a rank. The entire order needs to be re-set each time one category
- * moves because the writer has no way of knowing how to move just one category in the order</p>
- *
- * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
- * should wait until {@link #saveConfiguration()} is called</p>
- *
- * @param order <code>{@link List}<{@link String}></code>
- * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
- */
- void setDefaultPageOrder(List order);
-
- /**
- * <p>Should load the default settings from wherever they are being stored</p>
- */
- void loadDefaults();
-
- /**
- * <p>Should save the configuration permanently. Typically called after the user
- * changes some preferences using a preference page and then applies them, but if they do
- * not apply the changes then this function should not be called. This is the reason why the
- * various <code>set*</code> methods should not permanently save the configuration</p>
- *
- * @return <code>true</code> if the save was successful, <code>false</code> otherwise
- */
- boolean saveConfiguration();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java
deleted file mode 100644
index 33ff2d8741..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java
+++ /dev/null
@@ -1,47 +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.wst.sse.ui.quickoutline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-
-/**
- * Base class that provides configuration for a quick outline.
- *
- */
-public abstract class AbstractQuickOutlineConfiguration {
-
- /**
- * Provides the label provider to be used by the quick outline
- *
- * @return an <code>ILabelProvider</code> to be used by the quick outline
- */
- public abstract ILabelProvider getLabelProvider();
-
- /**
- * Provides the content provider to be used by the quick outline
- *
- * @return a <code>ITreeContentProvider</code> to be used when providing the content of the quick outline
- */
- public abstract ITreeContentProvider getContentProvider();
-
- /**
- * Provides the content selection provider to be used by the quick outline. This allows
- * for adjusting the selection to be displayed in the outline based on the editor's selection
- *
- * @return an <code>IContentSelectionProvider</code> used by the quick outline. By default, returns
- * null indicating that the selection in the editor translates to the selection in the outline.
- */
- public IContentSelectionProvider getContentSelectionProvider() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java
deleted file mode 100644
index 11093865b7..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java
+++ /dev/null
@@ -1,44 +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.wst.sse.ui.reconcile;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-/**
- * A course listener for source viewer "reconciling" of a document
- *
- */
-public interface ISourceReconcilingListener {
-
- /**
- * Called before reconciling is started.
- */
- void aboutToBeReconciled();
-
- /**
- * Called after reconciling has been finished.
- *
- * @param document
- * the text document or <code>null</code> if reconciliation has
- * been cancelled
- * @param model
- * the annotation model that was changed or <code>null</code>
- * if reconciliation has been cancelled
- * @param forced
- * <code>true</code> iff this reconciliation was forced
- * @param progressMonitor
- * the progress monitor
- */
- void reconciled(IDocument document, IAnnotationModel model, boolean forced, IProgressMonitor progressMonitor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java
deleted file mode 100644
index 653965b727..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.sse.ui.typing;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.link.ILinkedModeListener;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI;
-import org.eclipse.jface.text.link.LinkedPosition;
-import org.eclipse.jface.text.link.LinkedPositionGroup;
-import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
-import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-abstract public class AbstractCharacterPairInserter {
-
- class ExitPolicy implements IExitPolicy {
-
- private char fExit;
- private char fEscape;
- private IDocument fDocument;
-
- public ExitPolicy(char exit, char escape, IDocument document) {
- fExit = exit;
- fEscape = escape;
- fDocument = document;
- }
-
- public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
- if(!isMasked(offset)) {
- if (event.character == fExit)
- return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
- }
- return null;
- }
-
- private boolean isMasked(int offset) {
- try {
- return fEscape == fDocument.getChar(offset - 1);
- } catch (BadLocationException e) {
- }
- return false;
- }
- }
-
- /**
- * Pair the character <code>c</code> in the source viewer <code>viewer</code>.
- * Positions are linked before and after the inserted character.
- *
- * @param viewer the source viewer to add the linked mode to
- * @param c the character to pair with
- * @return true if the character was successfully paired; false otherwise
- */
- public boolean pair(final ISourceViewer viewer, final char c) {
- if (!shouldPair(viewer, c))
- return false;
-
- final char mc = getPair(c);
- final char[] chars = new char[2];
- chars[0] = c;
- chars[1] = mc;
-
- IDocument document = viewer.getDocument();
-
- final Point selection= viewer.getSelectedRange();
- final int offset= selection.x;
- final int length= selection.y;
-
- boolean paired = false;
- try {
- document.replace(offset, length, new String(chars));
- LinkedModeModel model = new LinkedModeModel();
- LinkedPositionGroup group = new LinkedPositionGroup();
- group.addPosition(new LinkedPosition(document, offset + 1, 0, LinkedPositionGroup.NO_STOP));
- model.addGroup(group);
- model.forceInstall();
-
- LinkedModeUI ui = new LinkedModeUI(model, viewer);
- ui.setCyclingMode(LinkedModeUI.CYCLE_NEVER);
- ui.setExitPosition(viewer, offset + 2, 0, Integer.MAX_VALUE);
- ui.setExitPolicy(getExitPolicy(mc, getEscapeChar(c), document));
- ui.setSimpleMode(true);
- ui.enter();
-
- paired = true;
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- return paired;
- }
-
- /**
- * Hook to evaluate if the character should be paired. Clients may override
- * to evaluate the case.
- * @param viewer the source viewer where the character would be paired
- * @param c the character to pair
- * @return true if the character should have its pair character inserted; false otherwise
- */
- protected boolean shouldPair(ISourceViewer viewer, char c) {
- return true;
- }
-
- /**
- * Can the character be paired by the inserter
- * @param c the character of interest
- * @return true if the character can be paired by the inserter; false otherwise
- */
- abstract public boolean hasPair(char c);
-
- /**
- * Get the paired character for <code>c</code>
- * @param c the character to find the pair of
- * @return the pair character
- */
- abstract protected char getPair(char c);
-
- /**
- * Gets the escape character for <code>c</code> in case <code>c</code> is to be used
- * within the paired characters
- * @param c the character to find the escape character of
- * @return the escape character
- */
- protected char getEscapeChar(char c) {
- return 0;
- }
-
- public void initialize() {
- }
-
- public void dispose() {
- }
-
- protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
- return new ExitPolicy(exit, escape, document);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java
deleted file mode 100644
index 6b461113a2..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.views.contentoutline;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-/**
- * Basic Configuration class for Outline Pages
- *
- * @since 1.0
- */
-public abstract class ContentOutlineConfiguration {
-
- /**
- * Add a collapse action to help with navigation.
- */
- private class CollapseTreeAction extends Action {
- private TreeViewer fTreeViewer = null;
-
- public CollapseTreeAction(TreeViewer viewer) {
- super(SSEUIMessages.ContentOutlineConfiguration_0, AS_PUSH_BUTTON); //$NON-NLS-1$
- setImageDescriptor(COLLAPSE_E);
- setDisabledImageDescriptor(COLLAPSE_D);
- setToolTipText(getText());
- fTreeViewer = viewer;
- }
-
- public void run() {
- super.run();
- fTreeViewer.collapseAll();
- }
- }
-
- /**
- * Toggles whether incoming selection notification affects us
- */
- private class ToggleLinkAction extends PropertyChangeUpdateAction {
- public ToggleLinkAction(IPreferenceStore store, String preference) {
- super(SSEUIMessages.ContentOutlineConfiguration_1, store, preference, true); //$NON-NLS-1$
- setToolTipText(getText());
- setDisabledImageDescriptor(SYNCED_D);
- setImageDescriptor(SYNCED_E);
- update();
- }
-
- public void update() {
- super.update();
- setLinkWithEditor(isChecked());
- }
- }
-
- ImageDescriptor COLLAPSE_D = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_COLLAPSEALL);
- ImageDescriptor COLLAPSE_E = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_COLLAPSEALL);
-
- private boolean fIsLinkWithEditor = false;
-
- private ILabelProvider fLabelProvider;
- private IContributionItem[] fMenuContributions = null;
- private IContributionItem[] fToolbarContributions = null;
- private final String OUTLINE_LINK_PREF = "outline-link-editor"; //$NON-NLS-1$
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.sse.ui.OutlinePage"; //$NON-NLS-1$
- ImageDescriptor SYNCED_D = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_SYNCED);
- ImageDescriptor SYNCED_E = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_SYNCED);
-
- /**
- * Create new instance of ContentOutlineConfiguration
- */
- public ContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /**
- * Creates the contributions for the view's local menu. Subclasses should
- * merge their contributions with these.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return menu contributions
- */
- protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
- IContributionItem toggleLinkItem = new PropertyChangeUpdateActionContributionItem(new ToggleLinkAction(getPreferenceStore(), OUTLINE_LINK_PREF));
- IContributionItem[] items = new IContributionItem[]{toggleLinkItem};
- return items;
- }
-
- /**
- * Creates the toolbar contributions. Subclasses should merge their
- * contributions with these.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return toolbar contributions
- */
- protected IContributionItem[] createToolbarContributions(TreeViewer viewer) {
- IContributionItem collapseAllItem = new ActionContributionItem(new CollapseTreeAction(viewer));
- IContributionItem[] items = new IContributionItem[]{collapseAllItem};
- return items;
- }
-
- /**
- * Returns the ContentProvider to use with the given viewer.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return the IContentProvider to use with this viewer
- */
- public abstract IContentProvider getContentProvider(TreeViewer viewer);
-
- /**
- * Returns an array of KeyListeners to attach to the given viewer's
- * control or null.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return an array of KeyListeners to attach to the TreeViewer's Control,
- * or null. The listeners should adhere to the KeyEvent.doit field
- * to ensure proper behaviors. Ordering of the event notifications
- * is dependent on the Control in the TreeViewer.
- */
- public KeyListener[] getKeyListeners(TreeViewer viewer) {
- return null;
- }
-
- /**
- * Returns the LabelProvider for the items within the given viewer.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return the ILabelProvider for items within the viewer
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null)
- fLabelProvider = new LabelProvider();
- return fLabelProvider;
- }
-
- /**
- * Returns the menu contribution items for the local menu in the outline.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return IContributionItem[] for the local menu
- */
- public final IContributionItem[] getMenuContributions(TreeViewer viewer) {
- if (fMenuContributions == null && (viewer.getControl() != null && !viewer.getControl().isDisposed())) {
- fMenuContributions = createMenuContributions(viewer);
- }
- return fMenuContributions;
- }
-
- /**
- * Returns the menu listener to notify when the given viewer's context
- * menu is about to be shown or null.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return the IMenuListener to notify when the viewer's context menu is
- * about to be shown, or null
- */
- public IMenuListener getMenuListener(TreeViewer viewer) {
- return null;
- }
-
- /**
- * Returns the PreferenceStore to use for this configuration.
- *
- * @return the preference store in which to remember preferences (such as
- * the link-with-editor toggle state)
- */
- protected IPreferenceStore getPreferenceStore() {
- return SSEUIPlugin.getInstance().getPreferenceStore();
- }
-
- /**
- * Returns the (filtered) selection from the given selection.
- *
- * @param selection
- * model selection
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return The (filtered) selection from this event. Uses include mapping
- * model selection onto elements provided by the content provider.
- * Should only return elements that will be shown in the Tree
- * Control.
- */
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- return selection;
- }
-
- /**
- * @since 2.0
- * @param treeViewer
- * @return a label provider providing the status line contents
- */
- public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
- return null;
- }
-
- /**
- * Returns contribution items for the local toolbar in the outline.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- * @return IContributionItem[] for the local toolbar
- */
- public final IContributionItem[] getToolbarContributions(TreeViewer viewer) {
- if (fToolbarContributions == null && (viewer.getControl() != null && !viewer.getControl().isDisposed())) {
- fToolbarContributions = createToolbarContributions(viewer);
- }
- return fToolbarContributions;
- }
-
- /**
- * Adopted since you can't easily removeDragSupport from
- * StructuredViewers.
- *
- * @param treeViewer
- * the TreeViewer associated with this configuration
- * @return an array of TransferDragSourceListeners
- */
- public TransferDragSourceListener[] getTransferDragSourceListeners(TreeViewer treeViewer) {
- return new TransferDragSourceListener[0];
- }
-
- /**
- * Adopted since you can't easily removeDropSupport from
- * StructuredViewers.
- *
- * @param treeViewer
- * the TreeViewer associated with this configuration
- * @return an array of TransferDropTargetListeners
- */
- public TransferDropTargetListener[] getTransferDropTargetListeners(TreeViewer treeViewer) {
- return new TransferDropTargetListener[0];
- }
-
- /**
- * Returns true if node selection changes affect selection in the
- * TreeViewer.
- *
- * @param treeViewer
- * the TreeViewer associated with this configuration
- * @return true if outline is currently linked to selection in editor,
- * false otherwise
- */
- public boolean isLinkedWithEditor(TreeViewer treeViewer) {
- return fIsLinkWithEditor;
- }
-
- /**
- * Sets whether or not outline view should be linked with selection in
- * editor.
- *
- * @param isLinkWithEditor
- * The isLinkWithEditor to set.
- */
- void setLinkWithEditor(boolean isLinkWithEditor) {
- fIsLinkWithEditor = isLinkWithEditor;
- }
-
- /**
- * General hook for resource releasing and listener removal when
- * configurations change or the viewer is disposed of. This implementation
- * stops of any remaining PropertyChangeUpdateActionContributionItem from
- * preference listening.
- *
- * @param viewer
- * the TreeViewer associated with this configuration
- */
- public void unconfigure(TreeViewer viewer) {
- if (fToolbarContributions != null) {
- for (int i = 0; i < fToolbarContributions.length; i++) {
- if (fToolbarContributions[i] instanceof PropertyChangeUpdateActionContributionItem) {
- ((PropertyChangeUpdateActionContributionItem) fToolbarContributions[i]).disconnect();
- }
- }
- fToolbarContributions = null;
- }
- if (fMenuContributions != null) {
- for (int i = 0; i < fMenuContributions.length; i++) {
- if (fMenuContributions[i] instanceof PropertyChangeUpdateActionContributionItem) {
- ((PropertyChangeUpdateActionContributionItem) fMenuContributions[i]).disconnect();
- }
- }
- fMenuContributions = null;
- }
- }
-
- /**
- * Provides the target used when associating filters to the outline
- *
- * @return The target id used when associating filters to the outline
- */
- protected String getOutlineFilterTarget() {
- return OUTLINE_FILTER_PREF ;
- }
-
- /**
- * Returns the content outline filter processor for this configuration
- *
- * @param viewer the {@link TreeViewer} that is associated with the filter
- *
- * @return A {@link ContentOutlineFilterProcessor} to filter nodes in the outline
- */
- public ContentOutlineFilterProcessor getOutlineFilterProcessor(TreeViewer viewer){
- return new ContentOutlineFilterProcessor(getPreferenceStore(), getOutlineFilterTarget(), viewer);
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineFilterProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineFilterProcessor.java
deleted file mode 100644
index b1b61e3e33..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineFilterProcessor.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.wst.sse.ui.internal.filter.OutlineCustomFiltersDialog;
-import org.eclipse.wst.sse.ui.internal.filter.OutlineFilterDescriptor;
-import org.eclipse.wst.sse.ui.internal.filter.OutlineNamePatternFilter;
-
-/**
- * Action group to add the filter action to a view part's tool bar menu.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ContentOutlineFilterProcessor {
-
- private static final String SEPARATOR = ","; //$NON-NLS-1$
- private final String TAG_USER_DEFINED_PATTERNS_ENABLED = "userDefinedPatternsEnabled"; //$NON-NLS-1$
- private final String TAG_USER_DEFINED_PATTERNS = "userDefinedPatterns"; //$NON-NLS-1$
-
- private static class FilterItem {
- boolean enabled;
- boolean previouslyEnabled;
- OutlineFilterDescriptor descriptor;
- String id;
-
- private ViewerFilter filterInstance = null;
-
- public FilterItem(OutlineFilterDescriptor descriptor) {
- this.descriptor = descriptor;
- this.id = descriptor.getId();
- this.previouslyEnabled = false;
- this.enabled = descriptor.isEnabled();
- }
-
- public ViewerFilter getFilterInstance() {
- if (filterInstance == null) {
- filterInstance = descriptor.createViewerFilter();
- }
- return filterInstance;
-
- }
- }
-
- private final StructuredViewer fViewer;
- private final OutlineNamePatternFilter fPatternFilter;
-
- private boolean fUserDefinedPatternsEnabled;
- private String[] fUserDefinedPatterns;
-
- private String[] fPreviousPatterns;
-
- private final Map fFilterItems;
-
- private final String fTargetId;
- private IPreferenceStore fStore;
-
- /**
- * Creates a new <code>CustomFilterAction</code>.
- *
- * @param store
- * the preference Store
- * @param ownerId
- * the id of this action group's owner
- * @param viewer
- * the viewer to be filtered
- */
- public ContentOutlineFilterProcessor(IPreferenceStore store, String ownerId, StructuredViewer viewer) {
- Assert.isNotNull(ownerId);
- Assert.isNotNull(viewer);
- fStore = store;
- fTargetId = ownerId;
- fViewer = viewer;
- fPatternFilter = new OutlineNamePatternFilter();
-
- fUserDefinedPatterns = new String[0];
- fUserDefinedPatternsEnabled = false;
- fPreviousPatterns = new String[0];
-
- fFilterItems = new HashMap();
- OutlineFilterDescriptor[] filterDescriptors = OutlineFilterDescriptor.getFilterDescriptors(fTargetId);
- for (int i = 0; i < filterDescriptors.length; i++) {
- FilterItem item = new FilterItem(filterDescriptors[i]);
- fFilterItems.put(item.id, item);
-
- }
-
- initializeWithViewDefaults();
-
- updateViewerFilters();
-
- }
-
- /*
- * @see org.eclipse.jface.action.IContributionItem#isDynamic()
- */
- public boolean isDynamic() {
- return true;
- }
-
- /**
- * Returns a list of currently enabled filters. The filter is identified by
- * its id.
- * <p>
- * This method is for internal use only and should not be called by clients
- * outside of JDT/UI.
- * </p>
- *
- * @return a list of currently enabled filters
- *
- * @noreference This method is not intended to be referenced by clients.
- */
- public String[] internalGetEnabledFilterIds() {
- ArrayList enabledFilterIds = new ArrayList();
- for (Iterator iterator = fFilterItems.values().iterator(); iterator.hasNext();) {
- FilterItem item = (FilterItem) iterator.next();
- if (item.enabled) {
- enabledFilterIds.add(item.id);
- }
- }
- return (String[]) enabledFilterIds.toArray(new String[enabledFilterIds.size()]);
- }
-
- private void setEnabledFilterIds(String[] enabledIds) {
- // set all to false
- fUserDefinedPatternsEnabled = false;
- for (Iterator iterator = fFilterItems.values().iterator(); iterator.hasNext();) {
- FilterItem item = (FilterItem) iterator.next();
- item.enabled = false;
- }
- // set enabled to true
- for (int i = 0; i < enabledIds.length; i++) {
- FilterItem item = (FilterItem) fFilterItems.get(enabledIds[i]);
- if (item != null) {
- item.enabled = true;
- }
- if (fPatternFilter.getClass().getName().equals(enabledIds[i]))
- fUserDefinedPatternsEnabled = true;
- }
- }
-
- private void setUserDefinedPatterns(String[] patterns) {
- fUserDefinedPatterns = patterns;
- }
-
- private boolean areUserDefinedPatternsEnabled() {
- return fUserDefinedPatternsEnabled;
- }
-
- private void setUserDefinedPatternsEnabled(boolean state) {
- fUserDefinedPatternsEnabled = state;
- }
-
- // ---------- viewer filter handling ----------
-
- private boolean updateViewerFilters() {
- ViewerFilter[] installedFilters = fViewer.getFilters();
- ArrayList viewerFilters = new ArrayList(installedFilters.length);
-
- HashSet patterns = new HashSet();
-
- boolean hasChange = false;
- boolean patternChange = false;
-
- for (Iterator iterator = fFilterItems.values().iterator(); iterator.hasNext();) {
- FilterItem item = (FilterItem) iterator.next();
- if (item.descriptor.isCustomFilter()) {
- if (item.enabled != item.previouslyEnabled) {
- hasChange = true;
- }
- if (item.enabled) {
- ViewerFilter filter = item.getFilterInstance(); // only
- // create
- // when
- // changed
- if (filter != null) {
- viewerFilters.add(filter);
- }
- }
- } else if (item.descriptor.isPatternFilter()) {
- if (item.enabled) {
- patterns.add(item.descriptor.getPattern());
- }
- patternChange |= (item.enabled != item.previouslyEnabled);
- }
- item.previouslyEnabled = item.enabled;
- }
-
- if (areUserDefinedPatternsEnabled()) {
- for (int i = 0; i < fUserDefinedPatterns.length; i++) {
- patterns.add(fUserDefinedPatterns[i]);
- }
- }
- if (!patternChange) { // no pattern change so far, test if the user
- // patterns made a difference
- patternChange = hasChanges(patterns, fPreviousPatterns);
- }
-
- fPreviousPatterns = (String[]) patterns.toArray(new String[patterns.size()]);
- if (patternChange || hasChange) {
- fPatternFilter.setPatterns(fPreviousPatterns);
- if (patterns.isEmpty()) {
- viewerFilters.remove(fPatternFilter);
- } else if (!viewerFilters.contains(fPatternFilter)) {
- boolean contains = false;
- for (int i = 0; i < viewerFilters.size(); i++) {
- if (viewerFilters.get(i) instanceof OutlineNamePatternFilter) {
- OutlineNamePatternFilter filter = (OutlineNamePatternFilter) viewerFilters.get(i);
- String[] a1 = filter.getPatterns();
- String[] a2 = fPatternFilter.getPatterns();
- if (a1[0].equals(a2[0]))
- contains = true;
- else {
- viewerFilters.remove(i);
- }
- break;
- }
- }
- if (!contains)
- viewerFilters.add(fPatternFilter);
- }
- hasChange = true;
- }
- if (hasChange) {
- fViewer.setFilters((ViewerFilter[]) viewerFilters.toArray(new ViewerFilter[viewerFilters.size()])); // will
- // refresh
- }
- return hasChange;
- }
-
- private boolean hasChanges(HashSet patterns, String[] oldPatterns) {
- HashSet copy = (HashSet) patterns.clone();
- for (int i = 0; i < oldPatterns.length; i++) {
- boolean found = copy.remove(oldPatterns[i]);
- if (!found)
- return true;
- }
- return !copy.isEmpty();
- }
-
- // ---------- view kind/defaults persistency ----------
-
- private void initializeWithViewDefaults() {
- // get default values for view
-
- fUserDefinedPatternsEnabled = fStore.getBoolean(getPreferenceKey(TAG_USER_DEFINED_PATTERNS_ENABLED));
- setUserDefinedPatterns(OutlineCustomFiltersDialog.convertFromString(fStore.getString(getPreferenceKey(TAG_USER_DEFINED_PATTERNS)), SEPARATOR));
-
- for (Iterator iterator = fFilterItems.values().iterator(); iterator.hasNext();) {
- FilterItem item = (FilterItem) iterator.next();
- String id = item.id;
- // set default to value from plugin contributions (fixes
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73991 ):
- fStore.setDefault(id, item.descriptor.isEnabled());
- item.enabled = fStore.getBoolean(id);
- }
-
- }
-
- private void storeViewDefaults() {
- // get default values for view
-
- fStore.setValue(getPreferenceKey(TAG_USER_DEFINED_PATTERNS_ENABLED), fUserDefinedPatternsEnabled);
- fStore.setValue(getPreferenceKey(TAG_USER_DEFINED_PATTERNS), OutlineCustomFiltersDialog.convertToString(fUserDefinedPatterns, SEPARATOR));
-
- boolean fFilterSelected = false;
- for (Iterator iterator = fFilterItems.values().iterator(); iterator.hasNext();) {
- FilterItem item = (FilterItem) iterator.next();
- fStore.setValue(item.id, item.enabled);
- if (item.enabled)
- fFilterSelected = true;
- }
-
- fStore.setValue(fTargetId, fUserDefinedPatternsEnabled || fFilterSelected);
-
- }
-
- private String getPreferenceKey(String tag) {
- return "CustomFiltersActionGroup." + fTargetId + '.' + tag; //$NON-NLS-1$
- }
-
- public void openDialog() {
- OutlineCustomFiltersDialog dialog = new OutlineCustomFiltersDialog(fViewer.getControl().getShell(), fTargetId, areUserDefinedPatternsEnabled(), fUserDefinedPatterns, internalGetEnabledFilterIds());
-
- if (dialog.open() == Window.OK) {
-
- setEnabledFilterIds(dialog.getEnabledFilterIds());
- setUserDefinedPatternsEnabled(dialog.areUserDefinedPatternsEnabled());
- setUserDefinedPatterns(dialog.getUserDefinedPatterns());
- storeViewDefaults();
-
- updateViewerFilters();
- } else {
- storeViewDefaults();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java
deleted file mode 100644
index d74eee9c90..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java
+++ /dev/null
@@ -1,41 +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.sse.ui.views.properties;
-
-/**
- * Declares that this IPropertySource might support outright removal of a
- * property
- *
- * @since 1.0
- */
-public interface IPropertySourceExtension {
-
- /**
- * Returns true if the property matching the given name can be removed,
- * false otherwise.
- *
- * @param name
- * the name of the property
- * @return whether the property matching this name can be removed
- */
- boolean isPropertyRemovable(Object name);
-
- /**
- * Removes the property with the given displayed name. If no such property
- * exists, nothing is done.
- *
- * @param name
- * the displayed name of the property
- */
- void removeProperty(Object name);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java
deleted file mode 100644
index f89e38d8af..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java
+++ /dev/null
@@ -1,104 +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.sse.ui.views.properties;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-
-/**
- * Configuration class for Property Sheet Pages. Not finalized.
- *
- * @since 1.0
- */
-public abstract class PropertySheetConfiguration {
- /**
- * Create new instance of PropertySheetConfiguration
- */
- public PropertySheetConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /**
- * Adds contribution menu items to the given menuManager, toolbarManager,
- * statusLineManager.
- *
- * @param menuManager
- * the local menu manager of the property sheet
- * @param toolBarManager
- * the local toolbar manager of the property sheet
- * @param statusLineManager
- * the status line manager of the property sheet
- */
- public void addContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
- // do nothing
- }
-
- /**
- * Allows for filteration of selection before being sent to the viewer.
- *
- * @param selectingPart
- * may be null
- * @param selection
- * model selection
- * @return the (filtered) selection to be sent to the viewer
- */
- public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
- ISelection preferredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- // don't support more than one selected node
- if (((IStructuredSelection) selection).size() > 1)
- preferredSelection = StructuredSelection.EMPTY;
- }
- return preferredSelection;
- }
-
- /**
- * Returns the correct IPropertySourceProvider.
- *
- * @param page
- * the page to be configured by this configuration
- * @return the IPropertySourceProvider for the given page
- */
- public abstract IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page);
-
- /**
- * Removes contribution menu items from the given menuManager,
- * toolbarManager, statusLineManager.
- *
- * @param menuManager
- * the local menu manager of the property sheet
- * @param toolBarManager
- * the local toolbar manager of the property sheet
- * @param statusLineManager
- * the status line manager of the property sheet
- */
- public void removeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
- // do nothing
- }
-
- /**
- * General hook for resource releasing and listener removal when
- * configurations change.
- */
- public void unconfigure() {
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/testToc.xml b/bundles/org.eclipse.wst.sse.ui/testToc.xml
deleted file mode 100644
index 6142b90182..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/testToc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc
- label="Test TOC"
- topic="html/toc.html">
- <link toc="toc.xml" />
-</toc> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/toc.xml b/bundles/org.eclipse.wst.sse.ui/toc.xml
deleted file mode 100644
index a5c0bb6c2b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/toc.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Sample Table of Contents">
- <topic
- label="Main Topic"
- href="html/maintopic.html">
- <topic
- label="Sub Topic"
- href="html/subtopic.html" />
- </topic>
- <topic label="Main Topic 2" />
-</toc>
diff --git a/bundles/org.eclipse.wst.standard.schemas/.cvsignore b/bundles/org.eclipse.wst.standard.schemas/.cvsignore
deleted file mode 100644
index acd4764f61..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-
-build.xml
diff --git a/bundles/org.eclipse.wst.standard.schemas/.project b/bundles/org.eclipse.wst.standard.schemas/.project
deleted file mode 100644
index c587d8212a..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.standard.schemas</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 21d0e95af8..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon May 14 22:44:45 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 47925bda71..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Wed Jun 15 14:14:46 EDT 2005
-compilers.p.deprecated=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF
deleted file mode 100644
index 8b453e13eb..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,9 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.standard.schemas;singleton:=true
-Bundle-Version: 1.0.401.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.wst.xml.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,2.0.0)"
diff --git a/bundles/org.eclipse.wst.standard.schemas/about.html b/bundles/org.eclipse.wst.standard.schemas/about.html
deleted file mode 100644
index 3a72b510b1..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/about.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<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/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</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>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third
-parties as set out below. If you did not receive this Content directly
-from the Eclipse Foundation, the following is provided for informational
-purposes only, and you should look to the Redistributor's license for
-terms and conditions of use.</p>
-
-<h4>Open Mobile Alliance DTDs</h4>
-
-<p>The plug-in is accompanied by document type definitions
-(&quot;WAP DTDs&quot;) defined by the Wireless Application Protocol
-(WAP) Forum. The WAP Forum has now been consolidated into the Open
-Mobile Alliance (OMA). The WAP DTDs are the following files located in
-the plug-in:</p>
-<ul>
- <li><strong>wml11.dtd</strong> obtained from <a
- href="http://www.wapforum.org/DTD/wml_1.1.xml" target="_blank">http://www.wapforum.org/DTD/wml_1.1.xml</a></li>
- <li><strong>wml13.dtd</strong> obtained from <a
- href="http://www.wapforum.org/DTD/wml13.dtd" target="_blank">http://www.wapforum.org/DTD/wml13.dtd</a></li>
- <li><strong>xhtml-mobile10-flat.dtd</strong> obtained from <a
- href="http://www.wapforum.org/DTD/xhtml-mobile10.dtd" target="_blank">http://www.wapforum.org/DTD/xhtml-mobile10.dtd</a></li>
-</ul>
-
-<p>Your use of the WAP DTDs is governed by the terms and conditions
-of the EPL.</p>
-
-<p>More information about the WAP and the OMA is available at <a
- href="http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html">http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html</a>.</p>
-
-<h4>W3C DTDs</h4>
-
-<p>The plug-in is accompanied by document type definitions (&quot;
-W3C DTDs&quot;) defined by the the W3C Extensible HyperText Markup
-Language (XHTML) 1.1. XHTML is described at <a
- href="http://www.w3.org/TR/xhtml11/">http://www.w3.org/TR/xhtml11/</a>.</p>
-The W3C DTDs are the following files located in the plug-in:
-<p>
-<ul>
- <li><strong>xhtml11-flat.dtd</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" target="_blank">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</a></li>
- <li><strong>xhtml1-frameset.dtd</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
- target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</a></li>
- <li><strong>xhtml1-strict</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a></li>
- <li><strong>xhtml1-transitional.dtd</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
- target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a></li>
- <li><strong>xhtml-basic10-f.dtd</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"
- target="_blank">http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd</a></li>
- <li><strong>xhtml-lat1.ent</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</a></li>
- <li><strong>xhtml-special.ent</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
- target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</a></li>
- <li><strong>xhtml-symbol.ent</strong> obtained from <a
- href="http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"
- target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</a></li>
-</ul>
-
-<p>As described in section 5.10 of the FAQ located at <a
- href="http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD"
- target="_blank">http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD</a>,
-your use of the W3C DTDs is governed by the terms and conditions of the
-W3C Software License a copy of which is included in the file <a
- href="about_files/copyright-software-19980720.htm">about_files/copyright-software-19980720.htm</a>
-and is also available at <a
- href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
- target="_blank">http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>.</p>
-<h4>WSDL Schemas</h4>
-
-<p>The plug-in is accompanied by five schema files. Your use of the
-following files located in the xsd directory of the plug-in:</p>
-
-<ul>
- <li><strong>http.xsd</strong> obtained from <a
- href="http://schemas.xmlsoap.org/wsdl/http/" target="_blank">http://schemas.xmlsoap.org/wsdl/http/</a></li>
- <li><strong>soap.xsd</strong> obtained from <a
- href="http://schemas.xmlsoap.org/wsdl/soap/" target="_blank">http://schemas.xmlsoap.org/wsdl/soap/</a></li>
- <li><strong>wsdl.xsd</strong> obtained from <a
- href="http://schemas.xmlsoap.org/wsdl/" target="_blank">http://schemas.xmlsoap.org/wsdl/</a></li>
- <li><strong>wsdl-mine.xsd</strong> obtained from <a
- href="http://schemas.xmlsoap.org/wsdl/mime/" target="_blank">http://schemas.xmlsoap.org/wsdl/mime/</a></li>
-</ul>
-
-<p>is governed by the terms and conditions of the &quot;License for
-WSDL Schema Files&quot; a copy which is located in <a
- href="about_files/wsdl-schema-files-license.txt">about_files/wsdl-schema-files-license.txt</a>.</p>
-
-<p>The following file located in the xsd directory of the plug-in:
-<p>
-<ul>
- <li><strong>soap-enc.xsd</strong>
-</ul>
-
-<p>is governed by the terms and conditions of the W3C Software
-License as described in section 5.10 of the FAQ located at <a
- href="http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD"
- target="_blank">http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD</a>.
-A copy of the W3C Software License is located in <a
- href="about_files/copyright-software-19980720.htm">about_files/copyright-software-19980720.htm</a>
-and is also available at <a
- href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
- target="_blank">http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>.</p>
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720.htm b/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720.htm
deleted file mode 100644
index 502ac7d614..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-
-
-<meta name="generator" content="HTML Tidy, see www.w3.org">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" type="text/css" href="copyright-software-19980720_files/base.css"><title>W3C IPR SOFTWARE NOTICE</title></head><body bgcolor="#ffffff" text="#000000">
-<h1>W3C<sup>®</sup> SOFTWARE NOTICE AND LICENSE</h1>
-
-<h3>Copyright © 1994-2002 <a href="http://www.w3.org/">World
-Wide Web Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts Institute of
-Technology</a>, <a href="http://www.inria.fr/">Institut National de
-Recherche en Informatique et en Automatique</a>, <a href="http://www.keio.ac.jp/">Keio University</a>). All Rights
-Reserved. http://www.w3.org/Consortium/Legal/</h3>
-
-<p>This W3C work (including software, documents, or other related
-items) is being provided by the copyright holders under the
-following license. By obtaining, using and/or copying this work,
-you (the licensee) agree that you have read, understood, and will
-comply with the following terms and conditions:</p>
-
-<p>Permission to use, copy, modify, and distribute this software
-and its documentation, with or without modification,&nbsp; for any
-purpose and without fee or royalty is hereby granted, provided that
-you include the following on ALL copies of the software and
-documentation or portions thereof, including modifications, that
-you make:</p>
-
-<ol>
-<li>The full text of this NOTICE in a location viewable to users of
-the redistributed or derivative work.</li>
-
-<li>Any pre-existing intellectual property disclaimers, notices, or
-terms and conditions. If none exist, a short notice of the
-following form (hypertext is preferred, text is permitted) should
-be used within the body of any redistributed or derivative code:
-"Copyright © [$date-of-software] <a href="http://www.w3.org/">World Wide Web Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts Institute of
-Technology</a>, <a href="http://www.inria.fr/">Institut National de
-Recherche en Informatique et en Automatique</a>, <a href="http://www.keio.ac.jp/">Keio University</a>). All Rights
-Reserved. http://www.w3.org/Consortium/Legal/"</li>
-
-<li>Notice of any changes or modifications to the W3C files,
-including the date changes were made. (We recommend you provide
-URIs to the location from which the code is derived.)</li>
-</ol>
-
-<p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND
-COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
-USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
-PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
-
-<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
-SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
-SOFTWARE OR DOCUMENTATION.</p>
-
-<p>The name and trademarks of copyright holders may NOT be used in
-advertising or publicity pertaining to the software without
-specific, written prior permission. Title to copyright in this
-software and any associated documentation will at all times remain
-with copyright holders.</p>
-
-<p>____________________________________</p>
-
-<p>This formulation of W3C's notice and license became active on
-August 14 1998 so as to improve compatibility with GPL. This
-version ensures that W3C software licensing terms are no more
-restrictive than GPL and consequently W3C software may be
-distributed in GPL packages. See the <a href="http://www.w3.org/Consortium/Legal/copyright-software-19980519.html">older formulation</a> for
-the policy prior to this date. Please see our <a href="http://www.w3.org/Consortium/Legal/IPR-FAQ.html">Copyright FAQ</a> for common questions about
-using materials from our site, including specific terms and
-conditions for packages like libwww, Amaya, and Jigsaw. Other
-questions about this notice can be directed to <a href="mailto:site-policy@w3.org">site-policy@w3.org</a>.<br>
-&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<address><a href="http://www.w3.org/Help/Webmaster.html">webmaster</a><br>
- (last updated $Date: 2007/05/15 02:42:24 $)</address>
-
-</body></html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720_files/base.css b/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720_files/base.css
deleted file mode 100644
index ce57ac6bce..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720_files/base.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright 1997-2003 W3C (MIT, ERCIM, Keio). All Rights Reserved.
- The following software licensing rules apply:
- http://www.w3.org/Consortium/Legal/copyright-software */
-
-/* $Id: base.css,v 1.1 2007/05/15 02:42:24 david_williams Exp $ */
-
-/* this style sheet defines the basic style for all W3C pages */
-/* you can point to this by adding:
-
- <LINK rel="Stylesheet" href="/StyleSheets/base">
-
-
- in the HEAD of your HTML document */
-
-body {
- font-family: sans-serif;
- color: black;
- background: white;
-}
-
-a:link, a:active {
- color: #00e;
- background: transparent;
-}
-
-a:visited {
- color: #529;
- background: transparent;
-}
-
-div.intro {
- margin-left: 5%;
- margin-right: 5%;
- font-style: italic
-}
-
-pre {
- font-family: monospace
-}
-
-a:link img, a:visited img {
- border-style: none
-}
-
-a img { color: white; } /* hide the border in Netscape 4 */
-@media all { /* hide from Netscape 4 */
- a img { color: inherit; } /* undo the rule above */
-}
-
-ul.toc, ol.toc {
- list-style: disc;
- list-style: none;
-}
-
-div.issue {
- padding: 0.5em;
- border: none;
- margin-right: 5%;
-}
-
-.hideme { display: none }
-
-@media print {
-
- table {
- page-break-inside: avoid
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/about_files/wsdl-schema-files-license.txt b/bundles/org.eclipse.wst.standard.schemas/about_files/wsdl-schema-files-license.txt
deleted file mode 100644
index b95f81f9d9..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/about_files/wsdl-schema-files-license.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
-All Rights Reserved
-
-License for WSDL Schema Files
-
-The Authors grant permission to copy and distribute the WSDL Schema
-Files in any medium without fee or royalty as long as this notice and
-license are distributed with them. The originals of these files can
-be located at:
-
- http://schemas.xmlsoap.org/wsdl/http/
- http://schemas.xmlsoap.org/wsdl/soap/
- http://schemas.xmlsoap.org/wsdl/
- http://schemas.xmlsoap.org/wsdl/mime/
-
-
-THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
-OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
-INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
-RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to these files or any program
-or service that uses these files, written prior permission. Title to copyright
-in these files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
diff --git a/bundles/org.eclipse.wst.standard.schemas/build.properties b/bundles/org.eclipse.wst.standard.schemas/build.properties
deleted file mode 100644
index f16450e565..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/build.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-bin.includes = plugin.xml,\
- dtds/,\
- plugin.properties,\
- META-INF/,\
- about.html,\
- about_files/,\
- xsd/
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = xsd/,\
- dtds/,\
- about_files/,\
- about.html
-generateSourceBundle=false
-
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent
deleted file mode 100644
index c644486047..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent
+++ /dev/null
@@ -1,194 +0,0 @@
-<!-- Portions (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1//EN//HTML">
- %HTMLlat1;
--->
-
-<!ENTITY nbsp CDATA "&#160;" -- no-break space = non-breaking space,
- U+00A0 ISOnum -->
-<!ENTITY iexcl CDATA "&#161;" -- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent CDATA "&#162;" -- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound CDATA "&#163;" -- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren CDATA "&#164;" -- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen CDATA "&#165;" -- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar CDATA "&#166;" -- broken bar = broken vertical bar,
- U+00A6 ISOnum -->
-<!ENTITY sect CDATA "&#167;" -- section sign, U+00A7 ISOnum -->
-<!ENTITY uml CDATA "&#168;" -- diaeresis = spacing diaeresis,
- U+00A8 ISOdia -->
-<!ENTITY copy CDATA "&#169;" -- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf CDATA "&#170;" -- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo CDATA "&#171;" -- left-pointing double angle quotation mark
- = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not CDATA "&#172;" -- not sign, U+00AC ISOnum -->
-<!ENTITY shy CDATA "&#173;" -- soft hyphen = discretionary hyphen,
- U+00AD ISOnum -->
-<!ENTITY reg CDATA "&#174;" -- registered sign = registered trade mark sign,
- U+00AE ISOnum -->
-<!ENTITY macr CDATA "&#175;" -- macron = spacing macron = overline
- = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg CDATA "&#176;" -- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn CDATA "&#177;" -- plus-minus sign = plus-or-minus sign,
- U+00B1 ISOnum -->
-<!ENTITY sup2 CDATA "&#178;" -- superscript two = superscript digit two
- = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 CDATA "&#179;" -- superscript three = superscript digit three
- = cubed, U+00B3 ISOnum -->
-<!ENTITY acute CDATA "&#180;" -- acute accent = spacing acute,
- U+00B4 ISOdia -->
-<!ENTITY micro CDATA "&#181;" -- micro sign, U+00B5 ISOnum -->
-<!ENTITY para CDATA "&#182;" -- pilcrow sign = paragraph sign,
- U+00B6 ISOnum -->
-<!ENTITY middot CDATA "&#183;" -- middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil CDATA "&#184;" -- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 CDATA "&#185;" -- superscript one = superscript digit one,
- U+00B9 ISOnum -->
-<!ENTITY ordm CDATA "&#186;" -- masculine ordinal indicator,
- U+00BA ISOnum -->
-<!ENTITY raquo CDATA "&#187;" -- right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 CDATA "&#188;" -- vulgar fraction one quarter
- = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 CDATA "&#189;" -- vulgar fraction one half
- = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 CDATA "&#190;" -- vulgar fraction three quarters
- = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest CDATA "&#191;" -- inverted question mark
- = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave CDATA "&#192;" -- latin capital letter A with grave
- = latin capital letter A grave,
- U+00C0 ISOlat1 -->
-<!ENTITY Aacute CDATA "&#193;" -- latin capital letter A with acute,
- U+00C1 ISOlat1 -->
-<!ENTITY Acirc CDATA "&#194;" -- latin capital letter A with circumflex,
- U+00C2 ISOlat1 -->
-<!ENTITY Atilde CDATA "&#195;" -- latin capital letter A with tilde,
- U+00C3 ISOlat1 -->
-<!ENTITY Auml CDATA "&#196;" -- latin capital letter A with diaeresis,
- U+00C4 ISOlat1 -->
-<!ENTITY Aring CDATA "&#197;" -- latin capital letter A with ring above
- = latin capital letter A ring,
- U+00C5 ISOlat1 -->
-<!ENTITY AElig CDATA "&#198;" -- latin capital letter AE
- = latin capital ligature AE,
- U+00C6 ISOlat1 -->
-<!ENTITY Ccedil CDATA "&#199;" -- latin capital letter C with cedilla,
- U+00C7 ISOlat1 -->
-<!ENTITY Egrave CDATA "&#200;" -- latin capital letter E with grave,
- U+00C8 ISOlat1 -->
-<!ENTITY Eacute CDATA "&#201;" -- latin capital letter E with acute,
- U+00C9 ISOlat1 -->
-<!ENTITY Ecirc CDATA "&#202;" -- latin capital letter E with circumflex,
- U+00CA ISOlat1 -->
-<!ENTITY Euml CDATA "&#203;" -- latin capital letter E with diaeresis,
- U+00CB ISOlat1 -->
-<!ENTITY Igrave CDATA "&#204;" -- latin capital letter I with grave,
- U+00CC ISOlat1 -->
-<!ENTITY Iacute CDATA "&#205;" -- latin capital letter I with acute,
- U+00CD ISOlat1 -->
-<!ENTITY Icirc CDATA "&#206;" -- latin capital letter I with circumflex,
- U+00CE ISOlat1 -->
-<!ENTITY Iuml CDATA "&#207;" -- latin capital letter I with diaeresis,
- U+00CF ISOlat1 -->
-<!ENTITY ETH CDATA "&#208;" -- latin capital letter ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde CDATA "&#209;" -- latin capital letter N with tilde,
- U+00D1 ISOlat1 -->
-<!ENTITY Ograve CDATA "&#210;" -- latin capital letter O with grave,
- U+00D2 ISOlat1 -->
-<!ENTITY Oacute CDATA "&#211;" -- latin capital letter O with acute,
- U+00D3 ISOlat1 -->
-<!ENTITY Ocirc CDATA "&#212;" -- latin capital letter O with circumflex,
- U+00D4 ISOlat1 -->
-<!ENTITY Otilde CDATA "&#213;" -- latin capital letter O with tilde,
- U+00D5 ISOlat1 -->
-<!ENTITY Ouml CDATA "&#214;" -- latin capital letter O with diaeresis,
- U+00D6 ISOlat1 -->
-<!ENTITY times CDATA "&#215;" -- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash CDATA "&#216;" -- latin capital letter O with stroke
- = latin capital letter O slash,
- U+00D8 ISOlat1 -->
-<!ENTITY Ugrave CDATA "&#217;" -- latin capital letter U with grave,
- U+00D9 ISOlat1 -->
-<!ENTITY Uacute CDATA "&#218;" -- latin capital letter U with acute,
- U+00DA ISOlat1 -->
-<!ENTITY Ucirc CDATA "&#219;" -- latin capital letter U with circumflex,
- U+00DB ISOlat1 -->
-<!ENTITY Uuml CDATA "&#220;" -- latin capital letter U with diaeresis,
- U+00DC ISOlat1 -->
-<!ENTITY Yacute CDATA "&#221;" -- latin capital letter Y with acute,
- U+00DD ISOlat1 -->
-<!ENTITY THORN CDATA "&#222;" -- latin capital letter THORN,
- U+00DE ISOlat1 -->
-<!ENTITY szlig CDATA "&#223;" -- latin small letter sharp s = ess-zed,
- U+00DF ISOlat1 -->
-<!ENTITY agrave CDATA "&#224;" -- latin small letter a with grave
- = latin small letter a grave,
- U+00E0 ISOlat1 -->
-<!ENTITY aacute CDATA "&#225;" -- latin small letter a with acute,
- U+00E1 ISOlat1 -->
-<!ENTITY acirc CDATA "&#226;" -- latin small letter a with circumflex,
- U+00E2 ISOlat1 -->
-<!ENTITY atilde CDATA "&#227;" -- latin small letter a with tilde,
- U+00E3 ISOlat1 -->
-<!ENTITY auml CDATA "&#228;" -- latin small letter a with diaeresis,
- U+00E4 ISOlat1 -->
-<!ENTITY aring CDATA "&#229;" -- latin small letter a with ring above
- = latin small letter a ring,
- U+00E5 ISOlat1 -->
-<!ENTITY aelig CDATA "&#230;" -- latin small letter ae
- = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil CDATA "&#231;" -- latin small letter c with cedilla,
- U+00E7 ISOlat1 -->
-<!ENTITY egrave CDATA "&#232;" -- latin small letter e with grave,
- U+00E8 ISOlat1 -->
-<!ENTITY eacute CDATA "&#233;" -- latin small letter e with acute,
- U+00E9 ISOlat1 -->
-<!ENTITY ecirc CDATA "&#234;" -- latin small letter e with circumflex,
- U+00EA ISOlat1 -->
-<!ENTITY euml CDATA "&#235;" -- latin small letter e with diaeresis,
- U+00EB ISOlat1 -->
-<!ENTITY igrave CDATA "&#236;" -- latin small letter i with grave,
- U+00EC ISOlat1 -->
-<!ENTITY iacute CDATA "&#237;" -- latin small letter i with acute,
- U+00ED ISOlat1 -->
-<!ENTITY icirc CDATA "&#238;" -- latin small letter i with circumflex,
- U+00EE ISOlat1 -->
-<!ENTITY iuml CDATA "&#239;" -- latin small letter i with diaeresis,
- U+00EF ISOlat1 -->
-<!ENTITY eth CDATA "&#240;" -- latin small letter eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde CDATA "&#241;" -- latin small letter n with tilde,
- U+00F1 ISOlat1 -->
-<!ENTITY ograve CDATA "&#242;" -- latin small letter o with grave,
- U+00F2 ISOlat1 -->
-<!ENTITY oacute CDATA "&#243;" -- latin small letter o with acute,
- U+00F3 ISOlat1 -->
-<!ENTITY ocirc CDATA "&#244;" -- latin small letter o with circumflex,
- U+00F4 ISOlat1 -->
-<!ENTITY otilde CDATA "&#245;" -- latin small letter o with tilde,
- U+00F5 ISOlat1 -->
-<!ENTITY ouml CDATA "&#246;" -- latin small letter o with diaeresis,
- U+00F6 ISOlat1 -->
-<!ENTITY divide CDATA "&#247;" -- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash CDATA "&#248;" -- latin small letter o with stroke,
- = latin small letter o slash,
- U+00F8 ISOlat1 -->
-<!ENTITY ugrave CDATA "&#249;" -- latin small letter u with grave,
- U+00F9 ISOlat1 -->
-<!ENTITY uacute CDATA "&#250;" -- latin small letter u with acute,
- U+00FA ISOlat1 -->
-<!ENTITY ucirc CDATA "&#251;" -- latin small letter u with circumflex,
- U+00FB ISOlat1 -->
-<!ENTITY uuml CDATA "&#252;" -- latin small letter u with diaeresis,
- U+00FC ISOlat1 -->
-<!ENTITY yacute CDATA "&#253;" -- latin small letter y with acute,
- U+00FD ISOlat1 -->
-<!ENTITY thorn CDATA "&#254;" -- latin small letter thorn,
- U+00FE ISOlat1 -->
-<!ENTITY yuml CDATA "&#255;" -- latin small letter y with diaeresis,
- U+00FF ISOlat1 --> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent
deleted file mode 100644
index 5ce5c6ad01..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent
+++ /dev/null
@@ -1,77 +0,0 @@
-<!-- Special characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML">
- %HTMLspecial; -->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. CDATA values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are ISO 10646 names.
-
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY quot CDATA "&#34;" -- quotation mark = APL quote,
- U+0022 ISOnum -->
-<!ENTITY amp CDATA "&#38;" -- ampersand, U+0026 ISOnum -->
-<!ENTITY lt CDATA "&#60;" -- less-than sign, U+003C ISOnum -->
-<!ENTITY gt CDATA "&#62;" -- greater-than sign, U+003E ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig CDATA "&#338;" -- latin capital ligature OE,
- U+0152 ISOlat2 -->
-<!ENTITY oelig CDATA "&#339;" -- latin small ligature oe, U+0153 ISOlat2 -->
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron CDATA "&#352;" -- latin capital letter S with caron,
- U+0160 ISOlat2 -->
-<!ENTITY scaron CDATA "&#353;" -- latin small letter s with caron,
- U+0161 ISOlat2 -->
-<!ENTITY Yuml CDATA "&#376;" -- latin capital letter Y with diaeresis,
- U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ CDATA "&#710;" -- modifier letter circumflex accent,
- U+02C6 ISOpub -->
-<!ENTITY tilde CDATA "&#732;" -- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp CDATA "&#8194;" -- en space, U+2002 ISOpub -->
-<!ENTITY emsp CDATA "&#8195;" -- em space, U+2003 ISOpub -->
-<!ENTITY thinsp CDATA "&#8201;" -- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj CDATA "&#8204;" -- zero width non-joiner,
- U+200C NEW RFC 2070 -->
-<!ENTITY zwj CDATA "&#8205;" -- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm CDATA "&#8206;" -- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm CDATA "&#8207;" -- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash CDATA "&#8211;" -- en dash, U+2013 ISOpub -->
-<!ENTITY mdash CDATA "&#8212;" -- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo CDATA "&#8216;" -- left single quotation mark,
- U+2018 ISOnum -->
-<!ENTITY rsquo CDATA "&#8217;" -- right single quotation mark,
- U+2019 ISOnum -->
-<!ENTITY sbquo CDATA "&#8218;" -- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo CDATA "&#8220;" -- left double quotation mark,
- U+201C ISOnum -->
-<!ENTITY rdquo CDATA "&#8221;" -- right double quotation mark,
- U+201D ISOnum -->
-<!ENTITY bdquo CDATA "&#8222;" -- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger CDATA "&#8224;" -- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger CDATA "&#8225;" -- double dagger, U+2021 ISOpub -->
-<!ENTITY permil CDATA "&#8240;" -- per mille sign, U+2030 ISOtech -->
-<!ENTITY lsaquo CDATA "&#8249;" -- single left-pointing angle quotation mark,
- U+2039 ISO proposed -->
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo CDATA "&#8250;" -- single right-pointing angle quotation mark,
- U+203A ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY euro CDATA "&#8364;" -- euro sign, U+20AC NEW --> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent
deleted file mode 100644
index 524bfe11bc..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent
+++ /dev/null
@@ -1,241 +0,0 @@
-<!-- Mathematical, Greek and Symbolic characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols//EN//HTML">
- %HTMLsymbol; -->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. CDATA values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are ISO 10646 names.
-
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof CDATA "&#402;" -- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha CDATA "&#913;" -- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta CDATA "&#914;" -- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma CDATA "&#915;" -- greek capital letter gamma,
- U+0393 ISOgrk3 -->
-<!ENTITY Delta CDATA "&#916;" -- greek capital letter delta,
- U+0394 ISOgrk3 -->
-<!ENTITY Epsilon CDATA "&#917;" -- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta CDATA "&#918;" -- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta CDATA "&#919;" -- greek capital letter eta, U+0397 -->
-<!ENTITY Theta CDATA "&#920;" -- greek capital letter theta,
- U+0398 ISOgrk3 -->
-<!ENTITY Iota CDATA "&#921;" -- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa CDATA "&#922;" -- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda CDATA "&#923;" -- greek capital letter lambda,
- U+039B ISOgrk3 -->
-<!ENTITY Mu CDATA "&#924;" -- greek capital letter mu, U+039C -->
-<!ENTITY Nu CDATA "&#925;" -- greek capital letter nu, U+039D -->
-<!ENTITY Xi CDATA "&#926;" -- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron CDATA "&#927;" -- greek capital letter omicron, U+039F -->
-<!ENTITY Pi CDATA "&#928;" -- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho CDATA "&#929;" -- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma CDATA "&#931;" -- greek capital letter sigma,
- U+03A3 ISOgrk3 -->
-<!ENTITY Tau CDATA "&#932;" -- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon CDATA "&#933;" -- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi CDATA "&#934;" -- greek capital letter phi,
- U+03A6 ISOgrk3 -->
-<!ENTITY Chi CDATA "&#935;" -- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi CDATA "&#936;" -- greek capital letter psi,
- U+03A8 ISOgrk3 -->
-<!ENTITY Omega CDATA "&#937;" -- greek capital letter omega,
- U+03A9 ISOgrk3 -->
-
-<!ENTITY alpha CDATA "&#945;" -- greek small letter alpha,
- U+03B1 ISOgrk3 -->
-<!ENTITY beta CDATA "&#946;" -- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma CDATA "&#947;" -- greek small letter gamma,
- U+03B3 ISOgrk3 -->
-<!ENTITY delta CDATA "&#948;" -- greek small letter delta,
- U+03B4 ISOgrk3 -->
-<!ENTITY epsilon CDATA "&#949;" -- greek small letter epsilon,
- U+03B5 ISOgrk3 -->
-<!ENTITY zeta CDATA "&#950;" -- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta CDATA "&#951;" -- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta CDATA "&#952;" -- greek small letter theta,
- U+03B8 ISOgrk3 -->
-<!ENTITY iota CDATA "&#953;" -- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa CDATA "&#954;" -- greek small letter kappa,
- U+03BA ISOgrk3 -->
-<!ENTITY lambda CDATA "&#955;" -- greek small letter lambda,
- U+03BB ISOgrk3 -->
-<!ENTITY mu CDATA "&#956;" -- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu CDATA "&#957;" -- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi CDATA "&#958;" -- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron CDATA "&#959;" -- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi CDATA "&#960;" -- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho CDATA "&#961;" -- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf CDATA "&#962;" -- greek small letter final sigma,
- U+03C2 ISOgrk3 -->
-<!ENTITY sigma CDATA "&#963;" -- greek small letter sigma,
- U+03C3 ISOgrk3 -->
-<!ENTITY tau CDATA "&#964;" -- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon CDATA "&#965;" -- greek small letter upsilon,
- U+03C5 ISOgrk3 -->
-<!ENTITY phi CDATA "&#966;" -- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi CDATA "&#967;" -- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi CDATA "&#968;" -- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega CDATA "&#969;" -- greek small letter omega,
- U+03C9 ISOgrk3 -->
-<!ENTITY thetasym CDATA "&#977;" -- greek small letter theta symbol,
- U+03D1 NEW -->
-<!ENTITY upsih CDATA "&#978;" -- greek upsilon with hook symbol,
- U+03D2 NEW -->
-<!ENTITY piv CDATA "&#982;" -- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull CDATA "&#8226;" -- bullet = black small circle,
- U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip CDATA "&#8230;" -- horizontal ellipsis = three dot leader,
- U+2026 ISOpub -->
-<!ENTITY prime CDATA "&#8242;" -- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime CDATA "&#8243;" -- double prime = seconds = inches,
- U+2033 ISOtech -->
-<!ENTITY oline CDATA "&#8254;" -- overline = spacing overscore,
- U+203E NEW -->
-<!ENTITY frasl CDATA "&#8260;" -- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp CDATA "&#8472;" -- script capital P = power set
- = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image CDATA "&#8465;" -- blackletter capital I = imaginary part,
- U+2111 ISOamso -->
-<!ENTITY real CDATA "&#8476;" -- blackletter capital R = real part symbol,
- U+211C ISOamso -->
-<!ENTITY trade CDATA "&#8482;" -- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym CDATA "&#8501;" -- alef symbol = first transfinite cardinal,
- U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef,
- U+05D0 although the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr CDATA "&#8592;" -- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr CDATA "&#8593;" -- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr CDATA "&#8594;" -- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr CDATA "&#8595;" -- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr CDATA "&#8596;" -- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr CDATA "&#8629;" -- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr CDATA "&#8656;" -- leftwards double arrow, U+21D0 ISOtech -->
-<!-- ISO 10646 does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr CDATA "&#8657;" -- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr CDATA "&#8658;" -- rightwards double arrow,
- U+21D2 ISOtech -->
-<!-- ISO 10646 does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr CDATA "&#8659;" -- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr CDATA "&#8660;" -- left right double arrow,
- U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall CDATA "&#8704;" -- for all, U+2200 ISOtech -->
-<!ENTITY part CDATA "&#8706;" -- partial differential, U+2202 ISOtech -->
-<!ENTITY exist CDATA "&#8707;" -- there exists, U+2203 ISOtech -->
-<!ENTITY empty CDATA "&#8709;" -- empty set = null set = diameter,
- U+2205 ISOamso -->
-<!ENTITY nabla CDATA "&#8711;" -- nabla = backward difference,
- U+2207 ISOtech -->
-<!ENTITY isin CDATA "&#8712;" -- element of, U+2208 ISOtech -->
-<!ENTITY notin CDATA "&#8713;" -- not an element of, U+2209 ISOtech -->
-<!ENTITY ni CDATA "&#8715;" -- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod CDATA "&#8719;" -- n-ary product = product sign,
- U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum CDATA "&#8721;" -- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus CDATA "&#8722;" -- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast CDATA "&#8727;" -- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic CDATA "&#8730;" -- square root = radical sign,
- U+221A ISOtech -->
-<!ENTITY prop CDATA "&#8733;" -- proportional to, U+221D ISOtech -->
-<!ENTITY infin CDATA "&#8734;" -- infinity, U+221E ISOtech -->
-<!ENTITY ang CDATA "&#8736;" -- angle, U+2220 ISOamso -->
-<!ENTITY and CDATA "&#8743;" -- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or CDATA "&#8744;" -- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap CDATA "&#8745;" -- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup CDATA "&#8746;" -- union = cup, U+222A ISOtech -->
-<!ENTITY int CDATA "&#8747;" -- integral, U+222B ISOtech -->
-<!ENTITY there4 CDATA "&#8756;" -- therefore, U+2234 ISOtech -->
-<!ENTITY sim CDATA "&#8764;" -- tilde operator = varies with = similar to,
- U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong CDATA "&#8773;" -- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp CDATA "&#8776;" -- almost equal to = asymptotic to,
- U+2248 ISOamsr -->
-<!ENTITY ne CDATA "&#8800;" -- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv CDATA "&#8801;" -- identical to, U+2261 ISOtech -->
-<!ENTITY le CDATA "&#8804;" -- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge CDATA "&#8805;" -- greater-than or equal to,
- U+2265 ISOtech -->
-<!ENTITY sub CDATA "&#8834;" -- subset of, U+2282 ISOtech -->
-<!ENTITY sup CDATA "&#8835;" -- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub CDATA "&#8836;" -- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube CDATA "&#8838;" -- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe CDATA "&#8839;" -- superset of or equal to,
- U+2287 ISOtech -->
-<!ENTITY oplus CDATA "&#8853;" -- circled plus = direct sum,
- U+2295 ISOamsb -->
-<!ENTITY otimes CDATA "&#8855;" -- circled times = vector product,
- U+2297 ISOamsb -->
-<!ENTITY perp CDATA "&#8869;" -- up tack = orthogonal to = perpendicular,
- U+22A5 ISOtech -->
-<!ENTITY sdot CDATA "&#8901;" -- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil CDATA "&#8968;" -- left ceiling = apl upstile,
- U+2308 ISOamsc -->
-<!ENTITY rceil CDATA "&#8969;" -- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor CDATA "&#8970;" -- left floor = apl downstile,
- U+230A ISOamsc -->
-<!ENTITY rfloor CDATA "&#8971;" -- right floor, U+230B ISOamsc -->
-<!ENTITY lang CDATA "&#9001;" -- left-pointing angle bracket = bra,
- U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang CDATA "&#9002;" -- right-pointing angle bracket = ket,
- U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz CDATA "&#9674;" -- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades CDATA "&#9824;" -- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs CDATA "&#9827;" -- black club suit = shamrock,
- U+2663 ISOpub -->
-<!ENTITY hearts CDATA "&#9829;" -- black heart suit = valentine,
- U+2665 ISOpub -->
-<!ENTITY diams CDATA "&#9830;" -- black diamond suit, U+2666 ISOpub --> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd
deleted file mode 100644
index 2449dd4568..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- This is the HTML 4.01 Frameset DTD, which should be
- used for documents with frames. This DTD is identical
- to the HTML 4.01 Transitional DTD except for the
- content model of the "HTML" element: in frameset
- documents, the "FRAMESET" element replaces the "BODY"
- element.
-
- Draft: $Date: 2008/07/22 07:37:01 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.01 is available at:
-
- http://www.w3.org/TR/1999/REC-html401-19991224.
--->
-<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Frameset//EN"
- -- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
- "http://www.w3.org/TR/html4/frameset.dtd">
- <html>
- <head>
- ...
- </head>
- <frameset>
- ...
- </frameset>
- </html>
--->
-
-<!ENTITY % HTML.Frameset "INCLUDE">
-<!ENTITY % HTML4.dtd PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-%HTML4.dtd; \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd
deleted file mode 100644
index 501fb482b1..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd
+++ /dev/null
@@ -1,1093 +0,0 @@
-<!--
- This is the HTML 4.01 Transitional DTD, which includes
- presentation attributes and elements that W3C expects to phase out
- as support for style sheets matures. Authors should use the Strict
- DTD when possible, but may use the Transitional DTD when support
- for presentation attribute and elements is required.
-
- HTML 4 includes mechanisms for style sheets, scripting,
- embedding objects, improved support for right to left and mixed
- direction text, and enhancements to forms for improved
- accessibility for people with disabilities.
-
- Draft: $Date: 2008/07/22 07:37:01 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.01 is available at:
-
- http://www.w3.org/TR/1999/REC-html401-19991224
-
-
- The HTML 4.01 specification includes additional
- syntactic constraints that cannot be expressed within
- the DTDs.
-
--->
-<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Transitional//EN"
- -- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- ...
- </head>
- <body>
- ...
- </body>
- </html>
-
- The URI used as a system identifier with the public identifier allows
- the user agent to download the DTD and entity sets as needed.
-
- The FPI for the Strict HTML 4.01 DTD is:
-
- "-//W3C//DTD HTML 4.01//EN"
-
- This version of the strict DTD is:
-
- http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd
-
- Authors should use the Strict DTD unless they need the
- presentation control for user agents that don't (adequately)
- support style sheets.
-
- If you are writing a document that includes frames, use
- the following FPI:
-
- "-//W3C//DTD HTML 4.01 Frameset//EN"
-
- This version of the frameset DTD is:
-
- http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
-
- Use the following (relative) URIs to refer to
- the DTDs and entity definitions of this specification:
-
- "strict.dtd"
- "loose.dtd"
- "frameset.dtd"
- "HTMLlat1.ent"
- "HTMLsymbol.ent"
- "HTMLspecial.ent"
-
--->
-
-<!--================== Imported Names ====================================-->
-<!-- Feature Switch for frameset documents -->
-<!ENTITY % HTML.Frameset "IGNORE">
-
-<!ENTITY % ContentType "CDATA"
- -- media type, as per [RFC2045]
- -->
-
-<!ENTITY % ContentTypes "CDATA"
- -- comma-separated list of media types, as per [RFC2045]
- -->
-
-<!ENTITY % Charset "CDATA"
- -- a character encoding, as per [RFC2045]
- -->
-
-<!ENTITY % Charsets "CDATA"
- -- a space-separated list of character encodings, as per [RFC2045]
- -->
-
-<!ENTITY % LanguageCode "NAME"
- -- a language code, as per [RFC1766]
- -->
-
-<!ENTITY % Character "CDATA"
- -- a single character from [ISO10646]
- -->
-
-<!ENTITY % LinkTypes "CDATA"
- -- space-separated list of link types
- -->
-
-<!ENTITY % MediaDesc "CDATA"
- -- single or comma-separated list of media descriptors
- -->
-
-<!ENTITY % URI "CDATA"
- -- a Uniform Resource Identifier,
- see [URI]
- -->
-
-<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
-
-
-<!ENTITY % Script "CDATA" -- script expression -->
-
-<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
-
-<!ENTITY % FrameTarget "CDATA" -- render in this frame -->
-
-
-<!ENTITY % Text "CDATA">
-
-
-<!-- Parameter Entities -->
-
-<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
-
-<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
-
-<!ENTITY % list "UL | OL | DIR | MENU">
-
-<!ENTITY % preformatted "PRE">
-
-<!ENTITY % Color "CDATA" -- a color using sRGB: #RRGGBB as Hex values -->
-
-<!-- There are also 16 widely known color names with their sRGB values:
-
- Black = #000000 Green = #008000
- Silver = #C0C0C0 Lime = #00FF00
- Gray = #808080 Olive = #808000
- White = #FFFFFF Yellow = #FFFF00
- Maroon = #800000 Navy = #000080
- Red = #FF0000 Blue = #0000FF
- Purple = #800080 Teal = #008080
- Fuchsia= #FF00FF Aqua = #00FFFF
- -->
-
-<!ENTITY % bodycolors "
- bgcolor %Color; #IMPLIED -- document background color --
- text %Color; #IMPLIED -- document text color --
- link %Color; #IMPLIED -- color of links --
- vlink %Color; #IMPLIED -- color of visited links --
- alink %Color; #IMPLIED -- color of selected links --
- ">
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin1//EN//HTML"
- "HTMLlat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols//EN//HTML"
- "HTMLsymbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML"
- "HTMLspecial.ent">
-%HTMLspecial;
-<!--=================== Generic Attributes ===============================-->
-
-<!ENTITY % coreattrs
- "id ID #IMPLIED -- document-wide unique id --
- class CDATA #IMPLIED -- space-separated list of classes --
- style %StyleSheet; #IMPLIED -- associated style info --
- title %Text; #IMPLIED -- advisory title --"
- >
-
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
- >
-
-<!ENTITY % events
- "onclick %Script; #IMPLIED -- a pointer button was clicked --
- ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
- onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
- onmouseup %Script; #IMPLIED -- a pointer button was released --
- onmouseover %Script; #IMPLIED -- a pointer was moved onto --
- onmousemove %Script; #IMPLIED -- a pointer was moved within --
- onmouseout %Script; #IMPLIED -- a pointer was moved away --
- onkeypress %Script; #IMPLIED -- a key was pressed and released --
- onkeydown %Script; #IMPLIED -- a key was pressed down --
- onkeyup %Script; #IMPLIED -- a key was released --"
- >
-
-<!-- Reserved Feature Switch -->
-<!ENTITY % HTML.Reserved "IGNORE">
-
-<!-- The following attributes are reserved for possible future use -->
-<![ %HTML.Reserved; [
-<!ENTITY % reserved
- "datasrc %URI; #IMPLIED -- a single or tabular Data Source --
- datafld CDATA #IMPLIED -- the property or column name --
- dataformatas (plaintext|html) plaintext -- text or html --"
- >
-]]>
-
-<!ENTITY % reserved "">
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-<!ENTITY % align "align (left|center|right|justify) #IMPLIED"
- -- default is left for ltr paragraphs, right for rtl --
- >
-
-<!--=================== Text Markup ======================================-->
-
-<!ENTITY % fontstyle
- "TT | I | B | U | S | STRIKE | BIG | SMALL">
-
-<!ENTITY % phrase "EM | STRONG | DFN | CODE |
- SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
-
-<!ENTITY % special
- "A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
- MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
-
-<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
-
-<!-- %inline; covers inline or "text-level" elements -->
-<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
-
-<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
-<!ATTLIST (%fontstyle;|%phrase;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
-<!ATTLIST (SUB|SUP)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
-<!ATTLIST SPAN
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
-<!ATTLIST BDO
- %coreattrs; -- id, class, style, title --
- lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #REQUIRED -- directionality --
- >
-
-<!ELEMENT BASEFONT - O EMPTY -- base font size -->
-<!ATTLIST BASEFONT
- id ID #IMPLIED -- document-wide unique id --
- size CDATA #REQUIRED -- base font size for FONT elements --
- color %Color; #IMPLIED -- text color --
- face CDATA #IMPLIED -- comma-separated list of font names --
- >
-
-<!ELEMENT FONT - - (%inline;)* -- local change to font -->
-<!ATTLIST FONT
- %coreattrs; -- id, class, style, title --
- %i18n; -- lang, dir --
- size CDATA #IMPLIED -- [+|-]nn e.g. size="+1", size="4" --
- color %Color; #IMPLIED -- text color --
- face CDATA #IMPLIED -- comma-separated list of font names --
- >
-
-<!ELEMENT BR - O EMPTY -- forced line break -->
-<!ATTLIST BR
- %coreattrs; -- id, class, style, title --
- clear (left|all|right|none) none -- control of text flow --
- >
-
-<!--================== HTML content models ===============================-->
-
-<!--
- HTML has two basic content models:
-
- %inline; character level elements and text strings
- %block; block-like elements e.g. paragraphs and lists
--->
-
-<!ENTITY % block
- "P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- TABLE | FIELDSET | ADDRESS">
-
-<!ENTITY % flow "%block; | %inline;">
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->
-<!ATTLIST BODY
- %attrs; -- %coreattrs, %i18n, %events --
- onload %Script; #IMPLIED -- the document has been loaded --
- onunload %Script; #IMPLIED -- the document has been removed --
- background %URI; #IMPLIED -- texture tile for document
- background --
- %bodycolors; -- bgcolor, text, link, vlink, alink --
- >
-
-<!ELEMENT ADDRESS - - ((%inline;)|P)* -- information on author -->
-<!ATTLIST ADDRESS
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
-<!ATTLIST DIV
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT CENTER - - (%flow;)* -- shorthand for DIV align=center -->
-<!ATTLIST CENTER
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================== The Anchor Element ================================-->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
-
-<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
-<!ATTLIST A
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #IMPLIED -- advisory content type --
- name CDATA #IMPLIED -- named link end --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- target %FrameTarget; #IMPLIED -- render in this frame --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- accesskey %Character; #IMPLIED -- accessibility key character --
- shape %Shape; rect -- for use with client-side image maps --
- coords %Coords; #IMPLIED -- for use with client-side image maps --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
-<!ATTLIST MAP
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #REQUIRED -- for reference by usemap --
- >
-
-<!ELEMENT AREA - O EMPTY -- client-side image map area -->
-<!ATTLIST AREA
- %attrs; -- %coreattrs, %i18n, %events --
- shape %Shape; rect -- controls interpretation of coords --
- coords %Coords; #IMPLIED -- comma-separated list of lengths --
- href %URI; #IMPLIED -- URI for linked resource --
- target %FrameTarget; #IMPLIED -- render in this frame --
- nohref (nohref) #IMPLIED -- this region has no action --
- alt %Text; #REQUIRED -- short description --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== The LINK Element ==================================-->
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the LINK element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel=stylesheet)
- c) to make a link to a script (rel=script)
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel=alternate media=print)
--->
-
-<!ELEMENT LINK - O EMPTY -- a media-independent link -->
-<!ATTLIST LINK
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- type %ContentType; #IMPLIED -- advisory content type --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- media %MediaDesc; #IMPLIED -- for rendering on these media --
- target %FrameTarget; #IMPLIED -- render in this frame --
- >
-
-<!--=================== Images ===========================================-->
-
-<!-- Length defined in strict DTD for cellpadding/cellspacing -->
-<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
-<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
-
-<![ %HTML.Frameset; [
-<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
-]]>
-
-<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
-
-<!ENTITY % IAlign "(top|middle|bottom|left|right)" -- center? -->
-
-<!-- To avoid problems with text-only UAs as well as
- to make image content understandable and navigable
- to users of non-visual UAs, you need to provide
- a description with ALT, and avoid server-side image maps -->
-<!ELEMENT IMG - O EMPTY -- Embedded image -->
-<!ATTLIST IMG
- %attrs; -- %coreattrs, %i18n, %events --
- src %URI; #REQUIRED -- URI of image to embed --
- alt %Text; #REQUIRED -- short description --
- longdesc %URI; #IMPLIED -- link to long description
- (complements alt) --
- name CDATA #IMPLIED -- name of image for scripting --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- border %Pixels; #IMPLIED -- link border width --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- >
-
-<!-- USEMAP points to a MAP element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--==================== OBJECT ======================================-->
-<!--
- OBJECT is used to embed objects as part of HTML pages
- PARAM elements should precede other content. SGML mixed content
- model technicality precludes specifying this formally ...
--->
-
-<!ELEMENT OBJECT - - (PARAM | %flow;)*
- -- generic embedded object -->
-<!ATTLIST OBJECT
- %attrs; -- %coreattrs, %i18n, %events --
- declare (declare) #IMPLIED -- declare but don't instantiate flag --
- classid %URI; #IMPLIED -- identifies an implementation --
- codebase %URI; #IMPLIED -- base URI for classid, data, archive--
- data %URI; #IMPLIED -- reference to object's data --
- type %ContentType; #IMPLIED -- content type for data --
- codetype %ContentType; #IMPLIED -- content type for code --
- archive CDATA #IMPLIED -- space-separated list of URIs --
- standby %Text; #IMPLIED -- message to show while loading --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- name CDATA #IMPLIED -- submit as part of form --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- border %Pixels; #IMPLIED -- link border width --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT PARAM - O EMPTY -- named property value -->
-<!ATTLIST PARAM
- id ID #IMPLIED -- document-wide unique id --
- name CDATA #REQUIRED -- property name --
- value CDATA #IMPLIED -- property value --
- valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
- type %ContentType; #IMPLIED -- content type for value
- when valuetype=ref --
- >
-
-<!--=================== Java APPLET ==================================-->
-<!--
- One of code or object attributes must be present.
- Place PARAM elements before other content.
--->
-<!ELEMENT APPLET - - (PARAM | %flow;)* -- Java applet -->
-<!ATTLIST APPLET
- %coreattrs; -- id, class, style, title --
- codebase %URI; #IMPLIED -- optional base URI for applet --
- archive CDATA #IMPLIED -- comma-separated archive list --
- code CDATA #IMPLIED -- applet class file --
- object CDATA #IMPLIED -- serialized applet file --
- alt %Text; #IMPLIED -- short description --
- name CDATA #IMPLIED -- allows applets to find each other --
- width %Length; #REQUIRED -- initial width --
- height %Length; #REQUIRED -- initial height --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- hspace %Pixels; #IMPLIED -- horizontal gutter --
- vspace %Pixels; #IMPLIED -- vertical gutter --
- >
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT HR - O EMPTY -- horizontal rule -->
-<!ATTLIST HR
- %attrs; -- %coreattrs, %i18n, %events --
- align (left|center|right) #IMPLIED
- noshade (noshade) #IMPLIED
- size %Pixels; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT P - O (%inline;)* -- paragraph -->
-<!ATTLIST P
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from H1 (the most important)
- to H6 (the least important).
--->
-
-<!ELEMENT (%heading;) - - (%inline;)* -- heading -->
-<!ATTLIST (%heading;)
- %attrs; -- %coreattrs, %i18n, %events --
- %align; -- align, text alignment --
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- excludes markup for images and changes in font size -->
-<!ENTITY % pre.exclusion "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT">
-
-<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
-<!ATTLIST PRE
- %attrs; -- %coreattrs, %i18n, %events --
- width NUMBER #IMPLIED
- >
-
-<!--===================== Inline Quotes ==================================-->
-
-<!ELEMENT Q - - (%inline;)* -- short inline quotation -->
-<!ATTLIST Q
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT BLOCKQUOTE - - (%flow;)* -- long quotation -->
-<!ATTLIST BLOCKQUOTE
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!-- INS/DEL are handled by inclusion on BODY -->
-<!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
-<!ATTLIST (INS|DEL)
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- info on reason for change --
- datetime %Datetime; #IMPLIED -- date and time of change --
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- definition lists - DT for term, DD for its definition -->
-
-<!ELEMENT DL - - (DT|DD)+ -- definition list -->
-<!ATTLIST DL
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-
-<!ELEMENT DT - O (%inline;)* -- definition term -->
-<!ELEMENT DD - O (%flow;)* -- definition description -->
-<!ATTLIST (DT|DD)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!-- Ordered lists (OL) Numbering style
-
- 1 arablic numbers 1, 2, 3, ...
- a lower alpha a, b, c, ...
- A upper alpha A, B, C, ...
- i lower roman i, ii, iii, ...
- I upper roman I, II, III, ...
-
- The style is applied to the sequence number which by default
- is reset to 1 for the first list item in an ordered list.
-
- This can't be expressed directly in SGML due to case folding.
--->
-
-<!ENTITY % OLStyle "CDATA" -- constrained to: "(1|a|A|i|I)" -->
-
-<!ELEMENT OL - - (LI)+ -- ordered list -->
-<!ATTLIST OL
- %attrs; -- %coreattrs, %i18n, %events --
- type %OLStyle; #IMPLIED -- numbering style --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- start NUMBER #IMPLIED -- starting sequence number --
- >
-
-<!-- Unordered Lists (UL) bullet styles -->
-<!ENTITY % ULStyle "(disc|square|circle)">
-
-<!ELEMENT UL - - (LI)+ -- unordered list -->
-<!ATTLIST UL
- %attrs; -- %coreattrs, %i18n, %events --
- type %ULStyle; #IMPLIED -- bullet style --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-
-<!ELEMENT (DIR|MENU) - - (LI)+ -(%block;) -- directory list, menu list -->
-<!ATTLIST DIR
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-<!ATTLIST MENU
- %attrs; -- %coreattrs, %i18n, %events --
- compact (compact) #IMPLIED -- reduced interitem spacing --
- >
-
-<!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle;|%OLStyle;)" -->
-
-<!ELEMENT LI - O (%flow;)* -- list item -->
-<!ATTLIST LI
- %attrs; -- %coreattrs, %i18n, %events --
- type %LIStyle; #IMPLIED -- list item style --
- value NUMBER #IMPLIED -- reset sequence number --
- >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT FORM - - (%flow;)* -(FORM) -- interactive form -->
-<!ATTLIST FORM
- %attrs; -- %coreattrs, %i18n, %events --
- action %URI; #REQUIRED -- server-side form handler --
- method (GET|POST) GET -- HTTP method used to submit the form--
- enctype %ContentType; "application/x-www-form-urlencoded"
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- name CDATA #IMPLIED -- name of form for scripting --
- onsubmit %Script; #IMPLIED -- the form was submitted --
- onreset %Script; #IMPLIED -- the form was reset --
- target %FrameTarget; #IMPLIED -- render in this frame --
- accept-charset %Charsets; #IMPLIED -- list of supported charsets --
- >
-
-<!-- Each label must not contain more than ONE field -->
-<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
-<!ATTLIST LABEL
- %attrs; -- %coreattrs, %i18n, %events --
- for IDREF #IMPLIED -- matches field ID value --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!ENTITY % InputType
- "(TEXT | PASSWORD | CHECKBOX |
- RADIO | SUBMIT | RESET |
- FILE | HIDDEN | IMAGE | BUTTON)"
- >
-
-<!-- attribute name required for all but submit and reset -->
-<!ELEMENT INPUT - O EMPTY -- form control -->
-<!ATTLIST INPUT
- %attrs; -- %coreattrs, %i18n, %events --
- type %InputType; TEXT -- what kind of widget is needed --
- name CDATA #IMPLIED -- submit as part of form --
- value CDATA #IMPLIED -- Specify for radio buttons and checkboxes --
- checked (checked) #IMPLIED -- for radio buttons and check boxes --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED -- for text and passwd --
- size CDATA #IMPLIED -- specific to each type of field --
- maxlength NUMBER #IMPLIED -- max chars for text fields --
- src %URI; #IMPLIED -- for fields with images --
- alt CDATA #IMPLIED -- short description --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
-<!ATTLIST SELECT
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED -- field name --
- size NUMBER #IMPLIED -- rows visible --
- multiple (multiple) #IMPLIED -- default is single selection --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
-<!ATTLIST OPTGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #REQUIRED -- for use in hierarchical menus --
- >
-
-<!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
-<!ATTLIST OPTION
- %attrs; -- %coreattrs, %i18n, %events --
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #IMPLIED -- for use in hierarchical menus --
- value CDATA #IMPLIED -- defaults to element content --
- >
-
-<!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
-<!ATTLIST TEXTAREA
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- rows NUMBER #REQUIRED
- cols NUMBER #REQUIRED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!--
- #PCDATA is to solve the mixed content problem,
- per specification only whitespace is allowed there!
- -->
-<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
-<!ATTLIST FIELDSET
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ATTLIST LEGEND
- %attrs; -- %coreattrs, %i18n, %events --
- accesskey %Character; #IMPLIED -- accessibility key character --
- align %LAlign; #IMPLIED -- relative to fieldset --
- >
-
-<!ELEMENT BUTTON - -
- (%flow;)* -(A|%formctrl;|FORM|ISINDEX|FIELDSET|IFRAME)
- -- push button -->
-<!ATTLIST BUTTON
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- value CDATA #IMPLIED -- sent to server when submitted --
- type (button|submit|reset) submit -- for use as form button --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- %reserved; -- reserved for possible future use --
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The BORDER attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The FRAME attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the VALIGN attribute.
-
- The value "border" is included for backwards compatibility with
- <TABLE BORDER> which yields frame=border and border=implied
- For <TABLE BORDER=1> you get border=1 and frame=implied. In this
- case, it is appropriate to treat this as frame=border for backwards
- compatibility with deployed browsers.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The RULES attribute defines which rules to draw between cells:
-
- If RULES is absent then assume:
- "none" if BORDER is absent or BORDER=0 otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents -->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED -- alignment char, e.g. char=':' --
- charoff %Length; #IMPLIED -- offset for alignment char --"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT TABLE - -
- (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
-<!ELEMENT CAPTION - - (%inline;)* -- table caption -->
-<!ELEMENT THEAD - O (TR)+ -- table header -->
-<!ELEMENT TFOOT - O (TR)+ -- table footer -->
-<!ELEMENT TBODY O O (TR)+ -- table body -->
-<!ELEMENT COLGROUP - O (COL)* -- table column group -->
-<!ELEMENT COL - O EMPTY -- table column -->
-<!ELEMENT TR - O (TH|TD)+ -- table row -->
-<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
-
-<!ATTLIST TABLE -- table element --
- %attrs; -- %coreattrs, %i18n, %events --
- summary %Text; #IMPLIED -- purpose/structure for speech output--
- width %Length; #IMPLIED -- table width --
- border %Pixels; #IMPLIED -- controls frame width around table --
- frame %TFrame; #IMPLIED -- which parts of frame to render --
- rules %TRules; #IMPLIED -- rulings between rows and cols --
- cellspacing %Length; #IMPLIED -- spacing between cells --
- cellpadding %Length; #IMPLIED -- spacing within cells --
- align %TAlign; #IMPLIED -- table position relative to window --
- bgcolor %Color; #IMPLIED -- background color for cells --
- %reserved; -- reserved for possible future use --
- datapagesize CDATA #IMPLIED -- reserved for possible future use --
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST CAPTION
- %attrs; -- %coreattrs, %i18n, %events --
- align %CAlign; #IMPLIED -- relative to table --
- >
-
-<!--
-COLGROUP groups a set of COL elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST COLGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- default number of columns in group --
- width %MultiLength; #IMPLIED -- default width for enclosed COLs --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- COL elements define the alignment properties for cells in
- one or more columns.
-
- The WIDTH attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The SPAN attribute causes the attributes of one
- COL element to apply to more than one column.
--->
-<!ATTLIST COL -- column groups and properties --
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- COL attributes affect N columns --
- width %MultiLength; #IMPLIED -- column width specification --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- Use THEAD to duplicate headers when breaking table
- across page boundaries, or for static headers when
- TBODY sections are rendered in scrolling panel.
-
- Use TFOOT to duplicate footers when breaking table
- across page boundaries, or for static footers when
- TBODY sections are rendered in scrolling panel.
-
- Use multiple TBODY sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!ATTLIST TR -- table row --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- bgcolor %Color; #IMPLIED -- background color for row --
- >
-
-
-<!-- Scope is simpler than headers attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
-<!ATTLIST (TH|TD) -- header or data cell --
- %attrs; -- %coreattrs, %i18n, %events --
- abbr %Text; #IMPLIED -- abbreviation for header cell --
- axis CDATA #IMPLIED -- comma-separated list of related headers--
- headers IDREFS #IMPLIED -- list of id's for header cells --
- scope %Scope; #IMPLIED -- scope covered by header cells --
- rowspan NUMBER 1 -- number of rows spanned by cell --
- colspan NUMBER 1 -- number of cols spanned by cell --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- nowrap (nowrap) #IMPLIED -- suppress word wrap --
- bgcolor %Color; #IMPLIED -- cell background color --
- width %Length; #IMPLIED -- width for cell --
- height %Length; #IMPLIED -- height for cell --
- >
-
-<!--================== Document Frames ===================================-->
-
-<!--
- The content model for HTML documents depends on whether the HEAD is
- followed by a FRAMESET or BODY element. The widespread omission of
- the BODY start tag makes it impractical to define the content model
- without the use of a marked section.
--->
-
-<![ %HTML.Frameset; [
-<!ELEMENT FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
-<!ATTLIST FRAMESET
- %coreattrs; -- id, class, style, title --
- rows %MultiLengths; #IMPLIED -- list of lengths,
- default: 100% (1 row) --
- cols %MultiLengths; #IMPLIED -- list of lengths,
- default: 100% (1 col) --
- onload %Script; #IMPLIED -- all the frames have been loaded --
- onunload %Script; #IMPLIED -- all the frames have been removed --
- >
-]]>
-
-<![ %HTML.Frameset; [
-<!-- reserved frame names start with "_" otherwise starts with letter -->
-<!ELEMENT FRAME - O EMPTY -- subwindow -->
-<!ATTLIST FRAME
- %coreattrs; -- id, class, style, title --
- longdesc %URI; #IMPLIED -- link to long description
- (complements title) --
- name CDATA #IMPLIED -- name of frame for targetting --
- src %URI; #IMPLIED -- source of frame content --
- frameborder (1|0) 1 -- request frame borders? --
- marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
- marginheight %Pixels; #IMPLIED -- margin height in pixels --
- noresize (noresize) #IMPLIED -- allow users to resize frames? --
- scrolling (yes|no|auto) auto -- scrollbar or none --
- >
-]]>
-
-<!ELEMENT IFRAME - - (%flow;)* -- inline subwindow -->
-<!ATTLIST IFRAME
- %coreattrs; -- id, class, style, title --
- longdesc %URI; #IMPLIED -- link to long description
- (complements title) --
- name CDATA #IMPLIED -- name of frame for targetting --
- src %URI; #IMPLIED -- source of frame content --
- frameborder (1|0) 1 -- request frame borders? --
- marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
- marginheight %Pixels; #IMPLIED -- margin height in pixels --
- scrolling (yes|no|auto) auto -- scrollbar or none --
- align %IAlign; #IMPLIED -- vertical or horizontal alignment --
- height %Length; #IMPLIED -- frame height --
- width %Length; #IMPLIED -- frame width --
- >
-
-<![ %HTML.Frameset; [
-<!ENTITY % noframes.content "(BODY) -(NOFRAMES)">
-]]>
-
-<!ENTITY % noframes.content "(%flow;)*">
-
-<!ELEMENT NOFRAMES - - %noframes.content;
- -- alternate content container for non frame-based rendering -->
-<!ATTLIST NOFRAMES
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Head =======================================-->
-<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
-<!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
-
-<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
-<!ATTLIST HEAD
- %i18n; -- lang, dir --
- profile %URI; #IMPLIED -- named dictionary of meta info --
- >
-
-<!-- The TITLE element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
-<!ATTLIST TITLE %i18n>
-
-<!ELEMENT ISINDEX - O EMPTY -- single line prompt -->
-<!ATTLIST ISINDEX
- %coreattrs; -- id, class, style, title --
- %i18n; -- lang, dir --
- prompt %Text; #IMPLIED -- prompt message -->
-
-<!ELEMENT BASE - O EMPTY -- document base URI -->
-<!ATTLIST BASE
- href %URI; #IMPLIED -- URI that acts as base URI --
- target %FrameTarget; #IMPLIED -- render in this frame --
- >
-
-<!ELEMENT META - O EMPTY -- generic metainformation -->
-<!ATTLIST META
- %i18n; -- lang, dir, for use with content --
- http-equiv NAME #IMPLIED -- HTTP response header name --
- name NAME #IMPLIED -- metainformation name --
- content CDATA #REQUIRED -- associated information --
- scheme CDATA #IMPLIED -- select form of content --
- >
-
-<!ELEMENT STYLE - - %StyleSheet -- style info -->
-<!ATTLIST STYLE
- %i18n; -- lang, dir, for use with title --
- type %ContentType; #REQUIRED -- content type of style language --
- media %MediaDesc; #IMPLIED -- designed for use with these media --
- title %Text; #IMPLIED -- advisory title --
- >
-
-<!ELEMENT SCRIPT - - %Script; -- script statements -->
-<!ATTLIST SCRIPT
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #REQUIRED -- content type of script language --
- language CDATA #IMPLIED -- predefined script language name --
- src %URI; #IMPLIED -- URI for an external script --
- defer (defer) #IMPLIED -- UA may defer execution of script --
- event CDATA #IMPLIED -- reserved for possible future use --
- for %URI; #IMPLIED -- reserved for possible future use --
- >
-
-<!ELEMENT NOSCRIPT - - (%flow;)*
- -- alternate content container for non script-based rendering -->
-<!ATTLIST NOSCRIPT
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Structure ==================================-->
-<!ENTITY % version "version CDATA #FIXED '%HTML.Version;'">
-
-<![ %HTML.Frameset; [
-<!ENTITY % html.content "HEAD, FRAMESET">
-]]>
-
-<!ENTITY % html.content "HEAD, BODY">
-
-<!ELEMENT HTML O O (%html.content;) -- document root element -->
-<!ATTLIST HTML
- %i18n; -- lang, dir --
- %version;
- >
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd
deleted file mode 100644
index 7032cb8f4e..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd
+++ /dev/null
@@ -1,870 +0,0 @@
-<!--
- This is HTML 4.01 Strict DTD, which excludes the presentation
- attributes and elements that W3C expects to phase out as
- support for style sheets matures. Authors should use the Strict
- DTD when possible, but may use the Transitional DTD when support
- for presentation attribute and elements is required.
-
- HTML 4 includes mechanisms for style sheets, scripting,
- embedding objects, improved support for right to left and mixed
- direction text, and enhancements to forms for improved
- accessibility for people with disabilities.
-
- Draft: $Date: 2008/07/22 07:37:01 $
-
- Authors:
- Dave Raggett <dsr@w3.org>
- Arnaud Le Hors <lehors@w3.org>
- Ian Jacobs <ij@w3.org>
-
- Further information about HTML 4.01 is available at:
-
- http://www.w3.org/TR/1999/REC-html401-19991224
-
-
- The HTML 4.01 specification includes additional
- syntactic constraints that cannot be expressed within
- the DTDs.
-
--->
-<!--
- Typical usage:
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- ...
- </head>
- <body>
- ...
- </body>
- </html>
-
- The URI used as a system identifier with the public identifier allows
- the user agent to download the DTD and entity sets as needed.
-
- The FPI for the Transitional HTML 4.01 DTD is:
-
- "-//W3C//DTD HTML 4.01 Transitional//EN"
-
- This version of the transitional DTD is:
-
- http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd
-
- If you are writing a document that includes frames, use
- the following FPI:
-
- "-//W3C//DTD HTML 4.01 Frameset//EN"
-
- This version of the frameset DTD is:
-
- http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
-
- Use the following (relative) URIs to refer to
- the DTDs and entity definitions of this specification:
-
- "strict.dtd"
- "loose.dtd"
- "frameset.dtd"
- "HTMLlat1.ent"
- "HTMLsymbol.ent"
- "HTMLspecial.ent"
-
--->
-
-<!--================== Imported Names ====================================-->
-<!-- Feature Switch for frameset documents -->
-<!ENTITY % HTML.Frameset "IGNORE">
-
-<!ENTITY % ContentType "CDATA"
- -- media type, as per [RFC2045]
- -->
-
-<!ENTITY % ContentTypes "CDATA"
- -- comma-separated list of media types, as per [RFC2045]
- -->
-
-<!ENTITY % Charset "CDATA"
- -- a character encoding, as per [RFC2045]
- -->
-
-<!ENTITY % Charsets "CDATA"
- -- a space-separated list of character encodings, as per [RFC2045]
- -->
-
-<!ENTITY % LanguageCode "NAME"
- -- a language code, as per [RFC1766]
- -->
-
-<!ENTITY % Character "CDATA"
- -- a single character from [ISO10646]
- -->
-
-<!ENTITY % LinkTypes "CDATA"
- -- space-separated list of link types
- -->
-
-<!ENTITY % MediaDesc "CDATA"
- -- single or comma-separated list of media descriptors
- -->
-
-<!ENTITY % URI "CDATA"
- -- a Uniform Resource Identifier,
- see [URI]
- -->
-
-<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
-
-
-<!ENTITY % Script "CDATA" -- script expression -->
-
-<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
-
-
-
-<!ENTITY % Text "CDATA">
-
-
-<!-- Parameter Entities -->
-
-<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
-
-<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
-
-<!ENTITY % list "UL | OL">
-
-<!ENTITY % preformatted "PRE">
-
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin1//EN//HTML"
- "HTMLlat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols//EN//HTML"
- "HTMLsymbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special//EN//HTML"
- "HTMLspecial.ent">
-%HTMLspecial;
-<!--=================== Generic Attributes ===============================-->
-
-<!ENTITY % coreattrs
- "id ID #IMPLIED -- document-wide unique id --
- class CDATA #IMPLIED -- space-separated list of classes --
- style %StyleSheet; #IMPLIED -- associated style info --
- title %Text; #IMPLIED -- advisory title --"
- >
-
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
- >
-
-<!ENTITY % events
- "onclick %Script; #IMPLIED -- a pointer button was clicked --
- ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
- onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
- onmouseup %Script; #IMPLIED -- a pointer button was released --
- onmouseover %Script; #IMPLIED -- a pointer was moved onto --
- onmousemove %Script; #IMPLIED -- a pointer was moved within --
- onmouseout %Script; #IMPLIED -- a pointer was moved away --
- onkeypress %Script; #IMPLIED -- a key was pressed and released --
- onkeydown %Script; #IMPLIED -- a key was pressed down --
- onkeyup %Script; #IMPLIED -- a key was released --"
- >
-
-<!-- Reserved Feature Switch -->
-<!ENTITY % HTML.Reserved "IGNORE">
-
-<!-- The following attributes are reserved for possible future use -->
-<![ %HTML.Reserved; [
-<!ENTITY % reserved
- "datasrc %URI; #IMPLIED -- a single or tabular Data Source --
- datafld CDATA #IMPLIED -- the property or column name --
- dataformatas (plaintext|html) plaintext -- text or html --"
- >
-]]>
-
-<!ENTITY % reserved "">
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-
-<!--=================== Text Markup ======================================-->
-
-<!ENTITY % fontstyle
- "TT | I | B | BIG | SMALL">
-
-<!ENTITY % phrase "EM | STRONG | DFN | CODE |
- SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
-
-<!ENTITY % special
- "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
-
-<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
-
-<!-- %inline; covers inline or "text-level" elements -->
-<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
-
-<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
-<!ATTLIST (%fontstyle;|%phrase;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
-<!ATTLIST (SUB|SUP)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
-<!ATTLIST SPAN
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
-<!ATTLIST BDO
- %coreattrs; -- id, class, style, title --
- lang %LanguageCode; #IMPLIED -- language code --
- dir (ltr|rtl) #REQUIRED -- directionality --
- >
-
-
-<!ELEMENT BR - O EMPTY -- forced line break -->
-<!ATTLIST BR
- %coreattrs; -- id, class, style, title --
- >
-
-<!--================== HTML content models ===============================-->
-
-<!--
- HTML has two basic content models:
-
- %inline; character level elements and text strings
- %block; block-like elements e.g. paragraphs and lists
--->
-
-<!ENTITY % block
- "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
- BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
-
-<!ENTITY % flow "%block; | %inline;">
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
-<!ATTLIST BODY
- %attrs; -- %coreattrs, %i18n, %events --
- onload %Script; #IMPLIED -- the document has been loaded --
- onunload %Script; #IMPLIED -- the document has been removed --
- >
-
-<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
-<!ATTLIST ADDRESS
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
-<!ATTLIST DIV
- %attrs; -- %coreattrs, %i18n, %events --
- %reserved; -- reserved for possible future use --
- >
-
-
-<!--================== The Anchor Element ================================-->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
-
-<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
-<!ATTLIST A
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #IMPLIED -- advisory content type --
- name CDATA #IMPLIED -- named link end --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- accesskey %Character; #IMPLIED -- accessibility key character --
- shape %Shape; rect -- for use with client-side image maps --
- coords %Coords; #IMPLIED -- for use with client-side image maps --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
-<!ATTLIST MAP
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #REQUIRED -- for reference by usemap --
- >
-
-<!ELEMENT AREA - O EMPTY -- client-side image map area -->
-<!ATTLIST AREA
- %attrs; -- %coreattrs, %i18n, %events --
- shape %Shape; rect -- controls interpretation of coords --
- coords %Coords; #IMPLIED -- comma-separated list of lengths --
- href %URI; #IMPLIED -- URI for linked resource --
- nohref (nohref) #IMPLIED -- this region has no action --
- alt %Text; #REQUIRED -- short description --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!--================== The LINK Element ==================================-->
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the LINK element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel=stylesheet)
- c) to make a link to a script (rel=script)
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel=alternate media=print)
--->
-
-<!ELEMENT LINK - O EMPTY -- a media-independent link -->
-<!ATTLIST LINK
- %attrs; -- %coreattrs, %i18n, %events --
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- href %URI; #IMPLIED -- URI for linked resource --
- hreflang %LanguageCode; #IMPLIED -- language code --
- type %ContentType; #IMPLIED -- advisory content type --
- rel %LinkTypes; #IMPLIED -- forward link types --
- rev %LinkTypes; #IMPLIED -- reverse link types --
- media %MediaDesc; #IMPLIED -- for rendering on these media --
- >
-
-<!--=================== Images ===========================================-->
-
-<!-- Length defined in strict DTD for cellpadding/cellspacing -->
-<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
-<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
-
-<![ %HTML.Frameset; [
-<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
-]]>
-
-<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
-
-
-<!-- To avoid problems with text-only UAs as well as
- to make image content understandable and navigable
- to users of non-visual UAs, you need to provide
- a description with ALT, and avoid server-side image maps -->
-<!ELEMENT IMG - O EMPTY -- Embedded image -->
-<!ATTLIST IMG
- %attrs; -- %coreattrs, %i18n, %events --
- src %URI; #REQUIRED -- URI of image to embed --
- alt %Text; #REQUIRED -- short description --
- longdesc %URI; #IMPLIED -- link to long description
- (complements alt) --
- name CDATA #IMPLIED -- name of image for scripting --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- >
-
-<!-- USEMAP points to a MAP element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--==================== OBJECT ======================================-->
-<!--
- OBJECT is used to embed objects as part of HTML pages
- PARAM elements should precede other content. SGML mixed content
- model technicality precludes specifying this formally ...
--->
-
-<!ELEMENT OBJECT - - (PARAM | %flow;)*
- -- generic embedded object -->
-<!ATTLIST OBJECT
- %attrs; -- %coreattrs, %i18n, %events --
- declare (declare) #IMPLIED -- declare but don't instantiate flag --
- classid %URI; #IMPLIED -- identifies an implementation --
- codebase %URI; #IMPLIED -- base URI for classid, data, archive--
- data %URI; #IMPLIED -- reference to object's data --
- type %ContentType; #IMPLIED -- content type for data --
- codetype %ContentType; #IMPLIED -- content type for code --
- archive CDATA #IMPLIED -- space-separated list of URIs --
- standby %Text; #IMPLIED -- message to show while loading --
- height %Length; #IMPLIED -- override height --
- width %Length; #IMPLIED -- override width --
- usemap %URI; #IMPLIED -- use client-side image map --
- name CDATA #IMPLIED -- submit as part of form --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT PARAM - O EMPTY -- named property value -->
-<!ATTLIST PARAM
- id ID #IMPLIED -- document-wide unique id --
- name CDATA #REQUIRED -- property name --
- value CDATA #IMPLIED -- property value --
- valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
- type %ContentType; #IMPLIED -- content type for value
- when valuetype=ref --
- >
-
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT HR - O EMPTY -- horizontal rule -->
-<!ATTLIST HR
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT P - O (%inline;)* -- paragraph -->
-<!ATTLIST P
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from H1 (the most important)
- to H6 (the least important).
--->
-
-<!ELEMENT (%heading;) - - (%inline;)* -- heading -->
-<!ATTLIST (%heading;)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- excludes markup for images and changes in font size -->
-<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
-
-<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
-<!ATTLIST PRE
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--===================== Inline Quotes ==================================-->
-
-<!ELEMENT Q - - (%inline;)* -- short inline quotation -->
-<!ATTLIST Q
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT)+ -- long quotation -->
-<!ATTLIST BLOCKQUOTE
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- URI for source document or msg --
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!-- INS/DEL are handled by inclusion on BODY -->
-<!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
-<!ATTLIST (INS|DEL)
- %attrs; -- %coreattrs, %i18n, %events --
- cite %URI; #IMPLIED -- info on reason for change --
- datetime %Datetime; #IMPLIED -- date and time of change --
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- definition lists - DT for term, DD for its definition -->
-
-<!ELEMENT DL - - (DT|DD)+ -- definition list -->
-<!ATTLIST DL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT DT - O (%inline;)* -- definition term -->
-<!ELEMENT DD - O (%flow;)* -- definition description -->
-<!ATTLIST (DT|DD)
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-
-<!ELEMENT OL - - (LI)+ -- ordered list -->
-<!ATTLIST OL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!-- Unordered Lists (UL) bullet styles -->
-<!ELEMENT UL - - (LI)+ -- unordered list -->
-<!ATTLIST UL
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-
-
-<!ELEMENT LI - O (%flow;)* -- list item -->
-<!ATTLIST LI
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
-<!ATTLIST FORM
- %attrs; -- %coreattrs, %i18n, %events --
- action %URI; #REQUIRED -- server-side form handler --
- method (GET|POST) GET -- HTTP method used to submit the form--
- enctype %ContentType; "application/x-www-form-urlencoded"
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- name CDATA #IMPLIED -- name of form for scripting --
- onsubmit %Script; #IMPLIED -- the form was submitted --
- onreset %Script; #IMPLIED -- the form was reset --
- accept-charset %Charsets; #IMPLIED -- list of supported charsets --
- >
-
-<!-- Each label must not contain more than ONE field -->
-<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
-<!ATTLIST LABEL
- %attrs; -- %coreattrs, %i18n, %events --
- for IDREF #IMPLIED -- matches field ID value --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- >
-
-<!ENTITY % InputType
- "(TEXT | PASSWORD | CHECKBOX |
- RADIO | SUBMIT | RESET |
- FILE | HIDDEN | IMAGE | BUTTON)"
- >
-
-<!-- attribute name required for all but submit and reset -->
-<!ELEMENT INPUT - O EMPTY -- form control -->
-<!ATTLIST INPUT
- %attrs; -- %coreattrs, %i18n, %events --
- type %InputType; TEXT -- what kind of widget is needed --
- name CDATA #IMPLIED -- submit as part of form --
- value CDATA #IMPLIED -- Specify for radio buttons and checkboxes --
- checked (checked) #IMPLIED -- for radio buttons and check boxes --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED -- for text and passwd --
- size CDATA #IMPLIED -- specific to each type of field --
- maxlength NUMBER #IMPLIED -- max chars for text fields --
- src %URI; #IMPLIED -- for fields with images --
- alt CDATA #IMPLIED -- short description --
- usemap %URI; #IMPLIED -- use client-side image map --
- ismap (ismap) #IMPLIED -- use server-side image map --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
-<!ATTLIST SELECT
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED -- field name --
- size NUMBER #IMPLIED -- rows visible --
- multiple (multiple) #IMPLIED -- default is single selection --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
-<!ATTLIST OPTGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #REQUIRED -- for use in hierarchical menus --
- >
-
-<!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
-<!ATTLIST OPTION
- %attrs; -- %coreattrs, %i18n, %events --
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- label %Text; #IMPLIED -- for use in hierarchical menus --
- value CDATA #IMPLIED -- defaults to element content --
- >
-
-<!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
-<!ATTLIST TEXTAREA
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- rows NUMBER #REQUIRED
- cols NUMBER #REQUIRED
- disabled (disabled) #IMPLIED -- unavailable in this context --
- readonly (readonly) #IMPLIED
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- onselect %Script; #IMPLIED -- some text was selected --
- onchange %Script; #IMPLIED -- the element value was changed --
- %reserved; -- reserved for possible future use --
- >
-
-<!--
- #PCDATA is to solve the mixed content problem,
- per specification only whitespace is allowed there!
- -->
-<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
-<!ATTLIST FIELDSET
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
-
-<!ATTLIST LEGEND
- %attrs; -- %coreattrs, %i18n, %events --
- accesskey %Character; #IMPLIED -- accessibility key character --
- >
-
-<!ELEMENT BUTTON - -
- (%flow;)* -(A|%formctrl;|FORM|FIELDSET)
- -- push button -->
-<!ATTLIST BUTTON
- %attrs; -- %coreattrs, %i18n, %events --
- name CDATA #IMPLIED
- value CDATA #IMPLIED -- sent to server when submitted --
- type (button|submit|reset) submit -- for use as form button --
- disabled (disabled) #IMPLIED -- unavailable in this context --
- tabindex NUMBER #IMPLIED -- position in tabbing order --
- accesskey %Character; #IMPLIED -- accessibility key character --
- onfocus %Script; #IMPLIED -- the element got the focus --
- onblur %Script; #IMPLIED -- the element lost the focus --
- %reserved; -- reserved for possible future use --
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The BORDER attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The FRAME attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the VALIGN attribute.
-
- The value "border" is included for backwards compatibility with
- <TABLE BORDER> which yields frame=border and border=implied
- For <TABLE BORDER=1> you get border=1 and frame=implied. In this
- case, it is appropriate to treat this as frame=border for backwards
- compatibility with deployed browsers.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The RULES attribute defines which rules to draw between cells:
-
- If RULES is absent then assume:
- "none" if BORDER is absent or BORDER=0 otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents -->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED -- alignment char, e.g. char=':' --
- charoff %Length; #IMPLIED -- offset for alignment char --"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT TABLE - -
- (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
-<!ELEMENT CAPTION - - (%inline;)* -- table caption -->
-<!ELEMENT THEAD - O (TR)+ -- table header -->
-<!ELEMENT TFOOT - O (TR)+ -- table footer -->
-<!ELEMENT TBODY O O (TR)+ -- table body -->
-<!ELEMENT COLGROUP - O (COL)* -- table column group -->
-<!ELEMENT COL - O EMPTY -- table column -->
-<!ELEMENT TR - O (TH|TD)+ -- table row -->
-<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
-
-<!ATTLIST TABLE -- table element --
- %attrs; -- %coreattrs, %i18n, %events --
- summary %Text; #IMPLIED -- purpose/structure for speech output--
- width %Length; #IMPLIED -- table width --
- border %Pixels; #IMPLIED -- controls frame width around table --
- frame %TFrame; #IMPLIED -- which parts of frame to render --
- rules %TRules; #IMPLIED -- rulings between rows and cols --
- cellspacing %Length; #IMPLIED -- spacing between cells --
- cellpadding %Length; #IMPLIED -- spacing within cells --
- %reserved; -- reserved for possible future use --
- datapagesize CDATA #IMPLIED -- reserved for possible future use --
- >
-
-
-<!ATTLIST CAPTION
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--
-COLGROUP groups a set of COL elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST COLGROUP
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- default number of columns in group --
- width %MultiLength; #IMPLIED -- default width for enclosed COLs --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- COL elements define the alignment properties for cells in
- one or more columns.
-
- The WIDTH attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The SPAN attribute causes the attributes of one
- COL element to apply to more than one column.
--->
-<!ATTLIST COL -- column groups and properties --
- %attrs; -- %coreattrs, %i18n, %events --
- span NUMBER 1 -- COL attributes affect N columns --
- width %MultiLength; #IMPLIED -- column width specification --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!--
- Use THEAD to duplicate headers when breaking table
- across page boundaries, or for static headers when
- TBODY sections are rendered in scrolling panel.
-
- Use TFOOT to duplicate footers when breaking table
- across page boundaries, or for static footers when
- TBODY sections are rendered in scrolling panel.
-
- Use multiple TBODY sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-<!ATTLIST TR -- table row --
- %attrs; -- %coreattrs, %i18n, %events --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-
-<!-- Scope is simpler than headers attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
-<!ATTLIST (TH|TD) -- header or data cell --
- %attrs; -- %coreattrs, %i18n, %events --
- abbr %Text; #IMPLIED -- abbreviation for header cell --
- axis CDATA #IMPLIED -- comma-separated list of related headers--
- headers IDREFS #IMPLIED -- list of id's for header cells --
- scope %Scope; #IMPLIED -- scope covered by header cells --
- rowspan NUMBER 1 -- number of rows spanned by cell --
- colspan NUMBER 1 -- number of cols spanned by cell --
- %cellhalign; -- horizontal alignment in cells --
- %cellvalign; -- vertical alignment in cells --
- >
-
-
-<!--================ Document Head =======================================-->
-<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
-<!ENTITY % head.content "TITLE & BASE?">
-
-<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
-<!ATTLIST HEAD
- %i18n; -- lang, dir --
- profile %URI; #IMPLIED -- named dictionary of meta info --
- >
-
-<!-- The TITLE element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
-<!ATTLIST TITLE %i18n>
-
-
-<!ELEMENT BASE - O EMPTY -- document base URI -->
-<!ATTLIST BASE
- href %URI; #REQUIRED -- URI that acts as base URI --
- >
-
-<!ELEMENT META - O EMPTY -- generic metainformation -->
-<!ATTLIST META
- %i18n; -- lang, dir, for use with content --
- http-equiv NAME #IMPLIED -- HTTP response header name --
- name NAME #IMPLIED -- metainformation name --
- content CDATA #REQUIRED -- associated information --
- scheme CDATA #IMPLIED -- select form of content --
- >
-
-<!ELEMENT STYLE - - %StyleSheet -- style info -->
-<!ATTLIST STYLE
- %i18n; -- lang, dir, for use with title --
- type %ContentType; #REQUIRED -- content type of style language --
- media %MediaDesc; #IMPLIED -- designed for use with these media --
- title %Text; #IMPLIED -- advisory title --
- >
-
-<!ELEMENT SCRIPT - - %Script; -- script statements -->
-<!ATTLIST SCRIPT
- charset %Charset; #IMPLIED -- char encoding of linked resource --
- type %ContentType; #REQUIRED -- content type of script language --
- src %URI; #IMPLIED -- URI for an external script --
- defer (defer) #IMPLIED -- UA may defer execution of script --
- event CDATA #IMPLIED -- reserved for possible future use --
- for %URI; #IMPLIED -- reserved for possible future use --
- >
-
-<!ELEMENT NOSCRIPT - - (%block;)+
- -- alternate content container for non script-based rendering -->
-<!ATTLIST NOSCRIPT
- %attrs; -- %coreattrs, %i18n, %events --
- >
-
-<!--================ Document Structure ==================================-->
-<!ENTITY % html.content "HEAD, BODY">
-
-<!ELEMENT HTML O O (%html.content;) -- document root element -->
-<!ATTLIST HTML
- %i18n; -- lang, dir --
- >
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/wml11.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/wml11.dtd
deleted file mode 100644
index b2b12bbf3a..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/wml11.dtd
+++ /dev/null
@@ -1,355 +0,0 @@
-<!--
-Wireless Markup Language (WML) Document Type Definition.
-
-Copyright Wireless Application Protocol Forum Ltd., 1998,1999.
- All rights reserved.
-
-WML is an XML language. Typical usage:
- <?xml version="1.0"?>
- <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
- "http://www.wapforum.org/DTD/wml_1.1.xml">
- <wml>
- ...
- </wml>
-
-Terms and conditions of use are available from the Wireless
-Application Protocol Forum Ltd. web site at
-http://www.wapforum.org/docs/copyright.htm.
--->
-
-<!ENTITY % length "CDATA"> <!-- [0-9]+ for pixels or [0-9]+"%" for
- percentage length -->
-<!ENTITY % vdata "CDATA"> <!-- attribute value possibly containing
- variable references -->
-<!ENTITY % HREF "%vdata;"> <!-- URI, URL or URN designating a hypertext
- node. May contain variable references -->
-<!ENTITY % boolean "(true|false)">
-<!ENTITY % number "NMTOKEN"> <!-- a number, with format [0-9]+ -->
-<!ENTITY % coreattrs "id ID #IMPLIED
- class CDATA #IMPLIED">
-
-
-
-<!ENTITY % emph "em | strong | b | i | u | big | small">
-<!ENTITY % layout "br">
-
-<!ENTITY % text "#PCDATA | %emph;">
-
-<!-- flow covers "card-level" elements, such as text and images -->
-<!ENTITY % flow "%text; | %layout; | img | anchor | a | table">
-
-<!-- Task types -->
-<!ENTITY % task "go | prev | noop | refresh">
-
-<!-- Navigation and event elements -->
-<!ENTITY % navelmts "do | onevent">
-
-<!--================ Decks and Cards ================-->
-
-<!ELEMENT wml ( head?, template?, card+ )>
-<!ATTLIST wml
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!-- card intrinsic events -->
-<!ENTITY % cardev
- "onenterforward %HREF; #IMPLIED
- onenterbackward %HREF; #IMPLIED
- ontimer %HREF; #IMPLIED"
- >
-
-<!-- card field types -->
-<!ENTITY % fields "%flow; | input | select | fieldset">
-
-<!ELEMENT card (onevent*, timer?, (do | p)*)>
-<!ATTLIST card
- title %vdata; #IMPLIED
- newcontext %boolean; "false"
- ordered %boolean; "true"
- xml:lang NMTOKEN #IMPLIED
- %cardev;
- %coreattrs;
- >
-
-<!--================ Event Bindings ================-->
-
-<!ELEMENT do (%task;)>
-<!ATTLIST do
- type CDATA #REQUIRED
- label %vdata; #IMPLIED
- name NMTOKEN #IMPLIED
- optional %boolean; "false"
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT onevent (%task;)>
-<!ATTLIST onevent
- type CDATA #REQUIRED
- %coreattrs;
- >
-
-<!--================ Deck-level declarations ================-->
-
-<!ELEMENT head ( access | meta )+>
-<!ATTLIST head
- %coreattrs;
- >
-
-<!ELEMENT template (%navelmts;)*>
-<!ATTLIST template
- %cardev;
- %coreattrs;
- >
-
-<!ELEMENT access EMPTY>
-<!ATTLIST access
- domain CDATA #IMPLIED
- path CDATA #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
- http-equiv CDATA #IMPLIED
- name CDATA #IMPLIED
- forua %boolean; #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
- %coreattrs;
- >
-
-<!--================ Tasks ================-->
-
-<!ELEMENT go (postfield | setvar)*>
-<!ATTLIST go
- href %HREF; #REQUIRED
- sendreferer %boolean; "false"
- method (post|get) "get"
- accept-charset CDATA #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT prev (setvar)*>
-<!ATTLIST prev
- %coreattrs;
- >
-
-<!ELEMENT refresh (setvar)*>
-<!ATTLIST refresh
- %coreattrs;
- >
-
-<!ELEMENT noop EMPTY>
-<!ATTLIST noop
- %coreattrs;
- >
-
-<!--================ postfield ================-->
-
-<!ELEMENT postfield EMPTY>
-<!ATTLIST postfield
- name %vdata; #REQUIRED
- value %vdata; #REQUIRED
- %coreattrs;
- >
-
-<!--================ variables ================-->
-
-<!ELEMENT setvar EMPTY>
-<!ATTLIST setvar
- name %vdata; #REQUIRED
- value %vdata; #REQUIRED
- %coreattrs;
- >
-
-<!--================ Card Fields ================-->
-
-<!ELEMENT select (optgroup|option)+>
-<!ATTLIST select
- title %vdata; #IMPLIED
- name NMTOKEN #IMPLIED
- value %vdata; #IMPLIED
- iname NMTOKEN #IMPLIED
- ivalue %vdata; #IMPLIED
- multiple %boolean; "false"
- tabindex %number; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT optgroup (optgroup|option)+ >
-<!ATTLIST optgroup
- title %vdata; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT option (#PCDATA | onevent)*>
-<!ATTLIST option
- value %vdata; #IMPLIED
- title %vdata; #IMPLIED
- onpick %HREF; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT input EMPTY>
-<!ATTLIST input
- name NMTOKEN #REQUIRED
- type (text|password) "text"
- value %vdata; #IMPLIED
- format CDATA #IMPLIED
- emptyok %boolean; "false"
- size %number; #IMPLIED
- maxlength %number; #IMPLIED
- tabindex %number; #IMPLIED
- title %vdata; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT fieldset (%fields; | do)* >
-<!ATTLIST fieldset
- title %vdata; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT timer EMPTY>
-<!ATTLIST timer
- name NMTOKEN #IMPLIED
- value %vdata; #REQUIRED
- %coreattrs;
- >
-
-<!--================ Images ================-->
-
-<!ENTITY % IAlign "(top|middle|bottom)" >
-
-<!ELEMENT img EMPTY>
-<!ATTLIST img
- alt %vdata; #REQUIRED
- src %HREF; #REQUIRED
- localsrc %vdata; #IMPLIED
- vspace %length; "0"
- hspace %length; "0"
- align %IAlign; "bottom"
- height %length; #IMPLIED
- width %length; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!--================ Anchor ================-->
-
-<!ELEMENT anchor ( #PCDATA | br | img | go | prev | refresh )*>
-<!ATTLIST anchor
- title %vdata; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT a ( #PCDATA | br | img )*>
-<!ATTLIST a
- href %HREF; #REQUIRED
- title %vdata; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!--================ Tables ================-->
-
-<!ELEMENT table (tr)+>
-<!ATTLIST table
- title %vdata; #IMPLIED
- align CDATA #IMPLIED
- columns %number; #REQUIRED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT tr (td)+>
-<!ATTLIST tr
- %coreattrs;
- >
-
-<!ELEMENT td ( %text; | %layout; | img | anchor | a )*>
-<!ATTLIST td
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!--================ Text layout and line breaks ================-->
-
-<!ELEMENT em (%flow;)*>
-<!ATTLIST em
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT strong (%flow;)*>
-<!ATTLIST strong
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT b (%flow;)*>
-<!ATTLIST b
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT i (%flow;)*>
-<!ATTLIST i
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT u (%flow;)*>
-<!ATTLIST u
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT big (%flow;)*>
-<!ATTLIST big
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT small (%flow;)*>
-<!ATTLIST small
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ENTITY % TAlign "(left|right|center)">
-<!ENTITY % WrapMode "(wrap|nowrap)" >
-<!ELEMENT p (%fields; | do)*>
-<!ATTLIST p
- align %TAlign; "left"
- mode %WrapMode; #IMPLIED
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ELEMENT br EMPTY>
-<!ATTLIST br
- xml:lang NMTOKEN #IMPLIED
- %coreattrs;
- >
-
-<!ENTITY quot "&#34;"> <!-- quotation mark -->
-<!ENTITY amp "&#38;#38;"> <!-- ampersand -->
-<!ENTITY apos "&#39;"> <!-- apostrophe -->
-<!ENTITY lt "&#38;#60;"> <!-- less than -->
-<!ENTITY gt "&#62;"> <!-- greater than -->
-<!ENTITY nbsp "&#160;"> <!-- non-breaking space -->
-<!ENTITY shy "&#173;"> <!-- soft hyphen (discretionary hyphen) -->
-
-<!--
-Copyright Wireless Application Protocol Forum Ltd., 1998,1999.
- All rights reserved.
--->
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/wml13.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/wml13.dtd
deleted file mode 100644
index c7d85b1806..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/wml13.dtd
+++ /dev/null
@@ -1,4 +0,0 @@
-<!-- Wireless Markup Language (WML) Document Type Definition. WML is an XML language. Typical usage: <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"> <wml> ... </wml> Terms and conditions of use are available from the Wireless Application Protocol Forum Ltd. web site at http://www.wapforum.org/docs/copyright.htm.
--->
- <!ENTITY % length "CDATA"> <!-- [0-9]+ for pixels or [0-9]+"%" for
-percentage length --> <!ENTITY % vdata "CDATA"> <!-- attribute value possibly containing variable references --> <!ENTITY % HREF "%vdata;"> <!-- URI, URL or URN designating a hypertext node. May contain variable references --> <!ENTITY % boolean "(true|false)"> <!ENTITY % number "NMTOKEN"> <!-- a number, with format [0-9]+ --> <!ENTITY % coreattrs "id ID #IMPLIED class CDATA #IMPLIED"> <!ENTITY % ContentType "%vdata;"> <!-- media type. May contain variable references --> <!ENTITY % emph "em | strong |b |i |u |big |small"> <!ENTITY % layout "br"> <!ENTITY % text "#PCDATA | %emph;"> <!-- flow covers "card-level" elements, such as text and images --> <!ENTITY % flow "%text; | %layout; | img | anchor |a |table"> <!-- Task types --> <!ENTITY % task "go | prev | noop | refresh"> <!-- Navigation and event elements --> <!ENTITY % navelmts "do | onevent"> <!--================ Decks and Cards ================--> <!ELEMENT wml ( head?, template?, card+ )> <!ATTLIST wml xml:lang NMTOKEN #IMPLIED %coreattrs; > <!-- card intrinsic events --> <!ENTITY % cardev "onenterforward %HREF; #IMPLIED onenterbackward %HREF; #IMPLIED ontimer %HREF; #IMPLIED" > <!-- card field types --> <!ENTITY % fields "%flow; | input | select | fieldset"> <!ELEMENT card (onevent*, timer?, (do | p | pre)*)> <!ATTLIST card title %vdata; #IMPLIED newcontext %boolean; "false" ordered %boolean; "true" xml:lang NMTOKEN #IMPLIED %cardev; %coreattrs; > <!--================ Event Bindings ================--> <!ELEMENT do (%task;)> <!ATTLIST do type CDATA #REQUIRED label %vdata; #IMPLIED name NMTOKEN #IMPLIED optional %boolean; "false" xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT onevent (%task;)> <!ATTLIST onevent type CDATA #REQUIRED %coreattrs; > <!--================ Deck-level declarations ================--> <!ELEMENT head ( access | meta )+> <!ATTLIST head %coreattrs; > <!ELEMENT template (%navelmts;)*> <!ATTLIST template %cardev; %coreattrs; > <!ELEMENT access EMPTY> <!ATTLIST access domain CDATA #IMPLIED path CDATA #IMPLIED %coreattrs; > <!ELEMENT meta EMPTY> <!ATTLIST meta http-equiv CDATA #IMPLIED name CDATA #IMPLIED forua %boolean; "false" content CDATA #REQUIRED scheme CDATA #IMPLIED %coreattrs; > <!--================ Tasks ================--> <!ENTITY % cache-control "(no-cache)" > <!ELEMENT go (postfield | setvar)*> <!ATTLIST go href %HREF; #REQUIRED sendreferer %boolean; "false" method (post|get) "get" enctype %ContentType; "application/x-www-form-urlencoded" cache-control %cache-control; #IMPLIED accept-charset CDATA #IMPLIED %coreattrs; > <!ELEMENT prev (setvar)*> <!ATTLIST prev %coreattrs; > <!ELEMENT refresh (setvar)*> <!ATTLIST refresh %coreattrs; > <!ELEMENT noop EMPTY> <!ATTLIST noop %coreattrs; > <!--================ postfield ================--> <!ELEMENT postfield EMPTY> <!ATTLIST postfield name %vdata; #REQUIRED value %vdata; #REQUIRED %coreattrs; > <!--================ variables ================--> <!ELEMENT setvar EMPTY> <!ATTLIST setvar name %vdata; #REQUIRED value %vdata; #REQUIRED %coreattrs; > <!--================ Card Fields ================--> <!ELEMENT select (optgroup|option)+> <!ATTLIST select title %vdata; #IMPLIED name NMTOKEN #IMPLIED value %vdata; #IMPLIED iname NMTOKEN #IMPLIED ivalue %vdata; #IMPLIED multiple %boolean; "false" tabindex %number; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT optgroup (optgroup|option)+ > <!ATTLIST optgroup title %vdata; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT option (#PCDATA | onevent)*> <!ATTLIST option value %vdata; #IMPLIED title %vdata; #IMPLIED onpick %HREF; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT input EMPTY> <!ATTLIST input name NMTOKEN #REQUIRED type (text|password) "text" value %vdata; #IMPLIED format CDATA #IMPLIED emptyok %boolean; #IMPLIED size %number; #IMPLIED maxlength %number; #IMPLIED tabindex %number; #IMPLIED title %vdata; #IMPLIED accesskey %vdata; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT fieldset (%fields; | do)* > <!ATTLIST fieldset title %vdata; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT timer EMPTY> <!ATTLIST timer name NMTOKEN #IMPLIED value %vdata; #REQUIRED %coreattrs; > <!--================ Images ================--> <!ENTITY % IAlign "(top|middle|bottom)" > <!ELEMENT img EMPTY> <!ATTLIST img alt %vdata; #REQUIRED src %HREF; #REQUIRED localsrc %vdata; #IMPLIED vspace %length; "0" hspace %length; "0" align %IAlign; "bottom" height %length; #IMPLIED width %length; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!--================ Anchor ================--> <!ELEMENT anchor ( #PCDATA | br | img | go | prev | refresh )*> <!ATTLIST anchor title %vdata; #IMPLIED accesskey %vdata; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT a ( #PCDATA | br | img )*> <!ATTLIST a href %HREF; #REQUIRED title %vdata; #IMPLIED accesskey %vdata; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!--================ Tables ================--> <!ELEMENT table (tr)+> <!ATTLIST table title %vdata; #IMPLIED align CDATA #IMPLIED columns %number; #REQUIRED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT tr (td)+> <!ATTLIST tr %coreattrs; > <!ELEMENT td ( %text; | %layout; | img | anchor |a )*> <!ATTLIST td xml:lang NMTOKEN #IMPLIED %coreattrs; > <!--================ Text layout and line breaks ================--> <!ELEMENT em (%flow;)*> <!ATTLIST em xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT strong (%flow;)*> <!ATTLIST strong xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT b (%flow;)*> <!ATTLIST b xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT i (%flow;)*> <!ATTLIST i xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT u (%flow;)*> <!ATTLIST u xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT big (%flow;)*> <!ATTLIST big xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT small (%flow;)*> <!ATTLIST small xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ENTITY % TAlign "(left|right|center)"> <!ENTITY % WrapMode "(wrap|nowrap)" > <!ELEMENT p (%fields; | do)*> <!ATTLIST p align %TAlign; "left" mode %WrapMode; #IMPLIED xml:lang NMTOKEN #IMPLIED %coreattrs; > <!ELEMENT br EMPTY> <!ATTLIST br %coreattrs; > <!ELEMENT pre (#PCDATA | a | anchor | do | u | br | i | b | em | strong | input | select )*> <!ATTLIST pre xml:space CDATA #FIXED "preserve" %coreattrs; > <!ENTITY quot "&#34;"> <!-- quotation mark --> <!ENTITY amp "&#38;#38;"> <!-- ampersand --> <!ENTITY apos "&#39;"> <!-- apostrophe --> <!ENTITY lt "&#38;#60;"> <!-- less than --> <!ENTITY gt "&#62;"> <!-- greater than --> <!ENTITY nbsp "&#160;"> <!-- non-breaking space --> <!ENTITY shy "&#173;"> <!-- soft hyphen (discretionary hyphen) --> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-basic10-f.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-basic10-f.dtd
deleted file mode 100644
index 5b3d25d11f..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-basic10-f.dtd
+++ /dev/null
@@ -1,3086 +0,0 @@
-<!-- XHTML Basic 1.0 DTD ...................................................... -->
-<!-- file: xhtml-basic10.dtd -->
-
-<!-- XHTML Basic 1.0 DTD
-
- This is XHTML Basic, a proper subset of XHTML.
-
- The Extensible HyperText Markup Language (XHTML)
- Copyright 1998-2000 World Wide Web Consortium
- (Massachusetts Institute of Technology, Institut National de
- Recherche en Informatique et en Automatique, Keio University).
- All Rights Reserved.
-
- Permission to use, copy, modify and distribute the XHTML Basic DTD
- and its accompanying documentation for any purpose and without fee is
- hereby granted in perpetuity, provided that the above copyright notice
- and this paragraph appear in all copies. The copyright holders make
- no representation about the suitability of the DTD for any purpose.
-
- It is provided "as is" without expressed or implied warranty.
-
- Editors: Murray M. Altheim <mailto:altheim@eng.sun.com>
- Peter Stark <mailto:Peter.Stark@ecs.ericsson.se>
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
--->
-<!-- This is the driver file for version 1.0 of the XHTML Basic DTD.
-
- This DTD is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC: "-//W3C//DTD XHTML Basic 1.0//EN"
- SYSTEM: "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"
--->
-<!ENTITY % XHTML.version "-//W3C//DTD XHTML Basic 1.0//EN" >
-
-<!-- Use this URI to identify the default namespace:
-
- "http://www.w3.org/1999/xhtml"
-
- See the Qualified Names module for information
- on the use of namespace prefixes in the DTD.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefix "" >
-
-<!-- Reserved for use with the XLink namespace:
--->
-<!ENTITY % XLINK.xmlns "" >
-<!ENTITY % XLINK.xmlns.attrib "" >
-
-<!-- For example, if you are using XHTML Basic 1.0 directly, use
- the FPI in the DOCTYPE declaration, with the xmlns attribute
- on the document element to identify the default namespace:
-
- <?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
- "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd" >
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en" >
- ...
- </html>
--->
-
-<!-- reserved for future use with document profiles -->
-<!ENTITY % XHTML.profile "" >
-
-<!-- Bidirectional Text features
- This feature-test entity is used to declare elements
- and attributes used for bidirectional text support.
--->
-<!ENTITY % XHTML.bidi "IGNORE" >
-
-<?doc type="doctype" role="title" { XHTML Basic 1.0 } ?>
-
-<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
-
-<!ENTITY % xhtml-events.module "IGNORE" >
-<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
-
-<!ENTITY % xhtml-model.mod
- PUBLIC "-//W3C//ENTITIES XHTML Basic 1.0 Document Model 1.0//EN"
- "xhtml-basic10-model-1.mod" >
-
-<!ENTITY % xhtml-framework.mod
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- "xhtml-framework-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Modular Framework Module ...................................... -->
-<!-- file: xhtml-framework-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-framework-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Modular Framework
-
- This required module instantiates the modules needed
- to support the XHTML modularization model, including:
-
- + notations
- + datatypes
- + namespace-qualified names
- + common attributes
- + document model
- + character entities
-
- The Intrinsic Events module is ignored by default but
- occurs in this module because it must be instantiated
- prior to Attributes but after Datatypes.
--->
-
-<!ENTITY % xhtml-arch.module "INCLUDE" >
-<![%xhtml-arch.module;[
-<!ENTITY % xhtml-arch.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
- "xhtml-arch-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Base Architecture Module ...................................... -->
-<!-- file: xhtml-arch-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-arch-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- This optional module includes declarations that enable XHTML to be used
- as a base architecture according to the 'Architectural Forms Definition
- Requirements' (Annex A.3, ISO/IEC 10744, 2nd edition). For more information
- on use of architectural forms, see the HyTime web site at:
-
- http://www.hytime.org/
--->
-
-<?IS10744 ArcBase xhtml ?>
-
-<!NOTATION xhtml PUBLIC "-//W3C//NOTATION AFDR ARCBASE XHTML 1.1//EN" >
-
-<!-- Entity declaration for associated Architectural DTD
--->
-<!ENTITY xhtml-arch.dtd
- PUBLIC "-//W3C//DTD XHTML Architecture 1.1//EN"
- "xhtml11-arch.dtd" >
-
-<?IS10744:arch xhtml
- public-id = "-//W3C//NOTATION AFDR ARCBASE XHTML 1.1//EN"
- dtd-public-id = "-//W3C//DTD XHTML 1.1//EN"
- dtd-system-id = "xhtml11.dtd"
- doc-elem-form = "html"
- form-att = "html"
- renamer-att = "htnames"
- suppressor-att = "htsupp"
- data-ignore-att = "htign"
- auto = "ArcAuto"
- options = "HtModReq HtModOpt"
- HtModReq = "Framework Text Hypertext Lists Structure"
- HtModOpt = "Standard"
-?>
-
-<!-- end of xhtml-arch-1.mod -->
-]]>
-
-<!ENTITY % xhtml-notations.module "INCLUDE" >
-<![%xhtml-notations.module;[
-<!ENTITY % xhtml-notations.mod
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- "xhtml-notations-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Notations Module .............................................. -->
-<!-- file: xhtml-notations-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-notations-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Notations
-
- defines the following notations, many of these imported from
- other specifications and standards. When an existing FPI is
- known, it is incorporated here.
--->
-
-<!-- XML Notations ..................................... -->
-<!-- SGML and XML Notations ............................ -->
-
-<!-- W3C XML 1.0 Recommendation -->
-<!NOTATION w3c-xml
- PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN" >
-
-<!-- XML 1.0 CDATA -->
-<!NOTATION cdata
- PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN" >
-
-<!-- SGML Formal Public Identifiers -->
-<!NOTATION fpi
- PUBLIC "ISO 8879:1986//NOTATION Formal Public Identifier//EN" >
-
-<!-- XHTML Notations ................................... -->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!NOTATION length
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN" >
-
-<!-- space-separated list of link types -->
-<!NOTATION linkTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!NOTATION mediaDesc
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN" >
-
-<!-- pixel, percentage, or relative -->
-<!NOTATION multiLength
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN" >
-
-<!-- one or more digits (NUMBER) -->
-<!NOTATION number
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN" >
-
-<!-- integer representing length in pixels -->
-<!NOTATION pixels
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN" >
-
-<!-- script expression -->
-<!NOTATION script
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Script//EN" >
-
-<!-- textual content -->
-<!NOTATION text
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN" >
-
-<!-- Imported Notations ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!NOTATION character
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Character//EN" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!NOTATION charset
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charset//EN" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!NOTATION charsets
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charsets//EN" >
-
-<!-- media type, as per [RFC2045] -->
-<!NOTATION contentType
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!NOTATION contentTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentTypes//EN" >
-
-<!-- date and time information. ISO date format -->
-<!NOTATION datetime
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN" >
-
-<!-- a language code, as per [RFC1766] -->
-<!NOTATION languageCode
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!NOTATION uri
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!NOTATION uris
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN" >
-
-<!-- end of xhtml-notations-1.mod -->
-]]>
-
-<!ENTITY % xhtml-datatypes.module "INCLUDE" >
-<![%xhtml-datatypes.module;[
-<!ENTITY % xhtml-datatypes.mod
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- "xhtml-datatypes-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Datatypes Module .............................................. -->
-<!-- file: xhtml-datatypes-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-datatypes-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Datatypes
-
- defines containers for the following datatypes, many of
- these imported from other specifications and standards.
--->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!ENTITY % Length.datatype "CDATA" >
-
-<!-- space-separated list of link types -->
-<!ENTITY % LinkTypes.datatype "NMTOKENS" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!ENTITY % MediaDesc.datatype "CDATA" >
-
-<!-- pixel, percentage, or relative -->
-<!ENTITY % MultiLength.datatype "CDATA" >
-
-<!-- one or more digits (NUMBER) -->
-<!ENTITY % Number.datatype "CDATA" >
-
-<!-- integer representing length in pixels -->
-<!ENTITY % Pixels.datatype "CDATA" >
-
-<!-- script expression -->
-<!ENTITY % Script.datatype "CDATA" >
-
-<!-- textual content -->
-<!ENTITY % Text.datatype "CDATA" >
-
-<!-- Imported Datatypes ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!ENTITY % Character.datatype "CDATA" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!ENTITY % Charset.datatype "CDATA" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!ENTITY % Charsets.datatype "CDATA" >
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType.datatype "CDATA" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!ENTITY % ContentTypes.datatype "CDATA" >
-
-<!-- date and time information. ISO date format -->
-<!ENTITY % Datetime.datatype "CDATA" >
-
-<!-- formal public identifier, as per [ISO8879] -->
-<!ENTITY % FPI.datatype "CDATA" >
-
-<!-- a language code, as per [RFC1766] -->
-<!ENTITY % LanguageCode.datatype "NMTOKEN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!ENTITY % URI.datatype "CDATA" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!ENTITY % URIs.datatype "CDATA" >
-
-<!-- end of xhtml-datatypes-1.mod -->
-]]>
-
-<!-- placeholder for XLink support module -->
-<!ENTITY % xhtml-xlink.mod "" >
-
-
-<!ENTITY % xhtml-qname.module "INCLUDE" >
-<![%xhtml-qname.module;[
-<!ENTITY % xhtml-qname.mod
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- "xhtml-qname-1.mod" >
-<!-- ....................................................................... -->
-<!-- XHTML Qname Module ................................................... -->
-<!-- file: xhtml-qname-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-qname-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- XHTML Qname (Qualified Name) Module
-
- This module is contained in two parts, labeled Section 'A' and 'B':
-
- Section A declares parameter entities to support namespace-
- qualified names, namespace declarations, and name prefixing
- for XHTML and extensions.
-
- Section B declares parameter entities used to provide
- namespace-qualified names for all XHTML element types:
-
- %applet.qname; the xmlns-qualified name for <applet>
- %base.qname; the xmlns-qualified name for <base>
- ...
-
- XHTML extensions would create a module similar to this one.
- Included in the XHTML distribution is a template module
- ('template-qname-1.mod') suitable for this purpose.
--->
-
-<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
-
-<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
- to activate namespace prefixing. The default value should
- inherit '%NS.prefixed;' from the DTD driver, so that unless
- overridden, the default behaviour follows the overall DTD
- prefixing scheme.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
-
-<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
- the URI reference used to identify the XHTML namespace:
--->
-<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" >
-
-<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
- the default namespace prefix string(s) to use when prefixing
- is enabled. This may be overridden in the DTD driver or the
- internal subset of an document instance. If no default prefix
- is desired, this may be declared as an empty string.
-
- NOTE: As specified in [XMLNAMES], the namespace prefix serves
- as a proxy for the URI reference, and is not in itself significant.
--->
-<!ENTITY % XHTML.prefix "" >
-
-<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
- colonized prefix(es) (eg., '%XHTML.prefix;:') used when
- prefixing is active, an empty string when it is not.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.pfx "%XHTML.prefix;:" >
-]]>
-<!ENTITY % XHTML.pfx "" >
-
-<!-- declare qualified name extensions here ............ -->
-<!ENTITY % xhtml-qname-extra.mod "" >
-
-
-<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
- redeclared to contain any non-XHTML namespace declaration
- attributes for namespaces embedded in XHTML. The default
- is an empty string. XLink should be included here if used
- in the DTD.
--->
-<!ENTITY % XHTML.xmlns.extra.attrib "" >
-
-<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing
- all XML Namespace declarations used in the DTD, plus the
- xmlns declaration for XHTML, its form dependent on whether
- prefixing is active.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % NS.decl.attrib
- "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XHTML.xmlns.extra.attrib;"
->
-]]>
-<!ENTITY % NS.decl.attrib
- "%XHTML.xmlns.extra.attrib;"
->
-
-<!-- This is a placeholder for future XLink support.
--->
-<!ENTITY % XLINK.xmlns.attrib "" >
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing all
- XML namespace declaration attributes used by XHTML, including
- a default xmlns attribute when prefixing is inactive.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.xmlns.attrib
- "%NS.decl.attrib;
- %XLINK.xmlns.attrib;"
->
-]]>
-<!ENTITY % XHTML.xmlns.attrib
- "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XLINK.xmlns.attrib;"
->
-
-<!-- placeholder for qualified name redeclarations -->
-<!ENTITY % xhtml-qname.redecl "" >
-
-
-<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
-
-<!-- 6. This section declares parameter entities used to provide
- namespace-qualified names for all XHTML element types.
--->
-
-<!-- module: xhtml-applet-1.mod -->
-<!ENTITY % applet.qname "%XHTML.pfx;applet" >
-
-<!-- module: xhtml-base-1.mod -->
-<!ENTITY % base.qname "%XHTML.pfx;base" >
-
-<!-- module: xhtml-bdo-1.mod -->
-<!ENTITY % bdo.qname "%XHTML.pfx;bdo" >
-
-<!-- module: xhtml-blkphras-1.mod -->
-<!ENTITY % address.qname "%XHTML.pfx;address" >
-<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" >
-<!ENTITY % pre.qname "%XHTML.pfx;pre" >
-<!ENTITY % h1.qname "%XHTML.pfx;h1" >
-<!ENTITY % h2.qname "%XHTML.pfx;h2" >
-<!ENTITY % h3.qname "%XHTML.pfx;h3" >
-<!ENTITY % h4.qname "%XHTML.pfx;h4" >
-<!ENTITY % h5.qname "%XHTML.pfx;h5" >
-<!ENTITY % h6.qname "%XHTML.pfx;h6" >
-
-<!-- module: xhtml-blkpres-1.mod -->
-<!ENTITY % hr.qname "%XHTML.pfx;hr" >
-
-<!-- module: xhtml-blkstruct-1.mod -->
-<!ENTITY % div.qname "%XHTML.pfx;div" >
-<!ENTITY % p.qname "%XHTML.pfx;p" >
-
-<!-- module: xhtml-edit-1.mod -->
-<!ENTITY % ins.qname "%XHTML.pfx;ins" >
-<!ENTITY % del.qname "%XHTML.pfx;del" >
-
-<!-- module: xhtml-form-1.mod -->
-<!ENTITY % form.qname "%XHTML.pfx;form" >
-<!ENTITY % label.qname "%XHTML.pfx;label" >
-<!ENTITY % input.qname "%XHTML.pfx;input" >
-<!ENTITY % select.qname "%XHTML.pfx;select" >
-<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" >
-<!ENTITY % option.qname "%XHTML.pfx;option" >
-<!ENTITY % textarea.qname "%XHTML.pfx;textarea" >
-<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" >
-<!ENTITY % legend.qname "%XHTML.pfx;legend" >
-<!ENTITY % button.qname "%XHTML.pfx;button" >
-
-<!-- module: xhtml-hypertext-1.mod -->
-<!ENTITY % a.qname "%XHTML.pfx;a" >
-
-<!-- module: xhtml-image-1.mod -->
-<!ENTITY % img.qname "%XHTML.pfx;img" >
-
-<!-- module: xhtml-inlphras-1.mod -->
-<!ENTITY % abbr.qname "%XHTML.pfx;abbr" >
-<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
-<!ENTITY % cite.qname "%XHTML.pfx;cite" >
-<!ENTITY % code.qname "%XHTML.pfx;code" >
-<!ENTITY % dfn.qname "%XHTML.pfx;dfn" >
-<!ENTITY % em.qname "%XHTML.pfx;em" >
-<!ENTITY % kbd.qname "%XHTML.pfx;kbd" >
-<!ENTITY % q.qname "%XHTML.pfx;q" >
-<!ENTITY % samp.qname "%XHTML.pfx;samp" >
-<!ENTITY % strong.qname "%XHTML.pfx;strong" >
-<!ENTITY % var.qname "%XHTML.pfx;var" >
-
-<!-- module: xhtml-inlpres-1.mod -->
-<!ENTITY % b.qname "%XHTML.pfx;b" >
-<!ENTITY % big.qname "%XHTML.pfx;big" >
-<!ENTITY % i.qname "%XHTML.pfx;i" >
-<!ENTITY % small.qname "%XHTML.pfx;small" >
-<!ENTITY % sub.qname "%XHTML.pfx;sub" >
-<!ENTITY % sup.qname "%XHTML.pfx;sup" >
-<!ENTITY % tt.qname "%XHTML.pfx;tt" >
-
-<!-- module: xhtml-inlstruct-1.mod -->
-<!ENTITY % br.qname "%XHTML.pfx;br" >
-<!ENTITY % span.qname "%XHTML.pfx;span" >
-
-<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) -->
-<!ENTITY % map.qname "%XHTML.pfx;map" >
-<!ENTITY % area.qname "%XHTML.pfx;area" >
-
-<!-- module: xhtml-link-1.mod -->
-<!ENTITY % link.qname "%XHTML.pfx;link" >
-
-<!-- module: xhtml-list-1.mod -->
-<!ENTITY % dl.qname "%XHTML.pfx;dl" >
-<!ENTITY % dt.qname "%XHTML.pfx;dt" >
-<!ENTITY % dd.qname "%XHTML.pfx;dd" >
-<!ENTITY % ol.qname "%XHTML.pfx;ol" >
-<!ENTITY % ul.qname "%XHTML.pfx;ul" >
-<!ENTITY % li.qname "%XHTML.pfx;li" >
-
-<!-- module: xhtml-meta-1.mod -->
-<!ENTITY % meta.qname "%XHTML.pfx;meta" >
-
-<!-- module: xhtml-param-1.mod -->
-<!ENTITY % param.qname "%XHTML.pfx;param" >
-
-<!-- module: xhtml-object-1.mod -->
-<!ENTITY % object.qname "%XHTML.pfx;object" >
-
-<!-- module: xhtml-script-1.mod -->
-<!ENTITY % script.qname "%XHTML.pfx;script" >
-<!ENTITY % noscript.qname "%XHTML.pfx;noscript" >
-
-<!-- module: xhtml-struct-1.mod -->
-<!ENTITY % html.qname "%XHTML.pfx;html" >
-<!ENTITY % head.qname "%XHTML.pfx;head" >
-<!ENTITY % title.qname "%XHTML.pfx;title" >
-<!ENTITY % body.qname "%XHTML.pfx;body" >
-
-<!-- module: xhtml-style-1.mod -->
-<!ENTITY % style.qname "%XHTML.pfx;style" >
-
-<!-- module: xhtml-table-1.mod -->
-<!ENTITY % table.qname "%XHTML.pfx;table" >
-<!ENTITY % caption.qname "%XHTML.pfx;caption" >
-<!ENTITY % thead.qname "%XHTML.pfx;thead" >
-<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" >
-<!ENTITY % tbody.qname "%XHTML.pfx;tbody" >
-<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" >
-<!ENTITY % col.qname "%XHTML.pfx;col" >
-<!ENTITY % tr.qname "%XHTML.pfx;tr" >
-<!ENTITY % th.qname "%XHTML.pfx;th" >
-<!ENTITY % td.qname "%XHTML.pfx;td" >
-
-
-<!-- Provisional XHTML 2.0 Qualified Names ...................... -->
-
-<!-- module: xhtml-image-2.mod -->
-<!ENTITY % alt.qname "%XHTML.pfx;alt" >
-
-<!-- end of xhtml-qname-1.mod -->
-]]>
-
-<!ENTITY % xhtml-events.module "IGNORE" >
-<![%xhtml-events.module;[
-<!ENTITY % xhtml-events.mod
- PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
- "xhtml-events-1.mod" >
-%xhtml-events.mod;]]>
-
-<!ENTITY % xhtml-attribs.module "INCLUDE" >
-<![%xhtml-attribs.module;[
-<!ENTITY % xhtml-attribs.mod
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- "xhtml-attribs-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Common Attributes Module ...................................... -->
-<!-- file: xhtml-attribs-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-attribs-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Common Attributes
-
- This module declares many of the common attributes for the XHTML DTD.
- %NS.decl.attrib; is declared in the XHTML Qname module.
--->
-
-<!ENTITY % id.attrib
- "id ID #IMPLIED"
->
-
-<!ENTITY % class.attrib
- "class NMTOKENS #IMPLIED"
->
-
-<!ENTITY % title.attrib
- "title %Text.datatype; #IMPLIED"
->
-
-<!ENTITY % Core.extra.attrib "" >
-
-<!ENTITY % Core.attrib
- "%XHTML.xmlns.attrib;
- %id.attrib;
- %class.attrib;
- %title.attrib;
- %Core.extra.attrib;"
->
-
-<!ENTITY % lang.attrib
- "xml:lang %LanguageCode.datatype; #IMPLIED"
->
-
-<![%XHTML.bidi;[
-<!ENTITY % dir.attrib
- "dir ( ltr | rtl ) #IMPLIED"
->
-
-<!ENTITY % I18n.attrib
- "%dir.attrib;
- %lang.attrib;"
->
-
-]]>
-<!ENTITY % I18n.attrib
- "%lang.attrib;"
->
-
-<!ENTITY % Common.extra.attrib "" >
-
-<!-- intrinsic event attributes declared previously
--->
-<!ENTITY % Events.attrib "" >
-
-<!ENTITY % Common.attrib
- "%Core.attrib;
- %I18n.attrib;
- %Events.attrib;
- %Common.extra.attrib;"
->
-
-<!-- end of xhtml-attribs-1.mod -->
-]]>
-
-<!-- placeholder for content model redeclarations -->
-<!ENTITY % xhtml-model.redecl "" >
-
-
-<!ENTITY % xhtml-model.module "INCLUDE" >
-<![%xhtml-model.module;[
-<!-- instantiate the Document Model module declared in the DTD driver
--->
-<!-- ....................................................................... -->
-<!-- XHTML Basic 1.0 Document Model Module .................................... -->
-<!-- file: xhtml-basic10-model-1.mod
-
- This is XHTML Basic, a proper subset of XHTML.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Basic 1.0 Document Model 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-basic/xhtml-basic10-model-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- XHTML Basic Document Model
-
- This module describes the groupings of elements that make up
- common content models for XHTML elements.
--->
-
-<!-- Optional Elements in head .............. -->
-
-<!ENTITY % HeadOpts.mix
- "( %meta.qname; | %link.qname; | %object.qname; )*" >
-
-<!-- Miscellaneous Elements ................. -->
-
-<!ENTITY % Misc.class "" >
-
-<!-- Inline Elements ........................ -->
-
-<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
-
-<!ENTITY % InlPhras.class
- "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
- | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
- | %abbr.qname; | %acronym.qname; | %q.qname;" >
-
-<!ENTITY % InlPres.class "" >
-
-<!ENTITY % I18n.class "" >
-
-<!ENTITY % Anchor.class "| %a.qname;" >
-
-<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
-
-<!ENTITY % InlForm.class
- "| %input.qname; | %select.qname; | %textarea.qname;
- | %label.qname;"
->
-
-<!ENTITY % Inline.extra "" >
-
-<!ENTITY % Inline.class
- "%InlStruct.class;
- %InlPhras.class;
- %Anchor.class;
- %InlSpecial.class;
- %InlForm.class;
- %Inline.extra;"
->
-
-<!ENTITY % InlNoAnchor.class
- "%InlStruct.class;
- %InlPhras.class;
- %InlSpecial.class;
- %InlForm.class;
- %Inline.extra;"
->
-
-<!ENTITY % InlNoAnchor.mix
- "%InlNoAnchor.class;
- %Misc.class;"
->
-
-<!ENTITY % Inline.mix
- "%Inline.class;
- %Misc.class;"
->
-
-<!-- Block Elements ......................... -->
-
-<!ENTITY % Heading.class
- "%h1.qname; | %h2.qname; | %h3.qname;
- | %h4.qname; | %h5.qname; | %h6.qname;"
->
-<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
-
-<!ENTITY % Table.class "| %table.qname;" >
-
-<!ENTITY % Form.class "| %form.qname;" >
-
-<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
-
-<!ENTITY % BlkPhras.class
- "| %pre.qname; | %blockquote.qname; | %address.qname;"
->
-
-<!ENTITY % BlkPres.class "" >
-
-<!ENTITY % BlkSpecial.class
- "%Table.class;
- %Form.class;"
->
-
-<!ENTITY % Block.extra "" >
-
-<!ENTITY % Block.class
- "%BlkStruct.class;
- %BlkPhras.class;
- %BlkSpecial.class;
- %Block.extra;"
->
-
-<!ENTITY % Block.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- %Misc.class;"
->
-
-<!-- All Content Elements ................... -->
-
-<!-- declares all content except tables
--->
-<!ENTITY % FlowNoTable.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %Form.class;
- %Block.extra;
- | %Inline.class;
- %Misc.class;"
->
-
-<!ENTITY % Flow.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- | %Inline.class;
- %Misc.class;"
->
-
-<!-- end of xhtml-basic10-model-1.mod -->
-]]>
-
-<!ENTITY % xhtml-charent.module "INCLUDE" >
-<![%xhtml-charent.module;[
-<!ENTITY % xhtml-charent.mod
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- "xhtml-charent-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Character Entities Module ......................................... -->
-<!-- file: xhtml-charent-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-charent-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Character Entities for XHTML
-
- This module declares the set of character entities for XHTML,
- including the Latin 1, Symbol and Special character collections.
--->
-
-<!ENTITY % xhtml-lat1
- PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent" >
-<!ENTITY % xhtml-symbol
- PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent" >
-<!ENTITY % xhtml-special
- PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent" >
-
-<!-- Portions (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
- %HTMLlat1;
--->
-
-<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
- U+00A0 ISOnum -->
-<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
- U+00A6 ISOnum -->
-<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
-<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
- U+00A8 ISOdia -->
-<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
- = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not "&#172;"> <!-- not sign = discretionary hyphen,
- U+00AC ISOnum -->
-<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
- U+00AD ISOnum -->
-<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
- U+00AE ISOnum -->
-<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
- = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
- U+00B1 ISOnum -->
-<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
- = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
- = cubed, U+00B3 ISOnum -->
-<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
- U+00B4 ISOdia -->
-<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
-<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
- U+00B6 ISOnum -->
-<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
- U+00B9 ISOnum -->
-<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
- U+00BA ISOnum -->
-<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
- = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
- = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
- = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest "&#191;"> <!-- inverted question mark
- = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
- = latin capital letter A grave,
- U+00C0 ISOlat1 -->
-<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
- U+00C1 ISOlat1 -->
-<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
- U+00C2 ISOlat1 -->
-<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
- U+00C3 ISOlat1 -->
-<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
- U+00C4 ISOlat1 -->
-<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
- = latin capital letter A ring,
- U+00C5 ISOlat1 -->
-<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
- = latin capital ligature AE,
- U+00C6 ISOlat1 -->
-<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
- U+00C7 ISOlat1 -->
-<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
- U+00C8 ISOlat1 -->
-<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
- U+00C9 ISOlat1 -->
-<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
- U+00CA ISOlat1 -->
-<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
- U+00CB ISOlat1 -->
-<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
- U+00CC ISOlat1 -->
-<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
- U+00CD ISOlat1 -->
-<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
- U+00CE ISOlat1 -->
-<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
- U+00CF ISOlat1 -->
-<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
- U+00D1 ISOlat1 -->
-<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
- U+00D2 ISOlat1 -->
-<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
- U+00D3 ISOlat1 -->
-<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
- U+00D4 ISOlat1 -->
-<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
- U+00D5 ISOlat1 -->
-<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
- U+00D6 ISOlat1 -->
-<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
- = latin capital letter O slash,
- U+00D8 ISOlat1 -->
-<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
- U+00D9 ISOlat1 -->
-<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
- U+00DA ISOlat1 -->
-<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
- U+00DB ISOlat1 -->
-<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
- U+00DC ISOlat1 -->
-<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
- U+00DD ISOlat1 -->
-<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
- U+00DE ISOlat1 -->
-<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
- U+00DF ISOlat1 -->
-<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
- = latin small letter a grave,
- U+00E0 ISOlat1 -->
-<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
- U+00E1 ISOlat1 -->
-<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
- U+00E2 ISOlat1 -->
-<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
- U+00E3 ISOlat1 -->
-<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
- U+00E4 ISOlat1 -->
-<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
- = latin small letter a ring,
- U+00E5 ISOlat1 -->
-<!ENTITY aelig "&#230;"> <!-- latin small letter ae
- = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
- U+00E7 ISOlat1 -->
-<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
- U+00E8 ISOlat1 -->
-<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
- U+00E9 ISOlat1 -->
-<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
- U+00EA ISOlat1 -->
-<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
- U+00EB ISOlat1 -->
-<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
- U+00EC ISOlat1 -->
-<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
- U+00ED ISOlat1 -->
-<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
- U+00EE ISOlat1 -->
-<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
- U+00EF ISOlat1 -->
-<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
- U+00F1 ISOlat1 -->
-<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
- U+00F2 ISOlat1 -->
-<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
- U+00F3 ISOlat1 -->
-<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
- U+00F4 ISOlat1 -->
-<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
- U+00F5 ISOlat1 -->
-<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
- U+00F6 ISOlat1 -->
-<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
- = latin small letter o slash,
- U+00F8 ISOlat1 -->
-<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
- U+00F9 ISOlat1 -->
-<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
- U+00FA ISOlat1 -->
-<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
- U+00FB ISOlat1 -->
-<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
- U+00FC ISOlat1 -->
-<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
- U+00FD ISOlat1 -->
-<!ENTITY thorn "&#254;"> <!-- latin small letter thorn with,
- U+00FE ISOlat1 -->
-<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
- U+00FF ISOlat1 -->
-
-<!-- Mathematical, Greek and Symbolic characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
- %HTMLsymbol;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof "&#402;"> <!-- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
- U+0393 ISOgrk3 -->
-<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
- U+0394 ISOgrk3 -->
-<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
-<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
- U+0398 ISOgrk3 -->
-<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda "&#923;"> <!-- greek capital letter lambda,
- U+039B ISOgrk3 -->
-<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
-<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
-<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
-<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
- U+03A3 ISOgrk3 -->
-<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
- U+03A6 ISOgrk3 -->
-<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
- U+03A8 ISOgrk3 -->
-<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
- U+03A9 ISOgrk3 -->
-
-<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
- U+03B1 ISOgrk3 -->
-<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
- U+03B3 ISOgrk3 -->
-<!ENTITY delta "&#948;"> <!-- greek small letter delta,
- U+03B4 ISOgrk3 -->
-<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
- U+03B5 ISOgrk3 -->
-<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta "&#952;"> <!-- greek small letter theta,
- U+03B8 ISOgrk3 -->
-<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
- U+03BA ISOgrk3 -->
-<!ENTITY lambda "&#955;"> <!-- greek small letter lambda,
- U+03BB ISOgrk3 -->
-<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
- U+03C2 ISOgrk3 -->
-<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
- U+03C3 ISOgrk3 -->
-<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
- U+03C5 ISOgrk3 -->
-<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega "&#969;"> <!-- greek small letter omega,
- U+03C9 ISOgrk3 -->
-<!ENTITY thetasym "&#977;"> <!-- greek small letter theta symbol,
- U+03D1 NEW -->
-<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
- U+03D2 NEW -->
-<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
- U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
- U+2026 ISOpub -->
-<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
- U+2033 ISOtech -->
-<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
- U+203E NEW -->
-<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
- = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image "&#8465;"> <!-- blackletter capital I = imaginary part,
- U+2111 ISOamso -->
-<!ENTITY real "&#8476;"> <!-- blackletter capital R = real part symbol,
- U+211C ISOamso -->
-<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
- U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef,
- U+05D0 although the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
-<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
- U+21D2 ISOtech -->
-<!-- Unicode does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
- U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
-<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
-<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
-<!ENTITY empty "&#8709;"> <!-- empty set = null set = diameter,
- U+2205 ISOamso -->
-<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
- U+2207 ISOtech -->
-<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
-<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
-<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
- U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum "&#8721;"> <!-- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
- U+221A ISOtech -->
-<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
-<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
-<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
-<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
-<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
-<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
-<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
- U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
- U+2248 ISOamsr -->
-<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
-<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
- U+2265 ISOtech -->
-<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
-<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
- U+2287 ISOtech -->
-<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
- U+2295 ISOamsb -->
-<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
- U+2297 ISOamsb -->
-<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
- U+22A5 ISOtech -->
-<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil "&#8968;"> <!-- left ceiling = apl upstile,
- U+2308 ISOamsc -->
-<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor "&#8970;"> <!-- left floor = apl downstile,
- U+230A ISOamsc -->
-<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
-<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
- U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
- U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
- U+2663 ISOpub -->
-<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
- U+2665 ISOpub -->
-<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
-
-<!-- Special characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
- %HTMLspecial;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY quot "&#34;"> <!-- quotation mark = APL quote,
- U+0022 ISOnum -->
-<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
-<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
-<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
-<!ENTITY apos "&#39;"> <!-- apostrophe mark, U+0027 ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
- U+0152 ISOlat2 -->
-<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
- U+0160 ISOlat2 -->
-<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
- U+0161 ISOlat2 -->
-<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
- U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
- U+02C6 ISOpub -->
-<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
-<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
-<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
- U+200C NEW RFC 2070 -->
-<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
-<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
- U+2018 ISOnum -->
-<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
- U+2019 ISOnum -->
-<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
- U+201C ISOnum -->
-<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
- U+201D ISOnum -->
-<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
-<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
-<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
- U+2039 ISO proposed -->
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
- U+203A ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
-
-
-<!-- end of xhtml-charent-1.mod -->
-]]>
-
-<!-- end of xhtml-framework-1.mod -->
-
-
-<!ENTITY % pre.content
- "( #PCDATA
- | %InlStruct.class;
- %InlPhras.class;
- %Anchor.class;
- %Inline.extra; )*"
->
-
-<!ENTITY % xhtml-text.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- "xhtml-text-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Text Module ................................................... -->
-<!-- file: xhtml-text-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-text-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Textual Content
-
- The Text module includes declarations for all core
- text container elements and their attributes.
--->
-
-<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
-<![%xhtml-inlstruct.module;[
-<!ENTITY % xhtml-inlstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- "xhtml-inlstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Structural Module ...................................... -->
-<!-- file: xhtml-inlstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-inlstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Structural
-
- br, span
-
- This module declares the elements and their attributes
- used to support inline-level structural markup.
--->
-
-<!-- br: forced line break ............................. -->
-
-<!ENTITY % br.element "INCLUDE" >
-<![%br.element;[
-
-<!ENTITY % br.content "EMPTY" >
-<!ENTITY % br.qname "br" >
-<!ELEMENT %br.qname; %br.content; >
-
-<!-- end of br.element -->]]>
-
-<!ENTITY % br.attlist "INCLUDE" >
-<![%br.attlist;[
-<!ATTLIST %br.qname;
- %Core.attrib;
->
-<!-- end of br.attlist -->]]>
-
-<!-- span: generic inline container .................... -->
-
-<!ENTITY % span.element "INCLUDE" >
-<![%span.element;[
-<!ENTITY % span.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % span.qname "span" >
-<!ELEMENT %span.qname; %span.content; >
-<!-- end of span.element -->]]>
-
-<!ENTITY % span.attlist "INCLUDE" >
-<![%span.attlist;[
-<!ATTLIST %span.qname;
- %Common.attrib;
->
-<!-- end of span.attlist -->]]>
-
-<!-- end of xhtml-inlstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-inlphras.module "INCLUDE" >
-<![%xhtml-inlphras.module;[
-<!ENTITY % xhtml-inlphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- "xhtml-inlphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Phrasal Module ......................................... -->
-<!-- file: xhtml-inlphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-inlphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Phrasal
-
- abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
-
- This module declares the elements and their attributes used to
- support inline-level phrasal markup.
--->
-
-<!ENTITY % abbr.element "INCLUDE" >
-<![%abbr.element;[
-<!ENTITY % abbr.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % abbr.qname "abbr" >
-<!ELEMENT %abbr.qname; %abbr.content; >
-<!-- end of abbr.element -->]]>
-
-<!ENTITY % abbr.attlist "INCLUDE" >
-<![%abbr.attlist;[
-<!ATTLIST %abbr.qname;
- %Common.attrib;
->
-<!-- end of abbr.attlist -->]]>
-
-<!ENTITY % acronym.element "INCLUDE" >
-<![%acronym.element;[
-<!ENTITY % acronym.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % acronym.qname "acronym" >
-<!ELEMENT %acronym.qname; %acronym.content; >
-<!-- end of acronym.element -->]]>
-
-<!ENTITY % acronym.attlist "INCLUDE" >
-<![%acronym.attlist;[
-<!ATTLIST %acronym.qname;
- %Common.attrib;
->
-<!-- end of acronym.attlist -->]]>
-
-<!ENTITY % cite.element "INCLUDE" >
-<![%cite.element;[
-<!ENTITY % cite.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % cite.qname "cite" >
-<!ELEMENT %cite.qname; %cite.content; >
-<!-- end of cite.element -->]]>
-
-<!ENTITY % cite.attlist "INCLUDE" >
-<![%cite.attlist;[
-<!ATTLIST %cite.qname;
- %Common.attrib;
->
-<!-- end of cite.attlist -->]]>
-
-<!ENTITY % code.element "INCLUDE" >
-<![%code.element;[
-<!ENTITY % code.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % code.qname "code" >
-<!ELEMENT %code.qname; %code.content; >
-<!-- end of code.element -->]]>
-
-<!ENTITY % code.attlist "INCLUDE" >
-<![%code.attlist;[
-<!ATTLIST %code.qname;
- %Common.attrib;
->
-<!-- end of code.attlist -->]]>
-
-<!ENTITY % dfn.element "INCLUDE" >
-<![%dfn.element;[
-<!ENTITY % dfn.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % dfn.qname "dfn" >
-<!ELEMENT %dfn.qname; %dfn.content; >
-<!-- end of dfn.element -->]]>
-
-<!ENTITY % dfn.attlist "INCLUDE" >
-<![%dfn.attlist;[
-<!ATTLIST %dfn.qname;
- %Common.attrib;
->
-<!-- end of dfn.attlist -->]]>
-
-<!ENTITY % em.element "INCLUDE" >
-<![%em.element;[
-<!ENTITY % em.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % em.qname "em" >
-<!ELEMENT %em.qname; %em.content; >
-<!-- end of em.element -->]]>
-
-<!ENTITY % em.attlist "INCLUDE" >
-<![%em.attlist;[
-<!ATTLIST %em.qname;
- %Common.attrib;
->
-<!-- end of em.attlist -->]]>
-
-<!ENTITY % kbd.element "INCLUDE" >
-<![%kbd.element;[
-<!ENTITY % kbd.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % kbd.qname "kbd" >
-<!ELEMENT %kbd.qname; %kbd.content; >
-<!-- end of kbd.element -->]]>
-
-<!ENTITY % kbd.attlist "INCLUDE" >
-<![%kbd.attlist;[
-<!ATTLIST %kbd.qname;
- %Common.attrib;
->
-<!-- end of kbd.attlist -->]]>
-
-<!ENTITY % q.element "INCLUDE" >
-<![%q.element;[
-<!ENTITY % q.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % q.qname "q" >
-<!ELEMENT %q.qname; %q.content; >
-<!-- end of q.element -->]]>
-
-<!ENTITY % q.attlist "INCLUDE" >
-<![%q.attlist;[
-<!ATTLIST %q.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of q.attlist -->]]>
-
-<!ENTITY % samp.element "INCLUDE" >
-<![%samp.element;[
-<!ENTITY % samp.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % samp.qname "samp" >
-<!ELEMENT %samp.qname; %samp.content; >
-<!-- end of samp.element -->]]>
-
-<!ENTITY % samp.attlist "INCLUDE" >
-<![%samp.attlist;[
-<!ATTLIST %samp.qname;
- %Common.attrib;
->
-<!-- end of samp.attlist -->]]>
-
-<!ENTITY % strong.element "INCLUDE" >
-<![%strong.element;[
-<!ENTITY % strong.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % strong.qname "strong" >
-<!ELEMENT %strong.qname; %strong.content; >
-<!-- end of strong.element -->]]>
-
-<!ENTITY % strong.attlist "INCLUDE" >
-<![%strong.attlist;[
-<!ATTLIST %strong.qname;
- %Common.attrib;
->
-<!-- end of strong.attlist -->]]>
-
-<!ENTITY % var.element "INCLUDE" >
-<![%var.element;[
-<!ENTITY % var.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % var.qname "var" >
-<!ELEMENT %var.qname; %var.content; >
-<!-- end of var.element -->]]>
-
-<!ENTITY % var.attlist "INCLUDE" >
-<![%var.attlist;[
-<!ATTLIST %var.qname;
- %Common.attrib;
->
-<!-- end of var.attlist -->]]>
-
-<!-- end of xhtml-inlphras-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
-<![%xhtml-blkstruct.module;[
-<!ENTITY % xhtml-blkstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- "xhtml-blkstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Structural Module ....................................... -->
-<!-- file: xhtml-blkstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-blkstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Structural
-
- div, p
-
- This module declares the elements and their attributes used to
- support block-level structural markup.
--->
-
-<!ENTITY % div.element "INCLUDE" >
-<![%div.element;[
-<!ENTITY % div.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ENTITY % div.qname "div" >
-<!ELEMENT %div.qname; %div.content; >
-<!-- end of div.element -->]]>
-
-<!ENTITY % div.attlist "INCLUDE" >
-<![%div.attlist;[
-<!-- end of div.attlist -->]]>
-<!ATTLIST %div.qname;
- %Common.attrib;
->
-
-<!ENTITY % p.element "INCLUDE" >
-<![%p.element;[
-<!ENTITY % p.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % p.qname "p" >
-<!ELEMENT %p.qname; %p.content; >
-<!-- end of p.element -->]]>
-
-<!ENTITY % p.attlist "INCLUDE" >
-<![%p.attlist;[
-<!ATTLIST %p.qname;
- %Common.attrib;
->
-<!-- end of p.attlist -->]]>
-
-<!-- end of xhtml-blkstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkphras.module "INCLUDE" >
-<![%xhtml-blkphras.module;[
-<!ENTITY % xhtml-blkphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- "xhtml-blkphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Phrasal Module .......................................... -->
-<!-- file: xhtml-blkphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-blkphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Phrasal
-
- address, blockquote, pre, h1, h2, h3, h4, h5, h6
-
- This module declares the elements and their attributes used to
- support block-level phrasal markup.
--->
-
-<!ENTITY % address.element "INCLUDE" >
-<![%address.element;[
-<!ENTITY % address.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % address.qname "address" >
-<!ELEMENT %address.qname; %address.content; >
-<!-- end of address.element -->]]>
-
-<!ENTITY % address.attlist "INCLUDE" >
-<![%address.attlist;[
-<!ATTLIST %address.qname;
- %Common.attrib;
->
-<!-- end of address.attlist -->]]>
-
-<!ENTITY % blockquote.element "INCLUDE" >
-<![%blockquote.element;[
-<!ENTITY % blockquote.content
- "( %Block.mix; )+"
->
-<!ENTITY % blockquote.qname "blockquote" >
-<!ELEMENT %blockquote.qname; %blockquote.content; >
-<!-- end of blockquote.element -->]]>
-
-<!ENTITY % blockquote.attlist "INCLUDE" >
-<![%blockquote.attlist;[
-<!ATTLIST %blockquote.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of blockquote.attlist -->]]>
-
-<!ENTITY % pre.element "INCLUDE" >
-<![%pre.element;[
-<!ENTITY % pre.content
- "( #PCDATA
- | %InlStruct.class;
- %InlPhras.class;
- | %tt.qname; | %i.qname; | %b.qname;
- %I18n.class;
- %Anchor.class;
- | %script.qname; | %map.qname;
- %Inline.extra; )*"
->
-<!ENTITY % pre.qname "pre" >
-<!ELEMENT %pre.qname; %pre.content; >
-<!-- end of pre.element -->]]>
-
-<!ENTITY % pre.attlist "INCLUDE" >
-<![%pre.attlist;[
-<!ATTLIST %pre.qname;
- %Common.attrib;
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of pre.attlist -->]]>
-
-<!-- ................... Heading Elements ................... -->
-
-<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
-
-<!ENTITY % h1.element "INCLUDE" >
-<![%h1.element;[
-<!ENTITY % h1.qname "h1" >
-<!ELEMENT %h1.qname; %Heading.content; >
-<!-- end of h1.element -->]]>
-
-<!ENTITY % h1.attlist "INCLUDE" >
-<![%h1.attlist;[
-<!ATTLIST %h1.qname;
- %Common.attrib;
->
-<!-- end of h1.attlist -->]]>
-
-<!ENTITY % h2.element "INCLUDE" >
-<![%h2.element;[
-<!ENTITY % h2.qname "h2" >
-<!ELEMENT %h2.qname; %Heading.content; >
-<!-- end of h2.element -->]]>
-
-<!ENTITY % h2.attlist "INCLUDE" >
-<![%h2.attlist;[
-<!ATTLIST %h2.qname;
- %Common.attrib;
->
-<!-- end of h2.attlist -->]]>
-
-<!ENTITY % h3.element "INCLUDE" >
-<![%h3.element;[
-<!ENTITY % h3.qname "h3" >
-<!ELEMENT %h3.qname; %Heading.content; >
-<!-- end of h3.element -->]]>
-
-<!ENTITY % h3.attlist "INCLUDE" >
-<![%h3.attlist;[
-<!ATTLIST %h3.qname;
- %Common.attrib;
->
-<!-- end of h3.attlist -->]]>
-
-<!ENTITY % h4.element "INCLUDE" >
-<![%h4.element;[
-<!ENTITY % h4.qname "h4" >
-<!ELEMENT %h4.qname; %Heading.content; >
-<!-- end of h4.element -->]]>
-
-<!ENTITY % h4.attlist "INCLUDE" >
-<![%h4.attlist;[
-<!ATTLIST %h4.qname;
- %Common.attrib;
->
-<!-- end of h4.attlist -->]]>
-
-<!ENTITY % h5.element "INCLUDE" >
-<![%h5.element;[
-<!ENTITY % h5.qname "h5" >
-<!ELEMENT %h5.qname; %Heading.content; >
-<!-- end of h5.element -->]]>
-
-<!ENTITY % h5.attlist "INCLUDE" >
-<![%h5.attlist;[
-<!ATTLIST %h5.qname;
- %Common.attrib;
->
-<!-- end of h5.attlist -->]]>
-
-<!ENTITY % h6.element "INCLUDE" >
-<![%h6.element;[
-<!ENTITY % h6.qname "h6" >
-<!ELEMENT %h6.qname; %Heading.content; >
-<!-- end of h6.element -->]]>
-
-<!ENTITY % h6.attlist "INCLUDE" >
-<![%h6.attlist;[
-<!ATTLIST %h6.qname;
- %Common.attrib;
->
-<!-- end of h6.attlist -->]]>
-
-<!-- end of xhtml-blkphras-1.mod -->
-]]>
-
-<!-- end of xhtml-text-1.mod -->
-
-
-<!ENTITY % xhtml-hypertext.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- "xhtml-hypertext-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Hypertext Module .............................................. -->
-<!-- file: xhtml-hypertext-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-hypertext-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Hypertext
-
- a
-
- This module declares the anchor ('a') element type, which
- defines the source of a hypertext link. The destination
- (or link 'target') is identified via its 'id' attribute
- rather than the 'name' attribute as was used in HTML.
--->
-
-<!-- ............ Anchor Element ............ -->
-
-<!ENTITY % a.element "INCLUDE" >
-<![%a.element;[
-<!ENTITY % a.content
- "( #PCDATA | %InlNoAnchor.mix; )*"
->
-<!ENTITY % a.qname "a" >
-<!ELEMENT %a.qname; %a.content; >
-<!-- end of a.element -->]]>
-
-<!ENTITY % a.attlist "INCLUDE" >
-<![%a.attlist;[
-<!ATTLIST %a.qname;
- %Common.attrib;
- href %URI.datatype; #IMPLIED
- charset %Charset.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of a.attlist -->]]>
-
-<!-- end of xhtml-hypertext-1.mod -->
-
-
-<!ENTITY % xhtml-list.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- "xhtml-list-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Lists Module .................................................. -->
-<!-- file: xhtml-list-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-list-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Lists
-
- dl, dt, dd, ol, ul, li
-
- This module declares the list-oriented element types
- and their attributes.
--->
-
-<!ENTITY % dl.qname "dl" >
-<!ENTITY % dt.qname "dt" >
-<!ENTITY % dd.qname "dd" >
-<!ENTITY % ol.qname "ol" >
-<!ENTITY % ul.qname "ul" >
-<!ENTITY % li.qname "li" >
-
-<!-- dl: Definition List ............................... -->
-
-<!ENTITY % dl.element "INCLUDE" >
-<![%dl.element;[
-<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" >
-<!ELEMENT %dl.qname; %dl.content; >
-<!-- end of dl.element -->]]>
-
-<!ENTITY % dl.attlist "INCLUDE" >
-<![%dl.attlist;[
-<!ATTLIST %dl.qname;
- %Common.attrib;
->
-<!-- end of dl.attlist -->]]>
-
-<!-- dt: Definition Term ............................... -->
-
-<!ENTITY % dt.element "INCLUDE" >
-<![%dt.element;[
-<!ENTITY % dt.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %dt.qname; %dt.content; >
-<!-- end of dt.element -->]]>
-
-<!ENTITY % dt.attlist "INCLUDE" >
-<![%dt.attlist;[
-<!ATTLIST %dt.qname;
- %Common.attrib;
->
-<!-- end of dt.attlist -->]]>
-
-<!-- dd: Definition Description ........................ -->
-
-<!ENTITY % dd.element "INCLUDE" >
-<![%dd.element;[
-<!ENTITY % dd.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %dd.qname; %dd.content; >
-<!-- end of dd.element -->]]>
-
-<!ENTITY % dd.attlist "INCLUDE" >
-<![%dd.attlist;[
-<!ATTLIST %dd.qname;
- %Common.attrib;
->
-<!-- end of dd.attlist -->]]>
-
-<!-- ol: Ordered List (numbered styles) ................ -->
-
-<!ENTITY % ol.element "INCLUDE" >
-<![%ol.element;[
-<!ENTITY % ol.content "( %li.qname; )+" >
-<!ELEMENT %ol.qname; %ol.content; >
-<!-- end of ol.element -->]]>
-
-<!ENTITY % ol.attlist "INCLUDE" >
-<![%ol.attlist;[
-<!ATTLIST %ol.qname;
- %Common.attrib;
->
-<!-- end of ol.attlist -->]]>
-
-<!-- ul: Unordered List (bullet styles) ................ -->
-
-<!ENTITY % ul.element "INCLUDE" >
-<![%ul.element;[
-<!ENTITY % ul.content "( %li.qname; )+" >
-<!ELEMENT %ul.qname; %ul.content; >
-<!-- end of ul.element -->]]>
-
-<!ENTITY % ul.attlist "INCLUDE" >
-<![%ul.attlist;[
-<!ATTLIST %ul.qname;
- %Common.attrib;
->
-<!-- end of ul.attlist -->]]>
-
-<!-- li: List Item ..................................... -->
-
-<!ENTITY % li.element "INCLUDE" >
-<![%li.element;[
-<!ENTITY % li.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %li.qname; %li.content; >
-<!-- end of li.element -->]]>
-
-<!ENTITY % li.attlist "INCLUDE" >
-<![%li.attlist;[
-<!ATTLIST %li.qname;
- %Common.attrib;
->
-<!-- end of li.attlist -->]]>
-
-<!-- end of xhtml-list-1.mod -->
-
-
-<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
-
-<!-- Image Module ............................................... -->
-<!ENTITY % xhtml-image.module "INCLUDE" >
-<![%xhtml-image.module;[
-<!ENTITY % xhtml-image.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- "xhtml-image-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Images Module ................................................. -->
-<!-- file: xhtml-image-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Rovision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-image-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Images
-
- img
-
- This module provides markup to support basic image embedding.
--->
-
-<!-- To avoid problems with text-only UAs as well as to make
- image content understandable and navigable to users of
- non-visual UAs, you need to provide a description with
- the 'alt' attribute, and avoid server-side image maps.
--->
-
-<!ENTITY % img.element "INCLUDE" >
-<![%img.element;[
-<!ENTITY % img.content "EMPTY" >
-<!ENTITY % img.qname "img" >
-<!ELEMENT %img.qname; %img.content; >
-<!-- end of img.element -->]]>
-
-<!ENTITY % img.attlist "INCLUDE" >
-<![%img.attlist;[
-<!ATTLIST %img.qname;
- %Common.attrib;
- src %URI.datatype; #REQUIRED
- alt %Text.datatype; #REQUIRED
- longdesc %URI.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
->
-<!-- end of img.attlist -->]]>
-
-<!-- end of xhtml-image-1.mod -->
-]]>
-
-<!-- Tables Module ............................................... -->
-<!ENTITY % xhtml-table.module "INCLUDE" >
-<![%xhtml-table.module;[
-<!ENTITY % xhtml-table.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
- "xhtml-basic-table-1.mod" >
-<!-- ....................................................................... -->
-<!-- XHTML Basic Table Module ............................................. -->
-<!-- file: xhtml-basic-table-1.mod
-
- This is XHTML Basic, a proper subset of XHTML.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-basic-table-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Basic Tables
-
- table, caption, tr, th, td
-
- This table module declares elements and attributes defining
- a table model based fundamentally on features found in the
- widely-deployed HTML 3.2 table model. While this module
- mimics the content model and table attributes of HTML 3.2
- tables, the element types declared herein also includes all
- HTML 4 common and most of the HTML 4 table attributes.
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % table.qname "table" >
-<!ENTITY % caption.qname "caption" >
-<!ENTITY % tr.qname "tr" >
-<!ENTITY % th.qname "th" >
-<!ENTITY % td.qname "td" >
-
-<!-- horizontal alignment attributes for cell contents
--->
-<!ENTITY % CellHAlign.attrib
- "align ( left
- | center
- | right ) #IMPLIED"
->
-
-<!-- vertical alignment attributes for cell contents
--->
-<!ENTITY % CellVAlign.attrib
- "valign ( top
- | middle
- | bottom ) #IMPLIED"
->
-
-<!-- scope is simpler than axes attribute for common tables
--->
-<!ENTITY % scope.attrib
- "scope ( row | col ) #IMPLIED"
->
-
-<!-- table: Table Element .............................. -->
-
-<!ENTITY % table.element "INCLUDE" >
-<![%table.element;[
-<!ENTITY % table.content
- "( %caption.qname;?, %tr.qname;+ )"
->
-<!ELEMENT %table.qname; %table.content; >
-<!-- end of table.element -->]]>
-
-<!ENTITY % table.attlist "INCLUDE" >
-<![%table.attlist;[
-<!ATTLIST %table.qname;
- %Common.attrib;
- summary %Text.datatype; #IMPLIED
->
-<!-- end of table.attlist -->]]>
-
-<!-- caption: Table Caption ............................ -->
-
-<!ENTITY % caption.element "INCLUDE" >
-<![%caption.element;[
-<!ENTITY % caption.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %caption.qname; %caption.content; >
-<!-- end of caption.element -->]]>
-
-<!ENTITY % caption.attlist "INCLUDE" >
-<![%caption.attlist;[
-<!ATTLIST %caption.qname;
- %Common.attrib;
->
-<!-- end of caption.attlist -->]]>
-
-<!-- tr: Table Row ..................................... -->
-
-<!ENTITY % tr.element "INCLUDE" >
-<![%tr.element;[
-<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" >
-<!ELEMENT %tr.qname; %tr.content; >
-<!-- end of tr.element -->]]>
-
-<!ENTITY % tr.attlist "INCLUDE" >
-<![%tr.attlist;[
-<!ATTLIST %tr.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of tr.attlist -->]]>
-
-<!-- th: Table Header Cell ............................. -->
-
-<!-- th is for header cells, td for data,
- but for cells acting as both use td
--->
-
-<!ENTITY % th.element "INCLUDE" >
-<![%th.element;[
-<!ENTITY % th.content
- "( #PCDATA | %FlowNoTable.mix; )*"
->
-<!ELEMENT %th.qname; %th.content; >
-<!-- end of th.element -->]]>
-
-<!ENTITY % th.attlist "INCLUDE" >
-<![%th.attlist;[
-<!ATTLIST %th.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of th.attlist -->]]>
-
-<!-- td: Table Data Cell ............................... -->
-
-<!ENTITY % td.element "INCLUDE" >
-<![%td.element;[
-<!ENTITY % td.content
- "( #PCDATA | %FlowNoTable.mix; )*"
->
-<!ELEMENT %td.qname; %td.content; >
-<!-- end of td.element -->]]>
-
-<!ENTITY % td.attlist "INCLUDE" >
-<![%td.attlist;[
-<!ATTLIST %td.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of td.attlist -->]]>
-
-<!-- end of xhtml-basic-table-1.mod -->
-]]>
-
-<!-- Forms Module ............................................... -->
-<!ENTITY % xhtml-form.module "INCLUDE" >
-<![%xhtml-form.module;[
-<!ENTITY % xhtml-form.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
- "xhtml-basic-form-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Simplified Forms Module ....................................... -->
-<!-- file: xhtml-basic-form-1.mod
-
- This is XHTML Basic, a proper subset of XHTML.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-basic-form-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Basic Forms
-
- This forms module is based on the HTML 3.2 forms model, with
- the WAI-requested addition of the label element. While this
- module essentially mimics the content model and attributes of
- HTML 3.2 forms, the element types declared herein also include
- all HTML 4 common attributes.
-
- form, label, input, select, option, textarea
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % form.qname "form" >
-<!ENTITY % label.qname "label" >
-<!ENTITY % input.qname "input" >
-<!ENTITY % select.qname "select" >
-<!ENTITY % option.qname "option" >
-<!ENTITY % textarea.qname "textarea" >
-
-<!-- %BlkNoForm.mix; includes all non-form block elements,
- plus %Misc.class;
--->
-<!ENTITY % BlkNoForm.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- | %table.qname;
- %Block.extra;
- %Misc.class;"
->
-
-<!-- form: Form Element ................................ -->
-
-<!ENTITY % form.element "INCLUDE" >
-<![%form.element;[
-<!ENTITY % form.content
- "( %BlkNoForm.mix; )+"
->
-<!ELEMENT %form.qname; %form.content; >
-<!-- end of form.element -->]]>
-
-<!ENTITY % form.attlist "INCLUDE" >
-<![%form.attlist;[
-<!ATTLIST %form.qname;
- %Common.attrib;
- action %URI.datatype; #REQUIRED
- method ( get | post ) 'get'
- enctype %ContentType.datatype; 'application/x-www-form-urlencoded'
->
-<!-- end of form.attlist -->]]>
-
-<!-- label: Form Field Label Text ...................... -->
-
-<!ENTITY % label.element "INCLUDE" >
-<![%label.element;[
-<!-- Each label must not contain more than ONE field
--->
-<!ENTITY % label.content
- "( #PCDATA
- | %input.qname; | %select.qname; | %textarea.qname;
- | %InlStruct.class;
- %InlPhras.class;
- %I18n.class;
- %InlPres.class;
- %InlSpecial.class;
- %Misc.class; )*"
->
-<!ELEMENT %label.qname; %label.content; >
-<!-- end of label.element -->]]>
-
-<!ENTITY % label.attlist "INCLUDE" >
-<![%label.attlist;[
-<!ATTLIST %label.qname;
- %Common.attrib;
- for IDREF #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of label.attlist -->]]>
-
-<!-- input: Form Control ............................... -->
-
-<!ENTITY % input.element "INCLUDE" >
-<![%input.element;[
-<!ENTITY % input.content "EMPTY" >
-<!ELEMENT %input.qname; %input.content; >
-<!-- end of input.element -->]]>
-
-<!-- Basic Forms removes 'image' and 'file' input types.
--->
-<!ENTITY % input.attlist "INCLUDE" >
-<![%input.attlist;[
-<!ENTITY % InputType.class
- "( text | password | checkbox | radio
- | submit | reset | hidden )"
->
-<!-- attribute name required for all but submit & reset
--->
-<!ATTLIST %input.qname;
- %Common.attrib;
- type %InputType.class; 'text'
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked ( checked ) #IMPLIED
- size CDATA #IMPLIED
- maxlength %Number.datatype; #IMPLIED
- src %URI.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of input.attlist -->]]>
-
-<!-- select: Option Selector ........................... -->
-
-<!ENTITY % select.element "INCLUDE" >
-<![%select.element;[
-<!ENTITY % select.content "( %option.qname; )+" >
-<!ELEMENT %select.qname; %select.content; >
-<!-- end of select.element -->]]>
-
-<!ENTITY % select.attlist "INCLUDE" >
-<![%select.attlist;[
-<!ATTLIST %select.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- size %Number.datatype; #IMPLIED
- multiple ( multiple ) #IMPLIED
->
-<!-- end of select.attlist -->]]>
-
-<!-- option: Selectable Choice ......................... -->
-
-<!ENTITY % option.element "INCLUDE" >
-<![%option.element;[
-<!ENTITY % option.content "( #PCDATA )" >
-<!ELEMENT %option.qname; %option.content; >
-<!-- end of option.element -->]]>
-
-<!ENTITY % option.attlist "INCLUDE" >
-<![%option.attlist;[
-<!ATTLIST %option.qname;
- %Common.attrib;
- selected ( selected ) #IMPLIED
- value CDATA #IMPLIED
->
-<!-- end of option.attlist -->]]>
-
-<!-- textarea: Multi-Line Text Field ................... -->
-
-<!ENTITY % textarea.element "INCLUDE" >
-<![%textarea.element;[
-<!ENTITY % textarea.content "( #PCDATA )" >
-<!ELEMENT %textarea.qname; %textarea.content; >
-<!-- end of textarea.element -->]]>
-
-<!ENTITY % textarea.attlist "INCLUDE" >
-<![%textarea.attlist;[
-<!ATTLIST %textarea.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- rows %Number.datatype; #REQUIRED
- cols %Number.datatype; #REQUIRED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of textarea.attlist -->]]>
-
-<!-- end of xhtml-basic-form-1.mod -->
-]]>
-
-<!-- Link Element Module ........................................ -->
-<!ENTITY % xhtml-link.module "INCLUDE" >
-<![%xhtml-link.module;[
-<!ENTITY % xhtml-link.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- "xhtml-link-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Link Element Module ........................................... -->
-<!-- file: xhtml-link-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-link-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Link element
-
- link
-
- This module declares the link element type and its attributes,
- which could (in principle) be used to define document-level links
- to external resources such as:
-
- a) for document specific toolbars/menus, e.g. start, contents,
- previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by stylesheets to control how collections of html nodes are
- rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel="alternate" media="print")
--->
-
-<!-- link: Media-Independent Link ...................... -->
-
-<!ENTITY % link.element "INCLUDE" >
-<![%link.element;[
-<!ENTITY % link.content "EMPTY" >
-<!ENTITY % link.qname "link" >
-<!ELEMENT %link.qname; %link.content; >
-<!-- end of link.element -->]]>
-
-<!ENTITY % link.attlist "INCLUDE" >
-<![%link.attlist;[
-<!ATTLIST %link.qname;
- %Common.attrib;
- charset %Charset.datatype; #IMPLIED
- href %URI.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- media %MediaDesc.datatype; #IMPLIED
->
-<!-- end of link.attlist -->]]>
-
-<!-- end of xhtml-link-1.mod -->
-]]>
-
-<!-- Document Metainformation Module ............................ -->
-<!ENTITY % xhtml-meta.module "INCLUDE" >
-<![%xhtml-meta.module;[
-<!ENTITY % xhtml-meta.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- "xhtml-meta-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Document Metainformation Module ............................... -->
-<!-- file: xhtml-meta-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-meta-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Meta Information
-
- meta
-
- This module declares the meta element type and its attributes,
- used to provide declarative document metainformation.
--->
-
-<!-- meta: Generic Metainformation ..................... -->
-
-<!ENTITY % meta.element "INCLUDE" >
-<![%meta.element;[
-<!ENTITY % meta.content "EMPTY" >
-<!ENTITY % meta.qname "meta" >
-<!ELEMENT %meta.qname; %meta.content; >
-<!-- end of meta.element -->]]>
-
-<!ENTITY % meta.attlist "INCLUDE" >
-<![%meta.attlist;[
-<!ATTLIST %meta.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- http-equiv NMTOKEN #IMPLIED
- name NMTOKEN #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
->
-<!-- end of meta.attlist -->]]>
-
-<!-- end of xhtml-meta-1.mod -->
-]]>
-
-<!-- Base Element Module ........................................ -->
-<!ENTITY % xhtml-base.module "INCLUDE" >
-<![%xhtml-base.module;[
-<!ENTITY % xhtml-base.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- "xhtml-base-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Base Element Module ........................................... -->
-<!-- file: xhtml-base-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-base-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Base element
-
- base
-
- This module declares the base element type and its attributes,
- used to define a base URI against which relative URIs in the
- document will be resolved.
-
- Note that this module also redeclares the content model for
- the head element to include the base element.
--->
-
-<!-- base: Document Base URI ........................... -->
-
-<!ENTITY % base.element "INCLUDE" >
-<![%base.element;[
-<!ENTITY % base.content "EMPTY" >
-<!ENTITY % base.qname "base" >
-<!ELEMENT %base.qname; %base.content; >
-<!-- end of base.element -->]]>
-
-<!ENTITY % base.attlist "INCLUDE" >
-<![%base.attlist;[
-<!ATTLIST %base.qname;
- %XHTML.xmlns.attrib;
- href %URI.datatype; #REQUIRED
->
-<!-- end of base.attlist -->]]>
-
-<!ENTITY % head.content
- "( %HeadOpts.mix;,
- ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
- | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
->
-
-<!-- end of xhtml-base-1.mod -->
-]]>
-
-<!-- Param Element Module ....................................... -->
-<!ENTITY % xhtml-param.module "INCLUDE" >
-<![%xhtml-param.module;[
-<!ENTITY % xhtml-param.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- "xhtml-param-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Param Element Module ..................................... -->
-<!-- file: xhtml-param-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-param-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Parameters for Java Applets and Embedded Objects
-
- param
-
- This module provides declarations for the param element,
- used to provide named property values for the applet
- and object elements.
--->
-
-<!-- param: Named Property Value ....................... -->
-
-<!ENTITY % param.element "INCLUDE" >
-<![%param.element;[
-<!ENTITY % param.content "EMPTY" >
-<!ENTITY % param.qname "param" >
-<!ELEMENT %param.qname; %param.content; >
-<!-- end of param.element -->]]>
-
-<!ENTITY % param.attlist "INCLUDE" >
-<![%param.attlist;[
-<!ATTLIST %param.qname;
- %XHTML.xmlns.attrib;
- %id.attrib;
- name CDATA #REQUIRED
- value CDATA #IMPLIED
- valuetype ( data | ref | object ) 'data'
- type %ContentType.datatype; #IMPLIED
->
-<!-- end of param.attlist -->]]>
-
-<!-- end of xhtml-param-1.mod -->
-]]>
-
-<!-- Embedded Object Module ..................................... -->
-<!ENTITY % xhtml-object.module "INCLUDE" >
-<![%xhtml-object.module;[
-<!ENTITY % xhtml-object.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- "xhtml-object-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Embedded Object Module ........................................ -->
-<!-- file: xhtml-object-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-object-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Embedded Objects
-
- object
-
- This module declares the object element type and its attributes,
- used to embed external objects as part of XHTML pages. In the
- document, place param elements prior to the object elements
- that require their content.
-
- Note that use of this module requires instantiation of the
- Param Element Module prior to this module.
--->
-
-<!-- object: Generic Embedded Object ................... -->
-
-<!ENTITY % object.element "INCLUDE" >
-<![%object.element;[
-<!ENTITY % object.content
- "( #PCDATA | %Flow.mix; | %param.qname; )*"
->
-<!ENTITY % object.qname "object" >
-<!ELEMENT %object.qname; %object.content; >
-<!-- end of object.element -->]]>
-
-<!ENTITY % object.attlist "INCLUDE" >
-<![%object.attlist;[
-<!ATTLIST %object.qname;
- %Common.attrib;
- declare ( declare ) #IMPLIED
- classid %URI.datatype; #IMPLIED
- codebase %URI.datatype; #IMPLIED
- data %URI.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- codetype %ContentType.datatype; #IMPLIED
- archive %URIs.datatype; #IMPLIED
- standby %Text.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
- name CDATA #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of object.attlist -->]]>
-
-<!-- end of xhtml-object-1.mod -->
-]]>
-
-<!ENTITY % xhtml-struct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- "xhtml-struct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Structure Module .............................................. -->
-<!-- file: xhtml-struct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-basic10-f.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-struct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Document Structure
-
- title, head, body, html
-
- The Structure Module defines the major structural elements and
- their attributes.
-
- Note that the content model of the head element type is redeclared
- when the Base Module is included in the DTD.
-
- The parameter entity containing the XML namespace URI value used
- for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
--->
-
-<!-- title: Document Title ............................. -->
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
--->
-
-<!ENTITY % title.element "INCLUDE" >
-<![%title.element;[
-<!ENTITY % title.content "( #PCDATA )" >
-<!ENTITY % title.qname "title" >
-<!ELEMENT %title.qname; %title.content; >
-<!-- end of title.element -->]]>
-
-<!ENTITY % title.attlist "INCLUDE" >
-<![%title.attlist;[
-<!ATTLIST %title.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
->
-<!-- end of title.attlist -->]]>
-
-<!-- head: Document Head ............................... -->
-
-<!ENTITY % head.element "INCLUDE" >
-<![%head.element;[
-<!ENTITY % head.content
- "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
->
-<!ENTITY % head.qname "head" >
-<!ELEMENT %head.qname; %head.content; >
-<!-- end of head.element -->]]>
-
-<!ENTITY % head.attlist "INCLUDE" >
-<![%head.attlist;[
-<!-- reserved for future use with document profiles
--->
-<!ENTITY % profile.attrib
- "profile %URI.datatype; '%XHTML.profile;'"
->
-
-<!ATTLIST %head.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- %profile.attrib;
->
-<!-- end of head.attlist -->]]>
-
-<!-- body: Document Body ............................... -->
-
-<!ENTITY % body.element "INCLUDE" >
-<![%body.element;[
-<!ENTITY % body.content
- "( %Block.mix; )+"
->
-<!ENTITY % body.qname "body" >
-<!ELEMENT %body.qname; %body.content; >
-<!-- end of body.element -->]]>
-
-<!ENTITY % body.attlist "INCLUDE" >
-<![%body.attlist;[
-<!ATTLIST %body.qname;
- %Common.attrib;
->
-<!-- end of body.attlist -->]]>
-
-<!-- html: XHTML Document Element ...................... -->
-
-<!ENTITY % html.element "INCLUDE" >
-<![%html.element;[
-<!ENTITY % html.content "( %head.qname;, %body.qname; )" >
-<!ENTITY % html.qname "html" >
-<!ELEMENT %html.qname; %html.content; >
-<!-- end of html.element -->]]>
-
-<!ENTITY % html.attlist "INCLUDE" >
-<![%html.attlist;[
-<!-- version attribute value defined in driver
--->
-<!ENTITY % XHTML.version.attrib
- "version %FPI.datatype; #FIXED '%XHTML.version;'"
->
-
-<!-- see the Qualified Names module for information
- on how to extend XHTML using XML namespaces
--->
-<!ATTLIST %html.qname;
- %XHTML.xmlns.attrib;
- %XHTML.version.attrib;
- %I18n.attrib;
->
-<!-- end of html.attlist -->]]>
-
-<!-- end of xhtml-struct-1.mod -->
-
-
-<!-- end of XHTML Basic 1.0 DTD ........................................... -->
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-lat1.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-lat1.ent
deleted file mode 100644
index 92198ed149..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-lat1.ent
+++ /dev/null
@@ -1,196 +0,0 @@
-<!-- Portions (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
- %HTMLlat1;
--->
-
-<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
- U+00A0 ISOnum -->
-<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
- U+00A6 ISOnum -->
-<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
-<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
- U+00A8 ISOdia -->
-<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
- = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not "&#172;"> <!-- not sign = angled dash,
- U+00AC ISOnum -->
-<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
- U+00AD ISOnum -->
-<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
- U+00AE ISOnum -->
-<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
- = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
- U+00B1 ISOnum -->
-<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
- = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
- = cubed, U+00B3 ISOnum -->
-<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
- U+00B4 ISOdia -->
-<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
-<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
- U+00B6 ISOnum -->
-<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
- U+00B9 ISOnum -->
-<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
- U+00BA ISOnum -->
-<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
- = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
- = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
- = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest "&#191;"> <!-- inverted question mark
- = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
- = latin capital letter A grave,
- U+00C0 ISOlat1 -->
-<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
- U+00C1 ISOlat1 -->
-<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
- U+00C2 ISOlat1 -->
-<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
- U+00C3 ISOlat1 -->
-<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
- U+00C4 ISOlat1 -->
-<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
- = latin capital letter A ring,
- U+00C5 ISOlat1 -->
-<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
- = latin capital ligature AE,
- U+00C6 ISOlat1 -->
-<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
- U+00C7 ISOlat1 -->
-<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
- U+00C8 ISOlat1 -->
-<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
- U+00C9 ISOlat1 -->
-<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
- U+00CA ISOlat1 -->
-<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
- U+00CB ISOlat1 -->
-<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
- U+00CC ISOlat1 -->
-<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
- U+00CD ISOlat1 -->
-<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
- U+00CE ISOlat1 -->
-<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
- U+00CF ISOlat1 -->
-<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
- U+00D1 ISOlat1 -->
-<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
- U+00D2 ISOlat1 -->
-<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
- U+00D3 ISOlat1 -->
-<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
- U+00D4 ISOlat1 -->
-<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
- U+00D5 ISOlat1 -->
-<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
- U+00D6 ISOlat1 -->
-<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
- = latin capital letter O slash,
- U+00D8 ISOlat1 -->
-<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
- U+00D9 ISOlat1 -->
-<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
- U+00DA ISOlat1 -->
-<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
- U+00DB ISOlat1 -->
-<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
- U+00DC ISOlat1 -->
-<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
- U+00DD ISOlat1 -->
-<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
- U+00DE ISOlat1 -->
-<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
- U+00DF ISOlat1 -->
-<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
- = latin small letter a grave,
- U+00E0 ISOlat1 -->
-<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
- U+00E1 ISOlat1 -->
-<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
- U+00E2 ISOlat1 -->
-<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
- U+00E3 ISOlat1 -->
-<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
- U+00E4 ISOlat1 -->
-<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
- = latin small letter a ring,
- U+00E5 ISOlat1 -->
-<!ENTITY aelig "&#230;"> <!-- latin small letter ae
- = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
- U+00E7 ISOlat1 -->
-<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
- U+00E8 ISOlat1 -->
-<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
- U+00E9 ISOlat1 -->
-<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
- U+00EA ISOlat1 -->
-<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
- U+00EB ISOlat1 -->
-<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
- U+00EC ISOlat1 -->
-<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
- U+00ED ISOlat1 -->
-<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
- U+00EE ISOlat1 -->
-<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
- U+00EF ISOlat1 -->
-<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
- U+00F1 ISOlat1 -->
-<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
- U+00F2 ISOlat1 -->
-<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
- U+00F3 ISOlat1 -->
-<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
- U+00F4 ISOlat1 -->
-<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
- U+00F5 ISOlat1 -->
-<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
- U+00F6 ISOlat1 -->
-<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
- = latin small letter o slash,
- U+00F8 ISOlat1 -->
-<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
- U+00F9 ISOlat1 -->
-<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
- U+00FA ISOlat1 -->
-<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
- U+00FB ISOlat1 -->
-<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
- U+00FC ISOlat1 -->
-<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
- U+00FD ISOlat1 -->
-<!ENTITY thorn "&#254;"> <!-- latin small letter thorn with,
- U+00FE ISOlat1 -->
-<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
- U+00FF ISOlat1 -->
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-mobile10-flat.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-mobile10-flat.dtd
deleted file mode 100644
index 16115038de..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-mobile10-flat.dtd
+++ /dev/null
@@ -1,3216 +0,0 @@
-<!-- XHTML Mobile 1.0 DTD ...................................................... -->
-<!-- file: xhtml-mobile10.dtd -->
-<!--
- This is XHTML Mobile profile, a proper subset of XHTML.
-
- @Wireless Application Protocol Forum, Ltd. 2001.
-
- Terms and conditions of use are available from the Wireless Application Protocol Forum Ltd.
- Web site (http://www.wapforum.org/what/copyright.htm).
-
--->
-<!-- This is the driver file for version 1.0 of the XHTML Mobile DTD.
-
- This DTD is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC: "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- SYSTEM: "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"
--->
-<!ENTITY % XHTML.version "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" >
-
-<!-- Use this URI to identify the default namespace:
-
- "http://www.w3.org/1999/xhtml"
-
- See the Qualified Names module for information
- on the use of namespace prefixes in the DTD.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefix "" >
-
-<!-- For example, if you are using XHTML Mobile 1.0 directly, use
- the FPI in the DOCTYPE declaration, with the xmlns attribute
- on the document element to identify the default namespace:
-
- <?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en" >
- ...
- </html>
--->
-
-<!-- reserved for future use with document profiles -->
-<!ENTITY % XHTML.profile "" >
-
-<!-- Inline Style Module ........................................ -->
-<!ENTITY % xhtml-inlstyle.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Style Module ........................................... -->
-<!-- file: xhtml-inlstyle-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Style
-
- This module declares the 'style' attribute, used to support inline
- style markup. This module must be instantiated prior to the XHTML
- Common Attributes module in order to be included in %Core.attrib;.
--->
-
-<!ENTITY % style.attrib
- "style CDATA #IMPLIED"
->
-
-
-<!ENTITY % Core.extra.attrib
- "%style.attrib;"
->
-
-<!-- end of xhtml-inlstyle-1.mod -->
-
-
-<!-- Document Model ........................................ -->
-<!ENTITY % xhtml-model.mod
- PUBLIC "-//WAPFORUM//ENTITIES XHTML Mobile 1.0 Document Model 1.0//EN"
- "http://www.wapforum.org/DTD/xhtml-mobile10-model-1.mod" >
-
-<!-- XHTML Framework ........................................ -->
-<!ENTITY % XHTML.bidi "IGNORE" >
-<!ENTITY % xhtml-framework.mod
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Modular Framework Module ...................................... -->
-<!-- file: xhtml-framework-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Modular Framework
-
- This required module instantiates the modules needed
- to support the XHTML modularization model, including:
-
- + notations
- + datatypes
- + namespace-qualified names
- + common attributes
- + document model
- + character entities
-
- The Intrinsic Events module is ignored by default but
- occurs in this module because it must be instantiated
- prior to Attributes but after Datatypes.
--->
-
-<!ENTITY % xhtml-arch.module "IGNORE" >
-<![%xhtml-arch.module;[
-<!ENTITY % xhtml-arch.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
- "xhtml-arch-1.mod" >
-%xhtml-arch.mod;]]>
-
-<!ENTITY % xhtml-notations.module "INCLUDE" >
-<![%xhtml-notations.module;[
-<!ENTITY % xhtml-notations.mod
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- "xhtml-notations-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Notations Module .............................................. -->
-<!-- file: xhtml-notations-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-notations-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Notations
-
- defines the following notations, many of these imported from
- other specifications and standards. When an existing FPI is
- known, it is incorporated here.
--->
-
-<!-- XML Notations ..................................... -->
-<!-- SGML and XML Notations ............................ -->
-
-<!-- W3C XML 1.0 Recommendation -->
-<!NOTATION w3c-xml
- PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN" >
-
-<!-- XML 1.0 CDATA -->
-<!NOTATION cdata
- PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN" >
-
-<!-- SGML Formal Public Identifiers -->
-<!NOTATION fpi
- PUBLIC "ISO 8879:1986//NOTATION Formal Public Identifier//EN" >
-
-<!-- XHTML Notations ................................... -->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!NOTATION length
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN" >
-
-<!-- space-separated list of link types -->
-<!NOTATION linkTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!NOTATION mediaDesc
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN" >
-
-<!-- pixel, percentage, or relative -->
-<!NOTATION multiLength
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN" >
-
-<!-- one or more digits (NUMBER) -->
-<!NOTATION number
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN" >
-
-<!-- integer representing length in pixels -->
-<!NOTATION pixels
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN" >
-
-<!-- script expression -->
-<!NOTATION script
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Script//EN" >
-
-<!-- textual content -->
-<!NOTATION text
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN" >
-
-<!-- Imported Notations ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!NOTATION character
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Character//EN" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!NOTATION charset
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charset//EN" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!NOTATION charsets
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charsets//EN" >
-
-<!-- media type, as per [RFC2045] -->
-<!NOTATION contentType
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!NOTATION contentTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentTypes//EN" >
-
-<!-- date and time information. ISO date format -->
-<!NOTATION datetime
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN" >
-
-<!-- a language code, as per [RFC3066] -->
-<!NOTATION languageCode
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!NOTATION uri
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!NOTATION uris
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN" >
-
-<!-- end of xhtml-notations-1.mod -->
-]]>
-
-<!ENTITY % xhtml-datatypes.module "INCLUDE" >
-<![%xhtml-datatypes.module;[
-<!ENTITY % xhtml-datatypes.mod
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- "xhtml-datatypes-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Datatypes Module .............................................. -->
-<!-- file: xhtml-datatypes-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-datatypes-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Datatypes
-
- defines containers for the following datatypes, many of
- these imported from other specifications and standards.
--->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!ENTITY % Length.datatype "CDATA" >
-
-<!-- space-separated list of link types -->
-<!ENTITY % LinkTypes.datatype "NMTOKENS" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!ENTITY % MediaDesc.datatype "CDATA" >
-
-<!-- pixel, percentage, or relative -->
-<!ENTITY % MultiLength.datatype "CDATA" >
-
-<!-- one or more digits (NUMBER) -->
-<!ENTITY % Number.datatype "CDATA" >
-
-<!-- integer representing length in pixels -->
-<!ENTITY % Pixels.datatype "CDATA" >
-
-<!-- script expression -->
-<!ENTITY % Script.datatype "CDATA" >
-
-<!-- textual content -->
-<!ENTITY % Text.datatype "CDATA" >
-
-<!-- Imported Datatypes ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!ENTITY % Character.datatype "CDATA" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!ENTITY % Charset.datatype "CDATA" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!ENTITY % Charsets.datatype "CDATA" >
-
-<!-- Color specification using color name or sRGB (#RRGGBB) values -->
-<!ENTITY % Color.datatype "CDATA" >
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType.datatype "CDATA" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!ENTITY % ContentTypes.datatype "CDATA" >
-
-<!-- date and time information. ISO date format -->
-<!ENTITY % Datetime.datatype "CDATA" >
-
-<!-- formal public identifier, as per [ISO8879] -->
-<!ENTITY % FPI.datatype "CDATA" >
-
-<!-- a language code, as per [RFC3066] -->
-<!ENTITY % LanguageCode.datatype "NMTOKEN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!ENTITY % URI.datatype "CDATA" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!ENTITY % URIs.datatype "CDATA" >
-
-<!-- end of xhtml-datatypes-1.mod -->
-]]>
-
-<!-- placeholder for XLink support module -->
-<!ENTITY % xhtml-xlink.mod "" >
-
-
-<!ENTITY % xhtml-qname.module "INCLUDE" >
-<![%xhtml-qname.module;[
-<!ENTITY % xhtml-qname.mod
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- "xhtml-qname-1.mod" >
-<!-- ....................................................................... -->
-<!-- XHTML Qname Module ................................................... -->
-<!-- file: xhtml-qname-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-qname-1.mod"
-
- Revisions:
-#2000-10-22: added qname declarations for ruby elements
- ....................................................................... -->
-
-<!-- XHTML Qname (Qualified Name) Module
-
- This module is contained in two parts, labeled Section 'A' and 'B':
-
- Section A declares parameter entities to support namespace-
- qualified names, namespace declarations, and name prefixing
- for XHTML and extensions.
-
- Section B declares parameter entities used to provide
- namespace-qualified names for all XHTML element types:
-
- %applet.qname; the xmlns-qualified name for <applet>
- %base.qname; the xmlns-qualified name for <base>
- ...
-
- XHTML extensions would create a module similar to this one.
- Included in the XHTML distribution is a template module
- ('template-qname-1.mod') suitable for this purpose.
--->
-
-<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
-
-<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
- to activate namespace prefixing. The default value should
- inherit '%NS.prefixed;' from the DTD driver, so that unless
- overridden, the default behaviour follows the overall DTD
- prefixing scheme.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
-
-<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
- the URI reference used to identify the XHTML namespace:
--->
-<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" >
-
-<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
- the default namespace prefix string(s) to use when prefixing
- is enabled. This may be overridden in the DTD driver or the
- internal subset of an document instance. If no default prefix
- is desired, this may be declared as an empty string.
-
- NOTE: As specified in [XMLNAMES], the namespace prefix serves
- as a proxy for the URI reference, and is not in itself significant.
--->
-<!ENTITY % XHTML.prefix "" >
-
-<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
- colonized prefix(es) (eg., '%XHTML.prefix;:') used when
- prefixing is active, an empty string when it is not.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.pfx "%XHTML.prefix;:" >
-]]>
-<!ENTITY % XHTML.pfx "" >
-
-<!-- declare qualified name extensions here ............ -->
-<!ENTITY % xhtml-qname-extra.mod "" >
-
-
-<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
- redeclared to contain any non-XHTML namespace declaration
- attributes for namespaces embedded in XHTML. The default
- is an empty string. XLink should be included here if used
- in the DTD.
--->
-<!ENTITY % XHTML.xmlns.extra.attrib "" >
-
-<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing
- all XML Namespace declarations used in the DTD, plus the
- xmlns declaration for XHTML, its form dependent on whether
- prefixing is active.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % NS.decl.attrib
- "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XHTML.xmlns.extra.attrib;"
->
-]]>
-<!ENTITY % NS.decl.attrib
- "%XHTML.xmlns.extra.attrib;"
->
-
-<!-- This is a placeholder for future XLink support.
--->
-<!ENTITY % XLINK.xmlns.attrib "" >
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing all
- XML namespace declaration attributes used by XHTML, including
- a default xmlns attribute when prefixing is inactive.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.xmlns.attrib
- "%NS.decl.attrib;
- %XLINK.xmlns.attrib;"
->
-]]>
-<!ENTITY % XHTML.xmlns.attrib
- "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XLINK.xmlns.attrib;"
->
-
-<!-- placeholder for qualified name redeclarations -->
-<!ENTITY % xhtml-qname.redecl "" >
-
-
-<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
-
-<!-- 6. This section declares parameter entities used to provide
- namespace-qualified names for all XHTML element types.
--->
-
-<!-- module: xhtml-applet-1.mod -->
-<!ENTITY % applet.qname "%XHTML.pfx;applet" >
-
-<!-- module: xhtml-base-1.mod -->
-<!ENTITY % base.qname "%XHTML.pfx;base" >
-
-<!-- module: xhtml-bdo-1.mod -->
-<!ENTITY % bdo.qname "%XHTML.pfx;bdo" >
-
-<!-- module: xhtml-blkphras-1.mod -->
-<!ENTITY % address.qname "%XHTML.pfx;address" >
-<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" >
-<!ENTITY % pre.qname "%XHTML.pfx;pre" >
-<!ENTITY % h1.qname "%XHTML.pfx;h1" >
-<!ENTITY % h2.qname "%XHTML.pfx;h2" >
-<!ENTITY % h3.qname "%XHTML.pfx;h3" >
-<!ENTITY % h4.qname "%XHTML.pfx;h4" >
-<!ENTITY % h5.qname "%XHTML.pfx;h5" >
-<!ENTITY % h6.qname "%XHTML.pfx;h6" >
-
-<!-- module: xhtml-blkpres-1.mod -->
-<!ENTITY % hr.qname "%XHTML.pfx;hr" >
-
-<!-- module: xhtml-blkstruct-1.mod -->
-<!ENTITY % div.qname "%XHTML.pfx;div" >
-<!ENTITY % p.qname "%XHTML.pfx;p" >
-
-<!-- module: xhtml-edit-1.mod -->
-<!ENTITY % ins.qname "%XHTML.pfx;ins" >
-<!ENTITY % del.qname "%XHTML.pfx;del" >
-
-<!-- module: xhtml-form-1.mod -->
-<!ENTITY % form.qname "%XHTML.pfx;form" >
-<!ENTITY % label.qname "%XHTML.pfx;label" >
-<!ENTITY % input.qname "%XHTML.pfx;input" >
-<!ENTITY % select.qname "%XHTML.pfx;select" >
-<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" >
-<!ENTITY % option.qname "%XHTML.pfx;option" >
-<!ENTITY % textarea.qname "%XHTML.pfx;textarea" >
-<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" >
-<!ENTITY % legend.qname "%XHTML.pfx;legend" >
-<!ENTITY % button.qname "%XHTML.pfx;button" >
-
-<!-- module: xhtml-hypertext-1.mod -->
-<!ENTITY % a.qname "%XHTML.pfx;a" >
-
-<!-- module: xhtml-image-1.mod -->
-<!ENTITY % img.qname "%XHTML.pfx;img" >
-
-<!-- module: xhtml-inlphras-1.mod -->
-<!ENTITY % abbr.qname "%XHTML.pfx;abbr" >
-<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
-<!ENTITY % cite.qname "%XHTML.pfx;cite" >
-<!ENTITY % code.qname "%XHTML.pfx;code" >
-<!ENTITY % dfn.qname "%XHTML.pfx;dfn" >
-<!ENTITY % em.qname "%XHTML.pfx;em" >
-<!ENTITY % kbd.qname "%XHTML.pfx;kbd" >
-<!ENTITY % q.qname "%XHTML.pfx;q" >
-<!ENTITY % samp.qname "%XHTML.pfx;samp" >
-<!ENTITY % strong.qname "%XHTML.pfx;strong" >
-<!ENTITY % var.qname "%XHTML.pfx;var" >
-
-<!-- module: xhtml-inlpres-1.mod -->
-<!ENTITY % b.qname "%XHTML.pfx;b" >
-<!ENTITY % big.qname "%XHTML.pfx;big" >
-<!ENTITY % i.qname "%XHTML.pfx;i" >
-<!ENTITY % small.qname "%XHTML.pfx;small" >
-<!ENTITY % sub.qname "%XHTML.pfx;sub" >
-<!ENTITY % sup.qname "%XHTML.pfx;sup" >
-<!ENTITY % tt.qname "%XHTML.pfx;tt" >
-
-<!-- module: xhtml-inlstruct-1.mod -->
-<!ENTITY % br.qname "%XHTML.pfx;br" >
-<!ENTITY % span.qname "%XHTML.pfx;span" >
-
-<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) -->
-<!ENTITY % map.qname "%XHTML.pfx;map" >
-<!ENTITY % area.qname "%XHTML.pfx;area" >
-
-<!-- module: xhtml-link-1.mod -->
-<!ENTITY % link.qname "%XHTML.pfx;link" >
-
-<!-- module: xhtml-list-1.mod -->
-<!ENTITY % dl.qname "%XHTML.pfx;dl" >
-<!ENTITY % dt.qname "%XHTML.pfx;dt" >
-<!ENTITY % dd.qname "%XHTML.pfx;dd" >
-<!ENTITY % ol.qname "%XHTML.pfx;ol" >
-<!ENTITY % ul.qname "%XHTML.pfx;ul" >
-<!ENTITY % li.qname "%XHTML.pfx;li" >
-
-<!-- module: xhtml-meta-1.mod -->
-<!ENTITY % meta.qname "%XHTML.pfx;meta" >
-
-<!-- module: xhtml-param-1.mod -->
-<!ENTITY % param.qname "%XHTML.pfx;param" >
-
-<!-- module: xhtml-object-1.mod -->
-<!ENTITY % object.qname "%XHTML.pfx;object" >
-
-<!-- module: xhtml-script-1.mod -->
-<!ENTITY % script.qname "%XHTML.pfx;script" >
-<!ENTITY % noscript.qname "%XHTML.pfx;noscript" >
-
-<!-- module: xhtml-struct-1.mod -->
-<!ENTITY % html.qname "%XHTML.pfx;html" >
-<!ENTITY % head.qname "%XHTML.pfx;head" >
-<!ENTITY % title.qname "%XHTML.pfx;title" >
-<!ENTITY % body.qname "%XHTML.pfx;body" >
-
-<!-- module: xhtml-style-1.mod -->
-<!ENTITY % style.qname "%XHTML.pfx;style" >
-
-<!-- module: xhtml-table-1.mod -->
-<!ENTITY % table.qname "%XHTML.pfx;table" >
-<!ENTITY % caption.qname "%XHTML.pfx;caption" >
-<!ENTITY % thead.qname "%XHTML.pfx;thead" >
-<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" >
-<!ENTITY % tbody.qname "%XHTML.pfx;tbody" >
-<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" >
-<!ENTITY % col.qname "%XHTML.pfx;col" >
-<!ENTITY % tr.qname "%XHTML.pfx;tr" >
-<!ENTITY % th.qname "%XHTML.pfx;th" >
-<!ENTITY % td.qname "%XHTML.pfx;td" >
-
-<!-- module: xhtml-ruby-1.mod -->
-
-<!ENTITY % ruby.qname "%XHTML.pfx;ruby" >
-<!ENTITY % rbc.qname "%XHTML.pfx;rbc" >
-<!ENTITY % rtc.qname "%XHTML.pfx;rtc" >
-<!ENTITY % rb.qname "%XHTML.pfx;rb" >
-<!ENTITY % rt.qname "%XHTML.pfx;rt" >
-<!ENTITY % rp.qname "%XHTML.pfx;rp" >
-
-<!-- Provisional XHTML 2.0 Qualified Names ...................... -->
-
-<!-- module: xhtml-image-2.mod -->
-<!ENTITY % alt.qname "%XHTML.pfx;alt" >
-
-<!-- end of xhtml-qname-1.mod -->
-]]>
-
-<!ENTITY % xhtml-events.module "IGNORE" >
-<![%xhtml-events.module;[
-<!ENTITY % xhtml-events.mod
- PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
- "xhtml-events-1.mod" >
-%xhtml-events.mod;]]>
-
-<!ENTITY % xhtml-attribs.module "INCLUDE" >
-<![%xhtml-attribs.module;[
-<!ENTITY % xhtml-attribs.mod
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- "xhtml-attribs-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Common Attributes Module ...................................... -->
-<!-- file: xhtml-attribs-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-attribs-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Common Attributes
-
- This module declares many of the common attributes for the XHTML DTD.
- %NS.decl.attrib; is declared in the XHTML Qname module.
--->
-
-<!ENTITY % id.attrib
- "id ID #IMPLIED"
->
-
-<!ENTITY % class.attrib
- "class NMTOKENS #IMPLIED"
->
-
-<!ENTITY % title.attrib
- "title %Text.datatype; #IMPLIED"
->
-
-<!ENTITY % Core.extra.attrib "" >
-
-<!ENTITY % Core.attrib
- "%XHTML.xmlns.attrib;
- %id.attrib;
- %class.attrib;
- %title.attrib;
- %Core.extra.attrib;"
->
-
-<!ENTITY % lang.attrib
- "xml:lang %LanguageCode.datatype; #IMPLIED"
->
-
-<![%XHTML.bidi;[
-<!ENTITY % dir.attrib
- "dir ( ltr | rtl ) #IMPLIED"
->
-
-<!ENTITY % I18n.attrib
- "%dir.attrib;
- %lang.attrib;"
->
-
-]]>
-<!ENTITY % I18n.attrib
- "%lang.attrib;"
->
-
-<!ENTITY % Common.extra.attrib "" >
-
-<!-- intrinsic event attributes declared previously
--->
-<!ENTITY % Events.attrib "" >
-
-<!ENTITY % Common.attrib
- "%Core.attrib;
- %I18n.attrib;
- %Events.attrib;
- %Common.extra.attrib;"
->
-
-<!-- end of xhtml-attribs-1.mod -->
-]]>
-
-<!-- placeholder for content model redeclarations -->
-<!ENTITY % xhtml-model.redecl "" >
-
-
-<!ENTITY % xhtml-model.module "INCLUDE" >
-<![%xhtml-model.module;[
-<!-- instantiate the Document Model module declared in the DTD driver
--->
-<!-- ....................................................................... -->
-<!-- XHTML Mobile 1.0 Document Model Module .................................... -->
-<!-- file: xhtml-mobile10-model-1.mod
-
- This is XHTML Mobile, a proper subset of XHTML.
- @Wireless Application Protocol Forum, Ltd. 2001.
-
- Terms and conditions of use are available from the Wireless Application Protocol Forum Ltd.
- Web site (http://www.wapforum.org/what/copyright.htm).
-
--->
-<!-- XHTML Mobile Document Model
-
- This module describes the groupings of elements that make up
- common content models for XHTML elements.
--->
-
-<!-- Optional Elements in head .............. -->
-
-<!ENTITY % HeadOpts.mix
- "( %meta.qname; | %link.qname; | %object.qname; | %style.qname; )*" >
-
-<!-- Miscellaneous Elements ................. -->
-
-<!ENTITY % Misc.class "" >
-
-<!-- Inline Elements ........................ -->
-
-<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
-
-<!ENTITY % InlPhras.class
- "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
- | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
- | %abbr.qname; | %acronym.qname; | %q.qname;" >
-
-<!ENTITY % InlPres.class
- "| %i.qname; | %b.qname; | %big.qname; | %small.qname; " >
-
-
-<!ENTITY % I18n.class "" >
-
-<!ENTITY % Anchor.class "| %a.qname;" >
-
-<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" >
-
-<!ENTITY % InlForm.class
- "| %input.qname; | %select.qname; | %textarea.qname;
- | %label.qname;"
->
-
-<!ENTITY % Inline.extra "" >
-
-<!ENTITY % Inline.class
- "%InlStruct.class;
- %InlPhras.class;
- %Anchor.class;
- %InlSpecial.class;
- %InlForm.class;
- %Inline.extra;"
->
-
-<!ENTITY % InlNoAnchor.class
- "%InlStruct.class;
- %InlPhras.class;
- %InlSpecial.class;
- %InlForm.class;
- %Inline.extra;"
->
-
-<!ENTITY % InlNoAnchor.mix
- "%InlNoAnchor.class;
- %Misc.class;"
->
-
-<!ENTITY % Inline.mix
- "%Inline.class;
- %Misc.class;"
->
-
-<!-- Block Elements ......................... -->
-
-<!ENTITY % Heading.class
- "%h1.qname; | %h2.qname; | %h3.qname;
- | %h4.qname; | %h5.qname; | %h6.qname;"
->
-<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
-
-<!ENTITY % Table.class "| %table.qname;" >
-
-<!ENTITY % Form.class "| %form.qname;" >
-
-<!ENTITY % Fieldset.class "| %fieldset.qname;" >
-
-<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
-
-<!ENTITY % BlkPhras.class
- "| %pre.qname; | %blockquote.qname; | %address.qname;"
->
-
-<!ENTITY % BlkPres.class "| %hr.qname;" >
-
-<!ENTITY % BlkSpecial.class
- "%Table.class;
- %Form.class;
- %Fieldset.class;"
->
-
-<!ENTITY % Block.extra "" >
-
-<!ENTITY % Block.class
- "%BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- %BlkSpecial.class;
- %Block.extra;"
->
-
-<!ENTITY % BlkNoForm.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- %Table.class;
- %Block.extra;
- %Misc.class;"
->
-
-<!ENTITY % Block.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- %Misc.class;"
->
-
-<!-- All Content Elements ................... -->
-
-<!-- declares all content except tables
--->
-<!ENTITY % FlowNoTable.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %Form.class;
- %Block.extra;
- | %Inline.class;
- %Misc.class;"
->
-
-
-<!ENTITY % Flow.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- | %Inline.class;
- %Misc.class;"
->
-
-<!-- end of xhtml-mobile10-model-1.mod -->
-]]>
-
-<!ENTITY % xhtml-charent.module "INCLUDE" >
-<![%xhtml-charent.module;[
-<!ENTITY % xhtml-charent.mod
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- "xhtml-charent-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Character Entities Module ......................................... -->
-<!-- file: xhtml-charent-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-charent-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Character Entities for XHTML
-
- This module declares the set of character entities for XHTML,
- including the Latin 1, Symbol and Special character collections.
--->
-
-<!ENTITY % xhtml-lat1
- PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent" >
-<!-- ...................................................................... -->
-<!-- XML-compatible ISO Latin 1 Character Entity Set for XHTML ............ -->
-<!-- file: xhtml-lat1.ent
-
- Typical invocation:
-
- <!ENTITY % xhtml-lat1
- PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent" >
- %xhtml-lat1;
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-lat1.ent"
-
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with conforming
- SGML systems and applications as defined in ISO 8879, provided
- this notice is included in all copies.
--->
-
-<!ENTITY nbsp "&#160;" ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
-<!ENTITY iexcl "&#161;" ><!-- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent "&#162;" ><!-- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound "&#163;" ><!-- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren "&#164;" ><!-- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen "&#165;" ><!-- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar "&#166;" ><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
-<!ENTITY sect "&#167;" ><!-- section sign, U+00A7 ISOnum -->
-<!ENTITY uml "&#168;" ><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
-<!ENTITY copy "&#169;" ><!-- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf "&#170;" ><!-- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo "&#171;" ><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not "&#172;" ><!-- not sign, U+00AC ISOnum -->
-<!ENTITY shy "&#173;" ><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
-<!ENTITY reg "&#174;" ><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
-<!ENTITY macr "&#175;" ><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg "&#176;" ><!-- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn "&#177;" ><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
-<!ENTITY sup2 "&#178;" ><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 "&#179;" ><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
-<!ENTITY acute "&#180;" ><!-- acute accent = spacing acute, U+00B4 ISOdia -->
-<!ENTITY micro "&#181;" ><!-- micro sign, U+00B5 ISOnum -->
-<!ENTITY para "&#182;" ><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
-<!ENTITY middot "&#183;" ><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil "&#184;" ><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 "&#185;" ><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
-<!ENTITY ordm "&#186;" ><!-- masculine ordinal indicator, U+00BA ISOnum -->
-<!ENTITY raquo "&#187;" ><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 "&#188;" ><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 "&#189;" ><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 "&#190;" ><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest "&#191;" ><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave "&#192;" ><!-- latin capital A with grave = latin capital A grave, U+00C0 ISOlat1 -->
-<!ENTITY Aacute "&#193;" ><!-- latin capital A with acute, U+00C1 ISOlat1 -->
-<!ENTITY Acirc "&#194;" ><!-- latin capital A with circumflex, U+00C2 ISOlat1 -->
-<!ENTITY Atilde "&#195;" ><!-- latin capital A with tilde, U+00C3 ISOlat1 -->
-<!ENTITY Auml "&#196;" ><!-- latin capital A with diaeresis, U+00C4 ISOlat1 -->
-<!ENTITY Aring "&#197;" ><!-- latin capital A with ring above = latin capital A ring, U+00C5 ISOlat1 -->
-<!ENTITY AElig "&#198;" ><!-- latin capital AE = latin capital ligature AE, U+00C6 ISOlat1 -->
-<!ENTITY Ccedil "&#199;" ><!-- latin capital C with cedilla, U+00C7 ISOlat1 -->
-<!ENTITY Egrave "&#200;" ><!-- latin capital E with grave, U+00C8 ISOlat1 -->
-<!ENTITY Eacute "&#201;" ><!-- latin capital E with acute, U+00C9 ISOlat1 -->
-<!ENTITY Ecirc "&#202;" ><!-- latin capital E with circumflex, U+00CA ISOlat1 -->
-<!ENTITY Euml "&#203;" ><!-- latin capital E with diaeresis, U+00CB ISOlat1 -->
-<!ENTITY Igrave "&#204;" ><!-- latin capital I with grave, U+00CC ISOlat1 -->
-<!ENTITY Iacute "&#205;" ><!-- latin capital I with acute, U+00CD ISOlat1 -->
-<!ENTITY Icirc "&#206;" ><!-- latin capital I with circumflex, U+00CE ISOlat1 -->
-<!ENTITY Iuml "&#207;" ><!-- latin capital I with diaeresis, U+00CF ISOlat1 -->
-<!ENTITY ETH "&#208;" ><!-- latin capital ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde "&#209;" ><!-- latin capital N with tilde, U+00D1 ISOlat1 -->
-<!ENTITY Ograve "&#210;" ><!-- latin capital O with grave, U+00D2 ISOlat1 -->
-<!ENTITY Oacute "&#211;" ><!-- latin capital O with acute, U+00D3 ISOlat1 -->
-<!ENTITY Ocirc "&#212;" ><!-- latin capital O with circumflex, U+00D4 ISOlat1 -->
-<!ENTITY Otilde "&#213;" ><!-- latin capital O with tilde, U+00D5 ISOlat1 -->
-<!ENTITY Ouml "&#214;" ><!-- latin capital O with diaeresis, U+00D6 ISOlat1 -->
-<!ENTITY times "&#215;" ><!-- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash "&#216;" ><!-- latin capital O with stroke = latin capital O slash, U+00D8 ISOlat1 -->
-<!ENTITY Ugrave "&#217;" ><!-- latin capital U with grave, U+00D9 ISOlat1 -->
-<!ENTITY Uacute "&#218;" ><!-- latin capital U with acute, U+00DA ISOlat1 -->
-<!ENTITY Ucirc "&#219;" ><!-- latin capital U with circumflex, U+00DB ISOlat1 -->
-<!ENTITY Uuml "&#220;" ><!-- latin capital U with diaeresis, U+00DC ISOlat1 -->
-<!ENTITY Yacute "&#221;" ><!-- latin capital Y with acute, U+00DD ISOlat1 -->
-<!ENTITY THORN "&#222;" ><!-- latin capital THORN, U+00DE ISOlat1 -->
-<!ENTITY szlig "&#223;" ><!-- latin small sharp s = ess-zed, U+00DF ISOlat1 -->
-<!ENTITY agrave "&#224;" ><!-- latin small a with grave = latin small a grave, U+00E0 ISOlat1 -->
-<!ENTITY aacute "&#225;" ><!-- latin small a with acute, U+00E1 ISOlat1 -->
-<!ENTITY acirc "&#226;" ><!-- latin small a with circumflex, U+00E2 ISOlat1 -->
-<!ENTITY atilde "&#227;" ><!-- latin small a with tilde, U+00E3 ISOlat1 -->
-<!ENTITY auml "&#228;" ><!-- latin small a with diaeresis, U+00E4 ISOlat1 -->
-<!ENTITY aring "&#229;" ><!-- latin small a with ring above = latin small a ring, U+00E5 ISOlat1 -->
-<!ENTITY aelig "&#230;" ><!-- latin small ae = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil "&#231;" ><!-- latin small c with cedilla, U+00E7 ISOlat1 -->
-<!ENTITY egrave "&#232;" ><!-- latin small e with grave, U+00E8 ISOlat1 -->
-<!ENTITY eacute "&#233;" ><!-- latin small e with acute, U+00E9 ISOlat1 -->
-<!ENTITY ecirc "&#234;" ><!-- latin small e with circumflex, U+00EA ISOlat1 -->
-<!ENTITY euml "&#235;" ><!-- latin small e with diaeresis, U+00EB ISOlat1 -->
-<!ENTITY igrave "&#236;" ><!-- latin small i with grave, U+00EC ISOlat1 -->
-<!ENTITY iacute "&#237;" ><!-- latin small i with acute, U+00ED ISOlat1 -->
-<!ENTITY icirc "&#238;" ><!-- latin small i with circumflex, U+00EE ISOlat1 -->
-<!ENTITY iuml "&#239;" ><!-- latin small i with diaeresis, U+00EF ISOlat1 -->
-<!ENTITY eth "&#240;" ><!-- latin small eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde "&#241;" ><!-- latin small n with tilde, U+00F1 ISOlat1 -->
-<!ENTITY ograve "&#242;" ><!-- latin small o with grave, U+00F2 ISOlat1 -->
-<!ENTITY oacute "&#243;" ><!-- latin small o with acute, U+00F3 ISOlat1 -->
-<!ENTITY ocirc "&#244;" ><!-- latin small o with circumflex, U+00F4 ISOlat1 -->
-<!ENTITY otilde "&#245;" ><!-- latin small o with tilde, U+00F5 ISOlat1 -->
-<!ENTITY ouml "&#246;" ><!-- latin small o with diaeresis, U+00F6 ISOlat1 -->
-<!ENTITY divide "&#247;" ><!-- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash "&#248;" ><!-- latin small o with stroke, = latin small o slash, U+00F8 ISOlat1 -->
-<!ENTITY ugrave "&#249;" ><!-- latin small u with grave, U+00F9 ISOlat1 -->
-<!ENTITY uacute "&#250;" ><!-- latin small u with acute, U+00FA ISOlat1 -->
-<!ENTITY ucirc "&#251;" ><!-- latin small u with circumflex, U+00FB ISOlat1 -->
-<!ENTITY uuml "&#252;" ><!-- latin small u with diaeresis, U+00FC ISOlat1 -->
-<!ENTITY yacute "&#253;" ><!-- latin small y with acute, U+00FD ISOlat1 -->
-<!ENTITY thorn "&#254;" ><!-- latin small thorn with, U+00FE ISOlat1 -->
-<!ENTITY yuml "&#255;" ><!-- latin small y with diaeresis, U+00FF ISOlat1 -->
-<!-- end of xhtml-lat1.ent -->
-
-
-<!ENTITY % xhtml-symbol
- PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent" >
-<!-- ...................................................................... -->
-<!-- ISO Math, Greek and Symbolic Character Entity Set for XHTML .......... -->
-<!-- file: xhtml-symbol.ent
-
- Typical invocation:
-
- <!ENTITY % xhtml-symbol
- PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent" >
- %xhtml-symbol;
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-symbol.ent"
-
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with conforming
- SGML systems and applications as defined in ISO 8879, provided
- this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 [SGML] list) do not clash with
- any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
- numbers are given for each character, in hex. Entity values are
- decimal conversions of the ISO 10646 values and refer to the
- document character set. Names are Unicode [UNICODE] names.
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof "&#402;" ><!-- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha "&#913;" ><!-- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta "&#914;" ><!-- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma "&#915;" ><!-- greek capital letter gamma, U+0393 ISOgrk3 -->
-<!ENTITY Delta "&#916;" ><!-- greek capital letter delta, U+0394 ISOgrk3 -->
-<!ENTITY Epsilon "&#917;" ><!-- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta "&#918;" ><!-- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta "&#919;" ><!-- greek capital letter eta, U+0397 -->
-<!ENTITY Theta "&#920;" ><!-- greek capital letter theta, U+0398 ISOgrk3 -->
-<!ENTITY Iota "&#921;" ><!-- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa "&#922;" ><!-- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda "&#923;" ><!-- greek capital letter lambda, U+039B ISOgrk3 -->
-<!ENTITY Mu "&#924;" ><!-- greek capital letter mu, U+039C -->
-<!ENTITY Nu "&#925;" ><!-- greek capital letter nu, U+039D -->
-<!ENTITY Xi "&#926;" ><!-- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron "&#927;" ><!-- greek capital letter omicron, U+039F -->
-<!ENTITY Pi "&#928;" ><!-- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho "&#929;" ><!-- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma "&#931;" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 -->
-<!ENTITY Tau "&#932;" ><!-- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon "&#933;" ><!-- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi "&#934;" ><!-- greek capital letter phi, U+03A6 ISOgrk3 -->
-<!ENTITY Chi "&#935;" ><!-- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi "&#936;" ><!-- greek capital letter psi, U+03A8 ISOgrk3 -->
-<!ENTITY Omega "&#937;" ><!-- greek capital letter omega, U+03A9 ISOgrk3 -->
-<!ENTITY alpha "&#945;" ><!-- greek small letter alpha, U+03B1 ISOgrk3 -->
-<!ENTITY beta "&#946;" ><!-- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma "&#947;" ><!-- greek small letter gamma, U+03B3 ISOgrk3 -->
-<!ENTITY delta "&#948;" ><!-- greek small letter delta, U+03B4 ISOgrk3 -->
-<!ENTITY epsilon "&#949;" ><!-- greek small letter epsilon, U+03B5 ISOgrk3 -->
-<!ENTITY zeta "&#950;" ><!-- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta "&#951;" ><!-- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta "&#952;" ><!-- greek small letter theta, U+03B8 ISOgrk3 -->
-<!ENTITY iota "&#953;" ><!-- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa "&#954;" ><!-- greek small letter kappa, U+03BA ISOgrk3 -->
-<!ENTITY lambda "&#955;" ><!-- greek small letter lambda, U+03BB ISOgrk3 -->
-<!ENTITY mu "&#956;" ><!-- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu "&#957;" ><!-- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi "&#958;" ><!-- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron "&#959;" ><!-- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi "&#960;" ><!-- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho "&#961;" ><!-- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf "&#962;" ><!-- greek small letter final sigma, U+03C2 ISOgrk3 -->
-<!ENTITY sigma "&#963;" ><!-- greek small letter sigma, U+03C3 ISOgrk3 -->
-<!ENTITY tau "&#964;" ><!-- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon "&#965;" ><!-- greek small letter upsilon, U+03C5 ISOgrk3 -->
-<!ENTITY phi "&#966;" ><!-- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi "&#967;" ><!-- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi "&#968;" ><!-- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega "&#969;" ><!-- greek small letter omega, U+03C9 ISOgrk3 -->
-<!ENTITY thetasym "&#977;" ><!-- greek small letter theta symbol, U+03D1 NEW -->
-<!ENTITY upsih "&#978;" ><!-- greek upsilon with hook symbol, U+03D2 NEW -->
-<!ENTITY piv "&#982;" ><!-- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull "&#8226;" ><!-- bullet = black small circle, U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip "&#8230;" ><!-- horizontal ellipsis = three dot leader, U+2026 ISOpub -->
-<!ENTITY prime "&#8242;" ><!-- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime "&#8243;" ><!-- double prime = seconds = inches, U+2033 ISOtech -->
-<!ENTITY oline "&#8254;" ><!-- overline = spacing overscore, U+203E NEW -->
-<!ENTITY frasl "&#8260;" ><!-- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp "&#8472;" ><!-- script capital P = power set = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image "&#8465;" ><!-- blackletter capital I = imaginary part, U+2111 ISOamso -->
-<!ENTITY real "&#8476;" ><!-- blackletter capital R = real part symbol, U+211C ISOamso -->
-<!ENTITY trade "&#8482;" ><!-- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym "&#8501;" ><!-- alef symbol = first transfinite cardinal, U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef, U+05D0 although
- the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr "&#8592;" ><!-- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr "&#8593;" ><!-- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr "&#8594;" ><!-- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr "&#8595;" ><!-- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr "&#8596;" ><!-- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr "&#8629;" ><!-- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr "&#8656;" ><!-- leftwards double arrow, U+21D0 ISOtech -->
-<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr "&#8657;" ><!-- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr "&#8658;" ><!-- rightwards double arrow, U+21D2 ISOtech -->
-<!-- Unicode does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr "&#8659;" ><!-- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr "&#8660;" ><!-- left right double arrow, U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall "&#8704;" ><!-- for all, U+2200 ISOtech -->
-<!ENTITY part "&#8706;" ><!-- partial differential, U+2202 ISOtech -->
-<!ENTITY exist "&#8707;" ><!-- there exists, U+2203 ISOtech -->
-<!ENTITY empty "&#8709;" ><!-- empty set = null set = diameter, U+2205 ISOamso -->
-<!ENTITY nabla "&#8711;" ><!-- nabla = backward difference, U+2207 ISOtech -->
-<!ENTITY isin "&#8712;" ><!-- element of, U+2208 ISOtech -->
-<!ENTITY notin "&#8713;" ><!-- not an element of, U+2209 ISOtech -->
-<!ENTITY ni "&#8715;" ><!-- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod "&#8719;" ><!-- n-ary product = product sign, U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum "&#8721;" ><!-- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus "&#8722;" ><!-- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast "&#8727;" ><!-- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic "&#8730;" ><!-- square root = radical sign, U+221A ISOtech -->
-<!ENTITY prop "&#8733;" ><!-- proportional to, U+221D ISOtech -->
-<!ENTITY infin "&#8734;" ><!-- infinity, U+221E ISOtech -->
-<!ENTITY ang "&#8736;" ><!-- angle, U+2220 ISOamso -->
-<!ENTITY and "&#8743;" ><!-- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or "&#8744;" ><!-- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap "&#8745;" ><!-- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup "&#8746;" ><!-- union = cup, U+222A ISOtech -->
-<!ENTITY int "&#8747;" ><!-- integral, U+222B ISOtech -->
-<!ENTITY there4 "&#8756;" ><!-- therefore, U+2234 ISOtech -->
-<!ENTITY sim "&#8764;" ><!-- tilde operator = varies with = similar to, U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong "&#8773;" ><!-- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp "&#8776;" ><!-- almost equal to = asymptotic to, U+2248 ISOamsr -->
-<!ENTITY ne "&#8800;" ><!-- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv "&#8801;" ><!-- identical to, U+2261 ISOtech -->
-<!ENTITY le "&#8804;" ><!-- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge "&#8805;" ><!-- greater-than or equal to, U+2265 ISOtech -->
-<!ENTITY sub "&#8834;" ><!-- subset of, U+2282 ISOtech -->
-<!ENTITY sup "&#8835;" ><!-- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub "&#8836;" ><!-- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube "&#8838;" ><!-- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe "&#8839;" ><!-- superset of or equal to, U+2287 ISOtech -->
-<!ENTITY oplus "&#8853;" ><!-- circled plus = direct sum, U+2295 ISOamsb -->
-<!ENTITY otimes "&#8855;" ><!-- circled times = vector product, U+2297 ISOamsb -->
-<!ENTITY perp "&#8869;" ><!-- up tack = orthogonal to = perpendicular, U+22A5 ISOtech -->
-<!ENTITY sdot "&#8901;" ><!-- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil "&#8968;" ><!-- left ceiling = apl upstile, U+2308 ISOamsc -->
-<!ENTITY rceil "&#8969;" ><!-- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor "&#8970;" ><!-- left floor = apl downstile, U+230A ISOamsc -->
-<!ENTITY rfloor "&#8971;" ><!-- right floor, U+230B ISOamsc -->
-<!ENTITY lang "&#9001;" ><!-- left-pointing angle bracket = bra, U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang "&#9002;" ><!-- right-pointing angle bracket = ket, U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz "&#9674;" ><!-- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades "&#9824;" ><!-- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs "&#9827;" ><!-- black club suit = shamrock, U+2663 ISOpub -->
-<!ENTITY hearts "&#9829;" ><!-- black heart suit = valentine, U+2665 ISOpub -->
-<!ENTITY diams "&#9830;" ><!-- black diamond suit, U+2666 ISOpub -->
-
-<!-- end of xhtml-symbol.ent -->
-
-
-<!ENTITY % xhtml-special
- PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent" >
-<!-- ...................................................................... -->
-<!-- XML-compatible ISO Special Character Entity Set for XHTML ............ -->
-<!-- file: xhtml-special.ent
-
- Typical invocation:
-
- <!ENTITY % xhtml-special
- PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent" >
- %xhtml-special;
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-special.ent"
-
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with conforming
- SGML systems and applications as defined in ISO 8879, provided
- this notice is included in all copies.
-
- Revisions:
-2000-10-28: added &apos; and altered XML Predefined Entities for compatibility
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 [SGML] list) do not clash with
- any existing ISO 8879 entity names. ISO 10646 [ISO10646] character
- numbers are given for each character, in hex. Entity values are
- decimal conversions of the ISO 10646 values and refer to the
- document character set. Names are Unicode [UNICODE] names.
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY lt "&#38;&#60;" ><!-- less-than sign, U+003C ISOnum -->
-<!ENTITY gt "&#62;" ><!-- greater-than sign, U+003E ISOnum -->
-<!ENTITY amp "&#38;&#38;" ><!-- ampersand, U+0026 ISOnum -->
-<!ENTITY apos "&#39;" ><!-- apostrophe, U+0027 ISOnum -->
-<!ENTITY quot "&#34;" ><!-- quotation mark = APL quote, U+0022 ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig "&#338;" ><!-- latin capital ligature OE, U+0152 ISOlat2 -->
-<!ENTITY oelig "&#339;" ><!-- latin small ligature oe, U+0153 ISOlat2 -->
-
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron "&#352;" ><!-- latin capital letter S with caron, U+0160 ISOlat2 -->
-<!ENTITY scaron "&#353;" ><!-- latin small letter s with caron, U+0161 ISOlat2 -->
-<!ENTITY Yuml "&#376;" ><!-- latin capital letter Y with diaeresis, U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ "&#710;" ><!-- modifier letter circumflex accent, U+02C6 ISOpub -->
-<!ENTITY tilde "&#732;" ><!-- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp "&#8194;" ><!-- en space, U+2002 ISOpub -->
-<!ENTITY emsp "&#8195;" ><!-- em space, U+2003 ISOpub -->
-<!ENTITY thinsp "&#8201;" ><!-- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj "&#8204;" ><!-- zero width non-joiner, U+200C NEW RFC 2070 -->
-<!ENTITY zwj "&#8205;" ><!-- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm "&#8206;" ><!-- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm "&#8207;" ><!-- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash "&#8211;" ><!-- en dash, U+2013 ISOpub -->
-<!ENTITY mdash "&#8212;" ><!-- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo "&#8216;" ><!-- left single quotation mark, U+2018 ISOnum -->
-<!ENTITY rsquo "&#8217;" ><!-- right single quotation mark, U+2019 ISOnum -->
-<!ENTITY sbquo "&#8218;" ><!-- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo "&#8220;" ><!-- left double quotation mark, U+201C ISOnum -->
-<!ENTITY rdquo "&#8221;" ><!-- right double quotation mark, U+201D ISOnum -->
-<!ENTITY bdquo "&#8222;" ><!-- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger "&#8224;" ><!-- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger "&#8225;" ><!-- double dagger, U+2021 ISOpub -->
-<!ENTITY permil "&#8240;" ><!-- per mille sign, U+2030 ISOtech -->
-
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY lsaquo "&#8249;" ><!-- single left-pointing angle quotation mark, U+2039 ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo "&#8250;" ><!-- single right-pointing angle quotation mark, U+203A ISO proposed -->
-<!ENTITY euro "&#8364;" ><!-- euro sign, U+20AC NEW -->
-
-<!-- end of xhtml-special.ent -->
-
-
-<!-- end of xhtml-charent-1.mod -->
-]]>
-
-<!-- end of xhtml-framework-1.mod -->
-
-
-<!-- XHTML Core Modules ........................................ -->
-<!ENTITY % pre.content
- "( #PCDATA
- | %InlStruct.class;
- %InlPhras.class;
- %Anchor.class;
- %Inline.extra; )*"
->
-
-<!ENTITY % xhtml-text.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Text Module ................................................... -->
-<!-- file: xhtml-text-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Textual Content
-
- The Text module includes declarations for all core
- text container elements and their attributes.
--->
-
-<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
-<![%xhtml-inlstruct.module;[
-<!ENTITY % xhtml-inlstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- "xhtml-inlstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Structural Module ...................................... -->
-<!-- file: xhtml-inlstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Structural
-
- br, span
-
- This module declares the elements and their attributes
- used to support inline-level structural markup.
--->
-
-<!-- br: forced line break ............................. -->
-
-<!ENTITY % br.element "INCLUDE" >
-<![%br.element;[
-
-<!ENTITY % br.content "EMPTY" >
-<!ENTITY % br.qname "br" >
-<!ELEMENT %br.qname; %br.content; >
-
-<!-- end of br.element -->]]>
-
-<!ENTITY % br.attlist "INCLUDE" >
-<![%br.attlist;[
-<!ATTLIST %br.qname;
- %Core.attrib;
->
-<!-- end of br.attlist -->]]>
-
-<!-- span: generic inline container .................... -->
-
-<!ENTITY % span.element "INCLUDE" >
-<![%span.element;[
-<!ENTITY % span.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % span.qname "span" >
-<!ELEMENT %span.qname; %span.content; >
-<!-- end of span.element -->]]>
-
-<!ENTITY % span.attlist "INCLUDE" >
-<![%span.attlist;[
-<!ATTLIST %span.qname;
- %Common.attrib;
->
-<!-- end of span.attlist -->]]>
-
-<!-- end of xhtml-inlstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-inlphras.module "INCLUDE" >
-<![%xhtml-inlphras.module;[
-<!ENTITY % xhtml-inlphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- "xhtml-inlphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Phrasal Module ......................................... -->
-<!-- file: xhtml-inlphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Phrasal
-
- abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
-
- This module declares the elements and their attributes used to
- support inline-level phrasal markup.
--->
-
-<!ENTITY % abbr.element "INCLUDE" >
-<![%abbr.element;[
-<!ENTITY % abbr.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % abbr.qname "abbr" >
-<!ELEMENT %abbr.qname; %abbr.content; >
-<!-- end of abbr.element -->]]>
-
-<!ENTITY % abbr.attlist "INCLUDE" >
-<![%abbr.attlist;[
-<!ATTLIST %abbr.qname;
- %Common.attrib;
->
-<!-- end of abbr.attlist -->]]>
-
-<!ENTITY % acronym.element "INCLUDE" >
-<![%acronym.element;[
-<!ENTITY % acronym.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % acronym.qname "acronym" >
-<!ELEMENT %acronym.qname; %acronym.content; >
-<!-- end of acronym.element -->]]>
-
-<!ENTITY % acronym.attlist "INCLUDE" >
-<![%acronym.attlist;[
-<!ATTLIST %acronym.qname;
- %Common.attrib;
->
-<!-- end of acronym.attlist -->]]>
-
-<!ENTITY % cite.element "INCLUDE" >
-<![%cite.element;[
-<!ENTITY % cite.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % cite.qname "cite" >
-<!ELEMENT %cite.qname; %cite.content; >
-<!-- end of cite.element -->]]>
-
-<!ENTITY % cite.attlist "INCLUDE" >
-<![%cite.attlist;[
-<!ATTLIST %cite.qname;
- %Common.attrib;
->
-<!-- end of cite.attlist -->]]>
-
-<!ENTITY % code.element "INCLUDE" >
-<![%code.element;[
-<!ENTITY % code.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % code.qname "code" >
-<!ELEMENT %code.qname; %code.content; >
-<!-- end of code.element -->]]>
-
-<!ENTITY % code.attlist "INCLUDE" >
-<![%code.attlist;[
-<!ATTLIST %code.qname;
- %Common.attrib;
->
-<!-- end of code.attlist -->]]>
-
-<!ENTITY % dfn.element "INCLUDE" >
-<![%dfn.element;[
-<!ENTITY % dfn.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % dfn.qname "dfn" >
-<!ELEMENT %dfn.qname; %dfn.content; >
-<!-- end of dfn.element -->]]>
-
-<!ENTITY % dfn.attlist "INCLUDE" >
-<![%dfn.attlist;[
-<!ATTLIST %dfn.qname;
- %Common.attrib;
->
-<!-- end of dfn.attlist -->]]>
-
-<!ENTITY % em.element "INCLUDE" >
-<![%em.element;[
-<!ENTITY % em.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % em.qname "em" >
-<!ELEMENT %em.qname; %em.content; >
-<!-- end of em.element -->]]>
-
-<!ENTITY % em.attlist "INCLUDE" >
-<![%em.attlist;[
-<!ATTLIST %em.qname;
- %Common.attrib;
->
-<!-- end of em.attlist -->]]>
-
-<!ENTITY % kbd.element "INCLUDE" >
-<![%kbd.element;[
-<!ENTITY % kbd.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % kbd.qname "kbd" >
-<!ELEMENT %kbd.qname; %kbd.content; >
-<!-- end of kbd.element -->]]>
-
-<!ENTITY % kbd.attlist "INCLUDE" >
-<![%kbd.attlist;[
-<!ATTLIST %kbd.qname;
- %Common.attrib;
->
-<!-- end of kbd.attlist -->]]>
-
-<!ENTITY % q.element "INCLUDE" >
-<![%q.element;[
-<!ENTITY % q.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % q.qname "q" >
-<!ELEMENT %q.qname; %q.content; >
-<!-- end of q.element -->]]>
-
-<!ENTITY % q.attlist "INCLUDE" >
-<![%q.attlist;[
-<!ATTLIST %q.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of q.attlist -->]]>
-
-<!ENTITY % samp.element "INCLUDE" >
-<![%samp.element;[
-<!ENTITY % samp.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % samp.qname "samp" >
-<!ELEMENT %samp.qname; %samp.content; >
-<!-- end of samp.element -->]]>
-
-<!ENTITY % samp.attlist "INCLUDE" >
-<![%samp.attlist;[
-<!ATTLIST %samp.qname;
- %Common.attrib;
->
-<!-- end of samp.attlist -->]]>
-
-<!ENTITY % strong.element "INCLUDE" >
-<![%strong.element;[
-<!ENTITY % strong.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % strong.qname "strong" >
-<!ELEMENT %strong.qname; %strong.content; >
-<!-- end of strong.element -->]]>
-
-<!ENTITY % strong.attlist "INCLUDE" >
-<![%strong.attlist;[
-<!ATTLIST %strong.qname;
- %Common.attrib;
->
-<!-- end of strong.attlist -->]]>
-
-<!ENTITY % var.element "INCLUDE" >
-<![%var.element;[
-<!ENTITY % var.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % var.qname "var" >
-<!ELEMENT %var.qname; %var.content; >
-<!-- end of var.element -->]]>
-
-<!ENTITY % var.attlist "INCLUDE" >
-<![%var.attlist;[
-<!ATTLIST %var.qname;
- %Common.attrib;
->
-<!-- end of var.attlist -->]]>
-
-<!-- end of xhtml-inlphras-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
-<![%xhtml-blkstruct.module;[
-<!ENTITY % xhtml-blkstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- "xhtml-blkstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Structural Module ....................................... -->
-<!-- file: xhtml-blkstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Structural
-
- div, p
-
- This module declares the elements and their attributes used to
- support block-level structural markup.
--->
-
-<!ENTITY % div.element "INCLUDE" >
-<![%div.element;[
-<!ENTITY % div.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ENTITY % div.qname "div" >
-<!ELEMENT %div.qname; %div.content; >
-<!-- end of div.element -->]]>
-
-<!ENTITY % div.attlist "INCLUDE" >
-<![%div.attlist;[
-<!ATTLIST %div.qname;
- %Common.attrib;
->
-<!-- end of div.attlist -->]]>
-
-<!ENTITY % p.element "INCLUDE" >
-<![%p.element;[
-<!ENTITY % p.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % p.qname "p" >
-<!ELEMENT %p.qname; %p.content; >
-<!-- end of p.element -->]]>
-
-<!ENTITY % p.attlist "INCLUDE" >
-<![%p.attlist;[
-<!ATTLIST %p.qname;
- %Common.attrib;
->
-<!-- end of p.attlist -->]]>
-
-<!-- end of xhtml-blkstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkphras.module "INCLUDE" >
-<![%xhtml-blkphras.module;[
-<!ENTITY % xhtml-blkphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- "xhtml-blkphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Phrasal Module .......................................... -->
-<!-- file: xhtml-blkphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Phrasal
-
- address, blockquote, pre, h1, h2, h3, h4, h5, h6
-
- This module declares the elements and their attributes used to
- support block-level phrasal markup.
--->
-
-<!ENTITY % address.element "INCLUDE" >
-<![%address.element;[
-<!ENTITY % address.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % address.qname "address" >
-<!ELEMENT %address.qname; %address.content; >
-<!-- end of address.element -->]]>
-
-<!ENTITY % address.attlist "INCLUDE" >
-<![%address.attlist;[
-<!ATTLIST %address.qname;
- %Common.attrib;
->
-<!-- end of address.attlist -->]]>
-
-<!ENTITY % blockquote.element "INCLUDE" >
-<![%blockquote.element;[
-<!ENTITY % blockquote.content
- "( %Block.mix; )+"
->
-<!ENTITY % blockquote.qname "blockquote" >
-<!ELEMENT %blockquote.qname; %blockquote.content; >
-<!-- end of blockquote.element -->]]>
-
-<!ENTITY % blockquote.attlist "INCLUDE" >
-<![%blockquote.attlist;[
-<!ATTLIST %blockquote.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of blockquote.attlist -->]]>
-
-<!ENTITY % pre.element "INCLUDE" >
-<![%pre.element;[
-<!ENTITY % pre.content
- "( #PCDATA
- | %InlStruct.class;
- %InlPhras.class;
- | %tt.qname; | %i.qname; | %b.qname;
- %I18n.class;
- %Anchor.class;
- | %script.qname; | %map.qname;
- %Inline.extra; )*"
->
-<!ENTITY % pre.qname "pre" >
-<!ELEMENT %pre.qname; %pre.content; >
-<!-- end of pre.element -->]]>
-
-<!ENTITY % pre.attlist "INCLUDE" >
-<![%pre.attlist;[
-<!ATTLIST %pre.qname;
- %Common.attrib;
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of pre.attlist -->]]>
-
-<!-- ................... Heading Elements ................... -->
-
-<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
-
-<!ENTITY % h1.element "INCLUDE" >
-<![%h1.element;[
-<!ENTITY % h1.qname "h1" >
-<!ELEMENT %h1.qname; %Heading.content; >
-<!-- end of h1.element -->]]>
-
-<!ENTITY % h1.attlist "INCLUDE" >
-<![%h1.attlist;[
-<!ATTLIST %h1.qname;
- %Common.attrib;
->
-<!-- end of h1.attlist -->]]>
-
-<!ENTITY % h2.element "INCLUDE" >
-<![%h2.element;[
-<!ENTITY % h2.qname "h2" >
-<!ELEMENT %h2.qname; %Heading.content; >
-<!-- end of h2.element -->]]>
-
-<!ENTITY % h2.attlist "INCLUDE" >
-<![%h2.attlist;[
-<!ATTLIST %h2.qname;
- %Common.attrib;
->
-<!-- end of h2.attlist -->]]>
-
-<!ENTITY % h3.element "INCLUDE" >
-<![%h3.element;[
-<!ENTITY % h3.qname "h3" >
-<!ELEMENT %h3.qname; %Heading.content; >
-<!-- end of h3.element -->]]>
-
-<!ENTITY % h3.attlist "INCLUDE" >
-<![%h3.attlist;[
-<!ATTLIST %h3.qname;
- %Common.attrib;
->
-<!-- end of h3.attlist -->]]>
-
-<!ENTITY % h4.element "INCLUDE" >
-<![%h4.element;[
-<!ENTITY % h4.qname "h4" >
-<!ELEMENT %h4.qname; %Heading.content; >
-<!-- end of h4.element -->]]>
-
-<!ENTITY % h4.attlist "INCLUDE" >
-<![%h4.attlist;[
-<!ATTLIST %h4.qname;
- %Common.attrib;
->
-<!-- end of h4.attlist -->]]>
-
-<!ENTITY % h5.element "INCLUDE" >
-<![%h5.element;[
-<!ENTITY % h5.qname "h5" >
-<!ELEMENT %h5.qname; %Heading.content; >
-<!-- end of h5.element -->]]>
-
-<!ENTITY % h5.attlist "INCLUDE" >
-<![%h5.attlist;[
-<!ATTLIST %h5.qname;
- %Common.attrib;
->
-<!-- end of h5.attlist -->]]>
-
-<!ENTITY % h6.element "INCLUDE" >
-<![%h6.element;[
-<!ENTITY % h6.qname "h6" >
-<!ELEMENT %h6.qname; %Heading.content; >
-<!-- end of h6.element -->]]>
-
-<!ENTITY % h6.attlist "INCLUDE" >
-<![%h6.attlist;[
-<!ATTLIST %h6.qname;
- %Common.attrib;
->
-<!-- end of h6.attlist -->]]>
-
-<!-- end of xhtml-blkphras-1.mod -->
-]]>
-
-<!-- end of xhtml-text-1.mod -->
-
-
-<!ENTITY % xhtml-hypertext.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Hypertext Module .............................................. -->
-<!-- file: xhtml-hypertext-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Hypertext
-
- a
-
- This module declares the anchor ('a') element type, which
- defines the source of a hypertext link. The destination
- (or link 'target') is identified via its 'id' attribute
- rather than the 'name' attribute as was used in HTML.
--->
-
-<!-- ............ Anchor Element ............ -->
-
-<!ENTITY % a.element "INCLUDE" >
-<![%a.element;[
-<!ENTITY % a.content
- "( #PCDATA | %InlNoAnchor.mix; )*"
->
-<!ENTITY % a.qname "a" >
-<!ELEMENT %a.qname; %a.content; >
-<!-- end of a.element -->]]>
-
-<!ENTITY % a.attlist "INCLUDE" >
-<![%a.attlist;[
-<!ATTLIST %a.qname;
- %Common.attrib;
- href %URI.datatype; #IMPLIED
- charset %Charset.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of a.attlist -->]]>
-
-<!-- end of xhtml-hypertext-1.mod -->
-
-
-<!ENTITY % xhtml-list.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Lists Module .................................................. -->
-<!-- file: xhtml-list-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Lists
-
- dl, dt, dd, ol, ul, li
-
- This module declares the list-oriented element types
- and their attributes.
--->
-
-<!ENTITY % dl.qname "dl" >
-<!ENTITY % dt.qname "dt" >
-<!ENTITY % dd.qname "dd" >
-<!ENTITY % ol.qname "ol" >
-<!ENTITY % ul.qname "ul" >
-<!ENTITY % li.qname "li" >
-
-<!-- dl: Definition List ............................... -->
-
-<!ENTITY % dl.element "INCLUDE" >
-<![%dl.element;[
-<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" >
-<!ELEMENT %dl.qname; %dl.content; >
-<!-- end of dl.element -->]]>
-
-<!ENTITY % dl.attlist "INCLUDE" >
-<![%dl.attlist;[
-<!ATTLIST %dl.qname;
- %Common.attrib;
->
-<!-- end of dl.attlist -->]]>
-
-<!-- dt: Definition Term ............................... -->
-
-<!ENTITY % dt.element "INCLUDE" >
-<![%dt.element;[
-<!ENTITY % dt.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %dt.qname; %dt.content; >
-<!-- end of dt.element -->]]>
-
-<!ENTITY % dt.attlist "INCLUDE" >
-<![%dt.attlist;[
-<!ATTLIST %dt.qname;
- %Common.attrib;
->
-<!-- end of dt.attlist -->]]>
-
-<!-- dd: Definition Description ........................ -->
-
-<!ENTITY % dd.element "INCLUDE" >
-<![%dd.element;[
-<!ENTITY % dd.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %dd.qname; %dd.content; >
-<!-- end of dd.element -->]]>
-
-<!ENTITY % dd.attlist "INCLUDE" >
-<![%dd.attlist;[
-<!ATTLIST %dd.qname;
- %Common.attrib;
->
-<!-- end of dd.attlist -->]]>
-
-<!-- ol: Ordered List (numbered styles) ................ -->
-
-<!ENTITY % ol.element "INCLUDE" >
-<![%ol.element;[
-<!ENTITY % ol.content "( %li.qname; )+" >
-<!ELEMENT %ol.qname; %ol.content; >
-<!-- end of ol.element -->]]>
-
-<!ENTITY % ol.attlist "INCLUDE" >
-<![%ol.attlist;[
-<!ATTLIST %ol.qname;
- %Common.attrib;
->
-<!-- end of ol.attlist -->]]>
-
-<!-- ul: Unordered List (bullet styles) ................ -->
-
-<!ENTITY % ul.element "INCLUDE" >
-<![%ul.element;[
-<!ENTITY % ul.content "( %li.qname; )+" >
-<!ELEMENT %ul.qname; %ul.content; >
-<!-- end of ul.element -->]]>
-
-<!ENTITY % ul.attlist "INCLUDE" >
-<![%ul.attlist;[
-<!ATTLIST %ul.qname;
- %Common.attrib;
->
-<!-- end of ul.attlist -->]]>
-
-<!-- li: List Item ..................................... -->
-
-<!ENTITY % li.element "INCLUDE" >
-<![%li.element;[
-<!ENTITY % li.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %li.qname; %li.content; >
-<!-- end of li.element -->]]>
-
-<!ENTITY % li.attlist "INCLUDE" >
-<![%li.attlist;[
-<!ATTLIST %li.qname;
- %Common.attrib;
->
-<!-- end of li.attlist -->]]>
-
-<!-- end of xhtml-list-1.mod -->
-
-<!-- Extend lists with value and start attributes -->
-<!ATTLIST %li.qname;
- value %Number.datatype; #IMPLIED
->
-<!ATTLIST %ol.qname;
- start %Number.datatype; #IMPLIED
->
-
-<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
-
-<!-- Image Module ............................................... -->
-<!ENTITY % xhtml-image.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Images Module ................................................. -->
-<!-- file: xhtml-image-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Rovision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Images
-
- img
-
- This module provides markup to support basic image embedding.
--->
-
-<!-- To avoid problems with text-only UAs as well as to make
- image content understandable and navigable to users of
- non-visual UAs, you need to provide a description with
- the 'alt' attribute, and avoid server-side image maps.
--->
-
-<!ENTITY % img.element "INCLUDE" >
-<![%img.element;[
-<!ENTITY % img.content "EMPTY" >
-<!ENTITY % img.qname "img" >
-<!ELEMENT %img.qname; %img.content; >
-<!-- end of img.element -->]]>
-
-<!ENTITY % img.attlist "INCLUDE" >
-<![%img.attlist;[
-<!ATTLIST %img.qname;
- %Common.attrib;
- src %URI.datatype; #REQUIRED
- alt %Text.datatype; #REQUIRED
- longdesc %URI.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
->
-<!-- end of img.attlist -->]]>
-
-<!-- end of xhtml-image-1.mod -->
-
-
-<!-- Tables Module ............................................... -->
-<!ENTITY % xhtml-table.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-table-1.mod" >
-<!-- ....................................................................... -->
-<!-- XHTML Basic Table Module ............................................. -->
-<!-- file: xhtml-basic-table-1.mod
-
- This is XHTML Basic, a proper subset of XHTML.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-table-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Basic Tables
-
- table, caption, tr, th, td
-
- This table module declares elements and attributes defining
- a table model based fundamentally on features found in the
- widely-deployed HTML 3.2 table model. While this module
- mimics the content model and table attributes of HTML 3.2
- tables, the element types declared herein also includes all
- HTML 4 common and most of the HTML 4 table attributes.
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % table.qname "table" >
-<!ENTITY % caption.qname "caption" >
-<!ENTITY % tr.qname "tr" >
-<!ENTITY % th.qname "th" >
-<!ENTITY % td.qname "td" >
-
-<!-- horizontal alignment attributes for cell contents
--->
-<!ENTITY % CellHAlign.attrib
- "align ( left
- | center
- | right ) #IMPLIED"
->
-
-<!-- vertical alignment attributes for cell contents
--->
-<!ENTITY % CellVAlign.attrib
- "valign ( top
- | middle
- | bottom ) #IMPLIED"
->
-
-<!-- scope is simpler than axes attribute for common tables
--->
-<!ENTITY % scope.attrib
- "scope ( row | col ) #IMPLIED"
->
-
-<!-- table: Table Element .............................. -->
-
-<!ENTITY % table.element "INCLUDE" >
-<![%table.element;[
-<!ENTITY % table.content
- "( %caption.qname;?, %tr.qname;+ )"
->
-<!ELEMENT %table.qname; %table.content; >
-<!-- end of table.element -->]]>
-
-<!ENTITY % table.attlist "INCLUDE" >
-<![%table.attlist;[
-<!ATTLIST %table.qname;
- %Common.attrib;
- summary %Text.datatype; #IMPLIED
->
-<!-- end of table.attlist -->]]>
-
-<!-- caption: Table Caption ............................ -->
-
-<!ENTITY % caption.element "INCLUDE" >
-<![%caption.element;[
-<!ENTITY % caption.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %caption.qname; %caption.content; >
-<!-- end of caption.element -->]]>
-
-<!ENTITY % caption.attlist "INCLUDE" >
-<![%caption.attlist;[
-<!ATTLIST %caption.qname;
- %Common.attrib;
->
-<!-- end of caption.attlist -->]]>
-
-<!-- tr: Table Row ..................................... -->
-
-<!ENTITY % tr.element "INCLUDE" >
-<![%tr.element;[
-<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" >
-<!ELEMENT %tr.qname; %tr.content; >
-<!-- end of tr.element -->]]>
-
-<!ENTITY % tr.attlist "INCLUDE" >
-<![%tr.attlist;[
-<!ATTLIST %tr.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of tr.attlist -->]]>
-
-<!-- th: Table Header Cell ............................. -->
-
-<!-- th is for header cells, td for data,
- but for cells acting as both use td
--->
-
-<!ENTITY % th.element "INCLUDE" >
-<![%th.element;[
-<!ENTITY % th.content
- "( #PCDATA | %FlowNoTable.mix; )*"
->
-<!ELEMENT %th.qname; %th.content; >
-<!-- end of th.element -->]]>
-
-<!ENTITY % th.attlist "INCLUDE" >
-<![%th.attlist;[
-<!ATTLIST %th.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of th.attlist -->]]>
-
-<!-- td: Table Data Cell ............................... -->
-
-<!ENTITY % td.element "INCLUDE" >
-<![%td.element;[
-<!ENTITY % td.content
- "( #PCDATA | %FlowNoTable.mix; )*"
->
-<!ELEMENT %td.qname; %td.content; >
-<!-- end of td.element -->]]>
-
-<!ENTITY % td.attlist "INCLUDE" >
-<![%td.attlist;[
-<!ATTLIST %td.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of td.attlist -->]]>
-
-<!-- end of xhtml-basic-table-1.mod -->
-
-
-<!-- Forms Module ...............................................
- XHTML basic forms module extended with optgroup and fieldset
--->
-<!ELEMENT %optgroup.qname; (%option.qname;)+>
-<!ATTLIST %optgroup.qname;
- %Common.attrib;
- label %Text.datatype; #REQUIRED
->
-<!ENTITY % select.content "( %optgroup.qname; | %option.qname; )+">
-<!ELEMENT %fieldset.qname; (#PCDATA | %Flow.mix;)*>
-<!ATTLIST %fieldset.qname;
- %Common.attrib;
->
-<!ENTITY % form.content "( %BlkNoForm.mix; | %fieldset.qname; )+">
-<!ENTITY % xhtml-form.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-form-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Simplified Forms Module ....................................... -->
-<!-- file: xhtml-basic-form-1.mod
-
- This is XHTML Basic, a proper subset of XHTML.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-form-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Basic Forms
-
- This forms module is based on the HTML 3.2 forms model, with
- the WAI-requested addition of the label element. While this
- module essentially mimics the content model and attributes of
- HTML 3.2 forms, the element types declared herein also include
- all HTML 4 common attributes.
-
- form, label, input, select, option, textarea
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % form.qname "form" >
-<!ENTITY % label.qname "label" >
-<!ENTITY % input.qname "input" >
-<!ENTITY % select.qname "select" >
-<!ENTITY % option.qname "option" >
-<!ENTITY % textarea.qname "textarea" >
-
-<!-- %BlkNoForm.mix; includes all non-form block elements,
- plus %Misc.class;
--->
-<!ENTITY % BlkNoForm.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- | %table.qname;
- %Block.extra;
- %Misc.class;"
->
-
-<!-- form: Form Element ................................ -->
-
-<!ENTITY % form.element "INCLUDE" >
-<![%form.element;[
-<!ENTITY % form.content
- "( %BlkNoForm.mix; )+"
->
-<!ELEMENT %form.qname; %form.content; >
-<!-- end of form.element -->]]>
-
-<!ENTITY % form.attlist "INCLUDE" >
-<![%form.attlist;[
-<!ATTLIST %form.qname;
- %Common.attrib;
- action %URI.datatype; #REQUIRED
- method ( get | post ) 'get'
- enctype %ContentType.datatype; 'application/x-www-form-urlencoded'
->
-<!-- end of form.attlist -->]]>
-
-<!-- label: Form Field Label Text ...................... -->
-
-<!ENTITY % label.element "INCLUDE" >
-<![%label.element;[
-<!-- Each label must not contain more than ONE field
--->
-<!ENTITY % label.content
- "( #PCDATA
- | %input.qname; | %select.qname; | %textarea.qname;
- | %InlStruct.class;
- %InlPhras.class;
- %I18n.class;
- %InlPres.class;
- %InlSpecial.class;
- %Misc.class; )*"
->
-<!ELEMENT %label.qname; %label.content; >
-<!-- end of label.element -->]]>
-
-<!ENTITY % label.attlist "INCLUDE" >
-<![%label.attlist;[
-<!ATTLIST %label.qname;
- %Common.attrib;
- for IDREF #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of label.attlist -->]]>
-
-<!-- input: Form Control ............................... -->
-
-<!ENTITY % input.element "INCLUDE" >
-<![%input.element;[
-<!ENTITY % input.content "EMPTY" >
-<!ELEMENT %input.qname; %input.content; >
-<!-- end of input.element -->]]>
-
-<!-- Basic Forms removes 'image' and 'file' input types.
--->
-<!ENTITY % input.attlist "INCLUDE" >
-<![%input.attlist;[
-<!ENTITY % InputType.class
- "( text | password | checkbox | radio
- | submit | reset | hidden )"
->
-<!-- attribute name required for all but submit & reset
--->
-<!ATTLIST %input.qname;
- %Common.attrib;
- type %InputType.class; 'text'
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked ( checked ) #IMPLIED
- size CDATA #IMPLIED
- maxlength %Number.datatype; #IMPLIED
- src %URI.datatype; #IMPLIED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of input.attlist -->]]>
-
-<!-- select: Option Selector ........................... -->
-
-<!ENTITY % select.element "INCLUDE" >
-<![%select.element;[
-<!ENTITY % select.content "( %option.qname; )+" >
-<!ELEMENT %select.qname; %select.content; >
-<!-- end of select.element -->]]>
-
-<!ENTITY % select.attlist "INCLUDE" >
-<![%select.attlist;[
-<!ATTLIST %select.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- size %Number.datatype; #IMPLIED
- multiple ( multiple ) #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of select.attlist -->]]>
-
-<!-- option: Selectable Choice ......................... -->
-
-<!ENTITY % option.element "INCLUDE" >
-<![%option.element;[
-<!ENTITY % option.content "( #PCDATA )" >
-<!ELEMENT %option.qname; %option.content; >
-<!-- end of option.element -->]]>
-
-<!ENTITY % option.attlist "INCLUDE" >
-<![%option.attlist;[
-<!ATTLIST %option.qname;
- %Common.attrib;
- selected ( selected ) #IMPLIED
- value CDATA #IMPLIED
->
-<!-- end of option.attlist -->]]>
-
-<!-- textarea: Multi-Line Text Field ................... -->
-
-<!ENTITY % textarea.element "INCLUDE" >
-<![%textarea.element;[
-<!ENTITY % textarea.content "( #PCDATA )" >
-<!ELEMENT %textarea.qname; %textarea.content; >
-<!-- end of textarea.element -->]]>
-
-<!ENTITY % textarea.attlist "INCLUDE" >
-<![%textarea.attlist;[
-<!ATTLIST %textarea.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- rows %Number.datatype; #REQUIRED
- cols %Number.datatype; #REQUIRED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of textarea.attlist -->]]>
-
-<!-- end of xhtml-basic-form-1.mod -->
-
-
-<!-- Link Element Module ........................................ -->
-<!ENTITY % xhtml-link.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Link Element Module ........................................... -->
-<!-- file: xhtml-link-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Link element
-
- link
-
- This module declares the link element type and its attributes,
- which could (in principle) be used to define document-level links
- to external resources such as:
-
- a) for document specific toolbars/menus, e.g. start, contents,
- previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by style sheets to control how collections of html nodes are
- rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel="alternate" media="print")
--->
-
-<!-- link: Media-Independent Link ...................... -->
-
-<!ENTITY % link.element "INCLUDE" >
-<![%link.element;[
-<!ENTITY % link.content "EMPTY" >
-<!ENTITY % link.qname "link" >
-<!ELEMENT %link.qname; %link.content; >
-<!-- end of link.element -->]]>
-
-<!ENTITY % link.attlist "INCLUDE" >
-<![%link.attlist;[
-<!ATTLIST %link.qname;
- %Common.attrib;
- charset %Charset.datatype; #IMPLIED
- href %URI.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- media %MediaDesc.datatype; #IMPLIED
->
-<!-- end of link.attlist -->]]>
-
-<!-- end of xhtml-link-1.mod -->
-
-
-<!-- Document Metainformation Module ............................ -->
-<!ENTITY % xhtml-meta.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Document Metainformation Module ............................... -->
-<!-- file: xhtml-meta-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Meta Information
-
- meta
-
- This module declares the meta element type and its attributes,
- used to provide declarative document metainformation.
--->
-
-<!-- meta: Generic Metainformation ..................... -->
-
-<!ENTITY % meta.element "INCLUDE" >
-<![%meta.element;[
-<!ENTITY % meta.content "EMPTY" >
-<!ENTITY % meta.qname "meta" >
-<!ELEMENT %meta.qname; %meta.content; >
-<!-- end of meta.element -->]]>
-
-<!ENTITY % meta.attlist "INCLUDE" >
-<![%meta.attlist;[
-<!ATTLIST %meta.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- http-equiv NMTOKEN #IMPLIED
- name NMTOKEN #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
->
-<!-- end of meta.attlist -->]]>
-
-<!-- end of xhtml-meta-1.mod -->
-
-
-<!-- Base Element Module ........................................ -->
-<!ENTITY % xhtml-base.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Base Element Module ........................................... -->
-<!-- file: xhtml-base-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Base element
-
- base
-
- This module declares the base element type and its attributes,
- used to define a base URI against which relative URIs in the
- document will be resolved.
-
- Note that this module also redeclares the content model for
- the head element to include the base element.
--->
-
-<!-- base: Document Base URI ........................... -->
-
-<!ENTITY % base.element "INCLUDE" >
-<![%base.element;[
-<!ENTITY % base.content "EMPTY" >
-<!ENTITY % base.qname "base" >
-<!ELEMENT %base.qname; %base.content; >
-<!-- end of base.element -->]]>
-
-<!ENTITY % base.attlist "INCLUDE" >
-<![%base.attlist;[
-<!ATTLIST %base.qname;
- %XHTML.xmlns.attrib;
- href %URI.datatype; #REQUIRED
->
-<!-- end of base.attlist -->]]>
-
-<!ENTITY % head.content
- "( %HeadOpts.mix;,
- ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
- | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
->
-
-<!-- end of xhtml-base-1.mod -->
-
-
-<!-- Stylesheets Module ......................................... -->
-<!ENTITY % xhtml-style.mod PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod">
-<!-- ...................................................................... -->
-<!-- XHTML Document Style Sheet Module ................................... -->
-<!-- file: xhtml-style-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Style Sheets
-
- style
-
- This module declares the style element type and its attributes,
- used to embed style sheet information in the document head element.
--->
-
-<!-- style: Style Sheet Information .................... -->
-
-<!ENTITY % style.element "INCLUDE" >
-<![%style.element;[
-<!ENTITY % style.content "( #PCDATA )" >
-<!ENTITY % style.qname "style" >
-<!ELEMENT %style.qname; %style.content; >
-<!-- end of style.element -->]]>
-
-<!ENTITY % style.attlist "INCLUDE" >
-<![%style.attlist;[
-<!ATTLIST %style.qname;
- %XHTML.xmlns.attrib;
- %title.attrib;
- %I18n.attrib;
- type %ContentType.datatype; #REQUIRED
- media %MediaDesc.datatype; #IMPLIED
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of style.attlist -->]]>
-
-<!-- end of xhtml-style-1.mod -->
-
-
-<!-- Param Element Module ....................................... -->
-<!ENTITY % xhtml-param.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Param Element Module ..................................... -->
-<!-- file: xhtml-param-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Parameters for Java Applets and Embedded Objects
-
- param
-
- This module provides declarations for the param element,
- used to provide named property values for the applet
- and object elements.
--->
-
-<!-- param: Named Property Value ....................... -->
-
-<!ENTITY % param.element "INCLUDE" >
-<![%param.element;[
-<!ENTITY % param.content "EMPTY" >
-<!ENTITY % param.qname "param" >
-<!ELEMENT %param.qname; %param.content; >
-<!-- end of param.element -->]]>
-
-<!ENTITY % param.attlist "INCLUDE" >
-<![%param.attlist;[
-<!ATTLIST %param.qname;
- %XHTML.xmlns.attrib;
- %id.attrib;
- name CDATA #REQUIRED
- value CDATA #IMPLIED
- valuetype ( data | ref | object ) 'data'
- type %ContentType.datatype; #IMPLIED
->
-<!-- end of param.attlist -->]]>
-
-<!-- end of xhtml-param-1.mod -->
-
-
-<!-- Embedded Object Module ..................................... -->
-<!ENTITY % xhtml-object.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Embedded Object Module ........................................ -->
-<!-- file: xhtml-object-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Embedded Objects
-
- object
-
- This module declares the object element type and its attributes, used
- to embed external objects as part of XHTML pages. In the document,
- place param elements prior to other content within the object element.
-
- Note that use of this module requires instantiation of the Param
- Element Module.
--->
-
-<!-- object: Generic Embedded Object ................... -->
-
-<!ENTITY % object.element "INCLUDE" >
-<![%object.element;[
-<!ENTITY % object.content
- "( #PCDATA | %Flow.mix; | %param.qname; )*"
->
-<!ENTITY % object.qname "object" >
-<!ELEMENT %object.qname; %object.content; >
-<!-- end of object.element -->]]>
-
-<!ENTITY % object.attlist "INCLUDE" >
-<![%object.attlist;[
-<!ATTLIST %object.qname;
- %Common.attrib;
- declare ( declare ) #IMPLIED
- classid %URI.datatype; #IMPLIED
- codebase %URI.datatype; #IMPLIED
- data %URI.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- codetype %ContentType.datatype; #IMPLIED
- archive %URIs.datatype; #IMPLIED
- standby %Text.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
- name CDATA #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of object.attlist -->]]>
-
-<!-- end of xhtml-object-1.mod -->
-
-
-<!-- Document Structure Module ..................................... -->
-<!ENTITY % xhtml-struct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Structure Module .............................................. -->
-<!-- file: xhtml-struct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Document Structure
-
- title, head, body, html
-
- The Structure Module defines the major structural elements and
- their attributes.
-
- Note that the content model of the head element type is redeclared
- when the Base Module is included in the DTD.
-
- The parameter entity containing the XML namespace URI value used
- for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
--->
-
-<!-- title: Document Title ............................. -->
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
--->
-
-<!ENTITY % title.element "INCLUDE" >
-<![%title.element;[
-<!ENTITY % title.content "( #PCDATA )" >
-<!ENTITY % title.qname "title" >
-<!ELEMENT %title.qname; %title.content; >
-<!-- end of title.element -->]]>
-
-<!ENTITY % title.attlist "INCLUDE" >
-<![%title.attlist;[
-<!ATTLIST %title.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
->
-<!-- end of title.attlist -->]]>
-
-<!-- head: Document Head ............................... -->
-
-<!ENTITY % head.element "INCLUDE" >
-<![%head.element;[
-<!ENTITY % head.content
- "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
->
-<!ENTITY % head.qname "head" >
-<!ELEMENT %head.qname; %head.content; >
-<!-- end of head.element -->]]>
-
-<!ENTITY % head.attlist "INCLUDE" >
-<![%head.attlist;[
-<!-- reserved for future use with document profiles
--->
-<!ENTITY % profile.attrib
- "profile %URI.datatype; '%XHTML.profile;'"
->
-
-<!ATTLIST %head.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- %profile.attrib;
->
-<!-- end of head.attlist -->]]>
-
-<!-- body: Document Body ............................... -->
-
-<!ENTITY % body.element "INCLUDE" >
-<![%body.element;[
-<!ENTITY % body.content
- "( %Block.mix; )+"
->
-<!ENTITY % body.qname "body" >
-<!ELEMENT %body.qname; %body.content; >
-<!-- end of body.element -->]]>
-
-<!ENTITY % body.attlist "INCLUDE" >
-<![%body.attlist;[
-<!ATTLIST %body.qname;
- %Common.attrib;
->
-<!-- end of body.attlist -->]]>
-
-<!-- html: XHTML Document Element ...................... -->
-
-<!ENTITY % html.element "INCLUDE" >
-<![%html.element;[
-<!ENTITY % html.content "( %head.qname;, %body.qname; )" >
-<!ENTITY % html.qname "html" >
-<!ELEMENT %html.qname; %html.content; >
-<!-- end of html.element -->]]>
-
-<!ENTITY % html.attlist "INCLUDE" >
-<![%html.attlist;[
-<!-- version attribute value defined in driver
--->
-<!ENTITY % XHTML.version.attrib
- "version %FPI.datatype; #FIXED '%XHTML.version;'"
->
-
-<!-- see the Qualified Names module for information
- on how to extend XHTML using XML namespaces
--->
-<!ATTLIST %html.qname;
- %XHTML.xmlns.attrib;
- %XHTML.version.attrib;
- %I18n.attrib;
->
-<!-- end of html.attlist -->]]>
-
-<!-- end of xhtml-struct-1.mod -->
-
-
-<!-- Block Presentation ........................................ -->
-<!ENTITY % xhtml-blkpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkpres-1.mod">
-<!-- ...................................................................... -->
-<!-- XHTML Block Presentation Module ..................................... -->
-<!-- file: xhtml-blkpres-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkpres-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Presentational Elements
-
- hr
-
- This module declares the elements and their attributes used to
- support block-level presentational markup.
--->
-
-<!ENTITY % hr.element "INCLUDE" >
-<![%hr.element;[
-<!ENTITY % hr.content "EMPTY" >
-<!ENTITY % hr.qname "hr" >
-<!ELEMENT %hr.qname; %hr.content; >
-<!-- end of hr.element -->]]>
-
-<!ENTITY % hr.attlist "INCLUDE" >
-<![%hr.attlist;[
-<!ATTLIST %hr.qname;
- %Common.attrib;
->
-<!-- end of hr.attlist -->]]>
-
-<!-- end of xhtml-blkpres-1.mod -->
-
-
-<!-- ========================================== -->
-<!--
- Inline Presentation: b, big, i, small
--->
-<!ENTITY % sub.element "IGNORE">
-<!ENTITY % sub.attlist "IGNORE">
-<!ENTITY % sup.element "IGNORE">
-<!ENTITY % sup.attlist "IGNORE">
-<!ENTITY % tt.element "IGNORE">
-<!ENTITY % tt.attlist "IGNORE">
-<!ENTITY % xhtml-inlpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlpres-1.mod">
-<!-- ...................................................................... -->
-<!-- XHTML Inline Presentation Module .................................... -->
-<!-- file: xhtml-inlpres-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml-mobile10-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlpres-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Presentational Elements
-
- b, big, i, small, sub, sup, tt
-
- This module declares the elements and their attributes used to
- support inline-level presentational markup.
--->
-
-<!ENTITY % b.element "INCLUDE" >
-<![%b.element;[
-<!ENTITY % b.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % b.qname "b" >
-<!ELEMENT %b.qname; %b.content; >
-<!-- end of b.element -->]]>
-
-<!ENTITY % b.attlist "INCLUDE" >
-<![%b.attlist;[
-<!ATTLIST %b.qname;
- %Common.attrib;
->
-<!-- end of b.attlist -->]]>
-
-<!ENTITY % big.element "INCLUDE" >
-<![%big.element;[
-<!ENTITY % big.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % big.qname "big" >
-<!ELEMENT %big.qname; %big.content; >
-<!-- end of big.element -->]]>
-
-<!ENTITY % big.attlist "INCLUDE" >
-<![%big.attlist;[
-<!ATTLIST %big.qname;
- %Common.attrib;
->
-<!-- end of big.attlist -->]]>
-
-<!ENTITY % i.element "INCLUDE" >
-<![%i.element;[
-<!ENTITY % i.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % i.qname "i" >
-<!ELEMENT %i.qname; %i.content; >
-<!-- end of i.element -->]]>
-
-<!ENTITY % i.attlist "INCLUDE" >
-<![%i.attlist;[
-<!ATTLIST %i.qname;
- %Common.attrib;
->
-<!-- end of i.attlist -->]]>
-
-<!ENTITY % small.element "INCLUDE" >
-<![%small.element;[
-<!ENTITY % small.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % small.qname "small" >
-<!ELEMENT %small.qname; %small.content; >
-<!-- end of small.element -->]]>
-
-<!ENTITY % small.attlist "INCLUDE" >
-<![%small.attlist;[
-<!ATTLIST %small.qname;
- %Common.attrib;
->
-<!-- end of small.attlist -->]]>
-
-<!ENTITY % sub.element "INCLUDE" >
-<![%sub.element;[
-<!ENTITY % sub.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % sub.qname "sub" >
-<!ELEMENT %sub.qname; %sub.content; >
-<!-- end of sub.element -->]]>
-
-<!ENTITY % sub.attlist "INCLUDE" >
-<![%sub.attlist;[
-<!ATTLIST %sub.qname;
- %Common.attrib;
->
-<!-- end of sub.attlist -->]]>
-
-<!ENTITY % sup.element "INCLUDE" >
-<![%sup.element;[
-<!ENTITY % sup.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % sup.qname "sup" >
-<!ELEMENT %sup.qname; %sup.content; >
-<!-- end of sup.element -->]]>
-
-<!ENTITY % sup.attlist "INCLUDE" >
-<![%sup.attlist;[
-<!ATTLIST %sup.qname;
- %Common.attrib;
->
-<!-- end of sup.attlist -->]]>
-
-<!ENTITY % tt.element "INCLUDE" >
-<![%tt.element;[
-<!ENTITY % tt.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % tt.qname "tt" >
-<!ELEMENT %tt.qname; %tt.content; >
-<!-- end of tt.element -->]]>
-
-<!ENTITY % tt.attlist "INCLUDE" >
-<![%tt.attlist;[
-<!ATTLIST %tt.qname;
- %Common.attrib;
->
-<!-- end of tt.attlist -->]]>
-
-<!-- end of xhtml-inlpres-1.mod -->
-
-
-<!-- end of XHTML Mobile 1.0 DTD ........................................... --> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-special.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-special.ent
deleted file mode 100644
index cf709d1d46..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-special.ent
+++ /dev/null
@@ -1,79 +0,0 @@
-<!-- Special characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
- %HTMLspecial;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY quot "&#34;"> <!-- quotation mark = APL quote,
- U+0022 ISOnum -->
-<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
-<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
-<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
-<!ENTITY apos "&#39;"> <!-- apostrophe mark, U+0027 ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
- U+0152 ISOlat2 -->
-<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
- U+0160 ISOlat2 -->
-<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
- U+0161 ISOlat2 -->
-<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
- U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
- U+02C6 ISOpub -->
-<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
-<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
-<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
- U+200C NEW RFC 2070 -->
-<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
-<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
- U+2018 ISOnum -->
-<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
- U+2019 ISOnum -->
-<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
- U+201C ISOnum -->
-<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
- U+201D ISOnum -->
-<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
-<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
-<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
- U+2039 ISO proposed -->
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
- U+203A ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-symbol.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-symbol.ent
deleted file mode 100644
index 16f876b251..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-symbol.ent
+++ /dev/null
@@ -1,242 +0,0 @@
-<!-- Mathematical, Greek and Symbolic characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
- %HTMLsymbol;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof "&#402;"> <!-- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
- U+0393 ISOgrk3 -->
-<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
- U+0394 ISOgrk3 -->
-<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
-<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
- U+0398 ISOgrk3 -->
-<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda "&#923;"> <!-- greek capital letter lambda,
- U+039B ISOgrk3 -->
-<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
-<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
-<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
-<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
- U+03A3 ISOgrk3 -->
-<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
- U+03A6 ISOgrk3 -->
-<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
- U+03A8 ISOgrk3 -->
-<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
- U+03A9 ISOgrk3 -->
-
-<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
- U+03B1 ISOgrk3 -->
-<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
- U+03B3 ISOgrk3 -->
-<!ENTITY delta "&#948;"> <!-- greek small letter delta,
- U+03B4 ISOgrk3 -->
-<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
- U+03B5 ISOgrk3 -->
-<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta "&#952;"> <!-- greek small letter theta,
- U+03B8 ISOgrk3 -->
-<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
- U+03BA ISOgrk3 -->
-<!ENTITY lambda "&#955;"> <!-- greek small letter lambda,
- U+03BB ISOgrk3 -->
-<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
- U+03C2 ISOgrk3 -->
-<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
- U+03C3 ISOgrk3 -->
-<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
- U+03C5 ISOgrk3 -->
-<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega "&#969;"> <!-- greek small letter omega,
- U+03C9 ISOgrk3 -->
-<!ENTITY thetasym "&#977;"> <!-- greek small letter theta symbol,
- U+03D1 NEW -->
-<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
- U+03D2 NEW -->
-<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
- U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
- U+2026 ISOpub -->
-<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
- U+2033 ISOtech -->
-<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
- U+203E NEW -->
-<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
- = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image "&#8465;"> <!-- blackletter capital I = imaginary part,
- U+2111 ISOamso -->
-<!ENTITY real "&#8476;"> <!-- blackletter capital R = real part symbol,
- U+211C ISOamso -->
-<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
- U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef,
- U+05D0 although the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
-<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
- U+21D2 ISOtech -->
-<!-- Unicode does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
- U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
-<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
-<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
-<!ENTITY empty "&#8709;"> <!-- empty set = null set = diameter,
- U+2205 ISOamso -->
-<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
- U+2207 ISOtech -->
-<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
-<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
-<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
- U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum "&#8721;"> <!-- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
- U+221A ISOtech -->
-<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
-<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
-<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
-<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
-<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
-<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
-<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
- U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
- U+2248 ISOamsr -->
-<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
-<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
- U+2265 ISOtech -->
-<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
-<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
- U+2287 ISOtech -->
-<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
- U+2295 ISOamsb -->
-<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
- U+2297 ISOamsb -->
-<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
- U+22A5 ISOtech -->
-<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil "&#8968;"> <!-- left ceiling = apl upstile,
- U+2308 ISOamsc -->
-<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor "&#8970;"> <!-- left floor = apl downstile,
- U+230A ISOamsc -->
-<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
-<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
- U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
- U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
- U+2663 ISOpub -->
-<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
- U+2665 ISOpub -->
-<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-frameset.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-frameset.dtd
deleted file mode 100644
index 5d3f79195d..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-frameset.dtd
+++ /dev/null
@@ -1,1225 +0,0 @@
-<!--
- Extensible HTML version 1.0 Frameset DTD
-
- This is the same as HTML 4.0 Frameset except for
- changes due to the differences between XML and SGML.
-
- Namespace = http://www.w3.org/1999/xhtml
-
- For further information, see: http://www.w3.org/TR/xhtml1
-
- Copyright (c) 1998-2000 W3C (MIT, INRIA, Keio),
- All Rights Reserved.
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
-
- $Revision: 1.1 $
- $Date: 2007/05/15 02:42:22 $
-
--->
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent">
-%HTMLspecial;
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA">
- <!-- media type, as per [RFC2045] -->
-
-<!ENTITY % ContentTypes "CDATA">
- <!-- comma-separated list of media types, as per [RFC2045] -->
-
-<!ENTITY % Charset "CDATA">
- <!-- a character encoding, as per [RFC2045] -->
-
-<!ENTITY % Charsets "CDATA">
- <!-- a space separated list of character encodings, as per [RFC2045] -->
-
-<!ENTITY % LanguageCode "NMTOKEN">
- <!-- a language code, as per [RFC1766] -->
-
-<!ENTITY % Character "CDATA">
- <!-- a single character from [ISO10646] -->
-
-<!ENTITY % Number "CDATA">
- <!-- one or more digits -->
-
-<!ENTITY % LinkTypes "CDATA">
- <!-- space-separated list of link types -->
-
-<!ENTITY % MediaDesc "CDATA">
- <!-- single or comma-separated list of media descriptors -->
-
-<!ENTITY % URI "CDATA">
- <!-- a Uniform Resource Identifier, see [RFC2396] -->
-
-<!ENTITY % UriList "CDATA">
- <!-- a space separated list of Uniform Resource Identifiers -->
-
-<!ENTITY % Datetime "CDATA">
- <!-- date and time information. ISO date format -->
-
-<!ENTITY % Script "CDATA">
- <!-- script expression -->
-
-<!ENTITY % StyleSheet "CDATA">
- <!-- style sheet data -->
-
-<!ENTITY % Text "CDATA">
- <!-- used for titles etc. -->
-
-<!ENTITY % FrameTarget "NMTOKEN">
- <!-- render in this frame -->
-
-<!ENTITY % Length "CDATA">
- <!-- nn for pixels or nn% for percentage length -->
-
-<!ENTITY % MultiLength "CDATA">
- <!-- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA">
- <!-- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA">
- <!-- integer representing length in pixels -->
-
-<!-- these are used for image maps -->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-
-<!ENTITY % Coords "CDATA">
- <!-- comma separated list of lengths -->
-
-<!-- used for object, applet, img, input and iframe -->
-<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
-
-<!-- a color using sRGB: #RRGGBB as Hex values -->
-<!ENTITY % Color "CDATA">
-
-<!-- There are also 16 widely known color names with their sRGB values:
-
- Black = #000000 Green = #008000
- Silver = #C0C0C0 Lime = #00FF00
- Gray = #808080 Olive = #808000
- White = #FFFFFF Yellow = #FFFF00
- Maroon = #800000 Navy = #000080
- Red = #FF0000 Blue = #0000FF
- Purple = #800080 Teal = #008080
- Fuchsia= #FF00FF Aqua = #00FFFF
--->
-
-<!--=================== Generic Attributes ===============================-->
-
-<!-- core attributes common to most elements
- id document-wide unique id
- class space separated list of classes
- style associated style info
- title advisory title/amplification
--->
-<!ENTITY % coreattrs
- "id ID #IMPLIED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED"
- >
-
-<!-- internationalization attributes
- lang language code (backwards compatible)
- xml:lang language code (as per XML 1.0 spec)
- dir direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #IMPLIED"
- >
-
-<!-- attributes for common UI events
- onclick a pointer button was clicked
- ondblclick a pointer button was double clicked
- onmousedown a pointer button was pressed down
- onmouseup a pointer button was released
- onmousemove a pointer was moved onto the element
- onmouseout a pointer was moved away from the element
- onkeypress a key was pressed and released
- onkeydown a key was pressed down
- onkeyup a key was released
--->
-<!ENTITY % events
- "onclick %Script; #IMPLIED
- ondblclick %Script; #IMPLIED
- onmousedown %Script; #IMPLIED
- onmouseup %Script; #IMPLIED
- onmouseover %Script; #IMPLIED
- onmousemove %Script; #IMPLIED
- onmouseout %Script; #IMPLIED
- onkeypress %Script; #IMPLIED
- onkeydown %Script; #IMPLIED
- onkeyup %Script; #IMPLIED"
- >
-
-<!-- attributes for elements that can get the focus
- accesskey accessibility key character
- tabindex position in tabbing order
- onfocus the element got the focus
- onblur the element lost the focus
--->
-<!ENTITY % focus
- "accesskey %Character; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED"
- >
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-<!-- text alignment for p, div, h1-h6. The default is
- align="left" for ltr headings, "right" for rtl -->
-
-<!ENTITY % TextAlign "align (left|center|right) #IMPLIED">
-
-<!--=================== Text Elements ====================================-->
-
-<!ENTITY % special
- "br | span | bdo |object | applet | img | map | iframe">
-
-<!ENTITY % fontstyle "tt | i | b | big | small | u
- | s | strike |font | basefont">
-
-<!ENTITY % phrase "em | strong | dfn | code | q | sub | sup |
- samp | kbd | var | cite | abbr | acronym">
-
-<!ENTITY % inline.forms "input | select | textarea | label | button">
-
-<!-- these can occur at block or inline level -->
-<!ENTITY % misc "ins | del | script | noscript">
-
-<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
-
-<!-- %Inline; covers inline or "text-level" elements -->
-<!ENTITY % Inline "(#PCDATA | %inline; | %misc;)*">
-
-<!--================== Block level elements ==============================-->
-
-<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
-<!ENTITY % lists "ul | ol | dl | menu | dir">
-<!ENTITY % blocktext "pre | hr | blockquote | address | center">
-
-<!ENTITY % block
- "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table">
-
-<!ENTITY % Block "(%block; | form | %misc;)*">
-
-<!-- %Flow; mixes Block and Inline and is used for list items etc. -->
-<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
-
-<!--================== Content models for exclusions =====================-->
-
-<!-- a elements use %Inline; excluding a -->
-
-<!ENTITY % a.content
- "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc;)*">
-
-<!-- pre uses %Inline excluding img, object, applet, big, small,
- sub, sup, font, or basefont -->
-
-<!ENTITY % pre.content
- "(#PCDATA | a | br | span | bdo | map | tt | i | b | u | s |
- %phrase; | %inline.forms;)*">
-
-<!-- form uses %Flow; excluding form -->
-
-<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
-
-<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
-
-<!ENTITY % button.content
- "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
- table | br | span | bdo | object | applet | img | map |
- %fontstyle; | %phrase; | %misc;)*">
-
-<!--================ Document Structure ==================================-->
-
-<!-- the namespace URI designates the document profile -->
-
-<!ELEMENT html (head, frameset)>
-<!ATTLIST html
- %i18n;
- xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
- >
-
-<!--================ Document Head =======================================-->
-
-<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
-
-<!-- content model is %head.misc; combined with a single
- title and an optional base element in any order -->
-
-<!ELEMENT head (%head.misc;,
- ((title, %head.misc;, (base, %head.misc;)?) |
- (base, %head.misc;, (title, %head.misc;))))>
-
-<!ATTLIST head
- %i18n;
- profile %URI; #IMPLIED
- >
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title %i18n;>
-
-<!-- document base URI -->
-
-<!ELEMENT base EMPTY>
-<!ATTLIST base
- href %URI; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!-- generic metainformation -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
- %i18n;
- http-equiv CDATA #IMPLIED
- name CDATA #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
- >
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the link element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a PostScript or PDF version (rel="alternate" media="print")
--->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
- %attrs;
- charset %Charset; #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- type %ContentType; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- media %MediaDesc; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!-- style info, which may include CDATA sections -->
-<!ELEMENT style (#PCDATA)>
-<!ATTLIST style
- %i18n;
- type %ContentType; #REQUIRED
- media %MediaDesc; #IMPLIED
- title %Text; #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- script statements, which may include CDATA sections -->
-<!ELEMENT script (#PCDATA)>
-<!ATTLIST script
- charset %Charset; #IMPLIED
- type %ContentType; #REQUIRED
- language CDATA #IMPLIED
- src %URI; #IMPLIED
- defer (defer) #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- alternate content container for non script-based rendering -->
-
-<!ELEMENT noscript %Flow;>
-<!ATTLIST noscript
- %attrs;
- >
-
-<!--======================= Frames =======================================-->
-
-<!-- only one noframes element permitted per document -->
-
-<!ELEMENT frameset (frameset|frame|noframes)*>
-<!ATTLIST frameset
- %coreattrs;
- rows %MultiLengths; #IMPLIED
- cols %MultiLengths; #IMPLIED
- onload %Script; #IMPLIED
- onunload %Script; #IMPLIED
- >
-
-<!-- reserved frame names start with "_" otherwise starts with letter -->
-
-<!-- tiled window within frameset -->
-
-<!ELEMENT frame EMPTY>
-<!ATTLIST frame
- %coreattrs;
- longdesc %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- src %URI; #IMPLIED
- frameborder (1|0) "1"
- marginwidth %Pixels; #IMPLIED
- marginheight %Pixels; #IMPLIED
- noresize (noresize) #IMPLIED
- scrolling (yes|no|auto) "auto"
- >
-
-<!-- inline subwindow -->
-
-<!ELEMENT iframe %Flow;>
-<!ATTLIST iframe
- %coreattrs;
- longdesc %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- src %URI; #IMPLIED
- frameborder (1|0) "1"
- marginwidth %Pixels; #IMPLIED
- marginheight %Pixels; #IMPLIED
- scrolling (yes|no|auto) "auto"
- align %ImgAlign; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!-- alternate content container for non frame-based rendering -->
-
-<!ELEMENT noframes (body)>
-<!ATTLIST noframes
- %attrs;
- >
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT body %Flow;>
-<!ATTLIST body
- %attrs;
- onload %Script; #IMPLIED
- onunload %Script; #IMPLIED
- background %URI; #IMPLIED
- bgcolor %Color; #IMPLIED
- text %Color; #IMPLIED
- link %Color; #IMPLIED
- vlink %Color; #IMPLIED
- alink %Color; #IMPLIED
- >
-
-<!ELEMENT div %Flow;> <!-- generic language/style container -->
-<!ATTLIST div
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT p %Inline;>
-<!ATTLIST p
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from h1 (the most important)
- to h6 (the least important).
--->
-
-<!ELEMENT h1 %Inline;>
-<!ATTLIST h1
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h2 %Inline;>
-<!ATTLIST h2
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h3 %Inline;>
-<!ATTLIST h3
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h4 %Inline;>
-<!ATTLIST h4
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h5 %Inline;>
-<!ATTLIST h5
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h6 %Inline;>
-<!ATTLIST h6
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- Unordered list bullet styles -->
-
-<!ENTITY % ULStyle "(disc|square|circle)">
-
-<!-- Unordered list -->
-
-<!ELEMENT ul (li)+>
-<!ATTLIST ul
- %attrs;
- type %ULStyle; #IMPLIED
- compact (compact) #IMPLIED
- >
-
-<!-- Ordered list numbering style
-
- 1 arabic numbers 1, 2, 3, ...
- a lower alpha a, b, c, ...
- A upper alpha A, B, C, ...
- i lower roman i, ii, iii, ...
- I upper roman I, II, III, ...
-
- The style is applied to the sequence number which by default
- is reset to 1 for the first list item in an ordered list.
--->
-<!ENTITY % OLStyle "CDATA">
-
-<!-- Ordered (numbered) list -->
-
-<!ELEMENT ol (li)+>
-<!ATTLIST ol
- %attrs;
- type %OLStyle; #IMPLIED
- compact (compact) #IMPLIED
- start %Number; #IMPLIED
- >
-
-<!-- single column list (DEPRECATED) -->
-<!ELEMENT menu (li)+>
-<!ATTLIST menu
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!-- multiple column list (DEPRECATED) -->
-<!ELEMENT dir (li)+>
-<!ATTLIST dir
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
-<!ENTITY % LIStyle "CDATA">
-
-<!-- list item -->
-
-<!ELEMENT li %Flow;>
-<!ATTLIST li
- %attrs;
- type %LIStyle; #IMPLIED
- value %Number; #IMPLIED
- >
-
-<!-- definition lists - dt for term, dd for its definition -->
-
-<!ELEMENT dl (dt|dd)+>
-<!ATTLIST dl
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!ELEMENT dt %Inline;>
-<!ATTLIST dt
- %attrs;
- >
-
-<!ELEMENT dd %Flow;>
-<!ATTLIST dd
- %attrs;
- >
-
-<!--=================== Address ==========================================-->
-
-<!-- information on author -->
-
-<!ELEMENT address %Inline;>
-<!ATTLIST address
- %attrs;
- >
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT hr EMPTY>
-<!ATTLIST hr
- %attrs;
- align (left|center|right) #IMPLIED
- noshade (noshade) #IMPLIED
- size %Pixels; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- content is %Inline; excluding
- "img|object|applet|big|small|sub|sup|font|basefont" -->
-
-<!ELEMENT pre %pre.content;>
-<!ATTLIST pre
- %attrs;
- width %Number; #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT blockquote %Flow;>
-<!ATTLIST blockquote
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!--=================== Text alignment ===================================-->
-
-<!-- center content -->
-<!ELEMENT center %Flow;>
-<!ATTLIST center
- %attrs;
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-
-<!--
- ins/del are allowed in block and inline content, but its
- inappropriate to include block content within an ins element
- occurring in inline content.
--->
-<!ELEMENT ins %Flow;>
-<!ATTLIST ins
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!ELEMENT del %Flow;>
-<!ATTLIST del
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!--================== The Anchor Element ================================-->
-
-<!-- content is %Inline; except that anchors shouldn't be nested -->
-
-<!ELEMENT a %a.content;>
-<!ATTLIST a
- %attrs;
- charset %Charset; #IMPLIED
- type %ContentType; #IMPLIED
- name NMTOKEN #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- accesskey %Character; #IMPLIED
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--===================== Inline Elements ================================-->
-
-<!ELEMENT span %Inline;> <!-- generic language/style container -->
-<!ATTLIST span
- %attrs;
- >
-
-<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
-<!ATTLIST bdo
- %coreattrs;
- %events;
- lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #REQUIRED
- >
-
-<!ELEMENT br EMPTY> <!-- forced line break -->
-<!ATTLIST br
- %coreattrs;
- clear (left|all|right|none) "none"
- >
-
-<!ELEMENT em %Inline;> <!-- emphasis -->
-<!ATTLIST em %attrs;>
-
-<!ELEMENT strong %Inline;> <!-- strong emphasis -->
-<!ATTLIST strong %attrs;>
-
-<!ELEMENT dfn %Inline;> <!-- definitional -->
-<!ATTLIST dfn %attrs;>
-
-<!ELEMENT code %Inline;> <!-- program code -->
-<!ATTLIST code %attrs;>
-
-<!ELEMENT samp %Inline;> <!-- sample -->
-<!ATTLIST samp %attrs;>
-
-<!ELEMENT kbd %Inline;> <!-- something user would type -->
-<!ATTLIST kbd %attrs;>
-
-<!ELEMENT var %Inline;> <!-- variable -->
-<!ATTLIST var %attrs;>
-
-<!ELEMENT cite %Inline;> <!-- citation -->
-<!ATTLIST cite %attrs;>
-
-<!ELEMENT abbr %Inline;> <!-- abbreviation -->
-<!ATTLIST abbr %attrs;>
-
-<!ELEMENT acronym %Inline;> <!-- acronym -->
-<!ATTLIST acronym %attrs;>
-
-<!ELEMENT q %Inline;> <!-- inlined quote -->
-<!ATTLIST q
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!ELEMENT sub %Inline;> <!-- subscript -->
-<!ATTLIST sub %attrs;>
-
-<!ELEMENT sup %Inline;> <!-- superscript -->
-<!ATTLIST sup %attrs;>
-
-<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
-<!ATTLIST tt %attrs;>
-
-<!ELEMENT i %Inline;> <!-- italic font -->
-<!ATTLIST i %attrs;>
-
-<!ELEMENT b %Inline;> <!-- bold font -->
-<!ATTLIST b %attrs;>
-
-<!ELEMENT big %Inline;> <!-- bigger font -->
-<!ATTLIST big %attrs;>
-
-<!ELEMENT small %Inline;> <!-- smaller font -->
-<!ATTLIST small %attrs;>
-
-<!ELEMENT u %Inline;> <!-- underline -->
-<!ATTLIST u %attrs;>
-
-<!ELEMENT s %Inline;> <!-- strike-through -->
-<!ATTLIST s %attrs;>
-
-<!ELEMENT strike %Inline;> <!-- strike-through -->
-<!ATTLIST strike %attrs;>
-
-<!ELEMENT basefont EMPTY> <!-- base font size -->
-<!ATTLIST basefont
- id ID #IMPLIED
- size CDATA #REQUIRED
- color %Color; #IMPLIED
- face CDATA #IMPLIED
- >
-
-<!ELEMENT font %Inline;> <!-- local change to font -->
-<!ATTLIST font
- %coreattrs;
- %i18n;
- size CDATA #IMPLIED
- color %Color; #IMPLIED
- face CDATA #IMPLIED
- >
-
-<!--==================== Object ======================================-->
-<!--
- object is used to embed objects as part of HTML pages.
- param elements should precede other content. Parameters
- can also be expressed as attribute/value pairs on the
- object element itself when brevity is desired.
--->
-
-<!ELEMENT object (#PCDATA | param | %block; | form |%inline; | %misc;)*>
-<!ATTLIST object
- %attrs;
- declare (declare) #IMPLIED
- classid %URI; #IMPLIED
- codebase %URI; #IMPLIED
- data %URI; #IMPLIED
- type %ContentType; #IMPLIED
- codetype %ContentType; #IMPLIED
- archive %UriList; #IMPLIED
- standby %Text; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- tabindex %Number; #IMPLIED
- align %ImgAlign; #IMPLIED
- border %Pixels; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!--
- param is used to supply a named property value.
- In XML it would seem natural to follow RDF and support an
- abbreviated syntax where the param elements are replaced
- by attribute value pairs on the object start tag.
--->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
- id ID #IMPLIED
- name CDATA #REQUIRED
- value CDATA #IMPLIED
- valuetype (data|ref|object) "data"
- type %ContentType; #IMPLIED
- >
-
-<!--=================== Java applet ==================================-->
-<!--
- One of code or object attributes must be present.
- Place param elements before other content.
--->
-<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
-<!ATTLIST applet
- %coreattrs;
- codebase %URI; #IMPLIED
- archive CDATA #IMPLIED
- code CDATA #IMPLIED
- object CDATA #IMPLIED
- alt %Text; #IMPLIED
- name NMTOKEN #IMPLIED
- width %Length; #REQUIRED
- height %Length; #REQUIRED
- align %ImgAlign; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!--=================== Images ===========================================-->
-
-<!--
- To avoid accessibility problems for people who aren't
- able to see the image, you should provide a text
- description using the alt and longdesc attributes.
- In addition, avoid the use of server-side image maps.
--->
-
-<!ELEMENT img EMPTY>
-<!ATTLIST img
- %attrs;
- src %URI; #REQUIRED
- alt %Text; #REQUIRED
- name NMTOKEN #IMPLIED
- longdesc %URI; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- ismap (ismap) #IMPLIED
- align %ImgAlign; #IMPLIED
- border %Pixels; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!-- usemap points to a map element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
-<!ATTLIST map
- %i18n;
- %events;
- id ID #REQUIRED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED
- name NMTOKEN #IMPLIED
- >
-
-<!ELEMENT area EMPTY>
-<!ATTLIST area
- %attrs;
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- href %URI; #IMPLIED
- nohref (nohref) #IMPLIED
- alt %Text; #REQUIRED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--================ Forms ===============================================-->
-
-<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
-
-<!ATTLIST form
- %attrs;
- action %URI; #REQUIRED
- method (get|post) "get"
- name NMTOKEN #IMPLIED
- enctype %ContentType; "application/x-www-form-urlencoded"
- onsubmit %Script; #IMPLIED
- onreset %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- accept-charset %Charsets; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--
- Each label must not contain more than ONE field
- Label elements shouldn't be nested.
--->
-<!ELEMENT label %Inline;>
-<!ATTLIST label
- %attrs;
- for IDREF #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!ENTITY % InputType
- "(text | password | checkbox |
- radio | submit | reset |
- file | hidden | image | button)"
- >
-
-<!-- the name attribute is required for all but submit & reset -->
-
-<!ELEMENT input EMPTY> <!-- form control -->
-<!ATTLIST input
- %attrs;
- type %InputType; "text"
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked (checked) #IMPLIED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- size CDATA #IMPLIED
- maxlength %Number; #IMPLIED
- src %URI; #IMPLIED
- alt CDATA #IMPLIED
- usemap %URI; #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- align %ImgAlign; #IMPLIED
- >
-
-<!ELEMENT select (optgroup|option)+> <!-- option selector -->
-<!ATTLIST select
- %attrs;
- name CDATA #IMPLIED
- size %Number; #IMPLIED
- multiple (multiple) #IMPLIED
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!ELEMENT optgroup (option)+> <!-- option group -->
-<!ATTLIST optgroup
- %attrs;
- disabled (disabled) #IMPLIED
- label %Text; #REQUIRED
- >
-
-<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
-<!ATTLIST option
- %attrs;
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED
- label %Text; #IMPLIED
- value CDATA #IMPLIED
- >
-
-<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
-<!ATTLIST textarea
- %attrs;
- name CDATA #IMPLIED
- rows %Number; #REQUIRED
- cols %Number; #REQUIRED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!--
- The fieldset element is used to group form fields.
- Only one legend element should occur in the content
- and if present should only be preceded by whitespace.
--->
-<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
-<!ATTLIST fieldset
- %attrs;
- >
-
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ELEMENT legend %Inline;> <!-- fieldset label -->
-<!ATTLIST legend
- %attrs;
- accesskey %Character; #IMPLIED
- align %LAlign; #IMPLIED
- >
-
-<!--
- Content is %Flow; excluding a, form, form controls, iframe
--->
-<!ELEMENT button %button.content;> <!-- push button -->
-<!ATTLIST button
- %attrs;
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- type (button|submit|reset) "submit"
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!-- single-line text input control (DEPRECATED) -->
-<!ELEMENT isindex EMPTY>
-<!ATTLIST isindex
- %coreattrs;
- %i18n;
- prompt %Text; #IMPLIED
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- Derived from IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The border attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The frame attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the valign attribute.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The rules attribute defines which rules to draw between cells:
-
- If rules is absent then assume:
- "none" if border is absent or border="0" otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents
-
- char alignment char, e.g. char=":"
- charoff offset for alignment char
--->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED
- charoff %Length; #IMPLIED"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT table
- (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
-<!ELEMENT caption %Inline;>
-<!ELEMENT thead (tr)+>
-<!ELEMENT tfoot (tr)+>
-<!ELEMENT tbody (tr)+>
-<!ELEMENT colgroup (col)*>
-<!ELEMENT col EMPTY>
-<!ELEMENT tr (th|td)+>
-<!ELEMENT th %Flow;>
-<!ELEMENT td %Flow;>
-
-<!ATTLIST table
- %attrs;
- summary %Text; #IMPLIED
- width %Length; #IMPLIED
- border %Pixels; #IMPLIED
- frame %TFrame; #IMPLIED
- rules %TRules; #IMPLIED
- cellspacing %Length; #IMPLIED
- cellpadding %Length; #IMPLIED
- align %TAlign; #IMPLIED
- bgcolor %Color; #IMPLIED
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST caption
- %attrs;
- align %CAlign; #IMPLIED
- >
-
-<!--
-colgroup groups a set of col elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST colgroup
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- col elements define the alignment properties for cells in
- one or more columns.
-
- The width attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The span attribute causes the attributes of one
- col element to apply to more than one column.
--->
-<!ATTLIST col
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- Use thead to duplicate headers when breaking table
- across page boundaries, or for static headers when
- tbody sections are rendered in scrolling panel.
-
- Use tfoot to duplicate footers when breaking table
- across page boundaries, or for static footers when
- tbody sections are rendered in scrolling panel.
-
- Use multiple tbody sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST thead
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tfoot
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tbody
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tr
- %attrs;
- %cellhalign;
- %cellvalign;
- bgcolor %Color; #IMPLIED
- >
-
-<!-- Scope is simpler than headers attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- th is for headers, td for data and for cells acting as both -->
-
-<!ATTLIST th
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- nowrap (nowrap) #IMPLIED
- bgcolor %Color; #IMPLIED
- width %Pixels; #IMPLIED
- height %Pixels; #IMPLIED
- >
-
-<!ATTLIST td
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- nowrap (nowrap) #IMPLIED
- bgcolor %Color; #IMPLIED
- width %Pixels; #IMPLIED
- height %Pixels; #IMPLIED
- >
-
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-strict.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-strict.dtd
deleted file mode 100644
index fdb11a0dd6..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-strict.dtd
+++ /dev/null
@@ -1,988 +0,0 @@
-<!--
- Extensible HTML version 1.0 Strict DTD
-
- This is the same as HTML 4.0 Strict except for
- changes due to the differences between XML and SGML.
-
- Namespace = http://www.w3.org/1999/xhtml
-
- For further information, see: http://www.w3.org/TR/xhtml1
-
- Copyright (c) 1998-2000 W3C (MIT, INRIA, Keio),
- All Rights Reserved.
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
-
- $Revision: 1.1 $
- $Date: 2007/05/15 02:42:22 $
-
--->
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent">
-%HTMLspecial;
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA">
- <!-- media type, as per [RFC2045] -->
-
-<!ENTITY % ContentTypes "CDATA">
- <!-- comma-separated list of media types, as per [RFC2045] -->
-
-<!ENTITY % Charset "CDATA">
- <!-- a character encoding, as per [RFC2045] -->
-
-<!ENTITY % Charsets "CDATA">
- <!-- a space separated list of character encodings, as per [RFC2045] -->
-
-<!ENTITY % LanguageCode "NMTOKEN">
- <!-- a language code, as per [RFC1766] -->
-
-<!ENTITY % Character "CDATA">
- <!-- a single character from [ISO10646] -->
-
-<!ENTITY % Number "CDATA">
- <!-- one or more digits -->
-
-<!ENTITY % LinkTypes "CDATA">
- <!-- space-separated list of link types -->
-
-<!ENTITY % MediaDesc "CDATA">
- <!-- single or comma-separated list of media descriptors -->
-
-<!ENTITY % URI "CDATA">
- <!-- a Uniform Resource Identifier, see [RFC2396] -->
-
-<!ENTITY % UriList "CDATA">
- <!-- a space separated list of Uniform Resource Identifiers -->
-
-<!ENTITY % Datetime "CDATA">
- <!-- date and time information. ISO date format -->
-
-<!ENTITY % Script "CDATA">
- <!-- script expression -->
-
-<!ENTITY % StyleSheet "CDATA">
- <!-- style sheet data -->
-
-<!ENTITY % Text "CDATA">
- <!-- used for titles etc. -->
-
-<!ENTITY % FrameTarget "NMTOKEN">
- <!-- render in this frame -->
-
-<!ENTITY % Length "CDATA">
- <!-- nn for pixels or nn% for percentage length -->
-
-<!ENTITY % MultiLength "CDATA">
- <!-- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA">
- <!-- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA">
- <!-- integer representing length in pixels -->
-
-<!-- these are used for image maps -->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-
-<!ENTITY % Coords "CDATA">
- <!-- comma separated list of lengths -->
-
-<!--=================== Generic Attributes ===============================-->
-
-<!-- core attributes common to most elements
- id document-wide unique id
- class space separated list of classes
- style associated style info
- title advisory title/amplification
--->
-<!ENTITY % coreattrs
- "id ID #IMPLIED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED"
- >
-
-<!-- internationalization attributes
- lang language code (backwards compatible)
- xml:lang language code (as per XML 1.0 spec)
- dir direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #IMPLIED"
- >
-
-<!-- attributes for common UI events
- onclick a pointer button was clicked
- ondblclick a pointer button was double clicked
- onmousedown a pointer button was pressed down
- onmouseup a pointer button was released
- onmousemove a pointer was moved onto the element
- onmouseout a pointer was moved away from the element
- onkeypress a key was pressed and released
- onkeydown a key was pressed down
- onkeyup a key was released
--->
-<!ENTITY % events
- "onclick %Script; #IMPLIED
- ondblclick %Script; #IMPLIED
- onmousedown %Script; #IMPLIED
- onmouseup %Script; #IMPLIED
- onmouseover %Script; #IMPLIED
- onmousemove %Script; #IMPLIED
- onmouseout %Script; #IMPLIED
- onkeypress %Script; #IMPLIED
- onkeydown %Script; #IMPLIED
- onkeyup %Script; #IMPLIED"
- >
-
-<!-- attributes for elements that can get the focus
- accesskey accessibility key character
- tabindex position in tabbing order
- onfocus the element got the focus
- onblur the element lost the focus
--->
-<!ENTITY % focus
- "accesskey %Character; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED"
- >
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-<!--=================== Text Elements ====================================-->
-
-<!ENTITY % special
- "br | span | bdo | object | img | map">
-
-<!ENTITY % fontstyle "tt | i | b | big | small">
-
-<!ENTITY % phrase "em | strong | dfn | code | q | sub | sup |
- samp | kbd | var | cite | abbr | acronym">
-
-<!ENTITY % inline.forms "input | select | textarea | label | button">
-
-<!-- these can occur at block or inline level -->
-<!ENTITY % misc "ins | del | script | noscript">
-
-<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
-
-<!-- %Inline; covers inline or "text-level" elements -->
-<!ENTITY % Inline "(#PCDATA | %inline; | %misc;)*">
-
-<!--================== Block level elements ==============================-->
-
-<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
-<!ENTITY % lists "ul | ol | dl">
-<!ENTITY % blocktext "pre | hr | blockquote | address">
-
-<!ENTITY % block
- "p | %heading; | div | %lists; | %blocktext; | fieldset | table">
-
-<!ENTITY % Block "(%block; | form | %misc;)*">
-
-<!-- %Flow; mixes Block and Inline and is used for list items etc. -->
-<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
-
-<!--================== Content models for exclusions =====================-->
-
-<!-- a elements use %Inline; excluding a -->
-
-<!ENTITY % a.content
- "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc;)*">
-
-<!-- pre uses %Inline excluding img, object, big, small, sup or sup -->
-
-<!ENTITY % pre.content
- "(#PCDATA | a | br | span | bdo | map | tt | i | b |
- %phrase; | %inline.forms;)*">
-
-<!-- form uses %Block; excluding form -->
-
-<!ENTITY % form.content "(%block; | %misc;)*">
-
-<!-- button uses %Flow; but excludes a, form and form controls -->
-
-<!ENTITY % button.content
- "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
- table | %special; | %fontstyle; | %phrase; | %misc;)*">
-
-<!--================ Document Structure ==================================-->
-
-<!-- the namespace URI designates the document profile -->
-
-<!ELEMENT html (head, body)>
-<!ATTLIST html
- %i18n;
- xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
- >
-
-<!--================ Document Head =======================================-->
-
-<!ENTITY % head.misc "(script|style|meta|link|object)*">
-
-<!-- content model is %head.misc; combined with a single
- title and an optional base element in any order -->
-
-<!ELEMENT head (%head.misc;,
- ((title, %head.misc;, (base, %head.misc;)?) |
- (base, %head.misc;, (title, %head.misc;))))>
-
-<!ATTLIST head
- %i18n;
- profile %URI; #IMPLIED
- >
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title %i18n;>
-
-<!-- document base URI -->
-
-<!ELEMENT base EMPTY>
-<!ATTLIST base
- href %URI; #IMPLIED
- >
-
-<!-- generic metainformation -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
- %i18n;
- http-equiv CDATA #IMPLIED
- name CDATA #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
- >
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the link element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a PostScript or PDF version (rel="alternate" media="print")
--->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
- %attrs;
- charset %Charset; #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- type %ContentType; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- media %MediaDesc; #IMPLIED
- >
-
-<!-- style info, which may include CDATA sections -->
-<!ELEMENT style (#PCDATA)>
-<!ATTLIST style
- %i18n;
- type %ContentType; #REQUIRED
- media %MediaDesc; #IMPLIED
- title %Text; #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- script statements, which may include CDATA sections -->
-<!ELEMENT script (#PCDATA)>
-<!ATTLIST script
- charset %Charset; #IMPLIED
- type %ContentType; #REQUIRED
- src %URI; #IMPLIED
- defer (defer) #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- alternate content container for non script-based rendering -->
-
-<!ELEMENT noscript %Block;>
-<!ATTLIST noscript
- %attrs;
- >
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT body %Block;>
-<!ATTLIST body
- %attrs;
- onload %Script; #IMPLIED
- onunload %Script; #IMPLIED
- >
-
-<!ELEMENT div %Flow;> <!-- generic language/style container -->
-<!ATTLIST div
- %attrs;
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT p %Inline;>
-<!ATTLIST p
- %attrs;
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from h1 (the most important)
- to h6 (the least important).
--->
-
-<!ELEMENT h1 %Inline;>
-<!ATTLIST h1
- %attrs;
- >
-
-<!ELEMENT h2 %Inline;>
-<!ATTLIST h2
- %attrs;
- >
-
-<!ELEMENT h3 %Inline;>
-<!ATTLIST h3
- %attrs;
- >
-
-<!ELEMENT h4 %Inline;>
-<!ATTLIST h4
- %attrs;
- >
-
-<!ELEMENT h5 %Inline;>
-<!ATTLIST h5
- %attrs;
- >
-
-<!ELEMENT h6 %Inline;>
-<!ATTLIST h6
- %attrs;
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- Unordered list -->
-
-<!ELEMENT ul (li)+>
-<!ATTLIST ul
- %attrs;
- >
-
-<!-- Ordered (numbered) list -->
-
-<!ELEMENT ol (li)+>
-<!ATTLIST ol
- %attrs;
- >
-
-<!-- list item -->
-
-<!ELEMENT li %Flow;>
-<!ATTLIST li
- %attrs;
- >
-
-<!-- definition lists - dt for term, dd for its definition -->
-
-<!ELEMENT dl (dt|dd)+>
-<!ATTLIST dl
- %attrs;
- >
-
-<!ELEMENT dt %Inline;>
-<!ATTLIST dt
- %attrs;
- >
-
-<!ELEMENT dd %Flow;>
-<!ATTLIST dd
- %attrs;
- >
-
-<!--=================== Address ==========================================-->
-
-<!-- information on author -->
-
-<!ELEMENT address %Inline;>
-<!ATTLIST address
- %attrs;
- >
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT hr EMPTY>
-<!ATTLIST hr
- %attrs;
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->
-
-<!ELEMENT pre %pre.content;>
-<!ATTLIST pre
- %attrs;
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT blockquote %Block;>
-<!ATTLIST blockquote
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-<!--
- ins/del are allowed in block and inline content, but its
- inappropriate to include block content within an ins element
- occurring in inline content.
--->
-<!ELEMENT ins %Flow;>
-<!ATTLIST ins
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!ELEMENT del %Flow;>
-<!ATTLIST del
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!--================== The Anchor Element ================================-->
-
-<!-- content is %Inline; except that anchors shouldn't be nested -->
-
-<!ELEMENT a %a.content;>
-<!ATTLIST a
- %attrs;
- charset %Charset; #IMPLIED
- type %ContentType; #IMPLIED
- name NMTOKEN #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- accesskey %Character; #IMPLIED
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!--===================== Inline Elements ================================-->
-
-<!ELEMENT span %Inline;> <!-- generic language/style container -->
-<!ATTLIST span
- %attrs;
- >
-
-<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
-<!ATTLIST bdo
- %coreattrs;
- %events;
- lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #REQUIRED
- >
-
-<!ELEMENT br EMPTY> <!-- forced line break -->
-<!ATTLIST br
- %coreattrs;
- >
-
-<!ELEMENT em %Inline;> <!-- emphasis -->
-<!ATTLIST em %attrs;>
-
-<!ELEMENT strong %Inline;> <!-- strong emphasis -->
-<!ATTLIST strong %attrs;>
-
-<!ELEMENT dfn %Inline;> <!-- definitional -->
-<!ATTLIST dfn %attrs;>
-
-<!ELEMENT code %Inline;> <!-- program code -->
-<!ATTLIST code %attrs;>
-
-<!ELEMENT samp %Inline;> <!-- sample -->
-<!ATTLIST samp %attrs;>
-
-<!ELEMENT kbd %Inline;> <!-- something user would type -->
-<!ATTLIST kbd %attrs;>
-
-<!ELEMENT var %Inline;> <!-- variable -->
-<!ATTLIST var %attrs;>
-
-<!ELEMENT cite %Inline;> <!-- citation -->
-<!ATTLIST cite %attrs;>
-
-<!ELEMENT abbr %Inline;> <!-- abbreviation -->
-<!ATTLIST abbr %attrs;>
-
-<!ELEMENT acronym %Inline;> <!-- acronym -->
-<!ATTLIST acronym %attrs;>
-
-<!ELEMENT q %Inline;> <!-- inlined quote -->
-<!ATTLIST q
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!ELEMENT sub %Inline;> <!-- subscript -->
-<!ATTLIST sub %attrs;>
-
-<!ELEMENT sup %Inline;> <!-- superscript -->
-<!ATTLIST sup %attrs;>
-
-<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
-<!ATTLIST tt %attrs;>
-
-<!ELEMENT i %Inline;> <!-- italic font -->
-<!ATTLIST i %attrs;>
-
-<!ELEMENT b %Inline;> <!-- bold font -->
-<!ATTLIST b %attrs;>
-
-<!ELEMENT big %Inline;> <!-- bigger font -->
-<!ATTLIST big %attrs;>
-
-<!ELEMENT small %Inline;> <!-- smaller font -->
-<!ATTLIST small %attrs;>
-
-<!--==================== Object ======================================-->
-<!--
- object is used to embed objects as part of HTML pages.
- param elements should precede other content. Parameters
- can also be expressed as attribute/value pairs on the
- object element itself when brevity is desired.
--->
-
-<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
-<!ATTLIST object
- %attrs;
- declare (declare) #IMPLIED
- classid %URI; #IMPLIED
- codebase %URI; #IMPLIED
- data %URI; #IMPLIED
- type %ContentType; #IMPLIED
- codetype %ContentType; #IMPLIED
- archive %UriList; #IMPLIED
- standby %Text; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- tabindex %Number; #IMPLIED
- >
-
-<!--
- param is used to supply a named property value.
- In XML it would seem natural to follow RDF and support an
- abbreviated syntax where the param elements are replaced
- by attribute value pairs on the object start tag.
--->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
- id ID #IMPLIED
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- valuetype (data|ref|object) "data"
- type %ContentType; #IMPLIED
- >
-
-<!--=================== Images ===========================================-->
-
-<!--
- To avoid accessibility problems for people who aren't
- able to see the image, you should provide a text
- description using the alt and longdesc attributes.
- In addition, avoid the use of server-side image maps.
- Note that in this DTD there is no name attribute. That
- is only available in the transitional and frameset DTD.
--->
-
-<!ELEMENT img EMPTY>
-<!ATTLIST img
- %attrs;
- src %URI; #REQUIRED
- alt %Text; #REQUIRED
- longdesc %URI; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- ismap (ismap) #IMPLIED
- >
-
-<!-- usemap points to a map element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
-<!ATTLIST map
- %i18n;
- %events;
- id ID #REQUIRED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED
- name NMTOKEN #IMPLIED
- >
-
-<!ELEMENT area EMPTY>
-<!ATTLIST area
- %attrs;
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- href %URI; #IMPLIED
- nohref (nohref) #IMPLIED
- alt %Text; #REQUIRED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!--================ Forms ===============================================-->
-<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
-
-<!ATTLIST form
- %attrs;
- action %URI; #REQUIRED
- method (get|post) "get"
- enctype %ContentType; "application/x-www-form-urlencoded"
- onsubmit %Script; #IMPLIED
- onreset %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- accept-charset %Charsets; #IMPLIED
- >
-
-<!--
- Each label must not contain more than ONE field
- Label elements shouldn't be nested.
--->
-<!ELEMENT label %Inline;>
-<!ATTLIST label
- %attrs;
- for IDREF #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!ENTITY % InputType
- "(text | password | checkbox |
- radio | submit | reset |
- file | hidden | image | button)"
- >
-
-<!-- the name attribute is required for all but submit & reset -->
-
-<!ELEMENT input EMPTY> <!-- form control -->
-<!ATTLIST input
- %attrs;
- type %InputType; "text"
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked (checked) #IMPLIED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- size CDATA #IMPLIED
- maxlength %Number; #IMPLIED
- src %URI; #IMPLIED
- alt CDATA #IMPLIED
- usemap %URI; #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- >
-
-<!ELEMENT select (optgroup|option)+> <!-- option selector -->
-<!ATTLIST select
- %attrs;
- name CDATA #IMPLIED
- size %Number; #IMPLIED
- multiple (multiple) #IMPLIED
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!ELEMENT optgroup (option)+> <!-- option group -->
-<!ATTLIST optgroup
- %attrs;
- disabled (disabled) #IMPLIED
- label %Text; #REQUIRED
- >
-
-<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
-<!ATTLIST option
- %attrs;
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED
- label %Text; #IMPLIED
- value CDATA #IMPLIED
- >
-
-<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
-<!ATTLIST textarea
- %attrs;
- name CDATA #IMPLIED
- rows %Number; #REQUIRED
- cols %Number; #REQUIRED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!--
- The fieldset element is used to group form fields.
- Only one legend element should occur in the content
- and if present should only be preceded by whitespace.
--->
-<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
-<!ATTLIST fieldset
- %attrs;
- >
-
-<!ELEMENT legend %Inline;> <!-- fieldset label -->
-<!ATTLIST legend
- %attrs;
- accesskey %Character; #IMPLIED
- >
-
-<!--
- Content is %Flow; excluding a, form and form controls
--->
-<!ELEMENT button %button.content;> <!-- push button -->
-<!ATTLIST button
- %attrs;
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- type (button|submit|reset) "submit"
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- Derived from IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The border attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The frame attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the valign attribute.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The rules attribute defines which rules to draw between cells:
-
- If rules is absent then assume:
- "none" if border is absent or border="0" otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents
-
- char alignment char, e.g. char=':'
- charoff offset for alignment char
--->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED
- charoff %Length; #IMPLIED"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT table
- (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
-<!ELEMENT caption %Inline;>
-<!ELEMENT thead (tr)+>
-<!ELEMENT tfoot (tr)+>
-<!ELEMENT tbody (tr)+>
-<!ELEMENT colgroup (col)*>
-<!ELEMENT col EMPTY>
-<!ELEMENT tr (th|td)+>
-<!ELEMENT th %Flow;>
-<!ELEMENT td %Flow;>
-
-<!ATTLIST table
- %attrs;
- summary %Text; #IMPLIED
- width %Length; #IMPLIED
- border %Pixels; #IMPLIED
- frame %TFrame; #IMPLIED
- rules %TRules; #IMPLIED
- cellspacing %Length; #IMPLIED
- cellpadding %Length; #IMPLIED
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST caption
- %attrs;
- >
-
-<!--
-colgroup groups a set of col elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST colgroup
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- col elements define the alignment properties for cells in
- one or more columns.
-
- The width attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The span attribute causes the attributes of one
- col element to apply to more than one column.
--->
-<!ATTLIST col
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- Use thead to duplicate headers when breaking table
- across page boundaries, or for static headers when
- tbody sections are rendered in scrolling panel.
-
- Use tfoot to duplicate footers when breaking table
- across page boundaries, or for static footers when
- tbody sections are rendered in scrolling panel.
-
- Use multiple tbody sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST thead
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tfoot
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tbody
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tr
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-
-<!-- Scope is simpler than headers attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- th is for headers, td for data and for cells acting as both -->
-
-<!ATTLIST th
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST td
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- >
-
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-transitional.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-transitional.dtd
deleted file mode 100644
index 1fc9ee2a55..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-transitional.dtd
+++ /dev/null
@@ -1,1196 +0,0 @@
-<!--
- Extensible HTML version 1.0 Transitional DTD
-
- This is the same as HTML 4.0 Transitional except for
- changes due to the differences between XML and SGML.
-
- Namespace = http://www.w3.org/1999/xhtml
-
- For further information, see: http://www.w3.org/TR/xhtml1
-
- Copyright (c) 1998-2000 W3C (MIT, INRIA, Keio),
- All Rights Reserved.
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
-
- $Revision: 1.1 $
- $Date: 2007/05/15 02:42:22 $
-
--->
-
-<!--================ Character mnemonic entities =========================-->
-
-<!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent">
-%HTMLlat1;
-
-<!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent">
-%HTMLsymbol;
-
-<!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent">
-%HTMLspecial;
-
-<!--================== Imported Names ====================================-->
-
-<!ENTITY % ContentType "CDATA">
- <!-- media type, as per [RFC2045] -->
-
-<!ENTITY % ContentTypes "CDATA">
- <!-- comma-separated list of media types, as per [RFC2045] -->
-
-<!ENTITY % Charset "CDATA">
- <!-- a character encoding, as per [RFC2045] -->
-
-<!ENTITY % Charsets "CDATA">
- <!-- a space separated list of character encodings, as per [RFC2045] -->
-
-<!ENTITY % LanguageCode "NMTOKEN">
- <!-- a language code, as per [RFC1766] -->
-
-<!ENTITY % Character "CDATA">
- <!-- a single character from [ISO10646] -->
-
-<!ENTITY % Number "CDATA">
- <!-- one or more digits -->
-
-<!ENTITY % LinkTypes "CDATA">
- <!-- space-separated list of link types -->
-
-<!ENTITY % MediaDesc "CDATA">
- <!-- single or comma-separated list of media descriptors -->
-
-<!ENTITY % URI "CDATA">
- <!-- a Uniform Resource Identifier, see [RFC2396] -->
-
-<!ENTITY % UriList "CDATA">
- <!-- a space separated list of Uniform Resource Identifiers -->
-
-<!ENTITY % Datetime "CDATA">
- <!-- date and time information. ISO date format -->
-
-<!ENTITY % Script "CDATA">
- <!-- script expression -->
-
-<!ENTITY % StyleSheet "CDATA">
- <!-- style sheet data -->
-
-<!ENTITY % Text "CDATA">
- <!-- used for titles etc. -->
-
-<!ENTITY % FrameTarget "NMTOKEN">
- <!-- render in this frame -->
-
-<!ENTITY % Length "CDATA">
- <!-- nn for pixels or nn% for percentage length -->
-
-<!ENTITY % MultiLength "CDATA">
- <!-- pixel, percentage, or relative -->
-
-<!ENTITY % MultiLengths "CDATA">
- <!-- comma-separated list of MultiLength -->
-
-<!ENTITY % Pixels "CDATA">
- <!-- integer representing length in pixels -->
-
-<!-- these are used for image maps -->
-
-<!ENTITY % Shape "(rect|circle|poly|default)">
-
-<!ENTITY % Coords "CDATA">
- <!-- comma separated list of lengths -->
-
-<!-- used for object, applet, img, input and iframe -->
-<!ENTITY % ImgAlign "(top|middle|bottom|left|right)">
-
-<!-- a color using sRGB: #RRGGBB as Hex values -->
-<!ENTITY % Color "CDATA">
-
-<!-- There are also 16 widely known color names with their sRGB values:
-
- Black = #000000 Green = #008000
- Silver = #C0C0C0 Lime = #00FF00
- Gray = #808080 Olive = #808000
- White = #FFFFFF Yellow = #FFFF00
- Maroon = #800000 Navy = #000080
- Red = #FF0000 Blue = #0000FF
- Purple = #800080 Teal = #008080
- Fuchsia= #FF00FF Aqua = #00FFFF
--->
-
-<!--=================== Generic Attributes ===============================-->
-
-<!-- core attributes common to most elements
- id document-wide unique id
- class space separated list of classes
- style associated style info
- title advisory title/amplification
--->
-<!ENTITY % coreattrs
- "id ID #IMPLIED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED"
- >
-
-<!-- internationalization attributes
- lang language code (backwards compatible)
- xml:lang language code (as per XML 1.0 spec)
- dir direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #IMPLIED"
- >
-
-<!-- attributes for common UI events
- onclick a pointer button was clicked
- ondblclick a pointer button was double clicked
- onmousedown a pointer button was pressed down
- onmouseup a pointer button was released
- onmousemove a pointer was moved onto the element
- onmouseout a pointer was moved away from the element
- onkeypress a key was pressed and released
- onkeydown a key was pressed down
- onkeyup a key was released
--->
-<!ENTITY % events
- "onclick %Script; #IMPLIED
- ondblclick %Script; #IMPLIED
- onmousedown %Script; #IMPLIED
- onmouseup %Script; #IMPLIED
- onmouseover %Script; #IMPLIED
- onmousemove %Script; #IMPLIED
- onmouseout %Script; #IMPLIED
- onkeypress %Script; #IMPLIED
- onkeydown %Script; #IMPLIED
- onkeyup %Script; #IMPLIED"
- >
-
-<!-- attributes for elements that can get the focus
- accesskey accessibility key character
- tabindex position in tabbing order
- onfocus the element got the focus
- onblur the element lost the focus
--->
-<!ENTITY % focus
- "accesskey %Character; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED"
- >
-
-<!ENTITY % attrs "%coreattrs; %i18n; %events;">
-
-<!-- text alignment for p, div, h1-h6. The default is
- align="left" for ltr headings, "right" for rtl -->
-
-<!ENTITY % TextAlign "align (left|center|right) #IMPLIED">
-
-<!--=================== Text Elements ====================================-->
-
-<!ENTITY % special
- "br | span | bdo | object | applet | img | map | iframe">
-
-<!ENTITY % fontstyle "tt | i | b | big | small | u
- | s | strike |font | basefont">
-
-<!ENTITY % phrase "em | strong | dfn | code | q | sub | sup |
- samp | kbd | var | cite | abbr | acronym">
-
-<!ENTITY % inline.forms "input | select | textarea | label | button">
-
-<!-- these can occur at block or inline level -->
-<!ENTITY % misc "ins | del | script | noscript">
-
-<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
-
-<!-- %Inline; covers inline or "text-level" elements -->
-<!ENTITY % Inline "(#PCDATA | %inline; | %misc;)*">
-
-<!--================== Block level elements ==============================-->
-
-<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
-<!ENTITY % lists "ul | ol | dl | menu | dir">
-<!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes">
-
-<!ENTITY % block
- "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">
-
-<!ENTITY % Block "(%block; | form | %misc;)*">
-
-<!-- %Flow; mixes Block and Inline and is used for list items etc. -->
-<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
-
-<!--================== Content models for exclusions =====================-->
-
-<!-- a elements use %Inline; excluding a -->
-
-<!ENTITY % a.content
- "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc;)*">
-
-<!-- pre uses %Inline excluding img, object, applet, big, small,
- sub, sup, font, or basefont -->
-
-<!ENTITY % pre.content
- "(#PCDATA | a | br | span | bdo | map | tt | i | b | u | s |
- %phrase; | %inline.forms;)*">
-
-<!-- form uses %Flow; excluding form -->
-
-<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*">
-
-<!-- button uses %Flow; but excludes a, form, form controls, iframe -->
-
-<!ENTITY % button.content
- "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
- table | br | span | bdo | object | applet | img | map |
- %fontstyle; | %phrase; | %misc;)*">
-
-<!--================ Document Structure ==================================-->
-
-<!-- the namespace URI designates the document profile -->
-
-<!ELEMENT html (head, body)>
-<!ATTLIST html
- %i18n;
- xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
- >
-
-<!--================ Document Head =======================================-->
-
-<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
-
-<!-- content model is %head.misc; combined with a single
- title and an optional base element in any order -->
-
-<!ELEMENT head (%head.misc;,
- ((title, %head.misc;, (base, %head.misc;)?) |
- (base, %head.misc;, (title, %head.misc;))))>
-
-<!ATTLIST head
- %i18n;
- profile %URI; #IMPLIED
- >
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
- -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title %i18n;>
-
-<!-- document base URI -->
-
-<!ELEMENT base EMPTY>
-<!ATTLIST base
- href %URI; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!-- generic metainformation -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
- %i18n;
- http-equiv CDATA #IMPLIED
- name CDATA #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
- >
-
-<!--
- Relationship values can be used in principle:
-
- a) for document specific toolbars/menus when used
- with the link element in document head e.g.
- start, contents, previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by stylesheets to control how collections of
- html nodes are rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a PostScript or PDF version (rel="alternate" media="print")
--->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
- %attrs;
- charset %Charset; #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- type %ContentType; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- media %MediaDesc; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!-- style info, which may include CDATA sections -->
-<!ELEMENT style (#PCDATA)>
-<!ATTLIST style
- %i18n;
- type %ContentType; #REQUIRED
- media %MediaDesc; #IMPLIED
- title %Text; #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- script statements, which may include CDATA sections -->
-<!ELEMENT script (#PCDATA)>
-<!ATTLIST script
- charset %Charset; #IMPLIED
- type %ContentType; #REQUIRED
- language CDATA #IMPLIED
- src %URI; #IMPLIED
- defer (defer) #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!-- alternate content container for non script-based rendering -->
-
-<!ELEMENT noscript %Flow;>
-<!ATTLIST noscript
- %attrs;
- >
-
-<!--======================= Frames =======================================-->
-
-<!-- inline subwindow -->
-
-<!ELEMENT iframe %Flow;>
-<!ATTLIST iframe
- %coreattrs;
- longdesc %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- src %URI; #IMPLIED
- frameborder (1|0) "1"
- marginwidth %Pixels; #IMPLIED
- marginheight %Pixels; #IMPLIED
- scrolling (yes|no|auto) "auto"
- align %ImgAlign; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!-- alternate content container for non frame-based rendering -->
-
-<!ELEMENT noframes %Flow;>
-<!ATTLIST noframes
- %attrs;
- >
-
-<!--=================== Document Body ====================================-->
-
-<!ELEMENT body %Flow;>
-<!ATTLIST body
- %attrs;
- onload %Script; #IMPLIED
- onunload %Script; #IMPLIED
- background %URI; #IMPLIED
- bgcolor %Color; #IMPLIED
- text %Color; #IMPLIED
- link %Color; #IMPLIED
- vlink %Color; #IMPLIED
- alink %Color; #IMPLIED
- >
-
-<!ELEMENT div %Flow;> <!-- generic language/style container -->
-<!ATTLIST div
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Paragraphs =======================================-->
-
-<!ELEMENT p %Inline;>
-<!ATTLIST p
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Headings =========================================-->
-
-<!--
- There are six levels of headings from h1 (the most important)
- to h6 (the least important).
--->
-
-<!ELEMENT h1 %Inline;>
-<!ATTLIST h1
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h2 %Inline;>
-<!ATTLIST h2
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h3 %Inline;>
-<!ATTLIST h3
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h4 %Inline;>
-<!ATTLIST h4
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h5 %Inline;>
-<!ATTLIST h5
- %attrs;
- %TextAlign;
- >
-
-<!ELEMENT h6 %Inline;>
-<!ATTLIST h6
- %attrs;
- %TextAlign;
- >
-
-<!--=================== Lists ============================================-->
-
-<!-- Unordered list bullet styles -->
-
-<!ENTITY % ULStyle "(disc|square|circle)">
-
-<!-- Unordered list -->
-
-<!ELEMENT ul (li)+>
-<!ATTLIST ul
- %attrs;
- type %ULStyle; #IMPLIED
- compact (compact) #IMPLIED
- >
-
-<!-- Ordered list numbering style
-
- 1 arabic numbers 1, 2, 3, ...
- a lower alpha a, b, c, ...
- A upper alpha A, B, C, ...
- i lower roman i, ii, iii, ...
- I upper roman I, II, III, ...
-
- The style is applied to the sequence number which by default
- is reset to 1 for the first list item in an ordered list.
--->
-<!ENTITY % OLStyle "CDATA">
-
-<!-- Ordered (numbered) list -->
-
-<!ELEMENT ol (li)+>
-<!ATTLIST ol
- %attrs;
- type %OLStyle; #IMPLIED
- compact (compact) #IMPLIED
- start %Number; #IMPLIED
- >
-
-<!-- single column list (DEPRECATED) -->
-<!ELEMENT menu (li)+>
-<!ATTLIST menu
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!-- multiple column list (DEPRECATED) -->
-<!ELEMENT dir (li)+>
-<!ATTLIST dir
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" -->
-<!ENTITY % LIStyle "CDATA">
-
-<!-- list item -->
-
-<!ELEMENT li %Flow;>
-<!ATTLIST li
- %attrs;
- type %LIStyle; #IMPLIED
- value %Number; #IMPLIED
- >
-
-<!-- definition lists - dt for term, dd for its definition -->
-
-<!ELEMENT dl (dt|dd)+>
-<!ATTLIST dl
- %attrs;
- compact (compact) #IMPLIED
- >
-
-<!ELEMENT dt %Inline;>
-<!ATTLIST dt
- %attrs;
- >
-
-<!ELEMENT dd %Flow;>
-<!ATTLIST dd
- %attrs;
- >
-
-<!--=================== Address ==========================================-->
-
-<!-- information on author -->
-
-<!ELEMENT address %Inline;>
-<!ATTLIST address
- %attrs;
- >
-
-<!--=================== Horizontal Rule ==================================-->
-
-<!ELEMENT hr EMPTY>
-<!ATTLIST hr
- %attrs;
- align (left|center|right) #IMPLIED
- noshade (noshade) #IMPLIED
- size %Pixels; #IMPLIED
- width %Length; #IMPLIED
- >
-
-<!--=================== Preformatted Text ================================-->
-
-<!-- content is %Inline; excluding
- "img|object|applet|big|small|sub|sup|font|basefont" -->
-
-<!ELEMENT pre %pre.content;>
-<!ATTLIST pre
- %attrs;
- width %Number; #IMPLIED
- xml:space (preserve) #FIXED 'preserve'
- >
-
-<!--=================== Block-like Quotes ================================-->
-
-<!ELEMENT blockquote %Flow;>
-<!ATTLIST blockquote
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!--=================== Text alignment ===================================-->
-
-<!-- center content -->
-<!ELEMENT center %Flow;>
-<!ATTLIST center
- %attrs;
- >
-
-<!--=================== Inserted/Deleted Text ============================-->
-
-<!--
- ins/del are allowed in block and inline content, but its
- inappropriate to include block content within an ins element
- occurring in inline content.
--->
-<!ELEMENT ins %Flow;>
-<!ATTLIST ins
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!ELEMENT del %Flow;>
-<!ATTLIST del
- %attrs;
- cite %URI; #IMPLIED
- datetime %Datetime; #IMPLIED
- >
-
-<!--================== The Anchor Element ================================-->
-
-<!-- content is %Inline; except that anchors shouldn't be nested -->
-
-<!ELEMENT a %a.content;>
-<!ATTLIST a
- %attrs;
- charset %Charset; #IMPLIED
- type %ContentType; #IMPLIED
- name NMTOKEN #IMPLIED
- href %URI; #IMPLIED
- hreflang %LanguageCode; #IMPLIED
- rel %LinkTypes; #IMPLIED
- rev %LinkTypes; #IMPLIED
- accesskey %Character; #IMPLIED
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--===================== Inline Elements ================================-->
-
-<!ELEMENT span %Inline;> <!-- generic language/style container -->
-<!ATTLIST span
- %attrs;
- >
-
-<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
-<!ATTLIST bdo
- %coreattrs;
- %events;
- lang %LanguageCode; #IMPLIED
- xml:lang %LanguageCode; #IMPLIED
- dir (ltr|rtl) #REQUIRED
- >
-
-<!ELEMENT br EMPTY> <!-- forced line break -->
-<!ATTLIST br
- %coreattrs;
- clear (left|all|right|none) "none"
- >
-
-<!ELEMENT em %Inline;> <!-- emphasis -->
-<!ATTLIST em %attrs;>
-
-<!ELEMENT strong %Inline;> <!-- strong emphasis -->
-<!ATTLIST strong %attrs;>
-
-<!ELEMENT dfn %Inline;> <!-- definitional -->
-<!ATTLIST dfn %attrs;>
-
-<!ELEMENT code %Inline;> <!-- program code -->
-<!ATTLIST code %attrs;>
-
-<!ELEMENT samp %Inline;> <!-- sample -->
-<!ATTLIST samp %attrs;>
-
-<!ELEMENT kbd %Inline;> <!-- something user would type -->
-<!ATTLIST kbd %attrs;>
-
-<!ELEMENT var %Inline;> <!-- variable -->
-<!ATTLIST var %attrs;>
-
-<!ELEMENT cite %Inline;> <!-- citation -->
-<!ATTLIST cite %attrs;>
-
-<!ELEMENT abbr %Inline;> <!-- abbreviation -->
-<!ATTLIST abbr %attrs;>
-
-<!ELEMENT acronym %Inline;> <!-- acronym -->
-<!ATTLIST acronym %attrs;>
-
-<!ELEMENT q %Inline;> <!-- inlined quote -->
-<!ATTLIST q
- %attrs;
- cite %URI; #IMPLIED
- >
-
-<!ELEMENT sub %Inline;> <!-- subscript -->
-<!ATTLIST sub %attrs;>
-
-<!ELEMENT sup %Inline;> <!-- superscript -->
-<!ATTLIST sup %attrs;>
-
-<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
-<!ATTLIST tt %attrs;>
-
-<!ELEMENT i %Inline;> <!-- italic font -->
-<!ATTLIST i %attrs;>
-
-<!ELEMENT b %Inline;> <!-- bold font -->
-<!ATTLIST b %attrs;>
-
-<!ELEMENT big %Inline;> <!-- bigger font -->
-<!ATTLIST big %attrs;>
-
-<!ELEMENT small %Inline;> <!-- smaller font -->
-<!ATTLIST small %attrs;>
-
-<!ELEMENT u %Inline;> <!-- underline -->
-<!ATTLIST u %attrs;>
-
-<!ELEMENT s %Inline;> <!-- strike-through -->
-<!ATTLIST s %attrs;>
-
-<!ELEMENT strike %Inline;> <!-- strike-through -->
-<!ATTLIST strike %attrs;>
-
-<!ELEMENT basefont EMPTY> <!-- base font size -->
-<!ATTLIST basefont
- id ID #IMPLIED
- size CDATA #REQUIRED
- color %Color; #IMPLIED
- face CDATA #IMPLIED
- >
-
-<!ELEMENT font %Inline;> <!-- local change to font -->
-<!ATTLIST font
- %coreattrs;
- %i18n;
- size CDATA #IMPLIED
- color %Color; #IMPLIED
- face CDATA #IMPLIED
- >
-
-<!--==================== Object ======================================-->
-<!--
- object is used to embed objects as part of HTML pages.
- param elements should precede other content. Parameters
- can also be expressed as attribute/value pairs on the
- object element itself when brevity is desired.
--->
-
-<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
-<!ATTLIST object
- %attrs;
- declare (declare) #IMPLIED
- classid %URI; #IMPLIED
- codebase %URI; #IMPLIED
- data %URI; #IMPLIED
- type %ContentType; #IMPLIED
- codetype %ContentType; #IMPLIED
- archive %UriList; #IMPLIED
- standby %Text; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- name NMTOKEN #IMPLIED
- tabindex %Number; #IMPLIED
- align %ImgAlign; #IMPLIED
- border %Pixels; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!--
- param is used to supply a named property value.
- In XML it would seem natural to follow RDF and support an
- abbreviated syntax where the param elements are replaced
- by attribute value pairs on the object start tag.
--->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
- id ID #IMPLIED
- name CDATA #REQUIRED
- value CDATA #IMPLIED
- valuetype (data|ref|object) "data"
- type %ContentType; #IMPLIED
- >
-
-<!--=================== Java applet ==================================-->
-<!--
- One of code or object attributes must be present.
- Place param elements before other content.
--->
-<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*>
-<!ATTLIST applet
- %coreattrs;
- codebase %URI; #IMPLIED
- archive CDATA #IMPLIED
- code CDATA #IMPLIED
- object CDATA #IMPLIED
- alt %Text; #IMPLIED
- name NMTOKEN #IMPLIED
- width %Length; #REQUIRED
- height %Length; #REQUIRED
- align %ImgAlign; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!--=================== Images ===========================================-->
-
-<!--
- To avoid accessibility problems for people who aren't
- able to see the image, you should provide a text
- description using the alt and longdesc attributes.
- In addition, avoid the use of server-side image maps.
--->
-
-<!ELEMENT img EMPTY>
-<!ATTLIST img
- %attrs;
- src %URI; #REQUIRED
- alt %Text; #REQUIRED
- name NMTOKEN #IMPLIED
- longdesc %URI; #IMPLIED
- height %Length; #IMPLIED
- width %Length; #IMPLIED
- usemap %URI; #IMPLIED
- ismap (ismap) #IMPLIED
- align %ImgAlign; #IMPLIED
- border %Length; #IMPLIED
- hspace %Pixels; #IMPLIED
- vspace %Pixels; #IMPLIED
- >
-
-<!-- usemap points to a map element which may be in this document
- or an external document, although the latter is not widely supported -->
-
-<!--================== Client-side image maps ============================-->
-
-<!-- These can be placed in the same document or grouped in a
- separate document although this isn't yet widely supported -->
-
-<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
-<!ATTLIST map
- %i18n;
- %events;
- id ID #REQUIRED
- class CDATA #IMPLIED
- style %StyleSheet; #IMPLIED
- title %Text; #IMPLIED
- name CDATA #IMPLIED
- >
-
-<!ELEMENT area EMPTY>
-<!ATTLIST area
- %attrs;
- shape %Shape; "rect"
- coords %Coords; #IMPLIED
- href %URI; #IMPLIED
- nohref (nohref) #IMPLIED
- alt %Text; #REQUIRED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--================ Forms ===============================================-->
-
-<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
-
-<!ATTLIST form
- %attrs;
- action %URI; #REQUIRED
- method (get|post) "get"
- name NMTOKEN #IMPLIED
- enctype %ContentType; "application/x-www-form-urlencoded"
- onsubmit %Script; #IMPLIED
- onreset %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- accept-charset %Charsets; #IMPLIED
- target %FrameTarget; #IMPLIED
- >
-
-<!--
- Each label must not contain more than ONE field
- Label elements shouldn't be nested.
--->
-<!ELEMENT label %Inline;>
-<!ATTLIST label
- %attrs;
- for IDREF #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!ENTITY % InputType
- "(text | password | checkbox |
- radio | submit | reset |
- file | hidden | image | button)"
- >
-
-<!-- the name attribute is required for all but submit & reset -->
-
-<!ELEMENT input EMPTY> <!-- form control -->
-<!ATTLIST input
- %attrs;
- type %InputType; "text"
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked (checked) #IMPLIED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- size CDATA #IMPLIED
- maxlength %Number; #IMPLIED
- src %URI; #IMPLIED
- alt CDATA #IMPLIED
- usemap %URI; #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- accept %ContentTypes; #IMPLIED
- align %ImgAlign; #IMPLIED
- >
-
-<!ELEMENT select (optgroup|option)+> <!-- option selector -->
-<!ATTLIST select
- %attrs;
- name CDATA #IMPLIED
- size %Number; #IMPLIED
- multiple (multiple) #IMPLIED
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!ELEMENT optgroup (option)+> <!-- option group -->
-<!ATTLIST optgroup
- %attrs;
- disabled (disabled) #IMPLIED
- label %Text; #REQUIRED
- >
-
-<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
-<!ATTLIST option
- %attrs;
- selected (selected) #IMPLIED
- disabled (disabled) #IMPLIED
- label %Text; #IMPLIED
- value CDATA #IMPLIED
- >
-
-<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
-<!ATTLIST textarea
- %attrs;
- name CDATA #IMPLIED
- rows %Number; #REQUIRED
- cols %Number; #REQUIRED
- disabled (disabled) #IMPLIED
- readonly (readonly) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- onselect %Script; #IMPLIED
- onchange %Script; #IMPLIED
- >
-
-<!--
- The fieldset element is used to group form fields.
- Only one legend element should occur in the content
- and if present should only be preceded by whitespace.
--->
-<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
-<!ATTLIST fieldset
- %attrs;
- >
-
-<!ENTITY % LAlign "(top|bottom|left|right)">
-
-<!ELEMENT legend %Inline;> <!-- fieldset label -->
-<!ATTLIST legend
- %attrs;
- accesskey %Character; #IMPLIED
- align %LAlign; #IMPLIED
- >
-
-<!--
- Content is %Flow; excluding a, form, form controls, iframe
--->
-<!ELEMENT button %button.content;> <!-- push button -->
-<!ATTLIST button
- %attrs;
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- type (button|submit|reset) "submit"
- disabled (disabled) #IMPLIED
- tabindex %Number; #IMPLIED
- accesskey %Character; #IMPLIED
- onfocus %Script; #IMPLIED
- onblur %Script; #IMPLIED
- >
-
-<!-- single-line text input control (DEPRECATED) -->
-<!ELEMENT isindex EMPTY>
-<!ATTLIST isindex
- %coreattrs;
- %i18n;
- prompt %Text; #IMPLIED
- >
-
-<!--======================= Tables =======================================-->
-
-<!-- Derived from IETF HTML table standard, see [RFC1942] -->
-
-<!--
- The border attribute sets the thickness of the frame around the
- table. The default units are screen pixels.
-
- The frame attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the valign attribute.
--->
-<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
-
-<!--
- The rules attribute defines which rules to draw between cells:
-
- If rules is absent then assume:
- "none" if border is absent or border="0" otherwise "all"
--->
-
-<!ENTITY % TRules "(none | groups | rows | cols | all)">
-
-<!-- horizontal placement of table relative to document -->
-<!ENTITY % TAlign "(left|center|right)">
-
-<!-- horizontal alignment attributes for cell contents
-
- char alignment char, e.g. char=':'
- charoff offset for alignment char
--->
-<!ENTITY % cellhalign
- "align (left|center|right|justify|char) #IMPLIED
- char %Character; #IMPLIED
- charoff %Length; #IMPLIED"
- >
-
-<!-- vertical alignment attributes for cell contents -->
-<!ENTITY % cellvalign
- "valign (top|middle|bottom|baseline) #IMPLIED"
- >
-
-<!ELEMENT table
- (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
-<!ELEMENT caption %Inline;>
-<!ELEMENT thead (tr)+>
-<!ELEMENT tfoot (tr)+>
-<!ELEMENT tbody (tr)+>
-<!ELEMENT colgroup (col)*>
-<!ELEMENT col EMPTY>
-<!ELEMENT tr (th|td)+>
-<!ELEMENT th %Flow;>
-<!ELEMENT td %Flow;>
-
-<!ATTLIST table
- %attrs;
- summary %Text; #IMPLIED
- width %Length; #IMPLIED
- border %Pixels; #IMPLIED
- frame %TFrame; #IMPLIED
- rules %TRules; #IMPLIED
- cellspacing %Length; #IMPLIED
- cellpadding %Length; #IMPLIED
- align %TAlign; #IMPLIED
- bgcolor %Color; #IMPLIED
- >
-
-<!ENTITY % CAlign "(top|bottom|left|right)">
-
-<!ATTLIST caption
- %attrs;
- align %CAlign; #IMPLIED
- >
-
-<!--
-colgroup groups a set of col elements. It allows you to group
-several semantically related columns together.
--->
-<!ATTLIST colgroup
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- col elements define the alignment properties for cells in
- one or more columns.
-
- The width attribute specifies the width of the columns, e.g.
-
- width=64 width in screen pixels
- width=0.5* relative width of 0.5
-
- The span attribute causes the attributes of one
- col element to apply to more than one column.
--->
-<!ATTLIST col
- %attrs;
- span %Number; "1"
- width %MultiLength; #IMPLIED
- %cellhalign;
- %cellvalign;
- >
-
-<!--
- Use thead to duplicate headers when breaking table
- across page boundaries, or for static headers when
- tbody sections are rendered in scrolling panel.
-
- Use tfoot to duplicate footers when breaking table
- across page boundaries, or for static footers when
- tbody sections are rendered in scrolling panel.
-
- Use multiple tbody sections when rules are needed
- between groups of table rows.
--->
-<!ATTLIST thead
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tfoot
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tbody
- %attrs;
- %cellhalign;
- %cellvalign;
- >
-
-<!ATTLIST tr
- %attrs;
- %cellhalign;
- %cellvalign;
- bgcolor %Color; #IMPLIED
- >
-
-<!-- Scope is simpler than headers attribute for common tables -->
-<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
-
-<!-- th is for headers, td for data and for cells acting as both -->
-
-<!ATTLIST th
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- nowrap (nowrap) #IMPLIED
- bgcolor %Color; #IMPLIED
- width %Pixels; #IMPLIED
- height %Pixels; #IMPLIED
- >
-
-<!ATTLIST td
- %attrs;
- abbr %Text; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- scope %Scope; #IMPLIED
- rowspan %Number; "1"
- colspan %Number; "1"
- %cellhalign;
- %cellvalign;
- nowrap (nowrap) #IMPLIED
- bgcolor %Color; #IMPLIED
- width %Pixels; #IMPLIED
- height %Pixels; #IMPLIED
- >
-
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml11-flat.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml11-flat.dtd
deleted file mode 100644
index 33a8517175..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/dtds/xhtml11-flat.dtd
+++ /dev/null
@@ -1,4513 +0,0 @@
-<!-- ....................................................................... -->
-<!-- XHTML 1.1 DTD ........................................................ -->
-<!-- file: xhtml11.dtd
--->
-
-<!-- XHTML 1.1 DTD
-
- This is XHTML, a reformulation of HTML as a modular XML application.
-
- The Extensible HyperText Markup Language (XHTML)
- Copyright 1998-2000 World Wide Web Consortium
- (Massachusetts Institute of Technology, Institut National de
- Recherche en Informatique et en Automatique, Keio University).
- All Rights Reserved.
-
- Permission to use, copy, modify and distribute the XHTML DTD and its
- accompanying documentation for any purpose and without fee is hereby
- granted in perpetuity, provided that the above copyright notice and
- this paragraph appear in all copies. The copyright holders make no
- representation about the suitability of the DTD for any purpose.
-
- It is provided "as is" without expressed or implied warranty.
-
- Author: Murray M. Altheim <altheim@eng.sun.com>
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
--->
-<!-- This is the driver file for version 1.1 of the XHTML DTD.
-
- Please use this formal public identifier to identify it:
-
- "-//W3C//DTD XHTML 1.1//EN"
--->
-<!ENTITY % XHTML.version "-//W3C//DTD XHTML 1.1//EN" >
-
-<!-- Use this URI to identify the default namespace:
-
- "http://www.w3.org/1999/xhtml"
-
- See the Qualified Names module for information
- on the use of namespace prefixes in the DTD.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefix "" >
-
-<!-- Reserved for use with the XLink namespace:
--->
-<!ENTITY % XLINK.xmlns "" >
-<!ENTITY % XLINK.xmlns.attrib "" >
-
-<!-- For example, if you are using XHTML 1.1 directly, use the FPI
- in the DOCTYPE declaration, with the xmlns attribute on the
- document element to identify the default namespace:
-
- <?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en">
- ...
- </html>
-
- Revisions:
- (none)
--->
-
-<!-- reserved for future use with document profiles -->
-<!ENTITY % XHTML.profile "" >
-
-<!-- Bidirectional Text features
- This feature-test entity is used to declare elements
- and attributes used for bidirectional text support.
--->
-<!ENTITY % XHTML.bidi "INCLUDE" >
-
-<?doc type="doctype" role="title" { XHTML 1.1 } ?>
-
-<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
-
-<!-- Pre-Framework Redeclaration placeholder .................... -->
-<!-- this serves as a location to insert markup declarations
- into the DTD prior to the framework declarations.
--->
-<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >
-<![%xhtml-prefw-redecl.module;[
-%xhtml-prefw-redecl.mod;
-<!-- end of xhtml-prefw-redecl.module -->]]>
-
-<!ENTITY % xhtml-events.module "INCLUDE" >
-
-<!-- Inline Style Module ........................................ -->
-<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
-<![%xhtml-inlstyle.module;[
-<!ENTITY % xhtml-inlstyle.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Style Module ........................................... -->
-<!-- file: xhtml-inlstyle-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Style
-
- This module declares the 'style' attribute, used to support inline
- style markup. This module must be instantiated prior to the XHTML
- Common Attributes module in order to be included in %Core.attrib;.
--->
-
-<!ENTITY % style.attrib
- "style CDATA #IMPLIED"
->
-
-
-<!ENTITY % Core.extra.attrib
- "%style.attrib;"
->
-
-<!-- end of xhtml-inlstyle-1.mod -->
-]]>
-
-<!-- declare Document Model module instantiated in framework
--->
-<!ENTITY % xhtml-model.mod
- PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
- "xhtml11-model-1.mod" >
-
-<!-- Modular Framework Module (required) ......................... -->
-<!ENTITY % xhtml-framework.module "INCLUDE" >
-<![%xhtml-framework.module;[
-<!ENTITY % xhtml-framework.mod
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Modular Framework Module ...................................... -->
-<!-- file: xhtml-framework-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Modular Framework
-
- This required module instantiates the modules needed
- to support the XHTML modularization model, including:
-
- + notations
- + datatypes
- + namespace-qualified names
- + common attributes
- + document model
- + character entities
-
- The Intrinsic Events module is ignored by default but
- occurs in this module because it must be instantiated
- prior to Attributes but after Datatypes.
--->
-
-<!ENTITY % xhtml-arch.module "IGNORE" >
-<![%xhtml-arch.module;[
-<!ENTITY % xhtml-arch.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
- "xhtml-arch-1.mod" >
-%xhtml-arch.mod;]]>
-
-<!ENTITY % xhtml-notations.module "INCLUDE" >
-<![%xhtml-notations.module;[
-<!ENTITY % xhtml-notations.mod
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- "xhtml-notations-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Notations Module .............................................. -->
-<!-- file: xhtml-notations-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-notations-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Notations
-
- defines the following notations, many of these imported from
- other specifications and standards. When an existing FPI is
- known, it is incorporated here.
--->
-
-<!-- XML Notations ..................................... -->
-<!-- SGML and XML Notations ............................ -->
-
-<!-- W3C XML 1.0 Recommendation -->
-<!NOTATION w3c-xml
- PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN" >
-
-<!-- XML 1.0 CDATA -->
-<!NOTATION cdata
- PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN" >
-
-<!-- SGML Formal Public Identifiers -->
-<!NOTATION fpi
- PUBLIC "ISO 8879:1986//NOTATION Formal Public Identifier//EN" >
-
-<!-- XHTML Notations ................................... -->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!NOTATION length
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN" >
-
-<!-- space-separated list of link types -->
-<!NOTATION linkTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!NOTATION mediaDesc
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN" >
-
-<!-- pixel, percentage, or relative -->
-<!NOTATION multiLength
- PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN" >
-
-<!-- one or more digits (NUMBER) -->
-<!NOTATION number
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN" >
-
-<!-- integer representing length in pixels -->
-<!NOTATION pixels
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN" >
-
-<!-- script expression -->
-<!NOTATION script
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Script//EN" >
-
-<!-- textual content -->
-<!NOTATION text
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN" >
-
-<!-- Imported Notations ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!NOTATION character
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Character//EN" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!NOTATION charset
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charset//EN" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!NOTATION charsets
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Charsets//EN" >
-
-<!-- media type, as per [RFC2045] -->
-<!NOTATION contentType
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!NOTATION contentTypes
- PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentTypes//EN" >
-
-<!-- date and time information. ISO date format -->
-<!NOTATION datetime
- PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN" >
-
-<!-- a language code, as per [RFC3066] -->
-<!NOTATION languageCode
- PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!NOTATION uri
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!NOTATION uris
- PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN" >
-
-<!-- end of xhtml-notations-1.mod -->
-]]>
-
-<!ENTITY % xhtml-datatypes.module "INCLUDE" >
-<![%xhtml-datatypes.module;[
-<!ENTITY % xhtml-datatypes.mod
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- "xhtml-datatypes-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Datatypes Module .............................................. -->
-<!-- file: xhtml-datatypes-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-datatypes-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Datatypes
-
- defines containers for the following datatypes, many of
- these imported from other specifications and standards.
--->
-
-<!-- Length defined for cellpadding/cellspacing -->
-
-<!-- nn for pixels or nn% for percentage length -->
-<!ENTITY % Length.datatype "CDATA" >
-
-<!-- space-separated list of link types -->
-<!ENTITY % LinkTypes.datatype "NMTOKENS" >
-
-<!-- single or comma-separated list of media descriptors -->
-<!ENTITY % MediaDesc.datatype "CDATA" >
-
-<!-- pixel, percentage, or relative -->
-<!ENTITY % MultiLength.datatype "CDATA" >
-
-<!-- one or more digits (NUMBER) -->
-<!ENTITY % Number.datatype "CDATA" >
-
-<!-- integer representing length in pixels -->
-<!ENTITY % Pixels.datatype "CDATA" >
-
-<!-- script expression -->
-<!ENTITY % Script.datatype "CDATA" >
-
-<!-- textual content -->
-<!ENTITY % Text.datatype "CDATA" >
-
-<!-- Imported Datatypes ................................ -->
-
-<!-- a single character from [ISO10646] -->
-<!ENTITY % Character.datatype "CDATA" >
-
-<!-- a character encoding, as per [RFC2045] -->
-<!ENTITY % Charset.datatype "CDATA" >
-
-<!-- a space separated list of character encodings, as per [RFC2045] -->
-<!ENTITY % Charsets.datatype "CDATA" >
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType.datatype "CDATA" >
-
-<!-- comma-separated list of media types, as per [RFC2045] -->
-<!ENTITY % ContentTypes.datatype "CDATA" >
-
-<!-- date and time information. ISO date format -->
-<!ENTITY % Datetime.datatype "CDATA" >
-
-<!-- formal public identifier, as per [ISO8879] -->
-<!ENTITY % FPI.datatype "CDATA" >
-
-<!-- a language code, as per [RFC3066] -->
-<!ENTITY % LanguageCode.datatype "NMTOKEN" >
-
-<!-- a Uniform Resource Identifier, see [URI] -->
-<!ENTITY % URI.datatype "CDATA" >
-
-<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
-<!ENTITY % URIs.datatype "CDATA" >
-
-<!-- end of xhtml-datatypes-1.mod -->
-]]>
-
-<!-- placeholder for XLink support module -->
-<!ENTITY % xhtml-xlink.mod "" >
-
-
-<!ENTITY % xhtml-qname.module "INCLUDE" >
-<![%xhtml-qname.module;[
-<!ENTITY % xhtml-qname.mod
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- "xhtml-qname-1.mod" >
-<!-- ....................................................................... -->
-<!-- XHTML Qname Module ................................................... -->
-<!-- file: xhtml-qname-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-qname-1.mod"
-
- Revisions:
-#2000-10-22: added qname declarations for ruby elements
- ....................................................................... -->
-
-<!-- XHTML Qname (Qualified Name) Module
-
- This module is contained in two parts, labeled Section 'A' and 'B':
-
- Section A declares parameter entities to support namespace-
- qualified names, namespace declarations, and name prefixing
- for XHTML and extensions.
-
- Section B declares parameter entities used to provide
- namespace-qualified names for all XHTML element types:
-
- %applet.qname; the xmlns-qualified name for <applet>
- %base.qname; the xmlns-qualified name for <base>
- ...
-
- XHTML extensions would create a module similar to this one.
- Included in the XHTML distribution is a template module
- ('template-qname-1.mod') suitable for this purpose.
--->
-
-<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
-
-<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
- to activate namespace prefixing. The default value should
- inherit '%NS.prefixed;' from the DTD driver, so that unless
- overridden, the default behaviour follows the overall DTD
- prefixing scheme.
--->
-<!ENTITY % NS.prefixed "IGNORE" >
-<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
-
-<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
- the URI reference used to identify the XHTML namespace:
--->
-<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" >
-
-<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
- the default namespace prefix string(s) to use when prefixing
- is enabled. This may be overridden in the DTD driver or the
- internal subset of an document instance. If no default prefix
- is desired, this may be declared as an empty string.
-
- NOTE: As specified in [XMLNAMES], the namespace prefix serves
- as a proxy for the URI reference, and is not in itself significant.
--->
-<!ENTITY % XHTML.prefix "" >
-
-<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
- colonized prefix(es) (eg., '%XHTML.prefix;:') used when
- prefixing is active, an empty string when it is not.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.pfx "%XHTML.prefix;:" >
-]]>
-<!ENTITY % XHTML.pfx "" >
-
-<!-- declare qualified name extensions here ............ -->
-<!ENTITY % xhtml-qname-extra.mod "" >
-
-
-<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
- redeclared to contain any non-XHTML namespace declaration
- attributes for namespaces embedded in XHTML. The default
- is an empty string. XLink should be included here if used
- in the DTD.
--->
-<!ENTITY % XHTML.xmlns.extra.attrib "" >
-
-<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing
- all XML Namespace declarations used in the DTD, plus the
- xmlns declaration for XHTML, its form dependent on whether
- prefixing is active.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % NS.decl.attrib
- "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XHTML.xmlns.extra.attrib;"
->
-]]>
-<!ENTITY % NS.decl.attrib
- "%XHTML.xmlns.extra.attrib;"
->
-
-<!-- This is a placeholder for future XLink support.
--->
-<!ENTITY % XLINK.xmlns.attrib "" >
-
-<!-- Declare a parameter entity %NS.decl.attrib; containing all
- XML namespace declaration attributes used by XHTML, including
- a default xmlns attribute when prefixing is inactive.
--->
-<![%XHTML.prefixed;[
-<!ENTITY % XHTML.xmlns.attrib
- "%NS.decl.attrib;
- %XLINK.xmlns.attrib;"
->
-]]>
-<!ENTITY % XHTML.xmlns.attrib
- "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;'
- %XLINK.xmlns.attrib;"
->
-
-<!-- placeholder for qualified name redeclarations -->
-<!ENTITY % xhtml-qname.redecl "" >
-
-
-<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
-
-<!-- 6. This section declares parameter entities used to provide
- namespace-qualified names for all XHTML element types.
--->
-
-<!-- module: xhtml-applet-1.mod -->
-<!ENTITY % applet.qname "%XHTML.pfx;applet" >
-
-<!-- module: xhtml-base-1.mod -->
-<!ENTITY % base.qname "%XHTML.pfx;base" >
-
-<!-- module: xhtml-bdo-1.mod -->
-<!ENTITY % bdo.qname "%XHTML.pfx;bdo" >
-
-<!-- module: xhtml-blkphras-1.mod -->
-<!ENTITY % address.qname "%XHTML.pfx;address" >
-<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" >
-<!ENTITY % pre.qname "%XHTML.pfx;pre" >
-<!ENTITY % h1.qname "%XHTML.pfx;h1" >
-<!ENTITY % h2.qname "%XHTML.pfx;h2" >
-<!ENTITY % h3.qname "%XHTML.pfx;h3" >
-<!ENTITY % h4.qname "%XHTML.pfx;h4" >
-<!ENTITY % h5.qname "%XHTML.pfx;h5" >
-<!ENTITY % h6.qname "%XHTML.pfx;h6" >
-
-<!-- module: xhtml-blkpres-1.mod -->
-<!ENTITY % hr.qname "%XHTML.pfx;hr" >
-
-<!-- module: xhtml-blkstruct-1.mod -->
-<!ENTITY % div.qname "%XHTML.pfx;div" >
-<!ENTITY % p.qname "%XHTML.pfx;p" >
-
-<!-- module: xhtml-edit-1.mod -->
-<!ENTITY % ins.qname "%XHTML.pfx;ins" >
-<!ENTITY % del.qname "%XHTML.pfx;del" >
-
-<!-- module: xhtml-form-1.mod -->
-<!ENTITY % form.qname "%XHTML.pfx;form" >
-<!ENTITY % label.qname "%XHTML.pfx;label" >
-<!ENTITY % input.qname "%XHTML.pfx;input" >
-<!ENTITY % select.qname "%XHTML.pfx;select" >
-<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" >
-<!ENTITY % option.qname "%XHTML.pfx;option" >
-<!ENTITY % textarea.qname "%XHTML.pfx;textarea" >
-<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" >
-<!ENTITY % legend.qname "%XHTML.pfx;legend" >
-<!ENTITY % button.qname "%XHTML.pfx;button" >
-
-<!-- module: xhtml-hypertext-1.mod -->
-<!ENTITY % a.qname "%XHTML.pfx;a" >
-
-<!-- module: xhtml-image-1.mod -->
-<!ENTITY % img.qname "%XHTML.pfx;img" >
-
-<!-- module: xhtml-inlphras-1.mod -->
-<!ENTITY % abbr.qname "%XHTML.pfx;abbr" >
-<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
-<!ENTITY % cite.qname "%XHTML.pfx;cite" >
-<!ENTITY % code.qname "%XHTML.pfx;code" >
-<!ENTITY % dfn.qname "%XHTML.pfx;dfn" >
-<!ENTITY % em.qname "%XHTML.pfx;em" >
-<!ENTITY % kbd.qname "%XHTML.pfx;kbd" >
-<!ENTITY % q.qname "%XHTML.pfx;q" >
-<!ENTITY % samp.qname "%XHTML.pfx;samp" >
-<!ENTITY % strong.qname "%XHTML.pfx;strong" >
-<!ENTITY % var.qname "%XHTML.pfx;var" >
-
-<!-- module: xhtml-inlpres-1.mod -->
-<!ENTITY % b.qname "%XHTML.pfx;b" >
-<!ENTITY % big.qname "%XHTML.pfx;big" >
-<!ENTITY % i.qname "%XHTML.pfx;i" >
-<!ENTITY % small.qname "%XHTML.pfx;small" >
-<!ENTITY % sub.qname "%XHTML.pfx;sub" >
-<!ENTITY % sup.qname "%XHTML.pfx;sup" >
-<!ENTITY % tt.qname "%XHTML.pfx;tt" >
-
-<!-- module: xhtml-inlstruct-1.mod -->
-<!ENTITY % br.qname "%XHTML.pfx;br" >
-<!ENTITY % span.qname "%XHTML.pfx;span" >
-
-<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) -->
-<!ENTITY % map.qname "%XHTML.pfx;map" >
-<!ENTITY % area.qname "%XHTML.pfx;area" >
-
-<!-- module: xhtml-link-1.mod -->
-<!ENTITY % link.qname "%XHTML.pfx;link" >
-
-<!-- module: xhtml-list-1.mod -->
-<!ENTITY % dl.qname "%XHTML.pfx;dl" >
-<!ENTITY % dt.qname "%XHTML.pfx;dt" >
-<!ENTITY % dd.qname "%XHTML.pfx;dd" >
-<!ENTITY % ol.qname "%XHTML.pfx;ol" >
-<!ENTITY % ul.qname "%XHTML.pfx;ul" >
-<!ENTITY % li.qname "%XHTML.pfx;li" >
-
-<!-- module: xhtml-meta-1.mod -->
-<!ENTITY % meta.qname "%XHTML.pfx;meta" >
-
-<!-- module: xhtml-param-1.mod -->
-<!ENTITY % param.qname "%XHTML.pfx;param" >
-
-<!-- module: xhtml-object-1.mod -->
-<!ENTITY % object.qname "%XHTML.pfx;object" >
-
-<!-- module: xhtml-script-1.mod -->
-<!ENTITY % script.qname "%XHTML.pfx;script" >
-<!ENTITY % noscript.qname "%XHTML.pfx;noscript" >
-
-<!-- module: xhtml-struct-1.mod -->
-<!ENTITY % html.qname "%XHTML.pfx;html" >
-<!ENTITY % head.qname "%XHTML.pfx;head" >
-<!ENTITY % title.qname "%XHTML.pfx;title" >
-<!ENTITY % body.qname "%XHTML.pfx;body" >
-
-<!-- module: xhtml-style-1.mod -->
-<!ENTITY % style.qname "%XHTML.pfx;style" >
-
-<!-- module: xhtml-table-1.mod -->
-<!ENTITY % table.qname "%XHTML.pfx;table" >
-<!ENTITY % caption.qname "%XHTML.pfx;caption" >
-<!ENTITY % thead.qname "%XHTML.pfx;thead" >
-<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" >
-<!ENTITY % tbody.qname "%XHTML.pfx;tbody" >
-<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" >
-<!ENTITY % col.qname "%XHTML.pfx;col" >
-<!ENTITY % tr.qname "%XHTML.pfx;tr" >
-<!ENTITY % th.qname "%XHTML.pfx;th" >
-<!ENTITY % td.qname "%XHTML.pfx;td" >
-
-<!-- module: xhtml-ruby-1.mod -->
-
-<!ENTITY % ruby.qname "%XHTML.pfx;ruby" >
-<!ENTITY % rbc.qname "%XHTML.pfx;rbc" >
-<!ENTITY % rtc.qname "%XHTML.pfx;rtc" >
-<!ENTITY % rb.qname "%XHTML.pfx;rb" >
-<!ENTITY % rt.qname "%XHTML.pfx;rt" >
-<!ENTITY % rp.qname "%XHTML.pfx;rp" >
-
-<!-- Provisional XHTML 2.0 Qualified Names ...................... -->
-
-<!-- module: xhtml-image-2.mod -->
-<!ENTITY % alt.qname "%XHTML.pfx;alt" >
-
-<!-- end of xhtml-qname-1.mod -->
-]]>
-
-<!ENTITY % xhtml-events.module "IGNORE" >
-<![%xhtml-events.module;[
-<!ENTITY % xhtml-events.mod
- PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
- "xhtml-events-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Intrinsic Events Module ....................................... -->
-<!-- file: xhtml-events-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-events-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Intrinsic Event Attributes
-
- These are the event attributes defined in HTML 4.0,
- Section 18.2.3 "Intrinsic Events". This module must be
- instantiated prior to the Attributes Module but after
- the Datatype Module in the Modular Framework module.
-
- "Note: Authors of HTML documents are advised that changes
- are likely to occur in the realm of intrinsic events
- (e.g., how scripts are bound to events). Research in
- this realm is carried on by members of the W3C Document
- Object Model Working Group (see the W3C Web site at
- http://www.w3.org/ for more information)."
--->
-<!-- NOTE: Because the ATTLIST declarations in this module occur
- before their respective ELEMENT declarations in other
- modules, there may be a dependency on this module that
- should be considered if any of the parameter entities used
- for element type names (eg., %a.qname;) are redeclared.
--->
-
-<!ENTITY % Events.attrib
- "onclick %Script.datatype; #IMPLIED
- ondblclick %Script.datatype; #IMPLIED
- onmousedown %Script.datatype; #IMPLIED
- onmouseup %Script.datatype; #IMPLIED
- onmouseover %Script.datatype; #IMPLIED
- onmousemove %Script.datatype; #IMPLIED
- onmouseout %Script.datatype; #IMPLIED
- onkeypress %Script.datatype; #IMPLIED
- onkeydown %Script.datatype; #IMPLIED
- onkeyup %Script.datatype; #IMPLIED"
->
-
-<!-- additional attributes on anchor element
--->
-<!ATTLIST %a.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on form element
--->
-<!ATTLIST %form.qname;
- onsubmit %Script.datatype; #IMPLIED
- onreset %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on label element
--->
-<!ATTLIST %label.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on input element
--->
-<!ATTLIST %input.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
- onselect %Script.datatype; #IMPLIED
- onchange %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on select element
--->
-<!ATTLIST %select.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
- onchange %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on textarea element
--->
-<!ATTLIST %textarea.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
- onselect %Script.datatype; #IMPLIED
- onchange %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on button element
--->
-<!ATTLIST %button.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on body element
--->
-<!ATTLIST %body.qname;
- onload %Script.datatype; #IMPLIED
- onunload %Script.datatype; #IMPLIED
->
-
-<!-- additional attributes on area element
--->
-<!ATTLIST %area.qname;
- onfocus %Script.datatype; #IMPLIED
- onblur %Script.datatype; #IMPLIED
->
-
-<!-- end of xhtml-events-1.mod -->
-]]>
-
-<!ENTITY % xhtml-attribs.module "INCLUDE" >
-<![%xhtml-attribs.module;[
-<!ENTITY % xhtml-attribs.mod
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- "xhtml-attribs-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Common Attributes Module ...................................... -->
-<!-- file: xhtml-attribs-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-attribs-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Common Attributes
-
- This module declares many of the common attributes for the XHTML DTD.
- %NS.decl.attrib; is declared in the XHTML Qname module.
--->
-
-<!ENTITY % id.attrib
- "id ID #IMPLIED"
->
-
-<!ENTITY % class.attrib
- "class NMTOKENS #IMPLIED"
->
-
-<!ENTITY % title.attrib
- "title %Text.datatype; #IMPLIED"
->
-
-<!ENTITY % Core.extra.attrib "" >
-
-<!ENTITY % Core.attrib
- "%XHTML.xmlns.attrib;
- %id.attrib;
- %class.attrib;
- %title.attrib;
- %Core.extra.attrib;"
->
-
-<!ENTITY % lang.attrib
- "xml:lang %LanguageCode.datatype; #IMPLIED"
->
-
-<![%XHTML.bidi;[
-<!ENTITY % dir.attrib
- "dir ( ltr | rtl ) #IMPLIED"
->
-
-<!ENTITY % I18n.attrib
- "%dir.attrib;
- %lang.attrib;"
->
-
-]]>
-<!ENTITY % I18n.attrib
- "%lang.attrib;"
->
-
-<!ENTITY % Common.extra.attrib "" >
-
-<!-- intrinsic event attributes declared previously
--->
-<!ENTITY % Events.attrib "" >
-
-<!ENTITY % Common.attrib
- "%Core.attrib;
- %I18n.attrib;
- %Events.attrib;
- %Common.extra.attrib;"
->
-
-<!-- end of xhtml-attribs-1.mod -->
-]]>
-
-<!-- placeholder for content model redeclarations -->
-<!ENTITY % xhtml-model.redecl "" >
-
-
-<!ENTITY % xhtml-model.module "INCLUDE" >
-<![%xhtml-model.module;[
-<!-- instantiate the Document Model module declared in the DTD driver
--->
-<!-- ....................................................................... -->
-<!-- XHTML 1.1 Document Model Module ...................................... -->
-<!-- file: xhtml11-model-1.mod
-
- This is XHTML 1.1, a reformulation of HTML as a modular XML application.
- Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11-model-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- XHTML 1.1 Document Model
-
- This module describes the groupings of elements that make up
- common content models for XHTML elements.
-
- XHTML has three basic content models:
-
- %Inline.mix; character-level elements
- %Block.mix; block-like elements, eg., paragraphs and lists
- %Flow.mix; any block or inline elements
-
- Any parameter entities declared in this module may be used
- to create element content models, but the above three are
- considered 'global' (insofar as that term applies here).
-
- The reserved word '#PCDATA' (indicating a text string) is now
- included explicitly with each element declaration that is
- declared as mixed content, as XML requires that this token
- occur first in a content model specification.
--->
-<!-- Extending the Model
-
- While in some cases this module may need to be rewritten to
- accommodate changes to the document model, minor extensions
- may be accomplished by redeclaring any of the three *.extra;
- parameter entities to contain extension element types as follows:
-
- %Misc.extra; whose parent may be any block or
- inline element.
-
- %Inline.extra; whose parent may be any inline element.
-
- %Block.extra; whose parent may be any block element.
-
- If used, these parameter entities must be an OR-separated
- list beginning with an OR separator ("|"), eg., "| a | b | c"
-
- All block and inline *.class parameter entities not part
- of the *struct.class classes begin with "| " to allow for
- exclusion from mixes.
--->
-
-<!-- .............. Optional Elements in head .................. -->
-
-<!ENTITY % HeadOpts.mix
- "( %script.qname; | %style.qname; | %meta.qname;
- | %link.qname; | %object.qname; )*"
->
-
-<!-- ................. Miscellaneous Elements .................. -->
-
-<!-- ins and del are used to denote editing changes
--->
-<!ENTITY % Edit.class "| %ins.qname; | %del.qname;" >
-
-<!-- script and noscript are used to contain scripts
- and alternative content
--->
-<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
-
-<!ENTITY % Misc.extra "" >
-
-<!-- These elements are neither block nor inline, and can
- essentially be used anywhere in the document body.
--->
-<!ENTITY % Misc.class
- "%Edit.class;
- %Script.class;
- %Misc.extra;"
->
-
-<!-- .................... Inline Elements ...................... -->
-
-<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
-
-<!ENTITY % InlPhras.class
- "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
- | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
- | %abbr.qname; | %acronym.qname; | %q.qname;" >
-
-<!ENTITY % InlPres.class
- "| %tt.qname; | %i.qname; | %b.qname; | %big.qname;
- | %small.qname; | %sub.qname; | %sup.qname;" >
-
-<!ENTITY % I18n.class "| %bdo.qname;" >
-
-<!ENTITY % Anchor.class "| %a.qname;" >
-
-<!ENTITY % InlSpecial.class
- "| %img.qname; | %map.qname;
- | %object.qname;" >
-
-<!ENTITY % InlForm.class
- "| %input.qname; | %select.qname; | %textarea.qname;
- | %label.qname; | %button.qname;" >
-
-<!ENTITY % Inline.extra "" >
-
-<!ENTITY % Ruby.class "| %ruby.qname;" >
-
-<!-- %Inline.class; includes all inline elements,
- used as a component in mixes
--->
-<!ENTITY % Inline.class
- "%InlStruct.class;
- %InlPhras.class;
- %InlPres.class;
- %I18n.class;
- %Anchor.class;
- %InlSpecial.class;
- %InlForm.class;
- %Ruby.class;
- %Inline.extra;"
->
-
-<!-- %InlNoRuby.class; includes all inline elements
- except ruby, used as a component in mixes
--->
-<!ENTITY % InlNoRuby.class
- "%InlStruct.class;
- %InlPhras.class;
- %InlPres.class;
- %I18n.class;
- %Anchor.class;
- %InlSpecial.class;
- %InlForm.class;
- %Inline.extra;"
->
-
-<!-- %NoRuby.content; includes all inlines except ruby
--->
-<!ENTITY % NoRuby.content
- "( #PCDATA
- | %InlNoRuby.class;
- %Misc.class; )*"
->
-
-<!-- %InlNoAnchor.class; includes all non-anchor inlines,
- used as a component in mixes
--->
-<!ENTITY % InlNoAnchor.class
- "%InlStruct.class;
- %InlPhras.class;
- %InlPres.class;
- %I18n.class;
- %InlSpecial.class;
- %InlForm.class;
- %Ruby.class;
- %Inline.extra;"
->
-
-<!-- %InlNoAnchor.mix; includes all non-anchor inlines
--->
-<!ENTITY % InlNoAnchor.mix
- "%InlNoAnchor.class;
- %Misc.class;"
->
-
-<!-- %Inline.mix; includes all inline elements, including %Misc.class;
--->
-<!ENTITY % Inline.mix
- "%Inline.class;
- %Misc.class;"
->
-
-<!-- ..................... Block Elements ...................... -->
-
-<!-- In the HTML 4.0 DTD, heading and list elements were included
- in the %block; parameter entity. The %Heading.class; and
- %List.class; parameter entities must now be included explicitly
- on element declarations where desired.
--->
-
-<!ENTITY % Heading.class
- "%h1.qname; | %h2.qname; | %h3.qname;
- | %h4.qname; | %h5.qname; | %h6.qname;" >
-
-<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
-
-<!ENTITY % Table.class "| %table.qname;" >
-
-<!ENTITY % Form.class "| %form.qname;" >
-
-<!ENTITY % Fieldset.class "| %fieldset.qname;" >
-
-<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
-
-<!ENTITY % BlkPhras.class
- "| %pre.qname; | %blockquote.qname; | %address.qname;" >
-
-<!ENTITY % BlkPres.class "| %hr.qname;" >
-
-<!ENTITY % BlkSpecial.class
- "%Table.class;
- %Form.class;
- %Fieldset.class;"
->
-
-<!ENTITY % Block.extra "" >
-
-<!-- %Block.class; includes all block elements,
- used as an component in mixes
--->
-<!ENTITY % Block.class
- "%BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- %BlkSpecial.class;
- %Block.extra;"
->
-
-<!-- %Block.mix; includes all block elements plus %Misc.class;
--->
-<!ENTITY % Block.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- %Misc.class;"
->
-
-<!-- ................ All Content Elements .................. -->
-
-<!-- %Flow.mix; includes all text content, block and inline
--->
-<!ENTITY % Flow.mix
- "%Heading.class;
- | %List.class;
- | %Block.class;
- | %Inline.class;
- %Misc.class;"
->
-
-<!-- end of xhtml11-model-1.mod -->
-]]>
-
-<!ENTITY % xhtml-charent.module "INCLUDE" >
-<![%xhtml-charent.module;[
-<!ENTITY % xhtml-charent.mod
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- "xhtml-charent-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Character Entities Module ......................................... -->
-<!-- file: xhtml-charent-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-charent-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Character Entities for XHTML
-
- This module declares the set of character entities for XHTML,
- including the Latin 1, Symbol and Special character collections.
--->
-
-<!ENTITY % xhtml-lat1
- PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "xhtml-lat1.ent" >
-<!-- Portions (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLlat1 PUBLIC
- "-//W3C//ENTITIES Latin 1 for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
- %HTMLlat1;
--->
-
-<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
- U+00A0 ISOnum -->
-<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
-<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
-<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
-<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
-<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
-<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
- U+00A6 ISOnum -->
-<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
-<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
- U+00A8 ISOdia -->
-<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
-<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
-<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
- = left pointing guillemet, U+00AB ISOnum -->
-<!ENTITY not "&#172;"> <!-- not sign = discretionary hyphen,
- U+00AC ISOnum -->
-<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
- U+00AD ISOnum -->
-<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
- U+00AE ISOnum -->
-<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
- = APL overbar, U+00AF ISOdia -->
-<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
-<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
- U+00B1 ISOnum -->
-<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
- = squared, U+00B2 ISOnum -->
-<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
- = cubed, U+00B3 ISOnum -->
-<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
- U+00B4 ISOdia -->
-<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
-<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
- U+00B6 ISOnum -->
-<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
- = Greek middle dot, U+00B7 ISOnum -->
-<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
-<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
- U+00B9 ISOnum -->
-<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
- U+00BA ISOnum -->
-<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
- = right pointing guillemet, U+00BB ISOnum -->
-<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
- = fraction one quarter, U+00BC ISOnum -->
-<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
- = fraction one half, U+00BD ISOnum -->
-<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
- = fraction three quarters, U+00BE ISOnum -->
-<!ENTITY iquest "&#191;"> <!-- inverted question mark
- = turned question mark, U+00BF ISOnum -->
-<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
- = latin capital letter A grave,
- U+00C0 ISOlat1 -->
-<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
- U+00C1 ISOlat1 -->
-<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
- U+00C2 ISOlat1 -->
-<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
- U+00C3 ISOlat1 -->
-<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
- U+00C4 ISOlat1 -->
-<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
- = latin capital letter A ring,
- U+00C5 ISOlat1 -->
-<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
- = latin capital ligature AE,
- U+00C6 ISOlat1 -->
-<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
- U+00C7 ISOlat1 -->
-<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
- U+00C8 ISOlat1 -->
-<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
- U+00C9 ISOlat1 -->
-<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
- U+00CA ISOlat1 -->
-<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
- U+00CB ISOlat1 -->
-<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
- U+00CC ISOlat1 -->
-<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
- U+00CD ISOlat1 -->
-<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
- U+00CE ISOlat1 -->
-<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
- U+00CF ISOlat1 -->
-<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
-<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
- U+00D1 ISOlat1 -->
-<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
- U+00D2 ISOlat1 -->
-<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
- U+00D3 ISOlat1 -->
-<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
- U+00D4 ISOlat1 -->
-<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
- U+00D5 ISOlat1 -->
-<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
- U+00D6 ISOlat1 -->
-<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
-<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
- = latin capital letter O slash,
- U+00D8 ISOlat1 -->
-<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
- U+00D9 ISOlat1 -->
-<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
- U+00DA ISOlat1 -->
-<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
- U+00DB ISOlat1 -->
-<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
- U+00DC ISOlat1 -->
-<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
- U+00DD ISOlat1 -->
-<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
- U+00DE ISOlat1 -->
-<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
- U+00DF ISOlat1 -->
-<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
- = latin small letter a grave,
- U+00E0 ISOlat1 -->
-<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
- U+00E1 ISOlat1 -->
-<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
- U+00E2 ISOlat1 -->
-<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
- U+00E3 ISOlat1 -->
-<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
- U+00E4 ISOlat1 -->
-<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
- = latin small letter a ring,
- U+00E5 ISOlat1 -->
-<!ENTITY aelig "&#230;"> <!-- latin small letter ae
- = latin small ligature ae, U+00E6 ISOlat1 -->
-<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
- U+00E7 ISOlat1 -->
-<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
- U+00E8 ISOlat1 -->
-<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
- U+00E9 ISOlat1 -->
-<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
- U+00EA ISOlat1 -->
-<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
- U+00EB ISOlat1 -->
-<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
- U+00EC ISOlat1 -->
-<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
- U+00ED ISOlat1 -->
-<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
- U+00EE ISOlat1 -->
-<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
- U+00EF ISOlat1 -->
-<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
-<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
- U+00F1 ISOlat1 -->
-<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
- U+00F2 ISOlat1 -->
-<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
- U+00F3 ISOlat1 -->
-<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
- U+00F4 ISOlat1 -->
-<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
- U+00F5 ISOlat1 -->
-<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
- U+00F6 ISOlat1 -->
-<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
-<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
- = latin small letter o slash,
- U+00F8 ISOlat1 -->
-<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
- U+00F9 ISOlat1 -->
-<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
- U+00FA ISOlat1 -->
-<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
- U+00FB ISOlat1 -->
-<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
- U+00FC ISOlat1 -->
-<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
- U+00FD ISOlat1 -->
-<!ENTITY thorn "&#254;"> <!-- latin small letter thorn with,
- U+00FE ISOlat1 -->
-<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
- U+00FF ISOlat1 -->
-
-
-<!ENTITY % xhtml-symbol
- PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
- "xhtml-symbol.ent" >
-<!-- Mathematical, Greek and Symbolic characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLsymbol PUBLIC
- "-//W3C//ENTITIES Symbols for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
- %HTMLsymbol;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- Latin Extended-B -->
-<!ENTITY fnof "&#402;"> <!-- latin small f with hook = function
- = florin, U+0192 ISOtech -->
-
-<!-- Greek -->
-<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
-<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
-<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
- U+0393 ISOgrk3 -->
-<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
- U+0394 ISOgrk3 -->
-<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
-<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
-<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
-<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
- U+0398 ISOgrk3 -->
-<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
-<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
-<!ENTITY Lambda "&#923;"> <!-- greek capital letter lambda,
- U+039B ISOgrk3 -->
-<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
-<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
-<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
-<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
-<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
-<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
-<!-- there is no Sigmaf, and no U+03A2 character either -->
-<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
- U+03A3 ISOgrk3 -->
-<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
-<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
- U+03A5 ISOgrk3 -->
-<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
- U+03A6 ISOgrk3 -->
-<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
-<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
- U+03A8 ISOgrk3 -->
-<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
- U+03A9 ISOgrk3 -->
-
-<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
- U+03B1 ISOgrk3 -->
-<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
-<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
- U+03B3 ISOgrk3 -->
-<!ENTITY delta "&#948;"> <!-- greek small letter delta,
- U+03B4 ISOgrk3 -->
-<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
- U+03B5 ISOgrk3 -->
-<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
-<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
-<!ENTITY theta "&#952;"> <!-- greek small letter theta,
- U+03B8 ISOgrk3 -->
-<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
-<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
- U+03BA ISOgrk3 -->
-<!ENTITY lambda "&#955;"> <!-- greek small letter lambda,
- U+03BB ISOgrk3 -->
-<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
-<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
-<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
-<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
-<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
-<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
-<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
- U+03C2 ISOgrk3 -->
-<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
- U+03C3 ISOgrk3 -->
-<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
-<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
- U+03C5 ISOgrk3 -->
-<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
-<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
-<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
-<!ENTITY omega "&#969;"> <!-- greek small letter omega,
- U+03C9 ISOgrk3 -->
-<!ENTITY thetasym "&#977;"> <!-- greek small letter theta symbol,
- U+03D1 NEW -->
-<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
- U+03D2 NEW -->
-<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
-
-<!-- General Punctuation -->
-<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
- U+2022 ISOpub -->
-<!-- bullet is NOT the same as bullet operator, U+2219 -->
-<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
- U+2026 ISOpub -->
-<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
-<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
- U+2033 ISOtech -->
-<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
- U+203E NEW -->
-<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
-
-<!-- Letterlike Symbols -->
-<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
- = Weierstrass p, U+2118 ISOamso -->
-<!ENTITY image "&#8465;"> <!-- blackletter capital I = imaginary part,
- U+2111 ISOamso -->
-<!ENTITY real "&#8476;"> <!-- blackletter capital R = real part symbol,
- U+211C ISOamso -->
-<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
-<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
- U+2135 NEW -->
-<!-- alef symbol is NOT the same as hebrew letter alef,
- U+05D0 although the same glyph could be used to depict both characters -->
-
-<!-- Arrows -->
-<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
-<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
-<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
-<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
-<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
-<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
- = carriage return, U+21B5 NEW -->
-<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
-<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
- but also does not have any other character for that function. So ? lArr can
- be used for 'is implied by' as ISOtech suggests -->
-<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
-<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
- U+21D2 ISOtech -->
-<!-- Unicode does not say this is the 'implies' character but does not have
- another character with this function so ?
- rArr can be used for 'implies' as ISOtech suggests -->
-<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
-<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
- U+21D4 ISOamsa -->
-
-<!-- Mathematical Operators -->
-<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
-<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
-<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
-<!ENTITY empty "&#8709;"> <!-- empty set = null set = diameter,
- U+2205 ISOamso -->
-<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
- U+2207 ISOtech -->
-<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
-<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
-<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
-<!-- should there be a more memorable name than 'ni'? -->
-<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
- U+220F ISOamsb -->
-<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
- the same glyph might be used for both -->
-<!ENTITY sum "&#8721;"> <!-- n-ary sumation, U+2211 ISOamsb -->
-<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
- though the same glyph might be used for both -->
-<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
-<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
-<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
- U+221A ISOtech -->
-<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
-<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
-<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
-<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
-<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
-<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
-<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
-<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
-<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
-<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
- U+223C ISOtech -->
-<!-- tilde operator is NOT the same character as the tilde, U+007E,
- although the same glyph might be used to represent both -->
-<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
-<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
- U+2248 ISOamsr -->
-<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
-<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
-<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
-<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
- U+2265 ISOtech -->
-<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
-<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
-<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
- font encoding and is not included. Should it be, for symmetry?
- It is in ISOamsn -->
-<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
-<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
-<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
- U+2287 ISOtech -->
-<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
- U+2295 ISOamsb -->
-<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
- U+2297 ISOamsb -->
-<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
- U+22A5 ISOtech -->
-<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
-<!-- dot operator is NOT the same character as U+00B7 middle dot -->
-
-<!-- Miscellaneous Technical -->
-<!ENTITY lceil "&#8968;"> <!-- left ceiling = apl upstile,
- U+2308 ISOamsc -->
-<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
-<!ENTITY lfloor "&#8970;"> <!-- left floor = apl downstile,
- U+230A ISOamsc -->
-<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
-<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
- U+2329 ISOtech -->
-<!-- lang is NOT the same character as U+003C 'less than'
- or U+2039 'single left-pointing angle quotation mark' -->
-<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
- U+232A ISOtech -->
-<!-- rang is NOT the same character as U+003E 'greater than'
- or U+203A 'single right-pointing angle quotation mark' -->
-
-<!-- Geometric Shapes -->
-<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
-
-<!-- Miscellaneous Symbols -->
-<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
-<!-- black here seems to mean filled as opposed to hollow -->
-<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
- U+2663 ISOpub -->
-<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
- U+2665 ISOpub -->
-<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
-
-
-<!ENTITY % xhtml-special
- PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
- "xhtml-special.ent" >
-<!-- Special characters for HTML -->
-
-<!-- Character entity set. Typical invocation:
- <!ENTITY % HTMLspecial PUBLIC
- "-//W3C//ENTITIES Special for XHTML//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
- %HTMLspecial;
--->
-
-<!-- Portions (C) International Organization for Standardization 1986:
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-
-<!-- Relevant ISO entity set is given unless names are newly introduced.
- New names (i.e., not in ISO 8879 list) do not clash with any
- existing ISO 8879 entity names. ISO 10646 character numbers
- are given for each character, in hex. values are decimal
- conversions of the ISO 10646 values and refer to the document
- character set. Names are Unicode names.
--->
-
-<!-- C0 Controls and Basic Latin -->
-<!ENTITY quot "&#34;"> <!-- quotation mark = APL quote,
- U+0022 ISOnum -->
-<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
-<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
-<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
-<!ENTITY apos "&#39;"> <!-- apostrophe mark, U+0027 ISOnum -->
-
-<!-- Latin Extended-A -->
-<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
- U+0152 ISOlat2 -->
-<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
-<!-- ligature is a misnomer, this is a separate character in some languages -->
-<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
- U+0160 ISOlat2 -->
-<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
- U+0161 ISOlat2 -->
-<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
- U+0178 ISOlat2 -->
-
-<!-- Spacing Modifier Letters -->
-<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
- U+02C6 ISOpub -->
-<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
-
-<!-- General Punctuation -->
-<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
-<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
-<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
-<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
- U+200C NEW RFC 2070 -->
-<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
-<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
-<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
-<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
-<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
-<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
- U+2018 ISOnum -->
-<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
- U+2019 ISOnum -->
-<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
-<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
- U+201C ISOnum -->
-<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
- U+201D ISOnum -->
-<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
-<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
-<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
-<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
-<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
- U+2039 ISO proposed -->
-<!-- lsaquo is proposed but not yet ISO standardized -->
-<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
- U+203A ISO proposed -->
-<!-- rsaquo is proposed but not yet ISO standardized -->
-<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
-
-
-<!-- end of xhtml-charent-1.mod -->
-]]>
-
-<!-- end of xhtml-framework-1.mod -->
-]]>
-
-<!-- Post-Framework Redeclaration placeholder ................... -->
-<!-- this serves as a location to insert markup declarations
- into the DTD following the framework declarations.
--->
-<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >
-<![%xhtml-postfw-redecl.module;[
-%xhtml-postfw-redecl.mod;
-<!-- end of xhtml-postfw-redecl.module -->]]>
-
-<!-- Text Module (Required) ..................................... -->
-<!ENTITY % xhtml-text.module "INCLUDE" >
-<![%xhtml-text.module;[
-<!ENTITY % xhtml-text.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Text Module ................................................... -->
-<!-- file: xhtml-text-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Textual Content
-
- The Text module includes declarations for all core
- text container elements and their attributes.
--->
-
-<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
-<![%xhtml-inlstruct.module;[
-<!ENTITY % xhtml-inlstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- "xhtml-inlstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Structural Module ...................................... -->
-<!-- file: xhtml-inlstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Structural
-
- br, span
-
- This module declares the elements and their attributes
- used to support inline-level structural markup.
--->
-
-<!-- br: forced line break ............................. -->
-
-<!ENTITY % br.element "INCLUDE" >
-<![%br.element;[
-
-<!ENTITY % br.content "EMPTY" >
-<!ENTITY % br.qname "br" >
-<!ELEMENT %br.qname; %br.content; >
-
-<!-- end of br.element -->]]>
-
-<!ENTITY % br.attlist "INCLUDE" >
-<![%br.attlist;[
-<!ATTLIST %br.qname;
- %Core.attrib;
->
-<!-- end of br.attlist -->]]>
-
-<!-- span: generic inline container .................... -->
-
-<!ENTITY % span.element "INCLUDE" >
-<![%span.element;[
-<!ENTITY % span.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % span.qname "span" >
-<!ELEMENT %span.qname; %span.content; >
-<!-- end of span.element -->]]>
-
-<!ENTITY % span.attlist "INCLUDE" >
-<![%span.attlist;[
-<!ATTLIST %span.qname;
- %Common.attrib;
->
-<!-- end of span.attlist -->]]>
-
-<!-- end of xhtml-inlstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-inlphras.module "INCLUDE" >
-<![%xhtml-inlphras.module;[
-<!ENTITY % xhtml-inlphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- "xhtml-inlphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Phrasal Module ......................................... -->
-<!-- file: xhtml-inlphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Phrasal
-
- abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
-
- This module declares the elements and their attributes used to
- support inline-level phrasal markup.
--->
-
-<!ENTITY % abbr.element "INCLUDE" >
-<![%abbr.element;[
-<!ENTITY % abbr.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % abbr.qname "abbr" >
-<!ELEMENT %abbr.qname; %abbr.content; >
-<!-- end of abbr.element -->]]>
-
-<!ENTITY % abbr.attlist "INCLUDE" >
-<![%abbr.attlist;[
-<!ATTLIST %abbr.qname;
- %Common.attrib;
->
-<!-- end of abbr.attlist -->]]>
-
-<!ENTITY % acronym.element "INCLUDE" >
-<![%acronym.element;[
-<!ENTITY % acronym.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % acronym.qname "acronym" >
-<!ELEMENT %acronym.qname; %acronym.content; >
-<!-- end of acronym.element -->]]>
-
-<!ENTITY % acronym.attlist "INCLUDE" >
-<![%acronym.attlist;[
-<!ATTLIST %acronym.qname;
- %Common.attrib;
->
-<!-- end of acronym.attlist -->]]>
-
-<!ENTITY % cite.element "INCLUDE" >
-<![%cite.element;[
-<!ENTITY % cite.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % cite.qname "cite" >
-<!ELEMENT %cite.qname; %cite.content; >
-<!-- end of cite.element -->]]>
-
-<!ENTITY % cite.attlist "INCLUDE" >
-<![%cite.attlist;[
-<!ATTLIST %cite.qname;
- %Common.attrib;
->
-<!-- end of cite.attlist -->]]>
-
-<!ENTITY % code.element "INCLUDE" >
-<![%code.element;[
-<!ENTITY % code.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % code.qname "code" >
-<!ELEMENT %code.qname; %code.content; >
-<!-- end of code.element -->]]>
-
-<!ENTITY % code.attlist "INCLUDE" >
-<![%code.attlist;[
-<!ATTLIST %code.qname;
- %Common.attrib;
->
-<!-- end of code.attlist -->]]>
-
-<!ENTITY % dfn.element "INCLUDE" >
-<![%dfn.element;[
-<!ENTITY % dfn.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % dfn.qname "dfn" >
-<!ELEMENT %dfn.qname; %dfn.content; >
-<!-- end of dfn.element -->]]>
-
-<!ENTITY % dfn.attlist "INCLUDE" >
-<![%dfn.attlist;[
-<!ATTLIST %dfn.qname;
- %Common.attrib;
->
-<!-- end of dfn.attlist -->]]>
-
-<!ENTITY % em.element "INCLUDE" >
-<![%em.element;[
-<!ENTITY % em.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % em.qname "em" >
-<!ELEMENT %em.qname; %em.content; >
-<!-- end of em.element -->]]>
-
-<!ENTITY % em.attlist "INCLUDE" >
-<![%em.attlist;[
-<!ATTLIST %em.qname;
- %Common.attrib;
->
-<!-- end of em.attlist -->]]>
-
-<!ENTITY % kbd.element "INCLUDE" >
-<![%kbd.element;[
-<!ENTITY % kbd.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % kbd.qname "kbd" >
-<!ELEMENT %kbd.qname; %kbd.content; >
-<!-- end of kbd.element -->]]>
-
-<!ENTITY % kbd.attlist "INCLUDE" >
-<![%kbd.attlist;[
-<!ATTLIST %kbd.qname;
- %Common.attrib;
->
-<!-- end of kbd.attlist -->]]>
-
-<!ENTITY % q.element "INCLUDE" >
-<![%q.element;[
-<!ENTITY % q.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % q.qname "q" >
-<!ELEMENT %q.qname; %q.content; >
-<!-- end of q.element -->]]>
-
-<!ENTITY % q.attlist "INCLUDE" >
-<![%q.attlist;[
-<!ATTLIST %q.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of q.attlist -->]]>
-
-<!ENTITY % samp.element "INCLUDE" >
-<![%samp.element;[
-<!ENTITY % samp.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % samp.qname "samp" >
-<!ELEMENT %samp.qname; %samp.content; >
-<!-- end of samp.element -->]]>
-
-<!ENTITY % samp.attlist "INCLUDE" >
-<![%samp.attlist;[
-<!ATTLIST %samp.qname;
- %Common.attrib;
->
-<!-- end of samp.attlist -->]]>
-
-<!ENTITY % strong.element "INCLUDE" >
-<![%strong.element;[
-<!ENTITY % strong.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % strong.qname "strong" >
-<!ELEMENT %strong.qname; %strong.content; >
-<!-- end of strong.element -->]]>
-
-<!ENTITY % strong.attlist "INCLUDE" >
-<![%strong.attlist;[
-<!ATTLIST %strong.qname;
- %Common.attrib;
->
-<!-- end of strong.attlist -->]]>
-
-<!ENTITY % var.element "INCLUDE" >
-<![%var.element;[
-<!ENTITY % var.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % var.qname "var" >
-<!ELEMENT %var.qname; %var.content; >
-<!-- end of var.element -->]]>
-
-<!ENTITY % var.attlist "INCLUDE" >
-<![%var.attlist;[
-<!ATTLIST %var.qname;
- %Common.attrib;
->
-<!-- end of var.attlist -->]]>
-
-<!-- end of xhtml-inlphras-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
-<![%xhtml-blkstruct.module;[
-<!ENTITY % xhtml-blkstruct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- "xhtml-blkstruct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Structural Module ....................................... -->
-<!-- file: xhtml-blkstruct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkstruct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Structural
-
- div, p
-
- This module declares the elements and their attributes used to
- support block-level structural markup.
--->
-
-<!ENTITY % div.element "INCLUDE" >
-<![%div.element;[
-<!ENTITY % div.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ENTITY % div.qname "div" >
-<!ELEMENT %div.qname; %div.content; >
-<!-- end of div.element -->]]>
-
-<!ENTITY % div.attlist "INCLUDE" >
-<![%div.attlist;[
-<!ATTLIST %div.qname;
- %Common.attrib;
->
-<!-- end of div.attlist -->]]>
-
-<!ENTITY % p.element "INCLUDE" >
-<![%p.element;[
-<!ENTITY % p.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % p.qname "p" >
-<!ELEMENT %p.qname; %p.content; >
-<!-- end of p.element -->]]>
-
-<!ENTITY % p.attlist "INCLUDE" >
-<![%p.attlist;[
-<!ATTLIST %p.qname;
- %Common.attrib;
->
-<!-- end of p.attlist -->]]>
-
-<!-- end of xhtml-blkstruct-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkphras.module "INCLUDE" >
-<![%xhtml-blkphras.module;[
-<!ENTITY % xhtml-blkphras.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- "xhtml-blkphras-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Phrasal Module .......................................... -->
-<!-- file: xhtml-blkphras-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkphras-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Phrasal
-
- address, blockquote, pre, h1, h2, h3, h4, h5, h6
-
- This module declares the elements and their attributes used to
- support block-level phrasal markup.
--->
-
-<!ENTITY % address.element "INCLUDE" >
-<![%address.element;[
-<!ENTITY % address.content
- "( #PCDATA | %Inline.mix; )*" >
-<!ENTITY % address.qname "address" >
-<!ELEMENT %address.qname; %address.content; >
-<!-- end of address.element -->]]>
-
-<!ENTITY % address.attlist "INCLUDE" >
-<![%address.attlist;[
-<!ATTLIST %address.qname;
- %Common.attrib;
->
-<!-- end of address.attlist -->]]>
-
-<!ENTITY % blockquote.element "INCLUDE" >
-<![%blockquote.element;[
-<!ENTITY % blockquote.content
- "( %Block.mix; )+"
->
-<!ENTITY % blockquote.qname "blockquote" >
-<!ELEMENT %blockquote.qname; %blockquote.content; >
-<!-- end of blockquote.element -->]]>
-
-<!ENTITY % blockquote.attlist "INCLUDE" >
-<![%blockquote.attlist;[
-<!ATTLIST %blockquote.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
->
-<!-- end of blockquote.attlist -->]]>
-
-<!ENTITY % pre.element "INCLUDE" >
-<![%pre.element;[
-<!ENTITY % pre.content
- "( #PCDATA
- | %InlStruct.class;
- %InlPhras.class;
- | %tt.qname; | %i.qname; | %b.qname;
- %I18n.class;
- %Anchor.class;
- | %script.qname; | %map.qname;
- %Inline.extra; )*"
->
-<!ENTITY % pre.qname "pre" >
-<!ELEMENT %pre.qname; %pre.content; >
-<!-- end of pre.element -->]]>
-
-<!ENTITY % pre.attlist "INCLUDE" >
-<![%pre.attlist;[
-<!ATTLIST %pre.qname;
- %Common.attrib;
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of pre.attlist -->]]>
-
-<!-- ................... Heading Elements ................... -->
-
-<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
-
-<!ENTITY % h1.element "INCLUDE" >
-<![%h1.element;[
-<!ENTITY % h1.qname "h1" >
-<!ELEMENT %h1.qname; %Heading.content; >
-<!-- end of h1.element -->]]>
-
-<!ENTITY % h1.attlist "INCLUDE" >
-<![%h1.attlist;[
-<!ATTLIST %h1.qname;
- %Common.attrib;
->
-<!-- end of h1.attlist -->]]>
-
-<!ENTITY % h2.element "INCLUDE" >
-<![%h2.element;[
-<!ENTITY % h2.qname "h2" >
-<!ELEMENT %h2.qname; %Heading.content; >
-<!-- end of h2.element -->]]>
-
-<!ENTITY % h2.attlist "INCLUDE" >
-<![%h2.attlist;[
-<!ATTLIST %h2.qname;
- %Common.attrib;
->
-<!-- end of h2.attlist -->]]>
-
-<!ENTITY % h3.element "INCLUDE" >
-<![%h3.element;[
-<!ENTITY % h3.qname "h3" >
-<!ELEMENT %h3.qname; %Heading.content; >
-<!-- end of h3.element -->]]>
-
-<!ENTITY % h3.attlist "INCLUDE" >
-<![%h3.attlist;[
-<!ATTLIST %h3.qname;
- %Common.attrib;
->
-<!-- end of h3.attlist -->]]>
-
-<!ENTITY % h4.element "INCLUDE" >
-<![%h4.element;[
-<!ENTITY % h4.qname "h4" >
-<!ELEMENT %h4.qname; %Heading.content; >
-<!-- end of h4.element -->]]>
-
-<!ENTITY % h4.attlist "INCLUDE" >
-<![%h4.attlist;[
-<!ATTLIST %h4.qname;
- %Common.attrib;
->
-<!-- end of h4.attlist -->]]>
-
-<!ENTITY % h5.element "INCLUDE" >
-<![%h5.element;[
-<!ENTITY % h5.qname "h5" >
-<!ELEMENT %h5.qname; %Heading.content; >
-<!-- end of h5.element -->]]>
-
-<!ENTITY % h5.attlist "INCLUDE" >
-<![%h5.attlist;[
-<!ATTLIST %h5.qname;
- %Common.attrib;
->
-<!-- end of h5.attlist -->]]>
-
-<!ENTITY % h6.element "INCLUDE" >
-<![%h6.element;[
-<!ENTITY % h6.qname "h6" >
-<!ELEMENT %h6.qname; %Heading.content; >
-<!-- end of h6.element -->]]>
-
-<!ENTITY % h6.attlist "INCLUDE" >
-<![%h6.attlist;[
-<!ATTLIST %h6.qname;
- %Common.attrib;
->
-<!-- end of h6.attlist -->]]>
-
-<!-- end of xhtml-blkphras-1.mod -->
-]]>
-
-<!-- end of xhtml-text-1.mod -->
-]]>
-
-<!-- Hypertext Module (required) ................................. -->
-<!ENTITY % xhtml-hypertext.module "INCLUDE" >
-<![%xhtml-hypertext.module;[
-<!ENTITY % xhtml-hypertext.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Hypertext Module .............................................. -->
-<!-- file: xhtml-hypertext-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Hypertext
-
- a
-
- This module declares the anchor ('a') element type, which
- defines the source of a hypertext link. The destination
- (or link 'target') is identified via its 'id' attribute
- rather than the 'name' attribute as was used in HTML.
--->
-
-<!-- ............ Anchor Element ............ -->
-
-<!ENTITY % a.element "INCLUDE" >
-<![%a.element;[
-<!ENTITY % a.content
- "( #PCDATA | %InlNoAnchor.mix; )*"
->
-<!ENTITY % a.qname "a" >
-<!ELEMENT %a.qname; %a.content; >
-<!-- end of a.element -->]]>
-
-<!ENTITY % a.attlist "INCLUDE" >
-<![%a.attlist;[
-<!ATTLIST %a.qname;
- %Common.attrib;
- href %URI.datatype; #IMPLIED
- charset %Charset.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of a.attlist -->]]>
-
-<!-- end of xhtml-hypertext-1.mod -->
-]]>
-
-<!-- Lists Module (required) .................................... -->
-<!ENTITY % xhtml-list.module "INCLUDE" >
-<![%xhtml-list.module;[
-<!ENTITY % xhtml-list.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Lists Module .................................................. -->
-<!-- file: xhtml-list-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Lists
-
- dl, dt, dd, ol, ul, li
-
- This module declares the list-oriented element types
- and their attributes.
--->
-
-<!ENTITY % dl.qname "dl" >
-<!ENTITY % dt.qname "dt" >
-<!ENTITY % dd.qname "dd" >
-<!ENTITY % ol.qname "ol" >
-<!ENTITY % ul.qname "ul" >
-<!ENTITY % li.qname "li" >
-
-<!-- dl: Definition List ............................... -->
-
-<!ENTITY % dl.element "INCLUDE" >
-<![%dl.element;[
-<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" >
-<!ELEMENT %dl.qname; %dl.content; >
-<!-- end of dl.element -->]]>
-
-<!ENTITY % dl.attlist "INCLUDE" >
-<![%dl.attlist;[
-<!ATTLIST %dl.qname;
- %Common.attrib;
->
-<!-- end of dl.attlist -->]]>
-
-<!-- dt: Definition Term ............................... -->
-
-<!ENTITY % dt.element "INCLUDE" >
-<![%dt.element;[
-<!ENTITY % dt.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %dt.qname; %dt.content; >
-<!-- end of dt.element -->]]>
-
-<!ENTITY % dt.attlist "INCLUDE" >
-<![%dt.attlist;[
-<!ATTLIST %dt.qname;
- %Common.attrib;
->
-<!-- end of dt.attlist -->]]>
-
-<!-- dd: Definition Description ........................ -->
-
-<!ENTITY % dd.element "INCLUDE" >
-<![%dd.element;[
-<!ENTITY % dd.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %dd.qname; %dd.content; >
-<!-- end of dd.element -->]]>
-
-<!ENTITY % dd.attlist "INCLUDE" >
-<![%dd.attlist;[
-<!ATTLIST %dd.qname;
- %Common.attrib;
->
-<!-- end of dd.attlist -->]]>
-
-<!-- ol: Ordered List (numbered styles) ................ -->
-
-<!ENTITY % ol.element "INCLUDE" >
-<![%ol.element;[
-<!ENTITY % ol.content "( %li.qname; )+" >
-<!ELEMENT %ol.qname; %ol.content; >
-<!-- end of ol.element -->]]>
-
-<!ENTITY % ol.attlist "INCLUDE" >
-<![%ol.attlist;[
-<!ATTLIST %ol.qname;
- %Common.attrib;
->
-<!-- end of ol.attlist -->]]>
-
-<!-- ul: Unordered List (bullet styles) ................ -->
-
-<!ENTITY % ul.element "INCLUDE" >
-<![%ul.element;[
-<!ENTITY % ul.content "( %li.qname; )+" >
-<!ELEMENT %ul.qname; %ul.content; >
-<!-- end of ul.element -->]]>
-
-<!ENTITY % ul.attlist "INCLUDE" >
-<![%ul.attlist;[
-<!ATTLIST %ul.qname;
- %Common.attrib;
->
-<!-- end of ul.attlist -->]]>
-
-<!-- li: List Item ..................................... -->
-
-<!ENTITY % li.element "INCLUDE" >
-<![%li.element;[
-<!ENTITY % li.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %li.qname; %li.content; >
-<!-- end of li.element -->]]>
-
-<!ENTITY % li.attlist "INCLUDE" >
-<![%li.attlist;[
-<!ATTLIST %li.qname;
- %Common.attrib;
->
-<!-- end of li.attlist -->]]>
-
-<!-- end of xhtml-list-1.mod -->
-]]>
-
-<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
-
-<!-- Edit Module ................................................ -->
-<!ENTITY % xhtml-edit.module "INCLUDE" >
-<![%xhtml-edit.module;[
-<!ENTITY % xhtml-edit.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-edit-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Editing Elements Module ....................................... -->
-<!-- file: xhtml-edit-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-edit-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Editing Elements
-
- ins, del
-
- This module declares element types and attributes used to indicate
- inserted and deleted content while editing a document.
--->
-
-<!-- ins: Inserted Text ............................... -->
-
-<!ENTITY % ins.element "INCLUDE" >
-<![%ins.element;[
-<!ENTITY % ins.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ENTITY % ins.qname "ins" >
-<!ELEMENT %ins.qname; %ins.content; >
-<!-- end of ins.element -->]]>
-
-<!ENTITY % ins.attlist "INCLUDE" >
-<![%ins.attlist;[
-<!ATTLIST %ins.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
- datetime %Datetime.datatype; #IMPLIED
->
-<!-- end of ins.attlist -->]]>
-
-<!-- del: Deleted Text ................................ -->
-
-<!ENTITY % del.element "INCLUDE" >
-<![%del.element;[
-<!ENTITY % del.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ENTITY % del.qname "del" >
-<!ELEMENT %del.qname; %del.content; >
-<!-- end of del.element -->]]>
-
-<!ENTITY % del.attlist "INCLUDE" >
-<![%del.attlist;[
-<!ATTLIST %del.qname;
- %Common.attrib;
- cite %URI.datatype; #IMPLIED
- datetime %Datetime.datatype; #IMPLIED
->
-<!-- end of del.attlist -->]]>
-
-<!-- end of xhtml-edit-1.mod -->
-]]>
-
-<!-- BIDI Override Module ....................................... -->
-<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
-<![%xhtml-bdo.module;[
-<!ENTITY % xhtml-bdo.mod
- PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-bdo-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML BDO Element Module ............................................. -->
-<!-- file: xhtml-bdo-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML BDO Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-bdo-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Bidirectional Override (bdo) Element
-
- This modules declares the element 'bdo', used to override the
- Unicode bidirectional algorithm for selected fragments of text.
-
- DEPENDENCIES:
- Relies on the conditional section keyword %XHTML.bidi; declared
- as "INCLUDE". Bidirectional text support includes both the bdo
- element and the 'dir' attribute.
--->
-
-<!ENTITY % bdo.element "INCLUDE" >
-<![%bdo.element;[
-<!ENTITY % bdo.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % bdo.qname "bdo" >
-<!ELEMENT %bdo.qname; %bdo.content; >
-<!-- end of bdo.element -->]]>
-
-<!ENTITY % bdo.attlist "INCLUDE" >
-<![%bdo.attlist;[
-<!ATTLIST %bdo.qname;
- %Core.attrib;
- xml:lang %LanguageCode.datatype; #IMPLIED
- dir ( ltr | rtl ) #REQUIRED
->
-]]>
-
-<!-- end of xhtml-bdo-1.mod -->
-]]>
-
-<!-- Ruby Module ................................................ -->
-<!ENTITY % Ruby.common.attlists "INCLUDE" >
-<!ENTITY % Ruby.common.attrib "%Common.attrib;" >
-<!ENTITY % xhtml-ruby.module "INCLUDE" >
-<![%xhtml-ruby.module;[
-<!ENTITY % xhtml-ruby.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
- "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Ruby Module .................................................... -->
-<!-- file: xhtml-ruby-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1999-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $
-
- This module is based on the W3C Ruby Annotation Specification:
-
- http://www.w3.org/TR/ruby
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
- SYSTEM "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod"
-
- ...................................................................... -->
-
-<!-- Ruby Elements
-
- ruby, rbc, rtc, rb, rt, rp
-
- This module declares the elements and their attributes used to
- support ruby annotation markup.
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % ruby.qname "ruby" >
-<!ENTITY % rbc.qname "rbc" >
-<!ENTITY % rtc.qname "rtc" >
-<!ENTITY % rb.qname "rb" >
-<!ENTITY % rt.qname "rt" >
-<!ENTITY % rp.qname "rp" >
-
-<!-- rp fallback is included by default.
--->
-<!ENTITY % Ruby.fallback "INCLUDE" >
-<!ENTITY % Ruby.fallback.mandatory "IGNORE" >
-
-<!-- Complex ruby is included by default; it may be
- overridden by other modules to ignore it.
--->
-<!ENTITY % Ruby.complex "INCLUDE" >
-
-<!-- Fragments for the content model of the ruby element -->
-<![%Ruby.fallback;[
-<![%Ruby.fallback.mandatory;[
-<!ENTITY % Ruby.content.simple
- "( %rb.qname;, %rp.qname;, %rt.qname;, %rp.qname; )"
->
-]]>
-<!ENTITY % Ruby.content.simple
- "( %rb.qname;, ( %rt.qname; | ( %rp.qname;, %rt.qname;, %rp.qname; ) ) )"
->
-]]>
-<!ENTITY % Ruby.content.simple "( %rb.qname;, %rt.qname; )" >
-
-<![%Ruby.complex;[
-<!ENTITY % Ruby.content.complex
- "| ( %rbc.qname;, %rtc.qname;, %rtc.qname;? )"
->
-]]>
-<!ENTITY % Ruby.content.complex "" >
-
-<!-- Content models of the rb and the rt elements are intended to
- allow other inline-level elements of its parent markup language,
- but it should not include ruby descendent elements. The following
- parameter entity %NoRuby.content; can be used to redefine
- those content models with minimum effort. It's defined as
- '( #PCDATA )' by default.
--->
-<!ENTITY % NoRuby.content "( #PCDATA )" >
-
-<!-- one or more digits (NUMBER) -->
-<!ENTITY % Number.datatype "CDATA" >
-
-<!-- ruby element ...................................... -->
-
-<!ENTITY % ruby.element "INCLUDE" >
-<![%ruby.element;[
-<!ENTITY % ruby.content
- "( %Ruby.content.simple; %Ruby.content.complex; )"
->
-<!ELEMENT %ruby.qname; %ruby.content; >
-<!-- end of ruby.element -->]]>
-
-<![%Ruby.complex;[
-<!-- rbc (ruby base component) element ................. -->
-
-<!ENTITY % rbc.element "INCLUDE" >
-<![%rbc.element;[
-<!ENTITY % rbc.content
- "(%rb.qname;)+"
->
-<!ELEMENT %rbc.qname; %rbc.content; >
-<!-- end of rbc.element -->]]>
-
-<!-- rtc (ruby text component) element ................. -->
-
-<!ENTITY % rtc.element "INCLUDE" >
-<![%rtc.element;[
-<!ENTITY % rtc.content
- "(%rt.qname;)+"
->
-<!ELEMENT %rtc.qname; %rtc.content; >
-<!-- end of rtc.element -->]]>
-]]>
-
-<!-- rb (ruby base) element ............................ -->
-
-<!ENTITY % rb.element "INCLUDE" >
-<![%rb.element;[
-<!-- %rb.content; uses %NoRuby.content; as its content model,
- which is '( #PCDATA )' by default. It may be overridden
- by other modules to allow other inline-level elements
- of its parent markup language, but it should not include
- ruby descendent elements.
--->
-<!ENTITY % rb.content "%NoRuby.content;" >
-<!ELEMENT %rb.qname; %rb.content; >
-<!-- end of rb.element -->]]>
-
-<!-- rt (ruby text) element ............................ -->
-
-<!ENTITY % rt.element "INCLUDE" >
-<![%rt.element;[
-<!-- %rt.content; uses %NoRuby.content; as its content model,
- which is '( #PCDATA )' by default. It may be overridden
- by other modules to allow other inline-level elements
- of its parent markup language, but it should not include
- ruby descendent elements.
--->
-<!ENTITY % rt.content "%NoRuby.content;" >
-
-<!ELEMENT %rt.qname; %rt.content; >
-<!-- end of rt.element -->]]>
-
-<!-- rbspan attribute is used for complex ruby only ...... -->
-<![%Ruby.complex;[
-<!ENTITY % rt.attlist "INCLUDE" >
-<![%rt.attlist;[
-<!ATTLIST %rt.qname;
- rbspan %Number.datatype; "1"
->
-<!-- end of rt.attlist -->]]>
-]]>
-
-<!-- rp (ruby parenthesis) element ..................... -->
-
-<![%Ruby.fallback;[
-<!ENTITY % rp.element "INCLUDE" >
-<![%rp.element;[
-<!ENTITY % rp.content
- "( #PCDATA )"
->
-<!ELEMENT %rp.qname; %rp.content; >
-<!-- end of rp.element -->]]>
-]]>
-
-<!-- Ruby Common Attributes
-
- The following optional ATTLIST declarations provide an easy way
- to define common attributes for ruby elements. These declarations
- are ignored by default.
-
- Ruby elements are intended to have common attributes of its
- parent markup language. For example, if a markup language defines
- common attributes as a parameter entity %attrs;, you may add
- those attributes by just declaring the following parameter entities
-
- <!ENTITY % Ruby.common.attlists "INCLUDE" >
- <!ENTITY % Ruby.common.attrib "%attrs;" >
-
- before including the Ruby module.
--->
-
-<!ENTITY % Ruby.common.attlists "IGNORE" >
-<![%Ruby.common.attlists;[
-<!ENTITY % Ruby.common.attrib "" >
-
-<!-- common attributes for ruby ........................ -->
-
-<!ENTITY % Ruby.common.attlist "INCLUDE" >
-<![%Ruby.common.attlist;[
-<!ATTLIST %ruby.qname;
- %Ruby.common.attrib;
->
-<!-- end of Ruby.common.attlist -->]]>
-
-<![%Ruby.complex;[
-<!-- common attributes for rbc ......................... -->
-
-<!ENTITY % Rbc.common.attlist "INCLUDE" >
-<![%Rbc.common.attlist;[
-<!ATTLIST %rbc.qname;
- %Ruby.common.attrib;
->
-<!-- end of Rbc.common.attlist -->]]>
-
-<!-- common attributes for rtc ......................... -->
-
-<!ENTITY % Rtc.common.attlist "INCLUDE" >
-<![%Rtc.common.attlist;[
-<!ATTLIST %rtc.qname;
- %Ruby.common.attrib;
->
-<!-- end of Rtc.common.attlist -->]]>
-]]>
-
-<!-- common attributes for rb .......................... -->
-
-<!ENTITY % Rb.common.attlist "INCLUDE" >
-<![%Rb.common.attlist;[
-<!ATTLIST %rb.qname;
- %Ruby.common.attrib;
->
-<!-- end of Rb.common.attlist -->]]>
-
-<!-- common attributes for rt .......................... -->
-
-<!ENTITY % Rt.common.attlist "INCLUDE" >
-<![%Rt.common.attlist;[
-<!ATTLIST %rt.qname;
- %Ruby.common.attrib;
->
-<!-- end of Rt.common.attlist -->]]>
-
-<![%Ruby.fallback;[
-<!-- common attributes for rp .......................... -->
-
-<!ENTITY % Rp.common.attlist "INCLUDE" >
-<![%Rp.common.attlist;[
-<!ATTLIST %rp.qname;
- %Ruby.common.attrib;
->
-<!-- end of Rp.common.attlist -->]]>
-]]>
-]]>
-
-<!-- end of xhtml-ruby-1.mod -->
-]]>
-
-<!-- Presentation Module ........................................ -->
-<!ENTITY % xhtml-pres.module "INCLUDE" >
-<![%xhtml-pres.module;[
-<!ENTITY % xhtml-pres.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-pres-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Presentation Module ............................................ -->
-<!-- file: xhtml-pres-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-pres-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Presentational Elements
-
- This module defines elements and their attributes for
- simple presentation-related markup.
--->
-
-<!ENTITY % xhtml-inlpres.module "INCLUDE" >
-<![%xhtml-inlpres.module;[
-<!ENTITY % xhtml-inlpres.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
- "xhtml-inlpres-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Inline Presentation Module .................................... -->
-<!-- file: xhtml-inlpres-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlpres-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Inline Presentational Elements
-
- b, big, i, small, sub, sup, tt
-
- This module declares the elements and their attributes used to
- support inline-level presentational markup.
--->
-
-<!ENTITY % b.element "INCLUDE" >
-<![%b.element;[
-<!ENTITY % b.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % b.qname "b" >
-<!ELEMENT %b.qname; %b.content; >
-<!-- end of b.element -->]]>
-
-<!ENTITY % b.attlist "INCLUDE" >
-<![%b.attlist;[
-<!ATTLIST %b.qname;
- %Common.attrib;
->
-<!-- end of b.attlist -->]]>
-
-<!ENTITY % big.element "INCLUDE" >
-<![%big.element;[
-<!ENTITY % big.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % big.qname "big" >
-<!ELEMENT %big.qname; %big.content; >
-<!-- end of big.element -->]]>
-
-<!ENTITY % big.attlist "INCLUDE" >
-<![%big.attlist;[
-<!ATTLIST %big.qname;
- %Common.attrib;
->
-<!-- end of big.attlist -->]]>
-
-<!ENTITY % i.element "INCLUDE" >
-<![%i.element;[
-<!ENTITY % i.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % i.qname "i" >
-<!ELEMENT %i.qname; %i.content; >
-<!-- end of i.element -->]]>
-
-<!ENTITY % i.attlist "INCLUDE" >
-<![%i.attlist;[
-<!ATTLIST %i.qname;
- %Common.attrib;
->
-<!-- end of i.attlist -->]]>
-
-<!ENTITY % small.element "INCLUDE" >
-<![%small.element;[
-<!ENTITY % small.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % small.qname "small" >
-<!ELEMENT %small.qname; %small.content; >
-<!-- end of small.element -->]]>
-
-<!ENTITY % small.attlist "INCLUDE" >
-<![%small.attlist;[
-<!ATTLIST %small.qname;
- %Common.attrib;
->
-<!-- end of small.attlist -->]]>
-
-<!ENTITY % sub.element "INCLUDE" >
-<![%sub.element;[
-<!ENTITY % sub.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % sub.qname "sub" >
-<!ELEMENT %sub.qname; %sub.content; >
-<!-- end of sub.element -->]]>
-
-<!ENTITY % sub.attlist "INCLUDE" >
-<![%sub.attlist;[
-<!ATTLIST %sub.qname;
- %Common.attrib;
->
-<!-- end of sub.attlist -->]]>
-
-<!ENTITY % sup.element "INCLUDE" >
-<![%sup.element;[
-<!ENTITY % sup.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % sup.qname "sup" >
-<!ELEMENT %sup.qname; %sup.content; >
-<!-- end of sup.element -->]]>
-
-<!ENTITY % sup.attlist "INCLUDE" >
-<![%sup.attlist;[
-<!ATTLIST %sup.qname;
- %Common.attrib;
->
-<!-- end of sup.attlist -->]]>
-
-<!ENTITY % tt.element "INCLUDE" >
-<![%tt.element;[
-<!ENTITY % tt.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ENTITY % tt.qname "tt" >
-<!ELEMENT %tt.qname; %tt.content; >
-<!-- end of tt.element -->]]>
-
-<!ENTITY % tt.attlist "INCLUDE" >
-<![%tt.attlist;[
-<!ATTLIST %tt.qname;
- %Common.attrib;
->
-<!-- end of tt.attlist -->]]>
-
-<!-- end of xhtml-inlpres-1.mod -->
-]]>
-
-<!ENTITY % xhtml-blkpres.module "INCLUDE" >
-<![%xhtml-blkpres.module;[
-<!ENTITY % xhtml-blkpres.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
- "xhtml-blkpres-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Block Presentation Module ..................................... -->
-<!-- file: xhtml-blkpres-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkpres-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Block Presentational Elements
-
- hr
-
- This module declares the elements and their attributes used to
- support block-level presentational markup.
--->
-
-<!ENTITY % hr.element "INCLUDE" >
-<![%hr.element;[
-<!ENTITY % hr.content "EMPTY" >
-<!ENTITY % hr.qname "hr" >
-<!ELEMENT %hr.qname; %hr.content; >
-<!-- end of hr.element -->]]>
-
-<!ENTITY % hr.attlist "INCLUDE" >
-<![%hr.attlist;[
-<!ATTLIST %hr.qname;
- %Common.attrib;
->
-<!-- end of hr.attlist -->]]>
-
-<!-- end of xhtml-blkpres-1.mod -->
-]]>
-
-<!-- end of xhtml-pres-1.mod -->
-]]>
-
-<!-- Link Element Module ........................................ -->
-<!ENTITY % xhtml-link.module "INCLUDE" >
-<![%xhtml-link.module;[
-<!ENTITY % xhtml-link.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Link Element Module ........................................... -->
-<!-- file: xhtml-link-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Link element
-
- link
-
- This module declares the link element type and its attributes,
- which could (in principle) be used to define document-level links
- to external resources such as:
-
- a) for document specific toolbars/menus, e.g. start, contents,
- previous, next, index, end, help
- b) to link to a separate style sheet (rel="stylesheet")
- c) to make a link to a script (rel="script")
- d) by stylesheets to control how collections of html nodes are
- rendered into printed documents
- e) to make a link to a printable version of this document
- e.g. a postscript or pdf version (rel="alternate" media="print")
--->
-
-<!-- link: Media-Independent Link ...................... -->
-
-<!ENTITY % link.element "INCLUDE" >
-<![%link.element;[
-<!ENTITY % link.content "EMPTY" >
-<!ENTITY % link.qname "link" >
-<!ELEMENT %link.qname; %link.content; >
-<!-- end of link.element -->]]>
-
-<!ENTITY % link.attlist "INCLUDE" >
-<![%link.attlist;[
-<!ATTLIST %link.qname;
- %Common.attrib;
- charset %Charset.datatype; #IMPLIED
- href %URI.datatype; #IMPLIED
- hreflang %LanguageCode.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- rel %LinkTypes.datatype; #IMPLIED
- rev %LinkTypes.datatype; #IMPLIED
- media %MediaDesc.datatype; #IMPLIED
->
-<!-- end of link.attlist -->]]>
-
-<!-- end of xhtml-link-1.mod -->
-]]>
-
-<!-- Document Metainformation Module ............................ -->
-<!ENTITY % xhtml-meta.module "INCLUDE" >
-<![%xhtml-meta.module;[
-<!ENTITY % xhtml-meta.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Document Metainformation Module ............................... -->
-<!-- file: xhtml-meta-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Meta Information
-
- meta
-
- This module declares the meta element type and its attributes,
- used to provide declarative document metainformation.
--->
-
-<!-- meta: Generic Metainformation ..................... -->
-
-<!ENTITY % meta.element "INCLUDE" >
-<![%meta.element;[
-<!ENTITY % meta.content "EMPTY" >
-<!ENTITY % meta.qname "meta" >
-<!ELEMENT %meta.qname; %meta.content; >
-<!-- end of meta.element -->]]>
-
-<!ENTITY % meta.attlist "INCLUDE" >
-<![%meta.attlist;[
-<!ATTLIST %meta.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- http-equiv NMTOKEN #IMPLIED
- name NMTOKEN #IMPLIED
- content CDATA #REQUIRED
- scheme CDATA #IMPLIED
->
-<!-- end of meta.attlist -->]]>
-
-<!-- end of xhtml-meta-1.mod -->
-]]>
-
-<!-- Base Element Module ........................................ -->
-<!ENTITY % xhtml-base.module "INCLUDE" >
-<![%xhtml-base.module;[
-<!ENTITY % xhtml-base.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Base Element Module ........................................... -->
-<!-- file: xhtml-base-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Base element
-
- base
-
- This module declares the base element type and its attributes,
- used to define a base URI against which relative URIs in the
- document will be resolved.
-
- Note that this module also redeclares the content model for
- the head element to include the base element.
--->
-
-<!-- base: Document Base URI ........................... -->
-
-<!ENTITY % base.element "INCLUDE" >
-<![%base.element;[
-<!ENTITY % base.content "EMPTY" >
-<!ENTITY % base.qname "base" >
-<!ELEMENT %base.qname; %base.content; >
-<!-- end of base.element -->]]>
-
-<!ENTITY % base.attlist "INCLUDE" >
-<![%base.attlist;[
-<!ATTLIST %base.qname;
- %XHTML.xmlns.attrib;
- href %URI.datatype; #REQUIRED
->
-<!-- end of base.attlist -->]]>
-
-<!ENTITY % head.content
- "( %HeadOpts.mix;,
- ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
- | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
->
-
-<!-- end of xhtml-base-1.mod -->
-]]>
-
-<!-- Scripting Module ........................................... -->
-<!ENTITY % xhtml-script.module "INCLUDE" >
-<![%xhtml-script.module;[
-<!ENTITY % xhtml-script.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-script-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Document Scripting Module ..................................... -->
-<!-- file: xhtml-script-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-script-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Scripting
-
- script, noscript
-
- This module declares element types and attributes used to provide
- support for executable scripts as well as an alternate content
- container where scripts are not supported.
--->
-
-<!-- script: Scripting Statement ....................... -->
-
-<!ENTITY % script.element "INCLUDE" >
-<![%script.element;[
-<!ENTITY % script.content "( #PCDATA )" >
-<!ENTITY % script.qname "script" >
-<!ELEMENT %script.qname; %script.content; >
-<!-- end of script.element -->]]>
-
-<!ENTITY % script.attlist "INCLUDE" >
-<![%script.attlist;[
-<!ATTLIST %script.qname;
- %XHTML.xmlns.attrib;
- charset %Charset.datatype; #IMPLIED
- type %ContentType.datatype; #REQUIRED
- src %URI.datatype; #IMPLIED
- defer ( defer ) #IMPLIED
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of script.attlist -->]]>
-
-<!-- noscript: No-Script Alternate Content ............. -->
-
-<!ENTITY % noscript.element "INCLUDE" >
-<![%noscript.element;[
-<!ENTITY % noscript.content
- "( %Block.mix; )+"
->
-<!ENTITY % noscript.qname "noscript" >
-<!ELEMENT %noscript.qname; %noscript.content; >
-<!-- end of noscript.element -->]]>
-
-<!ENTITY % noscript.attlist "INCLUDE" >
-<![%noscript.attlist;[
-<!ATTLIST %noscript.qname;
- %Common.attrib;
->
-<!-- end of noscript.attlist -->]]>
-
-<!-- end of xhtml-script-1.mod -->
-]]>
-
-<!-- Style Sheets Module ......................................... -->
-<!ENTITY % xhtml-style.module "INCLUDE" >
-<![%xhtml-style.module;[
-<!ENTITY % xhtml-style.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Document Style Sheet Module .................................... -->
-<!-- file: xhtml-style-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Style Sheets
-
- style
-
- This module declares the style element type and its attributes,
- used to embed stylesheet information in the document head element.
--->
-
-<!-- style: Style Sheet Information ..................... -->
-
-<!ENTITY % style.element "INCLUDE" >
-<![%style.element;[
-<!ENTITY % style.content "( #PCDATA )" >
-<!ENTITY % style.qname "style" >
-<!ELEMENT %style.qname; %style.content; >
-<!-- end of style.element -->]]>
-
-<!ENTITY % style.attlist "INCLUDE" >
-<![%style.attlist;[
-<!ATTLIST %style.qname;
- %XHTML.xmlns.attrib;
- %title.attrib;
- %I18n.attrib;
- type %ContentType.datatype; #REQUIRED
- media %MediaDesc.datatype; #IMPLIED
- xml:space ( preserve ) #FIXED 'preserve'
->
-<!-- end of style.attlist -->]]>
-
-<!-- end of xhtml-style-1.mod -->
-]]>
-
-<!-- Image Module ............................................... -->
-<!ENTITY % xhtml-image.module "INCLUDE" >
-<![%xhtml-image.module;[
-<!ENTITY % xhtml-image.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Images Module ................................................. -->
-<!-- file: xhtml-image-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Rovision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Images
-
- img
-
- This module provides markup to support basic image embedding.
--->
-
-<!-- To avoid problems with text-only UAs as well as to make
- image content understandable and navigable to users of
- non-visual UAs, you need to provide a description with
- the 'alt' attribute, and avoid server-side image maps.
--->
-
-<!ENTITY % img.element "INCLUDE" >
-<![%img.element;[
-<!ENTITY % img.content "EMPTY" >
-<!ENTITY % img.qname "img" >
-<!ELEMENT %img.qname; %img.content; >
-<!-- end of img.element -->]]>
-
-<!ENTITY % img.attlist "INCLUDE" >
-<![%img.attlist;[
-<!ATTLIST %img.qname;
- %Common.attrib;
- src %URI.datatype; #REQUIRED
- alt %Text.datatype; #REQUIRED
- longdesc %URI.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
->
-<!-- end of img.attlist -->]]>
-
-<!-- end of xhtml-image-1.mod -->
-]]>
-
-<!-- Client-side Image Map Module ............................... -->
-<!ENTITY % xhtml-csismap.module "INCLUDE" >
-<![%xhtml-csismap.module;[
-<!ENTITY % xhtml-csismap.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-csismap-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Client-side Image Map Module .................................. -->
-<!-- file: xhtml-csismap-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-csismap-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Client-side Image Maps
-
- area, map
-
- This module declares elements and attributes to support client-side
- image maps. This requires that the Image Module (or a module
- declaring the img element type) be included in the DTD.
-
- These can be placed in the same document or grouped in a
- separate document, although the latter isn't widely supported
--->
-
-<!ENTITY % area.element "INCLUDE" >
-<![%area.element;[
-<!ENTITY % area.content "EMPTY" >
-<!ENTITY % area.qname "area" >
-<!ELEMENT %area.qname; %area.content; >
-<!-- end of area.element -->]]>
-
-<!ENTITY % Shape.datatype "( rect | circle | poly | default )">
-<!ENTITY % Coords.datatype "CDATA" >
-
-<!ENTITY % area.attlist "INCLUDE" >
-<![%area.attlist;[
-<!ATTLIST %area.qname;
- %Common.attrib;
- href %URI.datatype; #IMPLIED
- shape %Shape.datatype; 'rect'
- coords %Coords.datatype; #IMPLIED
- nohref ( nohref ) #IMPLIED
- alt %Text.datatype; #REQUIRED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of area.attlist -->]]>
-
-<!-- modify anchor attribute definition list
- to allow for client-side image maps
--->
-<!ATTLIST %a.qname;
- shape %Shape.datatype; 'rect'
- coords %Coords.datatype; #IMPLIED
->
-
-<!-- modify img attribute definition list
- to allow for client-side image maps
--->
-<!ATTLIST %img.qname;
- usemap IDREF #IMPLIED
->
-
-<!-- modify form input attribute definition list
- to allow for client-side image maps
--->
-<!ATTLIST %input.qname;
- usemap IDREF #IMPLIED
->
-
-<!-- modify object attribute definition list
- to allow for client-side image maps
--->
-<!ATTLIST %object.qname;
- usemap IDREF #IMPLIED
->
-
-<!-- 'usemap' points to the 'id' attribute of a <map> element,
- which must be in the same document; support for external
- document maps was not widely supported in HTML and is
- eliminated in XHTML.
-
- It is considered an error for the element pointed to by
- a usemap IDREF to occur in anything but a <map> element.
--->
-
-<!ENTITY % map.element "INCLUDE" >
-<![%map.element;[
-<!ENTITY % map.content
- "(( %Block.mix; ) | %area.qname; )+"
->
-<!ENTITY % map.qname "map" >
-<!ELEMENT %map.qname; %map.content; >
-<!-- end of map.element -->]]>
-
-<!ENTITY % map.attlist "INCLUDE" >
-<![%map.attlist;[
-<!ATTLIST %map.qname;
- %XHTML.xmlns.attrib;
- id ID #REQUIRED
- %class.attrib;
- %title.attrib;
- %Core.extra.attrib;
- %I18n.attrib;
- %Events.attrib;
->
-<!-- end of map.attlist -->]]>
-
-<!-- end of xhtml-csismap-1.mod -->
-]]>
-
-<!-- Server-side Image Map Module ............................... -->
-<!ENTITY % xhtml-ssismap.module "INCLUDE" >
-<![%xhtml-ssismap.module;[
-<!ENTITY % xhtml-ssismap.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-ssismap-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Server-side Image Map Module .................................. -->
-<!-- file: xhtml-ssismap-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-ssismap-1.mod"
-
- Revisions:
-#2000-10-22: added declaration for 'ismap' on <input>
- ....................................................................... -->
-
-<!-- Server-side Image Maps
-
- This adds the 'ismap' attribute to the img and input elements
- to support server-side processing of a user selection.
--->
-
-<!ATTLIST %img.qname;
- ismap ( ismap ) #IMPLIED
->
-
-<!ATTLIST %input.qname;
- ismap ( ismap ) #IMPLIED
->
-
-<!-- end of xhtml-ssismap-1.mod -->
-]]>
-
-<!-- Param Element Module ....................................... -->
-<!ENTITY % xhtml-param.module "INCLUDE" >
-<![%xhtml-param.module;[
-<!ENTITY % xhtml-param.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Param Element Module ..................................... -->
-<!-- file: xhtml-param-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Parameters for Java Applets and Embedded Objects
-
- param
-
- This module provides declarations for the param element,
- used to provide named property values for the applet
- and object elements.
--->
-
-<!-- param: Named Property Value ....................... -->
-
-<!ENTITY % param.element "INCLUDE" >
-<![%param.element;[
-<!ENTITY % param.content "EMPTY" >
-<!ENTITY % param.qname "param" >
-<!ELEMENT %param.qname; %param.content; >
-<!-- end of param.element -->]]>
-
-<!ENTITY % param.attlist "INCLUDE" >
-<![%param.attlist;[
-<!ATTLIST %param.qname;
- %XHTML.xmlns.attrib;
- %id.attrib;
- name CDATA #REQUIRED
- value CDATA #IMPLIED
- valuetype ( data | ref | object ) 'data'
- type %ContentType.datatype; #IMPLIED
->
-<!-- end of param.attlist -->]]>
-
-<!-- end of xhtml-param-1.mod -->
-]]>
-
-<!-- Embedded Object Module ..................................... -->
-<!ENTITY % xhtml-object.module "INCLUDE" >
-<![%xhtml-object.module;[
-<!ENTITY % xhtml-object.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Embedded Object Module ........................................ -->
-<!-- file: xhtml-object-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Embedded Objects
-
- object
-
- This module declares the object element type and its attributes, used
- to embed external objects as part of XHTML pages. In the document,
- place param elements prior to other content within the object element.
-
- Note that use of this module requires instantiation of the Param
- Element Module.
--->
-
-<!-- object: Generic Embedded Object ................... -->
-
-<!ENTITY % object.element "INCLUDE" >
-<![%object.element;[
-<!ENTITY % object.content
- "( #PCDATA | %Flow.mix; | %param.qname; )*"
->
-<!ENTITY % object.qname "object" >
-<!ELEMENT %object.qname; %object.content; >
-<!-- end of object.element -->]]>
-
-<!ENTITY % object.attlist "INCLUDE" >
-<![%object.attlist;[
-<!ATTLIST %object.qname;
- %Common.attrib;
- declare ( declare ) #IMPLIED
- classid %URI.datatype; #IMPLIED
- codebase %URI.datatype; #IMPLIED
- data %URI.datatype; #IMPLIED
- type %ContentType.datatype; #IMPLIED
- codetype %ContentType.datatype; #IMPLIED
- archive %URIs.datatype; #IMPLIED
- standby %Text.datatype; #IMPLIED
- height %Length.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
- name CDATA #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of object.attlist -->]]>
-
-<!-- end of xhtml-object-1.mod -->
-]]>
-
-<!-- Tables Module ............................................... -->
-<!ENTITY % xhtml-table.module "INCLUDE" >
-<![%xhtml-table.module;[
-<!ENTITY % xhtml-table.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-table-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Table Module .................................................. -->
-<!-- file: xhtml-table-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-table-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Tables
-
- table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td
-
- This module declares element types and attributes used to provide
- table markup similar to HTML 4.0, including features that enable
- better accessibility for non-visual user agents.
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % table.qname "table" >
-<!ENTITY % caption.qname "caption" >
-<!ENTITY % thead.qname "thead" >
-<!ENTITY % tfoot.qname "tfoot" >
-<!ENTITY % tbody.qname "tbody" >
-<!ENTITY % colgroup.qname "colgroup" >
-<!ENTITY % col.qname "col" >
-<!ENTITY % tr.qname "tr" >
-<!ENTITY % th.qname "th" >
-<!ENTITY % td.qname "td" >
-
-<!-- The frame attribute specifies which parts of the frame around
- the table should be rendered. The values are not the same as
- CALS to avoid a name clash with the valign attribute.
--->
-<!ENTITY % frame.attrib
- "frame ( void
- | above
- | below
- | hsides
- | lhs
- | rhs
- | vsides
- | box
- | border ) #IMPLIED"
->
-
-<!-- The rules attribute defines which rules to draw between cells:
-
- If rules is absent then assume:
-
- "none" if border is absent or border="0" otherwise "all"
--->
-<!ENTITY % rules.attrib
- "rules ( none
- | groups
- | rows
- | cols
- | all ) #IMPLIED"
->
-
-<!-- horizontal alignment attributes for cell contents
--->
-<!ENTITY % CellHAlign.attrib
- "align ( left
- | center
- | right
- | justify
- | char ) #IMPLIED
- char %Character.datatype; #IMPLIED
- charoff %Length.datatype; #IMPLIED"
->
-
-<!-- vertical alignment attribute for cell contents
--->
-<!ENTITY % CellVAlign.attrib
- "valign ( top
- | middle
- | bottom
- | baseline ) #IMPLIED"
->
-
-<!-- scope is simpler than axes attribute for common tables
--->
-<!ENTITY % scope.attrib
- "scope ( row
- | col
- | rowgroup
- | colgroup ) #IMPLIED"
->
-
-<!-- table: Table Element .............................. -->
-
-<!ENTITY % table.element "INCLUDE" >
-<![%table.element;[
-<!ENTITY % table.content
- "( %caption.qname;?, ( %col.qname;* | %colgroup.qname;* ),
- (( %thead.qname;?, %tfoot.qname;?, %tbody.qname;+ ) | ( %tr.qname;+ )))"
->
-<!ELEMENT %table.qname; %table.content; >
-<!-- end of table.element -->]]>
-
-<!ENTITY % table.attlist "INCLUDE" >
-<![%table.attlist;[
-<!ATTLIST %table.qname;
- %Common.attrib;
- summary %Text.datatype; #IMPLIED
- width %Length.datatype; #IMPLIED
- border %Pixels.datatype; #IMPLIED
- %frame.attrib;
- %rules.attrib;
- cellspacing %Length.datatype; #IMPLIED
- cellpadding %Length.datatype; #IMPLIED
->
-<!-- end of table.attlist -->]]>
-
-<!-- caption: Table Caption ............................ -->
-
-<!ENTITY % caption.element "INCLUDE" >
-<![%caption.element;[
-<!ENTITY % caption.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %caption.qname; %caption.content; >
-<!-- end of caption.element -->]]>
-
-<!ENTITY % caption.attlist "INCLUDE" >
-<![%caption.attlist;[
-<!ATTLIST %caption.qname;
- %Common.attrib;
->
-<!-- end of caption.attlist -->]]>
-
-<!-- thead: Table Header ............................... -->
-
-<!-- Use thead to duplicate headers when breaking table
- across page boundaries, or for static headers when
- tbody sections are rendered in scrolling panel.
--->
-
-<!ENTITY % thead.element "INCLUDE" >
-<![%thead.element;[
-<!ENTITY % thead.content "( %tr.qname; )+" >
-<!ELEMENT %thead.qname; %thead.content; >
-<!-- end of thead.element -->]]>
-
-<!ENTITY % thead.attlist "INCLUDE" >
-<![%thead.attlist;[
-<!ATTLIST %thead.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of thead.attlist -->]]>
-
-<!-- tfoot: Table Footer ............................... -->
-
-<!-- Use tfoot to duplicate footers when breaking table
- across page boundaries, or for static footers when
- tbody sections are rendered in scrolling panel.
--->
-
-<!ENTITY % tfoot.element "INCLUDE" >
-<![%tfoot.element;[
-<!ENTITY % tfoot.content "( %tr.qname; )+" >
-<!ELEMENT %tfoot.qname; %tfoot.content; >
-<!-- end of tfoot.element -->]]>
-
-<!ENTITY % tfoot.attlist "INCLUDE" >
-<![%tfoot.attlist;[
-<!ATTLIST %tfoot.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of tfoot.attlist -->]]>
-
-<!-- tbody: Table Body ................................. -->
-
-<!-- Use multiple tbody sections when rules are needed
- between groups of table rows.
--->
-
-<!ENTITY % tbody.element "INCLUDE" >
-<![%tbody.element;[
-<!ENTITY % tbody.content "( %tr.qname; )+" >
-<!ELEMENT %tbody.qname; %tbody.content; >
-<!-- end of tbody.element -->]]>
-
-<!ENTITY % tbody.attlist "INCLUDE" >
-<![%tbody.attlist;[
-<!ATTLIST %tbody.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of tbody.attlist -->]]>
-
-<!-- colgroup: Table Column Group ...................... -->
-
-<!-- colgroup groups a set of col elements. It allows you
- to group several semantically-related columns together.
--->
-
-<!ENTITY % colgroup.element "INCLUDE" >
-<![%colgroup.element;[
-<!ENTITY % colgroup.content "( %col.qname; )*" >
-<!ELEMENT %colgroup.qname; %colgroup.content; >
-<!-- end of colgroup.element -->]]>
-
-<!ENTITY % colgroup.attlist "INCLUDE" >
-<![%colgroup.attlist;[
-<!ATTLIST %colgroup.qname;
- %Common.attrib;
- span %Number.datatype; '1'
- width %MultiLength.datatype; #IMPLIED
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of colgroup.attlist -->]]>
-
-<!-- col: Table Column ................................. -->
-
-<!-- col elements define the alignment properties for
- cells in one or more columns.
-
- The width attribute specifies the width of the
- columns, e.g.
-
- width="64" width in screen pixels
- width="0.5*" relative width of 0.5
-
- The span attribute causes the attributes of one
- col element to apply to more than one column.
--->
-
-<!ENTITY % col.element "INCLUDE" >
-<![%col.element;[
-<!ENTITY % col.content "EMPTY" >
-<!ELEMENT %col.qname; %col.content; >
-<!-- end of col.element -->]]>
-
-<!ENTITY % col.attlist "INCLUDE" >
-<![%col.attlist;[
-<!ATTLIST %col.qname;
- %Common.attrib;
- span %Number.datatype; '1'
- width %MultiLength.datatype; #IMPLIED
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of col.attlist -->]]>
-
-<!-- tr: Table Row ..................................... -->
-
-<!ENTITY % tr.element "INCLUDE" >
-<![%tr.element;[
-<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" >
-<!ELEMENT %tr.qname; %tr.content; >
-<!-- end of tr.element -->]]>
-
-<!ENTITY % tr.attlist "INCLUDE" >
-<![%tr.attlist;[
-<!ATTLIST %tr.qname;
- %Common.attrib;
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of tr.attlist -->]]>
-
-<!-- th: Table Header Cell ............................. -->
-
-<!-- th is for header cells, td for data,
- but for cells acting as both use td
--->
-
-<!ENTITY % th.element "INCLUDE" >
-<![%th.element;[
-<!ENTITY % th.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %th.qname; %th.content; >
-<!-- end of th.element -->]]>
-
-<!ENTITY % th.attlist "INCLUDE" >
-<![%th.attlist;[
-<!ATTLIST %th.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of th.attlist -->]]>
-
-<!-- td: Table Data Cell ............................... -->
-
-<!ENTITY % td.element "INCLUDE" >
-<![%td.element;[
-<!ENTITY % td.content
- "( #PCDATA | %Flow.mix; )*"
->
-<!ELEMENT %td.qname; %td.content; >
-<!-- end of td.element -->]]>
-
-<!ENTITY % td.attlist "INCLUDE" >
-<![%td.attlist;[
-<!ATTLIST %td.qname;
- %Common.attrib;
- abbr %Text.datatype; #IMPLIED
- axis CDATA #IMPLIED
- headers IDREFS #IMPLIED
- %scope.attrib;
- rowspan %Number.datatype; '1'
- colspan %Number.datatype; '1'
- %CellHAlign.attrib;
- %CellVAlign.attrib;
->
-<!-- end of td.attlist -->]]>
-
-<!-- end of xhtml-table-1.mod -->
-]]>
-
-<!-- Forms Module ............................................... -->
-<!ENTITY % xhtml-form.module "INCLUDE" >
-<![%xhtml-form.module;[
-<!ENTITY % xhtml-form.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-form-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Forms Module .................................................. -->
-<!-- file: xhtml-form-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-form-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Forms
-
- form, label, input, select, optgroup, option,
- textarea, fieldset, legend, button
-
- This module declares markup to provide support for online
- forms, based on the features found in HTML 4.0 forms.
--->
-
-<!-- declare qualified element type names:
--->
-<!ENTITY % form.qname "form" >
-<!ENTITY % label.qname "label" >
-<!ENTITY % input.qname "input" >
-<!ENTITY % select.qname "select" >
-<!ENTITY % optgroup.qname "optgroup" >
-<!ENTITY % option.qname "option" >
-<!ENTITY % textarea.qname "textarea" >
-<!ENTITY % fieldset.qname "fieldset" >
-<!ENTITY % legend.qname "legend" >
-<!ENTITY % button.qname "button" >
-
-<!-- %BlkNoForm.mix; includes all non-form block elements,
- plus %Misc.class;
--->
-<!ENTITY % BlkNoForm.mix
- "%Heading.class;
- | %List.class;
- | %BlkStruct.class;
- %BlkPhras.class;
- %BlkPres.class;
- %Table.class;
- %Block.extra;
- %Misc.class;"
->
-
-<!-- form: Form Element ................................ -->
-
-<!ENTITY % form.element "INCLUDE" >
-<![%form.element;[
-<!ENTITY % form.content
- "( %BlkNoForm.mix;
- | %fieldset.qname; )+"
->
-<!ELEMENT %form.qname; %form.content; >
-<!-- end of form.element -->]]>
-
-<!ENTITY % form.attlist "INCLUDE" >
-<![%form.attlist;[
-<!ATTLIST %form.qname;
- %Common.attrib;
- action %URI.datatype; #REQUIRED
- method ( get | post ) 'get'
- enctype %ContentType.datatype; 'application/x-www-form-urlencoded'
- accept-charset %Charsets.datatype; #IMPLIED
- accept %ContentTypes.datatype; #IMPLIED
->
-<!-- end of form.attlist -->]]>
-
-<!-- label: Form Field Label Text ...................... -->
-
-<!-- Each label must not contain more than ONE field
--->
-
-<!ENTITY % label.element "INCLUDE" >
-<![%label.element;[
-<!ENTITY % label.content
- "( #PCDATA
- | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
- | %InlStruct.class;
- %InlPhras.class;
- %I18n.class;
- %InlPres.class;
- %Anchor.class;
- %InlSpecial.class;
- %Inline.extra;
- %Misc.class; )*"
->
-<!ELEMENT %label.qname; %label.content; >
-<!-- end of label.element -->]]>
-
-<!ENTITY % label.attlist "INCLUDE" >
-<![%label.attlist;[
-<!ATTLIST %label.qname;
- %Common.attrib;
- for IDREF #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of label.attlist -->]]>
-
-<!-- input: Form Control ............................... -->
-
-<!ENTITY % input.element "INCLUDE" >
-<![%input.element;[
-<!ENTITY % input.content "EMPTY" >
-<!ELEMENT %input.qname; %input.content; >
-<!-- end of input.element -->]]>
-
-<!ENTITY % input.attlist "INCLUDE" >
-<![%input.attlist;[
-<!ENTITY % InputType.class
- "( text | password | checkbox | radio | submit
- | reset | file | hidden | image | button )"
->
-<!-- attribute 'name' required for all but submit & reset
--->
-<!ATTLIST %input.qname;
- %Common.attrib;
- type %InputType.class; 'text'
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- checked ( checked ) #IMPLIED
- disabled ( disabled ) #IMPLIED
- readonly ( readonly ) #IMPLIED
- size %Number.datatype; #IMPLIED
- maxlength %Number.datatype; #IMPLIED
- src %URI.datatype; #IMPLIED
- alt %Text.datatype; #IMPLIED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
- accept %ContentTypes.datatype; #IMPLIED
->
-<!-- end of input.attlist -->]]>
-
-<!-- select: Option Selector ........................... -->
-
-<!ENTITY % select.element "INCLUDE" >
-<![%select.element;[
-<!ENTITY % select.content
- "( %optgroup.qname; | %option.qname; )+"
->
-<!ELEMENT %select.qname; %select.content; >
-<!-- end of select.element -->]]>
-
-<!ENTITY % select.attlist "INCLUDE" >
-<![%select.attlist;[
-<!ATTLIST %select.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- size %Number.datatype; #IMPLIED
- multiple ( multiple ) #IMPLIED
- disabled ( disabled ) #IMPLIED
- tabindex %Number.datatype; #IMPLIED
->
-<!-- end of select.attlist -->]]>
-
-<!-- optgroup: Option Group ............................ -->
-
-<!ENTITY % optgroup.element "INCLUDE" >
-<![%optgroup.element;[
-<!ENTITY % optgroup.content "( %option.qname; )+" >
-<!ELEMENT %optgroup.qname; %optgroup.content; >
-<!-- end of optgroup.element -->]]>
-
-<!ENTITY % optgroup.attlist "INCLUDE" >
-<![%optgroup.attlist;[
-<!ATTLIST %optgroup.qname;
- %Common.attrib;
- disabled ( disabled ) #IMPLIED
- label %Text.datatype; #REQUIRED
->
-<!-- end of optgroup.attlist -->]]>
-
-<!-- option: Selectable Choice ......................... -->
-
-<!ENTITY % option.element "INCLUDE" >
-<![%option.element;[
-<!ENTITY % option.content "( #PCDATA )" >
-<!ELEMENT %option.qname; %option.content; >
-<!-- end of option.element -->]]>
-
-<!ENTITY % option.attlist "INCLUDE" >
-<![%option.attlist;[
-<!ATTLIST %option.qname;
- %Common.attrib;
- selected ( selected ) #IMPLIED
- disabled ( disabled ) #IMPLIED
- label %Text.datatype; #IMPLIED
- value CDATA #IMPLIED
->
-<!-- end of option.attlist -->]]>
-
-<!-- textarea: Multi-Line Text Field ................... -->
-
-<!ENTITY % textarea.element "INCLUDE" >
-<![%textarea.element;[
-<!ENTITY % textarea.content "( #PCDATA )" >
-<!ELEMENT %textarea.qname; %textarea.content; >
-<!-- end of textarea.element -->]]>
-
-<!ENTITY % textarea.attlist "INCLUDE" >
-<![%textarea.attlist;[
-<!ATTLIST %textarea.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- rows %Number.datatype; #REQUIRED
- cols %Number.datatype; #REQUIRED
- disabled ( disabled ) #IMPLIED
- readonly ( readonly ) #IMPLIED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of textarea.attlist -->]]>
-
-<!-- fieldset: Form Control Group ...................... -->
-
-<!-- #PCDATA is to solve the mixed content problem,
- per specification only whitespace is allowed
--->
-
-<!ENTITY % fieldset.element "INCLUDE" >
-<![%fieldset.element;[
-<!ENTITY % fieldset.content
- "( #PCDATA | %legend.qname; | %Flow.mix; )*"
->
-<!ELEMENT %fieldset.qname; %fieldset.content; >
-<!-- end of fieldset.element -->]]>
-
-<!ENTITY % fieldset.attlist "INCLUDE" >
-<![%fieldset.attlist;[
-<!ATTLIST %fieldset.qname;
- %Common.attrib;
->
-<!-- end of fieldset.attlist -->]]>
-
-<!-- legend: Fieldset Legend ........................... -->
-
-<!ENTITY % legend.element "INCLUDE" >
-<![%legend.element;[
-<!ENTITY % legend.content
- "( #PCDATA | %Inline.mix; )*"
->
-<!ELEMENT %legend.qname; %legend.content; >
-<!-- end of legend.element -->]]>
-
-<!ENTITY % legend.attlist "INCLUDE" >
-<![%legend.attlist;[
-<!ATTLIST %legend.qname;
- %Common.attrib;
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of legend.attlist -->]]>
-
-<!-- button: Push Button ............................... -->
-
-<!ENTITY % button.element "INCLUDE" >
-<![%button.element;[
-<!ENTITY % button.content
- "( #PCDATA
- | %BlkNoForm.mix;
- | %InlStruct.class;
- %InlPhras.class;
- %InlPres.class;
- %I18n.class;
- %InlSpecial.class;
- %Inline.extra; )*"
->
-<!ELEMENT %button.qname; %button.content; >
-<!-- end of button.element -->]]>
-
-<!ENTITY % button.attlist "INCLUDE" >
-<![%button.attlist;[
-<!ATTLIST %button.qname;
- %Common.attrib;
- name CDATA #IMPLIED
- value CDATA #IMPLIED
- type ( button | submit | reset ) 'submit'
- disabled ( disabled ) #IMPLIED
- tabindex %Number.datatype; #IMPLIED
- accesskey %Character.datatype; #IMPLIED
->
-<!-- end of button.attlist -->]]>
-
-<!-- end of xhtml-form-1.mod -->
-]]>
-
-<!-- Legacy Markup ............................................... -->
-<!ENTITY % xhtml-legacy.module "IGNORE" >
-<![%xhtml-legacy.module;[
-<!ENTITY % xhtml-legacy.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-legacy-1.mod" >
-%xhtml-legacy.mod;]]>
-
-<!-- Document Structure Module (required) ....................... -->
-<!ENTITY % xhtml-struct.module "INCLUDE" >
-<![%xhtml-struct.module;[
-<!ENTITY % xhtml-struct.mod
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod" >
-<!-- ...................................................................... -->
-<!-- XHTML Structure Module .............................................. -->
-<!-- file: xhtml-struct-1.mod
-
- This is XHTML, a reformulation of HTML as a modular XML application.
- Copyright 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
- Revision: $Id: xhtml11-flat.dtd,v 1.1 2007/05/15 02:42:22 david_williams Exp $ SMI
-
- This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
- PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
- SYSTEM "http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod"
-
- Revisions:
- (none)
- ....................................................................... -->
-
-<!-- Document Structure
-
- title, head, body, html
-
- The Structure Module defines the major structural elements and
- their attributes.
-
- Note that the content model of the head element type is redeclared
- when the Base Module is included in the DTD.
-
- The parameter entity containing the XML namespace URI value used
- for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
--->
-
-<!-- title: Document Title ............................. -->
-
-<!-- The title element is not considered part of the flow of text.
- It should be displayed, for example as the page header or
- window title. Exactly one title is required per document.
--->
-
-<!ENTITY % title.element "INCLUDE" >
-<![%title.element;[
-<!ENTITY % title.content "( #PCDATA )" >
-<!ENTITY % title.qname "title" >
-<!ELEMENT %title.qname; %title.content; >
-<!-- end of title.element -->]]>
-
-<!ENTITY % title.attlist "INCLUDE" >
-<![%title.attlist;[
-<!ATTLIST %title.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
->
-<!-- end of title.attlist -->]]>
-
-<!-- head: Document Head ............................... -->
-
-<!ENTITY % head.element "INCLUDE" >
-<![%head.element;[
-<!ENTITY % head.content
- "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
->
-<!ENTITY % head.qname "head" >
-<!ELEMENT %head.qname; %head.content; >
-<!-- end of head.element -->]]>
-
-<!ENTITY % head.attlist "INCLUDE" >
-<![%head.attlist;[
-<!-- reserved for future use with document profiles
--->
-<!ENTITY % profile.attrib
- "profile %URI.datatype; '%XHTML.profile;'"
->
-
-<!ATTLIST %head.qname;
- %XHTML.xmlns.attrib;
- %I18n.attrib;
- %profile.attrib;
->
-<!-- end of head.attlist -->]]>
-
-<!-- body: Document Body ............................... -->
-
-<!ENTITY % body.element "INCLUDE" >
-<![%body.element;[
-<!ENTITY % body.content
- "( %Block.mix; )+"
->
-<!ENTITY % body.qname "body" >
-<!ELEMENT %body.qname; %body.content; >
-<!-- end of body.element -->]]>
-
-<!ENTITY % body.attlist "INCLUDE" >
-<![%body.attlist;[
-<!ATTLIST %body.qname;
- %Common.attrib;
->
-<!-- end of body.attlist -->]]>
-
-<!-- html: XHTML Document Element ...................... -->
-
-<!ENTITY % html.element "INCLUDE" >
-<![%html.element;[
-<!ENTITY % html.content "( %head.qname;, %body.qname; )" >
-<!ENTITY % html.qname "html" >
-<!ELEMENT %html.qname; %html.content; >
-<!-- end of html.element -->]]>
-
-<!ENTITY % html.attlist "INCLUDE" >
-<![%html.attlist;[
-<!-- version attribute value defined in driver
--->
-<!ENTITY % XHTML.version.attrib
- "version %FPI.datatype; #FIXED '%XHTML.version;'"
->
-
-<!-- see the Qualified Names module for information
- on how to extend XHTML using XML namespaces
--->
-<!ATTLIST %html.qname;
- %XHTML.xmlns.attrib;
- %XHTML.version.attrib;
- %I18n.attrib;
->
-<!-- end of html.attlist -->]]>
-
-<!-- end of xhtml-struct-1.mod -->
-]]>
-
-<!-- end of XHTML 1.1 DTD ................................................. -->
-<!-- ....................................................................... -->
diff --git a/bundles/org.eclipse.wst.standard.schemas/plugin.properties b/bundles/org.eclipse.wst.standard.schemas/plugin.properties
deleted file mode 100644
index f34570bd49..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/plugin.properties
+++ /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
-###############################################################################
-
-documentType.displayName.0 = XHTML 1.0 Strict
-documentType.displayName.1 = XHTML 1.0 Transitional
-documentType.displayName.2 = XHTML 1.0 Frameset
-documentType.displayName.3 = XHTML Basic 1.0
-documentType.displayName.4 = XHTML 1.1
-documentType.displayName.5 = XHTML MP 1.0
-documentType.displayName.6 = WML 1.3
-Bundle-Name.0 = Standard Schemas and DTDs
-Bundle-Vendor.0 = Eclipse Web Tools Platform \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/plugin.xml b/bundles/org.eclipse.wst.standard.schemas/plugin.xml
deleted file mode 100644
index 38ed82d6c4..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/plugin.xml
+++ /dev/null
@@ -1,222 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
- <!--==========================================-->
- <!-- Catalog Contributions -->
- <!-- Register well known Web DTDs and XSDs -->
- <!--==========================================-->
-
- <!-- new form -->
-
- <!--
- See https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
- you may have to comment out following extension if used
- in development environment.
-
- -->
-
- <extension point="org.eclipse.wst.xml.core.catalogContributions">
- <catalogContribution id="default">
-
-
- <public
- publicId="-//WAPFORUM//DTD WML 1.1//EN"
- uri="dtds/wml11.dtd">
- </public>
-
- <public
- publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
- uri="dtds/xhtml1-strict.dtd"
- webURL="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- </public>
-
- <public
- publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
- uri="dtds/xhtml1-transitional.dtd"
- webURL="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- </public>
- <public
- publicId="-//W3C//DTD XHTML 1.0 Frameset//EN"
- uri="dtds/xhtml1-frameset.dtd"
- webURL="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- </public>
-
- <public
- publicId="-//W3C//DTD XHTML Basic 1.0//EN"
- uri="dtds/xhtml-basic10-f.dtd"
- webURL="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
- </public>
-
- <public
- publicId="-//W3C//DTD XHTML 1.1//EN"
- uri="dtds/xhtml11-flat.dtd"
- webURL="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- </public>
-
- <public
- publicId="-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- uri="dtds/xhtml-mobile10-flat.dtd"
- webURL="http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
- </public>
-
- <public
- publicId="-//WAPFORUM//DTD WML 1.3//EN"
- uri="dtds/wml13.dtd"
- webURL="http://www.wapforum.org/DTD/wml13.dtd">
- </public>
-
-
- <public
- publicId="-//W3C//DTD HTML 4.01 Frameset//EN"
- uri="dtds/frameset.dtd"
- webURL="http://www.w3.org/TR/html4/frameset.dtd">
- </public>
-
- <public
- publicId="-//W3C//ENTITIES Latin 1//EN//HTML"
- uri="dtds/HTMLlat1.ent"
- webURL="HTMLlat1.ent">
- </public>
-
- <public
- publicId="-//W3C//ENTITIES Special//EN//HTM"
- uri="dtds/HTMLspecial.ent"
- webURL="HTMLspecial.ent">
- </public>
-
- <public
- publicId="-//W3C//ENTITIES Symbols//EN//HTML"
- uri="dtds/HTMLsymbol.ent"
- webURL="HTMLsymbol.ent">
- </public>
-
- <public
- publicId="-//W3C//DTD HTML 4.01 Transitional//EN"
- uri="dtds/loose.dtd"
- webURL="http://www.w3.org/TR/html4/loose.dtd">
- </public>
-
- <public
- publicId="-//W3C//DTD HTML 4.01//EN"
- uri="dtds/strict.dtd"
- webURL="http://www.w3.org/TR/html4/strict.dtd">
- </public>
-
- <uri
- name="http://schemas.xmlsoap.org/wsdl/"
- uri="xsd/wsdl.xsd" />
- <uri
- name="http://schemas.xmlsoap.org/wsdl/soap/"
- uri="xsd/soap.xsd" />
- <uri
- name="http://schemas.xmlsoap.org/wsdl/http/"
- uri="xsd/http.xsd" />
- <uri
- name="http://schemas.xmlsoap.org/wsdl/mime/"
- uri="xsd/wsdl-mime.xsd" />
- <uri
- name="http://schemas.xmlsoap.org/soap/encoding/"
- uri="xsd/soapenc.xsd" />
- <uri
- name="http://schemas.xmlsoap.org/soap/envelope/"
- uri="xsd/soapenv.xsd" />
- <uri
- name="urn:oasis:names:tc:entity:xmlns:xml:catalog"
- uri="xsd/xmlcatalog11.xsd" />
- <uri
- name="http://www.w3.org/TR/html4/loose.dtd"
- uri="dtds/loose.dtd"/>
- <uri
- name="http://www.w3.org/TR/html4/strict.dtd"
- uri="dtds/strict.dtd"/>
-
-
- <!-- these are removed from the catalog, since they are -not-
- the same as those in the xsd.ui plugin, which
- point to the org.eclipse.xsd versions
- <uri
- name="http://www.w3.org/2001/XMLSchema"
- uri="dtdsAndSchemas/XMLSchema.dtd" />
-
- <system
- systemId="http://www.w3.org/2001/xml.xsd"
- uri="dtdsAndSchemas/xml.xsd" />
- -->
- </catalogContribution>
-
- </extension>
-
-
-
-
- <extension point="org.eclipse.wst.sse.core.documentTypes">
- <documentType
- elementName="html"
- displayName="%documentType.displayName.0"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Strict//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="%documentType.displayName.1"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Transitional//EN"
- defaultXHTML="true"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="%documentType.displayName.2"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="true"
- publicID="-//W3C//DTD XHTML 1.0 Frameset//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="%documentType.displayName.3"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML Basic 1.0//EN"
- systemID="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="%documentType.displayName.4"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.1//EN"
- systemID="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="%documentType.displayName.5"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- systemID="http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
- </documentType>
- <documentType
- elementName="wml"
- displayName="%documentType.displayName.6"
- namespaceURI=""
- isWML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD WML 1.3//EN"
- defaultWML="true"
- systemID="http://www.wapforum.org/DTD/wml13.dtd">
- </documentType>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/http.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/http.xsd
deleted file mode 100644
index d9466f6c1e..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/http.xsd
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
-All Rights Reserved
-
-License for WSDL Schema Files
-
-The Authors grant permission to copy and distribute the WSDL Schema
-Files in any medium without fee or royalty as long as this notice and
-license are distributed with them. The originals of these files can
-be located at:
-
-http://schemas.xmlsoap.org/wsdl/http/wsdl-http.xsd
-
-THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
-OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
-INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
-RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to these files or any program
-or service that uses these files, written prior permission. Title to copyright
-in these files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-
-
- -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/http/">
-
- <import namespace = "http://schemas.xmlsoap.org/wsdl/"/>
-
- <element name="address" type="http:addressType"/>
-
- <complexType name="addressType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
-
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="binding" type="http:bindingType"/>
- <complexType name="bindingType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
-
- <sequence/>
- <attribute name="verb" type="NMTOKEN" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="operation" type="http:operationType"/>
- <complexType name="operationType">
- <complexContent>
-
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="urlEncoded">
- <complexType/>
- </element>
-
- <element name="urlReplacement">
- <complexType/>
- </element>
-</schema> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/soap.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/soap.xsd
deleted file mode 100644
index 3ef8527a41..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/soap.xsd
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
-All Rights Reserved
-
-License for WSDL Schema Files
-
-The Authors grant permission to copy and distribute the WSDL Schema
-Files in any medium without fee or royalty as long as this notice and
-license are distributed with them. The originals of these files can
-be located at:
-
-http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.xsd
-
-THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
-OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
-INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
-RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to these files or any program
-or service that uses these files, written prior permission. Title to copyright
-in these files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/soap/" >
-
- <xs:import namespace = "http://schemas.xmlsoap.org/wsdl/" />
-
- <xs:simpleType name="encodingStyle" >
- <xs:annotation>
- <xs:documentation>
- "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element. For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification
- </xs:documentation>
- </xs:annotation>
-
- <xs:list itemType="xs:anyURI" />
- </xs:simpleType>
-
- <xs:element name="binding" type="soap:tBinding" />
- <xs:complexType name="tBinding" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="transport" type="xs:anyURI" use="required" />
- <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
-
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:simpleType name="tStyleChoice" >
- <xs:restriction base="xs:string" >
- <xs:enumeration value="rpc" />
- <xs:enumeration value="document" />
- </xs:restriction>
-
- </xs:simpleType>
-
- <xs:element name="operation" type="soap:tOperation" />
- <xs:complexType name="tOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="soapAction" type="xs:anyURI" use="optional" />
- <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
- </xs:extension>
-
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="body" type="soap:tBody" />
- <xs:attributeGroup name="tBodyAttributes" >
- <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
- <xs:attribute name="use" type="soap:useChoice" use="optional" />
- <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
- </xs:attributeGroup>
- <xs:complexType name="tBody" >
-
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="parts" type="xs:NMTOKENS" use="optional" />
- <xs:attributeGroup ref = "soap:tBodyAttributes" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:simpleType name="useChoice" >
- <xs:restriction base="xs:string" >
-
- <xs:enumeration value="literal" />
- <xs:enumeration value="encoded" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="fault" type="soap:tFault" />
- <xs:complexType name="tFaultRes" abstract="true" >
- <xs:complexContent>
- <xs:restriction base="soap:tBody" >
-
- <xs:attribute ref="wsdl:required" use="optional" />
- <xs:attribute name="parts" type="xs:NMTOKENS" use="prohibited" />
- <xs:attributeGroup ref="soap:tBodyAttributes" />
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="tFault" >
- <xs:complexContent>
- <xs:extension base="soap:tFaultRes">
- <xs:attribute name="name" type="xs:NCName" use="required" />
-
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
-
- <xs:element name="header" type="soap:tHeader" />
- <xs:attributeGroup name="tHeaderAttributes" >
- <xs:attribute name="message" type="xs:QName" use="required" />
- <xs:attribute name="part" type="xs:NMTOKEN" use="required" />
- <xs:attribute name="use" type="soap:useChoice" use="required" />
-
- <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
- <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
- </xs:attributeGroup>
- <xs:complexType name="tHeader" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:sequence>
- <xs:element ref="soap:headerfault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
-
- <xs:attributeGroup ref="soap:tHeaderAttributes" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="headerfault" type="soap:tHeaderFault" />
- <xs:complexType name="tHeaderFault" >
- <xs:attributeGroup ref="soap:tHeaderAttributes" />
- </xs:complexType>
-
- <xs:element name="address" type="soap:tAddress" />
- <xs:complexType name="tAddress" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="location" type="xs:anyURI" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
-</xs:schema> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/soapenc.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/soapenc.xsd
deleted file mode 100644
index 5ec80dc058..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/soapenc.xsd
+++ /dev/null
@@ -1,585 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!-- Schema for the SOAP/1.1 encoding
-
-Portions © 2001 DevelopMentor.
-© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
-
-This document is governed by the W3C Software License [1] as described in the FAQ [2].
-[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
-[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
-By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
-
-Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:
-
-1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
-
-2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
-
-3. Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
-Original W3C files; http://www.w3.org/2001/06/soap-encoding
-Changes made:
- - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/
- - reverted root to only allow 0 and 1 as lexical values
- - removed default value from root attribute declaration
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
- targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" >
-
- <xs:attribute name="root" >
- <xs:annotation>
- <xs:documentation>
- 'root' can be used to distinguish serialization roots from other
- elements that are present in a serialization but are not roots of
- a serialized value graph
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
-
- <xs:restriction base='xs:boolean'>
- <xs:pattern value='0|1' />
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attributeGroup name="commonAttributes" >
- <xs:annotation>
- <xs:documentation>
-
- Attributes common to all elements that function as accessors or
- represent independent (multi-ref) values. The href attribute is
- intended to be used in a manner like CONREF. That is, the element
- content should be empty iff the href attribute appears
- </xs:documentation>
- </xs:annotation>
- <xs:attribute name="id" type="xs:ID" />
- <xs:attribute name="href" type="xs:anyURI" />
- <xs:anyAttribute namespace="##other" processContents="lax" />
- </xs:attributeGroup>
-
- <!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
-
- <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. -->
-
-
- <xs:simpleType name="arrayCoordinate" >
- <xs:restriction base="xs:string" />
- </xs:simpleType>
-
- <xs:attribute name="arrayType" type="xs:string" />
- <xs:attribute name="offset" type="tns:arrayCoordinate" />
-
- <xs:attributeGroup name="arrayAttributes" >
- <xs:attribute ref="tns:arrayType" />
- <xs:attribute ref="tns:offset" />
- </xs:attributeGroup>
-
- <xs:attribute name="position" type="tns:arrayCoordinate" />
-
- <xs:attributeGroup name="arrayMemberAttributes" >
-
- <xs:attribute ref="tns:position" />
- </xs:attributeGroup>
-
- <xs:group name="Array" >
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:group>
-
- <xs:element name="Array" type="tns:Array" />
- <xs:complexType name="Array" >
-
- <xs:annotation>
- <xs:documentation>
- 'Array' is a complex type for accessors identified by position
- </xs:documentation>
- </xs:annotation>
- <xs:group ref="tns:Array" minOccurs="0" />
- <xs:attributeGroup ref="tns:arrayAttributes" />
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:complexType>
-
- <!-- 'Struct' is a complex type for accessors identified by name.
- Constraint: No element may be have the same name as any other,
- nor may any element have a maxOccurs > 1. -->
-
-
- <xs:element name="Struct" type="tns:Struct" />
-
- <xs:group name="Struct" >
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="Struct" >
- <xs:group ref="tns:Struct" minOccurs="0" />
-
- <xs:attributeGroup ref="tns:commonAttributes"/>
- </xs:complexType>
-
- <!-- 'Base64' can be used to serialize binary data using base64 encoding
- as defined in RFC2045 but without the MIME line length limitation. -->
-
- <xs:simpleType name="base64" >
- <xs:restriction base="xs:base64Binary" />
- </xs:simpleType>
-
- <!-- Element declarations corresponding to each of the simple types in the
- XML Schemas Specification. -->
-
- <xs:element name="duration" type="tns:duration" />
-
- <xs:complexType name="duration" >
- <xs:simpleContent>
- <xs:extension base="xs:duration" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="dateTime" type="tns:dateTime" />
-
- <xs:complexType name="dateTime" >
- <xs:simpleContent>
- <xs:extension base="xs:dateTime" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
-
- <xs:element name="NOTATION" type="tns:NOTATION" />
- <xs:complexType name="NOTATION" >
- <xs:simpleContent>
- <xs:extension base="xs:QName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
- <xs:element name="time" type="tns:time" />
-
- <xs:complexType name="time" >
- <xs:simpleContent>
- <xs:extension base="xs:time" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="date" type="tns:date" />
-
- <xs:complexType name="date" >
- <xs:simpleContent>
- <xs:extension base="xs:date" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gYearMonth" type="tns:gYearMonth" />
-
- <xs:complexType name="gYearMonth" >
- <xs:simpleContent>
- <xs:extension base="xs:gYearMonth" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gYear" type="tns:gYear" />
-
- <xs:complexType name="gYear" >
- <xs:simpleContent>
- <xs:extension base="xs:gYear" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gMonthDay" type="tns:gMonthDay" />
-
- <xs:complexType name="gMonthDay" >
- <xs:simpleContent>
- <xs:extension base="xs:gMonthDay" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gDay" type="tns:gDay" />
-
- <xs:complexType name="gDay" >
- <xs:simpleContent>
- <xs:extension base="xs:gDay" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gMonth" type="tns:gMonth" />
-
- <xs:complexType name="gMonth" >
- <xs:simpleContent>
- <xs:extension base="xs:gMonth" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="boolean" type="tns:boolean" />
- <xs:complexType name="boolean" >
-
- <xs:simpleContent>
- <xs:extension base="xs:boolean" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="base64Binary" type="tns:base64Binary" />
- <xs:complexType name="base64Binary" >
-
- <xs:simpleContent>
- <xs:extension base="xs:base64Binary" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="hexBinary" type="tns:hexBinary" />
- <xs:complexType name="hexBinary" >
-
- <xs:simpleContent>
- <xs:extension base="xs:hexBinary" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="float" type="tns:float" />
- <xs:complexType name="float" >
-
- <xs:simpleContent>
- <xs:extension base="xs:float" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="double" type="tns:double" />
- <xs:complexType name="double" >
-
- <xs:simpleContent>
- <xs:extension base="xs:double" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="anyURI" type="tns:anyURI" />
- <xs:complexType name="anyURI" >
-
- <xs:simpleContent>
- <xs:extension base="xs:anyURI" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="QName" type="tns:QName" />
- <xs:complexType name="QName" >
-
- <xs:simpleContent>
- <xs:extension base="xs:QName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
- <xs:element name="string" type="tns:string" />
- <xs:complexType name="string" >
-
- <xs:simpleContent>
- <xs:extension base="xs:string" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="normalizedString" type="tns:normalizedString" />
- <xs:complexType name="normalizedString" >
-
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="token" type="tns:token" />
- <xs:complexType name="token" >
-
- <xs:simpleContent>
- <xs:extension base="xs:token" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="language" type="tns:language" />
- <xs:complexType name="language" >
-
- <xs:simpleContent>
- <xs:extension base="xs:language" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="Name" type="tns:Name" />
- <xs:complexType name="Name" >
-
- <xs:simpleContent>
- <xs:extension base="xs:Name" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NMTOKEN" type="tns:NMTOKEN" />
- <xs:complexType name="NMTOKEN" >
-
- <xs:simpleContent>
- <xs:extension base="xs:NMTOKEN" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NCName" type="tns:NCName" />
- <xs:complexType name="NCName" >
-
- <xs:simpleContent>
- <xs:extension base="xs:NCName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NMTOKENS" type="tns:NMTOKENS" />
- <xs:complexType name="NMTOKENS" >
-
- <xs:simpleContent>
- <xs:extension base="xs:NMTOKENS" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ID" type="tns:ID" />
- <xs:complexType name="ID" >
-
- <xs:simpleContent>
- <xs:extension base="xs:ID" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="IDREF" type="tns:IDREF" />
- <xs:complexType name="IDREF" >
-
- <xs:simpleContent>
- <xs:extension base="xs:IDREF" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ENTITY" type="tns:ENTITY" />
- <xs:complexType name="ENTITY" >
-
- <xs:simpleContent>
- <xs:extension base="xs:ENTITY" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="IDREFS" type="tns:IDREFS" />
- <xs:complexType name="IDREFS" >
-
- <xs:simpleContent>
- <xs:extension base="xs:IDREFS" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ENTITIES" type="tns:ENTITIES" />
- <xs:complexType name="ENTITIES" >
-
- <xs:simpleContent>
- <xs:extension base="xs:ENTITIES" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="decimal" type="tns:decimal" />
- <xs:complexType name="decimal" >
-
- <xs:simpleContent>
- <xs:extension base="xs:decimal" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="integer" type="tns:integer" />
- <xs:complexType name="integer" >
-
- <xs:simpleContent>
- <xs:extension base="xs:integer" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger" />
- <xs:complexType name="nonPositiveInteger" >
-
- <xs:simpleContent>
- <xs:extension base="xs:nonPositiveInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="negativeInteger" type="tns:negativeInteger" />
- <xs:complexType name="negativeInteger" >
-
- <xs:simpleContent>
- <xs:extension base="xs:negativeInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="long" type="tns:long" />
- <xs:complexType name="long" >
-
- <xs:simpleContent>
- <xs:extension base="xs:long" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="int" type="tns:int" />
- <xs:complexType name="int" >
-
- <xs:simpleContent>
- <xs:extension base="xs:int" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="short" type="tns:short" />
- <xs:complexType name="short" >
-
- <xs:simpleContent>
- <xs:extension base="xs:short" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="byte" type="tns:byte" />
- <xs:complexType name="byte" >
-
- <xs:simpleContent>
- <xs:extension base="xs:byte" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger" />
- <xs:complexType name="nonNegativeInteger" >
-
- <xs:simpleContent>
- <xs:extension base="xs:nonNegativeInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedLong" type="tns:unsignedLong" />
- <xs:complexType name="unsignedLong" >
-
- <xs:simpleContent>
- <xs:extension base="xs:unsignedLong" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedInt" type="tns:unsignedInt" />
- <xs:complexType name="unsignedInt" >
-
- <xs:simpleContent>
- <xs:extension base="xs:unsignedInt" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedShort" type="tns:unsignedShort" />
- <xs:complexType name="unsignedShort" >
-
- <xs:simpleContent>
- <xs:extension base="xs:unsignedShort" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedByte" type="tns:unsignedByte" />
- <xs:complexType name="unsignedByte" >
-
- <xs:simpleContent>
- <xs:extension base="xs:unsignedByte" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="positiveInteger" type="tns:positiveInteger" />
- <xs:complexType name="positiveInteger" >
-
- <xs:simpleContent>
- <xs:extension base="xs:positiveInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="anyType" />
-</xs:schema>
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/soapenv.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/soapenv.xsd
deleted file mode 100644
index ba9918a264..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/soapenv.xsd
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Schema for the SOAP/1.1 envelope
-
-Portions © 2001 DevelopMentor.
-© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
-
-This document is governed by the W3C Software License [1] as described in the FAQ [2].
-[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
-[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
-By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
-
-Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:
-
-1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
-
-2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
-
-3. Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
-Original W3C files; http://www.w3.org/2001/06/soap-envelope
-Changes made:
- - reverted namespace to http://schemas.xmlsoap.org/soap/envelope/
- - reverted mustUnderstand to only allow 0 and 1 as lexical values
- - made encodingStyle a global attribute 20020825
- - removed default value from mustUnderstand attribute declaration
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/">
-
-
- <!-- Envelope, header and body -->
- <xs:element name="Envelope" type="tns:Envelope"/>
- <xs:complexType name="Envelope">
- <xs:sequence>
- <xs:element ref="tns:Header" minOccurs="0"/>
- <xs:element ref="tns:Body" minOccurs="1"/>
- <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="Header" type="tns:Header"/>
- <xs:complexType name="Header">
- <xs:sequence>
- <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="Body" type="tns:Body"/>
- <xs:complexType name="Body">
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##any" processContents="lax">
- <xs:annotation>
- <xs:documentation>
- Prose in the spec does not specify that attributes are allowed on the Body element
- </xs:documentation>
- </xs:annotation>
- </xs:anyAttribute>
- </xs:complexType>
-
-
- <!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
- <xs:attribute name="mustUnderstand">
- <xs:simpleType>
- <xs:restriction base="xs:boolean">
- <xs:pattern value="0|1"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="actor" type="xs:anyURI"/>
-
- <xs:simpleType name="encodingStyle">
- <xs:annotation>
- <xs:documentation>
- 'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element. For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification
- </xs:documentation>
- </xs:annotation>
- <xs:list itemType="xs:anyURI"/>
- </xs:simpleType>
-
- <xs:attribute name="encodingStyle" type="tns:encodingStyle"/>
- <xs:attributeGroup name="encodingStyle">
- <xs:attribute ref="tns:encodingStyle"/>
- </xs:attributeGroup>
-
- <xs:element name="Fault" type="tns:Fault"/>
- <xs:complexType name="Fault" final="extension">
- <xs:annotation>
- <xs:documentation>
- Fault reporting structure
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="faultcode" type="xs:QName"/>
- <xs:element name="faultstring" type="xs:string"/>
- <xs:element name="faultactor" type="xs:anyURI" minOccurs="0"/>
- <xs:element name="detail" type="tns:detail" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="detail">
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##any" processContents="lax"/>
- </xs:complexType>
-
-</xs:schema> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd
deleted file mode 100644
index a6dfbebd36..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-Copyright 2001-2005, International Business Machines Corporation and Microsoft Corporation
-All Rights Reserved
-
-License for WSDL Schema Files
-
-The Authors grant permission to copy and distribute the WSDL Schema
-Files in any medium without fee or royalty as long as this notice and
-license are distributed with them. The originals of these files can
-be located at:
-
-http://schemas.xmlsoap.org/wsdl/mime/2004-08-24.xsd
-
-THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
-OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
-INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
-RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to these files or any program
-or service that uses these files, written prior permission. Title to copyright
-in these files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-
- -->
-<schema targetNamespace="http://schemas.xmlsoap.org/wsdl/mime/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
- <import namespace="http://schemas.xmlsoap.org/wsdl/"/>
- <element name="content" type="mime:contentType"/>
- <complexType name="contentType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="type" type="string" use="optional"/>
- <attribute name="part" type="NMTOKEN" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="multipartRelated" type="mime:multipartRelatedType"/>
- <complexType name="multipartRelatedType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence>
- <element ref="mime:part" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="part" type="mime:tPart"/>
- <complexType name="tPart">
- <sequence>
- <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NMTOKEN" use="optional"/>
- </complexType>
- <element name="mimeXml" type = "mime:tMimeXml"/>
- <complexType name="tMimeXml">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="part" type="NMTOKEN" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl.xsd
deleted file mode 100644
index 9981d6354b..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl.xsd
+++ /dev/null
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation
-All Rights Reserved
-
-License for WSDL Schema Files
-
-The Authors grant permission to copy and distribute the WSDL Schema
-Files in any medium without fee or royalty as long as this notice and
-license are distributed with them. The originals of these files can
-be located at:
-
-http://schemas.xmlsoap.org/wsdl/2004-08-24.xsd
-
-THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS
-OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT,
-INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
-RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to these files or any program
-or service that uses these files, written prior permission. Title to copyright
-in these files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/"
- elementFormDefault="qualified" >
-
- <xs:complexType mixed="true" name="tDocumentation" >
- <xs:sequence>
- <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow them to be documented
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="documentation" type="wsdl:tDocumentation" minOccurs="0" />
- </xs:sequence>
- </xs:complexType>
-
- <!-- implemented resolution of swa124 -->
- <xs:complexType name="tExtensibleAttributesDocumented" abstract="true" >
- <xs:complexContent>
- <xs:extension base="wsdl:tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow attributes from other namespaces to be added.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <!-- implemented resolution of swa124 -->
- <xs:complexType name="tExtensibleDocumented" abstract="true" >
- <xs:complexContent>
- <xs:extension base="wsdl:tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow elements from other namespaces to be added.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="definitions" type="wsdl:tDefinitions" >
- <xs:key name="message" >
- <xs:selector xpath="wsdl:message" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="portType" >
- <xs:selector xpath="wsdl:portType" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="binding" >
- <xs:selector xpath="wsdl:binding" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="service" >
- <xs:selector xpath="wsdl:service" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="import" >
- <xs:selector xpath="wsdl:import" />
- <xs:field xpath="@namespace" />
- </xs:key>
- </xs:element>
-
- <xs:group name="anyTopLevelOptionalElement" >
- <xs:annotation>
- <xs:documentation>
- Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
- </xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element name="import" type="wsdl:tImport" />
- <xs:element name="types" type="wsdl:tTypes" />
- <xs:element name="message" type="wsdl:tMessage" >
- <xs:unique name="part" >
- <xs:selector xpath="wsdl:part" />
- <xs:field xpath="@name" />
- </xs:unique>
- </xs:element>
- <xs:element name="portType" type="wsdl:tPortType" />
- <xs:element name="binding" type="wsdl:tBinding" />
- <xs:element name="service" type="wsdl:tService" >
- <xs:unique name="port" >
- <xs:selector xpath="wsdl:port" />
- <xs:field xpath="@name" />
- </xs:unique>
- </xs:element>
- </xs:choice>
- </xs:group>
-
- <!-- implemented resolution of er015 and UPA fix. ASK -->
- <xs:complexType name="tDefinitions">
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented">
- <xs:sequence minOccurs="0">
- <xs:group ref="wsdl:anyTopLevelOptionalElement"/>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="wsdl:anyTopLevelOptionalElement"/>
- <xs:any namespace="##other" processContents="lax"/>
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="targetNamespace" type="xs:anyURI" use=
-"optional"/>
- <xs:attribute name="name" type="xs:NCName" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tImport" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="namespace" type="xs:anyURI" use="required" />
- <xs:attribute name="location" type="xs:anyURI" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tTypes" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" />
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tMessage" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="part" type="wsdl:tPart" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPart" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="element" type="xs:QName" use="optional" />
- <xs:attribute name="type" type="xs:QName" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPortType" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:sequence>
- <xs:element name="operation" type="wsdl:tOperation" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:choice>
- <xs:group ref="wsdl:request-response-or-one-way-operation" />
- <xs:group ref="wsdl:solicit-response-or-notification-operation" />
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="parameterOrder" type="xs:NMTOKENS" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="request-response-or-one-way-operation" >
- <xs:sequence>
- <xs:element name="input" type="wsdl:tParam" />
- <xs:sequence minOccurs='0' >
- <xs:element name="output" type="wsdl:tParam" />
- <xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:sequence>
- </xs:group>
-
- <xs:group name="solicit-response-or-notification-operation" >
- <xs:sequence>
- <xs:element name="output" type="wsdl:tParam" />
- <xs:sequence minOccurs='0' >
- <xs:element name="input" type="wsdl:tParam" />
- <xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="tParam" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="optional" />
- <xs:attribute name="message" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tFault" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="message" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBinding" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="operation" type="wsdl:tBindingOperation" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="type" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperationMessage" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperationFault" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="input" type="wsdl:tBindingOperationMessage" minOccurs="0" />
- <xs:element name="output" type="wsdl:tBindingOperationMessage" minOccurs="0" />
- <xs:element name="fault" type="wsdl:tBindingOperationFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tService" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="port" type="wsdl:tPort" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPort" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="binding" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:attribute name="arrayType" type="xs:string" />
- <xs:attribute name="required" type="xs:boolean" />
- <xs:complexType name="tExtensibilityElement" abstract="true" >
- <xs:attribute ref="wsdl:required" use="optional" />
- </xs:complexType>
-
-</xs:schema>
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd
deleted file mode 100644
index 1ac7956b99..0000000000
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd
+++ /dev/null
@@ -1,266 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright (c) The Organization for the Advancement of Structured Information Standards
-[OASIS] 2001, 2002, 2003, 2004, 2005. All Rights Reserved.
-
-OASIS takes no position regarding the validity or scope of any intellectual property or other rights
-that might be claimed to pertain to the implementation or use of the technology described in this document
-or the extent to which any license under such rights might or might not be available; neither does it
-represent that it has made any effort to identify any such rights. Information on OASIS's procedures
-with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of
-rights made available for publication and any assurances of licenses to be made available, or the result
-of an attempt made to obtain a general license or permission for the use of such proprietary rights by
-implementors or users of this specification, can be obtained from the OASIS Executive Director.
-
-OASIS invites any interested party to bring to its attention any copyrights, patents or patent
-applications, or other proprietary rights which may cover technology that may be required to implement
-this specification. Please address the information to the OASIS Executive Director.
-
-This document and translations of it may be copied and furnished to others, and derivative works that
-comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind, provided that the above copyright
-notice and this paragraph are included on all such copies and derivative works. However, this document
-itself may not be modified in any way, such as by removing the copyright notice or references to OASIS,
-except as needed for the purpose of developing OASIS specifications, in which case the procedures for
-copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors
-or assigns.
-
-This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS
-ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
-INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
-FOR A PARTICULAR PURPOSE.
-
-OASIS has been notified of intellectual property rights claimed in regard to some or all of the contents
-of this specification. For more information consult the online list of claimed rights.
- -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:er="urn:oasis:names:tc:entity:xmlns:xml:catalog"
- targetNamespace="urn:oasis:names:tc:entity:xmlns:xml:catalog"
- elementFormDefault="qualified">
-
- <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
-
- <xs:simpleType name="pubIdChars">
- <!-- A string of the characters defined as pubIdChar in production 13
- of the Second Edition of the XML 1.0 Recommendation. Does not include
- the whitespace characters because they're normalized by XML parsing. -->
- <xs:restriction base="xs:string">
- <xs:pattern value="[a-zA-Z0-9\-'\(\)+,./:=?;!*#@$_%]*"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="publicIdentifier">
- <xs:restriction base="er:pubIdChars"/>
- </xs:simpleType>
-
- <xs:simpleType name="partialPublicIdentifier">
- <xs:restriction base="er:pubIdChars"/>
- </xs:simpleType>
-
- <xs:simpleType name="systemOrPublic">
- <xs:restriction base="xs:string">
- <xs:enumeration value="system"/>
- <xs:enumeration value="public"/>
- </xs:restriction>
- </xs:simpleType>
-
- <!-- The global attribute xml:base is not explicitly declared; -->
- <!-- it is allowed by the anyAttribute declarations. -->
-
- <xs:complexType name="catalog">
- <xs:choice minOccurs="1" maxOccurs="unbounded">
- <xs:element ref="er:public"/>
- <xs:element ref="er:system"/>
- <xs:element ref="er:uri"/>
- <xs:element ref="er:rewriteSystem"/>
- <xs:element ref="er:rewriteURI"/>
- <xs:element ref="er:uriSuffix"/>
- <xs:element ref="er:systemSuffix"/>
- <xs:element ref="er:delegatePublic"/>
- <xs:element ref="er:delegateSystem"/>
- <xs:element ref="er:delegateURI"/>
- <xs:element ref="er:nextCatalog"/>
- <xs:element ref="er:group"/>
- <xs:any namespace="##other" processContents="skip"/>
- </xs:choice>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:attribute name="prefer" type="er:systemOrPublic"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:complexType name="public">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="publicId" type="er:publicIdentifier"
- use="required"/>
- <xs:attribute name="uri" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="system">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="systemId" type="xs:string"
- use="required"/>
- <xs:attribute name="uri" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="uri">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="name" type="xs:anyURI"
- use="required"/>
- <xs:attribute name="uri" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="rewriteSystem">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="systemIdStartString"
- type="xs:string"
- use="required"/>
- <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="rewriteURI">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="uriStartString"
- type="xs:string"
- use="required"/>
- <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="systemSuffix">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="systemIdSuffix"
- type="xs:string"
- use="required"/>
- <xs:attribute name="uri" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="uriSuffix">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="uriSuffix"
- type="xs:string"
- use="required"/>
- <xs:attribute name="uri" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="delegatePublic">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="publicIdStartString"
- type="er:partialPublicIdentifier"
- use="required"/>
- <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="delegateSystem">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="systemIdStartString"
- type="xs:string"
- use="required"/>
- <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="delegateURI">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="uriStartString"
- type="xs:string"
- use="required"/>
- <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="nextCatalog">
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:attribute name="catalog" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="group">
- <xs:choice minOccurs="1" maxOccurs="unbounded">
- <xs:element ref="er:public"/>
- <xs:element ref="er:system"/>
- <xs:element ref="er:uri"/>
- <xs:element ref="er:rewriteSystem"/>
- <xs:element ref="er:rewriteURI"/>
- <xs:element ref="er:uriSuffix"/>
- <xs:element ref="er:systemSuffix"/>
- <xs:element ref="er:delegatePublic"/>
- <xs:element ref="er:delegateSystem"/>
- <xs:element ref="er:delegateURI"/>
- <xs:element ref="er:nextCatalog"/>
- <xs:any namespace="##other" processContents="skip"/>
- </xs:choice>
- <xs:attribute name="prefer" type="er:systemOrPublic"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="catalog" type="er:catalog"/>
- <xs:element name="public" type="er:public"/>
- <xs:element name="system" type="er:system"/>
- <xs:element name="uri" type="er:uri"/>
- <xs:element name="rewriteSystem" type="er:rewriteSystem"/>
- <xs:element name="rewriteURI" type="er:rewriteURI"/>
- <xs:element name="systemSuffix" type="er:systemSuffix"/>
- <xs:element name="uriSuffix" type="er:uriSuffix"/>
- <xs:element name="delegatePublic" type="er:delegatePublic"/>
- <xs:element name="delegateSystem" type="er:delegateSystem"/>
- <xs:element name="delegateURI" type="er:delegateURI"/>
- <xs:element name="nextCatalog" type="er:nextCatalog"/>
- <xs:element name="group" type="er:group"/>
-
-</xs:schema>
-
diff --git a/bundles/org.eclipse.wst.xml.core/.classpath b/bundles/org.eclipse.wst.xml.core/.classpath
deleted file mode 100644
index 0f97d08f8d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.classpath
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-contentmodel"/>
- <classpathentry kind="src" path="src-search"/>
- <classpathentry kind="src" path="src-validation"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-catalog"/>
- <classpathentry kind="src" path="src-emfModelSynch"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/validation/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emf/resource/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emf/utilities/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/common/internal/emfworkbench/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
- <accessrules>
- <accessrule kind="accessible" pattern="org/apache/xerces/dom/TreeWalkerImpl"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/ranges/DocumentRange"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/ranges/Range"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/traversal/DocumentTraversal"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/traversal/NodeFilter"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/traversal/NodeIterator"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/traversal/TreeWalker"/>
- <accessrule kind="accessible" pattern="org/w3c/dom/ranges/RangeException"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/impl/XMLErrorReporter"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/parsers/StandardParserConfiguration"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/Augmentations"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/NamespaceContext"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/QName"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLAttributes"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLLocator"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/XMLResourceIdentifier"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/XNIException"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/parser/XMLEntityResolver"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/xni/parser/XMLInputSource"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/parsers/SAXParser"/>
- <accessrule kind="accessible" pattern="org/apache/xerces/parsers/AbstractSAXParser"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xml.core/.cvsignore b/bundles/org.eclipse.wst.xml.core/.cvsignore
deleted file mode 100644
index 273f8bc614..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-temp.folder
-build.xml
-xmlmodel.jar
-org.eclipse.wst.xml.core_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xml.core/.options b/bundles/org.eclipse.wst.xml.core/.options
deleted file mode 100644
index d282f9e448..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.options
+++ /dev/null
@@ -1,6 +0,0 @@
-org.eclipse.wst.xml.core/debug=true
-org.eclipse.wst.xml.core/debug/tracefilter=
-org.eclipse.wst.xml.core/debug/cmdocumentmanager=false
-org.eclipse.wst.xml.core/debug/cmdocumentcache=false
-org.eclipse.wst.xml.core/debug/validation=false
-org.eclipse.wst.xml.core/externalSchemaLocation=false \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/.project b/bundles/org.eclipse.wst.xml.core/.project
deleted file mode 100644
index c4175149e1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml.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.xml.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.xml.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.xml.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.xml.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.xml.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3405307322..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:18:23 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.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 1ca5c5e8a5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Nov 15 02:26:10 EST 2006
-eclipse.preferences.version=1
-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.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.xml.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.xml.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 86ca5a7023..0000000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Wed Nov 15 02:13:31 EST 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=1
-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.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex
deleted file mode 100644
index c33e65b772..0000000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-%%
-
-%table
-%public
-%final
-%class XML10Names
-%function isValidXML10Name
-%type boolean
-%unicode
-%ignorecase
-%buffer 2048
-%apiprivate
-
-S = (\x20 | \x09 | \x0D | \x0A)
-
-BaseChar = [\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-CombiningChar = [\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-Digit = [\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-Letter = ({BaseChar} | {Ideographic})
-
-NameChar = ({Letter} | {Digit} | . | - | _ | : | {CombiningChar} | {Extender})
-
-Name = ({Letter} | _ | : ) ({NameChar})*
-
-
-
-%{
-
- /**
- * Creates a new scanner
- */
- public XML10Names() {
- this.zzReader = null;
- }
-
- public boolean isValidXML10Name(String stringToCheck) {
- boolean result = false;
- yyreset(new java.io.StringReader(stringToCheck));
- try {
- result = isValidXML10Name();
- }
- catch (java.io.IOException e) {
- // should be impossible with strings, but if occurs, just means
- // "not"
- result = false;
- }
- return result;
- }
-
-%}
-
-
-
-
-%%
-
-<YYINITIAL>
-{
-
- // don't match if contains trailing or embedded space
- {Name} {S}+ {return false;}
- {Name} {S}+ {Name} {return false;}
-
- {Name} {return true;}
-
- // match anything should come last
- . {return false;}
-
-}
-
-
-// this rule always in effect
-<<EOF>>
-{
- {return false;}
-}
-
-
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
deleted file mode 100644
index 15d5b0a34b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,254 +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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.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;
-
-
-%%
-
-%{
-
-
- 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 XMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- zzReader = in;
-
- /* the current state of the DFA */
- zzState = 0;
-
- /* the current lexical state */
- zzLexicalState = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- 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 */
- zzPushbackPos = 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
- */
- zzAtBOL = true;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- zzAtEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- zzEOFDone = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- } else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
-
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class XMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-//%debug
-%switch
-%buffer 8192
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-//SpaceChar = [\x20\x09]
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-//BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-// Z is the single-byte zero character to be used in parsing double-byte files
-Z = (\x00)?
-S_UTF = {Z}{S}{Z}
-BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*
-
-%state ST_XMLDecl
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>
-{
- // force to start at beginning of line (^) and at beginning of file (yychar == 0)
- ^{UTF16BE} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}
- ^{UTF16LE} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}
- ^{UTF83ByteBOM} {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}
-
- // force to be started on first line, but we do allow preceeding spaces
- ^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-
-}
-
-<ST_XMLDecl>
-{
- ({Z}v{Z}e{Z}r{Z}s{Z}i{Z}o{Z}n{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
- ({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
- // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found
- // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is
- // read with incorrect encoding (such as if platform encoding is in effect until true encoding detected).
- ({Z}\?{Z}>{Z}) {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-
-
-<QuotedAttributeValue>
-{
- {Z}\"{Z} { yybegin(DQ_STRING); string.setLength(0); }
- {Z}\'{Z} { yybegin(SQ_STRING); string.setLength(0); }
- // in this state, anything other than a space character can start an undelimited string
- {S_UTF}*. { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
- {Z}\"{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- [^\x00] { string.append( yytext() ); }
-
-}
-
-<SQ_STRING>
-{
-
- {Z}\'{Z} { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}%{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- [^\x00] { string.append( yytext() ); }
-
-}
-
-<UnDelimitedString>
-{
-
- {S_UTF} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- {Z}{LineTerminator}{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}\?{Z}>{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- {Z}<{Z}
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
- {Z}\'{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- {Z}\"{Z} { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- [^\x00] { string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-.|\n {if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-
-// this rule always in effect
-<<EOF>> {hasMore = false; return EncodingParserConstants.EOF;}
-
- \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml
deleted file mode 100644
index 6d97563384..0000000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="XML10Names">
-
- <!-- Note: for Eclipse env., the JFlex 1.4 jar should be added
- to the ant global entries -->
- <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" />
-
- <target name="init">
- <property name="src.file" value="XML10Names.jFlex"/>
- <property name="src.dir" value="HeadParsers"/>
- <property name="dest.dir" value="../src"/>
- <!-- touch causes to always build, remove for real 'make' behavior -->
- <touch file="${src.dir}/${src.file}"/>
-
- </target>
-
- <target name="XML10Names" depends="init">
- <antcall target="run-jflex"/>
- </target>
-
- <target name="run-jflex" depends="init">
- <jflex
- file="${src.dir}/${src.file}"
- destdir="${dest.dir}"
- verbose="true"
- nobak="true"
- time="on"
- />
- </target>
-
-
-</project> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml
deleted file mode 100644
index 49619df58f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="HeadTokenizer">
-
- <!-- Note: for Eclipse env., the JFlex 1.4 jar should be added
- to the ant global entries -->
- <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" />
-
- <target name="init">
- <property name="src.file" value="XMLHeadTokenizer.jFlex"/>
- <property name="src.dir" value="HeadParsers"/>
- <property name="dest.dir" value="../src"/>
- <!-- touch causes to always build, remove for real 'make' behavior -->
- <touch file="${src.dir}/${src.file}"/>
-
- </target>
-
- <target name="HeadTokenizer" depends="init">
- <antcall target="run-jflex"/>
- </target>
-
- <target name="run-jflex" depends="init">
- <jflex
- file="${src.dir}/${src.file}"
- destdir="${dest.dir}"
- verbose="true"
- nobak="true"
- time="on"
- />
- </target>
-
-
-</project> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 8506cf9681..0000000000
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,327 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xml.core; singleton:=true
-Bundle-Version: 1.1.602.qualifier
-Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.core.contentmodel.modelquery,
- org.eclipse.wst.xml.core.internal;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.catalog.provisional;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.cleanup;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.impl;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.commentelement.util;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.annotation;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.basic;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.factory;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contentmodel.util;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.contenttype;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.document;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.emf2xml;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.encoding;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.formatter;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelhandler;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.modelquery;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.parser.regions;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.preferences;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.propagate;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contentmodel;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.contenttype;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.document;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.format;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.provisional.text;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.regions;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.impl;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.matching;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.search.quickscan;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.ssemodelquery;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.tasks;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.text.rules;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validate;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.core;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.core.logging;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.eclipse;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.internal.validation.errorcustomization;
- x-friends:="org.eclipse.wst.dtd.core,
- org.eclipse.wst.dtd.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.xsd.core,
- org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xml.core.text
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.jem.util;bundle-version="[2.0.200,3.0.0)";resolution:=optional,
- org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)";resolution:=optional,
- org.eclipse.wst.common.emf;bundle-version="[1.1.300,1.3.0)";resolution:=optional,
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";resolution:=optional,
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.300,1.3.0)";resolution:=optional,
- org.eclipse.wst.common.core;bundle-version="[1.1.201,1.3.0)",
- org.eclipse.osgi.services;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.core.internal.contenttype"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.core/README.txt b/bundles/org.eclipse.wst.xml.core/README.txt
deleted file mode 100644
index ffa6466947..0000000000
--- a/bundles/org.eclipse.wst.xml.core/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-THe XML specific model implementation. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/about.html b/bundles/org.eclipse.wst.xml.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.xml.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.xml.core/build.properties b/bundles/org.eclipse.wst.xml.core/build.properties
deleted file mode 100644
index 8d49b33ca6..0000000000
--- a/bundles/org.eclipse.wst.xml.core/build.properties
+++ /dev/null
@@ -1,33 +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
-#
-###############################################################################
-bin.includes = plugin.xml,\
- .options,\
- plugin.properties,\
- META-INF/,\
- .,\
- about.html,\
- schema/
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = component.xml,\
- schema/,\
- DevTimeSupport/
-source.. = src-catalog/,\
- src-contentmodel/,\
- src-validation/,\
- src/,\
- src-emfModelSynch/,\
- src-search/
-
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.xml.core/component.xml b/bundles/org.eclipse.wst.xml.core/component.xml
deleted file mode 100644
index e061eb3051..0000000000
--- a/bundles/org.eclipse.wst.xml.core/component.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.xml">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.xmleditor.doc.user" fragment="false" />
- <plugin id="org.eclipse.wst.xml.core" fragment="false" />
- <plugin id="org.eclipse.wst.xml.ui" fragment="false" />
- <description url="http://eclipse.org/webtools/wst/components/xml/overview.html" />
- <package name="org.eclipse.wst.xml.ui" api="false">
- <type name="StructuredTextViewerConfigurationXML" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.xml.ui.views.contentoutline" api="false">
- <type name="XMLContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.xml.ui.views.properties" api="false">
- <type name="XMLPropertySheetConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.xml.ui.infopop" fragment="false" />
- <plugin id="org.eclipse.wst.xml_core.feature.source" fragment="false" />
- <plugin id="org.eclipse.wst.xml_ui.feature.source" fragment="false" />
- <plugin id="org.apache.xerces" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.properties b/bundles/org.eclipse.wst.xml.core/plugin.properties
deleted file mode 100644
index 0e9ea2bd5d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Structured Source XML Model
-Structured_XML_Document_Factory_Extension.name=Structured XML Document Factory Extension
-XML_Content_Type_Extension_Element.name=XML (Illformed)
-# contentmodel strings
-Content_Model_Document_Factories_Extension.name=Content Model Document Factories
-Content_Model_Annotation_Files_Extension.name=Content Model Annotation Files
-Model_Query_Extension.name=Model Query Extension
-XML_Catalog_Contributions_Extension_Point.name=XML Catalog Contributions Extension Point
-XSL_Content_Type_Extension_Element.name=XSL
-XMI_Content_Type=XMI
-XML_Validator.name=XML Validator
-XML_Validation_Error_Customizer.name=XML Validator Error Customizer Extension Point
-External_Schema_Location.name=XML External Schema Location Extension Point
-_validationMarker.name=XML Problem
-_taskMarker.name=XML Task
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.xml b/bundles/org.eclipse.wst.xml.core/plugin.xml
deleted file mode 100644
index 38169629d5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <!-- An extension for contributing a XML validation error customizer. -->
- <extension-point id="errorCustomizer" name="%XML_Validation_Error_Customizer.name" schema="schema/errorCustomizer.exsd"/>
- <extension-point id="externalSchemaLocations" name="%External_Schema_Location.name" schema="schema/externalSchemaLocations.exsd"/>
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- default="true"
- class="org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML"
- associatedContentTypeId="org.eclipse.core.runtime.xml"
- id="org.eclipse.wst.xml.core.internal.modelhandler">
- </modelHandler>
- </extension>
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- default="true"
- class="org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML"
- associatedContentTypeId="org.eclipse.wst.xml.core.xmlsource"
- id="org.eclipse.wst.xml.core.internal.modelhandler2">
- </modelHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.embeddedTypeHandler">
- <embeddedTypeHandler
- class="org.eclipse.wst.xml.core.internal.modelhandler.EmbeddedXML">
- </embeddedTypeHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.taskscanner">
- <scanner
- id="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner"
- class="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner:org.eclipse.wst.xml.core.taskMarker"
- contentTypeIds="org.eclipse.core.runtime.xml" />
- </extension>
- <extension
- id="taskMarker"
- name="%_taskMarker.name"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.core.resources.taskmarker"/>
- <persistent value="true"/>
- </extension>
-
- <!-- Here we define a new extension point. This extension point is used
- to programmatically contribute catalog entries to the XML Catalog. -->
- <extension-point id="catalogContributions" name="%XML_Catalog_Contributions_Extension_Point.name" schema="schema/catalogContributions.exsd"/>
-
- <!-- This extension point extends the Common Extensbile URI Resolver so that
- the XML Catalog can participare in resolving processes. -->
- <extension point="org.eclipse.wst.common.uriresolver.resolverExtensions">
- <resolverExtension
- stage="postnormalization"
- class="org.eclipse.wst.xml.core.internal.catalog.XMLCatalogURIResolverExtension">
- </resolverExtension>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.xml.core.documentfactories"
- name="%Structured_XML_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.core.runtime.xml"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.xml.core.documentfactories2"
- name="%Structured_XML_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.xml.core.xmlsource"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="xsl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="xslt">
- </fileTypes>
- <fileTypes
- type="text"
- extension="dadx">
- </fileTypes>
- <fileTypes
- type="text"
- extension="wsdl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="nst">
- </fileTypes>
- <fileTypes
- type="text"
- extension="xmi">
- </fileTypes>
- <fileTypes
- type="text"
- extension="xsd">
- </fileTypes>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.xml.core.internal.formatter.XMLFormatterFormatProcessor"
- contentTypeId="org.eclipse.core.runtime.xml">
- </processor>
- </extension>
-
- <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=103083 -->\
- <!-- FYI: this xmi type *should* be defined in EMF, but, since isn't
- we will here. In future versions is could be removed -->
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- file-extensions="xmi"
- priority="low"
- name="%XMI_Content_Type"
- id="org.eclipse.wst.xml.core.xmisource"
- base-type="org.eclipse.core.runtime.xml">
- </content-type>
-
- <content-type
- file-extensions="xml,xsl,xslt,wsdl,xsd,exsd,xmi"
- priority="low"
- name="%XML_Content_Type_Extension_Element.name"
- id="org.eclipse.wst.xml.core.xmlsource"
- base-type="org.eclipse.core.runtime.text"
- default-charset="UTF-8">
- <describer class="org.eclipse.wst.xml.core.internal.contenttype.ContentDescriberForXML" />
- </content-type>
-
- <content-type
- file-extensions="xsl,xslt"
- priority="high"
- name="%XSL_Content_Type_Extension_Element.name"
- id="org.eclipse.wst.xml.core.xslsource"
- base-type="org.eclipse.core.runtime.xml"
- default-charset="UTF-8">
- </content-type>
- </extension>
-
-
- <!-- initialize xml core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer class="org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceInitializer" />
- </extension>
-
- <extension-point id="documentFactories" name="%Content_Model_Document_Factories_Extension.name" schema="schema/documentFactories.exsd"/>
-
- <extension-point id="modelQueryExtensions" name="%Model_Query_Extension.name" schema="schema/modelQueryExtensions.exsd"/>
-
- <extension-point id="annotationFiles" name="%Content_Model_Annotation_Files_Extension.name" schema="schema/annotationFiles.exsd"/>
-
- <extension
- point="org.eclipse.jem.util.uiContextSensitiveClass">
- <uiContextSensitiveClass
- context="UI"
- key="rendererFactory"
- className="org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSERendererFactory">
- </uiContextSensitiveClass>
- </extension>
- <!-- ====================================================== -->
- <!-- Register the XML validator with the validation -->
- <!-- framework. -->
- <!-- ====================================================== -->
-
- <extension
- id="validationMarker"
- name="%_validationMarker.name"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <persistent value="true"/>
- </extension>
-
- <extension id="xml" name="%XML_Validator.name" point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.eclipse.wst.xml.core.internal.validation.eclipse.Validator"
- manual="true"
- sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- version="3"
- markerId="org.eclipse.wst.xml.core.validationMarker">
- <include>
- <rules>
- <contentType id="org.eclipse.core.runtime.xml"></contentType>
- <contentType id="org.eclipse.wst.xml.core.xmlsource"></contentType>
- <contentType id="org.eclipse.wst.xml.core.xslsource"></contentType>
- <contentType id="org.eclipse.jst.jsp.core.tldsource"></contentType>
- <fileext
- caseSensitive="false"
- ext="xml">
- </fileext>
- </rules>
- </include>
- <exclude>
- <rules>
- <projectNature id="org.eclipse.jst.j2ee.ejb.EJBNature"/>
- <projectNature id="org.eclipse.jst.j2ee.EARNature"/>
- <file caseSensitive="true" name=".project" type="file"/>
- <file caseSensitive="true" name=".classpath" type="file"/>
- <file caseSensitive="true" name=".settings" type="folder"/>
- </rules>
- </exclude>
- </validator>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd b/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd
deleted file mode 100644
index d417f55921..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="annotationFiles" name="Content Model Annotation Files"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="annotationFile" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="annotationFile">
- <complexType>
- <attribute name="location" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="publicId" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd b/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd
deleted file mode 100644
index b7bad1b376..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd
+++ /dev/null
@@ -1,283 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="catalogContributions" name="XML Catalog Contributions Extension Point"/>
- </appInfo>
- <documentation>
- This extension point allows to specify entries for XML Catalog. Catalog entries have format specified in &lt;a href=&quot;http://www.oasis-open.org/committees/download.php/14041/xml-catalogs.html&quot;&gt;http://www.oasis-open.org/committees/entity/spec.html&lt;/a&gt;.
-Each catalog extension consists of a single catalogContribution element.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <choice>
- <element ref="catalogContribution"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="catalogContribution">
- <annotation>
- <documentation>
- The catalogContribution element may have id, and it is just a container for the contributed catalog entries.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="public" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="system" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="uri" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="nextCatalog" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- Id of the catalog to which entries will be added. Could be &quot;default&quot;, and if ommited, entries are added to the default workspace catalog.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="public">
- <annotation>
- <documentation>
- The public element associates a URI reference with the public identitier portion of an external identifier.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- Id of the element, optional.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="publicId" type="string" use="required">
- <annotation>
- <documentation>
- The public identifier portion of an external identifier.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="uri" type="string" use="required">
- <annotation>
- <documentation>
- The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="webURL" type="string">
- <annotation>
- <documentation>
- Alternative Web address for the public ID
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="system">
- <annotation>
- <documentation>
- The system elements associates a URI reference with the system identifier of an external identifier
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- Id of the element, optional.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="systemId" type="string" use="required">
- <annotation>
- <documentation>
- The system identifier portion of an external identifier.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="uri" type="string" use="required">
- <annotation>
- <documentation>
- The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="uri">
- <annotation>
- <documentation>
- The uri element associates a URI reference with the a URI reference that is not part of an external identifier.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- Id of the element, optional.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="uri" type="string" use="required">
- <annotation>
- <documentation>
- The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A URI reference that is not part of an external identitier.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="nextCatalog">
- <annotation>
- <documentation>
- The nextCatalog elements indicate additional catalog entry file(s) to be considered during the process of resolution.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- Id of the element, optional.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="catalog" type="string" use="required">
- <annotation>
- <documentation>
- The value of the uri attribute could be relative to the plugin.xml file, use platform:/ or file:/ protocols.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.xml.core.catalogContributions&quot;&gt;
- &lt;catalogContribution&gt;
- &lt;system
- systemId=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
- uri=&quot;data/xsd/wsdl.xml&quot; &gt;
- &lt;property
- name=&quot;webURL&quot;
- value=&quot;http://schemas.xmlsoap.org/wsdl/&quot;/&gt;
- &lt;/system&gt;
- &lt;uri
- name=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
- uri=&quot;data/xsd/soap.xsd&quot;/&gt;
- &lt;public
- publicId=&quot;http://www.w3.org/1999/XSL/Transform&quot;
- uri=&quot;data/xsd/XSLSchema.xsd&quot;&gt;
- &lt;/public&gt;
- &lt;nextCatalog
- id=&quot;nestedCatalog&quot;
- catalog=&quot;data/catalog1.xml&quot;/&gt;
- &lt;/catalogContribution&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd b/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd
deleted file mode 100644
index dd0d90624d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="documentFactories" name="Content Model Document Factories"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="factory"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="factory">
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
deleted file mode 100644
index 608f190047..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="errorCustomizer" name="XML Validation Error Customizer"/>
- </appInfo>
- <documentation>
- The error customizer extension point allows a client to contribute an error customizer for a specific namespace. The error customizer can provide error messages that are more domain specific than the generic error messages provided by the underlying generic XML validator.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="errorCustomizer" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="errorCustomizer">
- <complexType>
- <attribute name="namespace" type="string" use="required">
- <annotation>
- <documentation>
- The namespace for which this error customizer will consider error customizations.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an Error Customizer contribution:
-&lt;pre&gt;
- &lt;extension
- id=&quot;sampleErrorCustomizer&quot;
- name=&quot;Sample Error Customizer&quot;
- point=&quot;org.eclipse.wst.xml.core.errorCustomizer&quot;&gt;
- &lt;errorCustomizer
- namespace=&quot;http://sample.namespace&quot;
- class=&quot;org.eclipse.wst.xml.core.SampleErrorCustomizer&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The supplied class must implement &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/externalSchemaLocations.exsd b/bundles/org.eclipse.wst.xml.core/schema/externalSchemaLocations.exsd
deleted file mode 100644
index 0fe2a9074d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/externalSchemaLocations.exsd
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="externalSchemaLocations" name="External Schema Locations"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="provider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provider">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.xml.core.contentmodel.modelquery.IExternalSchemaLocationProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd b/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
deleted file mode 100644
index 80f8365ad2..0000000000
--- a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.core" id="modelQueryExtensions" name="Model Query Extension"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element internal="true" />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="modelQueryExtension"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="modelQueryExtension">
- <annotation>
- <documentation>
- Allows for the customization of returned vaues from a ModelQuery object.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension:"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="contentType" type="string" use="required">
- <annotation>
- <documentation>
- A comma-separated list of content types for which to use this extension.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
deleted file mode 100644
index b6c322cda6..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
+++ /dev/null
@@ -1,795 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-public class Catalog implements ICatalog
-{
-
- class CatalogLS
- {
- public void load()
- {
- }
-
- public synchronized void save()
- {
- try
- {
- new CatalogWriter().write(Catalog.this, location);
- } catch (Exception e)
- {
- Logger.logException(e);
- }
- }
- }
-
- class DefaultCatalogLS extends CatalogLS
- {
- public void load()
- {
- NextCatalog userCatalogReference = new NextCatalog();
- userCatalogReference.setId(XMLCorePlugin.USER_CATALOG_ID);
- userCatalogReference.setCatalogLocation(USER_CATALOG_FILE);
- addCatalogElement(userCatalogReference);
-
- NextCatalog systemCatalogReference = new NextCatalog();
- systemCatalogReference.setId(XMLCorePlugin.SYSTEM_CATALOG_ID);
- systemCatalogReference.setCatalogLocation(SYSTEM_CATALOG_FILE);
- addCatalogElement(systemCatalogReference);
-
- /*
- * Here we save the file in order to 'reflect' the catalog that
- * we've created from plug-in extensions to disk. The 'default'
- * catalog is only ever written to disk and never read from disk.
- */
- save();
- }
- }
-
- private static Comparator LONGEST_REWRITE_FIRST = new Comparator()
- {
- public int compare(Object entry1, Object entry2)
- {
- String start1 = ((IRewriteEntry)entry1).getStartString();
- String start2 = ((IRewriteEntry)entry2).getStartString();
-
- // Bigger is earlier
- return start2.length() - start1.length();
- }
- };
-
- private static Comparator LONGEST_SUFFIX_FIRST = new Comparator()
- {
- public int compare(Object entry1, Object entry2)
- {
- String suffix1 = ((ISuffixEntry)entry1).getSuffix();
- String suffix2 = ((ISuffixEntry)entry2).getSuffix();
-
- // Bigger is earlier
- return suffix2.length() - suffix1.length();
- }
- };
-
- private static Comparator LONGEST_DELEGATE_PREFIX_FIRST = new Comparator()
- {
- public int compare(Object entry1, Object entry2)
- {
- String prefix1 = ((IDelegateCatalog)entry1).getStartString();
- String prefix2 = ((IDelegateCatalog)entry2).getStartString();
-
- // Bigger is earlier
- return prefix2.length() - prefix1.length();
- }
- };
-
- class InternalResolver
- {
- protected Map publicMap = new HashMap();
-
- protected Map systemMap = new HashMap();
-
- protected Map uriMap = new HashMap();
-
- // These are sorted by longest "key" first.
- protected List rewriteSystemList = new LinkedList();
- protected List rewriteUriList = new LinkedList();
- protected List suffixSystemList = new LinkedList();
- protected List suffixUriList = new LinkedList();
- protected List delegatePublicList = new LinkedList();
- protected List delegateSystemList = new LinkedList();
- protected List delegateUriList = new LinkedList();
-
- InternalResolver()
- {
- synchronized (catalogElements) {
- for (Iterator i = catalogElements.iterator(); i.hasNext();)
- {
- ICatalogElement catalogElement = (ICatalogElement) i.next();
- if (catalogElement.getType() == ICatalogElement.TYPE_ENTRY)
- {
- ICatalogEntry entry = (ICatalogEntry) catalogElement;
- Map map = getEntryMap(entry.getEntryType());
- map.put(entry.getKey(), entry);
- }
- else if (catalogElement.getType() == ICatalogElement.TYPE_REWRITE)
- {
- IRewriteEntry entry = (IRewriteEntry) catalogElement;
- if (entry.getEntryType() == IRewriteEntry.REWRITE_TYPE_SYSTEM)
- {
- rewriteSystemList.add(entry);
- }
- else
- {
- rewriteUriList.add(entry);
- }
- }
- else if (catalogElement.getType() == ICatalogElement.TYPE_SUFFIX)
- {
- ISuffixEntry entry = (ISuffixEntry) catalogElement;
- if (entry.getEntryType() == ISuffixEntry.SUFFIX_TYPE_SYSTEM)
- {
- suffixSystemList.add(entry);
- }
- else
- {
- suffixUriList.add(entry);
- }
- }
- else if (catalogElement.getType() == ICatalogElement.TYPE_DELEGATE)
- {
- IDelegateCatalog delegate = (IDelegateCatalog) catalogElement;
- if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_PUBLIC)
- {
- delegatePublicList.add(delegate);
- }
- else if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_SYSTEM)
- {
- delegateSystemList.add(delegate);
- }
- else
- {
- delegateUriList.add(delegate);
- }
- }
- }
- }
-
- Collections.sort(rewriteSystemList, LONGEST_REWRITE_FIRST);
- Collections.sort(rewriteUriList, LONGEST_REWRITE_FIRST);
-
- Collections.sort(suffixSystemList, LONGEST_SUFFIX_FIRST);
- Collections.sort(suffixUriList, LONGEST_SUFFIX_FIRST);
-
- Collections.sort(delegatePublicList, LONGEST_DELEGATE_PREFIX_FIRST);
- Collections.sort(delegateSystemList, LONGEST_DELEGATE_PREFIX_FIRST);
- Collections.sort(delegateUriList, LONGEST_DELEGATE_PREFIX_FIRST);
- }
-
- private Map getEntryMap(int entryType)
- {
- Map map = systemMap;
- switch (entryType)
- {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC:
- map = publicMap;
- break;
- case ICatalogEntry.ENTRY_TYPE_URI:
- map = uriMap;
- break;
- default:
- break;
- }
- return map;
- }
-
- protected String getMappedURI(Map map, String key)
- {
- CatalogEntry entry = (CatalogEntry) map.get(key);
- if(entry == null) return null;
- String uri = entry.getURI();
- try
- {
- // TODO CS : do we really want to resolve these here?
- // I'm guessing we should return the 'platform:' form of the URI
- // to the caller.
- if (uri.startsWith("platform:")) //$NON-NLS-1$
- {
- URL entryURL = new URL(entry.getAbsolutePath(uri));
- uri = Platform.resolve(entryURL).toString();
-
- // we need to ensure URI's are of form "file:///D:/XXX" and NOT
- // "file:D:/XXX". Otherwise the EMF URI class gets confused
- // (see bug 103607)
- String FILE_SCHEME = "file:"; //$NON-NLS-1$
- if (uri.startsWith(FILE_SCHEME) && !uri.startsWith(FILE_SCHEME + "/")) //$NON-NLS-1$
- {
- uri = FILE_SCHEME + "///" + uri.substring(FILE_SCHEME.length()); //$NON-NLS-1$
- }
- }
- return uri;
- } catch (IOException e)
- {
- return null;
- }
- }
-
- public String resolvePublic(String publicId, String systemId)
- throws MalformedURLException, IOException
- {
- String result = getMappedURI(publicMap, publicId);
- if (result == null)
- {
- result = getMappedURI(systemMap, systemId);
- }
- // our clients used to pass namespace in place of public id, so we need to check uri map for those
- if (result == null)
- {
- result = getMappedURI(uriMap, publicId);
- }
- if (result == null)
- {
- result = resolveDelegateCatalogs(delegatePublicList, publicId, systemId);
- }
- if (result == null)
- {
- result = resolveSubordinateCatalogs(
- ICatalogEntry.ENTRY_TYPE_PUBLIC, publicId, systemId);
- }
- return result;
- }
-
- public String resolveSystem(String systemId)
- throws MalformedURLException, IOException
- {
- String result = getMappedURI(systemMap, systemId);
- if (result == null)
- {
- result = resolveRewrite(rewriteSystemList, systemId);
- }
- if (result == null)
- {
- result = resolveSuffix(suffixSystemList, systemId);
- }
- if (result == null)
- {
- result = resolveDelegateCatalogs(delegateSystemList, systemId, systemId); // systemId is the key for "startString"
- }
- if (result == null)
- {
- result = resolveSubordinateCatalogs(
- ICatalogEntry.ENTRY_TYPE_SYSTEM, null, systemId);
- }
- return result;
- }
-
- private String resolveRewrite(List rewriteList, String searchString)
- {
- for (Iterator it = rewriteList.iterator(); it.hasNext();)
- {
- IRewriteEntry entry = (IRewriteEntry) it.next();
- String startString = entry.getStartString();
- if (searchString.startsWith(startString))
- {
- return entry.getRewritePrefix() + searchString.substring(startString.length());
- }
- }
- return null;
- }
-
- private String resolveSuffix(List suffixList, String searchString) {
- for (Iterator it = suffixList.iterator(); it.hasNext();) {
- ISuffixEntry entry = (ISuffixEntry) it.next();
- if (searchString.endsWith(entry.getSuffix())) {
- return entry.getURI();
- }
- }
- return null;
- }
-
- protected String resolveDelegateCatalogs(List delegateCatalogs, String key,
- String systemId) throws MalformedURLException, IOException
- {
- String result = null;
- for (Iterator iterator = delegateCatalogs.iterator(); iterator
- .hasNext();) {
- IDelegateCatalog delegate = (IDelegateCatalog) iterator.next();
-
- if (key.startsWith(delegate.getStartString())) {
-
- ICatalog catalog = delegate.getReferencedCatalog();
- if (catalog != null)
- {
- switch (delegate.getEntryType())
- {
- case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
- result = catalog.resolvePublic(key, systemId);
- break;
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- result = catalog.resolveSystem(systemId);
- break;
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- result = catalog.resolveURI(systemId);
- break;
- default:
- break;
- }
- if (result != null)
- {
- return result;
- }
- }
- }
- }
- return null;
- }
-
- public String resolveURI(String uri) throws MalformedURLException,
- IOException
- {
- String result = getMappedURI(uriMap, uri);
- if (result == null)
- {
- result = resolveRewrite(rewriteUriList, uri);
- }
- if (result == null)
- {
- result = resolveSuffix(suffixUriList, uri);
- }
- if (result == null)
- {
- result = resolveDelegateCatalogs(delegateUriList, uri, uri); // uri is treated as the systemId
- }
- if (result == null)
- {
- result = resolveSubordinateCatalogs(
- ICatalogEntry.ENTRY_TYPE_URI, null, uri);
- }
- return result;
- }
- }
-
- class SystemCatalogLS extends CatalogLS
- {
- public void load()
- {
- new CatalogContributorRegistryReader(Catalog.this).readRegistry();
-
- /*
- * Here we save the file in order to 'reflect' the catalog that
- * we've created from plugin extensions to disk.
- * The 'system' catalog is only ever written to disk and never read from disk.
- */
- save();
- }
- }
-
- class UserCatalogLS extends CatalogLS
- {
- public void load()
- {
- InputStream inputStream = null;
- try
- {
- if (location != null && location.length() > 0)
- {
- URL url = new URL(location);
- inputStream = url.openStream();
- boolean oldNotificationEnabled = isNotificationEnabled();
- setNotificationEnabled(false);
- clear();
- try
- {
- CatalogReader.read(Catalog.this, inputStream);
- } finally
- {
- setNotificationEnabled(oldNotificationEnabled);
- }
- }
- else
- {
- clear();
- }
- notifyChanged();
- } catch (Exception e)
- {
- // This is OK since the catalog may not exist before we create it
- } finally
- {
- if (inputStream != null)
- {
- try
- {
- inputStream.close();
- } catch (Exception e)
- {
- }
- }
- }
- }
- }
-
- public static final String DEFAULT_CATALOG_FILE = "default_catalog.xml"; //$NON-NLS-1$
-
- public static final String SYSTEM_CATALOG_FILE = "system_catalog.xml"; //$NON-NLS-1$
-
- public static final String USER_CATALOG_FILE = "user_catalog.xml"; //$NON-NLS-1$
-
- protected String base;
-
- protected List catalogElements = new ArrayList();
-
- protected CatalogLS catalogLS;
-
- protected String id;
-
- protected InternalResolver internalResolver;
-
- protected boolean isNotificationEnabled;
-
- protected List listenerList = new ArrayList();
-
- protected String location;
-
- protected CatalogSet resourceSet;
-
- public Catalog(CatalogSet catalogResourceSet, String id, String location)
- {
- this.resourceSet = catalogResourceSet;
- this.id = id;
- this.location = location;
-
- if (XMLCorePlugin.DEFAULT_CATALOG_ID.equals(id))
- {
- catalogLS = new DefaultCatalogLS();
- } else if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(id))
- {
- catalogLS = new SystemCatalogLS();
- } else
- {
- catalogLS = new UserCatalogLS();
- }
- }
-
- public void addCatalogElement(ICatalogElement element)
- {
- synchronized (catalogElements) {
- catalogElements.add(element);
- }
- element.setOwnerCatalog(this);
- internalResolver = null;
- notifyAddElement(element);
- }
-
- public void addEntriesFromCatalog(ICatalog catalog)
- {
- try
- {
- setNotificationEnabled(false);
- if (catalog != null)
- {
- ICatalogElement[] entries = ((Catalog)catalog).getCatalogElements();
- for (int i = 0; i < entries.length; i++)
- {
- CatalogElement clone = (CatalogElement)((CatalogElement)entries[i]).clone();
- addCatalogElement(clone);
- }
- } else
- {
- Logger.log(Logger.ERROR, "argument was null in Catalog.addEntriesFromCatalog"); //$NON-NLS-1$
- }
- } finally
- {
- setNotificationEnabled(true);
- }
- internalResolver = null;
- notifyChanged();
- }
-
- public void addListener(ICatalogListener listener)
- {
- listenerList.add(listener);
- }
-
- public void clear()
- {
- synchronized (catalogElements) {
- catalogElements.clear();
- }
- internalResolver = null;
- notifyChanged();
- }
-
- public ICatalogElement createCatalogElement(int type)
- {
- switch (type)
- {
- case ICatalogElement.TYPE_ENTRY:
- return new CatalogEntry(); // TODO: Should be kind of deprecated
- case ICatalogElement.TYPE_NEXT_CATALOG:
- return new NextCatalog();
- case ICatalogEntry.ENTRY_TYPE_PUBLIC:
- case ICatalogEntry.ENTRY_TYPE_SYSTEM:
- case ICatalogEntry.ENTRY_TYPE_URI:
- return new CatalogEntry(type);
- case ICatalogElement.TYPE_REWRITE:
- case IRewriteEntry.REWRITE_TYPE_SYSTEM:
- case IRewriteEntry.REWRITE_TYPE_URI:
- return new RewriteEntry(type);
- case ICatalogElement.TYPE_SUFFIX:
- case ISuffixEntry.SUFFIX_TYPE_SYSTEM:
- case ISuffixEntry.SUFFIX_TYPE_URI:
- return new SuffixEntry(type);
- case ICatalogElement.TYPE_DELEGATE:
- case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- return new DelegateCatalog(type);
- default:
- throw new IllegalArgumentException("Unknown element type " + type);//$NON-NLS-1 // Makes no sense at all!
- }
- }
-
- public String getBase()
- {
- return base;
- }
-
- private List getCatalogElements(int type)
- {
- List result = new ArrayList();
- ICatalogElement[] elements = (ICatalogElement[]) catalogElements
- .toArray(new ICatalogElement[catalogElements.size()]);
- for (int i = 0; i < elements.length; i++)
- {
- ICatalogElement element = elements[i];
- if (element.getType() == type)
- {
- result.add(element);
- }
- }
- return result;
- }
-
- public ICatalogEntry[] getCatalogEntries()
- {
- List result = getCatalogElements(ICatalogElement.TYPE_ENTRY);
- return (ICatalogEntry[]) result
- .toArray(new ICatalogEntry[result.size()]);
- }
-
- public IDelegateCatalog[] getDelegateCatalogs()
- {
- List result = getCatalogElements(ICatalogElement.TYPE_DELEGATE);
- return (IDelegateCatalog[]) result
- .toArray(new IDelegateCatalog[result.size()]);
- }
-
- public IRewriteEntry[] getRewriteEntries()
- {
- List result = getCatalogElements(ICatalogElement.TYPE_REWRITE);
- return (IRewriteEntry[]) result
- .toArray(new IRewriteEntry[result.size()]);
- }
-
- public ISuffixEntry[] getSuffixEntries()
- {
- List result = getCatalogElements(ICatalogElement.TYPE_SUFFIX);
- return (ISuffixEntry[]) result
- .toArray(new ISuffixEntry[result.size()]);
- }
-
- protected CatalogSet getCatalogSet()
- {
- return resourceSet;
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getLocation()
- {
- return location;
- }
-
- public INextCatalog[] getNextCatalogs()
- {
- List result = getCatalogElements(ICatalogElement.TYPE_NEXT_CATALOG);
- return (INextCatalog[]) result.toArray(new INextCatalog[result.size()]);
- }
-
- protected InternalResolver getOrCreateInternalResolver()
- {
- if (internalResolver == null)
- {
- internalResolver = new InternalResolver();
- }
- return internalResolver;
- }
-
- protected boolean isNotificationEnabled()
- {
- return isNotificationEnabled;
- }
-
- public void load() throws IOException
- {
- catalogLS.load();
- }
-
- protected void notifyAddElement(ICatalogElement entry)
- {
- if (isNotificationEnabled)
- {
- ICatalogEvent event = new CatalogEvent(this, entry,
- ICatalogEvent.ELEMENT_ADDED);
- notifyListeners(event);
- }
- }
-
- protected void notifyChanged()
- {
- ICatalogEvent event = new CatalogEvent(this, null,
- ICatalogEvent.CHANGED);
- notifyListeners(event);
- }
-
- protected void notifyListeners(ICatalogEvent event)
- {
- List list = new ArrayList();
- list.addAll(listenerList);
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- ICatalogListener listener = (ICatalogListener) i.next();
- listener.catalogChanged(event);
- }
- }
-
- protected void notifyRemoveElement(ICatalogElement element)
- {
- if (isNotificationEnabled)
- {
- ICatalogEvent event = new CatalogEvent(this, element,
- ICatalogEvent.ELEMENT_REMOVED);
- notifyListeners(event);
- }
- }
-
- public void removeCatalogElement(ICatalogElement element)
- {
- synchronized (catalogElements) {
- catalogElements.remove(element);
- }
- internalResolver = null;
- notifyRemoveElement(element);
-
- }
-
- public void removeListener(ICatalogListener listener)
- {
- listenerList.remove(listener);
- }
-
- public String resolvePublic(String publicId, String systemId)
- throws MalformedURLException, IOException
- {
- return getOrCreateInternalResolver().resolvePublic(publicId, systemId);
- }
-
- protected String resolveSubordinateCatalogs(int entryType, String publicId,
- String systemId) throws MalformedURLException, IOException
- {
- String result = null;
- INextCatalog[] nextCatalogs = getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++)
- {
- INextCatalog nextCatalog = nextCatalogs[i];
- ICatalog catalog = nextCatalog.getReferencedCatalog();
- if (catalog != null)
- {
- switch (entryType)
- {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC:
- result = catalog.resolvePublic(publicId, systemId);
- break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM:
- result = catalog.resolveSystem(systemId);
- break;
- case ICatalogEntry.ENTRY_TYPE_URI:
- result = catalog.resolveURI(systemId);
- break;
- default:
- break;
- }
- if (result != null)
- {
- return result;
- }
- }
- }
- return null;
- }
-
- public String resolveSystem(String systemId) throws MalformedURLException,
- IOException
- {
- return getOrCreateInternalResolver().resolveSystem(systemId);
- }
-
- public String resolveURI(String uri) throws MalformedURLException,
- IOException
- {
- return getOrCreateInternalResolver().resolveURI(uri);
- }
-
- public void save() throws IOException
- {
- catalogLS.save();
- }
-
- public void setBase(String base)
- {
- this.base = base;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public void setLocation(String location)
- {
- this.location = location;
- }
-
- protected void setNotificationEnabled(boolean b)
- {
- isNotificationEnabled = b;
- }
-
- public ICatalogElement[] getCatalogElements()
- {
- return (ICatalogElement[]) catalogElements.toArray(new ICatalogElement[catalogElements.size()]);
- }
-
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
deleted file mode 100644
index 2f01c5fc67..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.osgi.framework.Bundle;
-
-public class CatalogContributorRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "catalogContributions"; //$NON-NLS-1$
- protected static final String TAG_CONTRIBUTION = "catalogContribution"; //$NON-NLS-1$
- /*
- * this is a sample exptension
- * <extension point="org.eclipse.wst.xml.core.catalogContributions">
- * <catalogContribution>
- * <uri
- * name="http://schemas.xmlsoap.org/wsdl/soap/"
- * uri="xsd/soap.xsd"/>
- * <public
- * publicId="-//W3C//DTD XHTML 1.1//EN"
- * uri="dtds/xhtml11-flat.dtd"/>
- * <nextCatalog id="nestedCatalog" catalog="data/catalog1.xml"/>
- * </catalogContribution>
- * </extension>
- *
- */
- protected ICatalog catalog;
-
- protected String declaringExtensionId;
-
- protected CatalogContributorRegistryReader(ICatalog aCatalog)
- {
- catalog = aCatalog;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- protected void readRegistry()
- {
- IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), EXTENSION_POINT_ID);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
-
- }
-
- public static String resolvePath(URL platformURL, String path)
- {
- String fileLocation = path;
- int jarPathStart = path.indexOf("jar:"); //$NON-NLS-1$
- jarPathStart = jarPathStart < 0 ? 0 : jarPathStart + "jar:".length(); //$NON-NLS-1$
- int jarPathEnd = path.indexOf("!"); //$NON-NLS-1$
- jarPathEnd = jarPathEnd < 0 ? path.length() : jarPathEnd;
- fileLocation = path.substring(jarPathStart, jarPathEnd);
-
- String result = path;
- String resolvedLocation = fileLocation;
- URL resolvedURL = null;
- if (fileLocation.startsWith("platform:/plugin")) //$NON-NLS-1$
- {
- // this is the speclial case, where the resource is located relative
- // to another plugin (not the one that declares the extension point)
- //
- try
- {
- resolvedURL = Platform.resolve(new URL(fileLocation));
- } catch (IOException e)
- {
- // do nothing
- }
- }
- else{
- // this is the typical case, where the resource is located relative
- // to the plugin that declares the extension point
- try {
- resolvedURL = new URL(Platform.resolve(platformURL), fileLocation);
- } catch (IOException e) {
- // do nothing
- }
- }
-
- if(resolvedURL != null){
- resolvedLocation = resolvedURL.toExternalForm().replace('\\', '/');
- result = result.replaceFirst(fileLocation, resolvedLocation);
- }
- return result;
- }
-
- public static URL getPlatformURL(String pluginId){
- Bundle bundle = Platform.getBundle(pluginId);
- if (bundle != null)
- {
- URL bundleEntry = bundle.getEntry("/"); //$NON-NLS-1$
-
- if(bundleEntry != null){
- try
- {
- return Platform.resolve(bundleEntry);
- } catch (IOException e)
- {
- Logger.logException(e);
- }
- }
- }
- return null;
- }
-
- private String resolvePath(String path)
- {
- return resolvePath(getPlatformURL(declaringExtensionId), path);
- }
-
- protected void readElement(IConfigurationElement element)
- {
- try
- {
- declaringExtensionId = element.getDeclaringExtension().getNamespace();
- }
- catch (InvalidRegistryObjectException e)
- {
- Logger.logException(e);
- }
-
- if (TAG_CONTRIBUTION.equals(element.getName())){
- IConfigurationElement[] mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_PUBLIC);
- processMappingInfoElements(mappingInfoElementList);
- mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_SYSTEM);
- processMappingInfoElements(mappingInfoElementList);
- mappingInfoElementList = element.getChildren(OASISCatalogConstants.TAG_URI);
- processMappingInfoElements(mappingInfoElementList);
- IConfigurationElement[] nextCatalogElementList = element.getChildren(OASISCatalogConstants.TAG_NEXT_CATALOG);
- processNextCatalogElements(nextCatalogElementList);
-
- }
-
- }
-
- private void processMappingInfoElements(IConfigurationElement[] childElementList)
- {
- if (catalog == null)
- return;
- for (int i = 0; i < childElementList.length; i++)
- {
- IConfigurationElement childElement = childElementList[i];
- String name = childElement.getName();
- String key = null;
-
- int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
- if (OASISCatalogConstants.TAG_PUBLIC.equals(name))
- {
- key = childElement.getAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID);
- }
- else if (OASISCatalogConstants.TAG_SYSTEM.equals(name))
- {
- key = childElement.getAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID);
- type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
- }
- else if (OASISCatalogConstants.TAG_URI.equals(name))
- {
- key = childElement.getAttribute(OASISCatalogConstants.ATTR_NAME);
- type = ICatalogEntry.ENTRY_TYPE_URI;
- }
- else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(name))
- {
- processNextCatalogElements(new IConfigurationElement[]{childElement});
- continue;
- }
- if (key == null || key.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
- continue;
- }
- String entryURI = childElement.getAttribute(OASISCatalogConstants.ATTR_URI); // mandatory
- if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
- continue;
- }
- ICatalogElement catalogElement = catalog.createCatalogElement(type);
- if (catalogElement instanceof ICatalogEntry)
- {
- ICatalogEntry entry = (ICatalogEntry) catalogElement;
- entry.setKey(key);
- String resolvedPath = resolvePath(entryURI);
- entry.setURI(resolvedPath);
- String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); // optional
- if (id != null && !id.equals("")) //$NON-NLS-1$
- {
- entry.setId(id);
- }
- }
- // process any other attributes
- for (int j = 0; j < childElement.getAttributeNames().length; j++)
- {
- String attrName = childElement.getAttributeNames()[j];
- if (!attrName.equals(OASISCatalogConstants.ATTR_URI) && !attrName.equals(OASISCatalogConstants.ATTR_NAME) && !attrName.equals(OASISCatalogConstants.ATTR_PUBLIC_ID)
- && !attrName.equals(OASISCatalogConstants.ATTR_SYSTEM_ID) && !attrName.equals(OASISCatalogConstants.ATTR_CATALOG) && !attrName.equals(OASISCatalogConstants.ATTR_ID)
- && !attrName.equals(OASISCatalogConstants.ATTR_BASE))
- {
- String attrValue = childElement.getAttribute(attrName);
- if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
- {
- catalogElement.setAttributeValue(attrName, attrValue);
- }
- }
- }
- catalog.addCatalogElement(catalogElement);
- }
- }
-
- private void processNextCatalogElements(IConfigurationElement[] childElementList)
- {
- if (catalog == null)
- return;
- for (int i = 0; i < childElementList.length; i++)
- {
- IConfigurationElement childElement = childElementList[i];
- String location = childElement.getAttribute(OASISCatalogConstants.ATTR_CATALOG); // mandatory
- if (location == null || location.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_next_catalog_location_uri_not_set);
- continue;
- }
- INextCatalog nextCatalog = new NextCatalog();
- String resolvedPath = resolvePath(location);
- nextCatalog.setCatalogLocation(resolvedPath);
- String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID);
- if (id != null && !id.equals("")) //$NON-NLS-1$
- {
- nextCatalog.setId(id);
- }
- catalog.addCatalogElement(nextCatalog);
- }
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
deleted file mode 100644
index ef86e228ac..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moller - jesper@selskabet.org - bug 112284
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-
-
-public class CatalogElement implements ICatalogElement
-{
- int type;
-
- String id;
-
- String base;
-
- Map attributes = new HashMap();
-
- ICatalog ownerCatalog;
-
- public CatalogElement(int aType)
- {
- super();
- type = aType;
- }
-
- public int getType()
- {
- return type;
- }
-
- public String getBase()
- {
- return base;
- }
-
- public void setBase(String base)
- {
- this.base = base;
- }
-
- public String getAttributeValue(String name)
- {
- return (String) attributes.get(name);
- }
-
- public void setAttributeValue(String name, String value)
- {
- attributes.put(name, value);
- }
-
- public String[] getAttributes()
- {
- Collection c = attributes.values();
- String[] result = new String[c.size()];
- attributes.keySet().toArray(result);
- return result;
- }
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public ICatalog getOwnerCatalog()
- {
- return ownerCatalog;
- }
-
- public void setOwnerCatalog(ICatalog catalog)
- {
- this.ownerCatalog = catalog;
- }
-
- protected static String makeAbsolute(String baseLocation, String location)
- {
- URL local = null;
- location = location.replace('\\', '/');
- try
- {
- URL baseURL = new URL(baseLocation);
- local = new URL(baseURL, location);
- } catch (MalformedURLException e)
- {
- }
-
- if (local != null)
- {
- return local.toString();
- } else
- {
- return location;
- }
- }
-
- public String getAbsolutePath(String path)
- {
- try
- {
- URI uri = new URI(path);
- if (uri.isAbsolute())
- {
- return path;
- }
- } catch (URISyntaxException e)
- {
- }
-
- if (this.base != null && !this.base.equals("")) //$NON-NLS-1$
- {
- return makeAbsolute(base, path);
- }
-
- String result = path;
- Catalog catalog = (Catalog) getOwnerCatalog();
- if (catalog != null)
- {
- String base = catalog.getBase();
- if (base == null || base.equals("")) //$NON-NLS-1$
- {
- base = catalog.getLocation();
- }
- result = makeAbsolute(base, path);
- }
- return result;
- }
-
- /*
- * Since we don't have events notifications for entry properties, clone()
- * could allow to copy and edit entry and then replace it in catalog. Entry
- * replacement will signal ICatalogEvent @return
- */
- public Object clone()
- {
- ICatalogElement element = ownerCatalog.createCatalogElement(type);
- String[] attributes = getAttributes();
- for (int i = 0; i < attributes.length; i++)
- {
- String attrName = attributes[i];
- String attrValue = getAttributeValue(attrName);
- element.setAttributeValue(attrName, attrValue);
- }
- element.setOwnerCatalog(ownerCatalog);
- element.setId(id);
- element.setBase(base);
- return element;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java
deleted file mode 100644
index 550a8e41d9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-public class CatalogEntry extends CatalogElement implements ICatalogEntry, Cloneable
-{
- int entryType = ICatalogEntry.ENTRY_TYPE_PUBLIC;
- String key;
- String uri;
-
- protected CatalogEntry(int anEntryType)
- {
- super(ICatalogElement.TYPE_ENTRY);
- entryType = anEntryType;
- }
-
- protected CatalogEntry()
- {
- super(ICatalogElement.TYPE_ENTRY);
- }
-
- public void setEntryType(int value)
- {
- entryType = value;
- }
-
- public int getEntryType()
- {
- return entryType;
- }
-
- public void setKey(String value)
- {
- key = value;
- }
-
- public String getKey()
- {
- return key;
- }
-
- public String getURI()
- {
- return uri;
- }
-
- public void setURI(String value)
- {
- uri = value;
- }
-
- public Object clone()
- {
- CatalogEntry entry = (CatalogEntry)super.clone();
- entry.setEntryType(entryType);
- entry.setKey(key);
- entry.setURI(uri);
- return entry;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java
deleted file mode 100644
index 8fba64d62f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
-
-
-public class CatalogEvent implements ICatalogEvent
-{
- protected ICatalog catalog;
- protected ICatalogElement catalogElement;
- protected int eventType;
-
- public CatalogEvent(Catalog catalog, ICatalogElement element, int eventType)
- {
- this.catalog = catalog;
- this.catalogElement = element;
- this.eventType = eventType;
- }
-
- public ICatalog getCatalog()
- {
- return catalog;
- }
-
- public ICatalogElement getCatalogElement()
- {
- return catalogElement;
- }
-
- public int getEventType()
- {
- return eventType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
deleted file mode 100644
index d53a15b02c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Stack;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- *
- */
-public final class CatalogReader
-{
- public static void read(Catalog xmlCatalog, InputStream input) throws IOException
- {
- try
- {
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);//$NON-NLS-1$
- SAXParser parser = factory.newSAXParser();
- parser.parse(new InputSource(input), new CatalogContentHandler(xmlCatalog));
- }
- catch (ParserConfigurationException e)
- {
- Logger.logException(e);
- }
- catch (SAXException e)
- {
- Logger.logException(e);
- }
- }
- protected static class CatalogContentHandler extends DefaultHandler
- {
- protected Catalog catalog;
- protected Stack baseURIStack = new Stack();
-
- public CatalogContentHandler(Catalog xmlCatalog)
- {
- this.catalog = xmlCatalog;
- String base = xmlCatalog.getBase();
- if(base == null || base == "") { //$NON-NLS-1$
- base = xmlCatalog.getLocation();
- }
- baseURIStack.push(base);
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- {
- // set base attribute xml:base
- String base = attributes.getValue(OASISCatalogConstants.ATTR_BASE); //$NON-NLS-1$
- if (base != null && !base.equals("")) //$NON-NLS-1$
- {
- // since the xml:base attribute can be relative to the enclosing element's effective base, we're maintaining a
- // stack of absolute URIs
- if (URI.createURI(base).isRelative())
- {
- base = URI.resolveRelativeURI(base, baseURIStack.peek().toString());
- }
-
- baseURIStack.push(URIHelper.ensureURIProtocolFormat(base));
- } else {
- baseURIStack.push(baseURIStack.peek());
- }
-
- // processing for backward compatibility start
- if (localName.equals(CompatabilityConstants.TAG_USER_ENTRY))
- {
- String typeName = attributes.getValue("", CompatabilityConstants.ATT_TYPE); //$NON-NLS-1$
- boolean isSystem = false;
- if (typeName != null)
- {
- isSystem = (typeName.compareToIgnoreCase("SYSTEM") == 0); //$NON-NLS-1$
- }
- ICatalogEntry catalogEntry = new CatalogEntry(isSystem ? ICatalogEntry.ENTRY_TYPE_SYSTEM : ICatalogEntry.ENTRY_TYPE_PUBLIC);
- catalogEntry.setKey(attributes.getValue("", CompatabilityConstants.ATT_ID)); //$NON-NLS-1$
- String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI); //$NON-NLS-1$
-
- // For relative URIs, try to resolve them using the corresponding base URI.
- catalogEntry.setURI(resolveRelative(entryUri));
-
- String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL); //$NON-NLS-1$
- if (webURL != null)
- {
- catalogEntry.setAttributeValue(
- ICatalogEntry.ATTR_WEB_URL, webURL);
- }
- catalog.addCatalogElement(catalogEntry);
- return;
- }
- // processing for backward compatibility end
- ICatalogElement catalogElement = null;
-
- if (OASISCatalogConstants.TAG_PUBLIC.equals(localName))
- {
- // 6.5.3. The public Entry
- catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_PUBLIC, OASISCatalogConstants.ATTR_PUBLIC_ID);
- }
- else if (OASISCatalogConstants.TAG_SYSTEM.equals(localName))
- {
- // 6.5.4. The system Element
- catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID);
- }
- else if (OASISCatalogConstants.TAG_URI.equals(localName))
- {
- // 6.5.9. The uri Element
- catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_URI, OASISCatalogConstants.ATTR_NAME);
- }
- else if (OASISCatalogConstants.TAG_REWRITE_SYSTEM.equals(localName))
- {
- // 6.5.5. The rewriteSystem Element
- catalogElement = createRewrite(attributes, IRewriteEntry.REWRITE_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING);
- }
- else if (OASISCatalogConstants.TAG_REWRITE_URI.equals(localName))
- {
- // 6.5.9. The uri Element
- catalogElement = createRewrite(attributes, IRewriteEntry.REWRITE_TYPE_URI, OASISCatalogConstants.ATTR_URI_START_STRING);
- }
- else if (OASISCatalogConstants.TAG_DELEGATE_PUBLIC.equals(localName))
- {
- // 6.5.7. The delegatePublic Element
- catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_PUBLIC, OASISCatalogConstants.ATTR_PUBLIC_ID_START_STRING);
- }
- else if (OASISCatalogConstants.TAG_DELEGATE_SYSTEM.equals(localName))
- {
- // 6.5.8. The delegateSystem Element
- catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING);
- }
- else if (OASISCatalogConstants.TAG_DELEGATE_URI.equals(localName))
- {
- // 6.5.12. The delegateURI Element
- catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_URI, OASISCatalogConstants.ATTR_URI_START_STRING);
- }
- else if (OASISCatalogConstants.TAG_SYSTEM_SUFFIX.equals(localName))
- {
- // 6.5.6. The systemSuffix Element
- catalogElement = createSuffix(attributes, ISuffixEntry.SUFFIX_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_SUFFFIX);
- }
- else if (OASISCatalogConstants.TAG_URI_SUFFIX.equals(localName))
- {
- // 6.5.11. The uriSuffix Element
- catalogElement = createSuffix(attributes, ISuffixEntry.SUFFIX_TYPE_URI, OASISCatalogConstants.ATTR_URI_SUFFIX);
- }
- else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(localName))
- {
- catalogElement = createNextCatalog(attributes);
- }
-
- if (catalogElement == null)
- {
- // do not set the extra information
- return;
- }
-
- String attrId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);//$NON-NLS-1$
- if (attrId != null && ! "".equals(attrId)) catalogElement.setId(attrId);//$NON-NLS-1$
- // process any other attributes
- for (int j = 0; j < attributes.getLength(); j++)
- {
- String attrName = attributes.getLocalName(j);
- if (!attrName.equals(OASISCatalogConstants.ATTR_URI) && !attrName.equals(OASISCatalogConstants.ATTR_NAME) && !attrName.equals(OASISCatalogConstants.ATTR_PUBLIC_ID)
- && !attrName.equals(OASISCatalogConstants.ATTR_SYSTEM_ID) && !attrName.equals(OASISCatalogConstants.ATTR_CATALOG) && !attrName.equals(OASISCatalogConstants.ATTR_ID)
- && !attrName.equals(OASISCatalogConstants.ATTR_BASE))
- {
- String attrValue = attributes.getValue(attrName);
- if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
- {
- catalogElement.setAttributeValue(attrName, attrValue);
- }
- }
- }
- catalog.addCatalogElement(catalogElement);
-
- }
-
- private ICatalogElement createNextCatalog(Attributes attributes) {
- String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG); //$NON-NLS-1$
- NextCatalog delegate = new NextCatalog();
- delegate.setBase((String)baseURIStack.peek());
- delegate.setCatalogLocation(location);
- return delegate;
- }
-
- private ICatalogEntry createEntry(Attributes attributes, int entryType, String keyAttributeName) {
- String key = attributes.getValue("", keyAttributeName); //$NON-NLS-1$
- if (key == null || key.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
- return null;
- }
- String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); //$NON-NLS-1$
- if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
- return null;
- }
- CatalogEntry entry = new CatalogEntry(entryType);
- entry.setKey(key);
- entry.setURI(resolveRelative(entryURI));
- return entry;
- }
-
- private IRewriteEntry createRewrite(Attributes attributes, int entryType, String prefixStringName) {
- String startString = attributes.getValue("", prefixStringName); //$NON-NLS-1$
- if (startString == null || startString.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_rewrite_startString_not_set);
- return null;
- }
- String prefix = attributes.getValue("", OASISCatalogConstants.ATTR_REWRITE_PREFIX); //$NON-NLS-1$
- if (prefix == null || prefix.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_rewrite_prefix_not_set);
- return null;
- }
- RewriteEntry entry = new RewriteEntry(entryType);
- entry.setStartString(startString);
- entry.setRewritePrefix(resolveRelative(prefix));
- return entry;
- }
-
- private IDelegateCatalog createDelegate(Attributes attributes, int entryType, String startStringAttrName) {
- String startString = attributes.getValue("", startStringAttrName); //$NON-NLS-1$
- if (startString == null || startString.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_delegate_prefix_not_set);
- return null;
- }
- String catalogUri = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG); //$NON-NLS-1$
- if (catalogUri == null || catalogUri.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_delegate_prefix_not_set);
- return null;
- }
- DelegateCatalog entry = new DelegateCatalog(entryType);
- entry.setStartString(startString);
- entry.setCatalogLocation(catalogUri);
- return entry;
- }
-
- private ISuffixEntry createSuffix(Attributes attributes, int entryType, String suffixAttrName) {
- String suffix = attributes.getValue("", suffixAttrName); //$NON-NLS-1$
- if (suffix == null || suffix.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_suffix_string_not_set);
- return null;
- }
- String uri = attributes.getValue("", OASISCatalogConstants.ATTR_URI); //$NON-NLS-1$
- if (uri == null || uri.equals("")) //$NON-NLS-1$
- {
- Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_suffix_uri_not_set);
- return null;
- }
- SuffixEntry entry = new SuffixEntry(entryType);
- entry.setSuffix(suffix);
- entry.setURI(resolveRelative(uri));
- return entry;
- }
-
- private String resolveRelative(String entryURI)
- {
- if(URI.createURI(entryURI).isRelative())
- {
- entryURI = URI.resolveRelativeURI(entryURI, baseURIStack.peek().toString());
- }
- return URIHelper.ensureURIProtocolFormat(entryURI);
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException
- {
- if (baseURIStack.size() > 0)
- {
- baseURIStack.pop();
- }
- }
-
- }
-
- // for backward compatability
- interface CompatabilityConstants{
-
- public static final String TAG_ID_XML_CATALOG_SETTINGS = "XMLCatalogSettings"; //$NON-NLS-1$
- public static final String TAG_ID_USER_ENTRIES = "UserEntries"; //$NON-NLS-1$
- public static final String TAG_USER_ENTRY = "UserEntry"; //$NON-NLS-1$
- public static final String ATT_TYPE = "TYPE"; //$NON-NLS-1$
- public static final String ATT_ID = "ID"; //$NON-NLS-1$
- public static final String ATT_URI = "URI"; //$NON-NLS-1$
- public static final String ATT_WEB_URL = "WEB_URL"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
deleted file mode 100644
index e9e766152c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.catalog;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-
-public class CatalogSet {
- protected Map uriResourceMap = new HashMap();
- protected Map catalogPersistenceLocations = new HashMap();
- public CatalogSet() {
- super();
- }
-
- /**
- * Find a Catalog with the given ID. If one is not found, create one at the given URI.
- *
- * @param id
- * @param uri - the URI, the parent of this file path must already exist
- * @return
- */
- public Catalog lookupOrCreateCatalog(String id, String uri) {
- Catalog catalog = getCatalog(id, uri);
- if (catalog == null) {
- catalog = new Catalog(this, id, uri);
- try {
- catalog.load();
- uriResourceMap.put(uri, catalog);
- }
- catch (Exception e) {
- // we catch and log all exceptions, to disallow
- // one bad extension interfering with others
- Logger.logException("error loading catalog: " + id + " " + uri, e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return catalog;
- }
-
- private Catalog getCatalog(String id, String uri) {
- return (Catalog) uriResourceMap.get(uri);
- }
-
- public void putCatalogPersistenceLocation(String logicalURI, String actualURI) {
- catalogPersistenceLocations.put(logicalURI, actualURI);
- }
-
- // Never used?
- public String getCatalogPersistenceLocation(String id) {
- return (String) catalogPersistenceLocations.get(id);
- }
-
- public void clearResourceCache() {//Clearing only uriResourceMap is required
- uriResourceMap.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
deleted file mode 100644
index 30d5169ed4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Write OASIS XML Catalog format
- *
- */
-public final class CatalogWriter
-{
- private Document doc;
-
- public void write(ICatalog xmlCatalog, String uri) throws FileNotFoundException, IOException
- {
- OutputStream outputStream = null;
- try {
- visitCatalog(xmlCatalog);
- outputStream = getOutputStream(uri);
- serialize(outputStream);
- }
- finally {
- if(outputStream != null) {
- outputStream.close();
- }
- }
- }
-
- public void write(ICatalog catalog, OutputStream os) throws FileNotFoundException, IOException
- {
- if (catalog != null)
- {
- visitCatalog(catalog);
- serialize(os);
- }
- }
-
- private void visitCatalog(ICatalog xmlCatalog)
- {
- try
- {
- doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- }
- catch (ParserConfigurationException e)
- {
- Logger.logException(e);
- }
- if (doc == null)
- return;
- Element catalogElement = doc.createElementNS(OASISCatalogConstants.namespaceName, OASISCatalogConstants.TAG_CATALOG);
- doc.appendChild(catalogElement);
- processCatalogEntries(xmlCatalog, catalogElement);
- processNextCatalogs(xmlCatalog, catalogElement);
- processDelegateCatalogs(xmlCatalog, catalogElement);
- processSuffixEntries(xmlCatalog, catalogElement);
- processRewriteEntries(xmlCatalog, catalogElement);
- }
-
- private void processRewriteEntries(ICatalog catalog, Element parent)
- {
- IRewriteEntry[] catalogEntries = catalog.getRewriteEntries();
-
- for (int i = 0; i < catalogEntries.length; i++)
- {
- IRewriteEntry entry = catalogEntries[i];
- String startString = entry.getStartString();
- String prefix = entry.getRewritePrefix();
- Element childElement = null;
-
- switch (entry.getEntryType())
- {
- case IRewriteEntry.REWRITE_TYPE_SYSTEM :
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_REWRITE_SYSTEM);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING, startString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_REWRITE_PREFIX, prefix);
- }
- break;
- case IRewriteEntry.REWRITE_TYPE_URI:
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_REWRITE_URI);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI_START_STRING, startString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_REWRITE_PREFIX, prefix);
- }
- break;
- default :
- break;
- }
- if (childElement != null)
- {
- setAttributes(entry, childElement);
- parent.appendChild(childElement);
- }
- }
- }
-
- private void processSuffixEntries(ICatalog catalog, Element parent)
- {
- ISuffixEntry[] suffixEntries = catalog.getSuffixEntries();
-
- for (int i = 0; i < suffixEntries.length; i++)
- {
- ISuffixEntry entry = suffixEntries[i];
- String suffixString = entry.getSuffix();
- String uri = entry.getURI();
- Element childElement = null;
-
- switch (entry.getEntryType())
- {
- case ISuffixEntry.SUFFIX_TYPE_SYSTEM :
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_SYSTEM_SUFFIX);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_SUFFFIX, suffixString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
- }
- break;
- case ISuffixEntry.SUFFIX_TYPE_URI:
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_URI_SUFFIX);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI_SUFFIX, suffixString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
- }
- break;
- default :
- break;
- }
- if (childElement != null)
- {
- setAttributes(entry, childElement);
- parent.appendChild(childElement);
- }
- }
- }
-
- private void processDelegateCatalogs(ICatalog catalog, Element parent)
- {
- IDelegateCatalog[] delegateCatalogs = catalog.getDelegateCatalogs();
-
- for (int i = 0; i < delegateCatalogs.length; i++)
- {
- IDelegateCatalog entry = delegateCatalogs[i];
- String prefixString = entry.getStartString();
- String catalogLocation = entry.getCatalogLocation();
- Element childElement = null;
-
- switch (entry.getEntryType())
- {
- case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_PUBLIC);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID_START_STRING, prefixString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
- }
- break;
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_SYSTEM);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING, prefixString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
- }
- break;
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_URI);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI_START_STRING, prefixString);
- childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
- }
- break;
- default :
- break;
- }
- if (childElement != null)
- {
- setAttributes(entry, childElement);
- parent.appendChild(childElement);
- }
- }
- }
-
- private void processCatalogEntries(ICatalog catalog, Element parent)
- {
- ICatalogEntry[] catalogEntries = catalog.getCatalogEntries();
-
- for (int i = 0; i < catalogEntries.length; i++)
- {
- ICatalogEntry entry = catalogEntries[i];
- String key = entry.getKey();
- String uri = entry.getURI();
- Element childElement = null;
-
- switch (entry.getEntryType())
- {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC :
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_PUBLIC);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID, key);
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
- }
- break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM :
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_SYSTEM);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID, key);
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
- }
- break;
- case ICatalogEntry.ENTRY_TYPE_URI :
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_URI);
- if (childElement != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_NAME, key);
- childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
- }
- break;
- default :
- break;
- }
- if (childElement != null)
- {
- setAttributes(entry, childElement);
- parent.appendChild(childElement);
- }
- }
- }
-
- private void setAttributes(ICatalogElement entry, Element childElement)
- {
- String[] attributes = entry.getAttributes();
- for (int j = 0; j < attributes.length; j++)
- {
- String attrName = attributes[j];
- if (attrName != null && !attrName.equals("")) //$NON-NLS-1$
- {
- String attrValue = entry.getAttributeValue(attrName);
- if (childElement != null && attrValue != null)
- {
- childElement.setAttribute(attrName, attrValue);
- }
- }
- }
- String id = entry.getId();
- if (id != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
- }
- }
-
- private void processNextCatalogs(ICatalog catalog, Element parent)
- {
- // handle catalog entries
- INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
- Element childElement = null;
- //dw String attrValue = null;
- for (int i = 0; i < nextCatalogs.length; i++)
- {
- INextCatalog delegate = nextCatalogs[i];
- childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_NEXT_CATALOG);
- if (childElement != null)
- {
- parent.appendChild(childElement);
- String location = delegate.getCatalogLocation();
- if (location != null)
- {
- childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, location);
- }
- setAttributes(delegate, childElement);
- }
- }
- }
-
- private void serialize(OutputStream outputStream) throws FileNotFoundException, IOException
- {
- if (doc == null)
- return;
- try
- {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- Transformer transformer = transformerFactory.newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- // Unless a width is set, there will be only line breaks but no
- // indentation.
- // The IBM JDK and the Sun JDK don't agree on the property name,
- // so we set them both.
- //
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- String encoding = "UTF-8"; // TBD //$NON-NLS-1$
- if (encoding != null)
- {
- transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
- }
- transformer.transform(new DOMSource(doc), new StreamResult(outputStream));
- }
- catch (TransformerException e)
- {
- Logger.logException(e);
- }
- }
-
- private OutputStream getOutputStream(String uri) throws FileNotFoundException, IOException
- {
- String filePath = removeProtocol(uri);
- File file = new File(filePath);
- OutputStream stream = new FileOutputStream(file);
- return stream;
- }
-
- protected static String removeProtocol(String uri)
- {
- String result = uri;
- String protocol_pattern = ":"; //$NON-NLS-1$
- if (uri != null)
- {
- int index = uri.indexOf(protocol_pattern);
- if (index > 2)
- {
- result = result.substring(index + protocol_pattern.length());
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java
deleted file mode 100644
index 57e729ba78..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-
-
-
-public class DelegateCatalog extends TypedCatalogElement implements IDelegateCatalog
-{
- private String location;
- private ICatalog referencedCatalog;
- private String startString;
-
- public String getStartString()
- {
- return startString;
- }
-
- public void setStartString(String startString)
- {
- this.startString = startString;
- }
-
- public DelegateCatalog(int type)
- {
- super(ICatalogElement.TYPE_DELEGATE, type);
- }
-
- public String getCatalogLocation()
- {
- return location;
- }
-
- public ICatalog getReferencedCatalog()
- {
- if (referencedCatalog == null)
- {
- referencedCatalog = ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location));
- }
- return referencedCatalog;
- }
-
- public void setCatalogLocation(String uri)
- {
- location = uri;
- referencedCatalog = null;
- }
-
- public Object clone()
- {
- DelegateCatalog nextCatalog = (DelegateCatalog)super.clone();
- nextCatalog.setCatalogLocation(location);
- nextCatalog.setStartString(startString);
- return nextCatalog;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java
deleted file mode 100644
index 16f755ace9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Raj Mandayam, IBM
- * 136400 NextCatalog.getReferencedCatalog() takes a lot of time computing constant information
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-
-public class NextCatalog extends CatalogElement implements INextCatalog
-{
- private String location;
- private ICatalog referencedCatalog;
-
- public NextCatalog()
- {
- super(ICatalogElement.TYPE_NEXT_CATALOG);
- }
-
- public String getCatalogLocation()
- {
- return location;
- }
-
- public ICatalog getReferencedCatalog()
- {
- if (referencedCatalog == null)
- {
- referencedCatalog = ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location));
- }
- return referencedCatalog;
- }
-
- public void setCatalogLocation(String uri)
- {
- location = uri;
- referencedCatalog = null;
- }
-
- public Object clone()
- {
- NextCatalog nextCatalog = (NextCatalog)super.clone();
- nextCatalog.setCatalogLocation(location);
- return nextCatalog;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
deleted file mode 100644
index d716a62fe8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-public interface OASISCatalogConstants
-{
- String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog"; //$NON-NLS-1$
- /** Types of the catalog entries */
- /** The CATALOG element name. */
- String TAG_CATALOG = "catalog"; //$NON-NLS-1$
- /** The GROUP catalog entry. */
- String TAG_GROUP = "group"; //$NON-NLS-1$
- /** The PUBLIC catalog entry. */
- String TAG_PUBLIC = "public"; //$NON-NLS-1$
- /** The SYSTEM catalog etnry. */
- String TAG_SYSTEM = "system"; //$NON-NLS-1$
- /** The URI catalog entry. */
- String TAG_URI = "uri"; //$NON-NLS-1$
- /** The REWRITE_SYSTEM catalog entry. */
- String TAG_REWRITE_SYSTEM = "rewriteSystem"; //$NON-NLS-1$
- /** The REWRITE_URI catalog entry. */
- String TAG_REWRITE_URI = "rewriteURI"; //$NON-NLS-1$
- /** The systemSuffix catalog entry. */
- String TAG_SYSTEM_SUFFIX = "systemSuffix"; //$NON-NLS-1$
- /** The uriSuffix catalog entry. */
- String TAG_URI_SUFFIX = "uriSuffix"; //$NON-NLS-1$
- /** The DELEGATE_PUBLIC catalog entry. */
- String TAG_DELEGATE_PUBLIC = "delegatePublic"; //$NON-NLS-1$
- /** The DELEGATE_SYSTEM catalog entry. */
- String TAG_DELEGATE_SYSTEM = "delegateSystem"; //$NON-NLS-1$
- /** The DELEGATE_URI catalog entry. */
- String TAG_DELEGATE_URI = "delegateURI"; //$NON-NLS-1$
- /** The NEXT_CATALOG catalog entry. */
- String TAG_NEXT_CATALOG = "nextCatalog"; //$NON-NLS-1$
- /** Attributes */
- /** Attribute id used in all catalog entries */
- String ATTR_ID = "id"; //$NON-NLS-1$
- /** Attribute id base in all catalog entries */
- String ATTR_BASE = "xml:base"; //$NON-NLS-1$
- /** Attribute id prefer in catalog entries: CATALOG, GROUP */
- String ATTR_PREFERE = "prefer"; //$NON-NLS-1$
- /** Attribute used in catalog entries of type: PUBLIC */
- String ATTR_PUBLIC_ID = "publicId"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: SYSTEM
- */
- String ATTR_SYSTEM_ID = "systemId"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: SYSTEM_SUFFIX
- */
- String ATTR_SYSTEM_ID_SUFFFIX = "systemIdSuffix"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: URI
- */
- String ATTR_NAME = "name"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: PUBLIC, URI
- */
- String ATTR_URI = "uri"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: URI_SUFFIX
- */
- String ATTR_URI_SUFFIX = "uriSuffix"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: REWRITE_SYSTEM, DELEGATE_SYSTEM
- */
- String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: REWRITE_SYSTEM, REWRITE_URI
- */
- String ATTR_REWRITE_PREFIX = "rewritePrefix"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: DELEGATE_PUBLIC
- */
- String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: DELEGATE_PUBLIC,
- * DELEGATE_SYSTEM, DELEGATE_URI, NEXT_CATALOG
- */
- String ATTR_CATALOG = "catalog"; //$NON-NLS-1$
- /**
- * Attribute used in catalog entries of type: REWRITE_URI, DELEGATE_URI
- */
- String ATTR_URI_START_STRING = "uriStartString"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java
deleted file mode 100644
index 5d9590ea87..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-
-public class RewriteEntry extends TypedCatalogElement implements IRewriteEntry, Cloneable
-{
- String startString;
- String rewritePrefix;
-
- protected RewriteEntry(int anEntryType)
- {
- super(ICatalogElement.TYPE_REWRITE, anEntryType);
- }
-
- public String getStartString()
- {
- return startString;
- }
-
- public void setStartString(String startString)
- {
- this.startString = startString;
- }
-
- public String getRewritePrefix()
- {
- return rewritePrefix;
- }
-
- public void setRewritePrefix(String rewritePrefix)
- {
- this.rewritePrefix = rewritePrefix;
- }
-
- public Object clone()
- {
- RewriteEntry entry = (RewriteEntry) super.clone();
- entry.setRewritePrefix(rewritePrefix);
- entry.setStartString(startString);
- return entry;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java
deleted file mode 100644
index f9daaa563e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-
-public class SuffixEntry extends TypedCatalogElement implements ISuffixEntry, Cloneable
-{
- String suffix;
- String uri;
-
- protected SuffixEntry(int anEntryType)
- {
- super(ICatalogElement.TYPE_SUFFIX, anEntryType);
- }
-
- public void setSuffix(String value)
- {
- suffix = value;
- }
-
- public String getSuffix()
- {
- return suffix;
- }
-
- public String getURI()
- {
- return uri;
- }
-
- public void setURI(String value)
- {
- uri = value;
- }
-
- public Object clone()
- {
- SuffixEntry entry = (SuffixEntry)super.clone();
- entry.setSuffix(suffix);
- entry.setURI(uri);
- return entry;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java
deleted file mode 100644
index 8592d6b04a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog;
-
-
-public class TypedCatalogElement extends CatalogElement
-{
- protected int entryType;
-
- public TypedCatalogElement(int type, int entryType)
- {
- super(type);
- this.entryType = entryType;
- }
-
- final public void setEntryType(int value)
- {
- entryType = value;
- }
-
- final public int getEntryType()
- {
- return entryType;
- }
-
- public Object clone()
- {
- TypedCatalogElement temp = (TypedCatalogElement)super.clone();
- temp.setEntryType(this.getEntryType());
- return temp;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
deleted file mode 100644
index 0b4af07ab5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverExtension;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * This class is used to inject the XMLCatalog resolution behaviour into the
- * Common Extensible URI Resolver. This class is referenced in the XML Catalog
- * plugin's plugin.xml file.
- */
-public class XMLCatalogURIResolverExtension implements URIResolverExtension
-{
- public String resolve(IFile file, String baseLocation, String publicId, String systemId)
- {
- // if we have catalog in a project we may add it
- // to the catalog manager first
- ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- if (catalog == null)
- {
- Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_null_catalog);
- return null;
- }
- String resolved = null;
- if (systemId != null)
- {
- try
- {
- resolved = catalog.resolveSystem(systemId);
- if (resolved == null)
- {
- resolved = catalog.resolveURI(systemId);
- }
- }
- catch (MalformedURLException me)
- {
- Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url);
- resolved = null;
- }
- catch (IOException ie)
- {
- Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception);
- resolved = null;
- }
- }
- if (resolved == null)
- {
- if (publicId != null)
- {
- // CS : this is a temporary workaround for bug 96772
- //
- // For schemas we always use locations where available and only use
- // namespace when no location is specified. For XML entities (such as DOCTYPE)
- // default always utilize the public catalog entry.
- //
- // This lame test below roughly discriminate between schema and XML entities.
- // TODO (bug 103243) remove this lame test once we move to the new URIResolver API
- // since the new API is explicit about namespace and publicId
- //
- if (!(systemId != null && systemId.endsWith(".xsd"))) //$NON-NLS-1$
- {
- try
- {
- resolved = catalog.resolvePublic(publicId, systemId);
- if (resolved == null)
- {
- resolved = catalog.resolveURI(publicId);
- }
- }
- catch (MalformedURLException me)
- {
- Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url);
- resolved = null;
- }
- catch (IOException ie)
- {
- Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception);
- resolved = null;
- }
- }
- }
- }
- return resolved;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
deleted file mode 100644
index 6796b74f84..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-
-
-/**
- * A representation of the model object '<em><b>Catalog</b></em>'.
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface ICatalog
-{
- /**
- * Returns catalog id string
- *
- * @return catalog id string
- */
- String getId();
-
- /**
- * Sets catalog id string
- *
- */
- void setId(String id);
-
-
- void setLocation(String location);
- String getLocation();
-
- /**
- * Return the applicable or SYSTEM identifier.
- *
- * <p>
- * This method searches the Catalog and returns the system identifier
- * specified for the given system or identifiers. If no appropriate
- * or SYSTEM entry is found in the Catalog, null is returned.
- * </p>
- *
- * @param publicId
- * The identifier to locate in the catalog. Public
- * identifiers are normalized before comparison.
- * @param systemId
- * The nominal system identifier for the entity in question (as
- * provided in the source document).
- *
- * @throws MalformedURLException
- * The formal system identifier of a subordinate catalog cannot
- * be turned into a valid URL.
- * @throws IOException
- * Error reading subordinate catalog file.
- *
- * @return The system identifier to use. Note that the nominal system
- * identifier is not returned if a match is not found in the
- * catalog, instead null is returned to indicate that no match was
- * found.
- */
- String resolvePublic(String publicId, String systemId)
- throws MalformedURLException, IOException;
-
- /**
- * Return the applicable SYSTEM system identifier.
- *
- * <p>
- * If a SYSTEM entry exists in the Catalog for the system ID specified,
- * return the mapped value.
- * </p>
- *
- * <p>
- * On Windows-based operating systems, the comparison between the system
- * identifier provided and the SYSTEM entries in the Catalog is
- * case-insensitive.
- * </p>
- *
- * @param systemId
- * The system ID to locate in the catalog.
- *
- * @return The resolved system identifier.
- *
- * @throws MalformedURLException
- * The formal system identifier of a subordinate catalog cannot
- * be turned into a valid URL.
- * @throws IOException
- * Error reading subordinate catalog file.
- */
- String resolveSystem(String systemId) throws MalformedURLException,
- IOException;
-
- /**
- * Return the applicable URI.
- *
- * <p>
- * If a URI entry exists in the Catalog for the URI specified, return the
- * mapped value.
- * </p>
- *
- * <p>
- * URI comparison is case sensitive.
- * </p>
- *
- * @param uri
- * The URI to locate in the catalog.
- *
- * @return The resolved URI.
- *
- * @throws MalformedURLException
- * The system identifier of a subordinate catalog cannot be
- * turned into a valid URL.
- * @throws IOException
- * Error reading subordinate catalog file.
- */
- String resolveURI(String uri) throws MalformedURLException,
- IOException;
-
- /**
- * Adds catalog element to the collection of the catalog elements.
- *
- * @param element -
- * catalog element
- */
- void addCatalogElement(ICatalogElement element);
-
- /**
- * Removes catalog element from the collection of the catalog elements.
- *
- * @param element -
- * catalog element
- */
- void removeCatalogElement(ICatalogElement element);
-
- /**
- * Returns an array of catalog elements of type ICatalogElement.TYPE_ENTRY
- *
- * @return an array of catalog elements
- */
- ICatalogEntry[] getCatalogEntries();
-
- /**
- * Returns an array of catalog elements of type ICatalogElement.TYPE_REWRITE
- *
- * @return an array of rewrite catalog elements
- */
- IRewriteEntry[] getRewriteEntries();
-
- /**
- * Returns an array of catalog elements of type ICatalogElement.TYPE_SUFFIX
- *
- * @return an array of suffix entry elements
- */
- ISuffixEntry[] getSuffixEntries();
-
- /**
- * Returns an array of catalog elements of type ICatalogElement.TYPE_DELEGATE
- *
- * @return an array of delegate catalog elements
- */
- IDelegateCatalog[] getDelegateCatalogs();
-
- /**
- * Returns an array of catalog elements of type
- * ICatalogElement.TYPE_DELEGATE
- *
- * @return an array of catalog elements
- */
- INextCatalog[] getNextCatalogs();
-
- /**
- * Returns new catalog element with the specified type. If the type is one
- * of ELEMENT_TYPE, the result entry will have corresponding interface.
- *
- * @return
- */
- ICatalogElement createCatalogElement(int type);
-
- /**
- * Removes all the elements from this catalog.
- *
- */
- void clear();
-
- //void load() throws IOException;
-
- void save() throws IOException;
-
- /*
- * Loads catalog from the specified location. Expecting OASIS XML Catalog
- * format
- *
- * @param location -
- * uri of the file where catalog will be saved
-
- * @throws IOException -
- * problem loading file
- *
- */
- //void load(InputStream inputStream) throws IOException;
-
- /*
- * Saves catalog to the specified location in OASIS XML Catalog format
- *
- * @param location -
- * uri of the file where catalog will be saved
-
- * @throws IOException -
- * problem saving file
- *
- */
- //void save(OutputStream outputStream) throws IOException;
-
- /**
- * This method copies all catalog entries from source catalog to this one.
- *
- * @param catalog -
- * source catalog
- * @param includeNested -
- * a boolean flag indicating wether to include entries of the
- * same type from the nested catalogs
- */
- void addEntriesFromCatalog(ICatalog catalog);
-
- /**
- * Adds a listener of the catalog events
- *
- * @param listener -
- * listener of the catalog events
- * @see ICatalogEvent
- */
- void addListener(ICatalogListener listener);
-
- /**
- * Removes a listener of the catalog events
- *
- * @param listener -
- * listener of the catalog events
- * @see ICatalogEvent
- */
- void removeListener(ICatalogListener listener);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
deleted file mode 100644
index e011c9bce1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface ICatalogElement
-{
- /** Types of the catalog entries */
- /** The PUBLIC, URI or SYSTEM Catalog Entry. */
- int TYPE_ENTRY = 1;
-
- /** The NEXT_CATALOG Catalog Entry type. */
- int TYPE_NEXT_CATALOG = 10;
-
- /** Rewrite types (since XML Catalogs 1.1) */
- int TYPE_REWRITE = 20;
-
- /** Delegate types (sinceXML Catalogs 1.1) */
- int TYPE_DELEGATE = 30;
-
- /** Suffix types (since XML Catalogs 1.1) */
- int TYPE_SUFFIX = 40;
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- *
- * @return the value of the '<em>Type</em>' attribute.
- */
- int getType();
-
- /**
- * Returns the value of the attribute with specified name.
- *
- * @return the value of the attribute with specified name.
- * @see #setAttributeValue(String)
- */
- String getAttributeValue(String name);
-
- /**
- * Sets the value of the named attribute.
- *
- * @param name
- * the name of the attribute that will be set
- * @param value
- * the new value of the named attribute.
- * @see #getAttributeValue()
- */
- void setAttributeValue(String name, String value);
-
- /**
- * Returns an array of attribute names for any dynamic attributes that may exist
- *
- * @return array of attribute names
- * @see #getAttributeValue()
- * @see #setAttributeValue(String)
- */
- String[] getAttributes();
-
- /**
- * Returns element's id string
- *
- * @return element's id string
- */
- public String getId();
-
- /**
- * Sets element's id string
- *
- */
- public void setId(String id);
-
- public void setOwnerCatalog(ICatalog catalog);
-
- public ICatalog getOwnerCatalog();
-
- void setBase(String base);
-
- String getBase();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
deleted file mode 100644
index 372dbfe4f5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface ICatalogEntry extends ICatalogElement
-{
- /** The PUBLIC Catalog Entry type. */
- public static final int ENTRY_TYPE_PUBLIC = 2;
-
- /** The SYSTEM Catalog Entry type. */
- public static final int ENTRY_TYPE_SYSTEM = 3;
-
- /** The URI Catalog Entry type. */
- public static final int ENTRY_TYPE_URI = 4;
-
- /** Attribute name for Web address of catalog entry */
- public static final String ATTR_WEB_URL = "webURL"; //$NON-NLS-1$
-
- /**
- *
- * @param entryType
- */
- public void setEntryType(int entryType);
-
- /**
- *
- * @return
- */
- public int getEntryType();
-
- /**
- *
- * @param key
- */
- public void setKey(String key);
-
- /**
- *
- * @return
- */
- public String getKey();
-
- /**
- *
- * @return
- */
- public String getURI();
-
- /**
- *
- * @param uri
- */
- public void setURI(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java
deleted file mode 100644
index 7825768172..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog.provisional;
-
-
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface ICatalogEvent
-{
- /** */
- public static final int CHANGED = 0;
-
- public static final int ELEMENT_ADDED = 1;
-
- /** */
- public static final int ELEMENT_REMOVED = 2;
-
- /** */
- public static final int ELEMENT_CHANGED = 3;
-
- /**
- *
- * @return
- */
- public int getEventType();
-
- /**
- *
- * @return
- */
- public ICatalog getCatalog();
-
- /**
- *
- * @return
- */
- public ICatalogElement getCatalogElement();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java
deleted file mode 100644
index 7c3dc0d3fe..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog.provisional;
-
-import java.util.EventListener;
-
-
-/**
- * The clients of the catalog that want to listen to catalog changes should
- * implement this interface.
- *
- * @see ICatalog, ICatalogEvent,
- *
- */
-public interface ICatalogListener extends EventListener
-{
- /**
- * This method allows to react to catalog events
- *
- * @param event -
- * an event that client should react to
- */
- public void catalogChanged(ICatalogEvent event);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java
deleted file mode 100644
index 82040b0a7d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface IDelegateCatalog extends ICatalogElement
-{
- /** The SYSTEM Catalog Entry type. */
- int DELEGATE_TYPE_PUBLIC = 31;
-
- /** The SYSTEM Catalog Entry type. */
- int DELEGATE_TYPE_SYSTEM = 32;
-
- /** The URI Catalog Entry type. */
- int DELEGATE_TYPE_URI = 33;
-
- /**
- *
- * @param entryType
- */
- void setEntryType(int entryType);
-
- /**
- *
- * @return
- */
- int getEntryType();
-
- /**
- *
- * @param key
- */
- void setStartString(String key);
-
- /**
- *
- * @return
- */
- String getStartString();
-
- /**
- * Set location of the referenced catalog.
- *
- * @param uri -
- * location uri of the referenced catalog
- */
- void setCatalogLocation(String uri);
-
- /**
- * Get location uri of the referenced catalog.
- *
- * @return location uri of the referenced catalog
- */
- String getCatalogLocation();
-
- ICatalog getReferencedCatalog();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java
deleted file mode 100644
index 47c939cf80..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.catalog.provisional;
-
-
-
-/**
- *
- * A representation of the nextCatalog OASIS XML catalog element. Object of the
- * class that implements this interface would serve as a reference to the
- * catalog object.
- *
- * @see ICatalog, ICatalogElement
- *
- * This interface currently is used only by the catalog itself. Need to find if
- * there are any clients that need it.
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface INextCatalog extends ICatalogElement
-{
- /**
- * Set location of the referenced catalog.
- *
- * @param uri -
- * location uri of the referenced catalog
- */
- public void setCatalogLocation(String uri);
-
- /**
- * Get location uri of the referenced catalog.
- *
- * @return location uri of the referenced catalog
- */
- public String getCatalogLocation();
-
- public ICatalog getReferencedCatalog();
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java
deleted file mode 100644
index 9d9559220e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface IRewriteEntry extends ICatalogElement
-{
- /** The rewriteSystem Catalog type. */
- int REWRITE_TYPE_SYSTEM = 21;
-
- /** The URI Catalog Entry type. */
- int REWRITE_TYPE_URI = 22;
-
- /**
- *
- * @param entryType
- */
- void setEntryType(int entryType);
-
- /**
- *
- * @return
- */
- int getEntryType();
-
- /**
- *
- * @param key
- */
- void setStartString(String startString);
-
- /**
- *
- * @return
- */
- String getStartString();
-
- /**
- *
- * @return
- */
- String getRewritePrefix();
-
- /**
- *
- * @param uri
- */
- void setRewritePrefix(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java
deleted file mode 100644
index 0004014004..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Jesper Steen Moeller
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.catalog.provisional;
-
-/**
- *
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- */
-public interface ISuffixEntry extends ICatalogElement
-{
- /** The rewriteSystem Catalog type. */
- int SUFFIX_TYPE_SYSTEM = 41;
-
- /** The URI Catalog Entry type. */
- int SUFFIX_TYPE_URI = 42;
-
- /**
- *
- * @param entryType
- */
- void setEntryType(int entryType);
-
- /**
- *
- * @return
- */
- int getEntryType();
-
- /**
- *
- * @param key
- */
- void setSuffix(String suffixString);
-
- /**
- *
- * @return
- */
- String getSuffix();
-
- /**
- *
- * @return
- */
- String getURI();
-
- /**
- *
- * @param uri
- */
- void setURI(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/contentmodel/modelquery/IExternalSchemaLocationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/contentmodel/modelquery/IExternalSchemaLocationProvider.java
deleted file mode 100644
index 0f0a43defa..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/contentmodel/modelquery/IExternalSchemaLocationProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.wst.xml.core.contentmodel.modelquery;
-
-import java.net.URI;
-import java.util.Map;
-
-public interface IExternalSchemaLocationProvider extends org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider {
- String SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-schemaLocation"; //$NON-NLS-1$
- String NO_NAMESPACE_SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; //$NON-NLS-1$
-
- /**
- * Provided the file path URI, this will return the external schema location. The schema location is associated to a specific property,
- * which serves as the key in the map. The supported properties are:
- *
- * <p><b>http://apache.org/xml/properties/schema/external-schemaLocation</b> - The value for this property follows the same rules
- * as the schemaLocation attribute for an XML document (i.e., multiple schemas are acceptable and must be white-space separated).</p>
- *
- * <p><b>http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</b> - The value for this property follows the same
- * rules as the noNamespaceSchemaLocation attribute for an XML document (i.e., only one schema is allowed).
- *
- * @param filePath the path for the XML file
- * @return a {@link Map} associating the external-schemaLocation and/or external-noNamespaceSchemaLocation to the schema location
- */
- Map getExternalSchemaLocation(URI fileURI);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java
deleted file mode 100644
index 72a47024da..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMAnyElement interface
- */
-public interface CMAnyElement extends CMContent {
-/**
- * getNamespaceURI method
- * @return java.lang.String
- */
-String getNamespaceURI();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java
deleted file mode 100644
index c5f718fc13..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-import java.util.Enumeration;
-
-/**
- * AttributeDeclaration interface
- */
-public interface CMAttributeDeclaration extends CMNode {
- public static final int OPTIONAL = 1;
- public static final int REQUIRED = 2;
- public static final int FIXED = 3;
- public static final int PROHIBITED = 4;
-/**
- * getAttrName method
- * @return java.lang.String
- */
-String getAttrName();
-/**
- * getAttrType method
- * @return CMDataType
- */
-CMDataType getAttrType();
-/**
- * getDefaultValue method
- * @return java.lang.String
- * @deprecated -- to be replaced in future with additional CMDataType methods (currently found on CMDataTypeHelper)
- */
-String getDefaultValue();
-/**
- * getEnumAttr method
- * @return java.util.Enumeration
- * @deprecated -- to be replaced in future with additional CMDataType methods (currently found on CMDataTypeHelper)
- */
-Enumeration getEnumAttr();
-/**
- * getUsage method
- * @return int
- */
-int getUsage();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java
deleted file mode 100644
index 218b29751d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-public interface CMContent extends CMNode
-{
-/**
- * getMaxOccur method
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
-int getMaxOccur();
-/**
- * getMinOccur method
- * @return int
- *
- * If 0, it's OPTIONAL.
- * If 1, it's REQUIRED.
- */
-int getMinOccur();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
deleted file mode 100644
index b6472284be..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel;
-
-/**
- * CMDataType
- */
-public interface CMDataType extends CMNode {
-
- // todo... at some point we should remove these names to
- // avoid exposing implementation details via the interfaces
- //
- static final String CDATA = "CDATA"; //$NON-NLS-1$
- static final String ID = "ID"; //$NON-NLS-1$
- static final String IDREF = "IDREF"; //$NON-NLS-1$
- static final String IDREFS = "IDREFS"; //$NON-NLS-1$
- static final String ENTITY = "ENTITY"; //$NON-NLS-1$
- static final String ENTITIES = "ENTITIES"; //$NON-NLS-1$
- static final String NOTATION = "NOTATION"; //$NON-NLS-1$
- static final String NMTOKEN = "NMTOKEN"; //$NON-NLS-1$
- static final String NMTOKENS = "NMTOKENS"; //$NON-NLS-1$
- static final String NUMBER = "NUMBER"; //$NON-NLS-1$
- static final String URI = "URI"; //$NON-NLS-1$
- static final String ENUM = "ENUM"; //$NON-NLS-1$
-
- static final int IMPLIED_VALUE_NONE = 1;
- static final int IMPLIED_VALUE_FIXED = 2;
- static final int IMPLIED_VALUE_DEFAULT = 3;
-
-/**
- * getTypeName method
- * @return java.lang.String
- */
-String getDataTypeName();
-
-/**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
-
-int getImpliedValueKind();
-
-/**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
-String getImpliedValue();
-
-/**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
-String[] getEnumeratedValues();
-
-/**
- * getTypeName method
- * @return java.lang.String
- *
- * This method returns a suitable default value that can be used when an instance of the data type is created.
- * This returns null of a suitable default is not available.
- */
-String generateInstanceValue();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java
deleted file mode 100644
index 58d7a437f8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMDocument interface
- */
-public interface CMDocument extends CMNode {
-/**
- * getElements method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of ElementDeclaration
- */
-CMNamedNodeMap getElements();
-/**
- * getEntities method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of EntityDeclaration
- */
-CMNamedNodeMap getEntities();
-/**
- * getNamespace method
- * @return CMNamespace
- */
-CMNamespace getNamespace();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java
deleted file mode 100644
index 88e4d8dc3b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMDocumentation interface
- */
-public interface CMDocumentation extends CMNode {
- public String getValue();
- public String getLanguage();
- public String getSource();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java
deleted file mode 100644
index 2c48077e8a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMElementDeclaration interface
- */
-public interface CMElementDeclaration extends CMContent {
-
- public static final int ANY = 0;
- public static final int EMPTY = 1;
- public static final int ELEMENT = 2;
- public static final int MIXED = 3;
- public static final int PCDATA = 4;
- public static final int CDATA = 5; // todo... clarify this one
-/**
- * getAttributes method
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of AttributeDeclaration
- */
-CMNamedNodeMap getAttributes();
-/**
- * getCMContent method
- * @return CMContent
- *
- * Returns the root node of this element's content model.
- * This can be an CMElementDeclaration or a CMGroup
- */
-CMContent getContent();
-/**
- * getContentType method
- * @return int
- *
- * Returns one of :
- * ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
- */
-public int getContentType();
-/**
- * getElementName method
- * @return java.lang.String
- */
-String getElementName();
-
-/**
- * getDataType method
- * @return java.lang.String
- */
-CMDataType getDataType();
-
-/**
- * getLocalElements method
- * @return CMNamedNodeMap
- *
- * Returns a list of locally defined elements.
- */
-CMNamedNodeMap getLocalElements();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java
deleted file mode 100644
index 99b5434385..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMEntityDeclaration interface
- */
-public interface CMEntityDeclaration extends CMNode {
-
-/**
- * getName method
- * @return java.lang.String
- */
-String getName();
-/**
- * getValue method
- * @return java.lang.String
- */
-String getValue();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java
deleted file mode 100644
index ce01ca7410..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMGroup interface
- */
-public interface CMGroup extends CMContent {
-
- static final int ALL = 3;
- static final int CHOICE = 2;
- static final int SEQUENCE = 1;
-/**
- * getChildNodes method
- * @return CMNodeList
- *
- * Returns child CMNodeList, which includes ElementDefinition or CMElement.
- */
-CMNodeList getChildNodes();
-
-/**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
-int getOperator();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java
deleted file mode 100644
index 2c79b81f73..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-import java.util.Iterator;
-/**
- * NamedCMNodeMap
- */
-public interface CMNamedNodeMap {
-/**
- * getLength method
- * @return int
- */
-int getLength();
-/**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
-CMNode getNamedItem(String name);
-/**
- * item method
- * @return CMNode
- * @param index int
- */
-CMNode item(int index);
-
-/**
- *
- */
-Iterator iterator();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java
deleted file mode 100644
index 100bcbc53c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMNamespace interface
- */
-public interface CMNamespace extends CMNode {
-
-/**
- * getPrefix method
- * @return java.lang.String
- */
-String getPrefix();
-/**
- * getURI method
- * @return java.lang.String
- */
-String getURI();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java
deleted file mode 100644
index 8bd95e8a64..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMNode interface
- */
-public interface CMNode {
-
- static final int ANY_ELEMENT = 1;
- static final int ATTRIBUTE_DECLARATION = 2;
- static final int DATA_TYPE = 3;
- static final int DOCUMENT = 4;
- static final int ELEMENT_DECLARATION = 5;
- static final int ENTITY_DECLARATION = 6;
- static final int GROUP = 7;
- static final int NAME_SPACE = 8;
- static final int DOCUMENTATION = 9;
-/**
- * getNodeName method
- * @return java.lang.String
- */
-String getNodeName();
-/**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
-int getNodeType();
-
-/**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
-boolean supports(String propertyName);
-
-/**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
-Object getProperty(String propertyName); //todo throw unsupported property exception
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java
deleted file mode 100644
index 94adbf8c81..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-/**
- * CMNodeList interface
- */
-public interface CMNodeList {
-
-/**
- * getLength method
- * @return int
- */
-int getLength();
-/**
- * item method
- * @return CMNode
- * @param index int
- */
-CMNode item(int index);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java
deleted file mode 100644
index 602b16064b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactoryRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactoryRegistryReader;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileRegistryReader;
-
-
-/**
- * ContentModelManager class
- */
-public class ContentModelManager extends Plugin {
- // private static InferredGrammarFactory inferredGrammarFactory;
- private CMDocumentFactoryRegistry cmDocumentFactoryRegistry;
- private AnnotationFileRegistry annotationFileRegistry;
-
- private static ContentModelManager instance;
-
- public ContentModelManager() {
- super();
- }
-
- public static ContentModelManager getInstance() {
- if (instance == null) {
- instance = new ContentModelManager();
- }
- return instance;
- }
-
- public CMDocument createCMDocument(String uri, String resourceType) {
- if (resourceType == null && uri != null) {
- int index = uri.lastIndexOf("."); //$NON-NLS-1$
- resourceType = uri.substring(index + 1);
- }
-
- if (resourceType != null) {
- resourceType = resourceType.toLowerCase();
- }
- CMDocumentFactory factory = getCMDocumentFactoryRegistry().getFactory(resourceType);
- return factory != null ? factory.createCMDocument(uri) : null;
- }
-
-
- private CMDocumentFactoryRegistry getCMDocumentFactoryRegistry() {
- if (cmDocumentFactoryRegistry == null) {
- cmDocumentFactoryRegistry = new CMDocumentFactoryRegistry();
- new CMDocumentFactoryRegistryReader(cmDocumentFactoryRegistry).readRegistry();
- }
- return cmDocumentFactoryRegistry;
- }
-
-
- public List getAnnotationFilesInfos(String publicId) {
- return getAnnotationFileRegistry().getAnnotationFilesInfos(publicId);
- }
-
- private AnnotationFileRegistry getAnnotationFileRegistry() {
- if (annotationFileRegistry == null) {
- annotationFileRegistry = new AnnotationFileRegistry();
- new AnnotationFileRegistryReader(annotationFileRegistry).readRegistry();
- }
- return annotationFileRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java
deleted file mode 100644
index e0a3b3927d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.annotation;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- *
- */
-public class Annotation
-{
- protected Hashtable hashtable = new Hashtable();
-
- public Annotation()
- {
- }
-
- public void setSpec(String spec)
- {
- hashtable.put("spec", spec); //$NON-NLS-1$
- }
-
- public String getSpec()
- {
- return (String)hashtable.get("spec"); //$NON-NLS-1$
- }
-
- public void setProperty(String name, String value)
- {
- hashtable.put(name, value);
- }
-
- public String getProperty(String propertyName)
- {
- return (String)hashtable.get(propertyName);
- }
-
- public List getAttributeList()
- {
- return null; // todo
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java
deleted file mode 100644
index 4b930350cd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.annotation;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationFileParser;
-
-
-/**
- * AnnotationMap
- */
-public class AnnotationMap {
- protected List list = new Vector();
- protected Hashtable hashtable = new Hashtable();
- protected boolean isCaseSensitive = true;
-
- public AnnotationMap() {
- }
-
- public void setCaseSensitive(boolean isCaseSensitive) {
- this.isCaseSensitive = isCaseSensitive;
- }
-
- public void addAnnotation(Annotation annotation) {
- String spec = annotation.getSpec();
- if (spec != null) {
- list.add(annotation);
- StringTokenizer st = new StringTokenizer(spec, "[]|\t\n\r\f "); //$NON-NLS-1$
- while (st.hasMoreTokens()) {
- String cmNodeSpec = st.nextToken();
- addAnnotationForCMNodeSpec(cmNodeSpec, annotation);
- }
- }
- }
-
- protected void addAnnotationForCMNodeSpec(String cmNodeSpec, Annotation annotation) {
- String key = isCaseSensitive ? cmNodeSpec : cmNodeSpec.toLowerCase();
- List list = (List) hashtable.get(key);
- if (list == null) {
- list = new Vector();
-
- hashtable.put(key, list);
- }
- list.add(annotation);
- }
-
- public String getProperty(String cmNodeSpec, String propertyName) {
- String result = null;
- String key = isCaseSensitive ? cmNodeSpec : cmNodeSpec.toLowerCase();
- List annotationList = (List) hashtable.get(key);
- if (annotationList != null) {
- for (Iterator i = annotationList.iterator(); i.hasNext();) {
- Annotation annotation = (Annotation) i.next();
- result = annotation.getProperty(propertyName);
- if (result != null) {
- break;
- }
- }
- }
- return result;
- }
-
- public String getProperty(CMNode cmNode, String propertyName) {
- String result = null;
- String cmNodeSpec = (String) cmNode.getProperty("spec"); //$NON-NLS-1$
- if (cmNodeSpec == null) {
- cmNodeSpec = cmNode.getNodeName();
- }
- if (cmNodeSpec != null) {
- result = getProperty(cmNodeSpec, propertyName);
- }
- return result;
- }
-
- public List getAnnotations() {
- return list;
- }
-
- public void load(String uri, String bundleId) throws Exception {
- AnnotationFileParser parser = new AnnotationFileParser();
- AnnotationFileInfo fileInfo = new AnnotationFileInfo(uri, bundleId);
- parser.parse(this, fileInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java
deleted file mode 100644
index 8300a90e14..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-
-
-public class CMAnyElementImpl extends CMContentImpl implements CMAnyElement
-{
- protected String namespaceURI;
-
- public CMAnyElementImpl(String namespaceURI)
- {
- this.namespaceURI = namespaceURI;
- minOccur = -1;
- }
-
- public static String computeNodeName(String uri)
- {
- return uri != null ? ("any#" + uri) : "any"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // implements CMNode
- //
- public String getNodeName()
- {
- return computeNodeName(namespaceURI);
- }
-
- public int getNodeType()
- {
- return ANY_ELEMENT;
- }
-
- // implements CMAnyElement
- //
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
deleted file mode 100644
index 4b554b63cd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.basic;
-
-import java.util.Enumeration;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-public class CMAttributeDeclarationImpl extends CMNodeImpl implements CMAttributeDeclaration
-{
- protected CMDataType dataType;
- protected String nodeName;
- protected int usage;
- protected CMDocument cmDocument;
- protected boolean prefixQualification;
- protected List xsiTypes;
-
- public CMAttributeDeclarationImpl(String nodeName, int usage)
- {
- this(nodeName, usage, new CMDataTypeImpl(CMDataType.CDATA, ""));
- }
-
- public CMAttributeDeclarationImpl(String nodeName, int usage, CMDataType dataType)
- {
- this.nodeName = nodeName;
- this.usage = usage;
- this.dataType = dataType;
- }
-
- public int getNodeType()
- {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals("CMDocument")) //$NON-NLS-1$
- {
- result = cmDocument;
- }
- else if (propertyName.equals("XSITypes")) //$NON-NLS-1$
- {
- result = xsiTypes;
- }
- else if (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification")) //$NON-NLS-1$
- {
- result = prefixQualification ? "qualified" : "unqualified"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- result = super.getProperty(propertyName);
- }
- return result;
- }
-
- public void setPrefixQualification(boolean qualified)
- {
- prefixQualification = qualified;
- }
-
- public void setXSITypes(List list)
- {
- xsiTypes = list;
- }
-
- public void setCMDocument(CMDocument cmDocument)
- {
- this.cmDocument = cmDocument;
- }
-
- public String getNodeName()
- {
- return nodeName;
- }
-
- public String getAttrName()
- {
- return nodeName;
- }
-
- public void setAttrType(CMDataType dataType)
- {
- this.dataType = dataType;
- }
-
- public CMDataType getAttrType()
- {
- return dataType;
- }
-
- public int getUsage()
- {
- return usage;
- }
-
- /** @deprecated */
- public String getDefaultValue()
- {
- return ""; //$NON-NLS-1$
- }
-
- /** @deprecated */
- public Enumeration getEnumAttr()
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java
deleted file mode 100644
index 2357eec6ee..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-
-
-public abstract class CMContentImpl extends CMNodeImpl implements CMContent
-{
- protected int minOccur = 0;
- protected int maxOccur = -1;
-
- // implements CMContent
- //
- public int getMaxOccur()
- {
- return maxOccur;
- }
-
- public int getMinOccur()
- {
- return minOccur;
- }
-
- // implementation specific
- //
- public void setMaxOccur(int n)
- {
- maxOccur = n;
- }
-
- public void setMinOccur(int n)
- {
- minOccur = n;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java
deleted file mode 100644
index a004626c01..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class CMDataTypeImpl extends CMNodeImpl implements CMDataType
-{
- protected String dataTypeName;
- protected String[] enumeratedValues;
- protected String instanceValue;
-
- public CMDataTypeImpl(String dataTypeName, String instanceValue)
- {
- this.dataTypeName = dataTypeName;
- this.instanceValue = instanceValue;
- this.enumeratedValues = new String[0];
- }
-
- public CMDataTypeImpl(String dataTypeName, String[] enumeratedValues)
- {
- this.dataTypeName = dataTypeName;
- this.enumeratedValues = enumeratedValues;
- this.instanceValue = enumeratedValues[0];
- }
-
-
- public int getNodeType()
- {
- return CMNode.DATA_TYPE;
- }
-
- public String getNodeName()
- {
- return getDataTypeName();
- }
-
- public String getDataTypeName()
- {
- return dataTypeName;
- }
-
- public int getImpliedValueKind()
- {
- return IMPLIED_VALUE_NONE;
- }
-
- public String getImpliedValue()
- {
- return null;
- }
-
- public String[] getEnumeratedValues()
- {
- return enumeratedValues;
- }
-
- public String generateInstanceValue()
- {
- return instanceValue;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java
deleted file mode 100644
index 7c76a8e453..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-
-
-public class CMDocumentImpl extends CMNodeImpl implements CMDocument
-{
- protected String targetNamespace;
- protected CMNamedNodeMapImpl elements = new CMNamedNodeMapImpl();
- protected CMNamedNodeMapImpl localElementPool;
- protected CMNamedNodeMapImpl anyElements;
-
- public CMDocumentImpl(String targetNamespace)
- {
- this.targetNamespace = targetNamespace;
- }
-
- public int getNodeType()
- {
- return DOCUMENT;
- }
-
- public String getNodeName()
- {
- return ""; //$NON-NLS-1$
- }
-
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals("http://org.eclipse.wst/cm/properties/targetNamespaceURI")) //$NON-NLS-1$
- {
- result = targetNamespace;
- }
- else
- {
- result = super.getProperty(propertyName);
- }
- return result;
- }
-
- public CMNamedNodeMap getElements()
- {
- return elements;
- }
-
- public CMNamedNodeMapImpl getAnyElements()
- {
- if (anyElements == null)
- {
- anyElements = new CMNamedNodeMapImpl();
- }
- return anyElements;
- }
-
- public CMNamedNodeMapImpl getLocalElementPool()
- {
- if (localElementPool == null)
- {
- localElementPool = new CMNamedNodeMapImpl();
- }
- return localElementPool;
- }
-
- public CMNamedNodeMap getEntities()
- {
- return new CMNamedNodeMapImpl();
- }
-
- public CMNamespace getNamespace()
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java
deleted file mode 100644
index 1879b9f777..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-
-public class CMElementDeclarationImpl extends CMContentImpl implements CMElementDeclaration
-{
- protected String name;
- protected CMDocument cmDocument;
- protected CMNamedNodeMapImpl attributeMap = new CMNamedNodeMapImpl();
- protected CMNamedNodeMapImpl localElementMap = new CMNamedNodeMapImpl();
- protected CMContent content;
- protected CMDataType dataType;
- protected boolean isLocal;
-
- public CMElementDeclarationImpl(CMDocument cmDocument, String name)
- {
- this.cmDocument = cmDocument;
- this.name = name;
- }
-
- // implements CMNode
- //
- public String getNodeName()
- {
- return name;
- }
-
- public int getNodeType()
- {
- return ELEMENT_DECLARATION;
- }
-
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification")) //$NON-NLS-1$
- {
- result = isLocal ? "unqualified" : "qualified"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (propertyName.equals("CMDocument")) //$NON-NLS-1$
- {
- result = cmDocument;
- }
- else
- {
- result = super.getProperty(propertyName);
- }
- return result;
- }
-
- // implements CMElementDeclaration
- //
- public CMNamedNodeMap getAttributes()
- {
- return attributeMap;
- }
-
- public CMContent getContent()
- {
- return content;
- }
-
- public int getContentType()
- {
- return MIXED;
- }
-
- public String getElementName()
- {
- return name;
- }
-
- public CMDataType getDataType()
- {
- return dataType;
- }
-
- public CMNamedNodeMap getLocalElements()
- {
- return localElementMap;
- }
-
- //
- //
- public void setContent(CMContent cmContent)
- {
- content = cmContent;
- }
-
- public void setDataType(CMDataType cmDataType)
- {
- dataType = cmDataType;
- }
-
- public CMNamedNodeMapImpl getAttributeMap()
- {
- return attributeMap;
- }
-
- public void setLocal(boolean isLocal)
- {
- this.isLocal = isLocal;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java
deleted file mode 100644
index a5d97fae9b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-
-public class CMEntityDeclarationImpl extends CMNodeImpl implements CMEntityDeclaration
-{
- protected String name;
- protected String value;
-
- public CMEntityDeclarationImpl(String name, String value)
- {
- this.name = name;
- this.value = value;
- }
-
- public int getNodeType()
- {
- return ENTITY_DECLARATION;
- }
-
- public String getNodeName()
- {
- return name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getValue()
- {
- return value;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java
deleted file mode 100644
index 59c4eced52..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMGroupImpl extends CMContentImpl implements CMGroup
-{
- protected CMNodeList nodeList;
- protected int operator;
-
- public CMGroupImpl(CMNodeList nodeList, int operator)
- {
- this.nodeList = nodeList;
- this.operator = operator;
- }
-
- public int getNodeType()
- {
- return GROUP;
- }
-
- public CMNodeList getChildNodes()
- {
- return nodeList;
- }
-
- public int getOperator()
- {
- return operator;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java
deleted file mode 100644
index fee63d247c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-public class CMNamedNodeMapImpl implements CMNamedNodeMap
-{
- public static CMNamedNodeMapImpl EMPTY_NAMED_NODE_MAP = new CMNamedNodeMapImpl();
- protected Hashtable table = new Hashtable();
-
- /**
- * CMNamedNodeMapImpl constructor comment.
- */
- public CMNamedNodeMapImpl()
- {
- super();
- }
-
- public CMNamedNodeMapImpl(CMNamedNodeMap initialContentsMap) {
- super();
- if (initialContentsMap != null) {
- int length = initialContentsMap.getLength();
- for (int j = 0; j < length; j++) {
- put(initialContentsMap.item(j));
- }
- }
- }
- /**
- * getLength method
- * @return int
- */
- public int getLength()
- {
- return table.size();
- }
-
- /**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
- public CMNode getNamedItem(String name)
- {
- return (CMNode)table.get(name);
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index)
- {
- CMNode result = null;
- int size = table.size();
- if (index < size)
- {
- Enumeration values = table.elements();
- for(int i = 0; i <= index; i++)
- {
- result = (CMNode)values.nextElement();
- }
- }
- return result;
- }
-
- public Hashtable getHashtable()
- {
- return table;
- }
-
- public Iterator iterator()
- {
- return table.values().iterator();
- }
-
- public void put(CMNode cmNode)
- {
- table.put(cmNode.getNodeName(), cmNode);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java
deleted file mode 100644
index a12e2acae9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-public abstract class CMNodeImpl implements CMNode
-{
- protected boolean isInferred = false;
-
- public String getNodeName()
- {
- return ""; //$NON-NLS-1$
- }
-
- public boolean supports(String propertyName)
- {
- return false;
- }
-
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if ("isInferred".equals(propertyName)) //$NON-NLS-1$
- {
- result = isInferred ? Boolean.TRUE : Boolean.FALSE;
- }
- return result;
- }
-
- public void setInferred(boolean isInferred)
- {
- this.isInferred = isInferred;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java
deleted file mode 100644
index 6bcba3862b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.basic;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-
-public class CMNodeListImpl implements CMNodeList
-{
- public static CMNodeListImpl EMPTY_NODE_LIST = new CMNodeListImpl(Collections.EMPTY_LIST);
- protected List list;
-
- public CMNodeListImpl()
- {
- this(new Vector());
- }
-
- public CMNodeListImpl(List list)
- {
- this.list = list;
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength()
- {
- return list.size();
- }
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index)
- {
- return (CMNode)list.get(index);
- }
-
- public List getList()
- {
- return list;
- }
-
- public Iterator iterator()
- {
- return list.iterator();
- }
-
- public boolean contains(CMNode cmNode)
- {
- return list.contains(cmNode);
- }
-
- public void add(CMNode cmNode)
- {
- list.add(cmNode);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java
deleted file mode 100644
index a84be9551a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.factory;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-// this interface is used to build a grammar document given a local file name
-//
-public interface CMDocumentFactory
-{
- public CMDocument createCMDocument(String uri);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java
deleted file mode 100644
index c737b92df8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.factory;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-public class CMDocumentFactoryDescriptor
-{
- private IConfigurationElement fElement;
- private CMDocumentFactory factory;
-
- public CMDocumentFactoryDescriptor(IConfigurationElement element)
- {
- this.fElement = element;
- }
-
- public CMDocumentFactory getFactory()
- {
- if (factory == null)
- {
- try
- {
- factory = (CMDocumentFactory) fElement.createExecutableExtension("class"); //$NON-NLS-1$
- }
- catch (Exception e)
- {
- Logger.logException("Exception loading CMDocumentFactory",e); //$NON-NLS-1$
- }
- }
- return factory;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java
deleted file mode 100644
index 9f403b9a16..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.factory;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- *
- *
- */
-public class CMDocumentFactoryRegistry
-{
- protected static CMDocumentFactoryRegistry instance;
-
- private static String DEFAULT_RESOURCE_TYPE = "*"; //$NON-NLS-1$
-
- protected Map resourceTypeMap = new HashMap();
-
- protected Vector documentBuilderList = new Vector();
-
- public CMDocumentFactoryRegistry() {
- }
-
- public void putFactory(String resourceType, CMDocumentFactoryDescriptor factoryDescriptor) {
- resourceTypeMap.put(resourceType, factoryDescriptor);
- }
-
- public CMDocumentFactory getFactory(String resourceType) {
- CMDocumentFactoryDescriptor factoryDescriptor = null;
- if (resourceType != null) {
- factoryDescriptor = (CMDocumentFactoryDescriptor) resourceTypeMap.get(resourceType);
- }
- if (factoryDescriptor == null) {
- // (dmw) issue: a default type of '*' means what? registered as
- // '*' is the way this works now. is that the intent? Or should it
- // mean registered as any other type?
- factoryDescriptor = (CMDocumentFactoryDescriptor) resourceTypeMap.get(DEFAULT_RESOURCE_TYPE);
- }
- return factoryDescriptor != null ? factoryDescriptor.getFactory() : null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java
deleted file mode 100644
index 6c8b193604..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.factory;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-
-
-public class CMDocumentFactoryRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "documentFactories"; //$NON-NLS-1$
- protected static final String TAG_NAME = "factory"; //$NON-NLS-1$
- protected static final String ATT_CLASS = "class"; //$NON-NLS-1$
- protected static final String ATT_TYPE = "type"; //$NON-NLS-1$
- protected String pluginId, extensionPointId;
-
- protected CMDocumentFactoryRegistry registry;
-
- public CMDocumentFactoryRegistryReader(CMDocumentFactoryRegistry registry)
- {
- this.registry = registry;
- }
-
- public void readRegistry()
- {
- String bundleid = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(bundleid, EXTENSION_POINT_ID);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(TAG_NAME))
- {
- String factoryClass = element.getAttribute(ATT_CLASS);
- String filenameExtensions = element.getAttribute(ATT_TYPE);
- if (factoryClass != null && filenameExtensions != null)
- {
- try
- {
- CMDocumentFactoryDescriptor descriptor = new CMDocumentFactoryDescriptor(element);
- for (StringTokenizer st = new StringTokenizer(filenameExtensions, ","); st.hasMoreTokens(); ) //$NON-NLS-1$
- {
- String token = st.nextToken().trim();
- registry.putFactory(token, descriptor);
- }
- }
- catch (Exception e)
- {
- Logger.logException(e);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java
deleted file mode 100644
index a9a372f01e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-/**
- * Contains information about annotation files
- */
-public class AnnotationFileInfo {
- private String fAnnotationFileLocation;
- private String fBundleId;
-
- public AnnotationFileInfo(String annotationFileLocation, String bundleId) {
- fAnnotationFileLocation = annotationFileLocation;
- fBundleId = bundleId;
- }
-
- /**
- * Get the location of the annotation file as originally specified.
- *
- * @return String
- */
- public String getAnnotationFileLocation() {
- return fAnnotationFileLocation;
- }
-
- /**
- * Get the bundle id where the annotation file is located.
- *
- * @return String
- */
- public String getBundleId() {
- return fBundleId;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java
deleted file mode 100644
index 641915df34..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.Annotation;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-/**
- *
- */
-public class AnnotationFileParser {
- public static final String TAG_ID_ANNOTATIONS = "abstractGrammarAnnotations"; //$NON-NLS-1$
- public static final String TAG_ID_ANNOTATION = "annotation"; //$NON-NLS-1$
- public static final String TAG_ID_PROPERTY = "property"; //$NON-NLS-1$
-
- /**
- * This method is called to parse an annotation file and store the
- * contents into an annotationMap
- */
- private void parse(AnnotationMap annotationMap, InputStream input, AnnotationFileInfo fileInfo) throws Exception {
- // move to Xerces-2.... add 'contextClassLoader' stuff
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
- try {
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(true);
- SAXParser parser = factory.newSAXParser();
- parser.parse(new InputSource(input), new AnnotationMapContentHandler(annotationMap, fileInfo));
- }
- finally {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- }
-
- /**
- * This method is called to parse an annotation file and store the
- * contents into an annotationMap
- */
- public void parse(AnnotationMap map, AnnotationFileInfo fileInfo) throws Exception {
- InputStream inputStream = null;
- try {
- URL url = Platform.find(Platform.getBundle(fileInfo.getBundleId()), Path.fromOSString(fileInfo.getAnnotationFileLocation()));
- if (url != null) {
- inputStream = url.openStream();
- parse(map, inputStream, fileInfo);
- }
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- throw (e);
- }
- finally {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- }
- catch (IOException e) {
- }
- }
- }
-
- protected class AnnotationMapContentHandler extends DefaultHandler {
- private AnnotationMap annotationMap;
- private Annotation currentAnnotation;
- private String currentPropertyName;
- private StringBuffer propertyValueBuffer;
- private ResourceBundle resourceBundle;
- private AnnotationFileInfo fFileInfo;
-
- public AnnotationMapContentHandler(AnnotationMap annotationMap, AnnotationFileInfo fileInfo) {
- this.annotationMap = annotationMap;
- this.fFileInfo = fileInfo;
- }
-
- private URL generatePropertiesFileURL(AnnotationFileInfo fileInfo, String propertiesLocation) {
- URL propertiesURL = null;
-
- // prepend $nl$ variable to location
- IPath annotationPath = Path.fromOSString("$nl$/" + fileInfo.getAnnotationFileLocation()); //$NON-NLS-1$
- // remove the annotation.xml file
- IPath annotationFolder = annotationPath.removeLastSegments(1);
- // append location of propertiles file
- IPath propertiesFile = annotationFolder.append(propertiesLocation);
- // append .properties extension if needed
- if (propertiesFile.getFileExtension() == null)
- propertiesFile = propertiesFile.addFileExtension("properties"); //$NON-NLS-1$
- // create a URL out of the properties file location
- propertiesURL = Platform.find(Platform.getBundle(fileInfo.getBundleId()), propertiesFile);
- return propertiesURL;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- propertyValueBuffer = new StringBuffer();
- if (localName.equals(TAG_ID_ANNOTATIONS)) {
- int attributesLength = attributes.getLength();
- for (int i = 0; i < attributesLength; i++) {
- String attributeName = attributes.getLocalName(i);
- String attributeValue = attributes.getValue(i);
- if (attributeName.equals("propertiesLocation")) //$NON-NLS-1$
- {
- URL bundleURL = generatePropertiesFileURL(fFileInfo, attributeValue);
- if (bundleURL != null) {
- InputStream bundleStream = null;
- try {
- bundleStream = bundleURL.openStream();
- resourceBundle = new PropertyResourceBundle(bundleStream);
- }
- catch (IOException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- finally {
- try {
- if (bundleStream != null)
- bundleStream.close();
- }
- catch (IOException x) {
- Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
- }
- }
- }
- }
- else if (attributeName.equals("caseSensitive")) //$NON-NLS-1$
- {
- if (attributeValue.trim().equals("false")) //$NON-NLS-1$
- {
- annotationMap.setCaseSensitive(false);
- }
- }
- }
- }
- else if (localName.equals(TAG_ID_ANNOTATION)) {
- currentAnnotation = null;
- String specValue = attributes.getValue("spec"); //$NON-NLS-1$
- if (specValue != null) {
- currentAnnotation = new Annotation();
- currentAnnotation.setSpec(specValue);
- }
- annotationMap.addAnnotation(currentAnnotation);
- }
- else if (localName.equals(TAG_ID_PROPERTY)) {
- if (currentAnnotation != null) {
- currentPropertyName = attributes.getValue("name"); //$NON-NLS-1$
- }
- }
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException {
- if (currentPropertyName != null && currentAnnotation != null) {
- String propertyValue = propertyValueBuffer.toString();
- if (propertyValue != null) {
- if (propertyValue.startsWith("%") && resourceBundle != null) //$NON-NLS-1$
- {
- try {
- propertyValue = resourceBundle.getString(propertyValue.substring(1));
- }
- catch (Exception e) {
- // ignore any exception that occurs while trying
- // to fetch a resource
- }
- }
- currentAnnotation.setProperty(currentPropertyName, propertyValue);
- }
- }
-
- if (localName.equals(TAG_ID_ANNOTATION)) {
- currentAnnotation = null;
- }
- else if (localName.equals(TAG_ID_PROPERTY)) {
- currentPropertyName = null;
- }
- }
-
- public void characters(char[] ch, int start, int length) {
- if (currentPropertyName != null && currentAnnotation != null) {
- propertyValueBuffer.append(ch, start, length);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java
deleted file mode 100644
index c8991fb56a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class is used to associate one or more annotation files with a grammar
- * file.
- *
- */
-public class AnnotationFileRegistry {
- private Map map = new HashMap();
-
- public AnnotationFileRegistry() {
- new AnnotationFileRegistryReader(this).readRegistry();
- }
-
- public synchronized List getAnnotationFilesInfos(String publicId) {
- List theList = (List) map.get(publicId);
- return theList != null ? theList : new ArrayList();
- }
-
- public synchronized void addAnnotationFile(String publicId, AnnotationFileInfo fileInfo) {
- List fileInfos = (List) map.get(publicId);
- if (fileInfos == null) {
- fileInfos = new ArrayList();
- map.put(publicId, fileInfos);
- }
- fileInfos.add(fileInfo);
- }
-
- public synchronized void removeAnnotationFile(String publicId, AnnotationFileInfo fileInfo) {
- List fileInfos = (List) map.get(publicId);
- if (fileInfos != null) {
- fileInfos.remove(fileInfo);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java
deleted file mode 100644
index 3c7c42345a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-/**
- * This class reads the plugin manifests and adds each specified gramamr
- * annotation file with the AnnotationProvider
- */
-public class AnnotationFileRegistryReader {
- protected static final String EXTENSION_POINT_ID = "annotationFiles"; //$NON-NLS-1$
- protected static final String TAG_NAME = "annotationFile"; //$NON-NLS-1$
- protected static final String ATT_PUBLIC_ID = "publicId"; //$NON-NLS-1$
- protected static final String ATT_LOCATION = "location"; //$NON-NLS-1$
-
- private AnnotationFileRegistry annotationFileRegistry;
-
- public AnnotationFileRegistryReader(AnnotationFileRegistry annotationFileRegistry) {
- this.annotationFileRegistry = annotationFileRegistry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- String pluginId = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
- IExtensionPoint point = extensionRegistry.getExtensionPoint(pluginId, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- readElement(elements[i]);
- }
- }
- }
-
- /**
- * readElement() - parse and deal with an extension like:
- *
- * <extension
- * point="org.eclipse.wst.xml.core.internal.contentmodel.util_implementation">
- * <util_implementation class =
- * corg.eclipse.wst.baseutil.CMUtilImplementationImpl /> </extension>
- */
- protected void readElement(IConfigurationElement element) {
- if (element.getName().equals(TAG_NAME)) {
- String publicId = element.getAttribute(ATT_PUBLIC_ID);
- String location = element.getAttribute(ATT_LOCATION);
- if (publicId != null && location != null) {
- try {
- String bundleId = element.getNamespace();
- AnnotationFileInfo fileInfo = new AnnotationFileInfo(location, bundleId);
- annotationFileRegistry.addAnnotationFile(publicId, fileInfo);
- }
- catch (Exception e) {
- Logger.logException("problem adding annotation file " + location, e); //$NON-NLS-1$
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java
deleted file mode 100644
index 061088af50..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-
-/**
- *
- */
-public class AnnotationUtility {
- public static void loadAnnotationsForGrammar(String publicId, CMDocument cmDocument) {
- List annotationFiles = ContentModelManager.getInstance().getAnnotationFilesInfos(publicId);
- AnnotationMap map = (AnnotationMap) cmDocument.getProperty("annotationMap"); //$NON-NLS-1$
- if (map != null) {
- for (Iterator i = annotationFiles.iterator(); i.hasNext();) {
- try {
- AnnotationFileInfo annotationFileInfo = (AnnotationFileInfo) i.next();
- AnnotationFileParser parser = new AnnotationFileParser();
- parser.parse(map, annotationFileInfo);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java
deleted file mode 100644
index 98eeba4e5c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.annotation;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-
-
-public class ResourceBundleHelper
-{
- public static ResourceBundle getResourceBundle(String resourceURI, Locale targetLocale) throws Exception
- {
- // try to load bundle from the location specified in the resourceURI
- // we make the assumption that the resourceURI points to the local file system
-
- int index = resourceURI.lastIndexOf("/"); //$NON-NLS-1$
- if (index == -1)
- {
- throw new Exception("Invalid resourceURI"); //$NON-NLS-1$
- }
-
- // Below we set 'resourceDirectory' so that it ends with a '/'.
- // Here's an excerpt from the ClassLoader Javadoc ...
- // Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed
- // to refer to a JAR file which will be opened as needed.
- //
- String resourceDirectory = resourceURI.substring(0, index + 1);
- String resourceBundleName = resourceURI.substring(index + 1);
-
- // create a class loader with a class path that points to the resource bundle's location
- //
- URL[] classpath = new URL[1];
- classpath[0] = Platform.resolve(new URL(resourceDirectory));
- ClassLoader resourceLoader = new URLClassLoader(classpath, null);
-
- return ResourceBundle.getBundle(resourceBundleName, targetLocale, resourceLoader);
- }
-
- public static ResourceBundle getResourceBundle(String resourceURI) throws Exception
- {
- return getResourceBundle(resourceURI, Locale.getDefault());
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java
deleted file mode 100644
index 19d8131802..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAnyElementImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAttributeDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDocumentImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMElementDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMGroupImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-
-
-public class InferredGrammarFactory
-{
- public InferredGrammarFactory()
- {
- }
-
- public CMDocument createCMDocument(String uri)
- {
- CMDocumentImpl cmdocument =new CMDocumentImpl(uri);
- cmdocument.setInferred(true);
- return cmdocument;
- }
-
- public CMElementDeclaration createCMElementDeclaration(CMDocument cmDocument, Element element, boolean isLocal)
- {
- String localName = element.getLocalName();
- CMDocumentImpl cmDocumentImpl = (CMDocumentImpl)cmDocument;
-
- CMNamedNodeMapImpl elementMap = isLocal ?
- (CMNamedNodeMapImpl)cmDocumentImpl.getLocalElementPool() :
- (CMNamedNodeMapImpl)cmDocumentImpl.getElements();
-
- CMElementDeclarationImpl ed = (CMElementDeclarationImpl)elementMap.getNamedItem(localName);
- if (ed == null)
- {
- //System.out.println("create ed " + localName);
- ed = new CMElementDeclarationImpl(cmDocument, localName);
- ed.setInferred(true);
- ed.setLocal(isLocal);
- ed.setMaxOccur(1);
- CMGroupImpl group = new CMGroupImpl(new CMNodeListImpl(), CMGroup.CHOICE);
- group.setInferred(true);
- group.setMinOccur(0);
- group.setMaxOccur(-1);
- ed.setContent(group);
- elementMap.put(ed);
- }
-
- // lookup or create the attributes
- //
- NamedNodeMap attributeMap = element.getAttributes();
- int attributeMapLength = attributeMap.getLength();
- for (int i = 0; i < attributeMapLength; i++)
- {
- Attr attr = (Attr)attributeMap.item(i);
- CMAttributeDeclarationImpl ad = (CMAttributeDeclarationImpl)ed.getAttributeMap().getNamedItem(attr.getNodeName());
- if (ad == null)
- {
- // todo... use an attribute pool to be more efficient?
- ad = new CMAttributeDeclarationImpl(attr.getNodeName(), CMAttributeDeclaration.OPTIONAL);
- ad.setInferred(true);
- ed.getAttributeMap().put(ad);
- }
- }
- return ed;
- }
-
- public void createCMContent(CMDocument parentCMDocument, CMElementDeclaration parentEd, CMDocument childCMDocument, CMElementDeclaration childEd, boolean isLocal, String uri)
- {
- // add element to the parent's content
- // consider all content to be of the form (A | B | C)*
- //
- CMGroupImpl group = (CMGroupImpl)parentEd.getContent();
- CMNodeListImpl groupChildNodeList = (CMNodeListImpl)group.getChildNodes();
-
- if (parentCMDocument == childCMDocument)
- {
- if (!groupChildNodeList.contains(childEd))
- {
- groupChildNodeList.add(childEd);
- }
- if (isLocal)
- {
- CMNamedNodeMapImpl localElementMap = (CMNamedNodeMapImpl)parentEd.getLocalElements();
- localElementMap.put(childEd);
- }
- }
- else
- {
- CMAnyElement cmAnyElement = lookupOrCreateCMAnyElement((CMDocumentImpl)parentCMDocument, uri);
- if (!groupChildNodeList.contains(cmAnyElement))
- {
- groupChildNodeList.add(cmAnyElement);
- }
- }
- }
-
- protected CMAnyElement lookupOrCreateCMAnyElement(CMDocumentImpl parentCMDocument, String uri)
- {
- CMNamedNodeMapImpl anyElementMap = parentCMDocument.getAnyElements();
- CMAnyElementImpl anyElement = (CMAnyElementImpl)anyElementMap.getNamedItem(CMAnyElementImpl.computeNodeName(uri));
- if (anyElement == null)
- {
- //System.out.println("create anyElement " + uri);
- anyElement = new CMAnyElementImpl(uri);
- anyElement.setInferred(true);
- anyElementMap.put(anyElement);
- }
- return anyElement;
- }
-
-
- public void debugPrint(Collection collection)
- {
- for (Iterator iter = collection.iterator(); iter.hasNext(); )
- {
- CMDocument cmDocument = (CMDocument)iter.next();
- System.out.println("-----------------------------------------------"); //$NON-NLS-1$
- System.out.println("cmDocument (" + cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") +")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- CMNamedNodeMapImpl elementMap = (CMNamedNodeMapImpl)cmDocument.getElements();
- int size = elementMap.getLength();
- for (int i = 0; i < size; i++)
- {
- CMElementDeclaration ed = (CMElementDeclaration)elementMap.item(i);
- CMDescriptionBuilder builder = new CMDescriptionBuilder();
- System.out.println(" ELEMENT " + ed.getNodeName() + " = " + builder.buildDescription(ed)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java
deleted file mode 100644
index c6d9490466..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-
-/**
- * Describes an extension to the <code>modelQueryExtension</code> extension
- * point.
- *
- */
-public class ModelQueryExtensionDescriptor
-{
- private static final String CONTENT_TYPE_ATTRIBUTE = "contentType"; //$NON-NLS-1$
- private static final String NAMESPACE_ATTRIBUTE = "namespace"; //$NON-NLS-1$
- private static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
- private IConfigurationElement configuration;
- private String contentTypeId;
- private String namespace;
- private ModelQueryExtension extension;
-
- public ModelQueryExtensionDescriptor(IConfigurationElement element)
- {
- configuration = element;
- }
-
- public ModelQueryExtension createModelQueryExtension() throws CoreException
- {
- if (extension == null)
- {
- extension = (ModelQueryExtension) configuration.createExecutableExtension(CLASS_ATTRIBUTE);
- }
- return extension;
- }
-
- public String getContentTypeId()
- {
- if (contentTypeId == null)
- {
- contentTypeId = configuration.getAttribute(CONTENT_TYPE_ATTRIBUTE);
- }
- return contentTypeId;
- }
-
- public String getNamespace()
- {
- if (namespace == null)
- {
- namespace = configuration.getAttribute(NAMESPACE_ATTRIBUTE);
- }
- return namespace;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java
deleted file mode 100644
index 72c28fdb5e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-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.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class ModelQueryExtensionManagerImpl implements ModelQueryExtensionManager
-{
- protected ModelQueryExtensionRegistry modelQueryExtensionRegistry = new ModelQueryExtensionRegistry();
-
- public List getDataTypeValues(Element element, CMNode cmNode)
- {
- List list = new ArrayList();
- String contentTypeId = getContentTypeId(element);
- String namespace = getNamespace(cmNode);
- String name = cmNode.getNodeName();
-
- for (Iterator i = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, namespace).iterator(); i.hasNext();)
- {
- ModelQueryExtension extension = (ModelQueryExtension)i.next();
- String[] values = null;
- if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- {
- values = extension.getAttributeValues(element, namespace, name);
- }
- else
- {
- values = extension.getElementValues(element, namespace, name);
- }
- if (values != null)
- {
- list.addAll(Arrays.asList(values));
- }
- }
- return list;
- }
-
- public void filterAvailableElementContent(List cmnodes, Element element, CMElementDeclaration ed)
- {
- filterAvailableElementContent(cmnodes, element, ed, ModelQuery.INCLUDE_CHILD_NODES);
- }
-
- public void filterAvailableElementContent(List cmnodes, Element element, CMElementDeclaration ed, int includeOptions)
- {
- String contentTypeId = getContentTypeId(element);
- String parentNamespace = element.getNamespaceURI();
-
- List modelQueryExtensions = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, parentNamespace);
- if((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) > 0)
- {
- for (Iterator j = cmnodes.iterator(); j.hasNext(); )
- {
- CMNode cmNode = (CMNode)j.next();
- String namespace = getNamespace(cmNode);
- String name = cmNode.getNodeName();
-
- boolean include = true;
- for(int k = 0; k < modelQueryExtensions.size() && include; k++) {
- {
- ModelQueryExtension extension = (ModelQueryExtension)modelQueryExtensions.get(k);
- include = extension.isApplicableChildElement(element, namespace, name);
- if (!include)
- {
- // remove the cmNode from the list
- j.remove();
- }
- }
- }
- }
- }
- // add MQE-provided content
- for(int k = 0; k < modelQueryExtensions.size(); k++)
- {
- ModelQueryExtension extension = (ModelQueryExtension)modelQueryExtensions.get(k);
- cmnodes.addAll(Arrays.asList(extension.getAvailableElementContent(element, parentNamespace, includeOptions)));
- }
- }
-
- private String getNamespace(CMNode cmNode)
- {
- String namespace = null;
- CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- namespace = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- }
- return namespace;
- }
-
- private String getContentTypeId(Node node)
- {
- String contentTypeId = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
- if (node instanceof IDOMNode)
- {
- IDOMNode domNode = (IDOMNode) node;
- contentTypeId = domNode.getModel().getContentTypeIdentifier();
- }
- return contentTypeId;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java
deleted file mode 100644
index 1c98b44897..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-
-public class ModelQueryExtensionRegistry
-{
- protected static final String EXTENSION_POINT_ID = "modelQueryExtensions"; //$NON-NLS-1$
- protected static final String TAG_NAME = "modelQueryExtension"; //$NON-NLS-1$
- private List descriptors;
-
- public List getApplicableExtensions(String contentTypeId, String namespace)
- {
- List list = new ArrayList();
- if (contentTypeId != null)
- {
- ensureExtensionsLoaded();
- for (Iterator i = descriptors.iterator(); i.hasNext();)
- {
- ModelQueryExtensionDescriptor descriptor = (ModelQueryExtensionDescriptor) i.next();
- final String[] contentTypeIds = StringUtils.unpack(descriptor.getContentTypeId());
- for (int j = 0; j < contentTypeIds.length; j++) {
- if (contentTypeId.equals(contentTypeIds[j]))
- {
- if (descriptor.getNamespace() == null || descriptor.getNamespace().equals(namespace))
- {
- try
- {
- ModelQueryExtension extension = descriptor.createModelQueryExtension();
- list.add(extension);
- }
- catch (CoreException e) {
- Logger.logException("problem creating model query extension", e); //$NON-NLS-1$
- }
- }
- break;
- }
- }
- }
- }
- return list;
- }
-
- /*
- * TODO : consider providing a non-plugin means add/remove extensions
- *
- public void addExtension(ModelQueryExtension extension)
- {
- }
-
- public void removeExtension(ModelQueryExtensionDeprecated extension)
- {
- }*/
-
- /**
- * Reads all extensions.
- * <p>
- * This method can be called more than once in order to reload from a changed
- * extension registry.
- * </p>
- */
- private synchronized void reloadExtensions()
- {
- descriptors = new ArrayList();
- String bundleid = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(bundleid, EXTENSION_POINT_ID);
- for (int i = 0; i < elements.length; i++)
- {
- ModelQueryExtensionDescriptor descriptor = new ModelQueryExtensionDescriptor(elements[i]);
- descriptors.add(descriptor);
- }
- }
-
- /**
- * Ensures the extensions have been loaded at least once.
- */
- private void ensureExtensionsLoaded()
- {
- if (descriptors == null)
- {
- reloadExtensions();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java
deleted file mode 100644
index e09fa6c164..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-
-
-public class CMDataTypeValueHelper
-{
- protected int idCount = 0;
-
-
- public String getValue(CMAttributeDeclaration ad, NamespaceTable namespaceTable)
- {
- String value = null;
-
- if (isXSIType(ad))
- {
- List list = getQualifiedXSITypes(ad, namespaceTable);
- value = list.size() > 0 ? (String)list.get(0) : null;
- }
-
- // shameless hack
- //
- if (value == null)
- {
- if (ad.getAttrName().equals("xml:lang")) //$NON-NLS-1$
- {
- value = "EN"; //$NON-NLS-1$
- }
- }
-
- if (value == null)
- {
- CMDataType dataType = ad.getAttrType();
- if (dataType != null)
- {
- value = getValue(dataType);
- }
- }
- return value;
- }
-
-
- public String getValue(CMDataType dataType)
- {
- String value = null;
- value = dataType.getImpliedValue();
-
- if (value == null)
- {
- String[] values = dataType.getEnumeratedValues();
- if (values != null && values.length > 0)
- {
- value = values[0];
- }
- }
-
- if (value == null)
- {
- value = dataType.generateInstanceValue();
- }
-
- // Here is a special case where we handle DTD's ID related datatypes.
- // These values must be generated/validate by considering the entire xml file
- // so we can't rely on the 'generateInstanceValue' method.
- //
- // todo... find a nicer way to handle this
- if (value == null)
- {
- String dataTypeName = dataType.getDataTypeName();
- if (dataTypeName != null)
- {
- if (dataTypeName.equals("ID")) //$NON-NLS-1$
- {
- value = "idvalue" + idCount++; //$NON-NLS-1$
- }
- else if (dataTypeName.equals("IDREF") || dataTypeName.equals("IDREFS")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- value = "idvalue0"; //$NON-NLS-1$
- }
- }
- }
- return value;
- }
-
-
- public boolean isValidEmptyValue(CMAttributeDeclaration ad)
- {
- boolean result = true;
- CMDataType dataType = ad.getAttrType();
- if (dataType != null)
- {
- String propertyValue = (String)dataType.getProperty("isValidEmptyValue"); //$NON-NLS-1$
- if (propertyValue != null && propertyValue.equals("false")) //$NON-NLS-1$
- {
- result = false;
- }
- }
- return result;
- }
-
-
- public boolean isXSIType(CMAttributeDeclaration ad)
- {
- boolean result = false;
- if (ad.getNodeName().equals("type")) //$NON-NLS-1$
- {
- CMDocument cmDocument = (CMDocument)ad.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String namespaceName = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- if (namespaceName != null && namespaceName.equals("http://www.w3.org/2001/XMLSchema-instance")) //$NON-NLS-1$
- {
- result = true;
- }
- }
- }
- return result;
- }
-
-
- public List getQualifiedXSITypes(CMAttributeDeclaration ad, NamespaceTable table)
- {
- List list = new Vector();
-
- List xsiTypes = (List)ad.getProperty("XSITypes"); //$NON-NLS-1$
- if (xsiTypes != null && xsiTypes.size() > 0)
- {
- for (Iterator i = xsiTypes.iterator(); i.hasNext(); )
- {
- String uriQualifiedName = (String)i.next();
- String[] components = DOMNamespaceHelper.getURIQualifiedNameComponents(uriQualifiedName);
- String prefix = table.getPrefixForURI(components[0] != null ? components[0] : ""); //$NON-NLS-1$
- String typeName = (prefix != null && prefix.length() > 0) ?
- prefix + ":" + components[1] : //$NON-NLS-1$
- components[1];
- list.add(typeName);
- }
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
deleted file mode 100644
index 2de559049a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
+++ /dev/null
@@ -1,1250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (STAR) - bug 297005 - Some static constants not made final.
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-import java.util.Vector;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-
-
-
-public class CMValidator
-{
- protected static final StringElementContentComparator stringContentComparitor = new StringElementContentComparator();
- protected Hashtable graphNodeTable = new Hashtable();
-
- /**
- * GraphNode
- */
- protected static class GraphNode
- {
- public String name;
- public boolean isTerminal;
- public Vector arcList = new Vector();
-
- public GraphNode(String name)
- {
- this.name = name;
- }
-
- public void addArc(Arc arc)
- {
- arcList.addElement(arc);
- }
-
- public String toString()
- {
- return "[GraphNode " + name + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-
- /**
- * Arc
- */
- protected static class Arc
- {
- public static final int ELEMENT = 1;
- public static final int REPEAT = 2;
- public static final int OPTIONAL = 3;
- public static final int PREV_IN = 4;
- public static final int OUT_NEXT = 5;
- public static final int LINK = 6;
-
- public int kind;
- public String name;
- public GraphNode node;
- public CMNode cmNode;
-
- public Arc(int kind, GraphNode node, CMNode cmNode)
- {
- this(kind, "", node, cmNode); //$NON-NLS-1$
- }
-
- protected Arc(int kind, String name, GraphNode node, CMNode cmNode)
- {
- this.name = name;
- this.kind = kind;
- this.node = node;
- this.cmNode = cmNode;
- }
- }
-
-
- /**
- * GraphGenerator
- */
- protected static class GraphGenerator extends CMVisitor
- {
- public int indent;
- public int count;
- public GraphNode startGraphNode;
- public Context context;
-
- protected static class Context
- {
- GraphNode from;
- GraphNode to;
-
- Context(GraphNode from, GraphNode to)
- {
- this.from = from;
- this.to = to;
- }
-
- GraphNode getLastGraphNode()
- {
- return (to != null) ? to : from;
- }
- }
-
-
- protected GraphGenerator()
- {
- startGraphNode = new GraphNode(getGraphNodeName());
- context = new Context(startGraphNode, null);
- }
-
-
- protected void generateGraph(CMElementDeclaration ed)
- {
- int contentType = ed.getContentType();
-
- if (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.ELEMENT)
- {
- visitCMNode(ed.getContent());
- }
- // CMElementDeclaration.PCDATA... no graph required
- // CMElementDeclaration.ANY... no graph required
- context.getLastGraphNode().isTerminal = true;
- }
-
-
- protected String getGraphNodeName()
- {
- return "n" + count++; //$NON-NLS-1$
- }
-
-
- protected GraphNode getStartGraphNode()
- {
- return startGraphNode;
- }
-
-
- /**
- * repeat
- * +----#-----+
- * | |
- * v |
- * prev --#-> in --'x'-> out --#-> next
- * | ^
- * | |
- * +----------------#--------------+
- * optional
- *
- */
- protected void createArcs(GraphNode in, GraphNode out, CMContent cmContent)
- {
- createArcs(in, out, cmContent, false);
- }
-
- protected void createArcs(GraphNode in, GraphNode out, CMContent cmContent, boolean isAllGroup)
- {
- //println("+createArcs() " + ed.getDescription() + " " + ed.getMinOccur());
- GraphNode prev = context.from;
- GraphNode next = new GraphNode(getGraphNodeName());
-
- prev.addArc(new Arc(Arc.PREV_IN, in, cmContent));
- out.addArc(new Arc(Arc.OUT_NEXT, next, cmContent));
-
- if (context.to != null)
- {
- next.addArc(new Arc(Arc.LINK, context.to, cmContent));
- }
- else
- {
- context.from = next;
- }
-
- if (cmContent.getMinOccur() == 0)
- {
- // todo... should we see if an optional arc has already been added?
- prev.addArc(new Arc(Arc.OPTIONAL, next, cmContent));
- }
-
- if (cmContent.getMaxOccur() == -1 || cmContent.getMaxOccur() > 1 || isAllGroup)
- {
- out.addArc(new Arc(Arc.REPEAT, in, cmContent));
- }
- }
-
-
- public void visitCMGroup(CMGroup group)
- {
- Context prevContext = context;
- GraphNode in = new GraphNode("(" + getGraphNodeName()); //$NON-NLS-1$
- GraphNode out = new GraphNode(")" + getGraphNodeName()); //$NON-NLS-1$
-
- int groupOperator = group.getOperator();
- if (groupOperator == CMGroup.SEQUENCE)
- {
- context = new Context(in, null);
- super.visitCMGroup(group);
- context.from.addArc(new Arc(Arc.LINK, out, group));
- }
- else if (groupOperator == CMGroup.CHOICE ||
- groupOperator == CMGroup.ALL)
- {
- context = new Context(in, out);
- super.visitCMGroup(group);
- }
-
- context = prevContext;
- createArcs(in, out, group, groupOperator == CMGroup.ALL);
- }
-
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- GraphNode in = new GraphNode(getGraphNodeName());
- GraphNode out = new GraphNode(getGraphNodeName());
- createArcs(in, out, ed);
- in.addArc(new Arc(Arc.ELEMENT, ed.getElementName(), out, ed));
- }
-
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- GraphNode in = new GraphNode(getGraphNodeName());
- GraphNode out = new GraphNode(getGraphNodeName());
- createArcs(in, out, anyElement);
- in.addArc(new Arc(Arc.ELEMENT, "any", out, anyElement)); //$NON-NLS-1$
- }
- }
-
- // todo.. implement cache strategy hook, handle name spaces, locals etc.
- //
- public GraphNode lookupOrCreateGraph(CMElementDeclaration element)
- {
- Object key = element;
- GraphNode node = (GraphNode)graphNodeTable.get(key);
- if (node == null)
- {
- node = createGraph(element);
- graphNodeTable.put(key, node);
- }
- return node;
- }
-
- public GraphNode createGraph(CMElementDeclaration element)
- {
- GraphGenerator generator = new GraphGenerator();
- generator.generateGraph(element);
- return generator.getStartGraphNode();
- }
-
-
- public void printGraph(GraphNode node, Vector namedArcList, Vector unamedArcList, int indent)
- {
- //String decoration = node.isTerminal ? " *" : "";
- //printlnIndented(indent, "GraphNode:" + node.name + decoration);
-
- indent += 2;
- for (Enumeration e = node.arcList.elements() ; e.hasMoreElements() ;)
- {
- Arc arc = (Arc)e.nextElement();
- //boolean visit = false;
- //printlnIndented(indent, "Arc:" + arc.name + " (" + arc.kind + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (arc.kind == Arc.ELEMENT)
- {
- //table.add(currentGrammarObject, arc.grammarObject);
- if (!namedArcList.contains(arc))
- {
- namedArcList.add(arc);
- unamedArcList = new Vector();
- printGraph(arc.node, namedArcList, unamedArcList, indent + 2);
- }
- }
- else
- {
- if (!unamedArcList.contains(arc))
- {
- unamedArcList.add(arc);
- printGraph(arc.node, namedArcList, unamedArcList, indent + 2);
- }
- }
- }
- }
-
- public void printGraph(GraphNode node)
- {
- printGraph(node, new Vector(), new Vector(), 0);
- }
-
-
- public void validateElementList(ElementList initialList, GraphNode initialGraphNode, ElementContentComparator comparator, Result result, boolean initialLoopFlag) {
- Stack arcStack = new Stack();
- arcStack.push(new ArcStackItem(null, false));
- boolean loopFlag = initialLoopFlag;
- ElementList elementList = initialList;
- GraphNode graphNode = initialGraphNode;
- while(!arcStack.isEmpty() && !result.isValid) {
- ArcStackItem stackElement = (ArcStackItem) arcStack.peek();
- if(stackElement.isVisited) {
- arcStack.pop();
- if(stackElement.arc != null) {
- result.pop(stackElement.arc);
- continue;
- }
- } else {
- stackElement.isVisited = true;
- result.push(stackElement.arc);
- graphNode = stackElement.arc.node;
- loopFlag = stackElement.loopFlag;
- }
- if(elementList == null && graphNode.isTerminal) {
- result.isValid = true;
- } else {
- for(Iterator arcIterator = graphNode.arcList.iterator(); arcIterator.hasNext();) {
- Arc arc = (Arc)arcIterator.next();
- boolean traverseArc = false;
- if (arc.kind == Arc.ELEMENT) {
- if(elementList != null && comparator.matches(elementList.head, arc.cmNode)) {
- loopFlag = false;
- traverseArc = true;
- elementList = elementList.tail; // increment our position in the list
- }
- } else if(arc.kind == Arc.REPEAT) {
- if(!loopFlag) {
- traverseArc = true;
- }
- loopFlag = true;
- } else {
- traverseArc = true;
- }
- if(traverseArc) {
- if (result.canPush(arc)) { // test to see if we can push this arc due to facet constraints
- arcStack.push(new ArcStackItem(arc, loopFlag));
- }
- }
- }
- }
- }
- }
-
-
- private class ArcStackItem {
-
- Arc arc;
- boolean loopFlag;
- boolean isVisited;
-
- public ArcStackItem(Arc arc, boolean loopflag) {
- this.arc = arc;
- this.loopFlag = loopflag;
- this.isVisited = arc == null;
- }
-
- }
-
-
- /**
- *
- */
- protected static ElementList createElementList(int contentType, List v, ElementContentComparator comparator, Result result)
- {
- ElementList first = null;
- ElementList prev = null;
-
- int size = v.size();
- for (int i = 0; i < size; i++)
- {
- Object o = v.get(i);
- if (o != null && !comparator.isIgnorable(o))
- {
- if (comparator.isElement(o))
- {
- ElementList list = new ElementList();
- list.head = o;
-
- if (prev != null)
- {
- prev.tail = list;
- }
- else
- {
- first = list;
- }
- prev = list;
- }
- else if (contentType == CMElementDeclaration.ELEMENT)
- {
- result.isValid = false;
- result.errorIndex = i;
- result.errorMessage = "Element can not include PCDATA content"; //$NON-NLS-1$
- }
- }
- }
- return first;
- }
-
- /**
- *
- */
- public void validate(CMElementDeclaration ed, List elementContent, ElementContentComparator comparator, Result result)
- {
- int contentType = ed.getContentType();
-
- if (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.ELEMENT)
- {
- ElementList elementList = createElementList(contentType, elementContent, comparator, result);
- if (result.isValid == true)
- {
- boolean isGraphValidationNeeded = !(elementList == null && contentType == CMElementDeclaration.MIXED);
-
- // explicitly handle 'All' groups
- //
- CMContent content = ed.getContent();
- if (content != null && content.getNodeType() == CMNode.GROUP)
- {
- CMGroup group = (CMGroup)content;
- if (group.getOperator() == CMGroup.ALL)
- {
- isGraphValidationNeeded = false;
- validatAllGroupContent(elementContent, comparator, group, result);
- }
- }
-
- if (isGraphValidationNeeded)
- {
- // validate the elementList using a graph
- //
- result.isValid = false;
- GraphNode node = lookupOrCreateGraph(ed);
- validateElementList(elementList, node, comparator, result, false);
- }
- }
- }
- else if (contentType == CMElementDeclaration.PCDATA)
- {
- int size = elementContent.size();
- for (int i = 0; i < size; i++)
- {
- Object o = elementContent.get(i);
- if (comparator.isElement(o))
- {
- result.isValid = false;
- result.errorIndex = i;
- result.errorMessage = "Element may only include PCDATA content"; //$NON-NLS-1$
- break;
- }
- }
- }
- else if (contentType == CMElementDeclaration.EMPTY)
- {
- int size = elementContent.size();
- for (int i = 0; i < size; i++)
- {
- Object o = elementContent.get(i);
- if (!comparator.isIgnorable(o))
- {
- result.isValid = false;
- result.errorIndex = i;
- result.errorMessage = "Element may not contain PCDATA or Element content"; //$NON-NLS-1$
- break;
- }
- }
- }
- //else if (contentType == CMElementDeclaration.ANY)
- // {
- // assume elementContent will always be valid for this content type
- // }
- }
-
- static class ItemCount
- {
- int count = 0;
- }
-
- private void validatAllGroupContent(List elementContent, ElementContentComparator comparator, CMGroup allGroup, Result result)
- {
- boolean isValid = true;
- boolean isPartiallyValid = true;
- HashMap map = new HashMap();
- CMNodeList list = allGroup.getChildNodes();
- for (int j = list.getLength() - 1; j >= 0; j--)
- {
- CMNode node = list.item(j);
- if (map.get(node) == null)
- {
- map.put(node, new ItemCount());
- }
- }
- int validitionCount = 0;
- for (Iterator i = elementContent.iterator(); i.hasNext(); validitionCount++)
- {
- Object o = i.next();
- if (comparator.isElement(o))
- {
- // test to see if the element is listed in the all group
- //
- CMNode matchingCMNode = null;
- for (int j = list.getLength() - 1; j >= 0; j--)
- {
- CMNode node = list.item(j);
- if (comparator.matches(o, node))
- {
- matchingCMNode = node;
- break;
- }
- }
- if (matchingCMNode == null)
- {
- isPartiallyValid = false;
- isValid = false;
- break;
- }
- else
- {
- // test to see that the element occurs only once
- //
- ItemCount itemCount = (ItemCount)map.get(matchingCMNode);
- if (itemCount != null)
- {
- if (itemCount.count > 0)
- {
- // we don't want to allow too many elements!
- // we consider 'not enough' to be partially valid... but not 'too many'
- isPartiallyValid = false;
- break;
- }
- else
- {
- itemCount.count++;
- }
- }
- }
- }
- }
- if (isValid)
- {
- for (int j = list.getLength() - 1; j >= 0; j--)
- {
- CMNode node = list.item(j);
- if (node.getNodeType() == CMNode.ELEMENT_DECLARATION)
- {
- CMContent content = (CMContent)node;
- ItemCount itemCount = (ItemCount)map.get(node);
-// System.out.print("content " + content.getNodeName() + " " + content.getMinOccur());
- if (itemCount.count < content.getMinOccur())
- {
- isValid = false;
- break;
- }
- }
- }
- }
- if (result instanceof ElementPathRecordingResult && isPartiallyValid)
- {
- ((ElementPathRecordingResult)result).setPartialValidationCount(validitionCount);
- }
- result.isValid = isValid;
- }
-
-
- public void getOriginArray(CMElementDeclaration ed, List elementContent, ElementContentComparator comparator, ElementPathRecordingResult result)
- {
- CMNode[] cmNodeArray = null;
- validate(ed, elementContent, comparator, result);
- if (result.isValid)
- {
- CMDataType dataType = ed.getDataType();
- int size = elementContent.size();
- cmNodeArray = new CMNode[size];
- Vector originList = result.getElementOriginList();
- int originListSize = originList.size();
- int originListIndex = 0;
- for (int i = 0; i < size; i++)
- {
- Object o = elementContent.get(i);
- if (comparator.isElement(o))
- {
- if (originListIndex < originListSize)
- {
- cmNodeArray[i] = (CMNode)originList.get(originListIndex);
- originListIndex++;
- }
- }
- else if (comparator.isPCData(o))
- {
- cmNodeArray[i] = dataType;
- }
- // else the CMNode at this index is null
- }
- result.setOriginArray(cmNodeArray);
- }
- }
-
- private void collectNamedArcs(GraphNode node, List namedArcList, int indent)
- {
- //printlnIndented(indent, "GraphNode:" + node.name + decoration);
- indent += 2;
- for (Iterator i = node.arcList.iterator(); i.hasNext() ;)
- {
- Arc arc = (Arc)i.next();
- //printlnIndented(indent, "Arc:" + arc.name + " (" + arc.kind + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (arc.kind == Arc.ELEMENT)
- {
- if (!namedArcList.contains(arc))
- {
- namedArcList.add(arc);
- collectNamedArcs(arc.node, namedArcList, indent + 2);
- }
- }
- else if (arc.kind != Arc.REPEAT && arc.kind != Arc.OPTIONAL)
- {
- collectNamedArcs(arc.node, namedArcList, indent + 2);
- }
- }
- }
-
-
- private List getMatchingArcs(CMElementDeclaration ed, String elementName)
- {
- List arcList = new ArrayList();
- GraphNode graphNode = lookupOrCreateGraph(ed);
- if (elementName == null)
- {
- // here we add the 'root' arc
- for (Iterator i = graphNode.arcList.iterator(); i.hasNext() ;)
- {
- Arc arc = (Arc)i.next();
- if (arc.kind == Arc.PREV_IN)
- {
- arcList.add(arc);
- break;
- }
- }
- }
- else
- {
- List namedArcs = new ArrayList();
- collectNamedArcs(graphNode, namedArcs, 0);
- for (Iterator i = namedArcs.iterator(); i.hasNext(); )
- {
- Arc arc = (Arc)i.next();
- if (arc.cmNode != null && elementName.equals(arc.cmNode.getNodeName()))
- {
- arcList.add(arc);
- }
- }
- }
- return arcList;
- }
-
-
- private void collectNextSiblings(GraphNode node, List nextSiblingList, List namedArcList, List unamedArcList, int indent)
- {
- //printlnIndented(indent, "GraphNode:" + node.name + decoration);
- indent += 2;
- for (Iterator i = node.arcList.iterator(); i.hasNext(); )
- {
- Arc arc = (Arc)i.next();
- if (arc.kind == Arc.ELEMENT)
- {
- if (!namedArcList.contains(arc))
- {
- if (arc.cmNode != null)
- {
- nextSiblingList.add(arc.cmNode);
- if (arc.cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION ||
- arc.cmNode.getNodeType() == CMNode.ANY_ELEMENT)
- {
- namedArcList.add(arc);
- CMContent cmNode = (CMContent)arc.cmNode;
- if (cmNode.getMinOccur() == 0)
- {
- unamedArcList = new ArrayList();
- collectNextSiblings(arc.node, nextSiblingList, namedArcList, unamedArcList, indent + 2);
- }
- }
- }
- }
- }
- else
- {
- if (!unamedArcList.contains(arc))
- {
- unamedArcList.add(arc);
- collectNextSiblings(arc.node, nextSiblingList, namedArcList, unamedArcList, indent + 2);
- }
- }
- }
- }
-
- public CMNode[] getNextSiblings(CMElementDeclaration ed, String elementName)
- {
- List arcList = getMatchingArcs(ed, elementName);
- List nextSiblingList = new ArrayList();
- for (Iterator i = arcList.iterator(); i.hasNext(); )
- {
- Arc arc = (Arc)i.next();
- collectNextSiblings(arc.node, nextSiblingList, new ArrayList(), new ArrayList(), 0);
- }
- CMNode[] result = new CMNode[nextSiblingList.size()];
- nextSiblingList.toArray(result);
- //System.out.print("getNextSibling(" +elementName + ")");
- //for (int i = 0; i < result.length; i++)
- //{
- // System.out.print("[" + result[i].getNodeName() + "]");
- //}
- //System.out.println();
- return result;
- }
-
- /**
- *
- */
- public static class Result
- {
- public boolean isValid = true;
- public int errorIndex = -1;
- public String errorMessage;
- public boolean isRepeatTraversed; // detects if a repeat has been traversed
-
- public boolean canPush(Arc arc)
- {
- return true;
- }
-
- public void push(Arc arc)
- {
- // overide this method to record traversed nodes
- }
- public void pop(Arc arc)
- {
- // overide this method to record traversed nodes
- }
- public CMNode[] getOriginArray()
- {
- return null;
- }
- }
-
- /**
- *
- */
- public static class ElementPathRecordingResult extends Result
- {
- protected List activeItemCountList = new ArrayList();
- protected List inactiveItemCountList = new ArrayList();
- protected Vector elementOriginStack = new Vector();
- protected CMNode[] originArray = null;
- protected int partialValidationCount = 0;
-
-
- // this method is used to support facet counts
- //
- public boolean canPush(Arc arc)
- {
- boolean result = true;
- try
- {
- if (arc.kind == Arc.REPEAT)
- {
- if (arc.cmNode instanceof CMContent)
- {
- CMContent content = (CMContent)arc.cmNode;
-
- // we only need to do 'special' facet checking if the maxOccurs is > 1
- // values of '0' and '-1' (unbounded) work 'for free' without any special checking
- //
- if (content.getMaxOccur() > 1)
- {
- ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
-
- // here we need to compute if we can do another repeat
- // if we increase the repeat count by '1' will this violate the maxOccurs
- //
- if (itemCount.count + 1 >= content.getMaxOccur())
- {
- result = false;
- }
- }
- //System.out.println("canPush REPEAT (" + itemCount.count + ")" + content.getNodeName() + " result= " + result);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- //System.out.flush();
- return result;
- }
-
- public void push(Arc arc)
- {
- if (arc.kind == Arc.ELEMENT)
- {
- //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
- elementOriginStack.add(arc.cmNode);
- partialValidationCount = Math.max(elementOriginStack.size(), partialValidationCount);
- }
- else if (arc.kind == Arc.PREV_IN)
- {
- //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
- activeItemCountList.add(new ItemCount());
- }
- else if (arc.kind == Arc.OUT_NEXT)
- {
- //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName() + "[" + arc + "]");
- int size = activeItemCountList.size();
- ItemCount itemCount = (ItemCount)activeItemCountList.get(size - 1);
- activeItemCountList.remove(size - 1);
- inactiveItemCountList.add(itemCount);
- }
- else if (arc.kind == Arc.REPEAT)
- {
- //System.out.println("[X]push(" + arc.kind + ")" + arc.cmNode.getNodeName());
- ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
- itemCount.count++;
- //System.out.println("repeat(" + itemCount.count + ")" + arc.cmNode.getNodeName());
- }
- }
-
- public void pop(Arc arc)
- {
- if (arc.kind == Arc.ELEMENT)
- {
- //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
- int size = elementOriginStack.size();
- elementOriginStack.remove(size - 1);
- }
- else if (arc.kind == Arc.PREV_IN)
- {
- //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
- activeItemCountList.remove(activeItemCountList.size() - 1);
- }
- else if (arc.kind == Arc.OUT_NEXT)
- {
- //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
- int size = inactiveItemCountList.size();
- ItemCount itemCount = (ItemCount)inactiveItemCountList.get(size - 1);
- inactiveItemCountList.remove(size - 1);
- activeItemCountList.add(itemCount);
- }
- else if (arc.kind == Arc.REPEAT)
- {
- //System.out.println("[X]pop(" + arc.kind + ")" + arc.cmNode.getNodeName());
- ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
- itemCount.count--;
- }
- }
-
- public Vector getElementOriginList()
- {
- return elementOriginStack;
- }
-
- public CMNode[] getOriginArray()
- {
- return originArray;
- }
-
- public void setOriginArray(CMNode[] originArray)
- {
- this.originArray = originArray;
- }
-
- public int getPartialValidationCount()
- {
- return partialValidationCount;
- }
-
- public void setPartialValidationCount(int partialValidationCount)
- {
- this.partialValidationCount = partialValidationCount;
- }
- }
-
- /**
- *
- */
- public static class PathRecordingResult extends Result
- {
- protected Vector arcList = new Vector();
-
- public void push(Arc arc)
- {
- arcList.add(arc);
- }
-
- public void pop(Arc arc)
- {
- int size = arcList.size();
- arcList.remove(size - 1);
- }
-
- public List getArcList()
- {
- List list = new Vector();
- for (Iterator iterator = arcList.iterator(); iterator.hasNext(); )
- {
- Arc arc = (Arc)iterator.next();
- if (arc.kind == Arc.ELEMENT)
- {
- list.add(arc);
- }
- }
- return list;
- }
-
- public MatchModelNode getMatchModel()
- {
- MatchModelNodeBuilder builder = new MatchModelNodeBuilder(arcList);
- builder.buildMatchModel();
- return builder.getRoot();
- }
- }
-
- /**
- *
- */
- public static class MatchModelNode
- {
- public CMNode cmNode;
- public List children = new Vector();
- public Object data;
-
- public MatchModelNode(MatchModelNode parent, CMNode cmNode)
- {
- this.cmNode = cmNode;
- }
-
- public void printModel(int indent)
- {
- //String cmNodeName = cmNode != null ? cmNode.getNodeName() : "null";
- //printlnIndented(indent, "MatchModelNode : " + cmNodeName);
- for (Iterator iterator = children.iterator(); iterator.hasNext(); )
- {
- MatchModelNode child = (MatchModelNode)iterator.next();
- child.printModel(indent + 2);
- }
- }
- }
-
- public static class MatchModelNodeBuilder
- {
- protected List arcList;
- protected List stack = new Vector();
- protected MatchModelNode root;
- protected MatchModelNode current;
-
- public MatchModelNodeBuilder(List arcList)
- {
- this.arcList = arcList;
- root = new MatchModelNode(null, null);
- push(root);
- }
-
- protected void push(MatchModelNode node)
- {
- current = node;
- stack.add(node);
- }
-
- protected void pop()
- {
- int size = stack.size();
- stack.remove(size - 1);
- current = (MatchModelNode)stack.get(size - 2);
- }
-
- public boolean isCMGroup(CMNode cmNode)
- {
- return cmNode != null && cmNode.getNodeType() == CMNode.GROUP;
- }
-
- public void buildMatchModel()
- {
- for (Iterator iterator = arcList.iterator(); iterator.hasNext(); )
- {
- Arc arc = (Arc)iterator.next();
-
- if (arc.kind == Arc.ELEMENT)
- {
- current.children.add(new MatchModelNode(current, arc.cmNode));
- }
- else if (arc.kind == Arc.PREV_IN)
- {
- if (isCMGroup(arc.cmNode))
- {
- MatchModelNode newModelNode = new MatchModelNode(current, arc.cmNode);
- current.children.add(newModelNode);
- push(newModelNode);
- }
- }
- else if (arc.kind == Arc.OUT_NEXT)
- {
- if (isCMGroup(arc.cmNode))
- {
- pop();
- }
- }
- else if (arc.kind == Arc.REPEAT)
- {
- if (isCMGroup(arc.cmNode))
- {
- pop();
- MatchModelNode newModelNode = new MatchModelNode(current, arc.cmNode);
- current.children.add(newModelNode);
- push(newModelNode);
- }
- }
- }
- }
-
- public MatchModelNode getRoot()
- {
- return root;
- }
- }
-
-
- /**
- *
- */
- public interface ElementContentComparator
- {
- public boolean isIgnorable(Object o);
- public boolean isPCData(Object o);
- public boolean isElement(Object o);
- public boolean matches(Object o, CMNode cmNode);
- }
-
- /**
- * A linked list
- */
- public static class ElementList
- {
- protected Object head;
- protected ElementList tail;
-
- public static ElementList create(List v)
- {
- ElementList first = null;
- ElementList prev = null;
-
- for (Iterator iterator = v.iterator(); iterator.hasNext(); )
- {
- Object o = iterator.next();
- if (o != null)
- {
- ElementList list = new ElementList();
- list.head = o;
-
- if (prev != null)
- {
- prev.tail = list;
- }
- else
- {
- first = list;
- }
- prev = list;
- }
- }
- return first;
- }
-
-
- public String toString()
- {
- String string = "[" + head + "],"; //$NON-NLS-1$ //$NON-NLS-2$
-
- if (tail != null)
- {
- string += tail.toString();
- }
-
- return string;
- }
- }
-
- /**
- * StringElementContentComparator
- */
- public static class StringElementContentComparator implements ElementContentComparator
- {
- public boolean isIgnorable(Object o)
- {
- String string = o.toString();
- return string.startsWith("!") || string.startsWith("?"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean isPCData(Object o)
- {
- String string = o.toString();
- return string.startsWith("'") || string.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean isElement(Object o)
- {
- return !isIgnorable(o) && !isPCData(o);
- }
-
- public boolean matches(Object o, CMNode cmNode)
- {
- boolean result = false;
- if (cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- {
- CMElementDeclaration element = (CMElementDeclaration)cmNode;
- String name = o.toString();
- int index = name.indexOf("]"); //$NON-NLS-1$
- if (index != -1)
- {
- name = name.substring(index + 1);
- }
- result = name.equalsIgnoreCase(element.getElementName());
-
- // TODO... here's we consider substitution groups... revisit to see if this should be moved into validator code
- if (!result)
- {
- CMNodeList cmNodeList = (CMNodeList)element.getProperty("SubstitutionGroup"); //$NON-NLS-1$
- if (cmNodeList != null)
- {
- int cmNodeListLength = cmNodeList.getLength();
- if (cmNodeListLength > 1)
- {
- for (int i = 0; i < cmNodeListLength; i++)
- {
- CMElementDeclaration alternativeCMElementDeclaration = (CMElementDeclaration)cmNodeList.item(i);
- String altName = alternativeCMElementDeclaration.getElementName();
- result = name.equalsIgnoreCase(altName);
- if (result)
- {
- break;
- }
- }
- }
- }
- }
- }
- else if (cmNode.getNodeType() == CMNode.ANY_ELEMENT)
- {
- String string = o.toString();
- if (string.equals("*")) //$NON-NLS-1$
- {
- result = true;
- }
- else
- {
- CMAnyElement anyElement = (CMAnyElement)cmNode;
- String anyElementURI = anyElement.getNamespaceURI();
- if (anyElementURI != null)
- {
- if (anyElementURI.equals("##any")) //$NON-NLS-1$
- {
- result = true;
- }
- else if (anyElementURI.equals("##other")) //$NON-NLS-1$
- {
- result = true;
- CMDocument cmDocument = (CMDocument)anyElement.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String excludedURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- if (excludedURI != null)
- {
- String specifiedURI = getURIForContentSpecification(string);
- if (specifiedURI != null && excludedURI.equals(specifiedURI))
- {
- result = false;
- }
- }
- }
- }
- else if (anyElementURI.equals("##targetNamespace")) //$NON-NLS-1$
- {
- result = true;
- CMDocument cmDocument = (CMDocument)anyElement.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String targetNamespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- String specifiedURI = getURIForContentSpecification(string);
- if (specifiedURI != null && !targetNamespaceURI.equals(specifiedURI))
- {
- result = false;
- }
- }
- }
- else
- {
- result = true;
- String specifiedURI = getURIForContentSpecification(string);
- if (specifiedURI != null && !anyElementURI.equals(specifiedURI))
- {
- result = false;
- }
- }
- }
- else
- {
- result = true;
- }
- }
- }
- return result;
- }
-
-
- protected String getURIForContentSpecification(String specification)
- {
- String result = null;
- int index = specification.indexOf("]"); //$NON-NLS-1$
- if (index != -1)
- {
- result = specification.substring(1, index);
- }
- return result;
- }
- }
-
- public static List createStringList(String arg[], int startIndex)
- {
- Vector v = new Vector();
- for (int i = startIndex; i < arg.length; i++)
- {
- v.add(arg[i]);
- }
- return v;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java
deleted file mode 100644
index 4a11a27922..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-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.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * A special CMValidator that knows about DOMs
- */
-public class DOMValidator extends CMValidator
-{
- protected String getNamespaceURI(Node node)
- {
- return DOMNamespaceHelper.getNamespaceURI(node);
- //return node.getNamespaceURI();
- }
-
-
- //
- // This is a temporary hack!!
- //
- protected String getFallbackNamepaceURI(CMElementDeclaration ed)
- {
- String fallbackNamepaceURI = null;
- CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- fallbackNamepaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- }
- return fallbackNamepaceURI;
- }
-
- /**
- * Encode the Element's NodeList as a List of strings that the validator recognizes
- */
- public List createContentSpecificationList(Element element, CMElementDeclaration ed)
- {
- boolean isNamespaceAware = isNamespaceAware(ed);
- Vector v = new Vector();
- for (Node childNode = element.getFirstChild(); childNode != null; childNode = childNode.getNextSibling())
- {
- v.add(createContentSpecification(childNode, isNamespaceAware, isNamespaceAware ? getFallbackNamepaceURI(ed) : null));
- }
- return v;
- }
-
-
- public List createContentSpecificationList(List nodeList, CMElementDeclaration ed)
- {
- boolean isNamespaceAware = isNamespaceAware(ed);
- Vector v = new Vector();
-
- for (Iterator i = nodeList.iterator(); i.hasNext(); )
- {
- Node node = (Node)i.next();
- v.add(createContentSpecification(node, isNamespaceAware, getFallbackNamepaceURI(ed)));
- }
- return v;
- }
-
-
- /**
- * Encode the Node as a string that the validator recognizes
- */
- public String createContentSpecification(Node node, boolean isNamespaceAware, String fallbackNamepaceURI)
- {
- String result = "!"; //$NON-NLS-1$
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE :
- {
- String nodeName = node.getNodeName();
- if (nodeName.startsWith("jsp:")) //$NON-NLS-1$
- {
- result = "!"; // treat it as a comment so that it's ignored by the validator //$NON-NLS-1$
- }
- else
- {
- if (isNamespaceAware)
- {
- result = DOMNamespaceHelper.getUnprefixedName(nodeName);
- String uri = getNamespaceURI(node);
- if (uri != null)
- {
- result = "[" + uri + "]" + result; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (fallbackNamepaceURI != null)
- {
- result = "[" + fallbackNamepaceURI + "]" + result; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else
- {
- result = nodeName;
- }
- }
- //ContentModelManager.println("result " + result);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE :
- {
- result = "?"; //$NON-NLS-1$
- break;
- }
- case Node.COMMENT_NODE :
- {
- result = "!"; //$NON-NLS-1$
- break;
- }
- case Node.CDATA_SECTION_NODE :
- {
- result = "\"" + node.getNodeName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- case Node.TEXT_NODE :
- {
- String data = ((Text)node).getData();
- // here we test to see if the test node is 'ignorable'
- if (data != null && data.trim().length() > 0)
- {
- result = "\"" + node.getNodeName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- result = "!"; // todo... use another symbol? //$NON-NLS-1$
- }
- break;
- }
- }
- return result;
- }
-
-
- /**
- *
- */
- public List createContentSpecificationList(CMNode cmNode)
- {
- List list = new Vector();
- switch (cmNode.getNodeType())
- {
- case CMNode.ELEMENT_DECLARATION :
- {
- list.add(createContentSpecificationForCMElementDeclaration((CMElementDeclaration)cmNode));
- break;
- }
- case CMNode.DATA_TYPE :
- {
- list.add("\"" + cmNode.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- case CMNode.GROUP :
- {
- createContentSpecificationListForCMGroup((CMGroup)cmNode, list);
- break;
- }
- case CMNode.ANY_ELEMENT :
- {
- list.add("*"); //$NON-NLS-1$
- break;
- }
- default :
- {
- list.add("!"); //$NON-NLS-1$
- }
- }
- return list;
- }
-
-
- /**
- *
- */
- protected String createContentSpecificationForCMElementDeclaration(CMElementDeclaration ed)
- {
- CMDocument document = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
- String uri = document != null ? (String)document.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") : null; //$NON-NLS-1$
- String string = ed.getNodeName();
- if (uri != null)
- {
- string = "[" + uri + "]" + string; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return string;
- }
-
- /**
- *
- */
- protected void createContentSpecificationListForCMGroup(CMGroup group, List list)
- {
- CMGroupContentVisitor visitor = new CMGroupContentVisitor(group, list);
- visitor.visitCMNode(group);
- }
-
- protected class CMGroupContentVisitor extends CMVisitor
- {
- protected CMGroup root;
- protected List list;
-
- public CMGroupContentVisitor(CMGroup root, List list)
- {
- this.root = root;
- this.list = list;
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- if (ed.getMinOccur() > 0)
- {
- list.add(createContentSpecificationForCMElementDeclaration(ed));
- }
- }
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- list.add("*"); //$NON-NLS-1$
- }
-
- public void visitCMGroup(CMGroup group)
- {
- if (group == root || group.getMinOccur() > 0)
- {
- int op = group.getOperator();
- if (op == CMGroup.SEQUENCE)
- {
- super.visitCMGroup(group);
- }
- else if (op == CMGroup.CHOICE)
- {
- CMNodeList nodeList = group.getChildNodes();
- if (nodeList.getLength() > 0)
- {
- visitCMNode(nodeList.item(0));
- }
- }
- }
- }
- }
-
- public boolean isNamespaceAware(CMElementDeclaration ed)
- {
- return ed != null ? ed.getProperty("http://org.eclipse.wst/cm/properties/isNameSpaceAware") != null : false; //$NON-NLS-1$
- }
-
- /**
- *
- */
- public CMNode[] getOriginArray(CMElementDeclaration ed, Element element)
- {
- ElementPathRecordingResult result = new ElementPathRecordingResult();
- getOriginArray(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
- return result.getOriginArray();
- }
-
- /**
- *
- */
- public MatchModelNode getMatchModel(CMElementDeclaration ed, Element element)
- {
- MatchModelNode matchModelNode = null;
- PathRecordingResult result = new PathRecordingResult();
- validate(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
- if (result.isValid)
- {
- matchModelNode = result.getMatchModel();
- }
- return matchModelNode;
- }
-
-
- public List clone(List list)
- {
- List result = new Vector(list.size());
- result.addAll(list);
- return result;
- }
-
- /**
- *
- */
- public boolean canInsert(CMElementDeclaration ed, List contentSpecificationList, int insertIndex, CMNode cmNode)
- {
- List clonedList = clone(contentSpecificationList);
- insert(clonedList, insertIndex, cmNode);
- boolean result = isPartiallyValid(ed, clonedList);
- return result;
- }
-
- /**
- *
- */
- public boolean canInsert(CMElementDeclaration ed, List contentSpecificationList, int insertIndex, List cmNodeList)
- {
- List clonedList = clone(contentSpecificationList);
- insert(clonedList, insertIndex, cmNodeList);
- return isValid(ed, clonedList);
- }
-
- /**
- *
- */
- public boolean canRemove(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex)
- {
- return canRemove(ed, contentSpecificationList, startRemoveIndex, startRemoveIndex);
- }
-
- /**
- *
- */
- public boolean canRemove(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex, int endRemoveIndex)
- {
- List clonedList = clone(contentSpecificationList);
- remove(clonedList, startRemoveIndex, endRemoveIndex);
- return isValid(ed, clonedList);
- }
-
- /**
- *
- */
- public boolean canReplace(CMElementDeclaration ed, List contentSpecificationList, int startRemoveIndex, int endRemoveIndex, CMNode cmNode)
- {
- List clonedList = clone(contentSpecificationList);
- remove(clonedList, startRemoveIndex, endRemoveIndex);
- insert(clonedList, startRemoveIndex, cmNode);
- return isValid(ed, clonedList);
- }
-
- /**
- *
- */
- public boolean isValid(CMElementDeclaration ed, List contentSpecificationList)
- {
- Result result = new Result();
- validate(ed, contentSpecificationList, stringContentComparitor, result);
- return result.isValid;
- }
-
- public boolean isPartiallyValid(CMElementDeclaration ed, List contentSpecificationList)
- {
- CMValidator.ElementPathRecordingResult result = new CMValidator.ElementPathRecordingResult();
- validate(ed, contentSpecificationList, stringContentComparitor, result);
- int count = getElementCount(contentSpecificationList);
- //System.out.println("elementOriginList " + result.getPartialValidationCount() + "vs" + count);
- return result.getPartialValidationCount() >= count;
- }
-
- public int getElementCount(List contentSpecificationList)
- {
- int count = 0;
- for (Iterator i = contentSpecificationList.iterator(); i.hasNext(); )
- {
- if (stringContentComparitor.isElement(i.next()))
- {
- count++;
- }
- }
- return count;
- }
-
- protected Result validate(CMElementDeclaration ed, Element element)
- {
- Result result = new Result();
- validate(ed, createContentSpecificationList(element, ed), stringContentComparitor, result);
- return result;
- }
-
-
- protected void remove(List stringList, int startRemoveIndex, int endRemoveIndex)
- {
- if (startRemoveIndex != -1)
- {
- for (int i = startRemoveIndex; i <= endRemoveIndex; i++)
- {
- stringList.remove(i);
- }
- }
- }
-
- protected void insert(List stringList, int insertIndex, CMNode cmNode)
- {
- if (insertIndex != -1)
- {
- stringList.addAll(insertIndex, createContentSpecificationList(cmNode));
- }
- }
-
- protected void insert(List stringList, int insertIndex, List cmNodeList)
- {
- if (insertIndex != -1)
- {
- int insertListSize = cmNodeList.size();
- for (int i = insertListSize - 1; i >= 0; i--)
- {
- CMNode cmNode = (CMNode)cmNodeList.get(i);
- stringList.addAll(insertIndex, createContentSpecificationList(cmNode));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java
deleted file mode 100644
index 6fbee2aa9c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-
-/**
- * The CMDocumentManager can be visualized as a table of CMDocument
- * references, each with a corresponding entry in a CMDocument cache. The
- * CMDocumentManager also performs the task of loading CMDocuments providing
- * support for synchronous and asynchronous loading.
- *
- * publicIdTable CMDocumentCache ---------------------------
- * --------------------------------------- | publicId | resolvedURI | -> |
- * resolvedURI | status | CMDocument | ---------------------------
- * --------------------------------------- | (null) | file:/x.dtd | |
- * file:/x.dtd | loading | (null) | ---------------------------
- * --------------------------------------- | http:/... | file:/y.xsd | |
- * file:/y.xsd | loaded | | ---------------------------
- * ---------------------------------------
- *
- */
-public interface CMDocumentManager {
- /**
- * This property specifies WHEN CMDocuments are loaded. Setting this
- * property to true allows the CMDocumentManager to load CMDocuments on
- * demand. Settings this property a false puts the onus on the client to
- * call addCMDocumentReference() to explicity trigger a load. This allows
- * the client to control exactly when loading should take place. )
- */
- public static final String PROPERTY_AUTO_LOAD = "autoLoad"; //$NON-NLS-1$
-
- /**
- * This property specifies HOW CMDocuments are loaded. When set to false,
- * the getCMDocument() method will load the CMDocument synchronously and
- * return a CMDocument object when loading is successful. When set to
- * true, the getCMDocument() will load the CMDocument asynchronously and
- * will immediately return null. When loading is complete, the
- * CMDocumentManager will inform its listeners that the CMDocument has
- * been loaded.
- */
- public static final String PROPERTY_ASYNC_LOAD = "asyncLoad"; //$NON-NLS-1$
-
- /**
- *
- */
- public static final String PROPERTY_USE_CACHED_RESOLVED_URI = "useCachedResovledURI"; //$NON-NLS-1$
-
- /**
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399
- * Allows a client to control whether the document manager attempts to resolve a
- * CM document's URI. When set to false, the CM systemID will be assumed to point
- * to an already resolved URI. By default this property is set to true.
- */
- public static final String PROPERTY_PERFORM_URI_RESOLUTION = "performURIResolution"; //$NON-NLS-1$
-
- /**
- * Set the enabled state of a property.
- */
- public void setPropertyEnabled(String propertyName, boolean enabled);
-
- /**
- * Get the enabled state of the property.
- */
- public boolean getPropertyEnabled(String propertyName);
-
- /**
- * Adds a listener. Listeners should expect to receive call backs on a
- * secondary thread when asynchronously loading is used.
- */
- public void addListener(CMDocumentManagerListener listener);
-
- /**
- * Removes a listener.
- */
- public void removeListener(CMDocumentManagerListener listener);
-
- /**
- * Lookup or create a CMDocument (depending on PROPERTY_AUTO_LOAD).
- *
- * @param publicId
- * @param systemId
- * @param type -
- * 'dtd', 'xsd', 'tld', etc. if null is given as the type, then
- * the type is calculated as last segment (e.g. file extension)
- * of the resolved URI
- * @return
- */
- public CMDocument getCMDocument(String publicId, String systemId, String type);
-
- /**
- * Lookup a CMDocument.
- */
- public CMDocument getCMDocument(String publicId);
-
- /**
- * Get the status of a CMDocument.
- */
- public int getCMDocumentStatus(String publicId);
-
- /**
- * Creates a CMDocument and adds the associated CMDocument reference
- * information to the table. Calling this method always triggers a
- * CMDocument load.
- */
- public void addCMDocumentReference(String publicId, String systemId, String type);
-
- /**
- * Add an existingCMDocument and the reference information to the table.
- */
- public void addCMDocument(String publicId, String systemId, String resolvedURI, String type, CMDocument cmDocument);
-
- /**
- * Remove all entries from the table.
- */
- public void removeAllReferences();
-
- /**
- * Get the CMDocumentCache that is used to store loaded CMDocuments and
- * associated status.
- */
- public CMDocumentCache getCMDocumentCache();
-
- /**
- * Builds a CMDocument given a resoulvedURI. Note that no entries are
- * added to the table.
- */
- public CMDocument buildCMDocument(String publicId, String resolvedURI, String type);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java
deleted file mode 100644
index bd607dccc8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCacheListener;
-
-/**
- *
- */
-public interface CMDocumentManagerListener extends CMDocumentCacheListener
-{
- public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java
deleted file mode 100644
index 1d57f4612d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-
-public interface CMDocumentReference
-{
- public String getPublicId();
- public String getSystemId();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java
deleted file mode 100644
index d7dc8bfaa8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import java.util.List;
-
-import org.w3c.dom.Node;
-
-/**
- * The interface is used to abstract the task of computing the document references associated with a DOM
- * or a particular node within the DOM.
- */
-public interface CMDocumentReferenceProvider
-{
- List getCMDocumentReferences(Node node, boolean deep);
- String resolveGrammarURI(String publicId, String systemId);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/IExternalSchemaLocationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/IExternalSchemaLocationProvider.java
deleted file mode 100644
index 4ce758335c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/IExternalSchemaLocationProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery;
-
-import java.net.URI;
-import java.util.Map;
-
-public interface IExternalSchemaLocationProvider {
- String SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-schemaLocation"; //$NON-NLS-1$
- String NO_NAMESPACE_SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; //$NON-NLS-1$
-
- /**
- * Provided the file path URI, this will return the external schema location. The schema location is associated to a specific property,
- * which serves as the key in the map. The supported properties are:
- *
- * <p><b>http://apache.org/xml/properties/schema/external-schemaLocation</b> - The value for this property follows the same rules
- * as the schemaLocation attribute for an XML document (i.e., multiple schemas are acceptable and must be white-space separated).</p>
- *
- * <p><b>http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</b> - The value for this property follows the same
- * rules as the noNamespaceSchemaLocation attribute for an XML document (i.e., only one schema is allowed).
- *
- * @param filePath the path for the XML file
- * @return a {@link Map} associating the external-schemaLocation and/or external-noNamespaceSchemaLocation to the schema location
- */
- Map getExternalSchemaLocation(URI fileURI);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java
deleted file mode 100644
index 5d300e8d7c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * This class provides an interface for performing higher level queries based on
- * a xml model (DOM) and one or more associated content models (CMDocument).
- *
- * The queries provided can be organized into three groups:
- *
- * 1) DOM Node to CMNode mapping
- * Given a grammatically valid DOM Node the corresponding CMNode can be determined.
- * (i.e. Element -> CMElementDeclaration, Attr -> CMAttributeDeclaration, CharacterData -> CMDataType)
- *
- * 2) DOM editing tests ("Can I do this?")
- * Questions such as canInsert, canRemove, canReplace can assist in the editing of a DOM.
- *
- * The validityChecking argument determines the strictness of the validity testing that occurs.
- *
- * - VALIDITY_NONE : The current content of the Element is ignored.
- * Only the content model is considered.
- * This is most useful for codeassist related queries.
- *
- * - VALIDITY_STRICT : The current content of the Element is considered.
- * Returns true only if the operation preserves content validity.
- * This is useful when DOM editing needs to be constrained to maintain validity.
- *
- * - VALIDITY_PARTIAL : Some optimized compromise between the two options above.
- *
- * 3) DOM editing actions ("What can I do here?")
- * These methods return ModelQueryActions that are relevant at some specified DOM Node.
- * The actions indicate what kinds of DOM Node can be inserted where (at what index).
- */
-public interface ModelQuery
-{
- public static final int VALIDITY_NONE = 0;
- public static final int VALIDITY_PARTIAL = 1;
- public static final int VALIDITY_STRICT = 2;
-
- public static final int INCLUDE_ALL = 0xFF;
- public static final int INCLUDE_ATTRIBUTES = 0x01;
- public static final int INCLUDE_CHILD_NODES = 0x02;
- public static final int INCLUDE_SEQUENCE_GROUPS = 0x04;
- public static final int INCLUDE_TEXT_NODES = 0x08;
- public static final int INCLUDE_ENCLOSING_REPLACE_ACTIONS = 0x10;
-
- public static final int EDIT_MODE_UNCONSTRAINED = 0;
- public static final int EDIT_MODE_CONSTRAINED_LENIENT= 1;
- public static final int EDIT_MODE_CONSTRAINED_STRICT = 2;
-
-
- void setEditMode(int editMode);
-
- int getEditMode();
-
- /**
- * Returns the CMDocument that corresponds to the DOM Node.
- * or null if no CMDocument is appropriate for the DOM Node.
- */
- CMDocument getCorrespondingCMDocument(Node node);
-
- /**
- * Returns the corresponding CMNode for the DOM Node
- * or null if no CMNode is appropriate for the DOM Node.
- */
- CMNode getCMNode(Node node);
-
- /**
- * Returns the corresponding CMAttribute for the DOM Node
- * or null if no CMNode is appropriate for the DOM Node.
- */
- CMAttributeDeclaration getCMAttributeDeclaration(Attr attr);
-
- /**
- * Returns the corresponding CMAttribute for the DOM Node
- * or null if no CMNode is appropriate for the DOM Node.
- */
- CMElementDeclaration getCMElementDeclaration(Element element);
-
- /**
- * Returns true if the content of the element is valid
- */
- boolean isContentValid(Element element);
-
- /**
- * Returns the CMNode of the parent element's content model
- * that corresponds to the node
- */
- CMNode getOrigin(Node node);
-
- /**
- * Returns an array of CMNodes of the parent element's content model
- * that corresponds to the node
- */
- CMNode[] getOriginArray(Element element);
-
- /**
- * Returns a list of all CMNode 'meta data' that may be potentially added to the element.
- */
- List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions);
-
- /**
- * Can a DOM Node corresponding to the CMNode 'meta data' be added to the parent
- */
- boolean canInsert(Element parent, CMNode cmNode, int index, int validityChecking);
-
- /**
- * Can multiple DOM Nodes corresponding to the list of CMNode 'meta data' be added to the parent
- */
- boolean canInsert(Element parent, List cmNodeList, int index, int validityChecking);
-
- /**
- * Can the DOM Node be removed
- */
- boolean canRemove(Node node, int validityChecking);
-
- /**
- * Can the list of DOM Nodes be removed
- */
- boolean canRemove(List nodeList, int validityChecking);
-
- /**
- * Can the children within the indicated indices be replaced with a DOM Node corresponding to the CMNode 'meta data'
- */
- boolean canReplace(Element parent, int startIndex, int endIndex, CMNode cmNode, int validityChecking);
-
- /**
- * Can the children within the indicated indices be replaced with multiple DOM Nodes corresponding to the list of CMNode 'meta data'
- */
- boolean canReplace(Element parent, int startIndex, int endIndex, List cmNodeList, int validityChecking);
-
- /**
- *
- */
- void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList);
-
- /**
- *
- */
- void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList);
-
- /**
- * Return a list of replace actions that can be performed on the parent's content
- */
- void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList);
-
- /**
- * Return a list of replace actions that can be performed on the selected children of that parent
- */
- void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList);
-
-
- /**
- * @deprecated - use getPossibleDataTypeValues()
- */
- List getDataTypeValues(Element element, CMNode cmNode);
-
- /**
- * This methods return an array of possible values corresponding to the datatype of the CMNode (either an CMAttributeDeclaration or a CMElementDeclaration)
- */
- String[] getPossibleDataTypeValues(Element element, CMNode cmNode);
-
- /**
- * This method may return null if a CMDocumentManager is not used by the ModelQuery
- */
- CMDocumentManager getCMDocumentManager();
-
- /**
- * This method may return null the ModelQuery doesn't support the use of extensions
- */
- ModelQueryExtensionManager getExtensionManager();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java
deleted file mode 100644
index 059c4ff78b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Node;
-
-
-public interface ModelQueryAction
-{
- public static final int INSERT = 1;
- public static final int REMOVE = 2;
- public static final int REPLACE = 4;
-
- public int getKind();
- /**
- * if start index == -1 then no insert is possible
- * if start index != -1 and endIndex == -1 then an insert at any position is possible
- */
- public int getStartIndex();
- public int getEndIndex();
- public Node getParent();
- public CMNode getCMNode();
- public Object getUserData();
- public void setUserData(Object object);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java
deleted file mode 100644
index 77777560c4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- *
- *
- */
-public interface ModelQueryAssociationProvider extends ModelQueryCMProvider
-{
- public CMNode getCMNode(Node node);
- public CMDataType getCMDataType(Text text);
- public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr);
- public CMElementDeclaration getCMElementDeclaration(Element element);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java
deleted file mode 100644
index f0f937396c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelquery;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.w3c.dom.Node;
-
-
-
-/**
- *
- */
-public interface ModelQueryCMProvider
-{
- /**
- * Returns the CMDocument that corresponds to the DOM Node.
- * or null if no CMDocument is appropriate for the DOM Node.
- */
- CMDocument getCorrespondingCMDocument(Node node);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java
deleted file mode 100644
index b417f569d5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public abstract class ModelQueryExtension
-{
- protected static final String[] EMPTY_STRING_ARRAY = {};
- protected static final CMNode[] EMPTY_CMNODE_ARRAY = {};
-
- /**
- * @param ownerElement - the owner element
- * @param namespace - the active namespace
- * @param name - the name of an attribute node
- * @return valid values for the given attribute
- */
-public String[] getAttributeValues(Element ownerElement, String namespace, String name)
- {
- return EMPTY_STRING_ARRAY;
- }
-
- public String[] getElementValues(Node parentNode, String namespace, String name)
- {
- return EMPTY_STRING_ARRAY;
- }
-
- /**
- * @param parentNode
- * @param namespace
- * @param name
- * @return whether a child element of the given parentNode is valid given the active namespace
- */
-public boolean isApplicableChildElement(Node parentNode, String namespace, String name)
- {
- return true;
- }
-
- /**
- * @param parentElement - the parent Element when asking for children, the owner Element when asking for attributes
- * @param namespace - the active namespace
- * @param includeOptions - ModelQuery.INCLUDE_ATTRIBUTES or ModelQuery.INCLUDE_CHILD_NODES
- * @return additional valid CMAttributeDeclarations or CMElementDeclarations
- */
-public CMNode[] getAvailableElementContent(Element parentElement, String namespace, int includeOptions)
- {
- return EMPTY_CMNODE_ARRAY;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java
deleted file mode 100644
index 31c440fb11..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Element;
-
-
-
-public interface ModelQueryExtensionManager
-{
- List getDataTypeValues(Element element, CMNode cmNode);
-
- void filterAvailableElementContent(List availableContent, Element element, CMElementDeclaration ed);
-
- void filterAvailableElementContent(List availableContent, Element element, CMElementDeclaration ed, int includeOptions);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java
deleted file mode 100644
index 54242f6654..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAssociationProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- *
- */
-public abstract class BaseAssociationProvider implements ModelQueryAssociationProvider
-{
- public BaseAssociationProvider()
- {
- }
-
- public CMNode getCMNode(Node node)
- {
- CMNode result = null;
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE :
- {
- result = getCMAttributeDeclaration((Attr)node);
- break;
- }
- case Node.ELEMENT_NODE :
- {
- result = getCMElementDeclaration((Element)node);
- break;
- }
- case Node.CDATA_SECTION_NODE :
- case Node.TEXT_NODE :
- {
- result = getCMDataType((Text)node);
- break;
- }
- }
- return result;
- }
-
-
- public CMDataType getCMDataType(Text text)
- {
- CMDataType result = null;
- Node parentNode = text.getParentNode();
- if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- CMElementDeclaration ed = getCMElementDeclaration((Element)parentNode);
- result = ed.getDataType();
- }
- return result;
- }
-
-
- public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
- {
- CMAttributeDeclaration result = null;
- Element element = attr.getOwnerElement();
- if (element != null)
- {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- if (ed != null)
- {
- result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(attr.getName());
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java
deleted file mode 100644
index a4900efce8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.core.runtime.Platform;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- *
- */
-public class CMDocumentLoader
-{
- private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.xml.core/externalSchemaLocation")).booleanValue(); //$NON-NLS-1$
- protected Document document;
- protected ModelQuery modelQuery;
- protected CMDocumentManager cmDocumentManager;
- protected boolean isInferredGrammarEnabled = true;
- protected CMDocumentLoadingNamespaceTable namespaceTable;
- protected int count = 0;
-
- public CMDocumentLoader(Document document, ModelQuery modelQuery)
- {
- this(document, modelQuery.getCMDocumentManager());
- }
-
- public CMDocumentLoader(Document document, CMDocumentManager cmDocumentManager)
- {
- this.document = document;
- this.cmDocumentManager = cmDocumentManager;
- }
-
- public void loadCMDocuments()
- {
- //System.out.println("----------loadCMDocuments ------------");
- //long time = System.currentTimeMillis();
-
- boolean walkDocument = false;
-
- cmDocumentManager.removeAllReferences();
-
- String[] doctypeInfo = XMLAssociationProvider.getDoctypeInfo(document);
- if (doctypeInfo != null)
- {
- // load the doctype if required
- walkDocument = handleGrammar(doctypeInfo[0], doctypeInfo[1], "DTD"); //$NON-NLS-1$
- }
- else
- {
- Element element = getRootElement(document);
- if (element != null)
- {
- namespaceTable = new CMDocumentLoadingNamespaceTable(document);
- namespaceTable.addElement(element);
- if (namespaceTable.isNamespaceEncountered())
- {
- walkDocument = true;
- //System.out.println("isNamespaceAware");
- }
- else
- {
- namespaceTable = null;
- walkDocument = isInferredGrammarEnabled;
- //System.out.println("is NOT namespaceAware");
- }
- }
- }
-
- if (walkDocument)
- {
- if (!checkExternalSchema())
- visitNode(document);
- }
-
- //System.out.println("--- elapsed time (" + count + ") = " + (System.currentTimeMillis() - time));
- }
-
- protected boolean checkExternalSchema() {
- boolean externalSchemaLoaded = false;
- if (document instanceof IDOMDocument) {
- final String baseLocation = ((IDOMDocument) document).getModel().getBaseLocation();
- if (baseLocation == null)
- return false;
- final IPath basePath = new Path(baseLocation);
- IFile file = null;
- if (basePath.segmentCount() > 1) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- }
- final URI uri = (file == null || !file.isAccessible()) ? new File(baseLocation).toURI() : file.getLocationURI();
- if (uri != null) {
- IExternalSchemaLocationProvider[] providers = ExternalSchemaLocationProviderRegistry.getInstance().getProviders();
- for (int i = 0; i < providers.length; i++) {
- long time = _trace ? System.currentTimeMillis(): 0;
- final Map locations = providers[i].getExternalSchemaLocation(uri);
- if (_trace) {
- long diff = System.currentTimeMillis() - time;
- if (diff > 250)
- Logger.log(Logger.INFO, "Schema location provider took [" + diff + "ms] for URI [" + uri + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (locations != null && !locations.isEmpty()) {
- // Use the externalSchemaLocation
- if (namespaceTable != null && namespaceTable.isNamespaceEncountered()) {
- final String location = locations.get(IExternalSchemaLocationProvider.SCHEMA_LOCATION).toString();
- if (location != null) {
- final String[] ids = StringUtils.asArray(location);
- // namespace : location pairs
- if (ids.length >= 2 && ids.length % 2 == 0) {
- if (!externalSchemaLoaded)
- cmDocumentManager.removeAllReferences();
- for (int j = 0; j < ids.length; j+=2) {
- handleGrammar(ids[j], ids[j + 1], "XSD"); //$NON-NLS-1$
- externalSchemaLoaded = true;
- }
- }
- }
- }
- else { // noNamespace
- handleGrammar(uri.toString(), locations.get(IExternalSchemaLocationProvider.NO_NAMESPACE_SCHEMA_LOCATION).toString(), "XSD"); //$NON-NLS-1$
- externalSchemaLoaded = true;
- break;
- }
- }
- }
- }
- }
- return externalSchemaLoaded;
- }
-
- public boolean handleGrammar(String publicId, String systemId, String type)
- {
- boolean result = false;
-
- int status = cmDocumentManager.getCMDocumentStatus(publicId);
- if (status == CMDocumentCache.STATUS_NOT_LOADED)
- {
- cmDocumentManager.addCMDocumentReference(publicId, systemId, type);
- }
- else if (status == CMDocumentCache.STATUS_ERROR)
- {
- result = true;
- }
- return result;
- }
-
-
- public void handleElement(Element element)
- {
- visitChildNodes(element);
- }
-
-
- public void handleElementNS(Element element)
- {
- namespaceTable.addElement(element);
- visitChildNodes(element);
- }
-
-
- public void visitNode(Node node)
- {
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE)
- {
- count++;
-
- Element element = (Element)node;
- if (namespaceTable == null)
- {
- handleElement(element);
- }
- else
- {
- handleElementNS(element);
- }
- }
- else if (nodeType == Node.DOCUMENT_NODE)
- {
- visitChildNodes(node);
- }
- }
-
-
- protected void visitChildNodes(Node node)
- {
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling())
- {
- visitNode(child);
- }
- }
-
-
- protected class CMDocumentLoadingNamespaceTable extends NamespaceTable
- {
- protected List newNamespaceList;
-
- public CMDocumentLoadingNamespaceTable(Document document)
- {
- super(document);
- }
-
-
- public void addElement(Element element)
- {
- newNamespaceList = null;
- super.addElement(element);
- if (newNamespaceList != null)
- {
- for (Iterator i = newNamespaceList.iterator(); i.hasNext(); )
- {
- NamespaceInfo info = (NamespaceInfo)i.next();
- handleGrammar(info.uri, info.locationHint, "XSD"); //$NON-NLS-1$
- }
- }
- }
-
-
- protected void internalAddNamespaceInfo(String key, NamespaceInfo info)
- {
- super.internalAddNamespaceInfo(key, info);
- if (newNamespaceList == null)
- {
- newNamespaceList = new ArrayList();
- }
- newNamespaceList.add(info);
- }
- }
-
-
- protected Element getRootElement(Document document)
- {
- Element result = null;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0 ; i < nodeListLength; i++)
- {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- result = (Element)node;
- break;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
deleted file mode 100644
index 3e4af8cf2b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationUtility;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReferenceProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.GlobalCMDocumentCache.GlobalCacheQueryResponse;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- *
- */
-public class CMDocumentManagerImpl implements CMDocumentManager
-{
- protected CMDocumentCache cmDocumentCache;
- protected CMDocumentReferenceProvider cmDocumentReferenceProvider;
- protected List listenerList = new Vector();
- protected Hashtable propertyTable = new Hashtable();
- protected Hashtable publicIdTable = new Hashtable();
- private boolean globalCMDocumentCacheEnabled ;
-
-
- public CMDocumentManagerImpl(CMDocumentCache cmDocumentCache, CMDocumentReferenceProvider cmDocumentReferenceProvider)
- {
- this.cmDocumentCache = cmDocumentCache;
- this.cmDocumentReferenceProvider = cmDocumentReferenceProvider;
- setPropertyEnabled(PROPERTY_AUTO_LOAD, true);
- setPropertyEnabled(PROPERTY_USE_CACHED_RESOLVED_URI, false);
- setPropertyEnabled(PROPERTY_PERFORM_URI_RESOLUTION, true);
- initializeGlobalCMDocumentCacheSettings();
- }
-
-
- public CMDocumentCache getCMDocumentCache()
- {
- return cmDocumentCache;
- }
-
-
- public void setPropertyEnabled(String propertyName, boolean value)
- {
- propertyTable.put(propertyName, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- for (Iterator i = listenerList.iterator(); i.hasNext(); )
- {
- CMDocumentManagerListener listener = (CMDocumentManagerListener)i.next();
- listener.propertyChanged(this, propertyName);
- }
- }
-
-
- public boolean getPropertyEnabled(String propertyName)
- {
- Object object = propertyTable.get(propertyName);
- return object != null && object.equals("true"); //$NON-NLS-1$
- }
-
-
- public void addListener(CMDocumentManagerListener listener)
- {
- listenerList.add(listener);
- cmDocumentCache.addListener(listener);
- }
-
-
- public void removeListener(CMDocumentManagerListener listener)
- {
- listenerList.remove(listener);
- cmDocumentCache.removeListener(listener);
- }
-
-
- protected String lookupResolvedURI(String publicId)
- {
- String key = publicId != null ? publicId : ""; //$NON-NLS-1$
- return (String)publicIdTable.get(key);
- }
-
-
- protected String lookupOrCreateResolvedURI(String publicId, String systemId)
- {
- String resolvedURI = null;
-
- String key = publicId != null ? publicId : ""; //$NON-NLS-1$
-
- if (getPropertyEnabled(PROPERTY_USE_CACHED_RESOLVED_URI))
- {
- resolvedURI = (String)publicIdTable.get(key);
- }
-
- if (resolvedURI == null)
- {
- resolvedURI = cmDocumentReferenceProvider.resolveGrammarURI(publicId, systemId);
- if (resolvedURI == null)
- {
- resolvedURI = ""; //$NON-NLS-1$
- }
- publicIdTable.put(key, resolvedURI);
- }
-
- return resolvedURI;
- }
-
-
- public int getCMDocumentStatus(String publicId)
- {
- int status = CMDocumentCache.STATUS_NOT_LOADED;
- String resolvedURI = lookupResolvedURI(publicId);
- if (resolvedURI != null)
- {
- status = cmDocumentCache.getStatus(resolvedURI);
- }
- return status;
- }
-
-
- public CMDocument getCMDocument(String publicId)
- {
- CMDocument result = null;
- String resolvedURI = lookupResolvedURI(publicId);
- if (resolvedURI != null)
- {
- result = cmDocumentCache.getCMDocument(resolvedURI);
- }
- return result;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager#getCMDocument(java.lang.String, java.lang.String, java.lang.String)
- */
-public CMDocument getCMDocument(String publicId, String systemId, String type)
- {
- CMDocument cmDocument = null;
- String resolvedURI = null;
-
- if (getPropertyEnabled(PROPERTY_AUTO_LOAD))
- {
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=136399
-
- if (getPropertyEnabled(PROPERTY_PERFORM_URI_RESOLUTION))
- {
- resolvedURI = lookupOrCreateResolvedURI(publicId, systemId);
- }
- else
- {
- resolvedURI = systemId;
- }
- }
- else
- {
- resolvedURI = lookupResolvedURI(publicId);
- }
-
- if (resolvedURI != null)
- {
- int status = cmDocumentCache.getStatus(resolvedURI);
- if (status == CMDocumentCache.STATUS_LOADED)
- {
- cmDocument = cmDocumentCache.getCMDocument(resolvedURI);
- }
- else if (status == CMDocumentCache.STATUS_NOT_LOADED)
- {
- if (getPropertyEnabled(PROPERTY_AUTO_LOAD))
- {
- cmDocument = loadCMDocument(publicId, resolvedURI, type, getPropertyEnabled(PROPERTY_ASYNC_LOAD));
- }
- }
- }
- return cmDocument;
- }
-
- public void addCMDocumentReference(String publicId, String systemId, String type)
- {
- String resolvedURI = lookupOrCreateResolvedURI(publicId, systemId);
- if (resolvedURI != null && resolvedURI.length() > 0)
- {
- int status = cmDocumentCache.getStatus(resolvedURI);
- if (status == CMDocumentCache.STATUS_NOT_LOADED)
- {
- loadCMDocument(publicId, resolvedURI, type, getPropertyEnabled(PROPERTY_ASYNC_LOAD));
- }
- }
- }
-
-
- public void addCMDocument(String publicId, String systemId, String resolvedURI, String type, CMDocument cmDocument)
- {
- String key = publicId != null ? publicId : ""; //$NON-NLS-1$
- publicIdTable.put(key, resolvedURI);
- cmDocumentCache.putCMDocument(resolvedURI, cmDocument);
- }
-
-
- protected CMDocument loadCMDocument(final String publicId, final String resolvedURI, final String type, boolean async)
- {
- CMDocument result = null;
-
- //System.out.println("about to build CMDocument(" + publicId + ", " + unresolvedURI + " = " + resolvedURI + ")");
- if (async)
- {
- cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_LOADING);
- //Thread thread = new Thread(new AsyncBuildOperation(publicId, resolvedURI, type));
- //thread.start();
- Job job = new Job(XMLCoreMessages.loading + resolvedURI)
- {
- public boolean belongsTo(Object family)
- {
- boolean result = (family == CMDocumentManager.class);
- return result;
- }
-
- protected IStatus run(IProgressMonitor monitor)
- {
- try
- {
- buildCMDocument(publicId, resolvedURI, type);
- }
- catch (Exception e)
- {
- Logger.logException(MessageFormat.format(XMLCoreMessages.CMDocument_load_exception, new Object[]{resolvedURI, publicId}), e);
- }
- return Status.OK_STATUS;
- }
- };
- job.schedule();
- }
- else
- {
- result = buildCMDocument(publicId, resolvedURI, type);
- }
- return result;
- }
-
-
-
- public synchronized CMDocument buildCMDocument(String publicId, String resolvedURI, String type)
- {
- cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_LOADING);
- boolean documentCacheable = false;
- if(globalCMDocumentCacheEnabled) {
- GlobalCacheQueryResponse response = GlobalCMDocumentCache.getInstance().getCMDocument(resolvedURI);
- CMDocument cachedCMDocument = response.getCachedCMDocument();
- documentCacheable = response.isDocumentCacheable();
- if(cachedCMDocument != null) {
- cmDocumentCache.putCMDocument(resolvedURI, cachedCMDocument);
- return cachedCMDocument;
- }
- }
-
- CMDocument result = null;
- if (resolvedURI != null && resolvedURI.length() > 0)
- {
- // TODO... pass the TYPE thru to the CMDocumentBuilder
- result = ContentModelManager.getInstance().createCMDocument(resolvedURI, type);
- }
- if (result != null)
- {
- // load the annotation files for the document
- if (publicId != null)
- {
- AnnotationUtility.loadAnnotationsForGrammar(publicId, result);
- }
- if(globalCMDocumentCacheEnabled && documentCacheable) {
- GlobalCMDocumentCache.getInstance().putCMDocument(resolvedURI, result);
- }
- cmDocumentCache.putCMDocument(resolvedURI, result);
- }
- else
- {
- cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_ERROR);
- }
- return result;
- }
-
- public void removeAllReferences()
- {
- // TODO... initiate a timed release of the entries in the CMDocumentCache
- publicIdTable = new Hashtable();
- }
-
- private void initializeGlobalCMDocumentCacheSettings() {
- Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
- if(preferences != null) {
- globalCMDocumentCacheEnabled = preferences.getBoolean(XMLCorePreferenceNames.CMDOCUMENT_GLOBAL_CACHE_ENABLED);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java
deleted file mode 100644
index f4edabdb32..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReference;
-
-public class CMDocumentReferenceImpl implements CMDocumentReference
-{
- protected String systemId;
- protected String publicId;
-
- public CMDocumentReferenceImpl(String publicId, String systemId)
- {
- this.publicId = publicId;
- this.systemId = systemId;
- }
-
- public String getPublicId()
- {
- return publicId;
- }
-
- public String getSystemId()
- {
- return systemId;
- }
-
- public String toString()
- {
- return "[" + publicId + ", " + systemId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ExternalSchemaLocationProviderRegistry.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ExternalSchemaLocationProviderRegistry.java
deleted file mode 100644
index 594c5d826e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ExternalSchemaLocationProviderRegistry.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider;
-
-/**
- * A registry for all external schema location providers.
- *
- */
-public class ExternalSchemaLocationProviderRegistry {
-
- private static ExternalSchemaLocationProviderRegistry fRegistry;
- private IExternalSchemaLocationProvider[] fProviders;
-
- private ExternalSchemaLocationProviderRegistry() {
- fProviders = new IExternalSchemaLocationProvider[0];
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.wst.xml.core", "externalSchemaLocations"); //$NON-NLS-1$ //$NON-NLS-2$
- List providers = new ArrayList(elements.length);
- try {
- for (int i = 0; i < elements.length; i++) {
- providers.add(elements[i].createExecutableExtension("class"));
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- fProviders = new IExternalSchemaLocationProvider[elements.length];
- providers.toArray(fProviders);
- }
-
- public IExternalSchemaLocationProvider[] getProviders() {
- return fProviders;
- }
-
- public static synchronized ExternalSchemaLocationProviderRegistry getInstance() {
- if (fRegistry == null)
- fRegistry = new ExternalSchemaLocationProviderRegistry();
- return fRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java
deleted file mode 100644
index ca981f15dd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java
+++ /dev/null
@@ -1,121 +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.wst.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.lang.ref.SoftReference;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.sse.core.internal.util.AbstractMemoryListener;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventConstants;
-
-public class GlobalCMDocumentCache {
-
- private static GlobalCMDocumentCache globalDocumentCache = new GlobalCMDocumentCache();
- private Map systemCatalogEntries = getSystemCatalogEntries();
- private MemoryListener memoryListener;
- private final static String CATEGORY = "CMDocumentGlobalCache"; //$NON-NLS-1$
-
- protected GlobalCMDocumentCache() {
- Logger.trace(CATEGORY, "Cache initialized"); //$NON-NLS-1$
- memoryListener = new MemoryListener();
- memoryListener.connect();
- }
-
- public static GlobalCMDocumentCache getInstance() {
- return globalDocumentCache;
- }
-
- public synchronized GlobalCacheQueryResponse getCMDocument(String grammarURI) {
- //Logger.trace(CATEGORY, "Query for: " + grammarURI); //$NON-NLS-1$
- Object systemCatalogEntry = systemCatalogEntries.get(grammarURI);
- if(systemCatalogEntry != null) {
- //Logger.trace(CATEGORY, "Document " + grammarURI + " is in system catalog"); //$NON-NLS-1$ //$NON-NLS-2$
- Object object = ((SoftReference)systemCatalogEntry).get();
- if(object != null) {
- //Logger.trace(CATEGORY, "Document " + grammarURI + "is in cache, returning cached version"); //$NON-NLS-1$ //$NON-NLS-2$
- return new GlobalCacheQueryResponse((CMDocument)object, true);
- } else {
- //Logger.trace(CATEGORY, "Document " + grammarURI + " is not in cache"); //$NON-NLS-1$ //$NON-NLS-2$
- return new GlobalCacheQueryResponse(null, true);
- }
- }
- //Logger.trace(CATEGORY, "Document " + grammarURI + " is not in system catalog, not cached"); //$NON-NLS-1$ //$NON-NLS-2$
- return new GlobalCacheQueryResponse(null, false);
- }
-
- public synchronized void putCMDocument(String grammarURI, CMDocument cmDocument) {
- //Logger.trace(CATEGORY, "Document: " + grammarURI + " added to global cache"); //$NON-NLS-1$ //$NON-NLS-2$
- systemCatalogEntries.put(grammarURI, new SoftReference(cmDocument));
- }
-
- private synchronized static HashMap getSystemCatalogEntries(){
- HashMap systemCatalogURIs = new HashMap();
- ICatalog systemCatalog = null;
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- systemCatalog = referencedCatalog;
- }
- }
- }
- if(systemCatalog != null) {
- ICatalogEntry[] catalogEntries = systemCatalog.getCatalogEntries();
- for (int i = 0; i < catalogEntries.length; i++) {
- systemCatalogURIs.put(catalogEntries[i].getURI(), new SoftReference(null));
- }
- }
- return systemCatalogURIs;
- }
-
- public class GlobalCacheQueryResponse {
-
- private CMDocument cachedDocument;
- private boolean documentCacheable;
-
- public GlobalCacheQueryResponse(CMDocument cachedCMDocument, boolean documentCacheable) {
- this.cachedDocument = cachedCMDocument;
- this.documentCacheable = documentCacheable;
- }
-
- public CMDocument getCachedCMDocument() {
- return cachedDocument;
- }
-
- public boolean isDocumentCacheable() {
- return documentCacheable;
- }
-
- }
-
- private class MemoryListener extends AbstractMemoryListener {
- protected void handleMemoryEvent(Event event) {
- Object topic = event.getProperty(EventConstants.EVENT_TOPIC);
- if(SEV_SERIOUS.equals(topic) || SEV_CRITICAL.equals(topic)) {
- Logger.trace(CATEGORY, "Serious severity low memory event received, flushing global CMDocument cache."); //$NON-NLS-1$
- systemCatalogEntries = getSystemCatalogEntries();
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java
deleted file mode 100644
index c91e72cf45..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.Hashtable;
-
-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.internal.modelqueryimpl.InferredGrammarFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public class InferredGrammarBuildingCMDocumentLoader extends CMDocumentLoader
-{
- protected CMElementDeclaration inferredCMElementDeclaration;
- protected CMDocument inferredCMDocument;
- protected InferredGrammarFactory inferredGrammarFactory;
- protected Hashtable createdCMDocumentTable;
-
- public InferredGrammarBuildingCMDocumentLoader(Document document, ModelQuery modelQuery)
- {
- this(document, modelQuery.getCMDocumentManager());
- }
-
- public InferredGrammarBuildingCMDocumentLoader(Document document, CMDocumentManager cmDocumentManager)
- {
- super(document, cmDocumentManager);
- createdCMDocumentTable = new Hashtable();
- inferredGrammarFactory = new InferredGrammarFactory();
- }
-
-
- public void loadCMDocuments()
- {
- //System.out.println("----------loadCMDocuments ------------");
- if (inferredGrammarFactory != null)
- {
- //long time = System.currentTimeMillis();
- super.loadCMDocuments();
- //System.out.println("--- elapsed time (" + count + ") = " + (System.currentTimeMillis() - time));
- //inferredGrammarFactory.debugPrint(createdCMDocumentTable.values());
- }
-
- }
-
- public void handleElement(Element element)
- {
- CMElementDeclaration parentInferredCMElementDeclaration = inferredCMElementDeclaration;
-
- if (inferredCMDocument == null)
- {
- String cacheKey = "inferred-document"; //$NON-NLS-1$
- inferredCMDocument = inferredGrammarFactory.createCMDocument(""); //$NON-NLS-1$
- cmDocumentManager.addCMDocument("", "", cacheKey, "DTD", inferredCMDocument); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- createdCMDocumentTable.put(cacheKey, inferredCMDocument);
- }
-
- inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, false);
-
- if (parentInferredCMElementDeclaration != null)
- {
- inferredGrammarFactory.createCMContent(inferredCMDocument, parentInferredCMElementDeclaration, inferredCMDocument, inferredCMElementDeclaration, false, null);
- }
-
-
- visitChildNodes(element);
-
- // reset the 'current' state to inital values
- inferredCMElementDeclaration = parentInferredCMElementDeclaration;
- }
-
-
- public void handleElementNS(Element element)
- {
- CMDocument parentInferredCMDocument = inferredCMDocument;
- CMElementDeclaration parentInferredCMElementDeclaration = inferredCMElementDeclaration;
-
- inferredCMDocument = null;
- inferredCMElementDeclaration = null;
-
- // by adding the element to the namespaceTable, handleGrammar() will get called for any schema references
- if (element.getParentNode() != document)
- {
- namespaceTable.addElement(element);
- }
-
- String prefix = element.getPrefix();
- String uri = namespaceTable.getURIForPrefix(prefix);
-
- if (uri == null && element.getParentNode() == document)
- {
- // when this is the root element
- // we need to add an implied "no namespace schema location"
- uri = "ommitted-namespace"; //$NON-NLS-1$
- namespaceTable.addNamespaceInfo(prefix, uri, ""); //$NON-NLS-1$
- }
-
- // here's where we update the inferred grammar if required
- //
- boolean createCMElementDeclaration = true;
-
- boolean isLocal = (uri == null && prefix == null);
- if (isLocal)
- {
- if (parentInferredCMDocument == null)
- {
- // this is a local element... and the parent is not inferred (e.g) it has a known grammar
- // so we don't need to create an element declaration for this element
- createCMElementDeclaration = false;
- }
- else
- {
- if (uri == null)
- {
- uri = "ommitted-namespace"; //$NON-NLS-1$
- }
- }
- }
-
- if (createCMElementDeclaration)
- {
- if (isLocal)
- {
- inferredCMDocument = parentInferredCMDocument;
- inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, true);
- }
- else
- {
- boolean createCMDocument = false;
-
- String cacheKey = "inferred-document" + uri; //$NON-NLS-1$
- inferredCMDocument = (CMDocument)createdCMDocumentTable.get(cacheKey);
-
- if (inferredCMDocument == null)
- {
- // we don't have an inferred document for this uri yet... let's see of we need one
- int status = cmDocumentManager.getCMDocumentStatus(uri);
- if (status == CMDocumentCache.STATUS_NOT_LOADED || status == CMDocumentCache.STATUS_ERROR)
- {
- // the cache does not contain a 'proper' CMDocument for this uri
- // so we need to create an inferred one
- createCMDocument = true;
- }
- }
-
- if (createCMDocument)
- {
- //System.out.println("encountered element {" + element.getNodeName() + "} ... creating inferred CMDocument for " + uri);
- inferredCMDocument = inferredGrammarFactory.createCMDocument(uri);
- cmDocumentManager.addCMDocument(uri, "", cacheKey, "XSD", inferredCMDocument); //$NON-NLS-1$ //$NON-NLS-2$
- createdCMDocumentTable.put(cacheKey, inferredCMDocument);
- }
-
- if (inferredCMDocument != null)
- {
- inferredCMElementDeclaration = inferredGrammarFactory.createCMElementDeclaration(inferredCMDocument, element, false);
- }
- }
-
- if (parentInferredCMElementDeclaration != null)
- {
- inferredGrammarFactory.createCMContent(parentInferredCMDocument, parentInferredCMElementDeclaration, inferredCMDocument, inferredCMElementDeclaration, isLocal, uri);
- }
- }
-
- visitChildNodes(element);
-
- // reset the 'current' state to inital values
- inferredCMElementDeclaration = parentInferredCMElementDeclaration;
- inferredCMDocument = parentInferredCMDocument;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java
deleted file mode 100644
index b66a0d6ce9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMValidator;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- *
- */
-public class ModelQueryActionHelper
-{
- protected ModelQueryImpl modelQuery;
-
- protected static class Action implements ModelQueryAction
- {
- public int kind;
- public int startIndex;
- public int endIndex;
- public Node parent;
- public CMNode cmNode;
- public Object userData;
-
- public Action(int kind, Node parent, CMNode cmNode)
- {
- this.kind = kind;
- this.parent = parent;
- this.cmNode = cmNode;
- }
-
- public Action(int kind, Node parent, CMNode cmNode, int startIndex, int endIndex)
- {
- this.kind = kind;
- this.parent = parent;
- this.cmNode = cmNode;
- this.startIndex = startIndex;
- this.endIndex = endIndex;
- }
-
- public int getKind()
- {
- return kind;
- }
-
- public int getStartIndex()
- {
- return startIndex;
- }
-
- public int getEndIndex()
- {
- return endIndex;
- }
-
- public Node getParent()
- {
- return parent;
- }
-
- public CMNode getCMNode()
- {
- return cmNode;
- }
-
- public Object getUserData()
- {
- return userData;
- }
-
- public void setUserData(Object object)
- {
- userData = object;
- }
-
- public void performAction()
- {
- }
- }
-
-
- public ModelQueryActionHelper(ModelQueryImpl modelQuery)
- {
- this.modelQuery = modelQuery;
- }
-
-
- public void getAllActions(Element parent, CMElementDeclaration ed, int validityChecking, List actionList)
- {
- }
-
-
- // insert actions
- //
- public void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
- {
- if ((includeOptions & ModelQuery.INCLUDE_ATTRIBUTES) != 0)
- {
- getInsertAttributeActions(parent, ed, validityChecking, actionList);
- }
- includeOptions &= ~ModelQuery.INCLUDE_ATTRIBUTES;
- if ((includeOptions & ModelQuery.INCLUDE_CHILD_NODES) != 0)
- {
- if (index != -1)
- {
- getInsertChildNodeActionsAtIndex(parent, ed, index, includeOptions, validityChecking, actionList);
- }
- else
- {
- getInsertChildNodeActions(parent, ed, includeOptions, validityChecking, actionList);
- }
- }
- }
-
-
-
- protected void getInsertAttributeActions(Element parent, CMElementDeclaration ed, int validityChecking, List actionList)
- {
- // get actions for each insertable attribute
- //
- List availableAttributeList = modelQuery.getAvailableContent(parent, ed, ModelQuery.INCLUDE_ATTRIBUTES);
-
- for (Iterator i = availableAttributeList.iterator(); i.hasNext(); )
- {
- CMAttributeDeclaration ad = (CMAttributeDeclaration)i.next();
- if (modelQuery.canInsert(parent, ed, ad, 0, validityChecking))
- {
- Action action = new Action(ModelQueryAction.INSERT, parent, ad);
- actionList.add(action);
- }
- }
- }
-
-
- protected void getInsertChildNodeActionsAtIndex(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
- {
- // get actions for each insertable attribute
- //
- int size = parent.getChildNodes().getLength();
- if (index <= size)
- {
- List contentSpecificationList = modelQuery.getValidator().createContentSpecificationList(parent, ed);
- List availableChildNodeList = modelQuery.getAvailableContent(parent, ed, includeOptions);
-
- boolean isSimpleChoice = isSimpleChoiceGroupContentModel(ed);
-
- for (Iterator i = availableChildNodeList.iterator(); i.hasNext(); )
- {
- CMNode cmNode = (CMNode)i.next();
- if (isSimpleChoice || modelQuery.canInsert(parent, ed, cmNode, index, validityChecking, contentSpecificationList))
- {
- Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, index, index);
- actionList.add(action);
- }
- }
- }
- }
-
-
- protected boolean isSimpleChoiceGroupContentModel(CMElementDeclaration ed)
- {
- boolean result = false;
- CMNode cmNode = ed.getContent();
- if (cmNode != null && cmNode.getNodeType() == CMNode.GROUP)
- {
- CMGroup cmGroup = (CMGroup)cmNode;
- if (cmGroup.getOperator() == CMGroup.CHOICE && cmGroup.getMaxOccur() == -1)
- {
- result = true;
- CMNodeList list = cmGroup.getChildNodes();
- for (int i = list.getLength() - 1; i >= 0; i--)
- {
- if (list.item(i).getNodeType() != CMNode.ELEMENT_DECLARATION)
- {
- result = false;
- break;
- }
- }
- }
- }
- return result;
- }
-
-
- protected void getInsertChildNodeActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
- {
- int size = parent.getChildNodes().getLength();
- List contentSpecificationList = modelQuery.getValidator().createContentSpecificationList(parent, ed);
- List availableChildNodeList = modelQuery.getAvailableContent(parent, ed, includeOptions);
-
- boolean isSimpleChoice = isSimpleChoiceGroupContentModel(ed);
-
- for (Iterator iterator = availableChildNodeList.iterator(); iterator.hasNext(); )
- {
- CMNode cmNode = (CMNode)iterator.next();
- for (int i = size; i >= 0; i--)
- {
- if (isSimpleChoice || modelQuery.canInsert(parent, ed, cmNode, i, validityChecking, contentSpecificationList))
- {
- Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, i, i);
- actionList.add(action);
- break;
- }
- }
- }
- }
-
- public void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList)
- {
- // get the root element and doctype index (if any)
- //
- int doctypeIndex = -1;
- DocumentType doctype = null;
- Element rootElement = null;
- NodeList nodeList = parent.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++)
- {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE)
- {
- rootElement = (Element)childNode;
- break;
- }
- else if (childNode.getNodeType() == Node.DOCUMENT_TYPE_NODE)
- {
- doctype = (DocumentType)childNode;
- doctypeIndex = i;
- }
- }
-
- // make sure that root elements are only added after the doctype (if any)
- if (rootElement == null && index > doctypeIndex)
- {
- CMNamedNodeMap map = cmDocument.getElements();
- int mapLength = map.getLength();
- for (int i = 0; i < mapLength; i++)
- {
- CMNode cmNode = map.item(i);
-
- boolean canAdd = true;
- if (validityChecking == ModelQuery.VALIDITY_STRICT)
- {
- canAdd = doctype == null || doctype.getName().equals(cmNode.getNodeName());
- }
-
- if (canAdd)
- {
- Action action = new Action(ModelQueryAction.INSERT, parent, cmNode, index, index);
- actionList.add(action);
- }
- }
- }
- }
-
-
-
- public void getInsertChildNodeActionTable(Element parent, CMElementDeclaration ed, int validityChecking, Hashtable actionTable)
- {
- }
-
-
- public void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
- {
- CMValidator.MatchModelNode matchModelNode = modelQuery.getValidator().getMatchModel(ed, parent);
- if (matchModelNode != null)
- {
- MatchModelVisitor visitor = new MatchModelVisitor(parent, actionList);
- visitor.visitMatchModelNode(matchModelNode);
- }
- }
-
- public void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList)
- {
- int[] range = getRange(parent, selectedChildren);
- if (range != null)
- {
- if (isContiguous(parent, range, selectedChildren))
- {
- List tempList = new Vector();
- getReplaceActions(parent, ed, includeOptions, validityChecking, tempList);
- if ((includeOptions & ModelQuery.INCLUDE_ENCLOSING_REPLACE_ACTIONS) != 0)
- {
- removeActionsNotContainingRange(tempList, range[0], range[1]);
- }
- else
- {
- removeActionsNotMatchingRange(tempList, range[0], range[1]);
- }
- actionList.addAll(tempList);
- }
- }
-
- if (selectedChildren.size() == 1)
- {
- Node node = (Node)selectedChildren.get(0);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element childElement = (Element)node;
- CMNode childEd = modelQuery.getCMElementDeclaration(childElement);
- if (childEd != null)
- {
-
- CMNode childOrigin= modelQuery.getOrigin(childElement);
-
- CMNodeList cmNodeList = childOrigin != null ?
- (CMNodeList)childOrigin.getProperty("SubstitutionGroup") : //$NON-NLS-1$
- (CMNodeList)childEd.getProperty("SubstitutionGroup"); //$NON-NLS-1$
-
- if (cmNodeList != null && cmNodeList.getLength() > 1)
- {
- int replaceIndex = getIndex(parent, childElement);
- String childEdName = childEd.getNodeName();
- for (int i = 0; i < cmNodeList.getLength(); i++)
- {
- CMNode substitution = cmNodeList.item(i);
- if (!substitution.getNodeName().equals(childEdName) && !Boolean.TRUE.equals(substitution.getProperty("Abstract"))) //$NON-NLS-1$
- {
- Action action = new Action(ModelQueryAction.REPLACE, parent, cmNodeList.item(i), replaceIndex, replaceIndex);
- actionList.add(action);
- }
- }
- }
- }
- }
- }
- }
-
-
- // returns true if the selected nodes are contiguous
- //
- protected boolean isContiguous(Element parent, int[] range, List selectedNodeList)
- {
- boolean result = true;
- NodeList nodeList = parent.getChildNodes();
- // issue: nodeListLength was never read, but in theory,
- // nodelList.getLength() might cause some clearing of cached
- // data, or something, so leaving in a potential meaningless call, for now.
- //int nodeListLength = nodeList.getLength();
- nodeList.getLength();
- for (int i = range[0]; i < range[1]; i++)
- {
- Node node = nodeList.item(i);
- if (!isWhitespaceNode(node) && !selectedNodeList.contains(node))
- {
- result = false;
- break;
- }
- }
- return result;
- }
-
-
- protected int[] getRange(Element parent, List list)
- {
- int[] result = null;
- int first = -1;
- int last = -1;
-
- NodeList nodeList = parent.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++)
- {
- Node node = nodeList.item(i);
- if (list.contains(node))
- {
- first = (first == -1) ? i : Math.min(first, i);
- last = Math.max(last, i);
- }
- }
-
- if (first != -1 && last!= -1)
- {
- result = new int[2];
- result[0] = first;
- result[1] = last;
- }
- return result;
- }
-
-
- protected boolean isWhitespaceNode(Node node)
- {
- return node.getNodeType() == Node.TEXT_NODE &&
- node.getNodeValue().trim().length() == 0;
- }
-
-
- protected int getIndex(Node parentNode, Node child)
- {
- NodeList nodeList = parentNode.getChildNodes();
- int index = -1;
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++)
- {
- if (nodeList.item(i) == child)
- {
- index = i;
- break;
- }
- }
- return index;
- }
-
-
- protected boolean isActionContainingRange(ModelQueryAction action, int startIndex, int endIndex)
- {
- int actionStartIndex = action.getStartIndex();
- int actionEndIndex = action.getEndIndex();
-
- return (actionStartIndex <= startIndex &&
- actionEndIndex >= endIndex);
- }
-
-
- protected boolean isActionMatchingRange(ModelQueryAction action, int startIndex, int endIndex)
- {
- int actionStartIndex = action.getStartIndex();
- int actionEndIndex = action.getEndIndex();
- return (actionStartIndex == startIndex &&
- actionEndIndex == endIndex);
- }
-
-
- protected void removeActionsNotContainingRange(List actionList, int startIndex, int endIndex)
- {
- for (int i = actionList.size() - 1; i >= 0; i--)
- {
- ModelQueryAction action = (ModelQueryAction)actionList.get(i);
- if (!isActionContainingRange(action, startIndex, endIndex))
- {
- actionList.remove(i);
- }
- }
- }
-
-
- protected void removeActionsNotMatchingRange(List actionList, int startIndex, int endIndex)
- {
- for (int i = actionList.size() - 1; i >= 0; i--)
- {
- ModelQueryAction action = (ModelQueryAction)actionList.get(i);
- if (!isActionMatchingRange(action, startIndex, endIndex))
- {
- actionList.remove(i);
- }
- }
- }
-
-
- public static class MatchModelVisitor
- {
- int indent;
- int elementIndex;
- Node parent;
- List actionList;
-
- public MatchModelVisitor(Node parent, List actionList)
- {
- this.parent = parent;
- this.actionList = actionList;
- }
-
- public int indexOfNextElement(int start)
- {
- NodeList nodeList = parent.getChildNodes();
- int length = nodeList.getLength();
- int result = length;
- for (int i = start; i < length; i++)
- {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- result = i;
- break;
- }
- }
- return result;
- }
-
- public void visitMatchModelNode(CMValidator.MatchModelNode matchModelNode)
- {
- int startIndex = indexOfNextElement(elementIndex);
-
- //String cmNodeName = matchModelNode.cmNode != null ? matchModelNode.cmNode.getNodeName() : "null";
- //printIndented(indent, "+MatchModelNode : " + cmNodeName + " " + startIndex);
-
- indent += 2;
- for (Iterator iterator = matchModelNode.children.iterator(); iterator.hasNext(); )
- {
- CMValidator.MatchModelNode child = (CMValidator.MatchModelNode)iterator.next();
- visitMatchModelNode(child);
- }
- indent -= 2;
-
- if (matchModelNode.cmNode != null)
- {
- int nodeType = matchModelNode.cmNode.getNodeType();
- if (nodeType == CMNode.GROUP)
- {
- CMGroup group = (CMGroup)matchModelNode.cmNode;
- if (group.getOperator() == CMGroup.CHOICE)
- {
- addReplaceActions(matchModelNode, group, startIndex, elementIndex - 1);
- }
- }
- else if (nodeType == CMNode.ELEMENT_DECLARATION)
- {
- elementIndex = startIndex + 1;
- }
- //printIndented(indent, "-MatchModelNode : " + cmNodeName + " " + (elementIndex - 1));
- }
- }
-
- public void addReplaceActions(CMValidator.MatchModelNode matchModelNode, CMGroup group, int startIndex, int endIndex)
- {
- CMNode excludeCMNode = null;
- if (matchModelNode.children.size() > 0)
- {
- CMValidator.MatchModelNode child = (CMValidator.MatchModelNode)matchModelNode.children.get(0);
- excludeCMNode = child.cmNode;
- }
-
- CMNodeList nodeList = group.getChildNodes();
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++)
- {
- CMNode alternative = nodeList.item(i);
- if (alternative != excludeCMNode)
- {
- Action action = new Action(ModelQueryAction.REPLACE, parent, alternative, startIndex, endIndex);
- actionList.add(action);
- }
- }
- }
- }
-
- //public static void printIndented(int indent, String string)
- //{
- // for (int i = 0; i < indent; i++)
- // {
- // System.out.print(" ");
- // }
- // System.out.println(string);
- //}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
deleted file mode 100644
index e426ee2058..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
+++ /dev/null
@@ -1,846 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl.ModelQueryExtensionManagerImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMDataTypeValueHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.DOMValidator;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtensionManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-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;
-import org.w3c.dom.Text;
-
-
-/**
- * This class implements a large portion of the ModelQuery interfaces.
- * Some work is delegated to the DOMHelper, CMDocumentManager, and DOMValidator.
- */
-public class ModelQueryImpl implements ModelQuery
-{
- protected ModelQueryAssociationProvider modelQueryAssociationProvider;
- protected ModelQueryActionHelper modelQueryActionHelper;
- protected DOMValidator validator;
- protected ModelQueryExtensionManagerImpl extensionManager;
- protected CMDataTypeValueHelper valueHelper;
- protected int editMode = EDIT_MODE_CONSTRAINED_STRICT;
-
- public ModelQueryImpl(ModelQueryAssociationProvider modelQueryAssociationProvider)
- {
- this.modelQueryAssociationProvider = modelQueryAssociationProvider;
- modelQueryActionHelper = createModelQueryActionHelper();
- validator = new DOMValidator();
- extensionManager = new ModelQueryExtensionManagerImpl();
- valueHelper = new CMDataTypeValueHelper();
- }
-
- public int getEditMode()
- {
- return editMode;
- }
-
- public void setEditMode(int editMode)
- {
- this.editMode =editMode;
- }
-
-
- // factory methods
- public ModelQueryActionHelper createModelQueryActionHelper()
- {
- return new ModelQueryActionHelper(this);
- }
-
- public DOMValidator getValidator()
- {
- return validator;
- }
-
- public CMDocument getCorrespondingCMDocument(Node node)
- {
- return modelQueryAssociationProvider.getCorrespondingCMDocument(node);
- }
-
- public CMNode getCMNode(Node node)
- {
- return modelQueryAssociationProvider.getCMNode(node);
- }
-
- public CMDataType getCMDataType(Text text)
- {
- return modelQueryAssociationProvider.getCMDataType(text);
- }
-
- public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
- {
- return modelQueryAssociationProvider.getCMAttributeDeclaration(attr);
- }
-
- public CMElementDeclaration getCMElementDeclaration(Element element)
- {
- return modelQueryAssociationProvider.getCMElementDeclaration(element);
- }
-
- public CMDocumentManager getCMDocumentManager()
- {
- CMDocumentManager result = null;
- if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
- {
- XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
- result = xmlAssociationProvider.getCMDocumentManager();
- }
- return result;
- }
-
-
- /**
- * @deprected - use 3 arg version below
- */
- public List getCMDocumentList(Element element, String uri)
- {
- return Collections.EMPTY_LIST;
- }
-
- public List getCMDocumentList(Element element, CMElementDeclaration ed, String uri)
- {
- List result = new ArrayList();
- if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
- {
- XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
-
- // todo... revist... handle each ##thing explicitly
- //
- if (uri == null)
- {
- uri = "##any"; //$NON-NLS-1$
- }
-
- if (uri.equals("##targetNamespace")) //$NON-NLS-1$
- {
- CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- result.add(cmDocument);
- }
- }
- else if (uri.equals("##any") || uri.equals("##other")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- String excludedURI = null;
- if (uri.equals("##other")) //$NON-NLS-1$
- {
- CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- excludedURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- }
- }
-
- // in this case we should consider all of the schema related to this document
- //
- NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
- namespaceTable.addElementLineage(element);
- List list = namespaceTable.getNamespaceInfoList();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo)i.next();
- if (info.uri != null && !info.uri.equals(excludedURI))
- {
- CMDocument document = xmlAssociationProvider.getCMDocument(info.uri, info.locationHint, "XSD"); //$NON-NLS-1$
- if (document != null)
- {
- result.add(document);
- }
- }
- }
- }
- else
- {
- CMDocument document = xmlAssociationProvider.getCMDocument(element, uri);
- if (document != null)
- {
- result.add(document);
- }
- }
- }
- return result;
- }
-
-
- public CMDocument getCMDocument(Element element, String uri)
- {
-
- CMDocument result = null;
- if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
- {
- XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
- result = xmlAssociationProvider.getCMDocument(element, uri);
- }
- //ContentModelManager.println("ModelQueryImpl.getCMDocument(" + element.getNodeName() + ", " + uri + ") = " + result);
- return result;
- }
-
- public boolean isContentValid(Element element)
- {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- return isContentValid(ed, element);
- }
-
- public boolean isContentValid(CMElementDeclaration ed, Element element)
- {
- boolean result = true;
- if (ed != null)
- {
- // first check to see if all the required attributes are present
- //
- CMNamedNodeMap map = ed.getAttributes();
- int mapLength = map.getLength();
- for (int i = 0; i < mapLength; i++)
- {
- CMAttributeDeclaration ad = (CMAttributeDeclaration)map.item(i);
- String attributeName = DOMNamespaceHelper.computeName(ad, element, null);
- if (ad.getUsage() == CMAttributeDeclaration.REQUIRED)
- {
- Attr attr = element.getAttributeNode(attributeName);
- if (attr == null)
- {
- result = false;
- break;
- }
- }
- }
-
- // now check to see of the children validate properly
- //
- if (result)
- {
- CMNode[] originArray = getOriginArray(element);
- result = originArray != null && originArray.length == element.getChildNodes().getLength();
- }
- }
- return result;
- }
-
-
- public CMNode getOrigin(Node node)
- {
- CMNode result = null;
- // todo... make sure parent is right
- //
- Node parentNode = getParentOrOwnerNode(node);
- if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element parentElement = (Element)parentNode;
- CMNode[] array = getOriginArray(parentElement);
- if (array != null)
- {
- int index = getIndexOfNode(parentElement.getChildNodes(), node);
- if (index < array.length)
- {
- result = array[index];
- }
- }
- }
- return result;
- }
-
- public CMNode[] getOriginArray(Element element)
- {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- return (ed != null) ? getValidator().getOriginArray(ed, element) : null;
- }
-
- public int getIndexOfNode(NodeList nodeList, Node node)
- {
- int result = -1;
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++)
- {
- if (nodeList.item(i) == node)
- {
- result = i;
- break;
- }
- }
- return result;
- }
-
-
- /**
- * Returns a list of all CMNode 'meta data' that may be potentially added to the element.
- */
- public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions)
- {
- AvailableContentCMVisitor visitor = new AvailableContentCMVisitor(element, ed);
- List list = visitor.computeAvailableContent(includeOptions);
- if (extensionManager != null)
- {
- extensionManager.filterAvailableElementContent(list, element, ed, includeOptions);
- }
- return list;
- }
-
-
- public boolean canInsert(Element parent, CMNode cmNode, int index, int validityChecking)
- {
- boolean result = true;
- CMElementDeclaration ed = getCMElementDeclaration(parent);
- if (ed != null)
- {
- result = canInsert(parent, ed, cmNode, index, validityChecking);
- }
- return result;
- }
-
-
- public boolean canInsert(Element parent, CMElementDeclaration ed, CMNode cmNode, int index, int validityChecking)
- {
- return canInsert(parent, ed, cmNode, index, validityChecking, null);
- }
-
- protected boolean canInsert(Element parent, CMElementDeclaration ed, CMNode cmNode, int index, int validityChecking, Object reuseableData)
- {
- boolean result = true;
- switch (cmNode.getNodeType())
- {
- case CMNode.ATTRIBUTE_DECLARATION :
- {
- String attributeName = DOMNamespaceHelper.computeName(cmNode, parent, null);
- result = parent.getAttributeNode(attributeName) == null;
- break;
- }
- case CMNode.ELEMENT_DECLARATION :
- case CMNode.GROUP :
- {
- if (validityChecking == VALIDITY_STRICT)
- {
- // create list
- List contentSpecificationList = null;
- if (reuseableData != null)
- {
- contentSpecificationList = (List)reuseableData;
- }
- else
- {
- contentSpecificationList = getValidator().createContentSpecificationList(parent, ed);
- }
- result = getValidator().canInsert(ed, contentSpecificationList, index, cmNode);
- }
- break;
- }
- case CMNode.DATA_TYPE :
- {
- int contentType = ed.getContentType();
- result = (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.PCDATA ||
- contentType == CMElementDeclaration.ANY);
- break;
- }
- default :
- {
- result = false;
- break;
- }
- }
- return result;
- }
-
- public boolean canInsert(Element parent, List cmNodeList, int index, int validityChecking)
- {
- // todo
- return true;
- }
-
-
- public boolean canRemove(Node node, int validityChecking)
- {
- boolean result = true;
- if (validityChecking == VALIDITY_STRICT)
- {
- int nodeType = node.getNodeType();
- switch (nodeType)
- {
- case Node.ATTRIBUTE_NODE:
- {
- CMAttributeDeclaration ad = getCMAttributeDeclaration((Attr)node);
- if (ad != null)
- {
- result = (ad.getUsage() == CMAttributeDeclaration.OPTIONAL);
- }
- break;
- }
- case Node.ELEMENT_NODE:
- {
- Node parentNode = node.getParentNode();
- if (parentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element parentElement = (Element)parentNode;
- CMElementDeclaration ed = getCMElementDeclaration(parentElement);
- if (ed != null)
- {
- List contentSpecificationList = getValidator().createContentSpecificationList(parentElement, ed);
- int index = getIndexOfNode(parentElement.getChildNodes(), node);
- result = getValidator().canRemove(ed, contentSpecificationList, index);
- }
- }
- break;
- }
- }
- }
- return result;
- }
-
-
- public boolean canRemove(List nodeList, int validityChecking)
- {
- boolean result = true;
-
- if (validityChecking == VALIDITY_STRICT)
- {
- Element parentElement = null;
- List childList = null;
-
- for (Iterator i = nodeList.iterator(); i.hasNext(); )
- {
- Node node = (Node)i.next();
-
- if (parentElement == null)
- {
- parentElement = getParentOrOwnerElement(node);
- }
- else if (parentElement != getParentOrOwnerElement(node))
- {
- // make sure the parent are the same
- result = false;
- break;
- }
-
- if (parentElement == null)
- {
- result = true;
- break;
- }
-
- int nodeType = node.getNodeType();
- if (nodeType == Node.ATTRIBUTE_NODE)
- {
- if (!canRemove(node, validityChecking))
- {
- result = false;
- break;
- }
- }
- else
- {
- if (childList == null)
- {
- childList = nodeListToList(parentElement.getChildNodes());
- }
- childList.remove(node);
- }
- }
-
- if (result && childList != null)
- {
- CMElementDeclaration ed = getCMElementDeclaration(parentElement);
- if (ed != null)
- {
- List contentSpecificationList = getValidator().createContentSpecificationList(childList, ed);
- result = getValidator().isValid(ed, contentSpecificationList);
- }
- }
- }
-
- return result;
- }
-
- public boolean canReplace(Element parent, int startIndex, int endIndex, CMNode cmNode, int validityChecking)
- {
- return true;
- }
-
- public boolean canReplace(Element parent, int startIndex, int endIndex, List cmNodeList, int validityChecking)
- {
- return true;
- }
-
- /**
- * This method is experimental... use at your own risk
- */
- public boolean canWrap(Element childElement, CMElementDeclaration wrapElement, int validityChecking)
- {
- boolean result = true;
- Node parentNode = childElement.getParentNode();
- if (parentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element parentElement = (Element)parentNode;
- CMElementDeclaration parentEd = getCMElementDeclaration(parentElement);
- if (parentEd != null)
- {
- if (validityChecking == VALIDITY_STRICT)
- {
- int index = getIndexOfNode(parentElement.getChildNodes(), childElement);
-
- List contentSpecificationList = getValidator().createContentSpecificationList(parentElement, parentEd);
- List subList = contentSpecificationList.subList(index, index + 1);
- result = getValidator().canReplace(parentEd, contentSpecificationList, index, index, wrapElement);
- if (result)
- {
- result = getValidator().isValid(wrapElement, subList);
- }
- }
- }
- }
- else
- {
- result = false;
- }
- return result;
- }
-
- public void getInsertActions(Element parent, CMElementDeclaration ed, int index, int includeOptions, int validityChecking, List actionList)
- {
- modelQueryActionHelper.getInsertActions(parent, ed, index, includeOptions, validityChecking, actionList);
- }
-
- public void getInsertActions(Document parent, CMDocument cmDocument, int index, int includeOptions, int validityChecking, List actionList)
- {
- modelQueryActionHelper.getInsertActions(parent, cmDocument, index, includeOptions, validityChecking, actionList);
- }
-
- public void getReplaceActions(Element parent, CMElementDeclaration ed, int includeOptions, int validityChecking, List actionList)
- {
- modelQueryActionHelper.getReplaceActions(parent, ed, includeOptions, validityChecking, actionList);
- }
-
- public void getReplaceActions(Element parent, CMElementDeclaration ed, List selectedChildren, int includeOptions, int validityChecking, List actionList)
- {
- modelQueryActionHelper.getReplaceActions(parent, ed, selectedChildren, includeOptions, validityChecking, actionList);
- }
-
- public void getInsertChildNodeActionTable(Element parent, CMElementDeclaration ed, int validityChecking, Hashtable actionTable)
- {
- modelQueryActionHelper.getInsertChildNodeActionTable(parent, ed, validityChecking, actionTable);
- }
-
- public void getActionTable(Element parent, CMElementDeclaration ed, int index, int validityChecking, Hashtable actionTable)
- {
- //modelQueryActionHelper.getAllActions(parent, ed, validityChecking, actionList);
- }
-
-
- // some helper methods
- //
- protected Node getParentOrOwnerNode(Node node)
- {
- return (node.getNodeType() == Node.ATTRIBUTE_NODE) ?
- ((Attr)node).getOwnerElement() :
- node.getParentNode();
- }
-
- protected Element getParentOrOwnerElement(Node node)
- {
- Node parent = getParentOrOwnerNode(node);
- return (parent.getNodeType() == Node.ELEMENT_NODE) ? (Element)parent : null;
- }
-
-
- protected List nodeListToList(NodeList nodeList)
- {
- int size = nodeList.getLength();
- List v = new ArrayList(size);
- for (int i = 0; i < size; i++)
- {
- v.add(nodeList.item(i));
- }
- return v;
- }
-
- /**
- protected List getCMNodeList(NodeList nodeList)
- {
- int size = nodeList.getLength();
- Vector v = new Vector(size);
- for (int i = 0; i < size; i++)
- {
- v.add(getCMNode(nodeList.item(i));
- }
- return v;
- }
- */
-
- public class AvailableContentCMVisitor extends CMVisitor
- {
- public Hashtable childNodeTable = new Hashtable();
- public Hashtable attributeTable = new Hashtable();
- public Element rootElement;
- public CMElementDeclaration rootElementDeclaration;
- public boolean isRootVisited;
- protected boolean includeSequenceGroups;
-
- public AvailableContentCMVisitor(Element rootElement, CMElementDeclaration rootElementDeclaration)
- {
- this.rootElement = rootElement;
- this.rootElementDeclaration = rootElementDeclaration;
- }
-
- protected String getKey(CMNode cmNode)
- {
- String key = cmNode.getNodeName();
- CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- if (namespaceURI != null)
- {
- key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return key;
- }
-
- protected void addToTable(Hashtable table, CMNode cmNode)
- {
- String nodeName = cmNode.getNodeName();
- if (nodeName != null && nodeName.length() > 0)
- {
- table.put(getKey(cmNode), cmNode);
- }
- }
-
- public List computeAvailableContent(int includeOptions)
- {
- List v = new ArrayList();
-
- int contentType = rootElementDeclaration.getContentType();
- includeSequenceGroups = ((includeOptions & INCLUDE_SEQUENCE_GROUPS) != 0);
- visitCMNode(rootElementDeclaration);
-
- if ((includeOptions & INCLUDE_ATTRIBUTES) != 0)
- {
- v.addAll(attributeTable.values());
- CMAttributeDeclaration nillableAttribute = (CMAttributeDeclaration)rootElementDeclaration.getProperty("http://org.eclipse.wst/cm/properties/nillable"); //$NON-NLS-1$
- if (nillableAttribute != null)
- {
- v.add(nillableAttribute);
- }
- }
-
- if ((includeOptions & INCLUDE_CHILD_NODES) != 0)
- {
- if (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.ELEMENT)
- {
- v.addAll(childNodeTable.values());
- }
- else if (contentType == CMElementDeclaration.ANY)
- {
- CMDocument cmDocument = (CMDocument)rootElementDeclaration.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- CMNamedNodeMap elements = cmDocument.getElements();
- for (Iterator i = elements.iterator(); i.hasNext(); )
- {
- v.add(i.next());
- }
- }
- }
- }
- return v;
- }
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- String uri = anyElement.getNamespaceURI();
- List list = getCMDocumentList(rootElement, rootElementDeclaration, uri);
- for (Iterator iterator = list.iterator(); iterator.hasNext(); )
- {
- CMDocument cmdocument = (CMDocument)iterator.next();
- if (cmdocument != null)
- {
- CMNamedNodeMap map = cmdocument.getElements();
- int size = map.getLength();
- for (int i = 0; i < size; i++)
- {
- CMNode ed = map.item(i);
- addToTable(childNodeTable,ed);
- }
- }
- }
- }
-
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
- {
- super.visitCMAttributeDeclaration(ad);
- attributeTable.put(ad.getNodeName(), ad);
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- if (ed == rootElementDeclaration && !isRootVisited)
- {
- isRootVisited = true;
- super.visitCMElementDeclaration(ed);
- }
- else
- {
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) //$NON-NLS-1$
- {
- addToTable(childNodeTable,ed);
- }
-
- CMNodeList substitutionGroup = (CMNodeList)ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$
- if (substitutionGroup != null)
- {
- handleSubstitutionGroup(substitutionGroup);
- }
- }
- }
-
- protected void handleSubstitutionGroup(CMNodeList substitutionGroup)
- {
- int substitutionGroupLength = substitutionGroup.getLength();
- for (int i = 0; i < substitutionGroupLength; i++)
- {
- CMNode ed = substitutionGroup.item(i);
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract"))) //$NON-NLS-1$
- {
- addToTable(childNodeTable,ed);
- }
- }
- }
-
- public void visitCMGroup(CMGroup group)
- {
- if (includeSequenceGroups)
- {
- if (group.getOperator() == CMGroup.SEQUENCE &&
- group.getChildNodes().getLength() > 1 &&
- includesRequiredContent(group))
- {
- childNodeTable.put(group, group);
- }
- }
- super.visitCMGroup(group);
- }
-
- public boolean includesRequiredContent(CMGroup group)
- {
- List list = getValidator().createContentSpecificationList(group);
- return list.size() > 1;
- }
- }
-
-
- /**
- * @deprected - use getPossibleDataTypeValues()
- */
- public List getDataTypeValues(Element element, CMNode cmNode)
- {
- return Arrays.asList(getPossibleDataTypeValues(element, cmNode));
- }
-
- /**
- * This methods return an array of possible values corresponding to the datatype of the CMNode (either an CMAttributeDeclaration or a CMElementDeclaration)
- */
- public String[] getPossibleDataTypeValues(Element element, CMNode cmNode)
- {
- List list = new ArrayList();
-
- if (cmNode != null)
- {
- CMDataType dataType = null;
- if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- {
- dataType = ((CMAttributeDeclaration)cmNode).getAttrType();
- }
- else if (cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- {
- dataType = ((CMElementDeclaration)cmNode).getDataType();
- }
-
- String[] enumeratedValues = dataType != null ? dataType.getEnumeratedValues() : null;
- if (enumeratedValues != null)
- {
- for (int i = 0; i < enumeratedValues.length; i++)
- {
- list.add(enumeratedValues[i]);
- }
- }
- }
-
- addValuesForXSIType(element, cmNode, list);
-
- if (extensionManager != null)
- {
- list.addAll(extensionManager.getDataTypeValues(element, cmNode));
- }
-
- // Remove duplicates
- List duplicateFreeList = new ArrayList();
- Iterator iterator = list.iterator();
- while(iterator.hasNext()) {
- Object next = iterator.next();
- if(duplicateFreeList.indexOf(next) == -1) {
- duplicateFreeList.add(next);
- }
- }
-
- return (String[]) duplicateFreeList.toArray(new String[duplicateFreeList.size()]);
- }
-
-
- protected void addValuesForXSIType(Element element, CMNode cmNode, List list)
- {
- if (cmNode != null && cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- {
- CMAttributeDeclaration ad = (CMAttributeDeclaration)cmNode;
- if (valueHelper.isXSIType(ad))
- {
- NamespaceTable table = new NamespaceTable(element.getOwnerDocument());
- table.addElementLineage(element);
- list.addAll(valueHelper.getQualifiedXSITypes(ad, table));
- }
- }
- }
-
-
- public ModelQueryExtensionManager getExtensionManager()
- {
- return extensionManager;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java
deleted file mode 100644
index de5242f176..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-public class SimpleAssociationProvider extends BaseAssociationProvider
-{
- protected ModelQueryCMProvider modelQueryCMProvider;
-
- public SimpleAssociationProvider(ModelQueryCMProvider modelQueryCMProvider)
- {
- this.modelQueryCMProvider = modelQueryCMProvider;
- }
-
- public CMDocument getCorrespondingCMDocument(Node node)
- {
- return modelQueryCMProvider.getCorrespondingCMDocument(node);
- }
-
- public CMElementDeclaration getCMElementDeclaration(Element element)
- {
- CMElementDeclaration result = null;
- CMDocument cmDocument = getCorrespondingCMDocument(element);
- if (cmDocument != null)
- {
- result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
deleted file mode 100644
index 454fe8ad9a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.contentmodel.modelqueryimpl;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReferenceProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public abstract class XMLAssociationProvider extends BaseAssociationProvider implements CMDocumentReferenceProvider
-{
- protected CMDocumentCache cmDocumentCache;
- protected CMDocumentManagerImpl documentManager;
-
- private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.xml.core/externalSchemaLocation")).booleanValue(); //$NON-NLS-1$
-
- public XMLAssociationProvider(CMDocumentCache cmDocumentCache)
- {
- this.cmDocumentCache = cmDocumentCache;
- documentManager = new CMDocumentManagerImpl(cmDocumentCache, this);
- }
-
- public CMDocumentManager getCMDocumentManager()
- {
- return documentManager;
- }
-
-
- public static String[] getDoctypeInfo(Document document)
- {
- String[] result = null;
- DocumentType doctype = document.getDoctype();
-
- // defect 206833 ... here we test for DTDs that are declared inline
- // since we currently have no way of making use of inline DTDs we ignore them
- // so that the implict DTD (if any) can be used
- if (doctype != null && (doctype.getPublicId() != null || doctype.getSystemId() != null))
- {
- result = new String[2];
- result[0] = doctype.getPublicId();
- result[1] = doctype.getSystemId();
- }
- else if (getImplictDoctype(document) != null)
- {
- result = getImplictDoctype(document);
- }
- return result;
- }
-
-
- protected static String[] getImplictDoctype(Document document)
- {
- String[] result = null;
- /*
- DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
- if (domExtension != null)
- {
- result = domExtension.getImplicitDoctype();
- }*/
- return result;
- }
-
- public CMDocument getCorrespondingCMDocument(Node node)
- {
- return getCorrespondingCMDocument(node, true);
- }
-
- protected CMDocument getCorrespondingCMDocument(Node node, boolean getDocumentFromCMNode)
- {
- CMDocument result = null;
- try
- {
- Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document)node : node.getOwnerDocument();
-
- String[] doctypeInfo = getDoctypeInfo(document);
-
- if (doctypeInfo != null)
- {
- result = getCMDocument(doctypeInfo[0], doctypeInfo[1], "DTD"); //$NON-NLS-1$
- }
- // defect 211236 ... in some cases calling this method can result in a cycle
- // we use the getDocumentFromCMNode as a flag to avoid this
- // TODO... see if there is a way to re-organize to avoid the need for this flag
- else if (getDocumentFromCMNode)
- {
- CMNode cmNode = getCMNode(node);
- if (cmNode != null)
- {
- // todo... add a getCMDocument() methods to CMNode
- // for now use the getProperty interface
- result = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
- }
- }
- }
- catch (Exception e)
- {
- Logger.logException("exception locating CMDocument for " + node, e); //$NON-NLS-1$
- }
- return result;
- }
-
-
- public CMDocument getCMDocument(Element element, String uri)
- {
- CMDocument result = null;
- NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
- namespaceTable.addElementLineage(element);
- NamespaceInfo namespaceInfo = namespaceTable.getNamespaceInfoForURI(uri);
- if (namespaceInfo != null)
- {
- result = getCMDocument(namespaceInfo.uri, namespaceInfo.locationHint, "XSD"); //$NON-NLS-1$
- }
- return result;
- }
-
-
- public CMDocument getCMDocument(String publicId, String systemId, String type)
- {
- //String resolvedGrammarURI = resolveGrammarURI(document, publicId, systemId);
- return documentManager.getCMDocument(publicId, systemId, type);
- }
-
- //public CMDocument getCMDocument(Document document, String publicId, String systemId)
- //{
- // //String resolvedGrammarURI = resolveGrammarURI(document, publicId, systemId);
- // return documentManager.getCMDocument(publicId, systemId);
- //}
-
- public String resolveGrammarURI(String publicId, String systemId)
- {
- return resolveGrammarURI(null, publicId, systemId);
- }
-
-
- /**
- * This method should be specialized in order to implement specialized uri resolution
- */
- protected String resolveGrammarURI(Document document, String publicId, String systemId)
- {
- return systemId;
- }
-
-
- public CMElementDeclaration getCMElementDeclaration(Element element)
- {
- CMElementDeclaration result = null;
- Document document = element.getOwnerDocument();
- String[] doctypeInfo = getDoctypeInfo(document);
- if (doctypeInfo != null)
- {
- // we have detected doctype information so we assume that we can locate the CMElementDeclaration
- // in the CMDocument's table of global elements
- CMDocument cmDocument = getCorrespondingCMDocument(element, false);
-
- // TODO... consider replacing above with
- // CMDocument cmDocument = getCMDocument(document, doctypeInfo[0], doctypeInfo[1]);
-
- if (cmDocument != null)
- {
- result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());
-
- // this is a hack to get our xsl code assist working... we might want to handle similar
- // grammar behaviour via some established model query setting
- if (result == null && getImplictDoctype(document) != null)
- {
- Node parent = element.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE)
- {
- result = getCMElementDeclaration((Element)parent);
- }
- }
- }
- }
- else
- {
- // here we use a namespaceTable to consider if the root element has any namespace information
- //
- NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
- List list = NamespaceTable.getElementLineage(element);
- Element rootElement = (Element)list.get(0);
- namespaceTable.addElement(rootElement);
-
- if (namespaceTable.isNamespaceEncountered())
- {
- // we assume that this is an XMLSchema style namespace aware document
- result = getCMElementDeclaration(element, list, namespaceTable);
- }
- else
- {
- result = checkExternalSchema(element);
- if (result == null) {
- // we assume that this is an inferred CMDocument for a DTD style 'namespaceless' document
- CMDocument cmDocument = getCMDocument("", "", "DTD"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (cmDocument != null) {
- result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());
- }
- }
- }
- }
- return result;
- }
-
- protected CMElementDeclaration checkExternalSchema(Element element) {
- final Document document = element.getOwnerDocument();
- if (document instanceof IDOMDocument) {
- final String baseLocation = ((IDOMDocument) document).getModel().getBaseLocation();
- if (baseLocation != null) {
- final IPath basePath = new Path(baseLocation);
- IFile file = null;
- if (basePath.segmentCount() > 1) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- }
- final URI uri = (file == null || !file.isAccessible()) ? new File(baseLocation).toURI() : file.getLocationURI();
- if (uri != null) {
- IExternalSchemaLocationProvider[] providers = ExternalSchemaLocationProviderRegistry.getInstance().getProviders();
- for (int i = 0; i < providers.length; i++) {
- long time = _trace ? System.currentTimeMillis(): 0;
- final Map locations = providers[i].getExternalSchemaLocation(uri);
- if (_trace) {
- long diff = System.currentTimeMillis() - time;
- if (diff > 250)
- Logger.log(Logger.INFO, "Schema location provider took [" + diff + "ms] for URI [" + uri + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (locations != null && !locations.isEmpty()) {
- Object location = locations.get(IExternalSchemaLocationProvider.NO_NAMESPACE_SCHEMA_LOCATION);
- if (location != null)
- return getCMElementDeclaration(element, NamespaceTable.getElementLineage(element), uri.toString(), location.toString());
- }
- }
- }
- }
- }
- return null;
- }
-
- protected CMElementDeclaration getCMElementDeclaration(Element targetElement, List list, String publicId, String systemId)
- {
- CMElementDeclaration currentED = null;
- try
- {
- int listSize = list.size();
- for (int i = 0; i < listSize; i++)
- {
- Element element = (Element)list.get(i);
-
- final String nodeName = element.getNodeName();
-
- CMElementDeclaration ed = null;
-
- // see if the element is a local of the currentED
- //
- if (currentED != null)
- {
- ed = (CMElementDeclaration)currentED.getLocalElements().getNamedItem(nodeName);
- }
-
- if (ed == null)
- {
- CMDocument cmDocument = getCMDocument(publicId, systemId, "XSD"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- ed = (CMElementDeclaration)cmDocument.getElements().getNamedItem(nodeName);
- }
- }
- currentED = ed;
- }
- }
- catch (Exception e)
- {
- Logger.logException("exception locating element declaration for " + targetElement, e); //$NON-NLS-1$
- }
-
- return currentED;
- }
-
- protected CMElementDeclaration getCMElementDeclaration(Element targetElement, List list, NamespaceTable namespaceTable)
- {
- CMElementDeclaration currentED = null;
- try
- {
- int listSize = list.size();
- for (int i = 0; i < listSize; i++)
- {
- Element element = (Element)list.get(i);
-
- if (i != 0)
- {
- namespaceTable.addElement(element);
- }
-
- String nodeName = element.getNodeName();
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(nodeName);
- String prefix = DOMNamespaceHelper.getPrefix(nodeName);
-
- CMElementDeclaration ed = null;
-
- // see if the element is a local of the currentED
- //
- if (currentED != null)
- {
- ed = (CMElementDeclaration)currentED.getLocalElements().getNamedItem(unprefixedName);
- }
-
- if (ed == null)
- {
- NamespaceInfo namespaceInfo = namespaceTable.getNamespaceInfoForPrefix(prefix);
- if (namespaceInfo != null)
- {
- CMDocument cmDocument = getCMDocument(namespaceInfo.uri, namespaceInfo.locationHint, "XSD"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- ed = (CMElementDeclaration)cmDocument.getElements().getNamedItem(unprefixedName);
- }
- }
- }
- currentED = ed;
-
- // handle XSIType
- if (currentED != null)
- {
- CMElementDeclaration derivedED = getDerivedCMElementDeclaration(element, currentED, namespaceTable);
- if (derivedED != null)
- {
- currentED = derivedED;
- }
- }
- }
- }
- catch (Exception e)
- {
- Logger.logException("exception locating element declaration for " + targetElement, e); //$NON-NLS-1$
- }
-
- return currentED;
- }
-
-
- protected CMElementDeclaration getDerivedCMElementDeclaration(Element element, CMElementDeclaration ed, NamespaceTable namespaceTable)
- {
- CMElementDeclaration result = null;
- String xsiPrefix = namespaceTable.getPrefixForURI("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
- if (xsiPrefix != null)
- {
- String xsiTypeValue = element.getAttribute(xsiPrefix + ":type"); //$NON-NLS-1$
- if (xsiTypeValue != null && xsiTypeValue.length() > 0)
- {
- String typePrefix = DOMNamespaceHelper.getPrefix(xsiTypeValue);
- String typeName = DOMNamespaceHelper.getUnprefixedName(xsiTypeValue);
- String typeURI = namespaceTable.getURIForPrefix(typePrefix);
- String uriQualifiedTypeName = typeName;
- if (typeURI != null && typeURI.length() > 0)
- {
- uriQualifiedTypeName = "[" + typeURI + "]" + typeName; //$NON-NLS-1$ //$NON-NLS-2$
- }
- result = (CMElementDeclaration)ed.getProperty("DerivedElementDeclaration=" + uriQualifiedTypeName); //$NON-NLS-1$
- }
- }
- return result;
- }
-
-
- public CMAttributeDeclaration getCMAttributeDeclaration(Attr attr)
- {
- CMAttributeDeclaration result = null;
- Element element = attr.getOwnerElement();
- if (element != null)
- {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- if (ed != null)
- {
- result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(attr.getName());
- if (result == null)
- {
- // try to get the unprefixed name
- String name = DOMNamespaceHelper.getUnprefixedName(attr.getName());
- result = (CMAttributeDeclaration)ed.getAttributes().getNamedItem(name);
- }
- if (result == null)
- {
- // todo... perhaps this is a globally defined attribute...
- }
- }
- }
- return result;
- }
-
- /**
- * This method returns a list of CMDocumentReferences associated with a particular node or subtree
- */
- public List getCMDocumentReferences(Node node, boolean deep)
- {
- List result = new ArrayList();
- Document document = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document)node : node.getOwnerDocument();
- DocumentType doctype = document.getDoctype();
- // defect 206833 ... here we test for DTDs that are declared inline
- // since we currently have no way of making use of inline DTDs we ingore them
- // so that the implict DTD (if any) can be used
- if (doctype != null && (doctype.getPublicId() != null || doctype.getSystemId() != null))
- {
- String uri = resolveGrammarURI(document, doctype.getPublicId(), doctype.getSystemId());
- result.add(new CMDocumentReferenceImpl(doctype.getPublicId(), uri));
- }
- else if (getImplictDoctype(document) != null)
- {
- String[] implicitDoctype = getImplictDoctype(document);
- String uri = resolveGrammarURI(document, implicitDoctype[0], implicitDoctype[1]);
- result.add(new CMDocumentReferenceImpl(implicitDoctype[0], uri));
- }
- else
- {
- NamespaceTable namespaceTable = new NamespaceTable(document);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- namespaceTable.addElement((Element)node);
- }
- if (deep)
- {
- addChildElementsToNamespaceTable(node, namespaceTable);
- }
- List list = namespaceTable.getNamespaceInfoList();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- String uri = resolveGrammarURI(document, info.uri, info.locationHint);
- result.add(new CMDocumentReferenceImpl(info.uri, uri));
- }
- }
- return result;
- }
-
- protected void addChildElementsToNamespaceTable(Node node, NamespaceTable namespaceTable)
- {
- NodeList nodeList = node.getChildNodes();
- if (nodeList != null)
- {
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++)
- {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE)
- {
- namespaceTable.addElement((Element)childNode);
- addChildElementsToNamespaceTable(childNode, namespaceTable);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
deleted file mode 100644
index a82ab1c9be..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMDescriptionBuilder extends CMVisitor
-{
- protected StringBuffer sb;
- protected CMNode root;
- protected boolean isRootVisited;
- public String buildDescription(CMNode node)
- {
- sb = new StringBuffer();
- root = node;
- isRootVisited = false;
- visitCMNode(node);
- return sb.toString();
- }
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- sb.append("namespace:uri=\"" + anyElement.getNamespaceURI() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void visitCMDataType(CMDataType dataType)
- {
- sb.append("#PCDATA"); //$NON-NLS-1$
- }
-
- public void visitCMDocument(CMDocument document)
- {
- CMNamedNodeMap map = document.getElements();
- int size = map.getLength();
- for (int i = 0; i < size; i++)
- {
- visitCMNode(map.item(i));
- }
- }
-
- public void visitCMGroup(CMGroup group)
- {
- int op = group.getOperator();
- if (op == CMGroup.ALL)
- {
- sb.append("all"); //$NON-NLS-1$
- }
-
- sb.append("("); //$NON-NLS-1$
-
- String separator = ", "; //$NON-NLS-1$
-
- if (op == CMGroup.CHOICE)
- {
- separator = " | "; //$NON-NLS-1$
- }
-
-
- CMNodeList nodeList = group.getChildNodes();
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++)
- {
- visitCMNode(nodeList.item(i));
- if (i < size - 1)
- {
- sb.append(separator);
- }
- }
-
- sb.append(")"); //$NON-NLS-1$
- addOccurenceSymbol(group);
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- if (ed == root && !isRootVisited)
- {
- isRootVisited = true;
- CMContent content = ed.getContent();
- if (content != null)
- {
- if (content.getNodeType() != CMNode.GROUP)
- {
- sb.append("("); //$NON-NLS-1$
- visitCMNode(content);
- sb.append(")"); //$NON-NLS-1$
- }
- else
- {
- visitCMNode(content);
- }
- }
- }
- else
- {
- sb.append(ed.getElementName());
- addOccurenceSymbol(ed);
- }
- }
-
- public void addOccurenceSymbol(CMContent content)
- {
- int min = content.getMinOccur();
- int max = content.getMaxOccur();
- if (min == 0)
- {
- if (max > 1 || max == -1)
- {
- sb.append("*"); //$NON-NLS-1$
- }
- else
- {
- sb.append("?"); //$NON-NLS-1$
- }
- }
- else if (max > 1 || max == -1)
- {
- sb.append("+"); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java
deleted file mode 100644
index 670ff531b4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-
-/**
- *
- */
-public class CMDocumentCache
-{
- public static final int STATUS_NOT_LOADED = 0;
- public static final int STATUS_LOADING = 2;
- public static final int STATUS_LOADED = 3;
- public static final int STATUS_ERROR = 4;
-
- protected class Entry
- {
- public String uri;
- public int status = STATUS_NOT_LOADED;
- public float progress;
- public CMDocument cmDocument;
-
- public Entry(String uri)
- {
- this.uri = uri;
- }
-
- public Entry(String uri, int status, CMDocument cmDocument)
- {
- this.uri = uri;
- this.status = status;
- this.cmDocument = cmDocument;
- }
- }
-
- protected Hashtable hashtable;
- protected List listenerList = new Vector();
-
-
- /**
- * temporarily public until caching problem is solved
- */
- public CMDocumentCache()
- {
- hashtable = new Hashtable();
- }
-
- public void addListener(CMDocumentCacheListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeListener(CMDocumentCacheListener listener)
- {
- listenerList.remove(listener);
- }
-
- /**
- *
- */
- public CMDocument getCMDocument(String grammarURI)
- {
- CMDocument result = null;
- if (grammarURI != null)
- {
- Entry entry = (Entry)hashtable.get(grammarURI);
- if (entry != null)
- {
- result = entry.cmDocument;
- }
- }
- return result;
- }
-
- /**
- *
- */
- public int getStatus(String grammarURI)
- {
- int result = STATUS_NOT_LOADED;
- if (grammarURI != null)
- {
- Entry entry = (Entry)hashtable.get(grammarURI);
- if (entry != null)
- {
- result = entry.status;
- }
-
- }
- return result;
- }
-
- /**
- *
- */
- protected Entry lookupOrCreate(String grammarURI)
- {
- Entry entry = (Entry)hashtable.get(grammarURI);
- if (entry == null)
- {
- entry = new Entry(grammarURI);
- hashtable.put(grammarURI, entry);
- }
- return entry;
- }
-
-
- /**
- *
- */
- public void putCMDocument(String grammarURI, CMDocument cmDocument)
- {
- if (grammarURI != null && cmDocument != null)
- {
- Entry entry = lookupOrCreate(grammarURI);
- int oldStatus = entry.status;
- entry.status = STATUS_LOADED;
- entry.cmDocument = cmDocument;
- notifyCacheUpdated(grammarURI, oldStatus, entry.status, entry.cmDocument);
- }
- }
-
- /**
- *
- */
- public void setStatus(String grammarURI, int status)
- {
- if (grammarURI != null)
- {
- Entry entry = lookupOrCreate(grammarURI);
- int oldStatus = entry.status;
- entry.status = status;
- notifyCacheUpdated(grammarURI, oldStatus, entry.status, entry.cmDocument);
- }
- }
-
- /**
- *
- */
- public void clear()
- {
- hashtable.clear();
- notifyCacheCleared();
- }
-
- /**
- *
- */
- protected void notifyCacheUpdated(String uri, int oldStatus, int newStatus, CMDocument cmDocument)
- {
- List list = new Vector();
- list.addAll(listenerList);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- CMDocumentCacheListener listener = (CMDocumentCacheListener)i.next();
- listener.cacheUpdated(this, uri, oldStatus, newStatus, cmDocument);
- }
- }
-
- /**
- *
- */
- protected void notifyCacheCleared()
- {
- List list = new Vector();
- list.addAll(listenerList);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- CMDocumentCacheListener listener = (CMDocumentCacheListener)i.next();
- listener.cacheCleared(this);
- }
- }
-
- public List getCMDocuments()
- {
- List list = new ArrayList();
- for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
- {
- Entry entry = (Entry)i.next();
- list.add(entry.cmDocument);
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java
deleted file mode 100644
index d9f6dcdece..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-/**
- * todo... add more interface methods
- */
-public interface CMDocumentCacheListener
-{
- /** Tells the client that the cache has been cleared.
- * This gives clients an opportunity to flush any state that depends on the CMDocument
- * since this CMDocument will be recomputed on a subsequent 'lookup' request
- */
- public void cacheCleared(CMDocumentCache cache);
-
- /**
- * Tells the client that the cache has been updated.
- */
- public void cacheUpdated(CMDocumentCache cache, String uri, int oldStatus, int newStatus, CMDocument cmDocument);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
deleted file mode 100644
index 89bb9d6a9a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Stack;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-public class CMVisitor
-{
- protected int indent = 0;
- protected Stack visitedCMGroupStack = new Stack();
-
- public void visitCMNode(CMNode node)
- {
- if (node != null)
- {
- //ContentModelManager.printlnIndented("visitCMNode : " + node.getNodeName() + " " + node);
- indent += 2;
- int nodeType = node.getNodeType();
- switch (nodeType)
- {
- case CMNode.ANY_ELEMENT :
- {
- visitCMAnyElement((CMAnyElement)node);
- break;
- }
- case CMNode.ATTRIBUTE_DECLARATION :
- {
- visitCMAttributeDeclaration((CMAttributeDeclaration)node);
- break;
- }
- case CMNode.DATA_TYPE :
- {
- visitCMDataType((CMDataType)node);
- break;
- }
- case CMNode.DOCUMENT :
- {
- visitCMDocument((CMDocument)node);
- break;
- }
- case CMNode.ELEMENT_DECLARATION :
- {
- visitCMElementDeclaration((CMElementDeclaration)node);
- break;
- }
- case CMNode.GROUP :
- {
- CMGroup group = (CMGroup)node;
-
- // This is to prevent recursion.
- if (visitedCMGroupStack.contains(group))
- {
- break;
- }
-
- // Push the current group to check later to avoid potential recursion
- visitedCMGroupStack.push(group);
-
- visitCMGroup(group);
-
- // Pop the current group
- visitedCMGroupStack.pop();
- break;
- }
- }
- indent -= 2;
- }
- }
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- }
-
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
- {
- }
-
- public void visitCMDataType(CMDataType dataType)
- {
- }
-
- public void visitCMDocument(CMDocument document)
- {
- CMNamedNodeMap map = document.getElements();
- int size = map.getLength();
- for (int i = 0; i < size; i++)
- {
- visitCMNode(map.item(i));
- }
- }
-
- public void visitCMGroup(CMGroup group)
- {
- CMNodeList nodeList = group.getChildNodes();
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++)
- {
- visitCMNode(nodeList.item(i));
- }
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- CMNamedNodeMap nodeMap = ed.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++)
- {
- visitCMNode(nodeMap.item(i));
- }
-
- visitCMNode(ed.getContent());
-
- visitCMDataType(ed.getDataType());
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java
deleted file mode 100644
index 14d02b1879..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-
-/**
- * This class lets you traverse a 'CM' model providing callbacks to build content.
- */
-public class ContentBuilder extends CMVisitor
-{
- public static final int BUILD_ALL_CONTENT = 1;
- public static final int BUILD_ONLY_REQUIRED_CONTENT = 2;
- protected int buildPolicy = BUILD_ALL_CONTENT;
-
- protected boolean alwaysVisit;
- protected Vector visitedCMElementDeclarationList = new Vector();
-
- public ContentBuilder()
- {
- }
-
- public void setBuildPolicy(int buildPolicy)
- {
- this.buildPolicy = buildPolicy;
- }
-
- public int getBuildPolicy()
- {
- return buildPolicy;
- }
-
- protected void createAnyElementNode(CMAnyElement anyElement)
- {
- }
-
- protected void createElementNodeStart(CMElementDeclaration ed)
- {
- }
-
- protected void createElementNodeEnd(CMElementDeclaration ed)
- {
- }
-
- protected void createTextNode(CMDataType dataType)
- {
- }
-
- protected void createAttributeNode(CMAttributeDeclaration attribute)
- {
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
- int min = Math.max(ed.getMinOccur(), forcedMin);
- alwaysVisit = false;
-
- if (min > 0 && !visitedCMElementDeclarationList.contains(ed))
- {
- visitedCMElementDeclarationList.add(ed);
- for (int i = 1; i <= min; i++)
- {
- createElementNodeStart(ed);
-
- // instead of calling super.visitCMElementDeclaration()
- // we duplicate the code with some minor modifications
- CMNamedNodeMap nodeMap = ed.getAttributes();
- int size = nodeMap.getLength();
- for (int j = 0; j < size; j++)
- {
- visitCMNode(nodeMap.item(j));
- }
-
- CMContent content = ed.getContent();
- if (content != null)
- {
- visitCMNode(content);
- }
-
- if (ed.getContentType() == CMElementDeclaration.PCDATA)
- {
- CMDataType dataType = ed.getDataType();
- if (dataType != null)
- {
- visitCMDataType(dataType);
- }
- }
- // end duplication
- createElementNodeEnd(ed);
- }
- int size = visitedCMElementDeclarationList.size();
- visitedCMElementDeclarationList.remove(size - 1);
- }
- }
-
-
- public void visitCMDataType(CMDataType dataType)
- {
- createTextNode(dataType);
- }
-
-
- public void visitCMGroup(CMGroup e)
- {
- int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
- int min = Math.max(e.getMinOccur(), forcedMin);
- alwaysVisit = false;
-
- for (int i = 1; i <= min; i++)
- {
- if (e.getOperator() == CMGroup.CHOICE)
- {
- // add only 1 element from the group
- // todo... perhaps add something other than the first one
- CMNodeList nodeList = e.getChildNodes();
- if (nodeList.getLength() > 0)
- {
- visitCMNode(nodeList.item(0));
- }
- }
- else // SEQUENCE, ALL
- {
- // visit all of the content
- super.visitCMGroup(e);
- }
- }
- }
-
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
- {
- if (alwaysVisit ||
- buildPolicy == BUILD_ALL_CONTENT ||
- ad.getUsage() == CMAttributeDeclaration.REQUIRED)
- {
- createAttributeNode(ad);
- }
- }
-
-
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- int forcedMin = (buildPolicy == BUILD_ALL_CONTENT || alwaysVisit) ? 1 : 0;
- alwaysVisit = false;
- int min = Math.max(anyElement.getMinOccur(), forcedMin);
- for (int i = 1; i <= min; i++)
- {
- createAnyElementNode(anyElement);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java
deleted file mode 100644
index 9d23576155..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import java.util.List;
-
-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.CMNode;
-import org.w3c.dom.Node;
-
-
-public interface DOMContentBuilder
-{
- public static final int BUILD_OPTIONAL_ATTRIBUTES = 1;
- public static final int BUILD_OPTIONAL_ELEMENTS = 1<<1;
- public static final int BUILD_FIRST_CHOICE = 1<<2;
- public static final int BUILD_TEXT_NODES = 1<<3;
- public static final int BUILD_FIRST_SUBSTITUTION = 1<<4;
-
- public static final int
- BUILD_ONLY_REQUIRED_CONTENT =
- BUILD_FIRST_CHOICE
- | BUILD_TEXT_NODES;
- public static final int
- BUILD_ALL_CONTENT =
- BUILD_OPTIONAL_ATTRIBUTES
- | BUILD_OPTIONAL_ELEMENTS
- | BUILD_FIRST_CHOICE
- | BUILD_TEXT_NODES;
-
- public static final String PROPERTY_BUILD_BLANK_TEXT_NODES = "buildBlankTextNodes"; //$NON-NLS-1$
-
- public void setBuildPolicy(int buildPolicy);
- public int getBuildPolicy();
- public void setProperty(String propertyName, Object value);
- public Object getProperty(String propertyName);
- public List getResult();
- public void build(Node parent, CMNode child);
- public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration) throws Exception;
- public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration, List namespaceInfoList) throws Exception;
- public void createDefaultContent(Node parent, CMElementDeclaration ed) throws Exception;
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
deleted file mode 100644
index 290f6f5866..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.internal.util.CMDataTypeValueHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * todo... common up this code with 'ContentBuilder'
- */
-public class DOMContentBuilderImpl extends CMVisitor implements DOMContentBuilder {
- protected int buildPolicy = BUILD_ALL_CONTENT;
- protected Hashtable propertyTable = new Hashtable();
-
- protected boolean alwaysVisit = false;
- protected List resultList;
- protected Document document;
- protected Node currentParent;
- protected Node topParent;
- protected Vector visitedCMElementDeclarationList = new Vector();
- protected boolean attachNodesToParent = true;
- protected NamespaceTable namespaceTable;
-
- protected List namespaceInfoList;
- protected Element rootElement; // this is used only teporarily via
- // createDefaultRootContent
- protected ExternalCMDocumentSupport externalCMDocumentSupport;
-
- public boolean supressCreationOfDoctypeAndXMLDeclaration;
-
- protected CMDataTypeValueHelper valueHelper = new CMDataTypeValueHelper();
-
- protected int numOfRepeatableElements = 1;
- protected Stack cmGroupStack = new Stack();
- protected int depthLimit = -1;
-
- protected int domLevel;
- private int originalBuildPolicy;
-
- public interface ExternalCMDocumentSupport {
- public CMDocument getCMDocument(Element element, String uri);
- }
-
- public void setExternalCMDocumentSupport(ExternalCMDocumentSupport externalCMDocumentSupport) {
- this.externalCMDocumentSupport = externalCMDocumentSupport;
- }
-
- public DOMContentBuilderImpl(Document document) {
- this.document = document;
- namespaceTable = new NamespaceTable(document);
- }
-
- public void setBuildPolicy(int buildPolicy) {
- this.buildPolicy = buildPolicy;
- }
-
- public int getBuildPolicy() {
- return buildPolicy;
- }
-
- protected boolean buildAllContent(int policy) {
- return (policy & BUILD_ALL_CONTENT) == BUILD_ALL_CONTENT;
- }
-
- protected boolean buildOptionalElements(int policy) {
- return (policy & BUILD_OPTIONAL_ELEMENTS) == BUILD_OPTIONAL_ELEMENTS;
- }
-
- protected boolean buildOptionalAttributes(int policy) {
- return (policy & BUILD_OPTIONAL_ATTRIBUTES) == BUILD_OPTIONAL_ATTRIBUTES;
- }
-
- protected boolean buildFirstChoice(int policy) {
- return (policy & BUILD_FIRST_CHOICE) == BUILD_FIRST_CHOICE;
- }
-
- protected boolean buildTextNodes(int policy) {
- return (policy & BUILD_TEXT_NODES) == BUILD_TEXT_NODES;
- }
-
- protected boolean buildFirstSubstitution(int policy) {
- return (policy & BUILD_FIRST_SUBSTITUTION) == BUILD_FIRST_SUBSTITUTION;
- }
-
- public List getResult() {
- return resultList;
- }
-
- public void setProperty(String propertyName, Object value) {
- propertyTable.put(propertyName, value);
- }
-
- public Object getProperty(String propertyName) {
- return propertyTable.get(propertyName);
- }
-
- public void build(Node parent, CMNode child) {
- resultList = new Vector();
- topParent = parent;
- currentParent = parent;
- if (parent instanceof Element) {
- namespaceTable.addElementLineage((Element) parent);
- }
- attachNodesToParent = false;
- alwaysVisit = true;
- visitCMNode(child);
- }
-
- public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration, List namespaceInfoList) throws Exception {
- this.namespaceInfoList = namespaceInfoList;
- createDefaultRootContent(cmDocument, rootCMElementDeclaration);
- }
-
- public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration) throws Exception {
- String grammarFileName = cmDocument.getNodeName();
- if (!supressCreationOfDoctypeAndXMLDeclaration) {
- // TODO cs... investigate to see if this code path is ever used,
- // doesn't seem to be
- // for now I'm setting the encoding to UTF-8 just incase this code
- // path is used somewhere
- //
- String piValue = "version=\"1.0\""; //$NON-NLS-1$
- String encoding = "UTF-8"; //$NON-NLS-1$
- piValue += " encoding=\"" + encoding + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- ProcessingInstruction pi = document.createProcessingInstruction("xml", piValue); //$NON-NLS-1$
- document.appendChild(pi);
-
- // if we have a 'dtd' then add a DOCTYPE tag
- //
- if (grammarFileName != null && grammarFileName.endsWith("dtd")) //$NON-NLS-1$
- {
- DOMImplementation domImpl = document.getImplementation();
- DocumentType documentType = domImpl.createDocumentType(rootCMElementDeclaration.getElementName(), grammarFileName, grammarFileName);
- document.appendChild(documentType);
- }
- }
-
- // if we have a schema add an xsi:schemaLocation attribute
- //
- if (grammarFileName != null && grammarFileName.endsWith("xsd") && namespaceInfoList != null) //$NON-NLS-1$
- {
- DOMNamespaceInfoManager manager = new DOMNamespaceInfoManager();
- String name = rootCMElementDeclaration.getNodeName();
- if (namespaceInfoList.size() > 0) {
- NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
- if (info.prefix != null && info.prefix.length() > 0) {
- name = info.prefix + ":" + name; //$NON-NLS-1$
- }
- }
- rootElement = createElement(rootCMElementDeclaration, name, document);
- manager.addNamespaceInfo(rootElement, namespaceInfoList, true);
- }
- createDefaultContent(document, rootCMElementDeclaration);
- }
-
- public void createDefaultContent(Node parent, CMElementDeclaration ed) {
- currentParent = parent;
- alwaysVisit = true;
- originalBuildPolicy = buildPolicy;
- visitCMElementDeclaration(ed);
- }
-
- public String computeName(CMNode cmNode, Node parent) {
- String prefix = null;
- return DOMNamespaceHelper.computeName(cmNode, parent, prefix, namespaceTable);
- }
-
- // overide the following 'create' methods to control how nodes are created
- //
- protected Element createElement(CMElementDeclaration ed, String name, Node parent) {
- return document.createElement(name);
- }
-
- protected Attr createAttribute(CMAttributeDeclaration ad, String name, Node parent) {
- return document.createAttribute(name);
- }
-
- protected Text createTextNode(CMDataType dataType, String value, Node parent) {
- return document.createTextNode(value);
- }
-
- protected void handlePushParent(Element parent, CMElementDeclaration ed) {
- domLevel++;
- }
-
- protected void handlePopParent(Element element, CMElementDeclaration ed) {
- domLevel--;
- }
-
- // The range must be between 1 and 99.
- public void setNumOfRepeatableElements(int i) {
- numOfRepeatableElements = i;
- }
-
- protected int getNumOfRepeatableElements() {
- return numOfRepeatableElements;
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed) {
- int forcedMin = (buildOptionalElements(buildPolicy) || alwaysVisit) ? 1 : 0;
- int min = Math.max(ed.getMinOccur(), forcedMin);
-
- // Correct the min value if the element is contained in
- // a group.
- if (!cmGroupStack.isEmpty()) {
- CMGroup group = (CMGroup) cmGroupStack.peek();
- int gmin = group.getMinOccur();
- if (gmin == 0)
- if (buildOptionalElements(buildPolicy)) {
- /* do nothing: min = min */
- }
- else {
- min = min * gmin; // min = 0
- }
- else {
- min = min * gmin;
- }
- }
-
- int max = Math.min(ed.getMaxOccur(), getNumOfRepeatableElements());
- if (max < min)
- max = min;
-
- alwaysVisit = false;
-
- // Note - ed may not be abstract but has substitutionGroups
- // involved.
- if (buildFirstSubstitution(buildPolicy) || isAbstract(ed)) // leave
- // this
- // for
- // backward
- // compatibility
- // for now
- {
- // Note - To change so that if ed is optional, we do not
- // generate anything here.
- ed = getSubstitution(ed);
-
- // Note - the returned ed may be an abstract element in
- // which case the xml will be invalid.
- }
-
- if (min > 0 && !visitedCMElementDeclarationList.contains(ed)) {
- visitedCMElementDeclarationList.add(ed);
- for (int i = 1; i <= max; i++) {
- // create an Element for each
- Element element = null;
- if (rootElement != null) {
- element = rootElement;
- rootElement = null;
- }
- else {
- element = createElement(ed, computeName(ed, currentParent), currentParent);
- }
-
- // visit the children of the GrammarElement
- Node oldParent = currentParent;
- currentParent = element;
- handlePushParent(element, ed);
-
- namespaceTable.addElement(element);
-
- boolean oldAttachNodesToParent = attachNodesToParent;
- attachNodesToParent = true;
-
- // instead of calling super.visitCMElementDeclaration()
- // we duplicate the code with some minor modifications
- CMNamedNodeMap nodeMap = ed.getAttributes();
- int size = nodeMap.getLength();
- for (int j = 0; j < size; j++) {
- visitCMNode(nodeMap.item(j));
- }
-
- CMContent content = ed.getContent();
- if (content != null) {
- visitCMNode(content);
- }
-
- if (ed.getContentType() == CMElementDeclaration.PCDATA) {
- CMDataType dataType = ed.getDataType();
- if (dataType != null) {
- visitCMDataType(dataType);
- }
- }
- // end duplication
- attachNodesToParent = oldAttachNodesToParent;
- handlePopParent(element, ed);
- currentParent = oldParent;
- linkNode(element);
- }
- int size = visitedCMElementDeclarationList.size();
- visitedCMElementDeclarationList.remove(size - 1);
- }
- }
-
-
- public void visitCMDataType(CMDataType dataType) {
- Text text = null;
- String value = null;
-
- // For backward compatibility:
- // Previous code uses a property value but new one uses
- // buildPolicy.
- if (getProperty(PROPERTY_BUILD_BLANK_TEXT_NODES) != null && getProperty(PROPERTY_BUILD_BLANK_TEXT_NODES).equals("true")) //$NON-NLS-1$
- buildPolicy = buildPolicy ^ BUILD_TEXT_NODES;
-
- if (buildTextNodes(buildPolicy)) {
- value = valueHelper.getValue(dataType);
- if (value == null) {
- if (currentParent != null && currentParent.getNodeType() == Node.ELEMENT_NODE) {
- value = currentParent.getNodeName();
- }
- else {
- value = "pcdata"; //$NON-NLS-1$
- }
- }
- }
- else {
- value = ""; //$NON-NLS-1$
- }
- text = createTextNode(dataType, value, currentParent);
- linkNode(text);
- }
-
- public void visitCMNode(CMNode node) {
- if (depthLimit != -1) {
- if (domLevel > depthLimit) {
- buildPolicy = buildPolicy &= ~BUILD_OPTIONAL_ELEMENTS;
- } else {
- buildPolicy = originalBuildPolicy;
- }
- }
- super.visitCMNode(node);
- }
-
- public void visitCMGroup(CMGroup e) {
- cmGroupStack.push(e);
-
- int forcedMin = (buildOptionalElements(buildPolicy) || alwaysVisit) ? 1 : 0;
- int min = Math.max(e.getMinOccur(), forcedMin);
-
- int max = 0;
- if (e.getMaxOccur() == -1) // unbounded
- max = getNumOfRepeatableElements();
- else
- max = Math.min(e.getMaxOccur(), getNumOfRepeatableElements());
-
- if (max < min)
- max = min;
-
- alwaysVisit = false;
-
- for (int i = 1; i <= max; i++) {
- if (e.getOperator() == CMGroup.CHOICE && buildFirstChoice(buildPolicy)) {
- CMNode hintNode = null;
-
- // todo... the CMGroup should specify the hint... but it seems
- // as though
- // the Yamato guys are making the CMElement specify the hint.
- // I do it that way for now until... we should fix this post
- // GA
- //
- int listSize = visitedCMElementDeclarationList.size();
- if (listSize > 0) {
- CMElementDeclaration ed = (CMElementDeclaration) visitedCMElementDeclarationList.get(listSize - 1);
- Object contentHint = ed.getProperty("contentHint"); //$NON-NLS-1$
- if (contentHint instanceof CMNode) {
- hintNode = (CMNode) contentHint;
- }
- }
-
- // see if this hint corresponds to a valid choice
- //
- CMNode cmNode = null;
-
- if (hintNode != null) {
- CMNodeList nodeList = e.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int j = 0; j < nodeListLength; j++) {
- if (hintNode == nodeList.item(j)) {
- cmNode = hintNode;
- }
- }
- }
-
- // if no cmNode has been determined from the hint, just use
- // the first choice
- //
- if (cmNode == null) {
- CMNodeList nodeList = e.getChildNodes();
- if (nodeList.getLength() > 0) {
- cmNode = nodeList.item(0);
- }
- }
-
- if (cmNode != null) {
- // Bug 330260
- // Problem - Add child element also adds optional grand-child elements
- // This assumes 'e' is a model group choice, case 1. However 'e' could be a model group definition, case 2, where the
- // first child is a model group. In the first case (choice), the first child is an
- // element. Upon visiting the element (visitCMElementDeclaration), the minOccurs of the
- // choice is ALSO considered. If its minOccurs is 0, then the first element is not added as a child.
- // However, in the second case (model group definition), the first child is a choice, but the multiplicity is [1,1],
- // meaning, it is required. So the first element is then added as child, even though
- // the model group definition reference is optional. (minOccurs is not checked in this method, visitCMGroup)
- // Visit the node only if it is not a GROUP (model group). If it is an element, then visit it.
- if (!(cmNode.getNodeType() == CMNode.GROUP && min > 0)) {
- visitCMNode(cmNode);
- }
- }
- }
- else if (e.getOperator() == CMGroup.ALL // ALL
- || e.getOperator() == CMGroup.SEQUENCE) // SEQUENCE
- {
- // visit all of the content
- super.visitCMGroup(e);
- }
- }
-
- cmGroupStack.pop();
- }
-
- static int count = 0;
-
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad) {
- if (alwaysVisit || buildOptionalAttributes(buildPolicy) || ad.getUsage() == CMAttributeDeclaration.REQUIRED) {
- alwaysVisit = false;
- String name = computeName(ad, currentParent);
- String value = valueHelper.getValue(ad, namespaceTable);
- Attr attr = createAttribute(ad, name, currentParent);
- attr.setValue(value != null ? value : ""); //$NON-NLS-1$
- linkNode(attr);
- }
- }
-
- protected boolean isAbstract(CMNode ed) {
- boolean result = false;
- if (ed != null) {
- Object value = ed.getProperty("Abstract"); //$NON-NLS-1$
- result = (value == Boolean.TRUE);
- }
- return result;
- }
-
- protected CMElementDeclaration getSubstitution(CMElementDeclaration ed) {
- CMElementDeclaration result = ed;
- CMNodeList l = (CMNodeList) ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$
- if (l != null) {
- for (int i = 0; i < l.getLength(); i++) {
- CMNode candidate = l.item(i);
- if (!isAbstract(candidate) && (candidate instanceof CMElementDeclaration)) {
- result = (CMElementDeclaration) candidate;
- break;
- }
- }
- }
- return result;
- }
-
- protected CMElementDeclaration getParentCMElementDeclaration() {
- CMElementDeclaration ed = null;
- int listSize = visitedCMElementDeclarationList.size();
- if (listSize > 0) {
- ed = (CMElementDeclaration) visitedCMElementDeclarationList.get(listSize - 1);
- }
- return ed;
- }
-
- public void visitCMAnyElement(CMAnyElement anyElement) {
- // ingnore buildPolicy for ANY elements... only create elements if
- // absolutely needed
- //
- int forcedMin = alwaysVisit ? 1 : 0;
- int min = Math.max(anyElement.getMinOccur(), forcedMin);
- alwaysVisit = false;
-
- String uri = anyElement.getNamespaceURI();
- String targetNSProperty = "http://org.eclipse.wst/cm/properties/targetNamespaceURI"; //$NON-NLS-1$
- CMDocument parentCMDocument = (CMDocument) anyElement.getProperty("CMDocument"); //$NON-NLS-1$
- CMElementDeclaration ed = null;
-
- // System.out.println("parentCMDocument = " + parentCMDocument);
- // //$NON-NLS-1$
- if (parentCMDocument != null) {
- if (uri == null || uri.startsWith("##") || uri.equals(parentCMDocument.getProperty(targetNSProperty))) //$NON-NLS-1$
- {
- ed = getSuitableElement(getParentCMElementDeclaration(), parentCMDocument);
- }
- }
-
-
- if (ed == null && externalCMDocumentSupport != null && uri != null && !uri.startsWith("##") && currentParent instanceof Element) //$NON-NLS-1$
- {
- CMDocument externalCMDocument = externalCMDocumentSupport.getCMDocument((Element) currentParent, uri);
- if (externalCMDocument != null) {
- ed = getSuitableElement(null, externalCMDocument);
- }
- }
-
- for (int i = 1; i <= min; i++) {
- if (ed != null) {
- visitCMElementDeclaration(ed);
- }
- else {
- Element element = document.createElement("ANY-ELEMENT"); //$NON-NLS-1$
- linkNode(element);
- }
- }
- }
-
- protected CMElementDeclaration getSuitableElement(CMNamedNodeMap nameNodeMap) {
- CMElementDeclaration result = null;
- int size = nameNodeMap.getLength();
- for (int i = 0; i < size; i++) {
- CMElementDeclaration candidate = (CMElementDeclaration) nameNodeMap.item(i);
- if (!visitedCMElementDeclarationList.contains(candidate)) {
- result = candidate;
- break;
- }
- }
- return result;
- }
-
- protected CMElementDeclaration getSuitableElement(CMElementDeclaration ed, CMDocument cmDocument) {
- CMElementDeclaration result = null;
-
- if (ed != null) {
- result = getSuitableElement(ed.getLocalElements());
- }
-
- if (result == null && cmDocument != null) {
- result = getSuitableElement(cmDocument.getElements());
- }
-
- return result;
- }
-
-
- public void linkNode(Node node) {
- if (attachNodesToParent && currentParent != null) {
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- ((Element) currentParent).setAttributeNode((Attr) node);
- }
- else {
- currentParent.appendChild(node);
- }
- }
- else if (resultList != null) {
- resultList.add(node);
- }
- }
-
- public static void testPopulateDocumentFromGrammarFile(Document document, String grammarFileName, String rootElementName, boolean hack) {
- try {
- CMDocument cmDocument = ContentModelManager.getInstance().createCMDocument(grammarFileName, null);
- CMNamedNodeMap elementMap = cmDocument.getElements();
- CMElementDeclaration element = (CMElementDeclaration) elementMap.getNamedItem(rootElementName);
-
- DOMContentBuilderImpl contentBuilder = new DOMContentBuilderImpl(document);
- contentBuilder.supressCreationOfDoctypeAndXMLDeclaration = hack;
- contentBuilder.createDefaultRootContent(cmDocument, element);
-
- System.out.println();
- System.out.println("-----------------------------"); //$NON-NLS-1$
- DOMWriter writer = new DOMWriter();
- if (hack) {
- writer.print(document, grammarFileName);
- }
- else {
- writer.print(document);
- }
- System.out.println("-----------------------------"); //$NON-NLS-1$
- }
- catch (Exception e) {
- System.out.println("Error: " + e); //$NON-NLS-1$
- e.printStackTrace();
- }
- }
-
- public void setOptionalElementDepthLimit(int depth) {
- depthLimit = depth;
- }
-
-
- // test
- //
- /*
- * public static void main(String arg[]) { if (arg.length >= 2) { try {
- * CMDocumentFactoryRegistry.getInstance().registerCMDocumentBuilderWithClassName("org.eclipse.wst.xml.core.internal.contentmodel.mofimpl.CMDocumentBuilderImpl");
- *
- * String grammarFileName = arg[0]; String rootElementName = arg[1];
- *
- * Document document =
- * (Document)Class.forName("org.apache.xerces.dom.DocumentImpl").newInstance();
- * testPopulateDocumentFromGrammarFile(document, grammarFileName,
- * rootElementName, true); } catch (Exception e) {
- * System.out.println("DOMContentBuilderImpl error"); e.printStackTrace(); } }
- * else { System.out.println("Usage : java
- * org.eclipse.wst.xml.util.DOMContentBuildingCMVisitor grammarFileName
- * rootElementName"); } }
- */
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java
deleted file mode 100644
index 049d44585c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class DOMNamespaceHelper
-{
- protected static String getURIForPrefix(Element element, String prefix)
- {
- String result = null;
- String nsAttrName = null;
- if (prefix != null && prefix.length() > 0)
- {
- nsAttrName = "xmlns:" + prefix; //$NON-NLS-1$
- }
- else
- {
- nsAttrName = "xmlns"; //$NON-NLS-1$
- }
-
- // assume the node is qualified... look up the URI base on the prefix
- //
- for (Node node = element; node != null; node = node.getParentNode())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element theElement = (Element)node;
- Attr attr = theElement.getAttributeNode(nsAttrName);
- if (attr != null)
- {
- result = attr.getValue();
- }
- }
- else
- {
- break;
- }
- }
-
- // see if we can find some info from an 'implicit' namespace
- //
- if (result == null)
- {
- NamespaceTable table = new NamespaceTable(element.getOwnerDocument());
- result = table.getURIForPrefix(prefix);
- }
- return result;
- }
-
- public static String getNamespaceURI(Node node)
- {
- String result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element)node;
- String prefix = element.getPrefix();
- result = getURIForPrefix(element, prefix);
- }
- else if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Attr attr = (Attr)node;
- String prefix = attr.getPrefix();
- result = getURIForPrefix(attr.getOwnerElement(), prefix);
- }
- return result;
- }
-
- // todo... this is an ugly hack... needs to be fixed
- //
- public static String computePrefix(CMNode cmNode, Node parentNode)
- {
- String result = null;
- for (Node node = parentNode; node != null; node = node.getParentNode())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- result = getPrefix(node.getNodeName());
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
-
-
- public static String getPrefix(String name)
- {
- String prefix = null;
- int index = name.indexOf(":"); //$NON-NLS-1$
- if (index != -1)
- {
- prefix = name.substring(0, index);
- }
- return prefix;
- }
-
-
- public static String getUnprefixedName(String name)
- {
- int index = name.indexOf(":"); //$NON-NLS-1$
- if (index != -1)
- {
- name = name.substring(index + 1);
- }
- return name;
- }
-
-
- public static String computeName(CMNode cmNode, Node parent, String prefix)
- {
- return computeName(cmNode, parent, prefix, null);
- }
-
-
- public static String computeName(CMNode cmNode, Node parent, String prefix, NamespaceTable namespaceTable)
- {
- String result = cmNode.getNodeName();
-
- // if the cmNode has a hard coded prefix then we don't need to do anything
- //
- if (getPrefix(result) == null)
- {
- String qualification = (String)cmNode.getProperty("http://org.eclipse.wst/cm/properties/nsPrefixQualification"); //$NON-NLS-1$
- // see if we need a namespace prefix
- //
- if (qualification != null && qualification.equals("qualified")) //$NON-NLS-1$
- {
- if (prefix == null)
- {
- // todo... add getCMDocument() method to CMNode
- // for now use this getProperty() hack
- CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
- if (namespaceURI != null)
- {
- // use the NamespaceTable to figure out the correct prefix for this namespace uri
- //
- if (namespaceTable == null)
- {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document)parent : parent.getOwnerDocument();
- namespaceTable = new NamespaceTable(document);
- if (parent instanceof Element)
- {
- namespaceTable.addElementLineage((Element)parent);
- }
- }
- prefix = namespaceTable.getPrefixForURI(namespaceURI);
- }
- }
- }
- if (prefix != null && prefix.length() > 0)
- {
- result = prefix + ":" + result; //$NON-NLS-1$
- }
- }
- }
- return result;
- }
-
-
- public static String[] getURIQualifiedNameComponents(String uriQualifiedName)
- {
- String[] result = new String[2];
- int firstIndex = uriQualifiedName.indexOf("["); //$NON-NLS-1$
- int lastIndex = uriQualifiedName.indexOf("]"); //$NON-NLS-1$
- if (firstIndex != -1 && lastIndex > firstIndex)
- {
- result[0] = uriQualifiedName.substring(firstIndex + 1, lastIndex);
- result[1] = uriQualifiedName.substring(lastIndex + 1);
- }
- else
- {
- result[1] = uriQualifiedName;
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java
deleted file mode 100644
index 747efbc2af..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * DOMNamespaceInfoManager
- *
- *
- */
-public class DOMNamespaceInfoManager
-{
- public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- public DOMNamespaceInfoManager()
- {
- }
-
- public List getNamespaceInfoList(Element element)
- {
- NamespaceInfoReader reader = new NamespaceInfoReader();
- return reader.getNamespaceInfoList(element);
- }
-
- public void removeNamespaceInfo(Element element)
- {
- NamespaceInfoRemover remover = new NamespaceInfoRemover();
- remover.removeNamespaceInfo(element);
- }
-
- public void addNamespaceInfo(Element element, List namespaceInfoList, boolean needsXSI)
- {
- // first we create an xmlns attribute for each namespace
- //
- Document document = element.getOwnerDocument();
-
- String schemaLocationValue = ""; //$NON-NLS-1$
-
- for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext(); )
- {
- NamespaceInfo nsInfo = (NamespaceInfo)iterator.next();
- nsInfo.normalize();
-
- if (nsInfo.uri != null)
- {
- String attrName = nsInfo.prefix != null ? "xmlns:" + nsInfo.prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
- Attr namespaceAttr = document.createAttribute(attrName);
- namespaceAttr.setValue(nsInfo.uri);
- element.setAttributeNode(namespaceAttr);
-
- // in this case we use the attribute "xsi:schemaLocation"
- // here we build up its value
- //
- if (nsInfo.locationHint != null)
- {
- schemaLocationValue += nsInfo.uri;
- schemaLocationValue += " "; //$NON-NLS-1$
- schemaLocationValue += nsInfo.locationHint;
- schemaLocationValue += " "; //$NON-NLS-1$
- }
-
- if (nsInfo.uri.equals(XSI_URI))
- {
- needsXSI = false;
- }
- }
- else if (nsInfo.locationHint != null)
- {
- // in this case we use the attribute "xsi:noNamespaceSchemaLocation"
- //
- Attr attr = document.createAttribute("xsi:noNamespaceSchemaLocation"); //$NON-NLS-1$
- attr.setValue(nsInfo.locationHint);
- element.setAttributeNode(attr);
- }
- }
-
- if (needsXSI)
- {
- // we add an xmlns:xsi attribute to define 'xsi:schemaLocation' attribute
- //
- Attr attr = document.createAttribute("xmlns:xsi"); //$NON-NLS-1$
- attr.setValue(XSI_URI);
- element.setAttributeNode(attr);
- }
-
- if (schemaLocationValue.length() > 0)
- {
- // create the "xsi:schemaLocation" attribute
- //
- Attr attr = document.createAttribute("xsi:schemaLocation"); //$NON-NLS-1$
- attr.setValue(schemaLocationValue);
- element.setAttributeNode(attr);
- }
- }
-
- /**
- *
- */
- protected static class NamespaceInfoReader extends NamespaceAttributeVisitor
- {
- protected List namespaceInfoList = new Vector();
-
- public List getNamespaceInfoList(Element element)
- {
- visitElement(element);
- return namespaceInfoList;
- }
-
-
- public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
- {
- NamespaceInfo info = createNamespaceInfo();
- info.locationHint = value;
- }
-
- public void visitXMLNamespaceAttribute(Attr attr, String prefix, String uri)
- {
- NamespaceInfo info = createNamespaceInfo();
- info.uri = uri;
- info.prefix = prefix;
- super.visitXMLNamespaceAttribute(attr, prefix, uri);
- }
-
- public void visitXSISchemaLocationValuePair(String uri, String locationHint)
- {
- NamespaceInfo info = getNamespaceInfoForURI(uri);
- if (info != null)
- {
- info.locationHint = locationHint;
- }
- else
- {
- info = createNamespaceInfo();
- info.uri = uri;
- info.locationHint = locationHint;
- }
- }
-
- protected NamespaceInfo getNamespaceInfoForURI(String uri)
- {
- NamespaceInfo result = null;
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
- {
- NamespaceInfo info = (NamespaceInfo)i.next();
- if (info.uri != null && info.uri.equals(uri))
- {
- result = info;
- break;
- }
- }
- return result;
- }
-
- protected NamespaceInfo createNamespaceInfo()
- {
- NamespaceInfo info = new NamespaceInfo();
- namespaceInfoList.add(info);
- return info;
- }
- }
-
-
- /**
- *
- */
- protected static class NamespaceInfoRemover extends NamespaceAttributeVisitor
- {
- protected List attributesToRemove = new Vector();
-
- public void removeNamespaceInfo(Element element)
- {
- visitElement(element);
- removeAttributes();
- }
-
- public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
- {
- attributesToRemove.add(attr);
- }
-
- public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
- {
- attributesToRemove.add(attr);
- super.visitXMLNamespaceAttribute(attr, namespacePrefix, namespaceURI);
- }
-
- public void visitXSISchemaLocationAttribute(Attr attr, String value)
- {
- attributesToRemove.add(attr);
- }
-
- public void removeAttributes()
- {
- for (Iterator i = attributesToRemove.iterator(); i.hasNext(); )
- {
- Attr attr = (Attr)i.next();
- Element element = attr.getOwnerElement();
- if (element != null)
- {
- element.removeAttributeNode(attr);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java
deleted file mode 100644
index 0742f7bd8a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-// todo.. move this class to another package (perhaps xmlutility)
-//
-public class DOMVisitor
-{
- public void visitNode(Node node)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE :
- {
- visitAttr((Attr)node);
- break;
- }
- case Node.CDATA_SECTION_NODE :
- {
- visitCDATASection((CDATASection)node);
- break;
- }
- case Node.COMMENT_NODE :
- {
- visitComment((Comment)node);
- break;
- }
- case Node.DOCUMENT_NODE :
- {
- visitDocument((Document)node);
- break;
- }
- case Node.DOCUMENT_TYPE_NODE :
- {
- visitDocumentType((DocumentType)node);
- break;
- }
- case Node.ELEMENT_NODE :
- {
- visitElement((Element)node);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE :
- {
- visitProcessingInstruction((ProcessingInstruction)node);
- break;
- }
- case Node.TEXT_NODE :
- {
- visitText((Text)node);
- break;
- }
- }
- }
-
- protected void visitDocument(Document document)
- {
- visitChildNodesHelper(document);
- }
-
- protected void visitDocumentType(DocumentType doctype)
- {
-
- }
-
- protected void visitElement(Element element)
- {
- visitAttributesHelper(element);
- visitChildNodesHelper(element);
- }
-
-
- public void visitAttr(Attr attr)
- {
- }
-
- protected void visitText(Text text)
- {
- }
-
- protected void visitCDATASection(CDATASection cdataSection)
- {
- }
-
- protected void visitComment(Comment comment)
- {
- }
-
- protected void visitProcessingInstruction(ProcessingInstruction pi)
- {
- }
-
-
- protected void visitChildNodesHelper(Node node)
- {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++)
- {
- visitNode(children.item(i));
- }
- }
-
- protected void visitAttributesHelper(Node node)
- {
- NamedNodeMap map = node.getAttributes();
- for (int i = 0; i < map.getLength(); i++ )
- {
- visitNode(map.item(i));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
deleted file mode 100644
index 2d10d5209d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-import org.eclipse.osgi.util.TextProcessor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * This is a hacked up dom writer stolen from a Xerces sample.
- * I'd like to use an exisitng 'generic DOM' writer
- * If anyone can find such a thing then please go ahead and junk this.
- *
- * @version
- */
-public class DOMWriter
-{
- protected boolean formattingEnabled = true;
- protected boolean outputDoctypeEnabled = true;
- protected PrintWriter out;
- protected int indent = 0;
-
- public DOMWriter() throws UnsupportedEncodingException
- {
- this(System.out);
- }
-
- public DOMWriter(OutputStream outputSteam)
- {
- out = new PrintWriter(outputSteam);
- }
-
- public DOMWriter(Writer writer)
- {
- out = new PrintWriter(writer);
- }
-
- public void setFormattingEnabled(boolean enabled)
- {
- formattingEnabled = enabled;
- }
-
- public boolean getFormattingEnabled()
- {
- return formattingEnabled;
- }
-
- public void setOutputDoctypeEnabled(boolean enabled)
- {
- outputDoctypeEnabled = enabled;
- }
-
- public class XMLVisitor
- {
- protected boolean currentElementHasChildElements = false;
-
- public void visitNode(Node node)
- {
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE :
- {
- visitAttr((Attr)node);
- break;
- }
- case Node.CDATA_SECTION_NODE :
- {
- visitCDATASection((CDATASection)node);
- break;
- }
- case Node.COMMENT_NODE :
- {
- visitComment((Comment)node);
- break;
- }
- case Node.DOCUMENT_NODE :
- {
- visitDocument((Document)node);
- break;
- }
- case Node.DOCUMENT_TYPE_NODE :
- {
- visitDocumentType((DocumentType)node);
- break;
- }
- case Node.ELEMENT_NODE :
- {
- visitElement((Element)node);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE :
- {
- visitProcessingInstruction((ProcessingInstruction)node);
- break;
- }
- case Node.TEXT_NODE :
- {
- visitText((Text)node);
- break;
- }
- }
- }
-
- public void visitDocument(Document document)
- {
- visitChildNodesHelper(document);
- }
-
- public void visitDocumentType(DocumentType doctype)
- {
- if (outputDoctypeEnabled)
- {
- String data = getDocumentTypeData(doctype);
- print("<!DOCTYPE " + data + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void visitElement(Element element)
- {
- if (!doShow(element))
- return;
-
- boolean parentElementHasChildNodes = currentElementHasChildElements;
- currentElementHasChildElements = hasChildElements(element);
-
- printIndent();
- print("<"); //$NON-NLS-1$
- print(element.getNodeName());
- visitAttributesHelper(element);
-
- boolean hasChildNodes = element.getChildNodes().getLength() > 0;
- boolean isRootElement = element.getParentNode().getNodeType() == Node.DOCUMENT_NODE;
- if (hasChildNodes || isRootElement)
- {
- if (currentElementHasChildElements)
- {
- println(">"); //$NON-NLS-1$
- }
- else
- {
- print(">"); //$NON-NLS-1$
- }
- indent += 2;
- visitChildNodesHelper(element);
- indent -= 2;
-
- if (currentElementHasChildElements || isRootElement)
- {
- printIndent();
- }
- print("</"); //$NON-NLS-1$
- print(element.getNodeName());
- println(">"); //$NON-NLS-1$
- }
- else
- {
- println("/>"); //$NON-NLS-1$
- }
-
- currentElementHasChildElements = parentElementHasChildNodes;
- }
-
- public void visitAttr(Attr attr)
- {
- print(" "); //$NON-NLS-1$
- print(attr.getNodeName());
- print("=\""); //$NON-NLS-1$
- print(createPrintableCharacterData(attr.getValue()));
- print("\""); //$NON-NLS-1$
- }
-
- public void visitText(Text text)
- {
- if (currentElementHasChildElements)
- {
- printIndent();
- print(createPrintableCharacterData(text.getNodeValue()));
- println();
- }
- else
- {
- print(createPrintableCharacterData(text.getNodeValue()));
- }
- }
-
- public void visitCDATASection(CDATASection cdataSection)
- {
- }
-
- public void visitComment(Comment comment)
- {
- printIndent();
- print("<!--"); //$NON-NLS-1$
- print(comment.getNodeValue());
- println("-->"); //$NON-NLS-1$
- }
-
- public void visitProcessingInstruction(ProcessingInstruction pi)
- {
- printIndent();
- print("<?"); //$NON-NLS-1$
- print(pi.getNodeName());
- print(" "); //$NON-NLS-1$
- print(pi.getNodeValue());
- println("?>"); //$NON-NLS-1$
- }
-
-
- public boolean hasChildElements(Node node)
- {
- boolean result = false;
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++)
- {
- if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
- {
- result = true;
- break;
- }
- }
- return result;
- }
-
- public void visitChildNodesHelper(Node node)
- {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++)
- {
- visitNode(children.item(i));
- }
- }
-
- public void visitAttributesHelper(Node node)
- {
- NamedNodeMap map = node.getAttributes();
- for (int i = 0; i < map.getLength(); i++ )
- {
- visitNode(map.item(i));
- }
- }
- }
-
- /** an ugly hack until I restruct this code a little
- *
- */
- protected boolean doShow(Element element)
- {
- return true;
- }
-
- /** converts DOM text values to 'printable' values
- * - converts '&' to '&amp;'
- */
- protected String createPrintableCharacterData(String string)
- {
- String result = ""; //$NON-NLS-1$
- int index = 0;
- while (true)
- {
- int ampersandIndex = string.indexOf("&", index); //$NON-NLS-1$
- if (ampersandIndex != -1)
- {
- result += string.substring(index, ampersandIndex);
- result += "&amp;"; //$NON-NLS-1$
- index = ampersandIndex + 1;
- }
- else
- {
- break;
- }
- }
- result += string.substring(index);
- return result;
- }
-
-
- /** Prints the specified node, recursively. */
- public void print(Node node)
- {
- // is there anything to do?
- if (node != null)
- {
- XMLVisitor visitor = new XMLVisitor();
- visitor.visitNode(node);
- }
- out.flush();
- }
-
- /** a temporary hack to workaround our inability to create a DocumentType tag*/
- public void print(Document document, String grammarURL)
- {
- String systemId = null;
- if (grammarURL.endsWith("dtd")) //$NON-NLS-1$
- {
- int lastSlashIndex = Math.max(grammarURL.lastIndexOf("/"), grammarURL.lastIndexOf("\\")); //$NON-NLS-1$ //$NON-NLS-2$
- if (lastSlashIndex != -1)
- {
- systemId = grammarURL.substring(lastSlashIndex + 1);
- }
- }
- print(document, "UTF-8", grammarURL, null, systemId); //$NON-NLS-1$
-
- }
-
- /** a temporary hack to workaround our inability to create a DocumentType tag*/
- public void print(Document document, String encoding, String grammarFileName, String publicId, String systemId)
- {
- publicId = TextProcessor.process(publicId);
- systemId = TextProcessor.process(systemId);
- out.println("<?xml version=\"1.0\"" + " encoding=\"" + encoding + "\"?>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (grammarFileName.endsWith(".dtd")) //$NON-NLS-1$
- {
- String docTypeLine = "<!DOCTYPE " + document.getDocumentElement().getNodeName() + " "; //$NON-NLS-1$ //$NON-NLS-2$
- if (publicId != null)
- {
- docTypeLine += "PUBLIC \"" + publicId + "\" "; //$NON-NLS-1$ //$NON-NLS-2$
- if (systemId != null)
- {
- docTypeLine += "\"" + systemId + "\" "; //$NON-NLS-1$ //$NON-NLS-2$
- }
- docTypeLine += ">"; //$NON-NLS-1$
- out.println(docTypeLine);
- }
- else if (systemId != null)
- {
- docTypeLine += "SYSTEM \"" + systemId + "\" >"; //$NON-NLS-1$ //$NON-NLS-2$
- out.println(docTypeLine);
- }
- }
- print(document);
- }
-
- public static String getDocumentTypeData(DocumentType doctype)
- {
- String data = doctype.getName();
- if (doctype.getPublicId() != null)
- {
- data += " PUBLIC \"" + doctype.getPublicId() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- String systemId = doctype.getSystemId();
- if (systemId == null)
- {
- systemId = ""; //$NON-NLS-1$
- }
- data += " \"" + systemId + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- data += " SYSTEM \"" + doctype.getSystemId() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return data;
- }
-
- public void println()
- {
- if (formattingEnabled)
- {
- out.println();
- }
- }
-
- public void println(String string)
- {
- if (formattingEnabled)
- {
- out.println(string);
- }
- else
- {
- out.print(string);
- }
- }
-
- public void printIndent()
- {
- if (formattingEnabled)
- {
- for (int i = 0; i < indent; i++)
- {
- out.print(" "); //$NON-NLS-1$
- }
- }
- }
-
- public void print(String string)
- {
- out.print(string);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java
deleted file mode 100644
index d4a3c40384..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import java.util.Collection;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Element;
-
-
-// this interface is used to build a grammar document given a local file name
-//
-public interface InferredGrammarFactory
-{
- public CMDocument createCMDocument(String uri);
- public CMElementDeclaration createCMElementDeclaration(CMDocument cmDocument, Element element, boolean isLocal);
- public void createCMContent(CMDocument parentCMDocument, CMElementDeclaration parentEd, CMDocument childCMDocument, CMElementDeclaration childEd, boolean isLocal, String uri);
- public void debugPrint(Collection collection);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java
deleted file mode 100644
index 58d193d3d9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver - STAR - bug 198807 - attribute order dependancy.
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-public class NamespaceAttributeVisitor
-{
- public static final String XML_SCHEMA_INSTANCE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- public String xsiPrefix = "xsi"; //$NON-NLS-1$
-
- public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
- {
- if (namespaceURI.equals(XML_SCHEMA_INSTANCE_URI))
- {
- xsiPrefix = namespacePrefix;
- }
- }
-
- public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String value)
- {
- }
-
- public void visitXSISchemaLocationAttribute(Attr attr, String value)
- {
- StringTokenizer st = new StringTokenizer(value);
- while (true)
- {
- String nsURI = st.hasMoreTokens() ? st.nextToken() : null;
- String locationHint = st.hasMoreTokens() ? st.nextToken() : null;
- if (nsURI != null && locationHint != null)
- {
- visitXSISchemaLocationValuePair(nsURI, locationHint);
- }
- else
- {
- break;
- }
- }
- }
-
- public void visitXSISchemaLocationValuePair(String uri, String locationHint)
- {
- }
-
- public void visitElement(Element element)
- {
- NamedNodeMap map = element.getAttributes();
- int mapLength = map.getLength();
-
- // First retrieve all the namespaces so that they are loaded before
- // doing any special prefix handling. This allows the attributes to be
- // defined in any order, but the namespaces have to be retrieved first.
-
- for (int i = 0; i < mapLength; i++)
- {
- Attr attr = (Attr)map.item(i);
- String prefix = DOMNamespaceHelper.getPrefix(attr.getName());
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attr.getName());
- if (prefix != null && unprefixedName != null)
- {
- if (prefix.equals("xmlns")) //$NON-NLS-1$
- {
- visitXMLNamespaceAttribute(attr, unprefixedName, attr.getValue());
- }
- }
- else if (unprefixedName != null)
- {
- if (unprefixedName.equals("xmlns")) //$NON-NLS-1$
- {
- visitXMLNamespaceAttribute(attr, "", attr.getValue()); //$NON-NLS-1$
- }
- }
-
- }
-
- for (int i = 0; i < mapLength; i++)
- {
- Attr attr = (Attr)map.item(i);
- String prefix = DOMNamespaceHelper.getPrefix(attr.getName());
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attr.getName());
- if (prefix != null && unprefixedName != null)
- {
- if (prefix.equals(xsiPrefix) && unprefixedName.equals("schemaLocation")) //$NON-NLS-1$
- {
- visitXSISchemaLocationAttribute(attr, attr.getValue());
- }
- else if (prefix.equals(xsiPrefix) && unprefixedName.equals("noNamespaceSchemaLocation")) //$NON-NLS-1$
- {
- visitXSINoNamespaceSchemaLocationAttribute(attr, attr.getValue());
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java
deleted file mode 100644
index 56af91b55a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.core.internal.contentmodel.util;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-public class NamespaceInfo
-{
- public String uri;
- public String prefix;
- public String locationHint;
- public boolean isPrefixRequired;
- protected Hashtable hashtable;
-
- public NamespaceInfo()
- {
- }
-
- public NamespaceInfo(String uri, String prefix, String locationHint)
- {
- this.uri = uri;
- this.prefix = prefix;
- this.locationHint = locationHint;
- }
-
- public NamespaceInfo(NamespaceInfo that)
- {
- this.uri = that.uri;
- this.prefix = that.prefix;
- this.locationHint = that.locationHint;
- // todo... see if we need to clone the hastable
- }
-
- public void normalize()
- {
- uri = getNormalizedValue(uri);
- prefix = getNormalizedValue(prefix);
- locationHint= getNormalizedValue(locationHint);
- }
-
- protected String getNormalizedValue(String string)
- {
- return (string != null && string.trim().length() == 0) ? null : string;
- }
-
- public void setProperty(String property, Object value)
- {
- if (hashtable == null)
- {
- hashtable = new Hashtable();
- }
- hashtable.put(property, value);
- }
-
- public Object getProperty(String property)
- {
- return (hashtable != null) ? hashtable.get(property) : null;
- }
-
- public static List cloneNamespaceInfoList(List oldList)
- {
- List newList = new Vector(oldList.size());
- for (Iterator i = oldList.iterator(); i.hasNext(); )
- {
- NamespaceInfo oldInfo = (NamespaceInfo)i.next();
- newList.add(new NamespaceInfo(oldInfo));
- }
- return newList;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
deleted file mode 100644
index 71d115da76..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class NamespaceTable extends NamespaceAttributeVisitor
-{
- public Hashtable hashtable = new Hashtable();
-
-/**
- * @deprecated
- * @param document - no longer used
- */
-public NamespaceTable(Document document)
- {
- this();
- //DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
- //if (domExtension != null)
- //{
- // addNamespaceInfoList(domExtension.getImplictNamespaceInfoList(), true);
- // }
- }
-
- private NamespaceTable()
- {
- super();
- }
-
- public boolean isNamespaceEncountered()
- {
- return hashtable.values().size() > 0;
- }
-
- public String getPrefixForURI(String uri)
- {
- String result = null;
- NamespaceInfo entry = getNamespaceInfoForURI(uri, true);
- if (entry != null)
- {
- result = entry.prefix;
- }
- return result;
- }
-
-
- public String getURIForPrefix(String prefix)
- {
- String result = null;
- NamespaceInfo info = getNamespaceInfoForPrefix(prefix);
- if (info != null)
- {
- result = info.uri;
- }
- return result;
- }
-
-
- protected boolean isMatchingString(String a, String b)
- {
- return ((a == null && b == null) || (a != null && b != null && a.equals(b)));
- }
-
-
- public NamespaceInfo getNamespaceInfoForURI(String uri)
- {
- return getNamespaceInfoForURI(uri, false);
- }
-
-
- public NamespaceInfo getNamespaceInfoForURI(String uri, boolean testImplied)
- {
- NamespaceInfo result = null;
- for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
- {
- NamespaceInfo nsInfo = (NamespaceInfo)i.next();
- if (isMatchingString(nsInfo.uri, uri))
- {
- result = nsInfo;
- if (testImplied && nsInfo.getProperty("isImplied") != null) //$NON-NLS-1$
- {
- // continue
- }
- else
- {
- break;
- }
- }
- }
- return result;
- }
-
-
- public void setLocationHintForURI(String uri, String locationHint)
- {
- // List list = new Vector();
- for (Iterator i = hashtable.values().iterator(); i.hasNext(); )
- {
- NamespaceInfo nsInfo = (NamespaceInfo)i.next();
- if (isMatchingString(nsInfo.uri, uri))
- {
- nsInfo.locationHint = locationHint;
- }
- }
- }
-
-
- public NamespaceInfo getNamespaceInfoForPrefix(String prefix)
- {
- prefix = prefix != null ? prefix : ""; //$NON-NLS-1$
- return (NamespaceInfo)hashtable.get(prefix);
- }
-
-
- public void visitXMLNamespaceAttribute(Attr attr, String namespacePrefix, String namespaceURI)
- {
- NamespaceInfo nsInfo = new NamespaceInfo();
- nsInfo.prefix = namespacePrefix;
- nsInfo.uri = namespaceURI;
-
- NamespaceInfo matchingNamespaceInfo = getNamespaceInfoForURI(namespaceURI);
- if (matchingNamespaceInfo != null)
- {
- nsInfo.locationHint = matchingNamespaceInfo.locationHint;
- }
-
- internalAddNamespaceInfo(namespacePrefix, nsInfo);
-
- super.visitXMLNamespaceAttribute(attr, namespacePrefix, namespaceURI);
- }
-
- public void visitXSISchemaLocationValuePair(String uri, String locationHint)
- {
- setLocationHintForURI(uri, locationHint);
- }
-
- public void addNamespaceInfo(NamespaceInfo info)
- {
- String key = (info.prefix != null) ? info.prefix : ""; //$NON-NLS-1$
- internalAddNamespaceInfo(key, info);
- }
-
- protected void internalAddNamespaceInfo(String key, NamespaceInfo info)
- {
- hashtable.put(key, info);
- }
-
- protected void addNamespaceInfoList(List list, boolean isImplied)
- {
- if (list != null)
- {
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- NamespaceInfo info = (NamespaceInfo)i.next();
- NamespaceInfo clone = new NamespaceInfo(info);
- if (isImplied)
- {
- clone.setProperty("isImplied", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- addNamespaceInfo(clone);
- }
- }
- }
-
- public void addNamespaceInfoList(List list)
- {
- addNamespaceInfoList(list, false);
- }
-
- public void visitXSINoNamespaceSchemaLocationAttribute(Attr attr, String locationHint)
- {
- addNoNamespaceSchemaLocation(locationHint);
- }
-
- public void addNoNamespaceSchemaLocation(String locationHint)
- {
- NamespaceInfo nsInfo = new NamespaceInfo();
- nsInfo.prefix = null;
- nsInfo.uri = ""; //$NON-NLS-1$
- nsInfo.locationHint = locationHint;
- internalAddNamespaceInfo("", nsInfo); //$NON-NLS-1$
- }
-
- public void addNamespaceInfo(String prefix, String uri, String locationHint)
- {
- NamespaceInfo nsInfo = new NamespaceInfo();
- nsInfo.prefix = prefix;
- nsInfo.uri = uri;
- nsInfo.locationHint = locationHint;
- internalAddNamespaceInfo(prefix != null ? prefix : "", nsInfo); //$NON-NLS-1$
- }
-
- public void addElement(Element element)
- {
- visitElement(element);
- }
-
- public void addElementLineage(Element targetElement)
- {
- List list = NamespaceTable.getElementLineage(targetElement);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Element element = (Element)i.next();
- addElement(element);
- }
- }
-
- public static List getElementLineage(Element element)
- {
- List result = new ArrayList();
- for (Node node = element; node != null; node = node.getParentNode())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- result.add(0, node);
- }
- else
- {
- break;
- }
- }
- return result;
- }
-
- public Collection getNamespaceInfoCollection()
- {
- return hashtable.values();
- }
-
- public List getNamespaceInfoList()
- {
- List list = new Vector();
- list.addAll(hashtable.values());
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
deleted file mode 100644
index 5fd1041daf..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xml.core.internal.emf2xml;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.utilities.Assert;
-import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
-import org.eclipse.wst.common.internal.emf.utilities.FeatureValueConversionException;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.Logger;
-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.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class EMF2DOMSSEAdapter extends EMF2DOMAdapterImpl implements INodeAdapter {
-
- private Class resourceClass;
- public EMF2DOMSSEAdapter(Node node, EMF2DOMRenderer renderer, Translator translator) {
- super(node, renderer, translator);
- }
-
- public EMF2DOMSSEAdapter(Notifier object, Node node, EMF2DOMRenderer renderer, Translator translator) {
- super(object, node, renderer, translator);
- }
-
- public EMF2DOMSSEAdapter(TranslatorResource resource, Document document, EMF2DOMRenderer renderer, Translator translator) {
- super(resource, document, renderer, translator);
- }
-
- protected String calcIndentString(Node node) {
- Assert.isNotNull(node);
- Assert.isNotNull(node.getParentNode(), "Node must be connected into the tree"); //$NON-NLS-1$
-
- Node parent = node.getParentNode();
-
- String indentString = getNewlineString(node);
-
- // Find indentation string for this node based on its sibling or
- // parent
- Node previousSibling = DOMUtilities.getPreviousNodeSibling(node);
- if (previousSibling != null) {
- indentString = primGetIndentString(previousSibling);
- }
- else {
- String parentIndentString = primGetIndentString(parent);
- indentString = parentIndentString + DOMUtilities.INDENT_STRING;
- }
- return indentString;
- }
-
- /*
- * Prints out a DOM notification for debugging.
- */
- protected void debugDOMNotify(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue) {
- if (fDebug) {
- String notifType = ""; //$NON-NLS-1$
- switch (eventType) {
- case INodeNotifier.ADD :
- notifType = "ADD"; //$NON-NLS-1$
- break;
- case INodeNotifier.REMOVE :
- notifType = "REMOVE"; //$NON-NLS-1$
- break;
- case INodeNotifier.CHANGE :
- notifType = "CHANGE"; //$NON-NLS-1$
- break;
- case INodeNotifier.CONTENT_CHANGED :
- notifType = "CONTENT_CHANGED"; //$NON-NLS-1$
- break;
- case INodeNotifier.STRUCTURE_CHANGED :
- notifType = "STRUCTURE_CHANGE"; //$NON-NLS-1$
- break;
- }
- Logger.log(Logger.INFO_DEBUG, "DOM Change: " + notifType); //$NON-NLS-1$
- Logger.log(Logger.INFO_DEBUG, "\tnotifier : " + notifier); //$NON-NLS-1$
- Logger.log(Logger.INFO_DEBUG, "\tchangedFeature: " + changedFeature); //$NON-NLS-1$
- Logger.log(Logger.INFO_DEBUG, "\toldValue : " + oldValue); //$NON-NLS-1$
- Logger.log(Logger.INFO_DEBUG, "\tnewValue : " + newValue); //$NON-NLS-1$
- }
- }
-
- protected void disableUndoManagementIfNecessary() {
- IDOMModel model = getXMLModel();
- if (model != null && model.getUndoManager() != null)
- model.disableUndoManagement();
- }
-
- protected void enableUndoManagement() {
- IDOMModel model = getXMLModel();
- if (model != null && model.getUndoManager() != null)
- model.enableUndoManagement();
- }
-
- protected String getNewlineString(Node node) {
- /*
- * We should always have IDOMNode, and IStructuredDocument, and
- * consquently a valid "preferred" line delimiter, but just to be
- * safe, we'll assign something by default.
- */
- if (node instanceof IDOMNode) {
- IDOMNode xmlNode = (IDOMNode) node;
- IStructuredDocument document = xmlNode.getStructuredDocument();
- if (document != null) {
- return document.getLineDelimiter();
- }
- }
- return DOMUtilities.NEWLINE_STRING;
- }
-
- protected IDOMModel getXMLModel() {
- if (getNode() != null)
- return ((IDOMNode) getNode()).getModel();
- return null;
- }
-
- protected IDOMNode getXMLNode() {
- return (IDOMNode) getNode();
- }
-
- /*
- * Do nothing for SSE, we will tolerate anything they add
- */
- protected void handleFeatureValueConversionException(FeatureValueConversionException ex) {
- // Do nothing
- }
-
- /*
- * Do nothing for SSE, we will tolerate anything they add
- */
- protected void handleInvalidMultiNodes(String nodeName) {
- // Do nothing
- }
-
- protected void indent(Node node, Translator map) {
- Assert.isNotNull(node.getParentNode(), "Node must be connected into the tree"); //$NON-NLS-1$
- Assert.isNotNull(node);
-
- String indentString = calcIndentString(node);
-
- // Indent before the start tag
- indentStartTag(indentString, node, map);
-
- // Indent before the end tag
- indentEndTag(indentString, node, map);
- }
-
- /**
- * Indent before the end tag of the <node>passed in.
- */
- protected void indentEndTag(String indentString, Node node, Translator map) {
- if (!map.shouldIndentEndTag(node))
- return;
- String domPath = map.getDOMPath();
-
- if ((!map.isManagedByParent() && !map.isDOMTextValue()) || (map.isManagedByParent() && domPath.length() != 0) && node.getNodeName().equals(domPath)) {
- Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
- DOMUtilities.insertBeforeNode(node, newWS, null);
- }
- }
-
- /**
- * Indent before the start tag of the <node>passed in.
- */
- protected void indentStartTag(String indentString, Node node, Translator map) {
- Node parent = node.getParentNode();
- Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
- DOMUtilities.insertAfterNode(parent, newWS, DOMUtilities.getPreviousNodeSibling(node));
- }
-
- protected boolean isEmptyTag(Element parent) {
- return ((IDOMElement) parent).isEmptyTag();
- }
-
- /*
- * This method is called when the DOM node changes. It attempts to update
- * MOF object based on the changes.
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-
- if (!isNotificationEnabled())
- return;
-
- debugDOMNotify(notifier, eventType, changedFeature, oldValue, newValue);
-
- if (notifier != getNode() && eventType != INodeNotifier.CHANGE) {
- // This is the case where the notification was sent from a
- // sub node. Use the notifiers name to determine which
- // MOF feature to update. Note that is is assumed that if
- // the eventType is CHANGE then it attribute on a path node
- // changing. This was put in for the EGL group.
- if (notifier instanceof Element) {
- if (eventType == INodeNotifier.STRUCTURE_CHANGED || eventType == INodeNotifier.CONTENT_CHANGED || eventType == INodeNotifier.CHANGE) {
- Element notifyingNode = (Element) notifier;
- Translator map = findTranslator(notifyingNode.getNodeName(), false);
- if (map != null)
- updateMOFFeature(map, getNode(), getEObject());
- }
- }
- }
- else {
- // Update everything on STRUCTURE_CHANGE or CONTENT_CHANGE.
- // Other event types occur too often.
- if (eventType == INodeNotifier.STRUCTURE_CHANGED || eventType == INodeNotifier.CONTENT_CHANGED) {
- updateMOF();
- }
- // Update just the attribute that changed.
- else if (eventType == INodeNotifier.CHANGE) {
- Translator map = findTranslator(changedFeature.toString(), true);
- if (map != null)
- updateMOFFeature(map, getNode(), getEObject());
- }
- }
- }
-
- protected void postUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
- enableUndoManagement();
- }
-
- protected void preUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
- super.preUpdateDOMFeature(map, node, mofObject);
- disableUndoManagementIfNecessary();
- }
-
- protected void primAddDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
- ((IDOMNode) aNode).addAdapter((EMF2DOMSSEAdapter) anAdapter);
- }
-
- /**
- * Create an adapter for a child DOM node
- *
- * @param node
- * org.w3c.dom.Node The node to create the adapter for.
- */
- protected EMF2DOMAdapter primCreateAdapter(EObject mofObject, Translator childMap) {
- Element newNode = createNewNode(mofObject, childMap);
- return new EMF2DOMSSEAdapter(mofObject, newNode, fRenderer, childMap);
- }
-
- /**
- * Create an adapter for a child DOM node
- *
- * @param node
- * org.w3c.dom.Node The node to create the adapter for.
- */
- protected EMF2DOMAdapter primCreateAdapter(Node node, Translator childMap) {
- return new EMF2DOMSSEAdapter(node, fRenderer, childMap);
- }
- protected EMF2DOMAdapter createAdapter(Node node, Translator childMap) {
-
- //Assert.isNotNull(childMap.getChildAdapterClass());
- Assert.isNotNull(node);
-
- EMF2DOMAdapter adapter = primGetExistingAdapter(node,childMap);
-
- if (adapter != null) {
- if (adapter.isMOFProxy() || adapter.getTarget() == null) {
- removeDOMAdapter(node, adapter);
- if (adapter.getTarget() != null) {
- adapter.getTarget().eAdapters().remove(adapter);
- }
- adapter = null;
- }
- }
- if (adapter == null) {
- adapter = primCreateAdapter(node, childMap);
- }
- return adapter;
- }
- protected void addDOMAdapter(Node childNode) {
-
- // Only add the adapter if this is an child node that will not be
- // adapted. For instance a subtree that maps to a MOF attribute
- // setting.
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- EMF2DOMAdapter attrAdapter = primGetExistingAdapter(childNode);
-
- if (attrAdapter == null || attrAdapter.getNode() != getNode()) {
- // If the node is adapted, but not by this adapter then remove
- // it. This happens to non-object children when the parent tag
- // name is changed.
- removeDOMAdapter(childNode, attrAdapter);
-
- if (fDebug) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tCHILD: Adding DOM adapter: " + this); //$NON-NLS-1$
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\t\tto: " + childNode); //$NON-NLS-1$
- }
- primAddDOMAdapter(childNode, this);
- }
- }
- }
-
- protected EMF2DOMAdapter primGetExistingAdapter(Node aNode, Translator childMap) {
- INodeNotifier sseNode = (INodeNotifier) aNode;
- Collection adapters = sseNode.getAdapters();
- for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
- INodeAdapter adapter = (INodeAdapter) iterator.next();
- // First Check if it's an EMF2DOMAdapter
- if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
- // Cast to EMF2DOMAdapter
- EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
- Object adapterTarget = e2DAdapter.getTarget();
- //Translator adapterTranslator = e2DAdapter.fTranslator;
-
- //Handle the cases where either adapter's target is null
- if ((getTarget() == null) || (adapterTarget == null))
- if (resourceClass != null && resourceClass.equals(e2DAdapter.getResourceClass()))
- return e2DAdapter;
- else
- continue;
-
-
- // Check if target is an EMF resource
- if (getTarget() instanceof Resource) {
- /*
- * Now check if it's the right one (Multiple resources
- * could be attached)
- */
- if (adapterTarget != null && adapterTarget == getTarget()) {
- return e2DAdapter;
- }
- }
- else {
- // Check if targets are EObjects with the same resources
- EObject myTarget = (EObject) getTarget();
- /*
- * Now check if it's the right one (Multiple resources could
- * be attached)
- */
- if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
- return e2DAdapter;
- }
- }
-
- if (adapterTarget instanceof EObject) {
- if (((EObject) e2DAdapter.getTarget()).eResource() == null && e2DAdapter.fTranslator == childMap) {
- return e2DAdapter;
- }
- }
- }
- }
- return null;
- }
-
- protected EMF2DOMAdapter primGetExistingAdapter(Node aNode) {
- INodeNotifier sseNode = (INodeNotifier) aNode;
- Collection adapters = sseNode.getAdapters();
- for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
- INodeAdapter adapter = (INodeAdapter) iterator.next();
- // First Check if it's an EMF2DOMAdapter
- if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
- // Cast to EMF2DOMAdapter
- EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
- Object adapterTarget = e2DAdapter.getTarget();
-
- //Handle the cases where either adapter's target is null
- if ((getTarget() == null) || (adapterTarget == null))
- if (resourceClass != null && resourceClass.equals(e2DAdapter.getResourceClass()))
- return e2DAdapter;
- else
- continue;
-
-
- // Check if target is an EMF resource
- if (getTarget() instanceof Resource) {
- /*
- * Now check if it's the right one (Multiple resources
- * could be attached)
- */
- if (adapterTarget != null && adapterTarget == getTarget()) {
- return e2DAdapter;
- }
- }
- else {
- // Check if targets are EObjects with the same resources
- EObject myTarget = (EObject) getTarget();
- /*
- * Now check if it's the right one (Multiple resources could
- * be attached)
- */
- if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
- return e2DAdapter;
- }
- }
-
- if (adapterTarget instanceof EObject) {
- if (((EObject) e2DAdapter.getTarget()).eResource() == null) {
- return e2DAdapter;
- }
- }
- }
- }
- return null;
- }
-
- protected String primGetIndentString(Node node) {
- IStructuredDocument flatModel = ((IDOMNode) node).getStructuredDocument();
- int nodeStartOff = ((IDOMNode) node).getStartOffset();
-
- int startOff = Math.max(0, nodeStartOff - 100);
- int endOff = nodeStartOff;
-
- if(flatModel != null) {
- try {
- String text = flatModel.get(startOff, endOff - startOff);
-
- int inx = text.length() - 1;
- if (inx >= 0) {
- for (; inx >= 0; inx--) {
- char ch = text.charAt(inx);
- if (Character.isWhitespace(ch) && ch != '\n' && ch != '\r') {
- continue;
- }
- inx++;
- break;
- }
-
- return text.substring(inx);
- }
- }
- catch (BadLocationException ex) {
- Logger.logException(ex);
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- protected void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
- ((IDOMNode) aNode).removeAdapter((INodeAdapter) anAdapter);
- }
-
-
- protected void reorderDOMChild(Node parentNode, Node childNode, Node insertBeforeNode, Translator map) {
- super.reorderDOMChild(parentNode, childNode, insertBeforeNode, map);
- // Since reordering deletes all the whitespace before the node, we
- // must indent .
- if (insertBeforeNode != null && insertBeforeNode.getNodeType() == Node.ELEMENT_NODE)
- indentStartTag(calcIndentString(insertBeforeNode), insertBeforeNode, map);
- else
- indentStartTag(calcIndentString(childNode), childNode, map);
- }
-
- protected void setEmptyTag(Element element) {
- ((IDOMElement) element).setEmptyTag(true);
- }
-
- public void updateDOM() {
- if (!isNotificationEnabled())
- return;
- try {
- disableUndoManagementIfNecessary();
- primUpdateDOM();
- }
- finally {
- enableUndoManagement();
- }
- }
-
- public Class getResourceClass() {
- return resourceClass;
- }
-
- protected void initChildTranslators() {
- if (fRenderer != null && fRenderer.getResource() != null)
- resourceClass = fRenderer.getResource().getClass();
- super.initChildTranslators();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
deleted file mode 100644
index 40289d717e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.emf2xml;
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.common.internal.emfworkbench.integration.ResourceSetWorkbenchEditSynchronizer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
-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;
-
-
-public class EMF2DOMSSERenderer extends EMF2DOMRenderer implements IModelStateListener, IModelLifecycleListener {
-
- protected Object aboutToChangeNode = null;
-
- protected boolean isBatchChanges = false;
-
- private boolean isSaving = false;
-
- private IModelManager modelManager;
-
- private Class resourceClass;
-
- private boolean reverting = false;
-
- /** The XML DOM model */
- protected IDOMModel xmlModel;
-
- /** Used internally; the unique id for the xml model */
- protected String xmlModelId;
-
- protected boolean xmlModelReverted = false;
-
- public EMF2DOMSSERenderer() {
- super();
- }
-
- public void accessForRead() {
- if (!resource.isNew()) {
- String id = getModelManagerId();
- getModelManager().getExistingModelForRead(id);
- }
- }
-
- public void accessForWrite() {
- modelAccessForWrite();
- }
-
- /**
- * see batchModelEnd
- *
- */
-
- public void batchModeEnd() {
- getXMLModel().changedModel();
- setRootNodeAdapterNotificationEnabled(true);
- isBatchChanges = false;
- }
-
- /**
- * batchModeStart and batchModeEnd is a pair that controls notifications,
- * and tread access. They should always be called in a try/finally block.
- *
- * setBatchModel begins the processing where notifications are not sent
- * out on each change, but saved up until the endBatchMode called.
- *
- * This pair of calls can also, indirectly, "lock" the DOM Model to access
- * from only one thread, so it should not be locked for long periods of
- * time. That's also why it is important to have the endBatchMode in a
- * finally block to be sure it is always called, or the DOM will be left
- * in a locked, unusable, state and only shortly away from severere
- * program error.
- *
- * <pre><code>
- * Example
- * </code>
- *
- * try {
- * batchModelStart();
- * ...do a some work ...
- * }
- * finally {
- * endBatchMode();
- * }
- *
- *
- * </pre>
- */
- public void batchModeStart() {
- isBatchChanges = true;
- getXMLModel().aboutToChangeModel();
- setRootNodeAdapterNotificationEnabled(false);
- }
-
- private void cacheSynchronizationStamp() {
- IFile file = WorkbenchResourceHelper.getFile(resource);
- if (file != null) {
- if (xmlModel != null)
- xmlModel.resetSynchronizationStamp(file);
- }
- }
-
- /**
- * Create a new Document given
- *
- * @aResource.
- */
- protected void createDocument() {
- TranslatorResource res = getResource();
- res.setDefaults();
- IFile file = WorkbenchResourceHelper.getFile(resource);
- InputStream is = DOMUtilities.createHeaderInputStream(res.getDoctype(), res.getPublicId(), res.getSystemId());
- if (is == null)
- return;
- try {
- try {
- List folders = new ArrayList();
- IContainer container = file.getParent();
- while (null != container && !container.exists() && container instanceof IFolder) {
- folders.add(container);
- container = container.getParent();
- }
- IFolder folder = null;
- for (int i = 0; i < folders.size(); i++) {
- folder = (IFolder) folders.get(i);
- folder.create(true, true, null);
- }
- file.create(is, true, null);
- file.setLocal(true, 1, null);
- }
- catch (CoreException e1) {
- Logger.logException(e1);
- }
- finally {
- if (null != is) {
- is.close();
- }
- }
- initializeXMLModel(file, resource.getWriteCount() != 0);
- }
- catch (IOException ex) {
- Logger.log(Logger.ERROR, "IWAE0017E Unexpected IO exception occurred creating xml document");//$NON-NLS-1$
- }
- }
-
- protected void createDOMTreeIfNecessary() {
- if (needsToCreateDOM)
- createDOMTree();
- }
-
- protected EMF2DOMAdapter createRootDOMAdapter() {
- return new EMF2DOMSSEAdapter(getResource(), document, this, getResource().getRootTranslator());
- }
-
- public void deRegisterAsModelLifecycleListener() {
- if (xmlModel != null)
- xmlModel.removeModelLifecycleListener(this);
- }
-
- public void deRegisterAsModelStateListener() {
- if (xmlModel != null)
- xmlModel.removeModelStateListener(this);
- }
-
- private void deregisterFromXMLModel() {
-
- deRegisterAsModelStateListener();
- deRegisterAsModelLifecycleListener();
- // This try/catch block is a hack to fix defect 204114. This occurs
- // because
- // the model manager plugin is shut down and unloaded before the j2ee
- // plugin.
- // Calling getModelManager() can result in a class cast exception that
- // should
- // be ignored.
- // ModelManager mgr = null;
- try {
- getModelManager();
- }
- catch (ClassCastException exc) {
- return;
- }
- if (xmlModel != null) {
- int writeCount = resource.getWriteCount();
- int readCount = resource.getReadCount();
- for (int i = 0; i < writeCount; i++)
- xmlModel.releaseFromEdit();
- for (int ii = 0; ii < readCount; ii++)
- xmlModel.releaseFromRead();
- }
- EMF2DOMAdapter adapter = (EMF2DOMAdapter) EcoreUtil.getAdapter(resource.eAdapters(), EMF2DOMAdapter.ADAPTER_CLASS);
- if (adapter != null) {
- adapter.removeAdapters(adapter.getNode());
- }
- xmlModel = null;
- xmlModelId = null;
- }
-
- public void doSave(OutputStream outputStream, Map options) throws IOException {
-
- try {
- isSaving = true;
- if (null != outputStream) {
- throw new RuntimeException(this.getClass().getName() + " should not use an OutputStream for saving");} //$NON-NLS-1$
- createDOMTreeIfNecessary();
- ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
- IFile aFile = WorkbenchResourceHelper.getFile(resource);
- try {
- synchronizer.preSave(aFile, resource);
- xmlModel.save(aFile);
- }
- catch (CoreException ex) {
- synchronizer.removeFromRecentlySavedList(aFile);
- Logger.logException(ex);
- }
- cacheSynchronizationStamp();
- }
- finally {
- isSaving = false;
- }
- }
-
- public EMF2DOMAdapter getExistingDOMAdapter(Node node) {
- //IDOMNode xNode = (IDOMNode) node;
- //return (EMF2DOMSSEAdapter) xNode.getAdapterFor(EMF2DOMAdapter.ADAPTER_CLASS);
-
- INodeNotifier sseNode = (INodeNotifier) node;
- Collection adapters = sseNode.getAdapters();
- for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
- INodeAdapter adapter = (INodeAdapter) iterator.next();
- // First Check if it's an EMF2DOMAdapter
- if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
- // Cast to EMF2DOMSSEAdapter
- EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
- //Handle the cases where either adapter's target is null
- //Use the resourceClass to make sure the resource type is identical
- if (getResource() == null || e2DAdapter.getTarget() == null)
- if(resourceClass.equals(e2DAdapter.getResourceClass()))
- return e2DAdapter;
- else
- continue;
-
- // First check if targets are resources
- if (e2DAdapter.getTarget() instanceof Resource) {
- /*
- * Now check if it's the right one (Multiple resources
- * could be attached)
- */
- if (e2DAdapter.getTarget() == getResource()) {
- return e2DAdapter;
- }
- } else {
- // Check if targets are EObjects with the same resources
- TranslatorResource myTarget = getResource();
- EObject adapterTarget = (EObject) e2DAdapter.getTarget();
- /*
- * Now check if it's the right one (Multiple resources could
- * be attached)
- */
- if (adapterTarget.eResource() == myTarget || adapterTarget.eResource() == null) {
- return e2DAdapter;
- }
- }
- }
- }
- return null;
-
- }
-
- protected IModelManager getModelManager() {
- if (modelManager == null)
- modelManager = StructuredModelManager.getModelManager();
- return modelManager;
- }
-
- /**
- * Return id used to key the XML resource in the XML ModelManager.
- */
- protected String getModelManagerId() {
- if (xmlModelId == null) {
- IFile file = WorkbenchResourceHelper.getFile(getResource());
- if (file != null) {
- xmlModelId = getModelManager().calculateId(file);
- }
- else {
- xmlModelId = resource.getURI() + Long.toString(System.currentTimeMillis());
- }
- }
- return xmlModelId;
- }
-
- protected ResourceSet getResourceSet() {
- return resource == null ? null : resource.getResourceSet();
- }
-
- /**
- * Return the DOM model for this resource.
- */
- public IDOMModel getXMLModel() {
- return xmlModel;
- }
-
- public String getXMLModelId() {
- return xmlModelId;
- }
-
- private IDOMModel initializeXMLModel(IFile file, boolean forWrite) throws UnsupportedEncodingException, IOException {
- if (file == null || !file.exists())
- throw new FileNotFoundException((file == null) ? "null" : file.getFullPath().toOSString()); //$NON-NLS-1$
- try {
- IModelManager manager = getModelManager();
- String id = manager.calculateId(file);
- if (forWrite) {
- IDOMModel mod = (IDOMModel)manager.getExistingModelForEdit(id);
- if (mod == null)
- setXMLModel((IDOMModel) manager.getModelForEdit(file));
- else {
- setXMLModel(mod);
- }
- }
- else {
- IDOMModel mod = (IDOMModel)manager.getExistingModelForRead(id);
- if (mod == null)
- setXMLModel((IDOMModel) manager.getModelForRead(file));
- else {
- setXMLModel(mod);
- }
- }
- setXMLModelId(getXMLModel().getId());
- needsToCreateDOM = false;
- }
- catch (CoreException e) {
- Logger.logException(e);
- return null;
- }
- String id = getXMLModel().getId();
- syncReferenceCounts(id, forWrite);
- if (xmlModel != null)
- document = xmlModel.getDocument();
- return xmlModel;
- }
-
- public boolean isBatchMode() {
- return isBatchChanges;
- }
-
- public boolean isModified() {
- return (getXMLModel() != null && getXMLModel().isDirty());
- }
-
- public boolean isShared() {
-
- if( xmlModel == null) { //resource could be in process of being unloaded - check with model manager
- String id = getModelManagerId();
- return getModelManager().isShared(id);
- }
- if (getResourceSet() == null)
- return false;
- return xmlModel.isShared();
- }
-
- public boolean isSharedForWrite() {
- if (getResourceSet() == null || xmlModel == null)
- return false;
- return xmlModel.isSharedForEdit();
- }
-
- protected void loadDocument(InputStream in, Map options) throws IOException {
- if (null != in) {
- throw new RuntimeException(this.getClass().getName() + " should not use an InputStream for loading");} //$NON-NLS-1$
- IFile file = WorkbenchResourceHelper.getFile(resource);
- initializeXMLModel(file, (resource.getWriteCount() != 0));
- cacheSynchronizationStamp();
- }
-
- protected boolean managesDOMAdapters() {
- return false;
- }
-
- public void modelAboutToBeChanged(IStructuredModel model) {
- if (model.getStructuredDocument() != null)
- aboutToChangeNode = model.getStructuredDocument().getFirstStructuredDocumentRegion();
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- // TODO Auto-generated method stub
-
- }
-
- private void modelAccessForWrite() {
- String id = getModelManagerId();
- getModelManager().getExistingModelForEdit(id);
- }
-
- public void modelChanged(IStructuredModel model) {
- if (isBatchChanges)
- return;
- try {
- if (reverting && aboutToChangeNode != null && model.getStructuredDocument() != null
- && model.getStructuredDocument().getFirstStructuredDocumentRegion() != aboutToChangeNode) {
- String id = getModelManagerId();
- IStructuredModel tempModel = null;
- try {
- tempModel = getModelManager().getExistingModelForEdit(id);
- xmlModelReverted = true;
- resource.unload();
- } finally {
- if (tempModel != null && (tempModel.getReferenceCountForEdit() > 0)) {
- tempModel.releaseFromEdit();
- }
- reverting = false;
- }
- }
- } finally {
- aboutToChangeNode = null;
- }
- }
-
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- if (!isDirty && resource.isModified()) { // The XMLModel was saved
- resource.setModified(false);
- long stamp = WorkbenchResourceHelper.computeModificationStamp(resource);
- WorkbenchResourceHelper.setSynhronizationStamp(resource, stamp);
- IProject proj = WorkbenchResourceHelper.getProject(resource);
- ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) WorkbenchResourceHelperBase.getResourceSet(proj)).getSynchronizer();
- IFile aFile = WorkbenchResourceHelper.getFile(resource);
- synchronizer.preSave(aFile, resource);
- }
- if (isDirty)
- resource.setModified(true);
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- // TODO Auto-generated method stub
-
- }
-
- public void modelResourceDeleted(IStructuredModel model) {
- // Do nothing
- }
-
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- // Do nothing
- }
-
- /**
- * This method is called just prior to being removed from the ResourceSet.
- * Ensure that all reference counts to the XMLModel are removed.
- */
- public void preDelete() {
- if (resource.isLoaded())
- deregisterFromXMLModel();
- }
-
- public void preUnload() {
- deregisterFromXMLModel();
- }
-
- public void processPostModelEvent(ModelLifecycleEvent event) {
- if (event.getType() == ModelLifecycleEvent.MODEL_REVERT)
- reverting = false;
-
- }
-
- public void processPreModelEvent(ModelLifecycleEvent event) {
- if (event.getType() == ModelLifecycleEvent.MODEL_REVERT)
- reverting = true;
-
- if (!isSaving) {
- if (event.getType() == ModelLifecycleEvent.MODEL_SAVED) {
- ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
- IFile aFile = WorkbenchResourceHelper.getFile(resource);
- synchronizer.preSave(aFile, resource);
- }
- }
-
- }
-
-
- public void registerAsModelLifecycleListener() {
- this.xmlModel.addModelLifecycleListener(this);
- }
-
- /**
- * Insert the method's description here. Creation date: (9/7/2001 10:49:53
- * AM)
- */
- public void registerAsModelStateListener() {
- this.xmlModel.addModelStateListener(this);
- }
-
- public void releaseFromRead() {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
-
- public void releaseFromWrite() {
- if (xmlModel != null)
- xmlModel.releaseFromEdit();
- }
-
- public void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
- ((IDOMNode) aNode).removeAdapter((EMF2DOMSSEAdapter) anAdapter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.util.emf.xml.EMF2DOMRenderer#replaceDocumentType(java.lang.String,
- * java.lang.String, java.lang.String)
- */
- public void replaceDocumentType(String docTypeName, String publicId, String systemId) {
- if (document == null)
- return;
- DocumentTypeImpl docType = (DocumentTypeImpl) document.getDoctype();
- if (docType == null)
- return;
- if (publicId == null && systemId == null)
- document.removeChild(docType);
- else {
- docType.setPublicId(publicId);
- docType.setSystemId(systemId);
- }
- }
-
- /**
- * @deprecated use batchModeStart and BatchModeEnd instead even if you do
- * not use batchModelStart/End, you still need to use the
- * try/finally pattern documented there.
- */
-
- public void setBatchMode(boolean isBatch) {
-
- // This is some extra processing for clients to know they may be using
- // incorrectly
- if (isBatch) {
- if (isBatchChanges) {
- Logger.log(Logger.INFO_DEBUG, "setBatch was set to true when it was already true. This can be an indication of invalid calling order"); //$NON-NLS-1$
- }
- }
-
-
- if (isBatch) {
- batchModeStart();
- }
- else {
- batchModeEnd();
- }
- }
-
- private void setRootNodeAdapterNotificationEnabled(boolean b) {
- EObject root = resource.getRootObject();
- if (root != null) {
- EMF2DOMAdapter adapter = (EMF2DOMAdapter) EcoreUtil.getExistingAdapter(root, EMF2DOMAdapter.ADAPTER_CLASS);
- if (adapter != null) {
- adapter.setNotificationEnabled(b);
- if (b)
- adapter.updateDOM();
- }
- }
- }
-
- /**
- * Return the DOM model for this resource.
- */
- public void setXMLModel(IDOMModel xmlModel) {
- deRegisterAsModelStateListener();
- deRegisterAsModelLifecycleListener();
- this.xmlModel = xmlModel;
- registerAsModelStateListener();
- registerAsModelLifecycleListener();
- }
-
- public void setXMLModelId(String id) {
- xmlModelId = id;
- }
-
- private void syncReferenceCounts(String id, boolean forWrite) {
- int editIndex = 0, readIndex = 0;
- if (forWrite)
- editIndex++;
- else
- readIndex++;
- int writeCount = resource.getWriteCount();
- int readCount = resource.getReadCount();
- for (int i = writeCount; i > editIndex; i--)
- modelManager.getExistingModelForEdit(id);
- for (int i = readCount; i > readIndex; i--)
- modelManager.getExistingModelForRead(id);
- }
-
- public boolean useStreamsForIO() {
- return false;
- }
-
- public boolean wasReverted() {
- return xmlModelReverted;
- }
-
- public void setResource(TranslatorResource resource) {
- super.setResource(resource);
- if (resource != null)
- resourceClass = resource.getClass();
- }
- public boolean isReverting() {
- return this.reverting;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java
deleted file mode 100644
index 9b7912321d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java
+++ /dev/null
@@ -1,32 +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.xml.core.internal.emf2xml;
-
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-
-/**
- * @author schacher
- */
-public class EMF2DOMSSERendererFactory extends RendererFactory {
-
- public static final EMF2DOMSSERendererFactory INSTANCE = new EMF2DOMSSERendererFactory();
-
- public EMF2DOMSSERendererFactory() {
- // Default constructor
- }
-
-
- public Renderer createRenderer() {
- return new EMF2DOMSSERenderer();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
deleted file mode 100644
index 6c1dcdeeef..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
+++ /dev/null
@@ -1,73 +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.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public abstract class ComponentSearchContributor {
-
- protected HashMap declarations;
-
- protected HashMap references;
-
- protected String[] namespaces;
-
- public ComponentSearchContributor() {
- super();
- }
-
- public XMLSearchPattern getDeclarationPattern(QualifiedName componentName) {
- return (XMLSearchPattern) getDeclarations().get(componentName);
- }
-
- protected Map getDeclarations() {
- if (declarations == null) {
- initializeDeclarations();
- }
- return declarations;
- }
-
- protected Map getReferences() {
- if (references == null) {
- initializeReferences();
- }
- return references;
- }
-
- public XMLSearchPattern[] getReferencesPatterns(QualifiedName componentName) {
- List references = (List) getReferences().get(componentName);
- if (references != null) {
- return (XMLSearchPattern[]) references
- .toArray(new XMLSearchPattern[references.size()]);
- }
- return new XMLSearchPattern[0];
- }
-
-
- public boolean supports(QualifiedName componentName){
- return getReferencesPatterns(componentName).length > 0 ||
- getDeclarationPattern(componentName) != null;
- }
-
- public String[] getSupportedNamespaces() {
- return namespaces;
- }
-
- protected abstract void initializeDeclarations();
-
- protected abstract void initializeReferences();
-
- protected abstract void initializeSupportedNamespaces();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
deleted file mode 100644
index 6321b7c3b1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
+++ /dev/null
@@ -1,30 +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.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class TargetNamespaceReferencePattern extends SearchPattern {
-
- String namespaceURI;
-
- public TargetNamespaceReferencePattern(int matchRule, String namespaceuri) {
- super(matchRule);
- namespaceURI = namespaceuri;
- }
-
- public TargetNamespaceReferencePattern(String namespaceuri) {
- super();
- namespaceURI = namespaceuri;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
deleted file mode 100644
index 19f475beb1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
+++ /dev/null
@@ -1,34 +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.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentDeclarationPattern extends XMLComponentSearchPattern {
-
- public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
- super(null, elementQName, typeQName, matchRule);
-
- }
-
- public XMLComponentDeclarationPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
- super(file, elementQName, typeQName);
- }
-
- public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName) {
- super(null, elementQName, typeQName);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
deleted file mode 100644
index e68a8a422a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.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.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentReferencePattern extends XMLComponentSearchPattern{
-
- public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
- super(file, elementQName, typeQName, matchRule);
-
- }
-
- public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
- super(file, elementQName, typeQName);
-
- }
-
- public XMLComponentReferencePattern(QualifiedName elementQName, QualifiedName typeQName) {
- super(null, elementQName, typeQName);
-
- }
-
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
deleted file mode 100644
index dff3048c6a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
+++ /dev/null
@@ -1,96 +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.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-/**
- * XML component search pattern is a composite pattern that combines XML element pattern.
- *
- */
-public class XMLComponentSearchPattern extends ComponentSearchPattern {
-
- /**
- * Containing element patterns
- * @deprecated
- */
- XMLSearchPattern[] children = new XMLSearchPattern[0];
-
- /**
- * A map of XMLSearchPattern[] by {@link SearchParticipant search participant}.
- */
- protected Map childPatternsByParticipant = new HashMap();
-
- public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
- super(file, elementQName, typeQName, matchRule);
-
- }
-
-
- public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
- super(file, elementQName, typeQName);
-
- }
-
- /**
- * @deprecated Use {@link #getChildren(SearchParticipant)} instead.
- */
- public XMLSearchPattern[] getChildren(){
- return children;
- }
-
- /**
- * @deprecated Use {@link #addChildren(SearchParticipant, XMLSearchPattern[])} instead.
- */
- public void setChildren(XMLSearchPattern[] patterns){
- children = patterns;
-
- }
-
- /**
- * Provides the child patterns contributed by the given search participant.
- * @param searchParticipant the {@link SearchParticipant search participant} that contributed the patterns.
- * @see XMLComponentSearchPattern#addChildren(SearchParticipant, XMLSearchPattern[]) addChildren
- * @return an array with the {@link XMLSearchPattern patterns} contributed by the {@link SearchParticipant search participant}.
- */
- public XMLSearchPattern[] getChildren(SearchParticipant searchParticipant){
- XMLSearchPattern[] childPatterns = getChildren();
- if (searchParticipant != null){
- childPatterns = (XMLSearchPattern[])childPatternsByParticipant.get(searchParticipant);
- if (childPatterns == null){
- childPatterns = getChildren();
- }
- }
- return childPatterns;
- }
-
- /**
- * Saves the child patterns contributed by the given search participant.
- * @param searchParticipant the {@link SearchParticipant search participant} that is contributing the child search patterns.
- * @param childPatterns the child patterns contributed by the {@link SearchParticipant searchParticipant search participant}.
- * @see XMLComponentSearchPattern#getChildren(SearchParticipant) getChildren
- */
- public void addChildren(SearchParticipant searchParticipant, XMLSearchPattern[] childPatterns){
- if (searchParticipant != null && childPatterns != null) {
- childPatternsByParticipant.put(searchParticipant, childPatterns);
- }
- else {
- children = childPatterns;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
deleted file mode 100644
index b709f58b74..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
+++ /dev/null
@@ -1,387 +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.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.document.SearchDocumentSet;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.FileReferencePattern;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.ContentTypeSearchScope;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-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.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.impl.XMLSearchDocument;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.XMLSearchPatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.quickscan.XMLQuickScan;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- */
-public abstract class XMLSearchParticipant extends SearchParticipant {
-
- protected static final boolean debugPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.core.internal.search/perf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- public XMLSearchParticipant() {
- super();
- }
-
-
- /*
- public boolean initialize(SearchPattern pattern, String[] contentTypes){
-
- super.initialize(pattern, contentTypes);
- this.supportedContentTypes = contentTypes;
-
- if(pattern instanceof XMLComponentSearchPattern){
- return true;
- }
- return false;
- }*/
-
-
-
- public SearchDocument createSearchDocument(String documentPath) {
-
- return new XMLSearchDocument(documentPath, this);
-
- }
-
- public String getDescription() {
- return "XML search participant"; //$NON-NLS-1$
- }
-
-
-
- private void locateMatches(SearchPattern pattern, SearchDocument document,
- SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) {
-
- // TODO... utilize search options (that should get passed down via the SearchEngine)
- // to specify if accurate source coordinates are req'd if not, simply use the SAX results
- //
- if (pattern.getMatchRule() == SearchPattern.R_PATTERN_MATCH)
- {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(document.getPath()));
- // TODO.. don't assume the category is COMPONENT_DECL... handle any arbitarty category
- Entry[] entries = document.getEntries(IXMLSearchConstants.COMPONENT_DECL, null, 0);
- for (int i = 0; i < entries.length; i++)
- {
- // TODO.. don't assume this is just a component declaration entry
- ComponentDeclarationEntry entry = (ComponentDeclarationEntry)entries[i];
- SearchMatch searchMatch = new SearchMatch(null, 0, 0, file);
- searchMatch.map.put("name", entry.getName()); //$NON-NLS-1$
- searchMatch.map.put("metaName", entry.getMetaName()); //$NON-NLS-1$
- try
- {
- requestor.acceptSearchMatch(searchMatch);
- }
- catch (Exception e)
- {
- }
- }
- }
- else
- { if (document.getModel() instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) document.getModel();
- IDOMElement contextNode = (IDOMElement) domModel.getDocument()
- .getDocumentElement();
- DOMVisitor visitor = new DOMVisitor(document.getPath(), pattern,
- requestor);
- visitor.visit(contextNode);
- }
- }
- }
-
- private PatternMatcher getAdapter(Object adaptableObject, Class adapterType) {
- if (PatternMatcher.class.equals(adapterType) &&
- (adaptableObject instanceof XMLSearchPattern ||
- adaptableObject instanceof XMLComponentSearchPattern) ) {
- return new XMLSearchPatternMatcher(this);
- }
- return null;
- }
-
- private class DOMVisitor {
-
- String path;
- SearchPattern pattern;
- SearchRequestor requestor;
- PatternMatcher matcher;
-
-
- protected DOMVisitor(String path, SearchPattern pattern,
- SearchRequestor requestor) {
- super();
- this.path = path;
- this.pattern = pattern;
-
- matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
- if(matcher == null){
- matcher = getAdapter(pattern, PatternMatcher.class);
- }
- this.requestor = requestor;
- }
-
- private void visit(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- match((Element)node);
- NodeList nodeList = node.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node aNode = nodeList.item(i);
- visit(aNode);
- }
- }
- }
-
- private void match(Element node) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
- new Path(path));
- if(matcher != null){
- matcher.locateMatches(pattern, file, node, requestor);
- }
-
-
- }
-
- }
-
- public SearchScope selectDocumentLocations(SearchPattern pattern, SearchScope scope, Map searchOptions, IProgressMonitor monitor) {
- /*
- * gate #1: reduce the scope to the files with the content type that
- * could be searched using this participant
- */
- String[] contentTypes = getSupportedContentTypes();
- if(contentTypes != null && contentTypes.length > 0){
- scope = new ContentTypeSearchScope(scope, contentTypes);
- }
- return super.selectDocumentLocations(pattern, scope, searchOptions, monitor);
- }
-
- public abstract ComponentSearchContributor getSearchContributor();
-
-
- public void beginSearching(SearchPattern pattern, Map searchOptions) {
-
- super.beginSearching(pattern, searchOptions);
- if(pattern instanceof XMLComponentDeclarationPattern){
- XMLComponentDeclarationPattern componentPattern = (XMLComponentDeclarationPattern)pattern;
- XMLSearchPattern childPattern = getSearchContributor().getDeclarationPattern(componentPattern.getMetaName());
- if(childPattern != null){
- childPattern.setSearchName(componentPattern.getName().getLocalName());
- childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
- componentPattern.addChildren(this, new XMLSearchPattern[]{childPattern});
- }
-
- }
- else if(pattern instanceof XMLComponentReferencePattern){
- XMLComponentReferencePattern componentPattern = (XMLComponentReferencePattern)pattern;
- XMLSearchPattern[] childPatterns = getSearchContributor().getReferencesPatterns(componentPattern.getMetaName());
- for (int i = 0; i < childPatterns.length; i++) {
- XMLSearchPattern childPattern = childPatterns[i];
- childPattern.setSearchName(componentPattern.getName().getLocalName());
- childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
- }
- componentPattern.addChildren(this, childPatterns);
-
- }
- }
-
-
- /**
- * The intend of this method is to limit the search to the files that have content
- * which can be searched for the given pattern. It is called from
- * {@link #selectDocumentLocations(SearchPattern, SearchScope, IProgressMonitor)}
- *
- * @param pattern the search pattern that is searched for
- * @return content type's unique identifiers that could be searched for the given pattern.
- */
- public abstract String[] getSupportedContentTypes();
-
- public void populateSearchDocument(SearchDocument document, SearchPattern pattern)
- {
- PatternMatcher matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
- if(matcher == null){
- matcher = getAdapter(pattern, PatternMatcher.class);
- }
- XMLQuickScan.populateSearchDocument(document, matcher, pattern);
- }
-
- public void locateMatches(SearchDocumentSet documentSet, SearchPattern pattern, SearchScope scope, SearchRequestor requestor, Map searchOptions, IProgressMonitor monitor) throws CoreException
- {
- long time = System.currentTimeMillis();
-
- // TODO: use the file reference entries in the documents to reduce the scope to the referenced files only
- // SearchDocument[] documents = documentSet.getSearchDocuments(id);
-
- // check to see if the search pattern is qualified by a file location
- // if this is the case then we can use file scoping rules to prune the matches
- IFile targetFile = null;
- if (pattern instanceof ComponentSearchPattern)
- {
- ComponentSearchPattern componentSearchPattern = (ComponentSearchPattern)pattern;
- targetFile = componentSearchPattern.getFile();
- }
-
- // here we should have in scope only referenced files
- IFile[] files = scope.enclosingFiles();
- for (int i = 0; i < files.length; i++)
- {
- IFile file = files[i];
- String path = file.getLocation().toString();
- SearchDocument document = documentSet.getSearchDocument(path, id);
- if (document != null)
- {
- Entry[] entries = document.getEntries(getSearchEntryCategory(pattern), null, 0);
- if ((entries != null && entries.length > 0) || (searchOptions != null && searchOptions.get("searchDirtyContent") != null))
- {
- //for (int j = 0; j < entries.length; j++)
- //{
- // Entry entry = entries[j];
- //System.out.println("entry " + entry.getCategory() + " " + entry.getKey() + " " + entry.getClass().getName());
- //}
-
- boolean isInScope = true;
- if (targetFile != null)
- {
- try
- {
- isInScope = isLinked(documentSet, "file:///" + path, "file:///" + targetFile.getLocation().toString()); //$NON-NLS-1$ //$NON-NLS-2$
- //if (path.endsWith("CancelSelection.wsdl") && path.indexOf("clone1") != -1)
- //{
- // fileReferenceTable.debug(qualifiedPath, 0, 5);
- //}
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- if (isInScope)
- {
- this.locateMatches(pattern, document, requestor, searchOptions, monitor);
- }
- }
- }
- }
-
-
- if (debugPerf)
- {
- System.out
- .println("" //$NON-NLS-1$
- + getDescription()
- + ": " + (System.currentTimeMillis() - time) + "ms for locateMatches"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- }
-
- private boolean isLinked(SearchDocumentSet set, String source, String target)
- {
- return isLinked(set, source, target, new HashMap());
- }
-
- private boolean isLinked(SearchDocumentSet set, String source, String target, HashMap visited)
- {
- if (source.equals(target))
- return true;
-
- String fileProtocol = "file:///"; //$NON-NLS-1$
-
- // Fix for bug 204174 - Begin
- if(target.charAt(fileProtocol.length()) == '/') //$NON-NLS-1$
- {
- target = fileProtocol + target.substring(fileProtocol.length() + 1);
- }
- // Fix for bug 204174 - End
-
- if (source.startsWith(fileProtocol))
- {
-
- SearchDocument document = set._tempGetSearchDocumetn(source.substring(fileProtocol.length()));
- if (document != null)
- {
- URIResolver uriResolver = URIResolverPlugin.createResolver();
- Entry[] entries = document.getEntries(IXMLSearchConstants.REF, null, 0);
- String[] resolveEntry = new String[entries.length];
- for (int j = 0; j < entries.length; j++)
- {
- Entry entry = entries[j];
- if (entry instanceof FileReferenceEntry)
- {
- FileReferenceEntry fileReferenceEntry = (FileReferenceEntry)entry;
- // TODO.. record an utilize the public id from the fileReferenceEntry
- //
- if (fileReferenceEntry.getRelativeFilePath() != null)
- {
- String resolvedURI = uriResolver.resolve(source, null, fileReferenceEntry.getRelativeFilePath());
- resolveEntry[j] = resolvedURI;
- if (resolvedURI.equals(target))
- {
- return true;
- }
- }
- }
- }
- // now see if there's an indirect link from the source to the target
- // we keep track of the nodes we've already visited to avoid cycles
- if (visited.get(source) == null)
- {
- visited.put(source, Boolean.TRUE);
- for (int j = 0; j < entries.length; j++)
- {
- String resolvedURI = resolveEntry[j];
- if (resolvedURI != null && isLinked(set, resolveEntry[j], target, visited))
- return true;
- }
- }
- }
- }
- return false;
- }
-
-
-
- public static String getSearchEntryCategory(SearchPattern pattern){
- if(pattern instanceof XMLComponentDeclarationPattern){
- return IXMLSearchConstants.COMPONENT_DECL;
- }
- else if(pattern instanceof XMLComponentReferencePattern){
- return IXMLSearchConstants.COMPONENT_REF;
- }
- else if(pattern instanceof FileReferencePattern){
- return IXMLSearchConstants.COMPONENT_REF;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
deleted file mode 100644
index 7bc2a6aae4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.matching.SAXSearchElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import com.ibm.icu.util.StringTokenizer;
-
-public class XMLSearchPattern extends SearchPattern{
-
- private String elementNamespace = null;
- private String elementName = null;
- private String attributeName = null;
- private String searchName = null;
- private String searchNamespace = null;
- private String parentName = null;
- private int depth = -1;
- private SAXSearchElement element = null;
- private Element domElement = null;
-
- public XMLSearchPattern(String elementNamespace, String parentElementName,String elementName, String attributeName) {
- this(elementNamespace, parentElementName, elementName, attributeName, -1);
- }
-
- public XMLSearchPattern(String elementNamespace, String elementName, String attributeName) {
- this(elementNamespace, null, elementName, attributeName, -1);
- }
-
- public XMLSearchPattern(String elementNamespace, String elementName, String attributeName, int depth) {
- this(elementNamespace, null, elementName, attributeName, depth);
- }
-
- private XMLSearchPattern(String elementNamespace, String parentElementName, String elementName, String attributeName, int depth) {
- super();
- this.attributeName = attributeName;
- this.elementName = elementName;
- this.parentName = parentElementName;
- this.elementNamespace = elementNamespace;
- this.depth = depth;
- }
-
- public XMLSearchPattern(){
-
- }
-
- public String getAttributeName() {
- return attributeName;
- }
-
- public String getElementName() {
- return elementName;
- }
-
- public String getElementNamespace() {
- return elementNamespace;
- }
-
- public String getSearchName() {
- return searchName;
- }
-
- public String getSearchNamespace() {
- return searchNamespace;
- }
-
- public void setSearchName(String searchName) {
- this.searchName = searchName;
- }
-
- public void setSearchNamespace(String searchNamespace) {
- this.searchNamespace = searchNamespace;
- }
-
- public void setAttributeName(String attributeName) {
- this.attributeName = attributeName;
- }
-
- public void setElementName(String elementName) {
- this.elementName = elementName;
- }
-
- public void setElementNamespace(String elementNamespace) {
- this.elementNamespace = elementNamespace;
- }
-
- public void setSearchElement(SAXSearchElement element) {
- this.element = element;
- }
-
- public void setSearchElement(Element element) {
- domElement = element;
- }
-
- public boolean matches(XMLSearchPattern pattern) {
- if (pattern.searchName == null)
- return false;
- if ("*".equals(searchName) && "*".equals(searchNamespace)) { //$NON-NLS-1$ //$NON-NLS-2$
- return true;
- }
-
- final StringTokenizer tokenizer = new StringTokenizer(pattern.searchName);
- while (tokenizer.hasMoreTokens()) {
- final String token = tokenizer.nextToken();
- int n = token.indexOf(":"); //$NON-NLS-1$
- String name = token;
- String namespace = pattern.searchNamespace; // accept the default
- if(n > 0) {
- final String prefix = token.substring(0, n);
- name = token.substring(n+1);
- namespace = pattern.element != null ? (String)pattern.element.getNamespaceMap().get(prefix) : computeNamespaceForPrefix(pattern.domElement, prefix);
- }
-
- if (namespace == null) {
- if (name.equals(searchName) || "*".equals(searchName))
- return true;
- }
- else {
- if ((namespace.equals(searchNamespace) || "*".equals(searchNamespace)) && name.equals(searchName))
- return true;
- }
- }
- return false;
- }
-
- protected String computeNamespaceForPrefix(Element element, String prefix)
- {
- String result = null;
- for (Node node = element; node != null; node = node.getParentNode())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element e = (Element)node;
- String attributeName = (prefix != null && prefix.length() > 0) ? ("xmlns:" + prefix) : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
- result = e.hasAttribute(attributeName) ? e.getAttribute(attributeName) : null;
- if (result != null && result.length() > 0)
- {
- break;
- }
- }
- }
- return result;
- }
-
- public int getDepth()
- {
- return depth;
- }
-
- public void setDepth(int depth)
- {
- this.depth = depth;
- }
-
-public String getParentName() {
- return parentName;
-}
-
-public void setParentName(String parentName) {
- this.parentName = parentName;
-}
-
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
deleted file mode 100644
index d160d819ea..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
+++ /dev/null
@@ -1,20 +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.xml.core.internal.search.impl;
-
-public interface IXMLSearchConstants
-{
- String REF= "outLink"; //$NON-NLS-1$
- String COMPONENT_DECL = "componentDecl"; //$NON-NLS-1$
- String COMPONENT_REF = "componentDecl"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
deleted file mode 100644
index d7ae22f5c2..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
+++ /dev/null
@@ -1,73 +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.xml.core.internal.search.impl;
-
-import java.text.MessageFormat;
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.search.messages";//$NON-NLS-1$
-
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
- private Messages() {
- // Do not instantiate
- }
-
- /**
- * Bind the given message's substitution locations with the given string values.
- *
- * @param message the message to be manipulated
- * @return the manipulated String
- */
- public static String bind(String message) {
- return bind(message, null);
- }
-
- /**
- * Bind the given message's substitution locations with the given string values.
- *
- * @param message the message to be manipulated
- * @param binding the object to be inserted into the message
- * @return the manipulated String
- */
- public static String bind(String message, Object binding) {
- return bind(message, new Object[] {binding});
- }
-
- /**
- * Bind the given message's substitution locations with the given string values.
- *
- * @param message the message to be manipulated
- * @param binding1 An object to be inserted into the message
- * @param binding2 A second object to be inserted into the message
- * @return the manipulated String
- */
- public static String bind(String message, Object binding1, Object binding2) {
- return bind(message, new Object[] {binding1, binding2});
- }
-
- /**
- * Bind the given message's substitution locations with the given string values.
- *
- * @param message the message to be manipulated
- * @param bindings An array of objects to be inserted into the message
- * @return the manipulated String
- */
- public static String bind(String message, Object[] bindings) {
- return MessageFormat.format(message, bindings);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
deleted file mode 100644
index 7908adfac8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
+++ /dev/null
@@ -1,105 +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.xml.core.internal.search.impl;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XMLSearchDocument extends SearchDocument {
-
- IDOMModel model;
- Map entries = new HashMap(); // category -> set (entry)
-
- public XMLSearchDocument(String documentPath, XMLSearchParticipant participant) {
- super(documentPath, participant);
- }
-
- public Object getModel() {
- if(model == null){
- //System.out.println("creating DOM for " + getPath());
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(getPath()));
- if(file != null){
- try {
- model = (IDOMModel)StructuredModelManager.getModelManager().getModelForEdit(file);
- } catch (IOException e) {
- e.printStackTrace();
- } catch (CoreException e) {
- e.printStackTrace();
- }
-
- }
- }
- return model;
- }
-
- public Entry[] getEntries(String category, String key, int matchRule)
- {
- // TODO use matchRule
- Set results = new HashSet();
- if(category != null){
- Set values = (Set)entries.get(category);
- if(values == null){
- return new Entry[0];
- }
- if(key == null || "".equals(key) || "*".equals(key)){ //$NON-NLS-1$ //$NON-NLS-2$
- // entries with any key in the given category
- results.addAll(values);
- }
- else{
- // entries with the specified key in the given category
- for (Iterator iter = values.iterator(); iter.hasNext();)
- {
- Entry entry = (Entry) iter.next();
- if(key.equals(entry.getKey())){
- results.add(entry);
- }
- }
- }
-
- }
- return (Entry[]) results.toArray(new Entry[results.size()]);
- }
-
- public void putEntry(Entry entry)
- {
- if(entry.getCategory() != null){
- Set values = (Set)entries.get(entry.getCategory());
- if(values == null){
- entries.put(entry.getCategory(), values=new HashSet());
- }
- values.add(entry);
- }
-
- }
-
- public void dispose()
- {
- if (model != null)
- {
- model.releaseFromEdit();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
deleted file mode 100644
index 43aea953b7..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
+++ /dev/null
@@ -1,10 +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
-###############################################################################
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
deleted file mode 100644
index fa518e83f5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
+++ /dev/null
@@ -1,79 +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.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * This class contains matching implementation.
- * <p>
- * Subclasses of the PatternMatches should provide an implementation of the specific pattern matching.
- * </p>
- * <p>
- * Subclasses of the PatternMatches should be set as adapters for the patterns that they match.
- * </p>
- * An implementation of {@link org.eclipse.wst.common.core.search.SearchParticipant#selectDocumentLocations()} will call
- * { @link PatternMatcher#matches() } on the adapter on pattern matcher.
- *
- * An implementation of {@link org.eclipse.wst.common.core.search.SearchParticipant#locateMatches()} will call
- * { @link PatternMatcher#locateMatches() } on the adapter on pattern matcher.
- *
- */
-public abstract class PatternMatcher {
-
-
- /**
- * This method does dive actual match location to the requestor if there are matches
- */
- public abstract void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor);
-
- /**
- * This method only answers if the pattern matches element, it does not give actual match location
- */
- public abstract boolean matches(SearchPattern pattern, Object element);
-
- protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
- {
- int start = 0;
- int length = 0;
- if(attributeNode instanceof IDOMAttr){
- IDOMAttr domAttr = (IDOMAttr)attributeNode;
- start = domAttr.getValueRegionStartOffset();
- length = domAttr.getValueRegionText().length();
- }
- SearchMatch match = new SearchMatch(attributeNode, start, length, file);
- return match;
- }
-
- protected void addMatch(SearchPattern pattern, IFile file, Attr attributeNode, SearchRequestor requestor) {
- //System.out.println("addMatch " + pattern + " " + attributeNode.getName() + "=" + attributeNode.getValue());
- if (attributeNode != null) {
- SearchMatch match = createSearchMatch(file, attributeNode);
- if(requestor != null){
- try {
- requestor.acceptSearchMatch(match);
- } catch (CoreException e) {
- //do nothing
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
deleted file mode 100644
index a9ec4a10a6..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
+++ /dev/null
@@ -1,78 +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.xml.core.internal.search.matching;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.xml.sax.Attributes;
-
-public class SAXSearchElement{
- Attributes attributes;
- String elementName;
- String elementNamespace;
- Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
- String targetNamespace = ""; //$NON-NLS-1$
- String parentName;
- int depth = -1;
-
- public SAXSearchElement() {
- super();
- }
- public Attributes getAttributes() {
- return attributes;
- }
- public String getElementName() {
- return elementName;
- }
- public String getElementNamespace() {
- return elementNamespace;
- }
- public Map getNamespaceMap() {
- return namespaceMap;
- }
- public String getTargetNamespace() {
- return targetNamespace;
- }
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
- public void setElementName(String elementName) {
- this.elementName = elementName;
- }
- public void setElementNamespace(String elementNamespace) {
- this.elementNamespace = elementNamespace;
- }
- public void setNamespaceMap(Map namespaceMap) {
- this.namespaceMap = namespaceMap;
- }
- public void setTargetNamespace(String targetNamespace) {
- this.targetNamespace = targetNamespace;
- }
- public int getDepth()
- {
- return depth;
- }
- public void setDepth(int depth)
- {
- this.depth = depth;
- }
-public String getParentName() {
- return parentName;
-}
-public void setParentName(String parentName) {
- this.parentName = parentName;
-}
-
-
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
deleted file mode 100644
index 3364898649..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XMLSearchPatternMatcher extends PatternMatcher{
-
- /**
- * The active search participant.
- */
- private SearchParticipant searchParticipant;
-
- /**
- * Constructs a pattern matcher given a search participant.
- * @param searchParticipant the active {@link SearchParticipant search participant}.
- */
- public XMLSearchPatternMatcher(SearchParticipant searchParticipant)
- {
- this.searchParticipant = searchParticipant;
- }
-
- protected String computeNamespaceForPrefix(Element element, String prefix)
- {
- String result = null;
- for (Node node = element; node != null; node = node.getParentNode())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element e = (Element)node;
- String attributeName = (prefix != null && prefix.length() > 0) ? ("xmlns:" + prefix) : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
- result = e.hasAttribute(attributeName) ? e.getAttribute(attributeName) : null;
- if (result != null && result.length() > 0)
- {
- break;
- }
- }
- }
- return result;
- }
-
-
- protected void initialize(XMLSearchPattern pattern, Element domElement) {
-
- pattern.setElementName(domElement.getLocalName());
- pattern.setElementNamespace(domElement.getNamespaceURI());
- // TODO (cs) set the depth attribute on the pattern
- //
- String actualValue = domElement.hasAttribute(pattern.getAttributeName()) ? domElement.getAttribute(pattern.getAttributeName()) : null;
- if(actualValue != null && actualValue.length() > 0){
- pattern.setSearchElement(domElement);
- pattern.setSearchName(actualValue);
- pattern.setSearchNamespace(domElement.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace")); // set a default
- }
-
- }
-
- protected void initialize(XMLSearchPattern pattern, SAXSearchElement saxElement) {
-
- pattern.setElementName(saxElement.getElementName());
- pattern.setElementNamespace(saxElement.getElementNamespace());
- pattern.setDepth(saxElement.getDepth());
- pattern.setParentName(saxElement.getParentName());
- String actualValue = saxElement.getAttributes().getValue(pattern.getAttributeName());
- if(actualValue != null){
- pattern.setSearchElement(saxElement);
- pattern.setSearchName(actualValue);
- pattern.setSearchNamespace(saxElement.getTargetNamespace()); // set a default
- }
-
- }
-
- XMLSearchPattern searchPattern;
-
- public XMLSearchPatternMatcher() {
- super();
-
- }
-
-
-
-
- /**
- * This method does dive actual match location to the requestor if there are matches
- */
-
- public void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor) {
- if(pattern instanceof XMLComponentSearchPattern){
- XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
- if (childPatterns == null){
- return;
- }
- for (int i = 0; i < childPatterns.length; i++) {
- PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
- if(matcher == null){
- matcher = this;
- }
- if(matcher != null){
- matcher.locateMatches(childPatterns[i], file, element, requestor);
- }
- }
- }
- else if(pattern instanceof XMLSearchPattern){
- if(matches(pattern, element)){
- Attr attribute = element.getAttributeNode(((XMLSearchPattern)pattern).getAttributeName());
- addMatch(pattern, file, attribute, requestor);
- }
-
- }
- }
-
- /**
- * This method only answers if the pattern matches element, it does not give actual match location
- */
- public boolean matches(SearchPattern pattern, Object element){
- if(pattern instanceof XMLComponentSearchPattern){
- XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
- if (childPatterns == null){
- return false;
- }
- for (int i = 0; i < childPatterns.length; i++) {
- PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
- if(matcher == null){
- matcher = this;
- }
- if(matcher != null){
- if(matcher.matches(childPatterns[i], element)){
- return true;
- }
- }
-
- }
- }
- else if(pattern instanceof XMLSearchPattern){
-
- XMLSearchPattern possibleMatch = new XMLSearchPattern();
- possibleMatch.setAttributeName(((XMLSearchPattern)pattern).getAttributeName());
- if(element instanceof Element){
- initialize(possibleMatch, (Element)element);
- }
- else if(element instanceof SAXSearchElement){
- initialize(possibleMatch, (SAXSearchElement)element);
- }
- searchPattern = (XMLSearchPattern)pattern;
- return matchesPattern(possibleMatch);
- }
- return false;
- }
-
- protected boolean matchesPattern(SearchPattern pattern) {
- if(searchPattern != null && pattern instanceof XMLSearchPattern){
- XMLSearchPattern decodedPattern = (XMLSearchPattern)pattern;
- if(searchPattern.getElementName().equals(decodedPattern.getElementName()) &&
- searchPattern.getElementNamespace().equals(decodedPattern.getElementNamespace())){
- if(searchPattern.getParentName() != null &&
- decodedPattern.getParentName() != null &&
- !searchPattern.getParentName().equals(decodedPattern.getParentName()))
- {
- return false;
- }
- return searchPattern.matches(decodedPattern);
- }
- }
-
- return false;
- }
-
-
- protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
- {
- SearchMatch match = super.createSearchMatch(file, attributeNode);
- // todo... remove this ugly hack!!
- if ("name".equals(attributeNode.getName())) //$NON-NLS-1$
- {
- QualifiedName qualifiedName = new QualifiedName("todo-compute-targetNamespace", attributeNode.getValue()); //$NON-NLS-1$
- match.map.put("name", qualifiedName); //$NON-NLS-1$
- }
- //Element element = attributeNode.getOwnerDocument().getDocumentElement();
- //if (element.getAttribute("targetNamespace"))
- //{
- //}
- return match;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
deleted file mode 100644
index bf8a14cd89..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
+++ /dev/null
@@ -1,117 +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.xml.core.internal.search.quickscan;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-
-/**
- *
- */
-public class XMLQuickScan
-{
- /*
- public static String getTargetNamespace(String fullFilePath)
- {
- XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler();
- parseFile(fullFilePath, handler);
- return handler.getTargetNamespace();
- }*/
-
- /*
- * Returns information about matches encountered based on the criteria
- * provided.
- *
- public static boolean hasMatch(String fullFilePath, PatternMatcher matcher, SearchPattern pattern)
- {
- XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(matcher, pattern);
- parseFile(fullFilePath, handler);
- return handler.hasMatch();
- }*/
-
- public static boolean populateSearchDocument(SearchDocument document, PatternMatcher matcher, SearchPattern pattern)
- {
- XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(document, matcher, pattern);
- parseFile(document.getPath(), handler);
- return handler.hasMatch();
- }
-
- private static XMLReader reader;
- private static XMLReader getOrCreateReader()
- {
- if (reader == null)
- {
- try
- {
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- reader = parser.getXMLReader();
- reader.setFeature("http://xml.org/sax/features/namespaces", true); //$NON-NLS-1$
- reader.setErrorHandler(new InternalErrorHandler());
- }
- catch (Exception e)
- {
- }
- }
- return reader;
- }
-
- static class InternalErrorHandler implements ErrorHandler
- {
- public void error(SAXParseException exception) throws SAXException
- {
- }
-
- public void fatalError(SAXParseException exception) throws SAXException
- {
- }
- public void warning(SAXParseException exception) throws SAXException
- {
- }
- }
-
- private synchronized static void parseFile(String fullFilePath,
- XMLQuickScanContentHandler handler)
- {
- FileInputStream inputStream = null;
- try
- {
- inputStream = new FileInputStream(new File(fullFilePath));
- XMLReader reader = getOrCreateReader();
- reader.setContentHandler(handler);
- //System.out.println("parseFile" + reader + " (" + fullFilePath + ")");
- reader.parse(new InputSource(inputStream));
- } catch (Exception e)
- {
- // skip the file
- }
- finally{
- if(inputStream != null){
- try {
- inputStream.close();
- } catch (IOException e) {
- // can not do much
- }
- }
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
deleted file mode 100644
index 65d87cdc76..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
+++ /dev/null
@@ -1,212 +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.xml.core.internal.search.quickscan;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.ComponentReferenceEntry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.SAXSearchElement;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class is a SAX content handler, it should be recycled before scanning a file for the new SearchPattern.
- *
- */
-public class XMLQuickScanContentHandler extends DefaultHandler
-{
- private Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
- private String targetNamespace = ""; //$NON-NLS-1$
-
- private SearchPattern pattern;
- private SearchDocument document; // we'll add useful entries in the search document as we parsing
- private SAXSearchElement searchElement = new SAXSearchElement();
-
- private boolean hasMatch = false;
- private Stack currentPath = new Stack();
- private PatternMatcher matcher;
-
- public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- public static final String WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
-
-
- public XMLQuickScanContentHandler(PatternMatcher matcher, SearchPattern pattern) {
- super();
- this.pattern = pattern;
- this.matcher = matcher;
- }
-
- public XMLQuickScanContentHandler(SearchDocument document, PatternMatcher matcher, SearchPattern pattern) {
- super();
- this.pattern = pattern;
- this.matcher = matcher;
- this.document = document;
- }
-
- public XMLQuickScanContentHandler() {
- super();
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException
- {
- // Search for targetNamespace if we haven't encountered it yet.
- if (targetNamespace.equals("")) //$NON-NLS-1$
- {
- int nAttributes = attributes.getLength();
- for (int i = 0; i < nAttributes; i++)
- {
- if ("targetNamespace".equals(attributes.getQName(i))) //$NON-NLS-1$
- {
- targetNamespace = attributes.getValue(i);
- break;
- }
- }
- }
-
- // collect link info
-
- // TODO This code should be refactored to delegate the responsibility to
- // detect links between files to the search providers/contributors.
- // The current code only handles the XSD and WSDL cases.
-
- if("import".equals(localName) && namespaceMatches(uri)){ //$NON-NLS-1$
- FileReferenceEntry documentEntry = new FileReferenceEntry();
- documentEntry.setCategory(IXMLSearchConstants.REF);
- documentEntry.setKey("import"); //$NON-NLS-1$
- String namespace = attributes.getValue("namespace"); //$NON-NLS-1$
- String location = attributes.getValue(getLocationAttributeName(uri)); //$NON-NLS-1$
- documentEntry.setPublicIdentifier(namespace);
- documentEntry.setRelativeFilePath(location);
- document.putEntry(documentEntry);
- }
- if(("redefine".equals(localName)|| "include".equals(localName)) && //$NON-NLS-1$ //$NON-NLS-2$
- namespaceMatches(uri)){
- FileReferenceEntry documentEntry = new FileReferenceEntry();
- documentEntry.setCategory(IXMLSearchConstants.REF);
- documentEntry.setKey("include"); //$NON-NLS-1$
- String location = attributes.getValue(getLocationAttributeName(uri)); //$NON-NLS-1$
- documentEntry.setPublicIdentifier(uri);
- documentEntry.setRelativeFilePath(location);
- document.putEntry(documentEntry);
- }
-
-
- // issue (cs) you may want to try perf measurements to compate reusing the same
- // instance of a SAXSearchElement instead of newing one each time
- //XMLSearchPattern.SAXSearchElement searchElement = new XMLSearchPattern.SAXSearchElement();
- searchElement.setElementName(localName);
- searchElement.setElementNamespace(uri);
- searchElement.setAttributes(attributes);
- searchElement.setNamespaceMap(namespaceMap);
- searchElement.setTargetNamespace(targetNamespace);
- if (currentPath.size() > 0)
- {
- String parentName = (String)currentPath.peek();
- searchElement.setParentName(parentName);
- }
-
-
- if(matcher != null){
- if(matcher.matches(pattern, searchElement)){
- hasMatch = true;
- if(pattern instanceof XMLComponentReferencePattern){
- ComponentReferenceEntry documentEntry = new ComponentReferenceEntry();
- documentEntry.setCategory(IXMLSearchConstants.COMPONENT_REF);
- QualifiedName name = new QualifiedName(uri, localName);
- documentEntry.setKey(name.toString());
- documentEntry.setName(name);
- document.putEntry(documentEntry);
- }
- else if(pattern instanceof XMLComponentDeclarationPattern){
- ComponentDeclarationEntry documentEntry = new ComponentDeclarationEntry();
- documentEntry.setCategory(IXMLSearchConstants.COMPONENT_DECL);
- QualifiedName name = new QualifiedName(targetNamespace, attributes.getValue("name")); //$NON-NLS-1$
- QualifiedName metaName = new QualifiedName(uri, localName);
- documentEntry.setKey(name.toString());
- documentEntry.setName(name);
- documentEntry.setMetaName(metaName);
- document.putEntry(documentEntry);
- }
- }
- }
- currentPath.push(localName); //$NON-NLS-1$
- }
-
- private String getLocationAttributeName(String uri)
- {
- if (XMLSCHEMA_NAMESPACE.equals(uri))
- {
- return "schemaLocation";
- }
-
- else if (WSDL_NAMESPACE.equals(uri))
- {
- return "location";
- }
-
- return "";
- }
-
- private boolean namespaceMatches(String uri)
- {
- return XMLSCHEMA_NAMESPACE.equals(uri) ||
- WSDL_NAMESPACE.equals(uri);
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- currentPath.pop();
- }
-
- /**
- * Callback for SAX parser
- *
- * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
- * java.lang.String)
- */
- public void startPrefixMapping(String arg0, String arg1)
- throws SAXException
- {
- if (arg0 != null && arg0.length() > 0)
- {
- this.namespaceMap.put(arg0, arg1);
- }
- }
-
- public String getTargetNamespace() {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String targetNamespace) {
- this.targetNamespace = targetNamespace;
- }
-
- public boolean hasMatch() {
- return hasMatch;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java
deleted file mode 100644
index 5ba65d9705..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java
+++ /dev/null
@@ -1,41 +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.wst.xml.core.internal.validation;
-
-public class AnnotationMsg {
- public static String PROBMLEM_ID = "ProblemId"; //$NON-NLS-1$
- public static String LENGTH = "Length"; //$NON-NLS-1$
- public static String ATTRVALUETEXT = "AttributeValueText"; //$NON-NLS-1$
- public static String ATTRVALUENO = "AttributeValueNo"; //$NON-NLS-1$
- public static String ATTRNO = "AttrNo"; //$NON-NLS-1$
- private int problemId;
- private Object attributeValueText;
- private int length;
-
- public AnnotationMsg(int problemId, Object attributeValueText, int length) {
- super();
- this.problemId = problemId;
- this.attributeValueText = attributeValueText;
- this.length = length;
- }
- public int getProblemId() {
- return problemId;
- }
-
- public Object getAttributeValueText() {
- return attributeValueText;
- }
-
- public int getLength(){
- return length;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java
deleted file mode 100644
index a6d19bf645..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java
+++ /dev/null
@@ -1,929 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.osgi.util.NLS;
-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.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.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-/**
- * Basic XML syntax checking step.
- */
-public class MarkupValidator extends AbstractValidator implements IValidator {
- public static final int ELEMENT_ERROR_LIMIT = 25;
- public static final int PARTIAL = 1;
- public static final int TOTAL = 0;
- private String DQUOTE = "\""; //$NON-NLS-1$
- private String SQUOTE = "'"; //$NON-NLS-1$
-
-
- private IDocument fDocument;
-
- private IContentType fRootContentType = null;
-
- private IReporter fReporter = null;
-
- private static final String ANNOTATIONMSG = AnnotationMsg.class.getName();
-
- public void getAnnotationMsg(IReporter reporter, int problemId, LocalizedMessage message, Object attributeValueText, int len){
- AnnotationMsg annotation = new AnnotationMsg(problemId, attributeValueText,len);
- message.setAttribute(ANNOTATIONMSG, annotation);
- reporter.addMessage(this, message);
- }
-
-
- private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter, int messageSeverity) {
-
- if (sdRegion.isDeleted()) {
- return;
- }
-
- int lineNo = getLineNumber(start);
- LocalizedMessage message = new LocalizedMessage(messageSeverity, messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
-
-
- getAnnotationMsg(reporter, problemId, message, attributeValueText,length);
-
- }
-
- private void checkAttributesInEndTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- ITextRegionList textRegions = structuredDocumentRegion.getRegions();
- int errorCount = 0;
- int start = structuredDocumentRegion.getEndOffset();
- int end = structuredDocumentRegion.getEndOffset();
- for (int i = 0; (i < textRegions.size()) && (errorCount < ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
- ITextRegion textRegion = textRegions.get(i);
- if ((textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- if (start > structuredDocumentRegion.getStartOffset(textRegion)) {
- start = structuredDocumentRegion.getStartOffset(textRegion);
- }
- end = structuredDocumentRegion.getEndOffset(textRegion);
- errorCount++;
- }
- }
- // create one error for all attributes in the end tag
- if (errorCount > 0) {
- // Position p = new Position(start, end - start);
- String messageText = XMLCoreMessages.End_tag_has_attributes;
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES), messageText);
- message.setOffset(start);
- message.setLength(end - start);
- message.setLineNo(getLineNumber(start));
-
- getAnnotationMsg(reporter, ProblemIDsXML.AttrsInEndTag, message, null,end-start);
-
- }
- }
-
-
- private void checkClosingBracket(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- boolean closed = false;
- for (int i = 0; (i < regions.size()) && !structuredDocumentRegion.isDeleted(); i++) {
- r = regions.get(i);
- if ((r.getType() == DOMRegionContext.XML_TAG_CLOSE) || (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
- closed = true;
- }
- }
- if (!closed) {
-
- String messageText = XMLCoreMessages.ReconcileStepForMarkup_6;
-
- int start = structuredDocumentRegion.getStartOffset();
- int length = structuredDocumentRegion.getText().trim().length();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
- getAnnotationMsg(reporter, ProblemIDsXML.MissingClosingBracket, message, null,length);
-
-
- }
- }
-
- private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // navigate to name
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- if (regions.size() == 2) {
- // missing name region
- if ((regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) && (regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE)) {
- String messageText = XMLCoreMessages.ReconcileStepForMarkup_3;
- int start = structuredDocumentRegion.getStartOffset();
- int length = structuredDocumentRegion.getLength();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_TAG_NAME) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
-
- getAnnotationMsg(reporter, ProblemIDsXML.EmptyTag, message, null,length);
- }
- }
- }
-
- private int getLineNumber(int start) {
- int lineNo = -1;
- try {
- lineNo = getDocument().getLineOfOffset(start) + 1;
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- return lineNo;
- }
-
- private void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // 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();
- // ReconcileAnnotationKey key = createKey(structuredDocumentRegion,
- // getScope());
-
- int errorCount = 0;
- for (int i = 0; (i < textRegions.size()) && (errorCount < 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(XMLCoreMessages.Attribute__is_missing_a_value, args);
-
- int start = structuredDocumentRegion.getStartOffset(nameRegion);
- int end = structuredDocumentRegion.getEndOffset();
- int lineNo = getLineNumber(start);
- int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE) , messageText);
- message.setOffset(start);
- message.setLength(textLength);
- message.setLineNo(lineNo);
-
- // quick fix info
- ITextRegion equalsRegion = textRegions.get(i - 2 + 1);
- int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
- Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
-
- getAnnotationMsg(reporter, ProblemIDsXML.MissingAttrValue, message, additionalFixInfo,textLength);
- errorCount++;
- }
- }
- // name but no '=' (XML only)
- else if ((attrState == 1) && (i >= 1)) {
- // create annotation
- ITextRegion previousRegion = textRegions.get(i - 1);
- if (!(previousRegion instanceof ITextRegionContainer)) {
- Object[] args = {structuredDocumentRegion.getText(previousRegion)};
- String messageText = NLS.bind(XMLCoreMessages.Attribute__has_no_value, args);
- int start = structuredDocumentRegion.getStartOffset(previousRegion);
- int textLength = structuredDocumentRegion.getText(previousRegion).trim().length();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE), messageText);
- message.setOffset(start);
- message.setLength(textLength);
- message.setLineNo(lineNo);
-
- getAnnotationMsg(reporter, ProblemIDsXML.NoAttrValue, message, structuredDocumentRegion.getText(previousRegion),textLength);
-
-
- 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;
- }
- }
-
- }
-
- private void checkForSpaceBeforeName(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- String sdRegionText = structuredDocumentRegion.getFullText();
- if (sdRegionText.startsWith(" ")) { //$NON-NLS-1$
- IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
- if (prev != null) {
- // this is possibly the case of "< tag"
- if ((prev.getRegions().size() == 1) && isStartTag(prev)) {
- // add the error for preceding space in tag name
- String messageText = XMLCoreMessages.ReconcileStepForMarkup_2;
- int start = structuredDocumentRegion.getStartOffset();
- // find length of whitespace
- int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
- getAnnotationMsg(reporter, ProblemIDsXML.SpacesBeforeTagName, message, null,length);
- }
- }
- }
- }
-
- private void checkNoNamespaceInPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // navigate to name
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- int errorCount = 0;
- for (int i = 0; (i < regions.size()) && (errorCount < ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- String piText = structuredDocumentRegion.getText(r);
- int index = piText.indexOf(":"); //$NON-NLS-1$
- if (index != -1) {
- String messageText = XMLCoreMessages.ReconcileStepForMarkup_4;
- int start = structuredDocumentRegion.getStartOffset(r) + index;
- int length = piText.trim().length() - index;
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
-
-
- getAnnotationMsg(reporter, ProblemIDsXML.NamespaceInPI, message, null,length);
-
- errorCount++;
- }
- }
- }
- }
-
- private void checkQuotesForAttributeValues(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- String attrValueText = ""; //$NON-NLS-1$
- int errorCount = 0;
- for (int i = 0; (i < regions.size()) && (errorCount < 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 = XMLCoreMessages.ReconcileStepForMarkup_0;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
- errorCount++;
- }
- else {
- // missing both
- String message = XMLCoreMessages.ReconcileStepForMarkup_1;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
- errorCount++;
- }
- }
- else if (size == 2) {
- if ((one.equals(SQUOTE) && !two.equals(SQUOTE)) || (one.equals(DQUOTE) && !two.equals(DQUOTE))) {
- // missing closing quote
- String message = XMLCoreMessages.ReconcileStepForMarkup_0;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
- errorCount++;
- }
- }
- }
- // end of region for loop
- }
-
- private void checkStartEndTagPairs(IStructuredDocumentRegion sdRegion, IReporter reporter) {
-
- if (sdRegion.isDeleted()) {
- return;
- }
-
- // check start/end tag pairs
- IDOMNode xmlNode = getXMLNode(sdRegion);
-
- if (xmlNode == null) {
- return;
- }
-
- boolean selfClosed = false;
- String tagName = null;
-
- /**
- * For tags that aren't meant to be EMPTY, make sure it's empty or has an end tag
- */
- if (xmlNode.isContainer()) {
- IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
- if (endRegion == null) {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion != null && !startRegion.isDeleted() && DOMRegionContext.XML_TAG_OPEN.equals(startRegion.getFirstRegion().getType())) {
- // analyze the tag (check self closing)
- ITextRegionList regions = startRegion.getRegions();
- ITextRegion r = null;
- int start = sdRegion.getStart();
- int length = sdRegion.getTextLength();
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- start = sdRegion.getStartOffset(r);
- length = r.getTextLength();
- }
- else if (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- selfClosed = true;
- }
- }
-
-
- if (!selfClosed && (tagName != null)) {
- Object[] args = {tagName};
- String messageText = NLS.bind(XMLCoreMessages.Missing_end_tag_, args);
-
- int lineNumber = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_END_TAG) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNumber);
- Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
-
- getAnnotationMsg(reporter, ProblemIDsXML.MissingEndTag, message, additionalFixInfo,length);
- }
- }
- }
- else {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion == null || startRegion.isDeleted()) {
- // analyze the tag (check self closing)
- ITextRegionList regions = endRegion.getRegions();
- ITextRegion r = null;
- int start = sdRegion.getStart();
- int length = sdRegion.getTextLength();
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- start = sdRegion.getStartOffset(r);
- length = r.getTextLength();
- }
- }
-
- if (tagName != null) {
- Object[] args = {tagName};
- String messageText = NLS.bind(XMLCoreMessages.Missing_start_tag_, args);
-
- int lineNumber = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_START_TAG), messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNumber);
- Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
-
- getAnnotationMsg(reporter, ProblemIDsXML.MissingStartTag, message, additionalFixInfo,length);
-
- }
- }
- }
-
- }
- /*
- * Check for an end tag that has no start tag
- */
- else {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion == null) {
- IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
- if (!endRegion.isDeleted()) {
- // get name
- ITextRegionList regions = endRegion.getRegions();
- ITextRegion r = null;
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- }
- }
-
- if (!selfClosed && (tagName != null)) {
- String messageText = XMLCoreMessages.Indicate_no_grammar_specified_severities_error;
-
- int start = sdRegion.getStart();
- int lineNumber = getLineNumber(start);
-
- // SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
- IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
- message.setOffset(start);
- message.setLength(sdRegion.getTextLength());
- message.setLineNo(lineNumber);
-
- reporter.addMessage(this, message);
- }
- }
- }
- }
- }
-
- private Object[] getStartEndFixInfo(IDOMNode xmlNode, String tagName, ITextRegion r) {
- // quick fix info
- String tagClose = "/>"; //$NON-NLS-1$
- int tagCloseOffset = xmlNode.getFirstStructuredDocumentRegion().getEndOffset();
- if ((r != null) && (r.getType() == DOMRegionContext.XML_TAG_CLOSE)) {
- tagClose = "/"; //$NON-NLS-1$
- tagCloseOffset--;
- }
- IDOMNode firstChild = (IDOMNode) xmlNode.getFirstChild();
- while ((firstChild != null) && (firstChild.getNodeType() == Node.TEXT_NODE)) {
- firstChild = (IDOMNode) firstChild.getNextSibling();
- }
- int endOffset = xmlNode.getEndOffset();
- int firstChildStartOffset = firstChild == null ? endOffset : firstChild.getStartOffset();
- Object[] additionalFixInfo = {tagName, tagClose, new Integer(tagCloseOffset), new Integer(xmlNode.getFirstStructuredDocumentRegion().getEndOffset()), // startTagEndOffset
- new Integer(firstChildStartOffset), // firstChildStartOffset
- new Integer(endOffset)}; // endOffset
- return additionalFixInfo;
- }
-
- private void checkStartingSpaceForPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
- if ((prev != null) && prev.getStartOffset() == 0) {
- if (prev.getType() == DOMRegionContext.XML_CONTENT) {
- String messageText = XMLCoreMessages.ReconcileStepForMarkup_5;
- int start = prev.getStartOffset();
- int length = prev.getLength();
-
- LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.WHITESPACE_AT_START) , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
-
-
- getAnnotationMsg(reporter, ProblemIDsXML.SpacesBeforePI, message, null,length);
-
- // Position p = new Position(start, length);
- //
- // ReconcileAnnotationKey key =
- // createKey(structuredDocumentRegion, getScope());
- // TemporaryAnnotation annotation = new TemporaryAnnotation(p,
- // SEVERITY_SYNTAX_ERROR, message, key,
- // ProblemIDsXML.SpacesBeforePI);
- // results.add(annotation);
- }
- }
- }
-
- public int getScope() {
- return PARTIAL;
- }
-
- private IDOMNode getXMLNode(IStructuredDocumentRegion sdRegion) {
-
- if (sdRegion == null) {
- return null;
- }
-
- IStructuredModel xModel = null;
- IDOMNode xmlNode = null;
- // get/release models should always be in a try/finally block
- try {
- xModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- // xModel is sometime null, when closing editor, for example
- if (xModel != null) {
- xmlNode = (IDOMNode) xModel.getIndexedRegion(sdRegion.getStart());
- }
- }
- finally {
- if (xModel != null) {
- xModel.releaseFromRead();
- }
- }
- return xmlNode;
- }
-
- /**
- * Determines whether the IStructuredDocumentRegion is a XML "end tag"
- * since they're not allowed to have attribute ITextRegions
- *
- * @param structuredDocumentRegion
- */
- private boolean isEndTag(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN;
- }
-
- /**
- * Determines if the IStructuredDocumentRegion is an XML Processing
- * Instruction
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isPI(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_PI_OPEN;
- }
-
- /**
- * Determines whether the IStructuredDocumentRegion is a XML "start tag"
- * since they need to be checked for proper XML attribute region sequences
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isStartTag(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN;
- }
-
- // Because we check the "proper" closing separately from attribute
- // sequencing, we need to know what's
- // an appropriate close.
- private boolean isTagCloseTextRegion(ITextRegion textRegion) {
- return (textRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) || (textRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE);
- }
-
- /**
- * Determines if the IStructuredDocumentRegion is XML Content
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isXMLContent(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT;
- }
-
- private IDocument getDocument() {
- return fDocument;
- }
-
- public void connect(IDocument document) {
- fDocument = document;
- }
-
- public void disconnect(IDocument document) {
- fDocument = null;
- }
-
- public void validate(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion == null) {
- return;
- }
-
- if (isStartTag(structuredDocumentRegion)) {
- // check for attributes without a value
- checkForAttributeValue(structuredDocumentRegion, reporter);
- // check if started tag is ended
- checkStartEndTagPairs(structuredDocumentRegion, reporter);
- // check empty tag <>
- checkEmptyTag(structuredDocumentRegion, reporter);
- // check that each attribute has quotes
- checkQuotesForAttributeValues(structuredDocumentRegion, reporter);
- // check that the closing '>' is there
- checkClosingBracket(structuredDocumentRegion, reporter);
- }
- else if (isEndTag(structuredDocumentRegion)) {
- // check if ending tag was started
- checkStartEndTagPairs(structuredDocumentRegion, reporter);
- // check for attributes in an end tag
- checkAttributesInEndTag(structuredDocumentRegion, reporter);
- // check that the closing '>' is there
- checkClosingBracket(structuredDocumentRegion, reporter);
- }
- else if (isPI(structuredDocumentRegion)) {
- // check validity of processing instruction
- checkStartingSpaceForPI(structuredDocumentRegion, reporter);
- checkNoNamespaceInPI(structuredDocumentRegion, reporter);
- }
- else if (isXMLContent(structuredDocumentRegion)) {
- checkForSpaceBeforeName(structuredDocumentRegion, reporter);
- }
- else if (isXMLDoctypeDeclaration(structuredDocumentRegion)) {
- checkDocumentTypeReferences(structuredDocumentRegion, reporter);
- }
- }
-
- /**
- * @param structuredDocumentRegion
- * @param reporter
- */
- private void checkDocumentTypeReferences(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- }
-
- /**
- * @param structuredDocumentRegion
- * @return
- */
- private boolean isXMLDoctypeDeclaration(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_DECLARATION_OPEN && structuredDocumentRegion.getType().equals(DOMRegionContext.XML_DOCTYPE_DECLARATION);
- }
-
- public void cleanup(IReporter reporter) {
- fDocument = null;
- }
-
- public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
- String[] uris = helper.getURIs();
- IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- if (uris.length > 0) {
- IFile currentFile = null;
-
- for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
- // might be called with just project path?
- IPath path = new Path(uris[i]);
- if (path.segmentCount() > 1) {
- currentFile = wsRoot.getFile(path);
- if (shouldValidate(currentFile, true)) {
- validateV1File(currentFile, reporter);
- }
- }
- else if (uris.length == 1) {
- validateV1Project(helper, reporter);
- }
- }
- }
- else
- validateV1Project(helper, reporter);
- }
-
- private boolean shouldValidate(IResourceProxy proxy) {
- if(proxy.getType() == IResource.FILE) {
- String name = proxy.getName();
- if(name.toLowerCase(Locale.US).endsWith(".xml")) { //$NON-NLS-1$
- return true;
- }
- }
- return shouldValidate(proxy.requestResource(), false);
- }
-
- private boolean shouldValidate(IResource file, boolean checkExtension) {
- if (file == null || !file.exists() || file.getType() != IResource.FILE)
- return false;
- if (checkExtension) {
- String extension = file.getFileExtension();
- if (extension != null && "xml".endsWith(extension.toLowerCase(Locale.US))) //$NON-NLS-1$
- return true;
- }
-
- IContentDescription contentDescription = null;
- try {
- contentDescription = ((IFile) file).getContentDescription();
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- return contentDescription != null && contentType.isKindOf(getXMLContentType());
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- return false;
- }
-
- /**
- * @param helper
- * @param reporter
- */
- private void validateV1Project(IValidationContext helper, final IReporter reporter) {
- // if uris[] length 0 -> validate() gets called for each project
- if (helper instanceof IWorkbenchContext) {
- IProject project = ((IWorkbenchContext) helper).getProject();
- IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
- public boolean visit(IResourceProxy proxy) throws CoreException {
- if (shouldValidate(proxy)) {
- validateV1File((IFile) proxy.requestResource(), reporter);
- }
- return true;
- }
- };
- try {
- // collect all jsp files for the project
- project.accept(visitor, IResource.DEPTH_INFINITE);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
-
- /**
- * @param currentFile
- * @param reporter
- */
- private void validateV1File(IFile currentFile, IReporter reporter) {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, currentFile.getFullPath().toString().substring(1));
- reporter.displaySubtask(MarkupValidator.this, message);
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead(currentFile);
- IStructuredDocument document = null;
- if (model != null) {
- document = model.getStructuredDocument();
- connect(document);
- IStructuredDocumentRegion validationRegion = document.getFirstStructuredDocumentRegion();
- while (validationRegion != null) {
- validate(validationRegion, reporter);
- validationRegion = validationRegion.getNext();
- }
- disconnect(document);
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
-
- /**
- * @return
- */
- private IContentType getXMLContentType() {
- if (fRootContentType == null) {
- fRootContentType = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.xml"); //$NON-NLS-1$
- }
- return fRootContentType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.AbstractValidator#validate(org.eclipse.core.resources.IResource, int, org.eclipse.wst.validation.ValidationState, org.eclipse.core.runtime.IProgressMonitor)
- */
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE)
- return null;
- ValidationResult result = new ValidationResult();
- fReporter = result.getReporter(monitor);
-
- validateV1File((IFile) resource, fReporter);
-
- return result;
- }
-
- public IReporter validate(IResource resource, int kind, ValidationState state) {
- validate(resource,kind,state,new NullProgressMonitor());
- return fReporter;
- }
- private Preferences getPluginPreference(){
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
- if (getDocument() == null) {
- return;
- }
- if (!(getDocument() instanceof IStructuredDocument)) {
- return;
- }
-
- // remove old messages
- reporter.removeAllMessages(this);
-
- IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
- for (int i = 0; i < regions.length; i++) {
- validate(regions[i], reporter);
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java
deleted file mode 100644
index cf34e74f0b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 20010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-public interface ProblemIDsXML {
- int AttrsInEndTag = 3;
- int AttrValueNotQuoted = 13;
- int EmptyTag = 1;
- int InvalidAttrValue = 11;
- int MissingAttrValue = 4;
- int MissingClosingBracket = 14;
- int MissingEndTag = 2;
- int MissingRequiredAttr = 12;
- int MissingStartTag = 15;
- int NamespaceInPI = 8;
- int NoAttrValue = 5;
- int SpacesBeforePI = 7;
- int SpacesBeforeTagName = 6;
- int Unclassified = 0;
- int UnknownAttr = 10;
- int UnknownElement = 9;
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
deleted file mode 100644
index cd4631d5c8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * A helper class for the XML validator.
- *
- * @author Craig Salter, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidatorHelper
-{
- public List namespaceURIList = new Vector();
- public boolean isGrammarEncountered = false;
- public boolean isDTDEncountered = false;
- public boolean isNamespaceEncountered = false;
- public String schemaLocationString = ""; //$NON-NLS-1$
- public int numDTDElements = 0;
- public boolean isDocumentElementEncountered = false;
-
- private static final boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.xml.core/debug/validation")).booleanValue(); //$NON-NLS-1$
- /**
- * Constructor.
- */
- public ValidatorHelper()
- {
- }
-
- /**
- * Create an XML Reader.
- *
- * @return An XML Reader if one can be created or null.
- * @throws SAXNotSupportedException
- * @throws SAXNotRecognizedException
- */
- protected XMLReader createXMLReader(String uri) throws SAXNotRecognizedException, SAXNotSupportedException {
- XMLReader reader = null;
-
- reader = new org.apache.xerces.parsers.SAXParser();
- reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); //$NON-NLS-1$
- reader.setFeature("http://xml.org/sax/features/namespaces", false); //$NON-NLS-1$
- reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
- reader.setContentHandler(new MyContentHandler(uri));
- reader.setErrorHandler(new InternalErrorHandler());
-
- LexicalHandler lexicalHandler = new LexicalHandler()
- {
- public void startDTD (String name, String publicId, String systemId)
- {
- isGrammarEncountered = true;
- isDTDEncountered = true;
- }
-
- public void endDTD() throws SAXException
- {
- }
-
- public void startEntity(String name) throws SAXException
- {
- }
-
- public void endEntity(String name) throws SAXException
- {
- }
-
- public void startCDATA() throws SAXException
- {
- }
-
- public void endCDATA() throws SAXException
- {
- }
-
- public void comment (char ch[], int start, int length) throws SAXException
- {
- }
- };
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler); //$NON-NLS-1$
-
- return reader;
- }
-
- /**
- * An error handler to suppress error and warning information.
- */
- private class InternalErrorHandler implements org.xml.sax.ErrorHandler
- {
- public InternalErrorHandler()
- {
- super();
- }
-
- public void error(SAXParseException exception) throws SAXException
- {
- }
-
- public void fatalError(SAXParseException exception) throws SAXException
- {
- }
-
- public void warning(SAXParseException exception) throws SAXException
- {
- }
- }
-
-
- /**
- * Figures out the information needed for validation.
- *
- * @param uri The uri of the file to validate.
- * @param uriResolver A helper to resolve locations.
- */
- public void computeValidationInformation(String uri, Reader characterStream, URIResolver uriResolver)
- {
- try {
- XMLReader reader = createXMLReader(uri);
- InputSource inputSource = new InputSource(uri);
- inputSource.setCharacterStream(characterStream);
- reader.parse(inputSource);
- }
- catch (SAXException e) {
- if (_trace)
- Logger.logException(e);
- }
- catch (IOException e) {
- if (_trace)
- Logger.logException(e);
- }
- }
-
-
-
- /**
- * Handle the content while parsing the file.
- */
- class MyContentHandler extends org.xml.sax.helpers.DefaultHandler
- {
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- boolean isRootElement = true;
- String baseURI;
-
- MyContentHandler(String uri)
- {
- this.baseURI = uri;
- }
-
- public void error(SAXParseException e) throws SAXException
- {
- }
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException e) throws SAXException
- {
- }
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException e) throws SAXException
- {
- }
- public String getPrefix(String name)
- {
- String prefix = null;
- int index = name.indexOf(":"); //$NON-NLS-1$
- if (index != -1)
- {
- prefix = name.substring(0, index);
- }
- return prefix;
- }
-
- public String getUnprefixedName(String name)
- {
- int index = name.indexOf(":"); //$NON-NLS-1$
- if (index != -1)
- {
- name = name.substring(index + 1);
- }
- return name;
- }
-
- public String getPrefixedName(String prefix, String localName)
- {
- return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName; //$NON-NLS-1$
- }
-
- public void startElement(String namespaceURI, String localName, String rawName, Attributes atts)
- {
- //String explicitLocation = null;
- if (isRootElement)
- {
- isDocumentElementEncountered = true;
- isRootElement = false;
- int nAtts = atts.getLength();
- String schemaInstancePrefix = null;
- for (int i =0; i < nAtts; i++)
- {
- String attributeName = atts.getQName(i);
- if (attributeName.equals("xmlns") || attributeName.startsWith("xmlns:")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- isNamespaceEncountered = true;
- String value = atts.getValue(i);
- if (value.startsWith("http://www.w3.org/") && value.endsWith("/XMLSchema-instance")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- schemaInstancePrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- String prefix = getPrefix(rawName);
- String rootElementNamespaceDeclarationName = (prefix != null && prefix.length() > 0) ? "xmlns:" + prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
- String rootElementNamespace = rootElementNamespaceDeclarationName != null ? atts.getValue(rootElementNamespaceDeclarationName) : null;
-
- String location = null;
-
- // first we use any 'xsi:schemaLocation' or 'xsi:noNamespaceSchemaLocation' attribute
- // to determine a location
- if (schemaInstancePrefix != null)
- {
- location = atts.getValue(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation")); //$NON-NLS-1$
- if (location == null)
- {
- String schemaLoc = atts.getValue(getPrefixedName(schemaInstancePrefix, "schemaLocation")); //$NON-NLS-1$
- location = getSchemaLocationForNamespace(schemaLoc, rootElementNamespace);
- }
- }
- if (rootElementNamespace == null)
- {
- rootElementNamespace = "";
- }
-
- location = URIResolverPlugin.createResolver().resolve(baseURI, rootElementNamespace, location);
- location = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseURI, rootElementNamespace, location);
- if (location != null)
- {
- location = URIHelper.addImpliedFileProtocol(location);
- }
-
- schemaLocationString = location;
-
- if (location != null)
- {
- InputStream is = null;
- try
- {
- URL url = new URL(location);
- is = url.openStream();
- isGrammarEncountered = true;
- }
- catch(Exception e)
- {
- // Do nothing.
- }
- finally
- {
- if(is != null)
- {
- try
- {
- is.close();
- }
- catch(Exception e)
- {
- // Do nothing.
- }
- }
- }
- }
- }
- }
- /* (non-Javadoc)
- * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
- */
- public void elementDecl(String name, String model)
- {
- numDTDElements++;
- }
-
- // The xsiSchemaLocationValue is a list of namespace/location pairs that are separated by whitespace
- // this method walks the list of pairs looking for the specified namespace and returns the associated
- // location.
- //
- protected String getSchemaLocationForNamespace(String xsiSchemaLocationValue, String namespace)
- {
- String result = null;
- if (xsiSchemaLocationValue != null && namespace != null)
- {
-
- StringTokenizer st = new StringTokenizer(xsiSchemaLocationValue);
- while(st.hasMoreTokens())
- {
- if(st.nextToken().equals(namespace))
- {
- if(st.hasMoreTokens())
- {
- result = st.nextToken();
- }
- }
- else
- {
- if(st.hasMoreTokens())
- {
- st.nextToken();
- }
- }
- }
- }
- return result;
- }
- }
-
-
- /**
- * Replace all instances in the string of the old pattern with the new pattern.
- *
- * @param string The string to replace the patterns in.
- * @param oldPattern The old pattern to replace.
- * @param newPattern The pattern used for replacement.
- * @return The modified string with all occurrances of oldPattern replaced by new Pattern.
- */
- protected static String replace(String string, String oldPattern, String newPattern)
- {
- int index = 0;
- while (index != -1)
- {
- index = string.indexOf(oldPattern, index);
- if (index != -1)
- {
- string = string.substring(0, index) + newPattern + string.substring(index + oldPattern.length());
- index = index + oldPattern.length();
- }
- }
- return string;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java
deleted file mode 100644
index 29c5e7e3f9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-
-import java.util.HashSet;
-
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-
-
-/**
- * XMLNestedValidatorContext is used to store state data needed during an XML
- * validation session.
- */
-public class XMLNestedValidatorContext extends NestedValidatorContext
-{
- /**
- * A set of inaccessible locations URIs (String).
- */
- private HashSet inaccessibleLocationURIs = new HashSet();
-
- /**
- * Determines if a location URI was marked as inaccessible.
- *
- * @param locationURI
- * the location URI to test. Must not be null.
- * @return true if a location URI was marked as inaccessible, false otherwise.
- */
- public boolean isURIMarkedInaccessible(String locationURI)
- {
- return locationURI != null && inaccessibleLocationURIs.contains(locationURI);
- }
-
- /**
- * Marks the given location URI as inaccessible.
- *
- * @param locationURI
- * the location URI to mark as inaccessible. Must not be null.
- */
- public void markURIInaccessible(String locationURI)
- {
- if (locationURI != null)
- {
- inaccessibleLocationURIs.add(locationURI);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
deleted file mode 100644
index 1649104002..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver (STAR) - bug 297005 - Some static constants not made final.
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-/**
- * An XML validation configuration allows setting specific configuration
- * information for a WTP XML validation run. Any features and properties
- * set on this configuration should not be confused with those from
- * parsers such as Xerces. (This object does not by default wrap features
- * and properties from specific parsers.)
- */
-public class XMLValidationConfiguration
-{
- /**
- * @deprecated
- */
- public static final String WARN_NO_GRAMMAR = "WARN_NO_GRAMMAR"; //$NON-NLS-1$
- public static final String INDICATE_NO_GRAMMAR = "INDICATE_NO_GRAMMAR"; //$NON-NLS-1$
- public static final String INDICATE_NO_DOCUMENT_ELEMENT = "INDICATE_NO_DOCUMENT_ELEMENT"; //$NON-NLS-1$
- public static final String USE_XINCLUDE = "USE_XINCLUDE"; //$NON-NLS-1$
- public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "HONOUR_ALL_SCHEMA_LOCATIONS"; //$NON-NLS-1$
-
- private boolean warn_no_grammar_value = false;
- private int indicate_no_grammar_value = 1;
- private boolean use_xinclude = false;
- private boolean honour_all_schema_locations_value = false;
- private int indicate_no_document_value = 0;
-
- /**
- * Set a feature of this configuration.
- *
- * @param feature
- * The feature to set.
- * @param value
- * The value to set for the feature.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public void setFeature(String feature, boolean value) throws Exception
- {
- if(WARN_NO_GRAMMAR.equals(feature))
- warn_no_grammar_value = value;
- else if(USE_XINCLUDE.equals(feature))
- use_xinclude = value;
- else if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
- honour_all_schema_locations_value = value;
- else
- throw new Exception("Feature not recognized."); //$NON-NLS-1$
-
- }
-
- /**
- * Set a feature of this configuration.
- *
- * @param feature
- * The feature to set.
- * @param value
- * The value to set for the feature.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public void setFeature(String feature, int value) throws Exception
- {
- if(INDICATE_NO_GRAMMAR.equals(feature))
- indicate_no_grammar_value = value;
- else if (INDICATE_NO_DOCUMENT_ELEMENT.equals(feature))
- indicate_no_document_value = value;
- else
- throw new IllegalArgumentException("Feature not recognized."); //$NON-NLS-1$
-
- }
-
-
- /**
- * Get the value for a given feature. If the feature is not defined
- * this method will throw an exception.
- *
- * @param feature
- * The feature for which to retrieve the value.
- * @return
- * The feature's value, true or false.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public boolean getFeature(String feature) throws Exception
- {
- if(WARN_NO_GRAMMAR.equals(feature))
- return warn_no_grammar_value;
- else if(USE_XINCLUDE.equals(feature))
- return use_xinclude;
- if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
- return honour_all_schema_locations_value;
-
- throw new Exception("Feature not recognized."); //$NON-NLS-1$
- }
-
- /**
- * Get the value for a given feature. If the feature is not defined
- * this method will throw an exception.
- *
- * @param feature
- * The feature for which to retrieve the value.
- * @return
- * The feature's value, true or false.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public int getIntFeature(String feature) throws Exception
- {
- if(INDICATE_NO_GRAMMAR.equals(feature))
- return indicate_no_grammar_value;
- else if (INDICATE_NO_DOCUMENT_ELEMENT.equals(feature))
- return indicate_no_document_value;
-
- throw new IllegalArgumentException("Feature not recognized."); //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
deleted file mode 100644
index 1113eb9e1d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.util.Stack;
-
-import org.apache.xerces.xni.XMLLocator;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationManager;
-
-
-/**
- * A validation information object specific to XML validators.
- */
-public class XMLValidationInfo extends ValidationInfo implements XMLValidationReport
-{
- protected boolean grammarEncountered = false;
- protected boolean dtdEncountered = false;
- protected boolean namespaceEncountered = false;
- protected int elementDeclCount = 0;
- protected String currentErrorKey;
- protected Object messageArguments[] = null;
- protected XMLLocator locator = null;
- protected ErrorCustomizationManager errorCustomizationManager = null;
-
- /**
- * A stack of start tag locations, used to move errors
- * reported at the close tag to be reported at the start tag.
- */
- protected Stack startElementLocations = new Stack();
-
- /**
- * Constructor.
- *
- * @param uri The URI of the file this report describes.
- */
- public XMLValidationInfo(String uri)
- {
- super(uri);
- }
-
- public boolean isGrammarEncountered()
- {
- return grammarEncountered;
- }
-
- /**
- * Set whether a grammar has been encountered or not.
- *
- * @param grammarEncountered Set true if a grammar has been encountered, false otherwise.
- */
- public void setGrammarEncountered(boolean grammarEncountered)
- {
- this.grammarEncountered = grammarEncountered;
- }
-
- public boolean isDTDWithoutElementDeclarationEncountered()
- {
- return dtdEncountered && elementDeclCount == 0;
- }
-
- /**
- * Set whether a DTD without an element declaration was encountered.
- *
- * @param dtdWithoutElementDeclarationEncountered Set true if a DTD without an
- * element declaration was encountered, false otherwise.
- */
- public void setDTDEncountered(boolean dtdEncountered)
- {
- this.dtdEncountered = dtdEncountered;
- }
-
- public boolean isNamespaceEncountered()
- {
- return namespaceEncountered;
- }
-
- /**
- * Set whether a namespace was encountered.
- *
- * @param namespaceEncountered Set true if a namespace was encountered, false otherwise.
- */
- public void setNamespaceEncountered(boolean namespaceEncountered)
- {
- this.namespaceEncountered = namespaceEncountered;
- }
-
- /**
- * Increase the element declaration count for DTD elements by one.
- */
- public void increaseElementDeclarationCount()
- {
- this.elementDeclCount++;
- }
-
- /**
- * Set the number of DTD elements encountered.
- *
- * @param count The number of DTD elements encountered.
- */
- public void setElementDeclarationCount(int count)
- {
- elementDeclCount = count;
- }
-
- /**
- * Get the XML locator if one has been specified.
- *
- * @return The XML locator if one has been specified or null.
- */
- public XMLLocator getXMLLocator()
- {
- return locator;
- }
-
- /**
- * Set the XMLLocator.
- *
- * @param locator The XMLLocator to set.
- */
- public void setXMLLocator(XMLLocator locator)
- {
- this.locator = locator;
- }
-
- /**
- * Get the current error key.
- *
- * @return Returns the currentErrorKey.
- */
- public String getCurrentErrorKey()
- {
- return currentErrorKey;
- }
-
- /**
- * Set the current error key.
- *
- * @param currentErrorKey The currentErrorKey to set.
- */
- public void setCurrentErrorKey(String currentErrorKey)
- {
- this.currentErrorKey = currentErrorKey;
- }
-
-public Object[] getMessageArguments() {
- return messageArguments;
-}
-
-
-public void setMessageArguments(Object[] messageArguments) {
- this.messageArguments = messageArguments;
-}
-
- /**
- * Get the start elements locations.
- *
- * @return
- * A stack containing the start element locations.
- */
- protected Stack getStartElementLocations()
- {
- return startElementLocations;
- }
-
- /**
- * Get the error customization manager for this validation run.
- *
- * @return
- * The error customization manager for this validation run.
- */
- protected ErrorCustomizationManager getErrorCustomizationManager()
- {
- if(errorCustomizationManager == null)
- {
- errorCustomizationManager = new ErrorCustomizationManager();
- }
- return errorCustomizationManager;
- }
-
- /**
- * @deprecated Use {@link XMLValidationConfiguration} instead.
- */
- public boolean isUseXInclude() {
- return XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
deleted file mode 100644
index bf6887460c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Validation
- */
-public class XMLValidationMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.validation.xmlvalidation";//$NON-NLS-1$
-
- public static String _UI_PROBLEMS_VALIDATING_UNKNOWN_HOST;
- public static String _UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND;
- public static String _UI_PROBLEMS_CONNECTION_REFUSED;
- public static String _UI_REF_FILE_ERROR_MESSAGE;
- public static String _WARN_NO_GRAMMAR;
- public static String _NO_DOCUMENT_ELEMENT;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLValidationMessages.class);
- }
-
- private XMLValidationMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java
deleted file mode 100644
index 5a4f1f641c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-/**
- * An interface represention a validation report for XML validation.
- *
- * @author Lawrence Mandel, IBM
- */
-public interface XMLValidationReport extends ValidationReport
-{
-
- /**
- * Returns whether a grammar was encountered during the validation.
- *
- * @return True if a grammar was encountered, false otherwise.
- */
- public boolean isGrammarEncountered();
-
- /**
- * Returns whether a namespace was encountered.
- *
- * @return True if a namespace was encountered, false otherwise.
- */
- public boolean isNamespaceEncountered();
-
- /**
- * Returns whether a DTD without element declarations was encountered.
- *
- * @return True if a DTD without element declarations was encountered.
- */
- public boolean isDTDWithoutElementDeclarationEncountered();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
deleted file mode 100644
index 4277255285..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ /dev/null
@@ -1,930 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.net.ConnectException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.xerces.impl.XMLErrorReporter;
-import org.apache.xerces.impl.msg.XMLMessageFormatter;
-import org.apache.xerces.parsers.XIncludeAwareParserConfiguration;
-import org.apache.xerces.xni.Augmentations;
-import org.apache.xerces.xni.NamespaceContext;
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.XMLLocator;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.internal.ValOperation;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ExternalSchemaLocationProviderRegistry;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class performs validation using a xerces sax parser.
- * Here's a quick overview of the details :
- * - an ErrorHandler is used to collect errors into a list (so they may be displayed by the UI)
- * - an EntityResolver is used along with the xerces "external-schemaLocation" property to implement XML Catalog support
- */
-public class XMLValidator
-{
- protected URIResolver uriResolver = null;
- protected Hashtable ingoredErrorKeyTable = new Hashtable();
- protected Set adjustLocationErrorKeySet = new TreeSet();
-
- protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS"; //$NON-NLS-1$
- protected static final String IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL = "IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL"; //$NON-NLS-1$
- protected static final String PREMATURE_EOF = "PrematureEOF"; //$NON-NLS-1$
- protected static final String ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL = "RootElementTypeMustMatchDoctypedecl"; //$NON-NLS-1$
- protected static final String MSG_ELEMENT_NOT_DECLARED = "MSG_ELEMENT_NOT_DECLARED"; //$NON-NLS-1$
-
- // WTP XML validator specific key.
- protected static final String NO_GRAMMAR_FOUND = "NO_GRAMMAR_FOUND"; //$NON-NLS-1$
- protected static final String NO_DOCUMENT_ELEMENT_FOUND = "NO_DOCUMENT_ELEMENT_FOUND"; //$NON-NLS-1$
-
- private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND"; //$NON-NLS-1$
-
- private MarkupValidator val = new MarkupValidator();
-
- private final String ANNOTATIONMSG = AnnotationMsg.class.getName();
-
- private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.xml.core/externalSchemaLocation")).booleanValue(); //$NON-NLS-1$
- /**
- * Constructor.
- */
- public XMLValidator()
- {
- // Here we add some error keys that we need to filter out when we're validation
- // against a DTD without any element declarations.
- ingoredErrorKeyTable.put(PREMATURE_EOF, IGNORE_ALWAYS);
- ingoredErrorKeyTable.put(ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL, IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL);
- ingoredErrorKeyTable.put(MSG_ELEMENT_NOT_DECLARED, IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL);
-
- // Here we add some error keys that we need to adjust the location information for.
- // The location information will be adjusted to place the message on the line of the starting
- // element instead of on the line of the closing element.
- adjustLocationErrorKeySet.add("MSG_CONTENT_INVALID"); //$NON-NLS-1$
- adjustLocationErrorKeySet.add("MSG_CONTENT_INCOMPLETE"); //$NON-NLS-1$
- adjustLocationErrorKeySet.add("cvc-complex-type.2.4.b"); //$NON-NLS-1$
- adjustLocationErrorKeySet.add("cvc-complex-type.2.3"); //$NON-NLS-1$
- }
-
- /**
- * Set the URI Resolver to use.
- *
- * @param uriResolver The URI Resolver to use.
- */
- public void setURIResolver(URIResolver uriResolver)
- {
- this.uriResolver = uriResolver;
- //entityResolver = new MyEntityResolver(uriResolver);
- }
-
-
- /**
- * Create an XML Reader.
- *
- * @return The newly created XML reader or null if unsuccessful.
- * @throws Exception
- */
- protected XMLReader createXMLReader(final XMLValidationInfo valinfo, XMLEntityResolver entityResolver) throws Exception
- {
- XMLReader reader = null;
- // move to Xerces-2... add the contextClassLoader stuff
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- MyStandardParserConfiguration configuration = new MyStandardParserConfiguration(valinfo);
- reader = new org.apache.xerces.parsers.SAXParser(configuration)
- {
- private XMLLocator locator = null;
-
- /* (non-Javadoc)
- * @see org.apache.xerces.parsers.AbstractSAXParser#startDocument(org.apache.xerces.xni.XMLLocator, java.lang.String, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xni.Augmentations)
- */
- public void startDocument(org.apache.xerces.xni.XMLLocator theLocator, java.lang.String encoding, NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs)
- {
- locator = theLocator;
- valinfo.setXMLLocator(theLocator);
- super.startDocument(theLocator, encoding, nscontext, augs);
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.parsers.AbstractSAXParser#startElement(org.apache.xerces.xni.QName, org.apache.xerces.xni.XMLAttributes, org.apache.xerces.xni.Augmentations)
- */
- public void startElement(QName arg0, XMLAttributes arg1, Augmentations arg2) throws XNIException
- {
- valinfo.getStartElementLocations().push(new LocationCoordinate(locator.getLineNumber(), locator.getColumnNumber()));
- super.startElement(arg0, arg1, arg2);
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.parsers.AbstractSAXParser#endElement(org.apache.xerces.xni.QName, org.apache.xerces.xni.Augmentations)
- */
- public void endElement(QName arg0, Augmentations arg1) throws XNIException {
- super.endElement(arg0, arg1);
- valinfo.getStartElementLocations().pop();
- }
- };
-
- reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes", valinfo.isNamespaceEncountered()); //$NON-NLS-1$
- reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered()); //$NON-NLS-1$
-
- reader.setContentHandler(new DefaultHandler()
- {
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- valinfo.getErrorCustomizationManager().startElement(uri, localName);
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException {
- valinfo.getErrorCustomizationManager().endElement(uri, localName);
- }
- });
-
- // MH make sure validation works even when a customer entityResolver is note set (i.e. via setURIResolver())
- if (entityResolver != null)
- {
- reader.setProperty("http://apache.org/xml/properties/internal/entity-resolver", entityResolver); //$NON-NLS-1$
- }
- reader.setProperty("http://xml.org/sax/properties/declaration-handler", new MyDeclHandler()); //$NON-NLS-1$
- }
- catch(Exception e)
- {
- Logger.logException(e);
- //e.printStackTrace();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- return reader;
- }
-
- /**
- * Validate the file located at the given URI.
- *
- * @param uri The URI of the file to validate.
- * @return Returns an XML validation report.
- */
- public XMLValidationReport validate(String uri)
- {
- return validate(uri, null, new XMLValidationConfiguration());
- }
-
- final String createStringForInputStream(InputStream inputStream)
- {
- // Here we are reading the file and storing to a stringbuffer.
- StringBuffer fileString = new StringBuffer();
- try
- {
- InputStreamReader inputReader = new InputStreamReader(inputStream, "UTF-8"); //$NON-NLS-1$
- BufferedReader reader = new BufferedReader(inputReader);
- char[] chars = new char[1024];
- int numberRead = reader.read(chars);
- while (numberRead != -1)
- {
- fileString.append(chars, 0, numberRead);
- numberRead = reader.read(chars);
- }
- }
- catch (Exception e)
- {
- //TODO: log error message
- //e.printStackTrace();
- }
- return fileString.toString();
- }
- /**
- * Validate the inputStream
- *
- * @param uri The URI of the file to validate.
- * @param the inputStream of the file to validate
- * @return Returns an XML validation report.
- */
- public XMLValidationReport validate(String uri, InputStream inputStream)
- {
- return validate(uri, inputStream, new XMLValidationConfiguration());
- }
- /**
- * Validate the inputStream
- *
- * @param uri
- * The URI of the file to validate.
- * @param inputstream
- * The inputStream of the file to validate
- * @param configuration
- * A configuration for this validation session.
- * @return
- * Returns an XML validation report.
- */
- public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration)
- {
- return validate(uri, inputStream, configuration, null);
- }
-
- /**
- * Validate the inputStream
- *
- * @param uri
- * The URI of the file to validate.
- * @param inputstream
- * The inputStream of the file to validate
- * @param configuration
- * A configuration for this validation session.
- * @param result
- * The validation result
- * @return
- * Returns an XML validation report.
- */
- public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration, ValidationResult result)
- {
- return validate(uri, inputStream, configuration, null, null);
- }
-
- /**
- * Validate the inputStream
- *
- * @param uri
- * The URI of the file to validate.
- * @param inputstream
- * The inputStream of the file to validate
- * @param configuration
- * A configuration for this validation session.
- * @param result
- * The validation result
- * @param context
- * The validation context
- * @return
- * Returns an XML validation report.
- */
- public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration, ValidationResult result, NestedValidatorContext context)
- {
- String grammarFile = ""; //$NON-NLS-1$
- Reader reader1 = null; // Used for the preparse.
- Reader reader2 = null; // Used for validation parse.
-
- if (inputStream != null)
- {
- String string = createStringForInputStream(inputStream);
- reader1 = new StringReader(string);
- reader2 = new StringReader(string);
- }
-
- XMLValidationInfo valinfo = new XMLValidationInfo(uri);
- MyEntityResolver entityResolver = new MyEntityResolver(uriResolver, context);
- ValidatorHelper helper = new ValidatorHelper();
- try
- {
- helper.computeValidationInformation(uri, reader1, uriResolver);
- valinfo.setDTDEncountered(helper.isDTDEncountered);
- valinfo.setElementDeclarationCount(helper.numDTDElements);
- valinfo.setNamespaceEncountered(helper.isNamespaceEncountered);
- valinfo.setGrammarEncountered(helper.isGrammarEncountered);
- XMLReader reader = createXMLReader(valinfo, entityResolver);
- // Set the configuration option
- if (configuration.getFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS))
- {
- reader.setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true); //$NON-NLS-1$
- }
- if (configuration.getFeature(XMLValidationConfiguration.USE_XINCLUDE))
- {
- reader.setFeature("http://apache.org/xml/features/xinclude", true); //$NON-NLS-1$
- }
-
- // Support external schema locations
- boolean isGrammarEncountered = helper.isGrammarEncountered;
- if (!isGrammarEncountered) {
- isGrammarEncountered = checkExternalSchemas(reader, valinfo.getFileURI());
- }
- reader.setFeature("http://xml.org/sax/features/validation", isGrammarEncountered); //$NON-NLS-1$
- reader.setFeature("http://apache.org/xml/features/validation/schema", isGrammarEncountered); //$NON-NLS-1$
-
- XMLErrorHandler errorhandler = new XMLErrorHandler(valinfo);
- reader.setErrorHandler(errorhandler);
-
- InputSource inputSource = new InputSource(uri);
- inputSource.setCharacterStream(reader2);
- reader.parse(inputSource);
- if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR) > 0 &&
- valinfo.isValid() && !isGrammarEncountered)
- {
- if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR) == 1)
- valinfo.addWarning(XMLValidationMessages._WARN_NO_GRAMMAR, 1, 0, uri, NO_GRAMMAR_FOUND, null);
- else // 2
- valinfo.addError(XMLValidationMessages._WARN_NO_GRAMMAR, 1, 0, uri, NO_GRAMMAR_FOUND, null);
- }
- if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_DOCUMENT_ELEMENT) > 0 && valinfo.isValid() && !helper.isDocumentElementEncountered) {
- if(configuration.getIntFeature(XMLValidationConfiguration.INDICATE_NO_DOCUMENT_ELEMENT) == 1)
- valinfo.addWarning(XMLValidationMessages._NO_DOCUMENT_ELEMENT, 1, 0, uri, NO_DOCUMENT_ELEMENT_FOUND, null);
- else // 2
- valinfo.addError(XMLValidationMessages._NO_DOCUMENT_ELEMENT, 1, 0, uri, NO_DOCUMENT_ELEMENT_FOUND, null);
- }
- if (helper.isDTDEncountered)
- grammarFile = entityResolver.getLocation();
- else
- grammarFile = helper.schemaLocationString;
- }
- catch (SAXParseException saxParseException)
- {
- // These errors are caught by the error handler.
- //addValidationMessage(valinfo, saxParseException);
- }
- catch (IOException ioException)
- {
- addValidationMessage(valinfo, ioException);
- }
- catch (Exception exception)
- {
- Logger.logException(exception.getLocalizedMessage(), exception);
- }
-
- // Now set up the dependencies
- // Wrap with try catch so that if something wrong happens, validation can
- // still proceed as before
- if (result != null)
- {
- try
- {
- IResource resource = getWorkspaceFileFromLocation(grammarFile);
- ArrayList resources = new ArrayList();
- if (resource != null)
- resources.add(resource);
- result.setDependsOn((IResource [])resources.toArray(new IResource [0]));
- }
- catch (Exception e)
- {
- Logger.logException(e.getLocalizedMessage(), e);
- }
- }
-
- if ( XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION)){
- IReporter reporter = executeMarkupValidator(uri);
- if (reporter != null){
- List msgList = reporter.getMessages();
- for (int i = 0;i < msgList.size();i++){
- LocalizedMessage msg = (LocalizedMessage)msgList.get(i);
- if (msg.getSeverity() == 2)
- valinfo.addError(msg.getLocalizedMessage(), msg.getLineNumber(), msg.getOffset(),valinfo.getFileURI(),"null",getMsgArguments(msg) ); //$NON-NLS-1$
- else if (msg.getSeverity() == 1)
- valinfo.addWarning(msg.getLocalizedMessage(), msg.getLineNumber(), msg.getOffset(),valinfo.getFileURI(),"null", getMsgArguments(msg)); //$NON-NLS-1$
- }
- }
- }
-
- return valinfo;
-
- }
-
- private boolean checkExternalSchemas(XMLReader reader, String fileURI) throws Exception {
- boolean isGrammarEncountered = false;
- final StringBuffer schemaLocation = new StringBuffer();
- String noNamespaceSchemaLocation = null;
- // Check the schema provider extension point
- IExternalSchemaLocationProvider[] providers = ExternalSchemaLocationProviderRegistry.getInstance().getProviders();
- for (int i = 0; i < providers.length; i++) {
- URI uri = null;
- try {
- uri = URIUtil.fromString(fileURI);
- }
- catch (URISyntaxException e) {
- Logger.logException(e.getLocalizedMessage(), e);
- }
- if (uri != null) {
- long time = _trace ? System.currentTimeMillis(): 0;
- final Map locations = providers[i].getExternalSchemaLocation(uri);
- if (_trace) {
- long diff = System.currentTimeMillis() - time;
- if (diff > 250)
- Logger.log(Logger.INFO, "Schema location provider took [" + diff + "ms] for URI [" + fileURI + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (locations != null && !locations.isEmpty()) {
- Object path = locations.get(IExternalSchemaLocationProvider.SCHEMA_LOCATION);
- if (path instanceof String) {
- if (schemaLocation.length() > 0) {
- schemaLocation.append(' ');
- }
- schemaLocation.append(path);
- }
- path = locations.get(IExternalSchemaLocationProvider.NO_NAMESPACE_SCHEMA_LOCATION);
- if (path instanceof String) {
- noNamespaceSchemaLocation = (String)path;
- }
- }
- }
- }
-
- if (schemaLocation.length() > 0) {
- reader.setProperty(IExternalSchemaLocationProvider.SCHEMA_LOCATION, schemaLocation.toString());
- isGrammarEncountered = true;
- }
- if (noNamespaceSchemaLocation != null) {
- reader.setProperty(IExternalSchemaLocationProvider.NO_NAMESPACE_SCHEMA_LOCATION, noNamespaceSchemaLocation);
- isGrammarEncountered = true;
- }
- return isGrammarEncountered;
- }
-
- private Object[] getMsgArguments(LocalizedMessage msg){
- Object obj = msg.getAttribute(ANNOTATIONMSG);
- return new Object[]{obj};
- }
-
-
- private IReporter executeMarkupValidator(String uri){
- Path path = new Path(uri);
- String fileProtocol = "file://"; //$NON-NLS-1$
- int index = uri.indexOf(fileProtocol);
-
- IFile resource = null;
- if (index == 0){
- String transformedUri = uri.substring(fileProtocol.length());
- Path transformedPath = new Path(transformedUri);
- resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(transformedPath);
- }
- else {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-
- }
- IReporter reporter = null;
- if (resource != null){
- reporter = val.validate(resource, 0, new ValOperation().getState()) ;
- }
- return reporter;
- }
-
- /**
- * Add a validation message to the specified list.
- *
- * @param valinfo The validation info object to add the error to.
- * @param exception The exception that contains the validation information.
- */
- protected void addValidationMessage(XMLValidationInfo valinfo, IOException exception)
- {
- String validationMessageStr = exception.getMessage();
- Throwable cause = exception.getCause() != null ? exception.getCause() : exception;
- while(validationMessageStr == null && cause != null){
- String localizedMessage = cause.getLocalizedMessage();
- cause = cause.getCause();
- if(cause == null && localizedMessage != null )
- {
- validationMessageStr = localizedMessage;
- }
- }
-
- if (validationMessageStr != null)
- {
- if (cause instanceof FileNotFoundException)
- {
- validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND, new Object [] { validationMessageStr });
- }
- else if (cause instanceof UnknownHostException)
- {
- validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_UNKNOWN_HOST, new Object [] { validationMessageStr });
- }
- else if(cause instanceof ConnectException)
- {
- validationMessageStr = XMLValidationMessages._UI_PROBLEMS_CONNECTION_REFUSED;
- }
- }
-
- if (validationMessageStr != null)
- {
- XMLLocator locator = valinfo.getXMLLocator();
- valinfo.addWarning(validationMessageStr, locator != null ? locator.getLineNumber() : 1, locator != null ? locator.getColumnNumber() : 0, valinfo.getFileURI(), FILE_NOT_FOUND_KEY, null);
- }
- }
-
- /**
- * Add a validation message to the specified list.
- *
- * @param valinfo The validation info object to add the error to.
- * @param exception The exception that contains the validation information.
- */
- protected void addValidationMessage(XMLValidationInfo valinfo, SAXParseException exception)
- {
- if (exception.getMessage() != null)
- {
- valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
- }
- }
-
-
- /**
- * A custom entity resolver that uses the URI resolver specified to resolve entities.
- */
- protected class MyEntityResolver implements XMLEntityResolver
- {
- private URIResolver uriResolver;
- private String resolvedDTDLocation;
- private NestedValidatorContext context;
-
- /**
- * Constructor.
- *
- * @param uriResolver The URI resolver to use with this entity resolver.
- * @param context The XML validator context.
- */
- public MyEntityResolver(URIResolver uriResolver, NestedValidatorContext context)
- {
- this.uriResolver = uriResolver;
- this.context = context;
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xni.parser.XMLEntityResolver#resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier)
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier rid) throws XNIException, IOException
- {
- XMLInputSource inputSource = _internalResolveEntity(uriResolver, rid, context);
- if (inputSource != null)
- {
- resolvedDTDLocation = inputSource.getSystemId();
- }
- return inputSource;
- }
-
- public String getLocation()
- {
- return resolvedDTDLocation;
- }
- }
-
- // cs : I've refactored the common SAX based resolution code into this method for use by other validators
- // (i.e. XML Schema, WSDL etc). The other approach is maintain a copy for each validator that has
- // identical code. In any case we should strive to ensure that the validators perform resolution consistently.
- public static XMLInputSource _internalResolveEntity(URIResolver uriResolver, XMLResourceIdentifier rid) throws IOException
- {
- return _internalResolveEntity(uriResolver, rid, null);
- }
-
- public static XMLInputSource _internalResolveEntity(URIResolver uriResolver, XMLResourceIdentifier rid, NestedValidatorContext context) throws IOException
- {
- XMLInputSource is = null;
-
- if (uriResolver != null)
- {
- String id = rid.getPublicId();
- if(id == null)
- {
- id = rid.getNamespace();
- }
-
- String location = null;
- if (id != null || rid.getLiteralSystemId() != null)
- {
- location = uriResolver.resolve(rid.getBaseSystemId(), id, rid.getLiteralSystemId());
- }
-
- if (location != null)
- {
- String physical = uriResolver.resolvePhysicalLocation(rid.getBaseSystemId(), id, location);
-
- // if physical is already a known bad uri, just go ahead and throw an exception
- if (context instanceof XMLNestedValidatorContext)
- {
- XMLNestedValidatorContext xmlContext = ((XMLNestedValidatorContext)context);
-
- if (xmlContext.isURIMarkedInaccessible(physical))
- {
- throw new FileNotFoundException(physical);
- }
- }
-
- is = new XMLInputSource(rid.getPublicId(), location, location);
-
- // This block checks that the file exists. If it doesn't we need to throw
- // an exception so Xerces will report an error. note: This may not be
- // necessary with all versions of Xerces but has specifically been
- // experienced with the version included in IBM's 1.4.2 JDK.
- InputStream isTemp = null;
- try
- {
- isTemp = new URL(physical).openStream();
- }
- catch (IOException e)
- {
- // physical was a bad url, so cache it so we know next time
- if (context instanceof XMLNestedValidatorContext)
- {
- XMLNestedValidatorContext xmlContext = ((XMLNestedValidatorContext)context);
- xmlContext.markURIInaccessible(physical);
- }
- throw e;
- }
- finally
- {
- if(isTemp != null)
- {
- isTemp.close();
- }
- }
- is.setByteStream(new LazyURLInputStream(physical));
- }
- }
- return is;
- }
-
- /**
- * An error handler to catch errors encountered while parsing the XML document.
- */
- protected class XMLErrorHandler implements org.xml.sax.ErrorHandler
- {
-
- private final int ERROR = 0;
- private final int WARNING = 1;
- private XMLValidationInfo valinfo;
-
- /**
- * Constructor.
- *
- * @param valinfo The XML validation info object that will hold the validation messages.
- */
- public XMLErrorHandler(XMLValidationInfo valinfo)
- {
- this.valinfo = valinfo;
- }
-
- /**
- * Add a validation message with the given severity.
- *
- * @param exception The exception that contains the message.
- * @param severity The severity of the message.
- */
-
- protected void addValidationMessage(SAXParseException exception, int severity)
- {
- if(exception.getSystemId() != null)
- {
- int lineNumber = exception.getLineNumber();
- int columnNumber = exception.getColumnNumber();
-
- // For the following three errors the line number will be modified to use that of the start
- // tag instead of the end tag. Unless its a self ending tag and in that case the startElementLocations will be empty
- String currentErrorKey = valinfo.currentErrorKey;
- if (currentErrorKey != null && adjustLocationErrorKeySet.contains(currentErrorKey) && valinfo.getStartElementLocations().size() > 0)
- {
- LocationCoordinate adjustedCoordinates = (LocationCoordinate)valinfo.getStartElementLocations().peek();
- lineNumber = adjustedCoordinates.getLineNumber();
- columnNumber = adjustedCoordinates.getColumnNumner();
- }
-
- if(severity == WARNING)
- {
- valinfo.addWarning(exception.getLocalizedMessage(), lineNumber, columnNumber, exception.getSystemId());
- }
- else
- {
- valinfo.addError(exception.getLocalizedMessage(), lineNumber, columnNumber, exception.getSystemId(), valinfo.getCurrentErrorKey(), valinfo.getMessageArguments());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException exception) throws SAXException
- {
- addValidationMessage(exception, ERROR);
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException exception) throws SAXException
- {
- addValidationMessage(exception, ERROR);
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException exception) throws SAXException
- {
- addValidationMessage(exception, WARNING);
- }
- }
-
- /**
- * This class is used to count the elementDecls that are encountered in a DTD.
- */
- protected class MyDeclHandler implements DeclHandler
- {
-
- /**
- * Constructor.
- *
- * @param valinfo The XMLValidationInfo object that will count the declarations.
- */
- public MyDeclHandler()
- {
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void attributeDecl(String eName, String aName, String type, String valueDefault, String value)
- {
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
- */
- public void elementDecl(String name, String model)
- {
- //valinfo.increaseElementDeclarationCount();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
- */
- public void externalEntityDecl(String name, String publicId, String systemId)
- {
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String, java.lang.String)
- */
- public void internalEntityDecl(String name, String value)
- {
- }
- }
-
- /**
- * A XIncludeAwareParserConfiguration that creates an error reporter which can ignore
- * DTD error messages for DTD's with no elements defined.
- */
-
- protected class MyStandardParserConfiguration extends XIncludeAwareParserConfiguration
- {
- XMLValidationInfo valinfo = null;
- List reportedExceptions = new ArrayList();
-
- /**
- * Constructor.
- *
- * @param valinfo The XMLValidationInfo object to use.
- */
- public MyStandardParserConfiguration(XMLValidationInfo valinfo)
- {
- this.valinfo = valinfo;
-
- XMLErrorReporter errorReporter = createErrorReporter();
- if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
- fErrorReporter = errorReporter;
- setProperty(ERROR_REPORTER, errorReporter);
- fCommonComponents.remove(fErrorReporter);
- fCommonComponents.add(fErrorReporter);
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.parsers.DTDConfiguration#createErrorReporter()
- */
- protected XMLErrorReporter createErrorReporter()
- {
- return new XMLErrorReporter()
- {
- /* (non-Javadoc)
- * @see org.apache.xerces.impl.XMLErrorReporter#reportError(java.lang.String, java.lang.String, java.lang.Object[], short)
- */
- public void reportError(String domain, String key, Object[] arguments, short severity) throws XNIException
- {
- boolean reportError = true;
- valinfo.setCurrentErrorKey(key);
- valinfo.setMessageArguments(arguments);
- String ignoreCondition = (String)ingoredErrorKeyTable.get(key);
- if (ignoreCondition != null)
- {
- if (ignoreCondition.equals(XMLValidator.IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL))
- {
- boolean isDTDWithoutElementDeclarationEncountered = valinfo.isDTDWithoutElementDeclarationEncountered();
- reportError = !isDTDWithoutElementDeclarationEncountered;
- }
- else
- {
- reportError = false;
- }
- }
- if ("schema_reference.4".equals(key) && arguments.length > 0) //$NON-NLS-1$
- {
- Object location = arguments[0];
- if (location != null)
- {
- if(reportedExceptions.contains(location))
- {
- reportError = false;
- }
- else
- {
- reportedExceptions.add(location);
- }
- }
- }
- if (reportError)
- {
- super.reportError(domain, key, arguments, severity);
- valinfo.getErrorCustomizationManager().considerReportedError(valinfo, key, arguments);
- }
- }
- };
- }
- }
-
- /**
- * A line and column number coordinate.
- */
- protected class LocationCoordinate
- {
- private int lineNo = -1;
- private int columnNo = -1;
-
- public LocationCoordinate(int lineNumber, int columnNumber)
- {
- this.lineNo = lineNumber;
- this.columnNo = columnNumber;
- }
-
- public int getLineNumber()
- {
- return this.lineNo;
- }
-
- public int getColumnNumner()
- {
- return this.columnNo;
- }
- }
-
- protected IResource getWorkspaceFileFromLocation(String location)
- {
- if (location == null) return null;
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // To canonicalize the EMF URI
- IPath canonicalForm = new Path(location);
- // Need to convert to absolute location...
- IPath pathLocation = new Path(URIHelper.removeProtocol(canonicalForm.toString()));
- // ...to find the resource file that is in the workspace
- IResource resourceFile = workspace.getRoot().getFileForLocation(pathLocation);
- // If the resource is resolved to a file from http, or a file outside
- // the workspace, then we will just ignore it.
- return resourceFile;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
deleted file mode 100644
index f3a4da8801..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
+++ /dev/null
@@ -1,543 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-import org.eclipse.wst.xml.core.internal.validation.AnnotationMsg;
-
-/**
- * An abstract validator that assists validators in running and contributing
- * nested messages in the validation results.
- * *note: Subclasses do not need to contribute nested messages in order to
- * benefit from the use of this class. This class takes care of iterating
- * through results for validators that use the standard context.
- */
-public abstract class AbstractNestedValidator extends AbstractValidator implements IValidatorJob
-{
- // Locally used, non-UI strings.
- private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
- private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
- private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
- private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
- private final String GET_FILE = "getFile"; //$NON-NLS-1$
- private final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
- private final String GET_INPUTSTREAM = "inputStream"; //$NON-NLS-1$
-
- // Internal strings. These strings are common addition information types.
- protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
- protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
- protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
-
- /**
- * Perform the validation using version 2 of the validation framework.
- */
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- IFile file = null;
- if (resource instanceof IFile)file = (IFile)resource;
- if (file != null)
- {
- NestedValidatorContext nestedcontext = getNestedContext(state, false);
- boolean teardownRequired = false;
- if (nestedcontext == null)
- {
- // validationstart was not called, so manually setup and tear down
- nestedcontext = getNestedContext(state, true);
- nestedcontext.setProject(file.getProject());
- setupValidation(nestedcontext);
- teardownRequired = true;
- }
- else {
- nestedcontext.setProject(file.getProject());
- }
- validate(file, null, result, reporter, nestedcontext);
-
- if (teardownRequired)
- teardownValidation(nestedcontext);
- }
- return result;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- public IStatus validateInJob(IValidationContext context, IReporter reporter) throws ValidationException
- {
- NestedValidatorContext nestedcontext = new NestedValidatorContext();
- setupValidation(nestedcontext);
- String[] fileURIs = context.getURIs();
- if (fileURIs != null && fileURIs.length > 0)
- {
- int numFiles = fileURIs.length;
- for (int i = 0; i < numFiles && !reporter.isCancelled(); i++)
- {
- String fileName = fileURIs[i];
- if (fileName != null)
- {
- Object []parms = {fileName};
-
- IFile file = (IFile) context.loadModel(GET_FILE, parms);
- if (file != null && shouldValidate(file))
- {
- nestedcontext.setProject(file.getProject());
- // The helper may not have a file stored in it but may have an InputStream if being
- // called from a source other than the validation framework such as an editor.
- if (context.loadModel(GET_INPUTSTREAM) instanceof InputStream)
- {
- validate(file, (InputStream)context.loadModel(GET_INPUTSTREAM), null, reporter, nestedcontext); //do we need the fileName? what is int ruleGroup?
- }
- else
- {
- validate(file, null, null, reporter, nestedcontext);
- }
- }
- }
- }
- }
- // TODO: Is this needed? Shouldn't the framework pass the complete list?
- // Should I know that I'm validating a project as opposed to files?
- else
- {
- Object []parms = {getValidatorID()};
- Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
- // files can be null if they're outside of the workspace
- if (files != null) {
- Iterator iter = files.iterator();
- while (iter.hasNext() && !reporter.isCancelled())
- {
- IFile file = (IFile) iter.next();
- if(shouldValidate(file))
- {
- validate(file, null, null, reporter, nestedcontext);
- }
- }
- }
- }
-
- teardownValidation(nestedcontext);
- if(reporter.isCancelled())
- return Status.CANCEL_STATUS;
- return Status.OK_STATUS;
- }
-
- /**
- * Provides the id of this validator. The ID is used by the validation
- * framework. It usually is the fully qualified class name of the class
- * implementing the IValidator interface.
- *
- * @return a String with the ID of this validator.
- */
- protected String getValidatorID()
- {
- return this.getClass().getName();
- }
-
- /**
- * Perform set up before validation runs. Subclasses may implement this
- * method to perform validation specific set up.
- *
- * @param context
- * The context of the current validation.
- */
- protected void setupValidation(NestedValidatorContext context)
- {
- // Default implementation does nothing.
- }
-
- /**
- * Perform tear down after validation runs. Subclasses may implement this
- * method to perform validation specific tear down.
- *
- * @param context
- * The context of the current validation.
- */
- protected void teardownValidation(NestedValidatorContext context)
- {
- // Default implementation does nothing.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
- */
- public ISchedulingRule getSchedulingRule(IValidationContext arg0)
- {
- // TODO review whether returning a null rule is correct. Gary had a suggestion in the bug report.
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- public void cleanup(IReporter arg0)
- {
- // No cleanup to perform. Subclasses are free to implement this method.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#validate(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- public void validate(IValidationContext context, IReporter reporter) throws ValidationException
- {
- validateInJob(context, reporter);
- }
-
-
- /**
- * Determine if a given file should be validated.
- *
- * @param file The file that may be validated.
- * @return True if the file should be validated, false otherwise.
- */
- private static boolean shouldValidate(IFile file)
- {
- 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;
- }
-
- /**
- * Validate the given file and use the reporter for the validation messages.
- * This method does not perform the validation logic but rather delegates
- * to the validate method in subclasses to validate. This method is responsible
- * for reporting the messages that result from validation.
- *
- * @param file
- * An IFile to validate.
- * @param inputstream
- * An InputStream that represents the file. The InputStream may be null
- * in which case the files should be validated from the IFile.
- * @param result - The validation result
- * @param reporter
- * The reporter with which to report validation messages.
- * @param context
- * The context of the current validation.
- */
- private void validate(IFile file, InputStream inputstream, ValidationResult result, IReporter reporter, NestedValidatorContext context)
- {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString());
- reporter.displaySubtask(this, message);
-
- String locationString = null;
- if (file.getLocation() != null) {
- locationString = file.getLocation().toString();
- }
- if (locationString == null && file.getLocationURI() != null) {
- locationString = file.getLocationURI().toString();
- }
- if (locationString == null) {
- locationString = file.getFullPath().toString();
- }
- String uri = createURIForFilePath(locationString);
-
- clearMarkers(file, this, reporter);
-
- ValidationReport valreport = null;
- if (result == null)
- valreport = validate(uri, inputstream, context);
- else
- valreport = validate(uri, inputstream, context, result);
-
- createMarkers(file, valreport.getValidationMessages(), reporter);
-
- try
- {
- file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
- }
- catch(CoreException e)
- {
- System.out.println("Unable to set nested messages property."); //$NON-NLS-1$
- }
- }
-
- /**
- * Validate the given file and use the reporter for the validation messages.
- * Clients must implement this method with their specific validation logic.
- *
- * @param uri
- * The URI of the file to validate.
- * @param inputstream
- * An InputStream that represents the file. The InputStream may be null
- * in which case the files should be validated from the IFile.
- * @param context
- * The context of the current validation.
- * @return
- * A validation report summarizing the validation.
- */
- public abstract ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context);
-
- /**
- * Validate the given file and use the reporter for the validation messages.
- * Clients should override this method with their specific validation logic.
- * This method should now be used instead of the abstract version.
- * Design decision to not make this abstract.
- *
- * @param uri
- * @param inputstream
- * @param context
- * @param result
- * @return
- */
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result)
- {
- return validate(uri, inputstream, context);
- }
-
- /**
- * This method clears all the markers on the given IFile for a specified
- * validator.
- * This is a convenience method for subclasses.
- *
- * @param iFile
- * The IFile from which to clear the markers.
- * @param validator
- * The validator for which to remove the markers.
- * @param reporter
- * The reporter that can remove the markers.
- */
- private void clearMarkers(IFile iFile, IValidator validator, IReporter reporter)
- {
- if (fileIsAccessible(iFile))
- {
- reporter.removeAllMessages(validator, iFile);
- }
- }
-
- /**
- * Test whether the given file is accessible and may be used for validation. A file is
- * available if
- * 1. It is not null.
- * 2. It exists.
- * 3. The project containing the file is accessible.
- *
- * @param file
- * The file to check to ensure it is accessible.
- * @return
- * True if the file is accessible, false otherwise.
- */
- private boolean fileIsAccessible(IFile file)
- {
- if (file != null && file.exists() && file.getProject().isAccessible())
- {
- return true;
- }
- return false;
- }
-
- /**
- * Format a file name into a correct URI.
- * This is a convenience method for subclasses.
- *
- * @param filename
- * The file name to format.
- * @return
- *
- * The formatted URI.
- */
- private String createURIForFilePath(String filename)
- {
- if(!filename.startsWith(FILE_PROTOCOL_NO_SLASH))
- {
- while(filename.startsWith("/")) //$NON-NLS-1$
- {
- filename = filename.substring(1);
- }
- filename = FILE_PROTOCOL + filename;
- }
- return filename;
- }
-
- /**
- * Create markers for the valiation messages generated from the validation.
- *
- * @param iFile
- * The resource to create the markers on.
- * @param valmessages
- * The array of validation messages.
- */
- public void createMarkers(IFile iFile, ValidationMessage[] valmessages, IReporter reporter)
- {
- if (!fileIsAccessible(iFile))
- {
- return;
- }
- int nummessages = valmessages.length;
- for (int i = 0; i < nummessages; i++)
- {
- ValidationMessage validationMessage = valmessages[i];
- String uri = validationMessage.getUri();
-
- LocalizedMessage message;
- if (validationMessage.getSeverity() == ValidationMessage.SEV_LOW)
- {
- message = new LocalizedMessage(IMessage.NORMAL_SEVERITY,
- validationMessage.getMessage(), iFile);
- }
- else
- {
- message = new LocalizedMessage(IMessage.HIGH_SEVERITY, validationMessage.getMessage(), iFile);
- }
-
- message.setLineNo(validationMessage.getLineNumber());
- addInfoToMessage(validationMessage, message);
- Object[] objlist = validationMessage.getMessageArguments();
- if (objlist != null && objlist.length ==1 ){
- Object obj = objlist[0];
- if (obj instanceof AnnotationMsg){
- message.setAttribute(AnnotationMsg.PROBMLEM_ID, new Integer(((AnnotationMsg)obj).getProblemId()));
- message.setAttribute(AnnotationMsg.LENGTH, new Integer(((AnnotationMsg)obj).getLength()));
- Object obj1 = ((AnnotationMsg)obj).getAttributeValueText();
- if (obj1 instanceof String){
- message.setAttribute(AnnotationMsg.ATTRVALUETEXT, obj1);
- }
- else if ( obj1 instanceof Object[]){
- Object[] objArray = (Object[])obj1;
- message.setAttribute(AnnotationMsg.ATTRVALUENO, new Integer(objArray.length));
- for (int j=0; j <objArray.length;j++){
- Object obj2 = objArray[j];
- String attrName = AnnotationMsg.ATTRNO + j;
- message.setAttribute(attrName, obj2);
- }
-
- }
- }
- }
- List nestederrors = validationMessage.getNestedMessages();
- if (nestederrors != null && !nestederrors.isEmpty())
- {
- message.setGroupName(REFERENCED_FILE_ERROR_OPEN + uri + REFERENCED_FILE_ERROR_CLOSE);
- }
-
- reporter.addMessage(this, message);
-
- }
- }
-
- /**
- * This method allows the addition of information to the validation message
- * @param validationmessage
- * The ValidationMessage to retrieve the information from.
- * @param message
- * The IMessage to add the information to.
- */
- protected void addInfoToMessage (ValidationMessage validationmessage, IMessage message)
- {
- // This method may be overridden by subclasses
- }
-
- /**
- * Get the nested validation context.
- *
- * @param state
- * the validation state.
- * @param create
- * when true, a new context will be created if one is not found
- * @return the nested validation context.
- */
- protected NestedValidatorContext getNestedContext(ValidationState state, boolean create)
- {
- NestedValidatorContext context = null;
- if (create)
- {
- context = new NestedValidatorContext();
- }
- return context;
- }
-
- /**
- * A localized message is a specialized type of IMessage that allows setting
- * and using a localized message string for a message.
- */
- 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.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
deleted file mode 100644
index d9497af689..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
+++ /dev/null
@@ -1,259 +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.xml.core.internal.validation.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.internal.operations.ValidatorManager;
-import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-/**
- * A helper class for validation in the validation framework.
- *
- * @author Ernest Mah (ernest@ca.ibm.com)
- * @author Lawrence Mandel, IBM
- */
-public class Helper extends WorkbenchContext
-{
- public static final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
- public static final String GET_FILE = "getFile"; //$NON-NLS-1$
- //dw private static final IContainer[] NO_CONTAINERS = new IContainer[0];
- public static final String VALIDATION_MARKER = "org.eclipse.wst.validation.problemmarker"; //$NON-NLS-1$
- public static final String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$
-
- /**
- * Constructor.
- */
- public Helper()
- {
- super();
-
- // the following will register the helper's symbolic methods
- Class [] args = new Class[1] ;
- args[0] = String.class ; // a string argument denoting a specific JSP.
-
- registerModel(GET_FILE, "getFile", args);//$NON-NLS-1$
- registerModel(GET_PROJECT_FILES, "getFiles", args);//$NON-NLS-1$
- }
-
- /**
- * Get the IFile for the given filename.
- *
- * @param filename The name of the file to retrieve.
- * @return An IFile representing the file specified or null if it can't be resolved.
- */
- public IFile getFile(String filename)
- {
- // System.out.println("file name = " + filename);
- IResource res = getProject().findMember(filename, true); // true means include phantom resources
- if (res instanceof IFile)
- {
- return (IFile) res;
- }
- return null;
- }
-
- /**
- * Get the collection of files from the project that are relevant for the
- * validator with the given class name.
- *
- * @param validatorClassName The name of the validator class.
- * @return The collection of files relevant for the validator class specified.
- */
- public Collection getFiles(String validatorClassName)
- {
- IProject project = getProject();
- List files = new ArrayList();
- getFiles(files, project, validatorClassName);
- return files;
- }
-
- /**
- * Get the collection of files from the project that are relevant for the
- * validator with the given class name.
- *
- * @param files The files relevant for the class name.
- * @param resource The resource to look for files in.
- * @param validatorClassName The name of the validator class.
- */
- protected void getFiles(Collection files, IContainer resource, String validatorClassName)
- {
- try
- {
- IResource [] resourceArray = resource.members(false);
- for (int i=0; i<resourceArray.length; i++)
- {
- if (ValidatorManager.getManager().isApplicableTo(validatorClassName, resourceArray[i]))
- {
- if (resourceArray[i] instanceof IFile)
- {
- files.add(resourceArray[i]);
- }
- }
- if (resourceArray[i].getType() == IResource.FOLDER)
- getFiles(files,(IContainer)resourceArray[i], validatorClassName) ;
- }
- }
- catch (Exception e) {}
- }
-
-
-/**
- * Return the name of the resource, without the project-specific information
- * in front.
- *
- * This method is used by ValidationOperation to calculate the non-environment
- * specific names of the files. Only the IWorkbenchContext implementation knows how
- * much information to strip off of the IResource name. For example, if there is
- * an EJB Project named "MyEJBProject", and it uses the default names for the
- * source and output folders, "source" and "ejbModule", respectively, then the
- * current implementation of EJB Helper knows how much of that structure is
- * eclipse-specific.
- *
- * Since the "source" folder contains Java source files, a portable name would
- * be the fully-qualified name of the Java class, without the eclipse-specific
- * project and folder names in front of the file name. The EJBHelper knows that
- * everything up to the "source" folder, for example, can be removed, because,
- * according to the definition of the EJB Project, everything contained
- * in the source folder is java source code. So if there is an IResource in an
- * EJB Project named "/MyEJBProject/source/com/ibm/myclasses/MyJavaFile.java",
- * this method would make this name portable by stripping off the
- * "/MyEJBProject/source", and returning "com/ibm/myclasses/MyJavaFile.java".
- *
- * The output of this method is used by the ValidationOperation, when it
- * is calculating the list of added/changed/deleted file names for incremental
- * validation. If getPortableName(IResource) returns null, that means
- * that the IWorkbenchContext's implementation does not support that particular
- * type of resource, and the resource should not be included in the array of
- * IFileDelta objects in the IValidator's "validate" method.
- *
- * @param resource The resource to get the name from.
- * @return The portable name of the resource.
- */
-public String getPortableName(IResource resource)
- {
- // System.out.println("get portablename for " + resource);
- return resource.getProjectRelativePath().toString();
- }
-
-/**
- * When an IValidator associates a target object with an IMessage,
- * the WorkbenchReporter eventually resolves that target object
- * with an IResource. Sometimes more than one target object resolves
- * to the same IResource (usually the IProject, which is the default
- * IResource when an IFile cannot be found). This method is called,
- * by the WorkbenchReporter, so that the WorkbenchReporter can
- * distinguish between the IMessages which are on the same IResource,
- * but refer to different target objects. This is needed for the
- * removeAllMessages(IValidator, Object) method, so that when one
- * target object removes all of its messages, that it doesn't remove
- * another target object's messages.
- *
- * This method may return null only if object is null. Otherwise, an
- * id which can uniquely identify a particular object must be returned.
- * The id needs to be unique only within one particular IValidator.
- *
- * @param object The object from which to get the name.
- * @return The name of the object or null if the object is null.
- */
-public String getTargetObjectName(Object object)
- {
- if (object == null)
- {
- return null;
- }
-
- // System.out.println("get targetname for " + object);
- return object.toString();
- }
-
- /**
- * Delete the markers of the specified type from the specified resource.
- *
- * @param resource The resource to delete the markers from.
- * @param markerType The type of markers to delete from the resource.
- * @param attributeName The name of the attribute which the markers must have to be deleted.
- * @param attributeValue The value of the attribute corresponding to attributeName which the markers must have to be deleted.
- * @throws CoreException
- */
- public static void deleteMarkers(IResource resource, String markerType, final String attributeName, final Object attributeValue) throws CoreException
- {
- final IMarker[] v400Markers = resource.findMarkers(IMarker.PROBLEM, false, IResource.DEPTH_INFINITE);
- final IMarker[] markers = resource.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
- IWorkspaceRunnable op = new IWorkspaceRunnable()
- {
- public void run(IProgressMonitor progressMonitor) throws CoreException
- {
- // this fixes defect 193406
- // here we remove markers that may have been added by the v400 code
- // hopefully the '.markers' metadata files will be removed for the V5 install
- // and this kludge will not be needed there
- for (int i = 0; i < v400Markers.length; i++)
- {
- IMarker marker = markers[i];
- marker.delete();
- }
-
- for (int i = 0; i < markers.length; i++)
- {
- IMarker marker = markers[i];
-
- Object value = marker.getAttribute(attributeName);
- if (value != null &&
- value.equals(attributeValue))
- {
- marker.delete();
- }
- }
- }
- };
-
- try
- {
- ResourcesPlugin.getWorkspace().run(op, null);
- }
- catch (Exception e) { }
- }
-
- /**
- * Get the validation framework severity for the given severity.
- *
- * @param severity The severity to convert to validation framework severity.
- * @return The validation framework severity for the given severity.
- */
- static public int getValidationFrameworkSeverity(int severity)
- {
- switch (severity)
- {
- case IMarker.SEVERITY_ERROR:
- return IMessage.HIGH_SEVERITY;
- case IMarker.SEVERITY_WARNING:
- return IMessage.NORMAL_SEVERITY;
- case IMarker.SEVERITY_INFO:
- return IMessage.LOW_SEVERITY;
- }
- return IMessage.LOW_SEVERITY;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
deleted file mode 100644
index 78fd207fdc..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xml.core.internal.validation.core;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-
-/**
- * This class allows InputStreams to be created and returned to xerces without
- * actually opening file handles or network connections until it is absolutely
- * neccessary.
- */
-public class LazyURLInputStream extends InputStream
-{
-// private static int debugTotalOpenStreamCount = 0;
- protected InputStream inner;
- protected String url;
- protected boolean error;
- boolean hasMarks;
- boolean pretendFileIsStillOpen;
-
- public LazyURLInputStream(String url)
- {
- this.url = url;
- inner = null;
- pretendFileIsStillOpen = false;
- }
-
- private void createInnerStreamIfRequired() throws IOException
- {
- if (inner == null && !error)
- {
-// debugTotalOpenStreamCount++;
-
- try
- {
- inner = new URL(url).openStream();
- pretendFileIsStillOpen = false;
- hasMarks = false;
- }
- finally
- {
- if (inner == null)
- {
- error = true;
- }
- }
- }
- }
-
- protected void closeStream() throws IOException {
- if (inner != null && !pretendFileIsStillOpen) {
- inner.close();
- pretendFileIsStillOpen = true;
- }
- }
-
- public int available() throws IOException
- {
- if (pretendFileIsStillOpen) return 0;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- return inner.available();
- }
-
- public void close() throws IOException
- {
- if (pretendFileIsStillOpen) {
- // Stop behaving as if the stream were still open.
- pretendFileIsStillOpen = false;
- } else {
- if (inner != null) {
-// debugTotalOpenStreamCount--;
- inner.close();
- }
- }
- }
-
- public void mark(int readlimit)
- {
- if (pretendFileIsStillOpen) return;
- hasMarks = true;
- try {
- createInnerStreamIfRequired();
- inner.mark(readlimit);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public boolean markSupported()
- {
- if (pretendFileIsStillOpen) return false;
- try {
- createInnerStreamIfRequired();
- if (inner == null) return false;
- return inner.markSupported();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
-
- public int read() throws IOException
- {
- if (pretendFileIsStillOpen) return -1;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- int bytesRead = inner.read();
- if (bytesRead == -1 && !hasMarks) closeStream();
- return bytesRead;
- }
-
-
- public int read(byte[] b) throws IOException {
- if (pretendFileIsStillOpen) return -1;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- int bytesRead = inner.read(b);
- if (bytesRead == -1 && !hasMarks) closeStream();
- return bytesRead;
- }
-
- public int read(byte[] b, int off, int len) throws IOException
- {
- if (pretendFileIsStillOpen) return -1;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- int bytesRead = inner.read(b, off, len);
- if (bytesRead == -1 && !hasMarks) closeStream();
- return bytesRead;
- }
-
- public void reset() throws IOException
- {
- if (pretendFileIsStillOpen) return;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- inner.reset();
- }
-
- public long skip(long n) throws IOException
- {
- if (pretendFileIsStillOpen) return 0;
- createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
- return inner.skip(n);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
deleted file mode 100644
index bb96caff52..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import org.eclipse.core.resources.IProject;
-
-
-/**
- * A context class for validators to be able to determine the context of
- * given validation session. Currently this class is only used to identify
- * the unique context.
- */
-public class NestedValidatorContext
-{
- private IProject fProject;
-
- public void setProject(IProject project) {
- fProject = project;
- }
-
- public IProject getProject() {
- return fProject;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
deleted file mode 100644
index c43ac1d48e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver (STAR) - bug 297005 - Some static constants not made final.
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationMessages;
-
-/**
- * This class handles messages from a validator. This class can handle
- *
- * @author Lawrence Mandel, IBM
- */
-public class ValidationInfo implements ValidationReport
-{
- private boolean WRAPPER_ERROR_SUPPORT_ENABLED = true;
- public static final int SEV_ERROR = 0;
- public static final int SEV_WARNING = 1;
-
- private String validating_file_uri = null;
- private URL validating_file_url = null;
- private boolean valid = true;
- private List messages = new ArrayList();
- private HashMap nestedMessages = new HashMap();
-
- /**
- * Constructor.
- *
- * @param uri
- * The URI of the file for the validation.
- */
- public ValidationInfo(String uri)
- {
- if(uri != null)
- {
- this.validating_file_uri = uri;
- try
- {
- this.validating_file_url = new URL(uri);
- } catch (MalformedURLException e)
- {
- }
- }
- }
-
- public String getFileURI()
- {
- return validating_file_uri;
- }
-
- public boolean isValid()
- {
- return valid;
- }
-
- /**
- * Add an error message.
- *
- * @param message The message to add.
- * @param line The line location of the message.
- * @param column The column location of the message.
- * @param uri The URI of the file that contains the message.
- */
- public void addError(String message, int line, int column, String uri)
- {
- addError(message, line, column, uri, null, null);
- }
-
- /**
- *
- * Add an error message.
- *
- * @param message The message to add.
- * @param line The line location of the message.
- * @param column The column location of the message.
- * @param uri The URI of the file that contains the message.
- * @param key The key for the message.
- * @param messageArguments more information about the error
- */
- public void addError(String message, int line, int column, String uri, String key, Object[] messageArguments)
- {
- if(addMessage(message, line, column, uri, SEV_ERROR, key, messageArguments))
- {
- valid = false;
- }
- }
-
- /**
- * Add a warning message.
- *
- * @param message The string message of the warning.
- * @param line The line location of the warning.
- * @param column The column location of the warning.
- * @param uri The URI of the file that contains the warning.
- */
- public void addWarning(String message, int line, int column, String uri)
- {
- addWarning(message, line, column, uri, null, null);
- }
-
- /**
- *
- * Add an error message.
- *
- * @param message The message to add.
- * @param line The line location of the message.
- * @param column The column location of the message.
- * @param uri The URI of the file that contains the message.
- * @param key The key for the message.
- * @param messageArguments more information about the error
- */
- public void addWarning(String message, int line, int column, String uri, String key, Object[] messageArguments)
- {
- addMessage(message, line, column, uri, SEV_WARNING, key, messageArguments);
- }
-
- /**
- * Add a message to the list. Return true if successful, false otherwise.
- *
- * @param message The message to add to the list.
- * @param line The line location of the message.
- * @param column The column location of the message.
- * @param uri The URI of the file that contains the message.
- * @param severity The severity of the message.
- * @param key the Xerces error key for this error
- * @param messageArguments more information on the error
- * @return True if the message was successfully added, false otherwise.
- */
- private boolean addMessage(String message, int line, int column, String uri, int severity, String key, Object[] messageArguments)
- {
- boolean successfullyAdded = false;
- // If the message if null there is nothing to add.
- if(message == null)
- {
- return successfullyAdded;
- }
- String errorURI = normalize(uri);
- URL errorURL = null;
- if (errorURI != null)
- {
- try
- {
- errorURL = new URL(errorURI);
- } catch (MalformedURLException e)
- {
- }
- //errorURI = normalizeURI(errorURI);
- }
- //boolean doDialog = true;
- if (errorURL != null)
- {
- successfullyAdded = true;
- // Add to the appropriate list if nested error support is off or
- // this message is for the current file.
- if (!WRAPPER_ERROR_SUPPORT_ENABLED || (validating_file_url != null && validating_file_url.sameFile(errorURL)))
- {
-
- ValidationMessage valmes = new ValidationMessage(message, line,
- column, validating_file_uri, key, messageArguments);
- if (severity == SEV_ERROR)
- {
- valmes.setSeverity(ValidationMessage.SEV_NORMAL);
- } else if (severity == SEV_WARNING)
- {
- valmes.setSeverity(ValidationMessage.SEV_LOW);
- }
- messages.add(valmes);
- }
- // If nested error support is enabled create a nested error.
- else if (WRAPPER_ERROR_SUPPORT_ENABLED)
- {
- String nesteduri = errorURL.toExternalForm();
- ValidationMessage nestedmess = new ValidationMessage(message, line,
- column, nesteduri, key, messageArguments);
- if(severity == SEV_WARNING)
- {
- nestedmess.setSeverity(ValidationMessage.SEV_LOW);
- }
- else
- {
- nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);
- }
-
- ValidationMessage container = (ValidationMessage) nestedMessages.get(nesteduri);
- if(container == null)
- {
- container = new ValidationMessage(NLS.bind(XMLValidationMessages._UI_REF_FILE_ERROR_MESSAGE, new Object [] { nesteduri }), 1, 0, nesteduri);
-
- // Initially set the nested error to a warning. This will automatically be changed
- // to an error if a nested message has a severity of error.
- container.setSeverity(ValidationMessage.SEV_LOW);
- nestedMessages.put(nesteduri, container);
- messages.add(container);
- }
- container.addNestedMessage(nestedmess);
- }
- }
- return successfullyAdded;
- }
-
-
- /**
- * Add a nested message to the validation information.
- *
- * @param message The string message of the validation message.
- * @param line The line location of the validation message.
- * @param column The column location of the validation message.
- * @param uri The URI of the validation message.
- * @param severity The severity of the validation message.
- */
-// public void addNestedMessage(String message, int line, int column, String uri, int severity)
-// {
-// ValidationMessage nestedmess = new ValidationMessage(message, line, column, uri);
-// if(severity == SEV_WARNING)
-// {
-// nestedmess.setSeverity(ValidationMessage.SEV_LOW);
-// }
-// else
-// {
-// nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);
-// }
-// ValidationMessage container = (ValidationMessage)nestedMessages.get(uri);
-// if(container == null)
-// {
-// container = new ValidationMessage(XMLCoreValidationPlugin.getResourceString(_UI_REF_FILE_ERROR_MESSAGE, uri), 1, 0, validating_file_uri);
-// // Initially set the nested error to a warning. This will automatically be changed
-// // to an error if a nested message has a severity of error.
-// container.setSeverity(ValidationMessage.SEV_LOW);
-// nestedMessages.put(uri, container);
-// messages.add(container);
-// }
-// container.addNestedMessage(nestedmess);
-// }
-
- /**
- * @see org.eclipse.wsdl.validate.ValidationReport#getValidationMessages()
- */
- public ValidationMessage[] getValidationMessages()
- {
- return (ValidationMessage[])messages.toArray(new ValidationMessage[messages.size()]);
- }
-
- public HashMap getNestedMessages()
- {
- return nestedMessages;
- }
-
- /**
- * Put the URI in a standard format.
- *
- * @param uri The URI to put into a standard format.
- * @return The standard format of the URI.
- */
- private String normalize(String uri)
- {
-// if(uri.startsWith("platform:"))
-// {
-// try
-// {
-// uri = Platform.resolve(new URL(uri)).toString();
-// }
-// catch(Exception e)
-// {
-// }
-// }
- uri = uri.replaceAll("%20"," "); //$NON-NLS-1$ //$NON-NLS-2$
- uri = uri.replaceAll("%5E", "^"); //$NON-NLS-1$ //$NON-NLS-2$
- uri = uri.replace('\\','/');
-
- return uri;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
deleted file mode 100644
index e2662c0f19..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
+++ /dev/null
@@ -1,202 +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
- * David Carver (STAR) - bug 297005 - Some static constants not made final.
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.core;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * A class for holding validation message information. Holds the message and the
- * message location.
- */
-public class ValidationMessage
-{
- public static final QualifiedName ERROR_MESSAGE_MAP_QUALIFIED_NAME = new QualifiedName("org.eclipse.wst.xml.validation", "errorMessageMap"); //$NON-NLS-1$ //$NON-NLS-2$
- protected String message;
- protected int lineNumber;
- protected int columnNumber;
- protected String uri;
- protected List nestedErrors;
- protected String key;
- protected Object[] messageArguments;
- protected int startOffset;
- protected int severity = IMessage.NORMAL_SEVERITY;
- public static final int SEV_HIGH = IMessage.HIGH_SEVERITY;
- public static final int SEV_NORMAL = IMessage.NORMAL_SEVERITY;
- public static final int SEV_LOW = IMessage.LOW_SEVERITY;
-
- /**
- * Constructor.
- *
- * @param message The message for the validation message.
- * @param lineNumber The line location of the message.
- * @param columnNumber The column location of the message.
- */
- public ValidationMessage(String message, int lineNumber, int columnNumber)
- {
- this(message, lineNumber, columnNumber, null);
- }
-
- /**
- * Constructor.
- *
- * @param message The message for the validation message.
- * @param lineNumber The line location of the message.
- * @param columnNumber The column location of the message.
- * @param uri The uri of the file the message is for.
- */
- public ValidationMessage(String message, int lineNumber, int columnNumber, String uri)
- {
- this(message, lineNumber, columnNumber, uri, null, null);
- }
-
- /**
- * Constructor.
- *
- * @param message The message for the validation message.
- * @param lineNumber The line location of the message.
- * @param columnNumber The column location of the message.
- * @param uri The uri of the file the message is for.
- * @param key a unique string representing the error
- * @param messageArguments the arguments Xerces uses to create the message
- */
- public ValidationMessage(String message, int lineNumber, int columnNumber, String uri, String key, Object[] messageArguments)
- {
- this.message = message;
- this.lineNumber = lineNumber;
- this.columnNumber = columnNumber;
- this.uri = uri;
- this.key = key;
- this.messageArguments = messageArguments;
- this.startOffset = 0;
- }
-
-
- /**
- * Get the message for this valiation message.
- *
- * @return The message for this validation message.
- */
- public String getMessage()
- {
- return message;
- }
-
- /**
- * Get the column location.
- *
- * @return The column number.
- */
- public int getColumnNumber()
- {
- return columnNumber;
- }
-
- /**
- * Get the line location.
- *
- * @return The line number.
- */
- public int getLineNumber()
- {
- return lineNumber;
- }
-
- /**
- * Get the uri for the file that contains the message.
- *
- * @return The uri of the file that contains the message.
- */
- public String getUri()
- {
- return uri;
- }
-
- /**
- * Add a nested validation message to this validation message.
- *
- * @param validationMessage The validation message to add as a nested message.
- */
- public void addNestedMessage(ValidationMessage validationMessage)
- {
- if (nestedErrors == null)
- {
- nestedErrors = new ArrayList();
- }
- nestedErrors.add(validationMessage);
- int validaitonmessageSeverity = validationMessage.getSeverity();
- if(validaitonmessageSeverity == SEV_NORMAL || validaitonmessageSeverity == SEV_HIGH)
- {
- setSeverity(SEV_NORMAL);
- }
- }
-
- /**
- * Get the list of nested validation messages.
- *
- * @return The list of nested validation messages.
- */
- public List getNestedMessages()
- {
- return nestedErrors != null ? nestedErrors : Collections.EMPTY_LIST;
- }
-
- /**
- * Get the severity of the defect.
- *
- * @return The severity of the defect.
- */
- public int getSeverity()
- {
- return severity;
- }
-
- /**
- * Set the severity of the message.
- *
- * @param sev The severity to set.
- */
- public void setSeverity(int sev)
- {
- severity = sev;
- }
-
- public void setStartOffset(int offset)
- {
- this.startOffset = offset;
- }
-
- /**
- * @return Returns the key.
- */
- public String getKey()
- {
- return key;
- }
-
- public Object[] getMessageArguments()
- {
- return this.messageArguments;
- }
-
-
- public void setMessage(String message)
- {
- this.message = message;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java
deleted file mode 100644
index dbb1570553..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java
+++ /dev/null
@@ -1,45 +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.xml.core.internal.validation.core;
-
-import java.util.HashMap;
-
-/**
- * An interface for a validation report.
- *
- * @author Lawrence Mandel, IBM
- */
-public interface ValidationReport
-{
- /**
- * Returns the URI for the file the report refers to.
- *
- * @return The URI for the file the report refers to.
- */
- public String getFileURI();
-
- /**
- * Returns whether the file is valid. The file may have warnings associated with it.
- *
- * @return True if the file is valid, false otherwise.
- */
- public boolean isValid();
-
- /**
- * Returns an array of validation messages.
- *
- * @return An array of validation messages.
- */
- public ValidationMessage[] getValidationMessages();
-
- public HashMap getNestedMessages();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java
deleted file mode 100644
index 0d38f38817..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java
+++ /dev/null
@@ -1,32 +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.xml.core.internal.validation.core.logging;
-
-/**
- * A logger that will print log info to System.out.
- *
- * @author Lawrence Mandel, IBM
- */
-public class CommandLineLogger implements ILogger
-{
- public void logError(String error, Throwable exception)
- {
- System.out.println(error);
- System.out.println(exception.toString());
- }
-
- public void logWarning(String warning, Throwable exception)
- {
- System.out.println(warning);
- System.out.println(exception.toString());
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java
deleted file mode 100644
index 573cf2de9c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java
+++ /dev/null
@@ -1,34 +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.xml.core.internal.validation.core.logging;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
-
-/**
- * A logger that will log to the log file in the eclipse metadata directory.
- */
-public class EclipseLogger implements ILogger
-{
-
- public void logError(String error, Throwable exception)
- {
- XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, error, exception));
- }
-
- public void logWarning(String warning, Throwable exception)
- {
- XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.WARNING, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.WARNING, warning, exception));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java
deleted file mode 100644
index e81a410bc8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java
+++ /dev/null
@@ -1,35 +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.xml.core.internal.validation.core.logging;
-
-/**
- * The interface for a standard logger. Allows for logging errors and warnings.
- *
- * @author Lawrence Mandel, IBM
- */
-public interface ILogger
-{
- /**
- * Log an error message.
- *
- * @param error The error message to log.
- * @param exception The exception to log.
- */
- public void logError(String error, Throwable exception);
-
- /**
- * Log a warning message.
- *
- * @param warning The warning message to log.
- * @param exception The exception to log.
- */
- public void logWarning(String warning, Throwable exception);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
deleted file mode 100644
index 81549e3e9d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xml.core.internal.validation.core.logging;
-
-/**
- * The logger factory allows for simple use of whatever logging mechanism is in
- * place. The tool can specify a custom logging class and can request the
- * logger from this class.
- *
- * @author Lawrence Mandel, IBM
- *
- * @deprecated - not used in WTP or by any adopters as of 9/12/2007
- */
-public class LoggerFactory
-{
- private static ILogger logger = null;
- private static ClassLoader classloader = null;
- private static String loggerClass = null;
- private static final String commandlinelogger = "org.eclipse.wst.xml.validation.internal.core.logging.CommandLineLogger"; //$NON-NLS-1$
- private static final String eclipselogger = "org.eclipse.wst.xml.validation.internal.core.logging.EclipseLogger"; //$NON-NLS-1$
- private static String defaultlogger = commandlinelogger;
-
- /**
- * Get the one and only instance of the logger.
- *
- * @return The one and only instance of the logger.
- */
- public static ILogger getLoggerInstance()
- {
- if(logger == null)
- {
- if(loggerClass != null)
- {
- if(classloader != null)
- {
- try
- {
- Class lc = classloader.loadClass(loggerClass);
- logger = (ILogger) lc.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- if(logger == null)
- {
- try
- {
- Class lc = LoggerFactory.class.getClassLoader().loadClass(loggerClass);
- logger = (ILogger) lc.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- }
- if(logger == null)
- {
- try
- {
- Class lc = LoggerFactory.class.getClassLoader().loadClass(defaultlogger);
- logger = (ILogger) lc.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- }
- return logger;
- }
-
- /**
- * Specify the logger implementation to be used.
- *
- * @param classname
- * The name of the logger class.
- * @param loggerclassloader
- * The classloader to use to load the logger. If null, the default
- * classloader will be used.
- */
- public static void specifyLogger(String classname, ClassLoader loggerclassloader)
- {
- loggerClass = classname;
- classloader = loggerclassloader;
- }
-
- /**
- * Set the default logger to the eclipse logger.
- */
- public static void useEclipseLogger()
- {
- defaultlogger = eclipselogger;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
deleted file mode 100644
index 44a6481ad2..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
+++ /dev/null
@@ -1,81 +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.xml.core.internal.validation.eclipse;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationRegistry;
-import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorMessageCustomizerDelegate;
-import org.osgi.framework.Bundle;
-/**
- * This class reads the plug-in manifests and registers each extension
- * error customizer with the ErrorCustomizationRegistry.
- */
-public class ErrorCustomizationPluginRegistryReader {
-
- protected static final String PLUGIN_ID = "org.eclipse.wst.xml.core"; //$NON-NLS-1$
- protected static final String ATT_CLASS = "class"; //$NON-NLS-1$
- protected static final String ATT_NAMESPACE = "namespace"; //$NON-NLS-1$
- protected static final String EXTENSION_POINT_ID = "errorCustomizer"; //$NON-NLS-1$
- protected static final String tagName = EXTENSION_POINT_ID;
-
- /**
- * Read from plugin registry for the errorcustomizer extension.
- */
- public void readRegistry()
- {
- IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- /**
- * readElement() - parse and deal with an extension like:
- *
- * <extension point="org.eclipse.wst.xml.core.errorCustomizer"
- * id="specificErrorCustomizer"
- * name="Specific Error Customizer">
- * <errorCustomizer
- * namespace="http://specificnamespace"
- * class="org.eclipse.wst.xml.core.MySpecificErrorCustomizer/>
- * </extension>
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(tagName))
- {
- String errorCustomizerClass = element.getAttribute(ATT_CLASS);
- String namespace = element.getAttribute(ATT_NAMESPACE);
-
- if (errorCustomizerClass != null)
- {
- try
- {
- Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName());
- ErrorMessageCustomizerDelegate delegate = new ErrorMessageCustomizerDelegate(pluginBundle, errorCustomizerClass);
- ErrorCustomizationRegistry.getInstance().addErrorMessageCustomizer(namespace, delegate);
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 31b4d087bd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.XMLNestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationConfiguration;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-public class Validator extends AbstractNestedValidator
-{
- private static final String XML_VALIDATOR_CONTEXT = "org.eclipse.wst.xml.core.validatorContext"; //$NON-NLS-1$
- protected int indicateNoGrammar = 0;
- private IScopeContext[] fPreferenceScopes = null;
- /**
- * Set any preferences for XML validation.
- *
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- protected void setupValidation(NestedValidatorContext context)
- {
- super.setupValidation(context);
- fPreferenceScopes = createPreferenceScopes(context);
- indicateNoGrammar = Platform.getPreferencesService().getInt(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, 0, fPreferenceScopes);
- }
-
- protected IScopeContext[] createPreferenceScopes(NestedValidatorContext context) {
- if (context != null) {
- final IProject project = context.getProject();
- if (project != null && project.isAccessible()) {
- final ProjectScope projectScope = new ProjectScope(project);
- if (projectScope.getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(XMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
- return new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
- }
- }
- return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
- {
- return validate(uri, inputstream, context, null);
- }
-
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result)
- {
- XMLValidator validator = XMLValidator.getInstance();
-
- XMLValidationConfiguration configuration = new XMLValidationConfiguration();
- try
- {
- //Preferences pluginPreferences = XMLCorePlugin.getDefault().getPluginPreferences();
- configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR, indicateNoGrammar);
- final IPreferencesService preferencesService = Platform.getPreferencesService();
- configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_DOCUMENT_ELEMENT, preferencesService.getInt(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.INDICATE_NO_DOCUMENT_ELEMENT, -1, fPreferenceScopes));
- configuration.setFeature(XMLValidationConfiguration.USE_XINCLUDE, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.USE_XINCLUDE, false, fPreferenceScopes));
- configuration.setFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true, fPreferenceScopes));
- }
- catch(Exception e)
- {
- // TODO: Unable to set the preference. Log this problem.
- }
-
- XMLValidationReport valreport = validator.validate(uri, inputstream, configuration, result, context);
-
- return valreport;
- }
-
- /**
- * Store additional information in the message parameters. For XML validation there
- * are three additional pieces of information to store:
- * param[0] = the column number of the error
- * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
- * param[2] = the name or value of what is to be squiggled
- *
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage)
- */
- protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
- {
- String key = validationMessage.getKey();
- if(key != null)
- {
- XMLMessageInfoHelper messageInfoHelper = new XMLMessageInfoHelper();
- String[] messageInfo = messageInfoHelper.createMessageInfo(key, validationMessage.getMessageArguments());
-
- message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
- message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
- message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
- }
- }
-
- /**
- * Get the nested validation context.
- *
- * @param state
- * the validation state.
- * @param create
- * when true, a new context will be created if one is not found
- * @return the nested validation context.
- */
- protected NestedValidatorContext getNestedContext(ValidationState state, boolean create)
- {
- NestedValidatorContext context = null;
- Object o = state.get(XML_VALIDATOR_CONTEXT);
- if (o instanceof XMLNestedValidatorContext)
- context = (XMLNestedValidatorContext)o;
- else if (create)
- {
- context = new XMLNestedValidatorContext();
- }
- return context;
- }
-
- public void validationStarting(IProject project, ValidationState state, IProgressMonitor monitor)
- {
- if (project != null)
- {
- NestedValidatorContext context = getNestedContext(state, false);
- if (context == null)
- {
- context = getNestedContext(state, true);
- if (context != null)
- context.setProject(project);
- setupValidation(context);
- state.put(XML_VALIDATOR_CONTEXT, context);
- }
- super.validationStarting(project, state, monitor);
- }
- }
-
- public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor)
- {
- if (project != null)
- {
- super.validationFinishing(project, state, monitor);
- NestedValidatorContext context = getNestedContext(state, false);
- if (context != null)
- {
- teardownValidation(context);
- state.put(XML_VALIDATOR_CONTEXT, null);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
deleted file mode 100644
index b2a265bb27..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation.eclipse;
-
-/**
- * The message info helper determines the selection strategy for elements
- * in a SSE editor.
- *
- */
-public class XMLMessageInfoHelper
-{
- public XMLMessageInfoHelper()
- {
- super();
- }
-
- /**
- * Returns an array containing information about what should be underlined with the red "squiggles"
- * using the errorKey, and the messageArguments.
- * <br>Position 0 of the array returned contains the selection Strategy, or what DOM Element to underline.
- * For example "ATTRIBUTE_NAME"
- * <br>Position 1 contains the name or value to squiggle.
- * <p>For example, if we wanted to squiggle the attribute name of an attribute name
- * foo this method would return {"ATTRIBUTE_NAME", "foo"}
- * </p>
- * @param errorKey
- * The error key given by the Xerces parser.
- * @param messageArguments
- * The arguments used by Xerces to "fill in the blanks" of their messages.
- * @return
- * An array containing the squiggle information.
- * @see org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator
- *
- */
- public String[] createMessageInfo(String errorKey, Object[] messageArguments)
- {
- String selectionStrategy = null;
- String nameOrValue = null;
-
- if(errorKey != null)
- {
- if (errorKey.equals("cvc-complex-type.2.4.a") || errorKey.equals("cvc-complex-type.2.4.d") || errorKey.equals("cvc-complex-type.2.4.b") || errorKey.equals("MSG_CONTENT_INVALID") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- | errorKey.equals("MSG_CONTENT_INCOMPLETE") || errorKey.equals("MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED") || errorKey.equals("cvc-complex-type.4") || errorKey.equals("ElementPrefixUnbound") ) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- {
- selectionStrategy = "START_TAG"; //$NON-NLS-1$
- }
- else if (errorKey.equals("cvc-type.3.1.3")) //$NON-NLS-1$
- {
- selectionStrategy = "TEXT"; //$NON-NLS-1$
- }
- else if (errorKey.equals("cvc-complex-type.2.3")) //$NON-NLS-1$
- {
- selectionStrategy = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
- }
- else if (errorKey.equals("cvc-type.3.1.1")) //$NON-NLS-1$
- {
- selectionStrategy = "ALL_ATTRIBUTES"; //$NON-NLS-1$
- }
- else if (errorKey.equals("cvc-complex-type.3.2.2") || errorKey.equals("MSG_ATTRIBUTE_NOT_DECLARED")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
- //in this case we need nameOrValue to be the name of the attribute to underline
- nameOrValue = (String)messageArguments[1];
- }
- else if (errorKey.equals("cvc-attribute.3") || errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- {
- selectionStrategy = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
- //in this case we need nameOrValue to be the name of the Attribute
- if (errorKey.equals("cvc-attribute.3") || errorKey.equals("cvc-complex-type.3.1")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- nameOrValue = (String)messageArguments[1];
- }
- else if (errorKey.equals("MSG_ATTRIBUTE_VALUE_NOT_IN_LIST")) //$NON-NLS-1$
- {
- nameOrValue = (String)messageArguments[0];
- }
- }
- else if (errorKey.equals("cvc-elt.4.2")) //$NON-NLS-1$
- {
- selectionStrategy="VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
- //in this case we need nameOrValue to be the value of the attribute we want to unerline
- nameOrValue = (String)messageArguments[1];
- }
- else if (errorKey.equals("EntityNotDeclared")) //$NON-NLS-1$
- {
- selectionStrategy="TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
- nameOrValue = (String)messageArguments[0];
- }
- else if (errorKey.equals("ElementUnterminated")) //$NON-NLS-1$
- {
- selectionStrategy = "ENTIRE_ELEMENT"; //$NON-NLS-1$
- }
- else if (errorKey.equals("ETagUnterminated") || errorKey.equals("ETagRequired")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- selectionStrategy = "END_TAG"; //$NON-NLS-1$
- }
- else if (errorKey.equals("AttributeNotUnique")) //$NON-NLS-N$
- {
- selectionStrategy = "ATTRIBUTE_NAME_LAST"; //$NON-NLS-1$
- //in this case we need nameOrValue to be the name of the last attribute(like in case of duplicate attributes)
- //to underline
- nameOrValue = (String)messageArguments[1];
- }
- }
- String messageInfo[] = new String[2];
- messageInfo[0] = selectionStrategy != null? selectionStrategy: ""; //$NON-NLS-1$
- messageInfo[1] = nameOrValue;
- return messageInfo;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
deleted file mode 100644
index d4810581a1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java
+++ /dev/null
@@ -1,49 +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.xml.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-/**
- * An XML validator specific to Eclipse. This validator will wrap the internal
- * XML validator and provide automatic URI resolution support. This class also
- * reads from the plug-in registry and registers all error customizers with the
- * registry.
- */
-public class XMLValidator extends org.eclipse.wst.xml.core.internal.validation.XMLValidator
-{
- private static XMLValidator instance = null;
-
- /**
- * Return the one and only instance of the XML validator. The validator
- * can be reused and cannot be customized so there should only be one instance of it.
- *
- * @return The one and only instance of the XML validator.
- */
- public static XMLValidator getInstance()
- {
- if(instance == null)
- {
- instance = new XMLValidator();
- }
- return instance;
- }
- /**
- * Constructor. Create the XML validator, set the URI resolver and
- * get the extension error customizers from the registry.
- */
- protected XMLValidator()
- {
- setURIResolver(URIResolverPlugin.createResolver());
- new ErrorCustomizationPluginRegistryReader().readRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
deleted file mode 100644
index 649c99e553..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
+++ /dev/null
@@ -1,72 +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.xml.core.internal.validation.errorcustomization;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A simple class to store information about an XML element.
- */
-public class ElementInformation
-{
- protected String localName;
- protected String namespace;
- protected List children = new ArrayList();
-
- /**
- * Constructor.
- *
- * @param uri
- * The namespace URI of the element.
- * @param localName
- * The local name of the element.
- */
- public ElementInformation(String uri, String localName)
- {
- this.localName = localName;
- this.namespace = uri;
- }
-
- /**
- * Get the namespace of this element.
- *
- * @return
- * The namespace of this element.
- */
- public String getNamespace()
- {
- return namespace;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return
- * The local name of this element.
- */
- public String getLocalname()
- {
- return localName;
- }
-
- /**
- * Get the list of children of this element. The list contains
- * ElementInformation objects representing the children of this element.
- *
- * @return
- * The list of children of this element.
- */
- public List getChildren()
- {
- return children;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
deleted file mode 100644
index 745acc045a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
+++ /dev/null
@@ -1,110 +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.xml.core.internal.validation.errorcustomization;
-
-import java.util.Stack;
-
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-
-/**
- * This class tracks the context of the parsed document to help identify error
- * conditions
- */
-public class ErrorCustomizationManager
-{
- protected Stack elementInformationStack = new Stack();
- protected ErrorMessageInformation messageForConsideration;
-
- /**
- * This method should be called in the start element method of the XML validator's
- * content handler.
- *
- * @param uri
- * The namespace of the element.
- * @param localName
- * The local name of the element.
- */
- public void startElement(String uri, String localName)
- {
- ElementInformation elementInformation = new ElementInformation(uri, localName);
- if (elementInformationStack.size() > 0)
- {
- ElementInformation parent = (ElementInformation) elementInformationStack.peek();
- parent.children.add(elementInformation);
- }
- elementInformationStack.push(elementInformation);
- }
-
- /**
- * This method should be called in the end element method of the XML validator's
- * content handler.
- *
- * @param uri
- * The namespace of the element.
- * @param localName
- * The local name of the element.
- */
- public void endElement(String uri, String localName)
- {
- if (elementInformationStack.size() > 0)
- {
- ElementInformation elementInformation = (ElementInformation)elementInformationStack.pop();
- if (messageForConsideration != null)
- {
- IErrorMessageCustomizer[] customizers = ErrorCustomizationRegistry.getInstance().getCustomizers(elementInformation.getNamespace());
- int numCustomizers = customizers.length;
- for(int i = 0; i < numCustomizers; i++)
- {
- String message = customizers[i].customizeMessage(elementInformation, messageForConsideration.key, messageForConsideration.arguments);
- if(message != null)
- {
- messageForConsideration.message.setMessage(message);
- break;
- }
- }
- }
- }
- }
-
- /**
- * Consider the reported error for customization.
- *
- * @param valInfo
- * The current ValidationInfo object containing validation specific information.
- * @param key
- * The key related to the message.
- * @param arguments
- * Any message arguments.
- */
- public void considerReportedError(ValidationInfo valInfo, String key, Object[] arguments)
- {
- messageForConsideration = null;
- ValidationMessage[] messages = valInfo.getValidationMessages();
- if (messages.length > 0)
- {
- messageForConsideration = new ErrorMessageInformation();
- messageForConsideration.key = key;
- messageForConsideration.arguments = arguments;
- messageForConsideration.message = messages[messages.length - 1];
- }
- }
-
- /**
- * A simple class to hold error message information.
- */
- public class ErrorMessageInformation
- {
- public String key = null;
- public Object[] arguments = null;
- public ValidationMessage message = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
deleted file mode 100644
index 20948794fa..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
+++ /dev/null
@@ -1,97 +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.xml.core.internal.validation.errorcustomization;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The error customization regsitry manages all registered
- * IErrorMessageCustomizers by namespace.
- */
-public class ErrorCustomizationRegistry
-{
- protected static ErrorCustomizationRegistry registry = null;
- protected Map customizers = new HashMap();
-
- /**
- * Restricted constructor in keeping with the singleton pattern.
- */
- protected ErrorCustomizationRegistry()
- {
- }
-
- /**
- * Get the one and only instance of the registry.
- *
- * @return
- * The one and only instance of the registry.
- */
- public static ErrorCustomizationRegistry getInstance()
- {
- if(registry == null)
- {
- registry = new ErrorCustomizationRegistry();
- }
- return registry;
- }
-
- /**
- * Add a customizer to the registry.
- *
- * @param namespace
- * The namespace the customizer will act on.
- * @param customizer
- * The error customizer to register.
- */
- public void addErrorMessageCustomizer(String namespace, IErrorMessageCustomizer customizer)
- {
- // To register a customizer for the no namespace use an empty string.
- if(namespace == null)
- {
- namespace = ""; //$NON-NLS-1$
- }
- List customizersForNS = (List)customizers.get(namespace);
- if(customizersForNS == null)
- {
- customizersForNS = new ArrayList();
- customizers.put(namespace, customizersForNS);
- }
- if(customizer != null)
- {
- customizersForNS.add(customizer);
- }
- }
-
- /**
- * Get the error customizers for a given namespace.
- *
- * @param namespace
- * The namespace for which to retrieve the customizers.
- * @return
- * An array of customizers registered for this namespace.
- */
- public IErrorMessageCustomizer[] getCustomizers(String namespace)
- {
- if(namespace == null)
- {
- namespace = ""; //$NON-NLS-1$
- }
- List customizersForNS = (List)customizers.get(namespace);
- if(customizersForNS == null)
- {
- customizersForNS = new ArrayList();
- }
- return (IErrorMessageCustomizer[])customizersForNS.toArray(new IErrorMessageCustomizer[customizersForNS.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
deleted file mode 100644
index 07147c1455..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
+++ /dev/null
@@ -1,72 +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.xml.core.internal.validation.errorcustomization;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.osgi.framework.Bundle;
-
-/**
- * An error message customizer delegate is used to allow for
- * lazy loading of error customizers.
- *
- */
-public class ErrorMessageCustomizerDelegate implements IErrorMessageCustomizer
-{
- protected Bundle bundle = null;
- protected String classname = null;
- protected IErrorMessageCustomizer customizer = null;
-
- public ErrorMessageCustomizerDelegate(Bundle bundle, String classname)
- {
- this.bundle = bundle;
- this.classname = classname;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer#customizeMessage(org.eclipse.wst.xml.core.internal.validation.errorcustomization.ElementInformation, java.lang.String, java.lang.Object[])
- */
- public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments)
- {
- if(customizer == null)
- {
- loadCustomizer();
- }
- if(customizer == null)
- {
- return null;
- }
- return customizer.customizeMessage(elementInfo, errorKey, arguments);
- }
-
- /**
- * Load the customizer class.
- */
- protected void loadCustomizer()
- {
- try
- {
- Class customizerClass = bundle.loadClass(classname);
- customizer = (IErrorMessageCustomizer)customizerClass.newInstance();
- }
- catch(Exception e)
- {
- XMLCorePlugin.getDefault().getLog().log(
- new Status(IStatus.WARNING,
- XMLCorePlugin.getDefault().getBundle().getSymbolicName(),
- IStatus.OK,
- "The XML validator error customizer was unable to load class " + classname, e)); //$NON-NLS-1$
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
deleted file mode 100644
index ac6d1e0d89..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
+++ /dev/null
@@ -1,34 +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.xml.core.internal.validation.errorcustomization;
-
-/**
- * An error message customizer will be called by the XML validator to customize
- * XML validation errors for a given namespace. The customizer can be used to
- * create clearer errors for specific application domains.
- */
-public interface IErrorMessageCustomizer
-{
- /**
- * Return a customized error message for the given element. Null should be returned
- * if the message should not be customized.
- *
- * @param elementInformation
- * The information about the element for which to customize the error.
- * @param errorKey
- * The key for the error for which to replace the message.
- * @param arguments
- * Arguments related the the error message.
- * @return
- * A customized error message or null if this customizer will not customize the message.
- */
- public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
deleted file mode 100644
index a88483aa59..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-!-- Constants for strings
-
-! Usage:
-! {0} replaced with the host name
-!
-_UI_PROBLEMS_VALIDATING_UNKNOWN_HOST = The file cannot be validated as the host "{0}" is currently unreachable.
-
-! Usage:
-! {0} replaced with the file name
-!
-_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND = The file cannot be validated as the XML definition "{0}" that is specified as describing the syntax of the file cannot be located.
-
-_UI_PROBLEMS_CONNECTION_REFUSED = The file cannot be validated as there was a connection problem.
-
-!
-! Referenced File Dialog Related Message
-!
-_UI_REF_FILE_ERROR_MESSAGE = Referenced file contains errors ({0}). For more information, right click on the message in the Problems View and select "Show Details..."
-
-# Warning when no grammar is located.
-_WARN_NO_GRAMMAR = No grammar constraints (DTD or XML schema) detected for the document.
-
-_NO_DOCUMENT_ELEMENT = A well-formed document requires a root element.
-
diff --git a/bundles/org.eclipse.wst.xml.core/src/.cvsignore b/bundles/org.eclipse.wst.xml.core/src/.cvsignore
deleted file mode 100644
index 101c29e19d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-notebook.jpage
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java
deleted file mode 100644
index 266b80a5fc..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/DebugAdapterFactory.java
+++ /dev/null
@@ -1,77 +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.xml.core.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-public class DebugAdapterFactory extends AbstractAdapterFactory implements PropagatingAdapterFactory {
-
- /**
- * Constructor for DebugAdapterFactory.
- */
- public DebugAdapterFactory() {
- this(IDebugAdapter.class, true);
- }
-
- /**
- * Constructor for DebugAdapterFactory.
- *
- * @param fAdapterKey
- * @param registerAdapters
- */
- private DebugAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
- public void addContributedFactories(INodeAdapterFactory factory) {
- //none expected
- }
-
- public INodeAdapterFactory copy() {
- return new DebugAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- EveryNodeDebugAdapter result = null;
- result = EveryNodeDebugAdapter.getInstance();
- return result;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IAdapterFactory#isFactoryForType(java.lang.Object)
- */
- public boolean isFactoryForType(Object type) {
-
- return IDebugAdapter.class == type;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.PropagatingAdapterFactory#setContributedFactories(java.util.ArrayList)
- */
- public void setContributedFactories(ArrayList list) {
- // none expected
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java
deleted file mode 100644
index baa718c736..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java
+++ /dev/null
@@ -1,284 +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.xml.core.internal;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-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.events.AboutToBeChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-/**
- * Purely for use in debugging
- */
-public class EveryNodeDebugAdapter implements IDebugAdapter {
-
- static class InternalDocumentListener implements IDocumentListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- Debug.println("IdocumentAboutToBeChanged: " + event); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- Debug.println("IdocumentChanged: " + event); //$NON-NLS-1$
-
- }
-
- }
-
- static class InternalModelStateListener implements IModelStateListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IModelStateListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.IStructuredModel)
- */
- public void modelAboutToBeChanged(IStructuredModel model) {
- Debug.println("modelAboutToBeChanged: " + model); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IModelStateListener#modelChanged(org.eclipse.wst.sse.core.IStructuredModel)
- */
- public void modelChanged(IStructuredModel model) {
- Debug.println("modelChanged: " + model); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IModelStateListener#modelDirtyStateChanged(org.eclipse.wst.sse.core.IStructuredModel,
- * boolean)
- */
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- Debug.println("modelDirtyStateChanged: " + model); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IModelStateListener#modelResourceDeleted(org.eclipse.wst.sse.core.IStructuredModel)
- */
- public void modelResourceDeleted(IStructuredModel model) {
- Debug.println("modelResourceDeleted: " + model); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.IModelStateListener#modelResourceMoved(org.eclipse.wst.sse.core.IStructuredModel,
- * org.eclipse.wst.sse.core.IStructuredModel)
- */
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- Debug.println("modelResourceMoved: " + "oldModel: " + oldModel + "newModel: " + newModel); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- Debug.println("modelAboutToBeReinitialized: " + "structuredModel: " + structuredModel); //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- Debug.println("modelReinitialized: " + "structuredModel: " + structuredModel); //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- }
-
- static class InternalStructuredDocumentAboutToChange implements IModelAboutToBeChangedListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IModelAboutToBeChangedListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.events.AboutToBeChangedEvent)
- */
- public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentAboutToBeChanged: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- }
-
- static class InternalStructuredDocumentListener implements IStructuredDocumentListener {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#newModel(org.eclipse.wst.sse.core.events.NewDocumentContentEvent)
- */
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentChanged - newModel: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#noChange(org.eclipse.wst.sse.core.events.NoChangeEvent)
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentChanged - noChange: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#nodesReplaced(org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent)
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentChanged - nodesReplaced: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionChanged(org.eclipse.wst.sse.core.events.RegionChangedEvent)
- */
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentChanged - regionChanged: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionsReplaced(org.eclipse.wst.sse.core.events.RegionsReplacedEvent)
- */
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- Debug.println("structuredDocumentChanged - regionsReplaced: " + structuredDocumentEvent); //$NON-NLS-1$
-
- }
-
- }
-
- private static EveryNodeDebugAdapter singletonInstance;
-
- public static EveryNodeDebugAdapter getInstance() {
- if (singletonInstance == null) {
- singletonInstance = new EveryNodeDebugAdapter();
- }
- return singletonInstance;
- }
-
- InternalDocumentListener fInternalDocumentListener;
- InternalModelStateListener fInternalModelStateListener;
- InternalStructuredDocumentAboutToChange fInternalStructuredDocumentAboutToChange;
- InternalStructuredDocumentListener fInternalStructuredDocumentListener;
- IStructuredModel fModel;
-
- /**
- *
- */
- public EveryNodeDebugAdapter() {
- super();
- fInternalDocumentListener = new InternalDocumentListener();
- fInternalStructuredDocumentAboutToChange = new InternalStructuredDocumentAboutToChange();
- fInternalStructuredDocumentListener = new InternalStructuredDocumentListener();
- fInternalModelStateListener = new InternalModelStateListener();
- }
-
- /**
- * @param target
- */
- public EveryNodeDebugAdapter(INodeNotifier target) {
- this();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return (type == IDebugAdapter.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifier instanceof IDOMNode) {
- setModel(((IDOMNode) notifier).getModel());
- }
- Debug.println("notifier: " + notifier + " " + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " changedFeature: " + changedFeature + " oldValue: " + oldValue + " newValue: " + newValue + " pos: " + pos); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.IDebugAdapter#setDocument(org.eclipse.wst.sse.core.text.IStructuredDocument)
- */
- private void setModel(IStructuredModel structuredModel) {
- if (fModel == structuredModel)
- return;
-
- if (fModel != null) {
- fModel.removeModelStateListener(fInternalModelStateListener);
- //
- IStructuredDocument structuredDocument = fModel.getStructuredDocument();
- if (structuredDocument != null) {
- structuredDocument.removeDocumentListener(fInternalDocumentListener);
- structuredDocument.removeDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
- structuredDocument.removeDocumentChangedListener(fInternalStructuredDocumentListener);
- }
- }
- fModel = structuredModel;
- if (fModel != null) {
-
- fModel.addModelStateListener(fInternalModelStateListener);
- //
- IStructuredDocument structuredDocument = fModel.getStructuredDocument();
- if (structuredDocument != null) {
- structuredDocument.addDocumentListener(fInternalDocumentListener);
- structuredDocument.addDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
- structuredDocument.addDocumentChangedListener(fInternalStructuredDocumentListener);
- }
- }
-
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java
deleted file mode 100644
index 35c5712dae..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java
+++ /dev/null
@@ -1,19 +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.xml.core.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-public interface IDebugAdapter extends INodeAdapter {
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java
deleted file mode 100644
index 798c9bba70..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java
+++ /dev/null
@@ -1,157 +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.xml.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.xml.core"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
deleted file mode 100644
index 831c0a274e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 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 - Initial API and implementation
- * Jesper Steen Moeller - Added XML Catalogs 1.1 support
- **********************************************************************/
-package org.eclipse.wst.xml.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Core
- *
- * @plannedfor 1.0
- */
-public class XMLCoreMessages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.XMLCorePluginResources";//$NON-NLS-1$
-
- public static String Invalid_character_lt_fo_ERROR_;
- public static String Invalid_character_gt_fo_ERROR_;
- public static String Invalid_character_amp_fo_ERROR_;
- public static String Invalid_character__f_EXC_;
- public static String loading;
- public static String Catalog_entry_key_not_set;
- public static String Catalog_entry_uri_not_set;
- public static String Catalog_rewrite_startString_not_set;
- public static String Catalog_rewrite_prefix_not_set;
- public static String Catalog_suffix_string_not_set;
- public static String Catalog_suffix_uri_not_set;
- public static String Catalog_delegate_prefix_not_set;
- public static String Catalog_delegate_catalog_not_set;
- public static String Catalog_next_catalog_location_uri_not_set;
- public static String Catalog_resolution_null_catalog;
- public static String Catalog_resolution_malformed_url;
- public static String Catalog_resolution_io_exception;
- public static String CMDocument_load_exception;
- public static String End_tag_has_attributes;
- public static String Attribute__is_missing_a_value;
- public static String Attribute__has_no_value;
- public static String Missing_end_tag_;
- public static String Missing_start_tag_;
- public static String ReconcileStepForMarkup_0;
- public static String ReconcileStepForMarkup_1;
- public static String ReconcileStepForMarkup_2;
- public static String ReconcileStepForMarkup_3;
- public static String ReconcileStepForMarkup_4;
- public static String ReconcileStepForMarkup_5;
- public static String ReconcileStepForMarkup_6;
- public static String Indicate_no_grammar_specified_severities_error;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLCoreMessages.class);
- }
-
- private XMLCoreMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
deleted file mode 100644
index b31c95aaf4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xml.core.internal.catalog.Catalog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XMLCorePlugin extends Plugin {
- // The shared instance.
- private static XMLCorePlugin plugin;
- public static final String USER_CATALOG_ID = "user_catalog"; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = "default_catalog"; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = "system_catalog"; //$NON-NLS-1$
- private CatalogSet catalogSet = null;
- private String defaultCatalogFileStateLocation;
-
-
- /**
- * Returns the shared instance.
- */
- public static XMLCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * @deprecated use ResourcesPlugin.getWorkspace() directly
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * The constructor.
- */
- public XMLCorePlugin() {
- super();
- plugin = this;
- }
-
- private String getPluginStateLocation(String fileName) {
- String location = getStateLocation().append(fileName).toString();
- String file_protocol = "file:"; //$NON-NLS-1$
- if (location != null && !location.startsWith(file_protocol)) {
- location = file_protocol + location;
- }
- return location;
- }
-
- public ICatalog getDefaultXMLCatalog() {
- if (catalogSet == null) {
- catalogSet = new CatalogSet();
-
- defaultCatalogFileStateLocation = getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE);
-
- catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation);
- catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE));
- catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE));
- }
- return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation);
- }
-
- public void clearCatalogCache() {
- if (catalogSet != null) {
- catalogSet.clearResourceCache();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
deleted file mode 100644
index d9f1fb7099..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-# Jesper Steen Moeller - Added XML Catalogs 1.1 support
-#
-###############################################################################
-Invalid_character_lt_fo_ERROR_=Invalid character ('<') found
-Invalid_character_gt_fo_ERROR_=Invalid character ('>') found
-Invalid_character_amp_fo_ERROR_=Invalid character ('&') found
-Invalid_character__f_EXC_=Invalid character ('\"') found
-###############################################################################
-# contentmodel strings
-loading=loading
-# catalog strings
-Catalog_entry_key_not_set=Catalog entry key is not set
-Catalog_entry_uri_not_set=Catalog entry URI is not set
-Catalog_rewrite_startString_not_set=Catalog rewrite start string is not set
-Catalog_rewrite_prefix_not_set=Catalog rewrite prefix is not set
-Catalog_suffix_string_not_set=Catalog suffix string is not set
-Catalog_suffix_uri_not_set=Catalog suffix URI is not set
-Catalog_delegate_prefix_not_set=Catalog delegate prefix is not set
-Catalog_delegate_catalog_not_set=Catalog delegate URI is not set
-Catalog_next_catalog_location_uri_not_set=Next catalog location URI is not set
-Catalog_resolution_null_catalog=Catalog resolution attempted with null catalog; ignored
-Catalog_resolution_malformed_url=Malformed URL exception trying to resolve
-Catalog_resolution_io_exception=I/O exception trying to resolve
-CMDocument_load_exception=An error occurred while loading document {0} with publicId {1}
-End_tag_has_attributes=End tag has attributes
-Attribute__is_missing_a_value=Attribute \"{0}\" is missing a value
-Attribute__has_no_value=Attribute \"{0}\" has no value
-Missing_start_tag_=Missing start tag \"{0}\"
-Missing_end_tag_=Missing end tag \"{0}\"
-ReconcileStepForMarkup_0=Missing closing quote
-ReconcileStepForMarkup_1=Missing quotes for attribute value
-ReconcileStepForMarkup_2=A tagname cannot start with a space
-ReconcileStepForMarkup_3=Empty tags are not allowed
-ReconcileStepForMarkup_4=Namespaces are not allowed in a Processing Instruction target
-ReconcileStepForMarkup_5=Spaces are not allowed before a Processing Instruction
-ReconcileStepForMarkup_6=Tag missing closing bracket '>'
-Indicate_no_grammar_specified_severities_error=ErrorCMDocument_load_exception=An error occurred while loading document {0} with publicId {1}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
deleted file mode 100644
index 05a4af4a52..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.eclipse.wst.xml.core.internal.document.TextImpl;
-import org.eclipse.wst.xml.core.internal.formatter.XMLFormatterFormatProcessor;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-
-public class CleanupProcessorXML extends AbstractStructuredCleanupProcessor {
- protected IStructuredCleanupPreferences fCleanupPreferences = null;
-
- public void cleanupModel(IStructuredModel structuredModel) {
- Preferences preferences = getModelPreferences();
- if (preferences != null && preferences.getBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION)) {
- IDOMDocument document = ((DOMModelImpl) structuredModel).getDocument();
- if (!fixExistingXmlDecl(document)) {
- String encoding = preferences.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- Node xml = document.createProcessingInstruction("xml", "version=\"1.0\" " + "encoding=\"" + encoding +"\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- document.insertBefore(xml, document.getFirstChild());
- }
- }
- super.cleanupModel(structuredModel);
- }
-
- /**
- * Is the node an XML declaration
- * @param node
- * @return true if the node is an XML declaration; otherwise, false.
- */
- private boolean isXMLDecl(IDOMNode node) {
- return node != null && node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && "xml".equalsIgnoreCase(((ProcessingInstruction) node).getTarget()); //$NON-NLS-1$
- }
-
- private boolean fixExistingXmlDecl(IDOMDocument document) {
- IDOMNode node = (IDOMNode) document.getFirstChild();
- while (node != null && node.getNodeType() == Node.TEXT_NODE && ((TextImpl) node).isWhitespace())
- node = (IDOMNode) node.getNextSibling();
- if (isXMLDecl(node)) {
- document.insertBefore(node, document.getFirstChild());
- return true;
- }
- return false;
- }
-
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- short nodeType = node.getNodeType();
- IStructuredCleanupHandler cleanupHandler = null;
- switch (nodeType) {
- case Node.ELEMENT_NODE : {
- cleanupHandler = new ElementNodeCleanupHandler();
- break;
- }
- case Node.TEXT_NODE : {
- cleanupHandler = new NodeCleanupHandler();
- break;
- }
- default : {
- cleanupHandler = new NodeCleanupHandler();
- }
- }
-
- // init CleanupPreferences
- cleanupHandler.setCleanupPreferences(getCleanupPreferences());
-
- return cleanupHandler;
- }
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
- protected String getContentType() {
- return ContentTypeIdForXML.ContentTypeID_XML;
- }
-
- protected IStructuredFormatProcessor getFormatProcessor() {
- return new XMLFormatterFormatProcessor();
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void refreshCleanupPreferences() {
- fCleanupPreferences = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
deleted file mode 100644
index 10baa534a3..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (Intalion) - Cleanup Repeated Conditional check in isXMLType method
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.cleanup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class ElementNodeCleanupHandler extends NodeCleanupHandler {
- protected static final char DOUBLE_QUOTE = '\"'; //$NON-NLS-1$
- protected static final String DOUBLE_QUOTES = "\"\""; //$NON-NLS-1$
- protected static final String EMPTY_TAG_CLOSE = "/>"; //$NON-NLS-1$
- protected static final String END_TAG_OPEN = "</"; //$NON-NLS-1$
- protected static final char SINGLE_QUOTE = '\''; //$NON-NLS-1$
- protected static final String SINGLE_QUOTES = "''"; //$NON-NLS-1$
-
- /** Non-NLS strings */
- protected static final String START_TAG_OPEN = "<"; //$NON-NLS-1$
- protected static final String TAG_CLOSE = ">"; //$NON-NLS-1$
-
- public Node cleanup(Node node) {
- Node newNode = cleanupChildren(node);
- IDOMNode renamedNode = newNode instanceof IDOMNode ? (IDOMNode) newNode : null;
-
- // call quoteAttrValue() first so it will close any unclosed attr
- // quoteAttrValue() will return the new start tag if there is a
- // structure change
- renamedNode = quoteAttrValue(renamedNode);
-
- // insert tag close if missing
- // if node is not comment tag
- // and not implicit tag
- if (!isCommentTag(renamedNode) && !isImplicitTag(renamedNode)) {
- IDOMModel structuredModel = renamedNode.getModel();
-
- // save start offset before insertTagClose()
- // or else renamedNode.getStartOffset() will be zero if
- // renamedNode replaced by insertTagClose()
- int startTagStartOffset = renamedNode.getStartOffset();
-
- // for start tag
- IStructuredDocumentRegion startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
- insertTagClose(structuredModel, startTagStructuredDocumentRegion);
-
- // update renamedNode and startTagStructuredDocumentRegion after
- // insertTagClose()
- renamedNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
- startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
-
- // for end tag
- IStructuredDocumentRegion endTagStructuredDocumentRegion = renamedNode.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion != startTagStructuredDocumentRegion)
- insertTagClose(structuredModel, endTagStructuredDocumentRegion);
- }
-
- // call insertMissingTags() next, it will generate implicit tags if
- // there are any
- // insertMissingTags() will return the new missing start tag if one is
- // missing
- renamedNode = insertMissingTags(renamedNode);
-
- renamedNode = compressEmptyElementTag(renamedNode);
-
- renamedNode = insertRequiredAttrs(renamedNode);
-
- return renamedNode;
- }
-
- protected Node cleanupChildren(Node node) {
- Node parentNode = node;
-
- if (node != null) {
- Node childNode = node.getFirstChild();
- while (childNode != null) {
- // get cleanup handler
- IStructuredCleanupHandler cleanupHandler = getCleanupHandler(childNode);
-
- // cleanup each child
- childNode = cleanupHandler.cleanup(childNode);
-
- // get new parent node
- parentNode = childNode.getParentNode();
-
- // get next child node
- childNode = childNode.getNextSibling();
- }
- }
-
- return parentNode;
- }
-
- private IDOMNode compressEmptyElementTag(IDOMNode node) {
- boolean compressEmptyElementTags = getCleanupPreferences().getCompressEmptyElementTags();
- IDOMNode newNode = node;
-
- IStructuredDocumentRegion startTagStructuredDocumentRegion = newNode.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getLastStructuredDocumentRegion();
-
- if (compressEmptyElementTags && startTagStructuredDocumentRegion != endTagStructuredDocumentRegion && startTagStructuredDocumentRegion != null) {
- ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- // format children and end tag if not empty element tag
- if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- NodeList childNodes = newNode.getChildNodes();
- if (childNodes == null || childNodes.getLength() == 0 || (childNodes.getLength() == 1 && (childNodes.item(0)).getNodeType() == Node.TEXT_NODE && ((childNodes.item(0)).getNodeValue().trim().length() == 0))) {
- IDOMModel structuredModel = newNode.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- int startTagStartOffset = newNode.getStartOffset();
- int offset = endTagStructuredDocumentRegion.getStart();
- int length = endTagStructuredDocumentRegion.getLength();
- structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-
- offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
- structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- }
- }
- }
-
- return newNode;
- }
-
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- short nodeType = node.getNodeType();
- IStructuredCleanupHandler cleanupHandler = null;
- switch (nodeType) {
- case org.w3c.dom.Node.ELEMENT_NODE : {
- cleanupHandler = new ElementNodeCleanupHandler();
- break;
- }
- case org.w3c.dom.Node.TEXT_NODE : {
- cleanupHandler = new NodeCleanupHandler();
- break;
- }
- default : {
- cleanupHandler = new NodeCleanupHandler();
- }
- }
-
- // init CleanupPreferences
- cleanupHandler.setCleanupPreferences(getCleanupPreferences());
-
- return cleanupHandler;
- }
-
-
- protected ModelQuery getModelQuery(Node node) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- return ModelQueryUtil.getModelQuery((Document) node);
- } else {
- return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
- }
-
- protected List getRequiredAttrs(Node node) {
- List result = new ArrayList();
-
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
- if (elementDecl != null) {
- CMNamedNodeMap attrMap = elementDecl.getAttributes();
- Iterator it = attrMap.iterator();
- CMAttributeDeclaration attr = null;
- while (it.hasNext()) {
- attr = (CMAttributeDeclaration) it.next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
- result.add(attr);
- }
- }
- }
- }
-
- return result;
- }
-
- private IDOMNode insertEndTag(IDOMNode node) {
- IDOMNode newNode = node;
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- int startTagStartOffset = node.getStartOffset();
- IDOMModel structuredModel = node.getModel();
-
- if (isEmptyElement(element)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- ITextRegionList regions = startStructuredDocumentRegion.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), lastRegion.getLength(), EMPTY_TAG_CLOSE);
-
- if (regions.size() > 1) {
- ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);
-
- // insert a space separator before tag close if the previous
- // region does not have extra spaces
- if (regionBeforeTagClose.getTextLength() == regionBeforeTagClose.getLength())
- structuredDocument.replaceText(structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), 0, " "); //$NON-NLS-1$
- }
- } else {
- String tagName = node.getNodeName();
- String endTag = END_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
-
- IDOMNode lastChild = (IDOMNode) node.getLastChild();
- int endTagStartOffset = 0;
- if (lastChild != null)
- // if this node has children, insert the end tag after the
- // last child
- endTagStartOffset = lastChild.getEndOffset();
- else
- // if this node does not has children, insert the end tag
- // after the start tag
- endTagStartOffset = node.getEndOffset();
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- structuredDocument.replaceText(structuredDocument, endTagStartOffset, 0, endTag);
- }
-
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- private IDOMNode insertMissingTags(IDOMNode node) {
- boolean insertMissingTags = getCleanupPreferences().getInsertMissingTags();
- IDOMNode newNode = node;
-
- if (insertMissingTags) {
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startTagStructuredDocumentRegion == null) {
- // implicit start tag; generate tag for it
- newNode = insertStartTag(node);
- startTagStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- }
-
- IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getEndStructuredDocumentRegion();
- ITextRegionList startStructuredDocumentRegionRegions = startTagStructuredDocumentRegion.getRegions();
- if (startTagStructuredDocumentRegion != null && startStructuredDocumentRegionRegions != null && (startStructuredDocumentRegionRegions.get(startStructuredDocumentRegionRegions.size() - 1)).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-
- } else {
- if (startTagStructuredDocumentRegion == null) {
- // start tag missing
- if (isStartTagRequired(newNode))
- newNode = insertStartTag(newNode);
- } else if (endTagStructuredDocumentRegion == null) {
- // end tag missing
- if (isEndTagRequired(newNode))
- newNode = insertEndTag(newNode);
- }
- }
- }
-
- return newNode;
- }
-
- private IDOMNode insertRequiredAttrs(IDOMNode node) {
- boolean insertRequiredAttrs = getCleanupPreferences().getInsertRequiredAttrs();
- IDOMNode newNode = node;
-
- if (insertRequiredAttrs) {
- List requiredAttrs = getRequiredAttrs(newNode);
- if (requiredAttrs.size() > 0) {
- NamedNodeMap currentAttrs = node.getAttributes();
- List insertAttrs = new ArrayList();
- if (currentAttrs.getLength() == 0)
- insertAttrs.addAll(requiredAttrs);
- else {
- for (int i = 0; i < requiredAttrs.size(); i++) {
- String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
- boolean found = false;
- for (int j = 0; j < currentAttrs.getLength(); j++) {
- String currentAttrName = currentAttrs.item(j).getNodeName();
- if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
- found = true;
- break;
- }
- }
- if (!found)
- insertAttrs.add(requiredAttrs.get(i));
- }
- }
- if (insertAttrs.size() > 0) {
- IStructuredDocumentRegion startStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- int index = startStructuredDocumentRegion.getEndOffset();
- ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion();
- if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) {
- index--;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- } else if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- index = index - 2;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- try {
- for (int i = insertAttrs.size() - 1; i >= 0; i--) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) insertAttrs.get(i);
- String requiredAttributeName = attrDecl.getAttrName();
- String defaultValue = attrDecl.getDefaultValue();
- if (defaultValue == null)
- defaultValue = ""; //$NON-NLS-1$
- String nameAndDefaultValue = " "; //$NON-NLS-1$
- if (i == 0 && lastRegion.getLength() > lastRegion.getTextLength())
- nameAndDefaultValue = ""; //$NON-NLS-1$
- nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
- // BUG3381: MultiTextEdit applies all child
- // TextEdit's basing on offsets
- // in the document before the first TextEdit, not
- // after each
- // child TextEdit. Therefore, do not need to
- // advance the index.
- //index += nameAndDefaultValue.length();
- }
- multiTextEdit.apply(newNode.getStructuredDocument());
- } catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
-
- return newNode;
- }
-
- private IDOMNode insertStartTag(IDOMNode node) {
- IDOMNode newNode = node;
-
- if (isCommentTag(node))
- return node; // do nothing
-
- String tagName = node.getNodeName();
- String startTag = START_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- structuredDocument.replaceText(structuredDocument, startTagStartOffset, 0, startTag);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- private void insertTagClose(IDOMModel structuredModel, IStructuredDocumentRegion flatNode) {
- if (flatNode != null) {
- ITextRegionList flatnodeRegions = flatNode.getRegions();
- if (flatnodeRegions != null) {
- ITextRegion lastRegion = flatnodeRegions.get(flatnodeRegions.size() - 1);
- if (lastRegion != null) {
- String regionType = lastRegion.getType();
- if ((regionType != DOMRegionContext.XML_EMPTY_TAG_CLOSE) && (regionType != DOMRegionContext.XML_TAG_CLOSE)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- // insert ">" after lastRegion of flatNode
- // as in "<a</a>" if flatNode is for start tag, or in
- // "<a></a" if flatNode is for end tag
- structuredDocument.replaceText(structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- /**
- * @param renamedNode
- * @return
- */
- private boolean isCommentTag(Node renamedNode) {
- boolean result = false;
- if (renamedNode instanceof IDOMElement) {
- IDOMElement element = (IDOMElement) renamedNode;
- result = element.isCommentTag();
- }
- return result;
- }
-
- private boolean isEmptyElement(IDOMElement element) {
- Document document = element.getOwnerDocument();
- if (document == null)
- // undefined tag, return default
- return false;
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- // undefined tag, return default
- return false;
-
- CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
- if (decl == null)
- // undefined tag, return default
- return false;
-
- return (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- private boolean isEndTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- /**
- * A tag is implicit if it has not corresponding region in document.
- *
- * @param renamedNode
- * @return
- */
- private boolean isImplicitTag(IDOMNode renamedNode) {
- return renamedNode.getStartStructuredDocumentRegion() == null;
- }
-
- /**
- * The end tags of HTML EMPTY content type, such as IMG, and HTML
- * undefined tags are parsed separately from the start tags. So inserting
- * the missing start tag is useless and even harmful.
- */
- private boolean isStartTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- private boolean isXMLType(IDOMModel structuredModel) {
- boolean result = false;
-
- if (structuredModel != null) {
- IDOMDocument document = structuredModel.getDocument();
-
- if (document != null)
- result = document.isXMLType();
- }
-
- return result;
- }
-
- private IDOMNode quoteAttrValue(IDOMNode node) {
- IDOMNode newNode = node;
- //XMLElement element = (XMLElement) node;
- if (isCommentTag(node))
- return node; // do nothing
-
- boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
-
- if (quoteAttrValues) {
- NamedNodeMap attributes = newNode.getAttributes();
- if (attributes != null) {
- int attributesLength = attributes.getLength();
- ISourceGenerator generator = node.getModel().getGenerator();
-
- for (int i = 0; i < attributesLength; i++) {
- attributes = newNode.getAttributes();
- attributesLength = attributes.getLength();
- IDOMAttr eachAttr = (IDOMAttr) attributes.item(i);
- //ITextRegion oldAttrValueRegion =
- // eachAttr.getValueRegion();
- String oldAttrValue = eachAttr.getValueRegionText();
- if (oldAttrValue == null) {
- IDOMModel structuredModel = node.getModel();
- if (isXMLType(structuredModel)) {
- String newAttrValue = "\"" + eachAttr.getNameRegionText() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- if (eachAttr.getEqualRegion() != null)
- // equal region exists
- structuredDocument.replaceText(structuredDocument, eachAttr.getEndOffset(), 0, newAttrValue);
- else
- // no equal region
- structuredDocument.replaceText(structuredDocument, eachAttr.getNameRegionTextEndOffset(), 0, "=".concat(newAttrValue)); //$NON-NLS-1$
- newNode = (IDOMNode) structuredModel.getIndexedRegion(node.getStartOffset()); // save
- // new
- // node
- }
- } else {
- //String oldAttrValue = oldAttrValueRegion.getText();
- char quote = StringUtils.isQuoted(oldAttrValue) ? oldAttrValue.charAt(0) : DOUBLE_QUOTE;
- String newAttrValue = generator.generateAttrValue(eachAttr, quote);
-
- // There is a problem in
- // StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
- // when the region is instanceof ContextRegion.
- // Workaround for now...
- if (oldAttrValue.length() == 1) {
- char firstChar = oldAttrValue.charAt(0);
- if (firstChar == SINGLE_QUOTE)
- newAttrValue = SINGLE_QUOTES;
- else if (firstChar == DOUBLE_QUOTE)
- newAttrValue = DOUBLE_QUOTES;
- }
-
- if (newAttrValue != null) {
- if (newAttrValue.compareTo(oldAttrValue) != 0) {
- int attrValueStartOffset = eachAttr.getValueRegionStartOffset();
- int attrValueLength = oldAttrValue.length();
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- structuredDocument.replaceText(structuredDocument, attrValueStartOffset, attrValueLength, newAttrValue);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
- }
- }
- }
- }
- }
- }
-
- return newNode;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java
deleted file mode 100644
index 95c209792b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java
+++ /dev/null
@@ -1,63 +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.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.w3c.dom.Node;
-
-
-public class NodeCleanupHandler implements IStructuredCleanupHandler {
-
- protected IStructuredCleanupPreferences fCleanupPreferences = null;
- protected IProgressMonitor fProgressMonitor = null;
-
-
- public Node cleanup(Node node) {
-
- return node;
- }
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- public void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences) {
-
- fCleanupPreferences = cleanupPreferences;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java
deleted file mode 100644
index 473c4875da..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java
+++ /dev/null
@@ -1,142 +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.xml.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
-
-/**
- * @deprecated renamed to StructuredCleanupPreferences
- *
- * TODO will delete in C5
- */
-public class XMLCleanupPreferencesImpl {
-
- private static XMLCleanupPreferencesImpl fInstance;
-
- public synchronized static XMLCleanupPreferencesImpl getInstance() {
-
- // added for one method in CleanupDialog ... may be better way
- if (fInstance == null) {
- fInstance = new XMLCleanupPreferencesImpl();
- }
- return fInstance;
- }
-
- private int fAttrNameCase;
- private boolean fConvertEOLCodes;
- private String fEOLCode;
- private boolean fFormatSource;
- private boolean fInsertMissingTags;
- // private IPreferenceStore fPreferenceStore = null;
- private Preferences fPreferences = null;
- private boolean fQuoteAttrValues;
- private int fTagNameCase;
-
- public int getAttrNameCase() {
-
- return fAttrNameCase;
- }
-
- public boolean getConvertEOLCodes() {
-
- return fConvertEOLCodes;
- }
-
- public String getEOLCode() {
-
- return fEOLCode;
- }
-
- public boolean getFormatSource() {
-
- return fFormatSource;
- }
-
- public boolean getInsertMissingTags() {
-
- return fInsertMissingTags;
- }
-
- public Preferences getPreferences() {
-
- if (fPreferences == null) {
- fPreferences = SSECorePlugin.getDefault().getPluginPreferences();
- }
- return fPreferences;
- }
-
- public boolean getQuoteAttrValues() {
-
- return fQuoteAttrValues;
- }
-
- public int getTagNameCase() {
-
- return fTagNameCase;
- }
-
- public void setAttrNameCase(int attrNameCase) {
-
- fAttrNameCase = attrNameCase;
- }
-
- public void setConvertEOLCodes(boolean convertEOLCodes) {
-
- fConvertEOLCodes = convertEOLCodes;
- }
-
- public void setEOLCode(String EOLCode) {
-
- fEOLCode = EOLCode;
- }
-
- public void setFormatSource(boolean formatSource) {
-
- fFormatSource = formatSource;
- }
-
- public void setInsertMissingTags(boolean insertMissingTags) {
-
- fInsertMissingTags = insertMissingTags;
- }
-
- public void setPreferences(Preferences prefs) {
-
- fPreferences = prefs;
- updateOptions();
- }
-
- public void setQuoteAttrValues(boolean quoteAttrValues) {
-
- fQuoteAttrValues = quoteAttrValues;
- }
-
- public void setTagNameCase(int tagNameCase) {
-
- fTagNameCase = tagNameCase;
- }
-
- protected void updateOptions() {
-
- Preferences p = getPreferences();
- fTagNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_TAG_NAME_CASE);
- fAttrNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_ATTR_NAME_CASE);
- fInsertMissingTags = p.getBoolean(IXMLPreferenceNames.INSERT_MISSING_TAGS);
- fQuoteAttrValues = p.getBoolean(IXMLPreferenceNames.QUOTE_ATTR_VALUES);
- fFormatSource = p.getBoolean(IXMLPreferenceNames.FORMAT_SOURCE);
- fConvertEOLCodes = p.getBoolean(IXMLPreferenceNames.CONVERT_EOL_CODES);
- fEOLCode = p.getString(IXMLPreferenceNames.CLEANUP_EOL_CODE);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
deleted file mode 100644
index c06af5e212..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
+++ /dev/null
@@ -1,103 +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.xml.core.internal.commentelement;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementConfiguration;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-/**
- */
-public class CommentElementAdapter implements TagAdapter {
- private CommentElementConfiguration fConfiguration;
-
- private boolean fEndTag;
- private CommentElementHandler fHandler;
-
- public CommentElementAdapter(boolean isEndTag, CommentElementHandler handler) {
- fEndTag = isEndTag;
- fHandler = handler;
- }
-
- private String generateCommentClose(IDOMElement element) {
- return (element.isJSPTag()) ? "--%>" : "-->"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private String generateCommentOpen(IDOMElement element) {
- return (element.isJSPTag()) ? "<%--" : "<!--"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private CommentElementConfiguration getConfiguration() {
- return fConfiguration;
- }
-
- public String getEndTag(IDOMElement element) {
- String content = fHandler.generateEndTagContent(element);
- if (content == null) {
- return null;
- }
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(generateCommentOpen(element));
- buffer.append(content);
- buffer.append(generateCommentClose(element));
-
- return buffer.toString();
- }
-
- public String getHandlerID() {
- return getConfiguration().getHandlerID();
- }
-
-
- public String getProperty(String name) {
- return getConfiguration().getProperty(name);
- }
-
- public String getStartTag(IDOMElement element) {
- String content = fHandler.generateStartTagContent(element);
- if (content == null) {
- return null;
- }
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(generateCommentOpen(element));
- buffer.append(content);
- buffer.append(generateCommentClose(element));
-
- return buffer.toString();
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == CommentElementAdapter.class || type == TagAdapter.class);
- }
-
- public boolean isContainer() {
- return (!fHandler.isEmpty());
- }
-
- public boolean isEndTag() {
- return fEndTag;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- public void setConfiguration(CommentElementConfiguration configuration) {
- fConfiguration = configuration;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java
deleted file mode 100644
index 93e8e6eedb..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java
+++ /dev/null
@@ -1,107 +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.xml.core.internal.commentelement;
-
-
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public interface CommentElementHandler {
- /**
- * This method is called when the prefix of the comment content matches
- * the string specified in &lt;startswith prefix=""/&gt; in plugin
- * extension. Comment content is parsed and new DOM element is created in
- * this method. Implementor has to do following:
- * <li>For start tag :
- * <ul>
- * <li>parse comment content and create new element instance.</li>
- * </ul>
- * </li>
- * <li>For end tag :
- * <ul>
- * <li>parse comment content and create new element instance.</li>
- * <li>make isEndTag flag true.</li>
- * <li>Parser framework searches mached start tag element instance after
- * this createElement call, and new instance is just thrown away.</li>
- * </ul>
- * </li>
- * <li>For empty tag :
- * <ul>
- * <li>parse comment content and create new element instance.</li>
- * <li>make isEndTag flag true.</li>
- * </ul>
- * </li>
- *
- * @param document
- * parent DOM document
- * @param data
- * comment content. comment prefix (&lt;!-- or &lt;%--), suffix
- * (--&gt; or --%&gt;), and surrounding spaces are trimmed.
- * @param isJSPTag
- * true if the comment is JSP style comment. This information
- * may be required by handler when the handler accepts both XML
- * style and JSP style comment (namely,
- * commenttype=&quot;both&quot; in plugin.xml).
- * @return comment element instance if the comment content is rightly
- * parsed. if parse failed, returns null.
- */
- Element createElement(Document document, String data, boolean isJSPTag);
-
- /**
- * This method generates the source text of the end tag for the passed
- * element. Do not generate comment prefix (&lt;!-- or &lt;%--) and suffix
- * (--&gt; or --%&gt;). XMLGenerator uses this method to generate XML/HTML
- * source for a comment element.
- *
- * @param element
- * the comment element
- * @return generated tag string
- */
- String generateEndTagContent(IDOMElement element);
-
- /**
- * This method generates the source text of the start tag for the passed
- * element. Do not generate comment prefix (&lt;!-- or &lt;%--) and suffix
- * (--&gt; or --%&gt;). XMLGenerator uses this method to generate XML/HTML
- * source for a comment element.
- *
- * @param element
- * the comment element
- * @return generated tag string
- */
- String generateStartTagContent(IDOMElement element);
-
- /**
- *
- * @param element
- * the element
- * @return boolean whether the element is comment element or not
- */
- boolean isCommentElement(IDOMElement element);
-
- /**
- *
- * @return boolean whether this element can have children or not
- */
- boolean isEmpty();
-
- /**
- * @return String
- */
- // String getElementPrefix();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java
deleted file mode 100644
index caf62283d9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java
+++ /dev/null
@@ -1,135 +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.xml.core.internal.commentelement.impl;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.util.CommentElementFactory;
-import org.eclipse.wst.xml.core.internal.commentelement.util.TagScanner;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-
-/**
- */
-class BasicCommentElementHandler implements CommentElementHandler {
-
- private String elementName;
- private boolean isEmpty;
-
- public BasicCommentElementHandler(String elementName, boolean isEmpty) {
- super();
- this.elementName = elementName;
- this.isEmpty = isEmpty;
- }
-
-
- public Element createElement(Document document, String data, boolean isJSPTag) {
- Element element = null;
- String str = data.trim();
- CommentElementFactory factory = new CommentElementFactory(document, isJSPTag, this);
- if (str.charAt(0) == '/') { // end tag
- TagScanner scanner = new TagScanner(str, 1); // skip '/'
- String name = scanner.nextName();
- if (name.equals(elementName)) {
- element = factory.create(name, CommentElementFactory.IS_END);
- }
- } else { // start tag
- TagScanner scanner = new TagScanner(str, 0);
- String name = scanner.nextName();
- if (name.equals(elementName)) {
- element = factory.create(name, (isEmpty) ? CommentElementFactory.IS_EMPTY : CommentElementFactory.IS_START);
- // set attributes
- String attrName = scanner.nextName();
- while (attrName != null) {
- String attrValue = scanner.nextValue();
- Attr attr = document.createAttribute(attrName);
- if (attr != null) {
- if (attrValue != null)
- ((IDOMAttr) attr).setValueSource(attrValue);
- element.setAttributeNode(attr);
- }
- attrName = scanner.nextName();
- }
- }
- }
- return element;
- }
-
-
- public String generateEndTagContent(IDOMElement element) {
- if (isEmpty) {
- return null;
- }
- ISourceGenerator generator = element.getModel().getGenerator();
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(" /"); //$NON-NLS-1$
- String tagName = generator.generateTagName(element);
- if (tagName != null) {
- buffer.append(tagName);
- }
- buffer.append(' ');
-
- return buffer.toString();
- }
-
- public String generateStartTagContent(IDOMElement element) {
- ISourceGenerator generator = element.getModel().getGenerator();
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(' ');
- String tagName = generator.generateTagName(element);
- if (tagName != null) {
- buffer.append(tagName);
- }
-
- NamedNodeMap attributes = element.getAttributes();
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- Attr attr = (Attr) attributes.item(i);
- if (attr == null) {
- continue;
- }
- buffer.append(' ');
- String attrName = generator.generateAttrName(attr);
- if (attrName != null) {
- buffer.append(attrName);
- }
- String attrValue = generator.generateAttrValue(attr);
- if (attrValue != null) {
- // attr name only for HTML boolean and JSP
- buffer.append('=');
- buffer.append(attrValue);
- }
- }
-
- buffer.append(' ');
-
- return buffer.toString();
- }
-
- public boolean isCommentElement(IDOMElement element) {
- return (element != null && element.getTagName().equals(elementName)) ? true : false;
- }
-
- public boolean isEmpty() {
- return isEmpty;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
deleted file mode 100644
index 78d900d615..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.impl;
-
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CommentElementConfiguration {
- private Map fAttributes = null;
- private boolean fCustom;
- private IConfigurationElement fElement = null;
-
- private boolean fEmpty;
- private CommentElementHandler fHandler = null;
- private String fID = null;
- private boolean fJSPComment;
- private String[] fPrefix = null;
- private boolean fXMLComment;
-
- CommentElementConfiguration(IConfigurationElement element) {
- super();
- fElement = element;
- fCustom = "handler-custom".equalsIgnoreCase(element.getName()); //$NON-NLS-1$
-
- fillAttributes(element);
-
- fXMLComment = fJSPComment = false;
- String commentType = getProperty("commenttype"); //$NON-NLS-1$
- if ("xml".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
- fXMLComment = true;
- } else if ("jsp".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
- fJSPComment = true;
- } else if ("both".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
- fXMLComment = fJSPComment = true;
- }
- String empty = getProperty("isempty"); //$NON-NLS-1$
- fEmpty = Boolean.valueOf(empty).booleanValue(); //$NON-NLS-1$
- }
-
- public boolean acceptJSPComment() {
- return fJSPComment;
- }
-
- public boolean acceptXMLComment() {
- return fXMLComment;
- }
-
- public Element createElement(Document document, String data, boolean isJSPTag) {
- IDOMElement element = (IDOMElement) getHandler().createElement(document, data, isJSPTag);
- if (element != null) {
- CommentElementAdapter adapter = (CommentElementAdapter) element.getAdapterFor(CommentElementAdapter.class);
- if (adapter != null) {
- adapter.setConfiguration(this);
- }
- }
- return element;
- }
-
- private void fillAttributes(IConfigurationElement element) {
- if (fAttributes == null) {
- fAttributes = new HashMap();
- } else {
- fAttributes.clear();
- }
- String[] names = element.getAttributeNames();
- if (names == null) {
- return;
- }
- int length = names.length;
- for (int i = 0; i < length; i++) {
- String name = names[i];
- fAttributes.put(name.toLowerCase(), element.getAttribute(name));
- }
- }
-
- public CommentElementHandler getHandler() {
- if (fHandler == null) {
- if (fElement != null) {
- try {
- if (isCustom()) {
- fHandler = (CommentElementHandler) fElement.createExecutableExtension("class"); //$NON-NLS-1$
- } else {
- String elementName = getProperty("elementname"); //$NON-NLS-1$
- if (elementName != null) {
- fHandler = new BasicCommentElementHandler(elementName, fEmpty);
- }
- }
- // ((AbstractCommentElementHandler)fHandler).setElementPrefix(fElement.getAttribute("prefix"));
- } catch (Exception e) {
- // catch and log (and ignore) ANY exception created
- // by executable extension.
- Logger.logException(e);
- fHandler = null;
- }
- }
- if (fHandler == null) {
- fHandler = new CommentElementHandler() {
- public Element createElement(Document document, String data, boolean isJSPTag) {
- return null;
- }
-
- public String generateEndTagContent(IDOMElement element) {
- return null;
- }
-
- public String generateStartTagContent(IDOMElement element) {
- return null;
- }
-
-// removed in RC2, ro removed "unused" error/warning
-// public String getElementPrefix() {
-// return null;
-// }
-
- public boolean isCommentElement(IDOMElement element) {
- return false;
- }
-
- public boolean isEmpty() {
- return false;
- }
- };
- }
- }
- return fHandler;
- }
-
- public String getHandlerID() {
- if (fID == null) {
- fID = getProperty("id"); //$NON-NLS-1$
- if (fID == null) {
- if (isCustom()) {
- fID = getProperty("class"); //$NON-NLS-1$
- } else {
- StringBuffer buf = new StringBuffer();
- buf.append(fElement.getDeclaringExtension().getNamespace());
- buf.append('.');
- buf.append(getProperty("elementname")); //$NON-NLS-1$
- fID = buf.toString();
- }
- }
- }
- return fID;
- }
-
-
- public String[] getPrefix() {
- if (fPrefix == null) {
- if (fElement != null) {
- if (isCustom()) { // custom
- IConfigurationElement[] prefixes = fElement.getChildren("startwith"); //$NON-NLS-1$
- if (prefixes != null) {
- List prefixValues = new ArrayList(prefixes.length);
- for (int i = 0; i < prefixes.length; i++) {
- String prefix = prefixes[i].getAttribute("prefix"); //$NON-NLS-1$
- if (prefix != null) {
- prefixValues.add(prefix);
- }
- else {
- try {
- Logger.log(Logger.WARNING, "misconfigured comment element in" + fElement.getContributor().getName(), new IllegalArgumentException("startwith")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (InvalidRegistryObjectException e) {
- // stale bundle?
- }
- }
- }
- if (!prefixValues.isEmpty()) {
- fPrefix = (String[]) prefixValues.toArray(new String[prefixValues.size()]);
- }
- }
- } else { // basic
- String name = getProperty("elementname"); //$NON-NLS-1$
- if (name != null) {
- if (isEmpty()) {
- fPrefix = new String[1];
- fPrefix[0] = name;
- } else {
- fPrefix = new String[2];
- fPrefix[0] = name;
- fPrefix[1] = '/' + name;
- }
- }
- }
- }
- }
- if (fPrefix == null) {
- fPrefix = new String[0];
- }
- return fPrefix;
- }
-
- public String getProperty(String name) {
- return (fAttributes != null) ? (String) fAttributes.get(name) : null;
- }
-
- private boolean isCustom() {
- return fCustom;
- }
-
- private boolean isEmpty() {
- return fEmpty;
- }
-
- void setupCommentElement(IDOMElement element) {
- element.setCommentTag(true);
- CommentElementAdapter adapter = new CommentElementAdapter(false, fHandler);
- adapter.setConfiguration(this);
- element.addAdapter(adapter);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java
deleted file mode 100644
index 3516c9b23c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.commentelement.impl;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-/**
- */
-public class CommentElementRegistry {
-
- private static CommentElementRegistry fInstance = null;
-
- public synchronized static CommentElementRegistry getInstance() {
- if (fInstance == null) {
- fInstance = new CommentElementRegistry();
- }
- return fInstance;
- }
-
- private String EXTENSION_POINT_ID = "commentElementHandler"; //$NON-NLS-1$
- private CommentElementConfiguration[] fConfigurations = null;
-
- private String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
- /**
- * Constructor for CommentElementRegistry.
- */
- private CommentElementRegistry() {
- super();
- }
-
- public synchronized CommentElementConfiguration[] getConfigurations() {
- if (fConfigurations == null) {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- fConfigurations = new CommentElementConfiguration[elements.length];
- for (int i = 0; i < elements.length; i++) {
- fConfigurations[i] = new CommentElementConfiguration(elements[i]);
- }
- }
- if (fConfigurations == null) {
- fConfigurations = new CommentElementConfiguration[0];
- }
- }
- return fConfigurations;
- }
-
- public boolean setupCommentElement(IDOMElement element) {
- CommentElementConfiguration configurations[] = getConfigurations();
- int length = configurations.length;
- for (int i = 0; i < length; i++) {
- CommentElementConfiguration conf = configurations[i];
- boolean isJSP = element.isJSPTag();
- if (isJSP && conf.acceptJSPComment() || !isJSP && conf.acceptXMLComment()) {
- CommentElementHandler handler = conf.getHandler();
- if (handler.isCommentElement(element)) {
- conf.setupCommentElement(element);
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java
deleted file mode 100644
index 2ac27ba0b1..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.commentelement.util;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CommentElementFactory {
- public static final int IS_EMPTY = 4866;
- public static final int IS_END = 1808;
-
- public static final int IS_START = 28011;
-
- private Document fDocument;
- private CommentElementHandler fHandler;
- private boolean fJSPTag;
-
- /**
- * Constructor for CommentElementFactory.
- */
- private CommentElementFactory() {
- super();
- }
-
- public CommentElementFactory(Document document, boolean isJSPTag, CommentElementHandler handler) {
- this();
- fDocument = document;
- fJSPTag = isJSPTag;
- fHandler = handler;
- }
-
- public Element create(String name, int nodeType) {
- IDOMElement element = (IDOMElement) fDocument.createElement(name);
- if (element == null)
- return null;
- element.setCommentTag(true);
- if (nodeType == IS_EMPTY) {
- element.setEmptyTag(true);
- }
- element.setJSPTag(fJSPTag);
-
- CommentElementAdapter adapter = new CommentElementAdapter((nodeType == IS_END), fHandler);
- element.addAdapter(adapter);
-
- return element;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java
deleted file mode 100644
index 1d0d404c86..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java
+++ /dev/null
@@ -1,196 +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.xml.core.internal.commentelement.util;
-
-
-
-/**
- */
-public class TagScanner {
-
- /**
- */
- private static boolean isEqual(char c) {
- return (c == '=');
- }
-
- /**
- */
- private static boolean isQuote(char c) {
- return (c == '"' || c == '\'');
- }
-
- /**
- */
- private static boolean isSpace(char c) {
- return Character.isWhitespace(c);
- }
-
- private int length = 0;
- private int memOffset = 0;
- private int offset = 0;
- private boolean oneLine = false;
-
- private String tag = null;
-
- /**
- */
- public TagScanner(String tag, int offset) {
- super();
-
- this.tag = tag;
- this.offset = offset;
- this.memOffset = -1;
- if (tag != null)
- this.length = tag.length();
- }
-
- /**
- */
- public TagScanner(String tag, int offset, boolean oneLine) {
- this(tag, offset);
-
- this.oneLine = oneLine;
- }
-
- /**
- */
- public int getNextOffset() {
- int i;
- char c;
- for (i = offset; i < length; i++) {
- c = tag.charAt(i);
- if (isEnd(c))
- break;
- if (isQuote(c)) {
- i++;
- break;
- }
- if (!isSpace(c) && !isEqual(c))
- break;
- }
- return i;
- }
-
- /**
- */
- public int getOffset() {
- return this.memOffset;
- }
-
- /**
- */
- private final boolean isEnd(char c) {
- return (this.oneLine && (c == '\r' || c == '\n'));
- }
-
- /**
- */
- public boolean isNewLine() {
- if (oneLine)
- return false;
- char c;
- for (int i = memOffset - 1; 0 <= i; i--) {
- c = tag.charAt(i);
- if (c == '\r' || c == '\n')
- return true;
- if (!isSpace(c))
- return false;
- }
- return false;
- }
-
- /**
- */
- private char nextChar() {
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c))
- break;
- if (!isSpace(c))
- return c;
- }
- return 0;
- }
-
- /**
- */
- public String nextName() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- if (nextChar() == 0)
- return null;
-
- int nameOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c) || isSpace(c))
- break;
- if (isEqual(c) && this.offset > nameOffset)
- break;
- }
- if (this.offset == nameOffset)
- return null;
-
- this.memOffset = nameOffset;
- return this.tag.substring(nameOffset, this.offset);
- }
-
- /**
- */
- public String nextValue() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- char seperator = nextChar();
- if (!isEqual(seperator))
- return null;
- this.offset++; // skip '='
- char quote = nextChar();
- if (quote == 0)
- return null;
- if (isQuote(quote))
- this.offset++;
- else
- quote = 0;
-
- int valueOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c)) {
- quote = 0;
- break;
- }
- if (quote == 0) {
- if (isSpace(c))
- break;
- } else {
- if (c == quote)
- break;
- }
- }
- int valueEnd = this.offset;
- if (quote != 0 && this.offset < this.length)
- this.offset++;
- if (valueEnd == valueOffset)
- return null;
-
- this.memOffset = valueOffset;
- return this.tag.substring(valueOffset, valueEnd);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index fcbcbea17f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,258 +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.xml.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- } catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- } catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- //createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- protected 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.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index 3d50b3f7a2..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,108 +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.xml.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- *
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
- public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
- protected byte[] fBuffer;
-
- protected InputStream fInputStream;
-
- protected ByteReader() {
- super();
- }
-
- public ByteReader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE);
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- }
-
- public ByteReader(InputStream inputStream, int size) {
- fInputStream = inputStream;
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- fBuffer = new byte[size];
-
- }
-
- public void close() throws IOException {
- fInputStream.close();
- }
-
- public void mark(int readAheadLimit) throws IOException {
- fInputStream.mark(readAheadLimit);
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public int read() throws IOException {
- int b0 = fInputStream.read();
- return (b0 & 0x00FF);
- }
-
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > fBuffer.length) {
- length = fBuffer.length;
- }
-
- int count = fInputStream.read(fBuffer, 0, length);
-
- for (int i = 0; i < count; i++) {
- int b0 = 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 fInputStream.available() > 0;
- }
-
- public void reset() throws IOException {
- fInputStream.reset();
- }
-
- public long skip(long n) throws IOException {
- return fInputStream.skip(n);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java
deleted file mode 100644
index 9e56e7029e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java
+++ /dev/null
@@ -1,264 +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.xml.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 ContentDescriberForXML implements ITextContentDescriber {
- private final static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
- /**
- * <code>restrictedMode</code> is used just for testing/experiments.
- *
- * If in restrictedMode, our "custom" contentType is seen as valid only in
- * cases that the platform's standard one does not cover.
- */
- private final static boolean restrictedMode = true;
- private IResourceCharsetDetector getDetector() {
- return new XMLResourceEncodingDetector();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io.InputStream,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- // for this special case, always assume invalid, unless
- // our special circumstances are met.
- int result = IContentDescriber.INVALID;
-
- if (description == null) {
- // purely request for validty
- result = determineValidity(result, contents);
- }
- else {
- result = calculateSupportedOptions(result, contents, description);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.ITextContentDescriber#describe(java.io.Reader,
- * org.eclipse.core.runtime.content.IContentDescription)
- */
- public int describe(Reader contents, IContentDescription description) throws IOException {
- // for this special case, always assume invalid, unless
- // our special circumstances are met.
- int result = IContentDescriber.INVALID;
-
- if (description == null) {
- // purely request for validty
- result = determineValidity(result, contents);
- }
- else {
- result = calculateSupportedOptions(result, contents, description);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions()
- */
- public QualifiedName[] getSupportedOptions() {
-
- return SUPPORTED_OPTIONS;
- }
-
- private int calculateSupportedOptions(int result, InputStream contents, IContentDescription description) throws IOException {
- int returnResult = result;
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- contents.reset();
- detector.set(contents);
- returnResult = handleCalculations(result, description, detector);
- }
- return returnResult;
- }
-
- private int determineValidity(int result, InputStream contents) throws IOException {
- int returnResult = result;
- IResourceCharsetDetector detector = getDetector();
- contents.reset();
- detector.set(contents);
- returnResult = determineValidity(detector, returnResult);
- return returnResult;
- }
- private int determineValidity(int result, Reader contents) throws IOException {
- int returnResult = result;
- IResourceCharsetDetector detector = getDetector();
- contents.reset();
- detector.set(contents);
- returnResult = determineValidity(detector, returnResult);
- return returnResult;
- }
- /**
- * @param contents
- * @param description
- * @throws IOException
- */
- private int calculateSupportedOptions(int result, Reader contents, IContentDescription description) throws IOException {
- int returnResult = result;
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- returnResult = handleCalculations(result, description, detector);
- }
- return returnResult;
- }
-
- private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
- // since equal, we don't need to add, but if our detected version is
- // different than
- // javaCharset, then we should add it. This will happen, for example,
- // if there's
- // differences in case, or differences due to override properties
- if (detectedCharset != null) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- return result;
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- private int handleCalculations(int result, IContentDescription description, IResourceCharsetDetector detector) throws IOException {
- int returnResult = result;
- EncodingMemento encodingMemento = ((XMLResourceEncodingDetector) detector).getEncodingMemento();
- if (description != null) {
- // 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 the default
- Object defaultCharset = detector.getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- else {
- // assuming if there is no spec default, we always
- // need to add.
- // TODO: this is probably a dead branch in current
- // code, should re-examine for removal.
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
- }
-
- returnResult = determineValidity(detector, returnResult);
- return returnResult;
- }
-
- private int determineValidity(IResourceCharsetDetector detector, int returnResult) {
- // we always expect XMLResourceEncodingDetector, but just to make safe
- // cast.
- if (detector instanceof XMLResourceEncodingDetector) {
- XMLResourceEncodingDetector xmlResourceDetector = (XMLResourceEncodingDetector) detector;
- if (xmlResourceDetector.isDeclDetected()) {
- if (restrictedMode) {
- // if there is no initial whitespace, then platform's
- // default one will do.
- if (xmlResourceDetector.hasInitialWhiteSpace()) {
- returnResult = IContentDescriber.VALID;
- }
- }
- else {
- returnResult = IContentDescriber.VALID;
- }
- }
- }
- return returnResult;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java
deleted file mode 100644
index d4542a43cb..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java
+++ /dev/null
@@ -1,30 +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.xml.core.internal.contenttype;
-
-
-public interface EncodingParserConstants {
-
- final String EOF = "EOF"; //$NON-NLS-1$
- final String InvalidTerminatedStringValue = "InvalidTerminatedStringValue"; //$NON-NLS-1$
- final String InvalidTermintatedUnDelimitedStringValue = "InvalidTermintatedUnDelimitedStringValue"; //$NON-NLS-1$
- final String MAX_CHARS_REACHED = "MAX_CHARS_REACHED"; //$NON-NLS-1$
- final String StringValue = "strval"; //$NON-NLS-1$
- final String UnDelimitedStringValue = "UnDelimitedStringValue"; //$NON-NLS-1$
- public final String UTF16BE = "UTF16BE"; //$NON-NLS-1$
- public final String UTF16LE = "UTF16LE"; //$NON-NLS-1$
-
-
- public final String UTF83ByteBOM = "UTF83ByteBOM"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index 0f14b8b570..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.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.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
deleted file mode 100644
index 52dbae6905..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.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 size;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
- for (int i = 0; i < size; i++) {
- s.append(list[i]);
- if(i < size - 1) {
- s.append(", ");
- }
- }
- s.append("]");
- return s.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index 23f7462181..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,37 +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.xml.core.internal.contenttype;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
deleted file mode 100644
index 4bc3552811..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (STAR) - bug 297006 - String Comparison
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-
-public class XMLDeclDetector {
- private static final int MAX_BUF_SIZE = 1024 * 8;
- private static final int MAX_MARK_SIZE = 1024 * 8;
- protected boolean fHeaderParsed;
- private boolean fIsXML;
- protected Reader fReader;
- //private boolean DEBUG = false;
- private XMLHeadTokenizer fTokenizer;
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (EncodingParserConstants.UTF83ByteBOM.equals(tokenType)) {
- canHandleAsUnicodeStream = true;
- //fUnicode = "UTF-8"; //$NON-NLS-1$
- } else if (EncodingParserConstants.UTF16BE.equals(tokenType)) {
- canHandleAsUnicodeStream = true;
- //fUnicode = "UTF-16BE"; //$NON-NLS-1$
- } else if (EncodingParserConstants.UTF16LE.equals(tokenType)) {
- canHandleAsUnicodeStream = true;
- //fUnicode = "UTF-16"; //$NON-NLS-1$
- }
- return canHandleAsUnicodeStream;
- }
-
- final private void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- //private String fUnicode;
-
- /**
- * @return Returns the tokenizer.
- */
- private XMLHeadTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new XMLHeadTokenizer();
- }
- return fTokenizer;
- }
-
- /**
- * @return Returns the isXML.
- */
- public boolean isXML() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- }
- return fIsXML;
- }
-
- private void parseInput() throws IOException {
- XMLHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (canHandleAsUnicodeStream(tokenType)) {
- fReader.reset();
- // this is (obviously) not always true.
- // TODO: need to fix so we "remember" original iFile or
- // inputstream, and
- // create appropriate InputStreamReader.
- // I'm not sure what to do for the set(reader) case ... if its
- // even relevent.
- // plus, ensure against infinite loops!
- fIsXML = true;
- //fReader = new InputStreamReader(fReader, fUnicode);
- // parseInput();
- } else {
- if (XMLHeadTokenizerConstants.XMLDelEncoding.equals(tokenType)) {
- fIsXML = true;
- }
- }
- } while (tokenizer.hasMoreTokens());
-
- }
-
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fIsXML = false;
- //fUnicode = null;
-
- }
-
- public void set(IFile iFile) throws CoreException {
- resetAll();
- InputStream inputStream = iFile.getContents(true);
- InputStream resettableStream = new BufferedInputStream(inputStream, MAX_BUF_SIZE);
- resettableStream.mark(MAX_MARK_SIZE);
- set(resettableStream);
- }
-
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossible, since we know ByteReader supports marking
- throw new Error(e);
- }
- }
-
- /**
- * 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(MAX_MARK_SIZE);
- } catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
deleted file mode 100644
index 76fb40b2fc..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
+++ /dev/null
@@ -1,1451 +0,0 @@
-/* The following code was generated by JFlex 1.4.2 on 7/28/08 9:29 AM */
-
-/*******************************************************************************
- * 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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.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.jflex.de/">JFlex</a> 1.4.2
- * on 7/28/08 9:29 AM from the specification file
- * <tt>D:/workspaces/wtp301/workspace/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex</tt>
- */
-public class XMLHeadTokenizer {
-
- /** 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 = 8192;
-
- /** lexical states */
- public static final int YYINITIAL = 0;
- public static final int UnDelimitedString = 10;
- public static final int DQ_STRING = 6;
- public static final int SQ_STRING = 8;
- public static final int ST_XMLDecl = 2;
- public static final int QuotedAttributeValue = 4;
-
- /**
- * 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, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6
- };
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\33"+
- "\2\0\1\35\1\0\1\34\24\0\1\13\1\12\1\32\1\14\3\0"+
- "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
- "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\0\1\15\12\0"+
- "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
- "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\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
- */
- 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 =
- "\7\0\13\1\2\2\1\1\1\2\1\3\1\4\1\5"+
- "\1\6\1\1\1\5\1\7\1\1\1\5\1\10\1\1"+
- "\1\11\1\12\1\13\12\0\1\14\5\0\1\2\1\3"+
- "\1\4\1\6\2\0\1\15\1\7\2\0\1\10\1\11"+
- "\1\16\3\0\1\14\4\0\1\2\1\15\14\0\1\17"+
- "\5\0\1\17\6\0\1\20\3\0\1\20\2\0\1\21"+
- "\1\0\1\21\1\0";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[111];
- 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;
- }
-
-
- /* 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"
- };
-
- /** 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;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean zzEOFDone;
-
- /* 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 XMLHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- zzReader = in;
-
- /* the current state of the DFA */
- zzState = 0;
-
- /* the current lexical state */
- zzLexicalState = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- 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 */
-// zzPushbackPos = 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
- */
- zzAtBOL = true;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- zzAtEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- zzEOFDone = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- }
-
-
- 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 XMLHeadTokenizer(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 XMLHeadTokenizer(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 < 150) {
- 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;
- yychar = 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;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void zzDoEOF() {
- if (!zzEOFDone) {
- zzEOFDone = 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 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;
-
-
- while (true) {
- zzMarkedPosL = zzMarkedPos;
-
- yychar+= zzMarkedPosL-zzStartRead;
-
- if (zzMarkedPosL > zzStartRead) {
- switch (zzBufferL[zzMarkedPosL-1]) {
- case '\n':
- case '\u000B':
- case '\u000C':
- case '\u0085':
- case '\u2028':
- case '\u2029':
- zzAtBOL = true;
- break;
- case '\r':
- if (zzMarkedPosL < zzEndReadL)
- zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
- else if (zzAtEOF)
- zzAtBOL = false;
- else {
- boolean eof = zzRefill();
- zzMarkedPosL = zzMarkedPos;
- zzEndReadL = zzEndRead;
- zzBufferL = zzBuffer;
- if (eof)
- zzAtBOL = false;
- else
- zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
- }
- break;
- default:
- zzAtBOL = false;
- }
- }
- zzAction = -1;
-
- zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-
- if (zzAtBOL)
- zzState = ZZ_LEXSTATE[zzLexicalState+1];
- else
- 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++];
- }
- }
- zzInput = zzCMapL[zzInput];
-
- boolean zzIsFinal = false;
- boolean zzNoLookAhead = false;
-
- zzForNext: { switch (zzState) {
- case 0:
- switch (zzInput) {
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
- }
-
- case 1:
- switch (zzInput) {
- case 1: zzIsFinal = true; zzState = 8; break zzForNext;
- case 2: zzIsFinal = true; zzState = 9; break zzForNext;
- case 3: zzIsFinal = true; zzState = 10; break zzForNext;
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 11; break zzForNext;
- case 9: zzIsFinal = true; zzState = 12; break zzForNext;
- case 11: zzIsFinal = true; zzState = 13; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
- }
-
- case 2:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzState = 14; break zzForNext;
- case 12: zzIsFinal = true; zzState = 15; break zzForNext;
- case 16: zzIsFinal = true; zzState = 16; break zzForNext;
- case 17: zzIsFinal = true; zzState = 17; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
- }
-
- case 3:
- switch (zzInput) {
- case 6:
- case 7: zzIsFinal = true; zzState = 19; break zzForNext;
- case 8: zzIsFinal = true; zzState = 20; break zzForNext;
- case 9: zzIsFinal = true; zzState = 21; break zzForNext;
- case 27: zzIsFinal = true; zzState = 22; break zzForNext;
- case 28: zzIsFinal = true; zzState = 23; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
- }
-
- case 4:
- switch (zzInput) {
- case 7:
- case 8:
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 9: zzIsFinal = true; zzState = 26; break zzForNext;
- case 12: zzIsFinal = true; zzState = 27; break zzForNext;
- case 27: zzIsFinal = true; zzState = 28; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
- }
-
- case 5:
- switch (zzInput) {
- case 7:
- case 8:
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 28: zzIsFinal = true; zzState = 28; break zzForNext;
- case 9: zzIsFinal = true; zzState = 29; break zzForNext;
- case 29: zzIsFinal = true; zzState = 30; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
- }
-
- case 6:
- switch (zzInput) {
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 12: zzIsFinal = true; zzState = 30; break zzForNext;
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 31; break zzForNext;
- case 9: zzIsFinal = true; zzState = 32; break zzForNext;
- case 27:
- case 28: zzIsFinal = true; zzState = 33; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
- }
-
- case 8:
- switch (zzInput) {
- case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
- default: break zzForAction;
- }
-
- case 9:
- switch (zzInput) {
- case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 35; break zzForNext;
- default: break zzForAction;
- }
-
- case 10:
- switch (zzInput) {
- case 4: zzState = 36; break zzForNext;
- default: break zzForAction;
- }
-
- case 11:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 37; break zzForNext;
- case 9: zzState = 38; break zzForNext;
- case 11: zzState = 39; break zzForNext;
- default: break zzForAction;
- }
-
- case 12:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 37; break zzForNext;
- case 11: zzState = 39; break zzForNext;
- default: break zzForAction;
- }
-
- case 13:
- switch (zzInput) {
- case 9: zzState = 40; break zzForNext;
- case 12: zzState = 41; break zzForNext;
- default: break zzForAction;
- }
-
- case 14:
- switch (zzInput) {
- case 12: zzState = 42; break zzForNext;
- case 16: zzState = 43; break zzForNext;
- case 17: zzState = 44; break zzForNext;
- default: break zzForAction;
- }
-
- case 15:
- switch (zzInput) {
- case 9: zzState = 45; break zzForNext;
- case 26: zzIsFinal = true; zzState = 46; break zzForNext;
- default: break zzForAction;
- }
-
- case 16:
- switch (zzInput) {
- case 9: zzState = 47; break zzForNext;
- case 17: zzState = 48; break zzForNext;
- default: break zzForAction;
- }
-
- case 17:
- switch (zzInput) {
- case 9: zzState = 49; break zzForNext;
- case 22: zzState = 50; break zzForNext;
- default: break zzForAction;
- }
-
- case 19:
- switch (zzInput) {
- case 6:
- case 7: zzIsFinal = true; break zzForNext;
- case 8: zzState = 51; break zzForNext;
- case 9: zzIsFinal = true; zzState = 52; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
- }
-
- case 20:
- switch (zzInput) {
- case 6:
- case 7: zzIsFinal = true; zzState = 19; break zzForNext;
- case 8: zzState = 51; break zzForNext;
- case 9: zzIsFinal = true; zzState = 52; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
- }
-
- case 21:
- switch (zzInput) {
- case 27: zzIsFinal = true; zzState = 22; break zzForNext;
- case 28: zzIsFinal = true; zzState = 23; break zzForNext;
- case 6:
- case 7:
- case 8: zzState = 51; break zzForNext;
- default: break zzForAction;
- }
-
- case 22:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 53; break zzForNext;
- default: break zzForAction;
- }
-
- case 23:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 54; break zzForNext;
- default: break zzForAction;
- }
-
- case 25:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 55; break zzForNext;
- default: break zzForAction;
- }
-
- case 26:
- switch (zzInput) {
- case 7:
- case 8:
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 27: zzIsFinal = true; zzState = 28; break zzForNext;
- case 12: zzState = 56; break zzForNext;
- default: break zzForAction;
- }
-
- case 27:
- switch (zzInput) {
- case 9: zzState = 57; break zzForNext;
- case 26: zzIsFinal = true; zzState = 58; break zzForNext;
- default: break zzForAction;
- }
-
- case 28:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 59; break zzForNext;
- default: break zzForAction;
- }
-
- case 29:
- switch (zzInput) {
- case 7:
- case 8:
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 28: zzIsFinal = true; zzState = 28; break zzForNext;
- case 29: zzState = 60; break zzForNext;
- default: break zzForAction;
- }
-
- case 30:
- switch (zzInput) {
- case 26: zzIsFinal = true; zzState = 25; break zzForNext;
- case 9: zzState = 61; break zzForNext;
- default: break zzForAction;
- }
-
- case 31:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 62; break zzForNext;
- default: break zzForAction;
- }
-
- case 32:
- switch (zzInput) {
- case 11: zzIsFinal = true; zzState = 25; break zzForNext;
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 31; break zzForNext;
- case 27:
- case 28: zzIsFinal = true; zzState = 33; break zzForNext;
- case 12: zzState = 60; break zzForNext;
- default: break zzForAction;
- }
-
- case 33:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 63; break zzForNext;
- default: break zzForAction;
- }
-
- case 36:
- switch (zzInput) {
- case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 64; break zzForNext;
- default: break zzForAction;
- }
-
- case 37:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: break zzForNext;
- case 9: zzState = 38; break zzForNext;
- case 11: zzState = 39; break zzForNext;
- default: break zzForAction;
- }
-
- case 38:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 37; break zzForNext;
- case 11: zzState = 39; break zzForNext;
- case 9: zzState = 65; break zzForNext;
- default: break zzForAction;
- }
-
- case 39:
- switch (zzInput) {
- case 9: zzState = 40; break zzForNext;
- case 12: zzState = 41; break zzForNext;
- default: break zzForAction;
- }
-
- case 40:
- switch (zzInput) {
- case 12: zzState = 41; break zzForNext;
- default: break zzForAction;
- }
-
- case 41:
- switch (zzInput) {
- case 9: zzState = 66; break zzForNext;
- case 13: zzState = 67; break zzForNext;
- default: break zzForAction;
- }
-
- case 42:
- switch (zzInput) {
- case 9: zzState = 45; break zzForNext;
- case 26: zzIsFinal = true; zzState = 46; break zzForNext;
- default: break zzForAction;
- }
-
- case 43:
- switch (zzInput) {
- case 9: zzState = 47; break zzForNext;
- case 17: zzState = 48; break zzForNext;
- default: break zzForAction;
- }
-
- case 44:
- switch (zzInput) {
- case 9: zzState = 49; break zzForNext;
- case 22: zzState = 50; break zzForNext;
- default: break zzForAction;
- }
-
- case 45:
- switch (zzInput) {
- case 26: zzIsFinal = true; zzState = 46; break zzForNext;
- default: break zzForAction;
- }
-
- case 46:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 68; break zzForNext;
- default: break zzForAction;
- }
-
- case 47:
- switch (zzInput) {
- case 17: zzState = 48; break zzForNext;
- default: break zzForAction;
- }
-
- case 48:
- switch (zzInput) {
- case 9: zzState = 69; break zzForNext;
- case 18: zzState = 70; break zzForNext;
- default: break zzForAction;
- }
-
- case 49:
- switch (zzInput) {
- case 22: zzState = 50; break zzForNext;
- default: break zzForAction;
- }
-
- case 50:
- switch (zzInput) {
- case 9: zzState = 71; break zzForNext;
- case 23: zzState = 72; break zzForNext;
- default: break zzForAction;
- }
-
- case 51:
- switch (zzInput) {
- case 6:
- case 7: zzIsFinal = true; zzState = 19; break zzForNext;
- case 8: break zzForNext;
- case 9: zzIsFinal = true; zzState = 52; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
- }
-
- case 52:
- switch (zzInput) {
- case 6:
- case 7: zzIsFinal = true; zzState = 19; break zzForNext;
- case 8: zzState = 51; break zzForNext;
- case 9: zzIsFinal = true; zzState = 73; break zzForNext;
- default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
- }
-
- case 56:
- switch (zzInput) {
- case 9: zzState = 57; break zzForNext;
- case 26: zzIsFinal = true; zzState = 58; break zzForNext;
- default: break zzForAction;
- }
-
- case 57:
- switch (zzInput) {
- case 26: zzIsFinal = true; zzState = 58; break zzForNext;
- default: break zzForAction;
- }
-
- case 58:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 74; break zzForNext;
- default: break zzForAction;
- }
-
- case 60:
- switch (zzInput) {
- case 26: zzIsFinal = true; zzState = 25; break zzForNext;
- case 9: zzState = 61; break zzForNext;
- default: break zzForAction;
- }
-
- case 61:
- switch (zzInput) {
- case 26: zzIsFinal = true; zzState = 25; break zzForNext;
- default: break zzForAction;
- }
-
- case 65:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 37; break zzForNext;
- case 11: zzState = 39; break zzForNext;
- default: break zzForAction;
- }
-
- case 66:
- switch (zzInput) {
- case 13: zzState = 67; break zzForNext;
- default: break zzForAction;
- }
-
- case 67:
- switch (zzInput) {
- case 9: zzState = 75; break zzForNext;
- case 14: zzState = 76; break zzForNext;
- default: break zzForAction;
- }
-
- case 69:
- switch (zzInput) {
- case 18: zzState = 70; break zzForNext;
- default: break zzForAction;
- }
-
- case 70:
- switch (zzInput) {
- case 9: zzState = 77; break zzForNext;
- case 19: zzState = 78; break zzForNext;
- default: break zzForAction;
- }
-
- case 71:
- switch (zzInput) {
- case 23: zzState = 72; break zzForNext;
- default: break zzForAction;
- }
-
- case 72:
- switch (zzInput) {
- case 9: zzState = 79; break zzForNext;
- case 21: zzState = 80; break zzForNext;
- default: break zzForAction;
- }
-
- case 73:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 51; break zzForNext;
- default: break zzForAction;
- }
-
- case 75:
- switch (zzInput) {
- case 14: zzState = 76; break zzForNext;
- default: break zzForAction;
- }
-
- case 76:
- switch (zzInput) {
- case 9: zzState = 81; break zzForNext;
- case 15: zzState = 82; break zzForNext;
- default: break zzForAction;
- }
-
- case 77:
- switch (zzInput) {
- case 19: zzState = 78; break zzForNext;
- default: break zzForAction;
- }
-
- case 78:
- switch (zzInput) {
- case 9: zzState = 83; break zzForNext;
- case 20: zzState = 84; break zzForNext;
- default: break zzForAction;
- }
-
- case 79:
- switch (zzInput) {
- case 21: zzState = 80; break zzForNext;
- default: break zzForAction;
- }
-
- case 80:
- switch (zzInput) {
- case 9: zzState = 85; break zzForNext;
- case 24: zzState = 86; break zzForNext;
- default: break zzForAction;
- }
-
- case 81:
- switch (zzInput) {
- case 15: zzState = 82; break zzForNext;
- default: break zzForAction;
- }
-
- case 82:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 87; break zzForNext;
- case 9: zzState = 88; break zzForNext;
- default: break zzForAction;
- }
-
- case 83:
- switch (zzInput) {
- case 20: zzState = 84; break zzForNext;
- default: break zzForAction;
- }
-
- case 84:
- switch (zzInput) {
- case 9: zzState = 89; break zzForNext;
- case 21: zzState = 90; break zzForNext;
- default: break zzForAction;
- }
-
- case 85:
- switch (zzInput) {
- case 24: zzState = 86; break zzForNext;
- default: break zzForAction;
- }
-
- case 86:
- switch (zzInput) {
- case 9: zzState = 91; break zzForNext;
- case 20: zzState = 92; break zzForNext;
- default: break zzForAction;
- }
-
- case 87:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; break zzForNext;
- case 9: zzIsFinal = true; zzState = 93; break zzForNext;
- default: break zzForAction;
- }
-
- case 88:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 87; break zzForNext;
- case 9: zzState = 94; break zzForNext;
- default: break zzForAction;
- }
-
- case 89:
- switch (zzInput) {
- case 21: zzState = 90; break zzForNext;
- default: break zzForAction;
- }
-
- case 90:
- switch (zzInput) {
- case 9: zzState = 95; break zzForNext;
- case 22: zzState = 96; break zzForNext;
- default: break zzForAction;
- }
-
- case 91:
- switch (zzInput) {
- case 20: zzState = 92; break zzForNext;
- default: break zzForAction;
- }
-
- case 92:
- switch (zzInput) {
- case 9: zzState = 97; break zzForNext;
- case 22: zzState = 98; break zzForNext;
- default: break zzForAction;
- }
-
- case 93:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 87; break zzForNext;
- case 9: zzState = 94; break zzForNext;
- default: break zzForAction;
- }
-
- case 94:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 87; break zzForNext;
- default: break zzForAction;
- }
-
- case 95:
- switch (zzInput) {
- case 22: zzState = 96; break zzForNext;
- default: break zzForAction;
- }
-
- case 96:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: break zzForNext;
- case 9: zzState = 99; break zzForNext;
- case 10: zzIsFinal = true; zzState = 100; break zzForNext;
- default: break zzForAction;
- }
-
- case 97:
- switch (zzInput) {
- case 22: zzState = 98; break zzForNext;
- default: break zzForAction;
- }
-
- case 98:
- switch (zzInput) {
- case 9: zzState = 101; break zzForNext;
- case 25: zzState = 102; break zzForNext;
- default: break zzForAction;
- }
-
- case 99:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 96; break zzForNext;
- case 10: zzIsFinal = true; zzState = 100; break zzForNext;
- case 9: zzState = 103; break zzForNext;
- default: break zzForAction;
- }
-
- case 100:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 104; break zzForNext;
- case 9: zzState = 105; break zzForNext;
- default: break zzForAction;
- }
-
- case 101:
- switch (zzInput) {
- case 25: zzState = 102; break zzForNext;
- default: break zzForAction;
- }
-
- case 102:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: break zzForNext;
- case 9: zzState = 106; break zzForNext;
- case 10: zzIsFinal = true; zzState = 107; break zzForNext;
- default: break zzForAction;
- }
-
- case 103:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 96; break zzForNext;
- default: break zzForAction;
- }
-
- case 104:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzState = 100; break zzForNext;
- case 6:
- case 7:
- case 8: zzIsFinal = true; break zzForNext;
- default: break zzForAction;
- }
-
- case 105:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 104; break zzForNext;
- default: break zzForAction;
- }
-
- case 106:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 102; break zzForNext;
- case 10: zzIsFinal = true; zzState = 107; break zzForNext;
- case 9: zzState = 108; break zzForNext;
- default: break zzForAction;
- }
-
- case 107:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 109; break zzForNext;
- case 9: zzState = 110; break zzForNext;
- default: break zzForAction;
- }
-
- case 108:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzState = 102; break zzForNext;
- default: break zzForAction;
- }
-
- case 109:
- switch (zzInput) {
- case 9: zzIsFinal = true; zzState = 107; break zzForNext;
- case 6:
- case 7:
- case 8: zzIsFinal = true; break zzForNext;
- default: break zzForAction;
- }
-
- case 110:
- switch (zzInput) {
- case 6:
- case 7:
- case 8: zzIsFinal = true; zzState = 109; break zzForNext;
- default: break zzForAction;
- }
-
- default:
- // if this is ever reached, there is a serious bug in JFlex
- zzScanError(ZZ_UNKNOWN_ERROR);
- break;
- } }
-
- if ( zzIsFinal ) {
- zzAction = zzState;
- zzMarkedPosL = zzCurrentPosL;
- if ( zzNoLookAhead ) break zzForAction;
- }
-
- }
- }
-
- // store back cached position
- zzMarkedPos = zzMarkedPosL;
-
- switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
- case 12:
- { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;
- }
- case 18: break;
- case 14:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
- }
- case 19: break;
- case 9:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
- }
- case 20: break;
- case 2:
- { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
- }
- case 21: break;
- case 7:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
- }
- case 22: break;
- case 10:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
- }
- case 23: break;
- case 1:
- { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
- }
- case 24: break;
- case 6:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 25: break;
- case 5:
- { string.append( yytext() );
- }
- case 26: break;
- case 13:
- { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 27: break;
- case 4:
- { yybegin(SQ_STRING); string.setLength(0);
- }
- case 28: break;
- case 3:
- { yybegin(DQ_STRING); string.setLength(0);
- }
- case 29: break;
- case 8:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
- }
- case 30: break;
- case 17:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
- }
- case 31: break;
- case 15:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
- }
- case 32: break;
- case 11:
- { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
- }
- case 33: break;
- case 16:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
- }
- case 34: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- zzDoEOF();
- {
- hasMore = false; return EncodingParserConstants.EOF;
- }
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java
deleted file mode 100644
index ccf23f8aa9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java
+++ /dev/null
@@ -1,21 +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.xml.core.internal.contenttype;
-
-public interface XMLHeadTokenizerConstants extends EncodingParserConstants {
-
- final String XMLDeclEnd = "XMLDeclEnd"; //$NON-NLS-1$
- final String XMLDeclStart = "XMLDeclStart"; //$NON-NLS-1$
- final String XMLDelEncoding = "XMLDelEncoding"; //$NON-NLS-1$
- final String XMLDeclVersion = "XMLDeclVersion"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
deleted file mode 100644
index 1f1079b37d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (STAR) - bug 297006 - String Comparison
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.contenttype;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public class XMLResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
- private XMLHeadTokenizer fTokenizer;
- private boolean fDeclDetected = false;
- private boolean fInitialWhiteSpace = false;
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (EncodingParserConstants.UTF83ByteBOM.equals(tokenType)) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (EncodingParserConstants.UTF16BE.equals(tokenType) || EncodingParserConstants.UTF16LE.equals(tokenType)) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16"; //$NON-NLS-1$
- byte[] bom = (EncodingParserConstants.UTF16BE.equals(tokenType)) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUnicodeStream(true);
- fEncodingMemento.setUnicodeBOM(bom);
- }
- return canHandleAsUnicodeStream;
- }
-
- public String getSpecDefaultEncoding() {
- // by default, UTF-8 as per XML spec
- final String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- /**
- * @return Returns the tokenizer.
- */
- private XMLHeadTokenizer getTokenizer() {
- // TODO: need to work on 'reset' in tokenizer, so new instance isn't
- // always needed
- // if (fTokenizer == null) {
- fTokenizer = new XMLHeadTokenizer();
- // }
- return fTokenizer;
- }
-
- private boolean isLegalString(String valueTokenType) {
- if (valueTokenType == null)
- return false;
- else
- return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
-
- protected void parseInput() throws IOException {
- XMLHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
-
- // handle xml content type detection
- if (tokenType == XMLHeadTokenizerConstants.XMLDeclStart) {
- fDeclDetected = true;
- String declText = token.getText();
- if (declText.startsWith("<?")) { //$NON-NLS-1$
- fInitialWhiteSpace = false;
- }
- else {
- fInitialWhiteSpace = true;
- }
- }
-
- // handle encoding detection
- if (canHandleAsUnicodeStream(tokenType)) {
- // side effect of canHandle is to create appropriate memento
- }
- else {
- if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (isLegalString(tokenType)) {
- String enc = token.getText();
- if (enc != null && enc.length() > 0) {
- createEncodingMemento(enc, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- }
- }
- }
- }
- }
- }
- while (tokenizer.hasMoreTokens());
-
- }
-
- public boolean isDeclDetected() {
- if (!fHeaderParsed) {
- try {
- parseInput();
- }
- catch (IOException e) {
- fDeclDetected = false;
- }
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- }
- // fDeclDetected is set as part of parsing.
- return fDeclDetected;
- }
-
- public boolean hasInitialWhiteSpace() {
- return fInitialWhiteSpace;
- }
-
- protected void resetAll() {
- super.resetAll();
- fDeclDetected = false;
- fInitialWhiteSpace = false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
deleted file mode 100644
index 7c0af3399b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.List;
-
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-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.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLNamespace;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * AttrImpl class
- */
-public class AttrImpl extends NodeImpl implements IDOMAttr {
-
- private ITextRegion equalRegion = null;
-
- private char[] fName = null;
- private ITextRegion nameRegion = null;
- private ElementImpl ownerElement = null;
- private ITextRegion fValueRegion = null;
- private char[] fValueSource = null;
- private char[] fNamespaceURI = null;
-
- /**
- * AttrImpl constructor
- */
- protected AttrImpl() {
- super();
- }
-
- /**
- * AttrImpl constructor
- *
- * @param that
- * AttrImpl
- */
- protected AttrImpl(AttrImpl that) {
- super(that);
-
- if (that != null) {
- this.fName = that.fName;
- String valueSource = that.getValueSource();
- if (valueSource != null)
- this.fValueSource = valueSource.toCharArray();
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- */
- public Node cloneNode(boolean deep) {
- AttrImpl cloned = new AttrImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- */
- protected CMAttributeDeclaration getDeclaration() {
- ElementImpl element = (ElementImpl) getOwnerElement();
- if (element == null)
- return null;
- CMElementDeclaration elementDecl = element.getDeclaration();
- if (elementDecl == null)
- return null;
-
- List nodes = ModelQueryUtil.getModelQuery(getOwnerDocument()).getAvailableContent(getOwnerElement(), elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- String name = getName();
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && name.equals(cmnode.getNodeName())) {
- return (CMAttributeDeclaration) cmnode;
- }
- }
- return null;
- }
-
- /**
- * getEndOffset method
- *
- * @return int
- */
- public int getEndOffset() {
- if (this.ownerElement == null)
- return 0;
- int offset = this.ownerElement.getStartOffset();
- if (this.fValueRegion != null) {
- return (offset + this.fValueRegion.getEnd());
- }
- if (this.equalRegion != null) {
- return (offset + this.equalRegion.getEnd());
- }
- if (this.nameRegion != null) {
- return (offset + this.nameRegion.getEnd());
- }
- return 0;
- }
-
-
- public ITextRegion getEqualRegion() {
- return this.equalRegion;
- }
-
- public String getLocalName() {
- if (this.fName == null)
- return null;
- int index = CharOperation.indexOf(this.fName, ':');
- if (index < 0)
- return new String(this.fName);
- return new String(this.fName, index + 1, this.fName.length - index - 1);
- }
-
- /**
- * getName method
- *
- * @return java.lang.String
- */
- public String getName() {
- if (this.fName == null)
- return NodeImpl.EMPTY_STRING;
- return new String(this.fName);
- }
-
-
- public ITextRegion getNameRegion() {
- return this.nameRegion;
- }
-
- public int getNameRegionEndOffset() {
- if (this.ownerElement == null)
- return 0;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // attributes
- IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return 0;
- return flatNode.getEndOffset(this.nameRegion);
- }
-
- public int getNameRegionStartOffset() {
- if (this.ownerElement == null)
- return 0;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // attributes
- IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return 0;
- return flatNode.getStartOffset(this.nameRegion);
- }
-
- public String getNameRegionText() {
- if (this.ownerElement == null)
- return null;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // attributes
- IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- return flatNode.getText(this.nameRegion);
- }
-
- public int getNameRegionTextEndOffset() {
- if (this.ownerElement == null)
- return 0;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // attributes
- IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return 0;
- return flatNode.getTextEndOffset(this.nameRegion);
- }
-
- public String getNamespaceURI() {
- String nsAttrName = null;
- String prefix = getPrefix();
- if (prefix != null && prefix.length() > 0) {
- if (prefix.equals(IXMLNamespace.XMLNS)) {
- // fixed URI
- return IXMLNamespace.XMLNS_URI;
- }
- else if (prefix.equals(IXMLNamespace.XML)) {
- // fixed URI
- return IXMLNamespace.XML_URI;
- }
-
- nsAttrName = IXMLNamespace.XMLNS_PREFIX + prefix;
- }
- else {
- String name = getName();
- if (name != null && name.equals(IXMLNamespace.XMLNS)) {
- // fixed URI
- return IXMLNamespace.XMLNS_URI;
- }
- // does not inherit namespace from owner element
- // if (this.ownerElement != null) return
- // this.ownerElement.getNamespaceURI();
- if (this.fNamespaceURI == null)
- return null;
- return new String(this.fNamespaceURI);
- }
-
- for (Node node = this.ownerElement; node != null; node = node.getParentNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- break;
- Element element = (Element) node;
- Attr attr = element.getAttributeNode(nsAttrName);
- if (attr != null)
- return attr.getValue();
- }
-
- if (this.fNamespaceURI == null)
- return null;
- return new String(this.fNamespaceURI);
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return getName();
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return ATTRIBUTE_NODE;
- }
-
- /**
- * getNodeValue method
- *
- * @return java.lang.String
- */
- public String getNodeValue() {
- return getValue();
- }
-
- /**
- * getOwnerElement method
- *
- * @return org.w3c.dom.Element
- */
- public Element getOwnerElement() {
- return this.ownerElement;
- }
-
- /**
- */
- public String getPrefix() {
- if (this.fName == null)
- return null;
- int index = CharOperation.indexOf(this.fName, ':');
- if (index <= 0)
- return null;
- // exclude JSP tag in name
- if (this.fName[0] == '<')
- return null;
- return new String(this.fName, 0, index);
- }
-
- /**
- * getSpecified method
- *
- * @return boolean
- */
- public boolean getSpecified() {
- // if there is no underlying document region,
- // then this attributes value has not really be specified
- // yet in the document, and any returned values, such as
- // an empty string or a default value are being supplied
- // as per spec, not per what's in the users document.
- return this.fValueRegion != null;
- }
-
- /**
- * getStartOffset method
- *
- * @return int
- */
- public int getStartOffset() {
- if (this.ownerElement == null)
- return 0;
- int offset = this.ownerElement.getStartOffset();
- if (this.nameRegion != null) {
- return (offset + this.nameRegion.getStart());
- }
- if (this.equalRegion != null) {
- return (offset + this.equalRegion.getStart());
- }
- if (this.fValueRegion != null) {
- return (offset + this.fValueRegion.getStart());
- }
- return 0;
- }
-
- /**
- * getValue method
- *
- * @return java.lang.String
- */
- public String getValue() {
- return getValue(getValueSource());
- }
-
- /**
- * Returns value for the source
- */
- private String getValue(String source) {
- if (source == null)
- return NodeImpl.EMPTY_STRING;
- if (source.length() == 0)
- return source;
- StringBuffer buffer = null;
- int offset = 0;
- int length = source.length();
- int ref = source.indexOf('&');
- while (ref >= 0) {
- int end = source.indexOf(';', ref + 1);
- if (end > ref + 1) {
- String name = source.substring(ref + 1, end);
- String value = getCharValue(name);
- if (value != null) {
- if (buffer == null)
- buffer = new StringBuffer(length);
- if (ref > offset)
- buffer.append(source.substring(offset, ref));
- buffer.append(value);
- offset = end + 1;
- ref = end;
- }
- }
- ref = source.indexOf('&', ref + 1);
- }
- if (buffer == null)
- return source;
- if (length > offset)
- buffer.append(source.substring(offset));
- return buffer.toString();
- }
-
- public ITextRegion getValueRegion() {
- return this.fValueRegion;
- }
-
- /**
- * ISSUE: what should behavior be if this.value == null? It's an "error"
- * to be in that state, but seems to occur relatively easily ... probably
- * due to threading bugs ... but this just shows its needs to be spec'd.
- *
- */
- public int getValueRegionStartOffset() {
- if (this.ownerElement == null)
- return 0;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // the valueRegion -- should make smarter?
- IStructuredDocumentRegion structuredDocumentRegion = this.ownerElement.getFirstStructuredDocumentRegion();
- if (structuredDocumentRegion == null)
- return 0;
- // ensure we never pass null to getStartOffset.
- if (this.fValueRegion == null) {
- return 0;
- }
- return structuredDocumentRegion.getStartOffset(this.fValueRegion);
- }
-
- public String getValueRegionText() {
- if (this.ownerElement == null)
- return null;
- // assuming the firstStructuredDocumentRegion is the one that contains
- // attributes
- IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- if (this.fValueRegion == null)
- return null;
- return flatNode.getText(this.fValueRegion);
- }
-
- /**
- */
- public String getValueSource() {
- if (this.fValueSource != null)
- return new String(this.fValueSource);
- // DW: 4/16/2003 due to change in structuredDocument ... we need a
- // flatnode to
- // get at region values. For now I'll assume this is always the first
- // flatnode .. may need to make smarter later (e.g. to search for
- // the flatnode that this.valueRegion belongs to.
- // DW: 4/30/2003 For some reason, this method is getting called a lot
- // Not sure if its a threading problem, or a fundamental error
- // elsewhere.
- // It needs more investigation, but in the use cases I've seen,
- // doesn't
- // seem to hurt to simply return null in those cases. I saw this null
- // case,
- // when trying go format an XML file.
- if (this.ownerElement == null)
- return null;
- //attribute values will always be in the start region
- IStructuredDocumentRegion ownerRegion = this.ownerElement.getStartStructuredDocumentRegion();
- if (ownerRegion == null)
- return null;
- if (this.fValueRegion != null)
- return StructuredDocumentRegionUtil.getAttrValue(ownerRegion, this.fValueRegion);
- return NodeImpl.EMPTY_STRING;
- }
-
- private String getValueSource(ElementImpl ownerElement) {
- if (this.fValueSource != null)
- return new String(this.fValueSource);
- // DW: 4/16/2003 due to change in structuredDocument ... we need a
- // flatnode to
- // get at region values. For now I'll assume this is always the first
- // flatnode .. may need to make smarter later (e.g. to search for
- // the flatnode that this.valueRegion belongs to.
- if (this.fValueRegion != null)
- return StructuredDocumentRegionUtil.getAttrValue(ownerElement.getStructuredDocumentRegion(), this.fValueRegion);
- return NodeImpl.EMPTY_STRING;
- }
-
- /**
- */
- private String getValueSource(String value) {
- if (value == null)
- return null;
- if (value.length() == 0)
- return value;
- StringBuffer buffer = null;
- int offset = 0;
- int length = value.length();
- int amp = value.indexOf('&');
- while (amp >= 0) {
- if (buffer == null)
- buffer = new StringBuffer(length + 4);
- if (amp > offset)
- buffer.append(value.substring(offset, amp));
- buffer.append(IXMLCharEntity.AMP_REF);
- offset = amp + 1;
- amp = value.indexOf('&', offset);
- }
- if (buffer == null)
- return value;
- if (length > offset)
- buffer.append(value.substring(offset));
- return buffer.toString();
- }
-
- /**
- * Check if Attr has JSP in value
- */
- public boolean hasNestedValue() {
- if (this.fValueRegion == null)
- return false;
- if (!(this.fValueRegion instanceof ITextRegionContainer))
- return false;
- ITextRegionList regions = ((ITextRegionContainer) this.fValueRegion).getRegions();
- if (regions == null)
- return false;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_OPEN || isNestedLanguageOpening(regionType))
- return true;
- }
- return false;
- }
-
- /**
- * Check if Attr has only name but not equal sign nor value
- */
- public boolean hasNameOnly() {
- return (this.nameRegion != null && this.equalRegion == null && this.fValueRegion == null);
- }
-
- /**
- */
- protected final boolean hasPrefix() {
- if (this.fName == null || this.fName.length == 0)
- return false;
- return CharOperation.indexOf(this.fName, ':') > 0 && this.fName[0] != '<';
- }
-
- /**
- */
- protected final boolean ignoreCase() {
- if (this.ownerElement != null) {
- if (this.ownerElement.ignoreCase()) {
- return !hasPrefix();
- }
- }
- else {
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document != null && document.ignoreCase()) {
- // even in case insensitive document, if having prefix, it's
- // case sensitive
- return !hasPrefix();
- }
- }
- return false;
- }
-
- /**
- */
- public boolean isGlobalAttr() {
- if (hasPrefix())
- return false;
- if (this.ownerElement == null)
- return false;
- return this.ownerElement.isGlobalTag();
- }
-
- /**
- */
- public final boolean isXMLAttr() {
- if (this.ownerElement != null) {
- if (!this.ownerElement.isXMLTag()) {
- return hasPrefix();
- }
- }
- else {
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document != null && !document.isXMLType()) {
- // even in non-XML document, if having prefix, it's XML tag
- return hasPrefix();
- }
- }
- return true;
- }
-
- /**
- * matchName method
- *
- * @return boolean
- * @param name
- * java.lang.String
- */
- protected boolean matchName(String name) {
- if (name == null)
- return (this.fName == null);
- if (this.fName == null)
- return false;
- return CharOperation.equals(this.fName, name.toCharArray(), ignoreCase());
- }
-
- protected boolean matchName(char[] name) {
- if (name == null)
- return (this.fName == null);
- if (this.fName == null)
- return false;
- return CharOperation.equals(this.fName, name, ignoreCase());
- }
-
-
- /**
- * notifyValueChanged method
- */
- protected void notifyNameChanged() {
- if (this.ownerElement == null)
- return;
- DocumentImpl document = (DocumentImpl) this.ownerElement.getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.nameChanged(this);
- }
-
- /**
- * notifyValueChanged method
- */
- protected void notifyValueChanged() {
- if (this.ownerElement == null)
- return;
- DocumentImpl document = (DocumentImpl) this.ownerElement.getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.valueChanged(this);
- }
-
- /**
- * removeRegions method
- */
- void removeRegions() {
- this.nameRegion = null;
- this.fValueRegion = null;
- this.equalRegion = null;
- }
-
- /**
- */
- void resetRegions() {
- this.fValueSource = getValueSource().toCharArray();
- removeRegions();
- }
-
- /**
- */
- void resetRegions(ElementImpl ownerElement) {
- this.fValueSource = getValueSource(ownerElement).toCharArray();
- removeRegions();
- }
-
- void setEqualRegion(ITextRegion equalRegion) {
- this.equalRegion = equalRegion;
- }
-
- /**
- * setName method
- *
- * @param name
- * java.lang.String
- */
- protected void setName(String name) {
- String value = null;
- int startOffset = 0;
- if (this.ownerElement != null) {
- value = getValue();
- startOffset = this.ownerElement.getStartOffset();
- this.ownerElement.notify(REMOVE, this, value, null, startOffset);
- }
- this.fName = CharacterStringPool.getCharString(name);
- if (this.ownerElement != null) {
- this.ownerElement.notify(ADD, this, null, value, startOffset);
- }
- }
-
- void setNameRegion(ITextRegion nameRegion) {
- this.nameRegion = nameRegion;
- }
-
- protected void setNamespaceURI(String namespaceURI) {
- if (namespaceURI == null)
- this.fNamespaceURI = null;
- else
- this.fNamespaceURI = namespaceURI.toCharArray();
- }
-
- /**
- * setNodeValue method
- *
- * @param nodeValue
- * java.lang.String
- */
- public void setNodeValue(String nodeValue) throws DOMException {
- setValue(nodeValue);
- }
-
- /**
- * setOwnerElement method
- *
- * @param ownerElement
- * org.w3c.dom.Element
- */
- protected void setOwnerElement(Element ownerElement) {
- this.ownerElement = (ElementImpl) ownerElement;
- }
-
- /**
- */
- public void setPrefix(String prefix) throws DOMException {
- if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- int prefixLength = (prefix != null ? prefix.length() : 0);
- String localName = getLocalName();
- if (prefixLength == 0) {
- setName(localName);
- return;
- }
- if (localName == null)
- localName = NodeImpl.EMPTY_STRING;
- int localLength = localName.length();
- StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength);
- buffer.append(prefix);
- buffer.append(':');
- buffer.append(localName);
- setName(buffer.toString());
-
- notifyNameChanged();
- }
-
- /**
- * setValue method
- *
- * @param value
- * java.lang.String
- */
- public void setValue(String value) {
- // Remember: as we account for "floaters" in
- // future, remember that some are created
- // in the natural process of implementing
- // DOM apis.
- // this "self notification" of about/changed,
- // is added for this case, because it known to
- // be called from properties pages. Should be a
- // added to all DOM Modifiying APIs eventually.
- try {
- getModel().aboutToChangeModel();
- setValueSource(getValueSource(value));
- }
- finally {
- getModel().changedModel();
- }
- }
-
- void setValueRegion(ITextRegion valueRegion) {
- this.fValueRegion = valueRegion;
- if (valueRegion != null)
- this.fValueSource = null;
- }
-
- public void setValueSource(String source) {
- if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- this.fValueSource = (source != null) ? source.toCharArray() : null;
-
- notifyValueChanged();
- }
-
- /**
- * Subclasses must override
- *
- * @param regionType
- * @return
- */
- protected boolean isNestedLanguageOpening(String regionType) {
- boolean result = false;
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
deleted file mode 100644
index 1a3ad5748d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * CDATASectionImpl class
- */
-public class CDATASectionImpl extends TextImpl implements CDATASection {
-
- /**
- * CDATASectionImpl constructor
- */
- protected CDATASectionImpl() {
- super();
- }
-
- /**
- * CDATASectionImpl constructor
- *
- * @param that
- * CDATASectionImpl
- */
- protected CDATASectionImpl(CDATASectionImpl that) {
- super(that);
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- CDATASectionImpl cloned = new CDATASectionImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public String getData() throws DOMException {
- // instead of super(TextImpl).getData(), call getCharacterData()
- char[] data = getCharacterData();
- if (data == null) {
- String sdata = getData(getStructuredDocumentRegion());
- if (sdata != null)
- return sdata;
- return NodeImpl.EMPTY_STRING;
- }
- return new String(data);
- }
-
- /**
- */
- private String getData(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return null;
-
- ITextRegion contentRegion = null;
- StringBuffer buffer = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_CDATA_OPEN || regionType == DOMRegionContext.XML_CDATA_CLOSE) {
- continue;
- }
- if (contentRegion == null) { // first content
- contentRegion = region;
- } else { // multiple contents
- if (buffer == null) {
- buffer = new StringBuffer(flatNode.getText(contentRegion));
- }
- buffer.append(flatNode.getText(region));
- }
- }
-
- if (buffer != null)
- return buffer.toString();
- if (contentRegion != null)
- return flatNode.getText(contentRegion);
- return null;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#cdata-section";//$NON-NLS-1$
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return CDATA_SECTION_NODE;
- }
-
- /**
- */
- public boolean isClosed() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- return (regionType == DOMRegionContext.XML_CDATA_CLOSE);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java
deleted file mode 100644
index ae533abf5e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CMNodeUtil.java
+++ /dev/null
@@ -1,42 +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.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-
-/**
- */
-public class CMNodeUtil {
-
- /**
- */
- public static CMAttributeDeclaration getAttributeDeclaration(Attr attr) {
- if (attr == null)
- return null;
- return ((AttrImpl) attr).getDeclaration();
- }
-
- /**
- */
- public static CMElementDeclaration getElementDeclaration(Element element) {
- if (element == null)
- return null;
- return ((ElementImpl) element).getDeclaration();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java
deleted file mode 100644
index a446bde52a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java
+++ /dev/null
@@ -1,91 +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.wst.xml.core.internal.document;
-
-class CharOperation {
-
- private CharOperation() {
- }
-
- static int indexOf(char[] array, char c) {
- return indexOf(array, c, 0);
- }
-
- static int indexOf(char[] array, char c, int start) {
- for (int i = start; i < array.length; i++) {
- if (array[i] == c)
- return i;
- }
- return -1;
- }
-
-
- /**
- * note: This method taken from org.eclipse.jdt.core.compiler.CharOperation
- *
- * Answers true if the two arrays are identical character by character, otherwise false.
- * The equality is case sensitive.
- * <br>
- * <br>
- * For example:
- * <ol>
- * <li><pre>
- * first = null
- * second = null
- * result => true
- * </pre>
- * </li>
- * <li><pre>
- * first = { }
- * second = null
- * result => false
- * </pre>
- * </li>
- * <li><pre>
- * first = { 'a' }
- * second = { 'a' }
- * result => true
- * </pre>
- * </li>
- * <li><pre>
- * first = { 'a' }
- * second = { 'A' }
- * result => false
- * </pre>
- * </li>
- * </ol>
- * @param first the first array
- * @param second the second array
- * @return true if the two arrays are identical character by character, otherwise false
- */
- public static final boolean equals(char[] first, char[] second, boolean ignoreCase) {
- if (first == second)
- return true;
- if (first == null || second == null)
- return false;
- if (first.length != second.length)
- return false;
-
- for (int i = first.length; --i >= 0;) {
- if (ignoreCase) {
- if (Character.toUpperCase(first[i]) != Character.toUpperCase(second[i])) {
- return false;
- }
- }
- else {
- if (first[i] != second[i]) {
- return false;
- }
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
deleted file mode 100644
index 1eb28920bb..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-
-/**
- * CharacterDataImpl class
- */
-public abstract class CharacterDataImpl extends NodeImpl implements CharacterData {
-
- private char[] data = null;
-
- /**
- * CharacterDataImpl constructor
- */
- protected CharacterDataImpl() {
- super();
- }
-
- /**
- * CharacterDataImpl constructor
- *
- * @param that
- * CharacterDataImpl
- */
- protected CharacterDataImpl(CharacterDataImpl that) {
- super(that);
-
- if (that != null) {
- this.data = that.getData().toCharArray();
- }
- }
-
- /**
- * appendData method
- *
- * @param arg
- * java.lang.String
- */
- public void appendData(String arg) throws DOMException {
- if (arg == null)
- return;
-
- String data = getData();
- if (data == null)
- data = arg;
- else
- data += arg;
- setData(data);
- }
-
- /**
- * deleteData method
- *
- * @param offset
- * int
- * @param count
- * int
- */
- public void deleteData(int offset, int count) throws DOMException {
- if (count == 0)
- return;
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (count < 0 || offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String data = getData();
- if (data == null) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int length = data.length();
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (offset == 0) {
- if (count > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (count == length)
- data = NodeImpl.EMPTY_STRING;
- else
- data = data.substring(count);
- } else {
- int end = offset + count;
- if (end > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (end == length)
- data = data.substring(0, offset);
- else
- data = data.substring(0, offset) + data.substring(end);
- }
- setData(data);
- }
-
- /**
- */
- protected final char[] getCharacterData() {
- return this.data;
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public String getData() throws DOMException {
- char[] cdata = getCharacterData();
- if (cdata != null)
- return new String(cdata);
- return null;
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- String data = getData();
- if (data == null)
- return 0;
- return data.length();
- }
-
- /**
- * getNodeValue method
- *
- * @return java.lang.String
- */
- public String getNodeValue() {
- return getData();
- }
-
- /**
- * insertData method
- *
- * @param offset
- * int
- * @param arg
- * java.lang.String
- */
- public void insertData(int offset, String arg) throws DOMException {
- if (arg == null)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String data = getData();
- if (data == null) {
- if (offset > 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- data = arg;
- } else if (offset == 0) {
- data = arg + data;
- } else {
- int length = data.length();
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (offset == length)
- data += arg;
- else
- data = data.substring(0, offset) + arg + data.substring(offset);
- }
- setData(data);
- }
-
- /**
- * isJSPContent method
- *
- * @return boolean
- */
- public boolean isJSPContent() {
- Node parent = getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- ElementImpl element = (ElementImpl) parent;
- return element.isJSPContainer();
- }
-
- /**
- * replaceData method
- *
- * @param offset
- * int
- * @param count
- * int
- * @param arg
- * java.lang.String
- */
- public void replaceData(int offset, int count, String arg) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (arg == null) {
- deleteData(offset, count);
- return;
- }
- if (count == 0) {
- insertData(offset, arg);
- return;
- }
- if (offset < 0 || count < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String data = getData();
- if (data == null) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- } else if (offset == 0) {
- int length = data.length();
- if (count > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (count == length)
- data = arg;
- else
- data = arg + data.substring(count);
- } else {
- int length = data.length();
- int end = offset + count;
- if (end > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- if (end == length)
- data = data.substring(0, offset) + arg;
- else
- data = data.substring(0, offset) + arg + data.substring(end);
- }
- setData(data);
- }
-
- /**
- */
- void resetStructuredDocumentRegions() {
- this.data = getData().toCharArray();
- setStructuredDocumentRegion(null);
- }
-
- /**
- * setData method
- *
- * @param data
- * java.lang.String
- */
- public void setData(String data) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.data = (data != null ? data.toCharArray() : null);
-
- notifyValueChanged();
- }
-
- /**
- * setNodeValue method
- *
- * @param nodeValue
- * java.lang.String
- */
- public void setNodeValue(String nodeValue) throws DOMException {
- setData(nodeValue);
- }
-
- /**
- */
- void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- super.setStructuredDocumentRegion(flatNode);
- if (flatNode != null)
- this.data = null;
- }
-
- /**
- * substringData method
- *
- * @return java.lang.String
- * @param offset
- * int
- * @param count
- * int
- */
- public String substringData(int offset, int count) throws DOMException {
- if (count == 0)
- return NodeImpl.EMPTY_STRING;
- if (offset < 0 || count < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String data = getData();
- if (data == null) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int length = data.length();
- if (offset == 0 && count == length)
- return data;
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int end = offset + count;
- if (end > length) {
- // no DOMException specified to be thrown
- end = length;
- }
- return data.substring(offset, end);
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(getNodeName());
- buffer.append('(');
- buffer.append(getData());
- buffer.append(')');
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode != null) {
- buffer.append('@');
- buffer.append(flatNode.toString());
- }
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java
deleted file mode 100644
index 3bdb388dd2..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java
+++ /dev/null
@@ -1,100 +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.wst.xml.core.internal.document;
-
-import java.util.LinkedHashMap;
-
-/**
- * Organizes a pool of frequently used Strings as character arrays.
- *
- */
-final class CharacterStringPool {
-
- static private LinkedHashMap fPool = new LimitedHashMap();
-
- static private class LimitedHashMap extends LinkedHashMap {
- private static final long serialVersionUID = 1L;
- private static final int MAX = 500;
-
- public LimitedHashMap() {
- super(MAX / 10, .75f, true);
- }
- protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
- return size() > MAX;
- }
- }
-
- static private class CharArray {
- char[] fArray;
- /**
- * Answers a hashcode for the array. Algorithm from org.eclipse.jdt.core.compiler.CharOperation
- *
- * @param array the array for which a hashcode is required
- * @return the hashcode
- * @throws NullPointerException if array is null
- */
- public int hashCode() {
- int length = fArray.length;
- int hash = length == 0 ? 31 : fArray[0];
- if (length < 8) {
- for (int i = length; --i > 0;)
- hash = (hash * 31) + fArray[i];
- } else {
- // 8 characters is enough to compute a decent hash code, don't waste time examining every character
- for (int i = length - 1, last = i > 16 ? i - 16 : 0; i > last; i -= 2)
- hash = (hash * 31) + fArray[i];
- }
- return hash & 0x7FFFFFFF;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof CharArray))
- return false;
- CharArray other = (CharArray) obj;
- if (fArray.length != other.fArray.length)
- return false;
- for (int i = 0; i < fArray.length; i++) {
- if (fArray[i] != other.fArray[i])
- return false;
- }
- return true;
- }
- }
-
- private CharacterStringPool() {
- }
-
- /**
- * Returns the character array for <code>string</code>. If
- * the character array is already in the pool for character arrays,
- * the array is reused.
- *
- * @param string the string to retrieve the character array for
- * @return a pooled instance of the character array
- */
- public static char[] getCharString(String string) {
- CharArray array = new CharArray();
- array.fArray = string.toCharArray();
-
- Object obj = null;
- synchronized (fPool) {
- obj = fPool.get(array);
- if (obj == null) {
- obj = array;
- fPool.put(obj, obj);
- }
- }
- return ((CharArray) obj).fArray;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
deleted file mode 100644
index 4a817e07b4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * CommentImpl class
- */
-public class CommentImpl extends CharacterDataImpl implements Comment {
-
- private boolean isJSPTag = false;
-
- /**
- * CommentImpl constructor
- */
- protected CommentImpl() {
- super();
- }
-
- /**
- * CommentImpl constructor
- *
- * @param that
- * CommentImpl
- */
- protected CommentImpl(CommentImpl that) {
- super(that);
-
- if (that != null) {
- this.isJSPTag = that.isJSPTag;
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- CommentImpl cloned = new CommentImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public String getData() throws DOMException {
- char[] data = getCharacterData();
- if (data == null) {
- String sdata = getData(getStructuredDocumentRegion());
- if (sdata != null)
- return sdata;
- return NodeImpl.EMPTY_STRING;
- }
- return new String(data);
- }
-
- /**
- */
- private String getData(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return null;
-
- ITextRegion contentRegion = null;
- StringBuffer buffer = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_COMMENT_OPEN || regionType == DOMRegionContext.XML_COMMENT_CLOSE || isNestedCommentOpenClose(regionType)) {
- continue;
- }
- if (contentRegion == null) { // first content
- contentRegion = region;
- }
- else { // multiple contents
- if (buffer == null) {
- buffer = new StringBuffer(flatNode.getText(contentRegion));
- }
- buffer.append(flatNode.getText(region));
- }
- }
-
- if (buffer != null)
- return buffer.toString();
- if (contentRegion != null)
- return flatNode.getText(contentRegion);
- return null;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#comment";//$NON-NLS-1$
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return COMMENT_NODE;
- }
-
- /**
- */
- public boolean isClosed() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- return (regionType == DOMRegionContext.XML_COMMENT_CLOSE || isNestedCommentClose(regionType));
- }
-
- /**
- * Subclasses must override
- * @param regionType
- * @return
- */
- protected boolean isNestedCommentClose(String regionType) {
- boolean result = false;
- return result;
- }
- /**
- * Subclasses must override
- * @param regionType
- * @return
- */
- protected boolean isNestedCommentOpenClose(String regionType) {
- boolean result = false;
- return result;
- }
-
- public boolean isJSPTag() {
- return this.isJSPTag;
- }
-
- /**
- * setJSPTag method
- *
- * @param isJSPTag
- * boolean
- */
- public void setJSPTag(boolean isJSPTag) {
- if (isJSPTag == this.isJSPTag)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (isJSPTag) {
- if (document == null || !document.isJSPType())
- return;
- }
-
- this.isJSPTag = isJSPTag;
-
- if (getContainerDocument() != null) {
- // already in the tree, update IStructuredDocument
- setData(getData()); // calls notifyValueChanged();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java
deleted file mode 100644
index 5907bfda18..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java
+++ /dev/null
@@ -1,43 +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.wst.xml.core.internal.document;
-
-import org.eclipse.osgi.util.NLS;
-
-class DOMMessages extends NLS {
- private static String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.document.DOMMessages"; //$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, DOMMessages.class);
- }
-
- private DOMMessages() {
- }
-
- public static String DOMSTRING_SIZE_ERR;
- public static String HIERARCHY_REQUEST_ERR;
- public static String INDEX_SIZE_ERR;
- public static String INUSE_ATTRIBUTE_ERR;
- public static String INVALID_ACCESS_ERR;
- public static String INVALID_CHARACTER_ERR;
- public static String INVALID_MODIFICATION_ERR;
- public static String INVALID_STATE_ERR;
- public static String NAMESPACE_ERR;
- public static String NO_DATA_ALLOWED_ERR;
- public static String NO_MODIFICATION_ALLOWED_ERR;
- public static String NOT_FOUND_ERR;
- public static String NOT_SUPPORTED_ERR;
- public static String SYNTAX_ERR;
- public static String TYPE_MISMATCH_ERR;
- public static String VALIDATION_ERR;
- public static String WRONG_DOCUMENT_ERR;
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties
deleted file mode 100644
index 039213ef30..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-DOMSTRING_SIZE_ERR=DOMString Size Error
-HIERARCHY_REQUEST_ERR=Invalid Hierarchy Request
-INDEX_SIZE_ERR=Index Size Error
-INUSE_ATTRIBUTE_ERR=Attribute Node In Use Error
-INVALID_ACCESS_ERR=Invalid Access Error
-INVALID_CHARACTER_ERR=Invalid Characer Error
-INVALID_MODIFICATION_ERR=Invalid Modification Error
-INVALID_STATE_ERR=Invalid State Error
-NAMESPACE_ERR=Namespace Error
-NO_DATA_ALLOWED_ERR=No Data Allowed
-NO_MODIFICATION_ALLOWED_ERR=No Modification Allowed
-NOT_FOUND_ERR=Not Found
-NOT_SUPPORTED_ERR=Not Supported
-SYNTAX_ERR=Syntax Error
-TYPE_MISMATCH_ERR=Type Mismatch Error
-VALIDATION_ERR=Validation Error
-WRONG_DOCUMENT_ERR=Wrong Document
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
deleted file mode 100644
index 9fc72aa9db..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
+++ /dev/null
@@ -1,981 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.document;
-
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-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.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.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLNamespace;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * XMLModelImpl class
- */
-public class DOMModelImpl extends AbstractStructuredModel implements IStructuredDocumentListener, IDOMModel, DOMImplementation {
- private static String TRACE_PARSER_MANAGEMENT_EXCEPTION = "parserManagement"; //$NON-NLS-1$
- private Object active = null;
- private DocumentImpl document = null;
- private ISourceGenerator generator = null;
- private XMLModelNotifier notifier = null;
- private XMLModelParser parser = null;
- private boolean refresh = false;
- private XMLModelUpdater updater = null;
-
- /**
- * XMLModelImpl constructor
- */
- public DOMModelImpl() {
- super();
- this.document = (DocumentImpl) internalCreateDocument();
- }
-
- /**
- * This API allows clients to declare that they are about to make a
- * "large" change to the model. This change might be in terms of content
- * or it might be in terms of the model id or base location.
- *
- * Note that in the case of embedded calls, notification to listeners is
- * sent only once.
- *
- * Note that the client who is making these changes has the responsibility
- * to restore the models state once finished with the changes. See
- * getMemento and restoreState.
- *
- * The method isModelStateChanging can be used by a client to determine if
- * the model is already in a change sequence.
- */
- public void aboutToChangeModel() {
- super.aboutToChangeModel();
- // technically, no need to call beginChanging so often,
- // since aboutToChangeModel can be nested.
- // but will leave as is for this release.
- // see modelChanged, and be sure stays coordinated there.
- getModelNotifier().beginChanging();
- }
-
- public void aboutToReinitializeModel() {
- XMLModelNotifier notifier = getModelNotifier();
- notifier.cancelPending();
- super.aboutToReinitializeModel();
- }
-
- /**
- * attrReplaced method
- *
- * @param element
- * org.w3c.dom.Element
- * @param newAttr
- * org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- protected void attrReplaced(Element element, Attr newAttr, Attr oldAttr) {
- if (element == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.replaceAttr(element, newAttr, oldAttr);
- setActive(null);
- }
- getModelNotifier().attrReplaced(element, newAttr, oldAttr);
- }
-
- /**
- * This API allows a client controlled way of notifying all ModelEvent
- * listners that the model has been changed. This method is a matched pair
- * to aboutToChangeModel, and must be called after aboutToChangeModel ...
- * or some listeners could be left waiting indefinitely for the changed
- * event. So, its suggested that changedModel always be in a finally
- * clause. Likewise, a client should never call changedModel without
- * calling aboutToChangeModel first.
- *
- * In the case of embedded calls, the notification is just sent once.
- *
- */
- public void changedModel() {
- // NOTE: the order of 'changedModel' and 'endChanging' is significant.
- // By calling changedModel first, this basically decrements the
- // "isChanging" counter
- // in super class and when zero all listeners to model state events
- // will be notified
- // that the model has been changed. 'endChanging' will notify all
- // deferred adapters.
- // So, the significance of order is that adapters (and methods they
- // call)
- // can count on the state of model "isChanging" to be accurate.
- // But, remember, that this means the "modelChanged" event can be
- // received before all
- // adapters have finished their processing.
- // NOTE NOTE: The above note is obsolete in fact (though still states
- // issue correctly).
- // Due to popular demand, the order of these calls were reversed and
- // behavior
- // changed on 07/22/2004.
- //
- // see also
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4302
- // for motivation for this 'on verge of' call.
- // this could be improved in future if notifier also used counting
- // flag to avoid nested calls. If/when changed be sure to check if
- // aboutToChangeModel needs any changes too.
- if (isModelChangeStateOnVergeOfEnding()) {
- // end lock before noticiation loop, since directly or indirectly
- // we may be "called from foriegn code" during notification.
- endLock();
- // we null out here to avoid spurious"warning" message while debug
- // tracing is enabled
- fLockObject = null;
- // the notifier is what controls adaper notification, which
- // should be sent out before the 'modelChanged' event.
- getModelNotifier().endChanging();
- }
- // changedModel handles 'nesting', so only one event sent out
- // when mulitple calls to 'aboutToChange/Changed'.
- super.changedModel();
- handleRefresh();
- }
-
- /**
- * childReplaced method
- *
- * @param parentNode
- * org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- protected void childReplaced(Node parentNode, Node newChild, Node oldChild) {
- if (parentNode == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.replaceChild(parentNode, newChild, oldChild);
- setActive(null);
- }
- getModelNotifier().childReplaced(parentNode, newChild, oldChild);
- }
-
- /**
- * Creates an XML <code>Document</code> object of the specified type
- * with its document element. HTML-only DOM implementations do not need to
- * implement this method.
- *
- * @param namespaceURIThe
- * namespace URI of the document element to create.
- * @param qualifiedNameThe
- * qualified name of the document element to be created.
- * @param doctypeThe
- * type of document to be created or <code>null</code>. When
- * <code>doctype</code> is not <code>null</code>, its
- * <code>Node.ownerDocument</code> attribute is set to the
- * document being created.
- * @return A new <code>Document</code> object.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified
- * name contains an illegal character. <br>
- * NAMESPACE_ERR: Raised if the <code>qualifiedName</code>
- * is malformed, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is
- * <code>null</code>, or if the
- * <code>qualifiedName</code> has a prefix that is "xml"
- * and the <code>namespaceURI</code> is different from "
- * http://www.w3.org/XML/1998/namespace" .<br>
- * WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has
- * already been used with a different document or was
- * created from a different implementation.
- * @see DOM Level 2
- */
- public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException {
- final DocumentImpl document = new DocumentImpl();
- if (namespaceURI == null && qualifiedName == null && doctype == null)
- return document;
-
- if (qualifiedName != null) {
-
- final int idx = qualifiedName.indexOf(':');
- if (idx > 0) {
- if (namespaceURI == null)
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
- final String prefix = qualifiedName.substring(0, idx);
- if (prefix.equals(IXMLNamespace.XML) && !namespaceURI.equals(IXMLNamespace.XML_URI))
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
-
- // Check if the qualifiedName is malformed
- if (idx == qualifiedName.length() - 1) // No local name
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
-
- String localName = qualifiedName.substring(idx + 1);
- final int length = localName.length();
- if (length == 0)
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
-
- switch (localName.charAt(0)) {
- case '-':
- case '.':
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
- }
-
- final int qualifiedLength = qualifiedName.length();
- for (int i = 0; i < qualifiedLength; i++) {
- final char c = qualifiedName.charAt(i);
- if (Character.isWhitespace(c))
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, null);
- else if (c == ':' && i != idx)
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
- }
- }
- if (!NameValidator.isValid(qualifiedName))
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, null);
- }
- else if (namespaceURI != null){
- throw new DOMException(DOMException.NAMESPACE_ERR, null);
- }
-
- final DOMModelImpl model = (DOMModelImpl) StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForXML.ContentTypeID_XML);
- if (model != null) {
- document.setModel(model);
- model.document = document;
- }
-
- if (doctype != null) {
- if (doctype.getOwnerDocument() != null)
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, null);
- document.appendChild(doctype);
- }
-
- final ElementImpl root = new ElementImpl();
- document.appendChild(root);
- root.setNamespaceURI(namespaceURI);
- root.setTagName(qualifiedName);
-
- return document;
- }
-
- /**
- * Creates an empty <code>DocumentType</code> node. Entity declarations
- * and notations are not made available. Entity reference expansions and
- * default attribute additions do not occur. It is expected that a future
- * version of the DOM will provide a way for populating a
- * <code>DocumentType</code>.<br>
- * HTML-only DOM implementations do not need to implement this method.
- *
- * @param qualifiedNameThe
- * qualified name of the document type to be created.
- * @param publicIdThe
- * external subset public identifier.
- * @param systemIdThe
- * external subset system identifier.
- * @return A new <code>DocumentType</code> node with
- * <code>Node.ownerDocument</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified
- * name contains an illegal character. <br>
- * NAMESPACE_ERR: Raised if the <code>qualifiedName</code>
- * is malformed.
- * @see DOM Level 2
- */
- public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) throws DOMException {
- DocumentTypeImpl documentType = new DocumentTypeImpl();
- documentType.setName(qualifiedName);
- documentType.setPublicId(publicId);
- documentType.setSystemId(systemId);
- return documentType;
- }
-
- /**
- */
- protected void documentTypeChanged() {
- if (this.refresh)
- return;
- // unlike 'resfresh', 'reinitialize' finishes loop
- // and flushes remaining notification que before
- // actually reinitializing.
- // ISSUE: should reinit be used instead of handlerefresh?
- // this.setReinitializeNeeded(true);
- if (this.active != null || getModelNotifier().isChanging())
- return; // defer
- handleRefresh();
- }
-
- protected void editableChanged(Node node) {
- if (node != null) {
- getModelNotifier().editableChanged(node);
- }
- }
-
- /**
- */
- protected void endTagChanged(Element element) {
- if (element == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.changeEndTag(element);
- setActive(null);
- }
- getModelNotifier().endTagChanged(element);
- }
-
- /**
- */
- private XMLModelParser getActiveParser() {
- if (this.parser == null)
- return null;
- if (this.parser != this.active)
- return null;
- return this.parser;
- }
-
- /**
- */
- private XMLModelUpdater getActiveUpdater() {
- if (this.updater == null)
- return null;
- if (this.updater != this.active)
- return null;
- return this.updater;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (Document.class.equals(adapter))
- return getDocument();
- return super.getAdapter(adapter);
- }
-
- /**
- * getDocument method
- *
- * @return XMLDocument
- */
- public IDOMDocument getDocument() {
- return this.document;
- }
-
- public ISourceGenerator getGenerator() {
- if (this.generator == null) {
- this.generator = XMLGeneratorImpl.getInstance();
- }
- return this.generator;
- }
-
- /**
- * getNode method
- *
- * @param offset
- * int
- */
- public IndexedRegion getIndexedRegion(int offset) {
- if (this.document == null)
- return null;
- // search in document children
- IDOMNode parent = null;
- int length = this.document.getEndOffset();
- if (offset * 2 < length) {
- // search from the first
- IDOMNode child = (IDOMNode) this.document.getFirstChild();
- while (child != null) {
- if (child.getEndOffset() <= offset) {
- child = (IDOMNode) child.getNextSibling();
- continue;
- }
- if (child.getStartOffset() > offset) {
- break;
- }
- IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- if (startStructuredDocumentRegion.getEnd() > offset)
- return child;
- }
- IStructuredDocumentRegion endStructuredDocumentRegion = child.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- if (endStructuredDocumentRegion.getStart() <= offset)
- return child;
- }
- // dig more
- parent = child;
- child = (IDOMNode) parent.getFirstChild();
- }
- }
- else {
- // search from the last
- IDOMNode child = (IDOMNode) this.document.getLastChild();
- while (child != null) {
- if (child.getStartOffset() > offset) {
- child = (IDOMNode) child.getPreviousSibling();
- continue;
- }
- if (child.getEndOffset() <= offset) {
- break;
- }
- IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- if (startStructuredDocumentRegion.getEnd() > offset)
- return child;
- }
- IStructuredDocumentRegion endStructuredDocumentRegion = child.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- if (endStructuredDocumentRegion.getStart() <= offset)
- return child;
- }
- // dig more
- parent = child;
- child = (IDOMNode) parent.getLastChild();
- }
- }
- return parent;
- }
-
- /**
- */
- public XMLModelNotifier getModelNotifier() {
- if (this.notifier == null) {
- this.notifier = new XMLModelNotifierImpl();
- }
- return this.notifier;
- }
-
- /**
- */
- private XMLModelParser getModelParser() {
- if (this.parser == null) {
- this.parser = createModelParser();
- }
- return this.parser;
- }
-
- protected XMLModelParser createModelParser() {
- return new XMLModelParser(this);
- }
-
- /**
- */
- private XMLModelUpdater getModelUpdater() {
- if (this.updater == null) {
- this.updater = createModelUpdater();
- }
- return this.updater;
- }
-
- protected XMLModelUpdater createModelUpdater() {
- return new XMLModelUpdater(this);
- }
-
- /**
- */
- private void handleRefresh() {
- if (!this.refresh)
- return;
- XMLModelNotifier notifier = getModelNotifier();
- boolean isChanging = notifier.isChanging();
- if (!isChanging)
- notifier.beginChanging(true);
- XMLModelParser parser = getModelParser();
- setActive(parser);
- this.document.removeChildNodes();
- try {
- this.refresh = false;
- parser.replaceStructuredDocumentRegions(getStructuredDocument().getRegionList(), null);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- }
- finally {
- setActive(null);
- if (!isChanging)
- notifier.endChanging();
- }
- }
-
- /**
- * Test if the DOM implementation implements a specific feature.
- *
- * @param featureThe
- * name of the feature to test (case-insensitive). The values
- * used by DOM features are defined throughout the DOM Level 2
- * specifications and listed in the section. The name must be
- * an XML name. To avoid possible conflicts, as a convention,
- * names referring to features defined outside the DOM
- * specification should be made unique by reversing the name of
- * the Internet domain name of the person (or the organization
- * that the person belongs to) who defines the feature,
- * component by component, and using this as a prefix. For
- * instance, the W3C SVG Working Group defines the feature
- * "org.w3c.dom.svg".
- * @param versionThis
- * is the version number of the feature to test. In Level 2,
- * the string can be either "2.0" or "1.0". If the version is
- * not specified, supporting any version of the feature causes
- * the method to return <code>true</code>.
- * @return <code>true</code> if the feature is implemented in the
- * specified version, <code>false</code> otherwise.
- */
- public boolean hasFeature(String feature, String version) {
- if (feature == null)
- return false;
- if (version != null) {
- if (!version.equals("1.0") && !version.equals("2.0")) { //$NON-NLS-2$//$NON-NLS-1$
- return false;
- }
- }
- if (feature.equalsIgnoreCase("Core")) //$NON-NLS-1$
- return true; //$NON-NLS-1$
- if (feature.equalsIgnoreCase("XML")) //$NON-NLS-1$
- return true; //$NON-NLS-1$
- return false;
- }
-
- /**
- * createDocument method
- *
- * @return org.w3c.dom.Document
- */
- protected Document internalCreateDocument() {
- DocumentImpl document = new DocumentImpl();
- document.setModel(this);
- return document;
- }
-
- boolean isReparsing() {
- return (active != null);
- }
-
- /**
- * nameChanged method
- *
- * @param node
- * org.w3c.dom.Node
- */
- protected void nameChanged(Node node) {
- if (node == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.changeName(node);
- setActive(null);
- }
- // notification is already sent
- }
-
- /**
- * newModel method
- *
- */
- 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 (fStructuredDocument != null && fStructuredDocument != structuredDocument)
- setStructuredDocument(structuredDocument);
-
- internalSetNewDocument(structuredDocument);
- }
-
- private void internalSetNewDocument(IStructuredDocument structuredDocument) {
- if (structuredDocument == null)
- return;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if ((flatNodes == null) || (flatNodes.getLength() == 0)) {
- return;
- }
- if (this.document == null)
- return; // being constructed
- XMLModelUpdater updater = getActiveUpdater();
- if (updater != null) { // being updated
- try {
- updater.replaceStructuredDocumentRegions(flatNodes, null);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- }
- // // for new model, we might need to
- // // re-init, e.g. if someone calls setText
- // // on an existing model
- // checkForReinit();
- return;
- }
- XMLModelNotifier notifier = getModelNotifier();
- boolean isChanging = notifier.isChanging();
- // call even if changing to notify doing new model
- getModelNotifier().beginChanging(true);
- XMLModelParser parser = getModelParser();
- setActive(parser);
- this.document.removeChildNodes();
- try {
- parser.replaceStructuredDocumentRegions(flatNodes, null);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- // meaningless to refresh, because the result might be the same
- }
- finally {
- setActive(null);
- if (!isChanging) {
- getModelNotifier().endChanging();
- }
- // ignore refresh
- this.refresh = false;
- }
- }
-
- /**
- */
- public void noChange(NoChangeEvent event) {
- XMLModelUpdater updater = getActiveUpdater();
- if (updater != null) { // being updated
- // cleanup updater staffs
- try {
- updater.replaceStructuredDocumentRegions(null, null);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- }
- // I guess no chanage means the model could not need re-init
- // checkForReinit();
- return;
- }
- }
-
- /**
- * nodesReplaced method
- *
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- if (event == null)
- return;
- IStructuredDocumentRegionList oldStructuredDocumentRegions = event.getOldStructuredDocumentRegions();
- IStructuredDocumentRegionList newStructuredDocumentRegions = event.getNewStructuredDocumentRegions();
- XMLModelUpdater updater = getActiveUpdater();
- if (updater != null) { // being updated
- try {
- updater.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
- catch (Exception ex) {
- if (ex.getClass().equals(StructuredDocumentRegionManagementException.class)) {
- Logger.traceException(TRACE_PARSER_MANAGEMENT_EXCEPTION, ex);
- }
- else {
- Logger.logException(ex);
- }
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- }
- // checkForReinit();
- return;
- }
- XMLModelNotifier notifier = getModelNotifier();
- boolean isChanging = notifier.isChanging();
- if (!isChanging)
- notifier.beginChanging();
- XMLModelParser parser = getModelParser();
- setActive(parser);
- try {
- parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- if (!isChanging) {
- notifier.endChanging();
- handleRefresh();
- }
- }
-
- }
-
- /**
- * regionChanged method
- *
- * @param structuredDocumentEvent
- */
- public void regionChanged(RegionChangedEvent event) {
- if (event == null)
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
- ITextRegion region = event.getRegion();
- if (region == null)
- return;
- XMLModelUpdater updater = getActiveUpdater();
- if (updater != null) { // being updated
- try {
- updater.changeRegion(event, flatNode, region);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- }
- // checkForReinit();
- return;
- }
- XMLModelNotifier notifier = getModelNotifier();
- boolean isChanging = notifier.isChanging();
- if (!isChanging)
- notifier.beginChanging();
- XMLModelParser parser = getModelParser();
- setActive(parser);
- try {
- parser.changeRegion(event, flatNode, region);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- if (!isChanging) {
- notifier.endChanging();
- handleRefresh();
- }
- }
- // checkForReinit();
- }
-
- /**
- * regionsReplaced method
- *
- * @param event
- */
- public void regionsReplaced(RegionsReplacedEvent event) {
- if (event == null)
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
- ITextRegionList oldRegions = event.getOldRegions();
- ITextRegionList newRegions = event.getNewRegions();
- if (oldRegions == null && newRegions == null)
- return;
- XMLModelUpdater updater = getActiveUpdater();
- if (updater != null) { // being updated
- try {
- updater.replaceRegions(flatNode, newRegions, oldRegions);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- }
- // checkForReinit();
- return;
- }
- XMLModelNotifier notifier = getModelNotifier();
- boolean isChanging = notifier.isChanging();
- if (!isChanging)
- notifier.beginChanging();
- XMLModelParser parser = getModelParser();
- setActive(parser);
- try {
- parser.replaceRegions(flatNode, newRegions, oldRegions);
- }
- catch (Exception ex) {
- Logger.logException(ex);
- this.refresh = true;
- handleRefresh();
- }
- finally {
- setActive(null);
- if (!isChanging) {
- notifier.endChanging();
- handleRefresh();
- }
- }
- // checkForReinit();
- }
-
- /**
- */
- public void releaseFromEdit() {
- if (!isShared()) {
- // this.document.releaseStyleSheets();
- // this.document.releaseDocumentType();
- }
- super.releaseFromEdit();
- }
-
- /**
- */
- public void releaseFromRead() {
- if (!isShared()) {
- // this.document.releaseStyleSheets();
- // this.document.releaseDocumentType();
- }
- super.releaseFromRead();
- }
-
- /**
- */
- private void setActive(Object active) {
- this.active = active;
- // side effect
- // when ever becomes active, besure tagNameCache is cleared
- // (and not used)
- if (active == null) {
- document.activateTagNameCache(true);
- }
- else {
- document.activateTagNameCache(false);
- }
-
- }
-
- /**
- */
- public void setGenerator(ISourceGenerator generator) {
- this.generator = generator;
- }
-
- /**
- */
- public void setModelNotifier(XMLModelNotifier notifier) {
- this.notifier = notifier;
- }
-
- /**
- */
- public void setModelParser(XMLModelParser parser) {
- this.parser = parser;
- }
-
- /**
- */
- public void setModelUpdater(XMLModelUpdater updater) {
- this.updater = updater;
- }
-
- /**
- * setStructuredDocument method
- *
- * @param structuredDocument
- */
- public void setStructuredDocument(IStructuredDocument structuredDocument) {
- IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
- if (structuredDocument == oldStructuredDocument)
- return; // nothing to do
- if (oldStructuredDocument != null)
- oldStructuredDocument.removeDocumentChangingListener(this);
- super.setStructuredDocument(structuredDocument);
- if (structuredDocument != null) {
- internalSetNewDocument(structuredDocument);
- structuredDocument.addDocumentChangingListener(this);
- }
- }
-
- /**
- */
- protected void startTagChanged(Element element) {
- if (element == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.changeStartTag(element);
- setActive(null);
- }
- getModelNotifier().startTagChanged(element);
- }
-
- /**
- * valueChanged method
- *
- * @param node
- * org.w3c.dom.Node
- */
- protected void valueChanged(Node node) {
- if (node == null)
- return;
- if (getActiveParser() == null) {
- XMLModelUpdater updater = getModelUpdater();
- setActive(updater);
- updater.initialize();
- updater.changeValue(node);
- setActive(null);
- }
- getModelNotifier().valueChanged(node);
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
- */
- public Object getFeature(String feature, String version) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java
deleted file mode 100644
index cde882c636..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java
+++ /dev/null
@@ -1,81 +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
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * DocumentFragmentImpl class
- */
-public class DocumentFragmentImpl extends NodeContainer implements DocumentFragment {
-
- /**
- * DocumentFragmentImpl constructor
- */
- protected DocumentFragmentImpl() {
- super();
- }
-
- /**
- * DocumentFragmentImpl constructor
- *
- * @param that
- * DocumentFragmentImpl
- */
- protected DocumentFragmentImpl(DocumentFragmentImpl that) {
- super(that);
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- DocumentFragmentImpl cloned = new DocumentFragmentImpl(this);
- if (deep)
- cloneChildNodes(cloned, deep);
-
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#document-fragment";//$NON-NLS-1$
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return DOCUMENT_FRAGMENT_NODE;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
deleted file mode 100644
index 34a3e31707..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- * David Carver (Intalio) - bug 273004 - add check for valid xml characters in createAttribute
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-// for org.apache.xerces 3.2.1
-// import org.apache.xerces.utils.XMLCharacterProperties;
-// DMW modified for XML4J 4.0.1
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.xerces.dom.TreeWalkerImpl;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-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.CMEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-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.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.ranges.DocumentRange;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
-
-
-/**
- * DocumentImpl class
- */
-public class DocumentImpl extends NodeContainer implements IDOMDocument, DocumentRange, DocumentTraversal {
-
- private static int maxDocTypeSearch = 500;
- private static int noMaxSearch = -1;
- /**
- * Internal-use only class. This class was added to better able to handle
- * repetetive request for getElementsByTagName. The cache is cleared when
- * ever the document changes at all, so still not real efficient,
- */
- class TagNameCache {
-
- private boolean active = true;
-
- private Map cache;
-
- public TagNameCache() {
- super();
- cache = new HashMap();
- }
-
- /**
- * @param b
- */
- public void activate(boolean b) {
- active = b;
- if (!b)
- clear();
- }
-
- public void addItem(String tagname, NodeListImpl nodelist) {
- if (tagname == null || nodelist == null)
- return;
- cache.put(tagname, nodelist);
- }
-
- public void clear() {
- cache.clear();
- }
-
- public NodeListImpl getItem(String tagName) {
- NodeListImpl result = null;
- if (active) {
- result = (NodeListImpl) cache.get(tagName);
- // if (result != null) {
- // System.out.println("getElementsByTagname from cache: " +
- // tagName);
- // }
- }
- return result;
- }
-
- }
-
- private class LimitedCache extends LinkedHashMap {
- private static final long serialVersionUID = 1L;
- private static final int MAX_SIZE = 10;
- public LimitedCache() {
- super(0, 0.75f, true);
- }
-
- protected boolean removeEldestEntry(java.util.Map.Entry entry) {
- return size() > MAX_SIZE;
- }
- }
-
- // this is a constant just to give compile-time control over
- // whether or not to use the cache. If, in future, its found that
- // there are no (or few) "duplicate requests" ... then this cache
- // is not needed.
- private static final boolean usetagnamecache = true;
-
- // private DocumentTypeAdapter documentTypeAdapter = null;
-
- private DOMModelImpl model = null;
- private TagNameCache tagNameCache;
-
- private Map fCMCache;
- /**
- * DocumentImpl constructor
- */
- protected DocumentImpl() {
- super();
- if (usetagnamecache) {
- tagNameCache = new TagNameCache();
- }
- fCMCache = Collections.synchronizedMap(new LimitedCache());
- }
-
- /**
- * DocumentImpl constructor
- *
- * @param that
- * DocumentImpl
- */
- protected DocumentImpl(DocumentImpl that) {
- super(that);
- if (usetagnamecache) {
- tagNameCache = new TagNameCache();
- }
- fCMCache = Collections.synchronizedMap(new LimitedCache());
- }
-
- /**
- * @param b
- */
- void activateTagNameCache(boolean b) {
- tagNameCache.activate(b);
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * Changes the <code>ownerDocument</code> of a node, its children, as
- * well as the attached attribute nodes if there are any. If the node has
- * a parent it is first removed from its parent child list. This
- * effectively allows moving a subtree from one document to another. The
- * following list describes the specifics for each type of node.
- * <dl>
- * <dt>ATTRIBUTE_NODE</dt>
- * <dd>The <code>ownerElement</code> attribute is set to
- * <code>null</code> and the <code>specified</code> flag is set to
- * <code>true</code> on the adopted <code>Attr</code>. The
- * descendants of the source <code>Attr</code> are recursively adopted.
- * </dd>
- * <dt>DOCUMENT_FRAGMENT_NODE</dt>
- * <dd>The descendants of the source node are recursively adopted.</dd>
- * <dt>DOCUMENT_NODE</dt>
- * <dd><code>Document</code> nodes cannot be adopted.</dd>
- * <dt>DOCUMENT_TYPE_NODE</dt>
- * <dd><code>DocumentType</code> nodes cannot be adopted.</dd>
- * <dt>ELEMENT_NODE</dt>
- * <dd>Specified attribute nodes of the source element are adopted, and
- * the generated <code>Attr</code> nodes. Default attributes are
- * discarded, though if the document being adopted into defines default
- * attributes for this element name, those are assigned. The descendants
- * of the source element are recursively adopted.</dd>
- * <dt>ENTITY_NODE</dt>
- * <dd><code>Entity</code> nodes cannot be adopted.</dd>
- * <dt>ENTITY_REFERENCE_NODE</dt>
- * <dd>Only the <code>EntityReference</code> node itself is adopted,
- * the descendants are discarded, since the source and destination
- * documents might have defined the entity differently. If the document
- * being imported into provides a definition for this entity name, its
- * value is assigned.</dd>
- * <dt>NOTATION_NODE</dt>
- * <dd><code>Notation</code> nodes cannot be adopted.</dd>
- * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE,
- * COMMENT_NODE</dt>
- * <dd>These nodes can all be adopted. No specifics.</dd>
- * Should this method simply return null when it fails? How "exceptional"
- * is failure for this method?Stick with raising exceptions only in
- * exceptional circumstances, return null on failure (F2F 19 Jun 2000).Can
- * an entity node really be adopted?No, neither can Notation nodes (Telcon
- * 13 Dec 2000).Does this affect keys and hashCode's of the adopted
- * subtree nodes?If so, what about readonly-ness of key and hashCode?if
- * not, would appendChild affect keys/hashCodes or would it generate
- * exceptions if key's are duplicate? Update: Hashcodes have been dropped.
- * Given that the key is only unique within a document an adopted node
- * needs to be given a new key, but what does it mean for the application?
- *
- * TODO: Needs to notify UserDataHandlers for the node if any
- *
- * @param source
- * The node to move into this document.
- * @return The adopted node, or <code>null</code> if this operation
- * fails, such as when the source node comes from a different
- * implementation.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the source node is of type
- * <code>DOCUMENT</code>,<code>DOCUMENT_TYPE</code>.
- * <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the source node
- * is readonly.
- * @see DOM Level 3
- */
- public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws org.w3c.dom.DOMException {
- return null;
- }
-
- /**
- * @param tagName
- */
- protected void checkTagNameValidity(String tagName) {
- if (!isValidName(tagName)) {
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, createDOMExceptionMessage(DOMException.INVALID_CHARACTER_ERR, tagName));
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- DocumentImpl cloned = new DocumentImpl(this);
- if (deep)
- cloned.importChildNodes(this, true);
- return cloned;
- }
-
- /**
- * createAttribute method
- *
- * @return org.w3c.dom.Attr
- * @param name
- * java.lang.String
- */
- public Attr createAttribute(String name) throws DOMException {
- checkTagNameValidity(name);
- AttrImpl attr = new AttrImpl();
- attr.setOwnerDocument(this);
- attr.setName(name);
- return attr;
- }
-
- /**
- */
- public Attr createAttributeNS(String uri, String name) throws DOMException {
- checkTagNameValidity(name);
- AttrImpl attr = new AttrImpl();
- attr.setOwnerDocument(this);
- attr.setName(name);
- attr.setNamespaceURI(uri);
- return attr;
- }
-
- /**
- * createCDATASection method
- *
- * @return org.w3c.dom.CDATASection
- * @param data
- * java.lang.String
- */
- public CDATASection createCDATASection(String data) throws DOMException {
- // allow CDATA section
- // if (!isXMLType()) {
- // throw new DOMException(DOMException.NOT_SUPPORTED_ERR, new
- // String());
- // }
- CDATASectionImpl cdata = new CDATASectionImpl();
- cdata.setOwnerDocument(this);
- if (data != null)
- cdata.setData(data);
- return cdata;
- }
-
- /**
- * createComment method
- *
- * @return org.w3c.dom.Comment
- * @param data
- * java.lang.String
- */
- public Comment createComment(String data) {
- CommentImpl comment = new CommentImpl();
- comment.setOwnerDocument(this);
- if (data != null)
- comment.setData(data);
- return comment;
- }
-
- public Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException {
- Element result = null;
- if (!isJSPType() && isJSPTag) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, DOMMessages.INVALID_MODIFICATION_ERR);
- }
- ElementImpl element = (ElementImpl) createElement(tagName);
- element.setJSPTag(isJSPTag);
- CommentElementRegistry registry = CommentElementRegistry.getInstance();
- if (registry.setupCommentElement(element)) {
- result = element;
- }
- else {
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, DOMMessages.INVALID_CHARACTER_ERR);
- }
- return result;
- }
-
- /**
- * createDoctype method
- *
- * @return org.w3c.dom.DocumentType
- * @param name
- * java.lang.String
- */
- public DocumentType createDoctype(String name) {
- DocumentTypeImpl docType = new DocumentTypeImpl();
- docType.setOwnerDocument(this);
- docType.setName(name);
- return docType;
- }
-
- /**
- * createDocumentFragment method
- *
- * @return org.w3c.dom.DocumentFragment
- */
- public DocumentFragment createDocumentFragment() {
- DocumentFragmentImpl fragment = new DocumentFragmentImpl();
- fragment.setOwnerDocument(this);
- return fragment;
- }
-
- /**
- * createElement method
- *
- * @return org.w3c.dom.Element
- * @param tagName
- * java.lang.String
- */
- public Element createElement(String tagName) throws DOMException {
- checkTagNameValidity(tagName);
-
- ElementImpl element = new ElementImpl();
- element.setOwnerDocument(this);
- element.setTagName(tagName);
- return element;
- }
-
- /**
- */
- public Element createElementNS(String uri, String tagName) throws DOMException {
- if (!isValidName(tagName)) {
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, DOMMessages.INVALID_CHARACTER_ERR);
- }
-
- ElementImpl element = (ElementImpl) createElement(tagName);
- element.setNamespaceURI(uri);
- return element;
- }
-
- /**
- * createEntity method
- *
- * @return org.w3c.dom.Entity
- * @param name
- * java.lang.String
- */
- public Entity createEntity(String name) {
- EntityImpl entity = new EntityImpl();
- entity.setOwnerDocument(this);
- entity.setName(name);
- return entity;
- }
-
- /**
- * createEntityReference method
- *
- * @return org.w3c.dom.EntityReference
- * @param name
- * java.lang.String
- */
- public EntityReference createEntityReference(String name) throws DOMException {
- if (!isXMLType()) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, DOMMessages.NOT_SUPPORTED_ERR);
- }
-
- EntityReferenceImpl ref = new EntityReferenceImpl();
- ref.setOwnerDocument(this);
- ref.setName(name);
- return ref;
- }
-
- /**
- */
- public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
- if (root == null)
- root = this;
- return new NodeIteratorImpl(root, whatToShow, filter);
- }
-
- /**
- * createNotation method
- *
- * @return org.w3c.dom.Notation
- * @param name
- * java.lang.String
- */
- public Notation createNotation(String name) {
- NotationImpl notation = new NotationImpl();
- notation.setOwnerDocument(this);
- notation.setName(name);
- return notation;
- }
-
- /**
- * createProcessingInstruction method
- *
- * @return org.w3c.dom.ProcessingInstruction
- * @param target
- * java.lang.String
- * @param data
- * java.lang.String
- */
- public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException {
- ProcessingInstructionImpl pi = new ProcessingInstructionImpl();
- pi.setOwnerDocument(this);
- pi.setTarget(target);
- if (data != null)
- pi.setData(data);
- return pi;
- }
-
- /**
- */
- public Range createRange() {
- return new RangeImpl();
- }
-
- /**
- * createTextNode method
- *
- * @return org.w3c.dom.Text
- * @param data
- * java.lang.String
- */
- public Text createTextNode(String data) {
- TextImpl text = new TextImpl();
- text.setOwnerDocument(this);
- text.setData(data);
- return text;
- }
-
- /**
- * Return an instance of tree walk
- */
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.traversal.DocumentTraversal#createTreeWalker(org.w3c.dom.Node,
- * int, org.w3c.dom.traversal.NodeFilter, boolean)
- */
- public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
- if (root == null) {
- String msg = DOMMessages.NOT_SUPPORTED_ERR + " - Program Error: root node can not be null for TreeWalker";
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- // ISSUE: we just use Xerces implementation for now, but longer term,
- // we should make a
- // thread/job safe version (as well as not rely on Xerces "impl"
- // class.
- return new TreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion);
-
- }
-
- private DocumentType findDoctype(Node node) {
-
- int countSearch = 0;
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (countSearch++ > maxDocTypeSearch) {
- break;
- }
- if (child.getNodeType() == DOCUMENT_TYPE_NODE && child instanceof DocumentType) {
- return (DocumentType) child;
- }
- else if (child.getNodeType() == ELEMENT_NODE && ((IDOMElement) child).isCommentTag()) {
- // search DOCTYPE inside of generic comment element
- DocumentType docType = findDoctype(child);
- if (docType != null) {
- return docType;
- }
- }
- }
-
- return null;
- }
-
- private Element findDocumentElement(String docName, Node node, Node[] firstFound, int max) {
- int countSearch = 0;
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-
- /*
- * maxDocTypeSearch limits added via bug 151929
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=151929
- * but, in other contexts,
- * if noMaxSearch is specified, then do not "break out" of long searches
- * */
- if (max != noMaxSearch && countSearch++ > max) {
- break;
- }
- if (child.getNodeType() != ELEMENT_NODE)
- continue;
- ElementImpl element = (ElementImpl) child;
- if (element.isCommentTag()) {
- Element docElement = findDocumentElement(docName, element, firstFound, max);
- if (docElement != null) {
- return docElement;
- }
- else {
- // added 'else continue' to better handle cases where
- // there is "more than one root" element
- // especially complicated by CommentElements, which are
- // sometimes treated as elements, but should
- // be treated as comments in this context.
- continue;
- }
- }
- // note: the "name" won't match in the event of a jsp tag ... but
- // incase
- // the name is null, we do not want the jsp element returned as
- // documentElement
- if (element.isJSPTag())
- continue;
- if (docName == null)
- return element;
- // use local name for namespace
- String localName = element.getLocalName();
- if (localName == null)
- continue;
- if (isXMLType()) {
- if (localName.equals(docName))
- return element;
- }
- else {
- if (localName.equalsIgnoreCase(docName))
- return element;
- }
- if (firstFound[0] == null)
- firstFound[0] = element;
- }
- return null;
- }
-
- /**
- * getCharValue method
- *
- * @return java.lang.String
- * @param name
- * java.lang.String
- */
- protected String getCharValue(String name) {
- if (name == null)
- return null;
- int length = name.length();
- if (length == 0)
- return null;
-
- if (name.charAt(0) == '#') { // character reference
- if (length == 1)
- return null;
- int radix = 10;
- String s = null;
- // now allow hexadecimal also for non XML document
- if (name.charAt(1) == 'x') { // hexadecimal
- radix = 16;
- s = name.substring(2);
- }
- else { // decimal
- s = name.substring(1);
- }
- if (s == null || s.length() == 0)
- return null;
- if (s.charAt(0) == '-')
- return null; // no minus accepted
- char c = 0;
- try {
- c = (char) Integer.parseInt(s, radix);
- }
- catch (NumberFormatException ex) {
- }
- if (c == 0)
- return null;
- return String.valueOf(c);
- }
-
- // implicit character entities for XML
- if (name.equals(IXMLCharEntity.LT_NAME))
- return IXMLCharEntity.LT_VALUE;
- if (name.equals(IXMLCharEntity.GT_NAME))
- return IXMLCharEntity.GT_VALUE;
- if (name.equals(IXMLCharEntity.AMP_NAME))
- return IXMLCharEntity.AMP_VALUE;
- if (name.equals(IXMLCharEntity.QUOT_NAME))
- return IXMLCharEntity.QUOT_VALUE;
- if (isXMLType()) {
- if (name.equals(IXMLCharEntity.APOS_NAME))
- return IXMLCharEntity.APOS_VALUE;
- }
-
- CMDocument cm = getCMDocument();
- if (cm != null) {
- CMNamedNodeMap map = cm.getEntities();
- if (map != null) {
- CMEntityDeclaration decl = (CMEntityDeclaration) map.getNamedItem(name);
- if (decl != null) {
- String value = decl.getValue();
- if (value == null)
- return null;
- int valueLength = value.length();
- if (valueLength > 1 && value.charAt(0) == '&' && value.charAt(1) == '#' && value.charAt(valueLength - 1) == ';') {
- // character reference
- return getCharValue(value.substring(1, valueLength - 1));
- }
- return value;
- }
- }
- }
-
- return null;
- }
-
- /**
- */
- protected CMDocument getCMDocument() {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(this);
- if (modelQuery == null)
- return null;
- return modelQuery.getCorrespondingCMDocument(this);
- }
-
- /**
- * getDoctype method
- *
- * @return org.w3c.dom.DocumentType
- */
- public DocumentType getDoctype() {
- return findDoctype(this);
- }
-
- /**
- * getDocumentElement
- *
- * @return org.w3c.dom.Element From DOM 2 Spec: documentElement of type
- * Element [p.62] , readonly This is a convenience [p.119]
- * attribute that allows direct access to the child node that is
- * the root element of the document. For HTML documents, this is
- * the element with the tagName "HTML". Note: we differ from this
- * definition a little in that we don't necessarily take the first
- * child but also look to match the name. In a well formed
- * document, of course, the result is the same, but not
- * necessarily the same in an ill-formed document.
- */
- public Element getDocumentElement() {
- String name = null;
- DocumentType docType = getDocumentType();
- if (docType != null) {
- name = docType.getName();
- }
-
- Element first[] = new Element[1];
- Element docElement = findDocumentElement(name, this, first, noMaxSearch);
- if (docElement == null) {
- docElement = first[0];
- }
-
- return docElement;
- }
-
- /**
- */
- protected DocumentType getDocumentType() {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return getDoctype();
- return adapter.getDocumentType();
- }
-
-
- public String getDocumentTypeId() {
- DocumentType docType = getDocumentType();
- if (docType == null)
- return null;
- String id = docType.getPublicId();
- if (id == null)
- id = docType.getSystemId();
- return id;
- }
-
- public Element getElementById(String id) {
- if (id == null)
- return null;
- NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
- if (it == null)
- return null;
-
- for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- continue;
- ElementImpl element = (ElementImpl) node;
- if (element.hasAttribute("id") && id.equals(element.getAttribute("id"))) //$NON-NLS-1$ //$NON-NLS-2$
- return element;
- }
-
- return null;
- }
-
- public NodeList getElementsByTagName(String tagName) {
- if (tagName == null)
- return new NodeListImpl();
-
- NodeListImpl elements = null;
-
- if (usetagnamecache) {
- elements = tagNameCache.getItem(tagName);
- }
-
- if (elements == null) {
- elements = internalGetElementsByTagName(tagName);
-
- }
-
- return elements;
- }
-
- /**
- */
- public NodeList getElementsByTagNameNS(String uri, String tagName) {
- if (tagName == null)
- return new NodeListImpl();
-
- NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
- if (it == null)
- return new NodeListImpl();
- NodeListImpl elements = new NodeListImpl();
-
- if (uri != null && uri.length() == 1 && uri.charAt(0) == '*') {
- uri = null; // do not care
- }
- if (tagName.length() == 1 && tagName.charAt(0) == '*') {
- tagName = null; // do not care
- }
-
- for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- continue;
- ElementImpl element = (ElementImpl) node;
- if (tagName != null) {
- String localName = element.getLocalName();
- if (localName == null || !localName.equals(tagName))
- continue;
- }
- if (uri != null) {
- String nsURI = element.getNamespaceURI();
- if (nsURI == null || !nsURI.equals(uri))
- continue;
- }
- elements.appendNode(element);
- }
-
- return elements;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- *
- * @see DOM Level 3
- */
- public java.lang.String getEncoding() {
- return null;
- }
-
- /**
- */
- public DOMImplementation getImplementation() {
- return model;
- }
-
- /**
- * other nodes will be referring to this one to get the owning model
- */
- public IDOMModel getModel() {
- return model;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#document";//$NON-NLS-1$
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return DOCUMENT_NODE;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- *
- * @see DOM Level 3
- */
- public boolean getStandalone() {
- return false;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations, and
- * not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- *
- * @see DOM Level 3
- */
- public boolean getStrictErrorChecking() {
- return false;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- *
- * @see DOM Level 3
- */
- public String getVersion() {
- return null;
- }
-
- /**
- */
- protected boolean ignoreCase() {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return false;
- return (adapter.getTagNameCase() != DocumentTypeAdapter.STRICT_CASE);
- }
-
- /**
- */
- protected void importChildNodes(Node parent, boolean deep) {
- if (parent == null)
- return;
-
- removeChildNodes();
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- Node imported = importNode(child, deep);
- if (imported == null)
- continue;
- appendChild(imported);
- }
- }
-
- /**
- */
- public Node importNode(Node node, boolean deep) throws DOMException {
- if (node == null)
- return null;
- NodeImpl imported = (NodeImpl) node.cloneNode(deep);
- if (imported == null)
- return null;
- //successful import, notify UserDataHandlers if any
- NodeImpl nodeToNotify=(NodeImpl) node;
- nodeToNotify.notifyUserDataHandlers(UserDataHandler.NODE_IMPORTED, null);
- imported.setOwnerDocument(this, deep);
- return imported;
- }
-
- private NodeListImpl internalGetElementsByTagName(String tagName) {
- // System.out.println("getElementsByTagname: " + tagName);
- NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
- if (it == null)
- return new NodeListImpl();
- NodeListImpl elements = new NodeListImpl();
-
- if (tagName.length() == 1 && tagName.charAt(0) == '*') {
- tagName = null; // do not care
- }
-
- for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- continue;
- if (tagName != null) {
- ElementImpl element = (ElementImpl) node;
- if (!element.matchTagName(tagName))
- continue;
- }
- elements.appendNode(node);
- }
- if (usetagnamecache) {
- tagNameCache.addItem(tagName, elements);
- }
- return elements;
- }
-
- /**
- */
- public boolean isJSPDocument() {
- Element element = getDocumentElement();
- if (element == null)
- return false;
- String tagName = element.getTagName();
- if (tagName == null)
- return false;
- return tagName.equals(JSPTag.JSP_ROOT);
- }
-
- /**
- */
- public boolean isJSPType() {
- if (this.model == null)
- return false;
- IModelHandler handler = this.model.getModelHandler();
- if (handler == null)
- return false;
- String id = handler.getAssociatedContentTypeId();
- if (id == null)
- return false;
- // ISSUE: -- avoid this hardcoded string
- return id.equals("org.eclipse.jst.jsp.core.jspsource"); //$NON-NLS-1$
- }
-
- /**
- */
- protected boolean isValidName(String name) {
- if (name == null || name.length() == 0)
- return false;
- // // DMW: modified for XML4J 4.0.1
- // if (XMLChar.isValidName(name)) return true;
- if (NameValidator.isValid(name))
- return true;
- // special for invalid declaration
- if (name.length() == 1 && name.charAt(0) == '!')
- return true;
- // special for JSP tag in tag name
- if (name.startsWith(JSPTag.TAG_OPEN))
- return true;
- return false;
- }
-
- /**
- */
- public boolean isXMLType() {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return true;
- return adapter.isXMLType();
- }
-
- /**
- */
- // protected void releaseDocumentType() {
- // if (this.documentTypeAdapter == null)
- // return;
- // this.documentTypeAdapter.release();
- // this.documentTypeAdapter = null;
- // }
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- *
- * @see DOM Level 3
- */
- public void setEncoding(java.lang.String encoding) {
- }
-
- /**
- * setModel method
- *
- * @param model
- * XMLModel
- */
-
- protected void setModel(IDOMModel model) {
- this.model = (DOMModelImpl) model;
- }
-
- /**
- * Provides an element's attribute declarations
- * @param element the element to retrieve the attribute map of
- * @return a <code>CMNamedNodeMap</code> of attributes if the declaration exists; null otherwise.
- */
- CMNamedNodeMap getCMAttributes(Element element) {
- CMNamedNodeMap map = (CMNamedNodeMap) fCMCache.get(element);
- if (map == null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(this);
- CMElementDeclaration decl = modelQuery != null ? modelQuery.getCMElementDeclaration(element) : null;
- if (decl != null) {
- map = decl.getAttributes();
- fCMCache.put(element, map);
- }
- }
- return map;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- *
- * @see DOM Level 3
- */
- public void setStandalone(boolean standalone) {
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations, and
- * not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- *
- * @see DOM Level 3
- */
- public void setStrictErrorChecking(boolean strictErrorChecking) {
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- *
- * @see DOM Level 3
- */
- public void setVersion(java.lang.String version) {
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public String getInputEncoding() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public String getXmlEncoding() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public boolean getXmlStandalone() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public String getXmlVersion() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setXmlVersion(String xmlVersion) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public String getDocumentURI() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setDocumentURI(String documentURI) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public DOMConfiguration getDomConfig() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void normalizeDocument() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java
deleted file mode 100644
index d2167048dd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java
+++ /dev/null
@@ -1,51 +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.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.DocumentType;
-
-
-/**
- */
-public interface DocumentTypeAdapter extends INodeAdapter {
- static final int LOWER_CASE = 2;
- static final int STRICT_CASE = 0;
- static final int UPPER_CASE = 1;
-
- /**
- */
- int getAttrNameCase();
-
- /**
- */
- DocumentType getDocumentType();
-
- /**
- */
- int getTagNameCase();
-
- /**
- */
- boolean hasFeature(String feature);
-
- /**
- */
- boolean isXMLType();
-
- /**
- */
- void release();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java
deleted file mode 100644
index 29c3e95c44..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java
+++ /dev/null
@@ -1,119 +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.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DocumentType;
-
-
-/**
- */
-public class DocumentTypeAdapterImpl implements DocumentTypeAdapter {
-
- private IDOMDocument document = null;
- private DocumentType documentType = null;
-
- /**
- */
- protected DocumentTypeAdapterImpl() {
- super();
- }
-
- /**
- */
- protected DocumentTypeAdapterImpl(IDOMDocument document) {
- this.document = document;
- if (document != null) {
- this.documentType = document.getDoctype();
- }
- }
-
- /**
- */
- public int getAttrNameCase() {
- return STRICT_CASE;
- }
-
- /**
- */
- protected IDOMDocument getDocument() {
- return this.document;
- }
-
- /**
- */
- public DocumentType getDocumentType() {
- return this.documentType;
- }
-
- /**
- */
- public int getTagNameCase() {
- return STRICT_CASE;
- }
-
- /**
- */
- public boolean hasFeature(String feature) {
- return false;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == DocumentTypeAdapter.class);
- }
-
- /**
- */
- public boolean isXMLType() {
- return true;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (eventType != INodeNotifier.STRUCTURE_CHANGED)
- return;
- if (notifier == null || !(notifier instanceof IDOMDocument))
- return;
- this.documentType = ((IDOMDocument) notifier).getDoctype();
- }
-
- /**
- */
- protected void notifyDocumentTypeChanged() {
- if (this.document == null)
- return;
- IDOMModel model = this.document.getModel();
- if (model == null)
- return;
- ((DOMModelImpl) model).documentTypeChanged();
- }
-
- /**
- */
- public void release() {
- // nothing to do
- }
-
- /**
- */
- protected void setDocumentType(DocumentType documentType) {
- this.documentType = documentType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
deleted file mode 100644
index 5ff86bf393..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * DocumentType class
- */
-public class DocumentTypeImpl extends NodeImpl implements IDOMDocumentType {
- private String internalSubset = null;
-
- private String name = null;
- private String publicId = null;
- private String systemId = null;
-
- /**
- * DocumentTypeImpl constructor
- */
- protected DocumentTypeImpl() {
- super();
- }
-
- /**
- * DocumentTypeImpl constructor
- *
- * @param that
- * DocumentTypeImpl
- */
- protected DocumentTypeImpl(DocumentTypeImpl that) {
- super(that);
-
- if (that != null) {
- this.name = that.name;
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- DocumentTypeImpl cloned = new DocumentTypeImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getEntities method
- *
- * @return org.w3c.dom.NamedNodeMap
- */
- public NamedNodeMap getEntities() {
- return null;
- }
-
- /**
- */
- public String getInternalSubset() {
- return this.internalSubset;
- }
-
- /**
- * getName method
- *
- * @return java.lang.String
- */
- public String getName() {
- if (this.name == null)
- return NodeImpl.EMPTY_STRING;
- return this.name;
- }
-
- /**
- * getNodeName
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return getName();
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return DOCUMENT_TYPE_NODE;
- }
-
- /**
- * getNotations method
- *
- * @return org.w3c.dom.NamedNodeMap
- */
- public NamedNodeMap getNotations() {
- return null;
- }
-
- /**
- * getPublicId method
- *
- * @return java.lang.String
- */
- public String getPublicId() {
- return this.publicId;
- }
-
- /**
- * getSystemId method
- *
- * @return java.lang.String
- */
- public String getSystemId() {
- return this.systemId;
- }
-
- /**
- */
- public boolean isClosed() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- return (regionType == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
- }
-
- /**
- */
- public void setInternalSubset(String internalSubset) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.internalSubset = internalSubset;
- }
-
- /**
- * setName method
- *
- * @param name
- * java.lang.String
- */
- protected void setName(String name) {
- this.name = name;
- }
-
- /**
- * setPublicId method
- *
- * @param publicId
- * java.lang.String
- */
- public void setPublicId(String publicId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.publicId = publicId;
-
- notifyValueChanged();
- }
-
- /**
- * setSystemId method
- *
- * @param systemId
- * java.lang.String
- */
- public void setSystemId(String systemId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.systemId = systemId;
-
- notifyValueChanged();
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(getName());
- buffer.append('(');
- buffer.append(getPublicId());
- buffer.append(')');
- buffer.append('(');
- buffer.append(getSystemId());
- buffer.append(')');
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode != null) {
- buffer.append('@');
- buffer.append(flatNode.toString());
- }
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
deleted file mode 100644
index 8e5121e572..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
+++ /dev/null
@@ -1,1552 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- *
- * Valentin Baciu - https://bugs.eclipse.org/bugs/show_bug.cgi?id=139552
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.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.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLNamespace;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-
-/**
- * ElementImpl class
- */
-public class ElementImpl extends NodeContainer implements IDOMElement {
-
- private class Attributes implements NamedNodeMap {
- Attributes() {
- super();
- }
-
- public int getLength() {
- if (attrNodes == null)
- return 0;
- return attrNodes.getLength();
- }
-
- public Node getNamedItem(String name) {
- return getAttributeNode(name);
- }
-
- public Node getNamedItemNS(String uri, String name) {
- return getAttributeNodeNS(uri, name);
- }
-
- public Node item(int index) {
- if (attrNodes == null)
- return null;
- if (index >= attrNodes.getLength())
- return null;
- return attrNodes.item(index);
- }
-
- public Node removeNamedItem(String name) throws DOMException {
- return removeAttributeNode(name);
- }
-
- public Node removeNamedItemNS(String uri, String name) throws DOMException {
- return removeAttributeNodeNS(uri, name);
- }
-
- public Node setNamedItem(Node arg) throws DOMException {
- return setAttributeNode((AttrImpl) arg);
- }
-
- public Node setNamedItemNS(Node arg) throws DOMException {
- return setAttributeNodeNS((AttrImpl) arg);
- }
- }
-
-// private static final char[] XMLNS_PREFIX = IXMLNamespace.XMLNS_PREFIX.toCharArray();
- private static final byte FLAG_COMMENT = 0x1;
- private static final byte FLAG_EMPTY = 0x2;
- private static final byte FLAG_JSP = 0x4;
-
- private byte fTagFlags = 0;
-
- NodeListImpl attrNodes = null;
- private IStructuredDocumentRegion endStructuredDocumentRegion = null;
-
- private char[] fTagName = null;
-
- private char[] fNamespaceURI = null;
-
- private Stack fDefaultValueLookups = null;
-
- /**
- * ElementImpl constructor
- */
- protected ElementImpl() {
- super();
- }
-
- /**
- * ElementImpl constructor
- *
- * @param that
- * ElementImpl
- */
- protected ElementImpl(ElementImpl that) {
- super(that);
-
- if (that != null) {
- this.fTagName = that.fTagName;
- this.fTagFlags = that.fTagFlags;
-
- // clone attributes
- that.cloneAttributes(this);
- }
- }
-
- /**
- * addEndTag method
- *
- * @param end
- * org.w3c.dom.Element
- */
- protected void addEndTag(Element endTag) {
- if (endTag == null)
- return;
- if (hasEndTag())
- return;
- ElementImpl end = (ElementImpl) endTag;
-
- // move the end flat node from the end tag
- IStructuredDocumentRegion flatNode = end.getEndStructuredDocumentRegion();
- if (flatNode == null)
- return;
- end.setEndStructuredDocumentRegion(null);
- setEndStructuredDocumentRegion(flatNode);
- }
-
- /**
- * appendAttibuteNode method
- *
- * @return org.w3c.dom.Attr
- * @param newAttr
- * org.w3c.dom.Attr
- */
- public Attr appendAttributeNode(Attr newAttr) {
- if (newAttr == null)
- return null;
- AttrImpl attr = (AttrImpl) newAttr;
- if (attr.getOwnerElement() != null)
- return null;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (this.attrNodes == null)
- this.attrNodes = new NodeListImpl();
- this.attrNodes.appendNode(attr);
- attr.setOwnerElement(this);
-
- notifyAttrReplaced(attr, null);
- return attr;
- }
-
- /**
- * cloneAttributes method
- *
- * @param newOwner
- * org.w3c.dom.Element
- */
- protected void cloneAttributes(Element newOwner) {
- if (newOwner == null || newOwner == this)
- return;
-
- ElementImpl element = (ElementImpl) newOwner;
- element.removeAttributes();
-
- if (this.attrNodes == null)
- return;
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- Node node = this.attrNodes.item(i);
- if (node == null)
- continue;
- Attr cloned = (Attr) node.cloneNode(false);
- if (cloned != null)
- element.appendAttributeNode(cloned);
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- ElementImpl cloned = newInstance();
- if (deep)
- cloneChildNodes(cloned, deep);
-
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- protected ElementImpl newInstance() {
- return new ElementImpl(this);
- }
-
- /**
- * getAttribute method
- *
- * @return java.lang.String
- * @param name
- * java.lang.String
- */
- public String getAttribute(String name) {
- Attr attr = getAttributeNode(name);
- // In the absence of the attribute, get the default value
- if (attr == null) {
- final String defaultValue = getDefaultValue(name, NodeImpl.EMPTY_STRING);
- return defaultValue != null ? defaultValue : NodeImpl.EMPTY_STRING ;
- }
- return attr.getValue();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNode(java.lang.String)
- */
- public Attr getAttributeNode(String name) {
- if (name == null)
- return null; // invalid parameter
- if (this.attrNodes == null)
- return null; // no attribute
-
- final Attr attr = findAttributeNode(name);
- if (attr != null)
- return attr;
-
- String implied = getDefaultValue(name, null);
- if (implied != null) {
- Attr createdAttribute = getOwnerDocument().createAttribute(name);
- createdAttribute.setNodeValue(implied);
- ((AttrImpl) createdAttribute).setOwnerElement(this);
- return createdAttribute;
- }
-
- return null; // not found
- }
-
- /**
- * Finds an attribute node in this element's attribute nodelist
- * @param name the name of the attribute to find
- * @return The {@link Attr} whose name matches <code>name</code>. Returns null if an attribute by <code>name</code>
- * could not be found.
- */
- private Attr findAttributeNode(String name) {
- if (attrNodes == null)
- return null; // no attribute
-
- int length = attrNodes.getLength();
- char[] nameChars = name.toCharArray();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) attrNodes.item(i);
- if (attr == null)
- continue;
- if (attr.matchName(nameChars))
- return attr; // found
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNodeNS(java.lang.String, java.lang.String)
- */
- public Attr getAttributeNodeNS(String uri, String name) {
- if (name == null)
- return null; // invalid parameter
- if (this.attrNodes == null)
- return null; // no attribute
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr == null)
- continue;
- String localName = attr.getLocalName();
- if (localName == null || !localName.equals(name))
- continue;
- String nsURI = attr.getNamespaceURI();
- if (uri == null) {
- if (nsURI != null)
- continue;
- }
- else {
- if (nsURI == null || !nsURI.equals(uri))
- continue;
- }
-
- // found
- return attr;
- }
-
- return null; // not found
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#getAttributeNS(java.lang.String, java.lang.String)
- */
- public String getAttributeNS(String uri, String name) {
- Attr attr = getAttributeNodeNS(uri, name);
- // In the absence of the attribute, get the default value
- if (attr == null) {
- final String defaultValue = getDefaultValue(name, NodeImpl.EMPTY_STRING);
- return defaultValue != null ? defaultValue : NodeImpl.EMPTY_STRING;
- }
- return attr.getValue();
- }
-
- /**
- * getAttributes method
- *
- * @return org.w3c.dom.NamedNodeMap
- */
- public NamedNodeMap getAttributes() {
- return new Attributes();
- }
-
- /**
- */
- protected CMElementDeclaration getDeclaration() {
- Document document = getOwnerDocument();
- if (document == null)
- return null;
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- return null;
- return modelQuery.getCMElementDeclaration(this);
- }
-
- /**
- * Get the implied default value for attribute <code>name</code>
- *
- * @param name
- * @return returns the default value for attribute <code>name</code> if it
- * is found in the content model, <code>unknownDefault</code> otherwise
- */
- private String getDefaultValue(String name, String unknownDefault) {
- if (fDefaultValueLookups != null && fDefaultValueLookups.contains(name))
- return null;
- try {
- if (fDefaultValueLookups == null)
- fDefaultValueLookups = new Stack();
- fDefaultValueLookups.push(name);
- CMNamedNodeMap map = ((DocumentImpl) getOwnerDocument()).getCMAttributes(this);
- if (map != null) {
- CMNode attribute = map.getNamedItem(name);
- if (attribute instanceof CMAttributeDeclaration)
- return ((CMAttributeDeclaration) attribute).getAttrType().getImpliedValue();
- }
- return unknownDefault;
- }
- finally {
- fDefaultValueLookups.pop();
- }
- }
-
- /**
- * getElementsByTagName method
- *
- * @return org.w3c.dom.NodeList
- * @param tagName
- * java.lang.String
- */
- public NodeList getElementsByTagName(String tagName) {
- if (tagName == null)
- return new NodeListImpl();
-
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document == null)
- return new NodeListImpl();
- NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
- if (it == null)
- return new NodeListImpl();
- NodeListImpl elements = new NodeListImpl();
-
- if (tagName.length() == 1 && tagName.charAt(0) == '*') {
- tagName = null; // do not care
- }
-
- it.nextNode(); // skip the first node since it is the root from createNodeIterator
- for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- continue;
- if (tagName != null) {
- ElementImpl element = (ElementImpl) node;
- if (!element.matchTagName(tagName))
- continue;
- }
- elements.appendNode(node);
- }
-
- return elements;
- }
-
- /**
- */
- public NodeList getElementsByTagNameNS(String uri, String tagName) {
- if (tagName == null)
- return new NodeListImpl();
-
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document == null)
- return new NodeListImpl();
- NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false);
- if (it == null)
- return new NodeListImpl();
- NodeListImpl elements = new NodeListImpl();
-
- if (uri != null && uri.length() == 1 && uri.charAt(0) == '*') {
- uri = null; // do not care
- }
- if (tagName.length() == 1 && tagName.charAt(0) == '*') {
- tagName = null; // do not care
- }
-
- it.nextNode(); // skip the first node since it is the root from createNodeIterator
- for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- continue;
- ElementImpl element = (ElementImpl) node;
- if (tagName != null) {
- String localName = element.getLocalName();
- if (localName == null || !localName.equals(tagName))
- continue;
- }
- if (uri != null) {
- String nsURI = element.getNamespaceURI();
- if (nsURI == null || !nsURI.equals(uri))
- continue;
- }
- elements.appendNode(element);
- }
-
- return elements;
- }
-
- /**
- * getEndOffset method
- *
- * @return int
- */
- public int getEndOffset() {
- if (this.endStructuredDocumentRegion != null)
- return this.endStructuredDocumentRegion.getEnd();
- return super.getEndOffset();
- }
-
- /**
- * getEndStartOffset method
- *
- * @return int
- */
- public int getEndStartOffset() {
- if (this.endStructuredDocumentRegion != null)
- return this.endStructuredDocumentRegion.getStart();
- return super.getEndOffset();
- }
-
- /**
- * getEndStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getEndStructuredDocumentRegion() {
- return this.endStructuredDocumentRegion;
- }
-
- public String getEndTagName() {
- if (this.endStructuredDocumentRegion == null)
- return null;
-
- ITextRegionList regions = this.endStructuredDocumentRegion.getRegions();
- if (regions == null)
- return null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedEndTag(regionType)) {
- return this.endStructuredDocumentRegion.getText(region);
- }
- }
-
- return null;
- }
-
- protected boolean isNestedEndTag(String regionType) {
- boolean result = false;
- return result;
- }
-
- /**
- * getFirstStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode != null)
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(flatNode);
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.endStructuredDocumentRegion);
- }
-
- /**
- * getLastStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- if (this.endStructuredDocumentRegion != null)
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.endStructuredDocumentRegion);
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(getStructuredDocumentRegion());
- }
-
- /**
- */
- public String getLocalName() {
- if (this.fTagName == null)
- return null;
- int index = CharOperation.indexOf(this.fTagName, ':');
- if (index < 0)
- return new String(this.fTagName);
- return new String(this.fTagName, index + 1, this.fTagName.length - index - 1);
- }
-
- public String getNamespaceURI() {
- if (this.fNamespaceURI != null)
- return new String(this.fNamespaceURI);
-
- String nsAttrName = null;
- String prefix = getPrefix();
- if (prefix != null && prefix.length() > 0) {
- nsAttrName = IXMLNamespace.XMLNS_PREFIX + prefix;
- }
- else {
- nsAttrName = IXMLNamespace.XMLNS;
- }
-
- for (Node node = this; node != null; node = node.getParentNode()) {
- if (node.getNodeType() != ELEMENT_NODE)
- break;
- Element element = (Element) node;
- Attr attr = element.getAttributeNode(nsAttrName);
- if (attr != null)
- return attr.getValue();
- }
-
- return null;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return getTagName();
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return ELEMENT_NODE;
- }
-
- /**
- */
- public String getPrefix() {
- if (this.fTagName == null)
- return null;
- int index = CharOperation.indexOf(this.fTagName, ':');
- if (index <= 0)
- return null;
- // exclude JSP tag in name
- if (this.fTagName[0] == '<')
- return null;
- return new String(this.fTagName, 0, index);
- }
-
- /**
- * getStartEndOffset method
- *
- * @return int
- */
- public int getStartEndOffset() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode != null)
- return flatNode.getEnd();
- return super.getStartOffset();
- }
-
- /**
- * getStartOffset method
- *
- * @return int
- */
- public int getStartOffset() {
- if (getStartStructuredDocumentRegion() == null && this.endStructuredDocumentRegion != null && !hasChildNodes()) {
- return this.endStructuredDocumentRegion.getStart();
- }
- return super.getStartOffset();
- }
-
- /**
- * getStartStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getStartStructuredDocumentRegion() {
- return getStructuredDocumentRegion();
- }
-
- /**
- * getTagName method
- *
- * @return java.lang.String
- */
- public String getTagName() {
- if (this.fTagName == null)
- return NodeImpl.EMPTY_STRING;
- return new String(fTagName);
- }
-
- /**
- */
- public boolean hasAttribute(String name) {
- return (getAttributeNode(name) != null);
- }
-
- /**
- */
- public boolean hasAttributeNS(String uri, String name) {
- return (getAttributeNodeNS(uri, name) != null);
- }
-
- /**
- */
- public boolean hasAttributes() {
- return (this.attrNodes != null && this.attrNodes.getLength() > 0);
- }
-
- /**
- * hasEndTag method
- *
- * @return boolean
- */
- public boolean hasEndTag() {
- return (this.endStructuredDocumentRegion != null);
- }
-
- /**
- */
- protected final boolean hasPrefix() {
- if (this.fTagName == null || this.fTagName.length == 0)
- return false;
- return CharOperation.indexOf(this.fTagName, ':') > 0 && this.fTagName[0] != '<';
- }
-
- /**
- * hasStartTag method
- *
- * @return boolean
- */
- public boolean hasStartTag() {
- return (getStructuredDocumentRegion() != null);
- }
-
- /**
- */
- protected final boolean ignoreCase() {
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document != null && document.ignoreCase()) {
- // even in case insensitive document, if having prefix, it's case
- // sensitive tag
- return !hasPrefix();
- }
- return false;
- }
-
- /**
- */
- protected Attr insertAttributeNode(Attr newAttr, int index) {
- if (newAttr == null)
- return null;
- AttrImpl attr = (AttrImpl) newAttr;
- if (attr.getOwnerElement() != null)
- return null;
-
- if (this.attrNodes == null)
- this.attrNodes = new NodeListImpl();
- this.attrNodes.insertNode(attr, index);
- attr.setOwnerElement(this);
-
- notifyAttrReplaced(attr, null);
- return attr;
- }
-
- /**
- * insertBefore method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param refChild
- * org.w3c.dom.Node
- */
- public Node insertBefore(Node newChild, Node refChild) throws DOMException {
- // should throw DOMException instead of return null?
- if (newChild == null)
- return null;
- if (!isContainer()) { // never be container
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
- if (newChild.getNodeType() != TEXT_NODE && newChild.getNodeType() != CDATA_SECTION_NODE) {
- if (isJSPContainer() || isCDATAContainer()) { // accepts only
- // Text
- // child
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
- }
- return super.insertBefore(newChild, refChild);
- }
-
- /**
- */
- protected boolean isCDATAContainer() {
- // use BlockMaker instead of CMElementDeclaration
- // because <style> and <script> in XHTML is not CDATA content type
- IDOMModel model = getModel();
- if (model == null)
- return false; // error
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null || fTagName == null)
- return false; // eror
- RegionParser parser = structuredDocument.getParser();
- if (parser == null || !(parser instanceof XMLSourceParser))
- return false;
- return (((XMLSourceParser) parser).getBlockMarker(new String(this.fTagName)) != null);
- /*
- * CMElementDeclaration decl = getDeclaration(); if (decl == null)
- * return false; if (decl instanceof CMNodeWrapper) { decl =
- * (CMElementDeclaration)((CMNodeWrapper)decl).getOriginNode(); if
- * (decl == null) return false; } if (decl instanceof
- * TLDElementDeclaration) { String content =
- * ((TLDElementDeclaration)decl).getBodycontent(); if (content ==
- * null) return false; return
- * content.equals(JSP11TLDNames.CONTENT_TAGDEPENDENT); } if
- * (!isGlobalTag()) return false; return (decl.getContentType() ==
- * CMElementDeclaration.CDATA);
- */
- }
-
- /**
- */
- public boolean isClosed() {
- IStructuredDocumentRegion flatNode = null;
- if (isEmptyTag() || !isContainer()) {
- flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- }
- else {
- flatNode = getEndStructuredDocumentRegion();
- if (flatNode == null)
- return false; // must be generated
- }
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- if (isCommentTag()) {
- return (isNestedClosedComment(regionType) || regionType == DOMRegionContext.XML_COMMENT_CLOSE);
- }
- if (isJSPTag()) {
- return isNestedClosed(regionType);
- }
- return (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
- }
-
- protected boolean isNestedClosed(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected boolean isNestedClosedComment(String regionType) {
- boolean result = false;
- return result;
- }
-
- /**
- */
- public final boolean isCommentTag() {
- return (fTagFlags & FLAG_COMMENT) != 0;
- }
-
- /**
- * isContainer method
- *
- * @return boolean
- */
- public boolean isContainer() {
- if (isCommentTag()) {
- CommentElementAdapter adapter = (CommentElementAdapter) getAdapterFor(CommentElementAdapter.class);
- if (adapter != null) {
- return (adapter.isContainer());
- }
- return (getDeclaration() == null);
- }
- if (isJSPTag()) {
- // exclude JSP directive
- return (matchTagName(JSPTag.JSP_SCRIPTLET) || matchTagName(JSPTag.JSP_DECLARATION) || matchTagName(JSPTag.JSP_EXPRESSION));
- }
- if (!isXMLTag()) { // non-XML tag
- CMElementDeclaration decl = getDeclaration();
- if (decl == null)
- return true; // undefined tag
- return (decl.getContentType() != CMElementDeclaration.EMPTY);
- }
- return true;
- }
-
- /**
- * isEmptyTag method
- *
- * @return boolean
- */
- public boolean isEmptyTag() {
- if (isJSPTag())
- return false;
- if (isCommentTag())
- return false;
- if (!isXMLTag())
- return false;
- return (fTagFlags & FLAG_EMPTY) != 0;
- }
-
- /**
- */
- public boolean isEndTag() {
- return (hasEndTag() && !hasStartTag() && !hasChildNodes());
- }
-
- /**
- */
- public boolean isGlobalTag() {
- return !hasPrefix();
- }
-
- /**
- */
- public boolean isImplicitTag() {
- if (hasStartTag() || hasEndTag())
- return false;
- // make sure this is in the document tree
- // because if not in the document tree, no tags are generated yet
- return (getContainerDocument() != null);
- }
-
- /**
- */
- public boolean isJSPContainer() {
- return (isJSPTag() && !isCommentTag() && isContainer());
- }
-
- /**
- * isJSPTag method
- *
- * @return boolean
- */
- public final boolean isJSPTag() {
- return (fTagFlags & FLAG_JSP) != 0;
- }
-
- /**
- */
- public boolean isStartTagClosed() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- if (isCommentTag()) {
- return (isNestedClosedComment(regionType) || regionType == DOMRegionContext.XML_COMMENT_CLOSE);
- }
- if (isJSPTag()) {
- if (isContainer())
- return true; // start tag always has a single region
- return isClosedNestedDirective(regionType);
- }
- return (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE);
- }
-
- protected boolean isClosedNestedDirective(String regionType) {
- boolean result = false;
- return result;
- }
-
- /**
- */
- public final boolean isXMLTag() {
- if (isJSPTag())
- return false;
- if (isCommentTag())
- return false;
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document != null && !document.isXMLType()) {
- // even in non-XML document, if having prefix, it's XML tag
- return hasPrefix();
- }
- return true;
- }
-
- /**
- */
- protected boolean matchEndTag(Element element) {
- if (element == null)
- return false;
- ElementImpl impl = (ElementImpl) element;
- if (isJSPTag() && !isCommentTag()) {
- return (impl.isJSPTag() && !impl.isCommentTag());
- }
- return matchTagName(element.getTagName());
- }
-
- /**
- * matchTagName method
- *
- * @return boolean
- * @param tagName
- * java.lang.String
- */
- public boolean matchTagName(String tagName) {
- if (tagName == null)
- return (this.fTagName == null);
- if (this.fTagName == null)
- return false;
- if (this.fTagName.length != tagName.length())
- return false;
- String stringName = new String(this.fTagName);
- if (!ignoreCase())
- return stringName.equals(tagName);
- return stringName.equalsIgnoreCase(tagName);
- }
-
- /**
- * notifyAttrReplaced method
- *
- * @param newAttr
- * org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- protected void notifyAttrReplaced(Attr newAttr, Attr oldAttr) {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.attrReplaced(this, newAttr, oldAttr);
- }
-
- /**
- * notifyValueChanged method
- */
- public void notifyEndTagChanged() {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.endTagChanged(this);
- }
-
- /**
- */
- public void notifyStartTagChanged() {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.startTagChanged(this);
- }
-
- /**
- */
- public boolean preferEmptyTag() {
- if (hasChildNodes())
- return false;
- if (isJSPTag())
- return false;
- if (isCommentTag())
- return false;
- if (!isXMLTag())
- return false;
- CMElementDeclaration decl = getDeclaration();
- if (decl == null)
- return false;
- return (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#removeAttribute(java.lang.String)
- */
- public void removeAttribute(String name) throws DOMException {
- removeAttributeNode(name, false);
- }
-
- /**
- * removeAttributeNode method
- *
- * @return org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
- if (oldAttr == null)
- return null; // invalid parameter
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (this.attrNodes == null) { // no attribute
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- }
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr != oldAttr)
- continue;
-
- // found
- this.attrNodes.removeNode(i);
- attr.setOwnerElement(null);
-
- notifyAttrReplaced(null, attr);
- return attr;
- }
-
- // not found
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- }
-
- /**
- * @param name
- * @return
- */
- public Attr removeAttributeNode(String name) {
- return removeAttributeNode(name, true);
- }
-
- private Attr removeAttributeNode(String name, boolean exceptionOnNotFound) {
- if (name == null)
- return null; // invalid parameter
- if (this.attrNodes == null)
- return null; // no attribute
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr == null)
- continue;
- if (!attr.matchName(name))
- continue;
-
- // found
- this.attrNodes.removeNode(i);
- attr.setOwnerElement(null);
-
- notifyAttrReplaced(null, attr);
- return attr;
- }
-
- if (exceptionOnNotFound)
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- return null; // not found
- }
-
- /**
- */
- public Attr removeAttributeNodeNS(String uri, String name) {
- if (name == null)
- return null; // invalid parameter
- if (this.attrNodes == null)
- return null; // no attribute
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr == null)
- continue;
- String localName = attr.getLocalName();
- if (localName == null || !localName.equals(name))
- continue;
- String nsURI = attr.getNamespaceURI();
- if (uri == null) {
- if (nsURI != null)
- continue;
- }
- else {
- if (nsURI == null || !nsURI.equals(uri))
- continue;
- }
-
- // found
- this.attrNodes.removeNode(i);
- attr.setOwnerElement(null);
-
- notifyAttrReplaced(null, attr);
- return attr;
- }
-
- return null; // not found
- }
-
- /**
- */
- public void removeAttributeNS(String uri, String name) throws DOMException {
- removeAttributeNodeNS(uri, name);
- }
-
- /**
- * removeAttributes method
- */
- public void removeAttributes() {
- if (this.attrNodes == null)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr != null) {
- attr.setOwnerElement(null);
- notifyAttrReplaced(null, attr);
- }
- }
-
- this.attrNodes = null;
- }
-
- /**
- * removeEndTag method
- *
- * @return org.w3c.dom.Element
- */
- protected Element removeEndTag() {
- if (!hasEndTag())
- return null;
- NodeListImpl attrNodes = this.attrNodes;
- this.attrNodes = null; // not to copy attributes
- ElementImpl end = (ElementImpl) cloneNode(false);
- this.attrNodes = attrNodes;
- if (end == null)
- return null;
-
- // move the end flat node to the end tag
- IStructuredDocumentRegion flatNode = getEndStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- setEndStructuredDocumentRegion(null);
- end.setEndStructuredDocumentRegion(flatNode);
- return end;
- }
-
- /**
- */
- protected void removeStartTag() {
- removeAttributes();
- }
-
- /**
- * Resets attribute values from IStructuredDocumentRegion.
- */
- void resetStructuredDocumentRegions() {
- if (this.attrNodes != null) {
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr == null)
- continue;
- attr.resetRegions();
- }
- }
-
- super.resetStructuredDocumentRegions(); // for children
-
- this.endStructuredDocumentRegion = null;
- }
-
- /**
- * setAttribute method
- *
- * @param name
- * java.lang.String
- * @param value
- * java.lang.String
- */
- public void setAttribute(String name, String value) throws DOMException {
- if (name == null)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- Attr attr = findAttributeNode(name);
- if (attr != null) {
- attr.setValue(value); // change value
- return;
- }
-
- // new attribute
- Document doc = getOwnerDocument();
- if (doc == null)
- return;
- attr = doc.createAttribute(name);
- if (attr == null)
- return;
- attr.setValue(value);
- appendAttributeNode(attr);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr)
- */
- public Attr setAttributeNode(Attr newAttr) throws DOMException {
- if (newAttr == null)
- return null; // nothing to do
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- AttrImpl attr = (AttrImpl) newAttr;
- Element owner = attr.getOwnerElement();
- if (owner != null) {
- if (owner == this)
- return null; // nothing to do
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, DOMMessages.INUSE_ATTRIBUTE_ERR);
- }
-
- Attr oldAttr = removeAttributeNode(newAttr.getName(), false);
- appendAttributeNode(attr);
- return oldAttr;
- }
-
- /**
- */
- public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
- if (newAttr == null)
- return null; // nothing to do
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- AttrImpl attr = (AttrImpl) newAttr;
- Element owner = attr.getOwnerElement();
- if (owner != null) {
- if (owner == this)
- return null; // nothing to do
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, DOMMessages.INUSE_ATTRIBUTE_ERR);
- }
-
- String name = newAttr.getLocalName();
- String uri = newAttr.getNamespaceURI();
- Attr oldAttr = removeAttributeNodeNS(uri, name);
- appendAttributeNode(attr);
- return oldAttr;
- }
-
- /**
- * ISSUE: we should check for and throw NAMESPACE_ERR, according to spec.
- */
- public void setAttributeNS(String uri, String qualifiedName, String value) throws DOMException {
- if (qualifiedName == null)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139552
- // fix provided by Valentin Baciu
- int index = qualifiedName.indexOf(':');
- String localName = index != -1 ? qualifiedName.substring(index + 1) : qualifiedName;
-
- Attr attr = getAttributeNodeNS(uri, localName);
- if (attr != null) {
- attr.setValue(value); // change value
- }
- else {
-
- // new attribute
- Document doc = getOwnerDocument();
- if (doc != null) {
- attr = doc.createAttributeNS(uri, qualifiedName);
- if (attr != null) {
- attr.setValue(value);
- appendAttributeNode(attr);
- }
- }
- }
- }
-
- /**
- */
- public void setCommentTag(boolean isCommentTag) {
- IDOMNode parent = (IDOMNode) getParentNode();
- if (parent != null && !parent.isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (isCommentTag)
- fTagFlags |= FLAG_COMMENT;
- else
- fTagFlags &= ~FLAG_COMMENT;
- }
-
- /**
- * setEmptyTag method
- *
- * @param isEmptyTag
- * boolean
- */
- public void setEmptyTag(boolean isEmptyTag) {
- IDOMNode parent = (IDOMNode) getParentNode();
- if (parent != null && !parent.isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (isEmptyTag)
- fTagFlags |= FLAG_EMPTY;
- else
- fTagFlags &= ~FLAG_EMPTY;
- }
-
- /**
- * setEndStructuredDocumentRegion method
- *
- * @param flatNode
- */
- void setEndStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- this.endStructuredDocumentRegion = flatNode;
-
- NodeContainer parent = (NodeContainer) getParentNode();
- if (parent != null) {
- parent.syncChildEditableState(this);
- }
- }
-
- /**
- * setJSPTag method
- *
- * @param isJSPTag
- * boolean
- */
- public void setJSPTag(boolean isJSPTag) {
- IDOMNode parent = (IDOMNode) getParentNode();
- if (parent != null && !parent.isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, NodeImpl.EMPTY_STRING);
- }
-
- if (isJSPTag)
- fTagFlags |= FLAG_JSP;
- else
- fTagFlags &= ~FLAG_JSP;
- }
-
- protected void setNamespaceURI(String namespaceURI) {
- if (namespaceURI == null)
- this.fNamespaceURI = null;
- else
- this.fNamespaceURI = namespaceURI.toCharArray();
- }
-
- /**
- */
- protected void setOwnerDocument(Document ownerDocument, boolean deep) {
- super.setOwnerDocument(ownerDocument, deep);
-
- if (this.attrNodes == null)
- return;
-
- int length = this.attrNodes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
- if (attr == null)
- continue;
- attr.setOwnerDocument(ownerDocument);
- }
- }
-
- /**
- */
- public void setPrefix(String prefix) throws DOMException {
- IDOMNode parent = (IDOMNode) getParentNode();
- if (parent != null && !parent.isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, NodeImpl.EMPTY_STRING);
- }
-
- int prefixLength = (prefix != null ? prefix.length() : 0);
- String localName = getLocalName();
- if (prefixLength == 0) {
- if (localName == null || localName.length() == 0) {
- // invalid local name
- return;
- }
- setTagName(localName);
- }
- else {
- int localLength = (localName != null ? localName.length() : 0);
- StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength);
- buffer.append(prefix);
- buffer.append(':');
- if (localName != null)
- buffer.append(localName);
- setTagName(buffer.toString());
- }
-
- boolean changeEndTag = hasEndTag();
- notifyStartTagChanged();
- if (changeEndTag)
- notifyEndTagChanged();
- }
-
- /**
- * setStartStructuredDocumentRegion method
- *
- * @param flatNode
- */
- void setStartStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- setStructuredDocumentRegion(flatNode);
- }
-
- /**
- * setTagName method
- *
- * @param tagName
- * java.lang.String
- */
- protected void setTagName(String tagName) {
- this.fTagName = tagName != null ? CharacterStringPool.getCharString(tagName) : null;
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- String tagName = getTagName();
- if (hasStartTag())
- buffer.append(tagName);
- if (isEmptyTag())
- buffer.append('/');
- if (hasEndTag()) {
- buffer.append('/');
- buffer.append(tagName);
- }
- if (buffer.length() == 0)
- buffer.append(tagName);
-
- IStructuredDocumentRegion startStructuredDocumentRegion = getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- buffer.append('@');
- buffer.append(startStructuredDocumentRegion.toString());
- }
- IStructuredDocumentRegion endStructuredDocumentRegion = getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- buffer.append('@');
- buffer.append(endStructuredDocumentRegion.toString());
- }
- return buffer.toString();
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttribute(String name, boolean isId) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported in this version"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
deleted file mode 100644
index fae39ca20a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Entity;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * EntityImpl class
- */
-public class EntityImpl extends NodeImpl implements Entity {
-
- private String name = null;
- private String notationName = null;
- private String publicId = null;
- private String systemId = null;
-
- /**
- * EntityImpl constructor
- */
- protected EntityImpl() {
- super();
- }
-
- /**
- * EntityImpl constructor
- *
- * @param that
- * EntityImpl
- */
- protected EntityImpl(EntityImpl that) {
- super(that);
-
- if (that != null) {
- this.name = that.name;
- this.publicId = that.publicId;
- this.systemId = that.systemId;
- this.notationName = that.notationName;
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- EntityImpl cloned = new EntityImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the text declaration, the encoding
- * of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- *
- * @see DOM Level 3
- */
- public java.lang.String getEncoding() {
- return null;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- if (this.name == null)
- return NodeImpl.EMPTY_STRING;
- return this.name;
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return ENTITY_NODE;
- }
-
- /**
- * getNotationName method
- *
- * @return java.lang.String
- */
- public String getNotationName() {
- return this.notationName;
- }
-
- /**
- * getPublicId method
- *
- * @return java.lang.String
- */
- public String getPublicId() {
- return this.publicId;
- }
-
- /**
- * getSystemId method
- *
- * @return java.lang.String
- */
- public String getSystemId() {
- return this.systemId;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the text declaration, the version
- * number of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- *
- * @see DOM Level 3
- */
- public java.lang.String getVersion() {
- return null;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the text declaration, the encoding
- * of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- *
- * @see DOM Level 3
- */
- public void setEncoding(java.lang.String encoding) {
- }
-
- /**
- * setName method
- *
- * @param name
- * java.lang.String
- */
- protected void setName(String name) {
- this.name = name;
- }
-
- /**
- * setNotationName method
- *
- * @param notationName
- * java.lang.String
- */
- public void setNotationName(String notationName) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.notationName = notationName;
- }
-
- /**
- * setPublicId method
- *
- * @param publicId
- * java.lang.String
- */
- public void setPublicId(String publicId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.publicId = publicId;
- }
-
- /**
- * setSystemId method
- *
- * @param systemId
- * java.lang.String
- */
- public void setSystemId(String systemId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.systemId = systemId;
- }
-
- /**
- * <p>
- * EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001. </a>.
- * <p>
- * An attribute specifying, as part of the text declaration, the version
- * number of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- *
- * @see DOM Level 3
- */
- public void setVersion(java.lang.String version) {
- }
-
- public String getInputEncoding() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
- public String getXmlEncoding() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
-
- public String getXmlVersion() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
deleted file mode 100644
index a4edb32bca..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
+++ /dev/null
@@ -1,95 +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
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * EntityReference class
- */
-public class EntityReferenceImpl extends NodeImpl implements EntityReference {
-
- private String name = null;
-
- /**
- * EntityReferenceImpl constructor
- */
- protected EntityReferenceImpl() {
- super();
- }
-
- /**
- * EntityReferenceImpl constructor
- *
- * @param that
- * EntityReferenceImpl
- */
- protected EntityReferenceImpl(EntityReferenceImpl that) {
- super(that);
-
- if (that != null) {
- this.name = that.name;
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- EntityReferenceImpl cloned = new EntityReferenceImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- if (this.name == null)
- return NodeImpl.EMPTY_STRING;
- return this.name;
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return ENTITY_REFERENCE_NODE;
- }
-
- /**
- * setName method
- *
- * @param name
- * java.lang.String
- */
- protected void setName(String name) {
- this.name = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java
deleted file mode 100644
index 1a3a079a97..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/InvalidCharacterException.java
+++ /dev/null
@@ -1,67 +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.xml.core.internal.document;
-
-
-
-/**
- * Thrown an invalid character is specified in : XMLNode#setSource(String)
- */
-public class InvalidCharacterException extends Exception {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- private char invalidChar = 0;
- private int offset = -1;
-
- /**
- */
- public InvalidCharacterException() {
- super();
- }
-
- /**
- */
- public InvalidCharacterException(String s) {
- super(s);
- }
-
- /**
- */
- public InvalidCharacterException(String s, char c) {
- super(s);
- this.invalidChar = c;
- }
-
- /**
- */
- public InvalidCharacterException(String s, char c, int offset) {
- super(s);
- this.invalidChar = c;
- this.offset = offset;
- }
-
- /**
- */
- public char getInvalidChar() {
- return this.invalidChar;
- }
-
- /**
- */
- public int getOffset() {
- return this.offset;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java
deleted file mode 100644
index 6f2de44010..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java
+++ /dev/null
@@ -1,34 +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.xml.core.internal.document;
-
-
-
-/**
- * JSPTag interface
- */
-public interface JSPTag {
- static final String COMMENT_CLOSE = "--%>";//$NON-NLS-1$
- static final String COMMENT_OPEN = "<%--";//$NON-NLS-1$
- static final String DECLARATION_TOKEN = "!";//$NON-NLS-1$
- static final String DIRECTIVE_TOKEN = "@";//$NON-NLS-1$
- static final String EXPRESSION_TOKEN = "=";//$NON-NLS-1$
- static final String JSP_DECLARATION = "jsp:declaration";//$NON-NLS-1$
- static final String JSP_DIRECTIVE = "jsp:directive";//$NON-NLS-1$
- static final String JSP_EXPRESSION = "jsp:expression";//$NON-NLS-1$
- static final String JSP_ROOT = "jsp:root";//$NON-NLS-1$
-
- static final String JSP_SCRIPTLET = "jsp:scriptlet";//$NON-NLS-1$
- static final String TAG_CLOSE = "%>";//$NON-NLS-1$
- static final String TAG_OPEN = "<%";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
deleted file mode 100644
index e61907dd5d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- */
-public interface ModelParserAdapter extends INodeAdapter {
-
- /**
- */
- public boolean canBeImplicitTag(Element element);
-
- /**
- */
- public boolean canBeImplicitTag(Element element, Node child);
-
- /**
- */
- public boolean canContain(Element element, Node child);
-
- /**
- */
- public Element createCommentElement(Document document, String data, boolean isJSPTag);
-
- /**
- */
- public Element createImplicitElement(Document document, Node parent, Node child);
-
- /**
- */
- public String getFindRootName(String tagName);
-
- /**
- */
- public boolean isEndTag(IDOMElement element);
-
- boolean isEndTagOmissible(Element element);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
deleted file mode 100644
index ac7a403352..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * NodeContainer class
- */
-public abstract class NodeContainer extends NodeImpl implements Node, NodeList {
-
- /**
- */
- private class ChildNodesCache implements NodeList {
- private Node curChild = null;
- private int curIndex = -1;
- private int length = 0;
-
- ChildNodesCache() {
- initializeCache();
- }
-
- public int getLength() {
- // atomic
- return this.length;
- }
-
- private void initializeCache() {
- // note we use the outter objects lockobject
- // (since we are using their "children".
- synchronized (lockObject) {
- for (Node child = firstChild; child != null; child = child.getNextSibling()) {
- this.length++;
- }
- }
- }
-
- public Node item(int index) {
- synchronized (lockObject) {
- if (this.length == 0)
- return null;
- if (index < 0)
- return null;
- if (index >= this.length)
- return null;
-
- if (this.curIndex < 0) { // first time
- if (index * 2 >= this.length) { // search from the last
- this.curIndex = this.length - 1;
- this.curChild = lastChild;
- } else { // search from the first
- this.curIndex = 0;
- this.curChild = firstChild;
- }
- }
-
- if (index == this.curIndex)
- return this.curChild;
-
- if (index > this.curIndex) {
- while (index > this.curIndex) {
- this.curIndex++;
- this.curChild = this.curChild.getNextSibling();
- }
- } else { // index < this.curIndex
- while (index < this.curIndex) {
- this.curIndex--;
- this.curChild = this.curChild.getPreviousSibling();
- }
- }
-
- return this.curChild;
- }
- }
- }
-
- private NodeList childNodesCache = null;
-
- private boolean fChildEditable = true;
- NodeImpl firstChild = null;
- NodeImpl lastChild = null;
-
- Object lockObject = new byte[0];
-
- /**
- * NodeContainer constructor
- */
- protected NodeContainer() {
- super();
- }
-
- /**
- * NodeContainer constructor
- *
- * @param that
- * NodeContainer
- */
- protected NodeContainer(NodeContainer that) {
- super(that);
- }
-
- /**
- * appendChild method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- */
- public Node appendChild(Node newChild) throws DOMException {
- return insertBefore(newChild, null);
- }
-
- /**
- * cloneChildNodes method
- *
- * @param container
- * org.w3c.dom.Node
- * @param deep
- * boolean
- */
- protected void cloneChildNodes(Node newParent, boolean deep) {
- if (newParent == null || newParent == this)
- return;
- if (!(newParent instanceof NodeContainer))
- return;
-
- NodeContainer container = (NodeContainer) newParent;
- container.removeChildNodes();
-
- for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) {
- Node cloned = child.cloneNode(deep);
- if (cloned != null)
- container.appendChild(cloned);
- }
- }
-
- /**
- * getChildNodes method
- *
- * @return org.w3c.dom.NodeList
- */
- public NodeList getChildNodes() {
- return this;
- }
-
- /**
- * getFirstChild method
- *
- * @return org.w3c.dom.Node
- */
- public Node getFirstChild() {
- return this.firstChild;
- }
-
- /**
- * getLastChild method
- *
- * @return org.w3c.dom.Node
- */
- public Node getLastChild() {
- return this.lastChild;
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- if (this.firstChild == null)
- return 0;
- synchronized (lockObject) {
- if (this.childNodesCache == null)
- this.childNodesCache = new ChildNodesCache();
- return this.childNodesCache.getLength();
- }
- }
-
- /**
- */
- public String getSource() {
- StringBuffer buffer = new StringBuffer();
-
- IStructuredDocumentRegion startStructuredDocumentRegion = getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- String source = startStructuredDocumentRegion.getText();
- if (source != null)
- buffer.append(source);
- }
-
- for (NodeImpl child = firstChild; child != null; child = (NodeImpl) child.getNextSibling()) {
- String source = child.getSource();
- if (source != null)
- buffer.append(source);
- }
-
- IStructuredDocumentRegion endStructuredDocumentRegion = getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- String source = endStructuredDocumentRegion.getText();
- if (source != null)
- buffer.append(source);
- }
-
- return buffer.toString();
- }
-
- /**
- * hasChildNodes method
- *
- * @return boolean
- */
- public boolean hasChildNodes() {
- return (this.firstChild != null);
- }
-
- /**
- * insertBefore method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param refChild
- * org.w3c.dom.Node
- */
- public Node insertBefore(Node newChild, Node refChild) throws DOMException {
- if (newChild == null)
- return null; // nothing to do
- if (refChild != null && refChild.getParentNode() != this) {
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- }
- if (!isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (newChild == refChild)
- return newChild; // nothing to do
- //new child can not be a parent of this, would cause cycle
- if(isParent(newChild)) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
-
- if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
- // insert child nodes instead
- for (Node child = newChild.getFirstChild(); child != null; child = newChild.getFirstChild()) {
- newChild.removeChild(child);
- insertBefore(child, refChild);
- }
- return newChild;
- }
- // synchronized in case another thread is getting item, or length
- synchronized (lockObject) {
- this.childNodesCache = null; // invalidate child nodes cache
- }
-
- NodeImpl child = (NodeImpl) newChild;
- NodeImpl next = (NodeImpl) refChild;
- NodeImpl prev = null;
- Node oldParent = child.getParentNode();
- if (oldParent != null)
- oldParent.removeChild(child);
- if (next == null) {
- prev = this.lastChild;
- this.lastChild = child;
- } else {
- prev = (NodeImpl) next.getPreviousSibling();
- next.setPreviousSibling(child);
- }
- if (prev == null)
- this.firstChild = child;
- else
- prev.setNextSibling(child);
- child.setPreviousSibling(prev);
- child.setNextSibling(next);
- child.setParentNode(this);
- // make sure having the same owner document
- if (child.getOwnerDocument() == null) {
- if (getNodeType() == DOCUMENT_NODE) {
- child.setOwnerDocument((Document) this);
- } else {
- child.setOwnerDocument(getOwnerDocument());
- }
- }
-
- notifyChildReplaced(child, null);
-
- return child;
- }
-
- public boolean isChildEditable() {
- if (!fChildEditable) {
- DOMModelImpl model = (DOMModelImpl) getModel();
- if (model != null && model.isReparsing()) {
- return true;
- }
- }
- return fChildEditable;
- }
-
- /**
- * isContainer method
- *
- * @return boolean
- */
- public boolean isContainer() {
- return true;
- }
-
- /**
- * item method
- *
- * @return org.w3c.dom.Node
- * @param index
- * int
- */
- public Node item(int index) {
- if (this.firstChild == null)
- return null;
- synchronized (lockObject) {
- if (this.childNodesCache == null)
- this.childNodesCache = new ChildNodesCache();
- return this.childNodesCache.item(index);
- }
- }
-
- /**
- * notifyChildReplaced method
- *
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- protected void notifyChildReplaced(Node newChild, Node oldChild) {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
-
- syncChildEditableState(newChild);
-
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.childReplaced(this, newChild, oldChild);
- }
-
- /**
- * removeChild method
- *
- * @return org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- public Node removeChild(Node oldChild) throws DOMException {
- if (oldChild == null)
- return null;
- if (oldChild.getParentNode() != this) {
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- }
-
- if (!isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- // synchronized in case another thread is getting item, or length
- synchronized (lockObject) {
- this.childNodesCache = null; // invalidate child nodes cache
- }
-
- NodeImpl child = (NodeImpl) oldChild;
- NodeImpl prev = (NodeImpl) child.getPreviousSibling();
- NodeImpl next = (NodeImpl) child.getNextSibling();
-
- child.setEditable(true, true); // clear ReadOnly flags
-
- if (prev == null)
- this.firstChild = next;
- else
- prev.setNextSibling(next);
- if (next == null)
- this.lastChild = prev;
- else
- next.setPreviousSibling(prev);
- child.setPreviousSibling(null);
- child.setNextSibling(null);
- child.setParentNode(null);
-
- notifyChildReplaced(null, child);
-
- return child;
- }
-
- /**
- * removeChildNodes method
- */
- public void removeChildNodes() {
- if (!isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- Node nextChild = null;
- for (Node child = getFirstChild(); child != null; child = nextChild) {
- nextChild = child.getNextSibling();
- removeChild(child);
- }
- }
-
- /**
- * removeChildNodes method
- *
- * @return org.w3c.dom.DocumentFragment
- * @param firstChild
- * org.w3c.dom.Node
- * @param lastChild
- * org.w3c.dom.Node
- */
- public DocumentFragment removeChildNodes(Node firstChild, Node lastChild) {
- if (!hasChildNodes())
- return null;
- if (!isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- Document document = null;
- if (getNodeType() == DOCUMENT_NODE)
- document = (Document) this;
- else
- document = getOwnerDocument();
- if (document == null)
- return null;
- DocumentFragment fragment = document.createDocumentFragment();
- if (fragment == null)
- return null;
-
- if (firstChild == null)
- firstChild = getFirstChild();
- if (lastChild == null)
- lastChild = getLastChild();
- Node nextChild = null;
- for (Node child = firstChild; child != null; child = nextChild) {
- nextChild = child.getNextSibling();
- removeChild(child);
- fragment.appendChild(child);
- if (child == lastChild)
- break;
- }
-
- return fragment;
- }
-
- /**
- * replaceChild method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
- if (!isChildEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- if (oldChild == null || oldChild == newChild)
- return newChild;
- if (newChild != null)
- insertBefore(newChild, oldChild);
- return removeChild(oldChild);
- }
-
- public void setChildEditable(boolean editable) {
- if (fChildEditable == editable) {
- return;
- }
-
- ReadOnlyController roc = ReadOnlyController.getInstance();
- Node node;
- if (editable) {
- for (node = getFirstChild(); node != null; node = node.getNextSibling()) {
- roc.unlockNode((IDOMNode) node);
- }
- } else {
- for (node = getFirstChild(); node != null; node = node.getNextSibling()) {
- roc.lockNode((IDOMNode) node);
- }
- }
-
- fChildEditable = editable;
- notifyEditableChanged();
- }
-
- protected void syncChildEditableState(Node child) {
- ReadOnlyController roc = ReadOnlyController.getInstance();
- if (fChildEditable) {
- roc.unlockNode((NodeImpl) child);
- } else {
- roc.lockNode((NodeImpl) child);
- }
- }
-
- /**
- * <p>Checks to see if the given <code>Node</code> is a parent of <code>this</code> node</p>
- *
- * @param possibleParent the possible parent <code>Node</code> of <code>this</code> node
- * @return <code>true</code> if <code>possibleParent</code> is the parent of <code>this</code>,
- * <code>false</code> otherwise.
- */
- private boolean isParent(Node possibleParent) {
- Node parent = this.getParentNode();
- while(parent != null && parent != possibleParent) {
- parent = parent.getParentNode();
- }
-
- return parent == possibleParent;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
deleted file mode 100644
index 44e5df5140..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
+++ /dev/null
@@ -1,1171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *
- * David Carver (STAR) - bug 295127 - implement isSameNode and compareDocumentPosition methods.
- * Unit Tests covered in wst.xsl XPath 2.0 tests.
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-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.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.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * NodeImpl class
- */
-public abstract class NodeImpl extends AbstractNotifier implements Node, IDOMNode {
- // define one empty nodelist, for repeated use
- private final static NodeList EMPTY_NODE_LIST = new NodeListImpl();
- // DocumentPosition
- //private final static short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- private final static short DOCUMENT_POSITION_PRECEDING = 0x02;
- private final static short DOCUMENT_POSITION_FOLLOWING = 0x04;
- //private final static short DOCUMENT_POSITION_CONTAINS = 0x08;
- //private final static short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
- private final static short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
-
- private boolean fDataEditable = true;
- private IStructuredDocumentRegion flatNode = null;
- private NodeImpl nextSibling = null;
-
- private DocumentImpl ownerDocument = null;
- private NodeImpl parentNode = null;
- private NodeImpl previousSibling = null;
- // define one empty String constant for repeated use
- static final String EMPTY_STRING = "";
-
- /**
- * NodeImpl constructor
- */
- protected NodeImpl() {
- super();
- }
-
- /**
- * NodeImpl constructor
- *
- * @param that
- * NodeImpl
- */
- protected NodeImpl(NodeImpl that) {
- if (that != null) {
- this.ownerDocument = that.ownerDocument;
- }
- }
-
- /**
- * appendChild method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- */
- public Node appendChild(Node newChild) throws DOMException {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
-
- /**
- * contains method
- *
- * @return boolean
- * @param offset
- * int
- */
- public boolean contains(int offset) {
- return (offset >= getStartOffset() && offset < getEndOffset());
- }
-
- /**
- * @param s
- * @param tagName
- * @return
- */
- protected String createDOMExceptionMessage(short s, String tagName) {
- String result = null;
- // TODO: Should localize these messages, and provide /u escaped
- // version of tagName
- result = lookupMessage(s) + " " + tagName; //$NON-NLS-1$
- return result;
- }
-
- /**
- * getAttributes method
- *
- * @return org.w3c.dom.NamedNodeMap
- */
- public NamedNodeMap getAttributes() {
- return null;
- }
-
- /**
- */
- protected String getCharValue(String name) {
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document == null)
- return null;
- return document.getCharValue(name);
- }
-
- /**
- * getChildNodes method
- *
- * @return org.w3c.dom.NodeList
- */
- public NodeList getChildNodes() {
- // As per DOM spec, correct behavior for getChildNodes is to return a
- // zero length NodeList, not null, when there are no children.
- // We'll use a common instance of an empty node list, just to prevent
- // creating a trival object many many times.
-
- return EMPTY_NODE_LIST;
- }
-
- /**
- * getCommonAncestor method
- *
- * @return org.w3c.dom.Node
- * @param node
- * org.w3c.dom.Node
- */
- public Node getCommonAncestor(Node node) {
- if (node == null)
- return null;
-
- for (Node na = node; na != null; na = na.getParentNode()) {
- for (Node ta = this; ta != null; ta = ta.getParentNode()) {
- if (ta == na)
- return ta;
- }
- }
-
- return null; // not found
- }
-
- /**
- * getContainerDocument method
- *
- * @return org.w3c.dom.Document
- */
- public Document getContainerDocument() {
- Node parent = null;
- for (Node node = this; node != null; node = parent) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- return (Document) node;
- }
- /* Break out of a bad hierarchy */
- if ((parent = node.getParentNode()) == node)
- break;
- }
- return null;
- }
-
- /**
- * getEndOffset method
- *
- * @return int
- */
- public int getEndOffset() {
- Node node = this;
- while (node != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) node;
- IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null)
- return endStructuredDocumentRegion.getEnd();
- }
-
- Node last = node.getLastChild();
- if (last != null) { // dig into the last
- node = last;
- continue;
- }
-
- IStructuredDocumentRegion lastStructuredDocumentRegion = ((NodeImpl) node).getStructuredDocumentRegion();
- if (lastStructuredDocumentRegion != null)
- return lastStructuredDocumentRegion.getEnd();
-
- Node prev = node.getPreviousSibling();
- if (prev != null) { // move to the previous
- node = prev;
- continue;
- }
-
- Node parent = node.getParentNode();
- node = null;
- while (parent != null) {
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) parent;
- IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null)
- return startStructuredDocumentRegion.getEnd();
- }
- Node parentPrev = parent.getPreviousSibling();
- if (parentPrev != null) { // move to the previous
- node = parentPrev;
- break;
- }
- parent = parent.getParentNode();
- }
- }
- return 0;
- }
-
- public IStructuredDocumentRegion getEndStructuredDocumentRegion() {
- return null;
- }
-
- /**
- */
- public FactoryRegistry getFactoryRegistry() {
- IDOMModel model = getModel();
- if (model != null) {
- FactoryRegistry reg = model.getFactoryRegistry();
- if (reg != null)
- return reg;
- }
- return null;
- }
-
- /**
- * getFirstChild method
- *
- * @return org.w3c.dom.Node
- */
- public Node getFirstChild() {
- return null;
- }
-
- /**
- * getFirstStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.flatNode);
- }
-
- /**
- */
- public int getIndex() {
- Node parent = getParentNode();
- if (parent == null)
- return -1; // error
- int index = 0;
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child == this)
- return index;
- index++;
- }
- return -1; // error
- }
-
- /**
- * getLastChild method
- *
- * @return org.w3c.dom.Node
- */
- public Node getLastChild() {
- return null;
- }
-
- /**
- * getLastStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- return StructuredDocumentRegionUtil.getStructuredDocumentRegion(this.flatNode);
- }
-
- /**
- */
- public String getLocalName() {
- return null;
- }
-
- /**
- * the default implementation can just refer to the owning document
- */
- public IDOMModel getModel() {
- if (this.ownerDocument == null)
- return null;
- return this.ownerDocument.getModel();
- }
-
- /**
- * all but attr return null
- */
- public ITextRegion getNameRegion() {
- return null;
- }
-
- /**
- */
- public String getNamespaceURI() {
- return null;
- }
-
- /**
- * getNextSibling method
- *
- * @return org.w3c.dom.Node
- */
- public Node getNextSibling() {
- return this.nextSibling;
- }
-
- /**
- * getNodeAt method
- *
- * @return org.w3c.dom.Node
- * @param offset
- * int
- */
- Node getNodeAt(int offset) {
- IDOMNode parent = this;
- IDOMNode child = (IDOMNode) getFirstChild();
- while (child != null) {
- if (child.getEndOffset() <= offset) {
- child = (IDOMNode) child.getNextSibling();
- continue;
- }
- if (child.getStartOffset() > offset) {
- break;
- }
-
- IStructuredDocumentRegion startStructuredDocumentRegion = child.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- if (startStructuredDocumentRegion.getEnd() > offset)
- return child;
- }
-
- // dig more
- parent = child;
- child = (IDOMNode) parent.getFirstChild();
- }
-
- return parent;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeValue()
- */
- public String getNodeValue() throws DOMException {
- return null;
- }
-
- /**
- * getOwnerDocument method
- *
- * @return org.w3c.dom.Document
- */
- public Document getOwnerDocument() {
- return this.ownerDocument;
- }
-
- /**
- * getParentNode method
- *
- * @return org.w3c.dom.Node
- */
- public Node getParentNode() {
- return this.parentNode;
- }
-
- /**
- */
- public String getPrefix() {
- return null;
- }
-
- /**
- * getPreviousSibling method
- *
- * @return org.w3c.dom.Node
- */
- public Node getPreviousSibling() {
- return this.previousSibling;
- }
-
- /**
- */
- public String getSource() {
- if (this.flatNode == null)
- return NodeImpl.EMPTY_STRING;
- return this.flatNode.getText();
- }
-
- /**
- * getStartOffset method
- *
- * @return int
- */
- public int getStartOffset() {
- if (this.flatNode != null)
- return this.flatNode.getStart();
- NodeImpl prev = (NodeImpl) getPreviousSibling();
- if (prev != null)
- return prev.getEndOffset();
- Node parent = getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) parent;
- if (element.hasStartTag())
- return element.getStartEndOffset();
- return element.getStartOffset();
- }
- // final fallback to look into first child
- NodeImpl child = (NodeImpl) getFirstChild();
- while (child != null) {
- IStructuredDocumentRegion childStructuredDocumentRegion = child.getStructuredDocumentRegion();
- if (childStructuredDocumentRegion != null)
- return childStructuredDocumentRegion.getStart();
- child = (NodeImpl) child.getFirstChild();
- }
- return 0;
- }
-
- public IStructuredDocumentRegion getStartStructuredDocumentRegion() {
- return getFirstStructuredDocumentRegion();
- }
-
- /**
- * Every node (indirectly) knows its structuredDocument
- */
- public IStructuredDocument getStructuredDocument() {
- return getModel().getStructuredDocument();
- }
-
- /**
- */
- IStructuredDocumentRegion getStructuredDocumentRegion() {
- return this.flatNode;
- }
-
- /**
- * all but attr return null
- */
- public ITextRegion getValueRegion() {
- return null;
- }
-
- /**
- */
- public String getValueSource() {
- return getNodeValue();
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasAttributes()
- */
- public boolean hasAttributes() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#hasChildNodes()
- */
- public boolean hasChildNodes() {
- return false;
- }
-
- /**
- * hasProperties method
- *
- * @return boolean
- */
- public boolean hasProperties() {
- return false;
- }
-
- /**
- * insertBefore method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param refChild
- * org.w3c.dom.Node
- */
- public Node insertBefore(Node newChild, Node refChild) throws DOMException {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
-
- public boolean isChildEditable() {
- return false;
- }
-
- /**
- */
- public boolean isClosed() {
- return true;
- }
-
- /**
- * isContainer method
- *
- * @return boolean
- */
- public boolean isContainer() {
- return false;
- }
-
- public boolean isDataEditable() {
- if (!fDataEditable) {
- DOMModelImpl model = (DOMModelImpl) getModel();
- if (model != null && model.isReparsing()) {
- return true;
- }
- }
- return fDataEditable;
- }
-
- /**
- */
- public boolean isSupported(String feature, String version) {
- if (this.ownerDocument == null)
- return false;
- DOMImplementation impl = this.ownerDocument.getImplementation();
- if (impl == null)
- return false;
- return impl.hasFeature(feature, version);
- }
-
- /**
- * @param s
- * @return
- */
- private String lookupMessage(short s) {
- // TODO: make localized version
- String result = null;
- switch (s) {
- case DOMException.DOMSTRING_SIZE_ERR :
- result = DOMMessages.DOMSTRING_SIZE_ERR;
- break;
- case DOMException.HIERARCHY_REQUEST_ERR :
- result = DOMMessages.HIERARCHY_REQUEST_ERR;
- break;
- case DOMException.INDEX_SIZE_ERR :
- result = DOMMessages.INDEX_SIZE_ERR;
- break;
- case DOMException.INUSE_ATTRIBUTE_ERR :
- result = DOMMessages.INUSE_ATTRIBUTE_ERR;
- break;
- case DOMException.INVALID_ACCESS_ERR :
- result = DOMMessages.INVALID_ACCESS_ERR;
- break;
- case DOMException.INVALID_CHARACTER_ERR :
- result = DOMMessages.INVALID_CHARACTER_ERR;
- break;
- case DOMException.INVALID_MODIFICATION_ERR :
- result = DOMMessages.INVALID_MODIFICATION_ERR;
- break;
- case DOMException.INVALID_STATE_ERR :
- result = DOMMessages.INVALID_STATE_ERR;
- break;
- case DOMException.NAMESPACE_ERR :
- result = DOMMessages.NAMESPACE_ERR;
- break;
- case DOMException.NO_DATA_ALLOWED_ERR :
- result = DOMMessages.NO_DATA_ALLOWED_ERR;
- break;
- case DOMException.NO_MODIFICATION_ALLOWED_ERR :
- result = DOMMessages.NO_MODIFICATION_ALLOWED_ERR;
- break;
- case DOMException.NOT_FOUND_ERR :
- result = DOMMessages.NOT_FOUND_ERR;
- break;
- case DOMException.NOT_SUPPORTED_ERR :
- result = DOMMessages.NOT_SUPPORTED_ERR;
- break;
- case DOMException.SYNTAX_ERR :
- result = DOMMessages.SYNTAX_ERR;
- break;
- case 17:// DOMException.TYPE_MISMATCH_ERR :
- result = DOMMessages.TYPE_MISMATCH_ERR;
- break;
- case 16:// DOMException.VALIDATION_ERR :
- result = DOMMessages.VALIDATION_ERR;
- break;
- case DOMException.WRONG_DOCUMENT_ERR :
- result = DOMMessages.WRONG_DOCUMENT_ERR;
- break;
- default :
- result = NodeImpl.EMPTY_STRING;
- break;
- }
- return result;
- }
-
- /**
- * normalize method
- */
- public void normalize() {
- TextImpl prevText = null;
- for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) {
- switch (child.getNodeType()) {
- case TEXT_NODE : {
- if (prevText == null) {
- prevText = (TextImpl) child;
- break;
- }
- Text text = (Text) child;
- removeChild(text);
- prevText.appendText(text);
- child = prevText;
- break;
- }
- case ELEMENT_NODE : {
- Element element = (Element) child;
- element.normalize();
- prevText = null;
- break;
- }
- default :
- prevText = null;
- break;
- }
- }
- }
-
- protected void notifyEditableChanged() {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.editableChanged(this);
- }
-
- /**
- * notifyValueChanged method
- */
- protected void notifyValueChanged() {
- DocumentImpl document = (DocumentImpl) getContainerDocument();
- if (document == null)
- return;
-
- syncDataEditableState();
-
- DOMModelImpl model = (DOMModelImpl) document.getModel();
- if (model == null)
- return;
- model.valueChanged(this);
- }
-
- /**
- * removeChild method
- *
- * @return org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- public Node removeChild(Node oldChild) throws DOMException {
- throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
- }
-
- /**
- * removeChildNodes method
- */
- public void removeChildNodes() {
- }
-
- /**
- * removeChildNodes method
- *
- * @return org.w3c.dom.DocumentFragment
- * @param firstChild
- * org.w3c.dom.Node
- * @param lastChild
- * org.w3c.dom.Node
- */
- public DocumentFragment removeChildNodes(Node firstChild, Node lastChild) {
- return null;
- }
-
- /**
- * replaceChild method
- *
- * @return org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
- }
-
- /**
- * Resets children values from IStructuredDocumentRegion.
- */
- void resetStructuredDocumentRegions() {
- for (NodeImpl child = (NodeImpl) getFirstChild(); child != null; child = (NodeImpl) child.getNextSibling()) {
- child.resetStructuredDocumentRegions();
- }
- this.flatNode = null;
- }
-
- public void setChildEditable(boolean editable) {
- // nop
- }
-
- public void setDataEditable(boolean editable) {
- if (fDataEditable == editable) {
- return;
- }
-
- ReadOnlyController roc = ReadOnlyController.getInstance();
- if (editable) {
- roc.unlockData(this);
- }
- else {
- roc.lockData(this);
- }
-
- fDataEditable = editable;
-
- notifyEditableChanged();
- }
-
- public void setEditable(boolean editable, boolean deep) {
- if (deep) {
- IDOMNode node = (IDOMNode) getFirstChild();
- while (node != null) {
- node.setEditable(editable, deep);
- node = (IDOMNode) node.getNextSibling();
- }
- }
- setChildEditable(editable);
- setDataEditable(editable);
- }
-
- /**
- * setNextSibling method
- *
- * @param nextSibling
- * org.w3c.dom.Node
- */
- protected void setNextSibling(Node nextSibling) {
- this.nextSibling = (NodeImpl) nextSibling;
- }
-
- /**
- * setNodeValue method
- *
- * @param nodeValue
- * java.lang.String
- */
- public void setNodeValue(String nodeValue) throws DOMException {
- }
-
- /**
- * setOwnerDocument method
- *
- * @param ownerDocument
- * org.w3c.dom.Document
- */
- protected void setOwnerDocument(Document ownerDocument) {
- this.ownerDocument = (DocumentImpl) ownerDocument;
- }
-
- /**
- */
- protected void setOwnerDocument(Document ownerDocument, boolean deep) {
- this.ownerDocument = (DocumentImpl) ownerDocument;
-
- if (deep) {
- for (NodeImpl child = (NodeImpl) getFirstChild(); child != null; child = (NodeImpl) child.getNextSibling()) {
- child.setOwnerDocument(ownerDocument, deep);
- }
- }
- }
-
- /**
- * setParentNode method
- *
- * @param parentNode
- * org.w3c.dom.Node
- */
- protected void setParentNode(Node parentNode) {
- this.parentNode = (NodeImpl) parentNode;
- }
-
- /**
- */
- public void setPrefix(String prefix) throws DOMException {
- }
-
- /**
- * setPreviousSibling method
- *
- * @param previousSibling
- * org.w3c.dom.Node
- */
- protected void setPreviousSibling(Node previousSibling) {
- this.previousSibling = (NodeImpl) previousSibling;
- }
-
- /**
- */
- public void setSource(String source) throws InvalidCharacterException {
- // not supported
- }
-
- /**
- */
- void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- this.flatNode = flatNode;
- }
-
- /**
- */
- public void setValueSource(String source) {
- setNodeValue(source);
- }
-
- protected void syncDataEditableState() {
- ReadOnlyController roc = ReadOnlyController.getInstance();
- if (fDataEditable) {
- roc.unlockData(this);
- }
- else {
- roc.lockData(this);
- }
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- return getNodeName();
- }
-
- 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;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node)
- */
- public short compareDocumentPosition(Node other) throws DOMException {
- if (!(other instanceof IDOMNode))
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, DOMMessages.NOT_SUPPORTED_ERR);
-
- int nodeStart = this.getStartOffset();
- int otherStart = ((IDOMNode) other).getStartOffset();
-
- if (otherStart > nodeStart) {
- return DOCUMENT_POSITION_FOLLOWING;
- }
- else if (otherStart < nodeStart) {
- return DOCUMENT_POSITION_PRECEDING;
- }
- return DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String getBaseURI() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public Object getFeature(String feature, String version) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.Node#getTextContent()
- */
- public String getTextContent() throws DOMException {
- switch (getNodeType()) {
- case Node.DOCUMENT_NODE :
- case Node.DOCUMENT_TYPE_NODE :
- case Node.NOTATION_NODE :
- return null;
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- case Node.COMMENT_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- return getNodeValue();
- }
-
- if (hasChildNodes()) {
- final StringBuffer builder = new StringBuffer();
-
- Node child = getFirstChild();
- while (child != null) {
- short nodeType = child.getNodeType();
- if (nodeType == Node.COMMENT_NODE || nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
- child = child.getNextSibling();
- continue;
- }
-
- String text = ((IDOMNode) child).getTextContent();
- if (text != null) {
- builder.append(text);
- }
- child = child.getNextSibling();
- }
-
- return builder.toString();
- }
-
- return EMPTY_STRING;
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node)
- */
- public boolean isEqualNode(Node arg) {
- return this.equals(arg);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node)
- */
- public boolean isSameNode(Node other) {
- return this == other;
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String lookupNamespaceURI(String prefix) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String lookupPrefix(String namespaceURI) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public void setTextContent(String textContent) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public TypeInfo getSchemaTypeInfo() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isId() {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
- }
-
- /**
- * Retrieves the object for a node associated to a key.
- *
- * @param key The key associated with the object.
- * @return object The object for this node, associated with the key passed
- * or null if there was none set.
- *
- * @since DOM Level 3
- */
- public Object getUserData(String key) {
-
- if (key==null) return null;
- Map userDataTable = UserData.getInstance().getUserDataTable(this);
- if (userDataTable!=null) {
- UserDataAndHandler userDataAndHandler = (UserDataAndHandler) userDataTable.get(key);
- if (userDataAndHandler!=null) {
- return userDataAndHandler.getData();
- }
- }
- return null;
- }
-
- /**
- * Sets the user data and handler for a key
- *
- * @param key The key associated with the object.
- * @param object The object for this node, associated with the key passed.
- * Null passed removes the existing association to the key.
- * @param handler UserDataHandler for the userdata associated with this key
- * @return Object The previous userdata object if set, null if it was none.
- *
- * @since DOM Level 3
- */
- public Object setUserData(String key, Object data, UserDataHandler handler) {
-
- UserDataAndHandler previousDataAndHandler=null;
-
- //return immediately for null keys
- if (key ==null) return null;
- Map userDataTable = UserData.getInstance().getUserDataTable(this);
- //remove association for the key if data is null
- if (data==null) {
- if (userDataTable==null) return null;
-
- //see if there is a previous value set
- previousDataAndHandler = (UserDataAndHandler) userDataTable.get(key);
- if (previousDataAndHandler!=null) {
- userDataTable.remove(key);
- return previousDataAndHandler.getData();
- }
- //there is no previous value found
- return null;
- }
-
- //if data passed is not null
- //the first data in the hashtable
- if (userDataTable==null) {
- userDataTable=new Hashtable();
- UserDataAndHandler userDataAndHandler=new UserDataAndHandler(data,handler);
- userDataTable.put(key,userDataAndHandler);
- return null;
- //there is already data in the hashtable
- } else {
- UserDataAndHandler userDataAndHandler=new UserDataAndHandler(data,handler);
- previousDataAndHandler=(UserDataAndHandler) userDataTable.put(key,userDataAndHandler);
-
- //if we replace a value
- if (previousDataAndHandler!=null)
- return previousDataAndHandler.getData();
- else {
- return null;
- }
- }
- }
-
- /**
- * Notifies the UserDataHandlers of the node.
- *
- * @param operation
- * @param destination
- */
- protected void notifyUserDataHandlers(short operation, Node destination) {
-
- if (operation!=UserDataHandler.NODE_ADOPTED
- & operation!=UserDataHandler.NODE_CLONED
- & operation!=UserDataHandler.NODE_DELETED
- & operation!=UserDataHandler.NODE_IMPORTED
- & operation!=UserDataHandler.NODE_RENAMED)
- return;
- Map userDataTable = UserData.getInstance().getUserDataTable(this);
- if (userDataTable!=null) {
- Iterator entries =userDataTable.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry entry = (Map.Entry) entries.next();
- String key = entry.getKey().toString(); //should always be a string
- UserDataAndHandler dataAndHandler = (UserDataAndHandler) entry.getValue();
- if (dataAndHandler!=null) {
- UserDataHandler dataHandler=dataAndHandler.getHandler();
- if (dataHandler!=null) {
- dataHandler.handle(operation, key, dataAndHandler.getData(), this, destination);
- }
- }
- }
- }
- }
-
- /**
- *
- * Class for user data and UserDataHandler
- */
- protected static class UserDataAndHandler implements Serializable {
-
- /**
- * Generated Serial ID
- */
- private static final long serialVersionUID = 4860521237315444841L;
- /**
- * Generated serialization version
- */
-
- private Object data;
- private UserDataHandler handler;
-
- public UserDataAndHandler(Object data, UserDataHandler handler)
- {
- this.data=data;
- this.handler=handler;
- }
-
- public Object getData() {
- return data;
- }
-
- public void setData(Object data) {
- this.data = data;
- }
-
- public UserDataHandler getHandler() {
- return handler;
- }
-
- public void setHandler(UserDataHandler handler) {
- this.handler = handler;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java
deleted file mode 100644
index c4a278b694..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeIteratorImpl.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * NodeIteratorImpl class
- */
-public class NodeIteratorImpl implements NodeIterator {
- private NodeFilter filter = null;
- private Node nextNode = null;
-
- private Node rootNode = null;
- private int whatToShow = NodeFilter.SHOW_ALL;
-
- /**
- * NodeIteratorImpl constructor
- *
- * @param rootNode
- * org.w3c.dom.Node
- */
- NodeIteratorImpl(Node rootNode, int whatToShow, NodeFilter filter) {
- this.rootNode = rootNode;
- this.nextNode = rootNode;
- this.whatToShow = whatToShow;
- this.filter = filter;
- }
-
- /**
- */
- private final boolean acceptNode(Node node) {
- if (this.whatToShow != NodeFilter.SHOW_ALL) {
- if (node == null)
- return false;
- short nodeType = node.getNodeType();
- switch (this.whatToShow) {
- case NodeFilter.SHOW_ELEMENT :
- if (nodeType != Node.ELEMENT_NODE)
- return false;
- break;
- case NodeFilter.SHOW_ATTRIBUTE :
- if (nodeType != Node.ATTRIBUTE_NODE)
- return false;
- break;
- case NodeFilter.SHOW_TEXT :
- if (nodeType != Node.TEXT_NODE)
- return false;
- break;
- case NodeFilter.SHOW_CDATA_SECTION :
- if (nodeType != Node.CDATA_SECTION_NODE)
- return false;
- break;
- case NodeFilter.SHOW_ENTITY_REFERENCE :
- if (nodeType != Node.ENTITY_REFERENCE_NODE)
- return false;
- break;
- case NodeFilter.SHOW_ENTITY :
- if (nodeType != Node.ENTITY_NODE)
- return false;
- break;
- case NodeFilter.SHOW_PROCESSING_INSTRUCTION :
- if (nodeType != Node.PROCESSING_INSTRUCTION_NODE)
- return false;
- break;
- case NodeFilter.SHOW_COMMENT :
- if (nodeType != Node.COMMENT_NODE)
- return false;
- break;
- case NodeFilter.SHOW_DOCUMENT :
- if (nodeType != Node.DOCUMENT_NODE)
- return false;
- break;
- case NodeFilter.SHOW_DOCUMENT_TYPE :
- if (nodeType != Node.DOCUMENT_TYPE_NODE)
- return false;
- break;
- case NodeFilter.SHOW_DOCUMENT_FRAGMENT :
- if (nodeType != Node.DOCUMENT_FRAGMENT_NODE)
- return false;
- break;
- case NodeFilter.SHOW_NOTATION :
- if (nodeType != Node.NOTATION_NODE)
- return false;
- break;
- default :
- return false;
- }
- }
- if (this.filter != null) {
- return (this.filter.acceptNode(node) == NodeFilter.FILTER_ACCEPT);
- }
- return true;
- }
-
- /**
- * Detaches the <code>NodeIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the iterator in
- * the INVALID state. After <code>detach</code> has been invoked, calls
- * to <code>nextNode</code> or <code>previousNode</code> will raise
- * the exception INVALID_STATE_ERR.
- */
- public void detach() {
- this.rootNode = null;
- this.nextNode = null;
- this.filter = null;
- }
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they and their
- * descendants will be rejected. Note that this rejection takes precedence
- * over <code>whatToShow</code> and the filter. Also note that this is
- * currently the only situation where <code>NodeIterators</code> may
- * reject a complete subtree rather than skipping individual nodes. <br>
- * <br>
- * To produce a view of the document that has entity references expanded
- * and does not expose the entity reference node itself, use the
- * <code>whatToShow</code> flags to hide the entity reference node and
- * set <code>expandEntityReferences</code> to true when creating the
- * iterator. To produce a view of the document that has entity reference
- * nodes but no entity expansion, use the <code>whatToShow</code> flags
- * to show the entity reference node and set
- * <code>expandEntityReferences</code> to false.
- */
- public boolean getExpandEntityReferences() {
- // not supported
- return false;
- }
-
- /**
- * The <code>NodeFilter</code> used to screen nodes.
- */
- public NodeFilter getFilter() {
- return this.filter;
- }
-
- /**
- */
- private final Node getNextNode() {
- if (this.nextNode == null)
- return null;
- Node oldNext = this.nextNode;
- Node child = this.nextNode.getFirstChild();
- if (child != null) {
- this.nextNode = child;
- return oldNext;
- }
- for (Node node = this.nextNode; node != null && node != this.rootNode; node = node.getParentNode()) {
- Node next = node.getNextSibling();
- if (next != null) {
- this.nextNode = next;
- return oldNext;
- }
- }
- this.nextNode = null;
- return oldNext;
- }
-
- /**
- */
- private final Node getPreviousNode() {
- if (this.nextNode == this.rootNode)
- return null;
- Node prev = null;
- if (this.nextNode == null) {
- prev = this.rootNode; // never null
- } else {
- prev = this.nextNode.getPreviousSibling();
- if (prev == null) {
- this.nextNode = this.nextNode.getParentNode();
- return this.nextNode;
- }
- }
- Node last = prev.getLastChild();
- while (last != null) {
- prev = last;
- last = prev.getLastChild();
- }
- this.nextNode = prev;
- return this.nextNode;
- }
-
- /**
- * The root node of the <code>NodeIterator</code>, as specified when it
- * was created.
- */
- public Node getRoot() {
- return this.rootNode;
- }
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined in the
- * <code>NodeFilter</code> interface. Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered. Note that this skip takes precedence over the filter, if
- * any.
- */
- public int getWhatToShow() {
- return this.whatToShow;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a <code>NodeIterator</code> is created,
- * the first call to <code>nextNode()</code> returns the first node in
- * the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after
- * the <code>detach</code> method was invoked.
- */
- public Node nextNode() throws DOMException {
- for (Node node = getNextNode(); node != null; node = getNextNode()) {
- if (acceptNode(node))
- return node;
- }
- return null;
- }
-
- /**
- * Returns the previous node in the set and moves the position of the
- * <code>NodeIterator</code> backwards in the set.
- *
- * @return The previous <code>Node</code> in the set being iterated
- * over, or <code>null</code> if there are no more members in
- * that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after
- * the <code>detach</code> method was invoked.
- */
- public Node previousNode() throws DOMException {
- for (Node node = getPreviousNode(); node != null; node = getPreviousNode()) {
- if (acceptNode(node))
- return node;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
deleted file mode 100644
index a620f329ec..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * An array-backed NodeList, used to keep the array size down
- */
-public class NodeListImpl implements NodeList {
-
- private Object fLockObject = new byte[0];
- private final static int growthConstant = 2;
- private Node[] fNodes = null;
- private int fNodeCount = 0;
-
- /**
- * NodeListImpl constructor
- */
- public NodeListImpl() {
- super();
- }
-
- protected NodeListImpl(NodeListImpl list) {
- super();
- fNodeCount = list.fNodeCount;
- fNodes = list.fNodes;
- }
-
- /**
- * appendNode method
- *
- * @return org.w3c.dom.Node
- * @param node
- * org.w3c.dom.Node
- */
- protected Node appendNode(Node node) {
- if (node == null)
- return null;
- synchronized (fLockObject) {
- ensureCapacity(fNodeCount + 1);
- fNodes[fNodeCount++] = node;
- }
- return node;
- }
-
- /**
- * Grow the node array to at least the given size while keeping the
- * contents the same
- *
- * @param needed
- */
- private void ensureCapacity(int needed) {
- if (fNodes == null) {
- // first time
- fNodes = new Node[needed];
- return;
- }
- int oldLength = fNodes.length;
- if (oldLength < needed) {
- Node[] oldNodes = fNodes;
- Node[] newNodes = new Node[needed + growthConstant];
- System.arraycopy(oldNodes, 0, newNodes, 0, fNodeCount);
- fNodes = newNodes;
- }
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#getLength()
- */
- public int getLength() {
- return fNodeCount;
- }
-
- protected final Node[] getNodes() {
- return fNodes;
- }
-
- /**
- */
- protected Node insertNode(Node node, int index) {
- if (node == null)
- return null;
- synchronized (fLockObject) {
- if (fNodes == null) {
- // first time, ignore index
- fNodes = new Node[1];
- fNodes[fNodeCount++] = node;
- return node;
- }
-
- // gracefully handle out of bounds
- if (index < 0 || index > fNodeCount + 1)
- return appendNode(node);
-
- /*
- * Grow a new Node array, copying the old contents around the new
- * Node
- */
- Node[] newNodes = new Node[fNodeCount + growthConstant];
- System.arraycopy(fNodes, 0, newNodes, 0, index);
- newNodes[index] = node;
- System.arraycopy(fNodes, index, newNodes, index + 1, fNodeCount - index);
- fNodes = newNodes;
- fNodeCount++;
- }
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.NodeList#item(int)
- */
- public Node item(int index) {
- if (index < 0 || index >= fNodeCount)
- return null; // invalid parameter
- return fNodes[index];
- }
-
- /**
- * removeNode method
- *
- * @return org.w3c.dom.Node
- * @param index
- * int
- */
- protected Node removeNode(int index) {
- if (this.fNodes == null)
- return null; // no node
-
- synchronized (fLockObject) {
- if (index < 0 || index >= fNodeCount)
- return null; // invalid parameter
-
- Node removed = fNodes[index];
- Node[] newNodes = new Node[fNodeCount - 1];
- // copy around node being removed
- System.arraycopy(fNodes, 0, newNodes, 0, index);
- System.arraycopy(fNodes, index + 1, newNodes, index, fNodeCount - index - 1);
- fNodes = newNodes;
- fNodeCount--;
- return removed;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
deleted file mode 100644
index 186eea2e7e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * NotationImpl class
- */
-public class NotationImpl extends NodeImpl implements Notation {
-
- private String name = null;
- private String publicId = null;
- private String systemId = null;
-
- /**
- * NotationImpl constructor
- */
- protected NotationImpl() {
- super();
- }
-
- /**
- * NotationImpl constructor
- *
- * @param that
- * NotationImpl
- */
- protected NotationImpl(NotationImpl that) {
- super(that);
-
- if (that != null) {
- this.name = that.name;
- this.publicId = that.publicId;
- this.systemId = that.systemId;
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- NotationImpl cloned = new NotationImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- if (this.name == null)
- return NodeImpl.EMPTY_STRING;
- return this.name;
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return NOTATION_NODE;
- }
-
- /**
- * getPublicId method
- *
- * @return java.lang.String
- */
- public String getPublicId() {
- return this.publicId;
- }
-
- /**
- * getSystemId method
- *
- * @return java.lang.String
- */
- public String getSystemId() {
- return this.systemId;
- }
-
- /**
- * setName method
- *
- * @param name
- * java.lang.String
- */
- protected void setName(String name) {
- this.name = name;
- }
-
- /**
- * setPublicId method
- *
- * @param publicId
- * java.lang.String
- */
- public void setPublicId(String publicId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- this.publicId = publicId;
- }
-
- /**
- * setSystemId method
- *
- * @param systemId
- * java.lang.String
- */
- public void setSystemId(String systemId) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- this.systemId = systemId;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
deleted file mode 100644
index 044eb53b3b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.UserDataHandler;
-
-
-/**
- * ProcessingInstructionImpl class
- */
-public class ProcessingInstructionImpl extends NodeImpl implements ProcessingInstruction {
- private String data = null;
-
- private String target = null;
-
- /**
- * ProcessingInstructionImpl constructor
- */
- protected ProcessingInstructionImpl() {
- super();
- }
-
- /**
- * ProcessingInstructionImpl constructor
- *
- * @param that
- * ProcessingInstructionImpl
- */
- protected ProcessingInstructionImpl(ProcessingInstructionImpl that) {
- super(that);
-
- if (that != null) {
- this.target = that.target;
- this.data = that.getData();
- }
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- ProcessingInstructionImpl cloned = new ProcessingInstructionImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public String getData() {
- if (this.data != null)
- return this.data;
-
- IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return NodeImpl.EMPTY_STRING;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return NodeImpl.EMPTY_STRING;
-
- ITextRegion targetRegion = null;
- ITextRegion dataRegion = null;
- ITextRegion closeRegion = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_PI_OPEN)
- continue;
- if (regionType == DOMRegionContext.XML_PI_CLOSE) {
- closeRegion = region;
- }
- else {
- if (targetRegion == null)
- targetRegion = region;
- else if (dataRegion == null)
- dataRegion = region;
- }
- }
- if (dataRegion == null)
- return NodeImpl.EMPTY_STRING;
- int offset = dataRegion.getStart();
- int end = flatNode.getLength();
- if (closeRegion != null)
- end = closeRegion.getStart();
- String source = flatNode.getText();
- return source.substring(offset, end);
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return getTarget();
- }
-
- /**
- * getNodeType method
- *
- * @return short
- */
- public short getNodeType() {
- return PROCESSING_INSTRUCTION_NODE;
- }
-
- /**
- * getNodeValue method
- *
- * @return java.lang.String
- */
- public String getNodeValue() {
- return getData();
- }
-
- /**
- * getTarget method
- *
- * @return java.lang.String
- */
- public String getTarget() {
- if (this.target == null)
- return NodeImpl.EMPTY_STRING;
- return this.target;
- }
-
- /**
- */
- public boolean isClosed() {
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return true; // will be generated
- String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode);
- return (regionType == DOMRegionContext.XML_PI_CLOSE);
- }
-
- /**
- */
- void resetStructuredDocumentRegions() {
- this.data = getData();
- setStructuredDocumentRegion(null);
- }
-
- /**
- * setData method
- *
- * @param data
- * java.lang.String
- */
- public void setData(String data) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.data = data;
-
- notifyValueChanged();
- }
-
- /**
- * setNodeValue method
- *
- * @param nodeValue
- * java.lang.String
- */
- public void setNodeValue(String nodeValue) throws DOMException {
- setData(nodeValue);
- }
-
- /**
- */
- void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- super.setStructuredDocumentRegion(flatNode);
- if (flatNode != null)
- this.data = null;
- }
-
- /**
- * setTarget method
- *
- * @param target
- * java.lang.String
- */
- protected void setTarget(String target) {
- this.target = target;
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(getTarget());
- buffer.append('(');
- buffer.append(getData());
- buffer.append(')');
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java
deleted file mode 100644
index ad30e282ec..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/RangeImpl.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.ranges.RangeException;
-
-
-/**
- */
-public class RangeImpl implements Range {
- private Node endContainer = null;
- private int endOffset = 0;
-
- private Node startContainer = null;
- private int startOffset = 0;
-
- /**
- */
- protected RangeImpl() {
- super();
- }
-
- /**
- */
- protected RangeImpl(RangeImpl that) {
- super();
-
- if (that != null) {
- this.startContainer = that.startContainer;
- this.startOffset = that.startOffset;
- this.endContainer = that.endContainer;
- this.endOffset = that.endOffset;
- }
- }
-
- /**
- * Duplicates the contents of a Range
- *
- * @return A DocumentFragment that contains content equivalent to this
- * Range.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node
- * would be extracted into the new DocumentFragment. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public DocumentFragment cloneContents() throws DOMException {
- // not supported
- return null;
- }
-
- /**
- * Produces a new Range whose boundary-points are equal to the
- * boundary-points of the Range.
- *
- * @return The duplicated Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public Range cloneRange() throws DOMException {
- return new RangeImpl(this);
- }
-
- /**
- * Collapse a Range onto one of its boundary-points
- *
- * @param toStartIf
- * TRUE, collapses the Range onto its start; if FALSE,
- * collapses it onto its end.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void collapse(boolean toStart) throws DOMException {
- if (toStart) {
- this.endContainer = this.startContainer;
- this.endOffset = this.startOffset;
- } else {
- this.startContainer = this.endContainer;
- this.startOffset = this.endOffset;
- }
- }
-
- /**
- * Compare the boundary-points of two Ranges in a document.
- *
- * @param howA
- * code representing the type of comparison, as defined above.
- * @param sourceRangeThe
- * <code>Range</code> on which this current
- * <code>Range</code> is compared to.
- * @return -1, 0 or 1 depending on whether the corresponding
- * boundary-point of the Range is respectively before, equal to,
- * or after the corresponding boundary-point of
- * <code>sourceRange</code>.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in
- * the same Document or DocumentFragment. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public short compareBoundaryPoints(short how, Range sourceRange) throws DOMException {
- if (sourceRange == null)
- return (short) 0; // error
-
- Node container1 = null;
- int offset1 = 0;
- Node container2 = null;
- int offset2 = 0;
-
- switch (how) {
- case START_TO_START :
- container1 = this.startContainer;
- offset1 = this.startOffset;
- container2 = sourceRange.getStartContainer();
- offset2 = sourceRange.getStartOffset();
- break;
- case START_TO_END :
- container1 = this.startContainer;
- offset1 = this.startOffset;
- container2 = sourceRange.getEndContainer();
- offset2 = sourceRange.getEndOffset();
- break;
- case END_TO_END :
- container1 = this.endContainer;
- offset1 = this.endOffset;
- container2 = sourceRange.getEndContainer();
- offset2 = sourceRange.getEndOffset();
- break;
- case END_TO_START :
- container1 = this.endContainer;
- offset1 = this.endOffset;
- container2 = sourceRange.getStartContainer();
- offset2 = sourceRange.getStartOffset();
- break;
- default :
- return (short) 0; // error
- }
-
- return comparePoints(container1, offset1, container2, offset2);
- }
-
- /*
- */
- protected short comparePoints(Node container1, int offset1, Node container2, int offset2) {
- if (container1 == null || container2 == null)
- return (short) 0; // error
-
- if (container1 == container2) {
- if (offset1 > offset2)
- return (short) 1;
- if (offset1 < offset2)
- return (short) -1;
- return 0;
- }
-
- // get node offsets
- IDOMNode node1 = null;
- if (container1.hasChildNodes()) {
- Node child = container1.getFirstChild();
- for (int i = 0; i < offset1; i++) {
- Node next = child.getNextSibling();
- if (next == null)
- break;
- child = next;
- }
- node1 = (IDOMNode) child;
- offset1 = 0;
- } else {
- node1 = (IDOMNode) container1;
- }
- int nodeOffset1 = node1.getStartOffset();
- IDOMNode node2 = null;
- if (container2.hasChildNodes()) {
- Node child = container2.getFirstChild();
- for (int i = 0; i < offset2; i++) {
- Node next = child.getNextSibling();
- if (next == null)
- break;
- child = next;
- }
- node2 = (IDOMNode) child;
- offset2 = 0;
- } else {
- node2 = (IDOMNode) container2;
- }
- int nodeOffset2 = node2.getStartOffset();
-
- if (nodeOffset1 > nodeOffset2)
- return (short) 1;
- if (nodeOffset1 < nodeOffset2)
- return (short) -1;
- if (offset1 > offset2)
- return (short) 1;
- if (offset1 < offset2)
- return (short) -1;
- return (short) 0;
- }
-
- /**
- * Removes the contents of a Range from the containing document or
- * document fragment without returning a reference to the removed content.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of
- * the content of the Range is read-only or any of the
- * nodes that contain any of the content of the Range are
- * read-only. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void deleteContents() throws DOMException {
- // not supported
- }
-
- /**
- * Called to indicate that the Range is no longer in use and that the
- * implementation may relinquish any resources associated with this Range.
- * Subsequent calls to any methods or attribute getters on this Range will
- * result in a <code>DOMException</code> being thrown with an error code
- * of <code>INVALID_STATE_ERR</code>.
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void detach() throws DOMException {
- this.startContainer = null;
- this.startOffset = 0;
- this.endContainer = null;
- this.endOffset = 0;
- }
-
- /**
- * Moves the contents of a Range from the containing document or document
- * fragment to a new DocumentFragment.
- *
- * @return A DocumentFragment containing the extracted contents.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of
- * the content of the Range is read-only or any of the
- * nodes which contain any of the content of the Range are
- * read-only. <br>
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node
- * would be extracted into the new DocumentFragment. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public DocumentFragment extractContents() throws DOMException {
- // not supported
- return null;
- }
-
- /**
- * TRUE if the Range is collapsed
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public boolean getCollapsed() throws DOMException {
- if (this.startContainer == this.endContainer && this.startOffset == this.endOffset)
- return true;
- return false;
- }
-
- /**
- * The deepest common ancestor container of the Range's two
- * boundary-points.
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public Node getCommonAncestorContainer() throws DOMException {
- if (this.startContainer == null)
- return null;
- return ((NodeImpl) this.startContainer).getCommonAncestor(this.endContainer);
- }
-
- /**
- * Node within which the Range ends
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public Node getEndContainer() throws DOMException {
- return this.endContainer;
- }
-
- /**
- * Offset within the ending node of the Range.
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public int getEndOffset() throws DOMException {
- return this.endOffset;
- }
-
- /**
- * Node within which the Range begins
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public Node getStartContainer() throws DOMException {
- return this.startContainer;
- }
-
- /**
- * Offset within the starting node of the Range.
- *
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public int getStartOffset() throws DOMException {
- return this.startOffset;
- }
-
- /**
- * Inserts a node into the Document or DocumentFragment at the start of
- * the Range. If the container is a Text node, this will be split at the
- * start of the Range (as if the Text node's splitText method was
- * performed at the insertion point) and the insertion will occur between
- * the two resulting Text nodes. Adjacent Text nodes will not be
- * automatically merged. If the node to be inserted is a DocumentFragment
- * node, the children will be inserted rather than the DocumentFragment
- * node itself.
- *
- * @param newNodeThe
- * node to insert at the start of the Range
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor
- * container of the start of the Range is read-only. <br>
- * WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and
- * the container of the start of the Range were not created
- * from the same document. <br>
- * HIERARCHY_REQUEST_ERR: Raised if the container of the
- * start of the Range is of a type that does not allow
- * children of the type of <code>newNode</code> or if
- * <code>newNode</code> is an ancestor of the container.
- * <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code>
- * is an Attr, Entity, Notation, or Document node.
- */
- public void insertNode(Node newNode) throws RangeException, DOMException {
- // not supported
- }
-
- /**
- * Select a node and its contents
- *
- * @param refNodeThe
- * node to select.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of
- * <code>refNode</code> is an Entity, Notation or
- * DocumentType node or if <code>refNode</code> is a
- * Document, DocumentFragment, Attr, Entity, or Notation
- * node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void selectNode(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- Node parent = refNode.getParentNode();
- if (parent == null)
- return;
- int index = ((NodeImpl) refNode).getIndex();
- if (index < 0)
- return;
- setStart(parent, index);
- setEnd(parent, index + 1);
- }
-
- /**
- * Select the contents within a node
- *
- * @param refNodeNode
- * to select from
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
- * or an ancestor of <code>refNode</code> is an Entity,
- * Notation or DocumentType node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void selectNodeContents(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- if (refNode.getNodeType() == Node.TEXT_NODE) {
- Text text = (Text) refNode;
- setStart(refNode, 0);
- setEnd(refNode, text.getLength());
- } else {
- NodeList childNodes = refNode.getChildNodes();
- int length = (childNodes != null ? childNodes.getLength() : 0);
- setStart(refNode, 0);
- setEnd(refNode, length);
- }
- }
-
- /**
- * Sets the attributes describing the end of a Range.
- *
- * @param refNodeThe
- * <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offsetThe
- * <code>endOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
- * or an ancestor of <code>refNode</code> is an Entity,
- * Notation, or DocumentType node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is
- * negative or greater than the number of child units in
- * <code>refNode</code>. Child units are 16-bit units if
- * <code>refNode</code> is a type of CharacterData node
- * (e.g., a Text or Comment node) or a
- * ProcessingInstruction node. Child units are Nodes in all
- * other cases. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setEnd(Node refNode, int offset) throws RangeException, DOMException {
- this.endContainer = refNode;
- this.endOffset = offset;
- }
-
- /**
- * Sets the end of a Range to be after a node
- *
- * @param refNodeRange
- * ends after <code>refNode</code>.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document or
- * DocumentFragment node or if <code>refNode</code> is a
- * Document, DocumentFragment, Attr, Entity, or Notation
- * node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setEndAfter(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- Node parent = refNode.getParentNode();
- if (parent == null)
- return;
- int index = ((NodeImpl) refNode).getIndex();
- if (index < 0)
- return;
- setEnd(parent, index + 1);
- }
-
- /**
- * Sets the end position to be before a node.
- *
- * @param refNodeRange
- * ends before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or
- * DocumentFragment node or if <code>refNode</code> is a
- * Document, DocumentFragment, Attr, Entity, or Notation
- * node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setEndBefore(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- Node parent = refNode.getParentNode();
- if (parent == null)
- return;
- int index = ((NodeImpl) refNode).getIndex();
- if (index < 0)
- return;
- setEnd(parent, index);
- }
-
- /**
- * Sets the attributes describing the start of the Range.
- *
- * @param refNodeThe
- * <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offsetThe
- * <code>startOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code>
- * or an ancestor of <code>refNode</code> is an Entity,
- * Notation, or DocumentType node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is
- * negative or greater than the number of child units in
- * <code>refNode</code>. Child units are 16-bit units if
- * <code>refNode</code> is a type of CharacterData node
- * (e.g., a Text or Comment node) or a
- * ProcessingInstruction node. Child units are Nodes in all
- * other cases. <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setStart(Node refNode, int offset) throws RangeException, DOMException {
- this.startContainer = refNode;
- this.startOffset = offset;
- }
-
- /**
- * Sets the start position to be after a node
- *
- * @param refNodeRange
- * starts after <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or
- * DocumentFragment node or if <code>refNode</code> is a
- * Document, DocumentFragment, Attr, Entity, or Notation
- * node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setStartAfter(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- Node parent = refNode.getParentNode();
- if (parent == null)
- return;
- int index = ((NodeImpl) refNode).getIndex();
- if (index < 0)
- return;
- setStart(parent, index + 1);
- }
-
- /**
- * Sets the start position to be before a node
- *
- * @param refNodeRange
- * starts before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or
- * DocumentFragment node or if <code>refNode</code> is a
- * Document, DocumentFragment, Attr, Entity, or Notation
- * node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- */
- public void setStartBefore(Node refNode) throws RangeException, DOMException {
- if (refNode == null)
- return;
- Node parent = refNode.getParentNode();
- if (parent == null)
- return;
- int index = ((NodeImpl) refNode).getIndex();
- if (index < 0)
- return;
- setStart(parent, index);
- }
-
- /**
- * Reparents the contents of the Range to the given node and inserts the
- * node at the position of the start of the Range.
- *
- * @param newParentThe
- * node to surround the contents with.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor
- * container of either boundary-point of the Range is
- * read-only. <br>
- * WRONG_DOCUMENT_ERR: Raised if <code> newParent</code>
- * and the container of the start of the Range were not
- * created from the same document. <br>
- * HIERARCHY_REQUEST_ERR: Raised if the container of the
- * start of the Range is of a type that does not allow
- * children of the type of <code>newParent</code> or if
- * <code>newParent</code> is an ancestor of the container
- * or if <code>node</code> would end up with a child node
- * of a type not allowed by the type of <code>node</code>.
- * <br>
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has
- * already been invoked on this object.
- * @exception RangeException
- * BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially
- * selects a non-text node. <br>
- * INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is
- * an Attr, Entity, DocumentType, Notation, Document, or
- * DocumentFragment node.
- */
- public void surroundContents(Node newParent) throws RangeException, DOMException {
- // not supported
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
deleted file mode 100644
index 57c2375444..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-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.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-
-class ReadOnlyController {
-
- class Span {
- int length;
- int offset;
-
- Span(int offset, int length) {
- this.offset = offset;
- this.length = length;
- }
- }
-
- private static ReadOnlyController fInstance;
-
- static synchronized ReadOnlyController getInstance() {
- if (fInstance == null) {
- fInstance = new ReadOnlyController();
- }
- return fInstance;
- }
-
- static private void lock(IStructuredDocument doc, int offset, int length, boolean canInsertBefore, boolean canInsertAfter) {
- if (doc == null) {
- return;
- }
- if (doc instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument)doc).makeReadOnly(offset, length, canInsertBefore, canInsertAfter);
- } else {
- doc.makeReadOnly(offset, length);
- }
- }
-
- static private void lock(IStructuredDocumentRegion node, boolean canInsertBefore, boolean canInsertAfter) {
- if (node == null) {
- return;
- }
- IStructuredDocument doc = node.getParentDocument();
- if (doc == null) {
- return;
- }
- if (doc instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument)doc).makeReadOnly(node.getStart(), node.getLength(), canInsertBefore, canInsertAfter);
- } else {
- doc.makeReadOnly(node.getStart(), node.getLength());
- }
- }
-
- static private void unlock(IStructuredDocumentRegion node) {
- if (node == null) {
- return;
- }
- IStructuredDocument doc = node.getParentDocument();
- if (doc == null) {
- return;
- }
- doc.clearReadOnly(node.getStart(), node.getLength());
- }
-
- private ReadOnlyController() {
- super();
- }
-
- private Span getDataSpan(IDOMNode node) {
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE :
- return getDataSpanForElement((IDOMElement) node);
- case Node.TEXT_NODE :
- return getDataSpanForText((IDOMText) node);
- default :
- return new Span(0, -1);
- }
- }
-
- private Span getDataSpanForElement(IDOMElement node) {
- IStructuredDocumentRegion docRegion = node.getStartStructuredDocumentRegion();
- if (docRegion == null) {
- return new Span(0, -1);
- }
-
- ITextRegionList regions = docRegion.getRegions();
- if (regions == null) {
- return new Span(0, -1);
- }
-
- String startType;
- String endType;
- if (node.isCommentTag()) {
- startType = DOMRegionContext.XML_COMMENT_OPEN;
- endType = DOMRegionContext.XML_COMMENT_CLOSE;
- } else {
- startType = DOMRegionContext.XML_TAG_NAME;
- endType = DOMRegionContext.XML_TAG_CLOSE;
- }
-
- int startOffset = -1;
- int endOffset = -1;
- ITextRegion prevRegion = null;
- ITextRegion region;
- for (int i = 0; i < regions.size(); i++) {
- region = regions.get(i);
- String type = region.getType();
- if (type == startType) {
- startOffset = region.getEnd();
- } else if (type == endType && prevRegion != null) {
- endOffset = prevRegion.getTextEnd();
- }
- prevRegion = region;
- }
-
- if (0 <= startOffset && 0 <= endOffset) {
- return new Span(startOffset, endOffset - startOffset);
- } else {
- return new Span(0, -1);
- }
- }
-
- private Span getDataSpanForText(IDOMText node) {
- IStructuredDocumentRegion docRegion = ((NodeImpl) node).getStructuredDocumentRegion();
- if (docRegion == null) {
- return new Span(0, -1);
- }
- return new Span(0, docRegion.getLength());
- }
-
- /**
- * This method is used from parent's setChildEditable()
- *
- * case 1:<parent><node attr="value"/> <node2></parent>
- * x####################x case 2:<parent><node attr="value"> <child>
- * </child> </node> </parent> x###################? ?#######x (? :
- * editable if node.isEditable() == true)
- */
- void lockBoth(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- IStructuredDocumentRegion flatNode;
- boolean canInsert = false;
-
- // end node (element)
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- flatNode = node.getEndStructuredDocumentRegion();
- if (flatNode != null) {
- canInsert = node.isChildEditable();
- lock(flatNode, canInsert, false);
- }
- }
- // start node
- flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- lock(flatNode, false, canInsert);
- }
- }
-
- void lockData(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- Span span = getDataSpan(node);
- if (0 <= span.length) {
- lock(node.getModel().getStructuredDocument(), node.getStartOffset() + span.offset, span.length, false, false);
- }
- }
-
- /**
- * lock itself and all descendants
- */
- void lockDeep(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- int offset = node.getStartOffset();
- int length = node.getEndOffset() - offset;
-
- boolean canInsert = true;
- IDOMNode parent = (IDOMNode) node.getParentNode();
- if (parent != null && !parent.isChildEditable()) {
- canInsert = false;
- }
- lock(node.getStructuredDocument(), offset, length, canInsert, canInsert);
- }
-
- /**
- * This method is used from parent's setChildEditable()
- *
- * case 1:<parent><node attr="value"/> <node2></parent> x######x x##x
- * case 2:<parent><node attr="value"> <child></child> </node> </parent>
- * x######x x#? ?#######x (? : editable if node.isEditable() == true)
- */
- void lockNode(IDOMNode node) {
- if (node == null) {
- return;
- }
- if (!node.isDataEditable()) {
- lockBoth(node);
- return;
- }
-
- IStructuredDocumentRegion flatNode;
- boolean canInsert = false;
-
- // end node (element)
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- flatNode = node.getEndStructuredDocumentRegion();
- if (flatNode != null) {
- canInsert = node.isChildEditable();
- lock(flatNode, canInsert, false);
- }
- }
- // start node
- flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- Span span = getDataSpan(node);
- if (0 <= span.length) {
- IStructuredDocument structuredDocument = flatNode.getParentDocument();
- int offset, length;
- offset = flatNode.getStart();
- length = span.offset;
- lock(structuredDocument, offset, length, false, false);
- offset = offset + span.offset + span.length;
- length = flatNode.getEnd() - offset;
- lock(structuredDocument, offset, length, false, canInsert);
- } else {
- lock(flatNode, false, canInsert);
- }
- }
- }
-
- private void unlock(IStructuredDocument doc, int offset, int length) {
- if (doc == null) {
- return;
- }
- doc.clearReadOnly(offset, length);
- }
-
- void unlockBoth(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- IStructuredDocumentRegion flatNode;
- // start node
- flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- unlock(flatNode);
- }
- // end node
- flatNode = node.getEndStructuredDocumentRegion();
- if (flatNode != null) {
- unlock(flatNode);
- }
- }
-
- void unlockData(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- Span span = getDataSpan(node);
- if (0 <= span.length) {
- unlock(node.getModel().getStructuredDocument(), span.offset, span.length);
- }
- }
-
- void unlockDeep(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- int offset = node.getStartOffset();
- int length = node.getEndOffset() - offset;
-
- unlock(node.getStructuredDocument(), offset, length);
- }
-
- void unlockNode(IDOMNode node) {
- if (node == null) {
- return;
- }
-
- IStructuredDocumentRegion flatNode;
- // end node
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- flatNode = node.getEndStructuredDocumentRegion();
- if (flatNode != null) {
- unlock(flatNode);
- }
- }
-
- // start node
- flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- if (node.isDataEditable()) {
- unlock(flatNode);
- } else {
- Span span = getDataSpan(node);
- if (span.length <= 0) {
- unlock(flatNode);
- } else {
- IStructuredDocument structuredDocument = flatNode.getParentDocument();
- int offset, length;
- offset = flatNode.getStart();
- length = span.offset - offset;
- unlock(structuredDocument, offset, length);
- offset = span.offset + span.length;
- length = flatNode.getEnd() - span.offset;
- unlock(structuredDocument, offset, length);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
deleted file mode 100644
index 2051222cfd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- */
-public class SourceValidator {
-
- private NodeImpl node = null;
-
- /**
- */
- public SourceValidator(Node node) {
- super();
-
- if (node != null) {
- this.node = (NodeImpl) node;
- }
- }
-
- /**
- */
- public String convertSource(String source) {
- if (source == null)
- return null;
- if (this.node == null)
- return null; // error
-
- // setup conversion conditions
- boolean acceptTag = false;
- boolean acceptClose = false;
- boolean acceptQuote = false;
- boolean acceptAmpersand = false;
- boolean acceptEntityRef = true;
- boolean acceptJSPEnd = true;
- String endTagName = null;
- if (this.node.getNodeType() == Node.ATTRIBUTE_NODE) {
- IDOMDocument document = (IDOMDocument) this.node.getOwnerDocument();
- if (document != null && document.isJSPType())
- acceptTag = true;
- if (acceptTag) {
- Attr attr = (Attr) this.node;
- ElementImpl element = (ElementImpl) attr.getOwnerElement();
- if (element != null && element.isJSPTag())
- acceptTag = false;
- }
- // if the source does not include single quote,
- // double quote is valid
- acceptQuote = (source.indexOf('\'') < 0);
- } else if (this.node.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) this.node;
- if (text.isJSPContent()) {
- int index = source.indexOf(JSPTag.TAG_CLOSE);
- if (index < 0)
- return source;
- acceptTag = true;
- acceptClose = true;
- acceptQuote = true;
- acceptAmpersand = true;
- acceptJSPEnd = false;
- } else if (text.isCDATAContent()) {
- endTagName = text.getParentNode().getNodeName();
- if (endTagName == null)
- return null; // error
- acceptTag = true;
- acceptClose = true;
- acceptQuote = true;
- acceptAmpersand = true;
- }
- } else {
- IDOMDocument document = null;
- if (this.node.getNodeType() == Node.DOCUMENT_NODE) {
- document = (IDOMDocument) this.node;
- } else {
- document = (IDOMDocument) this.node.getOwnerDocument();
- }
- if (document != null && document.isJSPType())
- acceptTag = true;
- }
-
- StringBuffer buffer = null;
- int copiedLength = 0;
- int length = source.length();
- for (int i = 0; i < length; i++) {
- String ref = null;
- char c = source.charAt(i);
- switch (c) {
- case '<' :
- if (acceptTag) {
- if (endTagName != null) {
- if (!matchEndTag(source, i + 1, endTagName))
- continue;
- } else {
- int skip = skipTag(source, i + 1);
- if (skip >= 0) {
- i += skip;
- continue;
- }
- }
- // invalid JSP tag
- }
- ref = IXMLCharEntity.LT_REF;
- break;
- case '>' :
- if (acceptClose)
- continue;
- ref = IXMLCharEntity.GT_REF;
- break;
- case '&' :
- if (acceptAmpersand)
- continue;
- if (acceptEntityRef) {
- int skip = skipEntityRef(source, i + 1);
- if (skip >= 0) {
- i += skip;
- continue;
- }
- }
- ref = IXMLCharEntity.AMP_REF;
- break;
- case '"' :
- if (acceptQuote)
- continue;
- ref = IXMLCharEntity.QUOT_REF;
- break;
- case '%' :
- if (acceptJSPEnd)
- continue;
- if (source.charAt(i + 1) != '>')
- continue;
- i++;
- ref = IXMLCharEntity.GT_REF;
- break;
- default :
- continue;
- }
-
- if (ref != null) {
- if (buffer == null) {
- buffer = new StringBuffer(length + 8);
- }
- if (i > copiedLength) {
- buffer.append(source.substring(copiedLength, i));
- }
- buffer.append(ref);
- copiedLength = i + 1; // skip this character
- }
- }
-
- if (buffer != null) {
- if (copiedLength < length) {
- buffer.append(source.substring(copiedLength, length));
- }
- return buffer.toString();
- }
- return source;
- }
-
- /**
- */
- private final boolean matchEndTag(String source, int offset, String endTagName) {
- if (source == null || endTagName == null)
- return false;
- int length = source.length();
- if (offset < 0 || offset >= length)
- return false;
- if (source.charAt(offset) != '/')
- return false;
- offset++;
- int end = offset + endTagName.length();
- if (end > length)
- return false;
- return endTagName.equalsIgnoreCase(source.substring(offset, end));
- }
-
- /**
- */
- private final int skipEntityRef(String source, int offset) {
- if (source == null)
- return -1;
- if (offset < 0 || offset >= source.length())
- return -1;
- DocumentImpl document = (DocumentImpl) this.node.getOwnerDocument();
- if (document == null)
- return -1; // error
-
- int end = source.indexOf(';', offset);
- if (end < 0 || end == offset)
- return -1;
- String name = source.substring(offset, end);
- if (name == null || document.getCharValue(name) == null)
- return -1;
- return (end + 1 - offset);
- }
-
- /**
- */
- private final int skipTag(String source, int offset) {
- if (source == null)
- return -1;
- if (offset < 0 || offset >= source.length())
- return -1;
-
- int end = offset;
- if (source.charAt(offset) == '%') {
- // JSP tag
- int found = source.indexOf(JSPTag.TAG_CLOSE, offset + 1);
- if (found < 0)
- return -1; // invalid JSP tag
- end = found + 2;
- } else {
- // normal tag
- int found = source.lastIndexOf('>');
- if (found < offset)
- return -1; // invalid tag
- end = found + 1;
- }
- return (end - offset);
- }
-
- /**
- */
- public boolean validateSource(String source) throws InvalidCharacterException {
- if (source == null)
- return true;
- if (this.node == null)
- return false; // error
- String message = null;
-
-
- // setup validation conditions
- boolean acceptTag = false;
- boolean acceptClose = false;
- boolean acceptQuote = true;
- boolean acceptEntityRef = true;
- String endTagName = null;
- if (this.node.getNodeType() == Node.ATTRIBUTE_NODE) {
- IDOMDocument document = (IDOMDocument) this.node.getOwnerDocument();
- if (document != null && document.isJSPType())
- acceptTag = true;
- if (acceptTag) {
- Attr attr = (Attr) this.node;
- ElementImpl element = (ElementImpl) attr.getOwnerElement();
- if (element != null && element.isJSPTag())
- acceptTag = false;
- }
- // if the source does not include single quote,
- // double quote is valid
- acceptQuote = (source.indexOf('\'') < 0);
- } else if (this.node.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) this.node;
- if (text.isJSPContent()) {
- int index = source.indexOf(JSPTag.TAG_CLOSE);
- if (index < 0)
- return true;
- message = XMLCoreMessages.Invalid_character_gt_fo_ERROR_;
- throw new InvalidCharacterException(message, '>', index + 1);
- } else if (text.isCDATAContent()) {
- endTagName = text.getParentNode().getNodeName();
- if (endTagName == null)
- return false; // error
- acceptTag = true;
- acceptClose = true;
- } else if(hasNestedRegion(text)) {
- //there are cases (such as with EL) that the text is to complicated
- // to be verified by this validator
- return true;
- }
- } else {
- IDOMDocument document = null;
- if (this.node.getNodeType() == Node.DOCUMENT_NODE) {
- document = (IDOMDocument) this.node;
- } else {
- document = (IDOMDocument) this.node.getOwnerDocument();
- }
- if (document != null && document.isJSPType())
- acceptTag = true;
- }
-
- char c = 0;
- int length = source.length();
- for (int i = 0; i < length; i++) {
- c = source.charAt(i);
- switch (c) {
- case '<' :
- if (acceptTag) {
- if (endTagName != null) {
- if (!matchEndTag(source, i + 1, endTagName))
- continue;
- } else {
- int skip = skipTag(source, i + 1);
- if (skip >= 0) {
- i += skip;
- continue;
- }
- }
- // invalid tag
- }
- message = XMLCoreMessages.Invalid_character_lt_fo_ERROR_;
- break;
- case '>' :
- if (acceptClose)
- continue;
- message = XMLCoreMessages.Invalid_character_gt_fo_ERROR_;
- break;
- case '&' :
- if (acceptEntityRef) {
- if (endTagName != null)
- continue;
- int skip = skipEntityRef(source, i + 1);
- if (skip >= 0) {
- i += skip;
- continue;
- }
- // invalid entity reference
- }
- message = XMLCoreMessages.Invalid_character_amp_fo_ERROR_;
- break;
- case '"' :
- if (acceptQuote)
- continue;
- message = XMLCoreMessages.Invalid_character__f_EXC_;
- break;
- default :
- continue;
- }
-
- if (message != null) {
- throw new InvalidCharacterException(message, c, i);
- }
- }
-
- return true;
- }
-
- /**
- * True if the text has nested regions, meaning container is probably too
- * complicated (like EL regions) to validate with this validator.
- *
- * @param text
- * @return
- */
- private boolean hasNestedRegion(TextImpl text) {
- boolean done = false;
-
- IStructuredDocumentRegion currRegion = text.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastRegion = text.getLastStructuredDocumentRegion();
-
- while(currRegion != null && !done) {
-
- ITextRegionList regions = currRegion.getRegions();
- for(int i = 0; i < regions.size(); ++i) {
- ITextRegion container = regions.get(i);
- if ((container instanceof ITextRegionContainer)) {
- ITextRegionList regions2 = ((ITextRegionContainer) container).getRegions();
- if (regions2 != null) {
- return true;
- }
- }
- }
-
- done = currRegion == lastRegion;
- currRegion = currRegion.getNext();
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java
deleted file mode 100644
index 547c8f35c5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionChecker.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-/**
- * This class is only for debug purpose.
- */
-public class StructuredDocumentRegionChecker {
- String EOL = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private int offset = 0;
- Writer testWriter = null;
-
- /**
- */
- public StructuredDocumentRegionChecker() {
- super();
- }
-
- public StructuredDocumentRegionChecker(Writer writer) {
- super();
- testWriter = writer;
- }
-
- /**
- */
- private void checkChildNodes(Node node) {
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- checkNode(child);
- }
- }
-
- /**
- */
- public void checkModel(IDOMModel model) {
- checkChildNodes(model.getDocument());
- }
-
- /**
- */
- private void checkNode(Node node) {
- checkStructuredDocumentRegion(((NodeImpl) node).getStructuredDocumentRegion());
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- checkChildNodes(node);
- checkStructuredDocumentRegion(((ElementImpl) node).getEndStructuredDocumentRegion());
- }
- }
-
- /**
- */
- private void checkStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return;
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int n = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < n; i++) {
- IStructuredDocumentRegion c = container.getStructuredDocumentRegion(i);
- if (c == null) {
- reportError("null"); //$NON-NLS-1$
- continue;
- }
- checkStructuredDocumentRegion(c);
- }
- return;
- }
-
- int start = flatNode.getStart();
- if (start < this.offset)
- reportError("overwrap"); //$NON-NLS-1$
- if (start > this.offset)
- reportError("gap"); //$NON-NLS-1$
- int end = flatNode.getEnd();
- this.offset = end;
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- IStructuredDocumentRegion p = proxy.getStructuredDocumentRegion();
- if (p == null) {
- reportError("null"); //$NON-NLS-1$
- return;
- }
- int s = p.getStart();
- int e = p.getEnd();
- if (s > start || e < end)
- reportError("out"); //$NON-NLS-1$
- if (s == start && e == end)
- reportWarning("vain"); //$NON-NLS-1$
- }
- }
-
- /**
- */
- private void reportError(String message) {
- String msg = "StructuredDocumentRegionChecker : error : " + message; //$NON-NLS-1$
- if (testWriter != null) {
- try {
- testWriter.write(msg + EOL);
- } catch (IOException e) {
- e.printStackTrace();
- }
- } else {
- System.out.println(msg);
- }
- throw new StructuredDocumentRegionManagementException();
- }
-
- /**
- */
- private void reportWarning(String message) {
- String msg = "StructuredDocumentRegionChecker : warning : " + message; //$NON-NLS-1$
- if (testWriter != null) {
- try {
- testWriter.write(msg + EOL);
- } catch (IOException e) {
- e.printStackTrace();
- }
- } else {
- System.out.println(msg);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
deleted file mode 100644
index 245211d84d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
+++ /dev/null
@@ -1,435 +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
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Vector;
-
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-class StructuredDocumentRegionContainer implements IStructuredDocumentRegion {
-
- private Vector flatNodes = new Vector(2);
-
- /**
- */
- StructuredDocumentRegionContainer() {
- super();
- }
-
-
- public void addRegion(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjust(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustLength(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustStart(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustTextLength(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- /**
- */
- void appendStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return;
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- if (container.getStructuredDocumentRegionCount() > 0) {
- this.flatNodes.addAll(container.flatNodes);
- }
- }
- else {
- this.flatNodes.addElement(flatNode);
- }
- }
-
- public boolean containsOffset(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public boolean containsOffset(ITextRegion region, int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void equatePositions(ITextRegion region) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public ITextRegion getDeepestRegionAtCharacterOffset(int offset) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public int getEnd() {
- IStructuredDocumentRegion last = getLastStructuredDocumentRegion();
- if (last == null)
- return 0;
- return last.getEnd();
- }
-
- /**
- */
- public int getEndOffset() {
- return getEnd();
- }
-
- public int getEndOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public ITextRegion getFirstRegion() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- if (this.flatNodes.isEmpty())
- return null;
- return (IStructuredDocumentRegion) this.flatNodes.elementAt(0);
- }
-
- /**
- */
- public String getFullText() {
- return getText();
- }
-
- /**
- */
- public String getFullText(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public String getFullText(String context) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public ITextRegion getLastRegion() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- int size = this.flatNodes.size();
- if (size == 0)
- return null;
- return (IStructuredDocumentRegion) this.flatNodes.elementAt(size - 1);
- }
-
- /**
- */
- public int getLength() {
- return (getEnd() - getStart());
- }
-
- public IStructuredDocumentRegion getNext() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public int getNumberOfRegions() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public ITextRegionContainer getParent() {
- return null;
- }
-
- public IStructuredDocument getParentDocument() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public IStructuredDocumentRegion getPrevious() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public ITextRegion getRegionAtCharacterOffset(int offset) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public ITextRegionList getRegions() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public int getStart() {
- IStructuredDocumentRegion first = getFirstStructuredDocumentRegion();
- if (first == null)
- return 0;
- return first.getStart();
- }
-
- /**
- */
- public int getStartOffset() {
- return getStart();
- }
-
- public int getStartOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public IStructuredDocument getStructuredDocument() {
- IStructuredDocumentRegion first = getFirstStructuredDocumentRegion();
- if (first == null)
- return null;
- return first.getParentDocument();
- }
-
- /**
- */
- IStructuredDocumentRegion getStructuredDocumentRegion(int index) {
- if (index < 0 || index >= this.flatNodes.size())
- return null;
- return (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
- }
-
- /**
- */
- int getStructuredDocumentRegionCount() {
- return this.flatNodes.size();
- }
-
- /**
- */
- public String getText() {
- int size = this.flatNodes.size();
- if (size == 0)
- return NodeImpl.EMPTY_STRING;
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < size; i++) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(i);
- if (flatNode == null)
- continue;
- buffer.append(flatNode.getText());
- }
- return buffer.toString();
- }
-
- /**
- */
- public String getText(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public String getText(String context) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public int getTextEnd() {
- return getEnd();
- }
-
- /**
- */
- public int getTextEndOffset() {
- return getTextEnd();
- }
-
- public int getTextEndOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- * The text length is equal to length if there is no white space at the
- * end of a region. Otherwise it is smaller than length.
- */
- public int getTextLength() {
- return (getTextEnd() - getStart());
- }
-
- /**
- */
- public String getType() {
- return "StructuredDocumentRegionContainer";//$NON-NLS-1$
- }
-
- /**
- */
- void insertStructuredDocumentRegion(IStructuredDocumentRegion flatNode, int index) {
- if (flatNode == null)
- return;
- if (index < 0)
- return;
- int size = this.flatNodes.size();
- if (index > size)
- return;
- if (index == size) {
- appendStructuredDocumentRegion(flatNode);
- return;
- }
- this.flatNodes.insertElementAt(flatNode, index);
- }
-
- public boolean isEnded() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- IStructuredDocumentRegion removeStructuredDocumentRegion(int index) {
- if (index < 0 || index >= this.flatNodes.size())
- return null;
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
- this.flatNodes.removeElementAt(index);
- return flatNode;
- }
-
- /**
- */
- IStructuredDocumentRegion removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (oldStructuredDocumentRegion == null)
- return null;
- int size = this.flatNodes.size();
- for (int i = 0; i < size; i++) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(i);
- if (flatNode == oldStructuredDocumentRegion) {
- this.flatNodes.removeElementAt(i);
- return flatNode;
- }
- }
- return null; // not found
- }
-
- /**
- */
- IStructuredDocumentRegion replaceStructuredDocumentRegion(IStructuredDocumentRegion flatNode, int index) {
- if (flatNode == null)
- return removeStructuredDocumentRegion(index);
- if (index < 0 || index >= this.flatNodes.size())
- return null;
- IStructuredDocumentRegion oldStructuredDocumentRegion = (IStructuredDocumentRegion) this.flatNodes.elementAt(index);
- this.flatNodes.setElementAt(flatNode, index);
- return oldStructuredDocumentRegion;
- }
-
- public boolean sameAs(IStructuredDocumentRegion region, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public boolean sameAs(ITextRegion region, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setEnded(boolean hasEnd) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setLength(int newLength) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setNext(IStructuredDocumentRegion newNext) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setParentDocument(IStructuredDocument document) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setPrevious(IStructuredDocumentRegion newPrevious) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public void setRegions(ITextRegionList embeddedRegions) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setStart(int newStart) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append('{');
- int count = getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- if (i != 0)
- buffer.append(',');
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion(i);
- if (flatNode == null)
- buffer.append("null");//$NON-NLS-1$
- else
- buffer.append(flatNode.toString());
- }
- buffer.append('}');
- return buffer.toString();
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int start, int end) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
-
- public boolean isDeleted() {
- // if someone "gets" these temp regions by
- // accident, we'll always return "deleted".
- return true;
- }
-
-
- public void setDeleted(boolean deleted) {
- // do nothing
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java
deleted file mode 100644
index 90fecbe615..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java
+++ /dev/null
@@ -1,33 +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.xml.core.internal.document;
-
-
-
-
-/**
- */
-public class StructuredDocumentRegionManagementException extends RuntimeException {
-
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * StructuredDocumentRegionManagementException constructor
- */
- public StructuredDocumentRegionManagementException() {
- super("IStructuredDocumentRegion management failed.");//$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
deleted file mode 100644
index 531226086a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
+++ /dev/null
@@ -1,369 +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
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-class StructuredDocumentRegionProxy implements IStructuredDocumentRegion {
- private IStructuredDocumentRegion flatNode = null;
- private int length = 0;
-
- private int offset = 0;
-
- /**
- */
- StructuredDocumentRegionProxy() {
- super();
- }
-
- /**
- */
- StructuredDocumentRegionProxy(int offset, int length) {
- super();
-
- this.offset = offset;
- this.length = length;
- }
-
- /**
- */
- StructuredDocumentRegionProxy(int offset, int length, IStructuredDocumentRegion flatNode) {
- super();
-
- this.offset = offset;
- this.length = length;
- this.flatNode = flatNode;
- if (this.flatNode != null)
- this.offset -= this.flatNode.getStart();
- }
-
- public void addRegion(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjust(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustLength(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustStart(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public void adjustTextLength(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public boolean containsOffset(int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public boolean containsOffset(ITextRegion region, int i) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void equatePositions(ITextRegion region) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
-
- }
-
- public ITextRegion getDeepestRegionAtCharacterOffset(int offset) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public int getEnd() {
- int flatNodeOffset = 0;
- if (this.flatNode != null)
- flatNodeOffset = this.flatNode.getStart();
- return flatNodeOffset + this.offset + this.length;
- }
-
- public int getEndOffset() {
- return getEnd();
- }
-
- public int getEndOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public ITextRegion getFirstRegion() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public String getFullText() {
- return getText();
- }
-
- public String getFullText(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public String getFullText(String context) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public ITextRegion getLastRegion() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public int getLength() {
- return this.length;
- }
-
- public IStructuredDocumentRegion getNext() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public int getNumberOfRegions() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- int getOffset() {
- int flatNodeOffset = 0;
- if (this.flatNode != null)
- flatNodeOffset = this.flatNode.getStart();
- return flatNodeOffset + this.offset;
- }
-
- /**
- */
- public ITextRegionContainer getParent() {
- return null;
- }
-
- public IStructuredDocument getParentDocument() {
- return null;
- // throw new Error("intentionally not implemented since should never
- // be called");
- }
-
- public IStructuredDocumentRegion getPrevious() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public ITextRegion getRegionAtCharacterOffset(int offset) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public ITextRegionList getRegions() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public int getStart() {
- int flatNodeOffset = 0;
- if (this.flatNode != null)
- flatNodeOffset = this.flatNode.getStart();
- return flatNodeOffset + this.offset;
- }
-
- /**
- */
- public int getStartOffset() {
- return getStart();
- }
-
- public int getStartOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public IStructuredDocument getStructuredDocument() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- IStructuredDocumentRegion getStructuredDocumentRegion() {
- return this.flatNode;
- }
-
- /**
- */
- public String getText() {
- if (this.flatNode == null)
- return NodeImpl.EMPTY_STRING;
- String text = this.flatNode.getText();
- if (text == null)
- return NodeImpl.EMPTY_STRING;
- int end = this.offset + this.length;
- return text.substring(this.offset, end);
- }
-
- /**
- */
- public String getText(ITextRegion aRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public String getText(String context) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public int getTextEnd() {
- return getEnd();
- }
-
- /**
- */
- public int getTextEndOffset() {
- return getTextEnd();
- }
-
- public int getTextEndOffset(ITextRegion containedRegion) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- * The text length is equal to length if there is no white space at the
- * end of a region. Otherwise it is smaller than length.
- */
- public int getTextLength() {
- return getLength();
- }
-
- /**
- */
- public String getType() {
- return "StructuredDocumentRegionProxy";//$NON-NLS-1$
- }
-
- public boolean isDeleted() {
- // I'll assume never really needed here
- return true;
- }
-
- public boolean isEnded() {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public boolean sameAs(IStructuredDocumentRegion region, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- public boolean sameAs(ITextRegion region, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setDeleted(boolean deleted) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setEnded(boolean hasEnd) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- * had to make public, due to API transition.
- */
- public void setLength(int length) {
- this.length = length;
- }
-
- public void setNext(IStructuredDocumentRegion newNext) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- void setOffset(int offset) {
- this.offset = offset;
- if (this.flatNode != null)
- this.offset -= this.flatNode.getStart();
- }
-
- public void setParentDocument(IStructuredDocument document) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setPrevious(IStructuredDocumentRegion newPrevious) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setRegions(ITextRegionList embeddedRegions) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- public void setStart(int newStart) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-
- /**
- */
- void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (this.flatNode != null)
- this.offset += this.flatNode.getStart();
- this.flatNode = flatNode;
- if (this.flatNode != null)
- this.offset -= flatNode.getStart();
- }
-
- /**
- * toString method
- *
- * @return java.lang.String
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append('[');
- buffer.append(getStart());
- buffer.append(',');
- buffer.append(getEnd());
- buffer.append(']');
- buffer.append('(');
- if (this.flatNode != null)
- buffer.append(this.flatNode.toString());
- else
- buffer.append("null");//$NON-NLS-1$
- buffer.append(')');
- return buffer.toString();
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int start, int end) {
- throw new Error("intentionally not implemented since should never be called"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
deleted file mode 100644
index 84a378bea4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
+++ /dev/null
@@ -1,178 +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.xml.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;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Provides convenient functions to handle IStructuredDocumentRegion and
- * ITextRegion.
- */
-class StructuredDocumentRegionUtil {
-
- /**
- * Extracts contents enclosed with quotes. Quotes may be double or single.
- */
- static String getAttrValue(IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (region == null)
- return null;
- if (flatNode == null)
- return null;
- String value = flatNode.getText(region);
- if (value == null)
- return null;
- int length = value.length();
- if (length == 0)
- return value;
- char firstChar = value.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- if (length == 1)
- return null;
- if (value.charAt(length - 1) == firstChar)
- length--;
- return value.substring(1, length);
- }
- return value;
- }
-
- /**
- * Extracts the name without heading '&' and tailing ';'.
- */
- static String getEntityRefName(IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (region == null)
- return null;
- String ref = flatNode.getText(region);
- int length = ref.length();
- if (length == 0)
- return ref;
- int offset = 0;
- if (ref.charAt(0) == '&')
- offset = 1;
- if (ref.charAt(length - 1) == ';')
- length--;
- if (offset >= length)
- return null;
- return ref.substring(offset, length);
- }
-
- /**
- * Returns the first region.
- */
- static ITextRegion getFirstRegion(IStructuredDocumentRegion flatNode) {
- if(flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
- }
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0)
- return null;
- return regions.get(0);
- }
-
- /**
- * Returns the type of the first region.
- */
- static String getFirstRegionType(IStructuredDocumentRegion flatNode) {
- if(flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
- }
- if (flatNode == null)
- return DOMRegionContext.UNDEFINED;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0)
- return DOMRegionContext.UNDEFINED;
- ITextRegion region = regions.get(0);
- return region.getType();
- }
-
- /**
- */
- static IStructuredDocumentRegion getFirstStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- flatNode = ((StructuredDocumentRegionContainer) flatNode).getFirstStructuredDocumentRegion();
- }
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
- }
- return flatNode;
- }
-
- /**
- * Returns the last region.
- */
- static ITextRegion getLastRegion(IStructuredDocumentRegion flatNode) {
- if(flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
- }
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0)
- return null;
- return regions.get(regions.size() - 1);
- }
-
- /**
- * Returns the type of the first region.
- */
- static String getLastRegionType(IStructuredDocumentRegion flatNode) {
- if(flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
- }
- if (flatNode == null)
- return DOMRegionContext.UNDEFINED;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0)
- return DOMRegionContext.UNDEFINED;
- ITextRegion region = regions.get(regions.size() - 1);
- return region.getType();
- }
-
- /**
- */
- static IStructuredDocumentRegion getLastStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- flatNode = ((StructuredDocumentRegionContainer) flatNode).getLastStructuredDocumentRegion();
- }
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
- }
- return flatNode;
- }
-
- /**
- */
- static IStructuredDocumentRegion getStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- flatNode = ((StructuredDocumentRegionProxy) flatNode).getStructuredDocumentRegion();
- }
- return flatNode;
- }
-
- StructuredDocumentRegionUtil() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java
deleted file mode 100644
index f49ff7b959..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java
+++ /dev/null
@@ -1,35 +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.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- */
-public interface TagAdapter extends INodeAdapter {
-
- /**
- */
- String getEndTag(IDOMElement element);
-
- /**
- */
- String getStartTag(IDOMElement element);
-
- /**
- */
- boolean isEndTag();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
deleted file mode 100644
index d1d2c247d6..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
+++ /dev/null
@@ -1,1192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- *
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- * Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.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.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * TextImpl class
- */
-public class TextImpl extends CharacterDataImpl implements IDOMText {
-
- /**
- */
- private class StringPair {
- private String fFirst = null;
- private String fSecond = null;
-
- StringPair(String first, String second) {
- this.fFirst = first;
- this.fSecond = second;
- }
-
- String getFirst() {
- return this.fFirst;
- }
-
- String getSecond() {
- return this.fSecond;
- }
- }
-
- private String fSource = null;
-
- /**
- * TextImpl constructor
- */
- protected TextImpl() {
- super();
- }
-
- /**
- * TextImpl constructor
- *
- * @param that
- * TextImpl
- */
- protected TextImpl(TextImpl that) {
- super(that);
-
- if (that != null) {
- this.fSource = that.getSource();
- }
- }
-
- /**
- * appendData method
- *
- * @param arg
- * java.lang.String
- */
- public void appendData(String arg) throws DOMException {
- if (arg == null || arg.length() == 0)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- String newSource = getSource(arg);
- if (newSource == null)
- return;
- String source = getSource();
- if (source != null)
- setTextSource(source + newSource);
- else
- setTextSource(newSource);
- }
-
- /**
- */
- IStructuredDocumentRegion appendStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion) {
- if (newStructuredDocumentRegion == null)
- return null;
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null) {
- setStructuredDocumentRegion(newStructuredDocumentRegion);
- return newStructuredDocumentRegion;
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- else {
- StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
- container.appendStructuredDocumentRegion(flatNode);
- container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
- setStructuredDocumentRegion(container);
- }
-
- return newStructuredDocumentRegion;
- }
-
- /**
- * appendText method
- *
- * @param text
- * org.w3c.dom.Text
- */
- public void appendText(Text newText) {
- if (newText == null)
- return;
-
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- TextImpl text = (TextImpl) newText;
- String newSource = text.getSource();
- if (newSource == null || newSource.length() == 0)
- return;
- String source = getSource();
- if (source != null)
- setTextSource(source + newSource);
- else
- setTextSource(newSource);
- }
-
- /**
- * cloneNode method
- *
- * @return org.w3c.dom.Node
- * @param deep
- * boolean
- */
- public Node cloneNode(boolean deep) {
- TextImpl cloned = new TextImpl(this);
- notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned);
- return cloned;
- }
-
- /**
- * deleteData method
- *
- * @param offset
- * int
- * @param count
- * int
- */
- public void deleteData(int offset, int count) throws DOMException {
- if (count == 0)
- return;
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (count < 0 || offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String source = getSource();
- if (source == null || source.length() == 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- StringPair pair = substringSourceExcluded(source, offset, count);
- if (pair == null)
- return;
- source = null;
- String first = pair.getFirst();
- if (first != null)
- source = first;
- String second = pair.getSecond();
- if (second != null) {
- if (source != null)
- source += second;
- else
- source = second;
- }
- if (source == null)
- source = NodeImpl.EMPTY_STRING; // delete all
- setTextSource(source);
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public String getData() throws DOMException {
- if (this.fSource != null)
- return getData(this.fSource);
- String data = super.getData();
- if (data != null)
- return data;
- return getData(getStructuredDocumentRegion());
- }
-
- /**
- */
- private String getData(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return NodeImpl.EMPTY_STRING;
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int length = container.getLength();
- if (length < 16)
- length = 16; // default
- StringBuffer buffer = new StringBuffer(length);
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- String data = getData(content);
- if (data == null)
- continue;
- buffer.append(data);
- }
- return buffer.toString();
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- return flatNode.getText();
- }
-
- ITextRegion region = StructuredDocumentRegionUtil.getFirstRegion(flatNode);
- if (region != null) {
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
- String name = StructuredDocumentRegionUtil.getEntityRefName(flatNode, region);
- if (name != null) {
- DocumentImpl document = (DocumentImpl) getOwnerDocument();
- if (document != null) {
- String value = document.getCharValue(name);
- if (value != null)
- return value;
- }
- }
- }
- }
-
- return flatNode.getText();
- }
-
- /**
- * Returns data for the source
- */
- private String getData(String source) {
- if (source == null)
- return null;
- StringBuffer buffer = null;
- int offset = 0;
- int length = source.length();
- int ref = source.indexOf('&');
- while (ref >= 0) {
- int end = source.indexOf(';', ref + 1);
- if (end > ref + 1) {
- String name = source.substring(ref + 1, end);
- String value = getCharValue(name);
- if (value != null) {
- if (buffer == null)
- buffer = new StringBuffer(length);
- if (ref > offset)
- buffer.append(source.substring(offset, ref));
- buffer.append(value);
- offset = end + 1;
- ref = end;
- }
- }
- ref = source.indexOf('&', ref + 1);
- }
- if (buffer == null)
- return source;
- if (length > offset)
- buffer.append(source.substring(offset));
- return buffer.toString();
- }
-
- /**
- * getFirstStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- return StructuredDocumentRegionUtil.getFirstStructuredDocumentRegion(getStructuredDocumentRegion());
- }
-
- /**
- * getLastStructuredDocumentRegion method
- *
- */
- public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- return StructuredDocumentRegionUtil.getLastStructuredDocumentRegion(getStructuredDocumentRegion());
- }
-
- /**
- * getNodeName method
- *
- * @return java.lang.String
- */
- public String getNodeName() {
- return "#text";//$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#getNodeType()
- */
- public short getNodeType() {
- return TEXT_NODE;
- }
-
- /**
- */
- public String getSource() {
- if (this.fSource != null)
- return this.fSource;
- String data = super.getData();
- if (data != null && data.length() > 0) {
- String source = getSource(data);
- if (source != null)
- return source;
- }
- return super.getSource();
- }
-
- /**
- * Returns source for the data
- */
- private String getSource(String data) {
- if (data == null)
- return null;
- IDOMModel model = getModel();
- if (model == null)
- return null; // error
- ISourceGenerator generator = model.getGenerator();
- if (generator == null)
- return null; // error
- return generator.generateTextData(this, data);
- }
-
- /**
- */
- String getTextSource() {
- return this.fSource;
- }
-
- /**
- */
- public String getValueSource() {
- return getSource();
- }
-
- /**
- */
- boolean hasStructuredDocumentRegion(IStructuredDocumentRegion askedStructuredDocumentRegion) {
- if (askedStructuredDocumentRegion == null)
- return false;
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return false;
-
- if (flatNode == askedStructuredDocumentRegion)
- return true;
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- if (proxy.getStructuredDocumentRegion() == askedStructuredDocumentRegion)
- return true;
- return false;
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue;
- if (content == askedStructuredDocumentRegion)
- return true;
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == askedStructuredDocumentRegion)
- return true;
- }
- }
- return false;
- }
-
- return false;
- }
-
- /**
- * insertData method
- *
- * @param offset
- * int
- * @param arg
- * java.lang.String
- */
- public void insertData(int offset, String arg) throws DOMException {
- if (arg == null || arg.length() == 0)
- return;
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String source = getSource();
- if (source == null || source.length() == 0) {
- if (offset > 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- source = getSource(arg);
- if (source != null)
- setTextSource(source);
- return;
- }
-
- StringPair pair = substringSourceExcluded(source, offset, 0);
- if (pair == null)
- return; // error
- StringBuffer buffer = new StringBuffer(source.length() + arg.length());
- String first = pair.getFirst();
- if (first != null)
- buffer.append(first);
- source = getSource(arg);
- if (source != null)
- buffer.append(source);
- String second = pair.getSecond();
- if (second != null)
- buffer.append(second);
- setTextSource(buffer.toString());
- }
-
- /**
- */
- IStructuredDocumentRegion insertStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion, IStructuredDocumentRegion nextStructuredDocumentRegion) {
- if (newStructuredDocumentRegion == null)
- return null;
- if (nextStructuredDocumentRegion == null)
- return appendStructuredDocumentRegion(newStructuredDocumentRegion);
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return null; // error
-
- if (flatNode == nextStructuredDocumentRegion) {
- StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
- container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
- container.appendStructuredDocumentRegion(flatNode);
- setStructuredDocumentRegion(container);
- return newStructuredDocumentRegion;
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == nextStructuredDocumentRegion) {
- container.insertStructuredDocumentRegion(newStructuredDocumentRegion, i);
- return newStructuredDocumentRegion;
- }
- }
- return null; // error
- }
-
- return null; // error
- }
-
- /**
- * insertText method
- *
- * @param text
- * org.w3c.dom.Text
- * @param offset
- * int
- */
- public void insertText(Text newText, int offset) throws DOMException {
- if (newText == null)
- return;
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- TextImpl text = (TextImpl) newText;
- String newSource = text.getSource();
- if (newSource == null || newSource.length() == 0)
- return;
- if (offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String source = getSource();
- if (source == null || source.length() == 0) {
- if (offset > 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- setTextSource(newSource);
- return;
- }
-
- StringPair pair = substringSourceExcluded(source, offset, 0);
- if (pair == null)
- return; // error
- StringBuffer buffer = new StringBuffer(source.length() + newSource.length());
- String first = pair.getFirst();
- if (first != null)
- buffer.append(first);
- buffer.append(newSource);
- String second = pair.getSecond();
- if (second != null)
- buffer.append(second);
- setTextSource(buffer.toString());
- }
-
- /**
- * isCDATAContent method
- *
- * @return boolean
- */
- public boolean isCDATAContent() {
- Node parent = getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- ElementImpl element = (ElementImpl) parent;
- return element.isCDATAContainer();
- }
-
- /**
- */
- public boolean isInvalid() {
- return isInvalid(getStructuredDocumentRegion());
- }
-
- /**
- */
- private boolean isInvalid(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return false;
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (isInvalid(content))
- return true;
- }
- return false;
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- return isInvalid(proxy.getStructuredDocumentRegion());
- }
-
- String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
- if (regionType != DOMRegionContext.XML_CONTENT && isNotNestedContent(regionType) && regionType != DOMRegionContext.XML_ENTITY_REFERENCE && regionType != DOMRegionContext.XML_CHAR_REFERENCE && regionType != DOMRegionContext.BLOCK_TEXT && regionType != DOMRegionContext.WHITE_SPACE) {
- return true;
- }
-
- return false;
- }
-
- protected boolean isNotNestedContent(String regionType) {
- boolean result = true;
- return result;
- }
-
- /**
- */
- boolean isSharingStructuredDocumentRegion(IStructuredDocumentRegion sharedStructuredDocumentRegion) {
- if (sharedStructuredDocumentRegion == null)
- return false;
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return false;
-
- if (flatNode == sharedStructuredDocumentRegion)
- return false;
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- if (proxy.getStructuredDocumentRegion() == sharedStructuredDocumentRegion)
- return true;
- return false;
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue;
- if (content == sharedStructuredDocumentRegion)
- return false;
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == sharedStructuredDocumentRegion)
- return true;
- }
- }
- return false;
- }
-
- return false;
- }
-
- /**
- * Returns whether this text node contains <a
- * href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * element content whitespace</a>, often abusively called "ignorable
- * whitespace". The text node is determined to contain whitespace in
- * element content during the load of the document or if validation occurs
- * while using <code>Document.normalizeDocument()</code>.
- *
- * @see DOM Level 3
- */
- public boolean isElementContentWhitespace() {
- return isWhitespace();
- }
-
- /**
- */
- public boolean isWhitespace() {
- String data = getData();
- if (data == null)
- return true;
- int length = data.length();
- for (int i = 0; i < length; i++) {
- if (!Character.isWhitespace(data.charAt(i)))
- return false;
- }
- return true;
- }
-
- /**
- */
- IStructuredDocumentRegion removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (oldStructuredDocumentRegion == null)
- return null;
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return null; // error
-
- if (flatNode == oldStructuredDocumentRegion) {
- setStructuredDocumentRegion(null);
- return oldStructuredDocumentRegion;
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- // removed with proxy
- setStructuredDocumentRegion(null);
- return oldStructuredDocumentRegion;
- }
- return null; // error
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == oldStructuredDocumentRegion) {
- container.removeStructuredDocumentRegion(i);
- if (container.getStructuredDocumentRegionCount() == 1) {
- // get back to single IStructuredDocumentRegion
- setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
- }
- return oldStructuredDocumentRegion;
- }
-
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- // removed with proxy
- container.removeStructuredDocumentRegion(i);
- if (container.getStructuredDocumentRegionCount() == 1) {
- // get back to single IStructuredDocumentRegion
- setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
- }
- return oldStructuredDocumentRegion;
- }
- }
- }
- return null; // error
- }
-
- return null; // error
- }
-
- /**
- * replaceData method
- *
- * @param offset
- * int
- * @param count
- * int
- * @param arg
- * java.lang.String
- */
- public void replaceData(int offset, int count, String arg) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (arg == null || arg.length() == 0) {
- deleteData(offset, count);
- return;
- }
- if (count == 0) {
- insertData(offset, arg);
- return;
- }
- if (offset < 0 || count < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String source = getSource();
- if (source == null || source.length() == 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- StringPair pair = substringSourceExcluded(source, offset, count);
- if (pair == null)
- return; // error
- StringBuffer buffer = new StringBuffer(source.length() + arg.length());
- String first = pair.getFirst();
- if (first != null)
- buffer.append(first);
- source = getSource(arg);
- if (source != null)
- buffer.append(source);
- String second = pair.getSecond();
- if (second != null)
- buffer.append(second);
- setTextSource(buffer.toString());
- }
-
- /**
- */
- IStructuredDocumentRegion replaceStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion, IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (oldStructuredDocumentRegion == null)
- return null;
- if (newStructuredDocumentRegion == null)
- return removeStructuredDocumentRegion(oldStructuredDocumentRegion);
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null)
- return null; // error
-
- if (flatNode == oldStructuredDocumentRegion) {
- setStructuredDocumentRegion(newStructuredDocumentRegion);
- return oldStructuredDocumentRegion;
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- if (newStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- // proxy must not be nested
- setStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- else {
- proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- return oldStructuredDocumentRegion;
- }
- return null; // error
- }
-
- if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue; // error
- if (content == oldStructuredDocumentRegion) {
- container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
- return oldStructuredDocumentRegion;
- }
-
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- if (newStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- // proxy must not be nested
- container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
- }
- else {
- proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- return oldStructuredDocumentRegion;
- }
- }
- }
- return null; // error
- }
-
- return null; // error
- }
-
- /**
- */
- void resetStructuredDocumentRegions() {
- String source = getSource();
- if (source != null && source.length() > 0)
- this.fSource = source;
- super.resetStructuredDocumentRegions();
- }
-
- /**
- * getData method
- *
- * @return java.lang.String
- */
- public void setData(String data) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.fSource = null;
- super.setData(data);
- }
-
- /**
- */
- public void setSource(String source) throws InvalidCharacterException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- SourceValidator validator = new SourceValidator(this);
- if (validator.validateSource(source))
- setTextSource(source);
- }
-
- /**
- */
- void setStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- super.setStructuredDocumentRegion(flatNode);
- if (flatNode != null)
- this.fSource = null;
- }
-
- /**
- */
- public void setTextSource(String source) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- this.fSource = source;
-
- notifyValueChanged();
- }
-
- /**
- */
- public void setValueSource(String source) {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- SourceValidator validator = new SourceValidator(this);
- setTextSource(validator.convertSource(source));
- }
-
- /**
- * splitText method
- *
- * @return org.w3c.dom.Text
- * @param offset
- * int
- */
- public Text splitText(int offset) throws DOMException {
- if (!isDataEditable()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
- }
- if (offset < 0) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int length = getLength();
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- Document document = getOwnerDocument();
- if (document == null)
- return null;
-
- String source = null;
- if (offset < length) {
- int count = length - offset;
- source = substringSource(offset, count);
- deleteData(offset, count);
- }
- TextImpl text = (TextImpl) document.createTextNode(null);
- if (source != null)
- text.setTextSource(source);
-
- Node parent = getParentNode();
- if (parent != null)
- parent.insertBefore(text, getNextSibling());
-
- return text;
- }
-
- /**
- */
- Text splitText(IStructuredDocumentRegion nextStructuredDocumentRegion) {
- if (nextStructuredDocumentRegion == null)
- return null;
-
- IStructuredDocumentRegion flatNode = getStructuredDocumentRegion();
- if (flatNode == null || !(flatNode instanceof StructuredDocumentRegionContainer))
- return null; // error
-
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- int index = 0;
- for (; index < count; index++) {
- if (container.getStructuredDocumentRegion(index) == nextStructuredDocumentRegion)
- break;
- }
- if (index >= count) {
- // this is the case nextStructuredDocumentRegion is a new
- // IStructuredDocumentRegion
- // search gap by offset
- int offset = nextStructuredDocumentRegion.getStart();
- for (index = 0; index < count; index++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(index);
- if (content == null)
- continue; // error
- if (content.getStart() >= offset)
- break;
- }
- if (index >= count)
- return null; // error
- }
- if (index == 0)
- return this; // nothing to do
-
- Document document = getOwnerDocument();
- if (document == null)
- return null; // error
- Node parent = getParentNode();
- if (parent == null)
- return null; // error
- TextImpl nextText = (TextImpl) document.createTextNode(null);
- if (nextText == null)
- return null; // error
-
- for (; index < count; count--) {
- nextText.appendStructuredDocumentRegion(container.removeStructuredDocumentRegion(index));
- }
-
- // normalize IStructuredDocumentRegion
- if (index == 1) {
- setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
- }
-
- parent.insertBefore(nextText, getNextSibling());
- return nextText;
- }
-
- /**
- * Retruns data for the range
- */
- private String substringData(String data, int offset, int count) throws DOMException {
- // sure offset and count are non-negative
- if (count == 0)
- return NodeImpl.EMPTY_STRING;
- if (data == null) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int length = data.length();
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- int end = offset + count;
- if (end > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
- return data.substring(offset, end);
- }
-
- /**
- * Returns source for the range specified by: offset: data offset count:
- * data count
- */
- private String substringSource(int offset, int count) throws DOMException {
- // sure offset and count are non-negative
- if (this.fSource != null)
- return substringSource(this.fSource, offset, count);
-
- String data = super.getData();
- if (data != null && data.length() > 0) {
- data = substringData(data, offset, count);
- if (data == null)
- return NodeImpl.EMPTY_STRING;
- String source = getSource(data);
- if (source != null)
- return source;
- }
-
- return substringSource(getSource(), offset, count);
- }
-
- /**
- * Returns source for the range specified by: offset: data offset count:
- * data count
- */
- private String substringSource(String source, int offset, int count) throws DOMException {
- // sure offset and count are non-negative
- if (count == 0)
- return NodeImpl.EMPTY_STRING;
- if (source == null) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- int length = source.length();
- int end = offset + count;
-
- // find character reference
- int ref = source.indexOf('&');
- while (ref >= 0) {
- if (ref >= end)
- break;
- int refEnd = source.indexOf(';', ref + 1);
- if (refEnd > ref + 1) {
- String name = source.substring(ref + 1, refEnd);
- if (getCharValue(name) != null) {
- // found, shift for source offsets
- int refCount = refEnd - ref;
- if (ref < offset)
- offset += refCount;
- if (ref < end)
- end += refCount;
- ref = refEnd;
- }
- }
- ref = source.indexOf('&', ref + 1);
- }
-
- if (offset > length || end > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- return source.substring(offset, end);
- }
-
- /**
- * Returns sources before and after the range specified by: offset: data
- * offset count: data count
- */
- private StringPair substringSourceExcluded(String source, int offset, int count) throws DOMException {
- // sure offset and count are non-negative
- if (source == null) {
- if (offset == 0 && count == 0)
- return new StringPair(null, null);
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- int length = source.length();
- int end = offset + count;
-
- // find character reference
- int ref = source.indexOf('&');
- while (ref >= 0) {
- if (ref >= end)
- break;
- int refEnd = source.indexOf(';', ref + 1);
- if (refEnd > ref + 1) {
- String name = source.substring(ref + 1, refEnd);
- if (getCharValue(name) != null) {
- // found, shift for source offsets
- int refCount = refEnd - ref;
- if (ref < offset)
- offset += refCount;
- if (ref < end)
- end += refCount;
- ref = refEnd;
- }
- }
- ref = source.indexOf('&', ref + 1);
- }
-
- if (offset > length) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
- }
-
- String first = (offset > 0 ? source.substring(0, offset) : null);
- String second = (end < length ? source.substring(end, length) : null);
- return new StringPair(first, second);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Text#getWholeText()
- */
- public String getWholeText() {
- Node current = this;
- // rewind
- while (current.getPreviousSibling() != null)
- current = current.getPreviousSibling();
- // playback
- StringBuffer buffer = new StringBuffer();
- while (current != null) {
- if (current.getNodeType() == Node.TEXT_NODE || current.getNodeType() == Node.CDATA_SECTION_NODE) {
- buffer.append(current.getNodeValue());
- }
- current = current.getNextSibling();
- }
- return buffer.toString();
- }
- /**
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text. <br>
- * This method returns the node which received the replacement text. The
- * returned node is:
- * <ul>
- * <li><code>null</code>, when the replacement text is the empty
- * string; </li>
- * <li>the current node, except when the current node is read-only; </li>
- * <li> a new <code>Text</code> node of the same type (
- * <code>Text</code> or <code>CDATASection</code>) as the current
- * node inserted at the location of the replacement. </li>
- * </ul>
- * <br>
- * For instance, in the above example calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" with "yo" in argument results in the following: <br>
- * Where the nodes to be removed are read-only descendants of an
- * <code>EntityReference</code>, the <code>EntityReference</code>
- * must be removed instead of the read-only nodes. If any
- * <code>EntityReference</code> to be removed has descendants that are
- * not <code>EntityReference</code>, <code>Text</code>, or
- * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
- * method must fail before performing any modification of the document,
- * raising a <code>DOMException</code> with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>. <br>
- * For instance, in the example below calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" fails, because the <code>EntityReference</code> node
- * "ent" contains an <code>Element</code> node which cannot be removed.
- *
- * @param content
- * The content of the replacing <code>Text</code> node.
- * @return The <code>Text</code> node created with the specified
- * content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the
- * <code>Text</code> nodes being replaced is readonly.
- * @see DOM Level 3
- */
- public Text replaceWholeText(String content)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java
deleted file mode 100644
index 695ff71f10..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java
+++ /dev/null
@@ -1,56 +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.wst.xml.core.internal.document;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.w3c.dom.Node;
-
-/**
- * Collects user data associated to a Node.
- *
- */
-final class UserData {
-
- private static UserData fInstance;
-
- /**
- * Mapping of a Node to its User Data table (represented by a Map)
- */
- private Map fData;
-
- private UserData() {
- fData = new WeakHashMap(0);
- }
-
- public static synchronized UserData getInstance() {
- if (fInstance == null)
- fInstance = new UserData();
- return fInstance;
- }
-
- /**
- * Get the user data table associated with <code>node</code>.
- *
- * @param node the node
- * @return the user data table associated with the <code>node</code>
- */
- public synchronized Map getUserDataTable(Node node) {
- if (fData.containsKey(node))
- return (Map) fData.get(node);
- Map table = new HashMap();
- fData.put(node, table);
- return table;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java
deleted file mode 100644
index 17c7eb9e03..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java
+++ /dev/null
@@ -1,735 +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.xml.core.internal.document;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- */
-public class XMLGeneratorImpl implements ISourceGenerator {
- private static final String CDATA_CLOSE = "]]>";//$NON-NLS-1$
- private static final String CDATA_OPEN = "<![CDATA[";//$NON-NLS-1$
- private static final String COMMENT_CLOSE = "-->";//$NON-NLS-1$
- private static final String COMMENT_OPEN = "<!--";//$NON-NLS-1$
- private static final String DOCTYPE_OPEN = "<!DOCTYPE";//$NON-NLS-1$
- private static final String EMPTY_CLOSE = " />";//$NON-NLS-1$
- private static final String END_OPEN = "</";//$NON-NLS-1$
-
- private static XMLGeneratorImpl instance = null;
- private static final String PI_CLOSE = "?>";//$NON-NLS-1$
- private static final String PI_OPEN = "<?";//$NON-NLS-1$
- private static final String PUBLIC_ID = "PUBLIC";//$NON-NLS-1$
- private static final String SSI_PREFIX = "ssi";//$NON-NLS-1$
- //private static final String SSI_FEATURE = "SSI";//$NON-NLS-1$
- private static final String SSI_TOKEN = "#";//$NON-NLS-1$
- private static final String SYSTEM_ID = "SYSTEM";//$NON-NLS-1$
- private static final String TAG_CLOSE = ">";//$NON-NLS-1$
-
- /**
- */
- public synchronized static ISourceGenerator getInstance() {
- if (instance == null)
- instance = new XMLGeneratorImpl();
- return instance;
- }
-
- /**
- */
- //private boolean isCommentTag(XMLElement element) {
- // if (element == null) return false;
- // DocumentImpl document = (DocumentImpl)element.getOwnerDocument();
- // if (document == null) return false;
- // DocumentTypeAdapter adapter = document.getDocumentTypeAdapter();
- // if (adapter == null) return false;
- // if (!adapter.hasFeature(SSI_FEATURE)) return false;
- // String prefix = element.getPrefix();
- // return (prefix != null && prefix.equals(SSI_PREFIX));
- //}
- /**
- * Helper to modify the tag name in sub-classes
- */
- private static void setTagName(Element element, String tagName) {
- if (element == null || tagName == null)
- return;
- ((ElementImpl) element).setTagName(tagName);
- }
-
- /**
- * XMLModelGenerator constructor
- */
- private XMLGeneratorImpl() {
- super();
- }
-
- /**
- */
- public String generateAttrName(Attr attr) {
- if (attr == null)
- return null;
- String attrName = attr.getName();
- if (attrName == null)
- return null;
- if (attrName.startsWith(JSPTag.TAG_OPEN)) {
- if (!attrName.endsWith(JSPTag.TAG_CLOSE)) {
- // close JSP
- return (attrName + JSPTag.TAG_CLOSE);
- }
- }
- if (((IDOMAttr) attr).isGlobalAttr() && CMNodeUtil.getAttributeDeclaration(attr) != null) {
- switch (getAttrNameCase(attr)) {
- case DocumentTypeAdapter.UPPER_CASE :
- attrName = attrName.toUpperCase();
- break;
- case DocumentTypeAdapter.LOWER_CASE :
- attrName = attrName.toLowerCase();
- break;
- default :
- // ASIS_CASE
- break;
- }
- }
- return attrName;
- }
-
- /**
- */
- public String generateAttrValue(Attr attr) {
- return generateAttrValue(attr, (char) 0); // no quote preference
- }
-
- /**
- */
- public String generateAttrValue(Attr attr, char quote) {
- if (attr == null)
- return null;
- String name = attr.getName();
- SourceValidator validator = new SourceValidator(attr);
- String value = validator.convertSource(((IDOMNode) attr).getValueSource());
- if (value == null || value.length() == 0) {
- if (name != null && name.startsWith(JSPTag.TAG_OPEN))
- return null;
- if (isBooleanAttr(attr)) {
- if (((AttrImpl) attr).isXMLAttr()) {
- // generate the name as value
- value = attr.getName();
- } else {
- // not to generate '=' and value for HTML boolean
- return null;
- }
- }
- }
- return generateAttrValue(value, quote);
- }
-
- /**
- */
- public String generateAttrValue(String value, char quote) {
- // assume the valid is already validated not to include both quotes
- if (quote == '"') {
- if ((value != null) && (value.indexOf('"') >= 0))
- quote = '\''; // force
- } else if (quote == '\'') {
- if ((value != null) && (value.indexOf('\'') >= 0))
- quote = '"'; // force
- } else { // no preference
- if ((value != null) && (value.indexOf('"') < 0))
- quote = '"';
- else
- quote = '\'';
- }
-
- int length = (value == null ? 0 : value.length());
- StringBuffer buffer = new StringBuffer(length + 2);
- buffer.append(quote);
- if (value != null)
- buffer.append(value);
- buffer.append(quote);
- return buffer.toString();
- }
-
- /**
- * generateCDATASection method
- *
- * @return java.lang.String
- * @param comment
- * org.w3c.dom.CDATASection
- */
- public String generateCDATASection(CDATASection cdata) {
- if (cdata == null)
- return null;
-
- String data = cdata.getData();
- int length = (data != null ? data.length() : 0);
- StringBuffer buffer = new StringBuffer(length + 16);
- buffer.append(CDATA_OPEN);
- if (data != null)
- buffer.append(data);
- buffer.append(CDATA_CLOSE);
- return buffer.toString();
- }
-
- /**
- * generateChild method
- *
- * @return java.lang.String
- * @param org.w3c.dom.Node
- */
- public String generateChild(Node parentNode) {
- if (parentNode == null)
- return null;
- if (!parentNode.hasChildNodes())
- return null;
-
- StringBuffer buffer = new StringBuffer();
- for (Node child = parentNode.getFirstChild(); child != null; child = child.getNextSibling()) {
- String childSource = generateSource(child);
- if (childSource != null)
- buffer.append(childSource);
- }
- return buffer.toString();
- }
-
- /**
- */
- public String generateCloseTag(Node node) {
- if (node == null)
- return null;
-
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE : {
- ElementImpl element = (ElementImpl) node;
- if (element.isCommentTag()) {
- if (element.isJSPTag())
- return JSPTag.COMMENT_CLOSE;
- return COMMENT_CLOSE;
- }
- if (element.isJSPTag())
- return JSPTag.TAG_CLOSE;
- if (element.isEmptyTag())
- return EMPTY_CLOSE;
- return TAG_CLOSE;
- }
- case Node.COMMENT_NODE : {
- CommentImpl comment = (CommentImpl) node;
- if (comment.isJSPTag())
- return JSPTag.COMMENT_CLOSE;
- return COMMENT_CLOSE;
- }
- case Node.DOCUMENT_TYPE_NODE :
- return TAG_CLOSE;
- case Node.PROCESSING_INSTRUCTION_NODE :
- return PI_CLOSE;
- case Node.CDATA_SECTION_NODE :
- return CDATA_CLOSE;
- default :
- break;
- }
-
- return null;
- }
-
- /**
- * generateComment method
- *
- * @return java.lang.String
- * @param comment
- * org.w3c.dom.Comment
- */
- public String generateComment(Comment comment) {
- if (comment == null)
- return null;
-
- String data = comment.getData();
- int length = (data != null ? data.length() : 0);
- StringBuffer buffer = new StringBuffer(length + 8);
- CommentImpl impl = (CommentImpl) comment;
- if (!impl.isJSPTag())
- buffer.append(COMMENT_OPEN);
- else
- buffer.append(JSPTag.COMMENT_OPEN);
- if (data != null)
- buffer.append(data);
- if (!impl.isJSPTag())
- buffer.append(COMMENT_CLOSE);
- else
- buffer.append(JSPTag.COMMENT_CLOSE);
- return buffer.toString();
- }
-
- /**
- * generateDoctype method
- *
- * @return java.lang.String
- * @param docType
- * org.w3c.dom.DocumentType
- */
- public String generateDoctype(DocumentType docType) {
- if (docType == null)
- return null;
-
- String name = docType.getName();
- int length = (name != null ? name.length() : 0);
- StringBuffer buffer = new StringBuffer(length + 16);
- buffer.append(DOCTYPE_OPEN);
- buffer.append(' ');
- if (name != null)
- buffer.append(name);
- DocumentTypeImpl dt = (DocumentTypeImpl) docType;
- String publicID = dt.getPublicId();
- String systemID = dt.getSystemId();
- if (publicID != null) {
- buffer.append(' ');
- buffer.append(PUBLIC_ID);
- buffer.append(' ');
- buffer.append('"');
- buffer.append(publicID);
- buffer.append('"');
- if (systemID != null) {
- buffer.append(' ');
- buffer.append('"');
- buffer.append(systemID);
- buffer.append('"');
- }
- } else {
- if (systemID != null) {
- buffer.append(' ');
- buffer.append(SYSTEM_ID);
- buffer.append(' ');
- buffer.append('"');
- buffer.append(systemID);
- buffer.append('"');
- }
- }
- buffer.append('>');
- return buffer.toString();
- }
-
- /**
- * generateElement method
- *
- * @return java.lang.String
- * @param element
- * Element
- */
- public String generateElement(Element element) {
- if (element == null)
- return null;
-
- // if empty tag is preferrable, generate as empty tag
- ElementImpl impl = (ElementImpl) element;
- if (impl.preferEmptyTag())
- impl.setEmptyTag(true);
-
- StringBuffer buffer = new StringBuffer();
- String startTag = generateStartTag(element);
- if (startTag != null)
- buffer.append(startTag);
- String child = generateChild(element);
- if (child != null)
- buffer.append(child);
- String endTag = generateEndTag(element);
- if (endTag != null)
- buffer.append(endTag);
- return buffer.toString();
- }
-
- /**
- * generateEndTag method
- *
- * @return java.lang.String
- * @param element
- * org.w3c.dom.Element
- */
- public String generateEndTag(Element element) {
- if (element == null)
- return null;
-
- ElementImpl impl = (ElementImpl) element;
-
- // first check if tag adapter exists
- TagAdapter adapter = (TagAdapter) impl.getExistingAdapter(TagAdapter.class);
- if (adapter != null) {
- String endTag = adapter.getEndTag(impl);
- if (endTag != null)
- return endTag;
- }
-
- if (impl.isEmptyTag())
- return null;
- if (!impl.isContainer())
- return null;
- if (impl.isJSPTag())
- return JSPTag.TAG_CLOSE;
-
- String tagName = generateTagName(element);
- int length = (tagName != null ? tagName.length() : 0);
- StringBuffer buffer = new StringBuffer(length + 4);
- buffer.append(END_OPEN);
- if (tagName != null)
- buffer.append(tagName);
- buffer.append('>');
- return buffer.toString();
- }
-
- /**
- * generateEntityRef method
- *
- * @return java.lang.String
- * @param entityRef
- * org.w3c.dom.EntityReference
- */
- public String generateEntityRef(EntityReference entityRef) {
- if (entityRef == null)
- return null;
-
- String name = entityRef.getNodeName();
- int length = (name != null ? name.length() : 0);
- StringBuffer buffer = new StringBuffer(length + 4);
- buffer.append('&');
- if (name != null)
- buffer.append(name);
- buffer.append(';');
- return buffer.toString();
- }
-
- /**
- * generatePI method
- *
- * @return java.lang.String
- * @param pi
- * org.w3c.dom.ProcessingInstruction
- */
- public String generatePI(ProcessingInstruction pi) {
- if (pi == null)
- return null;
-
- String target = pi.getTarget();
- String data = pi.getData();
- int length = (target != null ? target.length() : 0);
- if (data != null)
- length += data.length();
- StringBuffer buffer = new StringBuffer(length + 8);
- buffer.append(PI_OPEN);
- if (target != null)
- buffer.append(target);
- buffer.append(' ');
- if (data != null)
- buffer.append(data);
- buffer.append(PI_CLOSE);
- return buffer.toString();
- }
-
- /**
- * generateSource method
- *
- * @return java.lang.String
- * @param node
- * org.w3c.dom.Node
- */
- public String generateSource(Node node) {
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE :
- return generateElement((Element) node);
- case Node.TEXT_NODE :
- return generateText((Text) node);
- case Node.COMMENT_NODE :
- return generateComment((Comment) node);
- case Node.DOCUMENT_TYPE_NODE :
- return generateDoctype((DocumentType) node);
- case Node.PROCESSING_INSTRUCTION_NODE :
- return generatePI((ProcessingInstruction) node);
- case Node.CDATA_SECTION_NODE :
- return generateCDATASection((CDATASection) node);
- case Node.ENTITY_REFERENCE_NODE :
- return generateEntityRef((EntityReference) node);
- default :
- // DOCUMENT
- break;
- }
- return generateChild(node);
- }
-
- /**
- * generateStartTag method
- *
- * @return java.lang.String
- * @param element
- * Element
- */
- public String generateStartTag(Element element) {
- if (element == null)
- return null;
-
- ElementImpl impl = (ElementImpl) element;
-
- if (impl.isJSPTag()) {
- // check if JSP content type and JSP Document
- IDOMDocument document = (IDOMDocument) element.getOwnerDocument();
- if (document != null && document.isJSPType()) {
- if (document.isJSPDocument() && !impl.hasChildNodes()) {
- impl.setJSPTag(false);
- }
- } else {
- impl.setJSPTag(false);
- }
- }
- if (impl.isCommentTag() && impl.getExistingAdapter(TagAdapter.class) == null) {
- CommentElementRegistry registry = CommentElementRegistry.getInstance();
- registry.setupCommentElement(impl);
- }
-
- // first check if tag adapter exists
- TagAdapter adapter = (TagAdapter) impl.getExistingAdapter(TagAdapter.class);
- if (adapter != null) {
- String startTag = adapter.getStartTag(impl);
- if (startTag != null)
- return startTag;
- }
-
- StringBuffer buffer = new StringBuffer();
-
- if (impl.isCommentTag()) {
- if (impl.isJSPTag())
- buffer.append(JSPTag.COMMENT_OPEN);
- else
- buffer.append(COMMENT_OPEN);
- String tagName = generateTagName(element);
- if (tagName != null)
- buffer.append(tagName);
- } else if (impl.isJSPTag()) {
- buffer.append(JSPTag.TAG_OPEN);
- String tagName = generateTagName(element);
- if (tagName != null)
- buffer.append(tagName);
- if (impl.isContainer())
- return buffer.toString(); // JSP container
- } else {
- buffer.append('<');
- String tagName = generateTagName(element);
- if (tagName != null)
- buffer.append(tagName);
- }
-
- NamedNodeMap attributes = element.getAttributes();
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) attributes.item(i);
- if (attr == null)
- continue;
- buffer.append(' ');
- String attrName = generateAttrName(attr);
- if (attrName != null)
- buffer.append(attrName);
- String attrValue = generateAttrValue(attr);
- if (attrValue != null) {
- // attr name only for HTML boolean and JSP
- buffer.append('=');
- buffer.append(attrValue);
- }
- }
-
- String closeTag = generateCloseTag(element);
- if (closeTag != null)
- buffer.append(closeTag);
-
- return buffer.toString();
- }
-
- /**
- */
- public String generateTagName(Element element) {
- if (element == null)
- return null;
- IDOMElement xe = (IDOMElement) element;
- String tagName = element.getTagName();
- if (tagName == null)
- return null;
- if (xe.isJSPTag()) {
- if (tagName.equals(JSPTag.JSP_EXPRESSION))
- return JSPTag.EXPRESSION_TOKEN;
- if (tagName.equals(JSPTag.JSP_DECLARATION))
- return JSPTag.DECLARATION_TOKEN;
- if (tagName.equals(JSPTag.JSP_DIRECTIVE))
- return JSPTag.DIRECTIVE_TOKEN;
- if (tagName.startsWith(JSPTag.JSP_DIRECTIVE)) {
- int offset = JSPTag.JSP_DIRECTIVE.length() + 1; // after '.'
- return (JSPTag.DIRECTIVE_TOKEN + tagName.substring(offset));
- }
- return (xe.isCommentTag()) ? tagName : null;
- } else if (tagName.startsWith(JSPTag.TAG_OPEN)) {
- if (!tagName.endsWith(JSPTag.TAG_CLOSE)) {
- // close JSP
- return (tagName + JSPTag.TAG_CLOSE);
- }
- } else if (xe.isCommentTag()) {
- String prefix = element.getPrefix();
- if (prefix.equals(SSI_PREFIX)) {
- return (SSI_TOKEN + element.getLocalName());
- }
- } else {
- if (!xe.isJSPTag() && xe.isGlobalTag() && // global tag
- CMNodeUtil.getElementDeclaration(xe) != null) {
- String newName = tagName;
- switch (getTagNameCase(xe)) {
- case DocumentTypeAdapter.UPPER_CASE :
- newName = tagName.toUpperCase();
- break;
- case DocumentTypeAdapter.LOWER_CASE :
- newName = tagName.toLowerCase();
- break;
- }
- if (newName != tagName) {
- tagName = newName;
- setTagName(element, tagName);
- }
- }
- }
- return tagName;
- }
-
- /**
- * generateText method
- *
- * @return java.lang.String
- * @param text
- * org.w3c.dom.Text
- */
- public String generateText(Text text) {
- if (text == null)
- return null;
- TextImpl impl = (TextImpl) text;
- String source = impl.getTextSource();
- if (source != null)
- return source;
- return generateTextData(text, impl.getData());
- }
-
- /**
- */
- public String generateTextData(Text text, String data) {
- if (data == null)
- return null;
- if (text == null)
- return null;
- TextImpl impl = (TextImpl) text;
- if (impl.isJSPContent() || impl.isCDATAContent()) {
- return new SourceValidator(impl).convertSource(data);
- }
- String source = data;
-
- // convert special characters to character entities
- StringBuffer buffer = null;
- int offset = 0;
- int length = data.length();
- for (int i = 0; i < length; i++) {
- String name = getCharName(data.charAt(i));
- if (name == null)
- continue;
- if (buffer == null)
- buffer = new StringBuffer(length + 8);
- if (i > offset)
- buffer.append(data.substring(offset, i));
- buffer.append('&');
- buffer.append(name);
- buffer.append(';');
- offset = i + 1;
- }
- if (buffer != null) {
- if (length > offset)
- buffer.append(data.substring(offset));
- source = buffer.toString();
- }
-
- if (source == null || source.length() == 0)
- return null;
- return source;
- }
-
- /**
- */
- private int getAttrNameCase(Attr attr) {
- DocumentImpl document = (DocumentImpl) attr.getOwnerDocument();
- if (document == null)
- return DocumentTypeAdapter.STRICT_CASE;
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return DocumentTypeAdapter.STRICT_CASE;
- return adapter.getAttrNameCase();
- }
-
- /**
- */
- private String getCharName(char c) {
- switch (c) {
- case '<' :
- return IXMLCharEntity.LT_NAME;
- case '>' :
- return IXMLCharEntity.GT_NAME;
- case '&' :
- return IXMLCharEntity.AMP_NAME;
- case '"' :
- return IXMLCharEntity.QUOT_NAME;
- }
- return null;
- }
-
- /**
- */
- private int getTagNameCase(Element element) {
- DocumentImpl document = (DocumentImpl) element.getOwnerDocument();
- if (document == null)
- return DocumentTypeAdapter.STRICT_CASE;
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return DocumentTypeAdapter.STRICT_CASE;
- return adapter.getTagNameCase();
- }
-
- /**
- */
- private boolean isBooleanAttr(Attr attr) {
- if (attr == null)
- return false;
- CMAttributeDeclaration decl = CMNodeUtil.getAttributeDeclaration(attr);
- if (decl == null)
- return false;
- CMDataType type = decl.getAttrType();
- if (type == null)
- return false;
- String values[] = type.getEnumeratedValues();
- if (values == null)
- return false;
- return (values.length == 1 && values[0].equals(decl.getAttrName()));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java
deleted file mode 100644
index 6a799f75f4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelContext.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * XMLModelContext class
- */
-class XMLModelContext {
- private Node nextNode = null;
- private Node parentNode = null;
-
- // private XMLModelImpl model = null;
- private Node rootNode = null;
-
- /**
- * XMLModelContext constructor
- *
- * @param rootNode
- * org.w3c.dom.Node
- */
- XMLModelContext(Node rootNode) {
- super();
-
- this.rootNode = rootNode;
- }
-
- /**
- * findEndTag method
- *
- * @return org.w3c.dom.Element
- * @param tagName
- * java.lang.String
- */
- Element findEndTag(String tagName) {
- if (tagName == null)
- return null;
- if (this.parentNode == null)
- return null;
-
- for (Node parent = this.parentNode.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl element = (ElementImpl) parent;
- if (element.hasEndTag()) {
- if (element.matchTagName(tagName))
- return element;
- // if ancestor element has end tag stop search
- break;
- }
- if (element.getNextSibling() != null)
- break;
- }
-
- return null;
- }
-
- /**
- */
- Text findNextText() {
- Node node = this.nextNode;
- while (node != null) {
- if (node != this.nextNode && node.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) node;
- // skip empty text
- if (text.getStructuredDocumentRegion() != null)
- return text;
- }
- Node child = node.getFirstChild();
- if (child != null) {
- node = child;
- continue;
- }
- while (node != null) {
- Node next = node.getNextSibling();
- if (next != null) {
- node = next;
- break;
- }
- node = node.getParentNode();
- }
- }
- return null;
- }
-
- /**
- * findPreviousText method
- *
- * @return org.w3c.dom.Text
- */
- Text findPreviousText() {
- if (this.parentNode == null)
- return null;
- Node node = null;
- if (this.nextNode != null)
- node = this.nextNode.getPreviousSibling();
- else
- node = this.parentNode.getLastChild();
- if (node == null || node.getNodeType() != Node.TEXT_NODE)
- return null;
- return (Text) node;
- }
-
- /**
- * findStartTag method
- *
- * @return org.w3c.dom.Element
- * @param tagName
- * java.lang.String
- */
- Element findStartTag(String tagName, String rootName) {
- if (tagName == null)
- return null;
-
- // check previous for empty content element
- Node prev = null;
- if (this.nextNode != null)
- prev = this.nextNode.getPreviousSibling();
- else if (this.parentNode != null)
- prev = this.parentNode.getLastChild();
- if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) prev;
- if (!element.hasEndTag() && !element.isEmptyTag() && element.matchTagName(tagName))
- return element;
- }
-
- for (Node parent = this.parentNode; parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl element = (ElementImpl) parent;
- if (element.matchTagName(tagName))
- return element;
- if (rootName != null && element.matchTagName(rootName))
- break;
- }
-
- return null;
- }
-
- /**
- * getNextNode method
- *
- * @return org.w3c.dom.Node
- */
- Node getNextNode() {
- return this.nextNode;
- }
-
- /**
- * getParentNode method
- *
- * @return org.w3c.dom.Node
- */
- Node getParentNode() {
- return this.parentNode;
- }
-
- /**
- * getRootNode method
- *
- * @return org.w3c.dom.Node
- */
- Node getRootNode() {
- return this.rootNode;
- }
-
- /**
- * setLast method
- */
- void setLast() {
- if (this.parentNode == null)
- return;
- if (this.nextNode != null) {
- Node prev = this.nextNode.getPreviousSibling();
- if (prev == null || prev.getNodeType() != Node.ELEMENT_NODE)
- return;
- ElementImpl element = (ElementImpl) prev;
- if (element.hasEndTag() || !element.isContainer() || element.isEmptyTag())
- return;
- setParentNode(prev);
- }
-
- // find last open parent
- Node parent = this.parentNode;
- Node last = parent.getLastChild();
- while (last != null) {
- if (last.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl element = (ElementImpl) last;
- if (element.hasEndTag() || !element.isContainer() || element.isEmptyTag())
- break;
- parent = element;
- last = parent.getLastChild();
- }
- if (parent != this.parentNode)
- setParentNode(parent);
- }
-
- /**
- * setNextNode method
- *
- * @param nextNode
- * org.w3c.dom.Node
- */
- void setNextNode(Node nextNode) {
- this.nextNode = nextNode;
- if (nextNode == null)
- return;
- this.parentNode = nextNode.getParentNode();
- }
-
- /**
- * setParentNode method
- *
- * @param parentNode
- * org.w3c.dom.Node
- */
- void setParentNode(Node parentNode) {
- this.parentNode = parentNode;
- this.nextNode = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java
deleted file mode 100644
index 9a3e255aeb..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifier.java
+++ /dev/null
@@ -1,139 +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.xml.core.internal.document;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- * XMLModelNotifier manages the notification process. Clients should not use
- * extend or reference.
- *
- * ISSUE: should be internalized.
- */
-
-public interface XMLModelNotifier {
-
- /**
- * attrReplaced method
- *
- * @param element
- * org.w3c.dom.Element
- * @param newAttr
- * org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- void attrReplaced(Element element, Attr newAttr, Attr oldAttr);
-
- /**
- * Signal that changing is starting.
- *
- */
- void beginChanging();
-
- /**
- * Signal that changing is starting with a brand new model.
- *
- */
- void beginChanging(boolean newModel);
-
- /**
- * Cancel pending notifications. This is called in the context of
- * "reinitialization" so is assumed ALL notifications can be safely
- * canceled, assuming that once factories and adapters are re-initialized
- * they will be re-notified as text is set in model, if still appropriate.
- */
- void cancelPending();
-
- /**
- * childReplaced method
- *
- * @param parentNode
- * org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- void childReplaced(Node parentNode, Node newChild, Node oldChild);
-
- /**
- * Editable state changed for node.
- *
- */
- void editableChanged(Node node);
-
- /**
- * Signal changing is finished.
- *
- */
- void endChanging();
-
- /**
- * Signal end tag changed.
- *
- * @param element
- *
- */
- void endTagChanged(Element element);
-
- /**
- * Used to reflect state of model.
- *
- * @return true if model had changed.
- *
- */
- boolean hasChanged();
-
- /**
- * Used to reflect state of parsing process.
- *
- * @return true if model is currently changing.
- */
- boolean isChanging();
-
- /**
- * signal property changed
- *
- * @param node
- */
- void propertyChanged(Node node);
-
- /**
- * signal start tag changed
- *
- * @param element
- */
- void startTagChanged(Element element);
-
- /**
- * signal structured changed.
- *
- * @param node
- */
- void structureChanged(Node node);
-
- /**
- * valueChanged method
- *
- * @param node
- * org.w3c.dom.Node
- */
- void valueChanged(Node node);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
deleted file mode 100644
index 75f89a089b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
+++ /dev/null
@@ -1,496 +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.wst.xml.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XMLModelNotifierImpl implements XMLModelNotifier {
-
- private static class NotifyEvent {
- Object changedFeature;
- boolean discarded;
- Object newValue;
- // note: don't initialize instance variables, since
- // that causes double assignments, and lots of these are created.
- INodeNotifier notifier;
- Object oldValue;
- int pos;
- String reason;
- int type;
- int index;
-
- NotifyEvent(INodeNotifier notifier, int type, Object changedFeature, Object oldValue, Object newValue, int pos) {
- this.notifier = notifier;
- this.type = type;
- this.changedFeature = changedFeature;
- this.oldValue = oldValue;
- this.newValue = newValue;
- this.pos = pos;
- this.reason = ""; //$NON-NLS-1$
- }
- }
-
- private final static String ADDED_THEN_REMOVED = "Discard: Added then removed rule"; //$NON-NLS-1$
- private final static boolean fOptimizeDeferred = true;
- private final static boolean fOptimizeDeferredAccordingToParentAdded = true;
- private final static boolean fOptimizeDeferredAccordingToParentRemoved = true;
- private final static String PARENT_IS_ADDED = "Disarded: Parent has just been added"; //$NON-NLS-1$
- /* start: for debugging only */
- private final static String PARENT_IS_REMOVED_TOO = "Discard: Parent was removed too"; //$NON-NLS-1$
- private final static String PARENT_IS_REPARENTED = "Not Discard: Parent was removed so this implies reparenting"; //$NON-NLS-1$
- private Node changedRoot = null;
-
- private boolean changing = false;
- private boolean doingNewModel = false;
- private List fEvents = null;
- private boolean flushing = false;
-
- /**
- */
- public XMLModelNotifierImpl() {
- super();
- }
-
- /**
- * attrReplaced method
- *
- * @param element
- * org.w3c.dom.Element
- * @param newAttr
- * org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- public void attrReplaced(Element element, Attr newAttr, Attr oldAttr) {
- if (element == null)
- return;
- Attr attr = null;
- String oldValue = null;
- String newValue = null;
- if (oldAttr != null) {
- attr = oldAttr;
- oldValue = oldAttr.getValue();
- }
- if (newAttr != null) {
- attr = newAttr;
- newValue = newAttr.getValue();
- }
- IDOMNode notifier = (IDOMNode) element;
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, attr, oldValue, newValue, offset);
- propertyChanged(notifier);
- }
-
- /**
- */
- public void beginChanging() {
- this.changing = true;
- }
-
- /**
- */
- public void beginChanging(boolean newModel) {
- beginChanging();
- this.doingNewModel = newModel;
- }
-
- public void cancelPending() {
- // we don't want to change the size of this array, since
- // the array may be being processed, in the deferred notification
- // loop, but we can signal that all
- // should be discarded, so any remaining ones will be ignored.
- if (this.fEvents != null) {
- int size = fEvents.size();
- for (int i = 0; i < size; i++) {
- NotifyEvent event = (NotifyEvent) fEvents.get(i);
- event.discarded = true;
- }
- }
- // this cancel is presumably being called as a function of
- // "reinitiailization" so we can ignore changes to the
- // old root, and changes to the new one will be triggered during
- // reinitialization.
- changedRoot = null;
- }
-
- /**
- * childReplaced method
- *
- * @param parentNode
- * org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- public void childReplaced(Node parentNode, Node newChild, Node oldChild) {
- if (parentNode == null)
- return;
- IDOMNode notifier = (IDOMNode) parentNode;
- int type = INodeNotifier.CHANGE;
- if (newChild == null)
- type = INodeNotifier.REMOVE;
- else if (oldChild == null)
- type = INodeNotifier.ADD;
- int offset = notifier.getStartOffset();
- notify(notifier, type, oldChild, oldChild, newChild, offset);
- structureChanged(notifier);
- }
-
- public void editableChanged(Node node) {
- if (node == null)
- return;
- IDOMNode notifier = (IDOMNode) node;
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
- propertyChanged(notifier);
- }
-
- /**
- */
- public void endChanging() {
- this.doingNewModel = false;
- if (!this.changing)
- return; // avoid nesting calls
- notifyDeferred();
- if (this.changedRoot != null) {
- notifyStructureChanged(this.changedRoot);
- if (Debug.debugNotifyDeferred) {
- String p = this.changedRoot.getNodeName();
- System.out.println("Deferred STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
- }
- this.changedRoot = null;
- }
- this.changing = false;
- }
-
- /**
- */
- public void endTagChanged(Element element) {
- if (element == null)
- return;
- IDOMNode notifier = (IDOMNode) element;
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
- propertyChanged(element);
- }
-
- /**
- */
- public boolean hasChanged() {
- return (this.fEvents != null);
- }
-
- /**
- */
- public boolean isChanging() {
- return this.changing;
- }
-
- /**
- */
- private void notify(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifier == null)
- return;
- if (this.changing && !this.flushing) {
- // defer notification
- if (this.fEvents == null)
- this.fEvents = new ArrayList();
- // we do not defer anything if we are doing a new Model,
- // except for the document event, since all others are
- // trivial and not needed at that initial point.
- // But even for that one document event, in the new model case,
- // it is still important to defer it.
- if ((!doingNewModel) || (((Node) notifier).getNodeType() == Node.DOCUMENT_NODE)) {
- this.fEvents.add(new NotifyEvent(notifier, eventType, changedFeature, oldValue, newValue, pos));
- }
- return;
- }
- try {
- // Its important to "keep going" if exception occurs, since this
- // notification
- // comes in between "about to change" and "changed" events. We do
- // log, however,
- // since would indicate a program error.
- notifier.notify(eventType, changedFeature, oldValue, newValue, pos);
- } catch (Exception e) {
- Logger.logException("A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- */
- private void notifyDeferred() {
- if (this.fEvents == null)
- return;
- if (this.flushing)
- return;
- this.flushing = true; // force notification
- int count = this.fEvents.size();
-
- if (!doingNewModel && fOptimizeDeferred) {
- Map notifyEvents = new HashMap();
- for (int i = 0; i < count; i++) {
- NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
- if (event == null)
- continue; // error
- event.index = i;
- if(event.type == INodeNotifier.REMOVE) {
- addToMap(event.oldValue, event, notifyEvents);
- }
- if(event.type == INodeNotifier.ADD) {
- addToMap(event.newValue, event, notifyEvents);
- }
- }
- Iterator it = notifyEvents.values().iterator();
- while (it.hasNext()) {
- NotifyEvent[] es = (NotifyEvent[]) it.next();
- for (int i = 0; i < es.length - 1; i++) {
- NotifyEvent event = es[i];
- if(es[i].discarded) continue;
- NotifyEvent next = es[i + 1];
- if(es[i].type == INodeNotifier.ADD && next.type == INodeNotifier.REMOVE) {
- // Added then removed later, discard both
- event.discarded = true;
- next.discarded = true;
- if (Debug.debugNotifyDeferred) {
- event.reason = event.reason + ADDED_THEN_REMOVED + "(see " + next.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- next.reason = next.reason + ADDED_THEN_REMOVED + "(see " + event.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
- for (int i = 0; i < count; i++) {
- NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
- if (event == null)
- continue; // error
- if(event.discarded) continue;
- if (event.notifier != null && fOptimizeDeferredAccordingToParentAdded) {
- if (event.type == INodeNotifier.ADD) {
- NotifyEvent[] es = (NotifyEvent[])notifyEvents.get(event.notifier);
- if(es != null) for (int p = 0; p < es.length && es[p].index < event.index; p++) {
- NotifyEvent prev = es[p];
- if (prev.type == INodeNotifier.REMOVE && prev.oldValue == event.notifier) {
- // parent is reparented, do not discard
- if (Debug.debugNotifyDeferred) {
- event.reason = event.reason + PARENT_IS_REPARENTED + "(see " + prev.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- } else if (prev.type == INodeNotifier.ADD && prev.newValue == event.notifier) {
- // parent has been added, discard this
- event.discarded = true;
- if (Debug.debugNotifyDeferred) {
- event.reason = event.reason + PARENT_IS_ADDED + "(see " + prev.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- }
- }
- }
- }
- if(event.discarded) continue;
- if (event.notifier != null && fOptimizeDeferredAccordingToParentRemoved) {
- if (event.type == INodeNotifier.REMOVE) {
- NotifyEvent[] es = (NotifyEvent[])notifyEvents.get(event.notifier);
- if(es != null) for (int n = 0; n < es.length; n++) {
- NotifyEvent next = es[n];
- if(next.index > event.index && next.type == INodeNotifier.REMOVE) {
- if (next.oldValue == event.notifier) {
- // parent will be removed, discard this
- event.discarded = true;
- if (Debug.debugNotifyDeferred) {
- event.reason = event.reason + PARENT_IS_REMOVED_TOO + "(see " + next.index + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- }
- }
- }
- }
- }
- if(event.discarded) continue;
- }
- }
- for (int i = 0; i < count; i++) {
- NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
- if (event == null)
- continue; // error
- if(event.discarded) continue;
- notify(event.notifier, event.type, event.changedFeature, event.oldValue, event.newValue, event.pos);
- }
- if (Debug.debugNotifyDeferred) {
- for (int l = 0; l < count; l++) {
- NotifyEvent event = (NotifyEvent) this.fEvents.get(l);
- Object o = null;
- String t = null;
- if (event.type == INodeNotifier.ADD) {
- o = event.newValue;
- t = " + "; //$NON-NLS-1$
- } else if (event.type == INodeNotifier.REMOVE) {
- o = event.oldValue;
- t = " - "; //$NON-NLS-1$
- }
- if (o instanceof Element) {
- String p = ((Node) event.notifier).getNodeName();
- String c = ((Node) o).getNodeName();
- String d = (event.discarded ? "! " : " "); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println(d + p + t + c);
- }
- }
- }
- this.flushing = false;
- this.fEvents = null;
- }
-
- void addToMap(Object o, NotifyEvent event, Map map) {
- if(o == null) return;
- Object x = map.get(o);
- if(x == null) {
- map.put(o, new NotifyEvent[]{event});
- } else {
- NotifyEvent[] es = (NotifyEvent[])x;
- NotifyEvent[] es2 = new NotifyEvent[es.length + 1];
- System.arraycopy(es, 0, es2, 0, es.length);
- es2[es.length] = event;
- map.put(o, es2);
- }
- }
-
- /**
- */
- private void notifyStructureChanged(Node root) {
- if (root == null)
- return;
- INodeNotifier notifier = (INodeNotifier) root;
- try {
- // Its important to "keep going" if exception occurs, since this
- // notification
- // comes in between "about to change" and "changed" events. We do
- // log, however,
- // since would indicate a program error.
- notifier.notify(INodeNotifier.STRUCTURE_CHANGED, null, null, null, -1);
- } catch (Exception e) {
- Logger.logException("A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[INodeNotifier.STRUCTURE_CHANGED] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- }
-
- /**
- */
- public void propertyChanged(Node node) {
- }
-
- /**
- * @param node
- */
- private void setCommonRootIfNeeded(Node node) {
- // defer notification
- if (this.changedRoot == null) {
- this.changedRoot = node;
- } else {
- // tiny optimization: if previous commonAncestor (changedRoot) is
- // already 'document',
- // or if already equal to this 'node',
- // then no need to re-calculate
- if (changedRoot.getNodeType() != Node.DOCUMENT_NODE && changedRoot != node) {
- Node common = ((NodeImpl) this.changedRoot).getCommonAncestor(node);
- if (common != null)
- this.changedRoot = common;
- else
- this.changedRoot = node;
- }
- }
- }
-
- /**
- */
- public void startTagChanged(Element element) {
- if (element == null)
- return;
- IDOMNode notifier = (IDOMNode) element;
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
- propertyChanged(element);
- }
-
- /**
- */
- public void structureChanged(Node node) {
- if (node == null)
- return;
- if (isChanging()) {
- setCommonRootIfNeeded(node);
- if (Debug.debugNotifyDeferred) {
- String p = this.changedRoot.getNodeName();
- System.out.println("requested STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
- }
- return;
- }
- if (Debug.debugNotifyDeferred) {
- String p = node.getNodeName();
- System.out.println("STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
- }
- notifyStructureChanged(node);
- }
-
- /**
- * valueChanged method
- *
- * @param node
- * org.w3c.dom.Node
- */
- public void valueChanged(Node node) {
- if (node == null)
- return;
- IDOMNode notifier = null;
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- Attr attr = (Attr) node;
- notifier = (IDOMNode) attr.getOwnerElement();
- // TODO_dmw: experimental: changed 06/29/2004 to send "structuure
- // changed" even for attribute value changes
- // there are pros and cons to considering attribute value
- // "structure changed". Will (re)consider
- // setCommonRootIfNeeded(notifier);
- if (notifier == null)
- return;
- String value = attr.getValue();
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, attr, null, value, offset);
- } else {
- // note: we do not send structured changed event for content
- // changed
- notifier = (IDOMNode) node;
- String value = node.getNodeValue();
- int offset = notifier.getStartOffset();
- notify(notifier, INodeNotifier.CHANGE, null, null, value, offset);
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- IDOMNode parent = (IDOMNode) node.getParentNode();
- if (parent != null) {
- notify(parent, INodeNotifier.CONTENT_CHANGED, node, null, value, offset);
- }
- }
- }
- propertyChanged(notifier);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
deleted file mode 100644
index 9f893bb53c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
+++ /dev/null
@@ -1,2422 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.xml.core.internal.commentelement.impl.CommentElementConfiguration;
-import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * XMLModelParser
- */
-public class XMLModelParser {
- private XMLModelContext context = null;
- private DOMModelImpl model = null;
- private TextImpl lastTextNode = null;
-
- /**
- */
- protected XMLModelParser(DOMModelImpl model) {
- super();
-
- if (model != null) {
- this.model = model;
- }
- }
-
- /**
- */
- protected boolean canBeImplicitTag(Element element) {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.canBeImplicitTag(element);
- }
- return false;
- }
-
- /**
- */
- protected boolean canBeImplicitTag(Element element, Node child) {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.canBeImplicitTag(element, child);
- }
- return false;
- }
-
- /**
- */
- protected boolean canContain(Element element, Node child) {
- if (element == null || child == null)
- return false;
- ElementImpl impl = (ElementImpl) element;
- if (impl.isEndTag())
- return false; // invalid (floating) end tag
- if (!impl.isContainer())
- return false;
- if (child.getNodeType() != Node.TEXT_NODE) {
- if (impl.isJSPContainer() || impl.isCDATAContainer()) {
- // accepts only Text child
- return false;
- }
- }
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.canContain(element, child);
- }
- return true;
- }
-
- /**
- */
- private void changeAttrEqual(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return;
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return;
- Node node = root.getNodeAt(offset);
- if (node == null)
- return;
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- // just notify the change instead of setting data
- ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
- pi.notifyValueChanged();
- }
- return;
- }
- // actually, do nothing
- }
-
- /**
- * changeAttrName method
- *
- */
- private void changeAttrName(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return;
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return;
- Node node = root.getNodeAt(offset);
- if (node == null)
- return;
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- // just notify the change instead of setting data
- ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
- pi.notifyValueChanged();
- }
- return;
- }
-
- ElementImpl element = (ElementImpl) node;
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null)
- return;
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) attributes.item(i);
- if (attr == null)
- continue;
- if (attr.getNameRegion() != region)
- continue;
-
- String name = flatNode.getText(region);
- attr.setName(name);
- break;
- }
- }
-
- /**
- * changeAttrValue method
- *
- */
- private void changeAttrValue(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return;
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return;
- Node node = root.getNodeAt(offset);
- if (node == null)
- return;
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- // just notify the change instead of setting data
- ProcessingInstructionImpl pi = (ProcessingInstructionImpl) node;
- pi.notifyValueChanged();
- }
- return;
- }
-
- ElementImpl element = (ElementImpl) node;
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null)
- return;
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- AttrImpl attr = (AttrImpl) attributes.item(i);
- if (attr == null)
- continue;
- if (attr.getValueRegion() != region)
- continue;
- // just notify the change instead of setting value
- attr.notifyValueChanged();
- break;
- }
- }
-
- /**
- * changeData method
- *
- */
- private void changeData(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return;
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return;
- Node node = root.getNodeAt(offset);
- if (node == null)
- return;
- switch (node.getNodeType()) {
- case Node.TEXT_NODE : {
- TextImpl text = (TextImpl) node;
- if (text.isSharingStructuredDocumentRegion(flatNode)) {
- // has consecutive text sharing IStructuredDocumentRegion
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- this.context.setNextNode(node);
- cleanupText();
- break;
- }
- case Node.CDATA_SECTION_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- break;
- case Node.COMMENT_NODE :
- case Node.ELEMENT_NODE :
- // comment tag
- changeStructuredDocumentRegion(flatNode);
- return;
- default :
- return;
- }
-
- // just notify the change instead of setting data
- NodeImpl impl = (NodeImpl) node;
- impl.notifyValueChanged();
- }
-
- /**
- */
- private void changeEndTag(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return; // error
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return; // error
- Node node = root.getNodeAt(offset);
- if (node == null)
- return; // error
-
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- changeStructuredDocumentRegion(flatNode);
- return;
- }
-
- // check if change is only for close tag
- if (newRegions != null) {
- Iterator e = newRegions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_CLOSE)
- continue;
-
- // other region has changed
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- }
- if (oldRegions != null) {
- Iterator e = oldRegions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_CLOSE)
- continue;
-
- // other region has changed
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- }
-
- // change for close tag has no impact
- // do nothing
- }
-
- /**
- * changeRegion method
- *
- */
- void changeRegion(RegionChangedEvent change, IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (flatNode == null || region == null)
- return;
- if (this.model.getDocument() == null)
- return;
- this.context = new XMLModelContext(this.model.getDocument());
-
- //determine if change was whitespace only change
- boolean isWhitespaceChange = false;
- if(change.getText() != null && change.getText().length() > 0) {
- isWhitespaceChange = Character.isWhitespace(change.getText().charAt(0));
- } else if(change.getDeletedText() != null && change.getDeletedText().length() > 0) {
- isWhitespaceChange = Character.isWhitespace(change.getDeletedText().charAt(0));
- }
-
- // optimize typical cases
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_CONTENT || regionType == DOMRegionContext.XML_COMMENT_TEXT || regionType == DOMRegionContext.XML_CDATA_TEXT || regionType == DOMRegionContext.BLOCK_TEXT || isNestedContent(regionType)) {
- changeData(flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
- // change is entirely in white-space
- return;
- }
- changeAttrName(flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
- // change is entirely in white-space
- return;
- }
- changeAttrValue(flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
- // change is entirely in white-space
- return;
- }
- changeAttrEqual(flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
- if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
- // change is entirely in white-space
- return;
- }
- changeTagName(flatNode, region);
- }
- else {
- changeStructuredDocumentRegion(flatNode);
- }
- }
-
-
-
- /**
- */
- private void changeStartTag(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return; // error
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return; // error
- Node node = root.getNodeAt(offset);
- if (node == null)
- return; // error
-
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- ElementImpl element = (ElementImpl) node;
-
- // check if changes are only for attributes and close tag
- boolean tagNameUnchanged = false;
- if (newRegions != null) {
- Iterator e = newRegions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- continue;
- if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
- // change from empty tag may have impact on structure
- if (!element.isEmptyTag())
- continue;
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
- String oldTagName = element.getTagName();
- String newTagName = flatNode.getText(region);
- if (oldTagName != null && newTagName != null && oldTagName.equals(newTagName)) {
- // the tag name is unchanged
- tagNameUnchanged = true;
- continue;
- }
- }
-
- // other region has changed
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- }
- if (oldRegions != null) {
- Iterator e = oldRegions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- continue;
- if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
- // change from empty tag may have impact on structure
- if (!element.isEmptyTag())
- continue;
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
- // if new tag name is unchanged, it's OK
- if (tagNameUnchanged)
- continue;
- }
-
- // other region has changed
- changeStructuredDocumentRegion(flatNode);
- return;
- }
- }
-
- // update attributes
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return; // error
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null)
- return; // error
-
- // first remove attributes
- int regionIndex = 0;
- int attrIndex = 0;
- AttrImpl attr = null;
- while (attrIndex < attributes.getLength()) {
- attr = (AttrImpl) attributes.item(attrIndex);
- if (attr == null) { // error
- attrIndex++;
- continue;
- }
- ITextRegion nameRegion = attr.getNameRegion();
- if (nameRegion == null) { // error
- element.removeAttributeNode(attr);
- continue;
- }
- boolean found = false;
- for (int i = regionIndex; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region == nameRegion) {
- regionIndex = i + 1; // next region
- found = true;
- break;
- }
- }
- if (found) {
- attrIndex++;
- }
- else {
- element.removeAttributeNode(attr);
- }
- }
-
- // insert or update attributes
- attrIndex = 0; // reset to first
- AttrImpl newAttr = null;
- ITextRegion oldValueRegion = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (newAttr != null) {
- // insert deferred new attribute
- element.insertAttributeNode(newAttr, attrIndex++);
- newAttr = null;
- }
- else if (attr != null && oldValueRegion != null) {
- // notify existing attribute value removal
- attr.notifyValueChanged();
- }
-
- oldValueRegion = null;
- attr = (AttrImpl) attributes.item(attrIndex);
- if (attr != null && attr.getNameRegion() == region) {
- // existing attribute
- attrIndex++;
- // clear other regions
- oldValueRegion = attr.getValueRegion();
- attr.setEqualRegion(null);
- attr.setValueRegion(null);
- }
- else {
- String name = flatNode.getText(region);
- attr = (AttrImpl) this.model.getDocument().createAttribute(name);
- if (attr != null)
- attr.setNameRegion(region);
- // defer insertion of new attribute
- newAttr = attr;
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (attr != null) {
- attr.setEqualRegion(region);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (attr != null) {
- attr.setValueRegion(region);
- if (attr != newAttr && oldValueRegion != region) {
- // notify existing attribute value changed
- attr.notifyValueChanged();
- }
- oldValueRegion = null;
- attr = null;
- }
- }
- }
-
- if (newAttr != null) {
- // insert deferred new attribute
- element.appendAttributeNode(newAttr);
- }
- else if (attr != null && oldValueRegion != null) {
- // notify existing attribute value removal
- attr.notifyValueChanged();
- }
- }
-
- /**
- * changeStructuredDocumentRegion method
- *
- */
- private void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return;
- if (this.model.getDocument() == null)
- return;
-
- setupContext(flatNode);
-
- removeStructuredDocumentRegion(flatNode);
- // make sure the parent is set to deepest level
- // when end tag has been removed
- this.context.setLast();
- insertStructuredDocumentRegion(flatNode);
-
- cleanupText();
- cleanupEndTag();
- }
-
- /**
- */
- private void changeTagName(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = flatNode.getStart();
- if (offset < 0)
- return; // error
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return; // error
- Node node = root.getNodeAt(offset);
- if (node == null)
- return; // error
-
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- changeStructuredDocumentRegion(flatNode);
- return;
- }
-
- ElementImpl element = (ElementImpl) node;
- String newTagName = flatNode.getText(region);
- if (newTagName == null || !element.matchTagName(newTagName)) {
- // the tag name is changed
- changeStructuredDocumentRegion(flatNode);
- return;
- }
-
- // the tag name is unchanged
- // this happens when typing spaces after the tag name
- // do nothing, but...
- // if it's not a change in the end tag of an element with the start
- // tag,
- // and case has been changed, set to element and notify
- if (!element.hasStartTag() || StructuredDocumentRegionUtil.getFirstRegionType(flatNode) != DOMRegionContext.XML_END_TAG_OPEN) {
- String tagName = element.getTagName();
- if (tagName == null || !tagName.equals(newTagName)) {
- element.setTagName(newTagName);
- element.notifyValueChanged();
- }
- }
- }
-
- /**
- * cleanupContext method
- */
- private void cleanupEndTag() {
- Node parent = this.context.getParentNode();
- Node next = this.context.getNextNode();
- while (parent != null) {
- while (next != null) {
- if (next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) next;
- if (element.isEndTag()) {
- // floating end tag
- String tagName = element.getTagName();
- String rootName = getFindRootName(tagName);
- ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
- if (start != null) {
- insertEndTag(start);
- // move the end tag from 'element' to 'start'
- start.addEndTag(element);
- removeNode(element);
- parent = this.context.getParentNode();
- next = this.context.getNextNode();
- continue;
- }
- }
- }
-
- Node first = next.getFirstChild();
- if (first != null) {
- parent = next;
- next = first;
- this.context.setNextNode(next);
- }
- else {
- next = next.getNextSibling();
- this.context.setNextNode(next);
- }
- }
-
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) parent;
- if (!element.hasEndTag() && element.hasStartTag() && element.getNextSibling() == null) {
- String tagName = element.getTagName();
- ElementImpl end = (ElementImpl) this.context.findEndTag(tagName);
- if (end != null) {
- // move the end tag from 'end' to 'element'
- element.addEndTag(end);
- removeEndTag(end);
- this.context.setParentNode(parent); // reset context
- continue;
- }
- }
- }
-
- next = parent.getNextSibling();
- parent = parent.getParentNode();
- if (next != null) {
- this.context.setNextNode(next);
- }
- else {
- this.context.setParentNode(parent);
- }
- }
- }
-
- /**
- */
- private void cleanupText() {
- if (lastTextNode != null) {
- lastTextNode.notifyValueChanged();
- lastTextNode = null;
- }
- Node parent = this.context.getParentNode();
- if (parent == null)
- return; // error
- Node next = this.context.getNextNode();
- Node prev = (next == null ? parent.getLastChild() : next.getPreviousSibling());
-
- TextImpl nextText = null;
- TextImpl prevText = null;
- if (next != null && next.getNodeType() == Node.TEXT_NODE) {
- nextText = (TextImpl) next;
- }
- if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- prevText = (TextImpl) prev;
- }
- if (nextText == null && prevText == null)
- return;
- if (nextText != null && prevText != null) {
- // consecutive Text nodes created by setupContext(),
- // concat them
- IStructuredDocumentRegion flatNode = nextText.getStructuredDocumentRegion();
- if (flatNode != null)
- prevText.appendStructuredDocumentRegion(flatNode);
- Node newNext = next.getNextSibling();
- parent.removeChild(next);
- next = null;
- this.context.setNextNode(newNext);
- }
-
- TextImpl childText = (prevText != null ? prevText : nextText);
- if (childText.getNextSibling() == null && childText.getPreviousSibling() == null) {
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl parentElement = (ElementImpl) parent;
- if (!parentElement.hasStartTag() && !parentElement.hasEndTag()) {
- if (childText.isWhitespace() || childText.isInvalid()) {
- // implicit parent is not required
- Node newParent = parent.getParentNode();
- if (newParent != null) {
- Node newNext = parent.getNextSibling();
- newParent.removeChild(parent);
- parent.removeChild(childText);
- newParent.insertBefore(childText, newNext);
- if (childText == next) {
- this.context.setNextNode(childText);
- }
- else if (newNext != null) {
- this.context.setNextNode(newNext);
- }
- else {
- this.context.setParentNode(newParent);
- }
- // try again
- cleanupText();
- }
- }
- }
- }
- }
- }
-
- /**
- * This routine create an Element from comment data for comment style
- * elements, such as SSI and METADATA
- */
- protected Element createCommentElement(String data, boolean isJSPTag) {
- String trimmedData = data.trim();
- CommentElementConfiguration[] configs = CommentElementRegistry.getInstance().getConfigurations();
- for (int iConfig = 0; iConfig < configs.length; iConfig++) {
- CommentElementConfiguration config = configs[iConfig];
- if ((isJSPTag && !config.acceptJSPComment()) || (!isJSPTag && !config.acceptXMLComment())) {
- continue;
- }
- String[] prefixes = config.getPrefix();
- for (int iPrefix = 0; iPrefix < prefixes.length; iPrefix++) {
- if (trimmedData.startsWith(prefixes[iPrefix])) {
- return config.createElement(this.model.getDocument(), data, isJSPTag);
- }
- }
- }
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.createCommentElement(this.model.getDocument(), data, isJSPTag);
- }
- return null;
- }
-
- /**
- * This routine create an implicit Element for given parent and child,
- * such as HTML, BODY, HEAD, and TBODY for HTML document.
- */
- protected Element createImplicitElement(Node parent, Node child) {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.createImplicitElement(this.model.getDocument(), parent, child);
- }
- return null;
- }
-
- /**
- */
- private void demoteNodes(Node root, Node newParent, Node oldParent, Node next) {
- if (newParent.getNodeType() != Node.ELEMENT_NODE)
- return;
- ElementImpl newElement = (ElementImpl) newParent;
-
- // find next
- while (next == null) {
- if (oldParent.getNodeType() != Node.ELEMENT_NODE)
- return;
- ElementImpl oldElement = (ElementImpl) oldParent;
- if (oldElement.hasEndTag())
- return;
- oldParent = oldElement.getParentNode();
- if (oldParent == null)
- return; // error
- next = oldElement.getNextSibling();
- }
-
- while (next != null) {
- boolean done = false;
- if (next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl nextElement = (ElementImpl) next;
- if (!nextElement.hasStartTag()) {
- Node nextChild = nextElement.getFirstChild();
- if (nextChild != null) {
- // demote children
- next = nextChild;
- oldParent = nextElement;
- continue;
- }
-
- if (nextElement.hasEndTag()) {
- if (nextElement.matchEndTag(newElement)) {
- // stop at the matched invalid end tag
- next = nextElement.getNextSibling();
- oldParent.removeChild(nextElement);
- newElement.addEndTag(nextElement);
-
- if (newElement == root)
- return;
- Node p = newElement.getParentNode();
- // check if reached to top
- if (p == null || p == oldParent || p.getNodeType() != Node.ELEMENT_NODE)
- return;
- newElement = (ElementImpl) p;
- done = true;
- }
- }
- else {
- // remove implicit element
- next = nextElement.getNextSibling();
- oldParent.removeChild(nextElement);
- done = true;
- }
- }
- }
-
- if (!done) {
- if (!canContain(newElement, next)) {
- if (newElement == root)
- return;
- Node p = newElement.getParentNode();
- // check if reached to top
- if (p == null || p == oldParent || p.getNodeType() != Node.ELEMENT_NODE)
- return;
- newElement = (ElementImpl) p;
- continue;
- }
-
- Node child = next;
- next = next.getNextSibling();
- oldParent.removeChild(child);
- insertNode(newElement, child, null);
- Node childParent = child.getParentNode();
- if (childParent != newElement) {
- newElement = (ElementImpl) childParent;
- }
- }
-
- // find next parent and sibling
- while (next == null) {
- if (oldParent.getNodeType() != Node.ELEMENT_NODE)
- return;
- ElementImpl oldElement = (ElementImpl) oldParent;
-
- // dug parent must not have children at this point
- if (!oldElement.hasChildNodes() && !oldElement.hasStartTag()) {
- oldParent = oldElement.getParentNode();
- if (oldParent == null)
- return; // error
- next = oldElement;
- break;
- }
-
- if (oldElement.hasEndTag())
- return;
- oldParent = oldElement.getParentNode();
- if (oldParent == null)
- return; // error
- next = oldElement.getNextSibling();
- }
- }
- }
-
- private ModelParserAdapter getParserAdapter() {
- return (ModelParserAdapter) this.model.getDocument().getAdapterFor(ModelParserAdapter.class);
- }
-
- /**
- */
- protected String getFindRootName(String tagName) {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.getFindRootName(tagName);
- }
- return null;
- }
-
- /**
- */
- protected final IDOMModel getModel() {
- return this.model;
- }
-
- /**
- * insertCDATASection method
- *
- */
- private void insertCDATASection(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- CDATASectionImpl cdata = null;
- try {
- cdata = (CDATASectionImpl) this.model.getDocument().createCDATASection(null);
- }
- catch (DOMException ex) {
- }
- if (cdata == null) { // CDATA section might not be supported
- insertInvalidDecl(flatNode); // regard as invalid decl
- return;
- }
-
- cdata.setStructuredDocumentRegion(flatNode);
- insertNode(cdata);
- }
-
- /**
- * insertComment method
- *
- */
- private void insertComment(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- StringBuffer data = null;
- boolean isJSPTag = false;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (isNestedCommentOpen(regionType)) {
- isJSPTag = true;
- }
- else if (regionType == DOMRegionContext.XML_COMMENT_TEXT || isNestedCommentText(regionType)) {
- if (data == null) {
- data = new StringBuffer(flatNode.getText(region));
- }
- else {
- data.append(flatNode.getText(region));
- }
- }
- }
-
- if (data != null) {
- ElementImpl element = (ElementImpl) createCommentElement(data.toString(), isJSPTag);
- if (element != null) {
- if (!isEndTag(element)) {
- element.setStartStructuredDocumentRegion(flatNode);
- insertStartTag(element);
- return;
- }
-
- // end tag
- element.setEndStructuredDocumentRegion(flatNode);
-
- String tagName = element.getTagName();
- String rootName = getFindRootName(tagName);
- ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
- if (start != null) { // start tag found
- insertEndTag(start);
- start.addEndTag(element);
- return;
- }
-
- // invalid end tag
- insertNode(element);
- return;
- }
- }
-
- CommentImpl comment = (CommentImpl) this.model.getDocument().createComment(null);
- if (comment == null)
- return;
- if (isJSPTag)
- comment.setJSPTag(true);
- comment.setStructuredDocumentRegion(flatNode);
- insertNode(comment);
- }
-
- /**
- * insertDecl method
- *
- */
- private void insertDecl(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- boolean isDocType = false;
- String name = null;
- String publicId = null;
- String systemId = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
- isDocType = true;
- }
- else if (regionType == DOMRegionContext.XML_DOCTYPE_NAME) {
- if (name == null)
- name = flatNode.getText(region);
- }
- else if (regionType == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
- if (publicId == null)
- publicId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
- if (systemId == null)
- systemId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region);
- }
- }
-
- // invalid declaration
- if (!isDocType) {
- insertInvalidDecl(flatNode);
- return;
- }
-
- DocumentTypeImpl docType = (DocumentTypeImpl) this.model.getDocument().createDoctype(name);
- if (docType == null)
- return;
- if (publicId != null)
- docType.setPublicId(publicId);
- if (systemId != null)
- docType.setSystemId(systemId);
- docType.setStructuredDocumentRegion(flatNode);
- insertNode(docType);
- }
-
- /**
- * insertEndTag method can be used by subclasses, but not overrided.
- *
- * @param element
- * org.w3c.dom.Element
- */
- protected void insertEndTag(Element element) {
- if (element == null)
- return;
-
- Node newParent = element.getParentNode();
- if (newParent == null)
- return; // error
-
- if (!((ElementImpl) element).isContainer()) {
- // just update context
- Node elementNext = element.getNextSibling();
- if (elementNext != null)
- this.context.setNextNode(elementNext);
- else
- this.context.setParentNode(newParent);
- return;
- }
-
- // promote children
- Node newNext = element.getNextSibling();
- Node oldParent = this.context.getParentNode();
- if (oldParent == null)
- return; // error
- Node oldNext = this.context.getNextNode();
- promoteNodes(element, newParent, newNext, oldParent, oldNext);
-
- // update context
- // re-check the next sibling
- newNext = element.getNextSibling();
- if (newNext != null)
- this.context.setNextNode(newNext);
- else
- this.context.setParentNode(newParent);
- }
-
- /**
- * insertEndTag method
- *
- */
- private void insertEndTag(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- String tagName = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
- if (tagName == null)
- tagName = flatNode.getText(region);
- }
- }
-
- if (tagName == null) { // invalid end tag
- insertText(flatNode); // regard as invalid text
- return;
- }
-
- String rootName = getFindRootName(tagName);
- ElementImpl start = (ElementImpl) this.context.findStartTag(tagName, rootName);
- if (start != null) { // start tag found
- insertEndTag(start);
- start.setEndStructuredDocumentRegion(flatNode);
- return;
- }
-
- // invalid end tag
- ElementImpl end = null;
- try {
- end = (ElementImpl) this.model.getDocument().createElement(tagName);
- }
- catch (DOMException ex) {
- }
- if (end == null) { // invalid end tag
- insertText(flatNode); // regard as invalid text
- return;
- }
- end.setEndStructuredDocumentRegion(flatNode);
- insertNode(end);
- }
-
- /**
- * insertEntityRef method
- *
- */
- private void insertEntityRef(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- String name = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
- if (name == null)
- name = StructuredDocumentRegionUtil.getEntityRefName(flatNode, region);
- }
- }
-
- if (name == null) { // invalid entity
- insertText(flatNode);
- return;
- }
-
- // ISSUE: avoid this cast
- String value = ((DocumentImpl)this.model.getDocument()).getCharValue(name);
- if (value != null) { // character entity
- TextImpl text = (TextImpl) this.context.findPreviousText();
- if (text != null) { // existing text found
- // do not append data
- text.appendStructuredDocumentRegion(flatNode);
- // Adjacent text nodes, where changes were queued
- if (lastTextNode != null && lastTextNode != text)
- lastTextNode.notifyValueChanged();
- lastTextNode = text;
- return;
- }
-
- // new text
- text = (TextImpl) this.model.getDocument().createTextNode(null);
- if (text == null)
- return;
- text.setStructuredDocumentRegion(flatNode);
- insertNode(text);
- return;
- }
-
- // general entity reference
- EntityReferenceImpl ref = null;
- try {
- ref = (EntityReferenceImpl) this.model.getDocument().createEntityReference(name);
- }
- catch (DOMException ex) {
- }
- if (ref == null) { // entity reference might not be supported
- insertText(flatNode); // regard as invalid text
- return;
- }
-
- ref.setStructuredDocumentRegion(flatNode);
- insertNode(ref);
- }
-
- /**
- * insertInvalidDecl method
- *
- */
- private void insertInvalidDecl(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- ElementImpl element = null;
- try {
- element = (ElementImpl) this.model.getDocument().createElement("!");//$NON-NLS-1$
- }
- catch (DOMException ex) {
- }
- if (element == null) { // invalid tag
- insertText(flatNode); // regard as invalid text
- return;
- }
- element.setEmptyTag(true);
- element.setStartStructuredDocumentRegion(flatNode);
- insertNode(element);
- }
-
- /**
- * insertJSPTag method
- *
- */
- private void insertNestedTag(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- String tagName = null;
- AttrImpl attr = null;
- List attrNodes = null;
- boolean isCloseTag = false;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (isNestedTagOpen(regionType) || isNestedTagName(regionType)) {
- tagName = computeNestedTag(regionType, tagName, flatNode, region);
- }
- else if (isNestedTagClose(regionType)) {
- isCloseTag = true;
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- String name = flatNode.getText(region);
- attr = (AttrImpl) this.model.getDocument().createAttribute(name);
- if (attr != null) {
- attr.setNameRegion(region);
- if (attrNodes == null)
- attrNodes = new ArrayList();
- attrNodes.add(attr);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (attr != null) {
- attr.setEqualRegion(region);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (attr != null) {
- attr.setValueRegion(region);
- attr = null;
- }
- }
- }
-
- if (tagName == null) {
- if (isCloseTag) {
- // close JSP tag
- Node parent = this.context.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl start = (ElementImpl) parent;
- if (start.isJSPContainer()) {
- insertEndTag(start);
- start.setEndStructuredDocumentRegion(flatNode);
- return;
- }
- }
- }
- // invalid JSP tag
- insertText(flatNode); // regard as invalid text
- return;
- }
-
- ElementImpl element = null;
- try {
- element = (ElementImpl) this.model.getDocument().createElement(tagName);
- }
- catch (DOMException ex) {
- }
- if (element == null) { // invalid tag
- insertText(flatNode); // regard as invalid text
- return;
- }
- if (attrNodes != null) {
- for (int i = 0; i < attrNodes.size(); i++) {
- element.appendAttributeNode((Attr) attrNodes.get(i));
- }
- }
- element.setJSPTag(true);
- element.setStartStructuredDocumentRegion(flatNode);
- insertStartTag(element);
- }
-
- protected boolean isNestedTagClose(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected boolean isNestedTagOpen(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected String computeNestedTag(String regionType, String tagName, IStructuredDocumentRegion structuredDocumentRegion, ITextRegion region) {
- return tagName;
- }
-
- /**
- * insertNode method
- *
- * @param child
- * org.w3c.dom.Node
- */
- private void insertNode(Node node) {
- if(node != null && this.context != null) {
- Node parent = this.context.getParentNode();
- if(parent != null) {
- Node next = this.context.getNextNode();
- // Reset parents which are closed container elements; should not be parents
- if(parent.getNodeType() == Node.ELEMENT_NODE) {
- String type = ((ElementImpl)parent).getStartStructuredDocumentRegion().getLastRegion().getType();
- if(((ElementImpl)parent).isContainer() && type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- next = parent.getNextSibling();
- parent = parent.getParentNode();
- }
- else {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- while (parent.getNodeType() == Node.ELEMENT_NODE && !adapter.canContain( (Element) parent, node) && adapter.isEndTagOmissible((Element) parent)) {
- next = parent.getNextSibling();
- parent = parent.getParentNode();
- }
- }
- }
- }
- insertNode(parent, node, next);
- next = node.getNextSibling();
- if (next != null) {
- this.context.setNextNode(next);
- } else {
- this.context.setParentNode(node.getParentNode());
- }
- }
- }
- }
-
- /**
- */
- private void insertNode(Node parent, Node node, Node next) {
- while (next != null && next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl nextElement = (ElementImpl) next;
- if (nextElement.hasStartTag())
- break;
- if (!canBeImplicitTag(nextElement, node))
- break;
- parent = nextElement;
- next = nextElement.getFirstChild();
- }
- Element implicitElement = createImplicitElement(parent, node);
- if (implicitElement != null)
- node = implicitElement;
- parent.insertBefore(node, next);
- }
-
- /**
- * insertPI method
- *
- */
- private void insertPI(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- String target = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_PI_OPEN || regionType == DOMRegionContext.XML_PI_CLOSE)
- continue;
- if (target == null)
- target = flatNode.getText(region);
- }
-
- ProcessingInstructionImpl pi = (ProcessingInstructionImpl) this.model.getDocument().createProcessingInstruction(target, null);
- if (pi == null)
- return;
- pi.setStructuredDocumentRegion(flatNode);
- insertNode(pi);
- }
-
- /**
- * insertStartTag method can be used by subclasses, but not overridden.
- *
- * @param element
- * org.w3c.dom.Element
- */
- protected void insertStartTag(Element element) {
- if (element == null)
- return;
- if (this.context == null)
- return;
-
- insertNode(element);
-
- ElementImpl newElement = (ElementImpl) element;
- if (newElement.isEmptyTag() || !newElement.isContainer())
- return;
-
- // Ignore container tags that have been closed
- String type = newElement.getStartStructuredDocumentRegion().getLastRegion().getType();
- if(newElement.isContainer() && type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
- return;
-
- // demote siblings
- Node parent = this.context.getParentNode();
- if (parent == null)
- return; // error
- Node next = this.context.getNextNode();
- demoteNodes(element, element, parent, next);
-
- // update context
- Node firstChild = element.getFirstChild();
- if (firstChild != null)
- this.context.setNextNode(firstChild);
- else
- this.context.setParentNode(element);
- }
-
- /**
- * insertStartTag method
- *
- */
- private void insertStartTag(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
-
- String tagName = null;
- boolean isEmptyTag = false;
- AttrImpl attr = null;
- List attrNodes = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
- if (tagName == null)
- tagName = flatNode.getText(region);
- }
- else if (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- isEmptyTag = true;
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- String name = flatNode.getText(region);
- attr = (AttrImpl) this.model.getDocument().createAttribute(name);
- if (attr != null) {
- attr.setNameRegion(region);
- if (attrNodes == null)
- attrNodes = new ArrayList();
- attrNodes.add(attr);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (attr != null) {
- attr.setEqualRegion(region);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (attr != null) {
- attr.setValueRegion(region);
- attr = null;
- }
- }
- }
-
- if (tagName == null) { // invalid start tag
- insertText(flatNode); // regard as invalid text
- return;
- }
-
- ElementImpl element = null;
- try {
- element = (ElementImpl) this.model.getDocument().createElement(tagName);
- }
- catch (DOMException ex) {
- // typically invalid name
- }
- if (element == null) { // invalid tag
- insertText(flatNode); // regard as invalid text
- return;
- }
- if (attrNodes != null) {
- for (int i = 0; i < attrNodes.size(); i++) {
- element.appendAttributeNode((Attr) attrNodes.get(i));
- }
- }
- if (isEmptyTag)
- element.setEmptyTag(true);
- element.setStartStructuredDocumentRegion(flatNode);
- insertStartTag(element);
- }
-
- /**
- * insertStructuredDocumentRegion method
- *
- */
- protected void insertStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
- boolean isTextNode = false;
- if (regionType == DOMRegionContext.XML_TAG_OPEN) {
- insertStartTag(flatNode);
- }
- else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- insertEndTag(flatNode);
- }
- else if (regionType == DOMRegionContext.XML_COMMENT_OPEN || isNestedCommentOpen(regionType)) {
- insertComment(flatNode);
- }
- else if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
- insertEntityRef(flatNode);
- isTextNode = true;
- }
- else if (regionType == DOMRegionContext.XML_DECLARATION_OPEN) {
- insertDecl(flatNode);
- }
- else if (regionType == DOMRegionContext.XML_PI_OPEN) {
- insertPI(flatNode);
- }
- else if (regionType == DOMRegionContext.XML_CDATA_OPEN) {
- insertCDATASection(flatNode);
- }
- else if (isNestedTag(regionType)) {
- insertNestedTag(flatNode);
- }
- else {
- insertText(flatNode);
- isTextNode = true;
- }
-
- // Changes to text regions are queued up, and once the value is done changing a notification is sent
- if (!isTextNode && lastTextNode != null) {
- lastTextNode.notifyValueChanged();
- lastTextNode = null;
- }
- }
-
- protected boolean isNestedTag(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected boolean isNestedCommentText(String regionType) {
- boolean result = false;
- return result;
- }
-
-
- protected boolean isNestedCommentOpen(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected boolean isNestedTagName(String regionType) {
- boolean result = false;
- return result;
- }
-
- protected boolean isNestedContent(String regionType) {
- boolean result = false;
- return result;
- }
-
- /**
- * insertText method Can be called from subclasses, not to be overrided or
- * re-implemented.
- *
- */
- protected void insertText(IStructuredDocumentRegion flatNode) {
- TextImpl text = (TextImpl) this.context.findPreviousText();
- if (text != null) { // existing text found
- text.appendStructuredDocumentRegion(flatNode);
- // Adjacent text nodes, where changes were queued
- if (lastTextNode != null && lastTextNode != text)
- lastTextNode.notifyValueChanged();
- lastTextNode = text;
- return;
- }
-
- // new text
- text = (TextImpl) this.model.getDocument().createTextNode(null);
- if (text == null)
- return;
- text.setStructuredDocumentRegion(flatNode);
- insertNode(text);
- }
-
- /**
- */
- protected boolean isEndTag(IDOMElement element) {
- ModelParserAdapter adapter = getParserAdapter();
- if (adapter != null) {
- return adapter.isEndTag(element);
- }
- return element.isEndTag();
- }
-
- /**
- */
- private void promoteNodes(Node root, Node newParent, Node newNext, Node oldParent, Node next) {
- ElementImpl newElement = null;
- if (newParent.getNodeType() == Node.ELEMENT_NODE) {
- newElement = (ElementImpl) newParent;
- }
-
- Node rootParent = root.getParentNode();
- while (oldParent != rootParent) {
- while (next != null) {
- boolean done = false;
- boolean endTag = false;
- if (next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl nextElement = (ElementImpl) next;
- if (!nextElement.hasStartTag()) {
- Node nextChild = nextElement.getFirstChild();
- if (nextChild != null) {
- // promote children
- next = nextChild;
- oldParent = nextElement;
- continue;
- }
-
- if (nextElement.hasEndTag()) {
- if (nextElement.matchEndTag(newElement)) {
- endTag = true;
- }
- }
- else {
- // remove implicit element
- next = nextElement.getNextSibling();
- oldParent.removeChild(nextElement);
- done = true;
- }
- }
- }
-
- if (!done) {
- if (!endTag && newElement != null && !canContain(newElement, next)) {
- newParent = newElement.getParentNode();
- if (newParent == null)
- return; // error
- Node elementNext = newElement.getNextSibling();
- // promote siblings
- promoteNodes(newElement, newParent, elementNext, newElement, newNext);
- newNext = newElement.getNextSibling();
- if (newParent.getNodeType() == Node.ELEMENT_NODE) {
- newElement = (ElementImpl) newParent;
- }
- else {
- newElement = null;
- }
- continue;
- }
-
- Node child = next;
- next = next.getNextSibling();
- oldParent.removeChild(child);
- insertNode(newParent, child, newNext);
- Node childParent = child.getParentNode();
- if (childParent != newParent) {
- newParent = childParent;
- newElement = (ElementImpl) newParent;
- newNext = child.getNextSibling();
- }
- }
- }
-
- if (oldParent.getNodeType() != Node.ELEMENT_NODE)
- return;
- ElementImpl oldElement = (ElementImpl) oldParent;
- oldParent = oldElement.getParentNode();
- if (oldParent == null)
- return; // error
- next = oldElement.getNextSibling();
-
- if (oldElement.hasEndTag()) {
- Element end = null;
- if (!oldElement.hasChildNodes() && !oldElement.hasStartTag()) {
- oldParent.removeChild(oldElement);
- end = oldElement;
- }
- else {
- end = oldElement.removeEndTag();
- }
- if (end != null) {
- insertNode(newParent, end, newNext);
- Node endParent = end.getParentNode();
- if (endParent != newParent) {
- newParent = endParent;
- newElement = (ElementImpl) newParent;
- newNext = end.getNextSibling();
- }
- }
- }
- }
- }
-
- /**
- * removeEndTag method
- *
- * @param element
- * org.w3c.dom.Element
- */
- private void removeEndTag(Element element) {
- if (element == null)
- return;
- if (this.context == null)
- return;
-
- Node parent = element.getParentNode();
- if (parent == null)
- return; // error
-
- if (!((ElementImpl) element).isContainer()) {
- // just update context
- Node elementNext = element.getNextSibling();
- if (elementNext != null)
- this.context.setNextNode(elementNext);
- else
- this.context.setParentNode(parent);
- return;
- }
-
- // demote siblings
- Node next = element.getNextSibling();
- ElementImpl newElement = (ElementImpl) element;
- // find new parent
- for (Node last = newElement.getLastChild(); last != null; last = last.getLastChild()) {
- if (last.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl lastElement = (ElementImpl) last;
- if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
- break;
- newElement = lastElement;
- }
- Node lastChild = newElement.getLastChild();
- demoteNodes(element, newElement, parent, next);
-
- // update context
- Node newNext = null;
- if (lastChild != null)
- newNext = lastChild.getNextSibling();
- else
- newNext = newElement.getFirstChild();
- if (newNext != null)
- this.context.setNextNode(newNext);
- else
- this.context.setParentNode(newElement);
- }
-
- /**
- * Remove the specified node if it is no longer required implicit tag with
- * remaining child nodes promoted.
- */
- private Element removeImplicitElement(Node parent) {
- if (parent == null)
- return null;
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- return null;
- ElementImpl element = (ElementImpl) parent;
- if (!element.isImplicitTag())
- return null;
- if (canBeImplicitTag(element))
- return null;
-
- Node elementParent = element.getParentNode();
- if (elementParent == null)
- return null; // error
- Node firstChild = element.getFirstChild();
- Node child = firstChild;
- Node elementNext = element.getNextSibling();
- while (child != null) {
- Node nextChild = child.getNextSibling();
- element.removeChild(child);
- elementParent.insertBefore(child, elementNext);
- child = nextChild;
- }
-
- // reset context
- if (this.context.getParentNode() == element) {
- Node oldNext = this.context.getNextNode();
- if (oldNext != null) {
- this.context.setNextNode(oldNext);
- }
- else {
- if (elementNext != null) {
- this.context.setNextNode(elementNext);
- }
- else {
- this.context.setParentNode(elementParent);
- }
- }
- }
- else if (this.context.getNextNode() == element) {
- if (firstChild != null) {
- this.context.setNextNode(firstChild);
- }
- else {
- if (elementNext != null) {
- this.context.setNextNode(elementNext);
- }
- else {
- this.context.setParentNode(elementParent);
- }
- }
- }
-
- removeNode(element);
- return element;
- }
-
- /**
- * removeNode method
- *
- * @param node
- * org.w3c.dom.Node
- */
- private void removeNode(Node node) {
- if (node == null)
- return;
- if (this.context == null)
- return;
-
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Node next = node.getNextSibling();
- Node prev = node.getPreviousSibling();
-
- // update context
- Node oldParent = this.context.getParentNode();
- if (node == oldParent) {
- if (next != null)
- this.context.setNextNode(next);
- else
- this.context.setParentNode(parent);
- }
- else {
- Node oldNext = this.context.getNextNode();
- if (node == oldNext) {
- this.context.setNextNode(next);
- }
- }
-
- parent.removeChild(node);
-
- if (removeImplicitElement(parent) != null)
- return;
-
- // demote sibling
- if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl newElement = (ElementImpl) prev;
- if (!newElement.hasEndTag() && !newElement.isEmptyTag() && newElement.isContainer()) {
- // find new parent
- for (Node last = newElement.getLastChild(); last != null; last = last.getLastChild()) {
- if (last.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl lastElement = (ElementImpl) last;
- if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
- break;
- newElement = lastElement;
- }
- Node lastChild = newElement.getLastChild();
- demoteNodes(prev, newElement, parent, next);
-
- // update context
- Node newNext = null;
- if (lastChild != null)
- newNext = lastChild.getNextSibling();
- else
- newNext = newElement.getFirstChild();
- if (newNext != null)
- this.context.setNextNode(newNext);
- else
- this.context.setParentNode(newElement);
- }
- }
- }
-
- /**
- * removeStartTag method
- *
- * @param element
- * org.w3c.dom.Element
- */
- private void removeStartTag(Element element) {
- if (element == null)
- return;
- if (this.context == null)
- return;
-
- // for implicit tag
- ElementImpl oldElement = (ElementImpl) element;
- if (canBeImplicitTag(oldElement)) {
- Node newParent = null;
- Node prev = oldElement.getPreviousSibling();
- if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl prevElement = (ElementImpl) prev;
- if (!prevElement.hasEndTag()) {
- if (prevElement.hasStartTag() || prevElement.matchTagName(oldElement.getTagName())) {
- newParent = prevElement;
- }
- }
- }
- if (newParent == null) {
- // this element should stay as implicit tag
- // just remove all attributes
- oldElement.removeStartTag();
-
- // update context
- Node child = oldElement.getFirstChild();
- if (child != null) {
- this.context.setNextNode(child);
- }
- else if (oldElement.hasEndTag()) {
- this.context.setParentNode(oldElement);
- }
- return;
- }
- }
- // for comment tag
- if (oldElement.isCommentTag())
- oldElement.removeStartTag();
-
- // promote children
- Node elementParent = element.getParentNode();
- Node parent = elementParent;
- if (parent == null)
- return;
- Node first = element.getFirstChild();
- Node firstElement = null; // for the case first is removed as end
- // tag
- if (first != null) {
- // find new parent for children
- ElementImpl newElement = null;
- for (Node last = element.getPreviousSibling(); last != null; last = last.getLastChild()) {
- if (last.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl lastElement = (ElementImpl) last;
- if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
- break;
- newElement = lastElement;
- }
- Node next = first;
- if (newElement != null) {
- while (next != null) {
- if (!newElement.hasEndTag() && newElement.hasStartTag() && next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl nextElement = (ElementImpl) next;
- if (!nextElement.hasStartTag() && nextElement.hasEndTag() && nextElement.matchEndTag(newElement)) {
- // stop at the matched invalid end tag
- Node elementChild = nextElement.getFirstChild();
- while (elementChild != null) {
- Node nextChild = elementChild.getNextSibling();
- nextElement.removeChild(elementChild);
- newElement.appendChild(elementChild);
- elementChild = nextChild;
- }
-
- next = nextElement.getNextSibling();
- element.removeChild(nextElement);
- newElement.addEndTag(nextElement);
- if (nextElement == first)
- firstElement = newElement;
-
- Node newParent = newElement.getParentNode();
- if (newParent == parent)
- break;
- if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
- break; // error
- newElement = (ElementImpl) newParent;
- continue;
- }
- }
- if (!canContain(newElement, next)) {
- Node newParent = newElement.getParentNode();
- if (newParent == parent)
- break;
- if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
- break; // error
- newElement = (ElementImpl) newParent;
- continue;
- }
- Node child = next;
- next = next.getNextSibling();
- element.removeChild(child);
- newElement.appendChild(child);
- }
- newElement = null;
- }
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- newElement = (ElementImpl) parent;
- }
- while (next != null) {
- if (newElement == null || canContain(newElement, next)) {
- Node child = next;
- next = next.getNextSibling();
- element.removeChild(child);
- parent.insertBefore(child, element);
- continue;
- }
-
- parent = newElement.getParentNode();
- if (parent == null)
- return;
-
- // promote siblings
- Node newNext = newElement.getNextSibling();
- Node child = element;
- while (child != null) {
- Node nextChild = child.getNextSibling();
- newElement.removeChild(child);
- parent.insertBefore(child, newNext);
- child = nextChild;
- }
-
- // leave the old end tag where it is
- if (newElement.hasEndTag()) {
- Element end = newElement.removeEndTag();
- if (end != null) {
- parent.insertBefore(end, newNext);
- }
- }
- if (!newElement.hasStartTag()) {
- // implicit element
- if (!newElement.hasChildNodes()) {
- parent.removeChild(newElement);
- }
- }
-
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- newElement = (ElementImpl) parent;
- }
- else {
- newElement = null;
- }
- }
- }
-
- Node newNext = element;
- Node startElement = null; // for the case element is removed as end
- // tag
- if (oldElement.hasEndTag()) {
- // find new parent for invalid end tag and siblings
- ElementImpl newElement = null;
- for (Node last = element.getPreviousSibling(); last != null; last = last.getLastChild()) {
- if (last.getNodeType() != Node.ELEMENT_NODE)
- break;
- ElementImpl lastElement = (ElementImpl) last;
- if (lastElement.hasEndTag() || lastElement.isEmptyTag() || !lastElement.isContainer())
- break;
- newElement = lastElement;
- }
- if (newElement != null) {
- // demote invalid end tag and sibling
- Node next = element;
- while (next != null) {
- if (!newElement.hasEndTag() && newElement.hasStartTag() && next.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl nextElement = (ElementImpl) next;
- if (!nextElement.hasStartTag() && nextElement.hasEndTag() && nextElement.matchEndTag(newElement)) {
- // stop at the matched invalid end tag
- Node elementChild = nextElement.getFirstChild();
- while (elementChild != null) {
- Node nextChild = elementChild.getNextSibling();
- nextElement.removeChild(elementChild);
- newElement.appendChild(elementChild);
- elementChild = nextChild;
- }
-
- next = nextElement.getNextSibling();
- parent.removeChild(nextElement);
- newElement.addEndTag(nextElement);
- if (nextElement == newNext)
- startElement = newElement;
-
- Node newParent = newElement.getParentNode();
- if (newParent == parent)
- break;
- if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
- break; // error
- newElement = (ElementImpl) newParent;
- continue;
- }
- }
- if (!canContain(newElement, next)) {
- Node newParent = newElement.getParentNode();
- if (newParent == parent)
- break;
- if (newParent == null || newParent.getNodeType() != Node.ELEMENT_NODE)
- break; // error
- newElement = (ElementImpl) newParent;
- continue;
- }
- Node child = next;
- next = next.getNextSibling();
- parent.removeChild(child);
- if (child == oldElement) {
- if (!oldElement.isCommentTag()) {
- // clone (re-create) end tag
- Element end = oldElement.removeEndTag();
- if (end != null) {
- child = end;
- newNext = end;
- }
- }
- }
- newElement.appendChild(child);
- }
- }
- else {
- if (!oldElement.isCommentTag()) {
- // clone (re-create) end tag
- Element end = oldElement.removeEndTag();
- if (end != null) {
- parent.insertBefore(end, oldElement);
- parent.removeChild(oldElement);
- newNext = end;
- }
- }
- }
- }
- else {
- newNext = oldElement.getNextSibling();
- parent.removeChild(oldElement);
- }
-
- // update context
- Node oldParent = this.context.getParentNode();
- Node oldNext = this.context.getNextNode();
- if (element == oldParent) {
- if (oldNext != null) {
- this.context.setNextNode(oldNext); // reset for new parent
- }
- else if (newNext != null) {
- this.context.setNextNode(newNext);
- }
- else {
- this.context.setParentNode(parent);
- }
- }
- else if (element == oldNext) {
- if (firstElement != null) {
- this.context.setParentNode(firstElement);
- }
- else if (first != null) {
- this.context.setNextNode(first);
- }
- else if (startElement != null) {
- this.context.setParentNode(startElement);
- }
- else {
- this.context.setNextNode(newNext);
- }
- }
-
- removeImplicitElement(elementParent);
- }
-
- /**
- * removeStructuredDocumentRegion method
- *
- */
- private void removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- NodeImpl next = (NodeImpl) this.context.getNextNode();
- if (next != null) {
- short nodeType = next.getNodeType();
- if (nodeType != Node.ELEMENT_NODE) {
- IStructuredDocumentRegion flatNode = next.getStructuredDocumentRegion();
- if (flatNode == oldStructuredDocumentRegion) {
- removeNode(next);
- return;
- }
- if (nodeType != Node.TEXT_NODE) {
- throw new StructuredDocumentRegionManagementException();
- }
- if (flatNode == null) {
- // this is the case for empty Text
- // remove and continue
- removeNode(next);
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- TextImpl text = (TextImpl) next;
- boolean isShared = text.isSharingStructuredDocumentRegion(oldStructuredDocumentRegion);
- if (isShared) {
- // make sure there is next Text node sharing this
- TextImpl nextText = (TextImpl) this.context.findNextText();
- if (nextText == null || !nextText.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
- isShared = false;
- }
- }
- oldStructuredDocumentRegion = text.removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- if (oldStructuredDocumentRegion == null) {
- throw new StructuredDocumentRegionManagementException();
- }
- if (text.getStructuredDocumentRegion() == null) {
- // this is the case partial IStructuredDocumentRegion is
- // removed
- removeNode(text);
- }
- else {
- // notify the change
- text.notifyValueChanged();
- }
- // if shared, continue to remove IStructuredDocumentRegion
- // from them
- if (isShared)
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
-
- ElementImpl element = (ElementImpl) next;
- if (element.hasStartTag()) {
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode != oldStructuredDocumentRegion) {
- throw new StructuredDocumentRegionManagementException();
- }
- if (element.hasEndTag() || element.hasChildNodes()) {
- element.setStartStructuredDocumentRegion(null);
- removeStartTag(element);
- }
- else {
- removeNode(element);
- }
- }
- else {
- Node child = element.getFirstChild();
- if (child != null) {
- this.context.setNextNode(child);
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
-
- if (!element.hasEndTag()) {
- // implicit element
- removeNode(element);
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
-
- IStructuredDocumentRegion flatNode = element.getEndStructuredDocumentRegion();
- if (flatNode != oldStructuredDocumentRegion) {
- throw new StructuredDocumentRegionManagementException();
- }
- removeNode(element);
- }
- return;
- }
-
- Node parent = this.context.getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE) {
- throw new StructuredDocumentRegionManagementException();
- }
-
- ElementImpl end = (ElementImpl) parent;
- if (end.hasEndTag()) {
- IStructuredDocumentRegion flatNode = end.getEndStructuredDocumentRegion();
- if (flatNode != oldStructuredDocumentRegion) {
- throw new StructuredDocumentRegionManagementException();
- }
- if (!end.hasStartTag() && !end.hasChildNodes()) {
- this.context.setNextNode(end);
- removeNode(end);
- }
- else {
- end.setEndStructuredDocumentRegion(null);
- removeEndTag(end);
- }
- return;
- }
-
- next = (NodeImpl) end.getNextSibling();
- if (next != null) {
- this.context.setNextNode(next);
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
-
- parent = end.getParentNode();
- if (parent != null) {
- this.context.setParentNode(parent);
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- }
-
- /**
- * replaceRegions method
- *
- * @param newRegions
- * java.util.Vector
- * @param oldRegions
- * java.util.Vector
- */
- void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- if (flatNode == null)
- return;
- if (this.model.getDocument() == null)
- return;
- this.context = new XMLModelContext(this.model.getDocument());
-
- // optimize typical cases
- String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
- if (regionType == DOMRegionContext.XML_TAG_OPEN) {
- changeStartTag(flatNode, newRegions, oldRegions);
- }
- else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- changeEndTag(flatNode, newRegions, oldRegions);
- }
- else {
- changeStructuredDocumentRegion(flatNode);
- }
- }
-
- /**
- * replaceStructuredDocumentRegions method
- *
- */
- void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- if (this.model.getDocument() == null)
- return;
- this.context = new XMLModelContext(this.model.getDocument());
-
- int newCount = (newStructuredDocumentRegions != null ? newStructuredDocumentRegions.getLength() : 0);
- int oldCount = (oldStructuredDocumentRegions != null ? oldStructuredDocumentRegions.getLength() : 0);
-
- if (oldCount > 0) {
- setupContext(oldStructuredDocumentRegions.item(0));
- // Node startParent = this.context.getParentNode();
-
- for (int i = 0; i < oldCount; i++) {
- IStructuredDocumentRegion documentRegion = oldStructuredDocumentRegions.item(i);
- removeStructuredDocumentRegion(documentRegion);
- }
- }
- else {
- if (newCount == 0)
- return;
- setupContext(newStructuredDocumentRegions.item(0));
- }
- // make sure the parent is set to deepest level
- // when end tag has been removed
- this.context.setLast();
-
- if (newCount > 0) {
- for (int i = 0; i < newCount; i++) {
- IStructuredDocumentRegion documentRegion = newStructuredDocumentRegions.item(i);
- insertStructuredDocumentRegion(documentRegion);
- }
- }
-
- cleanupText();
- cleanupEndTag();
- }
-
- /**
- * setupContext method
- *
- */
- private void setupContext(IStructuredDocumentRegion startStructuredDocumentRegion) {
- int offset = startStructuredDocumentRegion.getStart();
- if (offset < 0)
- return;
- NodeImpl root = (NodeImpl) this.context.getRootNode();
- if (root == null)
- return;
-
- if (offset == 0) {
- // at the beginning of document
- Node child = root.getFirstChild();
- if (child != null)
- this.context.setNextNode(child);
- else
- this.context.setParentNode(root);
- return;
- }
-
- NodeImpl node = (NodeImpl) root.getNodeAt(offset);
- if (node == null) {
- // might be at the end of document
- this.context.setParentNode(root);
- this.context.setLast();
- return;
- }
-
- if (offset == node.getStartOffset()) {
- this.context.setNextNode(node);
- return;
- }
-
- if (node.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) node;
- Text nextText = text.splitText(startStructuredDocumentRegion);
- // notify the change
- text.notifyValueChanged();
- if (nextText == null)
- return; // error
- this.context.setNextNode(nextText);
- return;
- }
-
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (offset >= ((NodeImpl) child).getEndOffset())
- continue;
- this.context.setNextNode(child);
- return;
- }
- this.context.setParentNode(node);
- this.context.setLast();
- }
-
- protected XMLModelContext getContext() {
- return context;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
deleted file mode 100644
index a92b2338ec..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
+++ /dev/null
@@ -1,1704 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.document;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-/**
- * XMLModelUpdater class
- */
-public class XMLModelUpdater {
- private int diff = 0;
- private int gapLength = 0;
- private int gapOffset = 0;
- private IStructuredDocumentRegion gapStructuredDocumentRegion = null;
- private ISourceGenerator generator = null;
- private DOMModelImpl model = null;
- private NodeImpl nextNode = null;
- private NodeImpl parentNode = null;
-
- protected XMLModelUpdater(DOMModelImpl model) {
- super();
-
- if (model != null) {
- this.model = model;
- this.generator = model.getGenerator();
- }
- }
-
- /**
- * changeAttrValue method
- *
- * @param attrNode
- * org.w3c.dom.Attr
- */
- private void changeAttrName(Attr attrNode) {
- if (attrNode == null)
- return;
-
- AttrImpl attr = (AttrImpl) attrNode;
- ElementImpl element = (ElementImpl) attr.getOwnerElement();
- if (element == null)
- return;
-
- if (element.isCommentTag()) {
- changeStartTag(element);
- return;
- }
-
- int offset = element.getStartOffset();
- int start = offset;
- int end = offset;
-
- String name = attr.getName();
- if (name == null)
- name = NodeImpl.EMPTY_STRING;
- ITextRegion nameRegion = attr.getNameRegion();
- if (nameRegion == null)
- return; // error
- start += nameRegion.getStart();
- // use getTextEnd() because getEnd() may include the tailing spaces
- end += nameRegion.getTextEnd();
-
- replaceSource(name, start, end);
- }
-
- /**
- * changeAttrValue method
- *
- * @param attrNode
- * org.w3c.dom.Attr
- */
- private void changeAttrValue(Attr attrNode) {
- if (attrNode == null)
- return;
-
- AttrImpl attr = (AttrImpl) attrNode;
- ElementImpl element = (ElementImpl) attr.getOwnerElement();
- if (element == null)
- return;
-
- if (element.isCommentTag()) {
- changeStartTag(element);
- return;
- }
-
- int offset = element.getStartOffset();
- int start = offset;
- int end = offset;
-
- String value = null;
- ITextRegion valueRegion = attr.getValueRegion();
- if (valueRegion != null) {
- char quote = 0; // no quote preference
- // DW: 4/16/2003 due to change in structuredDocument ... we need a
- // flatnode to
- // get at region values. For now I'll assume this is always the
- // first
- // flatnode .. may need to make smarter later (e.g. to search for
- // the flatnode that this.valueRegion belongs to.
- IStructuredDocumentRegion documentRegion = element.getFirstStructuredDocumentRegion();
- String oldValue = documentRegion.getText(valueRegion);
- if (oldValue != null && oldValue.length() > 0) {
- char firstChar = oldValue.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- quote = firstChar;
- }
- }
-
- ITextRegion startRegion = valueRegion;
-
- value = this.generator.generateAttrValue(attr, quote);
- if (value == null) {
- value = NodeImpl.EMPTY_STRING;
- // remove equal too
- ITextRegion equalRegion = attr.getEqualRegion();
- if (equalRegion != null)
- startRegion = equalRegion;
- }
- attr.setValueRegion(valueRegion); // reset value
-
- start += startRegion.getStart();
- // use getTextEnd() because getEnd() may include the tailing
- // spaces
- end += valueRegion.getTextEnd();
- }
- else {
- ITextRegion equalRegion = attr.getEqualRegion();
-
- value = this.generator.generateAttrValue(attr);
- if (value == null) {
- if (equalRegion == null)
- return; // nothng to do
- value = NodeImpl.EMPTY_STRING;
- // remove equal
- start += equalRegion.getStart();
- end += equalRegion.getTextEnd();
- }
- else {
- if (equalRegion != null) {
- // use getTextEnd() because getEnd() may include the
- // tailing spaces
- start += equalRegion.getTextEnd();
- }
- else {
- ITextRegion nameRegion = attr.getNameRegion();
- if (nameRegion == null)
- return; // must never happen
- // use getTextEnd() because getEnd() may include the
- // tailing spaces
- start += nameRegion.getTextEnd();
- value = '=' + value;
- }
- end = start;
- }
- }
-
- replaceSource(value, start, end);
- }
-
- /**
- */
- void changeEndTag(Element element) {
- String source = this.generator.generateEndTag(element);
- if (source == null)
- return;
- int length = source.length();
- if (length == 0)
- return;
-
- ElementImpl impl = (ElementImpl) element;
- int offset = impl.getEndStartOffset();
- int start = offset;
- int end = offset;
- if (impl.hasEndTag()) {
- end = impl.getEndOffset();
- this.gapStructuredDocumentRegion = impl.getEndStructuredDocumentRegion();
- impl.setEndStructuredDocumentRegion(new StructuredDocumentRegionProxy(offset, length));
- }
-
- replaceSource(source, start, end);
- }
-
- /**
- * changeName method
- *
- * @param node
- * org.w3c.dom.Node
- */
- void changeName(Node node) {
- if (node == null)
- return;
- if (getStructuredDocument() == null)
- return;
-
- // support changing name of attribute for setPrefix()
- short nodeType = node.getNodeType();
- if (nodeType == Node.ATTRIBUTE_NODE) {
- changeAttrName((Attr) node);
- return;
- }
-
- // not supported
- return;
- }
-
- void changeRegion(RegionChangedEvent change, IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd()) {
- // change is entirely in white-space
- return;
- }
-
- NodeImpl root = (NodeImpl) this.model.getDocument();
- this.parentNode = root;
- this.nextNode = (NodeImpl) root.getFirstChild();
-
- removeGapStructuredDocumentRegion(flatNode);
- insertGapStructuredDocumentRegionBefore(flatNode.getStart());
- changeStructuredDocumentRegion(flatNode);
- insertGapStructuredDocumentRegionAfter(flatNode.getEnd());
- }
-
- /**
- * This is a fallback method to regenerate the start tag.
- */
- void changeStartTag(Element element) {
- if (element == null)
- return;
- ElementImpl impl = (ElementImpl) element;
-
- if (!impl.hasStartTag() && !impl.hasEndTag()) {
- // need to generate the start and the end tags
- Node parent = element.getParentNode();
- if (parent != null) {
- replaceChild(parent, element, element);
- return;
- }
- // else error
- }
-
- String source = this.generator.generateStartTag(element);
- if (source == null)
- return;
- int length = source.length();
- if (length == 0)
- return;
-
- int offset = impl.getStartOffset();
- int start = offset;
- int end = offset;
- if (impl.hasStartTag()) {
- end = impl.getStartEndOffset();
- this.gapStructuredDocumentRegion = impl.getStartStructuredDocumentRegion();
- }
- impl.setStartStructuredDocumentRegion(new StructuredDocumentRegionProxy(offset, length));
-
- replaceSource(source, start, end);
- }
-
- private void changeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (oldStructuredDocumentRegion == null)
- return; // error
- if (this.parentNode == null)
- return; // error
-
- int oldOffset = oldStructuredDocumentRegion.getStart();
- int oldEnd = oldStructuredDocumentRegion.getEnd();
- boolean isEndTag = false;
-
- // find owner node
- NodeImpl ownerNode = null;
- while (this.parentNode != null) {
- if (this.nextNode != null) {
- IStructuredDocumentRegion nextStructuredDocumentRegion = this.nextNode.getStructuredDocumentRegion();
- if (nextStructuredDocumentRegion != null) {
- if (nextStructuredDocumentRegion == oldStructuredDocumentRegion) {
- ownerNode = this.nextNode;
- break;
- }
- int nextOffset = nextStructuredDocumentRegion.getStart();
- if (nextOffset == oldOffset) { // found
- ownerNode = this.nextNode;
- break;
- }
- if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) this.nextNode;
- if (text.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
- ownerNode = this.nextNode;
- break;
- }
- int nextEnd = nextStructuredDocumentRegion.getEnd();
- if (nextOffset < oldEnd && nextEnd > oldOffset) {
- ownerNode = this.nextNode;
- break;
- }
- }
- }
-
- Node child = this.nextNode.getFirstChild();
- if (child != null) {
- this.parentNode = this.nextNode;
- this.nextNode = (NodeImpl) child;
- continue;
- }
-
- if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
- this.parentNode = this.nextNode;
- this.nextNode = null;
- continue;
- }
-
- this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
- if (this.nextNode != null)
- continue;
- }
-
- if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) this.parentNode;
- IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- if (endStructuredDocumentRegion == oldStructuredDocumentRegion) {
- ownerNode = this.parentNode;
- isEndTag = true;
- break;
- }
- int endOffset = endStructuredDocumentRegion.getStart();
- if (endOffset == oldOffset) { // found
- ownerNode = this.parentNode;
- isEndTag = true;
- break;
- }
- }
- }
-
- this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
- this.parentNode = (NodeImpl) this.parentNode.getParentNode();
- }
- if (ownerNode == null)
- throw new StructuredDocumentRegionManagementException();
-
- short nodeType = ownerNode.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) ownerNode;
- if (isEndTag) {
- element.setEndStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- else {
- element.setStartStructuredDocumentRegion(oldStructuredDocumentRegion);
- updateAttrRegions(element, oldStructuredDocumentRegion);
- }
- }
- else if (nodeType == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) ownerNode;
-
- IStructuredDocumentRegion flatNode = text.getStructuredDocumentRegion();
- if (flatNode == oldStructuredDocumentRegion) {
- int newOffset = oldOffset;
- int newEnd = oldEnd;
- if (oldOffset == this.gapOffset) {
- newOffset += this.diff;
- }
- else {
- newEnd = this.gapOffset;
- }
- int newLength = newEnd - newOffset;
- IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(newOffset, newLength, oldStructuredDocumentRegion);
- text.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
- if (oldEnd > newEnd) {
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- return;
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- int offset = proxy.getOffset();
- int end = offset + proxy.getLength();
- if (proxy.getStructuredDocumentRegion() == null) {
- if (offset == oldOffset && end == oldEnd) {
- text.setStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- else {
- if (end > oldEnd) {
- StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
- container.appendStructuredDocumentRegion(oldStructuredDocumentRegion);
- proxy.setOffset(oldEnd);
- proxy.setLength(end - oldEnd);
- container.appendStructuredDocumentRegion(proxy);
- text.setStructuredDocumentRegion(container);
- }
- else {
- proxy.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-
- if (end < oldEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- }
- }
- return;
- }
-
- if (offset >= this.gapOffset) {
- proxy.setOffset(offset + this.diff);
- end += this.diff;
- }
- if (end < oldEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- }
- else if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue; // error
- if (content == oldStructuredDocumentRegion) {
- int newOffset = oldOffset;
- int newEnd = oldEnd;
- if (oldOffset == this.gapOffset) {
- newOffset += this.diff;
- }
- else {
- newEnd = this.gapOffset;
- }
- int newLength = newEnd - newOffset;
- IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(newOffset, newLength, oldStructuredDocumentRegion);
- container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
-
- if (oldEnd > newEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- return;
- }
-
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- int offset = proxy.getOffset();
- int end = offset + proxy.getLength();
- if (end <= oldOffset)
- continue;
- if (proxy.getStructuredDocumentRegion() == null) {
- if (offset == oldOffset && end == oldEnd) {
- container.replaceStructuredDocumentRegion(oldStructuredDocumentRegion, i);
- }
- else {
- if (end > oldEnd) {
- container.insertStructuredDocumentRegion(oldStructuredDocumentRegion, i);
- proxy.setOffset(oldEnd);
- proxy.setLength(end - oldEnd);
- }
- else {
- proxy.setStructuredDocumentRegion(oldStructuredDocumentRegion);
-
- if (end < oldEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- }
- }
- return;
- }
-
- if (offset >= this.gapOffset) {
- proxy.setOffset(offset + this.diff);
- end += this.diff;
- }
- if (end < oldEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- changeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- }
- }
- }
- else {
- throw new StructuredDocumentRegionManagementException();
- }
- }
- else {
- ownerNode.setStructuredDocumentRegion(oldStructuredDocumentRegion);
- }
- }
-
- /**
- */
- private void changeTextData(Text text) {
- if (text == null)
- return;
-
- String source = this.generator.generateSource(text);
- if (source == null)
- source = NodeImpl.EMPTY_STRING;
- int length = source.length();
-
- TextImpl impl = (TextImpl) text;
- int start = impl.getStartOffset();
- int end = impl.getEndOffset();
- int offset = start;
-
- // make sure previous tag is closed
- Node prev = text.getPreviousSibling();
- if (prev != null) {
- String preTag = getCloseTag((IDOMNode) prev);
- if (preTag != null && preTag.length() > 0) {
- offset += preTag.length();
- source = preTag + source;
- }
- }
- else {
- Node parent = text.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) parent;
- String preTag = getStartCloseTag(element);
- if (preTag != null && preTag.length() > 0) {
- offset += preTag.length();
- StringBuffer buffer = new StringBuffer();
- buffer.append(preTag);
- buffer.append(source);
- if (text.getNextSibling() == null && !element.hasEndTag() && (element.isJSPContainer() || element.isCDATAContainer())) {
- // need to generate the end tag
- String postTag = this.generator.generateEndTag(element);
- if (postTag != null) {
- int postLength = postTag.length();
- if (postLength > 0) {
- buffer.append(postTag);
- int postOffset = offset + length;
- IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(postOffset, postLength);
- element.setEndStructuredDocumentRegion(flatNode);
- }
- }
- }
- source = buffer.toString();
- }
- }
- }
-
- this.gapStructuredDocumentRegion = impl.getStructuredDocumentRegion();
- IStructuredDocumentRegion newStructuredDocumentRegion = null;
- if (length > 0)
- newStructuredDocumentRegion = new StructuredDocumentRegionProxy(offset, length);
- impl.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
- replaceSource(source, start, end);
- }
-
- /**
- * changeValue method
- *
- * @param node
- * org.w3c.dom.Node
- */
- void changeValue(Node node) {
- if (node == null)
- return;
- if (getStructuredDocument() == null)
- return;
-
- short nodeType = node.getNodeType();
- if (nodeType == Node.TEXT_NODE) {
- changeTextData((Text) node);
- return;
- }
- if (nodeType == Node.ATTRIBUTE_NODE) {
- changeAttrValue((Attr) node);
- return;
- }
- if (nodeType == Node.ELEMENT_NODE) {
- changeStartTag((Element) node);
- return;
- }
-
- String source = this.generator.generateSource(node);
- if (source == null)
- source = NodeImpl.EMPTY_STRING;
- int length = source.length();
-
- NodeImpl impl = (NodeImpl) node;
- int start = impl.getStartOffset();
- int end = impl.getEndOffset();
-
- this.gapStructuredDocumentRegion = impl.getStructuredDocumentRegion();
- IStructuredDocumentRegion flatNode = null;
- if (length > 0)
- flatNode = new StructuredDocumentRegionProxy(start, length);
- impl.setStructuredDocumentRegion(flatNode);
-
- replaceSource(source, start, end);
- }
-
- /**
- */
- private String getAttrValueClose(IDOMElement element) {
- if (element == null)
- return null;
-
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- ITextRegion region = StructuredDocumentRegionUtil.getLastRegion(flatNode);
- if (region == null || region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- return null;
- String value = flatNode.getText(region);
- if (value == null)
- return null;
- int length = value.length();
- if (length == 0)
- return null;
-
- // check open JSP tag
- boolean closeJSPTag = false;
- int offset = value.indexOf(JSPTag.TAG_OPEN);
- while (offset >= 0) {
- offset = value.indexOf(JSPTag.TAG_CLOSE, offset + 2);
- if (offset < 0) {
- closeJSPTag = true;
- break;
- }
- offset = value.indexOf(JSPTag.TAG_OPEN, offset + 2);
- }
-
- // check quote
- boolean closeQuote = false;
- char firstChar = value.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- if (closeJSPTag || length == 1 || value.charAt(length - 1) != firstChar) {
- closeQuote = true;
- }
- }
-
- if (!closeJSPTag && !closeQuote)
- return null;
-
- StringBuffer buffer = new StringBuffer();
- if (closeJSPTag)
- buffer.append(JSPTag.TAG_CLOSE);
- if (closeQuote)
- buffer.append(firstChar);
- return buffer.toString();
- }
-
- /**
- * Gather close tags recursively.
- */
- private String getCloseTag(IDOMNode node) {
- if (node == null || node.isClosed())
- return null;
-
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- return this.generator.generateCloseTag(node);
- }
-
- ElementImpl element = (ElementImpl) node;
- if (element.hasEndTag()) {
- // end tag is not closed
- return this.generator.generateCloseTag(element);
- }
-
- // no end tag
- int offset = element.getEndOffset();
- StringBuffer buffer = new StringBuffer();
-
- IDOMNode lastChild = (IDOMNode) element.getLastChild();
- if (lastChild == null) {
- if (!element.isStartTagClosed()) {
- if (element.preferEmptyTag())
- element.setEmptyTag(true);
- String closeTag = getStartCloseTag(element);
- if (closeTag != null) {
- int length = closeTag.length();
- if (length > 0) {
- buffer.append(closeTag);
- offset += length;
- }
- }
- }
- }
- else {
- String closeTag = getCloseTag(lastChild);
- if (closeTag != null) {
- int length = closeTag.length();
- if (length > 0) {
- buffer.append(closeTag);
- offset += length;
- }
- }
- }
-
- String endTag = this.generator.generateEndTag(element);
- if (endTag != null) {
- int length = endTag.length();
- if (length > 0) {
- buffer.append(endTag);
- IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(offset, length);
- element.setEndStructuredDocumentRegion(flatNode);
- }
- }
-
- return buffer.toString();
- }
-
- /**
- */
- private String getStartCloseTag(IDOMElement element) {
- if (element == null || element.isStartTagClosed())
- return null;
-
- StringBuffer buffer = new StringBuffer();
- String attrValueClose = getAttrValueClose(element);
- if (attrValueClose != null)
- buffer.append(attrValueClose);
- String closeTag = this.generator.generateCloseTag(element);
- if (closeTag != null)
- buffer.append(closeTag);
- return buffer.toString();
- }
-
- private IStructuredDocument getStructuredDocument() {
- if (model == null)
- return null;
- return model.getStructuredDocument();
- }
-
- /**
- */
- void initialize() {
- this.gapStructuredDocumentRegion = null;
- this.gapOffset = 0;
- this.gapLength = 0;
- this.diff = 0;
- this.parentNode = null;
- this.nextNode = null;
- }
-
- private void insertGapStructuredDocumentRegionAfter(int endOffset) {
- if (this.gapStructuredDocumentRegion == null)
- return;
-
- if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
- IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
- if (flatNode != null)
- insertStructuredDocumentRegion(flatNode);
- }
- else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue;
- if (content.getStart() < endOffset)
- continue;
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
- if (flatNode != null)
- insertStructuredDocumentRegion(flatNode);
- }
- else {
- insertStructuredDocumentRegion(content);
- }
- }
- }
- else {
- insertStructuredDocumentRegion(this.gapStructuredDocumentRegion);
- }
- }
-
- private void insertGapStructuredDocumentRegionBefore(int startOffset) {
- if (this.gapStructuredDocumentRegion == null)
- return;
-
- if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
- IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
- if (flatNode != null)
- insertStructuredDocumentRegion(flatNode);
- }
- else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue;
- if (content.getStart() >= startOffset)
- return;
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
- if (flatNode != null)
- insertStructuredDocumentRegion(flatNode);
- }
- else {
- insertStructuredDocumentRegion(content);
- }
- }
- }
- else {
- insertStructuredDocumentRegion(this.gapStructuredDocumentRegion);
- }
- }
-
- /**
- */
- private void insertStructuredDocumentRegion(IStructuredDocumentRegion newStructuredDocumentRegion) {
- if (newStructuredDocumentRegion == null)
- return; // error
- if (this.parentNode == null)
- return; // error
-
- int newOffset = newStructuredDocumentRegion.getStart();
- int newEnd = newStructuredDocumentRegion.getEnd();
- boolean isEndTag = false;
-
- // find owner node
- NodeImpl ownerNode = null;
- while (this.parentNode != null) {
- if (this.nextNode != null) {
- IStructuredDocumentRegion nextStructuredDocumentRegion = this.nextNode.getStructuredDocumentRegion();
- if (nextStructuredDocumentRegion != null) {
- int nextOffset = nextStructuredDocumentRegion.getStart();
- if (nextOffset == newOffset) { // found
- ownerNode = this.nextNode;
- break;
- }
- if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
- int nextEnd = nextStructuredDocumentRegion.getEnd();
- if (nextOffset < newEnd && nextEnd > newOffset) {
- ownerNode = this.nextNode;
- break;
- }
- }
- }
-
- Node child = this.nextNode.getFirstChild();
- if (child != null) {
- this.parentNode = this.nextNode;
- this.nextNode = (NodeImpl) child;
- continue;
- }
-
- if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
- this.parentNode = this.nextNode;
- this.nextNode = null;
- continue;
- }
-
- this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
- if (this.nextNode != null)
- continue;
- }
-
- if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) this.parentNode;
- IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null) {
- int endOffset = endStructuredDocumentRegion.getStart();
- if (endOffset == newOffset) { // found
- ownerNode = this.parentNode;
- isEndTag = true;
- break;
- }
- }
- }
-
- this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
- this.parentNode = (NodeImpl) this.parentNode.getParentNode();
- }
- if (ownerNode == null)
- throw new StructuredDocumentRegionManagementException();
-
- short nodeType = ownerNode.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) ownerNode;
- if (isEndTag) {
- element.setEndStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- else {
- element.setStartStructuredDocumentRegion(newStructuredDocumentRegion);
- updateAttrRegions(element, newStructuredDocumentRegion);
- }
- }
- else if (nodeType == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) ownerNode;
- IStructuredDocumentRegion oldStructuredDocumentRegion = text.getStructuredDocumentRegion();
- if (oldStructuredDocumentRegion == null) {
- throw new StructuredDocumentRegionManagementException();
- }
- int oldOffset = oldStructuredDocumentRegion.getStart();
- int oldEnd = oldStructuredDocumentRegion.getEnd();
- if (oldOffset == newOffset && oldEnd == newEnd) {
- text.setStructuredDocumentRegion(newStructuredDocumentRegion);
- return;
- }
-
- if (oldStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) oldStructuredDocumentRegion;
- if (oldEnd > newEnd) {
- StructuredDocumentRegionContainer container = new StructuredDocumentRegionContainer();
- if (oldOffset == newOffset) {
- container.appendStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- else {
- StructuredDocumentRegionProxy newProxy = new StructuredDocumentRegionProxy();
- newProxy.setOffset(oldOffset);
- newProxy.setLength(newEnd - oldOffset);
- newProxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
- container.appendStructuredDocumentRegion(newProxy);
- }
- proxy.setOffset(newEnd);
- proxy.setLength(oldEnd - newEnd);
- container.appendStructuredDocumentRegion(proxy);
- text.setStructuredDocumentRegion(container);
- }
- else {
- proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
-
- if (oldEnd < newEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- insertStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- }
- return;
- }
-
- if (oldStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) oldStructuredDocumentRegion;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue; // error
- int offset = content.getStart();
- int end = content.getEnd();
- if (end <= newOffset)
- continue;
- if (offset == newOffset && end == newEnd) {
- container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
- return;
- }
-
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (end > newEnd) {
- if (offset == newOffset) {
- container.insertStructuredDocumentRegion(newStructuredDocumentRegion, i);
- }
- else {
- StructuredDocumentRegionProxy newProxy = new StructuredDocumentRegionProxy();
- newProxy.setOffset(offset);
- newProxy.setLength(newEnd - offset);
- newProxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
- container.insertStructuredDocumentRegion(newProxy, i);
- }
- proxy.setOffset(newEnd);
- proxy.setLength(end - newEnd);
- return;
- }
- else {
- proxy.setStructuredDocumentRegion(newStructuredDocumentRegion);
- if (end == newEnd)
- return;
- }
- }
- }
-
- if (oldEnd < newEnd) { // to be shared
- this.nextNode = (NodeImpl) text.getNextSibling();
- insertStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- return;
- }
- else {
- throw new StructuredDocumentRegionManagementException();
- }
- }
- else {
- ownerNode.setStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- }
-
- private void removeGapStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (this.gapStructuredDocumentRegion == null)
- return;
-
- if (this.gapStructuredDocumentRegion == oldStructuredDocumentRegion) {
- this.gapStructuredDocumentRegion = null;
- return;
- }
-
- if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) this.gapStructuredDocumentRegion;
- IStructuredDocumentRegion flatNode = proxy.getStructuredDocumentRegion();
- if (flatNode == oldStructuredDocumentRegion)
- this.gapStructuredDocumentRegion = null;
- }
- else if (this.gapStructuredDocumentRegion instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) this.gapStructuredDocumentRegion;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue;
- if (content == oldStructuredDocumentRegion) {
- if (count > 1)
- container.removeStructuredDocumentRegion(i);
- else
- this.gapStructuredDocumentRegion = null;
- return;
- }
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- if (count > 1)
- container.removeStructuredDocumentRegion(i);
- else
- this.gapStructuredDocumentRegion = null;
- return;
- }
- }
- }
- }
- }
-
- private void removeStructuredDocumentRegion(IStructuredDocumentRegion oldStructuredDocumentRegion) {
- if (oldStructuredDocumentRegion == null)
- return; // error
- if (this.parentNode == null)
- return; // error
-
- int gapEnd = this.gapOffset + this.gapLength;
- int oldOffset = oldStructuredDocumentRegion.getStart();
- int oldEnd = oldStructuredDocumentRegion.getEnd();
- if (oldOffset >= this.gapOffset && oldEnd <= gapEnd)
- return; // do nothing
- int oldLength = oldEnd - oldOffset;
- if (oldOffset >= gapEnd)
- oldOffset += this.diff;
-
- // find owner node
- NodeImpl ownerNode = null;
- ElementImpl ownerEndTag = null;
- TextImpl ownerText = null;
- while (this.parentNode != null) {
- if (this.nextNode != null) {
- if (this.nextNode.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- ownerNode = this.nextNode;
- break;
- }
- if (this.nextNode.getNodeType() == Node.TEXT_NODE) {
- TextImpl text = (TextImpl) this.nextNode;
- if (text.hasStructuredDocumentRegion(oldStructuredDocumentRegion)) {
- ownerNode = this.nextNode;
- ownerText = text;
- break;
- }
- }
-
- Node child = this.nextNode.getFirstChild();
- if (child != null) {
- this.parentNode = this.nextNode;
- this.nextNode = (NodeImpl) child;
- continue;
- }
-
- if (this.nextNode.getNodeType() == Node.ELEMENT_NODE) {
- this.parentNode = this.nextNode;
- this.nextNode = null;
- continue;
- }
-
- this.nextNode = (NodeImpl) this.nextNode.getNextSibling();
- if (this.nextNode != null)
- continue;
- }
-
- if (this.parentNode.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) this.parentNode;
- if (element.getEndStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- ownerNode = this.parentNode;
- ownerEndTag = element;
- break;
- }
- }
-
- this.nextNode = (NodeImpl) this.parentNode.getNextSibling();
- this.parentNode = (NodeImpl) this.parentNode.getParentNode();
- }
- if (ownerNode == null)
- throw new StructuredDocumentRegionManagementException();
-
- if (ownerText != null) {
- IStructuredDocumentRegion flatNode = ownerText.getStructuredDocumentRegion();
- if (flatNode == oldStructuredDocumentRegion) {
- IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
- ownerText.setStructuredDocumentRegion(newStructuredDocumentRegion);
- return;
- }
-
- if (flatNode instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) flatNode;
- if (proxy.getStructuredDocumentRegion() != oldStructuredDocumentRegion) {
- throw new StructuredDocumentRegionManagementException();
- }
- int offset = proxy.getOffset();
- int end = offset + proxy.getLength();
- if (offset >= this.gapOffset) {
- proxy.setOffset(offset + this.diff);
- }
- proxy.setStructuredDocumentRegion(null);
- if (end < oldEnd && (end < this.gapOffset || oldEnd > gapEnd)) { // has
- // shared
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- }
- else if (flatNode instanceof StructuredDocumentRegionContainer) {
- StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
- int count = container.getStructuredDocumentRegionCount();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion content = container.getStructuredDocumentRegion(i);
- if (content == null)
- continue; // error
- if (content == oldStructuredDocumentRegion) {
- IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
- container.replaceStructuredDocumentRegion(newStructuredDocumentRegion, i);
- return;
- }
-
- if (content instanceof StructuredDocumentRegionProxy) {
- StructuredDocumentRegionProxy proxy = (StructuredDocumentRegionProxy) content;
- if (proxy.getStructuredDocumentRegion() == oldStructuredDocumentRegion) {
- int offset = proxy.getOffset();
- int end = offset + proxy.getLength();
- if (offset >= this.gapOffset) {
- proxy.setOffset(offset + this.diff);
- }
- proxy.setStructuredDocumentRegion(null);
- if (end < oldEnd && (end < this.gapOffset || oldEnd > gapEnd)) { // has
- // shared
- removeStructuredDocumentRegion(oldStructuredDocumentRegion);
- return;
- }
- }
- }
- }
- }
- else {
- throw new StructuredDocumentRegionManagementException();
- }
- }
- else {
- IStructuredDocumentRegion newStructuredDocumentRegion = new StructuredDocumentRegionProxy(oldOffset, oldLength);
- if (ownerEndTag != null) {
- ownerEndTag.setEndStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- else {
- ownerNode.setStructuredDocumentRegion(newStructuredDocumentRegion);
- }
- }
- }
-
- /**
- * replaceAttr method
- *
- * @param ownerElement
- * org.w3c.dom.Element
- * @param newAttr
- * org.w3c.dom.Attr
- * @param oldAttr
- * org.w3c.dom.Attr
- */
- void replaceAttr(Element ownerElement, Attr newAttr, Attr oldAttr) {
- if (ownerElement == null)
- return;
- if (getStructuredDocument() == null)
- return;
-
- ElementImpl element = (ElementImpl) ownerElement;
- if (!element.hasStartTag()) {
- changeStartTag(element);
- return;
- }
- if (element.isCommentTag()) {
- changeStartTag(element);
- return;
- }
-
- int offset = element.getStartOffset();
- int start = offset;
- int end = offset;
-
- boolean insertSpace = false;
- String attrValueClose = null;
- if (oldAttr != null) {
- AttrImpl impl = (AttrImpl) oldAttr;
- ITextRegion nameRegion = impl.getNameRegion();
- if (nameRegion == null)
- return; // must never happen
- ITextRegion lastRegion = impl.getValueRegion();
- if (lastRegion != null) {
- end += lastRegion.getEnd();
- }
- else {
- lastRegion = impl.getEqualRegion();
- if (lastRegion != null) {
- end += lastRegion.getEnd();
- }
- else {
- end += nameRegion.getEnd();
- lastRegion = nameRegion;
- }
- }
- // check there are extra space before the last attribute
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return; // must never happen
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return; // must never happen
- ITextRegion prevRegion = null;
- ITextRegion nextRegion = null;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region == nameRegion) {
- if (i > 0) {
- prevRegion = regions.get(i - 1);
- }
- }
- if (region == lastRegion) {
- if (i + 1 < regions.size()) {
- nextRegion = regions.get(i + 1);
- }
- break;
- }
- }
- boolean isLastAttr = false;
- if (nextRegion != null) {
- String regionType = nextRegion.getType();
- if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || isNestedTagClose(regionType)) {
- isLastAttr = true;
- }
- }
- if (isLastAttr && prevRegion != null) {
- start += prevRegion.getTextEnd();
- }
- else {
- start += nameRegion.getStart();
- }
-
- // impl.resetRegions(ownerElement);
- impl.resetRegions(element);
- }
- else { // append attribute
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return; // must never happen
-
- attrValueClose = getAttrValueClose(element);
- if (attrValueClose != null && attrValueClose.length() > 0) {
- insertSpace = true;
- start = flatNode.getEndOffset();
- end = start;
- }
- else {
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return; // must never happen
- int attrStart = 0;
- for (int i = regions.size() - 1; i >= 0; i--) {
- ITextRegion region = regions.get(i);
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE || isNestedTagClose(regionType))
- continue;
- int regionEnd = region.getEnd();
- if (regionEnd == region.getTextEnd())
- insertSpace = true;
- attrStart = regionEnd;
- break;
- }
- if (attrStart == 0)
- return; // not found, must never happen
- start += attrStart;
- end = start;
- }
- }
-
- String source = null;
- if (newAttr != null) {
- int size = 2;
- if (attrValueClose != null)
- size += attrValueClose.length();
- String name = this.generator.generateAttrName(newAttr);
- if (name != null)
- size += name.length();
- String value = this.generator.generateAttrValue(newAttr);
- if (value != null)
- size += value.length();
- StringBuffer buffer = new StringBuffer(size);
- if (attrValueClose != null)
- buffer.append(attrValueClose);
- if (insertSpace)
- buffer.append(' ');
- buffer.append(name);
- if (value != null) {
- buffer.append('=');
- buffer.append(value);
- }
- source = buffer.toString();
- }
-
- replaceSource(source, start, end);
- }
-
- protected boolean isNestedTagClose(String regionType) {
- boolean result = false;
- return result;
- }
-
- /**
- * replaceChild method
- *
- * @param parentNode
- * org.w3c.dom.Node
- * @param newChild
- * org.w3c.dom.Node
- * @param oldChild
- * org.w3c.dom.Node
- */
- void replaceChild(Node parentNode, Node newChild, Node oldChild) {
- if (parentNode == null)
- return;
- if (newChild == null && oldChild == null)
- return;
- if (getStructuredDocument() == null)
- return;
-
- int start = 0;
- int end = 0;
- String preTag = null;
- String postTag = null;
- ElementImpl postElement = null;
- if (oldChild != null) {
- NodeImpl node = (NodeImpl) oldChild;
- start = node.getStartOffset();
- end = node.getEndOffset();
- if (oldChild.getNodeType() == Node.TEXT_NODE) {
- this.gapStructuredDocumentRegion = node.getStructuredDocumentRegion();
- }
- node.resetStructuredDocumentRegions(); // reset values from
- // IStructuredDocumentRegion
- }
- else {
- NodeImpl prev = (NodeImpl) newChild.getPreviousSibling();
- if (prev != null) {
- start = prev.getEndOffset();
- end = start;
- preTag = getCloseTag(prev);
- }
- else {
- // first child
- NodeImpl next = (NodeImpl) newChild.getNextSibling();
- if (next != null) {
- start = next.getStartOffset();
- end = start;
- if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
- preTag = getStartCloseTag((IDOMElement) parentNode);
- }
- }
- else {
- // newly having a child
- if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) parentNode;
- if (element.isEmptyTag()) { // empty tag format
- // need to generate the start and the end tags
- end = element.getEndOffset();
- start = end - 2; // for "/>"
- element.setEmptyTag(false);
- preTag = this.generator.generateCloseTag(element);
- postTag = this.generator.generateEndTag(element);
- postElement = element;
- }
- else if (!element.hasStartTag()) {
- start = element.getStartOffset();
- end = start;
- // invalid end tag or implicit tag
- // need to generate the start tag
- preTag = this.generator.generateStartTag(element);
- if (preTag != null) {
- int length = preTag.length();
- if (length > 0) {
- IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(start, length);
- element.setStartStructuredDocumentRegion(flatNode);
- }
- }
- if (!element.hasEndTag()) {
- // implicit tag
- // need to generate the end tags
- postTag = this.generator.generateEndTag(element);
- postElement = element;
- }
- }
- else {
- start = element.getStartEndOffset();
- end = start;
- preTag = getStartCloseTag(element);
- if (preTag != null && preTag.length() > 0) {
- if (!element.hasEndTag() && (element.isJSPContainer() || element.isCDATAContainer())) {
- // need to generate the end tag
- postTag = this.generator.generateEndTag(element);
- postElement = element;
- }
- }
- }
- }
- // else might DOCUMENT_NODE, start and end are 0
- }
- }
- }
-
- String source = null;
- if (newChild != null) {
- StringBuffer buffer = new StringBuffer();
- int offset = start;
- if (preTag != null) {
- int length = preTag.length();
- if (length > 0) {
- offset += length;
- buffer.append(preTag);
- }
- }
-
- NodeImpl node = (NodeImpl) newChild;
- while (node != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) node;
- if (element.preferEmptyTag())
- element.setEmptyTag(true);
- IStructuredDocumentRegion flatNode = null;
- String startTag = this.generator.generateStartTag(element);
- if (startTag != null) {
- int length = startTag.length();
- if (length > 0) {
- buffer.append(startTag);
- flatNode = new StructuredDocumentRegionProxy(offset, length);
- offset += length;
- }
- }
- element.setStartStructuredDocumentRegion(flatNode);
- }
- else {
- String content = this.generator.generateSource(node);
- if (content == null)
- content = NodeImpl.EMPTY_STRING;
- int length = content.length();
- IStructuredDocumentRegion flatNode = null;
- if (length > 0) {
- buffer.append(content);
- flatNode = new StructuredDocumentRegionProxy(offset, length);
- offset += length;
- }
- node.setStructuredDocumentRegion(flatNode);
- }
-
- NodeImpl child = (NodeImpl) node.getFirstChild();
- if (child != null) {
- node = child;
- continue;
- }
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ElementImpl element = (ElementImpl) node;
- IStructuredDocumentRegion flatNode = null;
- String endTag = this.generator.generateEndTag(element);
- if (endTag != null) {
- int length = endTag.length();
- if (length > 0) {
- buffer.append(endTag);
- flatNode = new StructuredDocumentRegionProxy(offset, length);
- offset += length;
- }
- }
- element.setEndStructuredDocumentRegion(flatNode);
- }
-
- while (node != null) {
- if (node == newChild) {
- node = null;
- break;
- }
- NodeImpl next = (NodeImpl) node.getNextSibling();
- if (next != null) {
- node = next;
- break;
- }
-
- node = (NodeImpl) node.getParentNode();
- if (node.getNodeType() != Node.ELEMENT_NODE)
- continue;
- ElementImpl element = (ElementImpl) node;
- IStructuredDocumentRegion flatNode = null;
- String endTag = this.generator.generateEndTag(element);
- if (endTag != null) {
- int length = endTag.length();
- if (length > 0) {
- buffer.append(endTag);
- flatNode = new StructuredDocumentRegionProxy(offset, length);
- offset += length;
- }
- }
- element.setEndStructuredDocumentRegion(flatNode);
- }
- }
-
- if (postTag != null) {
- int length = postTag.length();
- if (length > 0) {
- buffer.append(postTag);
- if (postElement != null) {
- IStructuredDocumentRegion flatNode = new StructuredDocumentRegionProxy(offset, length);
- postElement.setEndStructuredDocumentRegion(flatNode);
- }
- }
- }
- source = buffer.toString();
- }
-
- if (start == end && (source == null || source.length() == 0)) {
- // no thing changed
- return;
- }
-
- replaceSource(source, start, end);
- }
-
- void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- // future_TODO: optimize
-
- NodeImpl root = (NodeImpl) this.model.getDocument();
- this.parentNode = root;
- this.nextNode = (NodeImpl) root.getFirstChild();
-
- removeGapStructuredDocumentRegion(flatNode);
- insertGapStructuredDocumentRegionBefore(flatNode.getStart());
- changeStructuredDocumentRegion(flatNode);
- insertGapStructuredDocumentRegionAfter(flatNode.getEnd());
- }
-
- /**
- * Wraps IStructuredDocumentRegion.replaceText() and sets contextual
- * information.
- */
- private void replaceSource(String source, int start, int end) {
- int inserted = 0;
- if (source == null)
- source = NodeImpl.EMPTY_STRING;
- else
- inserted = source.length();
- int removed = end - start;
- if (inserted == 0 && removed == 0)
- return;
-
- this.gapOffset = start;
- this.gapLength = removed;
- this.diff = inserted - removed;
- // Note: due to bug
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3619
- // for now assume "ignore readonly" region is ok -- assume DOM itself
- // checks if
- // ok to insert or not. In reality, we may have to make or "contains"
- // method more
- // better. Or, we may have to "perculate up" the parameter for clients
- // to tell us programatically
- // that its ok to insert/format in a read-only region.
- getStructuredDocument().replaceText(this.model, this.gapOffset, this.gapLength, source, true);
- }
-
- void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- NodeImpl root = (NodeImpl) this.model.getDocument();
-
- if (oldStructuredDocumentRegions != null) {
- this.parentNode = root;
- this.nextNode = (NodeImpl) root.getFirstChild();
-
- Enumeration e = oldStructuredDocumentRegions.elements();
- while (e.hasMoreElements()) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null)
- continue;
- removeStructuredDocumentRegion(flatNode);
- removeGapStructuredDocumentRegion(flatNode);
- }
- }
-
- if (newStructuredDocumentRegions != null) {
- this.parentNode = root;
- this.nextNode = (NodeImpl) root.getFirstChild();
-
- IStructuredDocumentRegion lastStructuredDocumentRegion = null;
- Enumeration e = newStructuredDocumentRegions.elements();
- while (e.hasMoreElements()) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null)
- continue;
- if (lastStructuredDocumentRegion == null)
- insertGapStructuredDocumentRegionBefore(flatNode.getStart());
- insertStructuredDocumentRegion(flatNode);
- lastStructuredDocumentRegion = flatNode;
- }
- if (lastStructuredDocumentRegion != null) {
- insertGapStructuredDocumentRegionAfter(lastStructuredDocumentRegion.getEnd());
- }
- else {
- insertGapStructuredDocumentRegionBefore(this.gapOffset);
- // make sure to restore all backuped StructuredDocumentRegions
- insertGapStructuredDocumentRegionAfter(this.gapOffset);
- }
- }
- else {
- this.parentNode = root;
- this.nextNode = (NodeImpl) root.getFirstChild();
-
- insertGapStructuredDocumentRegionBefore(this.gapOffset);
- // make sure to restore all backuped StructuredDocumentRegions
- insertGapStructuredDocumentRegionAfter(this.gapOffset);
- }
- }
-
- /**
- */
- private void updateAttrRegions(Element element, IStructuredDocumentRegion flatNode) {
-
- // update attributes
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return;
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null)
- return;
- int index = -1;
- AttrImpl attr = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- attr = (AttrImpl) attributes.item(++index);
- if (attr != null) {
- attr.setNameRegion(region);
- // reset other regions
- attr.setEqualRegion(null);
- attr.setValueRegion(null);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (attr != null)
- attr.setEqualRegion(region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (attr != null) {
- attr.setValueRegion(region);
- attr = null;
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java
deleted file mode 100644
index 697f649ebe..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java
+++ /dev/null
@@ -1,37 +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.xml.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLResourceEncodingDetector;
-
-
-/**
- * This class reads and parses first of XML file to get encoding.
- *
- */
-public class XMLDocumentCharsetDetector extends XMLResourceEncodingDetector implements IDocumentCharsetDetector {
-
- /**
- * XMLLoader constructor comment.
- */
- public XMLDocumentCharsetDetector() {
- super();
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java
deleted file mode 100644
index 2316b34c44..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java
+++ /dev/null
@@ -1,82 +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.xml.core.internal.encoding;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-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;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-
-
-/**
- * This class reads an XML file and creates an XML Structured Model.
- *
- */
-public class XMLDocumentLoader extends AbstractDocumentLoader {
-
- public XMLDocumentLoader() {
- super();
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForXML();
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new XMLDocumentCharsetDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- public RegionParser getParser() {
- return new XMLSourceParser();
- }
-
- protected String getPreferredNewLineDelimiter(IFile file) {
- String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForXML.ContentTypeID_XML);
- if (delimiter == null)
- delimiter = super.getPreferredNewLineDelimiter(file);
- return delimiter;
- }
-
- protected String getSpecDefaultEncoding() {
- // by default, UTF-8 as per XML spec
- final String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- if (structuredDocument instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser());
- }
- return structuredDocument;
- }
-
- public IDocumentLoader newInstance() {
- return new XMLDocumentLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
deleted file mode 100644
index 9537d42fc7..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
+++ /dev/null
@@ -1,1713 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver (STAR) - bug 297006 - String Comparison
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.formatter;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-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.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class DefaultXMLPartitionFormatter {
- /**
- * Just a small container class that holds a DOMNode & documentRegion that
- * should represent each other.
- */
- protected class DOMRegion {
- public IDOMNode domNode;
- public IStructuredDocumentRegion documentRegion;
- }
-
- static private final String PRESERVE = "preserve";//$NON-NLS-1$
- static private final String COLLAPSE = "collapse";//$NON-NLS-1$
- static private final String REPLACE = "replace";//$NON-NLS-1$
- static private final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
- static private final String XML_SPACE = "xml:space";//$NON-NLS-1$
- static private final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; //$NON-NLS-1$
- static private final String XSL_ATTRIBUTE = "attribute"; //$NON-NLS-1$
- static private final String XSL_TEXT = "text"; //$NON-NLS-1$
- static private final String SPACE = " "; //$NON-NLS-1$
- static private final String EMPTY = ""; //$NON-NLS-1$
- static private final String PROPERTY_WHITESPACE_FACET = "org.eclipse.wst.xsd.cm.properties/whitespace"; //$NON-NLS-1$
-
- private XMLFormattingPreferences fPreferences = null;
- private IProgressMonitor fProgressMonitor;
-
- private int replaceSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
- StringBuffer buff = new StringBuffer(whitespaceRun);
- for(int i = 0; i < buff.length(); i++) {
- buff.setCharAt(i, ' '); //$NON-NLS-1$
- }
- String replacementString = buff.toString();
- if (!replacementString.equals(whitespaceRun)) {
- ReplaceEdit replaceEdit = new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), replacementString);
- textEdit.addChild(replaceEdit);
- }
- return availableLineWidth;
- }
-
- private int collapseSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
- // prefer to use use existing whitespace
- int existingWhitespaceOffset = whitespaceRun.indexOf(' ');
- if (existingWhitespaceOffset > -1) {
- // delete whitespaces before and after existing whitespace
- if (existingWhitespaceOffset > 0) {
- DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset, existingWhitespaceOffset);
- textEdit.addChild(deleteEdit);
- }
- if (existingWhitespaceOffset < whitespaceRun.length() - 1) {
- int nextOffset = existingWhitespaceOffset + 1;
- DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset + nextOffset, whitespaceRun.length() - nextOffset);
- textEdit.addChild(deleteEdit);
- }
- }
- else {
- // delete all whitespace and insert new one
- // collapse whitespace by deleting whitespace
- DeleteEdit deleteEdit = new DeleteEdit(spaceStartOffset, whitespaceRun.length());
- textEdit.addChild(deleteEdit);
- // then insert one space
- InsertEdit insertEdit = new InsertEdit(spaceStartOffset, SPACE);
- textEdit.addChild(insertEdit);
- }
- // remember to account for space added
- --availableLineWidth;
- return availableLineWidth;
- }
-
- private int collapseAndIndent(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, int indentLevel, String whitespaceRun, IStructuredDocumentRegion currentRegion) {
- // Need to keep blank lines, but still collapse the whitespace
- String lineDelimiters = null;
- if (!getFormattingPreferences().getClearAllBlankLines()) {
- lineDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
- String formattedLine = lineDelimiters + getIndentString(indentLevel);
- if(lineDelimiters.length() > 0 && !formattedLine.equals(whitespaceRun)) {
- textEdit.addChild(new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), formattedLine));
- availableLineWidth = getFormattingPreferences().getMaxLineWidth() - indentLevel;
- }
- }
- if (lineDelimiters == null || lineDelimiters.length() == 0) {
- availableLineWidth = collapseSpaces(textEdit, spaceStartOffset, availableLineWidth, whitespaceRun);
- }
- return availableLineWidth;
- }
-
- private void deleteTrailingSpaces(TextEdit textEdit, ITextRegion currentTextRegion, IStructuredDocumentRegion currentDocumentRegion) {
- int textEnd = currentTextRegion.getTextEnd();
- int textEndOffset = currentDocumentRegion.getStartOffset() + textEnd;
- int difference = currentTextRegion.getEnd() - textEnd;
- DeleteEdit deleteEdit = new DeleteEdit(textEndOffset, difference);
- textEdit.addChild(deleteEdit);
- }
-
- public TextEdit format(IDocument document, int start, int length) {
- return format(document, start, length, new XMLFormattingPreferences());
- }
-
- public TextEdit format(IDocument document, int start, int length, XMLFormattingPreferences preferences) {
- TextEdit edit = null;
- if (document instanceof IStructuredDocument) {
- IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
- if (model != null) {
- try {
- edit = format(model, start, length, preferences);
- }
- finally {
- model.releaseFromEdit();
- }
- }
- }
- return edit;
- }
-
- public TextEdit format(IStructuredModel model, int start, int length) {
- return format(model, start, length, new XMLFormattingPreferences());
- }
-
- public TextEdit format(IStructuredModel model, int start, int length, XMLFormattingPreferences preferences) {
- setFormattingPreferences(preferences);
-
- TextEdit edit = new MultiTextEdit();
- IStructuredDocument document = model.getStructuredDocument();
- // get initial document region
- IStructuredDocumentRegion currentRegion = document.getRegionAtCharacterOffset(start);
- if (currentRegion != null) {
- int startOffset = currentRegion.getStartOffset();
-
- // get initial dom node
- IndexedRegion currentIndexedRegion = model.getIndexedRegion(startOffset);
- if (currentIndexedRegion instanceof IDOMNode) {
- // set up domRegion which will contain current region to be
- // formatted
- IDOMNode currentDOMNode = (IDOMNode) currentIndexedRegion;
- DOMRegion domRegion = new DOMRegion();
- domRegion.documentRegion = currentRegion;
- domRegion.domNode = currentDOMNode;
-
- XMLFormattingConstraints parentConstraints = getRegionConstraints(currentDOMNode);
-
- /* if the whitespace strategy is declared as default, get it from the preferences */
- if(XMLFormattingConstraints.DEFAULT.equals(parentConstraints.getWhitespaceStrategy()))
- parentConstraints.setWhitespaceStrategy(preferences.getElementWhitespaceStrategy());
-
- // TODO: initialize indentLevel
- // initialize available line width
- int lineWidth = getFormattingPreferences().getMaxLineWidth();
- try {
- IRegion lineInfo = document.getLineInformationOfOffset(startOffset);
- lineWidth = lineWidth - (startOffset - lineInfo.getOffset());
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- parentConstraints.setAvailableLineWidth(lineWidth);
-
- // format all siblings (and their children) as long they
- // overlap with start/length
- Position formatRange = new Position(start, length);
- formatSiblings(edit, domRegion, parentConstraints, formatRange);
- }
- }
- return edit;
- }
-
- /**
- * Determines the formatting constraints for a specified node based on
- * its ancestors' formatting. In particular, if any ancestor node either
- * explicitly defines whitespace preservation or ignorance, that
- * whitespace strategy should be used for <code>currentNode</code> and
- * all of its descendants.
- *
- * @param currentNode the node to investigate the ancestry of to determine
- * formatting constraints
- *
- * @return formatting constraints defined by an ancestor
- */
- private XMLFormattingConstraints getRegionConstraints(IDOMNode currentNode) {
- IDOMNode iterator = currentNode;
- XMLFormattingConstraints result = new XMLFormattingConstraints();
- DOMRegion region = new DOMRegion();
- XMLFormattingConstraints parentConstraints = new XMLFormattingConstraints();
- boolean parent = true;
-
- /* Iterate through the ancestry to find if any explicit whitespace strategy has
- * been defined
- */
- while(iterator != null && iterator.getNodeType() != Node.DOCUMENT_NODE) {
- iterator = (IDOMNode) iterator.getParentNode();
- region.domNode = iterator;
- region.documentRegion = iterator.getFirstStructuredDocumentRegion();
-
- updateFormattingConstraints(null, null, result, region);
-
- /* If this is the parent of the current node, keep the constraints
- * in case no other constraints are identified
- */
- if(parent) {
- parentConstraints.copyConstraints(result);
- parent = false;
- }
-
- /* A parent who has defined a specific whitespace strategy was found */
- if(XMLFormattingConstraints.PRESERVE.equals(result.getWhitespaceStrategy()) || XMLFormattingConstraints.DEFAULT.equals(result.getWhitespaceStrategy()))
- return result;
- }
-
- return parentConstraints;
- }
-// private XMLFormattingConstraints getRegionConstraints(IDOMNode currentNode) {
-// IDOMNode iterator = (IDOMNode) currentNode.getParentNode();
-// XMLFormattingConstraints result = new XMLFormattingConstraints();
-// DOMRegion region = new DOMRegion();
-//
-// /* Iterate through the ancestry to find if any explicit whitespace strategy has
-// * been defined
-// */
-// while(iterator != null && iterator.getNodeType() != Node.DOCUMENT_NODE) {
-
-// region.domNode = iterator;
-// region.documentRegion = iterator.getFirstStructuredDocumentRegion();
-//
-// updateFormattingConstraints(null, null, result, region);
-//
-// /* A parent who has defined a specific whitespace strategy was found */
-// if(XMLFormattingConstraints.PRESERVE == result.getWhitespaceStrategy() || XMLFormattingConstraints.DEFAULT == result.getWhitespaceStrategy())
-// return result;
-//
-// iterator = (IDOMNode) iterator.getParentNode();
-// }
-//
-// return null;
-// }
-
- /**
- * Formats the given xml content region
- *
- * @param textEdit
- * @param formatRange
- * @param parentConstraints
- * @param currentDOMRegion
- * @param previousRegion
- */
- private void formatContent(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
- IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
- String fullText = currentDOMRegion.domNode.getSource();
-
- // check if in preserve space mode, if so, don't touch anything but
- // make sure to update available line width
- String whitespaceMode = parentConstraints.getWhitespaceStrategy();
- if (XMLFormattingConstraints.PRESERVE.equals(whitespaceMode)) {
- int availableLineWidth = parentConstraints.getAvailableLineWidth();
- availableLineWidth = updateLineWidthWithLastLine(fullText, availableLineWidth);
-
- // update available line width in constraints
- parentConstraints.setAvailableLineWidth(availableLineWidth);
- // A text node can contain multiple structured document regions - sync the documentRegion
- // with the last region of the node since the text from all regions was formatted
- currentDOMRegion.documentRegion = currentDOMRegion.domNode.getLastStructuredDocumentRegion();
- return;
- }
-
- // if content is just whitespace and there's something after it
- // just skip over this region because region will take care of it
- boolean isAllWhitespace = ((IDOMText) currentDOMRegion.domNode).isElementContentWhitespace();
- IStructuredDocumentRegion nextDocumentRegion = null;
- if (isAllWhitespace) {
- parentConstraints.setAvailableLineWidth(fPreferences.getMaxLineWidth());
- nextDocumentRegion = currentRegion.getNext();
- if (nextDocumentRegion != null)
- return;
- }
-
- // special handling if text follows an entity or cdata region
- if (!XMLFormattingConstraints.COLLAPSE.equals(whitespaceMode) && previousRegion != null) {
- String previouRegionType = previousRegion.getType();
- if (DOMRegionContext.XML_ENTITY_REFERENCE.equals(previouRegionType) || DOMRegionContext.XML_CDATA_TEXT.equals(previouRegionType))
- whitespaceMode = XMLFormattingConstraints.COLLAPSE;
- }
- // also, special handling if text is before an entity or cdata region
- if (!XMLFormattingConstraints.COLLAPSE.equals(whitespaceMode)) {
- // get next document region if dont already have it
- if (nextDocumentRegion == null)
- nextDocumentRegion = currentRegion.getNext();
- if (nextDocumentRegion != null) {
- String nextRegionType = nextDocumentRegion.getType();
- if (DOMRegionContext.XML_ENTITY_REFERENCE.equals(nextRegionType) || DOMRegionContext.XML_CDATA_TEXT.equals(nextRegionType))
- whitespaceMode = XMLFormattingConstraints.COLLAPSE;
- }
- }
- final IStructuredDocumentRegion lastRegion = currentDOMRegion.domNode.getLastStructuredDocumentRegion();
- formatTextInContent(textEdit, parentConstraints, currentRegion, lastRegion != null ? lastRegion.getNext(): null, fullText, whitespaceMode);
- // A text node can contain multiple structured document regions - sync the documentRegion
- // with the last region of the node since the text from all regions was formatted
- currentDOMRegion.documentRegion = lastRegion;
- }
-
- private void formatEmptyStartTagWithNoAttr(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, int availableLineWidth, String indentStrategy, String whitespaceStrategy, ITextRegion currentTextRegion) {
- // get preference if there should be a space or not between tag
- // name and empty tag close
- // <tagName />
- boolean oneSpaceInTagName = getFormattingPreferences().getSpaceBeforeEmptyCloseTag();
-
- // calculate available line width
- int tagNameLineWidth = currentTextRegion.getTextLength() + 3;
- if (oneSpaceInTagName) {
- // add one more to account for space before empty tag close
- ++tagNameLineWidth;
- }
- availableLineWidth -= tagNameLineWidth;
-
- if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
- // if was inlining, need to check if out of available line
- // width
- if (availableLineWidth < 0) {
- // need to indent if possible
- int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
- // update available line width
- if (lineWidth > 0)
- availableLineWidth = lineWidth - tagNameLineWidth;
- else
- availableLineWidth -= tagNameLineWidth;
- }
- else {
- // no need to indent
- // just make sure to delete previous whitespace if
- // needed
- if ((DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) && (previousDocumentRegion.getFullText().trim().length() == 0)) {
- availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegion.getFullText());
- }
- }
- }
-
- // delete any trail spaces after tag name
- int textLength = currentTextRegion.getTextLength();
- int regionLength = currentTextRegion.getLength();
-
- boolean thereAreSpaces = textLength < regionLength;
- if (!oneSpaceInTagName && thereAreSpaces) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- }
- else if(oneSpaceInTagName) {
- insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
- }
- constraints.setAvailableLineWidth(availableLineWidth);
- }
-
- /**
- * Formats an end tag
- *
- * @param textEdit
- * @param currentRegion
- * @param textRegions
- */
- private void formatEndTag(TextEdit textEdit, Position formatRange, XMLFormattingConstraints constraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousDocumentRegion) {
- IStructuredDocumentRegion currentDocumentRegion = currentDOMRegion.documentRegion;
-
- String whitespaceStrategy = constraints.getWhitespaceStrategy();
- String indentStrategy = constraints.getIndentStrategy();
-
- // do not format space before start tag if preserving spaces
- if (whitespaceStrategy != XMLFormattingConstraints.PRESERVE) {
- // format like indent strategy says
- if (XMLFormattingConstraints.INDENT.equals(indentStrategy) || XMLFormattingConstraints.NEW_LINE.equals(indentStrategy)) {
- int availableLineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
- constraints.setAvailableLineWidth(availableLineWidth);
- }
- else if ( XMLFormattingConstraints.INLINE.equals(indentStrategy)){
- IStructuredDocument doc = currentDocumentRegion.getParentDocument();
- int currentLine = doc.getLineOfOffset(currentDocumentRegion.getStartOffset());
- int prevLine = doc.getLineOfOffset(previousDocumentRegion.getStartOffset());
- if ( currentLine != prevLine){
- int availableLineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
- constraints.setAvailableLineWidth(availableLineWidth);
- }
- }
- }
- // format the end tag itself
- formatWithinEndTag(textEdit, constraints, currentDocumentRegion, previousDocumentRegion);
- }
-
- /**
- * Formats the given region (and all its children) contained in domRegion.
- *
- * @param edit
- * edits required to format
- * @param formatRange
- * document range to format (only format content within this
- * range)
- * @param parentConstraints
- * @param domRegion
- * assumes dom node & region are not null
- * @param previousRegion
- * could be null
- * @return Returns the last region formatted
- */
- private DOMRegion formatRegion(TextEdit edit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion domRegion, IStructuredDocumentRegion previousRegion) {
- IStructuredDocumentRegion currentRegion = domRegion.documentRegion;
- String regionType = currentRegion.getType();
- if (DOMRegionContext.XML_TAG_NAME.equals(regionType)) {
- ITextRegion textRegion = currentRegion.getFirstRegion();
- String textRegionType = textRegion.getType();
- if (DOMRegionContext.XML_TAG_OPEN.equals(textRegionType)) {
- domRegion = formatStartTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
- }
- else if (DOMRegionContext.XML_END_TAG_OPEN.equals(textRegionType)) {
- formatEndTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
- }
- }
- else if (DOMRegionContext.XML_CONTENT.equals(regionType) || domRegion.domNode.getNodeType() == Node.TEXT_NODE) {
- formatContent(edit, formatRange, parentConstraints, domRegion, previousRegion);
- }
- else if (DOMRegionContext.XML_COMMENT_TEXT.equals(regionType)) {
- formatComment(edit, formatRange, parentConstraints, domRegion, previousRegion);
- }
- else {
- // unknown, so just leave alone for now but make sure to update
- // available line width
- String fullText = currentRegion.getFullText();
- int width = updateLineWidthWithLastLine(fullText, parentConstraints.getAvailableLineWidth());
- parentConstraints.setAvailableLineWidth(width);
- }
- return domRegion;
- }
-
- /**
- * Formats the domRegion and all of its children and siblings
- *
- * @param edit
- * @param domRegion
- * @param parentConstraints
- * @param formatRange
- */
- private void formatSiblings(TextEdit edit, DOMRegion domRegion, XMLFormattingConstraints parentConstraints, Position formatRange) {
- IStructuredDocumentRegion previousRegion = null;
- IStructuredDocumentRegion currentRegion = domRegion.documentRegion;
- IDOMNode currentDOMNode = domRegion.domNode;
- while (currentDOMNode != null && currentRegion != null && formatRange.overlapsWith(currentRegion.getStartOffset(), currentRegion.getLength()) && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
- domRegion.documentRegion = currentRegion;
- domRegion.domNode = currentDOMNode;
-
- // need to make sure current document region and current
- // dom node match up
- if (currentDOMNode.getFirstStructuredDocumentRegion().equals(currentRegion)) {
- // format this document region/node, formatRegion will
- // return the last node/region formatted
- domRegion = formatRegion(edit, formatRange, parentConstraints, domRegion, previousRegion);
- }
- else {
- // TODO: need to figure out what to do if they don't
- // match up
- }
- previousRegion = domRegion.documentRegion;
- // get the next sibling information
- if (domRegion.domNode != null)
- currentDOMNode = (IDOMNode) domRegion.domNode.getNextSibling();
- else
- currentDOMNode = null;
- currentRegion = previousRegion.getNext();
- }
- }
-
- /**
- * Formats a start tag
- *
- * @param textEdit
- * @param currentRegion
- * @param textRegions
- */
- private DOMRegion formatStartTag(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousDocumentRegion) {
- // determine proper indent by referring to parent constraints,
- // previous node, and current node
- IStructuredDocumentRegion currentDocumentRegion = currentDOMRegion.documentRegion;
- IDOMNode currentDOMNode = currentDOMRegion.domNode;
-
- // create a constraint for this tag
- XMLFormattingConstraints thisConstraints = new XMLFormattingConstraints();
- XMLFormattingConstraints childrenConstraints = new XMLFormattingConstraints();
- updateFormattingConstraints(parentConstraints, thisConstraints, childrenConstraints, currentDOMRegion);
-
- if(XMLFormattingConstraints.DEFAULT.equals(childrenConstraints.getWhitespaceStrategy()))
- childrenConstraints.setWhitespaceStrategy((new XMLFormattingPreferences()).getElementWhitespaceStrategy());
-
- String whitespaceStrategy = thisConstraints.getWhitespaceStrategy();
- String indentStrategy = thisConstraints.getIndentStrategy();
- int availableLineWidth = thisConstraints.getAvailableLineWidth();
-
- // format space before start tag
- // do not format space before start tag if preserving spaces
- if (!XMLFormattingConstraints.PRESERVE.equals(whitespaceStrategy)) {
- // format like indent strategy says
- if (XMLFormattingConstraints.INDENT.equals(indentStrategy) || XMLFormattingConstraints.NEW_LINE.equals(indentStrategy)) {
- availableLineWidth = indentIfPossible(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true, true);
- if (availableLineWidth > 0)
- thisConstraints.setAvailableLineWidth(availableLineWidth);
- }
- }
- // format the start tag itself
- boolean tagEnded = formatWithinTag(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion);
-
- // format children
- if (!tagEnded) {
- // update childConstraints with thisConstraint's indentLevel &
- // availableLineWidth
- childrenConstraints.setIndentLevel(thisConstraints.getIndentLevel());
- childrenConstraints.setAvailableLineWidth(thisConstraints.getAvailableLineWidth());
-
- previousDocumentRegion = currentDocumentRegion;
- IDOMNode childDOMNode = (IDOMNode) currentDOMNode.getFirstChild();
- IStructuredDocumentRegion nextRegion = currentDocumentRegion.getNext();
- boolean passedFormatRange = false;
- // as long as there is one child
- if (childDOMNode != null && nextRegion != null) {
- while (childDOMNode != null && nextRegion != null && !passedFormatRange && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
- DOMRegion childDOMRegion = new DOMRegion();
- childDOMRegion.documentRegion = nextRegion;
- childDOMRegion.domNode = childDOMNode;
- if (nextRegion.equals(childDOMNode.getFirstStructuredDocumentRegion())) {
- // format children. pass in child constraints
- childDOMRegion = formatRegion(textEdit, formatRange, childrenConstraints, childDOMRegion, previousDocumentRegion);
- }
- else {
- // TODO: what happens if they dont match up?
- }
-
- // update childDOMRegion with next dom/region node
- if (childDOMRegion.domNode != null) {
- childDOMNode = (IDOMNode) childDOMRegion.domNode.getNextSibling();
- }
- else {
- childDOMNode = null;
- }
- previousDocumentRegion = childDOMRegion.documentRegion;
- nextRegion = previousDocumentRegion.getNext();
- if (nextRegion != null)
- passedFormatRange = !formatRange.overlapsWith(nextRegion.getStartOffset(), nextRegion.getLength());
- }
- }
- else {
- // there were no children, so keep end tag inlined
- childrenConstraints.setWhitespaceStrategy(XMLFormattingConstraints.COLLAPSE);
- childrenConstraints.setIndentStrategy(XMLFormattingConstraints.INLINE);
- }
-
- if (!passedFormatRange) {
- // update the dom region with the last formatted region/dom
- // node should be end tag and this tag's DOMNode
- currentDOMRegion.documentRegion = nextRegion;
- currentDOMRegion.domNode = currentDOMNode;
-
- // end tag's indent level should be same as start tag's
- childrenConstraints.setIndentLevel(thisConstraints.getIndentLevel());
- // format end tag
- boolean formatEndTag = false;
- if (nextRegion != null && currentDOMNode != null) {
- ITextRegionList rs = nextRegion.getRegions();
- if (rs.size() > 1) {
- ITextRegion r = rs.get(0);
- if (r != null && DOMRegionContext.XML_END_TAG_OPEN.equals(r.getType())) {
- r = rs.get(1);
- if (r != null && DOMRegionContext.XML_TAG_NAME.equals(r.getType())) {
- String tagName = nextRegion.getText(r);
- if (tagName != null && tagName.equals(currentDOMNode.getNodeName()))
- formatEndTag = true;
- }
- }
-
- }
- }
- if (formatEndTag)
- formatEndTag(textEdit, formatRange, childrenConstraints, currentDOMRegion, previousDocumentRegion);
- else {
- // missing end tag so return last formatted document
- // region
- currentDOMRegion.documentRegion = previousDocumentRegion;
- }
- }
- else {
- // passed format range before could finish, so update dom
- // region to last known formatted region
- currentDOMRegion.documentRegion = nextRegion;
- currentDOMRegion.domNode = childDOMNode;
- }
-
- // update parent constraint since this is what is passed back
- parentConstraints.setAvailableLineWidth(childrenConstraints.getAvailableLineWidth());
- }
- else {
- // update available line width
- parentConstraints.setAvailableLineWidth(thisConstraints.getAvailableLineWidth());
- }
- return currentDOMRegion;
- }
-
- private void formatStartTagWithNoAttr(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, int availableLineWidth, String indentStrategy, String whitespaceStrategy, ITextRegion currentTextRegion) {
- // calculate available line width
- int tagNameLineWidth = currentTextRegion.getTextLength() + 2;
- availableLineWidth -= tagNameLineWidth;
-
- if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
- // if was inlining, need to check if out of available line
- // width
- if (availableLineWidth < 0) {
- // need to indent if possible
- int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
- // update available line width
- if (lineWidth > 0)
- availableLineWidth = lineWidth - tagNameLineWidth;
- else
- availableLineWidth -= tagNameLineWidth;
- }
- else {
- // no need to indent
- // just make sure to delete previous whitespace if
- // needed
- if (previousDocumentRegion != null) {
- if (DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) {
- String previousDocumentRegionText = previousDocumentRegion.getFullText();
- if (previousDocumentRegionText.trim().length() == 0) {
- availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
- }
- }
- }
- }
- }
-
- // delete any trail spaces after tag name
- if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- }
- constraints.setAvailableLineWidth(availableLineWidth);
- }
-
- /**
- * Format the text in xml content
- *
- * @param textEdit
- * @param parentConstraints
- * @param currentRegion
- * @param fullText
- * @param whitespaceMode
- */
- private void formatTextInContent(TextEdit textEdit, XMLFormattingConstraints parentConstraints, IStructuredDocumentRegion currentRegion, IStructuredDocumentRegion nextRegion, String fullText, String whitespaceMode) {
- int availableLineWidth = parentConstraints.getAvailableLineWidth();
-
- // determine indentation
- boolean forceInitialIndent = false;
- int indentLevel = parentConstraints.getIndentLevel() + 1;
- String indentMode = parentConstraints.getIndentStrategy();
- if (XMLFormattingConstraints.INDENT.equals(indentMode)) {
- forceInitialIndent = true;
- }
- if (XMLFormattingConstraints.NEW_LINE.equals(indentMode)) {
- indentLevel = parentConstraints.getIndentLevel();
- forceInitialIndent = true;
- }
-
- int fullTextOffset = 0;
- char[] fullTextArray = fullText.toCharArray();
- while (fullTextOffset < fullTextArray.length) {
- // gather all whitespaces
- String whitespaceRun = getCharacterRun(fullTextArray, fullTextOffset, true);
- if (whitespaceRun.length() > 0) {
- // offset where whitespace starts
- int whitespaceStart = fullTextOffset;
- // update current offset in fullText
- fullTextOffset += whitespaceRun.length();
-
- // gather following word
- String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
- int characterRunLength = characterRun.length();
- if (characterRunLength > 0) {
- // indent if word is too long or forcing initial
- // indent
- availableLineWidth -= characterRunLength;
- // offset where indent/collapse will happen
- int startOffset = currentRegion.getStartOffset() + whitespaceStart;
- if (forceInitialIndent || (availableLineWidth <= 0)) {
- // indent if not already indented
- availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, startOffset, whitespaceRun);
- // remember to subtract word length
- availableLineWidth -= characterRunLength;
- forceInitialIndent = false; // initial indent done
- }
- else {
- // just collapse spaces, but adjust for any indenting that may result from preserving line delimiters
- if (whitespaceStart == 0 && XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) {
- // if ignore, trim
- DeleteEdit deleteTrailing = new DeleteEdit(startOffset, whitespaceRun.length());
- textEdit.addChild(deleteTrailing);
- }
- else if(XMLFormattingConstraints.REPLACE.equals(whitespaceMode))
- availableLineWidth = replaceSpaces(textEdit, startOffset, availableLineWidth, whitespaceRun);
- else
- availableLineWidth = collapseAndIndent(textEdit, startOffset, availableLineWidth, indentLevel, whitespaceRun, currentRegion);
- }
-
- fullTextOffset += characterRunLength;
- }
- else {
- // handle trailing whitespace
- int whitespaceOffset = currentRegion.getStartOffset() + whitespaceStart;
- if (XMLFormattingConstraints.REPLACE.equals(whitespaceMode))
- availableLineWidth = replaceSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
- else if (XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) {
- // always trim
- DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
- textEdit.addChild(deleteTrailing);
- }
- else if(getFormattingPreferences().getClearAllBlankLines()) {
- if (!nextRegionHandlesTrailingWhitespace(nextRegion)) {
- if (XMLFormattingConstraints.IGNORE.equals(whitespaceMode)) {
- // if ignore, trim
- DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
- textEdit.addChild(deleteTrailing);
- }
- else {
- // if collapse, leave a space. but what if end up
- // wanting to add indent? then need to delete space
- // added and add indent instead
- availableLineWidth = collapseSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
- }
- }
- }
- }
- }
- else {
- // gather word
- String characterRun = getCharacterRun(fullTextArray, fullTextOffset, false);
- int characterRunLength = characterRun.length();
- if (characterRunLength > 0) {
- // indent if word is too long or forcing initial
- // indent
- // [243091] - characterRunLength should only be subtracted once or text formatting wraps prematurely
- // availableLineWidth = availableLineWidth - characterRunLength;
- if ((XMLFormattingConstraints.IGNORE.equals(whitespaceMode) || XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) && (forceInitialIndent || (availableLineWidth <= 0))) {
- // indent if not already indented
- availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, currentRegion.getStartOffset(), whitespaceRun);
- // remember to subtract word length
- availableLineWidth -= characterRunLength;
- forceInitialIndent = false; // initial indent done
- }
- else {
- // just collapse spaces
- availableLineWidth -= characterRunLength;
- }
-
- fullTextOffset += characterRunLength;
- }
- }
- }
- // update available line width
- parentConstraints.setAvailableLineWidth(availableLineWidth);
- }
-
- private boolean nextRegionHandlesTrailingWhitespace(IStructuredDocumentRegion region) {
- if (region == null)
- return false;
- final String type = region.getType();
- if (type.equals(DOMRegionContext.XML_TAG_NAME)) {
- return DOMRegionContext.XML_TAG_OPEN.equals(region.getFirstRegion().getType());
- }
- return DOMRegionContext.XML_COMMENT_TEXT.equals(type);
- }
-
- private void formatWithinEndTag(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion) {
- String indentStrategy = constraints.getIndentStrategy();
- String whitespaceStrategy = constraints.getWhitespaceStrategy();
- int availableLineWidth = constraints.getAvailableLineWidth();
- ITextRegionList textRegions = currentDocumentRegion.getRegions();
- int currentNumberOfRegions = currentDocumentRegion.getNumberOfRegions();
- int currentTextRegionIndex = 1;
-
- ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
- String currentType = currentTextRegion.getType();
- // tag name should always be the first text region
- if (DOMRegionContext.XML_TAG_NAME.equals(currentType) && currentTextRegionIndex < currentNumberOfRegions - 1) {
- ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
- // Bug 221279 - Some non well-formed documents will not contribute a next region
- if (nextTextRegion != null && DOMRegionContext.XML_TAG_CLOSE.equals(nextTextRegion.getType())) {
- // calculate available line width
- int tagNameLineWidth = currentTextRegion.getTextLength() + 3;
- availableLineWidth -= tagNameLineWidth;
-
- if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
- // if was inlining, need to check if out of available line
- // width - Whitespace may have been corrected in the text content
- if (availableLineWidth < 0 && XMLFormattingConstraints.IGNORE.equals(whitespaceStrategy)) {
- // need to deindent if possible
- int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
- // update available line width
- if (lineWidth > 0)
- availableLineWidth = lineWidth - tagNameLineWidth;
- }
- else {
- // no need to indent
- // just make sure to delete previous whitespace if
- // needed
- if (previousDocumentRegion != null) {
- if (DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) {
- String previousDocumentRegionText = previousDocumentRegion.getFullText();
- if (previousDocumentRegionText.trim().length() == 0) {
- availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
- }
- }
- }
- }
- }
- // delete any trail spaces after tag name
- if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- }
- }
- }
- else {
- // end tag has unexpected stuff, so just leave it alone
- }
- constraints.setAvailableLineWidth(availableLineWidth);
- }
-
- /**
- * Formats the contents within a tag like tag name and attributes
- *
- * @param textEdit
- * @param currentDocumentRegion
- * @param textRegions
- * contains at least 3 regions
- * @return true if tag was ended, false otherwise
- */
- private boolean formatWithinTag(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion) {
- int availableLineWidth = constraints.getAvailableLineWidth();
- String indentStrategy = constraints.getIndentStrategy();
- String whitespaceStrategy = constraints.getWhitespaceStrategy();
- int indentLevel = constraints.getIndentLevel();
- ITextRegionList textRegions = currentDocumentRegion.getRegions();
- int currentTextRegionIndex = 1;
-
- ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
- String currentType = currentTextRegion.getType();
- // tag name should always be the first text region
- if (DOMRegionContext.XML_TAG_NAME.equals(currentType)) {
- ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
- String nextType = (nextTextRegion != null) ? nextTextRegion.getType() : null;
- if (DOMRegionContext.XML_TAG_CLOSE.equals(nextType)) {
- // already at tag close
- formatStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
- return false;
- }
- else if (DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(nextType)) {
- // already at empty tag close
- formatEmptyStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
- return true;
- }
- else {
- availableLineWidth -= (currentTextRegion.getTextLength() + 2);
- boolean alignFinalBracket = getFormattingPreferences().getAlignFinalBracket();
- boolean oneSpaceInTagName = getFormattingPreferences().getSpaceBeforeEmptyCloseTag();
- boolean indentMultipleAttribute = getFormattingPreferences().getIndentMultipleAttributes();
- // indicates if tag spanned more than one line
- boolean spanMoreThan1Line = false;
- // indicates if all attributes should be indented
- boolean indentAllAttributes = false;
- if (indentMultipleAttribute) {
- int attributesCount = 0;
- int i = 2;
- final int size = textRegions.size();
- while (i < size && attributesCount < 2) {
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegions.get(i).getType())) {
- ++attributesCount;
- }
- i++;
- }
- indentAllAttributes = (attributesCount > 1);
- }
-
- while ((currentTextRegionIndex + 1) < textRegions.size()) {
- nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
- nextType = nextTextRegion.getType();
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(nextType)) {
- boolean indentAttribute = indentAllAttributes;
- if (!indentAttribute)
- indentAttribute = shouldIndentBeforeAttribute(constraints, textRegions, availableLineWidth, currentTextRegionIndex, currentTextRegion, nextTextRegion);
- if (indentAttribute) {
- availableLineWidth = indentIfNotAlreadyIndented(textEdit, indentLevel + 1, currentDocumentRegion, currentTextRegion);
- spanMoreThan1Line = true;
- }
- else {
- // otherwise, insertSpaceAndCollapse
- insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
- // update available line width
- availableLineWidth -= (currentTextRegion.getTextLength() + 1);
- }
- }
- else if (DOMRegionContext.XML_TAG_CLOSE.equals(nextType)) {
- // if need to align bracket on next line, indent
- if (alignFinalBracket && spanMoreThan1Line) {
- availableLineWidth = indentIfNotAlreadyIndented(textEdit, indentLevel, currentDocumentRegion, currentTextRegion);
- --availableLineWidth; // for tag close itself
- }
- else {
- // otherwise, just delete space before tag close
- if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- availableLineWidth -= (currentTextRegion.getTextLength() + 1);
- }
- }
- // update line width
- constraints.setAvailableLineWidth(availableLineWidth);
- return false;
- }
- else if (DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(nextType)) {
- int textLength = currentTextRegion.getTextLength();
- int regionLength = currentTextRegion.getLength();
-
- boolean thereAreSpaces = textLength < regionLength;
- if (!oneSpaceInTagName && thereAreSpaces) {
- // delete any trail spaces after tag name
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- availableLineWidth -= (currentTextRegion.getTextLength() + 2);
- }
- // insert a space and collapse ONLY IF it's specified
- else if (oneSpaceInTagName) {
- insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
- availableLineWidth -= (currentTextRegion.getTextLength() + 3);
- }
- // update line width
- constraints.setAvailableLineWidth(availableLineWidth);
- return true;
- }
- else {
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(currentType) && DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(nextType)) {
- if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- }
- // update available width
- availableLineWidth -= currentTextRegion.getTextLength();
- }
- else if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(currentType) && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(nextType)) {
- if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
- deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
- }
- // update available width
- availableLineWidth -= currentTextRegion.getTextLength();
- }
- else {
- // otherwise, insertSpaceAndCollapse
- insertSpaceAndCollapse(textEdit, currentDocumentRegion, availableLineWidth, currentTextRegion);
- // update available line width
- availableLineWidth -= (currentTextRegion.getTextLength() + 1);
- }
- }
- currentTextRegion = nextTextRegion;
- currentType = nextType;
- ++currentTextRegionIndex;
- }
- }
- }
- // update line width
- constraints.setAvailableLineWidth(availableLineWidth);
- return false;
- }
-
- /**
- * Format an XML comment structured document region.
- */
- private void formatComment(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
- IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
- int lineWidth = parentConstraints.getAvailableLineWidth() - currentRegion.getFullText().length();
- // Don't format if we're not exceeding the available line width, or if the whitespace
- // strategy is to preserve whitespace - But update line width.
- if(currentRegion == null || XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy()) || !fPreferences.getFormatCommentText()) {
- parentConstraints.setAvailableLineWidth(lineWidth);
- return;
- }
-
- Iterator it = currentRegion.getRegions().iterator();
- ITextRegion previous = null;
- if (previousRegion == null)
- previousRegion = currentRegion.getPrevious();
- // Iterate over each text region of the comment
- Node parent = currentDOMRegion.domNode.getParentNode();
- while(it.hasNext()) {
- ITextRegion text = (ITextRegion) it.next();
- String type = text.getType();
- if (type == DOMRegionContext.XML_COMMENT_OPEN) {
- int indentLevel = (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) ? 0 : 1;
- int width = formatCommentStart(textEdit, parentConstraints, indentLevel, currentRegion, previousRegion, text);
- parentConstraints.setAvailableLineWidth(width);
- }
- else if (type == DOMRegionContext.XML_COMMENT_TEXT) {
- int indentLevel = (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) ? -1 : parentConstraints.getIndentLevel();
- formatCommentContent(textEdit, parentConstraints, indentLevel, currentRegion, previous, text);
- }
- previous = text;
- }
- }
-
- private void formatCommentContent(TextEdit textEdit, XMLFormattingConstraints parentConstraints, int indentLevel, IStructuredDocumentRegion currentRegion, ITextRegion previous, ITextRegion region) {
- int lineWidth = parentConstraints.getAvailableLineWidth() - currentRegion.getFullText(previous).length();
- // If there's more text than line width available, format
- String text = currentRegion.getFullText(region);
- compressContent(textEdit, currentRegion, currentRegion.getStartOffset(region), indentLevel + 1, lineWidth, text);
- }
-
- private void compressContent(TextEdit textEdit, IStructuredDocumentRegion region, int startOffset, int indentLevel, int lineWidth, String text) {
- int length = text.length();
- int start = 0, end = 0;
- char c = 0;
- int resultLength = 0;
- boolean joinLines = fPreferences.getJoinCommentLines();
- boolean onOwnLine = false;
-
- String indent = getIndentString(indentLevel + 1);
-
- for (int i = 0; i < length; i++) {
- c = text.charAt(i);
- // Compress whitespace unless its a line delimiter and formatting does not permit joining lines
- if (Character.isWhitespace(c)) {
- if ((c != '\r' && c!= '\n') || joinLines) {
- // Just came off of a word
- if (start == end) {
- start = end = i;
- }
- end++;
- resultLength++;
- }
- else {
- // correct the indent of this line
- lineWidth = fPreferences.getMaxLineWidth();
- resultLength = 0;
- onOwnLine = true;
-
- // Compress any whitespace before the line delimiter
- if (start != end) {
- int replaceLength = end - start;
- textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, EMPTY));
- start = end = i;
- }
- }
- }
- else {
- // Transitioned to a new word
- if (start != end) {
- int replaceLength = end - start;
- if (onOwnLine) {
- // If content is on its own line, replace leading whitespace with proper indent
- textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, indent));
- resultLength -= (replaceLength - indent.length());
- onOwnLine = false;
- }
- else if (!(replaceLength == 1 && text.charAt(start) == ' ')) {
- textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, SPACE));
- resultLength -= (replaceLength - 1);
- }
- start = end = i;
- // Make sure the word starts on a new line
- if (resultLength > lineWidth) {
- lineWidth = fPreferences.getMaxLineWidth();
- resultLength = 0;
- textEdit.addChild(new InsertEdit(start + startOffset, getLineDelimiter(region) + indent));
- }
- }
- // Word is immediately after line delimiters, indent appropriately
- if (onOwnLine) {
- textEdit.addChild(new InsertEdit(i + startOffset, indent));
- onOwnLine = false;
- }
- resultLength++;
- }
- }
-
- // Clean up any dangling whitespace
- int replaceLength = end - start;
- indent = getIndentString(indentLevel);
- if (replaceLength == 0) { // No trailing whitespace
- textEdit.addChild(new InsertEdit(length + startOffset, (onOwnLine) ? indent : SPACE));
- }
- else {
- String whitespace = text.substring(start);
- String replacement = (onOwnLine) ? indent : SPACE;
- if (!whitespace.equals(replacement)) {
- textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, replacement));
- }
- }
- }
-
- private int formatCommentStart(TextEdit textEdit, XMLFormattingConstraints parentConstraints, int indentLevel, IStructuredDocumentRegion currentRegion, IStructuredDocumentRegion previousRegion, ITextRegion region) {
- int lineWidth = parentConstraints.getAvailableLineWidth();
- if (previousRegion!=null&&(DOMRegionContext.XML_CONTENT.equals(previousRegion.getType()))) {
- String previousText = previousRegion.getFullText();
- String trailingWhitespace = getTrailingWhitespace(previousText);
- String delimiters = extractLineDelimiters(trailingWhitespace, previousRegion);
- if (delimiters != null && delimiters.length() > 0){// && previousText.length() == trailingWhitespace.length()) {
- // Format the comment if it's on a new line
- int offset = previousRegion.getEnd() - trailingWhitespace.length();
- lineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, parentConstraints.getIndentLevel() + indentLevel, offset, trailingWhitespace);
- }
- }
- return lineWidth;
- }
-
- /**
- * Returns either a String of whitespace or characters depending on
- * forWhitespace
- *
- * @param fullTextArray
- * the text array to look in
- * @param textOffset
- * the start offset to start searching
- * @param forWhitespace
- * true if should return whitespaces, false otherwise
- * @return a String of either all whitespace or all characters. Never
- * returns null
- */
- private String getCharacterRun(char[] fullTextArray, int textOffset, boolean forWhitespace) {
- StringBuffer characterRun = new StringBuffer();
- boolean nonCharacterFound = false;
- while (textOffset < fullTextArray.length && !nonCharacterFound) {
- char c = fullTextArray[textOffset];
- boolean isWhitespace = Character.isWhitespace(c);
- if ((forWhitespace && isWhitespace) || (!forWhitespace && !isWhitespace))
- characterRun.append(c);
- else
- nonCharacterFound = true;
- ++textOffset;
- }
- return characterRun.toString();
- }
-
- private String getTrailingWhitespace(String text) {
- StringBuffer whitespaceRun = new StringBuffer();
- int index = text.length() - 1;
- while(index >= 0) {
- char c = text.charAt(index--);
- if (Character.isWhitespace(c))
- whitespaceRun.insert(0, c);
- else
- break;
- }
- return whitespaceRun.toString();
- }
-
- private String getIndentString(int indentLevel) {
- StringBuffer indentString = new StringBuffer();
- String indent = getFormattingPreferences().getOneIndent();
- for (int i = 0; i < indentLevel; ++i) {
- indentString.append(indent);
- }
- return indentString.toString();
- }
-
- protected XMLFormattingPreferences getFormattingPreferences() {
- if (fPreferences == null)
- fPreferences = new XMLFormattingPreferences();
- return fPreferences;
- }
-
- protected void setFormattingPreferences(XMLFormattingPreferences preferences) {
- fPreferences = preferences;
- }
-
- /**
- * Indent if whitespaceRun does not already contain an indent
- *
- * @param textEdit
- * @param indentLevel
- * @param indentStartOffset
- * @param maxAvailableLineWidth
- * @param whitespaceRun
- * @return new available line width up to where indented
- */
- private int indentIfNotAlreadyIndented(TextEdit textEdit, IStructuredDocumentRegion currentRegion, int indentLevel, int indentStartOffset, String whitespaceRun) {
- int maxAvailableLineWidth = getFormattingPreferences().getMaxLineWidth();
-
- int availableLineWidth;
- String indentString = getIndentString(indentLevel);
- String lineDelimiter = getLineDelimiter(currentRegion);
- String newLineAndIndent = lineDelimiter + indentString;
-
- TextEdit indentation = null;
-
- // if not already correctly indented
- if (!newLineAndIndent.equals(whitespaceRun)) {
- if (getFormattingPreferences().getClearAllBlankLines()) {
- if (whitespaceRun != null) {
- // replace existing whitespace run
- indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
- }
- else {
- // just insert correct indent
- indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
- }
- }
- // Keep the empty lines
- else {
- // just insert correct indent
- if(whitespaceRun == null)
- indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
- // Need to preserve the number of empty lines, but still indent on the current line properly
- else {
- String existingDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
- if(existingDelimiters != null && existingDelimiters.length() > 0) {
- String formatted = existingDelimiters + indentString;
- // Don't perform a replace if the formatted string is the same as the existing whitespaceRun
- if(!formatted.equals(whitespaceRun))
- indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), formatted);
- }
- // No blank lines to preserve - correct the indent
- else
- indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
- }
- }
- }
-
- if(indentation != null)
- textEdit.addChild(indentation);
- // update line width
- availableLineWidth = maxAvailableLineWidth - indentString.length();
- return availableLineWidth;
- }
-
- private int indentIfNotAlreadyIndented(TextEdit textEdit, int indentLevel, IStructuredDocumentRegion currentDocumentRegion, ITextRegion currentTextRegion) {
- // indent if not already indented
- int textLength = currentTextRegion.getTextLength();
- int regionLength = currentTextRegion.getLength();
- int indentStartOffset = currentDocumentRegion.getTextEndOffset(currentTextRegion);
- String fullText = currentDocumentRegion.getFullText(currentTextRegion);
- String whitespaceRun = fullText.substring(textLength, regionLength);
-
- // update line width
- int availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentDocumentRegion, indentLevel, indentStartOffset, whitespaceRun);
- return availableLineWidth;
- }
-
- private int indentIfPossible(TextEdit textEdit, XMLFormattingConstraints thisConstraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, String whitespaceStrategy, String indentStrategy, boolean addIndent) {
- return indentIfPossible(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, addIndent, !getFormattingPreferences().getClearAllBlankLines());
- }
-
- private int indentIfPossible(TextEdit textEdit, XMLFormattingConstraints thisConstraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, String whitespaceStrategy, String indentStrategy, boolean addIndent, boolean handlePreviousWhitespace) {
- int availableLineWidth = -1;
- // if there is no previous document region, there is no need to indent
- // because we're at beginning of document
- if (previousDocumentRegion == null)
- return availableLineWidth;
-
- // only indent if ignoring whitespace or if collapsing and
- // there was a whitespace character before this region
- boolean canIndent = false;
- String previousRegionFullText = null;
- String previousRegionType = null;
-
- if ((XMLFormattingConstraints.IGNORE.equals(whitespaceStrategy)) || XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceStrategy)) {
- // if ignoring, need to check if previous region was cdata
- previousRegionType = previousDocumentRegion.getType();
- if (DOMRegionContext.XML_CDATA_TEXT.equals(previousRegionType))
- canIndent = false;
- else
- canIndent = true;
- }
- else if (XMLFormattingConstraints.COLLAPSE.equals(whitespaceStrategy)) {
- // if collapsing, need to check if previous region ended in a
- // whitespace
- previousRegionType = previousDocumentRegion.getType();
- if (DOMRegionContext.XML_CONTENT.equals(previousRegionType)) {
- previousRegionFullText = previousDocumentRegion.getFullText();
- int length = previousRegionFullText.length();
- if (length > 1)
- canIndent = Character.isWhitespace(previousRegionFullText.charAt(length - 1));
- }
- }
- if (canIndent) {
- int indentStartOffset = currentDocumentRegion.getStartOffset();
- String whitespaceRun = null;
-
- // get previous region type if it was not previously retrieved
- if (previousRegionType == null)
- previousRegionType = previousDocumentRegion.getType();
-
- // get previous region's text if it was not previously retrieved
- if (previousRegionFullText == null && DOMRegionContext.XML_CONTENT.equals(previousRegionType))
- previousRegionFullText = previousDocumentRegion.getFullText();
-
- // if previous region was only whitespace, this may
- // already be indented, so need to make sure
- if ((previousRegionFullText != null) && (previousRegionFullText.trim().length() == 0)) {
- indentStartOffset = previousDocumentRegion.getStartOffset();
- whitespaceRun = previousRegionFullText;
- }
- if ((previousRegionFullText != null) && (whitespaceRun == null) && handlePreviousWhitespace) {
- whitespaceRun = getTrailingWhitespace(previousRegionFullText);
- indentStartOffset = previousDocumentRegion.getEndOffset() - whitespaceRun.length();
- }
-
- int indentLevel = thisConstraints.getIndentLevel();
- if (addIndent && XMLFormattingConstraints.INDENT.equals(indentStrategy)) {
- ++indentLevel;
- thisConstraints.setIndentLevel(indentLevel);
- }
-
- // indent if not already indented
- availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentDocumentRegion, indentLevel, indentStartOffset, whitespaceRun);
- }
- return availableLineWidth;
- }
-
- /**
- * Allow exactly one whitespace in currentTextRegion. If there are more,
- * collapse to one. If there are none, insert one.
- *
- * @param textEdit
- * @param currentDocumentRegion
- * @param availableLineWidth
- * @param currentTextRegion
- */
- private void insertSpaceAndCollapse(TextEdit textEdit, IStructuredDocumentRegion currentDocumentRegion, int availableLineWidth, ITextRegion currentTextRegion) {
- int textLength = currentTextRegion.getTextLength();
- int regionLength = currentTextRegion.getLength();
- boolean thereAreSpaces = textLength < regionLength;
- int spacesStartOffset = currentDocumentRegion.getStartOffset(currentTextRegion) + textLength;
-
- if (thereAreSpaces) {
- String fullTagName = currentDocumentRegion.getFullText(currentTextRegion);
- String whitespaceRun = fullTagName.substring(textLength, regionLength);
- collapseSpaces(textEdit, spacesStartOffset, availableLineWidth, whitespaceRun);
- }
- else {
- // insert a space
- InsertEdit insertEdit = new InsertEdit(spacesStartOffset, SPACE);
- textEdit.addChild(insertEdit);
- }
- }
-
- private boolean shouldIndentBeforeAttribute(XMLFormattingConstraints constraints, ITextRegionList textRegions, int availableLineWidth, int currentTextRegionIndex, ITextRegion currentTextRegion, ITextRegion nextTextRegion) {
- boolean indentAttribute = false;
-
- // look ahead to see if going to hit max line width
- // something attrName
- int currentWidth = currentTextRegion.getTextLength() + nextTextRegion.getTextLength() + 1;
- if (currentWidth > availableLineWidth)
- indentAttribute = true;
- else {
- if ((currentTextRegionIndex + 2) < textRegions.size()) {
- // still okay, so try next region
- // something attrName=
- ITextRegion textRegion = textRegions.get(currentTextRegionIndex + 2);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(textRegion.getType())) {
- ++currentWidth;
- if (currentWidth > availableLineWidth)
- indentAttribute = true;
- else {
- if ((currentTextRegionIndex + 3) < textRegions.size()) {
- // still okay, so try next region
- // something attrName=attrValue
- textRegion = textRegions.get(currentTextRegionIndex + 3);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {
- currentWidth = +textRegion.getTextLength();
- if (currentWidth > availableLineWidth)
- indentAttribute = true;
- }
- }
- }
- }
- }
- }
- return indentAttribute;
- }
-
- /**
- * Given the provided information (parentConstraints & currentDOMRegion),
- * update the formatting constraints (for this & child)
- *
- * @param parentConstraints
- * can be null
- * @param thisConstraints
- * can be null
- * @param childConstraints
- * can be null
- * @param currentDOMRegion
- * cannot be null
- */
- protected void updateFormattingConstraints(XMLFormattingConstraints parentConstraints, XMLFormattingConstraints thisConstraints, XMLFormattingConstraints childConstraints, DOMRegion currentDOMRegion) {
- IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
- IDOMNode currentNode = currentDOMRegion.domNode;
-
- // default to whatever parent's constraint said to do
- if (parentConstraints != null) {
- if (thisConstraints != null) {
- thisConstraints.copyConstraints(parentConstraints);
- }
- if (childConstraints != null) {
- childConstraints.copyConstraints(parentConstraints);
- // if whitespace strategy was only a hint, null it out so
- // defaults are taken instead
- if (parentConstraints.isWhitespaceStrategyAHint())
- childConstraints.setWhitespaceStrategy(null);
- }
- }
-
- // set up constraints for direct children of document root
- Node parentNode = currentNode.getParentNode();
- if (parentNode != null && parentNode.getNodeType() == Node.DOCUMENT_NODE) {
- if (thisConstraints != null) {
- thisConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
- thisConstraints.setIndentStrategy(XMLFormattingConstraints.NEW_LINE);
- thisConstraints.setIndentLevel(0);
- }
- if (childConstraints != null) {
- childConstraints.setWhitespaceStrategy(null);
- childConstraints.setIndentStrategy(null);
- childConstraints.setIndentLevel(0);
- }
- }
-
- // other conditions to check when setting up child constraints
- if (childConstraints != null) {
- XMLFormattingPreferences preferences = getFormattingPreferences();
-
- // if we're at document root, child tags should always just start
- // on a new line and have an indent level of 0
- if (currentNode.getNodeType() == Node.DOCUMENT_NODE) {
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
- childConstraints.setIndentStrategy(XMLFormattingConstraints.NEW_LINE);
- childConstraints.setIndentLevel(0);
- }
- else {
- // BUG108074 & BUG84688 - preserve whitespace in xsl:text &
- // xsl:attribute
- String nodeNamespaceURI = currentNode.getNamespaceURI();
- if (XSL_NAMESPACE.equals(nodeNamespaceURI)) {
- String nodeName = ((Element) currentNode).getLocalName();
- if (XSL_ATTRIBUTE.equals(nodeName) || XSL_TEXT.equals(nodeName)) {
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
- }
- }
- else {
- // search within current tag for xml:space attribute
- ITextRegionList textRegions = currentRegion.getRegions();
- int i = 0;
- boolean xmlSpaceFound = false;
- boolean preserveFound = false;
- while (i < textRegions.size() && !xmlSpaceFound) {
- ITextRegion textRegion = textRegions.get(i);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegion.getType())) {
- String regionText = currentRegion.getText(textRegion);
- if (XML_SPACE.equals(regionText)) {
- if ((i + 1) < textRegions.size()) {
- ++i;
- textRegion = textRegions.get(i);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(textRegion.getType()) && ((i + 1) < textRegions.size())) {
- ++i;
- textRegion = textRegions.get(i);
- regionText = currentRegion.getText(textRegion);
- if (PRESERVE.equals(regionText) || PRESERVE_QUOTED.equals(regionText)) {
- preserveFound = true;
- }
- }
- }
- xmlSpaceFound = true;
- }
- }
- ++i;
- }
- if (xmlSpaceFound) {
- if (preserveFound) {
- // preserve was found so set the strategy
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
- }
- else {
- // xml:space was found but it was not collapse, so
- // use default whitespace strategy
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
- }
- }
- else {
- // how to hande nodes that have nonwhitespace text
- // content
- NodeList nodeList = currentNode.getChildNodes();
- int length = nodeList.getLength();
- int index = 0;
- boolean textNodeFound = false;
- // BUG214516 - If the parent constraint is to preserve whitespace, child constraints should
- // still reflect the parent constraints
- while (index < length && !textNodeFound && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
- Node childNode = nodeList.item(index);
- if (childNode.getNodeType() == Node.TEXT_NODE) {
- textNodeFound = !((IDOMText) childNode).isElementContentWhitespace();
- }
- ++index;
- }
- if (textNodeFound) {
- if (length > 1) {
- // more in here than just text, so consider
- // this mixed content
- childConstraints.setWhitespaceStrategy(preferences.getMixedWhitespaceStrategy());
- childConstraints.setIndentStrategy(preferences.getMixedIndentStrategy());
- }
- else {
- // there's only text
- childConstraints.setWhitespaceStrategy(preferences.getTextWhitespaceStrategy());
- childConstraints.setIndentStrategy(preferences.getTextIndentStrategy());
- }
- childConstraints.setIsWhitespaceStrategyAHint(true);
- childConstraints.setIsIndentStrategyAHint(true);
- }
-
- // try referring to content model for information on
- // whitespace & indent strategy
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) currentNode.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
- CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(currentNode);
- if (elementDeclaration != null) {
- // follow whitespace strategy preference for
- // pcdata content
- int contentType = elementDeclaration.getContentType();
-
- String facetValue = null;
- if(elementDeclaration.getDataType() != null)
- facetValue = (String) elementDeclaration.getDataType().getProperty(PROPERTY_WHITESPACE_FACET);
- if(facetValue != null) {
- if(PRESERVE.equals(facetValue))
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
- // For XSD types, "collapse" corresponds to the IGNOREANDTRIM strategy
- else if(COLLAPSE.equals(facetValue))
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNOREANDTRIM);
- else if(REPLACE.equals(facetValue))
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.REPLACE);
- }
- else if (contentType == CMElementDeclaration.PCDATA && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
- childConstraints.setWhitespaceStrategy(preferences.getPCDataWhitespaceStrategy());
- }
- else if (contentType == CMElementDeclaration.ELEMENT && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNORE);
- childConstraints.setIndentStrategy(XMLFormattingConstraints.INDENT);
- childConstraints.setIsWhitespaceStrategyAHint(true);
- childConstraints.setIsIndentStrategyAHint(true);
- }
- else {
- // look for xml:space in content model
- CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
-
- // Not needed - we're looking for xml:space
- //CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
- //List nodes = ModelQueryUtil.getModelQuery(currentNode.getOwnerDocument()).getAvailableContent((Element) currentNode, elementDeclaration, ModelQuery.INCLUDE_ATTRIBUTES);
- //for (int k = 0; k < nodes.size(); k++) {
- // CMNode cmnode = (CMNode) nodes.get(k);
- // if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- // allAttributes.put(cmnode);
- // }
- //}
- //cmAttributes = allAttributes;
-
- // Check implied values from the DTD way.
- CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
- if (attributeDeclaration != null) {
- // CMAttributeDeclaration found, check
- // it
- // out.
-
- //BUG214516/196544 - Fixed NPE that was caused by an attr having
- // a null attr type
- String defaultValue = null;
- CMDataType attrType = attributeDeclaration.getAttrType();
- if (attrType != null) {
- if ((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && attrType.getImpliedValue() != null)
- defaultValue = attrType.getImpliedValue();
- else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
- defaultValue = attrType.getEnumeratedValues()[0];
- }
- }
-
- // xml:space="preserve" means preserve
- // space,
- // everything else means back to
- // default.
- if (PRESERVE.equals(defaultValue))
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
- else
- childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
- }
- // If the node has no attributes, inherit the parents whitespace strategy
- else {
- if (parentConstraints != null)
- childConstraints.setWhitespaceStrategy(parentConstraints.getWhitespaceStrategy());
- else
- childConstraints.setWhitespaceStrategy(null);
- }
- }
- }
- }
- }
- }
- // set default values according to preferences
- if (childConstraints.getWhitespaceStrategy() == null) {
- childConstraints.setWhitespaceStrategy(preferences.getElementWhitespaceStrategy());
- }
- if (childConstraints.getIndentStrategy() == null) {
- childConstraints.setIndentStrategy(preferences.getElementIndentStrategy());
- }
- }
- }
-
- /**
- * Calculates the current available line width given fullText.
- *
- * @param fullText
- * @param availableLineWidth
- * @param maxAvailableLineWidth
- * @return
- */
- private int updateLineWidthWithLastLine(String fullText, int availableLineWidth) {
- int maxAvailableLineWidth = getFormattingPreferences().getMaxLineWidth();
- int lineWidth = availableLineWidth;
- if (fullText != null) {
- int textLength = fullText.length();
- // update available line width
- // find last newline
- int lastLFOffset = fullText.lastIndexOf('\n');
- int lastCROffset = fullText.lastIndexOf('\r');
- // all text was on 1 line
- if (lastLFOffset == -1 && lastCROffset == -1) {
- // just subtract text length from current
- // available line width
- lineWidth -= fullText.length();
- }
- else {
- // calculate available line width of last line
- int lastNewLine = Math.max(lastLFOffset, lastCROffset);
- lineWidth = maxAvailableLineWidth - (textLength - lastNewLine);
- }
- }
- return lineWidth;
- }
-
- private String getLineDelimiter(IStructuredDocumentRegion currentRegion) {
- IStructuredDocument doc = currentRegion.getParentDocument();
- int line = doc.getLineOfOffset(currentRegion.getStartOffset());
- String lineDelimiter = doc.getLineDelimiter();
- try {
- if (line > 0) {
- lineDelimiter = doc.getLineDelimiter(line - 1);
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- // BUG115716: if cannot get line delimiter from current line, just
- // use default line delimiter
- if (lineDelimiter == null)
- lineDelimiter = doc.getLineDelimiter();
- return lineDelimiter;
- }
-
- private String extractLineDelimiters(String base, IStructuredDocumentRegion currentRegion) {
- String lineDelimiter = getLineDelimiter(currentRegion);
- StringBuffer sb = new StringBuffer();
- for(int index = 0; index < base.length();) {
- index = base.indexOf(lineDelimiter, index);
- if(index++ >= 0)
- sb.append(lineDelimiter);
- else
- break;
- }
- return sb.toString();
- }
-
- void setProgressMonitor(IProgressMonitor monitor) {
- fProgressMonitor = monitor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
deleted file mode 100644
index e02ee7e4cb..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
+++ /dev/null
@@ -1,146 +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.wst.xml.core.internal.formatter;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-/**
- * This is a wrapper for the new xml formatter so that it can be still
- * considered an IStruturedFormatProcessor
- */
-public class XMLFormatterFormatProcessor implements IStructuredFormatProcessor {
- private DefaultXMLPartitionFormatter fFormatter = null;
- private IProgressMonitor fProgressMonitor = null;
-
- public void formatDocument(IDocument document, int start, int length) throws IOException, CoreException {
- if (document instanceof IStructuredDocument) {
- IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
- if (model != null) {
- try {
- formatModel(model, start, length);
- }
- finally {
- model.releaseFromEdit();
- }
- }
- }
- }
-
- public void formatFile(IFile file) throws IOException, CoreException {
- if (file == null)
- return;
-
- IStructuredModel structuredModel = null;
- // OutputStream outputStream = null;
- try {
- // setup structuredModel
- // Note: We are getting model for edit. Will save model if model
- // changed.
- structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-
- // format
- formatModel(structuredModel);
-
- // save model if needed
- if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
- structuredModel.save();
- }
- finally {
- // ensureClosed(outputStream, null);
- // release from model manager
- if (structuredModel != null) {
- structuredModel.releaseFromEdit();
- }
-
- }
- }
-
- public void formatModel(IStructuredModel structuredModel) {
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
-
- formatModel(structuredModel, start, length);
- }
-
- public void formatModel(IStructuredModel structuredModel, int start, int length) {
- if(fProgressMonitor != null)
- fProgressMonitor.beginTask("", 2);
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- DocumentRewriteSession activeRewriteSession = ((IDocumentExtension4) structuredDocument).getActiveRewriteSession();
- boolean startedRewriteSession = false;
- if (activeRewriteSession == null) {
- activeRewriteSession = ((IDocumentExtension4) structuredDocument).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
- startedRewriteSession = true;
- }
- getFormatter().setProgressMonitor(new NullProgressMonitor() {
- public boolean isCanceled() {
- return fProgressMonitor != null && fProgressMonitor.isCanceled();
- }
- });
- TextEdit edit = getFormatter().format(structuredModel, start, length);
- if(fProgressMonitor != null)
- fProgressMonitor.worked(1);
-
- try {
- structuredModel.aboutToChangeModel();
- edit.apply(structuredDocument);
- if(fProgressMonitor != null)
- fProgressMonitor.worked(1);
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- finally {
- if (startedRewriteSession && activeRewriteSession != null) {
- ((IDocumentExtension4) structuredDocument).stopRewriteSession(activeRewriteSession);
- }
- structuredModel.changedModel();
- if(fProgressMonitor != null)
- fProgressMonitor.done();
- }
- }
-
- public void formatNode(Node node) {
- if (node instanceof IDOMNode) {
- IDOMNode domNode = (IDOMNode) node;
- formatModel(domNode.getModel(), domNode.getStartOffset(), domNode.getLength());
- }
- }
-
- public void setProgressMonitor(IProgressMonitor monitor) {
- fProgressMonitor = monitor;
- }
-
- private DefaultXMLPartitionFormatter getFormatter() {
- if (fFormatter == null) {
- fFormatter = new DefaultXMLPartitionFormatter();
- }
- return fFormatter;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
deleted file mode 100644
index fa2a53b45c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
+++ /dev/null
@@ -1,94 +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.wst.xml.core.internal.formatter;
-
-
-public class XMLFormattingConstraints {
- public final static String PRESERVE = "PRESERVE"; //$NON-NLS-1$
- public final static String COLLAPSE = "COLLAPSE"; //$NON-NLS-1$
- public final static String IGNORE = "IGNORE"; //$NON-NLS-1$
- public final static String IGNOREANDTRIM = "IGNOREANDTRIM"; //$NON-NLS-1$
- public final static String DEFAULT = "DEFAULT"; //$NON-NLS-1$
- public final static String REPLACE = "REPLACE"; //$NON-NLS-1$
-
- public final static String INDENT = "INDENT"; //$NON-NLS-1$
- public final static String NEW_LINE = "NEW_LINE"; //$NON-NLS-1$
- public final static String INLINE = "INLINE"; //$NON-NLS-1$
-
- private int fAvailableLineWidth = 0;
- private int fIndentLevel = 0;
- private String fIndentStrategy;
- private String fWhitespaceStrategy;
- private boolean fIsIndentStrategyAHint = false;
- private boolean fIsWhitespaceStrategyAHint = false;
-
- /**
- * Initializes the values in this formatting constraint with values from
- * constraints
- *
- * @param constraints
- * cannot be null
- */
- public void copyConstraints(XMLFormattingConstraints constraints) {
- setAvailableLineWidth(constraints.getAvailableLineWidth());
- setIndentLevel(constraints.getIndentLevel());
- setIndentStrategy(constraints.getIndentStrategy());
- setWhitespaceStrategy(constraints.getWhitespaceStrategy());
- }
-
- public int getAvailableLineWidth() {
- return fAvailableLineWidth;
- }
-
- public void setAvailableLineWidth(int lineWidth) {
- fAvailableLineWidth = lineWidth;
- }
-
- public int getIndentLevel() {
- return fIndentLevel;
- }
-
- public void setIndentLevel(int indentLevel) {
- fIndentLevel = indentLevel;
- }
-
- public String getIndentStrategy() {
- return fIndentStrategy;
- }
-
- public void setIndentStrategy(String indentStrategy) {
- fIndentStrategy = indentStrategy;
- }
-
- public String getWhitespaceStrategy() {
- return fWhitespaceStrategy;
- }
-
- public void setWhitespaceStrategy(String whitespaceStrategy) {
- fWhitespaceStrategy = whitespaceStrategy;
- }
-
- public boolean isIndentStrategyAHint() {
- return fIsIndentStrategyAHint;
- }
-
- public void setIsIndentStrategyAHint(boolean isIndentStrategyAHint) {
- fIsIndentStrategyAHint = isIndentStrategyAHint;
- }
-
- public boolean isWhitespaceStrategyAHint() {
- return fIsWhitespaceStrategyAHint;
- }
-
- public void setIsWhitespaceStrategyAHint(boolean isWhitespaceStrategyAHint) {
- fIsWhitespaceStrategyAHint = isWhitespaceStrategyAHint;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
deleted file mode 100644
index 61c1b46fb0..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
+++ /dev/null
@@ -1,179 +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.wst.xml.core.internal.formatter;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-
-public class XMLFormattingPreferences {
- public final static String PRESERVE = XMLFormattingConstraints.PRESERVE;
- public final static String COLLAPSE = XMLFormattingConstraints.COLLAPSE;
- public final static String IGNORE = XMLFormattingConstraints.IGNORE;
-
- public final static String INDENT = XMLFormattingConstraints.INDENT;
- public final static String NEW_LINE = XMLFormattingConstraints.NEW_LINE;
- public final static String INLINE = XMLFormattingConstraints.INLINE;
-
- private int fMaxLineWidth = 72;
- private boolean fAlignFinalBracket = false;
- private boolean fSpaceBeforeEmptyCloseTag = true;
- private boolean fIndentMultipleAttributes = false;
- private boolean fFormatCommentText = true;
- private boolean fJoinCommentLines = false;
-
- private String fPCDataWhitespaceStrategy = XMLFormattingConstraints.PRESERVE;
- private String fTextIndentStrategy = XMLFormattingConstraints.INLINE;
- private String fTextWhitespaceStrategy = XMLFormattingConstraints.COLLAPSE;
- private String fElementIndentStrategy = XMLFormattingConstraints.INDENT;
- private String fElementWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
- private String fMixedIndentStrategy = XMLFormattingConstraints.INDENT;
- private String fMixedWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
- private String fOneIndent = "\t"; //$NON-NLS-1$
- private boolean fClearAllBlankLines = false;
-
- public XMLFormattingPreferences() {
- Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- setFormatCommentText(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
- setJoinCommentLines(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
-
- setMaxLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
- setIndentMultipleAttributes(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- setAlignFinalBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
- setSpaceBeforeEmptyCloseTag(preferences.getBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
-
- boolean preservepcdata = preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT);
- if (preservepcdata)
- fPCDataWhitespaceStrategy = XMLFormattingPreferences.PRESERVE;
- else
- fPCDataWhitespaceStrategy = XMLFormattingPreferences.COLLAPSE;
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
- if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- setOneIndent(indent.toString());
- setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
- }
- }
-
- public int getMaxLineWidth() {
- return fMaxLineWidth;
- }
-
- public boolean getFormatCommentText() {
- return fFormatCommentText;
- }
-
- public boolean getAlignFinalBracket() {
- return fAlignFinalBracket;
- }
-
- public boolean getSpaceBeforeEmptyCloseTag() {
- return fSpaceBeforeEmptyCloseTag;
- }
-
- public boolean getIndentMultipleAttributes() {
- return fIndentMultipleAttributes;
- }
-
- public String getPCDataWhitespaceStrategy() {
- return fPCDataWhitespaceStrategy;
- }
-
- public String getTextIndentStrategy() {
- return fTextIndentStrategy;
- }
-
- public String getTextWhitespaceStrategy() {
- return fTextWhitespaceStrategy;
- }
-
- public String getElementIndentStrategy() {
- return fElementIndentStrategy;
- }
-
- public String getElementWhitespaceStrategy() {
- return fElementWhitespaceStrategy;
- }
-
- public boolean getJoinCommentLines() {
- return fJoinCommentLines;
- }
-
- public void setJoinCommentLines(boolean joinCommentLines) {
- fJoinCommentLines = joinCommentLines;
- }
-
- public void setFormatCommentText(boolean formatCommentText) {
- fFormatCommentText = formatCommentText;
- }
-
- public void setSpaceBeforeEmptyCloseTag(boolean spaceBeforeEmptyCloseTag) {
- fSpaceBeforeEmptyCloseTag = spaceBeforeEmptyCloseTag;
- }
-
- public void setIndentMultipleAttributes(boolean indentMultipleAttributes) {
- fIndentMultipleAttributes = indentMultipleAttributes;
- }
-
- public void setPCDataWhitespaceStrategy(String dataWhitespaceStrategy) {
- fPCDataWhitespaceStrategy = dataWhitespaceStrategy;
- }
-
- public void setAlignFinalBracket(boolean alignFinalBracket) {
- fAlignFinalBracket = alignFinalBracket;
- }
-
- public String getMixedIndentStrategy() {
- return fMixedIndentStrategy;
- }
-
- public void setMixedIndentStrategy(String mixedIndentStrategy) {
- fMixedIndentStrategy = mixedIndentStrategy;
- }
-
- public String getMixedWhitespaceStrategy() {
- return fMixedWhitespaceStrategy;
- }
-
- public void setMixedWhitespaceStrategy(String mixedWhitespaceStrategy) {
- fMixedWhitespaceStrategy = mixedWhitespaceStrategy;
- }
-
- public String getOneIndent() {
- return fOneIndent;
- }
-
- protected void setMaxLineWidth(int maxLineWidth) {
- fMaxLineWidth = maxLineWidth;
- }
-
- protected void setOneIndent(String oneIndent) {
- fOneIndent = oneIndent;
- }
-
- public boolean getClearAllBlankLines() {
- return fClearAllBlankLines;
- }
-
- public void setClearAllBlankLines(boolean clearAllBlankLines) {
- fClearAllBlankLines = clearAllBlankLines;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
deleted file mode 100644
index abff1a4b8a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedXML;
-
-
-public class EmbeddedXML implements EmbeddedTypeHandler {
-
- private static List supportedMimeTypes;
- public String ContentTypeID_EmbeddedXML = "org.eclipse.wst.xml.core.contenttype.EmbeddedXML"; //$NON-NLS-1$
-
- /**
- * Constructor for EmbeddedXML.
- */
- public EmbeddedXML() {
- super();
- }
-
- /*
- * @see EmbeddedContentType#getAdapterFactories()
- */
- public List getAdapterFactories() {
- List factories = new ArrayList();
- factories.add(new ModelQueryAdapterFactoryForEmbeddedXML());
- // factories.addAll(PluginContributedFactoryReader.getInstance().getFactories(this));
- return factories;
- }
-
- /**
- * @see EmbeddedContentType#getFamilyId()
- */
- public String getFamilyId() {
- return ModelHandlerForXML.AssociatedContentTypeID;
- }
-
- public List getSupportedMimeTypes() {
- if (supportedMimeTypes == null) {
- supportedMimeTypes = new ArrayList();
- supportedMimeTypes.add("application/xml"); //$NON-NLS-1$
- supportedMimeTypes.add("text/xml"); //$NON-NLS-1$
- }
- return supportedMimeTypes;
- }
-
- public void initializeFactoryRegistry(FactoryRegistry registry) {
- //TODO: initialize
- }
-
- public void initializeParser(RegionParser parser) {
- // nothing to initialize for "pure" XML
- // compare with XHTML
- }
-
- public boolean isDefault() {
- return false;
- }
-
- public EmbeddedTypeHandler newInstance() {
- return new EmbeddedXML();
- }
-
- public void uninitializeFactoryRegistry(FactoryRegistry registry) {
- // TODO: need to undo anything we did in initialize
-
- }
-
- public void uninitializeParser(RegionParser parser) {
- // need to undo anything we did in initialize
- }
-
- public boolean canHandleMimeType(String mimeType) {
- boolean canHandle = getSupportedMimeTypes().contains(mimeType);
- if(!canHandle) {
- canHandle = mimeType.endsWith("+xml"); //$NON-NLS-1$
- }
- return canHandle;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java
deleted file mode 100644
index f4bdf3c8be..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java
+++ /dev/null
@@ -1,59 +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.xml.core.internal.modelhandler;
-
-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;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentLoader;
-
-
-/**
- * Provides generic XML model handling. It is also marked as the default
- * content type handler. There should be only one implementation of the
- * default.
- */
-public class ModelHandlerForXML 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.core.runtime.xml"; //$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.xml.core.modelhandler"; //$NON-NLS-1$
-
- public ModelHandlerForXML() {
- super();
- setId(ModelHandlerID);
- setAssociatedContentTypeId(AssociatedContentTypeID);
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new XMLDocumentLoader();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new XMLDocumentCharsetDetector();
- }
-
- public IModelLoader getModelLoader() {
- return new XMLModelLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java
deleted file mode 100644
index ecf9223690..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java
+++ /dev/null
@@ -1,93 +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.xml.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-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.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.DebugAdapterFactory;
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForXML;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-/**
- * This class reads an XML file and creates an XML Structured Model.
- *
- */
-public class XMLModelLoader extends AbstractModelLoader {
-
- // private static final String STR_ENCODING = "encoding"; //$NON-NLS-1$
-
- /**
- * XMLLoader constructor comment.
- */
- public XMLModelLoader() {
- super();
- }
-
- public List getAdapterFactories() {
- List result = new ArrayList();
- INodeAdapterFactory factory = null;
- factory = new ModelQueryAdapterFactoryForXML();
- result.add(factory);
- // Does XML need propagating adapter? Or just JSP?
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
- return result;
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new XMLDocumentLoader();
- }
- return documentLoaderInstance;
- }
-
- public IModelLoader newInstance() {
- return new XMLModelLoader();
- }
-
- public IStructuredModel newModel() {
- return new DOMModelImpl();
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- super.preLoadAdapt(structuredModel);
- IDOMModel domModel = (IDOMModel) structuredModel;
- // if there is a model in the adapter, this will adapt it to
- // first node. After that the PropagatingAdater spreads over the
- // children being
- // created. Each time that happends, a side effect is to
- // also "spread" sprecific registered adapters,
- // they two can propigate is needed.
- ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
-
- if (Debug.debugNotificationAndEvents) {
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java
deleted file mode 100644
index 805a9c1a23..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java
+++ /dev/null
@@ -1,50 +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.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-
-
-public class ModelQueryAdapterFactoryForEmbeddedXML extends ModelQueryAdapterFactoryForXML {
-
-
- /**
- * Constructor for ModelQueryAdapterFactoryForEmbeddedXML.
- */
- public ModelQueryAdapterFactoryForEmbeddedXML() {
- super(ModelQueryAdapter.class, false);
- }
-
- protected void configureDocumentManager(CMDocumentManager mgr) {
- super.configureDocumentManager(mgr);
- mgr.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
- }
-
- /**
- * ISSUE: this "forces" a new one to always be created/returned,
- * not "cached" on the node. That seems incorrect.
- * Simply using shouldRegisterFalse should work, except,
- * there might have been one there that someone else already
- * explicitly put there, so this is only way I know to
- * override that. Especially complicated here since a number
- * of adapters are for ModelQueryAdapter.class.
- */
- public INodeAdapter adapt(INodeNotifier object) {
- return adaptNew(object);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java
deleted file mode 100644
index cbb4add74b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import java.io.File;
-import java.net.URI;
-
-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.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapterImpl;
-
-
-public class ModelQueryAdapterFactoryForXML extends AbstractAdapterFactory {
-
- protected ModelQueryAdapterImpl modelQueryAdapterImpl;
- IStructuredModel stateNotifier = null;
- private InternalModelStateListener internalModelStateListener;
-
- /**
- * ModelQueryAdapterFactoryForXML constructor comment.
- */
- public ModelQueryAdapterFactoryForXML() {
- this(ModelQueryAdapter.class, true);
- }
-
- /**
- * ModelQueryAdapterFactoryForXML constructor comment.
- *
- * @param adapterKey
- * java.lang.Object
- * @param registerAdapters
- * boolean
- */
- protected ModelQueryAdapterFactoryForXML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- class InternalModelStateListener implements IModelStateListener {
-
- /**
- * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
- */
- public void modelAboutToBeChanged(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelChanged(IStructuredModel)
- */
- public void modelChanged(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
- * boolean)
- */
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- }
-
- /**
- * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
- */
- public void modelResourceDeleted(IStructuredModel model) {
- }
-
- /**
- * @see IModelStateListener#modelResourceMoved(IStructuredModel,
- * IStructuredModel)
- */
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- stateNotifier.removeModelStateListener(this);
- stateNotifier = newModel;
- updateResolver(stateNotifier);
- stateNotifier.addModelStateListener(this);
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- // TODO Auto-generated method stub
-
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- updateResolver(structuredModel);
-
- }
-
-
- }
-
- protected boolean autoLoadCM() {
- // until the existence of a CMDocumentRequesterFactory to create the
- // load requests,
- // return true
- return true;
- }
-
- protected void configureDocumentManager(CMDocumentManager mgr) {
- // this depends on there being a CMDocumentRequesterFactory installed
- mgr.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, autoLoadCM());
- }
-
- public INodeAdapterFactory copy() {
-
- return new ModelQueryAdapterFactoryForXML(getAdapterKey(), isShouldRegisterAdapter());
- }
-
- /**
- * createAdapter method comment.
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
-
- if (org.eclipse.wst.sse.core.internal.util.Debug.displayInfo)
- System.out.println("-----------------------ModelQueryAdapterFactoryForXML.createAdapter" + target); //$NON-NLS-1$
- if (modelQueryAdapterImpl == null) {
- if (target instanceof IDOMNode) {
- IDOMNode xmlNode = (IDOMNode) target;
- IStructuredModel model = xmlNode.getModel();
- stateNotifier = xmlNode.getModel();
- stateNotifier.addModelStateListener(getInternalModelStateListener());
-
- org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
- if (Debug.displayInfo)
- System.out.println("----------------ModelQueryAdapterFactoryForXML... baseLocation : " + resolver.getFileBaseLocation()); //$NON-NLS-1$
-
- /**
- * XMLCatalogIdResolver currently requires a filesystem
- * location string. Customarily this will be what is in the
- * deprecated SSE URIResolver and required by the Common URI
- * Resolver.
- */
- URIResolver idResolver = null;
- if (resolver != null) {
- idResolver = new XMLCatalogIdResolver(resolver.getFileBaseLocation(), resolver);
- }
- else {
- /*
- * 203649 - this block may be necessary due to ordering of
- * setting the resolver into the model
- */
- String baseLocation = null;
- String modelsBaseLocation = model.getBaseLocation();
- if (modelsBaseLocation != null) {
- File file = new Path(modelsBaseLocation).toFile();
- if (file.exists()) {
- baseLocation = file.getAbsolutePath();
- }
- else {
- IPath basePath = new Path(model.getBaseLocation());
- IResource derivedResource = null;
- if (basePath.segmentCount() > 1)
- derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- else
- derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
- IPath derivedPath = derivedResource.getLocation();
- if (derivedPath != null) {
- baseLocation = derivedPath.toString();
- }
- else {
- URI uri = derivedResource.getLocationURI();
- if (uri != null) {
- baseLocation = uri.toString();
- }
- }
- }
- if(baseLocation == null) {
- baseLocation = modelsBaseLocation;
- }
- }
- idResolver = new XMLCatalogIdResolver(baseLocation, null);
- }
-
- CMDocumentCache cmDocumentCache = new CMDocumentCache();
- ModelQuery modelQuery = new XMLModelQueryImpl(cmDocumentCache, idResolver);
-
- // cs todo...
- // for now we create a CMDocumentCache on a 'per editor' basis
- // in the future we need to support a CMDocumentCache that is
- // shared between editors
- // nsd comment: may not be appropriate depending on
- CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
- if (documentManager != null) {
- configureDocumentManager(documentManager);
- }
- modelQueryAdapterImpl = new ModelQueryAdapterImpl(cmDocumentCache, modelQuery, idResolver);
- }
- }
- return modelQueryAdapterImpl;
- }
-
- public void release() {
- super.release();
- if (stateNotifier != null)
- stateNotifier.removeModelStateListener(getInternalModelStateListener());
- stateNotifier = null;
- if (modelQueryAdapterImpl != null)
- modelQueryAdapterImpl.release();
- }
-
- protected void updateResolver(IStructuredModel model) {
-
- String baseLocation = model.getBaseLocation();
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- if (baseFile != null) {
- if (baseFile.getLocation() != null) {
- baseLocation = baseFile.getLocation().toString();
- }
- if (baseLocation == null && baseFile.getLocationURI() != null) {
- baseLocation = baseFile.getLocationURI().toString();
- }
- if (baseLocation == null) {
- baseLocation = baseFile.getFullPath().toString();
- }
- }
- else {
- baseLocation = model.getBaseLocation();
- }
- modelQueryAdapterImpl.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
- }
-
- private final InternalModelStateListener getInternalModelStateListener() {
- if (internalModelStateListener == null) {
- internalModelStateListener = new InternalModelStateListener();
- }
- return internalModelStateListener;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java
deleted file mode 100644
index eae3e89082..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java
+++ /dev/null
@@ -1,64 +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.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-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.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Document;
-
-
-/**
- * This class is used to associate ModelQuery (and related data) with a
- * Document (or IStructuredModel).
- */
-public class ModelQueryUtil {
-
- public static CMDocumentCache getCMDocumentCache(Document node) {
- ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
- return modelQueryAdapter != null ? modelQueryAdapter.getCMDocumentCache() : null;
- }
-
- public static URIResolver getIdResolver(Document node) {
- ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
- return modelQueryAdapter != null ? modelQueryAdapter.getIdResolver() : null;
- }
-
- public static ModelQuery getModelQuery(Document node) {
- ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(node);
- return modelQueryAdapter != null ? modelQueryAdapter.getModelQuery() : null;
- }
-
- public static ModelQuery getModelQuery(IStructuredModel model) {
- if ((!(model instanceof IDOMModel)) || model == null)
- return null;
- return getModelQuery(((IDOMModel) model).getDocument());
- }
-
- public static ModelQueryAdapter getModelQueryAdapter(Document node) {
- ModelQueryAdapter result = null;
-
- if (node instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) node;
- result = (ModelQueryAdapter) notifier.getAdapterFor(ModelQueryAdapter.class);
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
deleted file mode 100644
index 61852f9ab6..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-// TODO cs : remove this class and utilize the common URIResolver directly
-// We need to update some of the ModelQuery related code to pass the
-// 'baseLocation' thru
-// and then there'll be node need for this class.
-//
-public class XMLCatalogIdResolver implements org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver {
- protected String resourceLocation;
-
- protected URIResolver uriresolver;
-
- private XMLCatalogIdResolver() {
- super();
- }
-
- private XMLCatalogIdResolver(String resourceLocation) {
- this();
- this.resourceLocation = resourceLocation;
- }
-
- public XMLCatalogIdResolver(String resourceLocation, URIResolver uriresolver) {
- this(resourceLocation);
-// this constructor should not be called with two null arguments.
-// If so, an assert will occur later when resolve is called.
-// See 118371 XMLCatalogIdResolver#resolve throws AssertionFailedException
-//
-// but, I'm not enabling this check now due to lateness in cycle.
-// if (resourceLocation == null && uriresolver == null) {
-// throw new IllegalArgumentException("both location and resolver can not be null");
-// }
- this.uriresolver = uriresolver;
- }
-
-
- /**
- * Gets the resourceLocation.
- *
- * @return Returns a String
- */
- private String getResourceLocation() {
- String location = resourceLocation;
- if (location == null) {
- if (uriresolver != null)
- location = uriresolver.getFileBaseLocation();
- }
- return location;
- }
-
-
- public String resolve(String base, String publicId, String systemId) {
-
- String result = systemId;
- if (base == null) {
- base = getResourceLocation();
- // bug 117320, ensure base URI is 'protocal' qualified before
- // passing it thru to URIResolver
- // bug 117424, we should be able to assume that the base location
- // is non-null
-
- /**
- * We shouldn't assert a failure because the catalog does not
- * require a base location to operate and it will be called from
- * non-file-based scenarios.
- *
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=206176
- */
- // Assert.isNotNull(base, "Base location is expected to be non null."); //$NON-NLS-1$
- if (base != null) {
- base = URIHelper.addImpliedFileProtocol(base);
- }
- }
- result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
- return result;
- }
-
- public String resolvePhysicalLocation(String baseLocation, String publicId, String logicalLocation) {
- // This class should never be called to perform physical resolution!
- // If it does we should log it as an error
- Logger.log(Logger.ERROR_DEBUG, "XMLCatalogIDResolver.resolvePhysicalLocation() called unexpectedly"); //$NON-NLS-1$
- return logicalLocation;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java
deleted file mode 100644
index 74d14abb92..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-
-/**
- * XMLModelQueryAssociationProvider
- *
- * This added and/or made public specifically for experimentation. It will
- * change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- *
- */
-public class XMLModelQueryAssociationProvider extends XMLAssociationProvider {
-
- protected URIResolver idResolver;
-
- public XMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
- super(cache);
- this.idResolver = idResolver;
- }
-
- protected String resolveGrammarURI(Document document, String publicId, String systemId) {
-
- // CS : spooky code alert!
- // this look really strange because we're passing null in as the first
- // argument
- // however we're assuming the use of a 'fudged' URIResolver that knows
- // the
- // correct baseLocation and will call to the URIResolver framework
- // properly
-
- // CS : note that we should never call resolvePhysical at this point.
- // Physical resolution should only occur when we're interesting to
- // opening the actual stream.
- // The CMDocumentFactory implementation would be responsible for
- // calling resolvePhysical.
- // All we need to do here is return a 'logical' URI
-
- if (idResolver == null)
- return null;
- return idResolver.resolve(null, publicId, systemId);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java
deleted file mode 100644
index 7bfa0014f0..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java
+++ /dev/null
@@ -1,38 +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.xml.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;
-
-
-public class XMLModelQueryImpl extends ModelQueryImpl implements MovableModelQuery {
-
- protected CMDocumentCache fCache = null;
-
- public XMLModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
- super(new XMLModelQueryAssociationProvider(cache, idResolver));
- fCache = cache;
- }
-
- /**
- * @see MovableModelQuery#setIdResolver(URIResolver)
- */
- public void setIdResolver(URIResolver newIdResolver) {
- modelQueryAssociationProvider = new XMLModelQueryAssociationProvider(fCache, newIdResolver);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.java
deleted file mode 100644
index 7754a80622..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/BlockStructuredDocumentRegion.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.IBlockedStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-
-public class BlockStructuredDocumentRegion extends BasicStructuredDocumentRegion implements IBlockedStructuredDocumentRegion {
-
- private String partitionType;
-
- /**
- * A BlockStructuredDocumentRegion is like a IStructuredDocumentRegion,
- * but is the result of a "block scan".
- */
- public BlockStructuredDocumentRegion() {
- super();
- }
-
- public String getPartitionType() {
- if (partitionType == null) {
- // eventually can look up surroundingTag name
- // but this field is primarily entended for future
- // extensibility. This may change.
- //partitionType = "org.eclipse.wst.sse.core." + tagname;
- }
- return partitionType;
- }
-
- public void setPartitionType(String partitionType) {
- this.partitionType = partitionType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
deleted file mode 100644
index 0de33025b0..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import org.eclipse.jface.text.BadLocationException;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-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.internal.text.TextRegionListImpl;
-import org.eclipse.wst.xml.core.internal.Logger;
-
-
-public class ContextRegionContainer implements ITextRegionContainer {
- protected int length;
- protected ITextRegionCollection parent;
- protected ITextRegionList regions;
- protected int start;
- protected int textLength;
- protected String type;
-
- public ContextRegionContainer() {
- super();
- regions = new TextRegionListImpl();
-
- }
-
- /**
- * these "deep" parenting is not normal, but just in case.
- */
- private IStructuredDocument _getParentDocument() {
- // go up enough parents to get to document
- ITextRegionCollection parent = getParent();
- while (!(parent instanceof IStructuredDocumentRegion)) {
- // would be an error not to be container, but
- // won't check for it now
- parent = ((ITextRegionContainer) parent).getParent();
- }
- return ((IStructuredDocumentRegion) parent).getParentDocument();
- }
-
-
- public void adjust(int i) {
-
- start += i;
- // I erroneously added length and textLength
- // TODO: may want to rename this method to adjustStart
- //length += i;
- //textLength += i;
-
- }
-
- public void adjustLength(int i) {
- length += i;
- }
-
- public void adjustStart(int i) {
- start += i;
- }
-
-
- public void adjustTextLength(int i) {
- textLength += i;
-
- }
-
- public boolean containsOffset(int i) {
-
- return getStartOffset() <= i && i < getEndOffset();
- }
-
- public boolean containsOffset(ITextRegion containedRegion, int offset) {
- return getStartOffset(containedRegion) <= offset && offset < getEndOffset(containedRegion);
- }
-
- /**
- * This method is just to equate positions. clients may (will probably)
- * still need to make calls to equate regions, parent, etc.
- */
- public void equatePositions(ITextRegion region) {
- start = region.getStart();
- length = region.getLength();
- textLength = region.getTextLength();
- }
-
- public int getEnd() {
- return start + length;
- }
-
- public int getEndOffset() {
- // our startOffset take into account our parent, and our start
- return getStartOffset() + getLength();
- }
-
- public int getEndOffset(ITextRegion containedRegion) {
- return getStartOffset(containedRegion) + containedRegion.getLength();
- }
-
- public ITextRegion getFirstRegion() {
- return getRegions().get(0);
- }
-
- public String getFullText() {
- return getParent().getFullText(this);
- }
-
- public String getFullText(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion aRegion) {
- // Must be proxied here since aRegion should always be a child of
- // *this* container and indexed from
- // this container's offset
- return parent.getFullText().substring(start + aRegion.getStart(), start + aRegion.getEnd());
- }
-
- public ITextRegion getLastRegion() {
- return getRegions().get(getRegions().size() - 1);
- }
-
- public int getLength() {
- return length;
- }
-
-
- public int getNumberOfRegions() {
- return getRegions().size();
- }
-
- public ITextRegionCollection getParent() {
- return parent;
- }
-
- /**
- * The parameter offset refers to the overall offset in the document.
- */
- public ITextRegion getRegionAtCharacterOffset(int offset) {
- ITextRegion result = null;
- if (regions != null) {
- int thisStartOffset = getStartOffset();
- if (offset < thisStartOffset)
- return null;
- int thisEndOffset = getStartOffset() + getLength();
- if (offset > thisEndOffset)
- return null;
- // transform the requested offset to the "scale" that
- // regions are stored in, which are all relative to the
- // start point.
- //int transformedOffset = offset - getStartOffset();
- //
- ITextRegionList regions = getRegions();
- int length = regions.size();
- int low = 0;
- int high = length;
- int mid = 0;
- // Binary search for the region
- while (low < high) {
- mid = low + ((high - low) >> 1);
- ITextRegion region = regions.get(mid);
- if (org.eclipse.wst.sse.core.internal.util.Debug.debugStructuredDocument) {
- System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
- System.out.println(" midpoint of search:" + mid); //$NON-NLS-1$
- System.out.println(" requested offset: " + offset); //$NON-NLS-1$
- //System.out.println(" transformedOffset: " +
- // transformedOffset); //$NON-NLS-1$
- System.out.println(" region start: " + region.getStart()); //$NON-NLS-1$
- System.out.println(" region end: " + region.getEnd()); //$NON-NLS-1$
- System.out.println(" region type: " + region.getType()); //$NON-NLS-1$
- System.out.println(" region class: " + region.getClass()); //$NON-NLS-1$
-
- }
- // Region is before this one
- if (offset < region.getStart() + thisStartOffset)
- high = mid;
- else if (offset > (region.getEnd() + thisStartOffset - 1))
- low = mid + 1;
- else
- return region;
- }
- return null;
- }
- return result;
- }
-
- public ITextRegionList getRegions() {
- return regions;
- }
-
- public int getStart() {
- return start;
- }
-
- public int getStartOffset() {
- return getParent().getStartOffset() + getStart();
- }
-
- public int getStartOffset(ITextRegion containedRegion) {
- // it is an error to pass null to this method
- // ISSUE: need better "spec" on error behavior:
- // for now will return zero as this will roughly
- // work for some cases (and avoid NPE).
- if (containedRegion == null) {
- return getStartOffset();
- }
- return getStartOffset() + containedRegion.getStart();
- }
-
- /**
- * same as getFullText for this region type ... do we need to take white
- * space off?
- */
-
- public String getText() {
- String result = null;
- try {
- IStructuredDocument parentDocument = _getParentDocument();
- result = parentDocument.get(start, length);
- } catch (BadLocationException e) {
- Logger.logException("program error: unreachable exception", e); //$NON-NLS-1$
- }
- return result;
- }
-
- public String getText(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion aRegion) {
- // Must be proxied here since aRegion should always be a child of
- // *this* container and indexed from
- // this container's offset
- return parent.getText().substring(start + aRegion.getStart(), start + aRegion.getTextEnd());
- }
-
- public int getTextEnd() {
- return start + textLength;
- }
-
- public int getTextEndOffset() {
- ITextRegion region = regions.get(regions.size() - 1);
- // our startOffset take into account our parent, and our start
- // (pa) 10/4 changed to be based on text end
- // it used to return incorrect value for embedded region containers
- //
-
- // TODO CRITICAL -- need to re-work this work around, so doesn't
- // depend on XMLRegionContext
- // // this is a workaround for 226823///////////
- // for (int i = regions.size() - 1; i >= 0 && region.getType() ==
- // XMLRegionContext.WHITE_SPACE; i--)
- // region = (ITextRegion) regions.get(i);
- // /////////////////////////////////////////////
-
- return getStartOffset() + region.getTextEnd();
- }
-
- public int getTextEndOffset(ITextRegion containedRegion) {
- int result = 0;
- if (regions != null) {
- int length = getRegions().size();
- for (int i = 0; i < length; i++) {
- ITextRegion region = getRegions().get(i);
- if (region == containedRegion) {
- result = getStartOffset(region) + region.getTextEnd();
- break;
- }
- }
- }
- return result;
- }
-
- public int getTextLength() {
- return textLength;
- }
-
- public String getType() {
- return type;
- }
-
- public void setLength(int i) {
- length = i;
- }
-
- public void setParent(ITextRegionCollection parentRegion) {
- parent = parentRegion;
- }
-
- public void setRegions(ITextRegionList containedRegions) {
- regions = containedRegions;
- }
-
- public void setStart(int i) {
- start = i;
- }
-
- public void setTextLength(int i) {
- textLength = i;
- }
-
- public void setType(String string) {
- type = string;
- }
-
- public String toString() {
- String className = getClass().getName();
- String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
- String result = "Container!!! " + shortClassName + "--> " + getType() + ": " + getStart() + "-" + getTextEnd() + (getTextEnd() != getEnd() ? ("/" + getEnd()) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- return result;
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent result = null;
- // FUTURE_TO_DO: need to implement region level parsing in
- // ITextRegionContainer::updateModel
- // never being called?
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
deleted file mode 100644
index 5cb8d5a6f8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-/*
- *
- * 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 boolean empty() {
- return size == 0;
- }
-
- public int get(int slot) {
- return list[slot];
- }
-
- 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 size;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
- for (int i = 0; i < size; i++) {
- s.append(list[i]);
- if(i < size - 1) {
- s.append(", ");
- }
- }
- s.append("]");
- return s.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java
deleted file mode 100644
index 1315a77980..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/RegionFactory.java
+++ /dev/null
@@ -1,49 +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.xml.core.internal.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-
-
-public class RegionFactory {
-
- public RegionFactory() {
- super();
- }
-
- public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length) {
- return this.createToken(parent, context, start, textLength, length, null, null);
- }
-
- public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length, String lang, String surroundingTag) {
- ITextRegion newRegion = createToken(context, start, textLength, length);
- // DW, 4/16/2003 token regions no longer have parents
- //newRegion.setParent(parent);
- return newRegion;
- }
-
- public ITextRegion createToken(String context, int start, int textLength, int length) {
- return this.createToken(context, start, textLength, length, null, null);
- }
-
- public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) {
- ITextRegion newRegion = new ContextRegion(context, start, textLength, length);
- return newRegion;
-
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
deleted file mode 100644
index 34faaec6ef..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 2/25/08 10:25 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
- * kb.huang - Bug 214416 Dot char is not escaped in XML10Names.jFlex
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 2/25/08 10:25 AM from the specification file
- * <tt>XML10Names.jflex</tt>
- */
-public final class XML10Names {
-
- /** This character denotes the end of file */
- private static final int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- private static final int ZZ_BUFFERSIZE = 2048;
-
- /** lexical states */
- private static final int YYINITIAL = 0;
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\12\0\1\3\42\0\1\2\1\2\1\0\12\2\1\1\6\0\32\1"+
- "\4\0\1\1\1\0\32\1\74\0\1\2\10\0\27\1\1\0\37\1"+
- "\1\0\72\1\2\0\13\1\2\0\10\1\1\0\65\1\1\0\104\1"+
- "\11\0\44\1\3\0\2\1\4\0\36\1\70\0\131\1\22\0\7\1"+
- "\16\0\2\2\56\0\106\2\32\0\2\2\44\0\1\1\1\2\3\1"+
- "\1\0\1\1\1\0\24\1\1\0\54\1\1\0\7\1\3\0\1\1"+
- "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\22\1\15\0\14\1"+
- "\1\0\102\1\1\0\14\1\1\0\44\1\1\0\4\2\11\0\65\1"+
- "\2\0\2\1\2\0\2\1\3\0\34\1\2\0\10\1\2\0\2\1"+
- "\67\0\46\1\2\0\1\1\7\0\46\1\12\0\21\2\1\0\27\2"+
- "\1\0\3\2\1\0\1\2\1\0\2\2\1\0\1\2\13\0\33\1"+
- "\5\0\3\1\56\0\32\1\5\0\1\2\12\1\10\2\15\0\12\2"+
- "\6\0\1\2\107\1\2\0\5\1\1\0\17\1\1\0\4\1\1\0"+
- "\1\1\17\2\2\1\2\2\1\0\4\2\2\0\12\2\u0207\0\3\2"+
- "\1\0\65\1\2\0\1\2\1\1\20\2\3\0\4\2\3\0\12\1"+
- "\2\2\2\0\12\2\21\0\3\2\1\0\10\1\2\0\2\1\2\0"+
- "\26\1\1\0\7\1\1\0\1\1\3\0\4\1\2\0\1\2\1\0"+
- "\7\2\2\0\2\2\2\0\3\2\11\0\1\2\4\0\2\1\1\0"+
- "\3\1\2\2\2\0\12\2\2\1\20\0\1\2\2\0\6\1\4\0"+
- "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1\1\0"+
- "\2\1\2\0\1\2\1\0\5\2\4\0\2\2\2\0\3\2\13\0"+
- "\4\1\1\0\1\1\7\0\12\2\2\2\3\1\14\0\3\2\1\0"+
- "\7\1\1\0\1\1\1\0\3\1\1\0\26\1\1\0\7\1\1\0"+
- "\2\1\1\0\5\1\2\0\1\2\1\1\10\2\1\0\3\2\1\0"+
- "\3\2\22\0\1\1\5\0\12\2\21\0\3\2\1\0\10\1\2\0"+
- "\2\1\2\0\26\1\1\0\7\1\1\0\2\1\2\0\4\1\2\0"+
- "\1\2\1\1\6\2\3\0\2\2\2\0\3\2\10\0\2\2\4\0"+
- "\2\1\1\0\3\1\4\0\12\2\22\0\2\2\1\0\6\1\3\0"+
- "\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1\3\0"+
- "\2\1\3\0\3\1\3\0\10\1\1\0\3\1\4\0\5\2\3\0"+
- "\3\2\1\0\4\2\11\0\1\2\17\0\11\2\21\0\3\2\1\0"+
- "\10\1\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\4\0"+
- "\7\2\1\0\3\2\1\0\4\2\7\0\2\2\11\0\2\1\4\0"+
- "\12\2\22\0\2\2\1\0\10\1\1\0\3\1\1\0\27\1\1\0"+
- "\12\1\1\0\5\1\4\0\7\2\1\0\3\2\1\0\4\2\7\0"+
- "\2\2\7\0\1\1\1\0\2\1\4\0\12\2\22\0\2\2\1\0"+
- "\10\1\1\0\3\1\1\0\27\1\1\0\20\1\4\0\6\2\2\0"+
- "\3\2\1\0\4\2\11\0\1\2\10\0\2\1\4\0\12\2\221\0"+
- "\56\1\1\0\1\1\1\2\2\1\7\2\5\0\6\1\1\2\10\2"+
- "\1\0\12\2\47\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1"+
- "\2\0\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1"+
- "\1\0\1\1\2\0\2\1\1\0\2\1\1\0\1\1\1\2\2\1"+
- "\6\2\1\0\2\2\1\1\2\0\5\1\1\0\1\2\1\0\6\2"+
- "\2\0\12\2\76\0\2\2\6\0\12\2\13\0\1\2\1\0\1\2"+
- "\1\0\1\2\4\0\2\2\10\1\1\0\41\1\7\0\24\2\1\0"+
- "\6\2\4\0\6\2\1\0\1\2\1\0\25\2\3\0\7\2\1\0"+
- "\1\2\346\0\46\1\12\0\47\1\11\0\1\1\1\0\2\1\1\0"+
- "\3\1\1\0\1\1\1\0\2\1\1\0\5\1\51\0\1\1\1\0"+
- "\1\1\1\0\1\1\13\0\1\1\1\0\1\1\1\0\1\1\3\0"+
- "\2\1\3\0\1\1\5\0\3\1\1\0\1\1\1\0\1\1\1\0"+
- "\1\1\1\0\1\1\3\0\2\1\3\0\2\1\1\0\1\1\50\0"+
- "\1\1\11\0\1\1\2\0\1\1\2\0\2\1\7\0\2\1\1\0"+
- "\1\1\1\0\7\1\50\0\1\1\4\0\1\1\10\0\1\1\u0c06\0"+
- "\234\1\4\0\132\1\6\0\26\1\2\0\6\1\2\0\46\1\2\0"+
- "\6\1\2\0\10\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+
- "\37\1\2\0\65\1\1\0\7\1\1\0\1\1\3\0\3\1\1\0"+
- "\7\1\3\0\4\1\2\0\6\1\4\0\15\1\5\0\3\1\1\0"+
- "\7\1\323\0\15\2\4\0\1\2\104\0\1\1\3\0\2\1\2\0"+
- "\1\1\121\0\3\1\u0e82\0\1\2\1\0\1\1\31\0\11\1\6\2"+
- "\1\0\5\2\13\0\124\1\4\0\2\2\2\0\2\2\2\0\132\1"+
- "\1\0\3\2\6\0\50\1\u1cd3\0\u51a6\1\u0c5a\0\u2ba4\1\u285c\0";
-
- /**
- * 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 =
- "\1\0\1\1\1\2\1\3";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[4];
- 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\4\0\10\0\14";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[4];
- 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 [] = {
- 1, 2, 1, -1, -1, -1, -1, -1, 3, 2,
- 2, -1, 3, 3, 3, -1
- };
-
- /* 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 =
- "\1\0\1\11\2\1";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[4];
- 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 textposition at the last state to be included in yytext */
- //private int zzPushbackPos;
-
- /** 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: */
- boolean result;
- /**
- * Creates a new scanner
- */
- public XML10Names() {
- this.zzReader = null;
- }
-
- public boolean isValidXML10Name(String stringToCheck) {
- boolean result = false;
- yyreset(new java.io.StringReader(stringToCheck));
- try {
- result = isValidXML10Name();
- }
- catch (java.io.IOException e) {
- // should be impossible with strings, but if occurs, just means
- // "not"
- result = false;
- }
- return result;
- }
-
-
-
- /**
- * 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 XML10Names(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 XML10Names(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 < 1218) {
- 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;
- //zzPushbackPos-= 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) {
- return true;
- }
- else {
- zzEndRead+= numRead;
- return false;
- }
- }
-
-
- /**
- * Closes the input stream.
- */
-// private 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
- */
- private final void yyreset(java.io.Reader reader) {
- zzReader = reader;
-// zzAtBOL = true;
- zzAtEOF = false;
- zzEndRead = zzStartRead = 0;
- zzCurrentPos = zzMarkedPos = 0;//zzPushbackPos = 0;
-// yyline = yychar = yycolumn = 0;
- zzLexicalState = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
-// private final int yystate() {
-// return zzLexicalState;
-// }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
-// private final void yybegin(int newState) {
-// zzLexicalState = newState;
-// }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
-// private 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
- */
-// private final char yycharat(int pos) {
-// return zzBuffer[zzStartRead+pos];
-// }
-
-
- /**
- * Returns the length of the matched text region.
- */
-// private 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()!
- */
-// private 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
- */
- private boolean isValidXML10Name() 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;
-
- zzAction = -1;
-
- zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-
- zzState = 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 1:
- { return false; /* matched wild */
- }
- case 4: break;
- case 2:
- { return true; /* exact name */
- }
- case 5: break;
- case 3:
- { return false; /* more than name */
- }
- case 6: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- { {return false; /* hit end with no match */} }
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
deleted file mode 100644
index 4a8791c4f7..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser;
-
-
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParserExtension;
-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.internal.text.CharSequenceReader;
-import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Takes input from the HTMLTokenizer and creates a tag list
- */
-
-public class XMLSourceParser implements RegionParser, BlockTagParser, StructuredDocumentRegionParser, IRegionComparible, StructuredDocumentRegionParserExtension {
- // made public to aid access from inner classes in hierarchy.
- // TODO: in future, figure out how to solve without exposing data.
- public CharSequence fCharSequenceSource = null;
- private IDocument fDocumentInput;
- protected int fOffset = 0;
- // DMW: 2/12/03. Removed some state data, since not really needed,
- // and since it added a lot to overhead (since so many regions are
- // created.
- // protected IStructuredDocumentRegion fCurrentNode = null;
- // protected IStructuredDocumentRegion fNodes = null;
- // protected List fRegions = null;
- // protected Object fInput = null;
- protected String fStringInput = null;
- protected List fStructuredDocumentRegionHandlers;
-
- protected BlockTokenizer fTokenizer = null;
- protected long startTime;
- protected long stopTime;
-
- /**
- * HTMLSourceParser constructor comment.
- */
- public XMLSourceParser() {
- super();
- fStructuredDocumentRegionHandlers = new ArrayList();
- }
-
- /**
- * This is a simple utility to count nodes. Used only for debug
- * statements.
- */
- protected int _countNodes(IStructuredDocumentRegion nodes) {
- int result = 0;
- IStructuredDocumentRegion countNode = nodes;
- while (countNode != null) {
- result++;
- countNode = countNode.getNext();
- }
- return result;
- }
-
- public void addBlockMarker(BlockMarker marker) {
- getTokenizer().addBlockMarker(marker);
- }
-
- public synchronized void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
- if (fStructuredDocumentRegionHandlers == null)
- fStructuredDocumentRegionHandlers = new ArrayList();
- synchronized (fStructuredDocumentRegionHandlers) {
- fStructuredDocumentRegionHandlers.add(handler);
- }
- }
-
- public void beginBlockScan(String newTagName) {
- getTokenizer().beginBlockTagScan(newTagName);
- }
-
- /**
- * @return IStructuredDocumentRegion
- */
- protected IStructuredDocumentRegion createStructuredDocumentRegion(String type) {
- IStructuredDocumentRegion newNode = null;
- if (type == DOMRegionContext.BLOCK_TEXT)
- newNode = XMLStructuredRegionFactory.createRegion(XMLStructuredRegionFactory.XML_BLOCK);
- else
- newNode = XMLStructuredRegionFactory.createRegion(XMLStructuredRegionFactory.XML);
- return newNode;
- }
-
- protected void fireNodeParsed(IStructuredDocumentRegion fCurrentNode) {
- /*
- * Never let an Exceptions from foreign code interfere with completion
- * of parsing. To get an exception here is definitely a program error
- * somewhere, but we can't afford to interrupt the flow of control. or
- * backwards typing can result!
- *
- * Protect the user's data above everything.
- */
- Object[] handlers = null;
- synchronized (fStructuredDocumentRegionHandlers) {
- if (fStructuredDocumentRegionHandlers == null)
- return;
-
- handlers = fStructuredDocumentRegionHandlers.toArray();
- }
- if (fCurrentNode != null && handlers != null) {
- for (int i = 0; i < handlers.length; i++) {
- try {
- ((StructuredDocumentRegionHandler) handlers[i]).nodeParsed(fCurrentNode);
- }
- catch (Exception e) {
- Logger.log(Logger.ERROR, "Error occurred while firing Node Parsed event", e); //$NON-NLS-1$
- }
- }
- }
- }
-
- public BlockMarker getBlockMarker(String tagName) {
- List markers = getTokenizer().getBlockMarkers();
- for (int i = 0; i < markers.size(); i++) {
- BlockMarker marker = (BlockMarker) markers.get(i);
- if (marker.isCaseSensitive()) {
- if (marker.getTagName().equals(tagName))
- return marker;
- }
- else {
- if (marker.getTagName().equalsIgnoreCase(tagName))
- return marker;
- }
- }
- return null;
- }
-
- public List getBlockMarkers() {
- return getTokenizer().getBlockMarkers();
- }
-
- /**
- * @return IStructuredDocumentRegion
- */
- public IStructuredDocumentRegion getDocumentRegions() {
- IStructuredDocumentRegion headnode = null;
- if (headnode == null) {
- if (Debug.perfTest) {
- startTime = System.currentTimeMillis();
- }
- headnode = parseNodes();
- if (Debug.perfTest) {
- stopTime = System.currentTimeMillis();
- System.out.println(" -- creating nodes of IStructuredDocument -- "); //$NON-NLS-1$
- System.out.println(" Time parse and init all regions: " + (stopTime - startTime) + " (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;
- }
-
- protected 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;
- }
-
- /**
- * Return the full list of known regions. Typically getNodes should be
- * used instead of this method.
- */
- 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;
- }
-
- /**
- * @deprecated - use the add/remove methods instead
- * @return java.util.List
- */
- public List getStructuredDocumentRegionHandlers() {
- if (fStructuredDocumentRegionHandlers == null) {
- fStructuredDocumentRegionHandlers = new ArrayList(0);
- }
- return fStructuredDocumentRegionHandlers;
- }
-
- /**
- * Returns text from the current input. Text is only valid before
- * getNodes() has been called and only when a raw String or DocumentReader
- * is given as the input.
- */
- public String getText(int offset, int length) {
- String text = null;
- if (fCharSequenceSource != null) {
- int start = fOffset + offset;
- int end = start + length;
- text = fCharSequenceSource.subSequence(start, end).toString();
- }
- else if (fDocumentInput != null) {
- try {
- text = fDocumentInput.get(offset, length);
- }
- catch (BadLocationException e) {
- text = ""; //$NON-NLS-1$
- }
- }
- else {
- if (fStringInput == null || fStringInput.length() == 0 || offset + length > fStringInput.length() || offset < 0) {
- text = ""; //$NON-NLS-1$
- }
- else {
- // offset is entirely valid during parsing as the parse
- // numbers haven't been adjusted.
- text = fStringInput.substring(offset, offset + length);
- }
- }
- return text;
- }
-
- protected BlockTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new XMLTokenizer();
- }
- return fTokenizer;
- }
-
-
- public RegionParser newInstance() {
- XMLSourceParser newInstance = new XMLSourceParser();
- newInstance.setTokenizer(getTokenizer().newInstance());
- return newInstance;
- }
-
- protected IStructuredDocumentRegion parseNodes() {
- // regions are initially reported as complete offsets within the
- // scanned input
- // they are adjusted here to be indexes from the currentNode's start
- // offset
- IStructuredDocumentRegion headNode = null;
- IStructuredDocumentRegion lastNode = null;
- ITextRegion region = null;
- IStructuredDocumentRegion currentNode = null;
- String type = null;
-
- while ((region = getNextRegion()) != null) {
- type = region.getType();
- // these types (might) demand a IStructuredDocumentRegion for each
- // of them
- if (type == DOMRegionContext.BLOCK_TEXT) {
- if (currentNode != null && currentNode.getLastRegion().getType() == DOMRegionContext.BLOCK_TEXT) {
- // multiple block texts indicated embedded containers; no
- // new IStructuredDocumentRegion
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- }
- else {
- // not continuing a IStructuredDocumentRegion
- if (currentNode != null) {
- // ensure that any existing node is at least
- // terminated
- if (!currentNode.isEnded()) {
- currentNode.setLength(region.getStart() - currentNode.getStart());
- // fCurrentNode.setTextLength(region.getStart() -
- // fCurrentNode.getStart());
- }
- lastNode = currentNode;
- }
- fireNodeParsed(currentNode);
- currentNode = createStructuredDocumentRegion(type);
- if (lastNode != null) {
- lastNode.setNext(currentNode);
- }
- currentNode.setPrevious(lastNode);
- currentNode.setStart(region.getStart());
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- currentNode.setEnded(true);
- region.adjustStart(-currentNode.getStart());
- currentNode.addRegion(region);
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- }
- }
- // the following contexts OPEN new StructuredDocumentRegions
- else if ((currentNode != null && currentNode.isEnded()) || (type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_DECLARATION_OPEN)) {
- if (currentNode != null) {
- // ensure that any existing node is at least terminated
- if (!currentNode.isEnded()) {
- currentNode.setLength(region.getStart() - currentNode.getStart());
- // fCurrentNode.setTextLength(region.getStart() -
- // fCurrentNode.getStart());
- }
- lastNode = currentNode;
- }
- fireNodeParsed(currentNode);
- currentNode = createStructuredDocumentRegion(type);
- if (lastNode != null) {
- lastNode.setNext(currentNode);
- }
- currentNode.setPrevious(lastNode);
- currentNode.setStart(region.getStart());
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- }
- // the following contexts neither open nor close
- // StructuredDocumentRegions; just add to them
- else if ((type == DOMRegionContext.XML_TAG_NAME) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMRegionContext.XML_COMMENT_TEXT) || (type == DOMRegionContext.XML_PI_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)) {
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- }
- // the following contexts close off StructuredDocumentRegions
- // cleanly
- else if ((type == DOMRegionContext.XML_PI_CLOSE) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (type == DOMRegionContext.XML_COMMENT_CLOSE) || (type == DOMRegionContext.XML_DECLARATION_CLOSE) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
- currentNode.setEnded(true);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- currentNode.addRegion(region);
- region.adjustStart(-currentNode.getStart());
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- }
- // this is extremely rare, but valid
- else if (type == DOMRegionContext.WHITE_SPACE) {
- ITextRegion lastRegion = currentNode.getLastRegion();
- // pack the embedded container with this region
- if (lastRegion instanceof ITextRegionContainer) {
- ITextRegionContainer container = (ITextRegionContainer) lastRegion;
- container.getRegions().add(region);
- // containers must have parent set ...
- // setting for EACH subregion is redundent, but not sure
- // where else to do, so will do here for now.
- container.setParent(currentNode);
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(container);
- region.adjustStart(container.getLength() - region.getStart());
- }
- currentNode.getLastRegion().adjustLength(region.getLength());
- currentNode.adjustLength(region.getLength());
- }
- else if (type == DOMRegionContext.UNDEFINED && currentNode != null) {
- // skip on a very-first region situation as the default
- // behavior is good enough
- // combine with previous if also undefined
- if (currentNode.getLastRegion() != null && currentNode.getLastRegion().getType() == DOMRegionContext.UNDEFINED) {
- currentNode.getLastRegion().adjustLength(region.getLength());
- currentNode.adjustLength(region.getLength());
- }
- // previous wasn't undefined
- else {
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- }
- }
- else {
- // if an unknown type is the first region in the document,
- // ensure that a node exists
- if (currentNode == null) {
- currentNode = createStructuredDocumentRegion(type);
- currentNode.setStart(region.getStart());
- }
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
- // DW 4/16/2003 regions no longer have parents
- // region.setParent(currentNode);
- if (Debug.debugTokenizer)
- System.out.println(getClass().getName() + " found region of not specifically handled type " + region.getType() + " @ " + region.getStart() + "[" + region.getLength() + "]"); //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
-
- // these regions also get their own node, so close them cleanly
- // NOTE: these regions have new StructuredDocumentRegions created
- // for them above; it may
- // be more readable if that is handled here as well, but the
- // current layout
- // ensures that they open StructuredDocumentRegions the same way
- if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE)) {
- currentNode.setEnded(true);
- }
- if (headNode == null && currentNode != null) {
- headNode = currentNode;
- }
- }
- if (currentNode != null) {
- fireNodeParsed(currentNode);
- currentNode.setPrevious(lastNode);
- }
- // fStringInput = null;
- primReset();
- return headNode;
- }
-
- protected void primReset() {
- // fNodes = null;
- // fRegions = null;
- // fInput = null;
- fStringInput = null;
- fCharSequenceSource = null;
- fDocumentInput = null;
- fOffset = 0;
- // fCurrentNode = null;
- // DMW: also reset tokenizer so it doesn't hold on
- // to large arrays
- getTokenizer().reset(new char[0]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.text.IRegionComparible#regionMatches(int,
- * int, java.lang.String)
- */
- public boolean regionMatches(int offset, int length, String stringToCompare) {
- // by definition
- if (stringToCompare == null)
- return false;
-
- int ajustedOffset = fOffset + offset;
- boolean result = false;
- if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
- result = ((IRegionComparible) fCharSequenceSource).regionMatches(ajustedOffset, length, stringToCompare);
- }
- else {
- // old fashioned ways
- String test = null;
- if (fCharSequenceSource != null) {
- test = fCharSequenceSource.subSequence(ajustedOffset, ajustedOffset + length).toString();
- }
- else if (fStringInput != null) {
- test = fStringInput.substring(ajustedOffset, ajustedOffset + length);
- }
- result = stringToCompare.equals(test);
- }
- return result;
- }
-
- public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
- // by definition
- if (stringToCompare == null)
- return false;
-
- int ajustedOffset = fOffset + offset;
- boolean result = false;
- if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
- result = ((IRegionComparible) fCharSequenceSource).regionMatchesIgnoreCase(ajustedOffset, length, stringToCompare);
- }
- else {
- // old fashioned ways
- String test = null;
- if (fCharSequenceSource != null) {
- test = fCharSequenceSource.subSequence(ajustedOffset, ajustedOffset + length).toString();
- }
- else if (fStringInput != null) {
- test = fStringInput.substring(ajustedOffset, ajustedOffset + length);
- }
- result = stringToCompare.equalsIgnoreCase(test);
- }
- return result;
- }
-
- public void removeBlockMarker(BlockMarker marker) {
- getTokenizer().removeBlockMarker(marker);
- }
-
- public void removeBlockMarker(String tagName) {
- getTokenizer().removeBlockMarker(tagName);
- }
-
- public void removeStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
- if (fStructuredDocumentRegionHandlers == null)
- return;
- synchronized (fStructuredDocumentRegionHandlers) {
- fStructuredDocumentRegionHandlers.remove(handler);
- }
- }
-
- /**
- * Resets the input.
- */
- public void reset(java.io.FileInputStream instream) {
- primReset();
- // fInput = instream;
- getTokenizer().reset(instream);
- }
-
- /**
- * Resets the input.
- */
- public void reset(java.io.Reader reader) {
- reset(reader, 0);
- }
-
- /**
- * Resets the input.
- */
- public void reset(java.io.Reader reader, int position) {
- primReset();
- fOffset = position;
- getTokenizer().reset(reader, position);
- if (reader instanceof DocumentReader) {
- IDocument doc = ((DocumentReader) reader).getDocument();
- if (doc instanceof CharSequence) {
- fCharSequenceSource = (CharSequence) doc;
- }
- else {
- // old fashioned IDocument
- fDocumentInput = ((DocumentReader) reader).getDocument();
- }
-
- }
- else if (reader instanceof CharSequenceReader) {
- fCharSequenceSource = ((CharSequenceReader) reader).getOriginalSource();
- }
- }
-
- /**
- * Resets the input. Use this version to allow text to be retrieved
- * <em>during</em> parsing, such as by the
- * StructuredDocumentRegionHandler.
- */
- public void reset(String sourceString) {
- reset(new StringReader(sourceString));
- fStringInput = sourceString;
- }
-
- /**
- * Resets the input. Use this version to allow text to be retrieved
- * <em>during</em> parsing, such as by the
- * StructuredDocumentRegionHandler.
- */
- public void reset(String sourceString, int position) {
- StringReader reader = new StringReader(sourceString);
- reset(reader, position);
- fStringInput = sourceString;
- }
-
- public void resetHandlers() {
- Object[] handlers = null;
- synchronized (fStructuredDocumentRegionHandlers) {
- if (fStructuredDocumentRegionHandlers == null)
- return;
-
- handlers = fStructuredDocumentRegionHandlers.toArray();
- }
- for (int i = 0; i < handlers.length; i++) {
- try {
- ((StructuredDocumentRegionHandler) handlers[i]).resetNodes();
- }
- catch (Exception e) {
- Logger.log(Logger.ERROR, "Error occurred while resetting handlers", e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- *
- * @param List
- */
- public void setStructuredDocumentRegionHandlers(List newStructuredDocumentRegionHandlers) {
- fStructuredDocumentRegionHandlers = newStructuredDocumentRegionHandlers;
- }
-
- protected void setTokenizer(BlockTokenizer newTokenizer) {
- // DMW: changed from private to protected, so subclass could use in
- // creation of 'newInstance'.
- fTokenizer = newTokenizer;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java
deleted file mode 100644
index c185520fa7..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java
+++ /dev/null
@@ -1,124 +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.xml.core.internal.parser;
-
-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.text.StructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLStructuredDocumentReParser extends StructuredDocumentReParser {
-
- public XMLStructuredDocumentReParser() {
- super();
- }
-
- protected IStructuredDocumentRegion findDirtyEnd(int end) {
- // Caution: here's one place we have to cast
- IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(end);
- // if not well formed, get one past, if there is something there
- if ((result != null) && (!result.isEnded())) {
- if (result.getNext() != null) {
- result = result.getNext();
- }
- }
- // also, get one past if exactly equal to the end (this was needed
- // as a simple fix to when a whole exact region is deleted.
- // there's probably a better way.
- if ((result != null) && (end == result.getEnd())) {
- if (result.getNext() != null) {
- result = result.getNext();
- }
- }
-
- // 12/6/2001 - Since we've changed the parser/scanner to allow a lone
- // '<' without
- // always interpretting it as start of a tag name, we need to be a
- // little fancier, in order
- // to "skip" over any plain 'ol content between the lone '<' and any
- // potential meating
- // regions past plain 'ol content.
- if (isLoneOpenFollowedByContent(result) && (result.getNext() != null)) {
- result = result.getNext();
- }
-
- if (result != null)
- fStructuredDocument.setCachedDocumentRegion(result);
- dirtyEnd = result;
-
- return dirtyEnd;
- }
-
- protected void findDirtyStart(int start) {
- IStructuredDocumentRegion result = fStructuredDocument.getRegionAtCharacterOffset(start);
- // heuristic: if the postion is exactly equal to the start, then
- // go back one more, if it exists. This prevents problems with
- // insertions
- // of text that should be merged with the previous node instead of
- // simply hung
- // off of it as a separate node (ex.: XML content inserted right
- // before an open
- // bracket should become part of the previous content node)
- if (result != null) {
- IStructuredDocumentRegion previous = result.getPrevious();
- if ((previous != null) && ((!(previous.isEnded())) || (start == result.getStart()))) {
- result = previous;
- }
- // If we are now at the end of a "tag dependent" content area (or
- // JSP area)
- // then we need to back up all the way to the beginning of that.
- IStructuredDocumentRegion potential = result;
- while (isPartOfBlockRegion(potential)) {
- potential = potential.getPrevious();
- }
- if (potential != null) {
- result = potential;
- fStructuredDocument.setCachedDocumentRegion(result);
- }
- }
- dirtyStart = result;
- }
-
- /**
- * The rule is, that is we are content, preceded by lone <, then we need
- * to advance one more for dirty end.
- */
- protected boolean isLoneOpenFollowedByContent(IStructuredDocumentRegion flatNode) {
- boolean result = false;
- String type = flatNode.getType();
- if (type == DOMRegionContext.XML_CONTENT) {
- IStructuredDocumentRegion previous = flatNode.getPrevious();
- String previousType = null;
- if (previous != null) {
- previousType = previous.getType();
- }
- if (previousType != null) {
- result = (previousType == DOMRegionContext.XML_TAG_OPEN);
- }
- }
- return result;
- }
-
- protected boolean isPartOfBlockRegion(IStructuredDocumentRegion flatNode) {
- boolean result = false;
- String type = flatNode.getType();
- result = (type == DOMRegionContext.BLOCK_TEXT);
- return result;
- }
-
- public IStructuredTextReParser newInstance() {
- return new XMLStructuredDocumentReParser();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java
deleted file mode 100644
index 8a98dc2d9b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredRegionFactory.java
+++ /dev/null
@@ -1,42 +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.xml.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.text.XMLStructuredDocumentRegion;
-
-
-/**
- * A simple class to generate instances of StructuredRegions.
- */
-public class XMLStructuredRegionFactory {
- public final static int JSP_DIRECTIVE = 1003;
- public final static int XML = 1001;
- public final static int XML_BLOCK = 1002;
-
- public static IStructuredDocumentRegion createRegion(int type) {
- IStructuredDocumentRegion instance = null;
- switch (type) {
- case XML :
- instance = new XMLStructuredDocumentRegion();
- break;
- case XML_BLOCK :
- instance = new BlockStructuredDocumentRegion();
- break;
- default :
- throw new IllegalArgumentException("AbstractRegion::createRegion. Invalid type."); //$NON-NLS-1$
- }
- return instance;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
deleted file mode 100644
index be32479132..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
+++ /dev/null
@@ -1,1913 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 3/7/11 4:17 PM */
-
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.xml.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.parser.regions.XMLParserRegionFactory;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 3/7/11 4:17 PM from the specification file
- * <tt>file:/C:/dev/workspaces/indigo/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex</tt>
- */
-public class XMLTokenizer implements BlockTokenizer, DOMRegionContext {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 23;
- final public static int ST_XML_ELEMENT_DECLARATION_CONTENT = 27;
- final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
- final public static int ST_XML_PI_TAG_CLOSE = 11;
- final public static int ST_XML_DECLARATION_CLOSE = 21;
- final public static int ST_XML_PI_ATTRIBUTE_VALUE = 10;
- final public static int ST_DHTML_EQUALS = 13;
- final public static int ST_XML_TAG_NAME = 16;
- final public static int ST_XML_ATTRIBUTE_VALUE = 19;
- final public static int ST_DHTML_ATTRIBUTE_VALUE = 14;
- final public static int ST_XML_DOCTYPE_ID_SYSTEM = 25;
- final public static int ST_XML_ATTRIBUTE_NAME = 17;
- final public static int ST_XML_ELEMENT_DECLARATION = 26;
- final public static int ST_XML_DOCTYPE_DECLARATION = 22;
- final public static int ST_XML_ATTLIST_DECLARATION = 28;
- final public static int ST_XML_COMMENT_END = 4;
- final public static int ST_CDATA_TEXT = 1;
- final public static int ST_DHTML_TAG_CLOSE = 15;
- final public static int ST_XML_COMMENT = 3;
- final public static int ST_PI_CONTENT = 7;
- final public static int ST_PI_WS = 6;
- final public static int ST_CDATA_END = 2;
- final public static int ST_XML_ATTLIST_DECLARATION_CONTENT = 29;
- final public static int ST_BLOCK_TAG_SCAN = 30;
- final public static int ST_XML_PI_EQUALS = 9;
- final public static int ST_XML_DECLARATION = 20;
- final public static int YYINITIAL = 0;
- final public static int ST_XML_DOCTYPE_ID_PUBLIC = 24;
- final public static int ST_XML_EQUALS = 18;
- final public static int ST_PI = 5;
- final public static int ST_XML_PI_ATTRIBUTE_NAME = 8;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\11\0\1\5\1\22\2\0\1\14\22\0\1\14\1\21\1\11\1\55"+
- "\1\16\1\17\1\12\1\13\1\16\1\16\1\16\1\16\1\16\1\7"+
- "\1\6\1\3\12\15\1\10\1\61\1\1\1\45\1\2\1\4\1\16"+
- "\1\34\1\62\1\32\1\33\1\50\1\57\1\36\1\36\1\42\1\36"+
- "\1\36\1\27\1\25\1\44\1\43\1\47\1\36\1\40\1\56\1\35"+
- "\1\60\2\36\1\23\1\46\1\36\1\31\1\0\1\20\1\0\1\10"+
- "\1\0\1\52\1\62\1\63\1\53\1\37\1\57\1\36\1\66\1\42"+
- "\2\36\1\30\1\26\1\44\1\43\1\47\1\36\1\40\1\41\1\51"+
- "\1\60\1\36\1\36\1\24\1\54\1\36\1\0\1\0\72\0\1\65"+
- "\10\0\27\64\1\0\37\64\1\0\72\64\2\0\13\64\2\0\10\64"+
- "\1\0\65\64\1\0\104\64\11\0\44\64\3\0\2\64\4\0\36\64"+
- "\70\0\131\64\22\0\7\64\16\0\2\65\56\0\106\65\32\0\2\65"+
- "\44\0\1\64\1\65\3\64\1\0\1\64\1\0\24\64\1\0\54\64"+
- "\1\0\7\64\3\0\1\64\1\0\1\64\1\0\1\64\1\0\1\64"+
- "\1\0\22\64\15\0\14\64\1\0\102\64\1\0\14\64\1\0\44\64"+
- "\1\0\4\65\11\0\65\64\2\0\2\64\2\0\2\64\3\0\34\64"+
- "\2\0\10\64\2\0\2\64\67\0\46\64\2\0\1\64\7\0\46\64"+
- "\12\0\21\65\1\0\27\65\1\0\3\65\1\0\1\65\1\0\2\65"+
- "\1\0\1\65\13\0\33\64\5\0\3\64\56\0\32\64\5\0\1\65"+
- "\12\64\10\65\15\0\12\65\6\0\1\65\107\64\2\0\5\64\1\0"+
- "\17\64\1\0\4\64\1\0\1\64\17\65\2\64\2\65\1\0\4\65"+
- "\2\0\12\65\u0207\0\3\65\1\0\65\64\2\0\1\65\1\64\20\65"+
- "\3\0\4\65\3\0\12\64\2\65\2\0\12\65\21\0\3\65\1\0"+
- "\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0\1\64\3\0"+
- "\4\64\2\0\1\65\1\0\7\65\2\0\2\65\2\0\3\65\11\0"+
- "\1\65\4\0\2\64\1\0\3\64\2\65\2\0\12\65\2\64\20\0"+
- "\1\65\2\0\6\64\4\0\2\64\2\0\26\64\1\0\7\64\1\0"+
- "\2\64\1\0\2\64\1\0\2\64\2\0\1\65\1\0\5\65\4\0"+
- "\2\65\2\0\3\65\13\0\4\64\1\0\1\64\7\0\12\65\2\65"+
- "\3\64\14\0\3\65\1\0\7\64\1\0\1\64\1\0\3\64\1\0"+
- "\26\64\1\0\7\64\1\0\2\64\1\0\5\64\2\0\1\65\1\64"+
- "\10\65\1\0\3\65\1\0\3\65\22\0\1\64\5\0\12\65\21\0"+
- "\3\65\1\0\10\64\2\0\2\64\2\0\26\64\1\0\7\64\1\0"+
- "\2\64\2\0\4\64\2\0\1\65\1\64\6\65\3\0\2\65\2\0"+
- "\3\65\10\0\2\65\4\0\2\64\1\0\3\64\4\0\12\65\22\0"+
- "\2\65\1\0\6\64\3\0\3\64\1\0\4\64\3\0\2\64\1\0"+
- "\1\64\1\0\2\64\3\0\2\64\3\0\3\64\3\0\10\64\1\0"+
- "\3\64\4\0\5\65\3\0\3\65\1\0\4\65\11\0\1\65\17\0"+
- "\11\65\21\0\3\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
- "\12\64\1\0\5\64\4\0\7\65\1\0\3\65\1\0\4\65\7\0"+
- "\2\65\11\0\2\64\4\0\12\65\22\0\2\65\1\0\10\64\1\0"+
- "\3\64\1\0\27\64\1\0\12\64\1\0\5\64\4\0\7\65\1\0"+
- "\3\65\1\0\4\65\7\0\2\65\7\0\1\64\1\0\2\64\4\0"+
- "\12\65\22\0\2\65\1\0\10\64\1\0\3\64\1\0\27\64\1\0"+
- "\20\64\4\0\6\65\2\0\3\65\1\0\4\65\11\0\1\65\10\0"+
- "\2\64\4\0\12\65\221\0\56\64\1\0\1\64\1\65\2\64\7\65"+
- "\5\0\6\64\1\65\10\65\1\0\12\65\47\0\2\64\1\0\1\64"+
- "\2\0\2\64\1\0\1\64\2\0\1\64\6\0\4\64\1\0\7\64"+
- "\1\0\3\64\1\0\1\64\1\0\1\64\2\0\2\64\1\0\2\64"+
- "\1\0\1\64\1\65\2\64\6\65\1\0\2\65\1\64\2\0\5\64"+
- "\1\0\1\65\1\0\6\65\2\0\12\65\76\0\2\65\6\0\12\65"+
- "\13\0\1\65\1\0\1\65\1\0\1\65\4\0\2\65\10\64\1\0"+
- "\41\64\7\0\24\65\1\0\6\65\4\0\6\65\1\0\1\65\1\0"+
- "\25\65\3\0\7\65\1\0\1\65\346\0\46\64\12\0\47\64\11\0"+
- "\1\64\1\0\2\64\1\0\3\64\1\0\1\64\1\0\2\64\1\0"+
- "\5\64\51\0\1\64\1\0\1\64\1\0\1\64\13\0\1\64\1\0"+
- "\1\64\1\0\1\64\3\0\2\64\3\0\1\64\5\0\3\64\1\0"+
- "\1\64\1\0\1\64\1\0\1\64\1\0\1\64\3\0\2\64\3\0"+
- "\2\64\1\0\1\64\50\0\1\64\11\0\1\64\2\0\1\64\2\0"+
- "\2\64\7\0\2\64\1\0\1\64\1\0\7\64\50\0\1\64\4\0"+
- "\1\64\10\0\1\64\u0c06\0\234\64\4\0\132\64\6\0\26\64\2\0"+
- "\6\64\2\0\46\64\2\0\6\64\2\0\10\64\1\0\1\64\1\0"+
- "\1\64\1\0\1\64\1\0\37\64\2\0\65\64\1\0\7\64\1\0"+
- "\1\64\3\0\3\64\1\0\7\64\3\0\4\64\2\0\6\64\4\0"+
- "\15\64\5\0\3\64\1\0\7\64\323\0\15\65\4\0\1\65\104\0"+
- "\1\64\3\0\2\64\2\0\1\64\121\0\3\64\u0e82\0\1\65\1\0"+
- "\1\64\31\0\11\64\6\65\1\0\5\65\13\0\124\64\4\0\2\65"+
- "\2\0\2\65\2\0\132\64\1\0\3\65\6\0\50\64\u1cd3\0\u51a6\64"+
- "\u0c5a\0\u2ba4\64\134\0\u0800\0\u1ffe\0\2\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
- /**
- * Translates a state to a row index in the transition table
- */
- final private static int yy_rowMap [] = {
- 0, 55, 110, 165, 220, 275, 330, 385, 440, 495,
- 550, 605, 660, 715, 770, 825, 880, 935, 990, 1045,
- 1100, 1155, 1210, 1265, 1320, 1375, 1430, 1485, 1540, 1595,
- 1650, 1705, 1760, 1815, 1870, 1925, 1980, 1925, 1980, 2035,
- 1925, 1925, 1980, 2090, 2145, 2200, 2255, 2310, 2365, 2420,
- 2475, 1925, 1980, 2530, 2585, 2640, 1925, 2695, 2695, 2750,
- 2805, 2860, 2530, 1925, 2915, 2970, 1925, 3025, 3080, 3135,
- 3190, 3245, 3300, 1925, 3355, 3410, 3465, 3520, 1925, 3575,
- 3630, 3685, 3740, 3795, 1925, 3850, 3905, 3960, 4015, 4070,
- 4125, 4180, 4235, 4235, 4290, 4345, 4400, 4455, 4455, 4510,
- 4565, 4620, 4675, 4675, 4730, 4785, 4840, 4895, 1925, 4950,
- 4950, 5005, 5060, 5115, 5170, 1925, 1925, 1980, 1925, 1925,
- 5225, 5280, 5335, 5390, 5445, 5500, 5555, 5610, 5665, 1925,
- 5720, 5775, 5830, 1925, 1925, 2695, 5885, 2805, 1925, 5940,
- 2860, 2915, 3025, 3080, 5995, 3135, 1925, 6050, 3190, 1925,
- 3575, 6105, 3685, 1925, 6160, 3740, 5225, 6215, 6270, 6325,
- 4015, 1925, 6380, 6435, 4235, 6490, 4290, 1925, 6545, 6600,
- 6655, 6655, 6710, 6765, 4400, 4235, 4455, 6820, 4510, 1925,
- 6875, 4565, 4620, 4455, 4675, 6930, 4730, 1925, 6985, 7040,
- 7095, 7095, 7150, 7205, 7260, 4950, 7315, 5005, 1925, 7370,
- 7425, 7480, 7480, 7535, 7590, 7645, 7700, 7755, 7810, 7865,
- 1925, 7920, 7975, 1925, 1925, 1925, 2255, 8030, 8085, 8140,
- 8195, 8250, 8305, 8360, 6545, 8415, 8415, 6985, 8470, 8470,
- 8525, 7370, 8580, 8580, 8635, 1925, 8690, 8745, 1925, 8800,
- 8855, 8910, 8965, 9020, 9075, 9130, 9185, 6710, 7150, 9240,
- 7535, 9295, 9350, 9405, 9460, 9515, 9570, 9625, 9680, 9735,
- 9790, 9845, 9900, 9955, 10010, 10065, 10120, 10175, 1925, 1925,
- 10230, 10285, 10340, 10395, 10450, 1925, 1925, 1925, 10505, 10560,
- 10615, 10670, 10725, 10780, 1925, 10835, 4840, 5115, 10890, 10945,
- 11000, 11055, 2255
- };
-
- /**
- * The packed transition table of the DFA
- */
- final private static String yy_packed =
- "\1\40\1\41\10\40\1\42\4\40\1\43\47\40\1\44"+
- "\1\45\65\44\1\46\1\47\16\46\1\50\1\46\1\51"+
- "\44\46\1\52\1\53\65\52\1\46\1\47\5\46\1\54"+
- "\12\46\1\51\45\46\1\47\2\46\1\55\1\56\2\46"+
- "\1\57\3\46\1\56\5\46\1\56\1\60\1\61\4\57"+
- "\1\46\10\57\1\62\2\57\1\46\7\57\1\46\3\57"+
- "\1\46\3\57\1\46\1\57\1\46\1\47\2\46\1\55"+
- "\1\63\6\46\1\63\5\46\1\63\44\46\1\64\1\65"+
- "\2\64\1\66\15\64\1\51\44\64\1\46\1\47\2\46"+
- "\1\67\1\56\2\46\1\70\3\46\1\56\5\46\1\56"+
- "\6\70\1\46\13\70\1\46\7\70\1\46\3\70\1\46"+
- "\3\70\1\46\1\70\1\46\1\47\2\46\1\67\1\56"+
- "\2\46\1\70\3\46\1\56\5\46\1\56\6\70\1\46"+
- "\13\70\1\71\7\70\1\46\3\70\1\46\3\70\1\46"+
- "\1\70\1\72\1\47\1\46\1\73\1\74\1\56\3\72"+
- "\1\75\1\72\1\76\1\56\5\72\1\56\44\72\1\46"+
- "\1\47\2\46\1\77\15\46\1\51\45\46\1\47\1\100"+
- "\1\101\1\46\1\56\2\46\1\102\3\46\1\56\5\46"+
- "\1\56\6\102\1\46\13\102\1\46\7\102\1\46\3\102"+
- "\1\46\3\102\1\46\1\102\1\46\1\47\1\100\1\101"+
- "\1\46\1\56\2\46\1\102\3\46\1\56\5\46\1\56"+
- "\6\102\1\46\13\102\1\103\7\102\1\46\3\102\1\46"+
- "\3\102\1\46\1\102\1\104\1\47\1\100\1\105\1\104"+
- "\1\56\3\104\1\106\1\104\1\107\1\56\5\104\1\56"+
- "\44\104\1\46\1\47\3\46\1\56\6\46\1\56\5\46"+
- "\1\56\44\46\1\110\1\111\1\112\1\113\4\110\1\114"+
- "\12\110\6\115\1\110\13\115\1\110\7\115\1\110\3\115"+
- "\1\110\3\115\1\110\1\115\1\46\1\111\1\112\1\113"+
- "\1\46\1\56\2\46\1\116\3\46\1\56\5\46\1\56"+
- "\6\116\1\46\13\116\1\46\7\116\1\46\3\116\1\46"+
- "\3\116\1\46\1\116\1\46\1\111\1\112\1\113\1\46"+
- "\1\56\2\46\1\116\3\46\1\56\5\46\1\56\6\116"+
- "\1\46\13\116\1\117\7\116\1\46\3\116\1\46\3\116"+
- "\1\46\1\116\1\120\1\111\1\112\1\121\1\120\1\56"+
- "\3\120\1\122\1\120\1\123\1\56\5\120\1\56\44\120"+
- "\1\46\1\124\1\125\2\46\1\56\6\46\1\56\5\46"+
- "\1\56\10\46\1\126\1\127\2\46\1\130\10\46\1\130"+
- "\1\46\1\127\1\126\14\46\1\47\1\125\2\46\1\56"+
- "\6\46\1\56\5\46\1\56\6\46\1\131\36\46\1\47"+
- "\1\125\2\46\1\56\2\46\1\132\3\46\1\56\5\46"+
- "\1\56\6\132\1\131\13\132\1\46\7\132\1\46\3\132"+
- "\1\46\3\132\1\46\1\132\1\46\1\47\1\125\2\46"+
- "\1\56\6\46\1\56\5\46\1\56\6\46\1\131\7\46"+
- "\1\133\5\46\1\134\6\46\1\133\10\46\1\135\1\47"+
- "\1\125\1\136\1\135\1\56\3\135\1\137\1\135\1\140"+
- "\1\56\5\135\1\56\6\135\1\141\35\135\1\142\1\47"+
- "\1\125\1\143\1\142\1\56\3\142\1\144\1\142\1\145"+
- "\1\56\5\142\1\56\6\142\1\146\35\142\1\147\1\47"+
- "\1\125\1\150\1\147\1\56\3\147\1\151\1\147\1\152"+
- "\1\56\5\147\1\56\44\147\1\153\1\154\1\155\64\153"+
- "\1\156\1\47\1\125\1\157\1\156\1\56\3\156\1\160"+
- "\1\156\1\161\1\56\5\156\1\56\44\156\1\162\1\163"+
- "\1\164\64\162\1\165\1\166\65\165\1\40\1\0\10\40"+
- "\1\0\4\40\1\0\47\40\3\0\1\167\1\170\14\0"+
- "\1\171\52\0\1\172\2\0\1\173\3\0\1\172\5\0"+
- "\1\172\6\173\1\0\13\173\1\0\7\173\1\174\3\173"+
- "\1\0\3\173\1\0\1\173\5\0\1\172\2\0\1\175"+
- "\3\0\1\172\2\0\1\176\2\0\1\172\6\175\1\0"+
- "\13\175\1\0\7\175\1\0\3\175\1\0\3\175\1\0"+
- "\1\175\110\0\1\177\65\0\1\200\55\0\1\201\61\0"+
- "\1\202\71\0\1\56\6\0\1\56\5\0\1\56\52\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\13\57\1\0"+
- "\7\57\1\0\3\57\1\0\5\57\6\0\3\57\4\0"+
- "\1\57\5\0\2\57\2\203\2\57\1\0\13\57\1\0"+
- "\7\57\1\0\3\57\1\0\5\57\6\0\3\57\4\0"+
- "\1\57\5\0\2\57\1\203\1\204\2\57\1\0\13\57"+
- "\1\0\7\57\1\0\3\57\1\0\5\57\6\0\3\57"+
- "\4\0\1\57\5\0\2\57\2\205\2\57\1\0\13\57"+
- "\1\0\7\57\1\0\3\57\1\0\5\57\5\0\1\63"+
- "\6\0\1\63\5\0\1\63\46\0\1\206\66\0\1\207"+
- "\72\0\3\70\4\0\1\70\5\0\6\70\1\0\13\70"+
- "\1\0\7\70\1\0\3\70\1\0\5\70\1\72\2\0"+
- "\1\210\1\72\1\0\3\72\1\0\1\72\2\0\5\72"+
- "\1\0\45\72\1\0\1\207\1\210\1\72\1\0\3\72"+
- "\1\0\1\72\2\0\5\72\1\0\44\72\1\75\2\211"+
- "\1\212\1\75\1\211\3\75\1\213\1\75\2\211\5\75"+
- "\1\211\44\75\1\76\2\214\1\215\1\76\1\214\3\76"+
- "\1\214\1\76\1\213\1\214\5\76\1\214\44\76\2\0"+
- "\1\100\1\216\71\0\3\102\4\0\1\102\5\0\6\102"+
- "\1\0\13\102\1\0\7\102\1\0\3\102\1\0\5\102"+
- "\1\104\2\0\1\217\1\104\1\0\3\104\1\0\1\104"+
- "\2\0\5\104\1\0\45\104\1\0\1\100\1\220\1\104"+
- "\1\0\3\104\1\0\1\104\2\0\5\104\1\0\44\104"+
- "\1\106\2\221\1\222\1\106\1\221\3\106\1\223\1\106"+
- "\2\221\5\106\1\221\44\106\1\107\2\224\1\225\1\107"+
- "\1\224\3\107\1\224\1\107\1\223\1\224\5\107\1\224"+
- "\44\107\1\110\3\0\17\110\6\0\1\110\13\0\1\110"+
- "\7\0\1\110\3\0\1\110\3\0\1\110\4\0\1\167"+
- "\15\0\1\171\47\0\1\226\64\0\1\110\3\0\2\110"+
- "\3\114\4\110\1\114\5\110\6\115\1\110\13\115\1\110"+
- "\7\115\1\110\3\115\1\110\3\115\1\114\1\115\6\0"+
- "\3\115\4\0\1\115\5\0\6\115\1\0\13\115\1\0"+
- "\7\115\1\0\3\115\1\0\5\115\6\0\3\116\4\0"+
- "\1\116\5\0\6\116\1\0\13\116\1\0\7\116\1\0"+
- "\3\116\1\0\5\116\1\120\2\0\1\227\1\120\1\0"+
- "\3\120\1\0\1\120\2\0\5\120\1\0\45\120\1\0"+
- "\1\226\1\227\1\120\1\0\3\120\1\0\1\120\2\0"+
- "\5\120\1\0\44\120\1\122\2\230\1\231\1\122\1\230"+
- "\3\122\1\232\1\122\2\230\5\122\1\230\44\122\1\123"+
- "\2\233\1\234\1\123\1\233\3\123\1\233\1\123\1\232"+
- "\1\233\5\123\1\233\44\123\3\0\1\167\15\0\1\235"+
- "\110\0\1\236\60\0\1\237\13\0\1\237\44\0\2\240"+
- "\36\0\20\241\1\242\46\241\6\0\3\132\4\0\1\132"+
- "\5\0\6\132\1\0\13\132\1\0\7\132\1\0\3\132"+
- "\1\0\5\132\46\0\1\243\5\0\1\243\72\0\1\244"+
- "\6\0\1\135\2\0\1\245\1\135\1\0\3\135\1\0"+
- "\1\135\2\0\5\135\1\0\44\135\1\137\2\246\1\247"+
- "\1\137\1\246\3\137\1\250\1\137\2\246\5\137\1\246"+
- "\44\137\1\251\2\252\1\253\1\254\1\252\3\254\1\252"+
- "\1\251\1\255\1\256\3\254\1\251\1\254\1\256\6\254"+
- "\1\251\32\254\2\251\1\254\1\141\2\241\1\257\1\141"+
- "\1\241\3\141\1\241\1\141\2\241\3\141\1\260\1\141"+
- "\1\241\44\141\1\142\2\0\1\261\1\142\1\0\3\142"+
- "\1\0\1\142\2\0\5\142\1\0\44\142\1\144\2\262"+
- "\1\263\1\144\1\262\3\144\1\264\1\144\2\262\5\144"+
- "\1\262\44\144\1\145\2\265\1\266\1\145\1\265\3\145"+
- "\1\265\1\145\1\264\1\265\5\145\1\265\44\145\1\146"+
- "\2\241\1\267\1\146\1\241\3\146\1\241\1\146\2\241"+
- "\3\146\1\270\1\146\1\241\44\146\1\147\2\0\1\271"+
- "\1\147\1\0\3\147\1\0\1\147\2\0\5\147\1\0"+
- "\44\147\1\151\2\272\1\273\1\151\1\272\3\151\1\274"+
- "\1\151\2\272\5\151\1\272\44\151\1\275\2\276\1\277"+
- "\1\300\1\276\3\300\1\276\1\275\1\301\1\302\3\300"+
- "\1\275\1\300\1\302\6\300\1\275\32\300\2\275\1\300"+
- "\2\153\1\0\66\153\1\0\16\153\1\303\45\153\1\156"+
- "\2\0\1\304\1\156\1\0\3\156\1\0\1\156\2\0"+
- "\5\156\1\0\44\156\1\160\2\305\1\306\1\160\1\305"+
- "\3\160\1\307\1\160\2\305\5\160\1\305\44\160\1\310"+
- "\2\311\1\312\1\313\1\311\3\313\1\311\1\310\1\314"+
- "\1\315\3\313\1\310\1\313\1\315\6\313\1\310\32\313"+
- "\2\310\1\313\2\162\1\0\66\162\1\0\16\162\1\316"+
- "\45\162\7\0\1\317\21\0\1\320\42\0\1\172\2\0"+
- "\1\40\3\0\1\172\5\0\1\172\6\40\1\0\13\40"+
- "\1\0\7\40\1\0\3\40\1\0\3\40\1\0\1\40"+
- "\1\321\1\0\3\321\1\322\3\173\1\321\1\0\1\321"+
- "\1\322\1\173\1\321\1\0\2\321\1\322\6\173\1\321"+
- "\13\173\1\321\7\173\1\321\3\173\1\323\5\173\15\0"+
- "\1\324\6\0\1\325\42\0\1\321\1\0\3\321\1\322"+
- "\3\175\1\321\1\0\1\321\1\322\1\175\1\321\1\0"+
- "\2\321\1\322\6\175\1\321\13\175\1\321\7\175\1\321"+
- "\3\175\1\326\5\175\17\0\1\176\100\0\1\320\37\0"+
- "\1\327\66\0\1\330\72\0\3\57\4\0\1\57\5\0"+
- "\4\57\2\331\1\0\13\57\1\0\7\57\1\0\3\57"+
- "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\4\57"+
- "\1\331\1\332\1\0\13\57\1\0\7\57\1\0\3\57"+
- "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
- "\1\0\13\57\1\0\1\57\1\333\5\57\1\0\3\57"+
- "\1\0\5\57\11\211\1\213\55\211\13\214\1\213\53\214"+
- "\11\221\1\223\55\221\13\224\1\223\53\224\11\230\1\232"+
- "\55\230\13\233\1\232\53\233\32\0\1\334\30\0\1\334"+
- "\40\0\1\335\13\0\1\335\54\0\1\336\10\0\1\336"+
- "\57\0\1\337\14\0\1\337\72\0\1\340\4\0\11\246"+
- "\1\250\55\246\1\251\2\252\1\341\1\251\1\252\3\251"+
- "\1\252\1\251\1\250\1\252\5\251\1\252\44\251\13\252"+
- "\1\250\53\252\1\251\2\252\1\341\1\251\1\252\3\251"+
- "\1\252\1\251\1\342\1\252\5\251\1\252\44\251\13\0"+
- "\1\343\53\0\13\252\1\342\53\252\11\262\1\264\55\262"+
- "\13\265\1\264\53\265\11\272\1\274\55\272\1\275\2\276"+
- "\1\344\1\275\1\276\3\275\1\276\1\275\1\274\1\276"+
- "\5\275\1\276\44\275\13\276\1\274\53\276\1\275\2\276"+
- "\1\344\1\275\1\276\3\275\1\276\1\275\1\345\1\276"+
- "\5\275\1\276\44\275\13\0\1\346\53\0\13\276\1\345"+
- "\53\276\2\153\1\0\26\153\1\347\35\153\11\305\1\307"+
- "\55\305\1\310\2\311\1\350\1\310\1\311\3\310\1\311"+
- "\1\310\1\307\1\311\5\310\1\311\44\310\13\311\1\307"+
- "\53\311\1\310\2\311\1\350\1\310\1\311\3\310\1\311"+
- "\1\310\1\351\1\311\5\310\1\311\44\310\13\0\1\352"+
- "\53\0\13\311\1\351\53\311\2\162\1\0\26\162\1\353"+
- "\35\162\7\0\1\354\111\0\1\355\34\0\1\321\1\0"+
- "\10\321\1\0\4\321\1\0\41\321\1\0\6\321\1\0"+
- "\3\321\1\322\4\321\1\0\1\321\1\322\2\321\1\0"+
- "\2\321\1\322\36\321\1\356\5\321\15\0\1\324\43\0"+
- "\1\357\22\0\1\360\14\0\3\360\2\0\1\360\10\0"+
- "\1\360\1\0\2\360\3\0\1\360\2\0\2\360\11\0"+
- "\1\57\1\361\1\57\4\0\1\57\5\0\6\57\1\0"+
- "\13\57\1\0\7\57\1\0\3\57\1\0\5\57\6\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\11\57\1\362"+
- "\1\57\1\0\7\57\1\0\3\57\1\0\5\57\35\0"+
- "\1\363\13\0\1\363\44\0\2\364\63\0\2\365\75\0"+
- "\1\366\13\0\1\366\44\0\2\367\41\0\2\370\1\0"+
- "\3\370\2\0\1\255\4\370\1\0\10\370\1\0\32\370"+
- "\2\0\1\370\3\0\2\371\1\0\3\371\2\0\1\301"+
- "\4\371\1\0\10\371\1\0\32\371\2\0\1\371\2\153"+
- "\1\0\27\153\1\372\34\153\3\0\2\373\1\0\3\373"+
- "\2\0\1\314\4\373\1\0\10\373\1\0\32\373\2\0"+
- "\1\373\2\162\1\0\27\162\1\374\34\162\33\0\1\375"+
- "\114\0\1\356\22\0\1\360\14\0\3\360\2\0\1\360"+
- "\10\0\1\360\1\0\2\360\3\0\1\360\1\0\1\357"+
- "\2\360\11\0\3\57\4\0\1\57\5\0\6\57\1\0"+
- "\7\57\1\376\3\57\1\0\7\57\1\0\3\57\1\0"+
- "\5\57\6\0\3\57\4\0\1\57\5\0\6\57\1\0"+
- "\6\57\1\377\4\57\1\0\7\57\1\0\3\57\1\0"+
- "\5\57\46\0\1\u0100\5\0\1\u0100\54\0\1\u0101\63\0"+
- "\1\u0102\10\0\1\u0102\55\0\1\u0103\10\0\1\u0103\60\0"+
- "\1\u0104\24\0\2\153\1\0\30\153\1\u0105\33\153\2\162"+
- "\1\0\30\162\1\u0106\33\162\34\0\1\u0107\40\0\3\57"+
- "\4\0\1\57\5\0\6\57\1\0\13\57\1\0\3\57"+
- "\1\u0108\3\57\1\0\3\57\1\0\5\57\6\0\3\57"+
- "\4\0\1\57\5\0\6\57\1\0\3\57\1\u0109\7\57"+
- "\1\0\3\57\1\u0109\3\57\1\0\3\57\1\0\5\57"+
- "\47\0\1\u010a\60\0\1\u010b\14\0\1\u010b\54\0\1\u010c"+
- "\47\0\2\u010d\72\0\1\u010e\30\0\1\u010e\3\0\2\153"+
- "\1\0\31\153\1\u010f\32\153\2\162\1\0\31\162\1\u0110"+
- "\32\162\35\0\1\u0111\37\0\3\57\4\0\1\57\5\0"+
- "\6\57\1\0\13\57\1\0\6\57\1\u0112\1\0\3\57"+
- "\1\0\5\57\5\0\1\u0113\3\57\3\0\1\u0113\1\57"+
- "\4\0\1\u0113\6\57\1\0\13\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\37\0\1\u0114\10\0\1\u0114\53\0"+
- "\1\u0115\13\0\1\u0115\52\0\1\u0116\13\0\1\u0116\15\0"+
- "\2\153\1\0\32\153\1\u0117\31\153\2\162\1\0\32\162"+
- "\1\u0118\31\162\34\0\1\u0119\40\0\3\57\4\0\1\57"+
- "\5\0\5\57\1\u011a\1\0\13\57\1\0\7\57\1\0"+
- "\3\57\1\0\5\57\5\0\1\u0113\6\0\1\u0113\5\0"+
- "\1\u0113\44\0\2\153\1\0\31\153\1\u011b\32\153\2\162"+
- "\1\0\31\162\1\u011c\32\162\31\0\1\u011d\43\0\3\57"+
- "\4\0\1\57\5\0\6\57\1\0\5\57\1\u011e\5\57"+
- "\1\0\7\57\1\0\3\57\1\0\5\57\2\153\1\0"+
- "\26\153\1\u011f\35\153\2\162\1\0\26\162\1\u0120\35\162"+
- "\6\0\3\57\4\0\1\57\5\0\6\57\1\0\7\57"+
- "\1\u0121\3\57\1\0\7\57\1\0\3\57\1\0\5\57"+
- "\6\0\3\57\4\0\1\57\5\0\6\57\1\0\13\57"+
- "\1\0\7\57\1\0\3\57\1\0\4\57\1\u0122\6\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\5\57\1\u0123"+
- "\5\57\1\0\7\57\1\0\3\57\1\0\5\57\6\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\5\57\1\u0124"+
- "\5\57\1\0\7\57\1\0\3\57\1\0\5\57\6\0"+
- "\3\57\4\0\1\57\5\0\6\57\1\0\13\57\1\0"+
- "\3\57\1\u0125\3\57\1\0\3\57\1\0\5\57";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans [] = yy_unpack(yy_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- // final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error", //$NON-NLS-1$
- "Internal error: unknown state", //$NON-NLS-1$
- "Error: could not match input", //$NON-NLS-1$
- "Error: pushback value was too large" //$NON-NLS-1$
- };
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {
- 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
- 1, 1, 1, 9, 1, 9, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 9, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9,
- 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 9, 1,
- 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1,
- 1, 1, 1, 9, 9, 1, 9, 9, 1, 0, 1, 0, 1, 1, 0, 0,
- 0, 9, 1, 1, 1, 9, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0,
- 0, 0, 9, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0,
- 0, 9, 0, 0, 0, 0, 0, 9, 1, 0, 0, 1, 1, 0, 0, 1,
- 0, 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 9, 1, 0, 0, 1,
- 1, 0, 1, 0, 0, 0, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0,
- 1, 1, 9, 0, 0, 9, 9, 9, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 9, 0, 1, 9, 0,
- 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0,
- 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 9, 9, 1, 1,
- 0, 1, 1, 9, 9, 9, 1, 1, 0, 1, 1, 1, 9, 1, 1, 1,
- 1, 1, 1, 1, 1
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- //private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
- // private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- // private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- // private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
- private int fTokenCount = 0;
-
- // required holders for white-space compacting
- private boolean fShouldLoadBuffered = false;
- private String fBufferedContext = null;
- private int fBufferedStart = 1;
- private int fBufferedLength = 0;
- private String f_context = null;
-
- // state stack for handling embedded regions
- private IntStack fStateStack = new IntStack();
-
- private String context = null;
- private int start = 0;
- private int textLength = 0;
- private int length = 0;
-
- // offset for tracking position specific block tags
- private int fOffset = 0;
-
- // the name of the current tag being opened
- private String fCurrentTagName = null;
-
- // the list of tag name BlockMarkers
- private List fBlockMarkers = new ArrayList();
-
- // required to not seek text blocks on an end tag
- private boolean fIsBlockingEnabled = false;
- private boolean fIsCaseSensitiveBlocking = true;
-
- private XMLParserRegionFactory fRegionFactory = new XMLParserRegionFactory();
-/**
- * user method
- */
-public final void addBlockMarker(BlockMarker marker) {
- if(containsTagName(marker.getTagName()))
- return;
- fBlockMarkers.add(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(BlockMarker marker) {
- fBlockMarkers.remove(marker);
-}
-/**
- * user method
- */
-public final void removeBlockMarker(String tagname) {
- if (fBlockMarkers != null) {
- Iterator blocks = fBlockMarkers.iterator();
- while (blocks.hasNext()) {
- if (((BlockMarker) blocks.next()).getTagName().equals(tagname))
- blocks.remove();
- }
- }
-}
-/* user method */
-public final boolean isCaseSensitiveBlocking() {
- return fIsCaseSensitiveBlocking;
-}
-/* user method */
-public final void setCaseSensitiveBlocking(boolean newValue) {
- fIsCaseSensitiveBlocking = newValue;
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity() {
- return getBlockMarkerCaseSensitivity(fCurrentTagName);
-}
-/* user method */
-public boolean getBlockMarkerCaseSensitivity(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- boolean casesensitive = marker.isCaseSensitive();
- if(casesensitive && marker.getTagName().equals(name))
- return casesensitive;
- else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
- return casesensitive;
- }
- return true;
-}
-/* user method */
-public String getBlockMarkerContext() {
- return getBlockMarkerContext(fCurrentTagName);
-}
-/* user method */
-public String getBlockMarkerContext(String name) {
- Iterator iterator = fBlockMarkers.iterator();
- while(iterator.hasNext()) {
- BlockMarker marker = (BlockMarker)iterator.next();
- if(marker.getTagName().equals(name))
- return marker.getContext();
- }
- return BLOCK_TEXT;
-}
-/* user method */
-public List getBlockMarkers() {
- return fBlockMarkers;
-}
-/* user method */
-public final int getOffset() {
- return fOffset + yychar;
-}
-private final boolean isBlockMarker() {
- return isBlockMarker(fCurrentTagName);
-}
-private final boolean isBlockMarker(String tagName) {
- if (!fIsBlockingEnabled)
- return false;
- return containsTagName(tagName);
-}
-/**
- * user method
- */
-public final void beginBlockTagScan(String newTagName) {
- beginBlockMarkerScan(newTagName, BLOCK_TEXT);
-}
-/**
- * user method
- *
- * Special tokenizer setup. Allows tokenization to be initiated at the
- * start of a text block within a "newTagName" tag.
- *
- * Example:
- * Tokenizer toker = new Tokenizer();
- * toker.setCaseSensitiveBlocking(false);
- * toker.reset(new java.io.StringReader("afiuhqwkejhtasihgalkwhtq</scripter></scr></script>asgdasga"));
- * toker.beginBlockMarkerScan("script", BLOCK_TEXT);
- * toker.getRegions();
- *
- * Returns:
- * BLOCK_TEXT: 0-40
- * XML_END_TAG_OPEN: 41-42
- * XML_TAG_NAME: 43-48
- * XML_TAG_CLOSE: 49-49
- * XML_CONTENT: 50-57
- *
- */
-public final void beginBlockMarkerScan(String newTagName, String blockcontext) {
- yybegin(ST_BLOCK_TAG_SCAN);
- fCurrentTagName = newTagName;
-}
-/**
- * Method doScan.
- *
- * Returns a context region for all of the text from the current position upto the end of input or
- * to right *before* the first occurence of searchString
- *
- * @param searchString - target string to search for ex.: "-->", "</tagname"
- * @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
- * @param context - the context of the scanned region if non-zero length
- * @param exitState - the state to go to if the region was of non-zero length
- * @param abortState - the state to go to if the searchString was found immediately
- * @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
- * @throws IOException
- */
-private final String doScan(String searchString, boolean requireTailSeparator, String searchContext, int exitState, int immediateFallbackState) throws IOException {
- boolean stillSearching = true;
- // Disable further block (probably)
- fIsBlockingEnabled = false;
- int searchStringLength = searchString.length();
- int n = 0;
- char lastCheckChar;
- int i;
- boolean same = false;
- while (stillSearching) {
- n = 0;
- // Ensure that enough data from the input exists to compare against the search String.
- n = yy_advance();
- while(n != YYEOF && yy_currentPos < searchStringLength)
- n = yy_advance();
- // If the input was too short or we've exhausted the input, stop immediately.
- if (n == YYEOF) {
- stillSearching = false;
- }
- else {
- same = true;
- // Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and
- // thus found twice at current-targetLength [since the first scan would have come out this far anyway].
- // Check the characters in the target versus the last targetLength characters read from the buffer
- // and see if it matches
-
- // safety check for array accesses (yy_currentPos is the *last* character we can check against)
- if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {
- for(i = 0; i < searchStringLength; i++) {
- if(same && fIsCaseSensitiveBlocking)
- same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);
- else if(same && !fIsCaseSensitiveBlocking)
- same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));
- }
- }
- // safety check failed; no match is possible right now
- else {
- same = false;
- }
- if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {
- // Additional check for close tags to ensure that targetString="</script" doesn't match
- // "</scriptS"
- lastCheckChar = yy_buffer[yy_currentPos];
- // Succeed on "</script>" and "</script "
- if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))
- stillSearching = false;
- }
- else {
- stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);
- }
- }
- }
- if (n != YYEOF || same) {
- // We've stopped short of the end or definitely found a match
- yy_markedPos = yy_currentPos - searchStringLength;
- yy_currentPos = yy_markedPos + 1;
- // If the searchString occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if (yy_markedPos == yy_startRead) {
- yybegin(immediateFallbackState);
- return primGetNextToken();
- }
- }
- else {
- // We ran through the rest of the input
- yy_markedPos = yy_currentPos;
- yy_currentPos++;
- }
- yybegin(exitState);
- // If the ending occurs at the very beginning of what would have
- // been a Block, resume scanning normally immediately
- if(yy_markedPos == yy_startRead)
- return primGetNextToken();
- return searchContext;
-}
-/**
- * user method
- *
- * A generic lookahead-like operation
- */
-private final String doBlockScan(String target, String targetContext, int immediateFallbackState) throws IOException {
- return doScan(target, false, targetContext, immediateFallbackState, immediateFallbackState);
-}
-/**
- * user method
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
- fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
- return doScan("</" + fCurrentTagName, true, getBlockMarkerContext(fCurrentTagName), YYINITIAL, YYINITIAL);
-}
-/**
- * user method
- *
- * Converts the raw context String returned by the primGetNextToken()
- * method into a full ITextRegion by pulling in values for the
- * current offset within the scanning text.
- *
- * Returns null when EOF is encountered and attaches intermittently
- * discovered whitespace onto the end of useful regions.
- *
- * Note that this algorithm caches the token following the one being returned
- * so that whitespace can be collapsed.
- */
-public final ITextRegion getNextToken() throws IOException {
- // load the starting non-whitespace token (assume that it is so)
- if (fShouldLoadBuffered) {
- context = fBufferedContext;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
- fShouldLoadBuffered = false;
- }
- else {
- context = primGetNextToken();
- if (context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- start = yychar;
- textLength = length = yylength();
- if (yy_atEOF) {
- fTokenCount++;
- return null;
- }
- }
- // store the next token
- f_context = primGetNextToken();
- if (f_context == XML_TAG_NAME) {
- if(containsTagName(yy_buffer, yy_startRead, yy_markedPos-yy_startRead))
- fCurrentTagName = yytext();
- else
- fCurrentTagName = null;
- }
- else if (f_context == XML_TAG_OPEN) {
- fIsBlockingEnabled = true;
- }
- else if (f_context == XML_END_TAG_OPEN) {
- fIsBlockingEnabled = false;
- }
- fBufferedContext = f_context;
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- fShouldLoadBuffered = true;
- if (fBufferedContext == WHITE_SPACE) {
- fShouldLoadBuffered = false;
- length += fBufferedLength;
- }
- if (context == null) {
- // EOF
- if (Debug.debugTokenizer) {
- System.out.println(getClass().getName() + " discovered " + fTokenCount + " tokens."); //$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
- fTokenCount++;
- return fRegionFactory.createToken(context, start, textLength, length, null, fCurrentTagName);
-}
-/* user method */
-public XMLTokenizer(){
- super();
-}
-/* user method */
-public XMLTokenizer(char[] charArray){
- this(new CharArrayReader(charArray));
-}
-/* user method */
-public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
-}
-/* user method */
-public void reset(char[] charArray, int newOffset) {
- reset(new CharArrayReader(charArray), newOffset);
-}
-/* user method */
-public void reset(java.io.InputStream in) {
- reset(new java.io.InputStreamReader(in), 0);
-}
-/* user method */
-public void reset(java.io.InputStream in, int newOffset) {
- reset(new java.io.InputStreamReader(in), newOffset);
-}
-/* user method */
-public void reset(java.io.Reader in) {
- reset(in, 0);
-}
-/**
- * user method *
- *
- * Reset internal counters and vars to "newly created" values, in the hopes
- * that resetting a pre-existing tokenizer is faster than creating a new one.
- *
- * This method contains code blocks that were essentially duplicated from the
- * <em>generated</em> output of this specification before this method was
- * added. Those code blocks were under the above copyright.
- */
-public void reset(java.io.Reader in, int newOffset) {
- if (Debug.debugTokenizer) {
- System.out.println("resetting tokenizer");//$NON-NLS-1$
- }
- fOffset = newOffset;
-
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- //yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
- //yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- /* user vars: */
- fTokenCount = 0;
-
- fShouldLoadBuffered = false;
- fBufferedContext = null;
- fBufferedStart = 1;
- fBufferedLength = 0;
- fStateStack = new IntStack();
-
- context = null;
- start = 0;
- textLength = 0;
- length = 0;
-}
-
- /**
- * user method
- *
- */
- public BlockTokenizer newInstance() {
- XMLTokenizer newInstance = new XMLTokenizer();
- // global tagmarkers can be shared; they have no state and
- // are never destroyed (e.g. 'release')
- for(int i = 0; i < fBlockMarkers.size(); i++) {
- BlockMarker blockMarker = (BlockMarker) fBlockMarkers.get(i);
- if(blockMarker.isGlobal())
- newInstance.addBlockMarker(blockMarker);
- }
- return newInstance;
- }
-/* user method */
-private final String scanXMLCommentText() throws IOException {
- // Scan for '-->' and return the text up to that point as
- // XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
- // case change to the ST_XML_COMMENT_END state and return the next
- // context as usual.
- return doScan("-->", false, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-}
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public XMLTokenizer(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 XMLTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed the packed transition table
- * @return the unpacked transition table
- */
- private static int [] yy_unpack(String packed) {
- int [] trans = new int[11110];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 3646) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do trans[j++] = value; while (--count > 0);
- }
- return trans;
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 1372) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Gets the next input character.
- *
- * @return the next character of the input stream, EOF if the
- * end of the stream is reached.
- * @exception IOException if any I/O-Error occurs
- */
- private int yy_advance() throws java.io.IOException {
-
- /* standard case */
- if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
- /* if the eof is reached, we don't need to work hard */
- if (yy_atEOF) return YYEOF;
-
- /* otherwise: need to refill the buffer */
-
- /* first: make room (if you can) */
- if (yy_startRead > 0) {
- System.arraycopy(yy_buffer, yy_startRead,
- yy_buffer, 0,
- yy_endRead-yy_startRead);
-
- /* translate stored positions */
- yy_endRead-= yy_startRead;
- yy_currentPos-= yy_startRead;
- yy_markedPos-= yy_startRead;
- //yy_pushbackPos-= yy_startRead;
- yy_startRead = 0;
- }
-
- /* is the buffer big enough? */
- if (yy_currentPos >= yy_buffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[yy_currentPos*2];
- System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
- yy_buffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = yy_reader.read(yy_buffer, yy_endRead,
- yy_buffer.length-yy_endRead);
-
- if ( numRead == -1 ) return YYEOF;
-
- yy_endRead+= numRead;
-
- return yy_buffer[yy_currentPos++];
- }
-
-
- /**
- * Closes the input stream.
- */
- final public void yyclose() throws java.io.IOException {
- yy_atEOF = true; /* indicate end of file */
- yy_endRead = yy_startRead; /* invalidate buffer */
- yy_reader.close();
- }
-
-
- /**
- * Returns the current lexical state.
- */
- final public int yystate() {
- return yy_lexical_state;
- }
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- final public void yybegin(int newState) {
- yy_lexical_state = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- final public String yytext() {
- return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
- }
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos-yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning - from the SED JFlex skeleton
- *
- * @param errorCode the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- try {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
- }
- // DO NOT EXIT the VM on an error
- // System.exit(1);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
- /**
- * user method - skeleton.sed
- */
- protected final boolean containsTagName(char[] markerTagName, int offset, int tagnameLength) {
- for(int j = 0; j < fBlockMarkers.size(); j++) {
- BlockMarker marker = (BlockMarker)fBlockMarkers.get(j);
- if(marker.getTagName().length() == tagnameLength) {
- boolean matchesSoFar = true;
- for(int i = 0; i < tagnameLength && matchesSoFar; i++) {
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().charAt(i) != markerTagName[i + offset])
- matchesSoFar = false;
- }
- else {
- if(Character.toLowerCase(marker.getTagName().charAt(i)) != Character.toLowerCase(markerTagName[i + offset]))
- matchesSoFar = false;
- }
- }
- if(matchesSoFar)
- return true;
- }
- }
- return false;
- }
-
- /**
- * user method - skeleton.sed
- *
- * Return ALL of the regions scannable within the remaining text
- * Note: for verification use
- */
- public final List getRegions() {
- List tokens = new ArrayList();
- ITextRegion region = null;
- try {
- region = getNextToken();
- while(region != null) {
- if (region != null) {
- tokens.add(region);
- }
- region = getNextToken();
- }
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName()+": input could not be tokenized correctly at position " + getOffset(), e);//$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- // Since this is convenience method and NOT the recommended
- // way of getting tokens, many errors are simply hidden
- Logger.logException("Exception not handled retrieving regions: " + e.getLocalizedMessage(), e);//$NON-NLS-1$
- }
- return tokens;
- }
- /**
- * user method - skeleton.sed
- */
- private final void dump(String s) {
- if (Debug.debugTokenizer) {
- System.out.println(s + " (" + yychar + "-" + //$NON-NLS-2$//$NON-NLS-1$
- (yylength() + yychar) + "):\'" +//$NON-NLS-1$
- StringUtils.escape(yytext()) + "\'");//$NON-NLS-1$
- }
- }
- /* user method - skeleton.sed */
- public final boolean isEOF() {
- return yy_atEOF;
- }
-/* user method - skeleton.sed */
-protected final boolean containsTagName(String markerTagName) {
- Iterator blocks = fBlockMarkers.iterator();
- while(blocks.hasNext()) {
- BlockMarker marker = (BlockMarker)blocks.next();
- if(marker.isCaseSensitive()) {
- if(marker.getTagName().equals(markerTagName))
- return true;
- }
- else {
- if(marker.getTagName().equalsIgnoreCase(markerTagName))
- return true;
- }
- }
- return false;
-}
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- // do nothing, this is the downstream parser's job
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- yy_state = yy_lexical_state;
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
- if (yy_next == -1) break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = YY_ATTRIBUTE[yy_state];
- if ( (yy_attributes & 1) > 0 ) {
- yy_action = yy_state;
- yy_markedPos = yy_currentPos;
- if ( (yy_attributes & 8) > 0 ) break yy_forAction;
- }
-
- }
- }
-
-
- switch (yy_action) {
-
- case 292:
- {
- if(Debug.debugTokenizer)
- dump("XSL processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 294: break;
- case 284:
- case 286:
- case 287:
- {
- if(Debug.debugTokenizer)
- dump("\nCDATA start");//$NON-NLS-1$
- fStateStack.push(yystate());
- yybegin(ST_CDATA_TEXT);
- return XML_CDATA_OPEN;
- }
- case 295: break;
- case 277:
- {
- if(Debug.debugTokenizer)
- dump("element");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION);
- return XML_ELEMENT_DECLARATION;
- }
- case 296: break;
- case 276:
- {
- if(Debug.debugTokenizer)
- dump("attlist");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION);
- return XML_ATTLIST_DECLARATION;
- }
- case 297: break;
- case 275:
- {
- if(Debug.debugTokenizer)
- dump("doctype");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_DECLARATION);
- return XML_DOCTYPE_DECLARATION;
- }
- case 298: break;
- case 269:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
- return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
- case 299: break;
- case 268:
- {
- if(Debug.debugTokenizer)
- dump("doctype external id");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
- case 300: break;
- case 264:
- case 274:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction target");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 301: break;
- case 238:
- {
- if(Debug.debugTokenizer)
- dump("\nCharRef");//$NON-NLS-1$
- return XML_CHAR_REFERENCE;
- }
- case 302: break;
- case 235:
- {
- if(Debug.debugTokenizer)
- dump("\ncomment start");//$NON-NLS-1$
- yybegin(ST_XML_COMMENT);
- return XML_COMMENT_OPEN;
- }
- case 303: break;
- case 216:
- case 217:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction target");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 304: break;
- case 215:
- {
- if(Debug.debugTokenizer)
- dump("comment end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_COMMENT_CLOSE;
- }
- case 305: break;
- case 214:
- {
- if(Debug.debugTokenizer)
- dump("CDATA end");//$NON-NLS-1$
- yybegin(fStateStack.pop());
- return XML_CDATA_CLOSE;
- }
- case 306: break;
- case 213:
- {
- if(Debug.debugTokenizer)
- dump("\nPEReference");//$NON-NLS-1$
- return XML_PE_REFERENCE;
- }
- case 307: break;
- case 210:
- {
- if(Debug.debugTokenizer)
- dump("\nEntityRef");//$NON-NLS-1$
- return XML_ENTITY_REFERENCE;
- }
- case 308: break;
- case 161:
- case 175:
- case 183:
- {
- return XML_DOCTYPE_INTERNAL_SUBSET;
- }
- case 309: break;
- case 149:
- {
- yybegin(YYINITIAL);
- if(Debug.debugTokenizer)
- dump("empty tag close");//$NON-NLS-1$
- return XML_EMPTY_TAG_CLOSE;
- }
- case 310: break;
- case 134:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 311: break;
- case 133:
- {
- // ended with nothing inside
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 312: break;
- case 129:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 313: break;
- case 120:
- {
- fStateStack.push(yystate());
- if(Debug.debugTokenizer)
- dump("\ndeclaration start");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION);
- return XML_DECLARATION_OPEN;
- }
- case 314: break;
- case 119:
- {
- if(Debug.debugTokenizer)
- dump("\nprocessing instruction start");//$NON-NLS-1$
- yybegin(ST_PI);
- return XML_PI_OPEN;
- }
- case 315: break;
- case 118:
- {
- if(Debug.debugTokenizer)
- dump("\nend tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_END_TAG_OPEN;
- }
- case 316: break;
- case 57:
- case 59:
- case 60:
- case 61:
- case 138:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 317: break;
- case 56:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 318: break;
- case 55:
- {
- if(Debug.debugTokenizer)
- dump("XML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_XML_PI_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 319: break;
- case 51:
- case 52:
- case 53:
- {
- // block scan until close is found
- return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
- case 320: break;
- case 50:
- {
- yybegin(ST_PI_CONTENT);
- return WHITE_SPACE;
- }
- case 321: break;
- case 46:
- case 47:
- case 48:
- case 49:
- case 130:
- case 131:
- case 132:
- case 218:
- case 240:
- case 241:
- case 253:
- case 254:
- case 263:
- case 273:
- case 281:
- case 285:
- case 288:
- case 289:
- case 290:
- case 291:
- {
- if(Debug.debugTokenizer)
- dump("processing instruction target");//$NON-NLS-1$
- yybegin(ST_PI_WS);
- return XML_TAG_NAME;
- }
- case 322: break;
- case 41:
- case 42:
- {
- if(Debug.debugTokenizer)
- dump("comment content");//$NON-NLS-1$
- return scanXMLCommentText();
- }
- case 323: break;
- case 40:
- {
- if(Debug.debugTokenizer)
- dump("LINE FEED");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 324: break;
- case 35:
- case 36:
- {
- if(Debug.debugTokenizer)
- dump("CDATA text");//$NON-NLS-1$
- String blockContext = doBlockScan("]]>", XML_CDATA_TEXT, ST_CDATA_END);//$NON-NLS-1$
- if(blockContext == XML_CDATA_TEXT)
- yybegin(ST_CDATA_END);
- return blockContext;
- }
- case 325: break;
- case 0:
- case 31:
- case 122:
- case 124:
- case 208:
- case 209:
- case 237:
- {
- if(Debug.debugTokenizer)
- dump("\nXML content");//$NON-NLS-1$
- return XML_CONTENT;
- }
- case 326: break;
- case 5:
- case 8:
- case 9:
- case 10:
- case 12:
- case 13:
- case 14:
- case 15:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 28:
- case 45:
- {
- if(Debug.debugTokenizer)
- dump("white space");//$NON-NLS-1$
- return WHITE_SPACE;
- }
- case 327: break;
- case 16:
- case 71:
- {
- if(Debug.debugTokenizer)
- dump("inappropriate tag name");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_CONTENT;
- }
- case 328: break;
- case 27:
- case 106:
- case 107:
- case 194:
- case 230:
- case 249:
- case 260:
- case 270:
- case 278:
- case 282:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl contentspec");//$NON-NLS-1$
- return XML_ELEMENT_DECL_CONTENT;
- }
- case 329: break;
- case 29:
- case 113:
- case 114:
- case 205:
- case 234:
- case 251:
- case 261:
- case 271:
- case 279:
- case 283:
- {
- if(Debug.debugTokenizer)
- dump("attlist contentspec");//$NON-NLS-1$
- return XML_ATTLIST_DECL_CONTENT;
- }
- case 330: break;
- case 32:
- case 72:
- case 83:
- {
- if(Debug.debugTokenizer)
- dump("\nstart tag open");//$NON-NLS-1$
- yybegin(ST_XML_TAG_NAME);
- return XML_TAG_OPEN;
- }
- case 331: break;
- case 33:
- case 37:
- case 38:
- case 39:
- case 43:
- case 44:
- case 54:
- case 58:
- case 62:
- case 64:
- case 68:
- case 74:
- case 80:
- case 85:
- case 86:
- case 87:
- case 88:
- case 90:
- case 91:
- case 93:
- case 98:
- case 103:
- case 110:
- {
- if (Debug.debugTokenizer)
- System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
- yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
- return UNDEFINED;
- }
- case 332: break;
- case 34:
- case 125:
- {
- if(Debug.debugTokenizer)
- dump("non-reference %");//$NON-NLS-1$
- return XML_CONTENT;
- }
- case 333: break;
- case 63:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction end");//$NON-NLS-1$
- yybegin(YYINITIAL);
- return XML_PI_CLOSE;
- }
- case 334: break;
- case 65:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute name");//$NON-NLS-1$
- yybegin(ST_DHTML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 335: break;
- case 66:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction '='");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 336: break;
- case 67:
- case 69:
- case 70:
- case 146:
- {
- if(Debug.debugTokenizer)
- dump("DHTML processing instruction attribute value");//$NON-NLS-1$
- yybegin(ST_DHTML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 337: break;
- case 73:
- {
- if(Debug.debugTokenizer)
- dump("tag close");//$NON-NLS-1$
- if(isBlockMarker()) {
- yybegin(ST_BLOCK_TAG_SCAN);
- }
- else
- yybegin(YYINITIAL);
- return XML_TAG_CLOSE;
- }
- case 338: break;
- case 75:
- case 76:
- {
- if(Debug.debugTokenizer)
- dump("tag name");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_NAME;
- }
- case 339: break;
- case 77:
- {
- if(Debug.debugTokenizer)
- dump("attr name");//$NON-NLS-1$
- yybegin(ST_XML_EQUALS);
- return XML_TAG_ATTRIBUTE_NAME;
- }
- case 340: break;
- case 78:
- {
- if(Debug.debugTokenizer)
- dump("equals");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_VALUE);
- return XML_TAG_ATTRIBUTE_EQUALS;
- }
- case 341: break;
- case 79:
- case 81:
- case 82:
- case 153:
- {
- if(Debug.debugTokenizer)
- dump("attr value");//$NON-NLS-1$
- yybegin(ST_XML_ATTRIBUTE_NAME);
- return XML_TAG_ATTRIBUTE_VALUE;
- }
- case 342: break;
- case 84:
- {
- if(Debug.debugTokenizer)
- dump("declaration end");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 343: break;
- case 89:
- {
- if(Debug.debugTokenizer)
- dump("doctype type");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
- return XML_DOCTYPE_NAME;
- }
- case 344: break;
- case 92:
- case 94:
- case 95:
- case 96:
- case 167:
- case 168:
- case 171:
- case 172:
- case 225:
- {
- if(Debug.debugTokenizer)
- dump("doctype public reference");//$NON-NLS-1$
- yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
- return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
- case 345: break;
- case 97:
- case 99:
- case 100:
- case 101:
- case 179:
- {
- if(Debug.debugTokenizer)
- dump("doctype system reference");//$NON-NLS-1$
- yybegin(ST_XML_DECLARATION_CLOSE);
- return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
- case 346: break;
- case 102:
- case 104:
- case 105:
- case 187:
- case 188:
- case 191:
- case 192:
- case 228:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl name");//$NON-NLS-1$
- yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
- return XML_ELEMENT_DECL_NAME;
- }
- case 347: break;
- case 108:
- {
- if(Debug.debugTokenizer)
- dump("elementdecl close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 348: break;
- case 109:
- case 111:
- case 112:
- case 198:
- case 199:
- case 202:
- case 203:
- case 232:
- {
- if(Debug.debugTokenizer)
- dump("attlist name");//$NON-NLS-1$
- yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
- return XML_ATTLIST_DECL_NAME;
- }
- case 349: break;
- case 115:
- {
- if(Debug.debugTokenizer)
- dump("attlist close");//$NON-NLS-1$
- if (Debug.debugTokenizer) {
- if(fStateStack.peek()!=YYINITIAL)
- System.out.println("end embedded region");//$NON-NLS-1$
- }
- yybegin(fStateStack.pop());
- return XML_DECLARATION_CLOSE;
- }
- case 350: break;
- case 116:
- case 117:
- {
- return doBlockTagScan();
- }
- case 351: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- return null;
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java
deleted file mode 100644
index 836dd41f5c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeEqualsRegion.java
+++ /dev/null
@@ -1,92 +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.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-
-public class AttributeEqualsRegion implements ITextRegion {
- static private final byte fTextLength = 1;
- static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS;
- private short fLength;
- private int fStart;
-
-
- public AttributeEqualsRegion() {
- super();
- }
-
- public AttributeEqualsRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fLength = (short) length;
- }
-
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
- public void adjustTextLength(int i) {
- // not supported
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = (short) region.getLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java
deleted file mode 100644
index a2c4158f80..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeNameRegion.java
+++ /dev/null
@@ -1,165 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class AttributeNameRegion implements ITextRegion {
- // specify correct type
- static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_NAME;
- private int fLength;
- private int fStart;
- private int fTextLength;
-
- public AttributeNameRegion() {
- super();
- }
-
- public AttributeNameRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fTextLength = textLength;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
- public void adjustTextLength(int i) {
- fTextLength += 1;
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- RegionChangedEvent result = null;
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
- canHandle = false;
- } else {
- canHandle = true;
- }
- } else {
- if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- } else {
- canHandle = false;
- }
-
- }
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- // TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
- // If we are handling as whitespace, there is no need to increase
- // the text length, only
- // the total length is changing.
- if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
- fTextLength += lengthDifference;
- }
- fLength += lengthDifference;
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java
deleted file mode 100644
index 7fbbbbf353..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java
+++ /dev/null
@@ -1,162 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class AttributeValueRegion implements ITextRegion {
- // specify correct type
- static private final String fType = DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE;
- private int fLength;
- private int fStart;
- private int fTextLength;
-
- public AttributeValueRegion() {
- super();
- }
-
- public AttributeValueRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fTextLength = textLength;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
- }
-
- public void adjustStart(int i) {
- fStart += i;
- }
-
- public void adjustTextLength(int i) {
- fTextLength += 1;
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- RegionChangedEvent result = null;
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
- canHandle = false;
- } else {
- canHandle = true;
- }
- } else {
- if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- } else {
- canHandle = false;
- }
- }
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- // TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
- // If we are handling as whitespace, there is no need to increase
- // the text length, only
- // the total length is changing.
- if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
- fTextLength += lengthDifference;
- }
- // update length (and end) after above check for white space,
- // since
- // it looks to determine if at end of region.
- fLength += lengthDifference;
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
deleted file mode 100644
index 339d692f4a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
+++ /dev/null
@@ -1,90 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class EmptyTagCloseRegion implements ITextRegion {
- private int fLength = 2;
- static private final byte fTextLength = 2;
- static private final String fType = DOMRegionContext.XML_EMPTY_TAG_CLOSE;
- private int fStart;
-
-
- public EmptyTagCloseRegion() {
- super();
- }
-
- public EmptyTagCloseRegion(int start, int textLength, int length) {
- super();
- fStart = start;
- fLength = length;
- if (fTextLength != textLength)
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- }
-
- public void adjustLength(int i) {
- fLength += i;
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
- public void adjustTextLength(int i) {
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
deleted file mode 100644
index 1ad5549d0d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
+++ /dev/null
@@ -1,101 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class EndTagOpenRegion implements ITextRegion {
- static private final String fType = DOMRegionContext.XML_END_TAG_OPEN;
- private int fLength;
- private int fStart;
- static private final byte fTextLength = 2;
-
-
- public EndTagOpenRegion() {
- super();
- }
-
- public EndTagOpenRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- if (fTextLength != textLength)
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- fLength = length;
- }
-
- public EndTagOpenRegion(int start, int length) {
- this();
- fStart = start;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
-// fTextLength += 1;
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
-// fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java
deleted file mode 100644
index e6064beb1d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java
+++ /dev/null
@@ -1,102 +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.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- *
- * This class is not intended to be used, its just present to server as a
- * generic starting point for adding new specific region types.
- *
- */
-
-public class GenericTemplateRegion implements ITextRegion {
- // specify correct type
- static private final String fType = DOMRegionContext.UNDEFINED;
- private int fLength;
- private int fStart;
- private int fTextLength;
-
-
- public GenericTemplateRegion() {
- super();
- }
-
- public GenericTemplateRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fTextLength = textLength;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
- fTextLength += i;
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java
deleted file mode 100644
index af783f63b0..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java
+++ /dev/null
@@ -1,29 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class RegionToStringUtil {
- static public String toString(ITextRegion region) {
- String className = region.getClass().getName();
- String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
- String result = shortClassName + "--> " + region.getType() + ": " + region.getStart() + "-" + region.getTextEnd() + (region.getTextEnd() != region.getEnd() ? ("/" + region.getEnd()) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- // NOTE: if the document held by any region has been updated and the
- // region offsets have not
- // yet been updated, the output from this method invalid.
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
deleted file mode 100644
index 567d0937bc..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- *
- * This is a utility class to centralize 'region' update. Note: care must be
- * taken that is is not used for StructuredDocumentRegions, or container
- * regions, its only for "token regions"
- *
- */
-public class RegionUpdateRule {
-
- static public boolean allLetterOrDigit(String changes) {
- boolean result = true;
- for (int i = 0; i < changes.length(); i++) {
- // TO_DO_FUTURE: check that a Java Letter or Digit is
- // the same thing as an XML letter or digit
- if (!(Character.isLetterOrDigit(changes.charAt(i)))) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- static public boolean allWhiteSpace(String changes) {
- boolean result = true;
- for (int i = 0; i < changes.length(); i++) {
- if (!Character.isWhitespace(changes.charAt(i))) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- static public boolean canHandleAsLetterOrDigit(ITextRegion region, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- if (parent == null)
- return canHandleAsLetterOrDigit(region, changes, requestStart, lengthToReplace);
- boolean result = false;
- // Make sure we are in a non-white space area
- if ((requestStart <= (parent.getTextEndOffset(region))) && (allLetterOrDigit(changes))) {
- result = true;
- }
- return result;
- }
-
- static public boolean canHandleAsLetterOrDigit(ITextRegion region, String changes, int requestStart, int lengthToReplace) {
- boolean result = false;
- // Make sure we are in a non-white space area
- if ((requestStart <= (region.getTextEnd())) && (allLetterOrDigit(changes))) {
- result = true;
- }
- return result;
- }
-
- static public boolean canHandleAsWhiteSpace(ITextRegion region, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // we don't explect a null parent, but just in case!
- // (in which case, we must be dealing with regions that are
- // structuredDocumentRegions).
- if (parent == null)
- return canHandleAsWhiteSpace(region, changes, requestStart, lengthToReplace);
- boolean result = false;
- // if we are in the "white space" area of a region, then
- // we don't want to handle, a reparse is needed.
- // the white space region is consider anywhere that would
- // leave whitespace between this character and the text part.
- // and of course, we can insert whitespace in whitespace region
- //
- // if there is no whitespace in this region, no need to look further
- if (region.getEnd() > region.getTextEnd()) {
- // no need to add one to end of text, as we used to, since we
- // change definition of length to equate to offset plus one.
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
- // watch out for whitespace at end of text
- if (requestStart >= parent.getTextEndOffset(region)) {
- // ok, we are in the whitespace region, so we can't handle,
- // unless
- // we are just inserting whitespace.
- if (allWhiteSpace(changes)) {
- result = true;
- } else {
- result = false;
- }
- }
- }
- return result;
- }
-
- static public boolean canHandleAsWhiteSpace(ITextRegion region, String changes, int requestStart, int lengthToReplace) {
- boolean result = false;
- // if we are in the "white space" area of a region, then
- // we don't want to handle, a reparse is needed.
- // the white space region is consider anywhere that would
- // leave whitespace between this character and the text part.
- // and of course, we can insert whitespace in whitespace region
- //
- // if there is no whitespace in this region, no need to look further
- if (region.getEnd() > region.getTextEnd()) {
- // no need to add one to end of text, as we used to, since we
- // change definition of length to equate to offset plus one.
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
- // watch out for whitespace at end of text
- if (requestStart >= region.getTextEnd()) {
- // ok, we are in the whitespace region, so we can't handle,
- // unless
- // we are just inserting whitespace.
- if (allWhiteSpace(changes)) {
- result = true;
- } else {
- result = false;
- }
- }
- }
- return result;
- }
-
- // need an adjust text length API before this can be used
- static public StructuredDocumentEvent updateModel(ITextRegion region, Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- RegionChangedEvent result = null;
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + region.getType()); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((region.getStart() >= region.getTextEnd()) || (Math.abs(lengthToReplace) >= region.getTextEnd() - region.getStart())) {
- canHandle = false;
- } else {
- canHandle = true;
- }
- } else {
- if ((RegionUpdateRule.canHandleAsWhiteSpace(region, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(region, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- } else {
- canHandle = false;
- }
- }
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- region.adjustLength(lengthDifference);
- // TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
- // If we are handling as whitespace, there is no need to increase
- // the text length, only
- // the total length is changing.
- if (!RegionUpdateRule.canHandleAsWhiteSpace(region, parent, changes, region.getStart(), lengthToReplace)) {
- // region.adjustTextLength(lengthDifference);
- }
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, region, changes, requestStart, lengthToReplace);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java
deleted file mode 100644
index 027ae4d992..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagCloseRegion.java
+++ /dev/null
@@ -1,89 +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.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagCloseRegion implements ITextRegion {
- static private final byte fLength = 1;
- static private final byte fTextLength = 1;
- static private final String fType = DOMRegionContext.XML_TAG_CLOSE;
- private int fStart;
-
-
- public TagCloseRegion() {
- super();
- }
-
- public TagCloseRegion(int start) {
- this();
- fStart = start;
- }
-
- public void adjustLength(int i) {
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
- public void adjustTextLength(int i) {
- // not supported
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java
deleted file mode 100644
index 38b59c4233..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java
+++ /dev/null
@@ -1,93 +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.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagNameRegion implements ITextRegion {
- static private final String fType = DOMRegionContext.XML_TAG_NAME;
- private short fLength;
- private int fStart;
- private short fTextLength;
-
-
- public TagNameRegion() {
- super();
- }
-
- public TagNameRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fTextLength = (short) textLength;
- fLength = (short) length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
- fTextLength += i;
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = (short) region.getLength();
- fTextLength = (short) region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
deleted file mode 100644
index e8cb85e928..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
+++ /dev/null
@@ -1,98 +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.wst.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class TagOpenRegion implements ITextRegion {
- static private final String fType = DOMRegionContext.XML_TAG_OPEN;
- private int fLength;
- private int fStart;
- static private final byte fTextLength = 1;
-
-
- public TagOpenRegion() {
- super();
- }
-
- public TagOpenRegion(int start, int textLength, int length) {
- this(start, length);
- if (fTextLength != textLength)
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- }
-
- public TagOpenRegion(int start, int length) {
- this();
- fStart = start;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
-// fTextLength += 1;
- throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java
deleted file mode 100644
index bc0bcc197b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java
+++ /dev/null
@@ -1,188 +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.xml.core.internal.parser.regions;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class WhiteSpaceOnlyRegion implements ITextRegion {
- static private final byte fTextLength = 0;
-
- static private final String fType = DOMRegionContext.WHITE_SPACE;
- protected int fLength;
- protected int fStart;
-
- public WhiteSpaceOnlyRegion(int start, int length) {
- super();
- fStart = start;
- fLength = length;
- }
-
- public void adjust(int i) {
- fStart += i;
- }
-
- public void adjustLength(int i) {
- fLength += i;
- }
-
- public void adjustStart(int i) {
- fStart += i;
- }
-
-
- public void adjustTextLength(int i) {
- // not supported
-
- }
-
- public boolean contains(int position) {
-
- return fStart <= position && position < fStart + fLength;
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public void setLength(int i) {
- fLength = i;
- }
-
- public void setStart(int i) {
- fStart = i;
- }
-
- public void setTextLength(short i) {
- throw new RuntimeException("invalid call"); //$NON-NLS-1$
- }
-
- public void setType(String string) {
- throw new RuntimeException("invalid call"); //$NON-NLS-1$
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- /**
- * For this ITextRegion type, the start must in terms of what the region
- * expects ... that is, its not document offset, but start relative to
- * what ever contains it.
- */
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
- canHandle = false;
- }
- else {
- canHandle = true;
- }
- }
- else {
- if (RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- }
- else {
- canHandle = false;
- }
-
- }
- RegionChangedEvent result = null;
-
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- fLength += lengthDifference;
-
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java
deleted file mode 100644
index 23da980cde..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java
+++ /dev/null
@@ -1,175 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLCDataTextRegion implements ITextRegion {
- static private final String fType = DOMRegionContext.XML_CDATA_TEXT;
- private int fLength;
- private int fStart;
- private int fTextLength;
-
-
- public XMLCDataTextRegion() {
- super();
- }
-
- public XMLCDataTextRegion(int start, int textLength, int length) {
- this();
- fStart = start;
- fTextLength = textLength;
- fLength = length;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
- fTextLength += i;
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- // TODO: shouldn't cdata be like XML Content ... length and text
- // length
- // always be the same, regardless of whitespace?
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // TODO: this is a pretty lame method, since XML CData region can have
- // a much
- // better rule for region update, but this is what previous
- // (unfactored)
- // version had, so I'll carry it over, of now.
- RegionChangedEvent result = null;
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
- canHandle = false;
- } else {
- canHandle = true;
- }
- } else {
- if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- } else {
- canHandle = false;
- }
-
- }
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- // TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
- // If we are handling as whitespace, there is no need to increase
- // the text length, only
- // the total length is changing.
- if (!RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) {
- fTextLength += lengthDifference;
- }
- fLength += lengthDifference;
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java
deleted file mode 100644
index e9088dbb0c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java
+++ /dev/null
@@ -1,175 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-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.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-
-public class XMLContentRegion implements ITextRegion {
- static private final String fType = DOMRegionContext.XML_CONTENT;
- // length and textLength are always the same for content region
- //private int fTextLength;
- private int fLength;
- private int fStart;
-
-
- public XMLContentRegion() {
- super();
- }
-
- public XMLContentRegion(int start, int length) {
- this();
- fStart = start;
- fLength = length;
- }
-
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
- // not supported
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public int getTextEnd() {
- return fStart + fLength;
- }
-
- public int getTextLength() {
- return fLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // TODO: this is a pretty lame method, since XML Content can have a
- // much
- // better rule for region update, but this is what previous
- // (unfactored)
- // version had, so I'll carry it over, of now.
- RegionChangedEvent result = null;
- // if the region is an easy type (e.g. attribute value),
- // and the requested changes are all
- // alphanumeric, then make the change here locally.
- // (This can obviously be made more sophisticated as the need arises,
- // but should
- // always follow this pattern.)
- if (Debug.debugStructuredDocument) {
- System.out.println("\t\tContextRegion::updateModel"); //$NON-NLS-1$
- System.out.println("\t\t\tregion type is " + fType); //$NON-NLS-1$
- }
- boolean canHandle = false;
- // note: we'll always handle deletes from these
- // regions ... if its already that region,
- // deleting something from it won't change its
- // type. (remember, the calling program needs
- // to insure we are not called, if not all contained
- // on one region.
- if ((changes == null) || (changes.length() == 0)) {
- // delete case
- // We can not do the quick delete, if
- // if all the text in a region is to be deleted.
- // Or, if the delete starts in the white space region.
- // In these cases, a reparse is needed.
- // Minor note, we use textEnd-start since it always
- // less than or equal to end-start. This might
- // cause us to miss a few cases we could have handled,
- // but will prevent us from trying to handle funning cases
- // involving whitespace.
- if ((fStart >= getTextEnd()) || (Math.abs(lengthToReplace) >= getTextEnd() - getStart())) {
- canHandle = false;
- } else {
- canHandle = true;
- }
- } else {
- if ((RegionUpdateRule.canHandleAsWhiteSpace(this, parent, changes, requestStart, lengthToReplace)) || RegionUpdateRule.canHandleAsLetterOrDigit(this, parent, changes, requestStart, lengthToReplace)) {
- canHandle = true;
- } else {
- canHandle = false;
- }
-
- }
- if (canHandle) {
- // at this point, we still have the old region. We won't create a
- // new instance, we'll just update the one we have, by changing
- // its end postion,
- // The parent flatnode, upon return, has responsibility
- // for updating sibling regions.
- // and in turn, the structuredDocument itself has responsibility
- // for
- // updating the text store and down stream flatnodes.
- if (Debug.debugStructuredDocument) {
- System.out.println("change handled by region"); //$NON-NLS-1$
- }
- int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
- // Note: we adjust both end and text end, because for any change
- // that is in only the trailing whitespace region, we should not
- // do a quick change,
- // so 'canHandle' should have been false for those case.
- fLength += lengthDifference;
- // TO_DO_FUTURE: cache value of canHandleAsWhiteSpace from above
- // If we are handling as whitespace, there is no need to increase
- // the text length, only
- // the total length is changing.
- // don't need for content region
- // if (!RegionUpdateRule.canHandleAsWhiteSpace(this, changes,
- // fStart, lengthToReplace)) {
- // fTextLength += lengthDifference;
- // }
- result = new RegionChangedEvent(parent.getParentDocument(), requester, parent, this, changes, requestStart, lengthToReplace);
- }
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java
deleted file mode 100644
index 38df3ea165..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserFactory.java
+++ /dev/null
@@ -1,25 +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.xml.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class XMLHeadParserFactory {
- public ITextRegion createToken(String context, int start, int textLength, int length, String text) {
- ITextRegion newRegion = null;
- // if (context == XMLRegionContext.XML_CDATA_TEXT) {
- newRegion = new XMLHeadParserRegion(context, start, textLength, length, text);
- // }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java
deleted file mode 100644
index f3917b6338..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLHeadParserRegion.java
+++ /dev/null
@@ -1,107 +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.xml.core.internal.parser.regions;
-
-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.ITextRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- *
- * This class is not intended to be used, its just present to server as a
- * generic starting point for adding new specific region types.
- */
-
-public class XMLHeadParserRegion implements ITextRegion {
- private int fLength;
- private int fStart;
- private String fText;
- private int fTextLength;
- // specify correct type
- private String fType = DOMRegionContext.UNDEFINED;
-
- public XMLHeadParserRegion() {
- super();
- }
-
- public XMLHeadParserRegion(String context, int start, int textLength, int length, String text) {
- this();
- fType = context;
- fStart = start;
- fTextLength = textLength;
- fLength = length;
- fText = text;
- }
-
- public void adjustLength(int i) {
- fLength += i;
-
- }
-
- public void adjustStart(int i) {
- fStart += i;
-
- }
-
-
- public void adjustTextLength(int i) {
- fTextLength += 1;
-
- }
-
- public void equatePositions(ITextRegion region) {
- fStart = region.getStart();
- fLength = region.getLength();
- fTextLength = region.getTextLength();
- }
-
- public int getEnd() {
- return fStart + fLength;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public int getStart() {
- return fStart;
- }
-
- public String getText() {
- return fText;
- }
-
- public int getTextEnd() {
- return fStart + fTextLength;
- }
-
- public int getTextLength() {
- return fTextLength;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return RegionToStringUtil.toString(this);
- }
-
- public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
- // can never be updated
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
deleted file mode 100644
index 581f44780e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
+++ /dev/null
@@ -1,103 +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.xml.core.internal.parser.regions;
-
-
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- *
- * This region factory is very specific to the parser output, and the specific
- * implementation classes for various regions.
- */
-
-public class XMLParserRegionFactory {
-
- public XMLParserRegionFactory() {
- super();
- }
-
- public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length) {
- return this.createToken(parent, context, start, textLength, length, null, null);
- }
-
- public ITextRegion createToken(ITextRegionContainer parent, String context, int start, int textLength, int length, String lang, String surroundingTag) {
- ITextRegion newRegion = createToken(context, start, textLength, length);
- // DW, 4/16/2003 token regions no longer have parents
- // newRegion.setParent(parent);
- return newRegion;
- }
-
- public ITextRegion createToken(String context, int start, int textLength, int length) {
- return this.createToken(context, start, textLength, length, null, null);
- }
-
- public ITextRegion createToken(String context, int start, int textLength, int length, String lang, String surroundingTag) {
- ITextRegion newRegion = null;
- if (context == DOMRegionContext.XML_CDATA_TEXT) {
- newRegion = new XMLCDataTextRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_CONTENT) {
- newRegion = new XMLContentRegion(start, length);
- }
- else if (context == DOMRegionContext.XML_TAG_NAME) {
- newRegion = new TagNameRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- newRegion = new AttributeNameRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- newRegion = new AttributeEqualsRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- newRegion = new AttributeValueRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_TAG_OPEN) {
- newRegion = new TagOpenRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_END_TAG_OPEN) {
- newRegion = new EndTagOpenRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.XML_TAG_CLOSE) {
- newRegion = new TagCloseRegion(start);
- }
- else if (context == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- newRegion = new EmptyTagCloseRegion(start, textLength, length);
- }
- else if (context == DOMRegionContext.WHITE_SPACE) {
- newRegion = new WhiteSpaceOnlyRegion(start, length);
- }
- else
- // removed this condition during transition, and implemented in
- // subclass
- // if (context == XMLJSPRegionContexts.JSP_CONTENT) {
- // newRegion = new JSPCodeRegion(context, start, textLength, length);
- // } else
- if (context == DOMRegionContext.BLOCK_TEXT) {
- newRegion = new ForeignRegion(context, start, textLength, length);
- ((ForeignRegion) newRegion).setSurroundingTag(surroundingTag);
- }
- else {
- newRegion = new ContextRegion(context, start, textLength, length);
- }
- return newRegion;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
deleted file mode 100644
index 4fad19bf9f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-package org.eclipse.wst.xml.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.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
-/**
- * Sets default values for XML Core preferences
- */
-public class XMLCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
- // formatting preferences
- node.putInt(XMLCorePreferenceNames.LINE_WIDTH, 72);
- node.putBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
- node.put(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
- node.putInt(XMLCorePreferenceNames.INDENTATION_SIZE, 1);
- node.putBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
- node.putBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET, false);
- node.putBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT, false);
- node.putBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG, true);
- node.putBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT, true);
- node.putBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES, true);
- // cleanup preferences
- node.putBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, true);
- node.putBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
- node.putBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS, true);
- node.putBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
- node.putBoolean(XMLCorePreferenceNames.FORMAT_SOURCE, true);
- node.putBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES, false);
- node.putBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION, true);
-
- node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
- node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, "UTF-8");//$NON-NLS-1$
- 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(XMLCorePreferenceNames.DEFAULT_EXTENSION, "xml"); //$NON-NLS-1$
-
- node.putBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR, true);
- // 1 = IMarker.SEVERITY_WARNING
- node.putInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, 1);
- node.putInt(XMLCorePreferenceNames.INDICATE_NO_DOCUMENT_ELEMENT, -1); // ignore
- node.putBoolean(XMLCorePreferenceNames.USE_XINCLUDE, false);
- node.putBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true);
- node.putBoolean(XMLCorePreferenceNames.CMDOCUMENT_GLOBAL_CACHE_ENABLED, true);
-
- node.putBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION, false);
- node.putInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE, 2);
- node.putInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_START_TAG, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_END_TAG, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_TAG_NAME, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_QUOTES, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET, 2);
- node.putInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE, 2);
- node.putInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET, 2);
- node.putInt(XMLCorePreferenceNames.WHITESPACE_AT_START, 2);
- node.putInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME, 2);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
deleted file mode 100644
index 4da44ce825..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.preferences;
-
-
-/**
- * Common preference keys used by XML core
- *
- * @plannedfor 1.0
- */
-public class XMLCorePreferenceNames {
- private XMLCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * The default extension to use when none is specified in the New File
- * Wizard.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
-
- /**
- * The maximum width of a line before a line split is needed.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-
- /**
- * Indicates if all blanks lines should be cleared during formatting.
- * Blank lines will be kept when false.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
- /**
- * The number of #INDENTATION_CHAR for 1 indentation.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String INDENTATION_SIZE = "indentationSize";//$NON-NLS-1$
-
- /**
- * The character used for indentation.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {TAB, SPACE}
- * </p>
- */
- public static final String INDENTATION_CHAR = "indentationChar";//$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * tab character when formatting.
- *
- * @see #SPACE
- * @see #INDENTATION_CHAR
- */
- public static final String TAB = "tab"; //$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * space character when formatting.
- *
- * @see #TAB
- * @see #INDENTATION_CHAR
- */
- public static final String SPACE = "space"; //$NON-NLS-1$
-
- /**
- * Indicates if tags with multiple attributes should be formatted
- * (splitting each attr on a new line).
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-
- /**
- * Indicates whether or not cleanup processor should format source.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
- /**
- * Indicates whether or not empty elements should be compressed during
- * cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert required attributes during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert missing tags during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to quote all attribute values during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert missing XML declarations during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>
- * </p>
- */
- public static final String FIX_XML_DECLARATION = "fixXMLDeclaration"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not to convert all line delimiters during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated - no longer used
- */
- public static final String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-
- /**
- * Indicates the line delimiter to use during cleanup if converting line
- * delimiters.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {CR, CRLF, LF, NO_TRANSLATION}
- * </p>
- *
- */
- public static final String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
- /**
- * Indicates whether or not a warning should be produced when validating a
- * file that specifies not grammar.
- * <p>
- * Value is of type <code>boolean</code>.<br />
- * Possible values: {TRUE, FALSE}
- * </p>
- * @deprecated
- */
- public static final String WARN_NO_GRAMMAR = "warnNoGrammar";//$NON-NLS-1$
-
- /**
- * Indicates whether or not a message should be produced when validating a
- * file that specifies not grammar.
- * <p>
- * Value is of type <code>integer</code>.<br />
- * Possible values: {0, 1, 2} (none, warning, error)
- * </p>
- */
- public static final String INDICATE_NO_GRAMMAR = "indicateNoGrammar";//$NON-NLS-1$
-
- /**
- * Indicates whether or not a message should be produced when validating a file that does not contain
- * a document element
- * <p>
- * Value is of type <code>integer</code>.<br/>
- * Possible values: {-1, 1, 2} (none, warning, error)
- * </p>
- */
- public static final String INDICATE_NO_DOCUMENT_ELEMENT = "indiciateNoDocumentElement"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not xincludes should be processed before
- * validation.
- * <p>
- * Value is of type <code>boolean</code>.<br />
- * Possible values: {TRUE, FALSE}
- * </p>
- *
- */
- public static final String USE_XINCLUDE = "xinclude";//$NON-NLS-1$
-
- /**
- * Indicates if all whitespace in tags with CDATA content should be
- * preserved.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String PRESERVE_CDATACONTENT = "preserveCDATAContent";//$NON-NLS-1$
-
- /**
- * Indicates if end brackets of start tags should be placed on a new line
- * if the start tag spans more than one line.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String ALIGN_END_BRACKET = "alignEndBracket";//$NON-NLS-1$
-
- /**
- * Indicates if an empty close tag should have a space inserted before
- * closing.
- * <p>
- * Value is of type <code>Boolean</code>
- * </p>
- */
- public static final String SPACE_BEFORE_EMPTY_CLOSE_TAG = "spaceBeforeEmptyCloseTag";//$NON-NLS-1$
-
- /**
- * Indicates whether or not all schema locations for XSD should be honoured
- * during XSD validation of XML.
- * <p>
- * Value is of type <code>boolean</code>.<br />
- * Possible values: {TRUE, FALSE}
- * </p>
- *
- */
- public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "honourAllSchemaLocations";//$NON-NLS-1$
-
- /**
- * Indicates whether or not the content of comments should be formatted
- * <p>
- * Value is of type <code>boolean</code><br />
- * Possible values: {TRUE, FALSE}
- * </p>
- */
- public static final String FORMAT_COMMENT_TEXT = "formatCommentText"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not the lines of comments should be joined when formatting
- * <p>
- * Value is of type <code>boolean</code>
- */
- public static final String FORMAT_COMMENT_JOIN_LINES = "formatCommentJoinLines"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not CMDocuments should be globally cached
- * <p>
- * Value is of type <code>boolean</code>
- */
- public static final String CMDOCUMENT_GLOBAL_CACHE_ENABLED = "cmDocumentGlobalCacheEnabled"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not MarkUpValidator should run as part of XMl Validation.
- * <p>
- * Value is of type <code>boolean</code>.<br />
- * Possible values: {TRUE, FALSE}
- * </p>
- */
- public static final String MARKUP_VALIDATION = "markupValidation"; //$NON-NLS-1$
-
- /**
- * Indicates whether or not a message should be produced when validating a
- * file that specifies following condition.
- * <p>
- * Value is of type <code>integer</code>.<br />
- * Possible values: {0, 1, 2} (none, warning, error)
- * </p>
- */
- public static final String ATTRIBUTE_HAS_NO_VALUE = "attributeHasNoValue"; //$NON-NLS-1$
- public static final String END_TAG_WITH_ATTRIBUTES = "endTagWithAttributes"; //$NON-NLS-1$
- public static final String WHITESPACE_BEFORE_TAGNAME = "whitespaceBeforeTagName"; //$NON-NLS-1$
- public static final String MISSING_CLOSING_BRACKET = "missingClosingBracket"; //$NON-NLS-1$
- public static final String MISSING_CLOSING_QUOTE = "missingClosingQuote"; //$NON-NLS-1$
- public static final String MISSING_END_TAG = "missingEndTag"; //$NON-NLS-1$
- public static final String MISSING_START_TAG = "missingStartTag"; //$NON-NLS-1$
- public static final String MISSING_QUOTES = "missingQuotes"; //$NON-NLS-1$
- public static final String NAMESPACE_IN_PI_TARGET = "namespaceInPITarget"; //$NON-NLS-1$
- public static final String MISSING_TAG_NAME = "missingTagName"; //$NON-NLS-1$
- public static final String WHITESPACE_AT_START = "whitespaceAtStart"; //$NON-NLS-1$
- public static final String USE_PROJECT_SETTINGS = "use-project-settings";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java
deleted file mode 100644
index 7376d4ee46..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterFactoryImpl.java
+++ /dev/null
@@ -1,113 +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.xml.core.internal.propagate;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-/**
- * The PropagatingAdapterFactory is part of the "adapt on create" mechanism. A
- * PropagatingAdapter, once added to a node, will cause proagating adapters to
- * be created for all child nodes. A side effect of creating a
- * PropagatingAdapter for a node is that is is also creates adapters for and
- * adapts the Node for all other registered 'create on adapt' Adapters. This
- * other adapters are registered by registering their factories via plugin
- * extension point.
- */
-public class PropagatingAdapterFactoryImpl extends AbstractAdapterFactory implements PropagatingAdapterFactory {
-
- private PropagatingAdapter fAdapterInstance;
- private List fContributedFactories = null;
-
- /**
- * PropagatingAdapterFactory constructor comment.
- */
- public PropagatingAdapterFactoryImpl() {
- this(PropagatingAdapter.class, true);
- }
-
- protected PropagatingAdapterFactoryImpl(Object adapterKey, boolean registerAdapters) { // ,
- super(adapterKey, registerAdapters);
- }
-
- public void addContributedFactories(INodeAdapterFactory factory) {
- if (fContributedFactories != null) {
- fContributedFactories.add(factory);
- }
-
- }
-
- /**
- * createAdapter method comment.
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- // every notifier get's one of these
- // (and the same instance of it)
- return getAdapterInstance();
- }
-
- /**
- * Gets the adapterInstance.
- *
- * @return Returns a PropagatingAdapter
- */
- private PropagatingAdapter getAdapterInstance() {
- if (fAdapterInstance == null) {
- fAdapterInstance = new PropagatingAdapterImpl();
- if (fContributedFactories != null) {
- for (int i = 0; i < fContributedFactories.size(); i++)
- fAdapterInstance.addAdaptOnCreateFactory((PropagatingAdapterFactory) fContributedFactories.get(i));
- }
- }
- return fAdapterInstance;
- }
-
- public void release() {
- // give the adapter instance a chance to release its factories
- getAdapterInstance().release();
-
- }
-
- public void setContributedFactories(ArrayList list) {
- fContributedFactories = list;
-
- }
-
- public INodeAdapterFactory copy() {
- PropagatingAdapterFactory clonedInstance = new PropagatingAdapterFactoryImpl(getAdapterKey(), isShouldRegisterAdapter());
- // clone this adapters specific list of adapter factories too
- if (fContributedFactories != null) {
-
- Iterator iterator = fContributedFactories.iterator();
- clonedInstance.setContributedFactories(new ArrayList());
- while (iterator.hasNext()) {
- INodeAdapterFactory existingFactory = (INodeAdapterFactory) iterator.next();
- clonedInstance.addContributedFactories(existingFactory.copy());
- }
- }
- return clonedInstance;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java
deleted file mode 100644
index f581590c35..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/propagate/PropagatingAdapterImpl.java
+++ /dev/null
@@ -1,144 +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.xml.core.internal.propagate;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class PropagatingAdapterImpl implements PropagatingAdapter {
-
- private List adaptOnCreateFactories = null;
-
- /**
- * AbstractPropagatingAdapterImpl constructor comment.
- */
- public PropagatingAdapterImpl() {
- super();
- }
-
- private void adaptOnCreate(IDOMNode node) {
- // give each of the factories a chance to adapt the node, if it
- // chooses to
- if (adaptOnCreateFactories != null) {
-
-
- synchronized (adaptOnCreateFactories) {
- int length = adaptOnCreateFactories.size();
- for (int i = 0; i < length; i++) {
- INodeAdapterFactory factory = (INodeAdapterFactory) adaptOnCreateFactories.get(i);
- factory.adapt(node);
- }
- }
-
- }
-
- }
-
- /**
- * This mechanism can be made "easier to use" later.
- */
- public void addAdaptOnCreateFactory(INodeAdapterFactory factory) {
- getAdaptOnCreateFactories().add(factory);
- }
-
- /**
- * Gets the adaptOnCreateFactories.
- *
- * @return Returns a List
- */
- public List getAdaptOnCreateFactories() {
- if (adaptOnCreateFactories == null)
- adaptOnCreateFactories = new ArrayList();
- return adaptOnCreateFactories;
- }
-
-
- /**
- * @see PropagatingAdapter#initializeForFactory(INodeAdapterFactory,
- * INodeNotifier)
- */
- public void initializeForFactory(INodeAdapterFactory factory, INodeNotifier node) {
- // ISSUE: we are a DOM specific implimentation,
- // we should not be.
- if (node instanceof IDOMNode) {
- IDOMNode xmlNode = (IDOMNode) node;
- propagateTo(xmlNode);
- }
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(PropagatingAdapter.class);
- }
-
- private boolean isInteresting(Object newValue) {
- return (newValue != null && (newValue instanceof Element || newValue instanceof Document || newValue instanceof DocumentType));
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // Issue: We only propagate to Elements ...
- // not attributes too! We should careful consider doning all when
- // when we improve "adapt on create" design.
- if (eventType == INodeNotifier.ADD && isInteresting(newValue)) {
- propagateTo((IDOMNode) newValue);
- }
- }
-
- private void propagateTo(IDOMNode node) {
- // get adapter to ensure its created
- node.getAdapterFor(PropagatingAdapter.class);
- adaptOnCreate(node);
- propagateToChildren(node);
- }
-
- private void propagateToChildren(IDOMNode parent) {
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- propagateTo((IDOMNode) child);
- }
- }
-
- /**
- * @see PropagatingAdapter#release()
- */
- public void release() {
- if (adaptOnCreateFactories != null) {
-
- synchronized (adaptOnCreateFactories) {
- int length = adaptOnCreateFactories.size();
- for (int i = 0; i < length; i++) {
- INodeAdapterFactory factory = (INodeAdapterFactory) adaptOnCreateFactories.get(i);
- factory.release();
- }
- }
-
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java
deleted file mode 100644
index b1fb483b99..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java
+++ /dev/null
@@ -1,39 +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.xml.core.internal.provisional;
-
-
-
-/**
- * XML Namespace constants
- *
- * @plannedfor 1.0
- */
-public interface IXMLCharEntity {
- static final String AMP_NAME = "amp";//$NON-NLS-1$
- static final String AMP_REF = "&amp;";//$NON-NLS-1$
- static final String AMP_VALUE = "&";//$NON-NLS-1$
- static final String APOS_NAME = "apos";//$NON-NLS-1$
- static final String APOS_REF = "&apos;";//$NON-NLS-1$
- static final String APOS_VALUE = "'";//$NON-NLS-1$
- static final String GT_NAME = "gt";//$NON-NLS-1$
- static final String GT_REF = "&gt;";//$NON-NLS-1$
- static final String GT_VALUE = ">";//$NON-NLS-1$
-
- static final String LT_NAME = "lt";//$NON-NLS-1$
- static final String LT_REF = "&lt;";//$NON-NLS-1$
- static final String LT_VALUE = "<";//$NON-NLS-1$
- static final String QUOT_NAME = "quot";//$NON-NLS-1$
- static final String QUOT_REF = "&quot;";//$NON-NLS-1$
- static final String QUOT_VALUE = "\"";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
deleted file mode 100644
index 10847db83c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xml.core.internal.provisional;
-
-
-
-/**
- * XML Namespace constants
- *
- * @plannedfor 1.0
- */
-public interface IXMLNamespace {
-
- String XMLNS = "xmlns";//$NON-NLS-1$
- String XMLNS_PREFIX = "xmlns:";//$NON-NLS-1$
- String XMLNS_URI = "http://www.w3.org/2000/xmlns/";//$NON-NLS-1$
- String XML = "xml";//$NON-NLS-1$
- String XML_PREFIX = "xml:";//$NON-NLS-1$
- String XML_URI = "http://www.w3.org/XML/1998/namespace";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java
deleted file mode 100644
index df49d48e1b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java
+++ /dev/null
@@ -1,55 +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.xml.core.internal.provisional;
-
-/**
- * Keys to use for preference settings.
- *
- * @plannedfor 1.0
- */
-
-public interface IXMLPreferenceNames {
- String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
- String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
- // cleanup preference names
- String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
- String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
- String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
- String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
- // others
- String LAST_ACTIVE_PAGE = "lastActivePage";//$NON-NLS-1$
- String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
- /*
- * not used for now // highlighting types String COMMENT_BORDER =
- * "commentBorder";//$NON-NLS-1$ String COMMENT_TEXT =
- * "commentText";//$NON-NLS-1$ String CDATA_BORDER =
- * "cdataBorder";//$NON-NLS-1$ String CDATA_TEXT =
- * "cdataText";//$NON-NLS-1$ String PI_BORDER = "piBorder";//$NON-NLS-1$
- * String PI_CONTENT = "piContent";//$NON-NLS-1$ String TAG_BORDER =
- * "tagBorder";//$NON-NLS-1$ String TAG_NAME = "tagName";//$NON-NLS-1$
- * String TAG_ATTRIBUTE_NAME = "tagAttributeName";//$NON-NLS-1$ String
- * TAG_ATTRIBUTE_VALUE = "tagAttributeValue";//$NON-NLS-1$ String
- * DECL_BORDER = "declBoder";//$NON-NLS-1$ String DOCTYPE_NAME =
- * "doctypeName";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID =
- * "doctypeExternalId";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID_PUBREF =
- * "doctypeExternalPubref";//$NON-NLS-1$ String DOCTYPE_EXTERNAL_ID_SYSREF =
- * "doctypeExtrenalSysref";//$NON-NLS-1$ String XML_CONTENT =
- * "xmlContent";//$NON-NLS-1$ // highlighting preferences String COMMA =
- * ",";//$NON-NLS-1$ String COLOR = "color";//$NON-NLS-1$ String NAME =
- * "name";//$NON-NLS-1$ String FOREGROUND = "foreground";//$NON-NLS-1$
- * String BACKGROUND = "background";//$NON-NLS-1$ String BOLD =
- * "bold";//$NON-NLS-1$ String ITALIC = "italic";//$NON-NLS-1$
- */
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java
deleted file mode 100644
index 496beb7234..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java
+++ /dev/null
@@ -1,63 +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.xml.core.internal.provisional;
-
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.parser.XML10Names;
-
-/**
- * This class provides consistent way to pre-check if a string is a valid XML
- * name, before, for example, trying to actually create an Element with it.
- * Attempting to create an Element with an invalid name will throw the appropriate
- * DOM Exception, but often clients want to check the validiting of a name
- * such as based on some user input, long in advance of actually making
- * the DOM call. And, natually, want to give the user feedback in a more
- * timely fashion.
- *
- * ISSUE: is "endns:" really valid xml name? I think not, but this method
- * (currently) says it is.
- *
- * @plannedfor 1.0
- */
-public final class NameValidator {
-
- private static XML10Names xml10charChecker = null;
-
- /**
- * Returns true if <code>name</code> is valid XML name according to XML
- * 1.0 rules, false otherwise.
- *
- * @param name
- * name is the string to test
- * @return true if valid name according to XML 1.0 rules, false otherwise.
- */
- public synchronized static final boolean isValid(String name) {
-
- if (xml10charChecker == null) {
- xml10charChecker = inititailizeXML10Names();
- }
- return xml10charChecker.isValidXML10Name(name);
- }
-
- private static XML10Names inititailizeXML10Names() {
- return new XML10Names((Reader) null);
- }
-
- /**
- * Not intenteded to be instantiated.
- */
- private NameValidator() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
deleted file mode 100644
index 3e6ff39c35..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.core.internal.provisional.contentmodel;
-
-
-public interface CMDocType {
- /**
- * CHTML files
- */
- public final static String CHTML_DOC_TYPE = "CHTML";//$NON-NLS-1$
- /**
- * HTML files
- */
- public final static String HTML_DOC_TYPE = "HTML";//$NON-NLS-1$
- /**
- * HTML5 files
- */
- public final static String HTML5_DOC_TYPE = "HTML5";//$NON-NLS-1$
- /**
- * JSP 1.1 files (currently includes 1.2 elements for backward behavioral compatibility)
- */
- public final static String JSP11_DOC_TYPE = "JSP11";//$NON-NLS-1$
- /**
- * JSP 1.2 files
- */
- public final static String JSP12_DOC_TYPE = "JSP12";//$NON-NLS-1$
- /**
- * JSP 2.0 JSP files
- */
- public final static String JSP20_DOC_TYPE = "JSP20";//$NON-NLS-1$
- /**
- * JSP 2.0 Tag files
- */
- public final static String TAG20_DOC_TYPE = "JSP20.TAG";//$NON-NLS-1$
- /**
- * JSP 2.1 Tag files
- */
- public final static String TAG21_DOC_TYPE = "JSP21.TAG";//$NON-NLS-1$
- /**
- * JSP 2.1 JSP files
- */
- public final static String JSP21_DOC_TYPE = "JSP21";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java
deleted file mode 100644
index 19baa552e9..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java
+++ /dev/null
@@ -1,32 +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.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-/**
- * Position dependent CMDocument tracker. A tracker matches a
- * IStructuredDocumentRegion with a CMDocument that it enables allowing for
- * position-dependent content models
- */
-public interface CMDocumentTracker {
-
- CMDocument getDocument();
-
- IStructuredDocumentRegion getStructuredDocumentRegion();
-}
-
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java
deleted file mode 100644
index dbe75d6799..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java
+++ /dev/null
@@ -1,21 +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.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public interface CMNodeWrapper extends CMNode {
- CMNode getOriginNode();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java
deleted file mode 100644
index a66811ee42..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java
+++ /dev/null
@@ -1,54 +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.xml.core.internal.provisional.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * ContentModelAdapter interface
- */
-public interface ContentModelAdapter extends org.eclipse.wst.sse.core.internal.provisional.INodeAdapter {
-
- /**
- * getCMDocument method
- *
- * @return CMDocument
- * @param notifer
- *
- * Returns CMDocument associated to the adapting node. For exampl : HTML
- * CMDocument is associated to HTML Document node, DTD CMDocument is
- * associated to DocumentType node, DTD/Schema CMDocument is associated to
- * Element node (sometime with namespace), and taglib CMDocument is
- * associated to taglib directive Element node.
- *
- * INodeNotifier is passed for stateless (singleton) INodeAdapter
- * implementation.
- */
- CMDocument getCMDocument(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier);
-
- /**
- * getDeclaration method
- *
- * @return CMNode
- * @param notifer
- *
- * Returns ElementDefinition or AttributeDefinition for the adapting node.
- *
- * INodeNotifier is passed for stateless (singleton) INodeAdapter
- * implementation.
- */
- CMNode getDeclaration(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java
deleted file mode 100644
index 0b2ee6ba9b..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java
+++ /dev/null
@@ -1,101 +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.xml.core.internal.provisional.contentmodel;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-/**
- * This class can be used to intialize specific variables that need a content
- * model, until the true content model is available. This prevents having to
- * do lots of null checks.
- */
-public class NullContentModel implements CMDocument {
-
- private static class NullCMNamedNodeMap implements CMNamedNodeMap {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new NullIterator();
- }
-
- }
-
- private static class NullIterator implements Iterator {
- public NullIterator() {
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
- }
-
- }
-
- public NullContentModel() {
- super();
- }
-
- public CMNamedNodeMap getElements() {
- return new NullCMNamedNodeMap();
- }
-
- public CMNamedNodeMap getEntities() {
- return new NullCMNamedNodeMap();
- }
-
- public CMNamespace getNamespace() {
- return null;
- }
-
- public String getNodeName() {
- return null;
- }
-
- public int getNodeType() {
- return 0;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java
deleted file mode 100644
index 67c3a90b03..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.provisional.contenttype;
-
-/**
- * This class, with its few 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.
- *
- * @plannedfor 1.0
- */
-final public class ContentTypeIdForXML {
- /**
- * This content type is actually supplied by base Eclipse. Its given here
- * just as documentation for WTP based clients. Typically, clients should
- * use the values/constants supplied by base Eclipse.
- */
- public final static String ContentTypeID_XML = getConstantString2();
- /**
- * This value is public only for testing and special infrastructure. The
- * constant nor is value should not be referenced by clients.
- *
- * 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_SSEXML = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeIdForXML() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.xml.core.xmlsource"; //$NON-NLS-1$
- }
-
- static String getConstantString2() {
- return "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java
deleted file mode 100644
index ee16e15de8..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java
+++ /dev/null
@@ -1,128 +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.xml.core.internal.provisional.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.Attr;
-
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- *
- * @plannedfor 1.0
- *
- */
-public interface IDOMAttr extends IDOMNode, Attr {
-
- /**
- * Get's the region in attribute representing the '=' sign. May or may not
- * have whitespace surrounding it.
- *
- * @deprecated -
- * ISSUE: need to change/remove to avoid exposing 'ITextRegion'
- * change to offset pattern, as others.
- *
- * @return ITextRegion - the region representing the equals sign, or null
- * if their is no equals sign.
- */
- ITextRegion getEqualRegion();
-
- /**
- * Gets the source location of the end of the attribute name, including
- * whitespace.
- *
- * @return int - the source location of the end of the attribute name,
- * including whitespace.
- */
- int getNameRegionEndOffset();
-
- /**
- * Gets the source location of the start of the attribute name.
- *
- * @return int - the source location of the start of the attribute name.
- */
- int getNameRegionStartOffset();
-
-
- /**
- * Gets the text associated with the attribute name.
- *
- * @return String - the text associated with the attribute name.
- */
- String getNameRegionText();
-
- /**
- * Gets the source location of the end of the attribute name, excluding
- * whitespace.
- *
- * @return int - returns the source location of the end of the attribute
- * name, excluding whitespace.
- */
- int getNameRegionTextEndOffset();
-
- /**
- * Gets the source location of the start of the attribute value.
- *
- * @return int - returns the source location of the start of the attribute
- * value.
- *
- * ISSUE: need to better spec interaction with quote marks
- */
- int getValueRegionStartOffset();
-
- /**
- * Gets the text associated with the attribute value.
- *
- * @return String - returns the text associated with the attribute value.
- */
- String getValueRegionText();
-
- /**
- * Check if Attr has a nested value (such as a JSP expression).
- *
- * @return true if contains a nested value, false otherwise.
- */
- boolean hasNestedValue();
-
- /**
- * Check if Attr has only name but not equal sign nor value.
- *
- * @return true if has only name but not equal sign nor value.
- */
- boolean hasNameOnly();
-
- /**
- * Returns true if attribute is defined globally for document. Returns
- * false if attribute is preceeded by a prefix (whether valid name space
- * or not). Returns true if its owning element is a global element.
- *
- * @return true if attribute is defined globally for document. Returns
- * false if attribute is preceeded by a prefix (whether valid name
- * space or not). Returns true if its owning element is a global
- * element.
- */
- boolean isGlobalAttr();
-
- /**
- * Returns true if is xml attr
- *
- * ISSUE: need to figure out how to specify this one in a meaningful way.
- *
- * @return boolean - returns true if is xml attr
- */
- boolean isXMLAttr();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java
deleted file mode 100644
index 4d69e58301..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java
+++ /dev/null
@@ -1,100 +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.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This interface enables creation of DOCTYPE declaration and some DOM Level 2
- * interfaces. May be referenced but not implemented by clients.
- *
- * @plannedfor 1.0
- */
-public interface IDOMDocument extends Node, Document, IDOMNode {
-
- /**
- * create comment element. tagName must be registered as comment element
- * name in plugin.xml
- *
- * @param tagName
- * the element name
- * @param isJSPTag
- * true if the element is JSP style comment (&lt;%-- ...
- * --%&gt;)
- * @return Element element instance
- * @throws DOMException
- * thrown if the element name is registered as comment element
- */
- Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException;
-
- /**
- * Creates a DocumentType node
- *
- * ISSUE: I believe this 'name' is the one specific in doctype extension,
- * need to verify.
- *
- * @param name -
- * name of the doctype
- * @return DocumentType - returns a document type node.
- */
- DocumentType createDoctype(String name);
-
- /**
- * Returns the DocumentType ID. Unlike the standard DOM approach of
- * "getDocumentType().getPublicId()", this method returns the id even if
- * implicit.
- *
- * @return the DocumentType ID
- */
- String getDocumentTypeId();
-
- /**
- * NOT API ... needs to be removed/changed
- *
- * ISSUE: need to specify
- *
- * @deprecated
- *
- * @return true if is JSPDocument
- *
- */
- boolean isJSPDocument();
-
- /**
- * NOT API ... needs to be removed/changed
- *
- * ISSUE: need to specify
- *
- * @deprecated
- *
- */
- boolean isJSPType();
-
- /**
- * NOT API ... may removed/changed
- *
- * ISSUE: need to specify -- currently used to denote an HTML DOM document
- * is XHTML
- *
- * @deprecated
- *
- */
- boolean isXMLType();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java
deleted file mode 100644
index 602c65e07c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java
+++ /dev/null
@@ -1,43 +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.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DocumentType;
-
-/**
- * This interface enables setting of Public and System ID for DOCTYPE
- * declaration.
- *
- * @plannedfor 1.0
- */
-public interface IDOMDocumentType extends IDOMNode, DocumentType {
-
-
- /**
- * Sets document type's public id, as source.
- *
- * @param String -
- * the publicId
- */
- void setPublicId(String publicId);
-
- /**
- * Sets docment type's system id, as source.
- *
- * @param String -
- * the systemId
- */
- void setSystemId(String systemId);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java
deleted file mode 100644
index fcd7763397..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java
+++ /dev/null
@@ -1,196 +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.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- *
- * @plannedfor 1.0
- *
- */
-public interface IDOMElement extends IDOMNode, Element {
-
- /**
- * Retuns the start offset of the end tag.
- *
- * ISSUE: need to sort out need for this
- *
- * @return int - the start offset of the end tag.
- */
- int getEndStartOffset();
-
- /**
- * Returns the end offset of the
- *
- * ISSUE: need to sort out need for this
- *
- * @return int - the end offset of the start tag.
- */
- int getStartEndOffset();
-
- /**
- * Returns true if has an end tag.
- *
- * In our source-oriented DOM, sometimes Elements are "ended", even
- * without an explicit end tag in the source.
- *
- * @return true if has an end tag.
- */
- boolean hasEndTag();
-
- /**
- * returns true if has a start tag.
- *
- * In our source-oriented DOM, a lone end tag will cause a node to be
- * created in the tree, unlike well-formed-only DOMs.
- *
- * @return true if has a start tag.
- */
- boolean hasStartTag();
-
- /**
- * returns true if this element is a comment element
- *
- * @return true if this element is a comment element
- */
- boolean isCommentTag();
-
- /**
- * isEmptyTag method
- *
- * @return boolean - true if is empty tag, false otherwise
- */
- boolean isEmptyTag();
-
- /**
- * Returns true if floating end tag.
- *
- * @return true if floating end tag.
- */
- boolean isEndTag();
-
- /**
- * Returns true for "global tag" (basically, without prefix)
- *
- * @return true for "global tag" (basically, without prefix)
- */
- boolean isGlobalTag();
-
- /**
- * Returns true for no start and the end tags in source.
- *
- * Provided for some very special cases when, for example, and HTML tag is
- * assumed in an HTML document that does not have a literal HTML tag.
- *
- * ISSUE: check with clients to see if still needed
- *
- * @return true or no start and the end tags in source.
- */
- boolean isImplicitTag();
-
- /**
- * isJSPTag method
- *
- * @return boolean
- *
- * ISSUE: change to isContainerLanguageTag(String type);
- */
- boolean isJSPTag();
-
- /**
- * Returns true if start tag is closed.
- *
- * @return true if start tag is closed.
- */
- boolean isStartTagClosed();
-
- /**
- * returns true if is xml tag
- *
- * ISSUE: need to spec this better.
- *
- * @return true if is xml tag
- */
- boolean isXMLTag();
-
- /**
- * NOT CLIENT API
- *
- * notifyEndTagChanged
- *
- */
- void notifyEndTagChanged();
-
- /**
- * NOT CLIENT API
- *
- * notifyStartTagChanged
- *
- */
- void notifyStartTagChanged();
-
- /**
- * NOT CLIENT API
- *
- * Signify that this tag is a comment
- *
- * For use only by parsers.
- *
- */
- void setCommentTag(boolean isCommentTag);
-
- /**
- * NOT CLIENT API
- *
- * Signify that this tag is an empty tag
- *
- * For use only by parsers
- */
- void setEmptyTag(boolean isEmptyTag);
-
- /**
- * NOT CLIENT API
- *
- * Signify that this tag is a JSP tag
- *
- * For use only by parsers
- *
- * ISSUE: I have had one non-parsing client who has had to use this ...
- * need to check
- *
- */
- void setJSPTag(boolean isJSPTag);
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttribute(String name, boolean isId);
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttributeNS(String namespaceURI, String localName, boolean isId);
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
- */
- public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java
deleted file mode 100644
index 3e22ec0587..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.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.xml.core.internal.provisional.document;
-
-import org.w3c.dom.Entity;
-
-public interface IDOMEntity extends Entity {
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
- */
- public String getInputEncoding();
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
- */
- public String getXmlEncoding();
-
- /**
- * NOT IMPLEMENTED. Is defined here in preparation of DOM 3.
- */
- public String getXmlVersion();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java
deleted file mode 100644
index da73e24db4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.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.xml.core.internal.provisional.document;
-
-public interface IDOMImplementation {
-
- /**
- * NOT IMPLEMENTED. This is defined here in preparation of DOM 3.
- *
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version, as specified in .
- * The specialized object may also be obtained by using binding-specific
- * casting methods but is not necessarily expected to, as discussed in .
- * This method also allow the implementation to provide specialized
- * objects which do not support the <code>DOMImplementation</code>
- * interface.
- *
- * @param feature
- * The name of the feature requested. Note that any plus sign
- * "+" prepended to the name of the feature will be ignored
- * since it is not significant in the context of this method.
- * @param version
- * This is the version number of the feature to test.
- * @return Returns an object which implements the specialized APIs of the
- * specified feature and version, if any, or <code>null</code>
- * if there is no object which implements interfaces associated
- * with that feature. If the <code>DOMObject</code> returned by
- * this method implements the <code>DOMImplementation</code>
- * interface, it must delegate to the primary core
- * <code>DOMImplementation</code> and not return results
- * inconsistent with the primary core
- * <code>DOMImplementation</code> such as
- * <code>hasFeature</code>, <code>getFeature</code>, etc.
- * @see DOM Level 3
- */
- public Object getFeature(String feature, String version);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java
deleted file mode 100644
index 3effc7ef0f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java
+++ /dev/null
@@ -1,59 +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.xml.core.internal.provisional.document;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.XMLModelNotifier;
-
-/**
- * Provides means to get the XMLModel form of IStrucutredModel. Not to be
- * implemented or extended by clients.
- *
- * @plannedfor 1.0
- */
-public interface IDOMModel extends IStructuredModel {
-
- /**
- * Returns the DOM Document.
- *
- * @return the DOM Document.
- */
- IDOMDocument getDocument();
-
- /**
- *
- * Returns an source generator appropriate for this model.
- *
- * @return the source generator
- */
- ISourceGenerator getGenerator();
-
- /**
- * NOT CLIENT API
- *
- * Returns an XMLModelNotifier. Clients should not use.
- *
- * ISSUE: should be "internalized".
- *
- */
- XMLModelNotifier getModelNotifier();
-
- /**
- * NOT CLIENT API
- *
- * Sets the model notifier Clients should not use.
- *
- * ISSUE: need to review with legacy clients.
- */
- void setModelNotifier(XMLModelNotifier notifier);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java
deleted file mode 100644
index ed8875f671..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java
+++ /dev/null
@@ -1,272 +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.xml.core.internal.provisional.document;
-
-
-
-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.xml.core.internal.document.InvalidCharacterException;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-/**
- * This interface describes the extended functionality of our source-oriented
- * DOM. First, our nodes extend the w3c Node interface, IndexedRegion, and
- * INodeNotifier. Plus, has the extra methods called out here.
- *
- * ISSUE: the 'read-only' API should be broken out in their own interface
- *
- * @plannedfor 1.0
- *
- */
-public interface IDOMNode extends IndexedRegion, INodeNotifier, Node {
-
- /**
- * Gets the last structured document region of this node.
- *
- * ISSUE: need to resolve getEnd/getLast confusion.
- *
- * @return IStructuredDocumentRegion - returns the last structured
- * document region associated with
- */
- IStructuredDocumentRegion getEndStructuredDocumentRegion();
-
- /**
- * Gets the first structured document region of this node.
- *
- * ISSUE: need to resolve getFirst/getStart confusion
- *
- * @return the first structured document region of this node.
- */
- IStructuredDocumentRegion getFirstStructuredDocumentRegion();
-
- /**
- * Gets the last structured document region of this node.
- *
- * ISSUE: need to resolve getEnd/getLast confusion.
- *
- * @return IStructuredDocumentRegion - returns the last structured
- * document region associated with
- */
- IStructuredDocumentRegion getLastStructuredDocumentRegion();
-
- /**
- * Returns the model associated with this node. Returns null if not part
- * of an active model.
- *
- * @return IDOMModel - returns the IDOMModel this node is part of.
- */
- IDOMModel getModel();
-
- /**
- * Get's the region representing the name of this node
- *
- * ISSUE: only implemented/used at attribute and DTDNodes -- should move.
- *
- * @return ITextRegion - returns the ITextRegion associated with this
- * Node.
- *
- * @deprecated
- */
- ITextRegion getNameRegion();
-
- /**
- * Returns the literal source representing this node in source document.
- *
- * ISSUE: need to fix implementation to match.
- *
- * @return the literal source representing this node in source document.
- */
- String getSource();
-
- /**
- * Gets the first structured document region of this node.
- *
- * ISSUE: need to resolve getFirst/getStart confusion
- *
- * @return the first structured document region of this node.
- */
- IStructuredDocumentRegion getStartStructuredDocumentRegion();
-
- /**
- * Returns the structured document that underlies this node's model.
- *
- * Returns null if this node is not actively part of a source document. In
- * contrast, in the pure DOM world, "owning document" is not null even
- * after a node is deleted from the DOM.
- *
- * ISSUE: we need to fix our implementation to match this spec.
- *
- * @return the structured document.
- */
- IStructuredDocument getStructuredDocument();
-
- /**
- * Get's the region representing the value of this node if only one
- * ITextRegion, null otherwise.
- *
- * ISSUE: only implemented/used at attribute level, move "down".
- *
- * @return ITextRegion - returns the ITextRegion associated with this
- * Node.
- *
- * @deprecated
- */
- ITextRegion getValueRegion();
-
- /**
- * Returns a string representing the source of this node, but with
- * character enties converted (e.g. &lt; is converted to '<').
- *
- * ISSUE: need to better spec extent of this conversion, we may not know
- * all character entities.
- *
- * ISSUE: need to fix implementation to match spec.
- *
- * @return String - get's the source of this Node.
- */
- String getValueSource();
-
- /**
- * Used to know read-only state of children.
- *
- * @return boolean Whether children of the element can be appended or
- * removed.
- */
- boolean isChildEditable();
-
- /**
- * Returns true if tag is closed in source.
- *
- * In our source orient DOM we sometimes end a Node without it being
- * explicitly closed in source.
- *
- * @return boolean - true if node is closed
- */
- boolean isClosed();
-
- /**
- * Returns true if this node can contain children.
- *
- * @return boolean - true if this node can contain children.
- */
- boolean isContainer();
-
- /**
- * Used to know read-only state of data.
- *
- */
- boolean isDataEditable();
-
- /**
- * Set's readonly state of children
- *
- */
- void setChildEditable(boolean editable);
-
- /**
- * Set's readonly state of data
- *
- */
- void setDataEditable(boolean editable);
-
- /**
- * Sets readonly state of data
- *
- * faster approach to set read-only state.
- */
- void setEditable(boolean editable, boolean deep);
-
- /**
- * Sets the specified raw source to the Text node. Throws
- * InvalidCharacterException when the specified raw source includes
- * invalid characters, such as, ' <', '>' and '&'. Valid character
- * entities, such as, "&amp;lt;", are accepted.
- */
- void setSource(String source) throws InvalidCharacterException;
-
- /**
- * Sets the specified raw source to the Text or Attr node's value. When
- * the specified raw source includes invalid characters, such as, ' <',
- * '>' and '&', converts them. Valid character entities, such as,
- * "&amp;lt;", are accepted.
- */
- void setValueSource(String source);
-
-
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public short compareDocumentPosition(Node other) throws DOMException;
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String getBaseURI();
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public Object getFeature(String feature, String version);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String getTextContent() throws DOMException;
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public Object getUserData(String key);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isEqualNode(Node arg);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isSameNode(Node other);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String lookupNamespaceURI(String prefix);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public String lookupPrefix(String namespaceURI);
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public void setTextContent(String textContent) throws DOMException;
-
-
- /**
- * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
- */
- public boolean isId();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java
deleted file mode 100644
index 67cec3bc7d..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java
+++ /dev/null
@@ -1,120 +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.xml.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Text;
-
-/**
- * This interface provides extensions to corresponding DOM interface to enable
- * functions for source editing and incremental parsing.
- *
- * @plannedfor 1.0
- *
- */
-public interface IDOMText extends IDOMNode, Text {
-
- /**
- * NOT API - can be eliminated or moved to ltk level
- *
- * Appends the content of the text node
- *
- * @param text -
- * the Text to append.
- */
- void appendText(Text text);
-
- /**
- * NOT API - can be eliminated or moved to ltk level
- *
- * Returns true if is not valid.
- */
- boolean isInvalid();
-
- /**
- * Returns true if is entirely white space.
- *
- * This is intened to be better performing that all clients getting the
- * source, and checking themselves.
- *
- * ISSUE: need to clarify if implementation is pure to "white space" as
- * per DOM spec? Here is the DOM spec:
- *
- * Returns whether this text node contains <a
- * href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * element content whitespace</a>, often abusively called "ignorable
- * whitespace". The text node is determined to contain whitespace in
- * element content during the load of the document or if validation occurs
- * while using <code>Document.normalizeDocument()</code>.
- *
- * @see DOM Level 3
- *
- * @return true if is entirely white space.
- */
-
- public boolean isElementContentWhitespace();
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Text#getWholeText()
- */
- public String getWholeText();
-
- /**
- * NOT YET IMPLEMENTED but exists here interface in preparation for DOM3
- *
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text. <br>
- * This method returns the node which received the replacement text. The
- * returned node is:
- * <ul>
- * <li><code>null</code>, when the replacement text is the empty
- * string; </li>
- * <li>the current node, except when the current node is read-only; </li>
- * <li> a new <code>Text</code> node of the same type (
- * <code>Text</code> or <code>CDATASection</code>) as the current
- * node inserted at the location of the replacement. </li>
- * </ul>
- * <br>
- * For instance, in the above example calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" with "yo" in argument results in the following: <br>
- * Where the nodes to be removed are read-only descendants of an
- * <code>EntityReference</code>, the <code>EntityReference</code>
- * must be removed instead of the read-only nodes. If any
- * <code>EntityReference</code> to be removed has descendants that are
- * not <code>EntityReference</code>, <code>Text</code>, or
- * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
- * method must fail before performing any modification of the document,
- * raising a <code>DOMException</code> with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>. <br>
- * For instance, in the example below calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" fails, because the <code>EntityReference</code> node
- * "ent" contains an <code>Element</code> node which cannot be removed.
- *
- * @param content
- * The content of the replacing <code>Text</code> node.
- * @return The <code>Text</code> node created with the specified
- * content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the
- * <code>Text</code> nodes being replaced is readonly.
- * @see DOM Level 3
- */
- public Text replaceWholeText(String content) throws DOMException;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java
deleted file mode 100644
index 473048cd52..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java
+++ /dev/null
@@ -1,201 +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.xml.core.internal.provisional.document;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- *
- * ISourceGenerator allows DOM models to generate source appropriate for their
- * parameter, relative to the model that provides the source generator.
- *
- */
-
-public interface ISourceGenerator {
-
- /**
- * Generate attribute name.
- *
- * @param attr -
- * the Attr
- * @return String - the string generated
- */
- String generateAttrName(Attr attr);
-
- /**
- * generateAttrValue
- *
- * @param attr -
- * the Attr
- * @return String - the string generated
- */
- String generateAttrValue(Attr attr);
-
- /**
- * generateAttrValue
- *
- * @param attr -
- * the Attr
- * @param char -
- * the type of quote desired (' or ").
- * @return String - the string generated
- */
- String generateAttrValue(Attr attr, char quote);
-
- /**
- * generateAttrValue
- *
- * @param value
- * the String value
- * @param char -
- * the type of quote desired (' or ").
- * @return String - the string generated
- */
- String generateAttrValue(String value, char quote);
-
- /**
- * generateCDATASection method
- *
- * @param comment
- * CDATASection
- * @return String - the string generated
- */
- String generateCDATASection(CDATASection cdata);
-
- /**
- * generateChild method
- *
- * @return String
- * @param Node
- * @return String - the string generated
- */
- String generateChild(Node parentNode);
-
- /**
- * generateCloseTag
- *
- * @param node -
- * the Node
- * @return String - the string generated
- */
- String generateCloseTag(Node node);
-
- /**
- * generateComment method
- *
- * @param comment
- * org.w3c.dom.Comment
- * @return String - the string generated
- */
- String generateComment(Comment comment);
-
- /**
- * generateDoctype method
- *
- * @param docType
- * DocumentType
- * @return String - the string generated
- */
- String generateDoctype(DocumentType docType);
-
- /**
- * generateElement method
- *
- * @param element -
- * Element
- * @return String - the string generated
- */
- String generateElement(Element element);
-
- /**
- * generateEndTag method
- *
- * @param element -
- * Element
- * @return String - the string generated
- */
- String generateEndTag(Element element);
-
- /**
- * generateEntityRef method
- *
- * @param entityRef
- * EntityReference
- * @return String - the string generated
- */
- String generateEntityRef(EntityReference entityRef);
-
- /**
- * generatePI method
- *
- * @param pi -
- * ProcessingInstruction
- * @return String - the string generated
- */
- String generatePI(ProcessingInstruction pi);
-
- /**
- * generateSource method
- *
- * @param node -
- * the Node
- * @return String - the string generated
- */
- String generateSource(Node node);
-
- /**
- * generateStartTag method
- *
- * @param element
- * Element
- * @return String - the string generated
- */
- String generateStartTag(Element element);
-
- /**
- * Generate tag name.
- *
- * @param element -
- * element
- * @return String - the string generated
- */
- String generateTagName(Element element);
-
- /**
- * generateText method
- *
- * @param text -
- * the Text
- * @return String - the string generated
- */
- String generateText(Text text);
-
- /**
- * generate text data
- *
- * @param text -
- * the Text
- * @param data -
- * the data
- * @return String - the string generated
- */
- String generateTextData(Text text, String data);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
deleted file mode 100644
index 7fba90580a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver (STAR) - bug 296999 - Inefficient use of new String()
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class CommentNodeFormatter extends NodeFormatter {
- static private final String CR = "\r"; //$NON-NLS-1$
- static private final String LF = "\n"; //$NON-NLS-1$
-
- protected String adjustIndentations(String aString, String lineIndent, String singleIndent) {
- String result = NodeFormatter.EMPTY_STRING;
-
- int indexOfLineDelimiter = StringUtils.indexOfLineDelimiter(aString);
- result = aString.substring(0, indexOfLineDelimiter);
- while (indexOfLineDelimiter != -1) {
- // Before find the next LineDelimiter, we have to figure out the
- // size of the current LineDelimiter
- // so we can figure out how many bytes to skip before finding the
- // next LineDelimiter.
- // Otherwise, we may treat the LF in CRLF as the next
- // LineDelimiter.
- int lineDelimiterSize = 1;
- if (aString.length() >= indexOfLineDelimiter + 2 && aString.substring(indexOfLineDelimiter, indexOfLineDelimiter + 1).compareTo(CR) == 0 && aString.substring(indexOfLineDelimiter + 1, indexOfLineDelimiter + 2).compareTo(LF) == 0)
- lineDelimiterSize = 2;
-
- int indexOfNextLineDelimiter = StringUtils.indexOfLineDelimiter(aString, indexOfLineDelimiter + lineDelimiterSize);
- int indexOfNonblank = StringUtils.indexOfNonblank(aString, indexOfLineDelimiter);
-
- if (indexOfNonblank != -1) {
- if (indexOfNextLineDelimiter == -1) {
- // last line; copy till the end
- result += lineIndent + singleIndent + aString.substring(indexOfNonblank);
- } else if (indexOfNextLineDelimiter != -1 && indexOfNextLineDelimiter < indexOfNonblank) {
- // blank line; just add a indent
- result += lineIndent + singleIndent;
- } else {
- // copy all text between indexOfNonblank and
- // indexOfNextLineDelimiter
- result += lineIndent + singleIndent + aString.substring(indexOfNonblank, indexOfNextLineDelimiter);
- }
-
- indexOfLineDelimiter = indexOfNextLineDelimiter;
- } else {
- if (indexOfNextLineDelimiter == -1) {
- result += lineIndent;
- } else {
- // blank line; just add a indent
- result += lineIndent + singleIndent;
- }
-
- indexOfLineDelimiter = indexOfNextLineDelimiter;
- }
- }
-
- return result;
- }
-
- protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- if (node != null) {
- // lineDelimiterFound means multi line comment
- String nodeValue = node.getNodeValue();
- boolean lineDelimiterFoundInComment = StringUtils.containsLineDelimiter(nodeValue);
-
- if (lineDelimiterFoundInComment) {
- // format indentation before node
- formatIndentationBeforeNode(node, formatContraints);
-
- // adjust indentations in multi line comment
- String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
- String lineIndent = formatContraints.getCurrentIndent();
- String singleIndent = getFormatPreferences().getIndent();
- String newNodevalue = adjustIndentations(nodeValue, lineDelimiter + lineIndent, singleIndent);
- if (nodeValue.compareTo(newNodevalue) != 0)
- node.setNodeValue(newNodevalue);
- }
-
- if (!nodeHasSiblings(node) || (node.getPreviousSibling() != null && node.getPreviousSibling().getNodeType() == Node.TEXT_NODE && !StringUtils.containsLineDelimiter(node.getPreviousSibling().getNodeValue()) && node.getNextSibling() == null)) {
- // single child
- // or inline comment after text
- // do nothing
- } else
- // format indentation after node
- formatIndentationAfterNode(node, formatContraints);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
deleted file mode 100644
index 297df28a1f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
+++ /dev/null
@@ -1,55 +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
- * Jesper Steen Møller - xml:space='preserve' support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-public class DocumentNodeFormatter extends NodeFormatter {
- protected void formatChildren(IDOMNode node, IStructuredFormatContraints formatContraints) {
- String singleIndent = getFormatPreferences().getIndent();
- String lineIndent = formatContraints.getCurrentIndent();
-
- if (node != null && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
- // normalize node first to combine adjacent text nodes
- node.normalize();
-
- IDOMNode nextChild = (IDOMNode) node.getFirstChild();
- while (nextChild != null) {
- IDOMNode eachChildNode = nextChild;
- nextChild = (IDOMNode) eachChildNode.getNextSibling();
- IStructuredFormatter formatter = getFormatter(eachChildNode);
- IStructuredFormatContraints childFormatContraints = formatter.getFormatContraints();
- String childIndent = lineIndent + singleIndent;
- childFormatContraints.setCurrentIndent(childIndent);
- childFormatContraints.setClearAllBlankLines(formatContraints.getClearAllBlankLines());
- childFormatContraints.setInPreserveSpaceElement(formatContraints.getInPreserveSpaceElement());
-
- // format each child
- formatter.format(eachChildNode, childFormatContraints);
-
- if (nextChild != null && nextChild.getParentNode() == null)
- // nextNode is deleted during format
- nextChild = (IDOMNode) eachChildNode.getNextSibling();
- }
- }
- }
-
- protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- if (node != null)
- formatChildren(node, formatContraints);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
deleted file mode 100644
index 6baf55b456..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Møller - xml:space='preserve' support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-
-public class ElementNodeFormatter extends DocumentNodeFormatter {
- static private final char DOUBLE_QUOTE = '"';//$NON-NLS-1$
- static private final String DOUBLE_QUOTES = "\"\"";//$NON-NLS-1$
- static private final char EQUAL_CHAR = '='; // equal sign$NON-NLS-1$
- static private final String PRESERVE = "preserve";//$NON-NLS-1$
- static private final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
- static private final char SINGLE_QUOTE = '\'';//$NON-NLS-1$
- static private final String XML_SPACE = "xml:space";//$NON-NLS-1$
- static private final char SPACE_CHAR = ' '; //$NON-NLS-1$
- static private final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; //$NON-NLS-1$
- static private final String XSL_ATTRIBUTE = "attribute"; //$NON-NLS-1$
- static private final String XSL_TEXT = "text"; //$NON-NLS-1$
-
- protected void formatEndTag(IDOMNode node, IStructuredFormatContraints formatContraints) {
- if (!isEndTagMissing(node)) {
- // end tag exists
-
- IStructuredDocument structuredDocument = node.getModel().getStructuredDocument();
- String lineDelimiter = structuredDocument.getLineDelimiter();
- String nodeIndentation = getNodeIndent(node);
- IDOMNode lastChild = (IDOMNode) node.getLastChild();
- if (lastChild != null && lastChild.getNodeType() != Node.TEXT_NODE) {
- if (isEndTagMissing(lastChild)) {
- // find deepest child
- IDOMNode deepestChild = (IDOMNode) lastChild.getLastChild();
- while (deepestChild != null && deepestChild.getLastChild() != null && isEndTagMissing(deepestChild)) {
- lastChild = deepestChild;
- deepestChild = (IDOMNode) deepestChild.getLastChild();
- }
-
- if (deepestChild != null) {
- if (deepestChild.getNodeType() == Node.TEXT_NODE) {
- // Special indentation handling if lastChild's end
- // tag is missing and deepestChild is a text node.
- String nodeText = deepestChild.getNodeValue();
-
- if (!nodeText.endsWith(lineDelimiter + nodeIndentation)) {
- nodeText = StringUtils.appendIfNotEndWith(nodeText, lineDelimiter);
- nodeText = StringUtils.appendIfNotEndWith(nodeText, nodeIndentation);
- }
-
- replaceNodeValue(deepestChild, nodeText);
- }
- else
- insertAfterNode(lastChild, lineDelimiter + nodeIndentation);
- }
- }
- else
- // indent end tag
- insertAfterNode(lastChild, lineDelimiter + nodeIndentation);
- }
- else if (lastChild == null && firstStructuredDocumentRegionContainsLineDelimiters(node)) {
- // BUG174243 do not indent end tag if node has empty content
- // (otherwise new text node would be introduced)
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
- CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
- if ((elementDeclaration == null) || (elementDeclaration.getContentType() != CMElementDeclaration.EMPTY)) {
- // indent end tag
- replace(structuredDocument, node.getFirstStructuredDocumentRegion().getEndOffset(), 0, lineDelimiter + nodeIndentation);
- }
- }
-
- // format end tag name
- IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getLastStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion.getRegions().size() >= 3) {
- ITextRegion endTagNameRegion = endTagStructuredDocumentRegion.getRegions().get(1);
- removeRegionSpaces(node, endTagStructuredDocumentRegion, endTagNameRegion);
- }
- }
- }
-
- protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- if (node != null) {
- // format indentation before node
- formatIndentationBeforeNode(node, formatContraints);
-
- // format start tag
- IDOMNode newNode = node;
- int startTagStartOffset = node.getStartOffset();
- IDOMModel structuredModel = node.getModel();
-
- boolean currentlyInXmlSpacePreserve = formatContraints.getInPreserveSpaceElement();
- formatStartTag(node, formatContraints);
- // save new node
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
-
- IStructuredDocumentRegion flatNode = newNode.getFirstStructuredDocumentRegion();
- if (flatNode != null) {
- ITextRegionList regions = flatNode.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- // format children and end tag if not empty start tag
- if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- // format children
- formatChildren(newNode, formatContraints);
-
- // save new node
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
-
- // format end tag
- formatEndTag(newNode, formatContraints);
- }
- }
-
- formatContraints.setInPreserveSpaceElement(currentlyInXmlSpacePreserve);
- // only indent if not at last node
- if (newNode != null && newNode.getNextSibling() != null)
- // format indentation after node
- formatIndentationAfterNode(newNode, formatContraints);
- }
- }
-
- /**
- * This method formats the start tag name, and formats the attributes if
- * available.
- */
- protected void formatStartTag(IDOMNode node, IStructuredFormatContraints formatContraints) {
- StructuredFormatPreferencesXML preferences = (StructuredFormatPreferencesXML) getFormatPreferences();
- String singleIndent = preferences.getIndent();
- String lineIndent = formatContraints.getCurrentIndent();
- String attrIndent = lineIndent + singleIndent;
- boolean splitMultiAttrs = preferences.getSplitMultiAttrs();
- boolean alignEndBracket = preferences.isAlignEndBracket();
- boolean sawXmlSpace = false;
-
- IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
- NamedNodeMap attributes = node.getAttributes();
-
- // Note: attributes should not be null even if the node has no
- // attributes. However, attributes.getLength() will be 0. But, check
- // for null just in case.
- if (attributes != null) {
- // compute current available line width
- int currentAvailableLineWidth = 0;
- try {
- // 1 is for "<"
- int nodeNameOffset = node.getStartOffset() + 1 + node.getNodeName().length();
- int lineOffset = node.getStructuredDocument().getLineInformationOfOffset(nodeNameOffset).getOffset();
- String text = node.getStructuredDocument().get(lineOffset, nodeNameOffset - lineOffset);
- int usedWidth = getIndentationLength(text);
- currentAvailableLineWidth = preferences.getLineWidth() - usedWidth;
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
-
- StringBuffer stringBuffer = new StringBuffer();
- String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
- int attrLength = attributes.getLength();
- int lastUndefinedRegionOffset = 0;
- boolean startTagSpansOver1Line = false;
-
- for (int i = 0; i < attrLength; i++) {
- AttrImpl attr = (AttrImpl) attributes.item(i);
- ITextRegion nameRegion = attr.getNameRegion();
- ITextRegion equalRegion = attr.getEqualRegion();
- ITextRegion valueRegion = attr.getValueRegion();
-
- // append undefined regions
- String undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, attr.getStartOffset() - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
- lastUndefinedRegionOffset = attr.getStartOffset();
-
- // check for xml:space attribute
- if (flatNode.getText(nameRegion).compareTo(XML_SPACE) == 0) {
- if (valueRegion == null) {
- // [111674] If nothing has been written yet, treat as
- // preserve, but only as hint
- formatContraints.setInPreserveSpaceElement(true);
- // Note we don't set 'sawXmlSpace', so that default or
- // fixed DTD/XSD values may override.
- }
- else {
- ISourceGenerator generator = node.getModel().getGenerator();
- String newAttrValue = generator.generateAttrValue(attr);
-
- // There is a problem in
- // StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
- // when the region is instanceof ContextRegion.
- // Workaround for now.
- if (flatNode.getText(valueRegion).length() == 1) {
- char firstChar = flatNode.getText(valueRegion).charAt(0);
- if ((firstChar == DOUBLE_QUOTE) || (firstChar == SINGLE_QUOTE))
- newAttrValue = DOUBLE_QUOTES;
- }
-
- if (newAttrValue.compareTo(PRESERVE_QUOTED) == 0)
- formatContraints.setInPreserveSpaceElement(true);
- else
- formatContraints.setInPreserveSpaceElement(false);
- sawXmlSpace = true;
- }
- }
-
- if (splitMultiAttrs && attrLength > 1) {
- stringBuffer.append(lineDelimiter + attrIndent);
- stringBuffer.append(flatNode.getText(nameRegion));
- startTagSpansOver1Line = true;
- if (valueRegion != null) {
- // append undefined regions
- undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(equalRegion) - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
- lastUndefinedRegionOffset = flatNode.getStartOffset(equalRegion);
-
- stringBuffer.append(EQUAL_CHAR);
-
- // append undefined regions
- undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(valueRegion) - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
- lastUndefinedRegionOffset = flatNode.getStartOffset(valueRegion);
-
- // Note: trim() should not be needed for
- // valueRegion.getText(). Just a workaround for a
- // problem found in valueRegion for now.
- stringBuffer.append(flatNode.getText(valueRegion).trim());
- }
- }
- else {
- if (valueRegion != null) {
- int textLength = 1 + flatNode.getText(nameRegion).length() + 1 + flatNode.getText(valueRegion).length();
- if (i == attrLength - 1) {
- if (flatNode != null) {
- ITextRegionList regions = flatNode.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)
- // 3 is for " />"
- textLength += 3;
- else
- // 1 is for ">"
- textLength++;
- }
- }
-
- if (currentAvailableLineWidth >= textLength) {
- stringBuffer.append(SPACE_CHAR);
- currentAvailableLineWidth--;
- }
- else {
- stringBuffer.append(lineDelimiter + attrIndent);
- startTagSpansOver1Line = true;
- currentAvailableLineWidth = preferences.getLineWidth() - attrIndent.length();
- }
-
- stringBuffer.append(flatNode.getText(nameRegion));
-
- // append undefined regions
- undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(equalRegion) - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
- lastUndefinedRegionOffset = flatNode.getStartOffset(equalRegion);
-
- stringBuffer.append(EQUAL_CHAR);
-
- // append undefined regions
- undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, flatNode.getStartOffset(valueRegion) - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
- lastUndefinedRegionOffset = flatNode.getStartOffset(valueRegion);
-
- // Note: trim() should not be needed for
- // valueRegion.getText(). Just a workaround for a
- // problem found in valueRegion for now.
- stringBuffer.append(flatNode.getText(valueRegion).trim());
-
- currentAvailableLineWidth -= flatNode.getText(nameRegion).length();
- currentAvailableLineWidth--;
- currentAvailableLineWidth -= flatNode.getText(valueRegion).trim().length();
- }
- else {
- if (currentAvailableLineWidth >= 1 + flatNode.getText(nameRegion).length()) {
- stringBuffer.append(SPACE_CHAR);
- currentAvailableLineWidth--;
- }
- else {
- stringBuffer.append(lineDelimiter + attrIndent);
- startTagSpansOver1Line = true;
- currentAvailableLineWidth = preferences.getLineWidth() - attrIndent.length();
- }
-
- stringBuffer.append(flatNode.getText(nameRegion));
-
- currentAvailableLineWidth -= flatNode.getText(nameRegion).length();
- }
- }
- }
-
- // append undefined regions
- String undefinedRegion = getUndefinedRegions(node, lastUndefinedRegionOffset, node.getEndOffset() - lastUndefinedRegionOffset);
- stringBuffer.append(undefinedRegion);
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- // 1 is for "<"
- int offset = node.getStartOffset() + 1 + node.getNodeName().length();
- // 1 is for "<"
- int length = node.getFirstStructuredDocumentRegion().getTextLength() - 1 - node.getNodeName().length();
-
- if (flatNode != null) {
- ITextRegionList regions = flatNode.getRegions();
- ITextRegion firstRegion = regions.get(0);
- ITextRegion lastRegion = regions.get(regions.size() - 1);
-
- if (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)
- // skip formatting for end tags in this format: </tagName>
- return;
- else {
- if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE || lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
- length = length - lastRegion.getLength();
-
- if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- // leave space before XML_EMPTY_TAG_CLOSE: <tagName />
- // unless already going to move end bracket
- if (!startTagSpansOver1Line || !alignEndBracket)
- stringBuffer.append(SPACE_CHAR);
- }
- }
- }
-
- if (startTagSpansOver1Line && alignEndBracket) {
- stringBuffer.append(lineDelimiter).append(lineIndent);
- }
-
- replace(structuredDocument, offset, length, stringBuffer.toString());
-
- // BUG108074 & BUG84688 - preserve whitespace in xsl:text &
- // xsl:attribute
- String nodeNamespaceURI = node.getNamespaceURI();
- if (XSL_NAMESPACE.equals(nodeNamespaceURI)) {
- String nodeName = ((Element) node).getLocalName();
- if (XSL_ATTRIBUTE.equals(nodeName) || XSL_TEXT.equals(nodeName)) {
- sawXmlSpace = true;
- formatContraints.setInPreserveSpaceElement(true);
- }
- }
-
- // If we didn't see a xml:space attribute above, we'll look for
- // one in the DTD.
- // We do not check for a conflict between a DTD's 'fixed' value
- // and the attribute value found in the instance document, we
- // leave that to the validator.
- if (!sawXmlSpace) {
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
- CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
- if (elementDeclaration != null) {
- int contentType = elementDeclaration.getContentType();
- if (preferences.isPreservePCDATAContent() && contentType == CMElementDeclaration.PCDATA) {
- formatContraints.setInPreserveSpaceElement(true);
- }
- else {
- CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
- // Check implied values from the DTD way.
- CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
- if (attributeDeclaration != null) {
- // CMAttributeDeclaration found, check it out.
- String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();
-
- // xml:space="preserve" means preserve space,
- // everything else means back to default.
- if (PRESERVE.compareTo(defaultValue) == 0)
- formatContraints.setInPreserveSpaceElement(true);
- else
- formatContraints.setInPreserveSpaceElement(false);
- }
- }
- }
- }
- }
- }
-
- protected String getUndefinedRegions(IDOMNode node, int startOffset, int length) {
- String result = NodeFormatter.EMPTY_STRING;
-
- IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
- ITextRegionList regions = flatNode.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- String regionType = region.getType();
- int regionStartOffset = flatNode.getStartOffset(region);
-
- if (regionType.compareTo(DOMRegionContext.UNDEFINED) == 0 && regionStartOffset >= startOffset && regionStartOffset < startOffset + length)
- result = result + flatNode.getFullText(region);
- }
-
- if (result.length() > 0)
- return SPACE_CHAR + result.trim();
- else
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java
deleted file mode 100644
index a798dbdbda..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.core.runtime.Preferences;
-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.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.w3c.dom.Node;
-
-public class FormatProcessorXML extends AbstractStructuredFormatProcessor {
- protected IStructuredFormatPreferences fFormatPreferences = null;
-
- protected String getFileExtension() {
- return "xml"; //$NON-NLS-1$
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setPreservePCDATAContent(preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
- if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-
- protected IStructuredFormatter getFormatter(Node node) {
- // 262135 - NPE during format of empty document
- if (node == null)
- return null;
-
- short nodeType = node.getNodeType();
- IStructuredFormatter formatter = null;
- switch (nodeType) {
- case Node.ELEMENT_NODE : {
- formatter = new ElementNodeFormatter();
- break;
- }
- case Node.TEXT_NODE : {
- formatter = new TextNodeFormatter();
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- formatter = new NoMoveFormatter();
- break;
- }
- case Node.COMMENT_NODE : {
- formatter = new CommentNodeFormatter();
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- formatter = new NodeFormatter();
- break;
- }
- case Node.DOCUMENT_NODE : {
- formatter = new DocumentNodeFormatter();
- break;
- }
- case Node.ENTITY_REFERENCE_NODE : {
- formatter = new NoMoveFormatter();
- break;
- }
- default : {
- formatter = new NodeFormatter();
- }
- }
-
- // init fomatter
- formatter.setFormatPreferences(getFormatPreferences());
- formatter.setProgressMonitor(fProgressMonitor);
-
- return formatter;
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void refreshFormatPreferences() {
- fFormatPreferences = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java
deleted file mode 100644
index 7b68ece73e..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java
+++ /dev/null
@@ -1,28 +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.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * Formats entities which really need no formatting. They are just like text
- * nodes.
- */
-class NoMoveFormatter extends NodeFormatter {
- protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // node nothing
- }
-
- protected void formatIndentationAfterNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // still do nothing
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
deleted file mode 100644
index f48ed184bf..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
+++ /dev/null
@@ -1,753 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Møller - xml:space='preserve' support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.document.CDATASectionImpl;
-import org.eclipse.wst.xml.core.internal.document.CharacterDataImpl;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-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.Node;
-
-public class NodeFormatter implements IStructuredFormatter {
- static protected final String EMPTY_STRING = ""; //$NON-NLS-1$
- static private final char SPACE_CHAR = ' '; //$NON-NLS-1$
- static private final char TAB_CHAR = '\t'; //$NON-NLS-1$
- static private final String TAB = "\t"; //$NON-NLS-1$
- protected IStructuredFormatContraints fFormatContraints = null;
- protected IStructuredFormatPreferences fFormatPreferences = null;
- protected IProgressMonitor fProgressMonitor = null;
-
- protected boolean firstStructuredDocumentRegionContainsLineDelimiters(IDOMNode node) {
- boolean result = false;
-
- if (node != null) {
- IStructuredDocumentRegion firstStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
- if (firstStructuredDocumentRegion != null) {
- String firstStructuredDocumentRegionText = firstStructuredDocumentRegion.getText();
- result = StringUtils.containsLineDelimiter(firstStructuredDocumentRegionText);
- }
- }
-
- return result;
- }
-
- public void format(Node node) {
- IStructuredFormatContraints formatContraints = getFormatContraints();
-
- format(node, formatContraints);
- }
-
- public void format(Node node, IStructuredFormatContraints formatContraints) {
- if (formatContraints.getFormatWithSiblingIndent())
- formatContraints.setCurrentIndent(getSiblingIndent(node));
-
- if (node instanceof IDOMNode)
- formatNode((IDOMNode) node, formatContraints);
- }
-
- protected void formatIndentationAfterNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // [111674] If inside xml:space="preserve" element, we bail
- if (formatContraints.getInPreserveSpaceElement())
- return;
- if (node != null) {
- IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
- IStructuredDocument doc = node.getModel().getStructuredDocument();
- String lineDelimiter = getLineDelimiter(node, doc);
-
- if (node.getParentNode() != null) {
- if (node.getParentNode().getNodeType() == Node.DOCUMENT_NODE)
- if (nextSibling != null)
- if (nextSibling.getNodeType() == Node.TEXT_NODE)
- getFormatter(nextSibling).format(nextSibling, formatContraints);
- else if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
- // do nothing
- }
- else {
- String lineIndent = formatContraints.getCurrentIndent();
- insertAfterNode(node, lineDelimiter + lineIndent);
- }
- else {
- }
-
- else if (nextSibling != null)
- if (nextSibling.getNodeType() == Node.TEXT_NODE)
- getFormatter(nextSibling).format(nextSibling, formatContraints);
- else if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
- // do nothing
- }
- else {
- String lineIndent = formatContraints.getCurrentIndent();
- insertAfterNode(node, lineDelimiter + lineIndent);
- }
- else {
- IDOMNode indentNode = getParentIndentNode(node);
- String lineIndent = getNodeIndent(indentNode);
- IDOMNode lastChild = getDeepestChildNode(node);
- boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
- if (lastChild != null) {
- if ((lastChild.getNodeType() == Node.TEXT_NODE) && (lastChild.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
- // this text node already ends with the requested
- // indentation
- }
-
- else if ((lastChild.getNodeType() == Node.TEXT_NODE) && (lastChild.getNodeValue() != null && lastChild.getNodeValue().endsWith(lineDelimiter)))
- if (clearAllBlankLines) {
- replaceNodeValue(lastChild, lineDelimiter + lineIndent);
- }
- else {
- // append indentation
- insertAfterNode(lastChild, lineIndent);
- }
- else if (lastChild.getNodeType() == Node.TEXT_NODE)
- if (lastChild.getNodeValue().length() == 0) {
- // replace
- replaceNodeValue(lastChild, lineDelimiter + lineIndent);
- }
- else {
- // append indentation
- insertAfterNode(lastChild, lineDelimiter + lineIndent);
- }
- else {
- // as long as not at the end of the document
- IStructuredDocumentRegion endRegion = node.getLastStructuredDocumentRegion();
- if (endRegion != null && endRegion.getNext() != null)
- // append indentation
- insertAfterNode(lastChild, lineDelimiter + lineIndent);
- }
- }
- }
- }
- }
- }
-
- protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // [111674] If inside xml:space="preserve" element, we bail
- if (formatContraints.getInPreserveSpaceElement())
- return;
- if (node != null) {
- IDOMNode previousSibling = (IDOMNode) node.getPreviousSibling();
- IStructuredDocument doc = node.getModel().getStructuredDocument();
- String lineDelimiter = getLineDelimiter(node, doc);
-
- String lineIndent = formatContraints.getCurrentIndent();
-
- if (node.getParentNode() != null) {
- if (node.getParentNode().getNodeType() == Node.DOCUMENT_NODE) {
- if (previousSibling != null)
- if (previousSibling.getNodeType() == Node.TEXT_NODE)
- getFormatter(previousSibling).format(previousSibling, formatContraints);
- else {
- insertBeforeNode(node, lineDelimiter + lineIndent);
- }
- }
- else {
- if (previousSibling == null || previousSibling.getNodeType() != Node.TEXT_NODE) {
- // 261968 - formatting tag without closing bracket:
- // <t1><t1
- // 265673 - Null ptr in formatIndentationBeforeNode
- int prevEndNodeOffset = -1;
- int prevEndRegionOffset = -1;
- if (previousSibling != null) {
- prevEndNodeOffset = previousSibling.getEndOffset();
- IStructuredDocumentRegion endRegion = previousSibling.getEndStructuredDocumentRegion();
- if (endRegion != null) {
- prevEndRegionOffset = endRegion.getTextEndOffset();
- }
- }
- if ((previousSibling == null) || (prevEndNodeOffset != -1 && prevEndNodeOffset == prevEndRegionOffset)) {
- insertBeforeNode(node, lineDelimiter + lineIndent);
- }
-
- }
- else {
- if (previousSibling.getNodeValue().length() == 0) {
- // replace
- replaceNodeValue(previousSibling, lineDelimiter + lineIndent);
- }
- else {
- // append indentation
- if (!previousSibling.getNodeValue().endsWith(lineDelimiter + lineIndent)) {
- if (previousSibling.getNodeValue().endsWith(lineDelimiter)) {
- insertAfterNode(previousSibling, lineIndent);
- }
- else
- getFormatter(previousSibling).format(previousSibling, formatContraints);
- }
- }
- }
- }
- }
- }
- }
-
- private String getLineDelimiter(IDOMNode node, IStructuredDocument doc) {
- int line = doc.getLineOfOffset(node.getStartOffset());
- String lineDelimiter = doc.getLineDelimiter();
- try {
- if (line > 0) {
- lineDelimiter = doc.getLineDelimiter(line - 1);
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- // BUG115716: if cannot get line delimiter from current line, just
- // use default line delimiter
- if (lineDelimiter == null)
- lineDelimiter = doc.getLineDelimiter();
- return lineDelimiter;
- }
-
- protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- if (node != null && (fProgressMonitor == null || !fProgressMonitor.isCanceled())) {
- // format indentation before node
- formatIndentationBeforeNode(node, formatContraints);
-
- // format indentation after node
- formatIndentationAfterNode(node, formatContraints);
- }
- }
-
- /**
- * This method will compute the correct indentation after this node
- * depending on the indentations of its sibling nodes and parent node. Not
- * needed anymore?
- */
- protected void formatTrailingText(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // [111674] If inside xml:space="preserve" element, we bail
- if (formatContraints.getInPreserveSpaceElement())
- return;
-
- String lineDelimiter = node.getModel().getStructuredDocument().getLineDelimiter();
- String lineIndent = formatContraints.getCurrentIndent();
- String parentLineIndent = getNodeIndent(node.getParentNode());
- boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
- if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE)) {
- IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
- if ((nextSibling != null) && (nextSibling.getNodeType() == Node.TEXT_NODE)) {
- String nextSiblingText = nextSibling.getNodeValue();
- if (nextSibling.getNextSibling() == null)
- if ((nextSibling.getParentNode().getNodeType() == Node.DOCUMENT_NODE) && (nextSiblingText.trim().length() == 0))
- // delete spaces at the end of the document
- replaceNodeValue(nextSibling, EMPTY_STRING);
- else
- // replace the text node with parent indentation
- replaceNodeValue(nextSibling, lineDelimiter + parentLineIndent);
- else
- // replace the text node with indentation
- replaceNodeValue(nextSibling, lineDelimiter + lineIndent);
- }
- else {
- if (nextSibling == null) {
- lineIndent = parentLineIndent;
-
- if (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)
- if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
- // this text node already ends with the requested
- // indentation
- }
-
- else if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter)))
- if (clearAllBlankLines)
- replaceNodeValue(node, lineDelimiter + lineIndent);
- else
- // append indentation
- insertAfterNode(node, lineIndent);
- else if (node.getNodeType() == Node.TEXT_NODE)
- if (node.getNodeValue().length() == 0)
- // replace
- replaceNodeValue(node, lineDelimiter + lineIndent);
- else
- // append indentation
- if (!node.getNodeValue().endsWith(lineDelimiter + lineIndent))
- if (node.getNodeValue().endsWith(lineDelimiter))
- insertAfterNode(node, lineIndent);
- else
- insertAfterNode(node, lineDelimiter + lineIndent);
- else
- replaceNodeValue(node, lineDelimiter + lineIndent);
- }
- else {
- if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter + lineIndent))) {
- // this text node already ends with the requested
- // indentation
- }
-
- else if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().endsWith(lineDelimiter)))
- if (clearAllBlankLines)
- replaceNodeValue(node, lineDelimiter + lineIndent);
- else
- // append indentation
- insertAfterNode(node, lineIndent);
- else if (node.getNodeType() == Node.TEXT_NODE)
- if (node.getNodeValue().length() == 0)
- // replace
- replaceNodeValue(node, lineDelimiter + lineIndent);
- else
- // append indentation
- insertAfterNode(node, lineDelimiter + lineIndent);
- else
- // append indentation
- insertAfterNode(node, lineDelimiter + lineIndent);
- }
- }
- }
- }
-
- protected IDOMNode getDeepestChildNode(IDOMNode node) {
- IDOMNode result = null;
- IDOMNode lastChild = (IDOMNode) node.getLastChild();
-
- if (lastChild == null)
- result = node;
- else {
- result = getDeepestChildNode(lastChild);
-
- if ((result.getNodeType() == Node.TEXT_NODE || result.getNodeType() == Node.COMMENT_NODE) && !isEndTagMissing(node))
- result = node;
- }
-
- return result;
- }
-
- public IStructuredFormatContraints getFormatContraints() {
- if (fFormatContraints == null) {
- fFormatContraints = new StructuredFormatContraints();
-
- fFormatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
- }
-
- return fFormatContraints;
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
- ((StructuredFormatPreferencesXML) fFormatPreferences).setPreservePCDATAContent(preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
- if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-
- protected IStructuredFormatter getFormatter(IDOMNode node) {
- // 262135 - NPE during format of empty document
- if (node == null)
- return null;
-
- short nodeType = ((Node) node).getNodeType();
- IStructuredFormatter formatter = null;
- switch (nodeType) {
- case Node.ELEMENT_NODE : {
- formatter = new ElementNodeFormatter();
- break;
- }
- case Node.TEXT_NODE : {
- formatter = new TextNodeFormatter();
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- formatter = new NoMoveFormatter();
- break;
- }
- case Node.COMMENT_NODE : {
- formatter = new CommentNodeFormatter();
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- formatter = new NodeFormatter();
- break;
- }
- case Node.DOCUMENT_NODE : {
- formatter = new DocumentNodeFormatter();
- break;
- }
- case Node.ENTITY_REFERENCE_NODE : {
- formatter = new NoMoveFormatter();
- break;
- }
- default : {
- formatter = new NodeFormatter();
- }
- }
-
- // init fomatter
- formatter.setFormatPreferences(getFormatPreferences());
- formatter.setProgressMonitor(fProgressMonitor);
-
- return formatter;
- }
-
- protected int getIndentationLength(String indent) {
- // TODO Kit : The calculation of IndentationLength is not correct
- // here.
- // nodeIndentation may contain tabs. Multiply by 4 temporarily to get
- // approx. width.
- // Need to re-work.
-
- int indentationLength = 0;
-
- for (int i = 0; i < indent.length(); i++) {
- if (indent.substring(i, i + 1).compareTo(TAB) == 0)
- indentationLength += 4;
- else
- indentationLength++;
- }
-
- return indentationLength;
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /**
- * This method will find the indentation for this node. It will search
- * backwards starting from the beginning of the node until a character
- * other than a space or a tab is found. If this node is null or it's a
- * document node or it's a first level node (node's parent is a document
- * node) the default empty string will be returned as the indentation.
- */
- protected String getNodeIndent(Node node) {
- String result = EMPTY_STRING;
-
- if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && (node.getParentNode() != null) && (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)) {
- IDOMNode siblingTextNode = (IDOMNode) node.getPreviousSibling();
- if ((siblingTextNode != null) && (siblingTextNode.getNodeType() == Node.TEXT_NODE)) {
- // find the indentation
- String siblingText = siblingTextNode.getNodeValue();
- int siblingTextLength = siblingText.length();
- if ((siblingText != null) && (siblingTextLength > 0) && ((siblingText.charAt(siblingTextLength - 1) == SPACE_CHAR) || (siblingText.charAt(siblingTextLength - 1) == TAB_CHAR))) {
- int searchIndex = siblingTextLength - 1;
- while ((searchIndex >= 0) && ((siblingText.charAt(searchIndex) == SPACE_CHAR) || (siblingText.charAt(searchIndex) == TAB_CHAR)))
- searchIndex--;
-
- if (searchIndex < siblingTextLength)
- result = siblingText.substring(searchIndex + 1, siblingTextLength);
- }
- }
- }
-
- return result;
- }
-
- protected String getNodeName(IDOMNode node) {
- return node.getNodeName();
- }
-
- protected String getNodeText(IDOMNode node) {
- String text = null;
-
- if ((node instanceof CharacterDataImpl) && !(node instanceof CommentImpl) && !(node instanceof CDATASectionImpl) && !isJSPTag(node))
- text = ((CharacterDataImpl) node).getSource();
- else
- text = node.getFirstStructuredDocumentRegion().getText();
-
- return text;
- }
-
- protected IDOMNode getParentIndentNode(IDOMNode node) {
- IDOMNode result = null;
- IDOMNode parentNode = (IDOMNode) node.getParentNode();
-
- if (parentNode.getNodeType() == Node.DOCUMENT_NODE)
- result = parentNode;
- else {
- ITextRegion region = parentNode.getLastStructuredDocumentRegion().getFirstRegion();
- if (region.getType() == DOMRegionContext.XML_END_TAG_OPEN)
- result = parentNode;
- else
- result = getParentIndentNode(parentNode);
- }
-
- return result;
- }
-
- /**
- * This method will find the indentation for a node sibling to this node.
- * It will try to find a sibling node before this node first. If there is
- * no sibling node before this node, it will try to find a sibling node
- * after this node. If still not found, we will check if this node is
- * already indented from its parent. If yes, this node's indentation will
- * be used. Otherwise, the parent node's indentation plus one indentation
- * will be used. If this node is null or it's a document node or it's a
- * first level node (node's parent is a document node) the default empty
- * string will be returned as the indentation.
- */
- protected String getSiblingIndent(Node node) {
- String result = EMPTY_STRING;
-
- if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && (node.getParentNode() != null) && (node.getParentNode().getNodeType() != Node.DOCUMENT_NODE)) {
- // find the text node before the previous non-text sibling
- // if that's not found, we will try the text node before the next
- // non-text sibling
- IDOMNode sibling = (IDOMNode) node.getPreviousSibling();
- while ((sibling != null) && (sibling.getNodeType() == Node.TEXT_NODE || sibling.getNodeType() == Node.COMMENT_NODE)) {
- if (sibling.getNodeType() == Node.COMMENT_NODE && sibling.getPreviousSibling() != null && sibling.getPreviousSibling().getNodeType() == Node.TEXT_NODE && StringUtils.containsLineDelimiter(sibling.getPreviousSibling().getNodeValue()))
- break;
- sibling = (IDOMNode) sibling.getPreviousSibling();
- }
- if (sibling == null) {
- sibling = (IDOMNode) node.getNextSibling();
- while ((sibling != null) && (sibling.getNodeType() == Node.TEXT_NODE))
- sibling = (IDOMNode) sibling.getNextSibling();
- }
- String singleIndent = getFormatPreferences().getIndent();
- String parentLineIndent = getNodeIndent(node.getParentNode());
-
- if (sibling != null) {
- String siblingIndent = getNodeIndent(sibling);
- if (siblingIndent.length() > 0)
- result = siblingIndent;
- else {
- String nodeIndent = getNodeIndent(node);
- if (nodeIndent.length() > parentLineIndent.length())
- // this node is indented from its parent, its
- // indentation will be used
- result = nodeIndent;
- else
- result = parentLineIndent + singleIndent;
- }
- }
- else {
- String nodeIndent = getNodeIndent(node);
- if (nodeIndent.length() > parentLineIndent.length())
- // this node is indented from its parent, its indentation
- // will be used
- result = nodeIndent;
- else
- result = parentLineIndent + singleIndent;
- }
- }
-
- return result;
- }
-
- protected void insertAfterNode(IDOMNode node, String string) {
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- int offset = node.getEndOffset();
- int length = 0;
-
- // 261968 - formatting tag without closing bracket: <t1><t1
- if (node.getEndStructuredDocumentRegion() != null) {
- offset = node.getEndStructuredDocumentRegion().getTextEndOffset();
- length = node.getEndOffset() - offset;
- }
- replace(structuredDocument, offset, length, string);
- }
-
- protected void insertBeforeNode(IDOMNode node, String string) {
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- replace(structuredDocument, node.getStartOffset(), 0, string);
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(IStructuredFormatter.class);
- }
-
- protected boolean isEndTagMissing(IDOMNode node) {
- boolean result = false;
-
- if ((node != null) && (node.getNodeType() != Node.DOCUMENT_NODE) && !isJSPTag(node)) {
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getLastStructuredDocumentRegion();
-
- ITextRegion startTagNameRegion = null;
- if (startTagStructuredDocumentRegion.getRegions().size() > 1)
- startTagNameRegion = startTagStructuredDocumentRegion.getRegions().get(1);
- ITextRegion endTagNameRegion = null;
- if (endTagStructuredDocumentRegion.getRegions().size() > 1)
- endTagNameRegion = endTagStructuredDocumentRegion.getRegions().get(1);
-
- ITextRegionList startTagRegions = startTagStructuredDocumentRegion.getRegions();
- if (startTagNameRegion == endTagNameRegion && startTagNameRegion != null && (startTagRegions.get(0)).getType() != DOMRegionContext.XML_END_TAG_OPEN && (startTagRegions.get(startTagRegions.size() - 1).getType()) != DOMRegionContext.XML_EMPTY_TAG_CLOSE)
- // end tag missing
- result = true;
- }
-
- return result;
- }
-
- protected boolean nodeHasSiblings(IDOMNode node) {
- return (node.getPreviousSibling() != null) || (node.getNextSibling() != null);
- }
-
- /**
- * Node changed. No format should be performed automatically.
- */
- public void notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- protected void removeRegionSpaces(IDOMNode node, IStructuredDocumentRegion flatNode, ITextRegion region) {
- if ((region != null) && (region instanceof ContextRegion || region instanceof TagNameRegion) && (flatNode.getEndOffset(region) > flatNode.getTextEndOffset(region))) {
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- replace(structuredDocument, flatNode.getTextEndOffset(region), flatNode.getEndOffset(region) - flatNode.getTextEndOffset(region), EMPTY_STRING);
- }
- }
-
- /**
- * This method will replace the string at offset and length with a new
- * string. If the string to be replaced is the same as the new string, the
- * string will not be replaced.
- */
- protected void replace(IStructuredDocument structuredDocument, int offset, int length, String string) {
- try {
- String structuredDocumentString = structuredDocument.get(offset, length);
- if (structuredDocumentString.compareTo(string) != 0)
- structuredDocument.replaceText(structuredDocument, offset, length, string);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /**
- * This method will replace the node value with a new string. If the node
- * value to be replaced is the same as the new string, the node value will
- * not be replaced.
- */
- protected void replaceNodeValue(IDOMNode node, String string) {
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- int offset = node.getStartOffset();
- int length = node.getEndOffset() - node.getStartOffset();
-
- try {
- String structuredDocumentString = structuredDocument.get(offset, length);
- if (structuredDocumentString.compareTo(string) != 0)
- replace(structuredDocument, offset, length, string);
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- public void setFormatPreferences(IStructuredFormatPreferences formatPreferences) {
- fFormatPreferences = formatPreferences;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.format.IStructuredFormatter#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void setProgressMonitor(IProgressMonitor monitor) {
- fProgressMonitor = monitor;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isJSPTag(Node node) {
-
- final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
- // final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
- // final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
- // final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
-
- final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
- final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
- final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
- final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
- // final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
- final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
- boolean result = false;
-
- if (node instanceof IDOMNode) {
- IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- // in some cases, the nodes exists, but hasn't been associated
- // with
- // a flatnode yet (the screen updates can be initiated on a
- // different thread,
- // so the request for a flatnode can come in before the node is
- // fully formed.
- // if the flatnode is null, we'll just allow the defaults to
- // apply.
- if (flatNode != null) {
- String flatNodeType = flatNode.getType();
- // should not be null, but just to be sure
- if (flatNodeType != null) {
- if ((flatNodeType.equals(JSP_CONTENT)) || (flatNodeType.equals(JSP_EXPRESSION_OPEN)) || (flatNodeType.equals(JSP_SCRIPTLET_OPEN)) || (flatNodeType.equals(JSP_DECLARATION_OPEN)) || (flatNodeType.equals(JSP_DIRECTIVE_CLOSE)) || (flatNodeType.equals(JSP_DIRECTIVE_NAME)) || (flatNodeType.equals(JSP_DIRECTIVE_OPEN)) || (flatNodeType.equals(JSP_CLOSE))) {
- result = true;
- }
- }
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java
deleted file mode 100644
index 07024eb3f5..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatPreferences;
-
-public class StructuredFormatPreferencesXML extends StructuredFormatPreferences {
- private boolean fSplitMultiAttrs = false;
- private boolean fPreservePCDATAContent = false;
- private boolean fAlignEndBracket = false;
-
- /**
- * True if formatter should split elements with multiple attributes onto
- * new lines.
- *
- * @return boolean
- */
- public boolean getSplitMultiAttrs() {
- return fSplitMultiAttrs;
- }
-
- /**
- * Sets whether or not formatter should split elements with multiple
- * attributes onto new lines.
- *
- * @param splitMultiAttrs
- */
- public void setSplitMultiAttrs(boolean splitMultiAttrs) {
- fSplitMultiAttrs = splitMultiAttrs;
- }
-
- /**
- * True if tags with PCDATA content should not have their whitespace
- * messed with when formatting.
- *
- * @return boolean
- */
- public boolean isPreservePCDATAContent() {
- return fPreservePCDATAContent;
- }
-
- /**
- * Sets whether or not formatter should preserve whitespace in tags with
- * PCDATA content.
- *
- * @param preservePCDATAContent
- */
- public void setPreservePCDATAContent(boolean preservePCDATAContent) {
- fPreservePCDATAContent = preservePCDATAContent;
- }
-
- /**
- * True if end brackets of start tags should be placed on a new line if
- * the start tag spans more than one line.
- *
- * @return
- */
- public boolean isAlignEndBracket() {
- return fAlignEndBracket;
- }
-
- /**
- * Sets whether or not formatter should align the end bracket of a start
- * tag on a new line if the start tag spans more than one line.
- *
- * @param alignEndBracket
- */
- public void setAlignEndBracket(boolean alignEndBracket) {
- fAlignEndBracket = alignEndBracket;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
deleted file mode 100644
index 873ab766e4..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
+++ /dev/null
@@ -1,385 +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
- * Jesper Steen Møller - xml:space='preserve' support
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.provisional.format;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class TextNodeFormatter extends NodeFormatter {
- static private final String CR = "\r"; //$NON-NLS-1$
- static private final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
- static private final String EMPTY_STRING = ""; //$NON-NLS-1$
- static private final String FF = "\f"; //$NON-NLS-1$
- static private final String LF = "\n"; //$NON-NLS-1$
- static private final String SPACE = " "; //$NON-NLS-1$
- static private final String TAB = "\t"; //$NON-NLS-1$
-
- private String compressSpaces(String string, IStructuredFormatContraints formatContraints) {
- /*
- * Note that the StructuredTextEditor supports mixed new line
- * characters (CR, LF, CRLF) in one file. We have to handle that when
- * we try to preserve blank lines.
- */
- String[] stringArray = null;
- boolean clearAllBlankLines = formatContraints.getClearAllBlankLines();
-
- if (clearAllBlankLines)
- stringArray = StringUtils.asArray(string);
- else
- stringArray = StringUtils.asArray(string, DELIMITERS, true);
-
- StringBuffer compressedString = new StringBuffer();
- if (stringArray.length > 0) {
- boolean cr = false, lf = false, cr2 = false, nonSpace = true;
-
- if (stringArray[0].compareTo(CR) == 0)
- cr = true;
- else if (stringArray[0].compareTo(LF) == 0)
- lf = true;
- else if ((stringArray[0].compareTo(SPACE) != 0) && (stringArray[0].compareTo(TAB) != 0) && (stringArray[0].compareTo(FF) != 0)) {
- compressedString.append(stringArray[0]);
- nonSpace = true;
- }
-
- for (int i = 1; i < stringArray.length; i++) {
- if (stringArray[i].compareTo(CR) == 0) {
- if (cr && lf) {
- if (nonSpace) {
- compressedString.append(CR + LF);
- nonSpace = false;
- }
- compressedString.append(stringArray[i]);
- cr2 = true;
- }
- else if (cr) {
- if (nonSpace) {
- compressedString.append(CR);
- nonSpace = false;
- }
- compressedString.append(stringArray[i]);
- cr2 = true;
- }
- else
- cr = true;
- }
- else if (stringArray[i].compareTo(LF) == 0) {
- if (cr && lf && cr2) {
- compressedString.append(stringArray[i]);
- }
- else if (lf) {
- if (nonSpace) {
- compressedString.append(LF);
- nonSpace = false;
- }
- compressedString.append(stringArray[i]);
- }
- else
- lf = true;
- }
- else if ((stringArray[i].compareTo(SPACE) != 0) && (stringArray[i].compareTo(TAB) != 0) && (stringArray[i].compareTo(FF) != 0)) {
- if (compressedString.length() > 0)
- compressedString.append(SPACE);
- compressedString.append(stringArray[i]);
-
- cr = false;
- lf = false;
- cr2 = false;
- nonSpace = true;
- }
- }
- }
-
- return compressedString.toString();
- }
-
- protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
- // [111674] If inside xml:space="preserve" element, we bail
- if (formatContraints.getInPreserveSpaceElement())
- return;
- if (node != null) {
- IStructuredDocument doc = node.getStructuredDocument();
-
- int lineWidth = getFormatPreferences().getLineWidth();
- int currentAvailableLineWidth = computeAvailableLineWidth(doc, node.getStartOffset(), lineWidth);
-
- String nodeText = getNodeText(node);
- String compressedText = compressSpaces(nodeText, formatContraints);
-
- IDOMNode parentNode = (IDOMNode) node.getParentNode();
-
- if (((enoughSpace(parentNode, currentAvailableLineWidth, compressedText)) && (noSiblingsAndNoFollowingComment(node)) && !firstStructuredDocumentRegionContainsLineDelimiters(parentNode)) || node.getStartOffset() == 0) {
- handleNoReflow(node, doc, compressedText, parentNode);
- }
- else {
- // not enough space, need to reflow text
- String nodeIndentation = formatContraints.getCurrentIndent();
- currentAvailableLineWidth = lineWidth - getIndentationLength(nodeIndentation);
- List vector = reflowText(compressedText, currentAvailableLineWidth);
- int vectorSize = vector.size();
- StringBuffer reflowedTextBuffer = new StringBuffer();
- String lineDelimiter = getLineDelimiter(doc, node.getStartOffset());
- // handle first line specially to check for allowWhitespace
- if (vectorSize > 0) {
- // determines whether or not to allow whitespace if there
- // is an entity or cdata before it
- boolean allowWhitespace = true;
- // [206072] StringIndexOutOfBoundsException
- if (nodeText.length() == 0 || !Character.isWhitespace(nodeText.charAt(0))) {
- Node previousSibling = node.getPreviousSibling();
- if (previousSibling != null && (previousSibling.getNodeType() == Node.ENTITY_REFERENCE_NODE || previousSibling.getNodeType() == Node.CDATA_SECTION_NODE))
- allowWhitespace = false;
- }
- String theString = (String) vector.get(0);
- if (allowWhitespace) {
- reflowedTextBuffer.append(lineDelimiter);
- if (theString.trim().length() > 0)
- reflowedTextBuffer.append(nodeIndentation).append(theString);
- }
- else {
- reflowedTextBuffer.append(theString);
- }
- }
- // do the rest of the lines
- for (int i = 1; i < vectorSize; i++) {
- String theString = (String) vector.get(i);
- if (theString.trim().length() > 0)
- reflowedTextBuffer.append(lineDelimiter).append(nodeIndentation).append(theString);
- else
- reflowedTextBuffer.append(lineDelimiter);
- }
- String reflowedText = reflowedTextBuffer.toString();
- if (node.getNextSibling() == null) {
- if (isEndTagMissing(parentNode)) {
- // don't add indentation to end if parent end tag is
- // missing
- }
-
- else {
- // add parent's indentation to end
- nodeIndentation = getNodeIndent(parentNode);
- if (!reflowedText.endsWith(lineDelimiter + nodeIndentation)) {
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
- }
- }
- }
- else {
- if (!reflowedText.endsWith(lineDelimiter + nodeIndentation)) {
- // not already ended with the expected indentation
- Node nextSibling = node.getNextSibling();
- if (nextSibling.getNodeType() == Node.COMMENT_NODE) {
- // add indentation to end if
- // currentTextEndsWithLineDelimiter
- // or followed by multiLineComment
-
- int indexOfLastLineDelimiter = StringUtils.indexOfLastLineDelimiter(nodeText);
- boolean currentTextEndsWithLineDelimiter = indexOfLastLineDelimiter != -1;
- if (currentTextEndsWithLineDelimiter) {
- // no more non blank character after the last
- // line delimiter
- currentTextEndsWithLineDelimiter = StringUtils.indexOfNonblank(nodeText, indexOfLastLineDelimiter) == -1;
- }
-
- String nodeValue = nextSibling.getNodeValue();
- boolean multiLineComment = StringUtils.containsLineDelimiter(nodeValue);
-
- if (currentTextEndsWithLineDelimiter || multiLineComment) {
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
- }
- }
- else if (nextSibling.getNodeType() == Node.ENTITY_REFERENCE_NODE || nextSibling.getNodeType() == Node.CDATA_SECTION_NODE) {
- int textLength = nodeText.length();
- if (textLength > 0 && Character.isWhitespace(nodeText.charAt(textLength - 1))) {
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
- }
- }
- else {
- // not a comment, just add add indentation to end
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, lineDelimiter);
- reflowedText = StringUtils.appendIfNotEndWith(reflowedText, nodeIndentation);
- }
- }
- }
-
- replaceNodeValue(node, reflowedText);
- }
- }
- }
-
- /**
- * Keeps text inline with its parent (no reflow necessary)
- *
- * @param node
- * @param doc
- * @param compressedText
- * @param parentNode
- */
- private void handleNoReflow(IDOMNode node, IStructuredDocument doc, String compressedText, IDOMNode parentNode) {
- String nodeIndentation;
- // enough space and text has no line delimiters and (node has no
- // siblings or followed by inline comment) and
- // parentFirstStructuredDocumentRegionContainsLineDelimiters
-
- if (isEndTagMissing(parentNode)) {
- parentNode = (IDOMNode) parentNode.getParentNode();
- while (isEndTagMissing(parentNode))
- parentNode = (IDOMNode) parentNode.getParentNode();
-
- // add parent's indentation to end
- nodeIndentation = getNodeIndent(parentNode);
- String lineDelimiter = getLineDelimiter(doc, node.getStartOffset());
- if (!compressedText.endsWith(lineDelimiter + nodeIndentation)) {
- compressedText = StringUtils.appendIfNotEndWith(compressedText, lineDelimiter);
- compressedText = StringUtils.appendIfNotEndWith(compressedText, nodeIndentation);
- }
- }
-
- if ((parentNode != null) && (parentNode.getNodeType() == Node.DOCUMENT_NODE) && (node.getNodeValue().length() > 0) && (node.getNodeValue().trim().length() == 0) && ((node.getPreviousSibling() == null) || (node.getNextSibling() == null)))
- // delete spaces at the beginning or end of the document
- compressedText = EMPTY_STRING;
-
- replaceNodeValue(node, compressedText);
- }
-
- private boolean noSiblingsAndNoFollowingComment(IDOMNode node) {
- IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
- return !nodeHasSiblings(node) || (noLineDelimiter(node) && isComment(nextSibling) && noLineDelimiter(nextSibling));
- }
-
- private boolean isComment(IDOMNode node) {
- boolean result = false;
- if (node != null) {
- result = node.getNodeType() == Node.COMMENT_NODE;
- }
- return result;
- }
-
- private boolean noLineDelimiter(IDOMNode node) {
- boolean result = false;
- if (node != null) {
- result = !StringUtils.containsLineDelimiter(node.getNodeValue());
- }
- return result;
- }
-
- /**
- * Calculates if there is enough space on the current line for
- * compressedText (and for its parent end tag)
- *
- * @param parentNode
- * @param currentAvailableLineWidth
- * @param compressedText
- * @return
- */
- private boolean enoughSpace(IDOMNode parentNode, int currentAvailableLineWidth, String compressedText) {
- int parentEndTagLength = parentNode.getNodeName().length() + 3;
- return compressedText.length() <= (currentAvailableLineWidth - parentEndTagLength) && !StringUtils.containsLineDelimiter(compressedText);
- }
-
- protected Vector reflowText(String text, int availableWidth) {
- String[] stringArray = null;
- boolean clearAllBlankLines = getFormatPreferences().getClearAllBlankLines();
-
- if (clearAllBlankLines)
- stringArray = StringUtils.asArray(text);
- else
- stringArray = StringUtils.asArray(text, DELIMITERS, true);
-
- Vector output = new Vector();
- if ((stringArray != null) && (stringArray.length > 0)) {
- StringBuffer buffer = new StringBuffer();
- if (stringArray[0].compareTo(CR) != 0)
- buffer.append(stringArray[0]);
- int bufferLength = stringArray[0].toString().length();
- boolean cr = stringArray[0].compareTo(CR) == 0;
-
- for (int i = 1; i < stringArray.length; i++) {
- String eachString = stringArray[i];
- if ((eachString.compareTo(SPACE) != 0) && (eachString.compareTo(TAB) != 0) && (eachString.compareTo(FF) != 0)) {
- if ((bufferLength + 1 + eachString.length() > availableWidth) || (eachString.compareTo(CR) == 0) || (eachString.compareTo(LF) == 0)) {
- if ((eachString.compareTo(LF) == 0) && cr) {
- // do nothing
- }
- else {
- output.add(buffer.toString());
- buffer = new StringBuffer();
- bufferLength = 0;
- }
- cr = eachString.compareTo(CR) == 0;
- }
- else if (buffer.toString().trim().length() > 0) {
- buffer.append(SPACE);
- bufferLength++;
- }
- if ((eachString.compareTo(CR) != 0) && (eachString.compareTo(LF) != 0)) {
- buffer.append(eachString);
- bufferLength = bufferLength + eachString.length();
- }
- }
- }
- output.add(buffer.toString());
- }
- else
- output.add(text);
-
- return output;
- }
-
- private String getLineDelimiter(IStructuredDocument doc, int nodeOffset) {
- int line = doc.getLineOfOffset(nodeOffset);
- String lineDelimiter = doc.getLineDelimiter();
- try {
- if (line > 0) {
- lineDelimiter = doc.getLineDelimiter(line - 1);
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- // BUG115716: if cannot get line delimiter from current line, just
- // use default line delimiter
- if (lineDelimiter == null)
- lineDelimiter = doc.getLineDelimiter();
- return lineDelimiter;
- }
-
- private int computeAvailableLineWidth(IStructuredDocument doc, int nodeOffset, int lineWidth) {
- // compute current available line width
- int currentAvailableLineWidth = 0;
- try {
- int lineOffset = doc.getLineInformationOfOffset(nodeOffset).getOffset();
- String text = doc.get(lineOffset, nodeOffset - lineOffset);
- int usedWidth = getIndentationLength(text);
- currentAvailableLineWidth = lineWidth - usedWidth;
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- return currentAvailableLineWidth;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
deleted file mode 100644
index 5d36751dca..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.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.wst.xml.core.internal.provisional.text;
-
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for XML.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @deprecated use org.eclipse.wst.xml.core.text
- */
-public interface IXMLPartitions {
-
- String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$
- String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$
- String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$
- String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$
- String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$
-
- /*
- * This value is used as a prefix to any unknown processing instructions
- * we find. The processor target name is converted to uppercase and
- * appended to the prefix to create a unique partition type.
- */
- String PROCESSING_INSTRUCTION_PREFIX = "org.eclipse.wst.xml.PROCESSING_INSTRUCTION:"; //$NON-NLS-1$
-
- /**
- * Should match
- * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET
- */
- String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java
deleted file mode 100644
index 4a73d8d431..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java
+++ /dev/null
@@ -1,69 +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.xml.core.internal.regions;
-
-public interface DOMRegionContext {
-
- public static final String BLOCK_TEXT = "BLOCK_TEXT"; //$NON-NLS-1$
-
- public static final String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
-
- public static final String WHITE_SPACE = "WHITE_SPACE"; //$NON-NLS-1$
- public static final String XML_ATTLIST_DECL_CLOSE = "XML_ATTLIST_DECL_CLOSE"; //$NON-NLS-1$
- public static final String XML_ATTLIST_DECL_CONTENT = "XML_ATTLIST_DECL_CONTENT"; //$NON-NLS-1$
- public static final String XML_ATTLIST_DECL_NAME = "XML_ATTLIST_DECL_NAME"; //$NON-NLS-1$
-
- public static final String XML_ATTLIST_DECLARATION = "XML_ATTLIST_DECLARATION"; //$NON-NLS-1$
- public static final String XML_CDATA_CLOSE = "XML_CDATA_CLOSE"; //$NON-NLS-1$
- public static final String XML_CDATA_OPEN = "XML_CDATA_OPEN"; //$NON-NLS-1$
- public static final String XML_CDATA_TEXT = "XML_CDATA_TEXT"; //$NON-NLS-1$
- public static final String XML_CHAR_REFERENCE = "XML_CHAR_REFERENCE"; //$NON-NLS-1$
- public static final String XML_COMMENT_CLOSE = "XML_COMMENT_CLOSE"; //$NON-NLS-1$
-
- public static final String XML_COMMENT_OPEN = "XML_COMMENT_OPEN"; //$NON-NLS-1$
- public static final String XML_COMMENT_TEXT = "XML_COMMENT_TEXT"; //$NON-NLS-1$
-
- public static final String XML_CONTENT = "XML_CONTENT"; //$NON-NLS-1$
- public static final String XML_DECLARATION_CLOSE = "XML_DECLARATION_CLOSE"; //$NON-NLS-1$
-
- public static final String XML_DECLARATION_OPEN = "XML_DECLARATION_OPEN"; //$NON-NLS-1$
-
- public static final String XML_DOCTYPE_DECLARATION = "XML_DOCTYPE_DECLARATION"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_DECLARATION_CLOSE = "XML_DOCTYPE_DECLARATION_CLOSE"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_EXTERNAL_ID_PUBLIC = "XML_DOCTYPE_EXTERNAL_ID_PUBLIC"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_EXTERNAL_ID_PUBREF = "XML_DOCTYPE_EXTERNAL_ID_PUBREF"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_EXTERNAL_ID_SYSREF = "XML_DOCTYPE_EXTERNAL_ID_SYSREF"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_EXTERNAL_ID_SYSTEM = "XML_DOCTYPE_EXTERNAL_ID_SYSTEM"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_INTERNAL_SUBSET = "XML_DOCTYPE_INTERNAL_SUBSET"; //$NON-NLS-1$
- public static final String XML_DOCTYPE_NAME = "XML_DOCTYPE_NAME"; //$NON-NLS-1$
- public static final String XML_ELEMENT_DECL_CLOSE = "XML_ELEMENT_DECL_CLOSE"; //$NON-NLS-1$
- public static final String XML_ELEMENT_DECL_CONTENT = "XML_ELEMENT_DECL_CONTENT"; //$NON-NLS-1$
- public static final String XML_ELEMENT_DECL_NAME = "XML_ELEMENT_DECL_NAME"; //$NON-NLS-1$
-
- public static final String XML_ELEMENT_DECLARATION = "XML_ELEMENT_DECLARATION"; //$NON-NLS-1$
- public static final String XML_EMPTY_TAG_CLOSE = "XML_EMPTY_TAG_CLOSE"; //$NON-NLS-1$
- public static final String XML_END_TAG_OPEN = "XML_END_TAG_OPEN"; //$NON-NLS-1$
- public static final String XML_ENTITY_REFERENCE = "XML_ENTITY_REFERENCE"; //$NON-NLS-1$
-
- public static final String XML_PE_REFERENCE = "XML_PE_REFERENCE"; //$NON-NLS-1$
- public static final String XML_PI_CLOSE = "XML_PI_CLOSE"; //$NON-NLS-1$
- public static final String XML_PI_CONTENT = "XML_PI_CONTENT"; //$NON-NLS-1$
- public static final String XML_PI_OPEN = "XML_PI_OPEN"; //$NON-NLS-1$
- public static final String XML_TAG_ATTRIBUTE_EQUALS = "XML_TAG_ATTRIBUTE_EQUALS"; //$NON-NLS-1$
- public static final String XML_TAG_ATTRIBUTE_NAME = "XML_TAG_ATTRIBUTE_NAME"; //$NON-NLS-1$
- public static final String XML_TAG_ATTRIBUTE_VALUE = "XML_TAG_ATTRIBUTE_VALUE"; //$NON-NLS-1$
- public static final String XML_TAG_CLOSE = "XML_TAG_CLOSE"; //$NON-NLS-1$
- public static final String XML_TAG_NAME = "XML_TAG_NAME"; //$NON-NLS-1$
-
- public static final String XML_TAG_OPEN = "XML_TAG_OPEN"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java
deleted file mode 100644
index 74ad2a1a4a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java
+++ /dev/null
@@ -1,31 +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.xml.core.internal.ssemodelquery;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-public interface ModelQueryAdapter extends INodeAdapter {
-
- public CMDocumentCache getCMDocumentCache();
-
- public URIResolver getIdResolver();
-
- public ModelQuery getModelQuery();
-
- void release();
-
- void setIdResolver(URIResolver newIdResolver);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java
deleted file mode 100644
index a68e672920..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java
+++ /dev/null
@@ -1,76 +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.xml.core.internal.ssemodelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-
-public class ModelQueryAdapterImpl implements ModelQueryAdapter {
- protected CMDocumentCache cmDocumentCache;
- protected URIResolver idResolver;
-
- protected ModelQuery modelQuery;
-
- public ModelQueryAdapterImpl(CMDocumentCache cmDocumentCache, ModelQuery modelQuery, URIResolver idResolver) {
- this.cmDocumentCache = cmDocumentCache;
- this.modelQuery = modelQuery;
- this.idResolver = idResolver;
- }
-
- public CMDocumentCache getCMDocumentCache() {
- return cmDocumentCache;
- }
-
- public URIResolver getIdResolver() {
- return idResolver;
- }
-
- public ModelQuery getModelQuery() {
- return modelQuery;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(ModelQueryAdapter.class);
- }
-
- /**
- */
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- * @see ModelQueryAdapter#release()
- */
- public void release() {
- }
-
- /**
- * @see ModelQueryAdapter#setIdResolver(URIResolver)
- */
-
- public void setIdResolver(URIResolver newIdResolver) {
- idResolver = newIdResolver;
- if (modelQuery instanceof MovableModelQuery)
- ((MovableModelQuery) modelQuery).setIdResolver(newIdResolver);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java
deleted file mode 100644
index 49d733960f..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java
+++ /dev/null
@@ -1,23 +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.xml.core.internal.ssemodelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-
-public interface MovableModelQuery extends ModelQuery {
-
- void setIdResolver(URIResolver newURIResolver);
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java
deleted file mode 100644
index 94b81555bc..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java
+++ /dev/null
@@ -1,28 +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.xml.core.internal.tasks;
-
-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;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class XMLFileTaskScanner extends StructuredFileTaskScanner {
- public XMLFileTaskScanner() {
- super();
- }
-
- protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
- return textRegion.getType().equals(DOMRegionContext.XML_COMMENT_TEXT);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java
deleted file mode 100644
index e26bf08551..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/XMLStructuredDocumentRegion.java
+++ /dev/null
@@ -1,36 +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.xml.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLStructuredDocumentRegion extends BasicStructuredDocumentRegion implements IStructuredDocumentRegion {
-
- public XMLStructuredDocumentRegion() {
- super();
- }
-
- public String getType() {
- String result = super.getType();
- // normally, we want the second region as the flatnode type ... since
- // the
- // first one is usually just "open tag".
- if ((result != DOMRegionContext.XML_PI_OPEN) && (getRegions().size() > 1)) {
- result = getRegions().get(1).getType();
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
deleted file mode 100644
index 8b73869003..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
+++ /dev/null
@@ -1,132 +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.xml.core.internal.text.rules;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-public class StructuredTextPartitionerForXML extends StructuredTextPartitioner implements IStructuredTextPartitioner {
-
- private final static String[] configuredContentTypes = new String[]{IXMLPartitions.XML_DEFAULT, IXMLPartitions.XML_CDATA, IXMLPartitions.XML_PI, IXMLPartitions.XML_DECLARATION, IXMLPartitions.XML_COMMENT, IXMLPartitions.DTD_SUBSET};
-
- public StructuredTextPartitionerForXML() {
- super();
- }
-
- protected void setInternalPartition(int offset, int length, String type) {
- super.setInternalPartition(offset, length, type);
- }
-
- protected void initLegalContentTypes() {
- fSupportedTypes = configuredContentTypes;
- }
-
- public String getPartitionType(ITextRegion region, int offset) {
- String result = null;
- if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT)
- result = IXMLPartitions.XML_COMMENT;
- else if (region.getType() == DOMRegionContext.XML_CDATA_TEXT)
- result = IXMLPartitions.XML_CDATA;
- else if (region.getType() == DOMRegionContext.XML_PI_CONTENT) {
- /**
- * Grammatically, it's impossible to get a PI_CONTENT region
- * without a preceding XML_TAG_NAME region. Relying on this,
- * extract the target processor name and create a partition type
- * dynamically.
- */
- IStructuredDocumentRegion docRegion = fStructuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion name = docRegion.getRegionAtCharacterOffset(docRegion.getStartOffset() + region.getStart() - 1);
- result = IXMLPartitions.PROCESSING_INSTRUCTION_PREFIX + docRegion.getText(name).toUpperCase(Locale.ENGLISH);
- }
- else if (region.getType() == DOMRegionContext.XML_PI_OPEN)
- result = IXMLPartitions.XML_PI;
- else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION)
- result = IXMLPartitions.XML_DECLARATION;
- else if (region.getType() == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)
- result = IXMLPartitions.DTD_SUBSET;
- else
- result = super.getPartitionType(region, offset);
- return result;
- }
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- // temp added just to dis-ambiguate call from subclass
- return super.getPartitionType(region, offset);
- }
-
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
- return super.getPartitionTypeBetween(previousNode, nextNode);
- }
-
- public String getDefaultPartitionType() {
- return IXMLPartitions.XML_DEFAULT;
- }
-
- public IDocumentPartitioner newInstance() {
- StructuredTextPartitionerForXML instance = new StructuredTextPartitionerForXML();
- return instance;
- }
-
- /**
- * @return
- */
- public static String[] getConfiguredContentTypes() {
- return configuredContentTypes;
- }
-
- protected String getPartitionFromBlockedText(ITextRegion region, int offset, String result) {
- // was moved to subclass for quick transition
- String newResult = result;
- // nsd_TODO: David and I need to discuss, design, and implement this
- // for all block tags and comments
- // and make sure is part of "extensible" design of block tags
- if (region.getType() == DOMRegionContext.BLOCK_TEXT) {
- // for code safety, we'll always check instanceof, but I think
- // always true.
- if (region instanceof ForeignRegion) {
- // super is used below so won't be ambiguous
- newResult = getPartitionType((ForeignRegion) region, offset);
- }
- else if (region instanceof ForeignRegion) {
- newResult = getPartitionType((ForeignRegion) region, offset);
- }
- else {
- newResult = getUnknown();
- }
- }
- return newResult;
- }
-
- protected boolean doParserSpecificCheck(int offset, boolean partitionFound, IStructuredDocumentRegion sdRegion, IStructuredDocumentRegion previousStructuredDocumentRegion, ITextRegion next, ITextRegion previousStart) {
- // this was moved down to subclass of StructuredTextPartioner
- // for quick fix to transition problems. Heirarchy needs lots of
- // cleanup.
- if (previousStart != null && previousStart.getType() == DOMRegionContext.XML_TAG_OPEN && next.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- ITextRegion previousName = previousStructuredDocumentRegion.getRegionAtCharacterOffset(previousStructuredDocumentRegion.getEndOffset(previousStart));
- ITextRegion nextName = sdRegion.getRegionAtCharacterOffset(sdRegion.getEndOffset(next));
- if (previousName != null && nextName != null && previousName.getType() == DOMRegionContext.XML_TAG_NAME && nextName.getType() == DOMRegionContext.XML_TAG_NAME) {
- setInternalPartition(offset, 0, getPartitionTypeBetween(previousStructuredDocumentRegion, sdRegion));
- partitionFound = true;
- }
- }
- return partitionFound;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
deleted file mode 100644
index 3fddda363a..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
+++ /dev/null
@@ -1,66 +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.wst.xml.core.internal.validate;
-
-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.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractPropagatingValidator extends ValidationComponent {
-
- /**
- * Constructor for AbstractPropagatingValidator.
- */
- public AbstractPropagatingValidator() {
- super();
- }
-
- protected abstract ValidationComponent getPropagatee();
-
- protected abstract ValidationAdapter getValidator();
-
-
- public void validate(IndexedRegion node) {
- if (node == null)
- return;
- getValidator().validate(node);
-
- propagateToChildElements(getPropagatee(), (Node) node);
- }
-
- private void propagateToChildElements(ValidationComponent validator, Node parent) {
- if (parent == null)
- return;
- Class clazz = validator.getClass();
-
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- INodeNotifier notifier = (INodeNotifier) child;
- ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
- if (va == null) {
- notifier.addAdapter(validator);
- va = validator;
- }
- // bug 143213 - Can't batch validate open HTML files when
- // as-you-type validation is enabled
- va.setReporter(validator.getReporter());
- va.validate((IndexedRegion) child);
- }
- child = child.getNextSibling();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java
deleted file mode 100644
index 3ce6569ccd..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validate;
-
-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.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @deprecated since 2.0 M5 - if propogateToChildElement is needed, just copy
- * method to your own class
- */
-public class Propagator {
-
- public static void propagateToChildElements(ValidationComponent validator, Node parent) {
- if (parent == null)
- return;
- Class clazz = validator.getClass();
-
- NodeList children = parent.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child == null || child.getNodeType() != Node.ELEMENT_NODE)
- continue;
-
- INodeNotifier notifier = (INodeNotifier) child;
- ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
- if (va == null) {
- notifier.addAdapter(validator);
- va = validator;
- }
- va.validate((IndexedRegion) child);
- }
- }
-
- /**
- * Propagator is just a placeholder of utilities. Don't instantiate.
- */
- private Propagator() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java
deleted file mode 100644
index dfd921f58c..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-
-public abstract class ValidationComponent implements ValidationAdapter {
-
- protected ValidationReporter reporter = null;
-
- /**
- * ValidationComponent constructor comment.
- */
- public ValidationComponent() {
- super();
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return (type == ValidationAdapter.class);
- }
-
- /**
- */
- public void notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // This method will be implemented in the V2.
- }
-
- /**
- */
- public void setReporter(ValidationReporter reporter) {
- this.reporter = reporter;
- }
-
- ValidationReporter getReporter() {
- return this.reporter;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
deleted file mode 100644
index d8da7868a3..0000000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.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.wst.xml.core.text;
-
-
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types for XML.
- * Clients should reference the partition type Strings defined here directly.
- *
- * @since 1.1
- */
-public interface IXMLPartitions {
-
- String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$
- String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$
- String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$
- String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$
- String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$
-
- /*
- * This value is used as a prefix to any unknown processing instructions
- * we find. The processor target name is converted to uppercase and
- * appended to the prefix to create a unique partition type.
- */
- String PROCESSING_INSTRUCTION_PREFIX = "org.eclipse.wst.xml.PROCESSING_INSTRUCTION:"; //$NON-NLS-1$
-
- /**
- * Should match
- * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET
- */
- String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/.classpath b/bundles/org.eclipse.wst.xml.ui/.classpath
deleted file mode 100644
index 9d03c22865..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.classpath
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src" />
- <classpathentry kind="src" path="src-validation" />
- <classpathentry kind="src" path="src-multipage" />
- <classpathentry kind="src" path="src-wizards" />
- <classpathentry kind="src" path="src-catalog" />
- <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/validation/internal/core/ValidationException" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/operations/LocalizedMessage/" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IMessage" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/core/Message" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IReporter" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IValidationContext" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IValidator" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/DefaultDragAndDropCommand" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dialogs/SelectSingleFileDialog" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/core/IMessageAccess" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IProjectValidationContext" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IValidatorJob" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/viewers/SelectSingleFileView" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/DragAndDropCommand" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/DragAndDropManager" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/ObjectTransfer" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/ViewerDragAdapter" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/dnd/ViewerDropAdapter" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/ConfigurationManager" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/ProjectConfiguration" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/ValidationRegistryReader" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/ValidatorMetaData" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/ValidationFactory" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/ui/internal/viewers/*" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/ValidationConfiguration" />
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin" />
-</classpath>
diff --git a/bundles/org.eclipse.wst.xml.ui/.cvsignore b/bundles/org.eclipse.wst.xml.ui/.cvsignore
deleted file mode 100644
index 701c285abb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-bin
-temp.folder
-build.xml
-xmleditor.jar
-org.eclipse.wst.xml.ui_1.0.0.jar
-org.eclipse.wst.xml.ui_1.0.0.zip
-xmleditorsrc.zip
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xml.ui/.options b/bundles/org.eclipse.wst.xml.ui/.options
deleted file mode 100644
index 5acae8fda4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.xml.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.xml.ui/.project b/bundles/org.eclipse.wst.xml.ui/.project
deleted file mode 100644
index 50dc4a8398..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml.ui</name>
- <comment></comment>
- <projects></projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.xml.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.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a512da061c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:59:49 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.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 0ece7b5d75..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,51 +0,0 @@
-#Wed Nov 22 23:23:01 EST 2006
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=false
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=true
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.format_comment=true
-cleanup.format_javadoc=true
-cleanup.format_multi_line_comment=true
-cleanup.format_single_line_comment=true
-cleanup.format_source_code=true
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=false
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=true
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_SSE Team Styles
-cleanup_settings_version=2
-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.xml.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index de4a8be5f8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,25 +0,0 @@
-#Wed Jun 04 20:07:47 EDT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.illegal-att-value=0
-compilers.p.internal=1
-compilers.p.missing-packages=1
-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-identifier=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.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 112256c8e8..0000000000
--- a/bundles/org.eclipse.wst.xml.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.wst.xml.ui; singleton:=true
-Bundle-Version: 1.1.202.qualifier
-Bundle-Activator: org.eclipse.wst.xml.ui.internal.XMLUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.ui,
- org.eclipse.wst.xml.ui.internal;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.actions;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.autoedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.contentassist;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.contentoutline;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.correction;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.dialogs;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.dnd;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.doubleclick;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.editor;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.editor.propertytester,
- org.eclipse.wst.xml.ui.internal.handlers;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.hyperlink;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.nsedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.perspective;x-friends:="org.eclipse.wst.xsl.ui",
- org.eclipse.wst.xml.ui.internal.preferences;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.projection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.properties;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.provisional;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.quickoutline,
- org.eclipse.wst.xml.ui.internal.registry;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.search;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.selection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.spelling,
- org.eclipse.wst.xml.ui.internal.style;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.tabletree;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.taginfo;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.templates;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.text;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.util;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.validation;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.views.annotations,
- org.eclipse.wst.xml.ui.internal.views.contentmodel,
- org.eclipse.wst.xml.ui.internal.wizards;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.views.contentoutline,
- org.eclipse.wst.xml.ui.views.properties
-Import-Package: com.ibm.icu.util; version="3.8",
- com.ibm.icu.text; version="3.8"
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.400,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)"
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo,org.eclipse.wst.xml.ui.internal.editor.propertytester"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.ui/about.html b/bundles/org.eclipse.wst.xml.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.xml.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.wst.xml.ui/about.ini b/bundles/org.eclipse.wst.xml.ui/about.ini
deleted file mode 100644
index 68af2913da..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/about.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
diff --git a/bundles/org.eclipse.wst.xml.ui/about.mappings b/bundles/org.eclipse.wst.xml.ui/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/about.properties b/bundles/org.eclipse.wst.xml.ui/about.properties
deleted file mode 100644
index 8f6039683d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/about.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Eclipse XML Editors and Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005, 2009. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/bundles/org.eclipse.wst.xml.ui/build.properties b/bundles/org.eclipse.wst.xml.ui/build.properties
deleted file mode 100644
index f7dbd12f9c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/build.properties
+++ /dev/null
@@ -1,32 +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
-#
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- templates/,\
- examples/,\
- META-INF/,\
- .,\
- .options,\
- about.html,\
- about.ini,\
- about.properties,\
- about.mappings
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = src/,\
- src-multipage/,\
- src-wizards/,\
- src-catalog/,\
- src-validation/
diff --git a/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip b/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip
deleted file mode 100644
index 62577670ee..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png b/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif b/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif
deleted file mode 100644
index 14eb1be095..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif
deleted file mode 100644
index ce74721ea2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif
deleted file mode 100644
index 7dc0de5130..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif
deleted file mode 100644
index 4bdceb84e9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif
deleted file mode 100644
index e823d572a3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif
deleted file mode 100644
index bc37b7a4e5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif
deleted file mode 100644
index 492c14f6e1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif
deleted file mode 100644
index e1cfdf7eb3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif
deleted file mode 100644
index 49325dd8ea..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif
deleted file mode 100644
index 561d1463ef..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif
deleted file mode 100644
index b75bc19602..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif
deleted file mode 100644
index a2d80a9044..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif
deleted file mode 100644
index c1ab04c81c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif
deleted file mode 100644
index 082f9c0ae8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif
deleted file mode 100644
index b2f45306c9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif
deleted file mode 100644
index 0205b29176..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif
deleted file mode 100644
index 9dfb62d35b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif
deleted file mode 100644
index 049cac696c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif
deleted file mode 100644
index 2b347ac458..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7196..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif
deleted file mode 100644
index 252d7ebcb8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif
deleted file mode 100644
index a8c66d5016..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif
deleted file mode 100644
index 6b0872c909..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif
deleted file mode 100644
index d13ba2e5b0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif
deleted file mode 100644
index 28c2ccb1e7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif
deleted file mode 100644
index af83c528dd..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif
deleted file mode 100644
index 9ced2044ca..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif
deleted file mode 100644
index 3300f82862..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acadd2d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif
deleted file mode 100644
index 3567815907..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif
deleted file mode 100644
index 61fd3d4caa..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index 3af9149125..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif
deleted file mode 100644
index 5c0a48115b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error_obj.gif
deleted file mode 100644
index 0bc60689c6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif
deleted file mode 100644
index 3244b26ef4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif
deleted file mode 100644
index 57ad089a69..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif
deleted file mode 100644
index 7bb65c9d51..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif
deleted file mode 100644
index 74436d8d3c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif
deleted file mode 100644
index 65f516e80a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif
deleted file mode 100644
index 5d1f81b6d4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_deemphasized_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_deemphasized_obj.gif
deleted file mode 100644
index cacb4058a7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_deemphasized_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_emphasized_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_emphasized_obj.gif
deleted file mode 100644
index 45c1db4c08..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_emphasized_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif
deleted file mode 100644
index b226e41c52..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif
deleted file mode 100644
index 1e5f5eb367..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif
deleted file mode 100644
index 5b0471b5eb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif
deleted file mode 100644
index c350704fa1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/hierarchy.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/view16/hierarchy.gif
deleted file mode 100644
index 7c7dca802e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/hierarchy.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/synced.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/view16/synced.gif
deleted file mode 100644
index 870934b693..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/wizban/generatexml_wiz.png b/bundles/org.eclipse.wst.xml.ui/icons/full/wizban/generatexml_wiz.png
deleted file mode 100644
index b17e48a94b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/wizban/generatexml_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif
deleted file mode 100644
index f439b47635..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif b/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif
deleted file mode 100644
index dc96b10c97..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.png b/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.png
deleted file mode 100644
index be7147416b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif b/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif
deleted file mode 100644
index 14eb1be095..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.properties b/bundles/org.eclipse.wst.xml.ui/plugin.properties
deleted file mode 100644
index 6d3572efef..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/plugin.properties
+++ /dev/null
@@ -1,161 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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
-# David Carver / STAR Standards - added XML Catalog Import/Export Wizard
-# bug 192568
-# David Carver / STAR Standards - bug 212330 - migrate to org.eclipse.ui.menus
-###############################################################################
-providerName=Eclipse Web Tools Platform
-pluginName=Eclipse XML Editors and Tools
-XML.name=XML
-XML_Files.name=XML Files
-XML_Source.name=Editor
-XML_Content_Assist.name=Content Assist
-XML_Validator.name=Validation
-XML_Templates.name=Templates
-XML_Styles.name=Styles
-XML_Syntax_Coloring=Syntax Coloring
-XML_Typing=Typing
-XML_Editor.name=XML Editor
-XML_Property_validation=XML Syntax
-###############################################################################
-_UI_WIZARD_NEW_XML=XML File
-XML_New_File.tooltip=New XML File
-_UI_WIZARD_XML_CATEGORY=XML
-genMenuLabel=&Generate
-_UI_ACTION_CREATE_XML=&XML File...
-_UI_CREATE_NEW_XML_FILE=Create a new XML file
-_UI_WIZARD_IMPORT_EXPORT_XMLCATALOG=XML Catalog
-_UI_IMPORT_XML_CATALOG_FILE=Import an existing XML Catalog.
-_UI_EXPORT_XML_CATALOG_FILE=Export an XML Catalog.
-XMLExample.name=Editing and validating XML files
-XMLExampleProjectCreationWizard.description=Create a project containing XML sample files
-XMLExampleProjectCreationWizard.projectname=XMLExamples
-XMLExampleProjectCreationWizard.pagetitle=XML sample files for editing and validating
-XMLExampleProjectCreationWizard.pagedescription=Create a project containing XML sample files.
-XMLExampleProjectCreationWizard.label=&Project Name:
-###############################################################################
-All_XML_context_type_Extension_Element.name=All XML
-XML_New_context_type_Extension_Element.name=New XML
-XML_Tag_context_type_Extension_Element.name=XML Tag
-XML_Attribute_context_type_Extension_Element.name=XML Attribute
-XML_Attribute_value_context_type_Extension_Element.name=XML Attribute value
-###############################################################################
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-###############################################################################
-XML_Catalog_File_Type_Extension_Point.name=XML Catalog file type extension point
-_UI_PREF_XML_CATALOG=XML Catalog
-_UI_PREF_DTD_FILES=DTD Files
-_UI_PREF_XSD_FILES=XSD Files
-_UI_PREF_TAGLIB_DEF_FILES=Taglib Definition Files
-_UI_PREF_CATALOG_FILES=XML Catalog Files
-###############################################################################
-_UI_XML_VALIDATOR = XML Validator
-_UI_REF_FILE_SHOW_DETAILS = Show Details...
-_UI_MENU_VALIDATE_XML = Validate XML File
-##
-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
-##
-preferenceKeywords.files=editor xml creating saving files suffix specified encoding iana
-preferenceKeywords.source=editor xml source formatting line width split multiple attributes new clear blank indent tabs spaces size content assist automatically suggestions prompt characters inserted strategy lax strict grammar constraints inferred absence dtd schema
-preferenceKeywords.contentassist=xml editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
-preferenceKeywords.templates=editor xml templates snippet macros
-preferenceKeywords.styles=editor xml style customize syntax highlighting type text content foreground background bold color
-preferenceKeywords.xmlcatalog=xml catalog entries
-preferenceKeywords.severities=xml grammar errors warnings ignore options severity severities suppress project specific projectspecific
-
-##
-XML_Source_target_name=XML Editors
-XML_hyperlink=Tags And Attributes
-##
-DesignMenu_name=&Design
-ReloadDependencies_name=Reload Dependencies
-ReloadDependencies_description=Reload Dependencies
-ReloadDependencies_mnemonic=R
-Constraints_name=Turn off Grammar Constraints
-Constraints_description=Turn off grammar Constraints
-Constraints_mnemonic=T
-ExpandAll_name=Expand All
-CollapseAll_name=Collapse All
-ActionDefinition.nextSibling.name=Next Sibling
-ActionDefinition.nextSibling.description=Go to Next Sibling
-ActionDefinition.previousSibling.name=Previous Sibling
-ActionDefinition.previousSibling.description=Go to Previous Sibling
-ActionDefinition.gotoMatchingTag.name=Matching Tag
-ActionDefinition.gotoMatchingTag.description=Go to Matching Tag
-MatchingTagPreference.label=Matching Tags
-
-scope.structured.text.editor.xml.name=Editing XML Source
-scope.structured.text.editor.xml.description=Editing XML Source
-scope.structured.text.editor.xml.navigation.name=XML Source Navigation
-scope.structured.text.editor.xml.navigation.description=XML Source Navigation
-scope.structured.text.editor.xml.cleanup.name=XML Source Cleanup
-scope.structured.text.editor.xml.cleanup.description=XML Source Cleanup
-scope.structured.text.editor.xml.comments.name=XML Source Comments
-scope.structured.text.editor.xml.comments.description=XML Source Comments
-scope.structured.text.editor.xml.selection.name=XML Source Selection
-scope.structured.text.editor.xml.selection.description=XML Source Selection
-scope.structured.text.editor.xml.dependencies.name=XML Source Dependencies
-scope.structured.text.editor.xml.dependencies.description=XML Source Dependencies
-scope.structured.text.editor.xml.grammar.name=XML Source Grammar
-scope.structured.text.editor.xml.grammar.description=XML Source Grammar
-scope.structured.text.editor.xml.expand.name=XML Source Expand/Collapse
-scope.structured.text.editor.xml.expand.description=XML Source Expand/Collapse
-scope.structured.text.editor.xml.occurrences.name=XML Source Occurrences
-scope.structured.text.editor.xml.occurrences.description=XML Source Occurrences
-
-Colors.tagAttributeName=Tag Attribute Name
-Colors.tagAttributeValue=Tag Attribute Value
-Colors.commentBorder=Comment Border
-Colors.commentText=Comment Text
-Colors.declBorder=Declaration Border
-Colors.doctypeName=Doctype Name
-Colors.doctypeExternalPubref=Doctype External Public Reference
-Colors.doctypeExternalId=Doctype External Id
-Colors.doctypeExtrenalSysref=Doctype External System Reference
-Colors.tagBorder=Tag Border
-Colors.tagName=Tag Name
-Colors.piBorder=Processing Instruction Border
-Colors.cdataBorder=CDATA Border
-Colors.cdataText=CDATA Text
-Colors.entityReference=Entity Reference
-# content assist
-proposalCategory.xmlTags=XML Tag Proposals
-proposalCategory.xmlTemplates=XML Template Proposals
-
-#XML Content Model
-contentModel.view.name=Content Model
-contentModel.view.synch.tooltip=Link with Editor
-contentModel.command.synch.name=Synch
-
-# XML Documentation view
-xmlannotations=Documentation
-
-# outline filter
-HideComments.label=Comments
-HideComments.description=Hides Comments
-HideProcessingInstruction.label=Processing Instructions
-HideProcessingInstruction.description=Hides Processing Instructions
-HideCDATASection.label=CDATA
-HideCDATASection.description=Hides CDATA Section Tags
-
-editor_grammar_toolbar=XML Grammar Usage
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.xml b/bundles/org.eclipse.wst.xml.ui/plugin.xml
deleted file mode 100644
index 7e36fbb4d3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/plugin.xml
+++ /dev/null
@@ -1,1767 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.3"?>
-<plugin>
-
- <extension-point id="catalogFileType" name="%XML_Catalog_File_Type_Extension_Point.name" schema="schema/catalogFileType.exsd"/>
-
- <extension point="org.eclipse.wst.xml.ui.catalogFileType">
- <fileType
- extensions="dtd, ent, mod"
- description="%_UI_PREF_DTD_FILES"
- id="org.eclipse.wst.xml.core.ui.catalogFileType.dtd">
- </fileType>
- <fileType
- extensions="xsd"
- description="%_UI_PREF_XSD_FILES"
- id="org.eclipse.wst.xml.core.ui.catalogFileType.xsd">
- </fileType>
- <fileType
- extensions="tld"
- description="%_UI_PREF_TAGLIB_DEF_FILES"
- id="org.eclipse.wst.xml.core.ui.catalogFileType.tld">
- </fileType>
- <fileType
- extensions="xml, cat, xmlcatalog"
- description="%_UI_PREF_CATALOG_FILES"
- id="org.eclipse.wst.xml.core.ui.catalogFileType.cat">
- </fileType>
- </extension>
-
- <!--The org.eclipse.wst.xml.core.xmlsource content type is only for
- handling some special cases of ill-formed xml in a reasonable
- manner, and should not be emulated by clients. The two content
- types are often used interchangeably by the XML component, but
- please use org.eclipse.core.runtime.xml instead. -->
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <contentOutlineConfiguration
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <quickOutlineConfiguration
- class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <propertySheetConfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <documentationTextHover
- class="org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor"
- target="org.eclipse.wst.xml.XML_DEFAULT">
- </documentationTextHover>
- <doubleClickStrategy
- class="org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy"
- target="org.eclipse.wst.xml.XML_DEFAULT">
- </doubleClickStrategy>
- <provisionalConfiguration
- type="sourceeditingtexttools"
- class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <provisionalConfiguration
- type="foldingstrategy"
- class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <provisionalConfiguration
- type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
- class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
- target="org.eclipse.wst.xml.XML_DEFAULT" />
- <provisionalConfiguration
- type="autoeditstrategy"
- class="org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML"
- target="org.eclipse.wst.xml.XML_DEFAULT" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.xml.ui.preferences.xml.xml, org.eclipse.wst.sse.ui.preferences.xml.source, org.eclipse.wst.sse.ui.preferences.xml.templates, org.eclipse.wst.sse.ui.preferences.xml.colors, org.eclipse.wst.sse.ui.preferences.xml.contentassist"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <provisionalDefinition
- type="spellingregions"
- value="XML_COMMENT_TEXT, XML_CONTENT, XML_DEFAULT"
- target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
- <provisionalDefinition
- type="activecontexts"
- value="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.cleanup, org.eclipse.wst.xml.selection, org.eclipse.wst.xml.dependencies, org.eclipse.wst.xml.grammar, org.eclipse.wst.xml.expand, org.eclipse.wst.xml.occurrences, org.eclipse.wst.sse.comments"
- target="org.eclipse.core.runtime.xml" />
- </extension>
-
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structured.text.editor.xml.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.description"
- id="org.eclipse.core.runtime.xml">
- </context>
- <context
- name="%scope.structured.text.editor.xml.navigation.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.navigation.description"
- id="org.eclipse.wst.xml.navigation">
- </context>
- <context
- name="%scope.structured.text.editor.xml.cleanup.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.cleanup.description"
- id="org.eclipse.wst.xml.cleanup">
- </context>
- <context
- name="%scope.structured.text.editor.xml.comments.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.comments.description"
- id="org.eclipse.wst.xml.comments">
- </context>
- <context
- name="%scope.structured.text.editor.xml.selection.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.selection.description"
- id="org.eclipse.wst.xml.selection">
- </context>
- <context
- name="%scope.structured.text.editor.xml.dependencies.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.dependencies.description"
- id="org.eclipse.wst.xml.dependencies">
- </context>
- <context
- name="%scope.structured.text.editor.xml.grammar.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.grammar.description"
- id="org.eclipse.wst.xml.grammar">
- </context>
- <context
- name="%scope.structured.text.editor.xml.expand.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.expand.description"
- id="org.eclipse.wst.xml.expand">
- </context>
- <context
- name="%scope.structured.text.editor.xml.occurrences.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.xml.occurrences.description"
- id="org.eclipse.wst.xml.occurrences">
- </context>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.core.runtime.xml"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- <factory
- contentTypeId="org.eclipse.wst.xml.core.xmlsource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.xml.ui.internal.registry.AdapterFactoryProviderForXML">
- <contentType id="org.eclipse.core.runtime.xml" />
- <contentType id="org.eclipse.wst.xml.core.xmlsource" />
- </adapterFactoryDescription>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <!-- The "top-level" XML category -->
- <page
- name="%XML.name"
- class="org.eclipse.wst.xml.ui.internal.preferences.EmptyFilePreferencePage"
- id="org.eclipse.wst.xml.ui.preferences.xml">
- </page>
- <!-- The "lower level" XML Files category/page -->
- <page
- name="%XML_Files.name"
- category="org.eclipse.wst.xml.ui.preferences.xml"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage"
- id="org.eclipse.wst.xml.ui.preferences.xml.xml">
- <keywordReference id="org.eclipse.wst.xml.ui.files"/>
- </page>
- <!-- XML PREFERENCE PAGES -->
- <page
- name="%XML_Source.name"
- category="org.eclipse.wst.xml.ui.preferences.xml.xml"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLSourcePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.xml.source">
- <keywordReference id="org.eclipse.wst.xml.ui.source"/>
- </page>
- <page
- name="%XML_Content_Assist.name"
- category="org.eclipse.wst.sse.ui.preferences.xml.source"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLContentAssistPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.xml.contentassist">
- <keywordReference id="org.eclipse.wst.xml.ui.contentassist"/>
- </page>
- <page
- name="%XML_Templates.name"
- category="org.eclipse.wst.sse.ui.preferences.xml.source"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLTemplatePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.xml.templates">
- <keywordReference id="org.eclipse.wst.xml.ui.templates"/>
- </page>
- <page
- name="%XML_Syntax_Coloring"
- category="org.eclipse.wst.sse.ui.preferences.xml.source"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLSyntaxColoringPage"
- id="org.eclipse.wst.sse.ui.preferences.xml.colors">
- <keywordReference id="org.eclipse.wst.xml.ui.styles"/>
- </page>
- <page
- name="%_UI_PREF_XML_CATALOG"
- category="org.eclipse.wst.xml.ui.preferences.xml"
- class="org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogPreferencePage"
- id="org.eclipse.wst.xml.core.ui.XMLCatalogPreferencePage">
- <keywordReference id="org.eclipse.wst.xml.ui.xmlcatalog"/>
- </page>
- <page
- name="%XML_Typing"
- category="org.eclipse.wst.sse.ui.preferences.xml.source"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLTypingPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.xml.typing">
- </page>
- <page
- name="%XML_Validator.name"
- category="org.eclipse.wst.xml.ui.preferences.xml.xml"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLValidatorPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.xml.validation">
- <keywordReference id="org.eclipse.wst.xml.ui.severities"/>
- </page>
- </extension>
-
- <!-- Web content settings -->
- <extension point="org.eclipse.ui.propertyPages">
- <page
- name="%XML_Property_validation"
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLValidatorPreferencePage"
- id="org.eclipse.wst.xml.ui.propertyPage.project.validation"
- category="ValidationPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
-
- </adapt>
- </enabledWhen>
- </page>
- </extension>
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.files"
- id="org.eclipse.wst.xml.ui.files"/>
- <keyword
- label="%preferenceKeywords.source"
- id="org.eclipse.wst.xml.ui.source"/>
- <keyword
- label="%preferenceKeywords.contentassist"
- id="org.eclipse.wst.xml.ui.contentassist"/>
- <keyword
- label="%preferenceKeywords.templates"
- id="org.eclipse.wst.xml.ui.templates"/>
- <keyword
- label="%preferenceKeywords.styles"
- id="org.eclipse.wst.xml.ui.styles"/>
- <keyword
- label="%preferenceKeywords.xmlcatalog"
- id="org.eclipse.wst.xml.ui.xmlcatalog"/>
- <keyword
- label="%preferenceKeywords.severities"
- id="org.eclipse.wst.xml.ui.severities"/>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.core.runtime.xml.source"></part>
- <part id="org.eclipse.core.runtime.xml.source2"></part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.core.runtime.xml.source"></part>
- <part id="org.eclipse.core.runtime.xml.source2"></part>
- </actionSetPartAssociation>
- </extension>
-
- <!-- Templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%All_XML_context_type_Extension_Element.name"
- class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
- id="xml_all">
- </contextType>
- <contextType
- name="%XML_New_context_type_Extension_Element.name"
- class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
- id="xml_new">
- </contextType>
- <contextType
- name="%XML_Tag_context_type_Extension_Element.name"
- class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
- id="xml_tag">
- </contextType>
- <contextType
- name="%XML_Attribute_context_type_Extension_Element.name"
- class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
- id="xml_attribute">
- </contextType>
- <contextType
- name="%XML_Attribute_value_context_type_Extension_Element.name"
- class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
- id="xml_attribute_value">
- </contextType>
- <include
- file="templates/xmldefault-templates.xml"
- translations="$nl$/templates/xmldefault-templates.properties">
- </include>
- </extension>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%XML_Editor.name"
- icon="$nl$/icons/xmldoc.gif"
- contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
- class="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
- <contentTypeBinding
- contentTypeId="org.eclipse.core.runtime.xml" />
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.xml.core.xmlsource" />
-
- </editor>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part
- id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
- </part>
- </actionSetPartAssociation>
- </extension>
-
-
-
- <!-- ================================================== -->
- <!-- Contribute a 'New Wizard' for XML files -->
- <!-- ================================================== -->
- <extension point="org.eclipse.ui.newWizards">
- <category
- name="%_UI_WIZARD_XML_CATEGORY"
- id="org.eclipse.wst.XMLCategory">
- </category>
- <wizard
- name="%_UI_WIZARD_NEW_XML"
- icon="/icons/full/etool16/new_xml.gif"
- category="org.eclipse.wst.XMLCategory"
- class="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"
- id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
- <description>%_UI_CREATE_NEW_XML_FILE</description>
- <selection class="org.eclipse.core.resources.IResource">
- </selection>
- </wizard>
- </extension>
-
- <!-- =============================================================================== -->
- <!-- Allow the 'New XML' wizard to be accessed via the 'Generate' menu on a XSD file -->
- <!-- =============================================================================== -->
-<!--
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xsd"
- id="org.eclipse.wst.xmlwizard.createXMLFromXSD">
- <menu
- label="%genMenuLabel"
- path="additions"
- id="generateXMLArtifacts">
- <separator name="xml" />
- </menu>
- <action
- label="%_UI_ACTION_CREATE_XML"
- class="org.eclipse.wst.xml.ui.internal.wizards.XMLImportActionDelegate"
- menubarPath="generateXMLArtifacts/xml"
- enablesFor="1"
- id="org.eclipse.wst.xmlwizard.createXMLFromXSDAction">
- </action>
- </objectContribution>
- </extension>
--->
-
- <!-- =============================================================================== -->
- <!-- Allow the 'New XML' wizard to be accessed via the 'Generate' menu on a DTD file -->
- <!-- =============================================================================== -->
-<!--
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.dtd"
- id="org.eclipse.wst.xmlwizard.createXMLFromDTD">
- <menu
- label="%genMenuLabel"
- path="additions"
- id="generateXMLArtifacts">
- <separator name="xml" />
- </menu>
- <action
- label="%_UI_ACTION_CREATE_XML"
- class="org.eclipse.wst.xml.ui.internal.wizards.XMLImportActionDelegate"
- menubarPath="generateXMLArtifacts/xml"
- enablesFor="1"
- id="org.eclipse.wst.xmlwizard.createXMLFromDTDAction">
- </action>
- </objectContribution>
- </extension>
--->
-
- <!-- =============================================================================== -->
- <!-- Contribute a New->Example... entry for Editing and Validating XML files -->
- <!-- =============================================================================== -->
-
- <!-- define the XMLSamples project wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <category
- name="%_UI_WIZARD_XML_CATEGORY"
- parentCategory="org.eclipse.ui.Examples"
- id="org.eclipse.wst.xml.examples">
- </category>
- <wizard
- name="%XMLExample.name"
- class="org.eclipse.wst.xml.ui.internal.wizards.ExampleProjectCreationWizard"
- category="org.eclipse.ui.Examples/org.eclipse.wst.xml.examples"
- id="org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard"
- project="true"
- icon="$nl$/icons/newSampleProject_wiz.gif">
- <description>
- %XMLExampleProjectCreationWizard.description
- </description>
- </wizard>
- </extension>
-
- <!-- configure the XMLSamples project wizard -->
- <extension
- point="org.eclipse.wst.common.ui.exampleProjectCreationWizard"
- id="XMLExampleProjectCreationWizardExtension">
- <wizard
- id="org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard"
- banner="icons/newSampleProject_wizbanner.png">
- <projectsetup
- pagetitle="%XMLExampleProjectCreationWizard.pagetitle"
- name="%XMLExampleProjectCreationWizard.projectname"
- label="%XMLExampleProjectCreationWizard.label"
- pagedescription="%XMLExampleProjectCreationWizard.pagedescription"
- open="readme.html">
- <import
- dest=""
- src="examples/EditingAndValidatingXML.zip" />
- </projectsetup>
- </wizard>
- </extension>
-
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel"
- class="org.eclipse.wst.xml.ui.internal.editor.DOMSelectionConvertorFactory">
- <adapter
- type="org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor"/>
- </factory>
- <factory
- adaptableType="org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel"
- class="org.eclipse.wst.xml.ui.internal.spelling.SpellcheckDelegateAdapterFactory">
- <adapter
- type="org.eclipse.wst.sse.ui.internal.spelling.ISpellcheckDelegate"/>
- </factory>
- </extension>
-
- <!-- initialize xml ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceInitializer" />
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- id="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML">
- <contentTypeIdentifier id="org.eclipse.core.runtime.xml">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_PI"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier id="org.eclipse.wst.xml.core.xmlsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_PI"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
-
- <extension point="org.eclipse.ui.editors.annotationTypes">
- <type name="org.eclipse.wst.xml.ui.matching.tag"/>
- </extension>
- <extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
- <specification
- includeOnPreferencePage="true"
- colorPreferenceValue="212,212,212"
- annotationType="org.eclipse.wst.xml.ui.matching.tag"
- colorPreferenceKey="matchingTagIndicationColor"
- presentationLayer="4"
- label="%MatchingTagPreference.label"
- icon="icons/full/obj16/tag-generic.gif"
- textPreferenceValue="false"
- textPreferenceKey="matchingTagIndication"
- highlightPreferenceKey="matchingTagHighlight"
- highlightPreferenceValue="true"
- verticalRulerPreferenceKey="matchingTagVerticalRuler"
- verticalRulerPreferenceValue="false"
- overviewRulerPreferenceKey="matchingTagIndicationInOverviewRuler"
- overviewRulerPreferenceValue="true"
- textStylePreferenceKey="matchingTagTextStyle"
- textStylePreferenceValue="NONE">
- </specification>
- </extension>
-
- <!--======================================================================================-->
- <!-- Document provider for ExternalFileEditorInput -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.editors.documentProviders">
- <provider
- inputTypes="org.eclipse.wst.xml.ui.internal.hyperlink.ExternalFileEditorInput"
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- id="org.eclipse.wst.xml.ui.internal.ExternalFileDocumentProvider">
- </provider>
- </extension>
-
- <!-- To Do: migrate this to the org.eclipse.ui.menus popup: format -->
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.core.runtime.xml.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
-
- <!--======================================================================================-->
- <!-- Pop-up menu and associated command/handler for nested validation messages. -->
- <!--======================================================================================-->
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="popup:org.eclipse.ui.ide.MarkersView">
- <command commandId="org.eclipse.wst.xml.ui.referencedFileErrors">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.xml.ui.referencedFileErrors" />
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command
- description="%_UI_REF_FILE_SHOW_DETAILS"
- id="org.eclipse.wst.xml.ui.referencedFileErrors"
- name="%_UI_REF_FILE_SHOW_DETAILS" />
- </extension>
-
- <extension point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorsHandler"
- commandId="org.eclipse.wst.xml.ui.referencedFileErrors">
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.referencedFileErrors" />
- </enabledWhen>
- </handler>
- </extension>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.GroupNamePropertyTester"
- id="org.eclipse.wst.xml.ui.markerGroupNamePropertyTester"
- namespace="org.eclipse.wst.xml.ui"
- properties="groupNamePrefix"
- type="org.eclipse.core.resources.IMarker">
- </propertyTester>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.referencedFileErrors">
- <and>
- <count value="1" />
- <with variable="selection">
- <iterate operator="or">
- <adapt type="org.eclipse.core.resources.IMarker">
- <test property="org.eclipse.wst.xml.ui.groupNamePrefix" value="referencedFileError" forcePluginActivation="true" />
- </adapt>
- </iterate>
- </with>
- </and>
- </definition>
- </extension>
-
-<!--
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.core.runtime.xml.source.editorActions"
- targetID="org.eclipse.core.runtime.xml.source">
- <action
- id="CleanupDocument"
- label="%CleanupDocument_label"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- tooltip="%CleanupDocument_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.CleanupActionXMLDelegate"
- actionID="CleanupDocument">
- </action>
- <action
- id="ToggleComment"
- label="%ToggleComment_label"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- tooltip="%ToggleComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- actionID="ToggleComment">
- </action>
- <action
- id="AddBlockComment"
- label="%AddBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- tooltip="%AddBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- actionID="AddBlockComment">
- </action>
- <action
- id="RemoveBlockComment"
- label="%RemoveBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- tooltip="%RemoveBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- actionID="RemoveBlockComment">
- </action>
- <action
- id="FindOccurrences"
- label="%FindOccurrences_label"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.wst.xml.ui.internal.search.XMLFindOccurrencesActionDelegate"
- 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>-->
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- targetID="org.eclipse.core.runtime.xml.source"
- id="org.eclipse.core.runtime.xml.source.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.workbench.texteditor.hyperlinkDetectorTargets">
- <target
- id="org.eclipse.core.runtime.xml"
- name="%XML_Source_target_name">
- </target>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.wst.xml.ui.internal.hyperlink.XMLHyperlinkDetector"
- id="org.eclipse.wst.xml.ui.internal.hyperlink.XMLHyperlinkDetector"
- name="%XML_hyperlink"
- targetId="org.eclipse.core.runtime.xml">
- </hyperlinkDetector>
- </extension>
- <extension
- point="org.eclipse.ui.importWizards">
- <category
- id="org.eclipse.wst.XMLCategory"
- name="%_UI_WIZARD_XML_CATEGORY">
- </category>
- <wizard
- category="org.eclipse.wst.XMLCategory"
- class="org.eclipse.wst.xml.ui.internal.wizards.ImportXMLCatalogWizard"
- icon="icons/xmldoc.gif"
- id="org.eclipse.wst.xml.ui.internal.wizards.ImportXMLCatalogWizard"
- name="%_UI_WIZARD_IMPORT_EXPORT_XMLCATALOG">
- <description>
- %_UI_IMPORT_XML_CATALOG_FILE
- </description>
- </wizard>
- </extension>
- <extension
- point="org.eclipse.ui.exportWizards">
- <category
- id="org.eclipse.wst.XMLCategory"
- name="%_UI_WIZARD_XML_CATEGORY">
- </category>
- <wizard
- category="org.eclipse.wst.XMLCategory"
- class="org.eclipse.wst.xml.ui.internal.wizards.ExportXMLCatalogWizard"
- icon="icons/xmldoc.gif"
- id="org.eclipse.wst.xml.ui.internal.wizards.ExportXMLCatalogWizard"
- name="%_UI_WIZARD_IMPORT_EXPORT_XMLCATALOG">
- <description>
- %_UI_EXPORT_XML_CATALOG_FILE
- </description>
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <!-- Navigate commands -->
- <command
- name="%ActionDefinition.nextSibling.name"
- description="%ActionDefinition.nextSibling.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xml.ui.nextSibling">
- </command>
- <command
- name="%ActionDefinition.previousSibling.name"
- description="%ActionDefinition.previousSibling.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xml.ui.previousSibling">
- </command>
- <command
- name="%ActionDefinition.gotoMatchingTag.name"
- description="%ActionDefinition.gotoMatchingTag.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xml.ui.gotoMatchingTag">
- </command>
- </extension>
-
- <extension point="org.eclipse.ui.bindings">
- <!-- win32: M1=CTRL, M2=SHIFT, M3=ALT, M4=-
- carbon: M1=COMMAND, M2=SHIFT, M3=ALT, M4=CTRL
- gtk: ?
- -->
- <!-- Navigate commands -->
- <key
- sequence="M1+M2+ARROW_UP"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.previousSibling"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- platform="carbon"
- sequence="CTRL+SHIFT+ARROW_UP"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.previousSibling"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- sequence="M1+M2+ARROW_DOWN"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.nextSibling"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- platform="carbon"
- sequence="CTRL+SHIFT+ARROW_DOWN"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.nextSibling"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- sequence="M1+M2+&gt;"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.gotoMatchingTag"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- platform="carbon"
- sequence="CTRL+SHIFT+."
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.xml.ui.gotoMatchingTag"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
-
- </extension>
-
-<!--
- This section contains the new org.eclipse.ui.menus extions points and command handler
- definitions.
- -->
-
- <extension point="org.eclipse.ui.menus">
- <!-- Unable to contribute to Search menu at the moment due to bug 213385 -->
-<!--
- <menuContribution locationURI="menu:org.eclipse.search.menu">
--->
- <menuContribution locationURI="menu:goTo?after=matchingEnd">
-<!--
- <command commandId="org.eclipse.wst.xml.ui.gotoMatchingTag" id="GoToMatchingTag" label="%GoToMatchingTag_label" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
--->
- <separator name="goToSiblingsBegin" visible="true"></separator>
- <command commandId="org.eclipse.wst.xml.ui.nextSibling" id="GoToNextSibling" label="%ActionDefinition.nextSibling.name" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"></reference>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.wst.xml.ui.previousSibling" id="GoToPreviousSibling" label="%ActionDefinition.previousSibling.name" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"></reference>
- </visibleWhen>
- </command>
- <separator name="goToSiblingsEnd" visible="false"></separator>
- </menuContribution>
- <menuContribution
- locationURI="menu:org.eclipse.ui.main.menu?before=window">
- <menu
- id="org.eclipse.wst.xml.ui.designMenuId"
- label="%DesignMenu_name">
- <separator
- name="designStart">
- </separator>
- <command
- commandId="org.eclipse.wst.xml.ui.disable.grammar.constraints"
- icon="icons/full/etool16/constrainon.gif"
- id="ToggleGrammarConstraints"
- mnemonic="%Constraints_mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <and>
- <reference definitionId="org.eclipse.wst.xml.ui.grammar"/>
- <not>
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </not>
- </and>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.xml.ui.reload.dependencies"
- icon="icons/full/etool16/rldgrmr.gif"
- id="ReloadDependencies"
- mnemonic="%ReloadDependencies_mnemonic"
- style="push">
- <visibleWhen checkEnabled="false">
- <and>
- <reference definitionId="org.eclipse.wst.xml.ui.dependencies"/>
- <not>
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </not>
- </and>
- </visibleWhen>
- </command>
- <separator
- name="expand"
- visible="true">
- </separator>
-
- <command
- commandId="sed.tabletree.expandAll"
- icon="icons/full/etool16/expand_all.gif"
- id="ExpandAll"
- style="push">
- <visibleWhen checkEnabled="false">
- <and>
- <reference definitionId="org.eclipse.wst.xml.ui.expand"/>
- <not>
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </not>
- </and>
- </visibleWhen>
- </command>
- <command
- commandId="sed.tabletree.collapseAll"
- icon="icons/full/etool16/collapse_all.gif"
- id="CollapseAll"
- style="push">
- <visibleWhen checkEnabled="false">
- <and>
- <reference definitionId="org.eclipse.wst.xml.ui.expand"/>
- <not>
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
- </not>
- </and>
- </visibleWhen>
- </command>
-
- <separator
- name="additions"
- visible="true">
- </separator>
- <separator
- name="designEnd"
- visible="false">
- </separator>
- </menu>
- </menuContribution>
- <menuContribution locationURI="menu:edit?after=additions">
- <command commandId="org.eclipse.ui.edit.text.contentAssist.proposals" id="XMLContentAssist" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.xml.ui.xmlSourceContributions.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
- <menu
- id="generateMenuId"
- label="%genMenuLabel">
- <command
- commandId="org.eclipse.wst.sse.ui.generate.xml"
- id="GenerateXML"
- style="push">
- <visibleWhen checkEnabled="false">
- <or>
- <iterate ifEmpty="false">
- <adapt
- type="org.eclipse.core.resources.IFile">
- <test
- property="org.eclipse.wst.sse.core.resources.contentTypeId"
- value="org.eclipse.wst.xsd.core.xsdsource">
- </test>
- </adapt>
- </iterate>
- <iterate ifEmpty="false">
- <adapt
- type="org.eclipse.core.resources.IFile">
- <test
- property="org.eclipse.wst.sse.core.resources.contentTypeId"
- value="org.eclipse.wst.dtd.core.dtdsource">
- </test>
- </adapt>
- </iterate>
- </or>
- </visibleWhen>
- </command>
- </menu>
- </menuContribution>
-
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
- <toolbar
- id="org.eclipse.wst.xml.ui.design.DesignToolBar"
- label="%editor_grammar_toolbar">
- <separator
- name="sed.tabletree.separator.1"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.wst.xml.ui.disable.grammar.constraints"
- icon="icons/full/etool16/constrainon.gif"
- id="ToggleGrammarConstraints"
- style="push"
- tooltip="%Constraints_name">
- <visibleWhen
- checkEnabled="false">
- <reference
- definitionId="org.eclipse.wst.xml.ui.grammar">
- </reference>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.wst.xml.ui.reload.dependencies"
- icon="icons/full/etool16/rldgrmr.gif"
- id="ReloadDependencies"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <reference
- definitionId="org.eclipse.wst.xml.ui.dependencies">
- </reference>
- </visibleWhen>
- </command>
- </toolbar>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.xmlSourceContributions.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.core.runtime.xml"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.core">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.core.runtime.xml"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.occurrences">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.occurrences"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.comments">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.comments"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.cleanup">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.cleanup"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.navigation">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.navigation"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.selection">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.selection"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.dependencies">
- <or>
- <with variable="activeEditor">
- <test property="org.eclipse.wst.xml.ui.editor" forcePluginActivation="true" />
- </with>
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.dependencies"/>
- </iterate>
- </with>
- </or>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.grammar">
- <or>
- <with variable="activeEditor">
- <test property="org.eclipse.wst.xml.ui.editor" forcePluginActivation="true" />
- </with>
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.grammar"/>
- </iterate>
- </with>
- </or>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.wst.xml.ui.internal.editor.propertytester.XMLEditorTester"
- id="org.eclipse.wst.xml.ui.internal.editor.propertytester.XMLEditorTester"
- namespace="org.eclipse.wst.xml.ui"
- properties="editor"
- type="org.eclipse.ui.IEditorPart">
- </propertyTester>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.expand">
- <or>
- <with variable="activeEditorId">
- <equals value="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"></equals>
- </with>
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.xml.expand"/>
- </iterate>
- </with>
- </or>
- </definition>
- </extension>
-
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.CleanupdocumentHandler"
- commandId="org.eclipse.wst.sse.ui.cleanup.document">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.cleanup"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.cleanup"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectEnclosingXMLHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.enclosing">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectNextXMLHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.next">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectPreviousXMLHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.previous">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.sse.ui.internal.handlers.StructuredSelectHistoryHandler"
- commandId="org.eclipse.wst.sse.ui.structure.select.last">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.selection"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.XMLFindOccurencesHandler"
- commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.occurrences"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.occurrences"/>
- </enabledWhen>
- </handler>
-<!--
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.GoToMatchingTagHandler"
- commandId="org.eclipse.wst.xml.ui.gotoMatchingTag">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </enabledWhen>
- </handler>
--->
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.NextSiblingNavigationHandler"
- commandId="org.eclipse.wst.xml.ui.nextSibling">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.PreviousSiblingNavigationHandler"
- commandId="org.eclipse.wst.xml.ui.previousSibling">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.navigation"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.ReloadDependenciesHandler"
- commandId="org.eclipse.wst.xml.ui.reload.dependencies">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.dependencies"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.dependencies"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.ToggleEditModeHandler"
- commandId="org.eclipse.wst.xml.ui.disable.grammar.constraints">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.grammar"/>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.grammar"/>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.wizards.NewXMLHandler"
- commandId="org.eclipse.wst.sse.ui.generate.xml">
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.ExpandAllHandler"
- commandId="sed.tabletree.expandAll">
- <activeWhen>
- <not>
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.sse.ui.structuredTextEditorScope"/>
- </iterate>
- </with>
- </not>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.CollapseAllHandler"
- commandId="sed.tabletree.collapseAll">
- <activeWhen>
- <not>
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.wst.sse.ui.structuredTextEditorScope"/>
- </iterate>
- </with>
- </not>
- </activeWhen>
- </handler>
- </extension>
-
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.eclipse.wst.sse.ui.generate.xml"
- name="%_UI_ACTION_CREATE_XML">
- </command>
- <command
- description="%ReloadDependencies_description"
- id="org.eclipse.wst.xml.ui.reload.dependencies"
- name="%ReloadDependencies_name">
- </command>
- <command
- description="%Constraints_description"
- id="org.eclipse.wst.xml.ui.disable.grammar.constraints"
- name="%Constraints_name">
- </command>
- <command
- id="sed.tabletree.expandAll"
- name="%ExpandAll_name">
- </command>
- <command
- id="sed.tabletree.collapseAll"
- name="%CollapseAll_name">
- </command>
- </extension>
-
- <!-- Define theme -->
- <extension
- point="org.eclipse.ui.themes">
- <theme
- id="org.eclipse.ui.ide.systemDefault">
- <colorOverride
- id="tagAttributeName"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="tagAttributeValue"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="commentBorder"
- value="COLOR_LIST_SELECTION">
- </colorOverride>
- <colorOverride
- id="commentText"
- value="COLOR_LIST_SELECTION">
- </colorOverride>
- <colorOverride
- id="declBoder"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="doctypeName"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="doctypeExternalPubref"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="doctypeExternalId"
- value="COLOR_WIDGET_NORMAL_SHADOW">
- </colorOverride>
- <colorOverride
- id="doctypeExtrenalSysref"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="tagBorder"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="tagName"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="piBorder"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="cdataBorder"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="cdataText"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- <colorOverride
- id="entityReference"
- value="COLOR_LIST_FOREGROUND">
- </colorOverride>
- </theme>
- <colorDefinition
- id="tagAttributeName"
- isEditable="false"
- label="%Colors.tagAttributeName"
- value="127, 0, 127">
- </colorDefinition>
- <colorDefinition
- id="tagAttributeValue"
- isEditable="false"
- label="%Colors.tagAttributeValue"
- value="42, 0, 255">
- </colorDefinition>
- <colorDefinition
- id="commentBorder"
- isEditable="false"
- label="%Colors.commentBorder"
- value="63, 95, 191">
- </colorDefinition>
- <colorDefinition
- id="commentText"
- isEditable="false"
- label="%Colors.commentText"
- value="63, 95, 191">
- </colorDefinition>
- <colorDefinition
- id="declBoder"
- isEditable="false"
- label="%Colors.declBorder"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="doctypeName"
- isEditable="false"
- label="%Colors.doctypeName"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="doctypeExternalPubref"
- isEditable="false"
- label="%Colors.doctypeExternalPubref"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="doctypeExternalId"
- isEditable="false"
- label="%Colors.doctypeExternalId"
- value="128, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="doctypeExtrenalSysref"
- isEditable="false"
- label="%Colors.doctypeExtrenalSysref"
- value="63, 127, 95">
- </colorDefinition>
- <colorDefinition
- id="tagBorder"
- isEditable="false"
- label="%Colors.tagBorder"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="tagName"
- isEditable="false"
- label="%Colors.tagName"
- value="63, 127, 127">
- </colorDefinition>
- <colorDefinition
- id="piBorder"
- isEditable="false"
- label="%Colors.piBorder"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="cdataBorder"
- isEditable="false"
- label="%Colors.cdataBorder"
- value="0, 128, 128">
- </colorDefinition>
- <colorDefinition
- id="cdataText"
- isEditable="false"
- label="%Colors.cdataText"
- value="0, 0, 0">
- </colorDefinition>
- <colorDefinition
- id="entityReference"
- isEditable="false"
- label="%Colors.entityReference"
- value="42, 0, 255">
- </colorDefinition>
- </extension>
-
- <!-- Enable the FormatHandler for XML 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.xml.ui.xmlContentType.definition"></reference>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.xml.ui.xmlContentType.definition"></reference>
- </enabledWhen>
- </handler>
- </extension>
-
- <!-- Set up a definition for XML Content Types -->
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.xml.ui.xmlContentType.definition">
- <or>
- <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.wst.xml.core.xmlsource" forcePluginActivation="true"/>
- </adapt>
- </iterate>
- <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.core.runtime.xml" forcePluginActivation="true"/>
- </adapt>
- </iterate>
- </or>
- </definition>
- </extension>
-
-
-
-
- <extension point="org.eclipse.ui.perspectives">
- <perspective id="org.eclipse.wst.xml.ui.perspective"
- class="org.eclipse.wst.xml.ui.internal.perspective.XMLPerspectiveFactory"
- icon="$nl$/icons/full/xml_perspective.gif"
- name="%XML.name"/>
- </extension>
-
- <extension point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension targetID="org.eclipse.wst.xml.ui.perspective">
- <!-- ProjectExplorer on the left -->
- <!--<view id="org.eclipse.ui.navigator.ProjectExplorer" relative="org.eclipse.ui.editorss" relationship="left" ratio="0.23" />-->
- <!-- XPath on the "bottom" left from its own UI plug-in since neither this bundle nor its owning feature require it -->
- <!-- Content Outline on the right -->
- <view id="org.eclipse.ui.views.ContentOutline" relative="org.eclipse.ui.editorss" relationship="right" ratio="0.7" />
- <!-- Templates on the bottom right [removed for 333271]
- <view id="org.eclipse.ui.texteditor.TemplatesView" relative="org.eclipse.ui.views.ContentOutline" relationship="bottom" ratio="0.6" />-->
- <!-- everything else on the bottom -->
- <view id="org.eclipse.ui.views.ProblemView" relative="org.eclipse.ui.editorss" relationship="bottom" ratio="0.6" />
- <view id="org.eclipse.wst.xml.ui.views.annotations.XMLAnnotationsView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" />
- <view id="org.eclipse.ui.views.PropertySheet" relative="org.eclipse.ui.views.ProblemView" relationship="stack"/>
- <view id="org.eclipse.ui.console.ConsoleView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" />
- <view id="org.eclipse.wst.common.snippets.internal.ui.SnippetsView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" />
- <!-- view placeholders -->
- <view id="org.eclipse.search.ui.views.SearchView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" visible="false" />
- <view id="org.eclipse.ui.views.ProgressView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" visible="false" />
-
- <actionSet id="org.eclipse.debug.ui.launchActionSet"/>
-
- <newWizardShortcut id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"/>
- <newWizardShortcut id="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"/>
- <newWizardShortcut id="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"/>
- <newWizardShortcut id="org.eclipse.ui.wizards.new.folder"/>
- <newWizardShortcut id="org.eclipse.ui.wizards.new.file"/>
- <newWizardShortcut id="org.eclipse.ui.editors.wizards.UntitledTextFileWizard"/>
-
- <viewShortcut id="org.eclipse.ui.navigator.ProjectExplorer"/>
- <viewShortcut id="org.eclipse.ui.views.ResourceNavigator"/>
- <viewShortcut id="org.eclipse.ui.views.ContentOutline"/>
- <viewShortcut id="org.eclipse.ui.views.PropertySheet"/>
- <viewShortcut id="org.eclipse.ui.views.ProblemView"/>
- <viewShortcut id="org.eclipse.ui.console.ConsoleView"/>
- <viewShortcut id="org.eclipse.ui.views.TaskList"/>
- <!--<viewShortcut id="org.eclipse.ui.texteditor.TemplatesView"/>-->
- <viewShortcut id="org.eclipse.search.ui.views.SearchView"/>
- <viewShortcut id="org.eclipse.ui.views.ProgressView"/>
-
- <perspectiveShortcut id="org.eclipse.debug.ui.DebugPerspective"/>
- <perspectiveShortcut id="org.eclipse.ui.resourcePerspective"/>
- </perspectiveExtension>
-
- <perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
- <perspectiveShortcut id="org.eclipse.wst.xml.ui.perspective"/>
- </perspectiveExtension>
- <perspectiveExtension targetID="org.eclipse.debug.ui.DebugPerspective">
- <perspectiveShortcut id="org.eclipse.wst.xml.ui.perspective"/>
- </perspectiveExtension>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard type="new" wizardId="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
- <enablement>
- <instanceof value="org.eclipse.core.resources.IResource"/>
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </enablement>
- </commonWizard>
- </extension>
-
- <extension point="org.eclipse.ui.menus" name="%XML.name" id="XML">
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
- <toolbar id="org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="$nl$/icons/full/etool16/new_xml.gif"
- id="org.eclipse.wst.xml.ui.newXMLFile"
- style="push"
- tooltip="%XML_New_File.tooltip">
- <parameter name="newWizardId" value="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"/>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- <separator name="additions" visible="false"/>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.characterPairing">
- <inserter
- class="org.eclipse.wst.xml.ui.internal.text.CharacterPairInserter"
- id="org.eclipse.wst.xml.ui.inserter">
- <contentTypeIdentifier
- id="org.eclipse.core.runtime.xml" partitions="org.eclipse.wst.xml.XML_DEFAULT,org.eclipse.wst.xml.XML_DECL">
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.wst.xml.core.xmlsource" partitions="org.eclipse.wst.xml.XML_DEFAULT,org.eclipse.wst.xml.XML_DECL">
- </contentTypeIdentifier>
- </inserter>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.commentingStrategy">
- <blockCommentingStrategy
- prefix="&lt;!--"
- suffix="--&gt;">
- <contentType
- id="org.eclipse.core.runtime.xml"
- associatedCommentPartitionTypeID="org.eclipse.wst.xml.XML_COMMENT">
- <allowablePartitionTypes
- anyPartitionType="true">
- </allowablePartitionTypes>
- </contentType>
- </blockCommentingStrategy>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal">
- <proposalCategory
- icon="icons/full/obj16/tag-generic.gif"
- id="org.eclipse.wst.xml.ui.proposalCategory.xmlTags"
- name="%proposalCategory.xmlTags">
- </proposalCategory>
- <proposalCategory
- icon="icons/full/obj16/tag-macro.gif"
- id="org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates"
- name="%proposalCategory.xmlTemplates">
- </proposalCategory>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.xml.ui.proposalCategory.xmlTags"
- class="org.eclipse.wst.xml.ui.internal.contentassist.XMLTagsCompletionProposalComputer"
- id="org.eclipse.wst.xml.ui.proposalComputer.xmlTags">
- <contentType
- id="org.eclipse.core.runtime.xml">
- </contentType>
- </proposalComputer>
- <proposalComputer
- activate="false"
- categoryId="org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates"
- class="org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer"
- id="org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates">
- <contentType
- id="org.eclipse.core.runtime.xml">
- </contentType>
- </proposalComputer>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
- <categoriesConfiguration
- class="org.eclipse.wst.xml.ui.internal.preferences.XMLCompletionProposalCategoriesConfiguration"
- contentTypeID="org.eclipse.core.runtime.xml">
- </categoriesConfiguration>
- </extension>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="%XML.name"
- id="org.eclipse.wst.xml"/>
- <view category="org.eclipse.wst.xml"
- class="org.eclipse.wst.xml.ui.internal.views.annotations.XMLAnnotationsView"
- id="org.eclipse.wst.xml.ui.views.annotations.XMLAnnotationsView"
- icon="icons/full/obj16/comment_obj.gif"
- name="%xmlannotations"
- restorable="true">
- </view>
- </extension>
-
- <!-- XML Content Model View -->
- <extension
- point="org.eclipse.ui.views">
- <view
- category="org.eclipse.wst.xml"
- class="org.eclipse.wst.xml.ui.internal.views.contentmodel.ContentModelView"
- icon="icons/full/view16/hierarchy.gif"
- id="org.eclipse.wst.xml.ui.contentmodel.view"
- name="%contentModel.view.name"
- restorable="true">
- </view>
- </extension>
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.wst.xml.ui.internal.views.contentmodel.ContentModelAdapterFactory"
- adaptableType="org.w3c.dom.Element">
- <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
- </factory>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="toolbar:org.eclipse.wst.xml.ui.contentmodel.view">
- <command
- commandId="org.eclipse.wst.xml.ui.cmnd.contentmodel.sych"
- id="org.eclipse.wst.xml.ui.command.contentmodel.synch"
- icon="icons/full/view16/synced.gif"
- style="toggle"
- tooltip="%contentModel.view.synch.tooltip">
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.xml.ui.internal.handlers.ContentModelSynchWithEditorHandler"
- commandId="org.eclipse.wst.xml.ui.cmnd.contentmodel.sych">
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.eclipse.wst.xml.ui.cmnd.contentmodel.sych"
- name="%contentModel.command.synch.name">
- <state
- class="org.eclipse.ui.handlers.RegistryToggleState:true"
- id="org.eclipse.ui.commands.toggleState">
- </state>
- </command>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.outlineFilters">
- <filter
- targetId="org.eclipse.wst.xml.ui.OutlinePage"
- name="%HideComments.label"
- enabled="false"
- description="%HideComments.description"
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLCommentFilter"
- id="org.eclipse.wst.xml.ui.views.contentoutline.XMLCommentFilter">
- </filter>
- <filter
- targetId="org.eclipse.wst.xml.ui.OutlinePage"
- name="%HideProcessingInstruction.label"
- enabled="false"
- description="%HideProcessingInstruction.description"
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLProcessingInstructionFilter"
- id="org.eclipse.wst.xml.ui.views.contentoutline.XMLProcessingInstructionFilter">
- </filter>
- <filter
- targetId="org.eclipse.wst.xml.ui.OutlinePage"
- name="%HideCDATASection.label"
- enabled="false"
- description="%HideCDATASection.description"
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLCDATASectionFilter"
- id="org.eclipse.wst.xml.ui.views.contentoutline.XMLCDATASectionFilter">
- </filter>
-</extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd b/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd
deleted file mode 100644
index 3629659d4d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.xml.ui" id="catalogFileType" name="XML Catalog file type extension point"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="fileType" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="fileType">
- <complexType>
- <attribute name="extensions" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java
deleted file mode 100644
index ac1dec6230..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.catalog;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.SaveAsDialog;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class AdvancedOptionsDialog extends Dialog {
- protected ICatalog workingUserCatalog;
-
- public AdvancedOptionsDialog(Shell parentShell, ICatalog workingUserCatalog) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.workingUserCatalog = workingUserCatalog;
- }
-
-
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- // WorkbenchHelp.setHelp(dialogArea, new
- // ControlContextComputer(dialogArea,
- // XMLBuilderContextIds.XMLP_PROJECT_DIALOG));
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label label = new Label(composite, SWT.NONE);
- label.setText(XMLCatalogMessages.UI_LABEL_DIALOG_DESCRIPTION);
-
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- buttonComposite.setLayout(gridLayout);
- buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite placeHolder = new Composite(buttonComposite, SWT.NONE);
- placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite buttonGroup = new Composite(buttonComposite, SWT.NONE);
- gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.makeColumnsEqualWidth = true;
- buttonGroup.setLayout(gridLayout);
- buttonGroup.setLayoutData(createGridData());
-
- Button importButton = new Button(buttonGroup, SWT.PUSH | SWT.CENTER);
- importButton.setText(" " + XMLCatalogMessages.UI_BUTTON_IMPORT + " "); //$NON-NLS-1$ //$NON-NLS-2$
-
- Button exportButton = new Button(buttonGroup, SWT.PUSH | SWT.CENTER);
- exportButton.setText(" " + XMLCatalogMessages.UI_BUTTON_EXPORT + " "); //$NON-NLS-1$ //$NON-NLS-2$
-
- placeHolder = new Composite(buttonComposite, SWT.NONE);
- placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // add importButton listener
- SelectionListener importButtonSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- invokeImportDialog();
- }
- };
- importButton.addSelectionListener(importButtonSelectionListener);
-
- // add exportButton listener
- SelectionListener exportButtonSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- invokeExportDialog();
- }
- };
- exportButton.addSelectionListener(exportButtonSelectionListener);
-
- return dialogArea;
- }
-
- protected GridData createGridData() {
- GridData gd = new GridData(GridData.CENTER);
- gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_CENTER;
- gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
- return gd;
- }
-
-
- protected void invokeImportDialog() {
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
- String[] extensions = {".xmlcatalog", ".xml"}; //$NON-NLS-1$ //$NON-NLS-2$
- dialog.addFilterExtensions(extensions);
- dialog.create();
- dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_TITLE);
- dialog.setTitle(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_HEADING);
- dialog.setMessage(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_MESSAGE);
- dialog.setBlockOnOpen(true);
- int rc = dialog.open();
- if (rc == Window.OK) {
- IFile file = dialog.getFile();
- if (file != null) {
- String fileName = file.getLocation().toFile().toURI().toString();
- try {
- CatalogSet tempResourceSet = new CatalogSet();
- ICatalog newCatalog = tempResourceSet.lookupOrCreateCatalog("temp", fileName); //$NON-NLS-1$
- workingUserCatalog.addEntriesFromCatalog(newCatalog);
- }
- catch (Exception e) {
- // TODO... give error message
- }
- }
- close();
- }
- }
-
-
- protected void invokeExportDialog() {
- IPath originalFilePath = null;
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects.length > 0) {
- originalFilePath = projects[0].getFullPath().append(".xmlcatalog"); //$NON-NLS-1$
- }
-
- SaveAsDialog dialog = new SaveAsDialog(getShell());
- if (originalFilePath != null) {
- IFile originalFile = ResourcesPlugin.getWorkspace().getRoot().getFile(originalFilePath);
- dialog.setOriginalFile(originalFile);
- }
- dialog.create();
-
- dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_TITLE);
- dialog.setTitle(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_HEADING);
- dialog.setMessage(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_MESSAGE);
-
- dialog.setBlockOnOpen(true);
- int rc = dialog.open();
- if (rc == Window.OK) {
- IPath path = dialog.getResult();
- if (path != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- String fileName = file.getLocation().toFile().toURI().toString();
-
- // here we save the catalog entries to the selected file
- try {
- createFileIfRequired(file);
- workingUserCatalog.setLocation(fileName);
- workingUserCatalog.save();
- }
- catch (Exception ex) {
- try {
- String title = XMLCatalogMessages.UI_LABEL_CATALOG_SAVE_ERROR;
- String briefMessage = XMLCatalogMessages.UI_LABEL_CATALOG_COULD_NOT_BE_SAVED;
- String reason = file.isReadOnly() ? NLS.bind(XMLCatalogMessages.UI_LABEL_FILE_IS_READ_ONLY, fileName) : NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
- String details = NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
-
- ErrorDialog.openError(Display.getCurrent().getActiveShell(), title, briefMessage, createStatus(reason, details));
- }
- catch (Exception ex2) {
- }
- }
- close();
- }
- }
- }
-
- // TODO... This was copied from WindowUtility. Is there an easier way to
- // create a status object?
- // If not, we should open an eclipse bug or add a similar utility to
- // baseExtensionsUI.
- //
- private static IStatus createStatus(String reason, String msg) {
- String pluginId = XMLUIPlugin.getDefault().getBundle().getSymbolicName();
- MultiStatus multiStatus = new MultiStatus(pluginId, 0, reason, null);
- Status status = new Status(IStatus.ERROR, pluginId, 0, msg, null);
- multiStatus.add(status);
- return multiStatus;
- }
-
-
- protected void createFileIfRequired(IFile file) {
- try {
- if ((file != null) && !file.exists()) {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(new byte[0]);
- file.create(inputStream, true, null);
- // createEmptyXMLCatalog(file);
- }
- }
- catch (Exception e) {
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
deleted file mode 100644
index 85b57d3344..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
+++ /dev/null
@@ -1,90 +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.xml.ui.internal.catalog;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class CatalogFileTypeRegistryReader {
- private static CatalogFileTypeRegistryReader _instance;
-
- static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
-
- static final String ATT_EXTENSIONS = "extensions"; //$NON-NLS-1$
-
- static final String ATT_ICON = "icon"; //$NON-NLS-1$
-
- static final String ATT_ID = "id"; //$NON-NLS-1$
-
- static final String EXTENSION_POINT_ID = "catalogFileType"; //$NON-NLS-1$
-
- static final String TAG_NAME = "fileType"; //$NON-NLS-1$
-
- private static CatalogFileTypeRegistryReader getInstance() {
- if (_instance == null) {
- _instance = new CatalogFileTypeRegistryReader();
- }
- return _instance;
- }
-
- public static Collection getXMLCatalogFileTypes() {
- return getInstance().hashMap.values();
- }
-
- private HashMap hashMap;
-
- public CatalogFileTypeRegistryReader() {
- this.hashMap = new HashMap();
- readRegistry();
- }
-
- private void readElement(IConfigurationElement element) {
- if (element.getName().equals(TAG_NAME)) {
- String id = element.getAttribute(ATT_ID);
- if (id != null) {
- XMLCatalogFileType fileType = (XMLCatalogFileType) hashMap.get(id);
- if (fileType == null) {
- fileType = new XMLCatalogFileType();
- hashMap.put(id, fileType);
- }
- fileType.id = id;
- if (fileType.description == null) {
- String description = element.getAttribute(ATT_DESCRIPTION);
- fileType.description = description;
- }
-
- fileType.addExtensions(element.getAttribute(ATT_EXTENSIONS));
- }
- }
- }
-
- private void readRegistry() {
- readRegistry(EXTENSION_POINT_ID);
- }
-
- private void readRegistry(String extensionPointId) {
- IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(XMLUIPlugin.ID, extensionPointId);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- readElement(elements[i]);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
deleted file mode 100644
index 578e8a8050..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
+++ /dev/null
@@ -1,1816 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-
-public class EditCatalogEntryDialog extends Dialog {
- protected static Image borwseImage = ImageFactory.INSTANCE.getImage("icons/obj16/file_expand.gif"); //$NON-NLS-1$
- protected static Image catalogEntryToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/catalogEntry.gif"); //$NON-NLS-1$
- protected static Image nextCatalogToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/nextCatalog.gif"); //$NON-NLS-1$
- protected static Image delegateCatalogToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/delegateCatalog.gif"); //$NON-NLS-1$
- protected static Image rewriteToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/rewrite.gif"); //$NON-NLS-1$
- protected static Image prefixToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/prefix.gif"); //$NON-NLS-1$
- protected static Image suffixToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/sufix.gif"); //$NON-NLS-1$
-
- protected class CatalogEntryPage extends CatalogElementPage {
-
- protected Button browseWorkspaceButton;
-
- protected Button browseFileSystemButton;
-
- protected ICatalogEntry catalogEntry;
-
- protected Button checkboxButton;
-
- protected Label errorMessageLabel;
-
- protected Text keyField;
-
- protected Combo keyTypeCombo;
-
- protected Text resourceLocationField;
-
- protected Combo resourceTypeCombo;
-
- protected Text webAddressField;
-
- protected String key;
-
- protected int type;
-
- public void refresh() {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- protected void computeErrorMessage() {
- errorMessage = null;
- warningMessage = null;
-
- String fileName = resourceLocationField.getText();
- if (fileName.trim().length() > 0) {
- if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
- }
-
- String uri = fileName;
- if (!URIHelper.hasProtocol(uri)) {
- URIHelper.isAbsolute(uri);
- uri = (URIHelper.isAbsolute(uri)) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
- }
-
- if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
- }
- }
- else {
- // this an error that is not actaully
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
-
- // Make sure the key is a fully qualified URI in the cases
- // where the key type is "System ID" or "Schema location"
- if ((keyField.getText().length() > 0) && (getKeyType() == ICatalogEntry.ENTRY_TYPE_SYSTEM)) {
- URI uri = URI.createURI(keyField.getText());
- if (uri.scheme() == null) {
- warningMessage = XMLCatalogMessages.UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI;
- }
- }
-
- if ((errorMessage == null) && checkboxButton.getSelection() && (webAddressField.getText().trim().length() == 0)) {
- // this an error that is not actaully
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
-
- if ((errorMessage == null) && (keyField.getText().trim().length() == 0)) {
- // this an error that is not actaully
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
- }
-
- protected Control createCatalogEntryPanel(Composite parent) {
-
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (e.widget == resourceLocationField) {
- if (keyField.getText().length() == 0) {
- String uri = resourceLocationField.getText();
- if (uri.endsWith("xsd") && !URIHelper.hasProtocol(uri)) { //$NON-NLS-1$
- uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
- String namespaceURI = XMLQuickScan.getTargetNamespaceURIForSchema(uri);
- if (namespaceURI != null) {
- keyField.setText(namespaceURI);
- }
- }
- }
- }
- updateWidgets(e.widget);
- }
- };
-
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gd);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- Composite group = new Composite(composite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
-
- layout = new GridLayout(2, false);
- group.setLayout(layout);
-
- Label resourceLocationLabel = new Label(group, SWT.NONE);
- resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_LOCATION_COLON);
-
- resourceLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
- gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- resourceLocationField.setLayoutData(gd);
-
- resourceLocationField.setText(getDisplayValue(URIUtils.convertURIToLocation(getEntry().getURI())));
-
- // WorkbenchHelp.setHelp(resourceLocationField,
- // XMLBuilderContextIds.XMLP_ENTRY_URI);
- resourceLocationField.addModifyListener(modifyListener);
-
- // WorkbenchHelp.setHelp(browseButton,
- // XMLBuilderContextIds.XMLP_ENTRY_BROWSE);
-
- Composite browseButtonsComposite = new Composite(group, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- gd.horizontalAlignment = GridData.END;
- browseButtonsComposite.setLayoutData(gd);
-
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.marginBottom = 5;
- browseButtonsComposite.setLayout(layout);
-
- browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
- browseWorkspaceButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeWorkspaceFileSelectionDialog();
- if(value != null) {
- resourceLocationField.setText(value);
- }
- }
- });
-
- browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
- browseFileSystemButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeFileSelectionDialog();
- if(value != null) {
- resourceLocationField.setText(value);
- }
- }
- });
-
- // Key Type
- //
- Label keyTypeLabel = new Label(group, SWT.NONE);
- keyTypeLabel.setText(XMLCatalogMessages.UI_KEY_TYPE_COLON);
-
- keyTypeCombo = new Combo(group, SWT.READ_ONLY);
- gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- keyTypeCombo.setLayoutData(gd);
- updateKeyTypeCombo(getEntry().getEntryType());
- keyTypeCombo.addModifyListener(modifyListener);
- // WorkbenchHelp.setHelp(keyTypeCombo,
- // XMLBuilderContextIds.XMLP_ENTRY_KEY_TYPE);
-
- // Key
- //
- Label keyValueLabel = new Label(group, SWT.NONE);
- keyValueLabel.setText(XMLCatalogMessages.UI_LABEL_KEY_COLON);
- keyField = new Text(group, SWT.SINGLE | SWT.BORDER);
- // WorkbenchHelp.setHelp(keyField,
- // XMLBuilderContextIds.XMLP_ENTRY_KEY);
- keyField.setLayoutData(gd);
- keyField.setText(getDisplayValue(getEntry().getKey()));
- keyField.addModifyListener(modifyListener);
-
- Composite group2 = new Composite(composite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- group2.setLayoutData(gd);
-
- layout = new GridLayout();
- group2.setLayout(layout);
-
- // checkbox -- note parent is dialogArea
- //
- checkboxButton = new Button(group2, SWT.CHECK);
- // WorkbenchHelp.setHelp(checkboxButton,
- // XMLBuilderContextIds.XMLP_ENTRY_SPECIFY_ALTERNATIVE);
- checkboxButton.setText(XMLCatalogMessages.UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL);
- checkboxButton.setLayoutData(new GridData());
- checkboxButton.setSelection(getEntry().getAttributeValue(ICatalogEntry.ATTR_WEB_URL) != null);
- SelectionListener buttonListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // no impl
- }
-
- public void widgetSelected(SelectionEvent event) {
- if (event.widget == checkboxButton) {
- updateWidgets(checkboxButton);
- }
- }
- };
- checkboxButton.addSelectionListener(buttonListener);
-
- // Web Address field
- //
-
- ModifyListener webAddressFieldListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
- };
-
- webAddressField = new Text(group2, SWT.SINGLE | SWT.BORDER);
- // WorkbenchHelp.setHelp(webAddressField,
- // XMLBuilderContextIds.XMLP_ENTRY_WEB_ADDRESS);
- webAddressField.setLayoutData(gd);
- webAddressField.setText(getDisplayValue(getEntry().getAttributeValue(ICatalogEntry.ATTR_WEB_URL)));
- webAddressField.setEnabled(false);
- webAddressField.addModifyListener(webAddressFieldListener);
-
-
- errorMessageLabel = new Label(group2, SWT.NONE);
- errorMessageLabel.setForeground(color);
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- updateWidgets(null);
-
- key = getEntry().getKey();
- type = getEntry().getEntryType();
-
- return composite;
- }
-
- public Control createControl(Composite parent) {
-
- fControl = createCatalogEntryPanel(parent);
-
- return fControl;
- }
-
-
- public ICatalogElement getData() {
- return getEntry();
- }
-
- protected ICatalogEntry getEntry() {
- if (catalogEntry == null) {
- if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY)) {
- catalogEntry = (ICatalogEntry) fCatalogElement;
- }
- else {
- if (catalog != null) {
- catalogEntry = (ICatalogEntry) catalog.createCatalogElement(ICatalogElement.TYPE_ENTRY);
- }
- }
- }
- return catalogEntry;
- }
-
- protected int getKeyType() {
- switch (keyTypeCombo.getSelectionIndex()) {
- case 0 :
- if ("schema".equals(keyTypeCombo.getData("keyType"))) { //$NON-NLS-1$ //$NON-NLS-2$
- return ICatalogEntry.ENTRY_TYPE_URI; // xsd
- // namespace
- // is URI type
- // key
- }
- return ICatalogEntry.ENTRY_TYPE_PUBLIC;
- case 1 :
- return ICatalogEntry.ENTRY_TYPE_SYSTEM;
- case 2 :
- return ICatalogEntry.ENTRY_TYPE_URI;
- default :
- return ICatalogEntry.ENTRY_TYPE_PUBLIC;
- }
- }
-
- public void saveData() {
- if (validateData()) {
- getEntry().setURI(URIUtils.convertLocationToURI(resourceLocationField.getText()));
- getEntry().setKey(keyField.getText());
- getEntry().setEntryType(getKeyType());
- getEntry().setAttributeValue(ICatalogEntry.ATTR_WEB_URL, checkboxButton.getSelection() ? webAddressField.getText() : null);
- dataSaved = true;
- }
- else {
- errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_ENTRY;
- errorMessageLabel.setText(errorMessage);
- updateOKButtonState();
- dataSaved = false;
- }
- }
-
- /**
- * Validates that the data entered does not conflict with an existing entry in either catalog.
- * @return True if validated, false otherwise.
- */
- protected boolean validateData() {
-
- String result = null;
- if (key == null || !key.equals(keyField.getText()) || type != getKeyType())
- {
- try {
- switch( getKeyType() )
- {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC:
- result = catalog.resolvePublic(keyField.getText(), null);
- break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM:
- result = catalog.resolveSystem(keyField.getText());
- break;
- case ICatalogEntry.ENTRY_TYPE_URI:
- result = catalog.resolveURI(keyField.getText());
- break;
- }
- }
- catch (Exception e) {
- }
- }
-
- return (result == null);
- }
-
- protected void updateKeyTypeCombo(int type) {
- keyTypeCombo.removeAll();
- for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
- XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
- if (theFileType.extensions != null) {
- for (Iterator j = theFileType.extensions.iterator(); j.hasNext();) {
- String extension = (String) j.next();
- if (resourceLocationField.getText().endsWith(extension)) {
- if ("org.eclipse.wst.xml.core.ui.catalogFileType.xsd".equals(theFileType.id)) { //$NON-NLS-1$
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM);
- keyTypeCombo.setData("keyType", "schema"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if ("org.eclipse.wst.xml.core.ui.catalogFileType.dtd".equals(theFileType.id)) { //$NON-NLS-1$
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- }
- else {
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- }
- }
-
- }
-
- }
- }
- if (keyTypeCombo.getItemCount() == 0) {
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- }
-
- switch (type) {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC :
- keyTypeCombo.select(0);
- break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM :
- keyTypeCombo.select(1);
- break;
- case ICatalogEntry.ENTRY_TYPE_URI : // handle XML Schema,
- // where namespace name is
- // mapped to URI situation
- if ("schema".equals(keyTypeCombo.getData("keyType"))) { //$NON-NLS-1$ //$NON-NLS-2$
- keyTypeCombo.select(0); // namespace name as URI key
- // type
- }
- else {
- keyTypeCombo.select(2); // URI key type
- }
- break;
- default :
- if (keyTypeCombo.getItemCount() > 0) {
- keyTypeCombo.select(0);
- }
- break;
- }
-
- }
-
- protected void updateWebAddressWidgets(int keyType) {
- boolean isPublicKeyType = (keyType == ICatalogEntry.ENTRY_TYPE_PUBLIC);
- checkboxButton.setEnabled(isPublicKeyType);
- webAddressField.setEnabled(isPublicKeyType && checkboxButton.getSelection());
- }
-
- protected void updateWidgets(Widget widget) {
- if (widget != keyTypeCombo) {
- updateKeyTypeCombo(getKeyType());
- }
- updateWebAddressWidgets(getKeyType());
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- }
-
- protected class SuffixEntryPage extends CatalogElementPage {
-
- protected Button browseWorkspaceButton;
-
- protected Button browseFileSystemButton;
-
- protected ISuffixEntry catalogEntry;
-
- protected Label errorMessageLabel;
-
- protected Text suffixField;
-
- protected Combo keyTypeCombo;
-
- protected Text resourceLocationField;
-
- protected Combo resourceTypeCombo;
-
- protected String key;
-
- protected int type;
-
- public void refresh() {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- protected void computeErrorMessage() {
- errorMessage = null;
- warningMessage = null;
-
- String fileName = resourceLocationField.getText();
- if (fileName.trim().length() > 0) {
- if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
- }
-
- String uri = fileName;
- if (!URIHelper.hasProtocol(uri)) {
- URIHelper.isAbsolute(uri);
- uri = (URIHelper.isAbsolute(uri)) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
- }
-
- if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
- }
- }
- else {
- // this an error that is not actaully
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
-
-
- if ((errorMessage == null) && (suffixField.getText().trim().length() == 0)) {
- // this an error that is not actaully
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
- }
-
- protected Control createSuffixEntryPanel(Composite parent) {
-
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (e.widget == resourceLocationField) {
- if (suffixField.getText().length() == 0) {
- String uri = resourceLocationField.getText();
- if (uri.endsWith("xsd") && !URIHelper.hasProtocol(uri)) { //$NON-NLS-1$
- uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
- String namespaceURI = XMLQuickScan.getTargetNamespaceURIForSchema(uri);
- if (namespaceURI != null) {
- suffixField.setText(namespaceURI);
- }
- }
- }
- }
- updateWidgets(e.widget);
- }
- };
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gd);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- Composite group = new Composite(composite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
-
- layout = new GridLayout(2, false);
- group.setLayout(layout);
-
- Label resourceLocationLabel = new Label(group, SWT.NONE);
- resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_LOCATION_COLON);
-
- resourceLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
- gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- resourceLocationField.setLayoutData(gd);
-
- resourceLocationField.setText(getDisplayValue(URIUtils.convertURIToLocation(getEntry().getURI())));
- resourceLocationField.addModifyListener(modifyListener);
-
- Composite browseButtonsComposite = new Composite(group, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- gd.horizontalAlignment = GridData.END;
- browseButtonsComposite.setLayoutData(gd);
-
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.marginBottom = 5;
- browseButtonsComposite.setLayout(layout);
-
- browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
- browseWorkspaceButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeWorkspaceFileSelectionDialog();
- if(value != null) {
- resourceLocationField.setText(value);
- }
- }
- });
-
- browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
- browseFileSystemButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeFileSelectionDialog();
- if(value != null) {
- resourceLocationField.setText(value);
- }
- }
- });
-
- // Key Type
- //
- Label keyTypeLabel = new Label(group, SWT.NONE);
- keyTypeLabel.setText(XMLCatalogMessages.UI_KEY_TYPE_COLON);
-
- keyTypeCombo = new Combo(group, SWT.READ_ONLY);
- gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- keyTypeCombo.setLayoutData(gd);
- updateKeyTypeCombo(getEntry().getEntryType());
- keyTypeCombo.addModifyListener(modifyListener);
-
- // Suffix
- //
- Label suffixValueLabel = new Label(group, SWT.NONE);
- suffixValueLabel.setText(XMLCatalogMessages.UI_LABEL_SUFFIX_COLON);
- suffixField = new Text(group, SWT.SINGLE | SWT.BORDER);
-
- suffixField.setLayoutData(gd);
- suffixField.setText(getDisplayValue(getEntry().getSuffix()));
- suffixField.addModifyListener(modifyListener);
-
- errorMessageLabel = new Label(composite, SWT.NONE);
- errorMessageLabel.setForeground(color);
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- updateWidgets(null);
-
- key = getEntry().getSuffix();
- type = getEntry().getEntryType();
-
- return composite;
- }
-
- public Control createControl(Composite parent) {
-
- fControl = createSuffixEntryPanel(parent);
-
- return fControl;
- }
-
-
- public ICatalogElement getData() {
- return getEntry();
- }
-
- protected ISuffixEntry getEntry() {
- if (catalogEntry == null) {
- if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_SUFFIX)) {
- catalogEntry = (ISuffixEntry) fCatalogElement;
- }
- else {
- if (catalog != null) {
- catalogEntry = (ISuffixEntry) catalog.createCatalogElement(ICatalogElement.TYPE_SUFFIX);
- }
- }
- }
- return catalogEntry;
- }
-
- protected int getKeyType() {
- switch (keyTypeCombo.getSelectionIndex()) {
- case 0 :
- return ISuffixEntry.SUFFIX_TYPE_URI; // xsd namespace is URI type key
- case 1 :
- return ISuffixEntry.SUFFIX_TYPE_SYSTEM;
- default :
- return ISuffixEntry.SUFFIX_TYPE_URI;
- }
- }
-
- public void saveData() {
- if (validateData()) {
- getEntry().setURI(URIUtils.convertLocationToURI(resourceLocationField.getText()));
- getEntry().setSuffix(suffixField.getText());
- getEntry().setEntryType(getKeyType());
- dataSaved = true;
- }
- else {
- errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_SUFFIX;
- errorMessageLabel.setText(errorMessage);
- updateOKButtonState();
- dataSaved = false;
- }
- }
-
- protected boolean validateData() {
- ISuffixEntry entry = getEntry();
- String uri = URIUtils.convertLocationToURI(resourceLocationField.getText());
- if(entry.getEntryType() != getKeyType() || !entry.getSuffix().equals(suffixField.getText()) || !entry.getURI().equals(uri)) {
- ISuffixEntry[] entries = catalog.getSuffixEntries();
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].getSuffix().equals(suffixField.getText()) && entries[i].getEntryType() == getKeyType()) return false;
- }
- }
- return true;
- }
-
- protected void updateKeyTypeCombo(int type) {
- keyTypeCombo.removeAll();
- for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
- XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
- if (theFileType.extensions != null) {
- for (Iterator j = theFileType.extensions.iterator(); j.hasNext();) {
- String extension = (String) j.next();
- if (resourceLocationField.getText().endsWith(extension)) {
- if ("org.eclipse.wst.xml.core.ui.catalogFileType.xsd".equals(theFileType.id)) { //$NON-NLS-1$
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM);
- }
- else if ("org.eclipse.wst.xml.core.ui.catalogFileType.dtd".equals(theFileType.id)) { //$NON-NLS-1$
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- }
- else {
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- }
- }
-
- }
-
- }
- }
- if (keyTypeCombo.getItemCount() == 0) {
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- }
-
- switch (type) {
- case ISuffixEntry.SUFFIX_TYPE_URI: // handle XML Schema,
- keyTypeCombo.select(0); // namespace name as URI key
- break;
-
- case ISuffixEntry.SUFFIX_TYPE_SYSTEM :
- keyTypeCombo.select(1);
- break;
-
- default :
- if (keyTypeCombo.getItemCount() > 0) {
- keyTypeCombo.select(0);
- }
- break;
- }
-
- }
-
- protected void updateWidgets(Widget widget) {
- if (widget != keyTypeCombo) {
- updateKeyTypeCombo(getKeyType());
- }
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- }
-
- protected abstract class CatalogElementPage {
-
- Control fControl;
-
- public CatalogElementPage() {
- super();
-
- }
-
- public abstract void refresh();
-
- public abstract Control createControl(Composite parent);
-
- public Control getControl() {
- return fControl;
- }
-
- public abstract ICatalogElement getData();
-
- public abstract void saveData();
- }
-
- protected class FilterableSelectSingleFileDialog extends SelectSingleFileDialog implements SelectionListener {
- protected Combo filterControl;
-
- public FilterableSelectSingleFileDialog(Shell parentShell) {
- super(parentShell, null, true);
- setFilters(null);
- }
-
- public void createAndOpen() {
- this.create();
- setBlockOnOpen(true);
- getShell().setText(XMLCatalogMessages.UI_LABEL_FILE_SELECTION);
- this.setTitle(XMLCatalogMessages.UI_LABEL_SELECT_FILE);
- this.setMessage(XMLCatalogMessages.UI_LABEL_CHOOSE_FILE_TO_ADD_TO_CATALOG);
- open();
- }
-
- public void createFilterControl(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- label.setText(XMLCatalogMessages.UI_LABEL_SELECT_FILE_FILTER_CONTROL);
-
- filterControl = new Combo(composite, SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- filterControl.setLayoutData(gd);
-
- filterControl.setText(XMLCatalogMessages.UI_TEXT_SELECT_FILE_FILTER_CONTROL);
- filterControl.add(XMLCatalogMessages.UI_TEXT_SELECT_FILE_FILTER_CONTROL);
-
- for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
- XMLCatalogFileType fileType = (XMLCatalogFileType) i.next();
- if (fileType.description != null) {
- filterControl.add(fileType.description);
- }
- }
-
- filterControl.select(0);
- filterControl.addSelectionListener(this);
- }
-
- protected void setFilters(XMLCatalogFileType fileType) {
- if (fileType == null) {
- // compute all the supported file extensions
- List list = new ArrayList();
- for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
- XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
- if (theFileType.extensions != null) {
- list.addAll(theFileType.extensions);
- }
- }
- // Any files are now supported with Resource URI
- selectSingleFileView.setFilterExtensions(createStringArray(list));
- }
- else {
- if (fileType.extensions != null) {
- selectSingleFileView.setFilterExtensions(createStringArray(fileType.extensions));
- }
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- String text = filterControl.getText();
- XMLCatalogFileType fileType = getMatchingFileType(text);
- setFilters(fileType);
- }
- }
-
- protected abstract class AbstractDelegatePage extends CatalogElementPage {
-
-
- protected Button browseWorkspaceButton;
-
- protected Button browseFileSystemButton;
-
- protected Text catalogLocationField;
-
- protected Label errorMessageLabel;
-
- protected void computeErrorMessage() {
- errorMessage = null;
- String fileName = catalogLocationField.getText();
- if (fileName.trim().length() > 0) {
- if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
- }
-
- String uri = fileName;
- if (!URIHelper.hasProtocol(uri)) {
- uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
- }
-
- if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
- errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
- }
- }
- else {
- // this an error that is not actually
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
- }
-
- public abstract Control createControl(Composite parent);
-
- protected Control createNextCatalogPanel(Composite parent, String catalogUriLabel) {
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateWidgets(e.widget);
- }
- };
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gd);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- Composite group = new Composite(composite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
-
- layout = new GridLayout();
- group.setLayout(layout);
-
- createSpecificFields(group);
-
- Label resourceLocationLabel = new Label(group, SWT.NONE);
- resourceLocationLabel.setText(catalogUriLabel);
-
- catalogLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
- catalogLocationField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- catalogLocationField.setText(URIUtils.convertURIToLocation(getDisplayValue(getCatalogLocation())));
- // WorkbenchHelp.setHelp(resourceLocationField,
- // XMLBuilderContextIds.XMLP_ENTRY_URI);
- catalogLocationField.addModifyListener(modifyListener);
-
- Composite browseButtonsComposite = new Composite(group, SWT.FLAT);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- gd.horizontalAlignment = GridData.END;
- browseButtonsComposite.setLayoutData(gd);
-
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.marginBottom = 5;
- browseButtonsComposite.setLayout(layout);
-
- browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
- browseWorkspaceButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeWorkspaceFileSelectionDialog();
- if(value != null) {
- catalogLocationField.setText(value);
- }
- }
- });
-
- browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
- browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
- browseFileSystemButton.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- String value = invokeFileSelectionDialog();
- if(value != null) {
- catalogLocationField.setText(value);
- }
- }
- });
-
- errorMessageLabel = new Label(group, SWT.NONE);
- errorMessageLabel.setForeground(color);
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- updateWidgets(null);
- return composite;
- }
-
- protected void createSpecificFields(Composite group) {
- }
-
- protected abstract String getCatalogLocation();
-
- protected void updateWidgets(Widget widget) {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
- }
-
- protected class NextCatalogPage extends AbstractDelegatePage {
- protected INextCatalog nextCatalog;
-
- public ICatalogElement getData() {
- return getNextCatalog();
- }
-
- public void refresh() {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- protected INextCatalog getNextCatalog() {
- if (nextCatalog == null) {
- if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG)) {
- nextCatalog = (INextCatalog) fCatalogElement;
- }
- else {
- if (catalog != null) {
- nextCatalog = (INextCatalog) catalog.createCatalogElement(ICatalogElement.TYPE_NEXT_CATALOG);
- }
- }
- }
- return nextCatalog;
- }
-
- public void saveData() {
- getNextCatalog().setCatalogLocation(URIUtils.convertLocationToURI(catalogLocationField.getText()));
- dataSaved = true;
- }
-
- protected String getCatalogLocation() {
- return getNextCatalog().getCatalogLocation();
- }
-
- public Control createControl(Composite parent) {
- fControl = createNextCatalogPanel(parent, XMLCatalogMessages.UI_LABEL_CATALOG_URI_COLON);
- return fControl;
- }
- }
-
- protected class DelegateCatalogPage extends AbstractDelegatePage {
- protected IDelegateCatalog delegateCatalog;
- private Text prefixField;
- private Combo keyTypeCombo;
-
- public void refresh() {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- protected void computeErrorMessage() {
- errorMessage = null;
- String prefix = prefixField.getText();
- if(prefix.length() > 0) {
- // good
- } else {
- errorMessage = "";
- }
- }
-
- public ICatalogElement getData() {
- return getDelegateCatalog();
- }
-
- protected void createSpecificFields(Composite group) {
-
- Composite prefixComposite = new Composite(group, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.marginBottom = 5;
- prefixComposite.setLayout(layout);
-
- // Key Type
- //
- Label keyTypeLabel = new Label(prefixComposite, SWT.NONE);
- keyTypeLabel.setText(XMLCatalogMessages.UI_MATCH_KEY_TYPE_COLON);
-
- keyTypeCombo = new Combo(prefixComposite, SWT.READ_ONLY);
- GridData gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- keyTypeCombo.setLayoutData(gd);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- switch (getDelegateCatalog().getEntryType()) {
- case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
- keyTypeCombo.select(0);
- break;
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- keyTypeCombo.select(1);
- break;
- default:
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- keyTypeCombo.select(2);
- break;
- }
-
- Label prefixLabel = new Label(prefixComposite, SWT.NONE);
- prefixLabel.setText(XMLCatalogMessages.UI_LABEL_START_STRING_COLON);
-
- prefixField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
- prefixField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- prefixField.setText(getDisplayValue(getDelegateCatalog().getStartString()));
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateWidgets(e.widget);
- }
- };
- prefixField.addModifyListener(modifyListener);
- prefixComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- }
-
- protected IDelegateCatalog getDelegateCatalog() {
- if (delegateCatalog == null) {
- if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_DELEGATE)) {
- delegateCatalog = (IDelegateCatalog) fCatalogElement;
- }
- else {
- if (catalog != null) {
- delegateCatalog = (IDelegateCatalog) catalog.createCatalogElement(IDelegateCatalog.DELEGATE_TYPE_URI);
- }
- }
- }
- return delegateCatalog;
- }
-
- public void saveData() {
- if (validateData())
- {
- getDelegateCatalog().setCatalogLocation(URIUtils.convertLocationToURI(catalogLocationField.getText()));
- getDelegateCatalog().setStartString(prefixField.getText());
- getDelegateCatalog().setEntryType(getDelegateType());
- dataSaved = true;
- }
- else {
- errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_DELEGATE;
- errorMessageLabel.setText(errorMessage);
- updateOKButtonState();
- dataSaved = false;
- }
- }
-
- private int getDelegateType() {
- switch (keyTypeCombo.getSelectionIndex()) {
- case 0:
- return IDelegateCatalog.DELEGATE_TYPE_PUBLIC;
-
- case 1:
- return IDelegateCatalog.DELEGATE_TYPE_SYSTEM;
-
- case 2:
- default:
- return IDelegateCatalog.DELEGATE_TYPE_URI;
- }
- }
-
- protected boolean validateData() {
- IDelegateCatalog entry = getDelegateCatalog();
- String prefix = prefixField.getText();
- if(entry.getEntryType() != getDelegateType() || !prefix.equals(entry.getStartString())) {
- IDelegateCatalog[] entries = catalog.getDelegateCatalogs();
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].getStartString().equals(prefixField) && entries[i].getEntryType() == getDelegateType()) return false;
- }
- }
- return true;
- }
-
- protected String getCatalogLocation() {
- return getDelegateCatalog().getCatalogLocation();
- }
-
- public Control createControl(Composite parent) {
- fControl = createNextCatalogPanel(parent, XMLCatalogMessages.UI_LABEL_DELEGATE_CATALOG_URI_COLON);
- return fControl;
- }
- }
-
- protected class RadioItemSelectionChangeListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- Object selection = e.getSource();
- if (selection instanceof Button) {
- Button button = (Button) selection;
- if (button.getSelection()) {
- if (!showPage((CatalogElementPage) button.getData())) {
- // Page flipping wasn't successful
- // handleError();
- }
- }
- }
- }
-
- }
-
- protected class RewriteEntryPage extends CatalogElementPage {
- protected IRewriteEntry rewriteEntry;
- private Text startStringField;
- private Text prefixField;
- private Combo keyTypeCombo;
-
- public void refresh() {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
-
- public ICatalogElement getData() {
- return getRewriteEntry();
- }
-
- protected Label errorMessageLabel;
-
- protected void computeErrorMessage() {
- errorMessage = null;
-
- String start = startStringField.getText();
- String prefix = prefixField.getText();
- if (start.trim().length() > 0 && prefix.trim().length() > 0) {
- // good
- }
- else {
- // this an error that is not actually
- // reported ... OK is just disabled
- errorMessage = ""; //$NON-NLS-1$
- }
- }
-
- protected IRewriteEntry getRewriteEntry() {
- if (rewriteEntry == null) {
- if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_REWRITE)) {
- rewriteEntry = (IRewriteEntry) fCatalogElement;
- }
- else {
- if (catalog != null) {
- rewriteEntry = (IRewriteEntry) catalog.createCatalogElement(IRewriteEntry.REWRITE_TYPE_SYSTEM);
- }
- }
- }
- return rewriteEntry;
- }
-
- protected void updateWidgets(Widget widget) {
- computeErrorMessage();
- updateErrorMessageLabel(errorMessageLabel);
- updateOKButtonState();
- }
- public void saveData() {
- if (validateData()) {
- getRewriteEntry().setRewritePrefix(prefixField.getText());
- getRewriteEntry().setStartString(startStringField.getText());
- getRewriteEntry().setEntryType(getEntryType());
- dataSaved = true;
- }
- else {
- errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_REWRITE;
- errorMessageLabel.setText(errorMessage);
- updateOKButtonState();
- dataSaved = false;
- }
- }
-
- private int getEntryType() {
- switch (keyTypeCombo.getSelectionIndex()) {
- case 0:
- return IRewriteEntry.REWRITE_TYPE_SYSTEM;
- case 1:
- default:
- return IRewriteEntry.REWRITE_TYPE_URI;
- }
- }
-
- protected boolean validateData() {
- IRewriteEntry entry = getRewriteEntry();
- String startString = startStringField.getText();
- if(entry.getEntryType() != getEntryType() || !entry.getStartString().equals(startString)) {
- IRewriteEntry[] entries = catalog.getRewriteEntries();
- for (int i = 0; i < entries.length; i++) {
- if (entries[i].getStartString().equals(startString) && entries[i].getEntryType() == getEntryType()) return false;
- }
- }
- return true;
- }
-
- public Control createControl(Composite parent) {
-
- fControl = createRewriteEntryPanel(parent);
-
- return fControl;
- }
-
- public Control createRewriteEntryPanel(Composite parent) {
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateWidgets(e.widget);
- }
- };
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gd);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- Composite group = new Composite(composite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
-
- layout = new GridLayout();
- group.setLayout(layout);
-
- Composite prefixComposite = new Composite(group, SWT.NONE);
-
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.marginBottom = 5;
- prefixComposite.setLayout(layout);
-
- // Key Type
- //
- Label keyTypeLabel = new Label(prefixComposite, SWT.NONE);
- keyTypeLabel.setText(XMLCatalogMessages.UI_MATCH_KEY_TYPE_COLON);
-
- keyTypeCombo = new Combo(prefixComposite, SWT.READ_ONLY);
- gd = new GridData();
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- keyTypeCombo.setLayoutData(gd);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
- keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
- switch (getRewriteEntry().getEntryType()) {
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- keyTypeCombo.select(0);
- break;
- default:
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- keyTypeCombo.select(1);
- break;
- }
- Label startStringLabel = new Label(prefixComposite, SWT.NONE);
- startStringLabel.setText(XMLCatalogMessages.UI_LABEL_START_STRING_COLON);
-
- startStringField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
- startStringField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- startStringField.setText(getDisplayValue(getRewriteEntry().getStartString()));
- startStringField.addModifyListener(modifyListener);
-
- Label prefixLabel = new Label(prefixComposite, SWT.NONE);
- prefixLabel.setText(XMLCatalogMessages.UI_LABEL_REWRITE_PREFIX_COLON);
-
- prefixField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
- prefixField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- prefixField.setText(getDisplayValue(getRewriteEntry().getRewritePrefix()));
- prefixField.addModifyListener(modifyListener);
-
- prefixComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
-
- errorMessageLabel = new Label(group, SWT.NONE);
- errorMessageLabel.setForeground(color);
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- updateWidgets(null);
- return composite;
- }
- }
-
- protected class ToolBarItemSelectionChangeListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- Object selection = e.getSource();
- if (selection instanceof ToolItem) {
- ToolItem toolItem = (ToolItem)selection;
- ToolBar toolbar = toolItem.getParent();
- if(toolbar != null) {
- ToolItem[] items = toolbar.getItems();
- for (int i = 0; i < items.length; i++) {
- items[i].setSelection(items[i] == toolItem);
- }
- }
- if (!showPage((CatalogElementPage) toolItem.getData())) {
- // Page flipping wasn't successful
- // handleError();
- }
- }
- }
- }
-
- public static String[] createStringArray(List list) {
- String[] stringArray = new String[list.size()];
- for (int i = 0; i < stringArray.length; i++) {
- stringArray[i] = (String) list.get(i);
- }
- return stringArray;
- }
-
- public static String removeLeadingSlash(String uri) {
- // remove leading slash from the value to avoid the whole leading
- // slash
- // ambiguity problem
- //
- if (uri != null) {
- while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
- uri = uri.substring(1);
- }
- }
- return uri;
- }
-
- protected ICatalog catalog;
-
- protected ICatalogElement fCatalogElement;
-
- protected String errorMessage;
-
- protected String warningMessage;
-
- protected Button okButton;
-
- protected PageBook pageContainer;
-
- protected CatalogElementPage selectedPage;
-
- // protected TreeViewer treeViewer;
-
- protected ToolBar toolBar;
-
- protected Composite elementTypeComposite;
-
- protected Color color;
- protected boolean dataSaved;
-
- public EditCatalogEntryDialog(Shell parentShell, ICatalog aCatalog) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.catalog = aCatalog;
- }
-
- public EditCatalogEntryDialog(Shell parentShell, ICatalogElement catalogElement, ICatalog aCatalog) {
- this(parentShell, aCatalog);
- this.fCatalogElement = catalogElement;
- // TODO EB: fix his
- // entry.setURI(URIHelper.removePlatformResourceProtocol(entry.getURI()));
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- selectedPage.saveData();
- if (!dataSaved) {
- // do not exit edit dialog
- return;
- }
- }
- super.buttonPressed(buttonId);
- }
-
-
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- okButton.setEnabled(false);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- updateOKButtonState();
- }
-
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogAreaComposite = (Composite) super.createDialogArea(parent);
- color = new Color(dialogAreaComposite.getDisplay(), 200, 0, 0);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- dialogAreaComposite.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 550;
- //gd.heightHint = 250;
- dialogAreaComposite.setLayoutData(gd);
- createMainComponent(dialogAreaComposite);
- return this.dialogArea;
- }
-
- public boolean close() {
- if (color != null) {
- color.dispose();
- }
- return super.close();
- }
-
- protected Composite createMainComponent(Composite composite) {
- if (fCatalogElement != null) // "edit" action
- {
- Composite composite1 = new Composite(composite, SWT.NONE);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite1.setLayoutData(data);
- GridLayout layout = new GridLayout();
- composite1.setLayout(layout);
-
- pageContainer = new PageBook(composite1, SWT.NONE);
- pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY) {
- CatalogElementPage entryPage = new CatalogEntryPage();
- entryPage.createControl(pageContainer);
- showPage(entryPage);
- }
- else if (fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG) {
- CatalogElementPage nextCatalogPage = new NextCatalogPage();
- nextCatalogPage.createControl(pageContainer);
- showPage(nextCatalogPage);
- }
- else if (fCatalogElement.getType() == ICatalogElement.TYPE_DELEGATE) {
- DelegateCatalogPage delegateCatalogPage = new DelegateCatalogPage();
- delegateCatalogPage.createControl(pageContainer);
- showPage(delegateCatalogPage);
- }
- else if (fCatalogElement.getType() == ICatalogElement.TYPE_SUFFIX) {
- SuffixEntryPage suffixEntryPage = new SuffixEntryPage();
- suffixEntryPage.createControl(pageContainer);
- showPage(suffixEntryPage);
- }
- else if (fCatalogElement.getType() == ICatalogElement.TYPE_REWRITE) {
- RewriteEntryPage rewriteEntryPage = new RewriteEntryPage();
- rewriteEntryPage.createControl(pageContainer);
- showPage(rewriteEntryPage);
- }
-
- return composite1;
- }
- return createMainComponentWithToolbar(composite);
-
- }
-
-
- protected Composite createMainComponentWithToolbar(Composite composite) {
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginHeight = 5;
- formLayout.marginWidth = 5;
- composite.setLayout(formLayout);
-
- Label label = new Label(composite, SWT.NONE);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- label.setLayoutData(data);
-
- toolBar = new ToolBar(composite, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);
-
-
- data = new FormData();
- data.top = new FormAttachment(label, 0);
- data.left = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- // data.height = 250;
- // data.width = 50;
- toolBar.setLayoutData(data);
-
- Composite composite1 = new Composite(composite, SWT.BORDER);
- data = new FormData();
- data.top = new FormAttachment(label, 0);
- data.left = new FormAttachment(toolBar, 0, SWT.DEFAULT);
- data.right = new FormAttachment(100, 0);
- data.bottom = new FormAttachment(100, 0);
- composite1.setLayoutData(data);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite1.setLayout(layout);
-
- // createPageBookPanel(composite1);
- pageContainer = new PageBook(composite1, SWT.NONE);
- pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- // add pages for each type of catalog element
- createCatalogEntryButton();
- createRewriteButton();
- createSuffixCatalogButton();
- createNextCatalogButton();
- createDelegateCatalogButton();
- if (toolBar.getItemCount() > 0) {
- ToolItem item = toolBar.getItem(0);
- showPage((CatalogElementPage) (item.getData()));
- }
- return composite1;
- }
-
- protected void createCatalogEntryButton() {
- CatalogElementPage page = new CatalogEntryPage();
- page.createControl(pageContainer);
- ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
- toolItem.setImage(catalogEntryToolBarImage);
- toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_catalogEntryLabel);
- toolItem.setData(page);
- toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
- toolItem.setSelection(true);
- }
-
- protected void createNextCatalogButton() {
- CatalogElementPage page = new NextCatalogPage();
- page.createControl(pageContainer);
- ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
- toolItem.setImage(nextCatalogToolBarImage);
- toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_nextCatalogLabel);
- toolItem.setData(page);
- toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
-
- }
-
- protected void createRewriteButton() {
- CatalogElementPage page = new RewriteEntryPage();
- page.createControl(pageContainer);
- ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
- toolItem.setImage(rewriteToolBarImage);
- toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_rewriteEntryLabel);
- toolItem.setData(page);
- toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
- }
-
- protected void createDelegateCatalogButton() {
- CatalogElementPage page = new DelegateCatalogPage();
- page.createControl(pageContainer);
- ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
- toolItem.setImage(delegateCatalogToolBarImage);
- toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_delegateCatalogLabel);
- toolItem.setData(page);
- toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
- }
-
- protected void createSuffixCatalogButton() {
- CatalogElementPage page = new SuffixEntryPage();
- page.createControl(pageContainer);
- ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
- toolItem.setImage(suffixToolBarImage);
- toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_suffixEntryLabel);
- toolItem.setData(page);
- toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
- }
-
-
-
-
-
-
-//
-// protected void createRewriteEntryButton() {
-// CatalogElementPage page = new RewriteEntryPage();
-// page.createControl(pageContainer);
-// Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
-// radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_rewriteEntryLabel);
-// radioButton.setData(page);
-// radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
-// }
-//
-// protected void createSuffixEntryButton() {
-// CatalogElementPage page = new SuffixEntryPage();
-// page.createControl(pageContainer);
-// Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
-// radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_suffixEntryLabel);
-// radioButton.setData(page);
-// radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
-// }
-//
-// protected void createDelegateCatalogButton() {
-// CatalogElementPage page = new DelegateCatalogPage();
-// page.createControl(pageContainer);
-// Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
-// radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_delegateCatalogLabel);
-// radioButton.setData(page);
-// radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
-//
-// }
-
- protected ICatalogElement getCatalogElement() {
- return fCatalogElement;
- }
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- protected XMLCatalogFileType getMatchingFileType(String description) {
- XMLCatalogFileType fileType = null;
- for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
- XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
- if ((theFileType.description != null) && theFileType.description.equals(description)) {
- fileType = theFileType;
- }
- }
- return fileType;
- }
-
- protected boolean showPage(CatalogElementPage page) {
- if (pageContainer.isDisposed()) {
- return false;
- }
- selectedPage = page;
- pageContainer.setVisible(true);
- pageContainer.showPage(selectedPage.getControl());
- fCatalogElement = selectedPage.getData();
- selectedPage.refresh();
- return true;
- }
-
- protected void updateErrorMessageLabel(Label errorMessageLabel) {
- if (errorMessage != null) {
- errorMessageLabel.setText(errorMessage);
- }
- else if (warningMessage != null) {
- errorMessageLabel.setText(warningMessage);
- }
- else {
- errorMessageLabel.setText("");
- }
- }
-
- protected void updateOKButtonState() {
- if (okButton != null) {
- okButton.setEnabled(errorMessage == null);
- }
- }
-
- protected Button createBrowseButton(Composite composite) {
- Button browseButton = new Button(composite, SWT.PUSH);
- // browseButton.setText(XMLCatalogMessages.
- // UI_BUTTON_BROWSE"));
- browseButton.setImage(borwseImage);
- Rectangle r = borwseImage.getBounds();
- GridData gd = new GridData();
- int IMAGE_WIDTH_MARGIN = 6;
- int IMAGE_HEIGHT_MARGIN = 6;
- gd.heightHint = r.height + IMAGE_HEIGHT_MARGIN;
- gd.widthHint = r.width + IMAGE_WIDTH_MARGIN;
- browseButton.setLayoutData(gd);
-
- return browseButton;
-
- }
-
- protected Button createWorkspaceBrowseButton(Composite composite) {
- Button browseWorkspaceButton = new Button(composite, SWT.PUSH);
- browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
- return browseWorkspaceButton;
- }
-
- protected Button createFileSystemBrowseButton(Composite composite) {
- Button browseFileSystemButton = new Button(composite, SWT.PUSH);
- browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
- return browseFileSystemButton;
- }
-
-
- String invokeWorkspaceFileSelectionDialog() {
- FilterableSelectSingleFileDialog dialog = new FilterableSelectSingleFileDialog(getShell());
- dialog.createAndOpen();
- IFile file = dialog.getFile();
- String uri = null;
- if (file != null) {
- // remove leading slash from the value to avoid the
- // whole leading slash ambiguity problem
- //
- uri = file.getFullPath().toString();
- while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
- uri = uri.substring(1);
- }
- }
- return uri;
- }
-
- String invokeFileSelectionDialog() {
- FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
- return dialog.open();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java
deleted file mode 100644
index 0ec61e6234..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.catalog;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-
-
-public abstract class ElementNodePage {
-
- Control fControl;
-
- public ElementNodePage() {
- super();
-
- }
-
- public abstract Control createControl(Composite parent);
-
- public Control getControl() {
- return fControl;
- }
-
- public abstract void saveData();
-
- public abstract ICatalogElement getData();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java
deleted file mode 100644
index 3938a7efb1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.catalog;
-
-import java.util.Hashtable;
-
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class ImageFactory {
- public static final int TOP_LEFT = 1;
- public static final int TOP_RIGHT = 2;
- public static final int BOTTOM_LEFT = 3;
- public static final int BOTTOM_RIGHT = 4;
-
- protected static final int[][] OVERLAY_COORDINATE = {{0, 0}, {0, 2}, {2, 0}, {2, 2}};
-
- protected static ImageFactory INSTANCE = new ImageFactory();
-
- protected Hashtable compositeImageTable = new Hashtable();
-
- public ImageFactory() {
- super();
- }
-
- public Image getImage(String iconName) {
- ImageRegistry imageRegistry = XMLUIPlugin.getDefault().getImageRegistry();
-
- if (imageRegistry.get(iconName) != null) {
- return imageRegistry.get(iconName);
- }
- else {
- imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
- return imageRegistry.get(iconName);
- }
- }
-
- public Image createCompositeImage(Image base, Image overlay, int overlayPosition) {
- String key = base + "*" + overlay + "*" + overlayPosition; //$NON-NLS-1$ //$NON-NLS-2$
- Image result = (Image) compositeImageTable.get(key);
- if (result == null) {
- ImageDescriptor overlays[][] = new ImageDescriptor[3][3];
- int[] coord = OVERLAY_COORDINATE[overlayPosition];
- overlays[coord[1]][coord[0]] = new ImageBasedImageDescriptor(overlay);
- OverlayIcon icon = new OverlayIcon(new ImageBasedImageDescriptor(base), overlays, new Point(16, 16));
- result = icon.createImage();
- compositeImageTable.put(key, result);
- }
- return result;
- }
-
-
- public static ImageDescriptor createImageDescriptorWrapper(Image image) {
- return new ImageBasedImageDescriptor(image);
- }
-
- /**
- * An OverlayIcon consists of a main icon and several adornments.
- */
- class OverlayIcon extends CompositeImageDescriptor {
-
- static final int DEFAULT_WIDTH = 22;
-
- static final int DEFAULT_HEIGHT = 16;
-
- private Point fSize = null;
-
- private ImageDescriptor fBase;
-
- private ImageDescriptor fOverlays[][];
-
- public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays, Point size) {
- fBase = base;
- fOverlays = overlays;
- fSize = size;
- }
-
- protected void drawBottomLeft(ImageDescriptor[] overlays) {
- if (overlays == null) {
- return;
- }
- int length = overlays.length;
- int x = 0;
- for (int i = 0; i < 3; i++) {
- if ((i < length) && (overlays[i] != null)) {
- ImageData id = overlays[i].getImageData();
- drawImage(id, x, getSize().y - id.height);
- x += id.width;
- }
- }
- }
-
- protected void drawBottomRight(ImageDescriptor[] overlays) {
- if (overlays == null) {
- return;
- }
- int length = overlays.length;
- int x = getSize().x;
- for (int i = 2; i >= 0; i--) {
- if ((i < length) && (overlays[i] != null)) {
- ImageData id = overlays[i].getImageData();
- x -= id.width;
- drawImage(id, x, getSize().y - id.height);
- }
- }
- }
-
- /**
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- ImageData bg;
- if ((fBase == null) || ((bg = fBase.getImageData()) == null)) {
- bg = DEFAULT_IMAGE_DATA;
- }
- drawImage(bg, 0, 0);
-
- if (fOverlays != null) {
- if (fOverlays.length > 0) {
- drawTopRight(fOverlays[0]);
- }
-
- if (fOverlays.length > 1) {
- drawBottomRight(fOverlays[1]);
- }
-
- if (fOverlays.length > 2) {
- drawBottomLeft(fOverlays[2]);
- }
-
- if (fOverlays.length > 3) {
- drawTopLeft(fOverlays[3]);
- }
- }
- }
-
- protected void drawTopLeft(ImageDescriptor[] overlays) {
- if (overlays == null) {
- return;
- }
- int length = overlays.length;
- int x = 0;
- for (int i = 0; i < 3; i++) {
- if ((i < length) && (overlays[i] != null)) {
- ImageData id = overlays[i].getImageData();
- drawImage(id, x, 0);
- x += id.width;
- }
- }
- }
-
- protected void drawTopRight(ImageDescriptor[] overlays) {
- if (overlays == null) {
- return;
- }
- int length = overlays.length;
- int x = getSize().x;
- for (int i = 2; i >= 0; i--) {
- if ((i < length) && (overlays[i] != null)) {
- ImageData id = overlays[i].getImageData();
- x -= id.width;
- drawImage(id, x, 0);
- }
- }
- }
-
- /**
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- return fSize;
- }
- }
-
- static class ImageBasedImageDescriptor extends ImageDescriptor {
- protected Image image;
-
- public ImageBasedImageDescriptor(Image image) {
- this.image = image;
- }
-
- public ImageData getImageData() {
- return image.getImageData();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/URIUtils.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/URIUtils.java
deleted file mode 100644
index ea0c2bc802..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/URIUtils.java
+++ /dev/null
@@ -1,54 +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.wst.xml.ui.internal.catalog;
-
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-public class URIUtils {
-
- private static final String PROTOCOL_PATTERN = ":";
- private static final String FILE_PROTOCOL = "file:";
- private static final String PLATFORM_RESOURCE_PROTOCOL = "platform:/resource/";
- private static final String LOCAL_FILE_PROTOCOL_FORWARD_SLASH = "\\\\\\";
- private static final String LOCAL_FILE_PROTOCOL_BACK_SLASH = "///";
- private static final char PATH_SEPARATOR_FORWARD_SLASH = '/';
- private static final char PATH_SEPARATOR_BACK_SLASH = '\\';
-
- public static String convertURIToLocation(String uri) {
- String location = uri;
- if (uri != null) {
- if (uri.startsWith(FILE_PROTOCOL)) {
- location = org.eclipse.wst.common.uriresolver.internal.URI.createURI(uri).toFileString();
- if (location != null && (location.startsWith(LOCAL_FILE_PROTOCOL_BACK_SLASH)
- || location.startsWith(LOCAL_FILE_PROTOCOL_FORWARD_SLASH))) {
- location = location.substring(LOCAL_FILE_PROTOCOL_BACK_SLASH.length());
- }
- } else if (uri.startsWith(PLATFORM_RESOURCE_PROTOCOL)) {
- location = uri.substring(PLATFORM_RESOURCE_PROTOCOL.length());
- }
- }
- return location;
- }
-
- public static String convertLocationToURI(String location) {
- String uri = location;
- if (!URIHelper.hasProtocol(location)) {
- uri = URIHelper.isAbsolute(location)? org.eclipse.wst.common.uriresolver.internal.URI.createFileURI(location).toString()
- : URIHelper.prependPlatformResourceProtocol(location);
- }
- if (uri.startsWith(FILE_PROTOCOL) && uri.indexOf(PROTOCOL_PATTERN, FILE_PROTOCOL.length()) != -1) {
- uri = URIHelper.ensureFileURIProtocolFormat(uri);
- }
- uri = uri.replace(PATH_SEPARATOR_BACK_SLASH, PATH_SEPARATOR_FORWARD_SLASH);
- return uri;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
deleted file mode 100644
index 8b32068d76..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.catalog;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-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.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.Catalog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-
-public class XMLCatalogEntriesView extends Composite {
- protected Button newButton;
- protected Button editButton;
- protected Button deleteButton;
- protected Button clearCacheButton;
- protected XMLCatalogTreeViewer tableViewer;
- protected ICatalog workingUserCatalog;
- protected ICatalog systemCatalog;
-
- // protected boolean isPageEnabled = true;
-
- public XMLCatalogEntriesView(Composite parent, ICatalog workingUserCatalog, ICatalog systemCatalog) {
- super(parent, SWT.NONE);
- this.workingUserCatalog = workingUserCatalog;
- this.systemCatalog = systemCatalog;
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- this.setLayout(gridLayout);
-
- tableViewer = createTableViewer(this);
- tableViewer.setInput("dummy"); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=202692
- // specifically set size of tree before expanding it
- Point initialSize = tableViewer.getTree().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.widthHint = initialSize.x;
- gridData.heightHint = initialSize.y;
- tableViewer.getControl().setLayoutData(gridData);
-
- tableViewer.expandToLevel(2);
- tableViewer.reveal(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT);
-
- ISelectionChangedListener listener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateWidgetEnabledState();
- }
- };
- tableViewer.addSelectionChangedListener(listener);
-
- createButtons(this);
- }
-
- public static String removeLeadingSlash(String uri) {
- // remove leading slash from the value to avoid the whole leading
- // slash ambiguity problem
- //
- if (uri != null) {
- while (uri.startsWith("/") || uri.startsWith("\\")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- uri = uri.substring(1);
- }
- }
- return uri;
- }
-
- protected XMLCatalogTreeViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = XMLCatalogMessages.UI_LABEL_KEY;
- headings[1] = XMLCatalogMessages.UI_LABEL_URI;
-
- XMLCatalogTreeViewer theTableViewer = new XMLCatalogTreeViewer(parent, workingUserCatalog, systemCatalog);
- return theTableViewer;
- }
-
- protected void createButtons(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData();
- gd.verticalAlignment = GridData.BEGINNING;
- composite.setLayoutData(gd);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- gridLayout.marginLeft = 3;
- composite.setLayout(gridLayout);
-
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == newButton) {
- performNew();
- }
- else if (e.widget == editButton) {
- performEdit();
- }
- else if (e.widget == deleteButton) {
- performDelete();
- }
- else if (e.widget == clearCacheButton) {
- performRefresh();
- }
- }
- };
-
- // add the "New..." button
- //
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
-
- newButton = new Button(composite, SWT.NONE);
- newButton.setText(XMLCatalogMessages.UI_BUTTON_NEW);
- // WorkbenchHelp.setHelp(newButton,
- // XMLBuilderContextIds.XMLP_MAPPING_NEW);
- newButton.setLayoutData(gd);
- newButton.addSelectionListener(selectionListener);
-
- // add the "Edit..." button
- //
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- editButton = new Button(composite, SWT.NONE);
- editButton.setText(XMLCatalogMessages.UI_BUTTON_EDIT);
- // WorkbenchHelp.setHelp(editButton,
- // XMLBuilderContextIds.XMLP_MAPPING_EDIT);
- editButton.setLayoutData(gd);
- editButton.addSelectionListener(selectionListener);
-
- // add the "Delete" button
- //
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- deleteButton = new Button(composite, SWT.NONE);
- deleteButton.setText(XMLCatalogMessages.UI_BUTTON_REMOVE);
- // WorkbenchHelp.setHelp(deleteButton,
- // XMLBuilderContextIds.XMLP_MAPPING_DELETE);
- deleteButton.setLayoutData(gd);
- deleteButton.addSelectionListener(selectionListener);
-
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.verticalIndent = 9;
- clearCacheButton = new Button(composite, SWT.NONE);
- clearCacheButton.setText(XMLCatalogMessages.UI_BUTTON_RELOAD_CATALOG);
- clearCacheButton.setLayoutData(gd);
- clearCacheButton.addSelectionListener(selectionListener);
-
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan = 4;
-
- Button hiddenButton = new Button(composite, SWT.NONE);
- hiddenButton.setLayoutData(gd);
- hiddenButton.setVisible(false);
- hiddenButton.setEnabled(false);
-
- // a cruddy hack so that the PreferenceDialog doesn't close every time
- // we press 'enter'
- //
- getShell().setDefaultButton(hiddenButton);
- updateWidgetEnabledState();
- }
-
- public void refresh() {
- tableViewer.refresh();// XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT);
- }
-
- protected EditCatalogEntryDialog invokeDialog(String title, ICatalogElement entry, ICatalog catalog) {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- EditCatalogEntryDialog dialog = entry != null ? new EditCatalogEntryDialog(shell, entry, catalog) : new EditCatalogEntryDialog(shell, catalog);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.open();
- return dialog;
- }
-
- protected EditCatalogEntryDialog invokeDialog(String title, ICatalog catalog) {
- return invokeDialog(title, null, catalog);
- }
-
-
- protected void performNew() {
-
- // ICatalogEntry newEntry =
- // (ICatalogEntry)workingUserCatalog.createCatalogElement(ICatalogElement.TYPE_ENTRY);
- EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_NEW_DIALOG_TITLE, workingUserCatalog);
- ICatalogElement element = dialog.getCatalogElement();
- if (dialog.getReturnCode() == Window.OK) {
- workingUserCatalog.addCatalogElement(element);
- tableViewer.setSelection(new StructuredSelection(element), true);
- tableViewer.refresh();
- }
- }
-
- protected void performEdit() {
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-
- if (selectedObject instanceof ICatalogElement) {
- ICatalogElement oldEntry = (ICatalogElement) selectedObject;
- ICatalogElement newEntry = (ICatalogElement) ((CatalogElement) oldEntry).clone();
-
- EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_EDIT_DIALOG_TITLE, newEntry, workingUserCatalog);
- if (dialog.getReturnCode() == Window.OK) {
- // delete the old value if the 'mapFrom' has changed
- //
- workingUserCatalog.removeCatalogElement(oldEntry);
-
- // update the new mapping
- //
- workingUserCatalog.addCatalogElement(newEntry);
- tableViewer.setSelection(new StructuredSelection(newEntry));
- }
- }
- }
-
- protected void performRefresh() {
- XMLCorePlugin.getDefault().clearCatalogCache();
- }
-
- protected void performDelete() {
- ISelection selection = tableViewer.getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- Iterator iterator = structuredSelection.iterator();
- while(iterator.hasNext()) {
- Object selectedObject = iterator.next();
- if (selectedObject instanceof ICatalogElement) {
- ICatalogElement catalogElement = (ICatalogElement) selectedObject;
- workingUserCatalog.removeCatalogElement(catalogElement);
- }
- }
- }
- }
-
- protected void updateWidgetEnabledState() {
- boolean isEditable = false;
- ISelection selection = tableViewer.getSelection();
- boolean multipleSelection = false;
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if(structuredSelection.size() > 1) {
- multipleSelection = true;
- }
- Object selectedObject = structuredSelection.getFirstElement();
- if (selectedObject instanceof ICatalogElement) {
- ICatalogElement[] elements = ((Catalog) workingUserCatalog).getCatalogElements();
- // dw List entriesList = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- ICatalogElement element = elements[i];
- isEditable = selectedObject.equals(element);
- if (isEditable) {
- break;
- }
- }
- }
- }
-
- // if (isPageEnabled)
- {
- editButton.setEnabled(isEditable & !multipleSelection);
- deleteButton.setEnabled(isEditable);
- }
- }
-
- /*
- * public void setPageEnabled(boolean enabled) { isPageEnabled = enabled;
- *
- * tableViewer.getControl().setEnabled(isPageEnabled);
- *
- * newButton.setEnabled(isPageEnabled);
- * editButton.setEnabled(isPageEnabled);
- * deleteButton.setEnabled(isPageEnabled); }
- */
- public void updatePage() {
- refresh();
- updateWidgetEnabledState();
- }
-
- public Viewer getViewer() {
- return tableViewer;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
deleted file mode 100644
index 054695065d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-
-
-
-public class XMLCatalogEntryDetailsView {
- protected Text detailsText;
- protected ScrollBar verticalScroll, horizontalScroll;
-
- public XMLCatalogEntryDetailsView(Composite parent) {
- Color color = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-
- detailsText = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 85;
- detailsText.setLayoutData(data);
-
- verticalScroll = detailsText.getVerticalBar();
- // verticalScroll.setVisible(false);
- horizontalScroll = detailsText.getHorizontalBar();
- detailsText.setEditable(false);
- detailsText.setBackground(color);
- }
-
- protected void setCatalogEntry(ICatalogEntry entry) {
- if (entry == null) {
- detailsText.setText(""); //$NON-NLS-1$
- return;
- }
- String value = getDisplayValue(entry != null ? entry.getURI() : ""); //$NON-NLS-1$
- String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t"; //$NON-NLS-1$
- String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
- String line1;
- if (value.startsWith("jar:file:")) { //$NON-NLS-1$
- String jarFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat(value.substring("jar:".length(), value.indexOf('!')))); //$NON-NLS-1$
- String internalFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat("file://" + value.substring(value.indexOf('!') + 1))); //$NON-NLS-1$
- line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + internalFile + " " + XMLCatalogMessages.UI_LABEL_DETAILS_IN_JAR_FILE + " " + jarFile; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- else {
- value = URIUtils.convertURIToLocation(value);
- line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + value; //$NON-NLS-1$
-
- }
- switch(entry.getEntryType()) {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC: line0 += XMLCatalogMessages.UI_LABEL_PUBLIC; break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM: line0 += XMLCatalogMessages.UI_LABEL_SYSTEM; break;
- case ICatalogEntry.ENTRY_TYPE_URI: line0 += XMLCatalogMessages.UI_LABEL_URI; break;
- }
- value = entry != null ? getKeyTypeValue(entry) : ""; //$NON-NLS-1$
- String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t" + value; //$NON-NLS-1$
- value = getDisplayValue(entry != null ? entry.getKey() : ""); //$NON-NLS-1$
- String line4 = XMLCatalogMessages.UI_LABEL_DETAILS_KEY_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
- String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3 + "\n" + line4; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- detailsText.setText(entireString);
- }
-
- protected void setNextCatalog(INextCatalog nextCatalog) {
- String value = getDisplayValue(nextCatalog != null ? nextCatalog.getCatalogLocation() : ""); //$NON-NLS-1$
- String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_NEXT_CATALOG; //$NON-NLS-1$
- String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
- String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
- String entireString = line0 + "\n" + line1 + "\n" + line2; //$NON-NLS-1$ //$NON-NLS-2$
- detailsText.setText(entireString);
- }
-
- protected void setSuffixEntry(ISuffixEntry element) {
- String value = getDisplayValue(element != null ? element.getURI() : ""); //$NON-NLS-1$
- String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_SUFFIX_ENTRY; //$NON-NLS-1$
- String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_SUFFIX_COLON + "\t\t\t\t" + element.getSuffix(); //$NON-NLS-1$
- String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
- String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t"; //$NON-NLS-1$
- String uri = element.getURI();
- boolean isSchema = false;
- if(uri != null && uri.endsWith("xsd")) { //$NON-NLS-1$
- isSchema = true;
- }
- switch (element.getEntryType()) {
- case ISuffixEntry.SUFFIX_TYPE_SYSTEM:
- line3 += isSchema? XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM : XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
- break;
- default:
- case ISuffixEntry.SUFFIX_TYPE_URI:
- line3 += isSchema? XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC : XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
- break;
- }
- String entireString = line0 + "\n" + line1 +"\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- detailsText.setText(entireString);
- }
-
- protected void setRewriteEntry(IRewriteEntry element) {
- String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_REWRITE_ENTRY; //$NON-NLS-1$
- String line1 = XMLCatalogMessages.UI_LABEL_START_STRING + "\t\t" + element.getStartString(); //$NON-NLS-1$
- String line2 = XMLCatalogMessages.UI_LABEL_REWRITE_PREFIX + "\t" + element.getRewritePrefix(); //$NON-NLS-1$
- String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t" ; //$NON-NLS-1$
- switch (element.getEntryType()) {
- case IRewriteEntry.REWRITE_TYPE_SYSTEM:
- line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
- break;
- default:
- case IRewriteEntry.REWRITE_TYPE_URI:
- line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
- break;
- }
- String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- detailsText.setText(entireString);
- }
-
- protected void setDelegateCatalog(IDelegateCatalog element) {
- String value = getDisplayValue(element != null ? element.getCatalogLocation() : ""); //$NON-NLS-1$
- String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_DELEGATE_CATALOG; //$NON-NLS-1$
- String line1 = XMLCatalogMessages.UI_LABEL_START_STRING + "\t\t" + element.getStartString(); //$NON-NLS-1$
- String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
- String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t"; //$NON-NLS-1$
- switch (element.getEntryType()) {
- case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
- line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
- break;
- case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
- line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
- break;
- default:
- case IDelegateCatalog.DELEGATE_TYPE_URI:
- line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
- break;
- }
- String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- detailsText.setText(entireString);
- }
-
- public void setCatalogElement(ICatalogElement element) {
- // I wish we had a visitor for this kind of mess
- if (element instanceof ICatalogEntry) setCatalogEntry((ICatalogEntry)element);
- else if (element instanceof INextCatalog) setNextCatalog((INextCatalog)element);
- else if (element instanceof IDelegateCatalog) setDelegateCatalog((IDelegateCatalog)element);
- else if (element instanceof IRewriteEntry) setRewriteEntry((IRewriteEntry)element);
- else if (element instanceof ISuffixEntry) setSuffixEntry((ISuffixEntry)element);
- else setCatalogEntry(null); // Gives null text
- }
-
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- protected String getKeyTypeValue(ICatalogEntry entry) {
- String result = null;
- if ((entry.getURI() != null) && entry.getURI().endsWith("xsd")) //$NON-NLS-1$
- {
- result = (entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_URI) ? XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC : XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM;
- }
- else {
- switch (entry.getEntryType()) {
- case ICatalogEntry.ENTRY_TYPE_PUBLIC :
- result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
- break;
- case ICatalogEntry.ENTRY_TYPE_SYSTEM :
- result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
- break;
- default :
- result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
- break;
- }
-
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
deleted file mode 100644
index c3cbbe80ae..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.catalog;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.swt.graphics.Image;
-
-
-public class XMLCatalogFileType {
- public String description;
- public String id;
- public List extensions = new ArrayList();
- public String iconFileName;
- public Image icon;
-
- public void addExtensions(String contributedExtensions) {
- List list = parseExtensions(contributedExtensions);
- for (Iterator i = list.iterator(); i.hasNext();) {
- String extension = (String) i.next();
- if (!extensions.contains(extension)) {
- extensions.add(extension);
- }
- }
- }
-
- protected List parseExtensions(String string) {
- List list = new ArrayList();
- for (StringTokenizer st = new StringTokenizer(string, ", "); st.hasMoreTokens();) //$NON-NLS-1$
- {
- String token = st.nextToken();
- if (token != null) {
- list.add(token);
- }
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
deleted file mode 100644
index 4f33585339..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of 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.xml.ui.internal.catalog;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Editor
- *
- * @plannedfor 1.0
- */
-public class XMLCatalogMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogResources";//$NON-NLS-1$
-
- public static String UI_WIZARD_SCHEMA_AND_NAME_SPACE_INFO;
- public static String UI_LABEL_NAME_SPACE_PREFIX;
- public static String UI_LABEL_NAME_SPACE_URI;
- public static String UI_LABEL_XSD_LOCATION;
- public static String UI_LABEL_DOCTYPE_INFORMATION;
- public static String UI_LABEL_SYSTEM_ID;
- public static String UI_LABEL_PUBLIC_ID;
- public static String UI_LABEL_SELECT_FILE;
- public static String UI_LABEL_KEY;
- public static String UI_LABEL_KEY_COLON;
- public static String UI_LABEL_SUFFIX;
- public static String UI_LABEL_SUFFIX_COLON;
- public static String UI_LABEL_DETAILS_KEY_COLON;
- public static String UI_LABEL_DETAILS_IN_JAR_FILE;
- public static String UI_LABEL_URI;
- public static String UI_LABEL_LOCATION_COLON;
- public static String UI_MATCH_KEY_TYPE_COLON;
- public static String UI_LABEL_ARROW;
- public static String UI_LABEL_CATALOG_URI_COLON;
- public static String UI_LABEL_DETAILS_URI_COLON;
- public static String UI_LABEL_DETAILS_URI_LOCATION;
- public static String UI_KEY_TYPE_COLON;
- public static String UI_ELEMENT_TYPE_COLON;
- public static String UI_LABEL_START_STRING_COLON;
- public static String UI_LABEL_REWRITE_PREFIX_COLON;
- public static String UI_KEY_TYPE_DETAILS_COLON;
- public static String UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC;
- public static String UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM;
- public static String UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
- public static String UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
- public static String UI_KEY_TYPE_DESCRIPTION_URI;
- public static String UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL;
- public static String UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
- public static String UI_LABEL_FILE_SELECTION;
- public static String UI_LABEL_CHOOSE_FILE_TO_ADD_TO_CATALOG;
-
-
- public static String UI_WARNING_URI_NOT_FOUND_COLON;
- public static String UI_WARNING_URI_NOT_FOUND_LONG;
- public static String UI_WARNING_INVALID_FILE;
- public static String UI_WARNING_INVALID_FILE_LONG;
- public static String UI_WARNING_NO_ELEMENT;
- public static String UI_WARNING_NO_ELEMENT_DTD_LONG;
- public static String UI_WARNING_NO_ELEMENT_XSD_LONG;
- public static String UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI;
- public static String UI_WARNING_DUPLICATE_ENTRY;
- public static String UI_WARNING_DUPLICATE_SUFFIX;
- public static String UI_WARNING_DUPLICATE_REWRITE;
- public static String UI_WARNING_DUPLICATE_DELEGATE;
-
- // NewModelWizard
- public static String UI_INVALID_GRAMMAR_ERROR;
- public static String UI_BUTTON_BROWSE;
-
- // XMLCatalogIdMappingPage
- public static String UI_LABEL_MAP_TO;
- public static String UI_LABEL_MAP_FROM;
- public static String UI_BUTTON_NEW;
- public static String UI_BUTTON_EDIT;
- public static String UI_BUTTON_DELETE;
- public static String UI_BUTTON_REMOVE;
- public static String UI_BUTTON_RELOAD_CATALOG;
- public static String UI_LABEL_NEW_DIALOG_TITLE;
- public static String UI_LABEL_EDIT_DIALOG_TITLE;
-
-
- // XMLCatalogPreferencePage
- public static String UI_LABEL_USER_ENTRIES;
- public static String UI_LABEL_USER_ENTRIES_TOOL_TIP;
- public static String UI_LABEL_SYSTEM_ENTRIES;
- public static String UI_LABEL_SYSTEM_ENTRIES_TOOL_TIP;
- public static String UI_BUTTON_CHANGE;
- public static String UI_LABEL_SELECT_PROJECT;
- public static String UI_LABEL_SPECIFY_PROJECT_DESCRIPTION;
- public static String UI_WARNING_NO_PROJECTS_CREATED;
- public static String UI_WARNING_PROJECT_NOT_SPECIFIED;
- public static String UI_WARNING_PROJECT_DOES_NOT_EXIST;
- public static String UI_LABEL_PROJECT_TO_USE;
- public static String UI_LABEL_CATALOG_SAVE_ERROR;
- public static String UI_LABEL_CATALOG_COULD_NOT_BE_SAVED;
- public static String UI_LABEL_ADVANCED;
- public static String UI_LABEL_ADVANCED_XML_CATALOG_PREFS;
- public static String UI_LABEL_SPECIFY_PERSISTENCE_FILE;
- public static String UI_LABEL_SAVE_CATALOG_DIALOG_TITLE;
- public static String UI_LABEL_SAVE_CATALOG_DIALOG_DESC;
- public static String UI_LABEL_BROWSE_CATALOG_FILE_TITLE;
- public static String UI_LABEL_BROWSE_CATALOG_FILE_DESC;
- public static String UI_LABEL_DETAILS;
- public static String UI_LABEL_USER_SPECIFIED_ENTRIES;
- public static String UI_LABEL_PLUGIN_SPECIFIED_ENTRIES;
- public static String UI_LABEL_PLATFORM_RESOURCE;
- public static String UI_LABEL_FILE_SYSTEM_RESOURCE;
- // AdvancedOptionsDialog
- public static String UI_BUTTON_IMPORT;
- public static String UI_BUTTON_EXPORT;
-
- public static String UI_LABEL_IMPORT_DIALOG_TITLE;
- public static String UI_LABEL_IMPORT_DIALOG_HEADING;
- public static String UI_LABEL_IMPORT_DIALOG_MESSAGE;
-
- public static String UI_LABEL_EXPORT_DIALOG_TITLE;
- public static String UI_LABEL_EXPORT_DIALOG_HEADING;
- public static String UI_LABEL_EXPORT_DIALOG_MESSAGE;
- public static String ERROR_SAVING_FILE;
- public static String UI_LABEL_FILE_IS_READ_ONLY;
- public static String UI_LABEL_DIALOG_DESCRIPTION;
-
- public static String UI_LABEL_NEXT_CATALOG;
- public static String UI_LABEL_DELEGATE_CATALOG;
- public static String UI_LABEL_REWRITE_ENTRY;
- public static String UI_LABEL_SUFFIX_ENTRY;
-
- public static String UI_LABEL_DELEGATE_CATALOG_URI_COLON;
- public static String EditCatalogEntryDialog_catalogEntryLabel;
- public static String EditCatalogEntryDialog_nextCatalogLabel;
- public static String EditCatalogEntryDialog_rewriteEntryLabel;
- public static String EditCatalogEntryDialog_suffixEntryLabel;
- public static String EditCatalogEntryDialog_delegateCatalogLabel;
- public static String UI_BUTTON_MENU_BROWSE_WORKSPACE;
- public static String UI_BUTTON_MENU_BROWSE_FILE_SYSTEM;
- public static String UI_LABEL_SELECT_FILE_FILTER_CONTROL;
- public static String UI_TEXT_SELECT_FILE_FILTER_CONTROL;
-
- public static String UI_LABEL_PUBLIC;
- public static String UI_LABEL_SYSTEM;
-
- public static String UI_LABEL_START_STRING;
- public static String UI_LABEL_REWRITE_PREFIX;
- public static String UI_LABEL_ENTRY_ELEMENT_COLON;
-
- public static String UI_LABEL_DETAILS_SUFFIX_COLON;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLCatalogMessages.class);
- }
-
- private XMLCatalogMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
deleted file mode 100644
index e84a82adc5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * David Carver/STAR Standard - d_a_carver@yahoo.com - bug 192568
- * Removed Advanced button - Functionality is now in the
- * Import/Export XML Catalog Wizards.
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-public class XMLCatalogPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, ICatalogListener {
-
- protected XMLCatalogEntriesView catalogEntriesView;
-
- protected ICatalog workingUserCatalog;
-
- protected ICatalog systemCatalog;
-
- protected ICatalog userCatalog;
-
- protected ICatalog defaultCatalog;
-
- protected Button advancedButton;
-
- public XMLCatalogPreferencePage() {
- defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- systemCatalog = referencedCatalog;
- }
- else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- userCatalog = referencedCatalog;
- }
- }
- }
- }
-
- public void dispose() {
- super.dispose();
- workingUserCatalog.removeListener(this);
- }
-
- /**
- * Refresh the view in responce to an event sent by the Catalog
- */
- public void catalogChanged(ICatalogEvent event) {
- catalogEntriesView.updatePage();
- }
-
- /**
- * Creates preference page controls on demand.
- *
- * @param parent
- * the parent for the preference page
- */
- protected Control createContents(Composite parent) {
- // we create a working copy of the 'User Settings' for the Catalog
- // that we can modify
- CatalogSet tempCatalogSet = new CatalogSet();
- workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
-
- // TODO: add entries from the nested catalogs as well
- workingUserCatalog.addEntriesFromCatalog(userCatalog);
- workingUserCatalog.addListener(this);
- noDefaultAndApplyButton();
- Composite composite = new Composite(parent, SWT.NULL);
- // WorkbenchHelp.setHelp(composite, new
- // ControlContextComputer(composite,
- // XMLBuilderContextIds.XMLP_CATALOG_PAGE));
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- createCatalogEntriesView(composite);
- createCatalogDetailsView(composite);
- //createAdvancedButton(composite);
- // catalogEntriesView.updatePage();
- applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * @deprecated
- * @param composite
- */
- protected void createAdvancedButton(Composite composite) {
- Composite panel = new Composite(composite, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- panel.setLayout(gridLayout);
- panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO... is there a better way to expand the page width?
- // This invisible label is created to force the width of the page to
- // be
- // wide enough to show
- // the rather long uri and key fields of a catalog entry.
- Label widthFudger = new Label(panel, SWT.NONE);
- String widthFudgerString = ""; //$NON-NLS-1$
- for (int i = 0; i < 55; i++) {
- widthFudgerString += "x"; //$NON-NLS-1$
- }
- widthFudger.setText(widthFudgerString);
- widthFudger.setVisible(false);
- Composite placeHolder = new Composite(panel, SWT.NONE);
- placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- advancedButton = new Button(panel, SWT.NONE);
- advancedButton.setText(XMLCatalogMessages.UI_LABEL_ADVANCED);
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- AdvancedOptionsDialog dialog = new AdvancedOptionsDialog(getShell(), workingUserCatalog);
- dialog.create();
- dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_ADVANCED_XML_CATALOG_PREFS);
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
- };
- advancedButton.addSelectionListener(selectionListener);
- }
-
- public boolean isSameFileName(String a, String b) {
- boolean result = false;
- if ((a == null) && (b == null)) {
- result = true;
- }
- else if ((a != null) && (b != null)) {
- result = a.equals(b);
- }
- return result;
- }
-
- protected void createCatalogEntriesView(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
- group.setText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES);
- group.setToolTipText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES_TOOL_TIP);
- // WorkbenchHelp.setHelp(userEntriesGroup, new
- // ControlContextComputer(userEntriesGroup,
- // XMLBuilderContextIds.XMLP_CATALOG_USER_GROUP));
- catalogEntriesView = new XMLCatalogEntriesView(group, workingUserCatalog, systemCatalog);
- catalogEntriesView.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- protected void createCatalogDetailsView(Composite parent) {
- Group detailsGroup = new Group(parent, SWT.NONE);
- detailsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- detailsGroup.setLayout(new GridLayout());
- detailsGroup.setText(XMLCatalogMessages.UI_LABEL_DETAILS);
- final XMLCatalogEntryDetailsView detailsView = new XMLCatalogEntryDetailsView(detailsGroup);
- ISelectionChangedListener listener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) && ((IStructuredSelection) selection).size() == 1 ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogElement) {
- detailsView.setCatalogElement((ICatalogElement)selectedObject);
- } else {
- detailsView.setCatalogElement(null);
- }
- }
- };
- catalogEntriesView.getViewer().addSelectionChangedListener(listener);
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- *
- * @return whether it is okay to close the preference page
- */
- public boolean performOk() {
- return storeValues();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) {
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private boolean storeValues() {
- // dw Object fileObject = null;
- try {
- // update the userCatalog so that its the same as the working
- // catalog
- userCatalog.clear();
- // TODO add entries from the nested catalogs?
- userCatalog.addEntriesFromCatalog(workingUserCatalog);
- // now save the userCatalog
- userCatalog.save();
- }
- catch (Exception e) {
- }
- return true;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
deleted file mode 100644
index 6edbb7809d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
+++ /dev/null
@@ -1,142 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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 Carver/STAR Standard, d_a_carver@yahoo.com, bug 192568
-# - Fixed grammar in XML Catalog Import dialog.
-###############################################################################
-UI_WIZARD_SCHEMA_AND_NAME_SPACE_INFO = Schema and Namespace Information
-UI_LABEL_NAME_SPACE_PREFIX = Namespace prefix:
-UI_LABEL_NAME_SPACE_URI = Namespace URI:
-UI_LABEL_XSD_LOCATION = Schema location:
-UI_LABEL_DOCTYPE_INFORMATION = Document type information
-UI_LABEL_SYSTEM_ID = &System ID:
-UI_LABEL_PUBLIC_ID = &Public ID:
-UI_LABEL_SELECT_FILE = Select File
-UI_LABEL_KEY = Key
-UI_LABEL_KEY_COLON = &Key:
-UI_LABEL_SUFFIX = Suffix
-UI_LABEL_SUFFIX_COLON = S&uffix:
-UI_LABEL_DETAILS_KEY_COLON = Key:
-UI_LABEL_DETAILS_IN_JAR_FILE = in jar file
-UI_LABEL_URI = URI
-UI_LABEL_START_STRING_COLON = &Matching start string:
-UI_LABEL_REWRITE_PREFIX_COLON = Rewrite prefi&x:
-UI_LABEL_ARROW = ->
-UI_LABEL_LOCATION_COLON = &Location:
-UI_LABEL_DELEGATE_CATALOG_URI_COLON = D&elegate to this XML Catalog file:
-UI_LABEL_CATALOG_URI_COLON = &Location of another XML Catalog file:
-UI_LABEL_DETAILS_URI_COLON = URI:
-UI_KEY_TYPE_COLON = Key &type:
-UI_KEY_TYPE_DETAILS_COLON = Key type:
-UI_MATCH_KEY_TYPE_COLON = &Key type to match:
-UI_LABEL_DETAILS_URI_LOCATION = Location:
-UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC = Namespace name
-UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM = Schema location
-UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC = Public ID
-UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM = System ID
-UI_KEY_TYPE_DESCRIPTION_URI = URI
-UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL = &Alternative web address:
-UI_WARNING_URI_MUST_NOT_HAVE_DOTS = URI must not include '.' or '..'
-UI_LABEL_PLATFORM_RESOURCE = Workspace
-UI_LABEL_FILE_SYSTEM_RESOURCE = File system
-UI_ELEMENT_TYPE_COLON = Catalog element type:
-UI_LABEL_NEXT_CATALOG = Next catalog
-UI_LABEL_DELEGATE_CATALOG = Delegate catalog
-UI_LABEL_REWRITE_ENTRY = Rewrite
-UI_LABEL_SUFFIX_ENTRY = Suffix
-UI_LABEL_ENTRY_ELEMENT_COLON = Entry element:
-UI_LABEL_PUBLIC = Public
-UI_LABEL_SYSTEM = System
-
-UI_WARNING_URI_NOT_FOUND_COLON = The specified resource can't be located :
-UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI = Warning: the key value should be a fully qualified URI
-UI_WARNING_URI_NOT_FOUND_LONG = The specified file cannot be found. It may have been moved to a different location. If the file is located remotely, a network connection cannot be established to the remote location.
-UI_WARNING_INVALID_FILE = The specified file is invalid.
-UI_WARNING_INVALID_FILE_LONG = The specified file is invalid. A proper XML file cannot be generated from it. Open the DTD or XML schema file, edit it as necessary, validate it and try again.
-UI_WARNING_NO_ELEMENT = The specified file must contain at least one element declaration.
-UI_WARNING_NO_ELEMENT_DTD_LONG = The specified file must contain at least one element declaration that can be used as the root element in the generated XML file.
-UI_WARNING_NO_ELEMENT_XSD_LONG = The specified file must contain at least one global element declaration that can be used as the root element in the generated XML file.
-UI_WARNING_DUPLICATE_ENTRY = The specified entry is invalid. An existing entry has the same key and key type.
-UI_WARNING_DUPLICATE_SUFFIX = The specified suffix is invalid. An existing entry has the same key type and suffix.
-UI_WARNING_DUPLICATE_REWRITE = The specified rewrite start string is invalid. An existing entry has the same start string.
-UI_WARNING_DUPLICATE_DELEGATE = The specified delegate start string is invalid. An existing entry has the same prefix.
-
-
-!NewModelWizard
-UI_INVALID_GRAMMAR_ERROR = Invalid Grammar
-UI_BUTTON_BROWSE = &Browse...
-
-!XMLCatalogIdMappingPage
-UI_LABEL_MAP_TO = Map to:
-UI_LABEL_MAP_FROM = Map from:
-UI_BUTTON_NEW = &Add...
-UI_BUTTON_EDIT = &Edit...
-UI_BUTTON_DELETE = &Delete
-UI_BUTTON_REMOVE = &Remove
-UI_BUTTON_RELOAD_CATALOG = Re&load Entries
-UI_LABEL_NEW_DIALOG_TITLE = Add XML Catalog Element
-UI_LABEL_EDIT_DIALOG_TITLE = Edit XML Catalog Element
-
-
-!XMLCatalogPreferencePage
-UI_LABEL_USER_ENTRIES = XML Catalog Entries
-UI_LABEL_USER_ENTRIES_TOOL_TIP = XML Catalog entries that have been specified by the user
-UI_LABEL_SYSTEM_ENTRIES = Plug-in specified entries
-UI_LABEL_SYSTEM_ENTRIES_TOOL_TIP = XML Catalog entries that have been specified by a plug-in
-UI_BUTTON_CHANGE = Change...
-UI_LABEL_SELECT_PROJECT = Select Project
-UI_LABEL_SPECIFY_PROJECT_DESCRIPTION = Specify the project to persist the XML Catalog information
-UI_WARNING_NO_PROJECTS_CREATED = No projects have been created yet.
-UI_WARNING_PROJECT_NOT_SPECIFIED = A project name has not been specified.
-UI_WARNING_PROJECT_DOES_NOT_EXIST = The specified project does not exist.
-UI_LABEL_PROJECT_TO_USE = Project to use to persist XML Catalog User Entries:
-UI_LABEL_CATALOG_SAVE_ERROR = XML Catalog Save Error
-UI_LABEL_CATALOG_COULD_NOT_BE_SAVED = The XML Catalog entry could not be saved.
-UI_LABEL_ADVANCED = &Advanced...
-UI_LABEL_ADVANCED_XML_CATALOG_PREFS = Advanced XML Catalog Preferences
-UI_LABEL_SPECIFY_PERSISTENCE_FILE = &Specify a file to use to persist the XML Catalog information.
-UI_LABEL_SAVE_CATALOG_DIALOG_TITLE = Save Changes
-UI_LABEL_SAVE_CATALOG_DIALOG_DESC = You have made unsaved changes to the current XML Catalog settings. Do you wish to save your changes before loading the new XML Catalog settings?
-UI_LABEL_BROWSE_CATALOG_FILE_TITLE = Select Folder
-UI_LABEL_BROWSE_CATALOG_FILE_DESC = Select the folder that contains the '.xmlcatalog' file.
-UI_LABEL_DETAILS = Details
-UI_LABEL_USER_SPECIFIED_ENTRIES = User Specified Entries
-UI_LABEL_PLUGIN_SPECIFIED_ENTRIES = Plugin Specified Entries
-UI_LABEL_FILE_SELECTION = File Selection
-UI_LABEL_CHOOSE_FILE_TO_ADD_TO_CATALOG = Choose a file to add to the XML Catalog
-
-!AdvancedOptionsDialog
-UI_LABEL_DIALOG_DESCRIPTION = Use the buttons below to import or export XML Catalog settings.
-UI_BUTTON_IMPORT = Import...
-UI_BUTTON_EXPORT = Export...
-
-UI_LABEL_IMPORT_DIALOG_TITLE = Import XML Catalog Settings
-UI_LABEL_IMPORT_DIALOG_HEADING = Specify XML Catalog File
-UI_LABEL_IMPORT_DIALOG_MESSAGE = Specify the file that will be used to load the XML Catalog Settings
-
-UI_LABEL_EXPORT_DIALOG_TITLE = Export XML Catalog Settings
-UI_LABEL_EXPORT_DIALOG_HEADING = Specify XML Catalog File
-UI_LABEL_EXPORT_DIALOG_MESSAGE = Specify the file that will used to save the XML Catalog Setting
-ERROR_SAVING_FILE = Error saving file %1
-UI_LABEL_FILE_IS_READ_ONLY = File %1 is read only
-
-UI_LABEL_START_STRING = Start string:
-UI_LABEL_REWRITE_PREFIX = Rewrite prefix:
-
-UI_LABEL_DETAILS_SUFFIX_COLON = Suffix:
-
-EditCatalogEntryDialog_catalogEntryLabel=&Catalog Entry
-EditCatalogEntryDialog_nextCatalogLabel=&Next Catalog
-EditCatalogEntryDialog_rewriteEntryLabel=&Rewrite Entry
-EditCatalogEntryDialog_suffixEntryLabel=&Suffix Entry
-EditCatalogEntryDialog_delegateCatalogLabel=&Delegate Catalog
-UI_BUTTON_MENU_BROWSE_WORKSPACE=&Workspace...
-UI_BUTTON_MENU_BROWSE_FILE_SYSTEM=&File System...
-UI_LABEL_SELECT_FILE_FILTER_CONTROL=Files of type:
-UI_TEXT_SELECT_FILE_FILTER_CONTROL=All Supported Files
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
deleted file mode 100644
index 6961d00fcc..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import com.ibm.icu.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
-
-
-public class XMLCatalogTreeViewer extends TreeViewer {
- protected static Image xmlCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/xmlcatalog_obj.gif"); //$NON-NLS-1$
- protected static Image errorImage = ImageFactory.INSTANCE.getImage("icons/ovr16/error-overlay.gif"); //$NON-NLS-1$
- protected static Image entryImage = ImageFactory.INSTANCE.getImage("icons/obj16/entry_obj.png"); //$NON-NLS-1$
- protected static Image nextCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/nextCatalog_obj.gif"); //$NON-NLS-1$
- protected static Image rewriteEntryImage = ImageFactory.INSTANCE.getImage("icons/obj16/rewrite_entry.gif"); //$NON-NLS-1$
- protected static Image suffixEntryImage = ImageFactory.INSTANCE.getImage("icons/obj16/suffix_entry.gif"); //$NON-NLS-1$
- protected static Image delegateCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/delegate_catalog.gif"); //$NON-NLS-1$
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
- protected ICatalog fWorkingUserCatalog;
- protected ICatalog fSystemCatalog;
-
- public static String USER_SPECIFIED_ENTRIES_OBJECT = XMLCatalogMessages.UI_LABEL_USER_SPECIFIED_ENTRIES;
- public static String PLUGIN_SPECIFIED_ENTRIES_OBJECT = XMLCatalogMessages.UI_LABEL_PLUGIN_SPECIFIED_ENTRIES;
-
- public XMLCatalogTreeViewer(Composite parent, ICatalog workingUserCatalog, ICatalog systemCatalog) {
- super(parent, SWT.MULTI | SWT.BORDER);
- this.fWorkingUserCatalog = workingUserCatalog;
- this.fSystemCatalog = systemCatalog;
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider {
- protected HashMap imageTable = new HashMap();
-
- public String getText(Object object) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = catalogEntry.getKey();
- }
- else if (object instanceof ISuffixEntry) {
- ISuffixEntry entry = (ISuffixEntry) object;
- result = "[...]" + entry.getSuffix() + " " + XMLCatalogMessages.UI_LABEL_ARROW + " " + entry.getURI();
- }
- else if (object instanceof IRewriteEntry) {
- IRewriteEntry entry = (IRewriteEntry) object;
- result = entry.getStartString() + "[...] " + XMLCatalogMessages.UI_LABEL_ARROW + " " + entry.getRewritePrefix() + "[...]";
- }
- else if (object instanceof INextCatalog) {
- INextCatalog nextCatalog = (INextCatalog) object;
- // result = nextCatalog.getCatalogLocation();
- result = URIUtils.convertURIToLocation(nextCatalog.getCatalogLocation());
- if (nextCatalog.getCatalogLocation().startsWith("file:")) {
- result += " (" + XMLCatalogMessages.UI_LABEL_FILE_SYSTEM_RESOURCE + ")";
- }
- else if (nextCatalog.getCatalogLocation().startsWith("platform:")) {
- result += " (" + XMLCatalogMessages.UI_LABEL_PLATFORM_RESOURCE + ")";
- }
- }
- else if (object instanceof IDelegateCatalog) {
- IDelegateCatalog nextCatalog = (IDelegateCatalog) object;
- // result = nextCatalog.getCatalogLocation();
- result = nextCatalog.getStartString() + " " + XMLCatalogMessages.UI_LABEL_ARROW + " " + URIUtils.convertURIToLocation(nextCatalog.getCatalogLocation());
- if (nextCatalog.getCatalogLocation().startsWith("file:")) {
- result += " (" + XMLCatalogMessages.UI_LABEL_FILE_SYSTEM_RESOURCE + ")";
- }
- else if (nextCatalog.getCatalogLocation().startsWith("platform:")) {
- result += " (" + XMLCatalogMessages.UI_LABEL_PLATFORM_RESOURCE + ")";
- }
- }
- result = TextProcessor.process(result);
- return result != null ? result : object.toString();
- }
-
- public Image getImage(Object object) {
- Image result = null;
- if (object instanceof String) {
- result = xmlCatalogImage;
- }
- else if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- result = getResourceImage(uri);
- }
- else if (object instanceof INextCatalog) {
- // TODO: add image to the imageTable and add error overlay if
- // next catalog URI is not readable
- result = nextCatalogImage;
- }
- else if (object instanceof IDelegateCatalog) {
- // TODO: add image to the imageTable and add error overlay if
- // next catalog URI is not readable
- result = delegateCatalogImage;
- }
- else if (object instanceof ISuffixEntry) {
- // TODO: add image to the imageTable and add error overlay if
- // next catalog URI is not readable
- result = suffixEntryImage;
- }
- else if (object instanceof IRewriteEntry) {
- // TODO: add image to the imageTable and add error overlay if
- // next catalog URI is not readable
- result = rewriteEntryImage;
- }
- return result;
- }
-
- private Image getResourceImage(String uri) {
- Image result = null;
- Image base = null;
-
- IEditorRegistry er = PlatformUI.getWorkbench().getEditorRegistry();
- ImageDescriptor imageDescriptor = er.getImageDescriptor(uri);
- Image image = (Image) imageTable.get(imageDescriptor);
- if (image == null) {
- image = imageDescriptor.createImage();
- imageTable.put(imageDescriptor, image);
- }
- base = image;
-
- if (base != null) {
- // TODO: This should be moved into the catalog
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- result = ImageFactory.INSTANCE.createCompositeImage(base, errorImage, ImageFactory.BOTTOM_LEFT);
- }
- }
- return result;
- }
-
- public void dispose() {
- super.dispose();
- for (Iterator it = imageTable.values().iterator(); it.hasNext();) {
- ((Image) it.next()).dispose();
- }
- }
- }
-
-
- public class CatalogEntryContentProvider implements ITreeContentProvider {
- protected Object[] roots;
-
- public CatalogEntryContentProvider() {
- roots = new Object[2];
- roots[0] = USER_SPECIFIED_ENTRIES_OBJECT;
- roots[1] = PLUGIN_SPECIFIED_ENTRIES_OBJECT;
- }
-
- public boolean isRoot(Object object) {
- return (object instanceof String) || (object instanceof INextCatalog);
- }
-
- public Object[] getElements(Object element) {
- return roots;
- }
-
- public Object[] getChildren(Object parentElement) {
- Object[] result = new Object[0];
- if (parentElement == roots[0]) {
- result = getChildrenHelper(fWorkingUserCatalog);
- }
- else if (parentElement == roots[1]) {
- result = getChildrenHelper(fSystemCatalog);
- }
- else if (parentElement instanceof INextCatalog) {
- ICatalog nextCatalog = ((INextCatalog) parentElement).getReferencedCatalog();
- result = getChildrenHelper(nextCatalog);
- }
- else if (parentElement instanceof IDelegateCatalog) {
- ICatalog nextCatalog = ((IDelegateCatalog) parentElement).getReferencedCatalog();
- result = getChildrenHelper(nextCatalog);
- }
- return result;
- }
-
- protected Object[] getChildrenHelper(ICatalog catalog) {
-
- ICatalogEntry[] entries = catalog.getCatalogEntries();
- if (entries.length > 0) {
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry entry1 = (ICatalogEntry) o1;
- ICatalogEntry entry2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(entry1.getKey(), entry2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(entries, comparator);
- }
- Vector result = new Vector();
- result.addAll(Arrays.asList(entries));
- result.addAll(Arrays.asList(catalog.getRewriteEntries()));
- result.addAll(Arrays.asList(catalog.getSuffixEntries()));
- result.addAll(Arrays.asList(catalog.getDelegateCatalogs()));
- INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
- List nextCatalogsList = Arrays.asList(nextCatalogs);
- result.addAll(nextCatalogsList);
-
- return result.toArray(new ICatalogElement[result.size()]);
- }
-
- public Object getParent(Object element) {
- return (element instanceof String) ? null : USER_SPECIFIED_ENTRIES_OBJECT;
- }
-
- public boolean hasChildren(Object element) {
- return isRoot(element) ? getChildren(element).length > 0 : false;
- }
-
- public void dispose() {
- // nothing to dispose
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- // ISSUE: seems we should do something here
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions1) {
- this.extensions = extensions1;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- else if (element.equals(XMLCatalogTreeViewer.PLUGIN_SPECIFIED_ENTRIES_OBJECT) || element.equals(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT)) {
- return true;
- }
- return result;
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java
deleted file mode 100644
index 723539d86c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.catalog;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- */
-public class XMLQuickScan {
- public static String getTargetNamespaceURIForSchema(String uri) {
- String result = null;
- try {
- URL url = new URL(uri);
- InputStream inputStream = url.openStream();
- result = XMLQuickScan.getTargetNamespaceURIForSchema(inputStream);
- }
- catch (Exception e) {
- }
- return result;
- }
-
- public static String getTargetNamespaceURIForSchema(InputStream input) {
- TargetNamespaceURIContentHandler handler = new TargetNamespaceURIContentHandler();
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(XMLQuickScan.class.getClassLoader());
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(true);
- SAXParser parser = factory.newSAXParser();
- parser.parse(new InputSource(input), handler);
- }
- catch (StopParseException e) {
- // this is a normal exception to stop parsing early,
- // when info is found, so we can safely ignore
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- catch (SAXException e) {
- Logger.logException(e);
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- return handler.targetNamespaceURI;
- }
-
- /**
- * This is a special exception that is used to stop parsing when required
- * information is found.
- */
- static class StopParseException extends org.xml.sax.SAXException {
- static final long serialVersionUID = 1L;
-
- /**
- * Constructor StopParseException.
- */
- StopParseException() {
- super("targetnamespace found, no need to continue the parse");
- }
- }
-
- static class TargetNamespaceURIContentHandler extends DefaultHandler {
- public String targetNamespaceURI;
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- if (localName.equals("schema")) //$NON-NLS-1$
- {
- int nAttributes = attributes.getLength();
- for (int i = 0; i < nAttributes; i++) {
- if (attributes.getLocalName(i).equals("targetNamespace")) //$NON-NLS-1$
- {
- targetNamespaceURI = attributes.getValue(i);
- break;
- }
- }
- }
- throw new StopParseException();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif
deleted file mode 100644
index d65b280297..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif
deleted file mode 100644
index c0d85ee54d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif
deleted file mode 100644
index 3a934b907c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif
deleted file mode 100644
index 6b87692b88..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif
deleted file mode 100644
index f00306433a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif
deleted file mode 100644
index 2bd5b41b61..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif
deleted file mode 100644
index a27e30a6f1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif
deleted file mode 100644
index 11bd2d09c0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.png b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.png
deleted file mode 100644
index be7147416b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif
deleted file mode 100644
index 85f9baaf44..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif
deleted file mode 100644
index 061161ae1c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif
deleted file mode 100644
index d4bfe79eb9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif
deleted file mode 100644
index 976cbc90df..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif
deleted file mode 100644
index 9cc8ee9168..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif
deleted file mode 100644
index dc76407557..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif
deleted file mode 100644
index a61441f2a8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java
deleted file mode 100644
index 5bebb72cca..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java
+++ /dev/null
@@ -1,135 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-public class DOMPropertyDescriptorFactory {
-
- protected static final String HACK = "hack"; //$NON-NLS-1$
-
- public DOMPropertyDescriptorFactory() {
- }
-
- public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
- IPropertyDescriptor result = null;
-
- String attributeName = attr.getName();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
-
- if (mq != null) {
- CMAttributeDeclaration ad = mq.getCMAttributeDeclaration(attr);
- if (ad != null) {
- String[] valuesArray = mq.getPossibleDataTypeValues(attr.getOwnerElement(), ad);
- if ((valuesArray != null) && (valuesArray.length > 0)) {
- result = new EnumeratedStringPropertyDescriptor(attributeName, attributeName, valuesArray);
- }
- }
- }
-
- if (result == null) {
- result = createDefaultPropertyDescriptor(attributeName);
- }
- return result;
- }
-
- public IPropertyDescriptor createCDATASectionPropertyDescriptor(CDATASection cdataSection) {
- return createDefaultPropertyDescriptor(HACK);
- }
-
- public IPropertyDescriptor createCommentPropertyDescriptor(Comment comment) {
- return createDefaultPropertyDescriptor(HACK);
- }
-
- protected IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
- return descriptor;
- }
-
- public IPropertyDescriptor createDocumentTypePropertyDescriptor(DocumentType documentType) {
- return null; // new TextPropertyDescriptor(HACK, HACK);
- }
-
- public IPropertyDescriptor createElementPropertyDescriptor(Element element) {
- return createDefaultPropertyDescriptor(HACK);
- }
-
- public IPropertyDescriptor createEntityReferencePropertyDescriptor(EntityReference entityReference) {
- return createDefaultPropertyDescriptor(HACK);
- }
-
- public IPropertyDescriptor createProcessingInstructionPropertyDescriptor(ProcessingInstruction pi) {
- return createDefaultPropertyDescriptor(HACK);
- }
-
- public IPropertyDescriptor createPropertyDescriptor(Object object) {
- IPropertyDescriptor result = null;
- if (object instanceof Node) {
- Node node = (Node) object;
- int nodeType = node.getNodeType();
- switch (nodeType) {
- case Node.ATTRIBUTE_NODE : {
- result = createAttributePropertyDescriptor((Attr) node);
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- result = createCDATASectionPropertyDescriptor((CDATASection) node);
- break;
- }
- case Node.COMMENT_NODE : {
- result = createCommentPropertyDescriptor((Comment) node);
- break;
- }
- case Node.DOCUMENT_TYPE_NODE : {
- result = createDocumentTypePropertyDescriptor((DocumentType) node);
- break;
- }
- case Node.ELEMENT_NODE : {
- result = createElementPropertyDescriptor((Element) node);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE : {
- result = createEntityReferencePropertyDescriptor((EntityReference) node);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- result = createProcessingInstructionPropertyDescriptor((ProcessingInstruction) node);
- break;
- }
- case Node.TEXT_NODE : {
- result = createTextPropertyDescriptor((Text) node);
- break;
- }
- }
- }
- return result;
- }
-
- public IPropertyDescriptor createTextPropertyDescriptor(Text text) {
- return createDefaultPropertyDescriptor(HACK);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DesignPageNavigationLocation.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DesignPageNavigationLocation.java
deleted file mode 100644
index 354e637a3b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DesignPageNavigationLocation.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.NavigationLocation;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-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.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * {@link NavigationLocation} that is loosely based on {@link TextSelectionNavigation}
- * but operates on the {@link XMLMultiPageEditorPart}'s design page. History is
- * preserved as positions, but the selection set on the viewer is the indexed region
- *
- */
-class DesignPageNavigationLocation extends NavigationLocation {
-
- // Memento tags and values
- private static final String TAG_X = "x"; //$NON-NLS-1$
- private static final String TAG_Y = "y"; //$NON-NLS-1$
- private static final String TAG_INFO = "info"; //$NON-NLS-1$
- private static final String INFO_DELETED = "deleted"; //$NON-NLS-1$
- private static final String INFO_NOT_DELETED = "not_deleted"; //$NON-NLS-1$
-
- private static final String CATEGORY = "__navigation_" + TextSelectionNavigationLocation.class.hashCode(); //$NON-NLS-1$
- private static final IPositionUpdater fgPositionUpdater = new DefaultPositionUpdater(CATEGORY);
-
- private Position fPosition;
- private IDocument fDocument;
- private Position fSavedPosition;
- private IDesignViewer fViewer;
-
- DesignPageNavigationLocation(IEditorPart part, IDesignViewer viewer, boolean initialize) {
- super(part);
-
- fViewer = viewer;
- if (initialize) {
- final ISelection selection = fViewer.getSelectionProvider().getSelection();
-
- IEditorPart textPart = getTextEditorPart();
- if (textPart != null) {
- IDocument document = getDocument((ITextEditor) textPart);
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object first = ((IStructuredSelection) selection).getFirstElement();
- if (first instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) first;
- Position position= new Position(node.getStartOffset(), node.getLength());
- if (installOnDocument(document, position)) {
- fDocument = document;
- fPosition = position;
- if (!part.isDirty())
- fSavedPosition = new Position(fPosition.offset, fPosition.length);
- }
- }
- }
- else { // The editor may not necessarily have a selection when opened
- Position position= new Position(0, 0);
- if (installOnDocument(document, position)) {
- fDocument = document;
- fPosition = position;
- if (!part.isDirty())
- fSavedPosition = new Position(fPosition.offset, fPosition.length);
- }
- }
- }
- }
-
- }
-
- /**
- * Returns the {@link ITextEditor} associated with this editor part
- * @return {@link IEditorPart} that is o
- */
- protected ITextEditor getTextEditorPart() {
- IEditorPart part = super.getEditorPart();
- if (part != null) {
- return (ITextEditor) part.getAdapter(ITextEditor.class);
- }
- return null;
- }
-
- /**
- * Returns the text editor's document.
- *
- * @param part
- * the text editor
- * @return the document of the given text editor
- */
- private IDocument getDocument(ITextEditor part) {
- IDocumentProvider provider = part.getDocumentProvider();
- return provider.getDocument(part.getEditorInput());
- }
-
- /**
- * Installs the given position on the given document.
- *
- * @param document
- * the document
- * @param position
- * the position
- * @return <code>true</code> if the position could be installed
- */
- private boolean installOnDocument(IDocument document, Position position) {
-
- if (document != null && position != null) {
-
- if (!document.containsPositionCategory(CATEGORY)) {
- document.addPositionCategory(CATEGORY);
- document.addPositionUpdater(fgPositionUpdater);
- }
-
- try {
- document.addPosition(CATEGORY, position);
- return true;
- } catch (BadLocationException e) {
- } catch (BadPositionCategoryException e) {
- }
- }
-
- return false;
- }
-
- /**
- * Uninstalls the given position from the given document.
- *
- * @param document
- * the document
- * @param position
- * the position
- * @return <code>true</code> if the position could be uninstalled
- */
- private boolean uninstallFromDocument(IDocument document, Position position) {
-
- if (document != null && position != null) {
- try {
-
- document.removePosition(CATEGORY, position);
-
- Position[] category = document.getPositions(CATEGORY);
- if (category == null || category.length == 0) {
- document.removePositionCategory(CATEGORY);
- document.removePositionUpdater(fgPositionUpdater);
- }
- return true;
-
- } catch (BadPositionCategoryException e) {
- }
- }
-
- return false;
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return "Selection<" + fPosition + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Tells whether this location is equal to the current location in the given
- * text editor.
- *
- * @param part
- * the text editor
- * @return <code>true</code> if the locations are equal
- */
- private boolean equalsLocationOf() {
-
- if (fPosition == null)
- return true;
-
- if (fPosition.isDeleted)
- return false;
-
- final ISelection selection = fViewer.getSelectionProvider().getSelection();
- if (selection instanceof IStructuredSelection) {
- final Object first = ((IStructuredSelection) selection).getFirstElement();
- if (first instanceof IDOMNode) {
- final IDOMNode node = (IDOMNode) first;
- return fPosition.offset == node.getStartOffset() && fPosition.length == node.getLength();
- }
- }
-
- return false;
- }
-
- public void dispose() {
- uninstallFromDocument(fDocument, fPosition);
- fDocument = null;
- fPosition = null;
- fSavedPosition = null;
- super.dispose();
- }
-
- /**
- * Releases the state of this location.
- */
- public void releaseState() {
- // deactivate
- uninstallFromDocument(fDocument, fPosition);
- fDocument = null;
- fPosition = null;
- fSavedPosition = null;
- super.releaseState();
- }
-
- /**
- * Merges the given location into this one.
- *
- * @param location
- * the location to merge into this one
- * @return <code>true<code> if merging was successful
- */
- public boolean mergeInto(INavigationLocation location) {
-
- if (location == null)
- return false;
-
- if (getClass() != location.getClass())
- return false;
-
- if (fPosition == null || fPosition.isDeleted)
- return true;
-
- DesignPageNavigationLocation s = (DesignPageNavigationLocation) location;
- if (s.fPosition == null || s.fPosition.isDeleted) {
- uninstallFromDocument(fDocument, fPosition);
- s.fDocument = fDocument;
- s.fPosition = fPosition;
- s.fSavedPosition = fSavedPosition;
- return true;
- }
-
- if (s.fDocument == fDocument) {
- if (s.fPosition.overlapsWith(fPosition.offset, fPosition.length) || fPosition.offset + fPosition.length == s.fPosition.offset || s.fPosition.offset + s.fPosition.length == fPosition.offset) {
- s.fPosition.offset = fPosition.offset;
- s.fPosition.length = fPosition.length;
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Restores this location.
- */
- public void restoreLocation() {
- if (fPosition == null || fPosition.isDeleted)
- return;
-
- if (fViewer instanceof Viewer) {
- ((Viewer) fViewer).setSelection(getSelection(), true);
- }
- }
-
- private ISelection getSelection() {
- ISelection selection = null;
- IStructuredModel model = null;
- final ITextEditor editor = getTextEditorPart();
- if (editor != null) {
- try {
- final IDocument document = getDocument(editor);
- if (document instanceof IStructuredDocument) {
- model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument) document);
- if (model != null) {
- final IndexedRegion region = model.getIndexedRegion(fPosition.offset);
- if (region != null) {
- selection = new StructuredSelection(region);
- }
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return selection;
- }
-
- /**
- * Restores the object state from the given memento.
- *
- * @param memento
- * the memento
- */
- public void restoreState(IMemento memento) {
-
- final ITextEditor part = getTextEditorPart();
- if (part != null) {
-
- // restore
- fDocument = getDocument(part);
-
- Integer offset = memento.getInteger(TAG_X);
- Integer length = memento.getInteger(TAG_Y);
- String deleted = memento.getString(TAG_INFO);
-
- if (offset != null && length != null) {
- Position p = new Position(offset.intValue(), length.intValue());
- if (deleted != null)
- p.isDeleted = INFO_DELETED.equals(deleted) ? true : false;
-
- // activate
- if (installOnDocument(fDocument, p)) {
- fPosition = p;
- if (!part.isDirty())
- fSavedPosition = new Position(fPosition.offset, fPosition.length);
- }
- }
- }
- }
-
- /**
- * Stores the object state into the given memento.
- *
- * @param memento
- * the memento
- */
- public void saveState(IMemento memento) {
- if (fSavedPosition != null) {
- memento.putInteger(TAG_X, fSavedPosition.offset);
- memento.putInteger(TAG_Y, fSavedPosition.length);
- memento.putString(TAG_INFO, (fSavedPosition.isDeleted ? INFO_DELETED : INFO_NOT_DELETED));
- }
- }
-
- /**
- * Hook method which is called when the given editor has been saved.
- *
- * @param part
- * the editor part
- */
- public void partSaved(IEditorPart part) {
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=25440
- if (fPosition == null || fPosition.isDeleted())
- fSavedPosition = null;
- else
- fSavedPosition = new Position(fPosition.offset, fPosition.length);
- }
-
- /**
- * Updates the this location.
- */
- public void update() {
- final IEditorPart part = getEditorPart();
-
- if (equalsLocationOf())
- return;
-
- final ISelection selection = fViewer.getSelectionProvider().getSelection();
- if (selection == null || selection.isEmpty())
- return;
-
- if (selection instanceof IStructuredSelection) {
- Object first = ((IStructuredSelection) selection).getFirstElement();
- if (first instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) first;
- fPosition.offset = node.getStartOffset();
- fPosition.length = node.getLength();
- fPosition.isDeleted = false;
- if (!part.isDirty())
- fSavedPosition = new Position(fPosition.offset, fPosition.length);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java
deleted file mode 100644
index f1be97fd80..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java
+++ /dev/null
@@ -1,25 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Control;
-
-public interface IDesignViewer {
- public Control getControl();
-
- String getTitle();
-
- void setDocument(IDocument document);
-
- ISelectionProvider getSelectionProvider();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java
deleted file mode 100644
index 411a3f9178..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java
+++ /dev/null
@@ -1,21 +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.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public interface IDesignViewerActionBarContributor extends ISourceViewerActionBarContributor {
- public void initViewerSpecificContributions(IActionBars bars);
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
deleted file mode 100644
index d70cdd3fb9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
+++ /dev/null
@@ -1,230 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public class SourceEditorActionBarContributor extends MultiPageEditorActionBarContributor implements IExtendedContributor {
-
- protected IEditorActionBarContributor designViewerActionBarContributor = null;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected MultiPageEditorPart multiPageEditor = null;
-
- // EditorExtension
- private static final String EDITOR_ID = "org.eclipse.wst.xml.ui.XMLMultiPageEditorPart"; //$NON-NLS-1$
- private IExtendedContributor extendedContributor;
-
- public SourceEditorActionBarContributor() {
- super();
-
- sourceViewerActionContributor = new SourcePageActionContributor();
-
- // Read action extensions.
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- extendedContributor = builder.readActionExtensions(EDITOR_ID);
- }
-
- public void init(IActionBars actionBars) {
- super.init(actionBars);
-
- if (actionBars != null) {
- initDesignViewerActionBarContributor(actionBars);
- initSourceViewerActionContributor(actionBars);
- }
- }
-
- protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
- if (designViewerActionBarContributor != null) {
- designViewerActionBarContributor.init(actionBars, getPage());
- }
- }
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null) {
- sourceViewerActionContributor.init(actionBars, getPage());
- }
- }
-
- public void dispose() {
- super.dispose();
-
- if (designViewerActionBarContributor != null) {
- designViewerActionBarContributor.dispose();
- }
-
- if (sourceViewerActionContributor != null) {
- sourceViewerActionContributor.dispose();
- }
-
- if (extendedContributor != null) {
- extendedContributor.dispose();
- }
-
- multiPageEditor = null;
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public final void contributeToMenu(IMenuManager menu) {
- super.contributeToMenu(menu);
-
- //addToMenu(menu);
-
- if (extendedContributor != null) {
- extendedContributor.contributeToMenu(menu);
- }
- }
-
- protected void addToMenu(IMenuManager menu) {
- }
-
- /**
- * @see IExtendedContributor#contributeToPopupMenu(IMenuManager)
- */
- public final void contributeToPopupMenu(IMenuManager menu) {
-
- addToPopupMenu(menu);
-
- if (extendedContributor != null) {
- extendedContributor.contributeToPopupMenu(menu);
- }
- }
-
- protected void addToPopupMenu(IMenuManager menu) {
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public final void contributeToToolBar(IToolBarManager toolBarManager) {
- super.contributeToToolBar(toolBarManager);
-
- addToToolBar(toolBarManager);
-
- if (extendedContributor != null) {
- extendedContributor.contributeToToolBar(toolBarManager);
- }
- }
-
- protected void addToToolBar(IToolBarManager toolBarManager) {
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
- */
- public final void contributeToStatusLine(IStatusLineManager manager) {
- super.contributeToStatusLine(manager);
-
- addToStatusLine(manager);
-
- if (extendedContributor != null) {
- extendedContributor.contributeToStatusLine(manager);
- }
- }
-
- protected void addToStatusLine(IStatusLineManager manager) {
- }
-
- /**
- * @see IExtendedContributor#updateToolbarActions()
- */
- public void updateToolbarActions() {
- if (extendedContributor != null) {
- extendedContributor.updateToolbarActions();
- }
- }
-
- public void setActiveEditor(IEditorPart targetEditor) {
- // save multiPageEditor before calling
- // super.setActiveEditor(targetEditor)
- // super.setActiveEditor will call setActivePage(IEditorPart
- // activeEditor)
- // multiPageEditor is needed in setActivePage(IEditorPart
- // activeEditor)
- if (targetEditor instanceof MultiPageEditorPart) {
- multiPageEditor = (MultiPageEditorPart) targetEditor;
- }
-
- super.setActiveEditor(targetEditor);
-
- updateToolbarActions();
-
- if (extendedContributor != null) {
- extendedContributor.setActiveEditor(targetEditor);
- }
- }
-
- public void setActivePage(IEditorPart activeEditor) {
- // This contributor is designed for StructuredTextMultiPageEditorPart.
- // To safe-guard this from problems caused by unexpected usage by
- // other editors, the following
- // check is added.
- if (multiPageEditor != null) {
- if ((activeEditor != null) && (activeEditor instanceof ITextEditor)) {
- activateSourcePage(activeEditor);
- }
- else {
- activateDesignPage(activeEditor);
- }
- }
-
- updateToolbarActions();
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
- }
-
- protected void activateDesignPage(IEditorPart activeEditor) {
- if ((designViewerActionBarContributor != null) && (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor)) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if ((sourceViewerActionContributor != null) && (sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)) {
- // if design page is not really an IEditorPart, activeEditor ==
- // null, so pass in multiPageEditor instead (d282414)
- if (activeEditor == null) {
- sourceViewerActionContributor.setActiveEditor(multiPageEditor);
- }
- else {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- }
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor) {
- if ((designViewerActionBarContributor != null) && (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor)) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if ((sourceViewerActionContributor != null) && (sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)) {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java
deleted file mode 100644
index bd1e251276..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.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.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- * Use XMLEditorActionContributor for single page editor.
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu
- * manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool
- * bar manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>'
- * status line manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars
- * the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
deleted file mode 100644
index 9033227d07..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
+++ /dev/null
@@ -1,513 +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.xml.ui.internal.tabletree;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMWriter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * This performs the work of taking a DOM tree and converting it to a
- * displayable 'UI' tree.
- *
- * For example : - white space text nodes are ommited from the 'UI' tree -
- * adjacent Text and EntityReference nodes are combined into a single 'UI'
- * node - Elements with 'text only' children are diplayed without children
- *
- */
-public class TreeContentHelper {
-
- public static final int HIDE_WHITE_SPACE_TEXT_NODES = 8;
- public static final int COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES = 16;
- public static final int HIDE_ELEMENT_CHILD_TEXT_NODES = 32;
-
- protected int style = HIDE_WHITE_SPACE_TEXT_NODES | COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES | HIDE_ELEMENT_CHILD_TEXT_NODES;
-
- /**
- *
- */
- public boolean hasStyleFlag(int flag) {
- return (style & flag) != 0;
- }
-
- /**
- *
- */
- public Object[] getChildren(Object element) {
- Object[] result = null;
-
- if (element instanceof Node) {
- Node node = (Node) element;
- List list = new ArrayList();
- boolean textContentOnly = true;
-
- NamedNodeMap map = node.getAttributes();
- if (map != null) {
- int length = map.getLength();
- for (int i = 0; i < length; i++) {
- list.add(map.item(i));
- textContentOnly = false;
- }
- }
-
- Node prevIncludedNode = null;
- for (Node childNode = node.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
- int childNodeType = childNode.getNodeType();
- boolean includeNode = true;
-
- if (includeNode && hasStyleFlag(HIDE_WHITE_SPACE_TEXT_NODES)) {
- if (isIgnorableText(childNode)) {
- // filter out the ignorable text node
- includeNode = false;
- }
- }
-
- if (includeNode && hasStyleFlag(COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES)) {
- if (isTextOrEntityReferenceNode(childNode) && (prevIncludedNode != null) && isTextOrEntityReferenceNode(prevIncludedNode)) {
- // we only show the first of a list of adjacent text
- // or entity reference node in the tree
- // so we filter out this subsequent one
- includeNode = false;
- }
- }
-
- if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES)) {
- if ((childNodeType != Node.TEXT_NODE) && (childNodeType != Node.ENTITY_REFERENCE_NODE)) {
- textContentOnly = false;
- }
- }
-
- if (includeNode) {
- list.add(childNode);
- prevIncludedNode = childNode;
- }
- }
-
- if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES) && textContentOnly) {
- result = new Object[0];
- }
- else {
- result = list.toArray();
- }
- }
- return result;
- }
-
- /**
- *
- */
- protected boolean isTextOrEntityReferenceNode(Node node) {
- return (node.getNodeType() == Node.TEXT_NODE) || (node.getNodeType() == Node.ENTITY_REFERENCE_NODE);
- }
-
- /**
- *
- */
- public boolean isIgnorableText(Node node) {
- boolean result = false;
- if (node.getNodeType() == Node.TEXT_NODE) {
- String data = ((Text) node).getData();
- result = ((data == null) || (data.trim().length() == 0));
- }
- return result;
- }
-
- /**
- *
- */
- public boolean isCombinedTextNode(Node node) {
- boolean result = false;
- if (node.getNodeType() == Node.TEXT_NODE) {
- Node nextNode = node.getNextSibling();
- if (nextNode != null) {
- if (nextNode.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- result = true;
- }
- }
- }
- else if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- result = true;
- }
- return result;
- }
-
- /**
- *
- */
- public List getCombinedTextNodeList(Node theNode) {
- List list = new Vector();
- boolean prevIsEntity = false;
- for (Node node = theNode; node != null; node = node.getNextSibling()) {
- int nodeType = node.getNodeType();
- if (nodeType == Node.ENTITY_REFERENCE_NODE) {
- prevIsEntity = true;
- list.add(node);
- }
- else if ((nodeType == Node.TEXT_NODE) && (prevIsEntity || (node == theNode))) {
- prevIsEntity = false;
- list.add(node);
- }
- else {
- break;
- }
- }
- return list;
- }
-
- public String getElementTextValue(Element element) {
- List list = _getElementTextContent(element);
- return list != null ? getValueForTextContent(list) : null;
- }
-
- public void setElementTextValue(Element element, String value) {
- setElementNodeValue(element, value);
- }
-
- private List _getElementTextContent(Element element) {
- List result = null;
-
- for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) {
- if ((node.getNodeType() == Node.TEXT_NODE) || (node.getNodeType() == Node.ENTITY_REFERENCE_NODE)) {
- if (result == null) {
- result = new Vector();
- }
- result.add(node);
- }
- else {
- result = null;
- break;
- }
- }
- return result;
- }
-
- /**
- * If the element is has 'text only' content this method will return the
- * list of elements that compose the text only content
- */
- public List getElementTextContent(Element element) {
- List result = null;
- if (!element.hasAttributes()) {
- result = _getElementTextContent(element);
- }
- return result;
- }
-
-
- /**
- *
- */
- public String getNodeValue(Node node) {
- String result = null;
- int nodeType = node.getNodeType();
- switch (nodeType) {
- case Node.ATTRIBUTE_NODE : {
- result = ((Attr) node).getValue();
- break;
- }
- case Node.CDATA_SECTION_NODE :
- // drop thru
- case Node.COMMENT_NODE : {
- result = ((CharacterData) node).getData();
- break;
- }
- case Node.DOCUMENT_TYPE_NODE : {
- result = getDocumentTypeValue((DocumentType) node);
- break;
- }
- case Node.ELEMENT_NODE : {
- result = getElementNodeValue((Element) node);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE :
- // drop thru
- case Node.TEXT_NODE : {
- result = getTextNodeValue(node);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- result = ((ProcessingInstruction) node).getData();
- break;
- }
- }
- return result;
- }
-
- /**
- *
- */
- public void setNodeValue(Node node, String value) {
- setNodeValue(node, value, null);
- }
-
- /**
- * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
- * on a given <tt>IWorkspace</tt>.
- *
- * @param model the model to be checked
- * @param context the shell context for which <code>validateEdit</code> will be run
- * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
- * will return true; otherwise, false.
- */
- private boolean validateEdit(IStructuredModel model, Shell context) {
- if (model != null && model.getBaseLocation() != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
- }
- return false;
- }
-
- /**
- *
- */
- public void setNodeValue(Node node, String value, Shell context) {
- // Model should not be edited because base location is read-only
- if (node instanceof IDOMNode && !validateEdit(((IDOMNode) node).getModel(), context)) {
- return;
- }
- int nodeType = node.getNodeType();
- try {
- switch (nodeType) {
- case Node.ATTRIBUTE_NODE : {
- ((Attr) node).setValue(value);
- break;
- }
- case Node.CDATA_SECTION_NODE :
- // drop thru
- case Node.COMMENT_NODE : {
- ((CharacterData) node).setData(value);
- break;
- }
- case Node.ELEMENT_NODE : {
- setElementNodeValue((Element) node, value);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE :
- // drop thru
- case Node.TEXT_NODE : {
- setTextNodeValue(node, value);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- ((ProcessingInstruction) node).setData(value);
- break;
- }
- }
- }
- catch (DOMException e) {
- Display d = getDisplay();
- if (d != null) {
- d.beep();
- }
- }
- }
-
- private Display getDisplay() {
-
- return PlatformUI.getWorkbench().getDisplay();
- }
-
-
- /**
- *
- */
- protected String getDocumentTypeValue(DocumentType documentType) {
- return DOMWriter.getDocumentTypeData(documentType);
- }
-
- /**
- *
- */
- protected String getElementNodeValue(Element element) {
- String result = null;
- List list = getElementTextContent(element);
- if (list != null) {
- result = getValueForTextContent(list);
- }
- return result;
- }
-
- /**
- *
- */
- protected void setElementNodeValue(Element element, String value) {
- List list = getElementTextContent(element);
- if (list != null) {
- setValueForTextContent(list, value);
- }
- else {
- Document document = element.getOwnerDocument();
- Text text = document.createTextNode(value);
- element.appendChild(text);
- }
- }
-
- /**
- *
- */
- protected String getTextNodeValue(Node node) {
- String result = null;
- List list = null;
- if (isCombinedTextNode(node)) {
- list = getCombinedTextNodeList(node);
- }
- else {
- list = new Vector();
- list.add(node);
- }
- result = getValueForTextContent(list);
- return result;
- }
-
- /**
- *
- */
- protected void setTextNodeValue(Node node, String value) {
- List list = null;
- if (isCombinedTextNode(node)) {
- list = getCombinedTextNodeList(node);
- }
- else {
- list = new Vector();
- list.add(node);
- }
- setValueForTextContent(list, value);
- }
-
- public Text getEffectiveTextNodeForCombinedNodeList(List list) {
- Text result = null;
- for (Iterator i = list.iterator(); i.hasNext();) {
- Node node = (Node) i.next();
- if (node.getNodeType() == Node.TEXT_NODE) {
- result = (Text) node;
- break;
- }
- }
- return result;
- }
-
- /**
- *
- */
- protected String getValueForTextContent(List list) {
- String result = null;
- if (list.size() > 0) {
- if (list.get(0) instanceof IDOMNode) {
- IDOMNode first = (IDOMNode) list.get(0);
- IDOMNode last = (IDOMNode) list.get(list.size() - 1);
- IDOMModel model = first.getModel();
- int start = first.getStartOffset();
- int end = last.getEndOffset();
- try {
- result = model.getStructuredDocument().get(start,
- end - start);
- } catch (Exception e) {
-
- }
- }
- else
- {
- if (list.get(0) instanceof Node)
- {
- Node n = (Node) list.get(0);
- for (Node node = n.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node.getNodeType() == Node.TEXT_NODE) {
- String text = node.getNodeValue();
- if(!((text == null) || (text.trim().length() == 0))) {
- result = text.trim();
- }
- }
- }
- }
- }
- }
-
- // we trim the content so that it looks nice when viewed
- // we need to be carfull to preserve the 'trimmed' text when the value
- // is set (see setValueForTextContent)
- if (result != null) {
- result = result.trim();
- }
- return result;
- }
-
- /**
- *
- */
- protected void setValueForTextContent(List list, String value) {
- // String oldValue = getValueForTextContent();
- // we worry about preserving trimmed text
- if (list.size() > 0) {
- if (list.get(0) instanceof IDOMNode) {
- IDOMNode first = (IDOMNode) list.get(0);
- IDOMNode last = (IDOMNode) list.get(list.size() - 1);
- int start = first.getStartOffset();
- int end = last.getEndOffset();
- first.getModel().getStructuredDocument().replaceText(this,
- start, end - start, value);
- }
- }
- }
-
- /**
- *
- */
- public boolean isEditable(Node node) {
- int nodeType = node.getNodeType();
- boolean result = false;
- switch (nodeType) {
- case Node.ATTRIBUTE_NODE :
- // drop thru
- case Node.CDATA_SECTION_NODE :
- // drop thru
- case Node.COMMENT_NODE :
- // drop thru
- case Node.ENTITY_REFERENCE_NODE :
- // drop thru
- case Node.TEXT_NODE :
- // drop thru
- case Node.PROCESSING_INSTRUCTION_NODE : {
- result = true;
- break;
- }
- case Node.ELEMENT_NODE : {
- result = (getElementTextContent((Element) node) != null) || (node.getChildNodes().getLength() == 0);
- break;
- }
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java
deleted file mode 100644
index c9832cc8ef..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java
+++ /dev/null
@@ -1,557 +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.xml.ui.internal.tabletree;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.PlatformUI;
-
-
-public class TreeExtension implements PaintListener {
-
- protected Tree fTree;
- protected EditManager editManager;
- protected String[] fColumnProperties;
- protected ICellModifier cellModifier;
- protected int columnPosition = 300;
- protected int columnHitWidth = 5;
- protected Color tableLineColor;
- protected int controlWidth;
- protected DelayedDrawTimer delayedDrawTimer;
- private boolean fisUnsupportedInput = false;
-
- public TreeExtension(Tree tree) {
- this.fTree = tree;
- InternalMouseListener listener = new InternalMouseListener();
- tree.addMouseMoveListener(listener);
- tree.addMouseListener(listener);
- tree.addPaintListener(this);
- editManager = new EditManager(tree);
- delayedDrawTimer = new DelayedDrawTimer(tree);
-
- tableLineColor = tree.getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
- }
-
- public void dispose() {
- tableLineColor.dispose();
- }
-
- public void setCellModifier(ICellModifier modifier) {
- cellModifier = modifier;
- }
-
- public void resetCachedData() {
- // todo: sure seems we should reset something?
- }
-
- public ICellModifier getCellModifier() {
- return cellModifier;
- }
-
- public List getItemList() {
- List list = new Vector();
- getItemListHelper(fTree.getItems(), list);
- return list;
- }
-
- protected void getItemListHelper(TreeItem[] items, List list) {
- for (int i = 0; i < items.length; i++) {
- TreeItem item = items[i];
- list.add(item);
- getItemListHelper(item.getItems(), list);
- }
- }
-
- protected TreeItem getTreeItemOnRow(int px, int py) {
- TreeItem result = null;
- List list = getItemList();
- for (Iterator i = list.iterator(); i.hasNext();) {
- TreeItem item = (TreeItem) i.next();
- Rectangle r = item.getBounds();
- if ((r != null) && (px >= r.x) && (py >= r.y) && (py <= r.y + r.height)) {
- result = item;
- }
- }
- return result;
- }
-
- protected class InternalMouseListener extends MouseAdapter implements MouseMoveListener {
- protected int columnDragged = -1;
- protected boolean isDown = false;
- protected int prevX = -1;
- protected Cursor cursor = null;
-
- public void mouseMove(MouseEvent e) {
- if ((e.x > columnPosition - columnHitWidth) && (e.x < columnPosition + columnHitWidth)) {
- if (cursor == null) {
- cursor = new Cursor(fTree.getDisplay(), SWT.CURSOR_SIZEWE);
- fTree.setCursor(cursor);
- }
- }
- else {
- if (cursor != null) {
- fTree.setCursor(null);
- cursor.dispose();
- cursor = null;
- }
- }
-
- if (columnDragged != -1) {
- // using the delay timer will make redraws less flickery
- if (e.x > 20) {
- columnPosition = e.x;
- delayedDrawTimer.reset(20);
- }
- }
- }
-
- public void mouseDown(MouseEvent e) {
- // here we handle the column resizing by detect if the user has
- // click on a column separator
- //
- columnDragged = -1;
- editManager.deactivateCellEditor();
-
- if ((e.x > columnPosition - columnHitWidth) && (e.x < columnPosition + columnHitWidth)) {
- columnDragged = 0;
- }
-
- // here we handle selecting tree items when any thing on the 'row'
- // is clicked
- //
- TreeItem item = fTree.getItem(new Point(e.x, e.y));
- if (item == null) {
- item = getTreeItemOnRow(e.x, e.y);
- if (item != null) {
- TreeItem[] items = new TreeItem[1];
- items[0] = item;
- fTree.setSelection(items);
- }
- }
- }
-
- public void mouseUp(MouseEvent e) {
- columnDragged = -1;
- }
- }
-
- public String[] getColumnProperties() {
- return fColumnProperties;
- }
-
- public void setColumnProperties(String[] columnProperties) {
- this.fColumnProperties = columnProperties;
- }
-
- public void paintControl(PaintEvent event) {
- GC gc = event.gc;
- Rectangle treeBounds = fTree.getBounds();
-
- controlWidth = treeBounds.width;
- Color bg = fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- Color bg2 = fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
-
- gc.setBackground(bg2);
-
- // // This next part causes problems on LINUX, so let's not do it
- // there
- // if (B2BHacks.IS_UNIX == false) {
- // TreeItem[] selectedItems = tree.getSelection();
- // if (selectedItems.length > 0) {
- // for (int i = 0; i < selectedItems.length; i++) {
- // TreeItem item = selectedItems[i];
- // Rectangle bounds = item.getBounds();
- // if (bounds != null) {
- // gc.fillRectangle(bounds.x + bounds.width, bounds.y, controlWidth,
- // bounds.height);
- // }
- // }
- // }
- // }
- //
- if (!fisUnsupportedInput) {
- TreeItem[] items = fTree.getItems();
- if (items.length > 0) {
- gc.setForeground(tableLineColor);
- gc.setBackground(bg);
-
- gc.fillRectangle(columnPosition, treeBounds.x, treeBounds.width, treeBounds.height);
-
- Rectangle itemBounds = items[0].getBounds();
- int height = computeTreeItemHeight();
-
- if (itemBounds != null) {
- /*
- * Bounds will be for the first item, which will either be
- * visible at the top of the Tree, or scrolled off with
- * negative values
- */
- int startY = itemBounds.y;
-
- /* Only draw lines within the Tree boundaries */
- for (int i = startY; i < treeBounds.height; i += height) {
- if (i >= treeBounds.y) {
- gc.drawLine(0, i, treeBounds.width, i);
- }
- }
- }
- gc.drawLine(columnPosition, 0, columnPosition, treeBounds.height);
- paintItems(gc, items, treeBounds);
-
- }
- else {
- addEmptyTreeMessage(gc);
- }
- }
- else {
- addUnableToPopulateTreeMessage(gc);
- }
- }
-
- protected int computeTreeItemHeight() {
- int result = -1;
-
- /*
- * On GTK tree.getItemHeight() seems to lie to us. It reports that the
- * tree item occupies a few pixles less vertical space than it should
- * (possibly because of the image height vs. the text height?). This
- * foils our code that draws the 'row' lines since we assume that
- * lines should be drawn at 'itemHeight' increments. Don't trust
- * getItemHeight() to compute the increment... instead compute the
- * value based on distance between two TreeItems, and then use the
- * larger value.
- *
- * This strategy only works on trees where the items are of even
- * height, however bug
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=117201 indicates that
- * this is no longer promised, at least on win32 and likely on other
- * platforms soon.
- */
- if (fTree.getItemCount() > 0) {
- TreeItem[] items = fTree.getItems();
- Rectangle itemBounds = items[0].getBounds();
-
- if (items[0].getExpanded()) {
- TreeItem[] children = items[0].getItems();
- if (children.length > 0) {
- result = children[0].getBounds().y - itemBounds.y;
- }
- }
- else if (items.length > 1) {
- result = items[1].getBounds().y - itemBounds.y;
- }
- }
-
- result = Math.max(fTree.getItemHeight(), result);
- return result;
- }
-
- protected void addEmptyTreeMessage(GC gc) {
- // nothing to add here
- }
-
- private void addUnableToPopulateTreeMessage(GC gc) {
- // here we print a message when the document cannot be displayed just
- // to give the
- // user a visual cue
- // so that they know how to proceed to edit the blank view
- gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
- gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- gc.drawString(XMLEditorMessages.TreeExtension_0, 10, 10);
- }
-
- void setIsUnsupportedInput(boolean isUnsupported) {
- fisUnsupportedInput = isUnsupported;
- }
-
- public void paintItems(GC gc, TreeItem[] items, Rectangle treeBounds) {
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- TreeItem item = items[i];
- if (item != null) {
- Rectangle bounds = item.getBounds();
- if (bounds != null) {
- if (treeBounds.intersects(bounds)) {
- paintItem(gc, item, bounds);
- }
- }
-
- // defect 241039
- //
- if (item.getExpanded()) {
- paintItems(gc, item.getItems(), treeBounds);
- }
- }
- }
- }
- }
-
- protected void paintItem(GC gc, TreeItem item, Rectangle bounds) {
- // nothing to paint
- }
-
- public interface ICellEditorProvider {
- CellEditor getCellEditor(Object o, int col);
- }
-
- /**
- * This class is used to improve drawing during a column resize.
- */
- public class DelayedDrawTimer implements Runnable {
- protected Control control;
-
- public DelayedDrawTimer(Control control1) {
- this.control = control1;
- }
-
- public void reset(int milliseconds) {
- getDisplay().timerExec(milliseconds, this);
- }
-
- public void run() {
- control.redraw();
- }
- }
-
- Display getDisplay() {
-
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * EditManager
- */
- public class EditManager {
- protected Tree fTree1;
- protected Control cellEditorHolder;
- protected CellEditorState cellEditorState;
-
- public EditManager(Tree tree) {
- this.fTree1 = tree;
- this.cellEditorHolder = new Composite(tree, SWT.NONE);
-
- final Tree theTree = tree;
-
- MouseAdapter theMouseAdapter = new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- deactivateCellEditor();
-
- if (e.x > columnPosition + columnHitWidth) {
- TreeItem[] items = theTree.getSelection();
- // No edit if more than one row is selected.
- if (items.length == 1) {
- Rectangle bounds = items[0].getBounds();
- if ((bounds != null) && (e.y >= bounds.y) && (e.y <= bounds.y + bounds.height)) {
- int columnToEdit = 1;
- activateCellEditor(items[0], columnToEdit);
- }
- }
- }
- }
- };
-
- SelectionListener selectionListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- applyCellEditorValue();
- }
-
- public void widgetSelected(SelectionEvent e) {
- applyCellEditorValue();
- }
- };
-
- KeyListener keyListener = new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.CR) {
- deactivateCellEditor();
- TreeItem[] items = theTree.getSelection();
- if (items.length == 1) {
- activateCellEditor(items[0], 1);
- }
- }
- }
- };
-
- tree.addMouseListener(theMouseAdapter);
- tree.addKeyListener(keyListener);
- ScrollBar hBar = tree.getHorizontalBar();
- if (hBar != null) {
- hBar.addSelectionListener(selectionListener);
- }
- ScrollBar vBar = tree.getVerticalBar();
- if (vBar != null) {
- vBar.addSelectionListener(selectionListener);
- }
- }
-
- public boolean isCellEditorActive() {
- return cellEditorState != null;
- }
-
- public void applyCellEditorValue() {
- if ((cellEditorState != null) && (cellModifier != null)) {
- TreeItem treeItem = cellEditorState.fTreeItem;
-
- // The area below the cell editor needs to be explicity
- // repainted on Linux
- //
- // Rectangle r = B2BHacks.IS_UNIX ? treeItem.getBounds() :
- // null;
-
- Object value = cellEditorState.fCellEditor.getValue();
- String property = cellEditorState.fProperty;
-
- deactivateCellEditor();
-
- cellModifier.modify(treeItem, property, value);
-
- // if (r != null) {
- // tree.redraw(r.x, r.y, tree.getBounds().width, r.height,
- // false);
- // }
- }
- }
-
- public void deactivateCellEditor() {
- // Clean up any previous editor control
- if (cellEditorState != null) {
- cellEditorState.deactivate();
- cellEditorState = null;
- }
- }
-
- public void activateCellEditor(TreeItem treeItem, int column) {
- if (cellModifier instanceof ICellEditorProvider) {
- ICellEditorProvider cellEditorProvider = (ICellEditorProvider) cellModifier;
- Object data = treeItem.getData();
- if (fColumnProperties.length > column) {
- String property = fColumnProperties[column];
- if (cellModifier.canModify(data, property)) {
- CellEditor newCellEditor = cellEditorProvider.getCellEditor(data, column);
- if (newCellEditor != null) {
- // The control that will be the editor must be a
- // child of the columnPosition
- Control control = newCellEditor.getControl();
- if (control != null) {
- cellEditorState = new CellEditorState(newCellEditor, control, treeItem, column, property);
- cellEditorState.activate();
- }
- }
- }
- }
- }
- }
-
- /**
- * this class holds the state that is need on a per cell editor
- * invocation basis
- */
- public class CellEditorState implements ICellEditorListener, FocusListener {
- public CellEditor fCellEditor;
- public Control fControl;
- public TreeItem fTreeItem;
- public int fColumnNumber;
- public String fProperty;
-
- public CellEditorState(CellEditor cellEditor, Control control, TreeItem treeItem, int columnNumber, String property) {
- this.fCellEditor = cellEditor;
- this.fControl = control;
- this.fTreeItem = treeItem;
- this.fColumnNumber = columnNumber;
- this.fProperty = property;
- }
-
- public void activate() {
- Object element = fTreeItem.getData();
- String value = cellModifier.getValue(element, fProperty).toString();
- if (fControl instanceof Text) {
- Text text = (Text) fControl;
- int requiredSize = value.length() + 100;
- if (text.getTextLimit() < requiredSize) {
- text.setTextLimit(requiredSize);
- }
- }
- Rectangle r = fTreeItem.getBounds();
- if (r != null) {
- fControl.setBounds(columnPosition + 5, r.y + 1, fTree1.getClientArea().width - (columnPosition + 5), r.height - 1);
- fControl.setVisible(true);
- fCellEditor.setValue(value);
- fCellEditor.addListener(this);
- fCellEditor.setFocus();
- fControl.addFocusListener(this);
- }
- }
-
- public void deactivate() {
- fCellEditor.removeListener(this);
- fControl.removeFocusListener(this);
- fCellEditor.deactivate();
- fTree1.forceFocus();
- }
-
- // ICellEditorListener methods
- //
- public void applyEditorValue() {
- applyCellEditorValue();
- }
-
- public void cancelEditor() {
- deactivateCellEditor();
- }
-
- public void editorValueChanged(boolean oldValidState, boolean newValidState) {
- // nothing, for now
- }
-
- // FocusListener methods
- //
- public void focusGained(FocusEvent e) {
- // do nothing
- }
-
- public void focusLost(FocusEvent e) {
- applyCellEditorValue();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java
deleted file mode 100644
index 02fd23cb5f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java
+++ /dev/null
@@ -1,66 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class ViewerExpandCollapseAction extends Action {
-
- protected boolean isExpandAction;
- protected AbstractTreeViewer viewer = null;
-
- public ViewerExpandCollapseAction(boolean isExpandAction) {
- this.isExpandAction = isExpandAction;
- if (isExpandAction) {
- ImageDescriptor e_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_ETOOL_EXPANDALL);
- ImageDescriptor d_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_DTOOL_EXPANDALL);
-
- setImageDescriptor(e_imageDescriptor);
- setDisabledImageDescriptor(d_imageDescriptor);
- setToolTipText(XMLUIMessages._UI_INFO_EXPAND_ALL);
- }
- else {
- ImageDescriptor e_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_ETOOL_COLLAPSEALL);
- ImageDescriptor d_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_DTOOL_COLLAPSEALL);
-
- setImageDescriptor(e_imageDescriptor);
- setDisabledImageDescriptor(d_imageDescriptor);
- setToolTipText(XMLUIMessages._UI_INFO_COLLAPSE_ALL);
- }
- }
-
- public void setViewer(AbstractTreeViewer viewer) {
- this.viewer = viewer;
- }
-
- public void run() {
- if (viewer != null) {
- // temporarily set the visibility to false
- // this has a HUGE performance benefit
- boolean isVisible = viewer.getControl().getVisible();
- viewer.getControl().setVisible(false);
-
- if (isExpandAction) {
- viewer.expandAll();
- }
- else {
- viewer.collapseAll();
- }
-
- // restore the previous visibility state
- //
- viewer.getControl().setVisible(isVisible);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java
deleted file mode 100644
index 1d380cfb8b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java
+++ /dev/null
@@ -1,33 +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.xml.ui.internal.tabletree;
-
-
-
-/**
- * Defines the definitions ids for the XML editor actions.
- *
- * @deprecated Use org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds
- * instead
- */
-public interface XMLEditorActionDefinitionIds {
- public final static String CLEANUP_DOCUMENT = "org.eclipse.wst.sse.ui.edit.ui.cleanup.document";//$NON-NLS-1$
- public final static String FORMAT_DOCUMENT = "org.eclipse.wst.sse.ui.edit.ui.format.document";//$NON-NLS-1$
- public final static String FORMAT_ACTIVE_ELEMENTS = "org.eclipse.wst.sse.ui.edit.ui.format.active.elements";//$NON-NLS-1$
- public final static String OPEN_FILE = "org.eclipse.wst.sse.ui.edit.ui.open.file.from.source";//$NON-NLS-1$
- // public final static String INFORMATION =
- // "org.eclipse.wst.sse.ui.edit.ui.show.tooltip.information";//$NON-NLS-1$
- public final static String INFORMATION = "org.eclipse.jdt.ui.edit.text.java.show.javadoc";//$NON-NLS-1$
- public final static String ADD_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.add.breakpoints";//$NON-NLS-1$
- public final static String MANAGE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.manage.breakpoints";//$NON-NLS-1$
- public final static String ENABLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.enable.breakpoints";//$NON-NLS-1$
- public final static String DISABLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.disable.breakpoints";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
deleted file mode 100644
index 2d20a65bfe..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
+++ /dev/null
@@ -1,57 +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 - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Editor
- *
- * @plannedfor 1.0
- */
-public class XMLEditorMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorResources";//$NON-NLS-1$
-
- public static String XMLTableTreeViewer_0;
- public static String XMLTableTreeViewer_1;
- public static String XMLTableTreeViewer_2;
- public static String XMLMultiPageEditorPart_0;
- public static String XMLTreeExtension_0;
- public static String XMLTreeExtension_1;
- public static String XMLTreeExtension_3;
- public static String XMLTreeExtension_4;
- public static String XMLTableTreeActionBarContributor_0;
- public static String XMLTableTreeActionBarContributor_1;
- public static String XMLTableTreeActionBarContributor_2;
- public static String XMLTableTreeActionBarContributor_3;
- public static String XMLTableTreeActionBarContributor_4;
- public static String XMLTableTreeActionBarContributor_5;
- public static String XMLTableTreeActionBarContributor_6;
- public static String XMLTableTreeActionBarContributor_7;
- public static String XMLTableTreeActionBarContributor_8;
- public static String An_error_has_occurred_when1_ERROR_;
-
- public static String ConfigureColumns_label;
- public static String Resource__does_not_exist;
- public static String Editor_could_not_be_open;
-
- public static String EditorMenu_tooltip;
- public static String TreeExtension_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLEditorMessages.class);
- }
-
- private XMLEditorMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java
deleted file mode 100644
index 7e11286e7c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.wst.xml.ui.internal.tabletree;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * 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 XMLEditorPluginImageHelper {
- private final String PLUGINID = XMLUIPlugin.ID;
- private static XMLEditorPluginImageHelper instance = null;
- public static final String EDITOR_MENU = "editor.xml_tabletree.menu"; //$NON-NLS-1$
-
- // save a descriptor for each image
- private static HashMap fImageDescRegistry = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a XMLEditorPluginImageHelper
- */
- public synchronized static XMLEditorPluginImageHelper getInstance() {
- if (instance == null) {
- instance = new XMLEditorPluginImageHelper();
- initializeRegistry();
- }
- return instance;
- }
-
- private static void initializeRegistry() {
- // Taken from org.eclipse.ui.internal.WorkbenchImages
- Display d = Display.getCurrent();
-
- Image viewMenu = new Image(d, 11, 16);
- Image viewMenuMask = new Image(d, 11, 16);
-
- GC gc = new GC(viewMenu);
- GC maskgc = new GC(viewMenuMask);
- drawViewMenu(gc, maskgc);
- gc.dispose();
- maskgc.dispose();
-
- ImageData data = viewMenu.getImageData();
- data.transparentPixel = data.getPixel(0,0);
-
- Image vm2 = new Image(d, viewMenu.getImageData(), viewMenuMask.getImageData());
- viewMenu.dispose();
- viewMenuMask.dispose();
-
- getImageRegistry().put(EDITOR_MENU, vm2);
- getImageDescriptorRegistry().put(EDITOR_MENU, ImageDescriptor.createFromImage(vm2));
- }
-
- private static void drawViewMenu(GC gc, GC maskgc) {
- Display display = Display.getCurrent();
-
- gc.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
- gc.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
-
- int[] shapeArray = new int[] {1, 1, 10, 1, 6, 5, 5, 5};
- gc.fillPolygon(shapeArray);
- gc.drawPolygon(shapeArray);
-
- Color black = display.getSystemColor(SWT.COLOR_BLACK);
- Color white = display.getSystemColor(SWT.COLOR_WHITE);
-
- maskgc.setBackground(black);
- maskgc.fillRectangle(0,0,12,16);
-
- maskgc.setBackground(white);
- maskgc.setForeground(white);
- maskgc.fillPolygon(shapeArray);
- maskgc.drawPolygon(shapeArray);
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private static 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 static 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.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java
deleted file mode 100644
index a35f00f4cc..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.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.xml.ui.internal.tabletree;
-
-/**
- * Bundle of most images used by the XML Editor plug-in.
- */
-public class XMLEditorPluginImages {
- public static final String IMG_DTOOL_COLLAPSE = "icons/full/dtool16/collapse.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_COLLAPSE = "icons/full/etool16/collapse.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_COLLAPSEALL = "icons/full/dtool16/collapse_all.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_COLLAPSEALL = "icons/full/etool16/collapse_all.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_EXPAND = "icons/full/dtool16/expand.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_EXPAND = "icons/full/etool16/expand.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_EXPANDALL = "icons/full/dtool16/expand_all.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_EXPANDALL = "icons/full/etool16/expand_all.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_NEW_XML = "icons/full/dtool16/new_xml.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_NEW_XML = "icons/full/etool16/new_xml.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
deleted file mode 100644
index 2a4a39bf6b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
+++ /dev/null
@@ -1,34 +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
-###############################################################################
-XMLTableTreeViewer_0=Design
-XMLTableTreeViewer_1=Node
-XMLTableTreeViewer_2=Content
-XMLMultiPageEditorPart_0=Source
-XMLTreeExtension_0=Structure
-XMLTreeExtension_1=Value
-XMLTreeExtension_3=The document is empty.
-XMLTreeExtension_4=Right mouse click here to insert content.
-XMLTableTreeActionBarContributor_0=&XML
-XMLTableTreeActionBarContributor_1=&Expand All
-XMLTableTreeActionBarContributor_2=&Collapse All
-XMLTableTreeActionBarContributor_3=Turn Grammar Constraints Off
-XMLTableTreeActionBarContributor_4=&Turn Grammar Constraints Off
-XMLTableTreeActionBarContributor_5=Turn Grammar Constraints On
-XMLTableTreeActionBarContributor_6=&Turn Grammar Constraints On
-XMLTableTreeActionBarContributor_7=Reload Dependencies
-XMLTableTreeActionBarContributor_8=&Reload Dependencies
-##
-An_error_has_occurred_when1_ERROR_=An error has occurred when initializing the input for the the editor's source page.
-ConfigureColumns_label=&Columns...
-Resource__does_not_exist=Resource {0} does not exist.
-Editor_could_not_be_open=Editor could not be open on {0}
-EditorMenu_tooltip=Editor Menu
-TreeExtension_0=Cannot display document contents.
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java
deleted file mode 100644
index 7d4ee4b629..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java
+++ /dev/null
@@ -1,93 +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.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public class XMLMultiPageEditorActionBarContributor extends SourceEditorActionBarContributor {
-
- private boolean needsMultiInit = true;
-
- public XMLMultiPageEditorActionBarContributor() {
- super();
- }
-
- protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
- super.initDesignViewerActionBarContributor(actionBars);
-
- if (designViewerActionBarContributor != null) {
- if (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
- ((IDesignViewerActionBarContributor) designViewerActionBarContributor).initViewerSpecificContributions(actionBars);
- }
- }
- }
-
- protected void activateDesignPage(IEditorPart activeEditor) {
- if ((sourceViewerActionContributor != null) && (sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)) {
- // if design page is not really an IEditorPart, activeEditor ==
- // null, so pass in multiPageEditor instead (d282414)
- if (activeEditor == null) {
- sourceViewerActionContributor.setActiveEditor(multiPageEditor);
- }
- else {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- }
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
- }
-
- if ((designViewerActionBarContributor != null) && (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor)) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- ((IDesignViewerActionBarContributor) designViewerActionBarContributor).setViewerSpecificContributionsEnabled(true);
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor) {
- if ((designViewerActionBarContributor != null) && (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor)) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- ((IDesignViewerActionBarContributor) designViewerActionBarContributor).setViewerSpecificContributionsEnabled(false);
- }
-
- if ((sourceViewerActionContributor != null) && (sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)) {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorActionBarContributor#init(org.eclipse.ui.IActionBars)
- */
- public void init(IActionBars actionBars) {
- super.init(actionBars);
- needsMultiInit = true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IEditorPart targetEditor) {
- if (needsMultiInit) {
- designViewerActionBarContributor = new XMLTableTreeActionBarContributor();
- initDesignViewerActionBarContributor(getActionBars());
- needsMultiInit = false;
- }
- super.setActiveEditor(targetEditor);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
deleted file mode 100644
index 59f8da32b6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
+++ /dev/null
@@ -1,1164 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.util.ConfigureColumns;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.INavigationLocationProvider;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageEditorSite;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.ITextRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-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.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class XMLMultiPageEditorPart extends MultiPageEditorPart implements INavigationLocationProvider {
-
- /**
- * Internal part activation listener, copied from AbstractTextEditor
- */
- class ActivationListener implements IPartListener, IWindowListener {
-
- /**
- * The maximum number of children the root nodes can have for the
- * design page to auto expand the root nodes
- */
- private static final int MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND = 500;
-
- /** Cache of the active workbench part. */
- private IWorkbenchPart fActivePart;
- /** Indicates whether activation handling is currently be done. */
- private boolean fIsHandlingActivation = false;
- /**
- * The part service.
- *
- * @since 3.1
- */
- private IPartService fPartService;
-
- /**
- * Creates this activation listener.
- *
- * @param partService
- * the part service on which to add the part listener
- * @since 3.1
- */
- public ActivationListener(IPartService partService) {
- fPartService = partService;
- fPartService.addPartListener(this);
- PlatformUI.getWorkbench().addWindowListener(this);
- }
-
- /**
- * Disposes this activation listener.
- *
- * @since 3.1
- */
- public void dispose() {
- fPartService.removePartListener(this);
- PlatformUI.getWorkbench().removeWindowListener(this);
- fPartService = null;
- }
-
- /*
- * @see IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- fActivePart = part;
- handleActivation();
- }
-
- /*
- * @see IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // do nothing
- }
-
- /*
- * @see IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- // do nothing
- }
-
- /*
- * @see IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- fActivePart = null;
- }
-
- /*
- * @see IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- if (fDesignViewer instanceof AbstractTreeViewer) {
- IDocument document = getDocument();
- if (document != null) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- try {
- if (model instanceof IDOMModel) {
- IDOMDocument modelDocument = ((IDOMModel) model).getDocument();
- NodeList rootChildren = modelDocument.getChildNodes();
-
- boolean tooManyChildren = (rootChildren.getLength() > MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND);
- /*
- * For each root (there should really only be one
- * real root but there are also could be empty
- * text regions and doc type at the root level)
- * determine if it has to many children or not to
- * auto expand
- */
- for (int i = 0; i < rootChildren.getLength() && !tooManyChildren; ++i) {
- tooManyChildren = (rootChildren.item(i).getChildNodes().getLength() > MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND);
- }
-
- /*
- * if root node does not have to many children
- * then auto expand the root node
- */
- if (!tooManyChildren) {
- ((AbstractTreeViewer) fDesignViewer).expandToLevel(2);
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- }
- }
-
- /**
- * Handles the activation triggering a element state check in the
- * editor.
- */
- void handleActivation() {
- if (fIsHandlingActivation || (getTextEditor() == null)) {
- return;
- }
-
- if (fActivePart == XMLMultiPageEditorPart.this) {
- fIsHandlingActivation = true;
- try {
- getTextEditor().safelySanityCheckState(getEditorInput());
- }
- finally {
- fIsHandlingActivation = false;
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowActivated(IWorkbenchWindow window) {
- if (window == getEditorSite().getWorkbenchWindow()) {
- /*
- * Workaround for problem described in
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 Will be
- * removed when SWT has solved the problem.
- */
- window.getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- handleActivation();
- }
- });
- }
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- // do nothing
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowClosed(IWorkbenchWindow window) {
- // do nothing
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowOpened(IWorkbenchWindow window) {
- // do nothing
- }
- }
-
- /**
- * Listens for selection from the source page, applying it to the design
- * viewer.
- */
- private class TextEditorPostSelectionAdapter extends UIJob implements ISelectionChangedListener {
- boolean forcePostSelection = false;
- ISelection selection = null;
-
- public TextEditorPostSelectionAdapter() {
- super(getTitle());
- setUser(true);
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (selection != null) {
- fDesignViewer.getSelectionProvider().setSelection(selection);
- }
- return Status.OK_STATUS;
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- if ((fDesignViewer != null) && ((getActivePage() != fDesignPageIndex) || !XMLMultiPageEditorPart.this.equals(getSite().getPage().getActivePart()))) {
- if (forcePostSelection) {
- selection = event.getSelection();
- schedule(200);
- }
- else {
- fDesignViewer.getSelectionProvider().setSelection(event.getSelection());
- }
- }
- }
- }
-
- private class PageInitializationData {
- IConfigurationElement fElement;
- String fPropertyName;
- Object fData;
-
- PageInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
- super();
- fElement = cfig;
- fPropertyName = propertyName;
- fData = data;
- }
-
- void sendInitializationData(IExecutableExtension executableExtension) {
- try {
- executableExtension.setInitializationData(fElement, fPropertyName, fData);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
- /**
- * Internal IPropertyListener on the source page
- */
- class PropertyListener implements IPropertyListener {
- public void propertyChanged(Object source, int propId) {
- switch (propId) {
- // had to implement input changed "listener" so that
- // StructuredTextEditor could tell it containing editor that
- // the input has change, when a 'resource moved' event is
- // found.
- case IEditorPart.PROP_INPUT : {
- if (source == getTextEditor() && fDesignViewer instanceof XMLTableTreeViewer) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- try {
- if (model instanceof IDOMModel) {
- IDOMDocument modelDocument = ((IDOMModel) model).getDocument();
- Object designInput = ((XMLTableTreeViewer) fDesignViewer).getInput();
- if (modelDocument != designInput)
- setInput(getTextEditor().getEditorInput());
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
- case IEditorPart.PROP_DIRTY : {
- if (source == getTextEditor()) {
- if (getTextEditor().getEditorInput() != getEditorInput()) {
- setInput(getTextEditor().getEditorInput());
- /*
- * title should always change when input changes.
- * create runnable for following post call
- */
- Runnable runnable = new Runnable() {
- public void run() {
- _firePropertyChange(IWorkbenchPart.PROP_TITLE);
- }
- };
- /*
- * Update is just to post things on the display
- * queue (thread). We have to do this to get the
- * dirty property to get updated after other
- * things on the queue are executed.
- */
- ((Control) getTextEditor().getAdapter(Control.class)).getDisplay().asyncExec(runnable);
- }
- }
- break;
- }
- case IWorkbenchPart.PROP_TITLE : {
- // update the input if the title is changed
- if (source == getTextEditor()) {
- if (getTextEditor().getEditorInput() != getEditorInput()) {
- setInput(getTextEditor().getEditorInput());
- }
- }
- break;
- }
- default : {
- // propagate changes. Is this needed? Answer: Yes.
- if (source == getTextEditor()) {
- _firePropertyChange(propId);
- }
- break;
- }
- }
-
- }
- }
-
- class TextInputListener implements ITextInputListener {
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- // do nothing
- }
-
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- if ((fDesignViewer != null) && (newInput != null)) {
- fDesignViewer.setDocument(newInput);
- }
- }
- }
-
- class StatusLineLabelProvider extends JFaceNodeLabelProvider {
- public StatusLineLabelProvider() {
- }
-
- public String getText(Object element) {
- if (element == null)
- return null;
-
- Node node = (Node) element;
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- return getText(((Attr) node).getOwnerElement());
- }
-
- StringBuffer s = new StringBuffer();
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- while (node != null && node instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) node;
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- IJFaceNodeAdapter adapter = (IJFaceNodeAdapter) notifier.getAdapterFor(IJFaceNodeAdapter.class);
- if (adapter != null) {
- s.insert(0, adapter.getLabelText(node));
- }
- }
- node = node.getParentNode();
- if (node != null && node.getNodeType() != Node.DOCUMENT_NODE)
- s.insert(0, IPath.SEPARATOR);
- }
- }
- return s.toString();
- }
-
- public Image getImage(Object element) {
- if (element == null)
- return null;
-
- Node node = (Node) element;
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- return getImage(((Attr) node).getOwnerElement());
- }
- return super.getImage(element);
- }
- }
-
- /** The design page index. */
- private int fDesignPageIndex;
-
- /** The design viewer */
- IDesignViewer fDesignViewer;
- /** Any container for the design viewer */
- private Composite fDesignContainer;
-
- private ActivationListener fActivationListener;
-
- IPropertyListener fPropertyListener = null;
-
- /** The source page index. */
- int fSourcePageIndex;
-
- /** The text editor. */
- private StructuredTextEditor fTextEditor;
-
- private TextEditorPostSelectionAdapter fTextEditorSelectionListener;
-
- private ILabelProvider fStatusLineLabelProvider;
-
- private PageInitializationData fPageInitializer;
-
- private ToolBarManager fToolbarManager;
- private ToolBarManager fEditorManager;
-
- /** Context menu manager */
- private MenuManager fMenuManager;
-
- private boolean fAllocateToolbar = true;
-
- /**
- * StructuredTextMultiPageEditorPart constructor comment.
- */
- public XMLMultiPageEditorPart() {
- super();
- fStatusLineLabelProvider = new StatusLineLabelProvider();
- }
-
- /*
- * This method is just to make firePropertyChanged accessible from some
- * (anonomous) inner classes.
- */
- void _firePropertyChange(int property) {
- super.firePropertyChange(property);
- }
-
- /**
- * Adds the source page of the multi-page editor.
- */
- private void addSourcePage() throws PartInitException {
- fSourcePageIndex = addPage(fTextEditor, getEditorInput());
- setPageText(fSourcePageIndex, XMLEditorMessages.XMLMultiPageEditorPart_0);
-
- firePropertyChange(PROP_TITLE);
-
- // Changes to the Text Viewer's document instance should also
- // force an
- // input refresh
- fTextEditor.getTextViewer().addTextInputListener(new TextInputListener());
- }
-
- /**
- * Connects the design viewer with the viewer selection manager. Should be
- * done after createSourcePage() is done because we need to get the
- * ViewerSelectionManager from the TextEditor. setModel is also done here
- * because getModel() needs to reference the TextEditor.
- */
- private void connectDesignPage() {
- if (fDesignViewer != null) {
- fDesignViewer.setDocument(getDocument());
- }
-
- /*
- * Connect selection from the Design page to the selection provider
- * for the XMLMultiPageEditorPart so that selection changes in the
- * Design page will propagate across the workbench
- */
- if (fDesignViewer.getSelectionProvider() instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) fDesignViewer.getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (getActivePage() != fSourcePageIndex) {
- ((MultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
- }
- }
- });
- }
- fDesignViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (getActivePage() != fSourcePageIndex) {
- ((MultiPageSelectionProvider) getSite().getSelectionProvider()).fireSelectionChanged(event);
- }
- }
- });
-
- fDesignViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (getActivePage() != fSourcePageIndex) {
- try {
- updateStatusLine(event.getSelection());
- }
- catch (Exception exception) {
- Logger.logException(exception);
- }
- }
- }
- });
-
- /*
- * Handle double-click in the Design page by selecting the
- * corresponding amount of text in the Source page.
- *
- * Warning: This implies more knowledge of the design viewer's underlying
- * Control than expressed in the IDesignViewer interface
- */
- fDesignViewer.getControl().addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event event) {
- ISelection selection = fDesignViewer.getSelectionProvider().getSelection();
- int start = -1;
- int length = -1;
- if (selection instanceof IStructuredSelection) {
- /*
- * selection goes from the start of the first object to
- * the end of the last
- */
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- Object o = structuredSelection.getFirstElement();
- Object o2 = null;
- if (structuredSelection.size() > 1) {
- o2 = structuredSelection.toArray()[structuredSelection.size() - 1];
- }
- else {
- o2 = o;
- }
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o).getStartOffset();
- length = ((IndexedRegion) o2).getEndOffset() - start;
- }
- else if (o2 instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- length = ((ITextRegion) o2).getEnd() - start;
- }
- }
- else if (selection instanceof ITextSelection) {
- start = ((ITextSelection) selection).getOffset();
- length = ((ITextSelection) selection).getLength();
- }
- if ((start > -1) && (length > -1)) {
- getTextEditor().selectAndReveal(start, length);
- }
- }
- });
-
- /*
- * Connect selection from the Source page to the selection provider of
- * the Design page so that selection in the Source page will drive
- * selection in the Design page. Prefer post selection.
- */
- ISelectionProvider provider = getTextEditor().getSelectionProvider();
- if (fTextEditorSelectionListener == null) {
- fTextEditorSelectionListener = new TextEditorPostSelectionAdapter();
- }
- if (provider instanceof IPostSelectionProvider) {
- fTextEditorSelectionListener.forcePostSelection = false;
- ((IPostSelectionProvider) provider).addPostSelectionChangedListener(fTextEditorSelectionListener);
- }
- else {
- fTextEditorSelectionListener.forcePostSelection = true;
- provider.addSelectionChangedListener(fTextEditorSelectionListener);
- }
- }
-
- /**
- * Create and Add the Design Page using a registered factory
- *
- */
- private void createAndAddDesignPage() {
- IDesignViewer designViewer = createDesignPage();
-
- fDesignViewer = designViewer;
- // note: By adding the design page as a Control instead of an
- // IEditorPart, page switches will indicate
- // a "null" active editor when the design page is made active
- if (fDesignContainer != null)
- fDesignPageIndex = addPage(fDesignContainer);
- else
- fDesignPageIndex = addPage(designViewer.getControl());
-
- setPageText(fDesignPageIndex, designViewer.getTitle());
- }
-
- protected IDesignViewer createDesignPage() {
- Composite container = getDesignContainer(getContainer());
-
- XMLTableTreeViewer tableTreeViewer = new XMLTableTreeViewer(container);
- tableTreeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- // Set the default info-pop for XML design viewer.
- XMLUIPlugin.getInstance().getWorkbench().getHelpSystem().setHelp(tableTreeViewer.getControl(), XMLTableTreeHelpContextIds.XML_DESIGN_VIEW_HELPID);
-
- // Toolbar wasn't allocated
- if (fToolbarManager != null && fEditorManager != null) {
- addToolBarActions(tableTreeViewer);
- addEditorActions(tableTreeViewer);
- }
- return tableTreeViewer;
- }
-
- protected Composite getDesignContainer(Composite defaultContainer) {
- Composite container = defaultContainer;
- // create a container to hold the toolbar if it should be created
- if (fAllocateToolbar) {
- container = new Composite(defaultContainer, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- container.setLayout(layout);
-
- Composite toolbarContainer = new Composite(container, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- layout.horizontalSpacing = 0;
- layout.numColumns = 2;
- toolbarContainer.setLayout(layout);
- toolbarContainer.setLayoutData(new GridData(GridData.END, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
-
- ToolBar tb = new ToolBar(toolbarContainer, SWT.FLAT | SWT.NO_BACKGROUND);
- fToolbarManager = new ToolBarManager(tb);
- tb.setLayoutData(new GridData(GridData.END, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
- tb = new ToolBar(toolbarContainer, SWT.FLAT | SWT.NO_BACKGROUND);
- fEditorManager = new ToolBarManager(tb);
- tb.setLayoutData(new GridData(GridData.END, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
- fDesignContainer = container;
- }
- return container;
- }
-
- private class EditorActions extends Action {
- private ToolBar fToolbar;
-
- public EditorActions(ToolBar toolbar) {
- fToolbar = toolbar;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImageHelper.EDITOR_MENU);
- }
-
- public String getToolTipText() {
- return XMLEditorMessages.EditorMenu_tooltip;
- }
-
- public void run() {
- Menu menu = fMenuManager.createContextMenu(fDesignContainer);
- Point size = fToolbar.getSize();
- Point location = fToolbar.toDisplay(0, size.y);
- menu.setLocation(location.x, location.y);
- menu.setVisible(true);
- }
- }
-
- private void addToolBarActions(IDesignViewer viewer) {
- if (viewer instanceof AbstractTreeViewer) {
- ViewerExpandCollapseAction expand = new ViewerExpandCollapseAction(true);
- ViewerExpandCollapseAction collapse = new ViewerExpandCollapseAction(false);
- fToolbarManager.add(expand);
- fToolbarManager.add(collapse);
- fToolbarManager.update(true);
-
-
- expand.setViewer((AbstractTreeViewer) viewer);
- collapse.setViewer((AbstractTreeViewer) viewer);
- }
- }
-
- private void addEditorActions(IDesignViewer viewer) {
- if (viewer instanceof AbstractTreeViewer) {
- final Tree tree = (Tree) ((AbstractTreeViewer) viewer).getControl();
- fMenuManager = new MenuManager();
- fMenuManager.add(new Action(XMLEditorMessages.ConfigureColumns_label) {
- public void run() {
- ConfigureColumns.forTree(tree , new SameShellProvider(tree));
- }
- });
- getSite().registerContextMenu("org.eclipse.wst.xml.ui.editor", fMenuManager, getSite().getSelectionProvider()); //$NON-NLS-1$
- fMenuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
- fEditorManager.add(new EditorActions(fEditorManager.getControl()));
- fEditorManager.update(true);
- }
- }
-
- /**
- * Creates the pages of this multi-page editor.
- * <p>
- * Subclasses of <code>MultiPageEditor</code> must implement this method.
- * </p>
- */
- protected void createPages() {
- try {
- // source page MUST be created before design page, now
- createSourcePage();
-
- createAndAddDesignPage();
- addSourcePage();
- connectDesignPage();
-
- // set the active editor in the action bar contributor first
- // before setactivepage calls action bar contributor's
- // setactivepage (bug141013 - remove when bug151488 is fixed)
- IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
- if (contributor instanceof MultiPageEditorActionBarContributor) {
- ((MultiPageEditorActionBarContributor) contributor).setActiveEditor(this);
- }
-
- int activePageIndex = getPreferenceStore().getInt(getEditorSite().getId() + "." + IXMLPreferenceNames.LAST_ACTIVE_PAGE); //$NON-NLS-1$;
- if ((activePageIndex >= 0) && (activePageIndex < getPageCount())) {
- setActivePage(activePageIndex);
- }
- else {
- setActivePage(fSourcePageIndex);
- }
- }
- catch (PartInitException e) {
- Logger.logException(e);
- throw new RuntimeException(e);
- }
- }
-
- /**
- * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
- */
- protected IEditorSite createSite(IEditorPart editor) {
- IEditorSite site = null;
- if (editor == fTextEditor) {
- site = new MultiPageEditorSite(this, editor) {
- /**
- * @see org.eclipse.ui.part.MultiPageEditorSite#getActionBarContributor()
- */
- public IEditorActionBarContributor getActionBarContributor() {
- IEditorActionBarContributor contributor = super.getActionBarContributor();
- IEditorActionBarContributor multiContributor = XMLMultiPageEditorPart.this.getEditorSite().getActionBarContributor();
- if (multiContributor instanceof XMLMultiPageEditorActionBarContributor) {
- contributor = ((XMLMultiPageEditorActionBarContributor) multiContributor).sourceViewerActionContributor;
- }
- return contributor;
- }
-
- public String getId() {
- // sets this id so nested editor is considered xml source
- // page
- return ContentTypeIdForXML.ContentTypeID_XML + ".source"; //$NON-NLS-1$;
- }
- };
- }
- else {
- site = super.createSite(editor);
- }
- return site;
- }
-
- /**
- * Creates the source page of the multi-page editor.
- */
- protected void createSourcePage() throws PartInitException {
- fTextEditor = createTextEditor();
- fTextEditor.setEditorPart(this);
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=134301 - XML editor
- * does not remember font settings
- *
- * @see
- * org.eclipse.ui.texteditor.AbstractTextEditor#getSymbolicFontName()
- */
- fPageInitializer.sendInitializationData(fTextEditor);
-
- if (fPropertyListener == null) {
- fPropertyListener = new PropertyListener();
- }
- fTextEditor.addPropertyListener(fPropertyListener);
- }
-
- /**
- * Method createTextEditor.
- *
- * @return StructuredTextEditor
- */
- private StructuredTextEditor createTextEditor() {
- return new StructuredTextEditor();
- }
-
- private void disconnectDesignPage() {
- if (fDesignViewer != null) {
- fDesignViewer.setDocument(null);
- }
- }
-
- public void dispose() {
- Logger.trace("Source Editor", "XMLMultiPageEditorPart::dispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
-
- disconnectDesignPage();
-
- if (fActivationListener != null) {
- fActivationListener.dispose();
- fActivationListener = null;
- }
-
- if (fMenuManager != null) {
- fMenuManager.removeAll();
- fMenuManager.dispose();
- fMenuManager = null;
- }
-
- if ((fTextEditor != null) && (fPropertyListener != null)) {
- fTextEditor.removePropertyListener(fPropertyListener);
- }
-
- // moved to last when added window ... seems like
- // we'd be in danger of losing some data, like site,
- // or something.
- super.dispose();
-
- Logger.trace("Source Editor", "StructuredTextMultiPageEditorPart::dispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- fTextEditor.doSave(monitor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#doSaveAs()
- */
- public void doSaveAs() {
- fTextEditor.doSaveAs();
- /*
- * Update the design viewer since the editor input would have changed
- * to the new file.
- */
- if (fDesignViewer != null) {
- fDesignViewer.setDocument(getDocument());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class key) {
- Object result = null;
-
- // we extend superclass, not override it, so allow it first
- // chance to satisfy request.
- result = super.getAdapter(key);
-
- if (result == null) {
- if (key == IDesignViewer.class) {
- result = fDesignViewer;
-
- }
- else if (key.equals(IGotoMarker.class)) {
- result = new IGotoMarker() {
- public void gotoMarker(IMarker marker) {
- XMLMultiPageEditorPart.this.gotoMarker(marker);
- }
- };
- }
- else {
- /*
- * DMW: I'm bullet-proofing this because its been reported (on
- * very early versions) a null pointer sometimes happens here
- * on startup, when an editor has been left open when
- * workbench shutdown.
- */
- if (fTextEditor != null) {
- result = fTextEditor.getAdapter(key);
- }
- }
- }
- return result;
- }
-
- private IDocument getDocument() {
- IDocument document = null;
- if (fTextEditor != null) {
- final IDocumentProvider provider = fTextEditor.getDocumentProvider();
- if (provider != null) {
- document = provider.getDocument(fTextEditor.getEditorInput());
- }
- }
- return document;
- }
-
- private IPreferenceStore getPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- StructuredTextEditor getTextEditor() {
- return fTextEditor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPart#getTitle()
- */
- public String getTitle() {
- String title = null;
- if (getTextEditor() == null) {
- if (getEditorInput() != null) {
- title = getEditorInput().getName();
- }
- }
- else {
- title = getTextEditor().getTitle();
- }
- if (title == null) {
- title = getPartName();
- }
- return title;
- }
-
- void gotoMarker(IMarker marker) {
- setActivePage(fSourcePageIndex);
- IDE.gotoMarker(fTextEditor, marker);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- try {
- super.init(site, input);
- // we want to listen for our own activation
- fActivationListener = new ActivationListener(site.getWorkbenchWindow().getPartService());
- }
- catch (Exception e) {
- Logger.logException("exception initializing " + getClass().getName(), e); //$NON-NLS-1$
- }
- setPartName(input.getName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return (fTextEditor != null) && fTextEditor.isSaveAsAllowed();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#isSaveOnCloseNeeded()
- */
- public boolean isSaveOnCloseNeeded() {
- // overriding super class since it does a lowly isDirty!
- if (fTextEditor != null) {
- return fTextEditor.isSaveOnCloseNeeded();
- }
- return isDirty();
- }
-
- /**
- * Prevents the creation of the in-editor toolbar, if called before
- * createPageContainer() during editor initialization.
- */
- protected final void noToolbar() {
- fAllocateToolbar = false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.MultiPageEditorPart#pageChange(int)
- */
- protected void pageChange(int newPageIndex) {
- if (newPageIndex == fSourcePageIndex) {
- ISelectionProvider provider = fDesignViewer.getSelectionProvider();
- if (provider != null) {
- getTextEditor().getSelectionProvider().setSelection(provider.getSelection());
- }
- }
- super.pageChange(newPageIndex);
- saveLastActivePageIndex(newPageIndex);
-
- if (newPageIndex == fDesignPageIndex) {
- // design page isn't an IEditorPart, therefore we have to send
- // selection changes ourselves
- ISelectionProvider selectionProvider = fDesignViewer.getSelectionProvider();
- if (selectionProvider != null) {
- SelectionChangedEvent event = new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection());
- ((MultiPageSelectionProvider) getSite().getSelectionProvider()).fireSelectionChanged(event);
- ((MultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
- }
- }
- }
-
- private void saveLastActivePageIndex(int newPageIndex) {
- // save the last active page index to preference manager
- getPreferenceStore().setValue(getEditorSite().getId() + "." + IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex); //$NON-NLS-1$
- }
-
- public void setFocus() {
- super.setFocus();
- Control control = fDesignViewer.getControl();
- control.setFocus();
- // 271382 - Focus not set properly after activating XML editor
- control.forceFocus();
- }
-
- public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
- super.setInitializationData(cfig, propertyName, data);
- fPageInitializer = new PageInitializationData(cfig, propertyName, data);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
- */
- protected void setInput(IEditorInput input) {
- /*
- * If driven from the Source page, it's "model" may not be up to date
- * with (or even exist for) the input just yet. Later notification
- * from the TextViewer could set us straight, although it's not
- * guaranteed to happen after the model has been created.
- */
- super.setInput(input);
- if (fDesignViewer != null) {
- fDesignViewer.setDocument(getDocument());
- }
- setPartName(input.getName());
- }
-
- void updateStatusLine(ISelection selection) {
- IStatusLineManager statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
- if (fStatusLineLabelProvider != null && statusLineManager != null) {
- String text = null;
- Image image = null;
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- if (firstElement != null) {
- text = fStatusLineLabelProvider.getText(firstElement);
- image = fStatusLineLabelProvider.getImage((firstElement));
- }
- }
- if (image == null) {
- statusLineManager.setMessage(text);
- }
- else {
- statusLineManager.setMessage(image, text);
- }
- }
- }
-
- public INavigationLocation createEmptyNavigationLocation() {
- if (getActivePage() == fDesignPageIndex) {
- return new DesignPageNavigationLocation(this, fDesignViewer, false);
- }
- // Makes sure that the text editor is returned
- return new TextSelectionNavigationLocation(fTextEditor, false) {
- protected IEditorPart getEditorPart() {
- IEditorPart part = super.getEditorPart();
- if (part != null) {
- part = (ITextEditor) part.getAdapter(ITextEditor.class);
- }
- return part;
- }
- };
- }
-
- public INavigationLocation createNavigationLocation() {
- if (getActivePage() == fDesignPageIndex) {
- return new DesignPageNavigationLocation(this, fDesignViewer, true);
- }
- // Makes sure that the text editor is returned
- return new TextSelectionNavigationLocation(fTextEditor, true) {
- protected IEditorPart getEditorPart() {
- IEditorPart part = super.getEditorPart();
- if (part != null) {
- part = (ITextEditor) part.getAdapter(ITextEditor.class);
- }
- return part;
- }
- };
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
deleted file mode 100644
index 4af5032074..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * David Carver - bug 212330 - migrate to org.eclipse.ui.menus extension point
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Document;
-
-/**
- *
- */
-public class XMLTableTreeActionBarContributor implements IDesignViewerActionBarContributor {
-
- protected IEditorPart editorPart;
- protected final static String DESIGN_VIEWER_SEPARATOR_1_ID = "sed.tabletree.separator.1"; //$NON-NLS-1$
- protected final static String DESIGN_VIEWER_SEPARATOR_2_ID = "sed.tabletree.separator.2"; //$NON-NLS-1$
- protected final static String VALIDATE_XML_ID = "sed.tabletree.validateXML"; //$NON-NLS-1$
- protected final static String RELOAD_GRAMMAR_ID = "sed.tabletree.reloadGrammar"; //$NON-NLS-1$
- protected final static String TOGGLE_EDIT_MODE_ID = "sed.tabletree.toggleEditMode"; //$NON-NLS-1$
- protected final static String EXPAND_ALL_ID = "sed.tabletree.expandAll"; //$NON-NLS-1$
- protected final static String COLLAPSE_ALL_ID = "sed.tabletree.collapseAll"; //$NON-NLS-1$
-
- protected ToggleEditModeAction toggleAction;
- protected ReloadGrammarAction reloadGrammarAction;
- // protected ValidateXMLAction validateXMLAction;
- protected ViewerExpandCollapseAction expandAction;
- protected ViewerExpandCollapseAction collapseAction;
- protected ViewerExpandCollapseAction xmlMenuExpandAction;
- protected ViewerExpandCollapseAction xmlMenuCollapseAction;
-
- public XMLTableTreeActionBarContributor() {
- }
-
- protected void removeContributions(IContributionManager manager) {
-/* try {
- doRemove(manager, DESIGN_VIEWER_SEPARATOR_1_ID);
- doRemove(manager, DESIGN_VIEWER_SEPARATOR_2_ID);
- doRemove(manager, VALIDATE_XML_ID);
- doRemove(manager, RELOAD_GRAMMAR_ID);
- doRemove(manager, TOGGLE_EDIT_MODE_ID);
- doRemove(manager, EXPAND_ALL_ID);
- doRemove(manager, COLLAPSE_ALL_ID);
- }
- catch (Exception e) {
- }
-*/
- }
-
- protected void doRemove(IContributionManager manager, String id) {
-/* try {
- if (manager.find(id) != null) {
- manager.remove(id);
- }
- }
- catch (Exception e) {
- }
-*/ }
-
- public void init(IActionBars bars, IWorkbenchPage page) {
- init(bars);
- }
-
- public void init(IActionBars bars) {
-// IToolBarManager tbm = bars.getToolBarManager();
-
-/* IMenuManager xmlMenu = bars.getMenuManager().findMenuUsingPath("org.eclipse.core.runtime.xml.design.xmlmenu"); //$NON-NLS-1$
-
- if (xmlMenu == null) {
- xmlMenu = new MenuManager(XMLEditorMessages.XMLTableTreeActionBarContributor_0, "org.eclipse.core.runtime.xml.design.xmlmenu"); //$NON-NLS-1$
- // For RCP usage
- if (bars.getMenuManager().find(IWorkbenchActionConstants.M_WINDOW) != null) {
- bars.getMenuManager().insertBefore(IWorkbenchActionConstants.M_WINDOW, xmlMenu);
- }
- }
- else {
- removeContributions(xmlMenu);
- }
-
- tbm.add(new Separator("DESIGN_VIEWER_SEPARATOR_1_ID")); //$NON-NLS-1$
-*/
- // ToggleEditModeAction
- //
-/* toggleAction = new ToggleEditModeAction();
- toggleAction.setId(TOGGLE_EDIT_MODE_ID);
- xmlMenu.add(toggleAction);
- tbm.add(toggleAction);
-*/
- // ReloadGrammarAction
- //
-/* reloadGrammarAction = new ReloadGrammarAction();
- reloadGrammarAction.setId(RELOAD_GRAMMAR_ID);
- tbm.add(reloadGrammarAction);
- xmlMenu.add(reloadGrammarAction);
-
- xmlMenu.add(new Separator());
-*/
- // ExpandCollapseAction
- //
-/* xmlMenuExpandAction = new ViewerExpandCollapseAction(true);
- xmlMenuExpandAction.setId(EXPAND_ALL_ID);
- xmlMenuExpandAction.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_1);
- xmlMenu.add(xmlMenuExpandAction);
-
- xmlMenuCollapseAction = new ViewerExpandCollapseAction(false);
- xmlMenuCollapseAction.setId(COLLAPSE_ALL_ID);
- xmlMenuCollapseAction.setId(EXPAND_ALL_ID);
- xmlMenuCollapseAction.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_2);
- xmlMenu.add(xmlMenuCollapseAction);
-*/
- }
-
- protected void addActionWithId(IMenuManager menuManager, Action action, String id) {
- action.setId(id);
- menuManager.add(action);
- }
-
- public void initViewerSpecificContributions(IActionBars bars) {
-/* IToolBarManager tbm = bars.getToolBarManager();
- tbm.add(new Separator(DESIGN_VIEWER_SEPARATOR_2_ID));
-
- expandAction = new ViewerExpandCollapseAction(true);
- expandAction.setId(EXPAND_ALL_ID);
- tbm.add(expandAction);
-
- collapseAction = new ViewerExpandCollapseAction(false);
- collapseAction.setId(COLLAPSE_ALL_ID);
- tbm.add(collapseAction);
-*/
- }
-
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
-/* if (expandAction != null) {
- expandAction.setEnabled(enabled);
- xmlMenuExpandAction.setEnabled(enabled);
- }
-
- if (collapseAction != null) {
- collapseAction.setEnabled(enabled);
- xmlMenuCollapseAction.setEnabled(enabled);
- }
-*/
- }
-
- public void setActiveEditor(IEditorPart targetEditor) {
- editorPart = targetEditor;
-
-// IStructuredModel model = getModelForEditorPart(targetEditor);
-/* reloadGrammarAction.setModel(model);
- toggleAction.setModelQuery(ModelQueryUtil.getModelQuery(model));
-
- XMLTableTreeViewer tableTreeViewer = getTableTreeViewerForEditorPart(editorPart);
- if (tableTreeViewer != null) {
- expandAction.setViewer(tableTreeViewer);
- collapseAction.setViewer(tableTreeViewer);
-
- xmlMenuExpandAction.setViewer(tableTreeViewer);
- xmlMenuCollapseAction.setViewer(tableTreeViewer);
- }
-*/
- if (editorPart instanceof XMLMultiPageEditorPart) {
- IWorkbenchPartSite site = editorPart.getSite();
- if (site instanceof IEditorSite) {
- ITextEditor textEditor = ((XMLMultiPageEditorPart) editorPart).getTextEditor();
- IActionBars actionBars = ((IEditorSite) site).getActionBars();
- actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO));
- actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO));
- }
- }
-
- // TODO... uncomment this and investigate NPE
- //
- // add the cut/copy/paste for text fields
- // ActionHandlerPlugin.connectPart(editorPart);
- }
-
- protected final IAction getAction(ITextEditor editor, String actionId) {
- return (editor == null ? null : editor.getAction(actionId));
- }
-
- /**
- * @deprecated - not to be used
- */
- protected IStructuredModel getModelForEditorPart(IEditorPart targetEditor) {
- IStructuredModel result = null;
- if (editorPart instanceof XMLMultiPageEditorPart) {
- StructuredTextEditor textEditor = ((XMLMultiPageEditorPart) targetEditor).getTextEditor();
- result = (textEditor != null) ? textEditor.getModel() : null;
- }
- return result;
- }
-
- /**
- * @deprecated - not to be used
- */
- protected XMLTableTreeViewer getTableTreeViewerForEditorPart(IEditorPart targetEditor) {
- XMLTableTreeViewer result = null;
- Object object = targetEditor.getAdapter(IDesignViewer.class);
- if (object instanceof XMLTableTreeViewer) {
- result = (XMLTableTreeViewer) object;
- }
- return result;
- }
-
- /**
- *
- */
- public class ToggleEditModeAction extends Action {
- protected ImageDescriptor onImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINON);
- protected ImageDescriptor offImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINOFF);
- protected ModelQuery modelQuery;
-
- public ToggleEditModeAction() {
- setAppearanceForEditMode(ModelQuery.EDIT_MODE_CONSTRAINED_STRICT);
- }
-
- public void run() {
- if (modelQuery != null) {
- int newState = getNextState(modelQuery.getEditMode());
- modelQuery.setEditMode(newState);
- setAppearanceForEditMode(newState);
- }
- }
-
- public void setModelQuery(ModelQuery newModelQuery) {
- modelQuery = newModelQuery;
- if (modelQuery != null) {
- setAppearanceForEditMode(modelQuery.getEditMode());
- }
- }
-
- public void setAppearanceForEditMode(int editMode) {
- if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
- setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_3);
- setText(XMLEditorMessages.XMLTableTreeActionBarContributor_4);
- setImageDescriptor(onImage);
- }
- else {
- setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_5);
- setText(XMLEditorMessages.XMLTableTreeActionBarContributor_6);
- setImageDescriptor(offImage);
- }
- }
-
- public int getNextState(int editMode) {
- int result = -1;
- if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
- result = ModelQuery.EDIT_MODE_UNCONSTRAINED;
- }
- else {
- result = ModelQuery.EDIT_MODE_CONSTRAINED_STRICT;
- }
- return result;
- }
- }
-
- /**
- *
- */
- public class ReloadGrammarAction extends Action {
- protected IStructuredModel model;
-
- public ReloadGrammarAction() {
- setDisabledImageDescriptor(SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_DTOOL_RLDGRMR));
- setImageDescriptor(SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_RLDGRMR));
- setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_7);
- setText(XMLEditorMessages.XMLTableTreeActionBarContributor_8);
- }
-
- public void setModel(IStructuredModel newModel) {
- this.model = newModel;
- }
-
- public void run() {
- if (model != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(model);
- Document document = ((IDOMModel) model).getDocument();
- if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
- modelQuery.getCMDocumentManager().getCMDocumentCache().clear();
- // TODO... need to figure out how to access the
- // DOMObserver via ModelQuery
- // ...why?
- CMDocumentLoader loader = new InferredGrammarBuildingCMDocumentLoader(document, modelQuery);
- loader.loadCMDocuments();
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
deleted file mode 100644
index e756ed7483..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
+++ /dev/null
@@ -1,384 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableColorProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-public class XMLTableTreeContentProvider implements ITreeContentProvider, ITableLabelProvider, ITableColorProvider, ILabelProvider, CMDocumentManagerListener {
-
- protected CMDocumentManager documentManager;
-
- StructuredViewer fViewer = null;
-
- private TreeContentHelper treeContentHelper = new TreeContentHelper();
-
- private CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
-
- private Color fCMColor = null;
-
- public XMLTableTreeContentProvider() {
- super();
- }
-
- //
- // ILabelProvider stuff
- //
- public void addListener(ILabelProviderListener listener) {
- // since we always return 'false' for "isLabelProperty",
- // not need to listen. Maybe that should change some day?
- }
-
- // CMDocumentManagerListener
- //
- public void cacheCleared(CMDocumentCache cache) {
- doDelayedRefreshForViewers();
- }
-
- public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
- if ((newStatus == CMDocumentCache.STATUS_LOADED) || (newStatus == CMDocumentCache.STATUS_ERROR)) {
- doDelayedRefreshForViewers();
- }
- }
-
- public void dispose() {
- if (documentManager != null) {
- documentManager.removeListener(this);
- }
- if (fViewer != null && fViewer.getInput() != null) {
- if (fViewer.getInput() instanceof IDOMNode) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) fViewer.getInput()).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.removeListener(fViewer);
- }
- }
- }
- if (fCMColor != null) {
- fCMColor.dispose();
- }
- }
-
- private void doDelayedRefreshForViewers() {
- if ((fViewer != null) && !fViewer.getControl().isDisposed()) {
- fViewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if ((fViewer != null) && !fViewer.getControl().isDisposed()) {
- fViewer.refresh(true);
- }
- }
- });
- }
- }
-
- public Object[] getChildren(Object element) {
- if (element instanceof INodeNotifier) {
- ((INodeNotifier) element).getAdapterFor(IJFaceNodeAdapter.class);
- }
- return treeContentHelper.getChildren(element);
- }
-
- public Image getColumnImage(Object object, int columnIndex) {
- return (columnIndex == 0) ? getImage(object) : null;
- }
-
- //
- // ITableLabelProvider stuff
- //
- public String getColumnText(Object object, int column) {
- String result = null;
- if (column == 0) {
- result = getText(object);
- }
- else if ((column == 1) && (object instanceof Node)) {
- result = treeContentHelper.getNodeValue((Node) object);
- if (result == null)
- result = getElementValueHelper((Element) object);
-
- }
- result = TextProcessor.process(result);
- return result != null ? result : ""; //$NON-NLS-1$
- }
-
- private String getElementValueHelper(Element element) {
- String result = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if ((result == null) && (mq != null)) {
- CMElementDeclaration ed = mq.getCMElementDeclaration(element);
- if ((ed != null) && !Boolean.TRUE.equals(ed.getProperty("isInferred"))) { //$NON-NLS-1$
- result = descriptionBuilder.buildDescription(ed);
- }
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
-
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
-
- public Image getImage(Object object) {
- if (object instanceof INodeNotifier) {
- ((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
- }
-
- Image image = null;
- if (object instanceof Node) {
- Node node = (Node) object;
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION);
- break;
- }
- case Node.COMMENT_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_COMMENT);
- break;
- }
- case Node.DOCUMENT_TYPE_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_DOCTYPE);
- break;
- }
- case Node.ELEMENT_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ELEMENT);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_PROCESSINGINSTRUCTION);
- break;
- }
- case Node.TEXT_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_TXTEXT);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE : {
- image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY_REFERENCE);
- break;
- }
- }
-
- // if (image != null) {
- // Image markerOverlayImage =
- // overlayIconManager.getOverlayImageForObject(node);
- // if (markerOverlayImage != null) {
- // image = imageFactory.createCompositeImage(image,
- // markerOverlayImage, ImageFactory.BOTTOM_LEFT);
- // }
- // }
- }
- return image;
- }
-
- public Object getParent(Object o) {
- if (o instanceof INodeNotifier) {
- ((INodeNotifier) o).getAdapterFor(IJFaceNodeAdapter.class);
- }
-
- Object result = null;
- if (o instanceof Node) {
- Node node = (Node) o;
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- result = ((Attr) node).getOwnerElement();
- }
- else {
- result = node.getParentNode();
- }
- }
- return result;
- }
-
- public Element getRootElement(Document document) {
- Element rootElement = null;
-
- for (Node childNode = document.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- rootElement = (Element) childNode;
- break;
- }
- }
- return rootElement;
- }
-
- public String getText(Object object) {
- if (object instanceof INodeNotifier) {
- ((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
- }
-
- String result = null;
- if (object instanceof Node) {
- Node node = (Node) object;
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE : {
- result = node.getNodeName();
- break;
- }
- case Node.DOCUMENT_TYPE_NODE : {
- result = "DOCTYPE"; //$NON-NLS-1$
- break;
- }
- case Node.ELEMENT_NODE : {
- result = node.getNodeName();
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- result = ((ProcessingInstruction) node).getTarget();
- break;
- }
- }
- }
- result = TextProcessor.process(result);
- return result != null ? result : ""; //$NON-NLS-1$
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // remove our listeners to the old state
- if (oldInput != null) {
- Document domDoc = (Document) oldInput;
- ModelQuery mq = ModelQueryUtil.getModelQuery(domDoc);
- if (mq != null) {
- documentManager = mq.getCMDocumentManager();
- if (documentManager != null) {
- documentManager.removeListener(this);
- }
- }
- }
-
- if ((oldInput != null) && (oldInput instanceof IDOMNode)) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) oldInput).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.removeListener(viewer);
- }
- }
-
- if (viewer instanceof StructuredViewer) {
- fViewer = null;
- }
- else {
- fViewer = (StructuredViewer) viewer;
- }
-
- if ((newInput != null) && (newInput instanceof IDOMNode)) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) newInput).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.addListener(viewer);
- }
- }
-
- if (newInput != null) {
- Document domDoc = (Document) newInput;
- ModelQuery mq = ModelQueryUtil.getModelQuery(domDoc);
-
- if (mq != null) {
- documentManager = mq.getCMDocumentManager();
- if (documentManager != null) {
- documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
- documentManager.addListener(this);
- }
- }
- }
- }
-
- public boolean isDeleted(Object element) {
- return element != null;
- }
-
- // the following methods handle filtering aspects of the viewer
- //
- //
- public boolean isIgnorableText(Node node) {
- boolean result = false;
- try {
- if (node.getNodeType() == Node.TEXT_NODE) {
- String data = ((Text) node).getData();
- result = ((data == null) || (data.trim().length() == 0));
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- return result;
- }
-
- public boolean isLabelProperty(Object object, String property) {
- return false;
- }
-
- public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
- if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
- doDelayedRefreshForViewers();
- }
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // since we always return 'false' for "isLabelProperty",
- // not need to listen. Maybe that should change some day?
- }
-
- public Color getBackground(Object element, int columnIndex) {
- return null;
- }
-
- public Color getForeground(Object element, int columnIndex) {
- if (columnIndex == 1 && treeContentHelper.getNodeValue((Node) element) == null)
- return getCMColor();
- return null;
- }
-
- private Color getCMColor() {
- if (fCMColor == null) {
- Color background = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- int r = Math.abs(background.getRed() - 125);
- int g = Math.abs(background.getGreen() - 85);
- int b = Math.abs(background.getBlue() - 105);
- fCMColor = new Color(Display.getCurrent(), r, g, b);
- }
- return fCMColor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java
deleted file mode 100644
index 60bc4df222..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java
+++ /dev/null
@@ -1,31 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-
-/**
- * Help context ids for the TableTree view.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented or extended.
- * </p>
- *
- */
-public interface XMLTableTreeHelpContextIds {
- // org.eclipse.wst.xml.ui.
- public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
-
- // XML Design View
- public static final String XML_DESIGN_VIEW_HELPID = PREFIX + "xmlm3000"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java
deleted file mode 100644
index b929b4cf32..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java
+++ /dev/null
@@ -1,118 +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.xml.ui.internal.tabletree;
-
-import java.util.List;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.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.ui.internal.properties.EnumeratedStringPropertyDescriptor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-public class XMLTableTreePropertyDescriptorFactory extends DOMPropertyDescriptorFactory {
-
- protected TreeContentHelper treeContentHelper = new TreeContentHelper();
-
- public XMLTableTreePropertyDescriptorFactory() {
- super();
- }
-
- protected IPropertyDescriptor createPropertyDescriptorHelper(String name, Element element, CMNode cmNode) {
- IPropertyDescriptor result = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- String[] valuesArray = null;
- if (mq != null) {
- valuesArray = mq.getPossibleDataTypeValues(element, cmNode);
- }
- if ((valuesArray != null) && (valuesArray.length > 0)) {
- result = new EnumeratedStringPropertyDescriptor(name, name, valuesArray);
- }
- else {
- result = createDefaultPropertyDescriptor(name);
- }
-
- return result;
- }
-
- public IPropertyDescriptor createTextPropertyDescriptor(Text text) {
- IPropertyDescriptor result = null;
- Node parentNode = text.getParentNode();
- if ((parentNode != null) && (parentNode.getNodeType() == Node.ELEMENT_NODE)) {
- Element parentElement = (Element) parentNode;
- ModelQuery mq = ModelQueryUtil.getModelQuery(text.getOwnerDocument());
- CMElementDeclaration ed = null;
- if (mq != null) {
- ed = mq.getCMElementDeclaration(parentElement);
- }
- if (ed != null) {
- result = createPropertyDescriptorHelper(HACK, parentElement, ed);
- }
- else {
- result = createDefaultPropertyDescriptor(parentElement.getNodeName());
- }
- }
-
- if (result == null) {
- result = new TextPropertyDescriptor(HACK, HACK);
- }
-
- return result;
- }
-
- public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
- IPropertyDescriptor result = null;
-
- String attributeName = attr.getName();
- ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
-
- CMAttributeDeclaration ad = null;
- if (mq != null) {
- ad = mq.getCMAttributeDeclaration(attr);
- }
- if (ad != null) {
- result = createPropertyDescriptorHelper(attributeName, attr.getOwnerElement(), ad);
- }
-
- if (result == null) {
- result = new TextPropertyDescriptor(attributeName, attributeName);
- }
-
- return result;
- }
-
- public IPropertyDescriptor createElementPropertyDescriptor(Element element) {
- IPropertyDescriptor result = null;
- List list = treeContentHelper.getElementTextContent(element);
- if (list != null) {
- Text text = treeContentHelper.getEffectiveTextNodeForCombinedNodeList(list);
- if (text != null) {
- result = createTextPropertyDescriptor(text);
- }
- }
-
- if (result == null) {
- result = new TextPropertyDescriptor(HACK, HACK);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
deleted file mode 100644
index 22579aac48..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationListener;
-import org.eclipse.jface.viewers.ColumnViewerEditorDeactivationEvent;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSource;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DragSourceListener;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.DropTargetListener;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-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.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.actions.NodeAction;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.dnd.DragNodeCommand;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class XMLTableTreeViewer extends TreeViewer implements IDesignViewer {
-
- class NodeActionMenuListener implements IMenuListener {
- public void menuAboutToShow(IMenuManager menuManager) {
- // used to disable NodeSelection listening while running
- // NodeAction
- XMLNodeActionManager nodeActionManager = new XMLNodeActionManager(((IDOMDocument) getInput()).getModel(), XMLTableTreeViewer.this) {
- public void beginNodeAction(NodeAction action) {
- super.beginNodeAction(action);
- }
-
- public void endNodeAction(NodeAction action) {
- super.endNodeAction(action);
- }
- };
- nodeActionManager.fillContextMenu(menuManager, getSelection());
- }
- }
-
- private class SelectionProvider implements IPostSelectionProvider {
-
- public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
- XMLTableTreeViewer.this.addPostSelectionChangedListener(listener);
- }
-
- public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
- XMLTableTreeViewer.this.removePostSelectionChangedListener(listener);
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- XMLTableTreeViewer.this.addSelectionChangedListener(listener);
- }
-
- public ISelection getSelection() {
- return XMLTableTreeViewer.this.getSelection();
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- XMLTableTreeViewer.this.removeSelectionChangedListener(listener);
- }
-
- public void setSelection(ISelection selection) {
- boolean selectionSet = false;
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) selection;
-
- if (structuredSelection.size() == 1) {
- if (structuredSelection.getFirstElement() instanceof IDOMNode) {
- IDOMNode domNode = (IDOMNode) structuredSelection.getFirstElement();
- IStructuredDocumentRegion startStructuredDocumentRegion = domNode.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- ITextRegion matchingRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(textSelection.getOffset());
- int allowedIterations = 40;
- while (matchingRegion != null && !matchingRegion.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && allowedIterations > 0) {
- matchingRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(startStructuredDocumentRegion.getStartOffset(matchingRegion) - 1);
- allowedIterations--;
- }
- if (matchingRegion != null && matchingRegion.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- String attrName = startStructuredDocumentRegion.getText(matchingRegion);
- NamedNodeMap attributes = domNode.getAttributes();
- if (attributes != null && attrName.length() > 0) {
- Node attr = attributes.getNamedItem(attrName);
- if (attr != null) {
- selectionSet = true;
- XMLTableTreeViewer.this.setSelection(new StructuredSelection(attr));
- }
- }
- }
- }
- }
- }
- }
- }
- if (!selectionSet) {
- XMLTableTreeViewer.this.setSelection(selection);
- }
- }
- }
-
- private PaintListener fContentPaintListener = new PaintListener() {
-
- public void paintControl(PaintEvent e) {
- GC gc = e.gc;
- if (getTree().getItemCount() == 0) {
- gc.setForeground(getTree().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- gc.setBackground(getTree().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- gc.drawString(XMLEditorMessages.XMLTreeExtension_3, 10, 10);
- gc.drawString(XMLEditorMessages.XMLTreeExtension_4, 10, 10 + gc.getFontMetrics().getHeight());
- }
- }
-
- };
-
- private ISelectionProvider fSelectionProvider = new SelectionProvider();
- // node: 40%, content: 60%
- static final double[] WEIGHTS = { .4, .6 };
-
- private ControlAdapter fResizeAdapter = new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- sizeColumns(getTree().getSize().x, WEIGHTS);
- }
-
- private void sizeColumns(int width, double[] weights) {
- TreeColumn[] columns = getTree().getColumns();
- int size = columns.length;
- for (int i = 0; i < size; i++) {
- columns[i].setWidth((int)(weights[i] * width));
- }
- }
- };
-
- public XMLTableTreeViewer(Composite parent) {
- super(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-
- TreeColumn column = new TreeColumn(this.getTree(), SWT.LEFT);
- column.setText(XMLEditorMessages.XMLTableTreeViewer_1);
-
- column = new TreeColumn(this.getTree(), SWT.LEFT);
- column.setText(XMLEditorMessages.XMLTableTreeViewer_2);
-
- this.getTree().setHeaderVisible(true);
- this.getTree().setLinesVisible(true);
- getTree().addControlListener(fResizeAdapter);
-
- // set up providers
- propertyDescriptorFactory = new XMLTableTreePropertyDescriptorFactory();
-
- XMLTableTreeContentProvider provider = new XMLTableTreeContentProvider();
- setContentProvider(provider);
- setLabelProvider(provider);
-
- setColumnProperties(new String[] {STRUCTURE_PROPERTY, VALUE_PROPERTY});
- setCellEditors(new CellEditor[] {null, new TextCellEditor(this.getTree())});
-
- setCellModifier(new XMLCMCellModifier());
- createContextMenu();
-
- DragSource dragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
- dragSource.addDragListener(createDragSourceListener());
- dragSource.setTransfer(new Transfer[] {LocalSelectionTransfer.getTransfer()});
- DropTarget dropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
- dropTarget.addDropListener(createDropTargetListener());
- dropTarget.setTransfer(new Transfer[] {LocalSelectionTransfer.getTransfer()});
-
- this.getTree().addPaintListener(fContentPaintListener);
- }
-
- /**
- * This creates a context menu for the viewer and adds a listener as well
- * registering the menu for extension.
- */
- protected void createContextMenu() {
- MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
- contextMenu.add(new Separator("additions")); //$NON-NLS-1$
- contextMenu.setRemoveAllWhenShown(true);
- contextMenu.addMenuListener(new NodeActionMenuListener());
- Menu menu = contextMenu.createContextMenu(getControl());
- getControl().setMenu(menu);
- }
-
- private DragSourceListener createDragSourceListener() {
- return new DragSourceListener() {
- public void dragFinished(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(null);
- }
-
- public void dragSetData(DragSourceEvent event) {
- }
-
- public void dragStart(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(getSelection());
- }
- };
- }
-
- private DropTargetListener createDropTargetListener() {
- return new DropTargetListener() {
- public void dragEnter(DropTargetEvent event) {
- }
-
- public void dragLeave(DropTargetEvent event) {
- }
-
- public void dragOperationChanged(DropTargetEvent event) {
- }
-
- public void drop(DropTargetEvent event) {
- if (event.operations != DND.DROP_NONE && LocalSelectionTransfer.getTransfer().getSelection() instanceof IStructuredSelection) {
- dragOver(event);
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- if (selection != null && !selection.isEmpty() && event.item != null && event.item.getData() != null) {
- /*
- * the command uses these numbers instead of the
- * feedback constants (even though it converts in
- * the other direction as well)
- */
- float feedbackFloat = getHeightInItem(event);
-
- final DragNodeCommand command = new DragNodeCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList(), XMLTableTreeViewer.this);
- if (command != null && command.canExecute()) {
- SafeRunnable.run(new SafeRunnable() {
- public void run() throws Exception {
- command.execute();
- }
- });
- }
- }
- }
- }
-
- public void dropAccept(DropTargetEvent event) {
- }
-
- public void dragOver(DropTargetEvent event) {
- event.feedback = DND.FEEDBACK_SELECT;
- float feedbackFloat = getHeightInItem(event);
- if (feedbackFloat > 0.75) {
- event.feedback = DND.FEEDBACK_INSERT_AFTER;
- }
- else if (feedbackFloat < 0.25) {
- event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- }
- event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
- if ( getLocalNodeSelection(event) == null){
- event.detail = DND.DROP_NONE;
- }
- }
-
- private IStructuredSelection getLocalNodeSelection(DropTargetEvent event){
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- if (selection != null && !selection.isEmpty() ) {
- for (Iterator i = selection.iterator(); i.hasNext();) {
- Object node = i.next();
- if (node instanceof Node){
- return selection;
- }
- }
- }
- return null;
- }
- private float getHeightInItem(DropTargetEvent event) {
- if(event.item == null) return .5f;
- if (event.item instanceof TreeItem) {
- TreeItem treeItem = (TreeItem) event.item;
- Control control = treeItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = treeItem.getBounds();
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else if (event.item instanceof TableItem) {
- TableItem tableItem = (TableItem) event.item;
- Control control = tableItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = tableItem.getBounds(0);
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else {
- return 0.0F;
- }
- }
- };
- }
-
- protected void doRefresh(Object o, boolean fromDelayed) {
- super.refresh(o);
- }
-
- public ISelectionProvider getSelectionProvider() {
- return fSelectionProvider;
- }
-
- public String getTitle() {
- return XMLEditorMessages.XMLTableTreeViewer_0;
- }
-
- protected void handleDispose(DisposeEvent event) {
- super.handleDispose(event);
- this.getTree().removePaintListener(fContentPaintListener);
- getTree().removeControlListener(fResizeAdapter);
- setDocument(null);
- }
-
- public void setDocument(IDocument document) {
- /*
- * let the text editor to be the one that manages the model's lifetime
- */
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-
- if ((model != null) && (model instanceof IDOMModel)) {
- Document domDoc = null;
- domDoc = ((IDOMModel) model).getDocument();
- setInput(domDoc);
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
-
- }
-
- protected TreeContentHelper treeContentHelper = new TreeContentHelper();
- protected XMLTableTreePropertyDescriptorFactory propertyDescriptorFactory;
-
- private final static String STRUCTURE_PROPERTY = XMLEditorMessages.XMLTreeExtension_0;
- private final static String VALUE_PROPERTY = XMLEditorMessages.XMLTreeExtension_1;
-
- private class CellListener extends ColumnViewerEditorActivationListener implements ICellEditorListener {
-
- private Node node;
- private CellEditor editor;
- private String originalValue;
-
- CellListener(Node data, CellEditor editor) {
- this.node = data;
- this.editor = editor;
-
- originalValue = treeContentHelper.getNodeValue(node);
- ((IDOMNode) node).getModel().aboutToChangeModel();
- }
-
- public void applyEditorValue() {
- editor.removeListener(this);
- }
-
- public void cancelEditor() {
- final Object value = editor.getValue();
- if (value != null && !value.equals(originalValue)) {
- treeContentHelper.setNodeValue(node, originalValue);
- }
- editor.removeListener(this);
- }
-
- public void editorValueChanged(boolean oldValidState, boolean newValidState) {
- if (newValidState) {
- treeContentHelper.setNodeValue(node, editor.getValue().toString(), getControl().getShell());
- }
- }
-
- public void beforeEditorActivated(ColumnViewerEditorActivationEvent event) {
- }
-
- public void afterEditorActivated(ColumnViewerEditorActivationEvent event) {
- }
-
- public void beforeEditorDeactivated(ColumnViewerEditorDeactivationEvent event) {
- }
-
- public void afterEditorDeactivated(ColumnViewerEditorDeactivationEvent event) {
- ((IDOMNode) node).getModel().changedModel();
- getColumnViewerEditor().removeEditorActivationListener(this);
- }
-
- }
-
- public class XMLCMCellModifier implements ICellModifier, TreeExtension.ICellEditorProvider {
- public boolean canModify(Object element, String property) {
- boolean result = false;
- if (element instanceof Node) {
- Node node = (Node) element;
- if (property == VALUE_PROPERTY) {
- result = treeContentHelper.isEditable(node);
- if (result) {
- /* Set up the cell editor based on the element */
- CellEditor[] editors = getCellEditors();
- if (editors.length > 0) {
- if (editors[1] != null)
- editors[1].dispose();
- editors[1] = getCellEditor(element, 1);
- if (editors[1] instanceof TextCellEditor) {
- final CellListener listener = new CellListener(node, editors[1]);
- getColumnViewerEditor().addEditorActivationListener(listener);
- editors[1].addListener(listener);
- }
- }
- }
-
- }
- }
- return result;
- }
-
- public Object getValue(Object object, String property) {
- String result = null;
- if (object instanceof Node) {
- result = treeContentHelper.getNodeValue((Node) object);
- }
- return (result != null) ? result : ""; //$NON-NLS-1$
- }
-
- public void modify(Object element, String property, Object value) {
- Item item = (Item) element;
- String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
- String newValue = value.toString();
- if ((newValue != null) && !newValue.equals(oldValue)) {
- treeContentHelper.setNodeValue((Node) item.getData(), value.toString(), getControl().getShell());
- }
- }
-
- public CellEditor getCellEditor(Object o, int col) {
- IPropertyDescriptor pd = propertyDescriptorFactory.createPropertyDescriptor(o);
- return pd != null ? pd.createPropertyEditor(XMLTableTreeViewer.this.getTree()) : null;
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
deleted file mode 100644
index b8601f8015..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
+++ /dev/null
@@ -1,174 +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.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- * @deprecated No longer used
- */
-public class XMLTreeExtension extends TreeExtension {
-
- public final static String STRUCTURE_PROPERTY = XMLEditorMessages.XMLTreeExtension_0;
- public final static String VALUE_PROPERTY = XMLEditorMessages.XMLTreeExtension_1;
-
- protected Composite control;
- protected MyCellModifier modifier;
- protected XMLTableTreePropertyDescriptorFactory propertyDescriptorFactory;
- protected CMDescriptionBuilder decriptionBuilder = new CMDescriptionBuilder();
- protected TreeContentHelper treeContentHelper = new TreeContentHelper();
-
- protected Color f1, f2, b1, b2;
- protected boolean cachedDataIsValid = true;
-
- public XMLTreeExtension(Tree tree) {
- super(tree);
- control = tree;
- modifier = new MyCellModifier();
- setCellModifier(modifier);
- String[] properties = {STRUCTURE_PROPERTY, VALUE_PROPERTY};
- setColumnProperties(properties);
-
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=185851 - Used to be hardcoded as COLOR_BLACK */
- f1 = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- Color background = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-
- int r = Math.abs(background.getRed() - 125);
- int g = Math.abs(background.getGreen() - 85);
- int b = Math.abs(background.getBlue() - 105);
-
- f2 = new Color(tree.getDisplay(), r, g, b);
- b1 = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
- b2 = background;
-
- propertyDescriptorFactory = new XMLTableTreePropertyDescriptorFactory();
- }
-
- public void dispose() {
- super.dispose();
- f2.dispose();
- }
-
- public void resetCachedData() {
- cachedDataIsValid = false;
- }
-
- public void paintItems(GC gc, TreeItem[] items, Rectangle treeBounds) {
- super.paintItems(gc, items, treeBounds);
- cachedDataIsValid = true;
- }
-
- protected Object[] computeTreeExtensionData(Object object) {
- Color color = f1;
- String string = ""; //$NON-NLS-1$
- if (string.length() == 0) {
- string = (String) modifier.getValue(object, VALUE_PROPERTY);
- color = f1;
- }
- if ((string.length() == 0) && (object instanceof Element)) {
- string = getElementValueHelper((Element) object);
- color = f2;
- }
- Object[] data = new Object[2];
- data[0] = string;
- data[1] = color;
- return data;
- }
-
- protected void paintItem(GC gc, TreeItem item, Rectangle bounds) {
- super.paintItem(gc, item, bounds);
- Object[] data = computeTreeExtensionData(item.getData());
- if ((data != null) && (data.length == 2)) {
- gc.setClipping(columnPosition, bounds.y + 1, controlWidth, bounds.height);
- gc.setForeground((Color) data[1]);
- gc.drawString((String) data[0], columnPosition + 5, bounds.y + 1);
- gc.setClipping((Rectangle) null);
- }
- }
-
- protected void addEmptyTreeMessage(GC gc) {
- // here we print a message when the document is empty just to give the
- // user a visual cue
- // so that they know how to proceed to edit the blank view
- gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
- gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- gc.drawString(XMLEditorMessages.XMLTreeExtension_3, 10, 10);
- gc.drawString(XMLEditorMessages.XMLTreeExtension_4, 10, 10 + gc.getFontMetrics().getHeight());
- }
-
- public String getElementValueHelper(Element element) {
- String result = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if ((result == null) && (mq != null)) {
- CMElementDeclaration ed = mq.getCMElementDeclaration(element);
- if ((ed != null) && !Boolean.TRUE.equals(ed.getProperty("isInferred"))) { //$NON-NLS-1$
- result = decriptionBuilder.buildDescription(ed);
- }
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
-
- /**
- *
- */
- public class MyCellModifier implements ICellModifier, TreeExtension.ICellEditorProvider {
- public boolean canModify(Object element, String property) {
- boolean result = false;
- if (element instanceof Node) {
- Node node = (Node) element;
- result = (property == VALUE_PROPERTY) && treeContentHelper.isEditable(node);
- }
- return result;
- }
-
- public Object getValue(Object object, String property) {
- String result = null;
- if (object instanceof Node) {
- result = treeContentHelper.getNodeValue((Node) object);
- }
- return (result != null) ? result : ""; //$NON-NLS-1$
- }
-
- public void modify(Object element, String property, Object value) {
- // enableNodeSelectionListener(false);
- Item item = (Item) element;
- String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
- String newValue = value.toString();
- if ((newValue != null) && !newValue.equals(oldValue)) {
- treeContentHelper.setNodeValue((Node) item.getData(), value.toString());
- }
- // enableNodeSelectionListener(true);
- }
-
- public CellEditor getCellEditor(Object o, int col) {
- IPropertyDescriptor pd = propertyDescriptorFactory.createPropertyDescriptor(o);
- return pd != null ? pd.createPropertyEditor(control) : null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
deleted file mode 100644
index ff3bea2100..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
+++ /dev/null
@@ -1,41 +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.xml.ui.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Validation
- */
-public class XMLValidationUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.validation.xmlvalidation"; //$NON-NLS-1$
-
- private XMLValidationUIMessages() {
- // cannot create new instance
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, XMLValidationUIMessages.class);
- }
- public static String _UI_REF_FILE_ERROR_DESCRIPTION;
- public static String _UI_REF_FILE_ERROR_MESSAGE;
- public static String _UI_REF_FILE_ERROR_DETAILS;
- public static String _UI_DETAILS_INFORMATION_UNAVAILABLE;
- public static String _UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
- public static String _UI_SAVE_DIRTY_FILE_MESSAGE;
- public static String _UI_SAVE_DIRTY_FILE_TITLE;
- public static String TaskListTableViewer_0;
- public static String TaskListTableViewer_1;
- public static String TaskListTableViewer_2;
- public static String TaskListTableViewer_3;
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java
deleted file mode 100644
index 7c3e9bc485..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IMarker;
-
-
-/**
- * Custom property tester used to determine if the groupName attribute is
- * present on a marker and that its value starts with a given expected value.
- */
-public class GroupNamePropertyTester extends PropertyTester
-{
- /**
- * The group name prefix property name.
- */
- private static final String GROUP_NAME_PREFIX = "groupNamePrefix"; //$NON-NLS-1$
-
- /**
- * The group name marker attribute.
- */
- private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
- {
- if (GROUP_NAME_PREFIX.equals(property))
- {
- if (receiver instanceof IMarker)
- {
- IMarker marker = (IMarker)receiver;
-
- String groupName = marker.getAttribute(GROUP_NAME, null);
-
- boolean testValue = groupName != null && expectedValue instanceof String && groupName.startsWith((String)expectedValue);
- return testValue;
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java
deleted file mode 100644
index 4cc9f29d4a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java
+++ /dev/null
@@ -1,254 +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.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-
-public class ReferencedFileErrorDialog extends Dialog {
- protected TaskListTableViewer tableViewer;
- protected List errorList;
- protected String markedUpDetailsMessage;
- protected String contextFile;
- protected String referencedFile;
- protected StyledText styledText;
- protected Text fullFileNameField;
-
- public ReferencedFileErrorDialog(Shell parentShell, List errorList, String contextFile, String referencedFile) {
- super(parentShell);
-
- int styleBits = getShellStyle() | SWT.RESIZE;
- styleBits &= ~SWT.APPLICATION_MODAL;
-
- setShellStyle(styleBits);
- this.errorList = errorList;
-
- this.referencedFile = referencedFile;
- this.contextFile = contextFile;
- this.markedUpDetailsMessage = getMarkedUpDetailsMessage();
- }
-
- public int createAndOpen() {
- create();
- getShell().setText(XMLValidationUIMessages._UI_REF_FILE_ERROR_DETAILS);
-
- setBlockOnOpen(false);
- return open();
- }
-
-
- protected Control createButtonBar(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fullFileNameField = new Text(composite, SWT.NONE);
- fullFileNameField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fullFileNameField.setBackground(parent.getBackground());
- fullFileNameField.setEditable(false);
-
- super.createButtonBar(composite);
-
- return composite;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- dialogArea.setLayout(new GridLayout());
-
- Composite c = new Composite(dialogArea, SWT.NONE);
- c.setLayout(new GridLayout());
- c.setLayoutData(createGridData(true, -1, 200));
-
- styledText = new StyledText(c, SWT.MULTI | SWT.WRAP);
- styledText.setBackground(c.getBackground());
- setStyledText(styledText, markedUpDetailsMessage);
- styledText.setEditable(false);
- styledText.setLayoutData(createGridData(false, 650, -1));
-
- MouseListener mouseListener = new MouseListener();
- styledText.addMouseMoveListener(mouseListener);
-
- tableViewer = new TaskListTableViewer(c, 10);
- tableViewer.setInput(errorList);
- tableViewer.addSelectionChangedListener(new InternalSelectionListener());
- tableViewer.getControl().setLayoutData(createGridData(true, 700, -1));
- return dialogArea;
- }
-
- String getFullURI(int offset) {
- String uri = ""; //$NON-NLS-1$
- int index = getIndex(offset);
- if (index != -1) {
- if ((index == 0) || (index == 2) || (index == 3)) {
- uri = referencedFile;
- }
- else {
- uri = contextFile;
- }
- }
- return uri;
- }
-
- private int getIndex(int offset) {
- int result = -1;
- StyleRange[] range = styledText.getStyleRanges();
- for (int i = 0; i < range.length; i++) {
- int l = range[i].start;
- int r = l + range[i].length;
- if ((l <= offset) && (r >= offset)) {
- result = i;
- break;
- }
- }
- return result;
- }
-
- class MouseListener implements MouseMoveListener {
- public void mouseMove(MouseEvent event) {
- String toolTipText = ""; //$NON-NLS-1$
- try {
-
- int offset = styledText.getOffsetAtLocation(new Point(event.x, event.y));
- toolTipText = getFullURI(offset);
-
- }
- catch (Exception e) {
- // Do nothing.
- }
- styledText.setToolTipText(toolTipText);
- if ((toolTipText != null) && (toolTipText.length() > 0)) {
- fullFileNameField.setText(toolTipText);
- }
- }
- }
-
- private String getMarkedUpDetailsMessage() {
- String detailsMessage = ""; //$NON-NLS-1$
- // TODO... need to move '_UI_REF_FILE_ERROR_DESCRIPTION' to this
- // plugin's properties file
- //
- String string = XMLValidationUIMessages._UI_REF_FILE_ERROR_DESCRIPTION;
- // TODO... need to edit the properties file to remove "'" characters
- // from the string
- // I'm using these characters to markup the bold font. It's safer if I
- // add these programtically.
- //
- string = removePattern(string, "'"); //$NON-NLS-1$
-
- String c = "'" + getLastSegment(contextFile) + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- String r = "'" + getLastSegment(referencedFile) + "'"; //$NON-NLS-1$ //$NON-NLS-2$
-
- detailsMessage = NLS.bind(string, new Object[]{r, c, r, c});
- return detailsMessage;
- }
-
- private String removePattern(String string, String pattern) {
- while (true) {
- int index = string.indexOf(pattern);
- if (index != -1) {
- string = string.substring(0, index) + string.substring(index + pattern.length());
- }
- else {
- break;
- }
- }
- return string;
- }
-
- private void setStyledText(StyledText styledText, String text) {
- String visibleMessage = ""; //$NON-NLS-1$
- for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", false); st.hasMoreTokens();) //$NON-NLS-1$
- {
- String token = st.nextToken();
- visibleMessage += token;
- }
-
- styledText.setText(visibleMessage);
- // dw Font font = styledText.getFont();
-
- boolean inQuote = false;
- int position = 0;
- for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", true); st.hasMoreTokens();) //$NON-NLS-1$
- {
- String token = st.nextToken();
-
- if (token.equals("'")) //$NON-NLS-1$
- {
- inQuote = !inQuote;
- }
- else {
- if (inQuote) {
- try {
-
- StyleRange style = new StyleRange(position, token.length(), styledText.getForeground(), styledText.getBackground(), SWT.BOLD);
- styledText.setStyleRange(style);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- position = position + token.length();
- }
- }
- }
-
- private static GridData createGridData(boolean fillBoth, int w, int h) {
- GridData gd = new GridData(fillBoth ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
- gd.widthHint = w;
- gd.heightHint = h;
- return gd;
- }
-
- private static String getLastSegment(String uri) {
- String result = uri;
- int index = Math.max(uri.lastIndexOf("/"), uri.lastIndexOf("\\")); //$NON-NLS-1$ //$NON-NLS-2$
- if (index != -1) {
- result = uri.substring(index + 1);
- }
- return result;
- }
-
- protected class InternalSelectionListener implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection) {
- ValidationMessage validationMessage = (ValidationMessage) ((StructuredSelection) selection).getFirstElement();
- if (validationMessage != null) {
- String uristring = validationMessage.getUri();
- ReferencedFileErrorUtility.openEditorAndGotoError(uristring, validationMessage.getLineNumber(), validationMessage.getColumnNumber());
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
deleted file mode 100644
index 378ee89867..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.net.URL;
-
-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.core.runtime.content.IContentType;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-
-
-public class ReferencedFileErrorUtility {
- public static void openEditorAndGotoError(String uristring, final int line, final int column) {
- if (uristring != null) {
- try {
- URL uri = new URL(uristring);
- if (uri != null) {
- if ("file".equals(uri.getProtocol())) //$NON-NLS-1$
- {
- String pathString = uri.getPath();
- IPath path = new Path(pathString);
- String device = path.getDevice();
- if ((device != null) && device.startsWith("/")) //$NON-NLS-1$
- {
- path = path.setDevice(device.substring(1));
- }
- final IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- if ((iFile != null) && iFile.exists()) {
- // Open the editor for this file.
- final IWorkbench workbench = PlatformUI.getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IContentType contentType = iFile.getContentDescription().getContentType();
- IEditorRegistry editorRegistry = workbench.getEditorRegistry();
- String fileName = iFile.getName();
- IEditorDescriptor descriptor = editorRegistry.getDefaultEditor(fileName, contentType);
- String editorId;
- if (descriptor != null) {
- editorId = descriptor.getId();
- }
- else {
- descriptor = editorRegistry.getDefaultEditor(fileName + ".txt"); //$NON-NLS-1$
- editorId = descriptor.getId();
- }
-
- if (editorId != null)
- {
- FileEditorInput editorInput = new FileEditorInput(iFile);
- IWorkbenchPage activePage = workbenchWindow.getActivePage();
- activePage.openEditor(editorInput, editorId);
- }
- }
- catch (Exception ex) {
- LoggerFactory.getLoggerInstance().logError("Exception encountered when attempting to open file: " + iFile + "\n\n", ex); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- });
-
- Runnable runnable = new Runnable() {
- public void run() {
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- gotoError(editorPart, line, column);
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
- }
- }
- }
- catch (Exception e) {
- // Do nothing.
- }
- }
- }
-
- static void gotoError(IEditorPart editorPart, int line, int column) {
- if (editorPart != null) {
- TextEditor textEditor = (TextEditor) editorPart.getAdapter(TextEditor.class);
- if (textEditor != null) {
- try {
- IDocumentProvider dp = textEditor.getDocumentProvider();
- IDocument document = (dp != null) ? dp.getDocument(textEditor.getEditorInput()) : null;
- textEditor.selectAndReveal(document.getLineOffset(line - 1) + column - 1, 0);
- }
- catch (BadLocationException x) {
- // marker refers to invalid text position -> do nothing
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java
deleted file mode 100644
index 3db624374e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.views.markers.MarkerViewHandler;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-
-/**
- * Handler for the referenced file errors command. This class replaces the old
- * ReferencedFileErrorActionDelegate.
- */
-public class ReferencedFileErrorsHandler extends MarkerViewHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException
- {
- final IMarker[] selectedMarkers = getSelectedMarkers(event);
-
- IMarker selectedMarker = selectedMarkers[0];
-
- if (selectedMarker != null)
- {
- try
- {
-
- IResource resource = selectedMarker.getResource();
- Map map = (Map)resource.getSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME);
- if (map == null)
- {
- String infoUnavailable = XMLValidationUIMessages._UI_DETAILS_INFORMATION_UNAVAILABLE;
- String revalidateToRegenerateErrors = XMLValidationUIMessages._UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
- MessageDialog.openInformation(Display.getCurrent().getActiveShell(), infoUnavailable, revalidateToRegenerateErrors);
- }
- else
- {
- String uri = null;
-
- String groupName = (String)selectedMarker.getAttribute("groupName"); //$NON-NLS-1$
- if (groupName.startsWith("referencedFileError")) //$NON-NLS-1$
- {
- int index1 = groupName.indexOf("("); //$NON-NLS-1$
- int index2 = groupName.lastIndexOf(")"); //$NON-NLS-1$
- if ((index1 != -1) && (index2 > index1))
- {
- uri = groupName.substring(index1 + 1, index2);
- }
- }
-
- if (uri != null)
- {
- List list = Collections.EMPTY_LIST;
-
- ValidationMessage message = (ValidationMessage)map.get(uri);
- if (message != null)
- {
- list = message.getNestedMessages();
- }
-
- IPath resourceLocation = resource.getLocation();
-
- if (resourceLocation != null)
- {
- String validatedFileURI = resourceLocation.toOSString();
- validatedFileURI = "file:/" + validatedFileURI; //$NON-NLS-1$
-
- ReferencedFileErrorDialog dialog = new ReferencedFileErrorDialog(
- HandlerUtil.getActiveShell(event),
- list,
- validatedFileURI,
- uri);
- dialog.createAndOpen();
- }
- }
- }
- }
- catch (CoreException e)
- {
- // Do nothing.
- }
- }
-
- return this;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java
deleted file mode 100644
index 433edf7601..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java
+++ /dev/null
@@ -1,159 +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.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-
-
-public class TaskListTableViewer extends TableViewer {
- protected static final int COLUMN_ICON = 0;
- protected static final int COLUMN_DESCRIPTION = 1;
- protected static final int COLUMN_RESOURCE = 3;
- protected static final int COLUMN_LOCATION = 2;
-
- protected static final String LABEL_ICON = ""; //$NON-NLS-1$
- protected static final String LABEL_DESCRIPTION = XMLValidationUIMessages.TaskListTableViewer_0;
- protected static final String LABEL_RESOURCE = XMLValidationUIMessages.TaskListTableViewer_1;
- protected static final String LABEL_LOCATION = XMLValidationUIMessages.TaskListTableViewer_2;
-
- protected int visibleRows = -1;
-
- protected int getColumnWidth(int column) {
- int result = 0;
- switch (column) {
- case COLUMN_ICON : {
- result = 1;
- break;
- }
- case COLUMN_DESCRIPTION : {
- result = 20;
- break;
- }
- case COLUMN_RESOURCE : {
- result = 3;
- break;
- }
- case COLUMN_LOCATION : {
- result = 3;
- break;
- }
- }
- return result;
- }
-
- public TaskListTableViewer(Composite parent, int visibleRows) {
- this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows);
- }
-
- public TaskListTableViewer(Composite parent, int style, int visibleRows) {
- super(new Table(parent, style));
- getTable().setLinesVisible(true);
-
- Provider provider = new Provider();
- setContentProvider(provider);
- setLabelProvider(provider);
-
- String[] columnPropertiesArray = {LABEL_ICON, LABEL_DESCRIPTION, LABEL_LOCATION};
- setColumnProperties(columnPropertiesArray);
-
- Table table = getTable();
- table.setHeaderVisible(true);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- TableLayout layout = new TableLayout();
-
- for (int i = 0; i < columnPropertiesArray.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnPropertiesArray[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
- }
-
- table.setLayout(layout);
-
- this.visibleRows = visibleRows;
- }
-
- /**
- * NamespaceInfoTableLabelProvider
- */
- protected class Provider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider {
- Viewer viewer;
- Image errorImage;
- Image warnImage;
-
- public Provider() {
- errorImage = XMLUIPlugin.getInstance().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-
- warnImage = XMLUIPlugin.getInstance().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
- }
-
- public Object[] getElements(Object inputElement) {
- List list = (List) viewer.getInput();
- return list != null ? list.toArray() : null;
- }
-
- public Image getColumnImage(Object object, int columnIndex) {
- ValidationMessage validationMessage = (ValidationMessage) object;
- Image result = null;
- if (columnIndex == 0) {
- int severity = validationMessage.getSeverity();
- if ((severity == IMessage.HIGH_SEVERITY) || (severity == IMessage.NORMAL_SEVERITY)) {
- result = errorImage;
- }
- else {
- result = warnImage;
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int column) {
- ValidationMessage errorMessage = (ValidationMessage) object;
- String result = ""; //$NON-NLS-1$
- switch (column) {
- case COLUMN_DESCRIPTION : {
- result = errorMessage.getMessage();
- break;
- }
- case COLUMN_LOCATION : {
- result = XMLValidationUIMessages.TaskListTableViewer_3 + errorMessage.getLineNumber();
- break;
- }
- }
- return result;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
deleted file mode 100644
index c35c84947b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
+++ /dev/null
@@ -1,29 +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
-###############################################################################
-### Constants for strings
-
-#
-# Referenced File Dialog Related Message
-#
-_UI_REF_FILE_ERROR_DESCRIPTION = The errors below were detected when validating the file "{0}" via the file "{1}". In most cases these errors can be detected by validating "{2}" directly. However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_MESSAGE = Referenced file contains errors ({0}). For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_ERROR_DETAILS = Referenced File Error Details
-
-_UI_DETAILS_INFORMATION_UNAVAILABLE = Details Information Unavailable
-_UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE = Details information currently unavailable. Please revalidate the file to regenerate the error details.
-
-#
-# Dirty File Dialog Related Messages
-#
-TaskListTableViewer_0=Description
-TaskListTableViewer_1=Resource
-TaskListTableViewer_2=Location
-TaskListTableViewer_3=line
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java
deleted file mode 100644
index cd809c778a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.wizards;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-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.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.osgi.framework.Bundle;
-
-public class ExampleProjectCreationOperation implements IRunnableWithProgress {
-
- private IResource elementToOpen;
-
- private IOverwriteQuery overwriteQuery;
-
- private ExampleProjectCreationWizardPage[] pages;
-
- /**
- * Constructor for ExampleProjectCreationOperation
- */
- public ExampleProjectCreationOperation(ExampleProjectCreationWizardPage[] myPages, IOverwriteQuery myOverwriteQuery) {
- elementToOpen = null;
- pages = myPages;
- overwriteQuery = myOverwriteQuery;
- }
-
- private IProject configNewProject(IWorkspaceRoot root, String name, String[] natureIds, IProject[] referencedProjects, IProgressMonitor monitor) throws InvocationTargetException {
- try {
- IProject project = root.getProject(name);
- if (!project.exists()) {
- project.create(null);
- }
- if (!project.isOpen()) {
- project.open(null);
- }
- IProjectDescription desc = project.getDescription();
- desc.setLocation(null);
- desc.setNatureIds(natureIds);
- desc.setReferencedProjects(referencedProjects);
-
- project.setDescription(desc, new SubProgressMonitor(monitor, 1));
-
- return project;
- }
- catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- private void createProject(IWorkspaceRoot root, ExampleProjectCreationWizardPage page, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IConfigurationElement desc = page.getConfigurationElement();
-
- IConfigurationElement[] imports = desc.getChildren("import"); //$NON-NLS-1$
- IConfigurationElement[] natures = desc.getChildren("nature"); //$NON-NLS-1$
- IConfigurationElement[] references = desc.getChildren("references"); //$NON-NLS-1$
- int nImports = (imports == null) ? 0 : imports.length;
- int nNatures = (natures == null) ? 0 : natures.length;
- int nReferences = (references == null) ? 0 : references.length;
-
- monitor.beginTask(XMLWizardsMessages.ExampleProjectCreationOperation_op_desc_proj, nImports + 1);
-
- String name = page.getProjectName();
-
- String[] natureIds = new String[nNatures];
- for (int i = 0; i < nNatures; i++) {
- natureIds[i] = natures[i].getAttribute("id"); //$NON-NLS-1$
- }
- IProject[] referencedProjects = new IProject[nReferences];
- for (int i = 0; i < nReferences; i++) {
- referencedProjects[i] = root.getProject(references[i].getAttribute("id")); //$NON-NLS-1$
- }
-
- IProject proj = configNewProject(root, name, natureIds, referencedProjects, monitor);
-
- for (int i = 0; i < nImports; i++) {
- doImports(proj, imports[i], new SubProgressMonitor(monitor, 1));
- }
-
- String open = desc.getAttribute("open"); //$NON-NLS-1$
- if ((open != null) && (open.length() > 0)) {
- IResource fileToOpen = proj.findMember(new Path(open));
- if (fileToOpen != null) {
- elementToOpen = fileToOpen;
- }
- }
-
- }
-
- private void doImports(IProject project, IConfigurationElement curr, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- IPath destPath;
- String name = curr.getAttribute("dest"); //$NON-NLS-1$
- if ((name == null) || (name.length() == 0)) {
- destPath = project.getFullPath();
- }
- else {
- IFolder folder = project.getFolder(name);
- if (!folder.exists()) {
- folder.create(true, true, null);
- }
- destPath = folder.getFullPath();
- }
- String importPath = curr.getAttribute("src"); //$NON-NLS-1$
- if (importPath == null) {
- importPath = ""; //$NON-NLS-1$
- Logger.log(Logger.ERROR, "projectsetup descriptor: import missing"); //$NON-NLS-1$
- return;
- }
-
- ZipFile zipFile = getZipFileFromPluginDir(importPath, getContributingPlugin(curr));
- importFilesFromZip(zipFile, destPath, new SubProgressMonitor(monitor, 1));
- }
- catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- private String getContributingPlugin(IConfigurationElement configurationElement) {
- Object parent = configurationElement;
- while (parent != null) {
- if (parent instanceof IExtension) {
- return ((IExtension) parent).getNamespace();
- }
- parent = ((IConfigurationElement) parent).getParent();
- }
- return null;
- }
-
- public IResource getElementToOpen() {
- return elementToOpen;
- }
-
- private ZipFile getZipFileFromPluginDir(String pluginRelativePath, String symbolicName) throws CoreException {
- try {
- Bundle bundle = Platform.getBundle(symbolicName);
- URL starterURL = new URL(bundle.getEntry("/"), pluginRelativePath); //$NON-NLS-1$
- return new ZipFile(Platform.asLocalURL(starterURL).getFile());
- }
- catch (IOException e) {
- String message = pluginRelativePath + ": " + e.getMessage(); //$NON-NLS-1$
- Status status = new Status(IStatus.ERROR, XMLUIPlugin.ID, IStatus.ERROR, message, e);
- throw new CoreException(status);
- }
- }
-
- private void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
- ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, overwriteQuery);
- op.run(monitor);
- }
-
- /*
- * @see IRunnableWithProgress#run(IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- try {
- monitor.beginTask(XMLWizardsMessages.ExampleProjectCreationOperation_op_desc, pages.length);
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-
- for (int i = 0; i < pages.length; i++) {
- createProject(root, pages[i], new SubProgressMonitor(monitor, 1));
- }
- }
- finally {
- monitor.done();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java
deleted file mode 100644
index d968c92071..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-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.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class ExampleProjectCreationWizard extends Wizard implements INewWizard, IExecutableExtension {
-
- private class ImportOverwriteQuery implements IOverwriteQuery {
-
- private int openDialog(final String file) {
- final int[] result = {IDialogConstants.CANCEL_ID};
- getShell().getDisplay().syncExec(new Runnable() {
- public void run() {
- String title = XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_title;
- String msg = NLS.bind(XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_message, file);
- String[] options = {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
- MessageDialog dialog = new MessageDialog(getShell(), title, null, msg, MessageDialog.QUESTION, options, 0);
- result[0] = dialog.open();
- }
- });
- return result[0];
- }
-
- public String queryOverwrite(String file) {
- String[] returnCodes = {YES, NO, ALL, CANCEL};
- int returnVal = openDialog(file);
- return returnVal < 0 ? CANCEL : returnCodes[returnVal];
- }
- }
-
- private IConfigurationElement wizardConfigElement;
- private IConfigurationElement exampleConfigElement;
-
- private String EXAMPLE_WIZARD_XP_ID = "org.eclipse.wst.common.ui.exampleProjectCreationWizard"; //$NON-NLS-1$
-
- private ExampleProjectCreationWizardPage[] pages;
-
- private final String WEB_BROWSER_ID = "org.eclipse.ui.browser.editor"; //$NON-NLS-1$
-
- public ExampleProjectCreationWizard() {
- super();
- setDialogSettings(XMLUIPlugin.getDefault().getDialogSettings());
- setWindowTitle(XMLWizardsMessages.ExampleProjectCreationWizard_title);
- setNeedsProgressMonitor(true);
- }
-
- /*
- * @see Wizard#addPages
- */
- public void addPages() {
- super.addPages();
-
- if (exampleConfigElement == null) {
- return;
- }
- IConfigurationElement[] children = exampleConfigElement.getChildren("projectsetup"); //$NON-NLS-1$
- if ((children == null) || (children.length == 0)) {
- Logger.log(Logger.ERROR, "descriptor must contain one ore more projectsetup tags"); //$NON-NLS-1$
- return;
- }
-
- pages = new ExampleProjectCreationWizardPage[children.length];
-
- for (int i = 0; i < children.length; i++) {
- pages[i] = new ExampleProjectCreationWizardPage(i, children[i]);
- addPage(pages[i]);
- }
- }
-
- public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
- if (exampleConfigElement != null) {
- String banner = exampleConfigElement.getAttribute("banner"); //$NON-NLS-1$
- if (banner != null) {
- URL imageURL = Platform.find(Platform.getBundle(exampleConfigElement.getDeclaringExtension().getNamespace()), new Path(banner));
- ImageDescriptor desc = ImageDescriptor.createFromURL(imageURL);
- setDefaultPageImageDescriptor(desc);
- }
- }
- }
-
- protected IConfigurationElement[] getExtendedConfigurationElements() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint exampleWizardXP = registry.getExtensionPoint(EXAMPLE_WIZARD_XP_ID);
- if (exampleWizardXP == null) {
- return new IConfigurationElement[0];
- }
- IExtension extension = exampleWizardXP.getExtension(getWizardExtensionId());
- if (extension != null) {
- return extension.getConfigurationElements();
- }
- IConfigurationElement[] exampleWizardCEs = exampleWizardXP.getConfigurationElements();
- return exampleWizardCEs;
- }
-
- private void handleException(Throwable target) {
- String title = XMLWizardsMessages.ExampleProjectCreationWizard_op_error_title;
- String message = XMLWizardsMessages.ExampleProjectCreationWizard_op_error_message;
- if (target instanceof CoreException) {
- IStatus status = ((CoreException) target).getStatus();
- ErrorDialog.openError(getShell(), title, message, status);
- Logger.logException(status.getMessage(), status.getException());
- }
- else {
- MessageDialog.openError(getShell(), title, target.getMessage());
- Logger.logException(target);
- }
- }
-
- private void openResource(final IResource resource) {
- if (resource.getType() != IResource.FILE) {
- return;
- }
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- final IWorkbenchPage activePage = window.getActivePage();
- if (activePage != null) {
- final Display display = getShell().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- try {
- IDE.openEditor(activePage, (IFile) resource, WEB_BROWSER_ID, true);
- }
- catch (PartInitException e) {
- Logger.logException(e);
- }
- }
- });
- BasicNewResourceWizard.selectAndReveal(resource, activePage.getWorkbenchWindow());
- }
- }
-
- /*
- * @see Wizard#performFinish
- */
- public boolean performFinish() {
- ExampleProjectCreationOperation runnable = new ExampleProjectCreationOperation(pages, new ImportOverwriteQuery());
-
- IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
- try {
- getContainer().run(false, true, op);
- }
- catch (InvocationTargetException e) {
- handleException(e.getTargetException());
- return false;
- }
- catch (InterruptedException e) {
- return false;
- }
- BasicNewProjectResourceWizard.updatePerspective(wizardConfigElement);
- IResource res = runnable.getElementToOpen();
- if (res != null) {
- openResource(res);
- }
- return true;
- }
-
- /**
- * Stores the configuration element for the wizard. The config element
- * will be used in <code>performFinish</code> to set the result
- * perspective.
- */
- public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
- wizardConfigElement = cfig;
- String title = wizardConfigElement.getAttribute("name"); //$NON-NLS-1$
- if (title != null) {
- setWindowTitle(title);
- }
- String wizardId = getWizardExtensionId();
- IConfigurationElement[] exampleWizardCEs = getExtendedConfigurationElements();
- for (int i = 0; i < exampleWizardCEs.length; i++) {
- IConfigurationElement element = exampleWizardCEs[i];
- String extWizardId = element.getAttribute("id"); //$NON-NLS-1$
- if ((wizardId != null) && (extWizardId != null) && wizardId.equals(extWizardId)) {
- exampleConfigElement = element;
- }
- }
- // initializeDefaultPageImageDescriptor();
- }
-
- public String getWizardExtensionId() {
- return wizardConfigElement.getAttribute("id"); //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java
deleted file mode 100644
index 3f13b33942..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 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.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-
-public class ExampleProjectCreationWizardPage extends WizardNewProjectCreationPage {
-
- private IConfigurationElement configurationElement;
-
- public ExampleProjectCreationWizardPage(int pageNumber, IConfigurationElement elem) {
-
- super("page" + pageNumber); //$NON-NLS-1$
- configurationElement = elem;
-
- String name = getAttribute(elem, "name"); //$NON-NLS-1$
- setInitialProjectName(calculateInitialProjectName(name));
-
- setDescription(getAttribute(configurationElement, "pagedescription")); //$NON-NLS-1$
- setTitle(getAttribute(configurationElement, "pagetitle")); //$NON-NLS-1$
-
- }
-
- /*
- * Set the default project name that is to appear on the initialPage page
- * of this wizard.
- */
- protected String calculateInitialProjectName(String projectName) {
- IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (!projectHandle.exists()) {
- return projectName;
- }
- // Change the name until it doesn't exists. Try 9 times and then
- // give up.
- for (int i = 1; i < 10; i++) {
- projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName + i);
- if (!projectHandle.exists()) {
- return projectName + i;
- }
- }
- return projectName + "9"; //$NON-NLS-1$
-
- }
-
- private String getAttribute(IConfigurationElement elem, String tag) {
- String res = elem.getAttribute(tag);
- if (res == null) {
- return '!' + tag + '!';
- }
- return res;
- }
-
-
-
- /**
- * Returns the configuration element of this page.
- *
- * @return Returns a IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement() {
- return configurationElement;
- }
-
- /**
- * @see org.eclipse.ui.dialogs.WizardNewProjectCreationPage#validatePage()
- */
- protected boolean validatePage() {
- if (!super.validatePage()) {
- return false;
- }
-
- String projectName = getProjectName();
- if (projectName == null) {
- return false;
- }
-
- IWizard wizard = getWizard();
- if (wizard instanceof ExampleProjectCreationWizard) {
- IWizardPage[] pages = wizard.getPages();
- for (int i = 0; i < pages.length; i++) {
- if ((pages[i] != this) && (pages[i] instanceof ExampleProjectCreationWizardPage)) {
- if (projectName.equals(((ExampleProjectCreationWizardPage) pages[i]).getProjectName())) {
- setErrorMessage(XMLWizardsMessages.ExampleProjectCreationWizardPage_error_alreadyexists);
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java
deleted file mode 100644
index 478d459796..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Standards for Technology in Automotive Retail (STAR) and
- * others. All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver/STAR - dcarver@starstandard.org/d_a_carver@yahoo.com - bug 192568
- * Initial API - This implements the functionality of the
- * old Export Dialog for the XML Catalog.
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IExportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class ExportXMLCatalogWizard extends BasicNewFileResourceWizard implements IExportWizard {
-
- protected WizardNewFileCreationPage exportPage = null;
- protected ICatalog workingUserCatalog = null;
- protected ICatalog userCatalog = null;
-
- public ExportXMLCatalogWizard() {
- setWindowTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_TITLE);
- ImageDescriptor descriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_WIZBAN_GENERATEXML);
- setDefaultPageImageDescriptor(descriptor);
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- userCatalog = referencedCatalog;
- }
- }
- }
- CatalogSet tempCatalogSet = new CatalogSet();
- workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
- workingUserCatalog.addEntriesFromCatalog(userCatalog);
-
- }
-
- public boolean performFinish() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot workspaceRoot = workspace.getRoot();
- String workspacePath = workspaceRoot.getLocation().toOSString();
- String fullPath = workspacePath + exportPage.getContainerFullPath().toOSString();
- String requiredString=fullPath + File.separator + exportPage.getFileName();
- try {
- IFile file = exportPage.createNewFile();
- workingUserCatalog.setLocation(requiredString);
- workingUserCatalog.save();
- file.refreshLocal(IResource.DEPTH_ZERO, null);
- } catch (Exception ex) {
- return false;
- }
- return true;
- }
-
- public void addPages() {
- exportPage = new WizardNewFileCreationPage("XML Catalog Export", getSelection());
- exportPage.setTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_TITLE);
- exportPage.setDescription(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_DESCRIPTION);
- exportPage.setFileExtension("xml"); //$NON-NLS-1$
-
- addPage(exportPage);
- }
-
- public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
- super.init(workbench, currentSelection);
- setWindowTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_TITLE);
- ImageDescriptor descriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_WIZBAN_GENERATEXML);
- setDefaultPageImageDescriptor(descriptor);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java
deleted file mode 100644
index e342efae4f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * Help context ids for the xml wizard.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- */
-interface IXMLWizardHelpContextIds {
- // org.eclipse.wst.xml.ui.
- public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
- // Create XML file from a DTD file radio
- public static final String XML_NEWWIZARD_CREATEXML1_HELPID = PREFIX + "xmlc0101"; //$NON-NLS-1$
- // Create XML file from an XML schema file radio button
- public static final String XML_NEWWIZARD_CREATEXML2_HELPID = PREFIX + "xmlc0102"; //$NON-NLS-1$
- // Create XML file from scratch radio button
- public static final String XML_NEWWIZARD_CREATEXML3_HELPID = PREFIX + "xmlc0103"; //$NON-NLS-1$
- // Select Source file page
- public static final String XML_NEWWIZARD_SELECTSOURCE_HELPID = PREFIX + "xmlc0500"; //$NON-NLS-1$
- // Root element for both DTD and XML schema
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT_HELPID = PREFIX + "xmlc0410"; //$NON-NLS-1$
- // Create Optional Attributes
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT1_HELPID = PREFIX + "xmlc0441"; //$NON-NLS-1$
- // Create Optional Elements
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT2_HELPID = PREFIX + "xmlc0442"; //$NON-NLS-1$
- // Create first choice of required choice
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT3_HELPID = PREFIX + "xmlc0443"; //$NON-NLS-1$
- // Fill elements and attribute with data
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT4_HELPID = PREFIX + "xmlc0444"; //$NON-NLS-1$
- // System ID for DTD
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT5_HELPID = PREFIX + "xmlc0210"; //$NON-NLS-1$
- // Public ID for DTD
- public static final String XML_NEWWIZARD_SELECTROOTELEMENT6_HELPID = PREFIX + "xmlc0220"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java
deleted file mode 100644
index 38e3447da2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Standards for Technology in Automotive Retail (STAR) and
- * others. All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver/STAR - dcarver@starstandard.org/d_a_carver@yahoo.com - bug 192568
- * Initial API - This implements the functionality of the
- * old Import Dialog for the XML Catalog.
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-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.wst.common.ui.internal.viewers.SelectSingleFileView;
-
-public class ImportXMLCatalogPage extends WizardPage {
-
- protected SelectSingleFileView selectSingleFileView;
- protected IStructuredSelection selection;
-
-
- public ImportXMLCatalogPage() {
- super(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_IMPORT_TITLE);
- setTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_IMPORT_TITLE);
- selection = new StructuredSelection();
- selectSingleFileView = new SelectSingleFileView(selection, false) {
- public void createFilterControl(Composite composite) {
- ImportXMLCatalogPage.this.createFilterControl(composite);
- }
- };
-
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 350;
- gd.heightHint = 350;
- composite.setLayoutData(gd);
- String[] extensions = { ".xmlcatalog", ".xml" }; //$NON-NLS-1$ //$NON-NLS-2$
- selectSingleFileView.addFilterExtensions(extensions);
- selectSingleFileView.createControl(composite);
- selectSingleFileView.setVisibleHelper(true);
- selectSingleFileView.addSelectionChangedTreeListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- ImportXMLCatalogPage.this.setPageComplete(selectSingleFileView.getFile() != null);
- }
- });
- setControl(composite);
- }
-
- public void createFilterControl(Composite composite) {
- }
-
- public IFile getFile() {
- return selectSingleFileView.getFile();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java
deleted file mode 100644
index f1200a2478..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail (STAR) and
- * others. All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver/STAR - dcarver@starstandard.org/d_a_carver@yahoo.com - bug 192568
- * Initial API - This implements the functionality of the
- * old Import Dialog for the XML Catalog.
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class ImportXMLCatalogWizard extends Wizard implements IImportWizard {
-
- protected ImportXMLCatalogPage importPage = null;
- protected ICatalog workingUserCatalog = null;
- protected ICatalog userCatalog = null;
-
- public ImportXMLCatalogWizard() {
- setWindowTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_IMPORT_TITLE);
- ImageDescriptor descriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_WIZBAN_GENERATEXML);
- setDefaultPageImageDescriptor(descriptor);
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- userCatalog = referencedCatalog;
- }
- }
- }
-
- CatalogSet tempCatalogSet = new CatalogSet();
- workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
- workingUserCatalog.addEntriesFromCatalog(userCatalog);
- }
-
- public boolean canFinish() {
- return importPage.isPageComplete();
- }
-
- public boolean performFinish() {
- IFile file = importPage.getFile();
- if (file != null) {
- String fileName = file.getLocation().toFile().toURI().toString();
- try {
- CatalogSet tempResourceSet = new CatalogSet();
- ICatalog newCatalog = tempResourceSet.lookupOrCreateCatalog("temp", fileName); //$NON-NLS-1$
-
- workingUserCatalog.addEntriesFromCatalog(newCatalog);
- userCatalog.clear();
- userCatalog.addEntriesFromCatalog(workingUserCatalog);
- userCatalog.save();
- }
- catch (Exception e) {
- return false;
- }
- }
-
- return true;
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- public void addPages() {
- importPage = new ImportXMLCatalogPage();
- importPage.setTitle(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_HEADING);
- importPage.setDescription(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_IMPORT_DESCRIPTION);
- importPage.setMessage(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_MESSAGE);
- addPage(importPage);
- importPage.setPageComplete(false);
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java
deleted file mode 100644
index 09eed81a69..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java
+++ /dev/null
@@ -1,51 +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.xml.ui.internal.wizards;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.ContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-
-public class NamespaceInfoContentBuilder extends ContentBuilder {
- protected int count = 1;
- public List list = new Vector();
- protected Hashtable table = new Hashtable();
-
- public NamespaceInfoContentBuilder() {
- super();
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed) {
- if (ed.getProperty("http://org.eclipse.wst/cm/properties/definitionInfo") != null) //$NON-NLS-1$
- {
- super.visitCMElementDeclaration(ed);
- }
- }
-
- protected void createAnyElementNode(CMAnyElement anyElement) {
- String uri = anyElement.getNamespaceURI();
- if ((uri != null) && !uri.startsWith("##")) //$NON-NLS-1$
- {
- if (table.get(uri) == null) {
- NamespaceInfo info = new NamespaceInfo();
- info.uri = uri;
- info.prefix = "p" + count++; //$NON-NLS-1$
- table.put(uri, info);
- list.add(info);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
deleted file mode 100644
index 4a400f2ae2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.osgi.util.NLS;
-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.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-
-public class NewModelWizard extends Wizard implements INewWizard {
-
- protected IStructuredSelection fSelection;
- protected IWorkbench fWorkbench;
- protected String fCurrentDirectory;
-
- public NewModelWizard() {
- super();
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.fWorkbench = workbench;
- this.fSelection = selection;
- }
-
- public boolean performFinish() {
- boolean result = true;
- WizardPage currentPage = (WizardPage) getContainer().getCurrentPage();
- if (currentPage != null) {
- result = currentPage.isPageComplete();
- }
- return result;
- }
-
- /**
- * showFileDialog
- */
- public FileDialog showFileDialog(Shell shell, String defaultDirectory, String defaultFile, String[] filterExtensions) {
- FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
-
- // Get the last visit directory if we haven't defined a particular one
- // here.
- if ((defaultDirectory == null) || (defaultDirectory.length() == 0)) {
- // defaultDirectory =
- // Locate.instance(this).getLastSelectedDirectory(getResourcePath());
- }
-
- if ((defaultDirectory != null) && (defaultDirectory.length() != 0)) {
- fileDialog.setFilterPath(defaultDirectory);
- }
-
- fileDialog.setFileName(defaultFile);
- fileDialog.setFilterExtensions(filterExtensions);
-
- fileDialog.open();
-
- return fileDialog;
- }
-
-
- public void setCurrentDirectory(String currentDirectory1) {
- this.fCurrentDirectory = currentDirectory1;
- }
-
-
- public void createWorkbenchResource(IContainer container, String fileName) {
- IPath path = container.getFullPath();
- path = path.append(fileName);
- IFile file = container.getWorkspace().getRoot().getFile(path);
- if (!file.exists()) {
- try {
- file.create(null, true, null);
- }
- catch (CoreException e) {
- // XMLBuilderPlugin.getPlugin().getMsgLogger().write("Encountered
- // exception creating file: " + e.getMessage());
- }
- }
- }
-
- /**
- * StartPage
- */
- public class StartPage extends WizardPage implements Listener {
- protected int selectedButton;
- protected String[] radioButtonLabel;
- protected Button[] radioButton;
-
- public StartPage(String pageName, String[] radioButtonLabel) {
- super(pageName);
- this.radioButtonLabel = radioButtonLabel;
- radioButton = new Button[radioButtonLabel.length];
- }
-
- public Button getRadioButtonAtIndex(int i) {
- Button result = null;
- if ((i >= 0) && (i < radioButton.length)) {
- result = radioButton[i];
- }
- return result;
- }
-
- public int getSelectedRadioButtonIndex() {
- int result = -1;
- for (int i = 0; i < radioButton.length; i++) {
- if (radioButton[i].getSelection()) {
- result = i;
- }
- }
- return result;
- }
-
- public void createControl(Composite parent) {
- Composite base = new Composite(parent, SWT.NONE);
- base.setLayout(new GridLayout());
-
- // radio buttons' container
- Composite radioButtonsGroup = new Composite(base, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- layout.marginWidth = 0;
-
- radioButtonsGroup.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 300;
- gd.widthHint = 400;
- radioButtonsGroup.setLayoutData(gd);
-
- for (int i = 0; i < radioButtonLabel.length; i++) {
- radioButton[i] = new Button(radioButtonsGroup, SWT.RADIO);
- radioButton[i].setText(radioButtonLabel[i]);
- radioButton[i].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // radioButton[i].addListener(SWT.Modify, this);
- }
- setControl(base);
- setPageComplete(isPageComplete());
- Dialog.applyDialogFont(parent);
- }
-
- public void handleEvent(Event event) {
- if (event.type == SWT.Modify) {
- setPageComplete(isPageComplete());
- }
- }
- }
-
-
- /**
- * NewFilePage
- */
- public class NewFilePage extends WizardNewFileCreationPage {
- public String defaultName = "NewFile"; //$NON-NLS-1$
- public String defaultFileExtension = ".txt"; //$NON-NLS-1$
- public String[] filterExtensions = {"*.txt"}; //$NON-NLS-1$
- private List fValidExtensions = null;
-
- public NewFilePage(IStructuredSelection selection) {
- super("", selection); //$NON-NLS-1$
- }
-
- protected String computeDefaultFileName() {
- int count = 0;
- String fileName = defaultName + defaultFileExtension;
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null) {
- while (true) {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path)) {
- count++;
- fileName = defaultName + count + defaultFileExtension;
- }
- else {
- break;
- }
- }
- }
- return fileName;
- }
-
- // returns true if file of specified name exists in any case for
- // selected container
- protected String existsFileAnyCase(String fileName) {
- if ((getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false) && (fileName.compareTo("") != 0)) //$NON-NLS-1$
- {
- // look through all resources at the specified container -
- // compare in upper case
- IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
- if (parent instanceof IContainer) {
- IContainer container = (IContainer) parent;
- try {
- IResource[] members = container.members();
- String enteredFileUpper = fileName.toUpperCase();
- for (int i = 0; i < members.length; i++) {
- String resourceUpperName = members[i].getName().toUpperCase();
- if (resourceUpperName.equals(enteredFileUpper)) {
- return members[i].getName();
- }
- }
- }
- catch (CoreException e) {
- }
- }
- }
- return null;
- }
-
-
- protected boolean validatePage() {
- String fullFileName = getFileName();
- if (!extensionValidForContentType(fullFileName)) {
- setErrorMessage(NLS.bind(XMLWizardsMessages._ERROR_BAD_FILENAME_EXTENSION, getValidExtensions().toString()));
- return false;
- }
- // no fileExtension, let's check for this file with default file
- // extension
- if (fullFileName.lastIndexOf('.') == -1)
- {
- fullFileName += defaultFileExtension;
- }
-
- if ((getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false) && (getFileName().compareTo("") != 0)) //$NON-NLS-1$
- {
- Path fullPath = new Path(getContainerFullPath().toString() + '/' + fullFileName);
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath);
- if (resource != null) {
- setErrorMessage(XMLWizardsMessages._ERROR_FILE_ALREADY_EXISTS);
- return false;
- }
- }
-
- // check for file should be case insensitive
- String sameName = existsFileAnyCase(fullFileName);
- if (sameName != null) {
- // ISSUE: is qualitifedFileName not needed, or is it supposed
- // to be used in error message?
- // String qualifiedFileName =
- // getContainerFullPath().toString() + '/' + fullFileName;
- setErrorMessage(XMLWizardsMessages._ERROR_FILE_ALREADY_EXISTS + " " + sameName); //$NON-NLS-1$
- return false;
- }
-
- return super.validatePage();
- }
-
- public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- this.setFileName(computeDefaultFileName());
- setPageComplete(validatePage());
- }
-
- /**
- * Get list of valid extensions for XML Content type
- *
- * @return List
- */
- List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
- 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
- */
- boolean extensionValidForContentType(String fileName) {
- boolean valid = false;
-
- IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
- // 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;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
deleted file mode 100644
index b40aad33af..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-
-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.content.IContentType;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-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.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.ContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMWriter;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class NewXMLGenerator {
-
- protected String grammarURI;
- protected CMDocument cmDocument;
- protected int buildPolicy;
- protected String rootElementName;
-
- protected ICatalogEntry xmlCatalogEntry;
- protected int optionalElementDepthLimit = -1;
-
- // info for dtd
- protected String publicId;
- protected String systemId;
- protected String defaultSystemId;
-
- // info for xsd
- public List namespaceInfoList;
-
- public NewXMLGenerator() {
- super();
- }
-
- public NewXMLGenerator(String grammarURI, CMDocument cmDocument) {
- this.grammarURI = grammarURI;
- this.cmDocument = cmDocument;
- }
-
-
- public static CMDocument createCMDocument(String uri, String[] errorInfo) {
- String title = null;
- String message = null;
- List errorList = new Vector();
- CMDocument cmDocument = null;
-
- if (URIHelper.isReadableURI(uri, true)) {
- // (cs) assume the uri has been provided in a normalized form
- cmDocument = ContentModelManager.getInstance().createCMDocument(uri, null);
-
- if (uri.endsWith(".dtd")) { //$NON-NLS-1$
- if (errorList.size() > 0) {
- title = XMLWizardsMessages._UI_INVALID_GRAMMAR_ERROR;
- message = XMLWizardsMessages._UI_LABEL_ERROR_DTD_INVALID_INFO;
- }
- }
- else // ".xsd"
- {
- // To be consistent with the schema editor validation
- XMLSchemaValidationChecker validator = new XMLSchemaValidationChecker();
- if (!validator.isValid(uri)) {
- title = XMLWizardsMessages._UI_INVALID_GRAMMAR_ERROR;
- message = XMLWizardsMessages._UI_LABEL_ERROR_SCHEMA_INVALID_INFO;
- }
- else if (cmDocument != null) {
- int globalElementCount = cmDocument.getElements().getLength();
- if (globalElementCount == 0) {
- title = XMLWizardsMessages._UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
- message = XMLWizardsMessages._UI_WARNING_MSG_NO_ROOT_ELEMENTS;
- }
- }
- }
- }
- else {
- title = XMLWizardsMessages._UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
- message = XMLWizardsMessages._UI_WARNING_URI_NOT_FOUND_COLON + " " + uri; //$NON-NLS-1$
- }
- errorInfo[0] = title;
- errorInfo[1] = message;
-
- return cmDocument;
- }
-
- private String applyLineDelimiter(IFile file, String text) {
- String systemLineSeparator = System.getProperty("line.separator");
- String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, systemLineSeparator, new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
- if(!systemLineSeparator.equals(lineDelimiter)) {
- String convertedText = StringUtils.replace(text, "\r\n", "\n");
- convertedText = StringUtils.replace(convertedText, "\r", "\n");
- convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
- return convertedText;
- }
- return text;
- }
-
- /**
- * @deprecated use createTemplateXMLDocument(IFile, String) instead
- */
- public void createEmptyXMLDocument(IFile newFile) throws Exception {
- String charSet = getUserPreferredCharset();
- String contents = "<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>"; //$NON-NLS-1$ //$NON-NLS-2$
- createTemplateXMLDocument(newFile, contents);
- }
-
- void createTemplateXMLDocument(IFile newFile, String contents) throws Exception {
- if (contents != null) {
- String charSet = getUserPreferredCharset();
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
- PrintWriter writer = new PrintWriter(new OutputStreamWriter(outputStream, charSet));
- contents = applyLineDelimiter(newFile, contents);
- writer.print(contents);
- writer.flush();
- outputStream.close();
-
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- newFile.setContents(inputStream, true, true, null);
- inputStream.close();
- }
- }
-
- private String getUserPreferredCharset() {
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- return charSet;
- }
-
- public void createXMLDocument(String xmlFileName) throws Exception {
- IContentType contentType = Platform.getContentTypeManager().findContentTypeFor(xmlFileName);
- String charset = null;
- if (contentType != null) {
- charset = contentType.getDefaultCharset();
- }
- ByteArrayOutputStream outputStream = createXMLDocument(xmlFileName, charset);
-
- File file = new File(xmlFileName);
- FileOutputStream fos = new FileOutputStream(file);
- outputStream.writeTo(fos);
- fos.close();
- }
-
-
- public void createXMLDocument(IFile newFile, String xmlFileName) throws Exception {
- String charset = newFile.getCharset();
- ByteArrayOutputStream outputStream = createXMLDocument(xmlFileName, charset);
-
- String contents = outputStream.toString(charset);
- contents = applyLineDelimiter(newFile, contents);
-
- ByteArrayInputStream inputStream = new ByteArrayInputStream(contents.getBytes(charset));
- newFile.setContents(inputStream, true, true, null);
- inputStream.close();
- }
-
-
- public ByteArrayOutputStream createXMLDocument(String xmlFileName, String charset) throws Exception {
- if (charset == null) {
- charset = getUserPreferredCharset();
- if (charset == null) {
- charset = "UTF-8"; //$NON-NLS-1$
- }
- }
- CMDocument cmDocument = getCMDocument();
-
- Assert.isNotNull(cmDocument);
- Assert.isNotNull(getRootElementName());
-
- // create the xml model
- CMNamedNodeMap nameNodeMap = cmDocument.getElements();
- CMElementDeclaration cmElementDeclaration = (CMElementDeclaration) nameNodeMap.getNamedItem(getRootElementName());
-
- Document xmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- DOMContentBuilderImpl contentBuilder = new DOMContentBuilderImpl(xmlDocument);
-
- // this 'uglyTempHack' flag is required in order to supress the
- // creation a default encoding
- // we'll handle this later in the domWriter.print() method used below
- //
- contentBuilder.supressCreationOfDoctypeAndXMLDeclaration = true;
- contentBuilder.setBuildPolicy(buildPolicy);
- contentBuilder.setOptionalElementDepthLimit(optionalElementDepthLimit);
- contentBuilder.setExternalCMDocumentSupport(new MyExternalCMDocumentSupport(namespaceInfoList, xmlFileName));
- contentBuilder.createDefaultRootContent(cmDocument, cmElementDeclaration, namespaceInfoList);
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, charset);
-
- DOMWriter domWriter = new DOMWriter(outputStreamWriter);
-
- // TODO... instead of relying on file extensions, we need to keep
- // track of the grammar type
- // better yet we should reate an SSE document so that we can format it
- // nicely before saving
- // then we won't need the DOMWriter at all
- //
- domWriter.print(xmlDocument, charset, cmDocument.getNodeName(), getNonWhitespaceString(getPublicId()), getNonWhitespaceString(getSystemId()));
- outputStream.flush();
- outputStream.close();
-
- return outputStream;
- }
-
-
- public void createNamespaceInfoList() {
- List result = new Vector();
- if (cmDocument != null) {
- result = (List) cmDocument.getProperty("http://org.eclipse.wst/cm/properties/completeNamespaceInfo"); //$NON-NLS-1$
- if (result != null) {
- int size = result.size();
- for (int i = 0; i < size; i++) {
- NamespaceInfo info = (NamespaceInfo) result.get(i);
- if (i == 0) {
- String locationInfo = null;
- if (xmlCatalogEntry != null) {
- if (xmlCatalogEntry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) {
- locationInfo = xmlCatalogEntry.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
- }
- else {
- locationInfo = xmlCatalogEntry.getKey();
- }
- }
- if (locationInfo == null) {
- locationInfo = defaultSystemId;
- }
- info.locationHint = locationInfo;
- info.setProperty("locationHint-readOnly", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- info.setProperty("uri-readOnly", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- info.setProperty("unremovable", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- info.locationHint = null;
- }
- }
- }
-
- NamespaceInfoContentBuilder builder = new NamespaceInfoContentBuilder();
- builder.setBuildPolicy(ContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
- builder.visitCMNode(cmDocument);
- result.addAll(builder.list);
- }
- namespaceInfoList = result;
- }
-
-
- public boolean isMissingNamespaceLocation() {
- boolean result = false;
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if (info.locationHint == null) {
- result = true;
- break;
- }
- }
- return result;
- }
-
-
- public String[] getNamespaceInfoErrors() {
- String[] errorList = null;
-
-// No warnings should be given when namespaces entries have missing location hints
-// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=105128
-// if ((namespaceInfoList != null) && isMissingNamespaceLocation()) {
-// String title = XMLWizardsMessages._UI_LABEL_NO_LOCATION_HINT;
-// String message = XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_1 + " " + XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_2 + "\n\n" + XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_3; //$NON-NLS-1$ //$NON-NLS-2$
-//
-// errorList = new String[2];
-// errorList[0] = title;
-// errorList[1] = message;
-// }
- return errorList;
- }
-
-
- public void setXMLCatalogEntry(ICatalogEntry catalogEntry) {
- xmlCatalogEntry = catalogEntry;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- return xmlCatalogEntry;
- }
-
-
- public void setBuildPolicy(int policy) {
- buildPolicy = policy;
- }
-
-
- public void setDefaultSystemId(String sysId) {
- defaultSystemId = sysId;
- }
-
- public String getDefaultSystemId() {
- return defaultSystemId;
- }
-
- public void setSystemId(String sysId) {
- systemId = sysId;
- }
-
- public String getSystemId() {
- return systemId;
- }
-
- public void setPublicId(String pubId) {
- publicId = pubId;
- }
-
- public String getPublicId() {
- return publicId;
- }
-
- public void setGrammarURI(String gramURI) {
- grammarURI = gramURI;
- }
-
- public String getGrammarURI() {
- return grammarURI;
- }
-
- public void setCMDocument(CMDocument cmDoc) {
- cmDocument = cmDoc;
- }
-
- public CMDocument getCMDocument() {
- return cmDocument;
- }
-
- public void setRootElementName(String rootName) {
- rootElementName = rootName;
- }
-
- public String getRootElementName() {
- return rootElementName;
- }
-
-
- protected class MyExternalCMDocumentSupport implements DOMContentBuilderImpl.ExternalCMDocumentSupport {
- protected List namespaceInfoList1;
- protected URIResolver idResolver;
- protected String resourceLocation;
-
- protected MyExternalCMDocumentSupport(List namespaceInfoListParam, String resourceLocation) {
- this.namespaceInfoList1 = namespaceInfoListParam;
- this.resourceLocation = resourceLocation;
- idResolver = URIResolverPlugin.createResolver();
- }
-
- public CMDocument getCMDocument(Element element, String namespaceURI) {
- CMDocument result = null;
- if ((namespaceURI != null) && (namespaceURI.trim().length() > 0)) {
- String locationHint = null;
- for (Iterator i = namespaceInfoList1.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if (namespaceURI.equals(info.uri)) {
- locationHint = info.locationHint;
- break;
- }
- }
- if (locationHint != null) {
- grammarURI = idResolver.resolve(resourceLocation, locationHint, locationHint);
- result = ContentModelManager.getInstance().createCMDocument(getGrammarURI(), null);
- }
- }
- else {
- result = cmDocument;
- }
- return result;
- }
- }
-
- public static String getNonWhitespaceString(String string) {
- String result = null;
- if (string != null) {
- if (string.trim().length() > 0) {
- result = string;
- }
- }
- return result;
- }
-
- public void setOptionalElementDepthLimit(int optionalElementDepthLimit) {
- this.optionalElementDepthLimit = optionalElementDepthLimit;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLHandler.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLHandler.java
deleted file mode 100644
index 38c2669350..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.util.Iterator;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class NewXMLHandler extends AbstractHandler implements IHandler {
-
- /**
- *
- */
- public NewXMLHandler() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
- ISelection selection = workbenchWindow.getSelectionService().getSelection();
- Object selectedObject = getSelection(selection);
-
- if ((selectedObject instanceof IFile) && (selection instanceof IStructuredSelection)) {
- IFile file = (IFile) selectedObject;
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- try {
- NewXMLWizard.showDialog(workbenchWindow.getShell(), file, structuredSelection);
- }
- catch (Exception e) {
- // XMLCorePlugin.getDefault().getLog().log();
- }
- }
- return null;
- }
-
- public static Object getSelection(ISelection selection) {
- if (selection == null) {
- return null;
- }
-
- Object result = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection es = (IStructuredSelection) selection;
- Iterator i = es.iterator();
- if (i.hasNext()) {
- result = i.next();
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java
deleted file mode 100644
index 0a4b580528..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xml.ui.internal.wizards;
-
-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.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;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- *
- */
-public class NewXMLTemplatesWizardPage 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(TemplateContextTypeIdsXML.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 NewXMLTemplatesWizardPage() {
- super("NewXMLTemplatesWizardPage", XMLWizardsMessages.NewXMLTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(XMLWizardsMessages.NewXMLTemplatesWizardPage_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 XML Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_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);
-
- Label label = new Label(innerParent, SWT.NONE);
- label.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_7);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- label.setLayoutData(data);
-
- // 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(XMLWizardsMessages.NewXMLTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_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 = XMLUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- // Create linked text to just to templates preference page
- Link link = new Link(parent, SWT.NONE);
- link.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_6);
- data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.XML_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 StructuredTextViewerConfigurationXML();
-
- 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);
- viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForXML.ContentTypeID_XML);
- 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(XMLWizardsMessages.NewXMLTemplatesWizardPage_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);
- // [261274] - source viewer was growing to fit the max line width of the template
- data.widthHint = convertWidthInCharsToPixels(2);
- 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.xml.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 = XMLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsXML.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 xml", 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 XML File wizard.
- */
- private void loadLastSavedPreferences() {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- boolean setSelection = false;
- String templateName = XMLUIPlugin.getDefault().getPreferenceStore().getString(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- templateName = XMLUIPlugin.getDefault().getPreferenceStore().getString(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
- if (templateName != null && templateName.length() > 0) {
- Template template = fTemplateStore.findTemplateById(templateName);
- if (template != null) {
- fLastSelectedTemplateName = template.getName();
- setSelection = true;
- }
- }
- }
- else {
- fLastSelectedTemplateName = templateName;
- setSelection = true;
- }
- fUseTemplateButton.setSelection(setSelection);
- enableTemplates();
- }
-
- /**
- * Save template name used for next call to New XML File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- XMLUIPlugin.getDefault().getPreferenceStore().setValue(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- XMLUIPlugin.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, TemplateContextTypeIdsXML.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
deleted file mode 100644
index bc77849fa8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
+++ /dev/null
@@ -1,967 +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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-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.util.DOMContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.dialogs.NamespaceInfoErrorHelper;
-import org.eclipse.wst.xml.ui.internal.dialogs.SelectFileOrXMLCatalogIdPanel;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
-
-import com.ibm.icu.text.Collator;
-
-public class NewXMLWizard extends NewModelWizard {
- protected static final int CREATE_FROM_DTD = 0;
- protected static final int CREATE_FROM_XSD = 1;
- protected static final int CREATE_FROM_SCRATCH = 2;
-
- protected static final String[] createFromRadioButtonLabel = {XMLWizardsMessages._UI_RADIO_XML_FROM_DTD, XMLWizardsMessages._UI_RADIO_XML_FROM_SCHEMA, XMLWizardsMessages._UI_RADIO_XML_FROM_SCRATCH};
-
- protected static final String[] filePageFilterExtensions = {".xml"}; //$NON-NLS-1$
- protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
- protected static final String[] browseDTDFilterExtensions = {".dtd"}; //$NON-NLS-1$
-
- protected static final int OPTIONAL_ELEMENT_DEPTH_LIMIT_DEFAULT_VALUE = 2;
-
- protected static final long XML_EDITOR_FILE_SIZE_LIMIT = 26214400; // 25 mb
-
- protected NewFilePage newFilePage;
- /**
- * @deprecated clients should not be allowed to change start page
- */
- protected StartPage startPage;
- private StartPage fCreateXMLFromWizardPage;
- protected SelectGrammarFilePage selectGrammarFilePage;
- protected SelectRootElementPage selectRootElementPage;
-
- protected String cmDocumentErrorMessage;
-
- protected NewXMLGenerator generator;
- private NewXMLTemplatesWizardPage fNewXMLTemplatesWizardPage;
-
-
- public NewXMLWizard() {
- setWindowTitle(XMLWizardsMessages._UI_WIZARD_CREATE_NEW_TITLE);
- ImageDescriptor descriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_WIZBAN_GENERATEXML);
- setDefaultPageImageDescriptor(descriptor);
- generator = new NewXMLGenerator();
- }
-
-
- public NewXMLWizard(IFile file, CMDocument cmDocument) {
- this();
-
- generator.setGrammarURI(URIHelper.getPlatformURI(file));
- generator.setCMDocument(cmDocument);
- }
-
-
- public static void showDialog(Shell shell, IFile file, IStructuredSelection structuredSelection) {
- String[] errorInfo = new String[2];
- // (cs) the URI argument to createCMDocument needs to be a fully
- // qualified URI
- //
- CMDocument cmDocument = NewXMLGenerator.createCMDocument(URIHelper.getPlatformURI(file), errorInfo);
- if (errorInfo[0] == null) {
- NewXMLWizard wizard = new NewXMLWizard(file, cmDocument);
- wizard.init(PlatformUI.getWorkbench(), structuredSelection);
- wizard.setNeedsProgressMonitor(true);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setText(XMLWizardsMessages._UI_DIALOG_NEW_TITLE);
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
- else {
- MessageDialog.openInformation(shell, errorInfo[0], errorInfo[1]);
- }
- }
-
- public void addPages() {
- String grammarURI = generator.getGrammarURI();
-
- // new file page
- newFilePage = new NewFilePage(fSelection);
- newFilePage.setTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_HEADING);
- newFilePage.setDescription(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_EXPL);
- newFilePage.defaultName = (grammarURI != null) ? URIHelper.removeFileExtension(URIHelper.getLastSegment(grammarURI)) : "NewFile"; //$NON-NLS-1$
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String ext = preference.getString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
- newFilePage.defaultFileExtension = "." + ext; //$NON-NLS-1$
- newFilePage.filterExtensions = filePageFilterExtensions;
- addPage(newFilePage);
-
- if (grammarURI == null) {
- // create xml from page
- fCreateXMLFromWizardPage = new StartPage("StartPage", createFromRadioButtonLabel) //$NON-NLS-1$
- {
- public void createControl(Composite parent) {
- super.createControl(parent);
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- getRadioButtonAtIndex(getCreateMode()).setSelection(true);
- getRadioButtonAtIndex(getCreateMode()).setFocus();
-
- // Set the help context for each button
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fCreateXMLFromWizardPage.getRadioButtonAtIndex(0), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML1_HELPID);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fCreateXMLFromWizardPage.getRadioButtonAtIndex(1), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML2_HELPID);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fCreateXMLFromWizardPage.getRadioButtonAtIndex(2), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML3_HELPID);
- }
- };
-
-
- fCreateXMLFromWizardPage.setTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_HEADING);
- fCreateXMLFromWizardPage.setDescription(XMLWizardsMessages._UI_WIZARD_CREATE_XML_EXPL);
- addPage(fCreateXMLFromWizardPage);
- }
-
- // selectGrammarFilePage
- selectGrammarFilePage = new SelectGrammarFilePage();
- addPage(selectGrammarFilePage);
-
- // select root element page
- selectRootElementPage = new SelectRootElementPage();
- selectRootElementPage.setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_ROOT_HEADING);
- selectRootElementPage.setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_ROOT_EXPL);
- addPage(selectRootElementPage);
-
- // from "scratch"
- fNewXMLTemplatesWizardPage = new NewXMLTemplatesWizardPage();
- addPage(fNewXMLTemplatesWizardPage);
- }
-
-
- public IWizardPage getStartingPage() {
- WizardPage result = null;
- if (startPage != null) {
- result = startPage;
- }
- else {
- result = newFilePage;
- }
- return result;
- }
-
-
- public int getCreateMode() {
- String grammarURI = generator.getGrammarURI();
-
- int result = CREATE_FROM_SCRATCH;
- if (grammarURI != null) {
- if (grammarURI.endsWith(".dtd")) //$NON-NLS-1$
- {
- result = CREATE_FROM_DTD;
- }
- else if (grammarURI.endsWith(".xsd")) //$NON-NLS-1$
- {
- result = CREATE_FROM_XSD;
- }
- }
- else if (fCreateXMLFromWizardPage != null) {
- int selectedIndex = fCreateXMLFromWizardPage.getSelectedRadioButtonIndex();
- if (selectedIndex != -1) {
- result = selectedIndex;
- }
- }
- return result;
- }
-
-
- public IWizardPage getNextPage(IWizardPage currentPage) {
- WizardPage nextPage = null;
- if (currentPage == startPage) {
- nextPage = newFilePage;
- }
- else if (currentPage == newFilePage) {
- if (generator.getGrammarURI() == null)
- nextPage = fCreateXMLFromWizardPage;
- else
- nextPage = selectRootElementPage;
- }
- else if (currentPage == fCreateXMLFromWizardPage) {
- if (getCreateMode() == CREATE_FROM_SCRATCH) {
- nextPage = fNewXMLTemplatesWizardPage;
- }
- else if (generator.getGrammarURI() == null) {
- nextPage = selectGrammarFilePage;
- }
- else {
- nextPage = selectRootElementPage;
- }
- }
- else if (currentPage == selectGrammarFilePage) {
- nextPage = selectRootElementPage;
- }
- return nextPage;
- }
-
-
- public boolean canFinish() {
- boolean result = false;
-
- IWizardPage currentPage = getContainer().getCurrentPage();
- // can finish on: new file page, create from & template page if creating from scratch, select root element page
- if ((currentPage == newFilePage && generator.getGrammarURI() == null) || (fCreateXMLFromWizardPage != null && fCreateXMLFromWizardPage.getSelectedRadioButtonIndex() == CREATE_FROM_SCRATCH) || (currentPage == selectRootElementPage)) {
- result = currentPage.isPageComplete();
- }
- return result;
- }
-
-
- public boolean performFinish() {
- boolean result = super.performFinish();
- // save user options for next use
- fNewXMLTemplatesWizardPage.saveLastSavedPreferences();
-
- String fileName = null;
- try {
-
- String[] namespaceErrors = generator.getNamespaceInfoErrors();
- if (namespaceErrors != null) {
- String title = namespaceErrors[0];
- String message = namespaceErrors[1];
- result = MessageDialog.openQuestion(getShell(), title, message);
- }
-
- if (result) {
- fileName = newFilePage.getFileName();
- if ((new Path(fileName)).getFileExtension() == null) {
- newFilePage.setFileName(fileName.concat(newFilePage.defaultFileExtension));
- }
-
- final IFile newFile = newFilePage.createNewFile();
- final String xmlFileName = newFile.getLocation().toOSString();
- final String grammarFileName = fileName;
-
- if (getContainer().getCurrentPage() == selectRootElementPage) {
-
- int limit = selectRootElementPage.getOptionalElementDepthLimit();
- generator.setOptionalElementDepthLimit(limit);
- setNeedsProgressMonitor(true);
- getContainer().run(true, false, new IRunnableWithProgress(){
- public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
- progressMonitor.beginTask(XMLWizardsMessages._UI_WIZARD_GENERATING_XML_DOCUMENT, IProgressMonitor.UNKNOWN);
- try {
- generator.createXMLDocument(newFile, xmlFileName);
- } catch (Exception exception) {
- Logger.logException("Exception completing New XML wizard " + grammarFileName, exception); //$NON-NLS-1$
- }
- progressMonitor.done();
- }
- });
- }
- else {
- // put template contents into file
- String templateString = fNewXMLTemplatesWizardPage.getTemplateString();
- generator.createTemplateXMLDocument(newFile, templateString);
- }
- newFile.refreshLocal(IResource.DEPTH_ONE, null);
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- BasicNewResourceWizard.selectAndReveal(newFile, workbenchWindow);
- openEditor(newFile);
- }
- }
- catch (Exception e) {
- Logger.logException("Exception completing New XML wizard " + fileName, e); //$NON-NLS-1$
- }
- return result;
- }
-
- public void openEditor(IFile file) {
- long length = 0;
- IPath location = file.getLocation();
- if (location != null) {
- File localFile = location.toFile();
- length = localFile.length();
- }
- if(length < XML_EDITOR_FILE_SIZE_LIMIT) {
- // Open editor on new file.
- String editorId = null;
- try {
- IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getLocation().toOSString(), file.getContentDescription().getContentType());
- if (editor != null) {
- editorId = editor.getId();
- }
- }
- catch (CoreException e1) {
- // editor id could not be retrieved, so we can not open editor
- return;
- }
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- try {
- if (dw != null) {
- IWorkbenchPage page = dw.getActivePage();
- if (page != null) {
- page.openEditor(new FileEditorInput(file), editorId, true);
- }
- }
- }
- catch (PartInitException e) {
- // editor can not open for some reason
- return;
- }
- }
- }
-
-
- protected String getDefaultSystemId() {
- String relativePath = "platform:/resource/" + newFilePage.getContainerFullPath().toString() + "/dummy"; //$NON-NLS-1$ //$NON-NLS-2$
- return URIHelper.getRelativeURI(generator.getGrammarURI(), relativePath);
- }
-
-
- /**
- * SelectGrammarFilePage
- */
- class SelectGrammarFilePage extends WizardPage {
- protected SelectFileOrXMLCatalogIdPanel panel;
-
- SelectGrammarFilePage() {
- super("SelectGrammarFilePage"); //$NON-NLS-1$
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTSOURCE_HELPID);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- setControl(composite);
-
- panel = new SelectFileOrXMLCatalogIdPanel(composite);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SelectFileOrXMLCatalogIdPanel.Listener listener = new SelectFileOrXMLCatalogIdPanel.Listener() {
- public void completionStateChanged() {
- updateErrorMessage();
- }
- };
- panel.setListener(listener);
- Dialog.applyDialogFont(parent);
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- if (getCreateMode() == CREATE_FROM_DTD) {
- setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_DTD_FILE_TITLE);
- setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_DTD_FILE_DESC);
- panel.setFilterExtensions(browseDTDFilterExtensions);
- }
- else {
- setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_XSD_FILE_TITLE);
- setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_XSD_FILE_DESC);
- panel.setFilterExtensions(browseXSDFilterExtensions);
- }
- generator.setGrammarURI(null);
- generator.setCMDocument(null);
- cmDocumentErrorMessage = null;
- }
- panel.setVisibleHelper(visible);
- }
-
- public String getURI() {
- String uri = panel.getXMLCatalogURI();
- if (uri == null) {
- IFile file = panel.getFile();
- if (file != null) {
- uri = URIHelper.getPlatformURI(file);
- }
- }
- return uri;
- }
-
- public boolean isPageComplete() {
- return (getURI() != null) && (getErrorMessage() == null);
- }
-
- public String getXMLCatalogId() {
- return panel.getXMLCatalogId();
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- return panel.getXMLCatalogEntry();
- }
-
- public String computeErrorMessage() {
- String errorMessage = null;
- String uri = getURI();
- if (uri != null) {
- if (!URIHelper.isReadableURI(uri, false)) {
- errorMessage = XMLWizardsMessages._UI_LABEL_ERROR_CATALOG_ENTRY_INVALID;
- }
- }
- return errorMessage;
- }
-
-
- public void updateErrorMessage() {
- String errorMessage = computeErrorMessage();
- setErrorMessage(errorMessage);
- setPageComplete(isPageComplete());
- }
- }
-
-
- /**
- * SelectRootElementPage
- */
- class SelectRootElementPage extends WizardPage implements SelectionListener {
- protected Combo combo;
- protected Button[] radioButton;
- protected PageBook pageBook;
- protected XSDOptionsPanel xsdOptionsPanel;
- protected DTDOptionsPanel dtdOptionsPanel;
- protected Text limitOptionalElementDepthTextControl;
- protected Button limitOptionalElementDepthCheckButtonControl;
-
-
-
- SelectRootElementPage() {
- super("SelectRootElementPage"); //$NON-NLS-1$
- }
-
- public void createControl(Composite parent) {
- // container group
- Composite containerGroup = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(containerGroup, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT_HELPID);
- containerGroup.setLayout(new GridLayout());
- containerGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- setControl(containerGroup);
-
- // select root element
- Label containerLabel = new Label(containerGroup, SWT.NONE);
- containerLabel.setText(XMLWizardsMessages._UI_LABEL_ROOT_ELEMENT);
- combo = new Combo(containerGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- combo.addSelectionListener(this);
-
- // Options
- {
- Group group = new Group(containerGroup, SWT.NONE);
- group.setText(XMLWizardsMessages._UI_WIZARD_CONTENT_OPTIONS);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- layout.marginWidth = 0;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- radioButton = new Button[4];
-
- radioButton[0] = new Button(group, SWT.CHECK);
- radioButton[0].setText(XMLWizardsMessages._UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES);
- radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[0].setSelection(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[0], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT1_HELPID);
-
- radioButton[1] = new Button(group, SWT.CHECK);
- radioButton[1].setText(XMLWizardsMessages._UI_WIZARD_CREATE_OPTIONAL_ELEMENTS);
- radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[1].setSelection(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[1], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT2_HELPID);
-
- radioButton[1].addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent selectionEvent) {
- boolean enabled = radioButton[1].getSelection();
- limitOptionalElementDepthCheckButtonControl.setEnabled(enabled);
- enabled = enabled && limitOptionalElementDepthCheckButtonControl.getSelection();
- limitOptionalElementDepthTextControl.setEnabled(enabled);
- }
- });
- Composite composite = new Composite(group, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- gridLayout.numColumns = 2;
- gridLayout.marginLeft = 20;
- composite.setLayout(gridLayout);
- limitOptionalElementDepthCheckButtonControl = new Button(composite, SWT.CHECK);
- limitOptionalElementDepthCheckButtonControl.setText(XMLWizardsMessages._UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH);
- limitOptionalElementDepthCheckButtonControl.setEnabled(false);
- limitOptionalElementDepthCheckButtonControl.setSelection(true);
- limitOptionalElementDepthCheckButtonControl.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent selectionEvent) {
- boolean enabled = limitOptionalElementDepthCheckButtonControl.getSelection();
- limitOptionalElementDepthTextControl.setEnabled(enabled);
- }
- });
- limitOptionalElementDepthTextControl = new Text(composite, SWT.BORDER);
- limitOptionalElementDepthTextControl.setText(Integer.toString(OPTIONAL_ELEMENT_DEPTH_LIMIT_DEFAULT_VALUE));
- limitOptionalElementDepthTextControl.setEnabled(false);
- GridData gridaData = new GridData();
- gridaData.widthHint = 25;
- limitOptionalElementDepthTextControl.setLayoutData(gridaData);
- limitOptionalElementDepthTextControl.addListener(SWT.Verify, new Listener() {
- public void handleEvent(Event event) {
- String string = event.text;
- char[] chars = new char[string.length()];
- string.getChars(0, chars.length, chars, 0);
- for (int i = 0; i < chars.length; i++) {
- if (!('0' <= chars[i] && chars[i] <= '9')) {
- event.doit = false;
- return;
- }
- }
- }
- });
-
- radioButton[2] = new Button(group, SWT.CHECK);
- radioButton[2].setText(XMLWizardsMessages._UI_WIZARD_CREATE_FIRST_CHOICE);
- radioButton[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[2].setSelection(true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[2], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT3_HELPID);
-
- radioButton[3] = new Button(group, SWT.CHECK);
- radioButton[3].setText(XMLWizardsMessages._UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES);
- radioButton[3].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[3].setSelection(true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[3], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT4_HELPID);
- /*
- * radioButton = new Button[2];
- *
- * radioButton[0] = new Button(group, SWT.RADIO);
- * radioButton[0].setText(XMLWizardsMessages.getString("_UI_WIZARD_CREATE_REQUIRED"));
- * radioButton[0].setLayoutData(new
- * GridData(GridData.FILL_HORIZONTAL));
- * radioButton[0].setSelection(true);
- * WorkbenchHelp.setHelp(radioButton[0],
- * XMLBuilderContextIds.XMLC_CREATE_REQUIRED_ONLY);
- *
- * radioButton[1] = new Button(group, SWT.RADIO);
- * radioButton[1].setText(XMLWizardsMessages.getString("_UI_WIZARD_CREATE_OPTIONAL"));
- * radioButton[1].setLayoutData(new
- * GridData(GridData.FILL_HORIZONTAL));
- * WorkbenchHelp.setHelp(radioButton[1],
- * XMLBuilderContextIds.XMLC_CREATE_REQUIRED_AND_OPTION);
- */
- }
-
- // add the grammar specific generation options
- //
- {
- pageBook = new PageBook(containerGroup, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
- xsdOptionsPanel = new XSDOptionsPanel(this, pageBook);
- dtdOptionsPanel = new DTDOptionsPanel(this, pageBook);
- pageBook.showPage(xsdOptionsPanel);
- }
- }
-
- public void widgetSelected(SelectionEvent event) {
- int index = combo.getSelectionIndex();
- String rootElementName = (index != -1) ? combo.getItem(index) : null;
- generator.setRootElementName(rootElementName);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if (visible) {
- try {
- if (generator.getGrammarURI() == null) {
- generator.setGrammarURI(selectGrammarFilePage.getURI());
- generator.setXMLCatalogEntry(selectGrammarFilePage.getXMLCatalogEntry());
- }
- Assert.isNotNull(generator.getGrammarURI());
-
- if (generator.getCMDocument() == null) {
- final String[] errorInfo = new String[2];
- final CMDocument[] cmdocs = new CMDocument[1];
- Runnable r = new Runnable() {
- public void run() {
- cmdocs[0] = NewXMLGenerator.createCMDocument(generator.getGrammarURI(), errorInfo);
- }
- };
- org.eclipse.swt.custom.BusyIndicator.showWhile(Display.getCurrent(), r);
-
- generator.setCMDocument(cmdocs[0]);
- cmDocumentErrorMessage = errorInfo[1];
- }
-
- combo.removeAll();
- if ((generator.getCMDocument() != null) && (cmDocumentErrorMessage == null)) {
- CMNamedNodeMap nameNodeMap = generator.getCMDocument().getElements();
- Vector nameNodeVector = new Vector();
-
- for (int i = 0; i < nameNodeMap.getLength(); i++) {
- CMElementDeclaration cmElementDeclaration = (CMElementDeclaration) nameNodeMap.item(i);
- Object value = cmElementDeclaration.getProperty("Abstract"); //$NON-NLS-1$
- if (value != Boolean.TRUE) {
- nameNodeVector.add(cmElementDeclaration.getElementName());
- }
- }
-
- Object[] nameNodeArray = nameNodeVector.toArray();
- if (nameNodeArray.length > 0) {
- Arrays.sort(nameNodeArray, Collator.getInstance());
- }
-
- String defaultRootName = (String) (generator.getCMDocument()).getProperty("http://org.eclipse.wst/cm/properties/defaultRootName"); //$NON-NLS-1$
- int defaultRootIndex = -1;
- for (int i = 0; i < nameNodeArray.length; i++) {
- String elementName = (String) nameNodeArray[i];
-
- combo.add(elementName);
- if ((defaultRootName != null) && defaultRootName.equals(elementName)) {
- defaultRootIndex = i;
- }
- }
-
- if (nameNodeArray.length > 0) {
- defaultRootIndex = defaultRootIndex != -1 ? defaultRootIndex : 0;
- combo.select(defaultRootIndex);
- generator.setRootElementName(combo.getItem(defaultRootIndex));
- }
- }
-
- if (generator.getGrammarURI().endsWith("xsd")) //$NON-NLS-1$
- {
- pageBook.showPage(xsdOptionsPanel);
- generator.setDefaultSystemId(getDefaultSystemId());
- generator.createNamespaceInfoList();
-
- // Provide default namespace prefix if none
- for (int i = 0; i < generator.namespaceInfoList.size(); i++) {
- NamespaceInfo nsinfo = (NamespaceInfo) generator.namespaceInfoList.get(i);
- if (((nsinfo.prefix == null) || (nsinfo.prefix.trim().length() == 0)) && ((nsinfo.uri != null) && (nsinfo.uri.trim().length() != 0))) {
- nsinfo.prefix = getDefaultPrefix(generator.namespaceInfoList);
- }
- }
- xsdOptionsPanel.setNamespaceInfoList(generator.namespaceInfoList);
- }
- else if (generator.getGrammarURI().endsWith("dtd")) //$NON-NLS-1$
- {
- pageBook.showPage(dtdOptionsPanel);
- dtdOptionsPanel.update();
- }
- }
- catch (Exception e) {
- // XMLBuilderPlugin.getPlugin().getMsgLogger().writeCurrentThread();
- }
-
- /*
- * String errorMessage = computeErrorMessage(); if
- * (errorMessage == null) super.setVisible(visible);
- */
-
- updateErrorMessage();
- }
- }
-
- private String getDefaultPrefix(List nsInfoList) {
- String defaultPrefix = "p"; //$NON-NLS-1$
- if (nsInfoList == null) {
- return defaultPrefix;
- }
-
- Vector v = new Vector();
- for (int i = 0; i < nsInfoList.size(); i++) {
- NamespaceInfo nsinfo = (NamespaceInfo) nsInfoList.get(i);
- if (nsinfo.prefix != null) {
- v.addElement(nsinfo.prefix);
- }
- }
-
- if (v.contains(defaultPrefix)) {
- String s = defaultPrefix;
- for (int j = 0; v.contains(s); j++) {
- s = defaultPrefix + Integer.toString(j);
- }
- return s;
- }
- return defaultPrefix;
- }
-
- public int getOptionalElementDepthLimit() {
- int depth = -1;
- if(radioButton[1].getSelection() && limitOptionalElementDepthCheckButtonControl.getSelection()) {
- try {
- depth = Integer.parseInt(limitOptionalElementDepthTextControl.getText());
- } catch( Exception exception) {}
- }
- return depth;
- }
-
- public boolean isPageComplete() {
- boolean complete = ((generator.getRootElementName() != null) && (generator.getRootElementName().length() > 0)) && (getErrorMessage() == null);
-
- if (complete) {
- /*
- * int buildPolicy = radioButton[0].getSelection() ?
- * DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT :
- * DOMContentBuilder.BUILD_ALL_CONTENT;
- */
- int buildPolicy = 0;
- if (radioButton[0].getSelection()) {
- buildPolicy = buildPolicy | DOMContentBuilder.BUILD_OPTIONAL_ATTRIBUTES;
- }
- if (radioButton[1].getSelection()) {
- buildPolicy = buildPolicy | DOMContentBuilder.BUILD_OPTIONAL_ELEMENTS;
- }
- if (radioButton[2].getSelection()) {
- buildPolicy = buildPolicy | DOMContentBuilder.BUILD_FIRST_CHOICE | DOMContentBuilder.BUILD_FIRST_SUBSTITUTION;
- }
- if (radioButton[3].getSelection()) {
- buildPolicy = buildPolicy | DOMContentBuilder.BUILD_TEXT_NODES;
- }
-
- generator.setBuildPolicy(buildPolicy);
- }
-
- return complete;
- }
-
- public String computeErrorMessage() {
- String errorMessage = null;
-
- if (cmDocumentErrorMessage != null) {
- errorMessage = cmDocumentErrorMessage;
- }
- else if ((generator.getRootElementName() == null) || (generator.getRootElementName().length() == 0)) {
- errorMessage = XMLWizardsMessages._ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED;
- }
-
- return errorMessage;
- }
-
-
- public void updateErrorMessage() {
- String errorMessage = computeErrorMessage();
- if (errorMessage == null) {
- if (xsdOptionsPanel.isVisible()) {
-
- errorMessage = xsdOptionsPanel.computeErrorMessage();
- }
- else if (dtdOptionsPanel.isVisible()) {
- errorMessage = dtdOptionsPanel.computeErrorMessage();
- }
- }
- setErrorMessage(errorMessage);
- setPageComplete(isPageComplete());
- }
- }
-
- // //////////////End SelectRootElementPage
-
-
-
- public static GridLayout createOptionsPanelLayout() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.horizontalSpacing = 0;
- return gridLayout;
- }
-
-
-
- /**
- *
- */
- class XSDOptionsPanel extends Composite {
- protected String errorMessage = null;
- protected SelectRootElementPage parentPage;
- protected CommonEditNamespacesDialog editNamespaces;
- private IPath currentPath = null;
-
- public XSDOptionsPanel(SelectRootElementPage parentPage, Composite parent) {
- super(parent, SWT.NONE);
- this.parentPage = parentPage;
-
- setLayout(createOptionsPanelLayout());
- setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- private CommonEditNamespacesDialog getEditNamespaces() {
- if (editNamespaces == null) {
- Composite co = new Composite(this, SWT.NONE);
- co.setLayout(new GridLayout());
- String tableTitle = XMLWizardsMessages._UI_LABEL_NAMESPACE_INFORMATION;
- editNamespaces = new CommonEditNamespacesDialog(co, null, tableTitle, true, true);
- this.layout();
- }
- return editNamespaces;
- }
-
- public void setNamespaceInfoList(List list) {
- CommonEditNamespacesDialog editDialog = getEditNamespaces();
-
- if (newFilePage != null) {
- IPath newPath = newFilePage.getContainerFullPath();
- if (newPath != null) {
- if (!newPath.equals(currentPath)) {
- String resourceURI = "platform:/resource" + newPath.toString() + "/dummy"; //$NON-NLS-1$ //$NON-NLS-2$
- String resolvedPath = URIHelper.normalize(resourceURI, null, null);
- resolvedPath = URIHelper.removeProtocol(resolvedPath);
-
- currentPath = new Path(resolvedPath);
- editDialog.setResourcePath(currentPath);
- }
- }
- }
- editDialog.setNamespaceInfoList(list);
- editDialog.updateErrorMessage(list);
- }
-
- public void updateErrorMessage(List namespaceInfoList) {
- NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
- errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
- parentPage.updateErrorMessage();
- }
-
-
- public String computeErrorMessage() {
- return errorMessage;
- }
- }
-
-
- /**
- *
- */
- public class DTDOptionsPanel extends Composite implements ModifyListener {
- protected Group group;
- protected Text systemIdField;
- protected Text publicIdField;
- protected SelectRootElementPage parentPage;
-
- public DTDOptionsPanel(SelectRootElementPage parentPage, Composite parent) {
- super(parent, SWT.NONE);
- this.parentPage = parentPage;
- setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- setLayout(createOptionsPanelLayout());
- Group group = new Group(this, SWT.NONE);
- group.setText(XMLWizardsMessages._UI_LABEL_DOCTYPE_INFORMATION);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label publicIdLabel = new Label(group, SWT.NONE);
- publicIdLabel.setText(XMLWizardsMessages._UI_LABEL_PUBLIC_ID);
- publicIdField = new Text(group, SWT.SINGLE | SWT.BORDER);
- publicIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- publicIdField.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(publicIdField, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT5_HELPID);
-
- Label systemIdLabel = new Label(group, SWT.NONE);
- systemIdLabel.setText(XMLWizardsMessages._UI_LABEL_SYSTEM_ID);
- systemIdField = new Text(group, SWT.SINGLE | SWT.BORDER);
- systemIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- systemIdField.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(systemIdField, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT6_HELPID);
- }
-
- public void update() {
- String thePublicId = null;
- String theSystemId = null;
- ICatalogEntry xmlCatalogEntry = generator.getXMLCatalogEntry();
-
- if (xmlCatalogEntry != null) {
- if (xmlCatalogEntry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) {
- thePublicId = xmlCatalogEntry.getKey();
- theSystemId = xmlCatalogEntry.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
- if (theSystemId == null) {
- theSystemId = generator.getGrammarURI().startsWith("http:") ? generator.getGrammarURI() : URIHelper.getLastSegment(generator.getGrammarURI()); //$NON-NLS-1$
- }
- }
- else {
- theSystemId = xmlCatalogEntry.getKey();
- }
- }
- else {
- theSystemId = getDefaultSystemId();
- }
-
- publicIdField.setText(thePublicId != null ? thePublicId : ""); //$NON-NLS-1$
- systemIdField.setText(theSystemId != null ? theSystemId : ""); //$NON-NLS-1$
- }
-
- public void modifyText(ModifyEvent e) {
- generator.setSystemId(systemIdField.getText());
- generator.setPublicId(publicIdField.getText());
- parentPage.updateErrorMessage();
- }
-
- public String computeErrorMessage() {
- return null;
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java
deleted file mode 100644
index 4b923c48ff..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java
+++ /dev/null
@@ -1,78 +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.xml.ui.internal.wizards;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-// TODO cs... rename this class NewXMLActionDelegate
-// we need to re-add pre-validation using the validation framework API's
-// since we also need to add validation to the 'New XML' case, this
-// prevalidation
-// function should really go into the NewWizard somewhere
-//
-public class XMLImportActionDelegate implements IActionDelegate {
- /**
- * Checks the current selection and runs the separate browser to show the
- * content of the Readme file. This code shows how to launch separate
- * browsers that are not VA/Base desktop parts.
- *
- * @param action
- * the action that was performed
- */
- public void run(IAction action) {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- ISelection selection = workbenchWindow.getSelectionService().getSelection();
- Object selectedObject = getSelection(selection);
-
- if ((selectedObject instanceof IFile) && (selection instanceof IStructuredSelection)) {
- IFile file = (IFile) selectedObject;
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- try {
- NewXMLWizard.showDialog(workbenchWindow.getShell(), file, structuredSelection);
- }
- catch (Exception e) {
- // XMLCorePlugin.getDefault().getLog().log();
- }
- }
- }
-
- /**
- * unused
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // unused
- }
-
- // scammed from WindowUtility
- //
- public static Object getSelection(ISelection selection) {
- if (selection == null) {
- return null;
- } // end of if ()
-
- Object result = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection es = (IStructuredSelection) selection;
- Iterator i = es.iterator();
- if (i.hasNext()) {
- result = i.next();
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java
deleted file mode 100644
index e56a3d33ea..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java
+++ /dev/null
@@ -1,71 +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.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class XMLSchemaValidationChecker {
- public boolean isValid(IFile ifile) {
- String xsdFileName = ifile.getLocation().toString();
- return isValid(xsdFileName);
- }
-
- /**
- * Should this be implemented as a Validator and simply called as such
- * with a reporter that only checks the results for severity = error? Or
- * should the Xerces requirement be broken using a plug-in extension?
- */
-
- public boolean isValid(String xsdFileName) {
- // DOMASBuilderImpl builder = new DOMASBuilderImpl();
- // DOMErrorHandler errorHandler = new DOMErrorHandler();
- // builder.setErrorHandler(errorHandler);
- try {
- // String uri =
- URIHelper.getURIForFilePath(xsdFileName);
- // ASModel model = builder.parseASURI(uri);
- // if (errorHandler.hasError())
- // return false;
- }
- catch (Exception e) // invalid schema
- {
- return false;
- }
-
- return true;
- }
-
- // inner class
- class DOMErrorHandler implements ErrorHandler {
- private boolean hasError = false;
-
- public boolean hasError() {
- return hasError;
- }
-
- public void error(SAXParseException err) {
- hasError = true;
- }
-
- public void fatalError(SAXParseException exception) throws SAXException {
- hasError = true;
- }
-
- public void warning(SAXParseException exception) throws SAXException {
- // not an error
- }
- } // end DOMErrorHandlerImpl
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java
deleted file mode 100644
index ffea5d4624..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java
+++ /dev/null
@@ -1,40 +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.xml.ui.internal.wizards;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class XMLWizard {
- protected static XMLWizard instance = new XMLWizard();
-
- public synchronized static XMLWizard getInstance() {
- return instance;
- }
-
- public XMLWizard() {
- instance = this;
-
- }
-
- public ImageDescriptor getImageDescriptor(String name) {
- try {
- URL url = new URL(Platform.getBundle("org.eclipse.wst.xml.ui").getEntry("/"), name); //$NON-NLS-1$ //$NON-NLS-2$
- return ImageDescriptor.createFromURL(url);
- }
- catch (MalformedURLException e) {
- return ImageDescriptor.getMissingImageDescriptor();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
deleted file mode 100644
index 61e8947377..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 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 - Initial API and implementation
- * David Carver/STAR Standard - d_a_carver@yahoo.com - bug 192568
- **********************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Wizards
- *
- * @plannedfor 1.0
- */
-public class XMLWizardsMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.wizards.wizardResource";//$NON-NLS-1$
-
- public static String _UI_DIALOG_NEW_TITLE;
- public static String _UI_DIALOG_TITLE_INVALID_GRAMMAR;
- public static String _UI_DIALOG_MESSAGE_INVALID_GRAMMAR;
- public static String _UI_WIZARD_CREATE_NEW_TITLE;
- public static String _UI_RADIO_XML_FROM_DTD;
- public static String _UI_RADIO_XML_FROM_SCHEMA;
- public static String _UI_RADIO_XML_FROM_SCRATCH;
- public static String _UI_WIZARD_CREATE_XML_HEADING;
- public static String _UI_WIZARD_CREATE_XML_EXPL;
- public static String _UI_WIZARD_CREATE_XML_FILE_HEADING;
- public static String _UI_WIZARD_CREATE_XML_FILE_EXPL;
- public static String _UI_WIZARD_SELECT_DTD_FILE_DESC;
- public static String _UI_WIZARD_SELECT_DTD_FILE_TITLE;
- public static String _UI_WIZARD_SELECT_XSD_FILE_DESC;
- public static String _UI_WIZARD_SELECT_XSD_FILE_TITLE;
- public static String _UI_WIZARD_SELECT_ROOT_HEADING;
- public static String _UI_WIZARD_SELECT_ROOT_EXPL;
- public static String _UI_LABEL_ROOT_ELEMENT;
- public static String _UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
- public static String _UI_WARNING_MSG_NO_ROOT_ELEMENTS;
- public static String _UI_LABEL_NO_LOCATION_HINT;
- public static String _UI_WARNING_MSG_NO_LOCATION_HINT_1;
- public static String _UI_WARNING_MSG_NO_LOCATION_HINT_2;
- public static String _UI_WARNING_MSG_NO_LOCATION_HINT_3;
- public static String _UI_WIZARD_CONTENT_OPTIONS;
- public static String _UI_WIZARD_CREATE_REQUIRED;// commented out
- public static String _UI_WIZARD_CREATE_OPTIONAL;// commented out
- public static String _UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES;
- public static String _UI_WIZARD_CREATE_OPTIONAL_ELEMENTS;
- public static String _UI_WIZARD_CREATE_FIRST_CHOICE;
- public static String _UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES;
- public static String _UI_LABEL_DOCTYPE_INFORMATION;
- public static String _UI_LABEL_SYSTEM_ID;
- public static String _UI_LABEL_PUBLIC_ID;
- public static String _UI_WARNING_URI_NOT_FOUND_COLON;
- public static String _UI_INVALID_GRAMMAR_ERROR;
- public static String _ERROR_BAD_FILENAME_EXTENSION;
- public static String _ERROR_FILE_ALREADY_EXISTS;
- public static String _ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED;
- public static String _UI_LABEL_ERROR_SCHEMA_INVALID_INFO;
- public static String _UI_LABEL_ERROR_DTD_INVALID_INFO;
- public static String _UI_LABEL_ERROR_CATALOG_ENTRY_INVALID;
- public static String _UI_LABEL_NAMESPACE_INFORMATION;
- public static String Validation_Plugins_Unavailable;
- public static String Validation_cannot_be_performed;
- public static String ExampleProjectCreationOperation_op_desc;
- public static String ExampleProjectCreationOperation_op_desc_proj;
- public static String ExampleProjectCreationWizard_title;
- public static String ExampleProjectCreationWizard_op_error_title;
- public static String ExampleProjectCreationWizard_op_error_message;
- public static String ExampleProjectCreationWizard_overwritequery_title;
- public static String ExampleProjectCreationWizard_overwritequery_message;
- public static String ExampleProjectCreationWizardPage_error_alreadyexists;
-
- public static String NewXMLTemplatesWizardPage_0;
- public static String NewXMLTemplatesWizardPage_1;
- public static String NewXMLTemplatesWizardPage_2;
- public static String NewXMLTemplatesWizardPage_3;
- public static String NewXMLTemplatesWizardPage_4;
- public static String NewXMLTemplatesWizardPage_5;
- public static String NewXMLTemplatesWizardPage_6;
- public static String NewXMLTemplatesWizardPage_7;
-
- public static String _UI_DIALOG_XMLCATALOG_IMPORT_TITLE;
- public static String _UI_DIALOG_XMLCATALOG_EXPORT_TITLE;
- public static String _UI_DIALOG_XMLCATALOG_EXPORT_DESCRIPTION;
- public static String _UI_DIALOG_XMLCATALOG_IMPORT_DESCRIPTION;
- public static String _UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH;
- public static String _UI_WIZARD_GENERATING_XML_DOCUMENT;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLWizardsMessages.class);
- }
-
- private XMLWizardsMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
deleted file mode 100644
index 06a2a6f5d2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
+++ /dev/null
@@ -1,102 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-# David Carver/STAR Standard - d_a_carver@yahoo.com - bug 192568
-###############################################################################
-! Properties file for component: XML Tools - New XML Wizard
-! Packaged for translation in: xml.zip
-
-!XMLImportActionDelegate
-_UI_DIALOG_NEW_TITLE = New XML File
-_UI_DIALOG_TITLE_INVALID_GRAMMAR = Invalid Grammar
-_UI_DIALOG_MESSAGE_INVALID_GRAMMAR = The grammar file contains errors. If you proceed, an incorrect result file will be generated. Do you want to continue?
-
-!NewXMLBWizard
-_UI_WIZARD_CREATE_NEW_TITLE = New XML File
-_UI_RADIO_XML_FROM_DTD = Create XML file from a &DTD file
-_UI_RADIO_XML_FROM_SCHEMA = Create XML file from an &XML schema file
-_UI_RADIO_XML_FROM_SCRATCH = Create XML file from an XML &template
-_UI_WIZARD_CREATE_XML_HEADING = Create XML File From
-_UI_WIZARD_CREATE_XML_EXPL = Select how you would like to create your XML file.
-_UI_WIZARD_CREATE_XML_FILE_HEADING = XML
-_UI_WIZARD_CREATE_XML_FILE_EXPL = Create a new XML file.
-_UI_WIZARD_SELECT_DTD_FILE_DESC = Select the DTD file to create the XML file.
-_UI_WIZARD_SELECT_DTD_FILE_TITLE = Select DTD File
-_UI_WIZARD_SELECT_XSD_FILE_DESC = Select the schema file to create the XML file.
-_UI_WIZARD_SELECT_XSD_FILE_TITLE = Select XML Schema File
-_UI_WIZARD_SELECT_ROOT_HEADING = Select Root Element
-_UI_WIZARD_SELECT_ROOT_EXPL = Select the root element of the XML file.
-_UI_LABEL_ROOT_ELEMENT = Root element:
-_UI_WARNING_TITLE_NO_ROOT_ELEMENTS = No Root Elements
-_UI_WARNING_MSG_NO_ROOT_ELEMENTS = No root element exists since the schema provided has no global elements.
-_UI_LABEL_NO_LOCATION_HINT = Unspecified Namespace Location
-_UI_WARNING_MSG_NO_LOCATION_HINT_1 = You have not specified a location hint for one or more namespace entries.
-_UI_WARNING_MSG_NO_LOCATION_HINT_2 = Elements from these namespaces will not be generated. This may lead to an invalid generated document.
-_UI_WARNING_MSG_NO_LOCATION_HINT_3 = Click Yes to continue, Click No to go back and specify the location hints.
-_UI_WIZARD_CONTENT_OPTIONS = Content options
-
-_UI_WIZARD_CREATE_REQUIRED = &Create required content only
-_UI_WIZARD_CREATE_OPTIONAL = Create required and &optional content
-_UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH = L&imit optional element depth to:
-_UI_WIZARD_GENERATING_XML_DOCUMENT = Generating XML document...
-
-_UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES = Create optional &attributes
-_UI_WIZARD_CREATE_OPTIONAL_ELEMENTS = Create optional e&lements
-_UI_WIZARD_CREATE_FIRST_CHOICE = Create first choice of required &choice
-_UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES = Fill elements and attributes with &data
-
-_UI_LABEL_DOCTYPE_INFORMATION = Document type information
-_UI_LABEL_SYSTEM_ID = &System ID:
-_UI_LABEL_PUBLIC_ID = &Public ID:
-
-_UI_WARNING_URI_NOT_FOUND_COLON = The specified resource cannot be located :
-
-!NewModelWizard
-_UI_INVALID_GRAMMAR_ERROR = Invalid Grammar
-
-!NewModelWizard
-_ERROR_BAD_FILENAME_EXTENSION = The file name must end in one of the following extensions {0}.
-_ERROR_FILE_ALREADY_EXISTS = The same file already exists.
-_ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED = A root element must be specified.
-_UI_LABEL_ERROR_SCHEMA_INVALID_INFO = The schema file contains errors. Open it in the XML schema editor for details.
-_UI_LABEL_ERROR_DTD_INVALID_INFO = The DTD file contains errors. Open it in the DTD editor for details.
-
-_UI_LABEL_ERROR_CATALOG_ENTRY_INVALID = The selected catalog entry specifies a URI that can not be located.
-
-_UI_LABEL_NAMESPACE_INFORMATION=Namespace Information
-
-Validation_Plugins_Unavailable=Validation Plugins Unavailable
-Validation_cannot_be_performed=Validation cannot be performed because the validation plugins were disabled or not found. The generated file may be invalid. Do you wish to continue?
-
-!ImportXMLCatalogWizard
-_UI_DIALOG_XMLCATALOG_IMPORT_TITLE = Import XML Catalog
-_UI_DIALOG_XMLCATALOG_IMPORT_DESCRIPTION = Import all entries from an existing XML Catalog into the User Catalog.
-
-!ExportXMLCatalogWizard
-_UI_DIALOG_XMLCATALOG_EXPORT_TITLE = Export Existing XML Catalog
-_UI_DIALOG_XMLCATALOG_EXPORT_DESCRIPTION = Export all existing User Catalog entries.
-#
-# ExampleProject
-ExampleProjectCreationOperation_op_desc=Creating example projects...
-ExampleProjectCreationOperation_op_desc_proj=Configuring project...
-ExampleProjectCreationWizard_title=New Example Project
-ExampleProjectCreationWizard_op_error_title=Project Creation Failed
-ExampleProjectCreationWizard_op_error_message=Project could not be created.
-ExampleProjectCreationWizard_overwritequery_title=Overwrite
-ExampleProjectCreationWizard_overwritequery_message=Do you want to overwrite {0}?
-ExampleProjectCreationWizardPage_error_alreadyexists=Project already exists.
-
-NewXMLTemplatesWizardPage_0=Select XML Template
-NewXMLTemplatesWizardPage_1=Select a template as initial content in the XML page.
-NewXMLTemplatesWizardPage_2=Name
-NewXMLTemplatesWizardPage_3=Description
-NewXMLTemplatesWizardPage_4=&Use XML Template
-NewXMLTemplatesWizardPage_5=&Preview:
-NewXMLTemplatesWizardPage_6=Templates are 'New XML' templates found in the <a>XML Templates</a> preference page.
-NewXMLTemplatesWizardPage_7=&Templates:
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
deleted file mode 100644
index 2c11ee3f12..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy;
-import org.eclipse.wst.xml.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLStructuredContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Configuration for a source viewer which shows XML 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 StructuredTextViewerConfigurationXML 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 fLineStyleProviderForXML;
- private ILabelProvider fStatusLineLabelProvider;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationXML
- */
- public StructuredTextViewerConfigurationXML() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- // be sure this is last, so it can modify any results form previous
- // commands that might on on same partiion type.
- // add auto edit strategy that handles when tab key is pressed
- allStrategies.add(new AutoEditStrategyForTabs());
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
-
- if (fConfiguredContentTypes == null) {
- String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
- fConfiguredContentTypes = new String[xmlTypes.length + 2];
- fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
- fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
- int index = 0;
- System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
- }
- return fConfiguredContentTypes;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
- * org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor processor = new XMLStructuredContentAssistProcessor(
- this.getContentAssistant(), partitionType, sourceViewer);
- return new IContentAssistProcessor[]{processor};
- }
-
- 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) formatter).setMasterStrategy(new XMLFormattingStrategy());
-// ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorXML()));
-
- return formatter;
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- Vector vector = new Vector();
-
- // prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
- Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
- int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
- String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
- boolean useSpaces = XMLCorePreferenceNames.SPACE.equals(indentCharPref);
-
- for (int i = 0; i <= indentationWidth; i++) {
- StringBuffer prefix = new StringBuffer();
- boolean appendTab = false;
-
- if (useSpaces) {
- for (int j = 0; j + i < indentationWidth; j++) {
- prefix.append(' ');
- }
-
- if (i != 0) {
- appendTab = true;
- }
- }
- else {
- for (int j = 0; j < i; j++) {
- prefix.append(' ');
- }
-
- if (i != indentationWidth) {
- appendTab = true;
- }
- }
-
- if (appendTab) {
- prefix.append('\t');
- vector.add(prefix.toString());
- // remove the tab so that indentation - tab is also an indent
- // prefix
- prefix.deleteCharAt(prefix.length() - 1);
- }
- vector.add(prefix.toString());
- }
-
- vector.add(""); //$NON-NLS-1$
-
- return (String[]) vector.toArray(new String[vector.size()]);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
-
- if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IXMLPartitions.XML_COMMENT) || (partitionType == IXMLPartitions.XML_DECLARATION) || (partitionType == IXMLPartitions.XML_PI)) {
- providers = new LineStyleProvider[]{getLineStyleProviderForXML()};
- }
-
- return providers;
- }
-
- private LineStyleProvider getLineStyleProviderForXML() {
- if (fLineStyleProviderForXML == null) {
- fLineStyleProviderForXML = new LineStyleProviderForXML();
- }
- return fLineStyleProviderForXML;
- }
-
- public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
- if (fStatusLineLabelProvider == null) {
- fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
- public String getText(Object element) {
- if (element == null)
- return null;
-
- StringBuffer s = new StringBuffer();
- Node node = (Node) element;
- while (node != null) {
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, super.getText(node));
- }
-
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- node = ((Attr) node).getOwnerElement();
- else
- node = node.getParentNode();
-
- if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, IPath.SEPARATOR);
- }
- }
- return s.toString();
- }
-
- };
- }
- return fStatusLineLabelProvider;
- }
-
- protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
- Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
- targets.put(ContentTypeIdForXML.ContentTypeID_XML, null);
- return targets;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
deleted file mode 100644
index 4b90cfb3ff..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal;
-
-
-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.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.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is used to observe changes in the DOM and perform
- * occasional'scans' to deduce information. We use a delay timer mechanism to
- * ensure scans are made every couple of seconds to avoid performance
- * problems. Currently this class is used to keep track of referenced grammar
- * uri's within the document ensure that they are loaded by the
- * CMDocumentManager. We might want to generalize this class to perform other
- * suplimental information gathering that is suitable for 'time delayed'
- * computation (error hints etc.).
- */
-// TODO: Where should this class go?
-public class DOMObserver {
-
-
- // An abstract adapter that ensures that the children of a new Node are
- // also adapted
- //
- abstract class DocumentAdapter implements INodeAdapter {
- public DocumentAdapter() {
- }
-
- public void connect(Document document) {
- ((INodeNotifier) document).addAdapter(this);
- adapt(document.getDocumentElement());
- }
-
- public void dicconnect(Document document) {
- ((INodeNotifier) document).removeAdapter(this);
- }
-
- public void adapt(Element element) {
- if (element != null) {
- if (((INodeNotifier) element).getExistingAdapter(this) == null) {
- ((INodeNotifier) element).addAdapter(this);
-
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- adapt((Element) child);
- }
- }
- }
- }
- }
-
- public boolean isAdapterForType(Object type) {
- return type == this;
- }
-
- abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
- }
-
- /**
- * This class listens to the changes in the CMDocument and triggers a
- * CMDocument load
- */
- class MyDocumentAdapter extends DocumentAdapter {
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index) {
- switch (eventType) {
- case INodeNotifier.ADD : {
- if (newValue instanceof Element) {
- // System.out.println("ADD (to " +
- // ((Node)notifier).getNodeName() + ") " +
- // ((Element)newValue).getNodeName() + " old " +
- // oldValue);
- adapt((Element) newValue);
- }
- break;
- }
- // case INodeNotifier.REMOVE:
- case INodeNotifier.CHANGE :
- case INodeNotifier.STRUCTURE_CHANGED :
- case INodeNotifier.CONTENT_CHANGED : {
- Node node = (Node) notifier;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- switch (eventType) {
- case INodeNotifier.CHANGE :
- case INodeNotifier.STRUCTURE_CHANGED : {
- // structure change
- invokeDelayedCMDocumentLoad();
- break;
- }
- case INodeNotifier.CONTENT_CHANGED : {
- // some content changed
- break;
- }
- }
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- invokeDelayedCMDocumentLoad();
- }
- break;
- }
- }
- }
- }
-
- /**
- * Intentionally left visible to the user
- */
- class TimerJob extends Job {
- public TimerJob() {
- super(SSEUIMessages.LoadingReferencedGrammars);
- }
-
- public IStatus run(IProgressMonitor monitor) {
- monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
- invokeCMDocumentLoad();
- monitor.done();
- return Status.OK_STATUS;
- }
- }
-
- private Job timer = new TimerJob();
- protected Document fDocument;
- protected boolean isGrammarInferenceEnabled;
- /**
- * If true, DOMObserver is currently disabled and not loading the content
- * model
- */
- private boolean fIsDisabled = false;
- /**
- * If true, DOMObserver is currently trying to load the content model
- */
- private boolean fIsLoading = false;
-
- public DOMObserver(IStructuredModel model) {
- fDocument = (model instanceof IDOMModel) ? ((IDOMModel) model).getDocument() : null;
-
- if (fDocument != null) {
- // here we create and init an adapter that will listen to
- // changes to the document and contained elements
- MyDocumentAdapter adapter = new MyDocumentAdapter();
- adapter.connect(fDocument);
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
- if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
- CMDocumentManager cmDocumentManager = modelQuery.getCMDocumentManager();
- cmDocumentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
- }
-
- // attach a dom observer adapter to the document so others have access to
- // domobserver if needed
- INodeAdapter domObserverAdapter = ((INodeNotifier)fDocument).getExistingAdapter(DOMObserverAdapter.class);
- if (domObserverAdapter == null) {
- domObserverAdapter = new DOMObserverAdapter();
- ((INodeNotifier)fDocument).addAdapter(domObserverAdapter);
- }
- ((DOMObserverAdapter)domObserverAdapter).setDOMObserver(this);
- }
- }
-
- public void init() {
- // CS: we seem to expose an XSD initialization problem when we do this
- // immediately
- // very nasty... I need to revist this problem with Ed Merks
- //
- timer.schedule();
- }
-
- public void invokeCMDocumentLoad() {
- if (fIsDisabled) return;
- try {
- fIsLoading = true;
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
- if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
- CMDocumentLoader loader = isGrammarInferenceEnabled ? new InferredGrammarBuildingCMDocumentLoader(fDocument, modelQuery) : new CMDocumentLoader(fDocument, modelQuery);
- loader.loadCMDocuments();
- }
- } finally {
- fIsLoading = false;
- }
- }
-
- public void invokeDelayedCMDocumentLoad() {
- if (fIsDisabled) return;
- timer.schedule(2000);
- }
-
- public void setGrammarInferenceEnabled(boolean isEnabled) {
- isGrammarInferenceEnabled = isEnabled;
- }
-
- boolean setDisabled(boolean isDisabled, boolean forced) {
- boolean success = true;
-
- if (fIsDisabled != isDisabled) {
- fIsDisabled = isDisabled;
- if (forced) {
- if (isDisabled)
- success = timer.cancel();
- else
- invokeCMDocumentLoad();
- }
- }
- return success;
- }
-
- boolean isLoading() {
- return fIsLoading;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java
deleted file mode 100644
index fcd60c405a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java
+++ /dev/null
@@ -1,74 +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.wst.xml.ui.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * This is just an adapter that sits on a document node to allow clients
- * limited access to the DOMObserver. Clients who handle their own content
- * model document loading (as opposed to letting the DOMObserver do it) may
- * use this class to stop the DOMObserver from loading and possibly
- * interfering with the client's document loading.
- */
-public class DOMObserverAdapter implements INodeAdapter {
- private DOMObserver fObserver = null;
-
- public boolean isAdapterForType(Object type) {
- return type == DOMObserverAdapter.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing
- }
-
- /**
- * The DOMObserver is the one that adds the adapter to the document node,
- * so it'll set itself up here as well.
- *
- * @param observer
- */
- void setDOMObserver(DOMObserver observer) {
- fObserver = observer;
- }
-
- /**
- * Disable the DOMObserver to prevent it from future content model loading
- * for this document.
- *
- * @param disable
- * true if caller wants DOMObserver disabled. false if caller
- * wants DOMObserver enabled.
- * @param force
- * if true, DOMObserver will forcibly be disabled (if the
- * DOMObserver model loading job is scheduled, it will be
- * cancelled)
- * @return true if DOMObserver was successfully disabled. false if
- * DOMObserver was already in the process of loading and was
- * unable to stop
- */
- public boolean disableObserver(boolean disable, boolean force) {
- return fObserver.setDisabled(disable, force);
- }
-
- /**
- * Returns whether or not DOMObserver is currently attempting to load the
- * content model.
- *
- * @return true if DOMObserver is currently in the process of loading the
- * content models. false otherwise.
- */
- public boolean isObserverLoading() {
- return fObserver.isLoading();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java
deleted file mode 100644
index ab66be9094..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java
+++ /dev/null
@@ -1,18 +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.wst.xml.ui.internal;
-
-public interface IProductConstants {
- /**
- * The explorer view to use when creating the XML perspective
- */
- String PERSPECTIVE_EXPLORER_VIEW = "idPerspectiveHierarchyView"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java
deleted file mode 100644
index b98e7ab1d2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java
+++ /dev/null
@@ -1,163 +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.xml.ui.internal;
-
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.xml.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if ((level == OK_DEBUG) || (level == INFO_DEBUG) || (level == WARNING_DEBUG) || (level == ERROR_DEBUG)) {
- if (!isDebugging()) {
- return;
- }
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null) {
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null) {
- Platform.getLog(bundle).log(statusObj);
- }
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging()) {
- return false;
- }
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java
deleted file mode 100644
index 6f88be4b7a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java
+++ /dev/null
@@ -1,41 +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.wst.xml.ui.internal;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.IPageLayout;
-
-public class ProductProperties {
- /**
- * Default values for WTP level product
- */
- static final String ID_PERSPECTIVE_EXPLORER_VIEW = IPageLayout.ID_PROJECT_EXPLORER;
-
- /**
- * Return the value for the associated key from the Platform Product registry or return the
- * WTP default.
- *
- * @param key
- * @return String value of product's property
- */
- public static String getProperty(String key) {
- if (key == null)
- return null;
- String value = null;
- if (Platform.getProduct()!=null)
- value = Platform.getProduct().getProperty(key);
- if (value == null) {
- if (key.equals(IProductConstants.PERSPECTIVE_EXPLORER_VIEW))
- return ID_PERSPECTIVE_EXPLORER_VIEW;
- }
- return value;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLFormattingStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLFormattingStrategy.java
deleted file mode 100644
index 39432efc78..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLFormattingStrategy.java
+++ /dev/null
@@ -1,105 +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.wst.xml.ui.internal;
-
-import java.util.LinkedList;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-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.jface.text.formatter.IFormattingStrategyExtension;
-import org.eclipse.text.edits.TextEdit;
-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.Logger;
-import org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter;
-
-public class XMLFormattingStrategy extends ContextBasedFormattingStrategy implements IFormattingStrategyExtension {
-
- /** 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();
- private IRegion fRegion;
- private DefaultXMLPartitionFormatter formatter = new DefaultXMLPartitionFormatter();
-
- /**
- * @param formatProcessor
- */
- public XMLFormattingStrategy() {
- super();
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
- */
- public void format() {
- super.format();
-
- final IDocument document = (IDocument) fDocuments.removeFirst();
- final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
-
- if (document != null && partition != null && fRegion != null) {
- try {
- if (document instanceof IStructuredDocument) {
- IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
- if (model != null) {
- try {
- TextEdit edit = formatter.format(model, fRegion.getOffset(), fRegion.getLength());
- if (edit != null) {
- try {
- model.aboutToChangeModel();
- edit.apply(document);
- }
- finally {
- model.changedModel();
- }
- }
- }
- finally {
- model.releaseFromEdit();
- }
- }
- }
- }
- catch (BadLocationException e) {
- // log for now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
-
- /*
- * @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));
- fRegion = (IRegion) context.getProperty(FormattingContextProperties.CONTEXT_REGION);
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
- */
- public void formatterStops() {
- super.formatterStops();
-
- fPartitions.clear();
- fDocuments.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
deleted file mode 100644
index 2250814301..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * 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
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- * David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- **********************************************************************/
-package org.eclipse.wst.xml.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML UI
- *
- * @plannedfor 1.0
- */
-public class XMLUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.XMLUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- public static String Sample_XML_doc;
- public static String Comment_Delimiters_UI_;
- public static String Comment_Content_UI_;
- public static String Tag_Delimiters_UI_;
- public static String Tag_Names_UI_;
- public static String Attribute_Names_UI_;
- public static String Attribute_Equals_UI_;
- public static String Attribute_Values_UI_;
- public static String Declaration_Delimiters_UI_;
- public static String Content_UI_;
- public static String CDATA_Delimiters_UI_;
- public static String CDATA_Content_UI_;
- public static String Processing_Instruction_Del_UI_;
- public static String Processing_Instruction_Con_UI__UI_;
- public static String DOCTYPE_Name_UI_;
- public static String DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_;
- public static String DOCTYPE_Public_Reference_UI_;
- public static String DOCTYPE_System_Reference_UI_;
- public static String Entity_Reference_UI_;
- public static String DELETE;
- public static String ADD_PROCESSING_INSTRUCTION;
- public static String _UI_MENU_ADD_AFTER;
- public static String _UI_MENU_ADD_ATTRIBUTE;
- public static String _UI_MENU_ADD_BEFORE;
- public static String _UI_MENU_ADD_CHILD;
- public static String _UI_MENU_REMOVE;
- public static String _UI_MENU_REPLACE_WITH;
- public static String _UI_MENU_EDIT_DOCTYPE;
- public static String _UI_LABEL_UNDO_REPLACE_DESCRIPTION;
- public static String _UI_LABEL_EDIT_DOCTYPE;
- public static String _UI_INFO_EXPAND_ALL;
- public static String _UI_INFO_COLLAPSE_ALL;
- public static String _UI_MENU_ADD_DTD_INFORMATION;
- public static String _UI_MENU_ADD_SCHEMA_INFORMATION;
- public static String _UI_MENU_EDIT_PROCESSING_INSTRUCTION;
- public static String _UI_MENU_EDIT_NAMESPACES;
- public static String _UI_MENU_ADD_DTD_INFORMATION_TITLE;
- public static String _UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE;
- public static String _UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE;
- public static String _UI_MENU_NEW_ATTRIBUTE;
- public static String _UI_MENU_NEW_ATTRIBUTE_TITLE;
- public static String _UI_MENU_EDIT_ATTRIBUTE;
- public static String _UI_MENU_EDIT_ATTRIBUTE_TITLE;
- public static String _UI_MENU_NEW_ELEMENT;
- public static String _UI_MENU_NEW_ELEMENT_TITLE;
- public static String _UI_MENU_RENAME;
- public static String _UI_MENU_RENAME_TITLE;
- public static String _UI_LABEL_ELEMENT_NAME;
- public static String _UI_MENU_ADD_COMMENT;
- public static String _UI_MENU_ADD_PROCESSING_INSTRUCTION;
- public static String _UI_MENU_ADD_CDATA_SECTION;
- public static String _UI_MENU_ADD_PCDATA;
- public static String _UI_MENU_COMMENT;
- public static String _UI_MENU_PROCESSING_INSTRUCTION;
- public static String _UI_MENU_CDATA_SECTION;
- public static String _UI_MENU_PCDATA;
- public static String _UI_MENU_ADD;
- public static String _UI_COMMENT_VALUE;
- public static String _UI_PI_TARGET_VALUE;
- public static String _UI_PI_DATA_VALUE;
- public static String _UI_LABEL_ROOT_ELEMENT_VALUE;
- public static String _UI_LABEL_TARGET_COLON;
- public static String _UI_LABEL_DATA_COLON;
- public static String _UI_LABEL_ROOT_ELEMENT_NAME_COLON;
- public static String _UI_LABEL_PUBLIC_ID_COLON;
- public static String _UI_LABEL_SYSTEM_ID_COLON;
- public static String _UI_LABEL_BROWSE;
- public static String _UI_LABEL_BROWSE_1;
- public static String _UI_LABEL_SELECT_XML_CATALOG_ENTRY;
- public static String _UI_LABEL_SPECIFY_SYSTEM_ID;
- public static String _UI_LABEL_SELECT_FILE;
- public static String _UI_LABEL_KEY;
- public static String _UI_LABEL_URI;
- public static String _UI_LABEL_XML_CATALOG_COLON;
- public static String _UI_LABEL_NAMESPACE_NAME;
- public static String _UI_LABEL_LOCATION_HINT;
- public static String _UI_LABEL_PREFIX;
- public static String _UI_LABEL_NAMESPACE_NAME_COLON;
- public static String _UI_LABEL_LOCATION_HINT_COLON;
- public static String _UI_LABEL_PREFIX_COLON;
- public static String _UI_NO_NAMESPACE_NAME;
- public static String _UI_NO_PREFIX;
- public static String _UI_LABEL_XML_SCHEMA_INFORMATION;
- public static String _UI_LABEL_NAME_COLON;
- public static String _UI_LABEL_VALUE_COLON;
- public static String _UI_BUTTON_DELETE;
- public static String _UI_BUTTON_NEW;
- public static String _UI_BUTTON_EDIT;
- public static String _UI_LABEL_NEW_NAMESPACE_INFORMATION;
- public static String _UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE;
- public static String _UI_RADIO_BUTTON_SELECT_FROM_CATALOG;
- public static String _UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME;
- public static String _UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME;
- public static String _UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX;
- public static String _UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX;
- public static String _UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED;
- public static String _UI_WARNING_LOCATION_HINT_NOT_SPECIFIED;
- public static String _UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED;
- public static String _UI_WARNING_PREFIX_NOT_SPECIFIED;
- public static String _UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED;
- public static String _UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED;
- public static String _UI_INVALID_NAME;
- public static String _UI_ENTER_REQ_PREFIX_AND_NAMESPACE;
- public static String _UI_SELECT_REGISTERED_NAMESPACES;
- public static String _UI_SPECIFY_NEW_NAMESPACE;
- public static String _UI_SELECT_NAMESPACE_TO_ADD;
- public static String _UI_ADD_NAMESPACE_DECLARATIONS;
- public static String _UI_NAMESPACE_DECLARATIONS;
- public static String _UI_TARGET_NAMESPACE;
- public static String _ERROR_XML_ATTRIBUTE_ALREADY_EXISTS;
- public static String _ERROR_XML_ATTRIBUTE_IS_INVALID;
- public static String error_message_goes_here;
- public static String SurroundWithNewElementQuickAssistProposal_0;
- public static String SurroundWithNewElementQuickAssistProposal_1;
- public static String RenameInFileQuickAssistProposal_0;
- public static String RenameInFileQuickAssistProposal_1;
- public static String InsertRequiredAttrsQuickAssistProposal_0;
- public static String InsertRequiredAttrsQuickAssistProposal_1;
- public static String EncodingSettings_0;
- public static String EncodingSettings_1;
- public static String DragNodeCommand_0;
- public static String DragNodeCommand_1;
- public static String CommonEditNamespacesDialog_0;
- public static String JFaceNodeAdapter_1;
- public static String QuickFixProcessorXML_0;
- public static String QuickFixProcessorXML_1;
- public static String QuickFixProcessorXML_2;
- public static String QuickFixProcessorXML_3;
- public static String QuickFixProcessorXML_4;
- public static String QuickFixProcessorXML_5;
- public static String QuickFixProcessorXML_6;
- public static String QuickFixProcessorXML_7;
- public static String QuickFixProcessorXML_8;
- public static String QuickFixProcessorXML_9;
- public static String QuickFixProcessorXML_10;
- public static String QuickFixProcessorXML_11;
- public static String QuickFixProcessorXML_12;
- public static String QuickFixProcessorXML_13;
- public static String QuickFixProcessorXML_14;
- public static String QuickFixProcessorXML_15;
- public static String XMLPropertySourceAdapter_0;
- public static String WorkbenchDefaultEncodingSettings_0;
- public static String refreshoutline_0;
- public static String Creating_files_encoding;
- public static String End_tag_has_attributes;
- public static String Attribute__is_missing_a_value;
- public static String Attribute__has_no_value;
- public static String Missing_end_tag_;
- public static String Missing_start_tag_;
- public static String ReconcileStepForMarkup_0;
- public static String ReconcileStepForMarkup_1;
- public static String ReconcileStepForMarkup_2;
- public static String ReconcileStepForMarkup_3;
- public static String ReconcileStepForMarkup_4;
- public static String ReconcileStepForMarkup_5;
- public static String ReconcileStepForMarkup_6;
- public static String End_with_;
- public static String SEVERE_internal_error_occu_UI_;
- public static String No_known_attribute__UI_;
- public static String Content_Assist_not_availab_UI_;
- public static String Element__is_unknown;
- public static String Comment__;
- public static String Close_with__;
- public static String End_with__;
- public static String Close_with___;
- public static String Close_with____;
- public static String _Has_no_available_child;
- public static String No_known_child_tag;
- public static String __Has_no_known_child;
- public static String No_known_child_tag_names;
- public static String The_document_element__;
- public static String No_definition_for_in;
- public static String No_definition_for;
- public static String No_content_model_for;
- public static String No_content_model_found_UI_;
- public static String Cleanup_UI_;
- public static String Compress_empty_element_tags_UI_;
- public static String Insert_required_attributes_UI_;
- public static String Insert_missing_tags_UI_;
- public static String Quote_attribute_values_UI_;
- public static String Format_source_UI_;
- public static String Convert_EOL_codes_UI_;
- public static String Insert_XML_decl;
- public static String EOL_Windows_UI;
- public static String EOL_Unix_UI;
- public static String EOL_Mac_UI;
- public static String Creating_files;
- public static String Encoding_desc;
- public static String Encoding;
- public static String Creating_or_saving_files;
- public static String End_of_line_code_desc;
- public static String End_of_line_code;
- public static String EOL_Windows;
- public static String EOL_Unix;
- public static String EOL_Mac;
- public static String EOL_NoTranslation;
- public static String XMLFilesPreferencePage_ExtensionLabel;
- public static String XMLFilesPreferencePage_ExtensionError;
- public static String XMLContentAssistPreferencePage_Auto_Activation_UI_;
- public static String XMLContentAssistPreferencePage_Cycling_UI_;
- public static String Automatically_make_suggest_UI_;
- public static String Auto_Activation_Delay;
- public static String Not_an_integer;
- public static String Missing_integer;
- public static String Prompt_when_these_characte_UI_;
- public static String Formatting_UI_;
- public static String Line_width__UI_;
- public static String Split_multiple_attributes;
- public static String Align_final_bracket;
- public static String Preserve_PCDATA_Content;
- public static String Space_before_empty_close_tag;
- public static String Indent_using_tabs;
- public static String Indent_using_spaces;
- public static String Indentation_size;
- public static String Indentation_size_tip;
- public static String Clear_all_blank_lines_UI_;
- public static String Format_comments;
- public static String Format_comments_join_lines;
- public static String Grammar_Constraints;
- public static String Use_inferred_grammar_in_absence_of;
- public static String Suggestion_Strategy;
- public static String Suggestion_Strategy_Lax;
- public static String Suggestion_Strategy_Strict;
- public static String Element____1;
- public static String Content_Model____2;
- public static String Attribute____3;
- public static String Data_Type____4;
- public static String Enumerated_Values____5;
- public static String Default_Value____6;
- public static String Documentation_view_default_msg;
- public static String SourceMenu_label;
- public static String Comment_label; // Resource bundle
- public static String Comment_tooltip; // Resource bundle
- public static String Comment_description; // Resource bundle
- public static String Uncomment_label; // Resource bundle
- public static String Uncomment_tooltip; // Resource bundle
- public static String Uncomment_description; // Resource bundle
- public static String ToggleComment_label; // Resource bundle
- public static String ToggleComment_tooltip; // Resource bundle
- public static String ToggleComment_description; // Resource bundle
- public static String AddBlockComment_label; // Resource bundle
- public static String AddBlockComment_tooltip; // Resource bundle
- public static String AddBlockComment_description; // Resource bundle
- public static String RemoveBlockComment_label; // Resource bundle
- public static String RemoveBlockComment_tooltip; // Resource bundle
- public static String RemoveBlockComment_description; // Resource bundle
- public static String 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 OpenFileFromSource_label; // Resource bundle
- public static String OpenFileFromSource_tooltip; // Resource bundle
- public static String OpenFileFromSource_description; // Resource bundle
- public static String XMLContentOutlineConfiguration_0;
- public static String XMLTyping_Auto_Complete;
- public static String XMLTyping_Auto_Remove;
- public static String XMLTyping_Complete_Comments;
- public static String XMLTyping_Close_Strings;
- public static String XMLTyping_Close_Brackets;
- public static String XMLTyping_Complete_End_Tags;
- public static String XMLTyping_Complete_Elements;
- public static String XMLTyping_Remove_End_Tags;
- public static String XMLTyping_Start_Tag;
- public static String XMLTyping_End_Tag;
- public static String StructureSelectEnclosing_label;
- public static String StructureSelectEnclosing_tooltip;
- public static String StructureSelectEnclosing_description;
- public static String StructureSelectNext_label;
- public static String StructureSelectNext_tooltip;
- public static String StructureSelectNext_description;
- public static String StructureSelectPrevious_label;
- public static String StructureSelectPrevious_tooltip;
- public static String StructureSelectPrevious_description;
- public static String MESSAGE_XML_VALIDATION_MESSAGE_UI_;
- public static String Indicate_no_grammar_specified;
- public static String Indicate_no_document_element;
- public static String Indicate_no_grammar_specified_severities_error;
- public static String Indicate_no_grammar_specified_severities_warning;
- public static String Indicate_no_grammar_specified_severities_ignore;
- public static String Validating_files;
- 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 EmptyFilePreferencePage_0;
- public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
- public static String gotoMatchingTag_label;
- public static String gotoMatchingTag_description;
- public static String gotoMatchingTag_start;
- public static String gotoMatchingTag_end;
- public static String nextSibling_label;
- public static String nextSibling_description;
- public static String previousSibling_label;
- public static String previousSibling_description;
- public static String Use_XInclude;
- public static String Honour_all_schema_locations;
- public static String Open;
- public static String Open_With;
- public static String _UI_BUTTON_SORT;
- public static String MarkupValidation_files_label;
- public static String MarkupValidation_files;
- public static String Severity_error;
- public static String Severity_warning;
- public static String Severity_ignore;
- public static String Empty_element_tag;
- public static String End_tag_with_attributes;
- public static String Invalid_whitespace_before_tagname;
- public static String Missing_closing_bracket;
- public static String Missing_closing_quote;
- public static String Missing_end_tag;
- public static String Missing_start_tag;
- public static String Missing_quotes;
- public static String Namespace_in_pi_target;
- public static String Tag_name_missing;
- public static String Whitespace_at_start;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, XMLUIMessages.class);
- }
-
- private XMLUIMessages() {
- // cannot create new instance
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null) {
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java
deleted file mode 100644
index fe8f1715b6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java
+++ /dev/null
@@ -1,117 +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.xml.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-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;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XMLUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.xml.ui"; //$NON-NLS-1$
-
- protected static XMLUIPlugin instance = null;
-
- public static XMLUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static XMLUIPlugin getInstance() {
- return instance;
- }
-
- /**
- * The template context type registry for the xml editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- /**
- * The template store for the xml editor.
- *
- */
- private TemplateStore fTemplateStore;
-
- public XMLUIPlugin() {
- super();
- instance = this;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * Returns the template store for the xml editor templates.
- *
- * @return the template store for the xml editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), XMLUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the xml plugin.
- *
- * @return the template context type registry for the xml plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsXML.ALL);
- registry.addContextType(TemplateContextTypeIdsXML.NEW);
- registry.addContextType(TemplateContextTypeIdsXML.TAG);
- registry.addContextType(TemplateContextTypeIdsXML.ATTRIBUTE);
- registry.addContextType(TemplateContextTypeIdsXML.ATTRIBUTE_VALUE);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-
- /**
- * Get an image from the registry.
- *
- * *This method is used by the referencingfile dialog and should be
- * removed when the dialog is moved to anothercomponent.
- *
- * @param imageName
- * The name of the image.
- * @return The image registered for the given name.
- */
- public Image getImage(String imageName) {
- return getWorkbench().getSharedImages().getImage(imageName);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
deleted file mode 100644
index cad523dd9e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
+++ /dev/null
@@ -1,377 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.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
-# Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
-# David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
-###############################################################################
-## The following line is a sample XML document. Please translate only the following parts:
-## begin color definitions
-## Normal text content.
-Sample_XML_doc=<?xml version=\"1.0\"?>\n<?customProcessingInstruction\n\tXML processor specific\n\tcontent ?>\n<!DOCTYPE colors\n\tPUBLIC \"//IBM/XML/COLORS/\" \"colors.dtd\">\n<colors>\n\t<!-- begin color definitions -->\n\t<color name=\"plaintext\" foreground=\"#000000\"\n\t\tbackground=\"#D4D0C8\" />\n\t<color name=\"bold\" foreground=\"#000000\"\n\t\tbackground=\"#B3ACA0\" />\n\t<![CDATA[<123456789>]]>\n\tNormal text content.\n\t===&gt;look at me!&lt;===\n\t<color name=\"inverse\" foreground=\"#F0F0F0\"\n\t\tbackground=\"#D4D0C8\" />\n\n</colors>\n
-Comment_Delimiters_UI_=Comment Delimiters
-Comment_Content_UI_=Comment Content
-Tag_Delimiters_UI_=Tag Delimiters
-Tag_Names_UI_=Tag Names
-Attribute_Names_UI_=Attribute Names
-Attribute_Equals_UI_=Attribute Equal Signs
-Attribute_Values_UI_=Attribute Values
-Declaration_Delimiters_UI_=Declaration Delimiters
-Content_UI_=Content
-Entity_Reference_UI_=Entity References
-## on the following 2 lines, do not translate CDATA
-CDATA_Delimiters_UI_=CDATA Delimiters
-CDATA_Content_UI_=CDATA Content
-Processing_Instruction_Del_UI_=Processing Instruction Delimiters
-Processing_Instruction_Con_UI__UI_=Processing Instruction Content
-## on the following line solely translate: Name
-DOCTYPE_Name_UI_=DOCTYPE Name
-## on the following line solely translate: Keyword
-DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_=DOCTYPE SYSTEM/PUBLIC Keyword
-## on the following line solely translate: Public Reference
-DOCTYPE_Public_Reference_UI_=DOCTYPE Public Reference
-## on the following line solely translate: System Reference
-DOCTYPE_System_Reference_UI_=DOCTYPE System Reference
-# XML Common UI
-# Constants for strings
-
-DELETE=Remove
-ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-
-_UI_MENU_ADD_AFTER=Add &After
-_UI_MENU_ADD_ATTRIBUTE=Add A&ttribute
-_UI_MENU_ADD_BEFORE=Add &Before
-_UI_MENU_ADD_CHILD=Add &Child
-_UI_MENU_REMOVE=Re&move
-_UI_MENU_REPLACE_WITH=Re&place With
-_UI_MENU_EDIT_DOCTYPE=Edit DOCTYPE...
-_UI_LABEL_UNDO_REPLACE_DESCRIPTION=Replace
-_UI_LABEL_EDIT_DOCTYPE=Edit DOCTYPE
-_UI_INFO_EXPAND_ALL=Expand All
-_UI_INFO_COLLAPSE_ALL=Collapse All
-
-_UI_MENU_ADD_DTD_INFORMATION=Add DTD Information...
-_UI_MENU_ADD_SCHEMA_INFORMATION=Add Schema Information...
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION=Edit Process&ing Instruction...
-_UI_MENU_EDIT_NAMESPACES=Edit &Namespaces...
-
-_UI_MENU_ADD_DTD_INFORMATION_TITLE=Add DTD Information
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE=Edit Processing Instruction
-_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE=Edit Schema Information
-
-_UI_MENU_NEW_ATTRIBUTE=&New Attribute...
-_UI_MENU_NEW_ATTRIBUTE_TITLE=New Attribute
-_UI_MENU_EDIT_ATTRIBUTE=Edit Attribute...
-_UI_MENU_EDIT_ATTRIBUTE_TITLE=Edit Attribute
-_UI_MENU_NEW_ELEMENT=New &Element...
-_UI_MENU_NEW_ELEMENT_TITLE=New Element
-_UI_MENU_RENAME=R&ename
-_UI_MENU_RENAME_TITLE=Rename
-_UI_LABEL_ELEMENT_NAME=Element name:
-
-_UI_MENU_ADD_COMMENT=Add Comment
-_UI_MENU_ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-_UI_MENU_ADD_CDATA_SECTION=Add CDATA Section
-_UI_MENU_ADD_PCDATA=Add #PCDATA;
-
-_UI_MENU_COMMENT=C&omment
-_UI_MENU_PROCESSING_INSTRUCTION=P&rocessing Instruction
-_UI_MENU_CDATA_SECTION=CDATA Section
-_UI_MENU_PCDATA=#PC&DATA;
-
-_UI_MENU_ADD=Add
-
-_UI_COMMENT_VALUE=comment
-_UI_PI_TARGET_VALUE=target
-_UI_PI_DATA_VALUE=data
-_UI_LABEL_ROOT_ELEMENT_VALUE=RootElement
-
-_UI_LABEL_TARGET_COLON=Target:
-_UI_LABEL_DATA_COLON=Data:
-_UI_LABEL_ROOT_ELEMENT_NAME_COLON=Root &element name:
-_UI_LABEL_PUBLIC_ID_COLON=&Public ID:
-_UI_LABEL_SYSTEM_ID_COLON=&System ID:
-_UI_LABEL_BROWSE=&Browse...
-_UI_LABEL_BROWSE_1=B&rowse...
-_UI_LABEL_SELECT_XML_CATALOG_ENTRY=Select XML Catalog Entry
-_UI_LABEL_SPECIFY_SYSTEM_ID=Specify System ID
-_UI_LABEL_SELECT_FILE=Select File
-
-_UI_LABEL_KEY=Key
-_UI_LABEL_URI=URI:
-_UI_LABEL_XML_CATALOG_COLON=XML &Catalog
-_UI_LABEL_NAMESPACE_NAME=Namespace Name
-_UI_LABEL_LOCATION_HINT=Location Hint
-_UI_LABEL_PREFIX=Prefix
-_UI_LABEL_NAMESPACE_NAME_COLON=&Namespace Name:
-_UI_LABEL_LOCATION_HINT_COLON=&Location Hint:
-_UI_LABEL_PREFIX_COLON=&Prefix:
-_UI_NO_NAMESPACE_NAME=<no namespace name>
-_UI_NO_PREFIX=<no prefix>
-
-_UI_LABEL_XML_SCHEMA_INFORMATION=XML Schema Information
-
-_UI_LABEL_NAME_COLON=Name:
-_UI_LABEL_VALUE_COLON=Value:
-
-_UI_BUTTON_DELETE=&Delete
-_UI_BUTTON_NEW=New...
-_UI_BUTTON_EDIT=&Edit...
-
-_UI_LABEL_NEW_NAMESPACE_INFORMATION=New Namespace Information
-
-# SelectFileOrXMLCatalogIdPanel.java
-
-_UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE=Select file from &Workspace
-_UI_RADIO_BUTTON_SELECT_FROM_CATALOG=Select &XML Catalog entry
-
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME=More than one namespace has been specified with the namespace name :
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME=More than one schema has been specified without a namespace name
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX=More than one namespace has been specificed without a prefix
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX=More than one namespace has been specified with the prefix :
-_UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED=The specified schema can not be located :
-_UI_WARNING_LOCATION_HINT_NOT_SPECIFIED=A location hint has not been specified for the namespace with name
-_UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED=A name must be specified for the namespace with prefix :
-_UI_WARNING_PREFIX_NOT_SPECIFIED=A prefix must be specified for the namespace named :
-_UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED=A root element name must be specified.
-_UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED=A system ID must be specified.
-
-_UI_INVALID_NAME=Invalid name
-
-# String used for editing namespaces (org.eclipse.wst.xml.ui.nsedit)
-_UI_ENTER_REQ_PREFIX_AND_NAMESPACE=Enter the required prefix and namespace URI for the namespace declaration.
-_UI_SELECT_REGISTERED_NAMESPACES=Select From &Registered Namespaces
-_UI_SPECIFY_NEW_NAMESPACE=Specify New Na&mespace
-_UI_SELECT_NAMESPACE_TO_ADD=&Select the namespace declarations to add.
-_UI_ADD_NAMESPACE_DECLARATIONS=Add Namespace Declarations
-_UI_NAMESPACE_DECLARATIONS=&Namespace Declarations
-_UI_TARGET_NAMESPACE=Target Namespace
-
-_ERROR_XML_ATTRIBUTE_ALREADY_EXISTS=The element already has an attribute with this name.
-
-#
-error_message_goes_here=error message goes here
-SurroundWithNewElementQuickAssistProposal_0=Surround with new element
-SurroundWithNewElementQuickAssistProposal_1=Surround with new element
-RenameInFileQuickAssistProposal_0=Link all references for a rename in file (does not change references in other files)
-RenameInFileQuickAssistProposal_1=Rename in file
-InsertRequiredAttrsQuickAssistProposal_0=Insert required attributes
-InsertRequiredAttrsQuickAssistProposal_1=Insert required attributes
-EncodingSettings_0=IANA:
-EncodingSettings_1=Encoding:
-DragNodeCommand_0=Move
-DragNodeCommand_1=Copy
-CommonEditNamespacesDialog_0=&Add...
-JFaceNodeAdapter_1=Refresh Property Sheet
-QuickFixProcessorXML_0=Remove empty tag
-QuickFixProcessorXML_1=Change to empty-element tag
-QuickFixProcessorXML_2=Remove this tag
-QuickFixProcessorXML_3=Insert end tag before first child element
-QuickFixProcessorXML_4=Insert end tag at end of element
-QuickFixProcessorXML_5=Remove attributes in end tag
-QuickFixProcessorXML_6=Insert default attribute value
-QuickFixProcessorXML_7=Remove this attribute
-QuickFixProcessorXML_8=Remove spaces before tag name
-QuickFixProcessorXML_9=Remove spaces before processing instruction
-QuickFixProcessorXML_10=Remove namespace in processing instruction
-QuickFixProcessorXML_11=Remove this element
-QuickFixProcessorXML_12=Remove this attribute value
-QuickFixProcessorXML_13=Insert required attribute
-QuickFixProcessorXML_14=Quote attribute value
-QuickFixProcessorXML_15=Insert closing bracket
-XMLPropertySourceAdapter_0=General
-
-WorkbenchDefaultEncodingSettings_0=Use workspace encoding
-refreshoutline_0=Refreshing Outline
-Creating_files_encoding=Creating files encoding preference
-# ReconcileStepForMarkup
-End_tag_has_attributes=End tag has attributes
-Attribute__is_missing_a_value=Attribute \"{0}\" is missing a value
-Attribute__has_no_value=Attribute \"{0}\" has no value
-Missing_start_tag_=Missing start tag \"{0}\"
-Missing_end_tag_=Missing end tag \"{0}\"
-ReconcileStepForMarkup_0=Missing closing quote
-ReconcileStepForMarkup_1=Missing quotes for attribute value
-ReconcileStepForMarkup_2=A tagname cannot start with a space
-ReconcileStepForMarkup_3=Empty tags are not allowed
-ReconcileStepForMarkup_4=Namespaces are not allowed in a Processing Instruction target
-ReconcileStepForMarkup_5=Spaces are not allowed before a Processing Instruction
-ReconcileStepForMarkup_6=Tag missing closing bracket '>'
-# Content Assist
-End_with_=End with {0}>
-SEVERE_internal_error_occu_UI_=SEVERE internal error occurred
-No_known_attribute__UI_=No known attribute
-Content_Assist_not_availab_UI_=Content Assist not available at the current location
-Element__is_unknown=Element <{0}> is unknown.
-Comment__=comment {0}
-Close_with__=Close with {0}
-End_with__=End with \"</{0}>\"
-Close_with___=Close with \"{0}\"
-Close_with____=Close with \"></{0}>\"
-_Has_no_available_child={0} has no available child tags.
-No_known_child_tag=No known child tag names of <{0}> begin with \"{1}\".
-__Has_no_known_child=<{0}> has no known child tags.
-No_known_child_tag_names=No known child tag names of <{0}> begin with \"{1}\"
-The_document_element__=The document element <{0}> is already present.
-No_definition_for_in=No definition was found for element <{0}> in {1}
-No_definition_for=No definition was found for element <{0}>
-No_content_model_for=No content model found for {0}.
-No_content_model_found_UI_=No content model found
-## The following strings are for the XML Cleanup dialog
-Cleanup_UI_=Cleanup
-Compress_empty_element_tags_UI_=&Compress empty element tags
-Insert_required_attributes_UI_=Insert &required attributes
-Insert_missing_tags_UI_=&Insert missing tags
-Quote_attribute_values_UI_=&Quote attribute values
-Format_source_UI_=&Format source
-Convert_EOL_codes_UI_=Convert line &delimiters to
-Insert_XML_decl=Fix XML declaration
-EOL_Windows_UI=&Windows
-EOL_Unix_UI=U&NIX
-EOL_Mac_UI=&Mac
-## XML Files preference page
-Creating_files=Creating files
-Encoding_desc=The following encoding will apply:
-Encoding=En&coding:
-Creating_or_saving_files=Creating or saving files
-End_of_line_code_desc=The following line delimiter will apply:
-End_of_line_code=&Line delimiter:
-EOL_Windows=Windows
-EOL_Unix=UNIX
-EOL_Mac=Mac
-EOL_NoTranslation=No translation
-Validating_files=Validating files
-Indicate_no_grammar_specified=No &grammar specified:
-Indicate_no_grammar_specified_severities_error=Error
-Indicate_no_grammar_specified_severities_warning=Warning
-Indicate_no_grammar_specified_severities_ignore=Ignore
-XMLFilesPreferencePage_ExtensionLabel=Add this &suffix (if not specified):
-XMLFilesPreferencePage_ExtensionError=Suffix must be one of the following {0}.
-## XML Source preference page
-XMLContentAssistPreferencePage_Auto_Activation_UI_=Auto Activation
-XMLContentAssistPreferencePage_Cycling_UI_=Cycling
-Automatically_make_suggest_UI_=Automatically ma&ke suggestions
-Auto_Activation_Delay=Auto activation dela&y (ms):
-Not_an_integer=''{0}'' is not a positive integer.
-Missing_integer=A positive integer must be specified.
-Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
-Formatting_UI_=Formatting
-Line_width__UI_=Line &width:
-Split_multiple_attributes=Split &multiple attributes each on a new line
-Align_final_bracket=&Align final bracket in multi-line element tags
-Preserve_PCDATA_Content=&Preserve whitespace in tags with PCDATA content
-Space_before_empty_close_tag=Ins&ert whitespace before closing empty end-tags
-Indent_using_tabs=&Indent using tabs
-Indent_using_spaces=I&ndent using spaces
-Indentation_size=In&dentation size:
-Indentation_size_tip=Indentation size
-Clear_all_blank_lines_UI_=Clear all &blank lines
-Format_comments=&Format comments
-Format_comments_join_lines=&Join lines
-Grammar_Constraints=Grammar Constraints
-Use_inferred_grammar_in_absence_of=&Use inferred grammar in absence of DTD/Schema
-Suggestion_Strategy=&Suggestion strategy:
-Suggestion_Strategy_Lax=Lax
-Suggestion_Strategy_Strict=Strict
-## tag info
-Element____1=Element :
-Content_Model____2=Content Model :
-Attribute____3=Attribute :
-Data_Type____4=Data Type :
-Enumerated_Values____5=Enumerated Values :
-Default_Value____6=Default Value :
-Documentation_view_default_msg=<p>Select a node in the editor to display XML Documentation if any is available.</p>
-## copied from sse.ui
-SourceMenu_label=&Source
-Comment_label=Co&mment
-Comment_tooltip=Comment
-Comment_description=Comment
-Uncomment_label=&Uncomment
-Uncomment_tooltip=Uncomment
-Uncomment_description=Uncomment
-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
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-FindOccurrences_label=Occurrences in File
-OpenFileFromSource_label=Op&en Selection
-OpenFileFromSource_tooltip=Open an editor on the selected link
-OpenFileFromSource_description=Open an editor on the selected link
-XMLContentOutlineConfiguration_0=&Show Attributes
-XMLTyping_Auto_Complete=Automatically close
-XMLTyping_Auto_Remove=Automatically remove
-XMLTyping_Complete_Comments=&Comments
-XMLTyping_Close_Strings=A&ttribute values
-XMLTyping_Close_Brackets=(Parentheses) and [square] brac&kets
-XMLTyping_Complete_End_Tags=&Automatically close the tag
-XMLTyping_Complete_Elements=&Insert a matching end tag
-XMLTyping_Remove_End_Tags=E&nd tags when creating empty self-closing tags
-XMLTyping_Start_Tag=When typing a start tag
-XMLTyping_End_Tag=When typing an end tag
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-MESSAGE_XML_VALIDATION_MESSAGE_UI_=XML Validator validating {0}
-SyntaxColoringPage_0=S&yntax Element:
-SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=&Bold
-SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strikethrough
-SyntaxColoringPage_6=&Underline
-EmptyFilePreferencePage_0=Expand the tree to edit preferences for a specific feature.
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=XML editing preferences. Note that some preferences may be set on the <a>{0}</a> preference page.
-Use_XInclude=Process XML &Inclusions
-Honour_all_schema_locations=&Honour all XML schema locations
-nextSibling_label=Next Sibling
-nextSibling_description=Go to Next Sibling
-previousSibling_label=Previous Sibling
-previousSibling_description=Go to Previous Sibling
-gotoMatchingTag_label=Matching Tag
-gotoMatchingTag_description=Go To Matching Tag
-gotoMatchingTag_start=Start tag of element <{0}>
-gotoMatchingTag_end=End tag of element <{0}>
-Open=Open ''{0}''
-Open_With=Open ''{0}'' with {1}
-_UI_BUTTON_SORT=Sort
-Validating_files=Validating files
-Indicate_no_document_element=Missing r&oot element:
-Indicate_no_grammar_specified_severities_error=Error
-Indicate_no_grammar_specified_severities_warning=Warning
-Indicate_no_grammar_specified_severities_ignore=Ignore
-MarkupValidation_files_label=Errors/Warnings
-MarkupValidation_files=&Enable markup validation
-Severity_error=Error
-Severity_warning=Warning
-Severity_ignore=Ignore
-Empty_element_tag=Invalid e&mpty element tag:
-End_tag_with_attributes=Invalid end &tag with attributes:
-Invalid_whitespace_before_tagname=Invalid &white space before tag name:
-Missing_closing_bracket=Missing &closing bracket:
-Missing_closing_quote=Missing closing &quote:
-Missing_end_tag=Missing e&nd tag:
-Missing_start_tag=Missing &start tag:
-Missing_quotes=Missing q&uotes:
-Namespace_in_pi_target=In&valid name space in PI:
-Tag_name_missing=Missing tag n&ame:
-Whitespace_at_start=Inva&lid white space at start:
-_ERROR_XML_ATTRIBUTE_IS_INVALID=\"{0}\" is not a valid attribute name \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java
deleted file mode 100644
index e00b29d7eb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,117 +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.xml.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xml.ui.internal.Logger;
-
-/**
- * Abstract comment action delegate for XML editors
- */
-abstract public class AbstractCommentActionXMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- static final String CLOSE_COMMENT = "-->"; //$NON-NLS-1$
- static final String OPEN_COMMENT = "<!--"; //$NON-NLS-1$
-
- IEditorPart fEditor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor) fEditor;
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null) {
- // get current text selection
- ITextSelection textSelection = getCurrentSelection();
- if (textSelection.isEmpty()) {
- return;
- }
-
- processAction(document, textSelection);
- }
- }
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- private ITextSelection getCurrentSelection() {
- if (fEditor instanceof ITextEditor) {
- ISelectionProvider provider = ((ITextEditor) fEditor).getSelectionProvider();
- if (provider != null) {
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection) {
- return (ITextSelection) selection;
- }
- }
- }
- return TextSelection.emptySelection();
- }
-
- abstract void processAction(IDocument document, ITextSelection textSelection);
-
- void removeOpenCloseComments(IDocument document, int offset, int length) {
- try {
- int adjusted_length = length;
-
- // remove open comments
- String string = document.get(offset, length);
- int index = string.lastIndexOf(OPEN_COMMENT);
- while (index != -1) {
- document.replace(offset + index, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
- index = string.lastIndexOf(OPEN_COMMENT, index - 1);
- adjusted_length -= OPEN_COMMENT.length();
- }
-
- // remove close comments
- string = document.get(offset, adjusted_length);
- index = string.lastIndexOf(CLOSE_COMMENT);
- while (index != -1) {
- document.replace(offset + index, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
- index = string.lastIndexOf(CLOSE_COMMENT, index - 1);
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
deleted file mode 100644
index be7e202da3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-
-public abstract class AbstractNodeActionManager extends BaseNodeActionManager {
-
-
- /**
- * AddNodeAction
- */
- public class AddNodeAction extends NodeAction {
- protected CMNode cmnode;
- protected String description;
- protected int index;
- protected int nodeType;
- protected Node parent;
- protected String undoDescription;
-
-
- public AddNodeAction(CMNode cmnode, Node parent, int index) {
- this.cmnode = cmnode;
- this.parent = parent;
- this.index = index;
-
- String text = getLabel(parent, cmnode);
- setText(text);
- description = text;
- undoDescription = XMLUIMessages._UI_MENU_ADD + " " + text; //$NON-NLS-1$
- ImageDescriptor descriptor = CMImageUtil.getImageDescriptor(cmnode);
- if (descriptor == null) {
- descriptor = imageDescriptorCache.getImageDescriptor(cmnode);
- }
- setImageDescriptor(descriptor);
- }
-
-
- public AddNodeAction(int nodeType, Node parent, int index) {
- this.nodeType = nodeType;
- this.index = index;
- this.parent = parent;
-
- switch (nodeType) {
- case Node.COMMENT_NODE : {
- description = XMLUIMessages._UI_MENU_COMMENT;
- undoDescription = XMLUIMessages._UI_MENU_ADD_COMMENT;
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- description = XMLUIMessages._UI_MENU_PROCESSING_INSTRUCTION;
- undoDescription = XMLUIMessages._UI_MENU_ADD_PROCESSING_INSTRUCTION;
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- description = XMLUIMessages._UI_MENU_CDATA_SECTION;
- undoDescription = XMLUIMessages._UI_MENU_ADD_CDATA_SECTION;
- break;
- }
- case Node.TEXT_NODE : {
- description = XMLUIMessages._UI_MENU_PCDATA;
- undoDescription = XMLUIMessages._UI_MENU_ADD_PCDATA;
- break;
- }
- }
- setText(description);
- setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
- }
-
-
- protected void addNodeForCMNode() {
- if (parent != null) {
- insert(parent, cmnode, index);
- }
- }
-
-
- protected void addNodeForNodeType() {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
- Node newChildNode = null;
- boolean format = true;
- switch (nodeType) {
- case Node.COMMENT_NODE : {
- newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- newChildNode = document.createCDATASection(""); //$NON-NLS-1$
- break;
- }
- case Node.TEXT_NODE : {
- format = false;
- newChildNode = document.createTextNode(parent.getNodeName());
- break;
- }
- }
-
- if (newChildNode != null) {
- List list = new Vector(1);
- list.add(newChildNode);
- insertNodesAtIndex(parent, list, index, format);
- }
- }
-
-
- public String getUndoDescription() {
- return undoDescription;
- }
-
-
- public void run() {
- if (validateEdit(getModel(), getWorkbenchWindowShell())) {
- beginNodeAction(this);
- if (cmnode != null) {
- addNodeForCMNode();
- }
- else {
- addNodeForNodeType();
- }
- endNodeAction(this);
- }
- }
- }
-
-
- /**
- * DeleteAction
- */
- public class DeleteAction extends NodeAction {
- protected List list;
-
- public DeleteAction(List list) {
- setText(XMLUIMessages._UI_MENU_REMOVE);
- this.list = list;
- }
-
- public DeleteAction(Node node) {
- setText(XMLUIMessages._UI_MENU_REMOVE);
- list = new Vector();
- list.add(node);
- }
-
- public String getUndoDescription() {
- return XMLUIMessages.DELETE;
- }
-
- public void run() {
- if (validateEdit(getModel(), getWorkbenchWindowShell())) {
- beginNodeAction(this);
-
- for (Iterator i = list.iterator(); i.hasNext();) {
- Node node = (Node) i.next();
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- Attr attr = (Attr) node;
- attr.getOwnerElement().removeAttributeNode(attr);
- }
- else {
- Node parent = node.getParentNode();
- if (parent != null) {
- Node previousSibling = node.getPreviousSibling();
- if ((previousSibling != null) && isWhitespaceTextNode(previousSibling)) {
- parent.removeChild(previousSibling);
- }
- parent.removeChild(node);
- }
- }
- }
-
- endNodeAction(this);
- }
- }
- }
-
-
- class ImageDescriptorCache {
- protected ImageDescriptor attributeImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- protected ImageDescriptor attributeReqImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
- protected ImageDescriptor cdataSectionImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_CDATASECTION);
- protected ImageDescriptor commentImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_COMMENT);
- protected ImageDescriptor elementImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
- protected ImageDescriptor piImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION);
- protected ImageDescriptor textImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
-
- public ImageDescriptor getImageDescriptor(Object object) {
- ImageDescriptor result = null;
- if (object instanceof CMNode) {
- CMNode cmnode = (CMNode) object;
- switch (cmnode.getNodeType()) {
- case CMNode.ATTRIBUTE_DECLARATION : {
- result = CMImageUtil.getImageDescriptor(cmnode);
- if (result == null) {
- if (((CMAttributeDeclaration) cmnode).getUsage() == CMAttributeDeclaration.REQUIRED) {
- result = attributeReqImage;
- }
- else {
- result = attributeImage;
- }
- }
- break;
- }
- case CMNode.DATA_TYPE : {
- result = textImage;
- break;
- }
- case CMNode.ELEMENT_DECLARATION : {
- result = CMImageUtil.getImageDescriptor(cmnode);
- if (result == null) {
- result = elementImage;
- }
- break;
- }
- case CMNode.GROUP : {
- result = elementImage;
- break;
- }
- }
- }
- else if (object instanceof Integer) {
- Integer integer = (Integer) object;
- switch (integer.intValue()) {
- case Node.COMMENT_NODE : {
- result = commentImage;
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- result = piImage;
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- result = cdataSectionImage;
- break;
- }
- case Node.TEXT_NODE : {
- result = textImage;
- break;
- }
- }
- }
- return result;
- }
- }
-
- // TODO... remove this class. I'm pretty sure it is no longer used by
- // anyone.
- /**
- * @depracated
- */
- public class InsertAction extends NodeAction {
- protected String description;
- protected int index;
- protected int nodeType;
- protected Node parent;
-
- public InsertAction(int nodeType, Node parent, int index) {
- this.nodeType = nodeType;
- this.index = index;
- this.parent = parent;
- switch (nodeType) {
- case Node.COMMENT_NODE : {
- description = XMLUIMessages._UI_MENU_COMMENT;
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- description = XMLUIMessages._UI_MENU_PROCESSING_INSTRUCTION;
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- description = XMLUIMessages._UI_MENU_CDATA_SECTION;
- break;
- }
- case Node.TEXT_NODE : {
- description = XMLUIMessages._UI_MENU_PCDATA;
- break;
- }
- }
- setText(description);
- setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
- }
-
- public InsertAction(int nodeType, Node parent, int index, String title) {
- this.nodeType = nodeType;
- this.index = index;
- this.parent = parent;
- description = title;
- setText(description);
- setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
- }
-
- public String getUndoDescription() {
- return XMLUIMessages._UI_MENU_ADD + " " + description; //$NON-NLS-1$
- }
-
- public void run() {
- if (validateEdit(getModel(), getWorkbenchWindowShell())) {
- beginNodeAction(this);
-
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
- Node newChildNode = null;
- boolean format = true;
- switch (nodeType) {
- case Node.COMMENT_NODE : {
- newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- newChildNode = document.createCDATASection(""); //$NON-NLS-1$
- break;
- }
- case Node.TEXT_NODE : {
- format = false;
- newChildNode = document.createTextNode(parent.getNodeName());
- break;
- }
- }
-
- if (newChildNode != null) {
- List list = new Vector(1);
- list.add(newChildNode);
- insertNodesAtIndex(parent, list, index, format);
- }
-
- endNodeAction(this);
- }
- }
- }
-
-
- /**
- * ReplaceNodeAction
- */
- public class ReplaceNodeAction extends NodeAction {
- protected CMNode cmnode;
- protected String description;
- protected int endIndex;
- protected Node parent;
- protected int startIndex;
-
-
- public ReplaceNodeAction(Node parent, CMNode cmnode, int startIndex, int endIndex) {
- this.parent = parent;
- this.cmnode = cmnode;
- this.startIndex = startIndex;
- this.endIndex = endIndex;
-
- setText(getLabel(parent, cmnode));
- setImageDescriptor(imageDescriptorCache.getImageDescriptor(cmnode));
- }
-
- public String getUndoDescription() {
- String result = XMLUIMessages._UI_LABEL_UNDO_REPLACE_DESCRIPTION;
- result += " " + getLabel(parent, cmnode); //$NON-NLS-1$
- return result;
- }
-
- public void run() {
- if (validateEdit(getModel(), getWorkbenchWindowShell())) {
- beginNodeAction(this);
-
- if ((parent != null) && (cmnode != null)) {
- remove(parent, startIndex, endIndex);
- insert(parent, cmnode, startIndex);
- }
- endNodeAction(this);
- }
- }
- }
-
- protected ImageDescriptorCache imageDescriptorCache = new ImageDescriptorCache();
- protected Viewer fViewer;
-
- public AbstractNodeActionManager(IStructuredModel model, ModelQuery modelQuery, Viewer viewer) {
- super(model, modelQuery);
- this.fViewer = viewer;
- }
-
-
- public void beginNodeAction(NodeAction action) {
- fModel.beginRecording(action, action.getUndoDescription());
- }
-
-
- protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad) {
- Action action = null;
- if (ad == null) {
- action = new EditAttributeAction(this, parent, null, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE_TITLE);
- }
- else {
- action = new AddNodeAction(ad, parent, -1);
- }
- return action;
- }
-
-
- protected Action createAddCDataSectionAction(Node parent, int index) {
- return new AddNodeAction(Node.CDATA_SECTION_NODE, parent, index);
- }
-
-
- protected Action createAddCommentAction(Node parent, int index) {
- return new AddNodeAction(Node.COMMENT_NODE, parent, index);
- }
-
-
- protected Action createAddDoctypeAction(Document document, int index) {
- return new EditDoctypeAction(fModel, document, fModel.getBaseLocation(), XMLUIMessages._UI_MENU_ADD_DTD_INFORMATION);
- }
-
-
- protected Action createAddElementAction(Node parent, CMElementDeclaration ed, int index) {
- Action action = null;
- if (ed == null) {
- action = new EditElementAction(this, parent, index, XMLUIMessages._UI_MENU_NEW_ELEMENT, XMLUIMessages._UI_MENU_NEW_ELEMENT_TITLE);
- }
- else {
- action = new AddNodeAction(ed, parent, index);
- }
- return action;
- }
-
-
- protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index) {
- Action action = null;
- if (dataType == null) {
- action = new AddNodeAction(Node.TEXT_NODE, parent, index);
- }
- else {
- action = new AddNodeAction(dataType, parent, index);
- }
- return action;
- }
-
-
- protected Action createAddProcessingInstructionAction(Node parent, int index) {
- Node refChild = getRefChildNodeAtIndex(parent, index);
- Action action = new EditProcessingInstructionAction(this, parent, refChild, XMLUIMessages._UI_MENU_ADD_PROCESSING_INSTRUCTION, XMLUIMessages.ADD_PROCESSING_INSTRUCTION);
- action.setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(Node.PROCESSING_INSTRUCTION_NODE)));
- return action;
- }
-
-
- protected Action createAddSchemaInfoAction(Element element) {
- return new EditSchemaInfoAction(this, element.getOwnerDocument(), fModel.getBaseLocation(), XMLUIMessages._UI_MENU_ADD_SCHEMA_INFORMATION);
- }
-
-
- protected Action createDeleteAction(List selection) {
- DeleteAction deleteAction = new DeleteAction(selection);
- deleteAction.setEnabled(selection.size() > 0);
- return deleteAction;
- }
-
-
- public DOMContentBuilder createDOMContentBuilder(Document document) {
- DOMContentBuilderImpl builder = new DOMContentBuilderImpl(document);
- return builder;
- }
-
-
- protected Action createEditAttributeAction(Attr attr, CMAttributeDeclaration ad) {
- return new EditAttributeAction(this, attr.getOwnerElement(), attr, XMLUIMessages._UI_MENU_EDIT_ATTRIBUTE, XMLUIMessages._UI_MENU_EDIT_ATTRIBUTE_TITLE);
- }
-
-
- protected Action createEditDoctypeAction(DocumentType doctype) {
- return new EditDoctypeAction(fModel, doctype, fModel.getBaseLocation(), XMLUIMessages._UI_MENU_EDIT_DOCTYPE);
- }
-
-
- protected Action createEditProcessingInstructionAction(ProcessingInstruction pi) {
- return new EditProcessingInstructionAction(this, pi, XMLUIMessages._UI_MENU_EDIT_PROCESSING_INSTRUCTION, XMLUIMessages._UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE);
- }
-
-
- protected Action createEditSchemaInfoAction(Element element) {
- return new EditSchemaInfoAction(this, element.getOwnerDocument(), fModel.getBaseLocation(), XMLUIMessages._UI_MENU_EDIT_NAMESPACES);
- }
-
-
- protected Action createRenameAction(Node node) {
- Action result = null;
- if (node instanceof Element) {
- result = new EditElementAction(this, (Element) node, XMLUIMessages._UI_MENU_RENAME, XMLUIMessages._UI_MENU_RENAME_TITLE);
- }
- return result;
- }
-
-
- protected Action createReplaceAction(Node parent, CMNode cmnode, int startIndex, int endIndex) {
- return new ReplaceNodeAction(parent, cmnode, startIndex, endIndex);
- }
-
- public void endNodeAction(NodeAction action) {
- fModel.endRecording(action);
- }
-
-
-
- public void fillContextMenu(IMenuManager menuManager, ISelection selection) {
- try {
- List selectionList = new ArrayList();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection es = (IStructuredSelection) selection;
- selectionList.addAll(es.toList());
- }
-
- contributeActions(menuManager, selectionList);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- *
- */
- public String getLabel(Node parent, CMNode cmnode) {
- String result = "?" + cmnode + "?"; //$NON-NLS-1$ //$NON-NLS-2$
- if (cmnode != null) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=155800
- result = cmnode.getNodeName();
- if(result == null) {
- result = (String) cmnode.getProperty("description"); //$NON-NLS-1$
- }
- if (result == null || result.length() == 0) {
- if (cmnode.getNodeType() == CMNode.GROUP) {
- CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
- result = descriptionBuilder.buildDescription(cmnode);
- }
- else {
- result = DOMNamespaceHelper.computeName(cmnode, parent, null);
- }
- }
- }
- return result;
- }
-
-
- public IStructuredModel getModel() {
- return fModel;
- }
-
-
- public Shell getWorkbenchWindowShell() {
- return XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
-
- public void insert(Node parent, CMNode cmnode, int index) {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
- DOMContentBuilder builder = createDOMContentBuilder(document);
- builder.setBuildPolicy(DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
- builder.build(parent, cmnode);
- insertNodesAtIndex(parent, builder.getResult(), index);
- }
-
-
- public void insertNodesAtIndex(Node parent, List list, int index) {
- insertNodesAtIndex(parent, list, index, true);
- }
-
-
- public void insertNodesAtIndex(Node parent, List list, int index, boolean format) {
- NodeList nodeList = parent.getChildNodes();
- if (index == -1) {
- index = nodeList.getLength();
- }
- Node refChild = (index < nodeList.getLength()) ? nodeList.item(index) : null;
-
- // here we consider the case where the previous node is a 'white
- // space' Text node
- // we should really do the insert before this node
- //
- int prevIndex = index - 1;
- Node prevChild = (prevIndex < nodeList.getLength()) ? nodeList.item(prevIndex) : null;
- if (isWhitespaceTextNode(prevChild)) {
- refChild = prevChild;
- }
-
- for (Iterator i = list.iterator(); i.hasNext();) {
- Node newNode = (Node) i.next();
-
- if (newNode.getNodeType() == Node.ATTRIBUTE_NODE) {
- Element parentElement = (Element) parent;
- parentElement.setAttributeNode((Attr) newNode);
- }
- else {
- parent.insertBefore(newNode, refChild);
- }
- }
-
- boolean formatDeep = false;
- for (Iterator i = list.iterator(); i.hasNext();) {
- Node newNode = (Node) i.next();
- if (newNode.getNodeType() == Node.ELEMENT_NODE) {
- formatDeep = true;
- }
-
- if (format) {
- reformat(newNode, formatDeep);
- }
- }
-
- setViewerSelection(list);
- }
-
-
- /**
- * This method is abstract since currently, the sed editor is required to
- * perform formating and we don't want to create a dependency on the sed
- * editor.
- */
- public abstract void reformat(Node parent, boolean deep);
-
-
- public void remove(Node parent, int startIndex, int endIndex) {
- NodeList nodeList = parent.getChildNodes();
- for (int i = endIndex; i >= startIndex; i--) {
- Node node = nodeList.item(i);
- if (node != null) {
- parent.removeChild(node);
- }
- }
- }
-
-
- public void setViewerSelection(List list) {
- if (fViewer != null) {
- fViewer.setSelection(new StructuredSelection(list), true);
- }
- }
-
-
- public void setViewerSelection(Node node) {
- if (fViewer != null) {
- fViewer.setSelection(new StructuredSelection(node), true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java
deleted file mode 100644
index c4f8285df7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java
+++ /dev/null
@@ -1,224 +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.wst.xml.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * XMLEditorActionContributor
- *
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- *
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorXML extends ActionContributor {
- private static final String[] EDITOR_IDS = {"org.eclipse.core.runtime.xml.source", "org.eclipse.core.runtime.xml.source2", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static final String GO_TO_MATCHING_TAG_ID = "org.eclipse.wst.xml.ui.gotoMatchingTag"; //$NON-NLS-1$
-
- protected RetargetTextEditorAction fCleanupDocument = null;
- protected RetargetTextEditorAction fComment = null;
- protected RetargetTextEditorAction fContentAssist = null;
- protected RetargetTextEditorAction fFindOccurrences = null;
- protected RetargetTextEditorAction fFormatActiveElements = null;
- protected RetargetTextEditorAction fFormatDocument = null;
- protected RetargetTextEditorAction fOpenFileAction = null; // open file
-
- protected RetargetTextEditorAction fUncomment = null;
- private GoToMatchingTagAction fGoToMatchingTagAction;
-
- public ActionContributorXML() {
- super();
-
- ResourceBundle resourceBundle = XMLUIMessages.getResourceBundle();
-
- fContentAssist = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-
- // source commands
- fCleanupDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fCleanupDocument.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
-
- fFormatDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatDocument.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-
- fFormatActiveElements = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatActiveElements.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
-
- // navigate commands
- fOpenFileAction = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fOpenFileAction.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
-
- fFindOccurrences = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFindOccurrences.setActionDefinitionId(ActionDefinitionIds.FIND_OCCURRENCES);
-
- fGoToMatchingTagAction = new GoToMatchingTagAction(resourceBundle, "gotoMatchingTag_", null); //$NON-NLS-1$
- fGoToMatchingTagAction.setActionDefinitionId(GO_TO_MATCHING_TAG_ID);
- fGoToMatchingTagAction.setId(GO_TO_MATCHING_TAG_ID);
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public void contributeToMenu(IMenuManager menu) {
- // navigate commands
- IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
- if (navigateMenu != null) {
- navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fCommandsSeparator);
- navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fOpenFileAction);
-
- IMenuManager gotoGroup = navigateMenu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
- if (gotoGroup != null) {
- gotoGroup.appendToGroup("matchingBegin", fGoToMatchingTagAction); //$NON-NLS-1$
- }
- }
- super.contributeToMenu(menu);
- }
-
- protected void addToMenu(IMenuManager menu) {
-/*
- // edit commands
- IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(fCommandsSeparator);
- editMenu.add(fToggleInsertModeAction);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fExpandSelectionToMenu);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fContentAssist);
- editMenu.add(fMenuAdditionsGroupMarker);
- }
-
- // source commands
- String sourceMenuLabel = XMLUIMessages.SourceMenu_label;
- String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
- IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
- if (sourceMenu != null) {
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fToggleComment);
- sourceMenu.add(fAddBlockComment);
- sourceMenu.add(fRemoveBlockComment);
- sourceMenu.add(fShiftRight);
- sourceMenu.add(fShiftLeft);
- sourceMenu.add(fCleanupDocument);
- sourceMenu.add(fFormatDocument);
- sourceMenu.add(fFormatActiveElements);
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fFindOccurrences);
- }
-
- // navigate commands
- IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
- if (navigateMenu != null) {
- navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fCommandsSeparator);
- navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fOpenFileAction);
-
- IMenuManager gotoGroup = navigateMenu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
- if (gotoGroup != null) {
- gotoGroup.add(fGotoMatchingBracketAction);
- gotoGroup.add(fGoToMatchingTagAction);
- gotoGroup.add(new Separator());
- }
- }
-*/
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.edit.util.ActionContributor#getExtensionIDs()
- */
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
- /**
- * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart activeEditor) {
- if (getActiveEditorPart() == activeEditor) {
- return;
- }
- super.setActiveEditor(activeEditor);
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- IStatusLineManager statusLineManager = actionBars.getStatusLineManager();
- if (statusLineManager != null) {
- statusLineManager.setMessage(null);
- statusLineManager.setErrorMessage(null);
- }
- }
-
- ITextEditor textEditor = getTextEditor(activeEditor);
-
- fContentAssist.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS));
-
- fCleanupDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT));
- fFormatDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT));
- fFormatActiveElements.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS));
- fCleanupDocument.setEnabled((textEditor != null) && textEditor.isEditable());
- fFormatDocument.setEnabled((textEditor != null) && textEditor.isEditable());
- fFormatActiveElements.setEnabled((textEditor != null) && textEditor.isEditable());
-
- fOpenFileAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE));
-
- fFindOccurrences.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES));
-
- fGoToMatchingTagAction.setEditor(textEditor);
- if (textEditor != null) {
- textEditor.setAction(GO_TO_MATCHING_TAG_ID, fGoToMatchingTagAction);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
- */
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
- super.setViewerSpecificContributionsEnabled(enabled);
-
- fContentAssist.setEnabled(enabled);
- // cleanup and format document actions do not rely on source viewer
- // being enabled
- // fCleanupDocument.setEnabled(enabled);
- // fFormatDocument.setEnabled(enabled);
-
- fFormatActiveElements.setEnabled(enabled);
- fOpenFileAction.setEnabled(enabled);
- fFindOccurrences.setEnabled(enabled);
-
- fGoToMatchingTagAction.setEnabled(enabled);
- fGotoMatchingBracketAction.setEnabled(enabled);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
deleted file mode 100644
index a038376bea..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,85 +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.xml.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-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.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Add block comment action delegate for XML editor
- */
-public class AddBlockCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.AddBlockComment_label);
- action.setToolTipText(XMLUIMessages.AddBlockComment_tooltip);
- action.setDescription(XMLUIMessages.AddBlockComment_description);
- }
- }
-
- void processAction(IDocument document, ITextSelection textSelection) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
- if (model != null) {
- try {
- IndexedRegion selectionStartIndexedRegion = model.getIndexedRegion(textSelection.getOffset());
- IndexedRegion selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength());
-
- if (selectionStartIndexedRegion == null) {
- return;
- }
- if ((selectionEndIndexedRegion == null) && (textSelection.getLength() > 0)) {
- selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength() - 1);
- }
- if (selectionEndIndexedRegion == null) {
- return;
- }
-
- int openCommentOffset = selectionStartIndexedRegion.getStartOffset();
- int closeCommentOffset = selectionEndIndexedRegion.getEndOffset() + OPEN_COMMENT.length();
-
-
- if ((textSelection.getLength() == 0) && (selectionStartIndexedRegion instanceof CommentImpl)) {
- return;
- }
-
- model.beginRecording(this, XMLUIMessages.AddBlockComment_tooltip);
- model.aboutToChangeModel();
-
- try {
- document.replace(openCommentOffset, 0, OPEN_COMMENT);
- document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
- removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- finally {
- model.changedModel();
- model.endRecording(this);
- }
- }
- finally {
- model.releaseFromEdit();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
deleted file mode 100644
index 4465152f82..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-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.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-
-public abstract class BaseNodeActionManager {
-
-
- /**
- * MyMenuManager
- */
- public static class MyMenuManager extends MenuManager {
- protected String title;
-
- public MyMenuManager(String s) {
- super(s);
- title = s;
- }
-
- public boolean isEnabled() {
- return !isEmpty();
- }
-
- public String toString() {
- return title;
- }
- }
-
- public static DocumentType getDoctype(Node node) {
- Document document = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument();
- return document.getDoctype();
- }
-
- protected MenuBuilder menuBuilder = new MenuBuilder();
- protected IStructuredModel fModel;
- protected ModelQuery modelQuery;
-
- protected BaseNodeActionManager(IStructuredModel model, ModelQuery modelQuery) {
- this.fModel = model;
- this.modelQuery = modelQuery;
- }
-
-
- protected void addActionHelper(IMenuManager menu, List modelQueryActionList) {
- List actionList = new Vector();
- for (Iterator i = modelQueryActionList.iterator(); i.hasNext();) {
- ModelQueryAction action = (ModelQueryAction) i.next();
- if (action.getCMNode() != null) {
- int cmNodeType = action.getCMNode().getNodeType();
- if (action.getKind() == ModelQueryAction.INSERT) {
- switch (cmNodeType) {
- case CMNode.ATTRIBUTE_DECLARATION : {
- actionList.add(createAddAttributeAction((Element) action.getParent(), (CMAttributeDeclaration) action.getCMNode()));
- break;
- }
- case CMNode.ELEMENT_DECLARATION : {
- actionList.add(createAddElementAction(action.getParent(), (CMElementDeclaration) action.getCMNode(), action.getStartIndex()));
- break;
- }
- }
- }
- else if (action.getKind() == ModelQueryAction.REPLACE) {
- if ((action.getParent() != null) && (action.getCMNode() != null)) {
- actionList.add(createReplaceAction(action.getParent(), action.getCMNode(), action.getStartIndex(), action.getEndIndex()));
- }
- }
- }
- }
- menuBuilder.populateMenu(menu, actionList, false);
- }
-
- protected void contributeAction(IMenuManager menu, Action action) {
- if (action != null) {
- menu.add(action);
- }
- }
-
-
- public void contributeActions(IMenuManager menu, List selection) {
- int editMode = modelQuery.getEditMode();
- int ic = ModelQuery.INCLUDE_CHILD_NODES;
- int vc = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.VALIDITY_STRICT : ModelQuery.VALIDITY_NONE;
-
- List implicitlySelectedNodeList = null;
-
- if (selection.size() > 0) {
- implicitlySelectedNodeList = getSelectedNodes(selection, true);
-
- // contribute delete actions
- contributeDeleteActions(menu, implicitlySelectedNodeList, ic, vc);
- }
-
- if (selection.size() == 1) {
- Node node = (Node) selection.get(0);
-
- // contribute edit actions
- contributeEditActions(menu, node);
-
- // contribute add child actions
- contributeAddChildActions(menu, node, ic, vc);
-
- // contribute add before actions
- contributeAddSiblingActions(menu, node, ic, vc);
- }
-
- if (selection.size() > 0) {
- // contribute replace actions
- contributeReplaceActions(menu, implicitlySelectedNodeList, ic, vc);
- }
-
- if (selection.size() == 0) {
- Document document = ((IDOMModel) fModel).getDocument();
- contributeAddDocumentChildActions(menu, document, ic, vc);
- contributeEditGrammarInformationActions(menu, document);
- }
- }
-
- protected boolean canContributeChildActions(Node node){
- return true;
- }
-
- protected void contributeAddChildActions(IMenuManager menu, Node node, int ic, int vc) {
- int nodeType = node.getNodeType();
-
- if (nodeType == Node.ELEMENT_NODE && canContributeChildActions(node)) {
- // 'Add Child...' and 'Add Attribute...' actions
- //
- Element element = (Element) node;
-
- IMenuManager addAttributeMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_ATTRIBUTE);
- IMenuManager addChildMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_CHILD);
- menu.add(addAttributeMenu);
- menu.add(addChildMenu);
-
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
- if (ed != null) {
- // add insert attribute actions
- //
- List modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(element, ed, -1, ModelQuery.INCLUDE_ATTRIBUTES, vc, modelQueryActionList);
- addActionHelper(addAttributeMenu, modelQueryActionList);
- // add insert child node actions
- //
- modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(element, ed, -1, ic, vc, modelQueryActionList);
- addActionHelper(addChildMenu, modelQueryActionList);
- }
-
- // add PI and COMMENT
- contributePIAndCommentActions(addChildMenu, element, ed, -1);
-
- // add PCDATA, CDATA_SECTION
- contributeTextNodeActions(addChildMenu, element, ed, -1);
-
- // add NEW ELEMENT
- contributeUnconstrainedAddElementAction(addChildMenu, element, ed, -1);
-
- // add ATTRIBUTE
- contributeUnconstrainedAttributeActions(addAttributeMenu, element, ed);
- }
- }
-
-
- protected void contributeAddDocumentChildActions(IMenuManager menu, Document document, int ic, int vc) {
- IMenuManager addChildMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_CHILD);
- menu.add(addChildMenu);
-
- // add PI and COMMENT
- contributePIAndCommentActions(addChildMenu, document, -1);
-
- // add NEW ELEMENT
- contributeUnconstrainedAddElementAction(addChildMenu, document, -1);
- }
-
-
- protected void contributeAddSiblingActions(IMenuManager menu, Node node, int ic, int vc) {
- IMenuManager addBeforeMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_BEFORE);
- IMenuManager addAfterMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_AFTER);
- menu.add(addBeforeMenu);
- menu.add(addAfterMenu);
-
- Node parentNode = node.getParentNode();
- if (parentNode != null) {
- int index = getIndex(parentNode, node);
- if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
- Element parentElement = (Element) parentNode;
- CMElementDeclaration parentED = modelQuery.getCMElementDeclaration(parentElement);
- if (parentED != null) {
- // 'Add Before...' and 'Add After...' actions
- //
- List modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(parentElement, parentED, index, ic, vc, modelQueryActionList);
- addActionHelper(addBeforeMenu, modelQueryActionList);
-
- modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(parentElement, parentED, index + 1, ic, vc, modelQueryActionList);
- addActionHelper(addAfterMenu, modelQueryActionList);
- }
-
- // add COMMENT and PI before and after
- contributePIAndCommentActions(addBeforeMenu, parentElement, parentED, index);
- contributePIAndCommentActions(addAfterMenu, parentElement, parentED, index + 1);
-
- // add PCDATA, CDATA_SECTION before and after
- contributeTextNodeActions(addBeforeMenu, parentElement, parentED, index);
- contributeTextNodeActions(addAfterMenu, parentElement, parentED, index + 1);
-
- // add NEW ELEMENT before and after
- contributeUnconstrainedAddElementAction(addBeforeMenu, parentElement, parentED, index);
- contributeUnconstrainedAddElementAction(addAfterMenu, parentElement, parentED, index + 1);
- }
- else if (parentNode.getNodeType() == Node.DOCUMENT_NODE) {
- Document document = (Document) parentNode;
- CMDocument cmDocument = modelQuery.getCorrespondingCMDocument(parentNode);
- if (cmDocument != null) {
- // add possible root element insertions
- //
- List modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(document, cmDocument, index, ic, vc, modelQueryActionList);
- addActionHelper(addAfterMenu, modelQueryActionList);
-
- modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(document, cmDocument, index + 1, ic, vc, modelQueryActionList);
- addActionHelper(addAfterMenu, modelQueryActionList);
- }
-
- // add COMMENT and PI before and after
- contributePIAndCommentActions(addBeforeMenu, document, index);
- contributePIAndCommentActions(addAfterMenu, document, index + 1);
-
- // add ELEMENT before and after
- contributeUnconstrainedAddElementAction(addBeforeMenu, document, index);
- contributeUnconstrainedAddElementAction(addAfterMenu, document, index + 1);
- }
- }
- }
-
- protected void contributeDeleteActions(IMenuManager menu, List list, int ic, int vc) {
- boolean canRemove = modelQuery.canRemove(list, vc);
-
-
- // a delete action with an empty list will produce a disabled menu
- // item
- //
- List resultList = canRemove ? list : Collections.EMPTY_LIST;
- contributeAction(menu, createDeleteAction(resultList));
- }
-
-
- protected void contributeEditActions(IMenuManager menu, Node node) {
- contributeEditGrammarInformationActions(menu, node);
-
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- contributeAction(menu, createEditProcessingInstructionAction((ProcessingInstruction) node));
- }
- else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- contributeAction(menu, createEditAttributeAction((Attr) node, null));
- }
- }
-
-
- protected void contributeEditGrammarInformationActions(IMenuManager menu, Node node) {
- Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document) node : node.getOwnerDocument();
-
- DocumentType doctype = getDoctype(node);
- if (doctype == null) {
- contributeAction(menu, createAddDoctypeAction(document, -1));
- }
-
- if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- contributeAction(menu, createEditDoctypeAction((DocumentType) node));
- }
-
- if ((doctype == null) && (getRootElement(document) != null)) {
- contributeAction(menu, createEditSchemaInfoAction(getRootElement(document)));
- }
- }
-
- protected void contributePIAndCommentActions(IMenuManager menu, Document document, int index) {
- // test to make sure that the index isn't before the XML declaration
- //
- contributeAction(menu, createAddCommentAction(document, index));
- contributeAction(menu, createAddProcessingInstructionAction(document, index));
- }
-
-
- protected void contributePIAndCommentActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
- if ((parentEd == null) || isCommentAllowed(parentEd)) {
- contributeAction(menu, createAddCommentAction(parentElement, index));
- contributeAction(menu, createAddProcessingInstructionAction(parentElement, index));
- }
- }
-
-
- protected void contributeReplaceActions(IMenuManager menu, List selectedNodeList, int ic, int vc) {
- // 'Replace With...' actions
- //
- IMenuManager replaceWithMenu = new MyMenuManager(XMLUIMessages._UI_MENU_REPLACE_WITH);
- menu.add(replaceWithMenu);
-
- if ((modelQuery.getEditMode() == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) && (selectedNodeList.size() > 0)) {
- Node node = (Node) selectedNodeList.get(0);
- Node parentNode = node.getParentNode();
- if ((parentNode != null) && (parentNode.getNodeType() == Node.ELEMENT_NODE)) {
- Element parentElement = (Element) parentNode;
- CMElementDeclaration parentED = modelQuery.getCMElementDeclaration(parentElement);
- if (parentED != null) {
- List replaceActionList = new Vector();
- modelQuery.getReplaceActions(parentElement, parentED, selectedNodeList, ic, vc, replaceActionList);
- addActionHelper(replaceWithMenu, replaceActionList);
- }
- }
- }
- }
-
- protected void contributeTextNodeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
- if ((parentEd == null) || isTextAllowed(parentEd)) {
- CMDataType dataType = parentEd != null ? parentEd.getDataType() : null;
- contributeAction(menu, createAddPCDataAction(parentElement, dataType, index));
- contributeAction(menu, createAddCDataSectionAction(parentElement, index));
- }
- }
-
-
- protected void contributeUnconstrainedAddElementAction(IMenuManager menu, Document document, int index) {
- if (isUnconstrainedActionAllowed()) {
- if (getRootElement(document) == null) {
- int xmlDeclarationIndex = -1;
- int doctypeIndex = -1;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++) {
- Node node = nodeList.item(i);
- int nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- doctypeIndex = i;
- break;
- }
- else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
- ProcessingInstruction pi = (ProcessingInstruction) node;
- if (pi.getTarget().equalsIgnoreCase("xml") && (xmlDeclarationIndex == -1)) { //$NON-NLS-1$
- xmlDeclarationIndex = i;
- }
- }
- }
-
- if (((xmlDeclarationIndex == -1) || (index > xmlDeclarationIndex)) && ((doctypeIndex == -1) || (index > doctypeIndex))) {
- contributeAction(menu, createAddElementAction(document, null, index));
- }
- }
- }
- }
-
-
- protected void contributeUnconstrainedAddElementAction(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
- if (isUnconstrainedActionAllowed()) {
- if ((parentEd == null) || (parentEd.getProperty("isInferred") == Boolean.TRUE) || ((modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) && isElementAllowed(parentEd))) { //$NON-NLS-1$
- contributeAction(menu, createAddElementAction(parentElement, null, index));
- }
- }
- }
-
-
- protected void contributeUnconstrainedAttributeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd) {
- if (isUnconstrainedActionAllowed()) {
- if ((parentEd == null) || (parentEd.getProperty("isInferred") == Boolean.TRUE) || (modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT)) { //$NON-NLS-1$
- contributeAction(menu, createAddAttributeAction(parentElement, null));
- }
- }
- }
-
- abstract protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad);
-
- abstract protected Action createAddCDataSectionAction(Node parent, int index);
-
- abstract protected Action createAddCommentAction(Node parent, int index);
-
- abstract protected Action createAddDoctypeAction(Document parent, int index);
-
- abstract protected Action createAddElementAction(Node parent, CMElementDeclaration ed, int index);
-
- abstract protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index);
-
- abstract protected Action createAddProcessingInstructionAction(Node parent, int index);
-
- abstract protected Action createAddSchemaInfoAction(Element element);
-
- abstract protected Action createDeleteAction(List selection);
-
- abstract protected Action createEditAttributeAction(Attr attribute, CMAttributeDeclaration ad);
-
- abstract protected Action createEditDoctypeAction(DocumentType doctype);
-
- abstract protected Action createEditProcessingInstructionAction(ProcessingInstruction pi);
-
- abstract protected Action createEditSchemaInfoAction(Element element);
-
- abstract protected Action createRenameAction(Node node);
-
- abstract protected Action createReplaceAction(Node parent, CMNode cmnode, int startIndex, int endIndex);
-
-
- public int getIndex(Node parentNode, Node child) {
- NodeList nodeList = parentNode.getChildNodes();
- int index = -1;
- int size = nodeList.getLength();
- for (int i = 0; i < size; i++) {
- if (nodeList.item(i) == child) {
- index = i;
- break;
- }
- }
- return index;
- }
-
-
- public Node getRefChildNodeAtIndex(Node parent, int index) {
- NodeList nodeList = parent.getChildNodes();
- Node refChild = ((index >= 0) && (index < nodeList.getLength())) ? nodeList.item(index) : null;
- return refChild;
- }
-
-
- protected Element getRootElement(Document document) {
- Element result = null;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- result = (Element) node;
- break;
- }
- }
- return result;
- }
-
-
- protected List getSelectedNodes(List list, boolean includeTextNodes) {
- List result = new ArrayList(0);
- for (Iterator i = list.iterator(); i.hasNext();) {
- Object object = i.next();
- if (object instanceof Node) {
- Node node = (Node) object;
- if (node.getNodeType() == Node.TEXT_NODE) {
- if (includeTextNodes) {
- result.add(object);
- }
- }
- else {
- result.add(node);
- }
- }
- }
- return result;
- }
-
-
- protected boolean isCommentAllowed(CMElementDeclaration parentEd) {
- int contentType = parentEd.getContentType();
- return (contentType == CMElementDeclaration.ELEMENT) || (contentType == CMElementDeclaration.MIXED) || (contentType == CMElementDeclaration.PCDATA) || (contentType == CMElementDeclaration.ANY);
- }
-
-
- protected boolean isElementAllowed(CMElementDeclaration parentEd) {
- int contentType = parentEd.getContentType();
- return (contentType == CMElementDeclaration.ELEMENT) || (contentType == CMElementDeclaration.MIXED) || (contentType == CMElementDeclaration.ANY);
- }
-
-
- protected boolean isTextAllowed(CMElementDeclaration parentEd) {
- int contentType = parentEd.getContentType();
- return (contentType == CMElementDeclaration.MIXED) || (contentType == CMElementDeclaration.PCDATA) || (contentType == CMElementDeclaration.ANY);
- }
-
-
- protected boolean isUnconstrainedActionAllowed() {
- return true;
- }
-
-
- protected boolean isWhitespaceTextNode(Node node) {
- return (node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().trim().length() == 0);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
deleted file mode 100644
index d91a815d7b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
+++ /dev/null
@@ -1,139 +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.xml.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.cleanup.CleanupProcessorXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Cleanup action delegate for CSS editor
- */
-public class CleanupActionXMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- fCleanupProcessor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.CleanupDocument_label);
- action.setToolTipText(XMLUIMessages.CleanupDocument_tooltip);
- action.setDescription(XMLUIMessages.CleanupDocument_description);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- final ITextEditor editor = (ITextEditor) fEditor;
- Dialog cleanupDialog = new CleanupDialogXML(editor.getSite().getShell());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- cleanupProcessor.cleanupModel(model);
- }
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength());
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(fEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null) {
- fCleanupProcessor = new CleanupProcessorXML();
- }
-
- return fCleanupProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
deleted file mode 100644
index 199eac0d3d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
+++ /dev/null
@@ -1,220 +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.xml.ui.internal.actions;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class CleanupDialogXML extends Dialog implements SelectionListener {
- protected Button fCheckBoxCompressEmptyElementTags;
- protected Button fCheckBoxConvertEOLCodes;
- protected Button fCheckBoxFormatSource;
- protected Button fCheckBoxInsertMissingTags;
- protected Button fCheckBoxInsertRequiredAttrs;
- protected Button fCheckBoxQuoteAttrValues;
- protected Button fCheckBoxInsertXMLDeclaration;
- protected IStructuredModel fModel = null;
- protected Preferences fPreferences = null;
- protected Button fRadioButtonAttrNameCaseAsis;
- protected Button fRadioButtonAttrNameCaseLower;
- protected Button fRadioButtonAttrNameCaseUpper;
- protected Button fRadioButtonConvertEOLMac;
- protected Button fRadioButtonConvertEOLUnix;
- protected Button fRadioButtonConvertEOLWindows;
-
- protected Button fRadioButtonTagNameCaseAsis;
- protected Button fRadioButtonTagNameCaseLower;
- protected Button fRadioButtonTagNameCaseUpper;
-
- public CleanupDialogXML(Shell shell) {
-
- super(shell);
- }
-
- public Control createDialogArea(Composite parent) {
-
- getShell().setText(XMLUIMessages.Cleanup_UI_);
- Composite composite = new Composite(parent, SWT.NULL);
- createDialogAreaInComposite(composite);
- initializeOptions();
- return composite;
- }
-
- protected void createDialogAreaInComposite(Composite composite) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CLEANUP_XML_HELPID); // use
- // XML
- // specific
- // help
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- composite.setLayout(layout);
-
- // Compress empty element tags
- fCheckBoxCompressEmptyElementTags = new Button(composite, SWT.CHECK);
- fCheckBoxCompressEmptyElementTags.setText(XMLUIMessages.Compress_empty_element_tags_UI_);
- fCheckBoxCompressEmptyElementTags.addSelectionListener(this);
-
- // Insert missing required attrs
- fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
- fCheckBoxInsertRequiredAttrs.setText(XMLUIMessages.Insert_required_attributes_UI_);
- fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
- // Insert missing begin/end tags
- fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
- fCheckBoxInsertMissingTags.setText(XMLUIMessages.Insert_missing_tags_UI_);
- fCheckBoxInsertMissingTags.addSelectionListener(this);
-
- // Quote attribute values
- fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
- fCheckBoxQuoteAttrValues.setText(XMLUIMessages.Quote_attribute_values_UI_);
- fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
- // Format source
- fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
- fCheckBoxFormatSource.setText(XMLUIMessages.Format_source_UI_);
- fCheckBoxFormatSource.addSelectionListener(this);
-
- fCheckBoxInsertXMLDeclaration = new Button(composite, SWT.CHECK);
- fCheckBoxInsertXMLDeclaration.setText(XMLUIMessages.Insert_XML_decl);
- fCheckBoxInsertXMLDeclaration.addSelectionListener(this);
-
- // Convert EOL code
- fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
- fCheckBoxConvertEOLCodes.setText(XMLUIMessages.Convert_EOL_codes_UI_);
- fCheckBoxConvertEOLCodes.addSelectionListener(this);
- Composite EOLCodes = new Composite(composite, SWT.NULL);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- EOLCodes.setLayout(hLayout);
- fRadioButtonConvertEOLWindows = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLWindows.setText(XMLUIMessages.EOL_Windows_UI);
- fRadioButtonConvertEOLWindows.addSelectionListener(this);
- fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLUnix.setText(XMLUIMessages.EOL_Unix_UI);
- fRadioButtonConvertEOLUnix.addSelectionListener(this);
- fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLMac.setText(XMLUIMessages.EOL_Mac_UI);
- fRadioButtonConvertEOLMac.addSelectionListener(this);
- }
-
- protected void enableEOLCodeRadios(boolean enable) {
-
- if ((fRadioButtonConvertEOLWindows != null) && (fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLMac != null)) {
- fRadioButtonConvertEOLWindows.setEnabled(enable);
- fRadioButtonConvertEOLUnix.setEnabled(enable);
- fRadioButtonConvertEOLMac.setEnabled(enable);
- if (!fRadioButtonConvertEOLWindows.getSelection() && !fRadioButtonConvertEOLUnix.getSelection() && !fRadioButtonConvertEOLMac.getSelection()) {
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- }
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void initializeOptions() {
-
- fCheckBoxCompressEmptyElementTags.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
- fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCheckBoxInsertXMLDeclaration.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION));
- String EOLCode = getModelPreferences().getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE);
- if (EOLCode.compareTo(CommonEncodingPreferenceNames.LF) == 0) {
- fRadioButtonConvertEOLUnix.setSelection(true);
- }
- else if (EOLCode.compareTo(CommonEncodingPreferenceNames.CR) == 0) {
- fRadioButtonConvertEOLMac.setSelection(true);
- }
- else {
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- protected void okPressed() {
-
- storeOptions();
- super.okPressed();
- }
-
- public void setModel(IStructuredModel model) {
-
- fModel = model;
- }
-
- protected void storeOptions() {
-
- getModelPreferences().setValue(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.FIX_XML_DECLARATION, fCheckBoxInsertXMLDeclaration.getSelection());
- if (fRadioButtonConvertEOLUnix.getSelection()) {
- getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
- }
- else if (fRadioButtonConvertEOLMac.getSelection()) {
- getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
- }
- else {
- getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
- }
- // explicitly save plugin preferences so values are stored
- XMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
-
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
-
- getButton(OK).setEnabled(((fRadioButtonTagNameCaseLower != null) && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection()))
- || ((fRadioButtonAttrNameCaseLower != null) && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection()))
- || fCheckBoxInsertMissingTags.getSelection()
- || fCheckBoxQuoteAttrValues.getSelection()
- || fCheckBoxFormatSource.getSelection()
- || fCheckBoxInsertXMLDeclaration.getSelection()
- || fCheckBoxCompressEmptyElementTags.getSelection()
- || fCheckBoxInsertRequiredAttrs.getSelection()
- || (( fCheckBoxConvertEOLCodes.getSelection() && fRadioButtonConvertEOLUnix != null ) && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection()
- || fRadioButtonConvertEOLWindows.getSelection())));
- if (e.widget == fCheckBoxConvertEOLCodes) {
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
deleted file mode 100644
index 0cdc771453..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditAttributeDialog;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class EditAttributeAction extends NodeAction {
- protected static ImageDescriptor imageDescriptor;
-
- public static ImageDescriptor createImageDescriptor() {
- if (imageDescriptor == null) {
- imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
- return imageDescriptor;
- }
-
- protected Attr attr;
- protected AbstractNodeActionManager manager;
- protected Element ownerElement;
- protected String title;
-
- public EditAttributeAction(AbstractNodeActionManager manager, Element ownerElement, Attr attr, String actionLabel, String title) {
- this.manager = manager;
- this.ownerElement = ownerElement;
- this.attr = attr;
- this.title = title;
- setText(actionLabel);
- // assume if attr is null then this is an 'Add' that requires action
- // an icons... otherwise this is an edit
- if (attr == null) {
- setImageDescriptor(createImageDescriptor());
- }
- }
-
- public String getUndoDescription() {
- return title;
- }
-
- public void run() {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (validateEdit(manager.getModel(), shell)) {
- manager.beginNodeAction(this);
- EditAttributeDialog dialog = new EditAttributeDialog(shell, ownerElement, attr);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- if (attr != null) {
- ownerElement.removeAttributeNode(attr);
- }
- Document document = ownerElement.getOwnerDocument();
- Attr newAttribute = document.createAttribute(dialog.getAttributeName());
- newAttribute.setValue(dialog.getAttributeValue());
- ownerElement.setAttributeNode(newAttribute);
- manager.setViewerSelection(newAttribute);
- }
- manager.endNodeAction(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
deleted file mode 100644
index 4ce515c692..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditDoctypeDialog;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * EditDoctypeAction
- */
-public class EditDoctypeAction extends NodeAction {
- protected DocumentType doctype;
- protected Document document;
- protected IStructuredModel model;
- protected String resourceLocation;
- protected String title;
-
- /**
- * This constructor is used to create a new doctype.
- */
- public EditDoctypeAction(IStructuredModel model, Document document, String resourceLocation, String title) {
- setText(title);
- this.model = model;
- this.document = document;
- this.resourceLocation = resourceLocation;
- this.title = title;
- }
-
- /**
- * This constructor is used to edit an exisitng doctype.
- */
- public EditDoctypeAction(IStructuredModel model, DocumentType doctype, String resourceLocation, String title) {
- setText(title);
- this.model = model;
- this.doctype = doctype;
- this.resourceLocation = resourceLocation;
- this.title = title;
- }
-
-
- protected DocumentType createDoctype(EditDoctypeDialog dialog, Document document) {
- DocumentType result = null;
- if (document instanceof DocumentImpl) {
- IDOMDocument documentImpl = (IDOMDocument) document;
- IDOMDocumentType doctypeImpl = (IDOMDocumentType) documentImpl.createDoctype(dialog.getName());
- doctypeImpl.setPublicId(dialog.getPublicId());
- doctypeImpl.setSystemId(dialog.getSystemId());
- result = doctypeImpl;
- }
- return result;
- }
-
- private Display getDisplay() {
-
- return PlatformUI.getWorkbench().getDisplay();
- }
-
-
- protected String getRootElementName(Document document) {
- Element rootElement = null;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++) {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- rootElement = (Element) childNode;
- break;
- }
- }
- return rootElement != null ? rootElement.getNodeName() : XMLUIMessages._UI_LABEL_ROOT_ELEMENT_VALUE;
- }
-
- public String getUndoDescription() {
- return title;
- }
-
-
- protected void insertDoctype(DocumentType doctype, Document document) {
- Node refChild = null;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++) {
- Node childNode = nodeList.item(i);
- if ((childNode.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) || (childNode.getNodeType() == Node.COMMENT_NODE)) {
- // continue on to the nextNode
- }
- else {
- refChild = childNode;
- break;
- }
- }
-
- document.insertBefore(doctype, refChild);
- // manager.reformat(doctype, false);
- }
-
- public void run() {
- Shell shell = getDisplay().getActiveShell();
- if (validateEdit(model, shell)) {
- model.beginRecording(this, getUndoDescription());
- // Shell shell =
- // XMLCommonUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- EditDoctypeDialog dialog = showEditDoctypeDialog(shell);
-
- if (dialog.getReturnCode() == Window.OK) {
- if (doctype != null) {
- updateDoctype(dialog, doctype);
- }
- else if (document != null) {
- DocumentType doctype = createDoctype(dialog, document);
- if (doctype != null) {
- insertDoctype(doctype, document);
- }
- }
- }
- model.endRecording(this);
- }
- }
-
- protected EditDoctypeDialog showEditDoctypeDialog(Shell shell) {
- EditDoctypeDialog dialog = null;
-
- if (doctype != null) {
- dialog = new EditDoctypeDialog(shell, doctype);
- if (title == null) {
- title = XMLUIMessages._UI_LABEL_EDIT_DOCTYPE;
- }
- }
- else if (document != null) {
- String rootElementName = getRootElementName(document);
- dialog = new EditDoctypeDialog(shell, rootElementName, "", rootElementName + ".dtd"); //$NON-NLS-1$ //$NON-NLS-2$
- if (title == null) {
- title = XMLUIMessages._UI_MENU_ADD_DTD_INFORMATION_TITLE;
- }
- }
-
- dialog.setComputeSystemId((doctype == null) || (doctype.getSystemId() == null) || (doctype.getSystemId().trim().length() == 0));
-
- dialog.setErrorChecking(false);// !model.getType().equals(IStructuredModel.HTML));
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(new Path(resourceLocation));
- dialog.open();
-
- return dialog;
- }
-
-
- protected void updateDoctype(EditDoctypeDialog dialog, DocumentType doctype) {
- if (doctype instanceof IDOMDocumentType) {
- IDOMDocumentType doctypeImpl = (IDOMDocumentType) doctype;
- if (doctypeImpl.getName().equals(dialog.getName())) {
- doctypeImpl.setPublicId(dialog.getPublicId());
- doctypeImpl.setSystemId(dialog.getSystemId());
- }
- else {
- // we need to create a new one and remove the old
- //
- Document document = doctype.getOwnerDocument();
- DocumentType newDoctype = createDoctype(dialog, document);
- document.insertBefore(newDoctype, doctype);
- document.removeChild(doctype);
- // manager.reformat(newDoctype, false);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
deleted file mode 100644
index 21b55fe3d4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditElementDialog;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class EditElementAction extends NodeAction {
-
- protected static ImageDescriptor imageDescriptor;
-
- public static ImageDescriptor createImageDescriptor() {
- if (imageDescriptor == null) {
- imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
- }
- return imageDescriptor;
- }
-
- protected Element element;
- protected int insertionIndex = -1;
- protected AbstractNodeActionManager manager;
- protected Node parent;
- protected String title;
-
- public EditElementAction(AbstractNodeActionManager manager, Element element, String actionLabel, String dialogTitle) {
- this(manager, element.getParentNode(), -1, element, actionLabel, dialogTitle);
- }
-
- protected EditElementAction(AbstractNodeActionManager manager, Node parent, int index, Element element, String actionLabel, String title) {
- this.manager = manager;
- this.parent = parent;
- this.insertionIndex = index;
- this.element = element;
- this.title = title;
- setText(actionLabel);
- if (element == null) {
- setImageDescriptor(createImageDescriptor());
- }
- }
-
- public EditElementAction(AbstractNodeActionManager manager, Node parent, int index, String actionLabel, String title) {
- this(manager, parent, index, null, actionLabel, title);
- }
-
- public String getUndoDescription() {
- return title;
- }
-
- public void run() {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (validateEdit(manager.getModel(), shell)) {
- manager.beginNodeAction(this);
- EditElementDialog dialog = new EditElementDialog(shell, element);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
- if (element != null) {
- // here we need to do a rename... which seems to be quite hard
- // to do :-(
- if (element instanceof IDOMElement) {
- IDOMElement elementImpl = (IDOMElement) element;
- IDOMModel model = elementImpl.getModel();
- String oldName = elementImpl.getNodeName();
- String newName = dialog.getElementName();
- setStructuredDocumentRegionElementName(model, elementImpl.getStartStructuredDocumentRegion(), oldName, newName);
- setStructuredDocumentRegionElementName(model, elementImpl.getEndStructuredDocumentRegion(), oldName, newName);
- }
- }
- else {
- Element newElement = document.createElement(dialog.getElementName());
- NodeList nodeList = parent.getChildNodes();
- int nodeListLength = nodeList.getLength();
- Node refChild = (insertionIndex < nodeListLength) && (insertionIndex >= 0) ? nodeList.item(insertionIndex) : null;
- parent.insertBefore(newElement, refChild);
- manager.reformat(newElement, false);
- manager.setViewerSelection(newElement);
- }
- }
- manager.endNodeAction(this);
- }
- }
-
- protected void setStructuredDocumentRegionElementName(IDOMModel model, IStructuredDocumentRegion flatNode, String oldName, String newName) {
- if (flatNode != null) {
- String string = flatNode.getText();
- int index = string.indexOf(oldName);
- if (index != -1) {
- index += flatNode.getStart();
- model.getStructuredDocument().replaceText(this, index, oldName.length(), newName);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
deleted file mode 100644
index 5578cf2aea..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditProcessingInstructionDialog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-/**
- * EditProcessingInstructionAction
- */
-public class EditProcessingInstructionAction extends NodeAction {
- protected Node childRef;
- protected AbstractNodeActionManager manager;
- protected Node parent;
- protected ProcessingInstruction pi;
- protected String title;
-
- /**
- * This constructor is used to add a new ProcessingInstruction
- */
- public EditProcessingInstructionAction(AbstractNodeActionManager manager, Node parent, Node childRef, String actionLabel, String title) {
- setText(actionLabel);
- this.manager = manager;
- this.parent = parent;
- this.childRef = childRef;
- this.title = title;
- }
-
- /**
- * This constructor is used to edit a ProcessingInstruction
- */
- public EditProcessingInstructionAction(AbstractNodeActionManager manager, ProcessingInstruction pi, String actionLabel, String title) {
- setText(actionLabel);
- this.manager = manager;
- this.pi = pi;
- this.parent = pi.getParentNode();
- this.title = title;
- }
-
- public String getUndoDescription() {
- return title;
- }
-
- public void run() {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (validateEdit(manager.getModel(), shell)) {
- manager.beginNodeAction(this);
-
-
- EditProcessingInstructionDialog dialog = null;
- if (pi != null) {
- dialog = new EditProcessingInstructionDialog(shell, pi);
- }
- else {
- dialog = new EditProcessingInstructionDialog(shell, XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
- }
-
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- if (pi != null) {
- childRef = pi;
- }
-
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
- Node newNode = document.createProcessingInstruction(dialog.getTarget(), dialog.getData());
- parent.insertBefore(newNode, childRef);
-
- if (pi != null) {
- parent.removeChild(pi);
- }
-
- manager.reformat(newNode, false);
- manager.setViewerSelection(newNode);
- }
- manager.endNodeAction(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
deleted file mode 100644
index c07557a90d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * EditDoctypeAction
- */
-public class EditSchemaInfoAction extends NodeAction {
- protected AbstractNodeActionManager manager;
- protected DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
- protected Node node;
- protected String resourceLocation;
- protected String title;
-
- public EditSchemaInfoAction(AbstractNodeActionManager manager, Node node, String resourceLocation, String title) {
- this.manager = manager;
- this.node = node;
- setText(title);
- this.resourceLocation = resourceLocation;
- this.title = title;
- }
-
- protected Map createPrefixMapping(List oldList, List newList) {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext();) {
- NamespaceInfo oldInfo = (NamespaceInfo) i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext();) {
- NamespaceInfo newInfo = (NamespaceInfo) i.next();
- NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
-
- // if oldInfo is non null ... there's a matching URI in the old
- // set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null) {
- oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
- }
-
- if (oldInfo != null) {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
- if (!oldPrefix.equals(newPrefix)) {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
-
- public Element getElement(Node node) {
- Element result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- result = (Element) node;
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- result = getRootElement((Document) node);
- }
- return result;
- }
-
-
- public Element getRootElement(Document document) {
- Element rootElement = null;
- NodeList nodeList = document.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++) {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- rootElement = (Element) childNode;
- break;
- }
- }
- return rootElement;
- }
-
- public String getUndoDescription() {
- return title;
- }
-
- public void run() {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (validateEdit(manager.getModel(), shell)) {
- manager.beginNodeAction(this);
-
- // todo... change constructor to take an element
- Element element = getElement(node);
- if (element != null) {
- EditSchemaInfoDialog dialog = new EditSchemaInfoDialog(shell, new Path(resourceLocation));
-
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
- List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out
- // how to update the document
- // in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
- }
-
- dialog.setNamespaceInfoList(namespaceInfoList);
- dialog.create();
- // dialog.getShell().setSize(500, 300);
- dialog.getShell().setText(XMLUIMessages._UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- List newInfoList = dialog.getNamespaceInfoList();
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
- if (prefixMapping.size() > 0) {
- try {
- manager.getModel().aboutToChangeModel();
- ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(manager, element, prefixMapping);
- replacePrefixAction.run();
- }
- finally {
- manager.getModel().changedModel();
- }
- }
- }
- }
- manager.endNodeAction(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java
deleted file mode 100644
index 5d7e7a373f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.xml.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-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;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Moves the cursor to the end tag if it is in a start tag, and vice versa.
- * Also updates the matching tag annotation in the active editor.
- *
- * @author nitin
- *
- */
-class GoToMatchingTagAction extends TextEditorAction {
-
- private class UpdateListener implements ISelectionChangedListener {
- public void selectionChanged(SelectionChangedEvent event) {
- updateFor(event.getSelection());
- }
- }
-
- private static final String ANNOTATION_TYPE = "org.eclipse.wst.xml.ui.matching.tag"; //$NON-NLS-1$
- private ISelectionChangedListener fUpdateListener = null;
- static final boolean DEBUG = false;
-
- /**
- * @param bundle
- * @param prefix
- * @param editor
- * @param style
- */
- GoToMatchingTagAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- fUpdateListener = new UpdateListener();
- }
-
- void removeAnnotation(boolean allMatching) {
- ITextEditor textEditor = getTextEditor();
- if (textEditor == null) {
- if (DEBUG) {
- System.out.println("no editor"); //$NON-NLS-1$
- }
- return;
- }
- IDocumentProvider documentProvider = textEditor.getDocumentProvider();
- if (documentProvider == null) {
- if (DEBUG) {
- System.out.println("no document provider"); //$NON-NLS-1$
- }
- return;
- }
- IAnnotationModel annotationModel = documentProvider.getAnnotationModel(textEditor.getEditorInput());
- if (annotationModel == null) {
- if (DEBUG) {
- System.out.println("no annotation model"); //$NON-NLS-1$
- }
- return;
- }
-
- Iterator annotationIterator = annotationModel.getAnnotationIterator();
- List oldAnnotations = new ArrayList();
- while (annotationIterator.hasNext()) {
- Annotation annotation = (Annotation) annotationIterator.next();
- if (ANNOTATION_TYPE.equals(annotation.getType())) {
- annotation.markDeleted(true);
- /**
- * Sometimes it is supported, sometime's it is not. Confusing.
- */
- try {
- annotationIterator.remove();
- }
- catch (UnsupportedOperationException e) {
- oldAnnotations.add(annotation);
- }
- if (DEBUG) {
- System.out.println("removed " + annotation); //$NON-NLS-1$
- }
- if (!allMatching)
- break;
- }
- }
- if (!oldAnnotations.isEmpty()) {
- int size = oldAnnotations.size();
- for (int i = 0; i < size; i++) {
- annotationModel.removeAnnotation((Annotation) oldAnnotations.get(i));
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- super.runWithEvent(event);
- if (getTextEditor() == null)
- return;
-
- ISelection selection = getTextEditor().getSelectionProvider().getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection && selection instanceof ITextSelection) {
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o instanceof IDOMNode) {
- int offset = ((ITextSelection) selection).getOffset();
- IStructuredDocumentRegion matchRegion = null;
- if (((Node) o).getNodeType() == Node.ATTRIBUTE_NODE) {
- o = ((Attr) o).getOwnerElement();
- }
-
- int targetOffset = -1;
- if (o instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) o;
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
- matchRegion = ((IDOMNode) o).getEndStructuredDocumentRegion();
- if (matchRegion != null)
- targetOffset = matchRegion.getStartOffset() + 2;
- }
- else {
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.containsOffset(offset)) {
- matchRegion = ((IDOMNode) o).getStartStructuredDocumentRegion();
- if (matchRegion != null)
- targetOffset = matchRegion.getStartOffset() + 1;
- }
- }
- }
-
- if (targetOffset >= 0) {
- getTextEditor().getSelectionProvider().setSelection(new TextSelection(targetOffset, 0));
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.TextEditorAction#setEditor(org.eclipse.ui.texteditor.ITextEditor)
- */
- public void setEditor(ITextEditor editor) {
- ITextEditor textEditor = getTextEditor();
- if (textEditor != null) {
- removeAnnotation(true);
-
- ISelectionProvider selectionProvider = textEditor.getSelectionProvider();
- if (selectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) selectionProvider).removePostSelectionChangedListener(fUpdateListener);
- }
- }
- super.setEditor(editor);
- if (editor != null) {
- ISelectionProvider selectionProvider = editor.getSelectionProvider();
- if (selectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(fUpdateListener);
- }
-
- updateFor(selectionProvider.getSelection());
- }
- }
-
- public void update() {
- setEnabled(true);
-
- }
-
- void updateFor(ISelection selection) {
- ITextEditor textEditor = getTextEditor();
- if (textEditor == null) {
- if (DEBUG) {
- System.out.println("no editor"); //$NON-NLS-1$
- }
- return;
- }
- IDocumentProvider documentProvider = textEditor.getDocumentProvider();
- if (documentProvider == null) {
- if (DEBUG) {
- System.out.println("no document provider"); //$NON-NLS-1$
- }
- return;
- }
- IAnnotationModel annotationModel = documentProvider.getAnnotationModel(textEditor.getEditorInput());
- if (annotationModel == null || !(annotationModel instanceof IAnnotationModelExtension)) {
- if (DEBUG) {
- System.out.println("no annotation model"); //$NON-NLS-1$
- }
- return;
- }
-
- List oldAnnotations = new ArrayList(2);
- Iterator annotationIterator = annotationModel.getAnnotationIterator();
- while (annotationIterator.hasNext()) {
- Annotation annotation = (Annotation) annotationIterator.next();
- if (ANNOTATION_TYPE.equals(annotation.getType())) {
- annotation.markDeleted(true);
- if (DEBUG) {
- System.out.println("removing " + annotation); //$NON-NLS-1$
- }
- oldAnnotations.add(annotation);
- }
- }
-
- Map newAnnotations = new HashMap();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection && selection instanceof ITextSelection) {
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o instanceof IDOMNode) {
- int offset = ((ITextSelection) selection).getOffset();
- IStructuredDocumentRegion matchRegion = null;
- if (((Node) o).getNodeType() == Node.ATTRIBUTE_NODE) {
- o = ((Attr) o).getOwnerElement();
- }
-
- Position pStart = null;
- Position pEnd = null;
- String tag = ""; //$NON-NLS-1$
- if (o instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) o;
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
- if (startStructuredDocumentRegion.getNumberOfRegions() > 1) {
- ITextRegion nameRegion = startStructuredDocumentRegion.getRegions().get(1);
- pStart = new Position(startStructuredDocumentRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
- tag = startStructuredDocumentRegion.getText(nameRegion);
- }
- matchRegion = ((IDOMNode) o).getEndStructuredDocumentRegion();
- if (matchRegion != null && matchRegion.getNumberOfRegions() > 1) {
- ITextRegion nameRegion = matchRegion.getRegions().get(1);
- pEnd = new Position(matchRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
- }
- }
- else {
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.containsOffset(offset)) {
- if (endStructuredDocumentRegion.getNumberOfRegions() > 1) {
- ITextRegion nameRegion = endStructuredDocumentRegion.getRegions().get(1);
- pEnd = new Position(endStructuredDocumentRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
- tag = endStructuredDocumentRegion.getText(nameRegion);
- }
- matchRegion = ((IDOMNode) o).getStartStructuredDocumentRegion();
- if (matchRegion != null && matchRegion.getNumberOfRegions() > 1) {
- ITextRegion nameRegion = matchRegion.getRegions().get(1);
- pStart = new Position(matchRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
- }
- }
- }
- }
- if (pStart != null && pEnd != null) {
- Annotation annotation = new Annotation(ANNOTATION_TYPE, false, NLS.bind(XMLUIMessages.gotoMatchingTag_start, tag));
- newAnnotations.put(annotation, pStart);
- if (DEBUG) {
- System.out.println("adding " + annotation); //$NON-NLS-1$
- }
- annotation = new Annotation(ANNOTATION_TYPE, false, NLS.bind(XMLUIMessages.gotoMatchingTag_end, tag));
- newAnnotations.put(annotation, pEnd);
- if (DEBUG) {
- System.out.println("adding " + annotation); //$NON-NLS-1$
- }
- }
- }
- }
- ((IAnnotationModelExtension) annotationModel).replaceAnnotations((Annotation[]) oldAnnotations.toArray(new Annotation[oldAnnotations.size()]), newAnnotations);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
deleted file mode 100644
index 78f3ceb017..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
+++ /dev/null
@@ -1,146 +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.xml.ui.internal.actions;
-
-import com.ibm.icu.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-
-
-public class MenuBuilder {
-
-
- protected Comparator comparator = new Comparator() {
-
- public int compare(Object o1, Object o2) {
- return Collator.getInstance().compare(getSortKey(o1), getSortKey(o2));
- }
-
- protected String getSortKey(Object o) {
- String result = ""; //$NON-NLS-1$
- if (o instanceof IAction) {
- IAction action = (IAction) o;
- result = action.getText();
- }
- // else if (o instanceof MenuData)
- // {
- // result = "z" + ((MenuData)o).name;
- // }
- return result;
- }
- };
-
-
- protected void createAlphebeticalGrouping(IMenuManager menu, List actionList) {
- Object[] array = actionList.toArray();
- if (array.length > 0) {
- Arrays.sort(array, comparator);
- }
-
- int groupSize = 15;
- int minGroupSize = 5;
- int numberOfGroups = (array.length / groupSize) + ((array.length % groupSize > minGroupSize) ? 1 : 0);
-
- for (int i = 0; i < numberOfGroups; i++) {
- boolean isLastGroup = (i == (numberOfGroups - 1));
- int firstIndex = i * groupSize;
- int lastIndex = isLastGroup ? array.length - 1 : i * groupSize + groupSize - 1;
- Action firstAction = (Action) array[firstIndex];
- Action lastAction = (Action) array[lastIndex];
- MenuManager submenu = new MenuManager(firstAction.getText() + " - " + lastAction.getText()); //$NON-NLS-1$
- menu.add(submenu);
- for (int j = firstIndex; j <= lastIndex; j++) {
- submenu.add((Action) array[j]);
- }
- }
- }
-
-
- public void populateMenu(IMenuManager menu, List actionList, boolean createTiered) {
- // sort the actions
- if (actionList.size() < 25) {
- Object[] array = actionList.toArray();
- if (array.length > 0) {
- Arrays.sort(array, comparator);
- }
- for (int i = 0; i < array.length; i++) {
- menu.add((Action) array[i]);
- }
- }
- else {
- createAlphebeticalGrouping(menu, actionList);
- }
- }
-
- /*
- * protected void createPropertyGrouping(IMenuManager menu, List
- * actionList) { MenuDataTable menuDataTable = new MenuDataTable();
- *
- * for (Iterator i = actionList.iterator(); i.hasNext(); ) { String
- * groupName = null; Action action = (Action)i.next(); if (action
- * instanceof NodeAction) { groupName =
- * ((NodeAction)action).getGroupName(); } if (groupName == null) {
- * groupName = ""; } MenuData menuData =
- * menuDataTable.lookupOrCreate(groupName, "");
- * menuData.childList.add(action); } populateMenu(menu,
- * menuDataTable.getRoot()); }
- *
- *
- * protected void populateMenu(MenuManager menuManager, MenuData menuData) {
- * for (Iterator i = menuData.childList.iterator(); i.hasNext(); ) {
- * Object o = i.next(); if (o instanceof Action) {
- * menuManager.add((Action)o); } else if (o instanceof MenuData) {
- * MenuData childMenuData = (MenuData)o; MenuManager childMenuManager =
- * new MenuManager(childMenuData.name); menuManager.add(childMenuManager);
- * populateMenu(childMenuManager, childMenuData); } } }
- *
- *
- * public MenuDataTable { protected Hashtable table = new Hashtable();
- * protected MenuData root;
- *
- * public MenuDataTable() { root = lookupOrCreateMenuData(null, null); }
- *
- * protected MenuData lookupMenuData(String name) { String key = name !=
- * null ? name : ""; return (MenuData)menuDataTable.get(key); }
- *
- * protected MenuData lookupOrCreateMenuData(String name, String
- * parentName) { String key = name != null ? name : ""; MenuData menuData =
- * (MenuData)menuDataTable.get(key); if (menuData == null) { menuData =
- * new MenuData(name, parentName); menuDataTable.put(key, menuData); }
- * return menuData; }
- *
- * public MenuData getRoot() { return root; } }
- *
- *
- * protected class MenuData { public String name; public String
- * parentName; public List childList = new Vector();
- *
- * MenuData(String name, String parentName) { this.name = name;
- * this.parentName = parentName; }
- *
- * protected void sort() { Object[] array = childList.toArray(); if
- * (array.length > 0 ) { Arrays.sort(array, comparator); } childList =
- * Arrays.asList(array);
- *
- * for (Iterator i = childList.iterator(); i.hasNext(); ) { Object o =
- * i.next(); if (o instanceof MenuData) { ((MenuData)o).sort(); } } } }
- */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
deleted file mode 100644
index 1ce764ac29..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-public abstract class NodeAction extends Action {
-
- public String getSortKey() {
- return null;
- }
-
- /**
- * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
- * on a given <tt>IWorkspace</tt>.
- *
- * @param model the model to be checked
- * @param context the shell context for which <code>validateEdit</code> will be run
- * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
- * will return true; otherwise, false.
- */
- protected final boolean validateEdit(IStructuredModel model, Shell context) {
- if (model != null && model.getBaseLocation() != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
- }
- return false; //$NON-NLS-1$
- }
-
- public abstract String getUndoDescription();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
deleted file mode 100644
index 473e5f257f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,87 +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.xml.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-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.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Remove block comment action delegate for XML editor
- */
-public class RemoveBlockCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
-
- void processAction(IDocument document, ITextSelection textSelection) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
- if (model != null) {
- try {
- IndexedRegion selectionStartIndexedRegion = model.getIndexedRegion(textSelection.getOffset());
- IndexedRegion selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength());
-
- if ((selectionStartIndexedRegion == null) || (selectionEndIndexedRegion == null)) {
- return;
- }
-
- int openCommentOffset = selectionStartIndexedRegion.getStartOffset();
- int closeCommentOffset = selectionEndIndexedRegion.getEndOffset() - OPEN_COMMENT.length() - CLOSE_COMMENT.length();
-
- model.beginRecording(this, XMLUIMessages.RemoveBlockComment_tooltip);
- model.aboutToChangeModel();
-
- try {
- if (textSelection.getLength() == 0) {
- if (selectionStartIndexedRegion instanceof CommentImpl) {
- document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
- document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
- }
- }
- else {
- if (selectionStartIndexedRegion instanceof CommentImpl) {
- document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
- }
-
- if (selectionEndIndexedRegion instanceof CommentImpl) {
- document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
- }
- }
- removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- finally {
- model.changedModel();
- model.endRecording(this);
- }
- }
- finally {
- model.releaseFromEdit();
- }
- }
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.RemoveBlockComment_label);
- action.setToolTipText(XMLUIMessages.RemoveBlockComment_tooltip);
- action.setDescription(XMLUIMessages.RemoveBlockComment_description);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
deleted file mode 100644
index 18599bdf82..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMVisitor;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class ReplacePrefixAction extends NodeAction {
-
- class NodeCollectingDOMVisitor extends DOMVisitor {
- public List list = new Vector();
-
- protected boolean isPrefixChangedNeeded(Node node) {
- String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
- return prefixMapping.get(key) != null;
- }
-
- public void visitAttr(Attr attr) {
- /*
- * if (isPrefixChangedNeeded(element)) { list.add(attr); }
- */
- }
-
- protected void visitElement(Element element) {
- super.visitElement(element);
- if (isPrefixChangedNeeded(element)) {
- list.add(element);
- }
- }
- }
-
- protected static ImageDescriptor imageDescriptor;
- protected Element element;
- protected AbstractNodeActionManager manager;
- protected Map prefixMapping;
-
- public ReplacePrefixAction(AbstractNodeActionManager manager, Element element, Map prefixMapping) {
- this.manager = manager;
- this.element = element;
- this.prefixMapping = prefixMapping;
- }
-
- public String getUndoDescription() {
- return ""; //$NON-NLS-1$
- }
-
- public void run() {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (validateEdit(manager.getModel(), shell)) {
- NodeCollectingDOMVisitor visitor = new NodeCollectingDOMVisitor();
- visitor.visitNode(element);
- for (Iterator i = visitor.list.iterator(); i.hasNext();) {
- Node node = (Node) i.next();
- String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
- String newPrefix = (String) prefixMapping.get(key);
- if (newPrefix != null) {
- node.setPrefix(newPrefix);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/SiblingNavigationAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/SiblingNavigationAction.java
deleted file mode 100644
index a08b44f60e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/SiblingNavigationAction.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Provides navigation to next/previous DOM sibling Nodes
- *
- * @author nitin
- *
- */
-class SiblingNavigationAction extends TextEditorAction {
-
- private boolean fForward;
-
- /**
- * @param bundle
- * @param prefix
- * @param editor
- */
- SiblingNavigationAction(ResourceBundle bundle, String prefix, ITextEditor editor, boolean forward) {
- super(bundle, prefix, editor);
- fForward = forward;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- super.runWithEvent(event);
- if (getTextEditor() == null)
- return;
-
- ISelection selection = getTextEditor().getSelectionProvider().getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o instanceof Node) {
- Node sibling = null;
-
- if (((Node) o).getNodeType() == Node.ATTRIBUTE_NODE) {
- o = ((Attr) o).getOwnerElement();
- }
- if (fForward) {
- sibling = ((Node) o).getNextSibling();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getNextSibling();
- }
- if (sibling == null) {
- sibling = ((Node) o).getParentNode().getFirstChild();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getNextSibling();
- }
- }
- }
- else {
- sibling = ((Node) o).getPreviousSibling();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getPreviousSibling();
- }
- if (sibling == null) {
- sibling = ((Node) o).getParentNode().getLastChild();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getPreviousSibling();
- }
- }
- }
-
- // The only child is a Text Node, go to the parent Node
- if (((Node) o).getNodeType() == Node.TEXT_NODE && o.equals(sibling)) {
- sibling = ((Node) o).getParentNode();
- }
-
-
- if (sibling != null) {
- getTextEditor().getSelectionProvider().setSelection(new StructuredSelection(sibling));
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.TextEditorAction#update()
- */
- public void update() {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
deleted file mode 100644
index 09d81d1840..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,174 +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.xml.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-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.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Toggle comment action delegate for XML editor
- */
-public class ToggleCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.ToggleComment_label);
- action.setToolTipText(XMLUIMessages.ToggleComment_tooltip);
- action.setDescription(XMLUIMessages.ToggleComment_description);
- }
- }
-
- void processAction(IDocument document, ITextSelection textSelection) {
- // get text selection lines info
- int selectionStartLine = textSelection.getStartLine();
- int selectionEndLine = textSelection.getEndLine();
- try {
- int selectionEndLineOffset = document.getLineOffset(selectionEndLine);
- int selectionEndOffset = textSelection.getOffset() + textSelection.getLength();
-
- // adjust selection end line
- if ((selectionEndLine > selectionStartLine) && (selectionEndLineOffset == selectionEndOffset)) {
- selectionEndLine--;
- }
-
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- // save the selection position since it will be changing
- Position selectionPosition = null;
- boolean updateStartOffset = false;
- try {
- selectionPosition = new Position(textSelection.getOffset(), textSelection.getLength());
- document.addPosition(selectionPosition);
-
- // extra check if commenting from beginning of line
- int selectionStartLineOffset = document.getLineOffset(selectionStartLine);
- if ((textSelection.getLength() > 0) && (selectionStartLineOffset == textSelection.getOffset()) && !isCommentLine(document, selectionStartLine)) {
- updateStartOffset = true;
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- processAction(document, selectionStartLine, selectionEndLine);
-
- updateCurrentSelection(selectionPosition, document, updateStartOffset);
- }
-
- private void processAction(IDocument document, int selectionStartLine, int selectionEndLine) {
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
- if (model != null) {
- try {
- model.beginRecording(this, XMLUIMessages.ToggleComment_tooltip);
- model.aboutToChangeModel();
-
- for (int i = selectionStartLine; i <= selectionEndLine; i++) {
- try {
- if (document.getLineLength(i) > 0) {
- if (isCommentLine(document, i)) {
- int lineOffset = document.getLineOffset(i);
- IRegion region = document.getLineInformation(i);
- String string = document.get(region.getOffset(), region.getLength());
- int openCommentOffset = lineOffset + string.indexOf(OPEN_COMMENT);
- int closeCommentOffset = lineOffset + string.indexOf(CLOSE_COMMENT) - OPEN_COMMENT.length();
- uncomment(document, openCommentOffset, closeCommentOffset);
- }
- else {
- int openCommentOffset = document.getLineOffset(i);
- int lineDelimiterLength = document.getLineDelimiter(i) == null ? 0 : document.getLineDelimiter(i).length();
- int closeCommentOffset = openCommentOffset + document.getLineLength(i) - lineDelimiterLength + OPEN_COMMENT.length();
- comment(document, openCommentOffset, closeCommentOffset);
- }
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
- finally {
- model.changedModel();
- model.endRecording(this);
- model.releaseFromEdit();
- }
- }
- }
-
- private boolean isCommentLine(IDocument document, int line) {
- boolean isComment = false;
-
- try {
- IRegion region = document.getLineInformation(line);
- String string = document.get(region.getOffset(), region.getLength()).trim();
- isComment = (string.length() >= OPEN_COMMENT.length() + CLOSE_COMMENT.length()) && string.startsWith(OPEN_COMMENT) && string.endsWith(CLOSE_COMMENT);
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- return isComment;
- }
-
- private void comment(IDocument document, int openCommentOffset, int closeCommentOffset) {
- try {
- document.replace(openCommentOffset, 0, OPEN_COMMENT);
- document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
- removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- private void uncomment(IDocument document, int openCommentOffset, int closeCommentOffset) {
- try {
- document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
- document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- private void updateCurrentSelection(Position selectionPosition, IDocument document, boolean updateStartOffset) {
- if (fEditor instanceof ITextEditor) {
- // update the selection if text selection changed
- if (selectionPosition != null) {
- ITextSelection selection = null;
- if (updateStartOffset) {
- selection = new TextSelection(document, selectionPosition.getOffset() - OPEN_COMMENT.length(), selectionPosition.getLength() + OPEN_COMMENT.length());
- }
- else {
- selection = new TextSelection(document, selectionPosition.getOffset(), selectionPosition.getLength());
- }
- ISelectionProvider provider = ((ITextEditor) fEditor).getSelectionProvider();
- if (provider != null) {
- provider.setSelection(selection);
- }
- document.removePosition(selectionPosition);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index 1b416ccc2c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,200 +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.wst.xml.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.Logger;
-
-/**
- * AutoEditStrategy to handle characters inserted when Tab key is pressed
- */
-public class AutoEditStrategyForTabs implements IAutoEditStrategy {
- private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
-
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- // if not in smart insert mode just ignore
- if (!isSmartInsertMode()) {
- return;
- }
-
- // spaces for tab character
- if ((command.length == 0) && (command.text != null) && (command.text.length() > 0) && (command.text.indexOf(TAB_CHARACTER) != -1)) {
- smartInsertForTab(command, document);
- }
- }
-
- /**
- * Insert spaces for tabs
- *
- * @param command
- */
- private void smartInsertForTab(DocumentCommand command, IDocument document) {
- // tab key was pressed. now check preferences to see if need to insert
- // spaces instead of tab
- int indentationWidth = getIndentationWidth();
- if (indentationWidth > -1) {
- String originalText = command.text;
- StringBuffer newText = new StringBuffer(originalText);
-
- // determine where in line this command begins
- int lineOffset = -1;
- try {
- IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
- lineOffset = command.offset - lineInfo.getOffset();
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- ILineTracker lineTracker = getLineTracker(document, originalText);
-
- int startIndex = 0;
- int index = newText.indexOf(TAB_CHARACTER);
- while (index != -1) {
- String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
-
- // replace \t character with spaces
- newText.replace(index, index + 1, indent);
- if (lineTracker != null) {
- try {
- lineTracker.replace(index, 1, indent);
- }
- catch (BadLocationException e) {
- // if something goes wrong with replacing text, just
- // reset to current string
- lineTracker.set(newText.toString());
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- startIndex = index + indent.length();
- index = newText.indexOf(TAB_CHARACTER, startIndex);
- }
- command.text = newText.toString();
- }
- }
-
- /**
- * Calculate number of spaces for next tab stop
- */
- private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
- int indentSize = indentationWidth;
- int offsetInLine = -1;
- if (lineTracker != null) {
- try {
- IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
- if ((lineInfo.getOffset() == 0) && (lineOffset > -1)) {
- offsetInLine = lineOffset + index;
- }
- else {
- offsetInLine = index - lineInfo.getOffset();
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- else {
- if (lineOffset > -1) {
- offsetInLine = lineOffset + index;
- }
- }
- if ((offsetInLine > -1) && (indentationWidth > 0)) {
- int remainder = offsetInLine % indentationWidth;
- indentSize = indentationWidth - remainder;
- }
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentSize; i++) {
- indent.append(' ');
- }
- return indent.toString();
- }
-
- /**
- * Set up a line tracker for text within command if text is multi-line
- */
- private ILineTracker getLineTracker(IDocument document, String originalText) {
- ConfigurableLineTracker lineTracker = null;
- int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
- if ((delims[0] != -1) || (delims[1] != -1)) {
- lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
- lineTracker.set(originalText);
- }
- return lineTracker;
- }
-
- /**
- * Return true if active editor is in smart insert mode, false otherwise
- *
- * @return boolean
- */
- 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 int
- */
- private int getIndentationWidth() {
- int width = -1;
-
- Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
- if (XMLCorePreferenceNames.SPACE.equals(preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
- width = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
- }
-
- return width;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
deleted file mode 100644
index efeabd9e4e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.autoedit;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.w3c.dom.Node;
-
-/**
- * Automatically inserts closing comment tag or end tag when appropriate.
- */
-public class StructuredAutoEditStrategyXML implements IAutoEditStrategy {
- /*
- * NOTE: copies of this class exists in
- * org.eclipse.wst.xml.ui.internal.autoedit
- * org.eclipse.wst.html.ui.internal.autoedit
- */
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!((textEditor instanceof ITextEditorExtension3) && (((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))) {
- return;
- }
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- if (command.text != null) {
- smartInsertCloseElement(command, document, model);
- smartInsertForComment(command, document, model);
- smartInsertForEndTag(command, document, model);
- smartRemoveEndTag(command, document, model);
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
-
- private boolean isPreferenceEnabled(String key) {
- return (key != null && XMLUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
- }
-
- private boolean isCommentNode(IDOMNode node) {
- return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
- }
-
- private boolean isDocumentNode(IDOMNode node) {
- return ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE));
- }
-
- /**
- * Attempts to clean up an end-tag if a start-tag is converted into an empty-element
- * tag (e.g., <node />) and the original element was empty.
- *
- * @param command the document command describing the change
- * @param document the document that will be changed
- * @param model the model based on the document
- */
- private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- // An opening tag is now a self-terminated end-tag
- if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if (node != null && !node.hasChildNodes()) {
- IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
- if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
-
- /* if the region before the command offset is a an attribute value region
- * check to see if it has both and opening and closing quote
- */
- ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
- boolean inUnclosedAttValueRegion = false;
- if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- //get the text of the attribute value region
- String prevText = region.getText(prevTextRegion);
- inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
- (prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
- }
- //if command offset is in an unclosed attribute value region then done remove the end tag
- if(!inUnclosedAttValueRegion) {
- region = node.getEndStructuredDocumentRegion();
- if (region != null && region.isEnded()) {
- document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- private void smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("-") && (document.getLength() >= 3) && document.get(command.offset - 3, 3).equals("<!-") && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " -->"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 2;
- command.doit = false;
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
-
- }
-
- /**
- * Attempts to insert the end tag when completing a start-tag with the '&gt;' character.
- *
- * @param command
- * @param document
- * @param model
- */
- private void smartInsertCloseElement(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- // Check terminating start tag, but ignore empty-element tags
- if (command.text.equals(">") && document.getLength() > 0 && document.getChar(command.offset - 1) != '/' && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS)) { //$NON-NLS-1$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset - 1);
- boolean isClosedByParent = false;
- // Only insert an end-tag if necessary. Because of the way the document is parsed, it is possible for a child tag with the same
- // name as an ancestor to be paired with the end-tag of an ancestor, so the ancestors must be checked for an unclosed tag.
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE && (!node.isClosed() || (isClosedByParent = hasUnclosedAncestor(node)))) {
- IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
- if (region != null && region.getRegions().size() > 0 && region.getRegions().get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN && !isClosedByParent)
- return;
- region = node.getStartStructuredDocumentRegion();
- if (region != null) {
- ITextRegion textRegion = region.getRegionAtCharacterOffset(command.offset - 1);
- if (textRegion != null && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {
- // Check that the command is not within a quoted attribute value
- final String text = region.getText(textRegion);
- final char first = text.charAt(0);
- if (first == '\'' || first == '"') {
- if (text.length() < 2) // Just an opening quote
- return;
- final char last = text.charAt(text.length() - 1);
- if (last == first) { // Quote is paired
- if (command.offset < region.getTextEndOffset(textRegion)) // Command is within the value
- return;
- }
- else // Unpaired quote
- return;
- }
- }
- }
- command.text += "</" + getElementName(node, command.offset) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 1;
- }
-
- }
- } catch (BadLocationException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Get the element name that will be created by closing the start tag. Defaults
- * to the node's nodeName.
- * @param node the node that is being edited
- * @param offset the offset in the document where the start tag is closed
- * @return The element name of the tag
- */
- private String getElementName(IDOMNode node, int offset) {
- String name = null;
-
- IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
- ITextRegion textRegion = region.getRegionAtCharacterOffset(offset);
- if (textRegion != null && textRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
- int nameStart = region.getStartOffset(textRegion);
- String regionText = region.getText(textRegion);
- int length = offset - nameStart;
- if (length <= regionText.length())
- name = regionText.substring(0, length);
- }
-
- // Default to the node name
- if (name == null)
- name = node.getNodeName();
- return name;
- }
-
- private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("/") && (document.getLength() >= 1) && document.get(command.offset - 1, 1).equals("<") && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
- if (isCommentNode(parentNode)) {
- // loop and find non comment node parent
- while ((parentNode != null) && isCommentNode(parentNode)) {
- parentNode = (IDOMNode) parentNode.getParentNode();
- }
- }
-
- if (!isDocumentNode(parentNode)) {
- // only add end tag if one does not already exist or if
- // add '/' does not create one already
- IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
- IDOMNode ancestor = parentNode;
- boolean smartInsertForEnd = false;
- if(endTagStructuredDocumentRegion != null) {
- // Look for ancestors by the same name that are missing end tags
- while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
- if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
- smartInsertForEnd = true;
- break;
- }
- }
- }
- if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
- StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
- if (toAdd.length() > 0) {
- toAdd.append(">"); //$NON-NLS-1$
- String suffix = toAdd.toString();
- if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
- command.text += suffix;
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * Checks if <code>node</code> has an unclosed ancestor by the same name
- *
- * @param node the node to check
- * @return true if <code>node</code> has an unclosed parent with the same node name
- */
- private boolean hasUnclosedAncestor(IDOMNode node) {
- IDOMNode parent = (IDOMNode) node.getParentNode();
- while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE && parent.getNodeName().equals(node.getNodeName())) {
- if (!parent.isClosed())
- return true;
- parent = (IDOMNode) parent.getParentNode();
- }
- return false;
- }
-
- /**
- * Return the active text editor if possible, otherwise the active editor
- * part.
- *
- * @return Object
- */
- private Object getActiveTextEditor() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor) {
- return editor;
- }
- ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- if (textEditor != null) {
- return textEditor;
- }
- return editor;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
deleted file mode 100644
index abd65e7d96..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
+++ /dev/null
@@ -1,2509 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-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.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-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.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-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.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future.
- * Implementers of this class should now use the <code>org.eclipse.wst.sse.ui.completionProposal</code>
- * extension point in conjunction with the {@link ICompletionProposalComputer} interface.
- *
- * @see StructuredContentAssistProcessor
- */
-abstract public class AbstractContentAssistProcessor implements IContentAssistProcessor, IReleasable {
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private class DOMJSPRegionContextsPrivateCopy {
- private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
- private static final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
- private static final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
- private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- private static final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
- private static final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
- private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
- private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
- private static final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
- private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
- }
-
- protected static final String INTERNALERROR = XMLUIMessages.SEVERE_internal_error_occu_UI_;
- protected static final String UNKNOWN_ATTR = XMLUIMessages.No_known_attribute__UI_;
- protected static final String UNKNOWN_CONTEXT = XMLUIMessages.Content_Assist_not_availab_UI_;
- protected char completionProposalAutoActivationCharacters[] = null;
- protected char contextInformationAutoActivationCharacters[] = null;
- private AttributeContextInformationPresenter fContextInformationPresenter = null;
-
- protected String fErrorMessage = null;
- protected XMLContentModelGenerator fGenerator;
- // protected IResource resource = null;
- protected MarkupTagInfoProvider fInfoProvider = null;
- protected ITextViewer fTextViewer = null;
-
- private final boolean showValues = true;
-
- public AbstractContentAssistProcessor() {
- init();
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- IStructuredDocumentRegion sdRegion = contentAssistRequest.getDocumentRegion();
- // retrieve the list of attributes
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- if (elementDecl != null) {
- CMNamedNodeMap attributes = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- }
- attributes = allAttributes;
-
- String matchString = contentAssistRequest.getMatchString();
-
- // check whether an attribute really exists for the replacement
- // offsets AND if it possesses a value
- boolean attrAtLocationHasValue = false;
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- AttrImpl existingAttr = (AttrImpl) attrs.item(i);
- ITextRegion name = existingAttr.getNameRegion();
-
- if ((sdRegion.getStartOffset(name) <= contentAssistRequest.getReplacementBeginPosition()) && (sdRegion.getStartOffset(name) + name.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength()) && (existingAttr.getValueRegion() != null)) {
- attrAtLocationHasValue = true;
- break;
- }
- }
-
- // only add proposals for the attributes whose names begin with
- // the matchstring
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributes.item(i);
-
- int isRequired = 0;
- if (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
- isRequired = XMLRelevanceConstants.R_REQUIRED;
- }
-
- boolean showAttribute = true;
- showAttribute = showAttribute && beginsWith(getRequiredName(node, attrDecl), matchString.trim());
- AttrImpl attr = (AttrImpl) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
- ITextRegion nameRegion = attr != null ? attr.getNameRegion() : null;
- // nameRegion.getEndOffset() + 1 is required to allow for
- // matches against the full name of an existing Attr
- showAttribute = showAttribute && (attr == null || nameRegion == null || (nameRegion != null && (sdRegion.getStartOffset(nameRegion) <= contentAssistRequest.getReplacementBeginPosition()) && (sdRegion.getStartOffset(nameRegion) + nameRegion.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength())));
- if (showAttribute) {
- Image attrImage = CMImageUtil.getImage(attrDecl);
- if (attrImage == null) {
- if (isRequired > 0) {
- attrImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
- }
- else {
- attrImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
- }
-
- String proposedText = null;
- String proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
- CustomCompletionProposal proposal = null;
- // attribute is at this location and already exists
- if (attrAtLocationHasValue) {
- // only propose the name
- proposedText = getRequiredName(node, attrDecl);
- proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), attrImage, proposedText, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true);
- }
- // no attribute exists or is elsewhere, generate
- // minimally
- else {
- Attr existingAttrNode = (Attr) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
- String value = null;
- if (existingAttrNode != null && existingAttrNode.getSpecified()) {
- value = existingAttrNode.getNodeValue();
- }
- if ((value != null) && (value.length() > 0)) {
- proposedText = getRequiredName(node, attrDecl);
- }
- else {
- proposedText = getRequiredText(node, attrDecl);
- }
- proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), attrDecl.getNodeName().length() + 2, attrImage,
- // if the value isn't empty (no empty set of
- // quotes), show it
- // BUG 203494, content strings may have "", but not be empty
- // An empty string is when there's no content between double quotes
- // and there is no single quote that may be encasing a double quote
- (showValues && (proposedText.lastIndexOf('\"') - proposedText.indexOf('\"') == 1 && proposedText.indexOf('\'') == -1)) ? getRequiredName(node, attrDecl) : proposedText,
- null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired);
- }
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- else {
- setErrorMessage(NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{node.getNodeName()})));
- }
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- // Find the attribute region and name for which this position should
- // have a value proposed
- 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;
- }
- }
-
- // the name region is REQUIRED to do anything useful
- if (nameRegion != null) {
- // Retrieve the declaration
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
-
- // String attributeName = nameRegion.getText();
- String attributeName = open.getText(nameRegion);
-
- CMAttributeDeclaration attrDecl = null;
-
- // No CMElementDeclaration means no attribute metadata, but
- // retrieve the
- // declaration for the attribute otherwise
- if (elementDecl != null) {
- CMNamedNodeMap attributes = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes) {
- private Map caseInsensitive;
-
- private Map getCaseInsensitiveMap() {
- if(caseInsensitive == null)
- caseInsensitive = new HashMap();
- return caseInsensitive;
- }
-
- public CMNode getNamedItem(String name) {
- CMNode node = super.getNamedItem(name);
- if (node == null) {
- node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
- }
- return node;
- }
-
- public void put(CMNode cmNode) {
- super.put(cmNode);
- getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
- }
- };
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- }
- attributes = allAttributes;
-
- String noprefixName = DOMNamespaceHelper.getUnprefixedName(attributeName);
- if (attributes != null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(noprefixName);
- if (attrDecl == null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(attributeName);
- }
- }
- if (attrDecl == null) {
- setErrorMessage(UNKNOWN_ATTR, attributeName);
- }
- }
-
- String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
- String proposedInfo = null;
- Image image = CMImageUtil.getImage(attrDecl);
- if (image == null) {
- if ((attrDecl != null) && (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED)) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
- }
- else {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
- }
-
- if ((attrDecl != null) && (attrDecl.getAttrType() != null)) {
- // attribute is known, prompt with values from the declaration
- proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
- List possibleValues = getPossibleDataTypeValues(node, attrDecl);
- String defaultValue = attrDecl.getAttrType().getImpliedValue();
- if (possibleValues.size() > 0 || defaultValue != null) {
- // ENUMERATED VALUES
- String matchString = contentAssistRequest.getMatchString();
- if (matchString == null) {
- matchString = ""; //$NON-NLS-1$
- }
- if ((matchString.length() > 0) && (matchString.startsWith("\"") || matchString.startsWith("'"))) {
- matchString = matchString.substring(1);
- }
- boolean currentValid = false;
-
- // d210858, if the region's a container, don't suggest the
- // enumerated values as they probably won't help
- boolean existingComplicatedValue = (contentAssistRequest.getRegion() != null) && (contentAssistRequest.getRegion() instanceof ITextRegionContainer);
- if (!existingComplicatedValue) {
- int rOffset = contentAssistRequest.getReplacementBeginPosition();
- int rLength = contentAssistRequest.getReplacementLength();
- for (Iterator j = possibleValues.iterator(); j.hasNext();) {
- String possibleValue = (String) j.next();
- if(!possibleValue.equals(defaultValue)) {
- currentValid = currentValid || possibleValue.equals(currentValue);
- if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
- String rString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, possibleValue.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if(defaultValue != null && ((matchString.length() == 0) || defaultValue.startsWith(matchString))) {
- String rString = "\"" + defaultValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, defaultValue.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT), rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) || (attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) && (attrDecl.getAttrType().getImpliedValue() != null)) {
- // FIXED values
- String value = attrDecl.getAttrType().getImpliedValue();
- if ((value != null) && (value.length() > 0)) {
- String rValue = "\"" + value + "\"";//$NON-NLS-2$//$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- if ((currentValue.length() > 0) && !value.equals(currentValue)) {
- rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- proposal = new CustomCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- else {
- // unknown attribute, so supply nice empty values
- proposedInfo = getAdditionalInfo(null, elementDecl);
- CustomCompletionProposal proposal = null;
- if ((currentValue != null) && (currentValue.length() > 0)) {
- String rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- proposal = new CustomCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else {
- setErrorMessage(UNKNOWN_CONTEXT);
- }
- }
-
- protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
- contentAssistRequest.addProposal(new CustomCompletionProposal("<!-- -->", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 5, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_COMMENT), NLS.bind(XMLUIMessages.Comment__, (new Object[]{" <!-- -->"})), //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_COMMENT));
- }
-
- /**
- * Add all of the element declarations int the CMContent object into one
- * big list.
- */
- protected void addContent(List contentList, CMContent content) {
- if (content == null) {
- return;
- }
- if (content instanceof CMGroup) {
- CMNodeList children = ((CMGroup) content).getChildNodes();
- if (children == null) {
- return;
- }
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- if (child.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- contentList.add(child);
- }
- else {
- if (child.getNodeType() == CMNode.GROUP) {
- addContent(contentList, (CMContent) child);
- }
- else {
- throw new IllegalArgumentException("Unknown content child: " + child); //$NON-NLS-1$
- }
- }
- }
- }
- else {
- contentList.add(content);
- }
- }
-
- protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
- // if a DocumentElement exists, use that for the root Element name
- String rootname = "unspecified"; //$NON-NLS-1$
- if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
- rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
- }
-
- String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"//UNKNOWN/\" \"unknown.dtd\">"; //$NON-NLS-1$ //$NON-NLS-2$
- ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 10, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE), "<!DOCTYPE ... >", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_DOCTYPE);
- // TODO provide special documentation on doc type
- contentAssistRequest.addProposal(proposal);
- }
-
- /**
- * Add the proposals for a completely empty document
- */
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- // nothing
- }
-
- /**
- * Add the proposals for the name in an end tag
- */
- protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
-
- if (contentAssistRequest.getStartOffset() + contentAssistRequest.getRegion().getTextLength() < contentAssistRequest.getReplacementBeginPosition()) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_END_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- Node aNode = contentAssistRequest.getNode();
- String matchString = contentAssistRequest.getMatchString();
- if (matchString.startsWith("</")) {
- matchString = matchString.substring(2);
- }
- while (aNode != null) {
- if (aNode.getNodeType() == Node.ELEMENT_NODE) {
- if (aNode.getNodeName().startsWith(matchString)) {
- IDOMNode aXMLNode = (IDOMNode) aNode;
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration((Element) aNode);
- if ((aXMLNode.getEndStructuredDocumentRegion() == null) && ((ed == null) || (ed.getContentType() != CMElementDeclaration.EMPTY))) {
- String replacementText = aNode.getNodeName();
- String displayText = replacementText;
- String proposedInfo = (ed != null) ? getAdditionalInfo(null, ed) : null;
- if(!contentAssistRequest.getDocumentRegion().isEnded()) {
- replacementText += ">"; //$NON-NLS-1$
- }
- CustomCompletionProposal proposal = null;
- // double check to see if the region acted upon is
- // a tag name; replace it if so
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_NAME) {
- proposal = new CustomCompletionProposal(replacementText, contentAssistRequest.getStartOffset(), contentAssistRequest.getRegion().getTextLength(), replacementText.length(), image, displayText, null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
- }
- else {
- proposal = new CustomCompletionProposal(replacementText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), replacementText.length(), image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{"'" + displayText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
- null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
- }
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- aNode = aNode.getParentNode();
- }
- }
- }
-
- /**
- * Prompt for end tags to a non-empty Node that hasn't ended Handles these
- * cases: <br>
- * <tagOpen>| <br>
- * <tagOpen>< |<br>
- * <tagOpen></ |
- *
- * @param contentAssistRequest
- */
- protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
-
- if (isCommentNode(node)) {
- // loop and find non comment node parent
- while ((node != null) && isCommentNode(node)) {
- node = (IDOMNode) node.getParentNode();
- }
- }
-
- // node is already closed
- if (node.isClosed()) {
- // loop and find non comment unclose node parent
- while ((node != null) && node.isClosed()) {
- node = (IDOMNode) node.getParentNode();
- }
- }
- // there were no unclosed tags
- if (node == null) {
- return;
- }
-
- // data to create a CustomCompletionProposal
- String replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
- int replaceBegin = contentAssistRequest.getReplacementBeginPosition();
- int replaceLength = contentAssistRequest.getReplacementLength();
- int cursorOffset = node.getNodeName().length() + 1;
- String displayString = ""; //$NON-NLS-1$
- String proposedInfo = ""; //$NON-NLS-1$
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-
- setErrorMessage(null);
- boolean addProposal = false;
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // ////////////////////////////////////////////////////////////////////////////////////
- IStructuredDocument sDoc = (IStructuredDocument) fTextViewer.getDocument();
- IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
- // skip backward to "<", "</", or the (unclosed) start tag, null
- // if not found
- String type = ""; //$NON-NLS-1$
- while ((xmlEndTagOpen != null) && ((type = xmlEndTagOpen.getType()) != DOMRegionContext.XML_END_TAG_OPEN) && (type != DOMRegionContext.XML_TAG_CLOSE) && !needsEndTag(xmlEndTagOpen) && (type != DOMRegionContext.XML_TAG_OPEN)) {
- xmlEndTagOpen = xmlEndTagOpen.getPrevious();
- }
-
- if (xmlEndTagOpen == null) {
- return;
- }
-
- node = (IDOMNode) node.getModel().getIndexedRegion(xmlEndTagOpen.getStartOffset());
- node = (IDOMNode) node.getParentNode();
-
- if (isStartTag(xmlEndTagOpen)) {
- // this is the case for a start tag w/out end tag
- // eg:
- // <p>
- // <% String test = "test"; %>
- // |
- if (needsEndTag(xmlEndTagOpen)) {
- String tagName = getTagName(xmlEndTagOpen);
- xmlEndTagOpen.getTextEndOffset();
- replaceLength = 0;
- replaceText = "</" + tagName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
- // replaceText = "</" + node.getNodeName() + ">";
- // //$NON-NLS-1$ $NON-NLS-2$
- cursorOffset = tagName.length() + 3;
- displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{tagName}));
- addProposal = true;
- }
- }
- else if (type == DOMRegionContext.XML_END_TAG_OPEN) {
- // this is the case for: <tag> </ |
- // possibly <tag> </ |<anotherTag>
- // should only be replacing white space...
- replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
- replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
- cursorOffset = replaceText.length();
- replaceBegin = xmlEndTagOpen.getTextEndOffset();
- displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{node.getNodeName()}));
- addProposal = true;
- }
- else if (type == DOMRegionContext.XML_TAG_OPEN) {
- // this is the case for: <tag> < |
- replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
- cursorOffset = replaceText.length();
- // replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$
- // $NON-NLS-2$
- // should only be replacing white space...
- replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
- replaceBegin = xmlEndTagOpen.getTextEndOffset();
- displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{"/" + node.getNodeName()})); //$NON-NLS-1$
- addProposal = true;
- }
- }
- // ////////////////////////////////////////////////////////////////////////////////////
- // sometimes the node is not null, but
- // getNodeValue() is null, put in a null check
- else if ((node.getNodeValue() != null) && (node.getNodeValue().indexOf("</") != -1)) { //$NON-NLS-1$
- // the case where "</" is started, but the nodes comes in as a
- // text node (instead of element)
- // like this: <tag> </|
- Node parent = node.getParentNode();
- if ((parent != null) && (parent.getNodeType() != Node.DOCUMENT_NODE)) {
- replaceText = parent.getNodeName() + ">"; //$NON-NLS-1$
- cursorOffset = replaceText.length();
- displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{parent.getNodeName()}));
- setErrorMessage(null);
- addProposal = true;
- }
- }
- // ////////////////////////////////////////////////////////////////////////////////////
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- setErrorMessage(UNKNOWN_CONTEXT);
- }
- if (addProposal == true) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(replaceText, replaceBegin, replaceLength, cursorOffset, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_END_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
-
- protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
- ICompletionProposal[] eps = computeEntityReferenceProposals(documentPosition, completionRegion, treeNode);
- for (int i = 0; (eps != null) && (i < eps.length); i++) {
- contentAssistRequest.addProposal(eps[i]);
- }
- }
-
- protected void addEntityProposals(Vector proposals, Properties map, String key, int nodeOffset, IStructuredDocumentRegion sdRegion, ITextRegion completionRegion) {
- if (map == null) {
- return;
- }
- String entityName = ""; //$NON-NLS-1$
- String entityValue = ""; //$NON-NLS-1$
- Image entityIcon = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE);
- String replacementText = ""; //$NON-NLS-1$
- String displayString = ""; //$NON-NLS-1$
- Enumeration keys = map.keys();
-
- while ((keys != null) && keys.hasMoreElements()) {
- entityName = (String) keys.nextElement();
- entityValue = map.getProperty(entityName);
- // filter based on partial entity string...
- if (entityName.toLowerCase().startsWith(key.toLowerCase()) || key.trim().equals("")) //$NON-NLS-1$
- {
- // figure out selection...if text is selected, add it to
- // selection length
- int selectionLength = nodeOffset;
- if (fTextViewer != null) {
- selectionLength += fTextViewer.getSelectedRange().y;
- }
- // create a new proposal for entity string...
- replacementText = "&" + entityName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- displayString = "&" + entityName + "; (" + entityValue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ICompletionProposal cp = new CustomCompletionProposal(replacementText, sdRegion.getStartOffset(completionRegion), selectionLength, replacementText.length(), entityIcon, displayString, null, null, XMLRelevanceConstants.R_ENTITY);
- if (cp != null) {
- proposals.add(cp);
- }
- }
- }
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- CustomCompletionProposal proposal = new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 9, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CDATASECTION), "CDATA Section", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_CDATA);
- contentAssistRequest.addProposal(proposal);
-
- proposal = new CustomCompletionProposal(nodeName, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), nodeName.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT), "#PCDATA", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_CDATA);
- contentAssistRequest.addProposal(proposal);
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- Node aNode = contentAssistRequest.getNode();
- boolean xmlpiFound = false;
- Document owningDocument = aNode.getOwnerDocument();
- // ==> // int xmlpiNodePosition = -1;
-
- // make sure xmlpi is root element
- // don't want doctype proposal if XMLPI isn't first element...
- Node first = owningDocument.getFirstChild();
- boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
- boolean insertDoctype = xmlpiIsFirstElement;
-
- for (Node child = owningDocument.getFirstChild(); child != null; child = child.getNextSibling()) {
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- xmlpiFound = xmlpiFound || xmlpi;
- if (xmlpiFound) {
- if (child instanceof IDOMNode) {
- // ==> // int xmlpiNodePosition =
- // ((XMLNode)child).getEndOffset();
- }
- // skip white space and text
- while (((child = child.getNextSibling()) != null) && (child.getNodeType() == Node.TEXT_NODE)) {
- // just skipping
- }
- // check if theres a node inbetween XMLPI and cursor position
- if ((child != null) && (child instanceof IDOMNode)) {
- if ((contentAssistRequest.getReplacementBeginPosition() >= ((IDOMNode) child).getEndOffset()) || !xmlpiIsFirstElement) {
- insertDoctype = false;
- }
- }
- break;
- }
- }
-
- if (xmlpiFound && (owningDocument.getDoctype() == null) && isCursorAfterXMLPI(contentAssistRequest) && insertDoctype) {
- addDocTypeProposal(contentAssistRequest);
- }
- }
-
- /**
- * Close an unclosed start tag
- */
- protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
- if (node.getNodeType() == Node.ELEMENT_NODE) {
-
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- String proposedInfo = (elementDecl != null) ? getAdditionalInfo(null, elementDecl) : null;
- int contentType = (elementDecl != null) ? elementDecl.getContentType() : CMElementDeclaration.ANY;
- // if it's XML and content doesn't HAVE to be element, add "/>"
- // proposal.
- boolean endWithSlashBracket = (getXML(node) && (contentType != CMElementDeclaration.ELEMENT));
-
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
-
- // is the start tag ended properly?
- if ((contentAssistRequest.getDocumentRegion() == node.getFirstStructuredDocumentRegion()) && !(node.getFirstStructuredDocumentRegion()).isEnded()) {
- setErrorMessage(null);
- // Is this supposed to be an empty tag? Note that if we can't
- // tell, we assume it's not.
- if ((elementDecl != null) && (elementDecl.getContentType() == CMElementDeclaration.EMPTY)) {
- // prompt with a self-closing end character if needed
- CustomCompletionProposal proposal = new CustomCompletionProposal(getContentGenerator().getStartTagClose(node, elementDecl), contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore the length --
- // always insert
- // contentAssistRequest.getReplacementLength(),
- 0, getContentGenerator().getStartTagClose(node, elementDecl).length(), image, NLS.bind(XMLUIMessages.Close_with___, (new Object[]{getContentGenerator().getStartTagClose(node, elementDecl)})), null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- // prompt with a close for the start tag
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore the
- // length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
-
- // prompt with the closer for the start tag and an end tag
- // if one is not present
- if (node.getEndStructuredDocumentRegion() == null) {
- // make sure tag name is actually what it thinks it
- // is...(eg. <%@ vs. <jsp:directive)
- IStructuredDocumentRegion sdr = contentAssistRequest.getDocumentRegion();
- String openingTagText = (sdr != null) ? sdr.getFullText() : ""; //$NON-NLS-1$
- if ((openingTagText != null) && (openingTagText.indexOf(node.getNodeName()) != -1)) {
- proposal = new CustomCompletionProposal("></" + node.getNodeName() + ">", //$NON-NLS-2$//$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to
- // ignore the length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with____, (new Object[]{node.getNodeName()})), null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
- // prompt with slash bracket "/>" incase if it's a self
- // ending tag
- if (endWithSlashBracket) {
- proposal = new CustomCompletionProposal("/>", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore
- // the length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 2, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" \"/>\""})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG + 1); // +1
- // to
- // bring
- // to
- // top
- // of
- // list
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else if ((contentAssistRequest.getDocumentRegion() == node.getLastStructuredDocumentRegion()) && !node.getLastStructuredDocumentRegion().isEnded()) {
- setErrorMessage(null);
- // prompt with a closing end character for the end tag
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore the
- // length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- setErrorMessage(UNKNOWN_CONTEXT);
- }
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- List cmnodes = null;
- Node parent = contentAssistRequest.getParent();
- String error = null;
-
- // (nsd) This is only valid at the document element level
- // only valid if it's XML (check added 2/17/2004)
- if ((parent != null) && (parent.getNodeType() == Node.DOCUMENT_NODE) && ((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
- return;
- }
- // only want proposals if cursor is after doctype...
- if (!isCursorAfterDoctype(contentAssistRequest)) {
- return;
- }
-
- // fix for meta-info comment nodes.. they currently "hide" other
- // proposals because the don't
- // have a content model (so can't propose any children..)
- if ((parent != null) && (parent instanceof IDOMNode) && isCommentNode((IDOMNode) parent)) {
- // loop and find non comment node?
- while ((parent != null) && isCommentNode((IDOMNode) parent)) {
- parent = parent.getParentNode();
- }
- }
-
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
- if (parentDecl != null) {
- // XSD-specific ability - no filtering
- CMDataType childType = parentDecl.getDataType();
- if (childType != null) {
- String[] childStrings = childType.getEnumeratedValues();
- String defaultValue = childType.getImpliedValue();
- if (childStrings != null || defaultValue != null) {
- // the content string is the sole valid child...so
- // replace the rest
- int begin = contentAssistRequest.getReplacementBeginPosition();
- int length = contentAssistRequest.getReplacementLength();
- if (parent instanceof IDOMNode) {
- if (((IDOMNode) parent).getLastStructuredDocumentRegion() != ((IDOMNode) parent).getFirstStructuredDocumentRegion()) {
- begin = ((IDOMNode) parent).getFirstStructuredDocumentRegion().getEndOffset();
- length = ((IDOMNode) parent).getLastStructuredDocumentRegion().getStartOffset() - begin;
- }
- }
- String proposedInfo = getAdditionalInfo(parentDecl, childType);
- for (int i = 0; i < childStrings.length; i++) {
- if(!childStrings[i].equals(defaultValue))
- {
- CustomCompletionProposal textProposal = new CustomCompletionProposal(childStrings[i], begin, length, childStrings[i].length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(textProposal);
- }
- }
- if(defaultValue != null) {
- CustomCompletionProposal textProposal = new CustomCompletionProposal(defaultValue, begin, length, defaultValue.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT), defaultValue, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(textProposal);
- }
- }
- }
- }
- if ((parentDecl != null) && (parentDecl.getContentType() == CMElementDeclaration.PCDATA)) {
- addPCDATAProposal(parentDecl.getNodeName(), contentAssistRequest);
- }
- else {
- // retrieve the list of all possible children within this
- // parent context
- cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
-
- // retrieve the list of the possible children within this
- // parent context and at this index
- List strictCMNodeSuggestions = null;
- if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) {
- strictCMNodeSuggestions = getValidChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
- }
- Iterator nodeIterator = cmnodes.iterator();
- if (!nodeIterator.hasNext()) {
- if (getCMElementDeclaration(parent) != null) {
- error = NLS.bind(XMLUIMessages._Has_no_available_child, (new Object[]{parent.getNodeName()}));
- }
- else {
- error = NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{parent.getNodeName()}));
- }
- }
- String matchString = contentAssistRequest.getMatchString();
- // chop off any leading <'s and whitespace from the
- // matchstring
- while ((matchString.length() > 0) && (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) {
- //$NON-NLS-1$
- matchString = matchString.substring(1);
- }
- while (nodeIterator.hasNext()) {
- Object o = nodeIterator.next();
- if (o instanceof CMElementDeclaration) {
- CMElementDeclaration elementDecl = (CMElementDeclaration) o;
- // only add proposals for the child element's that
- // begin with the matchstring
- String tagname = getRequiredName(parent, elementDecl);
- boolean isStrictCMNodeSuggestion = strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
-
- Image image = CMImageUtil.getImage(elementDecl);
-
- if (image == null) {
- if (strictCMNodeSuggestions != null) {
- image = isStrictCMNodeSuggestion ? XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_EMPHASIZED) : XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_DEEMPHASIZED);
- }
- else {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
-
- }
-
- // int markupAdjustment =
- // getContentGenerator().getMinimalStartTagLength(parent,
- // elementDecl);
- if (beginsWith(tagname, matchString)) {
- String proposedText = getRequiredText(parent, elementDecl);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
- // place cursor in first empty quotes
- int markupAdjustment = getCursorPositionForProposedText(proposedText);
-
- String proposedInfo = getAdditionalInfo(parentDecl, elementDecl);
- int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION : XMLRelevanceConstants.R_TAG_INSERTION;
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), markupAdjustment, image, tagname, null, proposedInfo, relevance);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if (contentAssistRequest.getProposals().size() == 0) {
- if (error != null) {
- setErrorMessage(error);
- }
- else if ((contentAssistRequest.getMatchString() != null) && (contentAssistRequest.getMatchString().length() > 0)) {
- setErrorMessage(NLS.bind(XMLUIMessages.No_known_child_tag, (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
- //$NON-NLS-1$ = "No known child tag names of <{0}> begin with \"{1}\"."
- }
- else {
- setErrorMessage(NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()})));
- }
- }
- }
- }
- else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- // Can only prompt with elements if the cursor position is past
- // the XML processing
- // instruction and DOCTYPE declaration
- boolean xmlpiFound = false;
- boolean doctypeFound = false;
- int minimumOffset = -1;
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- boolean doctype = child.getNodeType() == Node.DOCUMENT_TYPE_NODE;
- if (xmlpi || (doctype && (minimumOffset < 0))) {
- minimumOffset = ((IDOMNode) child).getFirstStructuredDocumentRegion().getStartOffset() + ((IDOMNode) child).getFirstStructuredDocumentRegion().getTextLength();
- }
- xmlpiFound = xmlpiFound || xmlpi;
- doctypeFound = doctypeFound || doctype;
- }
-
- if (contentAssistRequest.getReplacementBeginPosition() >= minimumOffset) {
- List childDecls = getAvailableRootChildren((Document) parent, childPosition);
- for (int i = 0; i < childDecls.size(); i++) {
- CMElementDeclaration ed = (CMElementDeclaration) childDecls.get(i);
- if (ed != null) {
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- String proposedText = getRequiredText(parent, ed);
- String tagname = getRequiredName(parent, ed);
- // account for the &lt; and &gt;
- int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, ed);
- String proposedInfo = getAdditionalInfo(null, ed);
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), markupAdjustment, image, tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
-
- protected void addTagNameProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- List cmnodes = null;
- Node parent = contentAssistRequest.getParent();
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- String error = null;
- String matchString = contentAssistRequest.getMatchString();
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- // retrieve the list of children
- // validActions = getAvailableChildrenAtIndex((Element) parent,
- // childPosition);
- cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
- Iterator nodeIterator = cmnodes.iterator();
- // chop off any leading <'s and whitespace from the matchstring
- while ((matchString.length() > 0) && (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) {
- //$NON-NLS-1$
- matchString = matchString.substring(1);
- }
- if (!nodeIterator.hasNext()) {
- error = NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()}));
- }
- while (nodeIterator.hasNext()) {
- CMNode elementDecl = (CMNode) nodeIterator.next();
- if (elementDecl != null) {
- // only add proposals for the child element's that begin
- // with the matchstring
- String proposedText = null;
- int cursorAdjustment = 0;
-
- // do a check to see if partial attributes of partial tag
- // names are in list
- if (((node != null) && (node.getAttributes() != null) && (node.getAttributes().getLength() > 0) && attributeInList(node, parent, elementDecl)) || ((node.getNodeType() != Node.TEXT_NODE) && node.getFirstStructuredDocumentRegion().isEnded())) {
-
- proposedText = getRequiredName(parent, elementDecl);
- cursorAdjustment = proposedText.length();
- }
- else {
- proposedText = getRequiredName(parent, elementDecl);
- cursorAdjustment = proposedText.length();
- if (elementDecl instanceof CMElementDeclaration) {
- CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
- StringBuffer sb = new StringBuffer();
- getContentGenerator().generateTag(parent, ed, sb);
- // since it's a name proposal, assume '<' is
- // already there
- // only return the rest of the tag
- proposedText = sb.toString().substring(1);
- cursorAdjustment = getCursorPositionForProposedText(proposedText);
-
- // cursorAdjustment = proposedText.length() +
- // 1;
- // proposedText += "></" +
- // getRequiredName(parent, elementDecl) + ">";
- // //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- if (beginsWith(proposedText, matchString)) {
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- String proposedInfo = getAdditionalInfo(getCMElementDeclaration(parent), elementDecl);
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, elementDecl), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if (contentAssistRequest.getProposals().size() == 0) {
- if (error != null) {
- setErrorMessage(error);
- }
- else if ((contentAssistRequest.getMatchString() != null) && (contentAssistRequest.getMatchString().length() > 0)) {
- setErrorMessage(NLS.bind(XMLUIMessages.No_known_child_tag_names, (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
- //$NON-NLS-1$ = "No known child tag names of <{0}> begin with \"{1}\""
- }
- else {
- setErrorMessage(NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()})));
- }
- }
- }
- else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- List childElements = getAvailableRootChildren((Document) parent, childPosition);
- for (int i = 0; i < childElements.size(); i++) {
- CMNode ed = (CMNode) childElements.get(i);
- if (ed == null) {
- continue;
- }
- String proposedText = null;
- int cursorAdjustment = 0;
- if (ed instanceof CMElementDeclaration) {
- // proposedText = getRequiredName(parent, ed);
- StringBuffer sb = new StringBuffer();
- getContentGenerator().generateTag(parent, (CMElementDeclaration) ed, sb);
- // tag starts w/ '<', but we want to compare to name
- proposedText = sb.toString().substring(1);
-
- if (!beginsWith(proposedText, matchString)) {
- continue;
- }
-
- cursorAdjustment = getCursorPositionForProposedText(proposedText);
-
- String proposedInfo = getAdditionalInfo(null, ed);
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
-
- /**
- * this is the position the cursor should be in after the proposal is
- * applied
- *
- * @param proposedText
- * @return the position the cursor should be in after the proposal is
- * applied
- */
- private int getCursorPositionForProposedText(String proposedText) {
- int cursorAdjustment;
- cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
- // otherwise, after the first tag
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.indexOf('>') + 1;
- }
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.length() + 1;
- }
-
- return cursorAdjustment;
- }
-
- /**
- * @deprecated XML proposal is added via xml declaration template instead
- */
- protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
- String proposedText = "<?xml version=\"1.0\" encoding=\"" + ContentTypeEncodingPreferences.getUserPreferredCharsetName(ContentTypeIdForXML.ContentTypeID_XML) + "\"?>"; //$NON-NLS-2$//$NON-NLS-1$
- ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION), proposedText, null, null, XMLRelevanceConstants.R_XML_DECLARATION);
- // TODO add special XML proposal info
- contentAssistRequest.addProposal(proposal);
- }
-
- /**
- * This method determines if any of the attributes in the proposed XMLNode
- * node, are possible values of attributes from possible Elements at this
- * point in the document according to the Content Model.
- *
- * @param node
- * the element with attributes that you would like to test if
- * are possible for possible Elements at this point
- * @param cmnode
- * possible element at this point in the document (depending on
- * what 'node' is) true if any attributes of 'node' match any
- * possible attributes from 'cmnodes' list.
- */
- protected boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
- if ((node == null) || (parent == null) || (cmnode == null)) {
- return false;
- }
- String elementMatchString = node.getNodeName();
- String cmnodeName = getRequiredName(parent, cmnode);// cmnode.getNodeName();
- if (node instanceof Element) {
- NamedNodeMap map = ((Element) node).getAttributes();
- String attrMatchString = ""; //$NON-NLS-1$
- CMNamedNodeMap cmattrMap = null;
- // iterate attribute possibilities for partially started node
- for (int i = 0; (map != null) && (i < map.getLength()); i++) {
- attrMatchString = map.item(i).getNodeName();
- // filter on whatever user typed for element name already
- if (beginsWith(cmnodeName, elementMatchString)) {
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- cmattrMap = ((CMElementDeclaration) cmnode).getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmattrMap);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, (CMElementDeclaration) cmnode, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode adnode = (CMNode) nodes.get(k);
- if (adnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(adnode);
- }
- }
- cmattrMap = allAttributes;
-
- // iterate possible attributes from a cmnode in
- // proposal list
- for (int k = 0; (cmattrMap != null) && (k < cmattrMap.getLength()); k++) {
- // check if name matches
- if (cmattrMap.item(k).getNodeName().equals(attrMatchString)) {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- protected boolean beginsWith(String aString, String prefix) {
- if ((aString == null) || (prefix == null)) {
- return true;
- }
- // (pa) matching independent of case to be consistant with Java
- // editor CA
- return aString.toLowerCase().startsWith(prefix.toLowerCase());
- }
-
- protected ContentAssistRequest computeAttributeProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if (documentPosition < sdRegion.getStartOffset(completionRegion)) {
- // setup to insert new attributes
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // Setup to replace an existing attribute name
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- }
- addAttributeNameProposals(contentAssistRequest);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- if ((node.getFirstStructuredDocumentRegion() != null) && (!node.getFirstStructuredDocumentRegion().isEnded())) {
- addTagCloseProposals(contentAssistRequest);
- }
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeAttributeValueProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if ((documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) && (sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() != sdRegion.getStartOffset(completionRegion) + completionRegion.getLength())) {
- // setup to add a new attribute at the documentPosition
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest);
- if ((actualNode.getFirstStructuredDocumentRegion() != null) && !actualNode.getFirstStructuredDocumentRegion().isEnded()) {
- addTagCloseProposals(contentAssistRequest);
- }
- }
- else {
- // setup to replace the existing value
- if (!nodeAtOffset.getFirstStructuredDocumentRegion().isEnded() && (documentPosition < sdRegion.getStartOffset(completionRegion))) {
- // if the IStructuredDocumentRegion isn't closed and the
- // cursor is in front of the value, add
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest);
- }
- else {
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- addAttributeValueProposals(contentAssistRequest);
- }
- }
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- ContentAssistRequest contentAssistRequest = null;
- String regionType = completionRegion.getType();
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- // Handle the most common and best supported cases
- if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() == Node.DOCUMENT_NODE)) {
- if (regionType == DOMRegionContext.XML_TAG_OPEN) {
- contentAssistRequest = computeTagOpenProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME) {
- contentAssistRequest = computeTagNameProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- contentAssistRequest = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- contentAssistRequest = computeEqualsProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (documentPosition == sdRegion.getTextEndOffset()) && (sdRegion.getText(completionRegion).endsWith("\"") || sdRegion.getText(completionRegion).endsWith("\'"))) //$NON-NLS-1$ //$NON-NLS-2$
- {
- // this is for when the cursor is at the end of the closing
- // quote for an attribute..
- IDOMNode actualNode = (IDOMNode) xmlnode.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagCloseProposals(contentAssistRequest);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- contentAssistRequest = computeAttributeValueProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_CLOSE) || (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE))) {
- contentAssistRequest = computeTagCloseProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = computeEndTagOpenProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
- else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType == DOMRegionContext.XML_CHAR_REFERENCE) || (regionType == DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType == DOMRegionContext.XML_PE_REFERENCE)) {
- contentAssistRequest = computeContentProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
-
- // These ITextRegion types begin DOM Elements as well and although
- // internally harder to assist,
- // text insertions directly before them can be made
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) && (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || (regionType == DOMRegionContext.XML_DECLARATION_OPEN) || (regionType == DOMRegionContext.XML_PI_OPEN) || (regionType == DOMRegionContext.XML_COMMENT_OPEN) || (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
- contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode));
- addStartDocumentProposals(contentAssistRequest);
- }
- }
- // Not a Document or Element? (odd cases go here for now)
- else if (isCloseRegion(completionRegion)) {
- contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion) + completionRegion.getLength(), 0, matchString);
- addStartDocumentProposals(contentAssistRequest);
- if (documentPosition >= sdRegion.getTextEndOffset(completionRegion)) {
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode) + 1);
- }
- }
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) && (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || (regionType == DOMRegionContext.XML_DECLARATION_OPEN) || (regionType == DOMRegionContext.XML_PI_OPEN) || (regionType == DOMRegionContext.XML_COMMENT_OPEN) || (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
- contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode));
- addStartDocumentProposals(contentAssistRequest);
- }
- return contentAssistRequest;
- }
-
- /**
- * CONTENT ASSIST STARTS HERE
- *
- * 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 textViewer
- * @param documentPosition -
- * the cursor location within the document
- *
- * an array of ICompletionProposals
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
-
- setErrorMessage(null);
-
- fTextViewer = textViewer;
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
-
- Node node = (Node) treeNode;
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- IDOMNode xmlnode = (IDOMNode) node;
-
- ContentAssistRequest contentAssistRequest = null;
-
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
-
- String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
-
- // Handle empty Documents
- if (completionRegion == null) {
- if (((treeNode == null) || (((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE)) && (completionRegion == null) && ((xmlnode == null) || (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
- try {
- if (sModel != null) {
- IDOMDocument docNode = ((IDOMModel) sModel).getDocument();
- contentAssistRequest = newContentAssistRequest(docNode, docNode, sdRegion, completionRegion, documentPosition, 0, null);
- addEmptyDocumentProposals(contentAssistRequest);
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- if (contentAssistRequest == null) {
- Logger.logException(new IllegalStateException("problem getting model")); //$NON-NLS-1$
- return new ICompletionProposal[0];
- }
- return contentAssistRequest.getCompletionProposals();
- }
- // MASSIVE ERROR CONDITION
- Logger.logException(new IllegalStateException("completion region was null")); //$NON-NLS-1$
- setErrorMessage(INTERNALERROR);
- contentAssistRequest = newContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- return contentAssistRequest.getCompletionProposals();
- }
-
-
- // catch documents where no region can be determined
- if ((xmlnode.getNodeType() == Node.DOCUMENT_NODE) && ((completionRegion == null) || (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
- contentAssistRequest = computeStartDocumentProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
- return contentAssistRequest.getCompletionProposals();
- }
-
- // compute normal proposals
- contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
- if (contentAssistRequest == null) {
- contentAssistRequest = newContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- if (Debug.displayWarnings) {
- System.out.println(UNKNOWN_CONTEXT + " " + completionRegion.getType() + "@" + documentPosition); //$NON-NLS-2$//$NON-NLS-1$
- }
- setErrorMessage(UNKNOWN_CONTEXT);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=123892
- * Only set this error message if nothing else was already set
- **/
- if (contentAssistRequest.getProposals().size() == 0 && getErrorMessage() == null) {
- setErrorMessage(UNKNOWN_CONTEXT);
- }
-
- return contentAssistRequest.getCompletionProposals();
- }
-
- protected ContentAssistRequest computeContentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
-
- // setup to add children at the content node's position
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
- if ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE) && (((Document) node).getDoctype() == null)) {
- addStartDocumentProposals(contentAssistRequest);
- }
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- addEndTagProposals(contentAssistRequest);
- }
- // entities?
- addEntityProposals(contentAssistRequest, documentPosition, completionRegion, node);
- // addEntityProposals(contentAssistRequest);
- return contentAssistRequest;
- }
-
- /**
- * 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 an array of context information objects or
- * <code>null</code> if no context could be found
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- return new IContextInformation[0];
- }
-
- protected ContentAssistRequest computeEndTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- int completionRegionStart = sdRegion.getStartOffset(completionRegion);
- int completionRegionLength = completionRegion.getLength();
- IStructuredDocumentRegion sdRegionAtCompletionOffset = node.getStructuredDocument().getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
- ITextRegion regionAtEndOfCompletion = sdRegionAtCompletionOffset.getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
-
- if ((documentPosition != completionRegionStart) && (regionAtEndOfCompletion != null) && (regionAtEndOfCompletion.getType() == DOMRegionContext.XML_TAG_NAME)) {
- ITextRegion nameRegion = regionAtEndOfCompletion;
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(nameRegion), nameRegion.getTextLength(), matchString);
- }
- else {
- if (nodeAtOffset.getFirstStructuredDocumentRegion() == sdRegion) {
- // abnormal case, this unmatched end tag will be a sibling
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // normal case, this end tag is the parent
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- }
- // if (documentPosition >= sdRegion.getStartOffset(completionRegion) +
- // completionRegion.getTextLength())
- addEndTagProposals(contentAssistRequest);
- // else
- if (completionRegionStart == documentPosition) {
- // positioned at start of end tag
- addTagInsertionProposals(contentAssistRequest, node.getChildNodes().getLength());
- }
- return contentAssistRequest;
- }
-
- /**
- * return all possible EntityReferenceProposals (according to current
- * position in doc)
- */
- protected ICompletionProposal[] computeEntityReferenceProposals(int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
- // only handle XML content for now
- Vector proposals = new Vector(); // ICompletionProposals
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if ((completionRegion != null) && (completionRegion.getType() == DOMRegionContext.XML_CONTENT)) {
- int nodeOffset = documentPosition - sdRegion.getStartOffset(completionRegion);
- String regionText = sdRegion.getFullText(completionRegion);
-
- // if directly to the right of a &, region will be null, need to
- // move to
- // the previous region...there might be a better way to do this
- if ((regionText != null) && regionText.trim().equals("") && (documentPosition > 0)) { //$NON-NLS-1$
- IStructuredDocumentRegion prev = treeNode.getStructuredDocument().getRegionAtCharacterOffset(documentPosition - 1);
- if ((prev != null) && prev.getText().equals("&")) { //$NON-NLS-1$
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=206680
- // examine previous region
- sdRegion = prev;
- completionRegion = prev.getLastRegion();
- regionText = prev.getFullText();
- nodeOffset = 1;
- }
- }
-
- // string must start w/ &
- if ((regionText != null) && regionText.startsWith("&")) { //$NON-NLS-1$
- String key = (nodeOffset > 0) ? regionText.substring(1, nodeOffset) : ""; //$NON-NLS-1$
-
- // get entity proposals, passing in the appropriate start
- // string
- ModelQuery mq = ModelQueryUtil.getModelQuery(((Node) treeNode).getOwnerDocument());
- if (mq != null) {
- CMDocument xmlDoc = mq.getCorrespondingCMDocument(treeNode);
- CMNamedNodeMap cmmap = null;
- Properties entities = null;
- if (xmlDoc != null) {
- cmmap = xmlDoc.getEntities();
- }
- if (cmmap != null) {
- entities = mapToProperties(cmmap);
- }
- else // 224787 in absence of content model, just use
- // minimal 5 entities
- {
- entities = new Properties();
- entities.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("apos", "'"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- addEntityProposals(proposals, entities, key, nodeOffset, sdRegion, completionRegion);
- }
- }
- }
- return (ICompletionProposal[]) ((proposals.size() > 0) ? proposals.toArray(new ICompletionProposal[proposals.size()]) : null);
- }
-
- protected ContentAssistRequest computeEqualsProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion valueRegion = node.getStartStructuredDocumentRegion().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) + completionRegion.getLength());
- if ((valueRegion != null) && (valueRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (sdRegion.getStartOffset(valueRegion) <= documentPosition)) {
- // replace the adjacent attribute value
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, valueRegion, sdRegion.getStartOffset(valueRegion), valueRegion.getTextLength(), matchString);
- }
- else {
- // append an attribute value after the '='
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- addAttributeValueProposals(contentAssistRequest);
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeStartDocumentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- // setup for a non-empty document, but one that hasn't been formally
- // started
- ContentAssistRequest contentAssistRequest = null;
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
- addStartDocumentProposals(contentAssistRequest);
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeTagCloseProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if ((node.getNodeType() == Node.DOCUMENT_NODE) || (documentPosition >= sdRegion.getEndOffset())) {
- // this is a content request as the documentPosition is AFTER the
- // end of the closing region
- if ((node == nodeAtOffset) && (node.getParentNode() != null)) {
- node = (IDOMNode) node.getParentNode();
- }
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() == null)) {
- addEndTagProposals(contentAssistRequest);
- }
- }
- else {
- // at the start of the tag's close or within it
- ITextRegion closeRegion = sdRegion.getLastRegion();
- boolean insideTag = !sdRegion.isEnded() || (documentPosition <= sdRegion.getStartOffset(closeRegion));
- if (insideTag) {
- // this is a request for completions within a tag
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() != null)) {
- addTagCloseProposals(contentAssistRequest);
- }
- if (sdRegion == nodeAtOffset.getFirstStructuredDocumentRegion()) {
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- addAttributeNameProposals(contentAssistRequest);
- }
- }
- }
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeTagNameProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
- // completing the *first* tag in "<tagname1 |<tagname2"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if (actualNode.getFirstStructuredDocumentRegion() == sdRegion) {
- // start tag
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // it's attributes
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
- if (node.getStructuredDocument().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getType() == DOMRegionContext.XML_TAG_OPEN) {
- addAttributeNameProposals(contentAssistRequest);
- }
- addTagCloseProposals(contentAssistRequest);
- }
- else {
- // it's name
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
- addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
- }
- }
- else {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // insert name
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // replace name
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest);
- }
- }
- }
- else {
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- // unclosed tag with only a name; should prompt for attributes
- // and a close instead
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
- addAttributeNameProposals(contentAssistRequest);
- addTagCloseProposals(contentAssistRequest);
- }
- else {
- if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
- int replaceLength = documentPosition - sdRegion.getStartOffset(completionRegion);
- contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), replaceLength, matchString);
- addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
- }
- else {
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(documentPosition);
- if (actualNode != null) {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest);
- }
- }
- }
- }
- return contentAssistRequest;
- }
-
- protected ContentAssistRequest computeTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion() || sdRegion.getPrevious() != null && sdRegion.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
- // completing the *first* XML_TAG_OPEN in "<<tagname"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if(sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- if(actualNode.hasChildNodes())
- addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode.getLastChild()));
- else
- addTagNameProposals(contentAssistRequest, 0);
- }
- else {
- contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
- }
- addEndTagProposals(contentAssistRequest); // (pa) 220850
- }
- }
- else {
- if (documentPosition == sdRegion.getStartOffset(completionRegion)) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // at the start of an existing tag, right before the '<'
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
- addEndTagProposals(contentAssistRequest);
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- // at the opening of the VERY first tag with a '<'
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- addStartDocumentProposals(contentAssistRequest);
- }
- }
- else {
- // within the white space
- ITextRegion name = getNameRegion(node.getStartStructuredDocumentRegion());
- // (pa) ITextRegion refactor
- // if (name != null && name.containsOffset(documentPosition))
- // {
- if ((name != null) && ((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition)) && (sdRegion.getLastRegion().getType() == DOMRegionContext.XML_TAG_CLOSE || sdRegion.getLastRegion().getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)){
- // replace the existing name
- contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
- }
- else {
- // insert a valid new name, or possibly an end tag
- contentAssistRequest = newContentAssistRequest(nodeAtOffset, ((Node) nodeAtOffset).getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addEndTagProposals(contentAssistRequest);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- }
- addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
- }
- }
- return contentAssistRequest;
- }
-
- /**
- * Retreives cmnode's documentation to display in the completion
- * proposal's additional info. If no documentation exists for cmnode, try
- * displaying parentOrOwner's documentation
- *
- * String any documentation information to display for cmnode.
- * <code>null</code> if there is nothing to display.
- */
- protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
- String addlInfo = null;
-
- if (cmnode == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return null;
- }
-
- addlInfo = getInfoProvider().getInfo(cmnode);
- if ((addlInfo == null) && (parentOrOwner != null)) {
- addlInfo = getInfoProvider().getInfo(parentOrOwner);
- }
- return addlInfo;
- }
-
- // returns a list of ModelQueryActions
- protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
- List list = new ArrayList();
- CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
- if (parentDecl != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- // taken from ActionManagers
- // int editMode = modelQuery.getEditMode();
- int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
- int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES | ModelQuery.INCLUDE_SEQUENCE_GROUPS : ModelQuery.INCLUDE_CHILD_NODES;
- modelQuery.getInsertActions(parent, parentDecl, index, ic, validityChecking, list);
- }
- return list;
- }
-
- // returns a list of CMElementDeclarations
- protected List getAvailableRootChildren(Document document, int childIndex) {
- List list = null;
-
- // extract the valid 'root' node name from the DocumentType Node
- DocumentType docType = document.getDoctype();
- String rootName = null;
- if (docType != null) {
- rootName = docType.getNodeName();
- }
- if (rootName == null) {
- return new ArrayList(0);
- }
-
- for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
- // make sure the "root" Element isn't already present
- // is it required to be an Element?
- if ((child.getNodeType() == Node.ELEMENT_NODE) && stringsEqual(child.getNodeName(), rootName)) {
- // if the node is missing either the start or end tag, don't
- // count it as present
- if ((child instanceof IDOMNode) && ((((IDOMNode) child).getStartStructuredDocumentRegion() == null) || (((IDOMNode) child).getEndStructuredDocumentRegion() == null))) {
- continue;
- }
- if (Debug.displayInfo) {
- System.out.println(rootName + " already present!"); //$NON-NLS-1$
- }
- setErrorMessage(NLS.bind(XMLUIMessages.The_document_element__, (new Object[]{rootName})));
- return new ArrayList(0);
- }
- }
-
- list = new ArrayList(1);
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
- if (cmdoc != null) {
- if (rootName != null) {
- CMElementDeclaration rootDecl = (CMElementDeclaration) cmdoc.getElements().getNamedItem(rootName);
- if (rootDecl != null) {
- list.add(rootDecl);
- }
- else {
- // supply the given document name anyway, even if it
- // is an error
- list.add(new SimpleCMElementDeclaration(rootName));
- if (Debug.displayInfo || Debug.displayWarnings) {
- System.out.println("No definition found for " + rootName + " in " + docType.getPublicId() + "/" + docType.getSystemId()); //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
- String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- if (location.length() > 0) {
- setErrorMessage(NLS.bind(XMLUIMessages.No_definition_for_in, (new Object[]{rootName, location})));
- }
- else {
- setErrorMessage(NLS.bind(XMLUIMessages.No_definition_for, (new Object[]{rootName})));
- }
- }
- }
- }
- else {
- if (Debug.displayInfo || Debug.displayWarnings) {
- System.out.println("No content model found."); //$NON-NLS-1$
- }
- //$NON-NLS-1$
- //$NON-NLS-1$
- String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- if (location.length() > 0) {
- setErrorMessage(NLS.bind(XMLUIMessages.No_content_model_for, (new Object[]{location})));
- }
- else {
- setErrorMessage(XMLUIMessages.No_content_model_found_UI_);
- }
- }
- }
-
- return list;
- }
-
- protected CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (modelQuery != null) {
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- }
- return result;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of possible completions.
- *
- * the auto activation characters for completion proposal or
- * <code>null</code> if no auto activation is desired
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return completionProposalAutoActivationCharacters;
- }
-
- protected ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion sdRegion) {
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
- if (region == null) {
- return null;
- }
-
- if (sdRegion.getStartOffset(region) == offset) {
- // The offset is at the beginning of the region
- if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset()) && (sdRegion.getPrevious() != null) && (!sdRegion.getPrevious().isEnded())) {
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = sdRegion.getPrevious().getRegionAtCharacterOffset(offset - 1);
- }
- else {
- // Is there no separating whitespace from the previous region?
- // If not,
- // then that region is the important one
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(offset - 1);
- if ((previousRegion != null) && (previousRegion != region) && (previousRegion.getTextLength() == previousRegion.getLength())) {
- region = previousRegion;
- }
- }
- }
- else {
- // The offset is NOT at the beginning of the region
- if (offset > sdRegion.getStartOffset(region) + region.getTextLength()) {
- // Is the offset within the whitespace after the text in this
- // region?
- // If so, use the next region
- ITextRegion nextRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) + region.getLength());
- if (nextRegion != null) {
- region = nextRegion;
- }
- }
- else {
- // Is the offset within the important text for this region?
- // If so, then we've already got the right one.
- }
- }
-
- // valid WHITE_SPACE region handler (#179924)
- if ((region != null) && (region.getType() == DOMRegionContext.WHITE_SPACE)) {
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
- if (previousRegion != null) {
- region = previousRegion;
- }
- }
-
- return region;
- }
-
- /**
- * Return the region whose content's require completion. This is something
- * of a misnomer as sometimes the user wants to be prompted for contents
- * of a non-existant ITextRegion, such as for enumerated attribute values
- * following an '=' sign.
- */
- protected ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
- if (domnode == null) {
- return null;
- }
-
- ITextRegion region = null;
- int offset = documentPosition;
- IStructuredDocumentRegion flatNode = null;
- IDOMNode node = (IDOMNode) domnode;
-
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getStructuredDocument().getLength() == 0) {
- return null;
- }
- ITextRegion result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- while (result == null) {
- offset--;
- result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- }
- return result;
- }
-
- IStructuredDocumentRegion startTag = node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endTag = node.getEndStructuredDocumentRegion();
-
- // Determine if the offset is within the start
- // IStructuredDocumentRegion, end IStructuredDocumentRegion, or
- // somewhere within the Node's XML content.
- if ((startTag != null) && (startTag.getStartOffset() <= offset) && (offset < startTag.getStartOffset() + startTag.getLength())) {
- flatNode = startTag;
- }
- else if ((endTag != null) && (endTag.getStartOffset() <= offset) && (offset < endTag.getStartOffset() + endTag.getLength())) {
- flatNode = endTag;
- }
-
- if (flatNode != null) {
- // the offset is definitely within the start or end tag, continue
- // on and find the region
- region = getCompletionRegion(offset, flatNode);
- }
- else {
- // the docPosition is neither within the start nor the end, so it
- // must be content
- flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(offset);
- // (pa) ITextRegion refactor
- // if (flatNode.contains(documentPosition)) {
- if ((flatNode.getStartOffset() <= documentPosition) && (flatNode.getEndOffset() >= documentPosition)) {
- // we're interesting in completing/extending the previous
- // IStructuredDocumentRegion if the current
- // IStructuredDocumentRegion isn't plain content or if it's
- // preceded by an orphan '<'
- if ((offset == flatNode.getStartOffset()) && (flatNode.getPrevious() != null) && (((flatNode.getRegionAtCharacterOffset(documentPosition) != null) && (flatNode.getRegionAtCharacterOffset(documentPosition).getType() != DOMRegionContext.XML_CONTENT)) || (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) || (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN))) {
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = flatNode.getPrevious().getLastRegion();
- }
- else if (flatNode.getEndOffset() == documentPosition) {
- region = flatNode.getLastRegion();
- }
- else {
- region = flatNode.getFirstRegion();
- }
- }
- else {
- // catch end of document positions where the docPosition isn't
- // in a IStructuredDocumentRegion
- region = flatNode.getLastRegion();
- }
- }
-
- return region;
- }
-
- /**
- * Provided by default. Subclasses may override with their own
- * implementations.
- *
- * @see AbstractContentAssistProcessor#getContentGenerator()
- */
- public XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- fGenerator = new XMLContentModelGenerator();
- }
- return fGenerator;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of context information.
- *
- * the auto activation characters for presenting context information or
- * <code>null</code> if no auto activation is desired
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return contextInformationAutoActivationCharacters;
- }
-
- /**
- * 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.
- *
- * a context information validator, or <code>null</code> if the
- * processor is incapable of computing context information
- */
- public IContextInformationValidator getContextInformationValidator() {
- if (fContextInformationPresenter == null) {
- fContextInformationPresenter = new AttributeContextInformationPresenter();
- }
- return fContextInformationPresenter;
- }
-
- protected int getElementPosition(Node child) {
- Node parent = child.getParentNode();
- if (parent == null) {
- return 0;
- }
-
- NodeList children = parent.getChildNodes();
- if (children == null) {
- return 0;
- }
- int count = 0;
-
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i) == child) {
- return count;
- }
- else {
- // if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
- count++;
- }
- }
- return 0;
- }
-
- private int getElementPositionForModelQuery(Node child) {
- return getElementPosition(child);
- // return -1;
- }
-
- /**
- * Return the reason why computeProposals was not able to find any
- * completions.
- *
- * an error message or null if no error occurred
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * @param iResource
- */
- // public void initialize(IResource iResource) {
- // this.resource = iResource;
- // }
- /**
- * Gets the infoProvider.
- *
- * fInfoProvider and if fInfoProvider was <code>null</code> create a new
- * instance
- */
- public MarkupTagInfoProvider getInfoProvider() {
- if (fInfoProvider == null) {
- fInfoProvider = new MarkupTagInfoProvider();
- }
- return fInfoProvider;
- }
-
- protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
- if ((aRegion == null) || isCloseRegion(aRegion)) {
- return ""; //$NON-NLS-1$
- }
- String matchString = null;
- String regionType = aRegion.getType();
- if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
- matchString = ""; //$NON-NLS-1$
- }
- else if (regionType == DOMRegionContext.XML_CONTENT) {
- matchString = ""; //$NON-NLS-1$
- }
- else {
- if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
- matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
- }
- else {
- matchString = ""; //$NON-NLS-1$
- }
- }
- return matchString;
- }
-
- protected ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- Iterator regionList = flatNode.getRegions().iterator();
- while (regionList.hasNext()) {
- ITextRegion region = (ITextRegion) regionList.next();
- if (isNameRegion(region)) {
- return region;
- }
- }
- return null;
- }
-
- /**
- * Retrieves all of the possible valid values for this attribute
- * declaration
- */
- protected List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
- List list = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- String[] dataTypeValues = null;
- // The ModelQuery may not be available if the corresponding
- // adapter
- // is absent
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null) {
- dataTypeValues = modelQuery.getPossibleDataTypeValues(element, ad);
- }
- else {
- if (ad.getAttrType() != null) {
- dataTypeValues = ad.getAttrType().getEnumeratedValues();
- }
- }
- if (dataTypeValues != null) {
- list = new ArrayList(dataTypeValues.length);
- for (int i = 0; i < dataTypeValues.length; i++) {
- list.add(dataTypeValues[i]);
- }
- }
- }
- if (list == null) {
- list = new ArrayList(0);
- }
- return list;
- }
-
- protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
- if ((cmnode == null) || (parentOrOwner == null)) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- return getContentGenerator().getRequiredName(parentOrOwner, cmnode);
- }
-
- protected String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
- if (attrDecl == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- StringBuffer buff = new StringBuffer();
- getContentGenerator().generateRequiredAttribute(parentOrOwner, attrDecl, buff);
- return buff.toString();
- }
-
- protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
- if (elementDecl == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- StringBuffer buff = new StringBuffer();
- getContentGenerator().generateTag(parentOrOwner, elementDecl, buff);
- return buff.toString();
- }
-
- /**
- * StructuredTextViewer must be set before using this.
- */
- public IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
- // (pa) ITextRegion refactor defect 245190
- // return
- // (IStructuredDocumentRegion)ContentAssistUtils.getNodeAt((StructuredTextViewer)fTextViewer,
- // pos);
- return ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
- }
-
- private String getTagName(IStructuredDocumentRegion sdRegion) {
- ITextRegionList regions = sdRegion.getRegions();
- ITextRegion region = null;
- String name = ""; //$NON-NLS-1$
- for (int i = 0; i < regions.size(); i++) {
- region = regions.get(i);
- if (region.getType() == DOMRegionContext.XML_TAG_NAME) {
- name = sdRegion.getText(region);
- break;
- }
- }
- return name;
- }
-
- // returns a list of CMNodes that are available within this parent context
- // Given the grammar shown below and a snippet of XML code (where the '|'
- // indicated the cursor position)
- // the list would return all of the element declarations that are
- // potential child elements of Foo.
- //
- // grammar : Foo -> (A, B, C)
- // snippet : <Foo><A>|
- // result : {A, B, C}
- //
- // TODO cs... do we need to pass in the 'kindOfAction'? Seems to me we
- // could assume it's always an insert.
- protected List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
- List modelQueryActions = getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE);
- Iterator iterator = modelQueryActions.iterator();
- List cmnodes = new Vector();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
- CMNode actionCMNode = action.getCMNode();
- if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
- cmnodes.add(actionCMNode);
- }
- }
- }
- return cmnodes;
- }
-
- // returns a list of CMNodes that can be validly inserted at this
- // childPosition
- // Given the grammar shown below and a snippet of XML code (where the '|'
- // indicated the cursor position)
- // the list would return only the element declarations can be inserted
- // while maintaing validity of the content.
- //
- // grammar : Foo -> (A, B, C)
- // snippet : <Foo><A>|
- // result : {B}
- //
- protected List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
- List modelQueryActions = getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT);
- Iterator iterator = modelQueryActions.iterator();
- List cmnodes = new Vector();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
- CMNode actionCMNode = action.getCMNode();
- if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
- cmnodes.add(actionCMNode);
- }
- }
- }
- return cmnodes;
- }
-
- /**
- * Similar to the call in HTMLContentAssistProcessor. Pass in a node, it
- * tells you if the document is XML type.
- *
- * @param node
- *
- */
- protected boolean getXML(Node node) {
- if (node == null) {
- return false;
- }
-
- Document doc = null;
- doc = (node.getNodeType() != Node.DOCUMENT_NODE) ? node.getOwnerDocument() : ((Document) node);
-
- return (doc instanceof IDOMDocument) && ((IDOMDocument) doc).isXMLType();
- }
-
- // Initialize local settings
- protected void init() {
- // implement in subclasses
- }
-
- protected boolean isCloseRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_PI_CLOSE) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (type == DOMRegionContext.XML_CDATA_CLOSE) || (type == DOMRegionContext.XML_COMMENT_CLOSE) || (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) || (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) || (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) || (type == DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) || (type == DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_CLOSE) || (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE)) || (type == DOMRegionContext.XML_DECLARATION_CLOSE));
- }
-
- /*
- * This is to determine if a tag is a special meta-info comment tag that
- * shows up as an ELEMENT
- */
- private boolean isCommentNode(IDOMNode node) {
- return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
- }
-
- /**
- * Checks if cursor position is after doctype tag...
- *
- * @param car
- *
- */
- protected boolean isCursorAfterDoctype(ContentAssistRequest car) {
- Node aNode = car.getNode();
- Document parent = aNode.getOwnerDocument();
- int xmldoctypeNodePosition = -1;
- boolean isAfterDoctype = true;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof IDOMNode) {
- if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- xmldoctypeNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterDoctype = (car.getReplacementBeginPosition() >= xmldoctypeNodePosition);
- break;
- }
- }
- }
- return isAfterDoctype;
- }
-
- /**
- * This method can check if the cursor is after the XMLPI
- *
- * @param car
- *
- */
- protected boolean isCursorAfterXMLPI(ContentAssistRequest car) {
- Node aNode = car.getNode();
- boolean xmlpiFound = false;
- Document parent = aNode.getOwnerDocument();
- int xmlpiNodePosition = -1;
- boolean isAfterXMLPI = false;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- xmlpiFound = xmlpiFound || xmlpi;
- if (xmlpiFound) {
- if (child instanceof IDOMNode) {
- xmlpiNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterXMLPI = (car.getReplacementBeginPosition() >= xmlpiNodePosition);
- }
- break;
- }
- }
- return isAfterXMLPI;
- }
-
- protected boolean isNameRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_TAG_NAME) || (type == DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME) || (type == DOMRegionContext.XML_ELEMENT_DECL_NAME) || (type == DOMRegionContext.XML_DOCTYPE_NAME) || (type == DOMRegionContext.XML_ATTLIST_DECL_NAME) || (type == DOMJSPRegionContextsPrivateCopy.JSP_ROOT_TAG_NAME) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME));
- }
-
- protected boolean isQuote(String string) {
- String trimmed = string.trim();
- if (trimmed.length() > 0) {
- return (trimmed.charAt(0) == '\'') || (trimmed.charAt(0) == '"');
- }
- return false;
- }
-
- private boolean isSelfClosed(IStructuredDocumentRegion startTag) {
- ITextRegionList regions = startTag.getRegions();
- return regions.get(regions.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
- }
-
- private boolean isStartTag(IStructuredDocumentRegion sdRegion) {
- boolean result = false;
- if (sdRegion.getRegions().size() > 0) {
- ITextRegion r = sdRegion.getRegions().get(0);
- result = (r.getType() == DOMRegionContext.XML_TAG_OPEN) && sdRegion.isEnded();
- }
- return result;
- }
-
- protected Properties mapToProperties(CMNamedNodeMap map) {
- Properties p = new Properties();
- for (int i = 0; i < map.getLength(); i++) {
- CMEntityDeclaration decl = (CMEntityDeclaration) map.item(i);
- p.put(decl.getName(), decl.getValue());
- }
- return p;
- }
-
- /**
- * Gets the corresponding XMLNode, and checks if it's closed.
- *
- * @param startTag
- *
- */
- private boolean needsEndTag(IStructuredDocumentRegion startTag) {
- boolean result = false;
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fTextViewer.getDocument());
- try {
- if (sModel != null) {
- IDOMNode xmlNode = (IDOMNode) sModel.getIndexedRegion(startTag.getStart());
- if (!isStartTag(startTag)) {
- result = false;
- }
- else if (isSelfClosed(startTag)) {
- result = false;
- }
- else if (!xmlNode.isContainer()) {
- result = false;
- }
- else {
- result = xmlNode.getEndStructuredDocumentRegion() == null;
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return result;
- }
-
- protected ContentAssistRequest newContentAssistRequest(Node node, Node possibleParent, IStructuredDocumentRegion documentRegion, ITextRegion completionRegion, int begin, int length, String filter) {
- return new ContentAssistRequest(node, possibleParent, documentRegion, completionRegion, begin, length, filter);
- }
-
- public void release() {
- fGenerator = null;
- }
-
- /**
- * Set the reason why computeProposals was not able to find any
- * completions.
- */
- public void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- }
-
- /**
- * Set the reason why computeProposals was not able to find any
- * completions.
- */
- protected void setErrorMessage(String errorMessage, String append) {
- setErrorMessage(errorMessage + append);
- }
-
- /**
- * Set the reason why computeProposals was not able to find any
- * completions.
- */
- protected void setErrorMessage(String errorMessage, String prepend, String append) {
- setErrorMessage(prepend + errorMessage + append);
- }
-
- protected boolean stringsEqual(String a, String b) {
- // (pa) 221190 matching independent of case to be consistant with Java
- // editor CA
- return a.equalsIgnoreCase(b);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java
deleted file mode 100644
index 7884482852..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java
+++ /dev/null
@@ -1,90 +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.xml.ui.internal.contentassist;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractContentModelGenerator {
-
- public static boolean generateChildren = false;
-
- public AbstractContentModelGenerator() {
- super();
- }
-
- public abstract void generateAttribute(CMAttributeDeclaration attrDecl, StringBuffer buffer);
-
- protected void generateAttributes(CMElementDeclaration elementDecl, StringBuffer buffer) {
- CMNamedNodeMap attributes = elementDecl.getAttributes();
- if (attributes == null) {
- return;
- }
- for (int i = 0; i < attributes.getLength(); i++) {
- generateAttribute((CMAttributeDeclaration) attributes.item(i), buffer);
- }
- return;
- }
-
- protected abstract void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer);
-
- public void generateRequiredChildren(Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (generateChildren) {
- }
- return;
- }
-
- protected abstract void generateStartTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer);
-
- public void generateTag(Node parent, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if ((elementDecl == null) || (buffer == null)) {
- return;
- }
-
- String tagName = getRequiredName(parent, elementDecl);
-
- generateStartTag(tagName, parent, elementDecl, buffer);
- generateRequiredChildren(parent, elementDecl, buffer);
- generateEndTag(tagName, parent, elementDecl, buffer);
- return;
- }
-
- public abstract int getMinimalStartTagLength(Node node, CMElementDeclaration elementDecl);
-
- public String getRequiredName(Node ownerNode, CMNode cmnode) {
- if (ownerNode != null) {
- return DOMNamespaceHelper.computeName(cmnode, ownerNode, null);
- }
- return cmnode.getNodeName();
- }
-
- public abstract String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl);
-
- protected boolean requiresAttributes(CMElementDeclaration ed) {
- CMNamedNodeMap attributes = ed.getAttributes();
- if (attributes == null) {
- return false;
- }
- for (int i = 0; i < attributes.getLength(); i++) {
- if (((CMAttributeDeclaration) attributes.item(i)).getUsage() == CMAttributeDeclaration.REQUIRED) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
deleted file mode 100644
index dd21a18a85..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
+++ /dev/null
@@ -1,1112 +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.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-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.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.ITextRegionContainer;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * <p>Implements the framework for making proposals in XML type documents. Deals with
- * all the nastiness needed to figure out where in an XML type document the content
- * assist was invoked and then calls one of many abstract methods depending on the
- * area the content assist was invoked. In this way implementers only have to worry about
- * implementing what to do in each situation while not having to deal with figuring out
- * which situation the content assist was invoked in.</p>
- *
- * @base org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor
- * @see DefaultXMLCompletionProposalComputer
- */
-public abstract class AbstractXMLCompletionProposalComputer implements ICompletionProposalComputer {
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private class DOMJSPRegionContextsPrivateCopy {
- private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
- private static final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
- private static final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
- private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- private static final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
- private static final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
- private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
- private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
- private static final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
- private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
- }
-
- private String fErrorMessage;
- private ITextViewer fTextViewer;
-
- public AbstractXMLCompletionProposalComputer() {
- fErrorMessage = null;
- fTextViewer = null;
- }
-
- /**
- * <p>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.</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- ITextViewer textViewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
-
- setErrorMessage(null);
-
- fTextViewer = textViewer;
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
-
- Node node = (Node) treeNode;
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- IDOMNode xmlnode = (IDOMNode) node;
-
- ContentAssistRequest contentAssistRequest = null;
-
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
-
- String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
-
- // Handle empty Documents
- if (completionRegion == null) {
- if (((treeNode == null) || (((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE)) && (completionRegion == null) &&
- ((xmlnode == null) || (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
-
- IStructuredModel sModel = null;
- try {
- if(textViewer.getDocument() instanceof IStructuredDocument) {
- sModel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)textViewer.getDocument());
- }
- if (sModel != null) {
- IDOMDocument docNode = ((IDOMModel) sModel).getDocument();
- contentAssistRequest = new ContentAssistRequest(docNode, docNode, sdRegion, completionRegion, documentPosition, 0, null);
- addEmptyDocumentProposals(contentAssistRequest, context);
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- if (contentAssistRequest == null) {
- Logger.logException(new IllegalStateException("problem getting model")); //$NON-NLS-1$
- return new ArrayList(0);
- }
-
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList(0);
- }
- // MASSIVE ERROR CONDITION
- Logger.logException(new IllegalStateException("completion region was null")); //$NON-NLS-1$
- setErrorMessage(XMLUIMessages.SEVERE_internal_error_occu_UI_);
- contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList(0);
- }
-
-
- // catch documents where no region can be determined
- if ((xmlnode.getNodeType() == Node.DOCUMENT_NODE) && ((completionRegion == null) ||
- (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
-
- contentAssistRequest = computeStartDocumentProposals(matchString, completionRegion,
- (IDOMNode) treeNode,xmlnode, context);
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList(0);
- }
-
- // compute normal proposals
- contentAssistRequest = computeCompletionProposals(matchString, completionRegion, (IDOMNode) treeNode, xmlnode, context);
- if (contentAssistRequest == null) {
- contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=123892
- * Only set this error message if nothing else was already set
- **/
- if (contentAssistRequest.getProposals().size() == 0 && getErrorMessage() == null) {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
-
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList(0);
- }
-
- /**
- * <p>Returns information about possible contexts based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text viewer.</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- //no default context info
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * Add proposals for attribute names
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addAttributeNameProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add proposals for attribute values
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addAttributeValueProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add comment proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addCommentProposal(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add the proposals for a completely empty document
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add the proposals for the name in an end tag
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEndTagNameProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Prompt for end tags to a non-empty Node that hasn't ended Handles these
- * cases: <br>
- * <tagOpen>| <br>
- * <tagOpen>< |<br>
- * <tagOpen></ |
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEndTagProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add entity proposals
- *
- * @param contentAssistRequest
- * @param completionRegion
- * @param treeNode
- * @param context
- */
- protected abstract void addEntityProposals(ContentAssistRequest contentAssistRequest,
- ITextRegion completionRegion, IDOMNode treeNode, CompletionProposalInvocationContext context);
-
- /**
- * add entity proposals
- *
- * @param proposals
- * @param map
- * @param key
- * @param nodeOffset
- * @param sdRegion
- * @param completionRegion
- * @param context
- */
- protected abstract void addEntityProposals(Vector proposals, Properties map, String key,
- int nodeOffset, IStructuredDocumentRegion sdRegion, ITextRegion completionRegion,
- CompletionProposalInvocationContext context);
-
- /**
- * Add PCData proposals
- *
- * @param nodeName
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add start document proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addStartDocumentProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Close an unclosed start tag
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addTagCloseProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add tag insertion proposals
- *
- * @param contentAssistRequest
- * @param childPosition
- * @param context
- */
- protected abstract void addTagInsertionProposals(ContentAssistRequest contentAssistRequest,
- int childPosition, CompletionProposalInvocationContext context);
-
- /**
- * Add tag name proposals
- *
- * @param contentAssistRequest
- * @param childPosition
- * @param context
- */
- protected abstract void addTagNameProposals(ContentAssistRequest contentAssistRequest,
- int childPosition, CompletionProposalInvocationContext context);
-
- /**
- * @param errorMessage the reason why computeProposals was not able to find any
- * completions.
- */
- protected void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- }
-
- /**
- * <p>This does all the magic of figuring out where in the XML type document
- * the content assist was invoked and then calling the corresponding method
- * to add the correct proposals</p>
- *
- * <p><b>NOTE: </b>if overriding be sure to make super call back to this method otherwise
- * you will loose all of the proposals generated by this method</p>
- *
- * @param matchString
- * @param completionRegion
- * @param treeNode
- * @param xmlnode
- * @param context
- *
- * @return {@link ContentAssistRequest} that now has all the proposals in it
- */
- protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
- IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
-
- ContentAssistRequest contentAssistRequest = null;
- String regionType = completionRegion.getType();
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- // Handle the most common and best supported cases
- if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() == Node.DOCUMENT_NODE)) {
- if (regionType == DOMRegionContext.XML_TAG_OPEN) {
- contentAssistRequest = computeTagOpenProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME) {
- contentAssistRequest = computeTagNameProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- contentAssistRequest = computeAttributeProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- contentAssistRequest = computeEqualsProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (documentPosition == sdRegion.getTextEndOffset()) &&
- (sdRegion.getText(completionRegion).endsWith("\"") || sdRegion.getText(completionRegion).endsWith("\'"))) { //$NON-NLS-1$ //$NON-NLS-2$
- // this is for when the cursor is at the end of the closing
- // quote for an attribute..
- IDOMNode actualNode = (IDOMNode) xmlnode.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagCloseProposals(contentAssistRequest, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- contentAssistRequest = computeAttributeValueProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_CLOSE) || (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
- (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE))) {
-
- contentAssistRequest = computeTagCloseProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = computeEndTagOpenProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType == DOMRegionContext.XML_CHAR_REFERENCE) ||
- (regionType == DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType == DOMRegionContext.XML_PE_REFERENCE)) {
-
- contentAssistRequest = computeContentProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
-
- // These ITextRegion types begin DOM Elements as well and although
- // internally harder to assist,
- // text insertions directly before them can be made
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
- (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) ||
- (regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
- (regionType == DOMRegionContext.XML_PI_OPEN) ||
- (regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
- (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
-
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- }
- // Not a Document or Element? (odd cases go here for now)
- else if (isCloseRegion(completionRegion)) {
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion) + completionRegion.getLength(), 0, matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- if (documentPosition >= sdRegion.getTextEndOffset(completionRegion)) {
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode) + 1, context);
- }
- }
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
- (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) ||
- regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) ||
- (regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
- (regionType == DOMRegionContext.XML_PI_OPEN) ||
- (regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
- (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
-
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- return contentAssistRequest;
- }
-
- /**
- * <p>Similar to {@link #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor)} only specificly for
- * attribute proposals</p>
- *
- * <p>Implementers should not override this method, it is made available to implementers so that if they override
- * {@link #computeCompletionProposals(String, ITextRegion, IDOMNode, IDOMNode, CompletionProposalInvocationContext)}
- * they can call this method if needed</p>
- *
- * @param matchString
- * @param completionRegion
- * @param nodeAtOffset
- * @param node
- * @param context
- * @return
- */
- protected final ContentAssistRequest computeAttributeProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ITextViewer viewer = context.getViewer();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- // if the attribute name is selected, replace it instead of creating a new attribute
- if (documentPosition <= sdRegion.getStartOffset(completionRegion) && (viewer != null && viewer.getSelectedRange().y != (sdRegion.getEndOffset(completionRegion) - sdRegion.getStartOffset(completionRegion)))) {
- // setup to insert new attributes
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // Setup to replace an existing attribute name
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- }
- addAttributeNameProposals(contentAssistRequest, context);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- if ((node.getFirstStructuredDocumentRegion() != null) && (!node.getFirstStructuredDocumentRegion().isEnded())) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- return contentAssistRequest;
- }
-
- /**
- * <p>this is the position the cursor should be in after the proposal is
- * applied</p>
- *
- * @param proposedText
- * @return the position the cursor should be in after the proposal is
- * applied
- */
- protected static int getCursorPositionForProposedText(String proposedText) {
- int cursorAdjustment;
- cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
- // otherwise, after the first tag
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.indexOf('>') + 1;
- }
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.length() + 1;
- }
-
- return cursorAdjustment;
- }
-
- /**
- * <p>helpful utility method for determining if one string starts with another one.
- * This is case insensitive. If either are null then result is <code>true</code></p>
- *
- * @param aString the string to check to see if it starts with the given prefix
- * @param prefix check that the given string starts with this prefix
- *
- * @return <code>true</code> if the given string starts with the given prefix,
- * <code>false</code> otherwise
- */
- protected static boolean beginsWith(String aString, String prefix) {
- if ((aString == null) || (prefix == null)) {
- return true;
- }
- return aString.toLowerCase().startsWith(prefix.toLowerCase());
- }
-
- private ContentAssistRequest computeAttributeValueProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
-
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if ((documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) && (sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() != sdRegion.getStartOffset(completionRegion) + completionRegion.getLength())) {
- // setup to add a new attribute at the documentPosition
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- if ((actualNode.getFirstStructuredDocumentRegion() != null) && !actualNode.getFirstStructuredDocumentRegion().isEnded()) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- }
- else {
- // setup to replace the existing value
- if (!nodeAtOffset.getFirstStructuredDocumentRegion().isEnded() && (documentPosition < sdRegion.getStartOffset(completionRegion))) {
- // if the IStructuredDocumentRegion isn't closed and the
- // cursor is in front of the value, add
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- }
- else {
- int replaceLength = completionRegion.getTextLength();
-
- //if container region, be sure replace length is only the attribute value region not the entire container
- if(completionRegion instanceof ITextRegionContainer){
- ITextRegion openRegion = ((ITextRegionContainer) completionRegion).getFirstRegion();
- ITextRegion closeRegion = ((ITextRegionContainer) completionRegion).getLastRegion();
-
- /*
- * check to see if the container is opened the same way its closed.
- * Such as:
- * <img src=' '
- * But not:
- * <img src='
- *
- * </body>
- * </html>
- * In the latter case we only want to replace the opening text of the container
- * Admittedly crude test, but effective.
- */
- if(openRegion.getType() != closeRegion.getType()) {
- replaceLength = openRegion.getTextLength();
- }
- }
-
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion),
- replaceLength, matchString);
-
- addAttributeValueProposals(contentAssistRequest, context);
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeContentProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
-
- // setup to add children at the content node's position
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
- if ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE) && (((Document) node).getDoctype() == null)) {
- addStartDocumentProposals(contentAssistRequest, context);
- }
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- addEndTagProposals(contentAssistRequest, context);
- }
- // entities?
- addEntityProposals(contentAssistRequest, completionRegion, node, context);
- // addEntityProposals(contentAssistRequest);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeEndTagOpenProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- int completionRegionStart = sdRegion.getStartOffset(completionRegion);
- int completionRegionLength = completionRegion.getLength();
- IStructuredDocumentRegion sdRegionAtCompletionOffset = node.getStructuredDocument().getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
- ITextRegion regionAtEndOfCompletion = sdRegionAtCompletionOffset.getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
-
- if ((documentPosition != completionRegionStart) && (regionAtEndOfCompletion != null) && (regionAtEndOfCompletion.getType() == DOMRegionContext.XML_TAG_NAME)) {
- ITextRegion nameRegion = regionAtEndOfCompletion;
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(nameRegion), nameRegion.getTextLength(), matchString);
- }
- else {
- if (nodeAtOffset.getFirstStructuredDocumentRegion() == sdRegion) {
- // abnormal case, this unmatched end tag will be a sibling
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // normal case, this end tag is the parent
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- }
- // if (documentPosition >= sdRegion.getStartOffset(completionRegion) +
- // completionRegion.getTextLength())
- addEndTagProposals(contentAssistRequest, context);
- // else
- if (completionRegionStart == documentPosition) {
- // positioned at start of end tag
- addTagInsertionProposals(contentAssistRequest, node.getChildNodes().getLength(), context);
- }
- return contentAssistRequest;
- }
-
-
- private ContentAssistRequest computeEqualsProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion valueRegion = node.getStartStructuredDocumentRegion().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) + completionRegion.getLength());
- if ((valueRegion != null) && (valueRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (sdRegion.getStartOffset(valueRegion) <= documentPosition)) {
- // replace the adjacent attribute value
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, valueRegion, sdRegion.getStartOffset(valueRegion), valueRegion.getTextLength(), matchString);
- }
- else {
- // append an attribute value after the '='
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- addAttributeValueProposals(contentAssistRequest, context);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeStartDocumentProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
-
- // setup for a non-empty document, but one that hasn't been formally
- // started
- ContentAssistRequest contentAssistRequest = null;
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node,
- getStructuredDocumentRegion(documentPosition), completionRegion,
- documentPosition, 0, matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagCloseProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if ((node.getNodeType() == Node.DOCUMENT_NODE) || (documentPosition >= sdRegion.getEndOffset())) {
- // this is a content request as the documentPosition is AFTER the
- // end of the closing region
- if ((node == nodeAtOffset) && (node.getParentNode() != null)) {
- node = (IDOMNode) node.getParentNode();
- }
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() == null)) {
- addEndTagProposals(contentAssistRequest, context);
- }
- }
- else {
- // at the start of the tag's close or within it
- ITextRegion closeRegion = sdRegion.getLastRegion();
- boolean insideTag = !sdRegion.isEnded() || (documentPosition <= sdRegion.getStartOffset(closeRegion));
- if (insideTag) {
- // this is a request for completions within a tag
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() != null)) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- if (sdRegion == nodeAtOffset.getFirstStructuredDocumentRegion()) {
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- addAttributeNameProposals(contentAssistRequest, context);
- }
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagNameProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
- // completing the *first* tag in "<tagname1 |<tagname2"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if (actualNode.getFirstStructuredDocumentRegion() == sdRegion) {
- // start tag
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // it's attributes
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
- if (node.getStructuredDocument().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getType() == DOMRegionContext.XML_TAG_OPEN) {
- addAttributeNameProposals(contentAssistRequest, context);
- }
- addTagCloseProposals(contentAssistRequest, context);
- }
- else {
- // it's name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition - matchString.length(),
- matchString.length(), matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(actualNode),
- context);
- }
- }
- else {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // insert name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // replace name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
- completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest, context);
- }
- }
- }
- else {
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- // unclosed tag with only a name; should prompt for attributes
- // and a close instead
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion,
- documentPosition - matchString.length(), matchString.length(), matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- addTagCloseProposals(contentAssistRequest, context);
- }
- else {
- if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
- int replaceLength = documentPosition - sdRegion.getStartOffset(completionRegion);
- contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion), replaceLength, matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- }
- else {
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(documentPosition);
- if (actualNode != null) {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
- completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest, context);
- }
- }
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagOpenProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion() || sdRegion.getPrevious() != null && sdRegion.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
- // completing the *first* XML_TAG_OPEN in "<<tagname"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if(sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- if(actualNode.hasChildNodes())
- addTagNameProposals(contentAssistRequest,
- getElementPosition(actualNode.getLastChild()), context);
- else
- addTagNameProposals(contentAssistRequest, 0, context);
- }
- else {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(actualNode), context);
- }
- addEndTagProposals(contentAssistRequest, context); // (pa) 220850
- }
- }
- else {
- if (documentPosition == sdRegion.getStartOffset(completionRegion)) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // at the start of an existing tag, right before the '<'
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
- completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- addEndTagProposals(contentAssistRequest, context);
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- // at the opening of the VERY first tag with a '<'
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- }
- else {
- // within the white space
- ITextRegion name = getNameRegion(node.getStartStructuredDocumentRegion());
- // (pa) ITextRegion refactor
- // if (name != null && name.containsOffset(documentPosition))
- // {
- if ((name != null) &&
- ((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition)) &&
- (sdRegion.getLastRegion().getType() == DOMRegionContext.XML_TAG_CLOSE || sdRegion.getLastRegion().getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)){
-
- // replace the existing name
- contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
- }
- else {
- // insert a valid new name, or possibly an end tag
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, ((Node) nodeAtOffset).getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addEndTagProposals(contentAssistRequest, context);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- }
- addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- }
- }
- return contentAssistRequest;
- }
-
- private ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion sdRegion) {
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
- if (region == null) {
- return null;
- }
-
- if (sdRegion.getStartOffset(region) == offset) {
- // The offset is at the beginning of the region
- if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset()) && (sdRegion.getPrevious() != null) && (!sdRegion.getPrevious().isEnded())) {
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = sdRegion.getPrevious().getRegionAtCharacterOffset(offset - 1);
- }
- else {
- // Is there no separating whitespace from the previous region?
- // If not,
- // then that region is the important one
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(offset - 1);
- if ((previousRegion != null) && (previousRegion != region) && (previousRegion.getTextLength() == previousRegion.getLength())) {
- region = previousRegion;
- }
- }
- }
- else {
- // The offset is NOT at the beginning of the region
- if (offset > sdRegion.getStartOffset(region) + region.getTextLength()) {
- // Is the offset within the whitespace after the text in this
- // region?
- // If so, use the next region
- ITextRegion nextRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) + region.getLength());
- if (nextRegion != null) {
- region = nextRegion;
- }
- }
- else {
- // Is the offset within the important text for this region?
- // If so, then we've already got the right one.
- }
- }
-
- // valid WHITE_SPACE region handler (#179924)
- if ((region != null) && (region.getType() == DOMRegionContext.WHITE_SPACE)) {
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
- if (previousRegion != null) {
- region = previousRegion;
- }
- }
-
- return region;
- }
-
- /**
- * Return the region whose content's require completion. This is something
- * of a misnomer as sometimes the user wants to be prompted for contents
- * of a non-existant ITextRegion, such as for enumerated attribute values
- * following an '=' sign.
- */
- private ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
- if (domnode == null) {
- return null;
- }
-
- ITextRegion region = null;
- int offset = documentPosition;
- IStructuredDocumentRegion flatNode = null;
- IDOMNode node = (IDOMNode) domnode;
-
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getStructuredDocument().getLength() == 0) {
- return null;
- }
- ITextRegion result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- while (result == null) {
- offset--;
- result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- }
- return result;
- }
-
- IStructuredDocumentRegion startTag = node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endTag = node.getEndStructuredDocumentRegion();
-
- // Determine if the offset is within the start
- // IStructuredDocumentRegion, end IStructuredDocumentRegion, or
- // somewhere within the Node's XML content.
- if ((startTag != null) && (startTag.getStartOffset() <= offset) && (offset < startTag.getStartOffset() + startTag.getLength())) {
- flatNode = startTag;
- }
- else if ((endTag != null) && (endTag.getStartOffset() <= offset) && (offset < endTag.getStartOffset() + endTag.getLength())) {
- flatNode = endTag;
- }
-
- if (flatNode != null) {
- // the offset is definitely within the start or end tag, continue
- // on and find the region
- region = getCompletionRegion(offset, flatNode);
- }
- else {
- // the docPosition is neither within the start nor the end, so it
- // must be content
- flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(offset);
- // (pa) ITextRegion refactor
- // if (flatNode.contains(documentPosition)) {
- if ((flatNode.getStartOffset() <= documentPosition) && (flatNode.getEndOffset() >= documentPosition)) {
- // we're interesting in completing/extending the previous
- // IStructuredDocumentRegion if the current
- // IStructuredDocumentRegion isn't plain content or if it's
- // preceded by an orphan '<'
- if ((offset == flatNode.getStartOffset()) &&
- (flatNode.getPrevious() != null) &&
- (((flatNode.getRegionAtCharacterOffset(documentPosition) != null) &&
- (flatNode.getRegionAtCharacterOffset(documentPosition).getType() != DOMRegionContext.XML_CONTENT)) ||
- (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) ||
- (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN))) {
-
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = flatNode.getPrevious().getLastRegion();
- }
- else if (flatNode.getEndOffset() == documentPosition) {
- region = flatNode.getLastRegion();
- }
- else {
- region = flatNode.getFirstRegion();
- }
- }
- else {
- // catch end of document positions where the docPosition isn't
- // in a IStructuredDocumentRegion
- region = flatNode.getLastRegion();
- }
- }
-
- return region;
- }
-
- private int getElementPosition(Node child) {
- Node parent = child.getParentNode();
- if (parent == null) {
- return 0;
- }
-
- NodeList children = parent.getChildNodes();
- if (children == null) {
- return 0;
- }
- int count = 0;
-
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i) == child) {
- return count;
- }
- else {
- // if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
- count++;
- }
- }
- return 0;
- }
-
- private String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
- if ((aRegion == null) || isCloseRegion(aRegion)) {
- return ""; //$NON-NLS-1$
- }
- String matchString = null;
- String regionType = aRegion.getType();
- if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
- matchString = ""; //$NON-NLS-1$
- }
- else if (regionType == DOMRegionContext.XML_CONTENT) {
- matchString = ""; //$NON-NLS-1$
- }
- else {
- if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
- matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
- }
- else {
- matchString = ""; //$NON-NLS-1$
- }
- }
- return matchString;
- }
-
- private ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- Iterator regionList = flatNode.getRegions().iterator();
- while (regionList.hasNext()) {
- ITextRegion region = (ITextRegion) regionList.next();
- if (isNameRegion(region)) {
- return region;
- }
- }
- return null;
- }
-
- private boolean isCloseRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_PI_CLOSE) ||
- (type == DOMRegionContext.XML_TAG_CLOSE) ||
- (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
- (type == DOMRegionContext.XML_CDATA_CLOSE) ||
- (type == DOMRegionContext.XML_COMMENT_CLOSE) ||
- (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) ||
- (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) ||
- (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) ||
- (type == DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) ||
- (type == DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_CLOSE) ||
- (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE)) ||
- (type == DOMRegionContext.XML_DECLARATION_CLOSE));
- }
-
- private boolean isNameRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_TAG_NAME) ||
- (type == DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME) ||
- (type == DOMRegionContext.XML_ELEMENT_DECL_NAME) ||
- (type == DOMRegionContext.XML_DOCTYPE_NAME) ||
- (type == DOMRegionContext.XML_ATTLIST_DECL_NAME) ||
- (type == DOMJSPRegionContextsPrivateCopy.JSP_ROOT_TAG_NAME) ||
- type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME));
- }
-
- /**
- * StructuredTextViewer must be set before using this.
- */
- private IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
- return ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java
deleted file mode 100644
index c6c0143cf2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java
+++ /dev/null
@@ -1,1862 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-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.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;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-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.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-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.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-
-/**
- * <p>Implementation of an {@link AbstractXMLCompletionProposalComputer} that uses {@link ModelQuery}s
- * to make its proposals.</p>
- *
- * @base org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor
- */
-public abstract class AbstractXMLModelQueryCompletionProposalComputer extends AbstractXMLCompletionProposalComputer {
-
- private static MarkupTagInfoProvider infoProvider = new MarkupTagInfoProvider();
-
- /**
- * <p>Default constructor</p>
- */
- public AbstractXMLModelQueryCompletionProposalComputer() {
- }
-
- /**
- * <p>default is to do nothing</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- //default is to do nothing
- }
-
- /**
- * <p>default is to do nothing</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
- */
- public void sessionStarted() {
- //default is to do nothing
- }
-
- /**
- * @return {@link XMLContentModelGenerator} used to generate proposals
- */
- protected abstract XMLContentModelGenerator getContentGenerator();
-
- /**
- * <p>Given a {@link CMNode} generated by a model query should decide if the
- * action is valid for this implementation of the model query proposal computer</p>
- *
- * <p>This is needed because {@link ModelQuery}s return a lot of {@link CMNode}s that
- * can come from multiple sources and a particular computer may not want to propose
- * all of the actions as content assist proposals</p>
- *
- * @param action {@link CMNode} to decide if it is valid as a result
- * for this model query proposal computer
- *
- * @return <code>true</code> if the given {@link CMNode} is valid for this
- * computer, <code>false</code> otherwise
- */
- protected abstract boolean validModelQueryNode(CMNode node);
-
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- IStructuredDocumentRegion sdRegion = contentAssistRequest.getDocumentRegion();
- // retrieve the list of attributes
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- if (elementDecl != null) {
- CMNamedNodeMapImpl attributes = new CMNamedNodeMapImpl(elementDecl.getAttributes());
- addModelQueryAttributeDeclarations(node, elementDecl,attributes);
-
- String matchString = contentAssistRequest.getMatchString();
- int cursorOffset = context.getInvocationOffset();
- // check whether an attribute really exists for the replacement
- // offsets AND if it possesses a value
- boolean attrAtLocationHasValue = false;
- boolean proposalNeedsSpace = false;
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- AttrImpl existingAttr = (AttrImpl) attrs.item(i);
- ITextRegion name = existingAttr.getNameRegion();
-
- if (name != null && (sdRegion.getStartOffset(name) <= contentAssistRequest.getReplacementBeginPosition()) &&
- (sdRegion.getStartOffset(name) + name.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength()) &&
- (existingAttr.getValueRegion() != null)) {
- // selected region is attribute name
- if (cursorOffset >= sdRegion.getStartOffset(name) && contentAssistRequest.getReplacementLength() != 0)
- attrAtLocationHasValue = true;
- // propose new attribute, cursor is at the start of another attribute name
- else if (cursorOffset == sdRegion.getStartOffset(name))
- proposalNeedsSpace = true;
- break;
- }
- }
-
- // only add proposals for the attributes whose names begin with the matchstring
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributes.item(i);
-
- if(validModelQueryNode(attrDecl)) {
- int isRequired = 0;
- if (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
- isRequired = XMLRelevanceConstants.R_REQUIRED;
- }
-
- boolean showAttribute = true;
- showAttribute = showAttribute && beginsWith(getRequiredName(node, attrDecl), matchString.trim());
- AttrImpl attr = (AttrImpl) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
- ITextRegion nameRegion = attr != null ? attr.getNameRegion() : null;
- // nameRegion.getEndOffset() + 1 is required to allow for
- // matches against the full name of an existing Attr
- showAttribute = showAttribute && ((attr == null) || nameRegion == null ||
- ((nameRegion != null) &&
- (sdRegion.getStartOffset(nameRegion) <
- contentAssistRequest.getReplacementBeginPosition()) &&
- (sdRegion.getStartOffset(nameRegion) + nameRegion.getLength() >=
- (contentAssistRequest.getReplacementBeginPosition() +
- contentAssistRequest.getReplacementLength()) )));
- if (showAttribute) {
- //get the proposal image
- Image attrImage = CMImageUtil.getImage(attrDecl);
- if (attrImage == null) {
- if (isRequired > 0) {
- attrImage = this.getRequiredAttributeImage();
- } else {
- attrImage = this.getNotRequiredAttributeImage();
- }
- }
-
- String proposedText = null;
- String proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
- CustomCompletionProposal proposal = null;
- // attribute is at this location and already exists
- if (attrAtLocationHasValue) {
- // only propose the name
- proposedText = getRequiredName(node, attrDecl);
- proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), proposedText.length(),
- attrImage, proposedText, null, proposedInfo,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true);
- }
- // no attribute exists or is elsewhere, generate
- // minimally
- else {
- Attr existingAttrNode = (Attr) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
- String value = null;
- if (existingAttrNode != null && existingAttrNode.getSpecified()) {
- value = existingAttrNode.getNodeValue();
- }
- int cursorPosition = 0;
- if ((value != null) && (value.length() > 0)) {
- proposedText = getRequiredName(node, attrDecl);
- cursorPosition = proposedText.length() + 2;
- }
- else {
- proposedText = getRequiredText(node, attrDecl);
- // skip the cursor past a fixed value
- if (attrDecl.getAttrType() != null && attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)
- cursorPosition = proposedText.length();
- else
- cursorPosition = getRequiredName(node, attrDecl).length() + 2;
- }
- if (proposalNeedsSpace)
- proposedText += " "; //$NON-NLS-1$
- proposal = new CustomCompletionProposal(proposedText,
- contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(),
- cursorPosition, attrImage,
- // if the value isn't empty (no empty set of quotes), show it
- // BUG 203494, content strings may have "", but not be empty
- // An empty string is when there's no content between double quotes
- // and there is no single quote that may be encasing a double quote
- ((proposedText.lastIndexOf('\"') - proposedText.indexOf('\"') == 1 &&
- proposedText.indexOf('\'') == -1)) ? getRequiredName(node, attrDecl) : proposedText,
- null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired);
- }
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- else {
- setErrorMessage(NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{node.getNodeName()})));
- }
- }
-
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- // Find the attribute region and name for which this position should
- // have a value proposed
- 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;
- }
- }
-
- // the name region is REQUIRED to do anything useful
- if (nameRegion != null) {
- // Retrieve the declaration
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
-
- // String attributeName = nameRegion.getText();
- String attributeName = open.getText(nameRegion);
-
- CMAttributeDeclaration attrDecl = null;
-
- // No CMElementDeclaration means no attribute metadata, but retrieve the
- // declaration for the attribute otherwise
- if (elementDecl != null) {
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(elementDecl.getAttributes()) {
- private Map caseInsensitive;
-
- private Map getCaseInsensitiveMap() {
- if(caseInsensitive == null)
- caseInsensitive = new HashMap();
- return caseInsensitive;
- }
-
- public CMNode getNamedItem(String name) {
- CMNode node = super.getNamedItem(name);
- if (node == null) {
- node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
- }
- return node;
- }
-
- public void put(CMNode cmNode) {
- super.put(cmNode);
- getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
- }
- };
- this.addModelQueryAttributeDeclarations(node, elementDecl, allAttributes);
-
- String noprefixName = DOMNamespaceHelper.getUnprefixedName(attributeName);
- if (allAttributes != null) {
- attrDecl = (CMAttributeDeclaration) allAttributes.getNamedItem(attributeName);
- if (attrDecl == null) {
- attrDecl = (CMAttributeDeclaration) allAttributes.getNamedItem(noprefixName);
- }
- }
- if (attrDecl == null) {
- setErrorMessage(XMLUIMessages.No_known_attribute__UI_ + attributeName);
- }
- }
-
- String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
- String proposedInfo = null;
- //get proposal image
- Image image = CMImageUtil.getImage(attrDecl);
- if (image == null) {
- if ((attrDecl != null) && (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED)) {
- image = this.getRequiredAttributeImage();
- } else {
- image = this.getNotRequiredAttributeImage();
- }
- }
-
- if ((attrDecl != null) && (attrDecl.getAttrType() != null)) {
- // attribute is known, prompt with values from the declaration
- proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
- List possibleValues = getPossibleDataTypeValues(node, attrDecl);
- String defaultValue = attrDecl.getAttrType().getImpliedValue();
- String qualifiedDelimiter = (String) attrDecl.getProperty("qualified-delimiter"); //$NON-NLS-1$
- if (possibleValues.size() > 0 || defaultValue != null) {
- // ENUMERATED VALUES
- String matchString = contentAssistRequest.getMatchString();
- if (matchString == null) {
- matchString = ""; //$NON-NLS-1$
- }
- if ((matchString.length() > 0) && (matchString.startsWith("\"") || matchString.startsWith("'"))) { //$NON-NLS-1$ //$NON-NLS-2$
- matchString = matchString.substring(1);
- }
- boolean currentValid = false;
-
- //create suggestions for enumerated values
- int rOffset = contentAssistRequest.getReplacementBeginPosition();
- int rLength = contentAssistRequest.getReplacementLength();
- for (Iterator j = possibleValues.iterator(); j.hasNext();) {
- String possibleValue = (String) j.next();
- String alternateMatch = null;
- if (qualifiedDelimiter != null) {
- int delimiter = possibleValue.lastIndexOf(qualifiedDelimiter);
- if (delimiter >= 0 && delimiter < possibleValue.length() - 1) {
- alternateMatch = possibleValue.substring(delimiter + 1);
- }
- }
- if(!possibleValue.equals(defaultValue)) {
- currentValid = currentValid || possibleValue.equals(currentValue);
- if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
- String rString = "\"" + possibleValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- alternateMatch = "\"" + alternateMatch; //$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- rString, rOffset, rLength, possibleValue.length() + 1,
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM),
- rString, alternateMatch, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE, true);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if(defaultValue != null && ((matchString.length() == 0) || defaultValue.startsWith(matchString))) {
- String rString = "\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- rString, rOffset, rLength, defaultValue.length() + 1,
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT),
- rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) ||
- (attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) &&
- (attrDecl.getAttrType().getImpliedValue() != null)) {
-
- // FIXED values
- String value = attrDecl.getAttrType().getImpliedValue();
- if ((value != null) && (value.length() > 0)) {
- String rValue = "\"" + value + "\"";//$NON-NLS-2$//$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- rValue, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), rValue.length() + 1,
- image, rValue, null, proposedInfo,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- if ((currentValue.length() > 0) && !value.equals(currentValue)) {
- rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- proposal = new CustomCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- else {
- // unknown attribute, so supply nice empty values
- proposedInfo = getAdditionalInfo(null, elementDecl);
- CustomCompletionProposal proposal = null;
- if ((currentValue != null) && (currentValue.length() > 0)) {
- String rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- proposal = new CustomCompletionProposal(rValue,
- contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), 1, image,
- rValue, null, proposedInfo,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
- }
-
- protected void addCommentProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- contentAssistRequest.addProposal(new CustomCompletionProposal("<!-- -->", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), 5,
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_COMMENT),
- NLS.bind(XMLUIMessages.Comment__, (new Object[]{" <!-- -->"})), //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_COMMENT));
- }
-
-
-
- /**
- * Add the proposals for the name in an end tag
- */
- protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- if (contentAssistRequest.getStartOffset() + contentAssistRequest.getRegion().getTextLength() < contentAssistRequest.getReplacementBeginPosition()) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_END_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- Node aNode = contentAssistRequest.getNode();
- String matchString = contentAssistRequest.getMatchString();
- if (matchString.startsWith("</")) { //$NON-NLS-1$
- matchString = matchString.substring(2);
- }
- while (aNode != null) {
- if (aNode.getNodeType() == Node.ELEMENT_NODE) {
- if (aNode.getNodeName().startsWith(matchString)) {
- IDOMNode aXMLNode = (IDOMNode) aNode;
- CMElementDeclaration ed = getCMElementDeclaration(aNode);
- //declaration must be valid for this computer to make proposal
- if ((aXMLNode.getEndStructuredDocumentRegion() == null) && (ed == null || (validModelQueryNode(ed) && ed.getContentType() != CMElementDeclaration.EMPTY))) {
- String replacementText = aNode.getNodeName();
- String displayText = replacementText;
- String proposedInfo = (ed != null) ? getAdditionalInfo(null, ed) : null;
- if(!contentAssistRequest.getDocumentRegion().isEnded()) {
- replacementText += ">"; //$NON-NLS-1$
- }
- CustomCompletionProposal proposal = null;
- // double check to see if the region acted upon is
- // a tag name; replace it if so
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = this.getGenericTagImage();
- }
- if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_NAME) {
- proposal = new CustomCompletionProposal(
- replacementText, contentAssistRequest.getStartOffset(),
- contentAssistRequest.getRegion().getTextLength(),
- replacementText.length(), image, displayText, null,
- proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
- }
- else {
- proposal = new CustomCompletionProposal(
- replacementText,
- contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(),
- replacementText.length(), image,
- NLS.bind(XMLUIMessages.Close_with__,
- (new Object[]{"'" + displayText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
- null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
- }
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- aNode = aNode.getParentNode();
- }
- }
- }
-
- /**
- * Prompt for end tags to a non-empty Node that hasn't ended Handles these
- * cases: <br>
- * <tagOpen>| <br>
- * <tagOpen>< |<br>
- * <tagOpen></ |
- *
- * @param contentAssistRequest
- */
- protected void addEndTagProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
-
- if (isCommentNode(node)) {
- // loop and find non comment node parent
- while ((node != null) && isCommentNode(node)) {
- node = (IDOMNode) node.getParentNode();
- }
- }
-
- // node is already closed
- if (node.isClosed()) {
- // loop and find non comment unclose node parent
- while ((node != null) && node.isClosed()) {
- node = (IDOMNode) node.getParentNode();
- }
- }
- // there were no unclosed tags
- if (node == null) {
- return;
- }
-
- // data to create a CustomCompletionProposal
- String replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
- int replaceBegin = contentAssistRequest.getReplacementBeginPosition();
- int replaceLength = contentAssistRequest.getReplacementLength();
- int cursorOffset = node.getNodeName().length() + 1;
- String displayString = ""; //$NON-NLS-1$
- String proposedInfo = ""; //$NON-NLS-1$
- Image image = this.getGenericTagImage();
-
- setErrorMessage(null);
- boolean addProposal = false;
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // ////////////////////////////////////////////////////////////////////////////////////
- IStructuredDocument sDoc = (IStructuredDocument) context.getDocument();
- IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
- // skip backward to "<", "</", or the (unclosed) start tag, null if not found
- String type = ""; //$NON-NLS-1$
- while ((xmlEndTagOpen != null) &&
- ((type = xmlEndTagOpen.getType()) != DOMRegionContext.XML_END_TAG_OPEN) &&
- (type != DOMRegionContext.XML_TAG_CLOSE) && !needsEndTag(xmlEndTagOpen, context) &&
- (type != DOMRegionContext.XML_TAG_OPEN)) {
-
- xmlEndTagOpen = xmlEndTagOpen.getPrevious();
- }
-
- if (xmlEndTagOpen == null) {
- return;
- }
-
- node = (IDOMNode) node.getModel().getIndexedRegion(xmlEndTagOpen.getStartOffset());
- node = (IDOMNode) node.getParentNode();
-
- if (isStartTag(xmlEndTagOpen)) {
- // this is the case for a start tag w/out end tag
- // eg:
- // <p>
- // <% String test = "test"; %>
- // |
- if (needsEndTag(xmlEndTagOpen, context)) {
- String tagName = getTagName(xmlEndTagOpen);
- xmlEndTagOpen.getTextEndOffset();
- replaceLength = 0;
- replaceText = "</" + tagName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
- cursorOffset = tagName.length() + 3;
- displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{tagName}));
- addProposal = true;
- }
- }
- else if (type == DOMRegionContext.XML_END_TAG_OPEN) {
- // this is the case for: <tag> </ |
- // possibly <tag> </ |<anotherTag>
- // should only be replacing white space...
- replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
- replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
- cursorOffset = replaceText.length();
- replaceBegin = xmlEndTagOpen.getTextEndOffset();
- displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{node.getNodeName()}));
- addProposal = true;
- }
- else if (type == DOMRegionContext.XML_TAG_OPEN) {
- // this is the case for: <tag> < |
- replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
- cursorOffset = replaceText.length();
-
- // should only be replacing white space...
- replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
- replaceBegin = xmlEndTagOpen.getTextEndOffset();
- displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{"/" + node.getNodeName()})); //$NON-NLS-1$
- addProposal = true;
- }
- }
- // ////////////////////////////////////////////////////////////////////////////////////
- // sometimes the node is not null, but
- // getNodeValue() is null, put in a null check
- else if ((node.getNodeValue() != null) && (node.getNodeValue().indexOf("</") != -1)) { //$NON-NLS-1$
- // the case where "</" is started, but the nodes comes in as a
- // text node (instead of element)
- // like this: <tag> </|
- Node parent = node.getParentNode();
- if ((parent != null) && (parent.getNodeType() != Node.DOCUMENT_NODE)) {
- replaceText = parent.getNodeName() + ">"; //$NON-NLS-1$
- cursorOffset = replaceText.length();
- displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{parent.getNodeName()}));
- setErrorMessage(null);
- addProposal = true;
- }
- }
- // ////////////////////////////////////////////////////////////////////////////////////
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
- if (addProposal == true) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(replaceText, replaceBegin, replaceLength, cursorOffset, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_END_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
-
- protected void addEntityProposals(
- ContentAssistRequest contentAssistRequest,
- ITextRegion completionRegion, IDOMNode treeNode,
- CompletionProposalInvocationContext context) {
-
- ICompletionProposal[] eps = computeEntityReferenceProposals(completionRegion,
- treeNode, context);
- for (int i = 0; (eps != null) && (i < eps.length); i++) {
- contentAssistRequest.addProposal(eps[i]);
- }
- }
-
- protected void addEntityProposals(Vector proposals, Properties map,
- String key, int nodeOffset, IStructuredDocumentRegion sdRegion,
- ITextRegion completionRegion,
- CompletionProposalInvocationContext context) {
-
- if (map == null) {
- return;
- }
- String entityName = ""; //$NON-NLS-1$
- String entityValue = ""; //$NON-NLS-1$
- Image entityIcon = this.getEntityReferenceImage();
- String replacementText = ""; //$NON-NLS-1$
- String displayString = ""; //$NON-NLS-1$
- Enumeration keys = map.keys();
-
- while ((keys != null) && keys.hasMoreElements()) {
- entityName = (String) keys.nextElement();
- entityValue = map.getProperty(entityName);
- // filter based on partial entity string...
- if (entityName.toLowerCase().startsWith(key.toLowerCase()) || key.trim().equals("")) //$NON-NLS-1$
- {
- // figure out selection...if text is selected, add it to
- // selection length
- int selectionLength = nodeOffset;
- if (context.getViewer() != null) {
- selectionLength += context.getViewer().getSelectedRange().y;
- }
- // create a new proposal for entity string...
- replacementText = "&" + entityName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- displayString = "&" + entityName + "; (" + entityValue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ICompletionProposal cp = new CustomCompletionProposal(replacementText, sdRegion.getStartOffset(completionRegion), selectionLength, replacementText.length(), entityIcon, displayString, null, null, XMLRelevanceConstants.R_ENTITY);
- if (cp != null) {
- proposals.add(cp);
- }
- }
- }
- }
-
- protected void addPCDATAProposal(String nodeName,
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- CustomCompletionProposal proposal = new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 9, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CDATASECTION), "CDATA Section", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_CDATA);
- contentAssistRequest.addProposal(proposal);
-
- proposal = new CustomCompletionProposal(nodeName, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), nodeName.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT), "#PCDATA", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_CDATA);
- contentAssistRequest.addProposal(proposal);
- }
-
- protected void addStartDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- //determine if XMLPI is first element
- Node aNode = contentAssistRequest.getNode();
- Document owningDocument = aNode.getOwnerDocument();
- Node first = owningDocument.getFirstChild();
- boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
-
- // make sure xmlpi is root element don't want doctype proposal if XMLPI isn't first element...
- if (xmlpiIsFirstElement && (owningDocument.getDoctype() == null) &&
- isCursorAfterXMLPI(contentAssistRequest)) {
-
- addDocTypeProposal(contentAssistRequest, context);
- }
- }
-
- /**
- * Close an unclosed start tag
- */
- protected void addTagCloseProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
- if (node.getNodeType() == Node.ELEMENT_NODE) {
-
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- String proposedInfo = (elementDecl != null) ? getAdditionalInfo(null, elementDecl) : null;
- int contentType = (elementDecl != null) ? elementDecl.getContentType() : CMElementDeclaration.ANY;
- // if it's XML and content doesn't HAVE to be element, add "/>" proposal.
- boolean endWithSlashBracket = (isXMLNode(node) && (contentType != CMElementDeclaration.ELEMENT));
-
- //get the image
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- image = this.getGenericTagImage();
- }
-
- // is the start tag ended properly?
- if ((contentAssistRequest.getDocumentRegion() == node.getFirstStructuredDocumentRegion()) && !(node.getFirstStructuredDocumentRegion()).isEnded()) {
- setErrorMessage(null);
- // Is this supposed to be an empty tag? Note that if we can't
- // tell, we assume it's not.
- if ((elementDecl != null) && (elementDecl.getContentType() == CMElementDeclaration.EMPTY)) {
- // prompt with a self-closing end character if needed
- // this is one of the few times to ignore the length -- always insert
- // contentAssistRequest.getReplacementLength()
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- getContentGenerator().getStartTagClose(node, elementDecl),
- contentAssistRequest.getReplacementBeginPosition(), 0,
- getContentGenerator().getStartTagClose(node, elementDecl).length(), image,
- NLS.bind(XMLUIMessages.Close_with___,(new Object[]{getContentGenerator().getStartTagClose(node, elementDecl)})),
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- // prompt with a close for the start tag
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore the
- // length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
-
- // prompt with the closer for the start tag and an end tag if one is not present
- if (node.getEndStructuredDocumentRegion() == null) {
- // make sure tag name is actually what it thinks it
- // is...(eg. <%@ vs. <jsp:directive)
- IStructuredDocumentRegion sdr = contentAssistRequest.getDocumentRegion();
- String openingTagText = (sdr != null) ? sdr.getFullText() : ""; //$NON-NLS-1$
- if ((openingTagText != null) && (openingTagText.indexOf(node.getNodeName()) != -1)) {
- proposal = new CustomCompletionProposal("></" + node.getNodeName() + ">", //$NON-NLS-2$//$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to
- // ignore the length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with____, (new Object[]{node.getNodeName()})), null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
- // prompt with slash bracket "/>" incase if it's a self ending tag
- if (endWithSlashBracket) {
- proposal = new CustomCompletionProposal("/>", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore
- // the length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 2, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" \"/>\""})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG + 1); // +1
- // to bring to top of list
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else if ((contentAssistRequest.getDocumentRegion() == node.getLastStructuredDocumentRegion()) && !node.getLastStructuredDocumentRegion().isEnded()) {
- setErrorMessage(null);
- // prompt with a closing end character for the end tag
- CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- // this is one of the few times to ignore the length -- always insert
- // contentAssistRequest.getReplacementLength(),
- 0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
- null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
- contentAssistRequest.addProposal(proposal);
- }
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
- }
-
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- List cmnodes = null;
- Node parent = contentAssistRequest.getParent();
- String error = null;
-
- // (nsd) This is only valid at the document element level
- // only valid if it's XML (check added 2/17/2004)
- if ((parent != null) && (parent.getNodeType() == Node.DOCUMENT_NODE) &&
- ((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
- return;
- }
- // only want proposals if cursor is after doctype...
- if (!isCursorAfterDoctype(contentAssistRequest)) {
- return;
- }
-
- // fix for meta-info comment nodes.. they currently "hide" other
- // proposals because the don't
- // have a content model (so can't propose any children..)
- if ((parent != null) && (parent instanceof IDOMNode) && isCommentNode((IDOMNode) parent)) {
- // loop and find non comment node?
- while ((parent != null) && isCommentNode((IDOMNode) parent)) {
- parent = parent.getParentNode();
- }
- }
-
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
- if (parentDecl != null) {
- // XSD-specific ability - no filtering
- CMDataType childType = parentDecl.getDataType();
- if (childType != null) {
- String[] childStrings = childType.getEnumeratedValues();
- String defaultValue = childType.getImpliedValue();
- if (childStrings != null || defaultValue != null) {
- // the content string is the sole valid child...so replace the rest
- int begin = contentAssistRequest.getReplacementBeginPosition();
- int length = contentAssistRequest.getReplacementLength();
- if (parent instanceof IDOMNode) {
- if (((IDOMNode) parent).getLastStructuredDocumentRegion() != ((IDOMNode) parent).getFirstStructuredDocumentRegion()) {
- begin = ((IDOMNode) parent).getFirstStructuredDocumentRegion().getEndOffset();
- length = ((IDOMNode) parent).getLastStructuredDocumentRegion().getStartOffset() - begin;
- }
- }
- String proposedInfo = getAdditionalInfo(parentDecl, childType);
- for (int i = 0; i < childStrings.length; i++) {
- if(!childStrings[i].equals(defaultValue)) {
- CustomCompletionProposal textProposal = new CustomCompletionProposal(
- childStrings[i],begin, length, childStrings[i].length(),
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM),
- childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(textProposal);
- }
- }
- if(defaultValue != null) {
- CustomCompletionProposal textProposal = new CustomCompletionProposal(
- defaultValue, begin, length, defaultValue.length(),
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT),
- defaultValue, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(textProposal);
- }
- }
- }
- }
- if ((parentDecl != null) && (parentDecl.getContentType() == CMElementDeclaration.PCDATA)) {
- addPCDATAProposal(parentDecl.getNodeName(), contentAssistRequest, context);
- }
- else {
- // retrieve the list of all possible children within this parent context
- cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition,ModelQueryAction.INSERT);
-
- // retrieve the list of the possible children within this
- // parent context and at this index
- List strictCMNodeSuggestions = null;
- if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) {
- strictCMNodeSuggestions = getValidChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
- }
- Iterator nodeIterator = cmnodes.iterator();
- if (!nodeIterator.hasNext()) {
- if (getCMElementDeclaration(parent) != null) {
- error = NLS.bind(XMLUIMessages._Has_no_available_child, (new Object[]{parent.getNodeName()}));
- }
- else {
- error = NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{parent.getNodeName()}));
- }
- }
- String matchString = contentAssistRequest.getMatchString();
- // chop off any leading <'s and whitespace from the matchstring
- while ((matchString.length() > 0) &&
- (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) { //$NON-NLS-1$
-
- matchString = matchString.substring(1);
- }
- while (nodeIterator.hasNext()) {
- Object o = nodeIterator.next();
- if (o instanceof CMElementDeclaration) {
- CMElementDeclaration elementDecl =(CMElementDeclaration) o;
- // only add proposals for the child element's that
- // begin with the matchstring
- String tagname = getRequiredName(parent, elementDecl);
- boolean isStrictCMNodeSuggestion =
- strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
-
- //get the proposal image
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- if (strictCMNodeSuggestions != null) {
- image = isStrictCMNodeSuggestion ? this.getEmphasizedTagImage() : this.getDeemphasizedTagImage();
- } else {
- image = this.getGenericTagImage();
- }
- }
-
- if (beginsWith(tagname, matchString)) {
- String proposedText = getRequiredText(parent, elementDecl);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
- // place cursor in first empty quotes
- int markupAdjustment = getCursorPositionForProposedText(proposedText);
-
- String proposedInfo = getAdditionalInfo(parentDecl, elementDecl);
- int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION : XMLRelevanceConstants.R_TAG_INSERTION;
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), markupAdjustment,
- image, tagname, null, proposedInfo, relevance);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if (contentAssistRequest.getProposals().size() == 0) {
- if (error != null) {
- setErrorMessage(error);
- }
- else if ((contentAssistRequest.getMatchString() != null) &&
- (contentAssistRequest.getMatchString().length() > 0)) {
-
- setErrorMessage(NLS.bind(
- XMLUIMessages.No_known_child_tag,
- (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
- }
- else {
- setErrorMessage(NLS.bind(
- XMLUIMessages.__Has_no_known_child,
- (new Object[]{parent.getNodeName()})));
- }
- }
- }
- }
- else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- // Can only prompt with elements if the cursor position is past
- // the XML processing
- // instruction and DOCTYPE declaration
- boolean xmlpiFound = false;
- boolean doctypeFound = false;
- int minimumOffset = -1;
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- boolean doctype = child.getNodeType() == Node.DOCUMENT_TYPE_NODE;
- if (xmlpi || (doctype && (minimumOffset < 0))) {
- minimumOffset = ((IDOMNode) child).getFirstStructuredDocumentRegion().getStartOffset() + ((IDOMNode) child).getFirstStructuredDocumentRegion().getTextLength();
- }
- xmlpiFound = xmlpiFound || xmlpi;
- doctypeFound = doctypeFound || doctype;
- }
-
- if (contentAssistRequest.getReplacementBeginPosition() >= minimumOffset) {
- List childDecls = getAvailableRootChildren((Document) parent, childPosition);
- for (int i = 0; i < childDecls.size(); i++) {
- CMElementDeclaration ed = (CMElementDeclaration) childDecls.get(i);
- if (ed != null) {
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = this.getGenericTagImage();
- }
- String proposedText = getRequiredText(parent, ed);
- String tagname = getRequiredName(parent, ed);
- // account for the &lt; and &gt;
- int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, ed);
- String proposedInfo = getAdditionalInfo(null, ed);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), markupAdjustment, image,
- tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
-
- protected void addTagNameProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- List cmnodes = null;
- Node parent = contentAssistRequest.getParent();
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- String error = null;
- String matchString = contentAssistRequest.getMatchString();
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- // retrieve the list of children
- // validActions = getAvailableChildrenAtIndex((Element) parent,
- // childPosition);
- cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
- List strictCMNodeSuggestions = null;
- if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) {
- strictCMNodeSuggestions = getValidChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
- }
-
- Iterator nodeIterator = cmnodes.iterator();
- // chop off any leading <'s and whitespace from the matchstring
- while ((matchString.length() > 0) &&
- (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) { //$NON-NLS-1$
-
- matchString = matchString.substring(1);
- }
- if (!nodeIterator.hasNext()) {
- error = NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()}));
- }
- while (nodeIterator.hasNext()) {
- CMNode elementDecl = (CMNode) nodeIterator.next();
- if (elementDecl != null) {
- // only add proposals for the child element's that begin with the matchstring
- String proposedText = null;
- int cursorAdjustment = 0;
-
- //determine if strict suggestion
- boolean isStrictCMNodeSuggestion =
- strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
-
- // do a check to see if partial attributes of partial tag names are in list
- if (((node != null) && (node.getAttributes() != null) &&
- (node.getAttributes().getLength() > 0) &&
- attributeInList(node, parent, elementDecl)) ||
- ((node.getNodeType() != Node.TEXT_NODE) &&
- node.getFirstStructuredDocumentRegion().isEnded())) {
-
- proposedText = getRequiredName(parent, elementDecl);
- cursorAdjustment = proposedText.length();
- }
- else {
- proposedText = getRequiredName(parent, elementDecl);
-
- cursorAdjustment = proposedText.length();
- if (elementDecl instanceof CMElementDeclaration) {
- CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
- StringBuffer sb = new StringBuffer();
- getContentGenerator().generateTag(parent, ed, sb);
- // since it's a name proposal, assume '<' is already there
- // only return the rest of the tag
- proposedText = sb.toString().substring(1);
- cursorAdjustment = getCursorPositionForProposedText(proposedText);
- }
- }
- if (beginsWith(proposedText, matchString)) {
- //get the proposal image
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- if (strictCMNodeSuggestions != null) {
- image = isStrictCMNodeSuggestion ? this.getEmphasizedTagImage() : this.getDeemphasizedTagImage();
- } else {
- image = this.getGenericTagImage();
- }
- }
- int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_NAME : XMLRelevanceConstants.R_TAG_NAME;
- String proposedInfo = getAdditionalInfo(getCMElementDeclaration(parent), elementDecl);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), cursorAdjustment, image,
- getRequiredName(parent, elementDecl), null, proposedInfo,
- relevance);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- if (contentAssistRequest.getProposals().size() == 0) {
- if (error != null) {
- setErrorMessage(error);
- }
- else if ((contentAssistRequest.getMatchString() != null) && (contentAssistRequest.getMatchString().length() > 0)) {
- setErrorMessage(NLS.bind(
- XMLUIMessages.No_known_child_tag_names,
- (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
- }
- else {
- setErrorMessage(NLS.bind(
- XMLUIMessages.__Has_no_known_child,
- (new Object[]{parent.getNodeName()})));
- }
- }
- }
- else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- List childElements = getAvailableRootChildren((Document) parent, childPosition);
- if ( childElements.size() == 0) {
- //No doctype available , treat it as empty document
- addEmptyDocumentProposals(contentAssistRequest, context);
- }
- for (int i = 0; i < childElements.size(); i++) {
- CMNode ed = (CMNode) childElements.get(i);
- if (ed == null) {
- continue;
- }
- String proposedText = null;
- int cursorAdjustment = 0;
- if (ed instanceof CMElementDeclaration) {
- // proposedText = getRequiredName(parent, ed);
- StringBuffer sb = new StringBuffer();
- getContentGenerator().generateTag(parent, (CMElementDeclaration) ed, sb);
- // tag starts w/ '<', but we want to compare to name
- proposedText = sb.toString().substring(1);
-
- if (!beginsWith(proposedText, matchString)) {
- continue;
- }
-
- cursorAdjustment = getCursorPositionForProposedText(proposedText);
-
- String proposedInfo = getAdditionalInfo(null, ed);
- Image image = CMImageUtil.getImage(ed);
- if (image == null) {
- image = this.getGenericTagImage();
- }
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), cursorAdjustment, image,
- getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
-
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- //by default do nothing
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for generic tag proposals
- */
- protected Image getGenericTagImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for emphasized tag proposals
- */
- protected Image getEmphasizedTagImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_EMPHASIZED);
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for de-emphasized tag proposals
- */
- protected Image getDeemphasizedTagImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_DEEMPHASIZED);
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for entity reference proposals
- */
- protected Image getEntityReferenceImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE);
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for not required attributes
- */
- protected Image getNotRequiredAttributeImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
-
- /**
- * <p>Implementers are allowed to override</p>
- *
- * @return the proposal image to display for required attributes
- */
- protected Image getRequiredAttributeImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
- }
-
- /**
- * This method can check if the cursor is after the XMLPI
- *
- * @param car
- */
- protected boolean isCursorAfterXMLPI(ContentAssistRequest car) {
- Node aNode = car.getNode();
- boolean xmlpiFound = false;
- Document parent = aNode.getOwnerDocument();
- int xmlpiNodePosition = -1;
- boolean isAfterXMLPI = false;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- xmlpiFound = xmlpiFound || xmlpi;
- if (xmlpiFound) {
- if (child instanceof IDOMNode) {
- xmlpiNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterXMLPI = (car.getReplacementBeginPosition() >= xmlpiNodePosition);
- }
- break;
- }
- }
- return isAfterXMLPI;
- }
-
- protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
- if ((cmnode == null) || (parentOrOwner == null)) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- return getContentGenerator().getRequiredName(parentOrOwner, cmnode);
- }
-
- private String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
- if (attrDecl == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- StringBuffer buff = new StringBuffer();
- getContentGenerator().generateRequiredAttribute(parentOrOwner, attrDecl, buff);
- return buff.toString();
- }
-
- protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
- if (elementDecl == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
- StringBuffer buff = new StringBuffer();
- getContentGenerator().generateTag(parentOrOwner, elementDecl, buff);
- return buff.toString();
- }
-
- /**
- * Retrieves all of the possible valid values for this attribute
- * declaration
- */
- private List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
- List list = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- String[] dataTypeValues = null;
- // The ModelQuery may not be available if the corresponding
- // adapter
- // is absent
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null) {
- dataTypeValues = modelQuery.getPossibleDataTypeValues(element, ad);
- }
- else {
- if (ad.getAttrType() != null) {
- dataTypeValues = ad.getAttrType().getEnumeratedValues();
- }
- }
- if (dataTypeValues != null) {
- list = new ArrayList(dataTypeValues.length);
- for (int i = 0; i < dataTypeValues.length; i++) {
- list.add(dataTypeValues[i]);
- }
- }
- }
- if (list == null) {
- list = new ArrayList(0);
- }
- return list;
- }
-
- /**
- * This is to determine if a tag is a special meta-info comment tag that
- * shows up as an ELEMENT
- *
- * @param node
- * @return
- */
- private boolean isCommentNode(IDOMNode node) {
- return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
- }
-
- private boolean isStartTag(IStructuredDocumentRegion sdRegion) {
- boolean result = false;
- if (sdRegion.getRegions().size() > 0) {
- ITextRegion r = sdRegion.getRegions().get(0);
- result = (r.getType() == DOMRegionContext.XML_TAG_OPEN) && sdRegion.isEnded();
- }
- return result;
- }
-
- /**
- * Gets the corresponding XMLNode, and checks if it's closed.
- *
- * @param startTag
- *
- */
- private boolean needsEndTag(IStructuredDocumentRegion startTag,
- CompletionProposalInvocationContext context) {
-
- boolean result = false;
- IStructuredModel sModel =
- StructuredModelManager.getModelManager().getExistingModelForRead(context.getDocument());
- try {
- if (sModel != null) {
- IDOMNode xmlNode = (IDOMNode) sModel.getIndexedRegion(startTag.getStart());
- if (!isStartTag(startTag)) {
- result = false;
- }
- else if (isSelfClosed(startTag)) {
- result = false;
- }
- else if (!xmlNode.isContainer()) {
- result = false;
- }
- else {
- result = xmlNode.getEndStructuredDocumentRegion() == null;
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return result;
- }
-
- private boolean isSelfClosed(IStructuredDocumentRegion startTag) {
- ITextRegionList regions = startTag.getRegions();
- return regions.get(regions.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
- }
-
- private String getTagName(IStructuredDocumentRegion sdRegion) {
- ITextRegionList regions = sdRegion.getRegions();
- ITextRegion region = null;
- String name = ""; //$NON-NLS-1$
- for (int i = 0; i < regions.size(); i++) {
- region = regions.get(i);
- if (region.getType() == DOMRegionContext.XML_TAG_NAME) {
- name = sdRegion.getText(region);
- break;
- }
- }
- return name;
- }
-
- /**
- * return all possible EntityReferenceProposals (according to current
- * position in doc)
- */
- private ICompletionProposal[] computeEntityReferenceProposals(ITextRegion completionRegion,
- IDOMNode treeNode,CompletionProposalInvocationContext context) {
-
- // only handle XML content for now
- int documentPosition = context.getInvocationOffset();
- Vector proposals = new Vector(); // ICompletionProposals
- IStructuredDocumentRegion sdRegion =
- ContentAssistUtils.getStructuredDocumentRegion(context.getViewer(), context.getInvocationOffset());
- if ((completionRegion != null) && (completionRegion.getType() == DOMRegionContext.XML_CONTENT)) {
- int nodeOffset = documentPosition - sdRegion.getStartOffset(completionRegion);
- String regionText = sdRegion.getFullText(completionRegion);
-
- // if directly to the right of a &, region will be null, need to
- // move to
- // the previous region...there might be a better way to do this
- if ((regionText != null) && regionText.trim().equals("") && (documentPosition > 0)) { //$NON-NLS-1$
- IStructuredDocumentRegion prev = treeNode.getStructuredDocument().getRegionAtCharacterOffset(documentPosition - 1);
- if ((prev != null) && prev.getText().equals("&")) { //$NON-NLS-1$
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=206680
- // examine previous region
- sdRegion = prev;
- completionRegion = prev.getLastRegion();
- regionText = prev.getFullText();
- nodeOffset = 1;
- }
- }
-
- // string must start w/ &
- if ((regionText != null) && regionText.startsWith("&")) { //$NON-NLS-1$
- String key = (nodeOffset > 0) ? regionText.substring(1, nodeOffset) : ""; //$NON-NLS-1$
-
- // get entity proposals, passing in the appropriate start
- // string
- ModelQuery mq = ModelQueryUtil.getModelQuery(((Node) treeNode).getOwnerDocument());
- if (mq != null) {
- CMDocument xmlDoc = mq.getCorrespondingCMDocument(treeNode);
- CMNamedNodeMap cmmap = null;
- Properties entities = null;
- if (xmlDoc != null) {
- cmmap = xmlDoc.getEntities();
- }
- if (cmmap != null) {
- entities = mapToProperties(cmmap);
- }
- else // 224787 in absence of content model, just use
- // minimal 5 entities
- {
- entities = new Properties();
- entities.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("apos", "'"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
- entities.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- addEntityProposals(proposals, entities, key,
- nodeOffset, sdRegion, completionRegion, context);
- }
- }
- }
- return (ICompletionProposal[]) ((proposals.size() > 0) ? proposals.toArray(new ICompletionProposal[proposals.size()]) : null);
- }
-
- /**
- * Similar to the call in HTMLContentAssistProcessor. Pass in a node, it
- * tells you if the document is XML type.
- *
- * @param node
- *
- */
- private boolean isXMLNode(Node node) {
- if (node == null) {
- return false;
- }
-
- Document doc = null;
- doc = (node.getNodeType() != Node.DOCUMENT_NODE) ? node.getOwnerDocument() : ((Document) node);
-
- return (doc instanceof IDOMDocument) && ((IDOMDocument) doc).isXMLType();
- }
-
- /**
- * Checks if cursor position is after doctype tag...
- *
- * @param car
- *
- */
- private boolean isCursorAfterDoctype(ContentAssistRequest car) {
- Node aNode = car.getNode();
- Document parent = aNode.getOwnerDocument();
- int xmldoctypeNodePosition = -1;
- boolean isAfterDoctype = true;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof IDOMNode) {
- if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- xmldoctypeNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterDoctype = (car.getReplacementBeginPosition() >= xmldoctypeNodePosition);
- break;
- }
- }
- }
- return isAfterDoctype;
- }
-
- /**
- * returns a list of CMElementDeclarations
- *
- * @param document
- * @param childIndex
- * @return
- */
- private List getAvailableRootChildren(Document document, int childIndex) {
- List list = null;
-
- // extract the valid 'root' node name from the DocumentType Node
- DocumentType docType = document.getDoctype();
- String rootName = null;
- if (docType != null) {
- rootName = docType.getNodeName();
- }
- if (rootName == null) {
- return new ArrayList(0);
- }
-
- for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
- // make sure the "root" Element isn't already present
- // is it required to be an Element?
- if ((child.getNodeType() == Node.ELEMENT_NODE) && child.getNodeName().equalsIgnoreCase(rootName)) {
- // if the node is missing either the start or end tag, don't
- // count it as present
- if ((child instanceof IDOMNode) && ((((IDOMNode) child).getStartStructuredDocumentRegion() == null) || (((IDOMNode) child).getEndStructuredDocumentRegion() == null))) {
- continue;
- }
- if (Debug.displayInfo) {
- System.out.println(rootName + " already present!"); //$NON-NLS-1$
- }
- setErrorMessage(NLS.bind(XMLUIMessages.The_document_element__, (new Object[]{rootName})));
- return new ArrayList(0);
- }
- }
-
- list = new ArrayList(1);
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
- if (cmdoc != null) {
- if (rootName != null) {
- CMElementDeclaration rootDecl = (CMElementDeclaration) cmdoc.getElements().getNamedItem(rootName);
- if (rootDecl != null) {
- list.add(rootDecl);
- }
- else {
- // supply the given document name anyway, even if it
- // is an error
- list.add(new SimpleCMElementDeclaration(rootName));
-
- String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if (location.length() > 0) {
- setErrorMessage(NLS.bind(
- XMLUIMessages.No_definition_for_in,
- (new Object[]{rootName, location})));
- }
- else {
- setErrorMessage(NLS.bind(
- XMLUIMessages.No_definition_for,
- (new Object[]{rootName})));
- }
- }
- }
- }
- else {
- String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if (location.length() > 0) {
- setErrorMessage(NLS.bind(
- XMLUIMessages.No_content_model_for,
- (new Object[]{location})));
- }
- else {
- setErrorMessage(XMLUIMessages.No_content_model_found_UI_);
- }
- }
- }
-
- return list;
- }
-
- /**
- * This method determines if any of the attributes in the proposed XMLNode
- * node, are possible values of attributes from possible Elements at this
- * point in the document according to the Content Model.
- *
- * @param node
- * the element with attributes that you would like to test if
- * are possible for possible Elements at this point
- * @param cmnode
- * possible element at this point in the document (depending on
- * what 'node' is) true if any attributes of 'node' match any
- * possible attributes from 'cmnodes' list.
- */
- private boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
- if ((node == null) || (parent == null) || (cmnode == null)) {
- return false;
- }
- String elementMatchString = node.getNodeName();
- String cmnodeName = getRequiredName(parent, cmnode);// cmnode.getNodeName();
- if (node instanceof Element) {
- NamedNodeMap map = ((Element) node).getAttributes();
- String attrMatchString = ""; //$NON-NLS-1$
- // iterate attribute possibilities for partially started node
- for (int i = 0; (map != null) && (i < map.getLength()); i++) {
- attrMatchString = map.item(i).getNodeName();
- // filter on whatever user typed for element name already
- if (beginsWith(cmnodeName, elementMatchString)) {
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- CMNamedNodeMapImpl attributes = new CMNamedNodeMapImpl(((CMElementDeclaration) cmnode).getAttributes());
- this.addModelQueryAttributeDeclarations(
- node,((CMElementDeclaration) cmnode),attributes);
-
- // iterate possible attributes from a cmnode in
- // proposal list
- for (int k = 0; (attributes != null) && (k < attributes.getLength()); k++) {
- // check if name matches
- if (attributes.item(k).getNodeName().equals(attrMatchString)) {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private Properties mapToProperties(CMNamedNodeMap map) {
- Properties p = new Properties();
- for (int i = 0; i < map.getLength(); i++) {
- CMEntityDeclaration decl = (CMEntityDeclaration) map.item(i);
- p.put(decl.getName(), decl.getValue());
- }
- return p;
- }
-
- /**
- * <p>Adds model query attribute declaration proposals</p>
- *
- * @param node
- * @param elementDecl
- * @param allAttributes
- */
- private void addModelQueryAttributeDeclarations(IDOMNode node,
- CMElementDeclaration elementDecl, CMNamedNodeMapImpl allAttributes) {
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- nodes = filterAvailableModelQueryCMNodes(nodes);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- }
- }
-
- /**
- * returns a list of CMNodes that are available within this parent context
- * Given the grammar shown below and a snippet of XML code (where the '|'
- * indicated the cursor position)
- * the list would return all of the element declarations that are
- * potential child elements of Foo.
- *
- * grammar : Foo -> (A, B, C)
- * snippet : <Foo><A>|
- * result : {A, B, C}
- *
- * TODO cs... do we need to pass in the 'kindOfAction'? Seems to me we
- * could assume it's always an insert.
- *
- * @param parent
- * @param childPosition
- * @param kindOfAction
- * @return
- */
- private List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
- List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE);
- Iterator iterator = modelQueryActions.iterator();
- List cmnodes = new Vector();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
- CMNode actionCMNode = action.getCMNode();
- if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
- cmnodes.add(actionCMNode);
- }
- }
- }
- return cmnodes;
- }
-
- /**
- * returns a list of CMNodes that can be validly inserted at this
- * childPosition
- * Given the grammar shown below and a snippet of XML code (where the '|'
- * indicated the cursor position)
- * the list would return only the element declarations can be inserted
- * while maintaing validity of the content.
- *
- * grammar : Foo -> (A, B, C)
- * snippet : <Foo><A>|
- * result : {B}
- *
- * @param parent
- * @param childPosition
- * @param kindOfAction
- * @return
- */
- private List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
- List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT);
- Iterator iterator = modelQueryActions.iterator();
- List cmnodes = new Vector();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
- CMNode actionCMNode = action.getCMNode();
- if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
- cmnodes.add(actionCMNode);
- }
- }
- }
- return cmnodes;
- }
-
- /**
- * returns a list of ModelQueryActions
- *
- * @param parent
- * @param index
- * @param validityChecking
- * @return
- */
- private List getAvailableModelQueryActionsAtIndex(Element parent, int index, int validityChecking) {
- List list = new ArrayList();
- CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
- if (parentDecl != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- // taken from ActionManagers
- // int editMode = modelQuery.getEditMode();
- int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
- int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES | ModelQuery.INCLUDE_SEQUENCE_GROUPS : ModelQuery.INCLUDE_CHILD_NODES;
- modelQuery.getInsertActions(parent, parentDecl, index, ic, validityChecking, list);
- }
-
- list = filterAvailableModelQueryActions(list);
- return list;
- }
-
- /**
- * <p>Filters out any model query actions that are not valid for this
- * implementation of the model query computer based on the {@link CMNode}
- * of the action.</p>
- *
- * @param modelQueryActions
- * @return the filtered list of {@link ModelQueryAction}s
- */
- private List filterAvailableModelQueryActions(List modelQueryActions) {
- List filtered = new ArrayList(modelQueryActions.size());
-
- Iterator iterator = modelQueryActions.iterator();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if(validModelQueryNode(action.getCMNode())) {
- filtered.add(action);
- }
- }
-
- return filtered;
- }
-
- /**
- * <p>Filters out any model query {@link CMNode}s that are not valid for this
- * implementation of the model query computer</p>
- *
- * @param modelQueryNodes
- * @return the filtered list of {@link CMNode}s
- */
- private List filterAvailableModelQueryCMNodes(List modelQueryNodes) {
- List filtered = new ArrayList(modelQueryNodes.size());
-
- Iterator iterator = modelQueryNodes.iterator();
- while (iterator.hasNext()) {
- CMNode node = (CMNode) iterator.next();
- if(validModelQueryNode(node)) {
- filtered.add(node);
- }
- }
-
- return filtered;
- }
-
- /**
- * <p>Adds a generic doc type proposal</p>
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addDocTypeProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- // if a DocumentElement exists, use that for the root Element name
- String rootname = "unspecified"; //$NON-NLS-1$
- if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
- rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
- }
-
- String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"//UNKNOWN/\" \"unknown.dtd\">"; //$NON-NLS-1$ //$NON-NLS-2$
- ICompletionProposal proposal = new CustomCompletionProposal(
- proposedText, contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(), 10,
- XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE),
- "<!DOCTYPE ... >", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_DOCTYPE);
- // TODO provide special documentation on doc type
- contentAssistRequest.addProposal(proposal);
- }
-
- public static CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (modelQuery != null) {
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- }
- return result;
- }
-
- /**
- * Retrieves cmnode's documentation to display in the completion
- * proposal's additional info. If no documentation exists for cmnode, try
- * displaying parentOrOwner's documentation
- *
- * String any documentation information to display for cmnode.
- * <code>null</code> if there is nothing to display.
- */
- public static String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
- String addlInfo = null;
-
- if (cmnode == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return null;
- }
-
- addlInfo = infoProvider.getInfo(cmnode);
- if ((addlInfo == null) && (parentOrOwner != null)) {
- addlInfo = infoProvider.getInfo(parentOrOwner);
- }
- return addlInfo;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java
deleted file mode 100644
index 66e514ae24..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationExtension;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * Implementation of IContextInformation. Adds knowledge about the information
- * display string such as required attributes for this context.
- *
- * @author pavery
- */
-public class AttributeContextInformation implements IContextInformation, IContextInformationExtension {
- private HashMap fAttr2RangeMap;
- /** The name of the context */
- private String fContextDisplayString;
- /** The image to be displayed */
- private Image fImage;
- /** The information to be displayed */
- private String fInformationDisplayString;
- private int fPosition = -1;
-
- /**
- * Creates a new context information with an image.
- *
- * @param image
- * the image to display when presenting the context information
- * @param contextDisplayString
- * the string to be used when presenting the context
- * @param informationDisplayString
- * the string to be displayed when presenting the context
- * information, may not be <code>null</code>
- */
- public AttributeContextInformation(Image image, String contextDisplayString, String informationDisplayString, HashMap attr2RangeMap) {
- Assert.isNotNull(informationDisplayString, "illegal argument: informationDisplayString can not be null"); //$NON-NLS-1$
-
- fImage = image;
- fContextDisplayString = contextDisplayString;
- fInformationDisplayString = informationDisplayString;
- fAttr2RangeMap = attr2RangeMap;
- }
-
- /**
- * Creates a new context information without an image.
- *
- * @param contextDisplayString
- * the string to be used when presenting the context
- * @param informationDisplayString
- * the string to be displayed when presenting the context
- * information
- */
- public AttributeContextInformation(String contextDisplayString, String informationDisplayString, HashMap attr2RangeMap) {
- this(null, contextDisplayString, informationDisplayString, attr2RangeMap);
- }
-
- /**
- * Maps (String -> Position). The attribute name to the Text position.
- *
- *
- */
- public HashMap getAttr2RangeMap() {
- return fAttr2RangeMap;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
- */
- public String getContextDisplayString() {
- if (fContextDisplayString != null) {
- return fContextDisplayString;
- }
- return fInformationDisplayString;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformationExtension#getContextInformationPosition()
- */
- public int getContextInformationPosition() {
- return fPosition;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
- */
- public Image getImage() {
- return fImage;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
- */
- public String getInformationDisplayString() {
- return fInformationDisplayString;
- }
-
- public void setContextInformationPosition(int position) {
- fPosition = position;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
deleted file mode 100644
index 9871c796bb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-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.contentassist.ContextInformationValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Responsible for the presentation of the context info popup. This includes
- * text style, and when the window should close.
- *
- * @author pavery
- */
-public class AttributeContextInformationPresenter extends ContextInformationValidator implements IContextInformationPresenter {
-
- private IContextInformation fInfo = null;
- private ContextInfoModelUtil fModelUtil = null;
-
- public AttributeContextInformationPresenter() {
- super();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.contentassist.ContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation, org.eclipse.jface.text.ITextViewer, int)
- */
- public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
- super.install(info, viewer, documentPosition);
- this.fInfo = info;
- this.fModelUtil = new ContextInfoModelUtil((IStructuredDocument) viewer.getDocument());
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int,
- * org.eclipse.jface.text.TextPresentation)
- */
- public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
- presentation.clear();
-
- if (!(fInfo instanceof AttributeContextInformation)) {
- return false;
- }
-
- // iterate existing attributes from current node
- IDOMNode xmlNode = fModelUtil.getXMLNode(documentPosition);
- if (xmlNode == null)
- return false;
-
- IStructuredDocumentRegion sdRegion = xmlNode.getFirstStructuredDocumentRegion();
- ITextRegionList regions = sdRegion.getRegions();
- ITextRegion r = null;
- String attrName = ""; //$NON-NLS-1$
- Object temp = null;
- Position p = null;
- HashMap map = ((AttributeContextInformation) fInfo).getAttr2RangeMap();
-
- // so we can add ranges in order
- StyleRange[] sorted = new StyleRange[fInfo.getInformationDisplayString().length()];
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- attrName = sdRegion.getText(r);
- temp = map.get(attrName);
- if (temp != null) {
- p = (Position) temp;
- sorted[p.offset] = new StyleRange(p.offset, p.length, null, null, SWT.BOLD);
- }
- }
- }
- // style ranges need to be added in order
- StyleRange sr = null;
- for (int i = 0; i < sorted.length; i++) {
- sr = sorted[i];
- if (sr != null) {
- presentation.addStyleRange(sr);
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
deleted file mode 100644
index f18d7c88df..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-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.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.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * Calculates attribute context information based on a StructuedDocument and
- * document position.
- *
- * @author pavery
- */
-public class AttributeContextInformationProvider {
- private final IContextInformation[] EMPTY_CONTEXT_INFO = new IContextInformation[0];
- private Comparator fComparator;
-
- private IStructuredDocument fDocument = null;
- private ContextInfoModelUtil fModelUtil = null;
-
- public AttributeContextInformationProvider(IStructuredDocument doc, AttributeContextInformationPresenter presenter) {
- fDocument = doc;
- fModelUtil = new ContextInfoModelUtil(fDocument);
- }
-
- /**
- * @param sdRegion
- *
- */
- private boolean canProposeInfo(IStructuredDocumentRegion sdRegion) {
- if ((sdRegion != null) && isEndTag(sdRegion)) {
- return false;
- }
- else {
- return true;
- }
- }
-
- public IContextInformation[] getAttributeInformation(int offset) {
- /*
- * need to take care of special cases w/ ambiguous regions <tag>|
- * </tag> also end tags..
- */
- IContextInformation[] results = EMPTY_CONTEXT_INFO;
-
- IStructuredDocumentRegion sdRegion = fModelUtil.getDocument().getRegionAtCharacterOffset(offset);
- if (!canProposeInfo(sdRegion)) {
- return EMPTY_CONTEXT_INFO;
- }
-
- IDOMNode node = fModelUtil.getXMLNode(offset);
- if (node != null) {
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE :
- results = getInfoForElement(node);
- break;
- // future...
- // case Node.TEXT_NODE :
- // results = getInfoForText(node);
- // break;
- }
- }
- return results;
- }
-
- /**
- * Returns a comparator that compares CMAttributeDeclaration names.
- *
- * the comparator
- */
- private Comparator getCMAttributeComparator() {
- if (fComparator == null) {
- fComparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((CMAttributeDeclaration) o1).getAttrName().compareTo(((CMAttributeDeclaration) o2).getAttrName());
- }
- };
- }
- return fComparator;
- }
-
- /**
- * @param node
- *
- */
- private IContextInformation[] getInfoForElement(IDOMNode node) {
- IContextInformation[] results = EMPTY_CONTEXT_INFO;
- CMElementDeclaration decl = fModelUtil.getModelQuery().getCMElementDeclaration((Element) node);
- if (decl != null) {
- CMNamedNodeMap attributes = decl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, decl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attributes = allAttributes;
-
- String attrContextString = node.getNodeName();
- StringBuffer attrInfo = new StringBuffer(" "); //$NON-NLS-1$
- String name = ""; //$NON-NLS-1$
- HashMap attrPosMap = new HashMap();
- int pos = 0;
- int length = 0;
- int numPerLine = 8;
-
- CMAttributeDeclaration[] sortedAttrs = getSortedAttributes(attributes);
-
- for (int i = 0; i < sortedAttrs.length; i++) {
- name = sortedAttrs[i].getAttrName();
- length = name.length();
- pos = attrInfo.length();
-
- attrInfo.append(name);
-
- if (sortedAttrs[i].getUsage() == CMAttributeDeclaration.REQUIRED) {
- attrInfo.append("*"); //$NON-NLS-1$
- length++;
- }
- if (i < attributes.getLength() - 1) {
- attrInfo.append(" "); //$NON-NLS-1$
- if ((i != 0) && (i % numPerLine == 0)) {
- attrInfo.append("\n "); //$NON-NLS-1$
- }
- }
- attrPosMap.put(name, new Position(pos, length));
- }
- if (!attrInfo.toString().trim().equals("")) {
- return new IContextInformation[]{new AttributeContextInformation(attrContextString, attrInfo.toString(), attrPosMap)};
- }
- }
- return results;
- }
-
- /**
- * @param node
- *
- */
- IContextInformation[] getInfoForText(IDOMNode node) {
- Node parent = node.getParentNode();
- String contextString = node.getNodeName();
- StringBuffer info = new StringBuffer(" "); //$NON-NLS-1$
- if ((parent != null) && (parent.getNodeType() == Node.ELEMENT_NODE)) {
- CMElementDeclaration decl = fModelUtil.getModelQuery().getCMElementDeclaration((Element) parent);
- CMContent content = decl.getContent();
- if (content instanceof CMGroup) {
- CMGroup cmGroup = (CMGroup) content;
- CMNodeList children = cmGroup.getChildNodes();
- CMNode cmNode = null;
- for (int i = 0; i < children.getLength(); i++) {
- cmNode = children.item(i);
- contextString = cmNode.getNodeName();
- if (contextString != null) {
- info.append("<" + cmNode.getNodeName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- if (i < children.getLength() - 1) {
- info.append(" "); //$NON-NLS-1$
- }
- }
- }
- }
- }
- if (!info.toString().trim().equals("")) {
- return new IContextInformation[]{new ContextInformation(contextString, info.toString())};
- }
- else {
- return EMPTY_CONTEXT_INFO;
- }
- }
-
- /**
- * Returns sorted array of CMAttributeDeclarations.
- *
- * @param attributes
- *
- */
- private CMAttributeDeclaration[] getSortedAttributes(CMNamedNodeMap attributes) {
- List sorted = new ArrayList();
- for (int i = 0; i < attributes.getLength(); i++) {
- sorted.add(attributes.item(i));
- }
- Collections.sort(sorted, getCMAttributeComparator());
- return (CMAttributeDeclaration[]) sorted.toArray(new CMAttributeDeclaration[sorted.size()]);
- }
-
- /**
- * @param sdRegion
- *
- */
- private boolean isEndTag(IStructuredDocumentRegion sdRegion) {
- ITextRegionList regions = sdRegion.getRegions();
- return regions.get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
deleted file mode 100644
index 6a1d3af534..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
+++ /dev/null
@@ -1,260 +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.xml.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-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.utils.StringUtils;
-import org.w3c.dom.Node;
-
-
-public class ContentAssistRequest {
- protected IStructuredDocumentRegion documentRegion = null;
- protected List macros = new ArrayList();
- protected String matchString;
- protected Node node = null;
- protected Node parent = null;
- protected List proposals = new ArrayList();
- protected ITextRegion region = null;
- protected int replacementBeginPosition;
- protected int replacementLength;
-
- // private Boolean separate = null; // (pa) not used
- // private Boolean sort = null; // (pa) not used
- /**
- * XMLContentAssistRequest constructor comment.
- */
- public ContentAssistRequest(Node node, Node parent, IStructuredDocumentRegion documentRegion, ITextRegion completionRegion, int begin, int length, String filter) {
- super();
- setNode(node);
- setParent(parent);
- setDocumentRegion(documentRegion);
- setRegion(completionRegion);
- setMatchString(filter);
- setReplacementBeginPosition(begin);
- setReplacementLength(length);
- }
-
- public void addMacro(ICompletionProposal newProposal) {
- macros.add(newProposal);
- }
-
- public void addProposal(ICompletionProposal newProposal) {
- proposals.add(newProposal);
- }
-
- public ICompletionProposal[] getCompletionProposals() {
- ICompletionProposal results[] = null;
- if ((getProposals().size() > 0) || (getMacros().size() > 0)) {
- List allProposals = new ArrayList();
- if (!shouldSeparate()) {
- allProposals.addAll(getProposals());
- // should be empty, as all macros should have gone into the
- // proposal list
- allProposals.addAll(getMacros());
- allProposals = sortProposals(allProposals);
- }
- else {
- allProposals.addAll(sortProposals(getProposals()));
- allProposals.addAll(sortProposals(getMacros()));
- }
-
- results = new ICompletionProposal[allProposals.size()];
- for (int i = 0; i < allProposals.size(); i++) {
- results[i] = (ICompletionProposal) allProposals.get(i);
- }
- }
- return results;
- }
-
-
- public IStructuredDocumentRegion getDocumentRegion() {
- return documentRegion;
- }
-
- /**
- *
- * @return java.util.List
- */
- public java.util.List getMacros() {
- return macros;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String getMatchString() {
- return matchString;
- }
-
- /**
- *
- * @return org.w3c.dom.Node
- */
- public org.w3c.dom.Node getNode() {
- return node;
- }
-
- /**
- *
- * @return org.w3c.dom.Node
- */
- public org.w3c.dom.Node getParent() {
- return parent;
- }
-
- /**
- *
- * @return java.util.List
- */
- public java.util.List getProposals() {
- return proposals;
- }
-
- public ITextRegion getRegion() {
- return region;
- }
-
- /**
- *
- * @return int
- */
- public int getReplacementBeginPosition() {
- return replacementBeginPosition;
- }
-
- /**
- * @return int
- */
- public int getReplacementLength() {
- return replacementLength;
- }
-
- public int getStartOffset() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getStartOffset(getRegion());
- }
- return -1;
- }
-
- public String getText() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getText(getRegion());
- }
- return ""; //$NON-NLS-1$
- }
-
- public int getTextEndOffset() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getTextEndOffset(getRegion());
- }
- return -1;
- }
-
- /**
- * @param region
- */
- public void setDocumentRegion(IStructuredDocumentRegion region) {
- documentRegion = region;
- }
-
- /**
- *
- * @param newMatchString
- * java.lang.String
- */
- public void setMatchString(java.lang.String newMatchString) {
- matchString = newMatchString;
- }
-
- /**
- *
- * @param newNode
- * org.w3c.dom.Node
- */
- public void setNode(org.w3c.dom.Node newNode) {
- node = newNode;
- }
-
- /**
- *
- * @param newParent
- * org.w3c.dom.Node
- */
- public void setParent(org.w3c.dom.Node newParent) {
- parent = newParent;
- }
-
- /**
- *
- * @param newRegion
- */
- public void setRegion(ITextRegion newRegion) {
- region = newRegion;
- }
-
- /**
- *
- * @param newReplacementBeginPosition
- * int
- */
- public void setReplacementBeginPosition(int newReplacementBeginPosition) {
- replacementBeginPosition = newReplacementBeginPosition;
- }
-
-
- public void setReplacementLength(int newReplacementLength) {
- replacementLength = newReplacementLength;
- }
-
- public boolean shouldSeparate() {
- /*
- * if (separate == null) { PreferenceManager manager =
- * getPreferenceManager(); if(manager == null) { separate =
- * Boolean.FALSE; } else { Element caSettings =
- * manager.getElement(PreferenceNames.CONTENT_ASSIST); separate = new
- * Boolean(caSettings.getAttribute(PreferenceNames.SEPARATE).equals(PreferenceNames.TRUE)); } }
- * return separate.booleanValue();
- */
- return false;
- }
-
- protected List sortProposals(List proposalsIn) {
- Collections.sort(proposalsIn, new ProposalComparator());
- return proposalsIn;
-
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String toString() {
- return "Node: " + getNode() //$NON-NLS-1$
- + "\nParent: " + getParent() //$NON-NLS-1$
- + "\nStructuredDocumentRegion: " + StringUtils.escape(getDocumentRegion().toString()) //$NON-NLS-1$
- + "\nRegion: " + getRegion() //$NON-NLS-1$
- + "\nMatch string: '" + StringUtils.escape(getMatchString()) + "'" //$NON-NLS-2$//$NON-NLS-1$
- + "\nOffsets: [" + getReplacementBeginPosition() + "-" + (getReplacementBeginPosition() + getReplacementLength()) + "]\n"; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
deleted file mode 100644
index a0c1c81f23..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-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.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-/**
- * @author pavery
- */
-public class ContextInfoModelUtil {
- IStructuredDocument fDocument = null;
-
- ContextInfoModelUtil(IStructuredDocument doc) {
- fDocument = doc;
- }
-
- public IStructuredDocument getDocument() {
- return fDocument;
- }
-
- public ModelQuery getModelQuery() {
- ModelQuery mq = null;
-
- IStructuredModel xmlModel = null;
- try {
- xmlModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- mq = ModelQueryUtil.getModelQuery(xmlModel);
- }
- finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return mq;
- }
-
- public IDOMNode getXMLNode(int offset) {
- IStructuredModel xmlModel = null;
- IDOMNode xmlNode = null;
- try {
- xmlModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- if (xmlModel != null) {
- xmlNode = (IDOMNode) xmlModel.getIndexedRegion(offset);
- }
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
- return xmlNode;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
deleted file mode 100644
index f19dd90858..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +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.xml.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-/**
- * Purpose of this class is to make the additional proposal info into content
- * fit for an HTML viewer (by escaping characters)
- */
-class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
- // copies of this class exist in:
- // org.eclipse.jst.jsp.ui.internal.contentassist
- // org.eclipse.wst.html.ui.internal.contentassist
- // org.eclipse.wst.xml.ui.internal.contentassist
-
- public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
- super(template, context, region, image, relevance);
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- return StringUtils.convertToHTMLContent(additionalInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java
deleted file mode 100644
index 5b4024ff53..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java
+++ /dev/null
@@ -1,200 +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.wst.xml.ui.internal.contentassist;
-
-import java.util.Properties;
-import java.util.Vector;
-
-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.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <p>Default implementation of the {@link AbstractXMLCompletionProposalComputer}, defaults are to do nothing</p>
- */
-public class DefaultXMLCompletionProposalComputer extends
- AbstractXMLCompletionProposalComputer {
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
- */
- public void sessionStarted() {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addCommentProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addCommentProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addDocTypeProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addDocTypeProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEndTagNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEndTagProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEntityProposals(
- ContentAssistRequest contentAssistRequest,
- ITextRegion completionRegion, IDOMNode treeNode,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(java.util.Vector, java.util.Properties, java.lang.String, int, org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEntityProposals(Vector proposals, Properties map,
- String key, int nodeOffset, IStructuredDocumentRegion sdRegion,
- ITextRegion completionRegion,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addPCDATAProposal(java.lang.String, org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addPCDATAProposal(String nodeName,
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addStartDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagCloseProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagNameProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
deleted file mode 100644
index c713a224d0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-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.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-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.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-
-/**
- * ContentAssistProcessor to handle special cases in content assist where the
- * partitioner cannot determine a partition type at the current cursor
- * position (usually at EOF).
- *
- * @author pavery
- * @deprecated This class is no longer used locally and will be removed in the future
- */
-public class NoRegionContentAssistProcessor implements IContentAssistProcessor, IReleasable {
-
- private static final boolean DEBUG = false;
- protected char completionProposalAutoActivationCharacters[] = null;
- protected char contextInformationAutoActivationCharacters[] = null;
-
- private final ICompletionProposal[] EMPTY_PROPOSAL_SET = new ICompletionProposal[0];
- protected String fErrorMessage = null;
- private HashMap fNameToProcessorMap = null;
- private HashMap fPartitionToProcessorMap = null;
-
- public NoRegionContentAssistProcessor() {
- super();
- }
-
- protected void addPartitionProcessor(String key, IContentAssistProcessor processor) {
- addProcessor(getPartitionToProcessorMap(), key, processor);
- }
-
- protected void addNameProcessor(String key, IContentAssistProcessor processor) {
- addProcessor(getNameToProcessorMap(), key, processor);
- }
-
- protected IContentAssistProcessor getPartitionProcessor(String key) {
- return (IContentAssistProcessor) getPartitionToProcessorMap().get(key);
- }
-
- /**
- * Ensures release if it's a duplicate partition type.
- *
- * @param map
- * @param key
- * @param processor
- */
- private void addProcessor(HashMap map, String key, IContentAssistProcessor processor) {
- Object o = map.remove(key);
- if (o != null) {
- if (o instanceof IReleasable) {
- ((IReleasable) o).release();
- }
- }
- map.put(key, processor);
- }
-
- /**
- * Figures out what the correct ICompletionProposalProcessor is and
- * computesCompletionProposals on that.
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- IContentAssistProcessor p = null;
- ICompletionProposal[] results = EMPTY_PROPOSAL_SET;
-
- p = guessContentAssistProcessor(viewer, documentOffset);
- if (p != null) {
- results = p.computeCompletionProposals(viewer, documentOffset);
- }
-
- return (results != null) ? results : EMPTY_PROPOSAL_SET;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- // get context info from processor that we end up using...
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return completionProposalAutoActivationCharacters;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return contextInformationAutoActivationCharacters;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- // return the validator for the content assist processor that we
- // used...
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- private HashMap getNameToProcessorMap() {
- if (fNameToProcessorMap == null) {
- fNameToProcessorMap = new HashMap();
- initNameToProcessorMap();
- }
- return fNameToProcessorMap;
- }
-
- private HashMap getPartitionToProcessorMap() {
- if (fPartitionToProcessorMap == null) {
- fPartitionToProcessorMap = new HashMap();
- initPartitionToProcessorMap();
- }
- return fPartitionToProcessorMap;
- }
-
- /**
- * Gives you the document partition type (String) for the given
- * StructuredTextViewer and documentPosition.
- *
- * @param viewer
- * @param documentPosition
- * @return String
- */
- protected String getPartitionType(StructuredTextViewer viewer, int documentPosition) {
- IDocument document = viewer.getDocument();
- String partitionType = null;
- ITypedRegion partition = null;
- try {
- partition = document.getPartition(documentPosition);
- partitionType = partition.getType();
- }
- catch (BadLocationException e) {
- partitionType = null;
- }
- return partitionType;
- }
-
- /**
- * Guesses a ContentAssistProcessor based on the TextViewer and
- * documentOffset.
- *
- * @param viewer
- * @param documentOffset
- */
- protected IContentAssistProcessor guessContentAssistProcessor(ITextViewer viewer, int documentOffset) {
- // mapping logic here...
- // look @ previous region
- // look @ previous doc partition type
- // look @ page language
- IContentAssistProcessor p = null;
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentOffset);
- if (sdRegion != null) {
- String currentRegionType = sdRegion.getType();
- // System.out.println("current region type is >> " +
- // currentRegionType);
- if (currentRegionType == DOMRegionContext.UNDEFINED) {
- IStructuredDocumentRegion sdPrev = sdRegion.getPrevious();
- if (sdPrev != null) {
- if (DEBUG) {
- String prevRegionType = sdPrev.getType();
- System.out.println("previous region type is >> " + prevRegionType); //$NON-NLS-1$
- }
- }
- }
- }
- // working w/ viewer & document partition
- if ((p == null) && (viewer.getDocument().getLength() > 0)) {
- String prevPartitionType = getPartitionType((StructuredTextViewer) viewer, documentOffset - 1);
- // System.out.println("previous partition type is > " +
- // prevPartitionType);
- p = (IContentAssistProcessor) getPartitionToProcessorMap().get(prevPartitionType);
- }
- return p;
- }
-
- /**
- * Inits map for extra ContentAssistProcessors (useBean, get/setProperty)
- */
- protected void initNameToProcessorMap() {
- // nothing to do in this case
- }
-
- /**
- * Adds all relevent ContentAssistProcessors to the partition to processor
- * map (just XML here)
- */
- protected void initPartitionToProcessorMap() {
- XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor();
- addProcessor(getPartitionToProcessorMap(), IXMLPartitions.XML_DEFAULT, xmlProcessor);
- }
-
- public void release() {
- releasePartitionToProcessorMap();
- releaseNameToProcessorMap();
- }
-
- protected void releaseMap(HashMap map) {
- if ((map != null) && !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;
- }
- }
-
- protected void releaseNameToProcessorMap() {
- releaseMap(fNameToProcessorMap);
- }
-
- protected void releasePartitionToProcessorMap() {
- releaseMap(fPartitionToProcessorMap);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java
deleted file mode 100644
index 24a397dcf6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java
+++ /dev/null
@@ -1,159 +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.xml.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class NonValidatingModelQueryAction implements org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction {
-
- protected CMNode cmnode = null;
- protected int endIndex = 0;
- protected int kind = INSERT;
- protected int startIndex = 0;
- protected Object userData = null;
-
- /**
- * NonValidatingModelQueryAction constructor comment.
- */
- protected NonValidatingModelQueryAction() {
- super();
- }
-
- /**
- * NonValidatingModelQueryAction constructor comment.
- */
- public NonValidatingModelQueryAction(CMNode newChild, int newKind, int newStart, int newEnd, Object newUserData) {
- super();
- cmnode = newChild;
- kind = newKind;
- startIndex = newStart;
- endIndex = newEnd;
- userData = newUserData;
- }
-
- /**
- * getCMNode method comment.
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNode getCMNode() {
- return cmnode;
- }
-
- /**
- *
- * @return int
- */
- public int getEndIndex() {
- return endIndex;
- }
-
- /**
- *
- * @return int
- */
- public int getKind() {
- return kind;
- }
-
- /**
- * getParent method comment.
- */
- public org.w3c.dom.Node getParent() {
- return null;
- }
-
- /**
- *
- * @return int
- */
- public int getStartIndex() {
- return startIndex;
- }
-
- /**
- * getUserData method comment.
- */
- public Object getUserData() {
- return null;
- }
-
- /**
- * performAction method comment.
- */
- public void performAction() {
- }
-
- /**
- * setCMNode method comment.
- */
- protected void setCMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode newNode) {
- cmnode = newNode;
- }
-
- /**
- *
- * @param newEndIndex
- * int
- */
- protected void setEndIndex(int newEndIndex) {
- endIndex = newEndIndex;
- }
-
- /**
- *
- * @param newKind
- * int
- */
- protected void setKind(int newKind) {
- kind = newKind;
- }
-
- /**
- *
- * @param newStartIndex
- * int
- */
- protected void setStartIndex(int newStartIndex) {
- startIndex = newStartIndex;
- }
-
- /**
- * setUserData method comment.
- */
- public void setUserData(Object object) {
- }
-
- /**
- *
- * @return java.lang.String
- */
- public String toString() {
- String actionName = null;
- switch (kind) {
- case INSERT :
- actionName = "INSERT";//$NON-NLS-1$
- break;
- case REMOVE :
- actionName = "REMOVE";//$NON-NLS-1$
- break;
- case REPLACE :
- actionName = "REPLACE";//$NON-NLS-1$
- break;
- default :
- actionName = "UNKNOWN ACTION ";//$NON-NLS-1$
- }
- String nodeName = (cmnode != null) ? getCMNode().getNodeName() : "(unknown)";//$NON-NLS-1$
- return actionName + "=" + nodeName + "(" + startIndex + "..." + endIndex + ")";//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
deleted file mode 100644
index ee6e8e8a66..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
+++ /dev/null
@@ -1,49 +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.xml.ui.internal.contentassist;
-
-
-
-import java.util.Comparator;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-
-public class ProposalComparator implements Comparator {
-
-
- public int compare(Object o1, Object o2) {
- int relevance = 0;
- if ((o1 instanceof IRelevanceCompletionProposal) && (o2 instanceof IRelevanceCompletionProposal)) {
- // sort based on relevance
- IRelevanceCompletionProposal cp1 = (IRelevanceCompletionProposal) o1;
- IRelevanceCompletionProposal cp2 = (IRelevanceCompletionProposal) o2;
-
- relevance = cp2.getRelevance() - cp1.getRelevance();
-
- // if same relevance, secondary sort (lexigraphically)
- if ((relevance == 0) && (o1 instanceof ICompletionProposal) && (o2 instanceof ICompletionProposal)) {
- String displayString1 = ((ICompletionProposal) o1).getDisplayString();
- String displayString2 = ((ICompletionProposal) o2).getDisplayString();
- if ((displayString1 != null) && (displayString2 != null)) {
- // relevance = displayString1.compareTo(displayString2);
- // // this didn't mix caps w/ lowercase
- relevance = com.ibm.icu.text.Collator.getInstance().compare(displayString1, displayString2);
- }
- }
- }
- // otherwise if it's not ISEDRelevanceCompletionProposal, don't sort
- return relevance;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java
deleted file mode 100644
index 0d9f11ecd7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.xml.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;
-import org.eclipse.jface.text.templates.TemplateVariable;
-
-/**
- * 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);
- String templateName = template.getName().toLowerCase();
- if (buffer != null) {
- if ((fInsertOffset > -1) && (fInsertOffset > getStart())) {
- String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
- if (!templateName.startsWith(prefix.toLowerCase())) {
- // generate a new buffer that actually contains the
- // text that was going to be overwritten
- int prefixSize = prefix.length();
- TemplateVariable[] newTemplateVar = buffer.getVariables();
- for (int i =0; i < newTemplateVar.length; i++ ){
- int[] offsets = newTemplateVar[i].getOffsets();
- for (int j=0; j<offsets.length ;j++){
- offsets[j] += prefixSize;
- }
- }
- buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
- }
- }
- }
- return buffer;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java
deleted file mode 100644
index 41a607aa0e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java
+++ /dev/null
@@ -1,170 +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.xml.ui.internal.contentassist;
-
-
-
-public class SimpleCMElementDeclaration implements org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration {
-
- String fNodeName;
-
- /**
- * SimpleCMELementDeclaration constructor comment.
- */
- public SimpleCMElementDeclaration() {
- super();
- }
-
- public SimpleCMElementDeclaration(String nodeName) {
- super();
- setNodeName(nodeName);
- }
-
- /**
- * getAttributes method
- *
- * @return CMNamedNodeMap
- *
- * Returns CMNamedNodeMap of AttributeDeclaration
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap getAttributes() {
- return null;
- }
-
- /**
- * getCMContent method
- *
- * @return CMContent
- *
- * Returns the root node of this element's content model. This can be an
- * CMElementDeclaration or a CMGroup
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMContent getContent() {
- return null;
- }
-
- /**
- * getContentType method
- *
- * @return int
- *
- * Returns one of : ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
- */
- public int getContentType() {
- return 0;
- }
-
- /**
- * getDataType method
- *
- * @return java.lang.String
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMDataType getDataType() {
- return null;
- }
-
- /**
- * getElementName method
- *
- * @return java.lang.String
- */
- public String getElementName() {
- return null;
- }
-
- /**
- * getLocalElements method
- *
- * @return CMNamedNodeMap
- *
- * Returns a list of locally defined elements.
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap getLocalElements() {
- return null;
- }
-
- /**
- * getMaxOccur method
- *
- * @return int
- *
- * If -1, it's UNBOUNDED.
- */
- public int getMaxOccur() {
- return 0;
- }
-
- /**
- * getMinOccur method
- *
- * @return int
- *
- * If 0, it's OPTIONAL. If 1, it's REQUIRED.
- */
- public int getMinOccur() {
- return 0;
- }
-
- /**
- *
- * @return java.lang.String
- */
- public java.lang.String getNodeName() {
- return fNodeName;
- }
-
- /**
- * getNodeType method
- *
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return 0;
- }
-
- /**
- * getProperty method
- *
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- return null;
- }
-
- /**
- *
- * @param newNodeName
- * java.lang.String
- */
- public void setNodeName(java.lang.String newNodeName) {
- fNodeName = newNodeName;
- }
-
- /**
- * supports method
- *
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java
deleted file mode 100644
index fe16777023..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java
+++ /dev/null
@@ -1,48 +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.xml.ui.internal.contentassist;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-/**
- * @deprecated use internal XMLEditorPluginImageHelper or external
- * SharedXMLEditorPluginImageHelper instead
- */
-public class SourceEditorImageHelper {
-
- public SourceEditorImageHelper() {
- super();
- }
-
- public Image createImage(String resource) {
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, resource);
- Image image = desc.createImage();
- JFaceResources.getImageRegistry().put(resource, image);
- return image;
- }
-
- public Image getImage(String resource) {
- Image image = JFaceResources.getImageRegistry().get(resource);
- if (image == null) {
- image = createImage(resource);
- }
- return image;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java
deleted file mode 100644
index 20d4451819..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-/**
- * @deprecated This class is no longer used locally and will be removed in the future
- * @see XMLStructuredContentAssistProcessor
- */
-public class XMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
-
- protected IPreferenceStore fPreferenceStore = null;
- protected IResource fResource = null;
- private XMLTemplateCompletionProcessor fTemplateProcessor = null;
- private List fTemplateContexts = new ArrayList();
-
- public XMLContentAssistProcessor() {
- super();
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE);
- super.addAttributeNameProposals(contentAssistRequest);
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE_VALUE);
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.NEW);
- super.addEmptyDocumentProposals(contentAssistRequest);
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.TAG);
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
- addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- * @param startOffset
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
- if (contentAssistRequest == null) {
- return;
- }
-
- // if already adding template proposals for a certain context type, do
- // not add again
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList) {
- contentAssistRequest.addProposal(proposals[i]);
- }
- else {
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
- }
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- // bug115927 use original document position for all/any region
- // templates
- addTemplates(request, TemplateContextTypeIdsXML.ALL, documentPosition);
- return request;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xml.ui.contentassist.AbstractContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
- fTemplateContexts.clear();
- return super.computeCompletionProposals(textViewer, documentPosition);
- }
-
- protected IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null) {
- fPreferenceStore = XMLUIPlugin.getDefault().getPreferenceStore();
- }
- return fPreferenceStore;
- }
-
- private XMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new XMLTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-
- protected void init() {
- getPreferenceStore().addPropertyChangeListener(this);
- reinit();
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
-
- if ((property.compareTo(XMLUIPreferenceNames.AUTO_PROPOSE) == 0) || (property.compareTo(XMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0)) {
- reinit();
- }
- }
-
- protected void reinit() {
- String key = XMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = XMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- }
- else {
- completionProposalAutoActivationCharacters = null;
- }
- }
-
- public void release() {
- super.release();
- getPreferenceStore().removePropertyChangeListener(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
deleted file mode 100644
index 4aa4b346c8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
+++ /dev/null
@@ -1,516 +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.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.osgi.util.NLS;
-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.util.ScriptLanguageKeys;
-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.IDOMElement;
-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.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author pavery
- */
-public class XMLContentAssistUtilities extends ContentAssistUtils {
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private class DOMJSPRegionContextsPrivateCopy {
- private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
- private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
- private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
- }
-
-
- public static final String CONTENT = "Content"; //$NON-NLS-1$
- public static final String CONTENT_SCRIPT_TYPE = "Content-Script-Type"; //$NON-NLS-1$
- public static final String HEAD = "HEAD"; //$NON-NLS-1$
- public static final String HTML = "HTML"; //$NON-NLS-1$
- public static final String HTTP_EQUIV = "HTTP-EQUIV"; //$NON-NLS-1$
- public static final String META = "META"; //$NON-NLS-1$
-
- /**
- * A convenience method for getting the closing proposal given the
- * contents (IndexedRegion) of a tag that is started, but possibly not
- * ended
- *
- * @param viewer
- * the text viewer
- * @param documentPosition
- * the cursor position in the viewer
- * @param indexedNode
- * the contents of the tag that is started but possibly not
- * ended
- * @param parentTagName
- * the tag on which you are checkin for an ending tag
- * @param imagePath
- * content assist image relative path
- * @return ICompletionProposal
- */
- public static ICompletionProposal computeJSPEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
- ICompletionProposal p = null;
-
- // check if tag is closed
- boolean hasEndTag = true;
- boolean isJSPTag = false;
- IDOMNode xnode = null;
- String tagName = ""; //$NON-NLS-1$
- if (indexedNode instanceof IDOMNode) {
- xnode = ((IDOMNode) indexedNode);
- // it's ended already...
- if (xnode.getEndStructuredDocumentRegion() != null) {
- return null;
- }
- IDOMNode openNode = null;
- if (!xnode.getNodeName().equalsIgnoreCase(parentTagName)) {
- openNode = (IDOMNode) xnode.getParentNode();
- }
- if (openNode != null) {
- if (openNode instanceof IDOMElement) {
- isJSPTag = ((IDOMElement) openNode).isJSPTag();
- }
- tagName = openNode.getNodeName();
- hasEndTag = (openNode.getEndStructuredDocumentRegion() != null);
- }
- }
-
- // it's closed, don't add close tag proposal
- if (!hasEndTag && !isJSPTag) {
-
- // create appropriate close tag text
- String proposedText = "</" + tagName; //$NON-NLS-1$
- String viewerText = viewer.getTextWidget().getText();
- if ((viewerText.length() >= documentPosition) && (viewerText.length() >= 2) && (documentPosition >= 2)) {
- String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
- if (last2chars.endsWith("</")) {
- proposedText = tagName;
- }
- else if (last2chars.endsWith("<")) {
- proposedText = "/" + tagName; //$NON-NLS-1$
- }
- }
-
- // create proposal
- p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
- documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})), null, null, XMLRelevanceConstants.R_END_TAG);
- }
- else if (!hasEndTag && isJSPTag) {
-
- // create appropriate close tag text
- String proposedText = "%"; //$NON-NLS-1$
- String viewerText = viewer.getTextWidget().getText();
-
- // TODO (pa) make it smarter to add "%>" or just ">" if % is
- // already there...
- if ((viewerText.length() >= documentPosition) && (viewerText.length() >= 2)) {
- String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
- String lastchar = viewerText.substring(documentPosition - 1, documentPosition);
- if (lastchar.equals("%")) //$NON-NLS-1$
- {
- if (last2chars.endsWith("<%")) {
- proposedText = "%"; //$NON-NLS-1$
- }
- else {
- proposedText = ""; //$NON-NLS-1$
- }
- }
- }
-
- // create proposal
- p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
- documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})), null, null, XMLRelevanceConstants.R_END_TAG);
- }
-
- return p;
- }
-
-
- /**
- * A convenience method for getting the closing proposal given the
- * contents (IndexedRegion) of a tag that is started, but possibly not
- * ended
- *
- * @param viewer
- * the text viewer
- * @param documentPosition
- * the cursor position in the viewer
- * @param indexedNode
- * the contents of the tag that is started but possibly not
- * ended
- * @param parentTagName
- * the tag on which you are checkin for an ending tag
- * @param imagePath
- * content assist relative image path
- * @return ICompletionProposal
- */
- public static ICompletionProposal computeXMLEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
- ICompletionProposal p = null;
-
- // check if tag is closed
- boolean hasEndTag = true;
- IDOMNode xnode = null;
- String tagName = ""; //$NON-NLS-1$
- if (indexedNode instanceof IDOMNode) {
- xnode = ((IDOMNode) indexedNode);
- // it's ended already...
- if (xnode.getEndStructuredDocumentRegion() != null) {
- return null;
- }
- IDOMNode styleNode = null;
- if (!xnode.getNodeName().equalsIgnoreCase(parentTagName)) {
- styleNode = (IDOMNode) xnode.getParentNode();
- }
- if (styleNode != null) {
- tagName = styleNode.getNodeName();
- hasEndTag = (styleNode.getEndStructuredDocumentRegion() != null);
- }
- }
-
- // it's closed, don't add close tag proposal
- if (!hasEndTag) {
-
- // create appropriate close tag text
- String proposedText = "</" + tagName; //$NON-NLS-1$
- String viewerText = viewer.getTextWidget().getText();
- if ((viewerText.length() >= documentPosition) && (viewerText.length() >= 2) && (documentPosition >= 2)) {
- String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
- if (last2chars.endsWith("</")) {
- proposedText = tagName;
- }
- else if (last2chars.endsWith("<")) {
- proposedText = "/" + tagName; //$NON-NLS-1$
- }
- }
-
- // create proposal
- p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
- documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})), null, null, XMLRelevanceConstants.R_END_TAG);
- }
- return p;
- }
-
- private static String getMetaScriptType(Document doc) {
- // Can not just do a Document.getElementsByTagName(String) as this
- // needs
- // to be relatively fast.
- List metas = new ArrayList();
- // check for META tags under the Document
- Node html = null;
- Node head = null;
- Node child = null;
- // ----------------------------------------------------------------------
- // (pa) 20021217
- // cmvc defect 235554
- // performance enhancement: using child.getNextSibling() rather than
- // nodeList(item) for O(n) vs. O(n*n)
- // ----------------------------------------------------------------------
-
- for (child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE) {
- continue;
- }
- if (child.getNodeName().equalsIgnoreCase(META)) {
- metas.add(child);
- }
- else if (child.getNodeName().equalsIgnoreCase(HTML)) {
- html = child;
- }
- }
- // NodeList children = doc.getChildNodes();
- // for(int i = 0; i < children.getLength(); i++) {
- // child = children.item(i);
- // if(child.getNodeType() != Node.ELEMENT_NODE)
- // continue;
- // if(child.getNodeName().equalsIgnoreCase(META))
- // metas.add(child);
- // else if(child.getNodeName().equalsIgnoreCase(HTML))
- // html = child;
- // }
-
- // check for META tags under HEAD
- if (html != null) {
- for (child = html.getFirstChild(); (child != null) && (head == null); child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE) {
- continue;
- }
- if (child.getNodeName().equalsIgnoreCase(HEAD)) {
- head = child;
- }
- }
- // children = html.getChildNodes();
- // for(int i = 0; i < children.getLength() && head == null; i++) {
- // child = children.item(i);
- // if(child.getNodeType() != Node.ELEMENT_NODE)
- // continue;
- // if(child.getNodeName().equalsIgnoreCase(HEAD))
- // head = child;
- // }
- }
-
- if (head != null) {
- for (head.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE) {
- continue;
- }
- if (child.getNodeName().equalsIgnoreCase(META)) {
- metas.add(child);
- }
- }
- // children = head.getChildNodes();
- // for(int i = 0 ; i < children.getLength(); i++) {
- // child = children.item(i);
- // if(child.getNodeType() != Node.ELEMENT_NODE)
- // continue;
- // if(child.getNodeName().equalsIgnoreCase(META))
- // metas.add(child);
- // }
- }
-
- return getMetaScriptType(metas);
- }
-
- private static String getMetaScriptType(List metaNodeList) {
- Node meta = null;
- NamedNodeMap attributes = null;
- boolean httpEquiv = false;
- String contentScriptType = null;
-
- for (int i = metaNodeList.size() - 1; i >= 0; i--) {
- meta = (Node) metaNodeList.get(i);
- attributes = meta.getAttributes();
- httpEquiv = false;
- contentScriptType = null;
- for (int j = 0; j < attributes.getLength(); j++) {
- if (attributes.item(j).getNodeName().equalsIgnoreCase(HTTP_EQUIV)) {
- httpEquiv = attributes.item(j).getNodeValue().equalsIgnoreCase(CONTENT_SCRIPT_TYPE);
- }
- else if (attributes.item(j).getNodeName().equalsIgnoreCase(CONTENT)) {
- contentScriptType = attributes.item(j).getNodeValue();
- }
- }
- if (httpEquiv && (contentScriptType != null)) {
- return contentScriptType;
- }
- }
- return null;
- }
-
- /**
- * Returns the scripting language the scriptNode is in Currently returns
- * javascript unless some unknown type or language is specified. Then the
- * unknown type/language is returned
- *
- * @param scriptNode
- */
- public static String getScriptLanguage(Node scriptNode) {
- Node attr = null;
-
- boolean specified = false;
- // try to find a scripting adapter for 'type'
- if ((scriptNode == null) || (scriptNode.getAttributes() == null)) {
- return null;
- }
-
- attr = scriptNode.getAttributes().getNamedItem("type");//$NON-NLS-1$
- if (attr != null) {
- specified = true;
- String type = attr.getNodeValue();
- return lookupScriptType(type);
- }
- // now try to find a scripting adapter for 'language' (deprecated by
- // HTML specifications)
- attr = scriptNode.getAttributes().getNamedItem("language");//$NON-NLS-1$
- if (attr != null) {
- specified = true;
- String language = attr.getNodeValue();
- return lookupScriptLanguage(language);
- }
- // check if one is specified by a META tag at the root level or inside
- // of HEAD
- String type = null;
- if (!specified) {
- type = getMetaScriptType(scriptNode.getOwnerDocument());
- }
- if (type != null) {
- specified = true;
- return lookupScriptType(type);
- }
- // return default
- if (!specified) {
- return ScriptLanguageKeys.JAVASCRIPT;
- }
- return null;
- }
-
- /**
- * Tells you if the flatnode is the %> delimiter
- *
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isJSPCloseDelimiter(IStructuredDocumentRegion fn) {
- if (fn == null) {
- return false;
- }
- return isJSPCloseDelimiter(fn.getType());
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isJSPCloseDelimiter(String type) {
- if (type == null) {
- return false;
- }
- return (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) || type.equals(DOMRegionContext.XML_TAG_CLOSE));
- }
-
- /**
- * Tells you if the flatnode is the JSP region <%%>, <%=%>, <%!%>
- *
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isJSPDelimiter(IStructuredDocumentRegion fn) {
- boolean isDelimiter = false;
- String type = fn.getType();
- if (type != null) {
- isDelimiter = isJSPDelimiter(type);
- }
- return isDelimiter;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isJSPDelimiter(String type) {
- if (type == null) {
- return false;
- }
- return (isJSPOpenDelimiter(type) || isJSPCloseDelimiter(type));
- }
-
- /**
- * Tells you if the flatnode is <%, <%=, or <%! ISSUE: this is a bit of
- * hidden JSP knowledge that was implemented this way for expedency.
- * Should be evolved in future to depend on "nestedContext".
- */
- public static boolean isJSPOpenDelimiter(IStructuredDocumentRegion fn) {
- if (fn == null) {
- return false;
- }
- return isJSPOpenDelimiter(fn.getType());
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isJSPOpenDelimiter(String type) {
- if (type == null) {
- return false;
- }
- return (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN));
- }
-
- /**
- * Tells you if the flatnode is the <jsp:scriptlet>, <jsp:expression>, or
- * <jsp:declaration>tag
- *
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- public static boolean isXMLJSPDelimiter(IStructuredDocumentRegion fn) {
- boolean isDelimiter = false;
- if ((fn != null) && (fn instanceof ITextRegionContainer)) {
- Object[] regions = ((ITextRegionContainer) fn).getRegions().toArray();
- ITextRegion temp = null;
- String regionText = ""; //$NON-NLS-1$
- for (int i = 0; i < regions.length; i++) {
- temp = (ITextRegion) regions[i];
- if (temp.getType() == DOMRegionContext.XML_TAG_NAME) {
- regionText = fn.getText(temp);
- if (regionText.equalsIgnoreCase("jsp:scriptlet") || regionText.equalsIgnoreCase("jsp:expression") || regionText.equalsIgnoreCase("jsp:declaration")) {
- isDelimiter = true;
- }
- }
- }
- }
- return isDelimiter;
- }
-
- /**
- * Returns "javascript" if language attribute is some form of javascript,
- * "java" if language attribute is some form of java. Otherwise, just
- * returns type.
- *
- * @param language
- */
- public static String lookupScriptLanguage(String language) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++) {
- if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language)) {
- return ScriptLanguageKeys.JAVASCRIPT;
- }
- }
- for (int i = 0; i < ScriptLanguageKeys.JAVA_LANGUAGE_KEYS.length; i++) {
- if (ScriptLanguageKeys.JAVA_LANGUAGE_KEYS[i].equalsIgnoreCase(language)) {
- return ScriptLanguageKeys.JAVA;
- }
- }
- return language;
- }
-
- /**
- * Returns "javascript" if type (used in <script type="xxx"> is actually
- * javascript type. Otherwise, just returns type
- *
- * @param type
- */
- public static String lookupScriptType(String type) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++) {
- if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type)) {
- return ScriptLanguageKeys.JAVASCRIPT;
- }
- }
- return type;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java
deleted file mode 100644
index 2896432813..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java
+++ /dev/null
@@ -1,154 +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.wst.xml.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class XMLContentModelGenerator extends AbstractContentModelGenerator {
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private class DOMJSPRegionContextsPrivateCopy {
- private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
- }
-
- /**
- * XMLContentModelGenerator constructor comment.
- */
- public XMLContentModelGenerator() {
- super();
- }
-
- public void generateAttribute(CMAttributeDeclaration attrDecl, StringBuffer buffer) {
- if ((attrDecl == null) || (buffer == null)) {
- return;
- }
- int usage = attrDecl.getUsage();
- if (usage == CMAttributeDeclaration.REQUIRED) {
- buffer.append(" "); //$NON-NLS-1$
- generateRequiredAttribute(null, attrDecl, buffer); // todo pass
- // ownerNode as
- // 1st param
- }
- return;
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null) {
- return;
- }
- if (elementDecl.getContentType() != CMElementDeclaration.EMPTY) {
- buffer.append("</" + tagName + ">");//$NON-NLS-2$//$NON-NLS-1$
- }
- return;
- }
-
- public void generateRequiredAttribute(Node ownerNode, CMAttributeDeclaration attrDecl, StringBuffer buffer) {
- if ((attrDecl == null) || (buffer == null)) {
- return;
- }
-
- // attribute name
- String attributeName = getRequiredName(ownerNode, attrDecl);
- CMDataType attrType = attrDecl.getAttrType();
- String defaultValue = null;
- // = sign
- buffer.append(attributeName + "="); //$NON-NLS-1$
- // attribute value
- if (attrType != null) {
- // insert any value that is implied
- if ((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (attrType.getImpliedValue() != null)) {
- defaultValue = attrType.getImpliedValue();
- }
- // otherwise, if an enumerated list of values exists, use the
- // first value
- else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
- defaultValue = attrType.getEnumeratedValues()[0];
- }
- }
-
- char attrQuote = '\"';
- // Found a double quote, wrap the attribute in single quotes
- if(defaultValue != null && defaultValue.indexOf(attrQuote) >= 0) {
- attrQuote = '\'';
- }
-
- buffer.append(attrQuote);
- buffer.append(((defaultValue != null) ? defaultValue : "")); //$NON-NLS-1$
- buffer.append(attrQuote);
- return;
- }
-
- protected void generateStartTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if ((elementDecl == null) || (buffer == null)) {
- return;
- }
- buffer.append("<" + tagName);//$NON-NLS-1$
- generateAttributes(elementDecl, buffer);
- buffer.append(getStartTagClose(parentNode, elementDecl));
- return;
- }
-
- public int getMinimalStartTagLength(Node node, CMElementDeclaration elementDecl) {
- if (elementDecl == null) {
- return 0;
- }
- if (requiresAttributes(elementDecl)) {
- return getRequiredName(node, elementDecl).length() + 2; // < +
- // name +
- // space
- }
- else {
- return 1 + getRequiredName(node, elementDecl).length() + getStartTagClose(node, elementDecl).length(); // < +
- // name
- // +
- // appropriate
- // close
- }
- }
-
- protected String getOtherClose(Node notATagNode) {
- if (notATagNode instanceof IDOMNode) {
- IStructuredDocumentRegion node = ((IDOMNode) notATagNode).getStartStructuredDocumentRegion();
- if ((node != null) && (node.getNumberOfRegions() > 1) && node.getRegions().get(0).getType().equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN)) {
- return "%>"; //$NON-NLS-1$
- }
- }
- return null;
- }
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null) {
- return other;
- }
- if (elementDecl == null) {
- return ">";//$NON-NLS-1$
- }
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- return "/>"; //$NON-NLS-1$
- }
- return ">"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
deleted file mode 100644
index 8fc14570e9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
-
-
-
-/**
- * some relevance constants for content assist higher relevance means it shows
- * up higher on the list
- */
-public interface XMLRelevanceConstants extends IRelevanceConstants {
-
- int R_CDATA = 400;
- int R_CLOSE_TAG = 1500;
-
- int R_COMMENT = 100;
-
- // moved this above macros
- int R_DOCTYPE = 600;
- int R_END_TAG = 1400;
- int R_END_TAG_NAME = 1100;
- int R_ENTITY = 1000;
- int R_JSP = 500;
-
- int R_JSP_ATTRIBUTE_VALUE = 700;
-
- // (pa) make these the same relevance so proposals are same order for V501
- int R_MACRO = 500;
-
- // add this onto "required" attrs, elements, etc to bubble them up on
- // sorting...
- // CMVC 246618
- int R_REQUIRED = 10;
- int R_TAG_INSERTION = 500;
- int R_STRICTLY_VALID_TAG_INSERTION = 600;
- int R_TAG_NAME = 1200;
- int R_STRICTLY_VALID_TAG_NAME = 1250;
- int R_XML_ATTRIBUTE_NAME = 900;
- int R_XML_ATTRIBUTE_VALUE = 800;
- int R_XML_DECLARATION = 1300;
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java
deleted file mode 100644
index 6588e5d0b2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.contentassist;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-
-/**
- * <p>Implementation of {@link StructuredContentAssistProcessor} for XML documents</p>
- *
- * <p>This implementation will react to user preference changes for auto activation
- * characters for XML pages</p>
- *
- * @see StructuredContentAssistProcessor
- */
-public class XMLStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
- /** the auto activation characters for this processor, set by user preference */
- private char[] fCompletionProposalAutoActivationCharacters;
-
- /** the context information validator for this processor */
- private IContextInformationValidator fContextInformationValidator;
-
- /**
- * <p>Constructor</p>
- *
- * @param assistant {@link ContentAssistant} to use
- * @param partitionTypeID the partition type this processor is for
- * @param viewer {@link ITextViewer} this processor is acting in
- */
- public XMLStructuredContentAssistProcessor(ContentAssistant assistant,
- String partitionTypeID, ITextViewer viewer) {
-
- super(assistant, partitionTypeID, viewer, XMLUIPlugin.getDefault().getPreferenceStore());
- getAutoActivationCharacterPreferences();
- updateAutoActivationDelay();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- if (this.fContextInformationValidator == null) {
- this.fContextInformationValidator = new AttributeContextInformationPresenter();
- }
- return this.fContextInformationValidator;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return super.getCompletionProposalAutoActivationCharacters() != null ? super.getCompletionProposalAutoActivationCharacters() : this.fCompletionProposalAutoActivationCharacters;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
- * org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(XMLUIPreferenceNames.AUTO_PROPOSE) ||
- event.getProperty().equals(XMLUIPreferenceNames.AUTO_PROPOSE_CODE)) {
- getAutoActivationCharacterPreferences();
- }else if (event.getProperty().equals(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY)) {
- updateAutoActivationDelay();
- }
- }
-
-
-
- /**
- * <p>Sets the auto activation delay in Content Assist</p>
- */
- private void updateAutoActivationDelay() {
- IPreferenceStore store = getPreferenceStore();
- boolean doAuto = store.getBoolean(XMLUIPreferenceNames.AUTO_PROPOSE);
- if (doAuto) {
- setAutoActivationDelay(store.getInt(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY));
- }
-
- }
-
-
- protected void getAutoActivationCharacterPreferences() {
- String key = XMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = XMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- fCompletionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- }
- else {
- fCompletionProposalAutoActivationCharacters = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java
deleted file mode 100644
index ae03566e81..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * <p>{@link AbstractXMLModelQueryCompletionProposalComputer} used to
- * generate XML tag content assist proposals</p>
- *
- * <p><b>NOTE:</b> Currently this computer does not filter out any of the
- * model query results so it will return all proposals from the model query
- * for the current content type. In the future this may need to change.</p>
- */
-public class XMLTagsCompletionProposalComputer extends
- AbstractXMLModelQueryCompletionProposalComputer {
-
- /** the generated used to generate the proposals */
- protected XMLContentModelGenerator fGenerator;
-
- /** the context information validator for this computer */
- private IContextInformationValidator fContextInformationValidator;
-
- /**
- * <p>Default constructor</p>
- */
- public XMLTagsCompletionProposalComputer() {
- this.fContextInformationValidator = null;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getContentGenerator()
- */
- protected XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- fGenerator = new XMLContentModelGenerator();
- }
- return fGenerator;
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- AttributeContextInformationProvider attributeInfoProvider =
- new AttributeContextInformationProvider((IStructuredDocument)context.getDocument(),
- (AttributeContextInformationPresenter) getContextInformationValidator());
- return Arrays.asList(attributeInfoProvider.getAttributeInformation(context.getInvocationOffset()));
- }
-
- /**
- * <p>Filters out any model query actions that are not specific to XML</p>
- * <p><b>NOTE:</b> Currently nothing is filtered so this computer returns all
- * results from the model query for the current content type</p>
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
- */
- protected boolean validModelQueryNode(CMNode node) {
- return true;
- }
-
- /**
- * 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.
- *
- * a context information validator, or <code>null</code> if the
- * processor is incapable of computing context information
- */
- private IContextInformationValidator getContextInformationValidator() {
- if (fContextInformationValidator == null) {
- fContextInformationValidator = new AttributeContextInformationPresenter();
- }
- return fContextInformationValidator;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java
deleted file mode 100644
index d0bb83c785..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-/**
- * <p>Completion computer for XML templates</p>
- */
-class XMLTemplateCompletionProcessor 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 XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_MACRO);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return XMLUIPlugin.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 XMLUIPlugin.getDefault().getTemplateStore();
- }
-
- void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java
deleted file mode 100644
index 287baaaec3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java
+++ /dev/null
@@ -1,124 +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.wst.xml.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-/**
- * <p>Proposal computer used to computer XML template content assist
- * proposals</p>
- */
-public class XMLTemplatesCompletionProposalComputer extends
- DefaultXMLCompletionProposalComputer {
-
- /** <p>The template processor used to create the proposals</p> */
- private XMLTemplateCompletionProcessor fTemplateProcessor = null;
-
- /**
- * Create the computer
- */
- public XMLTemplatesCompletionProposalComputer() {
- super();
- fTemplateProcessor = new XMLTemplateCompletionProcessor();
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE_VALUE, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.NEW, context);
- }
-
- /**
- * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.TAG, context);
- }
-
- /**
- * <p>Adds templates to the list of proposals</p>
- *
- * @param contentAssistRequest
- * @param templateContext
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
- CompletionProposalInvocationContext context) {
-
- if (contentAssistRequest != null) {
-
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (fTemplateProcessor != null) {
- fTemplateProcessor.setContextType(templateContext);
- ICompletionProposal[] proposals =
- fTemplateProcessor.computeCompletionProposals(
- context.getViewer(), context.getInvocationOffset());
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList) {
- contentAssistRequest.addProposal(proposals[i]);
- }
- else {
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
- }
-
- public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
- List list = new ArrayList(super.computeCompletionProposals(context, monitor));
-
- if (fTemplateProcessor != null) {
- fTemplateProcessor.setContextType(TemplateContextTypeIdsXML.ALL);
- ICompletionProposal[] proposals = fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
- if (proposals != null) {
- for (int i = 0; i < proposals.length; i++) {
- list.add(proposals[i]);
- }
- }
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
deleted file mode 100644
index 0ea3570340..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapter implements IJFaceNodeAdapter {
-
- final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
-
- /**
- * debug .option
- */
- private static final boolean DEBUG = getDebugValue();
-
- private static boolean getDebugValue() {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
- boolean result = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- return result;
- }
-
- JFaceNodeAdapterFactory fAdapterFactory;
- RefreshStructureJob fRefreshJob = null;
-
- public JFaceNodeAdapter(JFaceNodeAdapterFactory adapterFactory) {
- super();
- this.fAdapterFactory = adapterFactory;
- }
-
- protected Image createImage(Object object) {
- Image image = null;
- Node node = (Node) object;
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
- break;
- }
- case Node.ATTRIBUTE_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- break;
- }
- case Node.TEXT_NODE : { // actually, TEXT should never be seen in
- // the tree
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
- break;
- }
- case Node.CDATA_SECTION_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_CDATASECTION);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE :
- case Node.ENTITY_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ENTITY);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION);
- break;
- }
- case Node.COMMENT_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_COMMENT);
- break;
- }
- case Node.DOCUMENT_TYPE_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_DOCTYPE);
- break;
- }
- case Node.NOTATION_NODE : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_NOTATION);
- break;
- }
- default : {
- image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
- break;
- }
- }
- return image;
- }
-
- protected Image createXMLImageDescriptor(String imageResourceName) {
- return XMLEditorPluginImageHelper.getInstance().getImage(imageResourceName);
- }
-
- public Object[] getChildren(Object object) {
-
- // (pa) 20021217
- // cmvc defect 235554
- // performance enhancement: using child.getNextSibling() rather than
- // nodeList(item) for O(n) vs. O(n*n)
- //
- ArrayList v = new ArrayList();
- if (object instanceof Node) {
- Node node = (Node) object;
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- Node n = child;
- if (n.getNodeType() != Node.TEXT_NODE) {
- v.add(n);
- }
- }
- }
- return v.toArray();
- }
-
- /**
- * Returns an enumeration with the elements belonging to the passed
- * element. These are the top level items in a list, tree, table, etc...
- */
- public Object[] getElements(Object node) {
- return getChildren(node);
- }
-
- /**
- * Fetches the label image specific to this object instance.
- */
- public Image getLabelImage(Object node) {
- Image image = null;
- if (node instanceof Node) {
- // check for an image from the content model
- image = CMImageUtil.getImage(CMImageUtil.getDeclaration((Node) node));
- if (image == null) {
- /*
- * Create/get image based on Node type. Images are cached
- * transparently in this class, subclasses must do this for
- * themselves if they're going to return their own results.
- */
- image = createImage(node);
- }
- }
- return image;
- }
-
- /**
- * Fetches the label text specific to this object instance.
- */
- public String getLabelText(Object node) {
- return getNodeName(node);
- }
-
- private String getNodeName(Object object) {
- StringBuffer nodeName = new StringBuffer();
- if (object instanceof Node) {
- Node node = (Node) object;
- nodeName.append(node.getNodeName());
-
- if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- nodeName.insert(0, "DOCTYPE:"); //$NON-NLS-1$
- }
-
- }
- return nodeName.toString();
- }
-
-
- public Object getParent(Object object) {
- if (object instanceof Node) {
- Node node = (Node) object;
- return node.getParentNode();
- }
- return null;
- }
-
- private synchronized RefreshStructureJob getRefreshJob() {
- if (fRefreshJob == null) {
- fRefreshJob = new RefreshStructureJob();
- }
- return fRefreshJob;
- }
-
-
- public boolean hasChildren(Object object) {
- // (pa) 20021217
- // cmvc defect 235554 > use child.getNextSibling() instead of
- // nodeList(item) for O(n) vs. O(n*n)
- Node node = (Node) object;
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.TEXT_NODE) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- if (type == null) {
- return false;
- }
- return type.equals(ADAPTER_KEY);
- }
-
- /**
- * Called by the object being adapter (the notifier) when something has
- * changed.
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // future_TODO: the 'uijobs' used in this method were added to solve
- // threading problems when the dom
- // is updated in the background while the editor is open. They may be
- // a bit overkill and not that useful.
- // (That is, may be be worthy of job manager management). If they are
- // found to be important enough to leave in,
- // there's probably some optimization that can be done.
- if (notifier instanceof Node) {
- Collection listeners = fAdapterFactory.getListeners();
- Iterator iterator = listeners.iterator();
-
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
- // if (notifier instanceof Node && (listener instanceof
- // StructuredViewer) && (eventType ==
- // INodeNotifier.STRUCTURE_CHANGED || (eventType ==
- // INodeNotifier.CHANGE && changedFeature == null))) {
- if ((listener instanceof StructuredViewer) && ((eventType == INodeNotifier.STRUCTURE_CHANGED) || (eventType == INodeNotifier.CONTENT_CHANGED) || (eventType == INodeNotifier.CHANGE))) {
- if (DEBUG) {
- System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
- }
-
- // refresh on structural and "unknown" changes
- StructuredViewer structuredViewer = (StructuredViewer) listener;
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
- if (structuredViewer.getControl() != null) {
- getRefreshJob().refresh(structuredViewer, (Node) notifier);
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
deleted file mode 100644
index 3943403b34..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
+++ /dev/null
@@ -1,183 +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.xml.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-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.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-/**
- * An adapter factory to create JFaceNodeAdapters. Use this adapter factory
- * with a JFaceAdapterContentProvider to display DOM nodes in a tree.
- */
-public class JFaceNodeAdapterFactory extends AbstractAdapterFactory implements IJFaceNodeAdapterFactory {
- public class CMDocumentManagerListenerImpl implements CMDocumentManagerListener {
- private static final int UPDATE_DELAY = 200;
-
- public void cacheCleared(CMDocumentCache cache) {
- // nothing to do
- }
-
- public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
- if ((newStatus == CMDocumentCache.STATUS_LOADED) || (newStatus == CMDocumentCache.STATUS_ERROR)) {
- refreshViewers();
- }
- }
-
- public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
- if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
- refreshViewers();
- }
- }
-
- private void refreshViewers() {
- Object[] listeners = getListeners().toArray();
- for (int i = 0; i < listeners.length; i++) {
- if (listeners[i] instanceof StructuredViewer) {
- final StructuredViewer viewer = (StructuredViewer) listeners[i];
- Job refresh = new UIJob(XMLUIMessages.refreshoutline_0) {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Control refreshControl = viewer.getControl();
- if ((refreshControl != null) && !refreshControl.isDisposed()) {
- viewer.refresh(true);
- }
- return Status.OK_STATUS;
- }
- };
- refresh.setSystem(true);
- refresh.setPriority(Job.SHORT);
- refresh.schedule(UPDATE_DELAY);
- }
- else if (listeners[i] instanceof Viewer) {
- final Viewer viewer = (Viewer) listeners[i];
- Job refresh = new UIJob(XMLUIMessages.refreshoutline_0) {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Control refreshControl = viewer.getControl();
- if ((refreshControl != null) && !refreshControl.isDisposed()) {
- viewer.refresh();
- }
- return Status.OK_STATUS;
- }
- };
- refresh.setSystem(true);
- refresh.setPriority(Job.SHORT);
- refresh.schedule(UPDATE_DELAY);
- }
- }
- }
- }
-
- private CMDocumentManager cmDocumentManager;
- private CMDocumentManagerListenerImpl fCMDocumentManagerListener = null;
- /**
- * This keeps track of all the listeners.
- */
- private Set fListeners = new HashSet();
-
- protected INodeAdapter singletonAdapter;
-
- public JFaceNodeAdapterFactory() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public synchronized void addListener(Object listener) {
- fListeners.add(listener);
- }
-
- public INodeAdapterFactory copy() {
- return new JFaceNodeAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
- }
-
- /**
- * Create a new JFace adapter for the DOM node passed in
- */
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new JFaceNodeAdapter(this);
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-
-
- /**
- * returns "copy" so no one can modify our list. It is a shallow copy.
- */
- public synchronized Collection getListeners() {
- return new ArrayList(fListeners);
- }
-
- protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
- Assert.isTrue(cmDocumentManager == null);
- Assert.isTrue(fCMDocumentManagerListener == null);
-
- // register for CMDocumentManager events
- ModelQueryAdapter mqadapter = (ModelQueryAdapter) node.getAdapterFor(ModelQueryAdapter.class);
- if (mqadapter != null) {
- ModelQuery mquery = mqadapter.getModelQuery();
- if ((mquery != null) && (mquery.getCMDocumentManager() != null)) {
- cmDocumentManager = mquery.getCMDocumentManager();
- fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
- cmDocumentManager.addListener(fCMDocumentManagerListener);
- }
- }
- }
-
- public void release() {
- // deregister from CMDocumentManager events
- if ((cmDocumentManager != null) && (fCMDocumentManagerListener != null)) {
- cmDocumentManager.removeListener(fCMDocumentManagerListener);
- }
- fListeners.clear();
- if (singletonAdapter != null && singletonAdapter instanceof JFaceNodeAdapter) {
- RefreshStructureJob refreshJob = ((JFaceNodeAdapter) singletonAdapter).fRefreshJob;
- if (refreshJob != null) {
- refreshJob.cancel();
- }
- }
- }
-
- public synchronized void removeListener(Object listener) {
- fListeners.remove(listener);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java
deleted file mode 100644
index f3c5452f80..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java
+++ /dev/null
@@ -1,120 +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.xml.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-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.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-/**
- * An ITreeContentProvider for a TreeViewers used to display DOM nodes. This
- * content provider takes an adapter factory to create JFace adapters for the
- * nodes in the tree.
- */
-public class JFaceNodeContentProvider implements ITreeContentProvider {
-
- public JFaceNodeContentProvider() {
- super();
- }
-
- /**
- * The visual part that is using this content provider is about to be
- * disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- }
-
- /**
- * Returns the JFace adapter for the specified object.
- *
- * @param adaptable
- * java.lang.Object The object to get the adapter for
- */
- protected IJFaceNodeAdapter getAdapter(Object adaptable) {
- if (adaptable instanceof INodeNotifier) {
- INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
- if (adapter instanceof IJFaceNodeAdapter) {
- return (IJFaceNodeAdapter) adapter;
- }
- }
- return null;
- }
-
- public Object[] getChildren(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
-
- if (adapter != null) {
- return adapter.getChildren(object);
- }
-
- return new Object[0];
- }
-
- public Object[] getElements(Object object) {
- // The root is usually an instance of an XMLStructuredModel in
- // which case we want to extract the document.
- Object topNode = object;
- if (object instanceof IDOMModel) {
- topNode = ((IDOMModel) object).getDocument();
- }
-
- IJFaceNodeAdapter adapter = getAdapter(topNode);
-
- if (adapter != null) {
- return adapter.getElements(topNode);
- }
-
- return new Object[0];
- }
-
- public Object getParent(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
-
- if (adapter != null) {
- return adapter.getParent(object);
- }
-
- return null;
- }
-
- public boolean hasChildren(Object object) {
- IJFaceNodeAdapter adapter = getAdapter(object);
-
- if (adapter != null) {
- return adapter.hasChildren(object);
- }
-
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if ((oldInput != null) && (oldInput instanceof IStructuredModel)) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) oldInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.removeListener(viewer);
- }
- }
- if ((newInput != null) && (newInput instanceof IStructuredModel)) {
- IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) newInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
- if (factory != null) {
- factory.addListener(viewer);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
deleted file mode 100644
index 6168ddebcf..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
+++ /dev/null
@@ -1,81 +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.wst.xml.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-
-/**
- * A (column) label provider backed by JFaceNodeAdapters.
- */
-public class JFaceNodeLabelProvider extends ColumnLabelProvider {
- /**
- * JFaceNodeLabelProvider constructor comment.
- */
- public JFaceNodeLabelProvider() {
- super();
- }
-
- /**
- * Returns the JFace adapter for the specified object.
- *
- * @param adaptable
- * java.lang.Object The object to get the adapter for
- */
- protected IJFaceNodeAdapter getAdapter(Object adaptable) {
- if (adaptable instanceof INodeNotifier) {
- INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
- if (adapter instanceof IJFaceNodeAdapter) {
- return (IJFaceNodeAdapter) adapter;
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- IJFaceNodeAdapter adapter = getAdapter(element);
- if (adapter != null)
- return adapter.getLabelImage(element);
- return super.getImage(element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- IJFaceNodeAdapter adapter = getAdapter(element);
- if (adapter != null)
- return adapter.getLabelText(element);
- return super.getText(element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object,
- * java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
deleted file mode 100644
index 55c93901e5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
+++ /dev/null
@@ -1,368 +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.xml.ui.internal.contentoutline;
-
-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.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * This job holds a queue of updates (affected nodes) for multiple structured
- * viewers. When a new request comes in, the current run is cancelled, the new
- * request is added to the queue, then the job is re-scheduled. Support for
- * multiple structured viewers is required because refresh updates are usually
- * triggered by model changes, and the model may be visible in more than one
- * viewer.
- *
- * @author pavery
- */
-class RefreshStructureJob extends Job {
-
- /** debug flag */
- static final boolean DEBUG;
- private static final long UPDATE_DELAY = 300;
- static {
- String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/refreshStructure"); //$NON-NLS-1$
- DEBUG = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- /** List of refresh requests (Nodes) */
- private final List fRefreshes;
- /** List of update requests (Nodes) */
- private final List fUpdates;
- /** List of update requests (Nodes) */
- private final List fUpdateProperties;
- /** the structured viewers */
- Set fRefreshViewers = new HashSet(3);
- Set fUpdateViewers = new HashSet(3);
-
- public RefreshStructureJob() {
- super(XMLUIMessages.refreshoutline_0);
- setPriority(Job.LONG);
- setSystem(true);
- fRefreshes = new ArrayList(5);
- fUpdates = new ArrayList(5);
- fUpdateProperties = new ArrayList(5);
- }
-
- private synchronized void addUpdateRequest(Node newNodeRequest, String[] updateProperties) {
- /*
- * If we get to here, either from existing request list being zero
- * length, or no exisitng requests "matched" new request, then add the
- * new request.
- */
- fUpdates.add(newNodeRequest);
- fUpdateProperties.add(updateProperties);
- }
-
- private synchronized void addUpdateViewer(StructuredViewer viewer) {
- fUpdateViewers.add(viewer);
- }
-
- private synchronized void addRefreshRequest(Node newNodeRequest) {
- /*
- * note: the caller must NOT pass in null node request (which, since
- * private method, we do not need to gaurd against here, as long as we
- * gaurd against it in calling method.
- */
- int size = fRefreshes.size();
- for (int i = 0; i < size; i++) {
- Node existingNodeRequest = (Node) fRefreshes.get(i);
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=157427 If we
- * already have a request which equals the new request, discard
- * the new request
- */
- if (existingNodeRequest.equals(newNodeRequest)) {
- return;
- }
- /*
- * If we already have a request which contains the new request,
- * discard the new request
- */
- if (contains(existingNodeRequest, newNodeRequest)) {
- return;
- }
- /*
- * If new request contains any existing requests, replace it with
- * new request. ISSUE: technically, we should replace ALL
- * contained, existing requests (such as if many siblings already
- * que'd up when their common parent is then requested, but, I'm
- * not sure if that occurs much, in practice, or if there's an
- * algorithm to quickly find them all. Actually, I guess we could
- * just go through the _rest_ of the list (i+1 to size) and remove
- * any that are contained by new request ... in future :) .
- */
- if (contains(newNodeRequest, existingNodeRequest)) {
- fRefreshes.set(i, newNodeRequest);
- return;
- }
- }
- /*
- * If we get to here, either from existing request list being zero
- * length, or no exisitng requests "matched" new request, then add the
- * new request.
- */
- fRefreshes.add(newNodeRequest);
- }
-
- private synchronized void addRefreshViewer(StructuredViewer viewer) {
- fRefreshViewers.add(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#canceling()
- */
- protected void canceling() {
- fUpdates.clear();
- fUpdateViewers.clear();
- super.canceling();
- }
-
- /**
- * Simple hierarchical containment relationship. Note, this method returns
- * "false" if the two nodes are equal!
- *
- * @param root
- * @param possible
- * @return if the root is parent of possible, return true, otherwise
- * return false
- */
- private boolean contains(Node root, Node possible) {
- if (DEBUG) {
- System.out.println("=============================================================================================================="); //$NON-NLS-1$
- System.out.println("recursive call w/ root: " + root.getNodeName() + " and possible: " + possible); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("--------------------------------------------------------------------------------------------------------------"); //$NON-NLS-1$
- }
-
- // the following checks are important
- // #document node will break the algorithm otherwise
-
- // can't contain the child if it's null
- if (root == null) {
- if (DEBUG) {
- System.out.println("returning false: root is null"); //$NON-NLS-1$
- }
- return false;
- }
- // nothing can be parent of Document node
- if (possible instanceof Document) {
- if (DEBUG) {
- System.out.println("returning false: possible is Document node"); //$NON-NLS-1$
- }
- return false;
- }
- // document contains everything
- if (root instanceof Document) {
- if (DEBUG) {
- System.out.println("returning true: root is Document node"); //$NON-NLS-1$
- }
- return true;
- }
-
- // check parentage
- Node current = possible;
- // loop parents
- while ((current != null) && (current.getNodeType() != Node.DOCUMENT_NODE)) {
- // found it
- if (root.equals(current)) {
- if (DEBUG) {
- System.out.println(" !!! found: " + possible.getNodeName() + " in subelement of: " + root.getNodeName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return true;
- }
- current = current.getParentNode();
- }
- // never found it
- return false;
- }
-
- /**
- * Refresh must be on UI thread because it's on a SWT widget.
- *
- * @param node
- */
- private void doRefresh(final Node node, final StructuredViewer[] viewers) {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (DEBUG) {
- System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- for (int i = 0; i < viewers.length; i++) {
- if (!viewers[i].getControl().isDisposed()) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- viewers[i].refresh(true);
- }
- else {
- viewers[i].refresh(node, true);
- }
- }
- else {
- if (DEBUG) {
- System.out.println(" !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
- }
- }
- }
- }
- });
- }
-
- /**
- * Update must be on UI thread because it's on a SWT widget.
- *
- * @param node
- */
- private void doUpdate(final StructuredViewer[] viewers, final Node node, final String[] properties) {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (DEBUG) {
- System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- for (int i = 0; i < viewers.length; i++) {
- if (!viewers[i].getControl().isDisposed()) {
- viewers[i].update(node, properties);
- }
- else {
- if (DEBUG) {
- System.out.println(" !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
- }
- }
- }
- }
- });
- }
-
- /**
- * This method also synchronized because it accesses the fRefreshes queue
- * and fRefreshViewers list
- *
- * @return an array containing and array of the currently requested Nodes
- * to refresh and the viewers in which to refresh them
- */
- private synchronized Object[] getRefreshRequests() {
- Node[] toRefresh = (Node[]) fRefreshes.toArray(new Node[fRefreshes.size()]);
- fRefreshes.clear();
-
- StructuredViewer[] viewers = (StructuredViewer[]) fRefreshViewers.toArray(new StructuredViewer[fRefreshViewers.size()]);
- fRefreshViewers.clear();
-
- return new Object[]{toRefresh, viewers};
- }
-
- /**
- * This method also synchronized because it accesses the fUpdates queue
- * and fUpdateViewers list
- *
- * @return an array containing and array of the currently requested Nodes
- * to refresh and the viewers in which to refresh them
- */
- private synchronized Object[] getUpdateRequests() {
- Node[] toUpdate = (Node[]) fUpdates.toArray(new Node[fUpdates.size()]);
- fUpdates.clear();
-
- StructuredViewer[] viewers = (StructuredViewer[]) fUpdateViewers.toArray(new StructuredViewer[fUpdateViewers.size()]);
- fUpdateViewers.clear();
-
- String[][] properties = (String[][]) fUpdateProperties.toArray(new String[fUpdateProperties.size()][]);
- fUpdateProperties.clear();
-
- return new Object[]{toUpdate, viewers, properties};
- }
-
- /**
- * Invoke a refresh on the viewer on the given node.
- *
- * @param node
- */
- public void refresh(StructuredViewer viewer, Node node) {
- if (node == null) {
- return;
- }
-
- addRefreshViewer(viewer);
- addRefreshRequest(node);
- schedule(UPDATE_DELAY);
- }
-
- /**
- * Invoke a refresh on the viewer on the given node.
- *
- * @param node
- */
- public void update(StructuredViewer viewer, Node node, String[] properties) {
- if (node == null) {
- return;
- }
-
- addUpdateViewer(viewer);
- addUpdateRequest(node, properties);
- schedule(UPDATE_DELAY);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- performUpdates();
-
- performRefreshes(monitor);
- }
- finally {
- monitor.done();
- }
- return status;
- }
-
- private void performRefreshes(IProgressMonitor monitor) {
- // Retrieve BOTH viewers and Nodes on one block
- Object[] requests = getRefreshRequests();
- Node[] nodes = (Node[]) requests[0];
- StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
-
- for (int i = 0; i < nodes.length; i++) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- doRefresh(nodes[i], viewers);
- }
- }
-
- private void performUpdates() {
- // Retrieve BOTH viewers and Nodes on one block
- Object[] requests = getUpdateRequests();
- Node[] nodes = (Node[]) requests[0];
- StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
- String[][] properties = (String[][]) requests[2];
-
- for (int i = 0; i < nodes.length; i++) {
- doUpdate(viewers, nodes[i], properties[i]);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java
deleted file mode 100644
index f858071966..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java
+++ /dev/null
@@ -1,53 +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.xml.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.ui.internal.actions.AbstractNodeActionManager;
-import org.w3c.dom.Node;
-
-
-public class XMLNodeActionManager extends AbstractNodeActionManager {
- public XMLNodeActionManager(IStructuredModel model, Viewer viewer) {
- super(model, ModelQueryUtil.getModelQuery(model), viewer);
- }
-
- public void reformat(Node newElement, boolean deep) {
- try {
- // tell the model that we are about to make a big model change
- fModel.aboutToChangeModel();
-
- // format selected node
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(newElement);
- }
- finally {
- // tell the model that we are done with the big model change
- fModel.changedModel();
- }
- }
-
- public void setModel(IStructuredModel newModel) {
- fModel = newModel;
- setModelQuery(ModelQueryUtil.getModelQuery(newModel));
- }
-
- protected void setModelQuery(ModelQuery newModelQuery) {
- modelQuery = newModelQuery;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
deleted file mode 100644
index 2c11048950..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
+++ /dev/null
@@ -1,51 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-/**
- * Correction assistant for XML
- *
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class CorrectionAssistantProviderXML extends CorrectionAssistantProvider {
-
- public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = null;
-
- if (sourceViewer != null) {
- ContentAssistant assistant = new ContentAssistant();
-
- if (sourceViewer != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DEFAULT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
- }
- ca = assistant;
- }
-
- return ca;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java
deleted file mode 100644
index 97e73e73f0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickFixProcessor;
-import org.eclipse.wst.sse.ui.internal.correction.StructuredCorrectionProcessor;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class CorrectionProcessorXML extends StructuredCorrectionProcessor {
- protected IQuickAssistProcessor fQuickAssistProcessor;
- protected IQuickFixProcessor fQuickFixProcessor;
-
- public CorrectionProcessorXML(ISourceViewer sourceViewer) {
- super(sourceViewer);
- }
-
- protected IQuickAssistProcessor getQuickAssistProcessor() {
- if (fQuickAssistProcessor == null) {
- fQuickAssistProcessor = new QuickAssistProcessorXML();
- }
-
- return fQuickAssistProcessor;
- }
-
- protected IQuickFixProcessor getQuickFixProcessor() {
- if (fQuickFixProcessor == null) {
- fQuickFixProcessor = new QuickFixProcessorXML();
- }
-
- return fQuickFixProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java
deleted file mode 100644
index 74947edfd4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java
+++ /dev/null
@@ -1,180 +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.xml.ui.internal.correction;
-
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-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.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-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.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class InsertRequiredAttrsQuickAssistProposal implements ICompletionProposal, ICompletionProposalExtension2 {
- private final List fRequiredAttrs;
-
- /**
- * @param requiredAttrs
- */
- public InsertRequiredAttrsQuickAssistProposal(List requiredAttrs) {
- fRequiredAttrs = requiredAttrs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
- */
- public void apply(IDocument document) {
- // not implemented?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
- * char, int, int)
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- int index = startStructuredDocumentRegion.getEndOffset();
- ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion();
- if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) {
- index--;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- else if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- index = index - 2;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- try {
- for (int i = 0; i < fRequiredAttrs.size(); i++) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) fRequiredAttrs.get(i);
- String requiredAttributeName = attrDecl.getAttrName();
- String defaultValue = attrDecl.getDefaultValue();
- if (defaultValue == null) {
- defaultValue = ""; //$NON-NLS-1$
- }
- String nameAndDefaultValue = " "; //$NON-NLS-1$
- if ((i == 0) && (lastRegion.getLength() > lastRegion.getTextLength())) {
- nameAndDefaultValue = ""; //$NON-NLS-1$
- }
- nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$//$NON-NLS-2$
- multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
- // BUG3381: MultiTextEdit applies all child TextEdit's basing
- // on offsets
- // in the document before the first TextEdit, not after each
- // child TextEdit. Therefore, do not need to advance the
- // index.
- // index += nameAndDefaultValue.length();
- }
- multiTextEdit.apply(viewer.getDocument());
- }
- catch (BadLocationException e) {
- // log, for now, unless we find there's reasons why we get some
- // here.
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return XMLUIMessages.InsertRequiredAttrsQuickAssistProposal_0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
- */
- public IContextInformation getContextInformation() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- return XMLUIMessages.InsertRequiredAttrsQuickAssistProposal_1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
- */
- public Image getImage() {
- // return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ADD_CORRECTION);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
- */
- public Point getSelection(IDocument document) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
- * boolean)
- */
- public void selected(ITextViewer viewer, boolean smartToggle) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
- */
- public void unselected(ITextViewer viewer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
- * int, org.eclipse.jface.text.DocumentEvent)
- */
- public boolean validate(IDocument document, int offset, DocumentEvent event) {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
deleted file mode 100644
index 8bebba4bfd..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-public interface ProblemIDsXML extends org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML {
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
deleted file mode 100644
index 486c6c980a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-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.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickAssistProcessor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor and XMLQuickAssistProcessor
- */
-public class QuickAssistProcessorXML implements IQuickAssistProcessor {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.correction.IQuickAssistProcessor#canAssist(org.eclipse.wst.sse.core.text.IStructuredDocument,
- * int)
- */
- public boolean canAssist(StructuredTextViewer viewer, int offset) {
- return true;
- }
-
- /**
- * @param proposals
- * @param viewer
- * @param offset
- */
- protected void getInsertRequiredAttrs(ArrayList proposals, StructuredTextViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- if ((node != null) && (node.getNodeType() == Node.ELEMENT_NODE)) {
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
- IDOMNode cursorNode = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- List requiredAttrs = getRequiredAttrs(cursorNode);
- if (requiredAttrs.size() > 0) {
- NamedNodeMap currentAttrs = node.getAttributes();
- List insertAttrs = new ArrayList();
- if (currentAttrs.getLength() == 0) {
- insertAttrs.addAll(requiredAttrs);
- }
- else {
- for (int i = 0; i < requiredAttrs.size(); i++) {
- String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
- boolean found = false;
- for (int j = 0; j < currentAttrs.getLength(); j++) {
- String currentAttrName = currentAttrs.item(j).getNodeName();
- if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
- found = true;
- break;
- }
- }
- if (!found) {
- insertAttrs.add(requiredAttrs.get(i));
- }
- }
- }
- if (insertAttrs.size() > 0) {
- proposals.add(new InsertRequiredAttrsQuickAssistProposal(insertAttrs));
- }
- }
- }
- }
- }
-
- /**
- * @param proposals
- * @param viewer
- * @param offset
- */
- protected void getLocalRenameQuickAssistProposal(ArrayList proposals, StructuredTextViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- IStructuredDocumentRegion startStructuredDocumentRegion = node == null ? null : node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endStructuredDocumentRegion = node == null ? null : node.getEndStructuredDocumentRegion();
-
- ITextRegion region = null;
- int regionTextEndOffset = 0;
- if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
- region = startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- regionTextEndOffset = startStructuredDocumentRegion.getTextEndOffset(region);
- }
- else if ((endStructuredDocumentRegion != null) && endStructuredDocumentRegion.containsOffset(offset)) {
- region = endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- regionTextEndOffset = endStructuredDocumentRegion.getTextEndOffset(region);
- }
-
- if ((region != null) && ((region.getType() == DOMRegionContext.XML_TAG_NAME) || (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) && (offset <= regionTextEndOffset)) {
- proposals.add(new RenameInFileQuickAssistProposal());
- }
- }
-
- protected ModelQuery getModelQuery(Node node) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- return ModelQueryUtil.getModelQuery((Document) node);
- }
- else {
- return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.correction.IQuickAssistProcessor#getProposals(org.eclipse.wst.sse.core.text.IStructuredDocument,
- * int)
- */
- public ICompletionProposal[] getProposals(StructuredTextViewer viewer, int offset) throws CoreException {
- ArrayList proposals = new ArrayList();
-
- getLocalRenameQuickAssistProposal(proposals, viewer, offset);
- getSurroundWithNewElementQuickAssistProposal(proposals, viewer, offset);
- getInsertRequiredAttrs(proposals, viewer, offset);
-
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-
- protected List getRequiredAttrs(Node node) {
- List result = new ArrayList();
-
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
- if (elementDecl != null) {
- CMNamedNodeMap attrMap = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element)node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attrMap = allAttributes;
-
- Iterator it = attrMap.iterator();
- CMAttributeDeclaration attr = null;
- while (it.hasNext()) {
- attr = (CMAttributeDeclaration) it.next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
- result.add(attr);
- }
- }
- }
- }
-
- return result;
- }
-
- /**
- * @param proposals
- * @param viewer
- * @param offset
- */
- protected void getSurroundWithNewElementQuickAssistProposal(ArrayList proposals, StructuredTextViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- if (node != null) {
- proposals.add(new SurroundWithNewElementQuickAssistProposal());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
deleted file mode 100644
index 600824fbe3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickFixProcessor;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-/**
- * @deprecated since 2.0 RC0 Use
- * org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
- */
-public class QuickFixProcessorXML implements IQuickFixProcessor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.correction.IQuickFixProcessor#canFix(int)
- */
- public boolean canFix(Annotation annotation) {
- boolean result = false;
-
- if (annotation instanceof TemporaryAnnotation) {
- TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) annotation;
- int problemID = tempAnnotation.getProblemID();
- switch (problemID) {
- case ProblemIDsXML.EmptyTag :
- case ProblemIDsXML.MissingEndTag :
- case ProblemIDsXML.AttrsInEndTag :
- case ProblemIDsXML.MissingAttrValue :
- case ProblemIDsXML.NoAttrValue :
- case ProblemIDsXML.SpacesBeforeTagName :
- case ProblemIDsXML.SpacesBeforePI :
- case ProblemIDsXML.NamespaceInPI :
- case ProblemIDsXML.UnknownElement :
- case ProblemIDsXML.UnknownAttr :
- case ProblemIDsXML.InvalidAttrValue :
- case ProblemIDsXML.MissingRequiredAttr :
- case ProblemIDsXML.AttrValueNotQuoted :
- case ProblemIDsXML.MissingClosingBracket :
- result = true;
- }
- }
-
- return result;
- }
-
- public Image getImage() {
- // return
- // JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CORRECTION_CHANGE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.correction.IQuickFixProcessor#getProposals(org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation)
- */
- public ICompletionProposal[] getProposals(Annotation annotation) throws CoreException {
- ArrayList proposals = new ArrayList();
-
- if (annotation instanceof TemporaryAnnotation) {
- TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) annotation;
- int problemID = tempAnnotation.getProblemID();
- switch (problemID) {
- case ProblemIDsXML.EmptyTag :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_0, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingEndTag :
- String tagName = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
- String tagClose = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1];
- int tagCloseOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[2]).intValue();
- int startTagEndOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[3]).intValue();
- int firstChildStartOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[4]).intValue();
- int endOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[5]).intValue();
- proposals.add(new CompletionProposal(tagClose, tagCloseOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_1, null, "")); //$NON-NLS-1$
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), startTagEndOffset - tempAnnotation.getPosition().getOffset(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_2, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- proposals.add(new CompletionProposal("</" + tagName + ">", firstChildStartOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_3, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("</" + tagName + ">", endOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_4, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case ProblemIDsXML.AttrsInEndTag :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_5, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingAttrValue :
- String defaultAttrValue = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
- int insertOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1]).intValue();
- proposals.add(new CompletionProposal("\"" + defaultAttrValue + "\"", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength() + insertOffset, 0, defaultAttrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.NoAttrValue :
- defaultAttrValue = (String) tempAnnotation.getAdditionalFixInfo();
- proposals.add(new CompletionProposal("=\"" + defaultAttrValue + "\"", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength(), 0, defaultAttrValue.length() + 3, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.SpacesBeforeTagName :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_8, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.SpacesBeforePI :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_9, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.NamespaceInPI :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_10, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.UnknownElement :
- proposals.add(new RemoveUnknownElementQuickFixProposal(tempAnnotation.getAdditionalFixInfo(), getImage(), XMLUIMessages.QuickFixProcessorXML_11));
- proposals.add(new RenameInFileQuickAssistProposal());
- break;
- case ProblemIDsXML.UnknownAttr :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- proposals.add(new RenameInFileQuickAssistProposal());
- break;
- case ProblemIDsXML.InvalidAttrValue :
- proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_12, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingRequiredAttr :
- String requiredAttr = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
- insertOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1]).intValue();
- proposals.add(new CompletionProposal(requiredAttr, tempAnnotation.getPosition().getOffset() + insertOffset, 0, requiredAttr.length(), getImage(), XMLUIMessages.QuickFixProcessorXML_13, null, "")); //$NON-NLS-1$
- break;
- case ProblemIDsXML.AttrValueNotQuoted :
- String attrValue = (String) tempAnnotation.getAdditionalFixInfo();
- proposals.add(new CompletionProposal("\"" + attrValue + "\"", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), attrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_14, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case ProblemIDsXML.MissingClosingBracket :
- proposals.add(new CompletionProposal(">", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength(), 0, 1, getImage(), XMLUIMessages.QuickFixProcessorXML_15, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
-
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java
deleted file mode 100644
index b87a2c9a78..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java
+++ /dev/null
@@ -1,162 +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.xml.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class RemoveUnknownElementQuickFixProposal implements ICompletionProposal, ICompletionProposalExtension2 {
- private Object fAdditionalFixInfo = null;
- private String fDisplayString;
- private Image fImage;
- private Point fSelection; // initialized by apply()
-
- public RemoveUnknownElementQuickFixProposal(Object additionalFixInfo, Image image, String displayString) {
- fAdditionalFixInfo = additionalFixInfo;
- fImage = image;
- fDisplayString = displayString;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
- */
- public void apply(IDocument document) {
- // not implemented?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
- * char, int, int)
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- int startTagOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[0]).intValue();
- int startTagLength = ((Integer) ((Object[]) fAdditionalFixInfo)[1]).intValue();
- int endTagOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[2]).intValue();
- int endTagLength = ((Integer) ((Object[]) fAdditionalFixInfo)[3]).intValue();
-
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- if (endTagOffset != -1) {
- multiTextEdit.addChild(new DeleteEdit(endTagOffset, endTagLength));
- fSelection = new Point(endTagOffset, 0);
- }
- if (startTagOffset != -1) {
- multiTextEdit.addChild(new DeleteEdit(startTagOffset, startTagLength));
- fSelection = new Point(startTagOffset, 0);
- }
-
- try {
- multiTextEdit.apply(viewer.getDocument());
- }
- catch (MalformedTreeException e) {
- // log for now, unless find reasons not to.
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (BadLocationException e) {
- // log for now, unless find reasons not to.
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
- */
- public IContextInformation getContextInformation() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- if (fDisplayString == null) {
- fDisplayString = XMLUIMessages.QuickFixProcessorXML_11;
- }
-
- return fDisplayString;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
- */
- public Image getImage() {
- return fImage;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
- */
- public Point getSelection(IDocument document) {
- return fSelection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
- * boolean)
- */
- public void selected(ITextViewer viewer, boolean smartToggle) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
- */
- public void unselected(ITextViewer viewer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
- * int, org.eclipse.jface.text.DocumentEvent)
- */
- public boolean validate(IDocument document, int offset, DocumentEvent event) {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
deleted file mode 100644
index d299f25ff8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
+++ /dev/null
@@ -1,187 +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.xml.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI;
-import org.eclipse.jface.text.link.LinkedPosition;
-import org.eclipse.jface.text.link.LinkedPositionGroup;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
-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.ui.internal.contentassist.ContentAssistUtils;
-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.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class RenameInFileQuickAssistProposal implements ICompletionProposal, ICompletionProposalExtension2 {
- protected IRegion fSelectedRegion; // initialized by apply()
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
- */
- public void apply(IDocument document) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
- * char, int, int)
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- IDocument document = viewer.getDocument();
- LinkedPositionGroup group = new LinkedPositionGroup();
- try {
- IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- ITextRegion region = (startStructuredDocumentRegion == null) ? null : startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- if (region != null) {
- group.addPosition(new LinkedPosition(document, startStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 0));
-
- if ((region.getType() == DOMRegionContext.XML_TAG_NAME) && (node.getEndStructuredDocumentRegion() != null)) {
- region = node.getEndStructuredDocumentRegion().getRegions().get(1);
- if (region != null) {
- group.addPosition(new LinkedPosition(document, node.getEndStructuredDocumentRegion().getStartOffset() + region.getStart(), region.getTextLength(), 1));
- }
- }
- }
- else {
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- region = (endStructuredDocumentRegion == null) ? null : endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- if (region != null) {
- if ((region.getType() == DOMRegionContext.XML_TAG_NAME) && (node.getStartStructuredDocumentRegion() != null)) {
- ITextRegion startTagNameRegion = node.getStartStructuredDocumentRegion().getRegions().get(1);
- if (region != null) {
- group.addPosition(new LinkedPosition(document, node.getStartStructuredDocumentRegion().getStartOffset() + startTagNameRegion.getStart(), startTagNameRegion.getTextLength(), 0));
- group.addPosition(new LinkedPosition(document, endStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 1));
- }
- }
- else {
- group.addPosition(new LinkedPosition(document, endStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 0));
- }
- }
- }
-
- // TODO CompletionProposalPopup#insertProposal() calls
- // IRewriteTarget.beginCompoundChange()
- // which disables redraw in ITextViewer. Workaround for now.
- if(viewer instanceof ITextViewerExtension)
- ((ITextViewerExtension) viewer).setRedraw(true);
-
- LinkedModeModel linkedModeModel = new LinkedModeModel();
- linkedModeModel.addGroup(group);
- linkedModeModel.forceInstall();
-
- LinkedModeUI ui = new EditorLinkedModeUI(linkedModeModel, viewer);
- ui.setExitPosition(viewer, offset, 0, LinkedPositionGroup.NO_STOP);
- ui.enter();
-
- fSelectedRegion = ui.getSelectedRegion();
- }
- catch (BadLocationException e) {
- // log for now, unless find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return XMLUIMessages.RenameInFileQuickAssistProposal_0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
- */
- public IContextInformation getContextInformation() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- return XMLUIMessages.RenameInFileQuickAssistProposal_1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
- */
- public Image getImage() {
- // return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_LOCAL_VARIABLE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
- */
- public Point getSelection(IDocument document) {
- return new Point(fSelectedRegion.getOffset(), fSelectedRegion.getLength());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
- * boolean)
- */
- public void selected(ITextViewer viewer, boolean smartToggle) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
- */
- public void unselected(ITextViewer viewer) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
- * int, org.eclipse.jface.text.DocumentEvent)
- */
- public boolean validate(IDocument document, int offset, DocumentEvent event) {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java
deleted file mode 100644
index 0e8457fee9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI;
-import org.eclipse.jface.text.link.LinkedPosition;
-import org.eclipse.jface.text.link.LinkedPositionGroup;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-public class SurroundWithNewElementQuickAssistProposal extends RenameInFileQuickAssistProposal {
- private static final String ELEMENT_NAME = "element"; //$NON-NLS-1$
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
- * char, int, int)
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- try {
- int startTagOffset = offset;
- int endTagOffset = offset + viewer.getSelectedRange().y;
-
- // surround the node if no selection
- if (startTagOffset == endTagOffset) {
- IDOMNode cursorNode = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
- // use parent node if text node is empty
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = (IDOMNode) cursorNode.getParentNode();
- }
-
- startTagOffset = cursorNode.getStartOffset();
- endTagOffset = cursorNode.getEndOffset();
- }
-
- // insert new element
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- // element tag name cannot be DBCS, do not translate "<element>"
- // and "</element>"
- final String startElement = "<" + ELEMENT_NAME + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- multiTextEdit.addChild(new InsertEdit(startTagOffset, startElement));
- multiTextEdit.addChild(new InsertEdit(endTagOffset, "</"+ELEMENT_NAME +">")); //$NON-NLS-1$ //$NON-NLS-2$
- multiTextEdit.apply(viewer.getDocument());
- Position start = new Position(startTagOffset);
- Position end = new Position(endTagOffset + startElement.length());
-
- try {
- viewer.getDocument().addPosition(start);
- viewer.getDocument().addPosition(end);
-
- // get new element node
- IDOMNode newElementNode = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, startTagOffset);
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(newElementNode);
-
- // rename new element
- apply(viewer, trigger, stateMask, start, end, ELEMENT_NAME.length());
- } finally {
- viewer.getDocument().removePosition(start);
- viewer.getDocument().removePosition(end);
- }
- }
- catch (MalformedTreeException e) {
- // log for now, unless find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- catch (BadLocationException e) {
- // log for now, unless find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- private void apply(ITextViewer viewer, char trigger, int stateMask, Position start, Position end, int length) {
- IDocument document = viewer.getDocument();
- LinkedPositionGroup group = new LinkedPositionGroup();
- try {
- group.addPosition(new LinkedPosition(document, start.offset + 1, length, 0)); // offset by 1 for <
- group.addPosition(new LinkedPosition(document, end.offset + 2, length, 1)); // offset by 2 for </
-
- if(viewer instanceof ITextViewerExtension)
- ((ITextViewerExtension) viewer).setRedraw(true);
-
- LinkedModeModel linkedModeModel = new LinkedModeModel();
- linkedModeModel.addGroup(group);
- linkedModeModel.forceInstall();
-
- LinkedModeUI ui = new EditorLinkedModeUI(linkedModeModel, viewer);
- ui.setExitPosition(viewer, start.offset, 0, LinkedPositionGroup.NO_STOP);
- ui.enter();
-
- fSelectedRegion = ui.getSelectedRegion();
- }
- catch (BadLocationException e) {
- // log for now, unless find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
- */
- public String getAdditionalProposalInfo() {
- return XMLUIMessages.SurroundWithNewElementQuickAssistProposal_0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
- */
- public String getDisplayString() {
- return XMLUIMessages.SurroundWithNewElementQuickAssistProposal_1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
- */
- public Image getImage() {
- // return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ADD_CORRECTION);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/XMLQuickAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/XMLQuickAssistProcessor.java
deleted file mode 100644
index 4649e948af..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/XMLQuickAssistProcessor.java
+++ /dev/null
@@ -1,212 +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.wst.xml.ui.internal.correction;
-
-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.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.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.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class XMLQuickAssistProcessor implements IQuickAssistProcessor {
-
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- return true;
- }
-
- public boolean canFix(Annotation annotation) {
- return false;
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
- List proposals = new ArrayList();
-
- getLocalRenameQuickAssistProposal(proposals, invocationContext.getSourceViewer(), invocationContext.getOffset());
- getSurroundWithNewElementQuickAssistProposal(proposals, invocationContext.getSourceViewer(), invocationContext.getOffset());
- getInsertRequiredAttrs(proposals, invocationContext.getSourceViewer(), invocationContext.getOffset());
-
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- private void getInsertRequiredAttrs(List proposals, ISourceViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) getNodeAt(viewer, offset);
- if ((node != null) && (node.getNodeType() == Node.ELEMENT_NODE)) {
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
- IDOMNode cursorNode = (IDOMNode) getNodeAt(viewer, offset);
- List requiredAttrs = getRequiredAttrs(cursorNode);
- if (requiredAttrs.size() > 0) {
- NamedNodeMap currentAttrs = node.getAttributes();
- List insertAttrs = new ArrayList();
- if (currentAttrs.getLength() == 0) {
- insertAttrs.addAll(requiredAttrs);
- }
- else {
- for (int i = 0; i < requiredAttrs.size(); i++) {
- String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
- boolean found = false;
- for (int j = 0; j < currentAttrs.getLength(); j++) {
- String currentAttrName = currentAttrs.item(j).getNodeName();
- if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
- found = true;
- break;
- }
- }
- if (!found) {
- insertAttrs.add(requiredAttrs.get(i));
- }
- }
- }
- if (insertAttrs.size() > 0) {
- proposals.add(new InsertRequiredAttrsQuickAssistProposal(insertAttrs));
- }
- }
- }
- }
- }
-
- private void getLocalRenameQuickAssistProposal(List proposals, ISourceViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) getNodeAt(viewer, offset);
- IStructuredDocumentRegion startStructuredDocumentRegion = node == null ? null : node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endStructuredDocumentRegion = node == null ? null : node.getEndStructuredDocumentRegion();
-
- ITextRegion region = null;
- int regionTextEndOffset = 0;
- if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
- region = startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- regionTextEndOffset = startStructuredDocumentRegion.getTextEndOffset(region);
- }
- else if ((endStructuredDocumentRegion != null) && endStructuredDocumentRegion.containsOffset(offset)) {
- region = endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
- regionTextEndOffset = endStructuredDocumentRegion.getTextEndOffset(region);
- }
-
- if ((region != null) && ((region.getType() == DOMRegionContext.XML_TAG_NAME) || (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) && (offset <= regionTextEndOffset)) {
- proposals.add(new RenameInFileQuickAssistProposal());
- }
- }
-
- private ModelQuery getModelQuery(Node node) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- return ModelQueryUtil.getModelQuery((Document) node);
- }
- else {
- return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
- }
-
- private List getRequiredAttrs(Node node) {
- List result = new ArrayList();
-
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
- if (elementDecl != null) {
- CMNamedNodeMap attrMap = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attrMap = allAttributes;
-
- Iterator it = attrMap.iterator();
- CMAttributeDeclaration attr = null;
- while (it.hasNext()) {
- attr = (CMAttributeDeclaration) it.next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
- result.add(attr);
- }
- }
- }
- }
-
- return result;
- }
-
- private void getSurroundWithNewElementQuickAssistProposal(List proposals, ISourceViewer viewer, int offset) {
- IDOMNode node = (IDOMNode) getNodeAt(viewer, offset);
- if (node != null) {
- proposals.add(new SurroundWithNewElementQuickAssistProposal());
- }
- }
-
- /**
- * Returns the closest IndexedRegion for the offset and viewer allowing
- * for differences between viewer offsets and model positions. note: this
- * method returns an IndexedRegion for read only
- *
- * @param viewer
- * the viewer whose document is used to compute the proposals
- * @param documentOffset
- * an offset within the document for which completions should
- * be computed
- * @return an IndexedRegion
- */
- private IndexedRegion getNodeAt(ITextViewer viewer, int documentOffset) {
- // copied from ContentAssistUtils.getNodeAt()
- if (viewer == null)
- return null;
-
- IndexedRegion node = null;
- IModelManager mm = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- if (mm != null)
- model = mm.getExistingModelForRead(viewer.getDocument());
- try {
- if (model != null) {
- int lastOffset = documentOffset;
- node = model.getIndexedRegion(documentOffset);
- while (node == null && lastOffset >= 0) {
- lastOffset--;
- node = model.getIndexedRegion(lastOffset);
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return node;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java
deleted file mode 100644
index 9cdbc5b886..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.document.JSPTag;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-public class EditAttributeDialog extends Dialog implements ModifyListener {
- protected Attr attribute;
- protected String attributeName;
- protected Text attributeNameField;
- protected String attributeValue;
- protected Text attributeValueField;
- protected Label errorMessageIcon;
- protected Label errorMessageLabel;
- protected Button okButton;
- protected Element ownerElement;
-
- public EditAttributeDialog(Shell parentShell, Element ownerElement, Attr attribute) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.ownerElement = ownerElement;
- this.attribute = attribute;
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- attributeName = getModelValue(attributeNameField.getText());
- attributeValue = attributeValueField.getText();
- }
- super.buttonPressed(buttonId);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- attributeNameField.forceFocus();
- attributeNameField.selectAll();
- updateErrorMessage();
- return control;
- }
-
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_ATTRIBUTE_DIALOG);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- //
- // Style convenience constants
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label attributeNameLabel = new Label(composite, SWT.NONE);
- attributeNameLabel.setText(XMLUIMessages._UI_LABEL_NAME_COLON);
-
- attributeNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 300;
- attributeNameField.setLayoutData(gd);
- attributeNameField.setText(getDisplayValue(attribute != null ? attribute.getName() : "")); //$NON-NLS-1$
- attributeNameField.addModifyListener(this);
-
- Label attributeValueLabel = new Label(composite, SWT.NONE);
- attributeValueLabel.setText(XMLUIMessages._UI_LABEL_VALUE_COLON);
-
- String value = attribute != null ? attribute.getValue() : ""; //$NON-NLS-1$
- int style = SWT.SINGLE | SWT.BORDER;
- if (value.indexOf("\n") != -1) { //$NON-NLS-1$
- style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
- }
-
- attributeValueField = new Text(composite, style);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 300;
- attributeValueField.setLayoutData(gd);
- attributeValueField.setText(getDisplayValue(attribute != null ? attribute.getValue() : "")); //$NON-NLS-1$
-
- // Error message
- Composite message = new Composite(composite, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- message.setLayout(layout);
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- message.setLayoutData(gd);
-
- errorMessageIcon = new Label(message, SWT.NONE);
- gd = new GridData();
- gd.horizontalSpan = 1;
- gd.verticalAlignment = SWT.TOP;
- errorMessageIcon.setLayoutData(gd);
- errorMessageIcon.setImage(null);
-
- errorMessageLabel = new Label(message, SWT.WRAP);
- errorMessageLabel.setText(XMLUIMessages.error_message_goes_here);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 200;
- gd.heightHint = Math.max(30, errorMessageLabel.computeSize(0, 0, false).y * 2);
- gd.horizontalSpan = 1;
- gd.verticalAlignment = SWT.TOP;
- errorMessageLabel.setLayoutData(gd);
-
- return dialogArea;
- }
-
- public String getAttributeName() {
- return attributeName;
- }
-
- public String getAttributeValue() {
- return attributeValue;
- }
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- protected String getModelValue(String string) {
- String result = null;
- if ((string != null) && (string.trim().length() > 0)) {
- result = string;
- }
- return result;
- }
-
- public void modifyText(ModifyEvent e) {
- updateErrorMessage();
- }
-
- protected void updateErrorMessage() {
- String errorMessage = null;
- Image image = null;
- String name = attributeNameField.getText().trim();
- if (name.length() > 0) {
- Attr matchingAttribute = ownerElement.getAttributeNode(name);
- if ((matchingAttribute != null) && (matchingAttribute != attribute)) {
- errorMessage = XMLUIMessages._ERROR_XML_ATTRIBUTE_ALREADY_EXISTS;
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ERROR_OBJ);
- }
- else {
- if (!isValidName(name)){
- errorMessage = NLS.bind(XMLUIMessages._ERROR_XML_ATTRIBUTE_IS_INVALID, name);
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ERROR_OBJ);
- }
- }
- }
- else {
- errorMessage = ""; //$NON-NLS-1$
- }
-
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- errorMessageIcon.setImage(image);
- errorMessageLabel.getParent().layout();
- okButton.setEnabled(errorMessage == null);
- }
-
- private boolean isValidName(String name) {
- if (NameValidator.isValid(name))
- return true;
- // special for JSP tag in tag name
- if (name.startsWith(JSPTag.TAG_OPEN))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java
deleted file mode 100644
index 9a0b308f03..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java
+++ /dev/null
@@ -1,235 +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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.DocumentType;
-
-public class EditDoctypeDialog extends Dialog {
- protected boolean computeSystemId;
- protected String[] doctypeData;
- protected boolean errorChecking;
- protected Label errorMessageLabel;
- protected Button okButton;
- protected Button publicIdBrowseButton;
- protected Text publicIdField;
- protected IPath resourceLocation;
- protected Text rootElementNameField;
- protected Button systemIdBrowseButton;
- protected Text systemIdField;
-
- public EditDoctypeDialog(Shell parentShell, DocumentType doctype) {
- this(parentShell, doctype.getName(), doctype.getPublicId(), doctype.getSystemId());
- }
-
- public EditDoctypeDialog(Shell parentShell, String name, String publicId, String systemId) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- doctypeData = new String[3];
- doctypeData[0] = name;
- doctypeData[1] = publicId;
- doctypeData[2] = systemId;
- }
-
- protected void buttonPressed(int buttonId) {
- doctypeData[0] = getModelValue(rootElementNameField.getText());
- doctypeData[1] = getModelValue(publicIdField.getText());
- doctypeData[2] = getModelValue(systemIdField.getText());
- super.buttonPressed(buttonId);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
-
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- updateErrorMessage();
- return control;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogControl = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogControl, XMLCommonUIContextIds.XCUI_DOCTYPE_DIALOG);
-
- Composite composite = new Composite(dialogControl, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (e.widget == systemIdField) {
- computeSystemId = false;
- }
- updateErrorMessage();
- }
- };
-
- // row 1
- //
- Label rootElementNameLabel = new Label(composite, SWT.NONE);
- rootElementNameLabel.setText(XMLUIMessages._UI_LABEL_ROOT_ELEMENT_NAME_COLON);
-
- rootElementNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(rootElementNameField, XMLCommonUIContextIds.XCUI_DOCTYPE_ROOT);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 200;
- rootElementNameField.setLayoutData(gd);
- rootElementNameField.setText(getDisplayValue(doctypeData[0]));
- rootElementNameField.addModifyListener(modifyListener);
-
- Label placeHolder = new Label(composite, SWT.NONE);
- placeHolder.setLayoutData(new GridData());
-
- // row 2
- //
- Label publicIdLabel = new Label(composite, SWT.NONE);
- publicIdLabel.setText(XMLUIMessages._UI_LABEL_PUBLIC_ID_COLON);
-
- publicIdField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(publicIdField, XMLCommonUIContextIds.XCUI_DOCTYPE_PUBLIC);
- publicIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- publicIdField.setText(getDisplayValue(doctypeData[1]));
-
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- EditEntityHelper helper = new EditEntityHelper();
- if (e.widget == publicIdBrowseButton) {
- helper.performBrowseForPublicId(getShell(), publicIdField, computeSystemId ? systemIdField : null);
- }
- else if (e.widget == systemIdBrowseButton) {
- helper.performBrowseForSystemId(getShell(), systemIdField, resourceLocation);
- }
- }
- };
-
- publicIdBrowseButton = new Button(composite, SWT.NONE);
- publicIdBrowseButton.setText(XMLUIMessages._UI_LABEL_BROWSE);
- publicIdBrowseButton.addSelectionListener(selectionListener);
-
- // row 3
- Label systemIdLabel = new Label(composite, SWT.NONE);
- systemIdLabel.setText(XMLUIMessages._UI_LABEL_SYSTEM_ID_COLON);
-
- systemIdField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(systemIdField, XMLCommonUIContextIds.XCUI_DOCTYPE_SYSTEM);
- systemIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- systemIdField.setText(getDisplayValue(doctypeData[2]));
- systemIdField.addModifyListener(modifyListener);
-
-
- systemIdBrowseButton = new Button(composite, SWT.NONE);
- systemIdBrowseButton.setText(XMLUIMessages._UI_LABEL_BROWSE_1);
- systemIdBrowseButton.addSelectionListener(selectionListener);
-
- // error message
- errorMessageLabel = new Label(dialogControl, SWT.NONE);
- errorMessageLabel.setText(""); //$NON-NLS-1$
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
- errorMessageLabel.setForeground(color);
-
- Dialog.applyDialogFont(parent);
- return dialogControl;
- }
-
-
- protected Label createMessageArea(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- // label.setText(message);
- return label;
- }
-
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- public boolean getErrorChecking() {
- return errorChecking;
- }
-
-
- protected String getModelValue(String string) {
- String result = null;
- if ((string != null) && (string.trim().length() > 0)) {
- result = string;
- }
- return result;
- }
-
- public String getName() {
- return doctypeData[0];
- }
-
- public String getPublicId() {
- return doctypeData[1];
- }
-
- public String getSystemId() {
- return doctypeData[2];
- }
-
- public void setComputeSystemId(boolean computeSystemId) {
- this.computeSystemId = computeSystemId;
- }
-
- public void setErrorChecking(boolean errorChecking) {
- this.errorChecking = errorChecking;
- }
-
- public void setResourceLocation(IPath path) {
- resourceLocation = path;
- }
-
- public void updateErrorMessage() {
- if (errorChecking) {
- String errorMessage = null;
- if (getModelValue(systemIdField.getText()) == null) {
- errorMessage = XMLUIMessages._UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED;
- }
- else if (getModelValue(rootElementNameField.getText()) == null) {
- errorMessage = XMLUIMessages._UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED;
- }
-
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- okButton.setEnabled(errorMessage == null);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java
deleted file mode 100644
index adad3814f2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java
+++ /dev/null
@@ -1,141 +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.xml.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.Element;
-
-public class EditElementDialog extends Dialog implements ModifyListener {
- protected Element element;
- protected String elementName;
- protected Text elementNameField;
- protected Label errorMessageLabel;
- protected Button okButton;
-
- public EditElementDialog(Shell parentShell, Element element) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.element = element;
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- elementName = getModelValue(elementNameField.getText());
- }
- super.buttonPressed(buttonId);
- }
-
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- elementNameField.forceFocus();
- elementNameField.selectAll();
- updateErrorMessage();
- return control;
- }
-
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_ELEMENT_DIALOG);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label elementNameLabel = new Label(composite, SWT.NONE);
- elementNameLabel.setText(XMLUIMessages._UI_LABEL_ELEMENT_NAME);
-
- elementNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 200;
- elementNameField.setLayoutData(gd);
- elementNameField.setText(getDisplayValue(element != null ? element.getNodeName() : "")); //$NON-NLS-1$
- elementNameField.addModifyListener(this);
-
- // error message
- errorMessageLabel = new Label(composite, SWT.NONE);
- errorMessageLabel.setText(XMLUIMessages.error_message_goes_here);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- errorMessageLabel.setLayoutData(gd);
- Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
- errorMessageLabel.setForeground(color);
-
- return dialogArea;
- }
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- public String getElementName() {
- return elementName;
- }
-
- protected String getModelValue(String string) {
- String result = null;
- if ((string != null) && (string.trim().length() > 0)) {
- result = string;
- }
- return result;
- }
-
- public void modifyText(ModifyEvent e) {
- updateErrorMessage();
- }
-
- protected void updateErrorMessage() {
- String errorMessage = null;
- String name = elementNameField.getText();
- // String name = elementNameField.getText().trim();
- if (name.length() > 0) {
- // TODO use checkName from model level
- // errorMessage = ValidateHelper.checkXMLName(name);
- if (!NameValidator.isValid(name)) {
- errorMessage = XMLUIMessages._UI_INVALID_NAME;
- }
- }
- else {
- errorMessage = ""; //$NON-NLS-1$
- }
-
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- okButton.setEnabled(errorMessage == null);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java
deleted file mode 100644
index 25eb64dc55..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java
+++ /dev/null
@@ -1,73 +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.xml.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class EditEntityHelper {
-
- public void performBrowseForPublicId(Shell parentShell, Text publicIdField) {
- performBrowseForPublicId(parentShell, publicIdField, null);
- }
-
- public void performBrowseForPublicId(Shell parentShell, Text publicIdField, Text systemIdField) {
- String[] extensions = {"dtd", "txt"}; //$NON-NLS-1$ //$NON-NLS-2$
- SelectXMLCatalogIdDialog dialog = new SelectXMLCatalogIdDialog(parentShell, extensions);
- dialog.create();
- dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_XML_CATALOG_ENTRY);
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- String id = dialog.getId();
- if (id != null) {
- publicIdField.setText(id);
- if ((systemIdField != null) && (dialog.getSystemId() != null)) {
- systemIdField.setText(dialog.getSystemId());
- }
- }
- }
- }
-
- public void performBrowseForSystemId(Shell parentShell, Text systemIdField, IPath resourceLocation) {
- String[] extensions = {"dtd"}; //$NON-NLS-1$
- SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(parentShell, extensions, ICatalogEntry.ENTRY_TYPE_SYSTEM);
- dialog.create();
- dialog.getShell().setText(XMLUIMessages._UI_LABEL_SPECIFY_SYSTEM_ID);
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- String id = dialog.getId();
- IFile file = dialog.getFile();
- if (id != null) {
- systemIdField.setText(id);
- }
- else if (file != null) {
- String uri = null;
- if (resourceLocation != null) {
- uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
- }
- else {
- uri = file.getLocation().toOSString();
- }
- systemIdField.setText(uri);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
deleted file mode 100644
index 844ac60e03..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
+++ /dev/null
@@ -1,274 +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.wst.xml.ui.internal.dialogs;
-
-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.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-
-public class EditNamespaceInfoDialog extends Dialog {
-
- public static EditNamespaceInfoDialog invokeDialog(Shell shell, String title, NamespaceInfo info, IPath resourceLocation) {
- EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(resourceLocation);
- dialog.open();
- return dialog;
- }
-
- protected Button browseButton;
- protected String errorMessage;
-
- protected Label errorMessageLabel;
- protected NamespaceInfo fInfo;
- protected Text locationHintField;
-
- protected Button okButton;
- protected Text prefixField;
- protected IPath resourceLocation;
- protected Text uriField;
-
- public EditNamespaceInfoDialog(Shell parentShell, NamespaceInfo info) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.fInfo = info;
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- fInfo.uri = uriField.getText();
- fInfo.prefix = prefixField.getText();
- fInfo.locationHint = locationHintField.getText();
- }
- super.buttonPressed(buttonId);
- }
-
- protected void computeErrorMessage() {
- errorMessage = null;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- okButton.setEnabled(false);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- updateWidgets();
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogsubArea = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogsubArea, XMLCommonUIContextIds.XCUI_NAMESPACE_DIALOG);
-
- Composite composite = new Composite(dialogsubArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 350;
- composite.setLayoutData(gd);
-
- ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateWidgets();
- }
- };
-
-
- // row 1
- //
- Label uriLabel = new Label(composite, SWT.NONE);
- uriLabel.setText(XMLUIMessages._UI_LABEL_NAMESPACE_NAME_COLON);
-
- uriField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- uriField.setLayoutData(gd);
- uriField.setText(getDisplayValue(fInfo.uri));
- uriField.addModifyListener(modifyListener);
- uriField.setEnabled(fInfo.getProperty("uri-readOnly") == null); //$NON-NLS-1$
-
- // never read
- Label placeHolder1 = new Label(composite, SWT.NONE);
- placeHolder1.setText(""); //$NON-NLS-1$
-
- // row 2
- //
- Label prefixLabel = new Label(composite, SWT.NONE);
- prefixLabel.setText(XMLUIMessages._UI_LABEL_PREFIX_COLON);
-
- prefixField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- prefixField.setLayoutData(gd);
- prefixField.setText(getDisplayValue(fInfo.prefix));
- prefixField.addModifyListener(modifyListener);
- prefixField.setEnabled(fInfo.getProperty("prefix-readOnly") == null); //$NON-NLS-1$
-
- // never read
- Label placeHolder2 = new Label(composite, SWT.NONE);
- placeHolder2.setText(""); //$NON-NLS-1$
-
- // row 3
- //
- Label locationHintLabel = new Label(composite, SWT.NONE);
- locationHintLabel.setText(XMLUIMessages._UI_LABEL_LOCATION_HINT_COLON);
-
- locationHintField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- locationHintField.setLayoutData(gd);
- locationHintField.setText(getDisplayValue(fInfo.locationHint));
- locationHintField.addModifyListener(modifyListener);
- locationHintField.setEnabled(fInfo.getProperty("locationHint-readOnly") == null); //$NON-NLS-1$
-
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- performBrowse();
- }
- };
-
- browseButton = new Button(composite, SWT.NONE);
- browseButton.setText(XMLUIMessages._UI_LABEL_BROWSE);
- browseButton.addSelectionListener(selectionListener);
- browseButton.setEnabled(locationHintField.getEnabled());
-
- // error message
- errorMessageLabel = new Label(dialogsubArea, SWT.NONE);
- errorMessageLabel.setText(XMLUIMessages.error_message_goes_here);
- errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
- errorMessageLabel.setForeground(color);
-
- return dialogsubArea;
- }
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- protected void performBrowse() {
- String[] extensions = {".xsd"}; //$NON-NLS-1$
- SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(getShell(), extensions);
- dialog.create();
- dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_FILE);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- String grammarURI = null;
- IFile file = dialog.getFile();
- String id = dialog.getId();
- if (file != null) {
- String uri = null;
- if (resourceLocation != null) {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceLocation);
- if (resource != null) {
- IPath location = resource.getLocation();
- if (location != null) {
- uri = URIHelper.getRelativeURI(file.getLocation(), location);
- }
- }
- else {
- uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
- }
- grammarURI = file.getLocation().toOSString();
- }
- else {
- uri = file.getLocation().toOSString();
- grammarURI = uri;
- }
- locationHintField.setText(uri);
- }
- else if (id != null) {
- locationHintField.setText(id);
- URIResolver resolver = URIResolverPlugin.createResolver();
- grammarURI = resolver.resolve(null, id, id);
- }
-
-
- CMDocument document = ContentModelManager.getInstance().createCMDocument(URIHelper.getURIForFilePath(grammarURI), "xsd"); //$NON-NLS-1$
- if(document != null) {
- List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
- if(namespaceInfoList != null) {
- NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
- if(info != null) {
- if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
- uriField.setText(info.uri);
- }
- if ((prefixField.getText().trim().length() == 0) && (info.prefix != null)) {
- prefixField.setText(info.prefix);
- }
- }
- }
- }
- }
- }
-
- public void setResourceLocation(IPath path) {
- resourceLocation = path;
- }
-
- protected void updateErrorMessageLabel() {
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- }
-
- protected void updateOKButtonState() {
- if (okButton != null) {
- if ((uriField.getText().trim().length() == 0) && (prefixField.getText().trim().length() == 0) && (locationHintField.getText().trim().length() == 0)) {
- okButton.setEnabled(false);
- }
- else {
- okButton.setEnabled(errorMessage == null);
- }
- }
- }
-
- protected void updateWidgets() {
- computeErrorMessage();
- updateErrorMessageLabel();
- updateOKButtonState();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java
deleted file mode 100644
index 6742855d8c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java
+++ /dev/null
@@ -1,116 +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.xml.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.ProcessingInstruction;
-
-public class EditProcessingInstructionDialog extends Dialog {
- protected String data;
- protected Text dataField;
- protected String target;
- protected Text targetField;
-
- public EditProcessingInstructionDialog(Shell parentShell, ProcessingInstruction pi) {
- this(parentShell, pi.getTarget(), pi.getData());
- }
-
- public EditProcessingInstructionDialog(Shell parentShell, String target, String data) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.target = target;
- this.data = data;
- }
-
- protected void buttonPressed(int buttonId) {
- target = getModelValue(targetField.getText());
- data = getModelValue(dataField.getText());
- super.buttonPressed(buttonId);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea1 = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea1, XMLCommonUIContextIds.XCUI_PROCESSING_DIALOG);
-
- Composite composite = new Composite(dialogArea1, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 250;
-
- Label targetLabel = new Label(composite, SWT.NONE);
- targetLabel.setText(XMLUIMessages._UI_LABEL_TARGET_COLON);
-
- targetField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- targetField.setLayoutData(gd);
- targetField.setText(getDisplayValue(target));
-
- Label dataLabel = new Label(composite, SWT.NONE);
- dataLabel.setText(XMLUIMessages._UI_LABEL_DATA_COLON);
-
- dataField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- dataField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- dataField.setText(getDisplayValue(data));
-
- return dialogArea1;
- }
-
- protected Label createMessageArea(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- // label.setText(message);
- return label;
- }
-
- public String getData() {
- return data;
- }
-
- protected String getDisplayValue(String string) {
- return string != null ? string : ""; //$NON-NLS-1$
- }
-
- protected String getModelValue(String string) {
- String result = null;
- if ((string != null) && (string.trim().length() > 0)) {
- result = string;
- }
- return result;
- }
-
-
- public String getTarget() {
- return target;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java
deleted file mode 100644
index d4458097d8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java
+++ /dev/null
@@ -1,80 +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.xml.ui.internal.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-
-public class EditSchemaInfoDialog extends Dialog implements UpdateListener {
- // protected NamespaceInfoTable namespaceInfoTable;
- protected Label errorMessageLabel;
- protected List namespaceInfoList;
- protected IPath resourceLocation;
-
- public EditSchemaInfoDialog(Shell parentShell, IPath resourceLocation) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.resourceLocation = resourceLocation;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_SCHEMA_INFO_DIALOG);
-
- CommonEditNamespacesDialog editNamespacesControl = new CommonEditNamespacesDialog(dialogArea, resourceLocation, XMLUIMessages._UI_NAMESPACE_DECLARATIONS, false, true);
- editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
-
- editNamespacesControl.updateErrorMessage(namespaceInfoList);
-
- return dialogArea;
- }
-
- protected Control getDialogArea(Composite parent) {
- return super.createDialogArea(parent);
- }
-
- public List getNamespaceInfoList() {
- return namespaceInfoList;
- }
-
- public void setNamespaceInfoList(List list) {
- namespaceInfoList = list;
- }
-
- public void updateErrorMessage(List namespaceInfoList) {
- NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
- String errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- }
-
- public void updateOccured(Object object, Object arg) {
- updateErrorMessage((List) arg);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java
deleted file mode 100644
index 540df93305..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java
+++ /dev/null
@@ -1,104 +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.xml.ui.internal.dialogs;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class NamespaceInfoErrorHelper {
-
- protected List errorList;
-
- public NamespaceInfoErrorHelper() {
- }
-
- public String computeErrorMessage(List namespaceInfoList, URIResolver idResolver) {
- String result = null;
- Hashtable prefixTable = new Hashtable();
- Hashtable uriTable = new Hashtable();
- for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
- NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
- nsInfo.normalize();
-
- String urikey = nsInfo.uri != null ? nsInfo.uri : ""; //$NON-NLS-1$
- NamespaceInfo nsInfo2 = null;
- if ((nsInfo2 = (NamespaceInfo) uriTable.get(urikey)) != null) {
- if ((nsInfo.uri != null) && nsInfo.uri.equals(nsInfo2.uri)) {
- result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME + "'" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME;
- }
- break;
- }
- else {
- uriTable.put(urikey, nsInfo);
- }
-
- if (nsInfo.uri != null) {
- String key = nsInfo.prefix != null ? nsInfo.prefix : ""; //$NON-NLS-1$
- if (prefixTable.get(key) != null) {
- if (nsInfo.prefix != null) {
- result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX + "'" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- else {
- result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX;
- break;
- }
- }
- else {
- prefixTable.put(key, nsInfo);
- }
-
- if ((nsInfo.locationHint != null) && (idResolver != null)) {
- String grammarURI = idResolver.resolve(null, nsInfo.locationHint, nsInfo.locationHint);
- if (!URIHelper.isReadableURI(grammarURI, false)) {
- result = XMLUIMessages._UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED + " '" + nsInfo.locationHint + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
- if ((idResolver != null) && (nsInfo.locationHint == null) && !nsInfo.uri.equals(DOMNamespaceInfoManager.XSI_URI)) {
- result = XMLUIMessages._UI_WARNING_LOCATION_HINT_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
- else {
- if (nsInfo.prefix != null) {
- result = XMLUIMessages._UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED + " '" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
- }
- // additional tests
- if (result == null) {
- for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
- NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
- nsInfo.normalize();
- if ((nsInfo.uri != null) && nsInfo.isPrefixRequired && (nsInfo.prefix == null)) {
- result = XMLUIMessages._UI_WARNING_PREFIX_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java
deleted file mode 100644
index 8a438dce85..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java
+++ /dev/null
@@ -1,398 +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.xml.ui.internal.dialogs;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-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.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class NamespaceInfoTable extends Composite {
-
- /**
- * NamespaceInfoTableLabelProvider
- */
- protected class NamespaceInfoTableLabelProvider implements ITableLabelProvider, IStructuredContentProvider {
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public Image getColumnImage(Object object, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object object, int column) {
- NamespaceInfo info = (NamespaceInfo) object;
- String result = null;
- switch (column) {
- case 0 : {
- result = info.uri;
- break;
- }
- case 1 : {
- result = info.prefix;
- break;
- }
- case 2 : {
- result = info.locationHint;
- break;
- }
- }
- result = result != null ? result : ""; //$NON-NLS-1$
- if (result.equals("")) { //$NON-NLS-1$
- switch (column) {
- case 0 : {
- result = XMLUIMessages._UI_NO_NAMESPACE_NAME;
- break;
- }
- case 1 : {
- result = XMLUIMessages._UI_NO_PREFIX;
- break;
- }
- }
- }
- return result;
- }
-
- String getDefaultPrefix() {
- String defaultPrefix = "p"; //$NON-NLS-1$
- if (namespaceInfoList == null) {
- return defaultPrefix;
- }
- Vector v = new Vector();
- for (int i = 0; i < namespaceInfoList.size(); i++) {
- NamespaceInfo nsinfo = (NamespaceInfo) namespaceInfoList.get(i);
- if (nsinfo.prefix != null) {
- v.addElement(nsinfo.prefix);
- }
- }
- if (v.contains(defaultPrefix)) {
- String s = defaultPrefix;
- for (int j = 0; v.contains(s); j++) {
- s = defaultPrefix + Integer.toString(j);
- }
- return s;
- }
- else {
- return defaultPrefix;
- }
- }
-
- public Object[] getElements(Object inputElement) {
- return namespaceInfoList.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public boolean isDeleted(Object element) {
- return false;
- }
-
- public boolean isLabelProperty(Object object, Object property) {
- return false;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
- }
-
- protected static final String LOCATION_HINT = XMLUIMessages._UI_LABEL_LOCATION_HINT;
- protected static final String NAMESPACE_URI = XMLUIMessages._UI_LABEL_NAMESPACE_NAME;
- protected static final String PREFIX = XMLUIMessages._UI_LABEL_PREFIX;
- protected Button deleteButton;
- protected boolean dummyRowsRemoved = false;
- protected Button editButton;
- protected List namespaceInfoList = new Vector();
- protected Button newButton;
- protected NamespaceInfoTableLabelProvider provider;
- protected IPath resourceLocation;
- protected TableViewer tableViewer;
- protected UpdateListener updateListener;
- protected int visibleRows = -1;
-
- public NamespaceInfoTable(Composite parent) {
- this(parent, -1, -1, -1);
- }
-
- public NamespaceInfoTable(Composite parent, int visibleRows) {
- this(parent, -1, -1, visibleRows);
- }
-
- public NamespaceInfoTable(Composite parent, int widthHint, int heightHint) {
- this(parent, widthHint, heightHint, -1);
- }
-
- public NamespaceInfoTable(Composite parent, int widthHint, int heightHint, int visibleRows) {
- super(parent, SWT.NONE);
- setLayout(createGridLayout());
- setLayoutData(new GridData(GridData.FILL_BOTH));
- Group namespaceInfoGroup = new Group(this, SWT.NONE);
- namespaceInfoGroup.setText(XMLUIMessages._UI_LABEL_XML_SCHEMA_INFORMATION);
- namespaceInfoGroup.setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- if (widthHint != -1) {
- gd.widthHint = widthHint;
- }
- if (heightHint != -1) {
- gd.heightHint = heightHint;
- }
- namespaceInfoGroup.setLayoutData(gd);
- // WorkbenchHelp.setHelp(namespaceInfoGroup, new
- // ControlContextComputer(namespaceInfoGroup,
- // XMLBuilderContextIds.XMLC_NAMESPACE_GROUP));
- String[] titleArray = {NAMESPACE_URI, PREFIX, LOCATION_HINT};
- tableViewer = new TableViewer(namespaceInfoGroup, SWT.FULL_SELECTION);
- provider = new NamespaceInfoTableLabelProvider();
- tableViewer.setContentProvider(provider);
- tableViewer.setLabelProvider(provider);
- tableViewer.setColumnProperties(titleArray);
- Table table = tableViewer.getTable();
- table.setHeaderVisible(true);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- int[] widthArray = {50, 20, 30};
- TableLayout layout = new TableLayout();
- for (int i = 0; i < titleArray.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(titleArray[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(widthArray[i], true));
- }
- this.visibleRows = visibleRows;
- for (int i = 0; i < visibleRows; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText("#######"); //$NON-NLS-1$
- }
- table.setLayout(layout);
- CellEditor[] cellEditors = new CellEditor[titleArray.length];
- cellEditors[1] = new TextCellEditor(table);
- cellEditors[2] = new TextCellEditor(table);
- tableViewer.setCellEditors(cellEditors);
- MouseAdapter mouseAdapter = new MouseAdapter() {
- public void mouseDoubleClick(MouseEvent e) {
- if (tableViewer.getTable().getItem(new Point(e.x, e.y)) != null) {
- performEdit();
- }
- }
- };
- table.addMouseListener(mouseAdapter);
- createButtons(namespaceInfoGroup);
- ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateButtonEnabledState();
- }
- };
- tableViewer.addSelectionChangedListener(selectionChangedListener);
- }
-
- protected void createButtons(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- composite.setLayout(gridLayout);
- Button hiddenButton = new Button(composite, SWT.NONE);
- hiddenButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- hiddenButton.setVisible(false);
- hiddenButton.setEnabled(false);
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == newButton) {
- performNew();
- }
- else if (e.widget == editButton) {
- performEdit();
- }
- else if (e.widget == deleteButton) {
- performDelete();
- }
- }
- };
- // create a composite to hold the three buttons
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- GridLayout buttonGridLayout = new GridLayout();
- buttonGridLayout.numColumns = 3;
- buttonGridLayout.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(buttonGridLayout);
- // add the New button
- //
- newButton = new Button(buttonComposite, SWT.NONE);
- newButton.setText(XMLUIMessages._UI_BUTTON_NEW);
- newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- newButton.addSelectionListener(selectionListener);
- // add the Edit button
- //
- editButton = new Button(buttonComposite, SWT.NONE);
- editButton.setText(XMLUIMessages._UI_BUTTON_EDIT);
- editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- editButton.addSelectionListener(selectionListener);
- // add the Delete button
- //
- deleteButton = new Button(buttonComposite, SWT.NONE);
- deleteButton.setText(XMLUIMessages._UI_BUTTON_DELETE);
- deleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- deleteButton.addSelectionListener(selectionListener);
- }
-
- public GridLayout createGridLayout() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.horizontalSpacing = 0;
- return gridLayout;
- }
-
- public List getNamespaceInfoList() {
- return namespaceInfoList;
- }
-
- protected NamespaceInfo getTargetNamespaceInfo() {
- return ((namespaceInfoList != null) && (namespaceInfoList.size() > 0)) ? (NamespaceInfo) namespaceInfoList.get(0) : null;
- }
-
- protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info) {
- Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(resourceLocation);
- dialog.open();
- return dialog;
- }
-
- protected void performDelayedUpdate() {
- Runnable delayedUpdate = new Runnable() {
- public void run() {
- update();
- }
- };
- getDisplay().asyncExec(delayedUpdate);
- if (updateListener != null) {
- updateListener.updateOccured(this, namespaceInfoList);
- }
- }
-
- public void performDelete() {
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject != null) {
- namespaceInfoList.remove(selectedObject);
- performDelayedUpdate();
- }
- }
-
- public void performEdit() {
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof NamespaceInfo) {
- invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, (NamespaceInfo) selectedObject);
- performDelayedUpdate();
- }
- }
-
- public void performNew() {
- NamespaceInfo info = new NamespaceInfo();
- EditNamespaceInfoDialog dialog = invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, info);
- if (dialog.getReturnCode() == Window.OK) {
- namespaceInfoList.add(info);
- performDelayedUpdate();
- }
- }
-
- public void setNamespaceInfoList(List namespaceInfoList) {
- this.namespaceInfoList = namespaceInfoList;
- update();
- }
-
- public void setResourceLocation(IPath resourceLocation) {
- this.resourceLocation = resourceLocation;
- }
-
- public void setUpdateListener(UpdateListener updateListener) {
- this.updateListener = updateListener;
- }
-
- public void update() {
- updateHelper(namespaceInfoList);
- }
-
- public void updateButtonEnabledState() {
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- NamespaceInfo info = (NamespaceInfo) selectedObject;
- editButton.setEnabled(info != null);
- deleteButton.setEnabled((info != null) && (info.getProperty("unremovable") == null)); //$NON-NLS-1$
- }
-
- public void updateHelper(List namespaceInfoList) {
- if ((visibleRows != -1) && !dummyRowsRemoved) {
- dummyRowsRemoved = true;
- tableViewer.getTable().removeAll();
- }
- ISelection selection = tableViewer.getSelection();
- tableViewer.setInput(namespaceInfoList);
- if (selection.isEmpty()) {
- if (namespaceInfoList.size() > 0) {
- tableViewer.setSelection(new StructuredSelection(namespaceInfoList.get(0)));
- }
- }
- else {
- tableViewer.setSelection(selection);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java
deleted file mode 100644
index d36cf7bc65..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java
+++ /dev/null
@@ -1,87 +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.xml.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class SelectFileOrXMLCatalogIdDialog extends Dialog {
- protected int catalogEntryType;
- protected String[] extensions;
- protected IFile file;
- protected String id;
- protected Button okButton;
- protected SelectFileOrXMLCatalogIdPanel panel;
-
- public SelectFileOrXMLCatalogIdDialog(Shell parentShell, String[] extensions) {
- this(parentShell, extensions, 0);
- }
-
- public SelectFileOrXMLCatalogIdDialog(Shell parentShell, String[] extensions, int catalogEntryType) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.extensions = extensions;
- this.catalogEntryType = catalogEntryType;
- }
-
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- file = panel.getFile();
- id = panel.getXMLCatalogId();
- }
- super.buttonPressed(buttonId);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- okButton.setEnabled(false);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- panel = new SelectFileOrXMLCatalogIdPanel(dialogArea);
- panel.setCatalogEntryType(catalogEntryType);
- panel.setFilterExtensions(extensions);
- panel.setVisibleHelper(true);
- SelectFileOrXMLCatalogIdPanel.Listener listener = new SelectFileOrXMLCatalogIdPanel.Listener() {
- public void completionStateChanged() {
- updateButtonState();
- }
- };
- panel.setListener(listener);
-
- return dialogArea;
- }
-
- public IFile getFile() {
- return file;
- }
-
- public String getId() {
- return id;
- }
-
- protected void updateButtonState() {
- okButton.setEnabled((panel.getFile() != null) || (panel.getXMLCatalogId() != null));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index 2987b045ca..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,184 +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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
- /**
- * TODO: Change the name of this interface; "Listener" is used by SWT.
- */
- public interface Listener {
- void completionStateChanged();
- }
-
- protected class MySelectSingleFileView extends SelectSingleFileView implements SelectSingleFileView.Listener {
- protected Control control;
-
- public MySelectSingleFileView(Composite parent) {
- super(null, true);
- // String[] ext = {".dtd"};
- // addFilterExtensions(ext);
- control = createControl(parent);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
- MySelectSingleFileView.this.setListener(this);
- }
-
- public Control getControl() {
- return control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
-
- public void setVisibleHelper(boolean isVisible) {
- super.setVisibleHelper(isVisible);
- }
- }
-
- protected Listener listener;
- protected PageBook pageBook;
-
- protected Button[] radioButton;
- protected MySelectSingleFileView selectSingleFileView;
- protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
- public SelectFileOrXMLCatalogIdPanel(Composite parent) {
- super(parent, SWT.NONE);
-
- // container group
- setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 400;
- gd.widthHint = 400;
- setLayoutData(gd);
-
- radioButton = new Button[2];
- radioButton[0] = new Button(this, SWT.RADIO);
- radioButton[0].setText(XMLUIMessages._UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE);
- radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[0].setSelection(true);
- radioButton[0].addSelectionListener(this);
-
- radioButton[1] = new Button(this, SWT.RADIO);
- radioButton[1].setText(XMLUIMessages._UI_RADIO_BUTTON_SELECT_FROM_CATALOG);
- radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[1].addSelectionListener(this);
-
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectSingleFileView = new MySelectSingleFileView(pageBook);
-
- ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
- selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateCompletionStateChange();
- }
- });
- Dialog.applyDialogFont(parent);
- pageBook.showPage(selectSingleFileView.getControl());
-
- }
-
- public IFile getFile() {
- IFile result = null;
- if (radioButton[0].getSelection()) {
- result = selectSingleFileView.getFile();
- }
- return result;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getXMLCatalogEntry();
- }
- return result;
- }
-
- public String getXMLCatalogId() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getId();
- }
- return result;
- }
-
- public String getXMLCatalogURI() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getURI();
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
- }
-
- public void setFilterExtensions(String[] filterExtensions) {
- selectSingleFileView.resetFilters();
- selectSingleFileView.addFilterExtensions(filterExtensions);
-
- selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
- }
-
- public void setListener(Listener listener) {
- this.listener = listener;
- }
-
- public void setVisibleHelper(boolean isVisible) {
- selectSingleFileView.setVisibleHelper(isVisible);
- }
-
- public void updateCompletionStateChange() {
- if (listener != null) {
- listener.completionStateChanged();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == radioButton[0]) {
- pageBook.showPage(selectSingleFileView.getControl());
- }
- else {
- pageBook.showPage(selectXMLCatalogIdPanel);
- }
- updateCompletionStateChange();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java
deleted file mode 100644
index 624c96a89c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java
+++ /dev/null
@@ -1,111 +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.xml.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-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.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-
-
-
-public class SelectXMLCatalogIdDialog extends Dialog {
- protected String[] extensions;
- protected Button okButton;
- protected SelectXMLCatalogIdPanel panel;
- protected String publicId;
- protected String systemId;
-
- public SelectXMLCatalogIdDialog(Shell parentShell, String[] extensions) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.extensions = extensions;
- }
-
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- ISelection selection = panel.getTableViewer().getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-
- if (selectedObject instanceof ICatalogEntry) {
- ICatalogEntry mappingInfo = (ICatalogEntry) selectedObject;
- publicId = mappingInfo.getKey();
- systemId = computeDefaultSystemId(mappingInfo);
- }
- }
- super.buttonPressed(buttonId);
- }
-
- protected String computeDefaultSystemId(ICatalogEntry mappingInfo) {
- String result = mappingInfo.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
- if ((result == null) && (mappingInfo.getURI() != null)) {
- int index = mappingInfo.getURI().lastIndexOf("/"); //$NON-NLS-1$
- String lastSegment = index != -1 ? mappingInfo.getURI().substring(index + 1) : mappingInfo.getURI();
- result = lastSegment;
- }
- return result;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- okButton.setEnabled(false);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_CATALOG_DIALOG);
-
- ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- panel = new SelectXMLCatalogIdPanel(dialogArea, xmlCatalog);
-
- ISelectionChangedListener listener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateButtonState();
- }
- };
- panel.getTableViewer().setFilterExtensions(extensions);
- panel.getTableViewer().addSelectionChangedListener(listener);
- return dialogArea;
- }
-
-
-
- public String getId() {
- return publicId;
- }
-
- public String getSystemId() {
- return systemId;
- }
-
- protected void updateButtonState() {
- ISelection selection = panel.getTableViewer().getSelection();
- okButton.setEnabled(!selection.isEmpty());
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 58e5767227..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.dialogs;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-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.Label;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
- protected int catalogEntryType;
- protected boolean doTableSizeHack = false;
-
- protected XMLCatalogTableViewer tableViewer;
- protected ICatalog fXmlCatalog;
-
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
- super(parent, SWT.NONE);
- this.fXmlCatalog = xmlCatalog;
-
- GridLayout gridLayout = new GridLayout();
- this.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 700;
- this.setLayoutData(gd);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(XMLUIMessages._UI_LABEL_XML_CATALOG_COLON);
-
- tableViewer = createTableViewer(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.setInput("dummy"); //$NON-NLS-1$
- }
-
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = XMLUIMessages._UI_LABEL_KEY;
- headings[1] = XMLUIMessages._UI_LABEL_URI;
-
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
- protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if (catalogEntryType == 0) {
- list.add(entry);
- }
- else if (catalogEntryType == entry.getEntryType()) {
- list.add(entry);
- }
- }
- }
-
- public Collection getXMLCatalogEntries() {
- List result = null;
-
- if ((fXmlCatalog == null) || doTableSizeHack) {
- // this lets us create a table with an initial height of
- // 10 rows
- // otherwise we get stuck with 0 row heigh table... that's
- // too small
- doTableSizeHack = false;
- result = new Vector();
- for (int i = 0; i < 6; i++) {
- result.add(""); //$NON-NLS-1$
- }
- }
- else {
- result = new Vector();
- processCatalog(result, fXmlCatalog);
- }
- return result;
- }
-
- private void processCatalog(List result, ICatalog catalog) {
- addXMLCatalogEntries(result, catalog.getCatalogEntries());
- INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- ICatalog nextCatalog = nextCatalogs[i].getReferencedCatalog();
- if (nextCatalog != null) {
- processCatalog(result, nextCatalog);
- }
- }
- }
- };
- return theTableViewer;
- }
-
-
- public String getId() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getKey() : null;
- }
-
- public XMLCatalogTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public String getURI() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getURI() : null;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry) {
- result = (ICatalogEntry) selectedObject;
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- this.catalogEntryType = catalogEntryType;
- tableViewer.refresh();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java
deleted file mode 100644
index 607270ad1f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java
+++ /dev/null
@@ -1,20 +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.xml.ui.internal.dialogs;
-
-public interface UpdateListener {
-
- public void updateOccured(Object object, Object arg);
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
deleted file mode 100644
index 62776b2528..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.dialogs;
-
-import com.ibm.icu.text.Collator;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-public class XMLCatalogTableViewer extends TableViewer {
-
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getElements(Object element) {
- Object[] array = getXMLCatalogEntries().toArray();
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
- ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(array, comparator);
- return array;
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
-
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
- }
-
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions) {
- this.extensions = extensions;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
- }
-
- protected static Image dtdFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DTDFILE);
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
- protected static Image errorImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OVR_ERROR);
-
- protected static Image unknownFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
- protected static Image xsdFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_XSDFILE);
-
- // protected ImageFactory imageFactory = new ImageFactory();
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
- super(parent, SWT.FULL_SELECTION | SWT.BORDER);
-
- Table table = getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
- table.setLayout(layout);
- table.setLinesVisible(false);
-
- setColumnProperties(columnProperties);
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public Collection getXMLCatalogEntries() {
- return null;
- }
-
-
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
deleted file mode 100644
index 736fc550ef..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.dnd;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class DragNodeCommand extends DefaultDragAndDropCommand {
- private List fSelections;
- private TreeViewer fTreeViewer;
-
- public DragNodeCommand(Object target, float location, int operations, int operation, Collection sources, TreeViewer treeViewer) {
- super(target, location, operations, operation, sources);
- fTreeViewer = treeViewer;
- fSelections = new ArrayList();
- }
-
- private void beginModelChange(Node node, boolean batchUpdate) {
- IStructuredModel structuredModel = getStructuredModel(node);
- if (structuredModel != null) {
- String undoDesc = new String();
- if (getOperation() == DND.DROP_MOVE) {
- undoDesc = XMLUIMessages.DragNodeCommand_0;
- }
- else if (getOperation() == DND.DROP_COPY) {
- undoDesc = XMLUIMessages.DragNodeCommand_1;
- }
-
- structuredModel.beginRecording(this, undoDesc);
- if (batchUpdate) {
- // structuredModel.aboutToChangeModel();
- }
- }
- }
-
- public boolean canExecute() {
- return executeHelper(true);
- }
-
- private boolean doModify(Node source, Node parentNode, Node refChild, boolean testOnly) {
- boolean result = false;
- if (source.getNodeType() == Node.ATTRIBUTE_NODE) {
- Attr sourceAttribute = (Attr) source;
- Element sourceAttributeOwnerElement = sourceAttribute.getOwnerElement();
- if ((parentNode.getNodeType() == Node.ELEMENT_NODE) && (sourceAttributeOwnerElement != parentNode)) {
- result = true;
- if (!testOnly) {
- try {
- if (getOperation() == DND.DROP_MOVE) {
- Element targetElement = (Element) parentNode;
- sourceAttributeOwnerElement.removeAttributeNode(sourceAttribute);
- targetElement.getAttributes().setNamedItem(sourceAttribute);
- fSelections.add(sourceAttribute);
- }
- else if (getOperation() == DND.DROP_COPY) {
- Attr cloneAttribute = (Attr) sourceAttribute.cloneNode(false);
- Element targetElement = (Element) parentNode;
- targetElement.getAttributes().setNamedItem(cloneAttribute);
- fSelections.add(cloneAttribute);
- }
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
- }
- else {
- if (((parentNode.getNodeType() == Node.ELEMENT_NODE) || (parentNode.getNodeType() == Node.DOCUMENT_NODE)) && !(refChild instanceof Attr)) {
- result = true;
-
- if (!testOnly) {
- try {
- if (isAncestor(source, parentNode)) {
- // System.out.println("can not perform this drag drop
- // operation.... todo... pop up dialog");
- }
- else {
- // defect 221055 this test is required or else the
- // node will
- // be removed from the tree and the insert will fail
- if (source != refChild) {
- if (getOperation() == DND.DROP_MOVE) {
- Node oldParent = source.getParentNode();
- Node oldSibling = source.getNextSibling();
- oldParent.removeChild(source);
- try {
- parentNode.insertBefore(source, refChild);
- } catch (DOMException e) {
- // bug151692 - if unable to move node to new location, reinsert back to old location
- oldParent.insertBefore(source, oldSibling);
- }
- fSelections.add(source);
- }
- else if (getOperation() == DND.DROP_COPY) {
- Node nodeClone = source.cloneNode(true);
- parentNode.insertBefore(nodeClone, refChild);
- fSelections.add(nodeClone);
- }
- }
- }
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
- }
- return result;
- }
-
- private void endModelChange(Node node, boolean batchUpdate) {
- IStructuredModel structuredModel = getStructuredModel(node);
- if (structuredModel != null) {
- structuredModel.endRecording(this);
- if (batchUpdate) {
- // structuredModel.changedModel();
- }
- }
- }
-
- public void execute() {
- executeHelper(false);
-
- // Make our selection if the treeViewer != null
- if (fTreeViewer != null) {
- StructuredSelection structuredSelection = new StructuredSelection(fSelections);
- fTreeViewer.setSelection(structuredSelection);
- }
- }
-
- private boolean executeHelper(boolean testOnly) {
- boolean result = true;
- if (target instanceof Node) {
- Node targetNode = (Node) target;
- if (!testOnly && fTreeViewer != null && !validateEdit(getStructuredModel(targetNode), fTreeViewer.getControl().getShell()))
- return false;
-
- Node parentNode = getParentForDropPosition(targetNode);
- Node refChild = getRefChild(targetNode);
-
- Vector sourcesList = new Vector();
- sourcesList.addAll(sources);
-
- removeMemberDescendants(sourcesList);
- boolean performBatchUpdate = sourcesList.size() > 5;
-
- if (!testOnly) {
- beginModelChange(targetNode, performBatchUpdate);
- }
- for (Iterator i = sourcesList.iterator(); i.hasNext();) {
- Object source = i.next();
- if (source instanceof Node) {
- if (!((refChild == null) && (targetNode instanceof Attr)) && (parentNode != null)) {
- result = doModify((Node) source, parentNode, refChild, testOnly);
- }
- else {
- result = false;
- }
- if (!result) {
- break;
- }
- }
- }
- if (!testOnly) {
- endModelChange(targetNode, performBatchUpdate);
- }
- }
- else {
- result = false;
- }
- return result;
- }
-
- /**
- * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
- * on a given <tt>IWorkspace</tt>.
- *
- * @param model the model to be checked
- * @param context the shell context for which <code>validateEdit</code> will be run
- * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
- * will return true; otherwise, false.
- */
- private boolean validateEdit(IStructuredModel model, Shell context) {
- if (model != null && model.getBaseLocation() != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
- }
- return false; //$NON-NLS-1$
- }
-
- public int getFeedback() {
- int result = DND.FEEDBACK_SELECT;
- if (location > 0.75) {
- result = DND.FEEDBACK_INSERT_AFTER;
- }
- else if (location < 0.25) {
- result = DND.FEEDBACK_INSERT_BEFORE;
- }
- return result;
- }
-
- private Node getParentForDropPosition(Node node) {
- Node result = null;
-
- int feedback = getFeedback();
- if (feedback == DND.FEEDBACK_SELECT) {
- result = node;
- }
- else {
- result = getParentOrOwner(node);
- }
- return result;
- }
-
-
- private Node getParentOrOwner(Node node) {
- return (node.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) node).getOwnerElement() : node.getParentNode();
- }
-
-
- private Node getRefChild(Node node) {
- Node result = null;
-
- int feedback = getFeedback();
-
- if (feedback == DND.FEEDBACK_INSERT_BEFORE) {
- result = node;
- }
- else if (feedback == DND.FEEDBACK_INSERT_AFTER) {
- result = node.getNextSibling();
- }
- return result;
- }
-
- private IStructuredModel getStructuredModel(Node node) {
- IStructuredModel result = null;
- if (node instanceof IDOMNode) {
- result = ((IDOMNode) node).getModel();
- }
- return result;
- }
-
- // returns true if a is an ancestore of b
- //
- private boolean isAncestor(Node a, Node b) {
- boolean result = false;
- for (Node parent = b; parent != null; parent = parent.getParentNode()) {
- if (parent == a) {
- result = true;
- break;
- }
- }
- return result;
- }
-
-
- /**
- * This method removes members of the list that have ancestors that are
- * also members of the list.
- */
- private void removeMemberDescendants(List list) {
- Hashtable table = new Hashtable();
- for (Iterator i = list.iterator(); i.hasNext();) {
- Object node = i.next();
- table.put(node, node);
- }
-
- for (int i = list.size() - 1; i >= 0; i--) {
- Object node = list.get(i);
- if (node instanceof Node){
- for (Node parent = getParentOrOwner((Node)node); parent != null; parent = getParentOrOwner(parent)) {
- if (table.get(parent) != null) {
- list.remove(i);
- break;
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java
deleted file mode 100644
index 48097a81eb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java
+++ /dev/null
@@ -1,54 +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.xml.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
-import org.eclipse.wst.common.ui.internal.dnd.ObjectTransfer;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDragAdapter;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDropAdapter;
-import org.w3c.dom.Node;
-
-public class XMLDragAndDropManager implements DragAndDropManager {
- private TreeViewer fViewer;
-
- public static void addDragAndDropSupport(TreeViewer viewer) {
- int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[]{ObjectTransfer.getInstance()};
- viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new ViewerDropAdapter(viewer, new XMLDragAndDropManager(viewer)));
- }
-
- public XMLDragAndDropManager() {
- super();
- }
-
- public XMLDragAndDropManager(TreeViewer viewer) {
- fViewer = viewer;
- }
-
- public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
- DragAndDropCommand result = null;
- if (target instanceof Node) {
- result = new DragNodeCommand(target, location, operations, operation, source, fViewer);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
deleted file mode 100644
index 4d35d879f3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
+++ /dev/null
@@ -1,324 +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.xml.ui.internal.doubleclick;
-
-import org.eclipse.jface.text.DefaultTextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.graphics.Point;
-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.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-
-public class XMLDoubleClickStrategy extends DefaultTextDoubleClickStrategy {
- protected static final char DOUBLE_QUOTE = '\"';
- protected static final char SINGLE_QUOTE = '\'';
- protected static final char SPACE = ' ';
- protected int fCaretPosition = -1;
- protected int fDoubleClickCount = 0;
- protected Node fNode = null;
- protected IStructuredDocumentRegion fStructuredDocumentRegion = null;
- protected String fStructuredDocumentRegionText = ""; //$NON-NLS-1$
- protected IStructuredModel fStructuredModel = null;
- protected ITextViewer fTextViewer;
- protected ITextRegion fTextRegion = null;
-
- public void doubleClicked(ITextViewer textViewer) {
- fTextViewer = textViewer;
- try {
- fStructuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(fTextViewer.getDocument());
-
- if (fStructuredModel != null) {
- int caretPosition = textViewer.getSelectedRange().x;
- if (caretPosition < 0) {
- return;
- }
-
- fNode = (Node) fStructuredModel.getIndexedRegion(caretPosition);
- if (fNode == null) {
- return;
- }
-
- updateDoubleClickCount(caretPosition);
- updateStructuredDocumentRegion();
- updateTextRegion();
-
- if (fNode.getNodeType() == Node.TEXT_NODE) {
- processTextDoubleClicked();
- }
- else {
- processElementDoubleClicked();
- }
- }
- }
- finally {
- if (fStructuredModel != null) {
- fStructuredModel.releaseFromRead();
- }
- }
- }
-
- protected Point getWord(String string, int cursor) {
- if (string == null) {
- return null;
- }
-
- int wordStart = 0;
- int wordEnd = string.length();
-
- wordStart = string.lastIndexOf(SPACE, cursor - 1);
- int temp = string.lastIndexOf(SINGLE_QUOTE, cursor - 1);
- wordStart = Math.max(wordStart, temp);
- temp = string.lastIndexOf(DOUBLE_QUOTE, cursor - 1);
- wordStart = Math.max(wordStart, temp);
- if (wordStart == -1) {
- wordStart = cursor;
- }
- else {
- wordStart++;
- }
-
- wordEnd = string.indexOf(SPACE, cursor);
- if (wordEnd == -1) {
- wordEnd = string.length();
- }
- temp = string.indexOf(SINGLE_QUOTE, cursor);
- if (temp == -1) {
- temp = string.length();
- }
- wordEnd = Math.min(wordEnd, temp);
- temp = string.indexOf(DOUBLE_QUOTE, cursor);
- if (temp == -1) {
- temp = string.length();
- }
- wordEnd = Math.min(wordEnd, temp);
- if (wordEnd == string.length()) {
- wordEnd = cursor;
- }
-
- if ((wordStart == wordEnd) && !isQuoted(string)) {
- wordStart = 0;
- wordEnd = string.length();
- }
-
- return new Point(wordStart, wordEnd);
- }
-
- protected boolean isQuoted(String string) {
- if ((string == null) || (string.length() < 2)) {
- return false;
- }
-
- int lastIndex = string.length() - 1;
- char firstChar = string.charAt(0);
- char lastChar = string.charAt(lastIndex);
-
- return (((firstChar == SINGLE_QUOTE) && (lastChar == SINGLE_QUOTE)) || ((firstChar == DOUBLE_QUOTE) && (lastChar == DOUBLE_QUOTE)));
- }
-
- protected void processElementAttrEqualsDoubleClicked2Times() {
- int prevRegionOffset = fStructuredDocumentRegion.getStartOffset(fTextRegion) - 1;
- ITextRegion prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
- int nextRegionOffset = fStructuredDocumentRegion.getEndOffset(fTextRegion);
- ITextRegion nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
-
- if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && (nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), nextRegion.getTextEnd() - prevRegion.getStart());
- }
- }
-
- protected void processElementAttrNameDoubleClicked2Times() {
- int nextRegionOffset = fStructuredDocumentRegion.getEndOffset(fTextRegion);
- ITextRegion nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
-
- if (nextRegion != null) {
- nextRegionOffset = fStructuredDocumentRegion.getEndOffset(nextRegion);
- nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
- if ((nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), nextRegion.getTextEnd() - fTextRegion.getStart());
- }
- else {
- // attribute has no value
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
- }
-
- protected void processElementAttrValueDoubleClicked() {
- String regionText = fStructuredDocumentRegion.getText(fTextRegion);
-
- if (fDoubleClickCount == 1) {
- Point word = getWord(regionText, fCaretPosition - fStructuredDocumentRegion.getStartOffset(fTextRegion));
- if (word.x == word.y) { // no word found; select whole region
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
- fDoubleClickCount++;
- }
- else {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + word.x, word.y - word.x);
- }
- }
- else if (fDoubleClickCount == 2) {
- if (isQuoted(regionText)) {
- // ==> // Point word = getWord(regionText, fCaretPosition -
- // fStructuredDocumentRegion.getStartOffset(fTextRegion));
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
- }
- else {
- processElementAttrValueDoubleClicked2Times();
- }
- }
- else if (fDoubleClickCount == 3) {
- if (isQuoted(regionText)) {
- processElementAttrValueDoubleClicked2Times();
- }
- else {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
- else { // fDoubleClickCount == 4
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
-
- protected void processElementAttrValueDoubleClicked2Times() {
- int prevRegionOffset = fStructuredDocumentRegion.getStartOffset(fTextRegion) - 1;
- ITextRegion prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
-
- if (prevRegion != null) {
- prevRegionOffset = fStructuredDocumentRegion.getStartOffset(prevRegion) - 1;
- prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
- if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), fTextRegion.getTextEnd() - prevRegion.getStart());
- }
- }
- }
-
- protected void processElementDoubleClicked() {
- if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- processElementAttrValueDoubleClicked(); // special handling for
- }
- else {
- if (fDoubleClickCount == 1) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + fTextRegion.getStart(), fTextRegion.getTextLength());
- }
- else if (fDoubleClickCount == 2) {
- if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- processElementAttrNameDoubleClicked2Times();
- }
- else if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- processElementAttrEqualsDoubleClicked2Times();
- }
- else {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
- else { // fDoubleClickCount == 3
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
- }
-
- protected void processTextDoubleClicked() {
- if (fDoubleClickCount == 1) {
- super.doubleClicked(fTextViewer);
-
- Point selectedRange = fTextViewer.getSelectedRange();
- if ((selectedRange.x == fStructuredDocumentRegion.getStartOffset(fTextRegion)) && (selectedRange.y == fTextRegion.getTextLength())) {
- // only one word in region, skip one level of double click
- // selection
- fDoubleClickCount++;
- }
- }
- else if (fDoubleClickCount == 2) {
- if (fTextRegion.getType() == DOMRegionContext.UNDEFINED) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- else {
- if (isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion))) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + 1, fTextRegion.getTextLength() - 2);
- }
- else {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
- }
- }
- }
- else {
- if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion))) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
- }
- else {
- if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegionText)) {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + 1, fStructuredDocumentRegion.getLength() - 2);
- }
- else {
- fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
- fDoubleClickCount = 0;
- }
- }
- }
- }
-
- public void setModel(IStructuredModel structuredModel) {
- fStructuredModel = structuredModel;
- }
-
- protected void updateDoubleClickCount(int caretPosition) {
- if (fCaretPosition == caretPosition) {
- if (fStructuredDocumentRegion != null) {
- fDoubleClickCount++;
- }
- else {
- fDoubleClickCount = 1;
- }
- }
- else {
- fCaretPosition = caretPosition;
- fDoubleClickCount = 1;
- }
- }
-
- protected void updateStructuredDocumentRegion() {
- fStructuredDocumentRegion = fStructuredModel.getStructuredDocument().getRegionAtCharacterOffset(fCaretPosition);
- if (fStructuredDocumentRegion != null) {
- fStructuredDocumentRegionText = fStructuredDocumentRegion.getText();
- }
- else {
- fStructuredDocumentRegionText = ""; //$NON-NLS-1$
- }
- }
-
- protected void updateTextRegion() {
- if (fStructuredDocumentRegion != null) {
- fTextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(fCaretPosition);
- // if fTextRegion is null, it means we are at just past the last
- // fStructuredDocumentRegion,
- // at the very end of the document, so we'll use the last text
- // region in the document
- if (fTextRegion == null) {
- fTextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(fCaretPosition - 1);
- }
- }
- else {
- fTextRegion = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
deleted file mode 100644
index 7fa80c84d0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xml.ui.internal.editor;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.wst.sse.core.internal.util.JarUtilities;
-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.ui.internal.XMLUIPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author nsd
- */
-public class CMImageUtil {
-
- public static String SMALL_ICON_URL = "small-icon"; //$NON-NLS-1$
-
- public static CMNode getDeclaration(Node node) {
- CMNode decl = null;
- ModelQuery mq = null;
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE : {
- mq = ModelQueryUtil.getModelQuery(((Attr) node).getOwnerDocument());
- decl = mq.getCMAttributeDeclaration((Attr) node);
- }
- break;
- case Node.ELEMENT_NODE : {
- mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- decl = mq.getCMElementDeclaration((Element) node);
- }
- break;
- }
- return decl;
- }
-
- public static Image getImage(CMNode cmnode) {
- if (cmnode == null) {
- return null;
- }
- Image image = null;
- // cache CM-specified images with the XML UI plugin
- String imageURLString = (String) cmnode.getProperty(SMALL_ICON_URL);
- if ((imageURLString != null) && (imageURLString.length() > 0)) {
- /* First ensure that the descriptor itself is cached */
- ImageDescriptor imageDescriptor = getImageDescriptor(imageURLString);
- if (imageDescriptor != null) {
- /*
- * Then obtain the image from the registry so that it is both
- * cached and properly disposed of later
- */
- image = getImageRegistry().get(imageURLString);
- }
- }
- return image;
- }
-
- public static ImageDescriptor getImageDescriptor(CMNode cmnode) {
- if (cmnode == null) {
- return null;
- }
- // cache CM-specified images with the XML UI plugin
- String imageURLString = (String) cmnode.getProperty(SMALL_ICON_URL);
- ImageDescriptor descriptor = null;
- if ((imageURLString != null) && (imageURLString.length() > 0)) {
- descriptor = getImageDescriptor(imageURLString);
- }
- return descriptor;
- }
-
- private static ImageDescriptor getImageDescriptor(String imageURLString) {
- ImageDescriptor descriptor = getImageRegistry().getDescriptor(imageURLString);
- if (descriptor == null) {
- try {
- URL imageURL = new URL(imageURLString);
- InputStream inputStream = JarUtilities.getInputStream(imageURL);
- try {
- if (inputStream != null) {
- ImageData data = new ImageData(inputStream);
- descriptor = ImageDescriptor.createFromImageData(data);
- getImageRegistry().put(imageURLString, descriptor);
- }
- }
- catch (SWTException e) {
- /*
- * There was a problem loading image from stream
- * (corrupt, missing, etc.)
- */
- if (inputStream != null)
- inputStream.close();
- }
- }
- catch (MalformedURLException e) {
- descriptor = null;
- }
- catch (IOException e) {
- descriptor = null;
- }
- }
- return descriptor;
- }
-
- private static final ImageRegistry getImageRegistry() {
- return XMLUIPlugin.getInstance().getImageRegistry();
- }
-
- /**
- *
- */
- private CMImageUtil() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java
deleted file mode 100644
index 0f0988b6f7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.editor;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor;
-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.w3c.dom.NamedNodeMap;
-
-/**
- * @author nitin
- *
- */
-public class DOMSelectionConvertorFactory implements IAdapterFactory {
-
- private static final Class[] ADAPTER_LIST = new Class[]{SelectionConvertor.class};
-
- private static class XMLSelectionConvertor extends SelectionConvertor {
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor#getElements(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)
- */
- public Object[] getElements(IStructuredModel model, int start, int end) {
- Object[] objects = super.getElements(model, start, end);
- // narrow single selected Elements into Attrs if possible
- if (objects.length == 1) {
- if (objects[0] instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) objects[0];
- NamedNodeMap attributes = node.getAttributes();
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- IDOMAttr attribute = (IDOMAttr) attributes.item(i);
- if (attribute.contains(start) && attribute.contains(end)) {
- objects[0] = attribute;
- break;
- }
- }
- }
- }
- }
- return objects;
- }
- }
-
- private static final Object selectionConvertor = new XMLSelectionConvertor();
-
- /**
- *
- */
- public DOMSelectionConvertorFactory() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
- * java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof IDOMModel && SelectionConvertor.class.equals(adapterType))
- return selectionConvertor;
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index f7542e3cd6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.editor;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * Help context ids for the XML Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.xml.ui.
- public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
-
- // figured out on the fly
- // // XML Source page editor
- // public static final String XML_SOURCEVIEW_HELPID =
- // ContentTypeIdForXML.ContentTypeID_XML +"_source_HelpId"; //$NON-NLS-1$
-
- // XML Files Preference page
- public static final String XML_PREFWEBX_FILES_HELPID = PREFIX + "webx0060"; //$NON-NLS-1$
- // XML Source Preference page
- public static final String XML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0061"; //$NON-NLS-1$
- // XML Styles Preference page
- public static final String XML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0062"; //$NON-NLS-1$
- // XML Templates Preference page
- public static final String XML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0063"; //$NON-NLS-1$
- // XML Validator Preference page
- public static final String XML_PREFWEBX_VALIDATOR_HELPID = PREFIX + "webx0064"; //$NON-NLS-1$
-
- // XML Cleanup dialog
- public static final String CLEANUP_XML_HELPID = PREFIX + "xmlm1200"; //$NON-NLS-1$
-
- // XML New File Wizard - Template Page
- public static final String XML_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "xmlw0010"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
deleted file mode 100644
index 73b67360e8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,159 +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.xml.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-/**
- * 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 XMLEditorPluginImageHelper {
- private static XMLEditorPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a XMLEditorPluginImageHelper
- */
- public synchronized static XMLEditorPluginImageHelper getInstance() {
- if (instance == null) {
- instance = new XMLEditorPluginImageHelper();
- }
- return instance;
- }
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
- private final String PLUGINID = XMLUIPlugin.ID;
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
- getImageRegistry().put(resource, image);
- }
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null) {
- fImageDescRegistry = new HashMap();
- }
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return XMLUIPlugin.getDefault().getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
deleted file mode 100644
index b82c4b824a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.editor;
-
-/**
- * Bundle of most images used by the XML Source Editor plug-in.
- */
-public class XMLEditorPluginImages {
-
- public static final String IMG_DTOOL_CONSTRAINOFF = "icons/full/dtool16/constrainoff.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_CONSTRAINON = "icons/full/dtool16/constrainon.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_RLDGRMR = "icons/full/dtool16/rldgrmr.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_VALIDATE = "icons/full/dtool16/validate.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_CONSTRAINOFF = "icons/full/etool16/constrainoff.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_CONSTRAINON = "icons/full/etool16/constrainon.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_RLDGRMR = "icons/full/etool16/rldgrmr.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_VALIDATE = "icons/full/etool16/validate.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_CORRECTION = "icons/full/obj16/add_correction.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ATT_REQ_OBJ = "icons/full/obj16/att_req_obj.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CDATASECTION = "icons/full/obj16/cdatasection.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_COMMENT = "icons/full/obj16/comment_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CORRECTION_CHANGE = "icons/full/obj16/correction_change.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_DOCTYPE = "icons/full/obj16/doctype.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_DTDFILE = "icons/full/obj16/dtdfile.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ELEMENT = "icons/full/obj16/element_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ENTITY = "icons/full/obj16/entity.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ENTITY_REFERENCE = "icons/full/obj16/entity_reference.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ENUM = "icons/full/obj16/enum.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_LOCAL_VARIABLE = "icons/full/obj16/localvariable_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_NOTATION = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_PROCESSINGINSTRUCTION = "icons/full/obj16/proinst_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC_DEEMPHASIZED = "icons/full/obj16/tag_generic_deemphasized_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC_EMPHASIZED = "icons/full/obj16/tag_generic_emphasized_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_MACRO = "icons/full/obj16/tag-macro.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TXTEXT = "icons/full/obj16/text.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_WARNING_OBJ = "icons/full/obj16/warning_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ERROR_OBJ = "icons/full/obj16/error_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_XSDFILE = "icons/full/obj16/XSDFile.gif"; //$NON-NLS-1$
-
- public static final String IMG_OVR_ERROR = "icons/full/ovr16/error_ovr.gif"; //$NON-NLS-1$
- public static final String IMG_OVR_STALE_ERROR = "icons/full/ovr16/stale_error_ovr.gif"; //$NON-NLS-1$
- public static final String IMG_OVR_WARN = "icons/full/ovr16/warn_ovr.gif"; //$NON-NLS-1$
-
- public static final String IMG_WIZBAN_GENERATEXML = "icons/full/wizban/generatexml_wiz.png"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_DEFAULT = "icons/full/obj16/default.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/propertytester/XMLEditorTester.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/propertytester/XMLEditorTester.java
deleted file mode 100644
index fba88e0e6a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/propertytester/XMLEditorTester.java
+++ /dev/null
@@ -1,46 +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.wst.xml.ui.internal.editor.propertytester;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * A property tester that determines if the editor part is or contains (in the case of a {@link org.eclipse.ui.part.MultiPageEditorPart}) the XML editor.
- *
- */
-public class XMLEditorTester extends PropertyTester {
-
- private static final String PROPERTY = "editor"; //$NON-NLS-1$
-
- /** The XML editor's part ID */
- private static final String EDITOR_ID = "org.eclipse.core.runtime.xml.source"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof IEditorPart && PROPERTY.equals(property)) {
- ITextEditor editor = null;
- if (receiver instanceof ITextEditor)
- editor = (ITextEditor) receiver;
- else
- editor = (ITextEditor) ((IEditorPart) receiver).getAdapter(ITextEditor.class);
- if (editor != null) {
- IEditorSite site = editor.getEditorSite();
- if (site != null) {
- return EDITOR_ID.equals(site.getId());
- }
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/AbstractSiblingNavigationHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/AbstractSiblingNavigationHandler.java
deleted file mode 100644
index 4e0565bbf2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/AbstractSiblingNavigationHandler.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Provides navigation to next/previous DOM sibling Nodes
- */
-abstract public class AbstractSiblingNavigationHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
-
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o instanceof Node) {
- Node sibling = null;
-
- if (((Node) o).getNodeType() == Node.ATTRIBUTE_NODE) {
- o = ((Attr) o).getOwnerElement();
- }
- if (moveForward()) {
- sibling = ((Node) o).getNextSibling();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getNextSibling();
- }
- if (sibling == null) {
- sibling = ((Node) o).getParentNode().getFirstChild();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getNextSibling();
- }
- }
- }
- else {
- sibling = ((Node) o).getPreviousSibling();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getPreviousSibling();
- }
- if (sibling == null) {
- sibling = ((Node) o).getParentNode().getLastChild();
- while (sibling != null && sibling.getNodeType() == Node.TEXT_NODE && sibling.getNodeValue().trim().length() == 0) {
- sibling = sibling.getPreviousSibling();
- }
- }
- }
-
- // The only child is a Text Node, go to the parent Node
- if (((Node) o).getNodeType() == Node.TEXT_NODE && o.equals(sibling)) {
- sibling = ((Node) o).getParentNode();
- }
-
-
- if (sibling != null) {
- textEditor.getSelectionProvider().setSelection(new StructuredSelection(sibling));
- }
- }
- }
- }
- return null;
- }
-
- abstract protected boolean moveForward();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CleanupdocumentHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CleanupdocumentHandler.java
deleted file mode 100644
index 0d46a0e6d9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CleanupdocumentHandler.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation - bug 212330 -
- * Based off CleanupActionXMLDelegate
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.cleanup.CleanupProcessorXML;
-import org.eclipse.wst.xml.ui.internal.actions.CleanupDialogXML;
-
-public class CleanupdocumentHandler extends AbstractHandler implements IHandler {
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void dispose() {
- // nulling out just in case
- fCleanupProcessor = null;
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- final ITextEditor finalTextEditor = textEditor;
- Dialog cleanupDialog = new CleanupDialogXML(editor.getSite().getShell());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(finalTextEditor.getDocumentProvider().getDocument(finalTextEditor.getEditorInput()));
- if (model != null) {
- cleanupProcessor.cleanupModel(model);
- }
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) textEditor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength());
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(textEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) textEditor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
-
- return null;
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null) {
- fCleanupProcessor = new CleanupProcessorXML();
- }
-
- return fCleanupProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CollapseAllHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CollapseAllHandler.java
deleted file mode 100644
index 60c644be2e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CollapseAllHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class CollapseAllHandler extends ExpandCollapseAllHandler implements IHandler {
-
- /**
- *
- */
- public CollapseAllHandler() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
-
- viewer = getTableTreeViewerForEditorPart(editorPart);
-
- if (viewer != null) {
- // temporarily set the visibility to false
- // this has a HUGE performance benefit
- boolean isVisible = viewer.getControl().getVisible();
- viewer.getControl().setVisible(false);
- viewer.collapseAll();
-
- // restore the previous visibility state
- //
- viewer.getControl().setVisible(isVisible);
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ContentModelSynchWithEditorHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ContentModelSynchWithEditorHandler.java
deleted file mode 100644
index b3017e732d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ContentModelSynchWithEditorHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class ContentModelSynchWithEditorHandler extends
- AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- Command command = event.getCommand();
- HandlerUtil.toggleCommandState(command);
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandAllHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandAllHandler.java
deleted file mode 100644
index 9091399bbc..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandAllHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer;
-
-public class ExpandAllHandler extends ExpandCollapseAllHandler {
-
- protected XMLTableTreeViewer viewer = null;
-
- /**
- *
- */
- public ExpandAllHandler() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
-
- viewer = getTableTreeViewerForEditorPart(editorPart);
-
- if (viewer != null) {
- // temporarily set the visibility to false
- // this has a HUGE performance benefit
- boolean isVisible = viewer.getControl().getVisible();
- viewer.getControl().setVisible(false);
- viewer.expandAll();
-
- // restore the previous visibility state
- //
- viewer.getControl().setVisible(isVisible);
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandCollapseAllHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandCollapseAllHandler.java
deleted file mode 100644
index 52d40f4d5d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandCollapseAllHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.menus.UIElement;
-import org.eclipse.wst.xml.ui.internal.tabletree.IDesignViewer;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer;
-
-public class ExpandCollapseAllHandler extends AbstractHandler implements IElementUpdater {
-
- protected XMLTableTreeViewer viewer = null;
-
- /**
- * Command handler for handling Expand and Collapse for Tree Viewer
- */
- public ExpandCollapseAllHandler() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // Implementors to put their code here.
-
- return null;
- }
-
- protected XMLTableTreeViewer getTableTreeViewerForEditorPart(IEditorPart targetEditor) {
- XMLTableTreeViewer result = null;
- Object object = targetEditor.getAdapter(IDesignViewer.class);
- if (object instanceof XMLTableTreeViewer) {
- result = (XMLTableTreeViewer) object;
- }
- return result;
- }
-
- public void updateElement(UIElement element, Map parameters) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/NextSiblingNavigationHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/NextSiblingNavigationHandler.java
deleted file mode 100644
index c25951cc89..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/NextSiblingNavigationHandler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-public class NextSiblingNavigationHandler extends AbstractSiblingNavigationHandler {
-
- protected boolean moveForward() {
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/PreviousSiblingNavigationHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/PreviousSiblingNavigationHandler.java
deleted file mode 100644
index 3442a8b523..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/PreviousSiblingNavigationHandler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-public class PreviousSiblingNavigationHandler extends AbstractSiblingNavigationHandler {
-
- protected boolean moveForward() {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ReloadDependenciesHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ReloadDependenciesHandler.java
deleted file mode 100644
index c371a18e21..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ReloadDependenciesHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-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.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-
-public class ReloadDependenciesHandler extends AbstractHandler implements IHandler {
- protected IStructuredModel model;
-
- /**
- *
- */
- public ReloadDependenciesHandler() {
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- ModelQuery modelQuery = null;
- try {
- modelQuery = ModelQueryUtil.getModelQuery(model);
- }
- finally {
- model.releaseFromRead();
- }
- Document domDocument = ((IDOMModel) model).getDocument();
- if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
- modelQuery.getCMDocumentManager().getCMDocumentCache().clear();
- // TODO... need to figure out how to access the
- // DOMObserver via ModelQuery
- // ...why?
- CMDocumentLoader loader = new InferredGrammarBuildingCMDocumentLoader(domDocument, modelQuery);
- loader.loadCMDocuments();
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectEnclosingXMLHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectEnclosingXMLHandler.java
deleted file mode 100644
index f043b6e1b6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectEnclosingXMLHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-import org.w3c.dom.Node;
-
-public class StructuredSelectEnclosingXMLHandler extends AbstractStructuredSelectHandler {
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
- if ((cursorNodeRegion.getOffset() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength())) {
- Node newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectNextXMLHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectNextXMLHandler.java
deleted file mode 100644
index 366789fc29..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectNextXMLHandler.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-import org.w3c.dom.Node;
-
-public class StructuredSelectNextXMLHandler extends AbstractStructuredSelectHandler {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- int offset = textSelection.getOffset() + textSelection.getLength() - 1;
- if (offset < 0) {
- offset = 0;
- }
-
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, offset);
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if ((cursorNodeRegion.getOffset() >= currentOffset) && (cursorNodeRegion.getOffset() <= currentEndOffset) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset)) {
- newRegion = getNewSelectionRegion2(indexedRegion, textSelection);
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-
- /**
- * This method was separated out from getNewSelectionRegion2 because the
- * code in here is allowed to be called recursively.
- *
- * @param indexedRegion
- * @param textSelection
- * @return new region to select or null if none
- */
- private Region getNewSelectionRegion2(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node node = (Node) indexedRegion;
- Node newNode = node.getNextSibling();
- if (newNode == null) {
- newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(textSelection.getOffset(), newIndexedRegion.getEndOffset() - textSelection.getOffset());
-
- if (newNode.getNodeType() == Node.TEXT_NODE) {
- newRegion = getNewSelectionRegion2(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
- }
- }
- }
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectPreviousXMLHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectPreviousXMLHandler.java
deleted file mode 100644
index 1e7a80201f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectPreviousXMLHandler.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.wst.xml.ui.internal.handlers;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
-import org.w3c.dom.Node;
-
-public class StructuredSelectPreviousXMLHandler extends AbstractStructuredSelectHandler {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
- if ((cursorNodeRegion.getOffset() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength())) {
-
- newRegion = getNewSelectionRegion2(indexedRegion, textSelection);
-
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-
- /**
- * This method was separated out from getNewSelectionRegion2 because the
- * code in here is allowed to be called recursively.
- *
- * @param indexedRegion
- * @param textSelection
- * @return new region to select or null if none
- */
- protected Region getNewSelectionRegion2(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node node = (Node) indexedRegion;
-
- Node newNode = node.getPreviousSibling();
- if (newNode == null) {
- newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), textSelection.getOffset() + textSelection.getLength() - newIndexedRegion.getStartOffset());
-
- if (newNode.getNodeType() == Node.TEXT_NODE) {
- newRegion = getNewSelectionRegion2(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
- }
- }
- }
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
deleted file mode 100644
index c36673fcd4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation, bug 212330
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.menus.UIElement;
-import org.eclipse.ui.services.IServiceScopes;
-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.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorMessages;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-public class ToggleEditModeHandler extends AbstractHandler implements IElementUpdater {
- protected ImageDescriptor onImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINON);
- protected ImageDescriptor offImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINOFF);
-
- public ToggleEditModeHandler() {
- super();
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- ModelQuery modelQuery;
- try {
- modelQuery = ModelQueryUtil.getModelQuery(model);
- }
- finally {
- model.releaseFromRead();
- }
- if (modelQuery != null) {
- int newState = getNextState(modelQuery.getEditMode());
- modelQuery.setEditMode(newState);
-
- // Force a Refresh on this command so that the image can
- // be
- // updated.
- ICommandService commandService = (ICommandService) HandlerUtil.getActiveWorkbenchWindow(event).getService(ICommandService.class);
- Map filter = new HashMap();
- filter.put(IServiceScopes.WINDOW_SCOPE, HandlerUtil.getActiveWorkbenchWindow(event));
- commandService.refreshElements(event.getCommand().getId(), filter);
- }
- }
- }
-
- return null;
- }
-
- public int getNextState(int editMode) {
- int result = -1;
- if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
- result = ModelQuery.EDIT_MODE_UNCONSTRAINED;
- }
- else {
- result = ModelQuery.EDIT_MODE_CONSTRAINED_STRICT;
- }
- return result;
- }
-
-
- // Handlers that need to interact with the ui that the command came from
- // need to use implement this method.
- public void updateElement(UIElement element, Map parameters) {
- IEditorPart editor = XMLUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else if (editor != null) {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- ModelQuery modelQuery;
- try {
- modelQuery = ModelQueryUtil.getModelQuery(model);
- }
- finally {
- model.releaseFromRead();
- }
- if (modelQuery != null) {
- setAppearanceForEditMode(modelQuery.getEditMode(), element);
- }
- }
- }
- }
-
- public void setAppearanceForEditMode(int editMode, UIElement element) {
- if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
- element.setTooltip(XMLEditorMessages.XMLTableTreeActionBarContributor_3);
- element.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_3);
- element.setIcon(onImage);
- }
- else {
- element.setTooltip(XMLEditorMessages.XMLTableTreeActionBarContributor_5);
- element.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_5);
- element.setIcon(offImage);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java
deleted file mode 100644
index 591e5f13e5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation - bug 212330 -
- * Based off CleanupActionXMLDelegate
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-import org.eclipse.wst.xml.ui.internal.search.XMLFindOccurrencesProcessor;
-
-public class XMLFindOccurencesHandler extends AbstractHandler implements IHandler {
- private List fProcessors;
-
- public void dispose() {
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- ITextEditor textEditor = null;
- boolean okay = false;
-
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
-
- if (textEditor != null) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null) {
- ITextSelection textSelection = getTextSelection(textEditor);
- FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
- if (findOccurrenceProcessor != null) {
- if (textEditor.getEditorInput() instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
- okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
- }
- }
- }
- }
- if (okay) {
- // clear status message
- PlatformStatusLineUtil.clearStatusLine();
- }
- else {
- String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
- if (textEditor instanceof StructuredTextEditor) {
- PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
- }
- else {
- PlatformStatusLineUtil.displayErrorMessage(errorMessage);
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
-
- return null;
- }
-
- /**
- * Get the appropriate find occurrences processor
- *
- * @param document -
- * assumes not null
- * @param textSelection
- * @return FindOccurrencesProcessor
- */
- private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
- // check if we have an action that's enabled on the current partition
- ITypedRegion tr = getPartition(document, textSelection);
- String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
-
- Iterator it = getProcessors().iterator();
- FindOccurrencesProcessor processor = null;
- while (it.hasNext()) {
- processor = (FindOccurrencesProcessor) it.next();
- // we just choose the first action that can handle the partition
- if (processor.enabledForParitition(partition))
- return processor;
- }
-
- List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
- for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
- Object o = extendedFindOccurrencesProcessors.get(i);
- if (o instanceof FindOccurrencesProcessor) {
- /*
- * We just choose the first registered processor that
- * explicitly says it can handle the partition
- */
- processor = (FindOccurrencesProcessor) o;
- if (processor.enabledForParitition(partition))
- return processor;
- }
- }
- return null;
- }
-
- private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
- ITypedRegion region = null;
- if (textSelection != null) {
- try {
- region = document.getPartition(textSelection.getOffset());
- }
- catch (BadLocationException e) {
- region = null;
- }
- }
- return region;
- }
-
- private ITextSelection getTextSelection(ITextEditor textEditor) {
- ITextSelection textSelection = null;
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection && !selection.isEmpty()) {
- textSelection = (ITextSelection) selection;
- }
- return textSelection;
- }
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- XMLFindOccurrencesProcessor htmlProcessor = new XMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
- }
- return fProcessors;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
deleted file mode 100644
index 04d32d0360..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-class CatalogEntryHyperlink implements IHyperlink {
-
- private IRegion fHyperlinkRegion = null;
- private ICatalogEntry fEntry = null;
-
- /**
- * @param hyperlinkRegion
- * @param entry
- */
- CatalogEntryHyperlink(IRegion hyperlinkRegion, ICatalogEntry entry) {
- super();
- fHyperlinkRegion = hyperlinkRegion;
- fEntry = entry;
- }
-
- /**
- * @return
- */
- private IHyperlink getHyperlink() {
- if (fEntry.getURI().startsWith("file:")) { //$NON-NLS-1$
- return new ExternalFileHyperlink(fHyperlinkRegion, new File(fEntry.getURI().substring(5)));
- }
- else if (fEntry.getURI().startsWith("platform:/resource/")) { //$NON-NLS-1$
- IPath path = new Path(fEntry.getURI().substring(20));
- if (path.segmentCount() > 1)
- return new WorkspaceFileHyperlink(fHyperlinkRegion, ResourcesPlugin.getWorkspace().getRoot().getFile(path));
- }
- else {
- /*
- * the URL detector will already work on the literal text, so
- * offer to open the contents in an editor
- */
- try {
- if (fEntry.getURI().startsWith("jar:file:"))
- return new URLStorageHyperlink(fHyperlinkRegion, new URL(fEntry.getURI())) {
- public String getHyperlinkText() {
- final String editorLabel = getEditorLabel();
- if (editorLabel != null)
- return NLS.bind(XMLUIMessages.Open_With, fEntry.getKey(), editorLabel);
- return NLS.bind(XMLUIMessages.Open, fEntry.getKey());
- }
- };
- }
- catch (MalformedURLException e) {
- // not valid?
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- IHyperlink link = getHyperlink();
- if (link != null)
- return link.getHyperlinkText();
- return NLS.bind(XMLUIMessages.Open, fEntry.getKey());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- IHyperlink link = getHyperlink();
- if (link != null)
- return link.getTypeLabel();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- IHyperlink link = getHyperlink();
- if (link != null)
- link.open();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index f432234093..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorDescriptor;
-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.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Hyperlink for external files.
- */
-class ExternalFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fHyperlinkRegion;
- private File fHyperlinkFile;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public String getHyperlinkText() {
- String path = fHyperlinkFile.getPath();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- final String editorLabel = getEditorLabel();
- if (editorLabel != null)
- return NLS.bind(XMLUIMessages.Open_With, path, editorLabel);
- return NLS.bind(XMLUIMessages.Open, path);
- }
-
- private String getEditorLabel() {
- final IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
- final String name = store.fetchInfo().getName();
-
- if (name == null) {
- return null;
- }
-
- IContentType contentType= null;
- try {
- InputStream is = null;
- try {
- is = store.openInputStream(EFS.NONE, null);
- contentType= Platform.getContentTypeManager().findContentTypeFor(is, name);
- } finally {
- if (is != null) {
- is.close();
- }
- }
- } catch (CoreException ex) {
- // continue without content type
- } catch (IOException ex) {
- // continue without content type
- }
-
- final IEditorDescriptor descriptor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(name, contentType);
- return descriptor != null ? descriptor.getLabel() : null;
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
- IDE.openEditorOnFileStore(page, store) ;
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
deleted file mode 100644
index 957ec592a9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.IOException;
-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.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.osgi.util.NLS;
-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;
-import org.eclipse.wst.sse.core.internal.util.JarUtilities;
-import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * Hyperlink for URLs (opens in read-only mode)
- */
-class URLStorageHyperlink 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 {
- if (fURL.toString().startsWith("jar:file"))
- stream = JarUtilities.getInputStream(fURL);
- else
- stream = fURL.openStream();
- }
- catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, XMLUIPlugin.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 URLStorageHyperlink(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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String path = fURL.toString();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- final String editorLabel = getEditorLabel();
- if (editorLabel != null)
- return NLS.bind(XMLUIMessages.Open_With, path, editorLabel);
- return NLS.bind(XMLUIMessages.Open, path);
- }
-
- protected String getEditorLabel() {
- IEditorDescriptor descriptor = getEditorDescriptor();
- return descriptor != null ? descriptor.getLabel() : null;
- }
-
- private IEditorDescriptor getEditorDescriptor() {
- final URLStorage storage = new URLStorage(fURL);
- final String path = fURL.getPath();
- String name = null;
- if (path != null)
- name = new Path(fURL.getPath()).lastSegment();
-
- IContentType contentType= null;
- try {
- InputStream is = null;
- try {
- is = storage.getContents();
- contentType= Platform.getContentTypeManager().findContentTypeFor(is, name);
- } finally {
- if (is != null) {
- is.close();
- }
- }
- } catch (CoreException ex) {
- // continue without content type
- } catch (IOException ex) {
- // continue without content type
- }
-
- return PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(name, contentType);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- if (fURL != null) {
- IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
- try {
- final IEditorDescriptor descriptor = getEditorDescriptor();
- 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);
- new URLHyperlink(fRegion, fURL.toString()).open();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 0a8d3d158b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * 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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- String path = fFile.getFullPath().toString();
- if (path.length() > 60) {
- path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
- }
- String editorLabel = null;
- try {
- editorLabel = getEditorLabel();
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- if (editorLabel != null) {
- return NLS.bind(XMLUIMessages.Open_With, path, editorLabel);
- }
- return NLS.bind(XMLUIMessages.Open, path);
- }
-
- private String getEditorLabel() throws CoreException {
- final IContentDescription description = fFile.getContentDescription();
- final IEditorDescriptor defaultEditor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(fFile.getName(), description != null ? description.getContentType() : null);
- return defaultEditor != null ? defaultEditor.getLabel() : null;
- }
-
- public void open() {
- if ((fFile != null) && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if ((fHighlightRange != null) && (editor instanceof ITextEditor)) {
- ((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
- }
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index beceafca6a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,598 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-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.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.Region;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- *
- */
-public class XMLHyperlinkDetector extends AbstractHyperlinkDetector {
- private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
-
- ICatalogEntry entry = getCatalogEntry(uriString);
- if (entry != null) {
- link = new CatalogEntryHyperlink(hyperlinkRegion, entry);
- }
- else {
- // try to locate the file in the workspace
- File systemFile = getFileFromUriString(uriString);
- if (systemFile != null) {
- String systemPath = systemFile.getPath();
- IFile file = getFile(systemPath);
- if (file != null) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- else {
- // this is an ExternalFileHyperlink since file does not
- // exist in workspace
- link = new ExternalFileHyperlink(hyperlinkRegion, systemFile);
- }
- }
- }
- return link;
- }
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- // for now, only capable of creating 1 hyperlink
- List hyperlinks = new ArrayList(0);
-
- if ((region != null) && (textViewer != null)) {
- IDocument document = textViewer.getDocument();
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null) {
- String uriString = null;
- if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- // doctype nodes
- uriString = getURIString(currentNode, document, region);
- }
- else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
- // element nodes
- Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
- if (currentAttr != null) {
- // try to find link for current attribute
- // resolve attribute value
- uriString = getURIString(currentAttr, document, region);
- // verify validity of uri string
- if ((uriString == null) || !isValidURI(uriString)) {
- // reset current attribute
- currentAttr = null;
- }
- }
- if (currentAttr == null) {
- // try to find a linkable attribute within element
- currentAttr = getLinkableAttr((Element) currentNode);
- if (currentAttr != null) {
- uriString = getURIString(currentAttr, document, region);
- }
- }
- currentNode = currentAttr;
- }
- // try to create hyperlink from information gathered
- if ((uriString != null) && (currentNode != null) && isValidURI(uriString)) {
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
- IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
- if (hyperlink != null) {
- hyperlinks.add(hyperlink);
- }
- }
- }
- }
- if (hyperlinks.size() == 0) {
- return null;
- }
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Get the base location from the current model (local file system)
- */
- private String getBaseLocation(IDocument document) {
- String result = null;
-
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- result = sModel.getBaseLocation();
-
- IPath path = new Path(result);
- if (path.segmentCount() > 1) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file.exists()) {
- String baseLocation = null;
- if (file.getLocation() != null) {
- baseLocation = file.getLocation().toString();
- }
- if (baseLocation == null && file.getLocationURI() != null) {
- baseLocation = file.getLocationURI().toString();
- }
- if (baseLocation == null) {
- baseLocation = file.getFullPath().toString();
- }
- result = baseLocation;
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return result;
- }
-
- /**
- * Get the CMElementDeclaration for an element
- *
- * @param element
- * @return CMElementDeclaration
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration ed = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- ed = mq.getCMElementDeclaration(element);
- }
- return ed;
- }
-
- /**
- * Returns the attribute node within node at offset
- *
- * @param node
- * @param offset
- * @return Attr
- */
- private Attr getCurrentAttrNode(Node node, int offset) {
- if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
- NamedNodeMap attrs = node.getAttributes();
- // go through each attribute in node and if attribute contains
- // offset, return that attribute
- for (int i = 0; i < attrs.getLength(); ++i) {
- // assumption that if parent node is of type IndexedRegion,
- // then its attributes will also be of type IndexedRegion
- IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
- if (attRegion.contains(offset)) {
- return (Attr) attrs.item(i);
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * Create a file from the given uri string
- *
- * @param uriString -
- * assumes uriString is not http://
- * @return File created from uriString if possible, null otherwise
- */
- private File getFileFromUriString(String uriString) {
- File file = null;
- try {
- // first just try to create a file directly from uriString as
- // default in case create file from uri does not work
- file = new File(uriString);
-
- // try to create file from uri
- URI uri = new URI(uriString);
- file = new File(uri);
- }
- catch (Exception e) {
- // if exception is thrown while trying to create File just ignore
- // and file will be null
- }
- return file;
- }
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
-
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null) {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- /**
- * Attempts to find an attribute within element that is openable.
- *
- * @param element -
- * cannot be null
- * @return Attr attribute that can be used for open on, null if no
- * attribute could be found
- */
- private Attr getLinkableAttr(Element element) {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- // get the list of attributes for this node
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- // check if this attribute is "openOn-able"
- Attr att = (Attr) attrs.item(i);
- if (isLinkableAttr(att, ed)) {
- return att;
- }
- }
- return null;
- }
-
- /**
- * Find the location hint for the given namespaceURI if it exists
- *
- * @param elementNode -
- * cannot be null
- * @param namespaceURI -
- * cannot be null
- * @return location hint (systemId) if it was found, null otherwise
- */
- private String getLocationHint(Element elementNode, String namespaceURI) {
- Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
- if (schemaLocNode != null) {
- StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
- while (st.hasMoreTokens()) {
- String publicId = st.hasMoreTokens() ? st.nextToken() : null;
- String systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // found location hint
- if (namespaceURI.equalsIgnoreCase(publicId)) {
- return systemId;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the URI string
- *
- * @param node -
- * assumes not null
- */
- private String getURIString(Node node, IDocument document, IRegion region) {
- String resolvedURI = null;
- // need the base location, publicId, and systemId for URIResolver
- String baseLoc = null;
- String publicId = null;
- String systemId = null;
-
- short nodeType = node.getNodeType();
- // handle doc type node
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- baseLoc = getBaseLocation(document);
- publicId = ((DocumentType) node).getPublicId();
- systemId = ((DocumentType) node).getSystemId();
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- String attrName = attrNode.getName();
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
- if ((attrValue != null) && (attrValue.length() > 0)) {
- baseLoc = getBaseLocation(document);
-
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- publicId = attrValue;
- systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
- if (systemId == null) {
- systemId = attrValue;
- }
- }
- else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- // for now just use the first pair
- // need to look into being more precise
-
- //Being precise now
- String attrText = ""; //$NON-NLS-1$
- int relativeOffset = -1;
- if (node instanceof IDOMNode) {
- relativeOffset = region.getOffset() - ((IDOMNode)node).getStartOffset();
- try {
- attrText = document.get(((IDOMNode)node).getStartOffset(), ((IDOMNode)node).getLength());
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- StringTokenizer st = new StringTokenizer(attrValue);
- while (st.hasMoreTokens()) {
- publicId = st.nextToken();
- systemId = st.hasMoreTokens() ? st.nextToken() : null;
- int startOffset = -1;
- int endOffset = -1;
- if (publicId != null) {
- startOffset = attrText.indexOf(publicId);
- if (systemId != null) {
- endOffset = attrText.indexOf(systemId) + systemId.length();
- }
- else {
- endOffset = attrText.indexOf(publicId) + publicId.length();
- }
- }
- if (startOffset <= relativeOffset && relativeOffset <= endOffset)
- break;
- // else check if xmlns publicId = value
- }
- }
- else {
- systemId = attrValue;
- }
- }
- }
-
- resolvedURI = resolveURI(baseLoc, publicId, systemId);
- return resolvedURI;
- }
-
- /**
- * Checks to see if the given attribute is openable. Attribute is openable
- * if it is a namespace declaration attribute or if the attribute value is
- * of type URI.
- *
- * @param attr
- * cannot be null
- * @param cmElement
- * CMElementDeclaration associated with the attribute (can be
- * null)
- * @return true if this attribute is "openOn-able" false otherwise
- */
- private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
- String attrName = attr.getName();
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- // determine if attribute is namespace declaration
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- return true;
- }
-
- // determine if attribute contains schema location
- if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName)))) {
- return true;
- }
-
- // determine if attribute value is of type URI
- if (cmElement != null) {
- CMNamedNodeMap attrDecls = cmElement.getAttributes();
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrDecls);
- List nodes = ModelQueryUtil.getModelQuery(attr.getOwnerDocument()).getAvailableContent(attr.getOwnerElement(), cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attrDecls = allAttributes;
-
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(attrName);
- if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Checks whether the given uriString is really pointing to a file
- *
- * @param uriString
- * @return boolean
- */
- private boolean isValidURI(String uriString) {
- boolean isValid = false;
-
- if (getCatalogEntry(uriString) != null) {
- isValid = true;
- }
- else {
- File file = getFileFromUriString(uriString);
- if (file != null) {
- isValid = file.isFile();
- }
- if(!isValid) {
- }
-
- }
- return isValid;
- }
-
- /**
- * @param uriString
- * @return
- */
- private ICatalogEntry getCatalogEntry(String uriString) {
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- if (defaultCatalog != null) {
- // Process default catalog
- ICatalogEntry[] entries = defaultCatalog.getCatalogEntries();
- for (int entry = 0; entry < entries.length; entry++) {
- if (uriString.equals(entries[entry].getKey())||uriString.equals(entries[entry].getURI())) {
- return entries[entry];
- }
- }
-
- // Process declared OASIS nextCatalogs catalog
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int nextCatalog = 0; nextCatalog < nextCatalogs.length; nextCatalog++) {
- ICatalog catalog = nextCatalogs[nextCatalog].getReferencedCatalog();
- ICatalogEntry[] entries2 = catalog.getCatalogEntries();
- for (int entry = 0; entry < entries2.length; entry++) {
- if (uriString.equals(entries2[entry].getKey())||uriString.equals(entries2[entry].getURI()))
- return entries2[entry];
- }
- }
- }
- return null;
- }
-
- /**
- * Resolves the given URI information
- *
- * @param baseLocation
- * @param publicId
- * @param systemId
- * @return String resolved uri.
- */
- private String resolveURI(String baseLocation, String publicId, String systemId) {
- // dont resolve if there's nothing to resolve
- if ((baseLocation == null) && (publicId == null) && (systemId == null)) {
- return null;
- }
- return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
deleted file mode 100644
index 5a2d83cd35..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-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.Label;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.SelectFileOrXMLCatalogIdDialog;
-
-public class CommonAddNamespacesControl extends Composite implements SelectionListener {
-
- class EditNamespaceControl extends Composite {
- protected Button browseButton;
- Text locationHintField;
- Text prefixField;
- Text uriField;
-
- // protected NamespaceInfo info;
-
- public EditNamespaceControl(Composite parent) {
- super(parent, SWT.NONE); // BORDER);
- setLayout(new GridLayout());
- setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label label = new Label(this, SWT.NONE);
- label.setText(XMLUIMessages._UI_ENTER_REQ_PREFIX_AND_NAMESPACE);
-
- Composite composite = new Composite(this, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginWidth = 0;
- layout.verticalSpacing = 1;
- composite.setLayout(layout);
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 350;
- composite.setLayoutData(gd);
-
- // row 1
- //
- Label prefixLabel = new Label(composite, SWT.NONE);
- prefixLabel.setText(XMLUIMessages._UI_LABEL_PREFIX_COLON);
-
- prefixField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- prefixField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // prefixField.setText(getDisplayValue(info.prefix));
- // prefixField.addModifyListener(modifyListener);
- // prefixField.setEnabled(info.getProperty("prefix-readOnly") ==
- // null);
- new Label(composite, SWT.NONE);
-
- // row 2
- //
- Label uriLabel = new Label(composite, SWT.NONE);
- uriLabel.setText(XMLUIMessages._UI_LABEL_NAMESPACE_NAME_COLON);
-
- uriField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- uriField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // uriField.setText(getDisplayValue(info.uri));
- // uriField.addModifyListener(modifyListener);
- // uriField.setEnabled(info.getProperty("uri-readOnly") == null);
-
- new Label(composite, SWT.NONE);
-
- // row 3
- //
- Label locationHintLabel = new Label(composite, SWT.NONE);
- locationHintLabel.setText(XMLUIMessages._UI_LABEL_LOCATION_HINT_COLON);
-
- locationHintField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- locationHintField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // locationHintField.setText(getDisplayValue(info.locationHint));
- // locationHintField.addModifyListener(modifyListener);
- // locationHintField.setEnabled(info.getProperty("locationHint-readOnly")
- // == null);
-
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- performBrowse();
- }
- };
-
- browseButton = new Button(composite, SWT.NONE);
- browseButton.setText(XMLUIMessages._UI_LABEL_BROWSE);
- browseButton.addSelectionListener(selectionListener);
- browseButton.setEnabled(locationHintField.getEnabled());
- }
-
- protected void performBrowse() {
- String[] extensions = {".xsd"}; //$NON-NLS-1$
- SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(getShell(), extensions);
- dialog.create();
- dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_FILE);
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK) {
- // String grammarURI = null;
- IFile file = dialog.getFile();
- String id = dialog.getId();
- if (file != null) {
- String uri = null;
- if (resourceLocation != null) {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceLocation);
- if (resource != null) {
- IPath location = resource.getLocation();
- if (location != null) {
- uri = URIHelper.getRelativeURI(file.getLocation(), location);
- }
- }
- else {
- uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
- }
- // grammarURI = file.getLocation().toOSString();
- }
- else {
- uri = file.getLocation().toOSString();
- // grammarURI = uri;
- }
- locationHintField.setText(uri);
- }
- else if (id != null) {
- locationHintField.setText(id);
- // URIResolver resolver =
- URIResolverPlugin.createResolver();
- // grammarURI = resolver.resolve(null, id, id);
- }
-
- try {
- // TODO CMDocument document =
- // CMDocumentBuilderRegistry.getInstance().buildCMDocument(grammarURI);
- // List namespaceInfoList =
- // (List)document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo");
- // NamespaceInfo info =
- // (NamespaceInfo)namespaceInfoList.get(0);
- // if (uriField.getText().trim().length() == 0 && info.uri
- // != null)
- // {
- // uriField.setText(info.uri);
- // }
- // if (prefixField.getText().trim().length() == 0 &&
- // info.prefix != null)
- // {
- // prefixField.setText(info.prefix);
- // }
- }
- catch (Exception e) {
- }
- }
- }
- }
-
- protected Button deleteButton;
- protected Button editButton;
- protected EditNamespaceControl editNamespaceControl;
- protected int heightHint = 250;
- protected List namespaceInfoList = new ArrayList();
- protected Button newButton;
- protected PageBook pageBook;
- protected Button radio1;
- protected Button radio2;
- protected IPath resourceLocation;
- protected Composite tableSection;
- protected CommonNamespaceInfoTable tableViewer;
- protected int widthHint = 500;
-
-
- public CommonAddNamespacesControl(Composite parent, int style, IPath resourceLocation) {
- super(parent, style);
- this.resourceLocation = resourceLocation;
- GridData gd = new GridData(GridData.FILL_BOTH);
- if (widthHint != -1) {
- gd.widthHint = widthHint;
- }
- if (heightHint != -1) {
- gd.heightHint = heightHint;
- }
- setLayoutData(gd);
- setLayout(new GridLayout());
-
- radio1 = new Button(this, SWT.RADIO);
- radio1.setText(XMLUIMessages._UI_SELECT_REGISTERED_NAMESPACES);
- radio1.setSelection(true);
- radio1.addSelectionListener(this);
-
- radio2 = new Button(this, SWT.RADIO);
- radio2.setText(XMLUIMessages._UI_SPECIFY_NEW_NAMESPACE);
- radio2.addSelectionListener(this);
-
- Label separator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // Group namespaceInfoGroup = new Group(this, SWT.NONE);
- // namespaceInfoGroup.setText("Namespace Declarations");
- // //XMLCommonUIPlugin.getInstance().getString("_UI_LABEL_XML_SCHEMA_INFORMATION"));
- // namespaceInfoGroup.setLayout(new GridLayout(2, false));
- // namespaceInfoGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- tableSection = new Composite(pageBook, SWT.NONE);
- tableSection.setLayout(new GridLayout());
- Label label = new Label(tableSection, SWT.NONE);
- label.setText(XMLUIMessages._UI_SELECT_NAMESPACE_TO_ADD);
-
- tableViewer = new CommonNamespaceInfoTable(tableSection, SWT.CHECK, 6);
- editNamespaceControl = new EditNamespaceControl(pageBook);
- pageBook.showPage(tableSection);
-
- tableViewer.setInput(namespaceInfoList);
- }
-
-
-
- public List getNamespaceInfoList() {
- List list = new ArrayList();
- if (radio1.getSelection()) {
- TableItem[] items = tableViewer.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- TableItem item = items[i];
- if (item.getChecked()) {
- list.add(item.getData());
- }
- }
- }
- else {
- NamespaceInfo info = new NamespaceInfo();
- info.prefix = editNamespaceControl.prefixField.getText();
- info.uri = editNamespaceControl.uriField.getText();
- info.locationHint = editNamespaceControl.locationHintField.getText();
- list.add(info);
- }
- return list;
- }
-
- public void setNamespaceInfoList(List list) {
- namespaceInfoList = list;
- tableViewer.setInput(namespaceInfoList);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == radio1) {
- pageBook.showPage(tableSection);
- }
- else if (e.widget == radio2) {
- pageBook.showPage(editNamespaceControl);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java
deleted file mode 100644
index 269113fea8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java
+++ /dev/null
@@ -1,205 +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.xml.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-
-
-
-public class CommonAddNamespacesDialog extends Dialog {
- protected CommonAddNamespacesControl addNamespacesControl;
- protected List existingNamespaces;
- protected List namespaceInfoList;
- protected Button okButton;
- protected HashMap preferredPrefixTable = new HashMap();
- protected IPath resourceLocation;
- protected String title;
-
- public CommonAddNamespacesDialog(Shell parentShell, String title, IPath resourceLocation, List existingNamespaces) {
- super(parentShell);
- this.resourceLocation = resourceLocation;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.title = title;
- this.existingNamespaces = existingNamespaces;
- preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/", "wsdl"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/soap/", "soap"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/http/", "http"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/mime/", "mime"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://schemas.xmlsoap.org/soap/encoding/", "soapenc"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://schemas.xmlsoap.org/soap/envelope/", "soapenv"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://www.w3.org/2001/XMLSchema-instance", "xsi"); //$NON-NLS-1$ //$NON-NLS-2$
- preferredPrefixTable.put("http://www.w3.org/2001/XMLSchema", "xsd"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected void addBuiltInNamespaces(List list) {
- String xsiNamespace = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- if (!isAlreadyDeclared(xsiNamespace)) {
- list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema-instance", "xsi", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (!isAlreadyDeclared(xsdNamespace)) {
- list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema", "xsd", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- protected void addCatalogMapToList(ICatalog catalog, List list) {
- ICatalogEntry[] entries = catalog.getCatalogEntries();
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if ((entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) && entry.getURI().endsWith(".xsd")) { //$NON-NLS-1$
- if (!isAlreadyDeclared(entry.getKey())) {
- NamespaceInfo namespaceInfo = new NamespaceInfo(entry.getKey(), "xx", null); //$NON-NLS-1$
- list.add(namespaceInfo);
- }
- }
- }
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- namespaceInfoList = addNamespacesControl.getNamespaceInfoList();
- }
- super.buttonPressed(buttonId);
- }
-
- public void computeAddablePrefixes(List addableList, List exisitingList) {
- HashMap map = new HashMap();
- for (Iterator i = exisitingList.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if (info.prefix != null) {
- map.put(info.prefix, info);
- }
- }
- for (Iterator i = addableList.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if (info.uri != null) {
- String prefix = (String) preferredPrefixTable.get(info.uri);
- info.prefix = getUniquePrefix(map, prefix, info.uri);
- map.put(info.prefix, info);
- }
- }
- }
-
- public int createAndOpen() {
- create();
- getShell().setText(title);
- Rectangle r = getShell().getBounds();
- getShell().setBounds(r.x + 80, r.y + 80, r.width, r.height);
- setBlockOnOpen(true);
- return open();
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- return control;
- }
-
-
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- addNamespacesControl = new CommonAddNamespacesControl(dialogArea, SWT.NONE, resourceLocation);
- List list = new ArrayList();
-
- addBuiltInNamespaces(list);
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog userCatalog = referencedCatalog;
- addCatalogMapToList(userCatalog, list);
-
- }
- else if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog systemCatalog = referencedCatalog;
- addCatalogMapToList(systemCatalog, list);
- }
- }
- }
-
- computeAddablePrefixes(list, existingNamespaces);
-
- addNamespacesControl.setNamespaceInfoList(list);
- return dialogArea;
- }
-
- public List getNamespaceInfoList() {
- return namespaceInfoList;
- }
-
- protected String getPreferredPrefix(String namespaceURI) {
- return (String) preferredPrefixTable.get(namespaceURI);
- }
-
- private String getUniquePrefix(HashMap prefixMap, String prefix, String uri) {
- if (prefix == null) {
- int lastIndex = uri.lastIndexOf('/');
- if (lastIndex == uri.length() - 1) {
- uri = uri.substring(0, lastIndex);
- lastIndex = uri.lastIndexOf('/');
- }
- prefix = uri.substring(lastIndex + 1);
- if ((prefix.length() > 20) || (prefix.indexOf(':') != -1)) {
- prefix = null;
- }
- }
- if (prefix == null) {
- prefix = "p"; //$NON-NLS-1$
- }
- if (prefixMap.get(prefix) != null) {
- String base = prefix;
- for (int count = 0; prefixMap.get(prefix) != null; count++) {
- prefix = base + count;
- }
- }
- return prefix;
- }
-
- protected boolean isAlreadyDeclared(String namespaceURI) {
- boolean result = false;
- for (Iterator i = existingNamespaces.iterator(); i.hasNext();) {
- NamespaceInfo namespaceInfo = (NamespaceInfo) i.next();
- if (namespaceURI.equals(namespaceInfo.uri)) {
- result = true;
- break;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java
deleted file mode 100644
index 507b880c08..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.graphics.Color;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditNamespaceInfoDialog;
-import org.eclipse.wst.xml.ui.internal.dialogs.NamespaceInfoErrorHelper;
-
-public class CommonEditNamespacesDialog {
- protected Composite commonComposite;
- protected Button deleteButton;
- protected Button editButton;
-
- protected Label errorMessageLabel;
- protected int heightHint = 250;
- protected List namespaceInfoList = new ArrayList();
-
- protected Button newButton;
- protected IPath resourceLocation;
-
- private boolean showLocationText = false;
- protected String tableLabel = ""; //$NON-NLS-1$
- protected CommonNamespaceInfoTable tableViewer;
-
- protected Composite topComposite;
- protected boolean useGroup;
- protected int widthHint = 500;
-
- public CommonEditNamespacesDialog(Composite parent, IPath resourceLocation, String stringTableLabel) {
- this(parent, resourceLocation, stringTableLabel, false, false);
- }
-
- public CommonEditNamespacesDialog(Composite parent, IPath resourceLocation, String stringTableLabel, boolean useGroup, boolean showLocText) {
- this.resourceLocation = resourceLocation;
- tableLabel = stringTableLabel;
- this.useGroup = useGroup;
- showLocationText = showLocText;
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- if (widthHint != -1) {
- gd.widthHint = widthHint;
- }
- if (heightHint != -1) {
- gd.heightHint = heightHint;
- }
-
- // Set GridData and GridLayout for the parent Composite
- parent.setLayoutData(gd);
- parent.setLayout(new GridLayout());
-
- // Create the top Composite
- topComposite = new Composite(parent, SWT.NONE);
- GridData topData = new GridData(GridData.FILL_HORIZONTAL);
- topData.heightHint = 0;
- topComposite.setLayoutData(topData);
- topComposite.setLayout(new GridLayout());
-
- // Create the 'common'/middle Composite
- if (useGroup) {
- commonComposite = new Group(parent, SWT.NONE);
- }
- else {
- commonComposite = new Composite(parent, SWT.NONE);
- }
- commonComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
- commonComposite.setLayout(new GridLayout(3, false));
-
- // Add the error Message Label
- errorMessageLabel = new Label(parent, SWT.NONE);
- errorMessageLabel.setLayoutData(createHorizontalFill());
- Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
- errorMessageLabel.setForeground(color);
-
- createControlArea();
- }
-
-
- protected void createButtons(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- composite.setLayout(gridLayout);
-
- SelectionListener selectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == newButton) {
- performNew();
- }
- else if (e.widget == editButton) {
- performEdit();
- }
- else if (e.widget == deleteButton) {
- performDelete();
- }
- }
- };
-
- // create a composite to hold the three buttons
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- buttonComposite.setLayoutData(createHorizontalFill());
- GridLayout buttonGridLayout = new GridLayout();
- // buttonGridLayout.numColumns = 3;
- // buttonGridLayout.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(buttonGridLayout);
-
- // add the New button
- //
- newButton = new Button(buttonComposite, SWT.NONE);
- // newButton.setText(" " +
- // XMLCommonUIPlugin.getInstance().getString("_UI_BUTTON_NEW") + " ");
- newButton.setText(" " + XMLUIMessages.CommonEditNamespacesDialog_0 + " "); //$NON-NLS-1$ //$NON-NLS-2$
- newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // ViewUtility.createHorizontalFill());
- newButton.addSelectionListener(selectionListener);
-
- // add the Edit button
- //
- // gd = new GridData();
- // gd.horizontalAlignment = gd.FILL;
- // gd.grabExcessHorizontalSpace = true;
-
- editButton = new Button(buttonComposite, SWT.NONE);
- editButton.setText(XMLUIMessages._UI_BUTTON_EDIT);
- editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // ViewUtility.createHorizontalFill());
- editButton.addSelectionListener(selectionListener);
-
- // add the Delete button
- //
- // gd = new GridData();
- // gd.horizontalAlignment = gd.FILL;
- // gd.grabExcessHorizontalSpace = true;
-
- deleteButton = new Button(buttonComposite, SWT.NONE);
- deleteButton.setText(XMLUIMessages._UI_BUTTON_DELETE);
- deleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // ViewUtility.createHorizontalFill());
- deleteButton.addSelectionListener(selectionListener);
- }
-
- private void createControlArea() {
- if (useGroup) {
- ((Group) commonComposite).setText(tableLabel);
- }
- else {
- Label label = new Label(commonComposite, SWT.NONE);
- label.setText(tableLabel);
- label.setLayoutData(createGridData(false, 3));
- }
-
- tableViewer = new CommonNamespaceInfoTable(commonComposite, 6, showLocationText);
- tableViewer.getControl().setLayoutData(createGridData(true, 2));
- createButtons(commonComposite);
-
- tableViewer.setInput(namespaceInfoList);
- updateButtonEnabledState();
- ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateButtonEnabledState();
- }
- };
- tableViewer.addSelectionChangedListener(selectionChangedListener);
- }
-
- protected GridData createGridData(boolean both, int span) {
- GridData gd = new GridData(both ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- return gd;
- }
-
- private GridData createHorizontalFill() {
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- return gd;
- }
-
-
-
- public NamespaceInfo getNamespaceInfo(String namespace) {
- NamespaceInfo result = null;
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if ((info.uri != null) && info.uri.equals(namespace)) {
- result = info;
- break;
- }
- }
- return result;
- }
-
- protected Object getSelection(ISelection selection) {
- if (selection == null) {
- return null;
- } // end of if ()
-
- Object result = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection es = (IStructuredSelection) selection;
- Iterator i = es.iterator();
- if (i.hasNext()) {
- result = i.next();
- }
- }
- return result;
- }
-
- /*
- * Use the returned Composite to add content above the 'common contents'.
- * Note: The GridData for the returned Composite has a heightHint = 0.
- * This means when using the returned Composite, the GridData must be
- * reset, else the Composite and it's contents will not appear.
- */
- protected Composite getTopComposite() {
- return topComposite;
- }
-
- protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info) {
- EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(topComposite.getShell(), info);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(resourceLocation);
- dialog.open();
- return dialog;
- }
-
- protected void performDelayedUpdate() {
- tableViewer.refresh();
- /*
- * Runnable delayedUpdate = new Runnable() { public void run() {
- * tableViewer.refresh(); } };
- * Display.getCurrent().asyncExec(delayedUpdate);
- */
- // if (updateListener != null)
- // {
- // updateListener.updateOccured(this, namespaceInfoList);
- // }
- }
-
- public void performDelete() {
- ISelection selection = tableViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- namespaceInfoList.removeAll(structuredSelection.toList());
- updateErrorMessage(namespaceInfoList);
- performDelayedUpdate();
- }
- }
-
- public void performEdit() {
- Object selection = getSelection(tableViewer.getSelection());
- if (selection != null) {
- invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, (NamespaceInfo) selection);
- updateErrorMessage(namespaceInfoList);
- performDelayedUpdate();
- }
- }
-
- public void performNew() {
- CommonAddNamespacesDialog dialog = new CommonAddNamespacesDialog(topComposite.getShell(), XMLUIMessages._UI_ADD_NAMESPACE_DECLARATIONS, resourceLocation, namespaceInfoList);
- dialog.createAndOpen();
- if (dialog.getReturnCode() == Window.OK) {
- namespaceInfoList.addAll(dialog.getNamespaceInfoList());
- updateErrorMessage(namespaceInfoList);
- performDelayedUpdate();
- }
- }
-
- public void setNamespaceInfoList(List list) {
- namespaceInfoList = list;
- tableViewer.setInput(namespaceInfoList);
- }
-
- public void updateButtonEnabledState() {
- Object selection = getSelection(tableViewer.getSelection());
- NamespaceInfo info = (NamespaceInfo) selection;
- editButton.setEnabled(info != null);
- deleteButton.setEnabled((info != null) && (info.getProperty("unremovable") == null)); //$NON-NLS-1$
- }
-
- public void updateErrorMessage(List namespaceInfoList) {
- NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
- String errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- }
-
- public void setResourcePath(IPath path) {
- resourceLocation = path;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java
deleted file mode 100644
index 1f6d85ae0a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java
+++ /dev/null
@@ -1,104 +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.xml.ui.internal.nsedit;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/*
- * This class is an extension of CommonEditNamespacesDialog. This class adds
- * the target namespaces dialog field.
- */
-public class CommonEditNamespacesTargetFieldDialog extends CommonEditNamespacesDialog {
-
- class TargetNamespaceModifyListener implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- String oldTargetNamespace = targetNamespace;
- targetNamespace = targetNamespaceField.getText();
- updateTargetNamespaceAndNamespaceInfo(oldTargetNamespace, targetNamespace);
- }
- }
-
- protected String targetNamespace;
- protected Text targetNamespaceField;
-
- public CommonEditNamespacesTargetFieldDialog(Composite parent, IPath resourceLocation1) {
- super(parent, resourceLocation1, XMLUIMessages._UI_NAMESPACE_DECLARATIONS);
-
- Composite targetComp = getTopComposite();
- targetComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- Label targetNamespaceLabel = new Label(targetComp, SWT.NONE);
- targetNamespaceLabel.setLayoutData(gd);
- targetNamespaceLabel.setText(XMLUIMessages._UI_TARGET_NAMESPACE);
-
- targetNamespaceField = new Text(targetComp, SWT.BORDER);
- targetNamespaceField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- targetNamespaceField.addModifyListener(new TargetNamespaceModifyListener());
-
- // createControlArea();
- }
-
- public String getTargetNamespace() {
- return targetNamespace;
- }
-
- public void performEdit() {
- Object selection = getSelection(tableViewer.getSelection());
- if (selection != null) {
- boolean editTargetNamespace = false;
- NamespaceInfo nsInfo = (NamespaceInfo) selection;
- if (getTargetNamespace().equals(nsInfo.uri)) {
- editTargetNamespace = true;
- }
-
- invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, nsInfo);
- updateErrorMessage(namespaceInfoList);
- performDelayedUpdate();
-
- if (editTargetNamespace) {
- targetNamespaceField.setText(nsInfo.uri);
- }
- }
- }
-
- public void setTargetNamespace(String theTargetNamespace) {
- targetNamespace = theTargetNamespace != null ? theTargetNamespace : ""; //$NON-NLS-1$
- targetNamespaceField.setText(targetNamespace);
- // updateTargetNamespaceAndNamespaceInfo(targetNamespace);
- }
-
- void updateTargetNamespaceAndNamespaceInfo(String oldTargetNamespace, String newTargetNamespace) {
- NamespaceInfo info = getNamespaceInfo(newTargetNamespace);
- if (info == null) {
- info = getNamespaceInfo(oldTargetNamespace);
- if (info == null) {
- info = new NamespaceInfo(newTargetNamespace, "tns", null); //$NON-NLS-1$
- namespaceInfoList.add(info);
- }
- else {
- info.uri = targetNamespace;
- }
- }
- tableViewer.refresh();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java
deleted file mode 100644
index 44162e45ff..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java
+++ /dev/null
@@ -1,346 +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.xml.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class CommonNamespaceInfoTable extends TableViewer {
-
- /**
- * NamespaceInfoTableLabelProvider
- */
- protected class Provider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider {
- Viewer viewer;
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- int columnCode = getColumnCode(columnIndex);
- if (columnCode == COLUMN_LOCATION_HINT) {
- NamespaceInfo info = (NamespaceInfo) object;
- if ((info.locationHint == null) || info.locationHint.trim().equals("")) { //$NON-NLS-1$
- // Comment this out until we solve the alignment/(space
- // for image being allocated
- // to prefix column) ......
- // result =
- // XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_WARNING_OBJ);
- }
- }
-
- return result;
- }
-
- public String getColumnText(Object object, int column) {
- NamespaceInfo info = (NamespaceInfo) object;
- String result = null;
- int columnCode = getColumnCode(column);
- switch (columnCode) {
- case COLUMN_PREFIX : {
- result = info.prefix;
- break;
- }
- case COLUMN_NAMESPACE_URI : {
- result = info.uri;
- break;
- }
- case COLUMN_CHECKBOX : {
- result = ""; // info.locationHint; //$NON-NLS-1$
- break;
- }
- case COLUMN_LOCATION_HINT : {
- result = info.locationHint;
- break;
- }
- }
- result = result != null ? result : ""; //$NON-NLS-1$
- if (result.equals("")) { //$NON-NLS-1$
- switch (columnCode) {
- case COLUMN_PREFIX : {
- result = XMLUIMessages._UI_NO_PREFIX;
- break;
- }
- case COLUMN_NAMESPACE_URI : {
- result = XMLUIMessages._UI_NO_NAMESPACE_NAME;
- break;
- }
- }
- }
- return result;
- }
-
- public Object[] getElements(Object inputElement) {
- List list = (List) viewer.getInput();
- return list != null ? list.toArray() : null;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
- }
- }
-
- class TableItemChecker extends MouseAdapter {
- public void mouseDown(MouseEvent e) {
- TableItem item = getTable().getItem(new Point(e.x, e.y));
- if (item != null) {
- Object obj = item.getData();
- if (obj != null) {
- NamespaceInfo info = (NamespaceInfo) obj;
- TableColumn col = getTable().getColumn(0);
- if (e.x < col.getWidth()) // if the point falls within
- // the
- // Select column then perform
- // check/uncheck
- {
- String currentState = (String) info.getProperty("checked"); //$NON-NLS-1$
- System.out.println("currentState" + currentState); //$NON-NLS-1$
- if ((currentState == null) || currentState.equals("false")) //$NON-NLS-1$
- {
- info.setProperty("checked", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- info.setProperty("checked", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- refresh();
- }
- }
- }
- }
- }
-
- protected static final int COLUMN_CHECKBOX = 1;
- protected static final int COLUMN_LOCATION_HINT = 4;
- protected static final int COLUMN_NAMESPACE_URI = 2;
- protected static final int COLUMN_PREFIX = 3;
-
- protected static final String LABEL_CHECKBOX = ""; //$NON-NLS-1$
- protected static final String LABEL_LOCATION_HINT = XMLUIMessages._UI_LABEL_LOCATION_HINT;
- protected static final String LABEL_NAMESPACE_URI = XMLUIMessages._UI_LABEL_NAMESPACE_NAME;
- protected static final String LABEL_PREFIX = XMLUIMessages._UI_LABEL_PREFIX;
- protected List checkedList = new ArrayList();
-
- // protected List namespaceInfoList = new ArrayList();
- protected int[] columnIndexMap;
- protected boolean showCheckBoxes = true;
- private boolean showLocationText = false;
-
- private Table table;
- protected int visibleRows = -1;
-
- public CommonNamespaceInfoTable(Composite parent, int visibleRows) {
- this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows, false);
- }
-
- // protected CellEditor getCellEditor(int column)
- // {
- // return (column == COLUMN_CHECKBOX) ? checkBoxCellEditor :
- // textCellEditor;
- // }
-
- public CommonNamespaceInfoTable(Composite parent, int visibleRows, boolean showLocationText) {
- this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows, showLocationText);
- }
-
- public CommonNamespaceInfoTable(Composite parent, int style, int visibleRows) {
- this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | style, visibleRows, false);
- }
-
- public CommonNamespaceInfoTable(Composite parent, int style, int visibleRows, boolean showLocationText) {
- super(new Table(parent, style));
- getTable().setLinesVisible(true);
- this.showCheckBoxes = (style & SWT.CHECK) != 0;
- columnIndexMap = createColumnIndexMap();
- this.showLocationText = showLocationText;
-
- Provider provider = new Provider();
- setContentProvider(provider);
- setLabelProvider(provider);
-
- String[] columnPropertiesArray = createColumnPropertiesArray();
- setColumnProperties(columnPropertiesArray);
-
- table = getTable();
- table.setHeaderVisible(true);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- TableLayout layout = new TableLayout();
-
- for (int i = 0; i < columnPropertiesArray.length; i++) {
- TableColumn column = new TableColumn(table, i);
- if ((columnPropertiesArray[i]).equals(LABEL_LOCATION_HINT)) {
- if (showLocationText) {
- column.setText(columnPropertiesArray[i]);
- }
- else {
- // Comment this out until we solve the alignment/(space
- // for image being allocated
- // to prefix column) ......
- // column.setImage(XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT));
- }
- }
- else {
- column.setText(columnPropertiesArray[i]);
- }
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
- }
- table.setLayout(layout);
-
- this.visibleRows = visibleRows;
- // for (int i = 0; i < visibleRows; i++)
- // {
- // TableItem item = new TableItem(table, SWT.NONE);
- // item.setText("#######");
- // }
- // checkBoxCellEditor = new NamespaceInfoCheckboxCellEditor(table);
- // textCellEditor = new TextCellEditor(table);
-
- /*
- * CellEditor[] cellEditors = new
- * CellEditor[columnPropertiesArray.length]; for (int i = 0; i <
- * columnPropertiesArray.length; i++) { cellEditors[i] =
- * getCellEditor(i); } setCellEditors(cellEditors);
- */
- // if (showCheckBoxes)
- // {
- // getTable().addMouseListener(new TableItemChecker());
- // }
- }
-
- // protected CellEditor checkBoxCellEditor;
- // protected CellEditor textCellEditor;
-
- protected int[] createColumnIndexMap() {
- int[] result = new int[showCheckBoxes ? 4 : 3];
- int i = 0;
- if (showCheckBoxes) {
- result[i++] = COLUMN_CHECKBOX;
- }
- result[i++] = COLUMN_PREFIX;
- result[i++] = COLUMN_NAMESPACE_URI;
- if (!showCheckBoxes) {
- result[i++] = COLUMN_LOCATION_HINT;
- }
- return result;
- }
-
- protected String[] createColumnPropertiesArray() {
- String[] result = new String[3];
- int i = 0;
- if (showCheckBoxes) {
- result[i++] = LABEL_CHECKBOX;
- }
- result[i++] = LABEL_PREFIX;
- result[i++] = LABEL_NAMESPACE_URI;
- if (!showCheckBoxes) {
- result[i++] = LABEL_LOCATION_HINT;
- }
- return result;
- }
-
- protected int getColumnCode(int column) {
- int result = 0;
- if (column < columnIndexMap.length) {
- result = columnIndexMap[column];
- }
- return result;
- }
-
- protected int getColumnWidth(int column) {
- int result = 0;
- switch (getColumnCode(column)) {
- case COLUMN_PREFIX : {
- result = 5;
- break;
- }
- case COLUMN_NAMESPACE_URI : {
- // Size columns differently when location hint text label is
- // displayed
- if (showLocationText) {
- result = 10;
- }
- else {
- result = 20;
- }
- break;
- }
- case COLUMN_CHECKBOX : {
- result = 1; // info.locationHint;
- break;
- }
- case COLUMN_LOCATION_HINT : {
- // Size columns differently when location hint text label is
- // displayed
- if (showLocationText) {
- result = 10;
- }
- else {
- result = 2;
- }
- break;
- }
- }
- return result;
- }
- /*
- * protected class NamespaceInfoCellModifier implements ICellModifier {
- * public NamespaceInfoCellModifier() { }
- *
- * public boolean canModify(Object element, String property) { if
- * (property.equals(LABEL_CHECKBOX)) { return true; } else if
- * (property.equals(LABEL_PREFIX)) { return true; } return false; }
- *
- * public Object getValue(Object element, String property) { int column =
- * 0; if (property.equals(LABEL_CHECKBOX)) { column = 0; } else if
- * (property.equals(LABEL_PREFIX)) { column = 1; } else if
- * (property.equals(LABEL_NAMESPACE_URI)) { column = 2; }
- *
- * //if (element instanceof TableElement) //{ // return
- * provider.getColumnText(element, column); //} //else //{ // return null; // }
- * return "hello"; }
- *
- * public void modify(Object element, String property, Object value) { } }
- *
- * protected class NamespaceInfoCheckboxCellEditor extends
- * CheckboxCellEditor implements MouseListener { public
- * NamespaceInfoCheckboxCellEditor(Composite parent) { super(parent); }
- *
- * protected void doSetValue(Object value) { }
- *
- * public void activate() { super.activate(); deactivate();
- * Display.getCurrent().getFocusControl().redraw(); }
- *
- * public void mouseDown(MouseEvent e) { if (getTable().getItem(new
- * Point(e.x, e.y)) != null) { } } public void mouseDoubleClick(MouseEvent
- * e) { } public void mouseUp(MouseEvent e) { } }
- */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java
deleted file mode 100644
index 0d9ebb6633..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Standards for Technology in Automotive Retail
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - bug 213883 - initial api
- * IBM Corporation - bug 271619 - Move and rename XML perspective definition
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.perspective;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.IProductConstants;
-import org.eclipse.wst.xml.ui.internal.ProductProperties;
-
-
-/**
- * @author dcarver
- *
- */
-public class XMLPerspectiveFactory implements IPerspectiveFactory {
-
-// private static final String SEARCH_VIEW_ID = "org.eclipse.search.ui.views.SearchView"; //$NON-NLS-1$
-// private static final String XPATH_VIEW_ID = "org.eclipse.wst.xml.views.XPathView"; //$NON-NLS-1$
-// private static final String SNIPPETS_VIEW_ID = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView"; //$NON-NLS-1$
-// private static final String TEXTEDITOR_TEMPLATES_VIEW_ID = "org.eclipse.ui.texteditor.TemplatesView"; //$NON-NLS-1$
-// private static final String ID_CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView"; //$NON-NLS-1$
-
- private static String EXPLORER_VIEW_ID = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
-
- public XMLPerspectiveFactory() {
- String viewerID = ProductProperties.getProperty(IProductConstants.PERSPECTIVE_EXPLORER_VIEW);
- if (viewerID != null) {
- // verify that the view actually exists
- if (PlatformUI.getWorkbench().getViewRegistry().find(viewerID) != null){
- EXPLORER_VIEW_ID = viewerID;
- }
- }
- }
- /**
- * Creates the initial layout. This is what the layout is reset to when
- * the Reset Perspective is selected. It takes as input a IPageLayout
- * object.
- *
- * @param layout
- */
- public void createInitialLayout(IPageLayout layout) {
- // Get the Editor Area
-// String editorArea = layout.getEditorArea();
-
- // Turn on the Editor Area
- layout.setEditorAreaVisible(true);
- layout.setFixed(false);
-
- layout.addShowViewShortcut(EXPLORER_VIEW_ID);
-
- IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.23f, layout.getEditorArea());//$NON-NLS-1$
- topLeft.addView(EXPLORER_VIEW_ID);
-
- // Create the areas of the layout with their initial views
-// IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float) 0.23, editorArea); //$NON-NLS-1$
-// left.addView(IPageLayout.ID_PROJECT_EXPLORER);
-//
-// IFolderLayout bottomLeft = layout.createFolder("bottom-left", IPageLayout.BOTTOM, (float) 0.50, "left"); //$NON-NLS-1$ //$NON-NLS-2$
-// bottomLeft.addView(XPATH_VIEW_ID); //$NON-NLS-1$
-//
-// IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float) 0.70, editorArea); //$NON-NLS-1$
-// right.addView(IPageLayout.ID_OUTLINE);
-//
-// IFolderLayout bottomRight = layout.createFolder("bottom-right", IPageLayout.BOTTOM, (float) 0.60, "right"); //$NON-NLS-1$//$NON-NLS-2$
-// bottomRight.addView(TEXTEDITOR_TEMPLATES_VIEW_ID);
-//
-// IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$
-// bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
-// bottom.addView(IPageLayout.ID_PROP_SHEET);
-// bottom.addView(ID_CONSOLE_VIEW);
-// bottom.addView(SNIPPETS_VIEW_ID);
-//
-// bottom.addPlaceholder(SEARCH_VIEW_ID);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EmptyFilePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EmptyFilePreferencePage.java
deleted file mode 100644
index 9870632ea9..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EmptyFilePreferencePage.java
+++ /dev/null
@@ -1,100 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class EmptyFilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private Composite createComposite(Composite parent, int numColumns) {
- noDefaultAndApplyButton();
-
- 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;
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createScrolledComposite(parent);
-
- String description = XMLUIMessages.EmptyFilePreferencePage_0;
- Text text = new Text(composite, SWT.READ_ONLY);
- // some themes on GTK have different background colors for Text and Labels
- text.setBackground(composite.getBackground());
- text.setText(description);
-
- setSize(composite);
- return composite;
- }
-
- private Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1, 1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- public void init(IWorkbench workbench) {
- }
-
- private void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
deleted file mode 100644
index b58079aaf2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * EncodingSettings is a composite that can be used to display the set of
- * encoding values that are available to the user. The list of encoding values
- * is based off the SupportedJavaEncoding class. As the user selects an
- * encoding from the combo box, the readonly field below it changes to show
- * the IANA tag for that particular encoding description. The labels for the
- * widgets are configurable and the initial value to display to the user can
- * be set using the setIANATag(). The currently selected entry's IANA tag can
- * be retrieved with getIANATag(). Entries displayed to the user can be added
- * and removed.
- */
-public class EncodingSettings extends Composite {
-
- private class ComboListener implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- int i = encodingCombo.getSelectionIndex();
- if ((i >= 0) && (i < ianaVector.size())) {
- ianaText.setText((String) (ianaVector.elementAt(encodingCombo.getSelectionIndex())));
- }
- }
- }
-
- private static String ENCODING_LABEL = XMLUIMessages.EncodingSettings_1;
-
- private static String IANA_LABEL = XMLUIMessages.EncodingSettings_0;
-
- private ModifyListener comboListener = new ComboListener();
- protected Combo encodingCombo;
- protected Label encodingLabel, ianaLabel;
- protected Text ianaText;
- protected Vector ianaVector;
-
- /**
- * Method EncodingSettings.
- *
- * @param parent
- */
- public EncodingSettings(Composite parent) {
- super(parent, SWT.NONE);
- init(IANA_LABEL, ENCODING_LABEL);
- }
-
- /**
- * Method EncodingSettings.
- *
- * @param parent
- * @param encodingLabel -
- * text label to use beside the locale sensitive description of
- * the currently selected encoding
- */
- public EncodingSettings(Composite parent, String encodingLabel) {
- super(parent, SWT.NONE);
- init(IANA_LABEL, encodingLabel);
- }
-
- /**
- * Method EncodingSettings.
- *
- * @param parent
- * @param ianaLabel =
- * text label to use beside the display only IANA field
- * @param encodingLabel -
- * text label to use beside the locale sensitive description of
- * the currently selected encoding
- */
- public EncodingSettings(Composite parent, String ianaLabel, String encodingLabel) {
- super(parent, SWT.NONE);
- init(ianaLabel, encodingLabel);
- }
-
- /**
- * Method addEntry. Add an entry to the end of the Encoding Combobox
- *
- * @param description -
- * encoding description to display
- * @param ianaTag -
- * IANA tag for the description
- */
- public void addEntry(String description, String ianaTag) {
- encodingCombo.add(description);
- ianaVector.add(ianaTag);
- }
-
- /**
- * Method addEntry. Add an entry to the Encoding Combobox at index index
- *
- * @param description -
- * encoding description to display
- * @param ianaTag -
- * IANA tag for the description
- * @param index -
- * index into the combo to add to
- */
- public void addEntry(String description, String ianaTag, int index) {
- if (index == ianaVector.size()) {
- // just add to the end
- addEntry(description, ianaTag);
- return;
- }
-
- if ((0 <= index) && (index < ianaVector.size())) {
- encodingCombo.add(description, index);
- ianaVector.add(index, ianaTag);
- }
- }
-
- protected Combo createComboBox(Composite parent, boolean isReadOnly) {
- int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
- Combo combo = new Combo(parent, style);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- return combo;
- }
-
- /**
- * Helper method for creating labels.
- */
- protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- protected Text createTextField(Composite parent, int width) {
- Text text = new Text(parent, SWT.SINGLE | SWT.READ_ONLY);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- text.setLayoutData(data);
-
- text.setBackground(text.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- return text;
- }
-
- /**
- * @see org.eclipse.swt.widgets.Widget#dispose()
- */
- public void dispose() {
- encodingCombo.removeModifyListener(comboListener);
- super.dispose();
- }
-
- private void fillCombo() {
- try {
- String[] ianaTags = CommonCharsetNames.getCommonCharsetNames();
- int totalNum = ianaTags.length;
- for (int i = 0; i < totalNum; i++) {
- String iana = ianaTags[i];
- String enc = CommonCharsetNames.getDisplayString(iana);
-
- if (enc != null) {
- encodingCombo.add(enc);
- }
- else {
- Logger.log(Logger.WARNING, "CommonCharsetNames.getDisplayString(" + iana + ") returned null"); //$NON-NLS-1$ //$NON-NLS-2$
- encodingCombo.add(iana);
- }
- ianaVector.add(iana);
- }
- }
- catch (Exception e) {
- // e.printStackTrace();
- // MessageDialog.openError(getShell(), "Resource exception",
- // "Unable to obtain encoding strings. Check resource file");
- // XMLEncodingPlugin.getPlugin().getMsgLogger().write(e.toString());
- // XMLEncodingPlugin.getPlugin().getMsgLogger().writeCurrentThread();
- Logger.log(Logger.ERROR, "Exception", e); //$NON-NLS-1$
- }
- }
-
- /**
- * <code>getEncoding</code> Get the descriptive encoding name that was
- * selected.
- *
- * @return a <code>String</code> value
- */
- public String getEncoding() {
- return encodingCombo.getText();
- }
-
- /**
- * Method getEncodingCombo. Returns the combo used to display the encoding
- * descriptions.
- *
- * @return Combo
- */
- public Combo getEncodingCombo() {
- return encodingCombo;
- }
-
- /**
- * <code>getIANATag</code> Get the IANA tag equivalent of the selected
- * descriptive encoding name
- *
- * @return a <code>String</code> value
- */
- public String getIANATag() {
- int i = encodingCombo.getSelectionIndex();
- if (i >= 0) {
- return (String) (ianaVector.elementAt(i));
- }
- return ""; //$NON-NLS-1$
- }
-
- protected void init(String ianaLabelStr, String encodingLabelStr) {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- setLayoutData(data);
-
- encodingLabel = createLabel(this, encodingLabelStr);
- encodingCombo = createComboBox(this, true);
- ianaLabel = createLabel(this, ianaLabelStr);
- ianaText = createTextField(this, 20);
- ianaVector = new Vector();
-
- fillCombo();
- resetToDefaultEncoding();
- encodingCombo.addModifyListener(comboListener);
- }
-
- /**
- * <code>isEncodingInList</code> Checks whether the encoding name is in
- * the combo
- *
- * @param enc
- * a <code>string</code> value. The encoding name.
- * @return a <code>boolean</code> value. TRUE if encoding is in list.
- * FALSE if encoding is not in list.
- */
- public boolean isEncodingInList(String enc) {
- int i = encodingCombo.indexOf(enc);
- if (i >= 0) {
- return true;
- }
- return false;
- }
-
- /**
- * <code>isIANATagInList</code> Checks whether the IANA tag is in the
- * combo
- *
- * @param ianaTag
- * a <code>string</code> value. The IANA tag.
- * @return a <code>boolean</code> value. TRUE if tag is in list. FALSE
- * if tag is not in list.
- */
- public boolean isIANATagInList(String ianaTag) {
- int i = ianaVector.indexOf(ianaTag);
- if (i >= 0) {
- return true;
- }
- return false;
- }
-
- /**
- * Method removeEntry. Removes both the description and the IANA tag at
- * the specified index
- *
- * @param index
- */
- public void removeEntry(int index) {
- if ((0 <= index) && (index < ianaVector.size())) {
- encodingCombo.remove(index);
- ianaVector.remove(index);
- }
- }
-
- /**
- * Method resetToDefaultEncoding. Reset the control to the default
- * encoding. Currently UTF-8
- */
- public void resetToDefaultEncoding() {
- String defaultIANATag = "UTF-8"; //$NON-NLS-1$
- ianaText.setText(defaultIANATag);
- setIANATag(defaultIANATag);
- }
-
- /**
- * Method setEnabled. Enable/disable the EncodingSettings composite.
- *
- * @param enabled
- */
- public void setEnabled(boolean enabled) {
- encodingCombo.setEnabled(enabled);
- encodingLabel.setEnabled(enabled);
- ianaLabel.setEnabled(enabled);
- ianaText.setEnabled(enabled);
- }
-
- /**
- * <code>setEncoding</code> Set the selection in the combo to the
- * descriptive encoding name.
- *
- * @param enc
- * a <code>string</code> value. Note this is not the IANA
- * tag.
- */
- public void setEncoding(String enc) {
- encodingCombo.setText(enc);
- encodingCombo.select(encodingCombo.indexOf(enc));
- }
-
- /**
- * <code>setIANATag</code> Set the IANA tag for the combo
- *
- * @param ianaTag
- * a <code>string</code> value. The IANA tag.
- */
- public void setIANATag(String ianaTag) {
- ianaTag = CommonCharsetNames.getPreferenceName(ianaTag);
- int i = ianaVector.indexOf(ianaTag);
- if (i >= 0) {
- encodingCombo.select(i);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java
deleted file mode 100644
index e7930edb9e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java
+++ /dev/null
@@ -1,141 +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.xml.ui.internal.preferences;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * WorkbenchDefaultEncodingSettings is an extension of EncodingSettings. This
- * composite contains EncodingSettings for users to select the encoding they
- * desire as well as a checkbox for users to select to use the default
- * workbench encoding instead.
- *
- * @see org.eclipse.wst.xml.ui.internal.preferences.EncodingSettings
- */
-public class WorkbenchDefaultEncodingSettings extends Composite {
-
- private final static int INDENT = 15;
- private static final String WORKBENCH_DEFAULT = ""; //$NON-NLS-1$
- private EncodingSettings fEncodingSettings;
- private String fNonDefaultIANA = null;
- private Button fUseDefaultButton;
-
- public WorkbenchDefaultEncodingSettings(Composite parent) {
- super(parent, SWT.NONE);
- createControls();
- }
-
- private void createControls() {
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginWidth = 0;
- setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- setLayoutData(data);
-
- Composite defaultEncodingComposite = new Composite(this, SWT.NONE);
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- data = new GridData(GridData.FILL_BOTH);
- defaultEncodingComposite.setLayout(layout);
- defaultEncodingComposite.setLayoutData(data);
-
- fUseDefaultButton = new Button(defaultEncodingComposite, SWT.CHECK);
- fUseDefaultButton.setText(XMLUIMessages.WorkbenchDefaultEncodingSettings_0);
-
- fUseDefaultButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleUseDefaultButtonSelected();
- }
- });
-
- fEncodingSettings = new EncodingSettings(this);
- ((GridLayout) fEncodingSettings.getLayout()).marginWidth = 0;
- ((GridData) fEncodingSettings.getLayoutData()).horizontalIndent = INDENT;
-
- }
-
- private Combo getEncodingCombo() {
- return fEncodingSettings.getEncodingCombo();
- }
-
- /**
- * <code>getIANATag</code> Get the IANA tag equivalent of the selected
- * descriptive encoding name. Returns empty string if using workbench
- * encoding.
- *
- * @return a <code>String</code> value
- */
- public String getIANATag() {
- if (!isDefault()) {
- return fEncodingSettings.getIANATag();
- }
- return WORKBENCH_DEFAULT;
- }
-
- private String getWorkbenchEncoding() {
- return ResourcesPlugin.getEncoding();
- }
-
- void handleUseDefaultButtonSelected() {
- if (fUseDefaultButton.getSelection()) {
- fNonDefaultIANA = fEncodingSettings.getIANATag();
- String workbenchValue = getWorkbenchEncoding();
- workbenchValue = CommonCharsetNames.getIanaPreferredCharsetName(workbenchValue);
- fEncodingSettings.setIANATag(workbenchValue);
- }
- else if (fNonDefaultIANA != null) {
- fEncodingSettings.setIANATag(fNonDefaultIANA);
- }
- getEncodingCombo().setEnabled(!fUseDefaultButton.getSelection());
- fEncodingSettings.setEnabled(!fUseDefaultButton.getSelection());
- }
-
- private boolean isDefault() {
- return fUseDefaultButton.getSelection();
- }
-
- /**
- * <code>setEncoding</code> Set the selection in the combo to the
- * descriptive encoding name. Selects use workbench encoding if ianaTag is
- * null or empty string.
- *
- */
- public void setIANATag(String ianaTag) {
- if ((ianaTag == null) || ianaTag.equals(WORKBENCH_DEFAULT)) {
- fUseDefaultButton.setSelection(true);
- handleUseDefaultButtonSelected();
- }
- else {
- fUseDefaultButton.setSelection(false);
- handleUseDefaultButtonSelected();
- if (!isDefault()) {
- fEncodingSettings.setIANATag(ianaTag);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
deleted file mode 100644
index 4f29d750f1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * @deprecated
- */
-public class XMLColorPage extends AbstractColorPage {
-
- protected Control createContents(Composite parent) {
- Composite pageComponent = createComposite(parent, 1);
- ((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
- super.createContents(pageComponent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.XML_PREFWEBX_STYLES_HELPID);
- return pageComponent;
- }
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String) i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- public String getSampleText() {
- return XMLUIMessages.Sample_XML_doc; // = "<?xml
- // version=\"1.0\"?>\n<?customProcessingInstruction\n\tXML
- // processor
- // specific\n\tcontent
- // ?>\n<!DOCTYPE
- // colors\n\tPUBLIC
- // \"//IBM/XML/COLORS/\"
- // \"colors.dtd\">\n<colors>\n\t<!--
- // begin color definitions
- // -->\n\t<color
- // name=\"plaintext\"
- // foreground=\"#000000\"\n\t\tbackground=\"#D4D0C8\"/>\n\t<color
- // name=\"bold\"
- // foreground=\"#000000\"\n\t\tbackground=\"#B3ACA0\">\n\t<![CDATA[<123456789>]]>\n\tNormal
- // text content.\n\t<color
- // name=\"inverse\"
- // foreground=\"#F0F0F0\"\n\t\tbackground=\"#D4D0C8\"/>\n\n</colors>\n";
- }
-
- protected void initCommonContextStyleMap(Dictionary contextStyleMap) {
-
- contextStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- contextStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
-
- contextStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
- contextStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- contextStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- contextStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
-
- contextStyleMap.put(DOMRegionContext.XML_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
- contextStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- contextStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- contextStyleMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
-
- contextStyleMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
- }
-
- protected void initCommonDescriptions(Dictionary descriptions) {
-
- // create descriptions for hilighting types
- descriptions.put(IStyleConstantsXML.COMMENT_BORDER, XMLUIMessages.Comment_Delimiters_UI_); // =
- // "Comment
- // Delimiters"
- descriptions.put(IStyleConstantsXML.COMMENT_TEXT, XMLUIMessages.Comment_Content_UI_); // =
- // "Comment
- // Content"
- descriptions.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
- // "Tag
- // Delimiters"
- descriptions.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
- // "Tag
- // Names"
- descriptions.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
- // "Attribute
- // Names"
- descriptions.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
- // "Attribute
- // Values"
- descriptions.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_); // =
- // "Declaration
- // Delimiters"
- descriptions.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_); // =
- // "Content"
- descriptions.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
- }
-
- protected void initCommonStyleList(ArrayList list) {
-
- // list.add(IStyleConstantsXML.CDATA_BORDER);
- // list.add(IStyleConstantsXML.CDATA_TEXT);
- // list.add(IStyleConstantsXML.PI_BORDER);
- // list.add(IStyleConstantsXML.PI_CONTENT);
-
- list.add(IStyleConstantsXML.TAG_BORDER);
- list.add(IStyleConstantsXML.TAG_NAME);
- list.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- list.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- list.add(IStyleConstantsXML.COMMENT_BORDER);
- list.add(IStyleConstantsXML.COMMENT_TEXT);
- list.add(IStyleConstantsXML.DECL_BORDER);
- list.add(IStyleConstantsXML.XML_CONTENT);
- list.add(IStyleConstantsXML.ENTITY_REFERENCE);
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- initDocTypeContextStyleMap(contextStyleMap);
- contextStyleMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
- contextStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
-
- contextStyleMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
- contextStyleMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
- contextStyleMap.put(DOMRegionContext.XML_PI_CLOSE, IStyleConstantsXML.PI_BORDER);
-
- }
-
- protected void initDescriptions(Dictionary descriptions) {
-
- initCommonDescriptions(descriptions);
- initDocTypeDescriptions(descriptions);
- descriptions.put(IStyleConstantsXML.CDATA_BORDER, XMLUIMessages.CDATA_Delimiters_UI_); // =
- // "CDATA
- // Delimiters"
- descriptions.put(IStyleConstantsXML.CDATA_TEXT, XMLUIMessages.CDATA_Content_UI_); // =
- // "CDATA
- // Content"
- descriptions.put(IStyleConstantsXML.PI_BORDER, XMLUIMessages.Processing_Instruction_Del_UI_); // =
- // "Processing
- // Instruction
- // Delimiters"
- descriptions.put(IStyleConstantsXML.PI_CONTENT, XMLUIMessages.Processing_Instruction_Con_UI__UI_); // =
- // "Processing
- // Instruction
- // Content"
- }
-
- protected void initDocTypeContextStyleMap(Dictionary contextStyleMap) {
-
- contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- }
-
- protected void initDocTypeDescriptions(Dictionary descriptions) {
-
- // create descriptions for hilighting types for DOCTYPE related items
- descriptions.put(IStyleConstantsXML.DOCTYPE_NAME, XMLUIMessages.DOCTYPE_Name_UI_); // =
- // "DOCTYPE
- // Name"
- descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, XMLUIMessages.DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_); // =
- // "DOCTYPE
- // SYSTEM/PUBLIC
- // Keyword"
- descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, XMLUIMessages.DOCTYPE_Public_Reference_UI_); // =
- // "DOCTYPE
- // Public
- // Reference"
- descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, XMLUIMessages.DOCTYPE_System_Reference_UI_); // =
- // "DOCTYPE
- // System
- // Reference"
- }
-
- protected void initDocTypeStyleList(ArrayList list) {
-
- list.add(IStyleConstantsXML.DOCTYPE_NAME);
- list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- }
-
- protected void initStyleList(ArrayList list) {
- initCommonStyleList(list);
- initDocTypeStyleList(list);
- list.add(IStyleConstantsXML.CDATA_BORDER);
- list.add(IStyleConstantsXML.CDATA_TEXT);
- list.add(IStyleConstantsXML.PI_BORDER);
- list.add(IStyleConstantsXML.PI_CONTENT);
- }
-
- public boolean performOk() {
- // required since the superclass *removes* existing preferences before
- // saving its own
- super.performOk();
-
- SSEUIPlugin.getDefault().savePluginPreferences();
- return true;
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForXML.ContentTypeID_XML).getParser());
-
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- XMLUIPlugin.getDefault().savePluginPreferences();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java
deleted file mode 100644
index 92a7ccc0ce..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java
+++ /dev/null
@@ -1,81 +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.wst.xml.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * <p>The readable and writable completion proposal categories configuration
- * for the XML content type</p>
- */
-public class XMLCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
-
- /** the ID of the preference page where users can change the preferences */
- private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.contentassist"; //$NON-NLS-1$
-
- /**
- * <p>Creates the configuration</p>
- */
- public XMLCompletionProposalCategoriesConfiguration() {
- //nothing to do.
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
- */
- public boolean hasAssociatedPropertiesPage() {
- return true;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
- */
- public String getPropertiesPageID() {
- return PREFERENCES_PAGE_ID;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
- */
- protected String getShouldNotDisplayOnDefaultPagePrefKey() {
- return XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
- */
- protected String getShouldNotDisplayOnOwnPagePrefKey() {
- return XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
- */
- protected String getPageSortOrderPrefKey() {
- return XMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
- */
- protected String getDefaultPageSortOrderPrefKey() {
- return XMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java
deleted file mode 100644
index 28338d47b6..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
-import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * <p>Defines the preference page for allowing the user to change the content
- * assist preferences</p>
- */
-public class XMLContentAssistPreferencePage extends AbstractPreferencePage implements
- IWorkbenchPreferencePage {
-
- private static final String XML_CONTENT_TYPE_ID = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
-
- // Auto Activation
- private Button fAutoPropose;
- private Label fAutoProposeDelayLabel;
- private Text fAutoProposeDelay;
- private Label fAutoProposeLabel;
- private Text fAutoProposeText;
- private Combo fSuggestionStrategyCombo;
- private Vector fSuggestionStrategies = null;
-
- /** configuration block for changing preference having to do with the content assist categories */
- private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
-
- createContentsForAutoActivationGroup(composite);
- createContentsForCyclingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
- */
- protected void performDefaults() {
- performDefaultsForAutoActivationGroup();
- performDefaultsForCyclingGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- initializeValuesForAutoActivationGroup();
- initializeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- storeValuesForAutoActivationGroup();
- storeValuesForCyclingGroup();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#enableValues()
- */
- protected void enableValues() {
- if (fAutoPropose != null) {
- if (fAutoPropose.getSelection()) {
- fAutoProposeDelayLabel.setEnabled(true);
- fAutoProposeDelay.setEnabled(true);
- fAutoProposeLabel.setEnabled(true);
- fAutoProposeText.setEnabled(true);
- }
- else {
- fAutoProposeDelayLabel.setEnabled(false);
- fAutoProposeDelay.setEnabled(false);
- fAutoProposeLabel.setEnabled(false);
- fAutoProposeText.setEnabled(false);
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * <p>Create contents for the auto activation preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForAutoActivationGroup(Composite parent) {
- Group contentAssistGroup = createGroup(parent, 2);
- contentAssistGroup.setText(XMLUIMessages.XMLContentAssistPreferencePage_Auto_Activation_UI_);
-
- fAutoPropose = createCheckBox(contentAssistGroup, XMLUIMessages.Automatically_make_suggest_UI_);
- ((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
- fAutoPropose.addSelectionListener(this);
-
- fAutoProposeDelayLabel = createLabel(contentAssistGroup, XMLUIMessages.Auto_Activation_Delay);
- fAutoProposeDelay = createTextField(contentAssistGroup);
- fAutoProposeDelay.setTextLimit(4);
- fAutoProposeDelay.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- verifyDelay();
- }
- });
-
-
- fAutoProposeLabel = createLabel(contentAssistGroup, XMLUIMessages.Prompt_when_these_characte_UI_);
- fAutoProposeText = createTextField(contentAssistGroup);
-
- createLabel(contentAssistGroup, XMLUIMessages.Suggestion_Strategy);
- fSuggestionStrategyCombo = new Combo(contentAssistGroup, SWT.READ_ONLY);
- fSuggestionStrategies = new Vector();
- fSuggestionStrategyCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Lax);
- fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
- fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Strict);
- fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT);
- }
-
- private void verifyDelay() {
- final String text = fAutoProposeDelay.getText();
- boolean valid = true;
- try {
- final int delay = Integer.parseInt(text);
- if (delay < 0) {
- valid = false;
- }
- }
- catch (NumberFormatException e) {
- valid = false;
- }
- if (!valid) {
- if (text.trim().length() > 0)
- setErrorMessage(NLS.bind(XMLUIMessages.Not_an_integer, text));
- else
- setErrorMessage(XMLUIMessages.Missing_integer);
- setValid(false);
- }
- else {
- setErrorMessage(null);
- setValid(true);
- }
- }
-
- /**
- * <p>Create the contents for the content assist cycling preference group</p>
- * @param parent {@link Composite} parent of the group
- */
- private void createContentsForCyclingGroup(Composite parent) {
- ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(XML_CONTENT_TYPE_ID);
-
- if(configurationWriter != null) {
- fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(XML_CONTENT_TYPE_ID, configurationWriter);
- fConfigurationBlock.createContents(parent, XMLUIMessages.XMLContentAssistPreferencePage_Cycling_UI_);
- } else {
- Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
- " specified for the XML content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
- " preference block for editing proposal categories preferences."); //$NON-NLS-1$
- }
- }
-
- /**
- * <p>Store the values for the auto activation group</p>
- */
- private void storeValuesForAutoActivationGroup() {
- getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
- getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
- getPreferenceStore().setValue(XMLUIPreferenceNames.SUGGESTION_STRATEGY, getCurrentAutoActivationSuggestionStrategy());
- getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY, Integer.parseInt(fAutoProposeDelay.getText()));
- }
-
- /**
- * <p>Store the values for the cycling group</p>
- */
- private void storeValuesForCyclingGroup() {
- if (fConfigurationBlock != null) {
- fConfigurationBlock.storeValues();
- }
- }
-
- /**
- * <p>Initialize the values for the auto activation group</p>
- */
- private void initializeValuesForAutoActivationGroup() {
- fAutoPropose.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
- fAutoProposeText.setText(getPreferenceStore().getString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
- fAutoProposeDelay.setText(Integer.toString(getPreferenceStore().getInt(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY)));
- String suggestionStrategy = getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
- if (suggestionStrategy.length() > 0) {
- setCurrentAutoActivationSuggestionStrategy(suggestionStrategy);
- }
- else {
- setCurrentAutoActivationSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
- }
- }
-
- /**
- * <p>Initialize the values for the cycling group</p>
- */
- private void initializeValuesForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.initializeValues();
- }
- }
-
- /**
- * <p>Load the defaults for the auto activation group</p>
- */
- private void performDefaultsForAutoActivationGroup() {
- fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
- fAutoProposeText.setText(getPreferenceStore().getDefaultString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
- fAutoProposeDelay.setText(Integer.toString(getPreferenceStore().getDefaultInt(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY)));
- String suggestionStrategy = getPreferenceStore().getDefaultString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
- if (suggestionStrategy.length() > 0) {
- setCurrentAutoActivationSuggestionStrategy(suggestionStrategy);
- }
- else {
- setCurrentAutoActivationSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
- }
- }
-
- /**
- * <p>Load the defaults of the cycling group</p>
- */
- private void performDefaultsForCyclingGroup() {
- if(fConfigurationBlock != null) {
- fConfigurationBlock.performDefaults();
- }
- }
-
- /**
- * Return the currently selected suggestion strategy preference
- *
- * @return a suggestion strategy constant from XMLUIPreferenceNames
- */
- private String getCurrentAutoActivationSuggestionStrategy() {
- int i = fSuggestionStrategyCombo.getSelectionIndex();
- if (i >= 0) {
- return (String) (fSuggestionStrategies.elementAt(i));
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Set a suggestion strategy in suggestion strategy combo box
- *
- * @param strategy
- */
- private void setCurrentAutoActivationSuggestionStrategy(String strategy) {
- // Clear the current selection.
- fSuggestionStrategyCombo.clearSelection();
- fSuggestionStrategyCombo.deselectAll();
-
- int i = fSuggestionStrategies.indexOf(strategy);
- if (i >= 0) {
- fSuggestionStrategyCombo.select(i);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
deleted file mode 100644
index 8a19fcac83..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class XMLFilesPreferencePage extends AbstractPreferencePage {
- protected EncodingSettings fEncodingSettings = null;
-
- private Combo fDefaultSuffix;
- private List fValidExtensions;
-
- protected Control createContents(Composite parent) {
- Composite composite = (Composite) super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
- createContentsForCreatingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- protected void createContentsForCreatingGroup(Composite parent) {
- Group creatingGroup = createGroup(parent, 2);
- creatingGroup.setText(XMLUIMessages.Creating_files);
-
- // Default extension for New file Wizard
- createLabel(creatingGroup, XMLUIMessages.XMLFilesPreferencePage_ExtensionLabel);
- fDefaultSuffix = createDropDownBox(creatingGroup);
- String[] validExtensions = (String[]) getValidExtensions().toArray(new String[0]);
- Arrays.sort(validExtensions);
- fDefaultSuffix.setItems(validExtensions);
- fDefaultSuffix.addSelectionListener(this);
-
- Label label = createLabel(creatingGroup, XMLUIMessages.Encoding_desc);
- ((GridData) label.getLayoutData()).horizontalSpan = 2;
- fEncodingSettings = new EncodingSettings(creatingGroup, XMLUIMessages.Encoding);
- ((GridData) fEncodingSettings.getLayoutData()).horizontalSpan = 2;
- }
-
- public void dispose() {
- fDefaultSuffix.removeModifyListener(this);
- super.dispose();
- }
-
- protected void doSavePreferenceStore() {
- XMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
- }
-
- /**
- * Get list of valid extensions
- *
- * @return List
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void initializeValues() {
- initializeValuesForCreatingGroup();
- }
-
- protected void initializeValuesForCreatingGroup() {
- String suffix = getModelPreferences().getString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
- fDefaultSuffix.setText(suffix);
-
- String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- fEncodingSettings.setIANATag(encoding);
- }
-
- protected void performDefaults() {
- performDefaultsForCreatingGroup();
-
- super.performDefaults();
- }
-
- protected void performDefaultsForCreatingGroup() {
- String suffix = getModelPreferences().getDefaultString(XMLCorePreferenceNames.DEFAULT_EXTENSION);
- fDefaultSuffix.setText(suffix);
-
- String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- fEncodingSettings.setIANATag(encoding);
- // fEncodingSettings.resetToDefaultEncoding();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- protected void storeValues() {
- storeValuesForCreatingGroup();
- }
-
- protected void storeValuesForCreatingGroup() {
- String suffix = fDefaultSuffix.getText();
- getModelPreferences().setValue(XMLCorePreferenceNames.DEFAULT_EXTENSION, suffix);
-
- getModelPreferences().setValue(CommonEncodingPreferenceNames.OUTPUT_CODESET, fEncodingSettings.getIANATag());
- }
-
- protected void validateValues() {
- boolean isValid = false;
- Iterator i = getValidExtensions().iterator();
- while (i.hasNext() && !isValid) {
- String extension = (String) i.next();
- isValid = extension.equalsIgnoreCase(fDefaultSuffix.getText());
- }
-
- if (!isValid) {
- setErrorMessage(NLS.bind(XMLUIMessages.XMLFilesPreferencePage_ExtensionError, getValidExtensions().toString()));
- setValid(false);
- }
- else {
- setErrorMessage(null);
- setValid(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
deleted file mode 100644
index 65456897e2..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class XMLSourcePreferencePage extends AbstractPreferencePage implements ModifyListener, SelectionListener, IWorkbenchPreferencePage {
- private final int MIN_INDENTATION_SIZE = 0;
- private final int MAX_INDENTATION_SIZE = 16;
-
- // Formatting
- protected Label fLineWidthLabel;
- protected Text fLineWidthText;
- protected Button fSplitMultiAttrs;
- private Button fIndentUsingTabs;
- private Button fIndentUsingSpaces;
- private Spinner fIndentationSize;
- private Button fPreservePCDATAContent;
- private Button fAlignEndBracket;
- private Button fFormatComments;
- private Button fFormatCommentsJoinLines;
- // BUG195264 - Support for removing/adding a space before empty close tags
- private Button fSpaceBeforeEmptyCloseTag;
- protected Button fClearAllBlankLines;
-
- // grammar constraints
- protected Button fUseInferredGrammar;
-
- protected Control createContents(Composite parent) {
- final Composite composite = super.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_SOURCE_HELPID);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", XMLUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- createContentsForFormattingGroup(composite);
- createContentsForGrammarConstraintsGroup(composite);
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- protected void createContentsForFormattingGroup(Composite parent) {
- Group formattingGroup = createGroup(parent, 2);
- formattingGroup.setText(XMLUIMessages.Formatting_UI_);
-
- fLineWidthLabel = createLabel(formattingGroup, XMLUIMessages.Line_width__UI_);
- fLineWidthText = new Text(formattingGroup, SWT.SINGLE | SWT.BORDER);
- GridData gData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.BEGINNING);
- gData.widthHint = 25;
- fLineWidthText.setLayoutData(gData);
- fLineWidthText.addModifyListener(this);
-
- fSplitMultiAttrs = createCheckBox(formattingGroup, XMLUIMessages.Split_multiple_attributes);
- ((GridData) fSplitMultiAttrs.getLayoutData()).horizontalSpan = 2;
- fAlignEndBracket = createCheckBox(formattingGroup, XMLUIMessages.Align_final_bracket);
- ((GridData) fAlignEndBracket.getLayoutData()).horizontalSpan = 2;
- fPreservePCDATAContent = createCheckBox(formattingGroup, XMLUIMessages.Preserve_PCDATA_Content);
- ((GridData) fPreservePCDATAContent.getLayoutData()).horizontalSpan = 2;
- fClearAllBlankLines = createCheckBox(formattingGroup, XMLUIMessages.Clear_all_blank_lines_UI_);
- ((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
- // formatting comments
- fFormatComments = createCheckBox(formattingGroup, XMLUIMessages.Format_comments);
- ((GridData) fFormatComments.getLayoutData()).horizontalSpan = 2;
- fFormatComments.addSelectionListener(this);
- fFormatCommentsJoinLines = createCheckBox(formattingGroup, XMLUIMessages.Format_comments_join_lines);
- ((GridData) fFormatCommentsJoinLines.getLayoutData()).horizontalSpan = 2;
- ((GridData) fFormatCommentsJoinLines.getLayoutData()).horizontalIndent = 20;
- // end formatting comments
- fSpaceBeforeEmptyCloseTag = createCheckBox(formattingGroup, XMLUIMessages.Space_before_empty_close_tag);
- ((GridData) fSpaceBeforeEmptyCloseTag.getLayoutData()).horizontalSpan = 2;
-
- // [269224] - Place the indent controls in their own composite for proper tab ordering
- Composite indentComposite = createComposite(formattingGroup, 1);
- ((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
- ((GridLayout) indentComposite.getLayout()).marginWidth = 0;
- ((GridLayout) indentComposite.getLayout()).marginHeight = 0;
-
- fIndentUsingTabs = createRadioButton(indentComposite, XMLUIMessages.Indent_using_tabs);
- ((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
-
- fIndentUsingSpaces = createRadioButton(indentComposite, XMLUIMessages.Indent_using_spaces);
- ((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
-
- createLabel(formattingGroup, XMLUIMessages.Indentation_size);
- fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- fIndentationSize.setLayoutData(gd);
- fIndentationSize.setToolTipText(XMLUIMessages.Indentation_size_tip);
- fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
- fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
- fIndentationSize.setIncrement(1);
- fIndentationSize.setPageIncrement(4);
- fIndentationSize.addModifyListener(this);
- }
-
- protected void createContentsForGrammarConstraintsGroup(Composite parent) {
- Group grammarConstraintsGroup = createGroup(parent, 1);
- grammarConstraintsGroup.setText(XMLUIMessages.Grammar_Constraints);
- grammarConstraintsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
-
- fUseInferredGrammar = createCheckBox(grammarConstraintsGroup, XMLUIMessages.Use_inferred_grammar_in_absence_of);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- XMLUIPlugin.getDefault().savePluginPreferences(); // editor
- XMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected void enableValues() {
- if (fFormatComments != null && fFormatCommentsJoinLines != null) {
- fFormatCommentsJoinLines.setEnabled(fFormatComments.getSelection());
- }
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void initializeValues() {
- initializeValuesForFormattingGroup();
- initializeValuesForGrammarConstraintsGroup();
- }
-
- protected void initializeValuesForFormattingGroup() {
- // Formatting
- fLineWidthText.setText(getModelPreferences().getString(XMLCorePreferenceNames.LINE_WIDTH));
- fSplitMultiAttrs.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fAlignEndBracket.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
- fClearAllBlankLines.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
- fPreservePCDATAContent.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
- fSpaceBeforeEmptyCloseTag.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
- fFormatComments.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
- fFormatCommentsJoinLines.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
-
- if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- }
- else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
-
- fIndentationSize.setSelection(getModelPreferences().getInt(XMLCorePreferenceNames.INDENTATION_SIZE));
- }
-
- protected void initializeValuesForGrammarConstraintsGroup() {
- fUseInferredGrammar.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR));
- }
-
- protected void performDefaults() {
- performDefaultsForFormattingGroup();
- performDefaultsForGrammarConstraintsGroup();
-
- validateValues();
- enableValues();
-
- super.performDefaults();
- }
-
- protected void performDefaultsForFormattingGroup() {
- // Formatting
- fLineWidthText.setText(getModelPreferences().getDefaultString(XMLCorePreferenceNames.LINE_WIDTH));
- fSplitMultiAttrs.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fAlignEndBracket.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
- fClearAllBlankLines.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
- fPreservePCDATAContent.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
- // BUG195264 - Support for removing/adding a space before empty close tags
- fSpaceBeforeEmptyCloseTag.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
- fFormatComments.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
- fFormatCommentsJoinLines.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
-
- if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
- fIndentUsingTabs.setSelection(true);
- fIndentUsingSpaces.setSelection(false);
- }
- else {
- fIndentUsingSpaces.setSelection(true);
- fIndentUsingTabs.setSelection(false);
- }
- fIndentationSize.setSelection(getModelPreferences().getDefaultInt(XMLCorePreferenceNames.INDENTATION_SIZE));
- }
-
- protected void performDefaultsForGrammarConstraintsGroup() {
- fUseInferredGrammar.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR));
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- protected void storeValues() {
- storeValuesForFormattingGroup();
- storeValuesForGrammarConstraintsGroup();
- }
-
- protected void storeValuesForFormattingGroup() {
- // Formatting
- getModelPreferences().setValue(XMLCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
- getModelPreferences().setValue(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS, fSplitMultiAttrs.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.ALIGN_END_BRACKET, fAlignEndBracket.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, fClearAllBlankLines.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.PRESERVE_CDATACONTENT, fPreservePCDATAContent.getSelection());
- // BUG195264 - Support for removing/adding a space before empty close tags
- getModelPreferences().setValue(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG, fSpaceBeforeEmptyCloseTag.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT, fFormatComments.getSelection());
- getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES, fFormatCommentsJoinLines.getSelection());
-
- if (fIndentUsingTabs.getSelection()) {
- getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
- }
- else {
- getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.SPACE);
- }
- getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
- }
-
- protected void storeValuesForGrammarConstraintsGroup() {
- getPreferenceStore().setValue(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR, fUseInferredGrammar.getSelection());
- }
-
- protected void validateValues() {
- boolean isError = false;
- String widthText = null;
-
- if (fLineWidthText != null) {
- try {
- widthText = fLineWidthText.getText();
- int formattingLineWidth = Integer.parseInt(widthText);
- if ((formattingLineWidth < WIDTH_VALIDATION_LOWER_LIMIT) || (formattingLineWidth > WIDTH_VALIDATION_UPPER_LIMIT)) {
- throw new NumberFormatException();
- }
- }
- catch (NumberFormatException nfexc) {
- setInvalidInputMessage(widthText);
- setValid(false);
- isError = true;
- }
- }
-
- int indentSize = 0;
- if (fIndentationSize != null) {
- try {
- indentSize = fIndentationSize.getSelection();
- if ((indentSize < MIN_INDENTATION_SIZE) || (indentSize > MAX_INDENTATION_SIZE)) {
- throw new NumberFormatException();
- }
- }
- catch (NumberFormatException nfexc) {
- setInvalidInputMessage(Integer.toString(indentSize));
- setValid(false);
- isError = true;
- }
- }
-
- if (!isError) {
- setErrorMessage(null);
- setValid(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java
deleted file mode 100644
index a0548bcd2d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java
+++ /dev/null
@@ -1,894 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-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.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.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.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.AbstractSyntaxColoringPage;
-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.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-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 XMLSyntaxColoringPage extends AbstractSyntaxColoringPage 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;
-
- private ISourceViewer fPreviewViewer;
-
- // 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);
- fBold.setEnabled(true);
- fItalic.setEnabled(true);
- fStrike.setEnabled(true);
- fUnderline.setEnabled(true);
- fForegroundLabel.setEnabled(true);
- fBackgroundLabel.setEnabled(true);
- fForegroundColorEditor.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.XML_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, XMLUIMessages.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, XMLUIMessages.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);
- fForegroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Foreground_Color_Selector_Button;
- }
- });
-
- 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);
- fBackgroundColorEditor.getButton().getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName (final AccessibleEvent e) {
- e.result = SSEUIMessages.Background_Color_Selector_Button;
- }
- });
-
- fBold = createCheckbox(editControls, XMLUIMessages.SyntaxColoringPage_3);
- fBold.setEnabled(false);
- ((GridData) fBold.getLayoutData()).horizontalSpan = 2;
- fItalic = createCheckbox(editControls, XMLUIMessages.SyntaxColoringPage_4);
- fItalic.setEnabled(false);
- ((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
- fStrike = createCheckbox(editControls, XMLUIMessages.SyntaxColoringPage_5);
- fStrike.setEnabled(false);
- ((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
- fUnderline = createCheckbox(editControls, XMLUIMessages.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:"
- fPreviewViewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = fPreviewViewer.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(ContentTypeIdForXML.ContentTypeID_XML);
- fDocument.set(getExampleText());
- initializeSourcePreviewColors(fPreviewViewer);
- fPreviewViewer.setDocument(fDocument);
-
- top.setWeights(new int[]{1, 1});
- editor.setWeights(new int[]{1, 1});
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.XML_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;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSyntaxColoringPage#getSourcePreview()
- */
- protected ISourceViewer getSourcePreviewViewer() {
- return fPreviewViewer;
- }
-
- // 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 XMLUIPlugin.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 XMLUIMessages.Sample_XML_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.DOCTYPE_NAME);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- styles.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- styles.add(IStyleConstantsXML.CDATA_BORDER);
- styles.add(IStyleConstantsXML.CDATA_TEXT);
- styles.add(IStyleConstantsXML.PI_BORDER);
- styles.add(IStyleConstantsXML.PI_CONTENT);
- styles.add(IStyleConstantsXML.TAG_BORDER);
- styles.add(IStyleConstantsXML.TAG_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- styles.add(IStyleConstantsXML.COMMENT_BORDER);
- styles.add(IStyleConstantsXML.COMMENT_TEXT);
- styles.add(IStyleConstantsXML.DECL_BORDER);
- styles.add(IStyleConstantsXML.XML_CONTENT);
- styles.add(IStyleConstantsXML.ENTITY_REFERENCE);
- 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_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- 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_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
- fContextToStyleMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
- fContextToStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
- fContextToStyleMap.put(DOMRegionContext.XML_PI_CLOSE, IStyleConstantsXML.PI_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- fContextToStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-
- 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);
- }
-
- private void initStyleToDescriptionMap() {
- fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_BORDER, XMLUIMessages.CDATA_Delimiters_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.CDATA_TEXT, XMLUIMessages.CDATA_Content_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.PI_BORDER, XMLUIMessages.Processing_Instruction_Del_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.PI_CONTENT, XMLUIMessages.Processing_Instruction_Con_UI__UI_);
- 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_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_NAME, XMLUIMessages.DOCTYPE_Name_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, XMLUIMessages.DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, XMLUIMessages.DOCTYPE_Public_Reference_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, XMLUIMessages.DOCTYPE_System_Reference_UI_);
- fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_);
- }
-
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- fText.redraw();
- }
-
- public boolean performOk() {
- getOverlayStore().propagate();
-
- XMLUIPlugin.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.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
deleted file mode 100644
index ed6dea52fc..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-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.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;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for XML templates
- */
-public class XMLTemplatePreferencePage extends TemplatePreferencePage {
-
- class XMLEditTemplateDialog extends EditTemplateDialog {
- public XMLEditTemplateDialog(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 StructuredTextViewerConfigurationXML();
-
- 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 XMLTemplatePreferencePage() {
- XMLUIPlugin xmlEditorPlugin = XMLUIPlugin.getDefault();
-
- setPreferenceStore(xmlEditorPlugin.getPreferenceStore());
- setTemplateStore(xmlEditorPlugin.getTemplateStore());
- setContextTypeRegistry(xmlEditorPlugin.getTemplateContextRegistry());
- }
-
- /*
- * (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.XML_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 StructuredTextViewerConfigurationXML();
-
- 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 = ContentTypeIdForXML.ContentTypeID_XML;
- viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- 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 XMLEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
- if (dialog.open() == Window.OK) {
- return dialog.getTemplate();
- }
- return null;
- }
-
- /*
- * (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.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- XMLUIPlugin.getDefault().savePluginPreferences();
- return ok;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java
deleted file mode 100644
index 8487ab2cb3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.xml.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class XMLTypingPreferencePage extends AbstractPreferencePage {
-
- private Button fCloseComment;
- private Button fCloseEndTag;
- private Button fRemoveEndTag;
- private Button fCloseElement;
- private Button fCloseStrings;
- private Button fCloseBrackets;
-
- protected Control createContents(Composite parent) {
- Composite composite = super.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
-
- createStartTagGroup(composite);
- createEndTagGroup(composite);
- createAutoComplete(composite);
- createAutoRemove(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private void createStartTagGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_Start_Tag);
-
- fCloseElement = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Elements);
- ((GridData) fCloseElement.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createEndTagGroup(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_End_Tag);
-
- fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
- ((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createAutoComplete(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_Auto_Complete);
-
- fCloseComment = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Comments);
- ((GridData) fCloseComment.getLayoutData()).horizontalSpan = 2;
-
- fCloseStrings = createCheckBox(group, XMLUIMessages.XMLTyping_Close_Strings);
- ((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
-
- fCloseBrackets = createCheckBox(group, XMLUIMessages.XMLTyping_Close_Brackets);
- ((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
- }
-
- private void createAutoRemove(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(XMLUIMessages.XMLTyping_Auto_Remove);
-
- fRemoveEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Remove_End_Tags);
- ((GridData) fRemoveEndTag.getLayoutData()).horizontalSpan = 2;
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- XMLUIPlugin.getDefault().savePluginPreferences();
-
- return result;
- }
-
- protected void initializeValues() {
- initCheckbox(fCloseComment, XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- initCheckbox(fCloseEndTag, XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
- initCheckbox(fCloseElement, XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
- initCheckbox(fRemoveEndTag, XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
- initCheckbox(fCloseStrings, XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- initCheckbox(fCloseBrackets, XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- protected void performDefaults() {
- defaultCheckbox(fCloseComment, XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
- defaultCheckbox(fCloseEndTag, XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
- defaultCheckbox(fCloseElement, XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
- defaultCheckbox(fRemoveEndTag, XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
- defaultCheckbox(fCloseStrings, XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- defaultCheckbox(fCloseBrackets, XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- }
-
- protected void storeValues() {
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComment != null) ? fCloseComment.getSelection() : false);
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, (fCloseEndTag != null) ? fCloseEndTag.getSelection() : false);
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, (fCloseElement != null) ? fCloseElement.getSelection() : false);
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, (fRemoveEndTag != null) ? fRemoveEndTag.getSelection() : false);
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
- getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
deleted file mode 100644
index ce65015eac..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.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.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for XML UI preferences
- */
-public class XMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE, true);
- store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<=:"); //$NON-NLS-1$
- store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE_DELAY, 500);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=140946
- store.setDefault(XMLUIPreferenceNames.SUGGESTION_STRATEGY, XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT);
- store.setDefault(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR, true);
-
- // XML 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$
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified
- // value is black; leaving as widget default
-
- 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.DECL_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_NAME, 0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, 0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, 128, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, 63, 127, 95) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue); // specified
- // value is black; leaving as widget default
-
- styleValue = ColorHelper.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, IStyleConstantsXML.PI_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue); // specified
- // value is black; leaving as widget default
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_TEXT, 0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.ENTITY_REFERENCE, 42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.ENTITY_REFERENCE, styleValue);
-
- // set default new xml file template to use in new file wizard
- /*
- * Need to find template name that goes with default template id (name
- * may change for different language)
- */
- store.setDefault(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.xml.ui.internal.templates.xmldeclaration"); //$NON-NLS-1$
-
- // Defaults for the Typing preference page
- store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
- store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true);
- store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, true);
- store.setDefault(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true);
- store.setDefault(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
- store.setDefault(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
-
- // Defaults for Content Assist preference page
- store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
- store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
- store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates");
- store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0"+
- "org.eclipse.wst.xml.ui.proposalCategory.xmlTags");
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
deleted file mode 100644
index 83f1278433..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.xml.ui.internal.preferences;
-
-/**
- * Preference keys for XML UI
- */
-public class XMLUIPreferenceNames {
-
- public final static String SUGGESTION_STRATEGY_VALUE_LAX = "Lax"; //$NON-NLS-1$
- public final static String SUGGESTION_STRATEGY_VALUE_STRICT = "Strict"; //$NON-NLS-1$
-
- /**
- * A named preference that controls time before code assist gets auto activated.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE_DELAY = "autoProposeDelay";//$NON-NLS-1$
-
- /**
- * 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$
- }
-
- /**
- * A named preference that controls whether or grammar should be inferred
- * or not.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String USE_INFERRED_GRAMMAR = getUseInferredGrammarKey();
-
- public static class OUTLINE_BEHAVIOR {
- public static final String ELEMENT_NODE = "outline-behavior.element-node"; //$NON-NLS-1$
- public static final String ATTRIBUTE_NODE = "outline-behavior.attribute-node"; //$NON-NLS-1$
- public static final String TEXT_NODE = "outline-behavior.text-node"; //$NON-NLS-1$
- public static final String CDATA_SECTION_NODE = "outline-behavior.cdata-section-node"; //$NON-NLS-1$
- public static final String ENTITY_REFERENCE_NODE = "outline-behavior.entity-reference-node"; //$NON-NLS-1$
- public static final String ENTITY_NODE = "outline-behavior.entity-node"; //$NON-NLS-1$
- public static final String PROCESSING_INSTRUCTION_NODE = "outline-behavior.instruction-node"; //$NON-NLS-1$
- public static final String COMMENT_NODE = "outline-behavior.comment-node"; //$NON-NLS-1$
- public static final String DOCUMENT_NODE = "outline-behavior.document-node"; //$NON-NLS-1$
- public static final String DOCUMENT_TYPE_NODE = "outline-behavior.document-type-node"; //$NON-NLS-1$
- public static final String DOCUMENT_FRAGMENT_NODE = "outline-behavior.document-fragment-node"; //$NON-NLS-1$
- public static final String NOTATION_NODE = "outline-behavior.notation-node"; //$NON-NLS-1$
- }
-
- private static String getUseInferredGrammarKey() {
- return "useInferredGrammar"; //$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 SUGGESTION_STRATEGY = getSuggestionStrategeyKey();
-
- private static String getSuggestionStrategeyKey() {
- return "suggestionStrategy";//$NON-NLS-1$
- }
-
- /**
- * The key to store the last template name used in new DTD 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 initial template ID to be used in the new XML file wizard. In the absence
- * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
- */
- public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing comments while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_COMMENTS = "completeComments"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing end-tags after entering
- * <code>&lt;/</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_END_TAGS = "completeEndTags"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing the element after entering
- * <code>&gt;</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_ELEMENTS = "completeElements"; //$NON-NLS-1$
-
- /**
- * The key to store the option for removing an end-tag if the start tag is
- * converted to an empty-tag.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_REMOVE_END_TAGS = "removeEndTags"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing strings (" and ') while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing brackets ([ and () while
- * typing.
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), ordered is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "xml_content_assist_display_on_default_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key used for saving which categories should not display on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>), order is ignored</p>
- */
- public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "xml_content_assist_display_on_own_page"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "xml_content_assist_own_page_sort_order"; //$NON-NLS-1$
-
- /**
- * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
- *
- * <p>Value is of type {@link String} consisting of
- * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
- * character (<tt>\0</tt>) in the desired sort order.</p>
- */
- public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "xml_content_assist_default_page_sort_order"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java
deleted file mode 100644
index cadbeed6c8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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
- * David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-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.ControlEnableState;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractValidationSettingsPage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class XMLValidatorPreferencePage extends AbstractValidationSettingsPage {
- private static final String SETTINGS_SECTION_NAME = "XMLValidationSeverities";//$NON-NLS-1$
-
- boolean fOriginalUseXIncludeButtonSelected;
-
- boolean fOriginalUseHonourAllButtonSelected;
-
- boolean fOriginalUseExtendedMarkupValidation;
-
- private Combo fIndicateNoGrammar = null;
-
- private Combo fIndicateNoDocumentElement = null;
-
- private Button fHonourAllSchemaLocations = null;
-
- private Button fUseXinclude = null;
-
- private Button fExtendedMarkupValidation;
-
- private Combo fMissingStartTag;
-
- private Combo fMissingEndTag;
-
- private Combo fMissingTagName;
-
- private Combo fEmptyElementTag;
-
- private Combo fEndTagWithAttributes;
-
- private Combo fInvalidWhitespaceBeforeTagname;
-
- private Combo fMissingClosingBracket;
-
- private Combo fMissingClosingQuote;
-
- private Combo fMissingQuotes;
-
- private Combo fInvalidNamespaceInPI;
-
- private Combo fInvalidWhitespaceAtStart;
-
- private Group fMarkupValidationGroup;
- private ControlEnableState fMarkupState;
-
- private static final int[] XML_SEVERITIES = { ValidationMessage.WARNING, ValidationMessage.ERROR, ValidationMessage.IGNORE };
-
- private static final String[] MARKUP_SEVERITIES = { XMLUIMessages.Severity_error, XMLUIMessages.Severity_warning, XMLUIMessages.Severity_ignore };
-
- protected void createContentsForValidatingGroup(Composite validatingGroup) {
-
- if (fIndicateNoGrammar == null)
- fIndicateNoGrammar = addComboBox(validatingGroup, XMLUIMessages.Indicate_no_grammar_specified, XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
-
- if (fIndicateNoDocumentElement == null) {
- fIndicateNoDocumentElement = addComboBox(validatingGroup, XMLUIMessages.Indicate_no_document_element, XMLCorePreferenceNames.INDICATE_NO_DOCUMENT_ELEMENT, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- }
-
- if (fUseXinclude == null) {
- fUseXinclude = createCheckBox(validatingGroup, XMLUIMessages.Use_XInclude);
- ((GridData) fUseXinclude.getLayoutData()).horizontalSpan = 2;
- }
-
- if (fHonourAllSchemaLocations == null) {
- fHonourAllSchemaLocations = createCheckBox(validatingGroup, XMLUIMessages.Honour_all_schema_locations);
- ((GridData) fHonourAllSchemaLocations.getLayoutData()).horizontalSpan = 2;
- }
-
- IScopeContext[] contexts = createPreferenceScopes();
- fOriginalUseXIncludeButtonSelected = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(XMLCorePreferenceNames.USE_XINCLUDE, true);
-
- if (fUseXinclude != null) {
- fUseXinclude.setSelection(fOriginalUseXIncludeButtonSelected);
- }
- fOriginalUseHonourAllButtonSelected = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true);
- if (fHonourAllSchemaLocations != null) {
- fHonourAllSchemaLocations.setSelection(fOriginalUseHonourAllButtonSelected);
- }
-
- }
-
- private void handleMarkupSeveritySelection(boolean selection) {
- if (selection) {
- if (fMarkupState != null) {
- fMarkupState.restore();
- fMarkupState = null;
- }
- } else {
- if (fMarkupState == null)
- fMarkupState = ControlEnableState.disable(fMarkupValidationGroup);
- }
- }
-
- protected void createContentsForMarkupValidationGroup(Composite parent) {
-
- IScopeContext[] contexts = createPreferenceScopes();
-
- fOriginalUseExtendedMarkupValidation = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION, false);
- fExtendedMarkupValidation = createCheckBox(parent, XMLUIMessages.MarkupValidation_files);
-
- ((GridData) fExtendedMarkupValidation.getLayoutData()).horizontalSpan = 2;
- fExtendedMarkupValidation.setSelection(fOriginalUseExtendedMarkupValidation);
-
- fExtendedMarkupValidation.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleMarkupSeveritySelection(fExtendedMarkupValidation.getSelection());
- }
- });
-
- fMarkupValidationGroup = createGroup(parent, 3);
- ((GridLayout) fMarkupValidationGroup.getLayout()).makeColumnsEqualWidth = false;
- fMarkupValidationGroup.setText(XMLUIMessages.MarkupValidation_files_label);
- GridLayout layout = new GridLayout(3, false);
- fMarkupValidationGroup.setLayout(layout);
-
- if (fMissingStartTag == null)
- fMissingStartTag = addComboBox(fMarkupValidationGroup, XMLUIMessages.Missing_start_tag, XMLCorePreferenceNames.MISSING_START_TAG, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fMissingEndTag == null)
- fMissingEndTag = addComboBox(fMarkupValidationGroup, XMLUIMessages.Missing_end_tag, XMLCorePreferenceNames.MISSING_END_TAG, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fMissingTagName == null)
- fMissingTagName = addComboBox(fMarkupValidationGroup, XMLUIMessages.Tag_name_missing, XMLCorePreferenceNames.MISSING_TAG_NAME, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fMissingQuotes == null)
- fMissingQuotes = addComboBox(fMarkupValidationGroup, XMLUIMessages.Missing_quotes, XMLCorePreferenceNames.MISSING_QUOTES, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fMissingClosingBracket == null)
- fMissingClosingBracket = addComboBox(fMarkupValidationGroup, XMLUIMessages.Missing_closing_bracket, XMLCorePreferenceNames.MISSING_CLOSING_BRACKET, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fMissingClosingQuote == null)
- fMissingClosingQuote = addComboBox(fMarkupValidationGroup, XMLUIMessages.Missing_closing_quote, XMLCorePreferenceNames.MISSING_CLOSING_QUOTE, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fEmptyElementTag == null)
- fEmptyElementTag = addComboBox(fMarkupValidationGroup, XMLUIMessages.Empty_element_tag, XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fEndTagWithAttributes == null)
- fEndTagWithAttributes = addComboBox(fMarkupValidationGroup, XMLUIMessages.End_tag_with_attributes, XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fInvalidWhitespaceBeforeTagname == null)
- fInvalidWhitespaceBeforeTagname = addComboBox(fMarkupValidationGroup, XMLUIMessages.Invalid_whitespace_before_tagname, XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fInvalidNamespaceInPI == null)
- fInvalidNamespaceInPI = addComboBox(fMarkupValidationGroup, XMLUIMessages.Namespace_in_pi_target, XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
- if (fInvalidWhitespaceAtStart == null)
- fInvalidWhitespaceAtStart = addComboBox(fMarkupValidationGroup, XMLUIMessages.Whitespace_at_start, XMLCorePreferenceNames.WHITESPACE_AT_START, XML_SEVERITIES, MARKUP_SEVERITIES, 0);
-
- handleMarkupSeveritySelection(fOriginalUseExtendedMarkupValidation);
-
- }
-
- protected void performDefaultsForValidatingGroup() {
- IEclipsePreferences modelPreferences = new DefaultScope().getNode(getPreferenceNodeQualifier());
- boolean useXIncludeButtonSelected = modelPreferences.getBoolean(XMLCorePreferenceNames.USE_XINCLUDE, true);
-
- if (fUseXinclude != null) {
- fUseXinclude.setSelection(useXIncludeButtonSelected);
- }
- boolean useHonourAllButtonSelected = modelPreferences.getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true);
- if (fHonourAllSchemaLocations != null) {
- fHonourAllSchemaLocations.setSelection(useHonourAllButtonSelected);
- }
- }
-
- protected void performDefaultsForMarkupValidationGroup() {
- IEclipsePreferences modelPreferences = new DefaultScope().getNode(getPreferenceNodeQualifier());
- boolean useExtendedMarkupValidation = modelPreferences.getBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION, false);
-
- if (fExtendedMarkupValidation != null) {
- if (fExtendedMarkupValidation.getSelection() != useExtendedMarkupValidation) {
- handleMarkupSeveritySelection(useExtendedMarkupValidation);
- }
- fExtendedMarkupValidation.setSelection(useExtendedMarkupValidation);
- }
- }
-
- protected void storeValuesForValidatingGroup(IScopeContext[] contexts) {
- if (fUseXinclude != null) {
- boolean useXIncludeButtonSelected = fUseXinclude.getSelection();
- contexts[0].getNode(getPreferenceNodeQualifier()).putBoolean(XMLCorePreferenceNames.USE_XINCLUDE, useXIncludeButtonSelected);
- }
- if (fHonourAllSchemaLocations != null) {
- boolean honourAllButtonSelected = fHonourAllSchemaLocations.getSelection();
- contexts[0].getNode(getPreferenceNodeQualifier()).putBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, honourAllButtonSelected);
- }
- }
-
- protected void storeValuesForMarkupValidationGroup(IScopeContext[] contexts) {
- if (fExtendedMarkupValidation != null) {
- boolean extendedMarkupValidation = fExtendedMarkupValidation.getSelection();
- contexts[0].getNode(getPreferenceNodeQualifier()).putBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION, extendedMarkupValidation);
- }
- }
-
- protected void performDefaults() {
- resetSeverities();
- performDefaultsForValidatingGroup();
- performDefaultsForMarkupValidationGroup();
- super.performDefaults();
- }
-
- protected Preferences getModelPreferences() {
- return XMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void doSavePreferenceStore() {
- XMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected void storeValues() {
- super.storeValues();
- IScopeContext[] contexts = createPreferenceScopes();
-
- storeValuesForValidatingGroup(contexts);
- storeValuesForMarkupValidationGroup(contexts);
- }
-
- protected Control createCommonContents(Composite parent) {
- final Composite page = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- page.setLayout(layout);
-
- Group validatingGroup = createGroup(page, 3);
- validatingGroup.setText(XMLUIMessages.Validating_files);
- createContentsForValidatingGroup(validatingGroup);
-
- createContentsForMarkupValidationGroup(page);
-
- return page;
- }
-
- protected String getPreferenceNodeQualifier() {
- return XMLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- protected String getPreferencePageID() {
- return "org.eclipse.wst.sse.ui.preferences.xml.validation";//$NON-NLS-1$
- }
-
- protected String getProjectSettingsKey() {
- return XMLCorePreferenceNames.USE_PROJECT_SETTINGS;
- }
-
- protected String getPropertyPageID() {
- return "org.eclipse.wst.xml.ui.propertyPage.project.validation";//$NON-NLS-1$
- }
-
- public void init(IWorkbench workbench) {
- }
-
- private Group createGroup(Composite parent, int numColumns) {
-
- Group group = new Group(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- return group;
- }
-
- private Button createCheckBox(Composite group, String label) {
- Button button = new Button(group, SWT.CHECK | SWT.LEFT);
- button.setText(label);
-
- // button.setLayoutData(GridDataFactory.fillDefaults().create());
-
- // GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- public void dispose() {
- storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
- super.dispose();
- }
-
- protected IDialogSettings getDialogSettings() {
- return XMLUIPlugin.getDefault().getDialogSettings();
- }
-
- protected boolean shouldRevalidateOnSettingsChange() {
- return fOriginalUseExtendedMarkupValidation != fExtendedMarkupValidation.getSelection() || fOriginalUseXIncludeButtonSelected != fUseXinclude.getSelection() || fOriginalUseHonourAllButtonSelected != fHonourAllSchemaLocations.getSelection() || super.shouldRevalidateOnSettingsChange();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java
deleted file mode 100644
index d9740e9055..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java
+++ /dev/null
@@ -1,52 +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.wst.xml.ui.internal.projection;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition;
-
-/**
- *
- */
-public class XMLCommentFoldingPosition extends AbstractStructuredCommentFoldingPosition {
-
- /**
- * The region covering an XML comment
- */
- private IStructuredDocumentRegion fRegion;
-
- /**
- * Create a folding position to cover a XML comment region
- *
- * @param region
- */
- public XMLCommentFoldingPosition(IStructuredDocumentRegion region) {
- //can't use region.getLength here because doesn't work in DTD docs for some reason
- super(region.getStartOffset(), region.getEndOffset() - region.getStartOffset());
- this.fRegion = region;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition#getEndOffset()
- */
- protected int getEndOffset() {
- return fRegion.getEndOffset();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition#getStartOffset()
- */
- protected int getStartOffset() {
- return fRegion.getStartOffset();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java
deleted file mode 100644
index 233e301133..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java
+++ /dev/null
@@ -1,77 +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.wst.xml.ui.internal.projection;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition;
-
-/**
- * Folds an XML element
- */
-public class XMLElementFoldingPosition extends AbstractStructuredFoldingPosition {
-
- /**
- * The region representing the start of the folding region
- */
- private IStructuredDocumentRegion fStartRegion;
-
- /**
- * The region representing the end of the folding region, or <code>null</code>
- * if the entire folding region is represented by <code>fStartRegion</code>
- */
- private IStructuredDocumentRegion fEndRegion;
-
- /**
- * <p>Used to represent a folding position that covers a single
- * {@link IStructuredDocumentRegion}.</p>
- *
- * @param region the region that covers the entire position of the folding region
- */
- public XMLElementFoldingPosition(IStructuredDocumentRegion region) {
- super(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
- this.fStartRegion = region;
- this.fEndRegion = null;
- }
-
- /**
- * <p>Used to represent a folding position that covers more then one
- * {@link IStructuredDocumentRegion}.</p>
- *
- * @param startRegion the first region covered by this position
- * @param endRegion the last region covered by this position
- */
- public XMLElementFoldingPosition(IStructuredDocumentRegion startRegion, IStructuredDocumentRegion endRegion) {
- super(startRegion.getStartOffset(), endRegion.getEndOffset()-startRegion.getStartOffset());
- this.fStartRegion = startRegion;
- this.fEndRegion = endRegion;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getStartOffset()
- */
- protected int getStartOffset() {
- return fStartRegion.getStartOffset();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getEndOffset()
- */
- protected int getEndOffset() {
- int endOffset;
- if(fEndRegion != null) {
- endOffset = fEndRegion.getEndOffset();
- } else {
- endOffset = fStartRegion.getEndOffset();
- }
- return endOffset;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java
deleted file mode 100644
index fb96c7b7b5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-
-
-/**
- * A folding strategy for XML type structured documents.
- * See AbstractStructuredFoldingStrategy for more details.
- */
-public class XMLFoldingStrategy extends AbstractStructuredFoldingStrategy {
-
- /**
- * Create an instance of the folding strategy.
- * Be sure to set the viewer and document after creation.
- */
- public XMLFoldingStrategy() {
- super();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
- Position retPos = null;
-
- //only want to fold regions of the valid type and with a valid range
- if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
- IDOMNode node = (IDOMNode)indexedRegion;
- IStructuredDocumentRegion startRegion = node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endRegion = node.getEndStructuredDocumentRegion();
-
- //if the node has an endRegion (end tag) then folding region is
- // between the start and end tag
- //else if the region is a comment
- //else if the region is only an open tag or an open/close tag then don't fold it
- if(startRegion != null && endRegion != null) {
- if (endRegion.getEndOffset() >= startRegion.getStartOffset())
- retPos = new XMLElementFoldingPosition(startRegion, endRegion);
- } else if(startRegion != null && indexedRegion instanceof CommentImpl) {
- retPos = new XMLCommentFoldingPosition(startRegion);
- }
- }
-
- return retPos;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
- return (indexedRegion instanceof IDOMNode) && !(indexedRegion instanceof IDOMText);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java
deleted file mode 100644
index a4bd9f6fcb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java
+++ /dev/null
@@ -1,71 +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.xml.ui.internal.properties;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-/**
- * This class should be used for properties which require a combo box cell
- * editor and whose values consist of a list of enumerated strings.
- */
-public class EnumeratedStringPropertyDescriptor extends PropertyDescriptor {
- protected StringComboBoxCellEditor fEditor;
- protected Composite fParent;
-
- /**
- * The enumerated possible values for the described property
- */
- protected String fValues[] = null;
-
- public EnumeratedStringPropertyDescriptor(Object id, String newDisplayName, String[] valuesArray) {
- super(id, newDisplayName);
- setDescription((String) id);
- fValues = valuesArray;
- }
-
- /**
- * Creates and returns a new cell editor for editing this property.
- * Returns <code>null</code> if the property is not editable.
- *
- * @param parent
- * the parent widget for the cell editor
- * @return the cell editor for this property, or <code>null</code> if
- * this property cannot be edited
- */
- public CellEditor createPropertyEditor(Composite parent) {
- // Check to see if we already have a Cell Editor with a valid Control
- // under the given parent.
- // If any of that's not true, create and return a new Cell Editor
- if ((fEditor == null) || (fEditor.getControl() == null) || fEditor.getControl().isDisposed() || (parent != fParent)) {
- fEditor = new StringComboBoxCellEditor(parent, fValues);
- }
- fParent = parent;
- return fEditor;
- }
-
- public void updateValues(String newValues[]) {
- if (Arrays.equals(fValues, newValues)) {
- return;
- }
- fValues = newValues;
- if (fEditor != null) {
- fEditor.setItems(newValues);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java
deleted file mode 100644
index a6536be42a..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java
+++ /dev/null
@@ -1,119 +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.xml.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * An extended ComboBoxCellEditor that selects and returns Strings
- */
-
-public class StringComboBoxCellEditor extends ComboBoxCellEditor {
- private boolean fSettingValue = false;
-
- /**
- *
- */
- public StringComboBoxCellEditor() {
- super();
- }
-
- /**
- * @param parent
- * @param items
- */
- public StringComboBoxCellEditor(Composite parent, String[] items) {
- super(parent, items);
- }
-
- /**
- * @param parent
- * @param items
- * @param style
- */
- public StringComboBoxCellEditor(Composite parent, String[] items, int style) {
- super(parent, items, style);
- }
-
- protected Object doGetValue() {
- // otherwise limits to set of valid values
- Object index = super.doGetValue();
- int selection = -1;
- if (index instanceof Integer) {
- selection = ((Integer) index).intValue();
- }
- if (selection >= 0) {
- return getItems()[selection];
- }
- else if (getControl() instanceof CCombo) {
- // retrieve the actual text as the list of valid items doesn't
- // contain the value
- return ((CCombo) getControl()).getText();
- }
- return null;
- }
-
- protected void doSetValue(Object value) {
- if (fSettingValue) {
- return;
- }
- fSettingValue = true;
- if (value instanceof Integer) {
- super.doSetValue(value);
- }
- else {
- String stringValue = value.toString();
- int selection = -1;
- for (int i = 0; i < getItems().length; i++) {
- if (getItems()[i].equals(stringValue)) {
- selection = i;
- }
- }
- if (selection >= 0) {
- super.doSetValue(new Integer(selection));
- }
- else {
- super.doSetValue(new Integer(-1));
- if ((getControl() instanceof CCombo) && !stringValue.equals(((CCombo) getControl()).getText())) {
- // update the Text widget
- ((CCombo) getControl()).setText(stringValue);
- }
- }
- }
- fSettingValue = false;
- }
-
- public void setItems(String[] newItems) {
- if ((getControl() == null) || getControl().isDisposed()) {
- Logger.log(Logger.ERROR, "Attempted to update item list for disposed cell editor"); //$NON-NLS-1$
- return;
- }
-
- // keep selection if possible
- Object previousSelectedValue = getValue();
- super.setItems(newItems);
- if ((previousSelectedValue != null) && (getControl() instanceof CCombo)) {
- for (int i = 0; i < newItems.length; i++) {
- if (newItems[i].equals(previousSelectedValue)) {
- setValue(previousSelectedValue);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
deleted file mode 100644
index 8bcac35e4e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
+++ /dev/null
@@ -1,834 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource2;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * An IPropertySource implementation for a JFace viewer used to display
- * properties of DOM nodes.
- */
-public class XMLPropertySource implements IPropertySource, IPropertySourceExtension, IPropertySource2 {
- protected final static String CATEGORY_ATTRIBUTES = XMLUIMessages.XMLPropertySourceAdapter_0;
-
- /**
- * Controls whether optional attributes are marked as for "experts"
- */
- private static final boolean fSetExpertFilter = false;
-
- /**
- * Controls whether to derive categories from CMDataTypes; disabled by
- * default until display strings can be planned
- */
- private boolean fShouldDeriveCategories = false;
-
- private final static boolean fSortEnumeratedValues = true;
-
- /**
- * Note: we want the default fCaseSensitive to be true, but, to avoid
- * meaningless double initialization, we leave default here, and set in
- * constructor only.
- */
- private boolean fCaseSensitive;
- private IPropertyDescriptor[] fDescriptors = null;
- private Node fNode = null;
-
- private Stack fValuesBeingSet = new Stack();
-
- public XMLPropertySource(INodeNotifier target) {
- super();
- fNode = initNode(target);
- fCaseSensitive = initCaseSensitive(fNode);
- }
-
- public XMLPropertySource(Node target, boolean useCategories) {
- super();
- initNode(target);
- fNode = target;
- fCaseSensitive = initCaseSensitive(fNode);
- fShouldDeriveCategories = useCategories;
- }
-
- /** Separate method just to isolate error processing */
- private static INodeNotifier initNode(Node target) {
- if (target instanceof INodeNotifier) {
- return (INodeNotifier) target;
- }
- throw new IllegalArgumentException("XMLPropertySource is only for INodeNotifiers"); //$NON-NLS-1$
- }
-
- /** Separate method just to isolate error processing */
- private static Node initNode(INodeNotifier target) {
- if (target instanceof Node) {
- return (Node) target;
- }
- throw new IllegalArgumentException("XMLPropertySource is only for W3C DOM Nodes"); //$NON-NLS-1$
- }
-
- private boolean initCaseSensitive(Node node) {
- // almost all tags are case sensitive, except that old HTML
- boolean caseSensitive = true;
- if (node instanceof IDOMNode) {
- DocumentTypeAdapter adapter = getDocTypeFromDOMNode(node);
- if (adapter != null) {
- caseSensitive = (adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE);
- }
- }
- return caseSensitive;
- }
-
- /**
- * by "internal spec" the DOCTYPE adapter is only available from Document
- * Node
- *
- * @return {@link DocumentTypeAdapter}
- */
- private DocumentTypeAdapter getDocTypeFromDOMNode(Node node) {
- DocumentTypeAdapter adapter = null;
- Document ownerDocument = node.getOwnerDocument();
- if (ownerDocument == null) {
- // if ownerDocument is null, then fNode must be the Document Node
- // [old, old comment]
- // hmmmm, guess not. See
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=130233
- // guess this is used for many INodeNotifiers, not just XML.
- // (and DTD's use IDOMNode? ... that doesn't sound quite right
- // ... but, maybe a separate issue).
- if (node instanceof Document) {
- ownerDocument = (Document) node;
- }
- }
- if (ownerDocument != null) {
- adapter = (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
- }
-
- return adapter;
- }
-
- private String[] _getValidFixedStrings(CMAttributeDeclaration attrDecl, CMDataType helper) {
- String attributeName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- List values = new ArrayList(1);
- String impliedValue = helper.getImpliedValue();
- if (impliedValue != null) {
- values.add(impliedValue);
- }
- boolean checkIfCurrentValueIsIncluded = ((fNode.getAttributes() != null) && (fNode.getAttributes().getNamedItem(attributeName) != null) && (fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null));
- if (checkIfCurrentValueIsIncluded) {
- String currentValue = null;
- currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
- if (!currentValue.equals(impliedValue)) {
- values.add(currentValue);
- }
- }
- String[] validStrings = new String[values.size()];
- validStrings = (String[]) values.toArray(validStrings);
- return validStrings;
- }
-
- private String[] _getValidStrings(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
- String attributeName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- List values = new ArrayList(1);
- boolean currentValueKnown = false;
- boolean checkIfCurrentValueIsKnown = ((fNode.getAttributes() != null) && (fNode.getAttributes().getNamedItem(attributeName) != null) && (fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null));
- String currentValue = null;
- if (checkIfCurrentValueIsKnown) {
- currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
- }
-
- if ((valuesHelper.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) && (valuesHelper.getImpliedValue() != null)) {
- // FIXED value
- currentValueKnown = (currentValue != null) && valuesHelper.getImpliedValue().equals(currentValue);
- values.add(valuesHelper.getImpliedValue());
- }
- else {
- // ENUMERATED values
- String[] valueStrings = null;
- // valueStrings = valuesHelper.getEnumeratedValues();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
- if ((modelQuery != null) && (fNode.getNodeType() == Node.ELEMENT_NODE)) {
- valueStrings = modelQuery.getPossibleDataTypeValues((Element) fNode, attrDecl);
- }
- else {
- valueStrings = attrDecl.getAttrType().getEnumeratedValues();
- }
- if (valueStrings != null) {
- for (int i = 0; i < valueStrings.length; i++) {
- if (checkIfCurrentValueIsKnown && valueStrings[i].equals(currentValue)) {
- currentValueKnown = true;
- }
- values.add(valueStrings[i]);
- }
- }
- }
- if ((valuesHelper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (valuesHelper.getImpliedValue() != null)) {
- if (!values.contains(valuesHelper.getImpliedValue())) {
- values.add(valuesHelper.getImpliedValue());
- }
- }
-
- if (checkIfCurrentValueIsKnown && !currentValueKnown && (currentValue != null) && (currentValue.length() > 0)) {
- values.add(currentValue);
- }
- String[] validStrings = new String[values.size()];
- validStrings = (String[]) values.toArray(validStrings);
- return validStrings;
- }
-
- private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
- return createDefaultPropertyDescriptor(attributeName, false);
- }
-
- private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName, boolean hideOnFilter) {
- // The descriptor class used here is also used in
- // updatePropertyDescriptors()
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
- descriptor.setCategory(getCategory(null, null));
- descriptor.setDescription(attributeName);
- if (hideOnFilter && fSetExpertFilter) {
- descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- }
- return descriptor;
- }
-
- /**
- * Creates a property descriptor for an attribute with ENUMERATED values -
- * if the value does not exist, an editable combo box is returned - if the
- * value exists but is not one in the enumerated list of value, a combo
- * box featuring the current and correct values is returned - if the value
- * exists and it is a valid value, a combo box featuring the correct
- * values with the current one visible is returned
- */
- private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper, Attr attr) {
- // the displayName MUST be set
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrName, attrName, _getValidStrings(attrDecl, valuesHelper));
- descriptor.setCategory(getCategory(attrDecl, attr));
- descriptor.setDescription(attrName);
- if ((attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED) && fSetExpertFilter) {
- descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- }
- return descriptor;
- }
-
- /**
- * Creates a property descriptor for an attribute with a FIXED value - if
- * the value does not exist, an editable combo box is returned - if the
- * value exists but is not the fixed/default value, a combo box featuring
- * the current and correct value is returned - if the value exists and it
- * is the fixed/default value, no cell editor is provided "locking" the
- * value in
- */
- private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper, Attr attr) {
- // the displayName MUST be set
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrName, attrName, _getValidFixedStrings(attrDecl, helper));
- descriptor.setCategory(getCategory(attrDecl, attr));
- descriptor.setDescription(DOMNamespaceHelper.computeName(attrDecl, fNode, null));
- return descriptor;
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
- IPropertyDescriptor descriptor = null;
- CMDataType attrType = attrDecl.getAttrType();
-
- if (attrType != null) {
- // handle declarations that provide FIXED/ENUMERATED values
- if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
- descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType, attr);
- }
- else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) || (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) && (attrType.getImpliedValue() != null)) {
- descriptor = createFixedPropertyDescriptor(attrDecl, attrType, attr);
- }
- else {
- // plain text
- descriptor = createTextPropertyDescriptor(attrDecl, attr);
- }
- }
- else {
- // no extra information given
- descriptor = createTextPropertyDescriptor(attrDecl, attr);
- }
- return descriptor;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return all valid descriptors.
- */
- private IPropertyDescriptor[] createPropertyDescriptors() {
- CMNamedNodeMap attrMap = null;
- CMElementDeclaration ed = getDeclaration();
- if (ed != null) {
- attrMap = ed.getAttributes();
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
- List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attrMap = allAttributes;
- }
-
- List descriptorList = new ArrayList();
- List names = new ArrayList();
- IPropertyDescriptor descriptor;
-
- CMAttributeDeclaration attrDecl = null;
-
- // add descriptors for existing attributes
- NamedNodeMap attributes = fNode.getAttributes();
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
- // if metainfo is present for this attribute, use the
- // CMAttributeDeclaration to derive a descriptor
- if (attrMap != null) {
- String attrName = attr.getName();
- if (fCaseSensitive) {
- attrDecl = (CMAttributeDeclaration) attrMap.getNamedItem(attrName);
- }
- else {
- attrDecl = null;
- for (int j = 0; j < attrMap.getLength(); j++) {
- if (!fCaseSensitive && attrMap.item(j).getNodeName().equalsIgnoreCase(attrName)) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(j);
- break;
- }
- }
- }
- }
- // be consistent: if there's metainfo, use *that* as the
- // descriptor ID
- descriptor = null;
- if (attrDecl != null) {
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- if (!names.contains(attrName)) {
- descriptor = createPropertyDescriptor(attrDecl, attr);
- if (descriptor != null)
- names.add(attrName);
- }
- }
- else {
- if (!names.contains(attr.getName())) {
- descriptor = createDefaultPropertyDescriptor(attr.getName());
- if (descriptor != null)
- names.add(attr.getName());
- }
- }
- if (descriptor != null) {
- descriptorList.add(descriptor);
- }
- }
- }
-
- // add descriptors from the metainfo that are not yet listed
- if (attrMap != null) {
- for (int i = 0; i < attrMap.getLength(); i++) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- if (!names.contains(attrName)) {
- IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
- if (holdDescriptor != null) {
- names.add(attrName);
- descriptorList.add(holdDescriptor);
- }
- }
- }
- }
-
- // add MQE-based descriptors
- if (ed != null && fNode.getNodeType() == Node.ELEMENT_NODE) {
- List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int i = 0; i < nodes.size(); i++) {
- CMNode node = (CMNode) nodes.get(i);
- if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- attrDecl = (CMAttributeDeclaration) node;
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- if (!names.contains(attrName)) {
- IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
- if (holdDescriptor != null) {
- names.add(attrName);
- descriptorList.add(holdDescriptor);
- }
- }
- }
- }
- }
-
-
- IPropertyDescriptor[] descriptors = new IPropertyDescriptor[descriptorList.size()];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = (IPropertyDescriptor) descriptorList.get(i);
- }
- return descriptors;
- }
-
- private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attrName, attrName);
- descriptor.setCategory(getCategory(attrDecl, attr));
- descriptor.setDescription(attrName);
- if ((attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED) && fSetExpertFilter) {
- descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- }
- return descriptor;
- }
-
- private String getCategory(CMAttributeDeclaration attrDecl, Attr attr) {
- if (attr != null) {
- String namespaceURI = attr.getNamespaceURI();
- if (namespaceURI == null)
- namespaceURI = attr.getOwnerElement().getNamespaceURI();
- if (namespaceURI != null)
- return namespaceURI;
- }
- if (attrDecl != null) {
- if (attrDecl.supports("category")) { //$NON-NLS-1$
- return (String) attrDecl.getProperty("category"); //$NON-NLS-1$
- }
- if (fShouldDeriveCategories && (attrDecl.getAttrType() != null) && (attrDecl.getAttrType().getDataTypeName() != null) && (attrDecl.getAttrType().getDataTypeName().length() > 0)) {
- return attrDecl.getAttrType().getDataTypeName();
- }
- }
- return CATEGORY_ATTRIBUTES;
- }
-
- private CMElementDeclaration getDeclaration() {
- if ((fNode == null) || (fNode.getNodeType() != Node.ELEMENT_NODE)) {
- return null;
- }
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
- if (modelQuery != null) {
- return modelQuery.getCMElementDeclaration((Element) fNode);
- }
- return null;
- }
-
- private Display getDisplay() {
-
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * Returns a value for this Node that can be editted in a property sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue() {
- return null;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return all valid descriptors.
- */
- public final IPropertyDescriptor[] getPropertyDescriptors() {
- if ((fDescriptors == null) || (fDescriptors.length == 0)) {
- fDescriptors = createPropertyDescriptors();
- }
- else {
- updatePropertyDescriptors();
- }
- return fDescriptors;
- }
-
- /**
- * Returns the current value for the named property.
- *
- */
- public Object getPropertyValue(Object nameObject) {
- String name = nameObject.toString();
- String returnedValue = null;
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attribute = attrMap.getNamedItem(name);
- if (attribute != null) {
- if (attribute instanceof IDOMNode) {
- returnedValue = ((IDOMNode) attribute).getValueSource();
- }
- else {
- returnedValue = attribute.getNodeValue();
- }
- }
- }
- if (returnedValue == null) {
- returnedValue = ""; //$NON-NLS-1$
- }
- return returnedValue;
- }
-
- private String[] getValidValues(CMAttributeDeclaration attrDecl) {
- if (attrDecl == null) {
- return new String[0];
- }
-
- String[] validValues = null;
- CMDataType attrType = attrDecl.getAttrType();
- if (attrType != null) {
- validValues = _getValidStrings(attrDecl, attrType);
- if (fSortEnumeratedValues) {
- Arrays.sort(validValues);
- }
- }
- if (validValues == null) {
- validValues = new String[0];
- }
- return validValues;
- }
-
- public boolean isPropertyRemovable(Object id) {
- return true;
- }
-
- public boolean isPropertyResettable(Object id) {
- return fNode != null && fNode.getNodeType() == Node.ELEMENT_NODE;
- }
-
- /**
- * Returns whether the property value has changed from the default.
- *
- * @return <code>true</code> if the value of the specified property has
- * changed from its original default value; <code>false</code>
- * otherwise.
- */
- public boolean isPropertySet(Object propertyObject) {
- String property = propertyObject.toString();
-
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attr = attrMap.getNamedItem(property);
- return attr != null && (attr instanceof Attr ? ((Attr) attr).getSpecified() : true);
- }
- return false;
- }
-
- /**
- * Remove the given attribute from the Node
- *
- * @param propertyObject
- */
- public void removeProperty(Object propertyObject) {
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attribute = attrMap.getNamedItem(propertyObject.toString());
- if (attribute != null) {
- try {
- attrMap.removeNamedItem(propertyObject.toString());
- }
- catch (DOMException e) {
- if (e.code != DOMException.INVALID_MODIFICATION_ERR) {
- Logger.logException(e);
- }
- }
- }
- }
- }
-
- /**
- * Resets the specified property's value to its default value.
- */
- public void resetPropertyValue(Object propertyObject) {
- String property = propertyObject.toString();
- CMNamedNodeMap attrDecls = null;
-
- CMElementDeclaration ed = getDeclaration();
- if (ed != null) {
- attrDecls = ed.getAttributes();
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrDecls);
- List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attrDecls = allAttributes;
- }
-
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrDecls != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
- String defValue = null;
- if (attrDecl != null) {
- if (attrDecl.getAttrType() != null) {
- CMDataType helper = attrDecl.getAttrType();
- if ((helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (helper.getImpliedValue() != null)) {
- defValue = helper.getImpliedValue();
- }
- }
- }
- if ((defValue != null) && (defValue.length() > 0)) {
- // implied values will be in the DOM, but not the source
- attrMap.removeNamedItem(property);
- }
- else {
- ((Attr) attrMap.getNamedItem(property)).setValue(""); //$NON-NLS-1$
- }
- }
- else {
- // remember, this method is for reset, not remove
- ((Attr) attrMap.getNamedItem(property)).setValue(""); //$NON-NLS-1$
- }
- }
-
- /**
- * Sets the named property to the given value.
- *
- */
- public void setPropertyValue(Object nameObject, Object value) {
- // Avoid cycling - can happen if a closing cell editor causes a
- // refresh
- // on the PropertySheet page and the setInput again asks the editor to
- // close; besides, why apply the same value twice?
- if (!fValuesBeingSet.isEmpty() && (fValuesBeingSet.peek() == nameObject)) {
- return;
- }
- fValuesBeingSet.push(nameObject);
- String name = nameObject.toString();
- String valueString = ""; //$NON-NLS-1$
- if (value != null) {
- valueString = value.toString();
- }
- NamedNodeMap attrMap = fNode.getAttributes();
- try {
- if (attrMap != null) {
- Attr attr = (Attr) attrMap.getNamedItem(name);
- if (attr != null && attr.getSpecified()) {
- // EXISTING VALUE
- // potential out of control loop if updating the value
- // triggers a viewer update, forcing the
- // active cell editor to save its value and causing the
- // loop to continue
- if ((attr.getValue() == null) || !attr.getValue().equals(valueString)) {
- if (attr instanceof IDOMNode) {
- ((IDOMNode) attr).setValueSource(valueString);
- }
- else {
- attr.setValue(valueString);
- }
- }
- }
- else {
- // NEW(?) value
- Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
- if (newAttr instanceof IDOMNode) {
- ((IDOMNode) newAttr).setValueSource(valueString);
- }
- else {
- newAttr.setValue(valueString);
- }
- attrMap.setNamedItem(newAttr);
- }
- }
- else {
- if (fNode instanceof Element) {
- ((Element) fNode).setAttribute(name, valueString);
- }
- }
- }
- catch (DOMException e) {
- Display d = getDisplay();
- if (d != null) {
- d.beep();
- }
- }
- fValuesBeingSet.pop();
- }
-
- protected void updatePropertyDescriptors() {
- if ((fDescriptors == null) || (fDescriptors.length == 0)) {
- // Nothing to update
- return;
- }
-
- // List of all names encountered in the tag and defined by the element
- List declaredNames = new ArrayList();
- // New descriptor list that will become fDescriptors after all
- // processing is done
- List descriptors = new ArrayList();
- // Names of the descriptors in the above List
- List descriptorNames = new ArrayList();
-
- // Update any descriptors derived from the metainfo
- CMElementDeclaration ed = getDeclaration();
- CMNamedNodeMap attrMap = null;
- if (ed != null) {
- attrMap = ed.getAttributes();
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
- if(modelQuery != null) {
- List nodes = modelQuery.getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- }
- attrMap = allAttributes;
- }
- // Update exiting descriptors; not added to the final list here
- if (attrMap != null) {
- // Update existing descriptor types based on metainfo
- CMAttributeDeclaration attrDecl = null;
- for (int i = 0; i < attrMap.getLength(); i++) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- if (!declaredNames.contains(attrName)) {
- declaredNames.add(attrName);
- }
- for (int j = 0; j < fDescriptors.length; j++) {
- boolean sameName = (fCaseSensitive && fDescriptors[j].getId().equals(attrDecl.getNodeName())) || (!fCaseSensitive && attrDecl.getNodeName().equals(fDescriptors[j].getId().toString()));
- if (sameName) {
- String[] validValues = getValidValues(attrDecl);
- // Update the descriptor for this
- // CMAttributeDeclaration (only enumerated values get
- // updated for now)
- if (fDescriptors[j] instanceof EnumeratedStringPropertyDescriptor) {
- ((EnumeratedStringPropertyDescriptor) fDescriptors[j]).updateValues(validValues);
- }
- // Replace with better descriptor
- else if ((validValues != null) && (validValues.length > 0)) {
- fDescriptors[j] = createPropertyDescriptor(attrDecl, null);
- }
- }
- }
- }
- }
- else {
- // Update existing descriptors based on not having any metainfo
- for (int j = 0; j < fDescriptors.length; j++) {
- // Replace with basic descriptor
- if (!(fDescriptors[j] instanceof TextPropertyDescriptor)) {
- fDescriptors[j] = createDefaultPropertyDescriptor((String) fDescriptors[j].getId());
- }
- }
- }
-
- NamedNodeMap attributes = fNode.getAttributes();
-
- // Remove descriptors for attributes that aren't present AND aren't
- // known through metainfo,
- // do this by only reusing existing descriptors for attributes that
- // are present or declared
- for (int i = 0; i < fDescriptors.length; i++) {
- if (fDescriptors[i] != null) {
- String descriptorName = fDescriptors[i].getId().toString();
- if ((declaredNames.contains(descriptorName) || (attributes.getNamedItem(descriptorName) != null)) && !descriptorNames.contains(descriptorName)) {
- descriptorNames.add(descriptorName);
- descriptors.add(fDescriptors[i]);
- }
- }
- }
-
- // Add descriptors for declared attributes that don't already have one
- if (attrMap != null) {
- // Update existing descriptor types based on metainfo
- CMAttributeDeclaration attrDecl = null;
- for (int i = 0; i < attrMap.getLength(); i++) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
- if (fCaseSensitive) {
- if (!descriptorNames.contains(attrName)) {
- IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
- if (descriptor != null) {
- descriptorNames.add(attrName);
- descriptors.add(descriptor);
- }
- }
- }
- else {
- boolean exists = false;
- for (int j = 0; j < descriptorNames.size(); j++) {
- exists = (descriptorNames.get(j).toString().equalsIgnoreCase(attrName)) || exists;
- }
- if (!exists) {
- descriptorNames.add(attrName);
- IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
- if (descriptor != null) {
- descriptorNames.add(attrName);
- descriptors.add(descriptor);
- }
- }
- }
- }
- }
-
- // Add descriptors for existing attributes that don't already have one
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
- String attrName = attr.getName();
- if (fCaseSensitive) {
- if (!descriptorNames.contains(attrName)) {
- descriptorNames.add(attrName);
- descriptors.add(createDefaultPropertyDescriptor(attrName));
- }
- }
- else {
- boolean exists = false;
- for (int j = 0; j < descriptorNames.size(); j++) {
- exists = (descriptorNames.get(j).toString().equalsIgnoreCase(attrName)) || exists;
- }
- if (!exists) {
- descriptorNames.add(attrName);
- descriptors.add(createDefaultPropertyDescriptor(attrName));
- }
- }
- }
- }
-
- // Update fDescriptors
- IPropertyDescriptor[] newDescriptors = new IPropertyDescriptor[descriptors.size()];
- for (int i = 0; i < newDescriptors.length; i++) {
- newDescriptors[i] = (IPropertyDescriptor) descriptors.get(i);
- }
- fDescriptors = newDescriptors;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java
deleted file mode 100644
index a018b08f09..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java
+++ /dev/null
@@ -1,68 +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.xml.ui.internal.provisional;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NodeLocation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public interface IDOMSourceEditingTextTools extends ISourceEditingTextTools {
- /**
- * Returns a W3C DOM document
- *
- * @return Document object or <code>null</code> if corresponding
- * document does not exist
- */
- Document getDOMDocument();
-
- /**
- * Returns the W3C DOM Node at the given offset
- *
- * @param offset
- * the offset within the IDocument
- * @return a Node at that location, if one is present
- *
- * @throws BadLocationException
- * for invalid offsets
- */
- Node getNode(int offset) throws BadLocationException;
-
- /**
- * Returns a NodeLocation object describing the position information of
- * the Node's start and end tags.
- *
- * @param node
- * @return The NodeLocation for this Node, null for unsupported Node
- * instances.
- */
- NodeLocation getNodeLocation(Node node);
-
- /**
- * Returns the current server-side page language for the Document of the
- * given Node.
- *
- * @return The server-side page language for this nodem null for Nodes
- * within unsupported Documents.
- */
- String getPageLanguage(Node node);
-
- /**
- * Returns start offset of given Node.
- *
- * @param node
- * w3c <code>Node</code> object to check
- * @return the start offset or -1 for unsupported Nodes
- */
- int getStartOffset(Node node);
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java
deleted file mode 100644
index 63a337edd1..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java
+++ /dev/null
@@ -1,182 +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.xml.ui.internal.provisional;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NodeLocation;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Implements ISourceEditingTextTools interface
- */
-public class XMLSourceEditingTextTools implements IDOMSourceEditingTextTools, INodeAdapter {
-
- protected class NodeLocationImpl implements NodeLocation {
- private IDOMNode node;
-
- public NodeLocationImpl(IDOMNode xmlnode) {
- super();
- node = xmlnode;
- }
-
- public int getEndTagEndOffset() {
- if (node.getEndStructuredDocumentRegion() != null) {
- return node.getEndStructuredDocumentRegion().getEndOffset();
- }
- return -1;
- }
-
- public int getEndTagStartOffset() {
- if (node.getEndStructuredDocumentRegion() != null) {
- return node.getEndStructuredDocumentRegion().getStartOffset();
- }
- return -1;
- }
-
- public int getStartTagEndOffset() {
- if (node.getStartStructuredDocumentRegion() != null) {
- return node.getStartStructuredDocumentRegion().getEndOffset();
- }
- return -1;
- }
-
- public int getStartTagStartOffset() {
- if (node.getStartStructuredDocumentRegion() != null) {
- return node.getStartStructuredDocumentRegion().getStartOffset();
- }
- return -1;
- }
- }
-
- StructuredTextEditor fTextEditor = null;
-
- public int getCaretOffset() {
- StructuredTextViewer stv = fTextEditor.getTextViewer();
- if ((stv != null) && (stv.getTextWidget() != null) && !stv.getTextWidget().isDisposed()) {
- return stv.widgetOffset2ModelOffset(stv.getTextWidget().getCaretOffset());
- }
- return 0;
- }
-
- public IDocument getDocument() {
- return fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
- }
-
- public Document getDOMDocument() {
- return (Document) fTextEditor.getModel().getAdapter(Document.class);
- }
-
- /*
- * If similar function is needed, composite it around the text editor's
- * instance. Removed also because it returns an alread-released model
- *
- * public Document getDOMDocument(IMarker marker) { if (marker == null)
- * return null;
- *
- * IResource res = marker.getResource(); if (res == null || !(res
- * instanceof IFile)) return null;
- *
- * IModelManager mm = StructuredModelManager.getModelManager();
- * IStructuredModel model = null; try { model =
- * mm.getExistingModelForRead((IFile) res); if (model == null || !(model
- * instanceof IDOMModel)) return null;
- *
- * return ((IDOMModel) model).getDocument(); } finally { if (model !=
- * null) model.releaseFromRead(); } }
- */
-
- public IEditorPart getEditorPart() {
- return fTextEditor.getEditorPart();
- }
-
- public Node getNode(int offset) throws BadLocationException {
- Node node = null;
- if ((0 <= offset) && (offset <= getDocument().getLength())) {
- node = (Node) fTextEditor.getModel().getIndexedRegion(offset);
- }
- else {
- throw new BadLocationException();
- }
- return node;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.extensions.SourceEditingTextTools#getNodeLocation(org.w3c.dom.Node)
- */
- public NodeLocation getNodeLocation(Node node) {
- if ((node.getNodeType() == Node.ELEMENT_NODE) && (node instanceof IDOMNode)) {
- return new NodeLocationImpl((IDOMNode) node);
- }
- return null;
- }
-
- public String getPageLanguage(Node node) {
- return ""; //$NON-NLS-1$
- }
-
- public ITextSelection getSelection() {
- return (ITextSelection) fTextEditor.getSelectionProvider().getSelection();
- }
-
- /**
- * IExtendedMarkupEditor method
- */
- // public List getSelectedNodes() {
- // ViewerSelectionManager vsm = getViewerSelectionManager();
- // return (vsm != null) ? vsm.getSelectedNodes() : null;
- // }
- public int getStartOffset(Node node) {
- if ((node == null) || !(node instanceof IDOMText)) {
- return -1;
- }
-
- IStructuredDocumentRegion fnode = ((IDOMText) node).getFirstStructuredDocumentRegion();
- return fnode.getStartOffset();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.core.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return ISourceEditingTextTools.class.equals(type);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.core.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.core.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- public void setTextEditor(StructuredTextEditor editor) {
- fTextEditor = editor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java
deleted file mode 100644
index a3c9c7519e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.wst.xml.ui.internal.quickoutline;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-public class XMLContentSelectionProvider implements IContentSelectionProvider {
-
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- ISelection filteredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
- filteredSelection = new StructuredSelection(filteredNodes);
- }
- return filteredSelection;
- }
-
- private Object[] getFilteredNodes(Object[] filteredNodes) {
- for (int i = 0; i < filteredNodes.length; i++) {
- filteredNodes[i] = getFilteredNode(filteredNodes[i]);
- }
- return filteredNodes;
- }
-
- private Object getFilteredNode(Object object) {
- if (object instanceof Node) {
- Node node = (Node) object;
- short nodeType = node.getNodeType();
- // replace attribute node in selection with its parent
- if (nodeType == Node.ATTRIBUTE_NODE) {
- node = ((Attr) node).getOwnerElement();
- }
- // anything else not visible, replace with parent node
- else if (nodeType == Node.TEXT_NODE) {
- node = node.getParentNode();
- }
- return node;
- }
- return object;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java
deleted file mode 100644
index 16d21a1f93..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java
+++ /dev/null
@@ -1,43 +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.wst.xml.ui.internal.quickoutline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.wst.sse.ui.IContentSelectionProvider;
-import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-
-public class XMLQuickOutlineConfiguration extends AbstractQuickOutlineConfiguration {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getContentProvider()
- */
- public ITreeContentProvider getContentProvider() {
- return new JFaceNodeContentProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getContentSelectionProvider()
- */
- public IContentSelectionProvider getContentSelectionProvider() {
- return new XMLContentSelectionProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getLabelProvider()
- */
- public ILabelProvider getLabelProvider() {
- return new JFaceNodeLabelProvider();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java
deleted file mode 100644
index 3794a1782e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java
+++ /dev/null
@@ -1,90 +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.xml.ui.internal.registry;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-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.core.internal.util.Assert;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.DOMObserver;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-
-/**
- *
- */
-public class AdapterFactoryProviderForXML implements AdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
-
- // add the normal content based factories to model's registry
- addContentBasedFactories(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 JFaceNodeAdapterFactory();
- factoryRegistry.addFactory(factory);
- }
-
- // cs... added for inferred grammar support
- //
- if (structuredModel != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
- if (modelQuery != null) {
- CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
- if (documentManager != null) {
- IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
- boolean useInferredGrammar = (store != null) ? store.getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR) : true;
-
- documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
- documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
- documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_USE_CACHED_RESOLVED_URI, true);
- DOMObserver domObserver = new DOMObserver(structuredModel);
- domObserver.setGrammarInferenceEnabled(useInferredGrammar);
- domObserver.init();
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider#isFor(org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForXML);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java
deleted file mode 100644
index 84f2ec934e..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
-
-/**
- * Sets up FindOccurrencesActionDelegate for xml find occurrences processors
- */
-public class XMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
- private List fProcessors;
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- XMLFindOccurrencesProcessor htmlProcessor = new XMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
- }
- return fProcessors;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
deleted file mode 100644
index 6b12fec560..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,31 +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.xml.ui.internal.search;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-/**
- * Configures a FindOccurrencesProcessor with XML partitions and regions
- */
-public class XMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
- protected String[] getPartitionTypes() {
- return new String[]{IXMLPartitions.XML_DEFAULT};
- }
-
- protected String[] getRegionTypes() {
- return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE};
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java
deleted file mode 100644
index 258be52d4f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.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.xml.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectEnclosingXMLActionDelegate extends StructuredSelectActionDelegate {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
- if ((cursorNodeRegion.getOffset() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength())) {
- Node newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.StructureSelectEnclosing_label);
- action.setToolTipText(XMLUIMessages.StructureSelectEnclosing_tooltip);
- action.setDescription(XMLUIMessages.StructureSelectEnclosing_description);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java
deleted file mode 100644
index f5088c3122..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java
+++ /dev/null
@@ -1,109 +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.xml.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectNextXMLActionDelegate extends StructuredSelectActionDelegate {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- int offset = textSelection.getOffset() + textSelection.getLength() - 1;
- if (offset < 0) {
- offset = 0;
- }
-
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, offset);
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
- int currentOffset = textSelection.getOffset();
- int currentEndOffset = currentOffset + textSelection.getLength();
- if ((cursorNodeRegion.getOffset() >= currentOffset) && (cursorNodeRegion.getOffset() <= currentEndOffset) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset)) {
- newRegion = getNewSelectionRegion2(indexedRegion, textSelection);
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.StructureSelectNext_label);
- action.setToolTipText(XMLUIMessages.StructureSelectNext_tooltip);
- action.setDescription(XMLUIMessages.StructureSelectNext_description);
- }
- }
-
- /**
- * This method was separated out from getNewSelectionRegion2 because the
- * code in here is allowed to be called recursively.
- *
- * @param indexedRegion
- * @param textSelection
- * @return new region to select or null if none
- */
- private Region getNewSelectionRegion2(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node node = (Node) indexedRegion;
- Node newNode = node.getNextSibling();
- if (newNode == null) {
- newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(textSelection.getOffset(), newIndexedRegion.getEndOffset() - textSelection.getOffset());
-
- if (newNode.getNodeType() == Node.TEXT_NODE) {
- newRegion = getNewSelectionRegion2(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
- }
- }
- }
- }
- return newRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java
deleted file mode 100644
index 8939c32b4d..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java
+++ /dev/null
@@ -1,88 +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.xml.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectPreviousXMLActionDelegate extends StructuredSelectActionDelegate {
-
- protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
- IndexedRegion indexedRegion = null;
-
- indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
- return indexedRegion;
- }
-
- protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
- Region newRegion = null;
- if (indexedRegion instanceof Node) {
- Node cursorNode = (Node) indexedRegion;
-
- // use parent node for empty text node
- if ((cursorNode.getNodeType() == Node.TEXT_NODE) && (cursorNode.getNodeValue().trim().length() == 0)) {
- cursorNode = cursorNode.getParentNode();
-
- if (cursorNode instanceof IndexedRegion) {
- indexedRegion = (IndexedRegion) cursorNode;
- }
- }
-
- Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
- if ((cursorNodeRegion.getOffset() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset()) && (cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength())) {
- Node newNode = cursorNode.getPreviousSibling();
- if (newNode == null) {
- newNode = cursorNode.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- }
- else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), textSelection.getOffset() + textSelection.getLength() - newIndexedRegion.getStartOffset());
-
- if (newNode.getNodeType() == Node.TEXT_NODE) {
- newRegion = getNewSelectionRegion(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
- }
- }
- }
-
- }
- else {
- newRegion = cursorNodeRegion;
- }
- }
- return newRegion;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(XMLUIMessages.StructureSelectPrevious_label);
- action.setToolTipText(XMLUIMessages.StructureSelectPrevious_tooltip);
- action.setDescription(XMLUIMessages.StructureSelectPrevious_description);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java
deleted file mode 100644
index d77bea1210..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.spelling;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-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.spelling.ISpellcheckDelegate;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * An <code>IAdapterFactory</code> to adapt an <code>IDOMModel</code> to a
- * <code>ISpellcheckDelegate</code>.
- */
-public class SpellcheckDelegateAdapterFactory implements IAdapterFactory {
- /**
- * This list of classes this factory adapts to.
- */
- private static final Class[] ADAPTER_LIST = new Class[]{ISpellcheckDelegate.class};
-
- /**
- * The <code>ISpellcheckDelegate</code> this factory adapts to
- */
- private static final ISpellcheckDelegate DELEGATE = new XMLSpellcheckDelegate();
-
- /**
- * Implementation of <code>ISpellcheckDelegate</code> for XML type documents.
- */
- private static class XMLSpellcheckDelegate implements ISpellcheckDelegate {
-
- /**
- * If the region in the given <code>model</code> at the given <code>offset</code> is a
- * <code>Comment</code> region then it should be spell checked, otherwise it should not.
- *
- * @see org.eclipse.wst.sse.ui.internal.spelling.ISpellcheckDelegate#shouldSpellcheck(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
- */
- public boolean shouldSpellcheck(int offset, IStructuredModel model) {
- boolean shouldSpellcheck = true;
-
- IndexedRegion region = model.getIndexedRegion(offset);
- if(region != null) {
- shouldSpellcheck = region instanceof Comment;
- if (!shouldSpellcheck && region instanceof Text) {
- final Node parent = ((Text) (region)).getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- final ModelQuery mq = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- if (mq != null) {
- final CMElementDeclaration decl = mq.getCMElementDeclaration((Element) parent);
- if (decl != null) {
- final CMDataType type= decl.getDataType();
- shouldSpellcheck = type == null || type.getEnumeratedValues() == null || type.getEnumeratedValues().length == 0;
- }
- }
- }
- }
- }
-
- return shouldSpellcheck;
- }
-
- }
-
- /**
- * Adapts <code>IDOMModel</code> to <code>ISpellcheckDelegate</code>.
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- ISpellcheckDelegate decision = null;
-
- if (adaptableObject instanceof IDOMModel && ISpellcheckDelegate.class.equals(adapterType)) {
- decision = DELEGATE;
- }
-
- return decision;
- }
-
- /**
- * This adapter only adapts to <code>ISpellcheckDelegate</code>
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java
deleted file mode 100644
index 79055b6c95..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsXML {
- public static final String BACKGROUND = "background"; //$NON-NLS-1$
- public static final String CDATA_BORDER = "cdataBorder";//$NON-NLS-1$
- public static final String CDATA_TEXT = "cdataText";//$NON-NLS-1$
- public static final String COMMENT_BORDER = "commentBorder";//$NON-NLS-1$
- public static final String COMMENT_TEXT = "commentText";//$NON-NLS-1$
- public static final String DECL_BORDER = "declBoder";//$NON-NLS-1$
- public static final String DOCTYPE_EXTERNAL_ID = "doctypeExternalId";//$NON-NLS-1$
- public static final String DOCTYPE_EXTERNAL_ID_PUBREF = "doctypeExternalPubref";//$NON-NLS-1$
- public static final String DOCTYPE_EXTERNAL_ID_SYSREF = "doctypeExtrenalSysref";//$NON-NLS-1$
- public static final String DOCTYPE_NAME = "doctypeName";//$NON-NLS-1$
-
- public static final String FOREGROUND = "foreground"; //$NON-NLS-1$
- public static final String PI_BORDER = "piBorder";//$NON-NLS-1$
- public static final String PI_CONTENT = "piContent";//$NON-NLS-1$
-
- public static final String TAG_ATTRIBUTE_EQUALS = "tagAttributeEquals"; //$NON-NLS-1$
- public static final String TAG_ATTRIBUTE_NAME = "tagAttributeName";//$NON-NLS-1$
- public static final String TAG_ATTRIBUTE_VALUE = "tagAttributeValue";//$NON-NLS-1$
- public static final String TAG_BORDER = "tagBorder";//$NON-NLS-1$
- public static final String TAG_NAME = "tagName";//$NON-NLS-1$
- public static final String XML_CONTENT = "xmlContent";//$NON-NLS-1$
- public static final String ENTITY_REFERENCE = "entityReference";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
deleted file mode 100644
index 1241201df8..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.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.XMLUIPlugin;
-
-public class LineStyleProviderForXML extends AbstractLineStyleProvider implements LineStyleProvider {
- public LineStyleProviderForXML() {
- super();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
- }
-
- String type = region.getType();
- if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET) || (type == DOMRegionContext.UNDEFINED)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
- }
- if ((type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_BORDER);
- }
- if (type == DOMRegionContext.XML_CDATA_TEXT) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
- }
- if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- }
- if (type == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
- }
- if (type == DOMRegionContext.XML_TAG_NAME) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
- }
- if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- }
- if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- }
- if ((type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_COMMENT_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_BORDER);
- }
- if (type == DOMRegionContext.XML_COMMENT_TEXT) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_TEXT);
- }
- if (type == DOMRegionContext.XML_DOCTYPE_NAME) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_NAME);
- }
- if ((type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PE_REFERENCE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.ENTITY_REFERENCE);
- }
- if (type == DOMRegionContext.XML_PI_CONTENT) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_CONTENT);
- }
- if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_BORDER);
- }
- if ((type == DOMRegionContext.XML_DECLARATION_OPEN) || (type == DOMRegionContext.XML_DECLARATION_CLOSE)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DECL_BORDER);
- }
- if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- }
- if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- }
- if ((type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC) || (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM)) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- }
- if (type == DOMRegionContext.WHITE_SPACE) {
- /*
- * White space is normally not on its own ... but when it is,
- * we'll treat as content
- */
- return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- /*
- * default, return null to signal "not handled" in which case, other
- * providers should be tried
- */
- return null;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- 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.ENTITY_REFERENCE.equals(prefKey)) {
- styleKey = IStyleConstantsXML.ENTITY_REFERENCE;
- }
- 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;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- /**
- * Loads text attributes into map. Make sure map is cleared before calling
- * this.
- */
- 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(IStyleConstantsXML.ENTITY_REFERENCE);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
deleted file mode 100644
index 9615ad47b3..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
+++ /dev/null
@@ -1,184 +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.xml.ui.internal.taginfo;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation;
-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.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Provides basic tag information such as element/attribute name, data type,
- * and tag info/documentation for CMNodes. Uses HTML to enhance presentation.
- */
-public class MarkupTagInfoProvider {
- protected final static String BOLD_END = "</b>"; //$NON-NLS-1$
- protected final static String BOLD_START = "<b>"; //$NON-NLS-1$
- protected final static String HEADING_END = "</h5>"; //$NON-NLS-1$
- protected final static String HEADING_START = "<h5>"; //$NON-NLS-1$
- protected final static String LIST_BEGIN = "<ul>"; //$NON-NLS-1$
- protected final static String LIST_ELEMENT = "<li>"; //$NON-NLS-1$
- protected final static String NEW_LINE = "<dl>"; //$NON-NLS-1$
- protected final static String PARAGRAPH_END = "</p>"; //$NON-NLS-1$
- protected final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
- protected final static String SPACE = " "; //$NON-NLS-1$
-
- /**
- * Returns basic tag information for display given a CMNode
- *
- * @return String
- */
- public String getInfo(CMNode node) {
- if (node == null) {
- return null;
- }
- StringBuffer sb = new StringBuffer();
- // we assume that if there is tagInfo present, only display tagInfo
- printTagInfo(sb, node);
-
- // no tagInfo present, so try to display tag description
- if (sb.length() == 0) {
- printDescription(sb, node);
- }
-
- // no tag description present either, so display default info
- if (sb.length() == 0) {
- printDefaultInfo(node, sb);
- }
-
- return sb.toString();
- }
-
- /**
- * Adds dataType's data type information, including enumerated type values
- * to string buffer, sb
- *
- */
- protected void printDataTypeInfo(StringBuffer sb, CMDataType dataType) {
- String dataTypeName = dataType.getNodeName();
- if ((dataTypeName != null) && (dataTypeName.length() > 0)) {
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END);
- sb.append(dataTypeName);
- sb.append(PARAGRAPH_END);
- }
- String defaultValue = dataType.getImpliedValue();
- if(defaultValue != null) {
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Default_Value____6 + SPACE + BOLD_END);
- sb.append(defaultValue);
- sb.append(PARAGRAPH_END);
- }
- String[] enumeratedValue = dataType.getEnumeratedValues();
- if ((enumeratedValue != null) && (enumeratedValue.length > 0)) {
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Enumerated_Values____5 + SPACE + BOLD_END);
- sb.append(LIST_BEGIN);
- for (int i = 0; i < enumeratedValue.length; i++) {
- sb.append(LIST_ELEMENT + enumeratedValue[i]);
- }
- sb.append(PARAGRAPH_END);
- }
- }
-
- /**
- * Adds the default info (element name, content model, data type) of
- * CMNode to the string buffer, sb
- *
- */
- protected void printDefaultInfo(CMNode node, StringBuffer sb) {
- {
-
- if (node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- CMElementDeclaration ed = (CMElementDeclaration) node;
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Element____1 + SPACE + BOLD_END);
- sb.append(node.getNodeName());
- sb.append(PARAGRAPH_END);
- printDocumentation(sb, node);
- if (ed.getContentType() == CMElementDeclaration.PCDATA) {
- CMDataType dataType = ed.getDataType();
- if (dataType != null) {
- printDataTypeInfo(sb, dataType);
- }
- }
- else {
- CMDescriptionBuilder builder = new CMDescriptionBuilder();
- String description = builder.buildDescription(node);
- if ((description != null) && (description.length() > 0)) {
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Content_Model____2 + SPACE + BOLD_END);
- sb.append(description + PARAGRAPH_END);
- }
- }
- }
- else if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- CMAttributeDeclaration ad = (CMAttributeDeclaration) node;
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Attribute____3 + SPACE + BOLD_END);
- sb.append(node.getNodeName());
- sb.append(PARAGRAPH_END);
- printDocumentation(sb, node);
- CMDataType dataType = ad.getAttrType();
- if (dataType != null) {
- printDataTypeInfo(sb, dataType);
- }
- }
- else if (node.getNodeType() == CMNode.DATA_TYPE) {
- sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END);
- sb.append(node.getNodeName());
- sb.append(PARAGRAPH_END);
- printDocumentation(sb, node);
- }
- }
- }
-
- /**
- * Adds the description property of the CMNode to the string buffer, sb
- *
- */
- protected void printDescription(StringBuffer sb, CMNode node) {
- String tagInfo = (String) node.getProperty("description"); //$NON-NLS-1$
- if (tagInfo != null) {
- sb.append(PARAGRAPH_START + tagInfo.trim() + PARAGRAPH_END);
- }
- }
-
- /**
- * Adds the tag documentation property of the CMNode to the string buffer,
- * sb
- *
- */
- protected void printDocumentation(StringBuffer sb, CMNode node) {
- CMNodeList nodeList = (CMNodeList) node.getProperty("documentation"); //$NON-NLS-1$
- if ((nodeList != null) && (nodeList.getLength() > 0)) {
- for (int i = 0; i < nodeList.getLength(); i++) {
- CMDocumentation documentation = (CMDocumentation) nodeList.item(i);
- String doc = documentation.getValue();
- if (doc != null) {
- sb.append(PARAGRAPH_START + doc.trim() + PARAGRAPH_END);
- }
- }
- sb.append(NEW_LINE);
- }
- }
-
- /**
- * Adds the tag info property of the CMNode to the string buffer, sb
- *
- */
- protected void printTagInfo(StringBuffer sb, CMNode node) {
- String tagInfo = (String) node.getProperty("tagInfo"); //$NON-NLS-1$
- if (tagInfo != null) {
- sb.append(PARAGRAPH_START + tagInfo.trim() + PARAGRAPH_END);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java
deleted file mode 100644
index fe76a69dab..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides context information for XML tags (Shows tooltip description)
- *
- * @deprecated StructuredTextViewerConfiguration creates the appropriate
- * information provider
- */
-public class XMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
- private ITextHover fTextHover = null;
-
- public XMLInformationProvider() {
- fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new XMLTagInfoHoverProcessor());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
deleted file mode 100644
index 47276fc757..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,362 +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.wst.xml.ui.internal.taginfo;
-
-
-
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-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.Debug;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * Provides hover help documentation for xml tags
- *
- * @see org.eclipse.jface.text.ITextHover
- */
-public class XMLTagInfoHoverProcessor extends AbstractHoverProcessor {
- protected MarkupTagInfoProvider fInfoProvider = null;
-
- /**
- * Constructor for XMLTextHoverProcessor.
- */
- public XMLTagInfoHoverProcessor() {
- // nothing
- }
-
- /**
- * Retreives documentation to display in the hover help popup.
- *
- * @return String any documentation information to display
- * <code>null</code> if there is nothing to display.
- *
- */
- protected String computeHoverHelp(ITextViewer textViewer, int documentPosition) {
- String result = null;
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
- if (treeNode == null) {
- return null;
- }
- Node node = (Node) treeNode;
-
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- IDOMNode parentNode = (IDOMNode) node;
-
- IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(documentPosition);
- if (flatNode != null) {
- ITextRegion region = flatNode.getRegionAtCharacterOffset(documentPosition);
- if (region != null) {
- result = computeRegionHelp(treeNode, parentNode, flatNode, region);
- }
- }
-
- return result;
- }
-
- /**
- * Computes the hoverhelp based on region
- *
- * @return String hoverhelp
- */
- 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 == DOMRegionContext.XML_TAG_NAME) {
- result = computeTagNameHelp((IDOMNode) treeNode, parentNode, flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- result = computeTagAttNameHelp((IDOMNode) treeNode, parentNode, flatNode, region);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- result = computeTagAttValueHelp((IDOMNode) treeNode, parentNode, flatNode, region);
- }
- return result;
- }
-
- /**
- * Computes the hover help for the attribute name
- */
- protected String computeTagAttNameHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
- CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
- String attName = flatNode.getText(region);
- CMAttributeDeclaration attDecl = getCMAttributeDeclaration(xmlnode, elementDecl, attName);
- return getAdditionalInfo(elementDecl, attDecl);
- }
-
- /**
- * Computes the hover help for the attribute value (this is the same as
- * the attribute name's help)
- */
- protected String computeTagAttValueHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
- CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
- ITextRegion attrNameRegion = getAttrNameRegion(xmlnode, region);
-
- String attName = flatNode.getText(attrNameRegion);
- CMAttributeDeclaration attDecl = getCMAttributeDeclaration(xmlnode, elementDecl, attName);
- return getAdditionalInfo(elementDecl, attDecl);
- }
-
- /**
- * Computes the hover help for the tag name
- */
- protected String computeTagNameHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
- CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
- CMElementDeclaration pelementDecl = getCMElementDeclaration(parentNode);
- return getAdditionalInfo(pelementDecl, elementDecl);
- }
-
- /**
- * Retreives cmnode's documentation to display in the hover help popup. If
- * no documentation exists for cmnode, try displaying parentOrOwner's
- * documentation
- *
- * @return String any documentation information to display for cmnode.
- * <code>null</code> if there is nothing to display.
- */
- protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
- String addlInfo = null;
-
- if (cmnode == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return null;
- }
-
- addlInfo = getInfoProvider().getInfo(cmnode);
- if ((addlInfo == null) && (parentOrOwner != null)) {
- addlInfo = getInfoProvider().getInfo(parentOrOwner);
- }
- return addlInfo;
- }
-
- /**
- * Find the region of the attribute name for the given attribute value
- * region
- *
- */
- protected ITextRegion getAttrNameRegion(IDOMNode node, ITextRegion region) {
- // Find the attribute name for which this position should have a value
- IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
- ITextRegionList openRegions = open.getRegions();
- int i = openRegions.indexOf(region);
- if (i < 0) {
- return null;
- }
- ITextRegion nameRegion = null;
- while (i >= 0) {
- nameRegion = openRegions.get(i--);
- if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- break;
- }
- }
- return nameRegion;
- }
-
- /**
- * Retreives CMAttributeDeclaration indicated by attribute name within
- * elementDecl
- */
- protected CMAttributeDeclaration getCMAttributeDeclaration(IDOMNode node, CMElementDeclaration elementDecl, String attName) {
- CMAttributeDeclaration attrDecl = null;
-
- if (elementDecl != null) {
- CMNamedNodeMap attributes = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attributes = allAttributes;
-
- String noprefixName = DOMNamespaceHelper.getUnprefixedName(attName);
- if (attributes != null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(noprefixName);
- if (attrDecl == null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(attName);
- }
- }
- }
- return attrDecl;
- }
-
- /**
- * Retreives CMElementDeclaration for given node
- *
- * @return CMElementDeclaration - CMElementDeclaration of node or
- * <code>null</code> if not possible
- */
- protected CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (modelQuery != null) {
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
- if ((hoverRegion == null) || (viewer == null) || (viewer.getDocument() == null)) {
- return null;
- }
-
- String displayText = null;
- int documentOffset = hoverRegion.getOffset();
- displayText = computeHoverHelp(viewer, documentOffset);
-
- return displayText;
- }
-
- /**
- * Returns the region to hover the text over based on the offset.
- *
- * @param textViewer
- * @param offset
- *
- * @return IRegion region to hover over if offset is within tag name,
- * attribute name, or attribute value and if offset is not over
- * invalid whitespace. otherwise, returns <code>null</code>
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(ITextViewer, int)
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
- if ((textViewer == null) || (textViewer.getDocument() == null)) {
- return null;
- }
-
- IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(offset);
- ITextRegion region = null;
-
- if (flatNode != null) {
- region = flatNode.getRegionAtCharacterOffset(offset);
- }
-
- if (region != null) {
- // only supply hoverhelp for tag name, attribute name, or
- // attribute value
- String regionType = region.getType();
- if ((regionType == DOMRegionContext.XML_TAG_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- try {
- // check if we are at whitespace before or after line
- IRegion line = textViewer.getDocument().getLineInformationOfOffset(offset);
- if ((offset > (line.getOffset())) && (offset < (line.getOffset() + line.getLength()))) {
- // check if we are in region's trailing whitespace
- // (whitespace after relevant info)
- if (offset < flatNode.getTextEndOffset(region)) {
- return new Region(flatNode.getStartOffset(region), region.getTextLength());
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- }
- return null;
- }
-
- /**
- * @deprecated if enabled flag is false, dont call getHoverRegion in the
- * first place if true, use getHoverRegion(ITextViewer, int)
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset, boolean enabled) {
- if ((!enabled) || (textViewer == null) || (textViewer.getDocument() == null)) {
- return null;
- }
-
- IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(offset);
- ITextRegion region = null;
-
- if (flatNode != null) {
- region = flatNode.getRegionAtCharacterOffset(offset);
- }
-
- if (region != null) {
- // only supply hoverhelp for tag name, attribute name, or
- // attribute value
- String regionType = region.getType();
- if ((regionType == DOMRegionContext.XML_TAG_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- try {
- // check if we are at whitespace before or after line
- IRegion line = textViewer.getDocument().getLineInformationOfOffset(offset);
- if ((offset > (line.getOffset())) && (offset < (line.getOffset() + line.getLength()))) {
- // check if we are in region's trailing whitespace
- // (whitespace after relevant info)
- if (offset < flatNode.getTextEndOffset(region)) {
- return new Region(flatNode.getStartOffset(region), region.getTextLength());
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
- }
- return null;
- }
-
- /**
- * Gets the infoProvider.
- *
- * @return Returns fInfoProvider and if fInfoProvider was
- * <code>null</code> set fInfoProvider to DefaultInfoProvider
- */
- public MarkupTagInfoProvider getInfoProvider() {
- if (fInfoProvider == null) {
- fInfoProvider = new MarkupTagInfoProvider();
- }
- return fInfoProvider;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java
deleted file mode 100644
index 079b04270c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class EncodingTemplateVariableResolverXML extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverXML() {
- super(ENCODING_TYPE, XMLUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return XMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java
deleted file mode 100644
index f7993e295c..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java
+++ /dev/null
@@ -1,50 +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.xml.ui.internal.templates;
-
-public class TemplateContextTypeIdsXML {
-
- public static final String ALL = getAll();
-
- public static final String ATTRIBUTE = getAttribute();
-
- public static final String ATTRIBUTE_VALUE = getAttributeValue();
-
- public static final String NEW = getNew();
-
- public static final String TAG = getTag();
-
- private static String getAll() {
- return getPrefix() + "_all"; //$NON-NLS-1$
- }
-
- private static String getAttribute() {
- return getPrefix() + "_attribute"; //$NON-NLS-1$
- }
-
- private static String getAttributeValue() {
- return getPrefix() + "_attribute_value"; //$NON-NLS-1$
- }
-
- private static String getNew() {
- return getPrefix() + "_new"; //$NON-NLS-1$
- }
-
- private static String getPrefix() {
- return "xml"; //$NON-NLS-1$
- }
-
- private static String getTag() {
- return getPrefix() + "_tag"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java
deleted file mode 100644
index 43ccf20924..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for XML template context types. Templates of this context type
- * apply to any place within XML content type.
- */
-public class TemplateContextTypeXML extends TemplateContextType {
-
- public TemplateContextTypeXML() {
- 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 EncodingTemplateVariableResolverXML());
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java
deleted file mode 100644
index e83c1a0774..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.graphics.Point;
-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.ui.typing.AbstractCharacterPairInserter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-
-public class CharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {
-
- // preferences
- private boolean fCloseStrings = true;
- private boolean fCloseBrackets = true;
-
- protected boolean shouldPair(ISourceViewer viewer, char c) {
- switch (c) {
- case '\'':
- case '"':
- return fCloseStrings ? checkRegion(viewer, c) : false;
- default:
- return fCloseBrackets;
- }
- }
-
- /**
- * Checks if the region should support paired quotes
- * @param viewer the viewer
- * @return true if the region is not in an XML attribute value
- */
- private boolean checkRegion(ISourceViewer viewer, char c) {
- IDocument doc = viewer.getDocument();
- final Point selection= viewer.getSelectedRange();
- final int offset= selection.x;
-
- if (doc instanceof IStructuredDocument) {
- IStructuredDocumentRegion[] regions = ((IStructuredDocument) doc).getStructuredDocumentRegions(offset, 0);
- if (regions != null && regions.length > 0) {
- ITextRegion region = regions[0].getRegionAtCharacterOffset(offset);
- if (region != null) {
- final String type = region.getType();
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(type))
- return true;
- else if (DOMRegionContext.XML_TAG_CLOSE.equals(type) || DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(type)) {
- if (regions[0].containsOffset(offset - 1)) {
- region = regions[0].getRegionAtCharacterOffset(offset - 1);
- if (region != null && DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(region.getType()))
- return true;
- }
- }
- return c != '\'' && DOMRegionContext.XML_CONTENT.equals(type);
- }
- }
- }
- return true;
- }
-
- public boolean hasPair(char c) {
- switch (c) {
- case '"':
- case '\'':
- case '[':
- case '(':
- return true;
- default:
- return false;
- }
- }
-
- protected char getPair(char c) {
- switch (c) {
- case '\'':
- case '"':
- return c;
- case '(':
- return ')';
- case '[':
- return ']';
- default:
- throw new IllegalArgumentException();
- }
- }
-
- public void initialize() {
- IPreferenceStore store = XMLUIPlugin.getInstance().getPreferenceStore();
- fCloseStrings = store.getBoolean(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
- fCloseBrackets = store.getBoolean(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
- store.addPropertyChangeListener(this);
- }
-
- public void dispose() {
- XMLUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))
- fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
- else if (XMLUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))
- fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index b29fd9b47b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,27 +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.wst.xml.ui.internal.text;
-
-import org.eclipse.jface.text.source.DefaultCharacterPairMatcher;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- private static final char[] PAIRS = {'{', '}', '(', ')', '[', ']','"','"','\'','\''};
-
- public XMLDocumentRegionEdgeMatcher() {
- super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new DefaultCharacterPairMatcher(PAIRS));
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java
deleted file mode 100644
index 9981244de5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,72 +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.xml.ui.internal.util;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-public class SharedXMLEditorPluginImageHelper {
- public static final String IMG_DTOOL_CONSTRAINOFF = XMLEditorPluginImages.IMG_DTOOL_CONSTRAINOFF;
- public static final String IMG_DTOOL_CONSTRAINON = XMLEditorPluginImages.IMG_DTOOL_CONSTRAINON;
- public static final String IMG_DTOOL_RLDGRMR = XMLEditorPluginImages.IMG_DTOOL_RLDGRMR;
- public static final String IMG_DTOOL_VALIDATE = XMLEditorPluginImages.IMG_DTOOL_VALIDATE;
- public static final String IMG_ETOOL_CONSTRAINOFF = XMLEditorPluginImages.IMG_ETOOL_CONSTRAINOFF;
- public static final String IMG_ETOOL_CONSTRAINON = XMLEditorPluginImages.IMG_ETOOL_CONSTRAINON;
- public static final String IMG_ETOOL_RLDGRMR = XMLEditorPluginImages.IMG_ETOOL_RLDGRMR;
- public static final String IMG_ETOOL_VALIDATE = XMLEditorPluginImages.IMG_ETOOL_VALIDATE;
- public static final String IMG_OBJ_ATTRIBUTE = XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE;
- public static final String IMG_OBJ_CDATASECTION = XMLEditorPluginImages.IMG_OBJ_CDATASECTION;
- public static final String IMG_OBJ_COMMENT = XMLEditorPluginImages.IMG_OBJ_COMMENT;
- public static final String IMG_OBJ_DOCTYPE = XMLEditorPluginImages.IMG_OBJ_DOCTYPE;
- public static final String IMG_OBJ_ELEMENT = XMLEditorPluginImages.IMG_OBJ_ELEMENT;
- public static final String IMG_OBJ_ENTITY = XMLEditorPluginImages.IMG_OBJ_ENTITY;
- public static final String IMG_OBJ_ENTITY_REFERENCE = XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE;
- public static final String IMG_OBJ_NOTATION = XMLEditorPluginImages.IMG_OBJ_NOTATION;
- public static final String IMG_OBJ_PROCESSINGINSTRUCTION = XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION;
- public static final String IMG_OBJ_TAG_GENERIC = XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC;
- public static final String IMG_OBJ_TAG_MACRO = XMLEditorPluginImages.IMG_OBJ_TAG_MACRO;
- public static final String IMG_OBJ_TXTEXT = XMLEditorPluginImages.IMG_OBJ_TXTEXT;
-
- /**
- * Retrieves the specified image from the xml source editor plugin's image
- * registry. Note: The returned <code>Image</code> is managed by the
- * workbench; clients must <b>not </b> dispose of the returned image.
- *
- * @param symbolicName
- * the symbolic name of the image; there are constants declared
- * in this class for build-in images that come with the xml
- * source editor
- * @return the image, or <code>null</code> if not found
- */
- public static Image getImage(String symbolicName) {
- return XMLEditorPluginImageHelper.getInstance().getImage(symbolicName);
- }
-
- /**
- * Retrieves the image descriptor for specified image from the xml source
- * editor plugin's image registry. Unlike <code>Image</code>s, image
- * descriptors themselves do not need to be disposed.
- *
- * @param symbolicName
- * the symbolic name of the image; there are constants declared
- * in this interface for build-in images that come with the xml
- * source editor
- * @return the image descriptor, or <code>null</code> if not found
- */
- public static ImageDescriptor getImageDescriptor(String symbolicName) {
- return XMLEditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java
deleted file mode 100644
index a3ba0bba36..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java
+++ /dev/null
@@ -1,95 +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.xml.ui.internal.util;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * @deprecated use XMLUIPlugin.getResourceString() instead
- */
-/**
- * This class exists temporarily until the properties files can be
- * re-organized and the various resource references can be updated
- */
-public class XMLCommonResources {
- protected static XMLCommonResources instance;
-
- public synchronized static XMLCommonResources getInstance() {
- if (instance == null) {
- instance = new XMLCommonResources(XMLUIPlugin.getDefault());
- }
- return instance;
- }
-
- private XMLUIPlugin editorPlugin;
-
- private ResourceBundle resourceBundle;
-
- public XMLCommonResources(XMLUIPlugin editorPlugin) {
- instance = this;
- this.editorPlugin = editorPlugin;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xml.ui.internal.XMLUIPluginResources"); //$NON-NLS-1$
- }
- catch (MissingResourceException exception) {
- // TODO... log an error message
- // B2BUtilPlugin.getPlugin().getMsgLogger().write(B2BUtilPlugin.getGUIString("_WARN_PLUGIN_PROPERTIES_MISSING")
- // + descriptor.getLabel());
- resourceBundle = null;
- }
- }
-
- ImageDescriptor _getImageDescriptor(String iconName) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, iconName);
- }
-
-
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- /**
- * This gets the string resource.
- */
- public String getString(String key) {
- return getResourceBundle().getString(key);
- }
-
- /**
- * This gets the string resource and does one substitution.
- */
- public String getString(String key, Object s1) {
- return MessageFormat.format(getString(key), new Object[]{s1});
- }
-
- /**
- * This gets the string resource and does two substitutions.
- */
- public String getString(String key, Object s1, Object s2) {
- return MessageFormat.format(getString(key), new Object[]{s1, s2});
- }
-
- public IWorkbench getWorkbench() {
- return editorPlugin.getWorkbench();
- }
- /*
- * public ImageFactory getImageFactory() { return imageFactory; }
- */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java
deleted file mode 100644
index 763d502b7f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java
+++ /dev/null
@@ -1,51 +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.xml.ui.internal.util;
-
-/**
- * Context help id constants.
- */
-public interface XMLCommonUIContextIds {
- public static final String PLUGIN_NAME = "org.eclipse.wst.xml.ui"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0500 for Edit Attribute Instruction Dialog */
- public static final String XCUI_ATTRIBUTE_DIALOG = PLUGIN_NAME + ".xcui0500"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0400 for Select XML Catalog ID Dialog */
- public static final String XCUI_CATALOG_DIALOG = PLUGIN_NAME + ".xcui0400"; //$NON-NLS-1$
-
- /* CONTEXT_IDs for XML Common UI use xcuixxx context IDs */
-
- /* CONTEXT_ID xcui0010 for Edit Doctype Dialog */
- public static final String XCUI_DOCTYPE_DIALOG = PLUGIN_NAME + ".xcui0010"; //$NON-NLS-1$
- /* CONTEXT_ID xcui0030 for Public ID Text Edit */
- public static final String XCUI_DOCTYPE_PUBLIC = PLUGIN_NAME + ".xcui0030"; //$NON-NLS-1$
- /* CONTEXT_ID xcui0020 for Root Element Name Text Edit */
- public static final String XCUI_DOCTYPE_ROOT = PLUGIN_NAME + ".xcui0020"; //$NON-NLS-1$
- /* CONTEXT_ID xcui0040 for System ID Text Edit */
- public static final String XCUI_DOCTYPE_SYSTEM = PLUGIN_NAME + ".xcui0050"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0300 for Edit Element Instruction Dialog */
- public static final String XCUI_ELEMENT_DIALOG = PLUGIN_NAME + ".xcui0600"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0200 for Edit Namespace Dialog */
- public static final String XCUI_NAMESPACE_DIALOG = PLUGIN_NAME + ".xcui0200"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0300 for Edit Processing Instruction Dialog */
- public static final String XCUI_PROCESSING_DIALOG = PLUGIN_NAME + ".xcui0300"; //$NON-NLS-1$
-
- /* CONTEXT_ID xcui0100 for Edit Schema Information Dialog */
- public static final String XCUI_SCHEMA_INFO_DIALOG = PLUGIN_NAME + ".xcui0100"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
deleted file mode 100644
index 68e6e3b7c5..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-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.quickassist.IQuickAssistProcessor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.AnnotationInfo;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.IncrementalReporter;
-import org.eclipse.wst.validation.internal.core.IMessageAccess;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.validation.AnnotationMsg;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A DelegatingReconcileValidator calls its delegate validator to get a list
- * of validation error IMessages. Using information in this IMessage the
- * DelegatingReconcileValidator updates the IMessage with an offset and length
- * to give a good range to be "squiggled" and adds the messages to the
- * IReporter
- *
- * @author Mark Hutchinson
- *
- */
-public abstract class DelegatingSourceValidator implements IValidator {
- // the selection strategies:
- protected static final String ALL_ATTRIBUTES = "ALL_ATTRIBUTES"; //$NON-NLS-1$
- protected static final String ATTRIBUTE_NAME = "ATTRIBUTE_NAME"; //$NON-NLS-1$
- protected static final String ATTRIBUTE_NAME_LAST = "ATTRIBUTE_NAME_LAST"; //$NON-NLS-1$
- protected static final String ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
- protected static final String START_TAG = "START_TAG"; //$NON-NLS-1$
- protected static final String TEXT = "TEXT"; //$NON-NLS-1$
- protected static final String FIRST_NON_WHITESPACE_TEXT = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
- protected static final String TEXT_ENTITY_REFERENCE = "TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
- protected static final String VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
- protected static final String END_TAG = "END_TAG"; //$NON-NLS-1$
- private static final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
-
-
-
- /**
- * This constant specifies the attribute name that specifies the side of
- * the 'start tag' that the validator has used to report an error. A
- * validator may choose to report a message at the left (the start of the
- * start tag)or at the right (the end of the start tag). When this
- * attribute is not specified error ERROR_SIDE_LEFT is the default.
- */
- protected static final String ERROR_SIDE = "ERROR_SIDE"; //$NON-NLS-1$
-
- /**
- * When the ERROR_SIDE attribute specifies the ERROR_SIDE_LEFT value it is
- * assumed that the message specifies a location to the left of the start
- * tag
- */
- protected static final String ERROR_SIDE_LEFT = "ERROR_SIDE_LEFT"; //$NON-NLS-1$
-
- /**
- * When the ERROR_SIDE attribute specifies the ERROR_SIDE_RIGHT value it
- * is assumed that the message specifies a location to the right of the
- * start tag
- */
- protected static final String ERROR_SIDE_RIGHT = "ERROR_SIDE_RIGHT"; //$NON-NLS-1$
-
- protected static final String COLUMN_NUMBER_ATTRIBUTE = "columnNumber"; //$NON-NLS-1$
- protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; //$NON-NLS-1$
- protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; //$NON-NLS-1$
-
- public DelegatingSourceValidator() {
- super(); // constructor
- }
-
- public void cleanup(IReporter arg0) { // don't need to implement
- }
-
- // My Implementation of IHelper
- class MyHelper implements IProjectValidationContext {
- InputStream inputStream;
-
- IFile file;
-
- public MyHelper(InputStream inputStream, IFile file) {
- this.inputStream = inputStream;
- this.file = file;
- }
-
- public int getBuildKind() {
- return 0;
- }
-
- public Object loadModel(String symbolicName, Object[] parms) {
- if (symbolicName.equals("getFile")) { //$NON-NLS-1$
- return file;
- }
- return null;
- }
-
- public Object loadModel(String symbolicName) {
- if (symbolicName.equals("inputStream")) { //$NON-NLS-1$
- return inputStream;
- }
- return null;
- }
-
- public String[] getURIs() {
- if (file != null) {
- return new String[]{file.getFullPath().toString()};
- }
- return new String[0];
- }
-
- public IProject getProject() {
- if (file != null) {
- return file.getProject();
- }
- return null;
- }
- }
-
- // My Implementation of IReporter
- class MyReporter implements IReporter {
- List list = new ArrayList();
-
- public MyReporter() {
- super();
- }
-
- public void addMessage(IValidator origin, IMessage message) {
- list.add(message);
- }
-
- public void displaySubtask(IValidator validator, IMessage message) {
- /* do not need to implement */
- }
-
- public IMessageAccess getMessageAccess() {
- return null;
- }
-
- public boolean isCancelled() {
- return false;
- }
-
- public void removeAllMessages(IValidator origin, Object object) { // do
- /* do not need to implement */
- }
-
- public void removeAllMessages(IValidator origin) {
- /* do not need to implement */
- }
-
- public void removeMessageSubset(IValidator validator, Object obj, String groupName) {// do
- /* do not need to implement */
- }
-
- public List getMessages() {
- return list;
- }
- }
-
- protected abstract IValidator getDelegateValidator();
-
- /**
- * Calls a delegate validator getting and updates it's list of
- * ValidationMessages with a good squiggle offset and length.
- *
- * @param helper
- * loads an object.
- * @param reporter
- * Is an instance of an IReporter interface, which is used for
- * interaction with the user.
- */
- public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
- String[] delta = helper.getURIs();
- if (delta.length > 0) {
- // get the file, model and document:
- IFile file = getFile(delta[0]);
- IDOMModel xmlModel = null;
- if (file != null)
- xmlModel = getModelForResource(file);
- // some problem occurred, abort
- if (xmlModel == null)
- return;
-
- try {
- IDOMDocument document = xmlModel.getDocument();
-
- // store the text in a byte array; make a full copy to ease
- // any threading problems
- byte[] byteArray;
- try {
- byteArray = xmlModel.getStructuredDocument().get().getBytes("UTF-8");
- }
- catch (UnsupportedEncodingException e) {
- // Not likely to happen
- byteArray = xmlModel.getStructuredDocument().get().getBytes();
- }
-
- if (isDelegateValidatorEnabled(file)) {
- IValidator validator = getDelegateValidator();
- if (validator != null) {
- // Validate the file:
- IValidationContext vHelper = new MyHelper(new ByteArrayInputStream(byteArray), file);
- MyReporter vReporter = new MyReporter();
- if (validator instanceof IValidatorJob) {
- ((IValidatorJob) validator).validateInJob(vHelper, vReporter);
- }
- else {
- validator.validate(vHelper, vReporter);
- }
- List messages = vReporter.list;
-
- // set the offset and length
- updateValidationMessages(messages, document, reporter);
- }
- }
- }
-
-
- finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- }
- }
-
- /**
- * iterates through the messages and calculates a "better" offset and
- * length
- *
- * @param messages -
- * a List of IMessages
- * @param document -
- * the document
- * @param reporter -
- * the reporter the messages are to be added to
- */
- protected void updateValidationMessages(List messages, IDOMDocument document, IReporter reporter) {
- for (int i = 0; i < messages.size(); i++) {
- IMessage message = (IMessage) messages.get(i);
- try {
- if (message.getAttribute(COLUMN_NUMBER_ATTRIBUTE) != null) {
- int column = ((Integer) message.getAttribute(COLUMN_NUMBER_ATTRIBUTE)).intValue();
- if (message.getAttribute(AnnotationMsg.PROBMLEM_ID) != null && reporter instanceof IncrementalReporter){
- Integer problemId = (Integer)message.getAttribute(AnnotationMsg.PROBMLEM_ID);
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(problemId.intValue());
- message.setOffset(column);
- Integer length = (Integer) message.getAttribute(AnnotationMsg.LENGTH);
- message.setLength( length.intValue());
- Object attrValue = message.getAttribute(AnnotationMsg.ATTRVALUETEXT);
- if (attrValue != null)
- processor.setAdditionalFixInfo(attrValue);
- else{
- Object attrValueNo = message.getAttribute(AnnotationMsg.ATTRVALUENO);
- if (attrValueNo != null){
- int len = ((Integer)attrValueNo).intValue();
- Object[] objArray = new Object[len];
- for ( int j=0; j<len; j++){
- objArray[j] = message.getAttribute(AnnotationMsg.ATTRNO + j);
- }
- processor.setAdditionalFixInfo(objArray);
- }
-
- }
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- String selectionStrategy = (String) message.getAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE);
- String nameOrValue = (String) message.getAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE);
-
- // convert the line and Column numbers to an offset:
- int start = document.getStructuredDocument().getLineOffset(message.getLineNumber() - 1) + column - 1;
- int[] result = computeStartAndEndLocation(start, selectionStrategy, getErrorSide(message), nameOrValue, document);
- if (result != null) {
- message.setOffset(result[0]);
- message.setLength(result[1] - result[0]);
-
- reporter.addMessage(this, message);
- }
- }
- }
-
- }
- catch (BadLocationException e) { // this exception should not
- // occur - it is thrown if
- // trying to convert an
- // invalid line number to and
- // offset
- }
-
- }
- }
-
- /**
- * @param delta
- * the IFileDelta containing the file name to get
- * @return the IFile
- */
- public IFile getFile(String delta) {
- IPath path = new Path(delta);
- if (path.segmentCount() > 1) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file != null && file.exists())
- return file;
- }
- return null;
- }
-
- /**
- *
- * @param file
- * the file to get the model for
- * @return the file's XMLModel or null
- */
- protected IDOMModel getModelForResource(IFile file) {
- IStructuredModel model = null;
- IModelManager manager = StructuredModelManager.getModelManager();
-
- try {
- model = manager.getModelForRead(file);
- // TODO.. HTML validator tries again to get a model a 2nd way
- }
- catch (Exception e) {
- Logger.log(Logger.ERROR_DEBUG, file.getFullPath().toString(), e);
- }
-
- if (model instanceof IDOMModel)
- return (IDOMModel) model;
- if (model != null)
- model.releaseFromRead();
- return null;
- }
-
- /**
- * @deprecated use computeStartEndLocation(int startOffset, String
- * errorMessage, String selectionStrategy, boolean leftError,
- * String nameOrValue, IDOMDocument document) {
- *
- */
- protected int[] computeStartEndLocation(int startOffset, String errorMessage, String selectionStrategy, String nameOrValue, IDOMDocument document) {
- return computeStartAndEndLocation(startOffset, selectionStrategy, ERROR_SIDE_RIGHT, nameOrValue, document);
- }
-
- /**
- * Calculates the "better" offsets.
- *
- * @param startOffset -
- * the offset given by Xerces
- * @param errorMessage -
- * the Xerces error Message
- * @param selectionStrategy -
- * the selectionStrategy
- * @param document -
- * the document
- * @return int[] - position 0 has the start offset of the squiggle range,
- * position 1 has the endOffset
- */
- /*
- * The way the offsets is calculated is: - find the indexed region
- * (element) closest to the given offset - if we are between two elements,
- * choosing left or right element will depend on parameter 'errorSide' -
- * based on the selectionStrategy choose the underlining strategy (eg
- * START_TAG means underline the start tag of that element) - use
- * information from nameOrValue and the DOM to get better offsets
- *
- */
- protected int[] computeStartAndEndLocation(int startOffset, String selectionStrategy, String errorSide, String nameOrValue, IDOMDocument document) {
- try {
- int startEndPositions[] = new int[2];
-
- IndexedRegion region = document.getModel().getIndexedRegion(startOffset);
- IndexedRegion prevRegion = document.getModel().getIndexedRegion(startOffset - 1);
-
- if (prevRegion != region) {
- // if between two regions we use the 'errorSide' to understand
- // which
- // element is applicable. if we know the error has been
- // reported to the
- // right of the tag, then we can assume we need to step back
- // to the previous
- // region to land at the 'correct location. Otherwise assume
- // we're
- // exactly where we need to be.
- if (ERROR_SIDE_LEFT.equals(errorSide)) {
- region = prevRegion;
- }
- }
-
- // initialize start and end positions to be the start positions
- // this means if the
- // special case is not taken care of below the start and end
- // offset are set to be
- // the start of the region where the error was
- if (region != null) {
- startEndPositions[0] = region.getStartOffset();
- startEndPositions[1] = startEndPositions[0];
- }
- else { // this will message will not get added to the IReporter
- // since the length is 0
- startEndPositions[0] = 0;
- startEndPositions[1] = 0;
- }
- if (region instanceof Node) {
- Node node = (Node) region;
-
- if (START_TAG.equals(selectionStrategy)) {// then we want to
- // underline the opening tag
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- startEndPositions[0] = element.getStartOffset() + 1;
- startEndPositions[1] = startEndPositions[0] + element.getTagName().length();
- }
- }
- else if (END_TAG.equals(selectionStrategy)) {// then we want to
- // underline the end tag
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- startEndPositions[0] = element.getEndStartOffset();
- startEndPositions[1] = element.getEndOffset();
- }
- }
- else if (ATTRIBUTE_NAME.equals(selectionStrategy)) { // in
- // underline the attribute's name
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- IDOMNode attributeNode = (IDOMNode) (element.getAttributeNode(nameOrValue));
- if (attributeNode != null) {
- startEndPositions[0] = attributeNode.getStartOffset();
- startEndPositions[1] = attributeNode.getStartOffset() + nameOrValue.length();
- }
- }
- }
- else if (ATTRIBUTE_VALUE.equals(selectionStrategy)) {
- // underline the attribute's value
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- IDOMAttr attributeNode = (IDOMAttr) (element.getAttributeNode(nameOrValue));
- if (attributeNode != null) {
- startEndPositions[0] = attributeNode.getValueRegionStartOffset();
- String valueRegionText = attributeNode.getValueRegionText();
- int valueRegionLength = valueRegionText == null ? 0 : valueRegionText.length();
- startEndPositions[1] = startEndPositions[0] + valueRegionLength;
- }
- }
- }
- else if (ALL_ATTRIBUTES.equals(selectionStrategy)) {
- // underline all attributes
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- NamedNodeMap attributes = element.getAttributes();
- if (attributes != null) {
- IDOMNode first = (IDOMNode) attributes.item(0);
- IDOMNode last = (IDOMNode) attributes.item(attributes.getLength() - 1);
- if ((first != null) && (last != null)) {
- startEndPositions[0] = first.getStartOffset();
- startEndPositions[1] = last.getEndOffset();
- }
- }
- }
- }
- else if (TEXT.equals(selectionStrategy)) {
- // underline the text between the tags
- if (node.getNodeType() == Node.TEXT_NODE) {
- IDOMText textNode = (IDOMText) node;
- int start = textNode.getStartOffset();
- String value = textNode.getNodeValue();
- int index = 0;
- char curChar = value.charAt(index);
- // here we are finding start offset by skipping over
- // whitespace:
- while ((curChar == '\n') || (curChar == '\t') || (curChar == '\r') || (curChar == ' ')) {
- curChar = value.charAt(index);
- index++;
- }
- if (index > 0) {
- index--;
-
- }
- start = start + index;
- startEndPositions[0] = start;
- startEndPositions[1] = start + value.trim().length();
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- Node child = element.getFirstChild();
- if (child instanceof IDOMNode) {
- IDOMNode xmlChild = ((IDOMNode) child);
- startEndPositions[0] = xmlChild.getStartOffset();
- startEndPositions[1] = xmlChild.getEndOffset();
- }
- }
- }
- else if (FIRST_NON_WHITESPACE_TEXT.equals(selectionStrategy)) {
- // search through all child nodes and return range of
- // first non-whitespace
- // text node
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- NodeList nodes = node.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node currentNode = nodes.item(i);
- if (currentNode.getNodeType() == Node.TEXT_NODE) {
- // TODO (Trung) I don't think we should call
- // getNodeValue(), trim(), length()
- // repeatedly.
- // This is inefficient, to improve use local
- // variables to store values.
- IDOMText textNode = (IDOMText) currentNode;
- if (textNode.getNodeValue().trim().length() > 0) {
- String value = textNode.getNodeValue();
- int index = 0;
- int start = textNode.getStartOffset();
- char curChar = value.charAt(index);
- // here we are finding start offset by
- // skipping over whitespace:
- while ((curChar == '\n') || (curChar == '\t') || (curChar == '\r') || (curChar == ' ')) {
- curChar = value.charAt(index);
- index++;
- }
- if (index > 0) {
- index--;
-
- }
- start = start + index;
- startEndPositions[0] = start;
- startEndPositions[1] = start + value.trim().length();
- break;
- }
- }
-
- }
- }
- }
-
- else if (TEXT_ENTITY_REFERENCE.equals(selectionStrategy)) {
- if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- startEndPositions[0] = region.getStartOffset();
- startEndPositions[1] = region.getEndOffset();
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE) {
- /*
- * In this case the undeclared entity might be in one
- * of the attribute values. Search through the
- * attributes to find the range of the undeclared
- * entity.
- */
- String entity = "&" + nameOrValue + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- NamedNodeMap attributes = node.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- IDOMAttr attr = (IDOMAttr) attributes.item(i);
- String nodeValue = attr.getNodeValue();
- int index = nodeValue.indexOf(entity);
- if (index != -1) {
- startEndPositions[0] = attr.getValueRegionStartOffset() + index + 1;
- startEndPositions[1] = startEndPositions[0] + entity.length();
- }
- }
- }
-
- }
- else if (VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE.equals(selectionStrategy)) {
- // TODO (Trung) do we really need this strategy ?
- // If we know the name of the name of the attribute, we
- // can retrieve its value.
- // Hence, we can incoperate this strategy with
- // ATTRIBUTE_VALUE ?
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // here we will search through all attributes for the
- // one with the
- // with the value we want:
- // TODO (Trung) I see a potential problem here.
- // What happens when there is another attribute having
- // the same value
- // with this attribute's buggy value ?
- // Need to solve when time permits.
- NamedNodeMap attributes = node.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- IDOMAttr attr = (IDOMAttr) attributes.item(i);
- String nodeValue = attr.getNodeValue().trim();
- if (nodeValue.equals(nameOrValue)) {
- startEndPositions[0] = attr.getValueRegionStartOffset() + 1;
- startEndPositions[1] = startEndPositions[0] + nodeValue.length();
- break;
- }
- }
- }
- }
- else if (ATTRIBUTE_NAME_LAST.equals(selectionStrategy)) {
- // underline the last attribute's name
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap attributeMap = node.getAttributes();
- final int length = attributeMap.getLength();
- Node tempNode = null;
- Node attrNode = null;
- for (int i = 0; i < length; i++) {
- tempNode = attributeMap.item(i);
- if (tempNode != null && tempNode.getNodeName().equals(nameOrValue)) {
- attrNode = tempNode;
- }
- }
- IDOMNode attributeNode = (IDOMNode) (attrNode);
- if (attributeNode != null) {
- startEndPositions[0] = attributeNode.getStartOffset();
- startEndPositions[1] = attributeNode.getStartOffset() + nameOrValue.length();
- }
- }
- }
- }
- return startEndPositions;
- }
- // catch (Exception e) { // e.printStackTrace();
- // }
- finally {
- }
- // return null;
- }
-
- /**
- * Returns true if delegate validator is enabled based on Validation
- * preferences
- *
- * @param file
- * @return false if delegate validator is not enabled based on Validatoin
- * preferences, true otherwise
- */
- protected boolean isDelegateValidatorEnabled(IFile file) {
- return true;
- }
-
- protected String getErrorSide(IMessage message) {
- // note that if the ERROR_SIDE is unspecified we return the default
- // value ERROR_SIDE_LEFT
- Object value = message.getAttribute(ERROR_SIDE);
- return ERROR_SIDE_RIGHT.equals(value) ? ERROR_SIDE_RIGHT : ERROR_SIDE_LEFT;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
deleted file mode 100644
index 79e03345b0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/**
- * This performs as you type validation for XML files
- */
-public class DelegatingSourceValidatorForXML extends DelegatingSourceValidator
-{
- private final static String Id = "org.eclipse.wst.xml.core.xml"; //$NON-NLS-1$
-
- private Validator _validator;
-
- public DelegatingSourceValidatorForXML()
- {
- }
-
- private Validator getValidator()
- {
- if (_validator == null)
- _validator = ValidationFramework.getDefault().getValidator(Id);
- return _validator;
- }
-
- protected IValidator getDelegateValidator()
- {
- Validator v = getValidator();
- if (v == null)
- return null;
- return v.asIValidator();
- }
-
- protected boolean isDelegateValidatorEnabled(IFile file)
- {
- Validator v = getValidator();
- if (v == null)
- return false;
- if (!file.isSynchronized(IResource.DEPTH_ZERO))
- return false;
- if (!v.shouldValidate(file, false, false))
- return false;
- return v.isBuildValidation() || v.isManualValidation();
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java
deleted file mode 100644
index c5bb29949b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.xml.ui.internal.validation;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.correction.RemoveUnknownElementQuickFixProposal;
-import org.eclipse.wst.xml.ui.internal.correction.RenameInFileQuickAssistProposal;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-/**
- * Quick assist processor for problems found by the markup validator
- */
-class MarkupQuickAssistProcessor implements IQuickAssistProcessor {
- private int fProblemId;
- private Object fAdditionalFixInfo = null;
-
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- return false;
- }
-
- public boolean canFix(Annotation annotation) {
- boolean result = false;
-
- switch (fProblemId) {
- case ProblemIDsXML.EmptyTag :
- case ProblemIDsXML.MissingEndTag :
- case ProblemIDsXML.AttrsInEndTag :
- case ProblemIDsXML.MissingAttrValue :
- case ProblemIDsXML.NoAttrValue :
- case ProblemIDsXML.SpacesBeforeTagName :
- case ProblemIDsXML.SpacesBeforePI :
- case ProblemIDsXML.NamespaceInPI :
- case ProblemIDsXML.UnknownElement :
- case ProblemIDsXML.UnknownAttr :
- case ProblemIDsXML.InvalidAttrValue :
- case ProblemIDsXML.MissingRequiredAttr :
- case ProblemIDsXML.AttrValueNotQuoted :
- case ProblemIDsXML.MissingClosingBracket :
- result = true;
- }
-
- return result;
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
- ArrayList proposals = new ArrayList();
-
- switch (fProblemId) {
- case ProblemIDsXML.EmptyTag :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_0, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingEndTag :
- String tagName = (String) ((Object[]) fAdditionalFixInfo)[0];
- String tagClose = (String) ((Object[]) fAdditionalFixInfo)[1];
- int tagCloseOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[2]).intValue();
- int startTagEndOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[3]).intValue();
- int firstChildStartOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[4]).intValue();
- int endOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[5]).intValue();
- proposals.add(new CompletionProposal(tagClose, tagCloseOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_1, null, "")); //$NON-NLS-1$
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), startTagEndOffset - invocationContext.getOffset(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_2, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- proposals.add(new CompletionProposal("</" + tagName + ">", firstChildStartOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_3, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("</" + tagName + ">", endOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_4, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case ProblemIDsXML.AttrsInEndTag :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_5, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingAttrValue :
- String defaultAttrValue = (String) ((Object[]) fAdditionalFixInfo)[0];
- int insertOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[1]).intValue();
- proposals.add(new CompletionProposal("\"" + defaultAttrValue + "\"", invocationContext.getOffset() + invocationContext.getLength() + insertOffset, 0, defaultAttrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.NoAttrValue :
- defaultAttrValue = (String) fAdditionalFixInfo;
- proposals.add(new CompletionProposal("=\"" + defaultAttrValue + "\"", invocationContext.getOffset() + invocationContext.getLength(), 0, defaultAttrValue.length() + 3, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.SpacesBeforeTagName :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_8, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.SpacesBeforePI :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_9, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.NamespaceInPI :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_10, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.UnknownElement :
- proposals.add(new RemoveUnknownElementQuickFixProposal(fAdditionalFixInfo, getImage(), XMLUIMessages.QuickFixProcessorXML_11));
- proposals.add(new RenameInFileQuickAssistProposal());
- break;
- case ProblemIDsXML.UnknownAttr :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- proposals.add(new RenameInFileQuickAssistProposal());
- break;
- case ProblemIDsXML.InvalidAttrValue :
- proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_12, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ProblemIDsXML.MissingRequiredAttr :
- String requiredAttr = (String) ((Object[]) fAdditionalFixInfo)[0];
- insertOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[1]).intValue();
- proposals.add(new CompletionProposal(requiredAttr, invocationContext.getOffset() + insertOffset, 0, requiredAttr.length(), getImage(), XMLUIMessages.QuickFixProcessorXML_13, null, "")); //$NON-NLS-1$
- break;
- case ProblemIDsXML.AttrValueNotQuoted :
- String attrValue = (String) fAdditionalFixInfo;
- proposals.add(new CompletionProposal("\"" + attrValue + "\"", invocationContext.getOffset(), invocationContext.getLength(), attrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_14, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case ProblemIDsXML.MissingClosingBracket :
- proposals.add(new CompletionProposal(">", invocationContext.getOffset() + invocationContext.getLength(), 0, 1, getImage(), XMLUIMessages.QuickFixProcessorXML_15, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- private Image getImage() {
- return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CORRECTION_CHANGE);
- }
-
- public void setProblemId(int problemId) {
- fProblemId = problemId;
- }
-
- public void setAdditionalFixInfo(Object fixInfo) {
- fAdditionalFixInfo = fixInfo;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
deleted file mode 100644
index d228699587..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
+++ /dev/null
@@ -1,1042 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.osgi.util.NLS;
-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.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.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.AnnotationInfo;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.IncrementalReporter;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-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.validation.ProblemIDsXML;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-/**
- * Basic XML syntax checking step.
- * @deprecated No longer used as the source validator for XML documents. Instead {@link DelegatingSourceValidatorForXML}
- * is the source validator, and the markup validation is done as a step in {@link XMLValidator} by {@link org.eclipse.wst.xml.core.internal.validation.MarkupValidator}.
- *
- * @see org.eclipse.wst.xml.core.internal.validation.MarkupValidator
- * @see DelegatingSourceValidatorForXML
- * @see XMLValidator
- */
-public class MarkupValidator extends AbstractValidator implements IValidator, ISourceValidator {
- private String DQUOTE = "\""; //$NON-NLS-1$
- private String SQUOTE = "'"; //$NON-NLS-1$
- private final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
-
- private IDocument fDocument;
-
- private IContentType fRootContentType = null;
-
- private int SEVERITY_ATTRIBUTE_HAS_NO_VALUE = IMessage.HIGH_SEVERITY;
- private int SEVERITY_END_TAG_WITH_ATTRIBUTES = IMessage.HIGH_SEVERITY;
- private int SEVERITY_INVALID_WHITESPACE_BEFORE_TAGNAME = IMessage.HIGH_SEVERITY;
- private int SEVERITY_MISSING_CLOSING_BRACKET = IMessage.HIGH_SEVERITY;
- private int SEVERITY_MISSING_CLOSING_QUOTE = IMessage.HIGH_SEVERITY;
- private int SEVERITY_MISSING_END_TAG = IMessage.HIGH_SEVERITY;
- private int SEVERITY_MISSING_START_TAG = IMessage.HIGH_SEVERITY;
- private int SEVERITY_MISSING_QUOTES = IMessage.HIGH_SEVERITY;
- private int SEVERITY_NAMESPACE_IN_PI_TARGET = IMessage.HIGH_SEVERITY;
- private int SEVERITY_TAG_NAME_MISSING = IMessage.HIGH_SEVERITY;
- private int SEVERITY_WHITESPACE_AT_START = IMessage.HIGH_SEVERITY;
-
- private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter, int messageSeverity) {
-
- if (sdRegion.isDeleted()) {
- return;
- }
-
- int lineNo = getLineNumber(start);
- LocalizedMessage message = new LocalizedMessage(messageSeverity, messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
-
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(problemId);
- processor.setAdditionalFixInfo(attributeValueText);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
-
- private void checkAttributesInEndTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- ITextRegionList textRegions = structuredDocumentRegion.getRegions();
- int errorCount = 0;
- int start = structuredDocumentRegion.getEndOffset();
- int end = structuredDocumentRegion.getEndOffset();
- for (int i = 0; (i < textRegions.size()) && (errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
- ITextRegion textRegion = textRegions.get(i);
- if ((textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
- if (start > structuredDocumentRegion.getStartOffset(textRegion)) {
- start = structuredDocumentRegion.getStartOffset(textRegion);
- }
- end = structuredDocumentRegion.getEndOffset(textRegion);
- errorCount++;
- }
- }
- // create one error for all attributes in the end tag
- if (errorCount > 0) {
- // Position p = new Position(start, end - start);
- String messageText = XMLUIMessages.End_tag_has_attributes;
- LocalizedMessage message = new LocalizedMessage(SEVERITY_END_TAG_WITH_ATTRIBUTES, messageText);
- message.setOffset(start);
- message.setLength(end - start);
- message.setLineNo(getLineNumber(start));
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.AttrsInEndTag);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
-
-
- private void checkClosingBracket(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- boolean closed = false;
- for (int i = 0; (i < regions.size()) && !structuredDocumentRegion.isDeleted(); i++) {
- r = regions.get(i);
- if ((r.getType() == DOMRegionContext.XML_TAG_CLOSE) || (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
- closed = true;
- }
- }
- if (!closed) {
-
- String messageText = XMLUIMessages.ReconcileStepForMarkup_6;
-
- int start = structuredDocumentRegion.getStartOffset();
- int length = structuredDocumentRegion.getText().trim().length();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_MISSING_CLOSING_BRACKET , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.MissingClosingBracket);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
-
- private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // navigate to name
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- if (regions.size() == 2) {
- // missing name region
- if ((regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) && (regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE)) {
- String messageText = XMLUIMessages.ReconcileStepForMarkup_3;
- int start = structuredDocumentRegion.getStartOffset();
- int length = structuredDocumentRegion.getLength();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_TAG_NAME_MISSING , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNo);
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.EmptyTag);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
- }
-
- private int getLineNumber(int start) {
- int lineNo = -1;
- try {
- lineNo = getDocument().getLineOfOffset(start) + 1;
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- return lineNo;
- }
-
- private void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // 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();
- // ReconcileAnnotationKey key = createKey(structuredDocumentRegion,
- // getScope());
-
- 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 lineNo = getLineNumber(start);
- int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_ATTRIBUTE_HAS_NO_VALUE , messageText);
- message.setOffset(start);
- message.setLength(textLength);
- message.setLineNo(lineNo);
-
- // quick fix info
- ITextRegion equalsRegion = textRegions.get(i - 2 + 1);
- int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
- Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.MissingAttrValue);
- processor.setAdditionalFixInfo(additionalFixInfo);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- errorCount++;
- }
- }
- // name but no '=' (XML only)
- else if ((attrState == 1) && (i >= 1)) {
- // create annotation
- ITextRegion previousRegion = textRegions.get(i - 1);
- if (!(previousRegion instanceof ITextRegionContainer)) {
- Object[] args = {structuredDocumentRegion.getText(previousRegion)};
- String messageText = NLS.bind(XMLUIMessages.Attribute__has_no_value, args);
- int start = structuredDocumentRegion.getStartOffset(previousRegion);
- int textLength = structuredDocumentRegion.getText(previousRegion).trim().length();
- int lineNo = getLineNumber(start);
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_ATTRIBUTE_HAS_NO_VALUE, messageText);
- message.setOffset(start);
- message.setLength(textLength);
- message.setLineNo(lineNo);
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.NoAttrValue);
- processor.setAdditionalFixInfo(structuredDocumentRegion.getText(previousRegion));
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
-
- 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;
- }
- }
-
- }
-
- private void checkForSpaceBeforeName(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- String sdRegionText = structuredDocumentRegion.getFullText();
- if (sdRegionText.startsWith(" ")) { //$NON-NLS-1$
- IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
- if (prev != null) {
- // this is possibly the case of "< tag"
- if ((prev.getRegions().size() == 1) && isStartTag(prev)) {
- // add the error for preceding space in tag name
- String messageText = XMLUIMessages.ReconcileStepForMarkup_2;
- int start = structuredDocumentRegion.getStartOffset();
- // find length of whitespace
- int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_INVALID_WHITESPACE_BEFORE_TAGNAME , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.SpacesBeforeTagName);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
- }
- }
-
- private void checkNoNamespaceInPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- // navigate to name
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- int errorCount = 0;
- for (int i = 0; (i < regions.size()) && (errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- String piText = structuredDocumentRegion.getText(r);
- int index = piText.indexOf(":"); //$NON-NLS-1$
- if (index != -1) {
- String messageText = XMLUIMessages.ReconcileStepForMarkup_4;
- int start = structuredDocumentRegion.getStartOffset(r) + index;
- int length = piText.trim().length() - index;
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_NAMESPACE_IN_PI_TARGET , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.NamespaceInPI);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
-
- errorCount++;
- }
- }
- }
- }
-
- private void checkQuotesForAttributeValues(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- String attrValueText = ""; //$NON-NLS-1$
- int errorCount = 0;
- 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, SEVERITY_MISSING_CLOSING_QUOTE);
- errorCount++;
- }
- else {
- // missing both
- String message = XMLUIMessages.ReconcileStepForMarkup_1;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter, SEVERITY_MISSING_QUOTES);
- 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, SEVERITY_MISSING_CLOSING_QUOTE);
- errorCount++;
- }
- }
- }
- // end of region for loop
- }
-
- private void checkStartEndTagPairs(IStructuredDocumentRegion sdRegion, IReporter reporter) {
-
- if (sdRegion.isDeleted()) {
- return;
- }
-
- // check start/end tag pairs
- IDOMNode xmlNode = getXMLNode(sdRegion);
-
- if (xmlNode == null) {
- return;
- }
-
- boolean selfClosed = false;
- String tagName = null;
-
- /**
- * For tags that aren't meant to be EMPTY, make sure it's empty or has an end tag
- */
- if (xmlNode.isContainer()) {
- IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
- if (endRegion == null) {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion != null && !startRegion.isDeleted() && DOMRegionContext.XML_TAG_OPEN.equals(startRegion.getFirstRegion().getType())) {
- // analyze the tag (check self closing)
- ITextRegionList regions = startRegion.getRegions();
- ITextRegion r = null;
- int start = sdRegion.getStart();
- int length = sdRegion.getTextLength();
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- start = sdRegion.getStartOffset(r);
- length = r.getTextLength();
- }
- else if (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- selfClosed = true;
- }
- }
-
-
- if (!selfClosed && (tagName != null)) {
- Object[] args = {tagName};
- String messageText = NLS.bind(XMLUIMessages.Missing_end_tag_, args);
-
- int lineNumber = getLineNumber(start);
-
- IMessage message = new LocalizedMessage(SEVERITY_MISSING_END_TAG , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNumber);
-
- if (reporter instanceof IncrementalReporter) {
- Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
-
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.MissingEndTag);
- processor.setAdditionalFixInfo(additionalFixInfo);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
-
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
- }
- else {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion == null || startRegion.isDeleted()) {
- // analyze the tag (check self closing)
- ITextRegionList regions = endRegion.getRegions();
- ITextRegion r = null;
- int start = sdRegion.getStart();
- int length = sdRegion.getTextLength();
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- start = sdRegion.getStartOffset(r);
- length = r.getTextLength();
- }
- }
-
- if (tagName != null) {
- Object[] args = {tagName};
- String messageText = NLS.bind(XMLUIMessages.Missing_start_tag_, args);
-
- int lineNumber = getLineNumber(start);
-
- IMessage message = new LocalizedMessage(SEVERITY_MISSING_START_TAG, messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(lineNumber);
-
- if (reporter instanceof IncrementalReporter) {
- Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
-
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.MissingStartTag);
- processor.setAdditionalFixInfo(additionalFixInfo);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
-
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- }
- }
- }
-
- }
- /*
- * Check for an end tag that has no start tag
- */
- else {
- IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
- if (startRegion == null) {
- IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
- if (!endRegion.isDeleted()) {
- // get name
- ITextRegionList regions = endRegion.getRegions();
- ITextRegion r = null;
- for (int i = 0; i < regions.size(); i++) {
- r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- tagName = sdRegion.getText(r);
- }
- }
-
- if (!selfClosed && (tagName != null)) {
- String messageText = XMLUIMessages.Indicate_no_grammar_specified_severities_error;
-
- int start = sdRegion.getStart();
- int lineNumber = getLineNumber(start);
-
- // SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
- IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
- message.setOffset(start);
- message.setLength(sdRegion.getTextLength());
- message.setLineNo(lineNumber);
-
- reporter.addMessage(this, message);
- }
- }
- }
- }
- }
-
- private Object[] getStartEndFixInfo(IDOMNode xmlNode, String tagName, ITextRegion r) {
- // quick fix info
- String tagClose = "/>"; //$NON-NLS-1$
- int tagCloseOffset = xmlNode.getFirstStructuredDocumentRegion().getEndOffset();
- if ((r != null) && (r.getType() == DOMRegionContext.XML_TAG_CLOSE)) {
- tagClose = "/"; //$NON-NLS-1$
- tagCloseOffset--;
- }
- IDOMNode firstChild = (IDOMNode) xmlNode.getFirstChild();
- while ((firstChild != null) && (firstChild.getNodeType() == Node.TEXT_NODE)) {
- firstChild = (IDOMNode) firstChild.getNextSibling();
- }
- int endOffset = xmlNode.getEndOffset();
- int firstChildStartOffset = firstChild == null ? endOffset : firstChild.getStartOffset();
- Object[] additionalFixInfo = {tagName, tagClose, new Integer(tagCloseOffset), new Integer(xmlNode.getFirstStructuredDocumentRegion().getEndOffset()), // startTagEndOffset
- new Integer(firstChildStartOffset), // firstChildStartOffset
- new Integer(endOffset)}; // endOffset
- return additionalFixInfo;
- }
-
- private void checkStartingSpaceForPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
- if ((prev != null) && prev.getStartOffset() == 0) {
- if (prev.getType() == DOMRegionContext.XML_CONTENT) {
- String messageText = XMLUIMessages.ReconcileStepForMarkup_5;
- int start = prev.getStartOffset();
- int length = prev.getLength();
-
- LocalizedMessage message = new LocalizedMessage(SEVERITY_WHITESPACE_AT_START , messageText);
- message.setOffset(start);
- message.setLength(length);
- message.setLineNo(getLineNumber(start));
-
- if (reporter instanceof IncrementalReporter) {
- MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
- processor.setProblemId(ProblemIDsXML.SpacesBeforePI);
- message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
- AnnotationInfo info = new AnnotationInfo(message);
- ((IncrementalReporter) reporter).addAnnotationInfo(this, info);
- }
- else {
- reporter.addMessage(this, message);
- }
- // Position p = new Position(start, length);
- //
- // ReconcileAnnotationKey key =
- // createKey(structuredDocumentRegion, getScope());
- // TemporaryAnnotation annotation = new TemporaryAnnotation(p,
- // SEVERITY_SYNTAX_ERROR, message, key,
- // ProblemIDsXML.SpacesBeforePI);
- // results.add(annotation);
- }
- }
- }
-
- public int getScope() {
- return ReconcileAnnotationKey.PARTIAL;
- }
-
- private IDOMNode getXMLNode(IStructuredDocumentRegion sdRegion) {
-
- if (sdRegion == null) {
- return null;
- }
-
- IStructuredModel xModel = null;
- IDOMNode xmlNode = null;
- // get/release models should always be in a try/finally block
- try {
- xModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- // xModel is sometime null, when closing editor, for example
- if (xModel != null) {
- xmlNode = (IDOMNode) xModel.getIndexedRegion(sdRegion.getStart());
- }
- }
- finally {
- if (xModel != null) {
- xModel.releaseFromRead();
- }
- }
- return xmlNode;
- }
-
- /**
- * Determines whether the IStructuredDocumentRegion is a XML "end tag"
- * since they're not allowed to have attribute ITextRegions
- *
- * @param structuredDocumentRegion
- */
- private boolean isEndTag(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN;
- }
-
- /**
- * Determines if the IStructuredDocumentRegion is an XML Processing
- * Instruction
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isPI(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_PI_OPEN;
- }
-
- /**
- * Determines whether the IStructuredDocumentRegion is a XML "start tag"
- * since they need to be checked for proper XML attribute region sequences
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isStartTag(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN;
- }
-
- // Because we check the "proper" closing separately from attribute
- // sequencing, we need to know what's
- // an appropriate close.
- private boolean isTagCloseTextRegion(ITextRegion textRegion) {
- return (textRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) || (textRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE);
- }
-
- /**
- * Determines if the IStructuredDocumentRegion is XML Content
- *
- * @param structuredDocumentRegion
- *
- */
- private boolean isXMLContent(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT;
- }
-
- private void setDocument(IDocument doc) {
- fDocument = doc;
- }
-
- private IDocument getDocument() {
- return fDocument;
- }
-
- public void connect(IDocument document) {
- setDocument(document);
- }
-
- public void disconnect(IDocument document) {
- setDocument(null);
- }
-
- public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
- if (getDocument() == null) {
- return;
- }
- if (!(reporter instanceof IncrementalReporter)) {
- return;
- }
- if (!(getDocument() instanceof IStructuredDocument)) {
- return;
- }
-
- // remove old messages
- reporter.removeAllMessages(this);
-
- IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
- for (int i = 0; i < regions.length; i++) {
- validate(regions[i], reporter);
- }
- }
-
- public void validate(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion == null) {
- return;
- }
-
- if (isStartTag(structuredDocumentRegion)) {
- // check for attributes without a value
- checkForAttributeValue(structuredDocumentRegion, reporter);
- // check if started tag is ended
- checkStartEndTagPairs(structuredDocumentRegion, reporter);
- // check empty tag <>
- checkEmptyTag(structuredDocumentRegion, reporter);
- // check that each attribute has quotes
- checkQuotesForAttributeValues(structuredDocumentRegion, reporter);
- // check that the closing '>' is there
- checkClosingBracket(structuredDocumentRegion, reporter);
- }
- else if (isEndTag(structuredDocumentRegion)) {
- // check if ending tag was started
- checkStartEndTagPairs(structuredDocumentRegion, reporter);
- // check for attributes in an end tag
- checkAttributesInEndTag(structuredDocumentRegion, reporter);
- // check that the closing '>' is there
- checkClosingBracket(structuredDocumentRegion, reporter);
- }
- else if (isPI(structuredDocumentRegion)) {
- // check validity of processing instruction
- checkStartingSpaceForPI(structuredDocumentRegion, reporter);
- checkNoNamespaceInPI(structuredDocumentRegion, reporter);
- }
- else if (isXMLContent(structuredDocumentRegion)) {
- checkForSpaceBeforeName(structuredDocumentRegion, reporter);
- }
- else if (isXMLDoctypeDeclaration(structuredDocumentRegion)) {
- checkDocumentTypeReferences(structuredDocumentRegion, reporter);
- }
- }
-
- /**
- * @param structuredDocumentRegion
- * @param reporter
- */
- private void checkDocumentTypeReferences(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- }
-
- /**
- * @param structuredDocumentRegion
- * @return
- */
- private boolean isXMLDoctypeDeclaration(IStructuredDocumentRegion structuredDocumentRegion) {
- if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
- return false;
- }
- return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_DECLARATION_OPEN && structuredDocumentRegion.getType().equals(DOMRegionContext.XML_DOCTYPE_DECLARATION);
- }
-
- public void cleanup(IReporter reporter) {
- fDocument = null;
- }
-
- public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
- String[] uris = helper.getURIs();
- IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- if (uris.length > 0) {
- IFile currentFile = null;
-
- for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
- // might be called with just project path?
- IPath path = new Path(uris[i]);
- if (path.segmentCount() > 1) {
- currentFile = wsRoot.getFile(path);
- if (shouldValidate(currentFile, true)) {
- validateV1File(currentFile, reporter);
- }
- }
- else if (uris.length == 1) {
- validateV1Project(helper, reporter);
- }
- }
- }
- else
- validateV1Project(helper, reporter);
- }
-
- private boolean shouldValidate(IResourceProxy proxy) {
- if(proxy.getType() == IResource.FILE) {
- String name = proxy.getName();
- if(name.toLowerCase(Locale.US).endsWith(".xml")) {
- return true;
- }
- }
- return shouldValidate(proxy.requestResource(), false);
- }
-
- private boolean shouldValidate(IResource file, boolean checkExtension) {
- if (file == null || !file.exists() || file.getType() != IResource.FILE)
- return false;
- if (checkExtension) {
- String extension = file.getFileExtension();
- if (extension != null && "xml".endsWith(extension.toLowerCase(Locale.US)))
- return true;
- }
-
- IContentDescription contentDescription = null;
- try {
- contentDescription = ((IFile) file).getContentDescription();
- if (contentDescription != null) {
- IContentType contentType = contentDescription.getContentType();
- return contentDescription != null && contentType.isKindOf(getXMLContentType());
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- return false;
- }
-
- /**
- * @param helper
- * @param reporter
- */
- private void validateV1Project(IValidationContext helper, final IReporter reporter) {
- // if uris[] length 0 -> validate() gets called for each project
- if (helper instanceof IWorkbenchContext) {
- IProject project = ((IWorkbenchContext) helper).getProject();
- IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
- public boolean visit(IResourceProxy proxy) throws CoreException {
- if (shouldValidate(proxy)) {
- validateV1File((IFile) proxy.requestResource(), reporter);
- }
- return true;
- }
- };
- try {
- // collect all jsp files for the project
- project.accept(visitor, IResource.DEPTH_INFINITE);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
-
-
- /**
- * @param currentFile
- * @param reporter
- */
- private void validateV1File(IFile currentFile, IReporter reporter) {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, currentFile.getFullPath().toString().substring(1));
- reporter.displaySubtask(MarkupValidator.this, message);
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead(currentFile);
- IStructuredDocument document = null;
- if (model != null) {
- document = model.getStructuredDocument();
- connect(document);
- IStructuredDocumentRegion validationRegion = document.getFirstStructuredDocumentRegion();
- while (validationRegion != null) {
- validate(validationRegion, reporter);
- validationRegion = validationRegion.getNext();
- }
- disconnect(document);
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
-
- /**
- * @return
- */
- private IContentType getXMLContentType() {
- if (fRootContentType == null) {
- fRootContentType = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.xml");
- }
- return fRootContentType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.validation.AbstractValidator#validate(org.eclipse.core.resources.IResource, int, org.eclipse.wst.validation.ValidationState, org.eclipse.core.runtime.IProgressMonitor)
- */
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE)
- return null;
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- validateV1File((IFile) resource, reporter);
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/annotations/XMLAnnotationsView.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/annotations/XMLAnnotationsView.java
deleted file mode 100644
index c29b473e1f..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/annotations/XMLAnnotationsView.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver (STAR) - initial API and implementation
- * David Carver (Intalio) - generalize the implementation for contribution to eclipse
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.views.annotations;
-
-import org.eclipse.jface.internal.text.html.HTMLTextPresenter;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-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.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.w3c.dom.Node;
-
-/**
- * Provides a view similar to the JavaDoc view that will display any documentation that resides in
- * the content model for an XML document.
- *
- * @author dcarver
- *
- */
-public class XMLAnnotationsView extends ViewPart implements ISelectionListener {
-
- public static final String ID = "org.eclipse.wst.xml.ui.view.annotations.XMLAnnotationsView"; //$NON-NLS-1$
-
- private StyledText styledtext;
-
- private String xmlDoc = XMLUIMessages.Documentation_view_default_msg;
-
- private HTMLTextPresenter presenter;
-
- private final TextPresentation presentation = new TextPresentation();
-
- private IStructuredSelection currentSelection;
- private CMNode cmNode;
-
- public XMLAnnotationsView() {
- }
-
- public void init(IViewSite site) throws PartInitException {
- super.init(site);
- getSite().getPage().addPostSelectionListener(this);
- }
-
- /**
- * Create contents of the view part.
- *
- * @param parent
- */
- public void createPartControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- container.setLayout(new FillLayout());
- presenter = new HTMLTextPresenter(false);
- createStyledTextWidget(container);
- doStyledTextInput();
- }
-
- private void createStyledTextWidget(Composite container) {
- styledtext = new StyledText(container, SWT.V_SCROLL | SWT.H_SCROLL);
- styledtext.setBackground(getColor(SWT.COLOR_INFO_BACKGROUND));
- styledtext.setEditable(false);
- styledtext.setBounds(container.getBounds());
- styledtext.addControlListener(new ControlAdapter() {
- /*
- * @see
- * org.eclipse.swt.events.ControlAdapter#controlResized(org.eclipse
- * .swt.events.ControlEvent)
- */
- public void controlResized(ControlEvent e) {
- doStyledTextInput();
- }
- });
- }
-
- private void doStyledTextInput() {
- presentation.clear();
- Rectangle size = styledtext.getClientArea();
- int width = size.width;
- int height = size.height;
- if (width == 0) {
- width = 200;
- }
-
- if (height == 0) {
- height = 400;
- }
-
- String msg = presenter.updatePresentation(styledtext, xmlDoc, presentation, width, height);
- if (msg != null) {
- styledtext.setText(msg);
- TextPresentation.applyTextPresentation(presentation, styledtext);
- }
- }
-
- public void setFocus() {
-
- }
-
-
- public void dispose() {
- styledtext = null;
- getSite().getPage().removePostSelectionListener(this);
- cmNode = null;
- super.dispose();
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
- IEditorPart edPart = getSite().getPage().getActiveEditor();
- if (part.equals(edPart)) {
- if (selection instanceof IStructuredSelection) {
- currentSelection = (IStructuredSelection) selection;
- if (!selection.isEmpty()
- && (currentSelection.getFirstElement() instanceof Node)) {
- Node node = (Node) currentSelection.getFirstElement();
- ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (mq != null) {
- cmNode = mq.getCMNode(node);
- MarkupTagInfoProvider tagInfo = new MarkupTagInfoProvider();
- xmlDoc = tagInfo.getInfo(cmNode);
- }
- else {
- xmlDoc = XMLUIMessages.Documentation_view_default_msg;
- }
- doStyledTextInput();
- }
- }
- }
- }
-
- private Color getColor(int colorID) {
- Display display = Display.getCurrent();
- return display.getSystemColor(colorID);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/CMListWorkbenchAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/CMListWorkbenchAdapter.java
deleted file mode 100644
index 08d4fd27b0..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/CMListWorkbenchAdapter.java
+++ /dev/null
@@ -1,193 +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.wst.xml.ui.internal.views.contentmodel;
-
-import java.util.ArrayList;
-import java.util.EmptyStackException;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMVisitor;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class CMListWorkbenchAdapter extends CMVisitor implements IWorkbenchAdapter {
-
- private CMElementDeclaration fDeclaration;
- private String text;
- private ImageDescriptor image;
- private GroupStack fGroupStack;
- private CMDescriber fRoot;
-
- public CMListWorkbenchAdapter(CMElementDeclaration decl) {
- text = getFormattedLabel(decl.getNodeName(), decl.getMinOccur(), decl.getMaxOccur(), decl.getDataType());
- fDeclaration = decl;
- image = AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-
- fGroupStack = new GroupStack();
- fRoot = new CMDescriber(decl);
- }
-
- public Object[] getChildren(Object o) {
- /* TODO Use the CMElementDeclaration and ModelQuery to get the available children of the root element */
- return fRoot.getChildren(o);
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return image;
- }
-
- public String getLabel(Object o) {
- return text;
- }
-
- public Object getParent(Object o) {
- return fDeclaration;
- }
-
- /**
- * Formats the label for an element declaration. The format will be: <b>name</b> [<i>min</i>..<i>max</i>], where <i>max</i> when unbounded is represented by <b>*</b>
- * @param name The name of the element declaration
- * @param min The minimum number of occurrences of the element
- * @param max The maximum number of occurrences of the element
- * @return The formatted label String
- */
- static String getFormattedLabel(String name, int min, int max, CMDataType dataType) {
- StringBuffer buffer = new StringBuffer(name);
- buffer.append('[');
- buffer.append(min);
- buffer.append(".."); //$NON-NLS-1$
- buffer.append((max >= 0 ? Integer.toString(max) : "*")); //$NON-NLS-1$
- buffer.append(']');
- if (dataType != null) {
- buffer.append(" {"); //$NON-NLS-1$
- buffer.append(dataType.getDataTypeName());
- buffer.append('}');
- }
- return buffer.toString();
- }
-
- /**
- * Workbench adapter that describes its CMNode. It calculates its children lazily using the CMVisitor
- * to identify immediate children (i.e., the content of child nodes is not visited).
- *
- */
- private class CMDescriber extends CMVisitor implements IWorkbenchAdapter {
-
- List fChildren = null;
- ImageDescriptor fImage;
- String label;
- CMNode root;
-
- public CMDescriber(CMNode node) {
- root = node;
- }
-
- public Object[] getChildren(Object o) {
- if (fChildren == null) {
- fChildren = new ArrayList();
- if (root.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- CMElementDeclaration ed = (CMElementDeclaration) root;
- CMNamedNodeMap nodeMap = ed.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++) {
- visitCMNode(nodeMap.item(i));
- }
- visitCMNode(ed.getContent());
- }
- }
- return fChildren.toArray();
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return fImage;
- }
-
- public void setImage(String path) {
- fImage = AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, path);
- }
- public String getLabel(Object o) {
- return label;
- }
-
- public Object getParent(Object o) {
- return root;
- }
-
- public void visitCMGroup(CMGroup e) {
- fGroupStack.push(e.getMaxOccur());
- super.visitCMGroup(e);
- fGroupStack.pop();
- }
-
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad) {
- CMDescriber describer = new CMDescriber(ad);
- describer.label = ad.getNodeName();
- describer.setImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- fChildren.add(describer);
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed) {
- CMDescriber describer = new CMDescriber(ed);
-
- // If the parent group stack containing this element declaration is unbounded, the element within is unbounded as well
- describer.label = getFormattedLabel(ed.getNodeName(), ed.getMinOccur(), (!fGroupStack.isEmpty() && fGroupStack.peek() < 0) ? -1 : ed.getMaxOccur(), ed.getDataType());
- describer.setImage(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
- fChildren.add(describer);
- }
- }
-
- /**
- * A stack of integers used to determine if an element declaration is unbounded
- *
- */
- private static class GroupStack {
- int[] stack;
- int size;
-
- public GroupStack() {
- stack = new int[5];
- }
-
- public void push(int i) {
- if (size >= stack.length) {
- int[] tmp = stack;
- stack = new int[stack.length * 2];
- System.arraycopy(tmp, 0, stack, 0, tmp.length);
- }
- stack[size++] = i;
- }
-
- public int pop() {
- if (isEmpty())
- throw new EmptyStackException();
- return stack[--size];
- }
-
- public boolean isEmpty() {
- return size == 0;
- }
-
- public int peek() {
- if (isEmpty())
- throw new EmptyStackException();
- return stack[size - 1];
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelAdapterFactory.java
deleted file mode 100644
index 21dad4efa7..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelAdapterFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.views.contentmodel;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class ContentModelAdapterFactory implements IAdapterFactory {
- private static Class[] ADAPTORLIST = new Class[] { IWorkbenchAdapter.class };
- private IWorkbenchAdapter adapter = new ContentModelWorkbenchAdapter();
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (IWorkbenchAdapter.class.equals(adapterType))
- return adapter;
- return null;
- }
-
- public Class[] getAdapterList() {
- return ADAPTORLIST;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelView.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelView.java
deleted file mode 100644
index 6391e43e79..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelView.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.views.contentmodel;
-
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.State;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.model.BaseWorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.ViewPart;
-import org.w3c.dom.Element;
-
-
-public class ContentModelView extends ViewPart implements ISelectionListener {
- private TreeViewer tv;
-
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- getSite().getPage().addPostSelectionListener(this);
- }
-
- public void dispose() {
- getSite().getPage().removePostSelectionListener(this);
- super.dispose();
- }
-
- public void createPartControl(Composite parent) {
- Tree tree = new Tree(parent, SWT.NONE);
- tv = new TreeViewer(tree);
- tv.setContentProvider(new BaseWorkbenchContentProvider());
- tv.setLabelProvider(new WorkbenchLabelProvider());
- }
-
- public void setFocus() {
-
- }
-
-
- private IStructuredSelection currentSelection;
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
- IEditorPart edPart = getSite().getPage().getActiveEditor();
- if (part.equals(edPart)) {
- if (selection instanceof IStructuredSelection) {
- currentSelection = (IStructuredSelection) selection;
- if (!selection.isEmpty()
- && (currentSelection.getFirstElement() instanceof Element)) {
- if (isLinkedWithEditor() && !currentSelection.getFirstElement().equals(tv.getInput())) {
- tv.setInput(currentSelection.getFirstElement());
- }
- }
- }
- }
-
- }
-
- private boolean isLinkedWithEditor() {
- ICommandService service = (ICommandService) PlatformUI.getWorkbench()
- .getService(ICommandService.class);
- Command command = service.getCommand("org.eclipse.wst.xml.ui.cmnd.contentmodel.sych"); //$NON-NLS-1$
- State state = command.getState("org.eclipse.ui.commands.toggleState"); //$NON-NLS-1$
-
- return ((Boolean) state.getValue()).booleanValue();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelWorkbenchAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelWorkbenchAdapter.java
deleted file mode 100644
index fcec1a6356..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/views/contentmodel/ContentModelWorkbenchAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.views.contentmodel;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Element;
-
-class ContentModelWorkbenchAdapter implements IWorkbenchAdapter {
- private final Object[] EMPTY = new Object[0];
- private Object parent = null;
-
- public Object[] getChildren(Object o) {
- if (o instanceof Element) {
- Element node = (Element) o;
- ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (mq != null) {
- CMElementDeclaration decl = mq.getCMElementDeclaration(node);
- CMListWorkbenchAdapter adapter = new CMListWorkbenchAdapter(decl);
- return new Object[] { adapter };
- }
- }
- return EMPTY;
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- public String getLabel(Object o) {
- return null;
- }
-
- public Object getParent(Object o) {
- return parent;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java
deleted file mode 100644
index 00b2cf507b..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.views.contentoutline;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.dnd.DragNodeCommand;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Basic Outline Configuration for generic XML support. Expects that the viewer's
- * input will be the DOM Model, and provides basic label and content providers.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 3.1
- */
-public abstract class AbstractXMLContentOutlineConfiguration extends ContentOutlineConfiguration {
- private class ActionManagerMenuListener implements IMenuListener, IReleasable {
- private XMLNodeActionManager fActionManager;
- private TreeViewer fTreeViewer;
-
- public ActionManagerMenuListener(TreeViewer viewer) {
- fTreeViewer = viewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
- */
- public void menuAboutToShow(IMenuManager manager) {
- if (fActionManager == null) {
- fActionManager = createNodeActionManager(fTreeViewer);
- }
- if (fActionManager != null) {
- fActionManager.fillContextMenu(manager, fTreeViewer.getSelection());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
- */
- public void release() {
- fTreeViewer = null;
- if (fActionManager != null) {
- fActionManager.setModel(null);
- }
- }
- }
-
- private static class StatusLineLabelProvider extends JFaceNodeLabelProvider {
- public StatusLineLabelProvider() {
- super();
- }
-
- 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));
- }
-
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- node = ((Attr) node).getOwnerElement();
- else
- node = node.getParentNode();
-
- if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, IPath.SEPARATOR);
- }
- }
- return s.toString();
- }
- }
-
- private IContentProvider fContentProvider = null;
-
- private ActionManagerMenuListener fContextMenuFiller = null;
-
- private ILabelProvider fLabelProvider = null;
-
- boolean fShowAttributes = false;
-
- private ILabelProvider fSimpleLabelProvider;
- private TransferDragSourceListener[] fTransferDragSourceListeners;
-
- private TransferDropTargetListener[] fTransferDropTargetListeners;
-
- /**
- * Create new instance of XMLContentOutlineConfiguration
- */
- public AbstractXMLContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /**
- * Returns the NodeActionManager to use for the given treeViewer.
- * <p>
- * Not API. May be removed in the future.
- * </p>
- *
- * @param treeViewer
- * the TreeViewer associated with this configuration
- * @return a node action manager for use with this tree viewer
- */
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new XMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null) {
- fContentProvider = new JFaceNodeContentProvider();
- }
- return fContentProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null) {
- fLabelProvider = new JFaceNodeLabelProvider();
- }
- return fLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
- */
- public IMenuListener getMenuListener(TreeViewer viewer) {
- if (fContextMenuFiller == null) {
- fContextMenuFiller = new ActionManagerMenuListener(viewer);
- }
- return fContextMenuFiller;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return XMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
- if (fSimpleLabelProvider == null) {
- fSimpleLabelProvider = new StatusLineLabelProvider();
- }
- return fSimpleLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDragSourceListener[] getTransferDragSourceListeners(final TreeViewer treeViewer) {
- if (fTransferDragSourceListeners == null) {
- fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
-
- public void dragFinished(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(null);
- }
-
- public void dragSetData(DragSourceEvent event) {
- }
-
- public void dragStart(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection());
- }
-
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getTransfer();
- }
- }};
- }
-
- return fTransferDragSourceListeners;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDropTargetListener[] getTransferDropTargetListeners(final TreeViewer treeViewer) {
- if (fTransferDropTargetListeners == null) {
- fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
- public void dragEnter(DropTargetEvent event) {
- }
-
- public void dragLeave(DropTargetEvent event) {
- }
-
- public void dragOperationChanged(DropTargetEvent event) {
- }
-
- public void dragOver(DropTargetEvent event) {
- event.feedback = DND.FEEDBACK_SELECT;
- float feedbackFloat = getHeightInItem(event);
- if (feedbackFloat > 0.75) {
- event.feedback = DND.FEEDBACK_INSERT_AFTER;
- }
- else if (feedbackFloat < 0.25) {
- event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- }
- event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
- }
-
- public void drop(DropTargetEvent event) {
- if (event.operations != DND.DROP_NONE && LocalSelectionTransfer.getTransfer().getSelection() != null && !LocalSelectionTransfer.getTransfer().getSelection().isEmpty()) {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- if (selection != null && !selection.isEmpty() && event.item != null && event.item.getData() != null) {
- /*
- * the command uses these numbers instead of the
- * feedback constants (even though it converts in
- * the other direction as well)
- */
- float feedbackFloat = getHeightInItem(event);
-
- final DragNodeCommand command = new DragNodeCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList(), treeViewer);
- if (command != null && command.canExecute()) {
- SafeRunnable.run(new SafeRunnable() {
- public void run() throws Exception {
- command.execute();
- }
- });
- }
- }
- }
- }
-
- public void dropAccept(DropTargetEvent event) {
- }
-
- private float getHeightInItem(DropTargetEvent event) {
- if (event.item == null)
- return .5f;
- if (event.item instanceof TreeItem) {
- TreeItem treeItem = (TreeItem) event.item;
- Control control = treeItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = treeItem.getBounds();
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else if (event.item instanceof TableItem) {
- TableItem tableItem = (TableItem) event.item;
- Control control = tableItem.getParent();
- Point point = control.toControl(new Point(event.x, event.y));
- Rectangle bounds = tableItem.getBounds(0);
- return (float) (point.y - bounds.y) / (float) bounds.height;
- }
- else {
- return 0.0F;
- }
- }
-
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getTransfer();
- }
-
- public boolean isEnabled(DropTargetEvent event) {
- return getTransfer().isSupportedType(event.currentDataType);
- }
- }};
- }
- return fTransferDropTargetListeners;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
- */
- public void unconfigure(TreeViewer viewer) {
- super.unconfigure(viewer);
- fTransferDragSourceListeners = null;
- fTransferDropTargetListeners = null;
- if (fContextMenuFiller != null) {
- fContextMenuFiller.release();
- fContextMenuFiller = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java
deleted file mode 100644
index d41706a5bb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCDATASectionFilter.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.w3c.dom.CDATASection;
-
-public class XMLCDATASectionFilter extends ViewerFilter {
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- return !(element instanceof CDATASection);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java
deleted file mode 100644
index a747c90147..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLCommentFilter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.views.contentoutline;
-
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.w3c.dom.Comment;
-
-
-/**
- * Filters package declarations
- */
-public class XMLCommentFilter extends ViewerFilter {
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- return !(element instanceof Comment);
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
deleted file mode 100644
index 015c8c41c4..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.views.contentoutline;
-
-import java.util.List;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * More advanced Outline Configuration for XML support. Expects that the viewer's
- * input will be the DOM Model.
- *
- * @see AbstractXMLContentOutlineConfiguration
- * @since 1.0
- */
-public class XMLContentOutlineConfiguration extends AbstractXMLContentOutlineConfiguration {
- static final String ATTR_NAME = "name";
- static final String ATTR_ID = "id";
-
- private class AttributeShowingLabelProvider extends JFaceNodeLabelProvider {
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object o) {
- StringBuffer text = null;
- if (o instanceof Node) {
- Node node = (Node) o;
- if ((node.getNodeType() == Node.ELEMENT_NODE) && fShowAttributes) {
- text = new StringBuffer(super.getText(o));
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
- if (node.hasAttributes()) {
- Element element = (Element) node;
- NamedNodeMap attributes = element.getAttributes();
- Node idTypedAttribute = null;
- Node requiredAttribute = null;
- boolean hasId = false;
- boolean hasName = false;
- Node shownAttribute = null;
-
- // try to get content model element
- // declaration
- CMElementDeclaration elementDecl = null;
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- elementDecl = mq.getCMElementDeclaration(element);
- }
- // find an attribute of type (or just named)
- // ID
- if (elementDecl != null) {
- int i = 0;
- while ((i < attributes.getLength()) && (idTypedAttribute == null)) {
- Node attr = attributes.item(i);
- String attrName = attr.getNodeName();
- CMNamedNodeMap attributeDeclarationMap = elementDecl.getAttributes();
-
- CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributeDeclarationMap);
- List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent(element, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
- for (int k = 0; k < nodes.size(); k++) {
- CMNode cmnode = (CMNode) nodes.get(k);
- if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- allAttributes.put(cmnode);
- }
- }
- attributeDeclarationMap = allAttributes;
-
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributeDeclarationMap.getNamedItem(attrName);
- if (attrDecl != null) {
- if ((attrDecl.getAttrType() != null) && (CMDataType.ID.equals(attrDecl.getAttrType().getDataTypeName()))) {
- idTypedAttribute = attr;
- }
- else if ((attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) && (requiredAttribute == null)) {
- // as a backup, keep tabs on
- // any required
- // attributes
- requiredAttribute = attr;
- }
- else {
- hasId = hasId || attrName.equals(ATTR_ID);
- hasName = hasName || attrName.equals(ATTR_NAME);
- }
- }
- ++i;
- }
- }
-
- /*
- * If no suitable attribute was found, try using a
- * required attribute, if none, then prefer "id" or
- * "name", otherwise just use first attribute
- */
- if (idTypedAttribute != null) {
- shownAttribute = idTypedAttribute;
- }
- else if (requiredAttribute != null) {
- shownAttribute = requiredAttribute;
- }
- else if (hasId) {
- shownAttribute = attributes.getNamedItem(ATTR_ID);
- }
- else if (hasName) {
- shownAttribute = attributes.getNamedItem(ATTR_NAME);
- }
- if (shownAttribute == null) {
- shownAttribute = attributes.item(0);
- }
-
- // display the attribute and value (without quotes)
- String attributeName = shownAttribute.getNodeName();
- if ((attributeName != null) && (attributeName.length() > 0)) {
- String attributeValue = shownAttribute.getNodeValue();
- if ((attributeValue != null) && (attributeValue.length() > 0)) {
- text.append(" "); //$NON-NLS-1$
- text.append(attributeName);
- text.append("="); //$NON-NLS-1$
- text.append(StringUtils.strip(attributeValue));
- }
- }
- }
- }
- else {
- text = new StringBuffer(super.getText(o));
- }
- }
- else {
- return super.toString();
- }
- return text.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
- */
- public String getToolTipText(Object element) {
- if (element instanceof Node) {
- switch (((Node) element).getNodeType()) {
- case Node.COMMENT_NODE :
- case Node.CDATA_SECTION_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- case Node.TEXT_NODE : {
- String nodeValue = ((Node) element).getNodeValue().trim();
- return prepareText(nodeValue);
- }
- case Node.ELEMENT_NODE : {
- // show the preceding comment's tooltip information
- Node previous = ((Node) element).getPreviousSibling();
- if (previous != null && previous.getNodeType() == Node.TEXT_NODE)
- previous = previous.getPreviousSibling();
- if (previous != null && previous.getNodeType() == Node.COMMENT_NODE)
- return getToolTipText(previous);
- }
- }
- }
- return super.getToolTipText(element);
- }
-
- /**
- * Remove leading indentation from each line in the give string.
- * @param text
- * @return
- */
- private String prepareText(String text) {
- StringBuffer nodeText = new StringBuffer();
- for (int i = 0; i < text.length(); i++) {
- char c = text.charAt(i);
- if (c != '\r' && c != '\n') {
- nodeText.append(c);
- }
- else if (c == '\r' || c == '\n') {
- nodeText.append('\n');
- while (Character.isWhitespace(c) && i < text.length()) {
- i++;
- c = text.charAt(i);
- }
- nodeText.append(c);
- }
- }
- return nodeText.toString();
- }
- }
-
- /**
- * Toggle action for whether or not to display element's first attribute
- */
- private class ToggleShowAttributeAction extends PropertyChangeUpdateAction {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
- private TreeViewer fTreeViewer;
-
- public ToggleShowAttributeAction(IPreferenceStore store, String preference, TreeViewer treeViewer) {
- super(XMLUIMessages.XMLContentOutlineConfiguration_0, store, preference, true);
- setToolTipText(getText());
- // images needed
- // setDisabledImageDescriptor(SYNCED_D);
- // (nsd) temporarily re-use Properties view image
- setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS));
- fTreeViewer = treeViewer;
- update();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- super.update();
- fShowAttributes = isChecked();
-
- // notify the configuration of the change
- enableShowAttributes(fShowAttributes, fTreeViewer);
-
- // refresh the outline view
- fTreeViewer.refresh(true);
- }
- }
-
- private ILabelProvider fAttributeShowingLabelProvider;
- private IContentProvider fContentProvider = null;
-
- boolean fShowAttributes = false;
-
- /*
- * Preference key for Show Attributes
- */
- private final String OUTLINE_SHOW_ATTRIBUTE_PREF = "outline-show-attribute"; //$NON-NLS-1$
- private static final String OUTLINE_FILTER_PREF = "org.eclipse.wst.xml.ui.OutlinePage"; //$NON-NLS-1$
-
- /**
- * Create new instance of XMLContentOutlineConfiguration
- */
- public XMLContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
-
- /**
- * Set up our preference store here. This is done so that subclasses
- * aren't required to set their own values, although if they have,
- * those will be used instead.
- */
- IPreferenceStore store = getPreferenceStore();
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_NODE, "1, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.PROCESSING_INSTRUCTION_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.PROCESSING_INSTRUCTION_NODE, "2, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_TYPE_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_TYPE_NODE, "3, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_FRAGMENT_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_FRAGMENT_NODE, "4, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.COMMENT_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.COMMENT_NODE, "5, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ATTRIBUTE_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ATTRIBUTE_NODE, "6, false");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ELEMENT_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ELEMENT_NODE, "7, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_REFERENCE_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_REFERENCE_NODE, "8, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.CDATA_SECTION_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.CDATA_SECTION_NODE, "9, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_NODE, "10, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.NOTATION_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.NOTATION_NODE, "11, true");
- if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.TEXT_NODE).length() == 0)
- store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.TEXT_NODE, "12, false");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#createMenuContributions(org.eclipse.jface.viewers.TreeViewer)
- */
- protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
- IContributionItem[] items;
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
- IContributionItem showAttributeItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowAttributeAction(getPreferenceStore(), OUTLINE_SHOW_ATTRIBUTE_PREF, viewer));
-
- items = super.createMenuContributions(viewer);
- if (items == null) {
- items = new IContributionItem[]{showAttributeItem};
- }
- else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
- System.arraycopy(items, 0, combinedItems, 0, items.length);
- combinedItems[items.length] = showAttributeItem;
- items = combinedItems;
- }
- return items;
- }
-
- /**
- * Notifies this configuration that the flag that indicates whether or not
- * to show attribute values in the tree viewer has changed. The tree
- * viewer is automatically refreshed afterwards to update the labels.
- *
- * Clients should not call this method, but rather should react to it.
- *
- * @param showAttributes
- * flag indicating whether or not to show attribute values in
- * the tree viewer
- * @param treeViewer
- * the TreeViewer associated with this configuration
- */
- protected void enableShowAttributes(boolean showAttributes, TreeViewer treeViewer) {
- // nothing by default
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null) {
- fContentProvider = new JFaceNodeContentProvider();
- }
- return fContentProvider;
- }
-
- private Object getFilteredNode(Object object) {
- if (object instanceof Node) {
- Node node = (Node) object;
- short nodeType = node.getNodeType();
- // replace attribute node in selection with its parent
- if (nodeType == Node.ATTRIBUTE_NODE) {
- node = ((Attr) node).getOwnerElement();
- }
- // anything else not visible, replace with parent node
- else if (nodeType == Node.TEXT_NODE) {
- node = node.getParentNode();
- }
- return node;
- }
- return object;
- }
-
- private Object[] getFilteredNodes(Object[] filteredNodes) {
- for (int i = 0; i < filteredNodes.length; i++) {
- filteredNodes[i] = getFilteredNode(filteredNodes[i]);
- }
- return filteredNodes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fAttributeShowingLabelProvider == null) {
- fAttributeShowingLabelProvider = new AttributeShowingLabelProvider();
- }
- return fAttributeShowingLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getSelection(org.eclipse.jface.viewers.TreeViewer,
- * org.eclipse.jface.viewers.ISelection)
- */
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- ISelection filteredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
- filteredSelection = new StructuredSelection(filteredNodes);
- }
- return filteredSelection;
- }
-
- protected String getOutlineFilterTarget(){
- return OUTLINE_FILTER_PREF ;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java
deleted file mode 100644
index 59b74e9b14..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLProcessingInstructionFilter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.w3c.dom.ProcessingInstruction;
-
-public class XMLProcessingInstructionFilter extends ViewerFilter {
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- return !(element instanceof ProcessingInstruction);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
deleted file mode 100644
index 472fac16cb..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.xml.ui.views.properties;
-
-import java.util.HashSet;
-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.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.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.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.properties.XMLPropertySource;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Configuration for property sheet page which shows XML content.
- *
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- * @since 1.0
- */
-public class XMLPropertySheetConfiguration extends PropertySheetConfiguration {
- private class CMDocumentManagerListenerImpl implements CMDocumentManagerListener {
- public void cacheCleared(CMDocumentCache cache) {
- // nothing to do
- }
-
- public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
- if ((newStatus == CMDocumentCache.STATUS_LOADED) || (newStatus == CMDocumentCache.STATUS_ERROR)) {
- refreshPages();
- }
- }
-
- public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
- if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
- refreshPages();
- }
- }
-
- private void refreshPages() {
- getPropertiesRefreshJob().addPropertySheetPage(fPropertySheetPage);
- getPropertiesRefreshJob().schedule(PropertiesRefreshJob.UPDATE_DELAY);
- }
- }
-
- private class PropertiesRefreshJob extends UIJob {
- public static final int UPDATE_DELAY = 200;
-
- Set propertySheetPages = null;
-
- public PropertiesRefreshJob() {
- super(XMLUIMessages.JFaceNodeAdapter_1);
- setSystem(true);
- setPriority(Job.SHORT);
- propertySheetPages = new HashSet(1);
- }
-
- void addPropertySheetPage(IPropertySheetPage page) {
- if (page != null && propertySheetPages != null) {
- propertySheetPages.add(page);
- schedule(UPDATE_DELAY);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#canceling()
- */
- protected void canceling() {
- propertySheetPages.clear();
- super.canceling();
- }
-
- 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 != null) && (page.getControl() != null) && !page.getControl().isDisposed()) {
- page.refresh();
- }
- }
-
- return Status.OK_STATUS;
- }
- }
-
- private class XMLPropertySheetRefreshAdapter 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 XMLPropertySourceProvider implements IPropertySourceProvider {
- private IPropertySource fPropertySource = null;
- private INodeNotifier fSource = null;
-
- public IPropertySource getPropertySource(Object object) {
- if ((fSource != null) && object.equals(fSource)) {
- return fPropertySource;
- }
-
- if (object instanceof IDOMNode) {
- fSource = (INodeNotifier) object;
- fPropertySource = (IPropertySource) fSource.getAdapterFor(IPropertySource.class);
- if (fPropertySource == null) {
- fPropertySource = new XMLPropertySource((INodeNotifier) object) {
- public void setPropertyValue(Object nameObject, Object value) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=218979
- if (fSelectedNotifiers != null) {
- for (int i = 0; i < fSelectedNotifiers.length; i++) {
- fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
- }
- }
- super.setPropertyValue(nameObject, value);
- if (fSelectedNotifiers != null) {
- for (int i = 0; i < fSelectedNotifiers.length; i++) {
- fSelectedNotifiers[i].addAdapter(fRefreshAdapter);
- }
- }
- }
- };
- }
- }
- else {
- fSource = null;
- fPropertySource = null;
- }
- return fPropertySource;
- }
- }
-
- private CMDocumentManagerListenerImpl fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
- private PropertiesRefreshJob fPropertiesRefreshJob = null;
- IPropertySheetPage fPropertySheetPage = null;
- private IPropertySourceProvider fPropertySourceProvider = null;
- private INodeAdapter fRefreshAdapter = new XMLPropertySheetRefreshAdapter();
- private CMDocumentManager[] fSelectedCMDocumentManagers = new CMDocumentManager[0];
- private INodeNotifier[] fSelectedNotifiers = new INodeNotifier[0];
-
-
- /**
- * Create new instance of XMLPropertySheetConfiguration
- */
- public XMLPropertySheetConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
- if (fSelectedNotifiers != null) {
- for (int i = 0; i < fSelectedNotifiers.length; i++) {
- fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
- }
- fSelectedNotifiers = null;
- }
- for (int i = 0; i < fSelectedCMDocumentManagers.length; i++) {
- fSelectedCMDocumentManagers[i].removeListener(fCMDocumentManagerListener);
- }
-
- ISelection preferredSelection = selection;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSel = (IStructuredSelection) selection;
-
- /*
- * On Attr nodes, select the owner Element. On Text nodes, select
- * the parent Element.
- */
- Object[] selectedObjects = new Object[structuredSel.size()];
- System.arraycopy(structuredSel.toArray(), 0, selectedObjects, 0, selectedObjects.length);
- for (int i = 0; i < selectedObjects.length; i++) {
- Object inode = selectedObjects[i];
- if (inode instanceof Node) {
- Node node = (Node) inode;
- // replace Attribute Node with its owner
- Node parentNode = node.getParentNode();
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- Element ownerElement = ((Attr) node).getOwnerElement();
- selectedObjects[i] = ownerElement;
- }
- // replace Text Node with its parent
- else if (((node.getNodeType() == Node.TEXT_NODE) || (node.getNodeType() == Node.CDATA_SECTION_NODE)) && (parentNode != null)) {
- selectedObjects[i] = parentNode;
- }
- }
- }
-
- if (selectedObjects.length > 0) {
- Set managers = new HashSet(1);
- Set selectedNotifiers = new HashSet(1);
-
- for (int i = 0; i < selectedObjects.length; i++) {
- if (selectedObjects[i] instanceof Node) {
- ModelQuery query = ModelQueryUtil.getModelQuery(((Node) selectedObjects[i]).getOwnerDocument());
- if (query != null) {
- CMDocumentManager mgr = query.getCMDocumentManager();
- if (mgr != null) {
- managers.add(mgr);
- mgr.addListener(fCMDocumentManagerListener);
- }
- }
- }
- /*
- * Add UI refresh adapters and remember notifiers for
- * later removal
- */
- if (selectedObjects[i] instanceof INodeNotifier) {
- selectedNotifiers.add(selectedObjects[i]);
- ((INodeNotifier) selectedObjects[i]).addAdapter(fRefreshAdapter);
- }
- }
- fSelectedCMDocumentManagers = (CMDocumentManager[]) managers.toArray(new CMDocumentManager[managers.size()]);
- 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) {
- fPropertySheetPage = page;
- fPropertySourceProvider = new XMLPropertySourceProvider();
- }
- return fPropertySourceProvider;
- }
-
-
- public void unconfigure() {
- super.unconfigure();
- for (int i = 0; i < fSelectedCMDocumentManagers.length; i++) {
- fSelectedCMDocumentManagers[i].removeListener(fCMDocumentManagerListener);
- }
- if(fPropertiesRefreshJob != null) {
- fPropertiesRefreshJob.cancel();
- fPropertiesRefreshJob.propertySheetPages = null;
- }
- fPropertySheetPage = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties
deleted file mode 100644
index 8b5177a589..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties
+++ /dev/null
@@ -1,26 +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
-#
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=xml comment
-Templates.xmldeclaration.name=xml declaration
-Templates.xmldeclaration.desc=xml declaration
-Templates.xslpi.name=XSL processing instruction
-Templates.xslpi.desc=XSL processing instruction
-Templates.xsinsp.name=xsinsp
-Templates.xsinsp.desc=XML Schema name space
-Templates.schemaLoc.name=schemaLoc
-Templates.schemaLoc.desc=XML Schema location attribute
-Templates.noschemaLoc.name=noschemaLoc
-Templates.noschemaLoc.desc=No Namespace Schema Location
-Templates.defaultnsp.name=default namespace
-Templates.defaultnsp.desc=Default Namespace Attribute
diff --git a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
deleted file mode 100644
index b4ad498868..0000000000
--- a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
+++ /dev/null
@@ -1,24 +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
- * David Carver - added templates for xsi namespace, schemaLocation, and
- default namespace
- *******************************************************************************/
- -->
-<templates>
- <template name="%Templates.xmldeclaration.name" description="%Templates.xmldeclaration.desc" id="org.eclipse.wst.xml.ui.internal.templates.xmldeclaration" context="xml_new" enabled="true">&lt;?xml version="1.0" encoding="${encoding}"?&gt;</template>
- <template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.xml.ui.internal.templates.comment" context="xml_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
- <template name="%Templates.xslpi.name" description="%Templates.xslpi.desc" id="org.eclipse.wst.xml.ui.internal.templates.xslpi" context="xml_tag" enabled="true">&lt;?xml-stylesheet type="text/xsl" href="${cursor}"?&gt;</template>
- <template name="%Templates.xsinsp.name" description="%Templates.xsinsp.desc" id="org.eclipse.wst.xml.ui.internal.templates.xsinsp" context="xml_attribute" enabled="true">xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</template>
- <template name="%Templates.schemaLoc.name" description="%Templates.schemaLoc.desc" id="org.eclipse.wst.xml.ui.internal.templates.schemaLoc" context="xml_attribute" enabled="true">xsi:schemaLocation="{namespace} {location}"</template>
- <template name="%Templates.noschemaLoc.name" description="%Templates.noschemaLoc.desc" id="org.eclipse.wst.xml.ui.internal.templates.noschemaLoc" context="xml_attribute" enabled="true">xsi:noNamespaceSchemaLocation="{location}"</template>
- <template name="%Templates.defaultnsp.name" description="%Templates.defaultnsp.desc" id="org.eclipse.wst.xml.ui.internal.templates.defaultnsp" context="xml_attribute" enabled="true">xmlns="default namespace"</template>
-</templates>
diff --git a/bundles/org.eclipse.wst.xsd.core/.classpath b/bundles/org.eclipse.wst.xsd.core/.classpath
deleted file mode 100644
index 4710c45bcd..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/.classpath
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-contentmodel" />
- <classpathentry kind="src" path="src-validation" />
- <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">
- <accessrules>
- <accessrule kind="accessible"
- pattern="org/apache/xerces/impl/Constants" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/parsers/XMLGrammarPreparser" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/util/XMLGrammarPoolImpl" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/XMLResourceIdentifier" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/XNIException" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/grammars/XMLGrammarDescription" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/parser/XMLEntityResolver" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/parser/XMLErrorHandler" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/parser/XMLInputSource" />
- <accessrule kind="accessible"
- pattern="org/apache/xerces/xni/parser/XMLParseException" />
- </accessrules>
- </classpathentry>
- <classpathentry kind="con"
- path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/provisional/core/IMessage" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/internal/delegates/DelegatingValidator" />
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin" />
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsd.core/.cvsignore b/bundles/org.eclipse.wst.xsd.core/.cvsignore
deleted file mode 100644
index 33dd7de3de..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-temp.folder
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xsd.core/.project b/bundles/org.eclipse.wst.xsd.core/.project
deleted file mode 100644
index a95f8ef5e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ab5558fe54..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Sat Mar 24 02:19:12 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.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index e70985de11..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Wed Nov 15 02:13:10 EST 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=1
-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.xsd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
deleted file mode 100644
index de823e4515..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %_UI_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.xsd.core; singleton:=true
-Bundle-Version: 1.1.600.qualifier
-Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.contentmodel.internal;x-friends:="org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xsd.contentmodel.internal.util;x-internal:=true,
- org.eclipse.wst.xsd.core.internal;x-friends:="org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xsd.core.internal.preferences;x-friends:="org.eclipse.wst.xsd.ui",
- org.eclipse.wst.xsd.core.internal.validation;x-internal:=true,
- org.eclipse.wst.xsd.core.internal.validation.eclipse;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.xsd;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-
diff --git a/bundles/org.eclipse.wst.xsd.core/about.html b/bundles/org.eclipse.wst.xsd.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.xsd.core/build.properties b/bundles/org.eclipse.wst.xsd.core/build.properties
deleted file mode 100644
index 984631dafd..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/build.properties
+++ /dev/null
@@ -1,21 +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
-#
-###############################################################################
-bin.includes = META-INF/,\
- plugin.xml,\
- plugin.properties,\
- .,\
- about.html
-jars.compile.order = .
-output.. = bin/
-source.. = src-contentmodel/,\
- src-validation/,\
- src/
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.properties b/bundles/org.eclipse.wst.xsd.core/plugin.properties
deleted file mode 100644
index 42ba5578b0..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/plugin.properties
+++ /dev/null
@@ -1,22 +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
-###############################################################################
-! Properties file for component: XML Schema Validator
-
-!
-! Plugin
-!
-_UI_PLUGIN_NAME = XSD Core Plugin
-XSD_Content_Type=XSD
-
-_UI_XML_SCHEMA_VALIDATOR = XML Schema Validator
-_UI_XERCES_VALIDATOR_DELEGATE = Xerces-based XML Schema Validator
-
-Bundle-Vendor.0 = Eclipse Web Tools Platform
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.xml b/bundles/org.eclipse.wst.xsd.core/plugin.xml
deleted file mode 100644
index 8e2c53845b..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/plugin.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- priority="high"
- name="%XSD_Content_Type"
- id="org.eclipse.wst.xsd.core.xsdsource"
- base-type="org.eclipse.core.runtime.xml"
- default-charset="UTF-8"
- file-extensions="xsd" />
- </extension>
-
- <extension point="org.eclipse.wst.xml.core.documentFactories">
- <factory
- type="xsd"
- class="org.eclipse.wst.xsd.contentmodel.internal.CMDocumentFactoryXSD">
- </factory>
- </extension>
-
- <!-- ====================================================== -->
- <!-- Register the XSD validator with the validation -->
- <!-- framework. -->
- <!-- ====================================================== -->
- <!--
- <extension
- id="xsdValidator"
- name="%_UI_XML_SCHEMA_VALIDATOR"
- point="org.eclipse.wst.validation.validator">
- <validator>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- caseSensitive="false"
- nameFilter="*.xsd">
- </filter>
-
- <helper
- class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
- </helper>
-
- <run
- async="true"
- class="org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"
- enabled="true"
- fullBuild="true"
- incremental="true">
- </run>
- </validator>
- </extension>
- -->
-
- <extension id="xsd" name="%_UI_XML_SCHEMA_VALIDATOR" point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"
- manual="true"
- sourceid="org.eclipse.wst.xsd.ui.internal.validation.DelegatingSourceValidatorForXSD"
- version="2"
- markerId="org.eclipse.xsd.diagnostic">
- <include>
- <rules>
- <fileext caseSensitive="false" ext="xsd"></fileext>
- </rules>
- </include>
- </validator>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validatorDelegates">
- <delegate
- class="org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator"
- name="%_UI_XERCES_VALIDATOR_DELEGATE"
- target="org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator"/>
- </extension>
-
- <!-- initialize xml core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.xsd.core.internal.preferences.XSDCorePreferenceInitializer" />
- </extension>
-
- <!-- ====================================================== -->
- <!-- Add schemas to XML Catalog -->
- <!-- ====================================================== -->
- <extension
- point="org.eclipse.wst.xml.core.catalogContributions">
- <catalogContribution id="default">
- <uri
- name="http://www.w3.org/2001/XMLSchema"
- uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd" />
- <system
- systemId="http://www.w3.org/2001/xml.xsd"
- uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd"/>
- </catalogContribution>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java
deleted file mode 100644
index eaeb5d7581..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.contentmodel.internal;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-import org.eclipse.xsd.XSDPackage;
-
-/**
- * This builder handles building .dtd / .xsd grammar files
- */
-public class CMDocumentFactoryXSD implements CMDocumentFactory
-{
- public static final String XSD_FILE_TYPE = "XSD";
-
- public CMDocumentFactoryXSD()
- {
- // here we call init on the XSD and DTD packages to avoid strange initialization bugs
- //
- XSDPackage.eINSTANCE.eClass();
- XSDPackage.eINSTANCE.getXSDFactory();
- }
-
-
- public CMDocument createCMDocument(String uri)
- {
- CMDocument result = null;
- try
- {
- result = XSDImpl.buildCMDocument(uri);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java
deleted file mode 100644
index 9fca57870a..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java
+++ /dev/null
@@ -1,41 +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.xsd.contentmodel.internal;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public abstract class CMNodeImpl extends AdapterImpl implements CMNode
-{
- protected static final String PROPERTY_DOCUMENTATION = "documentation";
- protected static final String PROPERTY_DOCUMENTATION_SOURCE = "documentationSource";
- protected static final String PROPERTY_DOCUMENTATION_LANGUAGE = "documentationLanguage";
- protected static final String PROPERTY_MOF_NOTIFIER = "key";
- protected static final String PROPERTY_DEFINITION_INFO = "http://org.eclipse.wst/cm/properties/definitionInfo";
- protected static final String PROPERTY_DEFINITION = "http://org.eclipse.wst/cm/properties/definition";
-
- public abstract Object getKey();
-
- public boolean supports(String propertyName)
- {
- return propertyName.equals(PROPERTY_MOF_NOTIFIER);
- }
-
- public Object getProperty(String propertyName)
- {
- return null;
- }
-
- public void setProperty(String propertyName, Object object)
- {
- //no propertyes supported?
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java
deleted file mode 100644
index 3461a54924..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java
+++ /dev/null
@@ -1,38 +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.xsd.contentmodel.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Plugin;
-
-public class XSDCMManager extends Plugin
-{
- private static XSDCMManager instance;
-
- public XSDCMManager()
- {
- super();
- }
-
- public static XSDCMManager getInstance() {
- if (instance == null) {
- instance = new XSDCMManager();
- }
- return instance;
- }
-
-
- public void startup() throws CoreException
- {
- XSDTypeUtil.initialize();
- //ContentModelManager.getInstance().setInferredGrammarFactory(new InferredGrammarFactoryImpl());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
deleted file mode 100644
index 9abdc21698..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ /dev/null
@@ -1,3141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver - STAR - bug 157254 - referenced Attributes and Elements
- * were not being checked to see if they had the annotations if
- * none were defined locally. (Initial fix modified - see bug)
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAttributeDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDataTypeImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDocumentImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMEntityDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMGroupImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xsd.contentmodel.internal.util.XSDSchemaLocatorAdapterFactory;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDAttributeUseCategory;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDConstraint;
-import org.eclipse.xsd.XSDContentTypeCategory;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDForm;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSwitch;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * Utility class to build cmnodes from XML Schema nodes. The XML Schema model is
- * found in the org.eclipse.xsd plugin.
- *
- * TODO: getNamespaceURI()currently always returns '##any'.
- */
-public class XSDImpl
-{
- /*
- * properties common to all cmnodes the following properties defined in
- * CMNodeImpl class: PROPERTY_DOCUMENTATION PROPERTY_DOCUMENTATION_SOURCE
- * PROPERTY_DOCUMENTATION_LANGUAGE PROPERTY_MOF_NOTIFIER
- * PROPERTY_DEFINITION_INFO PROPERTY_DEFINITION
- *
- * the following properties defined in this class, XSDImpl:
- * PROPERTY_CMDOCUMENT PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS
- * PROPERTY_IS_NAME_SPACE_AWARE PROPERTY_NS_PREFIX_QUALIFICATION
- * PROPERTY_NILLABLE PROPERTY_SPEC
- */
- public static final String PROPERTY_CMDOCUMENT = "CMDocument";
- public static final String PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS = "http://org.eclipse.wst/cm/properties/usesLocalElementDeclarations";
- public static final String PROPERTY_IS_NAME_SPACE_AWARE = "http://org.eclipse.wst/cm/properties/isNameSpaceAware";
- public static final String PROPERTY_NS_PREFIX_QUALIFICATION = "http://org.eclipse.wst/cm/properties/nsPrefixQualification";
- public static final String PROPERTY_NILLABLE = "http://org.eclipse.wst/cm/properties/nillable";
- public static final String PROPERTY_SPEC = "spec";
- /*
- * properties common to all CMDocument nodes: PROPERTY_TARGET_NAMESPACE_URI
- * PROPERTY_IMPORTED_NAMESPACE_INFO PROPERTY_NAMESPACE_INFO
- * PROPERTY_ELEMENT_FORM_DEFAULT PROPERTY_ANNOTATION_MAP
- */
- public static final String PROPERTY_TARGET_NAMESPACE_URI = "http://org.eclipse.wst/cm/properties/targetNamespaceURI";
- public static final String PROPERTY_IMPORTED_NAMESPACE_INFO = "http://org.eclipse.wst/cm/properties/importedNamespaceInfo";
- public static final String PROPERTY_NAMESPACE_INFO = "http://org.eclipse.wst/cm/properties/namespaceInfo";
- public static final String PROPERTY_ELEMENT_FORM_DEFAULT = "http://org.eclipse.wst/cm/properties/elementFormDefault";
- public static final String PROPERTY_ANNOTATION_MAP = "annotationMap";
- public static final String PROPERTY_COMPLETE_NAMESPACE_INFO = "http://org.eclipse.wst/cm/properties/completeNamespaceInfo";
- /*
- * properties common to all CMElementDeclaration nodes: PROPERTY_XSITYPES
- * PROPERTY_DERIVED_ELEMENT_DECLARATION PROPERTY_SUBSTITUTION_GROUP
- * PROPERTY_ABSTRACT
- */
- public static final String PROPERTY_XSITYPES = "XSITypes";
- public static final String PROPERTY_DERIVED_ELEMENT_DECLARATION = "DerivedElementDeclaration";
- public static final String PROPERTY_SUBSTITUTION_GROUP = "SubstitutionGroup";
- public static final String PROPERTY_SUBSTITUTION_GROUP_VALUE = "SubstitutionGroupValue";
- public static final String PROPERTY_ABSTRACT = "Abstract";
- public static final String PROPERTY_WHITESPACE_FACET = "org.eclipse.wst.xsd.cm.properties/whitespace"; //$NON-NLS-1$
- /**
- * Definition info for element declarations.
- */
- public static final String DEFINITION_INFO_GLOBAL = "global";
- public static final String DEFINITION_INFO_LOCAL = "local";
- public static final String XML_LANG_ATTRIBUTE = "xml:lang";
- public static final String PLATFORM_PROTOCOL = "platform:";
- protected static XSDAdapterFactoryImpl xsdAdapterFactoryImpl = new XSDAdapterFactoryImpl();
- protected static XSIDocument xsiDocument = new XSIDocument();
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding CMDocument node.
- *
- * @param uri -
- * the uri for an XML Schema document
- * @param grammarErrorChecking -
- * grammar error checking flag
- * @param errorList -
- * the resulting error list
- * @return the corresponding CMDocument node.
- * @deprecated -- use buildCMDocument(String uri)
- */
- public static CMDocument buildCMDocument(String uri, int grammarErrorChecking, List errorList)
- {
- return buildCMDocument(uri);
- }
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding CMDocument node.
- *
- * @param uri -
- * the uri for an XML Schema document
- * @return the corresponding CMDocument node.
- */
- public static CMDocument buildCMDocument(String uri)
- {
- CMDocument cmDocument = null;
- XSDSchema xsdSchema = buildXSDModel(uri);
- if (xsdSchema != null)
- {
- cmDocument = (CMDocument) getAdapter(xsdSchema);
- }
- return cmDocument;
- }
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding CMDocument node.
- *
- * @param uri -
- * the uri for an XML Schema document
- * @return the corresponding CMDocument node.
- */
- public static XSDSchema buildXSDModel(String uriString)
- {
- XSDSchema xsdSchema = null;
-
- try
- {
- // if XML Schema for Schema is requested, get it through schema model
- if (uriString.endsWith("2001/XMLSchema.xsd"))
- {
- xsdSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
- else
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- //resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
- resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-
- URI uri = createURI(uriString);
-
- // CS : bug 113537 ensure we perform physical resolution before opening a stream for the resource
- //
- String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", uriString);
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- XSDResourceImpl resource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(inputStream, null);
- xsdSchema = resource.getSchema();
- }
- }
- catch (Exception e)
- {
- }
- return xsdSchema;
- }
-
- // TODO ... looks like we can remove this class?
- //
- static class InternalURIConverter extends URIConverterImpl
- {
- protected InputStream createURLInputStream(URI uri) throws IOException
- {
- if ("http".equals(uri.scheme()))
- {
- String theURI = uri.toString();
- String mapped = URIResolverPlugin.createResolver().resolve(theURI, theURI, theURI);
- if (mapped != null)
- {
- uri = createURI(mapped);
- }
- }
- return super.createURLInputStream(uri);
- }
- }
-
- /**
- * Returns an appropriate URI based on a uri string.
- *
- * @param uriString -
- * a uri string.
- * @return an appropriate URI based on a uri string.
- */
- public static URI createURI(String uriString)
- {
- if (hasProtocol(uriString))
- return URI.createURI(uriString);
- else
- return URI.createFileURI(uriString);
- }
-
- private static boolean hasProtocol(String uri)
- {
- boolean result = false;
- if (uri != null)
- {
- int index = uri.indexOf(":");
- if (index != -1 && index > 2) // assume protocol with be length 3 so that
- // the'C' in 'C:/' is not interpreted as a
- // protocol
- {
- result = true;
- }
- }
- return result;
- }
-
- /**
- * Returns true if string begins with platform protocol.
- *
- * @param uriString -
- * a uri string.
- * @return true if string begins with platform protocol.
- */
- public static boolean withPlatformProtocol(String uriString)
- {
- return uriString.startsWith(PLATFORM_PROTOCOL);
- }
-
- /**
- * Returns the value of the 'Min Occurs' attribute. The default value is "1".
- *
- * @param component -
- * a concrete component.
- * @return the value of the 'Min Occurs' attribute.
- */
- public static int getMinOccurs(XSDConcreteComponent component)
- {
- int minOccur = 1;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMinOccurs())
- {
- try
- {
- minOccur = ((XSDParticle) o).getMinOccurs();
- }
- catch (Exception e)
- {
- minOccur = 1;
- }
- }
- }
- }
- return minOccur;
- }
-
- /**
- * Returns the value of the 'Max Occurs' attribute. The default value is "1".
- *
- * @param component -
- * a concrete component.
- * @return the value of the 'Max Occurs' attribute.
- */
- public static int getMaxOccurs(XSDConcreteComponent component)
- {
- int maxOccur = 1;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMaxOccurs())
- {
- try
- {
- maxOccur = ((XSDParticle) o).getMaxOccurs();
- }
- catch (Exception e)
- {
- maxOccur = 1;
- }
- }
- }
- }
- return maxOccur;
- }
-
- /**
- * Returns the enumerated values for the given type.
- *
- * @param type -
- * a type definition.
- * @return the enumerated values for the given type.
- */
- private final static String TYPE_NAME_BOOLEAN = "boolean"; //$NON-NLS-1$
- private final static String TYPE_VALUE_TRUE = "true"; //$NON-NLS-1$
- private final static String TYPE_VALUE_FALSE= "false"; //$NON-NLS-1$
-
- public static String[] getEnumeratedValuesForType(XSDTypeDefinition type)
- {
- List result = new ArrayList();
- // See bug 214804 - Content assist not showing valid values when it's a complex
- // type with simple content
- if (type instanceof XSDComplexTypeDefinition)
- {
- type = ((XSDComplexTypeDefinition)type).getSimpleType();
- }
- if (type instanceof XSDSimpleTypeDefinition)
- {
- if (TYPE_NAME_BOOLEAN.equals(type.getName()) && type.getSchema().getSchemaForSchema() == type.getSchema())
- {
- result.add(TYPE_VALUE_TRUE);
- result.add(TYPE_VALUE_FALSE);
- }
- else
- {
- // Simple types can be one of: atomic, list or union.
- int varietyType = ((XSDSimpleTypeDefinition) type).getVariety().getValue();
-
- switch (varietyType)
- {
- case XSDVariety.ATOMIC:
- {
- XSDTypeDefinition baseType = type.getBaseType();
- if (baseType != null && !(type.getSchema().getSchemaForSchema() == baseType.getSchema()))
- {
- getEnumeratedValuesForSimpleType(baseType, result);
- }
- else
- {
- getEnumeratedValuesForSimpleType(type, result);
- }
- }
- break;
- case XSDVariety.LIST:
- {
- XSDSimpleTypeDefinition itemTypeDefinition = ((XSDSimpleTypeDefinition) type).getItemTypeDefinition();
- String[] values = getEnumeratedValuesForType(itemTypeDefinition);
- for (int j = 0; j < values.length; j++) {
- if(result.indexOf(values[j]) == -1) {
- result.add(values[j]);
- }
- }
- }
- break;
- case XSDVariety.UNION:
- {
- List memberTypes = ((XSDSimpleTypeDefinition) type).getMemberTypeDefinitions();
- if (memberTypes != null && memberTypes.size() > 0)
- {
- Iterator i = memberTypes.iterator();
- while (i.hasNext())
- {
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) i.next();
- String[] values = getEnumeratedValuesForType(simpleType);
- for (int j = 0; j < values.length; j++) {
- if(result.indexOf(values[j]) == -1) {
- result.add(values[j]);
- }
- }
- }
- }
- }
- break;
- }
- }
- }
- String[] array = new String[result.size()];
- result.toArray(array);
- return array;
- }
-
- private static void getEnumeratedValuesForSimpleType(XSDTypeDefinition type, List result)
- {
- List enumerationFacets = ((XSDSimpleTypeDefinition) type).getEnumerationFacets();
- for (Iterator i = enumerationFacets.iterator(); i.hasNext();)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
- List values = enumFacet.getValue();
- for (Iterator j = values.iterator(); j.hasNext();)
- {
- Object o = j.next();
- if (o != null)
- {
- if (!result.contains(o))
- {
- result.add(o.toString());
- }
- }
- }
- }
- }
-
- /**
- * Return a list of documentation elements from the given annotation. Working
- * with documentation elements requires dropping down into the DOM model.
- *
- * @param annotation -
- * an XSDAnnotation node.
- * @return a list of documentation elements.
- */
- public static CMNodeList getDocumentations(XSDAnnotation annotation)
- {
- CMNodeListImpl documentations = new CMNodeListImpl();
- if (annotation != null)
- {
- List documentationsElements = annotation.getUserInformation();
- for (Iterator i = documentationsElements.iterator(); i.hasNext();)
- {
- documentations.getList().add(new DocumentationImpl((Element) i.next()));
- }
- }
- return documentations;
- }
-
- /**
- * Adapted from public static List findTypesDerivedFrom(XSDSchema schema,
- * String namespace, String localName) in class XSDSchemaQueryTools found in
- * org.eclipse.xsd plugin.
- *
- * Find typeDefinitions that derive from a given type.
- *
- * @param type
- * the type derived from
- * @return List of any XSDTypeDefinitions found
- */
- public static List findTypesDerivedFrom(XSDTypeDefinition type)
- {
- ArrayList typesDerivedFrom = new ArrayList();
- if (type != null)
- {
- XSDSchema schema = type.getSchema();
- String localName = type.getName();
- if ((null != schema) && (null != localName))
- {
- String namespace = schema.getTargetNamespace();
- // A handy convenience method quickly gets all
- // typeDefinitions within our schema; note that
- // whether or not this returns types in included,
- // imported, or redefined schemas is subject to change
- List typedefs = schema.getTypeDefinitions();
- for (Iterator iter = typedefs.iterator(); iter.hasNext();)
- {
- XSDTypeDefinition typedef = (XSDTypeDefinition) iter.next();
- if (typedef instanceof XSDComplexTypeDefinition)
- {
- // Walk the baseTypes from this typedef seeing if any
- // of them match the requested one
- if (isTypeDerivedFrom(typedef, namespace, localName))
- {
- // We found it, return the original one and continue
- typesDerivedFrom.add(typedef);
- continue;
- }
- }
- }
- }
- }
- return typesDerivedFrom;
- }
-
- /**
- * Adapted from protected static boolean isTypeDerivedFrom(XSDTypeDefinition
- * typedef, String namespace, String localName) in class XSDSchemaQueryTools
- * found in org.eclipse.xsd plugin.
- *
- * Recursive worker method to find typeDefinitions that derive from a named
- * type.
- *
- * @see #findTypesDerivedFrom(XSDSchema, String, String)
- * @param typeDef
- * to see if it's derived from
- * @param namespace
- * for the type derived from
- * @param localName
- * for the type derived from
- * @return true if it is; false otherwise
- */
- protected static boolean isTypeDerivedFrom(XSDTypeDefinition typedef, String namespace, String localName)
- {
- // Walk the baseTypes from this typedef seeing if any
- // of them match the requested one
- XSDTypeDefinition baseType = typedef.getBaseType();
- if (baseType == null)
- {
- // typedef is a root type like xsd:anyType, so it has no base
- return false;
- }
-
- // As this convenience method if our parameters match
- if (baseType.hasNameAndTargetNamespace(localName, namespace))
- {
- return true;
- }
- XSDTypeDefinition rootType = typedef.getRootType();
-
- if (rootType == baseType)
- {
- // If we've hit the root, we aren't derived from it
- return false;
- }
- else
- {
- // Need to check if the base type is redefined/circular
- // otherwise this will be an endless recursive call.
- // Moved. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=213543
- // This method should be replaced with XSDConstants.isOrIsDerivedFrom(baseType, localName, namespace);
- if (rootType.isCircular())
- {
- return true;
- }
- // Otherwise continue to traverse upwards
- return isTypeDerivedFrom(baseType, namespace, localName);
- }
- }
-
- /**
- * Returns the corresponding cmnode of the specified XML Schema node.
- *
- * @param target -
- * an XML Schema node
- * @return the corresponding cmnode.
- */
- public static CMNode getAdapter(Notifier o)
- {
- return (CMNode) xsdAdapterFactoryImpl.adapt(o);
- }
-
- /**
- * Adapted from public String getPrefix(String ns, boolean withColon) in class
- * TypesHelper found in org.eclipse.wst.xsd.editor plugin.
- *
- * @param schema -
- * the relevant schema
- * @param ns -
- * the relevant namespace
- */
- public static String getPrefix(XSDSchema schema, String ns)
- {
- String key = "";
- if ((schema != null) && (ns != null))
- {
- Map map = schema.getQNamePrefixToNamespaceMap();
- Iterator iter = map.keySet().iterator();
- while (iter.hasNext())
- {
- Object keyObj = iter.next();
- Object value = map.get(keyObj);
- if (value != null && value.toString().equals(ns))
- {
- if (keyObj != null)
- {
- key = keyObj.toString();
- }
- else
- {
- key = "";
- }
- break;
- }
- }
- }
- return key;
- }
- /**
- * The Factory for the XSD adapter model. It provides a create method for each
- * non-abstract class of the model.
- */
- public static class XSDAdapterFactoryImpl extends AdapterFactoryImpl
- {
- public Adapter createAdapter(Notifier target)
- {
- XSDSwitch xsdSwitch = new XSDSwitch()
- {
- public Object caseXSDWildcard(XSDWildcard object)
- {
- return new XSDWildcardAdapter(object);
- }
-
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
- {
- return new XSDModelGroupDefinitionAdapter(object);
- }
-
- public Object caseXSDAttributeUse(XSDAttributeUse object)
- {
- return new XSDAttributeUseAdapter(object);
- }
-
- public Object caseXSDElementDeclaration(XSDElementDeclaration object)
- {
- return new XSDElementDeclarationAdapter(object);
- }
-
- public Object caseXSDModelGroup(XSDModelGroup object)
- {
- return new XSDModelGroupAdapter(object);
- }
-
- public Object caseXSDSchema(XSDSchema object)
- {
- return new XSDSchemaAdapter(object);
- }
- };
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter)
- {
- result = (Adapter) o;
- }
- else
- {
- Thread.dumpStack();
- }
- return result;
- }
-
- public Adapter adapt(Notifier target)
- {
- return adapt(target, this);
- }
- }
- /**
- * XSDBaseAdapter -- an abstract base node in the model. All other model nodes
- * are derived from it.
- */
- public static abstract class XSDBaseAdapter extends CMNodeImpl
- {
- protected CMNodeListImpl documentation = new CMNodeListImpl();
-
- /**
- * Returns the name of the node. The default value is an empty string value.
- * All derived classes must override this method if they do not want the
- * default value.
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- return "";
- }
-
- /**
- * Returns true of the given factory is the factory for this XSD adapter
- * model.
- *
- * @param type -
- * a factory
- * @return true if the type is the adapter factory for this model.
- */
- public boolean isAdapterForType(Object type)
- {
- return type == xsdAdapterFactoryImpl;
- }
-
- /**
- * Returns true if the property is supported for this class.
- *
- * @param propertyName -
- * name of a property
- * @return true if the property is supported.
- */
- public boolean supports(String propertyName)
- {
- return propertyName.equals(PROPERTY_NS_PREFIX_QUALIFICATION) || propertyName.equals(PROPERTY_NILLABLE) || propertyName.equals(PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS)
- || propertyName.equals(PROPERTY_DOCUMENTATION) || propertyName.equals(PROPERTY_DOCUMENTATION_SOURCE) || propertyName.equals(PROPERTY_DOCUMENTATION_LANGUAGE)
- || propertyName.equals(PROPERTY_MOF_NOTIFIER) || propertyName.equals(PROPERTY_DEFINITION_INFO) || propertyName.equals(PROPERTY_DEFINITION) || propertyName.equals(PROPERTY_CMDOCUMENT)
- || propertyName.equals(PROPERTY_IS_NAME_SPACE_AWARE) || propertyName.equals(PROPERTY_SPEC) || super.supports(propertyName);
- }
-
- /**
- * Returns the value of the 'Nillable' attribute. This represents the
- * nillable infoset property. The default value is false. All derived
- * classes must override this method if they do not want the default value.
- *
- * @return the value of the 'Nillable' attribute.
- */
- public boolean isNillable()
- {
- return false;
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode. The default
- * value is null; All derived classes must override this method if they do
- * not want the default value.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return null;
- }
-
- /**
- * Return a list of documentation elements. The default value is an empty
- * CMNodeList; All derived classes must override this method if they do not
- * want the default value.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- return documentation;
- }
-
- /**
- * Returns the property value for the property name. Returns null if the
- * property is not supported.
- *
- * @param propertyName -
- * name of a property
- * @return the property value for the property name.
- */
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals(PROPERTY_CMDOCUMENT))
- {
- result = getCMDocument();
- }
- else if (propertyName.equals(PROPERTY_DOCUMENTATION))
- {
- result = getDocumentation();
- }
- else if (propertyName.equals(PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS))
- {
- result = Boolean.TRUE;
- }
- else if (propertyName.equals(PROPERTY_IS_NAME_SPACE_AWARE))
- {
- result = Boolean.TRUE;
- }
- else if (propertyName.equals(PROPERTY_NS_PREFIX_QUALIFICATION))
- {
- result = getNSPrefixQualification();
- }
- else if (propertyName.equals(PROPERTY_NILLABLE))
- {
- result = isNillable() ? xsiDocument.nilAttribute : null;
- }
- else if (propertyName.equals(PROPERTY_MOF_NOTIFIER))
- {
- result = getKey();
- }
- else if (propertyName.equals(PROPERTY_SPEC))
- {
- result = getSpec();
- }
- else
- {
- result = super.getProperty(propertyName);
- {
- CMDocument cmDocument = getCMDocument();
- if (cmDocument instanceof XSDSchemaAdapter)
- {
- AnnotationMap map = ((XSDSchemaAdapter) cmDocument).annotationMap;
- if (map != null)
- {
- String spec = getSpec();
- if (spec != null)
- {
- result = map.getProperty(getSpec(), propertyName);
- }
- }
- }
- }
- }
- return result;
- }
-
-
-
- /*
- * Returns the value of the form [attribute] which affects the target
- * namespace of locally scoped features. The default value is null. All
- * derived classes must override this method if they do not want the default
- * value. @return the value of the form [attribute].
- */
- public Object getNSPrefixQualification()
- {
- return null;
- }
-
- /**
- * Returns a general XPath expression for the node.
- *
- * @return a general XPath expression for the node.
- */
- public String getSpec()
- {
- return "//" + getNodeName();
- }
- }
- /**
- * XSDSchemaAdapter implements CMDocument. A representation of the model
- * object 'Schema'.
- */
- public static class XSDSchemaAdapter extends XSDBaseAdapter implements CMDocument
- {
- protected XSDSchema xsdSchema;
- protected CMNamedNodeMapImpl namedNodeMap;
- protected CMNamedNodeMapImpl entityNodeMap;
- protected AnnotationMap annotationMap = new AnnotationMap();
- protected Hashtable substitutionGroupTable;
-
- /**
- * Constructor.
- *
- * @param xsdSchema -
- * the schema node.
- */
- public XSDSchemaAdapter(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdSchema;
- }
-
- /**
- * Returns the filename.
- *
- * @return the filename.
- */
- public String getNodeName()
- {
- // See buildCMDocument() above.
- return xsdSchema.getSchemaLocation();
- }
-
- /**
- * Returns true if the property is supported for this class.
- *
- * @param propertyName -
- * name of a property
- * @return true if the property is supported.
- */
- public boolean supports(String propertyName)
- {
- return propertyName.equals(PROPERTY_TARGET_NAMESPACE_URI) || propertyName.equals(PROPERTY_IMPORTED_NAMESPACE_INFO) || propertyName.equals(PROPERTY_NAMESPACE_INFO)
- || propertyName.equals(PROPERTY_ELEMENT_FORM_DEFAULT) || propertyName.equals(PROPERTY_ANNOTATION_MAP) || super.supports(propertyName);
- }
-
- /**
- * Returns true if a prefix is globally required for elements.
- *
- * @param xsdSchema -
- * the corresponding schema node.
- * @return true if a prefix is globally required for elements.
- */
- protected boolean isPrefixRequired(XSDSchema xsdSchema)
- {
- boolean result = true;
- if (xsdSchema.isSetElementFormDefault())
- result = !(xsdSchema.getElementFormDefault().getValue() == XSDForm.QUALIFIED);
- return result;
- }
-
- /**
- * Returns the property value for the property name. Returns null if the
- * property is not supported.
- *
- * @param propertyName -
- * name of a property
- * @return the property value for the property name.
- */
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals(PROPERTY_TARGET_NAMESPACE_URI))
- {
- result = xsdSchema.getTargetNamespace();
- }
- else if (propertyName.equals(PROPERTY_IMPORTED_NAMESPACE_INFO))
- {
- List list = new Vector();
- getImportedNamespaceInfo(xsdSchema, list);
- result = list;
- }
- else if (propertyName.equals(PROPERTY_NAMESPACE_INFO))
- {
- List list = new Vector();
- NamespaceInfo info = new NamespaceInfo();
- info.uri = xsdSchema.getTargetNamespace();
- info.prefix = getPrefix(xsdSchema, info.uri);
- info.locationHint = null; // note that this locationHint info is null
- // for the root xsd file
- info.isPrefixRequired = isPrefixRequired(xsdSchema);
- list.add(info);
- getImportedNamespaceInfo(xsdSchema, list);
- result = list;
- }
- else if (propertyName.equals(PROPERTY_COMPLETE_NAMESPACE_INFO))
- {
- result = getAllNamespaceInfo();
- }
- else if (propertyName.equals(PROPERTY_ELEMENT_FORM_DEFAULT))
- {
- result = xsdSchema.getElementFormDefault().getName();
- }
- else if (propertyName.equals(PROPERTY_ANNOTATION_MAP))
- {
- result = annotationMap;
- }
- else if (propertyName.equals("allElements"))
- {
- result = getAllElements();
- }
- else if (propertyName.startsWith("getElementForType#"))
- {
- int index = propertyName.indexOf("#");
- String typeName = propertyName.substring(index + 1, propertyName.length());
- //
- //
- XSDTypeDefinition td = xsdSchema.resolveTypeDefinition(typeName);
- if (td != null)
- {
- LocalElementVisitor localElementVisitor = new LocalElementVisitor();
- localElementVisitor.visitTypeDefinition(td);
- result = localElementVisitor.getCMNamedNodeMap();
- }
- }
- else
- {
- result = super.getProperty(propertyName);
- }
- return result;
- }
-
- /**
- * Gather information on namespaces used in external references.
- *
- * @param theXSDSchema -
- * the corresponding schema node
- * @param list -
- * the list of imported namespaces.
- */
- public void getImportedNamespaceInfo(XSDSchema theXSDSchema, List list)
- {
- for (Iterator iterator = theXSDSchema.getContents().iterator(); iterator.hasNext();)
- {
- XSDSchemaContent content = (XSDSchemaContent) iterator.next();
- if (content instanceof XSDImport)
- {
- XSDImport xImport = (XSDImport) content;
- XSDSchema importedXSDSchema = xImport.getResolvedSchema();
- NamespaceInfo info = new NamespaceInfo();
- info.uri = xImport.getNamespace();
- info.prefix = getPrefix(importedXSDSchema, info.uri);
- info.locationHint = xImport.getSchemaLocation();
- if (importedXSDSchema != null)
- {
- info.isPrefixRequired = isPrefixRequired(importedXSDSchema);
- }
- list.add(info);
- }
- }
- }
-
- /**
- * Returns set of named (top-level) element declarations for this schema
- * node.
- *
- * @return a set of named (top-level) element declarations.
- */
- public CMNamedNodeMap getElements()
- {
- if (namedNodeMap == null)
- {
- namedNodeMap = new CMNamedNodeMapImpl();
-
- // Note that if we call xsdSchema.getElementDeclarations()
- // we get 'more' elements than we really want since we also
- // get 'imported' elements. Below we test to ensure the elements
- // actually have the same target namespace as the schema.
- String targetNamespace = xsdSchema.getTargetNamespace();
- for (Iterator i = xsdSchema.getElementDeclarations().iterator(); i.hasNext();)
- {
- XSDElementDeclaration ed = (XSDElementDeclaration) i.next();
- if (targetNamespace != null ? targetNamespace.equals(ed.getTargetNamespace()) : ed.getTargetNamespace() == null)
- {
- XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) getAdapter(ed);
- namedNodeMap.getHashtable().put(adapter.getNodeName(), adapter);
- }
- }
- }
- return namedNodeMap;
- }
-
- /**
- * Returns the built-in entity declarations.
- *
- * @return the built-in entity declarations.
- */
- public CMNamedNodeMap getEntities()
- {
- if (entityNodeMap == null)
- {
- entityNodeMap = new CMNamedNodeMapImpl();
- // add the built in entity declarations
- entityNodeMap.getHashtable().put("amp", new CMEntityDeclarationImpl("amp", "&"));
- entityNodeMap.getHashtable().put("lt", new CMEntityDeclarationImpl("lt", "<"));
- entityNodeMap.getHashtable().put("gt", new CMEntityDeclarationImpl("gt", ">"));
- entityNodeMap.getHashtable().put("quot", new CMEntityDeclarationImpl("quot", "\""));
- entityNodeMap.getHashtable().put("apos", new CMEntityDeclarationImpl("apos", "'"));
- }
- return entityNodeMap;
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return DOCUMENT;
- }
-
- /*
- * Returns null. !!! Why are we not implementing this???? @return null.
- */
- public CMNamespace getNamespace()
- {
- return null;
- }
-
- /**
- * Returns this.
- *
- * @return this.
- */
- public CMDocument getCMDocument()
- {
- return this;
- }
-
- public CMNamedNodeMap getAllElements()
- {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- for (Iterator i = getElements().iterator(); i.hasNext(); )
- {
- CMElementDeclaration ed = (CMElementDeclaration)i.next();
- map.put(ed);
- addLocalElementDefinitions(map, ed);
- }
- return map;
- }
-
- protected void addLocalElementDefinitions(CMNamedNodeMapImpl map, CMElementDeclaration parentElementDeclaration)
- {
- CMNamedNodeMap localElementMap = parentElementDeclaration.getLocalElements();
- for (Iterator i = localElementMap.iterator(); i.hasNext(); )
- {
- CMElementDeclaration ed = (CMElementDeclaration)i.next();
- if (map.getNamedItem(ed.getNodeName()) == null)
- {
- map.put(ed);
- addLocalElementDefinitions(map, ed);
- }
- }
- }
-
-
- /**
- * Generates a List of NamespaceInfo objects corresponding to the target namespace of the given schema
- * and the target namespaces of all its recursively imported/included referenced schemas. All namespace
- * prefixes in the list are guaranteed to be unique. Prefix collitions are resolved by concatenating
- * integer numbers to each repeated prefix found i.e. tns, tns1, tns2...
- * All schema locations in the list are formated as encoded URIs relative to the given schema.
- * Schemas that are imported/included but not referenced will not appear in the list.
- * @return List of NamespaceInfo objects
- *
- */
- public List getAllNamespaceInfo() {
- List namespaceList = new ArrayList();
- List resources = xsdSchema.eResource().getResourceSet().getResources();
- Iterator i = resources.iterator();
- while(i.hasNext()) {
- XSDResourceImpl resource = (XSDResourceImpl) i.next();
- if(resource.isLoaded()) {
- XSDSchema schema = resource.getSchema();
- if(!isDataInNamespaceList(namespaceList, 0, schema.getTargetNamespace())) {
- NamespaceInfo info = new NamespaceInfo();
- info.uri = schema.getTargetNamespace();
- info.isPrefixRequired = isPrefixRequired(schema);
- info.prefix = getPrefix(schema,schema.getTargetNamespace());
- if("http://www.w3.org/XML/1998/namespace".equals(info.uri)) {
- info.prefix = "xml";
- } else if("http://www.w3.org/2000/xmlns".equals(info.uri)) {
- info.prefix = "xmlns";
- } else {
- if(info.uri != null && info.uri != "") {
- int n = 1;
- if(info.prefix == null || info.prefix.equals("")) {
- info.prefix = "p";
- }
- String prefix = info.prefix;
- while(isDataInNamespaceList(namespaceList, 1, info.prefix)) {
- info.prefix = prefix + n++;
- }
- }
- }
- URI relative = URI.createURI(xsdSchema.getSchemaLocation(), true);
- URI absolute = URI.createURI(schema.getSchemaLocation(), true);
- URI resolvedRelative = absolute.deresolve(relative);
- info.locationHint = resolvedRelative.toString();
- namespaceList.add(info);
- }
- }
- }
- return namespaceList;
- }
-
-
- /**
- * Searches for a given value in a list of namespaces.
- *
- * @param namespaceList: List of NamespaceInfo objects
- * @param data: integer representing the data in the namespace as follows:
- * 0: uri
- * 1: prefix
- * 2: locationHint
- * @param value String containing the value for search
- * @return true if the value is found, false otherwise
- */
- private boolean isDataInNamespaceList(List namespaceList, int data, String value) {
- if (namespaceList != null) {
- Iterator i = namespaceList.iterator();
- while (i.hasNext()) {
- NamespaceInfo namespaceInfo = (NamespaceInfo) i.next();
- switch(data) {
- case 0: if (namespaceInfo.uri != null && namespaceInfo.uri.equals(value)) {
- return true;
- }
- case 1: if (namespaceInfo.prefix != null && namespaceInfo.prefix.equals(value)) {
- return true;
- }
- case 2: if (namespaceInfo.locationHint != null && namespaceInfo.locationHint.equals(value)) {
- return true;
- }
- }
- }
- }
- return false;
- }
- }
- /**
- * XSDAttributeUseAdapter implements CMAttributeDeclaration. A representation
- * of the model object 'Attribute Use'.
- */
- public static class XSDAttributeUseAdapter extends XSDBaseAdapter implements CMAttributeDeclaration
- {
- // provides access to the XML Schema node
- protected XSDAttributeUse xsdAttributeUse;
- // provides access to the type of the attribute
- protected CMDataType dataType = new DataTypeImpl();
-
- /**
- * Constructor.
- *
- * @param xsdAttributeUse -
- * the XML Schema node.
- */
- public XSDAttributeUseAdapter(XSDAttributeUse xsdAttributeUse)
- {
- this.xsdAttributeUse = xsdAttributeUse;
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdAttributeUse;
- }
-
- /**
- * Returns a general XPath expression for the node.
- *
- * @return a general XPath expression for the node.
- */
- public String getSpec()
- {
- return "//@" + getAttrName();
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return ATTRIBUTE_DECLARATION;
- }
-
- /**
- * Returns the name of the node. Similar to getAttrName().
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- return getAttrName();
- }
-
- /**
- * getEnumAttr method
- *
- * @return java.util.Enumeration
- * @deprecated -- to be replaced in future with additional CMDataType
- * methods (currently found on CMDataTypeHelper)
- */
- public Enumeration getEnumAttr()
- {
- return Collections.enumeration(Collections.EMPTY_LIST);
- }
-
- /**
- * Returns the name of this attribute. Similar to getNodeName().
- *
- * @return the name of this attribute.
- */
- public String getAttrName()
- {
- return xsdAttributeUse.getAttributeDeclaration().getName();
- }
-
- /**
- * Returns the type of the attribute.
- *
- * @return the type of the attribute.
- */
- public CMDataType getAttrType()
- {
- return dataType;
- }
-
- /**
- * Returns the value of the default or fixed constraint.
- *
- * @return the value of the default or fixed constraint.
- */
- public String getDefaultValue()
- {
- return dataType.getImpliedValue();
- }
-
- /**
- * Returns the usage constraint for this attribute. The usages are defined
- * in CMAttributeDeclaration class (OPTIONAL, REQUIRED, FIXED or
- * PROHIBITED).
- *
- * @return the usage constraint for this attribute.
- */
- public int getUsage()
- {
- int useKind = OPTIONAL;
- switch (xsdAttributeUse.getUse().getValue())
- {
- case XSDAttributeUseCategory.OPTIONAL : {
- useKind = OPTIONAL;
- break;
- }
- case XSDAttributeUseCategory.PROHIBITED : {
- useKind = PROHIBITED;
- break;
- }
- case XSDAttributeUseCategory.REQUIRED : {
- useKind = REQUIRED;
- break;
- }
- }
- return useKind;
- }
-
- /*
- * Returns the value of the form [attribute] which affects the target
- * namespace of locally scoped features. If the form is not set on this
- * attribute, then see if there is a globally defined default. @return the
- * value of the form [attribute].
- */
- public Object getNSPrefixQualification()
- {
- String form = null;
- if (xsdAttributeUse.getContent() != xsdAttributeUse.getAttributeDeclaration())
- {
- form = "qualified";
- }
- else if (xsdAttributeUse.getContent().isSetForm())
- {
- form = xsdAttributeUse.getContent().getForm().getName();
- }
- else
- {
- XSDSchema schema = xsdAttributeUse.getSchema();
- if (schema != null)
- form = schema.getAttributeFormDefault().getName();
- }
- return form;
- }
-
- /**
- * Return a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- // Check if it is an attribute reference first
- XSDAttributeDeclaration xsdAttributeRef = xsdAttributeUse.getContent();
- if (xsdAttributeRef != null && xsdAttributeRef.isAttributeDeclarationReference())
- {
- // Determine if it has annotations
- boolean refHasDocumentation = false;
- XSDAnnotation refAnnotation = xsdAttributeRef.getAnnotation();
- if (refAnnotation != null)
- {
- // Determine if there is documentation
- if (!refAnnotation.getUserInformation().isEmpty())
- {
- refHasDocumentation = true;
- }
- }
- if (refHasDocumentation)
- return getDocumentations(refAnnotation);
- }
-
- // Otherwise proceed with getting the documentation as usual
- XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
- XSDAnnotation annotation = xsdAttributeDeclaration.getAnnotation();
-
- return getDocumentations(annotation);
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return (CMDocument) getAdapter(xsdAttributeUse.getSchema());
- }
- /**
- * XSDAttributeUseAdapter.DataTypeImpl An inner class to hold type
- * information for this attribute.
- */
- public class DataTypeImpl implements CMDataType
- {
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return CMNode.DATA_TYPE;
- }
-
- /**
- * Returns the name of the attribute type. Same as getDataTypeName().
- *
- * @return the name of the attribute type.
- */
- public String getNodeName()
- {
- return getDataTypeName();
- }
-
- /**
- * Returns true if the property is supported for this class.
- *
- * @param propertyName -
- * name of a property
- * @return true if the property is supported.
- */
- public boolean supports(String propertyName)
- {
- return (PROPERTY_WHITESPACE_FACET.equals(propertyName));
- }
-
- /**
- * Returns the property value for the property name. Returns null if the
- * property is not supported.
- *
- * @param propertyName -
- * name of a property
- * @return the property value for the property name.
- */
- public Object getProperty(String propertyName)
- {
- if(PROPERTY_WHITESPACE_FACET.equals(propertyName))
- return getWhiteSpaceFacetValue();
- return null;
- }
-
- /**
- * Returns the name of the attribute type. Same as getNodeName().
- *
- * @return the name of the attribute type.
- */
- public String getDataTypeName()
- {
- XSDSimpleTypeDefinition sc = xsdAttributeUse.getAttributeDeclaration().getTypeDefinition();
- String typeName = sc.getName();
- return typeName != null ? typeName : "string"; //$NON-NLS-1$
- }
-
- /**
- * Returns the kind of constraint: none, default or fixed. The kinds are
- * defined in CMDataType class (IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED or
- * IMPLIED_VALUE_DEFAULT).
- *
- * @return the kind of constraint: none, default or fixed.
- */
- public int getImpliedValueKind()
- {
- int result = IMPLIED_VALUE_NONE;
- if (xsdAttributeUse.isSetConstraint())
- {
- if (xsdAttributeUse.getConstraint().getValue() == XSDConstraint.DEFAULT)
- result = IMPLIED_VALUE_DEFAULT;
- else if (xsdAttributeUse.getConstraint().getValue() == XSDConstraint.FIXED)
- result = IMPLIED_VALUE_FIXED;
- }
- return result;
- }
-
- /**
- * Returns the value of the default or fixed constraint.
- *
- * @return the value of the default or fixed constraint.
- */
- public String getImpliedValue()
- {
- String result = null;
- if (xsdAttributeUse.isSetConstraint())
- {
- result = xsdAttributeUse.getLexicalValue();
- }
- return result;
- }
-
- /**
- * Returns the enumerated values for the attribute type.
- *
- * @return the enumerated values for the attribute type.
- */
- public String[] getEnumeratedValues()
- {
- return getEnumeratedValuesForType(getXSDType());
- }
-
- /**
- * Generate a valid value for the attribute based on its type.
- *
- * @return a valid value for the attribute based on its type.
- */
- public String generateInstanceValue()
- {
- XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
- return XSDTypeUtil.getInstanceValue(attr.getResolvedAttributeDeclaration().getTypeDefinition());
- }
-
- /**
- * Returns the corresponding XML Schema type definition.
- *
- * @return the corresponding XML Schema type definition.
- */
- protected XSDTypeDefinition getXSDType()
- {
- XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
- return attr.getResolvedAttributeDeclaration().getTypeDefinition();
- }
-
- /**
- * Obtains the whitespace facet of the XSD simple type.
- *
- * @return The whitespace facet for the XSD type. If none is
- * defined, or it is a complex type, null.
- */
- private String getWhiteSpaceFacetValue()
- {
- XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
- return (def != null && def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null ;
- }
- }
- }
- /**
- * ElementDeclarationBaseImpl implements CMElementDeclaration. This is the
- * base class for XSDElementDeclaration and DerivedElementDeclarationImpl.
- *
- * Abstract methods in this class are: public abstract Object getKey(); public
- * abstract Object getNSPrefixQualification(); public abstract
- * XSDElementDeclaration getXSDElementDeclaration(); public abstract
- * XSDTypeDefinition getXSDType(); public abstract List getXSITypes(); public
- * abstract CMElementDeclaration getDerivedElementDeclaration(String
- * uriQualifiedTypeName); public abstract CMNode getDefinition(); public
- * abstract String getDefinitionInfo(); public abstract CMNodeListImpl
- * getSubstitutionGroup();
- */
- public static abstract class ElementDeclarationBaseImpl extends XSDBaseAdapter implements CMElementDeclaration
- {
- protected CMDataType dataType = new DataTypeImpl();
- protected CMNamedNodeMap namedNodeMap;
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected abstract XSDElementDeclaration getXSDElementDeclaration();
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected abstract XSDElementDeclaration getResolvedXSDElementDeclaration();
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return ELEMENT_DECLARATION;
- }
-
- /**
- * Returns the name of the node. The same as getElementName().
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- return getElementName();
- }
-
- /**
- * Returns the name of this element. The same as getNodeName().
- *
- * @return the name of this element.
- */
- public String getElementName()
- {
- String result = getResolvedXSDElementDeclaration().getName();
- return result != null ? result : "";
- }
-
- /**
- * Returns true if the property is supported for this class.
- *
- * @param propertyName -
- * name of a property
- * @return true if the property is supported.
- */
- public boolean supports(String propertyName)
- {
- return propertyName.equals(PROPERTY_XSITYPES) || propertyName.equals(PROPERTY_DERIVED_ELEMENT_DECLARATION) || propertyName.equals(PROPERTY_SUBSTITUTION_GROUP)
- || propertyName.equals(PROPERTY_ABSTRACT) || super.supports(propertyName);
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public abstract Object getKey();
-
- /**
- * Returns the set of attributes defined for this element.
- *
- * @return the set of attributes defined for this element.
- */
- public CMNamedNodeMap getAttributes()
- {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- XSDTypeDefinition td = getXSDType();
- getAttributes(map, td);
- addXSITypeAttribute(map);
- return map;
- }
-
- /**
- * Gather the set of attributes defined for this element.
- *
- * @param map -
- * used for returning the set of attributes.
- * @param xsdTypeDefinition -
- * the type definition for this element.
- */
- public void getAttributes(CMNamedNodeMapImpl map, XSDTypeDefinition xsdTypeDefinition)
- {
- if (xsdTypeDefinition instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition) xsdTypeDefinition;
- for (Iterator i = ctd.getAttributeUses().iterator(); i.hasNext();)
- {
- XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) i.next();
- XSDAttributeUseAdapter adapter = (XSDAttributeUseAdapter) getAdapter(xsdAttributeUse);
- if (adapter != null && adapter.getNodeName() != null)
- {
- map.getHashtable().put(adapter.getNodeName(), adapter);
- }
- }
- }
- }
-
- /**
- * Returns the content for this element.
- *
- * @return the content for this element.
- */
- public CMContent getContent()
- {
- CMContent result = null;
- XSDTypeDefinition td = getXSDType();
- if (td instanceof XSDComplexTypeDefinition)
- {
- DerivedChildVisitor dcv = new DerivedChildVisitor(td);
- dcv.visitTypeDefinition(td);
- CMNodeList nodeList = dcv.getChildNodeList();
- if (nodeList.getLength() > 1)
- {
- result = new CMGroupImpl(nodeList, CMGroup.SEQUENCE);
- }
- else if (nodeList.getLength() > 0)
- {
- result = (CMContent) nodeList.item(0);
- }
- }
- return result;
- }
-
- /**
- * Returns the content type of this element. The content type is defined in
- * CMElementDeclaration (ANY, EMPTY, ELEMENT, MIXED, PCDATA or CDATA).
- *
- * @return the content type of this element.
- */
- public int getContentType()
- {
- int contentType = EMPTY;
- XSDTypeDefinition td = getXSDType();
- if (td instanceof XSDSimpleTypeDefinition)
- {
- String typeName = td.getName();
- if (typeName != null && typeName.equals("anyType"))
- {
- contentType = ANY;
- }
- else
- {
- contentType = PCDATA;
- }
- }
- else if (td instanceof XSDComplexTypeDefinition)
- {
- XSDContentTypeCategory category = ((XSDComplexTypeDefinition) td).getContentTypeCategory();
- if (category != null)
- {
- switch (category.getValue())
- {
- case XSDContentTypeCategory.ELEMENT_ONLY :
- contentType = ELEMENT;
- break;
- case XSDContentTypeCategory.EMPTY :
- contentType = EMPTY;
- break;
- case XSDContentTypeCategory.MIXED :
- contentType = MIXED;
- break;
- case XSDContentTypeCategory.SIMPLE :
- contentType = PCDATA;
- break;
- }
- }
- }
- return contentType;
- }
-
- /**
- * Returns the name of the element type.
- *
- * @return the name of the element type.
- */
- public CMDataType getDataType()
- {
- CMDataType result = null;
- int contentType = getContentType();
- boolean hasDataType = contentType == PCDATA || contentType == MIXED;
- if (hasDataType)
- {
- result = dataType;
- }
- return result;
- }
-
- /**
- * Returns the value of 'Min Occurs' attribute. The default value is "1".
- *
- * @return the value of the 'Min Occurs' attribute.
- */
- public int getMinOccur()
- {
- return getMinOccurs(getXSDElementDeclaration());
- }
-
- /**
- * Returns the value of the 'Max Occurs' attribute. The default value is
- * "1".
- *
- * @return the value of the 'Max Occurs' attribute.
- */
- public int getMaxOccur()
- {
- return getMaxOccurs(getXSDElementDeclaration());
- }
-
- /**
- * Returns the referenced element declaration if this is an element
- * reference. Otherwise it returns itself.
- *
- * @return an element declaration.
- */
- protected abstract CMNode getDefinition();
-
- /**
- * Returns a string indicating whether the element declaration is global or
- * local. Returns null if this is an element reference.
- *
- * @return a string indicating whether the element declaration is global or
- * local.
- */
- protected abstract String getDefinitionInfo();
-
- /**
- * Returns the elements local to this element declaration.
- *
- * @return the elements local to this element declaration.
- */
- public CMNamedNodeMap getLocalElements()
- {
- if (namedNodeMap == null)
- {
- LocalElementVisitor localElementVisitor = new LocalElementVisitor();
- localElementVisitor.visitTypeDefinition(getXSDType());
- namedNodeMap = localElementVisitor.getCMNamedNodeMap();
- }
- return namedNodeMap;
- }
-
- /**
- * Returns the property value for the property name. Returns null if the
- * property is not supported.
- *
- * @param propertyName -
- * name of a property
- * @return the property value for the property name.
- */
- public Object getProperty(String propertyName)
- {
- Object result = null;
- if (propertyName.equals(PROPERTY_DEFINITION_INFO))
- {
- result = getDefinitionInfo();
- }
- else if (propertyName.equals(PROPERTY_DEFINITION))
- {
- result = getDefinition();
- }
- else if (propertyName.equals(PROPERTY_XSITYPES))
- {
- result = getXSITypes();
- }
- else if (propertyName.startsWith(PROPERTY_DERIVED_ELEMENT_DECLARATION))
- {
- int index = propertyName.indexOf("=");
- if (index != -1)
- {
- String uriQualifiedTypeName = propertyName.substring(index + 1);
- result = getDerivedElementDeclaration(uriQualifiedTypeName);
- }
- }
- else if (propertyName.equals(PROPERTY_SUBSTITUTION_GROUP))
- {
- return getSubstitutionGroup();
- }
- else if (propertyName.equals(PROPERTY_SUBSTITUTION_GROUP_VALUE))
- {
- return getSubstitutionGroupValue();
- }
- else if (propertyName.equals(PROPERTY_ABSTRACT))
- {
- return getAbstract();
- }
- else
- {
- result = super.getProperty(propertyName);
- }
- return result;
- }
-
- /**
- * Returns the value of the 'Nillable' attribute. This represents the
- * nillable infoset property. The default value is false.
- *
- * @return the value of the 'Nillable' attribute.
- */
- public boolean isNillable()
- {
- if (getXSDElementDeclaration().isSetNillable())
- return getXSDElementDeclaration().isNillable();
- else
- return false;
- }
-
- /**
- * Returns the value of the substitutionGroup attribute.
- *
- * @return value of the substitutionGroup attribute
- */
- public String getSubstitutionGroupValue()
- {
- XSDElementDeclaration xsdElementDeclaration = getResolvedXSDElementDeclaration();
- if(xsdElementDeclaration != null)
- {
- Element element = xsdElementDeclaration.getElement();
- if(element != null)
- {
- if (element.hasAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
- return element.getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE);
- else return null;
- }
- }
- return "";
- }
-
-
- /**
- * Returns whether the element is 'Abstract'.
- *
- * @return true if the element is 'Abstract'.
- */
- public Boolean getAbstract()
- {
- boolean result = getResolvedXSDElementDeclaration().isAbstract();
- // TODO... how do we handle elements with abstract type's ?
- return result ? Boolean.TRUE : Boolean.FALSE;
- }
-
- /**
- * Returns a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- XSDElementDeclaration xsdElementDeclaration = getXSDElementDeclaration();
- XSDAnnotation annotation = xsdElementDeclaration.getAnnotation();
-
- // Need to check to see if there are any documentation elements. Just because
- // there is an annotation element doesn't mean that the documentation element is
- // also there, as it could contain just appinfo elements.
-
- boolean hasDocumentation = false;
-
- if (annotation != null) {
- if (!annotation.getUserInformation().isEmpty()) {
- hasDocumentation = true;
- }
- }
-
- // The element may not have annotation and if it is referenced
- // check the referenced attribute for the annotations.
- if (hasDocumentation == false) {
- if (xsdElementDeclaration.isElementDeclarationReference()) {
- annotation = xsdElementDeclaration.getResolvedElementDeclaration().getAnnotation();
- }
- }
-
- return getDocumentations(annotation);
- }
-
- /**
- * Returns the corresponding XML Schema type definition.
- *
- * @return the corresponding XML Schema type definition.
- */
- protected abstract XSDTypeDefinition getXSDType();
-
- /**
- * Returns a list of type names.
- *
- * @return a list of type names.
- */
- protected abstract List getXSITypes();
-
- /**
- * Return the element declaration corresponding to the given uri qualified
- * type name.
- *
- * @param uriQualifiedTypeName -
- * a uri qualified type name
- * @return corresponding element declaration.
- */
- protected abstract CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName);
-
- /**
- * Returns a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected void addXSITypeAttribute(CMNamedNodeMapImpl map)
- {
- List list = getXSITypes();
- int listSize = list.size();
- if (listSize > 1)
- {
- CMDataType dataType = new CMDataTypeImpl("typeNames", (String) null);
- CMAttributeDeclarationImpl attribute = new CMAttributeDeclarationImpl("type", CMAttributeDeclaration.OPTIONAL, dataType);
- attribute.setCMDocument(xsiDocument);
- attribute.setPrefixQualification(true);
- attribute.setXSITypes(list);
-
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=225447
- // For now, don't clobber the attribute with the same 'type' name defined in the grammar
- // with the xsi:type attribute. The impact of this change will be that for content assist, the non-xsi
- // type attribute will be presented; the generated XML from XSD will have this attribute created, and
- // not the xsi:type attribute.
- Hashtable hashTable = map.getHashtable();
- String name = attribute.getNodeName();
- if (!hashTable.containsKey(name))
- hashTable.put(name, attribute);
- }
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- XSDSchema schema = getResolvedXSDElementDeclaration().getSchema();
- if (schema == null)
- return null;
- else
- return (CMDocument) getAdapter(schema);
- }
-
- /**
- * Returns the substitution group for this element. The group consists of:
- * 1. the element declaration itself 2. and any element declaration that has
- * a {substitution group affiliation} in the group
- *
- * @return the substitution group for this element.
- */
- protected abstract CMNodeListImpl getSubstitutionGroup();
- /*
- * XSDElementDeclarationAdapter.DataTypeImpl An inner class to hold type
- * information for this element.
- */
- public class DataTypeImpl implements CMDataType
- {
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return CMNode.DATA_TYPE;
- }
-
- /**
- * Returns the name of the element type. Same as getDataTypeName().
- *
- * @return the name of the element type.
- */
- public String getNodeName()
- {
- return getDataTypeName();
- }
-
- /**
- * Returns true if the property is supported for this class.
- *
- * @param propertyName -
- * name of a property
- * @return true if the property is supported.
- */
- public boolean supports(String propertyName)
- {
- return (PROPERTY_WHITESPACE_FACET.equals(propertyName));
- }
-
- /**
- * Returns the property value for the property name. Returns null if the
- * property is not supported.
- *
- * @param propertyName -
- * name of a property
- * @return the property value for the property name.
- */
- public Object getProperty(String propertyName)
- {
- if(PROPERTY_WHITESPACE_FACET.equals(propertyName))
- return getWhiteSpaceFacetValue();
- return null;
- }
-
- /**
- * Returns the name of the element type. Same as getNodeName().
- *
- * @return the name of the element type.
- */
- public String getDataTypeName()
- {
- String typeName = null;
- XSDSimpleTypeDefinition std = getXSDType().getSimpleType();
- if (std != null)
- typeName = std.getName();
- return typeName != null ? typeName : "string"; //$NON-NLS-1$
- }
-
- /**
- * Returns the kind of constraint: none, default or fixed. The kinds are
- * defined in CMDataType class (IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED or
- * IMPLIED_VALUE_DEFAULT).
- *
- * @return the kind of constraint: none, default or fixed.
- */
- public int getImpliedValueKind()
- {
- int result = IMPLIED_VALUE_NONE;
- if (getXSDElementDeclaration().isSetConstraint())
- {
- if (getXSDElementDeclaration().getConstraint().getValue() == XSDConstraint.DEFAULT)
- result = IMPLIED_VALUE_DEFAULT;
- else if (getXSDElementDeclaration().getConstraint().getValue() == XSDConstraint.FIXED)
- result = IMPLIED_VALUE_FIXED;
- }
- return result;
- }
-
- /**
- * Returns the value of the default or fixed constraint.
- *
- * @return the value of the default or fixed constraint.
- */
- public String getImpliedValue()
- {
- String result = null;
- if (getXSDElementDeclaration().isSetConstraint())
- {
- result = getXSDElementDeclaration().getLexicalValue();
- }
- return result;
- }
-
- /**
- * Returns the enumerated values for the attribute type.
- *
- * @return the enumerated values for the attribute type.
- */
- public String[] getEnumeratedValues()
- {
- return getEnumeratedValuesForType(getXSDType());
- }
-
- public String generateInstanceValue()
- {
- return XSDTypeUtil.getInstanceValue(getXSDType());
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return (CMDocument) getAdapter(getXSDElementDeclaration().getSchema());
- }
-
- /**
- * Obtains the whitespace facet of the XSD simple type.
- *
- * @return The whitespace facet for the XSD type. If none is
- * defined, or it is a complex type, null.
- */
- private String getWhiteSpaceFacetValue()
- {
- XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
- return (def != null && def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null ;
- }
- }
- }
- /**
- * XSDElementDeclarationAdapter implements CMElementDeclaration. A
- * representation of the model object 'Element Declaration'.
- */
- public static class XSDElementDeclarationAdapter extends ElementDeclarationBaseImpl
- {
- protected List derivedElementDeclarations = null;
- protected List xsiTypes = null;
- protected XSDElementDeclaration xsdElementDeclaration;
- protected CMNodeListImpl substitutionGroup;
-
- /**
- * Constructor.
- *
- * @param xsdElementDeclaration -
- * the XML Schema node.
- */
- public XSDElementDeclarationAdapter(XSDElementDeclaration xsdElementDeclaration)
- {
- this.xsdElementDeclaration = xsdElementDeclaration;
- }
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected XSDElementDeclaration getXSDElementDeclaration()
- {
- return xsdElementDeclaration;
- }
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected XSDElementDeclaration getResolvedXSDElementDeclaration()
- {
- return xsdElementDeclaration.getResolvedElementDeclaration();
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdElementDeclaration;
- }
-
- /**
- * Returns the referenced element declaration if this is an element
- * reference. Otherwise it returns itself.
- *
- * @return an element declaration.
- */
- public CMNode getDefinition()
- {
- return getAdapter(xsdElementDeclaration.getResolvedElementDeclaration());
- }
-
- /**
- * Returns a string indicating whether the element declaration is global or
- * local. Returns null if this is an element reference.
- *
- * @return a string indicating whether the element declaration is global or
- * local.
- */
- protected String getDefinitionInfo()
- {
- if (xsdElementDeclaration.isElementDeclarationReference())
- return null;
- else if (xsdElementDeclaration.isGlobal())
- return DEFINITION_INFO_GLOBAL;
- else
- return DEFINITION_INFO_LOCAL;
- }
-
- public Object getNSPrefixQualification()
- {
- String form = null;
- if (xsdElementDeclaration.isElementDeclarationReference())
- {
- form = "qualified";
- }
- else
- {
- if (xsdElementDeclaration.isSetForm())
- {
- form = xsdElementDeclaration.getForm().getName();
- }
- else
- {
- XSDSchema schema = xsdElementDeclaration.getSchema();
- if (schema != null)
- form = schema.getElementFormDefault().getName();
- }
- }
- return form;
- }
-
- /**
- * Returns the corresponding XML Schema type definition.
- *
- * @return the corresponding XML Schema type definition.
- */
- protected XSDTypeDefinition getXSDType()
- {
- return xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
- }
-
- /**
- * Returns a list of type names.
- *
- * @return a list of type names.
- */
- protected List getXSITypes()
- {
- if (xsiTypes == null)
- {
- computeDerivedTypeInfo();
- }
- return xsiTypes;
- }
-
- protected void computeDerivedTypeInfo()
- {
- xsiTypes = new Vector();
- derivedElementDeclarations = new Vector();
- computeDerivedTypeInfoHelper(getXSDType(), xsiTypes, derivedElementDeclarations);
- }
-
- protected void computeDerivedTypeInfoHelper(XSDTypeDefinition type, List typeNameList, List edList)
- {
- if (type instanceof XSDComplexTypeDefinition)
- {
- List derivedTypes = findTypesDerivedFrom(type);
- ArrayList inclusiveDerivedTypes = new ArrayList();
- inclusiveDerivedTypes.add(type);
- if ((derivedTypes != null) && (derivedTypes.size() > 0))
- {
- inclusiveDerivedTypes.addAll(derivedTypes);
- }
- for (Iterator i = inclusiveDerivedTypes.iterator(); i.hasNext();)
- {
- XSDTypeDefinition derivedType = (XSDTypeDefinition) i.next();
- XSDSchema schema = derivedType.getSchema();
- if (schema != null)
- {
- String uri = schema.getTargetNamespace();
- String name = derivedType.getName();
- if (name != null)
- {
- name = uri != null ? ("[" + uri + "]" + name) : name;
- typeNameList.add(name);
- DerivedElementDeclarationImpl ed = new DerivedElementDeclarationImpl(this, derivedType, name);
- edList.add(ed);
- }
- }
- }
- }
- }
-
- /**
- * Return the element declaration corresponding to the given uri qualified
- * type name.
- *
- * @param uriQualifiedTypeName -
- * a uri qualified type name
- * @return corresponding element declaration.
- */
- protected CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName)
- {
- CMElementDeclaration result = null;
- if (derivedElementDeclarations == null)
- {
- computeDerivedTypeInfo();
- }
- for (Iterator i = derivedElementDeclarations.iterator(); i.hasNext();)
- {
- DerivedElementDeclarationImpl ed = (DerivedElementDeclarationImpl) i.next();
- if ((ed != null) && (ed.uriQualifiedTypeName != null))
- {
- if (ed.uriQualifiedTypeName.equals(uriQualifiedTypeName))
- {
- result = ed;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Returns the substitution group for this element. The group consists of:
- * 1. the element declaration itself 2. and any element declaration that has
- * a {substitution group affiliation} in the group
- *
- * @return the substitution group for this element.
- */
- protected CMNodeListImpl getSubstitutionGroup()
- {
- if (substitutionGroup == null)
- {
- substitutionGroup = new CMNodeListImpl();
- List sgroup = getResolvedXSDElementDeclaration().getSubstitutionGroup();
- for (Iterator i = sgroup.iterator(); i.hasNext();)
- {
- XSDElementDeclaration ed = (XSDElementDeclaration) i.next();
- substitutionGroup.add(getAdapter(ed));
- }
- }
- return substitutionGroup;
- }
- }
- /**
- * DerivedElementDeclarationImpl extends ElementDeclarationBaseImpl
- *
- */
- public static class DerivedElementDeclarationImpl extends ElementDeclarationBaseImpl
- {
- protected XSDElementDeclarationAdapter owner;
- protected XSDTypeDefinition xsdType;
- public String uriQualifiedTypeName;
-
- /**
- * Constructor.
- *
- * @param owner -
- * @param xsdType -
- * @param uriQualifiedTypeName -
- */
- public DerivedElementDeclarationImpl(XSDElementDeclarationAdapter owner, XSDTypeDefinition xsdType, String uriQualifiedTypeName)
- {
- this.owner = owner;
- this.xsdType = xsdType;
- this.uriQualifiedTypeName = uriQualifiedTypeName;
- }
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected XSDElementDeclaration getXSDElementDeclaration()
- {
- return (XSDElementDeclaration) owner.getKey();
- }
-
- /**
- * Returns corresponding XML Schema element declaration.
- *
- * @return corresponding XML Schema element declaration.
- */
- protected XSDElementDeclaration getResolvedXSDElementDeclaration()
- {
- return ((XSDElementDeclaration) owner.getKey()).getResolvedElementDeclaration();
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return owner.getKey();
- }
-
- /**
- * Returns the corresponding XML Schema type definition.
- *
- * @return the corresponding XML Schema type definition.
- */
- protected XSDTypeDefinition getXSDType()
- {
- return xsdType;
- }
-
- /**
- * Returns a list of type names.
- *
- * @return a list of type names.
- */
- protected List getXSITypes()
- {
- return owner.getXSITypes();
- }
-
- /**
- * Return the element declaration corresponding to the given uri qualified
- * type name.
- *
- * @param uriQualifiedTypeName -
- * a uri qualified type name
- * @return corresponding element declaration.
- */
- protected CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName)
- {
- return owner.getDerivedElementDeclaration(uriQualifiedTypeName);
- }
-
- /**
- * Returns the referenced element declaration if this is an element
- * reference. Otherwise it returns itself.
- *
- * @return an element declaration.
- */
- protected CMNode getDefinition()
- {
- return this;
- }
-
- /**
- * Returns a string indicating whether the element declaration is global or
- * local. Returns null if this is an element reference.
- *
- * @return a string indicating whether the element declaration is global or
- * local.
- */
- protected String getDefinitionInfo()
- {
- return owner.getDefinitionInfo();
- }
-
- /*
- * Returns the value of the form [attribute] which affects the target
- * namespace of locally scoped features. @return the value of the form
- * [attribute].
- */
- public Object getNSPrefixQualification()
- {
- return owner.getNSPrefixQualification();
- }
-
- /**
- * Returns the substitution group for this element. The group consists of:
- * 1. the element declaration itself 2. and any element declaration that has
- * a {substitution group affiliation} in the group
- *
- * @return the substitution group for this element.
- */
- protected CMNodeListImpl getSubstitutionGroup()
- {
- return owner.getSubstitutionGroup();
- }
- }
- /**
- * XSDWildcardAdapter
- */
- public static class XSDWildcardAdapter extends XSDBaseAdapter implements CMAnyElement
- {
- protected XSDWildcard xsdWildcard;
-
- public XSDWildcardAdapter(XSDWildcard xsdWildcard)
- {
- this.xsdWildcard = xsdWildcard;
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdWildcard;
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return ANY_ELEMENT;
- }
-
- /**
- * Returns the name of the node. The default value is an empty string value.
- * All derived classes must override this method if they do not want the
- * default value.
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- return "any";
- }
-
- public String getNamespaceURI()
- {
- if (xsdWildcard.getElement().hasAttribute(XSDConstants.NAMESPACE_ATTRIBUTE))
- {
- return xsdWildcard.getElement().getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
- }
- else
- return "##any";
- }
-
- /**
- * Returns the value of 'Min Occurs' attribute. The default value is "1".
- *
- * @return the value of the 'Min Occurs' attribute.
- */
- public int getMinOccur()
- {
- return getMinOccurs(xsdWildcard);
- }
-
- /**
- * Returns the value of the 'Max Occurs' attribute. The default value is
- * "1".
- *
- * @return the value of the 'Max Occurs' attribute.
- */
- public int getMaxOccur()
- {
- return getMaxOccurs(xsdWildcard);
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return (CMDocument) getAdapter(xsdWildcard.getSchema());
- }
-
- /**
- * Returns a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- XSDAnnotation annotation = xsdWildcard.getAnnotation();
- return getDocumentations(annotation);
- }
- }
- /**
- * XSDModelGroupAdapter
- */
- public static class XSDModelGroupAdapter extends XSDBaseAdapter implements CMGroup
- {
- protected XSDModelGroup xsdModelGroup;
-
- public XSDModelGroupAdapter()
- {
- }
-
- public XSDModelGroupAdapter(XSDModelGroup xsdModelGroup)
- {
- this.xsdModelGroup = xsdModelGroup;
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return GROUP;
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdModelGroup;
- }
-
- /**
- * Returns a list of the children of this group.
- *
- * @return a list of the children of this group.
- */
- public CMNodeList getChildNodes()
- {
- CMNodeListImpl nodeList = new CMNodeListImpl();
- if (xsdModelGroup != null)
- {
- for (Iterator i = xsdModelGroup.getParticles().iterator(); i.hasNext();)
- {
- XSDParticle particle = (XSDParticle) i.next();
- XSDParticleContent content = particle.getContent();
- CMNode adapter = getAdapter(content);
- if (adapter != null)
- {
- nodeList.getList().add(adapter);
- }
- }
- }
- return nodeList;
- }
-
- /**
- * Returns the name of the node. The default value is an empty string value.
- * All derived classes must override this method if they do not want the
- * default value.
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
- return descriptionBuilder.buildDescription(this);
- }
-
- /**
- * Returns the value of 'Min Occurs' attribute. The default value is "1".
- *
- * @return the value of the 'Min Occurs' attribute.
- */
- public int getMinOccur()
- {
- return getMinOccurs(xsdModelGroup);
- }
-
- /**
- * Returns the value of the 'Max Occurs' attribute. The default value is
- * "1".
- *
- * @return the value of the 'Max Occurs' attribute.
- */
- public int getMaxOccur()
- {
- return getMaxOccurs(xsdModelGroup);
- }
-
- /**
- * Return operator of this group -- CHOICE, SEQUENCE or ALL value.
- *
- * @return the operator of this group.
- */
- public int getOperator()
- {
- int result = 0;
- //todo... handle ALONE case by checkig if child count == 1
- if (xsdModelGroup != null)
- {
- switch (xsdModelGroup.getCompositor().getValue())
- {
- case XSDCompositor.CHOICE : {
- result = CHOICE;
- break;
- }
- case XSDCompositor.SEQUENCE : {
- result = SEQUENCE;
- break;
- }
- case XSDCompositor.ALL : {
- result = ALL;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Returns a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- XSDAnnotation annotation = xsdModelGroup.getAnnotation();
- return getDocumentations(annotation);
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return (CMDocument) getAdapter(xsdModelGroup.getSchema());
- }
- }
- /**
- * XSDModelGroupDefinitionAdapter
- */
- public static class XSDModelGroupDefinitionAdapter extends XSDBaseAdapter implements CMGroup
- {
- protected XSDModelGroupDefinition xsdModelGroupDefinition;
-
- public XSDModelGroupDefinitionAdapter(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- this.xsdModelGroupDefinition = xsdModelGroupDefinition;
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return GROUP;
- }
-
- /**
- * Returns the key for this cmnode which is the corresponding XML Schema
- * node.
- *
- * @return the key for this cmnode.
- */
- public Object getKey()
- {
- return xsdModelGroupDefinition;
- }
-
- /**
- * Returns a list of the children of this group.
- *
- * @return a list of the children of this group.
- */
- public CMNodeList getChildNodes()
- {
- CMNodeListImpl nodeList = new CMNodeListImpl();
- XSDModelGroup modelGroup = xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup();
- if (modelGroup != null)
- {
- CMNode adapter = getAdapter(modelGroup);
- nodeList.add(adapter);
- }
- return nodeList;
- }
-
- /**
- * Returns the name of the node. The default value is an empty string value.
- * All derived classes must override this method if they do not want the
- * default value.
- *
- * @return the name of the node.
- */
- public String getNodeName()
- {
- CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
- return descriptionBuilder.buildDescription(this);
- }
-
- /**
- * Returns the value of 'Min Occurs' attribute. The default value is "1".
- *
- * @return the value of the 'Min Occurs' attribute.
- */
- public int getMinOccur()
- {
- return getMinOccurs(xsdModelGroupDefinition);
- }
-
- /**
- * Returns the value of the 'Max Occurs' attribute. The default value is
- * "1".
- *
- * @return the value of the 'Max Occurs' attribute.
- */
- public int getMaxOccur()
- {
- return getMaxOccurs(xsdModelGroupDefinition);
- }
-
- /**
- * Return operator of this group -- CHOICE, SEQUENCE or ALL value.
- *
- * @return the operator of this group.
- */
- public int getOperator()
- {
- return XSDCompositor.SEQUENCE;
- }
-
- /**
- * Returns a list of documentation elements.
- *
- * @return a list of documentation elements.
- */
- protected CMNodeList getDocumentation()
- {
- XSDAnnotation annotation = xsdModelGroupDefinition.getAnnotation();
- return getDocumentations(annotation);
- }
-
- /**
- * Returns the cmdocument that is the owner of this cmnode.
- *
- * @return the cmdocument corresponding to this cmnode.
- */
- public CMDocument getCMDocument()
- {
- return (CMDocument) getAdapter(xsdModelGroupDefinition.getSchema());
- }
- }
- /**
- * DocumentationImpl implements CMDocumentation. A representation of the
- * documentation element part of the 'User Information' feature. Working with
- * the documentation element requires dropping down into the DOM model.
- */
- public static class DocumentationImpl implements CMDocumentation
- {
- protected Element documentation;
-
- /**
- * Constructor.
- *
- * @param documentation -
- * a documentation element.
- */
- public DocumentationImpl(Element documentation)
- {
- this.documentation = documentation;
- }
-
- /**
- * Returns the type of the node. The types are defined in CMNode class
- * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
- * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
- * DOCUMENTATION).
- *
- * @return the type of this node.
- */
- public int getNodeType()
- {
- return DOCUMENTATION;
- }
-
- /**
- * Returns an empty string value.
- *
- * @return an empty string value.
- */
- public String getNodeName()
- {
- return "";
- }
-
- /**
- * Returns false. This class does not support any properties.
- *
- * @param propertyName -
- * name of a property
- * @return false.
- */
- public boolean supports(String propertyName)
- {
- return false;
- }
-
- /**
- * Returns null. This class does not support any properties.
- *
- * @param propertyName -
- * name of a property
- * @return null.
- */
- public Object getProperty(String propertyName)
- {
- return null;
- }
-
- /**
- * Returns the content of the documentation element.
- *
- * @return the content of the documentation element.
- */
- public String getValue()
- {
- String content = "";
- boolean contentFound = false;
- NodeList nodes = documentation.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- if (node instanceof Text)
- {
- contentFound = true;
- content += node.getNodeValue();
- }
- }
- return contentFound ? content : null;
- }
-
- /**
- * Returns the xml:lang attribute value of the documentation element.
- *
- * @return the xml:lang attribute value of the documentation element.
- */
- public String getLanguage()
- {
- return documentation.hasAttributeNS(XSDConstants.XML_NAMESPACE_URI_1998, XML_LANG_ATTRIBUTE) ? documentation.getAttributeNS(XSDConstants.XML_NAMESPACE_URI_1998, XML_LANG_ATTRIBUTE) : null;
- }
-
- /**
- * Returns the source attribute value of the documentation element.
- *
- * @return the source attribute value of the documentation element.
- */
- public String getSource()
- {
- return documentation.hasAttributeNS(null, XSDConstants.SOURCE_ATTRIBUTE) ? documentation.getAttributeNS(null, XSDConstants.SOURCE_ATTRIBUTE) : null;
- }
- }
- /**
- * XSIDocument extends CMDocumentImpl. This class is used to hold those
- * attributes that are for direct use in any XML documents. These attributes
- * are in a different namespace, which has the namespace name
- * http://www.w3.org/2001/XMLSchema-instance. Attributes in this namespace
- * include: xsi:type xsi:nil xsi:schemaLocation xsi:noNamespaceSchemaLocation
- */
- public static class XSIDocument extends CMDocumentImpl
- {
- public CMAttributeDeclarationImpl nilAttribute;
-
- /**
- * Constructor. Creates the 'xsi:nil'
- */
- public XSIDocument()
- {
- super(XSDConstants.SCHEMA_INSTANCE_URI_2001);
- // create the 'nill' attribute
- String[] values = {"false", "true"};
- nilAttribute = new CMAttributeDeclarationImpl("nil", CMAttributeDeclaration.REQUIRED, new CMDataTypeImpl("boolean", values));
- nilAttribute.setPrefixQualification(true);
- nilAttribute.setCMDocument(this);
- }
- }
- /**
- * Note this XSD model visitor differs from the XSD model visitor in
- * org.eclipse.wst.xsd.editor plugin. In visitModelGroup method we call
- * getParticles() instead of getContents(). This gathers all of the content of
- * a derived type.
- */
- public static class XSDCMVisitor extends XSDVisitor
- {
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- XSDParticle ctd = type.getComplexType();
- if (ctd != null)
- visitParticle(ctd);
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getParticles() != null)
- {
- for (Iterator iterator = modelGroup.getParticles().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
- if (modelGroup != null)
- {
- visitModelGroup(modelGroup);
- }
- }
- }
- /**
- * A visitor class that walks the xsd model and computes the list of children
- * that belong to the initially visited element type.
- */
- public static class DerivedChildVisitor extends XSDCMVisitor
- {
- protected CMNodeListImpl childNodeList = new CMNodeListImpl();
- protected List baseTypeList = new Vector();
- Object root;
-
- DerivedChildVisitor(Object root)
- {
- this.root = root;
- }
-
- public CMNodeListImpl getChildNodeList()
- {
- return childNodeList;
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- childNodeList.getList().add(getAdapter(wildcard));
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- childNodeList.getList().add(getAdapter(element));
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- childNodeList.getList().add(getAdapter(modelGroup));
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDefinition)
- {
- childNodeList.getList().add(getAdapter(modelGroupDefinition));
- }
- }
- /**
- * A visitor class that gathers all of the elements within a type definition.
- */
- public static class LocalElementVisitor extends XSDCMVisitor
- {
- protected CMNamedNodeMapImpl namedNodeMap = new CMNamedNodeMapImpl();
- protected List baseTypeList = new Vector();
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) getAdapter(element);
- namedNodeMap.getHashtable().put(adapter.getNodeName(), adapter);
- }
-
- public CMNamedNodeMap getCMNamedNodeMap()
- {
- return namedNodeMap;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
deleted file mode 100644
index 1ab69ef8a8..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.contentmodel.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Helper class to generate valid values for built-in simple types.
- */
-
-public class XSDTypeUtil
-{
- protected static Map defaultValue = new HashMap();
-
- public static void initialize()
- {
- defaultValue.put("anySimpleType", null);
- defaultValue.put("anyType", null);
- defaultValue.put("anyURI", "http://tempuri.org");
- defaultValue.put("base64Binary", "MA==");
- defaultValue.put("boolean", "true");
- defaultValue.put("byte", "0");
- defaultValue.put("date", "2001-01-01");
- defaultValue.put("dateTime", "2001-12-31T12:00:00");
- defaultValue.put("decimal", "0.0");
- defaultValue.put("double", "0.0");
- defaultValue.put("duration", "P1D");
- defaultValue.put("ENTITY", "entity");
- defaultValue.put("ENTITIES", "entities");
- defaultValue.put("float", "0.0");
- defaultValue.put("gDay", "---01");
- defaultValue.put("gMonth", "--01--");
- defaultValue.put("gMonthDay", "--01-01");
- defaultValue.put("gYear", "2001");
- defaultValue.put("gYearMonth", "2001-01");
- defaultValue.put("hexBinary", "0F00");
- defaultValue.put("ID", null);
- defaultValue.put("IDREF", null);
- defaultValue.put("IDREFS", null);
- defaultValue.put("int", "0");
- defaultValue.put("integer", "0");
- defaultValue.put("language", "EN");
- defaultValue.put("long", "0");
- defaultValue.put("Name", "Name");
- defaultValue.put("NCName", "NCName");
- defaultValue.put("negativeInteger", "-1");
- defaultValue.put("NMTOKEN", "NMTOKEN");
- defaultValue.put("NMTOKENS", "NMTOKENS");
- defaultValue.put("nonNegativeInteger", "0");
- defaultValue.put("nonPositiveInteger", "0");
- defaultValue.put("normalizedString", null);
- defaultValue.put("NOTATION", "NOTATION");
- defaultValue.put("positiveInteger", "1");
- defaultValue.put("QName", "QName");
- defaultValue.put("short", "0");
- defaultValue.put("string", null);
- defaultValue.put("time", "12:00:00");
- defaultValue.put("token", "token");
- defaultValue.put("unsignedByte", "0");
- defaultValue.put("unsignedInt", "0");
- defaultValue.put("unsignedLong", "0");
- defaultValue.put("unsignedShort", "0");
- }
-
-
- /*
- * Returns true if the type is built-in.
- * @param type - an XSDTypeDefinition object.
- * @return true if the type is built-in.
- */
- public static boolean isBuiltIn(XSDTypeDefinition type)
- {
- boolean result = false;
- if (type instanceof XSDSimpleTypeDefinition)
- {
- String name = type.getName();
- if (name != null)
- {
- return defaultValue.containsKey(name);
- }
- }
- return result;
- }
-
-
- /**
- * Returns a valid default value for the simple type.
- * @param type - a simple built-in type.
- * @return a valid default value for the simple type.
- */
- public static String getInstanceValue(XSDTypeDefinition type)
- {
- if (type != null)
- {
- if (isBuiltIn(type))
- {
- String nameID = type.getName();
- return (String)defaultValue.get(nameID);
- }
- else
- {
- XSDTypeDefinition basetype = type.getBaseType();
- if (basetype != type) return getInstanceValue(basetype);
- }
- }
- return null;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
deleted file mode 100644
index 59f5838f67..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
- public XSDVisitor()
- {
- }
-
- protected XSDSchema schema;
- protected Stack particleStack = new Stack();
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- visitModelGroup(modelGroupDef.getModelGroup());
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getContentType() != null)
- {
- XSDComplexTypeContent complexContent = type.getContentType();
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition modelGroupDef = (XSDModelGroupDefinition) particleContent;
-
- if (particleStack.contains(modelGroupDef))
- {
- return;
- }
-
- particleStack.push(modelGroupDef);
-
- visitModelGroupDefinition(modelGroupDef);
-
- particleStack.pop();
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java
deleted file mode 100644
index c0309f1aee..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java
+++ /dev/null
@@ -1,31 +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.xsd.contentmodel.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocatorAdapterFactory extends AdapterFactoryImpl
-{
- protected XSDSchemaLocatorImpl schemaLocator = new XSDSchemaLocatorImpl();
-
- public boolean isFactoryForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return schemaLocator;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java
deleted file mode 100644
index cbf018359e..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java
+++ /dev/null
@@ -1,75 +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.xsd.contentmodel.internal.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocatorImpl extends AdapterImpl implements XSDSchemaLocator
-{
- /**
- * @see org.eclipse.xsd.util.XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema,
- * java.lang.String, java.lang.String, java.lang.String)
- */
- public XSDSchema locateSchema(XSDSchema xsdSchema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)
- {
- XSDSchema result = null;
- String baseLocation = xsdSchema.getSchemaLocation();
- String resolvedURI = URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, rawSchemaLocationURI);
- if (resolvedURI == null)
- {
- resolvedURI = resolvedSchemaLocationURI;
- }
- try
- {
- ResourceSet resourceSet = xsdSchema.eResource().getResourceSet();
- URI uri = URI.createURI(resolvedURI);
- Resource r = resourceSet.getResource(uri, false);
- XSDResourceImpl resolvedResource = null;
- if (r instanceof XSDResourceImpl)
- {
- resolvedResource = (XSDResourceImpl)r;
- }
- else
- {
- String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseLocation, namespaceURI, resolvedURI);
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- resolvedResource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
- resolvedResource.setURI(uri);
- resolvedResource.load(inputStream, null);
- }
-
- result = resolvedResource.getSchema();
- }
- catch (IOException exception)
- {
- // It is generally not an error to fail to resolve.
- // If a resource is actually created,
- // which happens only when we can create an input stream,
- // then it's an error if it's not a good schema
- }
- return result;
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationConfiguration.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationConfiguration.java
deleted file mode 100644
index 0a57f95bc2..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationConfiguration.java
+++ /dev/null
@@ -1,71 +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
- * David Carver, Standards for Technology in Automotive Retail, bug 1147033
- *******************************************************************************/
-package org.eclipse.wst.xsd.core.internal.validation;
-
-/**
- * An XSD validation configuration allows setting specific configuration
- * information for a WTP XSD validation run. Any features and properties
- * set on this configuration should not be confused with those from
- * parsers such as Xerces. (This object does not by default wrap features
- * and properties from specific parsers.)
- */
-public class XSDValidationConfiguration
-{
- public static String HONOUR_ALL_SCHEMA_LOCATIONS = "HONOUR_ALL_SCHEMA_LOCATIONS"; //$NON-NLS-1$
- public static String FULL_SCHEMA_CONFORMANCE = "FULL_SCHEMA_CONFORMANCE"; //$NON-NLS-1$
- private boolean honour_all_schema_locations = false;
- private boolean fullSchemaConformance = true;
-
- /**
- * Set a feature of this configuration.
- *
- * @param feature
- * The feature to set.
- * @param value
- * The value to set for the feature.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public void setFeature(String feature, boolean value) throws Exception
- {
- if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
- honour_all_schema_locations = value;
- else if (FULL_SCHEMA_CONFORMANCE.equals(feature))
- fullSchemaConformance = value;
- else
- throw new Exception("Feature not recognized."); //$NON-NLS-1$
-
- }
-
-
- /**
- * Get the value for a given feature. If the feature is not defined
- * this method will throw an exception.
- *
- * @param feature
- * The feature for which to retrieve the value.
- * @return
- * The feature's value, true or false.
- * @throws
- * An exception is thrown if the feature is not recognized.
- */
- public boolean getFeature(String feature) throws Exception
- {
- if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
- return honour_all_schema_locations;
- else if (FULL_SCHEMA_CONFORMANCE.equals(feature))
- return fullSchemaConformance;
-
- throw new Exception("Feature not recognized."); //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
deleted file mode 100644
index 1a6b5e9b93..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver, Standards for Technology in Automotive Retail, bug 1147033
- *******************************************************************************/
-package org.eclipse.wst.xsd.core.internal.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.xerces.impl.Constants;
-import org.apache.xerces.parsers.XMLGrammarPreparser;
-import org.apache.xerces.util.XMLGrammarPoolImpl;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.grammars.XMLGrammarDescription;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.apache.xerces.xni.parser.XMLParseException;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.w3c.dom.DOMError;
-
-/**
- * The XSDValidator will validate XSD files.
- */
-public class XSDValidator
-{
- protected URIResolver uriresolver = null;
-
- public ValidationReport validate(String uri)
- {
- return validate(uri, null);
- }
-
- public ValidationReport validate(String uri, InputStream inputStream)
- {
- return validate(uri, null, null);
- }
-
- /**
- * Validate the XSD file specified by the URI.
- *
- * @param uri
- * The URI of the XSD file to validate.
- * @param inputStream
- * An input stream representing the XSD file to validate.
- * @param configuration
- * A configuration for this validation run.
- */
- public ValidationReport validate(String uri, InputStream inputStream, XSDValidationConfiguration configuration)
- {
- if(configuration == null)
- {
- configuration = new XSDValidationConfiguration();
- }
- ValidationInfo valinfo = new ValidationInfo(uri);
- XSDErrorHandler errorHandler = new XSDErrorHandler(valinfo);
- try
- {
- XMLGrammarPreparser grammarPreparser = new XMLGrammarPreparser();
- grammarPreparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA,null/*schemaLoader*/);
-
- grammarPreparser.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, new XMLGrammarPoolImpl());
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE, false);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE, true);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, true);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, true);
-
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE, true);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE, true);
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE, true);
-
- if(configuration.getFeature(XSDValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS))
- {
- try
- {
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + "honour-all-schemaLocations", true); //$NON-NLS-1$
- }
- catch (Exception e)
- {
- // catch the exception and ignore
- }
- }
-
- if(configuration.getFeature(XSDValidationConfiguration.FULL_SCHEMA_CONFORMANCE)) {
- try
- {
- grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING, true);
- }
- catch (Exception e)
- {
- // ignore since we don't want to set it or can't.
- }
-
- }
-
- grammarPreparser.setErrorHandler(errorHandler);
- if (uriresolver != null)
- {
- XSDEntityResolver resolver = new XSDEntityResolver(uriresolver, uri);
- if (resolver != null)
- {
- grammarPreparser.setEntityResolver(resolver);
- }
- }
-
- try
- {
- XMLInputSource is = new XMLInputSource(null, uri, uri, inputStream, null);
- grammarPreparser.getLoader(XMLGrammarDescription.XML_SCHEMA);
- grammarPreparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,is);
- }
- catch (Exception e)
- {
- //parser will return null pointer exception if the document is structurally invalid
- //TODO: log error message
- //System.out.println(e);
- }
- }
- catch (Exception e)
- {
- // TODO: log error.
- //System.out.println(e);
- }
- return valinfo;
- }
-
- /**
- * Set the URI resolver to use with XSD validation.
- *
- * @param uriresolver
- * The URI resolver to use.
- */
- public void setURIResolver(URIResolver uriresolver)
- {
- this.uriresolver = uriresolver;
- }
-
- /**
- * The XSDErrorHandler handle Xerces parsing errors and puts the errors
- * into the given ValidationInfo object.
- */
- protected class XSDErrorHandler implements XMLErrorHandler
- {
-
- private final ValidationInfo valinfo;
-
- public XSDErrorHandler(ValidationInfo valinfo)
- {
- this.valinfo = valinfo;
- }
-
- /**
- * Add a validation message with the given severity.
- *
- * @param errorKey The Xerces error key.
- * @param exception The exception that contains the information about the message.
- * @param severity The severity of the validation message.
- */
- protected void addValidationMessage(String errorKey, XMLParseException exception, int severity)
- {
- String systemId = exception.getExpandedSystemId();
- if (systemId != null)
- {
- if (severity == DOMError.SEVERITY_WARNING)
- {
- valinfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId);
- }
- else
- {
- valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId, errorKey, null);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xni.parser.XMLErrorHandler#warning(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
- */
- public void warning(String domain, String key, XMLParseException exception) throws XNIException
- {
- addValidationMessage(key, exception, DOMError.SEVERITY_WARNING);
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xni.parser.XMLErrorHandler#error(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
- */
- public void error(String domain, String key, XMLParseException exception) throws XNIException
- {
- addValidationMessage(key, exception, DOMError.SEVERITY_ERROR);
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xni.parser.XMLErrorHandler#fatalError(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
- */
- public void fatalError(String domain, String key, XMLParseException exception) throws XNIException
- {
- addValidationMessage(key, exception, DOMError.SEVERITY_FATAL_ERROR);
- }
- }
-
- /**
- * The XSDEntityResolver wraps an idresolver to provide entity resolution to
- * the XSD validator.
- */
- protected class XSDEntityResolver implements XMLEntityResolver
- {
- private URIResolver uriresolver = null;
-
- /**
- * Constructor.
- *
- * @param idresolver
- * The idresolver this entity resolver wraps.
- * @param baselocation The base location to resolve with.
- */
- public XSDEntityResolver(URIResolver uriresolver, String baselocation)
- {
- this.uriresolver = uriresolver;
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xni.parser.XMLEntityResolver#resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier)
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException
- {
- String literalSystemId = resourceIdentifier.getLiteralSystemId();
- if(literalSystemId != null)
- {
- resourceIdentifier.setLiteralSystemId(literalSystemId.replace('\\','/'));
- }
- // TODO cs: In revision 1.1 we explicitly opened a stream to ensure
- // file I/O problems produced messages. I've remove this fudge for now
- // since I can't seem to reproduce the problem it was intended to fix.
- // I'm hoping the newer Xerces code base has fixed this problem and the fudge is defunct.
- return XMLValidator._internalResolveEntity(uriresolver, resourceIdentifier);
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
deleted file mode 100644
index 5da031b3e4..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver, Standards for Technology in Automotive Retail, bug 1147033
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-import java.io.InputStream;
-import java.util.HashMap;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
-import org.eclipse.wst.xsd.core.internal.preferences.XSDCorePreferenceNames;
-import org.eclipse.wst.xsd.core.internal.validation.XSDValidationConfiguration;
-
-public class Validator extends AbstractNestedValidator
-{
- protected HashMap xsdConfigurations = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- protected void setupValidation(NestedValidatorContext context)
- {
- XSDValidationConfiguration configuration = new XSDValidationConfiguration();
- boolean honourAllSchemaLocations = XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS);
- boolean fullSchemaConformance = XSDCorePlugin.getDefault().getPluginPreferences().getBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE);
- try
- {
- configuration.setFeature(XSDValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS, honourAllSchemaLocations);
- configuration.setFeature(XSDValidationConfiguration.FULL_SCHEMA_CONFORMANCE, fullSchemaConformance);
- }
- catch(Exception e)
- {
- // Unable to set the honour all schema locations option. Do nothing.
- }
- xsdConfigurations.put(context, configuration);
-
- super.setupValidation(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#teardownValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- protected void teardownValidation(NestedValidatorContext context)
- {
- xsdConfigurations.remove(context);
-
- super.teardownValidation(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
- {
- XSDValidator validator = XSDValidator.getInstance();
-
- XSDValidationConfiguration configuration = (XSDValidationConfiguration)xsdConfigurations.get(context);
-
- ValidationReport valreport = null;
-
- valreport = validator.validate(uri, inputstream, configuration);
-
- return valreport;
- }
-
- /**
- * Store additional information in the message parameters. For XSD validation there
- * are three additional pieces of information to store:
- * param[0] = the column number of the error
- * param[1] = the 'squiggle selection strategy' for which DOM part to squiggle
- * param[2] = the name or value of what is to be squiggled
- *
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage)
- */
- protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
- {
- String key = validationMessage.getKey();
- if(key != null)
- {
- XSDMessageInfoHelper messageInfoHelper = new XSDMessageInfoHelper();
- String[] messageInfo = messageInfoHelper.createMessageInfo(key, validationMessage.getMessage());
-
- message.setAttribute(COLUMN_NUMBER_ATTRIBUTE, new Integer(validationMessage.getColumnNumber()));
- message.setAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE, messageInfo[0]);
- message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorID()
- */
- protected String getValidatorID()
- {
- // Because this class is used as a delegate, return the id of the validator
- // which delegates to this class.
-
- return XSDDelegatingValidator.class.getName();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java
deleted file mode 100644
index 3f615ba45f..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java
+++ /dev/null
@@ -1,31 +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.xsd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.validation.internal.delegates.DelegatingValidator;
-
-/**
- * This class provides a unique name (class name) which the validation framework
- * will use to identify the XSD validator. The actual delegating validator
- * functionality is provided by the base class. The actual validation
- * functionality is provided by the delegates registered with this class as
- * their target.
- */
-public class XSDDelegatingValidator extends DelegatingValidator
-{
- /**
- * Default constructor.
- */
- public XSDDelegatingValidator()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java
deleted file mode 100644
index 5de3299414..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.core.internal.validation.eclipse;
-
-
-/**
- * The XSDMessageInfoHelper creates a string with the
- */
-public class XSDMessageInfoHelper
-{
- public XSDMessageInfoHelper()
- { super();
- }
-
- public String[] createMessageInfo(String errorKey, String errorMessage)
- {
- //Now map the error key to what we would want to underline:
- String nameOrValue = "";
- String selectionStrategy = "";
- if(errorKey != null)
- {
- if (errorKey.equals("s4s-elt-invalid-content.1") || errorKey.equals("s4s-elt-must-match.1") ||
- errorKey.equals("s4s-att-must-appear") || errorKey.equals("s4s-elt-invalid-content.2")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- {
- selectionStrategy = "START_TAG"; //$NON-NLS-1$
- }
- else if (errorKey.equals("s4s-att-not-allowed")) //$NON-NLS-1$
- {
- selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
- nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
- }
- else if (errorKey.equals("s4s-att-invalid-value")) //$NON-NLS-1$
- {
- selectionStrategy = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
- nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
- }
- else if (errorKey.equals("s4s-elt-character")) //$NON-NLS-1$
- {
- selectionStrategy = "TEXT"; //$NON-NLS-1$
- }
- else if (errorKey.equals("src-resolve.4.2") || errorKey.equals("src-resolve")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- selectionStrategy = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
- nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
- }
- else if (errorKey.equals("EqRequiredInAttribute") || errorKey.equals("OpenQuoteExpected") ||
- errorKey.equals("LessthanInAttValue")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- {
- selectionStrategy = "ATTRIBUTE_NAME"; //$NON-NLS-1$
- nameOrValue = getFirstStringBetweenQuotes(errorMessage);
- }
- else if (errorKey.equals("ElementUnterminated")) //$NON-NLS-1$
- {
- selectionStrategy = "ENTIRE_ELEMENT"; //$NON-NLS-1$
- }
- else if (errorKey.equals("ETagUnterminated") || errorKey.equals("ETagRequired")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- selectionStrategy = "END_TAG"; //$NON-NLS-1$
- }
- }
- String messageInfo[] = new String[2];
- messageInfo[0] = selectionStrategy;
- messageInfo[1] = nameOrValue;
- return messageInfo;
- }
-
- /**
- * This method is used to get the value between the first pair of single quotes
- * It is used to extract information from the error Message (for example
- * an attribute name)
- *
- * @param s
- * The string to extract the value from.
- */
- protected String getFirstStringBetweenSingleQuotes(String s)
- {
- return getFirstStringBetweenDelimiters(s, '\'');
- }
-
- /**
- * This method is used to get the value between the first pair of quotes
- * It is used to extract information from the error Message (for example
- * an attribute name)
- *
- * @param s
- * The string to extract the value from.
- */
- protected String getFirstStringBetweenQuotes(String s)
- {
- return getFirstStringBetweenDelimiters(s, '\"');
- }
-
- /**
- * This method is used to get the value between the first start and end occurrences of the given delimiter character.
- *
- * @param s
- * The string to extract the value from.
- * @param delimiter
- * The start and end character
- */
- protected String getFirstStringBetweenDelimiters(String s, char delimiter)
- {
- int first = s.indexOf(delimiter);
- int second = s.indexOf(delimiter, first + 1);
- String stringBetweenDelimiters = null;
- if (first != -1 && second != -1)
- {
- stringBetweenDelimiters = s.substring(first + 1, second);
- }
- return stringBetweenDelimiters;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java
deleted file mode 100644
index fbe1a0333e..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java
+++ /dev/null
@@ -1,48 +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.xsd.core.internal.validation.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-
-
-/**
- * An XSD validator specific to Eclipse. This validator will wrap the internal
- * XSD validator an provide automatic URI resolution support.
- * Using this class is equivalent to using the internal XSD validator and registering
- * the URI resolver from the URI resolution framework.
- */
-public class XSDValidator extends org.eclipse.wst.xsd.core.internal.validation.XSDValidator
-{
- private static XSDValidator instance = null;
-
- /**
- * Return the one and only instance of the XSD validator. The validator
- * can be reused and cannot be customized so there should only be one instance of it.
- *
- * @return The one and only instance of the XSD validator.
- */
- public static XSDValidator getInstance()
- {
- if(instance == null)
- {
- instance = new XSDValidator();
- }
- return instance;
- }
- /**
- * Constructor. Create the XSD validator and set the URI resolver.
- */
- protected XSDValidator()
- {
- this.setURIResolver(URIResolverPlugin.createResolver());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java
deleted file mode 100644
index 7b30f26ed5..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.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.xsd.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDCMManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XSDCorePlugin extends Plugin {
- //The shared instance.
- private static XSDCorePlugin plugin;
-
- /**
- * The constructor.
- */
- public XSDCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- XSDCMManager.getInstance().startup();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static XSDCorePlugin getDefault() {
- return plugin;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java
deleted file mode 100644
index f81f24d3d0..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xsd.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.xsd.core.internal.XSDCorePlugin;
-
-/**
- * Sets default values for XSD Core preferences
- */
-public class XSDCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(XSDCorePlugin.getDefault().getBundle().getSymbolicName());
-
- // In order to provide the best compatibility and conformance to the XML Schema
- // specification it is recommended that this be defaulted to true.
- node.putBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE, true);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java
deleted file mode 100644
index 06fc74e111..0000000000
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xsd.core.internal.preferences;
-
-/**
- * Common preference keys used by XSD core
- */
-public class XSDCorePreferenceNames {
- private XSDCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
- /**
- * Indicates whether or not all schema locations should be honoured
- * during XSD validation.
- * <p>
- * Value is of type <code>boolean</code>.<br />
- * Possible values: {TRUE, FALSE}
- * </p>
- * @deprecated
- */
- public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "honourAllSchemaLocations";//$NON-NLS-1$
- public static final String FULL_SCHEMA_CONFORMANCE = "fullSchemaConformance";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/.classpath b/bundles/org.eclipse.wst.xsd.ui/.classpath
deleted file mode 100644
index 492b51cc29..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.classpath
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-refactor"/>
- <classpathentry kind="src" path="src-adt"/>
- <classpathentry kind="src" path="src-adt-xsd"/>
- <classpathentry kind="src" path="src-common"/>
- <classpathentry kind="src" path="src-adt-xsd-typeviz"/>
- <classpathentry kind="src" path="src-search"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <accessrules>
- <accessrule kind="accessible" pattern="org/apache/xerces/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/validation/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/common/ui/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsd.ui/.cvsignore b/bundles/org.eclipse.wst.xsd.ui/.cvsignore
deleted file mode 100644
index 6500e4dc83..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-xsdeditor.jar
-build.xml
-temp.folder
-org.eclipse.wst.xsd.ui_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xsd.ui/.project b/bundles/org.eclipse.wst.xsd.ui/.project
deleted file mode 100644
index aab3824094..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsd.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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 95c882edc6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Tue Jan 16 17:48:30 EST 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=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-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=error
-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=error
-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.4
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 5a782e146c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue Jan 16 17:04:13 EST 2007
-eclipse.preferences.version=1
-internal.default.compliance=user
-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.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 061cd53dd0..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.wst.xsd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 74437c9554..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,87 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %_UI_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.xsd.ui; singleton:=true
-Bundle-Version: 1.2.404.qualifier
-Bundle-Activator: org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.ui.internal.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adapters;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design.directedit;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design.editparts;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.design.figures;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.edit;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.editor;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.facade;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.outline;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.properties;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.typeviz;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.commands;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.commands;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.properties.providers;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.properties.sections;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.common.util;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.design.editparts;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.design.editparts.model;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.design.editpolicies;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.design.figures;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.design.layouts;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.dialogs;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.editor.icons;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.editor.search;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.navigation;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.nsedit;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.handlers,
- org.eclipse.wst.xsd.ui.internal.refactor.rename;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.structure;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.util;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.refactor.wizard;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.search;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.search.actions;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.text;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.util;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.utils;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.validation;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.widgets;x-internal:=true,
- org.eclipse.wst.xsd.ui.internal.wizards;x-internal:=true
-Require-Bundle: org.eclipse.ui.views.properties.tabbed;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.common.core;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.2.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.gef;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore.edit;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.xsd.edit;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ltk.ui.refactoring;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.xsd.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.search;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)"
-Import-Package: com.ibm.icu.util;version="3.8.1"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.wst.xsd.ui/about.html b/bundles/org.eclipse.wst.xsd.ui/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.xsd.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.wst.xsd.ui/build.properties b/bundles/org.eclipse.wst.xsd.ui/build.properties
deleted file mode 100644
index cc91274bdb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/build.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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-search/,\
- src-refactor/,\
- src-adt/,\
- src-adt-xsd/,\
- src-adt-xsd-typeviz/,\
- src-common/
-bin.includes = .,\
- plugin.xml,\
- icons/,\
- plugin.properties,\
- META-INF/,\
- about.html
-src.includes = component.xml
-output.. = bin/
-javacSource=1.4
-javacTarget=1.4
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/component.xml b/bundles/org.eclipse.wst.xsd.ui/component.xml
deleted file mode 100644
index 294443a7d4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model"
- name="org.eclipse.wst.xsd">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.xsd.ui" fragment="false" />
- <plugin id="org.eclipse.wst.xsd.core" fragment="false" />
-</component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b55d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif b/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
deleted file mode 100644
index 1936e21a7c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
deleted file mode 100644
index 13dae59bea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
deleted file mode 100644
index b872beee62..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif
deleted file mode 100644
index b6efdd3d86..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
deleted file mode 100644
index b6922ac11c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif
deleted file mode 100644
index 5b67950b38..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
deleted file mode 100644
index d94ff10555..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/capturescreen.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/capturescreen.gif
deleted file mode 100644
index 3570c90f4d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/capturescreen.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/help_contents.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/help_contents.gif
deleted file mode 100644
index 74bf617372..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/help_contents.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
deleted file mode 100644
index d94ff10555..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif b/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif
deleted file mode 100644
index f2d7f1b8b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a31a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/capturescreen.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/capturescreen.gif
deleted file mode 100644
index 176830af2d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/capturescreen.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/help_contents.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/help_contents.gif
deleted file mode 100644
index 9d70301dae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/help_contents.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a31a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomminus.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomminus.gif
deleted file mode 100644
index dd2c92f9ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomminus.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomplus.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomplus.gif
deleted file mode 100644
index 466d756b3f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/zoomplus.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
deleted file mode 100644
index 5c287e92dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif b/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
deleted file mode 100644
index 6fe6f0e10a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif
deleted file mode 100644
index 2440a24c26..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif
deleted file mode 100644
index 44da7510b0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif
deleted file mode 100644
index 5a8df73015..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif
deleted file mode 100644
index b2c1db9ef4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif
deleted file mode 100644
index 79dc58fe6c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif
deleted file mode 100644
index 1e81677a91..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif
deleted file mode 100644
index f80af50633..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif
deleted file mode 100644
index 121d192343..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif
deleted file mode 100644
index b90c12e78d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif
deleted file mode 100644
index 878b94f132..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif
deleted file mode 100644
index 36d1b3e560..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif
deleted file mode 100644
index 40bd3aa68e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif
deleted file mode 100644
index 7b56868c26..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif
deleted file mode 100644
index 462c2d4aa5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif
deleted file mode 100644
index 068987bf0b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif
deleted file mode 100644
index e217e9b228..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif
deleted file mode 100644
index 98df7f416e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif
deleted file mode 100644
index 2ae812cefb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif
deleted file mode 100644
index da37fbad3e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif
deleted file mode 100644
index 6f5484c764..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
deleted file mode 100644
index 9bfb682d28..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
deleted file mode 100644
index 78092ff114..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
deleted file mode 100644
index 9254879842..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif
deleted file mode 100644
index 8af583f4bd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif
deleted file mode 100644
index 7ecc4ff4b9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
deleted file mode 100644
index 6000cb80f4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
deleted file mode 100644
index 26f720648d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
deleted file mode 100644
index 61e1e258d7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_tsk.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_tsk.gif
deleted file mode 100644
index 9b048d6053..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_tsk.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsn_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsn_obj.gif
deleted file mode 100644
index c24a95fba3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsn_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsndis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsndis_obj.gif
deleted file mode 100644
index 843cd0e11c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsndis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
deleted file mode 100644
index 7ca11cd95c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif
deleted file mode 100644
index 5bf9ac077e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
deleted file mode 100644
index e05c6455ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif
deleted file mode 100644
index 16b8612332..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif
deleted file mode 100644
index fd972de440..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif
deleted file mode 100644
index 2e74430cc2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif
deleted file mode 100644
index 320973eedd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
deleted file mode 100644
index 0b518c602b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif
deleted file mode 100644
index b83825cd0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
deleted file mode 100644
index d6a9afd1b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif
deleted file mode 100644
index 2b67663dfd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
deleted file mode 100644
index 6613149c90..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif
deleted file mode 100644
index 717203b3d3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
deleted file mode 100644
index 3267542eac..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
deleted file mode 100644
index 1931f929b2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/error_ovr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsn_ovr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsn_ovr.gif
deleted file mode 100644
index f34420bc3a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsn_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsndis_ovr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsndis_ovr.gif
deleted file mode 100644
index 94eb76820b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsndis_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
deleted file mode 100644
index d455c2b53f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.properties b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
deleted file mode 100644
index f4c5b827ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.properties
+++ /dev/null
@@ -1,850 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2011 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-! Properties file for component: XMSCH - XML Tools - XML Schema Editor
-! Packaged for translation in: xml.zip
-
-!
-! Plugin
-!
-_UI_PLUGIN_NAME = XML Schema Editor
-_UI_EDITOR_NAME = XML Schema Editor
-
-_UI_ACTION_EXT_GENERATE = &Generate
-_UI_ACTION_EXT_GENERATE_DDL = &DDL...
-_UI_ACTION_EXT_GENERATE_DTD = D&TD...
-_UI_ACTION_EXT_GENERATE_JAVA = &Java Beans...
-
-_UI_ACTION_EXT_GENERATE_XSD = &Generate XML Schema
-_UI_WIZARD_NAME_NEW_XSD = XML Schema
-
-_UI_XML_TOOLS_PREFERENCE_PAGE = XML
-_UI_XML_SCHEMA_PREFERENCE = XML Schema Files
-_UI_XML_SCHEMA_EDITOR_PREFERENCE = Editor
-_UI_XML_SCHEMA_VALIDATOR_PREFERENCE = Validation
-
-_UI_WIZARD_NEW_XSD = XML Schema File
-_UI_CREATE_A_NEW_SCHEMA = Create a new XML schema file
-
-! New property tabs
-_UI_LABEL_GENERAL = General
-_UI_LABEL_ATTRIBUTES = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-_UI_LABEL_TYPE_CONSTRAINTS = Constraints
-_UI_LABEL_APPLICATION_INFO = Application Info
-_UI_LABEL_EXTENSIONS = Extensions
-_UI_LABEL_FACETS = Facets
-_UI_LABEL_ENUMERATIONS = Enumerations
-_UI_LABEL_ADVANCED = Advanced
-
-_UI_LABEL_READ_ONLY = read-only
-_UI_LABEL_KIND = Kind:
-_UI_LABEL_VARIETY = &Variety:
-
-_UI_LABEL_APP_INFO = App Info
-
-!
-! Schema File Window
-!
-_UI_LABEL_FILE_NAME = File name:
-_UI_LABEL_VERSION = Version:
-_UI_TOOLTIP_VERSION = Convenient attribute to store version number
-_UI_LABEL_LANGUAGE = Language:
-_UI_TOOLTIP_LANGUAGE = Represents natural language identifiers
-_UI_GROUP_NAMESPACE = Namespace
-_UI_LABEL_SCHEMA_PREFIX = &Prefix:
-_UI_TOOLTIP_SCHEMA_PREFIX = The prefix associated with the current namespace.
-_UI_LABEL_TARGET_NAME_SPACE = &Target namespace:
-_UI_TOOLTIP_TARGET_NAME_SPACE = The namespace for this schema.
-_UI_BUTTON_APPLY = Apply
-_UI_LABEL_ATTRIBUTE_FORM_DEFAULT = Attribute form default:
-_UI_TOOLTIP_ATTRIBUTE_FORM = Indicates if all attributes in a schema must be qualified or not in the instance document
-_UI_LABEL_ELEMENT_FORM_DEFAULT = Element form default:
-_UI_TOOLTIP_ELEMENT_FORM_DEFAULT = Indicates if all elements in a schema must be qualified or not in the instance document
-_UI_LABEL_BLOCK_DEFAULT = Block default:
-_UI_TOOLTIP_BLOCK_DEFAULT = Control derivations for every type and element in the schema
-_UI_LABEL_FINAL_DEFAULT = Final default:
-_UI_TOOLTIP_FINAL_DEFAULT = Control derivations for every type and element in the schema
-_UI_ACTION_DELETE_INCLUDE = Delete
-_UI_ACTION_DELETE_NODES = Delete Nodes
-! Note to translators: The following is the acronym for Uniform Resource Indicator
-_UI_LABEL_URI = URI:
-
-
-_UI_LABEL_ADD = Add...
-_UI_LABEL_EDIT = Edit...
-_UI_LABEL_PATTERNS = Patterns
-_ERROR_FILE_ALREADY_EXISTS = The file name already exists: {0}
-
-!
-! Any Section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_NAMESPACE_AND_PROCESS_CONTENTS = namespace and processContents
-
-!
-! minOccurs and maxOccurs section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_MINOCCURS_AND_MAXOCCURS = minOccurs and maxOccurs
-
-!
-! Value Information Section
-!
-_UI_LABEL_VALUE_INFORMATION = Value Information
-
-!
-! Notation window
-!
-_UI_NOTATION_NAME = Name:
-_UI_NOTATION_PUBLIC = Public:
-_UI_NOTATION_SYSTEM = System:
-_UI_TOOLTIP_PUBLIC = An optional public identifier
-_UI_TOOLTIP_SYSTEM = An optional URI reference
-
-!
-! Complex Type Window
-!
-_UI_NAME = Name:
-_UI_ABSTRACT = Abstract:
-_UI_MIXED = Mixed:
-_UI_BLOCK = Block:
-_UI_FINAL = Final:
-
-_UI_CT_TOOLTIP_MIXED = Indicates if type may contain mixed content
-_UI_CT_TOOLTIP_ABSTRACT = When a complex type is declared abstract, it cannot be used in an instance document
-_UI_CT_TOOLTIP_FINAL = You can use this to prevent further derivations
-_UI_CT_TOOLTIP_BLOCK = You can use this to block any derivations
-
-!
-! SimpleContent and ComplexContent Window
-!
-_UI_LABEL_DERIVED_BY = Derived by:
-_UI_TOOLTIP_DERIVED_BY = Derive by extension to inherit from a base type content model and add to it. Derive by restriction to restrict the content model of an existing type.
-
-!
-! Element & Element Ref Window
-!
-_UI_ELEMENT_NAME = Name:
-_UI_CHECKBOX_NILLABLE = Nillable
-_UI_CHECKBOX_ABSTRACT = Abstract
-_UI_SUBSTITUTION = Substitution group:
-_UI_MINIMUM = Minimum:
-_UI_MAXIMUM = Maximum:
-_UI_REFERENCE_NAME = Reference name:
-
-_UI_TOOLTIP_ELEMENT_MINIMUM = A non-negative integer that specifies the minimum number of times an element can occur.
-_UI_TOOLTIP_ELEMENT_MAXIMUM = A non-negative integer or unbounded if there is no upper limit on the number of times the element can occur.
-_UI_TOOLTIP_ELEMENT_ABSTRACT = When an element is declared abstract, a member of its equivalent class must appear in the instance document,
-_UI_TOOLTIP_ELEMENT_NIL = If selected, an attribute can be included in the instance document to indicate that the element has a nil value.
-_UI_TOOLTIP_ELEMENT_SUBSTITUTION = Select the element that can be substituted by this element
-_UI_TOOLTIP_ELEMENT_FORM = Indicates if the element is qualifed in the instance document
-_UI_TOOLTIP_ELEMENT_VALUE = Provides a default or fixed value for the element.
-
-
-!
-! Attribute Window
-! _UI_COMBO_BOX strings are used in code generation.
-! Probably don't need to be translated
-!
-_UI_COMBO_BOX_REQUIRED = required
-_UI_COMBO_BOX_OPTIONAL = optional
-_UI_COMBO_BOX_PROHIBITED = prohibited
-
-_UI_FIXED = Fixed
-_UI_DEFAULT = Default
-_UI_ATTRIBUTE_NAME = Attribute name:
-_UI_USAGE = &Usage:
-_UI_FORM = &Form qualification:
-
-_UI_LABEL_OTHER_ATTRIBUTES = Other Attributes
-
-_UI_TOOLTIP_ATTRIBUTE_USE = Indicates if the attribute is required, optional, or prohibited
-_UI_TOOLTIP_ATTRIBUTE_VALUE = Provides default or fixed value for the attribute. Default value only valid if Usage value is set to optional.
-
-_UI_PROCESS_CONTENTS = Process contents:
-
-!
-! Annotation - Doc & AppInfo Window
-!
-_UI_COMMENT = Comment
-_UI_TOOLTIP_COMMENT = Information useful to the user or application
-_UI_SOURCE = Source:
-_UI_TOOLTIP_SOURCE = An optional URI reference to supplement the local information
-_UI_LANGUAGE = Language:
-_UI_TOOLTIP_LANGUAGE_ANNOTATION = Indicate the language in which the annotation is expressed
-
-!
-! Group
-!
-_UI_CONTENT_MODEL = Content model
-_UI_SEQUENCE = Sequence
-_UI_CHOICE = Choice
-_UI_ALL = All
-
-
-!
-! Simple Type Related Facets - appear as entries in a table - restriction on simple type
-!
-_UI_GROUP_FACETS = Facets
-_UI_LENGTH = Length
-_UI_MINIMUM_LENGTH = Minimum Length
-_UI_MAXIMUM_LENGTH = Maximum Length
-_UI_MINIMUM_INCLUSIVE = Minimum Inclusive
-_UI_MAXIMUM_INCLUSIVE = Maximum Inclusive
-_UI_MINIMUM_EXCLUSIVE = Minimum Exclusive
-_UI_MAXIMUM_EXCLUSIVE = Maximum Exclusive
-_UI_TOTAL_DIGITS = Total Digits
-_UI_FRACTION_DIGITS = Fraction Digits
-_UI_WHITE_SPACE = White Space
-_UI_FACET_NAME = Name
-_UI_FACET_VALUE = Value
-_UI_FACET_FIXED = Fixed
-
-_UI_TOOLTIP_LENGTH = The number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MIN_LEN = The minimum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_LEN = The maximum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_INCLUSIVE = The upper bound of the value space. The value is itself included.
-_UI_TOOLTIP_MAX_EXCLUSIVE = The upper bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_MIN_INCLUSIVE = The lower bound of the value space. The value is itself included.
-_UI_TOOLTIP_MIN_EXCLUSIVE = The lower bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_TOTAL_DIGITS = The maximum number of decimal digits. Must be a positive integer.
-_UI_TOOLTIP_FRACTION_DIGITS = The maximum number of decimal digits in the fractional part. Must be a non-negative integer.
-_UI_TOOLTIP_WHITE_SPACE = Indicates if white space should be preserved, replaced or collapsed.
-
-_UI_TOOLTIP_PATTERN = Constrains the value to match a specific pattern. The pattern must be a regular expression.
-_UI_TOOLTIP_ENUM = Constrains the value to a specified set of values.
-
-!
-! Simple/Complex Type Selection
-!
-_UI_LABEL_TYPE_INFORMATION = Type information
-_UI_LABEL_BASE_TYPE = Base type
-_UI_LABEL_BASE_TYPE_WITH_COLON = &Base type:
-_UI_LABEL_SET_BASE_TYPE = Set Base Type
-_UI_ACTION_SET_BASE_TYPE = Set Base Type...
-_UI_RADIO_NONE = None
-_UI_RADIO_BUILT_IN_SIMPLE_TYPE = Built-in simple type
-_UI_RADIO_USER_DEFINED_SIMPLE_TYPE = User-defined simple type
-_UI_RADIO_USER_DEFINED_COMPLEX_TYPE = User-defined complex type
-_UI_LABEL_NEW_COMPLEX_TYPE = New Complex Type
-_UI_LABEL_NEW_SIMPLE_TYPE = New Simple Type
-_UI_LABEL_SET_TYPE = Set Type
-_UI_LABEL_SET_EXISTING_TYPE = Set Existing Type...
-_UI_NO_TYPE = **none**
-_UI_LABEL_COMPONENTS = Components:
-_UI_LABEL_QUALIFIER = Qualifier:
-
-_UI_LABEL_COMPONENT_NAME = Component Name:
-_UI_LABEL_MATCHING_COMPONENTS = Matching Components:
-_UI_LABEL_MATCHING_TYPES = Matching Types:
-_UI_LABEL_TYPE_NAME = Type Name:
-_UI_LABEL_SPECIFIED_FILE = Specified File
-_UI_LABEL_ENCLOSING_PROJECT = Enclosing Project
-_UI_LABEL_WORKSPACE = Workspace
-_UI_LABEL_CURRENT_RESOURCE = Current Resource
-_UI_LABEL_SEARCH_SCOPE = Search Scope
-_UI_LABEL_NARROW_SEARCH_SCOPE_RESOURCE = Use resource view to narrow search scope
-_UI_LABEL_AVAILABLE_TYPES = Available Types
-
-
-!
-! Combo-box value
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_DEFAULT_ANONYMOUS = **anonymous**
-
-!
-! Unique, Key and KeyRef window
-!
-_UI_REFERENCE_KEY = Reference key
-_UI_SELECTOR = Selector
-_UI_FIELDS = Fields
-
-_UI_TOOLTIP_SELECTOR_TEXT = Specifies an XPath expression relative to instances of the current element
-_UI_TOOLTIP_FIELD_TEXT = Specifies an XPath expression relative to each element selected by the selector
-
-_UI_ADD_BUTTON = Add>>
-_UI_REMOVE_BUTTON = <<Remove
-
-!
-! Include & Imports
-!
-_UI_LABEL_PREFIX = &Prefix:
-_UI_LABEL_NAMESPACE = &Namespace:
-
-_UI_SCHEMA_INCLUDE_DESC = Select a schema file so that the definitions in the schema file will be available in the current schema. The target namespace of the included schema must be the same as the target namespace of the current schema.
-_UI_LABEL_SCHEMA_IMPORT_DESC = Select a schema file from a different namespace so that its definitions can be referenced by the current schema. You must associate a prefix with the new namespace for use in the current schema.
-
-_UI_LABEL_SCHEMA_LOCATION = &Schema location:
-_UI_BUTTON_SELECT = Select
-_UI_FILEDIALOG_SELECT_XML_SCHEMA = Select XML schema file
-_UI_FILEDIALOG_SELECT_XML_DESC = Select an XML schema file from the Workbench projects
-_UI_FILEDIALOG_SELECT_XML_URL = Select an XML schema file from HTTP
-
-_UI_LABEL_LOADING_XML_SCHEMA = Loading XML Schema
-_UI_LABEL_FINISH_LOADING = Finish Loading
-_UI_LABEL_NO_LOCATION_SPECIFIED = No Location Specified
-
-!
-! XSD Editor
-!
-_UI_TAB_SOURCE = Source
-_UI_TAB_DESIGN = Design
-! Note to translators: Graph is the graphic view of the XML schema
-_UI_TAB_GRAPH = Graph
-_UI_MENU_UNDO = &Undo @Ctrl+Z
-_UI_MENU_REDO = &Redo @Ctrl+Y
-
-!
-! Task List Related Message
-!
-_UI_REF_FILE_ERROR_DESCRIPTION = The errors below were detected when validating the file "{0}" via the file "{1}". In most cases these errors can be detected by validating "{2}" directly. However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_PUSH_HELP = Push the help button below to read more.
-_UI_REF_FILE_ERROR_MESSAGE = Referenced file contains errors ({0}). For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_SHOW_DETAILS = Show Details...
-
-
-!
-! XSDEditor Menu bar contributor
-!
-_UI_MENU_GENERATE_JAVA = Generate &Java Beans...
-_UI_MENU_GENERATE_DTD = Generate &DTD...
-_UI_MENU_GENERATE_SAMPLE_XML = Generate XM&L...
-_UI_MENU_XSD_EDITOR = &XSD
-_UI_MENU_VALIDATE_XML = &Validate XML Schema
-_UI_MENU_VALIDATE_XML_TOOLTIP = Validate the current state of the XML Schema
-_UI_MENU_GENERATE_JAVA_TOOLTIP = Generate Java beans for the XML Schema
-_UI_MENU_GENERATE_DTD_TOOLTIP = Generate a DTD from the XML Schema
-_UI_MENU_GENERATE_SAMPLE_XML_TOOLTIP = Generate an XML from the XML Schema
-_UI_MENU_RELOAD_DEPENDENCIES_TOOLTIP = Reload Dependencies
-_UI_MENU_RELOAD_DEPENDENCIES = &Reload Dependencies
-
-!
-! Preference Page
-!
-_UI_TEXT_INDENT_LABEL = Indentation
-_UI_TEXT_INDENT_SPACES_LABEL = &Number of spaces:
-_UI_TEXT_XSD_NAMESPACE_PREFIX = XML schema language
-_UI_TEXT_XSD_DEFAULT_PREFIX = XML schema language constructs &prefix:
-_UI_QUALIFY_XSD = &Qualify XML schema language constructs
-_UI_SEPARATE_DESIGN_AND_SOURCE_VIEW = Separate Source, Design and Graph view
-_UI_COMBINED_DESIGN_AND_SOURCE_VIEW = Combined Source or Graph view with Design view
-_UI_LABEL_EDITOR_LAYOUT = Editor Layout
-_UI_PREF_DESIGN_VIEW_LAYOUT = Design View Location
-_UI_PREF_DESIGN_BOTTOM = Below
-_UI_PREF_DESIGN_RIGHT = Right
-_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default Target Namespace:
-
-!
-! Content Outline View action
-! NOTE TO TRANSLATOR: Do not translate the word(s) following "Add" on each line in
-! this section i.e. Annotation, Documentation, AppInfo These words are XML Schema keywords.
-_UI_ACTION_DELETE = D&elete
-_UI_ACTION_ADD_ANNOTATION = Add &Annotation
-_UI_ACTION_ADD_DOC = Add &Documentation
-_UI_ACTION_ADD_APP_INFO = Add A&ppInfo
-_UI_ACTION_ADD_GLOBAL_ELEMENT = Add Glob&al Element
-_UI_ACTION_ADD_KEY = Add &Key
-_UI_ACTION_ADD_KEY_REF = Add Key Re&f
-_UI_ACTION_ADD_UNIQUE = Add Uni&que
-_UI_ACTION_ADD_GROUP = Add G&roup
-_UI_ADD_GROUP_REF = Add Gr&oup Ref
-_UI_ACTION_ADD_CONTENT_MODEL = Add Content &Model
-_UI_ACTION_ADD_ELEMENT = Add &Element
-_UI_ACTION_ADD_ELEMENT_REF = Add E&lement Ref
-_UI_ACTION_ADD_SIMPLE_TYPE = Add &Simple Type
-_UI_ACTION_ADD_PATTERN = Add &Pattern
-_UI_ACTION_ADD_ENUM = Add En&umeration
-_UI_ACTION_ADD_ENUMS = Add Enu&merations...
-_UI_ACTION_ADD_COMPLEX_TYPE = Add Complex &Type
-_UI_ACTION_ADD_COMPLEX_CONTENT = Add Comple&x Content
-_UI_ACTION_ADD_SIMPLE_CONTENT = Add Simple &Content
-_UI_ACTION_ADD_ATTRIBUTE = Add Attri&bute
-_UI_ACTION_ADD_ATTRIBUTE_GROUP = Add Attr&ibute Group
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF = Add A&ttribute Group Ref
-_UI_ACTION_ADD_INCLUDE = Add In&clude
-_UI_ACTION_ADD_IMPORT = Add &Import
-_UI_ACTION_ADD_REDEFINE = Add Re&define
-_UI_ACTION_ADD_NOTATION = Add &Notation
-_UI_ACTION_ADD_ANY_ELEMENT = Add An&y
-_UI_ACTION_ADD_ANY_ATTRIBUTE = Add &Any Attribute
-_UI_ACTION_ADD_GLOBAL_ATTRIBUTE = Add &Global Attribute
-_UI_ACTION_ADD_ATTRIBUTE_REFERENCE = Add Attrib&ute Ref
-_UI_ACTION_ADD_RESTRICTION = Add Re&striction
-_UI_ACTION_ADD_UNION = Add U&nion
-_UI_ACTION_ADD_LIST = Add &List
-_UI_ACTION_DELETE_GROUP_SCOPE = D&elete
-_UI_ACTION_ADD_CHOICE = Add &Choice
-_UI_ACTION_ADD_SEQUENCE = Add Se&quence
-_UI_ACTION_ADD_ALL = Add &All
-_UI_ACTION_ADD_EXTENSION = Add E&xtension
-_UI_ACTION_ADD_SELECTOR = Add &Selector
-_UI_ACTION_ADD_FIELD = Add &Field
-! NOTE TO TRANSLATOR: Translate Add and Node
-_UI_ACTION_ADD_SCHEMA_NODE = Add &Schema Node
-! NOTE TO TRANSLATOR: TRANSLATE Add and Local
-_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE = Add Local &Simple Type
-_UI_ACTION_ADD_LOCAL_COMPLEX_TYPE = Add Local &Complex Type
-_UI_ACTION_BACK_TO_SCHEMA_VIEW = Back To Schema
-_UI_HOVER_BACK_TO_SCHEMA_VIEW = Back to schema
-
-_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL = Make Anonymous Type Global
-_UI_ACTION_OPEN_SCHEMA = Open Schema
-
-_UI_ACTION_INSERT_BEFORE = Insert Before
-_UI_ACTION_INSERT_AFTER = Insert After
-
-_UI_OUTLINE_SORT = Sort alphabetically
-_UI_OUTLINE_DO_NOT_SORT = Do not sort alphabetically
-
-_UI_OUTLINE_SHOW_COMPLEX_TYPE = Show Complex Types Only
-_UI_OUTLINE_SHOW_SIMPLE_TYPE = Show Simple Types Only
-_UI_OUTLINE_SHOW_ATTRIBUTE_GROUP = Show Attribute Groups Only
-_UI_OUTLINE_SHOW_GROUP = Show Groups Only
-_UI_OUTLINE_SHOW_GLOBAL_ELEMENT = Show Global Elements Only
-_UI_OUTLINE_SHOW_REFERENCES = Show Reference Content
-_UI_OUTLINE_SHOW_INHERITED = Show Inherited Content
-
-_UI_ACTION_SET_MULTIPLICITY = Set Multiplicity
-
-!
-! New XML Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_MODEL_TITLE = Create XML Schema
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_CREATEXSD = createXSD
-_UI_NEW_XML_SCHEMA_TITLE = New XML Schema
-_UI_CREATE_A_NEW_XML_SCHEMA_DESC = Create a new XML schema.
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_NEW_XML_SCHEMA_FILENAME = NewXMLSchema.xsd
-
-!
-! XSD From RDB Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_FROM_RDB_TITLE = Create XSD from RDB Table
-
-
-!
-! Regular Expression Wizard
-!
-_UI_REGEX_WIZARD_CREATE_BUTTON = Create Regular Expression...
-_UI_TOOLTIP_REGEX_WIZARD_BUTTON = Launch the Regular Expression Wizard
-_UI_REGEX_WIZARD_TITLE = Regular Expression Wizard
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE = Compose Regular Expression
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION = To add a token, specify its contents and occurrence, then click Add.
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR_PREFIX = The current regular expression is not valid. Reason:
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR_PREFIX = The current token is not valid. Reason:
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR = The current regular expression is not valid.
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR = The current token is not valid.
-_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX = Invalid minimum range value. The value must be a positive integer less than the maximum value.
-_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX = Invalid minimum range value. A minimum range must be specified if a maximum range is specified.
-_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX = Invalid maximum range value. The value must be a positive integer greater than the minimum value.
-_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX = Invalid repeat value. The value must be a positive integer.
-_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR = Nothing is currently selected. Either make a selection or choose a different token.
-_UI_REGEX_WIZARD_TOKEN_LABEL = &Token contents:
-_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL = Auto &escape
-_UI_REGEX_WIZARD_OCCURENCE_LABEL = Occurrence
-! Instructions for translators: The following label is used in a phrase to identify a range of values.
-! For example: 5 to 10.
-! The values are text fields that are initially blank so the user has to enter in values
-! For example: _______ to ________
-_UI_REGEX_WIZARD_TO_LABEL = to
-_UI_REGEX_WIZARD_ADD_BUTTON_LABEL = &Add
-_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL = &Current regular expression:
-_UI_TOOLTIP_REGEX_WIZARD_TERMS = Content of new token
-_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX = Insert escape characters to match metacharacter literals (e.g. converts \"*\" to \"\\*\")
-_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON = Add this token to the regular expression
-_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX = The current regular expression
-_UI_TOOLTIP_REGEX_WIZARD_REPEAT = The number of times that the token must occur.
-_UI_TOOLTIP_REGEX_WIZARD_MIN = The minimum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_MAX = The maximum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL = The location where the new token will be inserted.
-_UI_REGEX_WIZARD_TESTING_PAGE_TITLE = Test Regular Expression
-_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION = To test the regular expression, enter sample text that you wish to match. The success of the match will be indicated above.
-_UI_REGEX_WIZARD_REGEX_LABEL = Regular expression:
-_UI_REGEX_WIZARD_SAMPLE_TEXT = Sample text:
-_UI_REGEX_WIZARD_MATCHES = The text matches the regular expression.
-_UI_REGEX_WIZARD_DOES_NOT_MATCH = The text does not match the regular expression.
-_UI_REGEX_WIZARD_TERM_ANY_CHAR = Any character
-_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR = Alphanumeric character
-_UI_REGEX_WIZARD_TERM_WHITESPACE = Whitespace
-_UI_REGEX_WIZARD_TERM_DIGIT = Digit
-_UI_REGEX_WIZARD_TERM_UPPER = Upper case
-_UI_REGEX_WIZARD_TERM_LOWER = Lower case
-_UI_REGEX_WIZARD_TERM_SELECTION = Current selection
-_UI_REGEX_WIZARD_QUANTIFIER_SINGLE = &Just once
-_UI_REGEX_WIZARD_QUANTIFIER_STAR = &Zero or more
-_UI_REGEX_WIZARD_QUANTIFIER_PLUS = &One or more
-_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL = O&ptional
-_UI_REGEX_WIZARD_QUANTIFIER_REPEAT = &Repeat
-_UI_REGEX_WIZARD_QUANTIFIER_RANGE = Ran&ge
-
-!
-! Select Include File Wizard
-_UI_LABEL_INCLUDE_URL_FILE = Select schema from:
-_UI_RADIO_URL = &HTTP
-_UI_RADIO_FILE = &Workbench projects
-_UI_WIZARD_INCLUDE_FILE_TITLE = Select a schema
-_UI_WIZARD_INCLUDE_FILE_DESC = Select another schema from workbench projects or from HTTP.
-_UI_LABEL_URL = URL:
-_UI_URL_START_WITH = The URL must start with http://
-_UI_SPECIFY_URL = Please specify a URL
-
-!
-! Enumerations Dialog
-_UI_ENUMERATIONS_DIALOG_TITLE = Add Enumerations
-_UI_LABEL_DELIMITER_CHAR = &Delimiter characters:
-_UI_LABEL_PRESERVE_WHITESPACE = &Preserve leading and trailing whitespace
-
-_UI_ACTION_DELETE_ENUMERATION = Delete Enumeration
-
-!
-! Validate Schema
-!
-_UI_DIALOG_XML_SCHEMA_INVALID_TITLE = Validation Failed
-_UI_DIALOG_XML_SCHEMA_VALID_TITLE = Validation Succeeded
-_UI_DIALOG_XML_SCHEMA_VALID_TEXT = The XML schema file is valid.
-_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = The XML schema file is valid however warnings have been issued. See the Problems view for the warning messages.
-_UI_DIALOG_XML_SCHEMA_INVALID_TEXT = The XML schema file is not valid. See the Problems view for the error messages.
-
-!
-! Combo-box choices
-!
-! NOTE TO TRANSLATOR: Do not translate following 10 lines
-_UI_COMBO_QUALIFIED = qualified
-_UI_COMBO_UNQUALIFIED = unqualified
-_UI_COMBO_EXTENSION = extension
-_UI_COMBO_RESTRICTION = restriction
-_UI_COMBO_ALL = all
-_UI_COMBO_TRUE = true
-_UI_COMBO_FALSE = false
-_UI_COMBO_LAX = lax
-_UI_COMBO_SKIP = skip
-_UI_COMBO_STRICT = strict
-
-! Generate DTD - pass as title and description for wizard page
-_UI_GENERATE_DTD_TITLE = Generate DTD
-_UI_GENERATE_DTD_DESCRIPTION = Generate a DTD from the selected XML schema file.
-
-! Generate DDL - pass as title and description for wizard page
-_UI_GENERATE_DDL_TITLE = Generate DDL
-_UI_GENERATE_DDL_DESCRIPTION = Generate DDL from the selected XML schema file.
-
-_UI_XML_SCHEMA_VALIDATOR = XML Schema Validator
-
-! Generation from the Schema model - pre-condition check
-_UI_DIALOG_TITLE_GRAMMAR_ERROR = Invalid Grammar
-_UI_DIALOG_INFO_SCHEMA_INVALID = The schema file contains errors. Open it in the XML Schema editor and validate it for details.
-_UI_DIALOG_TITLE_NO_GLOBAL_ELEMENTS = No Global Elements
-_UI_DIALOG_INFO_NO_GLOBAL_ELEMENTS = The selected schema has no global elements. Global elements are required to generate anything from an XML schema.
-
-! Section title for other attributes
-_UI_SECTION_ADVANCED_ATTRIBUTES = Advanced
-
-! For undo action menus
-! Note to Translators: For the following "Change" phrases,
-! maxOccurs, minOccurs, lang, xpath are keywords so please
-! do no translate them. These are for the undo action menus.
-! For example, if the user makes a change in the name of an
-! element, then the undo action would be Undo Element Name Change
-_UI_NAMESPACE_CHANGE = Namespace Change
-_UI_PROCESSCONTENTS_CHANGE = Process Contents Change
-_UI_MAXOCCURS_CHANGE = maxOccurs Change
-_UI_MINOCCURS_CHANGE = minOccurs Change
-_UI_SOURCE_ATTRIBUTE_CHANGE = Source Change
-_UI_COMMENT_CHANGE = Comment Change
-_UI_PREFIX_CHANGE = Prefix Change
-_UI_ATTRIBUTEGROUP_REF_CHANGE = Attribute Group Reference Change
-_UI_ATTRIBUTEGROUP_NAME_CHANGE = Attribute Group Name Change
-_UI_ATTRIBUTE_FIXED_CHANGE = Attribute Fixed Change
-_UI_ATTRIBUTE_DEFAULT_CHANGE = Attribute Default Change
-_UI_ATTRIBUTE_NAME_CHANGE = Attribute Name Change
-_UI_ATTRIBUTE_VALUE_CHANGE = Attribute Value Change
-_UI_ATTRIBUTE_USE_CHANGE = Attribute Use Change
-_UI_ATTRIBUTE_FORM_CHANGE = Attribute Form Change
-_UI_COMPLEXTYPE_NAME_CHANGE = Complex Type Name Change
-_UI_COMPLEXTYPE_ABSTRACT_CHANGE = Complex Type Abstract Change
-_UI_COMPLEXTYPE_MIXED_CHANGE = Complex Type Mixed Change
-_UI_COMPLEXTYPE_BLOCK_CHANGE = Complex Type Block Change
-_UI_COMPLEXTYPE_FINAL_CHANGE = Complex Type Final Change
-_UI_DOCUMENTATION_SOURCE_CHANGE = Documentation Source Change
-_UI_DOCUMENTATION_LANG_CHANGE = Documentation lang Change
-_UI_DOCUMENTATION_COMMENT_CHANGE = Documentation Comment Change
-_UI_ELEMENT_NAME_CHANGE = Element Name Change
-_UI_ELEMENT_VALUE_CHANGE = Element Value Change
-_UI_ELEMENT_TYPE_CHANGE = Element Type Change
-_UI_ENUM_VALUE_CHANGE = Enum Value Change
-_UI_FIELD_XPATH_CHANGE = Field xpath Change
-_UI_GROUP_REF_CHANGE = Group Reference Change
-_UI_GROUP_SCOPE_CHANGE = Content Model Change
-_UI_GROUP_NAME_CHANGE = Group Name Change
-_UI_IMPORT_CHANGE = Import Change
-_UI_KEY_NAME_CHANGE = Key Name Change
-_UI_KEYREF_NAME_CHANGE = Key Reference Name Change
-! Note to translators
-! For the following item, Refer is the keyref attribute to refer to some other key
-_UI_KEYREF_REFER_CHANGE = Key Reference Refer Change
-_UI_NOTATION_NAME_CHANGE = Notation Name Change
-_UI_NOTATION_PUBLIC_CHANGE = Notation Public Change
-_UI_NOTATION_SYSTEM_CHANGE = Notation System Change
-_UI_PATTERN_VALUE_CHANGE = Pattern Value Change
-_UI_SCHEMA_VERSION_CHANGE = Schema Version Change
-_UI_SCHEMA_LANG_CHANGE = Schema lang Change
-_UI_SELECTOR_XPATH_CHANGE = Selector xpath Change
-_UI_TYPE_CHANGE = Type Change
-_UI_DERIVEDBY_CHANGE = Derivation Change
-_UI_FACET_CHANGE = Facet Change
-_UI_SIMPLETYPE_NAME_CHANGE = SimpleType Name Change
-_UI_UNIQUE_NAME_CHANGE = Unique Name Change
-_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE = Attribute Form Default Change
-_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE = Element Form Default Change
-_UI_SCHEMA_BLOCKDEFAULT_CHANGE = Block Default Change
-_UI_SCHEMA_FINALDEFAULT_CHANGE = Final Default Change
-_UI_ELEMENT_SUBSTITUTIONGROUP_CHANGE = Substitution Group Change
-_UI_ELEMENT_FORM_CHANGE = Form Change
-_UI_ELEMENT_BLOCK_CHANGE = Block Change
-_UI_ELEMENT_FINAL_CHANGE = Final Change
-_UI_ELEMENT_ABSTRACT_CHANGE = Abstract Change
-_UI_ELEMENT_NILLABLE_CHANGE = Nillable Change
-_UI_TARGETNAMESPACE_CHANGE = Target Namespace Change
-
-! Window Headings for Flat View
-_UI_PAGE_HEADING_ANYATTRIBUTE = Any Attribute
-_UI_PAGE_HEADING_ANYELEMENT = Any Element
-_UI_PAGE_HEADING_APPINFO = AppInfo
-_UI_PAGE_HEADING_ATTRIBUTEGROUP_REF = Attribute Group Reference
-_UI_PAGE_HEADING_ATTRIBUTEGROUP = Attribute Group
-_UI_PAGE_HEADING_ATTRIBUTE_REF = Attribute Reference
-_UI_PAGE_HEADING_ATTRIBUTE = Attribute
-_UI_PAGE_HEADING_COMPLEXTYPE = Complex Type
-_UI_PAGE_HEADING_DOCUMENTATION = Documentation
-_UI_PAGE_HEADING_ELEMENT = Element
-_UI_PAGE_HEADING_ELEMENT_REF = Element Reference
-_UI_PAGE_HEADING_ENUM = Enumeration
-_UI_PAGE_HEADING_FIELD = Field
-_UI_PAGE_HEADING_GROUP_REF = Group Reference
-_UI_PAGE_HEADING_CONTENTMODEL = Content Model
-_UI_PAGE_HEADING_GROUP = Group
-_UI_PAGE_HEADING_IMPORT = Import
-_UI_PAGE_HEADING_INCLUDE = Include
-_UI_PAGE_HEADING_KEYREF = Key Reference
-_UI_PAGE_HEADING_KEY = Key
-_UI_PAGE_HEADING_NOTATION = Notation
-_UI_PAGE_HEADING_PATTERN = Pattern
-_UI_PAGE_HEADING_REDEFINE = Redefine
-_UI_PAGE_HEADING_SCHEMA = Schema
-_UI_PAGE_HEADING_SELECTOR = Selector
-_UI_PAGE_HEADING_LIST = List
-_UI_PAGE_HEADING_UNION = Union
-_UI_PAGE_HEADING_SIMPLECONTENT = Simple Content
-_UI_PAGE_HEADING_COMPLEXCONTENT = Complex Content
-_UI_PAGE_HEADING_RESTRICTION = Restriction
-_UI_PAGE_HEADING_EXTENSION = Extension
-_UI_PAGE_HEADING_SIMPLETYPE = Simple Type
-_UI_PAGE_HEADING_UNIQUE = Unique
-_UI_PAGE_HEADING_REFERENCE = reference
-
-!
-! Graph page
-!
-_UI_GRAPH_SIMPLE_TYPES = Simple Types
-_UI_GRAPH_COMPLEX_TYPES = Complex Types
-_UI_GRAPH_GROUPS = Groups
-_UI_GRAPH_GLOBAL_ATTRIBUTES = Global Attributes
-_UI_GRAPH_GLOBAL_ELEMENTS = Global Elements
-_UI_GRAPH_XSDSCHEMA = Schema
-_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified)
-_UI_GRAPH_XSDCOMPLEXTYPEDEFINITION = XSD Complex Type Definition:
-_UI_GRAPH_XSDMODELGROUP = XSD Model Group
-_UI_GRAPH_XSDPARTICLE = XSD Particle
-_UI_GRAPH_VIEW_NOT_AVAILABLE = View is not available for selected object.
-_UI_GRAPH_UNKNOWN_OBJECT = Unknown object
-
-! Additional Categories
-_UI_GRAPH_TYPES = Types
-_UI_GRAPH_ELEMENTS = Elements
-_UI_GRAPH_ATTRIBUTES = Attributes
-_UI_GRAPH_ATTRIBUTE_GROUPS = Attribute Groups
-_UI_GRAPH_NOTATIONS = Notations
-_UI_GRAPH_IDENTITY_CONSTRAINTS = Identity Constraints
-_UI_GRAPH_ANNOTATIONS = Annotations
-_UI_GRAPH_DIRECTIVES = Directives
-
-! For Union MemberTypes Dialog
-_UI_LABEL_SELECT_MEMBERTYPES = Select from the available types and add to the memberTypes list
-_UI_LABEL_MEMBERTYPES_CHANGE = Member Types Change
-_UI_LABEL_MEMBERTYPES_VALUE = Member Types Value:
-_UI_LABEL_MEMBERTYPES = Member types:
-
-_UI_LABEL_VARIETY_CHANGE = Variety Change
-
-_UI_LABEL_FIXEDORDEFAULT_VALUE = Fixed/Default Value
-
-_UI_LABEL_ITEM_TYPE_CHANGE = Item Type Change
-
-_UI_LABEL_INCLUDE_CHANGE = Include Change
-
-_UI_LABEL_ITEM_TYPE = Item type:
-_UI_LABEL_TYPE = Type
-_UI_LABEL_MODEL_GROUP = Model Group
-
-_UI_LABEL_ABSENT = absent
-
-_UI_WARNING_RESET_ATTRGRP_REF = Reset attribute group reference <{0}>
-_UI_WARNING_REMOVE_ATTRGRP_REF = Remove attribute group reference <{0}>
-_UI_WARNING_RESET_ATTR_REF = Reset attribute reference <{0}>
-_UI_WARNING_REMOVE_ATTR_REF = Remove attribute reference <{0}>
-
-!======================================================================================
-!
-! Here is the list of Error string that have message IDs - make sure they are unique
-
-!
-!======================================================================================
-! These three errors appear in the select include wizard
-! The name of the file will be substituted in
-_UI_DIFFERENT_NAME_SPACE = {0} is in a different namespace
-_UI_SAME_NAME_SPACE = {0} is in the same namespace
-_UI_INCORRECT_XML_SCHEMA = {0} is an invalid XML schema file
-
-_ERROR_SCHEMA_NOT_EXIST = Does not exist.
-_ERROR_LABEL_INVALID_PREFIX = Invalid prefix. A prefix must not be empty or contain any space.
-
-! The name of the file will be substituted in
-_ERROR_SCHEMA_NAME_THE_SAME = {0} is the current schema. A schema cannot include itself. Reset to the last valid schema.
-
-_ERROR_XSD_GENERATION = Error generating XML schema
-_ERROR_NO_CONTAINER = No folder selected
-_ERROR_NO_FILE_NAME = No file name provided
-_ERROR_FILENAME_MUST_END_XSD = The file name must end in .xsd
-
-
-!
-! For schema that has too many errors, an extended message.
-!
-_ERROR_DIALOG_XML_SCHEMA_INVALID_TEXT = The XML schema file is not valid.
-_ERROR_MORE_ERRORS = There are more errors in the schema than are displayed in the Tasks view. Correct the first {0} errors and re-validate the schema file.
-
-! DDL Generation Failed Dialog
-_UI_DIALOG_DDL_GEN_FAILED_TITLE = DDL Generation Failed
-_ERROR_DIALOG_DDL_NOT_GENEREATED = DDL has not been generated
-_UI_DIALOG_DDL_GEN_FAILED_REASON = The selected schema has no global elements
-_UI_DIALOG_DDL_GEN_FAILED_REASON2 = None of the global elements in the schema have a complex type or they reference complex types that cannot be found.
-
-_EXC_OPEN_XSD = Cannot open XML Schema editor
-
-_ERROR_LABEL_PREFIX_EXISTS = Prefix already exists
-
-_ERROR_REMOVE_LOCAL_SIMPLETYPE = Remove local simple type from extension
-
-_WARN_INVALID_TARGET_NAMESPACE = The target namespace is not well-formed
-
-_ERROR_TARGET_NAMESPACE_AND_PREFIX = A target namespace must be associated with a prefix
-
-
-_UI_CONTAINMENT = Containment
-_UI_INHERITANCE = Inheritance
-_UI_SUBSTITUTION_GROUPS = Substitution Groups
-_UI_ANONYMOUS = **anonymous**
-_UI_VALUE = Value
-_UI_ANY_ELEMENT = Any Element
-_UI_SORT = Sort
-
-_UI_ACTION_EDIT_NAMESPACES = Edit &Namespaces...
-
-
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
-
-!======================================================================================
-!
-! Used by org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView
-!
-!======================================================================================
-_UI_LABEL_SOURCE_FILES = Workbench Files
-_UI_LABEL_SELECTED_FILES = Selected Files
-
-_UI_IMPORT_BUTTON = Import Files...
-_UI_IMPORT_BUTTON_TOOL_TIP = Import files from file system
-
-
-!======================================================================================
-!
-! refactoring
-!
-!======================================================================================
-refactoringActionSet.label=Refac&tor
-refactoringActionSet.description=XSD Editor refactoring actions
-refactoring.menu.label=Refac&tor
-refactoring.renameAction.label=Re&name...
-context.text.editor.xsd.name=Editing XSD context
-command.xsd.refactor.rename.element.name=&Rename XSD element
-command.xsd.refactor.rename.element.description=Rename XSD element
-command.xsd.refactor.makeElementGlobal.element.name=Make Local Element &Global
-command.xsd.refactor.makeElementGlobal.element.description=Promotes local element to global level and replaces its references
-command.xsd.refactor.makeTypeGlobal.element.name=Make &Anonymous Type Global
-command.xsd.refactor.makeTypeGlobal.element.description=Promotes anonymous type to global level and replaces its references
-command.xsd.refactor.renameTargetNamespace.name=Rename Target Namespace
-command.xsd.refactor.renameTargetNamespace.description=Changes the target namespace of the schema
-xsd.resource.rename.participant.name=Rename XSD Component
-ExtensionsSchemasDescription=This extension point is deprecated, use extensionCategories
-ExtensionCategoriesDescription=Extension point for contributing to the 'built in' categories of extension elements for XML Schema
-XSDEditorExtensionConfiguration=This extension point is deprecated, use internalEditorConfiguration
-InternalEditorConfiguration=Extension point for extending the XML Schema Editor
-
-! Copied from sse
-23concat_EXC_=Resource {0} does not exist.
-32concat_EXC_=Editor could not be open on {0}
-An_error_has_occurred_when1_ERROR_=An error has occurred when initializing the input for the the editor's source page.
-OpenFileFromSource.label=Op&en Selection
-OpenFileFromSource.tooltip=Open an editor on the selected link
-OpenFileFromSource.image=
-OpenFileFromSource.description=Open an editor on the selected link
-
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-
-_ZERO_OR_MORE = Zero or More
-_ZERO_OR_ONE = Zero or One
-_ONE_OR_MORE = One or More
-
-# For translators, as in structured DOM tree
-_UI_LABEL_STRUCTURED = Structured
-
-_UI_LABEL_MOVE = Move
-_UI_LABEL_RENAME = Rename
-_UI_LABEL_TARGETNAMESPACE_CHANGE = Target Namespace Change
-_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE = Reset attribute group reference
-_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE = Remove attribute group reference
-
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-search.declarations.label = Declarations
-search.references.label = Re&ferences
-
-! extension points
-ExtensionNodeCustomizationsDescription = Extension Node Customizations
-XMLSchemaEditorModes = XML Schema Editor Modes
-##
-XSD_Source_target_name=XML Schema Source
-XSD_hyperlink=XML Schema Content
-
-
-XSD_DESIGN_VIEW_DESCRIPTION=XSD Editor Design View
-XSD_DESIGN_VIEW=XSD Editor Design View
-XSD_SOURCE_VIEW_DESCRIPTION=XSD Editor Source View
-XSD_SOURCE_VIEW=XSD Editor Source View \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
deleted file mode 100644
index 94f21e3800..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml
+++ /dev/null
@@ -1,695 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%_UI_EDITOR_NAME"
- icon="icons/XSDFile.gif"
- contributorClass="org.eclipse.wst.xsd.ui.internal.editor.XSDMultiPageEditorContributor"
- class="org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"
- id="org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.xsd.core.xsdsource" />
- </editor>
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- targetID="org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"
- id="org.eclipse.wst.xsd.core.xsdsource.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.newWizards">
- <wizard
- id="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"
- name="%_UI_WIZARD_NEW_XSD"
- class="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"
- category="org.eclipse.wst.XMLCategory"
- icon="icons/ctool16/NewXSD.gif">
- <description>%_UI_CREATE_A_NEW_SCHEMA</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="%_UI_XML_SCHEMA_PREFERENCE"
- category="org.eclipse.wst.xml.ui.preferences.xml"
- class="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
- id="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage">
- </page>
- <page
- category="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
- class="org.eclipse.wst.xsd.ui.internal.preferences.XSDEditorPreferencePage"
- id="org.eclipse.wst.xsd.ui.internal.preferences.XSDEditorPreferencePage"
- name="%_UI_XML_SCHEMA_EDITOR_PREFERENCE">
- </page>
- <page
- category="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
- class="org.eclipse.wst.xsd.ui.internal.preferences.XSDValidatorPreferencePage"
- id="org.eclipse.wst.xsd.ui.internal.preferences.XSDValidatorPreferencePage"
- name="%_UI_XML_SCHEMA_VALIDATOR_PREFERENCE">
- </page>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
- target="org.eclipse.wst.xsd.core.xsdsource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.xsd.ui.internal.editor.StructuredTextViewerConfigurationXSD"
- target="org.eclipse.wst.xsd.core.xsdsource" />
- </extension>
-
- <!-- ==================================================== -->
- <!-- Support help on the tags -->
- <!-- ==================================================== -->
- <!-- <extension
- point="org.eclipse.wst.xml.core.internal.contentmodel.annotationFiles">
- <annotationFile
- location="/w3c/schemaForCodeAssist-annotations.xml"
- publicId="http://www.w3.org/2001/XMLSchema">
- </annotationFile>
- </extension>
- -->
-
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.eclipse.wst.xsd.ui.internal.editor"
- labelProvider="org.eclipse.wst.xsd.ui.internal.common.properties.providers.XSDSectionLabelProvider">
- <propertyCategory category="General"/>
- <propertyCategory category="Documentation"/>
- <propertyCategory category="Advanced"/>
- </propertyContributor>
- </extension>
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
- contributorId="org.eclipse.wst.xsd.ui.internal.editor">
- <propertyTab
- label="%_UI_LABEL_GENERAL"
- category="General"
- id="property.tab.general">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_TYPE_CONSTRAINTS"
- category="General"
- afterTab="property.tab.general"
- id="property.tab.typeconstraints">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_ENUMERATIONS"
- category="General"
- afterTab="property.tab.general"
- id="property.tab.enumerations">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_ADVANCED"
- category="Advanced"
- afterTab="property.tab.general"
- id="property.tab.advanced">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_DOCUMENTATION"
- category="Documentation"
- afterTab="property.tab.general"
- id="property.tab.documentation">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_EXTENSIONS"
- category="Documentation"
- afterTab="property.tab.general"
- id="property.tab.extensions">
- </propertyTab>
- </propertyTabs>
- </extension>
-
-
-<extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections contributorId="org.eclipse.wst.xsd.ui.internal.editor">
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSchemaSection"
- id="prop.section.XSDSchemaSection">
- <input type="org.eclipse.xsd.XSDSchema">
- </input>
- </propertySection>
- <propertySection tab="property.tab.advanced"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSchemaAdvancedSection"
- id="prop.section.XSDSchemaSection">
- <input type="org.eclipse.xsd.XSDSchema">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.SchemaLocationSection"
- id="prop.section.SchemaLocationSection">
- <input type="org.eclipse.xsd.XSDSchemaCompositor">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDComplexTypeSection"
- id="prop.section.XSDComplexTypeSection">
- <input type="org.eclipse.xsd.XSDComplexTypeDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.advanced"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDComplexTypeAdvancedSection"
- id="prop.section.XSDComplexTypeAdvancedSection">
- <input type="org.eclipse.xsd.XSDComplexTypeDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDElementDeclarationSection"
- id="prop.section.XSDElementDeclarationSection">
- <input type="org.eclipse.xsd.XSDElementDeclaration">
- </input>
- </propertySection>
- <propertySection tab="property.tab.advanced"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDElementDeclarationAdvancedSection"
- id="prop.section.XSDElementDeclarationAdvancedSection">
- <input type="org.eclipse.xsd.XSDElementDeclaration">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDAttributeDeclarationSection"
- id="prop.section.XSDAttributeDeclarationSection">
- <input type="org.eclipse.xsd.XSDAttributeDeclaration">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDAttributeGroupDefinitionSection"
- id="prop.section.XSDAttributeGroupDefinitionSection">
- <input type="org.eclipse.xsd.XSDAttributeGroupDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDModelGroupSection"
- id="prop.section.XSDModelGroupSection">
- <input type="org.eclipse.xsd.XSDModelGroup">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDModelGroupDefinitionSection"
- id="prop.section.XSDModelGroupDefinitionSection">
- <input type="org.eclipse.xsd.XSDModelGroupDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSimpleTypeSection"
- id="prop.section.XSDSimpleTypeSection">
- <input type="org.eclipse.xsd.XSDSimpleTypeDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.advanced"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSimpleTypeAdvancedSection"
- id="prop.section.XSDSimpleTypeAdvancedSection">
- <input type="org.eclipse.xsd.XSDSimpleTypeDefinition">
- </input>
- </propertySection>
- <propertySection tab="property.tab.typeconstraints"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDFacetSection"
- filter="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDFacetSectionFilter"
- id="prop.section.XSDFacetSection">
- <input type="org.eclipse.xsd.XSDConcreteComponent">
- </input>
- </propertySection>
- <propertySection tab="property.tab.documentation"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.AnnotationSection"
- id="prop.section.AnnotationSection">
- <input type="org.eclipse.xsd.XSDConcreteComponent">
- </input>
- </propertySection>
- <propertySection tab="property.tab.extensions"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.ExtensionsSection"
- id="prop.section.ExtensionsSection">
- <input type="org.eclipse.xsd.XSDConcreteComponent">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDAnyElementContentsSection"
- id="prop.section.general">
- <input type="org.eclipse.xsd.XSDWildcard">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDImportSection"
- id="prop.section.general">
- <input type="org.eclipse.xsd.XSDImport">
- </input>
- </propertySection>
- <propertySection tab="property.tab.general"
- class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDEnumerationFacetSection"
- id="prop.section.general">
- <input type="org.eclipse.xsd.XSDEnumerationFacet">
- </input>
- </propertySection>
- </propertySections>
-</extension>
-
- <!-- this extension point is deprecated, use extensionCategories -->
- <extension-point id="ExtensionsSchemasDescription" name="%ExtensionsSchemasDescription"/>
- <extension-point id="extensionCategories" name="%ExtensionCategoriesDescription"/>
-
- <!-- this extension point is deprecated, use internalEditorConfiguration -->
- <extension-point id="XSDEditorExtensionConfiguration" name="%XSDEditorExtensionConfiguration"/>
- <extension-point id="internalEditorConfiguration" name="%InternalEditorConfiguration"/>
-
- <extension-point id="extensibilityNodeCustomizations" name="%ExtensionNodeCustomizationsDescription"/>
- <extension-point id="editorModes" name="%XMLSchemaEditorModes"/>
-
- <!-- intialize xsd reconcile validator -->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.xsd.ui.internal.validation.DelegatingSourceValidatorForXSD"
- id="org.eclipse.wst.xsd.ui.internal.validation.DelegatingSourceValidatorForXSD">
- <contentTypeIdentifier
- id="org.eclipse.wst.xsd.core.xsdsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension point="org.eclipse.ui.contexts">
- <context
- id="org.eclipse.wst.xsd.ui.text.editor.context"
- name="%context.text.editor.xsd.name"
- parentId="org.eclipse.ui.textEditorScope" />
- </extension>
-
- <!-- this extension point is used to augment the ModelQuery to provide schema specific guided editing -->
- <extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
- <modelQueryExtension
- class="org.eclipse.wst.xsd.ui.internal.text.XSDModelQueryExtension"
- contentType="org.eclipse.wst.xsd.core.xsdsource">
- </modelQueryExtension>
- </extension>
-
- <!-- ============================================================================== -->
- <!-- Register the XSDSearchParticpant against for XMLComponentSearchPatterns -->
- <!-- ============================================================================== -->
- <extension
- point="org.eclipse.wst.common.core.searchParticipants">
- <searchParticipant
- id="org.eclipse.wst.xsd.search.XSDSearchParticipant"
- class="org.eclipse.wst.xsd.ui.internal.search.XSDSearchParticipant">
- <enablement>
- <or>
- <with variable="pattern">
- <instanceof value="org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern"/>
- </with>
- </or>
- </enablement>
- </searchParticipant>
- </extension>
-
- <!-- ============================================================================== -->
- <!-- Register a 'rename' participant this enables us to provide refactoring for -->
- <!-- renamed XML Schema components (e.g. elements, types etc.) -->
- <!-- ============================================================================== -->
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- name="%xsd.resource.rename.participant.name"
- class="org.eclipse.wst.xsd.ui.internal.refactor.rename.XSDComponentRenameParticipant"
- id="org.eclipse.wst.xsd.refactoring.XSDComponentRenameParticipant">
- <enablement>
- <with variable="element">
- <instanceof
- value="org.eclipse.xsd.XSDNamedComponent">
- </instanceof>
- </with>
- </enablement>
- </renameParticipant>
-
- </extension>
-
- <!-- ============================================================================== -->
- <!-- Register a 'rename' participant this enables us to provide refactoring for -->
- <!-- renamed resources. -->
- <!-- ============================================================================== -->
-<!--
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- name="%xsd.resource.rename.participant.name"
- class="org.eclipse.wst.xsd.ui.internal.refactor.rename.ResourceRenameParticipant"
- id="org.eclipse.wst.xsd.refactoring.XSDResourceRenameParticipant">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.core.resources.IResource"/>
- </with>
- </enablement>
- </renameParticipant>
- </extension>
- -->
- <!-- ============================================================================================== -->
- <!-- Register the 'Refactor', 'References' and 'Declarations' items to the design view -->
- <!-- ============================================================================================== -->
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.wst.xsd.ui.refactoring.menu.objectContrib"
- objectClass="org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter">
- <!--
- cs : declaration search isn't fully implemented yet, removing this menu action for now
- <action
- id="org.eclipse.wst.xsd.ui.search.declarations.action"
- enablesFor="1"
- style="pulldown"
- menubarPath="search-slot"
- label="%search.declarations.label"
- class="org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchDeclarationsGroupActionDelegate">
- </action>
- -->
- <action
- id="org.eclipse.wst.xsd.ui.search.references.action"
- enablesFor="1"
- style="pulldown"
- menubarPath="search-slot"
- label="%search.references.label"
- class="org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchReferencesGroupActionDelegate">
- </action>
-
- </objectContribution>
-
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command
- name="%command.xsd.refactor.rename.element.name"
- description="%command.xsd.refactor.rename.element.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xsd.ui.refactor.rename.element">
- </command>
- <command
- name="%command.xsd.refactor.makeElementGlobal.element.name"
- description="%command.xsd.refactor.makeElementGlobal.element.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
- </command>
- <command
- name="%command.xsd.refactor.makeTypeGlobal.element.name"
- description="%command.xsd.refactor.makeTypeGlobal.element.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
- </command>
- <command
- name="%command.xsd.refactor.renameTargetNamespace.name"
- description="%command.xsd.refactor.renameTargetNamespace.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.xsd.ui.refactor.renameTargetNamespace">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
- <target
- id="org.eclipse.wst.xsd.core.xsdsource"
- name="%XSD_Source_target_name">
- </target>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.wst.xsd.ui.internal.editor.XSDHyperlinkDetector"
- id="org.eclipse.wst.xsd.ui.internal.editor.XSDHyperlinkDetector"
- name="%XSD_hyperlink"
- targetId="org.eclipse.wst.xsd.core.xsdsource">
- </hyperlinkDetector>
- </extension>
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="toolbar:org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="icons/ctool16/NewXSD.gif"
- id="org.eclipse.wst.xsd.ui.newXSDFile"
- style="push"
- tooltip="%_UI_NEW_XML_SCHEMA_TITLE">
- <parameter name="newWizardId" value="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"/>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution locationURI="popup:refactorPopupMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
- label="%refactoring.renameAction.label">
- <visibleWhen
- checkEnabled="false">
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
- label="%refactoring.renameAction.label">
- <visibleWhen
- checkEnabled="false">
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
- label="%refactoring.renameAction.label">
- <visibleWhen
- checkEnabled="false">
- <or>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
- </reference>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </or>
- </visibleWhen>
-
- </command>
- </menuContribution>
- <menuContribution locationURI="popup:refactorPopupMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
- label="%command.xsd.refactor.makeElementGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
- label="%command.xsd.refactor.makeElementGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
- label="%command.xsd.refactor.makeElementGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- <or>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
- </reference>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </or>
- </visibleWhen>
-
- </command>
- </menuContribution>
- <menuContribution locationURI="popup:refactorPopupMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
- label="%command.xsd.refactor.makeTypeGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
- label="%command.xsd.refactor.makeTypeGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:refactorMenuId">
- <command
- commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
- label="%command.xsd.refactor.makeTypeGlobal.element.name">
- <visibleWhen
- checkEnabled="false">
- <or>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
- </reference>
- <reference
- definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- </reference>
- </or>
- </visibleWhen>
-
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard type="new" wizardId="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
- <enablement>
- <instanceof value="org.eclipse.core.resources.IResource"/>
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xml.ui.perspective"/>
- </with>
- </enablement>
- </commonWizard>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler"
- commandId="org.eclipse.wst.xsd.ui.refactor.rename.element">
- <enabledWhen>
- <with
- variable="selection">
- <test
- property="org.eclipse.wst.xsd.ui.refactor.renameEnabled">
- </test>
-
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeLocalElementGlobalHandler"
- commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
- <enabledWhen>
- <with
- variable="selection">
- <test
- property="org.eclipse.wst.xsd.ui.refactor.makeLocalElementGlobalEnabled">
- </test>
-
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeAnonymousTypeGobalHandler"
- commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
- <enabledWhen>
- <with
- variable="selection">
- <test
- property="org.eclipse.wst.xsd.ui.refactor.makeAnonymousTypeGlobalEnabled">
- </test>
-
- </with>
- </enabledWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.wst.xsd.ui.internal.refactor.RenameEnablementTester"
- id="org.eclipse.wst.xsd.ui.refactor.rename.enablement"
- namespace="org.eclipse.wst.xsd.ui.refactor"
- properties="renameEnabled"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- <propertyTester
- class="org.eclipse.wst.xsd.ui.internal.refactor.MakeLocalElementGlobalEnablementTester"
- id="org.eclipse.wst.xsd.ui.refactor.makeLocalElementGlobalEnabled"
- namespace="org.eclipse.wst.xsd.ui.refactor"
- properties="makeLocalElementGlobalEnabled"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- <propertyTester
- class="org.eclipse.wst.xsd.ui.internal.refactor.MakeAnonymousTypsGlobalEnablementTester"
- id="org.eclipse.wst.xsd.ui.refactor.makeAnonymousTypeGlobalEnabled"
- namespace="org.eclipse.wst.xsd.ui.refactor"
- properties="makeAnonymousTypeGlobalEnabled"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
-
- </extension>
- <extension
- point="org.eclipse.ui.contexts">
- <context
- description="%XSD_DESIGN_VIEW_DESCRIPTION"
- id="org.eclipse.wst.xsd.ui.editor.designView"
- name="%XSD_DESIGN_VIEW">
- </context>
- <context
- description="%XSD_SOURCE_VIEW_DESCRIPTION"
- id="org.eclipse.wst.xsd.ui.editor.sourceView"
- name="%XSD_SOURCE_VIEW">
- </context>
- </extension>
- <extension
- point="org.eclipse.core.expressions.definitions">
- <definition
- id="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
- <with
- variable="activeContexts">
- <iterate
- operator="or">
- <equals
- value="org.eclipse.wst.xsd.ui.editor.designView">
- </equals>
- </iterate>
- </with>
- </definition>
- <definition
- id="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
- <with
- variable="activeContexts">
- <iterate
- operator="or">
- <equals
- value="org.eclipse.wst.xsd.ui.editor.sourceView">
- </equals>
- </iterate>
- </with>
- </definition>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/TypeVizEditorMode.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/TypeVizEditorMode.java
deleted file mode 100644
index c48d12bdcc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/TypeVizEditorMode.java
+++ /dev/null
@@ -1,53 +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.xsd.ui.internal.adt.typeviz;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlineProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory;
-
-public class TypeVizEditorMode extends EditorMode
-{
- private EditPartFactory editPartFactory;
- public final static String ID = "org.eclipse.wst.xsd.ui.typeviz";
-
- public Object getAdapter(Class adapter)
- {
- return null;
- }
-
- public String getDisplayName()
- {
- return "Advanced";
- }
-
- public EditPartFactory getEditPartFactory()
- {
- if (editPartFactory == null)
- {
- editPartFactory = new XSDEditPartFactory(new TypeVizFigureFactory());
- }
- return editPartFactory;
- }
-
- public String getId()
- {
- return ID;
- }
-
- public IContentProvider getOutlineProvider()
- {
- return new ADTContentOutlineProvider();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
deleted file mode 100644
index 95a904d0ad..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.ColumnData;
-
-public class BoxFigure extends Figure
-{
- protected ColumnData columnData = new ColumnData();
- public HeadingFigure headingFigure;
- protected Figure contentPane;
-
- public boolean isSelected = false;
-
- public BoxFigure()
- {
- super();
-
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (!highContrast)
- {
- setBackgroundColor(ColorConstants.white);
- }
-
- headingFigure = new HeadingFigure();
- add(headingFigure);
-
- contentPane = new Figure()
- {
- public void paint(Graphics graphics)
- {
- graphics.fillRectangle(getBounds());
- super.paint(graphics);
- boolean isFirst = false;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Figure figure = (Figure) i.next();
- if (isFirst)
- {
- isFirst = false;
- }
- else
- {
- Rectangle r = figure.getBounds();
- graphics.drawLine(r.x, r.y + 1, r.x + r.width, r.y + 1);
- }
- }
- }
- };
- contentPane.setLayoutManager(new ToolbarLayout());
- add(contentPane);
- headingFigure.setForegroundColor(ColorConstants.black);
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- /*
- // Fill for the header section
- //
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(ColorConstants.darkGray);
- Color gradient1 = ColorConstants.lightGray;
- if (isSelected)
- {
- gradient1 = ColorConstants.lightBlue;
- }
- Color gradient2 = ColorConstants.white;
- graphics.setForegroundColor(gradient1);
- graphics.setBackgroundColor(gradient2);
- graphics.fillGradient(r.x + 1, r.y + 1, r.width - 2, nodeNameLabel.getBounds().height - 1, true);
- nodeNameLabel.paint(graphics);
- */
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- public Label getNameLabel()
- {
- return headingFigure.getLabel();
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java
deleted file mode 100644
index a019ada90e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java
+++ /dev/null
@@ -1,188 +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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewerGraphicConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-
-public class CompartmentFigure extends Figure implements ICompartmentFigure
-{
- public Label nodeNameLabel;
- protected Figure contentPane;
- protected Figure annotationArea;
- public Figure rowFigure;
-
- public CompartmentFigure()
- {
- super();
-
- rowFigure = new Figure();
- add(rowFigure);
-
- annotationArea = new Figure() {
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- try
- {
- graphics.pushState();
- graphics.setForegroundColor(ColorConstants.blue);
- graphics.setFont(DesignViewerGraphicConstants.smallFont);
- List children = getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- Figure object = (Figure)i.next();
- traverse(object, graphics);
- }
- }
- finally
- {
- graphics.popState();
- }
- }
-
- private void traverse(Figure figure, Graphics graphics)
- {
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- Figure object = (Figure)i.next();
-
- if (object instanceof GenericGroupFigure)
- {
- GenericGroupFigure fig = (GenericGroupFigure) object;
- if (fig.hasText())
- graphics.drawText(fig.getText(), fig.getTextCoordinates());
- }
- traverse(object, graphics);
- }
-
- }
-
- };
- ToolbarLayout annotationLayout = new ToolbarLayout(false);
- annotationLayout.setStretchMinorAxis(true);
- annotationArea.setLayoutManager(annotationLayout);
-
- // Need this to show content model structure on the left side of the figure
- rowFigure.add(annotationArea);
-
- contentPane = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- graphics.pushState();
- try
- {
- boolean isFirst = true;
- Color oldColor = graphics.getForegroundColor();
- graphics.setForegroundColor(ColorConstants.lightGray);
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Figure figure = (Figure) i.next();
- Rectangle r = figure.getBounds();
-// if (figure instanceof FieldFigure)
-// {
-// Rectangle rChild = ((FieldFigure)figure).getNameFigure().getBounds();
-// graphics.drawLine(rChild.right(), rChild.y, rChild.right(), rChild.bottom());
-// graphics.setForegroundColor(ColorConstants.darkGray);
-// }
- if (isFirst)
- {
- isFirst = false;
-// graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
- }
- else
- {
- graphics.setForegroundColor(ColorConstants.white);
- graphics.setBackgroundColor(ColorConstants.lightGray);
- graphics.fillGradient(r.x, r.y, r.width, 1, false);
-// graphics.drawLine(r.x, r.y, r.x + r.width, r.y);
-// graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
- }
- }
- graphics.setForegroundColor(oldColor);
- }
- finally
- {
- graphics.popState();
- }
- }
- };
- contentPane.setLayoutManager(new ToolbarLayout());
- rowFigure.add(contentPane);
-
- RowLayout rowLayout = new RowLayout();
- rowFigure.setLayoutManager(rowLayout);
- rowLayout.setConstraint(annotationArea, "annotation");
- rowLayout.setConstraint(contentPane, "contentPane");
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- public IFigure getAnnotationPane()
- {
- return annotationArea;
- }
-
- public void editPartAttached(EditPart owner)
- {
- StructureEditPart structureEditPart = null;
- for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof StructureEditPart)
- {
- structureEditPart = (StructureEditPart) parent;
- break;
- }
- }
- RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
- IStructureFigure typeFigure = structureEditPart.getStructureFigure();
- Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
- rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());
- }
-
- public void addSelectionFeedback()
- {
- }
-
- public void removeSelectionFeedback()
- {
- }
-
- public void refreshVisuals(Object model)
- {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
deleted file mode 100644
index c1d87cc6a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout;
-
-public class FieldFigure extends Figure implements IFieldFigure
-{
- // TODO: put this color is some common class
- public static final Color cellColor = new Color(null, 224, 233, 246);
-
-// For fix to https://bugs.eclipse.org/bugs/show_bug.cgi?id=161940
-// public static final Color leftOuterBorderColor = new Color(null, 253, 196, 88);
-// public static final Color leftInnerBorderColor = new Color(null, 253, 226, 172);
-// public static final Color rightOuterBorderColor = new Color(null, 150, 179, 224);
-// public static final Color rightInnerBorderColor = new Color(null, 49, 106, 197);
-
- // Formatting constraints
- public static final int TOP_MARGIN = 2; // pixels
- public static final int BOTTOM_MARGIN = TOP_MARGIN + 1; // extra pixel for the
- // footer line
- public static final int LEFT_MARGIN = 2;
- public static final int RIGHT_MARGIN = LEFT_MARGIN;
- public static final int RIGHT_SIDE_PADDING = 6;
-
- // States requiring decorators, and their icons
- // protected static final Image errorIcon = ICON_ERROR;
-
- // Labels which handle presentation of name and type
- public Figure rowFigure;
- protected Label nameLabel;
- protected Label nameAnnotationLabel; // for occurrence text, or error icons
- protected Label typeLabel;
- protected Label typeAnnotationLabel; // for occurrence text, or error icons
- protected Label toolTipLabel;
-
- public boolean hasFocus = false;
-
- public FieldFigure()
- {
- super();
- setLayoutManager(new ToolbarLayout());
- rowFigure = new Figure();
- RowLayout rowLayout = new RowLayout();
- rowFigure.setLayoutManager(rowLayout);
-
- add(rowFigure);
-
- nameLabel = new Label();
- nameLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- nameLabel.setLabelAlignment(PositionConstants.LEFT);
- nameLabel.setOpaque(true);
- rowFigure.add(nameLabel);
-
- nameAnnotationLabel = new Label();
- nameAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- nameAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
- nameAnnotationLabel.setOpaque(true);
- rowFigure.add(nameAnnotationLabel);
-
- toolTipLabel = new Label();
-// Don't show tooltip for now. Annoying vertical line shows up. Safe fix.
-// nameLabel.setToolTip(toolTipLabel);
- typeLabel = new Label();
-
- // cs : we need to add some additional padding to the right
- // so that when we edit the field there's room for the combobox's arrow
- // and the type name won't be partially obscured
- //
- typeLabel.setBorder(new MarginBorder(3, 5, 3, 20));
- typeLabel.setLabelAlignment(PositionConstants.LEFT);
- typeLabel.setOpaque(true);
- rowFigure.add(typeLabel);
-
- typeAnnotationLabel = new Label() {
-
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- if (getText() == null || getText().equals(""))
- {
- return new Dimension(0, 0);
- }
- return super.getPreferredSize(wHint, hHint);
- }
- };
- typeAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- typeAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
- typeAnnotationLabel.setOpaque(true);
- rowFigure.add(typeAnnotationLabel);
-// Don't show tooltip for now. Annoying vertical line shows up. Safe fix.
-// typeAnnotationLabel.setToolTip(toolTipLabel);
-
- rowLayout.setConstraint(nameLabel, "name");
- rowLayout.setConstraint(nameAnnotationLabel, "nameAnnotation");
- rowLayout.setConstraint(typeLabel, "type");
- rowLayout.setConstraint(typeAnnotationLabel, "typeAnnotation");
- }
-
- /**
- * @return Returns the "name" string used by this figure.
- */
- public String getName()
- {
- return nameLabel.getText();
- }
-
- /**
- * @return Returns the figure representing the attribute name
- */
- public Label getNameLabel()
- {
- return nameLabel;
- }
-
- /**
- * @return Returns the "type" string used by this figure.
- */
- public String getType()
- {
- return typeLabel.getText();
- }
-
- /**
- * @return Returns the figure representing the attribute's type
- */
- public Label getTypeLabel()
- {
- return typeLabel;
- }
-
- /**
- * @param name
- * Set the "name" string used by this figure.
- */
- public void setName(String name)
- {
- nameLabel.setText(name);
- }
-
- /**
- * @param type
- * Set the "type" string used by this figure.
- */
- public void setType(String type)
- {
- typeLabel.setText(type);
- }
-
- public void setTypeToolTipText(String toolTip)
- {
- setNameToolTipText(toolTip);
- }
-
- public void setNameToolTipText(String toolTip)
- {
- if (toolTip.length() > 0)
- {
- nameLabel.setToolTip(toolTipLabel);
- toolTipLabel.setText(toolTip);
- }
- else
- {
- nameLabel.setToolTip(null);
- }
- }
-
- public void setNameAnnotationLabel(String text)
- {
- nameAnnotationLabel.setText(text);
- }
-
- public void setNameAnnotationLabelIcon(Image icon)
- {
- nameAnnotationLabel.setIcon(icon);
- }
-
- public Label getNameAnnotationLabel()
- {
- return nameAnnotationLabel;
- }
-
- public void setTypeAnnotationLabel(String text)
- {
- typeAnnotationLabel.setText(text);
- }
-
- public void setTypeAnnotationLabelIcon(Image icon)
- {
- typeAnnotationLabel.setIcon(icon);
- }
-
- public Label getTypeAnnotationLabel()
- {
- return typeAnnotationLabel;
- }
-
- public void recomputeLayout()
- {
- RowLayout layout = (RowLayout)rowFigure.getLayoutManager();
- if (layout != null && layout.getColumnData() != null)
- {
- layout.getColumnData().clearColumnWidths();
- }
- }
-
- public void editPartAttached(EditPart owner)
- {
- StructureEditPart structureEditPart = null;
- for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof StructureEditPart)
- {
- structureEditPart = (StructureEditPart) parent;
- break;
- }
- }
- RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
- IStructureFigure typeFigure = structureEditPart.getStructureFigure();
- Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
- rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());
- }
-
- public void addSelectionFeedback()
- {
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (highContrast)
- {
- rowFigure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- rowFigure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
- }
- else
- {
- rowFigure.setBackgroundColor(cellColor);
- }
- }
-
- public void removeSelectionFeedback()
- {
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (highContrast)
- {
- rowFigure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
- rowFigure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- }
- else
- {
- rowFigure.setBackgroundColor(getBackgroundColor());
- }
- }
-
- public void refreshVisuals(Object model)
- {
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- if (hasFocus)
- {
- try
- {
- graphics.pushState();
- Rectangle r = getBounds();
- graphics.setXORMode(true);
- graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
- }
- finally
- {
- graphics.popState();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java
deleted file mode 100644
index 6c275d68b3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java
+++ /dev/null
@@ -1,91 +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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-
-public class HeadingFigure extends Figure
-{
- public static final Color headerColor = new Color(null, 224, 233, 246);
- Label label;
- Color[] gradientColor = {ColorConstants.white,
- ColorConstants.lightGray,
- ColorConstants.lightBlue,
- ColorConstants.gray};
- boolean isSelected = false;
- boolean isReadOnly = false;
-
- public HeadingFigure()
- {
- label = new Label();
- label.setBorder(new MarginBorder(2));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- setLayoutManager(toolbarLayout);
- add(label);
- }
-
- public void setGradientColors(Color[] colors)
- {
- this.gradientColor = colors;
- }
-
- public void setSelected(boolean isSelected)
- {
- this.isSelected = isSelected;
- }
-
- public void setIsReadOnly(boolean isReadOnly)
- {
- this.isReadOnly = isReadOnly;
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
-
- graphics.pushState();
- try
- {
- // Fill for the header section
- //
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(ColorConstants.lightGray);
-
- Color gradient1 = isReadOnly ? gradientColor[1] : headerColor;
- if (isSelected && isReadOnly) gradient1 = gradientColor[3];
- else if (isSelected && !isReadOnly) gradient1 = gradientColor[2];
- Color gradient2 = gradientColor[0];
- graphics.setForegroundColor(gradient1);
- graphics.setBackgroundColor(gradient2);
- Rectangle labelBounds = label.getBounds();
- graphics.fillGradient(r.x+1, r.y+1, r.width-2, labelBounds.height - 2, true);
- graphics.setForegroundColor(ColorConstants.darkGray);
- label.paint(graphics);
- }
- finally
- {
- graphics.popState();
- }
- }
-
- public Label getLabel()
- {
- return label;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java
deleted file mode 100644
index 93e80f1bee..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java
+++ /dev/null
@@ -1,66 +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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder
-{
- protected int arcLength;
- protected int lineStyle = Graphics.LINE_SOLID;
-
- public RoundedLineBorder(Color c, int width, int arcLength)
- {
- super(c, width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(int width, int arcLength)
- {
- super(width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
- {
- super(c, width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public RoundedLineBorder(int width, int arcLength, int lineStyle)
- {
- super(width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets)
- {
- int rlbWidth = getWidth();
- tempRect.setBounds(getPaintRectangle(figure, insets));
- if (rlbWidth%2 == 1)
- {
- tempRect.width--;
- tempRect.height--;
- }
- tempRect.shrink(rlbWidth/2,rlbWidth/2);
- graphics.setLineWidth(rlbWidth);
- graphics.setLineStyle(lineStyle);
- if (getColor() != null)
- graphics.setForegroundColor(getColor());
- graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java
deleted file mode 100644
index 990f64b8ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java
+++ /dev/null
@@ -1,61 +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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-
-public class StructureFigure extends BoxFigure implements IStructureFigure
-{
- public void editPartAttached(EditPart owner)
- {
- // nothing to do here :-)
- }
-
- public void addSelectionFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder)getBorder();
- boxFigureLineBorder.setWidth(2);
- // TODO (cs) need to fix this
- //boxFigureLineBorder.setColor(getComplexType().isReadOnly() ? ColorConstants.darkGray : ColorConstants.darkBlue);
- getHeadingFigure().setSelected(true);
- repaint();
- }
-
- public void removeSelectionFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder)getBorder();
- boxFigureLineBorder.setWidth(1);
- getHeadingFigure().setSelected(false);
- repaint();
- }
-
- public boolean hitTestHeader(Point location)
- {
- IFigure target = getHeadingFigure();
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- public void refreshVisuals(Object model)
- {
- IStructure structure = (IStructure)model;
- getNameLabel().setText(structure.getName());
- getHeadingFigure().setIsReadOnly(structure.isReadOnly());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java
deleted file mode 100644
index 08260fb34f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java
+++ /dev/null
@@ -1,64 +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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-
-public class TypeVizFigureFactory implements IExtendedFigureFactory
-{
- public IStructureFigure createStructureFigure(Object model)
- {
- StructureFigure figure = new StructureFigure();
- figure.setBorder(new LineBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
-
- if (model instanceof ITreeElement)
- {
- figure.getNameLabel().setIcon(((ITreeElement)model).getImage());
- }
- //figure.getHeadingFigure().setIsReadOnly(getComplexType().isReadOnly());
- // we should organize ITreeElement and integrate it with the facade
- return figure;
- }
-
- public IFieldFigure createFieldFigure(Object model)
- {
- // TODO Auto-generated method stub
- return new FieldFigure();
- }
-
- public ICompartmentFigure createCompartmentFigure(Object model)
- {
- CompartmentFigure figure = new CompartmentFigure();
- figure.setBorder(new MarginBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- return figure;
- }
-
- public IModelGroupFigure createModelGroupFigure(Object model)
- {
- // TODO Auto-generated method stub
- return new ModelGroupFigure();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java
deleted file mode 100644
index 58e9dab1ee..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java
+++ /dev/null
@@ -1,83 +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.xsd.ui.internal.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class ColumnData
-{
- HashMap map = new HashMap();
-
- class Entry
- {
- int width = 0;
- int weight = 1;
- }
-
- public void clearColumnWidths()
- {
- for (Iterator i = map.values().iterator(); i.hasNext();)
- {
- Entry entry = (Entry)i.next();
- entry.width = 0;
- }
- }
-
- private Entry lookupOrCreateColumnEntry(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry == null)
- {
- entry = new Entry();
- map.put(identifier, entry);
- }
- return entry;
- }
-
- void stretchColumnWidthIfNeeded(String identifier, int width)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.width = Math.max(entry.width, width);
- }
-
- int getColumnWidth(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.width;
- }
- else
- {
- return 0;//hmm should we return -1 ?
- }
- }
-
- int getColumnWeight(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.weight;
- }
- else
- {
- return 0;
- }
- }
-
- public void setColumnWeight(String identifier, int weight)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.weight = weight;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java
deleted file mode 100644
index fc9067779f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java
+++ /dev/null
@@ -1,179 +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.xsd.ui.internal.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class RowLayout extends AbstractLayout
-{
- // layout is associated with a parent context
- // any layout manager under the parent context is connected
- // column rows are maintained accross container boundaries
- protected ColumnData columnData;
- protected HashMap figureToContstraintMap = new HashMap();
-
- public RowLayout()
- {
- super();
- }
-
-
- // this method computes the minimum size required to display the figures
- //
- private Dimension calculateChildrenSize(IFigure container, List children, int wHint, int hHint, boolean preferred)
- {
- Dimension childSize;
- IFigure child;
- int height = 0;
- int width = 0;
-
- //IRowFigure figure = (IRowFigure)container;
-
- // for each cell in the row
- //
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- String columnIdenifier = (String)getConstraint(child);
-
- // first we compute the child size without regard for columnData
- //
- childSize = child.getPreferredSize(wHint, hHint);// : child.getMinimumSize(wHint, hHint);
-
- // now that the columnData has been populated we can consider if the row needs to be larger
- //
- int effectiveWidth = childSize.width;
- if (columnIdenifier != null)
- {
- columnData.stretchColumnWidthIfNeeded(columnIdenifier, childSize.width);
- effectiveWidth = columnData.getColumnWidth(columnIdenifier);
- }
- height = Math.max(childSize.height, height);
- width += effectiveWidth;
- }
- return new Dimension(width, height);
- }
-
-
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- List children = container.getChildren();
- Dimension prefSize = calculateChildrenSize(container, children, wHint, hHint, true);
- return prefSize;
- }
-
- public void layout(IFigure parent)
- {
- // layout a table with the columns aligned
- //IRowFigure rowFigure = (IRowFigure)parent;
- Rectangle clientArea = parent.getClientArea();
- List children = parent.getChildren();
- Rectangle r = new Rectangle();
- r.x = clientArea.x;
- r.y = clientArea.y;
- r.height = clientArea.height;
-
- int childrenSize = children.size();
- Rectangle[] bounds = new Rectangle[childrenSize];
-
- // for each cell in the row
- //
- int requiredWidth = 0;
- int totalColumnWeight = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- //String columnIdenifier = figure.getColumnIdentifier(child);
- // first we compute the child size without regard for columnData
- //
- Dimension childSize = child.getPreferredSize(-1, -1);
-
- int columnWidth = -1;
- //String columnIdentifier = rowFigure.getColumnIdentifier(child);
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- //columnData.stretchColumnWidthIfNeeded(columnIdentifier, childSize.width);
- columnWidth = columnData.getColumnWidth(columnIdentifier);
- totalColumnWeight += columnData.getColumnWeight(columnIdentifier);
- }
- r.width = Math.max(childSize.width, columnWidth);
- requiredWidth += r.width;
- bounds[i] = new Rectangle(r);
- r.x += r.width;
- }
- if (totalColumnWeight < 1)
- {
- totalColumnWeight = 1;
- }
- int extraWidth = Math.max(clientArea.width - requiredWidth, 0);
- int extraWidthAllocated = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- Rectangle b = bounds[i];
- if (extraWidth > 0)
- {
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- int weight = columnData.getColumnWeight(columnIdentifier);
- float fraction = (float)weight / (float)totalColumnWeight;
- int extraWidthForChild = (int)(extraWidth * fraction);
-
- b.width += extraWidthForChild;
- b.x += extraWidthAllocated;
- extraWidthAllocated += extraWidthForChild;
- }
- else
- {
- b.x += extraWidthAllocated;
- }
- }
- child.setBounds(new Rectangle(b));
- }
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-
- public void setColumnData(ColumnData columnData)
- {
- this.columnData = columnData;
- }
-
- public Object getConstraint(IFigure child)
- {
- return figureToContstraintMap.get(child);
- }
-
- public void setConstraint(IFigure child, Object constraint)
- {
- figureToContstraintMap.put(child, constraint);
- }
-
- public void invalidate()
- {
- //figureToContstraintMap.clear();
- //this.columnData.clearColumnWidths();
- super.invalidate();
-
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
deleted file mode 100644
index 15f3b73146..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
+++ /dev/null
@@ -1,360 +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.xsd.ui.internal.actions;
-import java.util.List;
-
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-// issue (cs) can we remove this?
-//
-public class CreateElementAction extends Action
-{
- protected String description;
- protected Element parentNode;
-
- protected ISelectionProvider selectionProvider;
- protected XSDSchema xsdSchema;
-
- protected Object sourceContext;
-
- /**
- * Constructor for CreateElementAction.
- */
- public CreateElementAction()
- {
- super();
- }
- /**
- * Constructor for CreateElementAction.
- * @param text
- */
- public CreateElementAction(String text)
- {
- super(text);
- }
- /**
- * Constructor for CreateElementAction.
- * @param text
- * @param image
- */
- public CreateElementAction(String text, ImageDescriptor image)
- {
- super(text, image);
- }
-
- public void setXSDSchema(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- public void setSelectionProvider(ISelectionProvider selectionProvider)
- {
- this.selectionProvider = selectionProvider;
- }
-
- public void setSourceContext(Object sourceContext)
- {
- this.sourceContext = sourceContext;
- }
-
- /**
- * Gets the parentNode.
- * @return Returns a Element
- */
- public Element getParentNode()
- {
- return parentNode;
- }
-
- /**
- * Sets the parentNode.
- * @param parentNode The parentNode to set
- */
- public void setParentNode(Element parentNode)
- {
- this.parentNode = parentNode;
- }
-
- boolean isGlobal = false;
-
- public void setIsGlobal(boolean isGlobal)
- {
- this.isGlobal = isGlobal;
- }
-
- public boolean getIsGlobal()
- {
- return isGlobal;
- }
-
- protected Node relativeNode;
- protected String elementTag;
- public void setElementTag(String elementTag)
- {
- this.elementTag = elementTag;
- }
-
- public DocumentImpl getDocument()
- {
- return (DocumentImpl) getParentNode().getOwnerDocument();
- }
-
- public void beginRecording(String description)
- {
- getDocument().getModel().beginRecording(this, description);
- }
-
- public void endRecording()
- {
- DocumentImpl doc = getDocument();
-
- doc.getModel().endRecording(this);
- }
-
- public Element createAndAddNewChildElement()
- {
- String prefix = parentNode.getPrefix();
- prefix = (prefix == null) ? "" : (prefix + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
- if (getAttributes() != null)
- {
- List attributes = getAttributes();
- for (int i = 0; i < attributes.size(); i++)
- {
- DOMAttribute attr = (DOMAttribute) attributes.get(i);
- childNode.setAttribute(attr.getName(), attr.getValue());
- }
- }
- if (getRelativeNode() == null)
- {
- parentNode.appendChild(childNode);
- }
- else
- {
- parentNode.insertBefore(childNode,getRelativeNode());
- }
-
- if (isGlobal && getRelativeNode() == null)
- {
- Text textNode = getDocument().createTextNode("\n\n"); //$NON-NLS-1$
- parentNode.appendChild(textNode);
- }
- else if (isGlobal && getRelativeNode() != null)
- {
- Text textNode = getDocument().createTextNode("\n\n"); //$NON-NLS-1$
- parentNode.insertBefore(textNode, getRelativeNode());
- }
-
- formatChild(childNode);
-
- return childNode;
- }
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
- /*
- * @see IAction#run()
- */
- public void run()
- {
- beginRecording(getDescription());
- final Element child = createAndAddNewChildElement();
- endRecording();
-
- if (selectionProvider != null)
- {
- final XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(child);
-// selectionProvider.setSelection(new StructuredSelection(comp));
-
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- if (comp instanceof XSDAttributeDeclaration)
- {
- if (((XSDAttributeDeclaration)comp).getContainer() instanceof XSDAttributeUse)
- {
- if (comp.getContainer().getContainer() instanceof XSDAttributeGroupDefinition)
- {
- selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
- }
- else if (comp.getContainer().getContainer() instanceof XSDComplexTypeDefinition)
- {
- if (XSDDOMHelper.inputEquals(child, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
- {
- selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- if (comp instanceof XSDNamedComponent)
- {
- if (sourceContext instanceof AbstractEditPartViewer)
- {
-// AbstractEditPartViewer viewer = (AbstractEditPartViewer)sourceContext;
-
-// Object obj = viewer.getSelectedEditParts().get(0);
-
-// if (obj instanceof GraphicalEditPart)
-// {
-// if (obj instanceof ElementDeclarationEditPart)
-// {
-// XSDElementDeclaration elem = ((ElementDeclarationEditPart)obj).getXSDElementDeclaration();
-// if (!elem.isElementDeclarationReference())
-// {
-// ((ElementDeclarationEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof ModelGroupDefinitionEditPart)
-// {
-// XSDModelGroupDefinition group = ((ModelGroupDefinitionEditPart)obj).getXSDModelGroupDefinition();
-// if (!group.isModelGroupDefinitionReference())
-// {
-// ((ModelGroupDefinitionEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof ComplexTypeDefinitionEditPart)
-// {
-// XSDComplexTypeDefinition ct = ((ComplexTypeDefinitionEditPart)obj).getXSDComplexTypeDefinition();
-// if (ct.getName() != null)
-// {
-// ((ComplexTypeDefinitionEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof TopLevelComponentEditPart)
-// {
-// ((TopLevelComponentEditPart)obj).doEditName();
-// }
-// }
-
- }
- }
- }
- };
- Display.getDefault().timerExec(50,runnable);
- }
- }
-
- /**
- * Gets the relativeNode.
- * @return Returns a Element
- */
- public Node getRelativeNode()
- {
- return relativeNode;
- }
-
- /**
- * Sets the relativeNode.
- * @param relativeNode The relativeNode to set
- */
- public void setRelativeNode(Node relativeNode)
- {
- this.relativeNode = relativeNode;
- }
-
- /**
- * Gets the description.
- * @return Returns a String
- */
- public String getDescription()
- {
- if (description == null)
- {
- return getText();
- }
- return description;
- }
-
- /**
- * Sets the description.
- * @param description The description to set
- */
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- protected List attributes;
- /**
- * Gets the nameAttribute.
- * @return Returns a String
- */
- public List getAttributes()
- {
- return attributes;
- }
-
- /**
- * Sets the attributes.
- * @param attributes The attributes to set
- */
- public void setAttributes(List attributes)
- {
- this.attributes = attributes;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
deleted file mode 100644
index 5c4f35a8ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
+++ /dev/null
@@ -1,75 +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.xsd.ui.internal.actions;
-
-// issue (cs) remove this
-/**
- * @version 1.0
- * @author
- */
-public class DOMAttribute
-{
- /**
- * Constructor for DOMAttribute.
- */
- public DOMAttribute()
- {
- super();
- }
-
- /**
- * Constructor for DOMAttribute.
- */
- public DOMAttribute(String name, String value)
- {
- super();
- this.name = name;
- this.value = value;
- }
-
- protected String name, value;
- /**
- * Gets the value.
- * @return Returns a String
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value.
- * @param value The value to set
- */
- public void setValue(String value)
- {
- this.value = value;
- }
-
- /**
- * Gets the name.
- * @return Returns a String
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the name.
- * @param name The name to set
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java
deleted file mode 100644
index 52199f65e9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java
+++ /dev/null
@@ -1,19 +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.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-
-public interface IXSDToolbarAction extends IAction
-{
- public void setEditorPart(IEditorPart editorPart);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDAttributeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDAttributeAction.java
deleted file mode 100644
index 069a2f77d5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDAttributeAction.java
+++ /dev/null
@@ -1,248 +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.wst.xsd.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Node;
-
-public class MoveXSDAttributeAction extends MoveXSDBaseAction
-{
- private static int INSERT_BEFORE = 0;
- private static int INSERT_AFTER = 1;
- private static int INSERT_DIRECT = 2;
- protected List selectedNodes;
- protected Node parentNode;
- protected Node previousRefChild, nextRefChild;
- int insertType;
-
- XSDConcreteComponent parentComponent;
- XSDConcreteComponent selected, previousRefComponent, nextRefComponent;
- boolean insertAtEnd = true;
-
- public MoveXSDAttributeAction(XSDConcreteComponent parentComponent, XSDConcreteComponent selected, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent)
- {
- super();
- this.parentComponent = parentComponent;
- this.selected = selected;
- this.previousRefComponent = previousRefChildComponent;
- this.nextRefComponent = nextRefChildComponent;
-
- if (parentComponent == null)
- return;
- parentNode = parentComponent.getElement();
- nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null;
- previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null;
-
- if (nextRefComponent != null)
- {
- if (nextRefComponent.getContainer().getContainer() == parentComponent)
- {
- insertType = INSERT_BEFORE;
- }
- }
- if (previousRefComponent != null)
- {
- if (previousRefComponent.getContainer().getContainer() == parentComponent)
- {
- insertType = INSERT_AFTER;
- }
- }
- if (nextRefChildComponent == null && previousRefChildComponent == null)
- {
- insertType = INSERT_DIRECT;
- }
- }
-
- public MoveXSDAttributeAction(XSDConcreteComponent parentComponent, XSDConcreteComponent selected, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent, boolean insertAtEnd)
- {
- this(parentComponent, selected, previousRefChildComponent, nextRefChildComponent);
- this.insertAtEnd = insertAtEnd;
- }
-
- public boolean canMove()
- {
- boolean result = true;
-
- if (nextRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDElementDeclaration || parentComponent == null)
- return false;
-
- return result;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- if (parentComponent instanceof XSDAttributeGroupDefinition)
- {
- moveUnderXSDAttributeGroupDefinition((XSDAttributeGroupDefinition) parentComponent);
- }
- else if (parentComponent instanceof XSDComplexTypeDefinition)
- {
- moveUnderXSDComplexTypeDefinition((XSDComplexTypeDefinition) parentComponent);
- }
- }
-
- protected void moveUnderXSDAttributeGroupDefinition(XSDAttributeGroupDefinition parentGroup)
- {
- int originalIndex = 0;
- for (Iterator iterator = parentGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (attribute == selected)
- {
- parentGroup.getContents().remove(attribute.getContainer());
- break;
- }
- }
- originalIndex++;
- }
- int index = 0;
- boolean addedBack = false;
- if (insertType == INSERT_DIRECT)
- {
- XSDConcreteComponent container = selected.getContainer();
- if (container != null)
- {
- if (insertAtEnd)
- ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(container);
- else
- ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(0, container);
- addedBack = true;
- }
- return;
- }
-
- List attributeGroupContents = parentGroup.getContents();
- for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (insertType == INSERT_BEFORE)
- {
- if (attribute == nextRefComponent)
- {
- parentGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- if (selected == nextRefComponent && originalIndex == index)
- {
- parentGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- else if (insertType == INSERT_AFTER)
- {
- if (attribute == previousRefComponent)
- {
- parentGroup.getContents().add(index + 1, selected.getContainer());
- addedBack = true;
- break;
- }
- if (selected == previousRefComponent && originalIndex == index)
- {
- parentGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- }
- index++;
- }
- if (attributeGroupContents.size() == 0)
- {
- parentGroup.getContents().add(selected.getContainer());
- addedBack = true;
- }
-
- if (!addedBack)
- {
- parentGroup.getContents().add(originalIndex, selected.getContainer());
- }
- }
-
- protected void moveUnderXSDComplexTypeDefinition(XSDComplexTypeDefinition complexType)
- {
- int originalIndex = 0;
- for (Iterator iterator = complexType.getAttributeContents().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (attribute == selected)
- {
- complexType.getAttributeContents().remove(attribute.getContainer());
- break;
- }
- }
- originalIndex++;
- }
- int index = 0;
- boolean addedBack = false;
- List attributeGroupContents = complexType.getAttributeContents();
- for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (insertType == INSERT_AFTER)
- {
- if (attribute == previousRefComponent)
- {
- complexType.getAttributeContents().add(index + 1, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- else if (insertType == INSERT_BEFORE)
- {
- if (attribute == nextRefComponent)
- {
- complexType.getAttributeContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- }
- index++;
- }
- if (attributeGroupContents.size() == 0)
- {
- complexType.getAttributeContents().add(selected.getContainer());
- addedBack = true;
- }
-
- if (!addedBack)
- {
- complexType.getAttributeContents().add(originalIndex, selected.getContainer());
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDBaseAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDBaseAction.java
deleted file mode 100644
index c6d99065be..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDBaseAction.java
+++ /dev/null
@@ -1,28 +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.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-
-public class MoveXSDBaseAction extends Action
-{
-
- public MoveXSDBaseAction()
- {
- super();
- }
-
- public boolean canMove()
- {
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDElementAction.java
deleted file mode 100644
index 7e73ff5e9f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveXSDElementAction.java
+++ /dev/null
@@ -1,173 +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.wst.xsd.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.w3c.dom.Node;
-
-public class MoveXSDElementAction extends MoveXSDBaseAction
-{
- private static int INSERT_BEFORE = 0;
- private static int INSERT_AFTER = 1;
- private static int INSERT_DIRECT = 2;
- protected List selectedNodes;
- protected Node parentNode;
- protected Node previousRefChild, nextRefChild;
- int insertType;
-
- XSDModelGroup parentModelGroup;
- XSDConcreteComponent selected, previousRefComponent, nextRefComponent;
- boolean insertAtEnd = true;
-
- public MoveXSDElementAction(XSDModelGroup parentComponent, XSDConcreteComponent selected, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent)
- {
- super();
- this.parentModelGroup = parentComponent;
- this.selected = selected;
- this.previousRefComponent = previousRefChildComponent;
- this.nextRefComponent = nextRefChildComponent;
-
- if (parentComponent == null)
- return;
- parentNode = parentComponent.getElement();
- nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null;
- previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null;
-
- if (nextRefComponent != null)
- {
- if (nextRefComponent.getContainer().getContainer() == parentModelGroup)
- {
- insertType = INSERT_BEFORE;
- }
- }
- if (previousRefComponent != null)
- {
- if (previousRefComponent.getContainer().getContainer() == parentModelGroup)
- {
- insertType = INSERT_AFTER;
- }
- }
- if (nextRefChildComponent == null && previousRefChildComponent == null)
- {
- insertType = INSERT_DIRECT;
- }
- }
-
- public MoveXSDElementAction(XSDModelGroup parentComponent, XSDConcreteComponent selected, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent, boolean insertAtEnd)
- {
- this(parentComponent, selected, previousRefChildComponent, nextRefChildComponent);
- this.insertAtEnd = insertAtEnd;
- }
-
- public boolean canMove()
- {
- boolean result = true;
-
- if (nextRefComponent instanceof XSDAttributeDeclaration || previousRefComponent instanceof XSDAttributeDeclaration || parentModelGroup == null)
- return false;
-
- return result;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- int originalIndex = 0;
- for (Iterator particles = parentModelGroup.getContents().iterator(); particles.hasNext();)
- {
- XSDParticle particle = (XSDParticle) particles.next();
- XSDParticleContent particleContent = particle.getContent();
- if (particleContent == selected)
- {
- parentModelGroup.getContents().remove(particle);
- break;
- }
- originalIndex++;
- }
- int index = 0;
- boolean addedBack = false;
- if (insertType == INSERT_DIRECT)
- {
- XSDConcreteComponent container = selected.getContainer();
- if (container != null)
- {
- XSDConcreteComponent container2 = container.getContainer();
- if (container2 instanceof XSDModelGroup)
- {
- ((XSDModelGroup) container2).getContents().remove(container);
- }
- if (insertAtEnd)
- parentModelGroup.getContents().add(container);
- else
- parentModelGroup.getContents().add(0, container);
- addedBack = true;
- }
- return;
- }
-
- List particles = parentModelGroup.getContents();
- for (Iterator iterator = particles.iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- XSDParticleContent particleContent = particle.getContent();
- if (insertType == INSERT_BEFORE)
- {
- if (particleContent == nextRefComponent)
- {
- parentModelGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- if (selected == nextRefComponent && originalIndex == index)
- {
- parentModelGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- else if (insertType == INSERT_AFTER)
- {
- if (particleContent == previousRefComponent)
- {
- parentModelGroup.getContents().add(index + 1, selected.getContainer());
- addedBack = true;
- break;
- }
- if (selected == previousRefComponent && originalIndex == index)
- {
- parentModelGroup.getContents().add(index, selected.getContainer());
- addedBack = true;
- break;
- }
- }
- index++;
- }
- if (particles.size() == 0)
- {
- parentModelGroup.getContents().add(selected.getContainer());
- addedBack = true;
- }
-
- if (!addedBack)
- {
- parentModelGroup.getContents().add(originalIndex, selected.getContainer());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
deleted file mode 100644
index 6a573b3107..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNamespaceInformationCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.nsedit.SchemaPrefixChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class XSDEditNamespacesAction extends Action
-{
- private Element element;
- private String resourceLocation;
- private XSDSchema xsdSchema;
- private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-
- public XSDEditNamespacesAction(String label, Element element, Node node)
- {
- super();
- setText(label);
-
- this.element = element;
- // /////////////////// This needs to be changed....
- this.resourceLocation = "dummy";
- }
-
- public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema)
- {
- this(label, element, node);
- xsdSchema = schema;
- }
-
- public void run()
- {
- if (element != null)
- {
- Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- String targetNamespace = null;
- if (xsdSchema != null)
- {
- targetNamespace = xsdSchema.getTargetNamespace();
- }
- XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace);
-
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
- List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out how to
- // update the document in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
- }
-
- dialog.setNamespaceInfoList(namespaceInfoList);
- dialog.create();
- dialog.getShell().setSize(500, 400);
- dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE")); //$NON-NLS-1$
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- String xsdPrefix = null; //$NON-NLS-1$
- String origXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- String newTNSPrefix = "";
-
- if (dialog.getReturnCode() == Window.OK)
- {
- Element xsdSchemaElement = xsdSchema.getElement();
- DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-
- List newInfoList = dialog.getNamespaceInfoList();
-
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-
- String origTNSPrefix = null;
- Map origPrefixMap = xsdSchema.getQNamePrefixToNamespaceMap();
- for (Iterator iter = origPrefixMap.keySet().iterator(); iter.hasNext();)
- {
- String key = (String) iter.next();
- String ns = (String) origPrefixMap.get(key);
- if ((targetNamespace == null && ns == null) || targetNamespace != null && targetNamespace.equals(ns))
- {
- origTNSPrefix = key;
- break;
- }
- }
- Map map2 = new Hashtable();
- for (Iterator iter = newInfoList.iterator(); iter.hasNext();)
- {
- NamespaceInfo ni = (NamespaceInfo) iter.next();
- String pref = ni.prefix;
- String uri = ni.uri;
- if (pref == null)
- pref = ""; //$NON-NLS-1$
- if (uri == null)
- uri = ""; //$NON-NLS-1$
- if (XSDConstants.isSchemaForSchemaNamespace(uri))
- {
- xsdPrefix = pref;
- }
- if (uri.equals(dialog.getTargetNamespace()))
- {
- newTNSPrefix = pref;
- }
- map2.put(pref, uri);
- }
-
- if (map2.size() > 0)
- {
- try
- {
-
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
- boolean targetNamespaceChanged = (targetNamespace != null && !targetNamespace.equals(dialog.getTargetNamespace()) || targetNamespace == null && dialog.getTargetNamespace() != null);
- boolean tnsPrefixChanged = !newTNSPrefix.equals(origTNSPrefix);
- boolean xsdPrefixChanged = (!(origXSDPrefix == null && xsdPrefix.equals("")) || (origXSDPrefix != null && !origXSDPrefix.equals(xsdPrefix)));
-
- xsdSchema.setIncrementalUpdate(false);
-
- // First handle the prefix change for the target namespace
- if (tnsPrefixChanged)
- {
- prefixMapping.remove(origTNSPrefix);
- UpdateNamespaceInformationCommand command = new UpdateNamespaceInformationCommand(Messages._UI_ACTION_NAMESPACE_INFORMATION_CHANGE, xsdSchema, newTNSPrefix, targetNamespace);
- command.execute();
- xsdSchema.update();
- }
- // Second, handle the target namespace change
- if (targetNamespaceChanged)
- {
- // set the targetNamespace attribute
- xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
-
- TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
- targetNamespaceChangeHandler.resolve();
- }
-
-
- // Now handle the other changes. PrefixMapping size should be
- // greater than 0 for any remaining prefix changes
-
- if (prefixMapping.size() > 0)
- {
- for (Iterator iter = prefixMapping.keySet().iterator(); iter.hasNext();)
- {
- String oldPrefix = (String) iter.next();
- String newPrefix = (String) prefixMapping.get(oldPrefix);
-
- // Now update any references to this old prefix in the schema
- // with the value of the new prefix
- String ns = (String) origPrefixMap.get(oldPrefix);
- SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, newPrefix, ns != null? ns : ""); //$NON-NLS-1$
- spch.resolve();
- }
- }
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-
- // Third, handle the schema for schema prefix change
- if (xsdPrefixChanged)
- {
- if (xsdPrefix != null && xsdPrefix.length() == 0)
- {
- xsdSchema.setSchemaForSchemaQNamePrefix(null);
- }
- else
- {
- xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
- }
-
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
- xsdSchema.setIncrementalUpdate(true);
-
- // Now change the references to any schema types/components ie. string --> xs:string
- SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
- spch.resolve();
-
- // Change the prefix for all schema components
- updateAllNodes(element, xsdPrefix);
-
- prefixMapping.remove(origXSDPrefix != null? origXSDPrefix : ""); //$NON-NLS-1$
- }
- xsdSchema.setIncrementalUpdate(true);
- }
- catch (Exception e)
- {
- }
- finally
- {
- xsdSchema.update();
- doc.getModel().endRecording(this);
- }
- }
- }
- }
- }
-
- protected Map createPrefixMapping(List oldList, List newList)
- {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext();)
- {
- NamespaceInfo oldInfo = (NamespaceInfo) i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext();)
- {
- NamespaceInfo newInfo = (NamespaceInfo) i.next();
- NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
- // if oldInfo is non null ... there's a matching URI in the old set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null)
- {
- oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
- }
-
- if (oldInfo != null)
- {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
- if (!oldPrefix.equals(newPrefix))
- {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
-
- private void updateAllNodes(Element element, String prefix)
- {
- element.setPrefix(prefix);
- NodeList list = element.getChildNodes();
- if (list != null)
- {
- for (int i = 0; i < list.getLength(); i++)
- {
- Node child = list.item(i);
- if (child != null && child instanceof Element)
- {
- child.setPrefix(prefix);
- if (child.hasChildNodes())
- {
- updateAllNodes((Element) child, prefix);
- }
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
deleted file mode 100644
index cd995eeeae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction;
-import org.eclipse.xsd.XSDSchema;
-
-public class CategoryAdapter extends XSDBaseAdapter implements IModelProxy, IActionProvider, IADTObjectListener
-{
- protected String text;
- protected Image image;
- protected Object parent;
- protected int groupType;
- protected Collection children, allChildren; // children from current schema, children from current schema and includes
- XSDSchema xsdSchema;
-
- public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
- {
- this.text = label;
- this.image = image;
- this.parent = xsdSchema;
- this.xsdSchema = xsdSchema;
- this.target = xsdSchema;
- this.children = children;
- this.groupType = groupType;
- }
-
- public final static int ATTRIBUTES = 1;
- public final static int ELEMENTS = 2;
- public final static int TYPES = 3;
- public final static int GROUPS = 5;
- public final static int DIRECTIVES = 6;
- public final static int NOTATIONS = 7;
- public final static int ATTRIBUTE_GROUPS = 8;
- public final static int IDENTITY_CONSTRAINTS = 9;
- public final static int ANNOTATIONS = 10;
-
- public XSDSchema getXSDSchema()
- {
- return xsdSchema;
- }
-
- public int getGroupType()
- {
- return groupType;
- }
-
- public Image getImage()
- {
- return image;
- }
-
- public String getText()
- {
- return text;
- }
-
- public ITreeElement[] getChildren()
- {
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public ITreeElement[] getAllChildren()
- {
- return (ITreeElement[]) allChildren.toArray(new ITreeElement[0]);
- }
-
- public void setChildren(Collection list)
- {
- children = list;
- }
-
- public void setAllChildren(Collection list)
- {
- allChildren = list;
- }
-
- public Object getParent(Object element)
- {
- return xsdSchema;
- }
-
- public boolean hasChildren(Object element)
- {
- return true;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
-
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
-
- switch (groupType)
- {
- case TYPES : {
- actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
- actionIDs.add(AddXSDSimpleTypeDefinitionAction.ID);
- break;
- }
- case ELEMENTS : {
- actionIDs.add(AddXSDElementAction.ID);
- break;
- }
- case GROUPS : {
- actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
- break;
- }
- case ATTRIBUTES : {
- actionIDs.add(AddXSDAttributeDeclarationAction.ID);
- actionIDs.add(AddXSDAttributeGroupDefinitionAction.ID);
- break;
- }
- case ATTRIBUTE_GROUPS : {
- actionIDs.add(AddXSDAttributeGroupDefinitionAction.ID);
- break;
- }
- case DIRECTIVES : {
- actionIDs.add(AddXSDSchemaDirectiveAction.INCLUDE_ID);
- actionIDs.add(AddXSDSchemaDirectiveAction.IMPORT_ID);
- actionIDs.add(AddXSDSchemaDirectiveAction.REDEFINE_ID);
- break;
- }
- }
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (getText().equals(property))
- notifyListeners(this, property);
- }
-
- public List getTypes()
- {
- return null;
- }
-
- public IModel getModel()
- {
- return (IModel)XSDAdapterFactory.getInstance().adapt(xsdSchema);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java
deleted file mode 100644
index 83e8c924ba..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java
+++ /dev/null
@@ -1,85 +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.wst.xsd.ui.internal.adapters;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedSimpleTypeAction;
-import org.eclipse.xsd.XSDRedefine;
-
-
-public class RedefineCategoryAdapter extends CategoryAdapter
-{
- protected XSDRedefine xsdRedefine;
- private XSDRedefineAdapter xsdRedefineAdapter;
-
- public RedefineCategoryAdapter(String label, Image image, Collection children, XSDRedefine xsdRedefine, XSDRedefineAdapter xsdRedefineAdapter, int groupType)
- {
- super(label, image, children, xsdRedefine.getSchema(), groupType);
- this.xsdRedefine = xsdRedefine;
- this.target = xsdRedefine;
- this.xsdRedefineAdapter = xsdRedefineAdapter;
- }
-
- public XSDRedefine getXSDRedefine()
- {
- return xsdRedefine;
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
-
- switch (groupType)
- {
- case TYPES:
- {
- actionIDs.add(AddXSDRedefinedComplexTypeAction.ID);
- actionIDs.add(AddXSDRedefinedSimpleTypeAction.ID);
- break;
- }
- case GROUPS:
- {
- actionIDs.add(AddXSDRedefinedModelGroupAction.ID);
- break;
- }
- case ATTRIBUTES:
- case ATTRIBUTE_GROUPS:
- {
- actionIDs.add(AddXSDRedefinedAttributeGroupAction.ID);
- break;
- }
- }
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String[])actionIDs.toArray(new String [0]);
- }
-
- public IModel getModel()
- {
- return (IModel)XSDAdapterFactory.getInstance().adapt(xsdRedefine.getSchema());
- }
-
-
- public XSDRedefineAdapter getXsdRedefineAdapter() {
- return xsdRedefineAdapter;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
deleted file mode 100644
index a05ce01b12..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-public class XSDAdapterFactory extends AdapterFactoryImpl
-{
- protected static XSDAdapterFactory instance;
-
- public static XSDAdapterFactory getInstance()
- {
- if (instance == null)
- {
- // first use the one defined by the configuration
- instance = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getAdapterFactory();
- // if there isn't one, then use the default
- if (instance == null)
- instance = new XSDAdapterFactory();
- }
- return instance;
- }
-
- public Adapter createAdapter(Notifier target)
- {
- XSDSwitch xsdSwitch = new XSDSwitch()
- {
- public Object caseXSDSchemaDirective(XSDSchemaDirective object)
- {
- return new XSDSchemaDirectiveAdapter();
- }
-
- public Object caseXSDWildcard(XSDWildcard object)
- {
- return new XSDWildcardAdapter();
- }
-
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object)
- {
- return new XSDAttributeGroupDefinitionAdapter();
- }
-
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
- {
- return new XSDModelGroupDefinitionAdapter();
- }
-
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object)
- {
- return new XSDAttributeDeclarationAdapter();
- }
-
- public Object caseXSDAttributeUse(XSDAttributeUse object)
- {
- return new XSDAttributeUseAdapter();
- }
-
- public Object caseXSDParticle(XSDParticle object)
- {
- return new XSDParticleAdapter();
- }
-
- public Object caseXSDElementDeclaration(XSDElementDeclaration object)
- {
- return new XSDElementDeclarationAdapter();
- }
-
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
- {
- return new XSDSimpleTypeDefinitionAdapter();
- }
-
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
- {
- // we don't like exposing the 'anyType' type as a visible complex type
- // so we adapt it in a specialized way so that it's treated as simple type
- // that way it doesn't show up as a reference from a field
- //
- if ("anyType".equals(object.getName())) //$NON-NLS-1$
- {
- return new XSDAnyTypeDefinitionAdapter();
- }
- else
- {
- return new XSDComplexTypeDefinitionAdapter();
- }
- }
-
- public Object caseXSDModelGroup(XSDModelGroup object)
- {
- return new XSDModelGroupAdapter();
- }
-
- public Object caseXSDSchema(XSDSchema object)
- {
- return new XSDSchemaAdapter();
- }
-
- public Object caseXSDEnumerationFacet(XSDEnumerationFacet object)
- {
- return new XSDEnumerationFacetAdapter();
- }
-
- public Object caseXSDRedefine(XSDRedefine object)
- {
- return new XSDRedefineAdapter();
- }
- };
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter)
- {
- result = (Adapter) o;
- }
- else
- {
-// Thread.dumpStack();
- }
- return result;
- }
-
- public Adapter adapt(Notifier target)
- {
- return adapt(target, this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
deleted file mode 100644
index 3e8dc51a32..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class XSDAnyTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
-{
- public boolean isComplexType()
- {
- return false;
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
- public String[] getActions(Object object)
- {
- return null;
- }
-
- public boolean isAnonymous()
- {
- return false;
- }
-
- public IADTObject getTopContainer()
- {
- return null;
- }
-
- public Command getDeleteCommand()
- {
- return null;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(((XSDConcreteComponent)target).getSchema());
- return (IModel)adapter;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
deleted file mode 100644
index 2ed6b4fb10..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDAttributeDeclarationAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
- protected XSDAttributeDeclaration getXSDAttributeDeclaration()
- {
- return (XSDAttributeDeclaration)target;
- }
-
- protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
- {
- return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
- }
-
- public boolean isGlobal()
- {
- return getXSDAttributeDeclaration().eContainer() instanceof XSDSchema;
- }
-
- public boolean isReference()
- {
- return getXSDAttributeDeclaration().isAttributeDeclarationReference();
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=251008
- public String[] getActions(Object object)
- {
- if(!isGlobal())
- {
- List defaultActions = new ArrayList();
- defaultActions = Arrays.asList(super.getActions(object));
-
- ArrayList list = new ArrayList();
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ATTRIBUTE);
- list.add(AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID);
- list.add(AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
-
- int len = defaultActions.size();
- for(int i = 0; i < len; i++)
- {
- if (defaultActions.get(i).equals(AddXSDAttributeDeclarationAction.ID))
- {
- continue;
- }
- list.add(defaultActions.get(i));
- }
- return (String [])list.toArray(new String[0]);
- }
- else
- {
- return super.getActions(object);
- }
- }
-
-
- public boolean isFocusAllowed()
- {
- return isGlobal();
- }
-
- public String getTypeNameQualifier()
- {
- XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition();
- if (type != null)
- {
- return type.getTargetNamespace();
- }
- return "";
- }
-
- public IADTObject getTopContainer()
- {
- if (!isGlobal())
- {
- return getGlobalXSDContainer(getXSDAttributeDeclaration());
- }
- return this;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
deleted file mode 100644
index 6ecebef7e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDAttributeGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider, IGraphElement, IADTObjectListener
-{
- public static final Image ATTRIBUTE_GROUP_REF_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRef.gif");
- public static final Image ATTRIBUTE_GROUP_REF_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRefdis.gif");
- public static final Image ATTRIBUTE_GROUP_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroup.gif");
- public static final Image ATTRIBUTE_GROUP_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupdis.gif");
-
- protected List fields = null;
- protected List otherThingsToListenTo = null;
- protected boolean readOnly;
- protected boolean changeReadOnlyField =false;
- protected HashMap deletedTypes = new HashMap();
-
- public XSDAttributeGroupDefinitionAdapter()
- {
- super();
- }
-
- public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
- {
- return (XSDAttributeGroupDefinition) target;
- }
-
- public Image getImage()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
- {
- return isReadOnly() ? ATTRIBUTE_GROUP_REF_DISABLED_ICON_IMAGE : ATTRIBUTE_GROUP_REF_ICON_IMAGE;
- }
- else
- {
- return isReadOnly() ? ATTRIBUTE_GROUP_DISABLED_ICON_IMAGE : ATTRIBUTE_GROUP_ICON_IMAGE;
- }
- }
-
- public String getText()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- String result = xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ? xsdAttributeGroupDefinition.getQName() : xsdAttributeGroupDefinition.getName();
- return result == null ? Messages._UI_LABEL_ABSENT : result;
- }
-
- public ITreeElement[] getChildren()
- {
- XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target;
- List list = new ArrayList();
- Iterator iterator = xsdAttributeGroup.getContents().iterator();
- while (iterator.hasNext())
- {
- Object o = iterator.next();
- if (o instanceof XSDAttributeUse)
- {
- list.add(((XSDAttributeUse)o).getAttributeDeclaration());
- }
- else
- {
- list.add(o);
- }
- }
- XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
- if (wildcard != null)
- {
- list.add(wildcard);
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(AddXSDAnyAttributeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- Object schema = getEditorSchema();
- XSDAttributeGroupDefinition attributeGroupDefinition = getXSDAttributeGroupDefinition();
- if (attributeGroupDefinition.getSchema() == schema)
- {
- XSDConcreteComponent container = attributeGroupDefinition.getContainer();
- if (container == schema || container instanceof XSDRedefine)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- return null;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDAttributeGroupDefinition());
- }
-
- public List getFields()
- {
- if (fields == null)
- {
- fields = new ArrayList();
- otherThingsToListenTo = new ArrayList();
- XSDVisitorForFields visitor = new XSDVisitorForFields();
- visitor.visitAttributeGroupDefinition(getXSDAttributeGroupDefinition());
- populateAdapterList(visitor.concreteComponentList, fields);
- populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.registerListener(this);
- }
- }
- }
- return fields;
- }
-
- protected void clearFields()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.unregisterListener(this);
- }
- }
- }
- fields = null;
- otherThingsToListenTo = null;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeGroupDefinition().getSchema());
- return (IModel)adapter;
- }
-
- public String getName()
- {
- // TODO (cs) ... review this
- return getText();
- }
-
- public boolean isFocusAllowed()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
- {
- return false;
- }
- return true;
- }
-
- public IADTObject getTopContainer()
- {
- XSDAttributeGroupDefinition attrGroupDef = getXSDAttributeGroupDefinition();
- XSDConcreteComponent container = attrGroupDef.getContainer();
- if (container instanceof XSDSchema || container instanceof XSDRedefine)
- return this;
- else
- return getGlobalXSDContainer(attrGroupDef);
- }
-
- public void notifyChanged(Notification msg)
- {
- clearFields();
- super.notifyChanged(msg);
- }
-
- public void propertyChanged(Object object, String property)
- {
- clearFields();
- notifyListeners(this, null);
- }
- public boolean isReadOnly()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- if (hasSetReadOnlyField())
- {
- deletedTypes.put(xsdAttributeGroupDefinition.getName(), new Boolean(true));
- changeReadOnlyField = false;
- return readOnly;
- }
- else
- {
- if (deletedTypes!= null )
- {
- Boolean deleted = ((Boolean)deletedTypes.get(xsdAttributeGroupDefinition.getName()));
- if (deleted != null && deleted.booleanValue())
- {
- return true;
- }
- else
- {
- return super.isReadOnly();
- }
- }
- else
- {
- return super.isReadOnly();
- }
- }
- }
-
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- public boolean hasSetReadOnlyField() {
- return changeReadOnlyField;
- }
-
- public void setChangeReadOnlyField(boolean setReadOnlyField) {
- this.changeReadOnlyField = setReadOnlyField;
- }
-
- public void updateDeletedMap(String addComponent) {
- if (deletedTypes.get(addComponent) != null)
- {
- deletedTypes.clear();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java
deleted file mode 100644
index 668365c990..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDAttributeUseAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
- protected XSDAttributeDeclaration getXSDAttributeDeclaration()
- {
- return getXSDAttributeUse().getAttributeDeclaration();
- }
-
- protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
- {
- return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
- }
-
- protected XSDAttributeUse getXSDAttributeUse()
- {
- return (XSDAttributeUse)target;
- }
-
- public XSDAttributeUseAdapter()
- {
- super();
- }
-
- public String getText()
- {
- return getTextForAttributeUse(getXSDAttributeUse(), true);
- }
-
- public String getTextForAttributeUse(XSDAttributeUse attributeUse, boolean showType)
- {
- XSDAttributeDeclaration ad = attributeUse.getAttributeDeclaration();
-
- StringBuffer result = new StringBuffer();
- result.append(getTextForAttribute(ad, showType));
- /*
- if (xsdAttributeUse.isSetConstraint())
- {
- if (result.length() != 0)
- {
- result.append(" ");
- }
- result.append('<');
- result.append(xsdAttributeUse.getConstraint());
- result.append("=\"");
- result.append(xsdAttributeUse.getLexicalValue());
- result.append("\">");
- }
- */
- return result.toString();
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public String getTypeNameQualifier()
- {
- XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition();
- if (type != null)
- {
- return type.getTargetNamespace();
- }
- return "";
- }
-
- public IADTObject getTopContainer()
- {
- return getGlobalXSDContainer(getXSDAttributeUse());
- }
-
- public boolean isReference()
- {
- return getXSDAttributeUse().getAttributeDeclaration().isAttributeDeclarationReference();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
deleted file mode 100644
index 4db258d737..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.w3c.dom.Element;
-
-public class XSDBaseAdapter extends AdapterImpl implements IADTObject, ITreeElement
-{
- protected List listenerList = new ArrayList();
-
- public boolean isAdapterForType(Object type)
- {
- return type == XSDAdapterFactory.getInstance();
- }
-
- public void populateAdapterList(List notifierList, List adapterList)
- {
- for (Iterator i = notifierList.iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent)obj;
- adapterList.add(XSDAdapterFactory.getInstance().adapt(component));
- }
- else
- {
- adapterList.add(obj);
- }
- }
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- listenerList.remove(listener);
- }
-
- public void notifyChanged(Notification msg)
- {
- super.notifyChanged(msg);
- notifyListeners(this, null);
- }
-
- protected void notifyListeners(Object changedObject, String property)
- {
- List clonedListenerList = new ArrayList();
- clonedListenerList.addAll(listenerList);
- for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
- {
- IADTObjectListener listener = (IADTObjectListener)i.next();
- listener.propertyChanged(this, property);
- }
- }
-
- public ITreeElement[] getChildren()
- {
- return null;
- }
-
- public Image getImage()
- {
- return null;
- }
-
- public String getText()
- {
- return ""; //$NON-NLS-1$
- }
-
- public ITreeElement getParent()
- {
- return null;
- }
-
- public boolean hasChildren()
- {
- if (getChildren() != null)
- {
- return getChildren().length > 0;
- }
- return false;
- }
-
-
- /**
- * Implements IField getContainerType. Get parent Complex Type containing the field
- * @return IComplexType
- */
- public IComplexType getContainerType()
- {
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) target;
- XSDConcreteComponent parent = null;
- XSDComplexTypeDefinition ct = null;
- for (parent = xsdConcreteComponent.getContainer(); parent != null; )
- {
- if (parent instanceof XSDComplexTypeDefinition)
- {
- ct = (XSDComplexTypeDefinition)parent;
- break;
- }
- parent = parent.getContainer();
- }
- if (ct != null)
- {
- return (IComplexType)XSDAdapterFactory.getInstance().adapt(ct);
- }
- return null;
- }
-
- public boolean isReadOnly()
- {
- XSDSchema xsdSchema = null;
- try
- {
- IEditorPart editorPart = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null)
- {
- IWorkbenchPage page = window.getActivePage();
- if (page != null)
- {
- editorPart = page.getActiveEditor();
- }
- }
- if (target instanceof XSDConcreteComponent)
- {
- xsdSchema = ((XSDConcreteComponent)target).getSchema();
- }
- if (editorPart == null)
- {
- return fallBackCheckIsReadOnly();
- }
-
- XSDSchema editorSchema = (XSDSchema)editorPart.getAdapter(XSDSchema.class);
- if (xsdSchema != null && xsdSchema == editorSchema)
- {
- return false;
- }
- else
- {
- return fallBackCheckIsReadOnly();
- }
- }
- catch(Exception e)
- {
-
- }
- return true;
- }
-
- private boolean fallBackCheckIsReadOnly()
- {
- Element element = ((XSDConcreteComponent)target).getElement();
- if (element instanceof IDOMNode
- || element instanceof ElementImpl)
- {
- return false;
- }
- return true;
- }
-
- protected Object getEditorSchema()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart.getAdapter(XSDSchema.class);
- }
-
- protected IADTObject getGlobalXSDContainer(XSDConcreteComponent component)
- {
- XSDConcreteComponent c = component.getContainer();
- // We want the top most structural component
- while (c != null &&
- !(c.getContainer() instanceof XSDSchema) &&
- !(c instanceof XSDComplexTypeDefinition) &&
- !(c instanceof XSDSimpleTypeDefinition) &&
- !(c instanceof XSDModelGroupDefinition) &&
- !(c instanceof XSDAttributeGroupDefinition))
- {
- c = c.getContainer();
- }
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(c);
- if (adapter instanceof IADTObject)
- return (IADTObject)adapter;
- return null;
- }
-
- /**
- * Indicates the presence of an abstract attribute
- * @return true if the component's abstract attribute is true
- */
- public boolean isAbstract()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
deleted file mode 100644
index 9984076ba4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-// a base adapter for reuse by an AttributeUse and AttributeDeclaration
-//
-public abstract class XSDBaseAttributeAdapter extends XSDBaseAdapter implements IField, IGraphElement
-{
- protected abstract XSDAttributeDeclaration getXSDAttributeDeclaration();
- protected abstract XSDAttributeDeclaration getResolvedXSDAttributeDeclaration();
-
- public XSDBaseAttributeAdapter()
- {
- super();
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- if (!isGlobal())
- {
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- }
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- Object schema = getEditorSchema();
- if (getXSDAttributeDeclaration().getSchema() == schema)
- {
- if (getXSDAttributeDeclaration().getContainer() == schema)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String[]) list.toArray(new String[0]);
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDAttributeDeclaration());
- }
-
- public String getKind()
- {
- return XSDConstants.ATTRIBUTE_ELEMENT_TAG;
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return -3;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return -3;
- }
-
- public String getName()
- {
- XSDAttributeDeclaration resolvedAttributeDeclaration = getResolvedXSDAttributeDeclaration();
- String name = resolvedAttributeDeclaration.getName();
- return (name == null) ? "" : name; //$NON-NLS-1$
- }
-
- public IType getType()
- {
- XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition();
- return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public String getTypeName()
- {
- IType type = getType();
- if (type != null)
- {
- return type.getName();
- }
- return "";
- }
-
- public String getTypeNameQualifier()
- {
- XSDAttributeDeclaration attr = getResolvedXSDAttributeDeclaration();
- if (attr != null)
- {
- if (attr.getTypeDefinition() != null)
- {
- return attr.getTypeDefinition().getTargetNamespace();
- }
- }
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getResolvedXSDAttributeDeclaration(), name);
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getImage()
- */
- public Image getImage()
- {
- XSDAttributeDeclaration xsdAttributeDeclaration = getXSDAttributeDeclaration(); // don't want the resolved attribute
- if (xsdAttributeDeclaration.isAttributeDeclarationReference())
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeRefdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributedis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getText()
- */
- public String getText()
- {
- return getTextForAttribute(getResolvedXSDAttributeDeclaration(), true);
- }
-
- public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType)
- {
- ad = ad.getResolvedAttributeDeclaration();
- String name = ad.getName();
- StringBuffer result = new StringBuffer();
- if (name == null)
- {
- result.append(" " + Messages._UI_LABEL_ABSENT + " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- result.append(name);
- }
- if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
- result.append(ad.getTypeDefinition().getName());
- }
- return result.toString();
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public boolean isReference()
- {
- return false;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java
deleted file mode 100644
index 191110cd66..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java
+++ /dev/null
@@ -1,280 +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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-public class XSDChildUtility
-{
- static public List getModelChildren(Object model)
- {
- XSDChildVisitor visitor = new XSDChildVisitor(model);
- visitor.visitXSDObject(model);
- return visitor.list;
- }
-
- static public List getImmediateDerivedTypes(XSDComplexTypeDefinition complexType)
- {
- ArrayList typesDerivedFrom = new ArrayList();
-
- // A handy convenience method quickly gets all
- // typeDefinitions within our schema; note that
- // whether or not this returns types in included,
- // imported, or redefined schemas is subject to change
- List typedefs = complexType.getSchema().getTypeDefinitions();
-
- for (Iterator iter = typedefs.iterator(); iter.hasNext(); )
- {
- XSDTypeDefinition typedef = (XSDTypeDefinition)iter.next();
- // Walk the baseTypes from this typedef seeing if any
- // of them match the requested one
- if (complexType.equals(typedef.getBaseType()))
- {
- // We found it, return the original one and continue
- typesDerivedFrom.add(typedef);
- }
- }
- return typesDerivedFrom;
- }
- // TODO... use the XSDVisitor defined in xsdeditor.util instead
- //
- public static class XSDChildVisitor extends XSDVisitor
- {
- Object root;
- List list = new ArrayList();
-
- public XSDChildVisitor(Object root)
- {
- this.root = root;
- }
-
- public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
- {
- if (xsdModelGroup != root)
- {
- list.add(xsdModelGroup);
- }
- else
- {
- super.visitXSDModelGroup(xsdModelGroup);
- }
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- if (xsdModelGroupDefinition != root)
- {
- list.add(xsdModelGroupDefinition);
- }
- else
- {
- super.visitXSDModelGroupDefinition(xsdModelGroupDefinition);
- }
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
- {
- if (xsdElementDeclaration != root)
- {
- list.add(xsdElementDeclaration);
-
- }
- else
- {
- super.visitXSDElementDeclaration(xsdElementDeclaration);
- }
- }
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- if (xsdComplexTypeDefinition != root)
- {
- if (xsdComplexTypeDefinition.getName() != null || getModelChildren(xsdComplexTypeDefinition).size() > 0)
- {
- list.add(xsdComplexTypeDefinition);
- }
- }
- else
- {
- super.visitXSDComplexTypeDefinition(xsdComplexTypeDefinition);
- }
- }
-
- public void visitXSDWildcard(XSDWildcard xsdWildCard)
- {
- if (xsdWildCard != root)
- {
- list.add(xsdWildCard);
- }
- else
- {
- super.visitXSDWildcard(xsdWildCard);
- }
- }
- }
-
-
- public static class XSDVisitor
- {
- int indent = 0;
-
- public void visitXSDObject(Object object)
- {
- if (object == null)
- return;
-
- XSDSwitch theSwitch = new XSDSwitch()
- {
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
- {
- visitXSDComplexTypeDefinition(object);
- return null;
- }
-
- public Object caseXSDAttributeUse(XSDAttributeUse object)
- {
- visitXSDAttributeUse(object);
- return null;
- }
-
- public Object caseXSDElementDeclaration(XSDElementDeclaration object)
- {
- visitXSDElementDeclaration(object);
- return null;
- }
-
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
- {
- visitXSDModelGroupDefinition(object);
- return super.caseXSDModelGroupDefinition(object);
- }
-
- public Object caseXSDModelGroup(XSDModelGroup object)
- {
- visitXSDModelGroup(object);
- return super.caseXSDModelGroup(object);
- }
-
- public Object caseXSDParticle(XSDParticle object)
- {
- visitXSDParticle(object);
- return null;
- }
-
- public Object caseXSDSchema(XSDSchema object)
- {
- visitXSDSchema(object);
- return null;
- }
-
- public Object caseXSDWildcard(XSDWildcard object)
- {
- visitXSDWildcard(object);
- return null;
- }
- };
- theSwitch.doSwitch((EObject)object);
- }
-
- public void visitXSDAttributeUse(XSDAttributeUse xsdAttributeUse)
- {
-// printIndented("@" + xsdAttributeUse.getAttributeDeclaration().getName());
- }
-
- public void visitXSDSchema(XSDSchema xsdSchema)
- {
- indent += 2;
- for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); )
- {
- visitXSDObject(iterator.next());
- }
- indent -= 2;
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
- {
- indent += 2;
- XSDTypeDefinition td = xsdElementDeclaration.getTypeDefinition();
- if (td == null)
- {
- td = xsdElementDeclaration.getAnonymousTypeDefinition();
- }
- visitXSDObject(td);
- indent -= 2;
- }
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- indent += 2;
- for (Iterator i = xsdComplexTypeDefinition.getAttributeUses().iterator(); i.hasNext(); )
- {
- visitXSDObject(i.next());
- }
- visitXSDObject(xsdComplexTypeDefinition.getContent());
- indent -= 2;
- }
-
- public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
- {
- indent += 2;
- for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
- {
- visitXSDObject(iterator.next());
- }
- indent -= 2;
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- indent += 2;
- visitXSDObject(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
- indent -= 2;
- }
-
- public void visitXSDParticle(XSDParticle xsdParticle)
- {
- indent += 2;
- if (xsdParticle.getContent() != null)
- visitXSDObject(xsdParticle.getContent());
- indent -= 2;
- }
-
- public void visitXSDWildcard(XSDWildcard object)
- {
-
- }
-
- public void printIndented(String string)
- {
- //String spaces = "";
- //for (int i = 0; i < indent; i++)
- //{
- // spaces += " ";
- //}
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
deleted file mode 100644
index 4ad7e9057b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeDefinitionAdapter extends XSDTypeDefinitionAdapter implements IComplexType, IADTObjectListener
-{
- protected List fields = null;
- protected List otherThingsToListenTo = null;
- protected boolean readOnly;
- protected boolean changeReadOnlyField =false;
- protected HashMap deletedTypes = new HashMap();
-
- public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
- {
- return (XSDComplexTypeDefinition) target;
- }
-
- public IType getSuperType()
- {
- XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
-
- // test to filter out the 'anyType' type ... don't want to see that
- //
- if (td != null && !td.getName().equals("anyType")) //$NON-NLS-1$
- {
- return (IType) XSDAdapterFactory.getInstance().adapt(td);
- }
- return null;
- }
-
- protected void clearFields()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.unregisterListener(this);
- }
- }
- }
- fields = null;
- otherThingsToListenTo = null;
- }
-
- public List getFields()
- {
- if (fields == null)
- {
- fields = new ArrayList();
- otherThingsToListenTo = new ArrayList();
-
- XSDVisitorForFields visitor = new XSDVisitorForFieldsWithSpaceFillers();
- visitor.visitComplexTypeDefinition(getXSDComplexTypeDefinition());
- populateAdapterList(visitor.concreteComponentList, fields);
- populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.registerListener(this);
- }
- }
- }
- return fields;
- }
-
- class XSDVisitorForFieldsWithSpaceFillers extends XSDVisitorForFields
- {
- public XSDVisitorForFieldsWithSpaceFillers()
- {
- super();
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext();)
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attributeUse = (XSDAttributeUse) o;
- concreteComponentList.add(attributeUse.getAttributeDeclaration());
- thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) o;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- if (attrGroup.getContents().size() == 0)
- {
- concreteComponentList.add(new SpaceFiller("attribute")); //$NON-NLS-1$
- }
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- int numOfChildren = modelGroup.getContents().size();
- if (numOfChildren == 0)
- {
- concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
- }
- super.visitModelGroup(modelGroup);
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
- if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup()))
- {
- concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
- }
- super.visitModelGroupDefinition(modelGroupDef);
- }
- }
-
- public List getModelGroups()
- {
- List groups = new ArrayList();
- groups.addAll(XSDChildUtility.getModelChildren(getXSDComplexTypeDefinition()));
- return groups;
- }
-
- public List getAttributeGroupContent()
- {
- EList attrContent = getXSDComplexTypeDefinition().getAttributeContents();
- List attrUses = new ArrayList();
- List list = new ArrayList();
-
- for (Iterator it = attrContent.iterator(); it.hasNext();)
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) it.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) attrGroupContent;
- list.add(XSDAdapterFactory.getInstance().adapt(attributeGroupDefinition));
- getAttributeUses(attributeGroupDefinition, attrUses);
- }
- else
- {
- attrUses.add(attrGroupContent);
- list.add(new TargetConnectionSpaceFiller(this));
- }
- }
- return list;
- }
-
- public boolean isComplexType()
- {
- return true;
- }
-
- public void notifyChanged(Notification msg)
- {
- clearFields();
- super.notifyChanged(msg);
- }
-
- public Command getUpdateNameCommand(String newName)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getXSDComplexTypeDefinition(), newName);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- return new AddXSDElementCommand(Messages._UI_ACTION_ADD_FIELD, getXSDComplexTypeDefinition());
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDComplexTypeDefinition());
- }
-
- protected class AddNewFieldCommand extends Command
- {
- protected String defaultName;
- protected String fieldKind;
-
- AddNewFieldCommand(String defaultName, String fieldKind)
- {
- this.defaultName = defaultName;
- this.fieldKind = fieldKind;
- }
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- Object schema = getEditorSchema();
-
- XSDComplexTypeDefinition complexType = getXSDComplexTypeDefinition();
- Object contentType = getContentType();
- XSDDerivationMethod derivation = complexType.getDerivationMethod();
- if (contentType instanceof XSDSimpleTypeDefinition)
- {
- List fields = getFields();
- boolean hasSimpleContentAttributes = false;
- for (Iterator iterator = fields.iterator(); iterator.hasNext(); )
- {
- Object field = iterator.next();
- // We have attributes, so we need to add the compartment for housing the attributes
- if (field instanceof XSDAttributeDeclarationAdapter)
- {
- hasSimpleContentAttributes = true;
- break;
- }
- }
-
- if (hasSimpleContentAttributes || XSDDerivationMethod.EXTENSION_LITERAL.equals(derivation))
- {
- list.add(AddXSDAttributeDeclarationAction.ID);
- }
- else if (XSDDerivationMethod.RESTRICTION_LITERAL.equals(derivation))
- {
- list.add(AddXSDEnumerationFacetAction.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(SetBaseTypeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- }
- else
- {
- list.add(AddXSDElementAction.ID);
- list.add(AddXSDElementAction.REF_ID);
- list.add(AddXSDAnyElementAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(AddXSDAttributeDeclarationAction.REF_ID);
- list.add(AddXSDAttributeGroupDefinitionAction.REF_ID);
- list.add(AddXSDAnyAttributeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(AddXSDModelGroupAction.SEQUENCE_ID);
- list.add(AddXSDModelGroupAction.CHOICE_ID);
- list.add(AddXSDModelGroupAction.ALL_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(SetBaseTypeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- }
- if (complexType.getSchema() == schema)
- {
- XSDConcreteComponent container = complexType.getContainer();
- if (container == schema || container instanceof XSDRedefine)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- String[] result = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- public void propertyChanged(Object object, String property)
- {
- clearFields();
- notifyListeners(this, null);
- }
-
- class BogusAction extends Action
- {
- BogusAction(String name)
- {
- super(name);
- }
-
- public void run()
- {
- // TODO Auto-generated method stub
- super.run();
- }
- }
-
- public ITreeElement[] getChildren()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = getXSDComplexTypeDefinition();
- List list = new ArrayList();
- // Add attributes
- for (Iterator i = xsdComplexTypeDefinition.getAttributeContents().iterator(); i.hasNext();)
- {
- Object obj = i.next();
- if (obj instanceof XSDAttributeUse)
- {
- list.add(((XSDAttributeUse)obj).getAttributeDeclaration());
- }
- else if (obj instanceof XSDAttributeGroupDefinition)
- {
- getAttributeUses((XSDAttributeGroupDefinition) obj, list);
- }
- }
- // Add enumerations
- boolean canHaveEnumerations = xsdComplexTypeDefinition.getContentType() instanceof XSDSimpleTypeDefinition &&
- XSDDerivationMethod.RESTRICTION_LITERAL.equals(xsdComplexTypeDefinition.getDerivationMethod());
- if (canHaveEnumerations)
- {
- Object contentType = getContentType();
- if (contentType != null)
- {
- for (Iterator iterator = ((XSDSimpleTypeDefinition)contentType).getEnumerationFacets().iterator(); iterator.hasNext();)
- {
- XSDEnumerationFacet enumerationFacet = (XSDEnumerationFacet)iterator.next();
- list.add(enumerationFacet);
- }
- }
- }
- XSDWildcard anyAttr = xsdComplexTypeDefinition.getAttributeWildcard();
- if (anyAttr != null)
- list.add(anyAttr);
- // get immediate XSD Model Group of this complex type
- if (xsdComplexTypeDefinition.getContent() != null)
- {
- XSDComplexTypeContent xsdComplexTypeContent = xsdComplexTypeDefinition.getContent();
- if (xsdComplexTypeContent instanceof XSDParticle)
- {
- XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
- if (particleContent instanceof XSDModelGroup)
- {
- list.add(particleContent);
- }
- }
- }
- // get inherited XSD Model Group of this complex type
- boolean showInheritedContent = XSDEditorPlugin.getPlugin().getShowInheritedContent();
- if (showInheritedContent)
- {
- XSDTypeDefinition typeDef = xsdComplexTypeDefinition.getBaseTypeDefinition();
- if (typeDef instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition baseCT = (XSDComplexTypeDefinition) typeDef;
- if (baseCT.getTargetNamespace() != null && !baseCT.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- if (baseCT.getContent() != null)
- {
- XSDComplexTypeContent xsdComplexTypeContent = baseCT.getContent();
- if (xsdComplexTypeContent instanceof XSDParticle)
- {
- XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
- if (particleContent instanceof XSDModelGroup)
- {
- list.add(particleContent);
- }
- }
- }
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
-
- public Image getImage()
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDComplexTypedis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDComplexType.gif"); //$NON-NLS-1$
- }
-
- public String getText()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
-
- StringBuffer result = new StringBuffer();
-
- result.append(xsdComplexTypeDefinition.getName() == null ? "local type" : xsdComplexTypeDefinition.getName()); //$NON-NLS-1$
-
- XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
- if (baseTypeDefinition != null && baseTypeDefinition != xsdComplexTypeDefinition.getContent() && baseTypeDefinition.getName() != null && !XSDConstants.isURType(baseTypeDefinition))
- {
-
- try{
- String qName = baseTypeDefinition.getQName(xsdComplexTypeDefinition);
- result.append(" : "); //$NON-NLS-1$
- result.append(qName);
- }
- catch (Exception e)
- {
- return result.toString();
- }
-
- }
-
- return result.toString();
- }
-
- public void getAttributeUses(XSDAttributeGroupDefinition attributeGroupDefinition, List list)
- {
- Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
- while (i.hasNext())
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- getAttributeUses((XSDAttributeGroupDefinition) attrGroupContent, list);
- }
- else
- {
- list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
- }
- }
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDComplexTypeDefinition().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return true;
- }
-
- public boolean isAnonymous()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
- return !(xsdComplexTypeDefinition.eContainer() instanceof XSDSchema ||
- xsdComplexTypeDefinition.eContainer() instanceof XSDRedefine);
- }
-
- public IADTObject getTopContainer()
- {
- return this;
- }
-
- public boolean isAbstract()
- {
- return getXSDComplexTypeDefinition().isAbstract();
- }
-
- public Object getContentType()
- {
- return getXSDComplexTypeDefinition().getContent();
- }
- public boolean isReadOnly()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
- if (hasSetReadOnlyField())
- {
- deletedTypes.put(xsdComplexTypeDefinition.getName(), new Boolean(true));
- changeReadOnlyField = false;
- return readOnly;
- }
- else
- {
- if (deletedTypes!= null )
- {
- Boolean deleted = ((Boolean)deletedTypes.get(xsdComplexTypeDefinition.getName()));
- if (deleted != null && deleted.booleanValue())
- return true;
- else return super.isReadOnly();
- }
- else
- return super.isReadOnly();
- }
- }
-
-public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
-}
-
-public boolean hasSetReadOnlyField() {
- return changeReadOnlyField;
-}
-
-public void setChangeReadOnlyField(boolean setReadOnlyField) {
- this.changeReadOnlyField = setReadOnlyField;
-}
-
-public void updateDeletedMap(String addComponent)
-{
- if (deletedTypes.get(addComponent) != null)
- {
- deletedTypes.clear();
- }
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
deleted file mode 100644
index c1501d72d0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationAdapter extends XSDParticleAdapter implements IField, IActionProvider, IAnnotationProvider, IGraphElement
-{
- protected XSDElementDeclaration getXSDElementDeclaration()
- {
- return (XSDElementDeclaration) target;
- }
-
- public String getName()
- {
- String name = getXSDElementDeclaration().getResolvedElementDeclaration().getName();
- return (name == null) ? "" : name; //$NON-NLS-1$
- }
-
- public String getTypeName()
- {
- IType type = getType();
- if (type != null)
- {
- return type.getName();
- }
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- XSDTypeDefinition type = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
- if (type != null)
- {
- return type.getTargetNamespace();
- }
- return "";
- }
-
- public IType getType()
- {
- XSDTypeDefinition td = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
- //if (td != null &&
- // td.getTargetNamespace() != null && td.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) return null;
- return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public Image getImage()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
-
- if (!xsdElementDeclaration.isElementDeclarationReference())
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDElementdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDElementRefdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDElementRef.gif"); //$NON-NLS-1$
- }
- }
-
- public String getText()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
- XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
- //String name = xsdElementDeclaration != resolvedElementDeclaration ? xsdElementDeclaration.getQName() : xsdElementDeclaration.getName();
- String name = resolvedElementDeclaration.getName();
-
- StringBuffer result = new StringBuffer();
- if (name == null)
- {
- result.append(Messages._UI_LABEL_ABSENT);
- }
- else
- {
- result.append(name);
- }
-
- if (!xsdElementDeclaration.isGlobal())
- {
- Element element = xsdElementDeclaration.getElement();
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
- int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
-
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
-
- if (resolvedElementDeclaration.getAnonymousTypeDefinition() == null && resolvedElementDeclaration.getTypeDefinition() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- // result.append(resolvedElementDeclaration.getTypeDefinition().getQName(xsdElementDeclaration));
- result.append(resolvedElementDeclaration.getTypeDefinition().getName());
- }
-
- String text = result.toString();
- String processedString = TextProcessor.process(text, ":");
- return processedString;
-
- }
-
- public ITreeElement[] getChildren()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
- List list = new ArrayList();
- XSDTypeDefinition type = null;
- if (xsdElementDeclaration.isElementDeclarationReference())
- {
- type = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
- }
- else
- {
- type = xsdElementDeclaration.getAnonymousTypeDefinition();
- if (type == null)
- {
- type = xsdElementDeclaration.getTypeDefinition();
- }
- }
-
- if (type instanceof XSDComplexTypeDefinition && type.getTargetNamespace() != null && !type.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- XSDComplexTypeDefinition ctType = (XSDComplexTypeDefinition) type;
- if (ctType != null)
- {
- if (xsdElementDeclaration.isGlobal())
- list.add(ctType);
- }
- }
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
- }
-
- public String getKind()
- {
- return "element"; //$NON-NLS-1$
- }
-
- public boolean isGlobal()
- {
- return getXSDElementDeclaration().eContainer() instanceof XSDSchema;
- }
-
- public boolean isReference()
- {
- return ((XSDElementDeclaration) target).isElementDeclarationReference();
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getXSDElementDeclaration().getResolvedElementDeclaration(), name);
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return new DeleteCommand(getXSDElementDeclaration());
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
-
- if (!isGlobal())
- {
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ELEMENT);
- list.add(AddXSDElementAction.BEFORE_SELECTED_ID);
- list.add(AddXSDElementAction.AFTER_SELECTED_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
- }
-
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE);
- list.add(SetTypeAction.SET_NEW_TYPE_ID);
- list.add(SetTypeAction.SELECT_EXISTING_TYPE_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
-
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
- list.add(SetMultiplicityAction.REQUIRED_ID);
- list.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
- list.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
- list.add(SetMultiplicityAction.ONE_OR_MORE_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
-
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- Object schema = getEditorSchema();
- if (getXSDElementDeclaration().getSchema() == schema)
- {
- if (getXSDElementDeclaration().getContainer() == schema)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDElementDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return isGlobal();
- }
-
- public IADTObject getTopContainer()
- {
- if (!isGlobal())
- {
- return getGlobalXSDContainer(getXSDElementDeclaration());
- }
- return this;
- }
-
- public boolean isAbstract()
- {
- return getXSDElementDeclaration().isAbstract();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java
deleted file mode 100644
index 7e9b8fc997..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java
+++ /dev/null
@@ -1,120 +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.xsd.ui.internal.adapters;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-/**
- * @deprecated not used
- */
-public class XSDEmptyFieldAdapter extends XSDBaseAdapter implements IField
-{
- String kind;
- public XSDEmptyFieldAdapter()
- {
- super();
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public String getName()
- {
- return null;
- }
-
- public String getTypeName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IType getType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IModel getModel()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isReference()
- {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java
deleted file mode 100644
index e6dfbe9685..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDEnumerationFacet;
-
-public class XSDEnumerationFacetAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
-{
- public XSDEnumerationFacet getXSDEnumerationFacet()
- {
- return (XSDEnumerationFacet)target;
- }
-
- public XSDEnumerationFacetAdapter()
- {
- super();
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
-
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ENUMERATION);
- list.add(AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID);
- list.add(AddXSDEnumerationFacetAction.AFTER_SELECTED_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public Image getImage()
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif"); //$NON-NLS-1$
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDEnumerationFacet());
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDEnumerationFacet().getSchema());
- return (IModel)adapter;
- }
-
- public IADTObject getTopContainer()
- {
- return getGlobalXSDContainer(getXSDEnumerationFacet());
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
- public String getText()
- {
- return getXSDEnumerationFacet().getLexicalValue();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
deleted file mode 100644
index 904acec553..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDModelGroupAdapter extends XSDParticleAdapter implements IActionProvider, IGraphElement
-{
- XSDModelGroup getXSDModelGroup()
- {
- return (XSDModelGroup) target;
- }
-
- public XSDModelGroupAdapter()
- {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getImage()
- */
- public Image getImage()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- if (XSDCompositor.CHOICE_LITERAL == xsdModelGroup.getCompositor())
- {
- return ModelGroupFigure.CHOICE_ICON_IMAGE;
- }
- else if (XSDCompositor.ALL_LITERAL == xsdModelGroup.getCompositor())
- {
- return ModelGroupFigure.ALL_ICON_IMAGE;
- }
- else
- {
- return ModelGroupFigure.SEQUENCE_ICON_IMAGE;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getText()
- */
- public String getText()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
-
- StringBuffer result = new StringBuffer();
- String name = xsdModelGroup.getCompositor().getName();
- if (name != null)
- {
- result.append(name);
- }
-
- Element element = xsdModelGroup.getElement();
-
- if (element != null)
- {
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
- int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
- return result.toString();
- }
-
- public ITreeElement[] getChildren()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- List list = new ArrayList();
- for (Iterator i = xsdModelGroup.getContents().iterator(); i.hasNext(); )
- {
- Object object = i.next();
- XSDParticleContent particle = ((XSDParticle)object).getContent();
- if (particle instanceof XSDElementDeclaration)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDWildcard)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDModelGroup)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDModelGroupDefinition)
- {
- //list.add(((XSDModelGroupDefinition)particle).getResolvedModelGroupDefinition());
- list.add(particle);
- }
- }
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement []) adapterList.toArray(new ITreeElement[0]);
- }
-
- public Object getParent(Object object)
- {
- XSDModelGroup element = (XSDModelGroup) object;
- return element.getContainer();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
- */
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(AddXSDElementAction.ID);
- actionIDs.add(AddXSDElementAction.REF_ID);
- actionIDs.add(AddXSDAnyElementAction.ID);
- // Add Element Ref
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(AddXSDModelGroupAction.SEQUENCE_ID);
- actionIDs.add(AddXSDModelGroupAction.CHOICE_ID);
- actionIDs.add(AddXSDModelGroupAction.ALL_ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
-// actionIDs.add(AddFieldAction.ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- // Add Any
-
- actionIDs.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
- actionIDs.add(SetMultiplicityAction.REQUIRED_ID);
- actionIDs.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
- actionIDs.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
- actionIDs.add(SetMultiplicityAction.ONE_OR_MORE_ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_END_ID);
-
- if (!(getParent(target) instanceof XSDModelGroupDefinition))
- {
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(DeleteAction.ID);
- }
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
-
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public int getMaxOccurs()
- {
- return getMaxOccurs(getXSDModelGroup());
- }
-
- public int getMinOccurs()
- {
- return getMinOccurs(getXSDModelGroup());
- }
-
- public IADTObject getTopContainer()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- return getGlobalXSDContainer(xsdModelGroup);
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDModelGroup());
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroup().getSchema());
- return (IModel)adapter;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
deleted file mode 100644
index 6fcd1934f1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDModelGroupDefinitionAdapter extends XSDParticleAdapter implements IStructure, IActionProvider, IGraphElement, IADTObjectListener
-{
- public static final Image MODEL_GROUP_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroup.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupdis.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_REF_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupRef.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_REF_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupRefdis.gif"); //$NON-NLS-1$
-
- protected List fields = null;
- protected List otherThingsToListenTo = null;
- protected boolean readOnly;
- protected boolean changeReadOnlyField =false;
- protected HashMap deletedTypes = new HashMap();
-
- public XSDModelGroupDefinitionAdapter()
- {
- super();
- }
-
- public XSDModelGroupDefinition getXSDModelGroupDefinition()
- {
- return (XSDModelGroupDefinition) target;
- }
-
- public Image getImage()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
-
- if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
- {
- if (isReadOnly())
- {
- return MODEL_GROUP_REF_DISABLED_ICON;
- }
- return MODEL_GROUP_REF_ICON;
- }
- else
- {
- if (isReadOnly())
- {
- return MODEL_GROUP_DISABLED_ICON;
- }
- return MODEL_GROUP_ICON;
- }
- }
-
- public String getText()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
- if (xsdModelGroupDefinition.getResolvedModelGroupDefinition().getContainer() == null && xsdModelGroupDefinition.getName() ==null) return ""; // Removed
- String result = xsdModelGroupDefinition.isModelGroupDefinitionReference() ? xsdModelGroupDefinition.getQName() : xsdModelGroupDefinition.getName();
- return result == null ? Messages._UI_LABEL_ABSENT : result;
- }
-
- public ITreeElement[] getChildren()
- {
- XSDModelGroupDefinition def = (XSDModelGroupDefinition)target;
- List list = new ArrayList();
- // Bug246036 - need to stop showing element content in a cycle.
- // And, we should not show any element content for references otherwise there will be two
- // entries in the tree viewer for the same item
- if (!def.isModelGroupDefinitionReference())
- {
- XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
- if (xsdModelGroup != null)
- list.add(xsdModelGroup);
- }
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
- */
- public String[] getActions(Object object)
- {
- Collection list = new ArrayList();
-
- XSDModelGroupDefinition modelGroupDefinition = getXSDModelGroupDefinition();
- boolean isModelGroupReference = modelGroupDefinition.isModelGroupDefinitionReference();
- if (!isModelGroupReference)
- {
- list.add(AddXSDElementAction.ID);
- list.add(AddXSDElementAction.REF_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(AddXSDModelGroupAction.SEQUENCE_ID);
- list.add(AddXSDModelGroupAction.CHOICE_ID);
- list.add(AddXSDModelGroupAction.ALL_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- }
-
- list.add(DeleteAction.ID);
-
- if (isModelGroupReference)
- {
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
- list.add(SetMultiplicityAction.REQUIRED_ID);
- list.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
- list.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
- list.add(SetMultiplicityAction.ONE_OR_MORE_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- Object schema = getEditorSchema();
- if (modelGroupDefinition.getSchema() == schema)
- {
- XSDConcreteComponent container = modelGroupDefinition.getContainer();
- if (container == schema || container instanceof XSDRedefine)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
-
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- return null;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDModelGroupDefinition());
- }
-
- // TODO Common this up with XSDComplexType's. See also getFields
- protected void clearFields()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.unregisterListener(this);
- }
- }
- }
- fields = null;
- otherThingsToListenTo = null;
- }
-
- public List getFields()
- {
- List fields = new ArrayList();
- otherThingsToListenTo = new ArrayList();
- XSDVisitorForFields visitor = new XSDVisitorForGroupFieldsWithSpaceFillers();
- visitor.visitModelGroupDefinition(getXSDModelGroupDefinition());
- populateAdapterList(visitor.concreteComponentList, fields);
-
- // TODO (cs) common a base class for a structure thingee
- //
- populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.registerListener(this);
- }
- }
- return fields;
- }
-
- protected class XSDVisitorForGroupFieldsWithSpaceFillers extends XSDVisitorForFields
- {
- public XSDVisitorForGroupFieldsWithSpaceFillers()
- {
- super();
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- int numOfChildren = modelGroup.getContents().size();
- if (numOfChildren == 0)
- {
- concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
- }
- super.visitModelGroup(modelGroup);
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
- if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup()))
- {
- concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
- }
- super.visitModelGroupDefinition(modelGroupDef);
- }
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroupDefinition().getSchema());
- return (IModel)adapter;
- }
- public String getName()
- {
- return getText();
- }
-
- public boolean isFocusAllowed()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
- if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
- {
- return false;
- }
- return true;
- }
-
- public void propertyChanged(Object object, String property)
- {
- clearFields();
- notifyListeners(this, null);
- }
-
- public int getMaxOccurs()
- {
- return getMaxOccurs(getXSDModelGroupDefinition());
- }
-
- public int getMinOccurs()
- {
- return getMinOccurs(getXSDModelGroupDefinition());
- }
-
- public IADTObject getTopContainer()
- {
- XSDModelGroupDefinition group = getXSDModelGroupDefinition();
- XSDConcreteComponent container = group.getContainer();
- if (container instanceof XSDSchema || container instanceof XSDRedefine)
- return this;
- else
- return getGlobalXSDContainer(group);
- }
- public boolean isReadOnly()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
- if (hasSetReadOnlyField())
- {
- deletedTypes.put(xsdModelGroupDefinition.getName(), new Boolean(true));
- changeReadOnlyField = false;
- return readOnly;
- }
- else
- {
- if (deletedTypes!= null )
- {
- Boolean deleted = ((Boolean)deletedTypes.get(xsdModelGroupDefinition.getName()));
- if (deleted != null && deleted.booleanValue())
- return true;
- else return super.isReadOnly();
- }
- else
- return super.isReadOnly();
- }
-
-
- }
-
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- public boolean hasSetReadOnlyField() {
- return changeReadOnlyField;
- }
-
- public void setChangeReadOnlyField(boolean setReadOnlyField) {
- this.changeReadOnlyField = setReadOnlyField;
- }
-
- public void updateDeletedMap(String addComponent) {
- if (deletedTypes.get(addComponent) != null)
- deletedTypes.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java
deleted file mode 100644
index a26649ce7a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java
+++ /dev/null
@@ -1,161 +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.xsd.ui.internal.adapters;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-
-public class XSDParticleAdapter extends XSDBaseAdapter implements IAnnotationProvider
-{
- public XSDParticleAdapter()
- {
- super();
- }
-
- public int getMaxOccurs()
- {
- return getMaxOccurs((XSDConcreteComponent) target);
- }
-
- public int getMinOccurs()
- {
- return getMinOccurs((XSDConcreteComponent) target);
- }
-
- public static int getMinOccurs(XSDConcreteComponent component)
- {
- int minOccur = -2;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMinOccurs())
- {
- try
- {
- minOccur = ((XSDParticle) o).getMinOccurs();
- }
- catch (Exception e)
- {
- }
- }
- }
- }
- return minOccur;
- }
-
- public static int getMaxOccurs(XSDConcreteComponent component)
- {
- int maxOccur = -2;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMaxOccurs())
- {
- try
- {
- maxOccur = ((XSDParticle) o).getMaxOccurs();
- }
- catch (Exception e)
- {
- }
- }
- }
- }
- return maxOccur;
- }
-
- public String getNameAnnotationString()
- {
- return buildAnnotationString(true);
- }
-
- public String getNameAnnotationToolTipString()
- {
- return buildAnnotationString(false);
- }
-
- public String getTypeAnnotationString()
- {
- return null;
- }
-
- public String getTypeAnnotationToolTipString()
- {
- return null;
- }
-
- protected String buildAnnotationString(boolean isForLabel)
- {
- String occurenceDescription = ""; //$NON-NLS-1$
- String toolTipDescription = ""; //$NON-NLS-1$
- // TODO: set int values as defined constants
- // -2 means the user didn't specify (so the default is 1)
- int minOccurs = getMinOccurs();
- int maxOccurs = getMaxOccurs();
-
- // This is for the attribute field case, which has no
- // occurrence attributes
- if (minOccurs == -3 && maxOccurs == -3)
- {
- occurenceDescription = ""; //$NON-NLS-1$
- }
- else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
- {
- occurenceDescription = "[0..1]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_OPTIONAL;
- }
- else if (minOccurs == 0 && maxOccurs == -1)
- {
- occurenceDescription = "[0..*]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_ZERO_OR_MORE;
- }
- else if ((minOccurs == 1 && maxOccurs == -1) || (minOccurs == -2 && maxOccurs == -1))
- {
- occurenceDescription = "[1..*]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_ONE_OR_MORE;
- }
- else if ((minOccurs == 1 && maxOccurs == 1) || (minOccurs == -2 && maxOccurs == 1) || (minOccurs == 1 && maxOccurs == -2))
- {
- occurenceDescription = "[1..1]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_REQUIRED;
- }
- else if (minOccurs == -2 && maxOccurs == -2)
- {
- occurenceDescription = ""; //$NON-NLS-1$
- // none specified, so don't have any toolTip description
- }
- else
- {
- if (maxOccurs == -2)
- maxOccurs = 1;
- String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- occurenceDescription = "[" + minSymbol + ".." + maxSymbol + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- toolTipDescription = Messages._UI_LABEL_ARRAY;
- }
-
- if (isForLabel)
- {
- return occurenceDescription;
- }
- else
- {
- return toolTipDescription;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java
deleted file mode 100644
index 66bc64fe21..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java
+++ /dev/null
@@ -1,295 +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.wst.xsd.ui.internal.adapters;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDRedefineContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class XSDRedefineAdapter extends XSDSchemaDirectiveAdapter
-{
-
- public XSDRedefineAdapter()
- {
- super();
- }
-
- public ITreeElement[] getChildren()
- {
- XSDRedefine xsdRedefine = (XSDRedefine)getTarget();
-
- children = new ArrayList();
-
- if (attributesCategory != null)
- {
- List attributes = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
- List groups = getCategoryChildren(CategoryAdapter.GROUPS);
- List types = getCategoryChildren(CategoryAdapter.TYPES);
-
- attributesCategory.setChildren(attributes);
- attributesCategory.setAllChildren(attributes);
- typesCategory.setChildren(types);
- typesCategory.setAllChildren(types);
- groupsCategory.setChildren(groups);
- groupsCategory.setAllChildren(groups);
- }
- else
- {
- createCategoryAdapters(xsdRedefine);
- }
-
- children.add(attributesCategory);
- children.add(typesCategory);
- children.add(groupsCategory);
-
- return (ITreeElement[])children.toArray(new ITreeElement [0]);
- }
-
- public IADTObject getTopContainer()
- {
- return this;
- }
-
- public boolean isFocusAllowed()
- {
- return true;
- }
-
- protected List types = null;
-
- protected List children, allChildren;
-
- protected CategoryAdapter attributesCategory;
-
- protected CategoryAdapter typesCategory;
-
- protected CategoryAdapter groupsCategory;
-
- /**
- * Create all the category adapters
- *
- * @param xsdRedefine the parent redefine component
- */
- private void createCategoryAdapters(XSDRedefine xsdRedefine)
- {
- List attributes = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
- List groups = getCategoryChildren(CategoryAdapter.GROUPS);
- List types = getCategoryChildren(CategoryAdapter.TYPES);
-
- XSDEditorPlugin xsdEditorPlugin = XSDEditorPlugin.getDefault();
- attributesCategory = new RedefineCategoryAdapter(
- Messages._UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS,
- xsdEditorPlugin.getIconImage("obj16/attributesheader"), attributes, xsdRedefine, this, CategoryAdapter.ATTRIBUTES); //$NON-NLS-1$
- attributesCategory.setAllChildren(attributes);
- registerListener(attributesCategory);
-
- typesCategory = new RedefineCategoryAdapter(
- Messages._UI_GRAPH_REDEFINE_TYPES,
- xsdEditorPlugin.getIconImage("obj16/typesheader"), types, xsdRedefine, this, CategoryAdapter.TYPES); //$NON-NLS-1$
- typesCategory.setAllChildren(types);
- registerListener(typesCategory);
-
- groupsCategory = new RedefineCategoryAdapter(
- Messages._UI_GRAPH_REDEFINE_GROUPS,
- xsdEditorPlugin.getIconImage("obj16/groupsheader"), groups, xsdRedefine, this, CategoryAdapter.GROUPS); //$NON-NLS-1$
- groupsCategory.setAllChildren(groups);
- registerListener(groupsCategory);
- }
-
- public void notifyChanged(final Notification msg)
- {
- class CategoryNotification extends NotificationImpl
- {
- protected Object category;
-
- public CategoryNotification(Object category)
- {
- super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
- this.category = category;
- }
-
- public Object getNotifier()
- {
- return category;
- }
-
- public Object getFeature()
- {
- return msg.getFeature();
- }
- }
-
- if (children == null)
- {
- getChildren();
- }
-
- Object newValue = msg.getNewValue();
- Object oldValue = msg.getOldValue();
-
- if (XSDPackage.eINSTANCE.getXSDRedefine_Contents() == msg.getFeature())
- {
- if ((newValue instanceof XSDAttributeGroupDefinition) || oldValue instanceof XSDAttributeGroupDefinition)
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTES);
- Assert.isTrue(adapter != null);
- List list = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
- adapter.setChildren(list);
- adapter.setAllChildren(list);
-
- if (adapter.getModel() instanceof XSDSchemaAdapter)
- {
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
- schemaAdapter.notifyChanged(msg);
- }
-
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if ((newValue instanceof XSDComplexTypeDefinition || newValue instanceof XSDSimpleTypeDefinition) || (oldValue instanceof XSDComplexTypeDefinition || oldValue instanceof XSDSimpleTypeDefinition))
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.TYPES);
- Assert.isTrue(adapter != null);
- List types = getCategoryChildren(CategoryAdapter.TYPES);
- adapter.setChildren(types);
- adapter.setAllChildren(types);
- if (adapter.getModel() instanceof XSDSchemaAdapter)
- {
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
- schemaAdapter.notifyChanged(msg);
- }
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (newValue instanceof XSDModelGroupDefinition || oldValue instanceof XSDModelGroupDefinition)
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.GROUPS);
- Assert.isTrue(adapter != null);
- List list = getCategoryChildren(CategoryAdapter.GROUPS);
- adapter.setChildren(list);
- adapter.setAllChildren(list);
- if (adapter.getModel() instanceof XSDSchemaAdapter)
- {
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
- schemaAdapter.notifyChanged(msg);
- }
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Annotations())
- {
- return;
- }
- }
- super.notifyChanged(msg);
- }
-
- private void updateCategories()
- {
- getChildren();
- }
-
- public CategoryAdapter getCategory(int category)
- {
- if (children == null)
- {
- updateCategories();
- }
- int length = children.size();
- CategoryAdapter adapter = null;
- for (int index = 0; index < length; index++)
- {
- adapter = (CategoryAdapter)children.get(index);
- if (adapter.getGroupType() == category)
- {
- break;
- }
- }
- return adapter;
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
-
- actionIDs.add(DeleteAction.ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(SetInputToGraphView.ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
-
- return (String[])actionIDs.toArray(new String [0]);
- }
-
- public void propertyChanged(Object object, String property)
- {
- notifyListeners(object, property);
- }
-
- public Image getImage()
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif"); //$NON-NLS-1$
- }
-
- private List getCategoryChildren(int category)
- {
- List list = new ArrayList();
- XSDRedefine redefine = (XSDRedefine)target;
- Iterator iterator = redefine.getContents().iterator();
- while (iterator.hasNext())
- {
- XSDRedefineContent redefineContent = (XSDRedefineContent)iterator.next();
-
- if (redefineContent instanceof XSDAttributeGroupDefinition && category == CategoryAdapter.ATTRIBUTES)
- {
- list.add(redefineContent);
- }
- else if (redefineContent instanceof XSDModelGroupDefinition && category == CategoryAdapter.GROUPS)
- {
- list.add(redefineContent);
- }
- else if (redefineContent instanceof XSDComplexTypeDefinition && category == CategoryAdapter.TYPES)
- {
- list.add(redefineContent);
- }
- else if (redefineContent instanceof XSDSimpleTypeDefinition && category == CategoryAdapter.TYPES)
- {
- list.add(redefineContent);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
deleted file mode 100644
index fe30e58473..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Tada Takatoshi / Fujitsu - bug 245480 - provided initial patch
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSchemaAdapter extends XSDBaseAdapter implements IActionProvider, IModel, IADTObjectListener
-{
- protected List types = null;
- protected List children, allChildren;
-
- protected CategoryAdapter fDirectivesCategory;
- protected CategoryAdapter fElementsCategory;
- protected CategoryAdapter fAttributesCategory;
- protected CategoryAdapter fTypesCategory;
- protected CategoryAdapter fGroupsCategory;
-
- /**
- * Create all the category adapters
- *
- * @param xsdSchema
- */
- protected void createCategoryAdapters(XSDSchema xsdSchema)
- {
- List directivesList = getDirectives(xsdSchema);
- List elementsList = getGlobalElements(xsdSchema);
- List attributesList = getAttributeList(xsdSchema);
- List groups = getGroups(xsdSchema);
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- fDirectivesCategory = new CategoryAdapter(Messages._UI_GRAPH_DIRECTIVES, XSDEditorPlugin.getDefault().getIconImage("obj16/directivesheader"), directivesList, xsdSchema, CategoryAdapter.DIRECTIVES); //$NON-NLS-1$
- fDirectivesCategory.setAllChildren(directivesList);
- registerListener(fDirectivesCategory);
-
- fElementsCategory = new CategoryAdapter(Messages._UI_GRAPH_ELEMENTS, XSDEditorPlugin.getDefault().getIconImage("obj16/elementsheader"), elementsList, xsdSchema, CategoryAdapter.ELEMENTS); //$NON-NLS-1$
- fElementsCategory.setAllChildren(getGlobalElements(xsdSchema, true));
- registerListener(fElementsCategory);
-
- fAttributesCategory = new CategoryAdapter(Messages._UI_GRAPH_ATTRIBUTES, XSDEditorPlugin.getDefault().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES); //$NON-NLS-1$
- fAttributesCategory.setAllChildren(getAttributeList(xsdSchema,true));
- registerListener(fAttributesCategory);
-
- fTypesCategory = new CategoryAdapter(Messages._UI_GRAPH_TYPES, XSDEditorPlugin.getDefault().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES); //$NON-NLS-1$
- fTypesCategory.setAllChildren(getTypes(xsdSchema, true));
- registerListener(fTypesCategory);
-
- fGroupsCategory = new CategoryAdapter(Messages._UI_GRAPH_GROUPS, XSDEditorPlugin.getDefault().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS); //$NON-NLS-1$
- fGroupsCategory.setAllChildren(getGroups(xsdSchema,true));
- registerListener(fGroupsCategory);
- }
-
- public List getTypes()
- {
- if (types == null)
- {
- types = new ArrayList();
- XSDSchema schema = (XSDSchema) target;
- List concreteComponentList = new ArrayList();
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- XSDConcreteComponent component = (XSDConcreteComponent) i.next();
- if (component instanceof XSDTypeDefinition)
- {
- concreteComponentList.add(component);
- }
- }
- populateAdapterList(concreteComponentList, types);
- }
- return types;
- }
-
- protected boolean isSameNamespace(String ns1, String ns2)
- {
- if (ns1 == null) ns1 = "";
- if (ns2 == null) ns2 = "";
-
- if (ns1.equals(ns2))
- {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getChildren()
- */
- public ITreeElement[] getChildren()
- {
- XSDSchema xsdSchema = (XSDSchema) getTarget();
-
- children = new ArrayList();
-
- // just set categoryadapters' children if category adapters are
- // already created
- if (fDirectivesCategory != null)
- {
- List directivesList = getDirectives(xsdSchema);
- List elementsList = getGlobalElements(xsdSchema);
- List attributesList = getAttributeList(xsdSchema);
- List groups = getGroups(xsdSchema);
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- fDirectivesCategory.setChildren(directivesList);
- fDirectivesCategory.setAllChildren(directivesList);
- fElementsCategory.setChildren(elementsList);
- fElementsCategory.setAllChildren(getGlobalElements(xsdSchema, true));
- fAttributesCategory.setChildren(attributesList);
- fAttributesCategory.setAllChildren(getAttributeList(xsdSchema, true));
- fTypesCategory.setChildren(types);
- fTypesCategory.setAllChildren(getTypes(xsdSchema, true));
- fGroupsCategory.setChildren(groups);
- fGroupsCategory.setAllChildren(getGroups(xsdSchema, true));
- }
- else
- {
- createCategoryAdapters(xsdSchema);
- }
-
- children.add(fDirectivesCategory);
- children.add(fElementsCategory);
- children.add(fAttributesCategory);
- children.add(fTypesCategory);
- children.add(fGroupsCategory);
-
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public void notifyChanged(final Notification msg)
- {
- class CategoryNotification extends NotificationImpl
- {
- protected Object category;
-
- public CategoryNotification(Object category)
- {
- super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
- this.category = category;
- }
-
- public Object getNotifier()
- {
- return category;
- }
-
- public Object getFeature()
- {
- return msg.getFeature();
- }
- }
-
- if (children == null)
- {
- getChildren();
- }
-
- Object newValue = msg.getNewValue();
-
- Object oldValue = msg.getOldValue();
- // Bug 245480 - Deletion of Include, Import and Redefine is not reflected in the Outline view
- // We only want to refresh the Directives folder for any changes to XSDDirectives. The first case covers
- // changes to one directive, whereas the missing case as reported in bug 245480 covers changes to a list
- // of directives.
- boolean updateDirectivesCategory = false;
- if (oldValue instanceof XSDSchemaDirective)
- {
- updateDirectivesCategory = true;
- }
- else if (oldValue instanceof Collection)
- {
- Iterator iterator = ((Collection) oldValue).iterator();
- while (iterator.hasNext())
- {
- Object obj = iterator.next();
- if (obj instanceof XSDSchemaDirective)
- {
- // if we find at least one directive, then we should refresh the folder
- updateDirectivesCategory = true;
- break;
- }
- }
- }
-
- if (newValue instanceof XSDInclude || newValue instanceof XSDImport || newValue instanceof XSDRedefine ||
- (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Contents() && updateDirectivesCategory) || // handle the case for delete directive
- msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_IncorporatedVersions()) // updates to the imports/includes
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.DIRECTIVES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getDirectives(xsdSchema));
- adapter.setAllChildren(getDirectives(xsdSchema));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ElementDeclarations())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.ELEMENTS);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getGlobalElements(xsdSchema));
- adapter.setAllChildren(getGlobalElements(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeDeclarations() ||
- msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeGroupDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getAttributeList(xsdSchema));
- adapter.setAllChildren(getAttributeList(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_TypeDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.TYPES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- adapter.setChildren(types);
- adapter.setAllChildren(getTypes(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ModelGroupDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.GROUPS);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getGroups(xsdSchema));
- adapter.setAllChildren(getGroups(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Annotations())
- {
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_SchemaLocation())
- {
- notifyListeners(msg, null);
- return;
- }
-
- types = null;
- getTypes();
-
- super.notifyChanged(msg);
- }
-
- public void updateCategories()
- {
- // TODO: revisit this
- getChildren();
- }
-
- public CategoryAdapter getCategory(int category)
- {
- if (children == null) updateCategories(); // init categories
- int length = children.size();
- CategoryAdapter adapter = null;
- for (int i = 0; i < length; i++)
- {
- adapter = (CategoryAdapter) children.get(i);
- if (adapter.getGroupType() == category)
- {
- break;
- }
- }
- return adapter;
- }
-
- public List getDirectives(XSDSchema schema)
- {
- List list = new ArrayList();
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- list.add(o);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- public List getGlobalElements(XSDSchema schema, boolean showFromIncludes)
- {
- List elements = schema.getElementDeclarations();
- List list = new ArrayList();
- for (Iterator i = elements.iterator(); i.hasNext();)
- {
- XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
- if (shouldShowComponent(elem, schema, showFromIncludes))
- {
- list.add(elem);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- public List getGlobalElements(XSDSchema schema)
- {
- return getGlobalElements(schema, false);
- }
-
- /**
- * @param schema
- * @return
- */
- public List getComplexTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List allTypes = schema.getTypeDefinitions();
- List list = new ArrayList();
- for (Iterator i = allTypes.iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (td instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
- if (shouldShowComponent(ct, schema, showFromIncludes))
- {
- list.add(ct);
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- public List getComplexTypes(XSDSchema schema)
- {
- return getComplexTypes(schema, false);
- }
-
- public List getTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List list = getComplexTypes(schema, showFromIncludes);
- list.addAll(getSimpleTypes(schema, showFromIncludes));
- return list;
- }
-
- public List getAttributeGroupList(XSDSchema xsdSchema, boolean showFromIncludes)
- {
- List attributeGroupList = new ArrayList();
- for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
- if (shouldShowComponent(attrGroup, xsdSchema, showFromIncludes))
- {
- attributeGroupList.add(attrGroup);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(attributeGroupList, adapterList);
- return adapterList;
- }
-
- public List getAttributeGroupList(XSDSchema xsdSchema)
- {
- return getAttributeGroupList(xsdSchema, false);
- }
-
- public List getAttributeList(XSDSchema xsdSchema, boolean showFromIncludes)
- {
- List attributesList = new ArrayList();
- for (Iterator iter = xsdSchema.getAttributeDeclarations().iterator(); iter.hasNext();)
- {
- Object o = iter.next();
- if (o instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) o;
- if (attr != null)
- {
- if (attr.getTargetNamespace() != null)
- {
- if (!(attr.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
- {
- if (shouldShowComponent(attr, xsdSchema,showFromIncludes))
- {
- attributesList.add(attr);
- }
- }
- }
- else
- {
- if (shouldShowComponent(attr, xsdSchema,showFromIncludes))
- {
- attributesList.add(attr);
- }
- }
- }
- }
- }
-
- attributesList.addAll(getAttributeGroupList(xsdSchema, showFromIncludes));
-
- List adapterList = new ArrayList();
- populateAdapterList(attributesList, adapterList);
- return adapterList;
- }
-
- public List getAttributeList(XSDSchema xsdSchema)
- {
- return getAttributeList(xsdSchema, false);
- }
-
- public List getSimpleTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List allTypes = schema.getTypeDefinitions();
- List list = new ArrayList();
- for (Iterator i = allTypes.iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (td instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
- if (shouldShowComponent(st, schema, showFromIncludes))
- {
- list.add(st);
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- public List getSimpleTypes(XSDSchema schema)
- {
- return getSimpleTypes(schema, false);
- }
-
- public List getGroups(XSDSchema schema, boolean showFromIncludes)
- {
- List groups = schema.getModelGroupDefinitions();
- List list = new ArrayList();
- for (Iterator i = groups.iterator(); i.hasNext();)
- {
- XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
- if (shouldShowComponent(group, schema, showFromIncludes))
- {
- list.add(group);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- public List getGroups(XSDSchema schema)
- {
- return getGroups(schema, false);
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(AddXSDElementAction.ID);
- actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
-
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public void propertyChanged(Object object, String property)
- {
- notifyListeners(object, property);
- }
-
- public Image getImage()
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); //$NON-NLS-1$
- }
-
- protected boolean shouldShowComponent(XSDNamedComponent component, XSDSchema schema, boolean showFromIncludes)
- {
- return isSameNamespace(component.getTargetNamespace(), schema.getTargetNamespace()) && (component.getRootContainer() == schema || showFromIncludes);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java
deleted file mode 100644
index d7e89eb4ae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-public class XSDSchemaDirectiveAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
-{
- public Image getImage()
- {
- XSDSchemaDirective object = (XSDSchemaDirective) target;
- if (object instanceof XSDImport)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDImport.gif"); //$NON-NLS-1$
- }
- else if (object instanceof XSDInclude)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDInclude.gif"); //$NON-NLS-1$
- }
- else if (object instanceof XSDRedefine)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif"); //$NON-NLS-1$
- }
- return null;
- }
-
- public String getText()
- {
- XSDSchemaDirective directive = (XSDSchemaDirective) target;
- String result = "";
-
- String location = directive.getSchemaLocation();
- if (location == null || location.equals("") )
- {
- result = "(" + Messages._UI_LABEL_NO_LOCATION_SPECIFIED + ")";
- }
- else
- {
- result = location;
- }
-
- // only show the namespace when the directiave is an import
- // (otherwise the namespace is obviously the same as the containing schema's)
- if (directive instanceof XSDImport)
- {
- XSDImport importObj = (XSDImport) directive;
- String namespace = importObj.getNamespace();
- if (namespace != null)
- {
- result += " {" + namespace + "}";
- }
- }
- return result;
- }
-
- public ITreeElement[] getChildren()
- {
- List list = new ArrayList();
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(OpenInNewEditor.ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
-
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getDeleteCommand()
- {
- XSDSchemaDirective object = (XSDSchemaDirective) target;
- return new DeleteCommand(object);
- }
-
- public IModel getModel()
- {
- XSDSchema object = ((XSDSchemaDirective) target).getSchema();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(object);
- return (IModel)adapter;
- }
-
- public IADTObject getTopContainer()
- {
- // There is currently no drill-down details view of directives
- // The top level container is the schema
- return getModel();
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java
deleted file mode 100644
index a66f6a9fab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java
+++ /dev/null
@@ -1,93 +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.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDSimpleContentAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
-{
-
- public XSDSimpleContentAdapter()
- {
- }
-
- public XSDSimpleTypeDefinition getXSDSimpleTypeContent()
- {
- return (XSDSimpleTypeDefinition)target;
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDSimpleTypeContent());
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDSimpleTypeContent().getSchema());
- return (IModel)adapter;
- }
-
- public IADTObject getTopContainer()
- {
- XSDConcreteComponent c = getXSDSimpleTypeContent().getContainer();
- if (c instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) c;
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(ct);
- if (adapter instanceof IADTObject)
- return (IADTObject)adapter;
- }
-
- return null;
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
- public Image getImage()
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDSimpleContent.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDSimpleContent.gif"); //$NON-NLS-1$
- }
-
- public String getText()
- {
- return "";
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
deleted file mode 100644
index 105c362866..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSimpleTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
-{
- protected boolean readOnly;
- protected boolean changeReadOnlyField =false;
- protected HashMap deletedTypes = new HashMap();
- public Image getImage()
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/simpletypedis_obj.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getPlugin().getIcon("obj16/simpletype_obj.gif"); //$NON-NLS-1$
- }
-
- public String getDisplayName()
- {
- return getName();
- }
-
- public String getText()
- {
- return getText(true);
- }
-
- public String getText(boolean showType)
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-
- StringBuffer result = new StringBuffer();
-
- result.append(xsdSimpleTypeDefinition.getName() == null ? Messages._UI_LABEL_LOCAL_TYPE : xsdSimpleTypeDefinition.getName());
-
- if (showType)
- {
- XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
- if (baseTypeDefinition != null && XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
- {
- if (baseTypeDefinition.getName() != null && !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) && !XSDConstants.isAnySimpleType(baseTypeDefinition))
- {
- try {
- String qName = baseTypeDefinition.getQName(xsdSimpleTypeDefinition);
- result.append(" : "); //$NON-NLS-1$
- result.append(qName);
- }
- catch (Exception e)
- {
- }
- }
- }
- else
- {
- XSDSimpleTypeDefinition itemTypeDefinition = xsdSimpleTypeDefinition.getItemTypeDefinition();
- if (itemTypeDefinition != null)
- {
- if (itemTypeDefinition.getName() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- result.append(itemTypeDefinition.getQName(xsdSimpleTypeDefinition));
- }
- }
- else
- {
- List memberTypeDefinitions = xsdSimpleTypeDefinition.getMemberTypeDefinitions();
- if (!memberTypeDefinitions.isEmpty())
- {
- boolean first = true;
- for (Iterator members = memberTypeDefinitions.iterator(); members.hasNext();)
- {
- XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition) members.next();
- if (memberTypeDefinition.getName() != null)
- {
- if (first)
- {
- result.append(" : "); //$NON-NLS-1$
- first = false;
- }
- else
- {
- result.append(" | "); //$NON-NLS-1$
- }
- result.append(memberTypeDefinition.getQName(xsdSimpleTypeDefinition));
- }
- else
- {
- break;
- }
- }
- }
- else if (result.length() == 0)
- {
- result.append(Messages._UI_LABEL_ABSENT);
- }
- }
- }
- }
-
- return result.toString();
- }
-
- public boolean hasChildren()
- {
- return true;
- }
-
- public boolean isComplexType()
- {
- return false;
- }
-
- public boolean isFocusAllowed()
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- {
- return false;
- }
- if (xsdSimpleTypeDefinition.getName() == null)
- {
- return isAnonymous();
- }
- return true;
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(AddXSDEnumerationFacetAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(SetBaseTypeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- Object schema = getEditorSchema();
- XSDTypeDefinition typeDefinition = getXSDTypeDefinition();
- if (typeDefinition.getSchema() == schema)
- {
- XSDConcreteComponent container = typeDefinition.getContainer();
- if (container == schema || container instanceof XSDRedefine)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
-
- return (String [])list.toArray(new String[0]);
- }
-
- public boolean isAnonymous()
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- EObject eContainer = xsdSimpleTypeDefinition.eContainer();
- return !(eContainer instanceof XSDSchema ||
- eContainer instanceof XSDRedefine);
- }
-
- public IADTObject getTopContainer()
- {
- return this;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand(getXSDTypeDefinition());
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDTypeDefinition().getSchema());
- return (IModel)adapter;
- }
-
- public ITreeElement[] getChildren()
- {
- List adapterList = new ArrayList();
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- List list = xsdSimpleTypeDefinition.getEnumerationFacets();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
- public boolean isReadOnly()
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- if (hasSetReadOnlyField())
- {
- deletedTypes.put(xsdSimpleTypeDefinition.getName(), new Boolean(true));
- changeReadOnlyField = false;
- return readOnly;
- }
- else
- {
- if (deletedTypes!= null )
- {
- Boolean deleted = ((Boolean)deletedTypes.get(xsdSimpleTypeDefinition.getName()));
- if (deleted != null && deleted.booleanValue())
- return true;
- else return super.isReadOnly();
- }
- else
- return super.isReadOnly();
- }
-
-
- }
-
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- public boolean hasSetReadOnlyField() {
- return changeReadOnlyField;
- }
-
- public void setChangeReadOnlyField(boolean setReadOnlyField) {
- this.changeReadOnlyField = setReadOnlyField;
- }
-
- public void updateDeletedMap(String addComponent) {
- if (deletedTypes.get(addComponent) != null)
- deletedTypes.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
deleted file mode 100644
index 7ecd548cc6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public abstract class XSDTypeDefinitionAdapter extends XSDBaseAdapter implements IType, IActionProvider, IGraphElement
-{
- public XSDTypeDefinition getXSDTypeDefinition()
- {
- return (XSDTypeDefinition)target;
- }
-
- public String getName()
- {
- EObject eContainer = getXSDTypeDefinition().eContainer();
- if (eContainer instanceof XSDSchema || eContainer instanceof XSDRedefine)
- {
- return getXSDTypeDefinition().getName();
- }
- else
- {
- if (eContainer instanceof XSDNamedComponent)
- {
- XSDNamedComponent ed = (XSDNamedComponent)eContainer;
- return "(" + ed.getName() + "Type)"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return null;
- }
-
- public String getQualifier()
- {
- return getXSDTypeDefinition().getTargetNamespace();
- }
-
- public IType getSuperType()
- {
- XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
- return td != null ? (IType)XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public Command getUpdateNameCommand(String newName)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isComplexType()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
deleted file mode 100644
index 5e2b5c15b4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
- public XSDVisitor()
- {
- circularDefinitionFound = false;
- visitedGroups = new Stack();
- }
-
- public boolean circularDefinitionFound = false;
- protected XSDSchema schema;
- protected Stack visitedGroups = new Stack();
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- visitElementDeclaration(element.getResolvedElementDeclaration());
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- if ((visitedGroups.contains(modelGroupDef.getResolvedModelGroupDefinition().getModelGroup())))
- {
- circularDefinitionFound = true;
- return;
- }
- visitedGroups.push(modelGroupDef.getModelGroup());
- visitModelGroup(modelGroupDef.getModelGroup());
- visitedGroups.pop();
- }
- }
- else
- {
- XSDModelGroupDefinition resolvedGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
- XSDModelGroup modelGroup = resolvedGroupDef.getModelGroup();
-
- if ((visitedGroups.contains(modelGroup)))
- {
- circularDefinitionFound = true;
- return;
- }
-
- visitedGroups.push(modelGroup);
- if (modelGroup != null)
- {
- visitModelGroup(modelGroup);
- }
- visitedGroups.pop();
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)o;
- visitAttributeDeclaration(attrUse.getContent());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- visitAttributeGroupDefinition(attrGroup.getResolvedAttributeGroupDefinition());
- }
- }
- }
-
- public void visitRedefine(XSDRedefine redefine)
- {
-
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
- {
-
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getContent() != null)
- {
- XSDComplexTypeContent complexContent = type.getContent();
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitComplexTypeContent((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
deleted file mode 100644
index 48a0f34396..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitorForFields extends XSDVisitor
-{
- public XSDVisitorForFields()
- {
- super();
- }
-
- public List concreteComponentList = new ArrayList();
- public List thingsWeNeedToListenTo = new ArrayList();
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-
- visitAttributeDeclaration(attrUse.getContent());
-
-// if (attrUse.getAttributeDeclaration() != attrUse.getContent())
-// {
-// visitAttributeDeclaration(attrUse.getContent());
-// }
-// else
-// {
-// thingsWeNeedToListenTo.add(attrUse.getAttributeDeclaration());
-// concreteComponentList.add(attrUse.getAttributeDeclaration());
-// }
- }
- else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)attrGroupContent;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
- if (type.getAttributeWildcard() != null)
- {
- thingsWeNeedToListenTo.add(type.getAttributeWildcard());
- concreteComponentList.add(type.getAttributeWildcard());
- }
- super.visitComplexTypeDefinition(type);
- }
-
- public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
- {
- thingsWeNeedToListenTo.add(content);
-
- super.visitComplexTypeContent(content);
- }
-
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- // listen to definition in case it changes
- XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
- if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup())) return;
-
- if (modelGroupDef.isModelGroupDefinitionReference())
- {
- // if it's a reference we need to listen to the reference incase it changes
- if (!thingsWeNeedToListenTo.contains(modelGroupDef))
- thingsWeNeedToListenTo.add(modelGroupDef);
- }
- super.visitModelGroupDefinition(modelGroupDef);
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- super.visitModelGroup(modelGroup);
- thingsWeNeedToListenTo.add(modelGroup);
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attributeUse = (XSDAttributeUse)o;
- concreteComponentList.add(attributeUse.getAttributeDeclaration());
- thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
-
- XSDWildcard anyAttribute = attributeGroup.getAttributeWildcardContent();
- if (anyAttribute != null)
- {
- concreteComponentList.add(anyAttribute);
- thingsWeNeedToListenTo.add(anyAttribute);
- }
-
- }
-
- public void visitParticle(XSDParticle particle)
- {
- thingsWeNeedToListenTo.add(particle);
- super.visitParticle(particle);
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- concreteComponentList.add(wildcard);
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- thingsWeNeedToListenTo.add(element);
- thingsWeNeedToListenTo.add(element.getResolvedElementDeclaration());
- // now, add the reference as a field
- concreteComponentList.add(element);
- }
- else
- {
- concreteComponentList.add(element.getResolvedElementDeclaration());
- // note... we intentionally ommit the call to super.visitElementDeclaration()
- // since we don't want to delve down deeper than the element
- }
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- if (attr.isAttributeDeclarationReference())
- {
- thingsWeNeedToListenTo.add(attr);
- thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
- concreteComponentList.add(attr);
- }
- else
- {
- concreteComponentList.add(attr.getResolvedAttributeDeclaration());
- thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
deleted file mode 100644
index 1d9c140ee9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDWildcardAdapter extends XSDParticleAdapter implements IField, IActionProvider, IGraphElement
-{
-// public static final Image ANYELEMENT_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAny.gif"); //$NON-NLS-1$
-// public static final Image ANYELEMENT_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAny.gif"); //$NON-NLS-1$
-
- public XSDWildcardAdapter()
- {
-
- }
-
- public Image getImage()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
-
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAnydis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAny.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAnyAttributedis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAnyAttribute.gif"); //$NON-NLS-1$
- }
- }
-
- public String getText()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
-
- StringBuffer result = new StringBuffer();
- Element element = xsdWildcard.getElement();
-
- if (element != null)
- {
- result.append(element.getNodeName());
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
-
- int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
- return result.toString();
-
- }
-
- public boolean hasChildren()
- {
- return false;
- }
-
- public Object getParent(Object object)
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- return xsdWildcard.getContainer();
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand((XSDWildcard) target);
- }
-
- public String getKind()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- return "element"; //$NON-NLS-1$
- }
- return "attribute";
- }
-
- public IModel getModel()
- {
- return null;
- }
-
- public String getName()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- return "any"; //$NON-NLS-1$
- }
- return "anyAttribute"; //$NON-NLS-1$
- }
-
- public IType getType()
- {
- return null;
- }
-
- public String getTypeName()
- {
- return ""; //$NON-NLS-1$
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public boolean isReference()
- {
- return false;
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(DeleteAction.ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public IADTObject getTopContainer()
- {
- return getGlobalXSDContainer((XSDWildcard) target);
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java
deleted file mode 100644
index 2edf44efaf..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RoundedRectangle;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveXSDBaseAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ConnectableEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public abstract class BaseDragAndDropCommand extends BaseCommand
-{
- protected static int ABOVE_IS_CLOSER = 0;
- protected static int BELOW_IS_CLOSER = 1;
-
- protected EditPartViewer viewer;
- protected ChangeBoundsRequest request;
- protected boolean canExecute;
- protected GraphicalEditPart target;
-
- protected GraphicalEditPart leftSiblingEditPart;
- protected GraphicalEditPart rightSiblingEditPart;
- protected Point location;
-
- protected ConnectableEditPart parentEditPart;
- protected XSDConcreteComponent previousRefComponent = null, nextRefComponent = null, xsdComponentToDrag;
- protected XSDBaseFieldEditPart itemToDrag;
- protected Rectangle originalLocation;
- protected Polyline polyLine;
-
- protected MoveXSDBaseAction action;
- protected List targetSpacesList = new ArrayList();
- protected int closerSibling;
-
- public BaseDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
- {
- this.viewer = viewer;
- this.request = request;
- }
-
- protected abstract void setup();
-
- /**
- * Provides the DOM element associated with the parent XSD component.
- * This element is used in the the undo/redo mechanism.
- * @return the DOM element associated with the parent XSD component.
- */
- protected abstract Element getElement();
-
- public PointList getConnectionPoints(Rectangle draggedFigureBounds)
- {
- PointList pointList = null;
- if (target != null && itemToDrag != null && parentEditPart != null)
- {
- pointList = getConnectionPoints(parentEditPart, itemToDrag, draggedFigureBounds);
- }
- return pointList != null ? pointList : new PointList();
- }
-
- // This method supports the preview connection line function related to drag and drop
- //
- public PointList getConnectionPoints(ConnectableEditPart parentEditPart, BaseFieldEditPart childRefEditPart, Rectangle draggedFigureBounds)
- {
- PointList pointList = new PointList();
- int[] data = new int[1];
- Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
- if (a != null)
- {
- int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
- pointList.addPoint(a);
-
- if (data[0] == 0) // insert between 2 items
- {
- int x = a.x + 5;
- pointList.addPoint(new Point(x, a.y));
- pointList.addPoint(new Point(x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- else // insert at first or last position
- {
- pointList.addPoint(new Point(a.x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- }
- return pointList;
- }
-
- // This method supports the preview connection line function related to drag and drop
- //
- protected Point getConnectionPoint(ConnectableEditPart parentEditPart, BaseFieldEditPart childRefEditPart, int[] data)
- {
- Point point = null;
- List childList = parentEditPart.getChildren();
- if (parentEditPart.getFigure() instanceof GenericGroupFigure && childList.size() > 0)
- {
- point = new Point();
-
- Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);
- point.x = r.x + r.width;
- point.y = r.y + r.height/2;
- }
- return point;
- }
-
- protected Rectangle getConnectedEditPartConnectionBounds(ConnectableEditPart editPart)
- {
- return getZoomedBounds(((GenericGroupFigure)editPart.getFigure()).getIconFigure().getBounds());
- }
-
- public void redo()
- {
- }
-
- public void undo()
- {
- }
-
- public void execute()
- {
- if (canExecute)
- {
- // Wrap the drag and drop operation for easy undo and redo.
- beginRecording(this.getElement());
- action.run();
- endRecording();
- }
- }
-
- public boolean canExecute()
- {
- return canExecute;
- }
-
- protected void commonSetup(List siblings, GraphicalEditPart movingEditPart)
- {
- closerSibling = ABOVE_IS_CLOSER;
- int pointerYLocation = location.y;
- int index;
-
- for (index = 0; index < siblings.size(); index++)
- {
- GraphicalEditPart sibling = (GraphicalEditPart) siblings.get(index);
- if (sibling instanceof BaseFieldEditPart)
- {
- int siblingYLocation = getZoomedBounds(sibling.getFigure().getBounds()).getCenter().y;
-
- if (siblingYLocation > pointerYLocation)
- {
- rightSiblingEditPart = sibling;
- if (index > 0)
- {
- leftSiblingEditPart = (GraphicalEditPart) siblings.get(index - 1);
- }
-
- if (leftSiblingEditPart != null && Math.abs(getZoomedBounds(leftSiblingEditPart.getFigure().getBounds()).getCenter().y - pointerYLocation) > Math.abs(siblingYLocation - pointerYLocation))
- {
- closerSibling = BELOW_IS_CLOSER;
- }
- break;
- }
- }
- }
-
- boolean isHandled = handleFirstAndLastDropTargets(index, siblings);
- if (!isHandled)
- handleOtherTargets(index);
-
- calculateLeftAndRightXSDComponents();
-
- xsdComponentToDrag = (XSDConcreteComponent) ((XSDBaseAdapter) itemToDrag.getModel()).getTarget();
- }
-
- protected void calculateLeftAndRightXSDComponents()
- {
- if (leftSiblingEditPart instanceof XSDBaseFieldEditPart)
- {
- Object leftModel = ((XSDBaseFieldEditPart) leftSiblingEditPart).getModel();
- previousRefComponent = null;
- if (leftModel instanceof XSDBaseAdapter)
- {
- XSDBaseAdapter leftAdapter = (XSDBaseAdapter) leftModel;
- previousRefComponent = (XSDConcreteComponent) leftAdapter.getTarget();
- }
- }
-
- if (rightSiblingEditPart instanceof XSDBaseFieldEditPart)
- {
- Object rightModel = ((XSDBaseFieldEditPart) rightSiblingEditPart).getModel();
- nextRefComponent = null;
- if (rightModel instanceof XSDBaseAdapter)
- {
- XSDBaseAdapter rightAdapter = (XSDBaseAdapter) rightModel;
- nextRefComponent = (XSDConcreteComponent) rightAdapter.getTarget();
- }
- }
- }
-
- protected boolean handleFirstAndLastDropTargets(int index, List siblings)
- {
- // Handle case where you drop to first position
- if (index == 0 && siblings.size() > 0)
- {
- leftSiblingEditPart = null;
- rightSiblingEditPart = (GraphicalEditPart) siblings.get(0);
- closerSibling = BELOW_IS_CLOSER;
- }
- // Handle case where you drop to last position
- else if (index > 0 && index == siblings.size())
- {
- leftSiblingEditPart = (GraphicalEditPart) siblings.get(index - 1);
- rightSiblingEditPart = null;
- }
- return false;
- }
-
- protected void handleOtherTargets(int index)
- {
- int in = 0;
- ConnectableEditPart previousModelEditPart = null;
- for (Iterator i = targetSpacesList.iterator(); i.hasNext();)
- {
- Object o = i.next();
- previousModelEditPart = parentEditPart;
- TargetConnectionSpacingFigureEditPart sp = (TargetConnectionSpacingFigureEditPart) o;
- if (sp.getParent() instanceof ConnectableEditPart)
- parentEditPart = (ConnectableEditPart)sp.getParent();
- else
- parentEditPart = null;
- in++;
- if (in > index)
- {
- if (closerSibling == ABOVE_IS_CLOSER)
- {
- parentEditPart = previousModelEditPart;
- }
- break;
- }
- }
- }
-
- protected List calculateFieldEditParts()
- {
- List list = target.getParent().getChildren();
- List listOfFields = new ArrayList();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof BaseFieldEditPart)
- {
- listOfFields.add(o);
- }
- }
- return listOfFields;
- }
-
- protected PointList drawLines(Polyline polyLine)
- {
- PointList pointList = new PointList();
-
- if (leftSiblingEditPart != null)
- {
- Rectangle leftRectangle = getZoomedBounds(leftSiblingEditPart.getFigure().getBounds());
- int xCoord = leftRectangle.x;
- int yCoord = leftRectangle.y;
- int height = leftRectangle.height;
- int width = leftRectangle.width;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + height + 3, xCoord, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord, yCoord + height - 3, xCoord, yCoord + height);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord + height, xCoord + width, yCoord + height);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height + 3);
- }
- else if (rightSiblingEditPart != null)
- {
- Rectangle rightRectangle = getZoomedBounds(rightSiblingEditPart.getFigure().getBounds());
- int xCoord = rightRectangle.x;
- int yCoord = rightRectangle.y;
- int width = rightRectangle.width;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + 3, xCoord, yCoord - 3);
- addLineToPolyline(polyLine, xCoord, yCoord - 3, xCoord, yCoord);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord, xCoord + width, yCoord);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord + 3);
- }
-
- return pointList;
- }
-
- protected Polyline addLineToPolyline(Polyline polyline, int x1, int y1, int x2, int y2)
- {
- polyline.addPoint(new Point(x1, y1));
- polyline.addPoint(new Point(x2, y2));
-
- return polyline;
- }
-
- public IFigure getFeedbackFigure()
- {
- Figure panel = new Figure();
- panel.setLayoutManager(new FreeformLayout());
- panel.setOpaque(false);
-
- Polyline feedbackFigure = new Polyline();
- feedbackFigure.setLineWidth(2);
- drawLines(feedbackFigure);
- originalLocation = new Rectangle(feedbackFigure.getBounds());
- panel.add(feedbackFigure);
-
- polyLine = new Polyline();
- polyLine.setLineStyle(Graphics.LINE_DASHDOT);
- polyLine.setLineWidth(1);
- panel.add(polyLine);
-
- panel.setBounds(originalLocation);
-
- addConnectorToParent(panel);
-
- if (parentEditPart != null && parentEditPart.getFigure() instanceof GenericGroupFigure)
- {
- GenericGroupFigure fig = (GenericGroupFigure)parentEditPart.getFigure();
- Rectangle iconBounds = getZoomedBounds(fig.getIconFigure().getBounds());
- RoundedRectangle roundedRectangle = new RoundedRectangle();
- roundedRectangle.setFill(false);
- roundedRectangle.setOpaque(true);
-// roundedRectangle.setBounds(new Rectangle(iconBounds.x, iconBounds.y, iconBounds.width - 1, iconBounds.height - 1));
- roundedRectangle.setBounds(iconBounds);
- panel.add(roundedRectangle);
- }
- return panel;
- }
-
- protected void addConnectorToParent(IFigure p)
- {
- Rectangle r = originalLocation.getCopy();
- Rectangle pBounds = r.getCopy();
- PointList pointList = getConnectionPoints(r);
-
- if (pointList != null && pointList.size() > 0)
- {
- polyLine.setPoints(pointList);
- Point firstPoint = pointList.getFirstPoint();
- if (firstPoint != null)
- {
- pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
- }
- }
-
- if (parentEditPart != null)
- {
- if (parentEditPart.getFigure() instanceof GenericGroupFigure)
- {
- GenericGroupFigure fig = (GenericGroupFigure)parentEditPart.getFigure();
- Rectangle iconBounds = getZoomedBounds(fig.getIconFigure().getBounds());
- pBounds = pBounds.getUnion(iconBounds);
- }
- }
-
- p.setBounds(pBounds);
- p.validate();
- }
-
- public Point getZoomedPoint(Point p)
- {
- double factor = ((ScalableRootEditPart)viewer.getRootEditPart()).getZoomManager().getZoom();
-
- int x = (int)Math.round(p.x * factor);
- int y = (int)Math.round(p.y * factor);
-
- return new Point(x, y);
- }
-
- public Rectangle getZoomedBounds(Rectangle r)
- {
- double factor = ((ScalableRootEditPart)viewer.getRootEditPart()).getZoomManager().getZoom();
-
- int x = (int)Math.round(r.x * factor);
- int y = (int)Math.round(r.y * factor);
- int width = (int)Math.round(r.width * factor);
- int height = (int)Math.round(r.height * factor);
-
- return new Rectangle(x, y, width, height);
- }
-
- protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
- {
- target = leftField;
- if (direction == PositionConstants.SOUTH)
- {
- if (itemToDrag == target)
- return;
- target = rightField;
- }
- this.location = null;
- if (target != null)
- this.location = target.getFigure().getBounds().getCenter();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java
deleted file mode 100644
index 7c09eb072b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveXSDAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDWildcardAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.AttributeGroupDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDWildcard;
-import org.w3c.dom.Element;
-
-public class XSDAttributeDragAndDropCommand extends BaseDragAndDropCommand
-{
- public XSDAttributeDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request, GraphicalEditPart target, XSDBaseFieldEditPart itemToDrag, Point location)
- {
- super(viewer, request);
- setLabel(Messages._UI_ACTION_DRAG_DROP_ATTRIBUTE);
- this.target = target;
- this.itemToDrag = itemToDrag;
- this.location = location;
- setup();
- }
-
- public XSDAttributeDragAndDropCommand(XSDBaseFieldEditPart itemToDrag, XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
- {
- super(itemToDrag.getViewer(), null);
- setLabel(Messages._UI_ACTION_DRAG_DROP_ATTRIBUTE);
- this.itemToDrag = itemToDrag;
- canExecute = false;
- handleKeyboardDragAndDrop(leftField, rightField, direction);
- }
-
- protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
- {
- super.handleKeyboardDragAndDrop(leftField, rightField, direction);
- if (direction == PositionConstants.NORTH)
- {
- if (target == null)
- {
- target = rightField;
- this.location = target.getFigure().getBounds().getTop();
- }
- else if (!(leftField.getModel() instanceof XSDAttributeDeclarationAdapter)
- || leftField.getModel() instanceof XSDWildcardAdapter)
- {
- target = rightField;
- this.location = target.getFigure().getBounds().getTop();
- }
- }
- if (location == null) return;
- setup();
- }
-
- protected void setup()
- {
- canExecute = false;
-
- // Drop target is attribute group ref
- if (target instanceof AttributeGroupDefinitionEditPart)
- {
- parentEditPart = (AttributeGroupDefinitionEditPart) target;
- if (((GenericGroupFigure) parentEditPart.getFigure()).getIconFigure().getBounds().contains(location))
- {
- xsdComponentToDrag = (XSDConcreteComponent) ((XSDAttributeDeclarationAdapter) itemToDrag.getModel()).getTarget();
- action = new MoveXSDAttributeAction(((AttributeGroupDefinitionEditPart) parentEditPart).getXSDAttributeGroupDefinition(), xsdComponentToDrag, null, null);
- canExecute = action.canMove();
- }
- }
- else if (target instanceof BaseFieldEditPart)
- {
- targetSpacesList = new ArrayList();
- // Calculate the list of all sibling field edit parts;
- List targetEditPartSiblings = calculateFieldEditParts();
- calculateAttributeGroupList();
-
- // Get 'left' and 'right' siblings
- doDrop(targetEditPartSiblings, itemToDrag);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand#getElement()
- */
- protected Element getElement()
- {
- XSDAttributeDeclarationAdapter adapter = (XSDAttributeDeclarationAdapter) itemToDrag.getModel();
- XSDAttributeDeclaration target = (XSDAttributeDeclaration)adapter.getTarget();
- XSDConcreteComponent parent = (XSDConcreteComponent)target.eContainer();
- return parent.getElement();
- }
-
- protected void doDrop(List siblings, GraphicalEditPart movingEditPart)
- {
- commonSetup(siblings, movingEditPart);
-
- if ((previousRefComponent instanceof XSDAttributeDeclaration || previousRefComponent instanceof XSDWildcard)
- && (nextRefComponent instanceof XSDAttributeDeclaration || nextRefComponent instanceof XSDWildcard))
- {
- XSDConcreteComponent parent = previousRefComponent.getContainer().getContainer();
- if (closerSibling == BELOW_IS_CLOSER)
- {
- parent = nextRefComponent.getContainer().getContainer();
- }
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else if (previousRefComponent == null && (nextRefComponent instanceof XSDAttributeDeclaration || nextRefComponent instanceof XSDWildcard))
- {
- XSDConcreteComponent parent = nextRefComponent.getContainer().getContainer();
- if (closerSibling == ABOVE_IS_CLOSER)
- {
- if (leftSiblingEditPart == null)
- {
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else if (parentEditPart != null)
- {
- action = new MoveXSDAttributeAction(parentEditPart.getXSDConcreteComponent(), xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- else
- {
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- else if (previousRefComponent instanceof XSDAttributeDeclaration && nextRefComponent == null)
- {
- XSDConcreteComponent parent = previousRefComponent.getContainer().getContainer();
- if (closerSibling == ABOVE_IS_CLOSER)
- {
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else
- {
- if (rightSiblingEditPart == null)
- {
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else
- {
- action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- }
-
- if (action != null)
- canExecute = action.canMove();
- }
-
-
- // Attribute Group related helper method
-
- protected void calculateAttributeGroupList()
- {
- EditPart editPart = target;
- while (editPart != null)
- {
- if (editPart instanceof ComplexTypeEditPart)
- {
- List list = editPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object child = i.next();
- if (child instanceof CompartmentEditPart)
- {
- List compartmentList = ((CompartmentEditPart) child).getChildren();
- for (Iterator it = compartmentList.iterator(); it.hasNext();)
- {
- Object obj = it.next();
- if (obj instanceof XSDAttributesForAnnotationEditPart)
- {
- XSDAttributesForAnnotationEditPart groups = (XSDAttributesForAnnotationEditPart) obj;
- List groupList = groups.getChildren();
- for (Iterator iter = groupList.iterator(); iter.hasNext();)
- {
- Object groupChild = iter.next();
- if (groupChild instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(groupChild);
- }
- else if (groupChild instanceof AttributeGroupDefinitionEditPart)
- {
- getAttributeGroupEditParts((AttributeGroupDefinitionEditPart) groupChild);
- }
- }
- }
- }
- }
- }
- }
- editPart = editPart.getParent();
- }
-
- }
-
- // Attribute Group related helper method
-
- protected List getAttributeGroupEditParts(AttributeGroupDefinitionEditPart attributeGroupEditPart)
- {
- List groupList = new ArrayList();
- List list = attributeGroupEditPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object object = i.next();
- if (object instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(object);
- }
- else if (object instanceof AttributeGroupDefinitionEditPart)
- {
- AttributeGroupDefinitionEditPart groupRef = (AttributeGroupDefinitionEditPart) object;
- List groupRefChildren = groupRef.getChildren();
- for (Iterator it = groupRefChildren.iterator(); it.hasNext();)
- {
- Object o = it.next();
- if (o instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(o);
- }
- else if (o instanceof AttributeGroupDefinitionEditPart)
- {
- AttributeGroupDefinitionEditPart aGroup = (AttributeGroupDefinitionEditPart) o;
- groupList.add(aGroup);
- groupList.addAll(getAttributeGroupEditParts(aGroup));
- }
- }
- }
- }
- return groupList;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java
deleted file mode 100644
index 95f45b301e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDWildcardAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupDefinitionReferenceEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDGroupsForAnnotationEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDWildcard;
-import org.w3c.dom.Element;
-
-
-public class XSDElementDragAndDropCommand extends BaseDragAndDropCommand
-{
- protected ModelGroupEditPart topMostGroup;
-
- public XSDElementDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request, GraphicalEditPart target, XSDBaseFieldEditPart itemToDrag, Point location)
- {
- super(viewer, request);
- setLabel(Messages._UI_ACTION_DRAG_DROP_ELEMENT);
- this.target = target;
- this.itemToDrag = itemToDrag;
- this.location = location;
- setup();
- }
-
- public XSDElementDragAndDropCommand(XSDBaseFieldEditPart itemToDrag, XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
- {
- super(itemToDrag.getViewer(), null);
- setLabel(Messages._UI_ACTION_DRAG_DROP_ELEMENT);
- this.itemToDrag = itemToDrag;
- canExecute = false;
- handleKeyboardDragAndDrop(leftField, rightField, direction);
- }
-
- protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
- {
- super.handleKeyboardDragAndDrop(leftField, rightField, direction);
- if (direction == PositionConstants.NORTH)
- {
- if (target == null)
- {
- target = rightField;
- this.location = target.getFigure().getBounds().getTop();
- }
- else if (!(leftField.getModel() instanceof XSDElementDeclarationAdapter)
- || leftField.getModel() instanceof XSDWildcardAdapter)
- {
- target = rightField;
- this.location = target.getFigure().getBounds().getTop();
- }
- }
- if (location == null) return;
- setup();
- }
-
- protected void setup()
- {
- canExecute = false;
-
- // Drop target is model group
- if (target instanceof ModelGroupEditPart)
- {
- parentEditPart = (ModelGroupEditPart) target;
- if (((GenericGroupFigure) parentEditPart.getFigure()).getIconFigure().getBounds().contains(location))
- {
- xsdComponentToDrag = (XSDConcreteComponent) ((XSDElementDeclarationAdapter) itemToDrag.getModel()).getTarget();
- action = new MoveXSDElementAction(((ModelGroupEditPart) target).getXSDModelGroup(), xsdComponentToDrag, null, null);
- canExecute = action.canMove();
- }
- }
- else if (target instanceof BaseFieldEditPart)
- {
- targetSpacesList = new ArrayList();
- // Calculate the list of all sibling field edit parts;
- List targetEditPartSiblings = calculateFieldEditParts();
- calculateModelGroupList();
-
- doDrop(targetEditPartSiblings, itemToDrag);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand#getElement()
- */
- protected Element getElement()
- {
- XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) itemToDrag.getModel();
- XSDElementDeclaration target = (XSDElementDeclaration)adapter.getTarget();
- XSDConcreteComponent parent = (XSDConcreteComponent)target.eContainer();
- return parent.getElement();
- }
-
- protected void doDrop(List siblings, GraphicalEditPart movingEditPart)
- {
- commonSetup(siblings, movingEditPart);
-
- // Can common this code up with XSDAttributeDragAndDropCommand...
- if ((previousRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDWildcard)
- && (nextRefComponent instanceof XSDElementDeclaration || nextRefComponent instanceof XSDWildcard))
- {
- XSDModelGroup modelGroup = (XSDModelGroup) previousRefComponent.getContainer().getContainer();
- if (parentEditPart != null)
- modelGroup = ((ModelGroupEditPart) parentEditPart).getXSDModelGroup();
- action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else if (previousRefComponent == null && (nextRefComponent instanceof XSDElementDeclaration || nextRefComponent instanceof XSDWildcard))
- {
- if (closerSibling == ABOVE_IS_CLOSER)
- {
- if (leftSiblingEditPart == null)
- {
- action = new MoveXSDElementAction(topMostGroup.getXSDModelGroup(), xsdComponentToDrag, null, null, false);
- }
- else if (parentEditPart != null)
- {
- action = new MoveXSDElementAction(((ModelGroupEditPart) parentEditPart).getXSDModelGroup(), xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- else
- {
- XSDModelGroup modelGroup = (XSDModelGroup) nextRefComponent.getContainer().getContainer();
- action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- else if ((previousRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDWildcard)
- && nextRefComponent == null)
- {
- XSDModelGroup modelGroup = (XSDModelGroup)previousRefComponent.getContainer().getContainer();
- if (parentEditPart != null)
- modelGroup = ((ModelGroupEditPart) parentEditPart).getXSDModelGroup();
- if (closerSibling == ABOVE_IS_CLOSER)
- {
- action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- else
- {
- if (rightSiblingEditPart == null)
- {
- action = new MoveXSDElementAction(topMostGroup.getXSDModelGroup(), xsdComponentToDrag, null, null, true);
- }
- else
- {
- action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
- }
- }
- }
-
- if (action != null)
- canExecute = action.canMove();
- }
-
- /**
- * overrides base
- */
- protected boolean handleFirstAndLastDropTargets(int index, List siblings)
- {
- // This boolean is to handle the Top and Bottom drop targets for which we want to drop
- // to the top most model group
- // TODO: I need to rearrange this code better
- boolean isHandled = false;
- int pointerYLocation = location.y;
- // We need to find the parent editpart, which is the model group
- // Handle case where you drop to first position
- if (index == 0 && siblings.size() > 0)
- {
- leftSiblingEditPart = null;
- rightSiblingEditPart = (GraphicalEditPart) siblings.get(0);
- int siblingYLocation = getZoomedBounds(rightSiblingEditPart.getFigure().getBounds()).getCenter().y;
- closerSibling = BELOW_IS_CLOSER;
- if (Math.abs(pointerYLocation - siblingYLocation) > getZoomedBounds(rightSiblingEditPart.getFigure().getBounds()).height / 4)
- {
- isHandled = true;
- parentEditPart = topMostGroup;
- if (topMostGroup != null)
- closerSibling = ABOVE_IS_CLOSER;
- }
- }
- // Handle case where you drop to last position
- if (index > 0 && index == siblings.size())
- {
- leftSiblingEditPart = (GraphicalEditPart) siblings.get(index - 1);
- int siblingYLocation = getZoomedBounds(leftSiblingEditPart.getFigure().getBounds()).getCenter().y;
- if (Math.abs(pointerYLocation - siblingYLocation) > getZoomedBounds(leftSiblingEditPart.getFigure().getBounds()).height / 4)
- {
- isHandled = true;
- parentEditPart = topMostGroup;
- if (topMostGroup != null)
- closerSibling = BELOW_IS_CLOSER;
- }
- }
- return isHandled;
- }
-
- // Methods specific to element as drag source
-
- // Model Group related helper method
- protected void calculateModelGroupList()
- {
- EditPart editPart = target;
- while (editPart != null)
- {
- if (editPart instanceof ModelGroupEditPart)
- {
- getModelGroupEditParts((ModelGroupEditPart) editPart);
- }
- else if (editPart instanceof ComplexTypeEditPart || editPart instanceof StructureEditPart)
- {
- boolean foundTop = false;
- List list = editPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object child = i.next();
- if (child instanceof CompartmentEditPart)
- {
- List compartmentList = ((CompartmentEditPart) child).getChildren();
- for (Iterator it = compartmentList.iterator(); it.hasNext();)
- {
- Object obj = it.next();
- if (obj instanceof XSDGroupsForAnnotationEditPart)
- {
- XSDGroupsForAnnotationEditPart groups = (XSDGroupsForAnnotationEditPart) obj;
- List groupList = groups.getChildren();
- for (Iterator iter = groupList.iterator(); iter.hasNext();)
- {
- Object groupChild = iter.next();
- if (groupChild instanceof ModelGroupEditPart)
- {
- if (!foundTop)
- {
- foundTop = true;
- topMostGroup = (ModelGroupEditPart) groupChild;
- }
- getModelGroupEditParts((ModelGroupEditPart) groupChild);
- }
- }
- }
- }
- }
- }
- }
- editPart = editPart.getParent();
- }
- }
-
- // Model Group related helper method
-
- protected List getModelGroupEditParts(ModelGroupEditPart modelGroupEditPart)
- {
- List modelGroupList = new ArrayList();
- List list = modelGroupEditPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object object = i.next();
- if (object instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(object);
- }
- else if (object instanceof ModelGroupDefinitionReferenceEditPart)
- {
- ModelGroupDefinitionReferenceEditPart groupRef = (ModelGroupDefinitionReferenceEditPart) object;
- List groupRefChildren = groupRef.getChildren();
- for (Iterator it = groupRefChildren.iterator(); it.hasNext();)
- {
- Object o = it.next();
- if (o instanceof ModelGroupEditPart)
- {
- getModelGroupEditParts((ModelGroupEditPart) o);
- }
- }
- }
- else if (object instanceof ModelGroupEditPart)
- {
- getModelGroupEditParts((ModelGroupEditPart) object);
- }
- }
- return modelGroupList;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
deleted file mode 100644
index f5bbd30fc7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-
-public class AttributeGroupDefinitionEditPart extends ConnectableEditPart
-{
- ReferenceConnection figure;
- GenericGroupFigure groupFigure;
- public AttributeGroupDefinitionEditPart()
- {
- super();
- }
-
- public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
- {
- if (getModel() instanceof XSDAttributeGroupDefinitionAdapter)
- {
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
- return (XSDAttributeGroupDefinition) adapter.getTarget();
- }
-// else if (getModel() instanceof XSDAttributeGroupDefinition)
-// {
-// return (XSDAttributeGroupDefinition) getModel();
-// }
- return null;
-
- }
-
- protected IFigure createFigure()
- {
- groupFigure = new GenericGroupFigure();
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
- groupFigure.getIconFigure().image = adapter.getImage();
- Label toolTipsLabel = new Label();
- toolTipsLabel.setText(XSDEditorPlugin.getXSDString("_UI_PAGE_HEADING_ATTRIBUTEGROUP_REF"));
- groupFigure.setToolTip(toolTipsLabel);
- return groupFigure;
- }
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
-
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter)getModel();
- XSDAttributeGroupDefinition attributeGroupDefinition = adapter.getXSDAttributeGroupDefinition();
- Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
- while (i.hasNext())
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
- }
- else if (attrGroupContent instanceof XSDAttributeUse)
- {
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)XSDAdapterFactory.getInstance().adapt(((XSDAttributeUse)attrGroupContent).getAttributeDeclaration())));
- }
- else
- {
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
- }
- }
-
- if (list.isEmpty())
- {
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
- }
-
- return list;
- }
-
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- ReferenceConnection connectionFigure = new ReferenceConnection();
-
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
- if (child instanceof AttributeGroupDefinitionEditPart)
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((AttributeGroupDefinitionEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
- else if (child instanceof TargetConnectionSpacingFigureEditPart)
- {
-// TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((TargetConnectionSpacingFigureEditPart) child).getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
-
- connectionFigure.setHighlight(false);
- figure = connectionFigure;
- return connectionFigure;
- }
-
- public String getReaderText()
- {
- String text = ((Label) groupFigure.getToolTip()).getText();
- return text;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
deleted file mode 100644
index bc8008e0ca..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.EditPartNavigationHandlerUtil;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.ContainerLayout;
-
-public class CategoryEditPart extends BaseEditPart
-{
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
- protected Figure outerPane;
- HeadingFigure headingFigure;
- protected ScrollPane scrollpane;
- protected int minimumHeight = 400;
-
- public int getType()
- {
- return ((CategoryAdapter) getModel()).getGroupType();
- }
-
- protected IFigure createFigure()
- {
- outerPane = new Figure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
-
- createHeadingFigure();
-
- int minHeight = SWT.DEFAULT;
- switch (getType())
- {
- case CategoryAdapter.DIRECTIVES:
- {
- minHeight = 80;
- break;
- }
- case CategoryAdapter.ATTRIBUTES:
- case CategoryAdapter.GROUPS:
- {
- minHeight = 100;
- break;
- }
- }
-
- final int theMinHeight = minHeight;
-
- ToolbarLayout outerLayout = new ToolbarLayout(false)
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.union(new Dimension(250, theMinHeight));
- return d;
- }
- };
- outerLayout.setStretchMinorAxis(true);
- outerPane.setLayoutManager(outerLayout);
-
- RectangleFigure line = new RectangleFigure()
- {
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- Dimension d = super.getPreferredSize(wHint, hHint);
- d.width += 20;
- d.height = 1;
- return d;
- }
- };
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outerPane.add(line);
-
- scrollpane = new ScrollPane();
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); // ScrollPane.ALWAYS);
- outerPane.add(scrollpane);
-
- Figure pane = new Figure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- pane.setLayoutManager(layout);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- if (theMinHeight > 0)
- d.height = Math.min(d.height, theMinHeight);
- else
- {
- double factor = getZoomManager().getZoom();
- int scaledHeight = (int)Math.round((getViewer().getControl().getBounds().height - minimumHeight) / factor); // adjust for other categories and spaces
- d.height = Math.max(250, scaledHeight);
- }
- d.width = Math.min(d.width, 300);
- return d;
- }
- };
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
-
- return outerPane;
- }
-
- protected void createHeadingFigure()
- {
- headingFigure = new HeadingFigure();
- outerPane.add(headingFigure);
- headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
- headingFigure.getLabel().setIcon(((CategoryAdapter) getModel()).getImage());
- }
-
- public void refreshVisuals()
- {
- super.refreshVisuals();
-
- RoundedLineBorder border = (RoundedLineBorder) outerPane.getBorder();
- border.setWidth(isSelected ? 2 : 1);
- headingFigure.setSelected(isSelected);
- outerPane.repaint();
-
- headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
- }
-
- public IFigure getContentPane()
- {
- return scrollpane.getContents();
- }
-
- public Label getNameLabel()
- {
- return headingFigure.getLabel();
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- protected EditPart createChild(Object model)
- {
- EditPart editPart = new TopLevelComponentEditPart();
- editPart.setModel(model);
- editPart.setParent(this);
- return editPart;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (editPart instanceof TopLevelComponentEditPart)
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = EditPartNavigationHandlerUtil.getNextSibling(editPart);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = EditPartNavigationHandlerUtil.getPrevSibling(editPart);
- }
- if (result != null)
- {
- scrollTo((AbstractGraphicalEditPart)editPart);
- }
- }
- else
- {
- result = ((BaseEditPart)getParent()).doGetRelativeEditPart(editPart, direction);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- // cs : oddly arrowing up and down true items in the list is not handled nicely
- // by the canned GEF GraphicalViewerKeyHandler so this navigation policy is need to fix that
- selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- protected List getModelChildren()
- {
- CategoryAdapter adapter = (CategoryAdapter) getModel();
- List children = new ArrayList(Arrays.asList(adapter.getAllChildren()));
- return children;
- }
-
- public void scrollTo(AbstractGraphicalEditPart topLevel)
- {
- Rectangle topLevelBounds = topLevel.getFigure().getBounds();
- Rectangle categoryBounds = figure.getBounds();
- int scrollValue = scrollpane.getVerticalScrollBar().getValue();
- int location = topLevelBounds.y + scrollValue - categoryBounds.y;
- scrollpane.scrollVerticalTo(location - categoryBounds.height / 2);
- }
-
- public void setMinimumHeight(int minimumHeight)
- {
- this.minimumHeight = minimumHeight;
- }
-
- public String getReaderText()
- {
- return getNameLabel().getText();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java
deleted file mode 100644
index 5132936e10..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public abstract class ConnectableEditPart extends BaseEditPart
-{
- protected ArrayList connectionFigures = new ArrayList();
-
- public IExtendedFigureFactory getExtendedFigureFactory()
- {
- EditPartFactory factory = getViewer().getEditPartFactory();
- Assert.isTrue(factory instanceof IExtendedFigureFactory, "EditPartFactory must be an instanceof of IExtendedFigureFactory"); //$NON-NLS-1$
- return (IExtendedFigureFactory)factory;
- }
-
- public ConnectableEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- GenericGroupFigure figure = new GenericGroupFigure();
- return figure;
- }
-
- public XSDConcreteComponent getXSDConcreteComponent()
- {
- return (XSDConcreteComponent)((XSDBaseAdapter)getModel()).getTarget();
- }
-
- public List getConnectionFigures()
- {
- return connectionFigures;
- }
-
- public abstract ReferenceConnection createConnectionFigure(BaseEditPart child);
-
- public void activate()
- {
- super.activate();
- activateConnection();
- }
-
- protected void activateConnection()
- {
- if (connectionFigures == null)
- {
- connectionFigures = new ArrayList();
- }
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof BaseEditPart)
- {
- BaseEditPart g = (BaseEditPart) o;
- ReferenceConnection figure = createConnectionFigure(g);
- connectionFigures.add(figure);
- figure.setPoints(figure.getPoints());
-
- getLayer(LayerConstants.CONNECTION_LAYER).add(figure);
- }
- }
- }
-
- public void deactivate()
- {
- super.deactivate();
- deactivateConnection();
- }
-
- protected void deactivateConnection()
- {
- // if we have a connection, remove it
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
-
- if (getLayer(LayerConstants.CONNECTION_LAYER).getChildren().contains(connectionFigure))
- {
- getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
- }
- }
- connectionFigures = null;
- }
- }
-
- public void refresh()
- {
- super.refresh();
- refreshConnection();
- }
-
- protected void refreshConnection()
- {
- if (!isActive())
- return;
-
- if (connectionFigures == null || connectionFigures.isEmpty())
- {
- activateConnection();
- }
- else
- {
- deactivateConnection();
- activateConnection();
- }
- }
-
- public void addFeedback()
- {
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
- connectionFigure.setHighlight(true);
- }
- }
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().setMode(CenteredIconFigure.SELECTED);
- figure.getIconFigure().refresh();
- }
-
- public void removeFeedback()
- {
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
- connectionFigure.setHighlight(false);
- }
- }
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().setMode(CenteredIconFigure.NORMAL);
- figure.getIconFigure().refresh();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().refresh();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- }
-
- protected void addChildVisual(EditPart childEditPart, int index)
- {
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
- getContentPane().add(child, index);
- }
-
- protected void removeChildVisual(EditPart childEditPart)
- {
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
- getContentPane().remove(child);
- }
-
- public IFigure getContentPane()
- {
- return ((GenericGroupFigure)getFigure()).getContentFigure();
- }
-
- public Figure getTargetFigure()
- {
- return ((GenericGroupFigure)getFigure()).getTargetFigure();
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == PositionConstants.WEST)
- {
- if (getParent() instanceof ConnectableEditPart)
- {
- result = getParent();
- }
- else
- {
- result = this;
- }
- }
- else if (direction == PositionConstants.EAST)
- {
- result = (EditPart) editPart.getChildren().get(0);
- TargetConnectionSpacingFigureEditPart target = null;
- boolean foundSelectableGroup = false;
- for (Iterator i = editPart.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (!(child instanceof TargetConnectionSpacingFigureEditPart))
- {
- foundSelectableGroup = true;
- result = child;
- break;
- }
- }
- if (result instanceof TargetConnectionSpacingFigureEditPart)
- {
- target = (TargetConnectionSpacingFigureEditPart) result;
- }
- if (!foundSelectableGroup && target != null)
- {
- EditPart parent = editPart.getParent();
- while (!(parent instanceof CompartmentEditPart))
- {
- parent = parent.getParent();
- if (parent == null) break;
- }
- for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart) i.next();
- if (child instanceof BaseFieldEditPart && !(child instanceof SpaceFillerForFieldEditPart))
- {
- BaseFieldEditPart field = (BaseFieldEditPart) child;
- if (field.getFigure().getBounds().getCenter().y < target.getFigure().getBounds().bottom() &&
- field.getFigure().getBounds().getCenter().y > target.getFigure().getBounds().y)
- {
- return child;
- }
- }
- }
- return editPart;
- }
- }
- else if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- result = (EditPart) editPart.getChildren().get(0);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
deleted file mode 100644
index 8a1ff8bd72..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class ModelGroupDefinitionReferenceEditPart extends ConnectableEditPart
-{
- GenericGroupFigure figure;
-
- public ModelGroupDefinitionReferenceEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- figure = new GenericGroupFigure();
- return figure;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
- figure.getIconFigure().image = adapter.getImage();
-
- GenericGroupFigure groupFigure = (GenericGroupFigure)getFigure();
- String nodeName = "";
-
- // TODO: commmon this up with ModelGroupEditPart, XSDParticleAdapter's code
-
- // -2 means the user didn't specify (so the default is 1)
- int minOccurs = adapter.getMinOccurs();
- int maxOccurs = adapter.getMaxOccurs();
- String occurenceDescription = ""; //$NON-NLS-1$
-
- if (minOccurs == -3 && maxOccurs == -3)
- {
- occurenceDescription = nodeName;
- groupFigure.setText(null);
- }
- else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
- {
- occurenceDescription = nodeName + " [0..1]"; //$NON-NLS-1$
- groupFigure.setText("0..1");
- }
- else if ((minOccurs == 1 && maxOccurs == 1) ||
- (minOccurs == -2 && maxOccurs == 1) ||
- (minOccurs == 1 && maxOccurs == -2))
- {
- occurenceDescription = nodeName + " [1..1]"; //$NON-NLS-1$
- groupFigure.setText("1..1");
- }
- else if (minOccurs == -2 && maxOccurs == -2)
- {
- occurenceDescription = nodeName;
- groupFigure.setText(null);
- }
- else
- {
- if (maxOccurs == -2) maxOccurs = 1;
- String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs; //$NON-NLS-1$ //$NON-NLS-2$
-
- String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- occurenceDescription = nodeName + " [" + minSymbol + ".." + maxSymbol + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- groupFigure.setText(minSymbol + ".." + maxSymbol);
- }
-
- groupFigure.getIconFigure().setToolTipText(occurenceDescription);
- groupFigure.getIconFigure().repaint();
-
- }
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
-
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
- XSDModelGroupDefinition groupDef = ((XSDModelGroupDefinition) adapter.getTarget());
- XSDModelGroupDefinition resolvedGroupDef = groupDef.getResolvedModelGroupDefinition();
- XSDModelGroup xsdModelGroup = resolvedGroupDef.getModelGroup();
-
- ArrayList listOfVisibleGroupRefs = new ArrayList();
- for (EditPart ep = getParent(); ep != null; )
- {
- Object object = ep.getModel();
- if (object instanceof XSDModelGroupDefinitionAdapter)
- {
- Object model = ((XSDModelGroupDefinitionAdapter)object).getTarget();
- if (model instanceof XSDModelGroupDefinition)
- {
- listOfVisibleGroupRefs.add(((XSDModelGroupDefinition)model).getResolvedModelGroupDefinition());
- }
- }
- ep = ep.getParent();
- }
-
- boolean isCyclic = (listOfVisibleGroupRefs.contains(resolvedGroupDef));
-
- if (xsdModelGroup != null && !isCyclic)
- list.add(XSDAdapterFactory.getInstance().adapt(xsdModelGroup));
-
- if (isCyclic)
- list.add(new TargetConnectionSpaceFiller(null));
-
- return list;
- }
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- ReferenceConnection connectionFigure = new ReferenceConnection();
-
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
- if (child instanceof ModelGroupEditPart)
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
- else // for the cyclic group references
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((GenericGroupFigure) getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
- }
-
- connectionFigure.setHighlight(false);
-
- return connectionFigure;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java
deleted file mode 100644
index 9359394f89..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class ModelGroupEditPart extends ConnectableEditPart
-{
- protected IFigure createFigure()
- {
- return getExtendedFigureFactory().createModelGroupFigure(getModel());
- }
-
- public XSDParticle getXSDParticle()
- {
- Object o = getXSDModelGroup().getContainer();
- return (o instanceof XSDParticle) ? (XSDParticle) o : null;
- }
-
- public XSDModelGroup getXSDModelGroup()
- {
- if (getModel() instanceof XSDModelGroupAdapter)
- {
- XSDModelGroupAdapter adapter = (XSDModelGroupAdapter) getModel();
- return (XSDModelGroup) adapter.getTarget();
- }
-// else if (getModel() instanceof XSDModelGroup)
-// {
-// return (XSDModelGroup) getModel();
-// }
- return null;
-
- }
-
-
-
- protected void refreshVisuals()
- {
- boolean isReadOnly = false;
- GenericGroupFigure modelGroupFigure = (GenericGroupFigure)getFigure();
-
- XSDModelGroupAdapter adapter = (XSDModelGroupAdapter) getModel();
- isReadOnly = adapter.isReadOnly();
-
- String nodeName = "";
- Image image;
- switch (getXSDModelGroup().getCompositor().getValue())
- {
- case XSDCompositor.ALL:
- {
- image = isReadOnly ? ModelGroupFigure.ALL_ICON_DISABLED_IMAGE :ModelGroupFigure.ALL_ICON_IMAGE;
- modelGroupFigure.getIconFigure().image = XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent)adapter.getTarget(), image, isReadOnly);
- nodeName = XSDConstants.ALL_ELEMENT_TAG;
- break;
- }
- case XSDCompositor.CHOICE:
- {
- image = isReadOnly ? ModelGroupFigure.CHOICE_ICON_DISABLED_IMAGE : ModelGroupFigure.CHOICE_ICON_IMAGE;
- modelGroupFigure.getIconFigure().image = XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent)adapter.getTarget(), image, isReadOnly);
- nodeName = XSDConstants.CHOICE_ELEMENT_TAG;
- break;
- }
- case XSDCompositor.SEQUENCE:
- {
- image = isReadOnly ? ModelGroupFigure.SEQUENCE_ICON_DISABLED_IMAGE : ModelGroupFigure.SEQUENCE_ICON_IMAGE;
- modelGroupFigure.getIconFigure().image = XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent)adapter.getTarget(), image, isReadOnly);
- nodeName = XSDConstants.SEQUENCE_ELEMENT_TAG;
- break;
- }
- }
-
-// String occurenceDescription = adapter.getNameAnnotationToolTipString();
-// modelGroupFigure.getIconFigure().setToolTip(occurenceDescription);
-
- // TODO: commmon this up with XSDParticleAdapter's code
-
- // -2 means the user didn't specify (so the default is 1)
- int minOccurs = adapter.getMinOccurs();
- int maxOccurs = adapter.getMaxOccurs();
- String occurenceDescription = ""; //$NON-NLS-1$
-
- if (minOccurs == -3 && maxOccurs == -3)
- {
- occurenceDescription = nodeName;
- modelGroupFigure.setText(null);
- }
- else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
- {
- occurenceDescription = nodeName + " [0..1]"; //$NON-NLS-1$
- modelGroupFigure.setText("0..1");
- }
- else if ((minOccurs == 1 && maxOccurs == 1) ||
- (minOccurs == -2 && maxOccurs == 1) ||
- (minOccurs == 1 && maxOccurs == -2))
- {
- occurenceDescription = nodeName + " [1..1]"; //$NON-NLS-1$
- modelGroupFigure.setText("1..1");
- }
- else if (minOccurs == -2 && maxOccurs == -2)
- {
- occurenceDescription = nodeName;
- modelGroupFigure.setText(null);
- }
- else
- {
- if (maxOccurs == -2) maxOccurs = 1;
- String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs; //$NON-NLS-1$ //$NON-NLS-2$
-
- String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- occurenceDescription = nodeName + " [" + minSymbol + ".." + maxSymbol + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- modelGroupFigure.setText(minSymbol + ".." + maxSymbol);
- }
-
- modelGroupFigure.getIconFigure().setToolTipText(occurenceDescription);
- modelGroupFigure.getIconFigure().repaint();
-
- refreshConnection();
- }
-
- protected List getModelChildren()
- {
-// XSDModelGroupAdapter modelGroupAdapter = (XSDModelGroupAdapter)getModel();
-// ArrayList ch = new ArrayList();
-// ITreeElement [] tree = modelGroupAdapter.getChildren();
-// int length = tree.length;
-// for (int i = 0; i < length; i++)
-// {
-// ch.add(tree[i]);
-// }
-
- List list = new ArrayList();
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- for (Iterator i = xsdModelGroup.getContents().iterator(); i.hasNext();)
- {
- XSDParticle next = (XSDParticle) i.next();
- if (next.getContent() instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) next.getContent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(elementDeclaration);
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)adapter));
- }
- if (next.getContent() instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition def = (XSDModelGroupDefinition) next.getContent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(def);
- list.add(adapter);
- }
- else if (next.getTerm() instanceof XSDModelGroup)
- {
- XSDModelGroup modelGroup = (XSDModelGroup) next.getTerm();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(modelGroup);
- list.add(adapter);
- }
- else if (next.getTerm() instanceof XSDWildcard)
- {
- XSDWildcard wildCard = (XSDWildcard)next.getTerm();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(wildCard);
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)adapter));
- }
- }
-
- if (list.size() == 0)
- list.add(new TargetConnectionSpaceFiller(null));
-
- return list;
-// return ch;
- }
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- ReferenceConnection connectionFigure = new ReferenceConnection();
- GenericGroupFigure modelGroupFigure = (GenericGroupFigure)getFigure();
-
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(modelGroupFigure.getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
- if (child instanceof ModelGroupEditPart)
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
- else if (child instanceof TargetConnectionSpacingFigureEditPart)
- {
- TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 1));
- }
- else if (child instanceof ModelGroupDefinitionReferenceEditPart)
- {
- ModelGroupDefinitionReferenceEditPart elem = (ModelGroupDefinitionReferenceEditPart) child;
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 1));
- }
- connectionFigure.setHighlight(false);
- return connectionFigure;
- }
-
- public String getReaderText()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- return xsdModelGroup.getCompositor().getName();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
deleted file mode 100644
index fd63dbe166..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-
-public class ReferenceConnection extends PolylineConnection
-{
- protected boolean highlight = false;
-
- protected static final Color activeConnection = ColorConstants.black;
- public static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
- public ReferenceConnection()
- {
- super();
- setConnectionRouter(new XSDModelGroupRouter());
- }
-
- public void setConnectionRouter(ConnectionRouter cr)
- {
- if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof XSDModelGroupRouter))
- super.setConnectionRouter(cr);
- }
-
- public boolean isHighlighted()
- {
- return highlight;
- }
-
- public void setHighlight(boolean highlight)
- {
- this.highlight = highlight;
-
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (highContrast)
- {
- setForegroundColor(highlight ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND) : ColorConstants.lightGray);
- }
- else
- {
- setForegroundColor(highlight ? activeConnection : inactiveConnection);
- }
- setOpaque(highlight);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java
deleted file mode 100644
index 30f44ee1d0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class SpaceFillerForFieldEditPart extends BaseFieldEditPart
-{
- Label space;
- public SpaceFillerForFieldEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- space = new Label(""); //$NON-NLS-1$
- space.setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif")); //$NON-NLS-1$
- space.setBorder(new MarginBorder(3, 0, 3, 0));
- return space;
- }
-
- protected void refreshVisuals()
- {
- }
-
- protected void createEditPolicies()
- {
-
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
deleted file mode 100644
index dad1a8b8e8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-public class TargetConnectionSpacingFigureEditPart extends BaseEditPart
-{
- public TargetConnectionSpacingFigureEditPart()
- {
- super();
- }
-
- SpacingFigure figure;
-
- protected IFigure createFigure()
- {
- figure = new SpacingFigure();
- return figure;
- }
-
- public IFigure getConnectionFigure()
- {
- return figure;
- }
-
- protected void createEditPolicies()
- {
-
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java
deleted file mode 100644
index 44042f396e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.design.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IAutoDirectEdit;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.FieldFigure;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.GraphNodeDragTracker;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.TopLevelComponentLabelCellEditorLocator;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.TopLevelNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.design.figures.HyperLinkLabel;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.utils.OpenOnSelectionHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-public class TopLevelComponentEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart, IAutoDirectEdit
-{
- protected Label label;
- // protected Label arrowLabel;
- protected Figure labelHolder = new Figure();
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
- protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
- protected boolean isReadOnly;
- protected boolean isSelected;
- private Font italicFont;
-
- protected IFigure createFigure()
- {
- Figure typeGroup = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- if (hasFocus)
- {
- try
- {
- graphics.pushState();
- Rectangle r = getBounds();
- graphics.setXORMode(true);
- graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
- }
- finally
- {
- graphics.popState();
- }
- }
-
- }
- };
- typeGroup.setLayoutManager(new ToolbarLayout());
-
- labelHolder = new Figure();
- FillLayout fillLayout = new FillLayout();
- labelHolder.setLayoutManager(fillLayout);
- typeGroup.add(labelHolder);
-
- label = new HyperLinkLabel();
- label.setOpaque(true);
- label.setBorder(new MarginBorder(1, 2, 2, 5));
- if (!isHighContrast)
- label.setForegroundColor(ColorConstants.black);
- labelHolder.add(label);
-
- return typeGroup;
- }
-
- public void deactivate()
- {
- if (italicFont != null)
- {
- italicFont.dispose();
- italicFont = null;
- }
- super.deactivate();
- }
-
- public void refreshVisuals()
- {
- XSDBaseAdapter adapter = (XSDBaseAdapter) getModel();
- if (adapter != null)
- {
- isReadOnly = adapter.isReadOnly();
- label.setForegroundColor(computeLabelColor());
- label.setText(adapter.getText());
- Image image = adapter.getImage();
- if (image != null)
- {
- label.setIcon(XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent) adapter.getTarget(), image, isReadOnly));
- }
- // arrowLabel.setVisible(Boolean.TRUE.equals(adapter.getProperty(getModel(),
- // "drillDown")));
-
- if (adapter.isAbstract())
- {
- if (italicFont == null)
- {
- Font font = label.getFont();
- italicFont = getItalicFont(font);
- }
- if (italicFont != null)
- {
- label.setFont(italicFont);
- }
- }
- else
- {
- label.setFont(label.getParent().getFont());
- }
- }
- else
- {
- label.setText(Messages._UI_GRAPH_UNKNOWN_OBJECT + getModel().getClass().getName());
- // arrowLabel.setVisible(false);
- }
-
- if (reselect)
- {
- getViewer().select(this);
- setReselect(false);
- }
- }
-
- public List getModelChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- return ((BaseEditPart)this.getParent()).doGetRelativeEditPart(editPart, direction);
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
- // NonResizableEditPolicy());
- // selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
- // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- // selectionHandlesEditPolicy);
-
- SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
-
- SelectionEditPolicy feedBackSelectionEditPolicy = new SelectionEditPolicy()
- {
- protected void hideSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) editPart).removeFeedback();
- }
- }
-
- protected void showSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) editPart).addFeedback();
- }
- }
- };
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, feedBackSelectionEditPolicy);
-
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- }
-
- public Color computeLabelColor()
- {
- Color color = ColorConstants.black;
- if (isHighContrast)
- {
- color = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
- }
-
- if (isSelected)
- {
- if (isHighContrast)
- {
- color = ColorConstants.listBackground;
- }
- else
- {
- if (isReadOnly)
- {
- color = ColorConstants.gray;
- }
- else
- {
- color = ColorConstants.black;
- }
- }
- }
- else if (isReadOnly)
- {
- color = ColorConstants.gray;
- }
- return color;
- }
-
- public void addFeedback()
- {
- isSelected = true;
-
- if (isHighContrast)
- {
- labelHolder.setBackgroundColor(ColorConstants.listForeground);
- }
- else
- {
- labelHolder.setBackgroundColor(FieldFigure.cellColor);
- }
- label.setForegroundColor(computeLabelColor());
- // labelHolder.setFill(true);
-
- if (doScroll)
- {
- CategoryEditPart categoryEP = (CategoryEditPart) getParent();
- categoryEP.scrollTo(this);
- setScroll(false);
- }
- }
-
- private boolean doScroll = false;
-
- public void setScroll(boolean doScroll)
- {
- this.doScroll = doScroll;
- }
-
- public void removeFeedback()
- {
- isSelected = false;
- labelHolder.setBackgroundColor(null);
- label.setForegroundColor(computeLabelColor());
- // labelHolder.setFill(false);
- }
-
- public void performRequest(Request request)
- {
- // Do not open on or set focus on direct edit type
- if (request.getType() == RequestConstants.REQ_OPEN)
- {
-
- Object model = getModel();
- if (model instanceof IGraphElement)
- {
- if (((IGraphElement)model).isFocusAllowed())
- {
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest) request;
- Point p = locationRequest.getLocation();
-
- if (hitTest(labelHolder, p))
- {
- performDrillDownAction();
- }
- }
- }
- }
- else if (model instanceof XSDSchemaDirectiveAdapter)
- {
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest) request;
- Point p = locationRequest.getLocation();
-
- if (hitTest(labelHolder, p))
- {
- XSDSchemaDirective dir = (XSDSchemaDirective)((XSDSchemaDirectiveAdapter)model).getTarget();
- String schemaLocation = "";
- // force load of imported schema
- if (dir instanceof XSDImportImpl)
- {
- ((XSDImportImpl)dir).importSchema();
- }
- if (dir.getResolvedSchema() != null)
- {
- schemaLocation = URIHelper.removePlatformResourceProtocol(dir.getResolvedSchema().getSchemaLocation());
- if (schemaLocation != null)
- {
- OpenOnSelectionHelper.openXSDEditor(dir.getResolvedSchema());
- }
- }
- }
- }
- }
- }
- }
-
- public boolean hitTest(IFigure target, Point location)
- {
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- protected void performDrillDownAction()
- {
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- EditPart editPart = ((AbstractEditPartViewer) getViewer()).getRootEditPart().getContents();
- if (editPart instanceof RootContentEditPart)
- {
- IEditorPart editorPart = getEditorPart();
-// ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
-// IAction action = registry.getAction(SetInputToGraphView.ID);
-// action.run();
- ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
- if (registry != null)
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- if (action != null)
- action.run();
- return;
- }
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
-
- public void doEditName(boolean addFromDesign)
- {
- if (!addFromDesign) return;
-
-// removeFeedback();
-
- Object object = ((XSDBaseAdapter) getModel()).getTarget();
- if (object instanceof XSDNamedComponent)
- {
- Point p = label.getLocation();
- TopLevelNameDirectEditManager manager = new TopLevelNameDirectEditManager(TopLevelComponentEditPart.this, new TopLevelComponentLabelCellEditorLocator(TopLevelComponentEditPart.this, p), (XSDNamedComponent) object);
- NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
- adtDirectEditPolicy.setUpdateCommand(wrapper);
- manager.show();
- }
- }
-
- class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
- {
- Command command;
- protected DirectEditRequest request;
-
- public NameUpdateCommandWrapper()
- {
- super(Messages._UI_ACTION_UPDATE_NAME);
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- XSDBaseAdapter adapter = (XSDBaseAdapter)getModel();
- Object newValue = request.getCellEditor().getValue();
- if (newValue instanceof String && ((String)newValue).length() > 0)
- {
- UpdateNameCommand command = new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, (XSDNamedComponent)adapter.getTarget(), (String)newValue);
- if (command != null)
- command.execute();
- }
- }
- }
-
- static boolean reselect = false;
-
- public void setReselect(boolean state)
- {
- reselect = state;
- }
-
- public Label getNameLabelFigure()
- {
- return label;
- }
-
- public void performDirectEdit(Point cursorLocation)
- {
-
- }
-
- public void setSelected(int value)
- {
- // if it is selected, we want to scroll to it
- if (doScroll)
- setScroll(true);
- super.setSelected(value);
- }
-
- public void setFocus(boolean b)
- {
- super.setFocus(b);
- hasFocus = b;
- getFigure().repaint();
- }
-
- public DragTracker getDragTracker(Request request)
- {
- return new GraphNodeDragTracker(this);
- }
-
- public String getReaderText()
- {
- return getNameLabelFigure().getText();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
deleted file mode 100644
index 13b4dd5ce4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.SectionEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class XSDAttributesForAnnotationEditPart extends SectionEditPart
-{
- public XSDAttributesForAnnotationEditPart()
- {
- super();
- }
-
- protected List getModelChildren()
- {
- IStructure structure = ((Annotation)getModel()).getOwner();
- if (structure instanceof IComplexType)
- {
- complexType = (IComplexType)structure;
- if (complexType instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
- return adapter.getAttributeGroupContent();
- }
- }
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
deleted file mode 100644
index 6edac9c1c6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.AttributeReferenceDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ElementReferenceDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ReferenceDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.FieldFigure;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.DragAndDropEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class XSDBaseFieldEditPart extends BaseFieldEditPart
-{
-
- public XSDBaseFieldEditPart()
- {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
- */
- protected void refreshVisuals()
- {
- IFieldFigure figure = getFieldFigure();
- IField field = (IField) getModel();
-
- figure.getNameLabel().setText(field.getName());
- figure.getTypeLabel().setText(field.getTypeName());
- figure.refreshVisuals(getModel());
- if (field.isReadOnly())
- {
- figure.setForegroundColor(ColorConstants.darkGray);
- }
- else
- {
- if (isHighContrast)
- {
- figure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
- figure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- }
- else
- figure.setForegroundColor(ColorConstants.black);
- }
-
- String occurrenceDescription = ""; //$NON-NLS-1$
- if (field instanceof IAnnotationProvider)
- {
- occurrenceDescription = ((IAnnotationProvider)field).getNameAnnotationString();
- }
- refreshIcon();
- figure.getNameAnnotationLabel().setText(occurrenceDescription);
-
- figure.recomputeLayout();
-
-
- if (getRoot() != null)
- ((GraphicalEditPart)getRoot()).getFigure().invalidateTree();
- }
-
- protected void refreshIcon()
- {
- IFieldFigure figure = getFieldFigure();
- // our model implements ITreeElement
- if (getModel() instanceof XSDBaseAdapter)
- {
- Image image = ((XSDBaseAdapter)getModel()).getImage();
- boolean isReadOnly = ((XSDBaseAdapter)getModel()).isReadOnly();
- figure.getNameLabel().setIcon(image);
-
- if (image != null)
- {
- XSDConcreteComponent comp = (XSDConcreteComponent) ((XSDBaseAdapter)getModel()).getTarget();
- figure.getNameLabel().setIcon(XSDCommonUIUtils.getUpdatedImage(comp, image, isReadOnly));
- }
- }
- }
-
- public void addNotify()
- {
- super.addNotify();
- getFieldFigure().editPartAttached(this);
- }
-
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- if (!isFileReadOnly())
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
- }
-
- protected void directEditNameField()
- {
- Object model = getModel();
- IFieldFigure fieldFigure = getFieldFigure();
- if ( model instanceof IField)
- {
- IField field = (IField) model;
- if (field.isReference())
- {
- ReferenceDirectEditManager manager = null;
- if (field instanceof XSDElementDeclarationAdapter)
- {
- manager = new ElementReferenceDirectEditManager((IField) model, this, fieldFigure.getNameLabel());
- }
- else if (field instanceof XSDAttributeDeclarationAdapter)
- {
- manager = new AttributeReferenceDirectEditManager((IField) model, this, fieldFigure.getNameLabel());
- }
- if (manager != null)
- {
- ReferenceUpdateCommand elementUpdateCommand = new ReferenceUpdateCommand();
- elementUpdateCommand.setDelegate(manager);
- adtDirectEditPolicy.setUpdateCommand(elementUpdateCommand);
- manager.show();
- }
- }
- else
- {
- LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, null));
- NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
- adtDirectEditPolicy.setUpdateCommand(wrapper);
- manager.show();
- }
- }
- }
-
- public void setFocus(boolean focus)
- {
- super.setFocus(focus);
- hasFocus = focus;
- ((FieldFigure)getFigure()).hasFocus = hasFocus;
- getFigure().repaint();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java
deleted file mode 100644
index 211b7873c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ADTEditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ColumnEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class XSDEditPartFactory extends ADTEditPartFactory implements IExtendedFigureFactory
-{
- protected IExtendedFigureFactory delegate;
-
- public XSDEditPartFactory()
- {
- delegate = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getFigureFactory();
- if (delegate == null)
- delegate = new TypeVizFigureFactory();
- }
-
- public XSDEditPartFactory(IExtendedFigureFactory figureFactory)
- {
- delegate = figureFactory;
- }
-
-
- public EditPart doCreateEditPart(EditPart context, Object model)
- {
- EditPart child = null;
- // Override edit part where desired
-
- if (model instanceof IField)
- {
- if (model instanceof SpaceFiller)
- {
- child = new SpaceFillerForFieldEditPart();
- }
- else if (context instanceof CompartmentEditPart)
- {
- child = new XSDBaseFieldEditPart();
- }
- }
- else if (model instanceof XSDSchemaAdapter)
- {
- child = new XSDSchemaEditPart();
- }
- else if (model instanceof CategoryAdapter)
- {
- child = new CategoryEditPart();
- }
- else if (model instanceof XSDSimpleTypeDefinitionAdapter)
- {
- child = new XSDSimpleTypeEditPart();
- }
- else if (model instanceof XSDModelGroupAdapter)
- {
- child = new ModelGroupEditPart();
- }
- else if (model instanceof Annotation)
- {
- Annotation annotation = (Annotation) model;
- String kind = annotation.getCompartment().getKind();
- if (kind.equals("element")) //$NON-NLS-1$
- {
- child = new XSDGroupsForAnnotationEditPart();
- }
- else if (kind.equals("attribute")) //$NON-NLS-1$
- {
- child = new XSDAttributesForAnnotationEditPart();
- }
- }
- else if (!(context instanceof ColumnEditPart))
- {
- if (model instanceof TargetConnectionSpaceFiller)
- {
- child = new TargetConnectionSpacingFigureEditPart();
- }
- else if (model instanceof XSDModelGroupDefinitionAdapter)
- {
- child = new ModelGroupDefinitionReferenceEditPart();
- }
- else if (model instanceof XSDAttributeGroupDefinitionAdapter)
- {
- child = new AttributeGroupDefinitionEditPart();
- }
- }
- // if we don't have a specialzied XSD edit part to create
- // then we simply call the super class to create a generic ADT edit part
- //
- if (child == null)
- {
- child = super.doCreateEditPart(context, model);
- }
-
- // if at this this point we have not created an edit part we simply
- // create a placeholder edit part to provide the most robust behaviour possible
- //
- if (child == null)
- {
- // TODO (cs) log an error message here, since we shouldn't really get here
- child = new SpaceFillerForFieldEditPart();
- }
- return child;
- }
-
- public ICompartmentFigure createCompartmentFigure(Object model)
- {
- return delegate.createCompartmentFigure(model);
- }
-
- public IStructureFigure createStructureFigure(Object model)
- {
- IStructureFigure figure = delegate.createStructureFigure(model);
- if (model instanceof XSDBaseAdapter)
- {
- XSDConcreteComponent comp = (XSDConcreteComponent) ((XSDBaseAdapter)model).getTarget();
- boolean isReadOnly = ((XSDBaseAdapter)model).isReadOnly();
- figure.getNameLabel().setIcon(XSDCommonUIUtils.getUpdatedImage( comp, ((XSDBaseAdapter)model).getImage(), isReadOnly));
- }
- return figure;
- }
-
- public IFieldFigure createFieldFigure(Object model)
- {
- return delegate.createFieldFigure(model);
- }
-
- public IModelGroupFigure createModelGroupFigure(Object model)
- {
- return delegate.createModelGroupFigure(model);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
deleted file mode 100644
index c065b36e47..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.SectionEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDGroupsForAnnotationEditPart extends SectionEditPart
-{
- public XSDGroupsForAnnotationEditPart()
- {
- super();
- }
-
- protected List getModelChildren()
- {
- List xsdModelGroupList = new ArrayList();
- List adapterList = new ArrayList();
-
- IStructure structure = ((Annotation)getModel()).getOwner();
- if (structure instanceof IComplexType)
- {
- complexType = (IComplexType)structure;
- if (complexType instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
- xsdModelGroupList = adapter.getModelGroups();
- }
-
- for (Iterator i = xsdModelGroupList.iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof XSDModelGroup)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroup)obj));
- }
- else if (obj instanceof XSDModelGroupDefinition)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroupDefinition)obj));
- }
- }
- }
- else if (structure instanceof XSDModelGroupDefinitionAdapter)
- {
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter) structure;
- XSDModelGroup group = adapter.getXSDModelGroupDefinition().getModelGroup();
- if (group != null)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt(group));
- }
- }
-
- return adapterList;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java
deleted file mode 100644
index a1957822c7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java
+++ /dev/null
@@ -1,378 +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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractRouter;
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Ray;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-// TODO Manhattan connection router is final
-public class XSDModelGroupRouter extends AbstractRouter
-{
- public XSDModelGroupRouter()
- {
- super();
- }
- private Map rowsUsed = new HashMap();
- private Map colsUsed = new HashMap();
-
- private Map reservedInfo = new HashMap();
-
- private class ReservedInfo {
- public List reservedRows = new ArrayList(2);
- public List reservedCols = new ArrayList(2);
- }
-
- private static Ray UP = new Ray(0, -1),
- DOWN = new Ray(0, 1),
- LEFT = new Ray(-1, 0),
- RIGHT = new Ray(1, 0);
-
-
- /**
- * @see org.eclipse.draw2d.ConnectionRouter#invalidate(Connection)
- */
- public void invalidate(Connection connection) {
- removeReservedLines(connection);
- }
-
- private int getColumnNear(Connection connection, int r, int n, int x) {
- int min = Math.min(n, x),
- max = Math.max(n, x);
- if (min > r) {
- max = min;
- min = r - (min - r);
- }
- if (max < r) {
- min = max;
- max = r + (r - max);
- }
- int proximity = 0;
- int direction = -1;
- if (r % 2 == 1)
- r--;
- Integer i;
- while (proximity < r) {
- i = new Integer(r + proximity * direction);
- if (!colsUsed.containsKey(i)) {
- colsUsed.put(i, i);
- reserveColumn(connection, i);
- return i.intValue();
- }
- int j = i.intValue();
- if (j <= min)
- return j + 2;
- if (j >= max)
- return j - 2;
- if (direction == 1)
- direction = -1;
- else {
- direction = 1;
- proximity += 2;
- }
- }
- return r;
- }
-
- /**
- * Returns the direction the point <i>p</i> is in relation to the given rectangle.
- * Possible values are LEFT (-1,0), RIGHT (1,0), UP (0,-1) and DOWN (0,1).
- *
- * @param r the rectangle
- * @param p the point
- * @return the direction from <i>r</i> to <i>p</i>
- */
- protected Ray getDirection(Rectangle r, Point p) {
- int i, distance = Math.abs(r.x - p.x);
- Ray direction;
-
- direction = LEFT;
-
- i = Math.abs(r.y - p.y);
- if (i <= distance) {
- distance = i;
- direction = UP;
- }
-
- i = Math.abs(r.bottom() - p.y);
- if (i <= distance) {
- distance = i;
- direction = DOWN;
- }
-
- i = Math.abs(r.right() - p.x);
- if (i < distance) {
- distance = i;
- direction = RIGHT;
- }
-
- return direction;
- }
-
- protected Ray getEndDirection(Connection conn) {
- ConnectionAnchor anchor = conn.getTargetAnchor();
- Point p = getEndPoint(conn);
- Rectangle rect;
- if (anchor.getOwner() == null)
- rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
- else {
- rect = conn.getTargetAnchor().getOwner().getBounds().getCopy();
- conn.getTargetAnchor().getOwner().translateToAbsolute(rect);
- }
- return getDirection(rect, p);
- }
-
- protected int getRowNear(Connection connection, int r, int n, int x) {
- int min = Math.min(n, x),
- max = Math.max(n, x);
- if (min > r) {
- max = min;
- min = r - (min - r);
- }
- if (max < r) {
- min = max;
- max = r + (r - max);
- }
-
- int proximity = 0;
- int direction = -1;
- if (r % 2 == 1)
- r--;
- Integer i;
- while (proximity < r) {
- i = new Integer(r + proximity * direction);
- if (!rowsUsed.containsKey(i)) {
- rowsUsed.put(i, i);
- reserveRow(connection, i);
- return i.intValue();
- }
- int j = i.intValue();
- if (j <= min)
- return j + 2;
- if (j >= max)
- return j - 2;
- if (direction == 1)
- direction = -1;
- else {
- direction = 1;
- proximity += 2;
- }
- }
- return r;
- }
-
- protected Ray getStartDirection(Connection conn) {
- ConnectionAnchor anchor = conn.getSourceAnchor();
- Point p = getStartPoint(conn);
- Rectangle rect;
- if (anchor.getOwner() == null)
- rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
- else {
- rect = conn.getSourceAnchor().getOwner().getBounds().getCopy();
- conn.getSourceAnchor().getOwner().translateToAbsolute(rect);
- }
- return getDirection(rect, p);
- }
-
- protected void processPositions(Ray start, Ray end, List positions,
- boolean horizontal, Connection conn) {
- removeReservedLines(conn);
-
- int pos[] = new int[positions.size() + 2];
- if (horizontal)
- pos[0] = start.x;
- else
- pos[0] = start.y;
- int i;
- for (i = 0; i < positions.size(); i++) {
- pos[i + 1] = ((Integer)positions.get(i)).intValue();
- }
- if (horizontal == (positions.size() % 2 == 1))
- pos[++i] = end.x;
- else
- pos[++i] = end.y;
-
- PointList points = new PointList();
- points.addPoint(new Point(start.x, start.y));
- Point p;
- int current, prev, min, max;
- boolean adjust;
- for (i = 2; i < pos.length - 1; i++) {
- horizontal = !horizontal;
- prev = pos[i - 1];
- current = pos[i];
-
- adjust = (i != pos.length - 2);
- if (horizontal) {
- if (adjust) {
- min = pos[i - 2];
- max = pos[i + 2];
- pos[i] = current = getRowNear(conn, current, min, max);
- }
- p = new Point(prev, current);
- } else {
- if (adjust) {
- min = pos[i - 2];
- max = pos[i + 2];
- pos[i] = current = getColumnNear(conn, current, min, max);
- }
- p = new Point(current, prev);
- }
- points.addPoint(p);
- }
- points.addPoint(new Point(end.x, end.y));
- conn.setPoints(points);
- }
-
- /**
- * @see org.eclipse.draw2d.ConnectionRouter#remove(Connection)
- */
- public void remove(Connection connection) {
- removeReservedLines(connection);
- }
-
- protected void removeReservedLines(Connection connection) {
- ReservedInfo rInfo = (ReservedInfo) reservedInfo.get(connection);
- if (rInfo == null)
- return;
-
- for (int i = 0; i < rInfo.reservedRows.size(); i++) {
- rowsUsed.remove(rInfo.reservedRows.get(i));
- }
- for (int i = 0; i < rInfo.reservedCols.size(); i++) {
- colsUsed.remove(rInfo.reservedCols.get(i));
- }
- reservedInfo.remove(connection);
- }
-
- protected void reserveColumn(Connection connection, Integer column) {
- ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
- if (info == null) {
- info = new ReservedInfo();
- reservedInfo.put(connection, info);
- }
- info.reservedCols.add(column);
- }
-
- protected void reserveRow(Connection connection, Integer row) {
- ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
- if (info == null) {
- info = new ReservedInfo();
- reservedInfo.put(connection, info);
- }
- info.reservedRows.add(row);
- }
-
- /**
- * @see org.eclipse.draw2d.ConnectionRouter#route(Connection)
- */
- public void route(Connection conn) {
- if ((conn.getSourceAnchor() == null) || (conn.getTargetAnchor() == null))
- return;
- int i;
- Point startPoint = getStartPoint(conn);
- conn.translateToRelative(startPoint);
- Point endPoint = getEndPoint(conn);
- conn.translateToRelative(endPoint);
-
- Ray start = new Ray(startPoint);
- Ray end = new Ray(endPoint);
- Ray average = new Ray(startPoint.x + 4, startPoint.y); // start.getAveraged(end);
-
- Ray direction = new Ray(start, end);
- Ray startNormal = getStartDirection(conn);
- Ray endNormal = getEndDirection(conn);
-
- List positions = new ArrayList(5);
- boolean horizontal = startNormal.isHorizontal();
- if (horizontal)
- positions.add(new Integer(start.y));
- else
- positions.add(new Integer(start.x));
- horizontal = !horizontal;
-
- if (startNormal.dotProduct(endNormal) == 0) {
- if ((startNormal.dotProduct(direction) >= 0)
- && (endNormal.dotProduct(direction) <= 0)) {
- // 0
- } else {
- // 2
- if (startNormal.dotProduct(direction) < 0)
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- else {
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- }
- positions.add(new Integer(i));
- horizontal = !horizontal;
-
- if (endNormal.dotProduct(direction) > 0)
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- else {
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- }
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
- } else {
- if (startNormal.dotProduct(endNormal) > 0) {
- //1
- if (startNormal.dotProduct(direction) >= 0)
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- else
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- } else {
- //3 or 1
- if (startNormal.dotProduct(direction) < 0) {
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
-
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- positions.add(new Integer(i));
- horizontal = !horizontal;
-
- if (startNormal.dotProduct(direction) < 0) {
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
- }
- }
- if (horizontal)
- positions.add(new Integer(end.y));
- else
- positions.add(new Integer(end.x));
-
- processPositions(start, end, positions, startNormal.isHorizontal(), conn);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
deleted file mode 100644
index b2698be2c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDSchemaEditPart extends BaseEditPart
-{
- protected Label label;
-
- protected Figure outer, contentFigure;
- protected HeadingFigure headingFigure;
-
- public IFigure getContentPane()
- {
- return contentFigure;
- }
-
- protected IFigure createFigure()
- {
- outer = new Figure();
- outer.setBorder(new LineBorder(1));
-
- FillLayout fillLayout = new FillLayout(4);
- outer.setLayoutManager(fillLayout);
-
- headingFigure = new HeadingFigure();
- outer.add(headingFigure);
-
- RectangleFigure line = new RectangleFigure()
- {
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- Dimension d = super.getPreferredSize(wHint, hHint);
- d.height = 1;
- return d;
- }
- };
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outer.add(line);
-
- contentFigure = new Figure();
- contentFigure.setBorder(new MarginBorder(4));
- fillLayout = new FillLayout(4);
- contentFigure.setLayoutManager(fillLayout);
-
- outer.add(contentFigure);
- return outer;
- }
-
- protected List getModelChildren()
- {
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter) getModel();
- List list = new ArrayList();
-
-// Bug 103870: undo blanks out schema view
-// schemaAdapter.updateCategories();
-
- List templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.DIRECTIVES));
- Holder holder = new Holder(templist);
- list.add(holder);
-
- templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.ELEMENTS));
- templist.add(schemaAdapter.getCategory(CategoryAdapter.TYPES));
- holder = new Holder(templist);
- list.add(holder);
-
- templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.ATTRIBUTES));
- templist.add(schemaAdapter.getCategory(CategoryAdapter.GROUPS));
- holder = new Holder(templist);
- list.add(holder);
-
- return list;
- }
-
- protected EditPart createChild(Object model)
- {
- CategoryRowEditPart result = new CategoryRowEditPart();
- result.setModel(model);
- result.setParent(this);
- return result;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
-
- LineBorder border = (LineBorder) outer.getBorder();
- border.setWidth(isSelected ? 2 : 1);
- headingFigure.setSelected(isSelected);
-
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter) getModel();
- Image image = schemaAdapter.getImage();
- headingFigure.getLabel().setIcon(image);
- if (image != null)
- {
- headingFigure.getLabel().setIcon(XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent) schemaAdapter.getTarget(), image, false));
- }
- outer.repaint();
-
- String targetNamespaceValue = ((XSDSchema) ((XSDSchemaAdapter) getModel()).getTarget()).getTargetNamespace();
- targetNamespaceValue = TextProcessor.process(targetNamespaceValue);
-
- if (targetNamespaceValue == null || targetNamespaceValue.length() == 0)
- {
- targetNamespaceValue = Messages._UI_GRAPH_XSDSCHEMA_NO_NAMESPACE;
- }
- headingFigure.getLabel().setText(Messages._UI_GRAPH_XSDSCHEMA + " : " + targetNamespaceValue); //$NON-NLS-1$
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (editPart instanceof CategoryEditPart)
- {
- CategoryAdapter adapter = (CategoryAdapter)editPart.getModel();
- switch (adapter.getGroupType())
- {
- case CategoryAdapter.DIRECTIVES:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ELEMENTS);
- }
- break;
- }
- case CategoryAdapter.ELEMENTS:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ATTRIBUTES);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.DIRECTIVES);
- }
- break;
- }
- case CategoryAdapter.TYPES:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.GROUPS);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.DIRECTIVES);
- }
- break;
- }
- case CategoryAdapter.ATTRIBUTES:
- {
- if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ELEMENTS);
- }
- break;
- }
- case CategoryAdapter.GROUPS:
- {
- if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.TYPES);
- }
- break;
- }
- }
- }
- else if (editPart == this)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- result = ((CategoryRowEditPart)getChildren().get(0)).doGetRelativeEditPart(editPart, direction);
- }
- }
- return result;
- }
-
- protected EditPart getCategoryEditPart(int kind)
- {
- for (Iterator j = getChildren().iterator(); j.hasNext(); )
- {
- EditPart row = (EditPart)j.next();
- for (Iterator i = row.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- if (editPart instanceof CategoryEditPart)
- {
- CategoryEditPart categoryEditPart = (CategoryEditPart)editPart;
- CategoryAdapter adapter = (CategoryAdapter)categoryEditPart.getModel();
- if (adapter.getGroupType() == kind)
- {
- return editPart;
- }
- }
- }
- }
- return null;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionHandlesEditPolicyImpl());
- }
-
- public String getReaderText()
- {
- return headingFigure.getLabel().getSubStringText();
- }
-
-
- protected class Holder
- {
- List list;
-
- public Holder(List list)
- {
- this.list = list;
- }
-
- public List getList()
- {
- return list;
- }
- }
-
- protected class CategoryRowEditPart extends BaseEditPart
- {
- protected XSDSchema schema;
- protected Figure contentPane;
-
- protected IFigure createFigure()
- {
- Figure containerFigure = new Figure();
- containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
- // containerFigure.setBorder(new LineBorder(1));
- // containerFigure.setBackgroundColor(ColorConstants.green);
-
- FillLayout fillLayout = new FillLayout(4);
- fillLayout.setHorizontal(true);
- containerFigure.setLayoutManager(fillLayout);
-
- return containerFigure;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- if (editPart instanceof CategoryEditPart)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.OUT_TO_PARENT)
- {
- return getParent();
- }
- }
- else if (editPart instanceof XSDSchemaEditPart)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- return (EditPart)getChildren().get(0);
- }
- }
- return ((XSDSchemaEditPart)getParent()).doGetRelativeEditPart(editPart, direction);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getContentPane()
- */
- public IFigure getContentPane()
- {
- return super.getContentPane();
- }
-
- protected List getModelChildren()
- {
- Holder holder = (Holder) getModel();
- return holder.getList();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
deleted file mode 100644
index db5b8774a2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseTypeConnectingEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ColumnEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.TypeReferenceConnection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.StructureFigure;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDSimpleTypeEditPart extends BaseTypeConnectingEditPart
-{
- protected StructureFigure figure;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-
- public XSDSimpleTypeEditPart()
- {
- super();
- }
-
- public XSDSimpleTypeDefinition getXSDSimpleTypeDefinition()
- {
- return (XSDSimpleTypeDefinition)((XSDSimpleTypeDefinitionAdapter)getModel()).getTarget();
- }
-
- protected IFigure createFigure()
- {
- figure = new StructureFigure();
- figure.setBorder(new RoundedLineBorder(1, 10));
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- return figure;
- }
-
- protected void refreshVisuals()
- {
- XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter)getModel();
- String name = adapter.getDisplayName();
- HeadingFigure headingFigure = figure.getHeadingFigure();
- headingFigure.setIsReadOnly(adapter.isReadOnly());
- Label label = headingFigure.getLabel();
- label.setText(name);
- label.setIcon(XSDCommonUIUtils.getUpdatedImage(adapter.getXSDTypeDefinition(), adapter.getImage(), adapter.isReadOnly()));
- }
-
- public IStructureFigure getStructureFigure()
- {
- return (IStructureFigure)getFigure();
- }
-
- public IFigure getContentPane()
- {
- return getStructureFigure().getContentPane();
- }
-
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- }
-
- public void addFeedback()
- {
- getStructureFigure().addSelectionFeedback();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- getStructureFigure().removeSelectionFeedback();
- super.removeFeedback();
- }
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- TypeReferenceConnection connectionFigure = null;
- XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter)getModel();
- IType superType = adapter.getSuperType();
-
- if (superType != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getTargetEditPart(superType);
-
- if (referenceTypePart != null)
- {
- connectionFigure = new TypeReferenceConnection(true);
- // draw a line out from the top
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
-
- // TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
- // adding a label to the connection would help to
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0));
- connectionFigure.setConnectionRouter(new ManhattanConnectionRouter());
- ((CenteredConnectionAnchor)connectionFigure.getSourceAnchor()).setOther((CenteredConnectionAnchor)connectionFigure.getTargetAnchor());
- connectionFigure.setHighlight(false);
-
- }
- }
- return connectionFigure;
- }
-
- protected EditPart getTargetEditPart(IType type)
- {
- ColumnEditPart columnEditPart = null;
- for (EditPart editPart = this; editPart != null; editPart = editPart.getParent())
- {
- if (editPart instanceof ColumnEditPart)
- {
- columnEditPart = (ColumnEditPart)editPart;
- break;
- }
- }
- if (columnEditPart != null)
- {
- for (Iterator i = columnEditPart.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child.getModel() == type)
- {
- return child;
- }
- }
- }
- return null;
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_OPEN)
- {
- Object model = getModel();
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest)request;
- Point p = locationRequest.getLocation();
-
- if (getStructureFigure().hitTestHeader(p))
- {
- // TODO: !!! This should be moved to the adt-xsd package
- //
- if (model instanceof XSDSimpleTypeDefinitionAdapter)
- {
- XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter)model;
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)adapter.getTarget();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- Object schema = editorPart.getAdapter(XSDSchema.class);
- ActionRegistry registry = getEditorActionRegistry(editorPart);
- if (registry != null)
- {
- if (schema == st.getSchema())
- {
- IAction action = registry.getAction(SetInputToGraphView.ID);
- action.run();
- }
- else
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- action.run();
- }
- }
- }
- }
- }
- }
- }
-
- protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
-
- protected boolean shouldDrawConnection()
- {
- if (getModel() instanceof IType)
- {
- if (((IType)getModel()).getSuperType() != null)
- return true;
- }
- return false;
- }
-
- public String getReaderText()
- {
- HeadingFigure headingFigure = figure.getHeadingFigure();
- return headingFigure.getLabel().getText();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
deleted file mode 100644
index 30ab79a88f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts.model;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * Dummy class to add space to field list
- *
- */
-public class SpaceFiller implements IField
-{
- String kind;
- public SpaceFiller(String kind)
- {
- super();
- this.kind = kind;
- }
-
- public Image getImage()
- {
- if (kind.equals("attribute")) //$NON-NLS-1$
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
- }
- else
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- }
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public IComplexType getContainerType()
- {
- return null;
- }
-
- public String getName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IType getType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isReadOnly()
- {
- return true;
- }
-
- public IModel getModel()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isReference()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isAbstract()
- {
- // TODO Auto-generated method stub
- return false;
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java
deleted file mode 100644
index 73eae5aa24..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public class TargetConnectionSpaceFiller implements IADTObject
-{
- private XSDBaseAdapter adapter;
-
- public TargetConnectionSpaceFiller(XSDBaseAdapter adapter)
- {
- this.adapter = adapter;
- }
-
- public XSDBaseAdapter getAdapter()
- {
- return adapter;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
-
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
-
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java
deleted file mode 100644
index 142e3f6dad..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-
-import java.util.List;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAttributeAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.commands.XSDAttributeDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.commands.XSDElementDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-
-
-public class DragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
-{
- protected EditPartViewer viewer;
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
- public DragAndDropEditPolicy(EditPartViewer viewer, SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
- {
- this.viewer = viewer;
- this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
- }
-
- public boolean understandsRequest(Request req)
- {
- return true;
- }
-
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- BaseDragAndDropCommand command = null;
- if (request instanceof ChangeBoundsRequest)
- {
- ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest)request;
- Point location = changeBoundsRequest.getLocation();
-
- GraphicalEditPart target = (GraphicalEditPart)viewer.findObjectAt(location);
- location = getPointerLocation(changeBoundsRequest.getLocation());
- ((GraphicalEditPart)viewer.getRootEditPart()).getFigure().translateToRelative(location);
-
- List list = changeBoundsRequest.getEditParts();
- // allow drag and drop of only one selected object
- if (list.size() == 1)
- {
- Object itemToDrag = list.get(0);
- if (itemToDrag instanceof XSDBaseFieldEditPart)
- {
- XSDBaseFieldEditPart selected = (XSDBaseFieldEditPart) itemToDrag;
- if (selected.getModel() instanceof XSDElementDeclarationAdapter)
- {
- command = new XSDElementDragAndDropCommand(viewer, (ChangeBoundsRequest)request, target, selected, location);
- selectionHandlesEditPolicy.setDragAndDropCommand(command);
- }
- else if (selected.getModel() instanceof XSDBaseAttributeAdapter)
- {
- command = new XSDAttributeDragAndDropCommand(viewer, (ChangeBoundsRequest)request, target, selected, location);
- selectionHandlesEditPolicy.setDragAndDropCommand(command);
- }
- }
- }
- }
- return command;
- }
-
- protected Point getPointerLocation(Point origPointerLocation)
- {
- Point compensatedLocation = origPointerLocation;
- FigureCanvas figureCanvas = (FigureCanvas) viewer.getControl();
- int yOffset = figureCanvas.getViewport().getVerticalRangeModel().getValue();
- int xOffset = figureCanvas.getViewport().getHorizontalRangeModel().getValue();
- compensatedLocation.y = compensatedLocation.y + yOffset;
- compensatedLocation.x = compensatedLocation.x + xOffset;
- return compensatedLocation;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
deleted file mode 100644
index 26b229bd94..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-
-
-public class GraphNodeDragTracker extends DragEditPartsTracker
-{
- protected EditPart editPart;
-
- public GraphNodeDragTracker(EditPart editPart)
- {
- super(editPart);
- this.editPart = editPart;
- }
-
- protected Command getCommand()
- {
- Request request = getTargetRequest();
- return editPart.getCommand(request);
- }
-
- protected void performSelection()
- {
- performAdditionalSelection();
- super.performSelection();
- }
-
- protected void performAdditionalSelection()
- {
- EditPartViewer viewer = getCurrentViewer();
- // This code selects the fields in-between the last selected field and the newly
- // selected field, if the shift key is held down. Note that the selection logic
- // can be improved so that already selected but, a) incompatible edit part figures, or b)
- // like-edit part figures from other parents, should be unselected.
- if (getCurrentInput().isShiftKeyDown())
- {
- // This list contains the fields
- List list = editPart.getParent().getChildren();
- // Get the index of the current selection
- int currentIndex = list.indexOf(editPart);
- // List of all the currently selected edit parts
- List currentSelected = viewer.getSelectedEditParts();
- int size = currentSelected.size();
- if (size > 0)
- {
- Object lastSelected = currentSelected.get(size - 1);
- if (lastSelected instanceof BaseEditPart)
- {
- // Here, we determine the upper and lower limit of the indices
- int lowerIndex = -1, upperIndex = -1;
- int lastSelectedIndex = list.indexOf(lastSelected);
- if (lastSelectedIndex >= 0 && lastSelectedIndex < currentIndex)
- {
- lowerIndex = lastSelectedIndex;
- upperIndex = currentIndex;
- }
- else if (lastSelectedIndex >= 0 && lastSelectedIndex > currentIndex)
- {
- lowerIndex = currentIndex;
- upperIndex = lastSelectedIndex;
- }
- if (lowerIndex >= 0 && upperIndex >= 0)
- {
- for (int i = lowerIndex; i < upperIndex; i++)
- {
- viewer.appendSelection((EditPart) list.get(i));
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
deleted file mode 100644
index d7f0b3951a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand;
-
-public class SelectionHandlesEditPolicyImpl extends ADTSelectionFeedbackEditPolicy
-{
- protected IFigure feedback;
- protected Rectangle originalLocation;
- protected BaseDragAndDropCommand dragAndDropCommand;
- protected Polyline polyLine;
- protected RectangleFigure ghostShape;
-
- public boolean understandsRequest(Request request)
- {
- boolean result = false;
-
- if (REQ_MOVE.equals(request.getType()))
- {
- result = false;
- }
- else
- {
- result = super.understandsRequest(request);
- }
- return result;
- }
-
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- return null;
- }
-
- public void setDragAndDropCommand(BaseDragAndDropCommand dragAndDropCommand)
- {
- this.dragAndDropCommand = dragAndDropCommand;
- }
-
- public void showSourceFeedback(Request request)
- {
- eraseChangeBoundsFeedback(null);
- if (dragAndDropCommand != null && dragAndDropCommand.canExecute()) {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType())) {
- if (dragAndDropCommand != null && dragAndDropCommand.getFeedbackFigure() != null) {
- feedback = dragAndDropCommand.getFeedbackFigure();
- addFeedback(feedback);
- }
- }
- }
- }
-
- public void deactivate()
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- feedback = null;
- }
- hideFocus();
- super.deactivate();
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- }
- feedback = null;
- originalLocation = null;
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- public void eraseSourceFeedback(Request request)
- {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType()))
- {
- eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java
deleted file mode 100644
index a594a502f9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java
+++ /dev/null
@@ -1,49 +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.xsd.ui.internal.design.editpolicies;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-
-public class TopLevelComponentLabelCellEditorLocator extends LabelCellEditorLocator
-{
- public TopLevelComponentLabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation)
- {
- super(namedEditPart, cursorLocation);
- }
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text) celleditor.getControl();
-
- Label label = namedEditPart.getNameLabelFigure();
-
- if (text.getBounds().x <= 0)
- {
- super.relocate(celleditor);
- }
- else
- {
- org.eclipse.swt.graphics.Point sel = text.getSelection();
- org.eclipse.swt.graphics.Point pref = text.computeSize(-1, -1);
- Rectangle rect = label.getTextBounds().getCopy();
- label.translateToAbsolute(rect);
- text.setBounds(rect.x, rect.y-1, rect.width, pref.y+1);
- text.setSelection(0);
- text.setSelection(sel);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java
deleted file mode 100644
index fd92420bc0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.design.editpolicies;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class TopLevelNameDirectEditManager extends DirectEditManager
-{
- protected XSDNamedComponent component;
- private IActionBars actionBars;
- private CellEditorActionHandler actionHandler;
- private IAction copy, cut, paste, undo, redo, find, selectAll, delete;
- private Font scaledFont;
-
- public TopLevelNameDirectEditManager(GraphicalEditPart source, CellEditorLocator locator, XSDNamedComponent component)
- {
- super(source, null, locator);
- this.component = component;
- }
-
- /**
- * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
- */
- protected void bringDown()
- {
- if (actionHandler != null)
- {
- actionHandler.dispose();
- actionHandler = null;
- }
- if (actionBars != null)
- {
- restoreSavedActions(actionBars);
- actionBars.updateActionBars();
- actionBars = null;
- }
-
- Font disposeFont = scaledFont;
- scaledFont = null;
- super.bringDown();
- if (disposeFont != null)
- disposeFont.dispose();
-
- if (getEditPart() instanceof TopLevelComponentEditPart)
- {
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object adapter = editor.getAdapter(ISelectionProvider.class);
- if (adapter instanceof ISelectionProvider)
- {
- ISelectionProvider sel = (ISelectionProvider) adapter;
- sel.setSelection(new StructuredSelection(getEditPart().getModel()));
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
- }
-
- public void showFeedback()
- {
- super.showFeedback();
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- return new TextCellEditor(composite, SWT.SINGLE | SWT.WRAP);
- }
-
- protected void initCellEditor()
- {
- Text text = (Text) getCellEditor().getControl();
- Label label = ((INamedEditPart) getEditPart()).getNameLabelFigure();
-
- if (label != null)
- {
- scaledFont = label.getFont();
-
- Color color = label.getBackgroundColor();
- text.setBackground(color);
-
- String initialLabelText = component.getName();
- getCellEditor().setValue(initialLabelText);
- }
- else
- {
- scaledFont = label.getParent().getFont();
- text.setBackground(label.getParent().getBackgroundColor());
- }
-
- FontData data = scaledFont.getFontData()[0];
- Dimension fontSize = new Dimension(0, data.getHeight());
- label.getParent().translateToAbsolute(fontSize);
- data.setHeight(fontSize.height);
- scaledFont = new Font(null, data);
-
- text.setFont(scaledFont);
- // text.selectAll();
-
- // Hook the cell editor's copy/paste actions to the actionBars so that they
- // can
- // be invoked via keyboard shortcuts.
- actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars();
- saveCurrentActions(actionBars);
- actionHandler = new CellEditorActionHandler(actionBars);
- actionHandler.addCellEditor(getCellEditor());
- actionBars.updateActionBars();
- }
-
- private void restoreSavedActions(IActionBars actionBars)
- {
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
- // Delete action (key) doesn't always work. The saved action could be the
- // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
- // We'll only restore the delete action if it is indeed the one for the Design view.
- // We should update the other actions too, but currently, none are applicable.
- if (delete instanceof BaseSelectionAction)
- {
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
- }
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
- actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
- }
-
- private void saveCurrentActions(IActionBars actionBars)
- {
- copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
- paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
- IAction currentDeleteAction = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
- // Delete action (key) doesn't always work. The saved action could be the
- // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
- // We'll only restore the delete action if it is indeed the one for the Design view.
- // We should update the other actions too, but currently, none are applicable.
- if (currentDeleteAction instanceof BaseSelectionAction)
- {
- delete = currentDeleteAction;
- }
- selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
- cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
- find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
- undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
- redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java
deleted file mode 100644
index ad125399d4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java
+++ /dev/null
@@ -1,97 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-
-public class CategoryFigure extends Figure
-{
- protected ScrollPane scrollpane;
- protected Figure outerPane;
- public HeadingFigure headingFigure;
- Figure contentPane;
-
- public CategoryFigure(int type)
- {
- super();
-
- outerPane = new Figure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
-
- ToolbarLayout layout = new ToolbarLayout(false);
- layout.setVertical(true);
- layout.setStretchMinorAxis(true);
- FillLayout fillLayout = new FillLayout(3);
- fillLayout.setHorizontal(false);
-
- FillLayout outerLayout = new FillLayout();
- outerPane.setLayoutManager(outerLayout);
-
- add(outerPane);
-
- headingFigure = new HeadingFigure();
- outerPane.add(headingFigure);
-
- Figure line = new Figure();
- line.setBorder(new LineBorder(1));
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outerPane.add(line);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC);
- outerPane.add(scrollpane);
-
- Figure pane = new Figure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setSpacing(3);
- pane.setLayoutManager(toolbarLayout); // good
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout();
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- public ScrollPane getScrollPane()
- {
- return scrollpane;
- }
-
- public IFigure getContentPane()
- {
- return scrollpane.getContents();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
deleted file mode 100644
index 21772890b2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RoundedRectangle;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ReferenceConnection;
-
-public class CenteredIconFigure extends RoundedRectangle
-{
- public static final int NORMAL = 0;
- public static final int SELECTED = 1;
- public static final int HOVER = 2;
- public Image image;
- protected Label toolTipLabel;
- protected int mode = 0;
-
- public CenteredIconFigure()
- {
- super();
- setFill(true);
- toolTipLabel = new Label();
- setCornerDimensions(new Dimension(5,5));
- }
-
- public CenteredIconFigure(Image img)
- {
- this();
- this.image = img;
- }
-
- public void refresh()
- {
- repaint();
- }
-
- protected void outlineShape(Graphics graphics)
- {
- graphics.pushState();
- try
- {
- if (mode == NORMAL)
- { // TODO: common up and organize colors....
- graphics.setForegroundColor(ReferenceConnection.inactiveConnection);
- }
- else if (mode == SELECTED)
- {
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (highContrast)
- {
- graphics.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
- }
- else
- {
- graphics.setForegroundColor(ColorConstants.black);
- }
- }
- super.outlineShape(graphics);
- }
- finally
- {
- graphics.popState();
- }
- }
-
- protected void fillShape(Graphics g)
- {
- super.fillShape(g);
- if (image != null)
- {
- Rectangle r = getBounds();
- Dimension imageSize = new Dimension(15, 15);
- g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2 - 1);
- }
- }
-
- public Label getToolTipLabel()
- {
- return toolTipLabel;
- }
-
- public void setMode(int mode)
- {
- this.mode = mode;
- }
-
- public void setToolTipText(String text)
- {
- if (text.length() > 0)
- {
- setToolTip(toolTipLabel);
- toolTipLabel.setText(text);
- }
- else
- {
- setToolTip(null);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java
deleted file mode 100644
index c0117ce8cb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java
+++ /dev/null
@@ -1,93 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.ModelGroupLayout;
-
-public class GenericGroupFigure extends Figure
-{
- protected CenteredIconFigure centeredIconFigure;
- protected Figure contentFigure;
- protected String text;
- protected boolean hasText = false;
- protected Label textFigure;
-
- public GenericGroupFigure()
- {
- super();
- setLayoutManager(new ModelGroupLayout(true));
-
- centeredIconFigure = new CenteredIconFigure();
- centeredIconFigure.setPreferredSize(new Dimension(15, 15));
-
- add(centeredIconFigure);
- contentFigure = new Figure();
- contentFigure.setLayoutManager(new ModelGroupLayout(false, 0));
- add(contentFigure);
- }
-
- public void setText(String text)
- {
- this.text = text;
- hasText = false;
- if (text != null && text.length() > 0)
- {
- hasText = true;
- }
- }
-
- public boolean hasText()
- {
- return hasText;
- }
-
- public String getText()
- {
- return text;
- }
-
- public Point getTextCoordinates()
- {
- Rectangle rect = centeredIconFigure.getBounds();
- return new Point(rect.x, rect.y + 14);
- }
-
- public void setIconFigure(Image image)
- {
- centeredIconFigure.image = image;
- }
-
- public CenteredIconFigure getTargetFigure()
- {
- return centeredIconFigure;
- }
-
- public CenteredIconFigure getIconFigure()
- {
- return centeredIconFigure;
- }
-
- public Figure getContentFigure()
- {
- return contentFigure;
- }
-
- public void setToolTipText(String text)
- {
- centeredIconFigure.setToolTipText(text);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java
deleted file mode 100644
index b4ef29f118..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java
+++ /dev/null
@@ -1,47 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-
-public class HyperLinkLabel extends Label
-{
- protected void paintFigure(Graphics graphics)
- {
- super.paintFigure(graphics);
- graphics.setFont(getFont());
-
- // TODO (cs) this lookup to find " :" is a hack
- // that's specialized for element and type label text
- // we need to make the TopLevelComponent use two labels in this case
- //
- String string = getText();
- int index = string.indexOf(" :");
- if (index != -1)
- {
- string = string.substring(0, index);
- }
- // end hack
-
- Point p = getTextLocation();
- Dimension textSize = FigureUtilities.getTextExtents(string, getFont());
- int textWidth = textSize.width;
- int textHeight = textSize.height;
- int descent = graphics.getFontMetrics().getDescent();
- int lineY = bounds.y + p.y + textHeight - descent + 1;
- int lineX = bounds.x + p.x;
- graphics.drawLine(lineX, lineY, lineX + textWidth, lineY);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java
deleted file mode 100644
index e107b577a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory;
-
-public interface IExtendedFigureFactory extends IFigureFactory
-{
- IModelGroupFigure createModelGroupFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java
deleted file mode 100644
index 10ff423a21..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IADTFigure;
-
-public interface IModelGroupFigure extends IADTFigure
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java
deleted file mode 100644
index 7009930d7c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java
+++ /dev/null
@@ -1,58 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class ModelGroupFigure extends GenericGroupFigure implements IModelGroupFigure
-{
- public static final Image SEQUENCE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequence_obj.gif"); //$NON-NLS-1$
- public static final Image SEQUENCE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequencedis_obj.gif"); //$NON-NLS-1$
- public static final Image CHOICE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choice_obj.gif"); //$NON-NLS-1$
- public static final Image CHOICE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choicedis_obj.gif"); //$NON-NLS-1$
- public static final Image ALL_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/all_obj.gif"); //$NON-NLS-1$
- public static final Image ALL_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/alldis_obj.gif"); //$NON-NLS-1$
-
- public ModelGroupFigure()
- {
- super();
- }
-
- public void setIconFigure(Image image)
- {
- centeredIconFigure.image = image;
- }
-
- public void addSelectionFeedback()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void editPartAttached(EditPart owner)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void refreshVisuals(Object model)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void removeSelectionFeedback()
- {
- // TODO Auto-generated method stub
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java
deleted file mode 100644
index fa6a55a68f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java
+++ /dev/null
@@ -1,25 +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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class SpacingFigure extends Label
-{
- public SpacingFigure()
- {
- super(""); //$NON-NLS-1$
- setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif")); //$NON-NLS-1$
- setBorder(new MarginBorder(3, 0, 3, 0));
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java
deleted file mode 100644
index 6209800b93..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java
+++ /dev/null
@@ -1,219 +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.xsd.ui.internal.design.layouts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-
-public class ContainerLayout extends AbstractLayout
-{
- protected boolean isHorizontal;
- protected int spacing = 0;
- protected int border = 0;
-
- public ContainerLayout()
- {
- this(true, 0);
- }
-
- public ContainerLayout(boolean isHorizontal, int spacing)
- {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setBorder(int border)
- {
- this.border = border;
- }
-
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return -1;
- }
-
- /**
- * Calculates and returns the preferred size of the container
- * given as input.
- *
- * @param figure Figure whose preferred size is required.
- * @return The preferred size of the passed Figure.
- * @since 2.0
- */
- protected Dimension calculatePreferredSizeHelper(IFigure parent)
- {
- Dimension preferred = new Dimension();
- List children = parent.getChildren();
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- }
- else
- {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1)
- {
- if (isHorizontal)
- {
- preferred.width += spacing * (childrenSize - 1);
- }
- else
- {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += parent.getInsets().getWidth();
- preferred.height += parent.getInsets().getHeight();
-
- return preferred;
- }
-
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension preferred = null;
-
- // Here we ensure that an unexpanded container is given a size of (0,0)
- //
-// if (parent instanceof IExpandable)
-// {
-// IExpandable expandableFigure = (IExpandable)parent;
-// if (!expandableFigure.isExpanded())
-// {
-// preferred = new Dimension();
-// }
-// }
-
- if (preferred == null)
- {
- preferred = calculatePreferredSizeHelper(parent);
- }
-
- return preferred;
- }
-
-
- protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
- {
- }
-
- public void layout(IFigure parent)
- {
- List children = parent.getChildren();
-
- int rx = 0;
- Dimension dimension = new Dimension();
-
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal)
- {
- dimension.height = Math.max(dimension.height, childSize.height);
- rx += childSize.width;
- }
- else
- {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- //dimension.width += parent.getInsets().left;
- //dimension.height += parent.getInsets().top;
-
- if (isHorizontal)
- {
- dimension.height += border*2;
- dimension.width += border;
- }
- else
- {
- dimension.width += border*2;
- dimension.height += border;
- }
- adjustLayoutLocation(parent, dimension);
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int y = -1;
-
- y = alignFigure(parent, child);
-
- if (y == -1)
- {
- y = (dimension.height - childSize.height) / 2;
- }
-
- Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.width += childSize.width;
- dimension.width += spacing;
-
- if (child instanceof SpacingFigure)
- {
- int availableHorizontalSpace = parent.getClientArea().width - rx;
- dimension.width += availableHorizontalSpace;
- }
- }
- else
- {
- Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.height += childSize.height;
- dimension.height += spacing;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java
deleted file mode 100644
index 14fe8e5b3d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java
+++ /dev/null
@@ -1,158 +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.xsd.ui.internal.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class FillLayout extends AbstractLayout
-{
- protected boolean isHorizontal = false;
- protected int spacing = 0;
- public Dimension min;
-
- public FillLayout()
- {
- }
-
- public FillLayout(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- /**
- * Calculates and returns the preferred size of the input container. This is
- * the size of the largest child of the container, as all other children fit
- * into this size.
- *
- * @param figure
- * Container figure for which preferred size is required.
- * @return The preferred size of the input figure.
- */
-
- protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
- {
- Dimension d = calculatePreferredClientAreaSize(figure);
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-
- protected Dimension calculatePreferredClientAreaSize(IFigure figure)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- d.width += childSize.width;
- d.height = Math.max(childSize.height, d.height);
- }
- else
- {
- d.height += childSize.height;
- d.width = Math.max(childSize.width, d.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 0)
- {
- if (isHorizontal)
- {
- d.width += spacing * (childrenSize - 1);
- }
- else
- {
- d.height += spacing * (childrenSize - 1);
- }
- }
-
- if (min != null)
- {
- d.width = Math.max(d.width, min.width);
- d.height = Math.max(d.height, min.height);
- }
- return d;
- }
-
- /*
- * Returns the minimum size required by the input container. This is the size
- * of the largest child of the container, as all other children fit into this
- * size.
- */
- public Dimension getMinimumSize(IFigure figure, int width, int height)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
-
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- d.union(child.getMinimumSize());
- }
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- return d;
- }
-
- public Dimension getPreferredSize(IFigure figure, int width, int height)
- {
- return calculatePreferredSize(figure, width, height);
- }
-
- /*
- * Lays out the children on top of each other with their sizes equal to that
- * of the available paintable area of the input container figure.
- */
- public void layout(IFigure figure)
- {
- Dimension preferredSize = calculatePreferredClientAreaSize(figure);
- Rectangle r = figure.getClientArea().getCopy();
- List children = figure.getChildren();
-
- int nChildren = children.size();
- int extraHorizontalSpace = r.width - preferredSize.width;
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension preferredChildSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int w = preferredChildSize.width + (extraHorizontalSpace / nChildren);
- child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height)));
- r.x += w + spacing;
- }
- else
- {
- child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height));
- r.y += preferredChildSize.height + spacing;
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java
deleted file mode 100644
index db5a0ca42a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-public class ModelGroupLayout extends AbstractLayout
-{
- protected boolean isHorizontal;
- protected int spacing = 10;
- protected int border = 0;
-
- public ModelGroupLayout()
- {
- this(0);
- }
-
- public ModelGroupLayout(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public ModelGroupLayout(boolean isHorizontal, int spacing)
- {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public ModelGroupLayout(int spacing)
- {
- super();
- this.spacing = spacing;
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- Dimension preferred = new Dimension();
- List children = container.getChildren();
-
- for (int i = 0; i < children.size(); i++)
- {
- IFigure child = (IFigure) children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- }
- else
- {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1)
- {
- if (isHorizontal)
- {
- preferred.width += spacing * (childrenSize - 1);
- }
- else
- {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += container.getInsets().getWidth();
- preferred.height += container.getInsets().getHeight();
-
- return preferred;
- }
-
- public void layout(IFigure container)
- {
- List children = container.getChildren();
-
- Dimension dimension = new Dimension();
-
- for (int i = 0; i < children.size(); i++)
- {
- IFigure child = (IFigure) children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal)
- {
- dimension.height = Math.max(dimension.height, childSize.height);
- }
- else
- {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- if (isHorizontal)
- {
- dimension.height += border * 2;
- dimension.width += border;
- }
- else
- {
- dimension.width += border * 2;
- dimension.height += border;
- }
-
- Rectangle r = container.getClientArea();
- dimension = new Dimension(r.width, r.height);
- Point p = new Point(0, 0);
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- Rectangle rectangle = new Rectangle(p.x, 0, childSize.width, childSize.height);
-
- // last child
- if (!i.hasNext())
- {
- rectangle.width = dimension.width - rectangle.x;
- }
-
- if (p.x == 0)
- {
- rectangle.y = r.height / 2 - childSize.height / 2;
- }
- else
- {
- rectangle.y = r.height / 2 - childSize.height / 2;
- }
-
- rectangle.translate(container.getClientArea().getLocation());
- child.setBounds(rectangle);
- p.x += childSize.width;
- p.x += spacing;
-
- }
- else
- {
- Rectangle rectangle = new Rectangle(0, p.y, childSize.width, childSize.height);
-
- if (child instanceof SpacingFigure)
- {
- rectangle.x = dimension.width + 6;
- }
- else if (child instanceof ModelGroupFigure)
- {
- rectangle.width = dimension.width - rectangle.x;
- }
- else
- {
- rectangle.width = dimension.width - rectangle.x;
- }
-
- rectangle.translate(container.getClientArea().getLocation());
- child.setBounds(rectangle);
- p.y += childSize.height;
- p.y += spacing;
- }
- }
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- }
-
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java
deleted file mode 100644
index f0cecbb770..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java
+++ /dev/null
@@ -1,221 +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
- * Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-/**
- * This class provides the content for SelectBuiltInTypesForFilterDialog
- * readability Warning: Some simple tricks to tweak efficiency are used
- */
-public class BuiltInTypesTreeViewerProvider {
-
- ILabelProvider labelProvider;
-
- ITreeContentProvider contentProvider;
-
-// private static final String CONST_PARENT = "parent";
-
- /**
- * Currently there are 3 subgroups: Numbers, Data and Time, Other
- * Folks can choose to expand to more subgroups
- */
- private static int BUILT_IN_TYPES_SUB_GROUP = 3;
-
- static String[] numberTypes =
- { "base64Binary", "byte", "decimal", "double", "float", "hexBinary",
- "int", "integer", "long", "negativeInteger", "nonNegativeInteger",
- "nonPositiveInteger", "positiveInteger", "short", "unsignedByte",
- "unsignedInt", "unsignedLong", "unsignedShort"};
-
- static String[] dateAndTimeTypes =
- { "date", "dateTime", "duration", "gDay",
- "gMonth", "gMonthDay", "gYear", "gYearMonth", "time"};
-
-
- public static List getAllBuiltInTypes() {
- List items = new ArrayList();
- //for (int i = 0; i < XSDDOMHelper.dataType.length; i++) {
- // items.add(XSDDOMHelper.dataType[i][0]);
- //}
- Iterator it = items.iterator();
-
- List mainContainer = new ArrayList(BUILT_IN_TYPES_SUB_GROUP);
- ComponentSpecification header = new ComponentSpecification("", "Root", null);
- mainContainer.add(header);
-
- List numbersGroup = new ArrayList();
- header = new ComponentSpecification("", "Numbers", null);
- numbersGroup.add(header);
- mainContainer.add(numbersGroup);
-
- List dateAndTimeGroup = new ArrayList();
- header = new ComponentSpecification("", "Date and Time", null);
- dateAndTimeGroup.add(header);
- mainContainer.add(dateAndTimeGroup);
-
- List otherGroup = new ArrayList();
- header = new ComponentSpecification("", "Other", null);
- otherGroup.add(header);
- mainContainer.add(otherGroup);
-
- while (it.hasNext()) {
- Object item = it.next();
- String name = item.toString();
-
- ComponentSpecification builtInTypeItem = new ComponentSpecification(name, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, null);
-
- // if this built-In Type is in Number group
- if ( partOf(name, numberTypes) ){
- // Set parent
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, numbersGroup);
-
- numbersGroup.add(builtInTypeItem);
- }
- // if this built-In Type is in Date-and-Time group
- else if ( partOf(name, dateAndTimeTypes)){
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, dateAndTimeGroup);
- dateAndTimeGroup.add(builtInTypeItem);
- }
- // otherwise, put in Other group
- else {
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, otherGroup);
- otherGroup.add(builtInTypeItem);
- }
- }
-
- return mainContainer;
- }
-
- public ILabelProvider getLabelProvider(){
- if (labelProvider != null)
- return labelProvider;
-
- labelProvider = new BuiltInTypeLabelProvider();
- return labelProvider;
- }
-
- public ITreeContentProvider getContentProvider() {
- if (contentProvider != null)
- return contentProvider;
-
- contentProvider = new BuiltInTypesTreeContentProvider();
- return contentProvider;
- }
-
- /**
- * Determines whether an equivalent of 'item' appears in 'array'
- * @param item
- * @param array
- * @return
- */
- private static boolean partOf(String item, String[] array){
- for(int i = 0; i < array.length; i++ ){
- if ( item.equals(array[i]) ){
- return true;
- }
- }
- return false;
- }
-
- class BuiltInTypeLabelProvider implements ILabelProvider{
- public Image getImage(Object element) {
- if ( getText(element).equals("Numbers") )
- return XSDEditorPlugin.getXSDImage("icons/XSDNumberTypes.gif");
- if ( getText(element).equals("Date and Time") )
- return XSDEditorPlugin.getXSDImage("icons/XSDDateAndTimeTypes.gif");
- if ( getText(element).equals("Other") )
- return XSDEditorPlugin.getXSDImage("icons/browsebutton.gif");
- if ( element instanceof ComponentSpecification ){
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
- }
- return null;
- }
-
- public String getText(Object element) {
- ComponentSpecification spec = null;
-
- /* if not non-leaf node, the first element has the name for
- * the whole list */
- if (element instanceof List){
- spec = (ComponentSpecification) ((List) element).get(0);
- }
- else if (element instanceof ComponentSpecification ){
- spec = (ComponentSpecification) element;
- }
- return spec.getName();
- }
-
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- public void dispose() {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
-
- }
-
- }
-
-
- class BuiltInTypesTreeContentProvider implements ITreeContentProvider {
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof List) {
- List parentContent = (List) parentElement;
-
- /** Ignore the first element (which contains the name of this list
- * ie. 'Numbers', 'Date and time', 'Other') */
- return parentContent.subList(1, parentContent.size()).toArray();
- }
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (getChildren(element).length > 1) {
- return true;
- }
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/IOpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/IOpenInNewEditor.java
deleted file mode 100644
index 5e2c520e61..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/IOpenInNewEditor.java
+++ /dev/null
@@ -1,16 +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.wst.xsd.ui.internal.dialogs;
-
-public interface IOpenInNewEditor
-{
- public void openXSDEditor();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewAttributeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewAttributeDialog.java
deleted file mode 100644
index 5602942882..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewAttributeDialog.java
+++ /dev/null
@@ -1,93 +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.wst.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class NewAttributeDialog extends NewComponentDialog implements IComponentDialog
-{
- protected XSDSchema schema;
- protected Object setObject;
- protected int typeKind;
- protected Object selection;
-
- public NewAttributeDialog()
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ATTRIBUTE, "NewAttribute"); //$NON-NLS-1$
- }
-
- public NewAttributeDialog(XSDSchema schema)
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ATTRIBUTE, "NewAttribute"); //$NON-NLS-1$
- this.schema = schema;
- }
-
- private void setup() {
- if (schema != null) {
- List usedNames = getUsedElementNames();
- setUsedNames(usedNames);
- setDefaultName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", schema.getAttributeDeclarations()));
- }
- }
-
- public int createAndOpen()
- {
- setup();
- int returnCode = super.createAndOpen();
- if (returnCode == 0)
- {
- if (setObject instanceof Adapter)
- {
- //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
- }
- }
- return returnCode;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- ComponentSpecification componentSpecification = new ComponentSpecification(null, getName(), null);
- componentSpecification.setMetaName(IXSDSearchConstants.ATTRIBUTE_META_NAME);
- componentSpecification.setNew(true);
- return componentSpecification;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- private List getUsedElementNames() {
- List usedNames = new ArrayList();
- if (schema != null ) {
- List elementsList = schema.getAttributeDeclarations();
- Iterator elements = elementsList.iterator();
- while (elements.hasNext()) {
- usedNames.add(((XSDAttributeDeclaration) elements.next()).getName());
- }
- }
-
- return usedNames;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewComponentDialog.java
deleted file mode 100644
index aa0c49e02e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewComponentDialog.java
+++ /dev/null
@@ -1,196 +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.xsd.ui.internal.dialogs;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-
-public class NewComponentDialog extends Dialog implements ModifyListener
-{
- protected Text nameField;
- protected Button okButton;
- protected String name;
- protected String title;
- protected Label errorMessageLabel;
- protected List usedNames;
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- }
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName, List usedNames)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- this.usedNames = usedNames;
- }
-
- public int createAndOpen()
- {
- create();
- getShell().setText(title);
- setBlockOnOpen(true);
- return open();
- }
-
- protected Control createContents(Composite parent)
- {
- Control control = super.createContents(parent);
- nameField.forceFocus();
- nameField.selectAll();
- updateErrorMessage();
- return control;
- }
-
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected void createHeaderContent(Composite parent)
- {
- }
-
- protected void createExtendedContent(Composite parent)
- {
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite)super.createDialogArea(parent);
-
- createHeaderContent(dialogArea);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- composite.setLayoutData(gdFill);
-
- Label nameLabel = new Label(composite, SWT.NONE);
- nameLabel.setText(Messages.UI_LABEL_NAME);
-
- nameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- gd.widthHint = 200;
- nameField.setLayoutData(gd);
- nameField.setText(name);
- nameField.addModifyListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameField, XSDEditorCSHelpIds.NEWTYPE_NAME);
-
- createExtendedContent(dialogArea);
-
- // error message
- errorMessageLabel = new Label(dialogArea, SWT.NONE);
- errorMessageLabel.setText("error message goes here");
- GridData gd2 = new GridData();
- gd2.horizontalAlignment= GridData.FILL;
- gd2.grabExcessHorizontalSpace= true;
- gd2.widthHint = 200;
- errorMessageLabel.setLayoutData(gd2);
-// Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-// errorMessageLabel.setForeground(color);
-
- return dialogArea;
- }
-
- public void modifyText(ModifyEvent e)
- {
- updateErrorMessage();
- }
-
- protected String computeErrorMessage(String name)
- {
- if (usedNames == null)
- return null;
-
- Iterator iterator = usedNames.iterator();
- while (iterator.hasNext()) {
- if (name.equalsIgnoreCase((String) iterator.next())) {
- return org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ERROR_NAME_ALREADY_USED; //$NON-NLS-1$
- }
- }
-
- return null;
- }
-
- protected void updateErrorMessage()
- {
- String errorMessage = null;
- String name = nameField.getText().trim();
- if (name.length() > 0)
- {
- errorMessage = computeErrorMessage(name);
- }
- else
- {
- errorMessage = ""; //$NON-NLS-1$
- }
- errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
- okButton.setEnabled(errorMessage == null);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- name = nameField.getText();
- }
- super.buttonPressed(buttonId);
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setUsedNames(List usedNames) {
- this.usedNames = usedNames;
- }
-
- public void setDefaultName(String name) {
- this.name = name;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java
deleted file mode 100644
index 9c83571743..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java
+++ /dev/null
@@ -1,26 +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.xsd.ui.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewElementButtonHandler implements INewComponentHandler
-{
- public NewElementButtonHandler()
- {
- }
-
- public void openNewComponentDialog()
- {
- NewElementDialog newElementDialog = new NewElementDialog();
- newElementDialog.createAndOpen();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java
deleted file mode 100644
index 2a0619b52b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java
+++ /dev/null
@@ -1,92 +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.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class NewElementDialog extends NewComponentDialog implements IComponentDialog
-{
- protected XSDSchema schema;
- protected Object setObject;
- protected int typeKind;
- protected Object selection;
-
- public NewElementDialog()
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ELEMENT, "NewElement"); //$NON-NLS-1$
- }
-
- public NewElementDialog(XSDSchema schema)
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ELEMENT, "NewElement"); //$NON-NLS-1$
- this.schema = schema;
- }
-
- private void setup() {
- if (schema != null) {
- List usedNames = getUsedElementNames();
- setUsedNames(usedNames);
- setDefaultName(XSDCommonUIUtils.createUniqueElementName("NewElement", schema.getElementDeclarations()));
- }
- }
-
- public int createAndOpen()
- {
- setup();
- int returnCode = super.createAndOpen();
- if (returnCode == 0)
- {
- if (setObject instanceof Adapter)
- {
- //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
- }
- }
- return returnCode;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- ComponentSpecification componentSpecification = new ComponentSpecification(null, getName(), null);
- componentSpecification.setMetaName(IXSDSearchConstants.ELEMENT_META_NAME);
- componentSpecification.setNew(true);
- return componentSpecification;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- private List getUsedElementNames() {
- List usedNames = new ArrayList();
- if (schema != null ) {
- List elementsList = schema.getElementDeclarations();
- Iterator elements = elementsList.iterator();
- while (elements.hasNext()) {
- usedNames.add(((XSDElementDeclaration) elements.next()).getName());
- }
- }
-
- return usedNames;
- }
- }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java
deleted file mode 100644
index e815a88b8d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java
+++ /dev/null
@@ -1,26 +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.xsd.ui.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewTypeButtonHandler implements INewComponentHandler
-{
- public NewTypeButtonHandler()
- {
- }
-
- public void openNewComponentDialog()
- {
- NewTypeDialog newTypeDialog = new NewTypeDialog();
- newTypeDialog.createAndOpen();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java
deleted file mode 100644
index 45fec61d50..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.dialogs;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class NewTypeDialog extends NewComponentDialog implements IComponentDialog
-{
- protected XSDSchema schema;
- protected static int SIMPLE_TYPE = 0;
- protected static int COMPLEX_TYPE = 1;
- protected Object setObject;
- protected int typeKind;
- protected Object selection;
- protected boolean allowComplexType = true;
- protected boolean allowAnonymousType = true;
- protected boolean anonymousType = false;
- private Button complexTypeButton;
- private Button simpleTypeButton;
- private Button anonymousTypeCheckBox;
-
- public NewTypeDialog()
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_TYPE, "NewType"); //$NON-NLS-1$
- }
-
- public NewTypeDialog(XSDSchema schema)
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_TYPE, "NewType"); //$NON-NLS-1$
- this.schema = schema;
- }
-
- private void setup() {
- if (schema != null) {
- List usedNames = getUsedTypeNames();
- setUsedNames(usedNames);
- setDefaultName(XSDCommonUIUtils.createUniqueElementName(name, schema.getTypeDefinitions()));
- }
- }
-
- public int createAndOpen()
- {
- setup();
- int returnCode = super.createAndOpen();
- if (returnCode == 0)
- {
- if (setObject instanceof Adapter)
- {
- //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
- }
- }
- return returnCode;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- ComponentSpecification componentSpecification;
- if ( anonymousType )
- componentSpecification = new ComponentSpecification(null, null, null);
- else
- componentSpecification = new ComponentSpecification(null, getName(), null);
- componentSpecification.setMetaName(typeKind == COMPLEX_TYPE ? IXSDSearchConstants.COMPLEX_TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME);
- componentSpecification.setNew(true);
- //componentSpecification.
- return componentSpecification;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- protected void createHeaderContent(Composite parent)
- {
- complexTypeButton = new Button(parent, SWT.RADIO);
- complexTypeButton.setText(Messages._UI_LABEL_COMPLEX_TYPE);
- complexTypeButton.setEnabled(allowComplexType);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(complexTypeButton, XSDEditorCSHelpIds.NEWTYPE_COMPLEXTYPE);
-
- simpleTypeButton = new Button(parent, SWT.RADIO);
- simpleTypeButton.setText(Messages._UI_LABEL_SIMPLE_TYPE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(simpleTypeButton, XSDEditorCSHelpIds.NEWTYPE_SIMPLETYPE);
-
- SelectionAdapter listener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == simpleTypeButton)
- {
- typeKind = SIMPLE_TYPE;
- }
- else if (e.widget == complexTypeButton)
- {
- typeKind = COMPLEX_TYPE;
- }
- else if (allowAnonymousType && e.widget == anonymousTypeCheckBox)
- {
- if (anonymousTypeCheckBox.getSelection() == true)
- {
- nameField.setEnabled(false);
- anonymousType = true;
- }
- else
- {
- nameField.setEnabled(true);
- anonymousType = false;
- }
- }
- }
- };
- if (allowComplexType)
- {
- complexTypeButton.setSelection(true);
- typeKind = COMPLEX_TYPE;
- }
- else
- {
- simpleTypeButton.setSelection(true);
- typeKind = SIMPLE_TYPE;
- }
-
- simpleTypeButton.addSelectionListener(listener);
- complexTypeButton.addSelectionListener(listener);
-
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd = new GridData(GridData.FILL_BOTH);
- separator.setLayoutData(gd);
-
- if (allowAnonymousType )
- {
- anonymousTypeCheckBox = new Button(parent, SWT.CHECK);
- anonymousTypeCheckBox.setText(Messages._UI_LABEL_CREATE_ANON_TYPE);
- }
-
- if (anonymousTypeCheckBox != null)
- anonymousTypeCheckBox.addSelectionListener(listener);
- }
-
- /**
- * This method will be removed in the next WTP release.
- * @deprecated
- */
- protected String getNormalizedLocation(String location)
- {
- try
- {
- URL url = new URL(location);
- URL resolvedURL = FileLocator.resolve(url);
- location = resolvedURL.getPath();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return location;
- }
-
- public void allowComplexType(boolean value)
- {
- this.allowComplexType= value;
- }
-
- public void allowAnonymousType(boolean value)
- {
- this.allowAnonymousType = value;
- }
-
- private List getUsedTypeNames() {
- List usedNames = new ArrayList();
-
- if (schema != null) {
- List typesList = schema.getTypeDefinitions();
- Iterator types = typesList.iterator();
- while (types.hasNext()) {
- usedNames.add(((XSDTypeDefinition) types.next()).getName());
- }
- }
-
- return usedNames;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
deleted file mode 100644
index a437d6cdab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
+++ /dev/null
@@ -1,108 +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
- * Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * The BuiltInTypesFilteringDialog is a SelectionDialog that allows the user to
- * select a ...
- */
-public class SelectBuiltInTypesForFilteringDialog extends CheckedTreeSelectionDialog {
-
- public final static String CUSTOM_LIST_SEPARATOR = XSDEditorPlugin.CUSTOM_LIST_SEPARATOR;
-
- public SelectBuiltInTypesForFilteringDialog(Shell parent,
- ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parent, labelProvider, contentProvider);
-
- init();
- }
-
- public CheckboxTreeViewer getTreeViewer(){
- return super.getTreeViewer();
- }
-
- private void init(){
- // grey state enable
- setContainerMode(true);
-
- setTitle(Messages._UI_LABEL_SET_COMMON_BUILT_IN_TYPES);
- setMessage(Messages._UI_LABEL_SELECT_TYPES_FILTER_OUT);
-
- //super.create();
- //super.getTreeViewer().setSorter(new ViewerSorter());
-
- }
-
- /**
- * Returns a String acting as list of built-in types selected by the user
- * in the filter dialog (white space acts as the item separator).
- * Suggest using getSelectedBuiltInTypesFromString
- * to get a concrete array of selected types.
- * We can only store String in the plugin preference's storage so we have
- * use this method for conversion
- */
- public static String getTypesListInString(Object[] chosenTypes) {
- String returningList = ""; //$NON-NLS-1$
- for (int i = 0; i < chosenTypes.length; i++){
- if ( chosenTypes[i] instanceof ComponentSpecification){
- ComponentSpecification aType =
- (ComponentSpecification) chosenTypes[i];
-
- returningList += aType.getName() + CUSTOM_LIST_SEPARATOR;
- }
- /* else selectedBuiltInTypes[i] instanceof List, ie. a parentNode
- * we ignore it. */
- }
- return returningList;
- }
-
- /**
- * Filters out all built-In type not recorded in the 'listString' and
- * returns the result in a List
- * Warning: recursive method
- * @param listString
- * @param aContainer
- * Containing all types
- * @return a subset of what 'aContainer' has as specified by 'listString'
- */
- public static List getSelectedBuiltInTypesFromString(String listString,
- List aContainer) {
- List selectedTypes = new ArrayList();
-
- // ignore the 'header' item in the container, starting from i = 1
- for (int i = 1; i < aContainer.size(); i++){
- Object o = aContainer.get(i);
- if ( o instanceof ComponentSpecification){
- ComponentSpecification aType = (ComponentSpecification) o;
- String typeName = aType.getName();
- // if typeName's name appears in 'listString'
- if ( listString.indexOf(typeName + CUSTOM_LIST_SEPARATOR) != -1)
- selectedTypes.add(o);
- }
- else if ( o instanceof List){
- selectedTypes.addAll( getSelectedBuiltInTypesFromString(listString, (List) o) );
- }
- }
- return selectedTypes;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java
deleted file mode 100644
index 43e520d2a1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.IPath;
-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.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
-
-public class XSDEditSchemaNS extends EditSchemaInfoDialog
-{
- CommonEditNamespacesDialog editNamespacesControl;
-
- public XSDEditSchemaNS(Shell parentShell, IPath resourceLocation)
- {
- super(parentShell, resourceLocation);
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- editNamespacesControl = new CommonEditNamespacesDialog(composite, resourceLocation, XMLUIMessages._UI_NAMESPACE_DECLARATIONS);
-
- editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
- editNamespacesControl.updateErrorMessage(namespaceInfoList);
-
- return composite;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java
deleted file mode 100644
index 33adbdeff4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.xsd.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDGraphViewerDialog extends PopupDialog
-{
- protected Object model;
- protected ScrollingGraphicalViewer viewer;
- protected IOpenInNewEditor openInNewEditorHelper;
- private OpenEditorLinkListener linkListener;
- private Label nsInfoLabel;
- private Hyperlink link;
- private String infoText;
- private Font infoFont;
- private String uniqueID;
- private PreviewControlListener moveListener;
-
- private static String X_ORIGIN = "DIALOG_X_ORIGIN"; //$NON-NLS-1$
- private static String Y_ORIGIN = "DIALOG_Y_ORIGIN"; //$NON-NLS-1$
- private boolean isHighContrast = false;
-
- public XSDGraphViewerDialog(Shell parentShell, String titleText, String infoText, Object model, String ID)
- {
- // INFOPOPUP_SHELLSTYLE works properly on both Windows and Linux.
- super(parentShell, INFOPOPUP_SHELLSTYLE, true, true, true, true, false, titleText, infoText);
- setModel(model);
- linkListener = new OpenEditorLinkListener();
- this.infoText = infoText;
- this.uniqueID = ID;
- Assert.isTrue(ID != null && ID.length() > 0);
- moveListener = new PreviewControlListener();
- try
- {
- isHighContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e) {
- // ignore
- }
- create();
- }
-
- public void setOpenExternalEditor(IOpenInNewEditor helper)
- {
- this.openInNewEditorHelper = helper;
- }
-
- protected void fillDialogMenu(IMenuManager dialogMenu)
- {
- super.fillDialogMenu(dialogMenu);
- dialogMenu.add(new Separator());
- dialogMenu.add(new ClosePopup());
- dialogMenu.add(new Separator());
- dialogMenu.add(new SetOpenInEditor());
- }
-
- protected Control createDialogArea(Composite parent)
- {
- viewer = new ScrollingGraphicalViewer();
- Composite c = (Composite)super.createDialogArea(parent);
-
- if (isHighContrast)
- {
- c.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- }
- else
- {
- c.setBackground(ColorConstants.white);
- }
- c.setLayout(new FillLayout());
-
- RootEditPart root = new RootEditPart();
- viewer.setRootEditPart(root);
-
- viewer.createControl(c);
-
- // The graphical viewer tool tip processing creates an extra shell which
- // interferes with the PopupDialog's deactivation logic.
- removeMouseListeners(viewer.getControl());
-
- if (isHighContrast)
- {
- viewer.getControl().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- }
- else
- {
- viewer.getControl().setBackground(ColorConstants.white);
- }
- EditPartFactory editPartFactory = new XSDEditPartFactory(new TypeVizFigureFactory());
- viewer.setEditPartFactory(editPartFactory);
-
- RootContentEditPart rootContentEditPart = new RootContentEditPart();
- rootContentEditPart.setModel(model);
- viewer.setContents(rootContentEditPart);
-
- getShell().addControlListener(moveListener);
- return c;
- }
-
- private void removeMouseListeners(Control control)
- {
- Listener[] listeners = control.getListeners(SWT.MouseEnter);
- control.removeListener(SWT.MouseEnter, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseExit);
- control.removeListener(SWT.MouseExit, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseHover);
- control.removeListener(SWT.MouseHover, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseMove);
- control.removeListener(SWT.MouseMove, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseDown);
- control.removeListener(SWT.MouseDown, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseUp);
- control.removeListener(SWT.MouseUp, listeners[0]);
-
- listeners = control.getListeners(SWT.MouseDoubleClick);
- control.removeListener(SWT.MouseDoubleClick, listeners[0]);
- }
-
- protected Control createInfoTextArea(Composite parent)
- {
- Composite infoComposite = new Composite(parent, SWT.NONE);
- GridLayout gridLayout = new GridLayout(2, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- infoComposite.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- infoComposite.setLayoutData(gd);
-
- nsInfoLabel = new Label(infoComposite, SWT.LEFT);
- nsInfoLabel.setText(infoText);
-
- Font font = nsInfoLabel.getFont();
- FontData[] fontDatas = font.getFontData();
- for (int i = 0; i < fontDatas.length; i++)
- {
- fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
- }
- infoFont = new Font(nsInfoLabel.getDisplay(), fontDatas);
- nsInfoLabel.setFont(infoFont);
- gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
- nsInfoLabel.setLayoutData(gd);
- nsInfoLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
-
- link = new Hyperlink(infoComposite, SWT.RIGHT);
- // Remove mnemonic ampersand. It would be better to have a separate string in the future.
- String label = Messages._UI_ACTION_OPEN_IN_NEW_EDITOR.replaceAll("&", "");
- link.setText(label);
- link.setFont(infoFont);
- link.addHyperlinkListener(linkListener);
- return infoComposite;
- }
-
- private void setModel(Object model)
- {
- Assert.isTrue(model instanceof XSDConcreteComponent);
- this.model = XSDAdapterFactory.getInstance().adapt((XSDConcreteComponent) model);
- }
-
- protected class SetOpenInEditor extends Action
- {
- public SetOpenInEditor()
- {
- super(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR);
- }
-
- public void run()
- {
- if (openInNewEditorHelper != null)
- {
- try
- {
- openInNewEditorHelper.openXSDEditor();
- }
- catch (Exception e)
- {
-
- }
- }
- }
- }
-
- private class ClosePopup extends Action {
- public ClosePopup()
- {
- super(Messages._UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP);
- }
-
- public void run()
- {
- close();
- }
- }
-
- protected IDialogSettings getDialogSettings()
- {
- IDialogSettings settings= XSDEditorPlugin.getDefault().getDialogSettings().getSection(uniqueID);
- if (settings == null)
- settings= XSDEditorPlugin.getDefault().getDialogSettings().addNewSection(uniqueID);
-
- return settings;
- }
-
- protected Point getInitialLocation(Point initialSize)
- {
- Point result = super.getInitialLocation(initialSize);
-
- IDialogSettings settings = getDialogSettings();
- if (settings != null)
- {
- try
- {
-
- String prefix = uniqueID == null ? getClass().getName() : uniqueID;
- int x = settings.getInt(prefix + X_ORIGIN);
- int y = settings.getInt(prefix + Y_ORIGIN);
- result = new Point(x, y);
- Shell parent = getParentShell();
- if (parent != null)
- {
- Point parentLocation = parent.getLocation();
- result.x += parentLocation.x;
- result.y += parentLocation.y;
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- return result;
- }
-
- protected void saveDialogBounds(Shell shell)
- {
- IDialogSettings settings = getDialogSettings();
- if (settings != null)
- {
- Point shellLocation = shell.getLocation();
- Shell parent = getParentShell();
- if (parent != null)
- {
- Point parentLocation = parent.getLocation();
- shellLocation.x -= parentLocation.x;
- shellLocation.y -= parentLocation.y;
- }
- String prefix = uniqueID == null ? getClass().getName() : uniqueID;
- settings.put(prefix + X_ORIGIN, shellLocation.x);
- settings.put(prefix + Y_ORIGIN, shellLocation.y);
- }
- }
-
-
- public boolean close()
- {
- if (getShell() == null || getShell().isDisposed())
- {
- return true;
- }
-
- getShell().removeControlListener(moveListener);
- if (link != null)
- link.removeHyperlinkListener(linkListener);
- if (infoFont != null)
- infoFont.dispose();
- infoFont = null;
- return super.close();
- }
-
- private final class OpenEditorLinkListener implements IHyperlinkListener
- {
-
- public void linkActivated(HyperlinkEvent e)
- {
- new SetOpenInEditor().run();
- close();
- }
-
- public void linkEntered(HyperlinkEvent e)
- {
- link.setForeground(ColorConstants.lightBlue);
- }
-
- public void linkExited(HyperlinkEvent e)
- {
- link.setForeground(link.getParent().getForeground());
- }
-
- }
-
- protected class PreviewControlListener implements ControlListener
- {
-
- public void controlMoved(ControlEvent e)
- {
- saveDialogBounds(getShell());
- }
-
- public void controlResized(ControlEvent e)
- {
- }
- }
-
- /**
- * @deprecated since 1.2.101
- * @param xsdComponent
- * @param schema
- * @param editorName
- */
- public static void openNonXSDResourceSchema(XSDConcreteComponent xsdComponent, XSDSchema schema, String editorName)
- {
- openInlineSchema(getCurrentEditorInput(), xsdComponent, schema, editorName);
- }
-
- public static void openInlineSchema(IEditorInput editorInput, XSDConcreteComponent xsdComponent, XSDSchema schema, String editorName)
- {
- OpenInNewEditor.openInlineSchema(editorInput, xsdComponent, schema, editorName);
- }
-
- /**
- * @deprecated
- */
- public static void openXSDEditor(XSDConcreteComponent xsdComponent)
- {
- openXSDEditor(getCurrentEditorInput(), xsdComponent.getSchema(), xsdComponent);
- }
-
- public static void openXSDEditor(IEditorInput editorInput, XSDSchema schema, XSDConcreteComponent xsdComponent)
- {
- OpenInNewEditor.openXSDEditor(editorInput, schema, xsdComponent);
- }
-
- private static IEditorInput getCurrentEditorInput()
- {
- try
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = null;
- if (workbenchWindow != null)
- {
- page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorPart editorPart = page.getActiveEditor();
- if (editorPart != null)
- {
- return editorPart.getEditorInput();
- }
- }
- }
- }
- catch (Exception e)
- {
-
- }
- return null;
- }
-
- protected Control getFocusControl()
- {
- return link;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java
deleted file mode 100644
index 5d431615c5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java
+++ /dev/null
@@ -1,267 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Base class for hyperlinks detectors. Provides a framework and common code for
- * hyperlink detectors. TODO: Can we pull this class further up the inheritance
- * hierarchy?
- */
-public abstract class BaseHyperlinkDetector extends AbstractHyperlinkDetector
-{
- /*
- * (non-Javadoc)
- */
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
- {
- if (region == null || textViewer == null)
- {
- return null;
- }
-
- List hyperlinks = new ArrayList(0);
- IDocument document = textViewer.getDocument();
- int offset = region.getOffset();
-
- IDOMNode node = getCurrentNode(document, offset);
-
- // This call allows us to determine whether an attribute is linkable,
- // without incurring the cost of asking for the target component.
-
- if (!isLinkable(node))
- {
- return null;
- }
-
- IRegion hyperlinkRegion = getHyperlinkRegion(node);
-
- // createHyperlink is a template method. Derived classes, should override.
-
- IHyperlink hyperlink = createHyperlink(document, node, hyperlinkRegion);
-
- if (hyperlink != null)
- {
- hyperlinks.add(hyperlink);
- }
-
- if (hyperlinks.size() == 0)
- {
- return null;
- }
-
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Determines whether a node is "linkable" that is, the component it refers to
- * can be the target of a "go to definition" navigation.
- *
- * @param node the node to test, must not be null;
- * @return true if the node is linkable, false otherwise.
- */
- private boolean isLinkable(IDOMNode node)
- {
- if (node == null)
- {
- return false;
- }
-
- short nodeType = node.getNodeType();
-
- boolean isLinkable = false;
-
- if (nodeType == Node.ATTRIBUTE_NODE)
- {
- IDOMAttr attr = (IDOMAttr) node;
- String name = attr.getName();
-
- // isLinkableAttribute is a template method. Derived classes should
- // override.
-
- isLinkable = isLinkableAttribute(name);
- }
-
- return isLinkable;
- }
-
- /**
- * Determines whether an attribute is "linkable" that is, the component it
- * points to can be the target of a "go to definition" navigation. Derived
- * classes should override.
- *
- * @param name the attribute name. Must not be null.
- * @return true if the attribute is linkable, false otherwise.
- */
- protected abstract boolean isLinkableAttribute(String name);
-
- /**
- * Creates a hyperlink based on the selected node. Derived classes should
- * override.
- *
- * @param document the source document.
- * @param node the node under the cursor.
- * @param region the text region to use to create the hyperlink.
- * @return a new IHyperlink for the node or null if one cannot be created.
- */
- protected abstract IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region);
-
- /**
- * Locates the attribute node under the cursor.
- *
- * @param offset the cursor offset.
- * @param parent the parent node
- * @return an IDOMNode representing the attribute if one is found at the
- * offset or null otherwise.
- */
- protected IDOMNode getAttributeNode(int offset, IDOMNode parent)
- {
- IDOMAttr attrNode = null;
- NamedNodeMap map = parent.getAttributes();
-
- for (int index = 0; index < map.getLength(); index++)
- {
- attrNode = (IDOMAttr) map.item(index);
- boolean located = attrNode.contains(offset);
- if (located)
- {
- if (attrNode.hasNameOnly())
- {
- attrNode = null;
- }
- break;
- }
- }
-
- if (attrNode == null)
- {
- return parent;
- }
- return attrNode;
- }
-
- /**
- * Returns the node the cursor is currently on in the document or null if no
- * node is selected
- *
- * @param offset the current cursor offset.
- * @return IDOMNode either element, doctype, text, attribute or null
- */
- private IDOMNode getCurrentNode(IDocument document, int offset)
- {
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
-
- try
- {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally
- {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof IDOMNode)
- {
- IDOMNode node = (IDOMNode) inode;
-
- if (node.hasAttributes())
- {
- node = getAttributeNode(offset, node);
- }
- return node;
- }
-
- return null;
- }
-
- /**
- * Get the text region corresponding to an IDOMNode.
- *
- * @param node the node for which we want the text region. Must not be null.
- * @return an IRegion for the node, or null if the node is not recognized.
- */
- protected IRegion getHyperlinkRegion(IDOMNode node)
- {
- if (node == null)
- {
- return null;
- }
-
- IRegion hyperRegion = null;
- short nodeType = node.getNodeType();
-
- switch (nodeType)
- {
- case Node.ELEMENT_NODE :
- {
- hyperRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset());
- }
- break;
- case Node.ATTRIBUTE_NODE :
- {
- IDOMAttr att = (IDOMAttr) node;
-
- int regOffset = att.getValueRegionStartOffset();
-
- // ISSUE: We are using a deprecated method here. Is there
- // a better way to get what we need?
-
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null)
- {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
-
- // Do not include quotes in attribute value region and only
- // underline the actual value, not the quotes.
-
- if (StringUtils.isQuoted(attValue))
- {
- regLength = regLength - 2;
- regOffset++;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- break;
- default :
- // Do nothing.
- break;
- }
-
- return hyperRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java
deleted file mode 100644
index a51c0fd84d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.editor;
-
-import org.eclipse.jface.viewers.ISelection;
-
-public interface ISelectionMapper
-{
- ISelection mapSelection(ISelection selectedObject);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java
deleted file mode 100644
index 3343e55f29..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java
+++ /dev/null
@@ -1,1468 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.KeyStroke;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.gef.ui.actions.PrintAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.INavigationLocationProvider;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.AddFieldAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseDirectEditAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DesignSelectAll;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.IADTEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedSimpleTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.IDocumentChangedNotifier;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.navigation.DesignViewNavigationLocation;
-import org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.wst.xsd.ui.internal.utils.OpenOnSelectionHelper;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class InternalXSDMultiPageEditor extends ADTMultiPageEditor implements ITabbedPropertySheetPageContributor, INavigationLocationProvider
-{
- // IModel model;
- IStructuredModel structuredModel;
- XSDSchema xsdSchema;
- XSDModelAdapter schemaNodeAdapter;
- private OutlineTreeSelectionChangeListener fOutlineListener;
- private SourceEditorSelectionListener fSourceEditorSelectionListener;
- private XSDSelectionManagerSelectionListener fXSDSelectionListener;
- private InternalDocumentChangedNotifier internalDocumentChangedNotifier = new InternalDocumentChangedNotifier();
- private static final String XSD_EDITOR_MODE_EXTENSION_ID = "org.eclipse.wst.xsd.ui.editorModes"; //$NON-NLS-N$
- private XSDPreferenceStoreListener xsdPreferenceStoreListener;
-
- class InternalDocumentChangedNotifier implements IDocumentChangedNotifier
- {
- List list = new ArrayList();
-
- public void addListener(INodeAdapter adapter)
- {
- list.add(adapter);
- }
-
- public void removeListener(INodeAdapter adapter)
- {
- list.remove(adapter);
- }
-
- public void notifyListeners(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- List clone = new ArrayList(list.size());
- clone.addAll(list);
- for (Iterator i = clone.iterator(); i.hasNext(); )
- {
- INodeAdapter adapter = (INodeAdapter)i.next();
- adapter.notifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
- }
- }
-
- protected void setInputToGraphicalViewer(IDocument newDocument)
- {
- IStructuredModel structuredModel = null;
- try
- {
- // only set input if structured model already exists
- // (meaning source editor is already managing the model)
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(newDocument);
- if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
- {
- Document doc = ((IDOMModel) structuredModel).getDocument();
- if (doc != null)
- {
- XSDModelAdapter modelAdapter = XSDModelAdapter.lookupOrCreateModelAdapter(doc);
- if (modelAdapter != null) // Assert should not be null
- {
- modelAdapter.setSchema(xsdSchema);
- xsdSchema = modelAdapter.resetSchema(doc);
- model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
- }
- }
- }
- }
- catch (Exception e)
- {
- }
- finally
- {
- if (structuredModel != null)
- {
- structuredModel.releaseFromRead();
- }
- }
- }
-
-
- public IModel buildModel()
- {
- try
- {
- IEditorInput editorInput = getEditorInput();
-
- // If the input schema is from the WSDL Editor, then use that inline schema
- if (editorInput instanceof IADTEditorInput)
- {
- xsdSchema = ((IADTEditorInput) editorInput).getSchema();
- if (xsdSchema != null)
- model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
- }
-
- Document document = null;
- IDocument doc = structuredTextEditor.getDocumentProvider().getDocument(getEditorInput());
- if (doc instanceof IStructuredDocument)
- {
- IStructuredModel model = null;
- try
- {
- // TODO: for StorageEditorInputs, should be forRead
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
- if (model == null)
- {
- model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
- }
- document = ((IDOMModel) model).getDocument();
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromEdit();
- }
- }
- }
- Assert.isNotNull(document);
-
- if (model != null)
- return model;
-
- xsdSchema = XSDModelAdapter.lookupOrCreateSchema(document);
- model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
- }
- catch (Exception e)
- {
-
- }
-
-// try
-// {
-// EPackage.Registry reg = EPackage.Registry.INSTANCE;
-// XSDPackage xsdPackage = (XSDPackage) reg.getEPackage(XSDPackage.eNS_URI);
-// xsdSchema = xsdPackage.getXSDFactory().createXSDSchema();
-// resourceSet = XSDSchemaImpl.createResourceSet();
-// IFile resourceFile = editorInput.getFile();
-// structuredModel = StructuredModelManager.getModelManager().getModelForEdit(resourceFile);
-// // If the resource is in the workspace....
-// // otherwise the user is trying to open an external file
-// if (resourceFile != null)
-// {
-// String pathName = resourceFile.getFullPath().toString();
-// xsdResource = resourceSet.getResource(URI.createPlatformResourceURI(pathName), true);
-// resourceSet.getResources().add(xsdResource);
-// Object obj = xsdResource.getContents().get(0);
-// if (obj instanceof XSDSchema)
-// {
-// xsdSchema = (XSDSchema) obj;
-// xsdSchema.setElement(((IDOMModel) structuredModel).getDocument().getDocumentElement());
-// model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
-// }
-//
-// // If the input schema is from the WSDL Editor, then use that inline schema
-// if (editorInput instanceof XSDFileEditorInput)
-// {
-// xsdSchema = ((XSDFileEditorInput) editorInput).getSchema();
-// model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
-// }
-// if (xsdSchema.getElement() != null)
-//
-// // TODO (cs) ... we need to look into performance issues when we add elements
-// // seems to be that formatting is causig lots of notification and things get terribly slow
-// // I'm specializing the method below to add an isModelStateChanging check that should
-// // help here ... but we need to investigate further
-// new XSDModelReconcileAdapter(xsdSchema.getElement().getOwnerDocument(), xsdSchema)
-// {
-// public void handleNotifyChange(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
-// {
-// if (notifier instanceof NodeImpl)
-// {
-// NodeImpl nodeImpl = (NodeImpl)notifier;
-// if (!nodeImpl.getModel().isModelStateChanging())
-// {
-// super.handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index);
-// internalDocumentChangedNotifier.notifyListeners(notifier, eventType, feature, oldValue, newValue, index);
-// }
-// }
-// }
-// };
-// xsdResource.setModified(false);
-// }
-// }
-// catch (StackOverflowError e)
-// {
-// }
-// catch (Exception ex)
-// {
-// }
- return model;
- }
-
- public void dispose()
- {
- IStructuredModel structuredModel = null;
- XSDModelAdapter modelAdapter = null;
- IDOMDocument doc = null;
- IDocument idoc = structuredTextEditor.getDocumentProvider().getDocument(getEditorInput());
- if (idoc != null)
- {
- structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(idoc);
- if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
- {
- try
- {
- if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
- {
- doc = ((IDOMModel) structuredModel).getDocument();
- if (doc != null)
- {
- modelAdapter = (XSDModelAdapter) doc.getExistingAdapter(XSDModelAdapter.class);
- if (modelAdapter != null)
- {
- doc.getModel().removeModelStateListener(modelAdapter.getModelReconcileAdapter());
- doc.removeAdapter(modelAdapter.getModelReconcileAdapter());
- doc.removeAdapter(modelAdapter);
- modelAdapter.clear();
- modelAdapter = null;
- }
- }
- }
- }
- finally
- {
- structuredModel.releaseFromRead();
- }
- }
- }
-
-
-
- if (fOutlinePage != null)
- {
-// if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null)
-// {
-// ((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlineListener);
-// }
- if (fOutlineListener != null)
- {
- fOutlinePage.removeSelectionChangedListener(fOutlineListener);
- }
- }
- getSelectionManager().removeSelectionChangedListener(fXSDSelectionListener);
- XSDEditorPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(xsdPreferenceStoreListener);
- xsdPreferenceStoreListener = null;
- super.dispose();
- }
-
- protected void initializeGraphicalViewer()
- {
- RootContentEditPart root = new RootContentEditPart();
- if (!(getEditorInput() instanceof IADTEditorInput))
- {
- root.setModel(model);
- }
- graphicalViewer.setContents(root);
- }
-
- protected void configureGraphicalViewer()
- {
- super.configureGraphicalViewer();
- graphicalViewer.getKeyHandler().put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));
- // get edit part factory from extension
- EditPartFactory editPartFactory = getEditorModeManager().getCurrentMode().getEditPartFactory();
- graphicalViewer.setEditPartFactory(editPartFactory);
- }
-
- public Object getAdapter(Class type)
- {
- if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class)
- {
- XSDTabbedPropertySheetPage page = new XSDTabbedPropertySheetPage(this);
- return page;
- }
- else if (type == ISelectionProvider.class)
- {
- return getSelectionManager();
- }
- else if (type == XSDSchema.class)
- {
- return xsdSchema;
- }
- else if (type == IKeyboardDrag.class)
- {
- return new KeyboardDragImpl();
- }
- else if (type == IContentOutlinePage.class)
- {
- Object adapter = super.getAdapter(type);
- if (adapter != null)
- {
- IContentOutlinePage page = (IContentOutlinePage) adapter;
- fOutlineListener = new OutlineTreeSelectionChangeListener();
- page.addSelectionChangedListener(fOutlineListener);
-
-// if (page instanceof ConfigurableContentOutlinePage)
-// {
-// ((ConfigurableContentOutlinePage) page).addDoubleClickListener(fOutlineListener);
-// }
- return page;
- }
- }
- else if (type == XSDAttributeReferenceEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- // TODO (cs) currently we assume the schema editor will only ever edit a
- // single schema
- /// but if we want to enable the schema editor to edit wsdl files we
- // should pass in
- // an array of schemas
- // hmm.. perhaps just pass in a ResourceSet
- XSDSchema[] schemas = {xsdSchema};
- return new XSDAttributeReferenceEditManager(fileEditorInput.getFile(), schemas);
- }
- }
- else if (type == XSDElementReferenceEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- // TODO (cs) currently we assume the schema editor will only ever edit a
- // single schema
- /// but if we want to enable the schema editor to edit wsdl files we
- // should pass in
- // an array of schemas
- // hmm.. perhaps just pass in a ResourceSet
- XSDSchema[] schemas = {xsdSchema};
- return new XSDElementReferenceEditManager(fileEditorInput.getFile(), schemas);
- }
- }
- else if (type == XSDTypeReferenceEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- // TODO (cs) currently we assume the schema editor will only ever edit a
- // single schema
- // but if we want to enable the schema editor to edit wsdl files we
- // should pass in
- // an array of schemas
- // hmm.. perhaps just pass in a ResourceSet
- XSDSchema[] schemas = {xsdSchema};
- return new XSDTypeReferenceEditManager(fileEditorInput.getFile(), schemas);
- }
- }
- else if (type == XSDComplexTypeBaseTypeEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- // TODO (cs) currently we assume the schema editor will only ever edit a
- // single schema
- // but if we want to enable the schema editor to edit wsdl files we
- // should pass in
- // an array of schemas
- // hmm.. perhaps just pass in a ResourceSet
- XSDSchema[] schemas = {xsdSchema};
- return new XSDComplexTypeBaseTypeEditManager(fileEditorInput.getFile(), schemas);
- }
- }
- else if (type == XSDSubstitutionGroupEditManager.class)
- {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- XSDSchema[] schemas = {xsdSchema};
- return new XSDSubstitutionGroupEditManager(fileEditorInput.getFile(), schemas);
- }
- }
- else if (type == ITextEditor.class)
- {
- return getTextEditor();
- }
- else if (type == ISelectionMapper.class)
- {
- return new XSDSelectionMapper();
- }
- else if (type == IDocumentChangedNotifier.class)
- {
- return internalDocumentChangedNotifier;
- }
- else if (type == ProductCustomizationProvider.class)
- {
- return XSDEditorPlugin.getPlugin().getProductCustomizationProvider();
- }
- return super.getAdapter(type);
- }
-
- public String getContributorId()
- {
- return "org.eclipse.wst.xsd.ui.internal.editor"; //$NON-NLS-1$
- }
-
- public XSDSchema getXSDSchema()
- {
- return xsdSchema;
- }
-
- /**
- * Method openOnGlobalReference. The comp argument is a resolved xsd schema
- * object from another file. This is created and called from another schema
- * model to allow F3 navigation to open a new editor and choose the referenced
- * object within that editor context
- *
- * @param comp
- */
- public void openOnGlobalReference(XSDConcreteComponent comp)
- {
- XSDConcreteComponent namedComponent = openOnSelectionHelper.openOnGlobalReference(comp);
-
- if (namedComponent == null)
- {
- namedComponent = getXSDSchema();
- }
- XSDBaseAdapter adapter = (XSDBaseAdapter) XSDAdapterFactory.getInstance().adapt(namedComponent);
- getSelectionManager().setSelection(new StructuredSelection(adapter));
- IAction action = getActionRegistry().getAction(SetInputToGraphView.ID);
- if (action != null)
- {
- action.run();
- }
-
- }
-
- protected OpenOnSelectionHelper openOnSelectionHelper;
-
- public OpenOnSelectionHelper getOpenOnSelectionHelper()
- {
- return openOnSelectionHelper;
- }
-
- /**
- * Creates the pages of the multi-page editor.
- */
- protected void createPages()
- {
- super.createPages();
-
-// selectionProvider = getSelectionManager();
-// getEditorSite().setSelectionProvider(selectionProvider);
-//
-// structuredTextEditor = new StructuredTextEditor();
-// model = buildModel((IFileEditorInput) getEditorInput());
-// createGraphPage();
-// createSourcePage();
-
- openOnSelectionHelper = new OpenOnSelectionHelper(getTextEditor(), getXSDSchema());
-
- ISelectionProvider provider = getTextEditor().getSelectionProvider();
- fSourceEditorSelectionListener = new SourceEditorSelectionListener();
- if (provider instanceof IPostSelectionProvider)
- {
- ((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener);
- }
- else
- {
- provider.addSelectionChangedListener(fSourceEditorSelectionListener);
- }
- fXSDSelectionListener = new XSDSelectionManagerSelectionListener();
- getSelectionManager().addSelectionChangedListener(fXSDSelectionListener);
-
- xsdPreferenceStoreListener = new XSDPreferenceStoreListener();
- XSDEditorPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(xsdPreferenceStoreListener);
- }
-
- protected class XSDPreferenceStoreListener implements IPropertyChangeListener
- {
- public void propertyChange(PropertyChangeEvent evt)
- {
- String property = evt.getProperty();
- if (XSDEditorPlugin.CONST_SHOW_EXTERNALS.equals(property))
- {
- ((GraphicalEditPart) graphicalViewer.getContents()).getFigure().invalidateTree();
- graphicalViewer.getContents().refresh();
- }
- }
- }
-
- public boolean isReadOnly()
- {
- IEditorInput editorInput = getEditorInput();
- return !(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput);
- }
-
- protected void createActions()
- {
- super.createActions();
-
- ActionRegistry registry = getActionRegistry();
-
- // add an isReadOnly method to the editorPart instead
- if (!isReadOnly())
- {
- BaseSelectionAction action = new AddFieldAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
- action = new DeleteAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new DesignSelectAll(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new AddXSDRedefinedComplexTypeAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_COMPLEX_TYPE));
- registry.registerAction(action);
-
- action = new AddXSDRedefinedSimpleTypeAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_SIMPLE_TYPE));
- registry.registerAction(action);
-
- action = new AddXSDRedefinedAttributeGroupAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_ATTRIBUTE_GROUP));
- registry.registerAction(action);
-
- action = new AddXSDRedefinedModelGroupAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_MODEL_GROUP));
- registry.registerAction(action);
-
- action = new SetBaseTypeAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new AddXSDElementAction(this, AddXSDElementAction.ID, Messages._UI_ACTION_ADD_ELEMENT, false);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
- registry.registerAction(action);
-
- action = new AddXSDElementAction(this, AddXSDElementAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
- registry.registerAction(action);
-
- action = new AddXSDElementAction(this, AddXSDElementAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
- registry.registerAction(action);
-
- action = new AddXSDElementAction(this, AddXSDElementAction.REF_ID, Messages._UI_ACTION_ADD_ELEMENT_REF, true);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElementRef.gif"));
- registry.registerAction(action);
-
- action = new AddXSDModelGroupAction(this, XSDCompositor.SEQUENCE_LITERAL, AddXSDModelGroupAction.SEQUENCE_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSequence.gif"));
- registry.registerAction(action);
-
- action = new AddXSDModelGroupAction(this, XSDCompositor.CHOICE_LITERAL, AddXSDModelGroupAction.CHOICE_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDChoice.gif"));
- registry.registerAction(action);
-
- action = new AddXSDModelGroupAction(this, XSDCompositor.ALL_LITERAL, AddXSDModelGroupAction.ALL_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAll.gif"));
- registry.registerAction(action);
-
- action = new AddXSDModelGroupDefinitionAction(this, false);
- action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDGroup.gif"));
- registry.registerAction(action);
-
- action = new AddXSDModelGroupDefinitionAction(this, true);
- action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/obj16/XSDGroupRef.gif"));
- registry.registerAction(action);
-
- action = new AddXSDComplexTypeDefinitionAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDComplexType.gif"));
- registry.registerAction(action);
-
- action = new AddXSDSimpleTypeDefinitionAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleType.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAttributeDeclarationAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.REF_ID, Messages._UI_ACTION_ADD_ATTRIBUTE_REF, true);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeRef.gif"));
- registry.registerAction(action);
-
- action = new OpenInNewEditor(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ShowPropertiesViewAction(this);
- registry.registerAction(action);
-
- action = new AddXSDAttributeGroupDefinitionAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeGroup.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAttributeGroupDefinitionAction(this, AddXSDAttributeGroupDefinitionAction.REF_ID);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeGroupRef.gif"));
- registry.registerAction(action);
-
- action = new DeleteXSDConcreteComponentAction(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new AddXSDAnyElementAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAny.gif"));
- registry.registerAction(action);
-
- action = new AddXSDAnyAttributeAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAnyAttribute.gif"));
- registry.registerAction(action);
-
- action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.INCLUDE_ID, Messages._UI_ACTION_ADD_INCLUDE);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDInclude.gif"));
- registry.registerAction(action);
-
- action = new AddXSDEnumerationFacetAction(this);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
- registry.registerAction(action);
-
- action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
- registry.registerAction(action);
-
- action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
- registry.registerAction(action);
-
- action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.IMPORT_ID, Messages._UI_ACTION_ADD_IMPORT);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDImport.gif"));
- registry.registerAction(action);
-
- action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.REDEFINE_ID, Messages._UI_ACTION_ADD_REDEFINE);
- action.setSelectionProvider(getSelectionManager());
- action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDRedefine.gif"));
- registry.registerAction(action);
-
- SetTypeAction setNewComplexTypeAction = new SetTypeAction(Messages._UI_ACTION_NEW, SetTypeAction.SET_NEW_TYPE_ID, this);
- setNewComplexTypeAction.setSelectionProvider(getSelectionManager());
-
- registry.registerAction(setNewComplexTypeAction);
-
- SetTypeAction setExistingTypeAction = new SetTypeAction(Messages._UI_ACTION_BROWSE, SetTypeAction.SELECT_EXISTING_TYPE_ID, this);
- setExistingTypeAction.setSelectionProvider(getSelectionManager());
- registry.registerAction(setExistingTypeAction);
-
- addMultiplicityMenu(registry);
-
- PrintAction printAction = new PrintAction(this);
- registry.registerAction(printAction);
-
- BaseDirectEditAction directEditAction = new BaseDirectEditAction(this);
- directEditAction.setSelectionProvider(getSelectionManager());
- registry.registerAction(directEditAction);
-
- }
- else
- {
- BaseSelectionAction action = new OpenInNewEditor(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
-
- action = new ShowPropertiesViewAction(this);
- registry.registerAction(action);
-
- PrintAction printAction = new PrintAction(this);
- registry.registerAction(printAction);
- }
- }
-
- protected void addMultiplicityMenu(ActionRegistry registry)
- {
- SetMultiplicityAction oneMultiplicity = new SetMultiplicityAction(this, "1..1 (" + Messages._UI_LABEL_REQUIRED + ")", SetMultiplicityAction.REQUIRED_ID); //$NON-NLS-1$ //$NON-NLS-2$
- oneMultiplicity.setMaxOccurs(1);
- oneMultiplicity.setMinOccurs(1);
- oneMultiplicity.setSelectionProvider(getSelectionManager());
- registry.registerAction(oneMultiplicity);
-
- SetMultiplicityAction zeroOrMoreMultiplicity = new SetMultiplicityAction(this, "0..* (" + Messages._UI_LABEL_ZERO_OR_MORE + ")", SetMultiplicityAction.ZERO_OR_MORE_ID); //$NON-NLS-1$ //$NON-NLS-2$
- zeroOrMoreMultiplicity.setMaxOccurs(-1);
- zeroOrMoreMultiplicity.setMinOccurs(0);
- zeroOrMoreMultiplicity.setSelectionProvider(getSelectionManager());
- registry.registerAction(zeroOrMoreMultiplicity);
-
- SetMultiplicityAction zeroOrOneMultiplicity = new SetMultiplicityAction(this, "0..1 (" + Messages._UI_LABEL_OPTIONAL + ")", SetMultiplicityAction.ZERO_OR_ONE_ID); //$NON-NLS-1$ //$NON-NLS-2$
- zeroOrOneMultiplicity.setMaxOccurs(1);
- zeroOrOneMultiplicity.setMinOccurs(0);
- zeroOrOneMultiplicity.setSelectionProvider(getSelectionManager());
- registry.registerAction(zeroOrOneMultiplicity);
-
- SetMultiplicityAction oneOrMoreMultiplicity = new SetMultiplicityAction(this, "1..* (" + Messages._UI_LABEL_ONE_OR_MORE + ")", SetMultiplicityAction.ONE_OR_MORE_ID); //$NON-NLS-1$ //$NON-NLS-2$
- oneOrMoreMultiplicity.setMaxOccurs(-1);
- oneOrMoreMultiplicity.setMinOccurs(1);
- oneOrMoreMultiplicity.setSelectionProvider(getSelectionManager());
- registry.registerAction(oneOrMoreMultiplicity);
-
- }
-
- /**
- * Listener on SSE's outline page's selections that converts DOM selections
- * into xsd selections and notifies XSD selection manager
- */
- class OutlineTreeSelectionChangeListener implements ISelectionChangedListener, IDoubleClickListener
- {
- public OutlineTreeSelectionChangeListener()
- {
- }
-
- private ISelection getXSDSelection(ISelection selection)
- {
- ISelection sel = null;
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- Object o = structuredSelection.getFirstElement();
- if (o != null)
- {
- sel = new StructuredSelection(o);
- }
-
- }
- return sel;
- }
-
- /**
- * Determines DOM node based on object (xsd node)
- *
- * @param object
- * @return
- */
- private Object getObjectForOtherModel(Object object)
- {
- Node node = null;
- if (object instanceof Node)
- {
- node = (Node) object;
- }
- else if (object instanceof XSDComponent)
- {
- node = ((XSDComponent) object).getElement();
- }
- else if (object instanceof RedefineCategoryAdapter)
- {
- node = ((RedefineCategoryAdapter) object).getXSDRedefine().getElement();
- }
- else if (object instanceof CategoryAdapter)
- {
- node = ((CategoryAdapter) object).getXSDSchema().getElement();
- }
- else if (object instanceof XSDBaseAdapter)
- {
- if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent)
- {
- node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement();
- }
- }
- // the text editor can only accept sed nodes!
- //
- if (!(node instanceof IDOMNode))
- {
- node = null;
- }
- return node;
- }
-
- public void doubleClick(DoubleClickEvent event)
- {
- /*
- * Selection in outline tree changed so set outline tree's selection into
- * editor's selection and say it came from outline tree
- */
- if (getSelectionManager() != null && getSelectionManager().getEnableNotify())
- {
- ISelection selection = getXSDSelection(event.getSelection());
- if (selection != null)
- {
- getSelectionManager().setSelection(selection, fOutlinePage);
- }
- if (getTextEditor() != null && selection instanceof IStructuredSelection)
- {
- int start = -1;
- int length = 0;
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o != null)
- o = getObjectForOtherModel(o);
- if (o instanceof IndexedRegion)
- {
- start = ((IndexedRegion) o).getStartOffset();
- length = ((IndexedRegion) o).getEndOffset() - start;
- }
- if (start > -1)
- {
- getTextEditor().selectAndReveal(start, length);
- }
- }
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- /*
- * Selection in outline tree changed so set outline tree's selection into
- * editor's selection and say it came from outline tree
- */
- if (getSelectionManager() != null && getSelectionManager().getEnableNotify())
- {
- ISelection selection = getXSDSelection(event.getSelection());
- if (selection != null)
- {
- getSelectionManager().setSelection(selection, fOutlinePage);
- }
- }
- }
- }
-
-
- /**
- * Listener on SSE's source editor's selections that converts DOM selections
- * into xsd selections and notifies XSD selection manager
- */
- private class SourceEditorSelectionListener implements ISelectionChangedListener
- {
- /**
- * Determines XSD node based on object (DOM node)
- *
- * @param object
- * @return
- */
- private Object getXSDNode(Object object)
- {
- // get the element node
- Element element = null;
- if (object instanceof Node)
- {
- Node node = (Node) object;
- if (node != null)
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- element = (Element) node;
- }
- else if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- element = ((Attr) node).getOwnerElement();
- }
- else if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE)
- {
- return model;
- }
- }
- }
- Object o = element;
- if (element != null)
- {
- Object modelObject = getXSDSchema().getCorrespondingComponent(element);
- if (modelObject != null)
- {
- o = modelObject;
- o = XSDAdapterFactory.getInstance().adapt((Notifier) modelObject);
- }
- }
- return o;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (getSelectionManager().getEnableNotify() && getActivePage() == 1)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- List xsdSelections = new ArrayList();
- for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();)
- {
- Object domNode = i.next();
- Object xsdNode = getXSDNode(domNode);
- if (xsdNode != null)
- {
- xsdSelections.add(xsdNode);
- }
- if (xsdNode instanceof XSDRedefineAdapter)
- return;
- }
- if (!xsdSelections.isEmpty())
- {
- StructuredSelection xsdSelection = new StructuredSelection(xsdSelections);
- getSelectionManager().setSelection(xsdSelection, getTextEditor().getSelectionProvider());
- }
- }
- }
- }
- }
- /**
- * Listener on XSD's selection manager's selections that converts XSD
- * selections into DOM selections and notifies SSE's selection provider
- */
- private class XSDSelectionManagerSelectionListener implements ISelectionChangedListener
- {
- /**
- * Determines DOM node based on object (xsd node)
- *
- * @param object
- * @return
- */
- private Object getObjectForOtherModel(Object object)
- {
- Node node = null;
- if (object instanceof Node)
- {
- node = (Node) object;
- }
- else if (object instanceof XSDComponent)
- {
- node = ((XSDComponent) object).getElement();
- }
- else if (object instanceof RedefineCategoryAdapter)
- {
- RedefineCategoryAdapter category = (RedefineCategoryAdapter)object;
- node = category.getXSDRedefine().getElement();
- }
- else if (object instanceof CategoryAdapter)
- {
- node = ((CategoryAdapter) object).getXSDSchema().getElement();
- }
- else if (object instanceof XSDBaseAdapter)
- {
- if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent)
- {
- node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement();
- }
- }
- else if (object instanceof String)
- {
- // This case was added to make the F3/hyperlink navigation work when an
- // inline schema from a WSDL document is opened in the schema editor.
- // The string is expected to be a URI fragment used to identify an XSD
- // component in the context of the enclosing WSDL resource.
-
- String uriFragment = (String) object;
- Resource resource = xsdSchema.eResource();
- EObject modelObject = resource.getEObject(uriFragment);
-
- if (modelObject != null && modelObject instanceof XSDComponent)
- {
- XSDComponent component = (XSDComponent) modelObject;
- node = component.getElement();
- }
- }
-
- // the text editor can only accept sed nodes!
- //
- if (!(node instanceof IDOMNode))
- {
- node = null;
- }
- return node;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- // do not fire selection in source editor if the current active page is the InternalXSDMultiPageEditor (source)
- // We only want to make source selections if the active page is either the outline or properties (a modify
- // has been done via the outline or properties and not the source view). We don't want to be selecting
- // and unselecting things in the source when editing in the source!!
- boolean makeSelection = true;
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page.getActivePart() instanceof InternalXSDMultiPageEditor) {
- if (getActiveEditor() instanceof StructuredTextEditor) {
- makeSelection = false;
- }
- }
- }
-
- // do not fire selection in source editor if selection event came
- // from source editor
- if (event.getSource() != getTextEditor().getSelectionProvider() && makeSelection)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- List otherModelObjectList = new ArrayList();
- for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();)
- {
- Object modelObject = i.next();
- Object otherModelObject = getObjectForOtherModel(modelObject);
- if (otherModelObject != null)
- {
- otherModelObjectList.add(otherModelObject);
- }
- }
- if (!otherModelObjectList.isEmpty())
- {
- // here's an ugly hack... if we allow text selections to fire during
- // SetInputToGraphView action we screw up the navigation history!
- //
- //TODO (cs) ... we need to prevent the source editor from messing up the navigation history
- //
- if (getActivePage() == SOURCE_PAGE_INDEX)
- {
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
- getTextEditor().getSelectionProvider().setSelection(nodeSelection);
- }
- }
- }
- }
- }
-
- public void doSetSelection()
- {
- ISelection iSelection = getSelectionManager().getSelection();
- if (iSelection != null)
- {
- Object firstElement = ((StructuredSelection)iSelection).getFirstElement();
- Object otherModelObject = getObjectForOtherModel(firstElement);
- if (otherModelObject != null)
- {
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObject);
- getTextEditor().getSelectionProvider().setSelection(nodeSelection);
- }
- }
- }
- }
-
- // Bug 145590. Workaround to update source position when flipping to the source page.
- // Unfortunately, this will still add an entry to the navigation history, but this
- // behaviour is an improvement than without this change
- boolean doUpdateSourceLocation = false;
- protected void pageChange(int newPageIndex)
- {
- super.pageChange(newPageIndex);
- doUpdateSourceLocation = newPageIndex == SOURCE_PAGE_INDEX;
- if (doUpdateSourceLocation && fXSDSelectionListener != null)
- fXSDSelectionListener.doSetSelection();
-
- }
-
- public void propertyChanged(Object source, int propId)
- {
- switch (propId)
- {
- // when refactor rename while file is open in editor, need to reset
- // editor contents to reflect new document
- case IEditorPart.PROP_INPUT:
- {
- if (source == structuredTextEditor && xsdSchema != null)
- {
- IStructuredModel structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
- try
- {
- if (structuredModel instanceof IDOMModel)
- {
- Document schemaDocument = xsdSchema.getDocument();
- Document domModelDocument = ((IDOMModel)structuredModel).getDocument();
- // if dom documents are not the same, they need to be reset
- if (schemaDocument != domModelDocument)
- {
- XSDModelAdapter modelAdapter = null;
- if (schemaDocument instanceof IDOMDocument)
- {
- // save this model adapter for cleanup later
- modelAdapter = (XSDModelAdapter) ((IDOMDocument)schemaDocument).getExistingAdapter(XSDModelAdapter.class);
- }
-
- // update multipage editor with new editor input
- IEditorInput editorInput = structuredTextEditor.getEditorInput();
- setInput(editorInput);
- setPartName(editorInput.getName());
- getCommandStack().markSaveLocation();
-
- // Now do the clean up model adapter
- if (modelAdapter != null)
- {
- modelAdapter.clear();
- modelAdapter = null;
- }
- }
- }
- }
- finally
- {
- if (structuredModel != null)
- structuredModel.releaseFromRead();
- }
- }
- break;
- }
- }
- super.propertyChanged(source, propId);
- }
-
- public INavigationLocation createEmptyNavigationLocation()
- {
- if (getActivePage() == 0)
- {
- return new DesignViewNavigationLocation(this);
- }
- else
- {
- return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), false);
- }
- }
-
- public INavigationLocation createNavigationLocation()
- {
- if (getActivePage() == DESIGN_PAGE_INDEX)
- {
- try
- {
- RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
- EditPart editPart = rootEditPart.getContents();
- if (editPart instanceof RootContentEditPart)
- {
- RootContentEditPart rootContentEditPart = (RootContentEditPart)editPart;
- Object input = rootContentEditPart.getInput();
- if (input instanceof Adapter)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent)((Adapter)input).getTarget();
-
- Object object = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ProductCustomizationProvider.class);
- if (object instanceof ProductCustomizationProvider)
- {
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
- if (productCustomizationProvider != null)
- {
- return productCustomizationProvider.getNavigationLocation(this, concreteComponent, rootContentEditPart);
- }
- }
- return new DesignViewNavigationLocation(this, concreteComponent);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return null;
- }
- else
- {
- return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), true);
- }
- }
-
-
- public void editorModeChanged(EditorMode newEditorMode)
- {
- //if (isInitializing)
- // return;
-
- EditPartFactory editPartFactory = newEditorMode.getEditPartFactory();
- if (editPartFactory != null)
- {
- graphicalViewer.setEditPartFactory(editPartFactory);
- if (graphicalViewer instanceof DesignViewGraphicalViewer)
- {
- DesignViewGraphicalViewer viewer = (DesignViewGraphicalViewer)graphicalViewer;
- IADTObject input = viewer.getInput();
- viewer.setInput(null);
- //viewer.getRootEditPart().refresh();
- // viewer.getRootEditPart().getContents().refresh();
- viewer.setInput(input);
-
- floatingToolbar.setEditPartFactory(editPartFactory);
- floatingToolbar.setModel(getModel());
- floatingToolbar.refresh(!(input instanceof IModel));
-
- Control control = graphicalViewer.getControl();
- if (control instanceof Composite)
- {
- Composite parent = ((Composite)control).getParent();
- parent.layout();
- }
- }
- }
- IContentProvider provider = newEditorMode.getOutlineProvider();
- if (provider != null)
- {
- ADTContentOutlinePage outline = (ADTContentOutlinePage)getContentOutlinePage();
- if (outline != null)
- {
- TreeViewer treeViewer = outline.getTreeViewer();
- if (treeViewer != null)
- {
- outline.getTreeViewer().setContentProvider(provider);
- outline.getTreeViewer().refresh();
- }
- }
- }
- }
-
- private static final String DEFAULT_EDITOR_MODE_ID = "org.eclipse.wst.xsd.ui.defaultEditorModeId"; //$NON-NLS-1$
- //private boolean isInitializing = false;
- protected EditorModeManager createEditorModeManager()
- {
- final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class);
- EditorModeManager manager = new EditorModeManager(XSD_EDITOR_MODE_EXTENSION_ID)
- {
- public void init()
- {
- if (productCustomizationProvider == null ||
- productCustomizationProvider.isEditorModeApplicable(TypeVizEditorMode.ID))
- {
- addMode(new TypeVizEditorMode());
- }
- super.init();
- }
-
- protected EditorMode getDefaultMode()
- {
- String defaultModeId = XSDEditorPlugin.getPlugin().getPreferenceStore().getString(DEFAULT_EDITOR_MODE_ID);
- if (defaultModeId != null)
- {
- EditorMode editorMode = getEditorMode(defaultModeId);
- if (editorMode != null)
- {
- return editorMode;
- }
- }
- return super.getDefaultMode();
- }
- };
- manager.setProductCustomizationProvider(productCustomizationProvider);
- return manager;
- }
-
- protected void storeCurrentModePreference(String id)
- {
- XSDEditorPlugin.getPlugin().getPreferenceStore().setValue(DEFAULT_EDITOR_MODE_ID, id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor)
- {
- XSDDirectivesManager.removeUnusedXSDImports(((XSDSchema)getAdapter(XSDSchema.class)));
- super.doSave(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSaveAs()
- */
- public void doSaveAs()
- {
- // When performing a save as, the document changes. Our model state listeners should listen
- // to the new document.
-
- // First get the current document
- IDocument currentDocument = getDocument();
- XSDModelAdapter modelAdapter = null;
- IDOMDocument doc = null;
- if (currentDocument != null)
- {
- IStructuredModel structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(currentDocument);
- if (structuredModel != null)
- {
- try
- {
- if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
- {
- // Get the associated IDOMDocument model
- doc = ((IDOMModel) structuredModel).getDocument();
- // and now get our adapter that listens to DOM changes
- if (doc != null)
- {
- modelAdapter = (XSDModelAdapter) doc.getExistingAdapter(XSDModelAdapter.class);
- }
- }
- }
- finally
- {
- structuredModel.releaseFromRead();
- }
- }
- }
-
- IEditorInput editorInput = structuredTextEditor.getEditorInput();
- // perform save as
- structuredTextEditor.doSaveAs();
- // if saveAs cancelled then don't setInput because the input hasn't change
- // See AbstractDecoratedTextEditor's performSaveAs
- if (editorInput != structuredTextEditor.getEditorInput())
- {
- setInput(structuredTextEditor.getEditorInput());
- setPartName(structuredTextEditor.getEditorInput().getName());
-
- getCommandStack().markSaveLocation();
-
- // Now do the clean up on the old document
- if (modelAdapter != null)
- {
- // clear out model adapter
- modelAdapter.clear();
- modelAdapter = null;
- }
- }
- }
-
- protected void doPostEditorOpenTasks()
- {
- // Bug 204868: do the selection after the editor part is created, so that
- // AbstractTextEditor.markInNavigationHistory() won't cause the creation
- // of its own editor part.
- // Select the schema to show the properties
- getSelectionManager().setSelection(new StructuredSelection(getModel()));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java
deleted file mode 100644
index c0fc8e3290..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.commands.XSDAttributeDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.commands.XSDElementDragAndDropCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-import org.eclipse.xsd.XSDWildcard;
-
-public class KeyboardDragImpl implements IKeyboardDrag
-{
- public void performKeyboardDrag(GraphicalEditPart movingElement, int direction)
- {
- KeyBoardAccessibilityEditPolicy policy = (KeyBoardAccessibilityEditPolicy) movingElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
-
- EditPart rightElement = policy.getRelativeEditPart(movingElement, direction);
- policy = (KeyBoardAccessibilityEditPolicy) rightElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
- EditPart leftElement = (policy != null) ? policy.getRelativeEditPart(rightElement, direction) : null;
-
- // TODO: add support for extenders
- if (!(movingElement instanceof XSDBaseFieldEditPart)) return;
-
- XSDBaseFieldEditPart movingField = (XSDBaseFieldEditPart) movingElement;
- XSDBaseFieldEditPart leftField = (XSDBaseFieldEditPart) leftElement;
- XSDBaseFieldEditPart rightField = (XSDBaseFieldEditPart) rightElement;
-
- Object movingObject = movingField.getModel();
-
- BaseDragAndDropCommand command = null;
- if (movingObject instanceof XSDElementDeclarationAdapter || movingObject instanceof XSDWildcard)
- {
- command = new XSDElementDragAndDropCommand(movingField, leftField, rightField, direction);
- }
- else if (movingObject instanceof XSDAttributeDeclarationAdapter)
- {
- command = new XSDAttributeDragAndDropCommand(movingField, leftField, rightField, direction);
- }
-
- if (command != null && command.canExecute())
- {
- command.execute();
- // This is to reselect the moved item
- try
- {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (editor != null && editor.getAdapter(ISelectionProvider.class) != null)
- {
- ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
- if (provider != null)
- {
- provider.setSelection(new StructuredSelection(movingElement.getModel()));
- }
- }
- }
- catch (Exception e)
- {
-
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java
deleted file mode 100644
index 41274520a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java
+++ /dev/null
@@ -1,157 +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.xsd.ui.internal.editor;
-
-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.xsd.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java
deleted file mode 100644
index c013f7414a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver, Standards for Technology in Automotive Retail, bug 1147033
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
- static
- {
- NLS.initializeMessages("org.eclipse.wst.xsd.ui.internal.editor.messages", Messages.class); //$NON-NLS-1$
- }
-
- public Messages()
- {
- super();
- }
-
- public static String UI_LABEL_BASE_TYPE;
- public static String UI_LABEL_DERIVED_BY;
- public static String UI_LABEL_INHERIT_FROM;
- public static String UI_LABEL_INHERIT_BY;
- public static String UI_LABEL_DOCUMENTATION;
- public static String UI_LABEL_APP_INFO;
- public static String UI_LABEL_SET_TYPE;
- public static String UI_LABEL_TYPE;
- public static String UI_LABEL_NAME;
- public static String UI_LABEL_KIND;
- public static String UI_LABEL_MINOCCURS;
- public static String UI_LABEL_MAXOCCURS;
- public static String UI_NO_TYPE;
- public static String UI_PAGE_HEADING_REFERENCE;
- public static String UI_LABEL_READ_ONLY;
- public static String UI_LABEL_COMPONENTS;
-
- public static String _UI_GRAPH_TYPES;
- public static String _UI_GRAPH_REDEFINE_TYPES;
- public static String _UI_GRAPH_ELEMENTS;
- public static String _UI_GRAPH_ATTRIBUTES;
- public static String _UI_GRAPH_ATTRIBUTE_GROUPS;
- public static String _UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS;
- public static String _UI_GRAPH_NOTATIONS;
- public static String _UI_GRAPH_IDENTITY_CONSTRAINTS;
- public static String _UI_GRAPH_ANNOTATIONS;
- public static String _UI_GRAPH_DIRECTIVES;
- public static String _UI_GRAPH_GROUPS;
- public static String _UI_GRAPH_REDEFINE_GROUPS;
-
- public static String _UI_LABEL_NO_LOCATION_SPECIFIED;
- public static String _UI_NO_TYPE_DEFINED;
- public static String _UI_ACTION_UPDATE_NAME;
- public static String _UI_LABEL_ABSENT;
- public static String _UI_ACTION_ADD_FIELD;
- public static String _UI_ACTION_SET_MULTIPLICITY;
- public static String _UI_LABEL_OPTIONAL;
- public static String _UI_LABEL_ZERO_OR_MORE;
- public static String _UI_LABEL_ONE_OR_MORE;
- public static String _UI_LABEL_REQUIRED;
- public static String _UI_LABEL_ARRAY;
- public static String _UI_ACTION_SET_TYPE;
- public static String _UI_LABEL_LOCAL_TYPE;
-
- public static String _UI_GRAPH_UNKNOWN_OBJECT;
- public static String _UI_GRAPH_XSDSCHEMA;
- public static String _UI_GRAPH_XSDSCHEMA_NO_NAMESPACE;
- public static String _UI_LABEL_SET_COMMON_BUILT_IN_TYPES;
- public static String _UI_LABEL_SELECT_TYPES_FILTER_OUT;
- public static String _UI_LABEL_NEW_TYPE;
- public static String _UI_VALUE_NEW_TYPE;
- public static String _UI_LABEL_COMPLEX_TYPE;
- public static String _UI_LABEL_SIMPLE_TYPE;
- public static String _UI_LABEL_NEW_ELEMENT;
- public static String _UI_LABEL_NEW_ATTRIBUTE;
- public static String _UI_MENU_XSD_EDITOR;
- public static String _UI_LABEL_SOURCE;
- public static String _UI_ACTION_BEFORE;
- public static String _UI_ACTION_AFTER;
- public static String _UI_ACTION_ADD_ELEMENT;
- public static String _UI_ACTION_INSERT_ELEMENT;
- public static String _UI_ACTION_ADD_ELEMENT_REF;
- public static String _UI_ACTION_NEW;
- public static String _UI_ACTION_BROWSE;
- public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE;
- public static String _UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE;
- public static String _UI_LABEL_TARGET_NAMESPACE;
- public static String _UI_LABEL_NO_NAMESPACE;
- public static String _UI_ACTION_ADD_COMPLEX_TYPE;
- public static String _UI_ACTION_ADD_SIMPLE_TYPE;
- public static String _UI_LABEL_NAME_SEARCH_FILTER_TEXT;
- public static String _UI_LABEL_ELEMENTS_COLON;
- public static String _UI_LABEL_ATTRIBUTES_COLON;
- public static String _UI_LABEL_ATTRIBUTES_PROCESSCONTENTS;
- public static String _UI_LABEL_ATTRIBUTES_NAMESPACE;
- public static String _UI_LABEL_SET_ELEMENT_REFERENCE;
- public static String _UI_LABEL_SET_ATTRIBUTE_REFERENCE;
- public static String _UI_LABEL_REDEFINE_COMPONENT;
- public static String _UI_LABEL_TYPES_COLON;
- public static String _UI_LABEL_SET_TYPE;
-
- public static String _UI_TEXT_INDENT_LABEL;
- public static String _UI_TEXT_INDENT_SPACES_LABEL;
- public static String _UI_TEXT_XSD_NAMESPACE_PREFIX;
- public static String _UI_TEXT_XSD_DEFAULT_PREFIX;
- public static String _UI_QUALIFY_XSD;
- public static String _UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE;
- public static String _UI_VALIDATING_FILES;
- public static String _UI_FULL_CONFORMANCE;
- public static String _UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS;
-
- public static String _ERROR_LABEL_INVALID_PREFIX;
- public static String _UI_ACTION_ADD_INCLUDE;
- public static String _UI_ACTION_ADD_IMPORT;
- public static String _UI_ACTION_ADD_REDEFINE;
- public static String _UI_ACTION_ADD_ATTRIBUTE;
- public static String _UI_ACTION_INSERT_ATTRIBUTE;
- public static String _UI_ACTION_ADD_ATTRIBUTE_REF;
- public static String _UI_ACTION_DRAG_DROP_ELEMENT;
- public static String _UI_ACTION_DRAG_DROP_ATTRIBUTE;
- public static String _UI_ACTION_REDEFINE_COMPLEX_TYPE;
- public static String _UI_ACTION_REDEFINE_SIMPLE_TYPE;
- public static String _UI_ACTION_REDEFINE_ATTRIBUTE_GROUP;
- public static String _UI_ACTION_REDEFINE_MODEL_GROUP;
- public static String _UI_ACTION_RENAME;
-
- public static String _UI_IMAGE_COMPLEX_TYPE;
- public static String _UI_IMAGE_SIMPLE_TYPE;
- public static String _UI_IMAGE_MODEL_GROUP;
- public static String _UI_IMAGE_ATTRIBUTE_GROUP;
-
- // TODO: TO REMOVE
- public static String _UI_LABEL_ELEMENTFORMDEFAULT;
- // TODO: TO REMOVE
- public static String _UI_LABEL_ATTRIBUTEFORMDEFAULT;
- public static String _UI_LABEL_CREATE_ANON_TYPE;
- public static String _UI_XML_TEXT_EDITOR_PREFS_LINK;
- public static String _UI_XML_VALIDATOR_PREFS_LINK;
-
- public static String _UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP;
- public static String _UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG;
- public static String _UI_GRAPH_REDEFINE_SCHEMA;
-
- public static String _UI_COMBO_NEW;
- public static String _UI_COMBO_BROWSE;
-
- public static String _UI_ERROR_INVALID_NAME;
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java
deleted file mode 100644
index d85ed36ce7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java
+++ /dev/null
@@ -1,58 +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.xsd.ui.internal.editor;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- *
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
- * manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
- * manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java
deleted file mode 100644
index 62ac66bbc9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java
+++ /dev/null
@@ -1,28 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * Configuration for editing XSD content type
- */
-public class StructuredTextViewerConfigurationXSD extends StructuredTextViewerConfigurationXML {
- protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
- Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
- targets.put("org.eclipse.wst.xsd.core.xsdsource", null); //$NON-NLS-1$
- return targets;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java
deleted file mode 100644
index df4cab657d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java
+++ /dev/null
@@ -1,96 +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.wst.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAttributeDeclarationCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeReferenceAndManagerDirectivesCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewAttributeDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDAttributeReferenceEditManager extends XSDElementReferenceEditManager implements ComponentReferenceEditManager
-{
- public XSDAttributeReferenceEditManager(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public IComponentDialog getBrowseDialog()
- {
- XSDSearchListDialogDelegate dialogDelegate =
- new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.ATTRIBUTE_META_NAME, currentFile, schemas);
- return dialogDelegate;
- }
-
- public IComponentDialog getNewDialog()
- {
- if (schemas.length > 0) {
- return new NewAttributeDialog(schemas[0]);
- }
- else {
- return new NewAttributeDialog();
- }
- }
-
- public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent)
- {
- XSDAttributeDeclaration concreteComponent = null;
- if (referencingObject instanceof Adapter)
- {
- Adapter adapter = (Adapter)referencingObject;
- if (adapter.getTarget() instanceof XSDAttributeDeclaration)
- {
- concreteComponent = (XSDAttributeDeclaration)adapter.getTarget();
- }
- }
- else if (referencingObject instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDAttributeDeclaration) referencingObject;
- }
- if (concreteComponent != null)
- {
- if (referencedComponent.isNew())
- {
- XSDAttributeDeclaration attributeDec = null;
- if (referencedComponent.getMetaName() == IXSDSearchConstants.ATTRIBUTE_META_NAME)
- {
- AddXSDAttributeDeclarationCommand command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, concreteComponent.getSchema());
- command.setNameToAdd(referencedComponent.getName());
- command.execute();
- attributeDec = (XSDAttributeDeclaration) command.getAddedComponent();
- }
- if (attributeDec != null)
- {
- Command command = new UpdateAttributeReferenceCommand(Messages._UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE, concreteComponent, attributeDec);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- else
- {
- Command command = new UpdateAttributeReferenceAndManagerDirectivesCommand(concreteComponent, referencedComponent.getName(), referencedComponent.getQualifier(), referencedComponent.getFile());
- command.setLabel(Messages._UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE);
- command.execute();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java
deleted file mode 100644
index 002aa768aa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDComplexTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeAndManagerDirectivesCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDComplexTypeBaseTypeEditManager extends XSDTypeReferenceEditManager
-{
- public XSDComplexTypeBaseTypeEditManager(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public ComponentSpecification[] getQuickPicks()
- {
- return super.getQuickPicks();
- }
-
- public IComponentDialog getBrowseDialog()
- {
- XSDSearchListDialogDelegate dialogDelegate = new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.TYPE_META_NAME, currentFile, schemas);
- return dialogDelegate;
- }
-
- // TODO common this up
- public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
- {
- XSDConcreteComponent concreteComponent = null;
- if (referencingObject instanceof Adapter)
- {
- Adapter adpater = (Adapter)referencingObject;
- if (adpater.getTarget() instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDConcreteComponent)adpater.getTarget();
- }
- }
- else if (referencingObject instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDConcreteComponent) referencingObject;
- }
-
- if (concreteComponent instanceof XSDComplexTypeDefinition)
- {
- if (component.isNew())
- {
- XSDTypeDefinition td = null;
- if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
- {
- AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand(Messages._UI_ACTION_ADD_COMPLEX_TYPE, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- td = command.getCreatedComplexType();
- }
- else
- {
- AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- td = command.getCreatedSimpleType();
- }
- if (td != null)
- {
- Command command = new SetBaseTypeCommand(concreteComponent, td);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- else
- {
- Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
- command.setLabel(Messages._UI_ACTION_SET_BASE_TYPE);
- command.execute();
- }
- }
- else if (concreteComponent instanceof XSDSimpleTypeDefinition)
- {
- if (component.isNew())
- {
- XSDTypeDefinition td = null;
- if (component.getMetaName() == IXSDSearchConstants.SIMPLE_TYPE_META_NAME)
- {
- AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- td = command.getCreatedSimpleType();
- }
- if (td != null)
- {
- Command command = new SetBaseTypeCommand(concreteComponent, td);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- else
- {
- Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
- command.execute();
- }
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java
deleted file mode 100644
index 332e199b31..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-/**
- *
- * Context Sensitive Help IDs
- *
- */
-public class XSDEditorCSHelpIds
-{
- public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui";
-
- public static final String REGEX_WIZARD_PAGE = PLUGIN_NAME + ".xsduw0010";
- public static final String REGEX_TOKEN_CONTENTS = PLUGIN_NAME + ".xsduw0020";
- public static final String REGEX_JUST_ONCE = PLUGIN_NAME + ".xsduw0030";
- public static final String REGEX_ZERO_OR_MORE = PLUGIN_NAME + ".xsduw0040";
- public static final String REGEX_ONE_OR_MORE = PLUGIN_NAME + ".xsduw0050";
- public static final String REGEX_OPTIONAL = PLUGIN_NAME + ".xsduw0060";
- public static final String REGEX_REPEAT_RADIO = PLUGIN_NAME + ".xsduw0070";
- public static final String REGEX_RANGE_RADIO = PLUGIN_NAME + ".xsduw0080";
- public static final String REGEX_REPEAT_FIELD = PLUGIN_NAME + ".xsduw0090";
- public static final String REGEX_RANGE_MINIMUM_FIELD = PLUGIN_NAME + ".xsduw0100";
- public static final String REGEX_RANGE_MAXIMUM_FIELD = PLUGIN_NAME + ".xsduw0110";
- public static final String REGEX_ADD_BUTTON = PLUGIN_NAME + ".xsduw0120";
- public static final String REGEX_CURRENT_VALUE = PLUGIN_NAME + ".xsduw0130";
-
- public static final String REGEX_TEST_PAGE = PLUGIN_NAME + ".xsduw0200";
- public static final String REGEX_SAMPLE_TEXT = PLUGIN_NAME + ".xsduw0210";
-
- public static final String RENAME_NEW_NAME = PLUGIN_NAME + ".xsduw0300";
- public static final String RENAME_UPDATE_REFERENCES = PLUGIN_NAME + ".xsduw0310";
-
- public static final String NEWTYPE_COMPLEXTYPE = PLUGIN_NAME + ".xsdud0010";
- public static final String NEWTYPE_SIMPLETYPE = PLUGIN_NAME + ".xsdud0020";
- public static final String NEWTYPE_NAME = PLUGIN_NAME + ".xsdud0030";
-
- public static final String SETTYPE_NAME = PLUGIN_NAME + ".xsdud0050"; // these 3 are in common.ui
- public static final String SETTYPE_TYPES = PLUGIN_NAME + ".xsdud0060";
- public static final String SETTYPE_SEARCHSCOPES = PLUGIN_NAME + ".xsdud0070";
-
- public static final String ADD_ENUMERATIONS__NO_NAME = PLUGIN_NAME + ".xsdud0090";
- public static final String ADD_ENUMERATIONS__DELIMITER_CHARS = PLUGIN_NAME + ".xsdud0100";
- public static final String ADD_ENUMERATIONS__PRESERVE_LEAD_AND_TRAIL_WHITESPACES = PLUGIN_NAME + ".xsdud0110";
-
- public static final String ADD_EXTENSIONS_COMPONENTS__EXTENSION_CATEGORIES = PLUGIN_NAME + ".xsdud0130";
- public static final String ADD_EXTENSIONS_COMPONENTS__AVAILABLE_COMPONENTS_TO_ADD = PLUGIN_NAME + ".xsdud0140";
- public static final String ADD_EXTENSIONS_COMPONENTS__ADD = PLUGIN_NAME + ".xsdud0150";
- public static final String ADD_EXTENSIONS_COMPONENTS__DELETE = PLUGIN_NAME + ".xsdud0160";
- public static final String ADD_EXTENSIONS_COMPONENTS__EDIT = PLUGIN_NAME + ".xsdud0170";
-
- public static final String ADD_CATEGORY__NAME = PLUGIN_NAME + ".xsdud0190";
- public static final String ADD_CATEGORY__SCHEMA = PLUGIN_NAME + ".xsdud0200"; // can't invoke help, this is a CLabel, not text Field
-
- public static final String XML_CATALOG_ENTRIES__ENTRIES_TREELIST = PLUGIN_NAME + ".xsdud0220";
- public static final String XML_CATALOG_ENTRIES__DETAILS = PLUGIN_NAME + ".xsdud0230";
-
- public static final String XMLSCHEMAFILES_PREFERENCES__QUALIFY_XMLSCHEMA_LANGUAGE_CONSTRUCTS = PLUGIN_NAME + ".xsduf0010";
- public static final String XMLSCHEMAFILES_PREFERENCES__XML_SCHEMA_LANGUAGE_CONSTRUCTS_PREFIX = PLUGIN_NAME + ".xsduf0020";
- public static final String XMLSCHEMAFILES_PREFERENCES__DEFAULT_TARGETNAMESPACE = PLUGIN_NAME + ".xsduf0030";
- public static final String XMLSCHEMAFILES_PREFERENCES__HONOUR_ALL_SCHEMA_LOCATIONS = PLUGIN_NAME + ".xsduf0040";
- public static final String XMLSCHEMAFILES_PREFERENCES__IMPORT_CLEANUP = PLUGIN_NAME + ".xsduf0050";
-
- public static final String DOCUMENTATION_TAB__NO_LABEL = PLUGIN_NAME + ".xsdup0010";
-
- public static final String EXTENSIONS_TAB__EXTENSIONS = PLUGIN_NAME + ".xsdup0030";
- public static final String EXTENSIONS_TAB__ADD = PLUGIN_NAME + ".xsdup0040";
- public static final String EXTENSIONS_TAB__DELETE = PLUGIN_NAME + ".xsdup0050";
- public static final String EXTENSIONS_TAB__EXTENSIONS_DETAILS = PLUGIN_NAME + ".xsdup0060";
-
- public static final String CONSTRAINTS_TAB__MINIMUM_LENGTH = PLUGIN_NAME + ".xsdup0080";
- public static final String CONSTRAINTS_TAB__MAXIMUM_LENGTH = PLUGIN_NAME + ".xsdup0090";
- public static final String CONSTRAINTS_TAB__COLLAPSE_WHITESPACE = PLUGIN_NAME + ".xsdup0100";
- public static final String CONSTRAINTS_TAB__ENUMERATIONS = PLUGIN_NAME + ".xsdup0110";
- public static final String CONSTRAINTS_TAB__PATTERNS = PLUGIN_NAME + ".xsdup0120";
- public static final String CONSTRAINTS_TAB__NO_LABEL = PLUGIN_NAME + ".xsdup0130";
-
- public static final String GENERAL_TAB__SCHEMA__PREFIX = PLUGIN_NAME + ".xsdup0200";
- public static final String GENERAL_TAB__SCHEMA__TARGETNAMESPACE = PLUGIN_NAME + ".xsdup0210";
- public static final String GENERAL_TAB__SCHEMA__ADVANCED = PLUGIN_NAME + ".xsdup0220";
-
- public static final String ADVANCE_TAB__SCHEMA_ELEMENT_FORM_DEFAULT = PLUGIN_NAME + ".xsdup0450";
- public static final String ADVANCE_TAB__SCHEMA_ATTRIBUTE_FORM_DEFAULT = PLUGIN_NAME + ".xsdup0460";
- public static final String ADVANCE_TAB__SCHEMA_BLOCK_DEFAULT = PLUGIN_NAME + ".xsdup0470";
- public static final String ADVANCE_TAB__SCHEMA_FINAL_DEFAULT = PLUGIN_NAME + ".xsdup0480";
-
- public static final String GENERAL_TAB__ELEMENT__NAME = PLUGIN_NAME + ".xsdup0230";
- public static final String GENERAL_TAB__ELEMENT__TYPE = PLUGIN_NAME + ".xsdup0240";
- public static final String GENERAL_TAB__ELEMENT__REFERENCE = PLUGIN_NAME + ".xsdup0250";
- public static final String GENERAL_TAB__ELEMENT__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180";
- public static final String GENERAL_TAB__ELEMENT__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190";
-
- public static final String GENERAL_TAB__COMPLEX_TYPE__NAME = PLUGIN_NAME + ".xsdup0260";
- public static final String GENERAL_TAB__COMPLEX_TYPE__INHERIT_FROM = PLUGIN_NAME + ".xsdup0270";
- public static final String GENERAL_TAB__COMPLEX_TYPE__INHERIT_BY = PLUGIN_NAME + ".xsdup0280";
-
- public static final String GENERAL_TAB__SIMPLE_TYPE__NAME = PLUGIN_NAME + ".xsdup0290";
- public static final String GENERAL_TAB__SIMPLE_TYPE__VARIETY = PLUGIN_NAME + ".xsdup0300";
- public static final String GENERAL_TAB__SIMPLE_TYPE__BASE_TYPE = PLUGIN_NAME + ".xsdup0310";
-
- public static final String GENERAL_TAB__ATTRIBUTE__NAME = PLUGIN_NAME + ".xsdup0320";
- public static final String GENERAL_TAB__ATTRIBUTE__TYPE = PLUGIN_NAME + ".xsdup0330";
-
- public static final String GENERAL_TAB__ATTRIBUTEGROUP__NAME = PLUGIN_NAME + ".xsdup0340";
-
- public static final String GENERAL_TAB__MODELGROUP_DEFINITION__NAME = PLUGIN_NAME + ".xsdup0350";
-
- public static final String GENERAL_TAB__INCLUDE_REDEFINE__SCHEMALOCATION = PLUGIN_NAME + ".xsdup0360";
-
- public static final String GENERAL_TAB__IMPORT__SCHEMALOCATION = PLUGIN_NAME + ".xsdup0370";
- public static final String GENERAL_TAB__IMPORT__NAMESPACE = PLUGIN_NAME + ".xsdup0380";
- public static final String GENERAL_TAB__IMPORT__PREFIX = PLUGIN_NAME + ".xsdup0390";
-
- public static final String GENERAL_TAB__ANYELEMENT__NAMESPACE = PLUGIN_NAME + ".xsdup0400";
- public static final String GENERAL_TAB__ANYELEMENT__PROCESSCONTENTS = PLUGIN_NAME + ".xsdup0410";
- public static final String GENERAL_TAB__ANYELEMENT__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180";
- public static final String GENERAL_TAB__ANYELEMENT__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190";
-
- public static final String GENERAL_TAB__ANYATTRIBUTE__NAMESPACE = PLUGIN_NAME + ".xsdup0400"; // these 4 are not used, same as anyelement above
- public static final String GENERAL_TAB__ANYATTRIBUTE__PROCESSCONTENTS = PLUGIN_NAME + ".xsdup0410";
- public static final String GENERAL_TAB__ANYATTRIBUTE__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180";
- public static final String GENERAL_TAB__ANYATTRIBUTE__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190";
-
- public static final String GENERAL_TAB__MODELGROUP__KIND = PLUGIN_NAME + ".xsdup0420";
- public static final String GENERAL_TAB__MODELGROUP__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180"; //can't invoke help
- public static final String GENERAL_TAB__MODELGROUP__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190"; // can't invoke help
-
- public static final String GENERAL_TAB__MODELGROUP_REFS__REF = PLUGIN_NAME + ".xsdup0430";
-
- public static final String GENERAL_TAB__ATTRIBUTEGROUP_REFS__REF = PLUGIN_NAME + ".xsdup0440";
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java
deleted file mode 100644
index 89e5800fdd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java
+++ /dev/null
@@ -1,192 +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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorConfiguration
-{
- public static final String XSDEDITORCONFIGURATIONEXTENSIONID = "org.eclipse.wst.xsd.ui.XSDEditorExtensionConfiguration"; //$NON-NLS-1$
- public static final String INTERNALEDITORCONFIGURATION_EXTENSIONID = "org.eclipse.wst.xsd.ui.internalEditorConfiguration"; //$NON-NLS-1$
- public static final String CLASSNAME = "class"; //$NON-NLS-1$
- public static final String ADAPTERFACTORY = "adapterFactory"; //$NON-NLS-1$
- public static final String TOOLBARACTION = "toolbarAction"; //$NON-NLS-1$
- public static final String FIGUREFACTORY = "figureFactory"; //$NON-NLS-1$
- public static final String EDITPARTFACTORY = "editPartFactory"; //$NON-NLS-1$
-
- List definedExtensionsList = null;
-
- public XSDEditorConfiguration()
- {
-
- }
-
- public XSDAdapterFactory getAdapterFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getAdapterFactory();
- }
- return null;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getEditPartFactory();
- }
- return null;
- }
-
- public IExtendedFigureFactory getFigureFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getFigureFactory();
- }
- return null;
- }
-
- public List getToolbarActions()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getActionList();
- }
- return Collections.EMPTY_LIST;
- }
-
- protected Object loadClass(IConfigurationElement element, String classString)
- {
- String pluginId = element.getDeclaringExtension().getContributor().getName();
-
- try
- {
- Class theClass = Platform.getBundle(pluginId).loadClass(classString);
- Object instance = theClass.newInstance();
-
- return instance;
- }
- catch (Exception e)
- {
-
- }
- return null;
- }
-
- public void readXSDConfigurationRegistry()
- {
- definedExtensionsList = new ArrayList();
- updateList(INTERNALEDITORCONFIGURATION_EXTENSIONID);
- updateList(XSDEDITORCONFIGURATIONEXTENSIONID);
- }
-
- private void updateList(String ID)
- {
- IConfigurationElement[] xsdEditorExtensionList = Platform.getExtensionRegistry().getConfigurationElementsFor(ID);
- boolean definedExtensionsExist = (xsdEditorExtensionList != null && xsdEditorExtensionList.length > 0);
-
- if (definedExtensionsExist)
- {
-
- for (int i = 0; i < xsdEditorExtensionList.length; i++)
- {
- XSDEditorExtensionProperties properties = new XSDEditorExtensionProperties();
- definedExtensionsList.add(properties);
-
- IConfigurationElement element = xsdEditorExtensionList[i];
- String adapterFactoryClass = element.getAttribute(ADAPTERFACTORY);
- if (adapterFactoryClass != null)
- {
- Object object = loadClass(element, adapterFactoryClass);
- XSDAdapterFactory adapterFactory = null;
- if (object instanceof XSDAdapterFactory)
- {
- adapterFactory = (XSDAdapterFactory) object;
- properties.setAdapterFactory(adapterFactory);
- }
- }
-
- String figureFactoryClass = element.getAttribute(FIGUREFACTORY);
- if (figureFactoryClass != null)
- {
- Object object = loadClass(element, figureFactoryClass);
- IExtendedFigureFactory figureFactory = null;
- if (object instanceof IExtendedFigureFactory)
- {
- figureFactory = (IExtendedFigureFactory) object;
- properties.setFigureFactoryList(figureFactory);
- }
- }
-
- IConfigurationElement[] toolbarActions = element.getChildren(TOOLBARACTION);
- List actionList = new ArrayList();
- if (toolbarActions != null)
- {
- for (int j = 0; j < toolbarActions.length; j++)
- {
- IConfigurationElement actionElement = toolbarActions[j];
- String actionClass = actionElement.getAttribute(CLASSNAME);
- IXSDToolbarAction action = null;
- if (actionClass != null)
- {
- Object object = loadClass(actionElement, actionClass);
- if (object instanceof IXSDToolbarAction)
- {
- action = (IXSDToolbarAction) object;
- actionList.add(action);
- }
- }
- }
- }
- properties.setActionList(actionList);
-
- String editPartFactoryClass = element.getAttribute(EDITPARTFACTORY);
- if (editPartFactoryClass != null)
- {
- Object object = loadClass(element, editPartFactoryClass);
- EditPartFactory editPartFactory = null;
- if (object instanceof EditPartFactory)
- {
- editPartFactory = (EditPartFactory) object;
- properties.setEditPartFactoryList(editPartFactory);
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
deleted file mode 100644
index 2f1bc757af..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-/**
- * Context help id constants.
- */
-public interface XSDEditorContextIds
-{
- public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal";
-
- /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */
-
- /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */
-
- /* CONTEXT_ID xsde0010 for XSD Editor Design View */
- public static final String XSDE_SCHEMA_DESIGN_VIEW = PLUGIN_NAME + ".xsde0010";
- /* no CONTEXT_ID for File Name Text Edit (not editable) */
- /* CONTEXT_ID xsde0020 for Version Text Edit */
- public static final String XSDE_SCHEMA_VERSION = PLUGIN_NAME + ".xsde0020";
- /* CONTEXT_ID xsde0030 for Language Text Edit */
- public static final String XSDE_SCHEMA_LANGUAGE = PLUGIN_NAME + ".xsde0030";
- /* CONTEXT_ID xsde0040 for Namespace Group */
- public static final String XSDE_SCHEMA_NAMESPACE_GROUP = PLUGIN_NAME + ".xsde0040";
- /* CONTEXT_ID xsde0050 for Prefix Text Edit */
- public static final String XSDE_SCHEMA_PREFIX = PLUGIN_NAME + ".xsde0050";
- /* CONTEXT_ID xsde0060 for Target namespace Text Edit */
- public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060";
- /* CONTEXT_ID xsde0070 for Apply Push Button */
- public static final String XSDE_SCHEMA_APPLY = PLUGIN_NAME + ".xsde0070";
- /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */
- public static final String XSDE_SCHEMA_ATTRIBUTE = PLUGIN_NAME + ".xsde0080";
- /* CONTEXT_ID xsde0090 for Element form default Combo Box */
- public static final String XSDE_SCHEMA_ELEMENT = PLUGIN_NAME + ".xsde0090";
- /* CONTEXT_ID xsde0100 for Block default Combo Box */
- public static final String XSDE_SCHEMA_BLOCK = PLUGIN_NAME + ".xsde0100";
- /* CONTEXT_ID xsde0110 for Final Default Combo Box */
- public static final String XSDE_SCHEMA_FINAL = PLUGIN_NAME + ".xsde0110";
-
-
- /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */
- /* CONTEXT_ID - used in Documentation Design View */
- /* CONTEXT_ID - used in App Info Design View */
- public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200";
- /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */
- /* CONTEXT_ID - used in Documentation Design View */
- /* CONTEXT_ID - used in App Info Design View */
- public static final String XSDE_ANNOTATION_COMMENT = PLUGIN_NAME + ".xsde0210";
-
- /* CONTEXT_ID xsde0300 for Documentation Design View */
- public static final String XSDE_DOCUMENTATION_DESIGN_VIEW = PLUGIN_NAME + ".xsde0300";
- /* CONTEXT_ID xsde0310 for Source Text Edit */
- public static final String XSDE_DOCUMENTATION_SOURCE = PLUGIN_NAME + ".xsde0310";
- /* CONTEXT_ID xsde0320 for Language Text Edit */
- public static final String XSDE_DOCUMENTATION_LANGUAGE = PLUGIN_NAME + ".xsde0320";
- /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
- /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
- /* CONTEXT_ID xsde0400 for App Info Design View */
- public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400";
- /* CONTEXT_ID xsde0410 for App Info Source Text Edit */
- public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410";
- /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
- /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
- /* CONTEXT_ID xsde0500 for Complex Type Design View */
- public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500";
- /* CONTEXT_ID xsde0510 for Name Text Edit */
- public static final String XSDE_COMPLEX_NAME = PLUGIN_NAME + ".xsde0510";
- /* CONTEXT_ID xsde0520 for Abstract Combo Box */
- public static final String XSDE_COMPLEX_ABSTRACT = PLUGIN_NAME + ".xsde0520";
- /* CONTEXT_ID xsde0530 for Mixed Combo Box */
- public static final String XSDE_COMPLEX_MIXED = PLUGIN_NAME + ".xsde0530";
- /* CONTEXT_ID xsde0540 for Block Combo Box */
- public static final String XSDE_COMPLEX_BLOCK = PLUGIN_NAME + ".xsde0540";
- /* CONTEXT_ID xsde0550 for Final Combo Box */
- public static final String XSDE_COMPLEX_FINAL = PLUGIN_NAME + ".xsde0550";
-
- /* CONTEXT_ID xsde0600 for Simple Type Design View */
- public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600";
- /* CONTEXT_ID xsde0610 for Name Text Edit */
- public static final String XSDE_SIMPLE_NAME = PLUGIN_NAME + ".xsde0610";
-
- /* CONTEXT_ID for Global Element and Element Design Views are the same */
- /* CONTEXT_ID xsde0700 for Element Design View */
- public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700";
- /* CONTEXT_ID xsde0710 for Element Name Text Edit */
- public static final String XSDE_ELEMENT_NAME = PLUGIN_NAME + ".xsde0710";
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde0720 for Abstract Check Box */
- public static final String XSDE_ELEMENT_ABSTRACT = PLUGIN_NAME + ".xsde0720";
- /* CONTEXT_ID xsde0730 for Nillable Check Box */
- public static final String XSDE_ELEMENT_NILLABLE = PLUGIN_NAME + ".xsde0730";
- /* CONTEXT_ID xsde0740 for Value Group */
- public static final String XSDE_ELEMENT_VALUE = PLUGIN_NAME + ".xsde0740";
- /* CONTEXT_ID xsde0750 for Fixed Radio Button */
- public static final String XSDE_ELEMENT_FIXED = PLUGIN_NAME + ".xsde0750";
- /* CONTEXT_ID xsde0760 for Default Radio Button */
- public static final String XSDE_ELEMENT_DEFAULT = PLUGIN_NAME + ".xsde0760";
- /* CONTEXT_ID xsde0770 for Value Group */
- public static final String XSDE_ELEMENT_VALUE_GROUP = PLUGIN_NAME + ".xsde0770";
- /* CONTEXT_ID xsde0780 for Minimum Text Edit */
- public static final String XSDE_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde0780";
- /* CONTEXT_ID xsde0790 for Maximum Text Edit */
- public static final String XSDE_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde0790";
- /* CONTEXT_ID xsde0800 for Block Combo Box */
- public static final String XSDE_ELEMENT_BLOCK = PLUGIN_NAME + ".xsde0800";
- /* CONTEXT_ID xsde0810 for Final Combo Box */
- public static final String XSDE_ELEMENT_FINAL = PLUGIN_NAME + ".xsde0810";
- /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */
- public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820";
- /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */
- public static final String XSDE_ELEMENT_FORM = PLUGIN_NAME + ".xsde0830";
-
- /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_GROUP = PLUGIN_NAME + ".xsde0900";
- /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_NONE = PLUGIN_NAME + ".xsde0910";
- /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920";
- /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930";
- /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940";
- /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950";
-
- /* CONTEXT_ID xsde1000 for Attribute Design View */
- public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000";
- /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */
- public static final String XSDE_ATTRIBUTE_NAME = PLUGIN_NAME + ".xsde1010";
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1020 for Value Group */
- public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020";
- /* CONTEXT_ID xsde1030 for Fixed Radio Button */
- public static final String XSDE_ATTRIBUTE_FIXED = PLUGIN_NAME + ".xsde1030";
- /* CONTEXT_ID xsde1040 for Default Radio Button */
- public static final String XSDE_ATTRIBUTE_DEFAULT = PLUGIN_NAME + ".xsde1040";
- /* CONTEXT_ID xsde1050 for Value Text Edit */
- public static final String XSDE_ATTRIBUTE_VALUE = PLUGIN_NAME + ".xsde1050";
- /* CONTEXT_ID xsde1060 for Usage Combo Box */
- public static final String XSDE_ATTRIBUTE_USAGE = PLUGIN_NAME + ".xsde1060";
- /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */
- public static final String XSDE_ATTRIBUTE_FORM = PLUGIN_NAME + ".xsde1070";
-
- /* CONTEXT_ID xsde1100 for Element Ref Window Design View */
- public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100";
- /* CONTEXT_ID xsde1110 for Reference Name Combo Box */
- public static final String XSDE_ELEMENT_REF_REFERENCE = PLUGIN_NAME + ".xsde1110";
- /* CONTEXT_ID xsde1120 for Minimum Text Edit */
- public static final String XSDE_ELEMENT_REF_MINIMUM = PLUGIN_NAME + ".xsde1120";
- /* CONTEXT_ID xsde1130 for Maximum Text Edit */
- public static final String XSDE_ELEMENT_REF_MAXIMUM = PLUGIN_NAME + ".xsde1130";
-
- /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Complex Content Design View */
- public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Complex Content Design View */
- public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210";
-
- /* CONTEXT_ID xsde1300 for Restriction Design View */
- public static final String XSDE_RESTRICTION_DESIGN_VIEW = PLUGIN_NAME + ".xsde1300";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1310 for Facets Group */
- public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310";
- /* CONTEXT_ID xsde1320 for Facets Table */
- public static final String XSDE_RESTRICTION_FACETS = PLUGIN_NAME + ".xsde1320";
-
- /* CONTEXT_ID xsde1400 for List Design View */
- public static final String XSDE_LIST_DESIGN_VIEW = PLUGIN_NAME + ".xsde1400";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
- /* CONTEXT_ID xsde1500 for Attribute Group Design View */
- public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500";
- /* CONTEXT_ID xsde1510 for Name Text Edit */
- public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510";
-
- /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */
- /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */
- public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600";
- /* CONTEXT_ID xsde1610 for Reference Name Combo Box */
- public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610";
-
- /* CONTEXT_ID xsde1700 for Attribute Reference Design View */
- public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700";
- /* CONTEXT_ID xsde1710 for Reference Name Combo Box */
- public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710";
-
- /* CONTEXT_ID xsde1800 for Pattern Design View */
- public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800";
- /* CONTEXT_ID xsde1810 for Value Text Edit */
- public static final String XSDE_PATTERN_VALUE = PLUGIN_NAME + ".xsde1810";
- /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */
- public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820";
-
- /* CONTEXT_ID xsde1900 for Enum Design View */
- public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900";
- /* CONTEXT_ID xsde1910 for Value Text Edit */
- public static final String XSDE_ENUM_VALUE = PLUGIN_NAME + ".xsde1910";
-
- /* CONTEXT_ID xsde2000 for Include Design Page */
- public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
- /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */
- /* CONTEXT_ID - used in Include Design View */
- /* CONTEXT_ID - used in Import Design View */
- public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100";
-
- /* CONTEXT_ID xsde2200 for Import Design Page */
- public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
- /* CONTEXT_ID xsde2210 for Prefix Text Edit */
- public static final String XSDE_IMPORT_PREFIX = PLUGIN_NAME + ".xsde2210";
- /* no CONTEXT_ID for Namespace Text Edit (not editable) */
-
- /* CONTEXT_ID xsde2300 for Redefine Design View */
- public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
- /* CONTEXT_ID xsde2400 for Group Design View */
- public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400";
- /* CONTEXT_ID xsde2410 for Name Text Edit */
- public static final String XSDE_GROUP_NAME = PLUGIN_NAME + ".xsde2410";
-
- /* CONTEXT_ID xsde2500 for Group Scope Design View */
- public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2500";
- /* CONTEXT_ID xsde2510 for Content model Group */
- public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510";
- /* CONTEXT_ID xsde2520 for Sequence Radio Button */
- public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520";
- /* CONTEXT_ID xsde2530 for Choice Radio Button */
- public static final String XSDE_GROUP_SCOPE_CHOICE = PLUGIN_NAME + ".xsde2530";
- /* CONTEXT_ID xsde2540 for All Radio Button */
- public static final String XSDE_GROUP_SCOPE_ALL = PLUGIN_NAME + ".xsde2540";
- /* CONTEXT_ID xsde2550 for Minimum Text Edit */
- public static final String XSDE_GROUP_SCOPE_MINIMUM = PLUGIN_NAME + ".xsde2550";
- /* CONTEXT_ID xsde2560 for Maximum Text Edit*/
- public static final String XSDE_GROUP_SCOPE_MAXIMUM = PLUGIN_NAME + ".xsde2560";
-
- /* CONTEXT_ID xsde2600 for Group Ref Design View */
- public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600";
- /* CONTEXT_ID xsde2610 for Reference name Combo Box */
- public static final String XSDE_GROUP_REF_REFERENCE = PLUGIN_NAME + ".xsde2610";
- /* CONTEXT_ID xsde2620 for Minimum Text Edit */
- public static final String XSDE_GROUP_REF_MINIMUM = PLUGIN_NAME + ".xsde2620";
- /* CONTEXT_ID xsde2630 for Maximum Text Edit */
- public static final String XSDE_GROUP_REF_MAXIMUM = PLUGIN_NAME + ".xsde2630";
-
- /* CONTEXT_ID xsde2700 for Unique Design View */
- public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
- /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800";
- /* CONTEXT_ID xsde2810 for Selector Group - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810";
- /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SELECTOR = PLUGIN_NAME + ".xsde2820";
- /* CONTEXT_ID xsde2830 for Fields Group - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP = PLUGIN_NAME + ".xsde2830";
- /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SOURCE = PLUGIN_NAME + ".xsde2840";
- /* CONTEXT_ID xsde2850 for Add Push Button - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_ADD = PLUGIN_NAME + ".xsde2850";
- /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_REMOVE = PLUGIN_NAME + ".xsde2860";
- /* CONTEXT_ID xsde2870 for Target List Box - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_TARGET = PLUGIN_NAME + ".xsde2870";
-
- /* CONTEXT_ID xsde2900 for Key Design View */
- public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
- /* CONTEXT_ID xsde2900 for Key Design View */
-
- /* CONTEXT_ID xsde2950 for Key Ref Design View */
- public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID xsde2960 for Reference Key Combo Box */
- public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960";
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
- /* CONTEXT_ID xsde3000 for Any Element Design View */
- public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000";
- /* CONTEXT_ID xsde3010 for Namespace Text Edit */
- public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010";
- /* CONTEXT_ID xsde3020 for Process Contents Combo Box */
- public static final String XSDE_ANY_ELEMENT_PROCESS = PLUGIN_NAME + ".xsde3020";
- /* CONTEXT_ID xsde3030 for Minimum Text Edit */
- public static final String XSDE_ANY_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde3030";
- /* CONTEXT_ID xsde3040 for Maximum Text Edit */
- public static final String XSDE_ANY_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde3040";
-
- /* CONTEXT_ID xsde3100 for Any Attribute Design View */
- public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100";
- /* CONTEXT_ID xsde3110 for Namespace Text Edit */
- public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110";
- /* CONTEXT_ID xsde3120 for Process Contents Combo Box */
- public static final String XSDE_ANY_ATTRIBUTE_PROCESS = PLUGIN_NAME + ".xsde3120";
-
- /* no CONTEXT_ID for Union Design View - uses a generic interface */
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
- /* CONTEXT_ID xsde3200 for Notation Design View */
- public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200";
-
- /* CONTEXT_ID xsde4000 for Source View */
- public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000";
-
- /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */
-
- /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */
- public static final String XSDR_COMPOSITION_PAGE = PLUGIN_NAME + ".xsdr0010";
- /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */
- public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015";
- /* CONTEXT_ID xsdr0020 for Occurrece Group */
- public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020";
- /* CONTEXT_ID xsdr0030 for Just once Radio Button */
- public static final String XSDR_COMPOSITION_JUST_ONCE = PLUGIN_NAME + ".xsdr0030";
- /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */
- public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040";
- /* CONTEXT_ID xsdr0050 for One or more Radio Button */
- public static final String XSDR_COMPOSITION_ONE_OR_MORE = PLUGIN_NAME + ".xsdr0050";
- /* CONTEXT_ID xsdr0060 for Optional Radio Button */
- public static final String XSDR_COMPOSITION_OPTIONAL = PLUGIN_NAME + ".xsdr0060";
- /* CONTEXT_ID xsdr0070 for Repeat Radio Button */
- public static final String XSDR_COMPOSITION_REPEAT = PLUGIN_NAME + ".xsdr0070";
- /* CONTEXT_ID xsdr0080 for Range Radio Button */
- public static final String XSDR_COMPOSITION_RANGE = PLUGIN_NAME + ".xsdr0080";
- /* CONTEXT_ID xsdr0090 for Repeat Text Edit */
- public static final String XSDR_COMPOSITION_REPEAT_TEXT = PLUGIN_NAME + ".xsdr0090";
- /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */
- public static final String XSDR_COMPOSITION_RANGE_MIN = PLUGIN_NAME + ".xsdr0100";
- /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */
- public static final String XSDR_COMPOSITION_RANGE_MAX = PLUGIN_NAME + ".xsdr0110";
- /* CONTEXT_ID xsdr0120 for Add Push Button */
- public static final String XSDR_COMPOSITION_ADD = PLUGIN_NAME + ".xsdr0120";
- /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */
- public static final String XSDR_COMPOSITION_CURRENT = PLUGIN_NAME + ".xsdr0130";
-
- /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */
- public static final String XSDR_TEST_PAGE = PLUGIN_NAME + ".xsdr0200";
- /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */
- /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */
- public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210";
-
- /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */
-
- /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
- public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
- /* CONTEXT_ID xsdp0020 for XML Schema Editor Preferences Page */
- public static final String XSDP_EDITOR_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0020";
- /* CONTEXT_ID xsdp0030 for XML Schema Validator Preferences Page */
- public static final String XSDP_VALIDATOR_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0030";
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java
deleted file mode 100644
index f87139aeaf..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.editor;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorExtensionProperties
-{
- XSDAdapterFactory adapterFactory;
- IExtendedFigureFactory figureFactory;
- EditPartFactory editPartFactory;
- List actionList;
-
- public XSDEditorExtensionProperties()
- {
-
- }
-
- public void setActionList(List actionList)
- {
- this.actionList = actionList;
- }
-
- public void setAdapterFactory(XSDAdapterFactory adapterFactory)
- {
- this.adapterFactory = adapterFactory;
- }
-
- public void setEditPartFactoryList(EditPartFactory editPartFactory)
- {
- this.editPartFactory = editPartFactory;
- }
-
- public void setFigureFactoryList(IExtendedFigureFactory figureFactory)
- {
- this.figureFactory = figureFactory;
- }
-
- public List getActionList()
- {
- return actionList;
- }
-
- public XSDAdapterFactory getAdapterFactory()
- {
- return adapterFactory;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- return editPartFactory;
- }
-
- public IExtendedFigureFactory getFigureFactory()
- {
- return figureFactory;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java
deleted file mode 100644
index 010b4193b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.editor;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.*;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.*;
-
-public class XSDEditorPlugin extends AbstractUIPlugin
-{
- public static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$
- public static final String EDITOR_ID = "org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"; //$NON-NLS-1$
- public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText"; //$NON-NLS-1$
- public static final String CONST_PREFERED_BUILT_IN_TYPES = "org.eclipse.wst.xmlschema.preferedBuiltInTypes"; //$NON-NLS-1$
- public static final String CUSTOM_LIST_SEPARATOR = "\n"; //$NON-NLS-1$
- public static final String EXTENSIONS_SCHEMAS_EXTENSIONID = "org.eclipse.wst.xsd.ui.extensionCategories"; //$NON-NLS-1$
- private static final String DEPRECATED_EXTENSIONS_SCHEMAS_EXTENSIONID = "org.eclipse.wst.xsd.ui.ExtensionsSchemasDescription"; //$NON-NLS-1$
- public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org"; //$NON-NLS-1$
- public final static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource"; //$NON-NLS-1$
-
- //The shared instance.
- private static XSDEditorPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private ExtensionsSchemasRegistry registry;
- private NodeCustomizationRegistry nodeCustomizationRegistry;
- private XSDEditorConfiguration xsdEditorConfiguration = null;
- private static Bundle bundle;
-
- public static final String CONST_USE_SIMPLE_EDIT_MODE = PLUGIN_ID + ".useSimpleEditMode"; //$NON-NLS-1$
- public static final String CONST_SHOW_INHERITED_CONTENT = PLUGIN_ID + ".showInheritedContent"; //$NON-NLS-1$
-
- public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify"; //$NON-NLS-1$
- public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText"; //$NON-NLS-1$
- public static final String CONST_SHOW_EXTERNALS = PLUGIN_ID + ".showExternals"; //$NON-NLS-1$
- public static final String CONST_XSD_IMPORT_CLEANUP = PLUGIN_ID + ".autoImportCleanup"; //$NON-NLS-1$
- public static final String CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG = PLUGIN_ID + ".autoOpenSchemaLocationDialog"; //$NON-NLS-1$
-
- public static String DEFAULT_PAGE = "org.eclipse.wst.xsd.ui.internal.defaultPage";
- public static String DESIGN_PAGE = "org.eclipse.wst.xsd.ui.internal.designPage";
- public static String SOURCE_PAGE = "org.eclipse.wst.xsd.ui.internal.sourcePage";
-
- /**
- * The constructor.
- */
- public XSDEditorPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- bundle = context.getBundle();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static XSDEditorPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = XSDEditorPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- public static String getResourceString(String key, Object o)
- {
- return getResourceString(key, new Object[] { o});
- }
-
- public static String getResourceString(String key, Object[] objects)
- {
- return MessageFormat.format(getResourceString(key), objects);
- }
-
- public static String getResourceString(String key, Object o1, Object o2)
- {
- return getResourceString(key, new Object[] { o1, o2});
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- // resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xsd.ui.internal.editor.EditorPluginResources");
- resourceBundle = Platform.getResourceBundle(getBundle());
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.xsd.ui", path); //$NON-NLS-1$
- }
-
- public static ImageDescriptor getImageDescriptor(String name, boolean getBaseURL) {
- try {
- URL installURL = getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
- String imageString = getBaseURL ? "icons/" + name : name; //$NON-NLS-1$
-
- URL imageURL = new URL(installURL, imageString);
- return ImageDescriptor.createFromURL(imageURL);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public Image getIcon(String name)
- {
- try {
- ImageRegistry imageRegistry = getImageRegistry();
-
- if (imageRegistry.get(name) != null) {
- return imageRegistry.get(name);
- }
- else {
- URL installURL = getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
- String imageString = "icons/" + name; //$NON-NLS-1$
-
- URL imageURL = new URL(installURL, imageString);
- imageRegistry.put(name, ImageDescriptor.createFromURL(imageURL));
- return imageRegistry.get(name);
- }
-
- } catch (Exception e) {
- return null;
- }
- }
-
- public static XSDEditorPlugin getPlugin() {
- return plugin;
- }
-
- public static String getXSDString(String key) {
- return getResourceString(key);
- }
-
- /**
- * This gets the string resource and does one substitution.
- */
- public String getString(String key, Object s1) {
- return MessageFormat.format(Platform.getResourceBundle(getBundle()).getString(key), new Object[]{s1});
- }
-
- public static Image getXSDImage(String iconName) {
- return getDefault().getImage(iconName);
- }
-
- public Image getImage(String iconName) {
- ImageRegistry imageRegistry = getImageRegistry();
-
- if (imageRegistry.get(iconName) != null) {
- return imageRegistry.get(iconName);
- }
- else {
- imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
- return imageRegistry.get(iconName);
- }
- }
-
- public URL getBaseURL() {
- return bundle.getEntry("/"); //$NON-NLS-1$
- }
-
- public Image getIconImage(String object) {
- try {
- return ExtendedImageRegistry.getInstance().getImage(new URL(getBaseURL() + "icons/" + object + ".gif")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (MalformedURLException exception) {
-
- }
- return null;
- }
-
- public boolean getShowInheritedContent()
- {
- return getPreferenceStore().getBoolean(CONST_SHOW_INHERITED_CONTENT);
- }
-
- protected void initializeDefaultPreferences(IPreferenceStore store)
- {
- store.setDefault(CONST_SHOW_INHERITED_CONTENT, false);
- store.setDefault(CONST_XSD_DEFAULT_PREFIX_TEXT, "xsd"); //$NON-NLS-1$
- store.setDefault(CONST_XSD_LANGUAGE_QUALIFY, false);
- store.setDefault(DEFAULT_PAGE, DESIGN_PAGE);
- store.setDefault(CONST_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE);
- store.setDefault(CONST_SHOW_EXTERNALS, false);
- store.setDefault(CONST_XSD_IMPORT_CLEANUP, false);
- store.setDefault(CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG, true);
-
- //Even the last item in the list must contain a trailing List separator
- store.setDefault(CONST_PREFERED_BUILT_IN_TYPES,
- "boolean"+ CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "date" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "dateTime" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "double" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "float" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "hexBinary" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "int" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "string" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$
- "time" + CUSTOM_LIST_SEPARATOR); //$NON-NLS-1$
- }
-
- public ExtensionsSchemasRegistry getExtensionsSchemasRegistry()
- {
- if (registry == null)
- {
- registry = new ExtensionsSchemasRegistry(EXTENSIONS_SCHEMAS_EXTENSIONID);
- registry.__internalSetDeprecatedExtensionId(DEPRECATED_EXTENSIONS_SCHEMAS_EXTENSIONID);
- registry.setPrefStore(XSDEditorPlugin.getPlugin().getPreferenceStore() );
- }
- return registry;
- }
-
-
- public XSDEditorConfiguration getXSDEditorConfiguration()
- {
- if (xsdEditorConfiguration == null)
- {
- xsdEditorConfiguration = new XSDEditorConfiguration();
- }
- return xsdEditorConfiguration;
- }
-
- /**
- * Get the xml schema default namespace prefix
- */
- public String getXMLSchemaPrefix()
- {
- return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
- }
-
- public boolean getShowExternals()
- {
- return getPreferenceStore().getBoolean(CONST_SHOW_EXTERNALS);
- }
-
- public void setShowExternals(boolean doShow)
- {
- getPreferenceStore().setValue(CONST_SHOW_EXTERNALS, doShow);
- }
-
- public boolean getRemoveImportSetting()
- {
- return getPreferenceStore().getBoolean(CONST_XSD_IMPORT_CLEANUP);
- }
-
- public boolean getAutomaticallyOpenSchemaLocationDialogSetting()
- {
- return getPreferenceStore().getBoolean(CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG);
- }
-
- /**
- * Get the xml schema default target namespace
- */
- public String getXMLSchemaTargetNamespace() {
- String targetNamespace = getPreferenceStore().getString(CONST_DEFAULT_TARGET_NAMESPACE);
- if (!targetNamespace.endsWith("/")) { //$NON-NLS-1$
- targetNamespace = targetNamespace + "/"; //$NON-NLS-1$
- }
- return targetNamespace;
- }
-
- /**
- * Get the xml schema language qualification
- */
- public boolean isQualifyXMLSchemaLanguage() {
- return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
- }
-
- public static Shell getShell() {
- return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- public void setSourcePageAsDefault()
- {
- getPreferenceStore().setValue(DEFAULT_PAGE, SOURCE_PAGE);
- }
-
- public void setDesignPageAsDefault()
- {
- getPreferenceStore().setValue(DEFAULT_PAGE, DESIGN_PAGE);
- }
-
- /**
- * Method getDefaultPage.
- *
- * @return String value of the string constant that is the default page
- * the editor should turn to when first opened. Changes to the
- * last visible page when the editor was closed
- */
- public String getDefaultPage() {
- return getPreferenceStore().getString(DEFAULT_PAGE);
- }
-
- public NodeCustomizationRegistry getNodeCustomizationRegistry()
- {
- if (nodeCustomizationRegistry == null)
- {
- nodeCustomizationRegistry = new NodeCustomizationRegistry("foo");
- }
- return nodeCustomizationRegistry;
- }
-
- private static final String PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID = "org.eclipse.wst.xsd.ui.productCustomizationProviderPluginId"; //$NON-NLS-1$
- private static final String PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME = "org.eclipse.wst.xsd.ui.productCustomizationProviderClassName"; //$NON-NLS-1$
-
- private static ProductCustomizationProvider productCustomizationProvider;
- private static boolean productCustomizationProviderInitialized = false;
-
- public ProductCustomizationProvider getProductCustomizationProvider()
- {
- if (!productCustomizationProviderInitialized)
- {
- productCustomizationProviderInitialized = true;
- String pluginName = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID);
- String className = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME);
- if (pluginName != null && pluginName.length() > 0 &&
- className != null && className.length() > 0)
- {
- try
- {
- Bundle bundle = Platform.getBundle(pluginName);
- Class clazz = bundle.loadClass(className);
- productCustomizationProvider = (ProductCustomizationProvider)clazz.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- }
- return productCustomizationProvider;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java
deleted file mode 100644
index 6d03aec02a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceAndManageDirectivesCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewElementDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDElementReferenceEditManager implements ComponentReferenceEditManager
-{
- protected IFile currentFile;
- protected XSDSchema[] schemas;
-
- public XSDElementReferenceEditManager(IFile currentFile, XSDSchema[] schemas)
- {
- this.currentFile = currentFile;
- this.schemas = schemas;
- }
-
- public void addToHistory(ComponentSpecification component)
- {
- // TODO (cs) implement me!
- }
-
- public IComponentDialog getBrowseDialog()
- {
- //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas);
- //return dialog;
- XSDSearchListDialogDelegate dialogDelegate =
- new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.ELEMENT_META_NAME, currentFile, schemas);
- return dialogDelegate;
- }
-
- public IComponentDescriptionProvider getComponentDescriptionProvider()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ComponentSpecification[] getHistory()
- {
- // TODO (cs) implement this properly - should this history be global or local to each editor?
- // This is something we should play around with ourselves to see what feels right.
- //
- List list = new ArrayList();
- ComponentSpecification result[] = new ComponentSpecification[list.size()];
- list.toArray(result);
- return result;
- }
-
- public IComponentDialog getNewDialog()
- {
- if (schemas.length > 0) {
- return new NewElementDialog(schemas[0]);
- }
- else {
- return new NewElementDialog();
- }
- }
-
- public ComponentSpecification[] getQuickPicks()
- {
- // TODO (cs) implement this properly - we should be providing a list of the
- // most 'common' built in schema types here
- // I believe Trung will be working on a perference page to give us this list
- // for now let's hard code some values
- //
- List list = new ArrayList();
-
- ComponentSpecification result[] = new ComponentSpecification[list.size()];
- list.toArray(result);
- return result;
- }
-
-//TODO not changed yet
- public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
- {
- XSDElementDeclaration concreteComponent = null;
- if (referencingObject instanceof Adapter)
- {
- Adapter adapter = (Adapter)referencingObject;
- if (adapter.getTarget() instanceof XSDElementDeclaration)
- {
- concreteComponent = (XSDElementDeclaration)adapter.getTarget();
- }
- }
- else if (referencingObject instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDElementDeclaration) referencingObject;
- }
- if (concreteComponent != null)
- {
- if (component.isNew())
- {
- XSDElementDeclaration elementDec = null;
- if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME)
- {
- AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_ELEMENT, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- elementDec = (XSDElementDeclaration) command.getAddedComponent();
- }
- if (elementDec != null)
- {
- Command command = new UpdateElementReferenceCommand(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE, concreteComponent, elementDec);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- else
- {
- Command command = new UpdateElementReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
- command.setLabel(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE);
- command.execute();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java
deleted file mode 100644
index 62f283f02c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.IADTEditorInput;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDFileEditorInput extends FileEditorInput implements IADTEditorInput
-{
- private IFile file;
- private XSDSchema schema;
- private String editorName;
-
- public XSDFileEditorInput(IFile file, XSDSchema schema) {
- super(file);
- if (file == null) {
- throw new IllegalArgumentException();
- }
- this.file = file;
- this.schema = schema;
- editorName = file.getName();
- }
-
- public IFile getFile()
- {
- return file;
- }
-
- public XSDSchema getSchema()
- {
- return schema;
- }
-
- public void setEditorName(String name)
- {
- editorName = name;
- }
-
- public String getName()
- {
- if (editorName != null)
- {
- return editorName;
- }
- return super.getName();
- }
-
- public String getToolTipText()
- {
- if (schema != null)
- {
- String ns = schema.getTargetNamespace();
- if (ns != null && ns.length() > 0)
- return Messages._UI_LABEL_TARGET_NAMESPACE + ns;
- else
- return Messages._UI_LABEL_NO_NAMESPACE;
- }
- return super.getToolTipText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
deleted file mode 100644
index 5bb7f4cf94..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Jesper Steen Moller - added support for lookups out of workspace
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.net.URI;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTReadOnlyFileEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * XSDHyperlink knows how to open links from XSD files.
- *
- * @see XSDHyperlinkDetector
- */
-public class XSDHyperlink implements IHyperlink
-{
- private IRegion fRegion;
- private XSDConcreteComponent fComponent;
-
- public XSDHyperlink(IRegion region, XSDConcreteComponent component)
- {
- fRegion = region;
- fComponent = component;
- }
-
- public IRegion getHyperlinkRegion()
- {
- return fRegion;
- }
-
- public String getTypeLabel()
- {
- return null;
- }
-
- public String getHyperlinkText()
- {
- return NLS.bind(Messages._UI_HYPERLINK_TEXT, fComponent.getElement().getLocalName());
- }
-
- public void open()
- {
- XSDSchema schema = fComponent.getSchema();
-
- if (schema == null)
- {
- return;
- }
-
- String schemaLocation = schema.getSchemaLocation();
-
- IFile schemaFile = null;
- URI schemaUri = null;
-
- if (URIHelper.isPlatformResourceProtocol(schemaLocation))
- {
- IPath schemaPath = new Path(URIHelper.removePlatformResourceProtocol(schemaLocation));
- schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- if (! schemaFile.exists())
- {
- return;
- }
- }
- else
- {
- try {
- schemaUri = new URI(schemaLocation);
- } catch (Exception exception) {}
- }
-
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IEditorPart editorPart = workbenchPage.getActiveEditor();
-
- workbenchPage.getNavigationHistory().markLocation(editorPart);
-
- try
- {
- if (schemaFile != null)
- {
- editorPart = IDE.openEditor(workbenchPage, schemaFile, true);
- }
- else if (schemaUri != null && "file".equals(schemaUri.getScheme())) //$NON-NLS-1$
- {
- editorPart = IDE.openEditor(workbenchPage, schemaUri, XSDEditorPlugin.EDITOR_ID, true);
- }
- else
- {
- IEditorInput input = new ADTReadOnlyFileEditorInput(schemaLocation);
- editorPart = IDE.openEditor(workbenchPage, input, XSDEditorPlugin.EDITOR_ID, true);
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
- }
- }
- catch (PartInitException pie)
- {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java
deleted file mode 100644
index 8e27f1484e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java
+++ /dev/null
@@ -1,151 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-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;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-
-/**
- * Detects hyperlinks for XSD files. Used by the XSD text editor to provide a
- * "Go to declaration" functionality similar with the one provided by the Java
- * editor.
- */
-public class XSDHyperlinkDetector extends BaseHyperlinkDetector
-{
- /**
- * Determines whether an attribute is "linkable" that is, the component it
- * points to can be the target of a "go to definition" navigation. Derived
- * classes should override.
- *
- * @param name the attribute name. Must not be null.
- * @return true if the attribute is linkable, false otherwise.
- */
- protected boolean isLinkableAttribute(String name)
- {
- boolean isLinkable = name.equals(XSDConstants.TYPE_ATTRIBUTE) ||
- name.equals(XSDConstants.REFER_ATTRIBUTE) ||
- name.equals(XSDConstants.REF_ATTRIBUTE) ||
- name.equals(XSDConstants.BASE_ATTRIBUTE) ||
- name.equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE) ||
- name.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE) ||
- name.equals(XSDConstants.ITEMTYPE_ATTRIBUTE) ||
- name.equals(XSDConstants.MEMBERTYPES_ATTRIBUTE)
- ;
-
- return isLinkable;
- }
-
- /**
- * Creates a hyperlink based on the selected node. Derived classes should
- * override.
- *
- * @param document the source document.
- * @param node the node under the cursor.
- * @param region the text region to use to create the hyperlink.
- * @return a new IHyperlink for the node or null if one cannot be created.
- */
- protected IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region)
- {
- XSDSchema xsdSchema = getXSDSchema(document);
-
- if (xsdSchema == null)
- {
- return null;
- }
-
- XSDConcreteComponent targetComponent = getTargetXSDComponent(xsdSchema, node);
-
- if (targetComponent != null)
- {
- IRegion nodeRegion = getHyperlinkRegion(node);
-
- return new XSDHyperlink(nodeRegion, targetComponent);
- }
-
- return null;
- }
-
- /**
- * Finds the XSD component for the given node.
- *
- * @param xsdSchema cannot be null
- * @param node cannot be null
- * @return XSDConcreteComponent
- */
- private XSDConcreteComponent getTargetXSDComponent(XSDSchema xsdSchema, IDOMNode node)
- {
- XSDConcreteComponent xsdComponent = xsdSchema.getCorrespondingComponent(node);
-
- String attributeName = null;
-
- if (node instanceof Attr)
- {
- Attr attribute = (Attr)node;
- attributeName = attribute != null ? attribute.getName(): null;
- }
-
- XSDHyperlinkTargetLocator xsdHyperlinkTargetLocator = new XSDHyperlinkTargetLocator();
- XSDConcreteComponent component = xsdHyperlinkTargetLocator.locate(xsdComponent, attributeName);
-
- return component;
- }
-
- /**
- * Gets the xsd schema from document
- *
- * @param document
- * @return XSDSchema or null of one does not exist yet for document
- */
- private XSDSchema getXSDSchema(IDocument document)
- {
- XSDSchema schema = null;
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null)
- {
- try
- {
- if (model instanceof IDOMModel)
- {
- IDOMDocument domDoc = ((IDOMModel) model).getDocument();
- if (domDoc != null)
- {
- XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
- /*
- * ISSUE: Didn't want to go through initializing schema if it does
- * not already exist, so just attempted to get existing adapter. If
- * doesn't exist, just don't bother working.
- */
- if (modelAdapter != null)
- schema = modelAdapter.getSchema();
- }
- }
- }
- finally
- {
- model.releaseFromRead();
- }
- }
- return schema;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java
deleted file mode 100644
index c04aebd595..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java
+++ /dev/null
@@ -1,301 +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.xsd.ui.internal.editor;
-
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDSwitch;
-
-/**
- * A custom XSDSwitch used to locate the "referenced" component. Used by the
- * hyperlink/F3 navigation mechanism. Made a separate class because it is used
- * from the WSDL editor as well.
- */
-public class XSDHyperlinkTargetLocator extends XSDSwitch
-{
- /**
- * Holds the attribute name if the cursor/mouse is over an attribute.
- */
- private String attributeName;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration)
- */
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration)
- {
- XSDConcreteComponent target = null;
-
- if (attributeDeclaration.isAttributeDeclarationReference())
- {
- target = attributeDeclaration.getResolvedAttributeDeclaration();
- }
- else if (attributeDeclaration.getAnonymousTypeDefinition() == null)
- {
- target = attributeDeclaration.getTypeDefinition();
-
- // Avoid navigating to built in data types.
-
- if (isFromSchemaForSchema(target))
- {
- target = null;
- }
- }
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition)
- */
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroupDefinition)
- {
- XSDConcreteComponent target = null;
-
- if (attributeGroupDefinition.isAttributeGroupDefinitionReference())
- {
- target = attributeGroupDefinition.getResolvedAttributeGroupDefinition();
- }
-
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDElementDeclaration(org.eclipse.xsd.XSDElementDeclaration)
- */
- public Object caseXSDElementDeclaration(XSDElementDeclaration elementDeclaration)
- {
- XSDConcreteComponent target = null;
-
- if (elementDeclaration.isElementDeclarationReference())
- {
- target = elementDeclaration.getResolvedElementDeclaration();
- }
- else
- {
- XSDConcreteComponent typeDefinition = null;
-
- if (elementDeclaration.getAnonymousTypeDefinition() == null)
- {
- typeDefinition = elementDeclaration.getTypeDefinition();
- }
-
- XSDConcreteComponent substitutionGroupAffiliation = elementDeclaration.getSubstitutionGroupAffiliation();
-
- if (typeDefinition != null && substitutionGroupAffiliation != null)
- {
- // There are 2 things we can navigate to: if the cursor is anywhere on
- // the
- // substitution attribute then jump to that, otherwise just go to the
- // base type.
-
- if (XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE.equals(attributeName))
- {
- target = substitutionGroupAffiliation;
- }
- else
- {
- target = typeDefinition;
- }
- }
- else
- {
- target = typeDefinition != null ? typeDefinition : substitutionGroupAffiliation;
- }
-
- if (isFromSchemaForSchema(target))
- {
- target = null;
- }
- }
-
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDIdentityConstraintDefinition(org.eclipse.xsd.XSDIdentityConstraintDefinition)
- */
- public Object caseXSDIdentityConstraintDefinition(XSDIdentityConstraintDefinition idConstraintDefinition)
- {
- Object target = null;
-
- XSDIdentityConstraintDefinition referencedKey = idConstraintDefinition.getReferencedKey();
-
- if (referencedKey != null)
- {
- target = referencedKey;
- }
-
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition)
- */
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition modelGroupDefinition)
- {
- XSDConcreteComponent target = null;
-
- if (modelGroupDefinition.isModelGroupDefinitionReference())
- {
- target = modelGroupDefinition.getResolvedModelGroupDefinition();
- }
-
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective)
- */
- public Object caseXSDSchemaDirective(XSDSchemaDirective directive)
- {
- XSDSchema schema = directive.getResolvedSchema();
-
- return schema;
- }
-
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition typeDefinition)
- {
- XSDConcreteComponent target = null;
-
- // Simple types can be one of: atomic, list or union.
-
- XSDVariety variety = typeDefinition.getVariety();
- int varietyType = variety.getValue();
-
- switch (varietyType)
- {
- case XSDVariety.ATOMIC:
- {
- target = typeDefinition.getBaseTypeDefinition();
- }
- break;
- case XSDVariety.LIST:
- {
- target = typeDefinition.getItemTypeDefinition();
- }
- break;
- case XSDVariety.UNION:
- {
- List memberTypes = typeDefinition.getMemberTypeDefinitions();
- if (memberTypes != null && memberTypes.size() > 0)
- {
- // ISSUE: What if there are more than one type?
- // This could be a case for multiple hyperlinks at the same
- // location.
- target = (XSDConcreteComponent) memberTypes.get(0);
- }
- }
- break;
- }
-
- // Avoid navigating to built in data types.
-
- if (isFromSchemaForSchema(target))
- {
- target = null;
- }
-
- return target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xsd.util.XSDSwitch#caseXSDTypeDefinition(org.eclipse.xsd.XSDTypeDefinition)
- */
- public Object caseXSDTypeDefinition(XSDTypeDefinition typeDefinition)
- {
- XSDConcreteComponent target = null;
-
- XSDTypeDefinition baseType = typeDefinition.getBaseType();
-
- if (baseType != null)
- {
- target = baseType;
- }
-
- // Avoid navigating to built in data types.
-
- if (isFromSchemaForSchema(target))
- {
- target = null;
- }
-
- return target;
- }
-
- /**
- * Detects if a given schema component is from the schema for schema (built in
- * data types). Used to avoid navigating to this type of components as they
- * don't have an accessible physical location.
- *
- * @param component the component to check.
- * @return true if the component is from the schema for schema namespace,
- * false otherwise.
- */
- public boolean isFromSchemaForSchema(XSDConcreteComponent component)
- {
- if (component == null)
- {
- return false;
- }
-
- XSDSchema schema = component.getSchema();
-
- if (schema != null && schema.equals(schema.getSchemaForSchema()))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Locates the target component - for example the element declaration pointed
- * to by an element reference, etc.
- *
- * @param component the current component.
- * @param attributeName the attribute name if the cursor/mouse is over an
- * attribute. This is used to provide fine grained navigation for
- * components with more than one "active" attribute.
- * @return the referenced XSD concrete component or null if none is found.
- */
- public XSDConcreteComponent locate(XSDConcreteComponent component, String attributeName)
- {
- this.attributeName = attributeName;
-
- return (XSDConcreteComponent) doSwitch(component);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
deleted file mode 100644
index 5d62af8d21..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
-import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
-import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.CaptureScreenAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-
-/**
- * Manages the installation/deinstallation of global actions for multi-page
- * editors. Responsible for the redirection of global actions to the active
- * editor. Multi-page contributor replaces the contributors for the individual
- * editors in the multi-page editor.
- */
-public class XSDMultiPageEditorContributor extends MultiPageEditorActionBarContributor
-{
- private IEditorPart activeEditorPart;
- private InternalXSDMultiPageEditor xsdEditor;
- protected ITextEditor textEditor;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected List fPartListeners= new ArrayList();
- ZoomInRetargetAction zoomInRetargetAction;
- ZoomOutRetargetAction zoomOutRetargetAction;
- Action captureScreenAction;
- ZoomComboContributionItem zoomComboContributionItem;
- /**
- * Creates a multi-page contributor.
- */
- public XSDMultiPageEditorContributor()
- {
- super();
- sourceViewerActionContributor = new SourcePageActionContributor();
- zoomInRetargetAction = new ZoomInRetargetAction();
- zoomInRetargetAction.setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/etool16/zoomplus.gif"));
- zoomOutRetargetAction = new ZoomOutRetargetAction();
- zoomOutRetargetAction.setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/etool16/zoomminus.gif"));
- captureScreenAction = new CaptureScreenAction();
- fPartListeners.add(zoomInRetargetAction);
- fPartListeners.add(zoomOutRetargetAction);
- }
-
- /**
- * Returns the action registed with the given text editor.
- *
- * @return IAction or null if editor is null.
- */
- protected IAction getAction(ITextEditor editor, String actionID)
- {
- return (editor == null ? null : editor.getAction(actionID));
- }
-
- /*
- * (non-JavaDoc) Method declared in
- * AbstractMultiPageEditorActionBarContributor.
- */
-
- public void setActivePage(IEditorPart part)
- {
- if (activeEditorPart == part)
- return;
-
- activeEditorPart = part;
-
- IActionBars actionBars = getActionBars();
- boolean isSource = false;
-
- if (activeEditorPart != null && activeEditorPart instanceof ITextEditor)
- {
- isSource = true;
- zoomInRetargetAction.setEnabled(false);
- zoomOutRetargetAction.setEnabled(false);
- captureScreenAction.setEnabled(false);
- activateSourcePage(activeEditorPart, true);
- }
- else
- {
- activateSourcePage(xsdEditor, false);
- if (part instanceof InternalXSDMultiPageEditor)
- {
- xsdEditor = (InternalXSDMultiPageEditor) part;
- }
- if (xsdEditor != null)
- {
- // cs: here's we ensure the UNDO and REDO actions are available when
- // the design view is active
- IWorkbenchPartSite site = xsdEditor.getSite();
- if (site instanceof IEditorSite)
- {
- ITextEditor textEditor = xsdEditor.getTextEditor();
- IActionBars siteActionBars = ((IEditorSite) site).getActionBars();
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO));
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO));
- siteActionBars.updateActionBars();
- }
-
- Object adapter = xsdEditor.getAdapter(ActionRegistry.class);
- if (adapter instanceof ActionRegistry)
- {
- ActionRegistry registry = (ActionRegistry) adapter;
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), registry.getAction(DeleteAction.ID));
- actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN));
- actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT));
- actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId()));
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), registry.getAction(ActionFactory.SELECT_ALL.getId()));
- zoomInRetargetAction.setEnabled(true);
- zoomOutRetargetAction.setEnabled(true);
- captureScreenAction.setEnabled(true);
- }
- }
- }
-
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
-
- if (zoomComboContributionItem != null)
- {
- zoomComboContributionItem.setVisible(!isSource);
- zoomComboContributionItem.update();
- // Bug 254772 - parent contribution manager should not be null. We added this item already.
- // Force the ToolBarManager to update/redraw the items
- zoomComboContributionItem.getParent().update(true);
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor, boolean state)
- {
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)
- {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state);
- }
- }
-
- public void setActiveEditor(IEditorPart part)
- {
- IEditorPart activeNestedEditor = null;
- if (part instanceof MultiPageEditorPart)
- {
- activeNestedEditor = part;
- }
- setActivePage(activeNestedEditor);
-
- if (part instanceof InternalXSDMultiPageEditor)
- {
- xsdEditor = (InternalXSDMultiPageEditor) part;
-
- textEditor = xsdEditor.getTextEditor();
- if (textEditor != null)
- {
-// updateActions();
- getActionBars().updateActionBars();
- }
- }
-
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- ((IXSDToolbarAction)i.next()).setEditorPart(activeNestedEditor);
- }
-
- super.setActiveEditor(part);
- }
-
- public void contributeToMenu(IMenuManager manager)
- {
- IMenuManager menu = new MenuManager(Messages._UI_MENU_XSD_EDITOR);
- manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
-
- // Add extension menu actions
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- menu.add((IXSDToolbarAction)i.next());
- }
-
- menu.add(zoomInRetargetAction);
- menu.add(zoomOutRetargetAction);
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menu.add(captureScreenAction);
-
- menu.updateAll(true);
- }
-
- public void contributeToToolBar(IToolBarManager manager)
- {
- manager.add(new Separator());
- // Add extension toolbar actions
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- manager.add((IXSDToolbarAction)i.next());
- }
-
- manager.add(new Separator());
- String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
- zoomComboContributionItem = new ZoomComboContributionItem(getPage(), zoomStrings);
- manager.add(zoomComboContributionItem);
- manager.add(captureScreenAction);
- }
-
-
- public void init(IActionBars bars, IWorkbenchPage page)
- {
- Iterator e = fPartListeners.iterator();
- while (e.hasNext())
- {
- page.addPartListener((RetargetAction) e.next());
- }
-
- initSourceViewerActionContributor(bars);
-
- super.init(bars, page);
- }
-
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose()
- {
- fPartListeners = null;
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.dispose();
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java
deleted file mode 100644
index e5275999e0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java
+++ /dev/null
@@ -1,44 +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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public class XSDSelectionMapper implements ISelectionMapper
-{
- public ISelection mapSelection(ISelection selection)
- {
- List list = new ArrayList();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- for (Iterator i = structuredSelection.iterator(); i.hasNext(); )
- {
- Object o = i.next();
- if (o instanceof Adapter)
- {
- list.add(((Adapter)o).getTarget());
- }
- else
- {
- list.add(o);
- }
- }
- }
- return new StructuredSelection(list);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java
deleted file mode 100644
index 8bf2506b45..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSubstitutionGroupEditManager extends XSDElementReferenceEditManager
-{
-
- public XSDSubstitutionGroupEditManager(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
- {
- XSDElementDeclaration concreteComponent = null;
- if (referencingObject instanceof Adapter)
- {
- Adapter adapter = (Adapter)referencingObject;
- if (adapter.getTarget() instanceof XSDElementDeclaration)
- {
- concreteComponent = (XSDElementDeclaration)adapter.getTarget();
- }
- }
- else if (referencingObject instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDElementDeclaration) referencingObject;
- }
- if (concreteComponent != null)
- {
- if (component.isNew())
- {
- XSDElementDeclaration elementDec = null;
- if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME)
- {
- AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_ELEMENT, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- elementDec = (XSDElementDeclaration) command.getAddedComponent();
- }
- if (elementDec != null)
- {
- Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, elementDec.getQName(concreteComponent.getSchema()), org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
- command.execute();
- }
- }
- else
- {
- Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, ((XSDElementDeclaration)component.getObject()).getQName(concreteComponent.getSchema()), org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java
deleted file mode 100644
index 9ba373fc7b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Eugene Ostroukhov, eugene@genuitec.com - [203291] XSD Editor Source State
- * not updated in Outline/Graph
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeUseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDParticleAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Element;
-
-public class XSDTabbedPropertySheetPage extends TabbedPropertySheetPage implements IADTObjectListener
-{
- XSDBaseAdapter oldSelection;
- XSDModelAdapter xsdModelAdapter;
- public XSDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
- {
- super(tabbedPropertySheetPageContributor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
- Object selected = ((IStructuredSelection)selection).getFirstElement();
- if (selected instanceof XSDBaseAdapter)
- {
- XSDBaseAdapter adapter = (XSDBaseAdapter)selected;
- if (oldSelection != null)
- {
- oldSelection.unregisterListener(this);
- if (oldSelection instanceof XSDElementDeclarationAdapter)
- {
- XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)oldSelection).getTarget();
- if (elem.getContainer() != null)
- {
- Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer());
- if (adap instanceof XSDParticleAdapter)
- {
- XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap;
- particleAdapter.unregisterListener(this);
- }
- }
- if (elem.isElementDeclarationReference())
- {
- XSDElementDeclarationAdapter resolvedElementAdapter = (XSDElementDeclarationAdapter)XSDAdapterFactory.getInstance().adapt(elem.getResolvedElementDeclaration());
- resolvedElementAdapter.unregisterListener(this);
- }
- }
- }
- if (adapter instanceof XSDElementDeclarationAdapter)
- {
- XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)adapter).getTarget();
- Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer());
- if (adap instanceof XSDParticleAdapter)
- {
- XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap;
- particleAdapter.registerListener(this);
- }
- if (elem.isElementDeclarationReference())
- {
- XSDElementDeclarationAdapter resolvedElementAdapter = (XSDElementDeclarationAdapter)XSDAdapterFactory.getInstance().adapt(elem.getResolvedElementDeclaration());
- resolvedElementAdapter.registerListener(this);
- }
- }
- else if (adapter instanceof XSDAttributeUseAdapter)
- {
- XSDAttributeUseAdapter attributeUse = (XSDAttributeUseAdapter) adapter;
- XSDAttributeUse xsdAttrUse = (XSDAttributeUse) attributeUse.getTarget();
- adapter = (XSDBaseAdapter) XSDAdapterFactory.getInstance().adapt(xsdAttrUse.getAttributeDeclaration());
- }
- adapter.registerListener(this);
- oldSelection = adapter;
- Object model = adapter.getTarget();
-
- if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null)
- {
- xsdModelAdapter.getModelReconcileAdapter().removeListener(internalNodeAdapter);
- }
-
- Element element = ((XSDConcreteComponent)adapter.getTarget()).getElement();
- if (element != null) {
- xsdModelAdapter = XSDModelAdapter.lookupOrCreateModelAdapter(element.getOwnerDocument());
- }
- if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null)
- {
- xsdModelAdapter.getModelReconcileAdapter().addListener(internalNodeAdapter);
- }
-
- if (model instanceof XSDConcreteComponent)
- {
- selection = new StructuredSelection(model);
- }
- super.selectionChanged(part, selection);
- return;
- }
- super.selectionChanged(part, selection);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (getCurrentTab() != null)
- {
- refresh();
- }
- }
-
- public void dispose()
- {
- if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null)
- {
- xsdModelAdapter.getModelReconcileAdapter().removeListener(internalNodeAdapter);
- xsdModelAdapter = null;
- }
- super.dispose();
- }
-
- protected INodeAdapter internalNodeAdapter = new InternalNodeAdapter();
- class InternalNodeAdapter implements INodeAdapter
- {
- public boolean isAdapterForType(Object type)
- {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- refresh();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java
deleted file mode 100644
index 9e1e13be17..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager2;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDComplexTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceAndManageDirectivesCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class XSDTypeReferenceEditManager implements ComponentReferenceEditManager, ComponentReferenceEditManager2
-{
- protected IFile currentFile;
- protected XSDSchema[] schemas;
- private static ComponentSpecification result[];
- private IADTObject referencer;
-
- public XSDTypeReferenceEditManager(IFile currentFile, XSDSchema[] schemas)
- {
- this.currentFile = currentFile;
- this.schemas = schemas;
- }
-
- public void addToHistory(ComponentSpecification component)
- {
- // TODO (cs) implement me!
- }
-
- public IADTObject getReferencer()
- {
- return referencer;
- }
-
- public void setReferencer(IADTObject referencer)
- {
- this.referencer = referencer;
- }
-
- public IComponentDialog getBrowseDialog()
- {
- //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas);
- //return dialog;
- XSDSearchListDialogDelegate dialogDelegate = new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.TYPE_META_NAME, currentFile, schemas);
- return dialogDelegate;
- }
-
- public IComponentDescriptionProvider getComponentDescriptionProvider()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ComponentSpecification[] getHistory()
- {
- // TODO (cs) implement this properly - should this history be global or local to each editor?
- // This is something we should play around with ourselves to see what feels right.
- //
- List list = new ArrayList();
- ComponentSpecification result[] = new ComponentSpecification[list.size()];
- list.toArray(result);
- return result;
- }
-
- public IComponentDialog getNewDialog()
- {
- NewTypeDialog result = null;
- if (schemas.length > 0)
- {
- result = new NewTypeDialog(schemas[0]);
- }
- else
- {
- result = new NewTypeDialog();
- }
- if (referencer instanceof IField)
- {
- IField field = (IField)referencer;
- if (XSDConstants.ATTRIBUTE_ELEMENT_TAG.equals(field.getKind()))
- {
- result.allowComplexType(false);
- }
- String fieldName = field.getName();
- if (fieldName != null)
- {
- fieldName = fieldName.trim();
- if (fieldName.length() > 0)
- {
- result.setDefaultName(NLS.bind(Messages._UI_VALUE_NEW_TYPE, fieldName));
- }
- }
- }
- return result;
- }
-
- public ComponentSpecification[] getQuickPicks()
- {
- if (result != null)
- return result;
-
- // TODO (cs) implement this properly - we should be providing a list of the
- // most 'common' built in schema types here
- // I believe Trung will be working on a perference page to give us this list
- // for now let's hard code some values
- //
- List list = new ArrayList();
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "boolean", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "date", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "dateTime", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "double", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "float", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "hexBinary", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "int", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", null)); //$NON-NLS-1$
- list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "time", null)); //$NON-NLS-1$
- result = new ComponentSpecification[list.size()];
- list.toArray(result);
- return result;
- }
-
-
- public void modifyComponentReference(Object referencingObject, ComponentSpecification component)
- {
- XSDConcreteComponent concreteComponent = null;
- if (referencingObject instanceof Adapter)
- {
- Adapter adpater = (Adapter)referencingObject;
- if (adpater.getTarget() instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDConcreteComponent)adpater.getTarget();
- }
- }
- else if (referencingObject instanceof XSDConcreteComponent)
- {
- concreteComponent = (XSDConcreteComponent) referencingObject;
- }
-
- if (concreteComponent != null)
- {
- if (component.isNew())
- {
- XSDTypeDefinition td = null;
- if (component.getName() == null // This means we set to anonymous type
- && concreteComponent instanceof XSDElementDeclaration)
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) concreteComponent;
- // TODO (cs) we should use actions here so that UNDO/REDO can work nicely
- // with the proper undo descriptions
- if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
- {
- XSDComplexTypeDefinition complexType = factory.createXSDComplexTypeDefinition();
- elementDeclaration.setAnonymousTypeDefinition(complexType);
- }
- else
- {
- XSDSimpleTypeDefinition simpleType = factory.createXSDSimpleTypeDefinition();
- simpleType.setBaseTypeDefinition(
- elementDeclaration.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string") ); //$NON-NLS-1$
- elementDeclaration.setAnonymousTypeDefinition(simpleType);
- }
- elementDeclaration.getElement().removeAttribute("type"); //TODO use external literal string
- }
- else if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
- {
- AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand(Messages._UI_ACTION_ADD_COMPLEX_TYPE, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- td = command.getCreatedComplexType();
- }
- else
- {
- AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema());
- command.setNameToAdd(component.getName());
- command.execute();
- td = command.getCreatedSimpleType();
- }
- if (td != null)
- {
- Command command = new UpdateTypeReferenceCommand(concreteComponent, td);
- command.setLabel(Messages._UI_ACTION_SET_TYPE);
- command.execute();
- }
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- else
- {
- Command command = new UpdateTypeReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
- command.setLabel(Messages._UI_ACTION_SET_TYPE);
- command.execute();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif
deleted file mode 100644
index 210bb24ce0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif
deleted file mode 100644
index ac58c1e8ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif
deleted file mode 100644
index 2375c655d8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif
deleted file mode 100644
index d535dac36d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png
deleted file mode 100644
index 0c4caf1cc2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif
deleted file mode 100644
index 3d550a30e8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif
deleted file mode 100644
index bd37eb50b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif
deleted file mode 100644
index 2b347ac458..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif
deleted file mode 100644
index 6d74e802b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif
deleted file mode 100644
index d2108c0368..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif
deleted file mode 100644
index a39f93cdce..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif
deleted file mode 100644
index 5280cc2904..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif
deleted file mode 100644
index 2da001e3e9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif
deleted file mode 100644
index 648462ff67..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif
deleted file mode 100644
index a89fa8f187..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif
deleted file mode 100644
index 8365af2f3c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif
deleted file mode 100644
index 89ba825253..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif
deleted file mode 100644
index 41c68dda8c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif
deleted file mode 100644
index 007f8522af..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif
deleted file mode 100644
index 4fc84e4c3a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif
deleted file mode 100644
index d349a05f2b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif
deleted file mode 100644
index 0cfb8076dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif
deleted file mode 100644
index 378e43e14d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b55d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif
deleted file mode 100644
index 555ef53306..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif
deleted file mode 100644
index 34a7fb3f23..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif
deleted file mode 100644
index 9e44ce52a9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif
deleted file mode 100644
index b26c527f5e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif
deleted file mode 100644
index 04032a915a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif
deleted file mode 100644
index ee5829d693..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif
deleted file mode 100644
index ce9df985b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif
deleted file mode 100644
index 7134210d0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif
deleted file mode 100644
index 56964c13a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif
deleted file mode 100644
index 2399a58204..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif
deleted file mode 100644
index 8bf3f972d2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif
deleted file mode 100644
index 7ef38df720..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif
deleted file mode 100644
index 11d7958525..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif
deleted file mode 100644
index d08e78f891..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif
deleted file mode 100644
index a113cf45a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif
deleted file mode 100644
index 38bc12e32f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif
deleted file mode 100644
index 75f33c24fa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif
deleted file mode 100644
index 9aefeb27b6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif
deleted file mode 100644
index 292adafc8e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif
deleted file mode 100644
index 5a8a650f3d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif
deleted file mode 100644
index 85f9baaf44..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif
deleted file mode 100644
index 9e665d5c78..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif
deleted file mode 100644
index 24d1a279e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif
deleted file mode 100644
index 13dae59bea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif
deleted file mode 100644
index 0bc60689c6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif
deleted file mode 100644
index eab699e385..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif
deleted file mode 100644
index f2e363564f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif
deleted file mode 100644
index 94ae2a0ee2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png
deleted file mode 100644
index 2b1477a3f6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif
deleted file mode 100644
index c705db0c1e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif
deleted file mode 100644
index 3c65dc4ba1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif
deleted file mode 100644
index a61441f2a8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties
deleted file mode 100644
index bb90770654..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties
+++ /dev/null
@@ -1,153 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-
-UI_LABEL_BASE_TYPE = Base Type:
-UI_LABEL_DERIVED_BY = Derived By:
-
-UI_LABEL_INHERIT_FROM = Inherit &From:
-UI_LABEL_INHERIT_BY = Inherit &By:
-
-UI_LABEL_DOCUMENTATION = Documentation
-UI_LABEL_APP_INFO = App Info
-
-UI_LABEL_SET_TYPE = Set Type
-UI_LABEL_TYPE = &Type:
-
-UI_LABEL_NAME = &Name:
-
-UI_LABEL_KIND = Kind:
-
-UI_LABEL_MINOCCURS = &Minimum Occurrence:
-UI_LABEL_MAXOCCURS = Ma&ximum Occurrence:
-
-UI_PAGE_HEADING_REFERENCE = Reference
-UI_LABEL_READ_ONLY = read-only
-
-UI_NO_TYPE = No Type
-
-UI_LABEL_COMPONENTS = Components:
-
-! Additional Categories
-_UI_GRAPH_TYPES = Types
-_UI_GRAPH_ELEMENTS = Elements
-_UI_GRAPH_ATTRIBUTES = Attributes
-_UI_GRAPH_ATTRIBUTE_GROUPS = Attribute Groups
-_UI_GRAPH_NOTATIONS = Notations
-_UI_GRAPH_IDENTITY_CONSTRAINTS = Identity Constraints
-_UI_GRAPH_ANNOTATIONS = Annotations
-_UI_GRAPH_DIRECTIVES = Directives
-_UI_GRAPH_GROUPS = Groups
-_UI_GRAPH_REDEFINE_SCHEMA = Redefine Schema
-_UI_GRAPH_REDEFINE_TYPES = Types
-_UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS = Attribute Groups
-_UI_GRAPH_REDEFINE_GROUPS = Groups
-
-_UI_LABEL_NO_LOCATION_SPECIFIED = No Location Specified
-_UI_ACTION_SET_MULTIPLICITY = Set &Multiplicity
-_UI_LABEL_ABSENT = absent
-_UI_GRAPH_UNKNOWN_OBJECT = Unknown object
-_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified)
-_UI_GRAPH_XSDSCHEMA = Schema
-_UI_MENU_XSD_EDITOR = &XSD
-_UI_LABEL_SET_TYPE = Set Type
-
-!
-! Preference Page
-!
-_UI_TEXT_INDENT_LABEL = Indentation
-_UI_TEXT_INDENT_SPACES_LABEL = &Number of spaces:
-_UI_TEXT_XSD_NAMESPACE_PREFIX = Creating files
-_UI_XML_TEXT_EDITOR_PREFS_LINK = XML Schema editing preferences. Note that some preferences may be set on the XML <a>{0}</a> preference page.
-_UI_XML_VALIDATOR_PREFS_LINK = Note that some preferences may be set on the XML <a>{0}</a> preference page.
-_UI_TEXT_XSD_DEFAULT_PREFIX = XML schema language constructs &prefix:
-_UI_QUALIFY_XSD = &Qualify XML schema language constructs
-_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default &target namespace:
-_UI_VALIDATING_FILES = Validating files
-_UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS = Honour all schema locations
-_UI_FULL_CONFORMANCE = &Check full XML Schema conformance
-_UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP = &Automatically remove unused XSD imports and XML Namespace entries
-_UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG = &Prompt for schema location when adding a directive
-
-_ERROR_LABEL_INVALID_PREFIX = IWAX1004E Invalid prefix. A prefix must not be empty or contain any space.
-
-_UI_NO_TYPE_DEFINED=(no type defined)
-_UI_ACTION_UPDATE_NAME=Update Name
-_UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update Element reference
-_UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE=Update Attribute reference
-_UI_ACTION_ADD_FIELD=Add Field
-_UI_ACTION_ADD_ELEMENT=Add &Element
-_UI_ACTION_INSERT_ELEMENT=I&nsert Element
-_UI_ACTION_BEFORE=&Before
-_UI_ACTION_AFTER=&After
-_UI_ACTION_ADD_INCLUDE=Add In&clude
-_UI_ACTION_ADD_IMPORT=Add I&mport
-_UI_ACTION_ADD_REDEFINE=Add &Redefine
-_UI_ACTION_ADD_ELEMENT_REF=Add E&lement Ref
-_UI_ACTION_ADD_COMPLEX_TYPE=Add &Complex Type
-_UI_ACTION_ADD_SIMPLE_TYPE=Add &Simple Type
-_UI_ACTION_SET_TYPE=Set &Type
-_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
-_UI_ACTION_INSERT_ATTRIBUTE=I&nsert Attribute
-_UI_ACTION_ADD_ATTRIBUTE_REF=Add Attribute &Ref
-_UI_ACTION_NEW=&New...
-_UI_ACTION_BROWSE=&Browse...
-_UI_ACTION_DRAG_DROP_ELEMENT=Reorder Elements
-_UI_ACTION_DRAG_DROP_ATTRIBUTE=Reorder Attributes
-_UI_ACTION_REDEFINE_COMPLEX_TYPE=Redefine &Complex Type
-_UI_ACTION_REDEFINE_SIMPLE_TYPE=Redefine &Simple Type
-_UI_ACTION_REDEFINE_ATTRIBUTE_GROUP=Redefine &Attribute Group
-_UI_ACTION_REDEFINE_MODEL_GROUP=Redefine &Model Group
-_UI_ACTION_RENAME=Rename
-
-_UI_LABEL_OPTIONAL=Optional
-_UI_LABEL_ZERO_OR_MORE=Zero or more
-_UI_LABEL_ONE_OR_MORE=One or more
-_UI_LABEL_LOCAL_TYPE=local type
-_UI_LABEL_REQUIRED=Required
-_UI_LABEL_ARRAY=array
-
-_UI_LABEL_SET_COMMON_BUILT_IN_TYPES=Set common Built-In types
-_UI_LABEL_SELECT_TYPES_FILTER_OUT=Select the types that you do not want to filter out:
-_UI_LABEL_NAME_SEARCH_FILTER_TEXT=Name (? = any character, * = any string):
-_UI_LABEL_SET_ELEMENT_REFERENCE=Set element reference
-_UI_LABEL_SET_ATTRIBUTE_REFERENCE=Set attribute reference
-_UI_LABEL_REDEFINE_COMPONENT=Redefine component
-
-_UI_LABEL_NEW_TYPE=New Type
-_UI_VALUE_NEW_TYPE={0}Type
-_UI_LABEL_NEW_ELEMENT=New Element
-_UI_LABEL_NEW_ATTRIBUTE=New Attribute
-_UI_LABEL_COMPLEX_TYPE=&Complex Type
-_UI_LABEL_TARGET_NAMESPACE=Target Namespace:
-_UI_LABEL_NO_NAMESPACE=No Namespace
-_UI_LABEL_ELEMENTS_COLON=Elements:
-_UI_LABEL_ATTRIBUTES_COLON=Attributes:
-_UI_LABEL_SIMPLE_TYPE=&Simple Type
-_UI_LABEL_TYPES_COLON=Types:
-
-_UI_LABEL_SOURCE=Source
-
-_UI_LABEL_ELEMENTFORMDEFAULT=Prefix qualification of local elements:
-_UI_LABEL_ATTRIBUTEFORMDEFAULT=Prefix qualification of attributes:
-_UI_LABEL_CREATE_ANON_TYPE=Create as local &anonymous type
-
-_UI_LABEL_ATTRIBUTES_PROCESSCONTENTS=Process Contents:
-_UI_LABEL_ATTRIBUTES_NAMESPACE=Namespace:
-
-_UI_IMAGE_COMPLEX_TYPE=icons/XSDComplexType.gif
-_UI_IMAGE_SIMPLE_TYPE=icons/XSDSimpleType.gif
-_UI_IMAGE_MODEL_GROUP=icons/XSDGroup.gif
-_UI_IMAGE_ATTRIBUTE_GROUP=icons/XSDAttributeGroup.gif
-
-_UI_COMBO_NEW=New...
-_UI_COMBO_BROWSE=Browse...
-
-_UI_ERROR_INVALID_NAME=Invalid name \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java
deleted file mode 100644
index 4e3c62acfb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java
+++ /dev/null
@@ -1,25 +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.xsd.ui.internal.editor.search;
-
-public interface IXSDTypesFilter {
- /**
- * Give me an Object o, if I know it and it should be filtered out, I will
- * return true. Otherwise I'll return false, even if I don't know the object
- * @param o
- * @return
- */
- public boolean shouldFilterOut(Object o);
-
- public void turnOn();
- public void turnOff();
- public boolean isOn();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDAttributeSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDAttributeSearchListProvider.java
deleted file mode 100644
index e74fa122f0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDAttributeSearchListProvider.java
+++ /dev/null
@@ -1,64 +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.wst.xsd.ui.internal.editor.search;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDAttributeSearchListProvider extends XSDSearchListProvider
-{
-
- public XSDAttributeSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- // now we traverse the types already defined within the visible schemas
- // we do this in addition to the component search since this should execute
- // very quickly and there's a good chance the user wants to select a time that's
- // already imported/included
- // TODO (cs) ensure we don't add duplicates when we proceed to use the search list
- //
- List visitedSchemas = new ArrayList();
- for (int i = 0; i < schemas.length; i++)
- {
- XSDSchema schema = schemas[i];
- ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ATTRIBUTE_META_NAME);
- visitor.visitSchema(schema, true);
- visitedSchemas.addAll(visitor.getVisitedSchemas());
- }
- // finally we call the search API's to do a potentially slow search
- if (scope != null)
- {
- populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
- }
- }
-
- private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files)
- {
- SearchEngine searchEngine = new SearchEngine();
- InternalSearchRequestor requestor = new InternalSearchRequestor(list, files);
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.ATTRIBUTE_META_NAME);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java
deleted file mode 100644
index 1ecd32718f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDComponentDescriptionProvider extends LabelProvider implements IComponentDescriptionProvider
-{
- public boolean isApplicable(Object component)
- {
- // TODO (cs) if this provider is used in a multi language context
- // we'll need to provide some logic here
- return true;
- }
-
- private static final Image SIMPLE_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
- private static final Image COMPLEX_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
- private static final Image ELEMENT_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
- private static final Image ATTRIBUTE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
- //private final static Image BUILT_IN_TYPE)IMAGE =
-
- public String getQualifier(Object component)
- {
- String result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getQualifier();
- }
- else if (component instanceof XSDNamedComponent)
- {
- result = ((XSDNamedComponent)component).getTargetNamespace();
- }
- else if (component instanceof SearchMatch)
- {
- QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
- if (qualifiedName != null)
- {
- result = qualifiedName.getNamespace();
- }
- }
- return result;
- }
-
- // TODO... this will be much easier with Hiroshi's proposed SearchMatch changes
- //
- private QualifiedName getQualifiedNameForSearchMatch(SearchMatch match)
- {
- QualifiedName qualifiedName = null;
- Object o = match.map.get("name");
- if (o != null && o instanceof QualifiedName)
- {
- qualifiedName = (QualifiedName)o;
- }
- return qualifiedName;
- }
-
- public String getName(Object component)
- {
- String result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getName();
- }
- else if (component instanceof XSDNamedComponent)
- {
- result = ((XSDNamedComponent)component).getName();
- }
- else if (component instanceof SearchMatch)
- {
- QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
- if (qualifiedName != null)
- {
- result = qualifiedName.getLocalName();
- }
- }
- return result;
- }
-
- public IFile getFile(Object component)
- {
- IFile result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getFile();
- }
- else if (component instanceof SearchMatch)
- {
- result = ((SearchMatch)component).getFile();
- }
- else if (component instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent)component;
- XSDSchema schema = concreteComponent.getSchema();
- if (schema != null)
- {
- // TODO (cs) revisit and test more
- //
- String location = schema.getSchemaLocation();
- String platformResource = "platform:/resource";
- if (location != null && location.startsWith(platformResource))
- {
- Path path = new Path(location.substring(platformResource.length()));
- result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- }
- return result;
- }
-
- public ILabelProvider getLabelProvider()
- {
- return this;
- }
-
- public String getText(Object element)
- {
- String result = "";
- String name = getName(element);
- if (name != null)
- {
- result += name;
- /*
- String qualifier = getQualifier(element);
- if (qualifier != null)
- {
- result += " - " + qualifier;
- }
- IFile file = getFile(element);
- if (file != null)
- {
- result += " (" + file.getProject().getName() + ")";
- }*/
- }
- return result;
- }
-
- public Image getImage(Object component)
- {
- Image result = null;
- if (component instanceof SearchMatch)
- {
- SearchMatch searchMatch = (SearchMatch)component;
- QualifiedName qualifiedName = (QualifiedName)searchMatch.map.get("metaName");
- if ( qualifiedName != null ){
- if ( qualifiedName.equals(IXSDSearchConstants.SIMPLE_TYPE_META_NAME))
- result = SIMPLE_TYPE_IMAGE;
- else if ( qualifiedName.equals(IXSDSearchConstants.COMPLEX_TYPE_META_NAME))
- result = COMPLEX_TYPE_IMAGE;
- else if ( qualifiedName.equals(IXSDSearchConstants.ELEMENT_META_NAME))
- result = ELEMENT_IMAGE;
- else if ( qualifiedName.equals(IXSDSearchConstants.ATTRIBUTE_META_NAME))
- result = ATTRIBUTE_IMAGE;
- }
- }
- else if (component instanceof XSDComplexTypeDefinition)
- result = COMPLEX_TYPE_IMAGE;
- else if (component instanceof XSDSimpleTypeDefinition)
- result = SIMPLE_TYPE_IMAGE;
- else if (component instanceof XSDElementDeclaration)
- result = ELEMENT_IMAGE;
- else if (component instanceof XSDAttributeDeclaration)
- result = ATTRIBUTE_IMAGE;
- return result;
- }
-
- public Image getFileIcon(Object component) {
- return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif");
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java
deleted file mode 100644
index a94042b5bc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java
+++ /dev/null
@@ -1,59 +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.xsd.ui.internal.editor.search;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDElementsSearchListProvider extends XSDSearchListProvider
-{
- public XSDElementsSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- // now we traverse the types already defined within the visible schemas
- // we do this in addition to the component search since this should execute
- // very quickly and there's a good chance the user wants to select a time that's
- // already imported/included
- // TODO (cs) ensure we don't add duplicates when we proceed to use the search list
- //
- List visitedSchemas = new ArrayList();
- for (int i = 0; i < schemas.length; i++)
- {
- XSDSchema schema = schemas[i];
- ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ELEMENT_META_NAME);
- visitor.visitSchema(schema, true);
- visitedSchemas.addAll(visitor.getVisitedSchemas());
- }
- // finally we call the search API's to do a potentially slow search
- if (scope != null)
- {
- populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
- }
- }
-
- private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files)
- {
- SearchEngine searchEngine = new SearchEngine();
- InternalSearchRequestor requestor = new InternalSearchRequestor(list, files);
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.ELEMENT_META_NAME);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java
deleted file mode 100644
index 7f62dabee1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSearchListDialogDelegate implements IComponentDialog
-{
- public final static QualifiedName TYPE_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "type"); //$NON-NLS-1$
- public final static QualifiedName ELEMENT_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element"); //$NON-NLS-1$
- public final static QualifiedName ATTRIBUTE_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "attribute"); //$NON-NLS-1$
- // protected Object setObject;
- protected ComponentSpecification selection;
- protected IFile currentFile;
- protected XSDSchema[] schemas;
- protected QualifiedName metaName;
- protected boolean showComplexTypes = true;
-
- public XSDSearchListDialogDelegate(QualifiedName metaName, IFile currentFile, XSDSchema[] schemas)
- {
- super();
- this.metaName = metaName;
- this.currentFile = currentFile;
- this.schemas = schemas;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- return selection;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- /**
- * Whether to show complex types in the Dialog's List, has no effect if the
- * dialog populates list of elements instead of type
- * @param value
- */
- public void showComplexTypes(boolean value)
- {
- showComplexTypes = value;
- }
-
- public int createAndOpen()
- {
- Shell shell = XSDEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- int returnValue = Window.CANCEL;
- ScopedComponentSearchListDialog dialog = null;
-
- // TODO (cs) lot's of code is common to both these blocks. Can we re-org it a bit
- // so it's easier to see the difference between how we config for an element vs type?
- if ( metaName == ELEMENT_META_NAME)
- {
- XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
- final XSDElementsSearchListProvider searchListProvider = new XSDElementsSearchListProvider(currentFile, schemas);
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT);
- configuration.setListLabelText(Messages._UI_LABEL_ELEMENTS_COLON);
-// configuration.setNewComponentHandler(new NewElementButtonHandler());
- //TODO externalize string
- dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_ELEMENT_REFERENCE, configuration);
- }
- else if ( metaName == ATTRIBUTE_META_NAME)
- {
- XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
- final XSDAttributeSearchListProvider searchListProvider = new XSDAttributeSearchListProvider(currentFile, schemas);
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT);
- configuration.setListLabelText(Messages._UI_LABEL_ATTRIBUTES_COLON);
- dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_ATTRIBUTE_REFERENCE, configuration);
- }
- else if (metaName == TYPE_META_NAME)
- {
- XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
- final XSDTypesSearchListProvider searchListProvider = new XSDTypesSearchListProvider(currentFile, schemas);
- if (!showComplexTypes)
- searchListProvider.showComplexTypes(false);
-
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
-// configuration.setNewComponentHandler(new NewTypeButtonHandler());
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT);
- configuration.setListLabelText(Messages._UI_LABEL_TYPES_COLON);
- dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_TYPE, configuration); //$NON-NLS-1$
- }
-
- if (dialog != null)
- {
- dialog.setCurrentResource(currentFile);
- dialog.setBlockOnOpen(true);
- dialog.create();
- returnValue = dialog.open();
- if (returnValue == Window.OK)
- {
- selection = dialog.getSelectedComponent();
- }
- }
- return returnValue;
- }
-
-// private IEditorPart getActiveEditor()
-// {
-// IWorkbench workbench = PlatformUI.getWorkbench();
-// IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-// IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-// return editorPart;
-// }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java
deleted file mode 100644
index 6f53f9146a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-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.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchPlugin;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public abstract class XSDSearchListProvider implements IComponentSearchListProvider
-{
- protected XSDSchema[] schemas;
- protected IFile currentFile;
- // TODO (cs) remove these and use proper search scopes!
- //
- public static final int ENCLOSING_PROJECT_SCOPE = 0;
- public static final int ENTIRE_WORKSPACE_SCOPE = 1;
-
- public XSDSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- this.schemas = schemas;
- this.currentFile = currentFile;
-
- try
- {
- IProject[] refs = currentFile.getProject().getReferencedProjects();
-
- for (int i=0; i < refs.length; i++)
- {
- System.out.println("dep " + refs[i].getName());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- }
-
-
- class ComponentCollectingXSDVisitor
- {
- protected List visitedSchemas = new ArrayList();
- IComponentList list;
- QualifiedName searchKind;
-
- ComponentCollectingXSDVisitor(IComponentList list, QualifiedName searchKind)
- {
- this.list = list;
- this.searchKind = searchKind;
- }
-
- public void visitSchema(final XSDSchema schema, boolean visitImportedSchema)
- {
- visitedSchemas.add(schema);
- for (Iterator contents = schema.getContents().iterator(); contents.hasNext();)
- {
- XSDSchemaContent content = (XSDSchemaContent) contents.next();
- if (content instanceof XSDSchemaDirective)
- {
- final XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content;
- XSDSchema extSchema = schemaDirective.getResolvedSchema();
- if (extSchema == null && schemaDirective instanceof XSDImport && visitImportedSchema)
- {
- // Force the import declaration to resolve. The work must be done in the UI thread
- // because there are UI components listening to changes in the schema content.
-
- UIJob loadImportJob = new UIJob(XSDEditorPlugin.getResourceString("_UI_LABEL_LOADING_XML_SCHEMA")) //$NON-NLS-1$
- {
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- // The schema model will load the import when trying to resolve any component
- // in the imported schema's namespace.
-
- XSDImport xsdImport = (XSDImport)schemaDirective;
- String importNamespace = xsdImport.getNamespace();
- schema.resolveAttributeDeclaration(importNamespace, ""); //$NON-NLS-1$
- return Status.OK_STATUS;
- }
- };
- loadImportJob.setSystem(true);
- loadImportJob.schedule();
- try
- {
- loadImportJob.join();
- }
- catch (InterruptedException e)
- {
- // Nothing to do about it.
- }
- extSchema = schemaDirective.getResolvedSchema();
- }
-
- if (extSchema != null && !visitedSchemas.contains(extSchema))
- {
- if (schemaDirective instanceof XSDImport && visitImportedSchema)
- {
- visitSchema(extSchema, false);
- }
- else if (schemaDirective instanceof XSDInclude || schemaDirective instanceof XSDRedefine)
- {
- visitSchema(extSchema, false);
- }
- }
- }
- else if (content instanceof XSDElementDeclaration && searchKind == IXSDSearchConstants.ELEMENT_META_NAME)
- {
- list.add(content);
- }
- else if (content instanceof XSDAttributeDeclaration && searchKind == IXSDSearchConstants.ATTRIBUTE_META_NAME)
- {
- list.add(content);
- }
- else if (content instanceof XSDSimpleTypeDefinition && searchKind == IXSDSearchConstants.SIMPLE_TYPE_META_NAME)
- {
- // in this case we only want to show simple types
- list.add(content);
- }
- else if (content instanceof XSDTypeDefinition && searchKind == IXSDSearchConstants.TYPE_META_NAME)
- {
- // in this case we want to show all types
- list.add(content);
- }
- }
- }
-
- public List getVisitedSchemas()
- {
- return visitedSchemas;
- }
- }
-
-
- class InternalSearchRequestor extends SearchRequestor
- {
- IComponentList componentList;
- HashMap files;
-
- InternalSearchRequestor(IComponentList componentList, HashMap files)
- {
- this.componentList = componentList;
- this.files = files;
- }
-
- public void acceptSearchMatch(SearchMatch match) throws CoreException
- {
- // we filter out the matches from the current file since we assume the
- // info derived from our schema models is more update to date
- // (in the event that we haven't saved our latest modifications)
- //
- if (files.get(match.getFile()) == null)
- {
- // TODO... this ugly qualified name stashing will go away soon
- //
- QualifiedName qualifiedName = null;
- Object o = match.map.get("name");
- if (o != null && o instanceof QualifiedName)
- {
- qualifiedName = (QualifiedName)o;
- }
- if (qualifiedName != null && qualifiedName.getLocalName() != null)
- {
- componentList.add(match);
- }
- }
- }
- }
-
- protected void findMatches(SearchEngine searchEngine, SearchRequestor requestor, SearchScope scope, QualifiedName metaName)
- {
- try
- {
- XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(new QualifiedName("*", "*"), metaName, SearchPattern.R_PATTERN_MATCH);
- // TODO (cs) revist this... we shouldn't be needing to hard-code partipant id's
- // All we're really doing here is trying to avoid finding matches in
- // wsdl's since we don't ever want to import/include a wsdl from a schema!
- // Maybe we should just scope out any file types that aren't xsd's using a
- // custom SearchScope?
- //
- SearchParticipant particpant = SearchPlugin.getDefault().getSearchParticipant("org.eclipse.wst.xsd.search.XSDSearchParticipant");
- Assert.isNotNull(particpant);
- SearchParticipant[] participants = {particpant};
- searchEngine.search(pattern, requestor, participants, scope, null, new NullProgressMonitor());
- }
- catch (CoreException e)
- {
- e.printStackTrace();
- }
- }
-
-
- protected HashMap createFileMap(List visitedSchemas)
- {
- HashMap fileMap = new HashMap();
- for (Iterator i = visitedSchemas.iterator(); i.hasNext(); )
- {
- XSDSchema theSchema = (XSDSchema)i.next();
- String location = theSchema.getSchemaLocation();
- IFile file = computeFile(location);
- if (file != null)
- {
- fileMap.put(file, Boolean.TRUE);
- }
- }
- return fileMap;
- }
-
- private IFile computeFile(String baseLocation)
- {
- IFile file = null;
- if (baseLocation != null)
- {
- String fileScheme = "file:"; //$NON-NLS-1$
- String platformResourceScheme = "platform:/resource";
- if (baseLocation.startsWith(fileScheme))
- {
- baseLocation = baseLocation.substring(fileScheme.length());
- baseLocation = removeLeading(baseLocation, "/");
- IPath path = new Path(baseLocation);
- file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- }
- else if (baseLocation.startsWith(platformResourceScheme))
- {
- baseLocation = baseLocation.substring(platformResourceScheme.length());
- baseLocation = removeLeading(baseLocation, "/");
- IPath path = new Path(baseLocation);
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return file;
- }
-
- private String removeLeading(String path, String pattern)
- {
- while (path.startsWith(pattern))
- {
- path = path.substring(pattern.length());
- }
- return path;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java
deleted file mode 100644
index 9d80faeaab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java
+++ /dev/null
@@ -1,110 +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.xsd.ui.internal.editor.search;
-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.IProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-public class XSDTypesSearchListProvider extends XSDSearchListProvider
-{
- protected IXSDTypesFilter builtInFilter;
- /**
- * Determines if we should use the filter This us used to turn the filter on
- * and off
- */
- protected boolean supportFilter = true;
- private boolean showComplexTypes = true;
-
- public XSDTypesSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- // first we add the 'built in' types
- //
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (builtInFilter == null || !builtInFilter.shouldFilterOut(td))
- {
- list.add(td);
- }
- }
- // now we traverse the types already defined within the visible schemas
- // we do this in addition to the component search since this should execute
- // very quickly and there's a good chance the user wants to select a time
- // that's
- // already imported/included
- // TODO (cs) ensure we don't add duplicates when we proceed to use the
- // search list
- //
- List visitedSchemas = new ArrayList();
- for (int i = 0; i < schemas.length; i++)
- {
- XSDSchema schema = schemas[i];
- QualifiedName kind = showComplexTypes ? IXSDSearchConstants.TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME;
- ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, kind);
- visitor.visitSchema(schema, true);
- visitedSchemas.addAll(visitor.getVisitedSchemas());
- }
- // finally we call the search API's to do a potentially slow search
- //
- if (scope != null)
- {
- populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
- }
- }
-
- private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files)
- {
- SearchEngine searchEngine = new SearchEngine();
- InternalSearchRequestor requestor = new InternalSearchRequestor(list, files);
- if (showComplexTypes)
- {
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.COMPLEX_TYPE_META_NAME);
- }
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.SIMPLE_TYPE_META_NAME);
- }
-
-
- public void _populateComponentListQuick(IComponentList list, IProgressMonitor pm)
- {
- }
-
- public void turnBuiltInFilterOn(boolean option)
- {
- supportFilter = option;
- }
-
- public void setBuiltInFilter(IXSDTypesFilter filter)
- {
- this.builtInFilter = filter;
- }
-
- public void showComplexTypes(boolean show)
- {
- showComplexTypes = show;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java
deleted file mode 100644
index 6f256a1437..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.navigation;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.NavigationLocation;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDVisitor;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * This class exists to support navigation in a context where there is no text
- * editor page. In these cases we can't rely on the TextSelectionNavigationLocations
- * so we this class which is designed to work with just the design view.
- */
-public class DesignViewNavigationLocation extends NavigationLocation
-{
- protected Path path;
-
- private static final String PATH_TAG = "path"; //$NON-NLS-1$
-
- public DesignViewNavigationLocation(IEditorPart part)
- {
- super(part);
- this.path = new Path();
- }
-
- public DesignViewNavigationLocation(IEditorPart part, XSDConcreteComponent component)
- {
- super(part);
- this.path = Path.computePath(component);
- }
-
- public boolean mergeInto(INavigationLocation currentLocation)
- {
- boolean result = false;
- if (currentLocation instanceof DesignViewNavigationLocation)
- {
- DesignViewNavigationLocation loc = (DesignViewNavigationLocation) currentLocation;
- result = loc.path.toString().equals(path.toString());
- }
- else
- {
- }
- return result;
- }
-
- public void restoreLocation()
- {
- XSDSchema schema = (XSDSchema) getEditorPart().getAdapter(XSDSchema.class);
- Object viewer = getEditorPart().getAdapter(GraphicalViewer.class);
- if (viewer instanceof DesignViewGraphicalViewer)
- {
- DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) viewer;
- XSDConcreteComponent component = Path.computeComponent(schema, path);
- if (component != null)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(component);
- if (adapter instanceof IADTObject)
- {
- graphicalViewer.setInput((IADTObject)adapter);
- }
- }
- else if (path.segments.isEmpty())
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(schema);
- if (adapter instanceof IADTObject)
- {
- graphicalViewer.setInput((IADTObject)adapter);
- }
- }
- }
- }
-
- public void restoreState(IMemento memento)
- {
- String string = memento.getString(PATH_TAG);
- path = Path.createPath(string);
- }
-
- public void saveState(IMemento memento)
- {
- memento.putString(PATH_TAG, path.toString());
- }
-
- public void update()
- {
- // TODO (cs) not sure what needs to be done here
- }
- static class PathSegment
- {
- final static int ELEMENT = 1;
- final static int TYPE = 2;
- final static int MODEL_GROUP = 3;
- final static int ATTRIBUTE_GROUP = 4;
- final static int REDEFINE = 5;
- int kind;
- String name;
-
- PathSegment()
- {
- }
-
- PathSegment(int kind, String name)
- {
- this.kind = kind;
- this.name = name;
- }
- }
- protected static class Path
- {
- private static final String REDEFINE_TOKEN = "redefine"; //$NON-NLS-1$
- private static final String MODEL_GROUP_TOKEN = "modelGroup"; //$NON-NLS-1$
- private static final String ATTRIBUTE_GROUP_TOKEN = "attributeGroup"; //$NON-NLS-1$
- private static final String TYPE_TOKEN = "type"; //$NON-NLS-1$
- private static final String ELEMENT_TOKEN = "element"; //$NON-NLS-1$
-
- List segments = new ArrayList();
-
- public static XSDConcreteComponent computeComponent(XSDSchema schema, Path path)
- {
- PathResolvingXSDVisitor visitor = new PathResolvingXSDVisitor(path);
- visitor.visitSchema(schema);
- if (visitor.isDone())
- {
- return visitor.result;
- }
- return null;
- }
-
- static Path createPath(String pathString)
- {
- Path path = new Path();
- PathSegment segment = null;
- for (StringTokenizer st = new StringTokenizer(pathString, "/"); st.hasMoreTokens();)
- {
- String token = st.nextToken();
- int kind = -1;
- if (token.startsWith(ELEMENT_TOKEN))
- {
- kind = PathSegment.ELEMENT;
- }
- else if (token.startsWith(TYPE_TOKEN))
- {
- kind = PathSegment.TYPE;
- }
- else if (token.startsWith(ATTRIBUTE_GROUP_TOKEN))
- {
- kind = PathSegment.ATTRIBUTE_GROUP;
- }
- else if (token.startsWith(MODEL_GROUP_TOKEN))
- {
- kind = PathSegment.MODEL_GROUP;
- }
- else if (token.startsWith(REDEFINE_TOKEN))
- {
- kind = PathSegment.REDEFINE;
- }
- if (kind != -1)
- {
- segment = new PathSegment();
- segment.kind = kind;
- path.segments.add(segment);
- String namePattern = "[@name='";
- int startIndex = token.indexOf(namePattern);
- if (startIndex != -1)
- {
- startIndex += namePattern.length();
- int endIndex = token.indexOf("']");
- if (endIndex != -1)
- {
- segment.name = token.substring(startIndex, endIndex);
- }
- }
- }
- }
- return path;
- }
-
- public static Path computePath(XSDConcreteComponent component)
- {
- Path path = new Path();
- for (EObject c = component; c != null; c = c.eContainer())
- {
- if (c instanceof XSDConcreteComponent)
- {
- PathSegment segment = computePathSegment((XSDConcreteComponent) c);
- if (segment != null)
- {
- path.segments.add(0, segment);
- }
- }
- }
- return path;
- }
-
- static PathSegment computePathSegment(XSDConcreteComponent component)
- {
- PathSegment pathSegment = null;
- if (component instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) component;
- pathSegment = new PathSegment(PathSegment.ELEMENT, elementDeclaration.getResolvedElementDeclaration().getName());
- }
- else if (component instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) component;
- pathSegment = new PathSegment(PathSegment.TYPE, typeDefinition.getName());
- }
- else if (component instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) component;
- pathSegment = new PathSegment(PathSegment.MODEL_GROUP, modelGroupDefinition.getName());
- }
- else if (component instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) component;
- pathSegment = new PathSegment(PathSegment.ATTRIBUTE_GROUP, attributeGroupDefinition.getResolvedAttributeGroupDefinition().getName());
- }
- else if (component instanceof XSDRedefine)
- {
- XSDRedefine redefine = (XSDRedefine) component;
- pathSegment = new PathSegment(PathSegment.REDEFINE, redefine.getSchemaLocation());
- }
- return pathSegment;
- }
-
- public String toString()
- {
- StringBuffer b = new StringBuffer();
- for (Iterator i = segments.iterator(); i.hasNext();)
- {
- PathSegment segment = (PathSegment) i.next();
- String kind = "";
- if (segment.kind == PathSegment.ELEMENT)
- {
- kind = ELEMENT_TOKEN;
- }
- else if (segment.kind == PathSegment.TYPE)
- {
- kind = TYPE_TOKEN;
- }
- else if (segment.kind == PathSegment.MODEL_GROUP)
- {
- kind = MODEL_GROUP_TOKEN;
- }
- else if (segment.kind == PathSegment.ATTRIBUTE_GROUP)
- {
- kind = ATTRIBUTE_GROUP_TOKEN;
- }
- else if (segment.kind == PathSegment.REDEFINE)
- {
- kind = REDEFINE_TOKEN;
- }
- b.append(kind);
- if (segment.name != null)
- {
- b.append("[@name='" + segment.name + "']");
- }
- if (i.hasNext())
- {
- b.append("/");
- }
- }
- return b.toString();
- }
- }
-
-
- static class PathResolvingXSDVisitor extends XSDVisitor
- {
- Path path;
- int index = -1;
- PathSegment segment;
- XSDConcreteComponent result = null;
-
- PathResolvingXSDVisitor(Path path)
- {
- this.path = path;
- incrementSegment();
- }
-
- boolean isDone()
- {
- return index >= path.segments.size();
- }
-
- void incrementSegment()
- {
- index++;
- if (index < path.segments.size())
- {
- segment = (PathSegment) path.segments.get(index);
- }
- else
- {
- segment = null;
- }
- }
-
- public void visitSchema(XSDSchema schema)
- {
- if (segment != null)
- {
- if (segment.kind == PathSegment.ELEMENT)
- {
- XSDElementDeclaration elementDeclaration = schema.resolveElementDeclaration(segment.name);
- if (elementDeclaration != null)
- {
- visitElementDeclaration(elementDeclaration);
- }
- }
- else if (segment.kind == PathSegment.TYPE)
- {
- XSDTypeDefinition typeDefinition = schema.resolveTypeDefinition(segment.name);
- if (typeDefinition != null)
- {
- visitTypeDefinition(typeDefinition);
- }
- }
- else if (segment.kind == PathSegment.MODEL_GROUP)
- {
- XSDModelGroupDefinition modelGroupDefinition = schema.resolveModelGroupDefinition(segment.name);
- if (modelGroupDefinition != null)
- {
- visitModelGroupDefinition(modelGroupDefinition);
- }
- }
- else if (segment.kind == PathSegment.ATTRIBUTE_GROUP)
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = schema.resolveAttributeGroupDefinition(segment.name);
- if (attributeGroupDefinition != null)
- {
- visitAttributeGroupDefinition(attributeGroupDefinition);
- }
- }
- else if (segment.kind == PathSegment.REDEFINE)
- {
- Iterator iterator = schema.getContents().iterator();
- while (iterator.hasNext())
- {
- Object object = iterator.next();
- if (object instanceof XSDRedefine)
- {
- XSDRedefine redefine = (XSDRedefine)object;
- visitRedefine(redefine);
- }
- }
- }
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (segment != null)
- {
- String name = element.getResolvedElementDeclaration().getName();
- if (segment.kind == PathSegment.ELEMENT && isMatch(segment.name, name))
- {
- result = element;
- incrementSegment();
- if (!isDone())
- {
- super.visitElementDeclaration(element);
- }
- }
- }
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (segment != null)
- {
- String name = type.getName();
- if (segment.kind == PathSegment.TYPE && isMatch(segment.name, name))
- {
- result = type;
- incrementSegment();
- if (!isDone())
- {
- super.visitTypeDefinition(type);
- }
- }
- }
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
- {
- if (segment != null)
- {
- String name = modelGroup.getName();
- if (segment.kind == PathSegment.MODEL_GROUP && isMatch(segment.name, name))
- {
- result = modelGroup;
- incrementSegment();
- if (!isDone())
- {
- super.visitModelGroupDefinition(modelGroup);
- }
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- if (segment != null)
- {
- String name = attributeGroup.getName();
- if (segment.kind == PathSegment.ATTRIBUTE_GROUP && isMatch(segment.name, name))
- {
- result = attributeGroup;
- incrementSegment();
- if (!isDone())
- {
- super.visitAttributeGroupDefinition(attributeGroup);
- }
- }
- }
- }
-
- public void visitRedefine(XSDRedefine redefine)
- {
- if (segment != null)
- {
- String name = redefine.getSchemaLocation();
- if (segment.kind == PathSegment.REDEFINE && isMatch(segment.name, name))
- {
- result = redefine;
- incrementSegment();
- if (!isDone())
- {
- visitSchema(redefine.getSchema());
- }
- }
- }
-
- }
- protected boolean isMatch(String name1, String name2)
- {
- return name1 != null ? name1.equals(name2) : name1 == name2;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
deleted file mode 100644
index e0f65945c0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
+++ /dev/null
@@ -1,50 +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.xsd.ui.internal.navigation;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-
-/**
- * The platform's navigation history plumbing doesn't like multipage text
- * editors very much and tends to ignore text locations. To fix this
- * problem we need to override the getEditPart() method of the super class
- * in order to return the actual TextEditor of our multi-page editor
- */
-public class MultiPageEditorTextSelectionNavigationLocation extends TextSelectionNavigationLocation
-{
- public MultiPageEditorTextSelectionNavigationLocation(ITextEditor part, boolean initialize)
- {
- super(part, initialize);
- }
-
- protected IEditorPart getEditorPart()
- {
- IEditorPart part = super.getEditorPart();
- if (part != null)
- return (ITextEditor) part.getAdapter(ITextEditor.class);
- return null;
- }
-
- public String getText()
- {
- // ISSUE: how to get title?
- // IEditorPart part = getEditorPart();
- // if (part instanceof WSDLTextEditor) {
- // return ((WSDLTextEditor) part).getWSDLEditor().getTitle();
- // }
- // else {
- // return super.getText();
- // }
- return super.getText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
deleted file mode 100644
index 3ce74a83c2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SchemaPrefixChangeHandler
-{
- String newPrefix;
- XSDSchema xsdSchema;
- String namespace;
-
- public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
- {
- this.xsdSchema = xsdSchema;
- this.newPrefix= newPrefix;
- namespace = XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001;
- }
-
- public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix, String namespace)
- {
- this.xsdSchema = xsdSchema;
- this.newPrefix= newPrefix;
- this.namespace = namespace;
- }
-
- public void resolve()
- {
- XSDSchemaPrefixRenamer xsdSchemaPrefixRenamer = new XSDSchemaPrefixRenamer();
- xsdSchemaPrefixRenamer.visitSchema(xsdSchema);
- }
-
- public String getNewQName(XSDTypeDefinition comp, String value, String newXSDPrefix)
- {
- String qName = null;
- if (value != null)
- {
- qName = newXSDPrefix;
- if (qName != null && qName.length() > 0)
- {
- qName += ":" + value;
- }
- else
- {
- qName = value;
- }
- }
- else
- {
- qName = value;
- }
-
- return qName;
- }
-
-
- class XSDSchemaPrefixRenamer extends XSDVisitor
- {
- public XSDSchemaPrefixRenamer()
- {
- super();
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- super.visitElementDeclaration(element);
- XSDTypeDefinition type = element.getType();
- if (type != null)
- {
- String ns = type.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(namespace))
- {
- Element domElement = element.getElement();
- if (domElement != null && domElement instanceof IDOMNode)
- {
- Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));
- }
- }
- }
- }
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition simpleType)
- {
- super.visitSimpleTypeDefinition(simpleType);
- XSDTypeDefinition baseType = simpleType.getBaseTypeDefinition();
-
- if (baseType != null)
- {
- String ns = baseType.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(namespace))
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
- if (derivedBy != null && derivedBy instanceof IDOMNode)
- {
- Attr typeAttr = derivedBy.getAttributeNode(XSDConstants.BASE_ATTRIBUTE);
- if (typeAttr != null)
- {
- derivedBy.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName(baseType, baseType.getName(), newPrefix));
- }
- }
- }
- }
-
- XSDSimpleTypeDefinition itemType = simpleType.getItemTypeDefinition();
- if (itemType != null)
- {
- String ns = itemType.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(namespace))
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
- if (listNode != null && listNode instanceof Element)
- {
- Element listElement = (Element)listNode;
- if (listElement instanceof IDOMNode)
- {
- Attr typeAttr = listElement.getAttributeNode(XSDConstants.ITEMTYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getNewQName(itemType, itemType.getName(), newPrefix));
- }
- }
- }
- }
- }
-
- List memberTypes = simpleType.getMemberTypeDefinitions();
- if (memberTypes.size() > 0)
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Node unionNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.UNION_ELEMENT_TAG);
- if (unionNode != null && unionNode instanceof Element)
- {
- Element unionElement = (Element)unionNode;
- if (unionElement instanceof IDOMNode)
- {
- StringBuffer sb = new StringBuffer("");
- for (Iterator i = memberTypes.iterator(); i.hasNext(); )
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
- String ns = st.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(namespace))
- {
- sb.append(getNewQName(st, st.getName(), newPrefix));
- }
- else
- {
- sb.append(st.getQName(xsdSchema));
- }
- if (i.hasNext())
- {
- sb.append(" ");
- }
- }
- unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, sb.toString());
- }
- }
- }
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- super.visitAttributeDeclaration(attr);
- XSDTypeDefinition type = attr.getType();
- if (type != null)
- {
- String ns = type.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(namespace))
- {
- Element domElement = attr.getElement();
- if (domElement != null && domElement instanceof IDOMNode)
- {
- Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- attr.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
deleted file mode 100644
index d26c9df33f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
+++ /dev/null
@@ -1,152 +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.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class TargetNamespaceChangeHandler
-{
- String newNS;
- String oldNS;
- XSDSchema xsdSchema;
-
- public TargetNamespaceChangeHandler(XSDSchema xsdSchema, String oldNS, String newNS)
- {
- this.xsdSchema = xsdSchema;
- this.oldNS= oldNS;
- this.newNS= newNS;
- }
-
- public void resolve()
- {
- ElementReferenceRenamer elementReferenceRenamer = new ElementReferenceRenamer();
- elementReferenceRenamer.visitSchema(xsdSchema);
- AttributeReferenceRenamer attributeReferenceRenamer = new AttributeReferenceRenamer();
- attributeReferenceRenamer.visitSchema(xsdSchema);
- }
-
- class ElementReferenceRenamer extends XSDVisitor
- {
- public ElementReferenceRenamer()
- {
- super();
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- super.visitElementDeclaration(element);
- if (element.isElementDeclarationReference())
- {
- if (element.getResolvedElementDeclaration().getTargetNamespace() != null)
- {
- if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS))
- {
- // set the resolved element's declaration to new ns
- // this is defect 237518 - target namespace rename creates a new namespace
- element.getResolvedElementDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- element.getResolvedElementDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
-
- // Similar to defect 237518 but for attributes
- class AttributeReferenceRenamer extends XSDVisitor
- {
- public AttributeReferenceRenamer()
- {
- super();
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- super.visitComplexTypeDefinition(type);
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
- XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
- if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- super.visitAttributeGroupDefinition(attributeGroup);
- EList list = attributeGroup.getAttributeUses();
- if (list != null)
- {
- for (Iterator iter = list.iterator(); iter.hasNext(); )
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
- XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
- if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
deleted file mode 100644
index 115511a09e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
- public XSDVisitor()
- {
- }
-
- protected XSDSchema schema;
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- visitModelGroup(modelGroupDef.getModelGroup());
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- if (attributeGroup.getAttributeUses() != null)
- {
- for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
- visitAttributeDeclaration(attrUse.getContent());
- }
- }
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- XSDComplexTypeContent complexContent = type.getContent();
- if (complexContent != null)
- {
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
-
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
- visitAttributeDeclaration(attrUse.getContent());
- }
- else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
- }
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java
deleted file mode 100644
index e56ffe88e3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xsd.ui.internal.preferences;
-
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-public class XSDEditorPreferencePage extends AbstractPreferencePage
-{
- private static final String XML_EDITOR_PREFERENCE_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.source"; //$NON-NLS-1$
-
- private Button removeUnusedImports;
-
- private Button automaticallyOpenSchemaLocationDialog;
-
- protected Control createContents(Composite parent)
- {
- final Composite composite = super.createComposite(parent, 1);
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- helpSystem.setHelp(parent, XSDEditorContextIds.XSDP_EDITOR_PREFERENCE_PAGE);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, XML_EDITOR_PREFERENCE_PAGE_ID, Messages._UI_XML_TEXT_EDITOR_PREFS_LINK,
- (IWorkbenchPreferenceContainer)getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- createContentsForImportCleanup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private boolean getRemoveImportSetting()
- {
- return removeUnusedImports.getSelection();
- }
-
- private boolean getAutomaticallyOpenSchemaLocationDialogSetting()
- {
- return automaticallyOpenSchemaLocationDialog.getSelection();
- }
-
- protected void initializeValues()
- {
- IPreferenceStore store = getPreferenceStore();
- removeUnusedImports.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP));
- automaticallyOpenSchemaLocationDialog.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG));
- }
-
- protected void performDefaults()
- {
- IPreferenceStore preferenceStore = getPreferenceStore();
- removeUnusedImports.setSelection(preferenceStore.getDefaultBoolean(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP));
- automaticallyOpenSchemaLocationDialog.setSelection(preferenceStore.getDefaultBoolean(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG));
- super.performDefaults();
- }
-
- protected void storeValues()
- {
- saveValuesForImportsCleanup();
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void saveValuesForImportsCleanup()
- {
- IPreferenceStore store = getPreferenceStore();
-
- store.setValue(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP, getRemoveImportSetting());
- store.setValue(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG, getAutomaticallyOpenSchemaLocationDialogSetting());
- }
-
- /**
- * The indent is stored in the preference store associated with the XML Schema Model
- */
- public IPreferenceStore getPreferenceStore()
- {
- return XSDEditorPlugin.getPlugin().getPreferenceStore();
- }
-
- private void createContentsForImportCleanup(Composite parent)
- {
- Group unusedImportGroup = createGroup(parent, 1);
- unusedImportGroup.setText(Messages._UI_GRAPH_DIRECTIVES);
-
- //GridData
- GridData data = new GridData(SWT.FILL);
- data.verticalAlignment = SWT.CENTER;
- data.horizontalAlignment = SWT.FILL;
-
- if (removeUnusedImports == null)
- {
- removeUnusedImports = new Button(unusedImportGroup, SWT.CHECK | SWT.LEFT);
- removeUnusedImports.setText(Messages._UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP);
- removeUnusedImports.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(removeUnusedImports, XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__IMPORT_CLEANUP);
-
- automaticallyOpenSchemaLocationDialog = new Button(unusedImportGroup, SWT.CHECK | SWT.LEFT);
- automaticallyOpenSchemaLocationDialog.setText(Messages._UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG);
- automaticallyOpenSchemaLocationDialog.setLayoutData(GridDataFactory.copyData(data));
- }
- }
-
- protected void doSavePreferenceStore()
- {
- XSDEditorPlugin.getDefault().savePluginPreferences(); // model
- }
-
- public boolean performOk()
- {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
deleted file mode 100644
index 61f7d91e48..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 Carver, Standards for Technology in Automotive Retail, bug 1147033
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-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.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-public class XSDPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener
-{
- Text indentTextField;
- String indentString;
- Text schemaNsPrefixField;
- Text defaultTargetNamespaceText;
- Button qualifyXSDLanguage;
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(final Composite parent)
- {
- WorkbenchHelp.setHelp(parent, XSDEditorContextIds.XSDP_PREFERENCE_PAGE);
-
- Group group = createGroup(parent, 2);
- group.setText(Messages._UI_TEXT_XSD_NAMESPACE_PREFIX);
-
- qualifyXSDLanguage = ViewUtility.createCheckBox(group, Messages._UI_QUALIFY_XSD);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(qualifyXSDLanguage,
- XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__QUALIFY_XMLSCHEMA_LANGUAGE_CONSTRUCTS);
- ViewUtility.createLabel(group, " ");
-
- createLabel(group, Messages._UI_TEXT_XSD_DEFAULT_PREFIX);
- schemaNsPrefixField = createTextField(group);
- schemaNsPrefixField.addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- setValid(true);
- }
- });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(schemaNsPrefixField,
- XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__XML_SCHEMA_LANGUAGE_CONSTRUCTS_PREFIX);
-
- createLabel(group, Messages._UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE);
- defaultTargetNamespaceText = createTextField(group);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(defaultTargetNamespaceText,
- XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__DEFAULT_TARGETNAMESPACE);
-
-
- initializeValues();
-
- applyDialogFont(parent);
-
- return new Composite(parent, SWT.NULL);
- }
-
- private Group createGroup(Composite parent, int numColumns)
- {
- Group group = new Group(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- return group;
- }
-
- private Text createTextField(Composite parent)
- {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- text.setLayoutData(data);
-
- return text;
- }
-
- private Label createLabel(Composite parent, String text)
- {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- return label;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- checkValues();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- if (checkValues())
- {
- storeValues();
- return true;
- }
- return false;
- }
-
- protected void performApply()
- {
- if (checkValues())
- {
- storeValues();
- }
- }
-
- /**
- * Handles events generated by controls on this page.
- * @param e the event to handle
- */
- public void handleEvent(Event e)
- {
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench)
- {
- }
-
- /**
- * The indent is stored in the preference store associated with the XML Schema Model
- */
- public IPreferenceStore getPreferenceStore()
- {
- return XSDEditorPlugin.getPlugin().getPreferenceStore();
- }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
- qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
- defaultTargetNamespaceText.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
- }
-
- /**
- * Initializes states of the controls from the preference store.
- */
- private void initializeValues()
- {
- IPreferenceStore store = getPreferenceStore();
- schemaNsPrefixField.setText(store.getString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
- qualifyXSDLanguage.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
- defaultTargetNamespaceText.setText(store.getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- IPreferenceStore store = getPreferenceStore();
-
- store.setValue(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT, getXMLSchemaPrefix());
- store.setValue(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY, getQualify());
- store.setValue(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, getXMLSchemaTargetNamespace());
-
- XSDEditorPlugin.getPlugin().savePluginPreferences();
- }
-
- public String getXMLSchemaPrefix()
- {
- String prefix = schemaNsPrefixField.getText();
- if (prefix == null || prefix.equals(""))
- {
- return "xsd";
- }
- return prefix;
- }
-
- public boolean getQualify()
- {
- return qualifyXSDLanguage.getSelection();
- }
-
- /**
- * Get the xml schema default target namespace
- */
- public String getXMLSchemaTargetNamespace()
- {
- String targetNamespace = defaultTargetNamespaceText.getText();
- if (targetNamespace == null || targetNamespace.equals(""))
- {
- return XSDEditorPlugin.DEFAULT_TARGET_NAMESPACE;
- }
- return targetNamespace;
- }
-
- public boolean checkValues()
- {
-// KCPort TODO String errorMessage = ValidateHelper.checkXMLName(schemaNsPrefixField.getText());
- String errorMessage = null;
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- setErrorMessage(null);
- setValid(true);
- return true;
- }
- else
- {
- setErrorMessage(Messages._ERROR_LABEL_INVALID_PREFIX);
- setValid(false);
- return false;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java
deleted file mode 100644
index 957ae11e33..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xsd.ui.internal.preferences;
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
-import org.eclipse.wst.xsd.core.internal.preferences.XSDCorePreferenceNames;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
-
-
-public class XSDValidatorPreferencePage extends AbstractPreferencePage
-{
- private static final String XML_VALIDATOR_PREFERENCE_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.validation"; //$NON-NLS-1$
-
- private Button fullSchemaConformance = null;
-
- protected Control createContents(Composite parent)
- {
- final Composite composite = super.createComposite(parent, 1);
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- helpSystem.setHelp(parent, XSDEditorContextIds.XSDP_VALIDATOR_PREFERENCE_PAGE);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, XML_VALIDATOR_PREFERENCE_PAGE_ID, Messages._UI_XML_VALIDATOR_PREFS_LINK,
- (IWorkbenchPreferenceContainer)getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- createContentsForValidatingGroup(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private void createContentsForValidatingGroup(Composite parent)
- {
- Group validatingGroup = createGroup(parent, 1);
- validatingGroup.setText(Messages._UI_VALIDATING_FILES);
-
- GridData data = new GridData(SWT.FILL);
- data.verticalAlignment = SWT.CENTER;
- data.horizontalAlignment = SWT.FILL;
-
- if (fullSchemaConformance == null)
- {
- fullSchemaConformance = new Button(validatingGroup, SWT.CHECK | SWT.LEFT);
- fullSchemaConformance.setLayoutData(GridDataFactory.copyData(data));
- fullSchemaConformance.setText(Messages._UI_FULL_CONFORMANCE);
- }
- }
-
- protected void performDefaults()
- {
- fullSchemaConformance.setSelection(getModelPreferences().getDefaultBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
- super.performDefaults();
- }
-
- protected void initializeValues()
- {
- initializeValuesForValidatingGroup();
- super.initializeValues();
- }
-
- protected void initializeValuesForValidatingGroup()
- {
- fullSchemaConformance.setSelection(getModelPreferences().getBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
- }
-
- protected Preferences getModelPreferences()
- {
- return XSDCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void storeValuesForValidatingGroup()
- {
- if (fullSchemaConformance != null)
- {
- boolean fullSchemaConformanceSelected = fullSchemaConformance.getSelection();
- getModelPreferences().setValue(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE, fullSchemaConformanceSelected);
- }
- }
-
- protected void storeValues()
- {
- storeValuesForValidatingGroup();
- }
-
- protected void doSavePreferenceStore()
- {
- XSDCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- public boolean performOk()
- {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
deleted file mode 100644
index 3b250a2ccf..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * Jesper Steen Moller - broader recognition of URIs
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.text;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class XSDModelAdapter implements INodeAdapter
-{
- protected ResourceSet resourceSet;
- protected XSDSchema schema;
- private ModelReconcileAdapter modelReconcileAdapter;
-
- public XSDSchema getSchema()
- {
- return schema;
- }
-
- public void setSchema(XSDSchema schema)
- {
- this.schema = schema;
- }
-
- public void clear()
- {
- if (schema != null) {
- Document doc = schema.getDocument();
- if (doc instanceof IDOMDocument) {
- IDOMDocument domDocument = (IDOMDocument)doc;
- domDocument.getModel().removeModelStateListener(getModelReconcileAdapter());
- domDocument.removeAdapter(getModelReconcileAdapter());
- domDocument.removeAdapter(this);
- }
- schema = null;
- }
- resourceSet = null;
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == XSDModelAdapter.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- }
-
- public ModelReconcileAdapter getModelReconcileAdapter()
- {
- return modelReconcileAdapter;
- }
-
- public XSDSchema createSchema(Document document)
- {
- try
- {
- // (cs) note that we always want to ensure that a
- // schema model object get's returned
- schema = XSDFactory.eINSTANCE.createXSDSchema();
- resourceSet = XSDSchemaImpl.createResourceSet();
- resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
-
- IDOMNode domNode = (IDOMNode)document;
- String baseLocation = domNode.getModel().getBaseLocation();
-
- // TODO... gotta pester SSE folks to provide 'useful' baseLocations
- //
- URI uri = getURI(baseLocation);
-
- Resource resource = new XSDResourceImpl();
- resource.setURI(uri);
- schema = XSDFactory.eINSTANCE.createXSDSchema();
- resource.getContents().add(schema);
- resourceSet.getResources().add(resource);
-
- schema.setDocument(document);
- final Element element = document.getDocumentElement();
- if (element != null)
- {
- // Force the loading of the "meta" schema for schema instance instance.
- //
- String schemaForSchemaNamespace = element.getNamespaceURI();
- XSDSchemaImpl.getSchemaForSchema(schemaForSchemaNamespace);
- }
-
- IRunnableWithProgress setElementOperation = new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- {
- // Use the animated flavour as we don't know beforehand how many ticks we need.
- // The task name will be displayed by the code in XSDResourceImpl.
-
- monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- Map loadOptions = resourceSet.getLoadOptions();
- loadOptions.put(XSDResourceImpl.XSD_PROGRESS_MONITOR, monitor);
-
- schema.setElement(element);
-
- loadOptions.remove(XSDResourceImpl.XSD_PROGRESS_MONITOR);
- }
- };
-
- IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
- try
- {
- progressService.busyCursorWhile(setElementOperation);
- }
- catch (InvocationTargetException e)
- {
- e.printStackTrace();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- // attach an adapter to keep the XSD model and DOM in sync
- //
- modelReconcileAdapter = new XSDModelReconcileAdapter(document, schema);
- domNode.getModel().addModelStateListener(modelReconcileAdapter);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- return schema;
- }
-
- /**
- * @deprecated
- */
- public XSDSchema createSchema(Element element)
- {
- return createSchema(element.getOwnerDocument());
- }
-
- public XSDSchema resetSchema(Document document)
- {
- // The document has changed so the schema should be updated as well.
- try
- {
- IDOMNode domNode = (IDOMNode)document;
- schema.setDocument(document);
- schema.setElement(document.getDocumentElement());
-
- resourceSet = schema.eResource().getResourceSet();
-
- String baseLocation = domNode.getModel().getBaseLocation();
- URI uri = getURI(baseLocation);
- schema.eResource().setURI(uri);
-
- modelReconcileAdapter = new XSDModelReconcileAdapter(document, schema);
- domNode.getModel().addModelStateListener(modelReconcileAdapter);
- }
- catch (Exception ex)
- {
- }
- return schema;
- }
-
- public static XSDModelAdapter lookupOrCreateModelAdapter(Document document)
- {
- XSDModelAdapter adapter = null;
- if (document instanceof INodeNotifier)
- {
- INodeNotifier notifier = (INodeNotifier)document;
- adapter = (XSDModelAdapter)notifier.getAdapterFor(XSDModelAdapter.class);
- if (adapter == null)
- {
- adapter = new XSDModelAdapter();
- notifier.addAdapter(adapter);
- }
- }
- return adapter;
- }
-
- public static XSDSchema lookupOrCreateSchema(final Document document)
- {
- XSDSchema result = null;
- XSDModelAdapter adapter = lookupOrCreateModelAdapter(document);
- if (adapter.getSchema() == null)
- {
-
- adapter.createSchema(document);
- }
- result = adapter.getSchema();
- return result;
- }
-
- private URI getURI(String baseLocation)
- {
- URI uri = null;
- if (baseLocation.startsWith("/")) //$NON-NLS-1$
- {
- uri = URI.createPlatformResourceURI(baseLocation);
- }
- else if (baseLocation.indexOf(':') > 1)
- {
- // Looks like an URL
- uri = URI.createURI(baseLocation);
- }
- else
- {
- // Supposedly a file, then
- uri = URI.createFileURI(baseLocation);
- }
- return uri;
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java
deleted file mode 100644
index 02b7b6d76b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java
+++ /dev/null
@@ -1,195 +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.wst.xsd.ui.internal.text;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-
-/**
- * Provides delayed reconciliation between the SSE DOM and the XSD EMF model.
- * Changes in the DOM are queued and processed by a UI job. When a new request
- * comes in, the current run is cancelled, the new request is added to the queue,
- * then the job is re-scheduled.
- */
-public class XSDModelDelayedReconciler
-{
- /**
- * The model reconciler job.
- */
- private ReconcilerJob reconcilerJob;
-
- /**
- * The time in milliseconds to delay updating the EMF model.
- */
- private static final int DELAY = 300;
-
- /**
- * The elements to reconcile.
- */
- private List elementsToReconcile = new ArrayList();
-
- /**
- * Determines if the delayed reconciler should kick in.
- */
- public boolean shouldDelay(XSDSchema schema)
- {
- boolean shouldDelay = false;
-
- // The delayed reconciler should not be used when the editor is in graphical editing mode.
-
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IEditorPart editorPart = workbenchPage != null ? workbenchPage.getActiveEditor() : null;
- if (editorPart != null && editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor)editorPart;
- shouldDelay = xsdEditor.isSourcePageActive();
- }
-
- return shouldDelay;
- }
-
- /**
- * Updates the XSD EMF component corresponding to the DOM element.
- *
- * @param element the changed element.
- * @param schema the containing schema.
- */
- public void elementChanged(Element element, XSDSchema schema)
- {
- synchronized (elementsToReconcile)
- {
- // The number of elements should be small so a linear search should be fine.
-
- if (!elementsToReconcile.contains(element))
- {
- elementsToReconcile.add(element);
- }
-
- if (reconcilerJob == null)
- {
- reconcilerJob = new ReconcilerJob(schema);
- }
-
- reconcilerJob.schedule(DELAY);
- }
- }
-
- /**
- * A UI job used to reconcile the XSD EMF model with the associated SSE DOM.
- */
- class ReconcilerJob extends UIJob
- {
- /**
- * The target schema.
- */
- private XSDSchema schema;
-
- /**
- * The number of times allowed to wake up and do nothing.
- */
- private static final int MAX_INACTIVE_COUNT = 10;
-
- /**
- * The job will terminate once this counter reaches MAX_INACTIVE_COUNT.
- */
- private int timesAwakeAndIdle = 0;
-
- /**
- * Constructs the reconciler job and configures some of its properties.
- */
- public ReconcilerJob(XSDSchema schema)
- {
- super("Reconciling the XSD EMF model"); //$NON-NLS-1$
- setSystem(true);
- setPriority(Job.LONG);
- this.schema = schema;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- if (monitor.isCanceled())
- {
- return Status.CANCEL_STATUS;
- }
-
- Element[] elements = null;
-
- synchronized (elementsToReconcile)
- {
- if (!elementsToReconcile.isEmpty())
- {
- elements = new Element[elementsToReconcile.size()];
- elementsToReconcile.toArray(elements);
- elementsToReconcile.clear();
- }
- else
- {
- if (shouldTerminate())
- {
- reconcilerJob = null;
- return Status.CANCEL_STATUS;
- }
- }
- }
-
- reconcile(elements);
-
- schedule(DELAY);
-
- return Status.OK_STATUS;
- }
-
- private void reconcile(Element[] modifiedElements)
- {
- if (modifiedElements != null)
- {
- for (int index = 0; index < modifiedElements.length; index++)
- {
- Element modifiedElement = modifiedElements[index];
-
- reconcile(modifiedElement);
- }
- }
- }
-
- private void reconcile(Element modifiedElement)
- {
- if (modifiedElement != null)
- {
- XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(modifiedElement);
- concreteComponent.elementChanged(modifiedElement);
- }
- }
-
- private boolean shouldTerminate()
- {
- return timesAwakeAndIdle++ == MAX_INACTIVE_COUNT;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
deleted file mode 100644
index c111aadbdb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
+++ /dev/null
@@ -1,197 +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.xsd.ui.internal.text;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeFilter;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-public class XSDModelQueryExtension extends ModelQueryExtension
-{
- public XSDModelQueryExtension()
- {
- }
-
- public String[] getAttributeValues(Element e, String namespace, String name)
- {
- List list = new ArrayList();
- String currentElementName = e.getLocalName();
- Node parentNode = e.getParentNode();
- String parentName = parentNode != null ? parentNode.getLocalName() : "";
- if (checkName(name, "type"))
- {
- if (checkName(currentElementName, "attribute"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList2();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- else if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList2();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- else if (checkName(name, "minOccurs"))
- {
- list.add("0");
- }
- else if (checkName(name, "itemType"))
- {
- if (checkName(currentElementName, "list"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- }
- }
- else if (checkName(name, "memberTypes"))
- {
- if (checkName(currentElementName, "union"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- }
- }
- else if (checkName(name, "base"))
- {
- if (checkName(currentElementName, "restriction"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- else if (checkName(parentName, "simpleContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- else if (checkName(parentName, "complexContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- else if (checkName(currentElementName, "extension"))
- {
- if (checkName(parentName, "simpleContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- else if (checkName(parentName, "complexContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- }
- else if (checkName(name, "ref"))
- {
- if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getGlobalElements();
- }
- else if (checkName(currentElementName, "attribute"))
- {
- list = getTypesHelper(e).getGlobalAttributes();
- }
- else if (checkName(currentElementName, "attributeGroup"))
- {
- list = getTypesHelper(e).getGlobalAttributeGroups();
- }
- else if (checkName(currentElementName, "group"))
- {
- list = getTypesHelper(e).getModelGroups();
- }
- }
- else if (checkName(name, "substitutionGroup"))
- {
- if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getGlobalElements();
- }
- }
- String[] result = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- public boolean isApplicableChildElement(Node parentNode, String namespace, String name)
- {
- if (XSDConstants.APPINFO_ELEMENT_TAG.equals(parentNode.getNodeName()) &&
- XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace))
- {
- return false;
- }
-
- // we assume that other nodes don't want schema nodes as extension elements
- // TODO... cs: we really need to define custimizations for filtering based on parent/child
- // namespace pairs to accurately handle this
- String parentElementNamespaceURI = parentNode.getNamespaceURI();
- if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(parentElementNamespaceURI) &&
- XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace))
- {
- return false;
- }
-
- if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace))
- {
- NodeFilter filter = XSDEditorPlugin.getPlugin().getNodeCustomizationRegistry().getNodeFilter(namespace);
- if (filter != null)
- {
- return filter.isApplicableContext(parentNode, Node.ELEMENT_NODE, namespace, name);
- }
- }
-
- return true;
- }
-
- protected XSDSchema lookupOrCreateSchema(Document document)
- {
- return XSDModelAdapter.lookupOrCreateSchema(document);
- }
-
- /**
- * @deprecated
- */
- protected XSDSchema lookupOrCreateSchemaForElement(Element element)
- {
- return lookupOrCreateSchema(element.getOwnerDocument());
- }
-
- protected TypesHelper getTypesHelper(Element element)
- {
- XSDSchema schema = lookupOrCreateSchema(element.getOwnerDocument());
- return new TypesHelper(schema);
- }
-
- protected boolean checkName(String localName, String token)
- {
- if (localName != null && localName.trim().equals(token))
- {
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
deleted file mode 100644
index 44b0626f8b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
+++ /dev/null
@@ -1,196 +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
- * Eugene Ostroukhov, eugene@genuitec.com - [203291] XSD Editor Source State
- * not updated in Outline/Graph
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDModelReconcileAdapter extends ModelReconcileAdapter
-{
- protected XSDSchema schema;
- protected XSDModelDelayedReconciler delayedReconciler;
-
- public XSDModelReconcileAdapter(Document document, XSDSchema schema)
- {
- super(document);
- this.schema = schema;
- this.delayedReconciler = new XSDModelDelayedReconciler();
- }
-
- protected void handleNodeChanged(Node node)
- {
- // Make sure that the node is in the XSD Schema namespace. We don't need to
- // reconcile the model for other nodes like text or nodes in other namespaces
- // like the ones normally occurring in annotations.
-
- try
- {
- if (!shouldReconcileModelFor(node))
- {
- return;
- }
- }
- catch (Exception e)
- {
- }
-
- if (node instanceof Element)
- {
- Element element = (Element) node;
- if (delayedReconciler.shouldDelay(schema))
- {
- delayedReconciler.elementChanged(element, schema);
- }
- else
- {
- XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
- concreteComponent.elementChanged(element);
- }
- }
- else if (node instanceof Document)
- {
- // The document changed so we may need to fix up the
- // definition's root element
- Document document = (Document)node;
- Element schemaElement = document.getDocumentElement();
- if (schemaElement != null && schemaElement != schema.getElement())
- {
- // here we handle the case where a new 'schema' element was added
- //(e.g. the file was totally blank and then we type in the root element)
- //
- if (schemaElement.getLocalName().equals(XSDConstants.SCHEMA_ELEMENT_TAG))
- {
- //System.out.println("****** Setting new schema");
- schema.setElement(schemaElement);
- }
- }
- else if (schemaElement != null)
- {
- // handle the case where the definition element's content has changed
- // TODO (cs) do we really need to handle this case?
- schema.elementChanged(schemaElement);
- }
- else if (schemaElement == null)
- {
- // if there's no root element clear out the schema
- //
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=203291
- // Add try-catch to work-around problem at
- // XSDConcreteComponentImpl.forceNiceRemoveChild(XSDConcreteComponentImpl.java:1696)
- // otherwise the statements below don't get run
- try
- {
- schema.getContents().clear();
- }
- catch (NullPointerException e)
- {
- // workaround
- }
-
- // TODO (cs) I'm not sure why the above isn't enough
- // to clear out all of the component lists
- // for now I've just added a few more lines to do additional clearing
- //
- // See comment above for https://bugs.eclipse.org/bugs/show_bug.cgi?id=203291
- try { schema.getIncorporatedVersions().clear(); } catch (Exception e) { }
- try { schema.getElementDeclarations().clear(); } catch (Exception e) {}
- try { schema.getTypeDefinitions().clear(); } catch (Exception e) {}
- try { schema.getAttributeDeclarations().clear(); } catch (Exception e) {}
- try { schema.getModelGroupDefinitions().clear(); } catch (Exception e) {}
- try { schema.getAttributeGroupDefinitions().clear(); } catch (Exception e) {}
- try { schema.setTargetNamespace(null); } catch (Exception e) {}
- try { schema.reset(); } catch (Exception e) {}
-
- schema.setElement(null);
- }
- }
- }
-
- /**
- * Checks if a change to the given node should trigger a model update.
- *
- * @param changedNode
- * the DOM node to test.
- * @return true if the change to the given node should trigger a model update.
- */
- protected boolean shouldReconcileModelFor(Node changedNode)
- {
- // No need to reconcile if the node is in a different namespace as it is the
- // case for nodes deeply nested in appinfo or documentation elements.
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=203291
- if (changedNode instanceof Document)
- {
- return true;
- }
-
- String nodeNamespace = changedNode.getNamespaceURI();
- String schemaNamespace = schema.getSchemaForSchemaNamespace();
- // If the document node changes, then the nodeNamespace is null
- // so we do want to reconcile. This change is needed for
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148842 and
- // read only file support.
- if (!schemaNamespace.equals(nodeNamespace) && nodeNamespace != null)
- {
- return false;
- }
-
- // When a child node is added to an appinfo or documentation element
- // No need to reconcile if the node is the first child of appinfo or documentation
- // elements.
-
- Node parentNode = changedNode.getParentNode();
-
- if (parentNode != null)
- {
- String nodeName = changedNode.getLocalName();
-
- if (XSDConstants.APPINFO_ELEMENT_TAG.equals(nodeName) || XSDConstants.DOCUMENTATION_ELEMENT_TAG.equals(nodeName))
- {
- return false;
- }
- }
- return true;
- }
-
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty)
- {
- if (!isDirty)
- {
- // TODO need a way to tell the views to stop refreshing (temporarily)
- //
- /*
- schema.reset();
-
- // For some reason type references don't get fixed up when an import is removed
- // even if we call schema.reset() explictly. To work around this we iterate thru
- // the type references and recompute them incase a schema did infact change
- //
- for (Iterator i = schema.getElementDeclarations().iterator(); i.hasNext(); )
- {
- XSDElementDeclarationImpl ed = (XSDElementDeclarationImpl)i.next();
- //ed.elementAttributesChanged(ed.getElement());
- XSDTypeDefinition td = ed.getTypeDefinition();
- td = ed.resolveTypeDefinition(td.getSchema().getTargetNamespace(), td.getName());
- ed.setTypeDefinition(td);
- }*/
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java
deleted file mode 100644
index 03133c50ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java
+++ /dev/null
@@ -1,58 +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.xsd.ui.internal.util;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-abstract class DocumentAdapter implements INodeAdapter
-{
- Document document;
-
- public DocumentAdapter(Document document)
- {
- this.document = document;
- ((INodeNotifier) document).addAdapter(this);
- adaptChildElements(document);
- }
-
- private void adaptChildElements(Node parentNode)
- {
- for (Node child = parentNode.getFirstChild(); child != null; child = child.getNextSibling())
- {
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- adapt((Element) child);
- }
- }
- }
-
- public void adapt(Element element)
- {
- if (((INodeNotifier) element).getExistingAdapter(this) == null)
- {
- ((INodeNotifier) element).addAdapter(this);
- adaptChildElements(element);
- }
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == this;
- }
-
- abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ModelReconcileAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ModelReconcileAdapter.java
deleted file mode 100644
index 9f8567747b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ModelReconcileAdapter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public abstract class ModelReconcileAdapter extends DocumentAdapter implements IModelStateListener
-{
- protected boolean handlingNotifyChanged = false;
- protected List listeners = new ArrayList();
-
- public ModelReconcileAdapter(Document document)
- {
- super(document);
- }
-
- public void addListener(INodeAdapter listener)
- {
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- public void removeListener(INodeAdapter listener)
- {
- listeners.remove(listener);
- }
-
- protected void notifyListeners(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- List list = new ArrayList(listeners);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- INodeAdapter adapter = (INodeAdapter)i.next();
- adapter.notifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- if (!handlingNotifyChanged)
- {
- handlingNotifyChanged = true;
- try
- {
- handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index);
- notifyListeners(notifier, eventType, feature, oldValue, newValue, index);
- }
- catch (Exception e)
- {
-// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
- }
- finally
- {
- handlingNotifyChanged = false;
- }
- }
- }
-
- protected void handleNodeChanged(Node node)
- {
- }
-
- public void handleNotifyChange(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- Node node = (Node)notifier;
- switch (eventType)
- {
- case INodeNotifier.ADD:
- {
- if (newValue instanceof Element)
- {
- Element element = (Element)newValue;
- adapt(element);
- }
- break;
- }
- case INodeNotifier.REMOVE:
- {
- break;
- }
- case INodeNotifier.CHANGE:
- case INodeNotifier.STRUCTURE_CHANGED:
- {
- handleNodeChanged(node);
- break;
- }
- case INodeNotifier.CONTENT_CHANGED:
- {
- // If the only thing changed was the content of a text node
- // then we don't want to reconcile.
-
- if (feature instanceof Text)
- {
- break;
- }
-
- handleNodeChanged(node);
- break;
- }
- }
- }
-
- public void modelAboutToBeChanged(IStructuredModel model)
- {
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel)
- {
- }
-
- public void modelChanged(IStructuredModel model)
- {
- }
-
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty)
- {
- }
-
- public void modelReinitialized(IStructuredModel structuredModel)
- {
- }
-
- public void modelResourceDeleted(IStructuredModel model)
- {
- }
-
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
deleted file mode 100644
index 730784b6ce..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
+++ /dev/null
@@ -1,83 +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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public abstract class SelectionAdapter implements ISelectionProvider
-{
- protected List listenerList = new ArrayList();
- protected ISelection selection = new StructuredSelection();
- protected ISelectionProvider eventSource;
-
- public void setEventSource(ISelectionProvider eventSource)
- {
- this.eventSource = eventSource;
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- /**
- * This method should be specialized to return the correct object that corresponds to the 'other' model
- */
- abstract protected Object getObjectForOtherModel(Object object);
-
-
- public void setSelection(ISelection modelSelection)
- {
- List otherModelObjectList = new ArrayList();
- if (modelSelection instanceof IStructuredSelection)
- {
- for (Iterator i = ((IStructuredSelection)modelSelection).iterator(); i.hasNext(); )
- {
- Object modelObject = i.next();
- Object otherModelObject = getObjectForOtherModel(modelObject);
- if (otherModelObject != null)
- {
- otherModelObjectList.add(otherModelObject);
- }
- }
- }
-
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
- selection = nodeSelection;
- SelectionChangedEvent event = new SelectionChangedEvent(eventSource != null ? eventSource : this, nodeSelection);
-
- for (Iterator i = listenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
deleted file mode 100644
index 4536f9c5ba..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class TypesHelper
-{
- XSDSchema xsdSchema;
- Vector list = new Vector();
-
- public TypesHelper(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- private void updateExternalImportGlobals()
- {
- if (xsdSchema != null)
- {
- Iterator contents = xsdSchema.getContents().iterator();
- while (contents.hasNext())
- {
- XSDSchemaContent content = (XSDSchemaContent) contents.next();
- if (content instanceof XSDImportImpl)
- {
- XSDImportImpl anImport = (XSDImportImpl) content;
- try
- {
- if (anImport.getSchemaLocation() != null)
- {
- anImport.importSchema();
- }
- }
- catch (Exception e)
- {
-
- }
- }
- }
- }
- }
-
-
- // TODO This method and it's very similar getBuiltInTypeNamesList2 should
- // be reviewed and combined if possible. Both seem to be used from
- // XSDModelQueryExtension for content assist purposes.
-
- public java.util.List getBuiltInTypeNamesList()
- {
- List items = new ArrayList();
- if (xsdSchema != null)
- {
- String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- if (xsdSchema != null)
- {
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- String localName = td.getName();
- String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- items.add(prefixedName);
- }
- }
- }
- return items;
- }
-
- // issue (cs) do we still need this? it can likely be remove now
- // was used for content assist but I don't think we really need it
- public java.util.List getBuiltInTypeNamesList2()
- {
- List result = new ArrayList();
- if (xsdSchema != null)
- {
- List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- String localName = td.getName();
- String prefix = prefixes.size() > 0 ? (String)prefixes.get(0) : null;
- String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- result.add(prefixedName);
- }
- }
- return result;
- }
-
- public java.util.List getUserSimpleTypeNamesList()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDSimpleTypeDefinition)
- {
- items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
- }
- }
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getUserComplexTypeNamesList()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDComplexTypeDefinition)
- {
- items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
- }
- }
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getUserSimpleTypes()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDSimpleTypeDefinition)
- {
- items.add(typeDefinition);
- //items.add(typeDefinition.getQName(xsdSchema));
- }
- }
- // We need to add the anyType
-// items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-
- // items = addExternalImportedUserSimpleTypes(items);
- //items = (Vector) sortList(items);
- }
- return items;
- }
-
- public String getPrefix(String ns, boolean withColon)
- {
- String key = "";
-
- if (xsdSchema != null)
- {
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- Iterator iter = map.keySet().iterator();
- while (iter.hasNext())
- {
- Object keyObj = iter.next();
- Object value = map.get(keyObj);
- if (value != null && value.toString().equals(ns))
- {
- if (keyObj != null)
- {
- key = keyObj.toString();
- }
- else
- {
- key = "";
- }
- break;
- }
- }
- if (!key.equals(""))
- {
- if (withColon)
- {
- key = key + ":";
- }
- }
- }
- return key;
- }
-
- public java.util.List getGlobalElements()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getElementDeclarations() != null)
- {
- Iterator i = xsdSchema.getElementDeclarations().iterator();
- while (i.hasNext())
- {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
- String name = elementDeclaration.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedGlobalElements(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getGlobalAttributes()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getAttributeDeclarations() != null)
- {
- Iterator i = xsdSchema.getAttributeDeclarations().iterator();
- while (i.hasNext())
- {
- XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
- if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
- {
- String name = attributeDeclaration.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- }
- // items = addExternalImportedAttributes(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getGlobalAttributeGroups()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getAttributeGroupDefinitions() != null)
- {
- Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
- while (i.hasNext())
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
- String name = attributeGroupDefinition.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedAttributeGroups(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getModelGroups()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getModelGroupDefinitions() != null)
- {
- Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
- while (i.hasNext())
- {
- XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
- String name = modelGroupDefinition.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedGroups(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- // issue (cs) ssems like a rather goofy util method?
- public static java.util.List sortList(java.util.List types)
- {
- try
- {
- java.util.Collections.sort(types); // performance? n*log(n)
- }
- catch (Exception e)
- {
-// XSDEditorPlugin.getPlugin().getMsgLogger().write("Sort failed");
- }
- return types;
- }
-
- // issue (cs) do we still need this?
- public void updateMapAfterDelete(XSDImport deletedNode)
- {
- String ns = deletedNode.getNamespace();
- if (ns != null)
- {
- String prefix = getPrefix(ns, false);
- if (prefix != null)
- {
- prefix = prefix.trim();
- }
- String xmlnsAttr = (prefix == "") ? "xmlns" : "xmlns:" + prefix;
-
- if (prefix == "")
- {
- prefix = null;
- }
-
- if (xsdSchema != null)
- {
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- map.remove(prefix);
- Element schemaElement = xsdSchema.getElement();
- schemaElement.removeAttribute(xmlnsAttr);
- }
- }
- }
-
- public List getPrefixedNames(String namespace, String localName)
- {
- List list = new ArrayList();
- if (namespace == null)
- {
- namespace = "";
- }
- if (xsdSchema != null && localName != null)
- {
- List prefixes = getPrefixesForNamespace(namespace);
- for (Iterator i = prefixes.iterator(); i.hasNext(); )
- {
- String prefix = (String)i.next();
- if (prefix == null) prefix = "";
- String prefixedName = prefix.length() > 0 ? prefix + ":" + localName : localName;
- list.add(prefixedName);
- }
- if (prefixes.size() == 0)
- {
- list.add(localName);
- }
- }
- return list;
- }
-
- protected List getPrefixesForNamespace(String namespace)
- {
- List list = new ArrayList();
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
- {
- String prefix = (String) iter.next();
- Object value = map.get(prefix);
- if (value != null && value.toString().equals(namespace))
- {
- list.add(prefix);
- }
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
deleted file mode 100644
index cd5ac33904..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
+++ /dev/null
@@ -1,246 +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.xsd.ui.internal.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-// issue (cs) can we get rid of this class?
-// I've stripped it down a whole lot... but it'd be great to get rid of it
-//
-public class ViewUtility
-{
- private static Font font;
-
- private static Font getFont()
- {
- if (font == null)
- {
- font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);
- }
- return font;
- }
-
- public static void setComposite(Composite comp)
- {
- // deprecated. Remove later
- }
- public static Composite createComposite(Composite parent, int numColumns)
- {
- Composite composite = new Composite(parent, SWT.NONE);
-
- composite.setFont(getFont());
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
- }
-
- public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
- {
- if (!horizontalFill)
- {
- createComposite(parent, numColumns);
- }
-
- Composite composite = new Composite(parent, SWT.NONE);
-
- composite.setFont(getFont());
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- public static Label createHorizontalFiller(Composite parent, int horizontalSpan)
- {
- Label label = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = horizontalSpan;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Helper method for creating labels.
- */
- public static Label createLabel(Composite parent, String text)
- {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public Label createLabel(Composite parent, int style, String text)
- {
- Label label = new Label(parent, style);
-// setColor(label);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public static Label createLabel(Composite parent, String text, int alignment)
- {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = alignment;
- label.setLayoutData(data);
- return label;
- }
-
-
-
-
- /**
- * Create radio button
- */
- public static Button createRadioButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.RADIO);
- button.setText(label);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- /**
- * Helper method for creating check box
- */
- public static Button createCheckBox(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.CHECK);
- button.setText(label);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
- }
-
- public static Combo createComboBox(Composite parent)
- {
- return createComboBox(parent, true);
- }
-
- public static Combo createComboBox(Composite parent, boolean isReadOnly)
- {
- int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
- Combo combo = new Combo(parent, style);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- return combo;
- }
-
-
- public static Text createTextField(Composite parent, int width)
- {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- text.setLayoutData(data);
-
- return text;
- }
-
- /**
- * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
- *
- * @param parent a <code>Composite</code> value
- * @param width an <code>int</code> value
- * @param numLines an <code>int</code> value representing number of characters in height
- * @param verticalFill a <code>boolean</code> value
- * @return a <code>Text</code> value
- */
- public static Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- FontData[] fontData = getFont().getFontData();
- // hack for now where on Windows, only 1 fontdata exists
- data.heightHint = numLines * fontData[0].getHeight();
- text.setLayoutData(data);
-
- return text;
- }
-
- public static Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- data.heightHint = height;
- text.setLayoutData(data);
-
- return text;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
deleted file mode 100644
index cb8c84c320..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-// issue (cs) remove this class!!
-public class XSDDOMHelper
-{
-
- private static String XMLSchemaURI = "http://www.w3.org/2001/XMLSchema";
-
- /**
- * Constructor for XSDDOMHelper.
- */
- public XSDDOMHelper()
- {
- super();
- }
-
- public Node getChildNode(Element parent, String childName)
- {
-/* NodeList nodeList = parent.getElementsByTagNameNS(XMLSchemaURI, childName);
- if (nodeList.getLength() > 0)
- return nodeList.item(0);
- return null;
-*/
- NodeList list = null;
- if (parent != null)
- {
- list = parent.getChildNodes();
- }
-
- if (list != null)
- {
- // Performance issue perhaps?
- for (int i = 0; i < list.getLength(); i++)
- {
- if (list.item(i) instanceof Element)
- {
- if (list.item(i).getLocalName().equals(childName))
- {
- return list.item(i);
- }
- }
- }
- }
- return null;
- }
-
-
-
-
- public void changeDerivedByType(Element element, String derivedByType, String type)
- {
- Document doc = element.getOwnerDocument();
-
- String prefix = element.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element derivedByElement = getDerivedByElement(element);
-
- if (derivedByElement != null && derivedByElement.getLocalName().equals(derivedByType))
- {
- return; // it's already the derived by type
- }
- Element newNode;
- if (derivedByType.equals("restriction"))
- {
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
- }
- else
- {
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.EXTENSION_ELEMENT_TAG);
- }
-
- newNode.setAttribute("base", type);
-
- if (derivedByElement != null)
- {
- if (derivedByElement.hasChildNodes())
- {
- NodeList nodes = derivedByElement.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- newNode.appendChild(node.cloneNode(true));
- }
- }
- element.replaceChild(newNode, derivedByElement);
- }
- else
- {
- Element parent = (Element) element.getParentNode(); // get back to complexType
- NodeList nodes = parent.getChildNodes();
- ArrayList nodeSaveList = new ArrayList();
-
- // save children. (nodes turns out to be the same object as parent;
- // deleting them from parent will delete them from nodes.)
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- nodeSaveList.add(node);
- }
-
- // remove children so we can surround them by complexContent
- for (int i = 0; i < nodeSaveList.size(); i++)
- {
- Node node = (Node) nodeSaveList.get(i);
- parent.removeChild(node);
- }
-
- // build a complexContent element
- Element complexContent = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG);
- parent.appendChild(complexContent); // insert into complexType
- complexContent.appendChild(newNode); // insert derivation type
- for (int i = 0; i < nodeSaveList.size(); i++) // insert children previously of complexType
- {
- Node node = (Node) nodeSaveList.get(i);
- newNode.appendChild(node.cloneNode(true));
- }
-
- parent.appendChild(complexContent);
- formatChild(complexContent);
- }
- }
-
-
- /**
- * Get the derived by node given the complexContent or simpleContent node
- */
- public Element getDerivedByElement(Element element)
- {
- Node restrictionChild = getChildNode(element, "restriction");
- Node extensionChild = getChildNode(element, "extension");
- if (restrictionChild != null)
- {
- if (restrictionChild instanceof Element)
- {
- return (Element)restrictionChild;
- }
- }
-
- if (extensionChild != null)
- {
- if (extensionChild instanceof Element)
- {
- return (Element)extensionChild;
- }
- }
- return null;
- }
-
-
- public Element getDerivedByElementFromSimpleType(Element element)
- {
- Node atomic = getChildNode(element, "restriction");
- Node list = getChildNode(element, "list");
- Node union = getChildNode(element, "union");
- if (atomic instanceof Element)
- {
- return (Element)atomic;
- }
- if (list instanceof Element)
- {
- return (Element)list;
- }
- if (union instanceof Element)
- {
- return (Element)union;
- }
- return null;
- }
-
- /**
- * Get the derived by node given the ComplexType node
- * Returns the first one, if say, the INVALID schema has more than one
- */
- public Element getDerivedByElementFromComplexType(Element element)
- {
- NodeList nl = element.getChildNodes();
- int j = 0;
- for (j = 0; j < nl.getLength(); j++)
- {
- Node aNode = nl.item(j);
- if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- break;
- }
- }
- Element derivedByNode = getDerivedByElement((Element)nl.item(j));
- return derivedByNode;
- }
-
- /**
- * Get the content model given the ComplexType node
- * Returns the first one, if say, the INVALID schema has more than one
- */
- public Element getContentModelFromParent(Element element)
- {
- NodeList nl = element.getChildNodes();
- int j = 0;
- boolean modelExists = false;
- int length = nl.getLength();
- for (j = 0; j < length; j++)
- {
- Node aNode = nl.item(j);
- if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.CHOICE_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.ALL_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- }
- if (!modelExists)
- {
- return null;
- }
-
- Element derivedByNode = (Element)nl.item(j);
- return derivedByNode;
- }
-
- /**
- *
- */
- public void changeContentModel(Element complexTypeElement, String contentModel, Element sequenceChoiceOrAllElement)
- {
- Document doc = complexTypeElement.getOwnerDocument();
-
- String prefix = complexTypeElement.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element contentModelElement = getContentModelFromParent(complexTypeElement);
-
- if (contentModelElement.getLocalName().equals(contentModel))
- {
- return; // it's already the content model
- }
- Element newNode;
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-
- if (contentModelElement.hasChildNodes())
- {
- NodeList nodes = contentModelElement.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- if (node instanceof Element)
- {
- if (node.getLocalName().equals(XSDConstants.ANNOTATION_ELEMENT_TAG))
- {
- if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false)))
- {
- newNode.appendChild(node.cloneNode(true));
- }
- }
- else if (node.getLocalName().equals(XSDConstants.RESTRICTION_ELEMENT_TAG) ||
- node.getLocalName().equals(XSDConstants.EXTENSION_ELEMENT_TAG))
- {
- newNode.appendChild(node.cloneNode(true));
- if (sequenceChoiceOrAllElement != null)
- {
- node.appendChild(sequenceChoiceOrAllElement);
- }
- }
- else
- {
- removeNodeAndWhitespace(node);
- }
- }
- else
- {
- newNode.appendChild(node.cloneNode(true));
- }
- }
- }
- complexTypeElement.replaceChild(newNode, contentModelElement);
- }
-
- public Element cloneElement(Element parent, Element sourceNode)
- {
- Document doc = parent.getOwnerDocument();
- String prefix = parent.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + sourceNode.getLocalName());
-
- if (sourceNode.hasChildNodes())
- {
- NodeList nodes = sourceNode.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- newNode.appendChild(node.cloneNode(true));
- }
- }
- return newNode;
-// parent.replaceChild(newNode, sourceNode);
- }
-
- public static boolean hasOnlyWhitespace(Node node)
- {
- NodeList list = node.getChildNodes();
- int length = list.getLength();
- boolean hasOnlyWhitespace = true;
- for (int i = 0; i < length; i++)
- {
- Node child = list.item(i);
- if (child.getNodeType() != Node.TEXT_NODE)
- {
- hasOnlyWhitespace = false;
- break;
- }
- else
- {
- String value = child.getNodeValue();
- String trimmedValue = value.trim();
- if (trimmedValue.length() != 0)
- {
- hasOnlyWhitespace = false;
- }
- }
- }
-
- return hasOnlyWhitespace;
- }
-
- public static void removeNodeAndWhitespace(Node node)
- {
- Node parentNode = node.getParentNode();
-
- Node nextElement = getNextElementNode(node);
- Node previousElement = getPreviousElementNode(node);
-
- Node nextSibling = node.getNextSibling();
- if (nextSibling instanceof Text)
- {
- parentNode.removeChild(nextSibling);
- }
-
- if (parentNode != null)
- {
- parentNode.removeChild(node);
- }
-
- if (nextElement != null)
- {
- formatChild(nextElement);
- }
-
- if (previousElement != null)
- {
- formatChild(previousElement);
- }
- }
-
- public static void formatChild(Node child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
-
- private static Node getNextElementNode(Node node)
- {
- Node next = node.getNextSibling();
-
- while (!(next instanceof Element) && next != null)
- {
- next = next.getNextSibling();
- }
- if (next instanceof Text)
- {
- return null;
- }
- return next;
- }
-
- private static Node getPreviousElementNode(Node node)
- {
- Node previous = node.getPreviousSibling();
-
- while (!(previous instanceof Element) && previous != null)
- {
- previous = previous.getPreviousSibling();
- }
- if (previous instanceof Text)
- {
- return null;
- }
- return previous;
- }
-
-
-
- // issue (cs) what's this method supposed to do?
- // bizzare name
- public static boolean inputEquals(Object input, String tagname, boolean isRef)
- {
- if (input instanceof Element)
- {
- Element element = (Element) input;
- if (element.getLocalName().equals(tagname))
- {
- boolean refPresent = element.hasAttribute("ref");
-
- return refPresent == isRef;
- }
- }
- return false;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
deleted file mode 100644
index af3d91b06e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
+++ /dev/null
@@ -1,31 +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.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-
-public class XSDSchemaLocationResolverAdapterFactory extends AdapterFactoryImpl
-{
- protected XSDSchemaLocationResolverImpl schemaLocator = new XSDSchemaLocationResolverImpl();
-
- public boolean isFactoryForType(Object type)
- {
- return type == XSDSchemaLocationResolver.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return schemaLocator;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
deleted file mode 100644
index cd985b5985..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
+++ /dev/null
@@ -1,39 +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.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocationResolverImpl extends AdapterImpl implements XSDSchemaLocationResolver
-{
- public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
- {
- String baseLocation = xsdSchema.getSchemaLocation();
- String result = URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, schemaLocationURI);
- if (result == null) {
- result = namespaceURI;
- }
- if (result == null) {
- result = "";
- }
-
- return result;
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java
deleted file mode 100644
index be1aa78b54..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.utils;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-// issue (cs) can we remove this?
-//
-public class OpenOnSelectionHelper
-{
-
- protected StructuredTextEditor textEditor;
- protected XSDSchema xsdSchema;
-
-
- public OpenOnSelectionHelper(StructuredTextEditor textEditor, XSDSchema xsdSchema)
- {
- this.textEditor = textEditor;
- this.xsdSchema = xsdSchema;
- }
-
-
- boolean lastResult;
-
- public static void openXSDEditor(XSDSchema schema)
- {
- IEditorInput editorInput = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
-
- OpenInNewEditor.openXSDEditor(editorInput, schema, schema);
-
- }
-
- public static void openXSDEditor(String schemaLocation)
- {
- IPath schemaPath = new Path(schemaLocation);
- final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-
- Display.getDefault().asyncExec(new Runnable()
- {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run()
- {
- final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- try
- {
- workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.EDITOR_ID);
- }
- catch (PartInitException initEx)
- {
- initEx.printStackTrace();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- });
- }
-
- protected boolean revealObject(final XSDConcreteComponent component)
- {
- if (component.getRootContainer().equals(xsdSchema))
- {
- Node element = component.getElement();
- if (element instanceof IndexedRegion)
- {
- IndexedRegion indexNode = (IndexedRegion) element;
- textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(), indexNode.getEndOffset() - indexNode.getStartOffset(), true);
- return true;
- }
- return false;
- }
- else
- {
- lastResult = false;
- if (component.getSchema() != null)
- {
- String schemaLocation = URIHelper.removePlatformResourceProtocol(component.getSchema().getSchemaLocation());
- IPath schemaPath = new Path(schemaLocation);
- final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- Display.getDefault().syncExec(new Runnable()
- {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run()
- {
- final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- try
- {
- IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.PLUGIN_ID);
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- ((InternalXSDMultiPageEditor)editorPart).openOnGlobalReference(component);
- lastResult = true;
- }
- }
- catch (PartInitException initEx)
- {
- }
- }
- }
- });
- }
- return lastResult;
- }
- }
-
- public XSDNamedComponent openOnGlobalReference(XSDConcreteComponent comp)
- {
- XSDSchema schema = xsdSchema;
- String name = null;
- if (comp instanceof XSDNamedComponent)
- {
- name = ((XSDNamedComponent) comp).getName();
- }
- if (name == null)
- {
- // For Anonymous types, just show the element
- if (comp instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) comp;
- comp = type.getContainer();
- if (comp instanceof XSDNamedComponent)
- {
- name = ((XSDNamedComponent) comp).getName();
- }
- }
- }
-
- if (schema == null || name == null)
- {
- return null;
- }
-
- List objects = null;
- if (comp instanceof XSDElementDeclaration)
- {
- objects = schema.getElementDeclarations();
- }
- else if (comp instanceof XSDTypeDefinition)
- {
- objects = schema.getTypeDefinitions();
- }
- else if (comp instanceof XSDAttributeGroupDefinition)
- {
- objects = schema.getAttributeGroupDefinitions();
- }
- else if (comp instanceof XSDIdentityConstraintDefinition)
- {
- objects = schema.getIdentityConstraintDefinitions();
- }
- else if (comp instanceof XSDModelGroupDefinition)
- {
- objects = schema.getModelGroupDefinitions();
- }
- else if (comp instanceof XSDAttributeDeclaration)
- {
- objects = schema.getAttributeDeclarations();
- }
-
- if (objects != null)
- {
- for (Iterator iter = objects.iterator(); iter.hasNext();)
- {
- XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
-
- if (namedComp.getName().equals(name))
- {
- revealObject(namedComp);
- return namedComp;
- }
- }
- }
- return null;
- }
-
- public boolean openOnSelection()
- {
- List selectedNodes = null;
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof IStructuredSelection) {
- selectedNodes = ((IStructuredSelection) selection).toList();
- }
-
- if (selectedNodes != null && !selectedNodes.isEmpty())
- {
- for (Iterator i = selectedNodes.iterator(); i.hasNext();)
- {
- Object obj = i.next();
- if (xsdSchema != null)
- {
- XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node)obj);
- XSDConcreteComponent objectToReveal = null;
-
- if (xsdComp instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
- if (elementDecl.isElementDeclarationReference())
- {
- objectToReveal = elementDecl.getResolvedElementDeclaration();
- }
- else
- {
- XSDConcreteComponent typeDef = null;
- if (elementDecl.getAnonymousTypeDefinition() == null)
- {
- typeDef = elementDecl.getTypeDefinition();
- }
-
- XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
-
- if (typeDef != null && subGroupAffiliation != null)
- {
- // we have 2 things we can navigate to, if the cursor is anywhere on the substitution attribute
- // then jump to that, otherwise just go to the typeDef.
- if (obj instanceof Attr && ((Attr)obj).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
- {
- objectToReveal = subGroupAffiliation;
- }
- else
- {
- // try to reveal the type now. On success, then we return true.
- // if we fail, set the substitution group as the object to reveal as a backup plan.
- if (revealObject(typeDef))
- {
- return true;
- }
- else
- {
- objectToReveal = subGroupAffiliation;
- }
- }
- }
- else
- {
- // one or more of these is null. If the typeDef is non-null, use it. Otherwise
- // try and use the substitution group
- objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
- }
- }
- }
- else if (xsdComp instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
- if (elementDecl.isModelGroupDefinitionReference())
- {
- objectToReveal = elementDecl.getResolvedModelGroupDefinition();
- }
- }
- else if (xsdComp instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
- if (attrDecl.isAttributeDeclarationReference())
- {
- objectToReveal = attrDecl.getResolvedAttributeDeclaration();
- }
- else if (attrDecl.getAnonymousTypeDefinition() == null)
- {
- objectToReveal = attrDecl.getTypeDefinition();
- }
- }
- else if (xsdComp instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
- if (attrGroupDef.isAttributeGroupDefinitionReference())
- {
- objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
- }
- }
- else if (xsdComp instanceof XSDIdentityConstraintDefinition)
- {
- XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
- if (idConstraintDef.getReferencedKey() != null)
- {
- objectToReveal = idConstraintDef.getReferencedKey();
- }
- }
- else if (xsdComp instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
- objectToReveal = typeDef.getItemTypeDefinition();
- if (objectToReveal == null)
- {
- // if itemType attribute is not set, then check for memberType
- List memberTypes = typeDef.getMemberTypeDefinitions();
- if (memberTypes != null && memberTypes.size() > 0)
- {
- objectToReveal = (XSDConcreteComponent)memberTypes.get(0);
- }
- }
- }
- else if (xsdComp instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
- objectToReveal = typeDef.getBaseType();
- }
- else if (xsdComp instanceof XSDSchemaDirective)
- {
- XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
-// String schemaLocation = URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
-// openXSDEditor(schemaLocation);
-// return false;
- objectToReveal = directive.getResolvedSchema();
- }
-
- // now reveal the object if this isn't null
- if (objectToReveal != null)
- {
- return revealObject(objectToReveal);
- }
- }
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
deleted file mode 100644
index b90cce80c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-
-/**
- * This performs the as-you-type validation for schema files
- *
- */
-public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator {
- private final static String Id = "org.eclipse.wst.xsd.core.xsd";
-
- private Validator _validator;
-
- public DelegatingSourceValidatorForXSD() {
- }
-
- private Validator getValidator(){
- if (_validator == null)_validator = ValidationFramework.getDefault().getValidator(Id);
- return _validator;
- }
-
- protected IValidator getDelegateValidator() {
- Validator v = getValidator();
- if (v == null)return null;
- return v.asIValidator();
- }
-
- protected boolean isDelegateValidatorEnabled(IFile file) {
- Validator v = getValidator();
- if (v == null)return false;
- if (!v.shouldValidate(file, false, false))return false;
- return v.isBuildValidation() || v.isManualValidation();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
deleted file mode 100644
index 1af19fa903..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
+++ /dev/null
@@ -1,111 +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.xsd.ui.internal.widgets;
-
-import org.eclipse.jface.window.Window;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-/**
- * Dialog to help define a list of enumerations
- * for a join. This might be replaced once we know how to
- * initiate a drag tracker
- */
-
-public class EnumerationsDialog extends org.eclipse.jface.dialogs.Dialog
-{
- public EnumerationsDialog(Shell shell)
- {
- super(shell);
- }
-
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- shell.setText(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == Window.OK)
- {
- text = textField.getText();
- delimiter = delimiterField.getText();
- isPreserve = preserveWhitespace.getSelection();
- }
- super.buttonPressed(buttonId);
- }
-
- private String text, delimiter;
- private boolean isPreserve;
- public String getText() { return text; }
- public String getDelimiter() { return delimiter; }
- public boolean isPreserveWhitespace() { return isPreserve; }
-
- private Text textField;
- private Button preserveWhitespace;
- private Combo delimiterField;
- //
- // Create the controls
- //
- public Control createDialogArea(Composite parent)
- {
- Control[] tabOrder = new Control[3];
- int tabIndex = 0;
- Composite client = (Composite)super.createDialogArea(parent);
- GridLayout layout = (GridLayout)client.getLayout();
- layout.numColumns = 2;
- client.setLayout(layout);
-
- textField = ViewUtility.createWrappedMultiTextField(client, 400, 20, true);
- GridData gd = (GridData) textField.getLayoutData();
- gd.horizontalSpan = 2;
- tabOrder[tabIndex++] = textField;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textField, XSDEditorCSHelpIds.ADD_ENUMERATIONS__NO_NAME);
-
- ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_DELIMITER_CHAR"));
- delimiterField = ViewUtility.createComboBox(client, false);
- gd = (GridData) delimiterField.getLayoutData();
- gd.grabExcessHorizontalSpace = false;
- gd.horizontalAlignment = GridData.BEGINNING;
- gd.widthHint = 30;
- tabOrder[tabIndex++] = delimiterField;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(delimiterField, XSDEditorCSHelpIds.ADD_ENUMERATIONS__DELIMITER_CHARS);
-
- // add default delimiters
- delimiterField.add(":");
- delimiterField.add(",");
- delimiterField.add(" ");
- // set the current one to be ','
- delimiterField.setText(",");
-
- preserveWhitespace = ViewUtility.createCheckBox(client, XSDEditorPlugin.getXSDString("_UI_LABEL_PRESERVE_WHITESPACE"));
- gd = (GridData) preserveWhitespace.getLayoutData();
- gd.horizontalSpan = 2;
- tabOrder[tabIndex++] = preserveWhitespace;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(preserveWhitespace, XSDEditorCSHelpIds.ADD_ENUMERATIONS__PRESERVE_LEAD_AND_TRAIL_WHITESPACES);
-
- client.setTabList(tabOrder);
-
- return client;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
deleted file mode 100644
index ee29fee2d3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
+++ /dev/null
@@ -1,335 +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.xsd.ui.internal.widgets;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-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.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-
-public class TypeSection
-{
- /**
- * Constructor for TypeSection.
- * @param parent
- */
- public TypeSection(Composite parent)
- {
- }
-
- protected Button simpleType;
- protected Button userSimpleType;
- protected Button userComplexType;
- protected Button noneRadio;
- protected Combo typeList;
- protected Combo derivedByCombo;
- protected boolean showUserComplexType = true;
- protected boolean showUserSimpleType = true;
- protected boolean showNone = false;
- protected boolean showDerivedBy = false;
- protected String derivedByChoices[] = { "restriction", "extension" };
- public final int NONE = 1;
- public final int BUILT_IN = 2;
- public final int SIMPLE = 3;
- public final int COMPLEX = 4;
-
- String sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
- String currentObjectUuid = "";
-
- /*
- * @see FlatPageSection#createClient(Composite, WidgetFactory)
- */
- public Composite createClient(Composite parent)
- {
- Composite client = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout(1, true);
- gl.verticalSpacing = 0;
- client.setLayout(gl);
-
- if (showNone)
- {
- noneRadio = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_NONE"));
- WorkbenchHelp.setHelp(noneRadio, XSDEditorContextIds.XSDE_TYPE_HELPER_NONE);
- }
-
- simpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_BUILT_IN_SIMPLE_TYPE"));
- WorkbenchHelp.setHelp(simpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_BUILT_IN);
-
- if (showUserSimpleType)
- {
- userSimpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_SIMPLE_TYPE"));
- WorkbenchHelp.setHelp(userSimpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE);
- }
-
- if (showUserComplexType)
- {
- userComplexType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_COMPLEX_TYPE"));
- WorkbenchHelp.setHelp(userComplexType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX);
- }
-
- // typeList = utility.createComboBox(client);
- // WorkbenchHelp.setHelp(typeList, XSDEditorContextIds.XSDE_TYPE_HELPER_TYPE);
- // utility.createHeadingLabel(client, "Type",null);
-
- if (showDerivedBy)
- {
- Composite derivedByComposite = ViewUtility.createComposite(client, 2);
- ViewUtility.createLabel(derivedByComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"));
- derivedByCombo = ViewUtility.createComboBox(derivedByComposite);
- populateDerivedByCombo();
- WorkbenchHelp.setHelp(derivedByCombo, XSDEditorContextIds.XSDE_SIMPLE_CONTENT_DERIVED);
- derivedByCombo.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_DERIVED_BY"));
- }
- // Set the default selection
- if (showNone)
- {
- // noneRadio.setSelection(true);
- // typeList.setEnabled(false);
- }
- else
- {
- simpleType.setSelection(true);
- }
- return client;
- }
-
- public void setIsDerivedBy(boolean derive)
- {
- if (derive)
- {
- sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");
- }
- else
- {
- sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
- }
- // setHeaderText(sectionTitle);
- }
-
- /**
- * Set to true if called by Complex Type & Simple Type
- */
- public void setShowDerivedBy(boolean derive)
- {
- showDerivedBy = derive;
- }
-
- /**
- * Gets the derivedByField
- * @return Returns a Button
- */
- public Combo getDerivedByCombo()
- {
- return derivedByCombo;
- }
-
- /**
- * Gets the noneRadio.
- * @return Returns a Button
- */
- public Button getNoneRadio()
- {
- return noneRadio;
- }
-
- /**
- * Gets the simpleType.
- * @return Returns a Button
- */
- public Button getSimpleType()
- {
- return simpleType;
- }
-
- /**
- * Gets the userComplexType.
- * @return Returns a Button
- */
- public Button getUserComplexType()
- {
- return userComplexType;
- }
-
- /**
- * Gets the userSimpleType.
- * @return Returns a Button
- */
- public Button getUserSimpleType()
- {
- return userSimpleType;
- }
-
- /**
- * Gets the typeList.
- * @return Returns a CCombo
- */
- public Combo getTypeList()
- {
- return typeList;
- }
-
- /**
- * Populate combo box with built-in simple types
- */
- public void populateBuiltInType(XSDSchema xsdSchema)
- {
- getTypeList().removeAll();
- List items = getBuiltInTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getBuiltInTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getBuiltInTypeNamesList();
- }
-
- /**
- * Populate combo box with user defined complex types
- */
- public void populateUserComplexType(XSDSchema xsdSchema, boolean showAnonymous)
- {
- getTypeList().removeAll();
- if (showAnonymous)
- {
- getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
- }
-
- List items = getUserComplexTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getUserComplexTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getUserComplexTypeNamesList();
- }
-
- public void populateUserSimpleType(XSDSchema xsdSchema, boolean showAnonymous)
- {
- getTypeList().removeAll();
- if (showAnonymous)
- {
- getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
- }
- List items = getUserSimpleTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- /**
- * Populate combo box with user defined simple types
- */
- public void populateUserSimpleType(XSDSchema xsdSchema)
- {
- getTypeList().removeAll();
- List items = getUserSimpleTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getUserSimpleTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getUserSimpleTypeNamesList();
- }
-
- public String getPrefix(String ns, XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- String key = helper.getPrefix(ns, true);
- return key;
- }
-
- /**
- * Populate combo box with derived by choices
- */
- protected void populateDerivedByCombo()
- {
- for (int i = 0; i < derivedByChoices.length; i++)
- {
- getDerivedByCombo().add(derivedByChoices[i]);
- }
- }
-
- /**
- * Gets the showUserComplexType.
- * @return Returns a boolean
- */
- public boolean getShowUserComplexType()
- {
- return showUserComplexType;
- }
-
- /**
- * Gets the showUserSimpleType.
- * @return Returns a boolean
- */
- public boolean getShowUserSimpleType()
- {
- return showUserSimpleType;
- }
-
- /**
- * Gets the showNone.
- * @return Returns a boolean
- */
- public boolean getShowNone()
- {
- return showNone;
- }
-
- /**
- * Sets the showUserComplexType.
- * @param showUserComplexType The showUserComplexType to set
- */
- public void setShowUserComplexType(boolean showUserComplexType)
- {
- this.showUserComplexType = showUserComplexType;
- }
-
- /**
- * Sets the showUserSimpleType.
- * @param showUserSimpleType The showUserSimpleType to set
- */
- public void setShowUserSimpleType(boolean showUserSimpleType)
- {
- this.showUserSimpleType = showUserSimpleType;
- }
-
- /**
- * Sets the showNone
- * @param showUserSimpleType The showNone to set
- */
- public void setShowNone(boolean showNone)
- {
- this.showNone = showNone;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
deleted file mode 100644
index abd0167c44..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
+++ /dev/null
@@ -1,135 +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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.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.Shell;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesTargetFieldDialog;
-
-public class XSDEditSchemaInfoDialog extends EditSchemaInfoDialog implements SelectionListener {
- String targetNamespace;
- CommonEditNamespacesTargetFieldDialog editNamespacesControl;
- /**
- * @deprecated - These have been moved to the Advanced Properties Tab
- */
- Combo elementFormCombo, attributeFormCombo;
- /**
- * @deprecated
- */
- String elementFormQualified = "", attributeFormQualified = ""; //$NON-NLS-1$ //$NON-NLS-2$
-
- public XSDEditSchemaInfoDialog(Shell parentShell, IPath resourceLocation, String targetNamespace) {
- super(parentShell, resourceLocation);
- this.targetNamespace = targetNamespace;
- }
-
- // this is copy of ....
- protected Control __internalCreateDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) __internalCreateDialogArea(parent);
- editNamespacesControl = new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation); //$NON-NLS-1$
- if (targetNamespace != null)
- {
- editNamespacesControl.setTargetNamespace(targetNamespace);
- }
- editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
- editNamespacesControl.updateErrorMessage(namespaceInfoList);
-
- applyDialogFont(parent);
- return dialogArea;
- }
-
- public String getTargetNamespace() {
- return editNamespacesControl.getTargetNamespace();
- }
-
- /**
- * @deprecated
- */
- public void setIsElementQualified(String state)
- {
- elementFormCombo.setText(state);
- elementFormQualified = state;
- }
-
- /**
- * @deprecated
- */
- public void setIsAttributeQualified(String state)
- {
- attributeFormCombo.setText(state);
- attributeFormQualified = state;
- }
-
- /**
- * @deprecated
- */
- public String getElementFormQualified()
- {
- return elementFormQualified;
- }
-
- /**
- * @deprecated
- */
- public String getAttributeFormQualified()
- {
- return attributeFormQualified;
- }
-
- /**
- * @deprecated
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-
- /**
- * @deprecated
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == attributeFormCombo)
- {
- attributeFormQualified = attributeFormCombo.getText();
- }
- else if (e.widget == elementFormCombo)
- {
- elementFormQualified = elementFormCombo.getText();
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
deleted file mode 100644
index 41cd29db42..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-public class NewXSDWizard extends Wizard implements INewWizard {
- private XSDNewFilePage newFilePage;
- private IStructuredSelection selection;
- private IWorkbench workbench;
-
- public NewXSDWizard() {
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- this.selection = aSelection;
- this.workbench = aWorkbench;
-
- this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.png"));
- this.setWindowTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_CREATE_XSD_MODEL_TITLE"));
- }
-
- public void addPages() {
- newFilePage = new XSDNewFilePage(selection);
- addPage(newFilePage);
- }
-
- public boolean performFinish() {
- IFile file = newFilePage.createNewFile();
-
- //
- // Get the xsd schema name from the full path name
- // e.g. f:/b2b/po.xsd => schema name = po
- //
- IPath iPath = file.getFullPath().removeFileExtension();
- // String schemaName = iPath.lastSegment();
- String schemaName = iPath.lastSegment();
- String schemaPrefix = "tns";
- String prefixForSchemaNamespace = "";
- String schemaNamespaceAttribute = "xmlns";
- if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
- // Added this if check before disallowing blank prefixes in the
- // preferences...
- // Can take this out. See also XSDEditor
- if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
- prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
- schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
- }
- }
-
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals("")) {
- charSet = "UTF-8";
- }
-
- String newContents = "<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>\n";
-
- String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
- newContents += "<" + prefixForSchemaNamespace + "schema " + schemaNamespaceAttribute + "=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"" + defaultTargetURI + schemaName + "\" xmlns:" + schemaPrefix + "=\"" + defaultTargetURI + schemaName + "\" elementFormDefault=\"qualified\">\n</" + prefixForSchemaNamespace + "schema>";
-
- try {
- byte[] bytes = newContents.getBytes(charSet);
- ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
-
- file.setContents(inputStream, true, false, null);
- inputStream.close();
- }
- catch (Exception e) {
- // XSDEditorPlugin.getPlugin().getMsgLogger().write("Error writing
- // default content:\n" + newContents);
- // XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
- }
-
- if (file != null) {
- revealSelection(new StructuredSelection(file));
- }
-
- openEditor(file);
-
- return true;
- }
-
- private void revealSelection(final ISelection selection) {
- if (selection != null) {
- IWorkbench workbench2;
- if (workbench == null)
- {
- workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
- }
- else
- {
- workbench2 = workbench;
- }
- final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
- final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
- if (focusPart instanceof ISetSelectionTarget) {
- Display.getCurrent().asyncExec(new Runnable() {
- public void run() {
- ((ISetSelectionTarget) focusPart).selectReveal(selection);
- }
- });
- }
- }
- }
-
- public void openEditor(final IFile iFile) {
- if (iFile != null) {
- IWorkbench workbench2;
- if (workbench == null)
- {
- workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
- }
- else
- {
- workbench2 = workbench;
- }
- final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- String editorId = null;
- IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getLocation().toOSString(), iFile.getContentDescription().getContentType());
- if (editor != null) {
- editorId = editor.getId();
- }
- workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
-
- }
- catch (PartInitException ex) {
- }
- catch (CoreException ex) {
- }
- }
- });
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
deleted file mode 100644
index 1a1712d35b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
+++ /dev/null
@@ -1,947 +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
- *******************************************************************************/
-// Based on version 1.12 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDPatternFacet;
-
-
-
-/*
--other regex features (eg case sensitivity, ^ or $, |, etc etc)
--smarter model
--better keyboard navigation
--update list of tokens
-*/
-
-public class RegexCompositionPage extends WizardPage
-{
- private static final boolean debug = false;
-
- /* The text representation of our pattern. */
- private StyledText value;
-
- /* The StyleRange used to color code the current parse error. */
- private StyleRange currentError;
-
- /* The regex terms we can form tokens from. */
- private Combo terms;
-
- /* The checkbox for activating auto-escape mode. */
- private Button escapeCheckbox;
-
- /* On/off status of auto-escape mode. */
- private boolean autoEscapeStatus;
-
- /* The Add Token button. */
- private Button add;
-
-
- // The following controls are used in the occurrence selection group
-
- private Text repeatValue;
-
- private Text rangeMinValue;
- private Text rangeMaxValue;
- private Label rangeToLabel;
-
- private Button singleRadio;
- private Button starRadio;
- private Button plusRadio;
- private Button optionalRadio;
- private Button repeatRadio;
- private Button rangeRadio;
-
-
- // The following variables used as part of the model.
-
- /* Our pattern. */
- private XSDPatternFacet pattern;
-
- /* Model used to store the current token. */
- private RegexNode node;
-
- /* The flags passed to the new RegularExpression object. Default value includes:
- X = XMLSchema mode */
- private String regexFlags = "X";
-
-
- /* Is the current regex token valid? */
- private boolean isValidToken;
-
- /* The label used to indicate the value's caret position when it looses focus. */
- private Label caretLabel;
-
- /* The pixel offsets needed to align the label icon with the caret location.
- These are dependent on the icon used. */
- private static final int CARET_LABEL_X_OFFSET = -3;
- private static final int CARET_LABEL_Y_OFFSET = 19;
-
-
- /* Enumerated constants for specifying the type of an error message. */
- private static final int TOKEN = 0;
- private static final int SELECTION = 1;
- private static final int PARSE = 2;
-
- private static final int NUM_ERROR_MESSAGE_TYPES = 3;
-
- /* The current error message for each type of error. A value of null indicates no message.
- The array is indexed according to the above constants.
- */
- private String[] currentErrorMessages;
-
-
- public RegexCompositionPage(XSDPatternFacet pattern)
- {
- super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
- this.pattern = pattern;
-
- setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
- setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION"));
- }
-
- public void createControl(Composite parent)
- {
- // Set up our model and validator
- node = new RegexNode();
-
- isValidToken = true;
-
- currentErrorMessages = new String[NUM_ERROR_MESSAGE_TYPES];
-
- // The main composite
- Composite composite= new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, XSDEditorCSHelpIds.REGEX_WIZARD_PAGE);
- composite.setLayout(new GridLayout());
-
-
- // The composite for the token combo box, label, and auto-escape checkbox
- Composite tokenComposite = new Composite (composite, SWT.NONE);
- GridLayout tokenCompositeLayout = new GridLayout();
- tokenCompositeLayout.numColumns = 3;
- tokenCompositeLayout.marginWidth = 0;
- tokenComposite.setLayout(tokenCompositeLayout);
-
-
- new Label(tokenComposite, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TOKEN_LABEL"));
-
- terms = new Combo(tokenComposite, SWT.DROP_DOWN);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(terms, XSDEditorCSHelpIds.REGEX_TOKEN_CONTENTS);
- for (int i = 0; i < RegexNode.getNumRegexTerms(); i++)
- {
- terms.add(RegexNode.getRegexTermText(i));
- }
- terms.addListener(SWT.Modify, new ComboListener());
- terms.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_TERMS"));
-
- escapeCheckbox = new Button(tokenComposite, SWT.CHECK);
- escapeCheckbox.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL"));
- escapeCheckbox.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX"));
- escapeCheckbox.addSelectionListener(new CheckboxListener());
- autoEscapeStatus = false;
-
-
- // Set up the composites pertaining to the selection of occurrence quantifiers
-
- Group occurrenceSelectionArea = new Group(composite, SWT.NONE);
- occurrenceSelectionArea.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_OCCURENCE_LABEL"));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(occurrenceSelectionArea, XSDEditorCSHelpIds.REGEX_WIZARD_PAGE);
- GridLayout selectionAreaLayout = new GridLayout();
- selectionAreaLayout.numColumns = 2;
- occurrenceSelectionArea.setLayout(selectionAreaLayout);
-
- occurrenceSelectionArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Listener used for all of the text fields
- TextListener textListener = new TextListener();
-
-
- // Add the radio buttons
- RadioSelectListener radioSelectListener = new RadioSelectListener();
-
- singleRadio = addOccurenceRadioButton(RegexNode.SINGLE, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(singleRadio, XSDEditorCSHelpIds.REGEX_JUST_ONCE);
- ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
- starRadio = addOccurenceRadioButton(RegexNode.STAR, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(starRadio, XSDEditorCSHelpIds.REGEX_ZERO_OR_MORE);
- ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
- plusRadio = addOccurenceRadioButton(RegexNode.PLUS, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(plusRadio, XSDEditorCSHelpIds.REGEX_ONE_OR_MORE);
- ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
- optionalRadio = addOccurenceRadioButton(RegexNode.OPTIONAL, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(optionalRadio, XSDEditorCSHelpIds.REGEX_OPTIONAL);
- ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
- repeatRadio = addOccurenceRadioButton(RegexNode.REPEAT, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(repeatRadio, XSDEditorCSHelpIds.REGEX_REPEAT_RADIO);
-
- repeatValue = new Text(occurrenceSelectionArea, SWT.SINGLE | SWT.BORDER);
- repeatValue.addListener(SWT.Modify, textListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(repeatValue, XSDEditorCSHelpIds.REGEX_REPEAT_FIELD);
- repeatValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_REPEAT"));
- repeatValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- setEnabledStatus(RegexNode.REPEAT, false);
-
- rangeRadio = addOccurenceRadioButton(RegexNode.RANGE, occurrenceSelectionArea, radioSelectListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(rangeRadio, XSDEditorCSHelpIds.REGEX_RANGE_RADIO);
-
- // Add text fields and labels for specifying the range
- Composite rangeWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
- GridLayout gridLayout = new GridLayout(3, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- rangeWidgets.setLayout(gridLayout);
- rangeWidgets.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- rangeMinValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
- rangeMinValue.addListener(SWT.Modify, textListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(rangeMinValue, XSDEditorCSHelpIds.REGEX_RANGE_MINIMUM_FIELD);
- rangeMinValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MIN"));
- rangeMinValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- rangeToLabel = new Label(rangeWidgets, SWT.NONE);
- rangeToLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TO_LABEL"));
-
- rangeMaxValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
- rangeMaxValue.addListener(SWT.Modify, textListener);
- rangeMaxValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MAX"));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(rangeMaxValue, XSDEditorCSHelpIds.REGEX_RANGE_MAXIMUM_FIELD);
- rangeMaxValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- setEnabledStatus(RegexNode.RANGE, false);
-
- singleRadio.setSelection(true);
-
- // The add button
- add = new Button(composite, SWT.PUSH);
- add.addSelectionListener(new ButtonSelectListener());
- add.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(add, XSDEditorCSHelpIds.REGEX_ADD_BUTTON);
- add.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON"));
-
-
- Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
- // Our main text box
-
- Label valueLabel= new Label(composite, SWT.LEFT);
- valueLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL"));
-
- value = new StyledText(composite, SWT.SINGLE | SWT.BORDER);
- value.addListener(SWT.Modify, textListener);
- value.addListener(SWT.Selection, textListener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(value, XSDEditorCSHelpIds.REGEX_CURRENT_VALUE);
- value.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX"));
- value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- value.setFocus();
-
- // StyleRange used for highlighting parse errors
- currentError = new StyleRange();
- currentError.length = 1;
- currentError.foreground = parent.getDisplay().getSystemColor(SWT.COLOR_RED);
-
- // The caret label
- caretLabel = new Label(composite, SWT.LEFT);
- caretLabel.setImage(XSDEditorPlugin.getXSDImage("icons/RegexWizardArrow.gif"));
- caretLabel.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL"));
- setShowCaretLabel(true);
-
- value.addFocusListener(new TextFocusListener());
-
- terms.select(0);
-
-
- setControl(composite);
- }
-
-
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
-
- value.setText(pattern.getLexicalValue());
- value.setCaretOffset(value.getCharCount());
- }
-
- public void dispose()
- {
- super.dispose();
- }
-
-
- /**
- * Sets the visible status of caretLabel to status. If status is true, then we also update the position
- * of caretLabel in one of two ways. If there is no active selection in value, we set caretLabel's
- * position to correspond with the position of the actual caret. Alternatively, if there is an active selection
- * in value, we set caretLabel's position to the beginning of the selection.
- *
- * @param The new visibility status of caretLabel.
- */
- private void setShowCaretLabel(boolean status)
- {
- if (status)
- {
-
- int offset;
-
- if (value.getSelectionText().equals(""))
- {
- offset = value.getCaretOffset();
- }
- else
- {
- offset = value.getSelection().x;
- }
-
- Point p = value.getLocationAtOffset(offset);
-
- p.x += value.getLocation().x;
- p.y = value.getLocation().y;
-
- // Place the label under value, and make sure it is aligned with the caret.
- // The offsets are dependent on the icon used.
- p.x += CARET_LABEL_X_OFFSET;
- p.y += CARET_LABEL_Y_OFFSET;
-
- if (debug)
- {
- System.out.println("POINT: " + p); //$NON-NLS-1$
- }
-
- caretLabel.setLocation(p);
- caretLabel.setVisible(true);
- }
- else
- {
- caretLabel.setVisible(false);
- }
- }
-
-
- /**
- * Adds a new radio button to Composite c with SelectionListener l. The text of the button is the String associated with
- * quantifier.
- *
- * @param quantifier The desired quantifier, as enumerated in RegexNode.
- * @param c The Composite to add the buttons to (normally occurrenceRadioButtons).
- * @param l The SelectionListener (normally radioSelectionListener).
- * @return The newly created button.
- */
- private Button addOccurenceRadioButton(int quantifier, Composite c, SelectionListener l)
- {
- Button result = new Button(c, SWT.RADIO);
- result.setText(RegexNode.getQuantifierText(quantifier));
- result.addSelectionListener(l);
- return result;
- }
-
-
- /**
- * Validates the regex in value. If the regex is valid, clears the Wizard's error message. If it's not valid,
- * sets the Wizard's error message accordingly.
- *
- * @return Whether the regex is valid.
- */
- private boolean validateRegex()
- {
-
- boolean isValid;
- try
- {
- // We validate the regex by checking whether we get a ParseException.
- // By default, we assume that it's valid unless we determine otherwise.
- isValid = true;
- displayRegexErrorMessage(null);
- value.setStyleRange(null);
-
- Pattern.compile(value.getText());
- }
- catch (PatternSyntaxException pe)
- {
- isValid = false;
- displayRegexErrorMessage(pe.getMessage());
-
- // An off-by-one bug in the xerces regex parser will sometimes return a location for the parseError that
- // is off the end of the string. If this is the case, then we want to highlight the last character.
- if (pe.getIndex() >= value.getText().length())
- {
- currentError.start = value.getText().length() - 1;
- }
- else
- {
- currentError.start = pe.getIndex();
- }
-
- if (debug)
- {
- System.out.println("Parse Error location: " + pe.getIndex()); //$NON-NLS-1$
- System.out.println("currentError.start: " + currentError.start); //$NON-NLS-1$
- }
-
- value.setStyleRange(currentError);
-
- }
-
- // Another bug in the xerces parser will sometimes throw a RuntimeException instead of a ParseException.
- // When we get a RuntimeException, we aren't provided with the additional information we need to highlight
- // the parse error. So, we merely report that there is an error.
- catch (RuntimeException re)
- {
- displayRegexErrorMessage("");
- value.setStyleRange(null);
- isValid = false;
- }
-
- setPageComplete(isValid);
- return isValid;
- }
-
-
- /**
- * Manages the display of error messages.
- * Sets the error message for type to errorMessage. If errorMessage != null, then we set the Wizard's error message
- * to errorMessage. If errorMessage == null, then we check whether we have a pending message of another type.
- * If we do, then it is displayed as the Wizard's error message. If we don't, then the Wizard's error message field
- * is cleared.
- *
- * @param errorMessage The text of the new error message. A value of null indicates that the error message should
- * be cleared.
- * @param type The error type, one of PARSE, TOKEN, or SELECTION.
- */
- private void displayErrorMessage(String errorMessage, int type)
- {
- String messageToDisplay = null;
-
-
- currentErrorMessages[type] = errorMessage;
-
- messageToDisplay = errorMessage;
-
- for (int i = 0; i < NUM_ERROR_MESSAGE_TYPES; i++)
- {
- if (messageToDisplay != null)
- {
- break;
- }
- messageToDisplay = currentErrorMessages[i];
- }
-
- setErrorMessage(messageToDisplay);
- }
-
-
- /**
- * Sets the Wizard's error message to message, preceded by a standard prefix.
- *
- * @param message The new error message (or null to clear it).
- */
- private void displayRegexErrorMessage (String errorMessage)
- {
- if (errorMessage == null)
- {
- displayErrorMessage(null, PARSE);
- }
- else
- {
- if (errorMessage.trim().equals("")) // when there is no error message available.
- {
- displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REGEX_ERROR"),
- PARSE);
- }
- else
- {
- displayErrorMessage(errorMessage, PARSE);
- }
- }
- }
-
-
- /**
- * Updates the token status. Sets isValidToken to status && the status of the other error type.
- * If status is true, we clear the wizard's error message for this type; if it is false, we set it to errorMessage.
- *
- * @param status The new isValidToken value.
- * @param errorMessage The new error message.
- * @param type The type of the error (either TOKEN or SELECTION).
- */
- private void setTokenStatus (boolean status, String errorMessage, int type)
- {
- boolean otherTypeStatus = (type == TOKEN) ?
- currentErrorMessages[SELECTION] == null :
- currentErrorMessages[TOKEN] == null;
-
- isValidToken = status && otherTypeStatus;
- add.setEnabled(isValidToken);
-
- if (status)
- {
- displayErrorMessage(null, type);
- }
- else
- {
- if (errorMessage != null && errorMessage.trim().equals("")) // when there is no error message available.
- {
- displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR"),
- type);
- }
- else
- {
- displayErrorMessage(errorMessage, type);
- }
- }
- }
-
-
- /**
- * Updates the token status. Sets isValidToken to status && the status of the other error type.
- * Also clears the wizard's error message for this type.
- * Usually used to set isValidToken to true.
- *
- * @param status The new isValidToken value.
- * @param type The type of the error (either TOKEN or SELECTION).
- */
- private void setTokenStatus(boolean status, int type)
- {
- setTokenStatus(status, null, type);
- }
-
-
-
- /**
- * Sets the enabled status of the text fields and labels associated with the specified quantifier.
- * If status is true, then fields and labels associated with other quantifiers are disabled.
- * @param quantifier The quantifier whose elements' enabled status we wish to change
- * (as enumerated in RegexNode).
- * @param status The new status of the elements. If true, then all elements associated with other buttons
- * are disabled.
- */
- private void setEnabledStatus(int quantifier, boolean status)
- {
- switch (quantifier)
- {
-
- case RegexNode.REPEAT:
- repeatValue.setEnabled(status);
- if (status)
- {
- rangeMinValue.setEnabled(false);
- rangeMaxValue.setEnabled(false);
- rangeToLabel.setEnabled(false);
- }
- break;
-
- case RegexNode.RANGE:
- rangeMinValue.setEnabled(status);
- rangeMaxValue.setEnabled(status);
- rangeToLabel.setEnabled(status);
- if (status)
- {
- repeatValue.setEnabled(false);
- }
- break;
-
- }
- }
-
- /**
- * Checks to see if there is a selection in value. If there is not, we set the Wizard's error message accordingly.
- * If there is, we update the contents of node. If "Current Selection" is not the current token, then
- * we clear the Selection error message.
- */
- private void updateCurrentSelectionStatus()
- {
- if (terms.getSelectionIndex() == RegexNode.SELECTION)
- {
- String selection = value.getSelectionText();
- if (selection.equals(""))
- {
- setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR"), SELECTION);
- }
- else
- {
- setTokenStatus(true, SELECTION);
- node.setContents(selection);
- node.setHasParens(true);
- }
- }
- else
- {
- setTokenStatus(true, SELECTION);
- }
- }
-
- /**
- * Updates the enabled status of the auto-escape checkbox. If status is true, we enable the checkbox, and
- * set its selection status and node's auto-escape status to the value of autoEscapeStatus. If status is
- * false, then we disable and deselect the checkbox, and set node's status to false.
- *
- * @param status The new enabled status.
- */
- private void setEscapeCheckboxEnabledStatus(boolean status)
- {
- if (status)
- {
- escapeCheckbox.setEnabled(true);
- escapeCheckbox.setSelection(autoEscapeStatus);
- node.setAutoEscapeStatus(autoEscapeStatus);
- }
- else
- {
- escapeCheckbox.setEnabled(false);
- escapeCheckbox.setSelection(false);
- node.setAutoEscapeStatus(false);
- }
- }
-
-
- /**
- * Returns the current regex flags.
- */
- String getFlags()
- {
- return regexFlags;
- }
-
- /**
- * Returns the current XSDPattern model.
- */
- XSDPatternFacet getPattern()
- {
- return pattern;
- }
-
-
- /**
- * Returns a string consisting of the values of min, max, and repeat stored in node.
- * Used for debugging purposes only.
- */
- private String getAllFieldValues()
- {
- String result = "";
- result += "Min: " + node.getMin() + "\n";
- result += "Max: " + node.getMax() + "\n";
- result += "Repeat: " + node.getRepeat() + "\n";
- result += "\n";
- return result;
- }
-
-
- /* Listener for the add button. */
- class ButtonSelectListener implements SelectionListener
- {
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- // Precondition: isValidToken == true
- public void widgetSelected(SelectionEvent e)
- {
- if (!isValidToken) // should never happen
- {
- return;
- }
-
- // Whether there is anything selected in value.
- boolean isActiveSelection = value.getSelectionCount() != 0;
-
- value.insert(node.toString());
-
- if (terms.getSelectionIndex() == RegexNode.SELECTION)
- {
- updateCurrentSelectionStatus();
- }
-
- // If nothing is selected, then we need to advance the caret location.
- if (!isActiveSelection)
- {
- value.setCaretOffset(value.getCaretOffset() + node.toString().length());
- }
-
- value.setFocus();
-
- }
-
- }
-
-
- /* Listener for the terms combo box. */
- class ComboListener implements Listener
- {
- public void handleEvent(Event e)
- {
-
- updateCurrentSelectionStatus();
-
- // If the user has typed in a token
- if (terms.getSelectionIndex() == -1)
- {
- setEscapeCheckboxEnabledStatus(true);
- node.setContents(terms.getText());
- node.setHasParens(true);
-
-
- if (debug)
- {
- System.out.println(terms.getText());
- }
-
- }
- else if (terms.getSelectionIndex() == RegexNode.SELECTION)
- {
- setEscapeCheckboxEnabledStatus(false);
- }
- else
- {
- node.setContents(RegexNode.getRegexTermValue(terms.getSelectionIndex()));
- node.setHasParens(false);
- setEscapeCheckboxEnabledStatus(false);
- }
- }
- }
-
-
- /* Listener for enabling/disabling caretLabel. */
- class TextFocusListener implements FocusListener
- {
- public void focusGained(FocusEvent e)
- {
- setShowCaretLabel(false);
- }
- public void focusLost(FocusEvent e)
- {
- setShowCaretLabel(true);
- }
- }
-
-
-
- /* Listener for the text fields. */
- class TextListener implements Listener
- {
- public void handleEvent (Event e)
- {
-
- if (debug)
- {
- System.out.println("Inside TextListener handler"); //$NON-NLS-1$
- System.out.println(e);
- System.out.println(getAllFieldValues());
- }
-
-
- if ( (e.widget == value) && (e.type == SWT.Modify) )
- {
- pattern.setLexicalValue(value.getText());
- validateRegex();
- }
-
- else if (e.widget == value && e.type == SWT.Selection)
- {
- if (terms.getSelectionIndex() == RegexNode.SELECTION)
- {
- updateCurrentSelectionStatus();
- }
- }
-
- else if (e.widget == rangeMinValue)
- {
- boolean isValid = node.setMin(rangeMinValue.getText());
-
- if (isValid)
- {
- setTokenStatus(true, null, TOKEN);
- }
- else
- {
- setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX"), TOKEN);
- }
- }
-
- else if (e.widget == rangeMaxValue)
- {
- boolean isValid = node.setMax(rangeMaxValue.getText());
-
- if (node.getMin() == RegexNode.EMPTY)
- {
- setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX"), TOKEN);
- }
- else if (isValid)
- {
- setTokenStatus(true, null, TOKEN);
- }
- else
- {
- setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX"), TOKEN);
- }
- }
-
- else // (e.widget == repeatValue)
- {
- boolean isValid = node.setRepeat(repeatValue.getText());
- if (isValid)
- {
- setTokenStatus(true, null, TOKEN);
- }
- else
- {
- setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
- }
- }
- }
- }
-
- /* Listener for the auto-escape checkbox. */
- class CheckboxListener implements SelectionListener
- {
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- boolean newStatus = !autoEscapeStatus;
- node.setAutoEscapeStatus(newStatus);
- autoEscapeStatus = newStatus;
-
- if (debug)
- {
- System.out.println("AutoEscape Status: " + node.getAutoEscapeStatus()); //$NON-NLS-1$
- }
- }
-
- }
-
-
- /* Listener for the radio buttons. */
- class RadioSelectListener implements SelectionListener
- {
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (debug)
- {
- System.out.println(getAllFieldValues());
- }
-
-
- int currentQuantifier = getQuantifier(e);
-
- node.setQuantifier(currentQuantifier);
-
- switch (currentQuantifier)
- {
- case RegexNode.SINGLE:
- case RegexNode.STAR:
- case RegexNode.PLUS:
- case RegexNode.OPTIONAL:
- setEnabledStatus(RegexNode.REPEAT, false);
- setEnabledStatus(RegexNode.RANGE, false);
- setTokenStatus(true, TOKEN);
- break;
-
- case RegexNode.REPEAT:
- setEnabledStatus(RegexNode.REPEAT, true);
- setTokenStatus(node.hasValidRepeat(), XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
- repeatValue.setFocus();
- break;
-
- case RegexNode.RANGE:
- setEnabledStatus(RegexNode.RANGE, true);
- String error = (node.hasValidMin()) ?
- XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX") :
- XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX");
-
- setTokenStatus( node.hasValidMin() && node.hasValidMax(), error, TOKEN);
- rangeMinValue.setFocus();
- break;
- }
- }
-
- private int getQuantifier(SelectionEvent e)
- {
-
- if (e.widget == singleRadio)
- {
- return RegexNode.SINGLE;
- }
-
- else if (e.widget == starRadio)
- {
- return RegexNode.STAR;
- }
-
- else if (e.widget == plusRadio)
- {
- return RegexNode.PLUS;
- }
-
- else if (e.widget == optionalRadio)
- {
- return RegexNode.OPTIONAL;
- }
-
- else if (e.widget == repeatRadio)
- {
- return RegexNode.REPEAT;
- }
-
- else if (e.widget == rangeRadio)
- {
- return RegexNode.RANGE;
- }
-
- else // can't get here
- {
- return RegexNode.EMPTY;
- }
- }
- }
-
- public String getValue()
- {
- return value.getText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
deleted file mode 100644
index 64bbebcc07..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
+++ /dev/null
@@ -1,421 +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.xsd.ui.internal.wizards;
-
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-class RegexNode
-{
- private String contents;
- private int min;
- private int max;
- private int repeat;
- private int quantifier;
- private boolean hasParens;
- private boolean autoEscapeStatus;
-
-
- /* Quantifiers. */
- public static final int SINGLE = 0;
- public static final int STAR = 1;
- public static final int PLUS = 2;
- public static final int OPTIONAL = 3;
- public static final int REPEAT = 4;
- public static final int RANGE = 5;
-
- /* Regex quantifiers. First column is the on-screen textual representation, second column is the
- on-screen regex representation. The two are concatenated together to form the on-screen
- representation.
- Indexing of this array must correspond to the values of the quantifier constants above.
- */
- private static final String[][] regexQuantifiers =
- {
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_SINGLE"), "" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_STAR"), "*" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_PLUS"), "+" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL"), "?" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_REPEAT"), "" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_RANGE"), "" },
- };
-
-
- /* Regex tokens. First column is the on-screen representation, second column is the regex representation.
- More tokens can be added, but it is assumed that "Current Selection" is the last element in the array.
- If this is not the case, then the value of the SELECTION constant below will need to be changed
- accordingly.
- Also note that because these are java Strings, backslashes must be escaped (this is only relevant to the
- second column of the array).
- */
- private static final String[][] regexTerms =
- {
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ANY_CHAR"), "." },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR"), "\\w" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_WHITESPACE"), "\\s" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_DIGIT"), "\\d" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_UPPER"), "[A-Z]" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_LOWER"), "[a-z]" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_SELECTION"), "" },
- };
-
- /* Token enumerated constants. */
-
- // SELECTION must correspond to the index in regexTerms of "Current Selection". This is assumed to be
- // the last element.
- public static final int SELECTION = regexTerms.length - 1;
-
- public static final int EMPTY = -1;
-
- /*
- The metacharacters recognized by XML Schema.
- Note that the double backslash ("\\") actually represents an escaped single backslash character ("\").
- */
- private static final String metacharacters = ".\\?*+{}()[]";
-
-
- public static String getRegexTermText(int i)
- {
- if (i == SELECTION)
- {
- return regexTerms[i][0];
- }
- else
- {
- return regexTerms[i][0] + " ( " + regexTerms[i][1] + " )";
- }
- }
-
- public static String getRegexTermValue(int i)
- {
- if (i == SELECTION) // shouldn't happen
- {
- return "";
- }
- else
- {
- return regexTerms[i][1];
- }
- }
-
- public static int getNumRegexTerms()
- {
- return regexTerms.length;
- }
-
- public static String getQuantifierText(int i)
- {
- String result = regexQuantifiers[i][0];
-
- if (!regexQuantifiers[i][1].equals(""))
- {
- result += " ( ";
- result += regexQuantifiers[i][1];
- result += " )";
- }
-
- return result;
- }
-
- public RegexNode()
- {
- this.contents = "";
- this.quantifier = SINGLE;
- this.min = EMPTY;
- this.max = EMPTY;
- this.repeat = EMPTY;
- this.hasParens = false;
-
- }
-
-
- public String getContents()
- {
- return contents;
- }
-
- public void setContents(String contents)
- {
- this.contents = contents;
- }
-
-
- public int getQuantifier()
- {
- return quantifier;
- }
-
- public void setQuantifier(int quantifier)
- {
- this.quantifier = quantifier;
- }
-
-
- public int getMin()
- {
- return min;
- }
-
- public void setMin(int min)
- {
- this.min = min;
- }
-
- /**
- * Sets this.min to the integer representation of min iff min is a valid value (i.e. greater than 0).
- * Sets this.min to EMPTY if it is not.
- *
- * @param min The new min value
- * @returns Whether min was a valid value
- */
- public boolean setMin(String min)
- {
- this.min = convertToInt(min);
-
- // min > max is an invalid case, unless max is EMPTY (since EMPTY == -1).
- if ( (this.max != EMPTY) && (this.min > this.max) )
- {
- return false;
- }
-
- return (this.min >= 0);
- }
-
-
- public int getMax()
- {
- return max;
- }
-
- public void setMax(int max)
- {
- this.max = max;
- }
-
- /**
- * Sets this.max to the integer representation of max iff max is a valid value (i.e. greater than 0).
- * Sets this.max to EMPTY if it is not.
- *
- * @param max The new max value
- * @returns Whether max was a valid value, or (whether max == the empty string && min has a valid value)
- */
- public boolean setMax(String max)
- {
- this.max = convertToInt(max);
-
- // The empty string is a valid max value iff min has a valid value.
- // This is due to the fact that {n,} means "at least n times" in regex parlance.
- if (max.equals("") && this.min != EMPTY)
- {
- return true;
- }
-
- else if (this.max < this.min)
- {
- return false;
- }
-
- else
- {
- return (this.max >= 0);
- }
- }
-
-
-
- public int getRepeat()
- {
- return repeat;
- }
-
- public void setRepeat(int repeat)
- {
- this.repeat = repeat;
- }
-
- /**
- * Sets this.repeat to the integer representation of repeat iff repeat is a valid value (i.e. greater than 0).
- * Sets this.repeat to EMPTY if it is not.
- *
- * @param repeat The new repeat value
- * @returns Whether repeat was a valid value
- */
- public boolean setRepeat(String repeat)
- {
- this.repeat = convertToInt(repeat);
- return (this.repeat >= 0);
- }
-
-
-
- /**
- * Returns the integer representation of s. If s is less than zero, or if s is not an int
- * (i.e. if Integer.parseInt would throw a NumberFormatException), then returns EMPTY.
- *
- * @param s The String to convert.
- * @returns The integer representation of s.
- */
- private int convertToInt(String s)
- {
- int result;
- try
- {
- result = Integer.parseInt(s);
- if (result < 0)
- {
- result = EMPTY;
- }
- }
- catch (NumberFormatException e)
- {
- result = EMPTY;
- }
-
- return result;
- }
-
-
- public boolean getHasParens()
- {
- return hasParens;
- }
-
- public void setHasParens(boolean status)
- {
- this.hasParens = status;
- }
-
- public boolean getAutoEscapeStatus()
- {
- return autoEscapeStatus;
- }
-
- public void setAutoEscapeStatus(boolean status)
- {
- this.autoEscapeStatus = status;
- }
-
- /**
- * Returns an escaped version of s. In other words, each occurrence of a metacharacter ( .\?*+{}()[] )
- * is replaced by that character preceded by a backslash.
- *
- * @param s The String to escape.
- * @returns An escaped version of s.
- */
- private String addEscapeCharacters(String s)
- {
- StringBuffer result = new StringBuffer("");
-
- for (int i = 0; i < s.length(); i++)
- {
- char currentChar = s.charAt(i);
-
- if (isMetachar(currentChar))
- {
- result.append("\\"); // Note that this is an escaped backslash, not a double backslash.
- }
- result.append(currentChar);
-
- }
-
- return result.toString();
- }
-
- /**
- * Checks whether c is a metacharacter as defined in the static variable metacharacters.
- *
- * @param c The character to check.
- * @returns Whether c is a metacharacter.
- */
- private boolean isMetachar(char c)
- {
- return metacharacters.indexOf(c) != -1;
- }
-
-
- public boolean hasValidMin()
- {
- return (min != EMPTY);
- }
-
- public boolean hasValidMax()
- {
- return(max != EMPTY);
- }
-
- public boolean hasValidRepeat()
- {
- return(repeat != EMPTY);
- }
-
- public String toString()
- {
- String result = "";
-
- if (hasParens)
- {
- result += "(";
- }
-
- if (autoEscapeStatus)
- {
- result += addEscapeCharacters(contents);
- }
- else
- {
- result += contents;
- }
-
-
- if (hasParens)
- {
- result += ")";
- }
-
- switch (quantifier)
- {
- case STAR:
- result += "*";
- break;
-
- case PLUS:
- result += "+";
- break;
-
- case OPTIONAL:
- result += "?";
- break;
-
- case REPEAT:
- result += "{" + repeat + "}";
- break;
-
- case RANGE:
- result += "{" + min + ",";
- if (max == EMPTY)
- {
- result += "";
- }
- else
- {
- result += max;
- }
- result += "}";
- break;
-
- // SINGLE is a fall through
-
- }
- return result;
-
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
deleted file mode 100644
index 488c6ea155..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
+++ /dev/null
@@ -1,147 +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
- *******************************************************************************/
-// Based on version 1.6 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class RegexTestingPage extends WizardPage
-{
- /* Validator from xerces package. */
-// private RegularExpression validator;
-
- /* Displays the status of the match. */
- private Label matchLabel;
-
-
- /* The regex. */
- private Text value;
-
- /* The string the user is trying to match against the regex. */
- private StyledText testString;
-
- public RegexTestingPage()
- {
- super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
-
- setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
- setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
- }
-
-
- public void createControl(Composite parent)
- {
- Composite composite = ViewUtility.createComposite(parent, 1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, XSDEditorCSHelpIds.REGEX_TEST_PAGE);
-
- matchLabel = new Label(composite, SWT.WRAP);
- matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
- FontData[] fontData = matchLabel.getFont().getFontData();
- GridData dataF = new GridData();
- dataF.widthHint = 400;
- dataF.heightHint = 6 * fontData[0].getHeight();
- matchLabel.setLayoutData(dataF);
-
- Composite controls = new Composite(composite, SWT.NONE);
- GridLayout controlsLayout = new GridLayout();
- controlsLayout.numColumns = 2;
- controls.setLayout(controlsLayout);
- controls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_REGEX_LABEL"));
- value = new Text(controls, SWT.BORDER | SWT.READ_ONLY);
- value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
- new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_SAMPLE_TEXT"));
- testString = new StyledText(controls, SWT.SINGLE | SWT.BORDER);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(testString, XSDEditorCSHelpIds.REGEX_SAMPLE_TEXT);
- testString.addListener(SWT.Modify, new TestStringListener());
- testString.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- controls.pack();
-
- Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- GC gc = new GC(separator);
- Point pointSize = gc.stringExtent(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
- GridData gd = new GridData();
- gd.widthHint = pointSize.x / 2 + gc.getAdvanceWidth('M')*11;
- gd.horizontalAlignment= GridData.FILL;
- separator.setLayoutData(gd);
-
- composite.pack();
-
- setControl(composite);
- }
-
-
- private String getPatternValue()
- {
- return ( (RegexCompositionPage)getPreviousPage() ).getPattern().getLexicalValue();
- }
-
- private String getFlags()
- {
- return ( (RegexCompositionPage)getPreviousPage() ).getFlags();
- }
-
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
-
- getFlags();
- value.setText(TextProcessor.process(getPatternValue()));
- updateMatchStatus();
- testString.setFocus();
- }
-
- class TestStringListener implements Listener
- {
- public void handleEvent(Event e)
- {
- updateMatchStatus();
- }
- }
-
- private void updateMatchStatus()
- {
- if (Pattern.matches(getPatternValue(), testString.getText()))
- {
-// matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"));
- setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"), 1);
- }
- else
- {
- setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"), 2);
-// matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
deleted file mode 100644
index d341f661dc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-
-
-public class RegexWizard extends Wizard
-{
- private RegexCompositionPage compositionPage;
- private RegexTestingPage testingPage;
-
- /* The original, unchanged pattern. */
- private XSDPatternFacet originalPattern;
-
- /* A copy of the original pattern that is passed into the wizard. */
- private XSDPatternFacet modifiedPattern;
-
- String pattern;
-
- public RegexWizard(String expr)
- {
- super();
- setWindowTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TITLE"));
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/regx_wiz.png"));
-
- XSDFactoryImpl factory = new XSDFactoryImpl();
- modifiedPattern = factory.createXSDPatternFacet();
- modifiedPattern.setLexicalValue(expr);
-
- originalPattern = factory.createXSDPatternFacet();
- originalPattern.setLexicalValue(expr);
-
- compositionPage = new RegexCompositionPage(modifiedPattern);
- addPage(compositionPage);
-
- testingPage = new RegexTestingPage();
- addPage(testingPage);
- }
-
- public String getPattern()
- {
- return pattern;
- }
-
- public boolean canFinish()
- {
- return (compositionPage.getValue().length() > 0);
- }
-
- public boolean performFinish()
- {
- pattern = modifiedPattern.getLexicalValue();
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
deleted file mode 100644
index f709f10b7b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
+++ /dev/null
@@ -1,69 +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.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class XSDLocationChoicePage extends WizardPage
-{
- protected Button radioButton1;
- protected Button radioButton2;
-
- public XSDLocationChoicePage()
- {
- super("XSDLocationChoicePage");
-
- this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
- this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
- }
-
- public boolean isPageComplete()
- {
- return true;
- }
-
- public void createControl(Composite parent)
- {
- Composite base = new Composite(parent, SWT.NONE);
- base.setLayout(new GridLayout());
-
- ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
- Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);
-
- radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup,
- XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
-
- radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
- XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));
-
- radioButton1.setSelection(true);
-
- setControl(base);
- }
-
- // actions on finish
- public boolean performFinish()
- {
- return true;
- }
-
- public boolean isURL()
- {
- return radioButton2.getSelection();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
deleted file mode 100644
index f1c1e0b287..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
+++ /dev/null
@@ -1,129 +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.xsd.ui.internal.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-public class XSDNewFilePage extends WizardNewFileCreationPage
-{
- public XSDNewFilePage(IStructuredSelection selection)
- {
- super(XSDEditorPlugin.getXSDString("_UI_CREATEXSD"), selection);
- setTitle(XSDEditorPlugin.getXSDString("_UI_NEW_XML_SCHEMA_TITLE"));
- setDescription(XSDEditorPlugin.getXSDString("_UI_CREATE_A_NEW_XML_SCHEMA_DESC"));
- }
-
- public void createControl(Composite parent)
- {
- // inherit default container and name specification widgets
- super.createControl(parent);
-
- this.setFileName(computeDefaultFileName());
-
- setPageComplete(validatePage());
- }
-
- protected boolean validatePage()
- {
- Path newName = new Path(getFileName());
- String fullFileName = getFileName();
- String extension = newName.getFileExtension();
- if (extension == null || !extension.equalsIgnoreCase("xsd"))
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_FILENAME_MUST_END_XSD"));
- return false;
- }
- else
- {
- setErrorMessage(null);
- }
-
- // check for file should be case insensitive
- String sameName = existsFileAnyCase(fullFileName);
- if (sameName != null)
- {
- setErrorMessage(XSDEditorPlugin.getPlugin().getString("_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
- return false;
- }
-
- return super.validatePage();
- }
-
- public String defaultName = "NewXMLSchema"; //$NON-NLS-1$
- public String defaultFileExtension = ".xsd"; //$NON-NLS-1$
- public String[] filterExtensions = { "*.xsd"}; //$NON-NLS-1$
-
- protected String computeDefaultFileName()
- {
- int count = 0;
- String fileName = defaultName + defaultFileExtension;
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null)
- {
- while (true)
- {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
- {
- count++;
- fileName = defaultName + count + defaultFileExtension;
- }
- else
- {
- break;
- }
- }
- }
- return fileName;
- }
-
- // returns true if file of specified name exists in any case for selected container
- protected String existsFileAnyCase(String fileName)
- {
- if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
- && (fileName.compareTo("") != 0))
- {
- //look through all resources at the specified container - compare in upper case
- IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
- if (parent instanceof IContainer)
- {
- IContainer container = (IContainer) parent;
- try
- {
- IResource[] members = container.members();
- String enteredFileUpper = fileName.toUpperCase();
- for (int i=0; i<members.length; i++)
- {
- String resourceUpperName = members[i].getName().toUpperCase();
- if (resourceUpperName.equals(enteredFileUpper))
- {
- return members[i].getName();
- }
- }
- }
- catch (CoreException e)
- {
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
deleted file mode 100644
index 40c1bef077..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-
-/**
- * Extend the base wizard to select a file from the project or outside the workbench
- * and add error handling
- */
-public class XSDSelectIncludeFileWizard extends Wizard implements INewWizard
-{
- boolean isInclude;
- XSDSchema mainSchema;
- XSDSchema externalSchema;
-
- XSDLocationChoicePage choicePage;
- XSDSelectSingleFilePage filePage;
- XSDURLPage urlPage;
-
- IFile resultFile;
- String resultURL;
- String namespace = "";
-
- public XSDSelectIncludeFileWizard(XSDSchema mainSchema, boolean isInclude,
- String title, String desc,
- ViewerFilter filter,
- IStructuredSelection selection)
- {
- super();
- setWindowTitle(title);
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.png"));
-
- setNeedsProgressMonitor(true);
-
- // Choice Page
- choicePage = new XSDLocationChoicePage();
-
- // Select File Page
- filePage = new XSDSelectSingleFilePage(PlatformUI.getWorkbench(), selection, true);
- filePage.setTitle(title);
- filePage.setDescription(desc);
- filePage.addFilter(filter);
-
- // URL Page
- urlPage = new XSDURLPage();
- urlPage.setTitle(title);
- urlPage.setDescription(XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_URL"));
-
- this.mainSchema = mainSchema;
- this.isInclude = isInclude;
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
- {
- }
-
- public void addPages()
- {
- addPage(choicePage);
- addPage(filePage);
- addPage(urlPage);
- }
-
- public IWizardPage getNextPage(IWizardPage currentPage)
- {
- WizardPage nextPage = null;
-
- if (currentPage == choicePage)
- {
- if (choicePage.isURL())
- {
- nextPage = urlPage;
- }
- else
- {
- nextPage = filePage;
- }
- }
- return nextPage;
- }
-
- public boolean canFinish()
- {
- if (!choicePage.isURL())
- {
- return filePage.isPageComplete();
- }
- return true;
- }
-
- public boolean performFinish()
- {
- if (choicePage.isURL())
- {
- try
- {
- getContainer().run(false, true, urlPage.getRunnable());
- resultURL = urlPage.getURL();
- }
- catch (Exception e)
- {
- return false;
- }
- return true;
- }
- else
- {
- resultFile = filePage.getFile();
- }
- return true;
- }
-
- /**
- * Get the MOF object that represents the external file
- */
- public XSDSchema getExternalSchema()
- {
- return externalSchema;
- }
-
- public IFile getResultFile()
- {
- return resultFile;
- }
-
- public String getURL()
- {
- return resultURL;
- }
-
- public String getNamespace()
- {
- return namespace;
- }
-
- /**
- * Create a MOF model for the imported file
- */
- protected String doLoadExternalModel(IProgressMonitor monitor, String xsdModelFile, String xsdFileName)
- {
- String errorMessage = null;
- String currentNameSpace = mainSchema.getTargetNamespace();
-
- monitor.beginTask("Loading XML Schema", 100);
- monitor.worked(50);
-
- XSDParser parser = new XSDParser();
- parser.parse(xsdModelFile);
-
- externalSchema = parser.getSchema();
- if (externalSchema != null)
- {
- String extNamespace = externalSchema.getTargetNamespace();
- namespace = extNamespace;
-
- if (externalSchema.getDiagnostics() != null &&
- externalSchema.getDiagnostics().size() > 0)
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
- }
- else
- {
- if (isInclude)
- {
- // Check the namespace to make sure they are the same as current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdFileName);
- }
- }
- }
- else
- {
- // Check the namespace to make sure they are different from the current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdFileName);
- }
- }
- }
- }
- }
- else
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
- }
-
- monitor.subTask("Finish Loading");
- monitor.worked(80);
-
- return errorMessage;
- }
-
-
- /**
- * URL page
- */
- class XSDURLPage extends WizardPage
- {
- Text urlField;
- String saveString;
-
- public XSDURLPage()
- {
- super("URLPage");
- }
-
- public void createControl(Composite parent)
- {
- Composite client = ViewUtility.createComposite(parent,2);
- ViewUtility.setComposite(client);
-
- ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_URL"));
- ViewUtility.createLabel(client, "");
-
- urlField = ViewUtility.createTextField(client, 50);
- saveString = "http://";
- urlField.setText(saveString);
-
- setControl(client);
- }
-
- public String getURL()
- {
- return urlField.getText();
- }
-
- private boolean openExternalSchema(IProgressMonitor monitor)
- {
- String text = urlField.getText();
-// if (text.equals(saveString))
-// {
-// return false;
-// }
-// saveString = text;
-
- if (text.equals(""))
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_UI_SPECIFY_URL"));
- return false;
- }
-
- if ( !text.startsWith("http://") )
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_UI_URL_START_WITH"));
- return false;
- }
-
- setErrorMessage(null);
- String errorMessage = doLoadExternalModel(monitor, text, text);
- if (errorMessage != null)
- {
- setErrorMessage(errorMessage);
- return false;
- }
- else
- {
- return true;
- }
- }
-
- public IRunnableWithProgress getRunnable()
- {
- return new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException
- {
- if (monitor == null)
- {
- monitor= new NullProgressMonitor();
- }
- monitor.beginTask("", 6);
-
- boolean ok = openExternalSchema(monitor);
-
- if (!ok)
- {
- throw new InvocationTargetException(new java.lang.Error());
- }
-
- monitor.done();
- }
- };
- }
- }
-
- /**
- * Select XML Schema File
- */
- class XSDSelectSingleFilePage extends SelectSingleFilePage
- {
- public XSDSelectSingleFilePage(IWorkbench workbench, IStructuredSelection selection, boolean isFileMandatory)
- {
- super(workbench,selection,isFileMandatory);
- }
-
- private boolean openExternalSchema()
- {
- // Get the fully-qualified file name
- IFile iFile = getFile();
- if (iFile == null)
- return false;
-
- setErrorMessage(null);
-
- String xsdModelFile = iFile.getLocationURI().toString();
- String xsdFileName = iFile.getName();
- String errorMessage = doLoadExternalModel(new NullProgressMonitor(), xsdModelFile, xsdFileName);
-
- if (errorMessage != null)
- {
- setErrorMessage(errorMessage);
- return false;
- }
- else
- {
- return true;
- }
- }
-
- public boolean isPageComplete()
- {
- if (choicePage.isURL())
- {
- return true;
- }
-
- if (super.isPageComplete())
- {
- return openExternalSchema();
- }
- return super.isPageComplete();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java
deleted file mode 100644
index d41124077a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java
+++ /dev/null
@@ -1,77 +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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-
-
-public class AddFieldAction extends BaseSelectionAction
-{
- public static String ID = "AddFieldAction"; //$NON-NLS-1$
-
- public AddFieldAction(IWorkbenchPart part)
- {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_FIELD);
- }
-
- public void run()
- {
- if (getSelectedObjects().size() > 0)
- {
- Object o = getSelectedObjects().get(0);
- IComplexType type = null;
-
- if (o instanceof IComplexType)
- {
- type = (IComplexType)o;
- }
- else if (o instanceof IField)
- {
- IField field = (IField)o;
- type = field.getContainerType();
- }
- if (type != null)
- {
- Command command = type.getAddNewFieldCommand(""); //$NON-NLS-1$
- if (command != null)
- {
- getCommandStack().execute(command);
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(((BaseCommand)command).getAddedComponent());
- selectAddedComponent(adapter);
- }
- else
- {
- //TODO ... pop up a command not implemented message
- }
- }
- }
- }
-
- protected void doEdit(Object obj, IWorkbenchPart part)
- {
- if (obj instanceof BaseFieldEditPart)
- {
- BaseFieldEditPart editPart = (BaseFieldEditPart)obj;
- editPart.doEditName(!(part instanceof ContentOutline));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java
deleted file mode 100644
index 70141bec15..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java
+++ /dev/null
@@ -1,90 +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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.ui.actions.DirectEditAction;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-
-
-public class BaseDirectEditAction extends DirectEditAction {
- protected ISelectionProvider provider;
-
- /**
- * Same as {@link #DirectEditAction(IWorkbenchPart)}.
- * @param editor the editor
- */
- public BaseDirectEditAction(IEditorPart editor) {
- super((IWorkbenchPart)editor);
- }
-
- /**
- * Constructs a DirectEditAction using the specified part.
- * @param part the workbench part
- */
- public BaseDirectEditAction(IWorkbenchPart part) {
- super(part);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
- */
- protected ISelection getSelection()
- {
- // always get selection from selection provider first
- if (provider!=null) {
- Object selection = provider.getSelection();
- if (selection instanceof StructuredSelection) {
- Object object = ((StructuredSelection) selection).getFirstElement();
- if (object instanceof XSDBaseAdapter) {
- // We need to return an EditPart as the selection.
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object graphicalViewer = editor.getAdapter(GraphicalViewer.class);
- if (graphicalViewer instanceof AbstractEditPartViewer) {
- AbstractEditPartViewer viewer = (AbstractEditPartViewer) graphicalViewer;
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(object);
- return new StructuredSelection(editPart);
- }
- }
- }
- }
-
- return super.getSelection();
- }
-
- protected boolean calculateEnabled() {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter) {
- return !((XSDBaseAdapter) selection).isReadOnly();
- }
-
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- super.setSelectionProvider(provider);
- this.provider = provider;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java
deleted file mode 100644
index e52ea3a1a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-
-public abstract class BaseSelectionAction extends SelectionAction
-{
- public static final String SEPARATOR_ID = "org.eclipse.jface.action.Separator"; //$NON-NLS-1$
- public static final String SUBMENU_START_ID = "SUBMENU_START_ID: "; //$NON-NLS-1$
- public static final String SUBMENU_END_ID = "SUBMENU_END_ID: "; //$NON-NLS-1$
-
- protected ISelectionProvider provider;
- protected boolean doDirectEdit = true;
-
- public BaseSelectionAction(IWorkbenchPart part)
- {
- super(part);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
- */
- protected ISelection getSelection()
- {
- // always get selection from selection provider first
- if (provider!=null)
- return provider.getSelection();
-
- return super.getSelection();
- }
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- super.setSelectionProvider(provider);
- this.provider = provider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction#calculateEnabled()
- */
- protected boolean calculateEnabled()
- {
- if (getSelectedObjects().size() > 0)
- {
- Object o = getSelectedObjects().get(0);
- if (o instanceof IComplexType)
- {
- return !((IComplexType)o).isReadOnly();
- }
- else if (o instanceof IField)
- {
- return !((IField)o).isReadOnly();
- }
- else if (o instanceof IGraphElement)
- {
- return !((IGraphElement)o).isReadOnly();
- }
- }
- return true;
- }
-
- protected void selectAddedComponent(final Adapter adapter)
- {
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- if (adapter != null)
- {
- provider.setSelection(new StructuredSelection(adapter));
- if (doDirectEdit)
- activateDirectEdit();
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
-
- protected void activateDirectEdit()
- {
- if (getWorkbenchPart() instanceof IEditorPart)
- {
- try
- {
- IEditorPart owningEditor = (IEditorPart)getWorkbenchPart();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchPart part = workbench.getActiveWorkbenchWindow().getActivePage().getActivePart();
- Object object = owningEditor.getAdapter(GraphicalViewer.class);
- if (object instanceof AbstractEditPartViewer)
- {
- AbstractEditPartViewer viewer = (AbstractEditPartViewer)object;
- Object obj = viewer.getSelectedEditParts().get(0);
- doEdit(obj, part);
- }
- }
- catch (Exception e)
- {
-
- }
- }
- }
-
- protected void doEdit(Object obj, IWorkbenchPart part)
- {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java
deleted file mode 100644
index c0d0430814..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.adt.actions;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.SWTGraphics;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.LayerManager;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class CaptureScreenAction extends Action
-{
-
- private static String LAST_SCREEN_CAPTURE_PATH = System.getProperty("user.home"); //$NON-NLS-1$
- private static String LAST_SCREEN_CAPTURE_FILE_NAME = Messages._UI_ACTION_CAPTURE_SCREEN_DEFAULT_FILE_NAME;
- private static String LAST_SCREEN_CAPTURE_FILE_EXTENSION = ".jpg"; //$NON-NLS-1$
-
- public CaptureScreenAction()
- {
- setText(Messages._UI_CAPTURE_SCREEN_ACTION_TEXT);
- setToolTipText(Messages._UI_CAPTURE_SCREEN_ACTION_TOOLTIPTEXT);
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/etool16/capturescreen.gif")); //$NON-NLS-1$
- setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dtool16/capturescreen.gif")); //$NON-NLS-1$
- setAccelerator(SWT.CTRL | SWT.SHIFT | 'X'); //$NON-NLS-1$
- }
-
- public void run()
- {
- ImageExporter imageExporter = new ImageExporter();
- imageExporter.save(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(), (GraphicalViewer) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(GraphicalViewer.class));
- }
-
- public class ImageExporter
- {
- private static final String FILE_FORMATS = "*.jpeg;*.jfif;*.jpg;*.jpe;*.png;*.bmp;*.ico"; //$NON-NLS-1$
- private static final String FILE_SEPARATOR = "file.separator"; //$NON-NLS-1$
-
- public boolean save(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format)
- {
- Assert.isNotNull(editorPart, "null editorPart passed to ImageExporter.save"); //$NON-NLS-1$
- Assert.isNotNull(viewer, "null viewer passed to ImageExporter.save"); //$NON-NLS-1$
- Assert.isNotNull(saveFilePath, "null saveFilePath passed to ImageExporter.save"); //$NON-NLS-1$
-
- if (format != SWT.IMAGE_BMP && format != SWT.IMAGE_JPEG && format != SWT.IMAGE_ICO && format != SWT.IMAGE_PNG)
- throw new IllegalArgumentException(Messages._UI_ACTION_CAPTURE_SCREEN_FORMAT_NOT_SUPPORTED);
-
- try
- {
- saveEditorContentsAsImage(editorPart, viewer, saveFilePath, format);
- }
- catch (Exception ex)
- {
- MessageDialog.openError(editorPart.getEditorSite().getShell(), Messages._UI_ACTION_CAPTURE_SCREEN_ERROR_TITLE, Messages._UI_ACTION_CAPTURE_SCREEN_ERROR_DESCRIPTION);
- return false;
- }
-
- return true;
- }
-
- public boolean save(IEditorPart editorPart, GraphicalViewer viewer)
- {
- Assert.isNotNull(editorPart, "null editorPart passed to ImageExporter.save"); //$NON-NLS-1$
- Assert.isNotNull(viewer, "null viewer passed to ImageExporter.save"); //$NON-NLS-1$
-
- String saveFilePath = getSaveFilePath(editorPart, viewer);
- if (saveFilePath == null)
- return false;
-
- File file = new File(saveFilePath);
- if (file.exists() && file.isFile())
- {
- if (!MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages._UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION_QUESTION, Messages._UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION.replace("{0}", saveFilePath))) //$NON-NLS-1$
- {
- return false;
- }
- }
-
- int format = -1;
- String saveFilePathLowerCase = saveFilePath.toLowerCase();
- if (saveFilePathLowerCase.endsWith(".jpeg") || saveFilePathLowerCase.endsWith(".jpg") || saveFilePathLowerCase.endsWith(".jpe") || saveFilePathLowerCase.endsWith(".jfif")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- format = SWT.IMAGE_JPEG;
- else if (saveFilePathLowerCase.endsWith(".bmp")) //$NON-NLS-1$
- format = SWT.IMAGE_BMP;
- else if (saveFilePathLowerCase.endsWith(".ico")) //$NON-NLS-1$
- format = SWT.IMAGE_ICO;
- else if (saveFilePathLowerCase.endsWith(".png")) //$NON-NLS-1$
- format = SWT.IMAGE_PNG;
- else if (saveFilePathLowerCase.endsWith(".gif")) //$NON-NLS-1$
- format = SWT.IMAGE_GIF;
-
- if(format != -1) {
- return save(editorPart, viewer, saveFilePath, format);
- } else {
- return false;
- }
-
- }
-
- private String getSaveFilePath(IEditorPart editorPart, GraphicalViewer viewer)
- {
- String filePath;
-
- FileDialog fileDialog = new FileDialog(editorPart.getEditorSite().getShell(), SWT.SAVE);
-
- String[] filterExtensions = new String[] {FILE_FORMATS}; //$NON-NLS-1$
-
- fileDialog.setFileName(obtainNextFileName());
- fileDialog.setFilterExtensions(filterExtensions);
- fileDialog.setFilterNames(new String[] {FILE_FORMATS});
- fileDialog.setText(Messages._UI_ACTION_CAPTURE_SCREEN_FILE_SAVE_DIALOG_TITLE);
-
- filePath = fileDialog.open();
-
- if (filePath != null)
- {
- LAST_SCREEN_CAPTURE_PATH = fileDialog.getFilterPath();
- String fileName = fileDialog.getFileName();
- if (fileName.indexOf('.') > 0) {
- LAST_SCREEN_CAPTURE_FILE_NAME = fileName.substring(0, fileName.indexOf('.'));
- LAST_SCREEN_CAPTURE_FILE_EXTENSION = fileName.substring(fileName.indexOf('.'));
- }
- else
- {
- LAST_SCREEN_CAPTURE_FILE_NAME = fileName;
- LAST_SCREEN_CAPTURE_FILE_EXTENSION = ""; //$NON-NLS-1$
- }
- }
- return filePath;
- }
-
- private void saveEditorContentsAsImage(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format)
- {
- /*
- * 1. First get the figure whose visuals we want to save as image. So we
- * would like to save the rooteditpart which actually hosts all the
- * printable layers.
- *
- * NOTE: ScalableRootEditPart manages layers and is registered
- * graphicalviewer's editpartregistry with the key LayerManager.ID ...
- * well that is because ScalableRootEditPart manages all layers that are
- * hosted on a FigureCanvas. Many layers exist for doing different things
- */
- ScalableRootEditPart rootEditPart = (ScalableRootEditPart) viewer.getEditPartRegistry().get(LayerManager.ID);
- IFigure rootFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS);// rootEditPart.getFigure();
-
- Rectangle rootFigureBounds = new Rectangle(new Point(0,0),rootFigure.getPreferredSize());
- List rootEditPartChildren = rootEditPart.getChildren();
- Iterator rootEditPartChildrenIterator = rootEditPartChildren.iterator();
- while(rootEditPartChildrenIterator.hasNext()) {
- Object object = rootEditPartChildrenIterator.next();
- if(object instanceof AbstractGraphicalEditPart) {
- AbstractGraphicalEditPart childAbstractGraphicalEditPart = (AbstractGraphicalEditPart)object;
- List grandChildren = childAbstractGraphicalEditPart.getChildren();
- Iterator grandChildrenIterator = grandChildren.iterator();
- while(grandChildrenIterator.hasNext()) {
- AbstractGraphicalEditPart grandChildAbstractGraphicalEditPart = (AbstractGraphicalEditPart)grandChildrenIterator.next();
- IFigure figure = grandChildAbstractGraphicalEditPart.getFigure();
- LayoutManager layoutManager = figure.getLayoutManager();
- if(layoutManager instanceof FillLayout) {
- rootFigureBounds = rootFigure.getBounds();
- }
- }
- }
- }
-
- /*
- * 2. Now we want to get the GC associated with the control on which all
- * figures are painted by SWTGraphics. For that first get the SWT Control
- * associated with the viewer on which the rooteditpart is set as contents
- */
- Control figureCanvas = viewer.getControl();
- GC figureCanvasGC = new GC(figureCanvas);
-
- /*
- * 3. Create a new Graphics for an Image onto which we want to paint
- * rootFigure
- */
- Image img = new Image(null, rootFigureBounds.width, rootFigureBounds.height);
- GC imageGC = new GC(img);
- imageGC.setBackground(figureCanvasGC.getBackground());
- imageGC.setForeground(figureCanvasGC.getForeground());
- imageGC.setFont(figureCanvasGC.getFont());
- imageGC.setLineStyle(figureCanvasGC.getLineStyle());
- imageGC.setLineWidth(figureCanvasGC.getLineWidth());
- imageGC.setXORMode(figureCanvasGC.getXORMode());
- Graphics imgGraphics = new SWTGraphics(imageGC);
-
- /* 4. Draw rootFigure onto image. After that image will be ready for save */
- rootFigure.paint(imgGraphics);
-
- /* 5. Save image */
- ImageData[] imgData = new ImageData[1];
- imgData[0] = img.getImageData();
-
- ImageLoader imgLoader = new ImageLoader();
- imgLoader.data = imgData;
- imgLoader.save(saveFilePath, format);
-
- /* release OS resources */
- figureCanvasGC.dispose();
- imageGC.dispose();
- img.dispose();
-
- }
-
- String obtainNextFileName()
- {
-
- int aux = LAST_SCREEN_CAPTURE_FILE_NAME.length() - 1;
- while (Character.isDigit(LAST_SCREEN_CAPTURE_FILE_NAME.charAt(aux)))
- {
- aux--;
- }
-
- String nonNumeratedfileName = LAST_SCREEN_CAPTURE_FILE_NAME.substring(0, aux + 1);
- String filePath = LAST_SCREEN_CAPTURE_PATH + System.getProperty(FILE_SEPARATOR) + nonNumeratedfileName + LAST_SCREEN_CAPTURE_FILE_EXTENSION; //$NON-NLS-1$
-
- int counter = 1;
- File file = new File(filePath);
- while (file.exists())
- {
- filePath = LAST_SCREEN_CAPTURE_PATH + System.getProperty(FILE_SEPARATOR) + nonNumeratedfileName + counter++ + LAST_SCREEN_CAPTURE_FILE_EXTENSION; //$NON-NLS-1$
- file = new File(filePath);
- }
-
- return filePath;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
deleted file mode 100644
index 9a634c1775..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class DeleteAction extends BaseSelectionAction
-{
- public final static String ID = "org.eclipse.wst.xsd.ui.internal.editor.DeleteAction"; //$NON-NLS-1$
- public DeleteAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_DELETE);
- setId(ID);
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") ); //$NON-NLS-1$
- }
-
- public void run()
- {
- for (Iterator i = ((IStructuredSelection) getSelection()).iterator(); i.hasNext(); )
- {
- Object selection = i.next();
- Command command = null;
- boolean doSetInput = false;
- boolean doSetModelAsInput = false;
- IADTObject topLevelContainer = null;
- IModel model = null;
-
- if (selection instanceof IGraphElement)
- {
- IGraphElement xsdObj = (IGraphElement)selection;
-
- if (xsdObj instanceof XSDBaseAdapter)
- {
- XSDBaseAdapter baseAdapter = (XSDBaseAdapter)xsdObj;
-
- // Do not delete selected item if it is read-only, or if the item selected
- // is null and the read only check cannot be completed
- if (baseAdapter == null || baseAdapter.isReadOnly())
- {
- continue;
- }
-
- topLevelContainer = xsdObj.getTopContainer();
- if (topLevelContainer == selection)
- {
- doSetInput = true;
- doSetModelAsInput = true;
- }
- command = xsdObj.getDeleteCommand();
- model = xsdObj.getModel();
- }
- }
-
- if (command != null)
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null && workbenchWindow.getActivePage() != null)
- {
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- if (editorPart != null)
- {
- Object viewer = editorPart.getAdapter(GraphicalViewer.class);
- if (viewer instanceof DesignViewGraphicalViewer)
- {
- Object input = ((DesignViewGraphicalViewer)viewer).getInput();
- if (input != selection)
- {
- // Bug 86218 : Don't switch to top level view if the object we're deleting
- // is not the input to the viewer
- doSetInput = false;
- }
- }
- }
- }
- }
- command.execute();
- if (doSetInput)
- {
- if (model != null && doSetModelAsInput)
- provider.setSelection(new StructuredSelection(model));
- else if (topLevelContainer != null && !doSetModelAsInput)
- provider.setSelection(new StructuredSelection(topLevelContainer));
- }
- }
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java
deleted file mode 100644
index 61da6b4ac7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java
+++ /dev/null
@@ -1,75 +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.wst.xsd.ui.internal.adt.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.CategoryEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDSchemaEditPart;
-
-public class DesignSelectAll extends BaseSelectionAction
-{
- private GraphicalViewer graphicalViewer;
- private List selected;
-
- public DesignSelectAll(IWorkbenchPart part)
- {
- super(part);
- setId(ActionFactory.SELECT_ALL.getId());
- setText(Messages._UI_ACTION_SELECT_ALL);
- }
-
- public void run()
- {
- super.run();
-
- IWorkbenchPart part = getWorkbenchPart();
- selected = new ArrayList();
- if (part instanceof CommonMultiPageEditor)
- {
- graphicalViewer = (GraphicalViewer) ((CommonMultiPageEditor) part).getAdapter(GraphicalViewer.class);
- if (graphicalViewer != null)
- {
- EditPart editPart = graphicalViewer.getContents();
- doSelectChildren(editPart);
-
- graphicalViewer.setSelection(new StructuredSelection(selected));
- }
- }
- }
-
- private void doSelectChildren(EditPart editPart)
- {
- List list = editPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof GraphicalEditPart)
- {
- if (!(o instanceof XSDSchemaEditPart) && !(o instanceof CategoryEditPart))
- {
- selected.add(o);
- }
- doSelectChildren((GraphicalEditPart) o);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java
deleted file mode 100644
index c5f9301298..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-public class SetInputToGraphView extends BaseSelectionAction
-{
- public static String ID = "SetAsFocus"; //$NON-NLS-1$
- protected IEditorPart editorPart;
- protected Object input;
-
- public SetInputToGraphView(IWorkbenchPart part)
- {
- this(part, null);
- }
-
- public SetInputToGraphView(IWorkbenchPart part, Object input)
- {
- super(part);
- this.input = input;
- setId(ID);
- setText(Messages._UI_ACTION_SET_AS_FOCUS);
- if (part instanceof IEditorPart)
- {
- editorPart = (IEditorPart)part;
- }
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- Object selection = input;
- if (selection == null)
- {
- selection = ((IStructuredSelection) getSelection()).getFirstElement();
- }
- Object adapter = getWorkbenchPart().getAdapter(GraphicalViewer.class);
-
- if (selection instanceof IADTObject)
- {
- IADTObject obj = (IADTObject) selection;
- if (adapter instanceof DesignViewGraphicalViewer)
- {
- DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) adapter;
- EditPart editPart = graphicalViewer.getInputEditPart();
- if (editPart instanceof RootContentEditPart)
- {
- graphicalViewer.setInputAndMarkLocation(obj);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java
deleted file mode 100644
index e3d232f072..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java
+++ /dev/null
@@ -1,56 +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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-/**
- * Show the properties view in the current perspective.
- */
-public class ShowPropertiesViewAction extends BaseSelectionAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
- public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
-
- protected static ImageDescriptor enabledImage, disabledImage;
-
- public ShowPropertiesViewAction(IWorkbenchPart part)
- {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_SHOW_PROPERTIES);
- setToolTipText(getText());
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/elcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dlcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- try
- {
- getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
- }
- catch (PartInitException pie)
- {
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java
deleted file mode 100644
index b827ca52e7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.xsd.ui.internal.adt.design;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.ui.parts.GraphicalViewerImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ADTFloatingToolbarEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-
-public class ADTFloatingToolbar extends GraphicalViewerImpl
-{
- protected IModel model;
- protected boolean isDrilledDown;
- protected ADTFloatingToolbarEditPart editPart;
-
- public ADTFloatingToolbar(IModel model)
- {
- this.model = model;
- }
-
- public void setModel(IModel model)
- {
- this.model = model;
- editPart = (ADTFloatingToolbarEditPart)getEditPartFactory().createEditPart(null, new ADTFloatingToolbarModel(model));
- if (editPart == null)
- {
- editPart = new ADTFloatingToolbarEditPart(model);
- }
- editPart.setModel(model);
- setContents(editPart);
- }
-
- public Control createControl(Composite composite)
- {
- Canvas canvas = new Canvas(composite, SWT.NONE);
- canvas.setBackground(ColorConstants.white);
- setControl(canvas);
- return getControl();
- }
-
- public void refresh(boolean isDrilledDown)
- {
- this.isDrilledDown = isDrilledDown;
- if (editPart != null) {
- editPart.setIsDrilledDown(isDrilledDown);
- }
- EditPart contents = getContents();
- if (contents != null) {
- contents.refresh();
- }
- }
-
- public class ADTFloatingToolbarModel
- {
- IModel model;
- public ADTFloatingToolbarModel(IModel model)
- {
- this.model = model;
- }
-
- public IModel getModel()
- {
- return model;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java
deleted file mode 100644
index dfc4e82478..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-
-/**
- * This key handler is designed to be re-used by both the WSDL and XSD editor
- */
-public class BaseGraphicalViewerKeyHandler extends GraphicalViewerKeyHandler
-{
- public BaseGraphicalViewerKeyHandler(GraphicalViewer viewer)
- {
- super(viewer);
- }
-
- public boolean keyPressed(KeyEvent event)
- {
- int direction = -1;
- boolean isAltDown = (event.stateMask & SWT.ALT) != 0;
- boolean isCtrlDown = (event.stateMask & SWT.CTRL) != 0;
- switch (event.keyCode)
- {
- case SWT.ARROW_LEFT : {
- direction = PositionConstants.WEST;
- break;
- }
- case SWT.ARROW_RIGHT : {
- direction = PositionConstants.EAST;
- break;
- }
- case SWT.ARROW_UP : {
- direction = isAltDown ? KeyBoardAccessibilityEditPolicy.OUT_TO_PARENT : PositionConstants.NORTH;
- break;
- }
- case SWT.ARROW_DOWN : {
- direction = isAltDown ? KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD : PositionConstants.SOUTH;
- break;
- }
- }
-
- if (direction != -1)
- {
- GraphicalEditPart focusEditPart = getFocusEditPart();
- KeyBoardAccessibilityEditPolicy policy = (KeyBoardAccessibilityEditPolicy)focusEditPart.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
-
- if (policy != null)
- {
- EditPart target = policy.getRelativeEditPart(focusEditPart, direction);
- if (target != null)
- {
- if(isCtrlDown) {
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object keyboardDrag = editor.getAdapter(IKeyboardDrag.class);
- if (keyboardDrag instanceof IKeyboardDrag) {
- ((IKeyboardDrag) keyboardDrag).performKeyboardDrag(focusEditPart, direction);
- return true;
- }
- }
- else {
- navigateTo(target, event);
- return true;
- }
- }
- }
- }
-
- switch (event.keyCode)
- {
- case SWT.PAGE_DOWN :
- {
- if (scrollPage(event, PositionConstants.SOUTH))
- return true;
- }
- case SWT.PAGE_UP :
- {
- if (scrollPage(event, PositionConstants.NORTH))
- return true;
- }
- case SWT.F3 :
- case SWT.CR :
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
- if (registry != null)
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- if (action != null)
- action.run();
- }
- }
- /*
- case SWT.F5 :
- {
- IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (part != null)
- {
- EditorModeManager manager = (EditorModeManager)part.getAdapter(EditorModeManager.class);
- EditorMode[] modes = manager.getModes();
- EditorMode mode = manager.getCurrentMode();
- List list = Arrays.asList(modes);
- int index = list.indexOf(mode);
- int nextIndex = index + 1;
- if (nextIndex < modes.length)
- {
- mode = (EditorMode)list.get(nextIndex);
- }
- else
- {
- mode = (EditorMode)list.get(0);
- }
- if (mode != manager.getCurrentMode())
- {
- manager.setCurrentMode(mode);
- }
- }
- return true;
- }*/
- }
- return super.keyPressed(event);
- }
-
- private boolean scrollPage(KeyEvent event, int direction)
- {
- if (!(getViewer().getControl() instanceof FigureCanvas))
- return false;
- FigureCanvas figCanvas = (FigureCanvas) getViewer().getControl();
- Point loc = figCanvas.getViewport().getViewLocation();
- Rectangle area = figCanvas.getViewport().getClientArea(Rectangle.SINGLETON).scale(.8);
- if (direction == PositionConstants.NORTH)
- {
- figCanvas.scrollToY(loc.y - area.height);
- }
- else
- {
- figCanvas.scrollToY(loc.y + area.height);
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
deleted file mode 100644
index a13e440666..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.design;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ContextMenuParticipant;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.refactor.IXSDRefactorConstants;
-
-
-public class DesignViewContextMenuProvider extends ContextMenuProvider
-{
- IEditorPart editor;
- ISelectionProvider selectionProvider;
-
- /**
- * Constructor for GraphContextMenuProvider.
- *
- * @param selectionProvider
- * @param editor
- */
- public DesignViewContextMenuProvider(IEditorPart editor, EditPartViewer viewer, ISelectionProvider selectionProvider)
- {
- super(viewer);
- this.editor = editor;
- this.selectionProvider = selectionProvider;
- }
-
- /**
- * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.eclipse.gef.EditPartViewer)
- */
- public void buildContextMenu(IMenuManager menu)
- {
- IMenuManager currentMenu = menu;
-
- EditorModeManager manager = (EditorModeManager)editor.getAdapter(EditorModeManager.class);
- ContextMenuParticipant contextMenuParticipant = manager != null ? manager.getCurrentMode().getContextMenuParticipant() : null;
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- ActionRegistry registry = getEditorActionRegistry();
- ISelection selection = selectionProvider.getSelection();
-
- if (selection != null)
- {
- Object selectedObject = ((StructuredSelection) selection).getFirstElement();
-
- // Convert editparts to model objects as selections
- if (selectedObject instanceof EditPart)
- {
- selectedObject = ((EditPart)selectedObject).getModel();
- }
-
- if (selectedObject instanceof IActionProvider)
- {
- IActionProvider actionProvider = (IActionProvider) selectedObject;
-
- String[] actions = actionProvider.getActions(null);
- for (int i = 0; i < actions.length; i++)
- {
- String id = actions[i];
- if (contextMenuParticipant == null || contextMenuParticipant.isApplicable(selectedObject, id))
- {
- if (id.startsWith(BaseSelectionAction.SUBMENU_START_ID))
- {
- String text = id.substring(BaseSelectionAction.SUBMENU_START_ID.length());
- IMenuManager subMenu = new MenuManager(text);
- currentMenu.add(subMenu);
- currentMenu = subMenu;
- }
- else if (id.startsWith(BaseSelectionAction.SUBMENU_END_ID))
- {
- currentMenu = getParentMenu(menu, currentMenu);
- }
- else if (id.equals(BaseSelectionAction.SEPARATOR_ID))
- {
- currentMenu.add(new Separator());
- }
- else
- {
- IAction action = registry.getAction(id);
- if (action != null)
- {
- action.isEnabled();
- currentMenu.add(action);
- }
- }
- }
- }
- menu.add(new Separator());
- IMenuManager subMenu = new MenuManager(Messages._UI_REFACTOR_CONTEXT_MENU, IXSDRefactorConstants.REFACTOR_CONTEXT_MENU_ID); //$NON-NLS-1$
- menu.add(subMenu);
- menu.add(new Separator());
- menu.add(new Separator("search-slot")); //$NON-NLS-1$
- menu.add(new Separator());
- menu.add(new Separator("endDesignMenu-slot")); // $NON-NLS-1$
- menu.add(new Separator());
- }
- }
- menu.add(new Separator());
- }
-
- protected IMenuManager getParentMenu(IMenuManager root, IMenuManager child) {
- IMenuManager parent = null;
-
- IContributionItem[] kids = root.getItems();
- int index = 0;
- while (index < kids.length && parent == null) {
- IContributionItem item = kids[index];
- if (item.equals(child)) {
- parent = root;
- }
- else {
- if (item instanceof IMenuManager) {
- parent = getParentMenu((IMenuManager) item, child);
- }
- }
- index++;
- }
-
- return parent;
- }
-
- protected ActionRegistry getEditorActionRegistry()
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
- protected CommandStack commandStack;
-
- protected CommandStack getCommandStack()
- {
- if (commandStack == null)
- commandStack = getViewer().getEditDomain().getCommandStack();
- return commandStack;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
deleted file mode 100644
index 381415ca8c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.INavigationHistory;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IHolderEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonSelectionManager;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage;
-
-public class DesignViewGraphicalViewer extends ScrollingGraphicalViewer implements ISelectionChangedListener
-{
- protected ADTSelectionChangedListener internalSelectionProvider = new ADTSelectionChangedListener();
- protected InputChangeManager inputChangeManager = new InputChangeManager();
- private IEditorPart editorPart;
-
- public DesignViewGraphicalViewer(IEditorPart editor, CommonSelectionManager manager)
- {
- super();
- this.editorPart = editor;
- setContextMenu(new DesignViewContextMenuProvider(editor, this, this));
- editor.getEditorSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.graph", getContextMenu(), internalSelectionProvider, false); //$NON-NLS-1$
-
- // make the internalSelectionProvider listen to graph view selection changes
- addSelectionChangedListener(internalSelectionProvider);
- internalSelectionProvider.addSelectionChangedListener(manager);
- manager.addSelectionChangedListener(this);
-
- setKeyHandler(new BaseGraphicalViewerKeyHandler(this));
- }
-
-
- // this method is called when something changes in the selection manager
- // (e.g. a selection occured from another view)
- public void selectionChanged(SelectionChangedEvent event)
- {
- Object selectedObject = null;
- ISelection eventSelection = event.getSelection();
- if (eventSelection instanceof StructuredSelection)
- {
- selectedObject = ((StructuredSelection) eventSelection).getFirstElement();
- }
- // TODO (cs) It seems like there's way more selection going on than there
- // should
- // be!! There's at least 2 selections getting fired when something is
- // selected in the
- // outline view. Are we listening to too many things?
- //
- // if (event.getSource() instanceof ADTContentOutlinePage)
- if (selectedObject != null)
- {
- if (event.getSource() != internalSelectionProvider)
- {
- if (selectedObject instanceof IStructure)
- {
- if (((getInput() instanceof IModel) && (event.getSource() instanceof ADTContentOutlinePage)) ||
- (!(getInput() instanceof IModel)))
- {
- if ((selectedObject instanceof IGraphElement) && ((IGraphElement)selectedObject).isFocusAllowed())
- {
- if (!(event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider))
- {
- setInputAndMarkLocation((IStructure)selectedObject);
- }
- }
- }
- }
- else if (selectedObject instanceof IGraphElement)
- {
- if (((IGraphElement)selectedObject).isFocusAllowed() && ((event.getSource() instanceof ADTContentOutlinePage)))
- {
- setInputAndMarkLocation((IADTObject)selectedObject);
- }
- else if (!((IGraphElement)selectedObject).isFocusAllowed())
- {
- // We encountered an object that is not a valid input to the graph viewer
- // Now find the top container that can be a valid input
- IADTObject obj = ((IGraphElement)selectedObject).getTopContainer();
- if (event.getSource() instanceof ADTContentOutlinePage)
- {
- // In this case, if the selection is originated from the outline, we should
- // change the inputs
- if (obj != null && getInput() != obj) // Don't change inputs if the obj is already the input
- setInputAndMarkLocation(obj);
- }
- else if (event.getSource() instanceof CommonSelectionManager)
- {
- // In this case, if the selection is originated from some action, ie. adding
- // a new element, we should change the input only if the current input is the model
- // otherwise, inputs will change unexpectedly!!
- if (getInput() instanceof IModel)
- {
- if (obj != null)
- setInput (obj);
- }
- }
- else if (event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider )
- {
- // In this case, if the selection is originated from the source viewer
- // we should change the input regardless. Test is for multiple levels
- // of anonymous types
- if (obj != null)
- setInput (obj);
- }
- else
- {
- if (obj != null && getInput() instanceof IModel)
- setInputAndMarkLocation(obj);
- }
- }
- if (selectedObject instanceof IField)
- {
- IField field = (IField)selectedObject;
- if ( (!field.isGlobal() && getInput() instanceof IModel) ||
- (!field.isGlobal() && !(event.getSource() instanceof CommonSelectionManager)))
- {
- IADTObject obj = ((IGraphElement)selectedObject).getTopContainer();
- if (obj != null)
- setInputAndMarkLocation(obj);
- }
- else if (field.isGlobal() && !(getInput() instanceof IModel))
- {
- if (event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider )
- setInput(field);
- else
- setInputAndMarkLocation(field);
- }
- }
- }
- else if (selectedObject instanceof IField)
- {
- IField field = (IField)selectedObject;
- if ( (field.isGlobal() && (getInput() instanceof IModel) && (event.getSource() instanceof ADTContentOutlinePage)) ||
- ( (field.isGlobal() && !(getInput() instanceof IModel))))
- {
- setInputAndMarkLocation(field);
- }
- }
- else if (selectedObject instanceof IModelProxy)
- {
- IModelProxy adapter = (IModelProxy)selectedObject;
- if (selectedObject instanceof RedefineCategoryAdapter)
- {
- RedefineCategoryAdapter selectionAdapter = (RedefineCategoryAdapter)selectedObject;
- XSDRedefineAdapter selectionParentAdapter = selectionAdapter.getXsdRedefineAdapter();
- setInputAndMarkLocation(selectionParentAdapter);
- }
- else if (getInput() != adapter.getModel())
- setInput(adapter.getModel());
- }
- else if (selectedObject instanceof IModel)
- {
- if (getInput() != selectedObject)
- setInput((IModel)selectedObject);
- }
-
- EditPart editPart = getEditPart(getRootEditPart(), selectedObject);
- if (editPart != null)
- {
- setSelection(new StructuredSelection(editPart));
- setFocus(editPart);
- }
- }
- }
- }
-
- /*
- * We need to convert from edit part selections to model object selections
- */
- class ADTSelectionChangedListener implements ISelectionProvider, ISelectionChangedListener
- {
- protected List listenerList = new ArrayList();
- protected ISelection selection = new StructuredSelection();
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- protected void notifyListeners(SelectionChangedEvent event)
- {
- for (Iterator i = listenerList.iterator(); i.hasNext();)
- {
- ISelectionChangedListener listener = (ISelectionChangedListener) i.next();
- listener.selectionChanged(event);
- }
- }
-
- public StructuredSelection convertSelectionFromEditPartToModel(ISelection editPartSelection)
- {
- List selectedModelObjectList = new ArrayList();
- if (editPartSelection instanceof IStructuredSelection)
- {
- for (Iterator i = ((IStructuredSelection) editPartSelection).iterator(); i.hasNext();)
- {
- Object obj = i.next();
- Object model = null;
- if (obj instanceof EditPart)
- {
- EditPart editPart = (EditPart) obj;
- model = editPart.getModel();
- }
- if (model != null)
- {
- selectedModelObjectList.add(model);
- }
- }
- }
- return new StructuredSelection(selectedModelObjectList);
- }
-
- public void setSelection(ISelection selection)
- {
- this.selection = selection;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection newSelection = convertSelectionFromEditPartToModel(event.getSelection());
- this.selection = newSelection;
- SelectionChangedEvent newEvent = new SelectionChangedEvent(this, newSelection);
- notifyListeners(newEvent);
- }
- }
-
- protected EditPart getEditPart(EditPart parent, Object object)
- {
- EditPart result = null;
- for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- if (editPart.getModel() == object && !(editPart instanceof IHolderEditPart) && !(editPart instanceof RootContentEditPart))
- {
- result = editPart;
- break;
- }
- }
-
- if (result == null)
- {
- for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = getEditPart((EditPart)i.next(), object);
- if (editPart != null)
- {
- // First check to see if there is a selection
- ISelection currentSelection = getSelection();
-
- // If there is a selection then we will try to select
- // the target edit part that is one of its children
- // This is handy when you add an element to a structured edit part
- // then you want to select the element immediately and put it in
- // direct edit mode
- if (currentSelection != null)
- {
- if (currentSelection instanceof StructuredSelection)
- {
- EditPart targetStructureEditPart = (EditPart)((StructuredSelection)currentSelection).getFirstElement();
- if (targetStructureEditPart != null)
- {
- while (targetStructureEditPart != null)
- {
- if (targetStructureEditPart instanceof StructureEditPart)
- {
- break;
- }
- targetStructureEditPart = targetStructureEditPart.getParent();
- }
- }
- EditPart potentialEditPartToSelect = editPart;
-
- while (potentialEditPartToSelect != null)
- {
- if (potentialEditPartToSelect instanceof StructureEditPart)
- {
- break;
- }
- potentialEditPartToSelect = potentialEditPartToSelect.getParent();
- }
-
- // If we found a potential edit part to select then return it
- // OR, if there is no target found, then we should just return
- // the edit part we found
- if (potentialEditPartToSelect == targetStructureEditPart || potentialEditPartToSelect == null || targetStructureEditPart == null)
- {
- result = editPart;
- break;
- }
- }
- }
- else // Otherwise just find the first one and return
- {
- result = editPart;
- break;
- }
- }
- }
- }
-
- return result;
- }
-
- public void setInputAndMarkLocation(IADTObject object)
- {
- IADTObject oldInput = getInput();
- INavigationHistory navigationHistory = null;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if(workbench != null)
- {
- IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
- if(activeWorkbenchWindow != null)
- {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if(activePage != null)
- {
- navigationHistory = activePage.getNavigationHistory();
- }
- }
- }
-
- setInput(object);
-
- if (editorPart != null && oldInput != object)
- {
- navigationHistory.markLocation(editorPart);
- }
- }
-
- public void setInput(IADTObject object)
- {
- RootContentEditPart rootContentEditPart = (RootContentEditPart)getRootEditPart().getContents();
- rootContentEditPart.setModel(object);
- rootContentEditPart.refresh();
-
- if (object != null)
- {
- inputChangeManager.setSelection(new StructuredSelection(object));
- }
- // Select the editpart when it is set as input
- EditPart editPart = getEditPart(rootContentEditPart, object);
- if (editPart != null)
- select(editPart);
- }
-
- public IADTObject getInput()
- {
- RootContentEditPart rootContentEditPart = (RootContentEditPart)getRootEditPart().getContents();
- return (IADTObject)rootContentEditPart.getModel();
- }
-
- public EditPart getInputEditPart()
- {
- return getRootEditPart().getContents();
- }
-
- public void addInputChangdListener(ISelectionChangedListener listener)
- {
- inputChangeManager.addSelectionChangedListener(listener);
- }
-
- public void removeInputChangdListener(ISelectionChangedListener listener)
- {
- inputChangeManager.removeSelectionChangedListener(listener);
- }
-
-
- private class InputChangeManager implements ISelectionProvider
- {
- List listeners = new ArrayList();
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- public ISelection getSelection()
- {
- // no one should be calling this method
- return null;
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listeners.remove(listener);
- }
-
- public void setSelection(ISelection selection)
- {
- notifyListeners(selection);
- }
-
- void notifyListeners(ISelection selection)
- {
- List list = new ArrayList(listeners);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(new SelectionChangedEvent(this, selection));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewerGraphicConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewerGraphicConstants.java
deleted file mode 100644
index 434e0d7f75..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewerGraphicConstants.java
+++ /dev/null
@@ -1,21 +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.xsd.ui.internal.adt.design;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Display;
-
-public interface DesignViewerGraphicConstants
-{
- public static final String SCALED_HANDLE_LAYER = "Scaled Handle Layer"; //$NON-NLS-1$
- public final static Font smallFont = new Font(Display.getCurrent(), "Tahoma", 6, SWT.NONE); //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java
deleted file mode 100644
index 4959363983..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.wst.xsd.ui.internal.adt.design;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.accessibility.AccessibleTextAdapter;
-import org.eclipse.swt.accessibility.AccessibleTextEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TypedListener;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * The CCombo class represents a selectable user interface object
- * that combines a text field and a list and issues notification
- * when an item is selected from the list.
- * <p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to add children to it, or set a layout on it.
- * </p>
- * <dl>
- * <dt><b>Styles:</b>
- * <dd>BORDER, READ_ONLY, FLAT</dd>
- * <dt><b>Events:</b>
- * <dd>Selection</dd>
- * </dl>
- */
-public final class FlatCCombo extends Composite {
-
- Text text;
- List list;
- int visibleItemCount = 5;
- Shell popup;
- Label arrow;
- boolean hasFocus;
- Listener listener, filter;
- Color foreground, background;
- Font font;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#BORDER
- * @see SWT#READ_ONLY
- * @see SWT#FLAT
- * @see org.eclipse.swt.widgets.Widget#getStyle()
- */
-public FlatCCombo (Composite parent, int style) {
- super (parent, style = checkStyle (style));
-
- int textStyle = SWT.SINGLE;
- if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
- if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
- text = new Text (this, textStyle);
- arrow = new Label(this, SWT.FLAT);
- arrow.setImage(XSDEditorPlugin.getXSDImage("icons/TriangleToolBar.gif")); //$NON-NLS-1$
-
- listener = new Listener () {
- public void handleEvent (Event event) {
- if (popup == event.widget) {
- popupEvent (event);
- return;
- }
- if (text == event.widget) {
- textEvent (event);
- return;
- }
- if (list == event.widget) {
- listEvent (event);
- return;
- }
- if (arrow == event.widget) {
- arrowEvent (event);
- return;
- }
- if (FlatCCombo.this == event.widget) {
- comboEvent (event);
- return;
- }
- if (getShell () == event.widget) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
- filter = new Listener() {
- public void handleEvent(Event event) {
- Shell shell = ((Control)event.widget).getShell ();
- if (shell == FlatCCombo.this.getShell ()) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
-
- int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
- for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
-
- int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.MenuDetect, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn};
- for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
-
- int [] arrowEvents = {SWT.MouseDown, SWT.Selection, SWT.FocusIn};
- for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
-
- createPopup(null, -1);
- initAccessible();
-}
-static int checkStyle (int style) {
- int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- return style & mask;
-}
-/**
- * Adds the argument to the end of the receiver's list.
- *
- * @param string the new item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String,int)
- */
-public void add (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string);
-}
-/**
- * Adds the argument to the receiver's list at the given
- * zero-relative index.
- * <p>
- * Note: To add an item at the end of the list, use the
- * result of calling <code>getItemCount()</code> as the
- * index or use <code>add(String)</code>.
- * </p>
- *
- * @param string the new item
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String)
- */
-public void add (String string, int index) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string, index);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's text is modified, by sending
- * it one of the messages defined in the <code>ModifyListener</code>
- * interface.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #removeModifyListener
- */
-public void addModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Modify, typedListener);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection changes, by sending
- * it one of the messages defined in the <code>SelectionListener</code>
- * interface.
- * <p>
- * <code>widgetSelected</code> is called when the combo's list selection changes.
- * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #removeSelectionListener
- * @see org.eclipse.swt.events.SelectionEvent
- */
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Selection,typedListener);
- addListener (SWT.DefaultSelection,typedListener);
-}
-void arrowEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.Selection: {
- dropDown (!isDropped ());
- break;
- }
- case SWT.MouseDown: {
- dropDown (!isDropped ());
- break;
- }
- }
-}
-/**
- * Sets the selection in the receiver's text field to an empty
- * selection starting just before the first character. If the
- * text field is editable, this has the effect of placing the
- * i-beam at the start of the text.
- * <p>
- * Note: To clear the selected items in the receiver's list,
- * use <code>deselectAll()</code>.
- * </p>
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #deselectAll
- */
-public void clearSelection () {
- checkWidget ();
- text.clearSelection ();
- list.deselectAll ();
-}
-void comboEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (popup != null && !popup.isDisposed ()) {
- list.removeListener (SWT.Dispose, listener);
- popup.dispose ();
- }
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- popup = null;
- text = null;
- list = null;
- arrow = null;
- break;
- case SWT.Move:
- dropDown (false);
- break;
- case SWT.Resize:
- internalLayout (false);
- break;
- }
-}
-
-public Point computeSize (int wHint, int hHint, boolean changed) {
- checkWidget ();
- int width = 0, height = 0;
- String[] items = list.getItems ();
- int textWidth = 0;
- GC gc = new GC (text);
- int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
- for (int i = 0; i < items.length; i++) {
- textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
- }
- gc.dispose();
- Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- // Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- Point arrowSize = new Point(16, 16);
- Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- int borderWidth = getBorderWidth ();
-
- height = Math.max (textSize.y, arrowSize.y);
- width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x);
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point (width + 2*borderWidth, height + 2*borderWidth);
-}
-void createPopup(String[] items, int selectionIndex) {
- // create shell and list
- popup = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
- int style = getStyle ();
- int listStyle = SWT.SINGLE | SWT.V_SCROLL;
- if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
- if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
- if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
- list = new List (popup, listStyle);
- if (font != null) list.setFont (font);
- if (foreground != null) list.setForeground (foreground);
- if (background != null) list.setBackground (background);
-
- int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
- for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
- int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose};
- for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
-
- if (items != null) list.setItems (items);
- if (selectionIndex != -1) list.setSelection (selectionIndex);
-}
-/**
- * Deselects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already deselected, it remains
- * deselected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to deselect
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void deselect (int index) {
- checkWidget ();
- list.deselect (index);
-}
-/**
- * Deselects all selected items in the receiver's list.
- * <p>
- * Note: To clear the selection in the receiver's text field,
- * use <code>clearSelection()</code>.
- * </p>
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #clearSelection
- */
-public void deselectAll () {
- checkWidget ();
- list.deselectAll ();
-}
-void dropDown (boolean drop) {
- if (drop == isDropped ()) return;
- if (!drop) {
- popup.setVisible (false);
- if (!isDisposed ()&& arrow.isFocusControl()) {
- text.setFocus();
- }
- return;
- }
-
- if (getShell() != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- list.removeListener (SWT.Dispose, listener);
- popup.dispose();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
-
- Point size = getSize ();
- int itemCount = list.getItemCount ();
- itemCount = (itemCount == 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount);
- int itemHeight = list.getItemHeight () * itemCount;
- Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
- list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
-
- int index = list.getSelectionIndex ();
- if (index != -1) list.setTopIndex (index);
- Display display = getDisplay ();
- Rectangle listRect = list.getBounds ();
- Rectangle parentRect = display.map (getParent (), null, getBounds ());
- Point comboSize = getSize ();
- Rectangle displayRect = getMonitor ().getClientArea ();
- int width = Math.max (comboSize.x, listRect.width + 2);
- int height = listRect.height + 2;
- int x = parentRect.x;
- int y = parentRect.y + comboSize.y;
- if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
- if (x + width > displayRect.x + displayRect.width) x = displayRect.x + displayRect.width - listRect.width;
- popup.setBounds (x, y, width, height);
- popup.setVisible (true);
- list.setFocus ();
-}
-/*
- * Return the lowercase of the first non-'&' character following
- * an '&' character in the given string. If there are no '&'
- * characters in the given string, return '\0'.
- */
-char _findMnemonic (String string) {
- if (string == null) return '\0';
- int index = 0;
- int length = string.length ();
- do {
- while (index < length && string.charAt (index) != '&') index++;
- if (++index >= length) return '\0';
- if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
- index++;
- } while (index < length);
- return '\0';
-}
-/*
- * Return the Label immediately preceding the receiver in the z-order,
- * or null if none.
- */
-Label getAssociatedLabel () {
- Control[] siblings = getParent ().getChildren ();
- for (int i = 0; i < siblings.length; i++) {
- if (siblings [i] == this) {
- if (i > 0 && siblings [i-1] instanceof Label) {
- return (Label) siblings [i-1];
- }
- }
- }
- return null;
-}
-public Control [] getChildren () {
- return super.getChildren();
-}
-/**
- * Gets the editable state.
- *
- * @return whether or not the receiver is editable
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public boolean getEditable () {
- checkWidget ();
- return text.getEditable();
-}
-/**
- * Returns the item at the given, zero-relative index in the
- * receiver's list. Throws an exception if the index is out
- * of range.
- *
- * @param index the index of the item to return
- * @return the item at the given index
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getItem (int index) {
- checkWidget();
- return list.getItem (index);
-}
-/**
- * Returns the number of items contained in the receiver's list.
- *
- * @return the number of items
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemCount () {
- checkWidget ();
- return list.getItemCount ();
-}
-/**
- * Returns the height of the area which would be used to
- * display <em>one</em> of the items in the receiver's list.
- *
- * @return the height of one item
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemHeight () {
- checkWidget ();
- return list.getItemHeight ();
-}
-/**
- * Returns an array of <code>String</code>s which are the items
- * in the receiver's list.
- * <p>
- * Note: This is not the actual structure used by the receiver
- * to maintain its list of items, so modifying the array will
- * not affect the receiver.
- * </p>
- *
- * @return the items in the receiver's list
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String [] getItems () {
- checkWidget ();
- return list.getItems ();
-}
-public Menu getMenu() {
- return text.getMenu();
-}
-/**
- * Returns a <code>Point</code> whose x coordinate is the start
- * of the selection in the receiver's text field, and whose y
- * coordinate is the end of the selection. The returned values
- * are zero-relative. An "empty" selection as indicated by
- * the the x and y coordinates having the same value.
- *
- * @return a point representing the selection start and end
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public Point getSelection () {
- checkWidget ();
- return text.getSelection ();
-}
-/**
- * Returns the zero-relative index of the item which is currently
- * selected in the receiver's list, or -1 if no item is selected.
- *
- * @return the index of the selected item
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getSelectionIndex () {
- checkWidget ();
- return list.getSelectionIndex ();
-}
-public int getStyle () {
- int style = super.getStyle ();
- style &= ~SWT.READ_ONLY;
- if (!text.getEditable()) style |= SWT.READ_ONLY;
- return style;
-}
-/**
- * Returns a string containing a copy of the contents of the
- * receiver's text field.
- *
- * @return the receiver's text
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getText () {
- checkWidget ();
- return text.getText ();
-}
-/**
- * Returns the height of the receivers's text field.
- *
- * @return the text height
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextHeight () {
- checkWidget ();
- return text.getLineHeight ();
-}
-/**
- * Returns the maximum number of characters that the receiver's
- * text field is capable of holding. If this has not been changed
- * by <code>setTextLimit()</code>, it will be the constant
- * <code>Combo.LIMIT</code>.
- *
- * @return the text limit
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextLimit () {
- checkWidget ();
- return text.getTextLimit ();
-}
-/**
- * Gets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @return the number of items that are visible
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public int getVisibleItemCount () {
- checkWidget ();
- return visibleItemCount;
-}
-void handleFocus (int type) {
- if (isDisposed ()) return;
- switch (type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
- if (getEditable ()) text.selectAll ();
- hasFocus = true;
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- shell.addListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- display.addFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- if (!hasFocus) return;
- Control focusControl = getDisplay ().getFocusControl ();
- if (focusControl == arrow || focusControl == list || focusControl == text) return;
- hasFocus = false;
- Shell shell = getShell ();
- shell.removeListener(SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusOut, e);
- break;
- }
- }
-}
-/**
- * Searches the receiver's list starting at the first item
- * (index 0) until an item is found that is equal to the
- * argument, and returns the index of that item. If no item
- * is found, returns -1.
- *
- * @param string the search item
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string);
-}
-/**
- * Searches the receiver's list starting at the given,
- * zero-relative index until an item is found that is equal
- * to the argument, and returns the index of that item. If
- * no item is found or the starting index is out of range,
- * returns -1.
- *
- * @param string the search item
- * @param start the zero-relative index at which to begin the search
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string, int start) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string, start);
-}
-
-void initAccessible() {
- AccessibleAdapter accessibleAdapter = new AccessibleAdapter () {
- public void getName (AccessibleEvent e) {
- String name = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- name = stripMnemonic (label.getText());
- }
- e.result = name;
- }
- public void getKeyboardShortcut(AccessibleEvent e) {
- String shortcut = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- String text = label.getText ();
- if (text != null) {
- char mnemonic = _findMnemonic (text);
- if (mnemonic != '\0') {
- shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
- }
- }
- }
- e.result = shortcut;
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- };
- getAccessible ().addAccessibleListener (accessibleAdapter);
- text.getAccessible ().addAccessibleListener (accessibleAdapter);
- list.getAccessible ().addAccessibleListener (accessibleAdapter);
-
- arrow.getAccessible ().addAccessibleListener (new AccessibleAdapter() {
- public void getName (AccessibleEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void getKeyboardShortcut (AccessibleEvent e) {
- e.result = "Alt+Down Arrow"; //$NON-NLS-1$
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- });
-
- getAccessible().addAccessibleTextListener (new AccessibleTextAdapter() {
- public void getCaretOffset (AccessibleTextEvent e) {
- e.offset = text.getCaretPosition ();
- }
- public void getSelectionRange(AccessibleTextEvent e) {
- Point sel = text.getSelection();
- e.offset = sel.x;
- e.length = sel.y - sel.x;
- }
- });
-
- getAccessible().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getChildAtPoint (AccessibleControlEvent e) {
- Point testPoint = toControl (e.x, e.y);
- if (getBounds ().contains (testPoint)) {
- e.childID = ACC.CHILDID_SELF;
- }
- }
-
- public void getLocation (AccessibleControlEvent e) {
- Rectangle location = getBounds ();
- Point pt = toDisplay (location.x, location.y);
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount (AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole (AccessibleControlEvent e) {
- e.detail = ACC.ROLE_COMBOBOX;
- }
-
- public void getState (AccessibleControlEvent e) {
- e.detail = ACC.STATE_NORMAL;
- }
-
- public void getValue (AccessibleControlEvent e) {
- e.result = getText ();
- }
- });
-
- text.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter () {
- public void getRole (AccessibleControlEvent e) {
- e.detail = text.getEditable () ? ACC.ROLE_TEXT : ACC.ROLE_LABEL;
- }
- });
-
- arrow.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getDefaultAction (AccessibleControlEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
-}
-boolean isDropped () {
- return popup.getVisible ();
-}
-public boolean isFocusControl () {
- checkWidget();
- if (text.isFocusControl () || arrow.isFocusControl () || list.isFocusControl () || popup.isFocusControl ()) {
- return true;
- }
- return super.isFocusControl ();
-}
-void internalLayout (boolean changed) {
- if (isDropped ()) dropDown (false);
- Rectangle rect = getClientArea ();
- int width = rect.width;
- int height = rect.height;
- // Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
- // text.setBounds (0, 0, width - arrowSize.x, height);
- text.setBounds (0, 0, width - 16, height);
- // arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
- arrow.setBounds (width - 16, 0, 16, 16);
-}
-void listEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (getShell () != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
- break;
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- dropDown (false);
- break;
- }
- case SWT.Selection: {
- int index = list.getSelectionIndex ();
- if (index == -1) return;
- text.setText (list.getItem (index));
- text.selectAll ();
- list.setSelection (index);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- e.doit = event.doit;
- notifyListeners (SWT.Selection, e);
- event.doit = e.doit;
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ESCAPE:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- event.doit = false;
- break;
- }
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyUp, e);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.ESC) {
- // Escape key cancels popup list
- dropDown (false);
- }
- if ((event.stateMask & SWT.ALT) != 0 && (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN)) {
- dropDown (false);
- }
- if (event.character == SWT.CR) {
- // Enter causes default selection
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- // At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyDown, e);
- break;
-
- }
- }
-}
-
-void popupEvent(Event event) {
- switch (event.type) {
- case SWT.Paint:
- // draw black rectangle around list
- Rectangle listRect = list.getBounds();
- Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
- event.gc.setForeground(black);
- event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
- break;
- case SWT.Close:
- event.doit = false;
- dropDown (false);
- break;
- case SWT.Deactivate:
- dropDown (false);
- break;
- }
-}
-public void redraw () {
- super.redraw();
- text.redraw();
- arrow.redraw();
- if (popup.isVisible()) list.redraw();
-}
-public void redraw (int x, int y, int width, int height, boolean all) {
- super.redraw(x, y, width, height, true);
-}
-
-/**
- * Removes the item from the receiver's list at the given
- * zero-relative index.
- *
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int index) {
- checkWidget();
- list.remove (index);
-}
-/**
- * Removes the items from the receiver's list which are
- * between the given zero-relative start and end
- * indices (inclusive).
- *
- * @param start the start of the range
- * @param end the end of the range
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int start, int end) {
- checkWidget();
- list.remove (start, end);
-}
-/**
- * Searches the receiver's list starting at the first item
- * until an item is found that is equal to the argument,
- * and removes that item from the list.
- *
- * @param string the item to remove
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.remove (string);
-}
-/**
- * Removes all of the items from the receiver's list and clear the
- * contents of receiver's text field.
- * <p>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void removeAll () {
- checkWidget();
- text.setText (""); //$NON-NLS-1$
- list.removeAll ();
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's text is modified.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #addModifyListener
- */
-public void removeModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Modify, listener);
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection changes.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #addSelectionListener
- */
-public void removeSelectionListener (SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection,listener);
-}
-/**
- * Selects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already selected, it remains
- * selected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to select
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void select (int index) {
- checkWidget();
- if (index == -1) {
- list.deselectAll ();
- text.setText (""); //$NON-NLS-1$
- return;
- }
- if (0 <= index && index < list.getItemCount()) {
- if (index != getSelectionIndex()) {
- text.setText (list.getItem (index));
- text.selectAll ();
- list.select (index);
- list.showSelection ();
- }
- }
-}
-public void setBackground (Color color) {
- super.setBackground(color);
- background = color;
- if (text != null) text.setBackground(color);
- if (list != null) list.setBackground(color);
- if (arrow != null) arrow.setBackground(color);
-}
-/**
- * Sets the editable state.
- *
- * @param editable the new editable state
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setEditable (boolean editable) {
- checkWidget ();
- text.setEditable(editable);
-}
-public void setEnabled (boolean enabled) {
- super.setEnabled(enabled);
- if (popup != null) popup.setVisible (false);
- if (text != null) text.setEnabled(enabled);
- if (arrow != null) arrow.setEnabled(enabled);
-}
-public boolean setFocus () {
- checkWidget();
- return text.setFocus ();
-}
-public void setFont (Font font) {
- super.setFont (font);
- this.font = font;
- text.setFont (font);
- list.setFont (font);
- internalLayout (true);
-}
-public void setForeground (Color color) {
- super.setForeground(color);
- foreground = color;
- if (text != null) text.setForeground(color);
- if (list != null) list.setForeground(color);
- if (arrow != null) arrow.setForeground(color);
-}
-/**
- * Sets the text of the item in the receiver's list at the given
- * zero-relative index to the string argument. This is equivalent
- * to <code>remove</code>'ing the old item at the index, and then
- * <code>add</code>'ing the new item at that index.
- *
- * @param index the index for the item
- * @param string the new text for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItem (int index, String string) {
- checkWidget();
- list.setItem (index, string);
-}
-/**
- * Sets the receiver's list to be the given array of items.
- *
- * @param items the array of items
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItems (String [] items) {
- checkWidget ();
- list.setItems (items);
- if (!text.getEditable ()) text.setText (""); //$NON-NLS-1$
-}
-/**
- * Sets the layout which is associated with the receiver to be
- * the argument which may be null.
- * <p>
- * Note: No Layout can be set on this Control because it already
- * manages the size and position of its children.
- * </p>
- *
- * @param layout the receiver's new layout or null
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setLayout (Layout layout) {
- checkWidget ();
- return;
-}
-public void setMenu(Menu menu) {
- text.setMenu(menu);
-}
-/**
- * Sets the selection in the receiver's text field to the
- * range specified by the argument whose x coordinate is the
- * start of the selection and whose y coordinate is the end
- * of the selection.
- *
- * @param selection a point representing the new selection start and end
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setSelection (Point selection) {
- checkWidget();
- if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- text.setSelection (selection.x, selection.y);
-}
-
-/**
- * Sets the contents of the receiver's text field to the
- * given string.
- * <p>
- * Note: The text field in a <code>Combo</code> is typically
- * only capable of displaying a single line of text. Thus,
- * setting the text to a string containing line breaks or
- * other special characters will probably cause it to
- * display incorrectly.
- * </p>
- *
- * @param string the new text
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setText (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- int index = list.indexOf (string);
- if (index == -1) {
- list.deselectAll ();
- text.setText (string);
- return;
- }
- text.setText (string);
- text.selectAll ();
- list.setSelection (index);
- list.showSelection ();
-}
-/**
- * Sets the maximum number of characters that the receiver's
- * text field is capable of holding to be the argument.
- *
- * @param limit new text limit
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
- * </ul>
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setTextLimit (int limit) {
- checkWidget();
- text.setTextLimit (limit);
-}
-
-public void setToolTipText (String string) {
- checkWidget();
- super.setToolTipText(string);
- arrow.setToolTipText (string);
- text.setToolTipText (string);
-}
-
-public void setVisible (boolean visible) {
- super.setVisible(visible);
- if (!visible) popup.setVisible(false);
-}
-/**
- * Sets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @param count the new number of items to be visible
- *
- * @exception org.eclipse.swt.SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setVisibleItemCount (int count) {
- checkWidget ();
- if (count < 0) return;
- visibleItemCount = count;
-}
-String stripMnemonic (String string) {
- int index = 0;
- int length = string.length ();
- do {
- while ((index < length) && (string.charAt (index) != '&')) index++;
- if (++index >= length) return string;
- if (string.charAt (index) != '&') {
- return string.substring(0, index-1) + string.substring(index, length);
- }
- index++;
- } while (index < length);
- return string;
-}
-void textEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.CR) {
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
-
- if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
- event.doit = false;
- if ((event.stateMask & SWT.ALT) != 0) {
- boolean dropped = isDropped ();
- text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
-
- int oldIndex = getSelectionIndex ();
- if (event.keyCode == SWT.ARROW_UP) {
- select (Math.max (oldIndex - 1, 0));
- } else {
- select (Math.min (oldIndex + 1, getItemCount () - 1));
- }
- if (oldIndex != getSelectionIndex ()) {
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.Selection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- }
-
- // Further work : Need to add support for incremental search in
- // pop up list as characters typed in text widget
-
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyDown, e);
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyUp, e);
- break;
- }
- case SWT.MenuDetect: {
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.MenuDetect, e);
- break;
- }
- case SWT.Modify: {
- list.deselectAll ();
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.Modify, e);
- break;
- }
- case SWT.MouseDown: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- boolean dropped = isDropped ();
- text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- text.selectAll ();
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- // The enter causes default selection and
- // the arrow keys are used to manipulate the list contents so
- // do not use them for traversal.
- event.doit = false;
- break;
- }
-
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- }
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java
deleted file mode 100644
index 226d4357d8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.adt.design;
-
-public interface IAnnotationProvider
-{
- String getNameAnnotationString();
- String getNameAnnotationToolTipString();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IKeyboardDrag.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IKeyboardDrag.java
deleted file mode 100644
index fe069207d2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IKeyboardDrag.java
+++ /dev/null
@@ -1,19 +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.xsd.ui.internal.adt.design;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-public interface IKeyboardDrag {
-
- public void performKeyboardDrag (GraphicalEditPart source, int direction);
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ImageOverlayDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ImageOverlayDescriptor.java
deleted file mode 100644
index 0f2a674073..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ImageOverlayDescriptor.java
+++ /dev/null
@@ -1,60 +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.wst.xsd.ui.internal.adt.design;
-
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class ImageOverlayDescriptor extends CompositeImageDescriptor
-{
- protected Image baseImage;
- protected Image extensionOverlay, disabledExtensionOverlay;
- protected Point imageSize;
- protected boolean isReadOnly;
-
- public ImageOverlayDescriptor(Image baseImage, boolean isReadOnly)
- {
- super();
- this.baseImage = baseImage;
- this.isReadOnly = isReadOnly;
- imageSize = new Point(baseImage.getBounds().width, baseImage.getBounds().height);
- extensionOverlay = XSDEditorPlugin.getPlugin().getIcon("ovr16/extnsn_ovr.gif"); //$NON-NLS-1$
- disabledExtensionOverlay = XSDEditorPlugin.getPlugin().getIcon("ovr16/extnsndis_ovr.gif"); //$NON-NLS-1$
- }
-
- public Image getImage()
- {
- return createImage();
- }
-
- protected void drawCompositeImage(int width, int height)
- {
- drawImage(baseImage.getImageData(), 0, 0);
- ImageData extensionImageData;
- if (isReadOnly)
- {
- extensionImageData = disabledExtensionOverlay.getImageData();
- }
- else
- {
- extensionImageData = extensionOverlay.getImageData();
- }
- drawImage (extensionImageData, imageSize.x - extensionImageData.width, 0); // Top Right corner
- }
-
- protected Point getSize()
- {
- return imageSize;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
deleted file mode 100644
index 717c7aec22..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.design.directedit;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TypedListener;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-
-/*
- * This wraps the ComboBoxCellEditor.
- * We need to apply and deactivate the combo on a single click (not on a double click like
- * the ComboBoxCellEditor).
- */
-public class ADTComboBoxCellEditor extends ComboBoxCellEditor
-{
- private static final int adtDefaultStyle = SWT.NONE;
-
- /**
- * Used to determine if the value should be applied to the cell.
- */
- private boolean continueApply;
- private boolean isTraversing = false;
- private Object selectedValue;
- private ComponentReferenceEditManager componentReferenceEditManager;
-
- // This prevents the cell editor from being deactivated while handling the New or Browse selection.
- private boolean isHandlingSelection = false;
-
- /**
- * Creates a new cell editor with a combo containing the given list of choices
- * and parented under the given control. The cell editor value is the
- * zero-based index of the selected item. Initially, the cell editor has no
- * cell validator and the first item in the list is selected.
- *
- * @param parent
- * the parent control
- * @param items
- * the list of strings for the combo box
- */
- public ADTComboBoxCellEditor(Composite parent, String[] items, ComponentReferenceEditManager editManager)
- {
- super(parent, items, adtDefaultStyle | SWT.READ_ONLY);
- setItems(items);
- componentReferenceEditManager = editManager;
- }
-
- private void removeListeners(CCombo comboBox, int event)
- {
- Listener [] listeners = comboBox.getListeners(event);
- int length = listeners.length;
- for (int i = 0; i < length; i++)
- {
- Listener l = listeners[i];
- if (l instanceof TypedListener)
- {
- TypedListener typedListener = (TypedListener)l;
- String className = typedListener.getEventListener().getClass().getCanonicalName();
- // It's possible that there are other typed listeners added to the CCombo.
- // Currently there are none, but as an extra check, I want to ensure
- // I'm removing the ones added from the inherited class.
- // I've tested this and I know it removes the following:
- // org.eclipse.jface.viewers.ComboBoxCellEditor$2
- // org.eclipse.jface.viewers.ComboBoxCellEditor$4
- // which are indeed the ones I'm customizing
- if (className != null && className.contains("org.eclipse.jface.viewers.ComboBoxCellEditor"))
- {
- comboBox.removeListener(event, l);
- }
- }
- }
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected Control createControl(Composite parent)
- {
- CCombo comboBox = (CCombo)super.createControl(parent);
-
- comboBox.setFont(parent.getFont());
-
- // Need to remove the listeners added from ComboBoxCellEditor
- removeListeners(comboBox, SWT.Selection);
- removeListeners(comboBox, SWT.DefaultSelection);
- removeListeners(comboBox, SWT.FocusIn);
- removeListeners(comboBox, SWT.FocusOut);
-
- // Now add our custom listeners
- comboBox.addSelectionListener(new SelectionAdapter()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- // Want the same behaviour since hitting return on Browse or New should launch the dialogs,
- // and not immediately apply the value
-// applyEditorValueAndDeactivate();
- widgetSelected(event);
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- continueApply = true;
- CCombo comboBox = getCCombo();
- isHandlingSelection = true;
- Object newValue = null;
-
- try
- {
- int selection = comboBox.getSelectionIndex();
- if (isTraversing)
- {
- isTraversing = false;
- return;
- }
-
- String[] items = getItems();
- String stringSelection = items[selection];
-
- if (stringSelection.equals(Messages._UI_COMBO_BROWSE))
- {
- continueApply = true;
- newValue = invokeDialog(componentReferenceEditManager.getBrowseDialog());
- }
- else if (stringSelection.equals(Messages._UI_COMBO_NEW))
- {
- continueApply = true;
- newValue = invokeDialog(componentReferenceEditManager.getNewDialog());
- }
- }
- finally
- {
- isHandlingSelection = false;
- }
-
- if (continueApply)
- {
- if (newValue == null)
- {
- int index = comboBox.getSelectionIndex();
- if (index != -1)
- {
- selectedValue = comboBox.getItem(index);
- }
- }
- else
- {
- selectedValue = newValue;
- }
-
- applyEditorValueAndDeactivate();
- focusLost();
- }
- }
- });
-
- comboBox.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_ARROW_PREVIOUS)
- {
- isTraversing = true;
- }
- }
- });
-
- comboBox.addFocusListener(new FocusAdapter()
- {
- public void focusLost(FocusEvent e)
- {
- if (!isHandlingSelection)
- ADTComboBoxCellEditor.this.focusLost();
- }
- });
- return comboBox;
- }
-
- private Object invokeDialog(IComponentDialog dialog)
- {
- Object newValue = null;
-
- if (dialog == null)
- {
- return null;
- }
-
- //dialog.setInitialComponent(setObject);
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- }
- else
- {
- continueApply = false;
- focusLost();
- }
-
- return newValue;
- }
-
- public Object getSelectedValue()
- {
- return selectedValue;
- }
-
- protected CCombo getCCombo()
- {
- return (CCombo)getControl();
- }
-
-///////// ComboBox cell editor
-
- void applyEditorValueAndDeactivate()
- {
- // must set the selection before getting value
- CCombo comboBox = getCCombo();
- String[] items = getItems();
-
- int selection = comboBox.getSelectionIndex();
- Object newValue = doGetValue();
- markDirty();
- boolean isValid = isCorrect(newValue);
- setValueValid(isValid);
-
- if (!isValid)
- {
- // Only format if the 'index' is valid
- if (items.length > 0 && selection >= 0 && selection < items.length)
- {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] { items[selection] }));
- }
- else
- {
- // Since we don't have a valid index, assume we're using an
- // 'edit'
- // combo so format using its text value
- setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] { comboBox.getText() }));
- }
- }
-
- fireApplyEditorValue();
- deactivate();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/AttributeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/AttributeReferenceDirectEditManager.java
deleted file mode 100644
index 2b5e2722b3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/AttributeReferenceDirectEditManager.java
+++ /dev/null
@@ -1,38 +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.wst.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDAttributeReferenceEditManager;
-
-public class AttributeReferenceDirectEditManager extends ReferenceDirectEditManager
-{
- public AttributeReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(parameter, source, label);
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDAttributeReferenceEditManager.class);
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java
deleted file mode 100644
index c840f2199e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java
+++ /dev/null
@@ -1,224 +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.xsd.ui.internal.adt.design.directedit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class ComboBoxCellEditorManager extends DirectEditManager// implements
- // DirectEditPolicyDelegate
-{
- protected Label label;
-
- public ComboBoxCellEditorManager(GraphicalEditPart source, Label label)
- {
- super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
- this.label = label;
- }
-
- protected void initCellEditor()
- {
- String initialLabelText = label.getText();
-
- CCombo combo = (CCombo) getCellEditor().getControl();
- combo.setFont(label.getFont());
- combo.setForeground(label.getForegroundColor());
- combo.setBackground(label.getBackgroundColor());
- combo.setVisibleItemCount(20);
-
- /*
- * combo.addKeyListener(new KeyAdapter() { // hook key pressed - see PR
- * 14201 public void keyPressed(KeyEvent keyEvent) { if (keyEvent.character ==
- * 'z') { getCellEditor().applyEditorValue(); } } });
- */
- ICellEditorListener cellEditorListener = new ICellEditorListener()
- {
- public void cancelEditor()
- {
- }
-
- public void applyEditorValue()
- {
- }
-
- public void editorValueChanged(boolean old, boolean newState)
- {
- }
- };
- getCellEditor().addListener(cellEditorListener);
-
- String[] item = combo.getItems();
- for (int i = 0; i < item.length; i++)
- {
- if (item[i].equals(initialLabelText))
- {
- getCellEditor().setValue(new Integer(i));
- break;
- }
- }
- }
-
- // hack... for some reason the ComboBoxCellEditor does't fire an
- // editorValueChanged to set the dirty flag
- // unless we overide this method to return true, the manager is not notified
- // of changes made in the cell editor
- protected boolean isDirty()
- {
- return true;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- boolean isLabelTextInList = false;
- List list = computeComboContent();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- String string = (String) i.next();
- if (string.equals(label.getText()))
- {
- isLabelTextInList = true;
- break;
- }
- }
-
- if (!isLabelTextInList)
- {
- list.add(label.getText());
- }
-
- List sortedList = computeSortedList(list);
- String[] stringArray = new String[sortedList.size()];
- for (int i = 0; i < stringArray.length; i++)
- {
- stringArray[i] = (String) sortedList.get(i);
- }
- return createCellEditor(composite, stringArray);
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- return new ComboBoxCellEditor(composite, stringArray);
- }
-
- protected List computeSortedList(List list)
- {
- return list;
- }
-
- protected abstract List computeComboContent();
-
- protected abstract void performModify(Object value);
-
- public static class InternalCellEditorLocator implements CellEditorLocator
- {
- protected Label label;
-
- public InternalCellEditorLocator(Label label)
- {
- this.label = label;
- }
-
- public void relocate(CellEditor celleditor)
- {
- CCombo combo = (CCombo) celleditor.getControl();
-
- // TODO: We're pulling a fast one here..... This is assuming we're using a
- // CCombo as our widget
- // Our eventual 'Combo' may not even use CCombo so this will most likely
- // get replaced.
- // int dropDownButtonSizeX = 16;
-
- Rectangle labelParentBounds = label.getBounds().getCopy();
- label.translateToAbsolute(labelParentBounds);
-
- int x = labelParentBounds.x;
- int y = labelParentBounds.y;
- int widthK = labelParentBounds.width;
- int height = labelParentBounds.height;
- combo.setBounds(x, y + 1, widthK, height - 2);
- }
- }
-
- // implements DirectEditPolicyDelegate
- //
- public void performEdit(CellEditor cellEditor)
- {
- ADTComboBoxCellEditor comboCellEditor = (ADTComboBoxCellEditor) cellEditor;
- CCombo combo = (CCombo) getCellEditor().getControl();
- int index = combo.getSelectionIndex();
- if (index != -1)
- {
- Object value = combo.getItem(index);
- if (comboCellEditor.getSelectedValue() != null)
- {
- value = comboCellEditor.getSelectedValue();
- }
-
- performModify(value);
- }
- else
- {
- String typedValue = combo.getText();
- if (combo.indexOf(typedValue) != -1)
- {
- performModify(typedValue);
- }
- else
- {
- String closeMatch = getCloseMatch(typedValue, combo.getItems());
- if (closeMatch != null)
- {
- performModify(closeMatch);
- }
- else
- {
- Display.getCurrent().beep();
- }
- }
- }
- }
-
- protected String getCloseMatch(String value, String[] items)
- {
- int matchIndex = -1;
-
- for (int i = 0; i < items.length; i++)
- {
- String item = items[i];
- String a = getLocalName(value);
- String b = getLocalName(item);
- if (a.equalsIgnoreCase(b))
- {
- matchIndex = i;
- break;
- }
- }
- return matchIndex != -1 ? items[matchIndex] : null;
- }
-
- protected String getLocalName(String string)
- {
- int index = string.indexOf(":"); //$NON-NLS-1$
- return (index != -1) ? string.substring(index + 1) : string;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java
deleted file mode 100644
index 54117a2b10..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-
-public class ElementReferenceDirectEditManager extends ReferenceDirectEditManager
-{
- public ElementReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(parameter, source, label);
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java
deleted file mode 100644
index 0b34f8e404..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java
+++ /dev/null
@@ -1,90 +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.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-
-public class LabelCellEditorLocator implements CellEditorLocator
-{
- protected INamedEditPart namedEditPart;
- protected Point cursorLocation;
-
- public LabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation)
- {
- this.namedEditPart = namedEditPart;
- this.cursorLocation = cursorLocation;
- }
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text) celleditor.getControl();
-
- Label label = namedEditPart.getNameLabelFigure();
- if (text.getBounds().x <= 0)
- {
- int widthToRemove = 0;
- // HACK
- if (namedEditPart instanceof BaseFieldEditPart)
- {
- BaseFieldEditPart field = (BaseFieldEditPart)namedEditPart;
- IFieldFigure fieldFigure = field.getFieldFigure();
- widthToRemove = fieldFigure.getTypeLabel().getBounds().width;
- //TODO: !! perhaps the IFieldFigure should just have a method to compute this?
- //Label typeAnnotationLabel = ((FieldFigure) field.getFigure()).getTypeAnnotationLabel();
- //Label nameAnnotationLabel = ((FieldFigure) field.getFigure()).getNameAnnotationLabel();
- //widthToRemove = typeLabel.getBounds().width + typeAnnotationLabel.getBounds().width + nameAnnotationLabel.getBounds().width;
- }
-
- Rectangle boundingRect = label.getTextBounds();
-
- // Reduce the width by the amount we shifted along the x-axis
- int delta = Math.abs(boundingRect.x - label.getParent().getBounds().x);
-
- label.getParent().translateToAbsolute(boundingRect);
- org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
- boundingRect.translate(trim.x, trim.y);
- boundingRect.height = boundingRect.height - trim.y;
-
- boundingRect.width = label.getParent().getBounds().width - delta - widthToRemove;
- text.setBounds(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
-
- // Translate point
- if (cursorLocation != null) {
- Point translatedPoint = new Point(cursorLocation.x - boundingRect.x, cursorLocation.y - boundingRect.y);
-
- // Calculate text offset corresponding to the translated point
- text.setSelection(0, 0);
- int xCaret = text.getCaretLocation().x;
- int offset = text.getCaretPosition();
- while (xCaret < translatedPoint.x)
- {
- text.setSelection(offset + 1, offset + 1);
- xCaret = text.getCaretLocation().x;
- int newOffset = text.getCaretPosition();
- if (newOffset == offset)
- {
- break;
- }
- offset++;
- }
- text.setSelection(offset, offset);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
deleted file mode 100644
index 884341acae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-
-public class LabelEditManager extends DirectEditManager {
-
- private IActionBars actionBars;
- private CellEditorActionHandler actionHandler;
- private IAction copy, cut, paste, undo, redo, find, selectAll, delete;
- private Font scaledFont;
-
- public LabelEditManager(GraphicalEditPart source, CellEditorLocator locator) {
- super(source, null, locator);
- }
-
- /**
- * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
- */
- protected void bringDown() {
- if (actionHandler != null) {
- actionHandler.dispose();
- actionHandler = null;
- }
- if (actionBars != null) {
- restoreSavedActions(actionBars);
- actionBars.updateActionBars();
- actionBars = null;
- }
-
- Font disposeFont = scaledFont;
- scaledFont = null;
- super.bringDown();
- if (disposeFont != null)
- disposeFont.dispose();
- }
-
- public void showFeedback() {
-// super.showFeedback();
- getEditPart().showSourceFeedback(getDirectEditRequest());
- }
-
- protected CellEditor createCellEditorOn(Composite composite) {
- return new TextCellEditor(composite, SWT.SINGLE | SWT.WRAP);
- }
-
- protected void initCellEditor() {
- Text text = (Text)getCellEditor().getControl();
- Label label = ((INamedEditPart) getEditPart()).getNameLabelFigure();
-
- if (label != null) {
- scaledFont = label.getFont();
-
- Color color = label.getBackgroundColor();
- text.setBackground(color);
-
- String initialLabelText = label.getText();
- getCellEditor().setValue(initialLabelText);
- }
- else {
- scaledFont = label.getParent().getFont();
- text.setBackground(label.getParent().getBackgroundColor());
- }
-
- FontData data = scaledFont.getFontData()[0];
- Dimension fontSize = new Dimension(0, data.getHeight());
- label.getParent().translateToAbsolute(fontSize);
- data.setHeight(fontSize.height);
- scaledFont = new Font(null, data);
-
- text.setFont(scaledFont);
-// text.selectAll();
-
- // Hook the cell editor's copy/paste actions to the actionBars so that they can
- // be invoked via keyboard shortcuts.
- actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .getActiveEditor().getEditorSite().getActionBars();
- saveCurrentActions(actionBars);
- actionHandler = new CellEditorActionHandler(actionBars);
- actionHandler.addCellEditor(getCellEditor());
- actionBars.updateActionBars();
- }
-
- private void restoreSavedActions(IActionBars actionBars){
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
- // Delete action (key) doesn't always work. The saved action could be the
- // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
- // We'll only restore the delete action if it is indeed the one for the Design view.
- // We should update the other actions too, but currently, none are applicable.
- if (delete instanceof BaseSelectionAction)
- {
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
- }
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
- actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
- }
-
- private void saveCurrentActions(IActionBars actionBars) {
- copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
- paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
- IAction currentDeleteAction = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
- // Delete action (key) doesn't always work. The saved action could be the
- // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
- // We'll only restore the delete action if it is indeed the one for the Design view.
- // We should update the other actions too, but currently, none are applicable.
- if (currentDeleteAction instanceof BaseSelectionAction)
- {
- delete = currentDeleteAction;
- }
- selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
- cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
- find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
- undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
- redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java
deleted file mode 100644
index 7ced90db3c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.wst.xsd.ui.internal.adt.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-
-public abstract class ReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
- protected AbstractGraphicalEditPart editPart;
- protected IField setObject;
-
- public ReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(source, label);
- editPart = source;
- setObject = parameter;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- return super.createCellEditorOn(composite);
- }
-
- protected List computeComboContent()
- {
- List list = new ArrayList();
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- list.add(Messages._UI_COMBO_BROWSE);
- list.add(Messages._UI_COMBO_NEW);
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- list.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- list.add(componentSpecification.getName());
- }
- }
- }
- return list;
- }
-
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- public void performModify(Object value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager == null)
- {
- return;
- }
-
- // our crude combo box can only work with 'String' objects
- // if we get a String back we need to do some clever mapping to get the ComponentSpecification
- //
- if (value instanceof String)
- {
- value = getComponentSpecificationForValue((String)value);
- }
- // we assume the selected value is always of the form of a ComponentSpecification
- //
- if (value instanceof ComponentSpecification)
- {
- // we need to perform an asyncExec here since the 'host' editpart may be
- // removed as a side effect of performing the action
- DelayedSetReferenceRunnable runnable = new DelayedSetReferenceRunnable(editManager, setObject, (ComponentSpecification)value);
- //runnable.run();
- Display.getCurrent().asyncExec(runnable);
- }
- }
-
- protected List computeSortedList(List list)
- {
- // return TypesHelper.sortList(list);
- return list;
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- ADTComboBoxCellEditor cellEditor = new ADTComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
- //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
- return cellEditor;
- }
-
- protected abstract ComponentReferenceEditManager getComponentReferenceEditManager();
-
- protected IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart;
- }
-
- protected class DelayedSetReferenceRunnable implements Runnable
- {
- protected ComponentReferenceEditManager componentReferenceEditManager;
- protected ComponentSpecification newValue;
- protected IField field;
-
- public DelayedSetReferenceRunnable(ComponentReferenceEditManager componentReferenceEditManager,
- IField setObject, ComponentSpecification selectedValue)
- {
- this.componentReferenceEditManager = componentReferenceEditManager;
- newValue = selectedValue;
- field = setObject;
- }
-
- public void run()
- {
- componentReferenceEditManager.modifyComponentReference(field, newValue);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java
deleted file mode 100644
index dbebae1ddb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager2;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-
-public class TypeReferenceDirectEditManager extends ReferenceDirectEditManager //ComboBoxCellEditorManager
-{
- public TypeReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(parameter, source, label);
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- if (result instanceof ComponentReferenceEditManager2)
- {
- ComponentReferenceEditManager2 manager = (ComponentReferenceEditManager2)result;
- manager.setReferencer(setObject);
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java
deleted file mode 100644
index 26426048ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.wst.xsd.ui.internal.adt.design.ADTFloatingToolbar.ADTFloatingToolbarModel;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class ADTEditPartFactory implements EditPartFactory
-{
- public EditPart createEditPart(EditPart context, Object model)
- {
- EditPart child = doCreateEditPart(context, model);
- checkChild(child, model);
- return child;
- }
-
- protected EditPart doCreateEditPart(EditPart context, Object model)
- {
- EditPart child = null;
- if (model instanceof Compartment)
- {
- child = new CompartmentEditPart();
- }
- else if (model instanceof RootHolder)
- {
- child = new RootHolderEditPart();
- }
- else if (model instanceof ADTFloatingToolbarModel)
- {
- child = new ADTFloatingToolbarEditPart(((ADTFloatingToolbarModel)model).getModel());
- }
- else if (model instanceof AbstractModelCollection)
- {
- child = new ColumnEditPart();
- if (model instanceof FocusTypeColumn)
- {
- ColumnEditPart columnEditPart = (ColumnEditPart)child;
- columnEditPart.setSpacing(60);
- columnEditPart.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- }
- }
- else if (model instanceof IComplexType)
- {
- child = new ComplexTypeEditPart();
- }
- else if (model instanceof IStructure)
- {
- child = new StructureEditPart();
- }
- else if (model instanceof IField)
- {
- if (context instanceof CompartmentEditPart)
- {
- child = new FieldEditPart();
- }
- else
- {
- child = new TopLevelFieldEditPart();
- }
- }
- else if (model instanceof IModel)
- {
- child = new RootContentEditPart();
- }
- return child;
- }
-
- /**
- * Subclasses can override and not check for null
- *
- * @param child
- * @param model
- */
- protected void checkChild(EditPart child, Object model)
- {
- if (child == null)
- {
- // Thread.dumpStack();
- }
- Assert.isNotNull(child);
- child.setModel(model);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java
deleted file mode 100644
index 46b8be98cd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.awt.event.KeyEvent;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FocusEvent;
-import org.eclipse.draw2d.FocusListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.KeyListener;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.draw2d.MouseMotionListener;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class ADTFloatingToolbarEditPart extends BaseEditPart
-{
- protected IModel model;
- protected boolean isDrilledDown;
- protected ADTToolbarButton backToSchema;
-
- public ADTFloatingToolbarEditPart(IModel model)
- {
- this.model = model;
- }
-
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- ToolbarLayout tb = new ToolbarLayout(true);
- tb.setStretchMinorAxis(false);
- tb.setSpacing(3);
- figure.setLayoutManager(tb);
-
- backToSchema = new ADTToolbarButton(XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif"));
- backToSchema.setToolTipText(Messages._UI_HOVER_BACK_TO_SCHEMA);
- backToSchema.setBackgroundColor(ColorConstants.white);
- backToSchema.setFocusTraversable(true);
- figure.add(backToSchema);
- figure.setBounds(new Rectangle(0,0,24,24));
- addToToolbar(figure);
- return figure;
- }
-
- protected void addToToolbar(IFigure figure)
- {
-
- }
-
- public void setIsDrilledDown(boolean isDrilledDown)
- {
- this.isDrilledDown = isDrilledDown;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- backToSchema.isEnabled = isDrilledDown;
- if (isDrilledDown)
- {
- backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif");
- }
- else
- {
- backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("dlcl16/schemaview_co.gif");
- }
- backToSchema.refresh();
- }
-
- protected void doAction(MouseEvent me)
- {
- IEditorPart editorPart = getActionEditorPart();
-
- if (backToSchema.getBounds().contains(me.getLocation()))
- {
- SetInputToGraphView action = new SetInputToGraphView(editorPart, model);
- action.run();
- }
- }
-
- protected void doAction(org.eclipse.draw2d.KeyEvent ke)
- {
- IEditorPart editorPart = getActionEditorPart();
- SetInputToGraphView action = new SetInputToGraphView(editorPart, model);
- action.run();
- }
-
- private IEditorPart getActionEditorPart()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart;
- }
-
-
- protected class ADTToolbarButton extends CenteredIconFigure
- {
- protected MouseListener mouseListener;
- protected org.eclipse.draw2d.KeyListener keyListener;
- protected FocusListener focusListener;
- public boolean isEnabled;
-
- public ADTToolbarButton(Image img)
- {
- super();
- this.image = img;
-
- mouseListener = new MouseListener.Stub()
- {
- public void mousePressed(org.eclipse.draw2d.MouseEvent me)
- {
- if (isEnabled)
- {
- addFeedback();
- }
- }
-
- public void mouseReleased(org.eclipse.draw2d.MouseEvent me)
- {
- if (isEnabled)
- {
- removeFeedback();
- doAction(me);
- }
- }
- };
- addMouseListener(mouseListener);
- addMouseMotionListener(new MouseMotionListener.Stub()
- {
- public void mouseExited(MouseEvent me)
- {
- removeFeedback();
- }
- });
-
- keyListener = new KeyListener.Stub()
- {
- public void keyPressed(org.eclipse.draw2d.KeyEvent ke)
- {
- boolean isValidKey = (ke.keycode == KeyEvent.VK_SPACE);
- isValidKey = isValidKey || (ke.character == SWT.CR || ke.character == SWT.LF);
- if (isEnabled && isValidKey)
- {
- addFeedback();
- }
- }
-
- public void keyReleased(org.eclipse.draw2d.KeyEvent ke)
- {
- boolean isValidKey = (ke.keycode == KeyEvent.VK_SPACE);
- isValidKey = isValidKey || (ke.character == SWT.CR || ke.character == SWT.LF);
- if (isEnabled && isValidKey)
- {
- removeFeedback();
- doAction(ke);
- }
- }
- };
- addKeyListener(keyListener);
-
- focusListener = new FocusListener(){
-
- public void focusGained(FocusEvent fe) {
- setMode(CenteredIconFigure.HOVER);
- refresh();
- }
-
- public void focusLost(FocusEvent fe) {
- setMode(CenteredIconFigure.NORMAL);
- refresh();
- }
- };
-
- addFocusListener(focusListener);
- }
-
- public void addFeedback()
- {
- setMode(CenteredIconFigure.SELECTED);
- refresh();
- }
-
- public void removeFeedback()
- {
- setMode(CenteredIconFigure.NORMAL);
- refresh();
- }
-
- public Rectangle getBounds()
- {
- Rectangle r = super.getBounds();
- org.eclipse.swt.graphics.Rectangle rect = image.getBounds();
- return new Rectangle(r.x, r.y, rect.width + 8, rect.height + 8);
- }
-
- public Dimension getPreferredSize(int hint, int hint2)
- {
- org.eclipse.swt.graphics.Rectangle rect = image.getBounds();
- return new Dimension(rect.width + 8, rect.height + 8);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BackToSchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BackToSchemaEditPart.java
deleted file mode 100644
index f79ed6ce9a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BackToSchemaEditPart.java
+++ /dev/null
@@ -1,134 +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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class BackToSchemaEditPart extends BaseEditPart implements IFeedbackHandler
-{
- protected MultiPageEditorPart multipageEditor;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
- protected boolean isEnabled;
- protected CenteredIconFigure backToSchema;
- protected MouseListener mouseListener;
-
- public BackToSchemaEditPart(ADTMultiPageEditor multipageEditor)
- {
- super();
- this.multipageEditor = multipageEditor;
- }
-
- protected IFigure createFigure()
- {
- backToSchema = new CenteredIconFigure();
- backToSchema.setBackgroundColor(ColorConstants.white);
- backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif");
- // TODO, look at why the editpolicy doesn't work
- mouseListener = new MouseListener()
- {
- public void mouseDoubleClicked(org.eclipse.draw2d.MouseEvent me)
- {
-
- }
-
- public void mousePressed(org.eclipse.draw2d.MouseEvent me)
- {
- if (isEnabled)
- {
- addFeedback();
- }
- }
-
- public void mouseReleased(org.eclipse.draw2d.MouseEvent me)
- {
- if (isEnabled)
- {
- removeFeedback();
- SetInputToGraphView action = new SetInputToGraphView(multipageEditor, getModel());
- action.run();
- }
- }
- };
- backToSchema.addMouseListener(mouseListener);
- return backToSchema;
- }
-
-
- public void setEnabled(boolean isEnabled)
- {
- this.isEnabled = isEnabled;
- refreshVisuals();
- }
-
- protected void createEditPolicies()
- {
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT || request.getType() == RequestConstants.REQ_OPEN)
- {
- SetInputToGraphView action = new SetInputToGraphView(multipageEditor, getModel());
- action.run();
- }
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- CenteredIconFigure figure = (CenteredIconFigure) getFigure();
- if (isEnabled)
- {
- backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif");
- }
- else
- {
- backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("dlcl16/schemaview_co.gif");
- }
- figure.refresh();
- }
-
- public void addFeedback()
- {
- CenteredIconFigure figure = (CenteredIconFigure) getFigure();
- figure.setMode(CenteredIconFigure.SELECTED);
- figure.refresh();
- }
-
- public void removeFeedback()
- {
- CenteredIconFigure figure = (CenteredIconFigure) getFigure();
- figure.setMode(CenteredIconFigure.NORMAL);
- figure.refresh();
- }
-
- public void deactivate()
- {
- backToSchema.removeMouseListener(mouseListener);
- super.deactivate();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
deleted file mode 100644
index 357e63489f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.design.editparts;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.editparts.ZoomListener;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public abstract class BaseEditPart extends AbstractGraphicalEditPart implements IActionProvider, IADTObjectListener, IFeedbackHandler
-{
- protected static final String[] EMPTY_ACTION_ARRAY = {};
- protected boolean isSelected = false;
- protected boolean hasFocus = false;
- protected static boolean isHighContrast = Display.getDefault().getHighContrast();
- protected AccessibleEditPart accessiblePart;
-
- public IFigureFactory getFigureFactory()
- {
- EditPartFactory factory = getViewer().getEditPartFactory();
- Assert.isTrue(factory instanceof IFigureFactory, "EditPartFactory must be an instanceof of IFigureFactory"); //$NON-NLS-1$
- return (IFigureFactory)factory;
- }
-
- public String[] getActions(Object object)
- {
- Object model = getModel();
- if (model instanceof IActionProvider)
- {
- return ((IActionProvider)model).getActions(object);
- }
- return EMPTY_ACTION_ARRAY;
- }
-
- protected void addActionsToList(List list, IAction[] actions)
- {
- for (int i = 0; i < actions.length; i++)
- {
- list.add(actions[i]);
- }
- }
-
- public void activate()
- {
- super.activate();
- Object model = getModel();
- if (model instanceof IADTObject)
- {
- IADTObject object = (IADTObject)model;
- object.registerListener(this);
- }
-
- if (getZoomManager() != null)
- getZoomManager().addZoomListener(zoomListener);
-
- }
-
- public void deactivate()
- {
- try
- {
- Object model = getModel();
- if (model instanceof IADTObject)
- {
- IADTObject object = (IADTObject)model;
- object.unregisterListener(this);
- }
-
- if (getZoomManager() != null)
- getZoomManager().removeZoomListener(zoomListener);
- }
- finally
- {
- super.deactivate();
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- refresh();
- }
-
- public void refresh() {
-
- boolean doUpdateDesign = doUpdateDesign();
- if (doUpdateDesign)
- {
- super.refresh();
- }
- }
-
- public void addFeedback()
- {
- isSelected = true;
- refreshVisuals();
- }
-
- public void removeFeedback()
- {
- isSelected = false;
- refreshVisuals();
- }
-
- public ZoomManager getZoomManager()
- {
- return ((ScalableRootEditPart)getRoot()).getZoomManager();
- }
-
- public Rectangle getZoomedBounds(Rectangle r)
- {
- double factor = getZoomManager().getZoom();
- int x = (int)Math.round(r.x * factor);
- int y = (int)Math.round(r.y * factor);
- int width = (int)Math.round(r.width * factor);
- int height = (int)Math.round(r.height * factor);
-
- return new Rectangle(x, y, width, height);
- }
-
- private ZoomListener zoomListener = new ZoomListener()
- {
- public void zoomChanged(double zoom)
- {
- handleZoomChanged();
- }
- };
-
- protected void handleZoomChanged()
- {
- refreshVisuals();
- }
-
- public IEditorPart getEditorPart()
- {
- IEditorPart editorPart = null;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- if (workbenchWindow.getActivePage() != null)
- {
- editorPart = workbenchWindow.getActivePage().getActiveEditor();
- }
- }
- }
-// Assert.isNotNull(editorPart);
- return editorPart;
- }
-
- protected void createEditPolicies()
- {
- installEditPolicy(KeyBoardAccessibilityEditPolicy.KEY, new KeyBoardAccessibilityEditPolicy()
- {
- public EditPart getRelativeEditPart(EditPart editPart, int direction)
- {
- return doGetRelativeEditPart(editPart, direction);
- }
- });
- }
-
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- return null;
- }
-
- protected boolean isFileReadOnly()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null)
- {
- IEditorInput editorInput = editor.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- // For https://bugs.eclipse.org/bugs/show_bug.cgi?id=218281
- // Don't want to refresh the design when changes are made in the source view.
- protected boolean doUpdateDesign()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorPart editorPart = page.getActiveEditor();
- if (editorPart instanceof CommonMultiPageEditor)
- {
- CommonMultiPageEditor editor = (CommonMultiPageEditor) editorPart;
- GraphicalViewer viewer = (GraphicalViewer)editor.getAdapter(GraphicalViewer.class);
- // Need to ensure this is the same editor we are working with since the active editor may not be
- // the current, eg. at startup, there can be another XSD Editor open on the source page, so we could end
- // up not populating the design view initally
- if (getViewer() == viewer)
- {
- // If source page is active, don't update the design
- return !editor.isSourcePageActive();
- }
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Try to get the italic font for the current font
- * @param font
- * @return
- */
- protected Font getItalicFont(Font font)
- {
- if (font != null && !font.isDisposed())
- {
- FontData[] fd = font.getFontData();
- if (fd.length > 0)
- {
- fd[0].setStyle(fd[0].getStyle() | SWT.ITALIC);
- return new Font(font.getDevice(), fd);
- }
- }
- return font;
- }
- protected AccessibleEditPart getAccessibleEditPart() {
-
- if (accessiblePart ==null)
- {
- accessiblePart = new AccessibleGraphicalEditPart(){
-
- public void getName(AccessibleEvent e) {
- e.result = getReaderText();
- }
- };
- }
- return accessiblePart;
- }
-public String getReaderText()
-{
- return "";
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java
deleted file mode 100644
index e40978037d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ComboBoxCellEditorManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ElementReferenceDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.TypeReferenceDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ConnectableEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.GraphNodeDragTracker;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class BaseFieldEditPart extends BaseTypeConnectingEditPart implements INamedEditPart, IAutoDirectEdit
-{
- protected TypeReferenceConnection connectionFigure;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
- protected TypeReferenceConnection connectionFeedbackFigure;
-
- protected IFigure createFigure()
- {
- IFieldFigure figure = getFigureFactory().createFieldFigure(getModel());
- figure.setForegroundColor(ColorConstants.black);
- return figure;
- }
-
- public IFieldFigure getFieldFigure()
- {
- return (IFieldFigure)figure;
- }
-
-
- protected boolean shouldDrawConnection()
- {
- boolean result = false;
-
- // For now we only want to produce outbound lines from a Field to a Type
- // when the field in contained in the 'focus' edit part
- for (EditPart parent = getParent(); parent != null; parent = parent.getParent())
- {
- if (parent.getModel() instanceof FocusTypeColumn)
- {
- result = true;
- break;
- }
- }
- return result;
- }
-
- private EditPart getTargetEditPart(IType type)
- {
- ColumnEditPart columnEditPart = null;
- for (EditPart editPart = this; editPart != null; editPart = editPart.getParent())
- {
- if (editPart instanceof ColumnEditPart)
- {
- columnEditPart = (ColumnEditPart)editPart;
- break;
- }
- }
- if (columnEditPart != null)
- {
- // get the next column
- EditPart parent = columnEditPart.getParent();
- List columns = parent.getChildren();
- int index = columns.indexOf(columnEditPart);
- if (index + 1 < columns.size())
- {
- EditPart nextColumn = (EditPart)columns.get(index + 1);
- for (Iterator i = nextColumn.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child.getModel() == type)
- {
- return child;
- }
- }
- }
- }
- return null;
- }
-
- private EditPart getTargetConnectionEditPart()
- {
- EditPart result = null;
- IField field = (IField)getModel();
- IType type = field.getType();
- if (type != null)
- {
- result = getTargetEP(type); //getTargetEditPart(type);
- }
- return result;
- }
-
- /**
- * Do not override
- * @param type
- * @return
- */
- protected EditPart getTargetEP(IType type)
- {
- return getTargetEditPart(type);
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- connectionFigure = null;
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getTargetConnectionEditPart();
- if (referenceTypePart != null)
- {
- connectionFigure = new TypeReferenceConnection();
-
- if (getFigure().getParent() == referenceTypePart.getFigure())
- {
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.LEFT, 1));
- }
- else
- {
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 5));
- }
- int targetAnchorYOffset = 8;
-
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.HEADER_LEFT, 0, targetAnchorYOffset));
- connectionFigure.setHighlight(false);
- }
-
- return connectionFigure;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == PositionConstants.EAST)
- {
- result = getTargetConnectionEditPart();
- }
- else if (direction == PositionConstants.WEST)
- {
- for (Iterator iter = getParent().getChildren().iterator(); iter.hasNext(); )
- {
- Object child = iter.next();
- if (child instanceof SectionEditPart)
- {
- SectionEditPart groups = (SectionEditPart) child;
- for (Iterator i = groups.getChildren().iterator(); i.hasNext(); )
- {
- Object groupChild = i.next();
- EditPart connectable = getParentConnectableEditPart((EditPart)groupChild);
- if (connectable != null)
- {
- result = connectable;
- }
- }
- }
- }
- if (result == null)
- {
- result = this;
- }
- }
- else
- {
- result = super.doGetRelativeEditPart(editPart, direction);
- if (result == null)
- {
- result = ((BaseEditPart)getParent()).doGetRelativeEditPart(editPart, direction);
- }
- }
- return result;
- }
-
- protected ConnectableEditPart getParentConnectableEditPart(EditPart connectable)
- {
- if (connectable instanceof TargetConnectionSpacingFigureEditPart)
- {
- TargetConnectionSpaceFiller space = (TargetConnectionSpaceFiller) ((TargetConnectionSpacingFigureEditPart)connectable).getModel();
- if (space.getAdapter() == this.getModel())
- {
- return (ConnectableEditPart)connectable;
- }
- }
-
- for (Iterator i = connectable.getChildren().iterator(); i.hasNext(); )
- {
- Object child = i.next();
- if (child instanceof ConnectableEditPart)
- {
- ConnectableEditPart r = getParentConnectableEditPart((EditPart)child);
- if (r != null) return r;
- }
- else if (child instanceof TargetConnectionSpacingFigureEditPart)
- {
- TargetConnectionSpaceFiller space = (TargetConnectionSpaceFiller) ((TargetConnectionSpacingFigureEditPart)child).getModel();
- if (space.getAdapter() == this.getModel() && connectable instanceof ConnectableEditPart)
- {
- return (ConnectableEditPart)connectable;
- }
- }
- }
- return null;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- IFieldFigure figure = getFieldFigure();
- IField field = (IField) getModel();
-
- figure.getNameLabel().setText(field.getName());
- figure.getTypeLabel().setText(field.getTypeName());
- figure.refreshVisuals(getModel());
-
- figure.recomputeLayout();
-
- ((GraphicalEditPart)getRoot()).getFigure().invalidateTree();
- }
-
- public DragTracker getDragTracker(Request request)
- {
- return new GraphNodeDragTracker(this);
- }
-
- /*
- public IAction[] getActions(Object object)
- {
- // when a FieldEditPart is selected it provides it's own actions
- // as well as those of it's parent 'type' edit part
- List list = new ArrayList();
- EditPart compartment = getParent();
- if (compartment != null)
- {
- EditPart type = compartment.getParent();
- if (type != null && type instanceof IActionProvider)
- {
- IActionProvider provider = (IActionProvider)type;
- addActionsToList(list, provider.getActions(object));
- }
- }
- addActionsToList(list, super.getActions(object));
- IAction[] result = new IAction[list.size()];
- list.toArray(result);
- return result;
- }*/
-
- public Label getNameLabelFigure()
- {
- return getFieldFigure().getNameLabel();
- }
-
- public void performDirectEdit(Point cursorLocation)
- {
-
- }
-
- public void performRequest(Request request)
- {
- if (((IADTObject)getModel()).isReadOnly() || isFileReadOnly())
- {
- return;
- }
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT||
- request.getType() == RequestConstants.REQ_OPEN)
- {
- IFieldFigure fieldFigure = getFieldFigure();
- Object model = getModel();
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest)request;
- Point p = locationRequest.getLocation();
-
- if (hitTest(fieldFigure.getTypeLabel(), p))
- {
- TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager((IField)model, this, fieldFigure.getTypeLabel());
- TypeUpdateCommand typeUpdateCommand = new TypeUpdateCommand();
- typeUpdateCommand.setDelegate(manager);
- adtDirectEditPolicy.setUpdateCommand(typeUpdateCommand);
- manager.show();
- }
- else if (hitTest(fieldFigure.getNameLabel(), p))
- {
- directEditNameField();
- }
- }
- else {
- directEditNameField();
- }
- }
- }
-
- protected void directEditNameField()
- {
- if (isFileReadOnly()) return;
- Object model = getModel();
- IFieldFigure fieldFigure = getFieldFigure();
- if ( model instanceof IField)
- {
- IField field = (IField) model;
- if (field.isReference())
- {
- ElementReferenceDirectEditManager manager = new ElementReferenceDirectEditManager((IField) model, this, fieldFigure.getNameLabel());
- ReferenceUpdateCommand elementUpdateCommand = new ReferenceUpdateCommand();
- elementUpdateCommand.setDelegate(manager);
- adtDirectEditPolicy.setUpdateCommand(elementUpdateCommand);
- manager.show();
- }
- else
- {
- LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, null));
- NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
- adtDirectEditPolicy.setUpdateCommand(wrapper);
- manager.show();
- }
- }
- }
-
- public void doEditName(boolean addFromDesign)
- {
- if (!addFromDesign) return;
-
-// removeFeedback();
-
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- Object object = ((XSDBaseAdapter)getModel()).getTarget();
- if (object instanceof XSDNamedComponent)
- {
- Point p = getNameLabelFigure().getLocation();
- LabelEditManager manager = new LabelEditManager(BaseFieldEditPart.this, new LabelCellEditorLocator(BaseFieldEditPart.this, p));
- NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
- adtDirectEditPolicy.setUpdateCommand(wrapper);
- manager.show();
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
-
- }
-
- protected class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
- {
- Command command;
- protected DirectEditRequest request;
-
- public NameUpdateCommandWrapper()
- {
- super(Messages._UI_ACTION_UPDATE_NAME);
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- IField field = (IField)getModel();
- Object newValue = request.getCellEditor().getValue();
- if (newValue instanceof String)
- {
- command = field.getUpdateNameCommand((String)newValue);
- }
- if (command != null)
- command.execute();
- }
- }
-
- class TypeUpdateCommand extends Command implements IADTUpdateCommand
- {
- protected ComboBoxCellEditorManager delegate;
- protected DirectEditRequest request;
-
- public TypeUpdateCommand()
- {
- super(Messages._UI_ACTION_UPDATE_TYPE);
- }
-
- public void setDelegate(ComboBoxCellEditorManager delegate)
- {
- this.delegate = delegate;
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- if (delegate != null)
- {
- delegate.performEdit(request.getCellEditor());
- }
- }
-
- public boolean canExecute()
- {
- IField field = (IField)getModel();
- Object newValue = ((CCombo)request.getCellEditor().getControl()).getText();
- if (newValue instanceof String)
- {
- return !newValue.equals(field.getTypeName());
- }
- return true;
- }
- }
-
- protected class ReferenceUpdateCommand extends Command implements IADTUpdateCommand
- {
- protected ComboBoxCellEditorManager delegate;
- protected DirectEditRequest request;
-
- public ReferenceUpdateCommand()
- {
- super(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE);
- }
-
- public void setDelegate(ComboBoxCellEditorManager delegate)
- {
- this.delegate = delegate;
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- if (delegate != null)
- {
- delegate.performEdit(request.getCellEditor());
- }
- }
-
- public boolean canExecute()
- {
- return true;
- }
- }
-
-
- public void addFeedback()
- {
- // Put back connection figure so it won't get overlayed by other non highlighted connections
- if (connectionFigure != null && !isSelected)
- {
- connectionFeedbackFigure = new TypeReferenceConnection();
- connectionFeedbackFigure.setSourceAnchor(connectionFigure.getSourceAnchor());
- connectionFeedbackFigure.setTargetAnchor(connectionFigure.getTargetAnchor());
- connectionFeedbackFigure.setHighlight(true);
- getLayer(LayerConstants.FEEDBACK_LAYER).add(connectionFeedbackFigure);
- }
- super.addFeedback();
- getFieldFigure().addSelectionFeedback();
- }
-
- public void removeFeedback()
- {
- if (connectionFeedbackFigure != null)
- {
- connectionFeedbackFigure.setHighlight(false);
- getLayer(LayerConstants.FEEDBACK_LAYER).remove(connectionFeedbackFigure);
- }
- connectionFeedbackFigure = null;
- super.removeFeedback();
- getFieldFigure().removeSelectionFeedback();
- }
- public String getReaderText()
- {
- IFieldFigure fieldFigure = getFieldFigure();
-
- String name="";
- if (fieldFigure.getNameLabel() !=null&& fieldFigure.getNameLabel().getText().trim().length() > 0)
- name +=fieldFigure.getNameLabel().getText();
- if (fieldFigure.getNameAnnotationLabel() !=null && fieldFigure.getNameAnnotationLabel().getText().trim().length() > 0)
- name += " "+fieldFigure.getNameAnnotationLabel().getText();
- if (fieldFigure.getTypeLabel() !=null && fieldFigure.getTypeLabel().getText().trim().length() > 0)
- name += " type "+fieldFigure.getTypeLabel().getText();
- if (fieldFigure.getTypeAnnotationLabel() !=null && fieldFigure.getTypeAnnotationLabel().getText().trim().length() >0)
- name += " "+fieldFigure.getTypeAnnotationLabel().getText();
- return name;
-
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
deleted file mode 100644
index eebb8e6036..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-/**
- * This class provides some base function to enable drawing connections to a referenced type
- *
- */
-public abstract class BaseTypeConnectingEditPart extends BaseEditPart implements IFeedbackHandler, IConnectionContainer
-{
- private TypeReferenceConnection connectionFigure;
-
- public void activate()
- {
- super.activate();
- }
-
- public void deactivate()
- {
- deactivateConnection();
- super.deactivate();
- }
-
- public void refreshConnections()
- {
- deactivateConnection();
- activateConnection();
- }
-
- protected void activateConnection()
- {
- // If appropriate, create our connectionFigure and add it to the appropriate layer
- if (connectionFigure == null && shouldDrawConnection())
- {
- //System.out.println("activateeConnection()-pre:" + getClass().getName());
- connectionFigure = createConnectionFigure();
- if (connectionFigure != null)
- {
- // Add our editpolicy as a listener on the connection, so it can stay in synch
- //connectionFigure.addPropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
- //connectionFigure.addMouseListener(this);
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
- }
-
- protected void deactivateConnection()
- {
- // if we have a connection, remove it
- if (connectionFigure != null)
- {
- getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
- // Remove our editpolicy listener(s)
- //connectionFigure.removePropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
- //connectionFigure.removeMouseListener(this);
- connectionFigure = null;
- }
- }
-
- protected boolean shouldDrawConnection()
- {
- return true;
- }
-
- public abstract TypeReferenceConnection createConnectionFigure();
-
- public void addFeedback()
- {
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(true);
- }
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(false);
- }
- super.removeFeedback();
- }
-
- protected class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
- {
- Command command;
- protected DirectEditRequest request;
-
- public NameUpdateCommandWrapper()
- {
- super(Messages._UI_ACTION_UPDATE_NAME);
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- IType iType = (IType)getModel();
- Object newValue = request.getCellEditor().getValue();
- if (newValue instanceof String)
- {
- command = iType.getUpdateNameCommand((String)newValue);
- }
- if (command != null)
- command.execute();
- }
- }
-
- public boolean hitTest(IFigure target, Point location)
- {
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == PositionConstants.WEST)
- {
- result = getConnectionEditPart(PositionConstants.WEST);
- }
- else if (direction == PositionConstants.EAST)
- {
- result = getConnectionEditPart(PositionConstants.EAST);
- }
- return result;
- }
-
- private EditPart getConnectionEditPart(int direction)
- {
- // find the first connection that targets this editPart
- // navigate backward along the connection (to the left) to find the source edit part
- EditPart result = null;
- for (Iterator i = getLayer(LayerConstants.CONNECTION_LAYER).getChildren().iterator(); i.hasNext(); )
- {
- Figure figure = (Figure)i.next();
- if (figure instanceof TypeReferenceConnection)
- {
- TypeReferenceConnection typeReferenceConnection = (TypeReferenceConnection)figure;
- ConnectionAnchor thisAnchor = null;
- if (direction == PositionConstants.EAST)
- {
- thisAnchor = typeReferenceConnection.getSourceAnchor();
- }
- else if (direction == PositionConstants.WEST)
- {
- thisAnchor = typeReferenceConnection.getTargetAnchor();
- }
- if (thisAnchor != null && thisAnchor.getOwner() == getFigure())
- {
- ConnectionAnchor outAnchor = null;
- if (direction == PositionConstants.EAST)
- {
- outAnchor = typeReferenceConnection.getTargetAnchor();
- }
- else if (direction == PositionConstants.WEST)
- {
- outAnchor = typeReferenceConnection.getSourceAnchor();
- }
-
- if (outAnchor != null)
- {
- IFigure sourceFigure = outAnchor.getOwner();
- EditPart part = null;
- while (part == null && sourceFigure != null)
- {
- part = (EditPart)getViewer().getVisualPartMap().get(sourceFigure);
- sourceFigure = sourceFigure.getParent();
- }
- result = part;
- break;
- }
- }
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java
deleted file mode 100644
index 89a85deaae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java
+++ /dev/null
@@ -1,92 +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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.List;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure;
-
-public abstract class BoxEditPart extends BaseTypeConnectingEditPart //IFeedbackHandler
-{
- protected List compartmentList = null;
- protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-
- protected Compartment[] getCompartments()
- {
- return null;
- }
-
- protected IFigure createFigure()
- {
- BoxFigure figure = new BoxFigure();
- LineBorder boxLineBorder = new LineBorder(1);
- figure.setBorder(boxLineBorder);
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- // we should organize ITreeElement and integrate it with the facade
- if (getModel() instanceof ITreeElement)
- {
- figure.getNameLabel().setIcon(((ITreeElement)getModel()).getImage());
- }
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return ((BoxFigure)getFigure()).getContentPane();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
- }
-
-
- public void addFeedback()
- {
- BoxFigure boxFigure = (BoxFigure)figure;
- LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
- boxFigureLineBorder.setWidth(2);
- boxFigureLineBorder.setColor(ColorConstants.darkBlue);
- boxFigure.getHeadingFigure().setSelected(true);
- figure.repaint();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- BoxFigure boxFigure = (BoxFigure)figure;
- LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
- boxFigureLineBorder.setWidth(1);
- boxFigureLineBorder.setColor(ColorConstants.black);
- boxFigure.getHeadingFigure().setSelected(false);
- figure.repaint();
- super.removeFeedback();
- }
-
- protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CenteredConnectionAnchor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CenteredConnectionAnchor.java
deleted file mode 100644
index 0c93b9d691..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CenteredConnectionAnchor.java
+++ /dev/null
@@ -1,115 +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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure;
-
-public class CenteredConnectionAnchor extends AbstractConnectionAnchor
-{
- public static final int TOP = 0;
- public static final int BOTTOM = 1;
- public static final int LEFT = 2;
- public static final int RIGHT = 3;
-
- public static final int HEADER_LEFT = 4;
- public static final int HEADER_RIGHT = 5;
-
- private int location;
- private int inset;
- private int offset = 0;
- private CenteredConnectionAnchor other;
-
- public CenteredConnectionAnchor(IFigure owner, int location, int inset)
- {
- super(owner);
- this.location = location;
- this.inset = inset;
- }
-
- public CenteredConnectionAnchor(IFigure owner, int location, int inset, int offset)
- {
- this(owner, location, inset);
- this.offset = offset;
- }
-
- public Point getLocation(Point reference)
- {
- Rectangle r = getOwner().getBounds();
- int x, y;
- switch (location)
- {
- case TOP:
- x = r.right() - r.width / 2 + offset;
- y = r.y + inset;
- break;
- case BOTTOM:
- x = r.right() - r.width / 2 + offset;
- y = r.bottom() - inset;
- break;
- case LEFT:
- x = r.x + inset;
- y = r.bottom() - r.height / 2 + offset;
- break;
- case RIGHT:
- x = r.right() - inset;
- y = r.bottom() - r.height / 2 + offset;
- break;
- case HEADER_LEFT:
- x = r.x + inset;
- y = r.y + offset;
- break;
- case HEADER_RIGHT:
- x = r.right() - inset;
- y = r.y + offset;
- break;
-
- default:
- x = r.right() - r.width / 2;
- y = r.bottom() - r.height / 2;
- }
- Point p = new Point(x, y);
-
- if (!(getOwner() instanceof CenteredIconFigure))
- {
- getOwner().translateToAbsolute(p);
- }
- else
- {
- getOwner().translateToAbsolute(p);
- }
-
- if (other != null)
- {
- // if within only one pixel of being vertical, we straighten up the line
- Point p2 = other.getLocation(null);
- if (Math.abs(p2.x - p.x) <= 1)
- {
- p.x = p2.x;
- }
- }
- return p;
- }
-
- public Point getReferencePoint()
- {
- return getLocation(null);
- }
-
- public void setOther(CenteredConnectionAnchor other)
- {
- this.other = other;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java
deleted file mode 100644
index 8eb4090fbc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.ReferencedTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-
-public class ColumnEditPart extends BaseEditPart
-{
- protected int spacing = 20;
- protected int minorAlignment = -1;
- protected boolean isHorizontal = false;
-
- public ColumnEditPart()
- {
- }
-
- public ColumnEditPart(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- ToolbarLayout layout = new ToolbarLayout(isHorizontal);
-
- if (minorAlignment != -1)
- {
- layout.setMinorAlignment(minorAlignment);
- }
- layout.setStretchMinorAxis(false);
- layout.setSpacing(spacing);
- figure.setLayoutManager(layout);
- return figure;
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- if (figure != null)
- {
- ((ToolbarLayout)figure.getLayoutManager()).setSpacing(spacing);
- }
- }
-
- public IComplexType getComplexType()
- {
- return (IComplexType)getModel();
- }
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- }
-
- protected List getModelChildren()
- {
- AbstractModelCollection collection = (AbstractModelCollection)getModel();
- return collection.getChildren();
- }
-
- public int getMinorAlignment()
- {
- return minorAlignment;
- }
-
- public void setMinorAlignment(int minorAlignment)
- {
- this.minorAlignment = minorAlignment;
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- if (getModel() instanceof ReferencedTypeColumn)
- {
- if (getParent().getChildren().size() > 0)
- {
- EditPart editPart = (EditPart)getParent().getChildren().get(0);
- refreshConnections(editPart);
- }
- }
- else
- {
- refreshConnections(this);
- }
- }
-
-
- public void refreshConnections(EditPart parent)
- {
- for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- if (editPart instanceof BaseTypeConnectingEditPart)
- {
- BaseTypeConnectingEditPart connectingEditPart = (BaseTypeConnectingEditPart)editPart;
- connectingEditPart.refreshConnections();
- }
- refreshConnections(editPart);
- }
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CompartmentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CompartmentEditPart.java
deleted file mode 100644
index 15f56e892e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CompartmentEditPart.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-
-// TODO (cs) common-up with BoxEditPart (?)
-public class CompartmentEditPart extends BaseEditPart // implements
- // IFeedbackHandler
-{
- protected Annotation annotation = new Annotation();
-
- protected IFigure createFigure()
- {
- ICompartmentFigure figure = getFigureFactory().createCompartmentFigure(getModel());
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return getCompartmentFigure().getContentPane();
- }
-
- public boolean hasContent()
- {
- // since the annotation always takes up 1 child, here's a convenience method to figure out if
- return getChildren().size() > 1;
- }
-
- List getChildrenSansAnnotation()
- {
- List children = new ArrayList();
- children.addAll(getChildren());
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child.getModel() == annotation)
- {
- i.remove();
- break;
- }
- }
- return children;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
-
- // we compute the children sans the annotation EditPart
- // since the annotation EditPart confuses our up/down key handling
- List children = getChildrenSansAnnotation();
- if (children.contains(editPart))
- {
- if (direction == KeyBoardAccessibilityEditPolicy.OUT_TO_PARENT)
- {
- Compartment compartment = (Compartment)getModel();
- for (EditPart parent = editPart.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent.getModel() == compartment.getOwner())
- {
- result = parent;
- break;
- }
- }
- }
- else if (direction == PositionConstants.SOUTH)
- {
- int size = children.size();
- if (size > 0)
- {
- if (children.get(size - 1) == editPart)
- {
- CompartmentEditPart nextCompartment = (CompartmentEditPart)EditPartNavigationHandlerUtil.getNextSibling(CompartmentEditPart.this);
- if (nextCompartment != null && nextCompartment.getChildrenSansAnnotation().size() > 0)
- {
- result = EditPartNavigationHandlerUtil.getFirstChild(nextCompartment);
- }
- else
- {
- result = editPart;
- }
- }
- }
- if (result == null) result = EditPartNavigationHandlerUtil.getNextSibling(editPart);
- }
- else if (direction == PositionConstants.NORTH)
- {
- if (EditPartNavigationHandlerUtil.getFirstChild(CompartmentEditPart.this) == editPart)
- {
- EditPart prevCompartment = EditPartNavigationHandlerUtil.getPrevSibling(CompartmentEditPart.this);
- if (prevCompartment instanceof CompartmentEditPart)
- {
- List prevCompListChildren = ((CompartmentEditPart)prevCompartment).getChildrenSansAnnotation();
- int size = prevCompListChildren.size();
- if (size > 0)
- {
- result = (EditPart)prevCompartment.getChildren().get(size - 1);
- }
- }
- }
- if (result == null) result = EditPartNavigationHandlerUtil.getPrevSibling(editPart);
- }
- }
- return result;
- }
-
- protected void addChildVisual(EditPart childEditPart, int index)
- {
- Object model = childEditPart.getModel();
-
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-
- if (model instanceof IField)
- {
- getCompartmentFigure().getContentPane().add(child, index);
- return;
- }
- else if (model instanceof Annotation)
- {
- getCompartmentFigure().getAnnotationPane().add(child);
- return;
- }
- super.addChildVisual(childEditPart, index);
- }
-
- protected void removeChildVisual(EditPart childEditPart)
- {
- Object model = childEditPart.getModel();
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
-
- if (model instanceof IField)
- {
- getCompartmentFigure().getContentPane().remove(child);
- return;
- }
- else if (model instanceof Annotation)
- {
- getCompartmentFigure().getAnnotationPane().remove(child);
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- protected Compartment getCompartment()
- {
- return (Compartment) getModel();
- }
-
- protected List getModelChildren()
- {
- List children = getCompartment().getChildren();
- children.add(annotation);
- return children;
- }
-
- public void setModel(Object model)
- {
- super.setModel(model);
- annotation.setCompartment(getCompartment());
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- // ((AbstractGraphicalEditPart)getParent()).getContentPane().invalidate();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- }
-
- public void addFeedback()
- {
- // getFigure().setBackgroundColor(ColorConstants.blue);
- // ((CompartmentFigure)getFigure()).setBorderColor(ColorConstants.black);
- getFigure().repaint();
- }
-
- public void removeFeedback()
- {
- // getFigure().setBackgroundColor(ColorConstants.lightBlue);
- // ((CompartmentFigure)getFigure()).setBorderColor(ColorConstants.lightGray);
- getFigure().repaint();
- }
-
- public ICompartmentFigure getCompartmentFigure()
- {
- return (ICompartmentFigure)figure;
- }
-
- public void addNotify()
- {
- super.addNotify();
- getCompartmentFigure().editPartAttached(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
deleted file mode 100644
index 0eceb08ac1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class ComplexTypeEditPart extends StructureEditPart
-{
- private Font italicFont;
-
- protected boolean shouldDrawConnection()
- {
- if (getParent().getModel() instanceof FocusTypeColumn)
- {
- IComplexType complexType = (IComplexType)getModel();
- return complexType.getSuperType() != null;
- }
- return false;
- }
-
-
- private EditPart getTargetEditPart(IType type)
- {
- ColumnEditPart columnEditPart = null;
- for (EditPart editPart = this; editPart != null; editPart = editPart.getParent())
- {
- if (editPart instanceof ColumnEditPart)
- {
- columnEditPart = (ColumnEditPart)editPart;
- break;
- }
- }
- if (columnEditPart != null)
- {
- for (Iterator i = columnEditPart.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child.getModel() == type)
- {
- return child;
- }
- }
- }
- return null;
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- connectionFigure = null;
- IComplexType complexType = (IComplexType)getModel();
- IType type = complexType.getSuperType();
- if (type != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getTargetEditPart(type);
- if (referenceTypePart != null)
- {
- connectionFigure = new TypeReferenceConnection(true);
- // draw a line out from the top
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
-
- // TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
- // adding a label to the connection would help to
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0));
- connectionFigure.setConnectionRouter(new ManhattanConnectionRouter());
- ((CenteredConnectionAnchor)connectionFigure.getSourceAnchor()).setOther((CenteredConnectionAnchor)connectionFigure.getTargetAnchor());
- connectionFigure.setHighlight(false);
- }
- }
- return connectionFigure;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- Label label = getNameLabelFigure();
- IComplexType complexType = (IComplexType)getModel();
- if (complexType.isAbstract())
- {
- if (italicFont == null)
- {
- Font font = label.getFont();
- italicFont = getItalicFont(font);
- }
- if (italicFont != null)
- {
- label.setFont(italicFont);
- }
- }
- else
- {
- label.setFont(label.getParent().getFont());
- }
- }
-
- public void deactivate()
- {
- if (italicFont != null)
- {
- italicFont.dispose();
- italicFont = null;
- }
- super.deactivate();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java
deleted file mode 100644
index c234b65f5c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java
+++ /dev/null
@@ -1,72 +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.xsd.ui.internal.adt.design.editparts;
-import java.util.List;
-import org.eclipse.gef.EditPart;
-
-
-public class EditPartNavigationHandlerUtil
-{
- public static EditPart getFirstChild(EditPart editPart)
- {
- EditPart result = null;
- if (editPart.getChildren().size() > 0)
- {
- result = (EditPart)editPart.getChildren().get(0);
- }
- return result;
- }
-
- public static EditPart getLastChild(EditPart editPart)
- {
- EditPart result = null;
- int size = editPart.getChildren().size();
- if (size > 0)
- {
- result = (EditPart)editPart.getChildren().get(size - 1);
- }
- return result;
- }
-
- public static EditPart getNextSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index + 1 < children.size())
- {
- result = (EditPart)children.get(index + 1);
- }
- }
- return result;
- }
-
- public static EditPart getPrevSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index - 1 >= 0)
- {
- // if this is the first child
- //
- result = (EditPart)children.get(index - 1);
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java
deleted file mode 100644
index f17dd39853..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java
+++ /dev/null
@@ -1,21 +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.xsd.ui.internal.adt.design.editparts;
-
-
-public class FieldEditPart extends BaseFieldEditPart
-{
- public void addNotify()
- {
- super.addNotify();
- getFieldFigure().editPartAttached(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java
deleted file mode 100644
index bcd3186980..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java
+++ /dev/null
@@ -1,20 +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.wst.xsd.ui.internal.adt.design.editparts;
-
-/**
- * Edit parts that can be direct editable
- *
- */
-public interface IAutoDirectEdit
-{
- public void doEditName(boolean addFromDesign);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java
deleted file mode 100644
index 176125351a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java
+++ /dev/null
@@ -1,16 +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.xsd.ui.internal.adt.design.editparts;
-
-public interface IConnectionContainer
-{
- public void refreshConnections();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IHolderEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IHolderEditPart.java
deleted file mode 100644
index 7f7a5ae74c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IHolderEditPart.java
+++ /dev/null
@@ -1,16 +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.wst.xsd.ui.internal.adt.design.editparts;
-
-public interface IHolderEditPart
-{
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java
deleted file mode 100644
index b186c28124..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java
+++ /dev/null
@@ -1,21 +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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface INamedEditPart
-{
- public Label getNameLabelFigure();
-
- public void performDirectEdit(Point cursorLocation);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
deleted file mode 100644
index d2677d4a12..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class RootContentEditPart extends BaseEditPart
-{
- List collections = null;
- Figure contentPane;
-
- protected IFigure createFigure()
- {
- Panel panel = new Panel();
- panel.setBorder(new MarginBorder(60));
-
- ToolbarLayout panelLayout = new ToolbarLayout(false);
- panelLayout.setStretchMinorAxis(true);
- panel.setLayoutManager(panelLayout);
-
- contentPane = new Figure();
- panel.add(contentPane);
-
- ToolbarLayout tb = new ToolbarLayout(false);
- tb.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- tb.setStretchMinorAxis(true);
- tb.setSpacing(40);
- contentPane.setLayoutManager(tb);
-
- return panel;
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
-
- public IComplexType getSelectedComplexType()
- {
- IComplexType result = null;
- IModel model = (IModel)getModel();
- List types = model.getTypes();
- if (types.size() > 0)
- {
- if (types.get(0) instanceof IComplexType)
- result = (IComplexType)types.get(0);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- }
-
- protected List getModelChildren()
- {
- collections = new ArrayList();
- if (getModel() != null)
- {
- Object obj = getModel();
- IADTObject focusObject = null;
- if (obj instanceof IStructure)
- {
- if (obj instanceof IGraphElement)
- {
- if (((IGraphElement)obj).isFocusAllowed())
- focusObject = (IStructure)obj;
- }
- }
- else if (obj instanceof IField)
- {
- focusObject = (IField)obj;
- }
- else if (obj instanceof IModel)
- {
- focusObject = (IModel)obj;
- collections.add(focusObject);
- return collections;
- }
- else if (obj instanceof IType)
- {
- if (obj instanceof IGraphElement)
- {
- if (((IGraphElement)obj).isFocusAllowed())
- {
- focusObject = (IType)obj;
- }
- }
- }
- else if (obj instanceof IGraphElement)
- {
- if (((IGraphElement)obj).isFocusAllowed())
- {
- focusObject = (IADTObject)obj;
- collections.add(focusObject);
- return collections;
- }
- }
- if (focusObject != null)
- {
- RootHolder holder = new RootHolder(focusObject);
- collections.add(holder);
- return collections;
- }
- }
- return collections;
- }
-
-
- /**
- * @deprecated Don't call this method. Use DesignViewGraphicalViewer.setInput() instead.
- */
- public void setInput(Object component)
- {
- setModel(component);
- refresh();
- }
-
- /**
- * @deprecated Don't call this method. Use DesignViewGraphicalViewer.getInput() instead.
- */
- public Object getInput()
- {
- return getModel();
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252589
- public void activate()
- {
- super.activate();
- Object model = getModel();
- // The schema adapter doesn't have to notify the RootContentEditPart of it changes
- if (model instanceof IADTObject)
- {
- IADTObject object = (IADTObject)model;
- object.unregisterListener(this);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootEditPart.java
deleted file mode 100644
index fd8758129f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootEditPart.java
+++ /dev/null
@@ -1,115 +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.xsd.ui.internal.adt.design.editparts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import org.eclipse.draw2d.BendpointConnectionRouter;
-import org.eclipse.draw2d.ConnectionLayer;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Layer;
-import org.eclipse.draw2d.LayeredPane;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewerGraphicConstants;
-
-public class RootEditPart extends ScalableRootEditPart implements org.eclipse.gef.RootEditPart
-{
- public void activate()
- {
- super.activate();
- // Set up Connection layer with a router, if it doesn't already have one
- ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
- if (connectionLayer != null)
- {
- connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
- }
-
- Figure figure = (Figure)getLayer(LayerConstants.FEEDBACK_LAYER);
- if (figure != null)
- {
- if (getViewer() instanceof ScrollingGraphicalViewer)
- {
- //ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)getViewer();
- //IndexFigure indexFigure = new IndexFigure(sgv);
- //figure.add(indexFigure);
- //getViewer().addPropertyChangeListener(indexFigure);
- }
- }
- refresh();
- }
-
- protected LayeredPane createPrintableLayers()
- {
- LayeredPane pane = super.createPrintableLayers();
- Layer layer = new ScaledHandleLayer();
- layer.setPreferredSize(new Dimension(5, 5));
- pane.add(layer, DesignViewerGraphicConstants.SCALED_HANDLE_LAYER);
- return pane;
- }
-
-
- class ScaledHandleLayer extends Layer
- {
- ScaledHandleLayer()
- {
- setEnabled(true);
- }
- /**
- * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
- */
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- Rectangle rect = new Rectangle();
- for (int i = 0; i < getChildren().size(); i++)
- rect.union(((IFigure)getChildren().get(i)).getBounds());
- return rect.getSize();
- }
- }
-
- class IndexFigure extends RectangleFigure implements PropertyChangeListener
- {
- EditPart editPart;
- ScrollingGraphicalViewer sgv;
- public IndexFigure(ScrollingGraphicalViewer sgv)
- {
- this.sgv = sgv;
- ((FigureCanvas)sgv.getControl()).getViewport().getHorizontalRangeModel().addPropertyChangeListener(this);
- ((FigureCanvas)sgv.getControl()).getViewport().getVerticalRangeModel().addPropertyChangeListener(this);
- Rectangle bounds = new Rectangle(0, 0, 40, 40);
- translateToAbsolute(bounds);
- setBounds(bounds);
- }
- public void propertyChange(PropertyChangeEvent evt)
- {
- System.out.println("scroll-change");
- Rectangle bounds = new Rectangle(0, 0, 40, 40);
- Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
- bounds.translate(p);
- setBounds(bounds);
- }
-
- public Rectangle getBounds()
- {
- Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
- bounds.translate(p);
- return super.getBounds().getCopy().translate(p);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootHolderEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootHolderEditPart.java
deleted file mode 100644
index a4ad059af0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootHolderEditPart.java
+++ /dev/null
@@ -1,62 +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.wst.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.ReferencedTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-public class RootHolderEditPart extends BaseEditPart implements IHolderEditPart
-{
- protected Panel panel;
-
- public RootHolderEditPart()
- {
- }
-
- protected IFigure createFigure()
- {
- panel = new Panel();
- ToolbarLayout layout = new ToolbarLayout(true);
- layout.setStretchMinorAxis(false);
- layout.setSpacing(100);
- panel.setLayoutManager(layout);
-
- return panel;
- }
-
- protected List getModelChildren()
- {
- List collections = new ArrayList();
- RootHolder holder = (RootHolder)getModel();
- IADTObject focusObject = holder.getModel();
- collections.add(new FocusTypeColumn(focusObject));
- collections.add(new ReferencedTypeColumn(focusObject));
- return collections;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/SectionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/SectionEditPart.java
deleted file mode 100644
index a25af476be..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/SectionEditPart.java
+++ /dev/null
@@ -1,38 +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.wst.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-
-public class SectionEditPart extends BaseEditPart
-{
- protected IComplexType complexType;
-
- protected IFigure createFigure()
- {
- Figure fig = new Figure();
- fig.setLayoutManager(new ToolbarLayout());
- return fig;
- }
-
- protected void createEditPolicies()
- {
-
- }
-
- public boolean isSelectable()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
deleted file mode 100644
index 167bfcfc8a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.SpaceFillerForFieldEditPart;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-public class StructureEditPart extends BaseTypeConnectingEditPart implements INamedEditPart
-{
- protected List compartmentList = null;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
- protected TypeReferenceConnection connectionFigure;
- protected TypeReferenceConnection connectionFeedbackFigure;
-
- /**
- * TODO cs... I'm sure this has something to do with the way we wanted to rework compartment creation
- * I suppose we could have subclasses override this method instead of getModelChildren()
- *
- * @deprecated
- */
- protected Compartment[] getCompartments()
- {
- return null;
- }
-
- protected IFigure createFigure()
- {
- IStructureFigure figure = getFigureFactory().createStructureFigure(getModel());
- return figure;
- }
-
- public IStructureFigure getStructureFigure()
- {
- return (IStructureFigure)getFigure();
- }
-
- public IFigure getContentPane()
- {
- return getStructureFigure().getContentPane();
- }
-
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- CompartmentEditPart compartment = (CompartmentEditPart)i.next();
- if (compartment.hasContent())
- {
- for (Iterator contentChildren = compartment.getChildren().iterator(); contentChildren.hasNext(); )
- {
- Object child = contentChildren.next();
- if (child instanceof SectionEditPart)
- {
- SectionEditPart part = (SectionEditPart) child;
- result = (EditPart)part.getChildren().get(0);
- return result;
- }
- else if (child instanceof BaseFieldEditPart && (!(child instanceof SpaceFillerForFieldEditPart)))
- {
- result = (EditPart)child;
- return result;
- }
- }
- }
- }
- }
- else
- {
- return super.doGetRelativeEditPart(editPart, direction);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- }
-
- protected IStructure getStructure()
- {
- return (IStructure)getModel();
- }
-
- protected List getModelChildren()
- {
- if (compartmentList == null)
- {
- compartmentList = new ArrayList();
-
- // TODO.. this needs to be moved to the xsd specific version of this class
- compartmentList.add(new Compartment(getStructure(), "attribute")); //$NON-NLS-1$
- compartmentList.add(new Compartment(getStructure(), "element")); //$NON-NLS-1$
- }
- return compartmentList;
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- //getFigure().invalidateTree();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- getStructureFigure().refreshVisuals(getModel());
- }
-
- public void addFeedback()
- {
- getStructureFigure().addSelectionFeedback();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- getStructureFigure().removeSelectionFeedback();
- super.removeFeedback();
- }
-
- public Label getNameLabelFigure()
- {
- return getStructureFigure().getNameLabel();
- }
-
- public void performDirectEdit(Point cursorLocation)
- {
-
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
- {
- if (request instanceof LocationRequest)
- {
- // uncomment for direct edit of name (add else)
-// LocationRequest locationRequest = (LocationRequest)request;
-// Point p = locationRequest.getLocation();
-// if (hitTest(getNameLabelFigure(), p))
-// {
-// LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-// NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-// adtDirectEditPolicy.setUpdateCommand(wrapper);
-// manager.show();
-// }
- }
- }
- else if (request.getType() == RequestConstants.REQ_OPEN)
- {
- Object model = getModel();
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest)request;
- Point p = locationRequest.getLocation();
-
- if (getStructureFigure().hitTestHeader(p))
- {
- // TODO: !!! This should be moved to the adt-xsd package
- //
- if (model instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter)model;
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)adapter.getTarget();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- Object schema = editorPart.getAdapter(XSDSchema.class);
- ActionRegistry registry = getEditorActionRegistry(editorPart);
- if (registry != null)
- {
- if (schema == ct.getSchema())
- {
- IAction action = registry.getAction(SetInputToGraphView.ID);
- action.run();
- }
- else
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- action.run();
- }
- }
- }
- }
- }
- }
- }
-
- protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
-
- protected boolean shouldDrawConnection()
- {
- return false;
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- return null;
- }
- public String getReaderText()
- {
- // return getStructureFigure().getNameLabel().getText();
- return getNameLabelFigure().getText();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
deleted file mode 100644
index 1ad0195f3f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure;
-
-public class TopLevelFieldEditPart extends BoxEditPart implements INamedEditPart
-{
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
- private Font italicFont;
-
- protected boolean shouldDrawConnection()
- {
- IField field = (IField)getModel();
- IType type = field.getType();
- return (type != null);
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- TypeReferenceConnection connectionFigure = null;
- IField field = (IField)getModel();
- IType type = field.getType();
- if (type != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getViewer().getEditPartRegistry().get(type);
- if (referenceTypePart != null)
- {
- connectionFigure = new TypeReferenceConnection();
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 0));
- int targetAnchorYOffset = 12;
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.HEADER_LEFT, 0, targetAnchorYOffset));
- connectionFigure.setHighlight(false);
- }
- }
- return connectionFigure;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- }
-
- protected void refreshVisuals()
- {
- IField field = (IField)getModel();
- BoxFigure boxFigure = (BoxFigure)getFigure();
- Label label = boxFigure.getNameLabel();
- label.setText(field.getName());
- if (field.isAbstract())
- {
- if (italicFont == null)
- {
- Font font = label.getFont();
- italicFont = getItalicFont(font);
- }
- if (italicFont != null)
- {
- label.setFont(italicFont);
- }
- }
- else
- {
- label.setFont(label.getParent().getFont());
- }
- super.refreshVisuals();
- }
-
- public void deactivate()
- {
- if (italicFont != null)
- {
- italicFont.dispose();
- italicFont = null;
- }
- super.deactivate();
- }
-
- public Label getNameLabelFigure()
- {
- BoxFigure boxFigure = (BoxFigure)getFigure();
- return boxFigure.getNameLabel();
- }
-
- public void performDirectEdit(Point cursorLocation)
- {
-
- }
- public String getReaderText()
- {
- return getNameLabelFigure().getText();
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT||
- request.getType() == RequestConstants.REQ_OPEN)
- {
-// if (request instanceof LocationRequest)
-// {
-// LocationRequest locationRequest = (LocationRequest)request;
-// Point p = locationRequest.getLocation();
-//
-// if (hitTest(getNameLabelFigure(), p))
-// {
-// LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-// NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-// adtDirectEditPolicy.setUpdateCommand(wrapper);
-// manager.show();
-// }
-// }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
deleted file mode 100644
index 0d7da4aba0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-
-public class TypeReferenceConnection extends PolylineConnection
-{
- protected boolean highlight = false;
- protected static final Color activeConnection = ColorConstants.black;
- protected static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
- /**
- * Default constructor
- */
- public TypeReferenceConnection()
- {
- super();
- setTargetDecoration(new PolygonDecoration());
- }
-
- public TypeReferenceConnection(boolean fill)
- {
- super();
- PolygonDecoration dec = new PolygonDecoration()
- {
- protected void fillShape(Graphics g)
- {
- try
- {
- g.pushState();
- g.setBackgroundColor(ColorConstants.white);
- super.fillShape(g);
- }
- finally
- {
- g.popState();
- }
- }
-
- };
- dec.setFill(fill);
- dec.setTemplate(PolygonDecoration.TRIANGLE_TIP);
- dec.setScale(14,6);
- setTargetDecoration(dec);
- }
-
-
- public void setConnectionRouter(ConnectionRouter cr)
- {
- if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof ManhattanConnectionRouter))
- super.setConnectionRouter(cr);
- }
-
- /**
- * @return Returns the current highlight status.
- */
- public boolean isHighlighted()
- {
- return highlight;
- }
-
- /**
- * @param highlight
- * The highlight to set.
- */
- public void setHighlight(boolean highlight)
- {
- this.highlight = highlight;
- // Update our connection to use the correct colouring
- boolean highContrast = false;
- try
- {
- highContrast = Display.getDefault().getHighContrast();
- }
- catch (Exception e)
- {
- }
- if (highContrast)
- {
- setForegroundColor(highlight ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND) : ColorConstants.lightGray);
- }
- else
- {
- setForegroundColor(highlight ? activeConnection : inactiveConnection);
- }
- setOpaque(highlight);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java
deleted file mode 100644
index dbeb88e177..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public abstract class AbstractModelCollection implements IADTObject
-{
- protected IADTObject model;
- protected String kind;
-
- public AbstractModelCollection(IADTObject model, String kind)
- {
- this.model = model;
- this.kind = kind;
- }
-
- public Object getModel()
- {
- return model;
- }
-
- public void setModel(IADTObject model)
- {
- this.model = model;
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public abstract List getChildren();
-
- public void registerListener(IADTObjectListener listener)
- {
- model.registerListener(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- model.unregisterListener(listener);
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java
deleted file mode 100644
index 1f67a7fdd8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java
+++ /dev/null
@@ -1,37 +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.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class Annotation
-{
- Compartment compartment;
- public Annotation()
- {
- super();
- }
-
- public void setCompartment(Compartment compartment)
- {
- this.compartment = compartment;
- }
-
- public Compartment getCompartment()
- {
- return compartment;
- }
-
- public IStructure getOwner()
- {
- return compartment.getOwner();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java
deleted file mode 100644
index 628cd4f8ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java
+++ /dev/null
@@ -1,73 +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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class Compartment implements IADTObject
-{
- String kind;
- IStructure owner;
-
- public Compartment(IStructure owner, String kind)
- {
- this.kind = kind;
- this.owner = owner;
- }
-
- public List getChildren()
- {
- List list = new ArrayList();
- for (Iterator i = owner.getFields().iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- if (kind == null || kind.equals(field.getKind()))
- {
- list.add(field);
- }
- }
- return list;
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public IStructure getOwner()
- {
- return owner;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- // really we want to listen to the owner
- owner.registerListener(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- // really we want to listen to the owner
- owner.unregisterListener(listener);
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java
deleted file mode 100644
index 60a6fc19c2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class FocusTypeColumn extends AbstractModelCollection
-{
- protected boolean isFocusObject = false;
-
- public FocusTypeColumn(IADTObject model)
- {
- super(model, "FocusTypeColumn"); //$NON-NLS-1$
- }
-
- public FocusTypeColumn(IADTObject model, boolean isFocusObject)
- {
- super(model, "FocusTypeColumn"); //$NON-NLS-1$
- this.isFocusObject = isFocusObject;
- }
-
- public List getChildren()
- {
- List result = new ArrayList();
- if (model instanceof IType)
- {
- IType type = (IType)model;
- if (type.getSuperType() != null)
- {
- result.add(type.getSuperType());
- }
- result.add(type);
- }
- else if (model instanceof IField ||
- model instanceof IStructure)
- {
- result.add(model);
- }
- return result;
- }
-
- public boolean isFocusObject()
- {
- return isFocusObject;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java
deleted file mode 100644
index d8443fa552..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.design.editparts.model;
-
-
-
-public interface IActionProvider
-{
- public String[] getActions(Object object);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java
deleted file mode 100644
index 18e860b330..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.adt.design.editparts.model;
-
-public interface IFeedbackHandler
-{
- public void addFeedback();
- public void removeFeedback();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
deleted file mode 100644
index 9b2f5cba55..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.gef.commands.Command;
-
-public interface IGraphElement
-{
- boolean isFocusAllowed();
- IADTObject getTopContainer();
- Command getDeleteCommand();
- IModel getModel();
- boolean isReadOnly();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java
deleted file mode 100644
index f263c38dd6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-
-public interface IModelProxy
-{
- IModel getModel();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java
deleted file mode 100644
index 95f8970e0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java
+++ /dev/null
@@ -1,138 +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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class ReferencedTypeColumn extends AbstractModelCollection
-{
- List listenerList = new ArrayList();
- InternalListener internalListener = new InternalListener();
-
- // todo... really this this model object should listen
- // to the parent of the IType
- //
- public ReferencedTypeColumn(IADTObject model)
- {
- super(model, "ReferencedTypeColumn"); //$NON-NLS-1$
- model.registerListener(internalListener);
- internalListener.recomputeSubListeners();
- }
-
- public List getChildren()
- {
- List result = new ArrayList();
- if (model instanceof IStructure)
- {
- IStructure structure = (IStructure)model;
- for (Iterator i = structure.getFields().iterator(); i.hasNext(); )
- {
- IField field = (IField)i.next();
- IType type = field.getType();
- if (type != null) // && type.isComplexType())
- {
- if (!result.contains(type))
- {
- if (type instanceof IGraphElement)
- {
- if (((IGraphElement)type).isFocusAllowed())
- result.add(type);
- }
- }
- }
- }
- }
- else if (model instanceof IField)
- {
- IField field = (IField)model;
- IType type = field.getType();
- if (type != null) // && type.isComplexType())
- {
- if (type instanceof IGraphElement)
- {
- if (((IGraphElement)type).isFocusAllowed())
- result.add(type);
- }
- }
- }
- return result;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- listenerList.add(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- listenerList.remove(listener);
- }
-
- protected void notifyListeners(Object changedObject, String property)
- {
- List clonedListenerList = new ArrayList();
- clonedListenerList.addAll(listenerList);
- for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
- {
- IADTObjectListener listener = (IADTObjectListener)i.next();
- listener.propertyChanged(this, null);
- }
- }
-
- protected class InternalListener implements IADTObjectListener
- {
- List fields = new ArrayList();
-
- void recomputeSubListeners()
- {
- if (model instanceof IStructure)
- {
- // remove old ones
- for (Iterator i = fields.iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- field.unregisterListener(this);
- }
- // add new ones
- fields.clear();
- IStructure complexType = (IStructure) model;
- for (Iterator i = complexType.getFields().iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- fields.add(field);
- field.registerListener(this);
- }
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (object == model)
- {
- // we need to update the fields we're listening too
- // since these may have changed
- recomputeSubListeners();
- }
- else if (object instanceof IField)
- {
- }
- notifyListeners(object, property);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/RootHolder.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/RootHolder.java
deleted file mode 100644
index ca7b3a6225..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/RootHolder.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 22007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-public class RootHolder
-{
- IADTObject model;
-
- public RootHolder(IADTObject model)
- {
- this.model = model;
- }
-
- public IADTObject getModel()
- {
- return model;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java
deleted file mode 100644
index b7f22b30a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java
+++ /dev/null
@@ -1,46 +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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ComboBoxCellEditorManager;
-
-public class ADTDirectEditPolicy extends DirectEditPolicy
-{
- protected ComboBoxCellEditorManager delegate;
- protected IADTUpdateCommand command;
-
- public ADTDirectEditPolicy()
- {
- super();
- }
-
-
- public void setUpdateCommand(IADTUpdateCommand command)
- {
- this.command = command;
- }
-
- protected void showCurrentEditValue(DirectEditRequest request)
- {
- getHostFigure().getUpdateManager().performUpdate();
- }
-
- protected Command getDirectEditCommand(DirectEditRequest request)
- {
- command.setRequest(request);
- return (Command)command;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
deleted file mode 100644
index 0747165e75..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-
-public class ADTSelectionFeedbackEditPolicy extends SelectionEditPolicy
-{
-
- public ADTSelectionFeedbackEditPolicy()
- {
- super();
- }
-
- protected void hideSelection()
- {
- if (getHost() instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) getHost()).removeFeedback();
- }
- }
-
- protected void showSelection()
- {
- if (getHost() instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) getHost()).addFeedback();
- }
- }
-
- protected void showFocus()
- {
- super.showFocus();
- getHost().setFocus(true);
- }
-
- protected void hideFocus()
- {
- super.hideFocus();
- getHost().setFocus(false);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java
deleted file mode 100644
index 151b493512..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.jface.viewers.CellEditor;
-
-public interface DirectEditPolicyDelegate
-{
- public void performEdit(CellEditor cellEditor);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java
deleted file mode 100644
index a4c4eb50bb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.requests.DirectEditRequest;
-
-public interface IADTUpdateCommand
-{
- void setRequest(DirectEditRequest request);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java
deleted file mode 100644
index dd0ee63e22..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java
+++ /dev/null
@@ -1,28 +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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-
-public class KeyBoardAccessibilityEditPolicy extends GraphicalEditPolicy
-{
- public static String KEY = "KeyBoardAccessibilityEditPolicy";
-
- public static int OUT_TO_PARENT = PositionConstants.ALWAYS_LEFT;
- public static int IN_TO_FIRST_CHILD = PositionConstants.ALWAYS_RIGHT;
-
- public EditPart getRelativeEditPart(EditPart editPart, int direction)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java
deleted file mode 100644
index 4e38e39f6e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java
+++ /dev/null
@@ -1,58 +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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-
-public class SimpleDirectEditPolicy extends DirectEditPolicy
-{
- protected DirectEditPolicyDelegate delegate;
-
- public void setDelegate(DirectEditPolicyDelegate delegate)
- {
- this.delegate = delegate;
- }
-
- protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request)
- {
- return new Command() //AbstractCommand()
- {
- public void execute()
- {
- if (delegate != null)
- {
- delegate.performEdit(request.getCellEditor());
- }
- }
-
- public void redo()
- {
- }
-
- public void undo()
- {
- }
-
- public boolean canExecute()
- {
- return true;
- }
- };
- }
-
- protected void showCurrentEditValue(DirectEditRequest request)
- {
- //hack to prevent async layout from placing the cell editor twice.
- getHostFigure().getUpdateManager().performUpdate();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java
deleted file mode 100644
index 284a26043b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java
+++ /dev/null
@@ -1,22 +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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-
-public interface IADTFigure extends IFigure
-{
- void editPartAttached(EditPart owner);
- void addSelectionFeedback();
- void removeSelectionFeedback();
- void refreshVisuals(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java
deleted file mode 100644
index 3e25deff34..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java
+++ /dev/null
@@ -1,19 +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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface ICompartmentFigure extends IADTFigure
-{
- IFigure getContentPane();
- IFigure getAnnotationPane();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java
deleted file mode 100644
index efabeb0e68..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java
+++ /dev/null
@@ -1,23 +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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.Label;
-
-
-public interface IFieldFigure extends IADTFigure
-{
- Label getTypeLabel();
- Label getNameLabel();
- Label getNameAnnotationLabel();
- Label getTypeAnnotationLabel();
- void recomputeLayout();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java
deleted file mode 100644
index d6efe614c4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.design.figures;
-
-public interface IFigureFactory
-{
- IFieldFigure createFieldFigure(Object model);
- IStructureFigure createStructureFigure(Object model);
- ICompartmentFigure createCompartmentFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java
deleted file mode 100644
index 5a96af2019..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java
+++ /dev/null
@@ -1,22 +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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface IStructureFigure extends IADTFigure
-{
- IFigure getContentPane();
- Label getNameLabel();
- boolean hitTestHeader(Point point);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java
deleted file mode 100644
index 46ac99a38a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java
+++ /dev/null
@@ -1,26 +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.xsd.ui.internal.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-
-public interface ComponentReferenceEditManager
-{
- public IComponentDialog getBrowseDialog();
- public IComponentDialog getNewDialog();
- public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent);
- public IComponentDescriptionProvider getComponentDescriptionProvider();
-
- public ComponentSpecification[] getQuickPicks();
- public ComponentSpecification[] getHistory();
- public void addToHistory(ComponentSpecification component);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager2.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager2.java
deleted file mode 100644
index c01312da73..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager2.java
+++ /dev/null
@@ -1,19 +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.wst.xsd.ui.internal.adt.edit;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-public interface ComponentReferenceEditManager2 extends ComponentReferenceEditManager
-{
- void setReferencer(IADTObject field);
- IADTObject getReferencer();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java
deleted file mode 100644
index 4194f9b5b4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java
+++ /dev/null
@@ -1,31 +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.xsd.ui.internal.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-
-public interface IComponentDialog {
-
- /*
- * Set the Object being set
- */
- public void setInitialSelection(ComponentSpecification componentSpecification);
-
- /*
- * Return the Object which should be used as the type.
- */
- public ComponentSpecification getSelectedComponent();
-
- /*
- * Used to open the Dialog
- */
- public int createAndOpen();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java
deleted file mode 100644
index 96bf76a6d5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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
- * Jesper Steen Moller - added resolver lookups
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.editor;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.eclipse.core.resources.IEncodedStorage;
-import org.eclipse.core.resources.IResourceStatus;
-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.Platform;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class ADTExternalResourceVariant extends PlatformObject
-{
- private IStorage storage;
- private String urlString;
-
- public static String getCharset(String name, InputStream stream) throws IOException
- {
- IContentDescription description = getContentDescription(name, stream);
- return description == null ? null : description.getCharset();
- }
-
- public static IContentDescription getContentDescription(String name, InputStream stream) throws IOException
- {
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- try
- {
- return contentTypeManager.getDescriptionFor(stream, name, IContentDescription.ALL);
- }
- finally
- {
- if (stream != null)
- {
- try
- {
- stream.close();
- }
- catch (IOException e)
- {
-
- }
- }
- }
- }
-
- public ADTExternalResourceVariant(String urlString)
- {
- this.urlString = urlString;
- }
-
- class XSDResourceVariantStorage implements IEncodedStorage
- {
-
- public InputStream getContents() throws CoreException
- {
- try
- {
- String physicalUrlString = URIResolverPlugin.createResolver().resolvePhysicalLocation(null, null, urlString);
- URL url = new URL(physicalUrlString);
- URLConnection urlConnection = url.openConnection();
- return urlConnection.getInputStream();
- }
- catch (SocketTimeoutException toException)
- {
- // handle
- }
- catch (IOException e)
- {
-
- }
- return new ByteArrayInputStream(new byte[0]);
- }
-
- public IPath getFullPath()
- {
- // Since this is loaded from an URL, this should never be interpreted as a path
- return null;
- }
-
- public String getName()
- {
- return urlString;
- }
-
- public boolean isReadOnly()
- {
- return true;
- }
-
- public Object getAdapter(Class adapter)
- {
- return ADTExternalResourceVariant.this.getAdapter(adapter);
- }
-
- public String getCharset() throws CoreException
- {
- InputStream contents = getContents();
- try
- {
- String charSet = ADTExternalResourceVariant.getCharset(getName(), contents);
- return charSet;
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, XSDEditorPlugin.PLUGIN_ID, IResourceStatus.FAILED_DESCRIBING_CONTENTS, NLS.bind("", new String[] { getFullPath().toString() }), e));
- }
- finally
- {
- try
- {
- contents.close();
- }
- catch (IOException ioException)
- {
-
- }
- }
- }
- }
-
- public IStorage getStorage()
- {
- if (storage == null)
- {
- storage = new XSDResourceVariantStorage();
- }
- return storage;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTFileStoreEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTFileStoreEditorInput.java
deleted file mode 100644
index d9fc877296..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTFileStoreEditorInput.java
+++ /dev/null
@@ -1,60 +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.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-public class ADTFileStoreEditorInput extends FileStoreEditorInput implements IADTEditorInput
-{
- private XSDSchema schema;
- private String editorName;
-
- public ADTFileStoreEditorInput(IFileStore fileStore, XSDSchema xsdSchema)
- {
- super(fileStore);
- this.schema = xsdSchema;
- }
-
- public XSDSchema getSchema()
- {
- return schema;
- }
-
- public void setEditorName(String name)
- {
- editorName = name;
- }
-
- public String getName()
- {
- if (editorName != null)
- {
- return editorName;
- }
- return super.getName();
- }
-
- public String getToolTipText()
- {
- if (schema != null)
- {
- String ns = schema.getTargetNamespace();
- if (ns != null && ns.length() > 0)
- return Messages._UI_LABEL_TARGET_NAMESPACE + ns;
- else
- return Messages._UI_LABEL_NO_NAMESPACE;
- }
- return super.getToolTipText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
deleted file mode 100644
index dbd3b7ce24..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.editor;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.SelectionManager;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.design.ADTFloatingToolbar;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ADTEditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ExtensibleContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public abstract class ADTMultiPageEditor extends CommonMultiPageEditor
-{
- protected IModel model;
- private int currentPage = -1;
- protected Button tableOfContentsButton;
- protected ADTFloatingToolbar floatingToolbar;
- private IContextActivation contextActivation;
- public final static String DESIGN_VIEW_CONTEXT = "org.eclipse.wst.xsd.ui.editor.designView"; //$NON-NLS-1$
- public final static String SOURCE_VIEW_CONTEXT = "org.eclipse.wst.xsd.ui.editor.sourceView"; //$NON-NLS-1$
-
- /**
- * Creates a multi-page editor example.
- */
- public ADTMultiPageEditor()
- {
- super();
- }
-
-
- private class InternalLayout extends StackLayout
- {
- public InternalLayout()
- {
- super();
- }
-
- protected void layout(Composite composite, boolean flushCache)
- {
- Control children[] = composite.getChildren();
- Rectangle rect = composite.getClientArea();
- rect.x += marginWidth;
- rect.y += marginHeight;
- rect.width -= 2 * marginWidth;
- rect.height -= 2 * marginHeight;
-
- for (int i = 0; i < children.length; i++)
- {
- if (i == 0) // For the back to schema button
- {
- org.eclipse.draw2d.geometry.Rectangle r = ((GraphicalEditPart)floatingToolbar.getContents()).getFigure().getBounds();
- children[i].setBounds(rect.x + 10, rect.y + 10, r.width, Math.max(24, r.height));
- }
- else if (i == 1 && modeCombo != null) // For the drop down toolbar
- {
- children[i].setBounds(rect.x + rect.width - 90 - maxLength, rect.y + 10, maxLength + 60, 26);
- }
- else // For the main graph viewer
- {
- children[i].setBounds(rect);
- }
- }
- }
- }
-
- protected Composite createGraphPageComposite()
- {
- Composite parent = new Composite(getContainer(), SWT.FLAT);
- parent.setBackground(ColorConstants.white);
-
- parent.setLayout(new InternalLayout());
-
- floatingToolbar = new ADTFloatingToolbar(getModel());
- floatingToolbar.createControl(parent);
- floatingToolbar.getControl().setVisible(true);
- EditPartFactory editPartFactory = getEditorModeManager().getCurrentMode().getEditPartFactory();
- floatingToolbar.setEditPartFactory(editPartFactory);
-
- createViewModeToolbar(parent);
-
- return parent;
- }
-
- protected void createGraphPage()
- {
- super.createGraphPage();
-// toolbarViewer.getControl().moveAbove(graphicalViewer.getControl());
-// graphicalViewer.getControl().moveBelow(toolbarViewer.getControl());
- }
-
- public String getContributorId()
- {
- return "org.eclipse.wst.xsd.ui.internal.editor"; //$NON-NLS-1$
- }
-
- public IContentOutlinePage getContentOutlinePage()
- {
- if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed())
- {
- final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class);
- ExtensibleContentOutlinePage outlinePage = null;
- if (productCustomizationProvider != null)
- {
- outlinePage = productCustomizationProvider.getProductContentOutlinePage();
- }
-
- if (outlinePage == null)
- {
- outlinePage = new ADTContentOutlinePage();
- }
- outlinePage.setEditor(this);
- ITreeContentProvider provider = (ITreeContentProvider)getEditorModeManager().getCurrentMode().getOutlineProvider();
- outlinePage.setContentProvider(provider);
- ADTLabelProvider adtLabelProvider = new ADTLabelProvider();
- outlinePage.setLabelProvider(adtLabelProvider);
- outlinePage.setModel(getModel());
- fOutlinePage = outlinePage;
- }
- return fOutlinePage;
- }
-
- /**
- * Creates the pages of the multi-page editor.
- */
- protected void createPages()
- {
- selectionProvider = getSelectionManager();
-
- createGraphPage();
- createSourcePage();
-
- getEditorSite().setSelectionProvider(selectionProvider);
-
- model = buildModel(); // (IFileEditorInput)getEditorInput());
-
- initializeGraphicalViewer();
- floatingToolbar.setModel(model);
-
- int pageIndexToShow = getDefaultPageTypeIndex();
- setActivePage(pageIndexToShow);
- }
-
- protected int getDefaultPageTypeIndex() {
- int pageIndex = SOURCE_PAGE_INDEX;
- if (XSDEditorPlugin.getPlugin().getDefaultPage().equals(XSDEditorPlugin.DESIGN_PAGE)) {
- pageIndex = DESIGN_PAGE_INDEX;
- }
-
- return pageIndex;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus()
- {
- super.setFocus();
- if (getActivePage() == DESIGN_PAGE_INDEX)
- {
- if (graphicalViewer != null && graphicalViewer.getControl() != null)
- {
- List selected = graphicalViewer.getSelectedEditParts();
- if (selected.size() > 0)
- {
- graphicalViewer.setFocus((EditPart)selected.get(0));
- }
- graphicalViewer.getControl().setFocus();
-
- }
- }
- else
- {
- graphicalViewer.setFocus(null);
- }
- }
-
- protected void pageChange(int newPageIndex)
- {
- deactivateContext(contextActivation);
- currentPage = newPageIndex;
- super.pageChange(newPageIndex);
-
- String context = getContext(currentPage);
- contextActivation = activateContext(context);
-
- if (newPageIndex == DESIGN_PAGE_INDEX)
- {
- ISelection selection = graphicalViewer.getSelectionManager().getSelection();
- Object model = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- // While in the source view, selection could have changed.
- // Will try to select the first item when switching back to the design view.
- // We currently do not multi-select figures if multiple elements are selected in the source view.
- // For example, if multiple global elements are selected, the graph view will be in the details view
- // of the first one.
- Object elem = structuredSelection.getFirstElement();
- if (elem instanceof EditPart)
- model = ((EditPart)elem).getModel();
- }
- // Refresh the design page upon page change
- graphicalViewer.getContents().refresh();
- // Need to use the adapter, since after refresh, the old edit part will have been replaced
- // Maintain previous selection:
- if (model != null)
- {
- getSelectionManager().setSelection(new StructuredSelection(model));
- }
- }
- setFocus();
- }
-
- private boolean isTableOfContentsApplicable(Object graphViewInput)
- {
- return !(graphViewInput instanceof IModel);
- }
-
- protected ScrollingGraphicalViewer getGraphicalViewer()
- {
- DesignViewGraphicalViewer viewer = new DesignViewGraphicalViewer(this, getSelectionManager());
- viewer.addInputChangdListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection input = (IStructuredSelection)event.getSelection();
- floatingToolbar.refresh(isTableOfContentsApplicable(input.getFirstElement()));
- }
- });
- // Workaround bug 227687 An edit part's focus state is not updated properly
- // Once this is bug is fixed, we can remove custom selection manager
- viewer.setSelectionManager(new CustomSelectionManager());
- return viewer;
- }
-
- // Workaround bug 227687 An edit part's focus state is not updated properly
- // Once this is bug is fixed, we can remove this class
- private class CustomSelectionManager extends SelectionManager
- {
- public void appendSelection(EditPart editpart)
- {
- if (editpart != getFocus())
- getViewer().setFocus(editpart);
- super.appendSelection(editpart);
- }
- }
-
- abstract public IModel buildModel(); // (IFileEditorInput editorInput);
-
- protected void createActions()
- {
- ActionRegistry registry = getActionRegistry();
-
- BaseSelectionAction action = new SetInputToGraphView(this);
- action.setSelectionProvider(getSelectionManager());
- registry.registerAction(action);
- }
-
-
- public IModel getModel()
- {
- return model;
- }
-
- public Object getAdapter(Class type)
- {
- if (type == ZoomManager.class)
- return graphicalViewer.getProperty(ZoomManager.class.toString());
-
- if (type == GraphicalViewer.class)
- return graphicalViewer;
- if (type == EditPart.class && graphicalViewer != null)
- return graphicalViewer.getRootEditPart();
- if (type == IFigure.class && graphicalViewer != null)
- return ((GraphicalEditPart) graphicalViewer.getRootEditPart()).getFigure();
-
- if (type == IContentOutlinePage.class)
- {
- return getContentOutlinePage();
- }
-
- return super.getAdapter(type);
- }
-
- protected EditPartFactory getEditPartFactory() {
- return new ADTEditPartFactory();
- }
-
- protected void initializeGraphicalViewer()
- {
- graphicalViewer.setContents(model);
- }
-
- public void dispose()
- {
- if (currentPage == SOURCE_PAGE_INDEX)
- {
- XSDEditorPlugin.getPlugin().setSourcePageAsDefault();
- }
- else
- {
- XSDEditorPlugin.getPlugin().setDesignPageAsDefault();
- }
- floatingToolbar = null;
- deactivateContext(contextActivation);
- super.dispose();
- }
- protected String getContext(int pageIndex) {
- if (pageIndex == DESIGN_PAGE_INDEX) {
- return DESIGN_VIEW_CONTEXT;
- } else if (pageIndex == SOURCE_PAGE_INDEX) {
- return SOURCE_VIEW_CONTEXT;
- }
-
- return null;
- }
- private IContextActivation activateContext(String context) {
- IContextService contextService = (IContextService) getSite().getService(IContextService.class);
-
- if (contextService != null && context != null) {
- return contextActivation = contextService.activateContext(context);
- }
- return null;
- }
-
- private void deactivateContext(IContextActivation contextActivation) {
- IContextService contextService = (IContextService) getSite().getService(IContextService.class);
-
- if (contextService != null && contextActivation != null) {
- contextService.deactivateContext(contextActivation);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTReadOnlyFileEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTReadOnlyFileEditorInput.java
deleted file mode 100644
index b5fd8d2c51..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTReadOnlyFileEditorInput.java
+++ /dev/null
@@ -1,135 +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.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- *
- * Used for any read-only files, ie. HTTP files.
- *
- */
-public class ADTReadOnlyFileEditorInput implements IStorageEditorInput, IADTEditorInput
-{
- protected String urlString;
- protected IStorage storage;
- protected ADTExternalResourceVariant variant;
- protected XSDSchema xsdSchema;
- protected String editorName;
- protected String editorID = "";
-
- public ADTReadOnlyFileEditorInput(String urlString)
- {
- this.urlString = urlString;
- variant = new ADTExternalResourceVariant(urlString);
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
- if (o == this)
- return true;
-
- if (o instanceof ADTReadOnlyFileEditorInput)
- {
- ADTReadOnlyFileEditorInput input = (ADTReadOnlyFileEditorInput) o;
-
- return urlString.equals(input.getUrlString()) && input.getEditorID().equals(editorID);
- }
-
- return false;
- }
-
- public String getUrlString()
- {
- return urlString;
- }
-
- public IStorage getStorage() throws CoreException
- {
- storage = variant.getStorage();
- return storage;
- }
-
- public boolean exists()
- {
- return false;
- }
-
- public ImageDescriptor getImageDescriptor()
- {
- return null;
- }
-
- public String getName()
- {
- if (editorName == null)
- {
- URI uri = URI.createURI(urlString);
- return uri.lastSegment();
- }
- return editorName;
- }
-
- public IPersistableElement getPersistable()
- {
- // http files cannot persist
- return null;
- }
-
- public String getToolTipText()
- {
- return urlString;
- }
-
- public Object getAdapter(Class adapter)
- {
- if (adapter == IWorkbenchAdapter.class)
- return this;
- if (adapter == IStorage.class)
- return storage;
- return null;
- }
-
- public void setSchema(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- public XSDSchema getSchema()
- {
- return xsdSchema;
- }
-
- public void setEditorName(String name)
- {
- editorName = name;
- }
-
- public void setEditorID(String editorID)
- {
- this.editorID = editorID;
- }
-
- public String getEditorID()
- {
- return editorID;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java
deleted file mode 100644
index 148cc02b3f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java
+++ /dev/null
@@ -1,942 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.editor;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.MouseWheelHandler;
-import org.eclipse.gef.MouseWheelZoomHandler;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.editparts.LayerManager;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.actions.ZoomInAction;
-import org.eclipse.gef.ui.actions.ZoomOutAction;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.gef.ui.parts.SelectionSynchronizer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageEditorSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewerGraphicConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.design.FlatCCombo;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public abstract class CommonMultiPageEditor extends MultiPageEditorPart implements IResourceChangeListener, CommandStackListener, ITabbedPropertySheetPageContributor, IPropertyListener, IEditorModeListener
-{
- public static int SOURCE_PAGE_INDEX = 1, DESIGN_PAGE_INDEX = 0;
-
- protected IContentOutlinePage fOutlinePage;
- protected DefaultEditDomain editDomain;
- protected SelectionSynchronizer synchronizer;
- protected ActionRegistry actionRegistry;
- protected StructuredTextEditor structuredTextEditor;
- protected CommonSelectionManager selectionProvider;
- protected ScrollingGraphicalViewer graphicalViewer;
- protected EditorModeManager editorModeManager;
- protected FlatCCombo modeCombo;
- private EditorModeAndCustomizedName[] editorModeAndCustomizedNames;
- protected Composite toolbar;
- protected ModeComboListener modeComboListener;
- protected int maxLength = 0;
- protected CommonActivationListener fActivationListener;
-
- public CommonMultiPageEditor()
- {
- super();
- editDomain = new DefaultEditDomain(this)
- {
- public void mouseDown(MouseEvent mouseEvent, EditPartViewer viewer)
- {
- boolean eatTheEvent = false;
- LayerManager manager = (LayerManager)viewer.getEditPartRegistry().get(LayerManager.ID);
- IFigure layer = manager.getLayer(DesignViewerGraphicConstants.SCALED_HANDLE_LAYER);
- if (layer != null)
- {
- Point p = new Point(mouseEvent.x, mouseEvent.y);
- layer.translateToRelative(p);
- IFigure figure = layer.findFigureAt(p);
- if (figure != null && figure != layer)
- {
- // we eat this selection event!
- eatTheEvent = true;
- }
- }
- if (!eatTheEvent)
- {
- super.mouseDown(mouseEvent, viewer);
- }
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
- */
- public abstract String getContributorId();
-
-
- /**
- *
- */
- protected abstract void createActions();
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
- */
- protected void createPages()
- {
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor)
- {
-// getEditor(1).doSave(monitor);
- structuredTextEditor.doSave(monitor);
- getCommandStack().markSaveLocation();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSaveAs()
- */
- public void doSaveAs()
- {
- IEditorPart editor = getEditor(1);
-// editor.doSaveAs();
- structuredTextEditor.doSaveAs();
- setInput(structuredTextEditor.getEditorInput());
- setPartName(editor.getTitle());
- getCommandStack().markSaveLocation();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- *
- * Closes all project files on project close.
- */
- public void resourceChanged(final IResourceChangeEvent event)
- {
- if (event.getType() == IResourceChangeEvent.PRE_CLOSE)
- {
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
- for (int i = 0; i < pages.length; i++)
- {
- if (((FileEditorInput) structuredTextEditor.getEditorInput()).getFile().getProject().equals(event.getResource()))
- {
- IEditorPart editorPart = pages[i].findEditor(structuredTextEditor.getEditorInput());
- pages[i].closeEditor(editorPart, true);
- }
- }
- }
- });
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.commands.CommandStackListener#commandStackChanged(java.util.EventObject)
- */
- public void commandStackChanged(EventObject event)
- {
- firePropertyChange(PROP_DIRTY);
- }
-
- /**
- * Indicates that a property has changed.
- *
- * @param source
- * the object whose property has changed
- * @param propId
- * the id of the property which has changed; property ids are
- * generally defined as constants on the source class
- */
- public void propertyChanged(Object source, int propId)
- {
- switch (propId)
- {
- // had to implement input changed "listener" so that
- // strucutedText could tell it containing editor that
- // the input has change, when a 'resource moved' event is
- // found.
- case IEditorPart.PROP_INPUT :
- case IEditorPart.PROP_DIRTY : {
- if (source == structuredTextEditor)
- {
- if (structuredTextEditor.getEditorInput() != getEditorInput())
- {
- setInput(structuredTextEditor.getEditorInput());
- // title should always change when input changes.
- // create runnable for following post call
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- _firePropertyChange(IWorkbenchPart.PROP_TITLE);
- }
- };
- // Update is just to post things on the display queue
- // (thread). We have to do this to get the dirty
- // property to get updated after other things on the
- // queue are executed.
- postOnDisplayQue(runnable);
- }
- }
- break;
- }
- case IWorkbenchPart.PROP_TITLE : {
- // update the input if the title is changed
- if (source == structuredTextEditor)
- {
- if (structuredTextEditor.getEditorInput() != getEditorInput())
- {
- setInput(structuredTextEditor.getEditorInput());
- }
- }
- break;
- }
- default : {
- // propagate changes. Is this needed? Answer: Yes.
- if (source == structuredTextEditor)
- {
- firePropertyChange(propId);
- }
- break;
- }
- }
- }
-
- // Should override to set the input to the design viewer for a new document change
- // ie. when doing a saveAs
- protected void setInputToGraphicalViewer(IDocument newInput)
- {
- }
-
- protected void setInput(IEditorInput input)
- {
- super.setInput(input);
- if (graphicalViewer != null)
- {
- setInputToGraphicalViewer(getDocument());
- }
- }
-
- protected IDocument getDocument()
- {
- IDocument document = null;
- if (structuredTextEditor != null)
- {
- document = structuredTextEditor.getDocumentProvider().getDocument(structuredTextEditor.getEditorInput());
- }
- return document;
- }
-
- /**
- * @return
- */
- protected SelectionSynchronizer getSelectionSynchronizer()
- {
- if (synchronizer == null)
- synchronizer = new SelectionSynchronizer();
- return synchronizer;
- }
-
- public CommonSelectionManager getSelectionManager()
- {
- if (selectionProvider == null)
- {
- selectionProvider = new CommonSelectionManager(this);
- }
- return selectionProvider;
- }
-
- /*
- * This method is just to make firePropertyChanged accessbible from some
- * (anonomous) inner classes.
- */
- protected void _firePropertyChange(int property)
- {
- super.firePropertyChange(property);
- }
-
- /**
- * Posts the update code "behind" the running operation.
- */
- protected void postOnDisplayQue(Runnable runnable)
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- if (windows != null && windows.length > 0)
- {
- Display display = windows[0].getShell().getDisplay();
- display.asyncExec(runnable);
- }
- else
- runnable.run();
- }
-
- /**
- * The <code>MultiPageEditorPart</code> implementation of this
- * <code>IWorkbenchPart</code> method disposes all nested editors.
- * Subclasses may extend.
- */
- public void dispose()
- {
- getCommandStack().removeCommandStackListener(this);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- actionRegistry.dispose();
-
- if (structuredTextEditor != null) {
- structuredTextEditor.removePropertyListener(this);
- }
- structuredTextEditor = null;
- editDomain = null;
- fOutlinePage = null;
- synchronizer = null;
- actionRegistry = null;
- selectionProvider = null;
- graphicalViewer = null;
- if (modeCombo != null && !modeCombo.isDisposed())
- {
- modeCombo.removeSelectionListener(modeComboListener);
- modeComboListener = null;
- }
-
- if (fActivationListener != null) {
- fActivationListener.dispose();
- fActivationListener = null;
- }
-
- super.dispose();
- }
-
- protected CommandStack getCommandStack()
- {
- return editDomain.getCommandStack();
- }
-
- /*
- * (non-Javadoc) Method declared on IEditorPart
- */
- public void gotoMarker(IMarker marker)
- {
- setActivePage(SOURCE_PAGE_INDEX);
- IDE.gotoMarker(structuredTextEditor, marker);
- }
-
- /**
- * The <code>MultiPageEditorExample</code> implementation of this method
- * checks that the input is an instance of <code>IFileEditorInput</code>.
- */
- public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException
- {
- super.init(site, editorInput);
-
- getCommandStack().addCommandStackListener(this);
-
- initializeActionRegistry();
-
- String title = null;
- if (getEditorInput() != null) {
- title = getEditorInput().getName();
- }
- setPartName(title);
-
- fActivationListener = new CommonActivationListener(site.getWorkbenchWindow().getPartService());
- }
-
- protected void initializeActionRegistry()
- {
- createActions();
- }
-
- protected ActionRegistry getActionRegistry()
- {
- if (actionRegistry == null)
- actionRegistry = new ActionRegistry();
- return actionRegistry;
- }
-
- public Object getAdapter(Class type)
- {
- if (type == CommandStack.class)
- return getCommandStack();
- if (type == ActionRegistry.class)
- return getActionRegistry();
- if (type == EditorModeManager.class)
- return getEditorModeManager();
- if (type == IGotoMarker.class) {
- return new IGotoMarker() {
- public void gotoMarker(IMarker marker) {
- CommonMultiPageEditor.this.gotoMarker(marker);
- }
- };
- }
- if (type == ITextEditor.class)
- return getTextEditor();
-
- return super.getAdapter(type);
- }
-
- protected DefaultEditDomain getEditDomain()
- {
- return editDomain;
- }
-
- /**
- * From GEF GraphicalEditor A convenience method for updating a set of actions
- * defined by the given List of action IDs. The actions are found by looking
- * up the ID in the {@link #getActionRegistry() action registry}. If the
- * corresponding action is an {@link UpdateAction}, it will have its
- * <code>update()</code> method called.
- *
- * @param actionIds
- * the list of IDs to update
- */
- protected void updateActions(List actionIds)
- {
- ActionRegistry registry = getActionRegistry();
- Iterator iter = actionIds.iterator();
- while (iter.hasNext())
- {
- IAction action = registry.getAction(iter.next());
- if (action instanceof UpdateAction)
- ((UpdateAction) action).update();
- }
- }
-
- public StructuredTextEditor getTextEditor()
- {
- return structuredTextEditor;
- }
-
- protected Composite createGraphPageComposite()
- {
- Composite parent = new Composite(getContainer(), SWT.NONE);
- parent.setLayout(new FillLayout());
- return parent;
- }
-
- protected void createGraphPage()
- {
- Composite parent = createGraphPageComposite();
-
- graphicalViewer = getGraphicalViewer();
- graphicalViewer.createControl(parent);
-
- getEditDomain().addViewer(graphicalViewer);
-
- configureGraphicalViewer();
- hookGraphicalViewer();
- int index = addPage(parent);
- setPageText(index, Messages._UI_LABEL_DESIGN);
- }
-
- /**
- * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
- */
- protected IEditorSite createSite(IEditorPart editor) {
- IEditorSite site = null;
- if (editor == structuredTextEditor) {
- site = new MultiPageEditorSite(this, editor) {
- public String getId() {
- // sets this id so nested editor is considered xml source
- // page
- return ContentTypeIdForXML.ContentTypeID_XML + ".source"; //$NON-NLS-1$;
- }
- };
- }
- else {
- site = super.createSite(editor);
- }
- return site;
- }
-
- protected void createSourcePage()
- {
- structuredTextEditor = new StructuredTextEditor();
- try
- {
- int index = addPage(structuredTextEditor, getEditorInput());
- setPageText(index, Messages._UI_LABEL_SOURCE);
- structuredTextEditor.update();
- structuredTextEditor.setEditorPart(this);
- structuredTextEditor.addPropertyListener(this);
- firePropertyChange(PROP_TITLE);
- }
- catch (PartInitException e)
- {
- ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus()); //$NON-NLS-1$
- }
- }
-
- protected void configureGraphicalViewer()
- {
- graphicalViewer.getControl().setBackground(ColorConstants.listBackground);
-
- // Set the root edit part
- // ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
- RootEditPart root = new RootEditPart();
- ZoomManager zoomManager = root.getZoomManager();
-
- List zoomLevelContributions = new ArrayList(3);
- zoomLevelContributions.add(ZoomManager.FIT_ALL);
- zoomLevelContributions.add(ZoomManager.FIT_WIDTH);
- zoomLevelContributions.add(ZoomManager.FIT_HEIGHT);
- zoomManager.setZoomLevelContributions(zoomLevelContributions);
-
- double[] zoomLevels = {.10, .25, .5, .75, 1.0, 1.25, 1.5, 2.0, 2.5, 3, 4, 5};
- zoomManager.setZoomLevels(zoomLevels);
-
- IAction zoomIn = new ZoomInAction(zoomManager);
- IAction zoomOut = new ZoomOutAction(zoomManager);
- getActionRegistry().registerAction(zoomIn);
- getActionRegistry().registerAction(zoomOut);
-
- getSite().getKeyBindingService().registerAction(zoomIn);
- getSite().getKeyBindingService().registerAction(zoomOut);
-
- //ConnectionLayer connectionLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
- //connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
-
- //connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(connectionLayer));
- // connectionLayer.setVisible(false);
-
- // Zoom
- zoomManager.setZoom(1.0);
- // Scroll-wheel Zoom
- graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
- graphicalViewer.setRootEditPart(root);
- graphicalViewer.setEditPartFactory(getEditPartFactory());
- }
-
- protected void hookGraphicalViewer()
- {
- getSelectionSynchronizer().addViewer(graphicalViewer);
- }
-
- protected abstract ScrollingGraphicalViewer getGraphicalViewer();
- protected abstract EditPartFactory getEditPartFactory();
- protected abstract void initializeGraphicalViewer();
-
- protected EditorModeManager getEditorModeManager()
- {
- if (editorModeManager == null)
- {
- editorModeManager = createEditorModeManager();
- editorModeManager.addListener(this);
- editorModeManager.init();
- }
- return editorModeManager;
- }
-
- protected abstract EditorModeManager createEditorModeManager();
-
-
- private String getEditModeName(EditorMode editorMode, ProductCustomizationProvider productCustomizationProvider)
- {
- String result = editorMode.getDisplayName();
- if (productCustomizationProvider != null)
- {
- String customizedName = productCustomizationProvider.getEditorModeDisplayName(editorMode.getId());
- if (customizedName != null)
- {
- result = customizedName;
- }
- }
- return result;
- }
-
- class EditorModeAndCustomizedName
- {
- EditorMode mode;
- String name;
- }
-
- protected void createViewModeToolbar(Composite parent)
- {
- EditorModeManager manager = (EditorModeManager)getAdapter(EditorModeManager.class);
- final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class);
- EditorMode [] modeList = manager.getModes();
-
- int modeListLength = modeList.length;
- boolean showToolBar = modeListLength > 1;
-
- if (showToolBar)
- {
- toolbar = new Composite(parent, SWT.FLAT | SWT.DRAW_TRANSPARENT);
- toolbar.setBackground(ColorConstants.listBackground);
- toolbar.addPaintListener(new PaintListener() {
-
- public void paintControl(PaintEvent e)
- {
- Rectangle clientArea = toolbar.getClientArea();
- e.gc.setForeground(ColorConstants.lightGray);
- e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width - 1, clientArea.height - 1);
- }
- });
-
- GridLayout gridLayout = new GridLayout(3, false);
- toolbar.setLayout(gridLayout);
-
- Label label = new Label(toolbar, SWT.FLAT | SWT.HORIZONTAL);
- label.setBackground(ColorConstants.listBackground);
- label.setText(Messages._UI_LABEL_VIEW);
- label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
-
- modeCombo = new FlatCCombo(toolbar, SWT.FLAT);
- modeCombo.setEditable(false);
- modeCombo.setText(getEditModeName(manager.getCurrentMode(), productCustomizationProvider));
- GC gc = new GC(modeCombo);
- int textWidth = 0;
- maxLength = 0;
-
- // populate combo with modes
- editorModeAndCustomizedNames = new EditorModeAndCustomizedName[modeListLength];
- for (int i = 0; i < modeListLength; i++)
- {
- EditorModeAndCustomizedName entry = new EditorModeAndCustomizedName();
- editorModeAndCustomizedNames[i] = entry;
- entry.name = getEditModeName(modeList[i], productCustomizationProvider);
- entry.mode = modeList[i];
- }
- Arrays.sort(editorModeAndCustomizedNames, new Comparator()
- {
- public int compare(Object arg0, Object arg1)
- {
- EditorModeAndCustomizedName a = (EditorModeAndCustomizedName)arg0;
- EditorModeAndCustomizedName b = (EditorModeAndCustomizedName)arg1;
- return Collator.getInstance().compare(a.name, b.name);
- }
- });
- for (int i = 0; i < editorModeAndCustomizedNames.length; i++ )
- {
- EditorModeAndCustomizedName entry = editorModeAndCustomizedNames[i];
- modeCombo.add(entry.name);
- maxLength = Math.max (gc.stringExtent(entry.name).x, maxLength);
- int approxWidthOfStrings = Math.max (gc.stringExtent(entry.name).x, textWidth);
- if (approxWidthOfStrings > maxLength)
- maxLength = approxWidthOfStrings;
- }
-
- maxLength += gc.stringExtent(Messages._UI_LABEL_VIEW).x;
- gc.dispose();
-
- modeComboListener = new ModeComboListener();
- modeCombo.addSelectionListener(modeComboListener);
- modeCombo.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_END));
- modeCombo.setBackground(toolbar.getBackground());
-
- ImageHyperlink hyperlink = new ImageHyperlink(toolbar, SWT.FLAT);
- hyperlink.setBackground(ColorConstants.white);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=154457
- Image image = XSDEditorPlugin.getDefault().getIconImage("etool16/help_contents");
- hyperlink.setImage(image);
- hyperlink.setToolTipText(Messages._UI_HOVER_VIEW_MODE_DESCRIPTION);
- hyperlink.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
- hyperlink.addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- if (productCustomizationProvider != null)
- {
- productCustomizationProvider.handleAction("showEditorModeHelp");
- }
- }
- });
- }
- }
-
-
- protected class ModeComboListener implements SelectionListener
- {
- public ModeComboListener()
- {
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == modeCombo)
- {
- EditorModeManager manager = (EditorModeManager)getAdapter(EditorModeManager.class);
- EditorMode [] modeList = manager.getModes();
- if (modeList.length >= 1)
- {
- EditorModeAndCustomizedName entry = editorModeAndCustomizedNames[modeCombo.getSelectionIndex()];
- if (manager.getCurrentMode() != entry.mode)
- {
- manager.setCurrentMode(entry.mode);
- storeCurrentModePreference(entry.mode.getId());
- ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider) getAdapter(ProductCustomizationProvider.class);
- if (productCustomizationProvider != null)
- {
- productCustomizationProvider.handleAction("editorModeChanged");
- }
- }
- }
- }
- }
- }
-
- protected void storeCurrentModePreference(String id)
- {
- // Don't do anything as default. Allow extenders to implement.
- }
-
-
- protected class CommonActivationListener implements IPartListener, IWindowListener
- {
-
- /** Cache of the active workbench part. */
- private IWorkbenchPart fActivePart;
- /** Indicates whether activation handling is currently be done. */
- private boolean fIsHandlingActivation = false;
- /**
- * The part service.
- *
- * @since 3.1
- */
- private IPartService fPartService;
-
- /**
- * Creates this activation listener.
- *
- * @param partService
- * the part service on which to add the part listener
- * @since 3.1
- */
- public CommonActivationListener(IPartService partService)
- {
- fPartService = partService;
- fPartService.addPartListener(this);
- PlatformUI.getWorkbench().addWindowListener(this);
- }
-
- /**
- * Disposes this activation listener.
- *
- * @since 3.1
- */
- public void dispose()
- {
- fPartService.removePartListener(this);
- PlatformUI.getWorkbench().removeWindowListener(this);
- fPartService = null;
- }
-
- /*
- * @see IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part)
- {
- fActivePart = part;
- handleActivation();
- }
-
- /*
- * @see IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part)
- {
- // do nothing
- }
-
- /*
- * @see IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part)
- {
- // do nothing
- }
-
- /*
- * @see IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part)
- {
- fActivePart = null;
- }
-
- /*
- * @see IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part)
- {
- if (CommonMultiPageEditor.this.equals(part))
- {
- doPostEditorOpenTasks();
- }
- }
-
- /**
- * Handles the activation triggering a element state check in the editor.
- */
- void handleActivation()
- {
- if (fIsHandlingActivation || (getTextEditor() == null))
- {
- return;
- }
-
- if (fActivePart == CommonMultiPageEditor.this)
- {
- fIsHandlingActivation = true;
- try
- {
- getTextEditor().safelySanityCheckState(getEditorInput());
- }
- finally
- {
- fIsHandlingActivation = false;
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowActivated(IWorkbenchWindow window)
- {
- if (window == getEditorSite().getWorkbenchWindow())
- {
- /*
- * Workaround for problem described in
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 Will be removed
- * when SWT has solved the problem.
- */
- window.getShell().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- handleActivation();
- }
- });
- }
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowDeactivated(IWorkbenchWindow window)
- {
- // do nothing
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowClosed(IWorkbenchWindow window)
- {
- // do nothing
- }
-
- /*
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- * @since 3.1
- */
- public void windowOpened(IWorkbenchWindow window)
- {
- // do nothing
- }
- }
-
- public boolean isSourcePageActive()
- {
- return getActivePage() == SOURCE_PAGE_INDEX;
- }
-
- /**
- * Invoked during IPartListener#partOpened. Derived classes can override
- * to provide specialized behaviour.
- */
- protected void doPostEditorOpenTasks() {
- // Nothing to do in the base class.
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java
deleted file mode 100644
index c91a5f6e87..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-
-public class CommonSelectionManager extends MultiPageSelectionProvider implements ISelectionProvider, ISelectionChangedListener
-{
-
- public CommonSelectionManager(MultiPageEditorPart multiPageEditor)
- {
- super(multiPageEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection()
- {
- return currentSelection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection)
- {
- setSelection(selection, this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (enableNotify)
- {
- setSelection(event.getSelection(), event.getSelectionProvider());
- }
- }
-
-
- protected List listenerList = new ArrayList();
- protected ISelection currentSelection;
- protected boolean enableNotify = true;
-
- public boolean getEnableNotify()
- {
- return enableNotify;
- }
-
- public void setSelection(ISelection selection, ISelectionProvider source)
- {
- if (enableNotify)
- {
- currentSelection = selection;
- enableNotify = false;
- try
- {
- SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
- List copyOfListenerList = new ArrayList(listenerList);
- for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- // Bug 338126 Properties view not synced with XSD and WSDL design views
- // PropertySheet was changed to be a post selection listener
- // We need to fire off a post selection change event in order for the properties view to update.
- IEditorSite site = getMultiPageEditor().getEditorSite();
- if (site != null)
- {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider instanceof MultiPageSelectionProvider)
- {
- ((MultiPageSelectionProvider)selectionProvider).firePostSelectionChanged(event);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- enableNotify = true;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java
deleted file mode 100644
index 09d424f5e0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java
+++ /dev/null
@@ -1,25 +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.xsd.ui.internal.adt.editor;
-
-import org.eclipse.jface.action.IMenuManager;
-
-public class ContextMenuParticipant
-{
- public boolean isApplicable(Object object, String actionId)
- {
- return true;
- }
-
- public void contributeActions(Object object, IMenuManager menu)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorMode.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorMode.java
deleted file mode 100644
index 56ef845811..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorMode.java
+++ /dev/null
@@ -1,37 +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.xsd.ui.internal.adt.editor;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.viewers.IContentProvider;
-
-public abstract class EditorMode implements IAdaptable
-{
- public abstract String getId();
-
- public abstract String getDisplayName();
-
- public abstract EditPartFactory getEditPartFactory();
-
- // TODO (cs) this should return ITreeContentProvider
- public abstract IContentProvider getOutlineProvider();
-
- public ContextMenuParticipant getContextMenuParticipant()
- {
- return null;
- }
-
- public Object getAdapter(Class adapter)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorModeManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorModeManager.java
deleted file mode 100644
index 92bef66c30..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorModeManager.java
+++ /dev/null
@@ -1,136 +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.xsd.ui.internal.adt.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-
-public class EditorModeManager implements IAdaptable
-{
- private List modeList = new ArrayList();
- private EditorMode currentMode = null;
- private List listeners = new ArrayList();
- private String extensionPointId;
- private ProductCustomizationProvider productCustomizationProvider;
-
- public EditorModeManager(String extensionPointId)
- {
- this.extensionPointId = extensionPointId;
- }
-
- public void init()
- {
- readRegistry(extensionPointId);
- currentMode = getDefaultMode();
- }
-
- protected EditorMode getDefaultMode()
- {
- return (EditorMode)modeList.get(0);
- }
-
- protected void addMode(EditorMode mode)
- {
- modeList.add(mode);
- }
-
- public EditorMode getEditorMode(String editorModeId)
- {
- for (Iterator i = modeList.iterator(); i.hasNext(); )
- {
- EditorMode editorMode = (EditorMode)i.next();
- if (editorModeId.equals(editorMode.getId()))
- {
- return editorMode;
- }
- }
- return null;
- }
-
- public void setCurrentMode(EditorMode mode)
- {
- if (modeList.contains(mode))
- {
- currentMode = mode;
- List clonedList = new ArrayList();
- clonedList.addAll(listeners);
- for (Iterator i = clonedList.iterator(); i.hasNext(); )
- {
- IEditorModeListener listener = (IEditorModeListener)i.next();
- listener.editorModeChanged(mode);
- }
- }
- }
-
- public EditorMode getCurrentMode()
- {
- return currentMode;
- }
-
- public EditorMode[] getModes()
- {
- EditorMode[] modes = new EditorMode[modeList.size()];
- modeList.toArray(modes);
- return modes;
- }
-
- public void addListener(IEditorModeListener listener)
- {
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- public void removeListener(IEditorModeListener listener)
- {
- listeners.remove(listener);
- }
-
- private void readRegistry(String id)
- {
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(id);
- for (int i = 0; i < elements.length; i++)
- {
- IConfigurationElement element = elements[i];
- String editorModeId = element.getAttribute("id"); //$NON-NLS-1$
- if (editorModeId != null &&
- productCustomizationProvider != null &&
- !productCustomizationProvider.isEditorModeApplicable(editorModeId))
- {
- continue;
- }
- try
- {
- EditorMode mode = (EditorMode)element.createExecutableExtension("class");
- modeList.add(mode);
- }
- catch (Exception e)
- {
- }
- }
- }
-
- public Object getAdapter(Class adapter)
- {
- return null;
- }
-
-
- public void setProductCustomizationProvider(ProductCustomizationProvider productCustomizationProvider)
- {
- this.productCustomizationProvider = productCustomizationProvider;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IADTEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IADTEditorInput.java
deleted file mode 100644
index a364d66c3f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IADTEditorInput.java
+++ /dev/null
@@ -1,19 +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.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.xsd.XSDSchema;
-
-public interface IADTEditorInput extends IEditorInput
-{
- public XSDSchema getSchema();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java
deleted file mode 100644
index 7e98bde4f9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java
+++ /dev/null
@@ -1,16 +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.xsd.ui.internal.adt.editor;
-
-public interface IEditorModeListener
-{
- void editorModeChanged(EditorMode newEditorMode);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
deleted file mode 100644
index cb7de70269..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsd.ui.internal.adt.editor.messages"; //$NON-NLS-1$
-
- private Messages()
- {
- }
-
- static
- {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
- public static String _UI_ACTION_SHOW_PROPERTIES;
- public static String _UI_ACTION_SET_AS_FOCUS;
- public static String _UI_ACTION_DELETE;
- public static String _UI_ACTION_ADD_FIELD;
- public static String _UI_ACTION_BROWSE;
- public static String _UI_ACTION_NEW;
- public static String _UI_ACTION_UPDATE_NAME;
- public static String _UI_ACTION_UPDATE_TYPE;
- public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE;
- public static String _UI_ACTION_SELECT_ALL;
- public static String _UI_LABEL_DESIGN;
- public static String _UI_LABEL_SOURCE;
- public static String _UI_LABEL_VIEW;
- public static String _UI_HOVER_VIEW_MODE_DESCRIPTION;
- public static String _UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION_QUESTION;
- public static String _UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION;
- public static String _UI_ACTION_CAPTURE_SCREEN_ERROR_TITLE;
- public static String _UI_ACTION_CAPTURE_SCREEN_ERROR_DESCRIPTION;
- public static String _UI_ACTION_CAPTURE_SCREEN_FORMAT_NOT_SUPPORTED;
- public static String _UI_CAPTURE_SCREEN_ACTION_TEXT;
- public static String _UI_CAPTURE_SCREEN_ACTION_TOOLTIPTEXT;
- public static String _UI_ACTION_CAPTURE_SCREEN_DEFAULT_FILE_NAME;
- public static String _UI_ACTION_CAPTURE_SCREEN_FILE_SAVE_DIALOG_TITLE;
- public static String _UI_HOVER_BACK_TO_SCHEMA;
- public static String _UI_REFACTOR_CONTEXT_MENU;
- public static String _UI_HYPERLINK_TEXT;
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java
deleted file mode 100644
index bece06041f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.NavigationLocation;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ExtensibleContentOutlinePage;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public abstract class ProductCustomizationProvider
-{
- public abstract boolean isEditorModeApplicable(String id);
- public abstract String getEditorModeDisplayName(String id);
-
- public String getProductString(String id)
- {
- return "";
- }
-
- public String getProductString(String id, Object[] args)
- {
- return "";
- }
-
- public void handleAction(String actionId)
- {
- }
-
- public NavigationLocation getNavigationLocation(IEditorPart part, XSDConcreteComponent component, BaseEditPart editPart)
- {
- return null;
- }
-
- public ExtensibleContentOutlinePage getProductContentOutlinePage()
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
deleted file mode 100644
index c110e4d825..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-
-_UI_ACTION_SHOW_PROPERTIES=Sho&w properties
-_UI_ACTION_SET_AS_FOCUS=&Set As Focus
-_UI_ACTION_UPDATE_NAME=Update Name
-_UI_ACTION_UPDATE_TYPE=Update type
-_UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update element reference
-_UI_ACTION_DELETE=&Delete
-_UI_ACTION_BROWSE=&Browse...
-_UI_LABEL_DESIGN=Design
-_UI_LABEL_SOURCE=Source
-_UI_ACTION_NEW=&New...
-_UI_ACTION_ADD_FIELD=Add Field
-_UI_LABEL_VIEW=View:
-_UI_HOVER_VIEW_MODE_DESCRIPTION=Change the view mode of the editor
-_UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION_QUESTION=Question
-_UI_ACTION_CAPTURE_SCREEN_OVERWRITE_CONFIRMATION=The file {0} already exists. Do you want to replace the existing file?
-_UI_ACTION_CAPTURE_SCREEN_ERROR_TITLE=Error
-_UI_ACTION_CAPTURE_SCREEN_ERROR_DESCRIPTION=Could not save editor contents
-_UI_ACTION_CAPTURE_SCREEN_FORMAT_NOT_SUPPORTED=Format not supported
-_UI_CAPTURE_SCREEN_ACTION_TEXT = &Export Diagram as Image...
-_UI_CAPTURE_SCREEN_ACTION_TOOLTIPTEXT = Export Diagram as Image
-_UI_ACTION_CAPTURE_SCREEN_DEFAULT_FILE_NAME = Diagram
-_UI_ACTION_CAPTURE_SCREEN_FILE_SAVE_DIALOG_TITLE=Export Diagram as Image
-_UI_HOVER_BACK_TO_SCHEMA=Show schema index view
-_UI_ACTION_SELECT_ALL=Select &All
-_UI_REFACTOR_CONTEXT_MENU=Refac&tor
-_UI_HYPERLINK_TEXT = Open {0} with the XML Schema editor
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java
deleted file mode 100644
index bea4a836d9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.facade;
-
-public interface IADTObject
-{
- public void registerListener(IADTObjectListener listener);
- public void unregisterListener(IADTObjectListener listener);
- boolean isReadOnly();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java
deleted file mode 100644
index afc8efb4fb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java
+++ /dev/null
@@ -1,16 +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.xsd.ui.internal.adt.facade;
-
-public interface IADTObjectListener
-{
- public void propertyChanged(Object object, String property);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
deleted file mode 100644
index c97adc4f62..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-
-
-public interface IComplexType extends IType, IStructure
-{
- boolean isAbstract();
- Object getContentType();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
deleted file mode 100644
index 7e31d32453..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IField extends IADTObject
-{
- String getKind();
- String getName();
- String getTypeName();
- String getTypeNameQualifier();
- IModel getModel();
- IType getType();
- IComplexType getContainerType();
- int getMinOccurs();
- int getMaxOccurs();
- boolean isGlobal();
- boolean isReference();
- boolean isAbstract();
-
- Command getUpdateMinOccursCommand(int minOccurs);
- Command getUpdateMaxOccursCommand(int maxOccurs);
- Command getUpdateTypeNameCommand(String typeName, String quailifier);
- Command getUpdateNameCommand(String name);
- Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java
deleted file mode 100644
index 4e42451d9a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.adt.facade;
-
-import java.util.List;
-
-public interface IModel extends IADTObject
-{
- List getTypes();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java
deleted file mode 100644
index 0c0d16e383..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java
+++ /dev/null
@@ -1,23 +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.xsd.ui.internal.adt.facade;
-
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-
-public interface IStructure extends IADTObject
-{
- String getName();
- List getFields();
- IModel getModel();
- Command getAddNewFieldCommand(String fieldKind);
- Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
deleted file mode 100644
index cfd1adc99e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
+++ /dev/null
@@ -1,24 +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.xsd.ui.internal.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IType extends IADTObject
-{
- IType getSuperType();
- String getName();
- String getQualifier();
- boolean isComplexType();
- boolean isAnonymous();
-
- Command getUpdateNameCommand(String newName);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
deleted file mode 100644
index 48fb01e9c4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.adt.outline;
-
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewContextMenuProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class ADTContentOutlinePage extends ExtensibleContentOutlinePage
-{
- protected int level = 0;
- protected MultiPageSelectionProvider selectionManager;
- protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
-
- public ADTContentOutlinePage()
- {
- super();
- }
-
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- getTreeViewer().setContentProvider(contentProvider);
- getTreeViewer().setLabelProvider(labelProvider);
- getTreeViewer().setInput(model);
- getTreeViewer().addSelectionChangedListener(this);
- MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
- menuManager.setRemoveAllWhenShown(true);
- Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
- getTreeViewer().getControl().setMenu(menu);
- setSelectionManager(editor.getSelectionManager());
-
- // Create menu...for now reuse graph's. Note edit part viewer = null
- DesignViewContextMenuProvider menuProvider = new DesignViewContextMenuProvider(editor, null, editor.getSelectionManager());
- menuManager.addMenuListener(menuProvider);
- getSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.outline", menuManager, editor.getSelectionManager()); //$NON-NLS-1$
-
- // enable popupMenus extension
- // getSite().registerContextMenu("org.eclipse.wst.xsdeditor.ui.popup.outline",
- // menuManager, xsdEditor.getSelectionManager());
-
- // drill down from outline view
- getTreeViewer().getControl().addMouseListener(new MouseAdapter()
- {
- public void mouseDoubleClick(MouseEvent e)
- {
- ISelection iSelection = getTreeViewer().getSelection();
- if (iSelection instanceof StructuredSelection)
- {
- StructuredSelection selection = (StructuredSelection) iSelection;
- Object obj = selection.getFirstElement();
- if (obj instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent comp = (XSDConcreteComponent) obj;
- if (comp.getContainer() instanceof XSDSchema)
- {
- // getXSDEditor().getGraphViewer().setInput(obj);
- }
- }
- }
-
- }
- });
- }
-
- class XSDKeyListener extends KeyAdapter
- {
- }
-
- public void dispose()
- {
- contentProvider.dispose();
- super.dispose();
- }
-
- public void setExpandToLevel(int i)
- {
- level = i;
- }
-
- public void setInput(Object value)
- {
- getTreeViewer().setInput(value);
- getTreeViewer().expandToLevel(level);
- }
-
- // public ISelection getSelection()
- // {
- // if (getTreeViewer() == null)
- // return StructuredSelection.EMPTY;
- // return getTreeViewer().getSelection();
- // }
- public void setSelectionManager(MultiPageSelectionProvider newSelectionManager)
- {
- // disconnect from old one
- if (selectionManager != null)
- {
- selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
- }
- selectionManager = newSelectionManager;
- // connect to new one
- if (selectionManager != null)
- {
- selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
- }
- }
-
- protected class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateStatusLine(getSite().getActionBars().getStatusLineManager(), event.getSelection());
- if (event.getSelectionProvider() != ADTContentOutlinePage.this) //getTreeViewer())
- {
- StructuredSelection selection = (StructuredSelection)event.getSelection();
- StructuredSelection currentSelection = (StructuredSelection) getTreeViewer().getSelection();
-
- Object selectionFirstElement = selection.getFirstElement();
- Object currentFirstElement = currentSelection.getFirstElement();
-
- // TODO: Hack to prevent losing a selection when the schema is selected in the
- // source. Fix is to prevent the source from firing off selection changes when
- // the selection source is not the source view.
-
- if (selectionFirstElement instanceof IModel)
- {
- if (!(currentFirstElement instanceof IModelProxy) || currentFirstElement instanceof RedefineCategoryAdapter)
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- }
- else if (selectionFirstElement instanceof XSDSchemaDirectiveAdapter)
- {
- if (!(currentFirstElement instanceof RedefineCategoryAdapter))
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- }
- else
- {
- IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
- List list = structuredSelection.toList();
- int selectionLength = list.size();
- if (selectionLength > 0)
- {
- for (int i = 0; i < selectionLength; i++)
- {
- Object item = list.get(i);
-
- if (item instanceof AdapterImpl)
- {
- Notifier target = ((AdapterImpl) item).getTarget();
-
- if (!(target instanceof XSDConcreteComponent))
- continue;
-
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) target;
-
- // need to expand parent before child, thus a stack is required
- Stack componentStack = new Stack();
- while (xsdConcreteComponent != null)
- {
- componentStack.push(xsdConcreteComponent);
- xsdConcreteComponent = xsdConcreteComponent.getContainer();
- }
-
- // At this point the stack must have the XSDSchemaAdapter and
- // at least one component
- if (componentStack.size() < 2)
- continue;
-
- // Pop off the top node, since it is the XSDSchemaAdapter, which
- // isn't
- // used as part of finding the outline view hierarchy
- componentStack.pop();
-
- if (((XSDConcreteComponent) componentStack.peek()).eAdapters().size() <= 0)
- continue;
-
- Object object = ((XSDConcreteComponent) componentStack.peek()).eAdapters().get(0);
-
- // Find out which category the selected item is contained in
- int categoryIndex = -1;
- if (object instanceof XSDSchemaDirectiveAdapter)
- {
- categoryIndex = CategoryAdapter.DIRECTIVES;
- }
- else if (object instanceof XSDElementDeclarationAdapter)
- {
- categoryIndex = CategoryAdapter.ELEMENTS;
- }
- else if (object instanceof XSDAttributeDeclarationAdapter)
- {
- categoryIndex = CategoryAdapter.ATTRIBUTES;
- }
- else if (object instanceof XSDAttributeGroupDefinitionAdapter)
- {
- categoryIndex = CategoryAdapter.ATTRIBUTES;
- }
- else if (object instanceof XSDComplexTypeDefinitionAdapter || object instanceof XSDSimpleTypeDefinitionAdapter)
- {
- categoryIndex = CategoryAdapter.TYPES;
- }
- else if (object instanceof XSDModelGroupDefinitionAdapter)
- {
- categoryIndex = CategoryAdapter.GROUPS;
- }
-
- // Expand the category
- if (categoryIndex == -1)
- continue;
- CategoryAdapter category = ((XSDSchemaAdapter) model).getCategory(categoryIndex);
- treeViewer.setExpandedState(category, true);
-
- // Do not expand current node of interest, just its parents
- while (componentStack.size() > 1)
- {
- object = componentStack.pop();
- if (object instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent) object;
- if (component.eAdapters().size() > 0)
- {
- // expand
- getTreeViewer().setExpandedState(component.eAdapters().get(0), true);
- }
- }
- }
- }
- }
- }
- // Bug 251474 - We will restrict selection to only one item
- if (selectionLength == 1)
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- else
- {
- if(structuredSelection.getFirstElement() !=null)
- getTreeViewer().setSelection(new StructuredSelection(structuredSelection.getFirstElement()), true);
- }
- }
- }
- }
- }
-
- protected void updateStatusLine(IStatusLineManager mgr, ISelection selection)
- {
- String text = null;
- Image image = null;
- ILabelProvider statusLineLabelProvider = new StatusLineLabelProvider(getTreeViewer());
- if (statusLineLabelProvider != null && selection instanceof IStructuredSelection && !selection.isEmpty())
- {
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- if (firstElement instanceof XSDRedefineAdapter)
- return;
- text = statusLineLabelProvider.getText(firstElement);
- image = statusLineLabelProvider.getImage(firstElement);
- }
- if (image == null)
- {
- mgr.setMessage(text);
- }
- else
- {
- mgr.setMessage(image, text);
- }
- }
-
- protected class StatusLineLabelProvider extends JFaceNodeLabelProvider
- {
- TreeViewer treeViewer = null;
-
- public StatusLineLabelProvider(TreeViewer viewer)
- {
- treeViewer = viewer;
- }
-
- public String getText(Object element)
- {
- if (element == null)
- return null;
-
- StringBuffer s = new StringBuffer();
- s.append(labelProvider.getText(element));
- return s.toString();
- }
-
- public Image getImage(Object element)
- {
- return labelProvider.getImage(element);
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
deleted file mode 100644
index ac6e76f24e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public class ADTContentOutlineProvider implements ITreeContentProvider, IADTObjectListener
-{
- protected Viewer viewer = null;
- protected Object oldInput, newInput;
- protected ADTContentOutlineRefreshJob refreshJob;
-
- public ADTContentOutlineProvider()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement)
- {
- if (parentElement instanceof ITreeElement)
- {
- Object[] children = ((ITreeElement) parentElement).getChildren();
- if (children != null)
- {
- int length = children.length;
- for (int i = 0; i < length; i++)
- {
- Object child = children[i];
- if (child instanceof IADTObject)
- {
- ((IADTObject) child).registerListener(this);
- }
- }
- }
- return children;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element)
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement) element).hasChildren();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- Object input = viewer.getInput();
- if (input instanceof IADTObject)
- {
- removeListener((IADTObject) input);
- }
- if (refreshJob != null)
- {
- refreshJob.cancel();
- refreshJob = null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.viewer = viewer;
- this.oldInput = oldInput;
- this.newInput = newInput;
- if (refreshJob != null)
- {
- refreshJob.cancel();
- }
- refreshJob = new ADTContentOutlineRefreshJob(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener#propertyChanged(java.lang.Object, java.lang.String)
- */
- public void propertyChanged(Object object, String property)
- {
- refreshJob.refresh((IADTObject)object);
- }
-
- /**
- * @param model
- */
- private void removeListener(IADTObject model)
- {
- model.unregisterListener(this);
- Object[] children = null;
-
- if (model instanceof ITreeElement)
- {
- children = ((ITreeElement) model).getChildren();
- }
-
- if (children != null)
- {
- int length = children.length;
- for (int i = 0; i < length; i++)
- {
- Object child = children[i];
- if (child instanceof IADTObject && model != child)
- {
- removeListener((IADTObject) child);
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java
deleted file mode 100644
index bf04cf473a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java
+++ /dev/null
@@ -1,143 +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.wst.xsd.ui.internal.adt.outline;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-
-/**
- * This job holds a queue of updates (affected nodes) for the XSD editor's
- * outline view. When a new request comes in, the current run is cancelled,
- * the new request is added to the queue, then the job is re-scheduled.
- * This class is loosely based on RefreshStructureJob.
- */
-class ADTContentOutlineRefreshJob extends Job
-{
- /**
- * The delay time in milliseconds.
- */
- private static final long UPDATE_DELAY = 300;
-
- private final List nodesToRefresh = new ArrayList(5);
-
- private final TreeViewer viewer;
-
- public ADTContentOutlineRefreshJob(Viewer viewer)
- {
- super("Refreshing XSD outline"); //$NON-NLS-1$
- setPriority(Job.LONG);
- setSystem(true);
- this.viewer = (TreeViewer)viewer;
- }
-
- private synchronized void addRefreshRequest(IADTObject adtObject)
- {
- if (nodesToRefresh.contains(adtObject))
- {
- return;
- }
-
- nodesToRefresh.add(adtObject);
- }
-
- protected void canceling()
- {
- nodesToRefresh.clear();
- super.canceling();
- }
-
- private void doRefresh(final IADTObject adtObject)
- {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.asyncExec(new Runnable()
- {
- public void run()
- {
- boolean isValidViewer = viewer != null && !viewer.getControl().isDisposed();
- if (isValidViewer)
- {
- viewer.refresh(adtObject);
-
- // Needlessly revealing the category nodes causes a lot of UI flicker.
-
- if (!(adtObject instanceof CategoryAdapter))
- {
- viewer.reveal(adtObject);
- }
- }
- }
- });
- }
-
- private synchronized IADTObject[] getNodesToRefresh()
- {
- IADTObject[] toRefresh = new IADTObject [nodesToRefresh.size()];
- nodesToRefresh.toArray(toRefresh);
- nodesToRefresh.clear();
-
- return toRefresh;
- }
-
- public void refresh(IADTObject adtObject)
- {
- if (adtObject == null)
- {
- return;
- }
-
- addRefreshRequest(adtObject);
-
- schedule(UPDATE_DELAY);
- }
-
- protected IStatus run(IProgressMonitor monitor)
- {
- IStatus status = Status.OK_STATUS;
- try
- {
- performRefreshes(monitor);
- }
- finally
- {
- monitor.done();
- }
- return status;
- }
-
- private void performRefreshes(IProgressMonitor monitor)
- {
- IADTObject[] nodes = getNodesToRefresh();
-
- for (int index = 0; index < nodes.length; index++)
- {
- if (monitor.isCanceled())
- {
- throw new OperationCanceledException();
- }
- IADTObject node = nodes[index];
- doRefresh(node);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java
deleted file mode 100644
index 14a6d4d845..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java
+++ /dev/null
@@ -1,79 +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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-public class ADTLabelProvider implements ILabelProvider
-{
-
- public ADTLabelProvider()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement)element).getImage();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement)element).getText();
- }
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener)
- {
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
deleted file mode 100644
index 4e19a5667b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
+++ /dev/null
@@ -1,147 +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.wst.xsd.ui.internal.adt.outline;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
-
-public class ExtensibleContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener
-{
- protected ListenerList selectionChangedListeners = new ListenerList();
- protected TreeViewer treeViewer;
- protected Object model;
- protected ITreeContentProvider contentProvider;
- protected ILabelProvider labelProvider;
- protected ADTMultiPageEditor editor;
-
- protected ExtensibleContentOutlinePage()
- {
- super();
- }
-
- public void createControl(Composite parent)
- {
- treeViewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
- treeViewer.addSelectionChangedListener(this);
- }
-
- public void setEditor(ADTMultiPageEditor editor)
- {
- this.editor = editor;
- }
-
- public void setModel(Object newModel)
- {
- model = newModel;
- }
-
- public void setContentProvider(ITreeContentProvider contentProvider)
- {
- this.contentProvider = contentProvider;
- }
-
- public void setLabelProvider(ILabelProvider labelProvider)
- {
- this.labelProvider = labelProvider;
- }
-
- public void setFocus()
- {
- treeViewer.getControl().setFocus();
- }
-
- public void setSelection(ISelection selection)
- {
- if (treeViewer != null)
- {
- treeViewer.setSelection(selection);
- }
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.add(listener);
- }
-
- protected void fireSelectionChanged(ISelection selection)
- {
- // create an event
- final SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
-
- // fire the event
- Object[] listeners = selectionChangedListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i)
- {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- Platform.run(new SafeRunnable()
- {
- public void run()
- {
- l.selectionChanged(event);
- }
- });
- }
- }
-
- public Control getControl()
- {
- if (treeViewer == null)
- {
- return null;
- }
- return treeViewer.getControl();
- }
-
- public ISelection getSelection()
- {
- if (treeViewer == null)
- {
- return StructuredSelection.EMPTY;
- }
- return treeViewer.getSelection();
- }
-
- public TreeViewer getTreeViewer()
- {
- return treeViewer;
- }
-
- public void init(IPageSite pageSite)
- {
- super.init(pageSite);
- pageSite.setSelectionProvider(this);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.remove(listener);
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- fireSelectionChanged(event.getSelection());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java
deleted file mode 100644
index a660d9a30b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java
+++ /dev/null
@@ -1,23 +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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.swt.graphics.Image;
-
-public interface ITreeElement
-{
- public final static ITreeElement[] EMPTY_LIST = {};
- ITreeElement[] getChildren();
- ITreeElement getParent();
- boolean hasChildren();
- String getText();
- Image getImage();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java
deleted file mode 100644
index 5c1343f4f6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.properties;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-/**
- * @deprecated. Extenders should specialize...ie. XSDTabbedPropertySheetPage
- */
-public class ADTTabbedPropertySheetPage extends TabbedPropertySheetPage
-{
- public ADTTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
- {
- super(tabbedPropertySheetPageContributor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
-// Object selected = ((StructuredSelection)selection).getFirstElement();
-// if (selected instanceof EditPart)
-// {
-// Object model = ((EditPart)selected).getModel();
-// selection = new StructuredSelection(model);
-// }
- super.selectionChanged(part, selection);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyAttributeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyAttributeAction.java
deleted file mode 100644
index 07785fc680..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyAttributeAction.java
+++ /dev/null
@@ -1,90 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAnyAttributeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-public class AddXSDAnyAttributeAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.AddXSDAnyAttributeAction"; //$NON-NLS-1$
- protected XSDComplexTypeDefinition xsdComplexTypeDefinition;
-
- public AddXSDAnyAttributeAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ANY_ATTRIBUTE);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
- AddXSDAnyAttributeCommand command = null;
- if (selection instanceof XSDComplexTypeDefinition)
- {
- command = new AddXSDAnyAttributeCommand(Messages._UI_ACTION_ADD_ANY_ATTRIBUTE, (XSDComplexTypeDefinition) selection);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDAttributeGroupDefinition)
- {
- command = new AddXSDAnyAttributeCommand(Messages._UI_ACTION_ADD_ANY_ATTRIBUTE, (XSDAttributeGroupDefinition)selection);
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-
-
- protected boolean calculateEnabled()
- {
- boolean rc = super.calculateEnabled();
- if (rc)
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
- if (selection instanceof XSDComplexTypeDefinition)
- {
- return ((XSDComplexTypeDefinition)selection).getAttributeWildcardContent() == null;
- }
- else if (selection instanceof XSDAttributeGroupDefinition)
- {
- return ((XSDAttributeGroupDefinition)selection).getAttributeWildcardContent() == null;
- }
-
- }
- return rc;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java
deleted file mode 100644
index d50a53bb53..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAnyElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-
-public class AddXSDAnyElementAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.AddXSDAnyElementAction"; //$NON-NLS-1$
-
- public AddXSDAnyElementAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ANY_ELEMENT);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- XSDModelGroup modelGroup = getModelGroup(selection);
-
- AddXSDAnyElementCommand command = new AddXSDAnyElementCommand(getText(), modelGroup);
- if (selection instanceof XSDComplexTypeDefinition)
- {
- command.setComplexType((XSDComplexTypeDefinition)selection);
- }
- command.setDoCreateModelGroupForComplexType(modelGroup == null);
- getCommandStack().execute(command);
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
-
- private XSDModelGroup getModelGroup(Object selection)
- {
- if (selection instanceof XSDModelGroup)
- {
- return (XSDModelGroup) selection;
- }
- else if (selection instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeContent content = ((XSDComplexTypeDefinition)selection).getContent();
- if (content instanceof XSDParticle)
- {
- XSDParticleContent particleContent = ((XSDParticle)content).getContent();
- if (particleContent instanceof XSDModelGroup)
- {
- return (XSDModelGroup)particleContent;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java
deleted file mode 100644
index 7c113fe61d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAttributeDeclarationCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDAttributeDeclarationAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AddXSDAttributeAction"; //$NON-NLS-1$
- public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$
- public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID"; //$NON-NLS-1$
- public static String REF_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeReferenceAction"; //$NON-NLS-1$
- boolean isReference = false;
-
- public AddXSDAttributeDeclarationAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ATTRIBUTE);
- setId(ID);
- isReference = false;
- }
-
- public AddXSDAttributeDeclarationAction(IWorkbenchPart part, String id, String label, boolean isReference)
- {
- super(part);
- setText(label);
- setId(id);
- this.isReference = isReference;
- doDirectEdit = !isReference;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- if (selection instanceof XSDAttributeDeclaration)
- {
- selection = ((XSDAttributeDeclaration) selection).getContainer();
- }
- }
- AddXSDAttributeDeclarationCommand command = null;
- if (selection instanceof XSDComplexTypeDefinition)
- {
- command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, (XSDComplexTypeDefinition) selection);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDAttributeUse)
- {
- XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) selection;
- XSDConcreteComponent parent = null;
- XSDComplexTypeDefinition ct = null;
- XSDAttributeGroupDefinition group = null;
- for (parent = xsdAttributeUse.getContainer(); parent != null;)
- {
- if (parent instanceof XSDComplexTypeDefinition)
- {
- ct = (XSDComplexTypeDefinition) parent;
- break;
- }
- else if (parent instanceof XSDAttributeGroupDefinition)
- {
- group = (XSDAttributeGroupDefinition)parent;
- break;
- }
- parent = parent.getContainer();
- }
- if (ct != null)
- {
- XSDAttributeUse sel = (XSDAttributeUse) selection;
- int index = ct.getAttributeContents().indexOf(sel);
- command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, ct, getId(), index);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (group != null)
- {
- XSDAttributeUse sel = (XSDAttributeUse) selection;
- int index = group.eContents().indexOf(sel);
- command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, group, getId(), index);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- }
- else if (selection instanceof XSDAttributeGroupDefinition)
- {
- command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, (XSDAttributeGroupDefinition)selection);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDSchema)
- {
- command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, (XSDSchema)selection);
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeGroupDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeGroupDefinitionAction.java
deleted file mode 100644
index f30a3e78de..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeGroupDefinitionAction.java
+++ /dev/null
@@ -1,78 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAttributeGroupDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDAttributeGroupDefinitionAction extends XSDBaseAction
-{
- public static String ID = "AddXSDAttributeGroupDefinitionAction"; //$NON-NLS-1$
- public static String REF_ID = "AddXSDAttributeGroupDefinitionRefAction"; //$NON-NLS-1$
-
- public AddXSDAttributeGroupDefinitionAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ATTRIBUTE_GROUP);
- setId(ID);
- }
-
- public AddXSDAttributeGroupDefinitionAction(IWorkbenchPart part, String id)
- {
- super(part);
- if (id.equals(REF_ID))
- {
- setText(Messages._UI_ACTION_ADD_ATTRIBUTE_GROUP_REF);
- }
- else
- {
- setText(Messages._UI_ACTION_ADD_ATTRIBUTE_GROUP_DEFINITION);
- }
- setId(id);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- AddXSDAttributeGroupDefinitionCommand command = null;
- if (selection instanceof XSDComplexTypeDefinition)
- {
- command = new AddXSDAttributeGroupDefinitionCommand(Messages._UI_ACTION_ADD_ATTRIBUTE_GROUP_REF, (XSDComplexTypeDefinition) selection);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDSchema)
- {
- command = new AddXSDAttributeGroupDefinitionCommand(Messages._UI_ACTION_ADD_ATTRIBUTE_GROUP_DEFINITION, (XSDSchema) selection);
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDComplexTypeDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDComplexTypeDefinitionAction.java
deleted file mode 100644
index c55f4eff43..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDComplexTypeDefinitionAction.java
+++ /dev/null
@@ -1,52 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDComplexTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDComplexTypeDefinitionAction extends XSDBaseAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.internal.editor.AddXSDComplexTypeDefinitionAction"; //$NON-NLS-1$
-
- public AddXSDComplexTypeDefinitionAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_COMPLEX_TYPE);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- if (selection instanceof XSDSchema)
- {
- AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand(Messages._UI_ACTION_ADD_COMPLEX_TYPE, (XSDSchema) selection);
- getCommandStack().execute(command);
-
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java
deleted file mode 100644
index 68bd64a737..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDModelGroupImpl;
-
-//revisit this and see if we can reuse AddFieldAction??
-
-public class AddXSDElementAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction"; //$NON-NLS-1$
- public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$
- public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.AFTER_SELECTED_ID"; //$NON-NLS-1$
- public static String REF_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementReferenceAction"; //$NON-NLS-1$
- boolean isReference;
-
- public AddXSDElementAction(IWorkbenchPart part, String id, String label, boolean isReference)
- {
- super(part);
- setText(label);
- setId(id);
- this.isReference = isReference;
- doDirectEdit = !isReference;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
- AddXSDElementCommand command = null;
- if (selection instanceof XSDComplexTypeDefinition)
- {
- command = new AddXSDElementCommand(getText(), (XSDComplexTypeDefinition) selection);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDModelGroupDefinition)
- {
- command = new AddXSDElementCommand(getText(), (XSDModelGroupDefinition) selection);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDSchema)
- {
- command = new AddXSDElementCommand(getText(), (XSDSchema) selection);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDModelGroup)
- {
- XSDModelGroup modelGroup = (XSDModelGroup) selection;
- XSDConcreteComponent component = modelGroup.getContainer();
- XSDComplexTypeDefinition ct = null;
- while (component != null)
- {
- if (component instanceof XSDComplexTypeDefinition)
- {
- ct = (XSDComplexTypeDefinition) component;
- break;
- }
- component = component.getContainer();
- }
-
- if (ct != null)
- {
- command = new AddXSDElementCommand(getText(), (XSDModelGroup) selection, ct);
- }
- else
- {
- command = new AddXSDElementCommand(getText(), (XSDModelGroup) selection);
- }
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (selection instanceof XSDElementDeclaration || selection instanceof XSDAttributeUse)
- {
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) selection;
- XSDConcreteComponent parent = null;
- XSDComplexTypeDefinition ct = null;
- XSDModelGroupDefinition group = null;
- XSDModelGroupImpl ctGroup = null;
-
- for (parent = xsdConcreteComponent.getContainer(); parent != null; )
- {
- if (parent instanceof XSDComplexTypeDefinition)
- {
- ct = (XSDComplexTypeDefinition)parent;
- break;
- }
- else if (parent instanceof XSDModelGroupDefinition)
- {
- group = (XSDModelGroupDefinition)parent;
- break;
- }
- else if (parent instanceof XSDModelGroupImpl)
- {
- ctGroup = (XSDModelGroupImpl) parent;
- break;
- }
- parent = parent.getContainer();
- }
- if (ct != null)
- {
- command = new AddXSDElementCommand(getText(), ct);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (ctGroup != null)
- {
- XSDElementDeclaration sel = (XSDElementDeclaration) selection;
- int index = ctGroup.getContents().indexOf(sel.eContainer());
- command = new AddXSDElementCommand(getText(), ctGroup, getId(), index);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- else if (group != null)
- {
- command = new AddXSDElementCommand(getText(), group);
- command.setReference(isReference);
- getCommandStack().execute(command);
- }
- }
-
- if (command != null)
- {
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java
deleted file mode 100644
index fe4c11fb0d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.xsd.ui.internal.common.actions;
-
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class AddXSDEnumerationFacetAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.AddXSDEnumerationFacetAction"; //$NON-NLS-1$
- public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$
- public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction.AFTER_SELECTED_ID"; //$NON-NLS-1$
-
- public AddXSDEnumerationFacetAction(IWorkbenchPart part, String id, String label)
- {
- super(part);
- setText(label);
- setId(id);
- }
-
- public AddXSDEnumerationFacetAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ENUMERATION);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- int index = -1;
- AddEnumerationsCommand command = null;
- XSDSimpleTypeDefinition st = null;
- if (selection instanceof XSDSimpleTypeDefinition)
- {
- st = (XSDSimpleTypeDefinition)selection;
- command = new AddEnumerationsCommand(getText(), st);
- }
- else if (selection instanceof XSDEnumerationFacet)
- {
- st = ((XSDEnumerationFacet)selection).getSimpleTypeDefinition();
- index = st.getFacetContents().indexOf(selection);
- doDirectEdit = true;
- command = new AddEnumerationsCommand(getText(), st, getId(), index);
- }
- else if (selection instanceof XSDComplexTypeDefinition) // Support for Complex Type's simple Content with enumerations
- {
- st = (XSDSimpleTypeDefinition) ((XSDComplexTypeDefinition)selection).getContent();
- command = new AddEnumerationsCommand(getText(), st);
- }
- else // null
- {
- return;
- }
-
- List enumList = st.getEnumerationFacets();
-
- String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
-
- command.setValue(newName);
- getCommandStack().execute(command);
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-
- protected boolean calculateEnabled() {
-
- boolean parentResult = super.calculateEnabled();
- boolean endResult = true;
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- if (selection instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinition definition = ((XSDComplexTypeDefinitionAdapter) selection).getXSDComplexTypeDefinition();
- XSDTypeDefinition baseType = definition.getBaseType();
- if (baseType instanceof XSDSimpleTypeDefinition)
- endResult = false;
- }
- endResult = endResult & parentResult;
- return endResult;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java
deleted file mode 100644
index f4fb4648c6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDModelGroupCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class AddXSDModelGroupAction extends XSDBaseAction
-{
- public static String SEQUENCE_ID = "AddXSDSequenceModelGroupAction"; //$NON-NLS-1$
- public static String CHOICE_ID = "AddXSDChoiceModelGroupAction"; //$NON-NLS-1$
- public static String ALL_ID = "AddXSDAllModelGroupAction"; //$NON-NLS-1$
- XSDCompositor xsdCompositor;
-
- public AddXSDModelGroupAction(IWorkbenchPart part, XSDCompositor compositor, String ID)
- {
- super(part);
- setText(getLabel(compositor));
- setId(ID);
- this.xsdCompositor = compositor;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- if (selection instanceof XSDBaseAdapter)
- {
- XSDConcreteComponent xsdComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
- AddXSDModelGroupCommand command = null;
- if (xsdComponent instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) xsdComponent;
-
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdElementDeclaration, xsdCompositor);
- getCommandStack().execute(command);
- }
- else if (xsdComponent instanceof XSDModelGroup)
- {
- XSDModelGroup xsdModelGroup = (XSDModelGroup) xsdComponent;
-
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdModelGroup, xsdCompositor);
- getCommandStack().execute(command);
- }
- else if (xsdComponent instanceof XSDComplexTypeDefinition
- || xsdComponent instanceof XSDModelGroupDefinition)
- {
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdComponent, xsdCompositor);
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
- if (adapter != null)
- provider.setSelection(new StructuredSelection(adapter));
- }
-
- }
- }
-
- private String getLabel(XSDCompositor compositor)
- {
- String result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"); //$NON-NLS-1$
- if (compositor != null)
- {
- if (compositor == XSDCompositor.CHOICE_LITERAL)
- {
- result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE"); //$NON-NLS-1$
- }
- else if (compositor == XSDCompositor.ALL_LITERAL)
- {
- result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ALL");//$NON-NLS-1$
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupDefinitionAction.java
deleted file mode 100644
index d49a367a58..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupDefinitionAction.java
+++ /dev/null
@@ -1,62 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDModelGroupDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class AddXSDModelGroupDefinitionAction extends XSDBaseAction
-{
- public static final String MODELGROUPDEFINITION_ID = "AddXSDModelGroupDefinitionAction"; //$NON-NLS-1$
- public static final String MODELGROUPDEFINITIONREF_ID = "AddXSDModelGroupDefinitionRefAction"; //$NON-NLS-1$
- boolean isReference;
-
- public AddXSDModelGroupDefinitionAction(IWorkbenchPart part, boolean isReference)
- {
- super(part);
- this.isReference = isReference;
- if (isReference)
- {
- setText(Messages._UI_ACTION_ADD_GROUP_REF);
- setId(MODELGROUPDEFINITION_ID);
- }
- else
- {
- setText(Messages._UI_ACTION_ADD_GROUP);
- setId(MODELGROUPDEFINITIONREF_ID);
- }
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- XSDConcreteComponent xsdConcreteComponent = null;
- if (selection instanceof XSDBaseAdapter)
- {
- xsdConcreteComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
- }
- if (xsdConcreteComponent != null)
- {
- AddXSDModelGroupDefinitionCommand command = new AddXSDModelGroupDefinitionCommand(getText(), xsdConcreteComponent, isReference);
- getCommandStack().execute(command);
-
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java
deleted file mode 100644
index 8b8c19c020..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.xsd.ui.internal.common.actions;
-
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-public abstract class AddXSDRedefinableContentAction extends XSDBaseAction
-{
- protected AddXSDRedefinableContentAction(IWorkbenchPart part, String ID, String text)
- {
- super(part);
- setText(text);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection)getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter)selection).getTarget();
- }
-
- if (selection instanceof XSDRedefine)
- {
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setDescriptionProvider(new RedefineDescriptor());
- configuration.setSearchListProvider(new RedefineSearchListProvider((XSDRedefine)selection, this));
- ComponentSearchListDialog dialog = new ComponentSearchListDialog(Display.getDefault().getActiveShell(), Messages._UI_LABEL_REDEFINE_COMPONENT, configuration)
- {
- protected Control createDialogArea(Composite parent)
- {
- // Adjust the dialog's initial size.
-
- Composite mainComposite = (Composite)super.createDialogArea(parent);
- GridData gridData = (GridData)mainComposite.getLayoutData();
- gridData.heightHint = 500;
- gridData.widthHint = 350;
- return mainComposite;
- }
- };
- dialog.create();
- dialog.setBlockOnOpen(true);
- int result = dialog.open();
-
- if (result == Window.OK)
- {
- ComponentSpecification selectedComponent = dialog.getSelectedComponent();
- buildRedefine((XSDRedefine)selection, selectedComponent);
- }
- }
- }
-
- protected abstract AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent);
-
- protected abstract void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList);
-
- protected void buildRedefine(XSDRedefine redefine, ComponentSpecification selectedComponent)
- {
- XSDRedefinableComponent redefinableComponent = (XSDRedefinableComponent)selectedComponent.getObject();
- AddRedefinedComponentCommand command = getCommand(redefine, redefinableComponent);
- getCommandStack().execute(command);
- addedComponent = command.getAddedComponent();
- }
-
- class RedefineSearchListProvider implements IComponentSearchListProvider
- {
- XSDRedefine xsdRedefine;
- AddXSDRedefinableContentAction action;
-
- public RedefineSearchListProvider(XSDRedefine xsdRedefine, AddXSDRedefinableContentAction action)
- {
- this.xsdRedefine = xsdRedefine;
- this.action = action;
- }
-
- // Should refactor this to have a separate subclass for each type of redefine.
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- List currentRedefines = xsdRedefine.getContents();
- Set redefinedComponentsNames = new HashSet(currentRedefines.size());
- Iterator redefinesIterator = currentRedefines.iterator();
- while (redefinesIterator.hasNext())
- {
- XSDRedefinableComponent component = (XSDRedefinableComponent)redefinesIterator.next();
- String redefinedComponentName = component.getName();
- redefinedComponentsNames.add(redefinedComponentName);
- }
- action.buildComponentsList(xsdRedefine, redefinedComponentsNames, list);
- }
- }
-
- class RedefineDescriptor implements IComponentDescriptionProvider
- {
- public IFile getFile(Object component)
- {
- if (component instanceof XSDNamedComponent)
- {
- if (((XSDNamedComponent)component).getSchema() == null)
- {
- return null;
- }
- String location = ((XSDNamedComponent)component).getSchema().getSchemaLocation();
- String platformResource = "platform:/resource"; //$NON-NLS-1$
- if (location != null && location.startsWith(platformResource))
- {
- Path path = new Path(location.substring(platformResource.length()));
- return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return null;
- }
-
- public Image getFileIcon(Object component)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); //$NON-NLS-1$
- }
-
- public ILabelProvider getLabelProvider()
- {
- return new XSDRedefineComponentsLabelProvider();
- }
-
- public String getName(Object component)
- {
- if (component instanceof XSDNamedComponent)
- {
- return ((XSDNamedComponent)component).getName();
- }
- return "";
- }
-
- public String getQualifier(Object component)
- {
- if (component instanceof XSDNamedComponent)
- {
- return ((XSDNamedComponent)component).getTargetNamespace();
- }
- return "";
- }
-
- public boolean isApplicable(Object component)
- {
- return true;
- }
-
- }
-
- protected abstract Image getRedefinedComponentImage();
-
- class XSDRedefineComponentsLabelProvider implements ILabelProvider
- {
-
- public Image getImage(Object element)
- {
- Image image = getRedefinedComponentImage();
- return image;
- }
-
- public String getText(Object element)
- {
- if (element instanceof XSDNamedComponent)
- {
- return ((XSDNamedComponent)element).getName();
- }
- return "";
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void dispose()
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java
deleted file mode 100644
index 5f5b0e4365..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java
+++ /dev/null
@@ -1,68 +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.wst.xsd.ui.internal.common.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineAttributeGroupCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-public class AddXSDRedefinedAttributeGroupAction extends AddXSDRedefinableContentAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineAttributeGroup"; //$NON-NLS-1$
-
- public AddXSDRedefinedAttributeGroupAction(IWorkbenchPart part)
- {
- super(part, ID, Messages._UI_ACTION_REDEFINE_ATTRIBUTE_GROUP);
- }
-
- protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- AddRedefinedComponentCommand command = new RedefineAttributeGroupCommand(
- Messages._UI_ACTION_REDEFINE_ATTRIBUTE_GROUP,
- redefine,
- redefinableComponent);
- return command;
- }
-
- protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
- {
- List attributeGroups = xsdRedefine.getIncorporatedSchema().getAttributeGroupDefinitions();
- Iterator iterator = attributeGroups.iterator();
- while (iterator.hasNext())
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition)iterator.next();
- String attributeGroupDefinitionName = attributeGroupDefinition.getName();
- if (!redefinedComponentsNames.contains(attributeGroupDefinitionName))
- {
- componentList.add(attributeGroupDefinition);
- }
- }
- }
-
- protected Image getRedefinedComponentImage()
- {
- return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_ATTRIBUTE_GROUP);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java
deleted file mode 100644
index 901d5a6c6c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java
+++ /dev/null
@@ -1,69 +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.wst.xsd.ui.internal.common.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineComplexTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class AddXSDRedefinedComplexTypeAction extends AddXSDRedefinableContentAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineComplexType"; //$NON-NLS-1$
-
- public AddXSDRedefinedComplexTypeAction(IWorkbenchPart part)
- {
- super(part, ID, Messages._UI_ACTION_REDEFINE_COMPLEX_TYPE);
- }
-
- protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- AddRedefinedComponentCommand command = new RedefineComplexTypeCommand(
- Messages._UI_ACTION_REDEFINE_COMPLEX_TYPE,
- redefine,
- redefinableComponent);
- return command;
- }
-
- protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
- {
- List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
- Iterator iterator = typeDefinitions.iterator();
- while (iterator.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition)iterator.next();
- String typeDefinitionName = typeDefinition.getName();
- if (typeDefinition instanceof XSDComplexTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName))
- {
- componentList.add(typeDefinition);
- }
- }
- }
-
- protected Image getRedefinedComponentImage()
- {
- return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_COMPLEX_TYPE);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java
deleted file mode 100644
index d3839a92dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java
+++ /dev/null
@@ -1,68 +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.wst.xsd.ui.internal.common.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineModelGroupCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-public class AddXSDRedefinedModelGroupAction extends AddXSDRedefinableContentAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineModelGroup"; //$NON-NLS-1$
-
- public AddXSDRedefinedModelGroupAction(IWorkbenchPart part)
- {
- super(part, ID, Messages._UI_ACTION_REDEFINE_MODEL_GROUP);
- }
-
- protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- AddRedefinedComponentCommand command = new RedefineModelGroupCommand(
- Messages._UI_ACTION_REDEFINE_MODEL_GROUP,
- redefine,
- redefinableComponent);
- return command;
- }
-
- protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
- {
- List modelGroupList = xsdRedefine.getIncorporatedSchema().getModelGroupDefinitions();
- Iterator iterator = modelGroupList.iterator();
- while (iterator.hasNext())
- {
- XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition)iterator.next();
- String modelGroupDefinitionName = modelGroupDefinition.getName();
- if (!redefinedComponentsNames.contains(modelGroupDefinitionName))
- {
- componentList.add(modelGroupDefinition);
- }
- }
- }
-
- protected Image getRedefinedComponentImage()
- {
- return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_MODEL_GROUP);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java
deleted file mode 100644
index dd86050645..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java
+++ /dev/null
@@ -1,70 +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.wst.xsd.ui.internal.common.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineSimpleTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class AddXSDRedefinedSimpleTypeAction extends AddXSDRedefinableContentAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineSimpleType"; //$NON-NLS-1$
-
- public AddXSDRedefinedSimpleTypeAction(IWorkbenchPart part)
- {
- super(part, ID, Messages._UI_ACTION_REDEFINE_SIMPLE_TYPE);
- }
-
- public AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- AddRedefinedComponentCommand command = new RedefineSimpleTypeCommand(
- Messages._UI_ACTION_REDEFINE_SIMPLE_TYPE,
- redefine,
- redefinableComponent);
- return command;
- }
-
- protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
- {
- List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
- Iterator iterator = typeDefinitions.iterator();
- while (iterator.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition)iterator.next();
- String typeDefinitionName = typeDefinition.getName();
- if (typeDefinition instanceof XSDSimpleTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName))
- {
- componentList.add(typeDefinition);
- }
- }
-
- }
-
- protected Image getRedefinedComponentImage()
- {
- return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_SIMPLE_TYPE);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
deleted file mode 100644
index 0324f1c91c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDImportCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDIncludeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDRedefineCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDSchemaDirectiveAction extends XSDBaseAction
-{
- public static String INCLUDE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDIncludeAction"; //$NON-NLS-1$
- public static String IMPORT_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDImportAction"; //$NON-NLS-1$
- public static String REDEFINE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefineAction"; //$NON-NLS-1$
- String label;
-
- public AddXSDSchemaDirectiveAction(IWorkbenchPart part, String ID, String label)
- {
- super(part);
- setText(label);
- setId(ID);
- this.label = label;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- BaseCommand command = null;
- if (selection instanceof XSDSchema)
- {
- if (INCLUDE_ID.equals(getId()))
- {
- command = new AddXSDIncludeCommand(label, (XSDSchema) selection);
- }
- else if (IMPORT_ID.equals(getId()))
- {
- command = new AddXSDImportCommand(label, (XSDSchema) selection);
- }
- else if (REDEFINE_ID.equals(getId()))
- {
- command = new AddXSDRedefineCommand(label, (XSDSchema) selection);
- }
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
- if (adapter != null)
- {
- provider.setSelection(new StructuredSelection(adapter));
- // Automatically open the schema location dialog if the preference is enabled
- if(XSDEditorPlugin.getDefault().getAutomaticallyOpenSchemaLocationDialogSetting())
- {
- XSDSchemaDirectiveAdapter xsdSchemaDirectiveAdapter = null;
- if(adapter instanceof XSDSchemaDirectiveAdapter)
- {
- xsdSchemaDirectiveAdapter = (XSDSchemaDirectiveAdapter)adapter;
- }
- XSDDirectivesSchemaLocationUpdater.updateSchemaLocation((XSDSchema) selection, xsdSchemaDirectiveAdapter.getTarget(),
- (command instanceof AddXSDIncludeCommand || command instanceof AddXSDRedefineCommand));
- }
- // The graphical view may deselect, so select again
- provider.setSelection(new StructuredSelection(adapter));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSimpleTypeDefinitionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSimpleTypeDefinitionAction.java
deleted file mode 100644
index bc7cd73e62..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSimpleTypeDefinitionAction.java
+++ /dev/null
@@ -1,53 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDSimpleTypeDefinitionAction extends XSDBaseAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.internal.editor.AddXSDSimpleTypeDefinitionAction"; //$NON-NLS-1$
-
- public AddXSDSimpleTypeDefinitionAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_SIMPLE_TYPE);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- if (selection instanceof XSDSchema)
- {
- AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, (XSDSchema) selection);
- getCommandStack().execute(command);
-
- addedComponent = command.getAddedComponent();
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
- selectAddedComponent(adapter);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
deleted file mode 100644
index abfe49d036..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * @deprecated Use org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction
- *
- */
-public class DeleteXSDConcreteComponentAction extends XSDBaseAction
-{
- public static final String DELETE_XSD_COMPONENT_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction"; //$NON-NLS-1$
-
- public DeleteXSDConcreteComponentAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_DELETE);
- setId(DELETE_XSD_COMPONENT_ID);
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") ); //$NON-NLS-1$
- }
-
- public void run()
- {
- for (Iterator i = ((IStructuredSelection) getSelection()).iterator(); i.hasNext();)
- {
- Object selection = i.next();
- boolean doReselect = false;
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- if (selection instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent xsdComponent = (XSDConcreteComponent) selection;
- XSDSchema model = xsdComponent.getSchema();
-
- doReselect = xsdComponent.eContainer() instanceof XSDSchema;
-
- DeleteCommand command = new DeleteCommand(getText(), xsdComponent);
- getCommandStack().execute(command);
-
- if (model != null && doReselect)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(model);
- if (adapter != null)
- provider.setSelection(new StructuredSelection(adapter));
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
deleted file mode 100644
index 1efade029c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import java.net.URI;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTFileStoreEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTReadOnlyFileEditorInput;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDFileEditorInput;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-public class OpenInNewEditor extends BaseSelectionAction
-{
- public static final String ID = "OpenInNewEditor"; //$NON-NLS-1$
-
- public OpenInNewEditor(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR); //$NON-NLS-1$
- setId(ID);
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = null;
- IEditorInput editorInput = null;
- if (workbenchWindow != null)
- {
- page = workbenchWindow.getActivePage();
- IEditorPart activeEditor = page.getActiveEditor();
- if (activeEditor != null)
- {
- editorInput = activeEditor.getEditorInput();
- }
-
- }
-
- if (selection instanceof XSDBaseAdapter)
- {
- XSDBaseAdapter xsdAdapter = (XSDBaseAdapter) selection;
- XSDConcreteComponent fComponent = (XSDConcreteComponent) xsdAdapter.getTarget();
- XSDSchema schema = fComponent.getSchema();
-
- boolean isReference = false;
- if (fComponent instanceof XSDFeature)
- {
- isReference = ((XSDFeature)fComponent).isFeatureReference();
- fComponent = ((XSDFeature)fComponent).getResolvedFeature();
- }
-
- String schemaLocation = null;
- IPath schemaPath = null;
- IFile schemaFile = null;
-
- // Special case any imports/includes
- if (selection instanceof XSDSchemaDirectiveAdapter)
- {
- XSDSchemaDirective dir = (XSDSchemaDirective)((XSDSchemaDirectiveAdapter)selection).getTarget();
- // force load of imported schema
- if (dir instanceof XSDImportImpl)
- {
- ((XSDImportImpl)dir).importSchema();
- }
- if (dir.getResolvedSchema() != null)
- {
- schemaLocation = URIHelper.removePlatformResourceProtocol(dir.getResolvedSchema().getSchemaLocation());
- schemaPath = new Path(schemaLocation);
- schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- schema = dir.getResolvedSchema();
- fComponent = dir.getResolvedSchema();
- }
- } // Handle any other external components
- else if (fComponent.getSchema() != null && fComponent.eContainer() instanceof XSDSchema ||
- fComponent.eContainer() instanceof XSDRedefine || isReference)
- {
- schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
- schemaPath = new Path(schemaLocation);
- schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-
- try
- {
- XSDSchema xsdSchema = (XSDSchema)getWorkbenchPart().getAdapter(XSDSchema.class);
- if (fComponent.getSchema() == xsdSchema)
- {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
- }
- return;
- }
- }
- catch (Exception e)
- {
-
- }
- }
-
- // If the schemaFile exists in the workspace
- if (page != null && schemaFile != null && schemaFile.exists())
- {
- try
- {
- // Get the current editor's schema
- XSDSchema xsdSchema = (XSDSchema)getWorkbenchPart().getAdapter(XSDSchema.class);
- IEditorPart editorPart = null;
- // This first check is to ensure that the schema is actually
- // different than the current one we are editing against in the editor, and that we
- // are in the same resource file....hence multiple schemas in the same file.
- if (xsdSchema != null && fComponent.getRootContainer().eResource() == xsdSchema.eResource() && xsdSchema != schema)
- {
- String editorName = null;
- XSDFileEditorInput xsdFileEditorInput = new XSDFileEditorInput(schemaFile, fComponent.getSchema());
- // will use FileEditorInput's name if still null
- // Try to use the same editor name as the current one
- if (editorInput != null)
- {
- editorName = editorInput.getName();
- xsdFileEditorInput.setEditorName(editorName);
- }
- editorPart = getExistingEditorForInlineSchema(page, schemaFile, schema);
- if (editorPart == null)
- {
- editorPart = page.openEditor(xsdFileEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0);
- }
- }
- else
- {
- editorPart = page.openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.EDITOR_ID);
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
- }
- }
- catch (Exception e)
- {
- }
- }
- else
- {
- // open the xsd externally
- if (schemaLocation != null)
- openExternalFiles(page, schemaLocation, fComponent);
- }
- }
- }
-
- public static void openXSDEditor(IEditorInput editorInput, XSDConcreteComponent xsdComponent)
- {
- openXSDEditor(editorInput, xsdComponent.getSchema(), xsdComponent);
- }
-
- public static void openXSDEditor(IEditorInput editorInput, XSDSchema schema, XSDConcreteComponent xsdComponent)
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = null;
- if (workbenchWindow != null)
- {
- page = workbenchWindow.getActivePage();
- }
-
- String resource = schema.getSchemaLocation();
-
- if (editorInput instanceof FileEditorInput && resource != null && !resource.startsWith("http"))
- {
- String schemaLocation = URIHelper.removePlatformResourceProtocol(resource);
- openWorkspaceFile(page, schemaLocation, xsdComponent);
- }
- else
- {
- openExternalFiles(page, resource, xsdComponent);
- }
- }
-
- public static void openInlineSchema(IEditorInput editorInput, XSDConcreteComponent xsdComponent, XSDSchema schema, String editorName)
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = null;
- if (workbenchWindow != null)
- {
- page = workbenchWindow.getActivePage();
- }
-
- boolean isWorkspaceFile = false;
-
- String schemaLocation = schema.getSchemaLocation();
- String workspaceFileLocation = URIHelper.removePlatformResourceProtocol(schemaLocation);
- IPath workspaceFilePath = new Path(workspaceFileLocation);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(workspaceFilePath);
-
- if (page != null && file != null && file.exists())
- {
- isWorkspaceFile = true;
- }
-
- if (isWorkspaceFile)
- {
- try
- {
- IEditorPart editorPart = null;
- XSDFileEditorInput xsdFileEditorInput = new XSDFileEditorInput(file, schema);
- xsdFileEditorInput.setEditorName(editorName);
- IEditorReference[] refs = page.getEditorReferences();
- int length = refs.length;
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof XSDFileEditorInput)
- {
- IFile aFile = ((XSDFileEditorInput) input).getFile();
- if (aFile.getFullPath().equals(file.getFullPath()))
- {
- if (((XSDFileEditorInput) input).getSchema() == schema)
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- }
- if (editorPart == null)
- {
- editorPart = page.openEditor(xsdFileEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0); //$NON-NLS-1$
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(xsdComponent);
- }
- }
- catch (PartInitException pie)
- {
- }
- }
- else
- {
- if (schemaLocation != null && !schemaLocation.startsWith("http"))
- {
- String fileLocation = null;
- // This is to workaround the difference in URI resolution. On linux, the resolved location is
- // platform:/resource/ On Windows, it's file://
- //
- if (java.io.File.separatorChar == '/')
- {
- fileLocation = "/" + URIHelper.removePlatformResourceProtocol(schemaLocation);
- }
- else // Windows
- {
- fileLocation = URIHelper.removeProtocol(schemaLocation);
- }
- IPath schemaPath = new Path(fileLocation);
- IFileStore fileStore = EFS.getLocalFileSystem().getStore(schemaPath);
- if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists())
- {
- try
- {
- ADTFileStoreEditorInput xsdFileStoreEditorInput = new ADTFileStoreEditorInput(fileStore, schema);
- xsdFileStoreEditorInput.setEditorName(editorName);
-
- IEditorPart editorPart = null;
- IEditorReference[] refs = page.getEditorReferences();
- int length = refs.length;
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof ADTFileStoreEditorInput)
- {
- URI uri = ((ADTFileStoreEditorInput) input).getURI();
- if (uri.equals(xsdFileStoreEditorInput.getURI()) && ((ADTFileStoreEditorInput) input).getSchema() == xsdFileStoreEditorInput.getSchema())
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
-
- if (page != null && editorPart == null)
- {
- editorPart = page.openEditor(xsdFileStoreEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0); //$NON-NLS-1$
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(xsdComponent);
- }
- }
- catch (PartInitException pie)
- {
-
- }
- }
- }
- else
- {
- try
- {
- IEditorPart editorPart = null;
- IEditorReference[] refs = page.getEditorReferences();
- int length = refs.length;
- // Need to find if an editor on that schema has already been opened
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof ADTReadOnlyFileEditorInput)
- {
- ADTReadOnlyFileEditorInput xsdFileStorageEditorInput = (ADTReadOnlyFileEditorInput) input;
- if (xsdFileStorageEditorInput.getUrlString().equals(schemaLocation)
- && xsdFileStorageEditorInput.getEditorID().equals(XSDEditorPlugin.EDITOR_ID))
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- if (editorPart == null)
- {
- ADTReadOnlyFileEditorInput xsdFileStorageEditorInput = new ADTReadOnlyFileEditorInput(schemaLocation);
- xsdFileStorageEditorInput.setSchema(schema);
- xsdFileStorageEditorInput.setEditorName(editorName);
- xsdFileStorageEditorInput.setEditorID(XSDEditorPlugin.EDITOR_ID);
- editorPart = page.openEditor(xsdFileStorageEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0);
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(xsdComponent);
- }
- }
- catch (PartInitException pie)
- {
- }
-
- }
- return;
- }
- }
-
- private IEditorPart getExistingEditorForInlineSchema(IWorkbenchPage page, IFile schemaFile, XSDSchema schema)
- {
- IEditorReference [] refs = page.getEditorReferences();
- int length = refs.length;
- IEditorPart editorPart = null;
- try
- {
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof XSDFileEditorInput)
- {
- IFile aFile = ((XSDFileEditorInput)input).getFile();
- if (aFile.getFullPath().equals(schemaFile.getFullPath()))
- {
- if (((XSDFileEditorInput)input).getSchema() == schema)
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- }
- }
- catch (PartInitException e)
- {
- }
- return editorPart;
- }
-
- public static void openWorkspaceFile(IWorkbenchPage page, String schemaLocation, XSDConcreteComponent xsdComponent)
- {
- IPath schemaPath = new Path(schemaLocation);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- if (page != null && file != null && file.exists())
- {
- try
- {
- IEditorPart editorPart = IDE.openEditor(page, file, true);
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(xsdComponent);
- }
- }
- catch (PartInitException pie)
- {
-
- }
- }
- }
-
- public static void openExternalFiles(IWorkbenchPage page, String schemaLocation, XSDConcreteComponent fComponent)
- {
- if (schemaLocation == null) return; // Assert not null
-
- IPath schemaPath = new Path(schemaLocation);
-// Initially tried to use schemaPath.getDevice() to determine if it is an http reference. However, on Linux, it is null.
-// So as a result of bug 221421, we will just use the schemaLocation.
- if (!schemaLocation.startsWith("http"))
- {
- schemaPath = new Path(URIHelper.removeProtocol(schemaLocation));
- }
- IFileStore fileStore = EFS.getLocalFileSystem().getStore(schemaPath);
- URI schemaURI = URI.create(schemaLocation);
- if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists())
- {
- try
- {
- IEditorPart editorPart = null;
- IEditorReference[] refs = page.getEditorReferences();
- int length = refs.length;
- // Need to find if an editor on that schema has already been opened
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof FileStoreEditorInput)
- {
- URI uri = ((FileStoreEditorInput) input).getURI();
- if (uri.equals(schemaURI))
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- if (editorPart == null)
- {
- editorPart = IDE.openEditorOnFileStore(page, fileStore);
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(fComponent);
- }
- }
- catch (PartInitException pie)
- {
- }
- }
- else
- {
- try
- {
- if (schemaLocation.startsWith("http"))
- {
- try
- {
- IEditorPart editorPart = null;
- IEditorReference[] refs = page.getEditorReferences();
- int length = refs.length;
- // Need to find if an editor on that schema has already been opened
- for (int i = 0; i < length; i++)
- {
- IEditorInput input = refs[i].getEditorInput();
- if (input instanceof ADTReadOnlyFileEditorInput)
- {
- ADTReadOnlyFileEditorInput readOnlyEditorInput = (ADTReadOnlyFileEditorInput) input;
- if (readOnlyEditorInput.getUrlString().equals(schemaLocation) &&
- XSDEditorPlugin.EDITOR_ID.equals(readOnlyEditorInput.getEditorID()))
- {
- editorPart = refs[i].getEditor(true);
- page.activate(refs[i].getPart(true));
- break;
- }
- }
- }
- if (editorPart == null)
- {
- ADTReadOnlyFileEditorInput readOnlyStorageEditorInput = new ADTReadOnlyFileEditorInput(schemaLocation);
- readOnlyStorageEditorInput.setEditorID(XSDEditorPlugin.EDITOR_ID);
- editorPart = page.openEditor(readOnlyStorageEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0); //$NON-NLS-1$
- }
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
- xsdEditor.openOnGlobalReference(fComponent);
- }
- }
- catch (PartInitException pie)
- {
- }
-
- }
- else
- {
- FileStoreEditorInput xsdFileStoreEditorInput = new FileStoreEditorInput(fileStore);
- page.openEditor(xsdFileStoreEditorInput, XSDEditorPlugin.EDITOR_ID, true, 0); //$NON-NLS-1$
- }
-
- }
- catch (PartInitException e)
- {
-
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java
deleted file mode 100644
index dbc3a457a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java
+++ /dev/null
@@ -1,78 +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.wst.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class SetBaseTypeAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.setBaseType"; //$NON-NLS-1$
-
- public SetBaseTypeAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_SET_BASE_TYPE + "..."); //$NON-NLS-1$
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
-
- boolean complexType = selection instanceof XSDComplexTypeDefinition;
- boolean simpleType = selection instanceof XSDSimpleTypeDefinition;
-
- if (complexType || simpleType)
- {
-
- if (getWorkbenchPart() instanceof IEditorPart)
- {
- IEditorPart editor = (IEditorPart)getWorkbenchPart();
-
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);
- ComponentSpecification newValue;
- IComponentDialog dialog = null;
- dialog = manager.getBrowseDialog();
- if (dialog != null)
- {
- if(simpleType)
- {
- ((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
- }
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(selection, newValue);
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java
deleted file mode 100644
index a33996a005..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java
+++ /dev/null
@@ -1,88 +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.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetMultiplicityCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class SetMultiplicityAction extends XSDBaseAction
-{
- public static String REQUIRED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.REQUIRED_ID"; //$NON-NLS-1$
- public static String ZERO_OR_ONE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ZERO_OR_ONE_ID"; //$NON-NLS-1$
- public static String ZERO_OR_MORE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ZERO_OR_MORE_ID"; //$NON-NLS-1$
- public static String ONE_OR_MORE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ONE_OR_MORE_ID"; //$NON-NLS-1$
-
- SetMultiplicityCommand command;
-
- public SetMultiplicityAction(IWorkbenchPart part, String label, String ID)
- {
- super(part);
- setText(label);
- setId(ID);
- command = new SetMultiplicityCommand(label);
- }
-
- public void setMaxOccurs(int i)
- {
- command.setMaxOccurs(i);
- }
-
- public void setMinOccurs(int i)
- {
- command.setMinOccurs(i);
- }
-
- protected boolean calculateEnabled()
- {
- boolean state = super.calculateEnabled();
- if (state)
- {
- XSDConcreteComponent xsdConcreteComponent = getXSDInput();
- if (xsdConcreteComponent instanceof XSDElementDeclaration)
- {
- return !((XSDElementDeclaration)xsdConcreteComponent).isGlobal();
- }
- else if (xsdConcreteComponent instanceof XSDModelGroup)
- {
- return !(((XSDModelGroup)xsdConcreteComponent).eContainer() instanceof XSDModelGroupDefinition);
- }
- }
- return state;
- }
-
- private XSDConcreteComponent getXSDInput()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- XSDConcreteComponent xsdConcreteComponent = null;
- if (selection instanceof XSDBaseAdapter)
- {
- xsdConcreteComponent = (XSDConcreteComponent)((XSDBaseAdapter) selection).getTarget();
- }
- return xsdConcreteComponent;
- }
-
- public void run()
- {
- XSDConcreteComponent xsdConcreteComponent = getXSDInput();
- if (xsdConcreteComponent != null)
- {
- command.setXSDConcreteComponent(xsdConcreteComponent);
- getCommandStack().execute(command);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
deleted file mode 100644
index 2083e4f420..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetTypeAction extends XSDBaseAction
-{
- public static final String SET_NEW_TYPE_ID = "SetTypeAction_AddType"; //$NON-NLS-1$
- public static final String SELECT_EXISTING_TYPE_ID = "SetTypeAction_ExistingType"; //$NON-NLS-1$
-
- SetTypeCommand command;
-
- public SetTypeAction(String label, String ID, IWorkbenchPart part)
- {
- super(part);
- setText(label);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- Object target = ((XSDBaseAdapter) selection).getTarget();
-
- if (target instanceof XSDConcreteComponent)
- {
- command = new SetTypeCommand(Messages._UI_ACTION_SET_TYPE, getId(), (XSDConcreteComponent) target);
- command.setAdapter((XSDBaseAdapter) selection);
- getCommandStack().execute(command);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java
deleted file mode 100644
index 472d9605c0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IAutoDirectEdit;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDBaseAction extends BaseSelectionAction
-{
- XSDConcreteComponent addedComponent;
-
- public XSDBaseAction(IWorkbenchPart part)
- {
- super(part);
- }
-
- protected boolean calculateEnabled()
- {
- if (getWorkbenchPart() instanceof IEditorPart)
- {
- IEditorPart owningEditor = (IEditorPart)getWorkbenchPart();
-
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
- XSDSchema xsdSchema = null;
- if (selection instanceof XSDConcreteComponent)
- {
- xsdSchema = ((XSDConcreteComponent)selection).getSchema();
- }
-
- if (xsdSchema != null && xsdSchema == owningEditor.getAdapter(XSDSchema.class))
- {
- return true;
- }
- }
- return false;
- }
-
- protected void doEdit(Object obj, IWorkbenchPart part)
- {
- if (obj instanceof TopLevelComponentEditPart)
- {
- TopLevelComponentEditPart editPart = (TopLevelComponentEditPart)obj;
- if (addedComponent == ((XSDBaseAdapter)editPart.getModel()).getTarget())
- {
- editPart.setScroll(true);
- editPart.addFeedback();
- editPart.doEditName(!(part instanceof ContentOutline));
- }
- }
- else if (obj instanceof BaseFieldEditPart)
- {
- BaseFieldEditPart editPart = (BaseFieldEditPart)obj;
- editPart.doEditName(!(part instanceof ContentOutline));
- }
- else if (obj instanceof IAutoDirectEdit)
- {
- ((IAutoDirectEdit)obj).doEditName(!(part instanceof ContentOutline));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddDocumentationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddDocumentationCommand.java
deleted file mode 100644
index 4462eccf0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddDocumentationCommand.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AddDocumentationCommand extends BaseCommand
-{
- XSDAnnotation xsdAnnotation;
- XSDConcreteComponent input;
- String newValue, oldValue;
- boolean documentationExists;
- Element documentationElement;
-
- public AddDocumentationCommand(String label, XSDAnnotation xsdAnnotation, XSDConcreteComponent input, String newValue, String oldValue)
- {
- super(label);
- this.xsdAnnotation = xsdAnnotation;
- this.input = input;
- this.newValue = newValue;
- this.oldValue = oldValue;
- }
-
- public void execute()
- {
- if (input instanceof XSDSchema)
- {
- ensureSchemaElement((XSDSchema)input);
- }
-
- try
- {
- beginRecording(input.getElement());
-
- xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(input, true);
- Element element = xsdAnnotation.getElement();
-
- List documentationList = xsdAnnotation.getUserInformation();
- documentationElement = null;
- documentationExists = false;
- if (documentationList.size() > 0)
- {
- documentationExists = true;
- documentationElement = (Element) documentationList.get(0);
- }
-
- if (documentationElement == null)
- {
- documentationElement = xsdAnnotation.createUserInformation(null);
- element.appendChild(documentationElement);
- formatChild(documentationElement);
- // Defect in model....I create it but the model object doesn't appear
- // to be updated
- xsdAnnotation.updateElement();
- xsdAnnotation.setElement(element);
- }
-
- if (documentationElement.hasChildNodes())
- {
- if (documentationElement instanceof IDOMElement)
- {
- IDOMElement domElement = (IDOMElement) documentationElement;
-
- Node firstChild = documentationElement.getFirstChild();
- Node lastChild = documentationElement.getLastChild();
- int start = 0;
- int end = 0;
-
- // IDOMModel model = domElement.getModel();
- // IDOMDocument doc = model.getDocument();
- IDOMNode first = null;
- if (firstChild instanceof IDOMNode)
- {
- first = (IDOMNode) firstChild;
- start = first.getStartOffset();
- }
- if (lastChild instanceof IDOMNode)
- {
- IDOMNode last = (IDOMNode) lastChild;
- end = last.getEndOffset();
- }
-
- if (domElement != null)
- {
- oldValue = domElement.getModel().getStructuredDocument().get(start, end - start);
- domElement.getModel().getStructuredDocument().replaceText(documentationElement, start, end - start, newValue);
- }
- }
- }
- else
- {
- if (newValue.length() > 0)
- {
- oldValue = ""; //$NON-NLS-1$
- Node childNode = documentationElement.getOwnerDocument().createTextNode(newValue);
- documentationElement.appendChild(childNode);
- }
- }
- }
- catch (Exception e)
- {
-
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- super.undo();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java
deleted file mode 100644
index 6cb8fa7892..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class AddEnumerationsCommand extends BaseCommand
-{
- XSDSimpleTypeDefinition simpleType;
- String value;
- // The index of the currently selected item. If no item is selected, index will be less than 0
- private int index = -1;
- // Determines where the element should be inserted based on the currently selected element. If no
- // element is selected, use the default behaviour of appending the element to the end
- private String addEnumerationLocation;
-
- public AddEnumerationsCommand(String label, XSDSimpleTypeDefinition simpleType)
- {
- super(label);
- this.simpleType = simpleType;
- }
-
- public AddEnumerationsCommand(String label, XSDSimpleTypeDefinition simpleType, String ID, int index)
- {
- super(label);
- this.simpleType = simpleType;
- this.index = index;
- this.addEnumerationLocation = ID;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(simpleType.getElement());
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDEnumerationFacet enumerationFacet = factory.createXSDEnumerationFacet();
- enumerationFacet.setLexicalValue(value);
-
- index = getInsertionIndex();
- List facets = simpleType.getFacetContents();
- if (index >=0 && index < facets.size())
- {
- facets.add(index, enumerationFacet);
- }
- else
- {
- facets.add(enumerationFacet);
- }
- formatChild(simpleType.getElement());
- addedXSDConcreteComponent = enumerationFacet;
- }
- finally
- {
- endRecording();
- }
- }
-
- protected int getInsertionIndex()
- {
- if (index < 0)
- return -1;
-
- if (addEnumerationLocation.equals(AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID))
- {
- return index;
- }
- else if (addEnumerationLocation.equals(AddXSDEnumerationFacetAction.AFTER_SELECTED_ID))
- {
- index++;
- return index;
- }
- else
- {
- return -1;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensibilityElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensibilityElementCommand.java
deleted file mode 100644
index 6747f59c12..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensibilityElementCommand.java
+++ /dev/null
@@ -1,81 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddExtensibilityElementCommand extends BaseCommand
-{
- Element input, elementToAdd;
- SpecificationForExtensionsSchema extensionSchemaSpec;
-
- public AddExtensibilityElementCommand(String label, Element input, Element elementToAdd)
- {
- super(label);
- this.input = input;
- this.elementToAdd = elementToAdd;
- }
-
- public void execute()
- {
- super.execute();
- try
- {
- beginRecording(input);
- addElement();
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- super.undo();
- // TODO
- }
-
- public void setSchemaProperties(SpecificationForExtensionsSchema appInfoSchemaSpec)
- {
- this.extensionSchemaSpec = appInfoSchemaSpec;
- }
-
- private void addElement()
- {
- if (input != null)
- {
- Document doc = input.getOwnerDocument();
- String name = elementToAdd.getAttribute("name"); //$NON-NLS-1$
- try
- {
- Element rootElement = doc.createElementNS(extensionSchemaSpec.getNamespaceURI(), name);
- String prefix = input.getPrefix();
- rootElement.setPrefix(prefix);
- String xmlns = (prefix == null || prefix.equals("")) ? "xmlns" : "xmlns:" + prefix; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Attr nsURIAttribute = doc.createAttribute(xmlns);
- nsURIAttribute.setValue(extensionSchemaSpec.getNamespaceURI());
- rootElement.setAttributeNode(nsURIAttribute);
- input.appendChild(rootElement);
-
- }
- catch (Exception e)
- {
-
- }
-
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java
deleted file mode 100644
index 8ee0c5253e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AddExtensionAttributeCommand extends AddExtensionCommand
-{
- private static DOMNamespaceInfoManager manager = new DOMNamespaceInfoManager();
- private XSDAttributeDeclaration attribute;
- private boolean appInfoAttributeAdded = false;
- private String attributeQName;
- private String namespacePrefix;
-
- public AddExtensionAttributeCommand(String label, XSDConcreteComponent component,
- XSDAttributeDeclaration attribute)
- {
- super(label);
- this.component = component;
- this.attribute = attribute;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(component.getElement());
- super.execute();
- namespacePrefix = handleNamespacePrefices();
-
- attributeQName = namespacePrefix + ":" + attribute.getName(); //$NON-NLS-1$
-
- if (!(component.getElement().hasAttribute(attributeQName)))
- {
- appInfoAttributeAdded = true;
- component.getElement().setAttribute(attributeQName, ""); //$NON-NLS-1$
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- super.undo();
- if (appInfoAttributeAdded){
- component.getElement().removeAttribute(attributeQName);
- }
- }
-
- /** Create a namespace prefix if needed, other wise retrieve
- * a predefined namespace prefix
- * @return */
- private String handleNamespacePrefices()
- {
- Element schemaElement = component.getSchema().getElement();
- String prefix = null;
-
- // If target namespace of the attribute already exists
- List namespacePrefices = manager.getNamespaceInfoList(schemaElement);
- for (int i = 0; i < namespacePrefices.size(); i++){
- NamespaceInfo info = (NamespaceInfo) namespacePrefices.get(i);
- if ( info.uri.equals(attribute.getTargetNamespace())) {
- prefix = info.prefix;
- }
- }
-
- // Create unquie namespace prefix
- if ( prefix == null){
- prefix = createUniquePrefix(component);
- }
-
- NamespaceInfo info = new NamespaceInfo(attribute.getTargetNamespace(), prefix, ""); //$NON-NLS-1$
- List infoList = new ArrayList(1);
- infoList.add(info);
- manager.addNamespaceInfo(schemaElement, infoList, false);
- return prefix;
- }
-
- protected String createUniquePrefix(XSDConcreteComponent component)
- {
- String prefix = "p"; //$NON-NLS-1$
- Map prefMapper = component.getSchema().getQNamePrefixToNamespaceMap();
- if ( prefMapper.get(prefix) != null){
- int i = 1;
- while ( prefMapper.get(prefix + i) != null)
- i++;
- prefix += i;
- }
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java
deleted file mode 100644
index 5672104048..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java
+++ /dev/null
@@ -1,48 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddExtensionCommand extends BaseCommand
-{
- protected SpecificationForExtensionsSchema extensionsSchemaSpec;
- protected XSDConcreteComponent component;
-
- protected AddExtensionCommand(String label)
- {
- super(label);
- }
-
- public void setSchemaProperties(SpecificationForExtensionsSchema appInfoSchemaSpec)
- {
- this.extensionsSchemaSpec = appInfoSchemaSpec;
- }
-
- public Object getNewObject()
- {
- return null;
- }
-
- public void execute()
- {
- if (component instanceof XSDSchema)
- {
- ensureSchemaElement((XSDSchema)component);
- }
-
- super.execute();
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java
deleted file mode 100644
index 2446901182..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddExtensionElementCommand extends AddExtensionCommand
-{
- XSDElementDeclaration element;
- Element appInfo;
- Element newElement;
-
- public AddExtensionElementCommand(String label, XSDConcreteComponent input, XSDElementDeclaration element)
- {
- super(label);
- this.component = input;
- this.element = element;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(component.getElement());
- super.execute();
- addAnnotationSet(component.getSchema(), extensionsSchemaSpec);
- formatChild(component.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- super.undo();
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, false);
- xsdAnnotation.getElement().removeChild(appInfo);
- List appInfos = xsdAnnotation.getApplicationInformation();
- appInfos.remove(appInfo);
- xsdAnnotation.updateElement();
-
- }
-
- public void setSchemaProperties(SpecificationForExtensionsSchema spec)
- {
- this.extensionsSchemaSpec = spec;
- }
-
- public void addAnnotationSet(XSDSchema xsdSchema, SpecificationForExtensionsSchema spec)
- {
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, true);
- addAnnotationSet(spec, xsdAnnotation);
- }
-
- private void addAnnotationSet(SpecificationForExtensionsSchema spec, XSDAnnotation xsdAnnotation)
- {
- XSDSchema schema= xsdAnnotation.getSchema();
- Element schemaElement = schema.getElement();
-
- if (xsdAnnotation.getApplicationInformation().size() == 0)
- {
- appInfo = xsdAnnotation.createApplicationInformation(null);
- xsdAnnotation.getElement().appendChild(appInfo);
- List appInfos = xsdAnnotation.getApplicationInformation();
- appInfos.add(appInfo);
- }
- else
- {
- // use the first appInfo
- appInfo = (Element)xsdAnnotation.getApplicationInformation().get(0);
- }
-
- String prefix = addNamespaceDeclarationIfRequired(schemaElement, "p", spec.getNamespaceURI());
-
- if (appInfo != null)
- {
- Document doc = appInfo.getOwnerDocument();
-
- newElement = doc.createElementNS(spec.getNamespaceURI(), element.getName());
- newElement.setPrefix(prefix);
- appInfo.appendChild(newElement);
-
- xsdAnnotation.updateElement();
- }
- }
-
- public Object getNewObject()
- {
- return newElement;
- }
-
- /**
- * @deprecated
- */
- protected String createUniquePrefix(XSDConcreteComponent component)
- {
- String prefix = "p"; //$NON-NLS-1$
- Map prefMapper = component.getSchema().getQNamePrefixToNamespaceMap();
- if ( prefMapper.get(prefix) != null){
- int i = 1;
- while ( prefMapper.get(prefix + i) != null)
- i++;
- prefix += i;
- }
- return prefix;
- }
-
- // TODO... common this up with wsdl.ui
- private String addNamespaceDeclarationIfRequired(Element schemaElement, String prefixHint, String namespace)
- {
- String prefix = null;
- NamespaceTable namespaceTable = new NamespaceTable(schemaElement.getOwnerDocument());
- namespaceTable.addElement(schemaElement);
- prefix = namespaceTable.getPrefixForURI(namespace);
- if (prefix == null)
- {
- String basePrefix = prefixHint;
- prefix = basePrefix;
- String xmlnsColon = "xmlns:"; //$NON-NLS-1$
- String attributeName = xmlnsColon + prefix;
- int count = 0;
- while (schemaElement.hasAttribute(attributeName))
- {
- count++;
- prefix = basePrefix + count;
- attributeName = xmlnsColon + prefix;
- }
- schemaElement.setAttribute(attributeName, namespace);
- }
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java
deleted file mode 100644
index 05ecede51d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.wst.xsd.ui.internal.common.commands;
-
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.w3c.dom.Element;
-
-
-/**
- * Base class for commands that add redefined components to a schema redefine.
- */
-public abstract class AddRedefinedComponentCommand extends BaseCommand
-{
- protected XSDRedefine redefine;
-
- protected XSDRedefinableComponent redefinableComponent;
-
- public AddRedefinedComponentCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- super(label);
- this.redefine = redefine;
- this.redefinableComponent = redefinableComponent;
- }
-
- protected abstract void doExecute();
-
- public void execute()
- {
- Element element = redefine.getElement();
-
- try
- {
- beginRecording(element);
- doExecute();
- Object adapter = redefinableComponent.eAdapters().get(0);
- if (adapter instanceof XSDComplexTypeDefinitionAdapter)
- {
- ((XSDComplexTypeDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
- }
- else if (adapter instanceof XSDSimpleTypeDefinitionAdapter)
- {
- ((XSDSimpleTypeDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
- }
- else if (adapter instanceof XSDAttributeGroupDefinitionAdapter)
- {
- ((XSDAttributeGroupDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
- }
- else if (adapter instanceof XSDModelGroupDefinitionAdapter)
- {
- ((XSDModelGroupDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
- }
- redefine.getContents().add(addedXSDConcreteComponent);
- formatChild(addedXSDConcreteComponent.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyAttributeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyAttributeCommand.java
deleted file mode 100644
index 211cbc9d82..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyAttributeCommand.java
+++ /dev/null
@@ -1,64 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDWildcard;
-
-public class AddXSDAnyAttributeCommand extends BaseCommand
-{
- XSDComplexTypeDefinition xsdComplexTypeDefinition;
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition;
- XSDConcreteComponent input;
-
- public AddXSDAnyAttributeCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- super(label);
- this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
- this.input = xsdComplexTypeDefinition;
- }
-
- public AddXSDAnyAttributeCommand(String label, XSDAttributeGroupDefinition xsdAttributeGroupDefinition)
- {
- super(label);
- this.xsdAttributeGroupDefinition = xsdAttributeGroupDefinition;
- this.input = xsdAttributeGroupDefinition;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(input.getElement());
-
- XSDWildcard anyAttribute = XSDFactory.eINSTANCE.createXSDWildcard();
- if (xsdComplexTypeDefinition != null)
- {
- xsdComplexTypeDefinition.setAttributeWildcardContent(anyAttribute);
- formatChild(xsdComplexTypeDefinition.getElement());
- }
- else if (xsdAttributeGroupDefinition != null)
- {
- xsdAttributeGroupDefinition.setAttributeWildcardContent(anyAttribute);
- formatChild(xsdAttributeGroupDefinition.getElement());
- }
- addedXSDConcreteComponent = anyAttribute;
- }
- finally
- {
- endRecording();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyElementCommand.java
deleted file mode 100644
index 1b88a5809c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyElementCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class AddXSDAnyElementCommand extends BaseCommand
-{
- XSDModelGroup parent;
- XSDComplexTypeDefinition complexType;
- boolean doCreateModelGroupForComplexType = false;
-
- public AddXSDAnyElementCommand(String label, XSDModelGroup parent)
- {
- super(label);
- this.parent = parent;
- }
-
- public void setComplexType(XSDComplexTypeDefinition complexType)
- {
- this.complexType = complexType;
- }
-
- public void setDoCreateModelGroupForComplexType(boolean doCreate)
- {
- this.doCreateModelGroupForComplexType = doCreate;
- }
-
- private void createModelGroup()
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDParticle particle = factory.createXSDParticle();
- parent = factory.createXSDModelGroup();
- parent.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(parent);
- complexType.setContent(particle);
- }
-
- public void execute()
- {
- try
- {
- if (doCreateModelGroupForComplexType)
- {
- Assert.isNotNull(complexType);
- beginRecording(complexType.getElement());
- createModelGroup();
- }
- else
- {
- beginRecording(parent.getElement());
- }
- XSDWildcard wildCard = XSDFactory.eINSTANCE.createXSDWildcard();
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(wildCard);
- parent.getContents().add(particle);
- addedXSDConcreteComponent = wildCard;
- formatChild(parent.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java
deleted file mode 100644
index 00df7e042e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Text;
-
-public class AddXSDAttributeDeclarationCommand extends BaseCommand
-{
- XSDComplexTypeDefinition xsdComplexTypeDefinition;
- XSDModelGroup xsdModelGroup;
- XSDConcreteComponent parent;
- boolean isReference;
- private String nameToAdd;
- // The index of the currently selected item. If no item is selected, index will be less than 0
- private int index = -1;
- // Determines where the attribute should be inserted based on the currently selected attribute. If no
- // attribute is selected, use the default behaviour of appending the attribute to the end
- private String addAttributeLocation;
-
- public AddXSDAttributeDeclarationCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- super(label);
- this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
- }
-
- public AddXSDAttributeDeclarationCommand(String label, XSDConcreteComponent parent)
- {
- super(label);
- this.parent = parent;
- }
-
- public AddXSDAttributeDeclarationCommand(String label, XSDConcreteComponent parent, String addAttributeLocation, int index)
- {
- super(label);
- if (parent instanceof XSDComplexTypeDefinition)
- {
- this.xsdComplexTypeDefinition = (XSDComplexTypeDefinition) parent;
- }
- else
- {
- this.parent = parent;
- }
- this.addAttributeLocation = addAttributeLocation;
- this.index = index;
- }
-
- protected int getInsertionIndex()
- {
- if (index < 0)
- return -1;
-
- if (addAttributeLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID))
- {
- return index;
- }
- else if (addAttributeLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID))
- {
- index++;
- return index;
- }
- else
- {
- return -1;
- }
- }
-
- public void execute()
- {
- XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
- try
- {
- if (parent == null)
- {
- beginRecording(xsdComplexTypeDefinition.getElement());
- if (!isReference)
- {
- attribute.setName(getNewName(nameToAdd == null ? "NewAttribute" : nameToAdd)); //$NON-NLS-1$
- attribute.setTypeDefinition(xsdComplexTypeDefinition.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
- }
- else
- {
- attribute.setResolvedAttributeDeclaration(setGlobalAttributeReference(xsdComplexTypeDefinition.getSchema()));
- }
- XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
- attributeUse.setAttributeDeclaration(attribute);
- attributeUse.setContent(attribute);
-
- if (xsdComplexTypeDefinition.getAttributeContents() != null)
- {
- index = getInsertionIndex();
- if (index >= 0 && index < xsdComplexTypeDefinition.getAttributeContents().size())
- {
- xsdComplexTypeDefinition.getAttributeContents().add(index, attributeUse);
- }
- else
- {
- xsdComplexTypeDefinition.getAttributeContents().add(attributeUse);
- }
- formatChild(xsdComplexTypeDefinition.getElement());
- }
- }
- else
- {
- beginRecording(parent.getElement());
- if (parent instanceof XSDSchema)
- {
- XSDSchema xsdSchema = (XSDSchema) parent;
- attribute = createGlobalXSDAttributeDeclaration(xsdSchema);
- }
- else if (parent instanceof XSDAttributeGroupDefinition)
- {
- if (!isReference)
- {
- attribute.setTypeDefinition(parent.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
-
- List list = new ArrayList();
- Iterator i = ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getAttributeUses().iterator();
- while (i.hasNext())
- {
- XSDAttributeUse use = (XSDAttributeUse) i.next();
- list.add(use.getAttributeDeclaration());
- }
- attribute.setName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", list)); //$NON-NLS-1$
- }
- else
- {
- attribute.setResolvedAttributeDeclaration(setGlobalAttributeReference(parent.getSchema()));
- }
-
- XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
- attributeUse.setAttributeDeclaration(attribute);
- attributeUse.setContent(attribute);
-
- index = getInsertionIndex();
- if (index >= 0 && index < (((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().size()))
- {
- ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(index, attributeUse);
- }
- else
- {
- ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse);
- }
- formatChild(parent.getElement());
- }
- }
- }
- finally
- {
- endRecording();
- }
- addedXSDConcreteComponent = attribute;
- }
-
- ArrayList names;
-
- public void setNameToAdd(String name)
- {
- nameToAdd = name;
- }
-
- protected String getNewName(String description)
- {
- ArrayList usedAttributeNames = new ArrayList();
- usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdComplexTypeDefinition));
- usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes(xsdComplexTypeDefinition));
- return XSDCommonUIUtils.createUniqueElementName(description, usedAttributeNames); //$NON-NLS-1$
- }
-
- public void setReference(boolean isReference)
- {
- this.isReference = isReference;
- }
-
- protected XSDAttributeDeclaration createGlobalXSDAttributeDeclaration(XSDSchema xsdSchema)
- {
- ensureSchemaElement(xsdSchema);
- XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
- attribute.setTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
- attribute.setName(XSDCommonUIUtils.createUniqueElementName(nameToAdd == null ? "NewAttribute" : nameToAdd, xsdSchema.getAttributeDeclarations())); //$NON-NLS-1$
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(attribute);
- return attribute;
- }
-
- protected XSDAttributeDeclaration setGlobalAttributeReference(XSDSchema xsdSchema)
- {
- List list = xsdSchema.getAttributeDeclarations();
- XSDAttributeDeclaration referencedAttribute = null;
- boolean isUserDefined = false;
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) obj;
- if (!XSDConstants.SCHEMA_INSTANCE_URI_2001.equals(attr.getTargetNamespace()))
- {
- referencedAttribute = attr;
- isUserDefined = true;
- break;
- }
- }
- }
- if (!isUserDefined)
- {
- referencedAttribute = createGlobalXSDAttributeDeclaration(xsdSchema);
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(referencedAttribute);
- }
-
- return referencedAttribute;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeGroupDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeGroupDefinitionCommand.java
deleted file mode 100644
index 2ee575e73a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeGroupDefinitionCommand.java
+++ /dev/null
@@ -1,159 +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.xsd.ui.internal.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Text;
-
-public class AddXSDAttributeGroupDefinitionCommand extends BaseCommand
-{
- XSDComplexTypeDefinition xsdComplexTypeDefinition;
- XSDSchema xsdSchema;
-
- public AddXSDAttributeGroupDefinitionCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- super(label);
- this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
- }
-
- public AddXSDAttributeGroupDefinitionCommand(String label, XSDSchema xsdSchema)
- {
- super(label);
- this.xsdSchema = xsdSchema;
- }
-
- public void execute()
- {
- XSDAttributeGroupDefinition attributeGroup = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
- try
- {
- if (xsdSchema == null)
- {
- beginRecording(xsdComplexTypeDefinition.getElement());
- attributeGroup.setName(getNewName("AttributeGroup")); //$NON-NLS-1$
-
- List list = xsdComplexTypeDefinition.getSchema().getAttributeGroupDefinitions();
- if (list.size() > 0)
- {
- attributeGroup.setResolvedAttributeGroupDefinition((XSDAttributeGroupDefinition) list.get(0));
- }
- else
- {
- attributeGroup.setName(null);
- XSDAttributeGroupDefinition attributeGroup2 = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
- attributeGroup2.setName(XSDCommonUIUtils.createUniqueElementName("NewAttributeGroup", xsdComplexTypeDefinition.getSchema().getAttributeGroupDefinitions())); //$NON-NLS-1$
- xsdComplexTypeDefinition.getSchema().getContents().add(attributeGroup2);
- attributeGroup.setResolvedAttributeGroupDefinition(attributeGroup2);
- }
-
- if (xsdComplexTypeDefinition.getAttributeContents() != null)
- {
- xsdComplexTypeDefinition.getAttributeContents().add(attributeGroup);
- }
- addedXSDConcreteComponent = attributeGroup;
- }
- else
- {
- ensureSchemaElement(xsdSchema);
- // put this after, since we don't have a DOM node yet
- beginRecording(xsdSchema.getElement());
- attributeGroup.setName(XSDCommonUIUtils.createUniqueElementName("NewAttributeGroup", xsdSchema.getAttributeGroupDefinitions())); //$NON-NLS-1$
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(attributeGroup);
- addedXSDConcreteComponent = attributeGroup;
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- ArrayList names;
-
- protected String getNewName(String description)
- {
- String candidateName = "New" + description; //$NON-NLS-1$
- XSDConcreteComponent parent = xsdComplexTypeDefinition;
- names = new ArrayList();
- int i = 1;
- if (parent instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) parent;
- walkUpInheritance(ct);
-
- boolean ready = false;
- while (!ready)
- {
- ready = true;
- for (Iterator iter = names.iterator(); iter.hasNext();)
- {
- String attrName = (String) iter.next();
- if (candidateName.equals(attrName))
- {
- ready = false;
- candidateName = "New" + description + String.valueOf(i); //$NON-NLS-1$
- i++;
- }
- }
- }
- }
- return candidateName;
- }
-
- private void walkUpInheritance(XSDComplexTypeDefinition ct)
- {
- updateNames(ct);
- XSDTypeDefinition typeDef = ct.getBaseTypeDefinition();
- if (ct != ct.getRootType())
- {
- if (typeDef instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct2 = (XSDComplexTypeDefinition) typeDef;
- walkUpInheritance(ct2);
- }
- }
- }
-
- private void updateNames(XSDComplexTypeDefinition ct)
- {
- Iterator iter = ct.getAttributeContents().iterator();
- while (iter.hasNext())
- {
- Object obj = iter.next();
- if (obj instanceof XSDAttributeUse)
- {
- XSDAttributeUse use = (XSDAttributeUse) obj;
- XSDAttributeDeclaration attr = use.getAttributeDeclaration();
- String attrName = attr.getName();
- if (attrName != null)
- {
- names.add(attrName);
- }
- }
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDComplexTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDComplexTypeDefinitionCommand.java
deleted file mode 100644
index fa636cc11e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDComplexTypeDefinitionCommand.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public final class AddXSDComplexTypeDefinitionCommand extends BaseCommand
-{
- protected XSDConcreteComponent parent;
- protected XSDComplexTypeDefinition createdComplexType;
- private String nameToAdd;
-
- public AddXSDComplexTypeDefinitionCommand(String label, XSDConcreteComponent parent)
- {
- super(label);
- this.parent = parent;
- }
-
- public void setNameToAdd(String nameToAdd)
- {
- this.nameToAdd = nameToAdd;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute()
- {
- try
- {
- beginRecording(parent.getElement());
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDComplexTypeDefinition complexType = factory.createXSDComplexTypeDefinition();
- addedXSDConcreteComponent = complexType;
- String newName = getNewName(nameToAdd == null ? "NewComplexType" : nameToAdd, parent.getSchema()); //$NON-NLS-1$
- complexType.setName(newName);
- if (parent instanceof XSDSchema)
- {
- try
- {
- XSDSchema xsdSchema = (XSDSchema) parent;
- ensureSchemaElement(xsdSchema);
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(complexType);
- }
- catch (Exception e)
- {
-
- }
- }
- else if (parent instanceof XSDElementDeclaration)
- {
- ((XSDElementDeclaration) parent).setAnonymousTypeDefinition(complexType);
- formatChild(parent.getElement());
- }
- createdComplexType = complexType;
- }
- finally
- {
- endRecording();
- }
- }
-
- protected String getNewName(String description, XSDSchema schema)
- {
- String candidateName = description; //$NON-NLS-1$
- int i = 1;
-
- List list = schema.getTypeDefinitions();
- List listOfNames = new ArrayList();
- for (Iterator iter = list.iterator(); iter.hasNext();)
- {
- XSDTypeDefinition typeDef = (XSDTypeDefinition) iter.next();
- String name = typeDef.getName();
- if (name == null)
- name = ""; //$NON-NLS-1$
- if (typeDef.getTargetNamespace() == schema.getTargetNamespace())
- listOfNames.add(name);
- }
-
- boolean flag = true;
- while (flag)
- {
- if (!listOfNames.contains(candidateName))
- {
- flag = false;
- break;
- }
- candidateName = description + String.valueOf(i); //$NON-NLS-1$
- i++;
- }
-
- return candidateName;
- }
-
- public XSDComplexTypeDefinition getCreatedComplexType()
- {
- return createdComplexType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java
deleted file mode 100644
index a1bdff69e0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public class AddXSDElementCommand extends BaseCommand
-{
- XSDComplexTypeDefinition xsdComplexTypeDefinition;
- XSDModelGroupDefinition xsdModelGroupDefinition;
- XSDModelGroup xsdModelGroup;
- XSDSchema xsdSchema;
- boolean isReference;
- private String nameToAdd;
- // The index of the currently selected item. If no item is selected, index will be less than 0
- private int index = -1;
- // Determines where the element should be inserted based on the currently selected element. If no
- // element is selected, use the default behaviour of appending the element to the end
- private String addElementLocation;
-
- public AddXSDElementCommand()
- {
- super();
- }
-
- public AddXSDElementCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- super(label);
- this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
- xsdModelGroup = getModelGroup(xsdComplexTypeDefinition);
- }
-
- public AddXSDElementCommand(String label, XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- super(label);
- this.xsdModelGroupDefinition = xsdModelGroupDefinition;
- xsdModelGroup = getModelGroup(xsdModelGroupDefinition);
- }
-
- public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup, XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- super(label);
- this.xsdModelGroup = xsdModelGroup;
- this.xsdComplexTypeDefinition = xsdComplexTypeDefinition;
- }
-
- public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup)
- {
- super(label);
- this.xsdModelGroup = xsdModelGroup;
- }
-
- public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup, String ID, int index)
- {
- super(label);
- this.xsdModelGroup = xsdModelGroup;
- this.index = index;
- this.addElementLocation = ID;
- }
-
- public AddXSDElementCommand(String label, XSDSchema xsdSchema)
- {
- super(label);
- this.xsdSchema = xsdSchema;
- }
-
- public void setReference(boolean isReference)
- {
- this.isReference = isReference;
- }
-
- public void setNameToAdd(String name)
- {
- nameToAdd = name;
- }
-
- public void setAddElementLocation(String LocationType)
- {
- addElementLocation = LocationType;
- }
-
- protected int getInsertionIndex()
- {
- if (index < 0)
- return -1;
-
- if (addElementLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.BEFORE_SELECTED_ID))
- {
- return index;
- }
- else if (addElementLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.AFTER_SELECTED_ID))
- {
- index++;
- return index;
- }
- else
- {
- return -1;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute()
- {
- try
- {
- if (xsdSchema != null)
- {
- beginRecording(xsdSchema.getElement());
- XSDElementDeclaration element = createGlobalXSDElementDeclaration();
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(element);
- addedXSDConcreteComponent = element;
- }
- else if (xsdModelGroupDefinition != null)
- {
- beginRecording(xsdModelGroupDefinition.getElement());
- if (xsdModelGroup == null)
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDParticle particle = factory.createXSDParticle();
- xsdModelGroup = factory.createXSDModelGroup();
- xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(xsdModelGroup);
- xsdModelGroupDefinition.setModelGroup(xsdModelGroup);
- }
- xsdSchema = xsdModelGroupDefinition.getSchema();
- if (!isReference)
- {
- xsdModelGroup.getContents().add(createXSDElementDeclarationForModelGroupDefinitions());
- }
- else
- {
- xsdModelGroup.getContents().add(createXSDElementReference());
- }
- formatChild(xsdModelGroupDefinition.getElement());
- }
- else if (xsdModelGroup != null && (xsdComplexTypeDefinition == null || xsdModelGroupDefinition == null) )
- {
- xsdSchema = xsdModelGroup.getSchema();
- beginRecording(xsdSchema.getElement());
- if (!isReference)
- {
- index = getInsertionIndex();
- if(index >= 0 && index < xsdModelGroup.getContents().size())
- {
- xsdModelGroup.getContents().add(index,createXSDElementDeclaration());
- }
- else
- {
- xsdModelGroup.getContents().add(createXSDElementDeclaration());
- }
- }
- else
- {
- xsdModelGroup.getContents().add(createXSDElementReference());
- }
- formatChild(xsdModelGroup.getElement());
- }
- else
- {
- xsdSchema = xsdComplexTypeDefinition.getSchema();
- beginRecording(xsdSchema.getElement());
- if (xsdModelGroup == null)
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDParticle particle = factory.createXSDParticle();
- xsdModelGroup = factory.createXSDModelGroup();
- xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(xsdModelGroup);
- xsdComplexTypeDefinition.setContent(particle);
- }
- if (!isReference)
- {
- xsdModelGroup.getContents().add(createXSDElementDeclarationForComplexType());
- }
- else
- {
- xsdModelGroup.getContents().add(createXSDElementReference());
- }
- formatChild(xsdComplexTypeDefinition.getElement());
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- protected XSDParticle createXSDElementDeclaration()
- {
- XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
-
- XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
- XSDConcreteComponent comp = xsdModelGroup.getContainer();
- ArrayList usedAttributeNames = new ArrayList();
- XSDCommonUIUtils.resetVisitedGroupsStack();
- usedAttributeNames.addAll(XSDCommonUIUtils.getChildElements(xsdModelGroup));
- while (comp != null)
- {
- if (comp instanceof XSDModelGroupDefinition)
- {
- usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes((XSDModelGroupDefinition)comp));
- break;
- }
- else if (comp instanceof XSDComplexTypeDefinition)
- {
- usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes((XSDComplexTypeDefinition)comp));
- usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes((XSDComplexTypeDefinition)comp));
- break;
- }
- comp = comp.getContainer();
- }
- element.setName(XSDCommonUIUtils.createUniqueElementName(
- nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$
- element.setTypeDefinition(type);
-
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(element);
- addedXSDConcreteComponent = element;
- return particle;
- }
-
- protected XSDParticle createXSDElementReference()
- {
- List list = xsdModelGroup.getSchema().getElementDeclarations();
- XSDElementDeclaration referencedElement = null;
- if (list.size() > 0)
- {
- referencedElement = (XSDElementDeclaration)list.get(0);
- }
- else
- {
- referencedElement = createGlobalXSDElementDeclaration();
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(referencedElement);
- }
-
- XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
- element.setResolvedElementDeclaration(referencedElement);
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(element);
- addedXSDConcreteComponent = element;
- return particle;
- }
-
- protected XSDParticle createXSDElementDeclarationForComplexType()
- {
- XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
-
- XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
- ArrayList usedAttributeNames = new ArrayList();
- usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdComplexTypeDefinition));
- usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes(xsdComplexTypeDefinition));
- element.setName(XSDCommonUIUtils.createUniqueElementName(
- nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$
- element.setTypeDefinition(type);
-
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(element);
- addedXSDConcreteComponent = element;
- return particle;
- }
-
- protected XSDParticle createXSDElementDeclarationForModelGroupDefinitions()
- {
- XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
-
- XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
-
- ArrayList usedAttributeNames = new ArrayList();
- usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdModelGroupDefinition));
- element.setName(XSDCommonUIUtils.createUniqueElementName(
- nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$
- element.setTypeDefinition(type);
-
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(element);
- addedXSDConcreteComponent = element;
- return particle;
- }
-
- protected XSDElementDeclaration createGlobalXSDElementDeclaration()
- {
- ensureSchemaElement(xsdSchema);
- XSDSimpleTypeDefinition type = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDElementDeclaration element = factory.createXSDElementDeclaration();
-
- element.setName(XSDCommonUIUtils.createUniqueElementName(
- nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations())); //$NON-NLS-1$
- element.setTypeDefinition(type);
-
- return element;
- }
-
- public XSDModelGroup getModelGroup(XSDModelGroupDefinition modelGroupDef)
- {
- return modelGroupDef.getModelGroup();
- }
-
- //PORT
- public XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
- {
- XSDParticle particle = null;
-
- XSDComplexTypeContent xsdComplexTypeContent = cType.getContent();
- if (xsdComplexTypeContent instanceof XSDParticle)
- {
- particle = (XSDParticle)xsdComplexTypeContent;
- }
-
- if (particle == null)
- {
- return null;
- }
-
- Object particleContent = particle.getContent();
- XSDModelGroup group = null;
-
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup();
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- group = (XSDModelGroup) particleContent;
- }
-
- if (group == null)
- {
- return null;
- }
-
-// if (group.getContents().isEmpty() || group.eResource() != cType.eResource())
-// {
-// if (cType.getBaseType() != null)
-// {
-// XSDComplexTypeContent content = cType.getContent();
-// if (content instanceof XSDParticle)
-// {
-// group = (XSDModelGroup) ((XSDParticle) content).getContent();
-// }
-// }
-// }
-
- return group;
- }
-
- public XSDConcreteComponent getAddedComponent()
- {
- return super.getAddedComponent();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDImportCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDImportCommand.java
deleted file mode 100644
index e91f872f2a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDImportCommand.java
+++ /dev/null
@@ -1,42 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDImportCommand extends AddXSDSchemaDirectiveCommand
-{
- public AddXSDImportCommand(String label, XSDSchema schema)
- {
- super(label);
- this.xsdSchema = schema;
- }
-
- public void execute()
- {
- try
- {
- super.execute();
- // Add this after if we don't have a DOM Node yet
- beginRecording(xsdSchema.getElement());
- XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
- xsdSchema.getContents().add(findNextPositionToInsert(), xsdImport);
- addedXSDConcreteComponent = xsdImport;
- formatChild(xsdSchema.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDIncludeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDIncludeCommand.java
deleted file mode 100644
index e69b309467..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDIncludeCommand.java
+++ /dev/null
@@ -1,43 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDIncludeCommand extends AddXSDSchemaDirectiveCommand
-{
- public AddXSDIncludeCommand(String label, XSDSchema schema)
- {
- super(label);
- this.xsdSchema = schema;
- }
-
- public void execute()
- {
- try
- {
- super.execute();
- // Add this after if we don't have a DOM Node yet
- beginRecording(xsdSchema.getElement());
- XSDInclude xsdInclude = XSDFactory.eINSTANCE.createXSDInclude();
- xsdInclude.setSchemaLocation(""); //$NON-NLS-1$
- xsdSchema.getContents().add(findNextPositionToInsert(), xsdInclude);
- addedXSDConcreteComponent = xsdInclude;
- formatChild(xsdSchema.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupCommand.java
deleted file mode 100644
index 5d14b27017..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupCommand.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-
-public class AddXSDModelGroupCommand extends BaseCommand
-{
- XSDConcreteComponent parent;
- XSDCompositor xsdCompositor;
- XSDModelGroup newModelGroup;
-
- public AddXSDModelGroupCommand(String label, XSDConcreteComponent parent, XSDCompositor xsdCompositor)
- {
- super(label);
- this.parent = parent;
- this.xsdCompositor = xsdCompositor;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(parent.getElement());
- XSDConcreteComponent owner = getOwner();
- if (owner != null)
- {
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- newModelGroup = createModelGroup();
- particle.setContent(newModelGroup);
-
- XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition) owner;
- ctd.setContent(particle);
- }
- formatChild(parent.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- super.undo();
-
- if (parent instanceof XSDModelGroup)
- {
- XSDModelGroup model = (XSDModelGroup) parent;
- model.getContents().remove(newModelGroup.getContainer());
- }
- }
-
- private XSDConcreteComponent getOwner()
- {
- XSDConcreteComponent owner = null;
- if (parent instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration ed = (XSDElementDeclaration)parent;
- if (ed.getTypeDefinition() != null)
- {
- if (ed.getAnonymousTypeDefinition() == null)
- {
- ed.setTypeDefinition(null);
- XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- ed.setAnonymousTypeDefinition(td);
- owner = ed.getTypeDefinition();
- }
- else
- {
- XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- ed.setAnonymousTypeDefinition(td);
- owner = td;
- }
- }
- else if (ed.getAnonymousTypeDefinition() == null)
- {
- XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- ed.setAnonymousTypeDefinition(td);
- owner = td;
- }
- else if (ed.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
- {
- owner = ed.getAnonymousTypeDefinition();
- }
- else if (ed.getAnonymousTypeDefinition() instanceof XSDSimpleTypeDefinition)
- {
- XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- ed.setAnonymousTypeDefinition(td);
- owner = td;
- }
- }
- else if (parent instanceof XSDModelGroup)
- {
- newModelGroup = createModelGroup();
- ((XSDModelGroup) parent).getContents().add(newModelGroup.getContainer());
- }
- else if (parent instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
- owner = parent;
- if (ct.getContent() instanceof XSDParticle)
- {
- XSDParticle particle = (XSDParticle)ct.getContent();
- if (particle.getContent() instanceof XSDModelGroup)
- {
- owner = null;
- newModelGroup = createModelGroup();
- XSDModelGroup newParent = (XSDModelGroup)particle.getContent();
- newParent.getContents().add(newModelGroup.getContainer());
- }
-
- }
- }
- else if (parent instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition)parent;
- owner = null;
- newModelGroup = createModelGroup();
- if (modelGroupDefinition.getModelGroup() != null)
- {
- XSDModelGroup newParent = modelGroupDefinition.getModelGroup();
- newParent.getContents().add(newModelGroup.getContainer());
- }
- else
- {
- modelGroupDefinition.setModelGroup(newModelGroup);
- }
- }
- return owner;
- }
-
-
- protected boolean adopt(XSDConcreteComponent model)
- {
- return false;
- }
-
- protected XSDModelGroup createModelGroup()
- {
-
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDParticle particle = factory.createXSDParticle();
- XSDModelGroup modelGroup = factory.createXSDModelGroup();
- modelGroup.setCompositor(xsdCompositor);
- particle.setContent(modelGroup);
- addedXSDConcreteComponent = modelGroup;
- return modelGroup;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupDefinitionCommand.java
deleted file mode 100644
index 7e782d8294..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupDefinitionCommand.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-import org.w3c.dom.Text;
-
-public class AddXSDModelGroupDefinitionCommand extends BaseCommand
-{
- XSDConcreteComponent parent;
- boolean isReference;
-
- public AddXSDModelGroupDefinitionCommand(String label, XSDConcreteComponent parent, boolean isReference)
- {
- super(label);
- this.parent = parent;
- this.isReference = isReference;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute()
- {
- if (parent instanceof XSDSchema)
- {
- ensureSchemaElement((XSDSchema)parent);
- }
- try
- {
- beginRecording(parent.getElement());
- if (!isReference)
- {
- XSDModelGroupDefinition def = createXSDModelGroupDefinition();
- addedXSDConcreteComponent = def;
- }
- else
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDModelGroupDefinition def = factory.createXSDModelGroupDefinition();
- XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
- particle.setContent(def);
- List list = parent.getSchema().getModelGroupDefinitions();
- int length = list.size();
- if (length > 1)
- {
- for (int i = 0; i < length; i++)
- {
- XSDModelGroupDefinition gr = (XSDModelGroupDefinition) list.get(i);
- if (gr.getModelGroup() != parent)
- {
- def.setResolvedModelGroupDefinition(gr);
- }
- }
- }
- else if (length <= 1)
- {
- XSDModelGroupDefinition newGroupDef = createXSDModelGroupDefinition();
- def.setResolvedModelGroupDefinition(newGroupDef);
- }
-
- if (parent instanceof XSDModelGroup)
- {
- ((XSDModelGroup) parent).getContents().add(particle);
- }
- formatChild(def.getElement());
- addedXSDConcreteComponent = def;
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- protected XSDModelGroupDefinition createXSDModelGroupDefinition()
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDModelGroupDefinition def = factory.createXSDModelGroupDefinition();
- List list = parent.getSchema().getModelGroupDefinitions();
- String newName = XSDCommonUIUtils.createUniqueElementName("NewGroupDefinition", list); //$NON-NLS-1$
- def.setName(newName);
-
- XSDModelGroup modelGroup = createModelGroup();
- def.setModelGroup(modelGroup);
- Text textNode = parent.getSchema().getDocument().createTextNode("\n"); //$NON-NLS-1$
- parent.getSchema().getElement().appendChild(textNode);
- parent.getSchema().getContents().add(def);
- formatChild(def.getElement());
- return def;
- }
-
- protected XSDModelGroup createModelGroup()
- {
- XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
- XSDParticle particle = factory.createXSDParticle();
- XSDModelGroup modelGroup = factory.createXSDModelGroup();
- modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
- particle.setContent(modelGroup);
-
- return modelGroup;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDRedefineCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDRedefineCommand.java
deleted file mode 100644
index e2fd36721a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDRedefineCommand.java
+++ /dev/null
@@ -1,44 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDRedefineCommand extends AddXSDSchemaDirectiveCommand
-{
- public AddXSDRedefineCommand(String label, XSDSchema schema)
- {
- super(label);
- this.xsdSchema = schema;
- }
-
- public void execute()
- {
- super.execute();
- try
- {
- // Add this after if we don't have a DOM Node yet
- beginRecording(xsdSchema.getElement());
- XSDRedefine xsdRedefine = XSDFactory.eINSTANCE.createXSDRedefine();
- xsdRedefine.setSchemaLocation(""); //$NON-NLS-1$
- xsdSchema.getContents().add(findNextPositionToInsert(), xsdRedefine);
- addedXSDConcreteComponent = xsdRedefine;
- formatChild(xsdSchema.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java
deleted file mode 100644
index a4f9008868..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.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.wst.xsd.ui.internal.common.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-public abstract class AddXSDSchemaDirectiveCommand extends BaseCommand
-{
- protected XSDSchema xsdSchema;
-
- public AddXSDSchemaDirectiveCommand(String label)
- {
- super(label);
- }
-
- public void undo()
- {
- super.undo();
- }
-
- protected boolean adopt(XSDConcreteComponent model)
- {
- return false;
- }
-
- protected int findNextPositionToInsert()
- {
- int index = 0;
- for (Iterator i = xsdSchema.getContents().iterator(); i.hasNext(); )
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- index ++;
- }
- else
- {
- break;
- }
- }
- return index;
- }
-
- public void execute()
- {
- ensureSchemaElement(xsdSchema);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSimpleTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSimpleTypeDefinitionCommand.java
deleted file mode 100644
index 8cabbef36d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSimpleTypeDefinitionCommand.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Text;
-
-public final class AddXSDSimpleTypeDefinitionCommand extends BaseCommand
-{
- XSDConcreteComponent parent;
- XSDSimpleTypeDefinition createdSimpleType;
- private String nameToAdd;
-
- public AddXSDSimpleTypeDefinitionCommand(String label, XSDConcreteComponent parent)
- {
- super(label);
- this.parent = parent;
- }
-
- public void setNameToAdd(String nameToAdd)
- {
- this.nameToAdd = nameToAdd;
- }
-
- public void execute()
- {
- if (parent instanceof XSDSchema)
- {
- ensureSchemaElement((XSDSchema)parent);
- }
-
- try
- {
- beginRecording(parent.getElement());
- XSDSimpleTypeDefinition typeDef = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- typeDef.setBaseTypeDefinition(parent.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string")); //$NON-NLS-1$
-
- if (parent instanceof XSDSchema)
- {
- typeDef.setName(XSDCommonUIUtils.createUniqueElementName(nameToAdd == null ? "NewSimpleType" : nameToAdd, ((XSDSchema) parent).getTypeDefinitions())); //$NON-NLS-1$
- createdSimpleType = typeDef;
- try
- {
- XSDSchema xsdSchema = (XSDSchema) parent;
- Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
- xsdSchema.getElement().appendChild(textNode);
- xsdSchema.getContents().add(typeDef);
- }
- catch (Exception e)
- {
-
- }
- }
- else if (parent instanceof XSDElementDeclaration)
- {
- ((XSDElementDeclaration) parent).setAnonymousTypeDefinition(typeDef);
- }
- else if (parent instanceof XSDAttributeDeclaration)
- {
- ((XSDAttributeDeclaration) parent).setAnonymousTypeDefinition(typeDef);
- }
- formatChild(createdSimpleType.getElement());
-
- addedXSDConcreteComponent = createdSimpleType;
- }
- finally
- {
- endRecording();
- }
- }
-
- public XSDSimpleTypeDefinition getCreatedSimpleType()
- {
- return createdSimpleType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java
deleted file mode 100644
index 495fba8796..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-public class BaseCommand extends Command
-{
- private static final String XML = "xml"; //$NON-NLS-1$
-
- XSDConcreteComponent addedXSDConcreteComponent;
-
- public BaseCommand()
- {
- super();
- }
-
- public BaseCommand(String label)
- {
- // Commands inherit their name from the associated action.
- // This label shows up in the undo menu and it would look ugly with the mnemonic in it.
- // Ideally, we'd have separate strings.
-
- super(label != null ? label.replaceFirst("&", "") : "");
- }
-
- public XSDConcreteComponent getAddedComponent()
- {
- return addedXSDConcreteComponent;
- }
-
- IDOMNode domNode;
- protected void beginRecording(Object element) {
- if (element instanceof IDOMNode)
- {
- domNode = (IDOMNode) element;
- domNode.getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- protected void endRecording()
- {
- if (domNode != null)
- domNode.getModel().endRecording(this);
- }
-
- protected String getUndoDescription() {
- return getLabel();
- }
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
- protected static void ensureSchemaElement(XSDSchema schema)
- {
- Document document = schema.getDocument();
-
- Element schemaElement = document.getDocumentElement();
-
- if (schemaElement == null)
- {
- String targetNamespace = getDefaultNamespace(schema);
- schema.setTargetNamespace(targetNamespace);
- Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap();
- qNamePrefixToNamespaceMap.put("tns", targetNamespace);
- if (XSDEditorPlugin.getDefault().isQualifyXMLSchemaLanguage())
- {
- String prefix = XSDEditorPlugin.getDefault().getXMLSchemaPrefix();
- schema.setSchemaForSchemaQNamePrefix(prefix);
- qNamePrefixToNamespaceMap.put(prefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
- else
- {
- qNamePrefixToNamespaceMap.put(null, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
-
- schema.updateElement();
- ensureXMLDirective(document);
- }
- }
-
- private static void ensureXMLDirective(Document document)
- {
- if (hasXMLDirective(document))
- {
- return;
- }
-
- Node firstChild = document.getFirstChild();
- ProcessingInstruction xmlDeclaration = getXMLDeclaration(document);
- document.insertBefore(xmlDeclaration, firstChild);
- Text textNode = document.createTextNode(System.getProperty("line.separator"));
- document.insertBefore(textNode, firstChild);
- }
-
- private static boolean hasXMLDirective(Document document)
- {
- Node firstChild = document.getFirstChild();
-
- if (firstChild == null)
- {
- return false;
- }
-
- if (firstChild.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
- {
- return false;
- }
-
- ProcessingInstruction processingInstruction = (ProcessingInstruction)firstChild;
-
- if (!XML.equals(processingInstruction.getTarget()))
- {
- return false;
- }
-
- return true;
- }
-
- private static ProcessingInstruction getXMLDeclaration(Document document)
- {
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals(""))
- {
- charSet = "UTF-8";
- }
- ProcessingInstruction xmlDeclaration = document.createProcessingInstruction(XML, "version=\"1.0\" encoding=\"" + charSet + "\"");
- return xmlDeclaration;
- }
-
- private static String getDefaultNamespace(XSDSchema schema)
- {
- String namespace = XSDEditorPlugin.getDefault().getXMLSchemaTargetNamespace();
-
- if (!namespace.endsWith("/"))
- {
- namespace = namespace.concat("/");
- }
-
- namespace += getFileName(schema) + "/";
-
- return namespace;
-
- }
-
- private static String getFileName(XSDSchema schema)
- {
- URI schemaURI = schema.eResource().getURI();
- IPath filePath = new Path(schemaURI.toString());
- return filePath.removeFileExtension().lastSegment().toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ChangeToLocalSimpleTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ChangeToLocalSimpleTypeCommand.java
deleted file mode 100644
index bf10d8b590..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ChangeToLocalSimpleTypeCommand.java
+++ /dev/null
@@ -1,80 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class ChangeToLocalSimpleTypeCommand extends BaseCommand
-{
- XSDFeature parent;
- XSDSimpleTypeDefinition anonymousSimpleType;
- XSDSimpleTypeDefinition currentType;
-
- public ChangeToLocalSimpleTypeCommand(String label, XSDFeature parent)
- {
- super(label);
- this.parent = parent;
-
-// if (parent instanceof XSDElementDeclaration)
-// {
-// XSDElementDeclaration element = (XSDElementDeclaration) parent;
-// XSDTypeDefinition aType = element.getResolvedElementDeclaration().getTypeDefinition();
-//
-// if (aType instanceof XSDSimpleTypeDefinition)
-// {
-// currentType = (XSDSimpleTypeDefinition) aType;
-// }
-// }
- }
-
- public void execute()
- {
-// anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-// anonymousSimpleType.setBaseTypeDefinition(currentType);
- try
- {
- beginRecording(parent.getElement());
-
- if (parent instanceof XSDElementDeclaration)
- {
- ((XSDElementDeclaration) parent).setAnonymousTypeDefinition(anonymousSimpleType);
- }
- else if (parent instanceof XSDAttributeDeclaration)
- {
- ((XSDAttributeDeclaration) parent).setAnonymousTypeDefinition(anonymousSimpleType);
- }
- formatChild(parent.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
- public void setAnonymousSimpleType(XSDSimpleTypeDefinition anonymousSimpleType)
- {
- this.anonymousSimpleType = anonymousSimpleType;
- }
-
- public XSDSimpleTypeDefinition getAnonymousType()
- {
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(currentType);
- }
- return anonymousSimpleType;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
deleted file mode 100644
index 09cc838b8a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDVisitor;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class DeleteCommand extends BaseCommand
-{
- XSDConcreteComponent target;
-
- public DeleteCommand(String label, XSDConcreteComponent target)
- {
- super(label);
- this.target = target;
- }
-
- public DeleteCommand(XSDConcreteComponent target)
- {
- super(Messages._UI_ACTION_DELETE);
- this.target = target;
- }
-
- public void execute()
- {
- XSDVisitor visitor = new XSDVisitor()
- {
- public void visitElementDeclaration(org.eclipse.xsd.XSDElementDeclaration element)
- {
- if (element.getTypeDefinition() == target)
- {
- XSDSimpleTypeDefinition type = target.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
- element.setTypeDefinition(type);
- }
- super.visitElementDeclaration(element);
- }
- };
-
- XSDConcreteComponent parent = target.getContainer();
- XSDSchema schema = target.getSchema();
-
- try
- {
- beginRecording(parent.getElement());
- boolean doCleanup = false;
- if (target instanceof XSDModelGroup || target instanceof XSDElementDeclaration || target instanceof XSDModelGroupDefinition)
- {
- doCleanup = true;
- if (parent instanceof XSDParticle)
- {
- if (parent.getContainer() instanceof XSDModelGroup)
- {
- XSDModelGroup modelGroup = (XSDModelGroup) ((XSDParticle) parent).getContainer();
-
- modelGroup.getContents().remove(parent);
- }
- else if (parent.getContainer() instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) parent.getContainer();
- complexType.setContent(null);
- }
- }
- else if (parent instanceof XSDSchema)
- {
- visitor.visitSchema(target.getSchema());
- ((XSDSchema) parent).getContents().remove(target);
- }
- else if (parent instanceof XSDRedefine)
- {
- Object adapter = target.eAdapters().get(0);
- if (adapter instanceof XSDModelGroupDefinitionAdapter)
- {
- ((XSDModelGroupDefinitionAdapter) adapter).setReadOnly(true);
- ((XSDModelGroupDefinitionAdapter) adapter).setChangeReadOnlyField(true);
- }
- ((XSDRedefine) parent).getContents().remove(target);
- }
- }
- else if (target instanceof XSDAttributeDeclaration)
- {
- doCleanup = true;
- if (parent instanceof XSDAttributeUse)
- {
- EObject obj = parent.eContainer();
- XSDComplexTypeDefinition complexType = null;
- while (obj != null)
- {
- if (obj instanceof XSDComplexTypeDefinition)
- {
- complexType = (XSDComplexTypeDefinition) obj;
- break;
- }
- obj = obj.eContainer();
- }
- if (complexType != null)
- {
- complexType.getAttributeContents().remove(parent);
- }
-
- if (parent.getContainer() instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) parent.getContainer();
-
- attrGroup.getContents().remove(parent);
- }
- }
- else if (parent instanceof XSDSchema)
- {
- visitor.visitSchema(target.getSchema());
- ((XSDSchema) parent).getContents().remove(target);
- }
- }
- else if (target instanceof XSDAttributeGroupDefinition && parent instanceof XSDComplexTypeDefinition)
- {
- doCleanup = true;
- ((XSDComplexTypeDefinition) parent).getAttributeContents().remove(target);
- }
- else if (target instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumerationFacet = (XSDEnumerationFacet) target;
- enumerationFacet.getSimpleTypeDefinition().getFacetContents().remove(enumerationFacet);
- }
- else if (target instanceof XSDWildcard)
- {
- if (parent instanceof XSDParticle)
- {
- if (parent.getContainer() instanceof XSDModelGroup)
- {
- XSDModelGroup modelGroup = (XSDModelGroup) ((XSDParticle) parent).getContainer();
- modelGroup.getContents().remove(parent);
- }
- }
- else if (parent instanceof XSDComplexTypeDefinition)
- {
- ((XSDComplexTypeDefinition) parent).setAttributeWildcardContent(null);
- }
- else if (parent instanceof XSDAttributeGroupDefinition)
- {
- ((XSDAttributeGroupDefinition) parent).setAttributeWildcardContent(null);
- }
- }
- else if (target instanceof XSDTypeDefinition && parent instanceof XSDElementDeclaration)
- {
- doCleanup = true;
- ((XSDElementDeclaration) parent).setTypeDefinition(target.resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
- }
- else
- {
- if (parent instanceof XSDSchema)
- {
- doCleanup = true;
- visitor.visitSchema(target.getSchema());
- ((XSDSchema) parent).getContents().remove(target);
- }
- else if(parent instanceof XSDRedefine)
- {
- doCleanup = false;
- EList contents = ((XSDRedefine)parent).getContents();
- Object adapter = target.eAdapters().get(0);
- if (adapter instanceof XSDComplexTypeDefinitionAdapter)
- {
-
- ((XSDComplexTypeDefinitionAdapter) adapter).setReadOnly(true);
- ((XSDComplexTypeDefinitionAdapter) adapter).setChangeReadOnlyField(true);
- }
- else if (adapter instanceof XSDSimpleTypeDefinitionAdapter)
- {
-
- ((XSDSimpleTypeDefinitionAdapter) adapter).setReadOnly(true);
- ((XSDSimpleTypeDefinitionAdapter) adapter).setChangeReadOnlyField(true);
- }
- else if (adapter instanceof XSDAttributeGroupDefinitionAdapter)
- {
-
- ((XSDAttributeGroupDefinitionAdapter) adapter).setReadOnly(true);
- ((XSDAttributeGroupDefinitionAdapter) adapter).setChangeReadOnlyField(true);
- }
- contents.remove(target);
- }
- }
-
- if (doCleanup)
- XSDDirectivesManager.removeUnusedXSDImports(schema);
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java
deleted file mode 100644
index 6ce4c73635..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.xsd.ui.internal.common.commands;
-
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class ExtensibleAddExtensionCommand extends AddExtensionCommand
-{
- protected XSDElementDeclaration element;
- protected Element appInfo;
- protected Element newElement;
-
- public ExtensibleAddExtensionCommand(String label)
- {
- super(label);
- }
-
- public XSDElementDeclaration getXSDElementDeclarationElement()
- {
- return element;
- }
-
- public Element getNewElement()
- {
- return newElement;
- }
-
- public Element getAppInfo()
- {
- return appInfo;
- }
-
- public XSDSchema getXSDSchema()
- {
- return component.getSchema();
- }
-
- public void setInputs(XSDConcreteComponent input, XSDElementDeclaration element)
- {
- this.component = input;
- this.element = element;
- }
-
- public XSDAnnotation getXSDAnnotation()
- {
- if (component != null)
- {
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, false);
- return xsdAnnotation;
- }
- return null;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(component.getElement());
- super.execute();
- doPreprocessing();
- addExtensionNode();
- doCustomizedActions();
-
- formatChild(component.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
- protected void doPreprocessing()
- {
-
- }
-
- protected void addExtensionNode()
- {
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, true);
- XSDSchema schema= xsdAnnotation.getSchema();
- Element schemaElement = schema.getElement();
-
- if (xsdAnnotation.getApplicationInformation().size() == 0)
- {
- appInfo = xsdAnnotation.createApplicationInformation(null);
- xsdAnnotation.getElement().appendChild(appInfo);
- List appInfos = xsdAnnotation.getApplicationInformation();
- appInfos.add(appInfo);
- }
- else
- {
- // use the first appInfo
- appInfo = (Element)xsdAnnotation.getApplicationInformation().get(0);
- }
-
- if (appInfo != null)
- {
- Document doc = appInfo.getOwnerDocument();
- String prefix = addToNamespaceTable(schemaElement);
- newElement = doc.createElementNS(extensionsSchemaSpec.getNamespaceURI(), element.getName());
- newElement.setPrefix(prefix);
- appInfo.appendChild(newElement);
-
- xsdAnnotation.updateElement();
- }
- }
-
- protected String addToNamespaceTable(Element schemaElement)
- {
- String prefix = addNamespaceDeclarationIfRequired(schemaElement, "p", extensionsSchemaSpec.getNamespaceURI());
- return prefix;
- }
-
-
- protected void doCustomizedActions()
- {
-
- }
-
- public void undo()
- {
- super.undo();
- }
-
- public Object getNewObject()
- {
- return newElement;
- }
-
- // TODO... common this up with wsdl.ui
- protected String addNamespaceDeclarationIfRequired(Element schemaElement, String prefixHint, String namespace)
- {
- String prefix = null;
- NamespaceTable namespaceTable = new NamespaceTable(schemaElement.getOwnerDocument());
- namespaceTable.addElement(schemaElement);
- prefix = namespaceTable.getPrefixForURI(namespace);
- if (prefix == null)
- {
- String basePrefix = prefixHint;
- prefix = basePrefix;
- String xmlnsColon = "xmlns:"; //$NON-NLS-1$
- String attributeName = xmlnsColon + prefix;
- int count = 0;
- while (schemaElement.hasAttribute(attributeName))
- {
- count++;
- prefix = basePrefix + count;
- attributeName = xmlnsColon + prefix;
- }
- schemaElement.setAttribute(attributeName, namespace);
- }
- return prefix;
- }
-
- protected void addSchemaAttribute(Element schemaElement, String namespace, String attributeName, String attributeValue)
- {
- String prefix = null;
- NamespaceTable namespaceTable = new NamespaceTable(schemaElement.getOwnerDocument());
- namespaceTable.addElement(schemaElement);
- prefix = namespaceTable.getPrefixForURI(namespace);
- try
- {
- if (prefix != null)
- {
- if (schemaElement.getAttributeNode(prefix + ":" + attributeName) == null)
- schemaElement.setAttribute(prefix + ":" + attributeName, attributeValue);
- }
- else
- {
- if (schemaElement.getAttributeNode(attributeName) == null)
- schemaElement.setAttribute(attributeName, attributeValue);
- }
- }
- catch (Exception e)
- {
-
- }
- }
-
- protected void addSourceAttributeToAppInfo(String namespace)
- {
- if (appInfo.getAttributeNode(XSDConstants.SOURCE_ATTRIBUTE) == null)
- appInfo.setAttribute(XSDConstants.SOURCE_ATTRIBUTE, namespace);
- }
-
- /**
- *
- * @param element
- * @param attributeName
- * @param attributeValue
- */
- protected void addAttribute(Element element, String attributeName, String attributeValue)
- {
- element.setAttribute(attributeName, attributeValue);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleRemoveExtensionNodeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleRemoveExtensionNodeCommand.java
deleted file mode 100644
index cb5ff38f82..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleRemoveExtensionNodeCommand.java
+++ /dev/null
@@ -1,94 +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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-public class ExtensibleRemoveExtensionNodeCommand extends BaseCommand
-{
- protected Node node;
- protected XSDConcreteComponent input;
-
- public ExtensibleRemoveExtensionNodeCommand(String label)
- {
- super(label);
- }
-
- public void setNode(Node node)
- {
- this.node = node;
- }
-
- public XSDConcreteComponent getInput()
- {
- return input;
- }
-
- public void setInput(XSDConcreteComponent input)
- {
- this.input = input;
- }
-
- public void execute()
- {
- super.execute();
- try
- {
- beginRecording(node);
-
- doPreprocessing();
-
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Attr attr = (Attr) node;
- attr.getOwnerElement().removeAttributeNode(attr);
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Node parent = node.getParentNode();
- if (parent != null)
- {
- XSDDOMHelper.removeNodeAndWhitespace(node);
-
- if (XSDDOMHelper.hasOnlyWhitespace(parent))
- {
- if (XSDConstants.APPINFO_ELEMENT_TAG.equals(parent.getLocalName()))
- {
- XSDDOMHelper.removeNodeAndWhitespace(parent);
- }
- }
- }
- }
-
- doCustomizedActions();
-
- }
- finally
- {
- endRecording();
- }
- }
-
- protected void doPreprocessing()
- {
-
- }
-
- protected void doCustomizedActions()
- {
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java
deleted file mode 100644
index 3d473b4e8d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java
+++ /dev/null
@@ -1,36 +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.wst.xsd.ui.internal.common.commands;
-
-
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-/**
- * Creates a redefined attribute group based on the input attribute group and adds it to the parent redefine.
- */
-public class RedefineAttributeGroupCommand extends AddRedefinedComponentCommand
-{
- public RedefineAttributeGroupCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- super(label, redefine, redefinableComponent);
- }
-
- protected void doExecute()
- {
- XSDAttributeGroupDefinition redefinedAttributeGroupDefinition = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
- redefinedAttributeGroupDefinition.setName(redefinableComponent.getName());
- addedXSDConcreteComponent = redefinedAttributeGroupDefinition;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java
deleted file mode 100644
index 34dad50c1f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java
+++ /dev/null
@@ -1,40 +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.wst.xsd.ui.internal.common.commands;
-
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-/**
- * Creates a redefined complex type based on the input complex type and adds it to the parent redefine.
- */
-public class RedefineComplexTypeCommand extends AddRedefinedComponentCommand
-{
- public RedefineComplexTypeCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- super(label, redefine, redefinableComponent);
- }
-
- protected void doExecute()
- {
- XSDComplexTypeDefinition redefinedComplexTypeDefinition = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- redefinedComplexTypeDefinition.setName(redefinableComponent.getName());
- redefinedComplexTypeDefinition.setContent(XSDFactory.eINSTANCE.createXSDComplexTypeDefinition().getContent());
- redefinedComplexTypeDefinition.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
- redefinedComplexTypeDefinition.setBaseTypeDefinition((XSDComplexTypeDefinition)redefinableComponent);
- addedXSDConcreteComponent = redefinedComplexTypeDefinition;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java
deleted file mode 100644
index 7366eebefc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java
+++ /dev/null
@@ -1,36 +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.wst.xsd.ui.internal.common.commands;
-
-
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-
-
-/**
- * Creates a redefined model group based on the input model group and adds it to the parent redefine.
- */
-public class RedefineModelGroupCommand extends AddRedefinedComponentCommand
-{
-
- public RedefineModelGroupCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- super(label, redefine, redefinableComponent);
- }
-
- protected void doExecute()
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) redefinableComponent;
- XSDModelGroupDefinition redefinedModelGroupDefinition = (XSDModelGroupDefinition)modelGroup.cloneConcreteComponent(true, false);
- addedXSDConcreteComponent = redefinedModelGroupDefinition;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java
deleted file mode 100644
index 00765ae3d1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java
+++ /dev/null
@@ -1,38 +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.wst.xsd.ui.internal.common.commands;
-
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDRedefinableComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-/**
- * Creates a redefined simple type based on the input simple type and adds it to the parent redefine.
- */
-public class RedefineSimpleTypeCommand extends AddRedefinedComponentCommand
-{
- public RedefineSimpleTypeCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
- {
- super(label, redefine, redefinableComponent);
- }
-
- protected void doExecute()
- {
- XSDSimpleTypeDefinition redefinedSimpleTypeDefinition = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- redefinedSimpleTypeDefinition.setName(redefinableComponent.getName());
- redefinedSimpleTypeDefinition.setBaseTypeDefinition((XSDSimpleTypeDefinition)redefinableComponent);
- addedXSDConcreteComponent = redefinedSimpleTypeDefinition;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java
deleted file mode 100644
index a173a43def..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java
+++ /dev/null
@@ -1,43 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * @deprecated
- */
-public class RemoveExtensionAttributerCommand extends Command
-{
- Element hostElement;
- Attr attr;
-
- public RemoveExtensionAttributerCommand(String label, Element hostElement, Attr attr)
- {
- super(label);
- this.hostElement = hostElement;
- this.attr = attr;
- }
-
- public void execute()
- {
- super.execute();
- hostElement.removeAttributeNode(attr);
- }
-
- public void undo()
- {
- super.undo();
- //TODO implement me
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java
deleted file mode 100644
index d33c756093..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java
+++ /dev/null
@@ -1,46 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDAnnotation;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated
- */
-public class RemoveExtensionElementCommand extends Command
-{
- XSDAnnotation xsdAnnotation;
- Node appInfo;
-
- public RemoveExtensionElementCommand(String label, XSDAnnotation xsdAnnotation, Node appInfo)
- {
- super(label);
- this.xsdAnnotation = xsdAnnotation;
- this.appInfo = appInfo;
- }
-
- public void execute()
- {
- super.execute();
- xsdAnnotation.getApplicationInformation().remove(appInfo);
- xsdAnnotation.getElement().removeChild(appInfo);
- xsdAnnotation.updateElement();
- }
-
- public void undo()
- {
- super.undo();
- xsdAnnotation.getApplicationInformation().add(appInfo);
- xsdAnnotation.getElement().appendChild(appInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionNodeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionNodeCommand.java
deleted file mode 100644
index e41166b976..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionNodeCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-public class RemoveExtensionNodeCommand extends BaseCommand
-{
- Node node;
-
- public RemoveExtensionNodeCommand(String label, Node node)
- {
- super(label);
- this.node = node;
- }
-
- public void execute()
- {
- super.execute();
- try
- {
- beginRecording(node);
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Attr attr = (Attr) node;
- attr.getOwnerElement().removeAttributeNode(attr);
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Node parent = node.getParentNode();
- if (parent != null)
- {
- XSDDOMHelper.removeNodeAndWhitespace(node);
-
- if (XSDDOMHelper.hasOnlyWhitespace(parent))
- {
- if (XSDConstants.APPINFO_ELEMENT_TAG.equals(parent.getLocalName()))
- {
- XSDDOMHelper.removeNodeAndWhitespace(parent);
- }
- }
- }
- }
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java
deleted file mode 100644
index 1ec47ce5a6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class SetBaseTypeAndManagerDirectivesCommand extends UpdateTypeReferenceAndManageDirectivesCommand
-{
-
- public SetBaseTypeAndManagerDirectivesCommand(XSDConcreteComponent concreteComponent, String componentName, String componentNamespace, IFile file)
- {
- super(concreteComponent, componentName, componentNamespace, file);
- }
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
- XSDComponent td = computeComponent();
- if (td != null && td instanceof XSDTypeDefinition)
- {
- SetBaseTypeCommand command = new SetBaseTypeCommand(concreteComponent, (XSDTypeDefinition) td);
- command.execute();
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- }
- catch (Exception e)
- {
-
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java
deleted file mode 100644
index 7b74ec92a2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-
-public class SetBaseTypeCommand extends BaseCommand
-{
- XSDConcreteComponent concreteComponent;
- XSDTypeDefinition baseType;
- XSDBaseAdapter adapter;
-
-
- public SetBaseTypeCommand(XSDConcreteComponent concreteComponent, XSDTypeDefinition baseType)
- {
- super(Messages._UI_ACTION_SET_BASE_TYPE);
- this.concreteComponent = concreteComponent;
- this.baseType = baseType;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
- if (concreteComponent instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) concreteComponent;
- XSDComplexTypeContent contentType = (baseType instanceof XSDComplexTypeDefinition) ? ((XSDComplexTypeDefinition)baseType).getContentType() : null;
-
- // Complex type simple content
- if (baseType instanceof XSDSimpleTypeDefinition || (contentType != null && contentType instanceof XSDSimpleTypeDefinition))
- {
- if (!(complexType.getContent() instanceof XSDSimpleTypeDefinition))
- {
- XSDSimpleTypeDefinition simpleContent = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- complexType.setContent(simpleContent);
- }
- }
- // Complex type complex content
- else if(baseType instanceof XSDComplexTypeDefinition)
- {
- if(!(complexType.getContent() instanceof XSDComplexTypeDefinition))
- {
- XSDComplexTypeDefinition complexContent = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- complexType.setContent(complexContent.getContent());
- }
- }
- complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
- complexType.setBaseTypeDefinition(baseType);
- // vb This call should not be needed. The XSD Infoset model should reconcile itself properly.
- complexType.updateElement(true);
- formatChild(complexType.getElement());
- }
- else if (concreteComponent instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) concreteComponent;
- if (baseType instanceof XSDSimpleTypeDefinition)
- {
- XSDVariety variety = simpleType.getVariety();
- if (variety.getValue() == XSDVariety.ATOMIC)
- {
- simpleType.setBaseTypeDefinition((XSDSimpleTypeDefinition) baseType);
- }
- else if (variety.getValue() == XSDVariety.UNION)
- {
- simpleType.getMemberTypeDefinitions().add(baseType);
- }
- else if (variety.getValue() == XSDVariety.LIST)
- {
- simpleType.setItemTypeDefinition((XSDSimpleTypeDefinition) baseType);
- }
- }
- }
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetMultiplicityCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetMultiplicityCommand.java
deleted file mode 100644
index 1679feca03..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetMultiplicityCommand.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-
-public class SetMultiplicityCommand extends BaseCommand
-{
- XSDConcreteComponent parent;
- int maxOccurs, minOccurs;
-
- /**
- * @param parent
- */
- public SetMultiplicityCommand(String label)
- {
- super(label);
- }
-
- public void setMaxOccurs(int i)
- {
- maxOccurs=i;
- }
-
- public void setMinOccurs(int i)
- {
- minOccurs=i;
- }
-
- public void setXSDConcreteComponent(XSDConcreteComponent parent)
- {
- this.parent = parent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
- */
- public void execute()
- {
- try
- {
- beginRecording(parent.getElement());
- if (parent instanceof XSDParticleContent)
- {
- XSDParticleContent xsdParticleContent = (XSDParticleContent) parent;
- XSDParticle xsdParticle = (XSDParticle) xsdParticleContent.getContainer();
- if (maxOccurs < 0)
- {
- maxOccurs = XSDParticle.UNBOUNDED;
- }
- xsdParticle.setMaxOccurs(maxOccurs);
- xsdParticle.setMinOccurs(minOccurs);
- }
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetTypeCommand.java
deleted file mode 100644
index da4cb49c22..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetTypeCommand.java
+++ /dev/null
@@ -1,116 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class SetTypeCommand extends BaseCommand
-{
- XSDConcreteComponent parent;
- private boolean continueApply;
- XSDBaseAdapter adapter;
- String action;
-
- public SetTypeCommand(String label, String ID, XSDConcreteComponent parent)
- {
- super(label);
- this.parent = parent;
- this.action = ID;
- }
-
- public void setAdapter(XSDBaseAdapter adapter)
- {
- this.adapter = adapter;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(parent.getElement());
- ComponentReferenceEditManager componentReferenceEditManager = getComponentReferenceEditManager();
- continueApply = true;
- if (parent instanceof XSDElementDeclaration)
- {
- if (action.equals(SetTypeAction.SET_NEW_TYPE_ID))
- {
- ComponentSpecification newValue = (ComponentSpecification) invokeDialog(componentReferenceEditManager.getNewDialog());
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(adapter, newValue);
- }
- else
- {
- ComponentSpecification newValue = (ComponentSpecification) invokeDialog(componentReferenceEditManager.getBrowseDialog());
- if (continueApply)
- componentReferenceEditManager.modifyComponentReference(adapter, newValue);
- }
- formatChild(parent.getElement());
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- private Object invokeDialog(IComponentDialog dialog)
- {
- Object newValue = null;
-
- if (dialog == null)
- {
- return null;
- }
-
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- }
- else
- {
- continueApply = false;
- }
-
- return newValue;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- }
- return result;
- }
-
- private IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java
deleted file mode 100644
index 45c6884bb7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFacet;
-
-public class SetXSDFacetValueCommand extends BaseCommand
-{
- protected XSDFacet facet;
- protected String value;
-
- public SetXSDFacetValueCommand(String label, XSDFacet facet)
- {
- super(label);
- this.facet = facet;
- }
-
- public SetXSDFacetValueCommand(String label, XSDFacet facet, String value)
- {
- super(label);
- this.facet = facet;
- this.value = value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(facet.getElement());
- facet.setLexicalValue(value);
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java
deleted file mode 100644
index 7d38b4cb5c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java
+++ /dev/null
@@ -1,60 +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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class UpdateAttributeReferenceAndManagerDirectivesCommand extends UpdateComponentReferenceAndManageDirectivesCommand
-{
-
- public UpdateAttributeReferenceAndManagerDirectivesCommand(XSDConcreteComponent concreteComponent, String componentName, String componentNamespace, IFile file)
- {
- super(concreteComponent, componentName, componentNamespace, file);
- }
-
- protected XSDComponent getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace)
- {
- XSDAttributeDeclaration result = schema.resolveAttributeDeclaration(componentNamespace, componentName);
- if (result.eContainer() == null)
- {
- result = null;
- }
- return result;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
- XSDComponent componentDef = computeComponent();
- if (componentDef != null)
- {
- UpdateAttributeReferenceCommand command = new UpdateAttributeReferenceCommand(org.eclipse.wst.xsd.ui.internal.editor.Messages._UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE, (XSDAttributeDeclaration) concreteComponent,
- (XSDAttributeDeclaration) componentDef);
- command.execute();
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- }
- catch (Exception e)
- {
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceCommand.java
deleted file mode 100644
index 6af63752d3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceCommand.java
+++ /dev/null
@@ -1,38 +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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-
-public class UpdateAttributeReferenceCommand extends BaseCommand
-{
- XSDAttributeDeclaration attribute, ref;
-
- public UpdateAttributeReferenceCommand(String label, XSDAttributeDeclaration attribute, XSDAttributeDeclaration ref)
- {
- super(label);
- this.attribute = attribute;
- this.ref = ref;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(attribute.getElement());
- attribute.setResolvedAttributeDeclaration(ref);
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java
deleted file mode 100644
index b76f241939..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.w3c.dom.Element;
-
-/*
- * This command is used from the extension view to edit extension elements
- * and attributes which are implemented as DOM objects (not part of the EMF model)
- *
- * (trung) also used in XSDComplexTypeAdvancedSection to change attribute of
- * specical attributes like block, restriction which is not part of EMF Model
- */
-public class UpdateAttributeValueCommand extends BaseCommand
-{
- protected Element element;
- protected String attributeName;
- protected String attributeValue;
-
- /** Whether the attribute should be deleted if value to
- * be set is an empty String or null */
- protected boolean deleteIfValueEmpty = false;
-
- public UpdateAttributeValueCommand(Element element, String attributeName, String attributeValue, boolean deleteIfValueEmpty)
- {
- this.element = element;
- this.attributeName = attributeName;
- this.attributeValue = attributeValue;
- this.deleteIfValueEmpty = deleteIfValueEmpty;
- }
-
- public UpdateAttributeValueCommand(Element element, String attributeName, String attributeValue, String label)
- {
- this(element, attributeName, attributeValue, false);
-
- // The command label is shared with the actual UI label, which contains
- // mnemonics and colon characters. Since we don't want these to show up in
- // the undo menu we do a little bit of regular expression magic here to remove them.
-
- setLabel(NLS.bind(Messages._UI_ACTION_CHANGE, label.replaceAll("[&:]", "")));
- }
-
- public UpdateAttributeValueCommand(Element element, String attributeName, String attributeValue)
- {
- this(element, attributeName, attributeValue, false);
- setLabel(NLS.bind(Messages._UI_ACTION_CHANGE, attributeName));
- }
-
- public void setDeleteIfEmpty(boolean v)
- {
- deleteIfValueEmpty = v;
- }
-
- public void setAttributeName(String attributeName)
- {
- this.attributeName = attributeName;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(element);
- if (deleteIfValueEmpty &&
- (attributeValue == null || attributeValue.equals("") ) )
- {
- element.removeAttribute(attributeName);
- }
- else
- {
- element.setAttribute(attributeName, attributeValue);
- }
-
- doPostProcessing();
- }
- finally
- {
- endRecording();
- }
- }
-
- protected void doPostProcessing()
- {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java
deleted file mode 100644
index facae6a3d3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class UpdateComplexTypeDerivationBy extends BaseCommand
-{
- private XSDComplexTypeDefinition complexType;
- private String derivation;
-
- public UpdateComplexTypeDerivationBy(XSDComplexTypeDefinition complexType, String derivation)
- {
- this.complexType = complexType;
- this.derivation = derivation;
- // TODO: use new Message bundle mechanism
- setLabel(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"));
- }
-
- public void execute()
- {
- super.execute();
- try
- {
- beginRecording(complexType.getElement());
- XSDTypeDefinition originalBaseType = complexType.getBaseType();
- if (derivation.equals(XSDConstants.EXTENSION_ELEMENT_TAG))
- {
- complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
- }
- else if (derivation.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
- {
- complexType.setDerivationMethod(XSDDerivationMethod.RESTRICTION_LITERAL);
- }
- complexType.setBaseTypeDefinition(originalBaseType);
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index 9a23f365bc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.util.XSDResourceImpl;
-public abstract class UpdateComponentReferenceAndManageDirectivesCommand extends BaseCommand
-{
- protected XSDConcreteComponent concreteComponent;
- protected String componentName;
- protected String componentNamespace;
- protected IFile file;
-
- public UpdateComponentReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent, String componentName, String componentNamespace, IFile file)
- {
- this.concreteComponent = concreteComponent;
- this.componentName = componentName;
- this.componentNamespace = componentNamespace;
- this.file = file;
- }
-
- protected XSDComponent computeComponent()
- {
- XSDComponent result = null;
- XSDSchema schema = concreteComponent.getSchema();
- XSDSchemaDirective directive = null;
-
- // lets see if the element is already visible to our schema
- result = getDefinedComponent(schema, componentName, componentNamespace);
- if (result == null)
- {
- // TODO (cs) we need to provide a separate command to do this part
- //
- // apparently the element is not yet visible, we need to add
- // includes/imports to get to it
- if (componentNamespace != null && componentNamespace.equals(schema.getTargetNamespace()))
- {
- // we need to add an include
- // if the component's namespace is not null and matches the schema's
- // target namespace
- directive = XSDFactory.eINSTANCE.createXSDInclude();
- }
- else if (componentNamespace == null)
- {
- // we need to add an include
- // if the component's namespace is null, then we can just add it
- // only if the current namespace is not null
- directive = XSDFactory.eINSTANCE.createXSDInclude();
-
- // we have to ensure the schema for schema prefix is NOT null
- if (schema.getSchemaForSchemaQNamePrefix() == null)
- {
- String targetNS = schema.getTargetNamespace();
- if (targetNS == null)
- targetNS = "";
- // this will just update the schema for schema prefix to be, say, xsd
- UpdateNamespaceInformationCommand command = new UpdateNamespaceInformationCommand("", schema, "", targetNS);
- command.execute();
- }
- }
- else
- {
- // we need to add an import
- XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
- xsdImport.setNamespace(componentNamespace);
- directive = xsdImport;
- }
-
- String location = computeNiceLocation(schema.getSchemaLocation(), file);
- directive.setSchemaLocation(location);
- // TODO (cs) we should at the directive 'next' in the list of directives
- // for now I'm just adding as the first thing in the schema :-(
- //
- schema.getContents().add(0, directive);
- XSDSchema resolvedSchema = directive.getResolvedSchema();
- if (resolvedSchema == null)
- {
- String platformLocation = "platform:/resource" + file.getFullPath();
- Resource resource = concreteComponent.eResource().getResourceSet().createResource(URI.createURI(platformLocation));
- if (resource instanceof XSDResourceImpl)
- {
- try
- {
- resource.load(null);
- XSDResourceImpl resourceImpl = (XSDResourceImpl) resource;
- resolvedSchema = resourceImpl.getSchema();
- if (resolvedSchema != null)
- {
- directive.setResolvedSchema(resolvedSchema);
- }
- }
- catch (Exception e)
- {
- }
- }
- }
- if (resolvedSchema != null)
- {
- result = getDefinedComponent(resolvedSchema, componentName, componentNamespace);
- }
- else
- {
- // TODO (cs) consider setting some error state so that the client can
- // provide a pop-dialog error
- // we should also remove the import/include so save from cluttering
- // the file with bogus directives
- }
- }
-
- return result;
- }
-
- private final static String PLATFORM_RESOURCE_PREFIX = "platform:/resource";
- private String computeNiceLocation(String baseLocation, IFile file)
- {
- if (baseLocation.startsWith(PLATFORM_RESOURCE_PREFIX))
- {
- URI baseURI = URI.createURI(baseLocation);
- URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString());
- URI relative = fileURI.deresolve(baseURI, false, true, true);
- return relative.toString();
- }
- else
- {
- URI baseURI = URI.createURI(baseLocation);
- URI fileURI = URI.createFileURI(file.getLocation().toOSString());
- URI relative = fileURI.deresolve(baseURI, false, true, true);
- return relative.toString();
- }
- }
-
- protected abstract XSDComponent getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace);
-
- public abstract void execute();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateContentModelCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateContentModelCommand.java
deleted file mode 100644
index 87a560efbb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateContentModelCommand.java
+++ /dev/null
@@ -1,49 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class UpdateContentModelCommand extends BaseCommand
-{
- XSDModelGroup xsdModelGroup;
- XSDCompositor oldXSDCompositor, newXSDCompositor;
-
-
- public UpdateContentModelCommand(String label, XSDModelGroup xsdModelGroup, XSDCompositor xsdCompositor)
- {
- super(label);
- this.xsdModelGroup = xsdModelGroup;
- this.newXSDCompositor = xsdCompositor;
- this.oldXSDCompositor = xsdModelGroup.getCompositor();
- }
-
-
- public void execute()
- {
- try
- {
- super.execute();
- beginRecording(xsdModelGroup.getElement());
- xsdModelGroup.setCompositor(newXSDCompositor);
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- xsdModelGroup.setCompositor(oldXSDCompositor);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index b8aeb47443..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class UpdateElementReferenceAndManageDirectivesCommand extends UpdateComponentReferenceAndManageDirectivesCommand
-{
- public UpdateElementReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent, String componentName, String componentNamespace, IFile file)
- {
- super(concreteComponent, componentName, componentNamespace, file);
- }
-
- protected XSDComponent getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace)
- {
- XSDElementDeclaration result = schema.resolveElementDeclaration(componentNamespace, componentName);
- if (result.eContainer() == null)
- {
- result = null;
- }
- return result;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
- XSDComponent elementDef = computeComponent();
- if (elementDef != null)
- {
- UpdateElementReferenceCommand command = new UpdateElementReferenceCommand(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE, (XSDElementDeclaration) concreteComponent,
- (XSDElementDeclaration) elementDef);
- command.execute();
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- }
- catch (Exception e)
- {
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceCommand.java
deleted file mode 100644
index d4b52781f4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceCommand.java
+++ /dev/null
@@ -1,39 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class UpdateElementReferenceCommand extends BaseCommand
-{
- XSDElementDeclaration element, ref;
-
- public UpdateElementReferenceCommand(String label, XSDElementDeclaration element, XSDElementDeclaration ref)
- {
- super(label);
- this.element = element;
- this.ref = ref;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(element.getElement());
- element.setResolvedElementDeclaration(ref);
- }
- finally
- {
- endRecording();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java
deleted file mode 100644
index d159eb17a9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class UpdateMaxOccursCommand extends BaseCommand
-{
- private int oldMaxOccurs;
- private int newMaxOccurs;
- private boolean removeMaxOccursAttribute;
-
- XSDParticle particle;
-
- public UpdateMaxOccursCommand(String label, XSDParticle particle, int MaxOccurs)
- {
- super(label);
- this.newMaxOccurs = MaxOccurs;
- this.particle = particle;
- }
-
- public void execute()
- {
- try
- {
- Element element = particle.getElement();
- beginRecording(element);
- removeMaxOccursAttribute = (!(element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE)))? true: false;
- oldMaxOccurs = particle.getMaxOccurs();
- particle.setMaxOccurs(newMaxOccurs);
- }
- finally
- {
- endRecording();
- }
- }
-
- public void redo()
- {
- execute();
- }
-
- public void undo()
- {
- if (removeMaxOccursAttribute)
- {
- particle.unsetMaxOccurs();
- }
- else
- {
- particle.setMaxOccurs(oldMaxOccurs);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java
deleted file mode 100644
index 5e317665a6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDAttributeUseCategory;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class UpdateMinOccursCommand extends BaseCommand
-{
- private int oldMinOccurs;
- private int newMinOccurs;
- private boolean removeMinOccursAttribute;
-
- XSDComponent component;
-
- public UpdateMinOccursCommand(String label, XSDComponent component, int minOccurs)
- {
- super(label);
- this.newMinOccurs = minOccurs;
- this.component = component;
- }
-
- public void execute()
- {
- Element element = component.getElement();
- try
- {
- beginRecording(element);
- removeMinOccursAttribute = (!(element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE))) ? true : false;
-
- if (component instanceof XSDParticle)
- {
- oldMinOccurs = ((XSDParticle) component).getMinOccurs();
- ((XSDParticle) component).setMinOccurs(newMinOccurs);
- }
- else if (component instanceof XSDAttributeUse)
- {
- oldMinOccurs = (((XSDAttributeUse) component).getUse() == XSDAttributeUseCategory.REQUIRED_LITERAL ? 1 : 0);
- if (newMinOccurs == 1)
- ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
- else
- ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- public void undo()
- {
- if (component instanceof XSDParticle)
- {
- if (removeMinOccursAttribute)
- {
- ((XSDParticle) component).unsetMinOccurs();
- }
- else
- {
- ((XSDParticle) component).setMinOccurs(oldMinOccurs);
- }
- }
- else if (component instanceof XSDAttributeUse)
- {
- if (removeMinOccursAttribute)
- {
- ((XSDParticle) component).unsetMinOccurs();
- }
- else
- {
- if (oldMinOccurs == 1)
- ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
- else
- ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNameCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNameCommand.java
deleted file mode 100644
index 730a7c2790..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNameCommand.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.refactor.PerformUnsavedRefactoringOperation;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class UpdateNameCommand extends BaseCommand
-{
-// private String oldName;
- private String newName;
- private XSDNamedComponent component;
-
- public UpdateNameCommand(String label, XSDNamedComponent component, String newName)
- {
- super(label);
-
- if (component instanceof XSDComplexTypeDefinition && component.getName() == null && component.eContainer() instanceof XSDNamedComponent && ((XSDNamedComponent) component.eContainer()).getName() != null)
- {
- component = (XSDNamedComponent) component.eContainer();
- }
-
- this.component = component;
- this.newName = newName;
-// this.oldName = component.getName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute()
- {
- try
- {
- beginRecording(component.getElement());
- renameComponent(newName);
- }
- finally
- {
- endRecording();
- }
- }
-
- /**
- * Performs a rename refactoring to rename the component and all the
- * references to it within the current schema.
- *
- * @param newName the new component name.
- */
- private void renameComponent(String newName)
- {
- // this is a 'globally' defined component (e.g. global element)
- if (component.eContainer() instanceof XSDSchema)
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorInput editorInput = page.getActiveEditor().getEditorInput();
- if (editorInput instanceof FileEditorInput)
- {
- RefactoringComponent refactoringComponent = new XMLRefactoringComponent(
- component,
- (IDOMElement)component.getElement(),
- component.getName(),
- component.getTargetNamespace());
-
- RenameComponentProcessor processor = new RenameComponentProcessor(refactoringComponent, newName, true);
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- PerformUnsavedRefactoringOperation operation = new PerformUnsavedRefactoringOperation(refactoring);
- operation.run(null);
- }
- else
- {
- // We can't refactor rename external files
- component.setName(newName);
- }
- }
- }
- }
- else
- {
- // this is a 'locally' defined component (e.g. local element)
- // no need to call refactoring since this component can't be referenced
- component.setName(newName);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java
deleted file mode 100644
index 35efdd6740..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class UpdateNamespaceInformationCommand extends BaseCommand
-{
- protected XSDSchema xsdSchema;
- protected String newPrefix, newTargetNamespace;
-
- public UpdateNamespaceInformationCommand(String label, XSDSchema xsdSchema, String newPrefix, String newTargetNamespace)
- {
- super(label);
- this.xsdSchema = xsdSchema;
- this.newPrefix = newPrefix;
- this.newTargetNamespace = newTargetNamespace;
- }
-
- public void execute()
- {
- ensureSchemaElement(xsdSchema);
-
- Element element = xsdSchema.getElement();
- try
- {
- //DocumentImpl doc = (DocumentImpl) element.getOwnerDocument();
-
- String modelTargetNamespace = xsdSchema.getTargetNamespace();
- String oldNamespace = xsdSchema.getTargetNamespace();
-
- TypesHelper helper = new TypesHelper(xsdSchema);
- String oldPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-
- if (modelTargetNamespace == null)
- {
- modelTargetNamespace = ""; //$NON-NLS-1$
- }
-
- String targetNamespace = newTargetNamespace.trim();
- String prefix = newPrefix.trim();
-
- if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
- {
- return;
- }
-
- if (prefix.length() > 0 && targetNamespace.length() == 0)
- {
- // can't have blank targetnamespace and yet specify a prefix
- return;
- }
-
- //doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_TARGETNAMESPACE_CHANGE")); //$NON-NLS-1$
- beginRecording(element);
-
- String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
- // Check if prefix is blank
- // if it is, then make sure we have a prefix
- // for schema for schema
- if (prefix.length() == 0)
- {
- // if prefix for schema for schema is blank
- // then set it to value specified in preference
- // and update ALL nodes with this prefix
- if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
- {
- // get preference prefix
- xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
- // get a unique prefix by checking what's in the map
-
- xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
- element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); //$NON-NLS-1$
-
- updateAllNodes(element, xsdForXSDPrefix);
-
- // remove the old xmlns attribute for the schema for schema
- if (element.hasAttribute("xmlns") && //$NON-NLS-1$
- element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
- {
- element.removeAttribute("xmlns"); //$NON-NLS-1$
- }
- }
- }
-
- if (targetNamespace.length() > 0 || (targetNamespace.length() == 0 && prefix.length() == 0))
- {
- // clean up the old prefix for this schema
- if (oldPrefix != null && oldPrefix.length() > 0)
- {
- element.removeAttribute("xmlns:" + oldPrefix); //$NON-NLS-1$
- // element.setAttribute("xmlns:" + prefix, targetNamespace);
- // java.util.Map prefixToNameSpaceMap =
- // xsdSchema.getQNamePrefixToNamespaceMap();
- // prefixToNameSpaceMap.remove(oldPrefix);
- }
- else
- // if no prefix
- {
- if (element.hasAttribute("xmlns")) //$NON-NLS-1$
- {
- if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
- {
- element.removeAttribute("xmlns"); //$NON-NLS-1$
- }
- }
- }
- }
-
- if (targetNamespace.length() > 0)
- {
- if (!modelTargetNamespace.equals(targetNamespace))
- {
- element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
- }
- // now set the new xmlns:prefix attribute
- if (prefix.length() > 0)
- {
- element.setAttribute("xmlns:" + prefix, targetNamespace); //$NON-NLS-1$
- }
- else
- {
- element.setAttribute("xmlns", targetNamespace); //$NON-NLS-1$
- }
- // set the targetNamespace attribute
- }
- else
- // else targetNamespace is blank
- {
- if (prefix.length() == 0)
- {
- element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
- }
- }
-
- // do our own referential integrity
- TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
- targetNamespaceChangeHandler.resolve();
-
- updateElement(xsdSchema);
-
- //doc.getModel().endRecording(this);
- }
- finally
- {
- endRecording();
- }
- }
-
-
- // issue (cs) I don't have a clue why we need to call this method
- //
- private static void updateElement(XSDConcreteComponent concreteComp)
- {
- try
- {
- concreteComp.updateElement();
- }
- catch (Exception e)
- {
- for (Iterator containments = concreteComp.eClass().getEAllReferences().iterator(); containments.hasNext(); )
- {
- EReference eReference = (EReference)containments.next();
- if (eReference.isContainment())
- {
- if (eReference.isMany())
- {
- for (Iterator objects = ((Collection)concreteComp.eGet(eReference)).iterator(); objects.hasNext(); )
- {
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)objects.next();
- try
- {
- xsdConcreteComponent.updateElement();
- }
- catch (Exception ex) {}
- }
- }
- else
- {
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)concreteComp.eGet(eReference);
- if (xsdConcreteComponent != null)
- {
- try
- {
- xsdConcreteComponent.updateElement();
- }
- catch (Exception ex) {}
- }
- }
- }
- }
- }
- }
- private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
- {
- if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
- {
- xsdForXSDPrefix = "xsd"; //$NON-NLS-1$
- }
- // ensure prefix is unique
- int prefixExtension = 1;
- while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
- {
- xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
- prefixExtension++;
- }
- return xsdForXSDPrefix;
- }
-
- private void updateAllNodes(Element element, String prefix)
- {
- element.setPrefix(prefix);
- NodeList list = element.getChildNodes();
- if (list != null)
- {
- for (int i = 0; i < list.getLength(); i++)
- {
- Node child = list.item(i);
- if (child != null && child instanceof Element)
- {
- child.setPrefix(prefix);
- if (child.hasChildNodes())
- {
- updateAllNodes((Element) child, prefix);
- }
- }
- }
- }
- }
-
- private boolean validateTargetNamespace(String ns)
- {
- // will allow blank namespace !!
- if (ns.equals("")) //$NON-NLS-1$
- {
- return true;
- }
-
- String errorMessage = null;
- try
- {
- URI testURI = new URI(ns);
- testURI.isAbsolute();
- }
- catch (URISyntaxException e)
- {
- errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE"); //$NON-NLS-1$
- }
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- return true;
- }
- return false;
- }
-
- protected boolean validatePrefix(String prefix)
- {
- if (prefix != null && prefix.equals("")) return true;
- return XMLChar.isValidNCName(prefix);
- }
-
- public void redo()
- {
- execute();
- }
-
- public void undo()
- {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNumericBoundsFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNumericBoundsFacetCommand.java
deleted file mode 100644
index 0f5cea91e8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNumericBoundsFacetCommand.java
+++ /dev/null
@@ -1,168 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDMaxExclusiveFacet;
-import org.eclipse.xsd.XSDMaxInclusiveFacet;
-import org.eclipse.xsd.XSDMinExclusiveFacet;
-import org.eclipse.xsd.XSDMinInclusiveFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateNumericBoundsFacetCommand extends BaseCommand
-{
- XSDSimpleTypeDefinition xsdSimpleType;
- String max, min;
- boolean includeMin, includeMax;
- private boolean doUpdateMax = false, doUpdateMin = false;
- XSDMinInclusiveFacet minInclusiveFacet;
- XSDMinExclusiveFacet minExclusiveFacet;
- XSDMaxInclusiveFacet maxInclusiveFacet;
- XSDMaxExclusiveFacet maxExclusiveFacet;
-
-
- public UpdateNumericBoundsFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType, boolean includeMin, boolean includeMax)
- {
- super(label);
- this.xsdSimpleType = xsdSimpleType;
- this.includeMin = includeMin;
- this.includeMax = includeMax;
-
- minInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
- minExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
- maxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
- maxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-
- }
-
- public void setMin(String min)
- {
- this.min = min;
- doUpdateMin = true;
- }
-
- public void setMax(String max)
- {
- this.max = max;
- doUpdateMax = true;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(xsdSimpleType.getElement());
-
- if (doUpdateMin)
- {
- if (includeMin)
- {
- if (minInclusiveFacet == null && min != null)
- {
- minInclusiveFacet = XSDFactory.eINSTANCE.createXSDMinInclusiveFacet();
- minInclusiveFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().add(minInclusiveFacet);
-
- if (minExclusiveFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(minExclusiveFacet);
- }
- }
- else if (minInclusiveFacet != null && min != null)
- {
- minInclusiveFacet.setLexicalValue(min);
- }
- else if (minInclusiveFacet != null && min == null)
- {
- xsdSimpleType.getFacetContents().remove(minInclusiveFacet);
- }
- }
- else
- // !includeMin
- {
- if (minExclusiveFacet == null && min != null)
- {
- minExclusiveFacet = XSDFactory.eINSTANCE.createXSDMinExclusiveFacet();
- minExclusiveFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().add(minExclusiveFacet);
-
- if (minInclusiveFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(minInclusiveFacet);
- }
- }
- else if (minExclusiveFacet != null && min != null)
- {
- minExclusiveFacet.setLexicalValue(min);
- }
- else if (minExclusiveFacet != null && min == null)
- {
- xsdSimpleType.getFacetContents().remove(minExclusiveFacet);
- }
- }
- }
- else if (doUpdateMax)
- {
- if (includeMax)
- {
- if (maxInclusiveFacet == null && max != null)
- {
- maxInclusiveFacet = XSDFactory.eINSTANCE.createXSDMaxInclusiveFacet();
- maxInclusiveFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().add(maxInclusiveFacet);
-
- if (maxExclusiveFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(maxExclusiveFacet);
- }
- }
- else if (maxInclusiveFacet != null && max != null)
- {
- maxInclusiveFacet.setLexicalValue(max);
- }
- else if (maxInclusiveFacet != null && max == null)
- {
- xsdSimpleType.getFacetContents().remove(maxInclusiveFacet);
- }
- }
- else
- // !includeMax
- {
- if (maxExclusiveFacet == null && max != null)
- {
- maxExclusiveFacet = XSDFactory.eINSTANCE.createXSDMaxExclusiveFacet();
- maxExclusiveFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().add(maxExclusiveFacet);
-
- if (maxInclusiveFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(maxInclusiveFacet);
- }
- }
- else if (maxExclusiveFacet != null && max != null)
- {
- maxExclusiveFacet.setLexicalValue(max);
- }
- else if (maxExclusiveFacet != null && max == null)
- {
- xsdSimpleType.getFacetContents().remove(maxExclusiveFacet);
- }
- }
- }
-
- formatChild(xsdSimpleType.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateStringLengthFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateStringLengthFacetCommand.java
deleted file mode 100644
index b5e78e9280..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateStringLengthFacetCommand.java
+++ /dev/null
@@ -1,230 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDLengthFacet;
-import org.eclipse.xsd.XSDMaxLengthFacet;
-import org.eclipse.xsd.XSDMinLengthFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateStringLengthFacetCommand extends BaseCommand
-{
- XSDSimpleTypeDefinition xsdSimpleType;
- String max, min;
- private boolean doUpdateMax = false, doUpdateMin = false;
-
- public UpdateStringLengthFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType)
- {
- super(label);
- this.xsdSimpleType = xsdSimpleType;
- }
-
- public void setMin(String min)
- {
- this.min = min;
- doUpdateMin = true;
- }
-
- public void setMax(String max)
- {
- this.max = max;
- doUpdateMax = true;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(xsdSimpleType.getElement());
- XSDLengthFacet lengthFacet = xsdSimpleType.getEffectiveLengthFacet();
- XSDMinLengthFacet minLengthFacet = xsdSimpleType.getEffectiveMinLengthFacet();
- XSDMaxLengthFacet maxLengthFacet = xsdSimpleType.getEffectiveMaxLengthFacet();
-
- String currentLength = null, currentMin = null, currentMax = null;
- if (lengthFacet != null)
- {
- currentLength = lengthFacet.getLexicalValue();
- }
- if (minLengthFacet != null)
- {
- currentMin = minLengthFacet.getLexicalValue();
- }
- if (maxLengthFacet != null)
- {
- currentMax = maxLengthFacet.getLexicalValue();
- }
-
- if (doUpdateMax && !doUpdateMin)
- {
- if (maxLengthFacet != null)
- {
- if (max != null)
- {
- if (max.equals(currentMin))
- {
- lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
- lengthFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().add(lengthFacet);
- xsdSimpleType.getFacetContents().remove(maxLengthFacet);
- xsdSimpleType.getFacetContents().remove(minLengthFacet);
- }
- else
- {
- if (lengthFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
- }
- if (minLengthFacet == null && currentLength != null)
- {
- minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
- minLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(minLengthFacet);
- }
- maxLengthFacet.setLexicalValue(max);
- }
- }
- else
- {
- xsdSimpleType.getFacetContents().remove(maxLengthFacet);
- }
- }
- else
- {
- if (currentMin != null && currentMin.equals(max))
- {
- if (lengthFacet == null)
- {
- lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
- xsdSimpleType.getFacetContents().add(lengthFacet);
- }
- lengthFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().remove(minLengthFacet);
- }
- else if (currentLength != null && !currentLength.equals(max))
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
-
- if (max != null)
- {
- maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
- maxLengthFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().add(maxLengthFacet);
- }
-
- minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
- minLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(minLengthFacet);
- }
- else
- {
- if (lengthFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
-
- minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
- minLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(minLengthFacet);
-
- }
- maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
- maxLengthFacet.setLexicalValue(max);
- xsdSimpleType.getFacetContents().add(maxLengthFacet);
- }
- }
- }
- else if (!doUpdateMax && doUpdateMin)
- {
- if (minLengthFacet != null)
- {
- if (min != null)
- {
- if (min.equals(currentMax))
- {
- lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
- lengthFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().add(lengthFacet);
- xsdSimpleType.getFacetContents().remove(maxLengthFacet);
- xsdSimpleType.getFacetContents().remove(minLengthFacet);
- }
- else
- {
- if (lengthFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
- }
- if (maxLengthFacet == null && currentLength != null)
- {
- maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
- maxLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(maxLengthFacet);
- }
- minLengthFacet.setLexicalValue(min);
- }
- }
- else
- {
- xsdSimpleType.getFacetContents().remove(minLengthFacet);
- }
- }
- else
- {
- if (currentMax != null && currentMax.equals(min))
- {
- if (lengthFacet == null)
- {
- lengthFacet = XSDFactory.eINSTANCE.createXSDLengthFacet();
- xsdSimpleType.getFacetContents().add(lengthFacet);
- }
- lengthFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().remove(maxLengthFacet);
- }
- else if (currentLength != null && !currentLength.equals(min))
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
-
- if (min != null)
- {
- minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
- minLengthFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().add(minLengthFacet);
- }
-
- maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
- maxLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(maxLengthFacet);
- }
- else
- {
- minLengthFacet = XSDFactory.eINSTANCE.createXSDMinLengthFacet();
- minLengthFacet.setLexicalValue(min);
- xsdSimpleType.getFacetContents().add(minLengthFacet);
-
- if (lengthFacet != null)
- {
- xsdSimpleType.getFacetContents().remove(lengthFacet);
-
- maxLengthFacet = XSDFactory.eINSTANCE.createXSDMaxLengthFacet();
- maxLengthFacet.setLexicalValue(currentLength);
- xsdSimpleType.getFacetContents().add(maxLengthFacet);
- }
- }
- }
- }
- formatChild(xsdSimpleType.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTextValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTextValueCommand.java
deleted file mode 100644
index 66636465db..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTextValueCommand.java
+++ /dev/null
@@ -1,61 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xml.ui.internal.tabletree.TreeContentHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/*
- * This command is used from the extension view to edit extension elements
- * and which are implemented as DOM objects (not part of the EMF model)
- */
-public class UpdateTextValueCommand extends BaseCommand
-{
- Element element;
- String value;
-
- public UpdateTextValueCommand(Element element, String value)
- {
- this.element = element;
- this.value = value;
- }
-
-
- public void execute()
- {
- try
- {
- beginRecording(element);
- Node textNode = null;
- TreeContentHelper helper = new TreeContentHelper();
- for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.TEXT_NODE &&
- !helper.isIgnorableText(node))
- {
- textNode = node;
- break;
- }
- }
- if (textNode == null)
- {
- textNode = element.getOwnerDocument().createTextNode("");
- element.appendChild(textNode);
- }
- helper.setNodeValue(textNode, value);
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
deleted file mode 100644
index 0ed77b38da..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class UpdateTypeReferenceAndManageDirectivesCommand extends UpdateComponentReferenceAndManageDirectivesCommand
-{
-
- public UpdateTypeReferenceAndManageDirectivesCommand(XSDConcreteComponent concreteComponent,
- String componentName, String componentNamespace, IFile file)
- {
- super(concreteComponent, componentName, componentNamespace, file);
- }
-
-
- protected XSDComponent getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace)
- {
- XSDTypeDefinition result = schema.resolveTypeDefinition(componentNamespace, componentName);
- if (result.eContainer() == null)
- {
- result = null;
- }
- return result;
- }
-
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
- XSDComponent td = computeComponent();
- if (td != null && td instanceof XSDTypeDefinition)
- {
- UpdateTypeReferenceCommand command = new UpdateTypeReferenceCommand(concreteComponent, (XSDTypeDefinition) td);
- command.execute();
- XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
- }
- }
- catch (Exception e)
- {
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceCommand.java
deleted file mode 100644
index cda106c5bb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceCommand.java
+++ /dev/null
@@ -1,78 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class UpdateTypeReferenceCommand extends BaseCommand
-{
- XSDConcreteComponent concreteComponent;
- XSDTypeDefinition newType;
-
- public UpdateTypeReferenceCommand(XSDConcreteComponent concreteComponent, XSDTypeDefinition newType)
- {
- this.concreteComponent = concreteComponent;
- this.newType = newType;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(concreteComponent.getElement());
-
- if (concreteComponent instanceof XSDElementDeclaration)
- {
- setElementType((XSDElementDeclaration) concreteComponent);
- }
- else if (concreteComponent instanceof XSDAttributeUse)
- {
- setAttributeType((XSDAttributeUse) concreteComponent);
- }
- else if (concreteComponent instanceof XSDAttributeDeclaration)
- {
- setAttributeType((XSDAttributeDeclaration) concreteComponent);
- }
- }
- finally
- {
- endRecording();
- }
- }
-
- protected void setElementType(XSDElementDeclaration ed)
- {
- ed = ed.getResolvedElementDeclaration();
- if (ed != null)
- {
- ed.setTypeDefinition(newType);
- }
- }
-
- protected void setAttributeType(XSDAttributeUse attributeUse)
- {
- setAttributeType(attributeUse.getAttributeDeclaration());
- }
-
- protected void setAttributeType(XSDAttributeDeclaration ad)
- {
- ad = ad.getResolvedAttributeDeclaration();
- if (ad != null && newType instanceof XSDSimpleTypeDefinition)
- {
- ad.setTypeDefinition((XSDSimpleTypeDefinition)newType);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDPatternFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDPatternFacetCommand.java
deleted file mode 100644
index 3d1b6adc1d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDPatternFacetCommand.java
+++ /dev/null
@@ -1,76 +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.xsd.ui.internal.common.commands;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class UpdateXSDPatternFacetCommand extends BaseCommand
-{
- public static final int ADD = 0;
- public static final int DELETE = 1;
- public static final int UPDATE = 2;
-
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
- String value;
- int actionType;
- XSDPatternFacet patternToEdit;
-
- public UpdateXSDPatternFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleTypeDefinition, int actionType)
- {
- super(label);
- this.xsdSimpleTypeDefinition = xsdSimpleTypeDefinition;
- this.actionType = actionType;
-
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public void setPatternToEdit(XSDPatternFacet patternToEdit)
- {
- this.patternToEdit = patternToEdit;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(xsdSimpleTypeDefinition.getElement());
- if (actionType == ADD)
- {
- XSDPatternFacet pattern = XSDFactory.eINSTANCE.createXSDPatternFacet();
- pattern.setLexicalValue(value);
- xsdSimpleTypeDefinition.getFacetContents().add(pattern);
- }
- else if (actionType == DELETE)
- {
- Assert.isNotNull(patternToEdit);
- if (xsdSimpleTypeDefinition.getFacetContents().contains(patternToEdit))
- xsdSimpleTypeDefinition.getFacetContents().remove(patternToEdit);
- }
- else if (actionType == UPDATE)
- {
- Assert.isNotNull(patternToEdit);
- patternToEdit.setLexicalValue(value);
- }
- formatChild(xsdSimpleTypeDefinition.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDWhiteSpaceFacetCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDWhiteSpaceFacetCommand.java
deleted file mode 100644
index bd92c3fab8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDWhiteSpaceFacetCommand.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.wst.xsd.ui.internal.common.commands;
-
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWhiteSpace;
-import org.eclipse.xsd.XSDWhiteSpaceFacet;
-
-public class UpdateXSDWhiteSpaceFacetCommand extends BaseCommand
-{
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
- boolean doAddFacet;
-
- public UpdateXSDWhiteSpaceFacetCommand(String label, XSDSimpleTypeDefinition xsdSimpleType, boolean doAddFacet)
- {
- super(label);
- this.xsdSimpleTypeDefinition = xsdSimpleType;
- this.doAddFacet = doAddFacet;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(xsdSimpleTypeDefinition.getElement());
- XSDWhiteSpaceFacet whitespaceFacet = xsdSimpleTypeDefinition.getWhiteSpaceFacet();
-
- if (doAddFacet)
- {
- if (whitespaceFacet == null)
- {
- whitespaceFacet = XSDFactory.eINSTANCE.createXSDWhiteSpaceFacet();
- xsdSimpleTypeDefinition.getFacetContents().add(whitespaceFacet);
- }
- whitespaceFacet.setLexicalValue(XSDWhiteSpace.COLLAPSE_LITERAL.getName());
- }
- else
- {
- if (whitespaceFacet != null)
- {
- xsdSimpleTypeDefinition.getFacetContents().remove(whitespaceFacet);
- }
- }
- formatChild(xsdSimpleTypeDefinition.getElement());
- }
- finally
- {
- endRecording();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/providers/XSDSectionLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/providers/XSDSectionLabelProvider.java
deleted file mode 100644
index 321e5f8837..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/providers/XSDSectionLabelProvider.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.providers;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDSectionLabelProvider extends LabelProvider
-{
- /**
- *
- */
- public XSDSectionLabelProvider()
- {
- super();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object)
- {
- if (object == null || object.equals(StructuredSelection.EMPTY))
- {
- return null;
- }
- Image result = null;
- if (object instanceof StructuredSelection)
- {
- Object selected = ((StructuredSelection) object).getFirstElement();
-
- if (selected instanceof XSDConcreteComponent)
- {
- XSDBaseAdapter adapter = (XSDBaseAdapter)XSDAdapterFactory.getInstance().adapt((XSDConcreteComponent)selected);
- return ((ITreeElement)adapter).getImage();
- }
- }
- return result;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object)
- {
- if (object == null || object.equals(StructuredSelection.EMPTY))
- {
- return org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NO_ITEMS_SELECTED;
- }
-
- String result = null;
-
- boolean isReference = false;
- Object selected = null;
- if (object instanceof StructuredSelection)
- {
- selected = ((StructuredSelection) object).getFirstElement();
-
- if (selected instanceof XSDConcreteComponent)
- {
- if (selected instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) selected;
- if (xsdElementDeclaration.isElementDeclarationReference())
- {
- isReference = true;
- }
- } else if (selected instanceof XSDAttributeDeclaration)
- {
- if (((XSDAttributeDeclaration) selected).isAttributeDeclarationReference())
- {
- isReference = true;
- }
- } else if (selected instanceof XSDModelGroupDefinition)
- {
- if (((XSDModelGroupDefinition) selected).isModelGroupDefinitionReference())
- {
- isReference = true;
- }
- }
- StringBuffer sb = new StringBuffer();
- Element element = ((XSDConcreteComponent) selected).getElement();
- if (element != null)
- {
- sb.append(((XSDConcreteComponent) selected).getElement().getLocalName());
-
- if (isReference)
- {
- sb.append(" ref");//$NON-NLS-1$
- // This string is not easily translatable to other languages.
- // For now, make it english-only since we use the element tag as the title anyway
-// sb.append(Messages.UI_PAGE_HEADING_REFERENCE);
- }
-
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorPart editorPart = page.getActiveEditor();
- XSDSchema xsdSchema = ((XSDConcreteComponent) selected).getSchema();
- IEditorInput editorInput = editorPart.getEditorInput();
- boolean isReadOnly = false;
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput))
- {
- isReadOnly = true;
- }
- if (editorPart != null && xsdSchema != editorPart.getAdapter(XSDSchema.class) || isReadOnly)
- {
- sb.append(" (" + Messages.UI_LABEL_READ_ONLY + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- return sb.toString();
- }
- else
- {
- // If the element is null, then let's use the model object to find
- // an appropriate name
- if ((XSDConcreteComponent) selected instanceof XSDNamedComponent)
- {
- return ((XSDNamedComponent)selected).getName();
- }
- else if ((XSDConcreteComponent) selected instanceof XSDSchema)
- {
- return XSDConstants.SCHEMA_ELEMENT_TAG;
- }
- // last resort....
- return "(" + Messages.UI_LABEL_READ_ONLY + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- if (object instanceof Element)
- {
- return ((Element) object).getLocalName();
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java
deleted file mode 100644
index c0705c64ac..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java
+++ /dev/null
@@ -1,615 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.views.properties.PropertySheet;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.AddExtensionsComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.DOMExtensionDetailsContentProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.DOMExtensionItemMenuListener;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionDetailsViewer;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public abstract class AbstractExtensionsSection extends AbstractSection
-{
- protected ExtensionDetailsViewer extensionDetailsViewer;
- protected TreeViewer extensionTreeViewer;
- protected ITreeContentProvider extensionTreeContentProvider;
- protected ILabelProvider extensionTreeLabelProvider;
- protected Label contentLabel;
- protected ISelectionChangedListener elementSelectionChangedListener;
- protected IDocumentChangedNotifier documentChangeNotifier;
- protected INodeAdapter internalNodeAdapter = new InternalNodeAdapter();
-
- private Composite page;
- protected Button addButton, removeButton;
- private Object prevInput;
- private SpecificationForExtensionsSchema prevCategory;
-
- /**
- *
- */
- public AbstractExtensionsSection()
- {
- super();
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- extensionDetailsViewer.setCommandStack(getCommandStack());
- }
-
- class InternalNodeAdapter implements INodeAdapter
- {
-
- public boolean isAdapterForType(Object type)
- {
- // this method should never be called
- // we don't use objects of this class as 'standard' adapters
- return true;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- boolean isRoot = false;
- if (notifier instanceof Element)
- {
- if (isTreeViewerInputElement((Element)notifier))// TODO
- {
- isRoot = true;
- extensionTreeViewer.refresh(extensionTreeViewer.getInput());
- }
- }
- if (!isRoot)
- {
- extensionTreeViewer.refresh(notifier);
- if ( newValue instanceof Element)
- {
- extensionTreeViewer.expandToLevel(notifier, 1);
- extensionTreeViewer.setSelection(new StructuredSelection(newValue));
- }
- }
- }
- }
-
- protected boolean isTreeViewerInputElement(Element element)
- {
- return false;
- }
-
- public void createContents(Composite parent)
- {
- // TODO (cs) add assertion
- if (extensionTreeContentProvider == null)
- return;
-
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- documentChangeNotifier = (IDocumentChangedNotifier)editor.getAdapter(IDocumentChangedNotifier.class);
-
- if (documentChangeNotifier != null)
- {
- documentChangeNotifier.addListener(internalNodeAdapter);
- }
-
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- composite.setLayout(gridLayout);
-
- GridData gridData = new GridData();
-
- page = getWidgetFactory().createComposite(composite);
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- page.setLayout(gridLayout);
-
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalAlignment = GridData.FILL;
- page.setLayoutData(gridData);
-
- SashForm sashForm = new SashForm(page, SWT.HORIZONTAL);
- // Try to limit the initial width of the section
-
- int w = SWT.DEFAULT;
- try
- {
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
-
- // Find the width of the Tabbed Property Sheet's composite excluding the tab
- if (part instanceof PropertySheet)
- {
- PropertySheet sheet = (PropertySheet)part;
- if (sheet.getCurrentPage() instanceof TabbedPropertySheetPage)
- {
- TabbedPropertySheetPage tabbedPage = (TabbedPropertySheetPage)sheet.getCurrentPage();
- Composite targetComposite = null;
- if (tabbedPage.getControl() instanceof Composite)
- {
- Composite c = (Composite)tabbedPage.getControl();
- int length = c.getChildren().length;
- for (int i = 0; i < length; i++)
- {
- Control ctrl = c.getChildren()[i];
- int length2 = (((Composite)ctrl).getChildren()).length;
- for (int j = 0; j < length2; j++ )
- {
- if ((((Composite)ctrl).getChildren())[j] instanceof ScrolledComposite)
- {
- targetComposite = (Composite)(((Composite)ctrl).getChildren())[j];
- break;
- }
- }
- }
- }
- if (targetComposite != null)
- {
- w = targetComposite.getSize().x - 20; // ensure scrollbars don't show
- }
- // The above can be accomplished by the following code
- // but because TabbedPropertyComposite is in an internal package, I will get a discouraged
- // access warning.
- // w = ((TabbedPropertyComposite)(tabbedPage.getControl())).getTabComposite().getSize().x;
- }
- }
- }
- catch(Exception e)
- {
- w = SWT.DEFAULT;
- }
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalAlignment = GridData.FILL;
- // The initial size should be set, not the widthHint, which forces the width
- // to remain constant.
- sashForm.setSize(w, SWT.DEFAULT);
- sashForm.setLayoutData(gridData);
- sashForm.setForeground(ColorConstants.white);
- sashForm.setBackground(ColorConstants.white);
- Control[] children = sashForm.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].setVisible(false);
- }
- Composite leftContent = getWidgetFactory().createComposite(sashForm, SWT.FLAT);
- gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- leftContent.setLayout(gridLayout);
-
- Section section = getWidgetFactory().createSection(leftContent, SWT.FLAT | ExpandableComposite.TITLE_BAR);
- section.setText(Messages._UI_LABEL_EXTENSIONS);
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite tableAndButtonComposite = getWidgetFactory().createComposite(leftContent, SWT.FLAT);
- tableAndButtonComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
- gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- tableAndButtonComposite.setLayout(gridLayout);
-
- extensionTreeViewer = new TreeViewer(tableAndButtonComposite, SWT.FLAT | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.LINE_SOLID);
- MenuManager menuManager = new MenuManager();
- extensionTreeViewer.getTree().setMenu(menuManager.createContextMenu(extensionTreeViewer.getTree()));
- menuManager.addMenuListener(new DOMExtensionItemMenuListener(extensionTreeViewer));
-
- gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- extensionTreeViewer.getTree().setLayout(gridLayout);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalAlignment = GridData.FILL;
-
- extensionTreeViewer.getTree().setLayoutData(gridData);
- extensionTreeViewer.setContentProvider(extensionTreeContentProvider);
- extensionTreeViewer.setLabelProvider(extensionTreeLabelProvider);
- elementSelectionChangedListener = new ElementSelectionChangedListener();
- extensionTreeViewer.addSelectionChangedListener(elementSelectionChangedListener);
- extensionTreeViewer.getTree().addMouseTrackListener(new MouseTrackAdapter()
- {
- public void mouseHover(org.eclipse.swt.events.MouseEvent e)
- {
- ISelection selection = extensionTreeViewer.getSelection();
- if (selection instanceof StructuredSelection)
- {
- Object obj = ((StructuredSelection) selection).getFirstElement();
- if (obj instanceof Element)
- {
- Element element = (Element) obj;
- ExtensionsSchemasRegistry registry = getExtensionsSchemasRegistry();
- // ApplicationSpecificSchemaProperties[] properties =
- // registry.getAllApplicationSpecificSchemaProperties();
- // ApplicationSpecificSchemaProperties[] properties =
- // (ApplicationSpecificSchemaProperties[])
- // registry.getAllApplicationSpecificSchemaProperties().toArray(new
- // ApplicationSpecificSchemaProperties[0]);
- List properties = registry.getAllExtensionsSchemasContribution();
-
- int length = properties.size();
- for (int i = 0; i < length; i++)
- {
- SpecificationForExtensionsSchema current = (SpecificationForExtensionsSchema) properties.get(i);
- if (current.getNamespaceURI().equals(element.getNamespaceURI()))
- {
- extensionTreeViewer.getTree().setToolTipText(current.getDescription());
- break;
- }
- }
- }
- }
- }
-
- });
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(extensionTreeViewer.getControl(),
- XSDEditorCSHelpIds.EXTENSIONS_TAB__EXTENSIONS);
-
- Composite buttonComposite = getWidgetFactory().createComposite(tableAndButtonComposite, SWT.FLAT);
- //ColumnLayout columnLayout = new ColumnLayout();
- //buttonComposite.setLayout(columnLayout);
- buttonComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- gridLayout.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(gridLayout);
-
- addButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD_WITH_DOTS, SWT.FLAT);
- addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- addButton.addSelectionListener(this);
- addButton.setToolTipText(Messages._UI_ACTION_ADD_EXTENSION_COMPONENT);
- //addButton.setLayoutData(new ColumnLayoutData(ColumnLayoutData.FILL));
- addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(addButton,
- XSDEditorCSHelpIds.EXTENSIONS_TAB__ADD);
-
- removeButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_DELETE_BUTTON, SWT.FLAT);
- removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- removeButton.addSelectionListener(this);
- removeButton.setToolTipText(Messages._UI_ACTION_DELETE_EXTENSION_COMPONENT);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(removeButton,
- XSDEditorCSHelpIds.EXTENSIONS_TAB__DELETE);
-
- //removeButton.setLayoutData(new ColumnLayoutData(ColumnLayoutData.FILL));
-
- // TODO (cs) uncomment the up/down button when we have time to implement
- //
- //Button up = getWidgetFactory().createButton(buttonComposite, Messages._UI_LABEL_UP, SWT.FLAT);
- //up.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- //Button down = getWidgetFactory().createButton(buttonComposite, Messages._UI_LABEL_DOWN, SWT.FLAT);
- //down.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite rightContent = getWidgetFactory().createComposite(sashForm, SWT.FLAT);
- Section section2 = getWidgetFactory().createSection(rightContent, SWT.FLAT | ExpandableComposite.TITLE_BAR);
- section2.setText(Messages._UI_LABEL_EXTENSION_DETAILS);
- section2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- //contentLabel = getWidgetFactory().createLabel(rightContent, "Content");
-
- Composite testComp = getWidgetFactory().createComposite(rightContent, SWT.FLAT);
-
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.marginLeft = 0;
- gridLayout.marginRight = 0;
- gridLayout.numColumns = 1;
- gridLayout.marginHeight = 3;
- gridLayout.marginWidth = 3;
- rightContent.setLayout(gridLayout);
-
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalAlignment = GridData.FILL;
- rightContent.setLayoutData(gridData);
-
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginLeft = 0;
- gridLayout.marginRight = 0;
- gridLayout.marginBottom = 0;
- gridLayout.marginHeight = 3;
- gridLayout.marginWidth = 3;
- gridLayout.numColumns = 2;
- testComp.setLayout(gridLayout);
-
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalAlignment = GridData.FILL;
- testComp.setLayoutData(gridData);
-
- createElementContentWidget(testComp);
-
- int[] weights = { 40, 60 };
- sashForm.setWeights(weights);
- }
-
- protected void createElementContentWidget(Composite parent)
- {
- extensionDetailsViewer = new ExtensionDetailsViewer(parent, getWidgetFactory());
- extensionDetailsViewer.setContentProvider(new DOMExtensionDetailsContentProvider());
- extensionDetailsViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(extensionDetailsViewer.getControl(),
- XSDEditorCSHelpIds.EXTENSIONS_TAB__EXTENSIONS_DETAILS);
- }
-
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
- if (input != null)
- {
- if ( prevInput == input)
- return;
- else
- prevInput = input;
-
- Tree tree = extensionTreeViewer.getTree();
- extensionDetailsViewer.setInput(null);
- tree.removeAll();
-
- addButton.setEnabled(!isReadOnly);
-
- extensionTreeViewer.setInput(input);
- if (tree.getSelectionCount() == 0 && tree.getItemCount() > 0)
- {
- TreeItem treeItem = tree.getItem(0);
- extensionTreeViewer.setSelection(new StructuredSelection(treeItem.getData()));
- }
- removeButton.setEnabled(tree.getSelectionCount() > 0 && !isReadOnly);
- // Bugzilla 197315. Make this bulletproof for maintenance release.
- Control detailsViewerControl = extensionDetailsViewer.getControl();
- if (detailsViewerControl != null && !detailsViewerControl.isDisposed())
- {
- detailsViewerControl.setEnabled(!isReadOnly);
- }
- }
- setListenerEnabled(true);
- }
-
- public Composite getPage()
- {
- return page;
- }
-
- protected abstract AddExtensionCommand getAddExtensionCommand(Object o);
- protected abstract Command getRemoveExtensionCommand(Object o);
- protected abstract ExtensionsSchemasRegistry getExtensionsSchemasRegistry();
-
- protected AddExtensionsComponentDialog createAddExtensionsComponentDialog()
- {
- return new AddExtensionsComponentDialog(composite.getShell(), getExtensionsSchemasRegistry());
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- if (event.widget == addButton)
- {
- ExtensionsSchemasRegistry registry = getExtensionsSchemasRegistry();
- AddExtensionsComponentDialog dialog = createAddExtensionsComponentDialog();
-
- List properties = registry.getAllExtensionsSchemasContribution();
-
- dialog.setInput(properties);
- dialog.setBlockOnOpen(true);
- dialog.setPrefStore( getPrefStore() );
-
- if (prevCategory != null)
- dialog.setInitialCategorySelection(prevCategory);
-
- if (dialog.open() == Window.OK)
- {
- Object newSelection = null;
- Object[] result = dialog.getResult();
- if (result != null)
- {
- SpecificationForExtensionsSchema extensionsSchemaSpec = (SpecificationForExtensionsSchema) result[1];
- AddExtensionCommand addExtensionCommand = getAddExtensionCommand(result[0]);
- if (addExtensionCommand != null)
- {
- addExtensionCommand.setSchemaProperties(extensionsSchemaSpec);
- if (getCommandStack() != null)
- {
- getCommandStack().execute(addExtensionCommand);
- newSelection = addExtensionCommand.getNewObject();
- }
- }
- }
- //refresh();
- if (newSelection != null)
- {
- extensionTreeViewer.setSelection(new StructuredSelection(newSelection));
- }
- }
-
- prevCategory = dialog.getSelectedCategory();
- }
- else if (event.widget == removeButton)
- {
- ISelection selection = extensionTreeViewer.getSelection();
-
- if (selection instanceof StructuredSelection)
- {
- Object o = ((StructuredSelection) selection).getFirstElement();
- Command command = getRemoveExtensionCommand(o);
- if (getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
- }
- }
- else if (event.widget == extensionTreeViewer.getTree())
- {
-
- }
- }
-
- // TODO make this one an abstract method. XSDEditor and WSDLEditor should return
- // diferent IpreferenceStore objects
- protected IPreferenceStore getPrefStore() {
- return null;
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
-
- }
-
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- public void dispose()
- {
- if (documentChangeNotifier != null)
- documentChangeNotifier.removeListener(internalNodeAdapter);
- }
-
-
- Node selectedNode;
-
- class ElementSelectionChangedListener implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- boolean isDeleteEnabled = false;
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- if (structuredSelection.size() > 0)
- {
- Object obj = structuredSelection.getFirstElement();
- if (obj instanceof Node)
- {
- selectedNode = (Node) obj;
- extensionDetailsViewer.setInput(obj);
- isDeleteEnabled = true;
- }
- }
- else
- {
- // if nothing is selected then don't show any details
- //
- extensionDetailsViewer.setInput(null);
- }
-
- // Upon element selection, the details view populates fine, but there is no vertical scrollbar,
- // so it misleads the user into thinking there are no other attributes available
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=174073
- // This is a workaround to force a layout of the tab composite
- IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- if (part instanceof PropertySheet)
- {
- PropertySheet sheet = (PropertySheet)part;
- if (sheet.getCurrentPage() instanceof TabbedPropertySheetPage)
- {
- TabbedPropertySheetPage tabbedPage = (TabbedPropertySheetPage)sheet.getCurrentPage();
- if (tabbedPage.getControl() instanceof Composite)
- {
- Composite c = (Composite)tabbedPage.getControl();
- Point p = c.getSize();
- // c.layout(true, true) doesn't appear to work.
- // But this forces a relayout:
- c.setSize(p.x, p.y + 1);
- // Change the size back to the original
- c.setSize(p.x, p.y);
- }
- }
- }
- }
- removeButton.setEnabled(isDeleteEnabled && !isReadOnly);
- }
- }
-
- public ITreeContentProvider getExtensionTreeContentProvider()
- {
- return extensionTreeContentProvider;
- }
-
- public void setExtensionTreeContentProvider(ITreeContentProvider extensionTreeContentProvider)
- {
- this.extensionTreeContentProvider = extensionTreeContentProvider;
- }
-
- public ILabelProvider getExtensionTreeLabelProvider()
- {
- return extensionTreeLabelProvider;
- }
-
- public void setExtensionTreeLabelProvider(ILabelProvider extensionTreeLabelProvider)
- {
- this.extensionTreeLabelProvider = extensionTreeLabelProvider;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
deleted file mode 100644
index 1d07b36818..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.SubContributionManager;
-import org.eclipse.jface.action.SubStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class AbstractSection extends AbstractPropertySection implements SelectionListener, Listener
-{
- protected Composite composite;
- protected PaintListener painter;
- protected XSDSchema xsdSchema;
- protected Object input;
- protected boolean isReadOnly;
- protected boolean listenerEnabled = true;
- protected boolean isSimple;
- protected CustomListener customListener = new CustomListener();
- protected IEditorPart owningEditor;
- private IStatusLineManager statusLine;
- protected boolean isTraversing = false;
-
- public static final Image ICON_ERROR = XSDEditorPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-
- public AbstractSection()
- {
- super();
- }
-
- public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage)
- {
- super.createControls(parent, aTabbedPropertySheetPage);
- isSimple = getIsSimple();
- createContents(parent);
- }
-
- protected abstract void createContents(Composite parent);
-
- protected PaintListener createPainter() {
- return new PaintListener() {
-
- public void paintControl(PaintEvent e) {
-// Rectangle bounds = composite.getClientArea();
- GC gc = e.gc;
-
- gc.setForeground(gc.getBackground());
- gc.setBackground(getWidgetFactory().getColors().getColor(
- FormColors.TB_BG));
-
-// gc.fillGradientRectangle(4 + bounds.width / 2, 0,
-// bounds.width / 2 - 9, bounds.height, false);
-
- gc.setForeground(getWidgetFactory().getColors().getColor(
- FormColors.TB_BORDER));
-// gc.drawLine(bounds.width - 5, 0, bounds.width - 5,
-// bounds.height);
- }
-
- };
-
- }
-
- public void dispose()
- {
- if (composite != null && ! composite.isDisposed() && painter != null)
- composite.removePaintListener(painter);
-
- super.dispose();
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- isSimple = getIsSimple();
- Object input = ((IStructuredSelection)selection).getFirstElement();
- this.input = input;
-
- if (input instanceof XSDConcreteComponent)
- {
- xsdSchema = ((XSDConcreteComponent)input).getSchema();
- }
-
- // set owning editor of this section
- if (part!=null)
- {
- if (part instanceof IEditorPart)
- {
- owningEditor = (IEditorPart)part;
- }
- else
- {
- owningEditor = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
- }
- }
- if (xsdSchema == owningEditor.getAdapter(XSDSchema.class))
- {
- isReadOnly = false;
- }
- else
- {
- isReadOnly = true;
- }
-
- IEditorInput editorInput = owningEditor.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput || editorInput instanceof FileStoreEditorInput))
- {
- isReadOnly = true;
- }
- }
-
- public void refresh()
- {
- super.refresh();
- composite.setEnabled(!isReadOnly);
- }
-
- public void applyAllListeners(Control control)
- {
- control.addListener(SWT.Modify, customListener);
- control.addListener(SWT.FocusOut, customListener);
- control.addListener(SWT.KeyDown, customListener);
- }
-
- public void applyModifyListeners(Control control)
- {
- control.addListener(SWT.Modify, customListener);
- control.addListener(SWT.FocusOut, customListener);
- }
-
- public void applyKeyListener(Control control)
- {
- control.addListener(SWT.KeyDown, customListener);
- }
-
- public void removeListeners(Control control)
- {
- control.removeListener(SWT.Modify, customListener);
- control.removeListener(SWT.FocusOut, customListener);
- control.removeListener(SWT.KeyDown, customListener);
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {}
-
- public void doWidgetSelected(SelectionEvent e)
- {}
-
- public void widgetSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- input != null &&
- !isReadOnly)
- {
- doWidgetSelected(e);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- input != null &&
- !isReadOnly)
- {
- doWidgetDefaultSelected(e);
- }
- }
-
- /**
- * Get the value of listenerEnabled.
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled()
- {
- return listenerEnabled;
- }
-
- /**
- * Set the value of listenerEnabled.
- * @param v Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v)
- {
- this.listenerEnabled = v;
- }
-
- /**
- * Sent when an event that the receiver has registered for occurs.
- *
- * @param event the event which occurred
- */
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isReadOnly)
- {
- doHandleEvent(event);
- }
- }
-
- /**
- * Subclasses should override
- * @param event
- */
- protected void doHandleEvent(Event event)
- {
- }
-
- protected IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- this.owningEditor = editorPart;
- return editorPart;
- }
-
- public CommandStack getCommandStack()
- {
- Object commandStack = owningEditor.getAdapter(CommandStack.class);
-
- if (commandStack==null)
- return null;
- else
- return (CommandStack)commandStack;
- }
-
- public boolean getIsSimple()
- {
- return false;
- }
-
-
-
- /**
- * Intended to display error messages.
- * @return
- */
- private IStatusLineManager getStatusLineManager()
- {
- if (statusLine==null && getPart()!=null)
- {
- if(getPart().getSite() instanceof IEditorSite)
- statusLine = ((IEditorSite)getPart().getSite()).getActionBars().getStatusLineManager();
- else if (getPart().getSite() instanceof IViewSite)
- statusLine = ((IViewSite)getPart().getSite()).getActionBars().getStatusLineManager();
-
- /*
- * We must manually set the visibility of the status line since the action bars are from the editor
- * which means the status line only shows up when the editor is in focus (by default).
- * Note only a SubStatusLineManager can set the visibility.
- */
- if (statusLine instanceof SubStatusLineManager)
- ((SubStatusLineManager)statusLine).setVisible(true);
- }
-
- return statusLine;
- }
-
- /**
- * Display an error message in the status line.
- * Call setErrorMessage(null) to clear the status line.
- * @param text
- */
- public void setErrorMessage(String text)
- {
- IStatusLineManager statusLine = getStatusLineManager();
-
- if (statusLine!=null)
- {
- if (text==null || text.length()<1)
- statusLine.setErrorMessage(null);
- else
- statusLine.setErrorMessage(ICON_ERROR, text);
-
- // ensure our message gets displayed
- if (statusLine instanceof SubContributionManager)
- ((SubContributionManager)statusLine).setVisible(true);
-
- statusLine.update(true);
- }
- }
-
-
- protected EObject getModel()
- {
- return (XSDComponent)input;
- }
-
-
- class CustomListener implements Listener
- {
- boolean handlingEvent = false;
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isReadOnly)
- {
- switch (event.type)
- {
- case SWT.KeyDown :
- {
- if (event.character == SWT.CR)
- {
- if (!handlingEvent)
- {
- handlingEvent = true;
- doHandleEvent(event);
- handlingEvent = false;
- }
- }
- break;
- }
- case SWT.FocusOut :
- {
- if (!handlingEvent)
- {
- handlingEvent = true;
- doHandleEvent(event);
- handlingEvent = false;
- }
- break;
- }
- }
- }
- }
- }
-
- protected boolean shouldPerformComboSelection(int eventType, Object selectedItem)
- {
- // if traversing through combobox, don't automatically pop up
- // the browse and new dialog boxes
- boolean wasTraversing = isTraversing;
- if (isTraversing)
- isTraversing = false;
-
- // we only care about default selecting (hitting enter in combobox)
- // for browse.. and new.. otherwise, selection event will be fired
- if (eventType == SWT.DefaultSelection)
- {
- if (selectedItem instanceof String && ((Messages._UI_COMBO_BROWSE.equals(selectedItem) || Messages._UI_COMBO_NEW.equals(selectedItem))))
- return true;
- return false;
- }
-
- // if was traversing and got selection event, do nothing if it's
- // browse.. or new..
- if (wasTraversing && selectedItem instanceof String)
- {
- if (Messages._UI_COMBO_BROWSE.equals(selectedItem) || Messages._UI_COMBO_NEW.equals(selectedItem))
- {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java
deleted file mode 100644
index e0b33bb5c0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,108 +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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public AbstractSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
- */
- public IFilter getFilter()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(XSDConcreteComponent.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof XSDConcreteComponent || object instanceof Element)
- {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return ""; //$NON-NLS-1$
- }
-
-
- public int getEnablesFor()
- {
- return ENABLES_FOR_ANY;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java
deleted file mode 100644
index 8de7f40285..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddDocumentationCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AnnotationSection extends AbstractSection
-{
- Text simpleText;
-
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- simpleText = getWidgetFactory().createText(composite, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
- simpleText.addListener(SWT.Modify, this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(simpleText,
- XSDEditorCSHelpIds.DOCUMENTATION_TAB__NO_LABEL);
-
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 1);
- data.right = new FormAttachment(100, -1);
- data.top = new FormAttachment(0, 1);
- data.bottom = new FormAttachment(100, -1);
- simpleText.setLayoutData(data);
- }
-
- public AnnotationSection()
- {
- super();
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
-
- if (simpleText.isFocusControl()) return;
- setListenerEnabled(false);
- if (input instanceof XSDConcreteComponent)
- {
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation((XSDConcreteComponent) input, false);
- setInitialText(xsdAnnotation);
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event)
- {
- if (input instanceof XSDConcreteComponent)
- {
- if (event.widget == simpleText)
- {
- AddDocumentationCommand command = new AddDocumentationCommand(Messages._UI_ACTION_ADD_DOCUMENTATION, null, (XSDConcreteComponent) input, simpleText.getText(), ""); //$NON-NLS-1$
- getCommandStack().execute(command);
- }
- }
-
- }
-
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- public void dispose()
- {
-
- }
-
- private void setInitialText(XSDAnnotation an)
- {
- if (an != null)
- {
- try
- {
- List documentationList = an.getUserInformation();
- if (documentationList.size() > 0)
- {
- Element docElement = (Element) documentationList.get(0);
- if (docElement != null)
- {
- simpleText.setText(doSerialize(docElement));
- }
- }
- else
- {
- simpleText.setText("");
- }
- }
- catch (Exception e)
- {
-
- }
- }
- else
- {
- simpleText.setText(""); //$NON-NLS-1$
- }
- }
-
- private String doSerialize(Element element) throws IOException
- {
- String source = ""; //$NON-NLS-1$
-
- Node firstChild = element.getFirstChild();
- Node lastChild = element.getLastChild();
- int start = 0;
- int end = 0;
-
- if (element instanceof IDOMElement)
- {
- IDOMElement domElement = (IDOMElement) element;
- IDOMModel model = domElement.getModel();
- IDOMDocument doc = model.getDocument();
-
- if (firstChild instanceof IDOMNode)
- {
- IDOMNode first = (IDOMNode) firstChild;
- start = first.getStartOffset();
- }
- if (lastChild instanceof IDOMNode)
- {
- IDOMNode last = (IDOMNode) lastChild;
- end = last.getEndOffset();
- }
- source = doc.getSource().substring(start, end);
- }
-
- return source;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java
deleted file mode 100644
index e301ebbc41..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-public abstract class CommonDirectivesSection extends AbstractSection
-{
- Text schemaLocationText;
- Button wizardButton;
- StyledText errorText;
- Color red;
- protected boolean isValidSchemaLocation = true;
-
- // TODO: common up code with XSDSelectIncludeFileWizard
- public void doHandleEvent(Event event)
- {
- errorText.setText(""); //$NON-NLS-1$
-
- if (event.widget == schemaLocationText)
- {
- String errorMessage = ""; //$NON-NLS-1$
- isValidSchemaLocation = true;
- String xsdModelFile = schemaLocationText.getText();
- String namespace = ""; //$NON-NLS-1$
- XSDSchema externalSchema = null;
-
- if (xsdModelFile.length() == 0)
- {
- handleSchemaLocationChange(xsdModelFile, "", null); //$NON-NLS-1$
- return;
- }
-
- try
- {
- IFile currentIFile = null;
- IEditorInput editorInput = getActiveEditor().getEditorInput();
- if (editorInput instanceof IFileEditorInput)
- {
- currentIFile = ((IFileEditorInput)editorInput).getFile();
- }
-
- URI newURI = URI.createURI(xsdModelFile);
- String xsdFile = URIHelper.getRelativeURI(newURI.toString(), currentIFile.getFullPath().toString());
- final String normalizedXSDFile = URIHelper.normalize(xsdFile, currentIFile.getLocation().toString(), ""); //$NON-NLS-1$
- final String normalizedURI = URI.encodeFragment(URIHelper.addImpliedFileProtocol(normalizedXSDFile), true).toString();
- XSDParser parser = new XSDParser(new HashMap());
- parser.parse(normalizedURI);
- externalSchema = parser.getSchema();
-
- if (externalSchema != null)
- {
- String extNamespace = externalSchema.getTargetNamespace();
- if (extNamespace == null) extNamespace = ""; //$NON-NLS-1$
- namespace = extNamespace;
-
- if (externalSchema.getDiagnostics() != null &&
- externalSchema.getDiagnostics().size() > 0)
- {
- isValidSchemaLocation = false;
- errorMessage = XSDEditorPlugin.getResourceString("_UI_INCORRECT_XML_SCHEMA", xsdModelFile); //$NON-NLS-1$
- }
- else
- {
- String currentNameSpace = xsdSchema.getTargetNamespace();
- if (input instanceof XSDInclude || input instanceof XSDRedefine)
- {
- // Check the namespace to make sure they are the same as current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getResourceString("_UI_DIFFERENT_NAME_SPACE", xsdModelFile); //$NON-NLS-1$
- isValidSchemaLocation = false;
- }
- }
- }
- else
- {
- // Check the namespace to make sure they are different from the current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getResourceString("_UI_SAME_NAME_SPACE", xsdModelFile); //$NON-NLS-1$
- isValidSchemaLocation = false;
- }
- }
- }
- }
- }
- else
- {
- errorMessage = Messages._UI_ERROR_INVALID_FILE;
- isValidSchemaLocation = false;
- }
- }
- catch(Exception e)
- {
- errorMessage = Messages._UI_ERROR_INVALID_FILE;
- isValidSchemaLocation = false;
- }
- finally
- {
- if (!isValidSchemaLocation)
- {
- errorText.setText(errorMessage);
- int length = errorText.getText().length();
- red = new Color(null, 255, 0, 0);
- StyleRange style = new StyleRange(0, length, red, schemaLocationText.getBackground());
- errorText.setStyleRange(style);
- }
- else
- {
- handleSchemaLocationChange(xsdModelFile, namespace, externalSchema);
- }
- }
- }
- }
-
- protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
- {
-
- }
-
-
- public void dispose()
- {
- super.dispose();
- if (red != null)
- {
- red.dispose();
- red = null;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
deleted file mode 100644
index e8e2adde5c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class EnumerationsSection extends AbstractSection
-{
- private EnumerationsTableViewer enumerationsTable;
- private Button addButton;
- private Button addManyButton;
- private Button deleteButton;
-
- /**
- *
- */
- public EnumerationsSection()
- {
- super();
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
- if (e.widget == addButton)
- {
- List enumList = st.getEnumerationFacets();
- String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
-
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATION, (XSDSimpleTypeDefinition) input);
- command.setValue(newName);
- getCommandStack().execute(command);
-
- enumerationsTable.refresh();
- int newItemIndex = enumerationsTable.getTable().getItemCount() - 1;
- enumerationsTable.editElement(enumerationsTable.getElementAt(newItemIndex), 0);
- }
- else if (e.widget == addManyButton)
- {
- Display display = Display.getCurrent();
- // if it is null, get the default one
- display = display == null ? Display.getDefault() : display;
- Shell parentShell = display.getActiveShell();
- EnumerationsDialog dialog = new EnumerationsDialog(parentShell);
- dialog.setBlockOnOpen(true);
- int result = dialog.open();
-
- if (result == Window.OK)
- {
- String text = dialog.getText();
- String delimiter = dialog.getDelimiter();
- StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
- CompoundCommand compoundCommand = new CompoundCommand(Messages._UI_ACTION_ADD_ENUMERATIONS);
- while (tokenizer.hasMoreTokens())
- {
- String token = tokenizer.nextToken();
- if (dialog.isPreserveWhitespace() == false)
- {
- token = token.trim();
- }
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATIONS, (XSDSimpleTypeDefinition) input);
- command.setValue(token);
- compoundCommand.add(command);
- }
- getCommandStack().execute(compoundCommand);
- }
- enumerationsTable.refresh();
- }
- else if (e.widget == deleteButton)
- {
- StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
- if (selection != null)
- {
- Iterator i = selection.iterator();
- CompoundCommand compoundCommand = new CompoundCommand(Messages._UI_ACTION_DELETE_ENUMERATION);
- while (i.hasNext())
- {
- Object obj = i.next();
- if (obj != null)
- {
- if (obj instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) obj;
-
- DeleteCommand deleteCommand = new DeleteCommand(Messages._UI_ACTION_DELETE_ENUMERATION, enumFacet);
- compoundCommand.add(deleteCommand);
- }
- }
- }
- getCommandStack().execute(compoundCommand);
- enumerationsTable.refresh();
- }
- }
- else if (e.widget == enumerationsTable.getTable())
- {
- StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
- if (selection.getFirstElement() != null)
- {
- deleteButton.setEnabled(true);
- }
- else
- {
- deleteButton.setEnabled(false);
- }
- }
-
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-
- public void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
- enumerationsTable.setInput(input);
- Table table = enumerationsTable.getTable();
- table.addSelectionListener(this);
-
- addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$
- addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$ //$NON-NLS-2$
- deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
-
- FormData data2 = new FormData();
- data2.top = new FormAttachment(0, 0);
- data2.left = new FormAttachment(100, -100);
- data2.right = new FormAttachment(100, 0);
- // data2.width = 50;
- addButton.setLayoutData(data2);
- addButton.addSelectionListener(this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(addButton, 0, SWT.LEFT);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(addButton, 0);
- addManyButton.setLayoutData(data);
- addManyButton.addSelectionListener(this);
-
- data = new FormData();
- data.left = new FormAttachment(addButton, 0, SWT.LEFT);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(addManyButton, 0);
- deleteButton.setLayoutData(data);
- deleteButton.setEnabled(false);
- deleteButton.addSelectionListener(this);
-
- data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(addButton, 0);
- data.bottom = new FormAttachment(100, 0);
- data.width = 50;
- table.setLayoutData(data);
- table.addListener(SWT.Resize, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
- Iterator validFacets = st.getValidFacets().iterator();
-
- boolean isApplicable = false;
- while (validFacets.hasNext())
- {
- String aValidFacet = (String) validFacets.next();
- if (aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG))
- {
- isApplicable = true;
- }
- }
-
- if (isApplicable)
- {
- addButton.setEnabled(true);
- addManyButton.setEnabled(true);
- }
- else
- {
- addButton.setEnabled(false);
- addManyButton.setEnabled(false);
- }
- enumerationsTable.setInput(input);
- }
-
- public void handleEvent(Event event)
- {
- Table table = enumerationsTable.getTable();
- if (event.type == SWT.Resize && event.widget == table)
- {
- TableColumn tableColumn = table.getColumn(0);
- tableColumn.setWidth(table.getSize().x);
- }
- }
-
- public void dispose()
- {
- }
-
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
- {
- protected String[] columnProperties = { XSDConstants.ENUMERATION_ELEMENT_TAG };
-
- protected CellEditor[] cellEditors;
-
- Table table;
-
- public EnumerationsTableViewer(Table table)
- {
- super(table);
- table = getTable();
-
- table.setLinesVisible(true);
-
- setContentProvider(new EnumerationsTableContentProvider());
- setLabelProvider(new EnumerationsTableLabelProvider());
- setColumnProperties(columnProperties);
-
- setCellModifier(this);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setText(columnProperties[0]);
- column.setAlignment(SWT.LEFT);
- column.setResizable(true);
-
- cellEditors = new CellEditor[1];
-
- TableLayout layout = new TableLayout();
- ColumnWeightData data = new ColumnWeightData(100);
-
- layout.addColumnData(data);
- cellEditors[0] = new TextCellEditor(table);
-
- getTable().setLayout(layout);
- setCellEditors(cellEditors);
- }
-
- public boolean canModify(Object element, String property)
- {
- return true;
- }
-
- public void modify(Object element, String property, Object value)
- {
- if (element instanceof TableItem && (value != null))
- {
- TableItem item = (TableItem) element;
-
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
- SetXSDFacetValueCommand command = new SetXSDFacetValueCommand(Messages._UI_ACTION_SET_ENUMERATION_VALUE, enumFacet);
- command.setValue((String) value);
- getCommandStack().execute(command);
- item.setData(enumFacet);
- item.setText((String) value);
- }
- }
-
- public Object getValue(Object element, String property)
- {
- if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
- class EnumerationsTableContentProvider implements IStructuredContentProvider
- {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public java.lang.Object[] getElements(java.lang.Object inputElement)
- {
- java.util.List list = new ArrayList();
- if (inputElement instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) inputElement;
- return st.getEnumerationFacets().toArray();
- }
- return list.toArray();
- }
-
- public void dispose()
- {
- }
- }
-
- class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
- {
- public EnumerationsTableLabelProvider()
- {
-
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif"); //$NON-NLS-1$
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/ExtensionsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/ExtensionsSection.java
deleted file mode 100644
index 1fad5105af..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/ExtensionsSection.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionAttributeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleRemoveExtensionNodeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.RemoveExtensionNodeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.AddExtensionsComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.CategoryProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.DOMExtensionTreeLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionItemFilter;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.XSDExtensionTreeContentProvider;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeFilter;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class ExtensionsSection extends AbstractExtensionsSection
-{
- XSDModelAdapter adapter = null;
-
- public ExtensionsSection()
- {
- super();
- setExtensionTreeLabelProvider(new DOMExtensionTreeLabelProvider());
- setExtensionTreeContentProvider(new XSDExtensionTreeContentProvider());
- }
-
- protected AddExtensionsComponentDialog createAddExtensionsComponentDialog()
- {
- AddExtensionsComponentDialog dialog = new AddExtensionsComponentDialog(composite.getShell(), getExtensionsSchemasRegistry())
- {
- protected IStructuredContentProvider getCategoryContentProvider()
- {
- return new XSDCategoryContentProvider();
- }
- };
- dialog.addElementsTableFilter(new AddExtensionsComponentDialogFilter(input, dialog));
- return dialog;
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- if (adapter == null)
- {
- if (selection instanceof StructuredSelection)
- {
- Object obj = ((StructuredSelection) selection).getFirstElement();
- if (obj instanceof XSDConcreteComponent)
- {
- Element element = ((XSDConcreteComponent)obj).getElement();
- if (element != null)
- {
- adapter = XSDModelAdapter.lookupOrCreateModelAdapter(element.getOwnerDocument());
- if (adapter != null)
- {
- ModelReconcileAdapter modelReconcileAdapter = adapter.getModelReconcileAdapter();
- if (modelReconcileAdapter != null)
- {
- modelReconcileAdapter.addListener(internalNodeAdapter);
- }
- }
- }
- }
- }
- }
- extensionTreeViewer.expandToLevel(2);
- }
-
- public void dispose()
- {
- super.dispose();
- if (adapter != null)
- {
- ModelReconcileAdapter modelReconcileAdapter = adapter.getModelReconcileAdapter();
- if (modelReconcileAdapter != null)
- {
- modelReconcileAdapter.removeListener(internalNodeAdapter);
- }
- }
- }
-
- protected AddExtensionCommand getAddExtensionCommand(Object o)
- {
- AddExtensionCommand addExtensionCommand = null;
- if (o instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) o;
- ExtensibleAddExtensionCommand extensibleAddExtensionCommand = getExtensionsSchemasRegistry().getAddExtensionCommand(element.getTargetNamespace());
- if (extensibleAddExtensionCommand != null)
- {
- extensibleAddExtensionCommand.setInputs((XSDConcreteComponent) input, element);
- addExtensionCommand = extensibleAddExtensionCommand;
- }
- else
- {
- addExtensionCommand = new AddExtensionElementCommand(Messages._UI_ACTION_ADD_APPINFO_ELEMENT, (XSDConcreteComponent) input, element);
- }
- }
- else if (o instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) o;
- addExtensionCommand = new AddExtensionAttributeCommand(Messages._UI_ACTION_ADD_APPINFO_ATTRIBUTE, (XSDConcreteComponent) input, attribute);
- }
- return addExtensionCommand;
- }
-
- protected Command getRemoveExtensionCommand(Object o)
- {
- Command command = null;
- try
- {
- if (o instanceof Node)
- {
- Node node = (Node)o;
- ExtensibleRemoveExtensionNodeCommand removeCommand = getExtensionsSchemasRegistry().getRemoveExtensionNodeCommand(node.getNamespaceURI());
- if (removeCommand != null)
- {
- removeCommand.setInput((XSDConcreteComponent)input);
- removeCommand.setNode(node);
- return removeCommand;
- }
- else
- {
- command = new RemoveExtensionNodeCommand(Messages._UI_ACTION_DELETE_APPINFO_ELEMENT, node);
- // command.execute();
- }
- }
- }
- catch (Exception e)
- {
- }
- return command;
- }
-
- protected ExtensionsSchemasRegistry getExtensionsSchemasRegistry()
- {
- return XSDEditorPlugin.getDefault().getExtensionsSchemasRegistry();
- }
-
- protected boolean isTreeViewerInputElement(Element element)
- {
- if (input instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent)input;
- Element componentElement = component.getElement();
- Node parent = element.getParentNode();
- Node grandParent = parent != null ? parent.getParentNode() : null;
- return componentElement == element || componentElement == parent || componentElement == grandParent;
- }
- return false;
- }
-
- protected IPreferenceStore getPrefStore()
- {
- return XSDEditorPlugin.getPlugin().getPreferenceStore();
- }
-
- static class XSDCategoryContentProvider implements IStructuredContentProvider
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- SpecificationForExtensionsSchema[] extensionsSchemaSpecs = null;
- try
- {
- List inputList = (List) inputElement;
-
- List total = new ArrayList();
- total.addAll(inputList);
-
- List dynamicCategories = XSDEditorPlugin.getPlugin().getExtensionsSchemasRegistry().getCategoryProviders();
- for (Iterator iter = dynamicCategories.iterator(); iter.hasNext(); )
- {
- CategoryProvider categoryProvider = (CategoryProvider)iter.next();
- for (Iterator it = categoryProvider.getCategories().iterator(); it.hasNext(); )
- {
- SpecificationForExtensionsSchema sp = (SpecificationForExtensionsSchema)it.next();
- total.add(sp);
- }
- }
-
- extensionsSchemaSpecs = (SpecificationForExtensionsSchema[]) total.toArray(new SpecificationForExtensionsSchema[0]);
- }
- catch (Exception e)
- {
- }
- return extensionsSchemaSpecs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- // Do nothing
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- // Do nothing
-
- }
- }
-
- /**
- * This filter is to be used by the dialog invoked when addButton is pressed
- */
- protected class AddExtensionsComponentDialogFilter extends ViewerFilter
- {
- private Object input;
- private AddExtensionsComponentDialog dialog;
-
- public AddExtensionsComponentDialogFilter(Object input, AddExtensionsComponentDialog dialog)
- {
- this.input = input;
- this.dialog = dialog;
- }
-
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (input instanceof XSDConcreteComponent &&
- element instanceof XSDConcreteComponent)
- {
- SpecificationForExtensionsSchema spec = dialog.getSelectedCategory();
- // here we obtain the node filter that was registered for the applicable namespace
- // notied
- NodeFilter filter = XSDEditorPlugin.getPlugin().getNodeCustomizationRegistry().getNodeFilter(spec.getNamespaceURI());
-
- if (filter == null)
- {
- // Check if a node filter has been specified, if so, then use it
- filter = spec.getNodeFilter();
- }
-
- if (filter instanceof ExtensionItemFilter)
- {
- ExtensionItemFilter extensionItemFilter = (ExtensionItemFilter)filter;
- return extensionItemFilter.isApplicableContext((XSDConcreteComponent)input, (XSDConcreteComponent)element);
- }
- else
- {
- // TODO cs: even if it's just a plain old NodeFilter we should still be able to use it!
- }
- }
- return true;
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java
deleted file mode 100644
index e13d74d745..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java
+++ /dev/null
@@ -1,559 +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.xsd.ui.internal.common.properties.sections;
-
-//import java.util.ArrayList;
-//import java.util.Iterator;
-//import java.util.List;
-//
-//import org.eclipse.jface.viewers.CellEditor;
-//import org.eclipse.jface.viewers.ColumnWeightData;
-//import org.eclipse.jface.viewers.ICellModifier;
-//import org.eclipse.jface.viewers.ISelectionChangedListener;
-//import org.eclipse.jface.viewers.IStructuredContentProvider;
-//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.TextCellEditor;
-//import org.eclipse.jface.viewers.Viewer;
-//import org.eclipse.swt.SWT;
-//import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.events.MouseTrackAdapter;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.graphics.Point;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Table;
-//import org.eclipse.swt.widgets.TableColumn;
-//import org.eclipse.swt.widgets.TableItem;
-//import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-//import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-//import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-//import org.eclipse.wst.xsd.ui.internal.properties.XSDComboBoxPropertyDescriptor;
-//import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-//import org.eclipse.xsd.XSDConstrainingFacet;
-//import org.eclipse.xsd.XSDFactory;
-//import org.eclipse.xsd.XSDMaxExclusiveFacet;
-//import org.eclipse.xsd.XSDMaxFacet;
-//import org.eclipse.xsd.XSDMaxInclusiveFacet;
-//import org.eclipse.xsd.XSDMinExclusiveFacet;
-//import org.eclipse.xsd.XSDMinFacet;
-//import org.eclipse.xsd.XSDMinInclusiveFacet;
-//import org.eclipse.xsd.XSDSimpleTypeDefinition;
-//import org.eclipse.xsd.util.XSDConstants;
-//import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-//import org.w3c.dom.Element;
-
-public class FacetViewer //extends NavigableTableViewer implements ICellModifier
-{
-// public static final String FACET_NAME = XSDEditorPlugin.getXSDString("_UI_FACET_NAME"); // "Name";
-// public static final String FACET_VALUE = XSDEditorPlugin.getXSDString("_UI_FACET_VALUE"); // "Value";
-// public static final String FACET_OTHER = XSDEditorPlugin.getXSDString("_UI_FACET_FIXED"); // "Fixed";
-//
-// protected FacetsTableLabelProvider facetsTableLabelProvider = new FacetsTableLabelProvider();
-// protected FacetsTableContentProvider facetsTableContentProvider = new FacetsTableContentProvider();
-// protected String[] columnProperties = { FACET_NAME, FACET_VALUE, FACET_OTHER };
-// protected CellEditor[] cellEditors; // these cellEditors are used when
-// // non-whitespace facet is selected
-// protected CellEditor[] altCellEditors; // these cellEditors are used when
-// // whitespace facet is selected
-//
-// protected String[] whiteSpaceValues = new String[] { "", "preserve", "replace", "collapse" };
-// protected String[] trueFalseValues = new String[] { "", "false", "true" };
-//
-// /**
-// * @param parent
-// */
-// public FacetViewer(Composite parent)
-// {
-// super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE));
-//
-// getTable().setLinesVisible(true);
-// getTable().setHeaderVisible(true);
-//
-// addSelectionChangedListener(new SelectionChangedListener());
-// getTable().addMouseTrackListener(new MyMouseTrackListener());
-//
-// setContentProvider(facetsTableContentProvider);
-// setLabelProvider(facetsTableLabelProvider);
-// setColumnProperties(columnProperties);
-//
-// setCellModifier(this);
-//
-// for (int i = 0; i < 3; i++)
-// {
-// TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
-// column.setText(columnProperties[i]);
-// column.setAlignment(SWT.LEFT);
-// column.setResizable(true);
-// }
-//
-// cellEditors = new CellEditor[3];
-// altCellEditors = new CellEditor[3];
-//
-// TableLayout layout = new TableLayout();
-// ColumnWeightData data = new ColumnWeightData(60, 80, true);
-// layout.addColumnData(data);
-// cellEditors[0] = null;
-//
-// ColumnWeightData data2 = new ColumnWeightData(120, 80, true);
-// layout.addColumnData(data2);
-//
-// cellEditors[1] = new TextCellEditor(getTable());
-// XSDComboBoxPropertyDescriptor pd = new XSDComboBoxPropertyDescriptor("combo", "whitespace", whiteSpaceValues);
-// altCellEditors[1] = pd.createPropertyEditor(getTable());
-//
-// ColumnWeightData data3 = new ColumnWeightData(60, 60, true);
-// layout.addColumnData(data3);
-//
-// XSDComboBoxPropertyDescriptor pd2 = new XSDComboBoxPropertyDescriptor("combo", "other", trueFalseValues);
-// cellEditors[2] = pd2.createPropertyEditor(getTable());
-// altCellEditors[2] = pd2.createPropertyEditor(getTable());
-//
-// getTable().setLayout(layout);
-// setCellEditors(cellEditors);
-//
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
-// * java.lang.String)
-// */
-// public boolean canModify(Object element, String property)
-// {
-// return property.equals(FACET_VALUE) || property.equals(FACET_OTHER);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
-// * java.lang.String)
-// */
-// public Object getValue(Object element, String property)
-// {
-// int column = 0;
-// if (property.equals(columnProperties[0]))
-// {
-// column = 0;
-// }
-// else if (property.equals(columnProperties[1]))
-// {
-// column = 1;
-// }
-// else if (property.equals(columnProperties[2]))
-// {
-// column = 2;
-// }
-//
-// return facetsTableLabelProvider.getColumnText(element, column);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
-// * java.lang.String, java.lang.Object)
-// */
-// public void modify(Object element, String property, Object value)
-// {
-// XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-// TableItem item = (TableItem) element;
-// if (item != null)
-// {
-// Object o = item.getData();
-// if (o != null)
-// {
-// if (o instanceof String)
-// {
-// String facet = (String) o;
-//
-// Element simpleTypeElement = xsdSimpleType.getElement();
-// XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-// Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
-//
-// String prefix = simpleTypeElement.getPrefix();
-// prefix = (prefix == null) ? "" : (prefix + ":");
-//
-// Element childNodeElement = null;
-// DOMAttribute valueAttr = null;
-//
-// XSDConstrainingFacet targetFacet = getXSDConstrainingFacet(facet);
-//
-// String newValue = "";
-// if (value != null && value instanceof String)
-// {
-// newValue = (String) value;
-// }
-//
-// if (property.equals(columnProperties[1]))
-// {
-// if (targetFacet == null && newValue.length() > 0)
-// {
-// targetFacet = createFacet(facet);
-// childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + facet);
-// valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newValue);
-// childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
-// // add and format child
-// derivedByElement.appendChild(childNodeElement);
-// targetFacet.setElement(childNodeElement);
-// XSDDOMHelper.formatChild(childNodeElement);
-//
-// // XSDSchemaHelper.updateElement(xsdSimpleType);
-// }
-// if (targetFacet == null)
-// {
-// return;
-// }
-//
-// if (newValue.length() > 0)
-// {
-// targetFacet.setLexicalValue(newValue);
-//
-// if (targetFacet instanceof XSDMaxFacet || targetFacet instanceof XSDMinFacet)
-// {
-// if (targetFacet instanceof XSDMaxFacet)
-// {
-// if (targetFacet instanceof XSDMaxExclusiveFacet)
-// {
-// XSDMaxInclusiveFacet xsdMaxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
-// if (xsdMaxInclusiveFacet != null)
-// {
-// Element xsdMaxInclusiveFacetElement = xsdMaxInclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMaxInclusiveFacetElement);
-// }
-// }
-// else if (targetFacet instanceof XSDMaxInclusiveFacet)
-// {
-// XSDMaxExclusiveFacet xsdMaxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-// if (xsdMaxExclusiveFacet != null)
-// {
-// Element xsdMaxExclusiveFacetElement = xsdMaxExclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMaxExclusiveFacetElement);
-// }
-// }
-// }
-// else if (targetFacet instanceof XSDMinFacet)
-// {
-// if (targetFacet instanceof XSDMinExclusiveFacet)
-// {
-// XSDMinInclusiveFacet xsdMinInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
-// if (xsdMinInclusiveFacet != null)
-// {
-// Element xsdMinInclusiveFacetElement = xsdMinInclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMinInclusiveFacetElement);
-// }
-// }
-// else if (targetFacet instanceof XSDMinInclusiveFacet)
-// {
-// XSDMinExclusiveFacet xsdMinExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
-// if (xsdMinExclusiveFacet != null)
-// {
-// Element xsdMinExclusiveFacetElement = xsdMinExclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMinExclusiveFacetElement);
-// }
-// }
-// }
-// }
-// }
-// else
-// // newValue.length == 0
-// {
-// Element targetFacetElement = targetFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(targetFacetElement);
-// }
-// }
-// else if (property.equals(columnProperties[2]))
-// {
-// if (targetFacet != null)
-// {
-// if (newValue.length() > 0)
-// {
-// targetFacet.getElement().setAttribute(XSDConstants.FIXED_ATTRIBUTE, newValue);
-// }
-// else
-// {
-// targetFacet.getElement().removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-// }
-// }
-// }
-// xsdSimpleType.setElement(simpleTypeElement);
-// // xsdSimpleType.updateElement();
-// refresh();
-// }
-// }
-// }
-// }
-//
-// private XSDConstrainingFacet getXSDConstrainingFacet(String facetString)
-// {
-// XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-// List list = xsdSimpleType.getFacetContents();
-// if (list == null)
-// {
-// return null;
-// }
-// Iterator iter = list.iterator();
-// XSDConstrainingFacet targetFacet = null;
-//
-// while (iter.hasNext())
-// {
-// XSDConstrainingFacet xsdConstrainingFacet = (XSDConstrainingFacet) iter.next();
-// if (xsdConstrainingFacet.getFacetName().equals(facetString))
-// {
-// targetFacet = xsdConstrainingFacet;
-// break;
-// }
-// }
-// return targetFacet;
-// }
-//
-// private XSDConstrainingFacet createFacet(String facet)
-// {
-// XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-// XSDConstrainingFacet xsdFacet = null;
-// if (facet.equals("length"))
-// {
-// xsdFacet = factory.createXSDLengthFacet();
-// }
-// else if (facet.equals("minLength"))
-// {
-// xsdFacet = factory.createXSDMinLengthFacet();
-// }
-// else if (facet.equals("maxLength"))
-// {
-// xsdFacet = factory.createXSDMaxLengthFacet();
-// }
-// else if (facet.equals("minInclusive"))
-// {
-// xsdFacet = factory.createXSDMinInclusiveFacet();
-// }
-// else if (facet.equals("minExclusive"))
-// {
-// xsdFacet = factory.createXSDMinExclusiveFacet();
-// }
-// else if (facet.equals("maxInclusive"))
-// {
-// xsdFacet = factory.createXSDMaxInclusiveFacet();
-// }
-// else if (facet.equals("maxExclusive"))
-// {
-// xsdFacet = factory.createXSDMaxExclusiveFacet();
-// }
-//
-// else if (facet.equals("totalDigits"))
-// {
-// xsdFacet = factory.createXSDTotalDigitsFacet();
-// }
-// else if (facet.equals("fractionDigits"))
-// {
-// xsdFacet = factory.createXSDFractionDigitsFacet();
-// }
-// else if (facet.equals("whiteSpace"))
-// {
-// xsdFacet = factory.createXSDWhiteSpaceFacet();
-// }
-// return xsdFacet;
-// }
-//
-// /**
-// * Get the tooltip for the facet
-// */
-// public String getToolTip(String facet)
-// {
-// String key = "";
-// if (facet.equals("length"))
-// {
-// key = "_UI_TOOLTIP_LENGTH";
-// }
-// else if (facet.equals("minLength"))
-// {
-// key = "_UI_TOOLTIP_MIN_LEN";
-// }
-// else if (facet.equals("maxLength"))
-// {
-// key = "_UI_TOOLTIP_MAX_LEN";
-// }
-//
-// else if (facet.equals("minInclusive"))
-// {
-// key = "_UI_TOOLTIP_MIN_INCLUSIVE";
-// }
-// else if (facet.equals("minExclusive"))
-// {
-// key = "_UI_TOOLTIP_MIN_EXCLUSIVE";
-// }
-//
-// else if (facet.equals("maxInclusive"))
-// {
-// key = "_UI_TOOLTIP_MAX_INCLUSIVE";
-// }
-// else if (facet.equals("maxExclusive"))
-// {
-// key = "_UI_TOOLTIP_MAX_EXCLUSIVE";
-// }
-//
-// else if (facet.equals("totalDigits"))
-// {
-// key = "_UI_TOOLTIP_TOTAL_DIGITS";
-// }
-// else if (facet.equals("fractionDigits"))
-// {
-// key = "_UI_TOOLTIP_FRACTION_DIGITS";
-// }
-//
-// else if (facet.equals("whiteSpace"))
-// {
-// key = "_UI_TOOLTIP_WHITE_SPACE";
-// }
-//
-// return (key != null) ? XSDEditorPlugin.getXSDString(key) : "";
-// }
-//
-// /**
-// * This listener detects which row is selected and add a tool tip for that row
-// */
-// public class MyMouseTrackListener extends MouseTrackAdapter
-// {
-// public void mouseHover(MouseEvent e)
-// {
-// TableItem item = getTable().getItem(new Point(e.x, e.y));
-// if (item != null)
-// {
-// Object o = item.getData();
-// if (o != null)
-// {
-// String facetName = (String) o;
-// getTable().setToolTipText(getToolTip(facetName));
-// }
-// }
-// }
-// }
-//
-// /**
-// * Based on the selection, detects if it is a white space or not, and add the
-// * corresponding cell editors
-// */
-// public class SelectionChangedListener implements ISelectionChangedListener
-// {
-// public void selectionChanged(SelectionChangedEvent event)
-// {
-// Object selection = event.getSelection();
-// if (selection instanceof StructuredSelection)
-// {
-// Object o = ((StructuredSelection) selection).getFirstElement();
-// if (o != null)
-// {
-// String facet = (String) o;
-// if (facet.equals("whiteSpace"))
-// {
-// setCellEditors(altCellEditors);
-// }
-// else
-// {
-// setCellEditors(cellEditors);
-// }
-// }
-// }
-// }
-// }
-//
-// class FacetsTableContentProvider implements IStructuredContentProvider
-// {
-// protected String facet;
-//
-// public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-// {
-// }
-//
-// public java.lang.Object[] getElements(java.lang.Object inputElement)
-// {
-// List v = new ArrayList();
-// XSDSimpleTypeDefinition inputXSDSimpleType = (XSDSimpleTypeDefinition) inputElement;
-// XSDSimpleTypeDefinition base = inputXSDSimpleType.getPrimitiveTypeDefinition();
-//
-// if (base != null)
-// {
-// Iterator validFacets = inputXSDSimpleType.getValidFacets().iterator();
-// while (validFacets.hasNext())
-// {
-// String aValidFacet = (String) validFacets.next();
-// if (!(aValidFacet.equals("pattern") || aValidFacet.equals("enumeration")))
-// {
-// v.add(aValidFacet);
-// }
-// }
-// }
-// return v.toArray();
-// }
-//
-// public void dispose()
-// {
-// }
-// }
-//
-// class FacetsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-// {
-// public Image getColumnImage(Object element, int columnIndex)
-// {
-// return null;
-// }
-//
-// public String getColumnText(Object element, int columnIndex)
-// {
-// if (element instanceof String)
-// {
-// String value = null;
-// XSDConstrainingFacet targetFacet = getXSDConstrainingFacet((String) element);
-// switch (columnIndex)
-// {
-// case 0:
-// {
-// value = (String) element;
-// break;
-// }
-// case 1:
-// {
-// if (targetFacet == null)
-// {
-// value = "";
-// }
-// else
-// {
-// value = targetFacet.getLexicalValue();
-// }
-//
-// break;
-// }
-// case 2:
-// {
-// if (targetFacet == null)
-// {
-// value = "";
-// }
-// else
-// {
-// Element elem = targetFacet.getElement();
-// value = elem.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-// if (value == null)
-// value = "";
-// }
-// }
-// }
-// return value;
-// }
-// return "";
-// }
-// }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java
deleted file mode 100644
index a72e632f4e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java
+++ /dev/null
@@ -1,19 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-public interface IDocumentChangedNotifier
-{
- public void addListener(INodeAdapter adapter);
- public void removeListener(INodeAdapter adapter);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
deleted file mode 100644
index 556acfa0e8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateMaxOccursCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateMinOccursCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class MultiplicitySection extends RefactoringSection
-{
- protected CCombo minCombo, maxCombo;
-
- public MultiplicitySection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- }
-
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == minCombo)
- {
- updateMinAttribute();
- }
- else if (event.widget == maxCombo)
- {
- updateMaxAttribute();
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == minCombo)
- {
- updateMinAttribute();
- }
- else if (e.widget == maxCombo)
- {
- updateMaxAttribute();
- }
- super.doWidgetSelected(e);
- }
-
- protected void updateMaxAttribute()
- {
- setErrorMessage(null);
- XSDParticle particle = null;
-
- if (input instanceof XSDParticleContent)
- {
- particle = getAssociatedParticle((XSDParticleContent) input);
- }
- if (particle != null)
- {
- String newValue = maxCombo.getText().trim();
-
- if (newValue.length() == 0)
- {
- particle.unsetMaxOccurs();
- return;
- }
- try
- {
- int newMax = 1;
- if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- newMax = XSDParticle.UNBOUNDED;
- }
- else
- {
- if (newValue.length() > 0)
- {
- newMax = Integer.parseInt(newValue);
- }
- }
- setListenerEnabled(false);
- UpdateMaxOccursCommand command = new UpdateMaxOccursCommand(Messages._UI_ACTION_CHANGE_MAXIMUM_OCCURRENCE, particle, newMax);
- getCommandStack().execute(command);
- setListenerEnabled(true);
-
- }
- catch (NumberFormatException e)
- {
- setErrorMessage(Messages._UI_ERROR_INVALID_VALUE_FOR_MAXIMUM_OCCURRENCE);
- }
- }
- }
-
- protected void updateMinAttribute()
- {
- setErrorMessage(null);
- XSDParticle particle = null;
-
- if (input instanceof XSDParticleContent)
- {
- particle = getAssociatedParticle((XSDParticleContent) input);
- }
- if (particle != null)
- {
- String newValue = minCombo.getText();
- if (newValue.length() == 0)
- {
- particle.unsetMinOccurs();
- }
- try
- {
- int newMin = 1;
- if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- newMin = XSDParticle.UNBOUNDED;
- }
- else
- {
- newMin = Integer.parseInt(newValue);
- }
- UpdateMinOccursCommand command = new UpdateMinOccursCommand(Messages._UI_ACTION_CHANGE_MINIMUM_OCCURRENCE, particle, newMin);
- getCommandStack().execute(command);
- }
- catch (NumberFormatException e)
- {
-
- }
- }
- }
-
- protected void refreshMinMax()
- {
- boolean refreshMinText = true;
- boolean refreshMaxText = true;
- if (minCombo.isFocusControl())
- {
- refreshMinText = false;
- }
- if (maxCombo.isFocusControl())
- {
- refreshMaxText = false;
- }
- if (refreshMinText)
- {
- minCombo.setText(""); //$NON-NLS-1$
- }
- if (refreshMaxText)
- {
- maxCombo.setText(""); //$NON-NLS-1$
- }
-
- if (input != null)
- {
- if (input instanceof XSDParticleContent)
- {
- XSDParticle particle = getAssociatedParticle((XSDParticleContent) input);
- if (particle != null)
- {
- // minText.setText(String.valueOf(particle.getMinOccurs()));
- // maxText.setText(String.valueOf(particle.getMaxOccurs()));
- Element element = particle.getElement();
- if (element != null)
- {
- if (element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE) && refreshMinText)
- {
- String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- minCombo.setText(min);
- }
- if (element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE) && refreshMaxText)
- {
- String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
- maxCombo.setText(max);
- }
- }
- }
- }
- }
- }
-
- protected XSDParticle getAssociatedParticle(XSDParticleContent particleContent)
- {
- XSDConcreteComponent xsdComp = particleContent.getContainer();
- if (xsdComp instanceof XSDParticle)
- {
- return (XSDParticle) xsdComp;
- }
- return null;
- }
-
- public void dispose()
- {
- if (minCombo != null && !minCombo.isDisposed())
- removeListeners(minCombo);
- if (maxCombo != null && !maxCombo.isDisposed())
- removeListeners(maxCombo);
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
deleted file mode 100644
index b9efd04c87..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class RefactoringSection extends AbstractSection implements IHyperlinkListener
-{
- /**
- * Clicking on it invokes the refactor->rename action.
- */
- private ImageHyperlink renameHyperlink;
-
- protected boolean hideHyperLink;
-
- /**
- * Invokes the refactor->rename action on the current selection.
- */
- private void invokeRenameRefactoring()
- {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- XSDSchema schema = (XSDSchema) editor.getAdapter(XSDSchema.class);
- ISelection selection = new StructuredSelection(input);
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- selection = mapper != null ? mapper.mapSelection(selection) : selection;
- RenameHandler renameHandler = new RenameHandler();
- renameHandler.execute(selection, schema);
- }
-
- protected void showLink(boolean isVisible)
- {
- renameHyperlink.setVisible(isVisible);
- }
-
- /**
- * Creates the refactor/rename hyperlink shown beside a component name.
- * Clicking on the hyperlink invokes the refactor/rename action.
- *
- * @param parent
- * the parent composite. Must not be null.
- */
- protected void createRenameHyperlink(Composite parent)
- {
- renameHyperlink = getWidgetFactory().createImageHyperlink(parent, SWT.NONE);
-
- renameHyperlink.setImage(XSDEditorPlugin.getXSDImage("icons/quickassist.gif")); //$NON-NLS-1$
- renameHyperlink.setToolTipText(Messages._UI_TOOLTIP_RENAME_REFACTOR);
- renameHyperlink.addHyperlinkListener(this);
- }
-
- protected void setRenameHyperlinkEnabled(boolean isEnabled)
- {
- renameHyperlink.setEnabled(isEnabled);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkActivated(HyperlinkEvent e)
- {
- invokeRenameRefactoring();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkEntered(HyperlinkEvent e)
- {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkExited(HyperlinkEvent e)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java
deleted file mode 100644
index e8798bb0c5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.impl.XSDIncludeImpl;
-import org.eclipse.xsd.impl.XSDRedefineImpl;
-import org.w3c.dom.Element;
-
-public class SchemaLocationSection extends CommonDirectivesSection
-{
- IWorkbenchPart part;
-
- /**
- *
- */
- public SchemaLocationSection()
- {
- super();
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- GridData data = new GridData();
-
- // Create Schema Location Label
- CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- schemaLocationLabel.setLayoutData(data);
-
- // Create Schema Location Text
- schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- schemaLocationText.setEditable(true);
- applyAllListeners(schemaLocationText);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- schemaLocationText.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(schemaLocationText,
- XSDEditorCSHelpIds.GENERAL_TAB__INCLUDE_REDEFINE__SCHEMALOCATION);
-
- // Create Wizard Button
- wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
- wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- wizardButton.setLayoutData(data);
- wizardButton.addSelectionListener(this);
-
- // error text
- errorText = new StyledText(composite, SWT.FLAT);
- errorText.setEditable(false);
- errorText.setEnabled(false);
- errorText.setText(""); //$NON-NLS-1$
-
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 3;
- data.grabExcessHorizontalSpace = true;
- errorText.setLayoutData(data);
-
- }
-
- public void doWidgetSelected(SelectionEvent event)
- {
- if (event.widget == wizardButton)
- {
- XSDDirectivesSchemaLocationUpdater.updateSchemaLocation(xsdSchema,input,true);
- refresh();
- }
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
-
- Element element = null;
- if (input instanceof XSDInclude)
- {
- element = ((XSDIncludeImpl) input).getElement();
- }
- else if (input instanceof XSDRedefine)
- {
- element = ((XSDRedefineImpl) input).getElement();
- }
-
- if (element != null)
- {
- String location = ""; //$NON-NLS-1$
- location = element.getAttribute("schemaLocation"); //$NON-NLS-1$
- if (location == null)
- {
- location = ""; //$NON-NLS-1$
- }
- schemaLocationText.setText(location);
- }
-
- setListenerEnabled(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
deleted file mode 100644
index a090be1f09..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
+++ /dev/null
@@ -1,312 +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.xsd.ui.internal.common.properties.sections;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-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.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class SimpleContentUnionMemberTypesDialog extends Dialog implements SelectionListener
-{
- XSDSimpleTypeDefinition simpleType;
- /**
- * @param parentShell
- */
- public SimpleContentUnionMemberTypesDialog(Shell parentShell, XSDSimpleTypeDefinition simpleType)
- {
- super(parentShell);
- this.simpleType = simpleType;
- }
-
- Table table;
- TypeSection typeSection;
- Button addButton, removeButton;
- org.eclipse.swt.widgets.List memberTypesList;
-
- private String result;
-
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == Window.OK)
- {
- StringBuffer sb = new StringBuffer();
- int length = memberTypesList.getItemCount();
- for (int i=0 ; i < length; i++)
- {
- sb.append(memberTypesList.getItem(i));
- if (i < length - 1)
- {
- sb.append(" "); //$NON-NLS-1$
- }
- }
- result = sb.toString();
- }
- super.buttonPressed(buttonId);
- }
-
- public String getResult() { return result; }
-
- //
- // Create the controls
- //
- public Control createDialogArea(Composite parent)
- {
- Composite client = (Composite)super.createDialogArea(parent);
- getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); //$NON-NLS-1$
-
- Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
- instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES")); //$NON-NLS-1$
-
- Composite columnsComposite = new Composite(client, SWT.NONE);
- GridLayout ccGL = new GridLayout();
- ccGL.verticalSpacing = 0;
- ccGL.horizontalSpacing = 0;
- ccGL.marginHeight = 0;
- ccGL.marginWidth = 0;
- ccGL.makeColumnsEqualWidth = true;
- ccGL.numColumns = 3;
- columnsComposite.setLayout(ccGL);
-
- GridData ccGD = new GridData();
- ccGD.grabExcessHorizontalSpace = true;
- ccGD.horizontalAlignment = GridData.FILL;
- columnsComposite.setLayoutData(ccGD);
-
- typeSection = new TypeSection(columnsComposite);
- typeSection.setShowUserComplexType(false);
-
- typeSection.createClient(columnsComposite);
- typeSection.getSimpleType().setSelection(false);
- typeSection.getSimpleType().addSelectionListener(this);
- typeSection.getUserSimpleType().addSelectionListener(this);
-
- ViewUtility.createHorizontalFiller(columnsComposite, 1);
-
- Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
- memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE")); //$NON-NLS-1$
-
- Composite dataComposite = new Composite(client, SWT.NONE);
- GridLayout dcGL = new GridLayout();
- dcGL.verticalSpacing = 0;
- dcGL.marginHeight = 0;
- dcGL.marginWidth = 0;
- dcGL.numColumns = 3;
- dataComposite.setLayout(dcGL);
-
- GridData dcGD = new GridData();
- dcGD.grabExcessHorizontalSpace = true;
- dcGD.grabExcessVerticalSpace = true;
- dataComposite.setLayoutData(dcGD);
-
- table = new Table(dataComposite,
- SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- table.setHeaderVisible(false);
- table.setLinesVisible(true);
- GridData gd2 = new GridData();
- gd2.grabExcessHorizontalSpace = true;
- gd2.grabExcessVerticalSpace = true;
- gd2.horizontalAlignment = GridData.FILL;
- gd2.verticalAlignment = GridData.FILL;
- gd2.heightHint = 200;
- gd2.widthHint = 200;
- table.setLayoutData(gd2);
-
- // Fill table
- handleSetInput();
- table.getItemCount();
-
- TableColumn tc = new TableColumn(table, SWT.LEFT);
- tc.setWidth(200);
- tc.setResizable(true);
-
- Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
- GridLayout bcGL = new GridLayout();
- bcGL.numColumns = 1;
- buttonComposite.setLayout(bcGL);
- addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(">"); //$NON-NLS-1$
- addButton.addSelectionListener(this);
- removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText("<"); //$NON-NLS-1$
- removeButton.addSelectionListener(this);
-
- Composite listComposite = new Composite(dataComposite, SWT.NONE);
- GridLayout mtGL = new GridLayout();
- mtGL.numColumns = 1;
- mtGL.marginHeight = 0;
- mtGL.marginWidth = 0;
- mtGL.horizontalSpacing = 0;
- mtGL.verticalSpacing = 0;
- listComposite.setLayout(mtGL);
-
- GridData mtGD = new GridData();
- mtGD.grabExcessHorizontalSpace = true;
- mtGD.grabExcessVerticalSpace = true;
- mtGD.verticalAlignment = GridData.FILL;
- mtGD.horizontalAlignment = GridData.FILL;
- listComposite.setLayoutData(mtGD);
-
- memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData mtlGD = new GridData();
- mtlGD.grabExcessHorizontalSpace = true;
- mtlGD.grabExcessVerticalSpace = true;
- mtlGD.verticalAlignment = GridData.FILL;
- mtlGD.horizontalAlignment = GridData.FILL;
- mtlGD.heightHint = 200;
- mtlGD.widthHint = 200;
- memberTypesList.setLayoutData(mtlGD);
-
- initializeMemberListContent();
- return client;
- }
-
- private void initializeMemberListContent()
- {
-// String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-// if (result == null)
-// {
-// return;
-// }
-// StringTokenizer token = new StringTokenizer(result);
-// while (token.hasMoreTokens())
-// {
-// memberTypesList.add(token.nextToken());
-// }
- XSDSchema schema = simpleType.getSchema();
- for (Iterator i = simpleType.getMemberTypeDefinitions().iterator(); i.hasNext(); )
- {
- String name = ((XSDSimpleTypeDefinition)i.next()).getQName(schema);
- if (name != null)
- memberTypesList.add(name);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
- {
- populateBuiltInType();
- }
- else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
- {
- populateUserSimpleType(false);
- }
- else if (e.widget == addButton)
- {
- TableItem[] items = table.getItems();
- int selection = table.getSelectionIndex();
- if (items != null && items.length > 0 && selection >= 0)
- {
- String typeToAdd = items[selection].getData().toString();
- if (memberTypesList.indexOf(typeToAdd) < 0)
- {
- memberTypesList.add(items[selection].getData().toString());
- }
- }
- }
- else if (e.widget == removeButton)
- {
- String[] typesToRemove = memberTypesList.getSelection();
- for (int i=0; i < typesToRemove.length; i++)
- {
- memberTypesList.remove(typesToRemove[i]);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void handleSetInput()
- {
- populateBuiltInType();
- }
-
- public void populateBuiltInType()
- {
- table.removeAll();
- List items = getBuiltInTypeNamesList();
- for (int i = 0; i < items.size(); i++)
- {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(items.get(i).toString());
- item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
- item.setData(items.get(i));
- }
- }
-
- public void populateUserSimpleType(boolean showAnonymous)
- {
- table.removeAll();
- if (showAnonymous)
- {
- TableItem anonymousItem = new TableItem(table, SWT.NONE);
- anonymousItem.setText("**anonymous**"); //$NON-NLS-1$
- anonymousItem.setData("**anonymous**"); //$NON-NLS-1$
- }
- List items = getUserSimpleTypeNamesList();
- for (int i = 0; i < items.size(); i++)
- {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(items.get(i).toString());
- item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
- item.setData(items.get(i));
- }
- }
-
- public java.util.List getBuiltInTypeNamesList()
- {
- TypesHelper helper = new TypesHelper(simpleType.getSchema());
- return helper.getBuiltInTypeNamesList();
- }
-
- public java.util.List getUserSimpleTypeNamesList()
- {
- TypesHelper helper = new TypesHelper(simpleType.getSchema());
- return helper.getUserSimpleTypeNamesList();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java
deleted file mode 100644
index c13b65ddca..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ChangeToLocalSimpleTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateXSDPatternFacetCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class SpecificConstraintsWidget implements SelectionListener, Listener
-{
- public static int ENUMERATION = 0;
- public static int PATTERN = 1;
-
- int kind;
- ConstraintsTableViewer constraintsTableViewer;
- Button addButton;
- Button addUsingDialogButton;
- Button deleteButton;
- Button editButton;
- Composite composite;
- boolean isEnabled;
- TabbedPropertySheetWidgetFactory factory;
- XSDSimpleTypeDefinition input;
- XSDFeature feature;
- boolean isReadOnly;
- CommandStack commandStack;
- XSDFacetSection facetSection;
-
- /**
- * @deprecated
- * @param composite
- * @param factory
- * @param feature
- * @param input
- * @param facetSection
- */
- public SpecificConstraintsWidget(Composite composite, TabbedPropertySheetWidgetFactory factory, XSDFeature feature, XSDSimpleTypeDefinition input, XSDFacetSection facetSection)
- {
- this(composite, factory, feature, input, facetSection, ENUMERATION);
- }
-
- public SpecificConstraintsWidget(Composite composite, TabbedPropertySheetWidgetFactory factory, XSDFeature feature, XSDSimpleTypeDefinition input, XSDFacetSection facetSection, int kind)
- {
- this.factory = factory;
- this.input = input;
- this.composite = composite;
- this.feature = feature;
- this.facetSection = facetSection;
- this.kind = kind;
-
- createControl(composite);
- }
-
- public void setCommandStack(CommandStack commandStack)
- {
- this.commandStack = commandStack;
- }
-
- public void setIsReadOnly(boolean isReadOnly)
- {
- this.isReadOnly = isReadOnly;
- }
-
- public TabbedPropertySheetWidgetFactory getWidgetFactory()
- {
- return factory;
- }
-
- public Control getControl()
- {
- return composite;
- }
-
- public void setEnabled(boolean isEnabled)
- {
- this.isEnabled = isEnabled;
- addButton.setEnabled(isEnabled);
- addUsingDialogButton.setEnabled(isEnabled);
- editButton.setEnabled(isEnabled);
- constraintsTableViewer.getTable().setEnabled(isEnabled);
- composite.setEnabled(isEnabled);
- }
-
- public Control createControl(Composite parent)
- {
- composite = factory.createFlatFormComposite(parent);
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- constraintsTableViewer = new ConstraintsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
- constraintsTableViewer.setInput(input);
- Table table = constraintsTableViewer.getTable();
- table.addSelectionListener(this);
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 150;
- data.grabExcessVerticalSpace = true;
- table.setLayoutData(data);
- table.addListener(SWT.Resize, this);
-
- Composite buttonComposite = getWidgetFactory().createComposite(composite, SWT.FLAT);
- GridLayout buttonCompositeLayout = new GridLayout();
- buttonCompositeLayout.marginTop = 0;
- buttonCompositeLayout.marginBottom = 0;
- buttonCompositeLayout.numColumns = 1;
- buttonComposite.setLayout(buttonCompositeLayout);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- buttonComposite.setLayoutData(data);
-
-
- addButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD, SWT.PUSH);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.BEGINNING;
- addButton.setLayoutData(data);
- addButton.addSelectionListener(this);
-
- addUsingDialogButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_ADD_WITH_DOTS, SWT.PUSH);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.BEGINNING;
- addUsingDialogButton.setLayoutData(data);
- addUsingDialogButton.addSelectionListener(this);
-
- editButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_EDIT_WITH_DOTS, SWT.PUSH);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- editButton.setLayoutData(data);
- editButton.addSelectionListener(this);
-
-
- deleteButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_DELETE, SWT.PUSH);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- deleteButton.setLayoutData(data);
- deleteButton.addSelectionListener(this);
-
- setButtonStates(kind);
- return composite;
- }
-
- public void handleEvent(Event event)
- {
- Table table = constraintsTableViewer.getTable();
- if (event.type == SWT.Resize && event.widget == table)
- {
- TableColumn tableColumn = table.getColumn(0);
- tableColumn.setWidth(table.getSize().x);
- }
- }
-
- public void setInput(Object input)
- {
- constraintsTableViewer.setInput(input);
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
-// constraintsTableViewer.refresh();
- }
-
- public int getConstraintKind()
- {
- return this.kind;
- }
-
- protected void setButtonStates(int kind)
- {
- boolean add, addUsing, delete, edit;
-
- boolean listHasItems = false;
- StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
- if (selection != null)
- {
- if (selection.toList().size() > 0)
- {
- listHasItems = true;
- }
- }
-
- if (kind == ENUMERATION)
- {
- add = true;
- addUsing = true;
- edit = false;
- }
- else if (kind == PATTERN)
- {
- add = false;
- addUsing = true;
- edit = listHasItems;
- }
- else
- {
- add = true;
- addUsing = true;
- edit = true;
- }
- delete = listHasItems;
-
- if (!addButton.isDisposed())
- {
- addButton.setEnabled(add);
- }
- if (!addUsingDialogButton.isDisposed())
- {
- addUsingDialogButton.setEnabled(addUsing);
- }
- if (!deleteButton.isDisposed())
- {
- deleteButton.setEnabled(delete);
- }
- if (!editButton.isDisposed())
- {
- editButton.setEnabled(edit);
- }
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- XSDSimpleTypeDefinition st = input;
- if (e.widget == addButton)
- {
- List enumList = st.getEnumerationFacets();
- String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
-
- if (kind == ENUMERATION)
- {
- CompoundCommand compoundCommand = new CompoundCommand();
- XSDSimpleTypeDefinition targetSimpleType = null;
- if (feature != null)
- {
- XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(input);
-
- ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand(Messages._UI_ACTION_CHANGE_PATTERN, feature);
- changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
- compoundCommand.add(changeToAnonymousCommand);
- input = anonymousSimpleType;
- }
- targetSimpleType = anonymousSimpleType;
- }
- else
- {
- targetSimpleType = input;
- }
-
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATION, targetSimpleType);
- command.setValue(newName);
- compoundCommand.add(command);
- commandStack.execute(compoundCommand);
- setInput(input);
- constraintsTableViewer.refresh();
- int newItemIndex = constraintsTableViewer.getTable().getItemCount() - 1;
- constraintsTableViewer.editElement(constraintsTableViewer.getElementAt(newItemIndex), 0);
- }
- }
- else if (e.widget == addUsingDialogButton)
- {
- Display display = Display.getCurrent();
- // if it is null, get the default one
- display = display == null ? Display.getDefault() : display;
- Shell shell = display.getActiveShell();
-
- if (kind == PATTERN)
- {
- String initialValue = ""; //$NON-NLS-1$
- RegexWizard wizard = new RegexWizard(initialValue);
-
- WizardDialog wizardDialog = new WizardDialog(shell, wizard);
- wizardDialog.setBlockOnOpen(true);
- wizardDialog.create();
-
- int result = wizardDialog.open();
-
- if (result == Window.OK)
- {
- String newPattern = wizard.getPattern();
- CompoundCommand compoundCommand = new CompoundCommand();
- XSDSimpleTypeDefinition targetSimpleType = null;
- if (feature != null)
- {
- XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(input);
-
- ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand(Messages._UI_ACTION_CHANGE_PATTERN, feature);
- changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
- compoundCommand.add(changeToAnonymousCommand);
- input = anonymousSimpleType;
- }
- targetSimpleType = anonymousSimpleType;
- }
- else
- {
- targetSimpleType = input;
- }
-
- UpdateXSDPatternFacetCommand command = new UpdateXSDPatternFacetCommand(Messages._UI_ACTION_ADD_PATTERN, targetSimpleType, UpdateXSDPatternFacetCommand.ADD);
- command.setValue(newPattern);
- setInput(input);
- compoundCommand.add(command);
- commandStack.execute(compoundCommand);
- facetSection.doSetInput();
- }
- constraintsTableViewer.refresh();
- }
- else
- {
- EnumerationsDialog dialog = new EnumerationsDialog(shell);
- dialog.setBlockOnOpen(true);
- int result = dialog.open();
-
- if (result == Window.OK)
- {
- String text = dialog.getText();
- String delimiter = dialog.getDelimiter();
- StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
- CompoundCommand compoundCommand = new CompoundCommand(Messages._UI_ACTION_ADD_ENUMERATIONS);
-
- XSDSimpleTypeDefinition targetSimpleType = null;
- if (feature != null)
- {
- XSDSimpleTypeDefinition anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType(feature, input);
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(input);
-
- ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand("", feature); //$NON-NLS-1$
- changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
- compoundCommand.add(changeToAnonymousCommand);
- input = anonymousSimpleType;
- }
- targetSimpleType = anonymousSimpleType;
- }
- else
- {
- targetSimpleType = input;
- }
-
- while (tokenizer.hasMoreTokens())
- {
- String token = tokenizer.nextToken();
- if (dialog.isPreserveWhitespace() == false)
- {
- token = token.trim();
- }
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATIONS, targetSimpleType);
- command.setValue(token);
- compoundCommand.add(command);
- }
- commandStack.execute(compoundCommand);
- }
- //setInput(input);
- facetSection.doSetInput();
- constraintsTableViewer.refresh();
- }
- }
- else if (e.widget == deleteButton)
- {
- StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
- CompoundCommand compoundCommand = new CompoundCommand();
- if (selection != null)
- {
- Iterator i = selection.iterator();
- if (selection.size() > 0)
- {
- compoundCommand.setLabel(Messages._UI_ACTION_DELETE_CONSTRAINTS);
- }
- else
- {
- compoundCommand.setLabel(Messages._UI_ACTION_DELETE_PATTERN);
- }
- while (i.hasNext())
- {
- Object obj = i.next();
- if (obj != null)
- {
- if (obj instanceof XSDPatternFacet)
- {
- UpdateXSDPatternFacetCommand command = new UpdateXSDPatternFacetCommand("", input, UpdateXSDPatternFacetCommand.DELETE); //$NON-NLS-1$
- command.setPatternToEdit((XSDPatternFacet)obj);
- compoundCommand.add(command);
- }
- else if (obj instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) obj;
- DeleteCommand deleteCommand = new DeleteCommand(Messages._UI_ACTION_DELETE_ENUMERATION, enumFacet);
- compoundCommand.add(deleteCommand);
- }
- }
- }
- commandStack.execute(compoundCommand);
- constraintsTableViewer.refresh();
- }
- }
- else if (e.widget == editButton)
- {
- StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
- if (selection != null)
- {
- Object obj = selection.getFirstElement();
- if (obj instanceof XSDPatternFacet)
- {
- XSDPatternFacet pattern = (XSDPatternFacet) obj;
- String initialValue = pattern.getLexicalValue();
- if (initialValue == null)
- {
- initialValue = ""; //$NON-NLS-1$
- }
-
- Shell shell = Display.getCurrent().getActiveShell();
-
- RegexWizard wizard = new RegexWizard(initialValue);
-
- WizardDialog wizardDialog = new WizardDialog(shell, wizard);
- wizardDialog.setBlockOnOpen(true);
- wizardDialog.create();
-
- int result = wizardDialog.open();
-
- if (result == Window.OK)
- {
- String newPattern = wizard.getPattern();
- pattern.setLexicalValue(newPattern);
- constraintsTableViewer.refresh();
- }
- }
- }
- }
-
- setButtonStates(this.kind);
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-
-
- public void setConstraintKind(int kind)
- {
- this.kind = kind;
- setButtonStates(kind);
- constraintsTableViewer.setInput(input);
- constraintsTableViewer.refresh();
- }
-
- public void doModify(Object element, String property, Object value)
- {
- setButtonStates(this.kind);
- if (element instanceof TableItem && (value != null))
- {
- TableItem item = (TableItem) element;
-
- if (item.getData() instanceof XSDPatternFacet)
- {
- XSDPatternFacet patternFacet = (XSDPatternFacet) item.getData();
- patternFacet.setLexicalValue((String) value);
-
- item.setData(patternFacet);
- item.setText((String) value);
- }
- else if (item.getData() instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
- SetXSDFacetValueCommand command = new SetXSDFacetValueCommand(Messages._UI_ACTION_SET_ENUMERATION_VALUE, enumFacet);
- command.setValue((String) value);
- commandStack.execute(command);
- item.setData(enumFacet);
- item.setText((String) value);
- }
- }
- }
-
- public Object doGetValue(Object element, String property)
- {
- if (element instanceof XSDPatternFacet)
- {
- XSDPatternFacet patternFacet = (XSDPatternFacet) element;
- String value = patternFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- else if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
-
- return ""; //$NON-NLS-1$
- }
-
- class ConstraintsTableViewer extends NavigableTableViewer implements ICellModifier
- {
- protected String[] columnProperties = { Messages._UI_LABEL_PATTERN };
-
- protected CellEditor[] cellEditors;
-
- Table table;
-
- public ConstraintsTableViewer(Table table)
- {
- super(table);
- table = getTable();
-
- table.setLinesVisible(true);
-
- setContentProvider(new ConstraintsContentProvider());
- setLabelProvider(new ConstraintsTableLabelProvider());
- setColumnProperties(columnProperties);
-
- setCellModifier(this);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setText(columnProperties[0]);
- column.setAlignment(SWT.LEFT);
- column.setResizable(true);
-
- cellEditors = new CellEditor[1];
-
- TableLayout layout = new TableLayout();
- ColumnWeightData data = new ColumnWeightData(100);
-
- layout.addColumnData(data);
- cellEditors[0] = new TextCellEditor(table);
-
- getTable().setLayout(layout);
- setCellEditors(cellEditors);
- }
-
- public boolean canModify(Object element, String property)
- {
- return true;
- }
-
- public void modify(Object element, String property, Object value)
- {
- doModify(element, property, value);
- }
-
- public Object getValue(Object element, String property)
- {
- return doGetValue(element, property);
- }
-
- }
-
- class ConstraintsContentProvider implements IStructuredContentProvider
- {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public java.lang.Object[] getElements(java.lang.Object inputElement)
- {
- java.util.List list = new ArrayList();
- if (inputElement instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) inputElement;
- boolean isDefined = false;
- Iterator iter;
- if (kind == PATTERN)
- {
- iter = st.getPatternFacets().iterator();
- }
- else
- {
- iter = st.getEnumerationFacets().iterator();
- }
-
- while (iter.hasNext())
- {
- XSDFacet facet = (XSDFacet) iter.next();
- isDefined = (facet.getRootContainer() == facetSection.xsdSchema);
- }
-
- if (kind == PATTERN)
- {
- if (isDefined)
- {
- return st.getPatternFacets().toArray();
- }
- }
- else
- {
- if (isDefined)
- {
- return st.getEnumerationFacets().toArray();
- }
- }
- }
- return list.toArray();
- }
-
- public void dispose()
- {
- }
- }
-
- class ConstraintsTableLabelProvider extends LabelProvider implements ITableLabelProvider
- {
- public ConstraintsTableLabelProvider()
- {
-
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- if (kind == PATTERN)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDSimplePattern.gif"); //$NON-NLS-1$
- }
- else
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif"); //$NON-NLS-1$
- }
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- if (element instanceof XSDPatternFacet)
- {
- XSDPatternFacet pattern = (XSDPatternFacet) element;
- String value = pattern.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- else if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- return ""; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java
deleted file mode 100644
index b31fa6c429..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java
+++ /dev/null
@@ -1,148 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.actions.EditAttributeAction;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDActionManager extends XMLNodeActionManager {
-
- private CommandStack commandStack;
-
- public XSDActionManager(IStructuredModel model, Viewer viewer) {
- super(model, viewer);
- }
-
- public void setCommandStack(CommandStack commandStack) {
- this.commandStack = commandStack;
- }
-
- protected Action createAddCDataSectionAction(Node parent, int index)
- {
- return null;
- }
-
- protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index) {
- return null;
- }
-
-
- protected void contributeAddDocumentChildActions(IMenuManager menu, Document document, int ic, int vc) {
- }
-
- protected void contributeEditGrammarInformationActions(IMenuManager menu, Node node) {
- }
-
- protected void contributePIAndCommentActions(IMenuManager menu, Document document, int index) {
- }
-
- protected void contributePIAndCommentActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
- }
-
- protected void contributeTextNodeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
- super.contributeTextNodeActions(menu, parentElement, parentEd, index);
- }
-
- protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad) {
- Action action = null;
- if (ad == null) {
- action = new EditAttributeAction(this, parent, null, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- action = new AddNodeAction(ad, parent, -1);
- }
-
- WrapperCommand command = new WrapperCommand(action, parent, ad);
- WrapperAction wrapperAction = new WrapperAction(command);
- return wrapperAction;
- }
-
- class WrapperAction extends Action
- {
- WrapperCommand command;
-
- public WrapperAction(WrapperCommand command)
- {
- super();
- this.command = command;
- }
-
- public String getText()
- {
- return command.getAction().getText();
- }
-
- public void run()
- {
- // Some editors may not use a command stack
- if (commandStack != null)
- {
- commandStack.execute(command);
- }
- else
- {
- command.execute();
- }
- }
- }
-
- class WrapperCommand extends Command
- {
- Action action;
- Element parent;
- CMAttributeDeclaration ad;
- public WrapperCommand(Action action, Element parent, CMAttributeDeclaration ad)
- {
- super();
- this.action = action;
- this.parent = parent;
- this.ad = ad;
- }
-
- public String getLabel()
- {
- return action.getText();
- }
-
- public Action getAction()
- {
- return action;
- }
-
- public void execute()
- {
- action.run();
- }
-
- public void undo() {
-
-// ((Element)parent).removeAttribute(ad.getAttrName());
-
- getModel().getUndoManager().undo();
-
- }
-
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java
deleted file mode 100644
index a17ab481c2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDProcessContents;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDAnyElementContentsSection extends MultiplicitySection
-{
- CCombo namespaceCombo;
- CCombo processContentsCombo;
-
- private String[] namespaceComboValues = { "", //$NON-NLS-1$
- "##any", //$NON-NLS-1$
- "##other", //$NON-NLS-1$
- "##targetNamespace", //$NON-NLS-1$
- "##local" //$NON-NLS-1$
- };
-
- /**
- *
- */
- public XSDAnyElementContentsSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ATTRIBUTES_NAMESPACE);
- namespaceLabel.setLayoutData(data);
-
- namespaceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- namespaceCombo.setLayoutData(data);
- namespaceCombo.setItems(namespaceComboValues);
- namespaceCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(namespaceCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ANYELEMENT__NAMESPACE);
-
- CLabel processContentsLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ATTRIBUTES_PROCESSCONTENTS);
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- processContentsLabel.setLayoutData(data);
-
- processContentsCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- processContentsCombo.setLayoutData(data);
- Iterator list = XSDProcessContents.VALUES.iterator();
- processContentsCombo.add(""); //$NON-NLS-1$
- while (list.hasNext())
- {
- processContentsCombo.add(((XSDProcessContents) list.next()).getName());
- }
- processContentsCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(processContentsCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ANYELEMENT__PROCESSCONTENTS);
-
- // ------------------------------------------------------------------
- // min property
- // ------------------------------------------------------------------
-
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- minCombo.setLayoutData(data);
- minCombo.add("0"); //$NON-NLS-1$
- minCombo.add("1"); //$NON-NLS-1$
- applyAllListeners(minCombo);
- minCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(minCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ANYELEMENT__MIN_OCCURENCE);
-
- // ------------------------------------------------------------------
- // max property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- maxCombo.setLayoutData(data);
- maxCombo.add("0"); //$NON-NLS-1$
- maxCombo.add("1"); //$NON-NLS-1$
- maxCombo.add("unbounded"); //$NON-NLS-1$
- applyAllListeners(maxCombo);
- maxCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(maxCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ANYELEMENT__MAX_OCCURENCE);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
- namespaceCombo.setText(""); //$NON-NLS-1$
- processContentsCombo.setText(""); //$NON-NLS-1$
- if (input != null)
- {
- if (input instanceof XSDWildcard)
- {
- XSDWildcard wildcard = (XSDWildcard) input;
- if (wildcard.isSetLexicalNamespaceConstraint())
- {
- namespaceCombo.setText(wildcard.getStringLexicalNamespaceConstraint());
- }
- else
- {
- namespaceCombo.setText("");
- }
- if (wildcard.isSetProcessContents())
- {
- XSDProcessContents pc = wildcard.getProcessContents();
- processContentsCombo.setText(pc.getName());
- }
-
- if (wildcard.eContainer() instanceof XSDParticle)
- {
- minCombo.setEnabled(!isReadOnly);
- maxCombo.setEnabled(!isReadOnly);
- }
- else
- {
- minCombo.setEnabled(false);
- maxCombo.setEnabled(false);
- }
- }
- }
- refreshMinMax();
- setListenerEnabled(true);
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) input;
- if (concreteComponent instanceof XSDWildcard)
- {
- XSDWildcard wildcard = (XSDWildcard) concreteComponent;
- if (e.widget == namespaceCombo)
- {
- String newValue = namespaceCombo.getText();
- boolean removeAttribute = false;
- if (newValue.length() == 0)
- {
- removeAttribute = true;
- }
- // TODO use commands
- // beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"),
- // element); //$NON-NLS-1$
- if (removeAttribute)
- {
- wildcard.unsetLexicalNamespaceConstraint();
- }
- else
- {
- wildcard.setStringLexicalNamespaceConstraint(newValue);
- }
- // endRecording(element);
- }
- else if (e.widget == processContentsCombo)
- {
- String newValue = processContentsCombo.getText();
- boolean removeAttribute = false;
- if (newValue.length() == 0)
- {
- removeAttribute = true;
- }
- // beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"),
- // element); //$NON-NLS-1$
- if (removeAttribute)
- {
- wildcard.unsetProcessContents();
- }
- else
- {
- wildcard.setProcessContents(XSDProcessContents.get(processContentsCombo.getItem(processContentsCombo.getSelectionIndex())));
- }
- // endRecording(element);
- }
- }
- super.doWidgetSelected(e);
- }
-
- public void dispose()
- {
- if (minCombo != null && !minCombo.isDisposed())
- minCombo.removeSelectionListener(this);
- if (maxCombo != null && !maxCombo.isDisposed())
- maxCombo.removeSelectionListener(this);
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java
deleted file mode 100644
index 1ab3e25504..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java
+++ /dev/null
@@ -1,908 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDAttributeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDAttributeDeclarationSection extends RefactoringSection
-{
- protected Text nameText, defaultOrFixedText;
- protected CCombo componentNameCombo, typeCombo, usageCombo, formCombo;
- protected Button defaultButton, fixedButton;
- protected String typeName = "", refName = ""; //$NON-NLS-1$
- boolean isAttributeReference;
-
- public XSDAttributeDeclarationSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- String typeLabel = Messages.UI_LABEL_TYPE; //$NON-NLS-1$
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- nameText.setEnabled(!isAttributeReference);
- applyAllListeners(nameText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__NAME);
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- if (!hideHyperLink)
- {
- createRenameHyperlink(composite);
- setRenameHyperlinkEnabled(!isAttributeReference);
- }
- else
- {
- getWidgetFactory().createCLabel(composite, "");
- }
-
-
- // ------------------------------------------------------------------
- // Ref Label
- // ------------------------------------------------------------------
- if (isAttributeReference)
- {
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel refLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_REFERENCE);
- refLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Ref Combo
- // ------------------------------------------------------------------
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- componentNameCombo.addSelectionListener(this);
- componentNameCombo.addListener(SWT.Traverse, this);
- componentNameCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__NAME);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
- }
-
- // ------------------------------------------------------------------
- // typeLabel
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, typeLabel); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // typeCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- typeCombo = getWidgetFactory().createCCombo(composite);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.addListener(SWT.Traverse, this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(typeCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__TYPE);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // UsageLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel useLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_USAGE"));
- useLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // UsageCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- usageCombo = getWidgetFactory().createCCombo(composite);
- usageCombo.setLayoutData(data);
- usageCombo.addSelectionListener(this);
- usageCombo.add("");
- usageCombo.add("required"); //$NON-NLS-1$
- usageCombo.add("optional"); //$NON-NLS-1$
- usageCombo.add("prohibited"); //$NON-NLS-1$
- usageCombo.addSelectionListener(this);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // defaultLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel defaultLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_VALUE_COLON);
- defaultLabel.setLayoutData(data);
-
- Composite radio = getWidgetFactory().createComposite(composite);
- radio.setLayout(new RowLayout());
-
- defaultButton = new Button(radio, SWT.RADIO);
- defaultButton.setText(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_DEFAULT);
- defaultButton.setBackground(parent.getBackground());
- defaultButton.addSelectionListener(this);
-
- fixedButton = new Button(radio, SWT.RADIO);
- fixedButton.setText(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_FIXED);
- fixedButton.setBackground(parent.getBackground());
- fixedButton.addSelectionListener(this);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // defaultText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- defaultOrFixedText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- defaultOrFixedText.setLayoutData(data);
- applyAllListeners(defaultOrFixedText);
-
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- // XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__DEFAULT);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // FormLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel formLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_FORM);
- formLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // FormCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- formCombo = getWidgetFactory().createCCombo(composite);
- formCombo.setLayoutData(data);
- formCombo.addSelectionListener(this);
- formCombo.add("");
- formCombo.add("qualified"); //$NON-NLS-1$
- formCombo.add("unqualified"); //$NON-NLS-1$
- formCombo.addSelectionListener(this);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
- }
-
- private void fillTypesCombo()
- {
- IEditorPart editor = getActiveEditor();
- XSDTypeReferenceEditManager manager = (XSDTypeReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- if (manager != null)
- {
- ComponentSpecification[] items = manager.getQuickPicks();
-
- typeCombo.removeAll();
- typeCombo.add(Messages._UI_COMBO_BROWSE);
- typeCombo.add(Messages._UI_COMBO_NEW);
- for (int i = 0; i < items.length; i++)
- {
- typeCombo.add(items[i].getName());
- }
-
- XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
- XSDTypeDefinition namedComponentType = namedComponent.getType();
- if (namedComponentType != null)
- {
- String currentTypeName = namedComponentType.getQName(xsdSchema); // no
- // prefix
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(currentTypeName, manager);
- if (ret == null) // not in quickPick
- typeCombo.add(currentTypeName);
- }
- }
- }
-
- private ComponentSpecification getComponentSpecFromQuickPickForValue(String value, ComponentReferenceEditManager editManager)
- {
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value !=null && componentSpecification!=null && value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
-
- setListenerEnabled(false);
-
- // refresh name
-
- nameText.setText(""); //$NON-NLS-1$
- if (input instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
-
- String name = namedComponent.getName();
- if (name != null)
- {
- nameText.setText(name);
- }
- }
-
- if (isAttributeReference)
- {
- refreshRefCombo();
- }
-
- // refresh type
-
- typeCombo.setText(""); //$NON-NLS-1$
- if (input != null)
- {
- if (input instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
- isAttributeReference = ((XSDAttributeDeclaration)input).isAttributeDeclarationReference();
- XSDTypeDefinition typeDef = xsdAttribute.getResolvedAttributeDeclaration().getTypeDefinition();
- boolean isAnonymous = xsdAttribute.getAnonymousTypeDefinition() != null;
-
- if (isAnonymous)
- {
- typeCombo.setText("**anonymous**"); //$NON-NLS-1$
- }
- else
- {
- fillTypesCombo();
- if (typeDef != null)
- {
- typeName = typeDef.getQName(xsdSchema);
- if (typeName == null)
- {
- typeName = ""; //$NON-NLS-1$
- }
- typeCombo.setText(typeName);
- }
- else
- {
- typeCombo.setText(Messages.UI_NO_TYPE); //$NON-NLS-1$
- }
- }
-
- usageCombo.setText("");
- usageCombo.setEnabled(!xsdAttribute.isGlobal());
-
- Element element = xsdAttribute.getElement();
- boolean hasUseAttribute = false;
- if (element != null)
- {
- hasUseAttribute = element.hasAttribute(XSDConstants.USE_ATTRIBUTE);
- if (hasUseAttribute)
- {
- String usage = element.getAttribute(XSDConstants.USE_ATTRIBUTE);
- usageCombo.setText(usage);
- }
- }
-
- defaultOrFixedText.setText(""); //$NON-NLS-1$
-
- boolean hasDefaultAttribute = false, hasFixedAttribute = false;
- if (element != null)
- {
- hasDefaultAttribute = element.hasAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- hasFixedAttribute = element.hasAttribute(XSDConstants.FIXED_ATTRIBUTE);
-
- // Case where no fixed or default attributes exist, so ensure one of the radio buttons is selected
- if (!hasDefaultAttribute && !hasFixedAttribute)
- {
- if (!defaultButton.getSelection() && !fixedButton.getSelection()) // if none are selected then pick fixed
- fixedButton.setSelection(true);
- }
- else
- {
- // if both are present in source (an error!), assume that *fixed* takes "precedence"
- defaultButton.setSelection(!hasFixedAttribute && hasDefaultAttribute);
- fixedButton.setSelection(hasFixedAttribute);
- if (hasDefaultAttribute)
- {
- String theDefault = element.getAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- defaultOrFixedText.setText(theDefault);
- }
- if (hasFixedAttribute) // will overwrite default if both present
- {
- String fixed = element.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
- defaultOrFixedText.setText(fixed);
- }
- }
- }
-
- formCombo.setText("");
- formCombo.setEnabled(!xsdAttribute.isGlobal() && !isAttributeReference);
- boolean hasFormAttribute = false;
- if (element != null)
- {
- hasFormAttribute = element.hasAttribute(XSDConstants.FORM_ATTRIBUTE);
- if (hasFormAttribute)
- {
- String form = element.getAttribute(XSDConstants.FORM_ATTRIBUTE);
- formCombo.setText(form);
- }
- }
- }
- }
-
- setListenerEnabled(true);
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- String selection = typeCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else if (e.widget == componentNameCombo)
- {
- String selection = componentNameCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- String selection = typeCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else if (e.widget == componentNameCombo)
- {
- String selection = componentNameCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- private void handleWidgetSelection(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
-
- String selection = typeCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- ((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- ((NewTypeDialog) dialog).allowComplexType(false);
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- XSDAttributeDeclaration xsdAttribute = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
- manager.modifyComponentReference(xsdAttribute, newValue);
- }
- else{
- typeCombo.setText(typeName);
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else if (e.widget == componentNameCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDAttributeReferenceEditManager.class);
-
- String selection = componentNameCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(input, newValue);
- }
- else
- {
- componentNameCombo.setText(refName);
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else
- {
- XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
- Element element = xsdAttribute.getElement();
- if (e.widget == usageCombo)
- {
- final String newValue = usageCombo.getText();
- if (element != null)
- {
- PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_USAGE)
- {
- protected void doExecuteSteps()
- {
- if (newValue.length() == 0)
- element.removeAttribute(XSDConstants.USE_ATTRIBUTE);
- else
- element.setAttribute(XSDConstants.USE_ATTRIBUTE, newValue);
- }
- };
- getCommandStack().execute(command);
- }
- }
- else if (e.widget == formCombo)
- {
- final String newValue = formCombo.getText();
- if (element != null)
- {
- PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FORM)
- {
- protected void doExecuteSteps()
- {
- if (newValue.length() == 0)
- element.removeAttribute(XSDConstants.FORM_ATTRIBUTE);
- else
- element.setAttribute(XSDConstants.FORM_ATTRIBUTE, newValue);
- }
- };
- getCommandStack().execute(command);
- }
- }
- else if (e.widget == defaultButton)
- {
- boolean newValue = defaultButton.getSelection();
- if (element != null)
- {
- if (newValue)
- {
- if (element.hasAttribute(XSDConstants.FIXED_ATTRIBUTE))
- {
- final String value = element.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-
- PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_DEFAULT)
- {
- protected void doExecuteSteps()
- {
- element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
- element.setAttribute(XSDConstants.DEFAULT_ATTRIBUTE, value);
- }
- };
- getCommandStack().execute(command);
- }
- }
- }
- }
- else if (e.widget == fixedButton)
- {
- boolean newValue = fixedButton.getSelection();
- if (element != null)
- {
- if (newValue)
- {
- if (element.hasAttribute(XSDConstants.DEFAULT_ATTRIBUTE))
- {
- final String value = element.getAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_FIXED)
- {
- protected void doExecuteSteps()
- {
- element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- element.setAttribute(XSDConstants.FIXED_ATTRIBUTE, value);
- }
- };
- getCommandStack().execute(command);
- }
- }
- }
- }
- }
- super.doWidgetSelected(e);
- }
-
- protected void doHandleEvent(Event event)
- {
- if (event.type == SWT.Traverse) {
- if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
- isTraversing = true;
- return;
- }
- }
- super.doHandleEvent(event);
- if (event.widget == nameText)
- {
- if (!nameText.getEditable())
- return;
-
- String newValue = nameText.getText().trim();
- if (input instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
-
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
-
- if (isAttributeReference)
- {
- XSDAttributeDeclaration attrRef = (XSDAttributeDeclaration)input;
- String qname = attrRef.getResolvedAttributeDeclaration().getQName();
- attrRef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, qname);
-
-// TypesHelper helper = new TypesHelper(xsdSchema);
-// List items = new ArrayList();
-// items = helper.getGlobalElements();
-// items.add(0, "");
-// componentNameCombo.setItems((String [])items.toArray(new String[0]));
-//
-// refreshRefCombo();
- }
-
- }
- }
- else if (event.widget == defaultOrFixedText)
- {
- XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
- String newValue = defaultOrFixedText.getText();
- Element element = xsdAttribute.getElement();
- if (element != null)
- {
- if (newValue.length() == 0)
- {
- PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_VALUE)
- {
- protected void doExecuteSteps()
- {
- element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
- element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- }
- };
- getCommandStack().execute(command);
- }
- else
- {
- UpdateAttributeValueCommand command = null;
- if (fixedButton.getSelection())
- {
- command = new UpdateAttributeValueCommand(element, XSDConstants.FIXED_ATTRIBUTE, newValue, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_FIXED)
- {
- protected void doPostProcessing()
- {
- element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
- }
- };
- }
- else
- {
- command = new UpdateAttributeValueCommand(element, XSDConstants.DEFAULT_ATTRIBUTE, newValue, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_DEFAULT)
- {
- protected void doPostProcessing()
- {
- element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
- }
- };
- }
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void dispose()
- {
- if (componentNameCombo != null && !componentNameCombo.isDisposed())
- {
- componentNameCombo.removeSelectionListener(this);
- componentNameCombo.removeListener(SWT.Traverse, this);
- }
- if (nameText != null && !nameText.isDisposed())
- removeListeners(nameText);
- if (typeCombo != null && !typeCombo.isDisposed())
- {
- typeCombo.removeSelectionListener(this);
- typeCombo.removeListener(SWT.Traverse, this);
- }
- super.dispose();
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- setListenerEnabled(false);
- init();
- relayout();
-
- setListenerEnabled(true);
- }
-
- protected void init()
- {
- if (input instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
- isAttributeReference = xsdAttribute.isAttributeDeclarationReference();
- hideHyperLink = !xsdAttribute.isGlobal() || isAttributeReference;
- }
- }
-
- protected void relayout()
- {
- Composite parentComposite = composite.getParent();
- parentComposite.getParent().setRedraw(false);
-
- if (parentComposite != null && !parentComposite.isDisposed())
- {
- Control[] children = parentComposite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
-
- // Now initialize the new handler
- createContents(parentComposite);
- parentComposite.getParent().layout(true, true);
-
- // Now turn painting back on
- parentComposite.getParent().setRedraw(true);
- refresh();
- }
-
- protected void refreshRefCombo()
- {
- componentNameCombo.setText(""); //$NON-NLS-1$
- fillComponentNameCombo();
- }
-
- private void fillComponentNameCombo()
- {
- IEditorPart editor = getActiveEditor();
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDAttributeReferenceEditManager.class);
-
- componentNameCombo.removeAll();
- componentNameCombo.add(Messages._UI_ACTION_BROWSE);
- componentNameCombo.add(Messages._UI_ACTION_NEW);
- ComponentSpecification[] quickPicks = manager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- componentNameCombo.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = manager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- componentNameCombo.add(componentSpecification.getName());
- }
- }
-
- XSDAttributeDeclaration namedComponent = (XSDAttributeDeclaration) input;
- Element element = namedComponent.getElement();
- if (element != null)
- {
- String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
- if (attrValue == null)
- {
- attrValue = ""; //$NON-NLS-1$
- }
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(attrValue, manager);
- if (ret == null)
- {
- componentNameCombo.add(attrValue);
- }
- componentNameCombo.setText(attrValue);
- refName = attrValue;
- }
- }
-
- protected class PropertiesChangeCommand extends BaseCommand
- {
- protected Element element;
- public PropertiesChangeCommand(Element element, String label)
- {
- super(NLS.bind(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_CHANGE, label));
- this.element = element;
- }
-
- public void execute()
- {
- try
- {
- beginRecording(element);
- doExecuteSteps();
- }
- finally
- {
- endRecording();
- }
- }
-
- protected void doExecuteSteps()
- {
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java
deleted file mode 100644
index 8a409f0d03..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-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.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDAttributeGroupDefinitionSection extends RefactoringSection
-{
- protected Text nameText;
- protected CCombo refCombo;
- boolean isReference;
-
- public XSDAttributeGroupDefinitionSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- if (isReference)
- {
- // ------------------------------------------------------------------
- // Ref Label
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":"); //$NON-NLS-1$
- refLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Ref Combo
- // ------------------------------------------------------------------
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- refCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- refCombo.addSelectionListener(this);
- refCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(refCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTEGROUP_REFS__REF);
- }
- else
- {
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- applyAllListeners(nameText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTEGROUP__NAME);
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- if (!hideHyperLink)
- {
- createRenameHyperlink(composite);
- setRenameHyperlinkEnabled(!isReference);
- }
- else
- {
- getWidgetFactory().createCLabel(composite, "");
- }
- }
- }
-
- public void refresh()
- {
- super.refresh();
-
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
-
- setListenerEnabled(false);
-
- XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-
- if (isReference)
- {
- Element element = namedComponent.getElement();
- if (element != null)
- {
- String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
- if (attrValue == null)
- {
- attrValue = ""; //$NON-NLS-1$
- }
- refCombo.setText(attrValue);
- }
- }
- else
- {
- // refresh name
- nameText.setText(""); //$NON-NLS-1$
-
- String name = namedComponent.getName();
- if (name != null)
- {
- nameText.setText(name);
- }
- }
- setListenerEnabled(true);
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- init();
- relayout();
-
- if (isReference)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- List items = new ArrayList();
- items = helper.getGlobalAttributeGroups();
- items.add(0, ""); //$NON-NLS-1$
- refCombo.setItems((String [])items.toArray(new String[0]));
- }
- }
-
- protected void relayout()
- {
- Composite parentComposite = composite.getParent();
- parentComposite.getParent().setRedraw(false);
-
- if (parentComposite != null && !parentComposite.isDisposed())
- {
- Control[] children = parentComposite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
-
- // Now initialize the new handler
- createContents(parentComposite);
- parentComposite.getParent().layout(true, true);
-
- // Now turn painting back on
- parentComposite.getParent().setRedraw(true);
- refresh();
- }
-
- protected void init()
- {
- if (input instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition group = (XSDAttributeGroupDefinition) input;
- isReference = group.isAttributeGroupDefinitionReference();
- hideHyperLink = isReference;
- }
- }
-
- public void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- if (event.widget == nameText)
- {
- String newValue = nameText.getText().trim();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) input;
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
- // doReferentialIntegrityCheck(namedComponent, newValue);
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == refCombo)
- {
- String newValue = refCombo.getText();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent)input;
- Element element = namedComponent.getElement();
-
- if (namedComponent instanceof XSDAttributeGroupDefinition)
- {
- element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
- XSDDirectivesManager.removeUnusedXSDImports(namedComponent.getSchema());
- }
- }
- }
- super.doWidgetSelected(e);
- }
-
-
- public void dispose()
- {
- if (nameText != null && !nameText.isDisposed())
- removeListeners(nameText);
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java
deleted file mode 100644
index 4c4f99d749..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeAdvancedSection extends AbstractSection
-{
- private static final String EMPTY = ""; //$NON-NLS-1$
- private static final String FALSE = "false"; //$NON-NLS-1$
- private static final String TRUE = "true"; //$NON-NLS-1$
- protected CCombo blockCombo;
- protected CCombo finalCombo;
- protected CCombo mixedCombo;
- protected CCombo abstractCombo;
-
- private String finalValues[] = { EMPTY, XSDConstants.RESTRICTION_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG, "#" + XSDConstants.ALL_ELEMENT_TAG }; //$NON-NLS-1$
-
- private String blockValues[] = { EMPTY, XSDConstants.RESTRICTION_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG, "#" + XSDConstants.ALL_ELEMENT_TAG }; //$NON-NLS-1$
-
- private String booleanValues[] = { EMPTY, TRUE, FALSE }; // TODO use some
- // external string
- // here instead
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // AbstractLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel abstractLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ABSTRACT);
- abstractLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // AbstractCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- abstractCombo = getWidgetFactory().createCCombo(composite);
- abstractCombo.setLayoutData(data);
- abstractCombo.setEditable(false);
-
- abstractCombo.setItems(booleanValues);
- abstractCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // BlockLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel blockLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_BLOCK);
- blockLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // BlockCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- blockCombo = getWidgetFactory().createCCombo(composite);
- blockCombo.setLayoutData(data);
- blockCombo.setEditable(false);
-
- blockCombo.setItems(blockValues);
- blockCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // FinalLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel finalLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_FINAL);
- finalLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // FinalCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- finalCombo = getWidgetFactory().createCCombo(composite);
- finalCombo.setLayoutData(data);
- finalCombo.setEditable(false);
-
- finalCombo.setItems(finalValues);
- finalCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // Mixed Label
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel mixedLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_MIXED);
- mixedLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Mixed Combo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- mixedCombo = getWidgetFactory().createCCombo(composite);
- mixedCombo.setLayoutData(data);
- mixedCombo.setEditable(false);
-
- mixedCombo.setItems(booleanValues);
- mixedCombo.addSelectionListener(this);
-
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
- if (e.widget == blockCombo)
- {
- String value = blockCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.BLOCK_ATTRIBUTE, value, Messages._UI_LABEL_BLOCK);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == finalCombo)
- {
- String value = finalCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, Messages._UI_LABEL_FINAL);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == abstractCombo)
- {
- String value = abstractCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.ABSTRACT_ATTRIBUTE, value, Messages._UI_LABEL_ABSTRACT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == mixedCombo)
- {
- String value = mixedCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.MIXED_ATTRIBUTE, value, Messages._UI_LABEL_MIXED);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
-
- public void refresh()
- {
- super.refresh();
-
- setListenerEnabled(false);
- try
- {
- if (input instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
-
- boolean enabled = true;
- if (complexType.getContainer() instanceof XSDSchema)
- {
- enabled = !isReadOnly;
- }
- else
- {
- enabled = false;
- }
-
- if (complexType.getElement().hasAttribute(XSDConstants.BLOCK_ATTRIBUTE))
- {
- String blockAttValue = complexType.getElement().getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
- blockCombo.setText(blockAttValue);
- }
- else
- {
- blockCombo.setText(EMPTY);
- }
- blockCombo.setEnabled(enabled);
-
- if (complexType.getElement().hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
- {
- String finalAttValue = complexType.getElement().getAttribute(XSDConstants.FINAL_ATTRIBUTE);
- finalCombo.setText(finalAttValue);
- }
- else
- {
- finalCombo.setText(EMPTY);
- }
- finalCombo.setEnabled(enabled);
-
- if (complexType.getElement().hasAttribute(XSDConstants.ABSTRACT_ATTRIBUTE))
- {
- boolean absAttValue = complexType.isAbstract();
- if (absAttValue)
- abstractCombo.setText(TRUE);
- else
- abstractCombo.setText(FALSE);
- }
- else
- {
- abstractCombo.setText(EMPTY);
- }
- abstractCombo.setEnabled(enabled);
-
- if (complexType.getElement().hasAttribute(XSDConstants.MIXED_ATTRIBUTE))
- {
- boolean mixedValue = complexType.isMixed();
- if (mixedValue)
- mixedCombo.setText(TRUE);
- else
- mixedCombo.setText(FALSE);
- }
- else
- {
- mixedCombo.setText(EMPTY);
- }
-
- }
- }
- catch (Exception e)
- {
- }
- setListenerEnabled(true);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java
deleted file mode 100644
index ce8fecb970..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-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.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateComplexTypeDerivationBy;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDDerivationMethod;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeSection extends RefactoringSection implements SelectionListener
-{
- protected Text nameText;
- protected CCombo baseTypeCombo;
- protected CCombo derivedByCombo;
- private String derivedByChoicesComboValues[] = { "", XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.EXTENSION_ELEMENT_TAG }; //$NON-NLS-1$
-
- public XSDComplexTypeSection()
- {
- super();
- }
-
- /**
- * Contents of the property tab
- *
- * NameLabel NameText DummyLabel BaseTypeLabel BaseTypeCombo BaseTypeButton
- * DerivedByLabel DerivedByCombo
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- applyAllListeners(nameText);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__COMPLEX_TYPE__NAME);
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- createRenameHyperlink(composite);
-
- // ------------------------------------------------------------------
- // BaseTypeLabel
- // ------------------------------------------------------------------
-
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_INHERIT_FROM); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // BaseTypeCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- baseTypeCombo = getWidgetFactory().createCCombo(composite);
- baseTypeCombo.setEditable(false);
- baseTypeCombo.setLayoutData(data);
- baseTypeCombo.addSelectionListener(this);
- baseTypeCombo.addListener(SWT.Traverse, this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(baseTypeCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__COMPLEX_TYPE__INHERIT_FROM);
-
-
- // ------------------------------------------------------------------
- // Spacer label
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, "");
-
- // ------------------------------------------------------------------
- // DerivedByLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel derivedByLabel = getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_INHERIT_BY); //$NON-NLS-1$
- derivedByLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // DerivedByCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- derivedByCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- derivedByCombo.setLayoutData(data);
- derivedByCombo.setItems(derivedByChoicesComboValues);
- derivedByCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(derivedByCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__COMPLEX_TYPE__INHERIT_BY);
-
- // ------------------------------------------------------------------
- // Spacer label
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, "");
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- if (Display.getCurrent() == null)
- return;
-
- setListenerEnabled(false);
- showLink(!hideHyperLink);
-
- try
- {
- nameText.setText(""); //$NON-NLS-1$
- baseTypeCombo.setText(""); //$NON-NLS-1$
- fillTypesCombo();
-
- if (input instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
- String name = complexType.getName();
- if (name == null)
- name = ""; //$NON-NLS-1$
-
- boolean isAnonymousType = name.equals("") ? true : false; //$NON-NLS-1$
- if (isAnonymousType)
- {
- nameText.setText("**anonymous**"); //$NON-NLS-1$
- nameText.setEditable(false);
- }
- else
- {
- nameText.setText(name);
- nameText.setEditable(true);
- }
-
- XSDTypeDefinition baseTypeDefinition = complexType.getBaseTypeDefinition();
- String baseType = ""; //$NON-NLS-1$
- if (baseTypeDefinition != null)
- {
- baseType = baseTypeDefinition.getName();
- if (baseType == null)
- {
- baseType = ""; //$NON-NLS-1$
- }
- else if (baseType.equals("anyType"))
- {
- baseType = ""; //$NON-NLS-1$
- }
- }
- baseTypeCombo.setText(baseType);
-
- derivedByCombo.setText(""); //$NON-NLS-1$
- int derivationMethod = complexType.getDerivationMethod().getValue();
- XSDDOMHelper domHelper = new XSDDOMHelper();
- if(domHelper.getDerivedByElementFromComplexType(complexType.getElement()) != null) {
- if (derivationMethod == XSDDerivationMethod.EXTENSION)
- {
- derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
- }
- else if (derivationMethod == XSDDerivationMethod.RESTRICTION)
- {
- derivedByCombo.setText(XSDConstants.RESTRICTION_ELEMENT_TAG);
- }
- }
- }
-
- }
- finally
- {
- setListenerEnabled(true);
- }
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {
- if (e.widget == baseTypeCombo)
- {
- String selection = baseTypeCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == baseTypeCombo)
- {
- String selection = baseTypeCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- private void handleWidgetSelection(SelectionEvent e)
- {
- if (e.widget == baseTypeCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);
-
- String selection = baseTypeCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(input, newValue);
- }
- else
- {
- refresh();
- }
- }
- }
- else if (e.widget == derivedByCombo)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
- String value = derivedByCombo.getText();
- Command command = new UpdateComplexTypeDerivationBy(complexType, value);
-
- if (getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
- }
- super.doWidgetSelected(e);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void dispose()
- {
- super.dispose();
- if (baseTypeCombo != null && !baseTypeCombo.isDisposed())
- baseTypeCombo.removeListener(SWT.Traverse, this);
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.type == SWT.Traverse) {
- if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
- isTraversing = true;
- return;
- }
- }
- super.doHandleEvent(event);
- if (event.widget == nameText)
- {
- if (!nameText.getEditable())
- return;
-
- String newValue = nameText.getText().trim();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) input;
-
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
- // doReferentialIntegrityCheck(namedComponent, newValue);
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- setListenerEnabled(false);
- if (input instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
- hideHyperLink = !(complexType.getContainer() instanceof XSDSchema);
-
- }
-
- setListenerEnabled(true);
- }
-
- private void fillTypesCombo()
- {
- baseTypeCombo.removeAll();
- baseTypeCombo.add(Messages._UI_COMBO_BROWSE);
- baseTypeCombo.add(Messages._UI_COMBO_NEW);
- // Add the current Type of this attribute if needed
- XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
- XSDTypeDefinition baseType = complexType.getBaseType();
- if (baseType != null && baseType.getQName() != null)
- {
- String currentTypeName = baseType.getQName(xsdSchema); //no prefix
- if (currentTypeName != null && !currentTypeName.equals("anyType"))
- baseTypeCombo.add(currentTypeName);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java
deleted file mode 100644
index 56c6aa98ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Carver - STAR - added nillable advanced tab option, bug 209356
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDSubstitutionGroupEditManager;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationAdvancedSection extends AbstractSection
-{
- private static final String EMPTY = ""; //$NON-NLS-1$
- private static final String FALSE = "false"; //$NON-NLS-1$
- private static final String TRUE = "true"; //$NON-NLS-1$
- protected CCombo blockCombo;
- protected CCombo finalCombo;
- protected CCombo abstractCombo;
- protected CCombo substGroupCombo;
- protected CCombo nillableCombo;
-
- private String blockValues[] = { EMPTY, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG,
- "substitution" }; //$NON-NLS-1$
-
- private String finalValues[] = { EMPTY, "#" + XSDConstants.ALL_ELEMENT_TAG, XSDConstants.EXTENSION_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.RESTRICTION_ELEMENT_TAG }; //$NON-NLS-1$
-
- private String booleanValues[] = { EMPTY, TRUE, FALSE };
-
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // AbstractLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel abstractLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_ABSTRACT);
- abstractLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // AbstractCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- abstractCombo = getWidgetFactory().createCCombo(composite);
- abstractCombo.setLayoutData(data);
- abstractCombo.setEditable(false);
-
- abstractCombo.setItems(booleanValues);
- abstractCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // BlockLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel blockLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_BLOCK);
- blockLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // BlockCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- blockCombo = getWidgetFactory().createCCombo(composite);
- blockCombo.setLayoutData(data);
- blockCombo.setEditable(false);
-
- blockCombo.setItems(blockValues);
- blockCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // FinalLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel finalLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FINAL);
- finalLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // FinalCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- finalCombo = getWidgetFactory().createCCombo(composite);
- finalCombo.setLayoutData(data);
- finalCombo.setEditable(false);
-
- finalCombo.setItems(finalValues);
- finalCombo.addSelectionListener(this);
-
- // ------------------------------------------------------------------
- // Substitution Group Label
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel subGroupLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
- subGroupLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Substitution Group Combo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- substGroupCombo = getWidgetFactory().createCCombo(composite);
- substGroupCombo.setLayoutData(data);
- substGroupCombo.setEditable(true);
- substGroupCombo.addSelectionListener(this);
- substGroupCombo.addListener(SWT.Traverse, this);
- applyAllListeners(substGroupCombo);
-
- // ------------------------------------------------------------------
- // Nillable Label
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel nillableLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NILLABLE);
- nillableLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NillableCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nillableCombo = getWidgetFactory().createCCombo(composite);
- nillableCombo.setLayoutData(data);
- nillableCombo.setEditable(false);
-
- nillableCombo.setItems(booleanValues);
- nillableCombo.addSelectionListener(this);
-
- }
-
- public void doHandleEvent(Event e)
- {
- if (e.widget == substGroupCombo)
- {
- if (e.type == SWT.Traverse) {
- if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_ARROW_PREVIOUS)
- {
- isTraversing = true;
- return;
- }
- }
-
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
- String value = substGroupCombo.getText();
- String oldValue = eleDec.getElement().getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE);
- if (oldValue == null)
- oldValue = EMPTY;
- if (value.equals(oldValue))
- return;
-
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(eleDec.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, value, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {
- if (e.widget == substGroupCombo)
- {
- String selection = substGroupCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == substGroupCombo)
- {
- String selection = substGroupCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- private void handleWidgetSelection(SelectionEvent e)
- {
- if (e.widget == blockCombo)
- {
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
- String value = blockCombo.getText();
-
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(eleDec.getElement(), XSDConstants.BLOCK_ATTRIBUTE, value, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_BLOCK);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == finalCombo)
- {
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
- String value = finalCombo.getText();
-
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(eleDec.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FINAL);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == abstractCombo)
- {
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
- String value = abstractCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(eleDec.getElement(), XSDConstants.ABSTRACT_ATTRIBUTE, value, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_ABSTRACT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- else if (e.widget == substGroupCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDSubstitutionGroupEditManager.class);
-
- String selection = substGroupCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(input, newValue);
- }
- else
- {
- substGroupCombo.setText("");
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else if (e.widget == nillableCombo)
- {
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
- String value = nillableCombo.getText();
-
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(eleDec.getElement(), XSDConstants.NILLABLE_ATTRIBUTE, value, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NILLABLE);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
-
- public void refresh()
- {
- super.refresh();
- fillSubstitutionGroupCombo();
- setListenerEnabled(false);
- try
- {
- if (input instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
-
- composite.setEnabled(!isReadOnly);
- if (eleDec.getContainer() instanceof XSDSchema) // global element
- {
- abstractCombo.setEnabled(true);
- finalCombo.setEnabled(true);
- substGroupCombo.setEnabled(true);
- nillableCombo.setEnabled(true);
- }
- else
- {
- abstractCombo.setEnabled(false);
- finalCombo.setEnabled(false);
- substGroupCombo.setEnabled(false);
-
- // Nillable when used in a local element declaration can't be set on
- // on elements that use @ref.
- nillableCombo.setEnabled(!eleDec.isElementDeclarationReference());
- }
-
- Element element = eleDec.getElement();
-
- if (element.hasAttribute(XSDConstants.BLOCK_ATTRIBUTE))
- {
- String blockAttValue = element.getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
- blockCombo.setText(blockAttValue);
- }
- else
- {
- blockCombo.setText(EMPTY);
- }
- // We should show the value of the attribute regardless if it is invalid
- // ie. as the user starts typing 'true' in the source, the properties view
- // should show the value dynamically
- if (element.hasAttribute(XSDConstants.NILLABLE_ATTRIBUTE))
- {
- String attrValue = element.getAttribute(XSDConstants.NILLABLE_ATTRIBUTE);
- nillableCombo.setText(attrValue);
- }
- else
- {
- nillableCombo.setText(EMPTY);
- }
-
- if (element.hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
- {
- String finalAttValue = element.getAttribute(XSDConstants.FINAL_ATTRIBUTE);
- finalCombo.setText(finalAttValue);
- }
- else
- {
- finalCombo.setText(EMPTY);
- }
-
- if (element.hasAttribute(XSDConstants.ABSTRACT_ATTRIBUTE))
- {
- abstractCombo.setText(element.getAttribute(XSDConstants.ABSTRACT_ATTRIBUTE));
- }
- else
- abstractCombo.setText(EMPTY);
-
- if (element.hasAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
- {
- substGroupCombo.setText(element.getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE));
- }
- else
- {
- substGroupCombo.setText(EMPTY);
- }
- }
- }
- catch (Exception e)
- {
- }
- setListenerEnabled(true);
- }
-
- private void fillSubstitutionGroupCombo()
- {
- IEditorPart editor = getActiveEditor();
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDSubstitutionGroupEditManager.class);
- if (manager != null)
- {
- ComponentSpecification[] items = manager.getQuickPicks();
-
- substGroupCombo.removeAll();
- substGroupCombo.add(Messages._UI_COMBO_BROWSE);
- substGroupCombo.add(Messages._UI_COMBO_NEW);
- for (int i = 0; i < items.length; i++)
- {
- substGroupCombo.add(items[i].getName());
- }
- // Add the current substitution group if needed
- XSDElementDeclaration namedComponent = ((XSDElementDeclaration) input).getSubstitutionGroupAffiliation();
- if (namedComponent != null)
- {
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(namedComponent.getName(), manager);
- if (ret == null)
- {
- substGroupCombo.add(namedComponent.getQName(xsdSchema));
- }
- }
- }
- }
-
- private ComponentSpecification getComponentSpecFromQuickPickForValue(String value, ComponentReferenceEditManager editManager)
- {
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value != null && value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- public void dispose()
- {
- if (substGroupCombo != null && !substGroupCombo.isDisposed())
- {
- substGroupCombo.removeListener(SWT.Traverse, this);
- }
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java
deleted file mode 100644
index 41223f0c27..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-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.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationSection extends MultiplicitySection
-{
- protected Text nameText;
- protected CCombo typeCombo;
- protected CCombo componentNameCombo;
- boolean isElementReference;
- protected String typeName = ""; //$NON-NLS-1$
-
- private XSDTypeDefinition typeDefinition;
-
- public XSDElementDeclarationSection()
- {
- super();
- }
-
- /**
- * Contents of the property tab
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-
- String typeLabel = Messages.UI_LABEL_TYPE; //$NON-NLS-1$
-
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
-
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = factory.createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- nameText.setEnabled(!isElementReference);
- applyAllListeners(nameText);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__NAME);
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- if (!hideHyperLink)
- {
- createRenameHyperlink(composite);
- setRenameHyperlinkEnabled(!isElementReference);
- }
- else
- {
- getWidgetFactory().createCLabel(composite, "");
- }
-
- // ------------------------------------------------------------------
- // Ref Label
- // ------------------------------------------------------------------
- if (isElementReference)
- {
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel refLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_REFERENCE);
- refLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Ref Combo
- // ------------------------------------------------------------------
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- componentNameCombo.addSelectionListener(this);
- componentNameCombo.addListener(SWT.Traverse, this);
- componentNameCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__REFERENCE);
-
- // dummy
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
- }
-
- // ------------------------------------------------------------------
- // typeLabel
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, typeLabel);
-
- // ------------------------------------------------------------------
- // typeCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- typeCombo = getWidgetFactory().createCCombo(composite); //$NON-NLS-1$
- typeCombo.setEditable(false);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.addListener(SWT.Traverse, this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(typeCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__TYPE);
-
- // ------------------------------------------------------------------
- // DummyLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // min property
- // ------------------------------------------------------------------
-
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- minCombo.setLayoutData(data);
- minCombo.add("0"); //$NON-NLS-1$
- minCombo.add("1"); //$NON-NLS-1$
- applyAllListeners(minCombo);
- minCombo.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(minCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__MIN_OCCURENCE);
-
- // ------------------------------------------------------------------
- // DummyLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // max property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- maxCombo.setLayoutData(data);
- maxCombo.add("0"); //$NON-NLS-1$
- maxCombo.add("1"); //$NON-NLS-1$
- maxCombo.add("unbounded"); //$NON-NLS-1$
- applyAllListeners(maxCombo);
- maxCombo.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(maxCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__MAX_OCCURENCE);
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- setListenerEnabled(false);
- init();
- relayout();
-
- setListenerEnabled(true);
- }
-
- protected void init()
- {
- if (input instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) input;
- isElementReference = xsdElementDeclaration.isElementDeclarationReference();
-
- hideHyperLink = !xsdElementDeclaration.isGlobal() || isElementReference;
- typeDefinition = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
- }
- }
-
- private void fillTypesCombo()
- {
- IEditorPart editor = getActiveEditor();
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- if (manager != null)
- {
- ComponentSpecification[] items = manager.getQuickPicks();
-
- typeCombo.removeAll();
- typeCombo.add(Messages._UI_COMBO_BROWSE);
- typeCombo.add(Messages._UI_COMBO_NEW);
- for (int i = 0; i < items.length; i++)
- {
- typeCombo.add(items[i].getName());
- }
- // Add the current Type of this element if needed
- XSDElementDeclaration namedComponent = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
- XSDTypeDefinition td = namedComponent.getType();
- if (td != null)
- {
- String currentTypeName = td.getQName(xsdSchema);
- if (currentTypeName == null) // anonymous type
- currentTypeName = "**Anonymous**";
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(currentTypeName, manager);
- if (ret == null && currentTypeName != null) // not in quickPick
- {
- typeCombo.add(currentTypeName);
- }
- }
- }
- }
-
- private ComponentSpecification getComponentSpecFromQuickPickForValue(String value, ComponentReferenceEditManager editManager)
- {
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value != null && value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
-
- super.refresh();
-
- XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
-
- // refresh name
- nameText.setText(""); //$NON-NLS-1$
- typeCombo.setText(""); //$NON-NLS-1$
- String name = xsdElementDeclaration.getName();
- if (name != null)
- {
- nameText.setText(name);
- }
-
- if (isElementReference)
- {
- refreshRefCombo();
- }
-
- // refresh type
- if (input != null)
- {
- if (input instanceof XSDElementDeclaration)
- {
- boolean isAnonymous = xsdElementDeclaration.getAnonymousTypeDefinition() != null;
- //XSDTypeDefinition typeDef = XSDUtils.getResolvedType(xsdElementDeclaration);
- XSDTypeDefinition typeDef = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-
- if (typeDef != null)
- typeName = typeDef.getQName(xsdSchema);
-
- if (typeName == null)
- {
- typeName = ""; //$NON-NLS-1$
- }
-
- fillTypesCombo();
- if (isAnonymous)
- {
- typeCombo.setText("**Anonymous**");
- typeName = "**Anonymous**";
- }
- else
- {
- if (typeDefinition != null)
- {
- typeCombo.setText(typeName);
- }
- else
- {
- typeCombo.setText(Messages.UI_NO_TYPE); //$NON-NLS-1$
- }
- }
-
- maxCombo.setEnabled(!xsdElementDeclaration.isGlobal() || isElementReference);
- minCombo.setEnabled(!xsdElementDeclaration.isGlobal() || isElementReference);
- }
- }
-
- // refresh min max
- refreshMinMax();
-
- setListenerEnabled(true);
-
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- String selection = typeCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else if (e.widget == componentNameCombo)
- {
- String selection = componentNameCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- String selection = typeCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else if (e.widget == componentNameCombo)
- {
- String selection = componentNameCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- private void handleWidgetSelection(SelectionEvent e)
- {
- if (e.widget == typeCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- String selection = typeCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- ((XSDSearchListDialogDelegate) dialog).showComplexTypes(true);
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- ((NewTypeDialog) dialog).allowComplexType(true);
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- XSDElementDeclaration elementDeclaration = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
- manager.modifyComponentReference(elementDeclaration, newValue);
- }
- else
- {
- typeCombo.setText(typeName );
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else if (e.widget == componentNameCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
-
- String selection = componentNameCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(input, newValue);
- }
- else
- {
- componentNameCombo.setText("");
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else if (e.widget == maxCombo)
- {
- updateMaxAttribute();
- }
- else if (e.widget == minCombo)
- {
- updateMinAttribute();
- }
- }
-
- protected void relayout()
- {
- Composite parentComposite = composite.getParent();
- parentComposite.getParent().setRedraw(false);
-
- if (parentComposite != null && !parentComposite.isDisposed())
- {
- Control[] children = parentComposite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
-
- // Now initialize the new handler
- createContents(parentComposite);
- parentComposite.getParent().layout(true, true);
-
- // Now turn painting back on
- parentComposite.getParent().setRedraw(true);
- refresh();
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.type == SWT.Traverse) {
- if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
- isTraversing = true;
- return;
- }
- }
- super.doHandleEvent(event);
- if (event.widget == nameText)
- {
- String newValue = nameText.getText().trim();
- if (input instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration namedComponent = ((XSDElementDeclaration) input).getResolvedElementDeclaration();
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
-
- // doReferentialIntegrityCheck(namedComponent, newValue);
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void dispose()
- {
- if (componentNameCombo != null && !componentNameCombo.isDisposed())
- {
- componentNameCombo.removeSelectionListener(this);
- componentNameCombo.removeListener(SWT.Traverse, this);
- }
- if (minCombo != null && !minCombo.isDisposed())
- minCombo.removeSelectionListener(this);
- if (maxCombo != null && !maxCombo.isDisposed())
- maxCombo.removeSelectionListener(this);
- if (typeCombo != null && !typeCombo.isDisposed())
- {
- typeCombo.removeSelectionListener(this);
- typeCombo.removeListener(SWT.Traverse, this);
- }
- if (nameText != null && !nameText.isDisposed())
- removeListeners(nameText);
- super.dispose();
- }
-
- protected void refreshRefCombo()
- {
- componentNameCombo.setText(""); //$NON-NLS-1$
- fillElementsCombo();
- }
-
- private void fillElementsCombo()
- {
- IEditorPart editor = getActiveEditor();
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
- if (manager != null)
- {
- componentNameCombo.removeAll();
- componentNameCombo.add(Messages._UI_COMBO_BROWSE);
- componentNameCombo.add(Messages._UI_COMBO_NEW);
- ComponentSpecification[] quickPicks = manager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i = 0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- componentNameCombo.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = manager.getHistory();
- if (history != null)
- {
- for (int i = 0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- componentNameCombo.add(componentSpecification.getName());
- }
- }
- }
- XSDElementDeclaration namedComponent = (XSDElementDeclaration) input;
- Element element = namedComponent.getElement();
-
- if (element != null)
- {
- String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
- if (attrValue == null)
- {
- attrValue = ""; //$NON-NLS-1$
- }
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(attrValue, manager);
- if (ret == null)
- {
- componentNameCombo.add(attrValue);
- }
- componentNameCombo.setText(attrValue);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java
deleted file mode 100644
index ab1b0061fd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java
+++ /dev/null
@@ -1,129 +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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDEnumerationFacet;
-
-public class XSDEnumerationFacetSection extends AbstractSection
-{
- CCombo finalCombo;
- Text valueText;
-
- public XSDEnumerationFacetSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // ValueLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel valueLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_VALUE);
- valueLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // ValueText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- valueText.setLayoutData(data);
- applyAllListeners(valueText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(valueText,
- XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__NAME);
-
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- }
-
- public void refresh()
- {
- super.refresh();
-
- setListenerEnabled(false);
-
- valueText.setText(""); //$NON-NLS-1$
-
- if (input instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet)input;
-
- if(xsdEnumeration != null)
- {
- valueText.setText(xsdEnumeration.getLexicalValue());
- }
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == valueText)
- {
- if (!valueText.getEditable())
- return;
-
- String value = valueText.getText();
-
- if (input instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet)input;
-
- Command command = null;
- command = new SetXSDFacetValueCommand(Messages._UI_ACTION_CHANGE_ENUMERATION_VALUE,
- xsdEnumeration, value);
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- valueText.setText(value);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java
deleted file mode 100644
index e0d0df400b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-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.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ChangeToLocalSimpleTypeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNumericBoundsFacetCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateStringLengthFacetCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateXSDWhiteSpaceFacetCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDLengthFacet;
-import org.eclipse.xsd.XSDMaxExclusiveFacet;
-import org.eclipse.xsd.XSDMaxFacet;
-import org.eclipse.xsd.XSDMaxInclusiveFacet;
-import org.eclipse.xsd.XSDMaxLengthFacet;
-import org.eclipse.xsd.XSDMinExclusiveFacet;
-import org.eclipse.xsd.XSDMinFacet;
-import org.eclipse.xsd.XSDMinInclusiveFacet;
-import org.eclipse.xsd.XSDMinLengthFacet;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.XSDWhiteSpace;
-import org.eclipse.xsd.XSDWhiteSpaceFacet;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDFacetSection extends AbstractSection
-{
- private String minLengthString, maxLengthString, titleString;
- Font titleFont;
- CLabel title;
- Label minLengthLabel;
- Text minLengthText;
- Label maxLengthLabel;
- Text maxLengthText;
- Group simpleTypeModifierGroup;
- String simpleTypeModifierGroupTitle = ""; //$NON-NLS-1$
- Button collapseWhitespaceButton;
- Button useEnumerationsButton, usePatternsButton;
- Button minimumInclusiveCheckbox;
- Button maximumInclusiveCheckbox;
- boolean isNumericBaseType;
- boolean isSimpleTypeRestriction;
- private XSDTypeDefinition typeDefinition;
- private XSDSimpleTypeDefinition xsdSimpleTypeDefinition;
- private XSDSimpleTypeDefinition currentPrimitiveType, previousPrimitiveType;
- private XSDElementDeclaration xsdElementDeclaration;
- private XSDAttributeDeclaration xsdAttributeDeclaration;
- private XSDFeature xsdFeature;
- boolean hasMaxMinFacets;
-
- SpecificConstraintsWidget constraintsWidget;
-
- private int constraintKind = SpecificConstraintsWidget.ENUMERATION;
-
- public XSDFacetSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- composite.setLayout(gridLayout);
-
- title = factory.createCLabel(composite, ""); //$NON-NLS-1$
- FontData fontData = composite.getFont().getFontData()[0];
- title.setFont(JFaceResources.getFontRegistry().getBold(fontData.getName()));
- title.setText(titleString + (isReadOnly ? " - " + Messages._UI_LABEL_READONLY : "")); //$NON-NLS-1$ //$NON-NLS-2$
-
- Composite facetComposite = factory.createComposite(composite, SWT.FLAT);
-
- GridData data = new GridData();
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- facetComposite.setLayout(gridLayout);
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- facetComposite.setLayoutData(data);
-
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
-
- simpleTypeModifierGroup = getWidgetFactory().createGroup(facetComposite, simpleTypeModifierGroupTitle);
- GridLayout groupGrid = new GridLayout();
- groupGrid.marginTop = 0;
- groupGrid.marginBottom = 0;
- groupGrid.numColumns = 1;
- simpleTypeModifierGroup.setLayoutData(data);
- simpleTypeModifierGroup.setLayout(groupGrid);
-
- Composite simpleTypeModifierComposite = getWidgetFactory().createFlatFormComposite(simpleTypeModifierGroup);
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
-
- GridLayout grid = new GridLayout();
- grid.marginTop = 0;
- grid.marginBottom = 0;
- grid.numColumns = 3;
- simpleTypeModifierComposite.setLayout(grid);
- simpleTypeModifierComposite.setLayoutData(data);
- if (hasMaxMinFacets)
- {
- boolean isLinux = java.io.File.separator.equals("/");
- minLengthLabel = factory.createLabel(simpleTypeModifierComposite, minLengthString);
- minLengthText = factory.createText(simpleTypeModifierComposite, ""); //$NON-NLS-1$
- if (isLinux)
- {
- minLengthText.addListener(SWT.Modify, customListener);
- minLengthText.addListener(SWT.KeyDown, customListener);
- minLengthText.addListener(SWT.FocusOut, customListener);
- }
- else
- applyAllListeners(minLengthText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(minLengthText,
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__MINIMUM_LENGTH);
-
- GridData minGridData = new GridData();
- minGridData.widthHint = 100;
- minLengthText.setLayoutData(minGridData);
- minimumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_INCLUSIVE, SWT.CHECK);
- minimumInclusiveCheckbox.addSelectionListener(this);
-
- maxLengthLabel = factory.createLabel(simpleTypeModifierComposite, maxLengthString);
- maxLengthText = factory.createText(simpleTypeModifierComposite, ""); //$NON-NLS-1$
- if (isLinux)
- {
- maxLengthText.addListener(SWT.Modify, customListener);
- maxLengthText.addListener(SWT.KeyDown, customListener);
- maxLengthText.addListener(SWT.FocusOut, customListener);
- }
- else
- applyAllListeners(maxLengthText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(maxLengthText,
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__MAXIMUM_LENGTH);
-
- GridData maxGridData = new GridData();
- maxGridData.widthHint = 100;
- maxLengthText.setLayoutData(maxGridData);
-
- maximumInclusiveCheckbox = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_INCLUSIVE, SWT.CHECK);
- maximumInclusiveCheckbox.addSelectionListener(this);
-
- minimumInclusiveCheckbox.setVisible(isNumericBaseType);
- maximumInclusiveCheckbox.setVisible(isNumericBaseType);
- }
- collapseWhitespaceButton = factory.createButton(simpleTypeModifierComposite, Messages._UI_LABEL_COLLAPSE_WHITESPACE, SWT.CHECK);
- collapseWhitespaceButton.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(collapseWhitespaceButton,
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__COLLAPSE_WHITESPACE);
-
- Group specificValueConstraintsGroup = factory.createGroup(facetComposite, Messages._UI_LABEL_SPECIFIC_CONSTRAINT_VALUES);
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- specificValueConstraintsGroup.setLayout(gridLayout);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- specificValueConstraintsGroup.setLayoutData(data);
-
- Composite compositeForButtons = factory.createFlatFormComposite(specificValueConstraintsGroup);
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.verticalSpacing = 1;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- compositeForButtons.setLayout(gridLayout);
- data = new GridData();
- data.verticalAlignment = GridData.BEGINNING;
- compositeForButtons.setLayoutData(data);
-
- factory.createCLabel(compositeForButtons, Messages._UI_LABEL_RESTRICT_VALUES_BY);
-// useDefinedValuesButton = factory.createButton(compositeForButtons, "Only permit certain values", SWT.CHECK);
-// useDefinedValuesButton.addSelectionListener(this);
-
- Composite compositeForRadioButtons = factory.createFlatFormComposite(compositeForButtons);
- gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginLeft = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 1;
- compositeForRadioButtons.setLayout(gridLayout);
- useEnumerationsButton = factory.createButton(compositeForRadioButtons, Messages._UI_LABEL_ENUMERATIONS, SWT.RADIO);
- useEnumerationsButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(useEnumerationsButton,
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__ENUMERATIONS);
- usePatternsButton = factory.createButton(compositeForRadioButtons, Messages._UI_LABEL_PATTERNS, SWT.RADIO);
- usePatternsButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(usePatternsButton,
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__PATTERNS);
-
- constraintsWidget = new SpecificConstraintsWidget(specificValueConstraintsGroup, factory, (input instanceof XSDFeature) ? (XSDFeature)input : null, xsdSimpleTypeDefinition, this, constraintKind);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- constraintsWidget.getControl().setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(constraintsWidget.getControl(),
- XSDEditorCSHelpIds.CONSTRAINTS_TAB__NO_LABEL);
- }
-
- public void doSetInput()
- {
- setInput(getPart(), getSelection());
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- init();
-
- XSDSchema schemaOfType = null;
-
- if (!isReadOnly)
- {
- schemaOfType = xsdSimpleTypeDefinition.getSchema();
- }
- if (schemaOfType == owningEditor.getAdapter(XSDSchema.class))
- {
- isReadOnly = false;
- }
- else
- {
- if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- isReadOnly = true;
- }
- if (hasMaxMinFacets)
- {
- title.setText(titleString + (isReadOnly ? " - " + Messages._UI_LABEL_READONLY : "")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- relayout();
- constraintsWidget.setCommandStack(getCommandStack());
- }
-
- protected void init()
- {
- hasMaxMinFacets = false;
- try
- {
- updateInput();
-
- if (xsdSimpleTypeDefinition != null)
- {
- isSimpleTypeRestriction = xsdSimpleTypeDefinition.getVariety().getValue() == XSDVariety.ATOMIC;
-
- XSDSimpleTypeDefinition targetST = xsdSimpleTypeDefinition;
-
- while (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(targetST.getTargetNamespace()) && targetST != null)
- {
- targetST = targetST.getBaseTypeDefinition();
- }
-
- minLengthString = ""; //$NON-NLS-1$
- maxLengthString = ""; //$NON-NLS-1$
- if (targetST.getValidFacets().contains("length")) //$NON-NLS-1$
- {
- minLengthString = Messages._UI_LABEL_MINIMUM_LENGTH;
- maxLengthString = Messages._UI_LABEL_MAXIMUM_LENGTH;
- simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONSTRAINTS_ON_LENGTH_OF + targetST.getName();
- isNumericBaseType = false;
- hasMaxMinFacets = true;
- }
- else if (targetST.getValidFacets().contains("maxInclusive")) //$NON-NLS-1$
- {
- simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONSTRAINTS_ON_VALUE_OF + targetST.getName();
- minLengthString = Messages._UI_LABEL_MINIMUM_VALUE;
- maxLengthString = Messages._UI_LABEL_MAXIMUM_VALUE;
- isNumericBaseType = true;
- hasMaxMinFacets = true;
- }
- else
- {
- simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONTRAINTS_ON + (targetST != null ? targetST.getName() : "anyType"); //$NON-NLS-1$
- }
- }
- }
- catch(Exception e)
- {
- }
- }
-
- private void updateInput()
- {
- previousPrimitiveType = currentPrimitiveType;
- if (input instanceof XSDFeature)
- {
- xsdFeature = (XSDFeature) input;
- typeDefinition = xsdFeature.getResolvedFeature().getType();
- XSDTypeDefinition anonymousTypeDefinition = null;
- if (xsdFeature instanceof XSDElementDeclaration)
- {
- xsdElementDeclaration = (XSDElementDeclaration)xsdFeature;
- anonymousTypeDefinition = xsdElementDeclaration.getResolvedElementDeclaration().getAnonymousTypeDefinition();
- }
- else if (xsdFeature instanceof XSDAttributeDeclaration)
- {
- xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdFeature;
- anonymousTypeDefinition = xsdAttributeDeclaration.getResolvedAttributeDeclaration().getAnonymousTypeDefinition();
- }
-
- if (typeDefinition instanceof XSDSimpleTypeDefinition)
- {
- xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) typeDefinition;
- }
-
- if (anonymousTypeDefinition instanceof XSDSimpleTypeDefinition)
- {
- xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition)anonymousTypeDefinition;
- }
-
- if (xsdSimpleTypeDefinition != null)
- {
- if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- {
- XSDSimpleTypeDefinition basePrimitiveType = xsdSimpleTypeDefinition.getBaseTypeDefinition();
- String basePrimitiveTypeString = basePrimitiveType != null ? basePrimitiveType.getName() : "";
- currentPrimitiveType = basePrimitiveType;
- titleString = Messages._UI_LABEL_TYPE + (anonymousTypeDefinition != null ? "(" + xsdFeature.getResolvedFeature().getName() + "Type)" : xsdSimpleTypeDefinition.getName()) + " , " + Messages._UI_LABEL_BASE + ": " + basePrimitiveTypeString; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- else
- {
- currentPrimitiveType = xsdSimpleTypeDefinition;
- titleString = Messages._UI_LABEL_TYPE + (anonymousTypeDefinition != null ? "(" + xsdFeature.getResolvedFeature().getName() + "Type)" : xsdSimpleTypeDefinition.getName());
- }
- }
- }
- else if (input instanceof XSDSimpleTypeDefinition)
- {
- xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) input;
- currentPrimitiveType = xsdSimpleTypeDefinition;
- titleString = Messages._UI_LABEL_TYPE + (xsdSimpleTypeDefinition.getName() == null ? "(localType)" : xsdSimpleTypeDefinition.getName()) + " , " + Messages._UI_LABEL_BASE + ": " + xsdSimpleTypeDefinition.getBaseTypeDefinition().getName(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void refresh()
- {
- super.refresh();
- init();
-
- if (currentPrimitiveType != previousPrimitiveType)
- {
- relayout();
- }
-
- setListenerEnabled(false);
-
- XSDWhiteSpaceFacet whitespaceFacet = xsdSimpleTypeDefinition.getWhiteSpaceFacet();
- if (whitespaceFacet != null)
- {
- if (xsdSimpleTypeDefinition.getFacetContents().contains(whitespaceFacet))
- {
- if (XSDWhiteSpace.COLLAPSE_LITERAL.equals(whitespaceFacet.getValue()))
- {
- if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- {
- collapseWhitespaceButton.setSelection(true);
- }
- else
- {
- collapseWhitespaceButton.setSelection(false);
- }
- }
- }
- }
-
- if (hasMaxMinFacets && !minLengthLabel.isDisposed() && !maxLengthLabel.isDisposed())
- {
- minLengthLabel.setText(minLengthString);
- maxLengthLabel.setText(maxLengthString);
-
- if (!isNumericBaseType)
- refreshStringLength();
- else
- refreshValueLengths();
- }
-
- if ((xsdSimpleTypeDefinition.getEnumerationFacets().size() > 0
- && constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.ENUMERATION)
- || xsdSimpleTypeDefinition.getPatternFacets().size() == 0)
- {
- usePatternsButton.setSelection(false);
- useEnumerationsButton.setSelection(true);
- constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
- constraintsWidget.addButton.setEnabled(true);
- }
- else if ((xsdSimpleTypeDefinition.getPatternFacets().size() > 0
- && constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.PATTERN)
- || xsdSimpleTypeDefinition.getEnumerationFacets().size() == 0)
- {
- usePatternsButton.setSelection(true);
- useEnumerationsButton.setSelection(false);
- constraintsWidget.setConstraintKind(SpecificConstraintsWidget.PATTERN);
- constraintsWidget.addButton.setEnabled(false);
- }
- else
- {
- usePatternsButton.setSelection(false);
- useEnumerationsButton.setSelection(true);
- constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
- constraintsWidget.addButton.setEnabled(true);
- }
- constraintKind = constraintsWidget.getConstraintKind();
- constraintsWidget.setInput(xsdSimpleTypeDefinition);
-
- setWidgetsEnabled(isSimpleTypeRestriction && !isReadOnly);
- composite.setEnabled(isSimpleTypeRestriction && !isReadOnly);
-
- setListenerEnabled(true);
- }
-
- private void setWidgetsEnabled(boolean isEnabled)
- {
- if (collapseWhitespaceButton != null && !collapseWhitespaceButton.isDisposed())
- collapseWhitespaceButton.setEnabled(isEnabled);
- if (useEnumerationsButton != null && !useEnumerationsButton.isDisposed())
- useEnumerationsButton.setEnabled(isEnabled);
- if (usePatternsButton != null && !usePatternsButton.isDisposed())
- usePatternsButton.setEnabled(isEnabled);
- if (minimumInclusiveCheckbox != null && !minimumInclusiveCheckbox.isDisposed())
- minimumInclusiveCheckbox.setEnabled(isEnabled);
- if (maximumInclusiveCheckbox != null && !maximumInclusiveCheckbox.isDisposed())
- maximumInclusiveCheckbox.setEnabled(isEnabled);
- if (constraintsWidget != null && !constraintsWidget.getControl().isDisposed())
- {
- if(constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.PATTERN)
- {
- constraintsWidget.addButton.setEnabled(false);
- }
- else
- {
- constraintsWidget.addButton.setEnabled(isEnabled);
- }
- constraintsWidget.addUsingDialogButton.setEnabled(isEnabled);
- }
- }
-
- protected void relayout()
- {
- Composite parent = composite.getParent();
- parent.getParent().setRedraw(false);
-
- if (parent != null && !parent.isDisposed())
- {
- Control[] children = parent.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
- createContents(parent);
- parent.getParent().layout(true, true);
- parent.getParent().setRedraw(true);
- refresh();
- }
-
- public void dispose()
- {
- if (titleFont != null && !titleFont.isDisposed())
- titleFont.dispose();
- titleFont = null;
-
- if (minimumInclusiveCheckbox != null && !minimumInclusiveCheckbox.isDisposed())
- minimumInclusiveCheckbox.removeSelectionListener(this);
- if (maximumInclusiveCheckbox != null && !maximumInclusiveCheckbox.isDisposed())
- maximumInclusiveCheckbox.removeSelectionListener(this);
-
- if (collapseWhitespaceButton != null && !collapseWhitespaceButton.isDisposed())
- collapseWhitespaceButton.removeSelectionListener(this);
-
- if (maxLengthText != null && !maxLengthText.isDisposed())
- removeListeners(maxLengthText);
- if (minLengthText != null && !minLengthText.isDisposed())
- removeListeners(minLengthText);
-
- super.dispose();
- }
-
- public void refreshStringLength()
- {
- XSDMinLengthFacet minLengthFacet = xsdSimpleTypeDefinition.getMinLengthFacet();
- XSDMaxLengthFacet maxLengthFacet = xsdSimpleTypeDefinition.getMaxLengthFacet();
- XSDLengthFacet lengthFacet = xsdSimpleTypeDefinition.getLengthFacet();
-
- try
- {
- if (minLengthFacet != null)
- {
- int minLengthValue = minLengthFacet.getValue();
- if (minLengthValue >= 0 && minLengthFacet.getRootContainer() == xsdSchema)
- {
- minLengthText.setText(Integer.toString(minLengthValue));
- }
- else
- {
- minLengthText.setText(""); //$NON-NLS-1$
- }
- }
- if (maxLengthFacet != null)
- {
- int maxLength = maxLengthFacet.getValue();
- if (maxLength >= 0 && maxLengthFacet.getRootContainer() == xsdSchema)
- {
- maxLengthText.setText(Integer.toString(maxLength));
- }
- else
- {
- maxLengthText.setText(""); //$NON-NLS-1$
- }
- }
- if (lengthFacet != null)
- {
- int length = lengthFacet.getValue();
- if (length >= 0 && lengthFacet.getRootContainer() == xsdSchema)
- {
- minLengthText.setText(Integer.toString(length));
- maxLengthText.setText(Integer.toString(length));
- }
- }
- }
- catch (Exception e)
- {
-
- }
-
- }
-
- public void refreshValueLengths()
- {
- XSDSimpleTypeDefinition type = xsdSimpleTypeDefinition;
- XSDMinFacet minFacet = type.getMinFacet();
- XSDMaxFacet maxFacet = type.getMaxFacet();
-
- if (minFacet != null && minFacet.getRootContainer() == xsdSchema)
- {
- if (minFacet.getElement().getLocalName().equals(XSDConstants.MINEXCLUSIVE_ELEMENT_TAG) || minFacet.getElement().getLocalName().equals(XSDConstants.MININCLUSIVE_ELEMENT_TAG))
- {
- minLengthText.setText(minFacet.getLexicalValue());
- minimumInclusiveCheckbox.setSelection(minFacet.isInclusive());
- minimumInclusiveCheckbox.setEnabled(true);
- }
- else
- {
- minLengthText.setText(""); //$NON-NLS-1$
- }
- }
- else
- {
- minimumInclusiveCheckbox.setSelection(false);
- minimumInclusiveCheckbox.setEnabled(false);
- }
-
- if (maxFacet != null && maxFacet.getRootContainer() == xsdSchema)
- {
- if (maxFacet.getElement().getLocalName().equals(XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG) || maxFacet.getElement().getLocalName().equals(XSDConstants.MAXINCLUSIVE_ELEMENT_TAG))
- {
- maxLengthText.setText(maxFacet.getLexicalValue());
- maximumInclusiveCheckbox.setSelection(maxFacet.isInclusive());
- maximumInclusiveCheckbox.setEnabled(true);
- }
- else
- {
- maxLengthText.setText(""); //$NON-NLS-1$
- }
- }
- else
- {
- maximumInclusiveCheckbox.setSelection(false);
- maximumInclusiveCheckbox.setEnabled(false);
- }
- }
-
- protected void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- Command command = null;
- boolean doUpdateMax = false, doUpdateMin = false;
- boolean doSetInput = false;
-
- String minValue = minLengthText.getText().trim();
- String maxValue = maxLengthText.getText().trim();
-
- XSDLengthFacet lengthFacet = xsdSimpleTypeDefinition.getLengthFacet();
- XSDMinLengthFacet minLengthFacet = xsdSimpleTypeDefinition.getMinLengthFacet();
- XSDMaxLengthFacet maxLengthFacet = xsdSimpleTypeDefinition.getMaxLengthFacet();
-
- XSDMinInclusiveFacet minInclusiveFacet = xsdSimpleTypeDefinition.getMinInclusiveFacet();
- XSDMinExclusiveFacet minExclusiveFacet = xsdSimpleTypeDefinition.getMinExclusiveFacet();
- XSDMaxInclusiveFacet maxInclusiveFacet = xsdSimpleTypeDefinition.getMaxInclusiveFacet();
- XSDMaxExclusiveFacet maxExclusiveFacet = xsdSimpleTypeDefinition.getMaxExclusiveFacet();
-
- String currentMinInclusive = null, currentMinExclusive = null, currentMaxInclusive = null, currentMaxExclusive = null;
- if (minInclusiveFacet != null)
- {
- currentMinInclusive = minInclusiveFacet.getLexicalValue();
- }
- if (minExclusiveFacet != null)
- {
- currentMinExclusive = minExclusiveFacet.getLexicalValue();
- }
- if (maxInclusiveFacet != null)
- {
- currentMaxInclusive = maxInclusiveFacet.getLexicalValue();
- }
- if (maxExclusiveFacet != null)
- {
- currentMaxExclusive = maxExclusiveFacet.getLexicalValue();
- }
-
- String currentLength = null, currentMin = null, currentMax = null;
- if (lengthFacet != null)
- {
- currentLength = lengthFacet.getLexicalValue();
- }
- if (minLengthFacet != null)
- {
- currentMin = minLengthFacet.getLexicalValue();
- }
- if (maxLengthFacet != null)
- {
- currentMax = maxLengthFacet.getLexicalValue();
- }
-
- if (event.widget == minLengthText)
- {
- try
- {
- if (minValue.length() > 0)
- {
- if (!isNumericBaseType)
- {
- Number big = new BigInteger(minValue);
- big.toString();
- if (minLengthFacet != null)
- {
- if (minValue.equals(currentMin) || minValue.equals(currentLength))
- return;
- }
- else
- {
- if (maxValue != null && minValue.equals(maxValue) && lengthFacet != null)
- {
- return;
- }
- }
- }
- else
- {
- if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
- xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
- xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition.getBaseType())) //$NON-NLS-1$
- {
- BigDecimal bigDecimal = new BigDecimal(minValue);
- bigDecimal.toString();
- if ( (currentMinInclusive != null && minValue.equals(currentMinInclusive)) ||
- (currentMinExclusive != null && minValue.equals(currentMinExclusive)) )
- {
- return;
- }
- }
- else
- {
- Number big = new BigInteger(minValue);
- big.toString();
- }
- minimumInclusiveCheckbox.setEnabled(true);
- }
- }
- else
- {
- if (!isNumericBaseType)
- {
- if (currentMin == null && currentLength == null)
- return;
- }
- else
- {
- if (currentMinInclusive == null && minimumInclusiveCheckbox.getSelection())
- {
- return;
- }
- else if (currentMinExclusive == null && !minimumInclusiveCheckbox.getSelection())
- {
- return;
- }
- }
- minimumInclusiveCheckbox.setEnabled(false);
- minValue = null;
- }
- doUpdateMin = true;
- }
- catch (NumberFormatException e)
- {
- // TODO show error message
- doUpdateMin = false;
- }
- }
- if (event.widget == maxLengthText)
- {
- try
- {
- if (maxValue.length() > 0)
- {
- if (!isNumericBaseType)
- {
- Number big = new BigInteger(maxValue);
- big.toString();
- if (maxLengthFacet != null)
- {
- if (maxValue.equals(currentMax) || maxValue.equals(currentLength))
- return;
- }
- else
- {
- if (minValue != null && maxValue.equals(minValue) && lengthFacet != null)
- {
- return;
- }
- }
- }
- else
- {
- if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
- xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
- xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition.getBaseType())) //$NON-NLS-1$
- {
- BigDecimal bigDecimal = new BigDecimal(maxValue);
- bigDecimal.toString();
- }
- else
- {
- Number big = new BigInteger(maxValue);
- big.toString();
- }
- maximumInclusiveCheckbox.setEnabled(true);
- }
- }
- else
- {
- if (!isNumericBaseType)
- {
- if (currentMax == null && currentLength == null)
- return;
- }
- else
- {
- if (currentMaxInclusive == null && maximumInclusiveCheckbox.getSelection())
- {
- return;
- }
- else if (currentMaxExclusive == null && !maximumInclusiveCheckbox.getSelection())
- {
- return;
- }
- maximumInclusiveCheckbox.setEnabled(false);
- }
- maxValue = null;
- }
-
- doUpdateMax = true;
- }
- catch (NumberFormatException e)
- {
- doUpdateMax = false;
- // TODO show error message
- }
- }
-
- if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()) && (doUpdateMax || doUpdateMin))
- {
- XSDSimpleTypeDefinition anonymousSimpleType = null;
- CompoundCommand compoundCommand = new CompoundCommand();
- ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = null;
- if (input instanceof XSDFeature)
- {
- anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType((XSDFeature)input, xsdSimpleTypeDefinition);
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(xsdSimpleTypeDefinition);
-
- changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand(Messages._UI_ACTION_CONSTRAIN_LENGTH, (XSDFeature)input);
- changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
- compoundCommand.add(changeToAnonymousCommand);
- doSetInput = true;
- }
-
- if (!isNumericBaseType)
- {
- UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", anonymousSimpleType); //$NON-NLS-1$
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- compoundCommand.add(updateCommand);
- }
- else
- {
- UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand(Messages._UI_ACTION_UPDATE_BOUNDS, anonymousSimpleType, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- compoundCommand.add(updateCommand);
- }
- command = compoundCommand;
- getCommandStack().execute(command);
- }
- else if (input instanceof XSDSimpleTypeDefinition)
- {
- if (!isNumericBaseType)
- {
- UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", xsdSimpleTypeDefinition); //$NON-NLS-1$
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- command = updateCommand;
- }
- else
- {
- UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand(Messages._UI_ACTION_UPDATE_BOUNDS, xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- command = updateCommand;
- }
- getCommandStack().execute(command);
- }
- }
- else
- {
- if (!isNumericBaseType)
- {
- UpdateStringLengthFacetCommand updateCommand = new UpdateStringLengthFacetCommand("", xsdSimpleTypeDefinition); //$NON-NLS-1$
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- getCommandStack().execute(updateCommand);
- }
- else
- {
- UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand(Messages._UI_ACTION_UPDATE_BOUNDS, xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
- if (doUpdateMax)
- {
- updateCommand.setMax(maxValue);
- }
- if (doUpdateMin)
- {
- updateCommand.setMin(minValue);
- }
- getCommandStack().execute(updateCommand);
- }
-
- }
- refresh();
- if (doSetInput)
- setInput(getPart(), getSelection());
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == collapseWhitespaceButton)
- {
- CompoundCommand compoundCommand = new CompoundCommand();
- XSDSimpleTypeDefinition anonymousSimpleType = null;
- if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- {
- if (input instanceof XSDFeature)
- {
- anonymousSimpleType = XSDCommonUIUtils.getAnonymousSimpleType((XSDFeature)input, xsdSimpleTypeDefinition);
- if (anonymousSimpleType == null)
- {
- anonymousSimpleType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- anonymousSimpleType.setBaseTypeDefinition(xsdSimpleTypeDefinition);
-
- ChangeToLocalSimpleTypeCommand changeToAnonymousCommand = new ChangeToLocalSimpleTypeCommand(Messages._UI_ACTION_CONSTRAIN_LENGTH, (XSDFeature)input);
- changeToAnonymousCommand.setAnonymousSimpleType(anonymousSimpleType);
- compoundCommand.add(changeToAnonymousCommand);
- }
-
- UpdateXSDWhiteSpaceFacetCommand whiteSpaceCommand = new UpdateXSDWhiteSpaceFacetCommand(Messages._UI_ACTION_COLLAPSE_WHITESPACE, anonymousSimpleType, collapseWhitespaceButton.getSelection());
- compoundCommand.add(whiteSpaceCommand);
-
- getCommandStack().execute(compoundCommand);
- }
- setInput(getPart(), getSelection());
- }
- else
- {
- UpdateXSDWhiteSpaceFacetCommand whiteSpaceCommand = new UpdateXSDWhiteSpaceFacetCommand(Messages._UI_ACTION_COLLAPSE_WHITESPACE, xsdSimpleTypeDefinition, collapseWhitespaceButton.getSelection());
- getCommandStack().execute(whiteSpaceCommand);
- }
- }
- else if (e.widget == minimumInclusiveCheckbox)
- {
- String minValue = minLengthText.getText().trim();
- if (minValue.length() == 0) minValue = null;
-
- UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand(Messages._UI_ACTION_UPDATE_BOUNDS, xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
- updateCommand.setMin(minValue);
-
- if (minValue != null)
- getCommandStack().execute(updateCommand);
- }
- else if (e.widget == maximumInclusiveCheckbox)
- {
- String maxValue = maxLengthText.getText().trim();
- if (maxValue.length() == 0) maxValue = null;
- UpdateNumericBoundsFacetCommand updateCommand = new UpdateNumericBoundsFacetCommand(Messages._UI_ACTION_UPDATE_BOUNDS, xsdSimpleTypeDefinition, minimumInclusiveCheckbox.getSelection(), maximumInclusiveCheckbox.getSelection());
- updateCommand.setMax(maxValue);
- if (maxValue != null)
- getCommandStack().execute(updateCommand);
- }
- else if (e.widget == useEnumerationsButton)
- {
- constraintsWidget.addButton.setEnabled(true);
- if (isListenerEnabled())
- {
- constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
- constraintKind = constraintsWidget.getConstraintKind();
- }
- }
- else if (e.widget == usePatternsButton)
- {
- constraintsWidget.addButton.setEnabled(false);
- if (isListenerEnabled())
- {
- constraintsWidget.setConstraintKind(SpecificConstraintsWidget.PATTERN);
- constraintKind = constraintsWidget.getConstraintKind();
- }
- }
- }
-
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java
deleted file mode 100644
index bdc57c5a8d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java
+++ /dev/null
@@ -1,42 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDFacetSectionFilter implements IFilter
-{
- public boolean select(Object toTest)
- {
- if (toTest instanceof XSDFeature)
- {
- XSDTypeDefinition type = ((XSDFeature)toTest).getResolvedFeature().getType();
- if (type instanceof XSDSimpleTypeDefinition)
- {
- return true;
- }
- }
- else if (toTest instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)toTest;
- if (st.eContainer() instanceof XSDSchema ||
- st.eContainer() instanceof XSDFeature)
- {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java
deleted file mode 100644
index 98263e197c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.Map;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDImportSection extends SchemaLocationSection
-{
- protected Text namespaceText, prefixText;
- protected String oldPrefixValue;
-
- public XSDImportSection()
- {
- super();
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- GridData data = new GridData();
-
- // Create Schema Location Label
- CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_NAMESPACE")); //$NON-NLS-1$
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- namespaceLabel.setLayoutData(data);
-
- namespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- namespaceText.setEditable(false);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- applyAllListeners(namespaceText);
- namespaceText.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // DummyLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_PREFIX")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- prefixLabel.setLayoutData(data);
-
- prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- prefixText.setEditable(true);
- applyAllListeners(prefixText);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- prefixText.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // DummyLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // Create Schema Location Label
- CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- schemaLocationLabel.setLayoutData(data);
-
- // Create Schema Location Text
- schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- schemaLocationText.setEditable(true);
- applyAllListeners(schemaLocationText);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- schemaLocationText.setLayoutData(data);
-
- // Create Wizard Button
- wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
- wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- wizardButton.setLayoutData(data);
- wizardButton.addSelectionListener(this);
-
- // error text
- errorText = new StyledText(composite, SWT.FLAT);
- errorText.setEditable(false);
- errorText.setEnabled(false);
- errorText.setText(""); //$NON-NLS-1$
-
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 3;
- data.grabExcessHorizontalSpace = true;
- errorText.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(schemaLocationText,
- XSDEditorCSHelpIds.GENERAL_TAB__IMPORT__SCHEMALOCATION);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(namespaceText,
- XSDEditorCSHelpIds.GENERAL_TAB__IMPORT__NAMESPACE);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(prefixText,
- XSDEditorCSHelpIds.GENERAL_TAB__IMPORT__PREFIX);
-
- }
-
- public void refresh()
- {
- setListenerEnabled(false);
-
- errorText.setText("");
- Element element = null;
- if (input instanceof XSDImport)
- {
- element = ((XSDImport) input).getElement();
-
- String namespace = element.getAttribute("namespace"); //$NON-NLS-1$
- String schemaLocation = element.getAttribute("schemaLocation"); //$NON-NLS-1$
-
- TypesHelper helper = new TypesHelper(xsdSchema);
- String prefix = helper.getPrefix(element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE), false);
-
- if (namespace == null)
- {
- namespace = ""; //$NON-NLS-1$
- }
-
- if (prefix == null)
- {
- prefix = ""; //$NON-NLS-1$
- }
-
- if (schemaLocation == null)
- {
- schemaLocation = ""; //$NON-NLS-1$
- }
-
- namespaceText.setText(namespace);
- prefixText.setText(prefix);
- schemaLocationText.setText(schemaLocation);
- oldPrefixValue = prefixText.getText();
- }
-
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- if (event.widget == wizardButton)
- {
- setListenerEnabled(false);
-
- XSDDirectivesSchemaLocationUpdater.updateSchemaLocation(xsdSchema,input,false);
- refresh();
- setListenerEnabled(true);
- prefixText.addListener(SWT.Modify, this);
- }
- }
-
- public void doHandleEvent(Event event)
- {
- setErrorMessage(null);
- super.doHandleEvent(event);
- if (event.widget == prefixText)
- {
- String newPrefix = prefixText.getText();
- if (oldPrefixValue.equals(newPrefix) || !isValidSchemaLocation)
- return;
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- String key = prefixText.getText();
- if (key.length() == 0) key = null;
-
- if (validatePrefix(newPrefix) && schemaLocationText.getText().trim().length() > 0)
- {
- if (map.containsKey(key))
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
- }
- else
- {
- Element schemaElement = xsdSchema.getElement();
-
- if (key != null) {
- if (oldPrefixValue.length() == 0)
- schemaElement.removeAttribute("xmlns");
- else
- schemaElement.removeAttribute("xmlns:"+oldPrefixValue);
-
- schemaElement.setAttribute("xmlns:" + newPrefix, namespaceText.getText());
- }
- else {
- schemaElement.removeAttribute("xmlns:"+oldPrefixValue);
- schemaElement.setAttribute("xmlns", namespaceText.getText());
- }
- xsdSchema.updateElement();
- setErrorMessage(null);
- oldPrefixValue = newPrefix;
- }
- }
- else
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_INVALID_PREFIX"));
- }
- }
- }
-
- public void aboutToBeHidden()
- {
- setErrorMessage(null);
- super.aboutToBeHidden();
- }
-
- protected boolean validatePrefix(String prefix)
- {
- if (prefix.length() == 0) return true;
- return XMLChar.isValidNCName(prefix);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java
deleted file mode 100644
index fec1b37ad1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-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.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDModelGroupDefinitionSection extends MultiplicitySection
-{
- protected Text nameText;
- protected CCombo componentNameCombo;
- boolean isReference;
-
- public XSDModelGroupDefinitionSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- if (isReference)
- {
- // ------------------------------------------------------------------
- // Ref Label
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":"); //$NON-NLS-1$
- refLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // Ref Combo
- // ------------------------------------------------------------------
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
-
- componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- componentNameCombo.addSelectionListener(this);
- componentNameCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP_REFS__REF);
-
- // ------------------------------------------------------------------
- // min property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite,
- org.eclipse.wst.xsd.ui.internal.editor.Messages.UI_LABEL_MINOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
-
- minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- minCombo.setLayoutData(data);
- minCombo.add("0"); //$NON-NLS-1$
- minCombo.add("1"); //$NON-NLS-1$
- applyAllListeners(minCombo);
- minCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(minCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP__MIN_OCCURENCE);
-
- // ------------------------------------------------------------------
- // max property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite,
- org.eclipse.wst.xsd.ui.internal.editor.Messages.UI_LABEL_MAXOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
-
- maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- maxCombo.setLayoutData(data);
- maxCombo.add("0"); //$NON-NLS-1$
- maxCombo.add("1"); //$NON-NLS-1$
- maxCombo.add("unbounded"); //$NON-NLS-1$
- applyAllListeners(maxCombo);
- maxCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(maxCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP__MAX_OCCURENCE);
-
- }
- else
- {
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- applyAllListeners(nameText);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP_DEFINITION__NAME);
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- if (!hideHyperLink)
- {
- createRenameHyperlink(composite);
- setRenameHyperlinkEnabled(!isReference);
- }
- else
- {
- getWidgetFactory().createCLabel(composite, "");
- }
- }
- }
-
- public void refresh()
- {
- super.refresh();
-
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
-
- setListenerEnabled(false);
-
- XSDNamedComponent namedComponent = (XSDNamedComponent) input;
-
- if (isReference)
- {
- Element element = namedComponent.getElement();
- if (element != null)
- {
- String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
- if (attrValue == null)
- {
- attrValue = ""; //$NON-NLS-1$
- }
- componentNameCombo.setText(attrValue);
-
- // refresh min max
- if (minCombo != null && maxCombo != null)
- {
- refreshMinMax();
- }
- }
- }
- else
- {
- // refresh name
- nameText.setText(""); //$NON-NLS-1$
-
- String name = namedComponent.getName();
- if (name != null)
- {
- nameText.setText(name);
- }
- }
-
- setListenerEnabled(true);
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- init();
- relayout();
-
- if (isReference)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- List items = new ArrayList();
- items = helper.getModelGroups();
- if (input instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition group = (XSDModelGroupDefinition) input;
- XSDConcreteComponent parent = group.getContainer();
- while (parent != null)
- {
- if (parent instanceof XSDModelGroupDefinition)
- {
- items.remove(((XSDModelGroupDefinition)parent).getQName());
- break;
- }
- parent = parent.getContainer();
- }
- }
- items.add(0, ""); //$NON-NLS-1$
- componentNameCombo.setItems((String [])items.toArray(new String[0]));
- }
- }
-
- protected void init()
- {
- if (input instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition group = (XSDModelGroupDefinition) input;
- isReference = group.isModelGroupDefinitionReference();
- hideHyperLink = isReference;
- }
- }
-
- protected void relayout()
- {
- Composite parentComposite = composite.getParent();
- parentComposite.getParent().setRedraw(false);
-
- if (parentComposite != null && !parentComposite.isDisposed())
- {
- Control[] children = parentComposite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
-
- // Now initialize the new handler
- createContents(parentComposite);
- parentComposite.getParent().layout(true, true);
-
- // Now turn painting back on
- parentComposite.getParent().setRedraw(true);
- refresh();
- }
-
- public void doHandleEvent(Event event)
- {
- super.doHandleEvent(event);
- if (event.widget == nameText)
- {
- String newValue = nameText.getText().trim();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) input;
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
- // doReferentialIntegrityCheck(namedComponent, newValue);
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == componentNameCombo)
- {
- String newValue = componentNameCombo.getText();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent)input;
- Element element = namedComponent.getElement();
-
- if (namedComponent instanceof XSDModelGroupDefinition)
- {
- element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
- XSDDirectivesManager.removeUnusedXSDImports(namedComponent.getSchema());
- }
- }
- }
- super.doWidgetSelected(e);
- }
-
- public void dispose()
- {
- if (nameText != null && !nameText.isDisposed())
- removeListeners(nameText);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupSection.java
deleted file mode 100644
index c695f7cd5f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupSection.java
+++ /dev/null
@@ -1,163 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateContentModelCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDModelGroupSection extends MultiplicitySection
-{
- protected CCombo modelGroupCombo;
- private String[] modelGroupComboValues = { "sequence", "choice", "all" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- public XSDModelGroupSection()
- {
- super();
- }
-
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_KIND);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- modelGroupCombo.setLayoutData(data);
- modelGroupCombo.addSelectionListener(this);
- modelGroupCombo.setItems(modelGroupComboValues);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(modelGroupCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP__KIND);
-
-
- // ------------------------------------------------------------------
- // min property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MINOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- minCombo.setLayoutData(data);
- minCombo.add("0"); //$NON-NLS-1$
- minCombo.add("1"); //$NON-NLS-1$
- applyAllListeners(minCombo);
- minCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(minCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP__MIN_OCCURENCE);
-
- // ------------------------------------------------------------------
- // max property
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, Messages.UI_LABEL_MAXOCCURS);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- maxCombo.setLayoutData(data);
- maxCombo.add("0"); //$NON-NLS-1$
- maxCombo.add("1"); //$NON-NLS-1$
- maxCombo.add("unbounded"); //$NON-NLS-1$
- applyAllListeners(maxCombo);
- maxCombo.addSelectionListener(this);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(maxCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__MODELGROUP__MAX_OCCURENCE);
- }
-
-
- public void refresh()
- {
- super.refresh();
-
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
-
- setListenerEnabled(false);
-
- if (input != null)
- {
- if (input instanceof XSDModelGroup)
- {
- XSDModelGroup particle = (XSDModelGroup)input;
- String modelType = particle.getCompositor().getName();
- modelGroupCombo.setText(modelType);
-
- minCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition));
- maxCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition));
- }
- }
-
- refreshMinMax();
-
- setListenerEnabled(true);
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- XSDModelGroup particle = (XSDModelGroup)input;
- if (e.widget == modelGroupCombo)
- {
- XSDCompositor newValue = XSDCompositor.get(modelGroupCombo.getText());
- UpdateContentModelCommand command = new UpdateContentModelCommand(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_CHANGE_CONTENT_MODEL, particle, newValue);
- getCommandStack().execute(command);
- }
- super.doWidgetSelected(e);
- }
-
- public void dispose()
- {
- if (minCombo != null && !minCombo.isDisposed())
- minCombo.removeSelectionListener(this);
- if (maxCombo != null && !maxCombo.isDisposed())
- maxCombo.removeSelectionListener(this);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java
deleted file mode 100644
index 89029253ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java
+++ /dev/null
@@ -1,208 +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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.xsd.XSDForm;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSchemaAdvancedSection extends AbstractSection
-{
- IWorkbenchPart part;
- protected CLabel elementFormLabel, attributeFormLabel, blockDefaultLabel, finalDefaultLabel;
- protected CCombo elementFormCombo, attributeFormCombo, blockDefaultCombo, finalDefaultCombo;
-
- protected static final String emptyOption = ""; //$NON-NLS-1$
-
- protected static final String [] formQualification = { emptyOption, XSDForm.QUALIFIED_LITERAL.getLiteral(),
- XSDForm.UNQUALIFIED_LITERAL.getLiteral() }; //$NON-NLS-1$
-
-
- protected static final String derivedByChoicesComboValues[] = { "", XSDConstants.RESTRICTION_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG };
-
- protected static final String blockDefaultValues[] = { emptyOption, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG,
- "substitution"};
-
- protected static final String finalDefaultValues[] = { emptyOption, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG,
- XSDConstants.LIST_ELEMENT_TAG, XSDConstants.UNION_ELEMENT_TAG};
-
- public XSDSchemaAdvancedSection()
- {
- super();
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- // Create elementFormDefault label and combo
- elementFormLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
- Messages._UI_LABEL_ELEMENTFORMDEFAULT);
- elementFormCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
- formQualification,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_ELEMENT_FORM_DEFAULT);
-
- // Create attributeFormDefault label and combo
- attributeFormLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
- Messages._UI_LABEL_ATTRIBUTEFORMDEFAULT);
- attributeFormCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
- formQualification,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_ATTRIBUTE_FORM_DEFAULT);
-
- // Create blockDefault label and combo
- blockDefaultLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
- Messages._UI_LABEL_BLOCKDEFAULT);
- blockDefaultCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
- blockDefaultValues,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_BLOCK_DEFAULT);
-
- // Create finalDefault label and combo
- finalDefaultLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
- Messages._UI_LABEL_FINALDEFAULT);
- finalDefaultCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
- finalDefaultValues,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_FINAL_DEFAULT);
-
- Dialog.applyDialogFont(parent);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- setListenerEnabled(false);
-
- if (xsdSchema != null)
- {
- if (elementFormCombo != null)
- {
- String text;
- if (xsdSchema.getElement().hasAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE))
- {
- text = xsdSchema.getElementFormDefault().getName();
- }
- else
- {
- text = emptyOption;
- }
- elementFormCombo.setText(text);
- }
-
- if (attributeFormCombo != null)
- {
- String text;
- if (xsdSchema.getElement().hasAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE))
- {
- text = xsdSchema.getAttributeFormDefault().getName();
- }
- else
- {
- text = emptyOption;
- }
- attributeFormCombo.setText(text);
- }
-
- if (blockDefaultCombo != null)
- {
- String text;
- if (xsdSchema.getElement().hasAttribute(XSDConstants.BLOCKDEFAULT_ATTRIBUTE))
- {
- text = xsdSchema.getElement().getAttribute(XSDConstants.BLOCKDEFAULT_ATTRIBUTE);
- }
- else
- {
- text = emptyOption;
- }
- blockDefaultCombo.setText(text);
- }
-
- if (finalDefaultCombo != null)
- {
- String text;
- if (xsdSchema.getElement().hasAttribute(XSDConstants.FINALDEFAULT_ATTRIBUTE))
- {
- text = xsdSchema.getElement().getAttribute(XSDConstants.FINALDEFAULT_ATTRIBUTE);
- }
- else
- {
- text = emptyOption;
- }
- finalDefaultCombo.setText(text);
- }
- }
- setListenerEnabled(true);
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (xsdSchema != null)
- {
- if (e.widget == elementFormCombo && elementFormCombo != null)
- {
- String valueElementForm = elementFormCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(),
- XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE, valueElementForm,
- Messages._UI_LABEL_ELEMENTFORMDEFAULT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
-
- if (e.widget == attributeFormCombo && attributeFormCombo != null)
- {
- String valueAttributeForm = attributeFormCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(),
- XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE, valueAttributeForm,
- Messages._UI_LABEL_ATTRIBUTEFORMDEFAULT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
-
- if (e.widget == blockDefaultCombo && blockDefaultCombo != null)
- {
- String valueBlockDefault = blockDefaultCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(),
- XSDConstants.BLOCKDEFAULT_ATTRIBUTE, valueBlockDefault, Messages._UI_LABEL_BLOCKDEFAULT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
-
- if(e.widget == finalDefaultCombo && finalDefaultCombo != null)
- {
- String finalBlockDefault = finalDefaultCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(),
- XSDConstants.FINALDEFAULT_ATTRIBUTE, finalBlockDefault, Messages._UI_LABEL_FINALDEFAULT);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java
deleted file mode 100644
index dab2646974..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.osgi.util.TextProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-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.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNamespaceInformationCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDSchemaSection extends AbstractSection
-{
- IWorkbenchPart part;
- Text prefixText;
- Text targetNamespaceText;
- Button editButton;
- StyledText errorText;
- Color red;
-
- /**
- *
- */
- public XSDSchemaSection()
- {
- super();
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createContents(Composite parent)
- {
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- GridData data = new GridData();
-
- // Create Prefix Label
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")); //$NON-NLS-1$
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- prefixLabel.setLayoutData(data);
-
- // Create Prefix Text
- prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- prefixText.setLayoutData(data);
- applyAllListeners(prefixText);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(prefixText,
- XSDEditorCSHelpIds.GENERAL_TAB__SCHEMA__PREFIX);
-
- // Create TargetNamespace Label
- CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- targetNamespaceLabel.setLayoutData(data);
-
- // Create TargetNamespace Text
- targetNamespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- targetNamespaceText.setLayoutData(data);
- applyAllListeners(targetNamespaceText);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(targetNamespaceText,
- XSDEditorCSHelpIds.GENERAL_TAB__SCHEMA__TARGETNAMESPACE);
-
- // Advanced Button
- editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), SWT.PUSH); //$NON-NLS-1$
- data = new GridData(SWT.END, SWT.CENTER, true, false);
- data.horizontalSpan = 2;
- editButton.setLayoutData(data);
- editButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(editButton,
- XSDEditorCSHelpIds.GENERAL_TAB__SCHEMA__ADVANCED);
-
- // error text
- errorText = new StyledText(composite, SWT.FLAT);
- errorText.setEditable(false);
- errorText.setEnabled(false);
- errorText.setText(""); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- data.grabExcessHorizontalSpace = true;
- errorText.setLayoutData(data);
- Dialog.applyDialogFont(parent);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- setListenerEnabled(false);
-
- Element element = xsdSchema.getElement();
-
- if (element != null)
- {
- // Handle prefixText
- TypesHelper helper = new TypesHelper(xsdSchema);
- String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-
- if (aPrefix != null && aPrefix.length() > 0)
- {
- prefixText.setText(aPrefix);
- }
- else
- {
- prefixText.setText(""); //$NON-NLS-1$
- }
-
- // Handle TargetNamespaceText
-
- if (element.hasAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
- {
- String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
- String processedString = TextProcessor.process(tns);
- targetNamespaceText.setText(processedString);
- }
- else
- {
- targetNamespaceText.setText(""); //$NON-NLS-1$
- }
- errorText.setText(""); //$NON-NLS-1$
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event)
- {
- errorText.setText(""); //$NON-NLS-1$
- String prefixValue = prefixText.getText();
- String tnsValue = targetNamespaceText.getText();
-
- Element element = xsdSchema.getElement();
- TypesHelper helper = new TypesHelper(xsdSchema);
- String currentPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
- String currentNamespace = xsdSchema.getTargetNamespace();
-
- if (tnsValue.trim().length() == 0)
- {
- if (prefixValue.trim().length() > 0)
- {
- errorText.setText(XSDEditorPlugin.getXSDString("_ERROR_TARGET_NAMESPACE_AND_PREFIX")); //$NON-NLS-1$
- int length = errorText.getText().length();
- red = new Color(null, 255, 0, 0);
- StyleRange style = new StyleRange(0, length, red, targetNamespaceText.getBackground());
- errorText.setStyleRange(style);
- return;
- }
- }
-
- if (event.widget == prefixText)
- {
- // If the prefix is the same, just return. This may happen if the
- // widget loses focus.
- if (prefixValue.equals(currentPrefix))
- return;
- updateNamespaceInfo(prefixValue, tnsValue);
- }
- else if (event.widget == targetNamespaceText)
- {
- // If the ns is the same, just return. This may happen if the
- // widget loses focus.
- if (tnsValue.equals(currentNamespace))
- return;
-
- DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(xsdSchema.getElement());
-
- Element xsdSchemaElement = xsdSchema.getElement();
- DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-
- try
- {
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
-
- if (tnsValue.trim().length() == 0 ) //remove the targetNamespace attribute
- {
- xsdSchemaElement.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
- return;
- }
-
- // Now replace the namespace for the xmlns entry
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- if (info.uri.equals(currentNamespace))
- {
- info.uri = tnsValue;
- }
- }
-
- xsdSchema.setIncrementalUpdate(false);
- // set the new xmlns entries
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, namespaceInfoList, false);
- xsdSchema.setIncrementalUpdate(true);
-
- // set the targetNamespace attribute
- xsdSchema.setTargetNamespace(tnsValue);
-
- TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, currentNamespace, tnsValue);
- targetNamespaceChangeHandler.resolve();
- }
- catch (Exception e)
- {
-
- }
- finally
- {
- try
- {
- xsdSchema.update();
- }
- finally
- {
- doc.getModel().endRecording(this);
- }
- }
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == editButton)
- {
- XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), xsdSchema.getElement(), null, xsdSchema); //$NON-NLS-1$
- nsAction.run();
- refresh();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
- {
- UpdateNamespaceInformationCommand command = new UpdateNamespaceInformationCommand(Messages._UI_ACTION_NAMESPACE_INFORMATION_CHANGE, xsdSchema, newPrefix, newTargetNamespace);
- getCommandStack().execute(command);
- }
-
- public void dispose()
- {
- if (prefixText != null && !prefixText.isDisposed())
- removeListeners(prefixText);
- if (targetNamespaceText != null && !targetNamespaceText.isDisposed())
- removeListeners(targetNamespaceText);
-
- if (red != null)
- {
- red.dispose();
- red = null;
- }
- super.dispose();
- }
-
- /**
- * @deprecated
- */
- protected boolean validatePrefix(String prefix)
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java
deleted file mode 100644
index 0e2bb218bc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSimpleTypeAdvancedSection extends AbstractSection
-{
- private static final String EMPTY = ""; //$NON-NLS-1$
- private String finalValues[] = { EMPTY, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
- XSDConstants.LIST_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG,
- XSDConstants.UNION_ELEMENT_TAG};
-
- CCombo finalCombo;
-
- public XSDSimpleTypeAdvancedSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // FinalLabel
- // ------------------------------------------------------------------
- data = new GridData();
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
-
- CLabel finalLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_FINAL);
- finalLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // FinalCombo
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- finalCombo = getWidgetFactory().createCCombo(composite);
- finalCombo.setLayoutData(data);
- finalCombo.setEditable(false);
-
- finalCombo.setItems(finalValues);
- finalCombo.addSelectionListener(this);
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- }
-
- public void refresh()
- {
- super.refresh();
-
- setListenerEnabled(false);
-
- finalCombo.setText(""); //$NON-NLS-1$);
-
- if (input instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
-
-
- if (simpleType.getElement().hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
- {
- String finalAttValue = simpleType.getElement().getAttribute(XSDConstants.FINAL_ATTRIBUTE);
- finalCombo.setText(finalAttValue);
- }
- else
- {
- finalCombo.setText(EMPTY);
- }
- }
- setListenerEnabled(true);
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == finalCombo && input != null && input instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
- String value = finalCombo.getText();
- UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(simpleType.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, Messages._UI_LABEL_FINAL);
- command.setDeleteIfEmpty(true);
- getCommandStack().execute(command);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java
deleted file mode 100644
index e3275a3feb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.xerces.util.XMLChar;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-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.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.ibm.icu.util.StringTokenizer;
-
-public class XSDSimpleTypeSection extends RefactoringSection
-{
- protected Text nameText;
- CCombo varietyCombo;
- CCombo typesCombo;
- CLabel typesLabel;
-
- XSDSimpleTypeDefinition memberTypeDefinition, itemTypeDefinition, baseTypeDefinition;
-
- public XSDSimpleTypeSection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- GridData data = new GridData();
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginTop = 0;
- gridLayout.marginBottom = 0;
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
-
- // ------------------------------------------------------------------
- // NameLabel
- // ------------------------------------------------------------------
-
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- CLabel nameLabel = factory.createCLabel(composite, Messages.UI_LABEL_NAME);
- nameLabel.setLayoutData(data);
-
- // ------------------------------------------------------------------
- // NameText
- // ------------------------------------------------------------------
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- nameText.setLayoutData(data);
- applyAllListeners(nameText);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__NAME);
-
-
- // ------------------------------------------------------------------
- // Refactor/rename hyperlink
- // ------------------------------------------------------------------
- createRenameHyperlink(composite);
-
- // Variety Label
- CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY")); //$NON-NLS-1$
-
- // Variety Combo
- data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- label.setLayoutData(data);
-
- varietyCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
-
- List list = XSDVariety.VALUES;
- Iterator iter = list.iterator();
- while (iter.hasNext())
- {
- varietyCombo.add(((XSDVariety) iter.next()).getName());
- }
- varietyCombo.addSelectionListener(this);
- varietyCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(varietyCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__VARIETY);
-
-
- // ------------------------------------------------------------------
- // DummyLabel
- // ------------------------------------------------------------------
- getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // Types Label
- // ------------------------------------------------------------------
- typesLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-
- // ------------------------------------------------------------------
- // Types Combo
- // ------------------------------------------------------------------
- typesCombo = getWidgetFactory().createCCombo(composite);
- typesCombo.setEditable(false);
- typesCombo.setLayoutData(data);
- typesCombo.addSelectionListener(this);
- typesCombo.addListener(SWT.Traverse, this);
-
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- typesCombo.setLayoutData(data);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(typesCombo,
- XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__BASE_TYPE);
-
- }
-
- protected void relayout()
- {
- Composite parentComposite = composite.getParent();
- parentComposite.getParent().setRedraw(false);
-
- if (parentComposite != null && !parentComposite.isDisposed())
- {
- Control[] children = parentComposite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].dispose();
- }
- }
-
- // Now initialize the new handler
- createContents(parentComposite);
- parentComposite.getParent().layout(true, true);
-
- // Now turn painting back on
- parentComposite.getParent().setRedraw(true);
- refresh();
- }
-
- public void refresh()
- {
- super.refresh();
-
- setListenerEnabled(false);
- showLink(!hideHyperLink);
-
- nameText.setText(""); //$NON-NLS-1$
- varietyCombo.setText(""); //$NON-NLS-1$
- typesCombo.setText(""); //$NON-NLS-1$
- fillTypesCombo();
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-
- if (input instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
- String simpleTypeName = st.getName();
- if (simpleTypeName != null)
- {
- nameText.setText(simpleTypeName);
- nameText.setEditable(true);
- }
- else
- {
- nameText.setText("**anonymous**"); //$NON-NLS-1$);
- nameText.setEditable(false);
- }
-
- String variety = st.getVariety().getName();
- int intVariety = st.getVariety().getValue();
- XSDDOMHelper domHelper = new XSDDOMHelper();
- if(domHelper.getDerivedByElementFromSimpleType(st.getElement()) != null) {
- if (variety != null)
- {
- varietyCombo.setText(variety);
- if (intVariety == XSDVariety.ATOMIC)
- {
- baseTypeDefinition = st.getBaseTypeDefinition();
- String name = ""; //$NON-NLS-1$
- if (baseTypeDefinition != null)
- {
- name = baseTypeDefinition.getName();
- if (name == null) name = "";
- }
- typesCombo.setText(name);
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
- }
- else if (intVariety == XSDVariety.LIST)
- {
- itemTypeDefinition = st.getItemTypeDefinition();
- String name = ""; //$NON-NLS-1$
- if (itemTypeDefinition != null)
- {
- name = itemTypeDefinition.getName();
- if (name == null) name = "";
- }
- typesCombo.setText(name);
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
- }
- else if (intVariety == XSDVariety.UNION)
- {
- List memberTypesList = st.getMemberTypeDefinitions();
- StringBuffer sb = new StringBuffer();
- for (Iterator i = memberTypesList.iterator(); i.hasNext();)
- {
- XSDSimpleTypeDefinition typeObject = (XSDSimpleTypeDefinition) i.next();
- String name = typeObject.getQName();
- if (name != null)
- {
- sb.append(name);
- if (i.hasNext())
- {
- sb.append(" "); //$NON-NLS-1$
- }
- }
- }
- String memberTypes = sb.toString();
- typesCombo.setText(memberTypes);
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
- }
- }
- }
- }
- setListenerEnabled(true);
-
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {
- if (e.widget == typesCombo)
- {
- String selection = typesCombo.getText();
- if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == typesCombo)
- {
- String selection = typesCombo.getText();
- if (shouldPerformComboSelection(SWT.Selection, selection))
- handleWidgetSelection(e);
- } else
- {
- handleWidgetSelection(e);
- }
- }
-
- private void handleWidgetSelection(SelectionEvent e)
- {
- if (e.widget == typesCombo)
- {
- IEditorPart editor = getActiveEditor();
- if (editor == null) return;
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);
-
- String selection = typesCombo.getText();
- ComponentSpecification newValue;
- IComponentDialog dialog= null;
- if ( selection.equals(Messages._UI_COMBO_BROWSE))
- {
- dialog = manager.getBrowseDialog();
- ((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
- }
- else if ( selection.equals(Messages._UI_COMBO_NEW))
- {
- dialog = manager.getNewDialog();
- ((NewTypeDialog) dialog).allowComplexType(false);
- }
-
- if (dialog != null)
- {
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- manager.modifyComponentReference(input, newValue);
- }
- }
- else //use the value from selected quickPick item
- {
- newValue = getComponentSpecFromQuickPickForValue(selection, manager);
- if (newValue != null)
- manager.modifyComponentReference(input, newValue);
- }
- }
- else if (e.widget == varietyCombo)
- {
- if (input != null)
- {
- if (input instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
- Element parent = st.getElement();
-
- String variety = varietyCombo.getText();
- if (variety.equals(XSDVariety.ATOMIC_LITERAL.getName()))
- {
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
- st.setVariety(XSDVariety.ATOMIC_LITERAL);
- addCreateElementActionIfNotExist(XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), parent, null); //$NON-NLS-1$
- }
- else if (variety.equals(XSDVariety.UNION_LITERAL.getName()))
- {
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
- st.setVariety(XSDVariety.UNION_LITERAL);
- addCreateElementActionIfNotExist(XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), parent, null); //$NON-NLS-1$
- }
- else if (variety.equals(XSDVariety.LIST_LITERAL.getName()))
- {
- typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
- st.setVariety(XSDVariety.LIST_LITERAL);
- addCreateElementActionIfNotExist(XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), parent, null); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- // issue (cs) this method seems to be utilizing 'old' classes, can we reimplement?
- // (e.g. ChangeElementAction, XSDDOMHelper, etc)
- protected boolean addCreateElementActionIfNotExist(String elementTag, String label, Element parent, Node relativeNode)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
- List attributes = new ArrayList();
- String reuseType = null;
-
- // beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY_CHANGE"),
- // parent); //$NON-NLS-1$
- if (elementTag.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
- {
- Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
- if (listNode != null)
- {
- if (listNode.hasAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE))
- reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
- XSDDOMHelper.removeNodeAndWhitespace(listNode);
- }
-
- Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
- if (unionNode != null)
- {
-
- if (unionNode.hasAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE))
- {
- String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
- StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
- reuseType = stringTokenizer.nextToken();
- }
- XSDDOMHelper.removeNodeAndWhitespace(unionNode);
- }
-
- if (reuseType == null)
- {
- reuseType = getBuiltInStringQName();
- }
- attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, reuseType));
- st.setItemTypeDefinition(null);
- }
- else if (elementTag.equals(XSDConstants.LIST_ELEMENT_TAG))
- {
- Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
- if (restrictionNode != null)
- {
- reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
- XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
- }
- Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
- if (unionNode != null)
- {
- String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
- if (memberAttr != null)
- {
- StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
- reuseType = stringTokenizer.nextToken();
- }
- XSDDOMHelper.removeNodeAndWhitespace(unionNode);
- }
- attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, reuseType));
- }
- else if (elementTag.equals(XSDConstants.UNION_ELEMENT_TAG))
- {
- Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
- if (listNode != null)
- {
- reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
- XSDDOMHelper.removeNodeAndWhitespace(listNode);
- }
- Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
- if (restrictionNode != null)
- {
- reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
- XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
- }
- attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, reuseType));
- st.setItemTypeDefinition(null);
- }
-
- if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
- {
- Action action = addCreateElementAction(elementTag, label, attributes, parent, relativeNode);
- action.run();
- }
-
- st.setElement(parent);
- st.updateElement();
- // endRecording(parent);
- return true;
- }
-
- protected Action addCreateElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
- {
- CreateElementAction action = new CreateElementAction(label);
- action.setElementTag(elementTag);
- action.setAttributes(attributes);
- action.setParentNode(parent);
- action.setRelativeNode(relativeNode);
- return action;
- }
-
- protected Element getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
- {
- NodeList children = parent.getChildNodes();
- Element targetNode = null;
- for (int i = 0; i < children.getLength(); i++)
- {
- Node child = children.item(i);
- if (child != null && child instanceof Element)
- {
- if (XSDDOMHelper.inputEquals(child, elementTag, isRef))
- {
- targetNode = (Element) child;
- break;
- }
- }
- }
- return targetNode;
- }
-
- protected String getBuiltInStringQName()
- {
- String stringName = "string"; //$NON-NLS-1$
-
- if (xsdSchema != null)
- {
- String schemaForSchemaPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
- {
- String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- if (prefix != null && prefix.length() > 0)
- {
- stringName = prefix + ":" + stringName; //$NON-NLS-1$
- }
- }
- }
- return stringName;
- }
-
- // TODO: Common this up with element declaration
- public void doHandleEvent(Event event)
- {
- if (event.type == SWT.Traverse) {
- if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
- isTraversing = true;
- return;
- }
- }
- if (event.widget == nameText)
- {
- if (!nameText.getEditable())
- return;
-
- String newValue = nameText.getText().trim();
- if (input instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent)input;
- if (!validateSection())
- return;
-
- Command command = null;
-
- // Make sure an actual name change has taken place
- String oldName = namedComponent.getName();
- if (!newValue.equals(oldName))
- {
- command = new UpdateNameCommand(Messages._UI_ACTION_RENAME, namedComponent, newValue);
- }
-
- if (command != null && getCommandStack() != null)
- {
- getCommandStack().execute(command);
- }
-
- }
- }
- }
-
- protected boolean validateSection()
- {
- if (nameText == null || nameText.isDisposed())
- return true;
-
- setErrorMessage(null);
-
- String name = nameText.getText().trim();
-
- // validate against NCName
- if (name.length() < 1 || !XMLChar.isValidNCName(name))
- {
- setErrorMessage(Messages._UI_ERROR_INVALID_NAME);
- return false;
- }
-
- return true;
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- super.setInput(part, selection);
- setListenerEnabled(false);
- if (input instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
- hideHyperLink = !(simpleType.getContainer() instanceof XSDSchema);
-
- }
- // Don't have to call relayout() here
- setListenerEnabled(true);
- }
-
- private void fillTypesCombo()
- {
- typesCombo.removeAll();
-
- IEditorPart editor = getActiveEditor();
- ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- if (manager != null)
- {
- ComponentSpecification[] items = manager.getQuickPicks();
-
- typesCombo.add(Messages._UI_COMBO_BROWSE);
- typesCombo.add(Messages._UI_COMBO_NEW);
-
- for (int i = 0; i < items.length; i++)
- {
- typesCombo.add(items[i].getName());
- }
-
- // Add the current Type of this attribute if needed
- XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
- XSDTypeDefinition baseType = simpleType.getBaseType();
- if (baseType != null && baseType.getQName() != null)
- {
- String currentTypeName = baseType.getQName(xsdSchema); // no prefix
- ComponentSpecification ret = getComponentSpecFromQuickPickForValue(currentTypeName, manager);
- if (ret == null && currentTypeName != null) // not in quickPick
- {
- typesCombo.add(currentTypeName);
- }
- }
- }
- }
-
- // TODO: common this up with XSDElementDeclarationSection
- private ComponentSpecification getComponentSpecFromQuickPickForValue(String value, ComponentReferenceEditManager editManager)
- {
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value != null && value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- public void dispose()
- {
- if (typesCombo != null && !typesCombo.isDisposed())
- typesCombo.removeListener(SWT.Traverse, this);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java
deleted file mode 100644
index 0b04e7b5aa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java
+++ /dev/null
@@ -1,126 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer;
-import org.w3c.dom.Element;
-
-public class XSDTableTreeViewer extends XMLTableTreeViewer
-{
-
- String filter = ""; //$NON-NLS-1$
-
- class XSDActionMenuListener implements IMenuListener
- {
- public void menuAboutToShow(IMenuManager menuManager)
- {
- // used to disable NodeSelection listening while running NodeAction
- // XSDActionManager nodeActionManager = new XSDActionManager(fModel,
- // XSDTableTreeViewer.this);
- // nodeActionManager.setCommandStack(commandStack);
- // nodeActionManager.fillContextMenu(menuManager, getSelection());
-
- // used to disable NodeSelection listening while running NodeAction
- // XMLNodeActionManager nodeActionManager = new
- // XMLNodeActionManager(((IDOMDocument) getInput()).getModel(),
- // XMLTableTreeViewer.this) {
- if (getInput() != null)
- {
- XSDActionManager nodeActionManager = new XSDActionManager(((IDOMDocument) (((Element) getInput()).getOwnerDocument())).getModel(), XSDTableTreeViewer.this);
- // nodeActionManager.setCommandStack(commandStack);
- nodeActionManager.fillContextMenu(menuManager, getSelection());
- }
-
- }
- }
-
- public XSDTableTreeViewer(Composite parent)
- {
- super(parent);
- // treeExtension.setCellModifier(null);
- getTree().setLinesVisible(true);
-
- // treeExtension = new XMLTreeExtension(getTree());
-
- // Reassign the content provider
- XMLTableTreeContentProvider provider = new MyContentProvider();
- // provider.addViewer(this);
-
- setContentProvider(provider);
- setLabelProvider(provider);
-
- // setViewerSelectionManager(new ViewerSelectionManagerImpl(null));
- }
-
- protected Object getRoot()
- {
- return super.getRoot();
- }
-
- public void setFilter(String filter)
- {
- this.filter = filter;
- }
-
- protected void createContextMenu()
- {
- // TODO Verify if this is okay to override the MenuManager
- MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
- contextMenu.add(new Separator("additions")); //$NON-NLS-1$
- contextMenu.setRemoveAllWhenShown(true);
-
- // This is the line we have to modify
- contextMenu.addMenuListener(new XSDActionMenuListener());
- Menu menu = contextMenu.createContextMenu(getControl());
- getControl().setMenu(menu);
- }
-
- boolean added = false;
-
- class MyContentProvider extends XMLTableTreeContentProvider
- {
-
- // public Object[] getChildren(Object element) {
- //
- // if (!added) {
- // if (element instanceof Element) {
- // added = true;
- // Element elem = (Element)element;
- // if (elem instanceof INodeNotifier) {
- // viewerNotifyingAdapterFactory.adapt((INodeNotifier) elem);
- // }
- // // return new Object[] {elem};
- // }
- // }
- // return super.getChildren(element);
- // }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- added = false;
- if (oldInput instanceof Element)
- oldInput = ((Element) oldInput).getOwnerDocument();
-
- if (newInput instanceof Element)
- newInput = ((Element) newInput).getOwnerDocument();
- super.inputChanged(viewer, oldInput, newInput);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddExtensionsComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddExtensionsComponentDialog.java
deleted file mode 100644
index 3b309bf7ee..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddExtensionsComponentDialog.java
+++ /dev/null
@@ -1,785 +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.wst.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.xerces.dom.DocumentImpl;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddExtensionsComponentDialog extends SelectionDialog implements ISelectionChangedListener, SelectionListener
-{
- protected static final Image DEFAULT_ELEMENT_ICON = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- protected static final Image DEFAULT_ATTRIBUTE_ICON = XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
-
- /** A temporary Document in which we create temporary DOM element for each element in the
- * Element view. (required by LabelProvider) */
- protected static Document tempDoc = new DocumentImpl();
-
- Button addButton, removeButton, editButton;
-
- public AddExtensionsComponentDialog(Shell parent, ExtensionsSchemasRegistry schemaRegistry)
- {
- super(parent);
- setTitle(Messages._UI_ACTION_ADD_EXTENSION_COMPONENTS);
- setShellStyle(SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CLOSE);
- }
-
- private List fInput;
-
- private TableViewer categoryTableViewer, elementTableViewer;
- private ArrayList existingNames;
-
- private ViewerFilter elementTableViewerFilter;
- private SpecificationForExtensionsSchema currentExtCategory;
- private HashMap specToComponentsList = new HashMap();
- private IPreferenceStore prefStore;
-
- public void setInput(List input)
- {
- this.fInput = input;
- }
-
- public SpecificationForExtensionsSchema getSelectedCategory(){
- return currentExtCategory;
- }
-
- public void setInitialCategorySelection(SpecificationForExtensionsSchema spec){
- currentExtCategory = spec;
- }
-
- protected IStructuredContentProvider getCategoryContentProvider()
- {
- return new CategoryContentProvider();
- }
-
- protected Control createDialogArea(Composite container)
- {
- Composite parent = (Composite) super.createDialogArea(container);
-
- Composite categoryComposite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- GridData data = new GridData(GridData.FILL_BOTH);
- categoryComposite.setLayoutData(data);
- categoryComposite.setLayout(gl);
-
- Label label = new Label(categoryComposite, SWT.LEFT);
- label.setText(Messages._UI_LABEL_EXTENSION_CATEGORIES);
-
- new Label(categoryComposite, SWT.NONE);
-
- categoryTableViewer = new TableViewer(categoryComposite, getTableStyle());
- categoryTableViewer.setContentProvider(getCategoryContentProvider());
- categoryTableViewer.setLabelProvider(new CategoryLabelProvider());
- categoryTableViewer.setInput(fInput);
- categoryTableViewer.addSelectionChangedListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(categoryTableViewer.getControl(), XSDEditorCSHelpIds.ADD_EXTENSIONS_COMPONENTS__EXTENSION_CATEGORIES);
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- Table table = categoryTableViewer.getTable();
- table.setLayoutData(gd);
- table.setFont(container.getFont());
-
- Composite buttonComposite = new Composite(categoryComposite, SWT.NONE);
- gl = new GridLayout();
- gl.makeColumnsEqualWidth = true;
- gl.numColumns = 1;
- data = new GridData();
- data.horizontalAlignment = SWT.FILL;
- buttonComposite.setLayoutData(data);
- buttonComposite.setLayout(gl);
-
- addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(Messages._UI_LABEL_ADD_WITH_DOTS);
- addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- addButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(addButton,
- XSDEditorCSHelpIds.ADD_EXTENSIONS_COMPONENTS__ADD);
-
- removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText(Messages._UI_LABEL_DELETE);
- removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- removeButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(removeButton,
- XSDEditorCSHelpIds.ADD_EXTENSIONS_COMPONENTS__DELETE);
-
-
- editButton = new Button(buttonComposite, SWT.PUSH);
- editButton.setText(Messages._UI_LABEL_EDIT);
- editButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- editButton.addSelectionListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(editButton,
- XSDEditorCSHelpIds.ADD_EXTENSIONS_COMPONENTS__EDIT);
-
-
- List initialSelection = getInitialElementSelections();
- if (initialSelection != null)
- categoryTableViewer.setSelection(new StructuredSelection(initialSelection));
-
- Label elementLabel = new Label(categoryComposite, SWT.LEFT);
- elementLabel.setText(Messages._UI_LABEL_AVAILABLE_COMPONENTS_TO_ADD);
-
- new Label(categoryComposite, SWT.NONE);
-
- elementTableViewer = new TableViewer(categoryComposite, getTableStyle());
- elementTableViewer.setContentProvider(new ElementContentProvider());
- elementTableViewer.setLabelProvider(new ElementLabelProvider());
- elementTableViewer.setInput(null);
- elementTableViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- okPressed();
- }
- });
- if ( elementTableViewerFilter != null){
- elementTableViewer.addFilter(elementTableViewerFilter);
- }
-
- gd = new GridData(GridData.FILL_BOTH);
- table = elementTableViewer.getTable();
- table.setLayoutData(gd);
- table.setFont(container.getFont());
-
- elementTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(elementTableViewer.getControl(), XSDEditorCSHelpIds.ADD_EXTENSIONS_COMPONENTS__AVAILABLE_COMPONENTS_TO_ADD);
-
- return parent;
- }
-
- public void create()
- {
- super.create();
- if (categoryTableViewer.getTable().getItemCount() > 0)
- {
- categoryTableViewer.getTable().select(0);
-
- StructuredSelection structuredSelection;
- if (currentExtCategory != null){
- structuredSelection = new StructuredSelection(currentExtCategory);
- }
- else{
- structuredSelection =
- new StructuredSelection(categoryTableViewer.getElementAt(0));
- }
-
- categoryTableViewer.setSelection(structuredSelection);
- }
-
- // Setup the list of category names that already exist
- // and contructs the XSDSchema for each category
- existingNames = new ArrayList();
- TableItem[] categories = categoryTableViewer.getTable().getItems();
- for (int i = 0; i < categories.length; i++ ){
- existingNames.add(categories[i].getText());
-
- SpecificationForExtensionsSchema spec =
- (SpecificationForExtensionsSchema) categories[i].getData();
- XSDSchema schema = getASISchemaModel(spec);
-
- if (schema == null)
- {
- continue;
- }
-
- List components = buildInput(schema);
- specToComponentsList.put(spec, components);
-
- // mark category as gray/empty if applicable
- Object[] remains = components.toArray();
- if ( elementTableViewerFilter != null)
- remains = elementTableViewerFilter.filter(elementTableViewer,
- elementTableViewer.getTable(), remains);
- if ( remains.length == 0)
- {
- categories[i].setForeground(
- getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
- }
- }
-
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
-
- public void addElementsTableFilter(ViewerFilter filter){
- elementTableViewerFilter = filter;
- }
-
- public void setPrefStore(IPreferenceStore prefStore)
- {
- this.prefStore = prefStore;
- }
-
- protected Point getInitialSize()
- {
- return getShell().computeSize(400, 300);
- }
-
- /**
- * Return the style flags for the table viewer.
- *
- * @return int
- */
- protected int getTableStyle()
- {
- return SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
- }
-
- /*
- * Overrides method from Dialog
- */
- protected void okPressed()
- {
- // Build a list of selected children.
- getShell().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
- IStructuredSelection elementSelection = (IStructuredSelection) elementTableViewer.getSelection();
- IStructuredSelection categorySelection = (IStructuredSelection) categoryTableViewer.getSelection();
- List result = new ArrayList();
- result.add(elementSelection.getFirstElement());
- result.add(categorySelection.getFirstElement());
- if (elementSelection.getFirstElement() != null)
- {
- setResult(result);
- }
- else
- {
- setResult(null);
- }
- super.okPressed();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == addButton)
- {
- AddNewCategoryDialog addNewCategoryDialog
- = new AddNewCategoryDialog(getShell());
-
- addNewCategoryDialog.setUnavailableCategoryNames(existingNames);
-
- if ( addNewCategoryDialog.open() == Window.OK ){
- SpecificationForExtensionsSchema schemaSpec =
- new SpecificationForExtensionsSchema();
- schemaSpec.setDisplayName(addNewCategoryDialog.getNewCategoryName() );
- schemaSpec.setLocation(addNewCategoryDialog.getCategoryLocation() );
- schemaSpec.setSourceHint(addNewCategoryDialog.getSource());
- schemaSpec.setFromCatalog(addNewCategoryDialog.getFromCatalog() );
-
- fInput.add(schemaSpec);
- existingNames.add(schemaSpec.getDisplayName());
-
- // refresh without updating labels of existing TableItems
- categoryTableViewer.refresh(false);
-
- categoryTableViewer.setSelection(new StructuredSelection(schemaSpec));
- getButton(IDialogConstants.OK_ID).setEnabled(false);
-
- storeSpecInPref(schemaSpec); // must store after selection changed is called ie. 2 lines above (trung)
- }
- }
- else if (e.widget == removeButton)
- {
- TableItem[] selections = categoryTableViewer.getTable().getSelection();
- for (int i =0; i < selections.length; i++){
- SpecificationForExtensionsSchema spec =
- (SpecificationForExtensionsSchema) selections[i].getData();
-
- fInput.remove(spec );
- existingNames.remove(spec.getDisplayName());
- specToComponentsList.remove(spec);
-
- removeFromPref(spec);
- }
- categoryTableViewer.refresh(false);
-
- elementTableViewer.setInput(null);
- elementTableViewer.refresh();
-
- // TODO auto select either the prev category, the next category or the first category in the Table
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else if (e.widget == editButton)
- {
- // use this dialog not for adding but for editing purpose.
- AddNewCategoryDialog dialog = new AddNewCategoryDialog(getShell(), Messages._UI_LABEL_EDIT_CATEGORY);
-
- TableItem[] selections = categoryTableViewer.getTable().getSelection();
- if (selections.length == 0)
- return;
-
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema) selections[0].getData();
-
- String displayName = spec.getDisplayName();
-
- dialog.setCategoryName(displayName );
- dialog.setFromCatalog(spec.isFromCatalog() );
- dialog.setSource(spec.getSourceHint() );
- dialog.setCategoryLocation(spec.getLocation() );
-
- specToComponentsList.remove(spec);
- dialog.setUnavailableCategoryNames(existingNames);
-
- if ( dialog.open() == Window.OK){
- existingNames.remove(displayName);
- String newDisplayName = dialog.getNewCategoryName();
-
- spec.setDisplayName(newDisplayName);
- spec.setLocation(dialog.getCategoryLocation());
- spec.setSourceHint(dialog.getSource());
- spec.setFromCatalog(dialog.getFromCatalog());
- spec.setNamespaceURI(null);
-
- existingNames.add(newDisplayName);
-
- categoryTableViewer.update(spec, null);
- refreshElementsViewer(spec);
-
- editSpecInPref(displayName, spec);
- }
- }
- }
-
-/*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent event)
- {
-
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (event.getSource() == categoryTableViewer)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection)
- {
- Object obj = ((StructuredSelection) selection).getFirstElement();
- if (obj instanceof SpecificationForExtensionsSchema)
- {
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema) obj;
- currentExtCategory = spec;
- refreshElementsViewer(spec);
-
- if ( spec.isDefautSchema() ){
- editButton.setEnabled(false);
- removeButton.setEnabled(false);
- }
- else{
- editButton.setEnabled(true);
- removeButton.setEnabled(true);
- }
-
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- }
- }
- }
-
- private void refreshElementsViewer(SpecificationForExtensionsSchema spec) {
- List components = (List) specToComponentsList.get(spec);
- if ( components != null){
- elementTableViewer.setInput(components);
- return;
- }
-
- XSDSchema xsdSchema = getASISchemaModel(spec);
-
- if (xsdSchema == null){
- MessageBox errDialog = new MessageBox(getShell(), SWT.ICON_ERROR);
- errDialog.setText(Messages._UI_ERROR_INVALID_CATEGORY);
- // TODO (trung) I was forced to use a String in Messages to make the error clearer
- // When we are back to development phase, use another string: "Extension Category: "
- // not "Extension Categories:" + " " like we are using here
- errDialog.setMessage(Messages._UI_LABEL_EXTENSION_CATEGORIES + " " + spec.getDisplayName() //$NON-NLS-1$
- + "\n" //$NON-NLS-1$
- + Messages._UI_ERROR_FILE_CANNOT_BE_PARSED
- + "\n" + Messages._UI_ERROR_VALIDATE_THE_FILE); //$NON-NLS-1$
- errDialog.open();
-
- elementTableViewer.setInput(new ArrayList(0));
- return;
- }
-
- components = buildInput(xsdSchema);
- specToComponentsList.put(spec, components);
-
- List allItems = buildInput(xsdSchema);
- if ( allItems == null )
- return;
- elementTableViewer.setInput(allItems);
- }
-
- private static List buildInput(XSDSchema xsdSchema)
- {
- if ( xsdSchema ==null )
- return null;
-
- List elements = xsdSchema.getElementDeclarations();
- List attributes = xsdSchema.getAttributeDeclarations();
- String targetNamespace = xsdSchema.getTargetNamespace();
-
- // For safety purpose: We don't append 'attributes' to 'elements'
- // ArrayStoreException(or similar one) may occur
- List allItems = new ArrayList(attributes.size() + elements.size());
-
- {
- // getElementDeclarations returns a lot of elements from import
- // statement, we
- // only add non-imported elements here. (trung)
- for (int i = 0; i < elements.size(); i++)
- {
- XSDElementDeclaration currentElement = (XSDElementDeclaration) elements.get(i);
- if (currentElement.getTargetNamespace() != null)
- {
- if (currentElement.getTargetNamespace().equals(targetNamespace))
- allItems.add(currentElement);
- }
- else
- {
- if (targetNamespace == null)
- allItems.add(currentElement);
- }
- }
- // getAttributeDeclarations also returns a lot of elements from
- // import statement, we
- // only add non-imported elements here. (trung)
- for (int i = 0; i < attributes.size(); i++)
- {
- XSDAttributeDeclaration currentAttribute = (XSDAttributeDeclaration) attributes.get(i);
- if (currentAttribute.getTargetNamespace() != null)
- {
- if (currentAttribute.isGlobal() && currentAttribute.getTargetNamespace().equals(targetNamespace))
- allItems.add(currentAttribute);
- }
- else
- {
- if (targetNamespace == null)
- allItems.add(currentAttribute);
- }
- }
- }
- return allItems;
- }
-
-
- private static XSDSchema getASISchemaModel(SpecificationForExtensionsSchema extensionsSchemaSpec)
- {
- String location = extensionsSchemaSpec.getLocation();
- if ( location == null)
- return null;
- XSDSchema xsdSchema = XSDImpl.buildXSDModel(location);
-
- // now that the .xsd file is read, we can retrieve the namespace of this xsd file
- // and set the namespace for 'properties'
- if ( extensionsSchemaSpec.getNamespaceURI() == null){
- extensionsSchemaSpec.setNamespaceURI( xsdSchema.getTargetNamespace());
- }
-
- return xsdSchema;
- }
-
- private void storeSpecInPref(SpecificationForExtensionsSchema schemaSpec) {
- if (prefStore == null)
- return;
-
- String currentValue = prefStore.getString(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS);
- String specDesc = " " + "\t" + schemaSpec.getDisplayName() + "\t"+
- schemaSpec.getNamespaceURI() + "\t" + schemaSpec.getLocation() + "\t" +
- schemaSpec.isDefautSchema() + "\t" + schemaSpec.getSourceHint() + "\t" +
- schemaSpec.isFromCatalog();
- currentValue += specDesc + "\n";
-
- prefStore.setValue(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS,
- currentValue);
- }
-
- private void editSpecInPref(String displayName, SpecificationForExtensionsSchema newSpec) {
- if (prefStore == null)
- return;
-
- String newValue = "";
- String currentValue = prefStore.getString(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS);
- StringTokenizer tokenizer = new StringTokenizer(currentValue, "\n");
-
- while (tokenizer.hasMoreTokens())
- {
- String oneSpecDesc = tokenizer.nextToken();
- // get the Display name
- StringTokenizer _tokenizer_2 = new StringTokenizer(oneSpecDesc, "\t");
- _tokenizer_2.nextToken();
- String dName = _tokenizer_2.nextToken();
-
- if ( dName.equals(displayName ) )
- {
- oneSpecDesc = " " + "\t" + newSpec.getDisplayName() + "\t"+
- newSpec.getNamespaceURI() + "\t" + newSpec.getLocation() + "\t" +
- newSpec.isDefautSchema() + "\t" + newSpec.getSourceHint() + "\t" +
- newSpec.isFromCatalog();
- }
-
- newValue += oneSpecDesc + "\n";
- }
- prefStore.setValue(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS, newValue);
-
- }
-
- private void removeFromPref(SpecificationForExtensionsSchema spec) {
- if (prefStore == null)
- return;
-
- String newValue = "";
- String currentValue = prefStore.getString(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS);
- StringTokenizer tokenizer = new StringTokenizer(currentValue, "\n");
-
- while (tokenizer.hasMoreTokens())
- {
- String oneSpecDesc = tokenizer.nextToken();
- // get the Display name
- StringTokenizer _tokenizer_2 = new StringTokenizer(oneSpecDesc, "\t");
- _tokenizer_2.nextToken();
- String dName = _tokenizer_2.nextToken();
-
- if ( dName.equals(spec.getDisplayName() ) )
- continue;
- newValue += oneSpecDesc + "\n";
- }
- prefStore.setValue(ExtensionsSchemasRegistry.USER_ADDED_EXT_SCHEMAS, newValue);
- }
-
-static class CategoryContentProvider implements IStructuredContentProvider
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- SpecificationForExtensionsSchema[] extensionsSchemaSpecs = null;
- try
- {
- List inputList = (List) inputElement;
- extensionsSchemaSpecs = (SpecificationForExtensionsSchema[]) inputList.toArray(new SpecificationForExtensionsSchema[0]);
- }
- catch (Exception e)
- {
- }
- return extensionsSchemaSpecs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- // Do nothing
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- // Do nothing
-
- }
- }
-
- static class CategoryLabelProvider extends LabelProvider
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element)
- {
- return XSDEditorPlugin.getXSDImage("icons/appinfo_category.gif"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element)
- {
- if (element instanceof SpecificationForExtensionsSchema)
- return ((SpecificationForExtensionsSchema) element).getDisplayName();
-
- return super.getText(element);
- }
- }
-
- static class ElementContentProvider implements IStructuredContentProvider
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof List)
- {
- return ((List) inputElement).toArray();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- // Do nothing
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- // Do nothing
-
- }
- }
-
- class ElementLabelProvider extends LabelProvider
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element)
- {
- if ( element instanceof XSDElementDeclaration){
-
- // Workaround trick: (trung) we create a temporary Dom element and put it in the label provider
- // to get the image.
- String namespace = ((XSDElementDeclaration) element).getSchema().getTargetNamespace();
- String name = ((XSDElementDeclaration) element).getName();
- Element tempElement = tempDoc.createElementNS(namespace, name);
- ILabelProvider lp = XSDEditorPlugin.getDefault().getNodeCustomizationRegistry().getLabelProvider(namespace);
- if (lp != null){
- Image img = lp.getImage(tempElement);
-
- if (img != null){
- return img;
- }
- }
- return DEFAULT_ELEMENT_ICON;
- }
- else if ( element instanceof XSDAttributeDeclaration){
- return DEFAULT_ATTRIBUTE_ICON;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element)
- {
- if (element instanceof XSDElementDeclaration)
- return ((XSDElementDeclaration) element).getName();
- if (element instanceof XSDAttributeDeclaration )
- return ((XSDAttributeDeclaration) element).getName();
- return super.getText(element);
- }
- }
-
- public boolean close()
- {
- return super.close();
- }
-
- protected void enableButtons(boolean value)
- {
- editButton.setEnabled(value);
- addButton.setEnabled(value);
- removeButton.setEnabled(value);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java
deleted file mode 100644
index 5356877a48..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class AddNewCategoryDialog extends Dialog
-{
- private static final String SCHEMA_LABEL = Messages._UI_LABEL_SCHEMA;
- private static final String NAME_LABEL = Messages._UI_LABEL_NAME;
- private static final String SELECT_FROM_WORKSPACE = Messages._UI_LABEL_WORKSPACE;
- private static final String SELECT_FROM_CATALOG = Messages._UI_LABEL_CATALOG;
- private String dialogTitle = Messages._UI_LABEL_ADD_CATEGORY;
-
- protected MenuManager browseMenu;
- protected Label name;
- protected Text nameText;
- protected Label schema;
- protected CLabel schemaDisplayer;
- protected ToolBar browseToolBar;
- protected ToolItem browseItem;
- protected Button searchCatalog;
- protected Button searchWorkspace;
- protected Composite sourcesComposite;
-
- protected List invalidNames;
-
- // TODO (cs) rename this field to extensionSchemaLocation in WTP 2.0
- protected String appInfoSchemaLocation;
- protected String categoryName;
- protected CLabel errDisplayer;
- protected boolean isCategoryNameValid;
- protected boolean fromCatalog;
-
- private boolean canOK =false;
-
- /** Either the location if come from workspace or namespace if come from
- * XML Catalog */
- protected String source;
-
- public AddNewCategoryDialog(Shell parentShell)
- {
- super(parentShell);
- }
-
- public AddNewCategoryDialog(Shell parentShell, String dialogTitle)
- {
- super(parentShell);
- this.dialogTitle = dialogTitle;
- }
-
- /**
- * receive a List of names which have already been added to the category list
- *
- * @param unavailNames
- * Array of unvailable names
- */
- public void setUnavailableCategoryNames(List unavailNames)
- {
- invalidNames = unavailNames;
- }
-
- public String getNewCategoryName()
- {
- return categoryName.trim();
- }
-
- public String getCategoryLocation()
- {
- return appInfoSchemaLocation;
- }
-
- public void setCategoryLocation(String s){
- appInfoSchemaLocation = s;
- }
-
- /** @deprecated */
- public SpecificationForExtensionsSchema getExtensionsSchemaSpec(){
- SpecificationForExtensionsSchema schemaSpec = new SpecificationForExtensionsSchema();
- schemaSpec.setDisplayName(getNewCategoryName());
- schemaSpec.setLocation(getCategoryLocation());
-
- return schemaSpec;
- }
-
- public void setCategoryName(String categoryName) {
- this.categoryName = categoryName;
- }
-
- public boolean getFromCatalog() {
- return fromCatalog;
- }
-
- public void setFromCatalog(boolean b){
- fromCatalog = b;
- }
-
- public String getSource()
- {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- protected Control createButtonBar(Composite parent)
- {
- Control result = super.createButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(canOK);
- return result;
- }
-
- // redundant method to improve speed (according to the compiler)
- protected Button getButton(int id) {
- return super.getButton(id);
- }
-
- protected Control createDialogArea(Composite parent)
- {
- getShell().setText(dialogTitle);
-
- Composite mainComposite = (Composite) super.createDialogArea(parent);
- GridLayout layout = new GridLayout(2, false);
- layout.marginTop = 10;
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridData data = new GridData();
- data.widthHint = 400;
-
- mainComposite.setLayoutData(data);
-
- // Line 1, name
- name = new Label(mainComposite, SWT.NONE);
- name.setText(NAME_LABEL);
-
- nameText = new Text(mainComposite, SWT.BORDER | SWT.SINGLE);
- nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- if (categoryName != null)
- nameText.setText(categoryName);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
- XSDEditorCSHelpIds.ADD_CATEGORY__NAME);
-
-
-
- // Line 2, schema
- schema = new Label(mainComposite, SWT.NONE);
- schema.setText(SCHEMA_LABEL);
-
- schemaDisplayer = new CLabel(mainComposite, SWT.BORDER | SWT.SINGLE);
- schemaDisplayer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- if (source != null)
- {
- if (fromCatalog)
- schemaDisplayer.setImage(
- XSDEditorPlugin.getXSDImage("icons/xmlcatalog_obj.gif")); //$NON-NLS-1$
- else
- schemaDisplayer.setImage(
- XSDEditorPlugin.getXSDImage("icons/XSDFile.gif")); //$NON-NLS-1$
- schemaDisplayer.setText(source);
-
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(schemaDisplayer,
- XSDEditorCSHelpIds.ADD_CATEGORY__SCHEMA);
-
- if (categoryName != null && source != null)
- canOK = true;
-
- // Line 3, schema selection buttons
- Button hidden = new Button(mainComposite, SWT.NONE);
- hidden.setVisible(false);
-
- sourcesComposite = new Composite(mainComposite, SWT.NONE);
- RowLayout sourcesLayout = new RowLayout();
-
- sourcesComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
- sourcesComposite.setLayout(sourcesLayout);
-
- searchWorkspace = new Button(sourcesComposite, SWT.NONE);
- searchWorkspace.setText(SELECT_FROM_WORKSPACE);
-
- searchCatalog = new Button(sourcesComposite, SWT.NONE);
- searchCatalog.setText(SELECT_FROM_CATALOG);
-
- searchWorkspace.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- final String XSD_FILE_EXTENSION = ".xsd"; //$NON-NLS-1$
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
- dialog.addFilterExtensions(new String[] { XSD_FILE_EXTENSION });
- dialog.create();
- dialog.setTitle(Messages._UI_LABEL_SELECT_XSD_FILE);
- dialog.setMessage(Messages._UI_DESCRIPTION_CHOOSE_XSD_FILE);
-
- if (dialog.open() == Window.OK)
- {
- IFile appInfoSchemaFile = dialog.getFile();
- if (appInfoSchemaFile != null)
- {
- // remove leading slash from the value to avoid the
- // whole leading slash ambiguity problem
- String uri = appInfoSchemaFile.getFullPath().toString();
- while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
- uri = uri.substring(1);
- }
- appInfoSchemaLocation = uri.toString();
- source = uri;
- fromCatalog = false;
-
- appInfoSchemaLocation = "file://" + Platform.getLocation().toString() + "/" + appInfoSchemaLocation; //$NON-NLS-1$ //$NON-NLS-2$
- // TODO... be careful how we construct the location
- // UNIX related issues here
-
- schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/XSDFile.gif")); //$NON-NLS-1$
- schemaDisplayer.setText(uri);
-
- // Enable the OK button if we should..
- if (isCategoryNameValid)
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- errDisplayer.setText(""); //$NON-NLS-1$
- errDisplayer.setImage(null);
- }
- }
- }
- }
- }
-
- );
-
- searchCatalog.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- SelectFromCatalogDialog dialog = new SelectFromCatalogDialog(getShell());
- // dialog.open();
- if (dialog.open() == Window.OK)
- {
- appInfoSchemaLocation = dialog.getCurrentSelectionLocation();
- source = dialog.getCurrentSelectionNamespace();
- fromCatalog = true;
-
- schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/xmlcatalog_obj.gif")); //$NON-NLS-1$
- schemaDisplayer.setText(dialog.getCurrentSelectionNamespace());
-
- // Enable the OK button if we should..
- if (isCategoryNameValid && !appInfoSchemaLocation.equals("")) //$NON-NLS-1$
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- errDisplayer.setText(""); //$NON-NLS-1$
- errDisplayer.setImage(null);
- }
- }
- }
- });
-
-
- // TODO: Should be able to get the image from the XML plugin. Don't need
- // to copy to XSDEditor icons folder like this.
-
-
- // Composite errComp = new Composite(mainComposite, SWT.NONE);
- // errComp.setBackground(org.eclipse.draw2d.ColorConstants.white);
- // errComp.setLayout(new GridLayout());
- errDisplayer = new CLabel(mainComposite, SWT.FLAT);
- // errDisplayer.setText("abd");
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan = 3;
- errDisplayer.setLayoutData(gd);
-
- // errComp.setLayoutData(gd);
- // errDisplayer.setLayoutData(gd);
- // errMsgContainer.setContent(errDisplayer);
-
- nameText.addModifyListener(new ModifyListener()
- {
- // track the nameText and enable/disable the OK button accordingly
- public void modifyText(ModifyEvent e)
- {
- categoryName = nameText.getText();
-
- // name is in the invalid List
- if (invalidNames != null)
- {
- if (invalidNames.contains(categoryName.trim()))
- {
- isCategoryNameValid = false;
-
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- errDisplayer.setText(Messages._UI_ERROR_NAME_ALREADY_USED);
- errDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/error_st_obj.gif")); //$NON-NLS-1$
- return;
- }
- }
- // name is empty string
- if (categoryName.equals("")) //$NON-NLS-1$
- {
- isCategoryNameValid = false;
-
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- errDisplayer.setText(""); //$NON-NLS-1$
- errDisplayer.setImage(null);
- return;
- }
-
- /*
- * Enable the Ok button if the location field AND the name field are not
- * empty
- */
- if (!categoryName.equals("")) //$NON-NLS-1$
- {
- isCategoryNameValid = true;
- errDisplayer.setText(""); //$NON-NLS-1$
- errDisplayer.setImage(null);
- }
- if (appInfoSchemaLocation != null && !appInfoSchemaLocation.equals("")) //$NON-NLS-1$
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- }
- });
-
- return parent;
- }
-
- protected void okPressed()
- {
- super.okPressed();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/CategoryProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/CategoryProvider.java
deleted file mode 100644
index a3eb64a376..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/CategoryProvider.java
+++ /dev/null
@@ -1,81 +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.wst.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-public class CategoryProvider
-{
- private ICatalog systemCatalog;
-
- public CategoryProvider()
- {
-
- }
-
- /**
- * Extenders should implement and return a list of
- * SpecificationForExtensionsSchema
- * @return
- */
- public List getCategories()
- {
- return new ArrayList();
- }
-
- /**
- * Helper method to find the physical location of the schema
- * in the XML Catalog
- * @param namespaceURI
- * @return physical location of the schema
- */
- public String locateFileUsingCatalog(String namespaceURI)
- {
- retrieveCatalog();
-
- ICatalogEntry[] entries = systemCatalog.getCatalogEntries();
- for (int i = 0; i < entries.length; i++)
- {
- if (entries[i].getKey().equals(namespaceURI))
- return entries[i].getURI();
- }
-
- return null;
- }
-
- private void retrieveCatalog()
- {
- if (systemCatalog != null)
- return;
-
- ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++)
- {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null)
- {
- if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId()))
- {
- systemCatalog = referencedCatalog;
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java
deleted file mode 100644
index f28e18acbe..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java
+++ /dev/null
@@ -1,211 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.tabletree.TreeContentHelper;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.DefaultListNodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class DOMExtensionDetailsContentProvider implements ExtensionDetailsContentProvider
-{
- private static final Object[] EMPTY_ARRAY = {};
- private static final String[] EMPTY_STRING_ARRAY = {};
- private static final String XMLNS = "xmlns"; //$NON-NLS
- private static final String TEXT_NODE_KEY = "text()"; //$NON-NLS
-
- public Object[] getItems(Object input)
- {
- HashMap resultMap = new HashMap();
- if (input instanceof Element)
- {
- Element element = (Element) input;
-
- // here we compute items for the attributes that physically in the document
- //
- NamedNodeMap attributes = element.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++)
- {
- Attr attr = (Attr) attributes.item(i);
- if (!XMLNS.equals(attr.getName()) && !XMLNS.equals(attr.getPrefix())) //$NON-NLS-1$ //$NON-NLS-2$
- {
- resultMap.put(attr.getName(), DOMExtensionItem.createItemForElementAttribute(element, attr));
- }
- }
-
- // here we compute an item for the text node that is physically in the document
- //
- String textNodeValue = new TreeContentHelper().getNodeValue(element);
- if (textNodeValue != null)
- {
- resultMap.put(TEXT_NODE_KEY, DOMExtensionItem.createItemForElementText(element));
- }
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null)
- {
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
- if (ed != null)
- {
- // here we compute items for the attributes that may be added to the document according to the grammar
- //
- List list = modelQuery.getAvailableContent(element, ed, ModelQuery.INCLUDE_ATTRIBUTES);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- CMAttributeDeclaration ad = (CMAttributeDeclaration)i.next();
- if (ad != null && resultMap.get(ad.getNodeName()) == null)
- {
- resultMap.put(ad.getNodeName(), DOMExtensionItem.createItemForElementAttribute(element, ad));
- }
- }
- if (resultMap.get(TEXT_NODE_KEY) == null)
- {
- // here we compute an item for the text node that may be added to the document according to the grammar
- //
- int contentType = ed.getContentType();
- if (contentType == CMElementDeclaration.PCDATA || contentType == CMElementDeclaration.MIXED)
- {
- resultMap.put(TEXT_NODE_KEY, DOMExtensionItem.createItemForElementText(element));
- }
- }
- }
- }
- Collection collection = resultMap.values();
- // initialize the editor information for each item
- //
- for (Iterator i = collection.iterator(); i.hasNext();)
- {
- initPropertyEditorConfiguration((DOMExtensionItem) i.next());
- }
- DOMExtensionItem[] items = new DOMExtensionItem[collection.size()];
- resultMap.values().toArray(items);
-
- // here we sort the list alphabetically
- //
- if (items.length > 0)
- {
- Comparator comparator = new Comparator()
- {
- public int compare(Object arg0, Object arg1)
- {
- DOMExtensionItem a = (DOMExtensionItem)arg0;
- DOMExtensionItem b = (DOMExtensionItem)arg1;
-
- // begin special case to ensure 'text nodes' come last
- if (a.isTextValue() && !b.isTextValue())
- {
- return 1;
- }
- else if (b.isTextValue() && !a.isTextValue())
- {
- return -1;
- }
- // end special case
- else
- {
- return Collator.getInstance().compare(a.getName(), b.getName());
- }
- }
- };
- Arrays.sort(items, comparator);
- }
- return items;
- }
- else if (input instanceof Attr)
- {
- Attr attr = (Attr) input;
- DOMExtensionItem item = DOMExtensionItem.createItemForAttributeText(attr.getOwnerElement(), attr);
- DOMExtensionItem[] items = {item};
- return items;
- }
- return EMPTY_ARRAY;
- }
-
- public String getName(Object item)
- {
- if (item instanceof DOMExtensionItem)
- {
- return ((DOMExtensionItem) item).getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- public String getValue(Object item)
- {
- if (item instanceof DOMExtensionItem)
- {
- return ((DOMExtensionItem) item).getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public String[] getPossibleValues(Object item)
- {
- if (item instanceof DOMExtensionItem)
- {
- return ((DOMExtensionItem) item).getPossibleValues();
- }
- return EMPTY_STRING_ARRAY;
- }
-
- protected void initPropertyEditorConfiguration(DOMExtensionItem item)
- {
- String namespace = item.getNamespace();
- String name = item.getName();
- String parentName = item.getParentName();
- NodeEditorConfiguration configuration = null;
- if (namespace != null)
- {
- // TODO (cs) remove reference to XSDEditorPlugin... make generic
- // perhaps push down the xml.ui ?
- //
- NodeCustomizationRegistry registry = XSDEditorPlugin.getDefault().getNodeCustomizationRegistry();
- NodeEditorProvider provider= registry.getNodeEditorProvider(namespace);
- if (provider != null)
- {
- configuration = provider.getNodeEditorConfiguration(parentName, name);
- if (configuration != null)
- {
- configuration.setParentNode(item.getParentNode());
- if (item.getNode() != null)
- {
- configuration.setNode(item.getNode());
- }
- }
- }
- }
- String[] values = item.getPossibleValues();
- if (values != null && values.length > 1)
- {
- configuration = new DefaultListNodeEditorConfiguration(values);
- }
-
- // Note that it IS expected that the configaration may be null
- //
- item.setPropertyEditorConfiguration(configuration);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItem.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItem.java
deleted file mode 100644
index 52505251b2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItem.java
+++ /dev/null
@@ -1,226 +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.xsd.ui.internal.common.properties.sections.appinfo;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.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.ui.internal.tabletree.TreeContentHelper;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTextValueCommand;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-class DOMExtensionItem extends ExtensionItem
-{
- private final static int KIND_ELEMENT_ATTR = 1;
- private final static int KIND_ELEMENT_TEXT = 2;
- private final static int KIND_ELEMENT_CMATTRIBUTE = 3;
- private final static int KIND_ATTR_TEXT = 4;
- int kind;
- Attr attribute;
- Element parent;
- CMNode cmNode;
-
- private DOMExtensionItem(int kind, Element parent, Attr node, CMNode cmNode)
- {
- this.kind = kind;
- this.parent = parent;
- this.attribute = node;
- this.cmNode = cmNode;
- }
-
- public boolean isTextValue()
- {
- return kind == KIND_ELEMENT_TEXT || kind == KIND_ATTR_TEXT;
- }
-
- static DOMExtensionItem createItemForElementText(Element parent)
- {
- return new DOMExtensionItem(KIND_ELEMENT_TEXT, parent, null, null);
- }
-
- static DOMExtensionItem createItemForElementAttribute(Element parent, Attr attribute)
- {
- return new DOMExtensionItem(KIND_ELEMENT_ATTR, parent, attribute, null);
- }
-
- static DOMExtensionItem createItemForElementAttribute(Element parent, CMAttributeDeclaration ad)
- {
- if (ad == null)
- {
- System.out.println("null!");
- }
- return new DOMExtensionItem(KIND_ELEMENT_CMATTRIBUTE, parent, null, ad);
- }
-
- static DOMExtensionItem createItemForAttributeText(Element parent, Attr attribute)
- {
- return new DOMExtensionItem(KIND_ATTR_TEXT, parent, attribute, null);
- }
-
- public String getName()
- {
- String result = null;
- switch (kind)
- {
- case KIND_ATTR_TEXT : {
- result = "value";
- break;
- }
- case KIND_ELEMENT_ATTR : {
- result = attribute.getName();
- break;
- }
- case KIND_ELEMENT_CMATTRIBUTE : {
- CMAttributeDeclaration ad = (CMAttributeDeclaration) cmNode;
- result = ad.getNodeName();
- break;
- }
- case KIND_ELEMENT_TEXT : {
- result = "text value";
- break;
- }
- }
- return result != null ? result : "";
- }
-
- public String getValue()
- {
- switch (kind)
- {
- case KIND_ATTR_TEXT :
- case KIND_ELEMENT_ATTR : {
- // note intentional fall-thru!!
- return attribute.getNodeValue();
- }
- case KIND_ELEMENT_CMATTRIBUTE : {
- // CS : one would think that we'd just need to return "" here
- // but after editing a item of this kind and giving it value
- // the list of item's doesn't get recomputed.. so we need to trick
- // one of these items to behave like the KIND_ELEMENT_ATTR case
- //
- String value = parent.getAttribute(cmNode.getNodeName());
- return (value != null) ? value : "";
- }
- case KIND_ELEMENT_TEXT : {
- return new TreeContentHelper().getElementTextValue(parent);
- }
- }
- return "";
- }
-
-
- public String[] getPossibleValues()
- {
- String[] result = {};
-
- switch (kind)
- {
- case KIND_ATTR_TEXT :
- case KIND_ELEMENT_ATTR : {
- // note intentional fall-thru!!
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- if (modelQuery != null)
- {
- CMAttributeDeclaration ad = modelQuery.getCMAttributeDeclaration(attribute);
- if (ad != null)
- {
- result = modelQuery.getPossibleDataTypeValues(parent, ad);
- }
- }
- break;
- }
- case KIND_ELEMENT_CMATTRIBUTE : {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- if (modelQuery != null && cmNode != null)
- {
- result = modelQuery.getPossibleDataTypeValues(parent, cmNode);
- }
- break;
- }
- case KIND_ELEMENT_TEXT : {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- if (modelQuery != null)
- {
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(parent);
- if (ed != null)
- {
- result = modelQuery.getPossibleDataTypeValues(parent, ed);
- }
- }
- break;
- }
- }
- return result;
- }
-
- public Command getUpdateValueCommand(String newValue)
- {
- switch (kind)
- {
- case KIND_ATTR_TEXT :
- case KIND_ELEMENT_ATTR : {
- // note intentional fall-thru!!
- return new UpdateAttributeValueCommand(parent, attribute.getNodeName(), newValue, true);
- }
- case KIND_ELEMENT_CMATTRIBUTE : {
- final CMAttributeDeclaration ad = (CMAttributeDeclaration) cmNode;
- return new UpdateAttributeValueCommand(parent, ad.getAttrName(), newValue, true);
- }
- case KIND_ELEMENT_TEXT : {
- return new UpdateTextValueCommand(parent, newValue);
- }
- }
- return null;
- }
-
- public String getNamespace()
- {
- String namespace = null;
- if (kind == KIND_ATTR_TEXT)
- {
- namespace = attribute.getNamespaceURI();
- }
- else if (parent != null)
- {
- namespace = parent.getNamespaceURI();
- }
- return namespace;
- }
-
- public Node getParentNode()
- {
- Node parentNode = null;
- if (attribute != null)
- {
- parentNode = attribute.getOwnerElement();
- }
- else if (parent != null)
- {
- parentNode = parent;
- }
- return parentNode;
- }
-
- public String getParentName()
- {
- Node parentNode = getParentNode();
- return parentNode != null ? parentNode.getLocalName() : "";
- }
-
- public Node getNode()
- {
- return attribute;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java
deleted file mode 100644
index aac70ea719..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java
+++ /dev/null
@@ -1,50 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * @deprecated
- */
-public class DOMExtensionItemEditManager implements ExtensionItemEditManager
-{
- public void handleEdit(Object item, Widget widget)
- {
- }
-
- public Control createCustomButtonControl(Composite composite, Object item)
- {
- Button button = new Button(composite, SWT.NONE);
- button.setText("..."); //$NON-NLS-1$
- return button;
- }
-
- public Control createCustomTextControl(Composite composite, Object item)
- {
- return null;
- }
-
- public String getButtonControlStyle(Object object)
- {
- return ExtensionItemEditManager.STYLE_NONE;
- }
-
- public String getTextControlStyle(Object object)
- {
- return ExtensionItemEditManager.STYLE_NONE;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java
deleted file mode 100644
index fc30c94d0e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java
+++ /dev/null
@@ -1,127 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class DOMExtensionItemMenuListener implements IMenuListener
-{
- TreeViewer treeViewer;
-
- public DOMExtensionItemMenuListener(TreeViewer treeViewer)
- {
- this.treeViewer = treeViewer;
- }
-
- public void menuAboutToShow(IMenuManager manager)
- {
- manager.removeAll();
- ISelection selection = treeViewer.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- if (structuredSelection.getFirstElement() instanceof ElementImpl)
- {
- ElementImpl elementImpl = (ElementImpl) structuredSelection.getFirstElement();
- IDOMDocument domDocument = (IDOMDocument) elementImpl.getOwnerDocument();
- InternalNodeActionManager actionManager = new InternalNodeActionManager(domDocument.getModel(), treeViewer);
- actionManager.fillContextMenu(manager, structuredSelection);
- }
- }
- }
-
-
- class InternalNodeActionManager extends XMLNodeActionManager
- {
- public InternalNodeActionManager(IStructuredModel model, Viewer viewer)
- {
- super(model, viewer);
- }
-
- public void contributeActions(IMenuManager menu, List selection)
- {
- //menu.add(new Action("there"){});
- try
- {
- int editMode = modelQuery.getEditMode();
- int ic = ModelQuery.INCLUDE_CHILD_NODES;
- int vc = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.VALIDITY_STRICT : ModelQuery.VALIDITY_NONE;
- List implicitlySelectedNodeList = null;
-
- if (selection.size() == 1)
- {
- Node node = (Node) selection.get(0);
- // contribute add child actions
- contributeAddChildActions(menu, node, ic, vc);
- }
- if (selection.size() > 0)
- {
- implicitlySelectedNodeList = getSelectedNodes(selection, true);
- // contribute delete actions
- contributeDeleteActions(menu, implicitlySelectedNodeList, ic, vc);
- }
- }
- catch(Exception e)
- {
- menu.add(new Action(e.getMessage()){});
- }
- /*
- if (selection.size() > 0)
- {
- // contribute replace actions
- contributeReplaceActions(menu, implicitlySelectedNodeList, ic, vc);
- }*/
- }
-
- protected void contributeAddChildActions(IMenuManager menu, Node node, int ic, int vc)
- {
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE)
- {
- // 'Add Child...' and 'Add Attribute...' actions
- //
- Element element = (Element) node;
- MyMenuManager newMenu = new MyMenuManager("New"){
- public boolean isVisible() { return true; }
- };//$NON-NLS-1$
- newMenu.setVisible(true);
- menu.add(newMenu);
-
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
- if (ed != null)
- {
- List modelQueryActionList = new ArrayList();
- // add insert child node actions
- //
- modelQueryActionList = new ArrayList();
- modelQuery.getInsertActions(element, ed, -1, ic, vc, modelQueryActionList);
- addActionHelper(newMenu, modelQueryActionList);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java
deleted file mode 100644
index bc90293694..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java
+++ /dev/null
@@ -1,83 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class DOMExtensionTreeContentProvider implements ITreeContentProvider, INodeAdapter
-{
- protected String facet;
- protected Viewer viewer;
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.viewer = viewer;
- }
-
- public Object[] getChildren(Object parentElement)
- {
- if (parentElement instanceof Element)
- {
- Element element = (Element)parentElement;
- ArrayList list = new ArrayList();
- for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- list.add(node);
- }
- }
- return list.toArray();
- }
- return Collections.EMPTY_LIST.toArray();
- }
-
- public boolean hasChildren(Object element)
- {
- Object[] children = getChildren(element);
- return children.length > 0;
- }
-
- public Object getParent(Object element)
- {
- return null;
- }
-
- public java.lang.Object[] getElements(java.lang.Object inputElement)
- {
- return getChildren(inputElement);
- }
-
- public void dispose()
- {
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- if (viewer != null)
- {
- viewer.refresh();
- }
- }
-
- public boolean isAdapterForType(Object type)
- {
- // this method is not used
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java
deleted file mode 100644
index d173548205..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class DOMExtensionTreeLabelProvider extends LabelProvider
-{
- protected static final Image DEFAULT_ELEMENT_ICON = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- protected static final Image DEFAULT_ATTR_ICON = XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
-
- public DOMExtensionTreeLabelProvider()
- {
- }
-
- public Image getImage(Object element)
- {
- NodeCustomizationRegistry registry = XSDEditorPlugin.getDefault().getNodeCustomizationRegistry();
- if (element instanceof Element)
- {
- Element domElement = (Element) element;
- String namespace = domElement.getNamespaceURI();
- if (namespace != null)
- {
- ILabelProvider lp = registry.getLabelProvider(namespace);
- if (lp != null)
- {
- Image img = lp.getImage(domElement);
- if (img != null)
- return img;
- }
- }
- return DEFAULT_ELEMENT_ICON;
- }
- if (element instanceof Attr)
- return DEFAULT_ATTR_ICON;
- return null;
- }
-
- public String getText(Object input)
- {
- if (input instanceof Element)
- {
- Element domElement = (Element) input;
- String textVal = "";
-
- if (domElement.hasChildNodes())
- {
- Node node = domElement.getChildNodes().item(0);
- if (node instanceof Text)
- {
- Text textNode = (Text) node;
- try
- {
- if (!textNode.getNodeValue().contains("\n"))
- textVal = " [" + textNode.getNodeValue() + "]";
- }
- catch (DOMException e)
- {
- textVal = "";
- }
- }
- }
- return domElement.getLocalName() + textVal;
- }
- if ( input instanceof Attr){
- return ((Attr) input).getLocalName();
- }
- return ""; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java
deleted file mode 100644
index 6cfaac1e48..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java
+++ /dev/null
@@ -1,19 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-public interface ExtensionDetailsContentProvider
-{
- Object[] getItems(Object input);
- String getName(Object item);
- String getValue(Object item);
- String[] getPossibleValues(Object item);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java
deleted file mode 100644
index 8a62a5a0b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jesse Valianes - Seneca College https://bugs.eclipse.org/bugs/show_bug.cgi?id=235381
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-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.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.DialogNodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.ListNodeEditorConfiguration;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorConfiguration;
-
-public class ExtensionDetailsViewer extends Viewer
-{
- private final static String ITEM_DATA = "ITEM_DATA"; //$NON-NLS-1$
- private final static String EDITOR_CONFIGURATION_DATA = "EDITOR_CONFIGURATION_DATA"; //$NON-NLS-1$
-
- Composite control;
- Composite composite;
- ExtensionDetailsContentProvider contentProvider;
- TabbedPropertySheetWidgetFactory widgetFactory;
- InternalControlListener internalControlListener;
- CommandStack commandStack;
-
- public ExtensionDetailsViewer(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory)
- {
- this.widgetFactory = widgetFactory;
- control = widgetFactory.createComposite(parent);
- internalControlListener = new InternalControlListener();
- control.setLayout(new GridLayout());
- }
- public Control getControl()
- {
- return control;
- }
-
- public void setCommandStack(CommandStack commandStack)
- {
- this.commandStack = commandStack;
- }
-
- public Object getInput()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ISelection getSelection()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void refresh()
- {
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- Control control = children[i];
- if (control instanceof Text)
- {
- ExtensionItem item = (ExtensionItem)control.getData(ITEM_DATA);
- String value = contentProvider.getValue(item);
- ((Text)control).setText(value);
- }
- }
- }
-
- private void createTextOrComboControl(ExtensionItem item, Composite composite)
- {
- Control control = null;
- String value = contentProvider.getValue(item);
- NodeEditorConfiguration editorConfiguration = item.getPropertyEditorConfiguration();
-
- if (editorConfiguration != null && hasStyle(editorConfiguration, NodeEditorConfiguration.STYLE_COMBO))
- {
- ListNodeEditorConfiguration configuration = (ListNodeEditorConfiguration)editorConfiguration;
- CCombo combo = widgetFactory.createCCombo(composite);
- combo.setText(value);
- Object[] values = configuration.getValues(item);
- LabelProvider labelProvider = configuration.getLabelProvider();
- for (int j = 0; j < values.length; j++)
- {
- Object o = values[j];
- String displayName = labelProvider != null ?
- labelProvider.getText(o) :
- o.toString();
- combo.add(displayName);
- }
- combo.addSelectionListener(internalControlListener);
- control = combo;
- }
- if (control == null)
- {
- Text text = widgetFactory.createText(composite,value);
- text.addKeyListener(internalControlListener);
- control = text;
- }
- control.setData(ITEM_DATA, item);
- control.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- control.addFocusListener(internalControlListener);
- }
-
- private void createButtonControl(ExtensionItem item, Composite composite)
- {
- NodeEditorConfiguration editorConfiguration = item.getPropertyEditorConfiguration();
- if (editorConfiguration != null && hasStyle(editorConfiguration, NodeEditorConfiguration.STYLE_DIALOG))
- {
- DialogNodeEditorConfiguration configuration = (DialogNodeEditorConfiguration)editorConfiguration;
- Button button = new Button(composite, SWT.NONE);
- GridData gridData = new GridData();
- gridData.heightHint = 17;
- button.setLayoutData(gridData);
- button.addSelectionListener(internalControlListener);
- button.setData(ITEM_DATA, item);
- button.setData(EDITOR_CONFIGURATION_DATA, configuration);
- String text = configuration.getButonText();
- if (text != null)
- {
- button.setText(text); //$NON-NLS-1$
- }
- button.setImage(configuration.getButtonImage());
- }
- else
- {
- Control placeHolder = new Label(composite, SWT.NONE);
- placeHolder.setVisible(false);
- placeHolder.setEnabled(false);
- placeHolder.setLayoutData(new GridData());
- }
- }
-
- public void setInput(Object input)
- {
- // TODO (cs) add assertions
- //
- if (contentProvider == null)
- return;
-
- if (composite != null)
- {/*
- for (Iterator i = controlsThatWeAreListeningTo.iterator(); i.hasNext(); )
- {
- Control control = (Control)i.next();
- if (control != null)
- {
- control.removeFocusListener(internalFocusListener);
- }
- } */
- removeListeners();
- composite.dispose();
- }
-
- composite = widgetFactory.createComposite(control);
- composite.setBackground(ColorConstants.white);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- composite.setLayout(gridLayout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Object[] items = contentProvider.getItems(input);
-
- for (int i = 0; i < items.length; i++)
- {
- ExtensionItem item = (ExtensionItem)items[i];
- String name = contentProvider.getName(item);
- Label label = widgetFactory.createLabel(composite, name + ":"); //$NON-NLS-1$
- label.setLayoutData(new GridData());
- createTextOrComboControl(item, composite);
- createButtonControl(item, composite);
- }
- control.layout(true);
- }
-
- private boolean hasStyle(NodeEditorConfiguration configuration, int style)
- {
- return (configuration.getStyle() & style) != 0;
- }
-
-
- public void setSelection(ISelection selection, boolean reveal)
- {
- // TODO Auto-generated method stub
-
- }
- public ExtensionDetailsContentProvider getContentProvider()
- {
- return contentProvider;
- }
- public void setContentProvider(ExtensionDetailsContentProvider contentProvider)
- {
- this.contentProvider = contentProvider;
- }
-
- private void applyEdit(ExtensionItem item, Widget widget)
- {
- if (item != null)
- {
- String value = null;
- if (widget instanceof Text)
- {
- Text text = (Text)widget;
- value = text.getText();
- }
- else if (widget instanceof CCombo)
- {
- CCombo combo = (CCombo)widget;
- int index = combo.getSelectionIndex();
- if (index != -1)
- {
- value = combo.getItem(index);
- }
- }
- if (value != null)
- {
- Command command = item.getUpdateValueCommand(value);
- if (command != null)
- {
- if (commandStack != null)
- commandStack.execute(command);
- else
- command.execute();
- }
- }
- }
- }
-
- class InternalControlListener implements FocusListener, SelectionListener, KeyListener
- {
- public void widgetSelected(SelectionEvent e)
- {
- // for button controls we handle selection events
- //
- Object item = e.widget.getData(EDITOR_CONFIGURATION_DATA);
- if (item == null)
- item = e.widget.getData(ITEM_DATA);
- if (item instanceof DialogNodeEditorConfiguration)
- {
- DialogNodeEditorConfiguration dialogNodeEditorConfiguration = (DialogNodeEditorConfiguration)item;
- dialogNodeEditorConfiguration.invokeDialog();
- refresh();
- }
- else if (item instanceof ExtensionItem)
- {
- applyEdit((ExtensionItem)item, e.widget);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- // do nothing
- }
-
- public void focusGained(FocusEvent e)
- {
- }
-
- public void focusLost(FocusEvent e)
- {
- // apply edits for text and combo box controls
- // via the focusLost event
- Object item = e.widget.getData(ITEM_DATA);
- if (item instanceof ExtensionItem)
- {
- applyEdit((ExtensionItem)item, e.widget);
- }
- }
-
- public void keyPressed(KeyEvent e)
- {
- // handle explict ENTER key
- Object item = e.widget.getData(ITEM_DATA);
- if (item instanceof ExtensionItem)
- {
- if (e.character == SWT.CR)
- applyEdit((ExtensionItem)item, e.widget);
- }
- }
-
- public void keyReleased(KeyEvent e)
- {
- // Ignore these events
- }
- }
-
- public void removeListeners()
- {
- if (composite != null && !composite.isDisposed())
- {
- Control [] children = composite.getChildren();
- int length = children.length;
- for (int i = 0; i < length; i++)
- {
- Control o = children[i];
- if (o instanceof CCombo)
- {
- ((CCombo)o).removeSelectionListener(internalControlListener);
- o.removeFocusListener(internalControlListener);
- }
- else if (o instanceof Text)
- {
- ((Text)o).removeKeyListener(internalControlListener);
- o.removeFocusListener(internalControlListener);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java
deleted file mode 100644
index 4b67808305..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java
+++ /dev/null
@@ -1,31 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeEditorConfiguration;
-
-public abstract class ExtensionItem
-{
- NodeEditorConfiguration propertyEditorConfiguration;
-
- public NodeEditorConfiguration getPropertyEditorConfiguration()
- {
- return propertyEditorConfiguration;
- }
-
- public void setPropertyEditorConfiguration(NodeEditorConfiguration propertyEditorConfiguration)
- {
- this.propertyEditorConfiguration = propertyEditorConfiguration;
- }
-
- public abstract Command getUpdateValueCommand(String newValue);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java
deleted file mode 100644
index b84ad1c2ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java
+++ /dev/null
@@ -1,32 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * @deprecated
- */
-public interface ExtensionItemEditManager
-{
- public final static String STYLE_NONE = "none"; //$NON-NLS-1$
- public final static String STYLE_TEXT = "text"; //$NON-NLS-1$
- public final static String STYLE_COMBO = "combo"; //$NON-NLS-1$
- public final static String STYLE_CUSTOM = "custom"; //$NON-NLS-1$
-
- void handleEdit(Object item, Widget widget);
- String getTextControlStyle(Object item);
- String getButtonControlStyle(Object item);
- Control createCustomTextControl(Composite composite, Object item);
- Control createCustomButtonControl(Composite composite, Object item);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemFilter.java
deleted file mode 100644
index b199c37c60..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemFilter.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-
-// cs: This interface is intended to suppliment the NodeFilter class
-// that can be specified via the customization extensions point.
-// When the initial list of a category's objects is displayed
-// we'll use a NodeFilter to prune the list. If the NodeFilter
-// implements this interface we'll call this interface's isApplicableContext
-// method instead of the NodeFilter's DOM node based method. This provides
-// are a more convenient interface for clients who are only interested in
-// filter the list presented via the AddExtensionComponentDialog.
-// See the class ExtensionsSection for more details.
-//
-public interface ExtensionItemFilter
-{
- public boolean isApplicableContext(XSDConcreteComponent parent, XSDConcreteComponent candidate);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionsSchemasRegistry.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionsSchemasRegistry.java
deleted file mode 100644
index 8fc3af68bc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionsSchemasRegistry.java
+++ /dev/null
@@ -1,330 +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.wst.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleRemoveExtensionNodeCommand;
-import org.w3c.dom.Element;
-
-public class ExtensionsSchemasRegistry
-{
- public static final String USER_ADDED_EXT_SCHEMAS = "USER-ADDED-EXT-SCHEMAS"; // TODO externalize
- private static final String LOCATION_PREFIX = "platform:/plugin/"; //$NON-NLS-1$
- public static final String DESCRIPTION = "description"; //$NON-NLS-1$
- public static final String DISPLAYNAME = "displayName"; //$NON-NLS-1$
- public static final String NAMESPACEURI = "namespaceURI"; //$NON-NLS-1$
- public static final String XSDFILEURL = "xsdFileURL"; //$NON-NLS-1$
- public static final String LABELPROVIDER = "labelProviderClass"; //$NON-NLS-1$
- public static final String ADD_COMMAND_CLASS = "addCommandClass"; //$NON-NLS-1$
- public static final String DELETE_COMMAND_CLASS = "deleteCommandClass"; //$NON-NLS-1$
- public static final String CATEGORY_PROVIDER_CLASS = "class"; //$NON-NLS-1$
-
- protected IPreferenceStore prefStore;
- protected String extensionId;
-
- protected ArrayList nsURIProperties, categoryProviderList;
- private String deprecatedExtensionId;
-
- public ExtensionsSchemasRegistry(String appinfo_extensionid)
- {
- extensionId = appinfo_extensionid;
- }
-
- public void __internalSetDeprecatedExtensionId(String deprecatedId)
- {
- deprecatedExtensionId = deprecatedId;
- }
-
- public void setPrefStore(IPreferenceStore store)
- {
- prefStore = store;
- }
-
- public List getAllExtensionsSchemasContribution()
- {
- // If we read the registry, then let's not do it again.
- if (nsURIProperties != null)
- {
- return nsURIProperties;
- }
-
- nsURIProperties = new ArrayList();
- categoryProviderList = new ArrayList();
-
- getAllExtensionsSchemasContribution(extensionId);
- if (deprecatedExtensionId != null)
- {
- getAllExtensionsSchemasContribution(deprecatedExtensionId);
- }
-
- // get user-added schemas stored in preference
- if (prefStore != null)
- {
- String value = prefStore.getString(USER_ADDED_EXT_SCHEMAS);
- StringTokenizer tokenizer = new StringTokenizer(value, "\n");
-
- while ( tokenizer.hasMoreTokens() )
- {
- nsURIProperties.add( new SpecificationForExtensionsSchema( tokenizer.nextToken() ) );
- }
- }
-
- return nsURIProperties;
- }
-
- private List getAllExtensionsSchemasContribution(String id)
- {
- IConfigurationElement[] asiPropertiesList = Platform.getExtensionRegistry().getConfigurationElementsFor(id);
-
- boolean hasASIProperties = (asiPropertiesList != null) && (asiPropertiesList.length > 0);
-
- if (hasASIProperties)
- {
- for (int i = 0; i < asiPropertiesList.length; i++)
- {
- IConfigurationElement asiPropertiesElement = asiPropertiesList[i];
- String elementName = asiPropertiesElement.getName();
-
- if ("category".equals(elementName))
- {
- String description = asiPropertiesElement.getAttribute(DESCRIPTION);
- String displayName = asiPropertiesElement.getAttribute(DISPLAYNAME);
- String namespaceURI = asiPropertiesElement.getAttribute(NAMESPACEURI);
- String xsdFileURL = asiPropertiesElement.getAttribute(XSDFILEURL);
- String labelProviderClass = asiPropertiesElement.getAttribute(LABELPROVIDER);
- String addCommandClass = asiPropertiesElement.getAttribute(ADD_COMMAND_CLASS);
- String deleteCommandClass = asiPropertiesElement.getAttribute(DELETE_COMMAND_CLASS);
-
- if (displayName == null)
- {
- // If there is no display name, force the user
- // to manually create a name. Therefore, we ignore entry without
- // a display name.
- continue;
- }
-
- if (xsdFileURL == null)
- {
- xsdFileURL = locateFileUsingCatalog(namespaceURI);
- }
-
- SpecificationForExtensionsSchema extensionsSchemaSpec = createEntry();
- extensionsSchemaSpec.setDescription(description);
- extensionsSchemaSpec.setDisplayName(displayName);
- extensionsSchemaSpec.setNamespaceURI(namespaceURI);
- extensionsSchemaSpec.setDefautSchema();
-
- String pluginId = asiPropertiesElement.getDeclaringExtension().getContributor().getName();
-
- if (labelProviderClass != null)
- {
- ILabelProvider labelProvider = null;
- try
- {
- Class theClass = Platform.getBundle(pluginId).loadClass(labelProviderClass);
- if (theClass != null)
- {
- labelProvider = (ILabelProvider) theClass.newInstance();
- if (labelProvider != null)
- {
- extensionsSchemaSpec.setLabelProvider(labelProvider);
- }
- }
- }
- catch (Exception e)
- {
-
- }
- }
-
- if (addCommandClass != null)
- {
- try
- {
- ExtensibleAddExtensionCommand addCommand = (ExtensibleAddExtensionCommand)asiPropertiesElement.createExecutableExtension(ADD_COMMAND_CLASS);
- if (addCommand != null)
- {
- extensionsSchemaSpec.setExtensibleAddExtensionCommand(addCommand);
- }
- }
- catch (Exception e)
- {
- }
- }
-
- if (deleteCommandClass != null)
- {
- try
- {
- ExtensibleRemoveExtensionNodeCommand deleteCommand = (ExtensibleRemoveExtensionNodeCommand)asiPropertiesElement.createExecutableExtension(DELETE_COMMAND_CLASS);
- if (deleteCommand != null)
- {
- extensionsSchemaSpec.setExtensibleRemoveExtensionNodeCommand(deleteCommand);
- }
- }
- catch (Exception e)
- {
- }
- }
-
- extensionsSchemaSpec.setLocation(LOCATION_PREFIX + pluginId + "/" + xsdFileURL); //$NON-NLS-1$
-
- nsURIProperties.add(extensionsSchemaSpec);
-
- }
- else if ("categoryProvider".equals(elementName))
- {
- String categoryProviderClass = asiPropertiesElement.getAttribute(CATEGORY_PROVIDER_CLASS);
-
- if (categoryProviderClass != null)
- {
- try
- {
- CategoryProvider categoryProvider = (CategoryProvider)asiPropertiesElement.createExecutableExtension(CATEGORY_PROVIDER_CLASS);
- if (categoryProvider != null)
- {
- categoryProviderList.add(categoryProvider);
- }
- }
- catch (Exception e)
- {
- }
- }
-
- }
-
- }
-
- }
-
- return nsURIProperties;
- }
-
- public ExtensibleAddExtensionCommand getAddExtensionCommand(String namespace)
- {
- // Didn't retrieve the config elements yet.
- if (nsURIProperties == null)
- {
- getAllExtensionsSchemasContribution();
- }
-
- for (Iterator i = nsURIProperties.iterator(); i.hasNext(); )
- {
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema)i.next();
- String nsURI = spec.getNamespaceURI();
- if (nsURI != null && nsURI.equals(namespace))
- {
- return spec.getExtensibleAddExtensionCommand();
- }
- }
-
- for (Iterator i = categoryProviderList.iterator(); i.hasNext(); )
- {
- CategoryProvider categoryProvider = (CategoryProvider)i.next();
- for (Iterator j = categoryProvider.getCategories().iterator(); j.hasNext(); )
- {
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema) j.next();
- String namespaceURI = spec.getNamespaceURI();
- if (namespaceURI != null && namespaceURI.equals(namespace))
- {
- return spec.getExtensibleAddExtensionCommand();
- }
- }
- }
-
- return null;
- }
-
- public ExtensibleRemoveExtensionNodeCommand getRemoveExtensionNodeCommand(String namespace)
- {
- // Didn't retrieve the config elements yet.
- if (nsURIProperties == null)
- {
- getAllExtensionsSchemasContribution();
- }
-
- for (Iterator i = nsURIProperties.iterator(); i.hasNext(); )
- {
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema)i.next();
- String nsURI = spec.getNamespaceURI();
- if (nsURI != null && nsURI.equals(namespace))
- {
- return spec.getExtensibleRemoveExtensionNodeCommand();
- }
- }
-
- for (Iterator i = categoryProviderList.iterator(); i.hasNext(); )
- {
- CategoryProvider categoryProvider = (CategoryProvider)i.next();
- for (Iterator j = categoryProvider.getCategories().iterator(); j.hasNext(); )
- {
- SpecificationForExtensionsSchema spec = (SpecificationForExtensionsSchema) j.next();
- String namespaceURI = spec.getNamespaceURI();
- if (namespaceURI != null && namespaceURI.equals(namespace))
- {
- return spec.getExtensibleRemoveExtensionNodeCommand();
- }
- }
- }
-
- return null;
- }
-
- public List getCategoryProviders()
- {
- if (nsURIProperties == null)
- {
- getAllExtensionsSchemasContribution();
- }
-
- return categoryProviderList;
- }
-
- /**
- * @deprecated
- */
- public ILabelProvider getLabelProvider(Element element)
- {
- return null;
- }
-
- public SpecificationForExtensionsSchema createEntry()
- {
- return new SpecificationForExtensionsSchema();
- }
-
- /**
- * Returns the String location for the schema with the given namespaceURI by
- * looking at the XML catalog. We look only in the plugin specified entries of
- * the catalog.
- *
- * @param namespaceURI
- * @return String representing the location of the schema.
- */
- private String locateFileUsingCatalog(String namespaceURI)
- {
- URIResolver resolver = URIResolverPlugin.createResolver();
- String result = resolver.resolve("", namespaceURI, "");
- return resolver.resolvePhysicalLocation("", namespaceURI, result);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java
deleted file mode 100644
index 9b5daf0a65..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java
+++ /dev/null
@@ -1,207 +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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-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.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogEntriesView;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogEntryDetailsView;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogMessages;
-import org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogTreeViewer;
-
-public class SelectFromCatalogDialog extends Dialog
-{
-
- private ICatalog workingUserCatalog;
- private ICatalog userCatalog;
- private ICatalog defaultCatalog;
- private XMLCatalogEntriesView catalogEntriesView;
- private ICatalog systemCatalog;
-
- private String currentSelectionLocation;
- private String currentSelectionNamespace;
-
- public SelectFromCatalogDialog(Shell parentShell)
- {
- super(parentShell);
-
- defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++)
- {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null)
- {
- if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId()))
- {
- systemCatalog = referencedCatalog;
- }
- else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId()))
- {
- userCatalog = referencedCatalog;
- }
- }
- }
- }
-
- protected Control createDialogArea(Composite parent)
- {
- // we create a working copy of the 'User Settings' for the Catalog
- // that we can modify
- CatalogSet tempCatalogSet = new CatalogSet();
- workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
-
- // TODO: add entries from the nested catalogs as well
- workingUserCatalog.addEntriesFromCatalog(userCatalog);
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.heightHint = 500;
- composite.setLayoutData(gridData);
- createCatalogEntriesView(composite);
- createCatalogDetailsView(composite);
-
- return composite;
- }
-
- protected void createCatalogEntriesView(Composite parent)
- {
- Group group = new Group(parent, SWT.NONE);
- group.setLayout(new GridLayout());
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.widthHint = 370;
- group.setLayoutData(gridData);
- group.setText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES);
- group.setToolTipText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES_TOOL_TIP);
-
- /*
- * create a subclass of XMLCatalogEntriesView which suppresses - the
- * creation of 'Add', 'Edit', 'Delete' buttons - any method involving the
- * above buttons
- */
- catalogEntriesView = new XMLCatalogEntriesView(group, workingUserCatalog, systemCatalog)
- {
- protected void createButtons(Composite parent)
- {
- }
-
- protected void updateWidgetEnabledState()
- {
- }
-
- };
-
- // Only XML Schema entry is selectable
- catalogEntriesView.setLayoutData(gridData);
- XMLCatalogTreeViewer catalogTreeViewer = ((XMLCatalogTreeViewer) catalogEntriesView.getViewer());
- catalogTreeViewer.resetFilters();
-
- catalogTreeViewer.addFilter(new XMLCatalogTableViewerFilter(new String[] { ".xsd" }));
- }
-
- // Bug in the filter of the XML plugin, have to give a correct version here
- // TODO: Waiting for the fix to be commited to XML plugin and
- // be used by constellation
- private class XMLCatalogTableViewerFilter extends ViewerFilter
- {
- private static final String W3_XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/";
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions1)
- {
- this.extensions = extensions1;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element)
- {
- boolean result = false;
- if (element instanceof ICatalogEntry)
- {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++)
- {
- // if the extension is correct and the namespace indicates
- // that this entry is not the W3 XML Schema
- if (catalogEntry.getURI().endsWith(extensions[i]) && !catalogEntry.getKey().startsWith(W3_XMLSCHEMA_NAMESPACE))
- {
- result = true;
- break;
- }
- }
- }
- else if (element.equals(XMLCatalogTreeViewer.PLUGIN_SPECIFIED_ENTRIES_OBJECT) || element.equals(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT))
- {
- return true;
- }
- return result;
- }
- }
-
- protected void createCatalogDetailsView(Composite parent)
- {
- Group detailsGroup = new Group(parent, SWT.NONE);
- detailsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- detailsGroup.setLayout(new GridLayout());
- detailsGroup.setText(XMLCatalogMessages.UI_LABEL_DETAILS);
- final XMLCatalogEntryDetailsView detailsView = new XMLCatalogEntryDetailsView(detailsGroup);
- ISelectionChangedListener listener = new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry)
- {
- ICatalogEntry entry = (ICatalogEntry) selectedObject;
- detailsView.setCatalogElement(entry);
- currentSelectionLocation = entry.getURI();
- currentSelectionNamespace = entry.getKey();
- }
- else
- {
- detailsView.setCatalogElement((ICatalogEntry) null);
- currentSelectionLocation = "";
- currentSelectionNamespace = "";
- }
- }
- };
- catalogEntriesView.getViewer().addSelectionChangedListener(listener);
- }
-
- public String getCurrentSelectionLocation()
- {
- return currentSelectionLocation;
- }
-
- public String getCurrentSelectionNamespace()
- {
- return currentSelectionNamespace;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SpecificationForExtensionsSchema.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SpecificationForExtensionsSchema.java
deleted file mode 100644
index 8b4a9a5518..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SpecificationForExtensionsSchema.java
+++ /dev/null
@@ -1,219 +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.wst.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleRemoveExtensionNodeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeFilter;
-
-public class SpecificationForExtensionsSchema
-{
- private String description;
- private String displayName;
- private String namespaceURI;
- private String location;
- private ILabelProvider labelProvider;
- private boolean isDefaultSchema = false;
- private ExtensibleAddExtensionCommand addCommand;
- private ExtensibleRemoveExtensionNodeCommand removeCommand;
- private NodeFilter nodeFilter;
- private String classification;
-
- /**
- * Either the workspace-relative path of the xsd file or the namespace
- * of the xsd file (if it come from the Catalog)
- */
- private String sourceHint;
- private boolean fromCatalog;
-
- public SpecificationForExtensionsSchema()
- {
- super();
- }
-
- public SpecificationForExtensionsSchema(String desc) {
- StringTokenizer tokenizer = new StringTokenizer(desc, "\t");
-
- // we must be sure that each 'desc' contains info in correct format
- // no error checking here
- description = tokenizer.nextToken();
- displayName = tokenizer.nextToken();
- namespaceURI = tokenizer.nextToken();
- location = tokenizer.nextToken();
- isDefaultSchema = tokenizer.nextToken().equals("true");
- sourceHint = tokenizer.nextToken();
- fromCatalog = tokenizer.nextToken().equals("true");
- }
-
-/**
- * @return Returns the description.
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * @param description
- * The description to set.
- */
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- /**
- * @return Returns the displayName.
- */
- public String getDisplayName()
- {
- return displayName;
- }
-
- /**
- * @param name
- * The displayName to set.
- */
- public void setDisplayName(String displayName)
- {
- this.displayName = displayName;
- }
-
- /**
- * @return Returns the namespaceURI.
- */
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-
- /**
- * @param namespaceURI
- * The namespaceURI to set.
- */
- public void setNamespaceURI(String namespaceURI)
- {
- this.namespaceURI = namespaceURI;
- }
-
- /**
- * @return Returns the location of the xsd file.
- */
- public String getLocation()
- {
- return location;
- }
-
- /**
- * @param location
- * The location to be set
- */
- public void setLocation(String location)
- {
- this.location = location;
- }
-
- public ILabelProvider getLabelProvider()
- {
- return labelProvider;
- }
-
- public void setLabelProvider(ILabelProvider labelProvider)
- {
- this.labelProvider = labelProvider;
- }
-
- public ExtensibleAddExtensionCommand getExtensibleAddExtensionCommand()
- {
- return addCommand;
- }
-
- public void setExtensibleAddExtensionCommand(ExtensibleAddExtensionCommand addCommand)
- {
- this.addCommand = addCommand;
- }
-
- public ExtensibleRemoveExtensionNodeCommand getExtensibleRemoveExtensionNodeCommand()
- {
- return removeCommand;
- }
-
- public void setExtensibleRemoveExtensionNodeCommand(ExtensibleRemoveExtensionNodeCommand removeCommand)
- {
- this.removeCommand = removeCommand;
- }
-
- public boolean isDefautSchema(){
- return isDefaultSchema ;
- }
-
- public void setDefautSchema(){
- isDefaultSchema = true;
- }
-
- public void setSourceHint(String s){
- sourceHint = s;
- }
-
- public String getSourceHint(){
- return sourceHint;
- }
-
- public boolean isFromCatalog() {
- return fromCatalog;
- }
-
- public void setFromCatalog(boolean fromCatalog) {
- this.fromCatalog = fromCatalog;
- }
-
- /**
- * There is no support for setting this via the extension point defined in the plugin.xml
- * This allows extenders to provide a filter for a category that has been added
- * dynamically (programmatically)
- * @param nodeFilter
- */
- public void setNodeFilter(NodeFilter nodeFilter)
- {
- this.nodeFilter = nodeFilter;
- }
-
- /**
- * Get the node filter
- * @return NodeFilter
- */
- public NodeFilter getNodeFilter()
- {
- return nodeFilter;
- }
-
- /**
- * There is no support for setting this via the extension point defined in the plugin.xml
- * This allows extenders to group categories into groups or classificationss
- * @param classification
- */
- public void setClassification(String classification)
- {
- this.classification = classification;
- }
-
- /**
- * Get the classification
- * @return String
- */
- public String getClassification()
- {
- return classification;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/XSDExtensionTreeContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/XSDExtensionTreeContentProvider.java
deleted file mode 100644
index d0e4255561..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/XSDExtensionTreeContentProvider.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections.appinfo;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class XSDExtensionTreeContentProvider extends DOMExtensionTreeContentProvider
-{
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent) inputElement;
- List elementsAndAttributes = new ArrayList();
- XSDAnnotation xsdAnnotation = XSDCommonUIUtils.getInputXSDAnnotation(component, false);
- if (xsdAnnotation != null)
- {
- // Bug 137856 - Extension page of properties shouldn't display imported elements
- // Added this if statement
- if (xsdAnnotation.getSchema() == component.getSchema())
- {
- List appInfoList = xsdAnnotation.getApplicationInformation();
- Element appInfoElement = null;
- if (appInfoList.size() > 0)
- {
- appInfoElement = (Element) appInfoList.get(0);
- }
- if (appInfoElement != null)
- {
- for (Iterator it = appInfoList.iterator(); it.hasNext();)
- {
- Object obj = it.next();
- if (obj instanceof Element)
- {
- Element appInfo = (Element) obj;
- NodeList nodeList = appInfo.getChildNodes();
- int length = nodeList.getLength();
- for (int i = 0; i < length; i++)
- {
- Node node = nodeList.item(i);
- if (node instanceof Element)
- {
- elementsAndAttributes.add(node);
- }
- }
- }
- }
-
- /** Construct attributes list */
- NamedNodeMap attributes = appInfoElement.getAttributes();
- if (attributes != null)
- {
- // String defaultNamespace =
- // (String)component.getSchema().getQNamePrefixToNamespaceMap().get("");
- int length = attributes.getLength();
- for (int i = 0; i < length; i++)
- {
- Node oneAttribute = attributes.item(i);
- if (!isXmlnsAttribute(oneAttribute))
- {
- String namespace = oneAttribute.getNamespaceURI();
- boolean isExtension = true;
- if (namespace == null && oneAttribute.getPrefix() == null)
- {
- isExtension = false;
- }
- else if (!XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace))
- {
- isExtension = true;
- }
- if (isExtension)
- {
- elementsAndAttributes.add(oneAttribute);
- }
- }
- }
- }
- }
- }
- }
- return elementsAndAttributes.toArray();
- }
- return Collections.EMPTY_LIST.toArray();
- }
-
- private static boolean isXmlnsAttribute(Node attribute)
- {
- String prefix = attribute.getPrefix();
- if (prefix != null)
- {
- // this handle the xmlns:foo="blah" case
- return "xmlns".equals(prefix); //$NON-NLS-1$
- }
- else
- {
- // this handles the xmlns="blah" case
- return "xmlns".equals(attribute.getNodeName()); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java
deleted file mode 100644
index 584ad71494..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java
+++ /dev/null
@@ -1,27 +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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-
-public class DefaultListNodeEditorConfiguration extends ListNodeEditorConfiguration
-{
- private String[] values;
-
- public DefaultListNodeEditorConfiguration(String[] values)
- {
- this.values = values;
- }
-
- public Object[] getValues(Object propertyObject)
- {
- return values;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java
deleted file mode 100644
index ead530daf5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java
+++ /dev/null
@@ -1,33 +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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-import org.eclipse.swt.graphics.Image;
-
-public abstract class DialogNodeEditorConfiguration extends NodeEditorConfiguration
-{
- public int getStyle()
- {
- return STYLE_DIALOG;
- }
-
- public String getButonText()
- {
- return null;
- }
-
- public Image getButtonImage()
- {
- return null;
- }
-
- public abstract void invokeDialog();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java
deleted file mode 100644
index fdfbce6822..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java
+++ /dev/null
@@ -1,35 +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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-import org.eclipse.jface.viewers.LabelProvider;
-
-public abstract class ListNodeEditorConfiguration extends NodeEditorConfiguration
-{
- private LabelProvider labelProvider;
-
- public LabelProvider getLabelProvider()
- {
- return labelProvider;
- }
-
- public int getStyle()
- {
- return STYLE_COMBO;
- }
-
- public void setLabelProvider(LabelProvider labelProvider)
- {
- this.labelProvider = labelProvider;
- }
-
- public abstract Object[] getValues(Object propertyObject);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java
deleted file mode 100644
index e4df63d1e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java
+++ /dev/null
@@ -1,157 +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.wst.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.ILabelProvider;
-
-public class NodeCustomizationRegistry
-{
- private static final String NAMESPACE = "namespace"; //$NON-NLS-1$
- private static final String LABEL_PROVIDER_CLASS_ATTRIBUTE_NAME = "labelProviderClass";
- private static final String NODE_EDITOR_PROVIDER_CLASS_ATTRIBUTE_NAME = "nodeEditorProviderClass"; //$NON-NLS-1$
- private static final String FILTER_CLASS_ATTRIBUTE_NAME = "filterClass";
-
-
- protected String extensionId;
- protected HashMap map;
-
- public NodeCustomizationRegistry(String propertyEditorExtensionId)
- {
- extensionId = "org.eclipse.wst.xsd.ui.extensibilityNodeCustomizations";//propertyEditorExtensionId;
- }
-
- private class Descriptor
- {
- IConfigurationElement configurationElement;
- NodeEditorProvider nodeEditorProvider;
- NodeFilter nodeFilter;
- boolean nodeEditorProviderFailedToLoad = false;
- boolean labelProviderFailedToLoad = false;
-
- Descriptor(IConfigurationElement element)
- {
- this.configurationElement = element;
- }
-
- NodeEditorProvider lookupOrCreateNodeEditorProvider()
- {
- if (nodeEditorProvider == null && !nodeEditorProviderFailedToLoad)
- {
- try
- {
- nodeEditorProvider = (NodeEditorProvider)configurationElement.createExecutableExtension(NODE_EDITOR_PROVIDER_CLASS_ATTRIBUTE_NAME);
- }
- catch (Exception e)
- {
- nodeEditorProviderFailedToLoad = true;
- }
- }
- return nodeEditorProvider;
- }
-
- ILabelProvider createLabelProvider()
- {
- if (!labelProviderFailedToLoad)
- {
- try
- {
- return (ILabelProvider)configurationElement.createExecutableExtension(LABEL_PROVIDER_CLASS_ATTRIBUTE_NAME);
- }
- catch (Exception e)
- {
- labelProviderFailedToLoad = true;
- }
- }
- return null;
- }
-
- public NodeFilter getNodeFilter()
- {
- if (!nodeEditorProviderFailedToLoad)
- {
- try
- {
- nodeFilter = (NodeFilter)configurationElement.createExecutableExtension(FILTER_CLASS_ATTRIBUTE_NAME);
- }
- catch (Exception e)
- {
- nodeEditorProviderFailedToLoad = true;
- }
- }
- return nodeFilter;
- }
- }
-
-
- private HashMap initMap()
- {
- HashMap theMap = new HashMap();
- IConfigurationElement[] extensions = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.wst.xsd.ui.extensibilityNodeCustomizations");
- for (int i = 0; i < extensions.length; i++)
- {
- IConfigurationElement configurationElement = extensions[i];
- String namespace = configurationElement.getAttribute(NAMESPACE);
- if (namespace != null)
- {
- theMap.put(namespace, new Descriptor(configurationElement));
- }
- }
- return theMap;
- }
-
- private Descriptor getDescriptor(String namespace)
- {
- map = null;
- if (namespace != null)
- {
- if (map == null)
- {
- map = initMap();
- }
- return (Descriptor)map.get(namespace);
- }
- return null;
- }
-
- public NodeEditorProvider getNodeEditorProvider(String namespace)
- {
- Descriptor descriptor = getDescriptor(namespace);
- if (descriptor != null)
- {
- return descriptor.lookupOrCreateNodeEditorProvider();
- }
- return null;
- }
-
- public ILabelProvider getLabelProvider(String namespace)
- {
- Descriptor descriptor = getDescriptor(namespace);
- if (descriptor != null)
- {
- return descriptor.createLabelProvider();
- }
- return null;
- }
-
- public NodeFilter getNodeFilter(String namespace)
- {
- Descriptor descriptor = getDescriptor(namespace);
- if (descriptor != null)
- {
- return descriptor.getNodeFilter();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java
deleted file mode 100644
index 1506ad222f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java
+++ /dev/null
@@ -1,43 +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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-import org.w3c.dom.Node;
-
-public abstract class NodeEditorConfiguration
-{
- public final static int STYLE_NONE = 0;
- public final static int STYLE_TEXT = 1;
- public final static int STYLE_COMBO = 2;
- public final static int STYLE_DIALOG = 4;
-
- public abstract int getStyle();
-
- private Node node;
- private Node parentNode;
-
- public Node getNode()
- {
- return node;
- }
- public void setNode(Node node)
- {
- this.node = node;
- }
- public Node getParentNode()
- {
- return parentNode;
- }
- public void setParentNode(Node parentNode)
- {
- this.parentNode = parentNode;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java
deleted file mode 100644
index 07d1c63909..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java
+++ /dev/null
@@ -1,18 +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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-
-public abstract class NodeEditorProvider
-{
- public abstract NodeEditorConfiguration getNodeEditorConfiguration(String parentName, String nodeName);
- //public abstract NodeEditorConfiguration getNodeEditorConfiguration(Node node);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeFilter.java
deleted file mode 100644
index 5cabbc7622..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeFilter.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections.appinfo.custom;
-
-import org.w3c.dom.Node;
-
-public class NodeFilter
-{
- public boolean isApplicableContext(Node parentNode, int nodeType, String namespace, String name)
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java
deleted file mode 100644
index e5180f09a8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wst.xsd.ui.internal.common.util;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
- static
- {
- NLS.initializeMessages("org.eclipse.wst.xsd.ui.internal.common.util.messages", Messages.class); //$NON-NLS-1$
- }
-
- public Messages()
- {
- super();
- }
-
- public static String _UI_ACTION_OPEN_IN_NEW_EDITOR;
- public static String _UI_ACTION_ADD_ATTRIBUTE_GROUP;
- public static String _UI_ACTION_ADD_ATTRIBUTE_GROUP_REF;
- public static String _UI_ACTION_ADD_ATTRIBUTE_GROUP_DEFINITION;
- public static String _UI_ACTION_ADD_GROUP_REF;
- public static String _UI_ACTION_ADD_GROUP;
- public static String _UI_ACTION_DELETE;
- public static String _UI_ACTION_ADD_COMPLEX_TYPE;
- public static String _UI_ACTION_ADD_ATTRIBUTE;
- public static String _UI_ACTION_ADD_SIMPLE_TYPE;
- public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE;
- public static String _UI_LABEL_NO_ITEMS_SELECTED;
- public static String _UI_ACTION_ADD;
- public static String _UI_ACTION_ADD_WITH_DOTS;
- public static String _UI_ACTION_EDIT_WITH_DOTS;
- public static String _UI_ACTION_CHANGE_PATTERN;
- public static String _UI_ACTION_ADD_ENUMERATION;
- public static String _UI_ACTION_INSERT_ENUMERATION;
- public static String _UI_ACTION_ADD_PATTERN;
- public static String _UI_ACTION_ADD_ENUMERATIONS;
- public static String _UI_ACTION_DELETE_CONSTRAINTS;
- public static String _UI_ACTION_DELETE_PATTERN;
- public static String _UI_ACTION_DELETE_ENUMERATION;
- public static String _UI_ACTION_SET_ENUMERATION_VALUE;
- public static String _UI_LABEL_PATTERN;
- public static String _UI_ACTION_CHANGE_MAXIMUM_OCCURRENCE;
- public static String _UI_ERROR_INVALID_VALUE_FOR_MAXIMUM_OCCURRENCE;
- public static String _UI_ACTION_CHANGE_MINIMUM_OCCURRENCE;
- public static String _UI_ACTION_ADD_APPINFO_ELEMENT;
- public static String _UI_ACTION_ADD_APPINFO_ATTRIBUTE;
- public static String _UI_ACTION_DELETE_APPINFO_ELEMENT;
- public static String _UI_ACTION_DELETE_APPINFO_ATTRIBUTE;
- public static String _UI_ACTION_CHANGE_CONTENT_MODEL;
- public static String _UI_ACTION_RENAME;
- public static String _UI_ACTION_CHANGE_ENUMERATION_VALUE;
- public static String _UI_ERROR_INVALID_NAME;
- public static String _UI_LABEL_NAME;
- public static String _UI_LABEL_REFERENCE;
- public static String _UI_ACTION_UPDATE_MAXIMUM_OCCURRENCE;
- public static String _UI_ACTION_UPDATE_MINIMUM_OCCURRENCE;
- public static String _UI_LABEL_READONLY;
- public static String _UI_LABEL_INCLUSIVE;
- public static String _UI_LABEL_COLLAPSE_WHITESPACE;
- public static String _UI_LABEL_SPECIFIC_CONSTRAINT_VALUES;
- public static String _UI_LABEL_RESTRICT_VALUES_BY;
- public static String _UI_LABEL_ENUMERATIONS;
- public static String _UI_LABEL_PATTERNS;
- public static String _UI_LABEL_MINIMUM_LENGTH;
- public static String _UI_LABEL_MAXIMUM_LENGTH;
- public static String _UI_LABEL_CONSTRAINTS_ON_LENGTH_OF;
- public static String _UI_LABEL_CONSTRAINTS_ON_VALUE_OF;
- public static String _UI_LABEL_MINIMUM_VALUE;
- public static String _UI_LABEL_MAXIMUM_VALUE;
- public static String _UI_LABEL_CONTRAINTS_ON;
- public static String _UI_LABEL_TYPE;
- public static String _UI_LABEL_BLOCKDEFAULT;
- public static String _UI_LABEL_FINALDEFAULT;
- public static String _UI_ACTION_CONSTRAIN_LENGTH;
- public static String _UI_ACTION_UPDATE_BOUNDS;
- public static String _UI_ACTION_COLLAPSE_WHITESPACE;
- public static String _UI_LABEL_BASE;
- public static String _UI_ERROR_INVALID_FILE;
- public static String _UI_LABEL_EXTENSIONS;
- public static String _UI_ACTION_ADD_EXTENSION_COMPONENT;
- public static String _UI_ACTION_DELETE_EXTENSION_COMPONENT;
- public static String _UI_LABEL_UP;
- public static String _UI_LABEL_DOWN;
- public static String _UI_LABEL_EXTENSION_DETAILS;
- public static String _UI_ACTION_ADD_DOCUMENTATION;
- public static String _UI_ACTION_ADD_EXTENSION_COMPONENTS;
- public static String _UI_LABEL_EXTENSION_CATEGORIES;
- public static String _UI_LABEL_ADD_WITH_DOTS;
- public static String _UI_LABEL_DELETE;
- public static String _UI_LABEL_EDIT;
- public static String _UI_LABEL_AVAILABLE_COMPONENTS_TO_ADD;
- public static String _UI_LABEL_EDIT_CATEGORY;
- public static String _UI_ERROR_INVALID_CATEGORY;
- public static String _UI_ERROR_FILE_CANNOT_BE_PARSED;
- public static String _UI_ERROR_VALIDATE_THE_FILE;
- public static String _UI_LABEL_SCHEMA;
- public static String _UI_LABEL_ADD_CATEGORY;
- public static String _UI_ERROR_NAME_ALREADY_USED;
- public static String _UI_ACTION_BROWSE_WORKSPACE;
- public static String _UI_LABEL_SELECT_XSD_FILE;
- public static String _UI_DESCRIPTION_CHOOSE_XSD_FILE;
- public static String _UI_ACTION_BROWSE_CATALOG;
- public static String _UI_ACTION_ADD_ANY_ELEMENT;
- public static String _UI_ACTION_ADD_ANY_ATTRIBUTE;
- public static String _UI_ACTION_SET_BASE_TYPE;
- public static String _UI_TOOLTIP_RENAME_REFACTOR;
- public static String _UI_VALUE_COLON;
- public static String _UI_ID;
- public static String _UI_REF;
- public static String _UI_FIXED;
- public static String _UI_DEFAULT;
- public static String _UI_FORM;
- public static String _UI_USAGE;
- public static String _UI_ACTION_CHANGE;
- public static String _UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP;
- public static String _UI_ACTION_NAMESPACE_INFORMATION_CHANGE;
- public static String _UI_LABEL_ABSTRACT;
- public static String _UI_LABEL_BLOCK;
- public static String _UI_LABEL_FINAL;
- public static String _UI_LABEL_SUBSTITUTION_GROUP;
- public static String _UI_LABEL_MIXED;
- public static String _UI_LABEL_VALUE;
- public static String _UI_LABEL_FORM;
- public static String _UI_LABEL_NILLABLE;
- public static String _UI_LABEL_ELEMENTFORMDEFAULT;
- public static String _UI_LABEL_ATTRIBUTEFORMDEFAULT;
- public static String _UI_LABEL_WORKSPACE;
- public static String _UI_LABEL_CATALOG;
- public static String _UI_DELETE_BUTTON;
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java
deleted file mode 100644
index 9510888c09..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java
+++ /dev/null
@@ -1,622 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Naoki Akiyama, Fujitsu - Bug 244901 - Cannot set xsd:annotation to
- * xsd:redefine by Properties view.
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DecorationOverlayIcon;
-import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.adt.design.ImageOverlayDescriptor;
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.AbstractSection;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.XSDXPathDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDCommonUIUtils
-{
- public XSDCommonUIUtils()
- {
- super();
- }
-
- public static Image getUpdatedImage(XSDConcreteComponent input, Image baseImage, boolean isReadOnly)
- {
- XSDAnnotation xsdAnnotation = getInputXSDAnnotation(input, false);
-
- if (xsdAnnotation != null)
- {
- if (xsdAnnotation.getApplicationInformation().size() > 0)
- {
- // Will use the class name appended by the read only state as the name of the image.
- // There is a disabled and an enabled version of each baseImage, so we can't simply
- // use the component name as the name of the image
- String imageName = input.getClass().getName() + isReadOnly;
- Image newImage = XSDEditorPlugin.getDefault().getImageRegistry().get(imageName);
- if (newImage == null)
- {
- ImageOverlayDescriptor ovr = new ImageOverlayDescriptor(baseImage, isReadOnly);
- newImage = ovr.getImage();
- XSDEditorPlugin.getDefault().getImageRegistry().put(imageName, newImage);
- }
- return newImage;
- }
- }
- return baseImage;
- }
-
- public static XSDAnnotation getInputXSDAnnotation(XSDConcreteComponent input, boolean createIfNotExist)
- {
- XSDAnnotation xsdAnnotation = null;
- XSDFactory factory = XSDFactory.eINSTANCE;
- if (input instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration xsdComp = (XSDAttributeDeclaration) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition xsdComp = (XSDAttributeGroupDefinition) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration xsdComp = (XSDElementDeclaration) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDNotationDeclaration)
- {
- XSDNotationDeclaration xsdComp = (XSDNotationDeclaration) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDXPathDefinition)
- {
- XSDXPathDefinition xsdComp = (XSDXPathDefinition) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDModelGroup)
- {
- XSDModelGroup xsdComp = (XSDModelGroup) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDModelGroupDefinition)
- {
- XSDModelGroupDefinition xsdComp = (XSDModelGroupDefinition) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDIdentityConstraintDefinition)
- {
- XSDIdentityConstraintDefinition xsdComp = (XSDIdentityConstraintDefinition) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDWildcard)
- {
- XSDWildcard xsdComp = (XSDWildcard) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDSchema)
- {
- XSDSchema xsdComp = (XSDSchema) input;
- List list = xsdComp.getAnnotations();
- if (list.size() > 0)
- {
- xsdAnnotation = (XSDAnnotation) list.get(0);
- }
- else
- {
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- if (xsdComp.getContents() != null)
- {
- xsdComp.getContents().add(0, xsdAnnotation);
- }
- }
- }
- return xsdAnnotation;
- }
- else if (input instanceof XSDFacet)
- {
- XSDFacet xsdComp = (XSDFacet) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition xsdComp = (XSDTypeDefinition) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDInclude)
- {
- XSDInclude xsdComp = (XSDInclude) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDImport)
- {
- XSDImport xsdComp = (XSDImport) input;
- xsdAnnotation = xsdComp.getAnnotation();
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- xsdComp.setAnnotation(xsdAnnotation);
- }
- }
- else if (input instanceof XSDRedefine)
- {
- XSDRedefine xsdComp = (XSDRedefine) input;
- List contents = xsdComp.getContents();
- for (int i = 0; i < contents.size(); i++)
- {
- Object content = contents.get(i);
- if (content instanceof XSDAnnotation)
- {
- xsdAnnotation = (XSDAnnotation) content;
- break;
- }
- }
- if (createIfNotExist && xsdAnnotation == null)
- {
- xsdAnnotation = factory.createXSDAnnotation();
- contents.add(0, xsdAnnotation);
- }
- return xsdAnnotation;
- }
- else if (input instanceof XSDAnnotation)
- {
- xsdAnnotation = (XSDAnnotation) input;
- }
-
- if (createIfNotExist)
- {
- formatAnnotation(xsdAnnotation);
- }
-
- return xsdAnnotation;
- }
-
- private static void formatAnnotation(XSDAnnotation annotation)
- {
- Element element = annotation.getElement();
- formatChild(element);
- }
-
- public static void formatChild(Node child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode) child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
- public static String createUniqueElementName(String prefix, List elements)
- {
- ArrayList usedNames = new ArrayList();
- for (Iterator i = elements.iterator(); i.hasNext();)
- {
- usedNames.add(getDisplayName((XSDNamedComponent) i.next()));
- }
-
- int i = 1;
- String testName = prefix;
- while (usedNames.contains(testName))
- {
- testName = prefix + i++;
- }
- return testName;
- }
-
- public static String createUniqueEnumerationValue(String prefix, List elements)
- {
- ArrayList usedNames = new ArrayList();
- for (Iterator i = elements.iterator(); i.hasNext();)
- {
- usedNames.add(((XSDEnumerationFacet) i.next()).getLexicalValue());
- }
-
- int i = 1;
- String testName = prefix;
- while (usedNames.contains(testName))
- {
- testName = prefix + i++;
- }
- return testName;
- }
-
- public static String getDisplayName(XSDNamedComponent component)
- {
- if (component instanceof XSDTypeDefinition)
- return getDisplayNameFromXSDType((XSDTypeDefinition) component);
-
- if (component instanceof XSDFeature)
- {
- XSDFeature feature = (XSDFeature) component;
- if (feature.getName() != null)
- return feature.getName();
- else if (feature.getResolvedFeature() != null && feature.getResolvedFeature().getName() != null)
- return feature.getResolvedFeature().getName();
- }
-
- return component.getName();
-
- }
-
- public static String getDisplayNameFromXSDType(XSDTypeDefinition type)
- {
- return getDisplayNameFromXSDType(type, true);
- }
-
- public static String getDisplayNameFromXSDType(XSDTypeDefinition type, boolean returnPrimitiveParents)
- {
- if (type == null)
- return null;
-
- if (type.getName() == null || type.getName().length() == 0)
- {
- if (returnPrimitiveParents && isPrimitiveType(type))
- {
- return getDisplayNameFromXSDType(type.getBaseType());
- }
-
- EObject container = type.eContainer();
-
- while (container != null)
- {
- if (container instanceof XSDNamedComponent && ((XSDNamedComponent) container).getName() != null)
- {
- return ((XSDNamedComponent) container).getName();
- }
- container = container.eContainer();
- }
- return null;
- }
- else
- return type.getName();
- }
-
- public static boolean isPrimitiveType(XSDTypeDefinition type)
- {
- if (type instanceof XSDComplexTypeDefinition)
- return false;
-
- XSDTypeDefinition baseType = null;
- if (type != null)
- {
- baseType = type.getBaseType();
- XSDTypeDefinition origType = baseType; // KC: although invalid, we need to
- // prevent cycles and to avoid an
- // infinite loop
- while (baseType != null && !XSDConstants.isAnySimpleType(baseType) && !XSDConstants.isAnyType(baseType) && origType != baseType)
- {
- type = baseType;
- baseType = type.getBaseType();
- }
- baseType = type;
- }
- else
- {
- return false;
- }
-
- return (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(baseType.getTargetNamespace()));
- }
-
- public static XSDSimpleTypeDefinition getAnonymousSimpleType(XSDFeature input, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition anonymousSimpleType = null;
- XSDTypeDefinition localType = null;
-
- if (input instanceof XSDElementDeclaration)
- {
- localType = ((XSDElementDeclaration) input).getAnonymousTypeDefinition();
- }
- else if (input instanceof XSDAttributeDeclaration)
- {
- localType = ((XSDAttributeDeclaration) input).getAnonymousTypeDefinition();
- }
-
- if (localType instanceof XSDSimpleTypeDefinition)
- {
- anonymousSimpleType = (XSDSimpleTypeDefinition) localType;
- }
- return anonymousSimpleType;
- }
-
- // bug246036 - check for cyclic groups. We should refactor out this static class.
- private static Stack visitedGroups = new Stack();
-
- public static void resetVisitedGroupsStack()
- {
- visitedGroups.clear();
- }
-
- public static List getChildElements(XSDModelGroup group)
- {
- List children = new ArrayList();
- visitedGroups.push(group);
- if (group == null) return children;
-
- for (Iterator i = group.getContents().iterator(); i.hasNext();)
- {
- XSDParticle next = (XSDParticle) i.next();
- if (next.getContent() instanceof XSDFeature)
- {
- if (children.contains(next.getContent())) break;
- children.add(next.getContent());
- }
- else if (next.getTerm() instanceof XSDModelGroup)
- {
- if (!visitedGroups.contains(group))
- children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
- }
- }
- visitedGroups.pop();
- return children;
- }
-
- public static List getAllAttributes(XSDComplexTypeDefinition xsdComplexType)
- {
- List attributes = getChildElements(xsdComplexType);
- attributes.addAll(getChildAttributes(xsdComplexType));
-
- return attributes;
- }
-
- public static List getAllAttributes(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- List attributes = getChildElements(xsdModelGroupDefinition);
-
- return attributes;
- }
-
- public static List getInheritedAttributes(XSDComplexTypeDefinition ct)
- {
- List attrs = new ArrayList();
- XSDTypeDefinition parent = ct.getBaseTypeDefinition();
- if (parent != null && parent instanceof XSDComplexTypeDefinition && ct.isSetDerivationMethod())
- {
- attrs.addAll(getAllAttributes((XSDComplexTypeDefinition) parent));
- if (! ct.isCircular()) attrs.addAll(getInheritedAttributes((XSDComplexTypeDefinition) parent));
- }
-
- return attrs;
- }
-
- public static List getChildElements(XSDComplexTypeDefinition ct)
- {
- return getChildElements(getModelGroup(ct));
- }
-
- public static List getChildElements(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- return getChildElements(xsdModelGroupDefinition.getModelGroup());
- }
-
- public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
- {
- XSDParticle particle = cType.getComplexType();
-
- if (particle == null || particle.eContainer() != cType)
- return null;
-
- Object particleContent = particle.getContent();
- XSDModelGroup group = null;
-
- if (particleContent instanceof XSDModelGroupDefinition)
- group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup();
- else if (particleContent instanceof XSDModelGroup)
- group = (XSDModelGroup) particleContent;
-
- if (group == null)
- return null;
-
- if (group.getContents().isEmpty() || group.eResource() != cType.eResource())
- {
- XSDComplexTypeContent content = cType.getContent();
- if (content instanceof XSDParticle)
- group = (XSDModelGroup) ((XSDParticle) content).getContent();
- }
-
- return group;
- }
-
- public static List getChildAttributes(XSDComplexTypeDefinition ct)
- {
- EList attrContents = ct.getAttributeContents();
- List attrs = new ArrayList();
- for (int i = 0; i < attrContents.size(); i++)
- {
- Object next = attrContents.get(i);
-
- if (next instanceof XSDAttributeUse)
- {
- attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration());
- }
- else if (next instanceof XSDAttributeGroupDefinition)
- {
- //XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
- }
- }
- return attrs;
- }
-
- public static Image getImageWithErrorOverlay(XSDConcreteComponent input, Image baseImage, boolean isReadOnly)
- {
- Image extensionImage = getUpdatedImage(input, baseImage, isReadOnly);
- ImageDescriptor errorOverlay = XSDEditorPlugin.getImageDescriptor("icons/ovr16/error_ovr.gif"); //$NON-NLS-1$
- if (baseImage == extensionImage)
- {
- String imageName = input.getClass().getName() + "_error_" + isReadOnly;
- Image newImage = XSDEditorPlugin.getDefault().getImageRegistry().get(imageName);
- if (newImage == null)
- {
- DecorationOverlayIcon ovr = new DecorationOverlayIcon(baseImage, errorOverlay, IDecoration.TOP_LEFT);
- newImage = ovr.createImage();
- XSDEditorPlugin.getDefault().getImageRegistry().put(imageName, newImage);
- }
- return newImage;
- }
- else
- {
- String imageName = input.getClass().getName() + "_extension_error_" + isReadOnly;
- Image newImage = XSDEditorPlugin.getDefault().getImageRegistry().get(imageName);
- if (newImage == null)
- {
- DecorationOverlayIcon ovr = new DecorationOverlayIcon(extensionImage, errorOverlay, IDecoration.TOP_LEFT);
- newImage = ovr.createImage();
- XSDEditorPlugin.getDefault().getImageRegistry().put(imageName, newImage);
- }
- return newImage;
- }
- }
-
- public static CCombo getNewPropertiesCombo(Composite composite, TabbedPropertySheetWidgetFactory widgetFactory,
- AbstractSection listener, String[] items, String helpID)
- {
- CCombo combo = widgetFactory.createCCombo(composite);
- combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- combo.setEditable(false);
- combo.setItems(items);
- combo.addSelectionListener(listener);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, helpID);
- return combo;
- }
-
- public static CLabel getNewPropertiesLabel(Composite composite, TabbedPropertySheetWidgetFactory widgetFactory,
- String labelText)
- {
- // Create label
- CLabel label;
- label = widgetFactory.createCLabel(composite, labelText);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false;
- label.setLayoutData(data);
-
- return label;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java
deleted file mode 100644
index 39a1d8b6c9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java
+++ /dev/null
@@ -1,815 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.common.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This class performs cleanup/removal of unused XSD imports and includes from XML Schemas
- * and xmlns entries in the namespace table
- */
-public class XSDDirectivesManager
-{
- protected static final String XMLNS = "xmlns"; //$NON-NLS-1$
- // List of all the unused directives. These will be removed
- protected List unusedDirectives = new ArrayList();
- // List of all the included XSDSchema's
- protected List usedIncludeSchemas = new ArrayList();
- // List of all the XSDInclude's that are indirectly used
- protected List usedIndirectIncludes = new ArrayList();
- // List of the XSDInclude's that are directly used
- protected List usedDirectIncludes = new ArrayList();
- // Used to track the included schemas that were analyzed to avoid circular loop
- protected List analyzedIncludeSchemas = new ArrayList();
- // List of all the imported used schemas
- protected List usedSchemas = new ArrayList();
- // List of all the indirectly used includes
- protected Map usedIndirectIncludesMap = new HashMap();
- // Keep track of all the unused prefixes
- protected Set unusedPrefixes;
- // Keep track of all the used prefixes
- protected Set usedPrefixes;
- // Map of each schema's unused prefixes
- protected Map schemaToPrefixMap;
-
- public static void removeUnusedXSDImports(XSDSchema schema)
- {
- // Only do the removal if the preference is turned on
- if (XSDEditorPlugin.getDefault().getRemoveImportSetting())
- {
- XSDDirectivesManager mgr = new XSDDirectivesManager();
- mgr.performRemoval(schema);
- mgr.cleanup();
- }
- }
-
- /**
- * Main method to do the cleanup
- * @param schema
- */
- public void performRemoval(XSDSchema schema)
- {
- // Compute unused imports and unused prefixes
- computeUnusedImports(schema);
- // Remove the imports
- removeUnusedImports();
- // Remove the prefixes
- removeUnusedPrefixes();
- }
-
- /**
- * Clients can manually clean the lists
- */
- public void cleanup()
- {
- clearMaps();
- }
-
- /**
- * After performing the cleanup, return the list of unused XSD directives
- *
- * @return list of unused XSD directives
- */
- public List getUnusedXSDDirectives()
- {
- return unusedDirectives;
- }
-
- /**
- * After performing the cleanup, return the map of each schemas unused prefixes
- *
- * @return map of each schemas unused prefixes
- */
- public Map getSchemaToPrefixMap()
- {
- return schemaToPrefixMap;
- }
-
- /**
- * Returns the set of unused prefixes from the XML namespace table
- *
- * @return set of unused prefixes
- */
- public Set getUnusedPrefixes()
- {
- return unusedPrefixes;
- }
-
- /**
- * Returns the set of used prefixes from the XML namespace table
- *
- * @return set of used prefixes
- */
- public Set getUsedPrefixes()
- {
- return usedPrefixes;
- }
-
- /**
- * Perform any cleanup after computing and removing the unused imports.
- */
- protected void clearMaps()
- {
- if (schemaToPrefixMap != null)
- {
- schemaToPrefixMap.clear();
- }
- }
-
- /**
- * Remove the list of all unused imports. Imports is used in the generic term here.
- */
- protected void removeUnusedImports()
- {
- Iterator iter = unusedDirectives.iterator();
- while (iter.hasNext())
- {
- XSDSchemaDirective xsdDirective = (XSDSchemaDirective) iter.next();
- removeXSDDirective(xsdDirective);
- }
- }
-
- /**
- * Removes the directive from the model
- * @param xsdImport
- */
- protected void removeXSDDirective(XSDSchemaDirective xsdImport)
- {
- XSDSchema schema = xsdImport.getSchema();
-
- Element element = xsdImport.getElement();
-
- Document doc = element.getOwnerDocument();
-
- if (doc instanceof IDOMNode)
- ((IDOMNode)doc).getModel().aboutToChangeModel();
-
- try
- {
- if (!removeTextNodesBetweenNextElement(element))
- {
- removeTextNodeBetweenPreviousElement(element);
- }
- element.getParentNode().removeChild(element);
- }
- finally
- {
- if (doc instanceof IDOMNode)
- {
- ((IDOMNode)doc).getModel().changedModel();
- }
- schema.update(true);
- }
-
- }
-
- /**
- * This computes the list of unused imports for a schema
- * @param schema
- */
- protected void computeUnusedImports(XSDSchema schema)
- {
- unusedDirectives = new ArrayList();
- usedSchemas = new ArrayList();
- usedPrefixes = new HashSet();
- schemaToPrefixMap = new HashMap();
-
- try
- {
- // Step One. Find unused imports using cross referencer
- Map xsdNamedComponentUsage = TopLevelComponentCrossReferencer.find(schema);
-
- doCrossReferencer(schema, usedSchemas, xsdNamedComponentUsage);
-
- // Step Two. Update the unusedImport list given the list of used schemas obtained from cross referencing
- addToUnusedImports(schema, usedSchemas);
-
- // Step Three. Compute unused prefixes to be removed
- computeUnusedPrefixes(schema);
- }
- catch (Exception e)
- {
- unusedDirectives.clear();
- schemaToPrefixMap.clear();
- }
- }
-
- /**
- * Computes the list of unused prefixes from the XML namespace table given a schema
- * @param schema
- */
- protected void computeUnusedPrefixes(XSDSchema schema)
- {
- Map prefixMap = schema.getQNamePrefixToNamespaceMap();
- Set definedPrefixes = prefixMap.keySet();
- Set actualSet = new HashSet();
- NamedNodeMap attributes = schema.getElement().getAttributes();
- Iterator iter = definedPrefixes.iterator();
- while (iter.hasNext())
- {
- String pref = (String)iter.next();
- if (pref == null)
- {
- if (attributes.getNamedItem(XMLNS) != null)
- actualSet.add(null);
- }
- else
- {
- if (attributes.getNamedItem(XMLNS + ":" + pref) != null) //$NON-NLS-1$
- actualSet.add(pref);
- }
- }
-
- unusedPrefixes = new HashSet(actualSet);
-
- usedPrefixes.add(schema.getSchemaForSchemaQNamePrefix());
-
- Element element = schema.getElement();
-
- NodeList childElements = element.getChildNodes();
- int length = childElements.getLength();
- for (int i = 0; i < length; i++)
- {
- Node node = childElements.item(i);
- if (node instanceof Element)
- {
- traverseDOMElement((Element)node, schema);
- }
- }
-
- // compute the used prefixes
- computeUsedXSDPrefixes(schema);
-
- // remove the used prefixes from the unused to get the list of unused prefixes
- unusedPrefixes.removeAll(usedPrefixes);
-
- // perform additional process from extenders
- doAdditionalProcessing(schema);
-
- schemaToPrefixMap.put(schema, unusedPrefixes);
- }
-
- /**
- * Remove unused prefixes from the XML namespace table
- */
- protected void removeUnusedPrefixes()
- {
- Set schemaSet = schemaToPrefixMap.keySet();
- Iterator iter = schemaSet.iterator();
- while (iter.hasNext())
- {
- XSDSchema schema = (XSDSchema)iter.next();
- Map prefixMap = schema.getQNamePrefixToNamespaceMap();
- Set prefixesToRemove = (Set)schemaToPrefixMap.get(schema);
- Iterator iter2 = prefixesToRemove.iterator();
- while (iter2.hasNext())
- {
- String string = (String)iter2.next();
- if (prefixMap.containsKey(string))
- prefixMap.remove(string);
- }
- }
- }
-
- /**
- * Extenders can customize
- * @param schema
- */
- protected void doAdditionalProcessing(XSDSchema schema)
- {
- // Do nothing for XSD
- }
-
- /**
- *
- * @param schema
- */
- private void computeUsedXSDPrefixes(XSDSchema schema)
- {
- Map prefixMap = schema.getQNamePrefixToNamespaceMap();
- Set definedPrefixes = prefixMap.keySet();
-
- boolean foundEntryForTargetNamespace = false;
- String targetNamespace = schema.getTargetNamespace();
- for (Iterator iter = usedPrefixes.iterator(); iter.hasNext(); )
- {
- String key = (String) iter.next();
- String value = (String) prefixMap.get(key);
- if (targetNamespace == null && value == null)
- {
- foundEntryForTargetNamespace = true;
- break;
- }
- else if (targetNamespace != null && value != null)
- {
- if (targetNamespace.equals(value))
- {
- foundEntryForTargetNamespace = true;
- break;
- }
- }
- }
-
- if (!foundEntryForTargetNamespace)
- {
- for (Iterator iter = definedPrefixes.iterator(); iter.hasNext();)
- {
- String key = (String) iter.next();
- String value = (String) prefixMap.get(key);
- if (targetNamespace == null && value == null)
- {
- usedPrefixes.add(null);
- break;
- }
- else if (targetNamespace != null && value != null)
- {
- if (targetNamespace.equals(value))
- {
- usedPrefixes.add(key);
- break;
- }
- }
- }
- }
- }
-
- /**
- * Find prefixes that are in the document.
- * @param element
- * @param schema
- */
- private void traverseDOMElement(Element element, XSDSchema schema)
- {
- String prefix = element.getPrefix();
- usedPrefixes.add(prefix);
-
- NamedNodeMap attrs = element.getAttributes();
- int numOfAttrs = attrs.getLength();
- for (int i = 0; i < numOfAttrs; i++)
- {
- Node node = attrs.item(i);
- String attrPrefix = node.getPrefix();
- if (attrPrefix != null)
- {
- usedPrefixes.add(attrPrefix);
- }
-
- String attr = node.getLocalName();
- if (attr != null)
- {
- String value = node.getNodeValue();
- if (value == null) continue;
- if (attr.equals(XSDConstants.REF_ATTRIBUTE) ||
- attr.equals(XSDConstants.REFER_ATTRIBUTE) ||
- attr.equals(XSDConstants.TYPE_ATTRIBUTE) ||
- attr.equals(XSDConstants.BASE_ATTRIBUTE) ||
- attr.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE) ||
- attr.equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
- {
- try
- {
- usedPrefixes.add(extractPrefix(value));
- }
- catch (IndexOutOfBoundsException e)
- {
- }
- }
- else if (attr.equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
- {
- StringTokenizer tokenizer = new StringTokenizer(value);
- while (tokenizer.hasMoreTokens())
- {
- try
- {
- String token = tokenizer.nextToken();
- usedPrefixes.add(extractPrefix(token));
- }
- catch (IndexOutOfBoundsException e)
- {
- }
- }
- }
- }
- }
-
- NodeList childElements = element.getChildNodes();
- int length = childElements.getLength();
- for (int i = 0; i < length; i++)
- {
- Node node = childElements.item(i);
- if (node instanceof Element)
- {
- traverseDOMElement((Element)node, schema);
- }
- }
- }
-
- /**
- * Extract the prefix from the given string. For example, pref:attr returns pref.
- * @param value
- * @return the prefix
- */
- protected String extractPrefix(String value)
- {
- int index = value.indexOf(':');
- if (index < 0)
- return null;
- else
- return value.substring(0, index);
- }
-
- /**
- * This determines the list of referenced components and hence the used schemas from which
- * we can determine what are the unused directives
- *
- * @param schema
- * @param unusedImportList
- * @param usedSchemas
- */
- protected void doCrossReferencer(XSDSchema schema, List usedSchemas, Map xsdNamedComponentUsage)
- {
- // Calculate additional unused imports that may have the same
- // namespace that did not get added in the initial pass
- Iterator iterator = xsdNamedComponentUsage.keySet().iterator();
- // First determine the used schemas from the cross referencer
- while (iterator.hasNext())
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) iterator.next();
- XSDSchema namedComponentSchema = namedComponent.getSchema();
- // If the named component belongs to the same schema, then continue...we
- // want to check the external references
- if (namedComponentSchema == schema)
- {
- continue;
- }
- Collection collection = (Collection) xsdNamedComponentUsage.get(namedComponent);
- Iterator iterator2 = collection.iterator();
- while (iterator2.hasNext())
- {
- Setting setting = (Setting) iterator2.next();
- Object obj = setting.getEObject();
- if (isComponentUsed(obj, schema, namedComponentSchema))
- {
- if (!usedSchemas.contains(namedComponentSchema))
- usedSchemas.add(namedComponentSchema);
- }
- }
- }
- }
-
- /**
- * Determines if the object to be analyzed is referenced by the schema
- * @param obj
- * @param schema
- * @param targetSchema
- * @return true if the component is referenced by the schema, false if not referenced
- */
- protected boolean isComponentUsed(Object obj, XSDSchema schema, XSDSchema targetSchema)
- {
- if (obj instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent) obj;
- if (component == schema || component instanceof XSDSchema)
- {
- return false;
- }
- if (!usedIncludeSchemas.contains(targetSchema))
- usedIncludeSchemas.add(targetSchema);
- return true;
- }
- return false;
- }
-
- /**
- * From a list of used schemas, update the unusedImports list for the given schema
- *
- * @param schema
- * @param unusedImports
- * @param usedSchemas
- */
- protected void addToUnusedImports(XSDSchema schema, List usedSchemas)
- {
- // now that we have the list of usedSchemas, get the list of unused
- // schemas by comparing this list to what is actually in the schema
- Iterator iter = schema.getContents().iterator();
- while(iter.hasNext())
- {
- Object o = iter.next();
- if (o instanceof XSDSchemaDirective)
- {
- XSDSchemaDirective directive = (XSDSchemaDirective) o;
- boolean isUsed = false;
- Iterator iter2 = usedSchemas.iterator();
- while (iter2.hasNext())
- {
- XSDSchema usedSchema = (XSDSchema) iter2.next();
- if (directive instanceof XSDImport && directive.getResolvedSchema() == usedSchema)
- {
- isUsed = true;
- break;
- }
- if (directive instanceof XSDInclude && ((XSDInclude)directive).getIncorporatedSchema() == usedSchema)
- {
- isUsed = true;
- usedDirectIncludes.add(usedSchema);
- break;
- }
- // blindly accept redefines as used
- if (directive instanceof XSDRedefine)
- {
- isUsed = true;
- break;
- }
- }
-
- // If it is an include, we need to check if it is used indirectly
- if (directive instanceof XSDInclude && !isUsed)
- {
- XSDInclude inc = (XSDInclude)directive;
- XSDSchema incSchema = inc.getIncorporatedSchema();
- if (incSchema != null)
- {
- XSDSchema usedSchema = getUsedIncludeSchema(incSchema, inc);
- if (usedSchema != null)
- {
- usedIndirectIncludes.add(directive);
- usedIndirectIncludesMap.put(directive, usedSchema);
- isUsed = true;
- }
- else
- {
- isUsed = false;
- }
- }
- }
-
- // If resolved directives are determined unused
- // If resolved directives are not already in the unused list
- // Also any redefines should be considered used
- if (!isUsed && !unusedDirectives.contains(directive) && !(directive instanceof XSDRedefine))
- {
- unusedDirectives.add(directive);
- }
- }
- }
- Iterator iter3 = usedIndirectIncludes.iterator();
- while (iter3.hasNext())
- {
- Object o = iter3.next();
- if (o instanceof XSDInclude)
- {
- XSDInclude inc = (XSDInclude)o;
- XSDSchema targetSchema = (XSDSchema)usedIndirectIncludesMap.get(inc);
- if (usedIncludeSchemas.contains(targetSchema) && usedDirectIncludes.contains(targetSchema))
- {
- unusedDirectives.add(inc);
- }
- else
- {
- usedDirectIncludes.add(targetSchema);
- }
- }
- }
- }
-
- /**
- * Includes can be used indirectly. If the schema includes A which includes B, but the schema
- * references something in B, then A is indirectly used, and hence A cannot be removed.
- *
- * @param schema
- * @param xsdInclude
- * @return the referenced schema if used, null if not used
- */
- private XSDSchema getUsedIncludeSchema(XSDSchema schema, XSDInclude xsdInclude)
- {
- XSDSchema refSchema = null;
- boolean isUsed = false;
- Iterator iter = schema.getContents().iterator();
- while (iter.hasNext())
- {
- Object o = iter.next();
- if (o instanceof XSDInclude)
- {
- XSDInclude inc = (XSDInclude)o;
- XSDSchema incSchema = inc.getIncorporatedSchema();
- if (incSchema != null)
- {
- Iterator iter2 = usedIncludeSchemas.iterator();
- while (iter2.hasNext())
- {
- XSDSchema xsdSch = (XSDSchema)iter2.next();
- if (incSchema == xsdSch)
- {
- isUsed = true;
- refSchema = incSchema;
- break;
- }
- }
-
- if (!isUsed)
- {
- if (!analyzedIncludeSchemas.contains(incSchema)) // To prevent infinite cycle
- {
- analyzedIncludeSchemas.add(incSchema);
- refSchema = getUsedIncludeSchema(incSchema, inc);
- }
- }
- if (isUsed || refSchema != null)
- {
- return refSchema;
- }
- }
- }
- else
- {
- break;
- }
- }
- return refSchema;
- }
-
- /**
- * See cross reference for more details.
- */
- protected static class TopLevelComponentCrossReferencer extends XSDUtil.XSDNamedComponentCrossReferencer
- {
- private static final long serialVersionUID = 1L;
-
- XSDSchema schemaForSchema = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- XSDSchema schemaForXSI = XSDSchemaImpl.getSchemaInstance(XSDConstants.SCHEMA_INSTANCE_URI_2001);
-
- protected TopLevelComponentCrossReferencer(EObject arg0)
- {
- super(arg0);
- }
-
- /**
- * Returns a map of all XSDNamedComponent cross references in the content
- * tree.
- */
- public static Map find(EObject eObject)
- {
- TopLevelComponentCrossReferencer result = new TopLevelComponentCrossReferencer(eObject);
- result.crossReference();
- result.done();
- return result;
- }
-
- protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject)
- {
- if (crossReferencedEObject instanceof XSDNamedComponent)
- {
- XSDNamedComponent namedComponent = (XSDNamedComponent) crossReferencedEObject;
-
- if (namedComponent.getContainer() == schemaForSchema ||
- namedComponent.getContainer() == schemaForXSI ||
- crossReferencedEObject.eContainer() == eObject ||
- namedComponent.getName() == null)
- {
- return false;
- }
-
- if (namedComponent instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) namedComponent;
- if (!(typeDefinition.getContainer() instanceof XSDSchema))
- {
- return false;
- }
- if (typeDefinition.getName() == null)
- {
- return false;
- }
- }
- return true;
- }
- return false;
- }
- }
-
- /**
- * Helper method to remove Text nodes
- * @param element
- * @return
- */
- protected boolean removeTextNodesBetweenNextElement(Element element)
- {
- List nodesToRemove = new ArrayList();
- for (Node node = element.getNextSibling(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.TEXT_NODE)
- {
- nodesToRemove.add(node);
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- for (Iterator j = nodesToRemove.iterator(); j.hasNext();)
- {
- Node nodeToRemove = (Node) j.next();
- nodeToRemove.getParentNode().removeChild(nodeToRemove);
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Helper method to remove Text nodes.
- * @param element
- * @return
- */
- protected boolean removeTextNodeBetweenPreviousElement(Element element)
- {
- List nodesToRemove = new ArrayList();
- for (Node node = element.getPreviousSibling(); node != null; node = node.getPreviousSibling())
- {
- if (node.getNodeType() == Node.TEXT_NODE)
- {
- nodesToRemove.add(node);
- }
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- for (Iterator j = nodesToRemove.iterator(); j.hasNext();)
- {
- Node nodeToRemove = (Node) j.next();
- nodeToRemove.getParentNode().removeChild(nodeToRemove);
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- *
- * @param iFile
- * @param checkPreference - if false, ignore checking the preference setting
- * @throws CoreException
- * @throws IOException
- */
-
- public static void removeUnusedXSDImports(IFile iFile, boolean checkPreference) throws CoreException, IOException
- {
- if (!checkPreference || XSDEditorPlugin.getDefault().getRemoveImportSetting())
- {
- IDOMModel model = (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(iFile);
- if (model != null)
- {
- Document document = model.getDocument();
- if (document != null)
- {
- XSDSchema schema = XSDModelAdapter.lookupOrCreateSchema(document);
- XSDDirectivesManager mgr = new XSDDirectivesManager();
- mgr.performRemoval(schema);
- mgr.cleanup();
- model.save();
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java
deleted file mode 100644
index 1f8c19d636..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.common.util;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.w3c.dom.Element;
-
-public class XSDDirectivesSchemaLocationUpdater
-{
- /**
- * Modifies the schema location by opening the schema location dialog and
- * processing the results. This method refactors the code in
- * XSDImportSection$widgetSelected and SchemaLocationSection$widgetSelected
- * and the processing in handleSchemaLocationChange()
- */
- public static void updateSchemaLocation(XSDSchema xsdSchema, Object selection, boolean isInclude)
- {
- Shell shell = Display.getCurrent().getActiveShell();
- IFile currentIFile = null;
- IEditorInput editorInput = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
- ViewerFilter filter;
-
- if (editorInput instanceof IFileEditorInput)
- {
- currentIFile = ((IFileEditorInput) editorInput).getFile();
- filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$
- new IFile[] { currentIFile }, null);
- }
- else
- {
- filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$
- null, null);
- }
-
- XSDSelectIncludeFileWizard fileSelectWizard = new XSDSelectIncludeFileWizard(xsdSchema, isInclude, XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
- XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
- filter, new StructuredSelection(selection));
-
- WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
- wizardDialog.create();
- wizardDialog.setBlockOnOpen(true);
- int result = wizardDialog.open();
-
- if (result == Window.OK)
- {
- IFile selectedIFile = fileSelectWizard.getResultFile();
- String schemaFileString;
- if (selectedIFile != null && currentIFile != null)
- {
- schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
- }
- else if (selectedIFile != null && currentIFile == null)
- {
- schemaFileString = selectedIFile.getLocationURI().toString();
- }
- else
- {
- schemaFileString = fileSelectWizard.getURL();
- }
-
- String attributeSchemaLocation = "schemaLocation"; //$NON-NLS-1$
- if (selection instanceof XSDImport)
- {
- XSDImport xsdImport = (XSDImport) selection;
- xsdImport.getElement().setAttribute(attributeSchemaLocation, schemaFileString); //$NON-NLS-1$
-
- String namespace = fileSelectWizard.getNamespace();
- if (namespace == null)
- namespace = ""; //$NON-NLS-1$
-
- XSDSchema externalSchema = fileSelectWizard.getExternalSchema();
- java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- Element schemaElement = xsdSchema.getElement();
-
- // update the xmlns in the schema element first, and then update the
- // import element next so that the last change will be in the import element. This keeps the
- // selection on the import element
- TypesHelper helper = new TypesHelper(externalSchema);
- String prefix = helper.getPrefix(namespace, false);
-
- if (map.containsKey(prefix))
- {
- prefix = null;
- }
-
- if (prefix == null || (prefix != null && prefix.length() == 0))
- {
- StringBuffer newPrefix = new StringBuffer("pref"); //$NON-NLS-1$
- int prefixExtension = 1;
- while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
- {
- newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension)); //$NON-NLS-1$
- prefixExtension++;
- }
- prefix = newPrefix.toString();
- }
-
- String attributeNamespace = "namespace"; //$NON-NLS-1$
- if (namespace.length() > 0)
- {
- // if ns already in map, use its corresponding prefix
- if (map.containsValue(namespace))
- {
- TypesHelper typesHelper = new TypesHelper(xsdSchema);
- prefix = typesHelper.getPrefix(namespace, false);
- }
- else
- // otherwise add to the map
- {
- schemaElement.setAttribute("xmlns:" + prefix, namespace); //$NON-NLS-1$
- }
- // prefixText.setText(prefix);
- xsdImport.getElement().setAttribute(attributeNamespace, namespace);
- }
-
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=155885
- // Need to import otherwise the external schema is never
- // resolved. One problem is that the schema location is still null,
- // so the set types dialog will show types that belong to that schema
- // with a null schema location. This should load resource
- // into the resource set
- if (selection instanceof XSDImportImpl) // redundant
- {
- XSDImportImpl xsdImportImpl = (XSDImportImpl) selection;
- xsdImportImpl.importSchema();
- }
-
- }
- else if (selection instanceof XSDInclude)
- {
- XSDInclude xsdInclude = (XSDInclude) selection;
- xsdInclude.getElement().setAttribute(attributeSchemaLocation, schemaFileString);
- }
- else if (selection instanceof XSDRedefine)
- {
- XSDRedefine xsdRedefine = (XSDRedefine) selection;
- xsdRedefine.getElement().setAttribute(attributeSchemaLocation, schemaFileString);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties
deleted file mode 100644
index a5bdc10340..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties
+++ /dev/null
@@ -1,123 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-_UI_ACTION_OPEN_IN_NEW_EDITOR=&Open In New Editor
-_UI_ACTION_DELETE_CONSTRAINTS=Delete Constraints
-_UI_ACTION_DELETE_ENUMERATION=Delete Enumeration
-_UI_ACTION_DELETE_APPINFO_ELEMENT=Delete AppInfo Element
-_UI_ACTION_DELETE_APPINFO_ATTRIBUTE=Delete AppInfo Attribute
-_UI_ACTION_DELETE_EXTENSION_COMPONENT=Delete Extension Component
-_UI_ACTION_ADD_ATTRIBUTE_GROUP=Add Attribute &Group
-_UI_ACTION_ADD_APPINFO_ELEMENT=Add AppInfo Element
-_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
-_UI_ACTION_ADD_GROUP_REF=Add &Group Ref
-_UI_ACTION_ADD_ANY_ELEMENT=Add An&y
-_UI_ACTION_ADD_ANY_ATTRIBUTE=Add A&ny Attribute
-_UI_ACTION_ADD_WITH_DOTS=&Add...
-_UI_ACTION_UPDATE_BOUNDS=Update bounds
-_UI_ACTION_ADD_COMPLEX_TYPE=Add &Complex Type
-_UI_ACTION_ADD_ENUMERATIONS=Add Enumerations
-_UI_ACTION_ADD_DOCUMENTATION=Add Documentation
-_UI_ACTION_CONSTRAIN_LENGTH=Constrain length
-_UI_ACTION_BROWSE_WORKSPACE=Workspace
-_UI_DELETE_BUTTON=&Delete
-_UI_LABEL_NO_ITEMS_SELECTED=No items selected
-_UI_LABEL_ELEMENTFORMDEFAULT=Prefix for &Elements:
-_UI_LABEL_ATTRIBUTEFORMDEFAULT=Prefix for &Attributes:
-_UI_LABEL_BLOCKDEFAULT=&Block default:
-_UI_LABEL_EXTENSION_DETAILS=Extension Details
-_UI_LABEL_EXTENSION_CATEGORIES=Extension &Categories:
-_UI_LABEL_FINALDEFAULT=&Final default:
-_UI_LABEL_COLLAPSE_WHITESPACE=Collapse &whitespace
-_UI_LABEL_RESTRICT_VALUES_BY=&Restrict values by:
-_UI_LABEL_MINIMUM_LENGTH=Mi&nimum length:
-_UI_LABEL_MAXIMUM_LENGTH=Ma&ximum length:
-_UI_LABEL_SELECT_XSD_FILE=Select XSD file
-_UI_LABEL_CONSTRAINTS_ON_VALUE_OF=Constraints on value of
-_UI_ACTION_ADD_SIMPLE_TYPE=Add &Simple Type
-_UI_ACTION_EDIT_WITH_DOTS=&Edit...
-_UI_ACTION_CHANGE_PATTERN=Change pattern
-_UI_ACTION_ADD_ENUMERATION=Add &Enumeration
-_UI_ACTION_INSERT_ENUMERATION=&Insert Enumeration
-_UI_ACTION_CHANGE_ENUMERATION_VALUE=Change Enumeration value
-_UI_ACTION_DELETE_PATTERN=Delete Pattern
-_UI_ACTION_BROWSE_CATALOG=Catalog
-_UI_ACTION_ADD_GROUP=Add &Group
-_UI_ACTION_ADD_PATTERN=Add pattern
-_UI_ACTION_SET_BASE_TYPE=Set &Base Type
-_UI_ERROR_INVALID_NAME=Invalid name
-_UI_ERROR_INVALID_FILE=Invalid file
-_UI_ERROR_INVALID_CATEGORY=Invalid Category
-_UI_ACTION_DELETE=&Delete
-_UI_ACTION_ADD=A&dd
-_UI_ACTION_RENAME=Rename
-_UI_LABEL_PATTERN=Pattern
-_UI_LABEL_PATTERNS=&Patterns
-_UI_LABEL_NAME=&Name:
-_UI_LABEL_TYPE=&Type:
-_UI_LABEL_BASE=&Base:
-_UI_LABEL_UP=Up
-_UI_LABEL_DOWN=Down
-_UI_LABEL_DELETE=&Delete
-_UI_LABEL_SCHEMA=&Schema:
-_UI_LABEL_EDIT=&Edit...
-_UI_LABEL_REFERENCE=Reference:
-_UI_LABEL_READONLY=ReadOnly
-_UI_LABEL_INCLUSIVE=Inclusive
-_UI_LABEL_ENUMERATIONS=&Enumerations
-_UI_LABEL_EXTENSIONS=Extensions
-_UI_LABEL_MINIMUM_VALUE=&Minimum value:
-_UI_LABEL_MAXIMUM_VALUE=Ma&ximum value:
-_UI_LABEL_CONTRAINTS_ON=Constraints on
-_UI_LABEL_ADD_WITH_DOTS=&Add...
-_UI_LABEL_ADD_CATEGORY=Add Category
-_UI_LABEL_EDIT_CATEGORY=Edit Category
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF=Add Attribute &Group Ref
-_UI_ACTION_ADD_EXTENSION_COMPONENT=Add Extension Component
-_UI_ACTION_ADD_EXTENSION_COMPONENTS=Add Extension Components
-_UI_LABEL_CONSTRAINTS_ON_LENGTH_OF=Constraints on length of
-_UI_ACTION_ADD_APPINFO_ATTRIBUTE=Add AppInfo Attribute
-_UI_ACTION_SET_ENUMERATION_VALUE=Set Enumeration Value
-_UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update Element Reference
-_UI_ACTION_UPDATE_MAXIMUM_OCCURRENCE=Update Maximum Occurrence
-_UI_ACTION_UPDATE_MINIMUM_OCCURRENCE=Update Minimum Occurrence
-_UI_ACTION_CHANGE_MAXIMUM_OCCURRENCE=Maximum Occurrence Change
-_UI_ACTION_CHANGE_MINIMUM_OCCURRENCE=Minimum Occurrence Change
-_UI_LABEL_SPECIFIC_CONSTRAINT_VALUES=Specific constraint values
-_UI_LABEL_AVAILABLE_COMPONENTS_TO_ADD=Available com&ponents to Add:
-_UI_ACTION_CHANGE_CONTENT_MODEL=Change Content Model
-_UI_ERROR_FILE_CANNOT_BE_PARSED=The xsd file of the selected category cannot be parsed.
-_UI_DESCRIPTION_CHOOSE_XSD_FILE=Choose an XSD file containing schema for your extensible components
-_UI_ERROR_VALIDATE_THE_FILE=Please validate the file.
-_UI_ERROR_NAME_ALREADY_USED=The name is already being used.
-_UI_ACTION_COLLAPSE_WHITESPACE=Collapse whitespace
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_DEFINITION=Add Attribute Group Definition
-_UI_ERROR_INVALID_VALUE_FOR_MAXIMUM_OCCURRENCE=Invalid value for maximum occurrence
-_UI_TOOLTIP_RENAME_REFACTOR=Click here to invoke the Rename refactoring.
-_UI_VALUE_COLON=Value:
-_UI_ID=ID:
-_UI_REF=Reference:
-_UI_FIXED=Fixed
-_UI_DEFAULT=Default
-_UI_FORM=Form qualification:
-_UI_LABEL_CATALOG=&XML Catalog...
-_UI_LABEL_WORKSPACE=&Workspace...
-_UI_ACTION_CHANGE={0} Change
-_UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP=&Close
-_UI_ACTION_NAMESPACE_INFORMATION_CHANGE=Namespace Information Change
-_UI_LABEL_ABSTRACT=&Abstract:
-_UI_LABEL_BLOCK=&Block:
-_UI_LABEL_FINAL=&Final:
-_UI_LABEL_SUBSTITUTION_GROUP=&Substitution Group:
-_UI_LABEL_MIXED=&Mixed:
-_UI_LABEL_VALUE=&Value
-_UI_USAGE=Usage
-_UI_LABEL_FORM=Form
-_UI_LABEL_NILLABLE=&Nillable: \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
deleted file mode 100644
index 243aa72790..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
+++ /dev/null
@@ -1,38 +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.xsd.ui.internal.refactor;
-
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-
-public class Checks {
-
- public static RefactoringStatus checkName(String name) {
- RefactoringStatus result= new RefactoringStatus();
- if ("".equals(name)) //$NON-NLS-1$
- return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("Checks_Choose_name")); //$NON-NLS-1$
- return result;
- }
-
- public static boolean isAlreadyNamed(RefactoringComponent element, String name){
- return name.equals(element.getName());
- }
-
- public static RefactoringStatus checkComponentName(String name) {
- RefactoringStatus result= new RefactoringStatus();
- if (!NameValidator.isValid(name))
- return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("Checks_Choose_name")); //$NON-NLS-1$
-
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
deleted file mode 100644
index af89666c4e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.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.xsd.ui.internal.refactor;
-
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author ebelisar
- */
-public interface INameUpdating {
-
- public abstract void setNewElementName(String newName);
- public abstract String getNewElementName();
- public abstract String getCurrentElementName();
- public abstract RefactoringStatus checkNewElementName(String newName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
deleted file mode 100644
index 1ff48fe733..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
+++ /dev/null
@@ -1,35 +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.xsd.ui.internal.refactor;
-
-public interface IReferenceUpdating {
-
- /**
- * Checks if this refactoring object is capable of updating references to the renamed element.
- */
- public boolean canEnableUpdateReferences();
-
- /**
- * If <code>canUpdateReferences</code> returns <code>true</code>, then this method is used to
- * inform the refactoring object whether references should be updated.
- * This call can be ignored if <code>canUpdateReferences</code> returns <code>false</code>.
- */
- public void setUpdateReferences(boolean update);
-
- /**
- * If <code>canUpdateReferences</code> returns <code>true</code>, then this method is used to
- * ask the refactoring object whether references should be updated.
- * This call can be ignored if <code>canUpdateReferences</code> returns <code>false</code>.
- */
- public boolean getUpdateReferences();
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java
deleted file mode 100644
index 79dfec10a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java
+++ /dev/null
@@ -1,15 +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.wst.xsd.ui.internal.refactor;
-
-public interface IXSDRefactorConstants {
- String REFACTOR_CONTEXT_MENU_ID = "org.eclipse.wst.xsd.ui.refactorMenuId"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java
deleted file mode 100644
index a257bb7162..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java
+++ /dev/null
@@ -1,65 +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.wst.xsd.ui.internal.refactor;
-
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class MakeAnonymousTypsGlobalEnablementTester extends RefactorEnablementTester
-{
-
- protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
- {
- if (selectedObject == null)
- {
- return false;
- }
-
- XSDSchema selectedComponentSchema = null;
- boolean enable = false;
- selectedComponentSchema = selectedObject.getSchema();
-
- if (selectedComponentSchema != null && selectedComponentSchema == schema)
- {
- enable = true;
- }
-
- if (enable && selectedObject instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition)selectedObject;
- XSDConcreteComponent parent = typeDef.getContainer();
- if (parent instanceof XSDElementDeclaration)
- {
- return true;
- }
- }
- else if (enable && selectedObject instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition)selectedObject;
- XSDConcreteComponent parent = typeDef.getContainer();
- if (parent instanceof XSDElementDeclaration)
- {
- return true;
- }
- else if (parent instanceof XSDAttributeDeclaration)
- {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java
deleted file mode 100644
index e4f4696d53..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java
+++ /dev/null
@@ -1,47 +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.wst.xsd.ui.internal.refactor;
-
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class MakeLocalElementGlobalEnablementTester extends RefactorEnablementTester
-{
- protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
- {
- if (selectedObject == null)
- {
- return false;
- }
-
- boolean enable = false;
- XSDSchema selectedComponentSchema = null;
- selectedComponentSchema = selectedObject.getSchema();
- if (selectedComponentSchema != null && selectedComponentSchema == schema)
- {
- enable = true;
- }
-
- if (enable && selectedObject instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration)selectedObject;
- if (!element.isElementDeclarationReference() && !element.isGlobal())
- {
- return true;
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java
deleted file mode 100644
index 10739ece9b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.refactor;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
-
-public class PerformUnsavedRefactoringOperation implements IWorkspaceRunnable
-{
- private ProcessorBasedRefactoring refactoring;
-
- public PerformUnsavedRefactoringOperation(ProcessorBasedRefactoring refactoring)
- {
- this.refactoring = refactoring;
- }
-
- public void run(IProgressMonitor pm)
- {
- if (pm == null)
- {
- pm = new NullProgressMonitor();
- }
- try
- {
- refactoring.checkAllConditions(pm);
- Change change = refactoring.createChange(pm);
- if (change instanceof CompositeChange)
- {
- CompositeChange compositeChange = (CompositeChange)change;
- setSaveMode(compositeChange);
- }
- change.perform(pm);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private void setSaveMode(CompositeChange composite)
- {
- Change[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- Change child = children[i];
- if (child instanceof TextFileChange)
- {
- ((TextFileChange)child).setSaveMode(TextFileChange.LEAVE_DIRTY);
- }
- else if (child instanceof CompositeChange)
- {
- setSaveMode((CompositeChange)child);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java
deleted file mode 100644
index b912ca0ea3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java
+++ /dev/null
@@ -1,82 +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.wst.xsd.ui.internal.refactor;
-
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-
-public abstract class RefactorEnablementTester extends PropertyTester
-{
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
- {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
- {
- return false;
- }
-
- IWorkbenchPage activePage = window.getActivePage();
- if (activePage == null)
- {
- return false;
- }
-
- IEditorPart editor = activePage.getActiveEditor();
- if (editor == null)
- {
- return false;
- }
-
- XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
-
- if (receiver instanceof IStructuredSelection)
- {
- IStructuredSelection fStructuredSelection = (IStructuredSelection)receiver;
- receiver = fStructuredSelection.getFirstElement();
-
- if (receiver instanceof XSDBaseAdapter)
- {
- receiver = ((XSDBaseAdapter)receiver).getTarget();
- }
-
- if (receiver instanceof XSDConcreteComponent)
- {
- return canEnable((XSDConcreteComponent)receiver, schema);
- }
- else if (receiver instanceof Node)
- {
- Node node = (Node)receiver;
- if (schema != null)
- {
- XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
- return canEnable(concreteComponent, schema);
- }
- }
-
- return true;
- }
- return false;
- }
-
- protected abstract boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema);
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
deleted file mode 100644
index 554bc8a7d8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
+++ /dev/null
@@ -1,62 +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.xsd.ui.internal.refactor;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-public interface RefactoringComponent
-{
- /**
- * @return the name of the component that is refactored. E.g. "foo"
- */
- public String getName();
-
- /**
- * @return the namespace of the component that is refactored. E.g. "http://foo"
- */
- public String getNamespaceURI();
-
- /**
- * The basic DOM element is used by the refactoring processor/participant to get
- * access to the file location.
- *
- * @return the Structured Source Editor XML DOM element object that underlines the
- * combonent being refactore.
- *
- * @see IDOMElement
- */
- public IDOMElement getElement();
-
- /**
- * @return the qualified name of the type of the refactored component.
- *
- * <p>
- * A qualified name consists of a local name and a namespace.
- * E.g. "complexType"-local name, "http://www.w3.org/2001/XMLSchema"-namespace
- * </p>
- *
- * @see QualifiedName
- */
- public QualifiedName getTypeQName();
-
- /**
- * The model object may be required to be given to the refactored participants as is or
- * other objects could be derived from it.
- *
- * @return the principal object being refactored, such as an instance of WSDLElement or
- * XSDNamedComponent
- */
- public Object getModelObject();
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
deleted file mode 100644
index 68ed4b23d5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
+++ /dev/null
@@ -1,49 +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.xsd.ui.internal.refactor;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class RefactoringMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.wst.xsd.ui.internal.refactor.messages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private RefactoringMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- public static String[] getStrings(String keys[]) {
- String[] result= new String[keys.length];
- for (int i= 0; i < keys.length; i++) {
- result[i]= getString(keys[i]);
- }
- return result;
- }
-
- public static String getFormattedString(String key, Object arg) {
- return getFormattedString(key, new Object[] { arg });
- }
-
- public static String getFormattedString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java
deleted file mode 100644
index 99bb97e0a9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java
+++ /dev/null
@@ -1,82 +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.wst.xsd.ui.internal.refactor;
-
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class RenameEnablementTester extends RefactorEnablementTester
-{
- protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
- {
- if (selectedObject == null)
- {
- return false;
- }
-
- XSDNamedComponent selectedComponent = null;
- boolean enable = false;
-
- XSDSchema selectedComponentSchema = null;
- selectedComponentSchema = selectedObject.getSchema();
- if (selectedComponentSchema != null && selectedComponentSchema == schema)
- {
- enable = true;
- }
-
- if (enable && selectedObject instanceof XSDNamedComponent)
- {
- selectedComponent = (XSDNamedComponent)selectedObject;
-
- if (selectedComponent instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration)selectedComponent;
- if (element.isElementDeclarationReference())
- {
- return false;
- }
- if (!element.isGlobal())
- {
- return false;
- }
- }
- if (selectedComponent instanceof XSDTypeDefinition)
- {
- XSDTypeDefinition type = (XSDTypeDefinition)selectedComponent;
- XSDConcreteComponent parent = type.getContainer();
- if (parent instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration element = (XSDElementDeclaration)parent;
- if (element.getAnonymousTypeDefinition().equals(type))
- {
- return false;
- }
- }
- else if (parent instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration element = (XSDAttributeDeclaration)parent;
- if (element.getAnonymousTypeDefinition().equals(type))
- {
- return false;
- }
- }
- }
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
deleted file mode 100644
index e1c53e8e26..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
+++ /dev/null
@@ -1,115 +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.xsd.ui.internal.refactor;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-
-/**
- * A <code>TextChangeManager</code> manages associations between <code>IFile</code> and <code>TextChange</code> objects.
- */
-public class TextChangeManager {
-
- private Map fMap= new HashMap(10); // IFile -> TextChange
-
- private final boolean fKeepExecutedTextEdits;
-
- public TextChangeManager() {
- this(false);
- }
-
- public TextChangeManager(boolean keepExecutedTextEdits) {
- fKeepExecutedTextEdits= keepExecutedTextEdits;
- }
-
- /**
- * Adds an association between the given file and the passed
- * change to this manager.
- *
- * @param file the file (key)
- * @param change the change associated with the file
- */
- public void manage(IFile file, TextChange change) {
- fMap.put(file, change);
- }
-
- /**
- * Returns the <code>TextChange</code> associated with the given file.
- * If the manager does not already manage an association it creates a one.
- *
- * @param file the file for which the text buffer change is requested
- * @return the text change associated with the given file.
- */
- public TextChange get(IFile file) {
- TextChange result= (TextChange)fMap.get(file);
- if (result == null) {
- result= new TextFileChange(file.toString(), file);
- result.setKeepPreviewEdits(fKeepExecutedTextEdits);
- result.initializeValidationData(new NullProgressMonitor());
- fMap.put(file, result);
- }
- return result;
- }
-
- /**
- * Removes the <tt>TextChange</tt> managed under the given key
- * <code>unit<code>.
- *
- * @param unit the key determining the <tt>TextChange</tt> to be removed.
- * @return the removed <tt>TextChange</tt>.
- */
- public TextChange remove(IFile unit) {
- return (TextChange)fMap.remove(unit);
- }
-
- /**
- * Returns all text changes managed by this instance.
- *
- * @return all text changes managed by this instance
- */
- public TextChange[] getAllChanges(){
- return (TextChange[])fMap.values().toArray(new TextChange[fMap.values().size()]);
- }
-
- /**
- * Returns all files managed by this instance.
- *
- * @return all files managed by this instance
- */
- public IFile[] getAllCompilationUnits(){
- return (IFile[]) fMap.keySet().toArray(new IFile[fMap.keySet().size()]);
- }
-
- /**
- * Clears all associations between resources and text changes.
- */
- public void clear() {
- fMap.clear();
- }
-
- /**
- * Returns if any text changes are managed for the specified file.
- *
- * @param file the file
- * @return <code>true</code> if any text changes are managed for the specified file and <code>false</code> otherwise
- */
- public boolean containsChangesIn(IFile file){
- return fMap.containsKey(file);
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
deleted file mode 100644
index ad779b1ee4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
+++ /dev/null
@@ -1,78 +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.xsd.ui.internal.refactor;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-public class XMLRefactoringComponent implements RefactoringComponent
-{
- // The name of the component being refactored
- String name;
-
- // The namespace in which component is defined, e.g. XML or WSDL target namespace
- String targetNamespace;
-
- // Optional model object that is refactored
- Object model;
-
- // SED DOM object that underlines the component being refactored
- IDOMElement domElement;
-
- public XMLRefactoringComponent(Object modelObject, IDOMElement domElement, String name, String namespace)
- {
- super();
- this.model = modelObject;
- this.domElement = domElement;
- this.name = name;
- this.targetNamespace = namespace;
-
-
- }
-
- public XMLRefactoringComponent(IDOMElement domElement, String name, String namespace)
- {
- super();
- this.domElement = domElement;
- this.name = name;
- this.targetNamespace = namespace;
- }
-
- public Object getModelObject()
- {
- return model;
- }
-
- public IDOMElement getElement()
- {
- return domElement;
- }
-
- public String getName()
- {
-
- return name;
- }
-
- public String getNamespaceURI()
- {
- return targetNamespace;
- }
-
-
- public QualifiedName getTypeQName()
- {
- return new QualifiedName(domElement.getNamespaceURI(), domElement.getLocalName());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
deleted file mode 100644
index 891476461f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeAnonymousTypeGobalHandler;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated Use {@link MakeAnonymousTypeGobalHandler}
- */
-public class MakeAnonymousTypeGlobalAction extends XSDSelectionDispatchAction {
-
- private String fParentName;
- private boolean isComplexType = true;
- private XSDTypeDefinition fSelectedComponent;
-
- public MakeAnonymousTypeGlobalAction(ISelection selection, XSDSchema schema) {
- super(selection, schema);
- setText(RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text); //$NON-NLS-1$
- }
-
- public boolean canRun() {
-
- return fSelectedComponent != null;
- }
-
-
- private String getNewDefaultName(){
- if(fParentName != null && !"".equals(fParentName)){ //$NON-NLS-1$
- if(isComplexType){
- return fParentName + "ComplexType"; //$NON-NLS-1$
- }
- else{
- return fParentName + "SimpleType"; //$NON-NLS-1$
- }
- }
- else{
- if(isComplexType){
- return "NewComplexType"; //$NON-NLS-1$
- }
- else{
- return "NewSimpleType"; //$NON-NLS-1$
- }
- }
-
- }
- private boolean canEnable(XSDConcreteComponent xsdComponent){
- if (xsdComponent instanceof XSDComplexTypeDefinition) {
- fSelectedComponent = (XSDComplexTypeDefinition)xsdComponent;
- isComplexType = true;
- XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) xsdComponent;
- XSDConcreteComponent parent = typeDef.getContainer();
- if(parent instanceof XSDElementDeclaration){
- fParentName = ((XSDElementDeclaration)parent).getName();
- return true;
- }
- }
- else if (xsdComponent instanceof XSDSimpleTypeDefinition){
- fSelectedComponent = (XSDSimpleTypeDefinition)xsdComponent;
- isComplexType = false;
- XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComponent;
- XSDConcreteComponent parent = typeDef.getContainer();
- if(parent instanceof XSDElementDeclaration){
- fParentName = ((XSDElementDeclaration)parent).getName();
- return true;
- }
- else if(parent instanceof XSDAttributeDeclaration){
- fParentName = ((XSDAttributeDeclaration)parent).getName();
- return true;
- }
-
- }
- return false;
- }
-
- protected boolean canEnable(Object selectedObject) {
-
- if (selectedObject instanceof XSDConcreteComponent) {
- return canEnable((XSDConcreteComponent)selectedObject) && super.canEnable(selectedObject);
- }
- else if (selectedObject instanceof Node) {
- Node node = (Node) selectedObject;
- XSDConcreteComponent concreteComponent = getSchema().getCorrespondingComponent(node);
- return canEnable(concreteComponent) && super.canEnable(concreteComponent);
-
- }
- return false;
-
- }
-
- public void run1() {
-
- if(fSelectedComponent == null){
- return;
- }
-
- if(fSelectedComponent.getSchema() == null){
- getSchema().updateElement(true);
- }
- MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- try {
- RefactoringWizard wizard = new RenameRefactoringWizard(
- refactoring,
- RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, // TODO: provide correct strings
- RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null);
- RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
- op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
- //triggerBuild();
- } catch (InterruptedException e) {
- // do nothing. User action got cancelled
- }
-
- }
-
- public void run(){
- if(fSelectedComponent == null){
- return;
- }
-
- if(fSelectedComponent.getSchema() == null){
- getSchema().updateElement(true);
- }
- DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
- doc.getModel().beginRecording(
- this,
- RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
- MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
- fSelectedComponent, getNewDefaultName());
- command.run();
- doc.getModel().endRecording(this);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
deleted file mode 100644
index 49d877c8c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeLocalElementGlobalHandler;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeLocalElementGlobalCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated Use {@link MakeLocalElementGlobalHandler}
- */
-public class MakeLocalElementGlobalAction extends XSDSelectionDispatchAction {
-
- XSDElementDeclaration fSelectedComponent;
-
- public MakeLocalElementGlobalAction(ISelection selection, XSDSchema schema) {
- super(selection, schema);
- setText(RefactoringMessages.getString("MakeLocalElementGlobalAction.text")); //$NON-NLS-1$
- }
-
- public boolean canRun() {
-
- return fSelectedComponent != null;
- }
-
- protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
- fSelectedComponent = null;
- if (selectedObject instanceof XSDElementDeclaration) {
- XSDElementDeclaration element = (XSDElementDeclaration) selectedObject;
- if (!element.isElementDeclarationReference() && !element.isGlobal()) {
- fSelectedComponent = element;
- }
- }
- return canRun();
- }
-
-
- protected boolean canEnable(Object selectedObject) {
-
- if (selectedObject instanceof XSDConcreteComponent) {
- return canEnable((XSDConcreteComponent)selectedObject) && super.canEnable(selectedObject);
- }
- else if (selectedObject instanceof Node) {
- Node node = (Node) selectedObject;
- XSDConcreteComponent concreteComponent = getSchema()
- .getCorrespondingComponent(node);
- return canEnable(concreteComponent) && super.canEnable(concreteComponent);
- }
- return false;
-
- }
-
-
- public void run() {
- DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement()
- .getOwnerDocument();
- doc.getModel().beginRecording(this, getText());
- MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(
- fSelectedComponent);
- command.run();
- doc.getModel().endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
deleted file mode 100644
index 01d2fb7546..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
+++ /dev/null
@@ -1,118 +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.xsd.ui.internal.refactor.actions;
-
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-
-
-
-/**
-* Renames a XML Schema element or workbench resource.
-* <p>
-* Action is applicable to selections containing elements of type
-* <code></code> or <code>IResource</code>.
-*
-* <p>
-* This class may be instantiated; it is not intended to be subclassed.
-* </p>
-
-*/
-public class RenameAction extends SelectionDispatchAction {
-
- private SelectionDispatchAction renameComponentAction;
- private SelectionDispatchAction renameResourceAction;
-
-
- public RenameAction(ISelection selection) {
- super(selection);
- setText(RefactoringWizardMessages.RenameAction_text);
- renameResourceAction= new RenameResourceAction(selection);
- renameResourceAction.setText(getText());
-
- }
- public RenameAction(ISelection selection, Object model) {
- super(selection);
- setText(RefactoringWizardMessages.RenameAction_text);
- renameComponentAction= new RenameComponentAction(selection, model);
- renameComponentAction.setText(getText());
- renameResourceAction= new RenameResourceAction(selection);
- renameResourceAction.setText(getText());
-
- }
-
-
-
- /*
- * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- renameComponentAction.selectionChanged(event);
- if (renameResourceAction != null)
- renameResourceAction.selectionChanged(event);
- setEnabled(computeEnabledState());
- }
-
- /*
- * @see SelectionDispatchAction#update(ISelection)
- */
- public void update(ISelection selection) {
- if(renameComponentAction != null){
- renameComponentAction.update(selection);
- }
- if (renameResourceAction != null)
- renameResourceAction.update(selection);
- setEnabled(computeEnabledState());
- }
-
- private boolean computeEnabledState(){
- if (renameResourceAction != null) {
- return renameComponentAction.isEnabled() || renameResourceAction.isEnabled();
- } else {
- return renameComponentAction.isEnabled();
- }
- }
-
- public void run(IStructuredSelection selection) {
- if (renameComponentAction != null && renameComponentAction.isEnabled())
- renameComponentAction.run(selection);
- if (renameResourceAction != null && renameResourceAction.isEnabled())
- renameResourceAction.run(selection);
- }
-
- public void run(ITextSelection selection) {
- if (renameComponentAction != null && renameComponentAction.canRun())
- renameComponentAction.run(selection);
- else
- MessageDialog.openInformation(XSDEditorPlugin.getShell(), RefactoringWizardMessages.RenameAction_rename, RefactoringWizardMessages.RenameAction_unavailable);
- }
- public void run(ISelection selection) {
- if(selection == null){
- super.run();
- }
- else{
- super.run(selection);
- }
-
- }
- public final void setRenameComponentAction(
- SelectionDispatchAction renameComponentAction)
- {
- this.renameComponentAction = renameComponentAction;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
deleted file mode 100644
index e0447ef2de..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.common.ui.internal.dialogs.SaveDirtyFilesDialog;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated Use {@link RenameHandler}
- */
-public class RenameComponentAction extends XSDSelectionDispatchAction {
-
- private XSDNamedComponent selectedComponent;
-
- public RenameComponentAction(ISelection selection,
- Object aModel) {
- super(selection, aModel);
-
- }
-
- protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
- selectedComponent = null;
- if (selectedObject instanceof XSDNamedComponent) {
- selectedComponent = (XSDNamedComponent) selectedObject;
-
- // if it's element reference, then this action is not appropriate
- if (selectedComponent instanceof XSDElementDeclaration) {
- XSDElementDeclaration element = (XSDElementDeclaration) selectedComponent;
- if (element.isElementDeclarationReference()) {
- selectedComponent = null;
- }
- }
- if(selectedComponent instanceof XSDTypeDefinition){
- XSDTypeDefinition type = (XSDTypeDefinition) selectedComponent;
- XSDConcreteComponent parent = type.getContainer();
- if (parent instanceof XSDElementDeclaration) {
- XSDElementDeclaration element = (XSDElementDeclaration) parent;
- if(element.getAnonymousTypeDefinition().equals(type)){
- selectedComponent = null;
- }
- }
- else if(parent instanceof XSDAttributeDeclaration) {
- XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
- if(element.getAnonymousTypeDefinition().equals(type)){
- selectedComponent = null;
- }
- }
- }
- }
-
- return canRun();
- }
-
- protected boolean canEnable(Object selectedObject) {
-
- if (selectedObject instanceof XSDConcreteComponent)
- {
- return canEnable((XSDConcreteComponent) selectedObject) && super.canEnable(selectedObject);
- } else if (selectedObject instanceof Node)
- {
- Node node = (Node) selectedObject;
- if (getSchema() != null)
- {
- XSDConcreteComponent concreteComponent = getSchema()
- .getCorrespondingComponent(node);
- return canEnable(concreteComponent) && super.canEnable(concreteComponent);
- }
- }
- return false;
-
- }
-
- public boolean canRun() {
-
- return selectedComponent != null;
- }
-
- public void run(ISelection selection) {
- if (selectedComponent.getName() == null) {
- selectedComponent.setName(new String());
- }
- if (selectedComponent.getSchema() == null) {
- if (getSchema() != null) {
- getSchema().updateElement(true);
- }
-
- }
-
- boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
- if (!rc)
- {
- return;
- }
- RefactoringComponent component = new XMLRefactoringComponent(
- selectedComponent,
- (IDOMElement)selectedComponent.getElement(),
- selectedComponent.getName(),
- selectedComponent.getTargetNamespace());
-
- RenameComponentProcessor processor = new RenameComponentProcessor(
- component, selectedComponent.getName());
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- try {
- RefactoringWizard wizard = new RenameRefactoringWizard(
- refactoring,
- RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle,
- RefactoringWizardMessages
- .RenameComponentWizard_inputPage_description,
- null);
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
- wizard);
- op.run(XSDEditorPlugin.getShell(), wizard
- .getDefaultPageTitle());
-
- // TODO (cs) I'm not sure why we need to do this. See bug 145700
- //triggerBuild();
- } catch (InterruptedException e) {
- // do nothing. User action got cancelled
- }
-
- }
-
- public static void triggerBuild() {
- if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
- new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
- .getActiveWorkbenchWindow(),
- IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
deleted file mode 100644
index 17d7d9fa8a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-
-
-
-public class RenameResourceAction extends SelectionDispatchAction {
-
-
-
-
- public RenameResourceAction(ISelection selection)
- {
- super(selection);
- }
-
- public void selectionChanged(IStructuredSelection selection) {
- IResource element= getResource(selection);
- if (element == null) {
- setEnabled(false);
- } else {
- RenameResourceProcessor processor= new RenameResourceProcessor(element);
- setEnabled(processor.isApplicable());
-
- }
- }
-
- public void run(IStructuredSelection selection) {
- IResource resource = getResource(selection);
- RenameResourceProcessor processor= new RenameResourceProcessor(resource);
-
- if(!processor.isApplicable())
- return;
- RenameRefactoring refactoring= new RenameRefactoring(processor);
- try {
- RefactoringWizard wizard = new RenameRefactoringWizard(
- refactoring,
- RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, //TODO: provide correct strings
- RefactoringWizardMessages.RenameComponentWizard_inputPage_description,
- null);
- RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
- op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
- } catch (InterruptedException e) {
- // do nothing. User action got cancelled
- }
-
- }
-
- private static IResource getResource(IStructuredSelection selection) {
- if (selection.size() != 1)
- return null;
- Object first= selection.getFirstElement();
- if (! (first instanceof IResource))
- return null;
- return (IResource)first;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
deleted file mode 100644
index 444a5abbf9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author ebelisar@ca.ibm.com
- */
-public class RenameResourceActionDelegate implements IObjectActionDelegate {
-
- private ISelection fCurrentSelection;
-
-// private IWorkbenchPart fPart;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-// fPart = targetPart;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fCurrentSelection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection= (IStructuredSelection) fCurrentSelection;
- Object first= structuredSelection.getFirstElement();
- if (first instanceof IFile) {
- RenameResourceAction renameAction = new RenameResourceAction(structuredSelection);
- renameAction.run(structuredSelection);
- }
- }
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fCurrentSelection= selection;
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
deleted file mode 100644
index 58ceedc9ac..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameTargetNamespaceProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-
-public class RenameTargetNamespaceAction extends XSDSelectionDispatchAction {
-
- public RenameTargetNamespaceAction(ISelection selection,
- Object aModel) {
- super(selection, aModel);
- setText(RefactoringWizardMessages.RenameTargetNamespace_text);
-
- }
-
-
- protected boolean canEnable(Object selectedObject) {
-
- return super.canEnable(selectedObject);
-
- }
-
- public boolean canRun() {
-
- return getSchema() != null;
- }
-
-
- public void run(ISelection selection) {
-
-
- RenameTargetNamespaceProcessor processor = new RenameTargetNamespaceProcessor(getSchema(), getSchema().getTargetNamespace());
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- try {
- RefactoringWizard wizard = new RenameRefactoringWizard(
- refactoring,
- RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle,//TODO: provide correct strings
- RefactoringWizardMessages.RenameComponentWizard_inputPage_description,
- null);
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
- wizard);
- op.run(XSDEditorPlugin.getShell(), wizard
- .getDefaultPageTitle());
- triggerBuild();
- } catch (InterruptedException e) {
- // do nothing. User action got cancelled
- }
-
- }
-
- public static void triggerBuild() {
- if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
- new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
- .getActiveWorkbenchWindow(),
- IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
deleted file mode 100644
index 7a2aaca5e4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-
-
-/**
- * Action that dispatches the <code>IAction#run()</code> and the
- * <code>ISelectionChangedListener#selectionChanged</code>
- * according to the type of the selection.
- *
- * <ul>
- * <li>if selection is of type <code>ITextSelection</code> then
- * <code>run(ITextSelection)</code> and <code>selectionChanged(ITextSelection)</code>
- * is called.</li>
- * <li>if selection is of type <code>IStructuredSelection</code> then
- * <code>run(IStructuredSelection)</code> and <code>
- * selectionChanged(IStructuredSelection)</code> is called.</li>
- * <li>default is to call <code>run(ISelection)</code> and <code>
- * selectionChanged(ISelection)</code>.</li>
- * </ul>
- *
- * <p>
- * adapted from <code>org.eclipse.jdt.ui.actions.SelectionDispatchAction</code>
- * </p>
- *
- *
- */
-public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener {
-
- private ISelection selection;
-
- private Object model;
-
- protected SelectionDispatchAction(ISelection selection) {
- Assert.isNotNull(selection);
- this.selection = selection;
-
- }
-
- /**
- * Returns the selection provided by the site owning this action.
- *
- * @return the site's selection
- */
- public ISelection getSelection() {
- return selection;
- }
-
- /**
- * Updates the action's enablement state according to the given selection. This
- * default implementation calls one of the <code>selectionChanged</code>
- * methods depending on the type of the passed selection.
- *
- * @param selection the selection this action is working on
- */
- public void update(ISelection selection) {
- dispatchSelectionChanged(selection);
- }
-
- /**
- * Notifies this action that the given structured selection has changed. This default
- * implementation calls <code>selectionChanged(ISelection selection)</code>.
- *
- * @param selection the new selection
- */
- public void selectionChanged(IStructuredSelection selection) {
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- setEnabled(canEnable(object));
- }
- else{
- setEnabled(false);
- }
- }
-
- protected boolean canEnable(Object selectedObject){
- return false;
- }
-
- /**
- * Executes this actions with the given structured selection. This default implementation
- * calls <code>run(ISelection selection)</code>.
- */
- public void run(IStructuredSelection selection) {
- run((ISelection)selection);
- }
-
-
- /**
- * Notifies this action that the given text selection has changed. This default
- * implementation calls <code>selectionChanged(ISelection selection)</code>.
- *
- * @param selection the new selection
- */
- public void selectionChanged(ITextSelection selection) {
- selectionChanged((ISelection)selection);
- }
-
- /**
- * Executes this actions with the given text selection. This default implementation
- * calls <code>run(ISelection selection)</code>.
- */
- public void run(ITextSelection selection) {
- run((ISelection)selection);
- }
-
- /**
- * Notifies this action that the given selection has changed. This default
- * implementation sets the action's enablement state to <code>false</code>.
- *
- * @param selection the new selection
- */
- public void selectionChanged(ISelection selection) {
- setEnabled(false);
- }
-
- /**
- * Executes this actions with the given selection. This default implementation
- * does nothing.
- */
- public void run(ISelection selection) {
-
- }
-
- /* (non-Javadoc)
- * Method declared on IAction.
- */
- public void run() {
- dispatchRun(getSelection());
-
- }
-
- /* (non-Javadoc)
- * Method declared on ISelectionChangedListener.
- */
- public void selectionChanged(SelectionChangedEvent event) {
- dispatchSelectionChanged(event.getSelection());
- }
-
- private void dispatchSelectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- selectionChanged((IStructuredSelection)selection);
- } else if (selection instanceof ITextSelection) {
- selectionChanged((ITextSelection)selection);
- } else {
- selectionChanged(selection);
- }
- }
-
- protected void dispatchRun(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- run((IStructuredSelection)selection);
- } else if (selection instanceof ITextSelection) {
- run((ITextSelection)selection);
- } else {
- run(selection);
- }
- }
-
- public final Object getModel()
- {
- return model;
- }
-
- public final void setModel(Object model)
- {
- this.model = model;
- }
-
- public boolean canRun() {
-
- return true;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
deleted file mode 100644
index 0169f2625e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.refactor.actions;
-
-import java.util.ArrayList;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDRefactorActionGroup extends RefactorActionGroup {
-
- private static final String MAKE_ELEMENT_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"; //$NON-NLS-1$
-
- private static final String MAKE_TYPE_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"; //$NON-NLS-1$
-
- private static final String RENAME_ELEMENT = "org.eclipse.wst.xsd.ui.refactor.rename.element"; //$NON-NLS-1$
-
- //private static final String RENAME_TARGET_NAMESPCE = "org.eclipse.wst.xsd.ui.refactor.renameTargetNamespace"; //$NON-NLS-1$
-
- private SelectionDispatchAction fMakeLocalElementGlobal;
-
- private SelectionDispatchAction fMakeLocalTypeGlobal;
-
- public XSDRefactorActionGroup(ISelection selection,
- XSDSchema schema) {
- super(selection);
- fEditorActions = new ArrayList();
- fRenameAction = new RenameAction(selection, schema);
- fRenameAction.setActionDefinitionId(RENAME_ELEMENT);
- fEditorActions.add(fRenameAction);
-
- //fRenameTargetNamespace = new RenameTargetNamespaceAction(
- // selection, schema);
- //fRenameTargetNamespace.setActionDefinitionId(RENAME_TARGET_NAMESPCE);
- //fEditorActions.add(fRenameTargetNamespace);
-
- fMakeLocalElementGlobal = new MakeLocalElementGlobalAction(
- selection, schema);
- fMakeLocalElementGlobal.setActionDefinitionId(MAKE_ELEMENT_GLOBAL);
- fEditorActions.add(fMakeLocalElementGlobal);
-
- fMakeLocalTypeGlobal = new MakeAnonymousTypeGlobalAction(
- selection, schema);
- fMakeLocalTypeGlobal.setActionDefinitionId(MAKE_TYPE_GLOBAL);
- fEditorActions.add(fMakeLocalTypeGlobal);
-
- initAction(fRenameAction, selection);
- //initAction(fRenameTargetNamespace, selection);
- initAction(fMakeLocalElementGlobal, selection);
- initAction(fMakeLocalTypeGlobal, selection);
- }
-
- public void dispose() {
-// disposeAction(fRenameAction, selection);
-// disposeAction(fMakeLocalElementGlobal, selection);
-// disposeAction(fMakeLocalTypeGlobal, selection);
-// disposeAction(fRenameTargetNamespace, selection);
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
deleted file mode 100644
index a0873fc8cb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.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.wst.xsd.ui.internal.refactor.actions;
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupActionDelegate;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDRefactorGroupActionDelegate extends RefactorGroupActionDelegate {
-
- public XSDRefactorGroupActionDelegate() {
- super();
- }
-
- /**
- * Fills the menu with applicable refactor sub-menues
- * @param menu The menu to fill
- */
- protected void fillMenu(Menu menu) {
- if (fSelection == null) {
- return;
- }
- if (workbenchPart != null) {
- IWorkbenchPartSite site = workbenchPart.getSite();
- if (site == null)
- return;
-
- IEditorPart editor = site.getPage().getActiveEditor();
- if (editor != null) {
- XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
- ISelectionMapper mapper = (ISelectionMapper)editor.getAdapter(ISelectionMapper.class);
- if (schema != null)
- {
- ISelection selection = mapper != null ? mapper.mapSelection(fSelection) : fSelection;
- RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(selection, schema);
- RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
- subMenu.fill(menu, -1);
- }
- }
-
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
deleted file mode 100644
index ba28df9f87..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
+++ /dev/null
@@ -1,54 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDSelectionDispatchAction extends SelectionDispatchAction
-{
-
-
-
- public XSDSelectionDispatchAction(ISelection selection, Object model)
- {
- super(selection);
- setModel(model);
- }
-
- protected XSDSchema getSchema(){
- Object model = getModel();
- if(model instanceof XSDSchema)
- {
- return (XSDSchema) model;
- }
-
- return null;
- }
-
- protected boolean canEnable(Object selectedComponent)
- {
- XSDSchema selectedComponentSchema = null;
- if (selectedComponent instanceof XSDConcreteComponent)
- {
- selectedComponentSchema = ((XSDConcreteComponent)selectedComponent).getSchema();
- }
-
- if (selectedComponentSchema != null && selectedComponentSchema == getSchema() )
- {
- return true;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java
deleted file mode 100644
index efd80873a7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java
+++ /dev/null
@@ -1,138 +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.wst.xsd.ui.internal.refactor.handlers;
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-
-public class MakeAnonymousTypeGobalHandler extends RefactoringHandler
-{
- private String parentName;
- private boolean isComplexType = true;
-
- public Object doExecute(ISelection selection, XSDSchema schema)
- {
- if (selection != null)
- {
- Object selectedObject = ((StructuredSelection)selection).getFirstElement();
-
- if (selectedObject instanceof XSDBaseAdapter)
- {
- selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
- }
-
- XSDConcreteComponent concreteComp = null;
-
- if (selectedObject instanceof Node)
- {
- Node node = (Node)selectedObject;
- concreteComp = schema.getCorrespondingComponent(node);
- }
- else if (selectedObject instanceof XSDConcreteComponent)
- {
- concreteComp = ((XSDConcreteComponent)selectedObject);
- }
-
- if (concreteComp != null)
- {
- if (concreteComp instanceof XSDComplexTypeDefinition)
- {
-
- isComplexType = true;
- XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition)concreteComp;
- XSDConcreteComponent parent = typeDef.getContainer();
- if (parent instanceof XSDElementDeclaration)
- {
- parentName = ((XSDElementDeclaration)parent).getName();
- run(selection, schema, typeDef);
- }
- else if (concreteComp instanceof XSDSimpleTypeDefinition)
- {
- isComplexType = false;
- XSDSimpleTypeDefinition simpleTypeDef = (XSDSimpleTypeDefinition)concreteComp;
- XSDConcreteComponent parentComp = simpleTypeDef.getContainer();
- if (parentComp instanceof XSDElementDeclaration)
- {
- parentName = ((XSDElementDeclaration)parent).getName();
-
- }
- else if (parent instanceof XSDAttributeDeclaration)
- {
- parentName = ((XSDAttributeDeclaration)parent).getName();
-
- }
- run(selection, schema, simpleTypeDef);
- }
- }
- }
- }
-
- return null;
- }
-
- private String getNewDefaultName()
- {
- if (parentName != null && !"".equals(parentName)) { //$NON-NLS-1$
- if (isComplexType)
- {
- return parentName + "ComplexType"; //$NON-NLS-1$
- }
- else
- {
- return parentName + "SimpleType"; //$NON-NLS-1$
- }
- }
- else
- {
- if (isComplexType)
- {
- return "NewComplexType"; //$NON-NLS-1$
- }
- else
- {
- return "NewSimpleType"; //$NON-NLS-1$
- }
- }
-
- }
-
- public void run(ISelection selection, XSDSchema schema, XSDTypeDefinition selectedComponent)
- {
- if (selectedComponent == null)
- {
- return;
- }
-
- if (selectedComponent.getSchema() == null)
- {
- schema.updateElement(true);
- }
- DocumentImpl doc = (DocumentImpl)selectedComponent.getElement().getOwnerDocument();
- doc.getModel().beginRecording(this, RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
- MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(selectedComponent, getNewDefaultName());
- command.run();
- doc.getModel().endRecording(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java
deleted file mode 100644
index 8578d88c01..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java
+++ /dev/null
@@ -1,61 +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.wst.xsd.ui.internal.refactor.handlers;
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeLocalElementGlobalCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-
-public class MakeLocalElementGlobalHandler extends RefactoringHandler
-{
-
- public Object doExecute(ISelection selection, XSDSchema schema)
- {
- if (selection != null)
- {
- Object selectedObject = ((StructuredSelection)selection).getFirstElement();
- if (selectedObject instanceof XSDBaseAdapter)
- {
- selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
- }
- if (selectedObject instanceof XSDElementDeclaration)
- {
- run(selection, (XSDElementDeclaration)selectedObject);
- }
- else if (selectedObject instanceof Node)
- {
- Node node = (Node)selectedObject;
- XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
- if (concreteComponent instanceof XSDElementDeclaration)
- run(selection, (XSDElementDeclaration)concreteComponent);
- }
-
- }
- return null;
- }
-
- public void run(ISelection selection, XSDElementDeclaration selectedComponent)
- {
- DocumentImpl doc = (DocumentImpl)selectedComponent.getElement().getOwnerDocument();
- doc.getModel().beginRecording(this, "MakeLocalElementGlobalHandler.text");
- MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(selectedComponent);
- command.run();
- doc.getModel().endRecording(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java
deleted file mode 100644
index bbe02fc7ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java
+++ /dev/null
@@ -1,44 +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.wst.xsd.ui.internal.refactor.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class RefactoringHandler extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
- if (workbenchWindow == null) return null;
-
- IWorkbenchPage activePage = workbenchWindow.getActivePage();
- if (activePage == null) return null;
-
- IEditorPart editor = activePage.getActiveEditor();
- if (editor == null) return null;
- XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
-
- ISelection selection = activePage.getSelection();
-
- return doExecute(selection, schema);
- }
-
- protected abstract Object doExecute(ISelection selection, XSDSchema schema);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java
deleted file mode 100644
index c06bd43d09..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java
+++ /dev/null
@@ -1,118 +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.wst.xsd.ui.internal.refactor.handlers;
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.common.ui.internal.dialogs.SaveDirtyFilesDialog;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-
-public class RenameHandler extends RefactoringHandler
-{
-
- protected Object doExecute(ISelection selection, XSDSchema schema)
- {
- return execute(selection, schema);
- }
-
- public Object execute(ISelection selection, XSDSchema schema)
- {
- if (selection != null)
- {
-
- Object selectedObject = ((StructuredSelection)selection).getFirstElement();
- if (selectedObject instanceof XSDBaseAdapter)
- {
- selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
- }
-
- if (selectedObject instanceof XSDNamedComponent)
- {
- run(selection, schema, (XSDNamedComponent)selectedObject);
- }
- else if (selectedObject instanceof Node)
- {
- Node node = (Node)selectedObject;
- if (schema != null)
- {
- XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
- if (concreteComponent instanceof XSDNamedComponent)
- {
- run(selection, schema, (XSDNamedComponent)concreteComponent);
- }
- }
- }
- }
- return null;
-
- }
-
- public void run(ISelection selection, XSDSchema schema, XSDNamedComponent selectedComponent)
- {
- if (selectedComponent.getName() == null)
- {
- selectedComponent.setName(new String());
- }
- if (selectedComponent.getSchema() == null)
- {
- if (schema != null)
- {
- schema.updateElement(true);
- }
-
- }
-
- boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
- if (!rc)
- {
- return;
- }
- RefactoringComponent component = new XMLRefactoringComponent(
- selectedComponent,
- (IDOMElement)selectedComponent.getElement(),
- selectedComponent.getName(),
- selectedComponent.getTargetNamespace());
-
- RenameComponentProcessor processor = new RenameComponentProcessor(component, selectedComponent.getName());
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- try
- {
- RefactoringWizard wizard = new RenameRefactoringWizard(
- refactoring,
- RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle,
- RefactoringWizardMessages.RenameComponentWizard_inputPage_description,
- null);
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
- op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
-
- }
- catch (InterruptedException e)
- {
- // do nothing. User action got canceled
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
deleted file mode 100644
index 9c8b012e1c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-RefactorMenu.label=Refactor
-RefactorActionGroup.no_refactoring_available=<no refactoring available>
-
-RenameAction.rename=Rename
-RenameAction.unavailable=Operation unavailable on the current selection.\nSelect a ....
-RenameAction.text=Re&name...
-
-RenameInputWizardPage.new_name= &New name:
-RenameRefactoringWizard.internal_error= Internal error during name checking: {0}
-
-
-RenameXSDElementAction.exception=Unexpected exception occurred. See log for details
-RenameXSDElementAction.not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations, attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
-RenameXSDElementAction.name=Rename
-
-
-RenameSupport.dialog.title=Rename
-RenameSupport.not_available=Rename support not available
-
-RenameComponentWizard.defaultPageTitle=Rename wizard
-RenameComponentWizard.inputPage.description=Rename XML Schema component
-
-RenameInputWizardPage.update_references=Update references
-XSDComponentRenameChange.name=XML Schema component renaming in {0}: {1} to {2}
-XSDComponentRenameChange.Renaming=Renaming...
-ResourceRenameParticipant.compositeChangeName=XSD file rename references updating changes
-RenameResourceChange.rename_resource_reference_change=Renaming resource name references
-XSDRenameResourceChange.name=Resource rename: {0} to {1}
-RenameResourceRefactoring.Internal_Error=Internal error
-RenameResourceRefactoring.alread_exists=Resource already exist
-RenameResourceRefactoring.invalidName=Invalid resource name
-RenameResourceProcessor.name=Resource renaming
-MakeLocalElementGlobalAction.text=Make &Local Element Global
-XSDComponentRenameParticipant.Component_Refactoring_updates=XML Schema refactoring changes
-WSDLComponentRenameParticipant.Component_Refactoring_updates=WSDL refactoring changes
-RenameComponentProcessor.Component_Refactoring_updates=Component name refactoring changes
-RenameComponentProcessor.Component_Refactoring_update_declatation=Update component declaration/definition
-RenameComponentProcessor.Component_Refactoring_update_reference=Update component reference
-XSDComponentRenameParticipant.xsd_component_rename_participant=XSD component rename participant
-WSDLComponentRenameParticipant.wsdl_component_rename_participant=WSDL component rename participant
-ResourceRenameParticipant.File_Rename_update_reference=File rename refactoring changes
-RenameComponentRefactoring_checking=Checking...
-RenameComponentRefactoring_searching=Searching...
-Checks_Choose_name=Invalid name
-RenameComponentRefactoring_another_name=Name already used
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
deleted file mode 100644
index ebdf3d03ec..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
+++ /dev/null
@@ -1,52 +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.xsd.ui.internal.refactor.rename;
-
-import java.util.Map;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-
-public class ComponentRenameArguments extends RenameArguments {
-
- TextChangeManager changeManager;
- Map matches;
- String qualifier;
-
- public ComponentRenameArguments(String newName, boolean updateReferences) {
- super(newName, updateReferences);
- }
-
- public TextChangeManager getChangeManager() {
- return changeManager;
- }
-
- public void setChangeManager(TextChangeManager changeManager) {
- this.changeManager = changeManager;
- }
-
- public Map getMatches() {
- return matches;
- }
-
- public void setMatches(Map matches) {
- this.matches = matches;
- }
-
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(String qualifier) {
- this.qualifier = qualifier;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
deleted file mode 100644
index b49d4fbe6d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.xsd.ui.internal.refactor.rename;
-
-//import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-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.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.Position;
-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.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.core.search.scope.SelectionSearchScope;
-import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
-import org.eclipse.wst.common.core.search.util.CollectingSearchRequestor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xsd.ui.internal.refactor.Checks;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.wst.xsd.ui.internal.refactor.util.TextChangeCompatibility;
-
-
-
-public class RenameComponentProcessor extends RenameProcessor implements INameUpdating, IReferenceUpdating {
- public static final String IDENTIFIER = "org.eclipse.wst.xml.refactor.renameComponentProcessor"; //$NON-NLS-1$
- private boolean singleFileOnly = false;
-
- public static String quoteString(String value) {
- value = value == null ? "" : value;
-
- StringBuffer sb = new StringBuffer();
- if (!value.startsWith("\"")) {
- sb.append("\"");
- }
- sb.append(value);
- if (!value.endsWith("\"")) {
- sb.append("\"");
- }
- return sb.toString();
- }
-
- private TextChangeManager changeManager;
-
- private String newName;
-
- private RefactoringComponent selectedComponent;
-
- private boolean updateReferences = true;
-
- private Map references = new HashMap();
-
- public RenameComponentProcessor(RefactoringComponent selectedComponent) {
- this.selectedComponent = selectedComponent;
- }
-
- public RenameComponentProcessor(RefactoringComponent selectedComponent, String newName) {
- this(selectedComponent, newName, false);
- }
-
- public RenameComponentProcessor(RefactoringComponent selectedComponent, String newName, boolean singleFileOnly) {
- this.newName = newName;
- this.selectedComponent = selectedComponent;
- this.singleFileOnly = singleFileOnly;
- }
-
- private void addDeclarationUpdate(TextChangeManager manager) throws CoreException {
- String fileStr = selectedComponent.getElement().getModel().getBaseLocation();
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileStr));
- addDeclarationUpdate(manager, file);
- }
-
- final void addDeclarationUpdate(TextChangeManager manager, IFile file) throws CoreException {
-
- String componentName = selectedComponent.getName();
- String componentNamespace = selectedComponent.getNamespaceURI();
- QualifiedName elementQName = new QualifiedName(componentNamespace, componentName);
- QualifiedName typeQName = selectedComponent.getTypeQName();
-
-
-
- SearchScope scope = new WorkspaceSearchScope();
- if (file != null) {
- scope = new SelectionSearchScope(new IResource[]{file});
- }
- CollectingSearchRequestor requestor = new CollectingSearchRequestor();
- SearchPattern pattern = new XMLComponentDeclarationPattern(file, elementQName, typeQName);
- SearchEngine searchEngine = new SearchEngine();
- HashMap map = new HashMap();
- if (singleFileOnly)
- {
- map.put("searchDirtyContent", Boolean.TRUE);
- }
- searchEngine.search(pattern, requestor, scope, map, new NullProgressMonitor());
- List results = requestor.getResults();
-
- // more than one declaration found, so use offset as additional check
- Position offsetPosition = null;
- if (results.size() > 1) {
- IDOMElement selectedElement = selectedComponent.getElement();
- if (selectedElement != null) {
- int startOffset = selectedElement.getStartOffset();
- offsetPosition = new Position(startOffset, (selectedElement.getEndOffset() - startOffset));
- }
- }
-
- for (Iterator iter = results.iterator(); iter.hasNext();) {
- SearchMatch match = (SearchMatch) iter.next();
- if (match != null) {
- boolean addTextChange = true;
- // additional check to verify correct declaration is changed
- if (offsetPosition != null) {
- addTextChange = offsetPosition.overlapsWith(match.getOffset(), match.getLength());
- }
- if (addTextChange) {
- TextChange textChange = manager.get(match.getFile());
- String newName = getNewElementName();
- newName = quoteString(newName);
-
- ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName);
- String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");
- TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
- }
- }
- }
- }
-
- void addOccurrences(TextChangeManager manager, IProgressMonitor pm, RefactoringStatus status) throws CoreException {
-
- String fileStr = selectedComponent.getElement().getModel().getBaseLocation();
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileStr));
-
- String componentName = selectedComponent.getName();
- String componentNamespace = selectedComponent.getNamespaceURI();
- QualifiedName elementQName = new QualifiedName(componentNamespace, componentName);
- QualifiedName typeQName = selectedComponent.getTypeQName();
-
- SearchEngine searchEngine = new SearchEngine();
- SearchScope scope = null;
- HashMap map = new HashMap();
- if (singleFileOnly)
- {
- map.put("searchDirtyContent", Boolean.TRUE);
- scope = new SelectionSearchScope(new IResource[]{file});
- }
- else
- {
- scope = new WorkspaceSearchScope();
- }
- SortingSearchRequestor requestor = new SortingSearchRequestor();
- SearchPattern pattern = new XMLComponentReferencePattern(file, elementQName, typeQName);
-
- searchEngine.search(pattern, requestor, scope, map, new NullProgressMonitor());
- references = requestor.getResults();
- // for (Iterator iter = references.iterator(); iter.hasNext();) {
- // SearchMatch match = (SearchMatch) iter.next();
-
- // TextChange textChange = manager.get(match.getFile());
- // String newName = getNewElementName();
- // if(match.getObject() instanceof Node){
- // Node node = (Node)match.getObject();
- // if(node instanceof IDOMAttr){
- // IDOMAttr attr = (IDOMAttr)node;
- // IDOMElement element = (IDOMElement)attr.getOwnerElement() ;
- // newName = getNewQName(element, componentNamespace, newName);
- // }
- // newName = quoteString(newName);
- // }
- //
- // ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(),
- // match.getLength(), newName );
- // String editName =
- // RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_reference");
- // TextChangeCompatibility.addTextEdit(textChange, editName,
- // replaceEdit);
-
- // }
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
- */
- public boolean canEnableTextUpdating() {
- return true;
- }
-
- public boolean canEnableUpdateReferences() {
- return true;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkFinalConditions(IProgressMonitor monitor, CheckConditionsContext context) throws CoreException, OperationCanceledException {
- Assert.isNotNull(monitor);
- Assert.isNotNull(context);
- final RefactoringStatus status = new RefactoringStatus();
- try {
- monitor.beginTask("", 2); //$NON-NLS-1$
- monitor.setTaskName(RefactoringMessages.getString("RenameComponentRefactoring_checking")); //$NON-NLS-1$
- status.merge(checkNewElementName(getNewElementName()));
- monitor.worked(1);
- monitor.setTaskName(RefactoringMessages.getString("RenameComponentRefactoring_searching")); //$NON-NLS-1$
- status.merge(createRenameChanges(new SubProgressMonitor(monitor, 1)));
- }
- finally {
- monitor.done();
- }
- return status;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- // TODO add code to check initial conditions for component rename
- Assert.isNotNull(pm);
- try {
- return new RefactoringStatus();
- }
- finally {
- pm.done();
- }
-
- }
-
- public final RefactoringStatus checkNewElementName(final String name) {
- Assert.isNotNull(name);
- final RefactoringStatus result = Checks.checkName(name);
- result.merge(Checks.checkComponentName(name));
- if (Checks.isAlreadyNamed(selectedComponent, name))
- result.addFatalError(RefactoringMessages.getString("RenameComponentRefactoring_another_name")); //$NON-NLS-1$
- return result;
- }
-
- private Object[] computeDerivedElements() {
-
- Object[] elements = getElements();
- // Object[] results = new Object[elements.length];
- // for(int i=0; i< elements.length; i++){
- // RefactoringComponent component = (RefactoringComponent)elements[i];
- // results[i] = component.getAdaptee();
- //
- // }
- return elements;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- // don't create any change now, all the changes are in changeManger
- // variable and will be combined in postCreateChange method
- return null;
- }
-
- private TextChangeManager updateChangeManager(IProgressMonitor pm, RefactoringStatus status) throws CoreException {
- TextChangeManager manager = getChangeManager();
- // only one declaration gets updated
- addDeclarationUpdate(manager);
- if (getUpdateReferences()) {
- addOccurrences(manager, pm, status);
- }
- return manager;
- }
-
- private RefactoringStatus createRenameChanges(final IProgressMonitor monitor) throws CoreException {
- Assert.isNotNull(monitor);
- final RefactoringStatus status = new RefactoringStatus();
- try {
- monitor.beginTask(RefactoringMessages.getString("RenameComponentRefactoring_searching"), 1); //$NON-NLS-1$
- updateChangeManager(new SubProgressMonitor(monitor, 1), status);
- }
- finally {
- monitor.done();
- }
- return status;
- }
-
- public TextChangeManager getChangeManager() {
-
- if (changeManager == null) {
- changeManager = new TextChangeManager(false);
- }
- return changeManager;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
- */
- protected String[] getAffectedProjectNatures() throws CoreException {
- // TODO: find project natures of the files that are going to be
- // refactored
- return new String[]{"org.eclipse.jdt.core.javanature"};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
- */
- public String getCurrentElementName() {
- //
- return selectedComponent.getName();
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
- */
- public Object[] getElements() {
- Object model = selectedComponent.getModelObject();
- if (model != null) {
- return new Object[]{model};
- }
- return new Object[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
- */
- public String getIdentifier() {
- return IDENTIFIER;
- }
-
- public String getNewElementName() {
- return newName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
- */
- public String getProcessorName() {
- return RefactoringMessages.getFormattedString("RenameComponentRefactoring.name", //$NON-NLS-1$
- new String[]{selectedComponent.getNamespaceURI() + ":" + selectedComponent.getName(), newName});
-
- }
-
-
- public boolean getUpdateReferences() {
- return updateReferences;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
- */
- public boolean isApplicable() throws CoreException {
- if (selectedComponent == null)
- return false;
- // TODO implement isApplicable logic for the named component,
- // verify how it is different from other condition checks
- // if (fNamedComponent.isAnonymous())
- // return false;
- // if (! Checks.isAvailable(fType))
- // return false;
- // if (isSpecialCase(fType))
- // return false;
- return true;
- }
-
- protected void loadDerivedParticipants(RefactoringStatus status, List result, Object[] derivedElements, ComponentRenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
- if (derivedElements != null) {
- for (int i = 0; i < derivedElements.length; i++) {
- RenameParticipant[] participants = ParticipantManager.loadRenameParticipants(status, this, derivedElements[i], arguments, natures, shared);
- result.addAll(Arrays.asList(participants));
- }
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus,
- * java.util.List, java.lang.String[],
- * org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
- */
- protected void loadDerivedParticipants(RefactoringStatus status, List result, String[] natures, SharableParticipants shared) throws CoreException {
- ComponentRenameArguments arguments = new ComponentRenameArguments(getNewElementName(), getUpdateReferences());
- arguments.setMatches(references);
- arguments.setQualifier(selectedComponent.getNamespaceURI());
- // pass in changeManger to the participants so that it can collect all
- // changes/per files
- arguments.setChangeManager(getChangeManager());
- loadDerivedParticipants(status, result, computeDerivedElements(), arguments, natures, shared);
- }
-
- protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
- Object[] elements = new Object[0];// getElements();
- for (int i = 0; i < elements.length; i++) {
- result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, this, elements[i], arguments, natures, shared)));
- }
- }
-
-
- public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
- RenameArguments arguments = new RenameArguments(getNewElementName(), getUpdateReferences());
- String[] natures = getAffectedProjectNatures();
- List result = new ArrayList();
- loadElementParticipants(status, result, arguments, natures, sharedParticipants);
- loadDerivedParticipants(status, result, natures, sharedParticipants);
- for (Iterator i = result.iterator(); i.hasNext();) {
- Object o = i.next();
- if (o instanceof XMLComponentRenameParticipant) {
- XMLComponentRenameParticipant p = (XMLComponentRenameParticipant) o;
- // getChangeManager()
- p.setChangeManager(getChangeManager());
- }
- }
-
- return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
- }
-
- public void setNewElementName(String newName) {
- Assert.isNotNull(newName);
- this.newName = newName;
- }
-
- public void setUpdateReferences(boolean update) {
- updateReferences = update;
-
- }
-
- public Change postCreateChange(Change[] participantChanges, IProgressMonitor pm) throws CoreException, OperationCanceledException {
- Assert.isNotNull(pm);
- try {
- String changeName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_updates");
- TextChange[] changes = changeManager.getAllChanges();
-// Comparator c = new Comparator() {
-// public int compare(Object o1, Object o2) {
-// TextFileChange c1 = (TextFileChange) o1;
-// TextFileChange c2 = (TextFileChange) o2;
-// return Collator.getInstance().compare(c1.getFile().getFullPath(), c2.getFile().getFullPath());
-// }
-// };
- if (changes.length > 0) {
- // Arrays.sort(changes, c);
- CompositeChange compositeChange = new CompositeChange("!" + changeName, changes);
- compositeChange.markAsSynthetic();
- return compositeChange;
- }
- else {
- return null;
- }
-
- }
- finally {
- pm.done();
- }
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
deleted file mode 100644
index e817083664..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-public class RenameResourceProcessor extends RenameProcessor implements INameUpdating {
-
- private IResource fResource;
- private String fNewElementName;
-
- public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameResourceProcessor"; //$NON-NLS-1$
-
- public RenameResourceProcessor(IResource resource) {
- fResource= resource;
- if (fResource != null) {
- setNewElementName(fResource.getName());
- }
- }
-
- //---- INameUpdating ---------------------------------------------------
-
- public void setNewElementName(String newName) {
- Assert.isNotNull(newName);
- fNewElementName= newName;
- }
-
- public String getNewElementName() {
- return fNewElementName;
- }
-
- //---- IRenameProcessor methods ---------------------------------------
-
- public String getIdentifier() {
- return IDENTIFIER;
- }
-
- public boolean isApplicable() {
- if (fResource == null)
- return false;
- if (! fResource.exists())
- return false;
- if (! fResource.isAccessible())
- return false;
- return true;
- }
-
- public String getProcessorName() {
- String message= RefactoringMessages.getFormattedString("RenameResourceProcessor.name", //$NON-NLS-1$
- new String[]{getCurrentElementName(), getNewElementName()});
- return message;
- }
-
- public Object[] getElements() {
- return new Object[] {fResource};
- }
-
- public String getCurrentElementName() {
- return fResource.getName();
- }
-
- public String[] getAffectedProjectNatures() throws CoreException {
- return new String[0];
- }
-
- public Object getNewElement() {
-
-
- return ResourcesPlugin.getWorkspace().getRoot().findMember(createNewPath(getNewElementName()));
- }
-
- public boolean getUpdateReferences() {
- return true;
- }
-
- public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants shared) throws CoreException {
- Object[] elements= getElements();
- String[] natures= getAffectedProjectNatures();
- List result= new ArrayList();
- RenameArguments arguments= new RenameArguments(getNewElementName(), getUpdateReferences());
- for (int i= 0; i < elements.length; i++) {
- result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status,
- this, elements[i],
- arguments, natures, shared)));
- }
- return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
- }
-
- //--- Condition checking --------------------------------------------
-
- public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
- return new RefactoringStatus();
- }
-
- /* non java-doc
- * @see IRenameRefactoring#checkNewName()
- */
- public RefactoringStatus checkNewElementName(String newName) {
- Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
- IContainer c= fResource.getParent();
- if (c == null)
- return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.Internal_Error")); //$NON-NLS-1$
-
- if (c.findMember(newName) != null)
- return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.alread_exists")); //$NON-NLS-1$
-
- if (!c.getFullPath().isValidSegment(newName))
- return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.invalidName")); //$NON-NLS-1$
-
- RefactoringStatus result= RefactoringStatus.create(c.getWorkspace().validateName(newName, fResource.getType()));
- if (! result.hasFatalError())
- result.merge(RefactoringStatus.create(c.getWorkspace().validatePath(createNewPath(newName), fResource.getType())));
- return result;
- }
-
- /* non java-doc
- * @see Refactoring#checkInput(IProgressMonitor)
- */
- public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) {
- pm.beginTask("", 1); //$NON-NLS-1$
- try{
- return new RefactoringStatus();
- } finally{
- pm.done();
- }
- }
-
- private String createNewPath(String newName){
- return fResource.getFullPath().removeLastSegments(1).append(newName).toString();
- }
-
- //--- changes
-
- /* non java-doc
- * @see IRefactoring#createChange(IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) {
- pm.beginTask("", 1); //$NON-NLS-1$
- try{
- return new ResourceRenameChange(fResource, getNewElementName());
- } finally{
- pm.done();
- }
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java
deleted file mode 100644
index 4cd3c85c65..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-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.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class RenameTargetNamespaceProcessor extends RenameProcessor implements INameUpdating, IReferenceUpdating
-{
- private String newNamespace;
- private boolean updateReferences = true;
- private TextChangeManager changeManager;
- private XSDSchema model;
-
-
- public static final String IDENTIFIER = "org.eclipse.wst.ui.xsd.renameComponentProcessor"; //$NON-NLS-1$
-
- public RenameTargetNamespaceProcessor(XSDSchema model, String newName)
- {
- this.model = model;
- this.newNamespace = newName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
- */
- public boolean canEnableTextUpdating()
- {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
- */
- public String getCurrentElementName()
- {
- //
- return model.getTargetNamespace();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
- */
- protected String[] getAffectedProjectNatures() throws CoreException
- {
- // TODO: find project natures of the files that are going to be
- // refactored
- return new String[]{"org.eclipse.jdt.core.javanature"};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus,
- * java.util.List, java.lang.String[],
- * org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
- */
- protected void loadDerivedParticipants(RefactoringStatus status,
- List result, String[] natures, SharableParticipants shared)
- throws CoreException
- {
- String newCUName= getNewElementName(); //$NON-NLS-1$
- RenameArguments arguments= new RenameArguments(newCUName, getUpdateReferences());
- loadDerivedParticipants(status, result,
- computeDerivedElements(), arguments,
- natures, shared);
- }
-
- protected void loadDerivedParticipants(RefactoringStatus status, List result, Object[] derivedElements,
- RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
- if (derivedElements != null) {
- for (int i= 0; i < derivedElements.length; i++) {
- RenameParticipant[] participants= ParticipantManager.loadRenameParticipants(status,
- this, derivedElements[i],
- arguments, natures, shared);
- result.addAll(Arrays.asList(participants));
- }
- }
-
- }
-
- private Object[] computeDerivedElements() {
-
- Object[] elements = getElements();
- Object[] results = new Object[elements.length];
- for(int i=0; i< elements.length; i++){
- RefactoringComponent component = (RefactoringComponent)elements[i];
- results[i] = component.getModelObject();
-
- }
- return results;
-
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
- CheckConditionsContext context) throws CoreException,
- OperationCanceledException
- {
- try
- {
- RefactoringStatus result = new RefactoringStatus();
- pm.beginTask("", 9); //$NON-NLS-1$
- changeManager = createChangeManager(new SubProgressMonitor(pm, 1),
- result);
- return result;
- } finally
- {
- pm.done();
- }
-
-
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
- throws CoreException, OperationCanceledException
- {
- // TODO add code to check initial conditions for component rename
- return new RefactoringStatus();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException,
- OperationCanceledException
- {
- try
- {
- String changeName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_updates");
- return new CompositeChange(changeName, changeManager.getAllChanges());
- } finally
- {
- pm.done();
- }
-
- // Change[] changes = ComponentRenameChange.createChangesFor(
- // this.fNamedComponent, getNewElementName());
- //
- // if (changes.length > 0)
- // {
- // CompositeChange multiChange = null;
- // multiChange = new CompositeChange(
- // "XSD component rename participant changes", changes); //$NON-NLS-1$
- // TODO: externalize string
- // return multiChange;
- // } else
- // {
- //
- // return new ComponentRenameChange(
- // fNamedComponent,
- // fNamedComponent.getName(),
- // getNewElementName(),
- // fNamedComponent.getSchema());
- // }
-
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
- */
- public Object[] getElements()
- {
- return new Object[] { model };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
- */
- public String getIdentifier()
- {
- return IDENTIFIER;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
- */
- public String getProcessorName()
- {
- return RefactoringMessages.getFormattedString(
- "RenameComponentRefactoring.name", //$NON-NLS-1$
- new String[]
- {
- getCurrentElementName(),
- getNewElementName() });
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
- */
- public boolean isApplicable() throws CoreException
- {
- if (getModel() == null)
- return false;
- // TODO implement isApplicable logic for the named component,
- // verify how it is different from other condition checks
- // if (fNamedComponent.isAnonymous())
- // return false;
- // if (! Checks.isAvailable(fType))
- // return false;
- // if (isSpecialCase(fType))
- // return false;
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
- */
- public RefactoringStatus checkNewElementName(String newName)
- {
- Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
- // TODO: implement new name checking
- // RefactoringStatus result = Checks.checkTypeName(newName);
- // if (Checks.isAlreadyNamed(fType, newName))
- // result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));
- // //$NON-NLS-1$
- return new RefactoringStatus();
- }
-
- public final RefactoringParticipant[] loadParticipants(
- RefactoringStatus status, SharableParticipants sharedParticipants)
- throws CoreException
- {
- RenameArguments arguments = new RenameArguments(getNewElementName(),
- true);
- String[] natures = getAffectedProjectNatures();
- List result = new ArrayList();
- loadElementParticipants(status, result, arguments, natures,
- sharedParticipants);
- loadDerivedParticipants(status, result, natures, sharedParticipants);
- return (RefactoringParticipant[]) result
- .toArray(new RefactoringParticipant[result.size()]);
- }
-
- protected void loadElementParticipants(RefactoringStatus status,
- List result, RenameArguments arguments, String[] natures,
- SharableParticipants shared) throws CoreException
- {
- Object[] elements = getElements();
- for (int i = 0; i < elements.length; i++)
- {
- result.addAll(Arrays.asList(ParticipantManager
- .loadRenameParticipants(status, this, elements[i],
- arguments, natures, shared)));
- }
- }
-
- private TextChangeManager createChangeManager(IProgressMonitor pm,
- RefactoringStatus status) throws CoreException
- {
- TextChangeManager manager = new TextChangeManager(false);
- // only one declaration gets updated
- addDeclarationUpdate(manager);
- return manager;
- }
-
- private void addDeclarationUpdate(TextChangeManager manager)
-
- {
- String fileStr = getModel().getSchemaLocation();
- URI uri = URI.createPlatformResourceURI(fileStr);
- try
- {
- URL url = new URL(uri.toString());
- url = Platform.resolve(url);
- if(url != null){
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFileForLocation(new Path(url.getFile()));
- if(file != null ){
- TextChange change = manager.get(file);
- addDeclarationUpdate(change);
- }
- }
- } catch (MalformedURLException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- }
-
-
-
- final void addDeclarationUpdate(TextChange change)
- {
-// String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");;
-//
-// NamedComponentRenamer renamer = new NamedComponentRenamer(
-// selectedComponent.getElement(), newNamespace);
-// renamer.renameComponent();
-// List textEdits = renamer.getTextEdits();
-// for (int j = 0; j < textEdits.size(); j++)
-// {
-// ReplaceEdit replaceEdit = (ReplaceEdit) textEdits
-// .get(j);
-// TextChangeCompatibility.addTextEdit(change,
-// editName, replaceEdit);
-// }
- }
-
- public void setNewElementName(String newName)
- {
- this.newNamespace = newName;
- }
-
- public String getNewElementName()
- {
- return newNamespace;
- }
-
-
-
- public boolean canEnableUpdateReferences()
- {
- return true;
- }
-
- public boolean getUpdateReferences()
- {
- return updateReferences;
- }
-
- public void setUpdateReferences(boolean update)
- {
- updateReferences = update;
-
- }
-
- public final TextChangeManager getChangeManager()
- {
- return changeManager;
- }
-
- public final XSDSchema getModel()
- {
- return model;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
deleted file mode 100644
index e213e2af3b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-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.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * Represents a change that renames a given resource
- */
-public class ResourceRenameChange extends Change {
-
- /*
- * we cannot use handles because they became invalid when you rename the resource.
- * paths do not.
- */
- private IPath fResourcePath;
-
- private String fNewName;
-
- /**
- * @param newName includes the extension
- */
- public ResourceRenameChange(IResource resource, String newName) {
- this(resource.getFullPath(), newName);
- }
-
- private ResourceRenameChange(IPath resourcePath, String newName) {
- fResourcePath= resourcePath;
- fNewName= newName;
- }
-
- private IResource getResource() {
- return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath);
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
-
- // TODO: implement file validation, see JDTChange
- return new RefactoringStatus();
- }
-
- /*
- * to avoid the exception senders should check if a resource with the new name
- * already exists
- */
- public Change perform(IProgressMonitor pm) throws CoreException {
- try {
- pm.beginTask(RefactoringMessages.getString("XSDRenameResourceChange.rename_resource"), 1); //$NON-NLS-1$
-
- getResource().move(renamedResourcePath(fResourcePath, fNewName), getCoreRenameFlags(), pm);
-
- String oldName= fResourcePath.lastSegment();
- IPath newPath= renamedResourcePath(fResourcePath, fNewName);
- return new ResourceRenameChange(newPath, oldName);
- } finally {
- pm.done();
- }
- }
-
- private int getCoreRenameFlags() {
- if (getResource().isLinked())
- return IResource.SHALLOW;
- else
- return IResource.NONE;
- }
-
- /*
- * changes resource names /s/p/A.java renamed to B.java becomes /s/p/B.java
- */
- public static IPath renamedResourcePath(IPath path, String newName) {
- return path.removeLastSegments(1).append(newName);
- }
-
- public String getName() {
- return RefactoringMessages.getFormattedString(
- "XSDRenameResourceChange.name", new String[]{fResourcePath.toString(), //$NON-NLS-1$
- renamedResourcePath(fResourcePath, fNewName).toString()});
- }
-
- public Object getModifiedElement() {
- return getResource();
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void initializeValidationData(IProgressMonitor pm) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
deleted file mode 100644
index ec2bf8e350..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-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.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * This rename participant creates text changes for the references of the XSD and WSDL files
- */
-public class ResourceRenameParticipant extends RenameParticipant {
-
-// private IFile file = null;
- private TextChangeManager changeManager;
-
-
- private static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
- private static String WSDL_CONTENT_TYPE_ID = "org.eclipse.wst.wsdl.wsdlsource";
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- if(element instanceof IFile) {
- // check if file has XSD or WSDL content
- IFile aFile = (IFile) element;
- try {
- IContentDescription description = aFile.getContentDescription();
- if ( description == null )
- return false;
- IContentType contentType = description.getContentType();
- if(contentType != null){
- if(XSD_CONTENT_TYPE_ID.equals(contentType.getId()) ||
- WSDL_CONTENT_TYPE_ID.equals(contentType.getId())){
-// file = aFile;
- return true;
- }
- }
- } catch (CoreException e) {
- return false;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- return RefactoringMessages.getString("ResourceRenameParticipant.compositeChangeName");
- }
-
-// private IPath getNewFilePath() {
-//
-// IPath oldPath = file.getRawLocation();
-// IPath newPath = oldPath.removeLastSegments(1).append(getArguments().getNewName());
-// return newPath;
-// }
-
- public RefactoringStatus checkConditions(IProgressMonitor pm,
- CheckConditionsContext context) throws OperationCanceledException
- {
- RefactoringStatus result = new RefactoringStatus();
- try
- {
- pm.beginTask("", 9); //$NON-NLS-1$
- changeManager = createChangeManager(new SubProgressMonitor(pm, 1),
- result);
-
- } catch(CoreException e){
- result.addFatalError(e.toString());
- }
- finally
- {
- pm.done();
- }
- return result;
-
- }
-
-
-
- public Change createChange(IProgressMonitor pm) throws CoreException,
- OperationCanceledException
- {
- try
- {
- String changeName = RefactoringMessages.getString("RenameResourceChange.rename_resource_reference_change");
- TextChange[] changes = changeManager.getAllChanges();
- if(changes.length > 0){
- return new CompositeChange(changeName, changes);
- }
- else{
- return null;
- }
-
- } finally
- {
- pm.done();
- }
-
- }
-
-
- private TextChangeManager createChangeManager(IProgressMonitor pm,
- RefactoringStatus status) throws CoreException
- {
- TextChangeManager manager = new TextChangeManager(false);
- // only one declaration gets updated
- //addDeclarationUpdate(manager);
- if (getArguments().getUpdateReferences())
- addOccurrences(manager, pm, status);
- return manager;
- }
-
-
-
- void addOccurrences(TextChangeManager manager, IProgressMonitor pm,
- RefactoringStatus status) throws CoreException
- {
-//
-// Object[] occurrences = SearchTools.getFileDependencies(file);
-// pm.beginTask("", occurrences.length); //$NON-NLS-1$
-//
-// for (int i = 0; i < occurrences.length; i++)
-// {
-// Object object = occurrences[i];
-//
-// if (object instanceof SearchResultGroup)
-// {
-// SearchResultGroup searchResult = (SearchResultGroup) object;
-// if (searchResult == null)
-// continue;
-//
-// IFile referencingFile = (IFile)searchResult.getResource();
-//
-// resourceSet = new ResourceSetImpl();
-// // for each result file create XSD model and get component from that model
-// resourceSet.getAdapterFactories().add(
-// new XSDSchemaLocationResolverAdapterFactory());
-// URI uri = URI.createFileURI(referencingFile.getLocation().toPortableString());
-// try
-// {
-// XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
-// IStructuredModel structuredModel = StructuredModelManager.getModelManager().getModelForRead(referencingFile);
-// IDOMModel domModel = (IDOMModel) structuredModel;
-// Resource resource = new XSDResourceImpl();
-// resource.setURI(uri);
-// schema = XSDFactory.eINSTANCE.createXSDSchema();
-// resource.getContents().add(schema);
-// resourceSet.getResources().add(resource);
-// schema.setElement(domModel.getDocument().getDocumentElement());
-// // get target namespace
-// String stringPath = file.getLocation().toString();
-// String targetNamespace = XMLQuickScan.getTargetNamespace(stringPath);
-// targetNamespace = targetNamespace == null ? "" : targetNamespace;
-//
-// List textEdits = new ArrayList();
-// SearchMatch[] matches = searchResult.getSearchResults();
-//
-// for (int j = 0; j < matches.length; j++) {
-// SearchMatch match = matches[j];
-//
-// FileReferenceRenamer renamer = new FileReferenceRenamer(
-// match.getAttrValue(), targetNamespace, getNewFilePath().toString(), schema);
-// renamer.visitSchema(schema);
-// textEdits.addAll(renamer.getTextEdits());
-// }
-//
-//
-// if(!textEdits.isEmpty()){
-// TextChange textChange = manager.get(referencingFile);
-// for (int j = 0; j < textEdits.size(); j++)
-// {
-// ReplaceEdit replaceEdit = (ReplaceEdit) textEdits
-// .get(j);
-// String editName = RefactoringMessages.getString("ResourceRenameParticipant.File_Rename_update_reference");
-// TextChangeCompatibility.addTextEdit(textChange,
-// editName, replaceEdit);
-// }
-// }
-//
-// } catch (Exception e)
-// {
-// e.printStackTrace();
-// } finally
-// {
-//
-// }
-// }
-// }
- }
-
-
- public class ReferenceLocationFinder
- {
- protected XSDNamedComponent component;
- protected String name;
- protected XSDSchema referencingSchema;
- protected List results = new ArrayList();
-
- public ReferenceLocationFinder(XSDNamedComponent component,
- String name, XSDSchema referencingSchema)
- {
- this.component = component;
- this.name = name;
- this.referencingSchema = referencingSchema;
- }
-
- public void run()
- {
-
- //XSDSwitch xsdSwitch = new XSDSwitch()
-// {
-// public Object caseXSDTypeDefinition(XSDTypeDefinition object)
-// {
-// GlobalTypeReferenceRenamer renamer = new GlobalTypeReferenceRenamer(
-// object.getName(), object.getTargetNamespace(), name, referencingSchema);
-// renamer.visitSchema(referencingSchema);
-// results.addAll(renamer.getTextEdits());
-// return null;
-// }
-//
-// public Object caseXSDElementDeclaration(
-// XSDElementDeclaration object)
-// {
-// if (object.isGlobal())
-// {
-// GlobalElementRenamer renamer = new GlobalElementRenamer(
-// object.getName(), object.getTargetNamespace(), name, referencingSchema);
-// renamer.visitSchema(referencingSchema);
-// results.addAll(renamer.getTextEdits());
-// }
-// return null;
-// }
-//
-// public Object caseXSDModelGroupDefinition(
-// XSDModelGroupDefinition object)
-// {
-// GlobalGroupRenamer renamer = new GlobalGroupRenamer(
-// object.getName(), object.getTargetNamespace(), name, referencingSchema);
-// renamer.visitSchema(referencingSchema);
-// return null;
-// }
-// };
- //xsdSwitch.doSwitch(component);
-// component.setName(name);
-// try
-// {
-// referencingSchema.eResource().save(new HashMap());
-// } catch (IOException e)
-// {
-// e.printStackTrace();
-// }
-
- }
-
- public final List getResults()
- {
- return results;
- }
- }
-
-
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
deleted file mode 100644
index d140a8c9e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
+++ /dev/null
@@ -1,87 +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.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class SortingSearchRequestor extends SearchRequestor {
-
- public static String NONAMESPACE = "nonamespace";
-
-
- private Map fFound;
-
- public SortingSearchRequestor() {
- fFound= new HashMap();
- }
-
-
-
- /**
- * @return a List of {@link SearchMatch}es (sorted by namespace)
- */
- public Map/* namespace - <SearchMatch>*/ getResults() {
- return fFound;
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.core.search.internal.provisional.SearchRequestor#acceptSearchMatch(org.eclipse.wst.common.search.internal.provisional.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
-
-
- if(match != null && match.getObject() instanceof Node){
- Node node = (Node)match.getObject();
- Element domElement = null;
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE:
- domElement = ((Attr)node).getOwnerElement();
- break;
- case Node.ELEMENT_NODE:
- domElement = ((Element)node);
- break;
- default:
- break;
- }
- String namespace = domElement.getNamespaceURI();
- if(namespace == null || namespace.equals("")){
- namespace = NONAMESPACE;
- }
- List matches = getMatches(namespace);
- matches.add(match);
- }
-
- }
-
- private List getMatches(String namespace){
- Object matches = fFound.get(namespace);
- if(!(matches instanceof List)){
- matches = new ArrayList();
- fFound.put(namespace, matches);
- }
- return (List)matches;
-
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
deleted file mode 100644
index 4aba3206ff..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
+++ /dev/null
@@ -1,138 +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.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-import java.util.List;
-
-//import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-//import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.wst.xsd.ui.internal.refactor.util.TextChangeCompatibility;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-public class XMLComponentRenameParticipant extends RenameParticipant {
-
- protected SearchMatch match;
-
- protected TextChangeManager changeManager;
- protected List matches;
-
-
-
- protected boolean initialize(Object element) {
-
- if(getArguments() instanceof ComponentRenameArguments){
- // changeManger is passed in from the RenameComponentProcessor to collect all the changes
- changeManager = ((ComponentRenameArguments)getArguments()).getChangeManager();
- }
-
- return false;
- }
-
- public String getName() {
- return "XML Component Rename Participant";
- }
-
- public RefactoringStatus checkConditions(IProgressMonitor monitor,
- CheckConditionsContext context) throws OperationCanceledException {
- return null;
- }
-
- public TextChangeManager getChangeManager(){
-
- if(changeManager == null){
- changeManager = new TextChangeManager(false);
- }
- return changeManager;
-
- }
-
-// private RefactoringStatus createRenameChanges(final IProgressMonitor monitor) throws CoreException {
-// Assert.isNotNull(monitor);
-// final RefactoringStatus status= new RefactoringStatus();
-// try {
-// monitor.beginTask("RefactoringMessages.RenameComponentRefactoring_searching", 1);
-// createRenameChanges(new SubProgressMonitor(monitor, 1));
-// //updateChangeManager(new SubProgressMonitor(monitor, 1), status);
-// } finally {
-// monitor.done();
-// }
-// return status;
-// }
-
- public Change createChange(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- for (Iterator iter = matches.iterator(); iter.hasNext();) {
- SearchMatch match = (SearchMatch) iter.next();
- TextChange textChange = getChangeManager().get(match.getFile());
- String newName = getArguments().getNewName();
- String qualifier = "";
- if(getArguments() instanceof ComponentRenameArguments){
- qualifier = ((ComponentRenameArguments)getArguments()).getQualifier();
- }
- if(match.getObject() instanceof Node){
- Node node = (Node)match.getObject();
- if(node instanceof IDOMAttr){
- IDOMAttr attr = (IDOMAttr)node;
- IDOMElement element = (IDOMElement)attr.getOwnerElement() ;
- newName = getNewQName(element, qualifier, newName);
- }
- newName = RenameComponentProcessor.quoteString(newName);
- }
-
- ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName );
- String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_reference");
- TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
- }
- // don't create any change now, all the changes are in changeManger variable and will be combined in RenameComponentProcessor.postCreateChange method
- return null;
- }
-
- private static String getNewQName(Node node, String targetNamespace, String newName) {
- StringBuffer sb = new StringBuffer();
- if (newName != null) {
- String prefix = XSDConstants.lookupQualifier(node, targetNamespace);
- if (prefix != null && prefix.length() > 0) {
- sb.append(prefix);
- sb.append(":");
- sb.append(newName);
- } else {
- sb.append(newName);
- }
- } else {
- sb.append(newName);
- }
-
- return sb.toString();
- }
-
- public void setChangeManager(TextChangeManager changeManager)
- {
- this.changeManager = changeManager;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
deleted file mode 100644
index 3d169fdd79..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.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 Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.List;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDNamedComponent;
-
-/**
- * This participant takes case of renaming matches that are XSD components
- */
-public class XSDComponentRenameParticipant extends XMLComponentRenameParticipant {
-
-protected boolean initialize(Object element) {
- super.initialize(element);
- if(element instanceof XSDNamedComponent){
- if(getArguments() instanceof ComponentRenameArguments){
- matches = (List)((ComponentRenameArguments)getArguments()).getMatches().get(IXSDSearchConstants.XMLSCHEMA_NAMESPACE);
- }
- if(matches != null){
- return true;
- }
- }
- return false;
- }
-
- public String getName() {
-
- return "XSD component rename participant";
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java
deleted file mode 100644
index a39ebafae5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java
+++ /dev/null
@@ -1,71 +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.xsd.ui.internal.refactor.structure;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public abstract class AbstractCommand
-{
- private XSDConcreteComponent parent;
- private XSDConcreteComponent model;
-
- protected AbstractCommand(XSDConcreteComponent parent)
- {
- this.parent = parent;
- }
-
- public abstract void run();
-
- protected XSDConcreteComponent getParent()
- {
- return parent;
- }
-
- public XSDConcreteComponent getModelObject()
- {
- return model;
- }
-
- protected void setModelObject(XSDConcreteComponent model)
- {
- this.model = model;
- }
-
- // Establish part-whole relationship
- protected abstract boolean adopt(XSDConcreteComponent model);
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java
deleted file mode 100644
index d9fc1b022c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java
+++ /dev/null
@@ -1,84 +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.xsd.ui.internal.refactor.structure;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public final class MakeAnonymousTypeGlobalCommand extends AbstractCommand {
-
- String fNewName;
-
- public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element,
- String newName) {
- super(element.getContainer());
- setModelObject(element);
- fNewName = newName;
- }
-
- public void run() {
- XSDConcreteComponent model = getModelObject();
- XSDConcreteComponent parent = model.getContainer();
- XSDTypeDefinition globalTypeDef = null;
- if (model instanceof XSDComplexTypeDefinition) {
- if (parent instanceof XSDElementDeclaration) {
- // clone typedef with it's content and set it global
- globalTypeDef = (XSDComplexTypeDefinition) model
- .cloneConcreteComponent(true, false);
- globalTypeDef.setName(fNewName);
- parent.getSchema().getContents().add(globalTypeDef);
- ((XSDElementDeclaration) parent)
- .setTypeDefinition(globalTypeDef);
- }
- } else if (model instanceof XSDSimpleTypeDefinition) {
-
- XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) model;
- if (parent instanceof XSDElementDeclaration) {
- // clone typedef with it's content and set it global
- globalTypeDef = (XSDSimpleTypeDefinition) typeDef
- .cloneConcreteComponent(true, false);
- globalTypeDef.setName(fNewName);
- parent.getSchema().getContents().add(globalTypeDef);
- ((XSDElementDeclaration) parent)
- .setTypeDefinition(globalTypeDef);
- formatChild(globalTypeDef.getElement());
-
- } else if (parent instanceof XSDAttributeDeclaration) {
- // clone typedef with it's content and set it global
- globalTypeDef = (XSDSimpleTypeDefinition) typeDef
- .cloneConcreteComponent(true, false);
- globalTypeDef.setName(fNewName);
- parent.getSchema().getContents().add(globalTypeDef);
- ((XSDAttributeDeclaration) parent)
- .setTypeDefinition((XSDSimpleTypeDefinition) globalTypeDef);
-
- }
-
- }
-
- formatChild(globalTypeDef.getElement());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
- */
- protected boolean adopt(XSDConcreteComponent model) {
- // TODO Auto-generated method stub
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
deleted file mode 100644
index d7eb8a7177..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.refactor.structure;
-
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDSchema;
-
-
-public final class MakeLocalElementGlobalCommand extends AbstractCommand
-{
- public MakeLocalElementGlobalCommand(XSDConcreteComponent element)
- {
- super(element.getContainer());
- setModelObject(element);
- }
-
- public void run()
- {
- if (getModelObject() instanceof XSDElementDeclaration)
- {
-
- XSDElementDeclaration localElementDeclaration = (XSDElementDeclaration)getModelObject();
- XSDConcreteComponent parent = getParent();
- XSDConcreteComponent container = parent.getContainer();
-
- // Clone the local element with its content and set it global
-
- XSDElementDeclaration globalElementDeclaration = (XSDElementDeclaration)localElementDeclaration.cloneConcreteComponent(true, false);
-
- // The schema may already have a global element declaration with this name. In that case, ensure the name of the newly created
- // element does not collide with an existing one.
-
- XSDSchema schema = container.getSchema();
- String localElementName = localElementDeclaration.getName();
- XSDElementDeclaration existingGlobalElement = schema.resolveElementDeclaration(localElementName);
- boolean elementExists = existingGlobalElement != null && existingGlobalElement.getSchema() != null;
- if (elementExists)
- {
- String newElementName = XSDCommonUIUtils.createUniqueElementName(localElementName, schema.getElementDeclarations());
- globalElementDeclaration.setName(newElementName);
- }
-
- EList schemaContents = schema.getContents();
- schemaContents.add(globalElementDeclaration);
-
- // Modify the local element to become a reference to the global element.
-
- localElementDeclaration.setName(null);
- localElementDeclaration.setTypeDefinition(null);
- localElementDeclaration.setAnonymousTypeDefinition(null);
- localElementDeclaration.setResolvedElementDeclaration(globalElementDeclaration);
- XSDModelGroup modelGroup = (XSDModelGroup)container;
-
- // Format the markup.
-
- formatChild(modelGroup.getElement());
- formatChild(globalElementDeclaration.getElement());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
- */
- protected boolean adopt(XSDConcreteComponent model)
- {
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
deleted file mode 100644
index 23b1d23b88..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * @author ebelisar
- *
- */
-public class MakeTypeGlobalChange extends Change {
-
- private Map fChanges;
-
- private String fNewName;
-
- private XSDTypeDefinition fTypeComponent;
-
- public MakeTypeGlobalChange(XSDTypeDefinition component,
- String newName) {
- Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-
- fTypeComponent = component;
- fNewName = newName;
- }
-
- // public static Change[] createChangesFor(XSDNamedComponent component,
- // String newName) {
- // // TODO: P1 implement search of XSD files
- // XSDSearchSupport support = XSDSearchSupport.getInstance();
- // RefactorSearchRequestor requestor = new
- // RefactorSearchRequestor(component, newName);
- // support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE,
- // requestor);
- //
- // return requestor.getChanges();
- //
- // }
-
- protected Change createUndoChange() {
- return new MakeTypeGlobalChange(fTypeComponent, getNewName());
- }
-
- protected void doRename(IProgressMonitor pm) throws CoreException {
- // TODO P1 change temporary rename of XSD model components
- performModify(getNewName());
- }
-
- public void performModify(final String value) {
-// DelayedRenameRunnable runnable = new DelayedRenameRunnable(
-// fTypeComponent, value);
- // TODO: remove Display
- //Display.getCurrent().asyncExec(runnable);
- }
-
- protected static class DelayedRenameRunnable implements Runnable {
- protected XSDTypeDefinition component;
-
- protected String name;
-
- public DelayedRenameRunnable(XSDTypeDefinition component, String name) {
- this.component = component;
- this.name = name;
- }
-
- public void run() {
- DocumentImpl doc = (DocumentImpl) component.getElement().getOwnerDocument();
- doc.getModel().beginRecording(
- this,
- RefactoringMessages
- .getString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
- MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
- component, name);
- command.run();
- doc.getModel().endRecording(this);
- }
- }
-
- public TextChange getChange(IFile file) {
- TextChange result = (TextChange) fChanges.get(file);
- if (result == null) {
- result = new TextFileChange(file.getName(), file);
- fChanges.put(file, result);
- }
- return result;
- }
-
- public String getName() {
- return RefactoringMessages
- .getFormattedString(
- "MakeTypeGlobalChange.name", new String[] {getNewName() }); //$NON-NLS-1$
- }
-
- public final Change perform(IProgressMonitor pm) throws CoreException {
- try {
- pm.beginTask(RefactoringMessages
- .getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
- Change result = createUndoChange();
- doRename(new SubProgressMonitor(pm, 1));
- return result;
- } finally {
- pm.done();
- }
- }
-
- /**
- * Gets the newName.
- *
- * @return Returns a String
- */
- protected String getNewName() {
- return fNewName;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
- */
- public Object getModifiedElement() {
- // TODO Auto-generated method stub
- return fTypeComponent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void initializeValidationData(IProgressMonitor pm) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- // TODO implement change validation
- return new RefactoringStatus();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
deleted file mode 100644
index 0b793f3716..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class MakeTypeGlobalProcessor extends RenameProcessor implements INameUpdating{
-
- private XSDTypeDefinition fTypeComponent;
- private String fNewElementName;
-
- public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.makeTypeGlobalProcessor"; //$NON-NLS-1$
-
- //private QualifiedNameSearchResult fNameSearchResult;
-
- public MakeTypeGlobalProcessor(XSDTypeDefinition element, String newName) {
- fTypeComponent= element;
- fNewElementName = newName;
-
- }
-
- public XSDTypeDefinition getTypeComponent() {
- return fTypeComponent;
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
- */
- public boolean canEnableTextUpdating() {
- return true;
- }
-
- protected String[] getAffectedProjectNatures() throws CoreException {
- //TODO: find project natures of the files that are going to be refactored
- return new String[0];
- }
-
- protected void loadDerivedParticipants(RefactoringStatus status,
- List result, String[] natures, SharableParticipants shared)
- throws CoreException {
- // TODO: provide a way to load rename participants
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
- CheckConditionsContext context) throws CoreException,
- OperationCanceledException {
- // TODO add code to check final conditions for component rename
- return new RefactoringStatus();
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
- throws CoreException, OperationCanceledException {
-// TODO add code to check initial conditions for component rename
- return new RefactoringStatus();
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- // TODO P1 add change creation
-// Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
-// CompositeChange multiChange = null;
-// if(changes.length > 0)
-// multiChange = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
-// return multiChange;
-
-// computeNameMatches(pm);
-// Change[] changes = fNameSearchResult.getAllChanges();
-// return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
- pm.beginTask("", 1); //$NON-NLS-1$
- try{
- return new MakeTypeGlobalChange(fTypeComponent, getNewElementName());
- } finally{
- pm.done();
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
- */
- public Object[] getElements() {
-
- return new Object[] {fTypeComponent};
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
- */
- public String getIdentifier() {
- return IDENTIFIER;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
- */
- public String getProcessorName() {
- return RefactoringMessages.getFormattedString(
- "MakeLocalTypeGlobalRefactoring.name", //$NON-NLS-1$
- new String[]{getNewElementName()});
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
- */
- public boolean isApplicable() throws CoreException {
- if (fTypeComponent == null)
- return false;
- // TODO implement isApplicable logic for the named component,
- // verify how it is different from other condition checks
-// if (fNamedComponent.isAnonymous())
-// return false;
-// if (! Checks.isAvailable(fType))
-// return false;
-// if (isSpecialCase(fType))
-// return false;
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
- */
- public RefactoringStatus checkNewElementName(String newName){
- Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
- // TODO: implement new name checking
-// RefactoringStatus result = Checks.checkTypeName(newName);
-// if (Checks.isAlreadyNamed(fType, newName))
-// result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name")); //$NON-NLS-1$
- return new RefactoringStatus();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
- */
- public Object getNewElement() throws CoreException {
- // TODO implement this method, it's used for updating selection on new element
- return null;
- }
-
-// private void computeNameMatches(IProgressMonitor pm) throws CoreException {
-//
-// IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-// try {
-// URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
-// IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
-// if (fNameSearchResult == null)
-// fNameSearchResult= new QualifiedNameSearchResult();
-// QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),
-// getNewElementName(),
-// "*.xsd", file.getProject(), pm);
-// } catch (IOException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// }
-
- public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
- RenameArguments arguments= new RenameArguments(getNewElementName(), true);
- String[] natures= getAffectedProjectNatures();
- List result= new ArrayList();
- loadElementParticipants(status, result, arguments, natures, sharedParticipants);
- loadDerivedParticipants(status, result, natures, sharedParticipants);
- return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
- }
-
- protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
- Object[] elements= getElements();
- for (int i= 0; i < elements.length; i++) {
- result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status,
- this, elements[i],
- arguments, natures, shared)));
- }
- }
-
-
- public void setNewElementName(String newName) {
-
- fNewElementName= newName;
- }
-
- public String getNewElementName() {
- return fNewElementName;
- }
-
- public String getCurrentElementName() {
- // TODO Auto-generated method stub
- return fNewElementName;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
deleted file mode 100644
index 04a75e8ada..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
+++ /dev/null
@@ -1,97 +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.xsd.ui.internal.refactor.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.text.edits.TextEditGroup;
-
-/**
- * A utility class to provide compatibility with the old
- * text change API of adding text edits directly and auto
- * inserting them into the tree.
- */
-public class TextChangeCompatibility {
-
- public static void addTextEdit(TextChange change, String name, TextEdit edit) {
- Assert.isNotNull(change);
- Assert.isNotNull(name);
- Assert.isNotNull(edit);
- TextEdit root= change.getEdit();
- if (root == null) {
- root= new MultiTextEdit();
- change.setEdit(root);
- }
- insert(root, edit);
- change.addTextEditGroup(new TextEditGroup(name, edit));
- }
-
- public static void addTextEdit(TextChange change, String name, TextEdit[] edits) {
- Assert.isNotNull(change);
- Assert.isNotNull(name);
- Assert.isNotNull(edits);
- TextEdit root= change.getEdit();
- if (root == null) {
- root= new MultiTextEdit();
- change.setEdit(root);
- }
- for (int i= 0; i < edits.length; i++) {
- insert(root, edits[i]);
- }
- change.addTextEditGroup(new TextEditGroup(name, edits));
- }
-
- public static void insert(TextEdit parent, TextEdit edit) {
- if (!parent.hasChildren()) {
- parent.addChild(edit);
- return;
- }
- TextEdit[] children= parent.getChildren();
- // First dive down to find the right parent.
- for (int i= 0; i < children.length; i++) {
- TextEdit child= children[i];
- if (covers(child, edit)) {
- insert(child, edit);
- return;
- }
- }
- // We have the right parent. Now check if some of the children have to
- // be moved under the new edit since it is covering it.
- for (int i= children.length - 1; i >= 0; i--) {
- TextEdit child= children[i];
- if (covers(edit, child)) {
- parent.removeChild(i);
- edit.addChild(child);
- }
- }
- parent.addChild(edit);
- }
-
- private static boolean covers(TextEdit thisEdit, TextEdit otherEdit) {
- if (thisEdit.getLength() == 0) // an insertion point can't cover anything
- return false;
-
- int thisOffset= thisEdit.getOffset();
- int thisEnd= thisEdit.getExclusiveEnd();
- if (otherEdit.getLength() == 0) {
- int otherOffset= otherEdit.getOffset();
- return thisOffset < otherOffset && otherOffset < thisEnd;
- } else {
- int otherOffset= otherEdit.getOffset();
- int otherEnd= otherEdit.getExclusiveEnd();
- return thisOffset <= otherOffset && otherEnd <= thisEnd;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java
deleted file mode 100644
index 7318d093ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java
+++ /dev/null
@@ -1,215 +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.xsd.ui.internal.refactor.wizard;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameAction;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.SelectionDispatchAction;
-
-/**
- * Action group that adds refactor actions (for example 'Rename', 'Move') to a
- * context menu and the global menu bar.
- *
- */
-public abstract class RefactorActionGroup extends ActionGroup {
-
- private static class NoActionAvailable extends Action {
- public NoActionAvailable() {
- setEnabled(true);
- setText(RefactoringWizardMessages.RefactorActionGroup_no_refactoring_available);
- }
- }
-
- /**
- * Pop-up menu: name of group for reorganize actions (value
- * <code>"group.reorganize"</code>).
- */
- public static final String GROUP_REORGANIZE = IWorkbenchActionConstants.GROUP_REORGANIZE;
-
- public static final String MENU_ID = "org.eclipse.wst.xsd.ui.refactoring.menu"; //$NON-NLS-1$
-
- public static final String RENAME = "org.eclipse.wst.xsd.ui.refactoring.actions.Rename"; //$NON-NLS-1$
-
-
- protected static void initAction(SelectionDispatchAction action,
- ISelection selection) {
-
- Assert.isNotNull(selection);
- Assert.isNotNull(action);
- action.update(selection);
- //provider.addSelectionChangedListener(action);
- }
-
- protected List fEditorActions;
-
- private String fGroupName = GROUP_REORGANIZE;
-
- private Action fNoActionAvailable = new NoActionAvailable();
-
- protected RenameAction fRenameAction;
-
- protected SelectionDispatchAction fRenameTargetNamespace;
-
- protected ISelection selection;
-
- public RefactorActionGroup(ISelection selection) {
- this.selection = selection;
-
- }
-
- public int addAction(IAction action) {
- if (action != null && action.isEnabled()) {
- fEditorActions.add(action);
- return 1;
- }
- return 0;
- }
-
- private void addRefactorSubmenu(IMenuManager menu) {
-
- IMenuManager refactorSubmenu = new MenuManager(RefactoringWizardMessages.RefactorMenu_label, MENU_ID);
- refactorSubmenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- refactorMenuShown(manager);
- }
- });
- refactorSubmenu.add(fNoActionAvailable);
- if (menu.find(refactorSubmenu.getId()) == null) {
- if (menu.find(fGroupName) == null) {
- menu.add(refactorSubmenu);
- } else {
- menu.appendToGroup(fGroupName, refactorSubmenu);
- }
- }
- }
-
- protected void disposeAction(ISelectionChangedListener action,
- ISelectionProvider provider) {
- if (action != null)
- provider.removeSelectionChangedListener(action);
- }
-
- /*
- * (non-Javadoc) Method declared in ActionGroup
- */
- public void fillActionBars(IActionBars actionBars) {
- super.fillActionBars(actionBars);
- actionBars.setGlobalActionHandler(RENAME, fRenameAction);
- retargetFileMenuActions(actionBars);
- }
-
- public void fillActions(List enabledActions) {
-
- if(selection != null && fEditorActions != null){
- for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
- Action action = (Action) iter.next();
- if (action instanceof SelectionDispatchAction) {
- SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
- selectionAction.update(selection);
- }
-
- }
- for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
- Action action = (Action) iter.next();
- if (action != null) {
- enabledActions.add(action);
- }
- }
- }
-
- }
-
- /*
- * (non-Javadoc) Method declared in ActionGroup
- */
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
- addRefactorSubmenu(menu);
- }
-
- private int fillRefactorMenu(IMenuManager refactorSubmenu) {
- int added = 0;
- refactorSubmenu.add(new Separator(GROUP_REORGANIZE));
- for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
- Action action = (Action) iter.next();
- if (action != null && action.isEnabled()) {
- fEditorActions.add(action);
- return 1;
- }
- }
- return added;
- }
-
- private void refactorMenuHidden(IMenuManager manager) {
-
- for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
- Action action = (Action) iter.next();
- if (action instanceof SelectionDispatchAction) {
- SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
- selectionAction.update(selection);
- }
-
- }
- }
-
- private void refactorMenuShown(final IMenuManager refactorSubmenu) {
- // we know that we have an MenuManager since we created it in
- // addRefactorSubmenu.
- Menu menu = ((MenuManager) refactorSubmenu).getMenu();
- menu.addMenuListener(new MenuAdapter() {
- public void menuHidden(MenuEvent e) {
- refactorMenuHidden(refactorSubmenu);
- }
- });
-
- for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
- Action action = (Action) iter.next();
- if (action instanceof SelectionDispatchAction) {
- SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
- selectionAction.update(selection);
- }
- }
- refactorSubmenu.removeAll();
- if (fillRefactorMenu(refactorSubmenu) == 0)
- refactorSubmenu.add(fNoActionAvailable);
- }
-
- /**
- * Retargets the File actions with the corresponding refactoring actions.
- *
- * @param actionBars
- * the action bar to register the move and rename action with
- */
- public void retargetFileMenuActions(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(),
- fRenameAction);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
deleted file mode 100644
index 29c56783ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
+++ /dev/null
@@ -1,146 +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.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public abstract class RefactorGroupActionDelegate implements IObjectActionDelegate, IEditorActionDelegate, IMenuCreator {
-
- protected ISelection fSelection;
- private IAction fDelegateAction;
- // whether to re-fill the menu (reset on selection change)
- private boolean fFillMenu = true;
- protected IWorkbenchPart workbenchPart;
- protected ResourceSet resourceSet = new ResourceSetImpl();
-
-
- public RefactorGroupActionDelegate() {
-
- }
-
- /*
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- workbenchPart = targetPart;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- // nothing to do
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // never called
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- //Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
- Menu menu = new Menu(parent);
- /**
- * Add listener to repopulate the menu each time
- * it is shown because MenuManager.update(boolean, boolean)
- * doesn't dispose pulldown ActionContribution items for each popup menu.
- */
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fFillMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fFillMenu = false;
- }
- }
- });
- return menu;
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // Never called because we become a menu.
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fDelegateAction = action;
- updateWith(selection);
-
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- workbenchPart = targetEditor;
- fDelegateAction = action;
- if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) {
- updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection());
- }
-
- }
-
- public void updateWith(ISelection selection) {
- fSelection = selection;
- if (fDelegateAction != null) {
- boolean enable = false;
- if (selection != null) {
- if (selection instanceof ITextSelection) {
- //if (((ITextSelection) selection).getLength() > 0) {
- enable = true;
- //}
- }
- else if(selection instanceof IStructuredSelection ){
- enable = !selection.isEmpty();
- }
- }
- // enable action
- fDelegateAction.setEnabled(enable);
-
- // fill submenu
- fFillMenu = true;
- fDelegateAction.setMenuCreator(this);
-
-
- }
-
- }
-
-
- protected abstract void fillMenu(Menu menu);
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
deleted file mode 100644
index 77780e100f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
+++ /dev/null
@@ -1,57 +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.xsd.ui.internal.refactor.wizard;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-public class RefactorGroupSubMenu extends CompoundContributionItem {
-
- RefactorActionGroup fRefactorMenuGroup;
-
-
- public RefactorGroupSubMenu(RefactorActionGroup refactorMenuGroup) {
- super();
- fRefactorMenuGroup = refactorMenuGroup;
- }
-
- public RefactorGroupSubMenu(String id) {
- super(id);
- }
-
- protected IContributionItem[] getContributionItems() {
- ArrayList actionsList = new ArrayList();
- ArrayList contribList = new ArrayList();
- fRefactorMenuGroup.fillActions(actionsList);
-
- if (actionsList != null && !actionsList.isEmpty()) {
- for (Iterator iter = actionsList.iterator(); iter.hasNext();) {
- IAction action = (IAction) iter.next();
- contribList.add(new ActionContributionItem(action));
- }
- } else {
- Action dummyAction = new Action(RefactoringWizardMessages.RefactorActionGroup_no_refactoring_available) {
- // dummy inner class; no methods
- };
- dummyAction.setEnabled(false);
- contribList.add(new ActionContributionItem(dummyAction));
- }
- return (IContributionItem[]) contribList.toArray(new IContributionItem[contribList.size()]);
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java
deleted file mode 100644
index 6bac54b55e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.osgi.util.NLS;
-
-public class RefactoringWizardMessages extends NLS {
-
- private static final String BUNDLE_NAME= "org.eclipse.wst.xsd.ui.internal.refactor.wizard.messages";//$NON-NLS-1$
-
- public static String RefactorMenu_label;
- public static String RefactorActionGroup_no_refactoring_available;
-
- public static String RenameAction_rename;
- public static String RenameAction_unavailable;
- public static String RenameAction_text;
-
- public static String RenameInputWizardPage_new_name;
- public static String RenameRefactoringWizard_internal_error;
-
- public static String RenameTargetNamespace_text;
-
- public static String RenameXSDElementAction_exception;
- public static String RenameXSDElementAction_not_available;
- public static String RenameXSDElementAction_name;
-
- public static String RenameSupport_dialog_title;
- public static String RenameSupport_not_available;
-
- public static String RenameComponentWizard_defaultPageTitle;
- public static String RenameComponentWizard_inputPage_description;
-
- public static String RenameInputWizardPage_update_references;
- public static String XSDComponentRenameChange_name;
- public static String XSDComponentRenameChange_Renaming;
- public static String ResourceRenameParticipant_compositeChangeName;
- public static String RenameResourceChange_rename_resource_reference_change;
- public static String XSDRenameResourceChange_name;
- public static String RenameResourceRefactoring_Internal_Error;
- public static String RenameResourceRefactoring_alread_exists;
- public static String RenameResourceRefactoring_invalidName;
- public static String RenameResourceProcessor_name;
- public static String MakeAnonymousTypeGlobalAction_text;
- public static String MakeLocalElementGlobalAction_text;
- public static String XSDComponentRenameParticipant_Component_Refactoring_updates;
- public static String WSDLComponentRenameParticipant_Component_Refactoring_updates;
- public static String RenameComponentProcessor_Component_Refactoring_updates;
- public static String RenameComponentProcessor_Component_Refactoring_update_declatation;
- public static String RenameComponentProcessor_Component_Refactoring_update_reference;
- public static String XSDComponentRenameParticipant_xsd_component_rename_participant;
- public static String WSDLComponentRenameParticipant_wsdl_component_rename_participant;
- public static String ResourceRenameParticipant_File_Rename_update_reference;
-
-
- private RefactoringWizardMessages() {
- // Do not instantiate
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, RefactoringWizardMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java
deleted file mode 100644
index 10bf304d09..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * @author ebelisar
- *
- */
-public class RenameInputWizardPage extends UserInputWizardPage{
- private String fInitialValue;
- private Text fTextField;
- private Button fUpdateReferences;
- /**
- * Creates a new text input page.
- * @param isLastUserPage <code>true</code> if this page is the wizard's last
- * user input page. Otherwise <code>false</code>.
- */
- public RenameInputWizardPage(String description, boolean isLastUserPage) {
- this(description, isLastUserPage, ""); //$NON-NLS-1$
- }
-
- /**
- * Creates a new text input page.
- * @param isLastUserPage <code>true</code> if this page is the wizard's last
- * user input page. Otherwise <code>false</code>
- * @param initialValue the initial value
- */
- public RenameInputWizardPage(String description, boolean isLastUserPage, String initialValue) {
- super("RenameInputWizardPage");
- Assert.isNotNull(initialValue);
- setDescription(description);
- fInitialValue= initialValue;
- }
-
- /**
- * Returns whether the initial input is valid. Typically it is not, because the
- * user is required to provide some information e.g. a new type name etc.
- *
- * @return <code>true</code> iff the input provided at initialization is valid
- */
- protected boolean isInitialInputValid(){
- return false;
- }
-
- /**
- * Returns whether an empty string is a valid input. Typically it is not, because
- * the user is required to provide some information e.g. a new type name etc.
- *
- * @return <code>true</code> iff an empty string is valid
- */
- protected boolean isEmptyInputValid(){
- return false;
- }
-
- /**
- * Returns the content of the text input field.
- *
- * @return the content of the text input field. Returns <code>null</code> if
- * not text input field has been created
- */
- protected String getText() {
- if (fTextField == null)
- return null;
- return fTextField.getText();
- }
-
- /**
- * Sets the new text for the text field. Does nothing if the text field has not been created.
- * @param text the new value
- */
- protected void setText(String text) {
- if (fTextField == null)
- return;
- fTextField.setText(text);
- }
-
- /**
- * Performs input validation. Returns a <code>RefactoringStatus</code> which
- * describes the result of input validation. <code>Null<code> is interpreted
- * as no error.
- */
- protected RefactoringStatus validateTextField(String text){
- return null;
- }
-
- protected Text createTextInputField(Composite parent) {
- return createTextInputField(parent, SWT.BORDER);
- }
-
- protected Text createTextInputField(Composite parent, int style) {
- fTextField= new Text(parent, style);
- fTextField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textModified(getText());
- }
- });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fTextField, XSDEditorCSHelpIds.RENAME_NEW_NAME);
- fTextField.setText(fInitialValue);
- return fTextField;
- }
-
- /**
- * Checks the page's state and issues a corresponding error message. The page validation
- * is computed by calling <code>validatePage</code>.
- */
- protected void textModified(String text) {
- if (! isEmptyInputValid() && text.equals("")){ //$NON-NLS-1$
- setPageComplete(false);
- setErrorMessage(null);
- restoreMessage();
- return;
- }
- if ((! isInitialInputValid()) && text.equals(fInitialValue)){
- setPageComplete(false);
- setErrorMessage(null);
- restoreMessage();
- return;
- }
-
- setPageComplete(validateTextField(text));
-
-// TODO: enable preview in M4
- getRefactoringWizard().setForcePreviewReview(false);
- getContainer().updateButtons();
-
- }
-
- /**
- * Subclasses can override if they want to restore the message differently.
- * This implementation calls <code>setMessage(null)</code>, which clears the message
- * thus exposing the description.
- */
- protected void restoreMessage(){
- setMessage(null);
- }
-
- /* (non-Javadoc)
- * Method declared in IDialogPage
- */
- public void dispose() {
- fTextField= null;
- }
-
- /* (non-Javadoc)
- * Method declared in WizardPage
- */
- public void setVisible(boolean visible) {
- if (visible) {
- textModified(getText());
- }
- super.setVisible(visible);
- if (visible && fTextField != null) {
- fTextField.setFocus();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite superComposite= new Composite(parent, SWT.NONE);
- setControl(superComposite);
- initializeDialogUnits(superComposite);
-
- superComposite.setLayout(new GridLayout());
- Composite composite= new Composite(superComposite, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.verticalSpacing= 8;
- composite.setLayout(layout);
-
-
- Label label= new Label(composite, SWT.NONE);
- label.setText(getLabelText());
-
- Text text= createTextInputField(composite);
- text.selectAll();
- GridData gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint= convertWidthInCharsToPixels(25);
- text.setLayoutData(gd);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(text, XSDEditorCSHelpIds.RENAME_NEW_NAME);
-
- addOptionalUpdateReferencesCheckbox(superComposite);
- gd= new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(gd);
-
- getRefactoringWizard().setForcePreviewReview(false);
-
- Dialog.applyDialogFont(superComposite);
- //WorkbenchHelp.setHelp(getControl(), fHelpContextID);
-
- }
-
- private static Button createCheckbox(Composite parent, String title, boolean value) {
- Button checkBox= new Button(parent, SWT.CHECK);
- checkBox.setText(title);
- checkBox.setSelection(value);
- return checkBox;
- }
-
- private void addOptionalUpdateReferencesCheckbox(Composite result) {
-
- final IReferenceUpdating ref= (IReferenceUpdating)getRefactoring().getAdapter(IReferenceUpdating.class);
- if (ref == null || !ref.canEnableUpdateReferences())
- return;
- String title= RefactoringMessages.getString("RenameInputWizardPage.update_references"); //$NON-NLS-1$
- boolean defaultValue= true;
- fUpdateReferences= createCheckbox(result, title, defaultValue);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateReferences, XSDEditorCSHelpIds.RENAME_UPDATE_REFERENCES);
- ref.setUpdateReferences(fUpdateReferences.getSelection());
- fUpdateReferences.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- ref.setUpdateReferences(fUpdateReferences.getSelection());
- }
- });
- fUpdateReferences.setEnabled(true);
- }
-
- protected String getLabelText() {
- return RefactoringMessages.getString("RenameInputWizardPage.new_name"); //$NON-NLS-1$
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java
deleted file mode 100644
index e24977b91d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-
-public class RenameRefactoringWizard extends RefactoringWizard {
-
- private final String fInputPageDescription;
-
- private final ImageDescriptor fInputPageImageDescriptor;
-
- public RenameRefactoringWizard(Refactoring refactoring, String defaultPageTitle, String inputPageDescription,
- ImageDescriptor inputPageImageDescriptor) {
- super(refactoring, DIALOG_BASED_USER_INTERFACE);
- setDefaultPageTitle(defaultPageTitle);
- fInputPageDescription= inputPageDescription;
- fInputPageImageDescriptor= inputPageImageDescriptor;
-
- }
-
- /* non java-doc
- * @see RefactoringWizard#addUserInputPages
- */
- protected void addUserInputPages() {
- String initialSetting= getProcessor().getCurrentElementName();
- RenameInputWizardPage inputPage= createInputPage(fInputPageDescription, initialSetting);
- inputPage.setImageDescriptor(fInputPageImageDescriptor);
- addPage(inputPage);
- }
-
- protected INameUpdating getProcessor() {
-
- return (INameUpdating)getRefactoring().getAdapter(INameUpdating.class);
- }
-
-
- protected RenameInputWizardPage createInputPage(String message, String initialSetting) {
- return new RenameInputWizardPage(message, true, initialSetting) {
- protected RefactoringStatus validateTextField(String text) {
- return validateNewName(text);
- }
- };
- }
-
- protected RefactoringStatus validateNewName(String newName) {
- INameUpdating ref= getProcessor();
- ref.setNewElementName(newName);
-// try{
- return ref.checkNewElementName(newName);
-// } catch (CoreException e){
-// //XXX: should log the exception
-// String msg= e.getMessage() == null ? "": e.getMessage(); //$NON-NLS-1$
-// return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getFormattedString("RenameRefactoringWizard.internal_error", msg));//$NON-NLS-1$
-// }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
deleted file mode 100644
index f10fccce6a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-
-RefactorMenu_label=Refactor
-RefactorActionGroup_no_refactoring_available=<no refactoring available>
-
-RenameAction_rename=Rename
-RenameAction_unavailable=Operation unavailable on the current selection.\nSelect a ....
-RenameAction_text=Re&name...
-
-RenameInputWizardPage_new_name= &New name:
-RenameRefactoringWizard_internal_error= Internal error during name checking: {0}
-
-
-RenameXSDElementAction_exception=Unexpected exception occurred. See log for details
-RenameXSDElementAction_not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations, attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
-RenameXSDElementAction_name=Rename
-
-
-RenameSupport_dialog_title=Rename
-RenameSupport_not_available=Rename support not available
-
-RenameComponentWizard_defaultPageTitle=Rename wizard
-RenameComponentWizard_inputPage_description=Rename XML Schema component
-
-RenameInputWizardPage_update_references=Update references
-XSDComponentRenameChange_name=XML Schema component renaming in {0}: {1} to {2}
-XSDComponentRenameChange_Renaming=Renaming...
-ResourceRenameParticipant_compositeChangeName=XSD file rename references updating changes
-RenameResourceChange_rename_resource_reference_change=Renaming resource name references
-XSDRenameResourceChange_name=Resource rename: {0} to {1}
-RenameResourceRefactoring_Internal_Error=Internal error
-RenameResourceRefactoring_alread_exists=Resource already exist
-RenameResourceRefactoring_invalidName=Invalid resource name
-RenameResourceProcessor_name=Resource renaming
-MakeAnonymousTypeGlobalAction_text=Make &Anonymous Type Global
-MakeLocalElementGlobalAction_text=Make &Local Element Global
-XSDComponentRenameParticipant_Component_Refactoring_updates=XML Schema refactoring changes
-WSDLComponentRenameParticipant_Component_Refactoring_updates=WSDL Schema refactoring changes
-RenameComponentProcessor_Component_Refactoring_updates=Component name refactoring changes
-RenameComponentProcessor_Component_Refactoring_update_declatation=Update component declaration/definition
-RenameComponentProcessor_Component_Refactoring_update_reference=Update component reference
-XSDComponentRenameParticipant_xsd_component_rename_participant=XSD component rename participant
-WSDLComponentRenameParticipant_wsdl_component_rename_participant=WSDL component rename participant
-ResourceRenameParticipant_File_Rename_update_reference=File rename refactoring changes
-
-RenameTargetNamespace_text=Rename Target Namespace
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
deleted file mode 100644
index 5c465b3ce0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
+++ /dev/null
@@ -1,29 +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.xsd.ui.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public interface IXSDSearchConstants {
-
- public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
- public static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
-
- public static final QualifiedName TYPE_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "type");
- public static final QualifiedName COMPLEX_TYPE_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "complexType");
- public static final QualifiedName SIMPLE_TYPE_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "simpleType");
- public static final QualifiedName ELEMENT_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "element");
- public static final QualifiedName ATTRIBUTE_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "attribute");
- public static final QualifiedName ATTRIBUTE_GROUP_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "attributeGroup");
- public static final QualifiedName GROUP_META_NAME = new QualifiedName (XMLSCHEMA_NAMESPACE, "group");
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java
deleted file mode 100644
index a7077a8ff2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class SearchMessages extends NLS {
-
- private static final String BUNDLE_NAME= "org.eclipse.wst.common.ui.internal.search.SearchMessages";//$NON-NLS-1$
-
- private SearchMessages() {
- // Do not instantiate
- }
-
- public static String group_references;
- public static String Search_FindDeclarationAction_label;
- public static String Search_FindDeclarationsInProjectAction_label;
- public static String Search_FindDeclarationsInWorkingSetAction_label;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, SearchMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
deleted file mode 100644
index f589b57552..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
+++ /dev/null
@@ -1,93 +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.xsd.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSearchContributor extends ComponentSearchContributor {
-
-
- protected void initializeReferences() {
- references = new HashMap();
- String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
- List patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.REF_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE));
- references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
- references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDConstants.BASE_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDConstants.TYPE_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.UNION_ELEMENT_TAG, XSDConstants.MEMBERTYPES_ATTRIBUTE));
- patterns.add(new XMLSearchPattern( ns, XSDConstants.LIST_ELEMENT_TAG, XSDConstants.ITEMTYPE_ATTRIBUTE));
-
- references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.GROUP_ELEMENT_TAG, XSDConstants.REF_ATTRIBUTE));
- references.put(IXSDSearchConstants.GROUP_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDConstants.REF_ATTRIBUTE));
- references.put(IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME, patterns);
-
- patterns = new ArrayList();
- patterns.add(new XMLSearchPattern( ns, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDConstants.REF_ATTRIBUTE));
- references.put(IXSDSearchConstants.ATTRIBUTE_META_NAME, patterns);
- }
-
- protected void initializeDeclarations(){
-
- declarations = new HashMap();
- String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
- SearchPattern pattern = new XMLSearchPattern( ns, XSDConstants.SCHEMA_ELEMENT_TAG, XSDConstants.ELEMENT_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.ELEMENT_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.ATTRIBUTE_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME, pattern);
-
- pattern = new XMLSearchPattern(ns, XSDConstants.GROUP_ELEMENT_TAG, XSDConstants.NAME_ATTRIBUTE);
- declarations.put(IXSDSearchConstants.GROUP_META_NAME, pattern);
-
- }
-
- protected void initializeSupportedNamespaces() {
- namespaces = new String[]{ IXSDSearchConstants.XMLSCHEMA_NAMESPACE};
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
deleted file mode 100644
index 2051804c7e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
+++ /dev/null
@@ -1,51 +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.xsd.ui.internal.search;
-
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XSDSearchParticipant extends XMLSearchParticipant {
-
- private static String ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant";
-
- public XSDSearchParticipant()
- {
- super();
- id = ID;
- }
-
- public String[] getSupportedContentTypes()
- {
- String[] result = { "org.eclipse.wst.xsd.core.xsdsource" };
- return result;
- }
-
- public boolean isApplicable(SearchPattern pattern, Map searchOptions)
- {
- if(pattern instanceof XMLComponentSearchPattern ){
- XMLComponentSearchPattern componentPattern = (XMLComponentSearchPattern)pattern;
- String namespace = componentPattern.getMetaName().getNamespace();
- if(IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(namespace)){
- return true;
- }
- }
- return false;
- }
-
- public ComponentSearchContributor getSearchContributor() {
- return new XSDSearchContributor();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java
deleted file mode 100644
index 4dfefbde7f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java
+++ /dev/null
@@ -1,54 +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.xsd.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.AbstractSearchQuery;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-
-public class XSDSearchQuery extends AbstractSearchQuery
-{
- public final static int LIMIT_TO_DECLARATIONS = 1;
- public final static int LIMIT_TO_REFERENCES = 2;
-
- int fLimitTo = 0;
- IFile fContextFile;
- QualifiedName fElementQName;
- QualifiedName fTypeName;
-
- public XSDSearchQuery(String pattern, IFile file, QualifiedName elementQName, QualifiedName typeName, int limitTo, SearchScope scope, String scopeDescription)
- {
- super(pattern, scope, scopeDescription);
- fLimitTo = limitTo;
- fContextFile = file;
- fElementQName = elementQName;
- fTypeName = typeName;
- }
-
- protected SearchPattern createSearchPattern(QualifiedName typeName)
- {
- if (fLimitTo == LIMIT_TO_DECLARATIONS)
- {
- return new XMLComponentDeclarationPattern(fContextFile, fElementQName, fTypeName);
- }
- else if (fLimitTo == LIMIT_TO_REFERENCES)
- {
- return new XMLComponentReferencePattern(fContextFile, fElementQName, fTypeName);
- }
- return null;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java
deleted file mode 100644
index 1ac668fb78..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java
+++ /dev/null
@@ -1,146 +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.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-//TODO (trung) should be in common.ui this one ??
-public abstract class BaseGroupActionDelegate implements IObjectActionDelegate, IEditorActionDelegate, IMenuCreator
-{
- protected ISelection fSelection;
- private IAction fDelegateAction;
- // whether to re-fill the menu (reset on selection change)
- private boolean fFillMenu = true;
- protected IWorkbenchPart workbenchPart;
-
-
- public BaseGroupActionDelegate()
- {
-
- }
-
- /*
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- workbenchPart = targetPart;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- // nothing to do
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // never called
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- //Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
- Menu menu = new Menu(parent);
- /**
- * Add listener to repopulate the menu each time
- * it is shown because MenuManager.update(boolean, boolean)
- * doesn't dispose pulldown ActionContribution items for each popup menu.
- */
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fFillMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fFillMenu = false;
- }
- }
- });
- return menu;
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // Never called because we become a menu.
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fDelegateAction = action;
- updateWith(selection);
-
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- workbenchPart = targetEditor;
- fDelegateAction = action;
- if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) {
- updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection());
- }
-
- }
-
- public void updateWith(ISelection selection) {
- fSelection = selection;
- if (fDelegateAction != null) {
- boolean enable = false;
- if (selection != null) {
- if (selection instanceof ITextSelection) {
- //if (((ITextSelection) selection).getLength() > 0) {
- enable = true;
- //}
- }
- else if(selection instanceof IStructuredSelection ){
- enable = !selection.isEmpty();
- }
- }
- // enable action
- fDelegateAction.setEnabled(enable);
-
- // fill submenu
- fFillMenu = true;
- fDelegateAction.setMenuCreator(this);
-
-
- }
-
- }
-
-
- protected abstract void fillMenu(Menu menu);
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java
deleted file mode 100644
index e0f936af6b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-// TODO... open a bugzilla to get the JDT class moved to non internal platform
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-
-public class CompositeActionGroup extends ActionGroup {
-
- private ActionGroup[] fGroups;
-
- public CompositeActionGroup() {
- }
-
- public CompositeActionGroup(ActionGroup[] groups) {
- setGroups(groups);
- }
-
- protected void setGroups(ActionGroup[] groups) {
- Assert.isTrue(fGroups == null);
- Assert.isNotNull(groups);
- fGroups= groups;
- }
-
- public ActionGroup get(int index) {
- if (fGroups == null)
- return null;
- return fGroups[index];
- }
-
- public void addGroup(ActionGroup group) {
- if (fGroups == null) {
- fGroups= new ActionGroup[] { group };
- } else {
- ActionGroup[] newGroups= new ActionGroup[fGroups.length + 1];
- System.arraycopy(fGroups, 0, newGroups, 0, fGroups.length);
- newGroups[fGroups.length]= group;
- fGroups= newGroups;
- }
- }
-
- public void dispose() {
- super.dispose();
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].dispose();
- }
- }
-
- public void fillActionBars(IActionBars actionBars) {
- super.fillActionBars(actionBars);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].fillActionBars(actionBars);
- }
- }
-
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].fillContextMenu(menu);
- }
- }
-
- public void setContext(ActionContext context) {
- super.setContext(context);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].setContext(context);
- }
- }
-
- public void updateActionBars() {
- super.updateActionBars();
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].updateActionBars();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java
deleted file mode 100644
index 05308e26c2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.search.actions;
-
-// TODO.. fill in the content
-public class DeclarationsSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java
deleted file mode 100644
index ac5a175e19..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java
+++ /dev/null
@@ -1,30 +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.xsd.ui.internal.search.actions;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.IEditorPart;
-public class FindAction extends Action implements ISelectionChangedListener
-{
- protected IEditorPart editor;
-
- protected FindAction(IEditorPart editor)
- {
- this.editor = editor;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- // TODO Auto-generated method stub
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java
deleted file mode 100644
index ad53351e99..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.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.wst.xsd.ui.internal.search.actions;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
-import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-public class FindReferencesAction extends FindAction
-{
- public FindReferencesAction(IEditorPart editor)
- {
- super(editor);
- }
-
- public void setActionDefinitionId(String string)
- {
- }
-
- /**
- * To be used by subclass in its run() Returns the file where the selection of
- * a component (from the user) occurs ie. Returns the file that the user is
- * currently working on.
- *
- * @return The IFile representation of the current working file.
- */
- protected IFile getCurrentFile()
- {
- if (editor != null)
- {
- IEditorInput input = editor.getEditorInput();
- if (input instanceof IFileEditorInput)
- {
- IFileEditorInput fileEditorInput = (IFileEditorInput) input;
- return fileEditorInput.getFile();
- }
- }
- return null;
- }
-
- /**
- * To be used by subclass in its run().. Determines the metaName of the XSD
- * component given to this method.
- *
- * @param component
- * The component of which we want to determine the name
- * @return
- */
- protected QualifiedName determineMetaName(XSDNamedComponent component)
- {
- QualifiedName metaName = null;
- if (component instanceof XSDComplexTypeDefinition)
- {
- metaName = IXSDSearchConstants.COMPLEX_TYPE_META_NAME;
- }
- else if (component instanceof XSDSimpleTypeDefinition)
- {
- metaName = IXSDSearchConstants.SIMPLE_TYPE_META_NAME;
- }
- else if (component instanceof XSDElementDeclaration)
- {
- metaName = IXSDSearchConstants.ELEMENT_META_NAME;
- }
- else if (component instanceof XSDModelGroupDefinition)
- {
- metaName = IXSDSearchConstants.GROUP_META_NAME;
- }
- else if (component instanceof XSDAttributeGroupDefinition)
- {
- metaName = IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME;
- }
- else if (component instanceof XSDAttributeDeclaration)
- {
- metaName = IXSDSearchConstants.ATTRIBUTE_META_NAME;
- }
- return metaName;
- }
-
- protected XSDNamedComponent getXSDNamedComponent()
- {
- if (editor != null)
- {
- ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- if (provider != null)
- {
- ISelection selection = provider.getSelection();
- if (mapper != null)
- {
- selection = mapper.mapSelection(selection);
- }
- if (selection != null && selection instanceof IStructuredSelection)
- {
- IStructuredSelection s = (IStructuredSelection) selection;
- Object o = s.getFirstElement();
- if (o != null && o instanceof XSDNamedComponent)
- {
- return (XSDNamedComponent) o;
- }
- }
- }
- }
- // The expected component we get from the editor does not meet
- // our expectation
- return null;
- }
-
- public void run()
- {
- String pattern = "";
- XSDNamedComponent component = getXSDNamedComponent();
- IFile file = getCurrentFile();
- if (file != null && component != null)
- {
- QualifiedName metaName = determineMetaName(component);
- QualifiedName elementQName = new QualifiedName(component.getTargetNamespace(), component.getName());
- SearchScope scope = new WorkspaceSearchScope();
- String scopeDescription = "Workspace";
- XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java
deleted file mode 100644
index c94f256c4d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java
+++ /dev/null
@@ -1,45 +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.xsd.ui.internal.search.actions;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.ProjectSearchScope;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDNamedComponent;
-public class FindReferencesInProjectAction extends FindReferencesAction
-{
- public FindReferencesInProjectAction(IEditorPart editor)
- {
- super(editor);
- }
-
- public void run()
- {
- String pattern = "";
- XSDNamedComponent component = getXSDNamedComponent();
- IFile file = getCurrentFile();
- if (file != null && component != null)
- {
- QualifiedName metaName = determineMetaName(component);
- QualifiedName elementQName = new QualifiedName(component.getTargetNamespace(), component.getName());
- IPath fullPath = file.getFullPath();
- ProjectSearchScope scope = new ProjectSearchScope(fullPath);
- String scopeDescription = "Project";
- XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java
deleted file mode 100644
index 4c710efa17..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java
+++ /dev/null
@@ -1,88 +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.xsd.ui.internal.search.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.window.Window;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.WorkingSetSearchScope;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class FindReferencesInWorkingSetAction extends FindReferencesAction{
-
- public FindReferencesInWorkingSetAction(IEditorPart editor) {
- super(editor);
- }
-
- public void setActionDefinitionId(String string)
- {
-
- }
-
- public void run(){
- IWorkingSet[] workingSets = queryWorkingSets();
- if ( workingSets == null || workingSets.length == 0)
- // The user chooses nothing, no point to continue.
- return;
- String pattern = "";
-
- XSDNamedComponent component = getXSDNamedComponent();
- IFile file = getCurrentFile();
- if ( file != null && component != null){
- QualifiedName metaName = determineMetaName(component);
-
- QualifiedName elementQName =
- new QualifiedName(component.getTargetNamespace(), component.getName());
-
- // Create a scope from the selected working sets
- WorkingSetSearchScope scope = new WorkingSetSearchScope();
- for (int i = 0; i < workingSets.length; i++){
- IAdaptable[] elements = workingSets[i].getElements();
- scope.addAWorkingSetToScope(elements);
- }
-
- String scopeDescription = "Working Set";
- XSDSearchQuery searchQuery =
- new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(searchQuery);
- }
- }
-
- /**
- * Calls a dialog asking the user to choose the working Sets he wants
- * to do the search on
- * @return
- */
- public static IWorkingSet[] queryWorkingSets(){
- Shell shell= XSDEditorPlugin.getShell();
- if (shell == null)
- return null;
- IWorkingSetSelectionDialog dialog =
- PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
- if (dialog.open() == Window.OK) {
- IWorkingSet[] workingSets= dialog.getSelection();
- if (workingSets.length > 0)
- return workingSets;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java
deleted file mode 100644
index 0efc8ff10a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.search.actions;
-
-// TODO... fill in the content
-public class ImplementorsSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java
deleted file mode 100644
index 463e241e49..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java
+++ /dev/null
@@ -1,17 +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.xsd.ui.internal.search.actions;
-
-// TODO... fill in the content
-public class OccurrencesSearchGroup
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java
deleted file mode 100644
index d6984b3a05..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java
+++ /dev/null
@@ -1,179 +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.xsd.ui.internal.search.actions;
-
-import java.util.List;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.wst.xsd.ui.internal.search.SearchMessages;
-
-public class ReferencesSearchGroup extends SearchGroup {
- protected static final String MENU_TEXT= SearchMessages.group_references;
-
- protected IEditorPart fEditor;
- private IWorkbenchSite fSite;
- private IActionBars fActionBars;
-
-// private String fGroupId;
-
- protected FindAction fFindReferencesAction;
- protected FindAction fFindReferencesInProjectAction;
- protected FindAction fFindReferencesInWorkingSetAction;
-
-
- /**
- * Note: This constructor is for internal use only. Clients should not call this constructor.
- * @param editor
- */
- public ReferencesSearchGroup(IEditorPart editor) {
- Assert.isNotNull(editor);
- fEditor= editor;
- fSite= fEditor.getSite();
-
- initialize();
- }
-
- protected void initialize() {
-// fGroupId= ITextEditorActionConstants.GROUP_FIND;
-
- fFindReferencesAction= new FindReferencesAction(fEditor);
- fFindReferencesAction.setText(SearchMessages.Search_FindDeclarationAction_label);
- fFindReferencesAction.setActionDefinitionId("SEARCH_REFERENCES_IN_WORKSPACE");
- //fEditor.setAction("SearchReferencesInWorkspace", fFindReferencesAction); //$NON-NLS-1$
-
- fFindReferencesInProjectAction= new FindReferencesInProjectAction(fEditor);
- fFindReferencesInProjectAction.setText(SearchMessages.Search_FindDeclarationsInProjectAction_label);
- fFindReferencesInProjectAction.setActionDefinitionId("SEARCH_REFERENCES_IN_PROJECT");
- //fEditor.setAction("SearchReferencesInProject", fFindReferencesInProjectAction); //$NON-NLS-1$
-
- fFindReferencesInWorkingSetAction= new FindReferencesInWorkingSetAction(fEditor);
- fFindReferencesInWorkingSetAction.setText(SearchMessages.Search_FindDeclarationsInWorkingSetAction_label);
- fFindReferencesInWorkingSetAction.setActionDefinitionId(".SEARCH_REFERENCES_IN_WORKING_SET");
- //fEditor.setAction("SearchReferencesInWorkingSet", fFindReferencesInWorkingSetAction); //$NON-NLS-1$
- }
-
- /*
- private void registerAction(SelectionDispatchAction action, ISelectionProvider provider, ISelection selection) {
- action.update(selection);
- provider.addSelectionChangedListener(action);
- }*/
-
- /**
- * Note: this method is for internal use only. Clients should not call this method.
- *
- * @return the menu label
- */
- protected String getName() {
- return MENU_TEXT;
- }
-
- public void fillActions(List list)
- {
- list.add(fFindReferencesAction);
- //list.add(fFindReferencesInHierarchyAction);
- list.add(fFindReferencesInProjectAction);
- list.add(new Separator());
- list.add(fFindReferencesInWorkingSetAction);
- }
-
- /* (non-Javadoc)
- * Method declared in ActionGroup
- */
- public void fillActionBars(IActionBars actionBars) {
- Assert.isNotNull(actionBars);
- super.fillActionBars(actionBars);
- fActionBars= actionBars;
- updateGlobalActionHandlers();
- }
-
-
-// private void addAction(IAction action, IMenuManager manager) {
-// if (action.isEnabled()) {
-// manager.add(action);
-// }
-// }
-
- /*
- private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
- FindAction action;
- if (fEditor != null)
- action= new WorkingSetFindAction(fEditor, new FindReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
- else
- action= new WorkingSetFindAction(fSite, new FindReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
- action.update(getContext().getSelection());
- addAction(action, manager);
- }
- */
-
- /* (non-Javadoc)
- * Method declared on ActionGroup.
- */
- public void fillContextMenu(IMenuManager manager) {
- /*
- MenuManager javaSearchMM= new MenuManager(getName(), IContextMenuConstants.GROUP_SEARCH);
- addAction(fFindReferencesAction, javaSearchMM);
- addAction(fFindReferencesInProjectAction, javaSearchMM);
- addAction(fFindReferencesInHierarchyAction, javaSearchMM);
-
- javaSearchMM.add(new Separator());
-
- Iterator iter= SearchUtil.getLRUWorkingSets().sortedIterator();
- while (iter.hasNext()) {
- addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
- }
- addAction(fFindReferencesInWorkingSetAction, javaSearchMM);
-
- if (!javaSearchMM.isEmpty())
- manager.appendToGroup(fGroupId, javaSearchMM);
- */
- }
-
- /*
- * Overrides method declared in ActionGroup
- */
- public void dispose() {
- ISelectionProvider provider= fSite.getSelectionProvider();
- if (provider != null) {
- disposeAction(fFindReferencesAction, provider);
- disposeAction(fFindReferencesInProjectAction, provider);
- // disposeAction(fFindReferencesInHierarchyAction, provider);
- disposeAction(fFindReferencesInWorkingSetAction, provider);
- }
- fFindReferencesAction= null;
- fFindReferencesInProjectAction= null;
- //fFindReferencesInHierarchyAction= null;
- fFindReferencesInWorkingSetAction= null;
- updateGlobalActionHandlers();
- super.dispose();
- }
-
- private void updateGlobalActionHandlers() {
- if (fActionBars != null) {
-// fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_WORKSPACE, fFindReferencesAction);
-// fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_PROJECT, fFindReferencesInProjectAction);
-// fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_HIERARCHY, fFindReferencesInHierarchyAction);
-// fActionBars.setGlobalActionHandler(JdtActionConstants.FIND_REFERENCES_IN_WORKING_SET, fFindReferencesInWorkingSetAction);
- }
- }
-
- private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
- if (action != null)
- provider.removeSelectionChangedListener(action);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java
deleted file mode 100644
index 18071ba221..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.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
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.search.actions;
-
-import java.util.List;
-import org.eclipse.ui.actions.ActionGroup;
-
-public abstract class SearchGroup extends ActionGroup
-{
- public abstract void fillActions(List list);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java
deleted file mode 100644
index ec6846db85..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java
+++ /dev/null
@@ -1,35 +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.xsd.ui.internal.search.actions;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionGroup;
-
-public class XSDSearchActionGroup extends ActionGroup
-{
-// private ReferencesSearchGroup fReferencesGroup;
-// private DeclarationsSearchGroup fDeclarationsGroup;
-// private ImplementorsSearchGroup fImplementorsGroup;
-// private OccurrencesSearchGroup fOccurrencesGroup;
-// private IEditorPart fEditor;
-
- public XSDSearchActionGroup(IEditorPart editor)
- {
- Assert.isNotNull(editor);
-// fEditor = editor;
-// fReferencesGroup = new ReferencesSearchGroup(editor);
-// fDeclarationsGroup = new DeclarationsSearchGroup();
-// fImplementorsGroup = new ImplementorsSearchGroup();
-// fOccurrencesGroup = new OccurrencesSearchGroup();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java
deleted file mode 100644
index 91c55c61d1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java
+++ /dev/null
@@ -1,22 +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.xsd.ui.internal.search.actions;
-
-import org.eclipse.swt.widgets.Menu;
-
-//org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchGroupActionDelegate
-public class XSDSearchDeclarationsGroupActionDelegate extends BaseGroupActionDelegate
-{
- protected void fillMenu(Menu menu) {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java
deleted file mode 100644
index 5ec359fb81..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.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.xsd.ui.internal.search.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-// TODO should be in common.ui
-public class XSDSearchGroupSubMenu extends CompoundContributionItem
-{
- SearchGroup searchActionGroup;
-
- public XSDSearchGroupSubMenu(SearchGroup refactorMenuGroup)
- {
- super();
- searchActionGroup = refactorMenuGroup;
- }
-
- public XSDSearchGroupSubMenu(String id)
- {
- super(id);
- }
-
- protected IContributionItem[] getContributionItems()
- {
- ArrayList actionsList = new ArrayList();
- ArrayList contribList = new ArrayList();
- searchActionGroup.fillActions(actionsList);
- if (actionsList != null && !actionsList.isEmpty())
- {
- for (Iterator iter = actionsList.iterator(); iter.hasNext();)
- {
- Object o = iter.next();
- if (o instanceof IAction)
- {
- IAction action = (IAction)o;
- contribList.add(new ActionContributionItem(action));
- }
- else if (o instanceof Separator)
- {
- Separator separator = (Separator)o;
- contribList.add(separator);
- }
- }
- }
- else
- {
- Action dummyAction = new Action("XSDSeachActionGroup_no_refactoring_available") //TODO wrong string here ??
- {
- // dummy inner class; no methods
- };
- dummyAction.setEnabled(false);
- contribList.add(new ActionContributionItem(dummyAction));
- }
- return (IContributionItem[]) contribList.toArray(new IContributionItem[contribList.size()]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java
deleted file mode 100644
index be947bc397..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java
+++ /dev/null
@@ -1,46 +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.xsd.ui.internal.search.actions;
-
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-//org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchGroupActionDelegate
-public class XSDSearchReferencesGroupActionDelegate extends BaseGroupActionDelegate
-{
- protected void fillMenu(Menu menu) {
- try
- {
- if (fSelection == null) {
- return;
- }
- if (workbenchPart != null)
- {
- IWorkbenchPartSite site = workbenchPart.getSite();
- if (site == null)
- return;
-
- IEditorPart editor = site.getPage().getActiveEditor();
- if ( editor != null ){
- ReferencesSearchGroup referencesGroup = new ReferencesSearchGroup(editor);
- XSDSearchGroupSubMenu subMenu = new XSDSearchGroupSubMenu(referencesGroup);
- subMenu.fill(menu, -1);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.classpath b/bundles/org.eclipse.wtp.javascript.capabilities/.classpath
deleted file mode 100644
index fd545ef000..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <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"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.project b/bundles/org.eclipse.wtp.javascript.capabilities/.project
deleted file mode 100644
index 970984cab1..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wtp.javascript.capabilities</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9504e18e9c..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Tue May 19 03:12:16 EDT 2009
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.compiler.compliance=1.4
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index cb176097c0..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue May 19 03:12:17 EDT 2009
-eclipse.preferences.version=1
-resolve.requirebundle=false
-pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF
deleted file mode 100644
index a0b2924d8d..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wtp.javascript.capabilities;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.eclipse.ui.workbench,
- org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf
deleted file mode 100644
index 778e2f3084..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf
+++ /dev/null
@@ -1,2 +0,0 @@
-# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
-jarprocessor.exclude.pack=true \ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties
deleted file mode 100644
index 1186a6a0b7..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Properties file for org.eclipse.wtp.javascript.capabilities
-Bundle-Name.0 = JavaScript Capabilities
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-activity.javascript = JavaScript Development
-activity.javascript.desc = Develop JavaScript applications.
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/about.html b/bundles/org.eclipse.wtp.javascript.capabilities/about.html
deleted file mode 100644
index 31cec0d931..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/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, 2009</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.wtp.javascript.capabilities/build.properties b/bundles/org.eclipse.wtp.javascript.capabilities/build.properties
deleted file mode 100644
index 41197a489e..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = META-INF/,\
- .,\
- OSGI-INF/,\
- plugin.xml,\
- OSGI-INF/l10n/,\
- about.html
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml b/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml
deleted file mode 100644
index 659ce32a11..0000000000
--- a/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.ui.activities">
- <activity
- name="%activity.javascript"
- description="%activity.javascript.desc"
- id="org.eclipse.wtp.javascript.capabilities">
- </activity>
- <activityPatternBinding
- activityId="org.eclipse.wtp.javascript.capabilities"
- pattern="org\.eclipse\.wst\.jsdt\.[\.\w/]*">
- </activityPatternBinding>
-
- </extension>
-</plugin> \ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.web.capabilities/.project b/bundles/org.eclipse.wtp.web.capabilities/.project
deleted file mode 100644
index d08ea9c206..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wtp.web.capabilities</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index d4f00a125b..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue May 19 10:29:20 EDT 2009
-eclipse.preferences.version=1
-resolve.requirebundle=false
-pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF
deleted file mode 100644
index 5efdcd19b1..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wtp.web.capabilities;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.eclipse.ui.workbench,
- org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf
deleted file mode 100644
index 778e2f3084..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf
+++ /dev/null
@@ -1,2 +0,0 @@
-# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
-jarprocessor.exclude.pack=true \ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties
deleted file mode 100644
index 615c55420b..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Properties file for org.eclipse.wtp.web.capabilities
-Bundle-Name.0 = Web Capabilities
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-activity.web = Web Development
-activity.web.desc = Develop Web applications.
diff --git a/bundles/org.eclipse.wtp.web.capabilities/about.html b/bundles/org.eclipse.wtp.web.capabilities/about.html
deleted file mode 100644
index 31cec0d931..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/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, 2009</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.wtp.web.capabilities/build.properties b/bundles/org.eclipse.wtp.web.capabilities/build.properties
deleted file mode 100644
index cef084da28..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = META-INF/,\
- OSGI-INF/,\
- plugin.xml,\
- OSGI-INF/l10n/,\
- about.html
diff --git a/bundles/org.eclipse.wtp.web.capabilities/plugin.xml b/bundles/org.eclipse.wtp.web.capabilities/plugin.xml
deleted file mode 100644
index e95ad7d176..0000000000
--- a/bundles/org.eclipse.wtp.web.capabilities/plugin.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
- <!-- Web Capability Definition-->
- <!-- The Web capability requires the XML capability.
- The XML capability is currently serving as the
- default WTP capability. (See the comments on the
- XML capability.)
- -->
- <extension point="org.eclipse.ui.activities">
-
- <activity
- name="%activity.web"
- description="%activity.web.desc"
- id="org.eclipse.wtp.web.capabilities">
- </activity>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.css\.[\.\w/]*">
- </activityPatternBinding>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.html\.[\.\w/]*">
- </activityPatternBinding>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.javascript\.[\.\w/]*">
- </activityPatternBinding>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.server\.[\.\w/]*">
- </activityPatternBinding>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.internet\.monitor\.[\.\w/]*">
- </activityPatternBinding>
-
- <activityPatternBinding
- activityId="org.eclipse.wtp.web.capabilities"
- pattern="org\.eclipse\.wst\.web\.[\.\w/]*">
- </activityPatternBinding>
-
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/.project b/bundles/org.eclipse.wtp.xml.capabilities/.project
deleted file mode 100644
index bd1e416132..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wtp.xml.capabilities</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index eb760e204b..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue May 19 09:49:45 EDT 2009
-eclipse.preferences.version=1
-resolve.requirebundle=false
-pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF
deleted file mode 100644
index 746469337f..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wtp.xml.capabilities;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.eclipse.ui.workbench,
- org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf
deleted file mode 100644
index 778e2f3084..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf
+++ /dev/null
@@ -1,2 +0,0 @@
-# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
-jarprocessor.exclude.pack=true \ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties
deleted file mode 100644
index 74b8872041..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Properties file for org.eclipse.wtp.xml.capabilities
-Bundle-Name.0 = XML Capabilities
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-activity.xml = XML Development
-activity.xml.desc = Develop XML applications.
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/about.html b/bundles/org.eclipse.wtp.xml.capabilities/about.html
deleted file mode 100644
index 31cec0d931..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/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, 2009</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.wtp.xml.capabilities/build.properties b/bundles/org.eclipse.wtp.xml.capabilities/build.properties
deleted file mode 100644
index cef084da28..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = META-INF/,\
- OSGI-INF/,\
- plugin.xml,\
- OSGI-INF/l10n/,\
- about.html
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml b/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml
deleted file mode 100644
index 33eed274d2..0000000000
--- a/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!--
- XML Capability Definition The following components are
- associated with the XML activity as they are required by XML and
- other components and XML is currently serving as the base WTP
- component. common sse validation
- -->
- <extension
- point="org.eclipse.ui.activities">
- <activity
- name="%activity.xml"
- description="%activity.xml.desc"
- id="org.eclipse.wtp.xml.capabilities">
- </activity>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.xml\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.xsd\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.dtd\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.apache\.xerces\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.common\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.sse\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.validation\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.internet\.cache\.[\.\w/]*">
- </activityPatternBinding>
- <activityPatternBinding
- activityId="org.eclipse.wtp.xml.capabilities"
- pattern="org\.eclipse\.wst\.internet\.proxy\.[\.\w/]*">
- </activityPatternBinding>
-
- </extension>
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/.cvsignore b/docs/org.eclipse.jst.jsp.ui.infopop/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/.project b/docs/org.eclipse.jst.jsp.ui.infopop/.project
deleted file mode 100644
index 01be1bc426..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsp.ui.infopop</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.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/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.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/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml b/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml
deleted file mode 100644
index bac1fef208..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<contexts>
-<context id="jspf1000">
-<description>Select values for the following properties from the drop-down lists:
-- <b>Character code:</b> Specifies the page directive's pageEncoding value and contentType charset. In HTML documents, this value is also used for the &lt;META&gt; tag's charset property.
-- <b>Language:</b> Specifies the page directive's programming language.
-- <b>Content Type:</b> Specifies the contentType's TYPE value for the page directive. In HTML documents, this value is also used for the &lt;META&gt; tag's content property.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="jspr0010">
-<description>Select this option to open the <b>Rename Resource</b> dialog, if applicable, which lets you rename the currently selected Java element and references to that element.
-</description>
-<topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="jspr0020">
-<description>Select this option to open the <b>Move</b> dialog, if applicable, which lets you move the currently selected Java element. For example, you can move a method from one class to another.
-</description>
-<topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="webx0050">
-<description>This page lets you specify the line delimiter and the text encoding that will be used when you create or save a JavaServer Pages (JSP) file.
-
-Various development platforms use different line delimiters to indicate the start of a new line. Select the operating system that corresponds to your development or deployment platform.
-<b>Note:</b> This delimiter will not automatically be added to any documents that currently exist. It will be added only to documents that you create after you select the line delimiter type and click <b>Apply</b>, or to existing files that you open and then resave after you select the line delimiter type and click <b>Apply</b>.
-
-The encoding attribute is used to specify the default character encoding set that is used when creating JSP files. Changing the encoding causes any new JSP files that are created from scratch to use the selected encoding.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0051">
-<description>This page lets you customize the syntax highlighting that the JavaServer Pages (JSP) editor does when you are editing a file."
-
-The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
-
-The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that let you specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
-
-Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0052">
-<description>This page lets you create new and edit existing templates that will be used when you edit a JSP file.
-</description>
-<topic label="Adding and removing JSP templates" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html"/>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="xmlm1050">
-<description>Select this option to open the <b>Cleanup</b> dialog, which contains settings to update a document so that it is well-formed and formatted. Cleanup includes such activities as inserting missing tags, adding quotation marks around attribute values, node capitalization, and formatting a document.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-</contexts>
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts2.xml b/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts2.xml
deleted file mode 100644
index 780835ac94..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts2.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<contexts>
-<context id="jspsource_source_HelpId">
-<description>The JSP source page editor lets you edit a JavaServer Pages file. The editor provides many text editing features, such as content assist, user-defined templates, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-<topic label="Adding and removing JSP templates" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html"/>
-<topic label="Making content assist work for JSP files" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html"/>
-</context>
-
-<context id="jspf1000">
-<description>Select values for the following properties from the drop-down lists:
-- <b>Character code:</b> Specifies the page directive's pageEncoding value and contentType charset. In HTML documents, this value is also used for the &lt;META&gt; tag's charset property.
-- <b>Language:</b> Specifies the page directive's programming language.
-- <b>Content Type:</b> Specifies the contentType's TYPE value for the page directive. In HTML documents, this value is also used for the &lt;META&gt; tag's content property.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="jspr0010">
-<description>Select this option to open the <b>Refactor Rename</b> dialog, if applicable, which lets you rename the currently selected Java element and references to that element.
-</description>
-<topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="jspr0020">
-<description>Select this option to open the <b>Refactor Move</b> dialog, if applicable, which lets you move the currently selected Java element. For example, you can move a method from one class to another.
-</description>
-<topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="webx0050">
-<description>This page lets you specify the line delimiter and the text encoding that will be used when you create or save a JavaServer Pages (JSP) file.
-
-Various development platforms use different line delimiters to indicate the start of a new line. Select the operating system that corresponds to your development or deployment platform.
-<b>Note:</b> This delimiter will not automatically be added to any documents that currently exist. It will be added only to documents that you create after you select the line delimiter type and click <b>Apply</b>, or to existing files that you open and then resave after you select the line delimiter type and click <b>Apply</b>.
-
-The encoding attribute is used to specify the default character encoding set that is used when creating JSP files. Changing the encoding causes any new JSP files that are created from scratch to use the selected encoding.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0051">
-<description>This page lets you customize the syntax highlighting that the JavaServer Pages (JSP) editor does when you are editing a file."
-
-The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
-
-The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that let you specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
-
-Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0052">
-<description>This page lets you create new and edit existing templates that will be used when you edit a JSP file.
-</description>
-<topic label="Adding and removing JSP templates" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html"/>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="xmlm1050">
-<description>Select this option to open the <b>Cleanup</b> dialog, which contains settings to update a document so that it is well-formed and formatted. Cleanup includes such activities as inserting missing tags, adding quotation marks around attribute values, node capitalization, and formatting a document.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-</contexts>
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/JspWizContexts.xml b/docs/org.eclipse.jst.jsp.ui.infopop/JspWizContexts.xml
deleted file mode 100644
index 1d085e2666..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/JspWizContexts.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<contexts>
- <context id="jspw0010">
- <description>
- Select the JSP template checkbox to create your JSP file based on a default template. You can choose to have your JSP created with HTML, XHTML, or XHTML with XML markup. If you do not select a template, your newly created JSP file will be completely blank.
- </description>
- </context>
-</contexts>
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index 2888f4139d..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Plugin.name
-Bundle-SymbolicName: org.eclipse.jst.jsp.ui.infopop; singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/about.html b/docs/org.eclipse.jst.jsp.ui.infopop/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/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/docs/org.eclipse.jst.jsp.ui.infopop/build.properties b/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
deleted file mode 100644
index 58c6973134..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-bin.includes = EditorJspContexts.xml,\
- EditorJspContexts2.xml,\
- about.html,\
- plugin.xml,\
- META-INF/,\
- META-INF/,\
- EditorJspContexts2.xml,\
- EditorJspContexts.xml,\
- about.html,\
- plugin.properties,\
- plugin.xml,\
- plugin.properties
-generateSourceBundle=false
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
deleted file mode 100644
index aa9ca26eb9..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# NLS_MESSAGEFORMAT_VAR
-# ==============================================================================
-# Translation Instruction: section to be translated
-# ==============================================================================
-Plugin.name = JSP tools infopops
-
-Bundle-Vendor.0 = Eclipse Web Tools Platform \ No newline at end of file
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.xml b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.xml
deleted file mode 100644
index 3d1b116f16..0000000000
--- a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.1"?>
-
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
- <contexts file="EditorJspContexts.xml" plugin="org.eclipse.jst.jsp.ui"/>
- <contexts file="EditorJspContexts2.xml" plugin="org.eclipse.jst.jsp.core"/>
- <contexts file="JspWizContexts.xml" plugin="org.eclipse.jst.jsp.ui"/>
-</extension>
-
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/.cvsignore b/docs/org.eclipse.wst.doc.user/.cvsignore
deleted file mode 100644
index 183c840c6f..0000000000
--- a/docs/org.eclipse.wst.doc.user/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.doc.user_1.0.0.jar
diff --git a/docs/org.eclipse.wst.doc.user/.project b/docs/org.eclipse.wst.doc.user/.project
deleted file mode 100644
index 94c75b9860..0000000000
--- a/docs/org.eclipse.wst.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 5cf4c20290..0000000000
--- a/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.doc.user; singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
diff --git a/docs/org.eclipse.wst.doc.user/about.html b/docs/org.eclipse.wst.doc.user/about.html
deleted file mode 100644
index c76171588e..0000000000
--- a/docs/org.eclipse.wst.doc.user/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</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/docs/org.eclipse.wst.doc.user/book.css b/docs/org.eclipse.wst.doc.user/book.css
deleted file mode 100644
index 0df25533a9..0000000000
--- a/docs/org.eclipse.wst.doc.user/book.css
+++ /dev/null
@@ -1,203 +0,0 @@
-@import "../PRODUCT_PLUGIN/book.css";
-
-P.Code {
- display: block;
- text-align: left;
- text-indent: 0.00pt;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 15pt;
- font-size: 10.000000pt;
- font-weight: medium;
- font-style: Regular;
- color: #4444CC;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Courier New";
-}
-
-H6.CaptionFigColumn {
- display: block;
- text-align: left;
- text-indent: 0.000000pt;
- margin-top: 3.000000pt;
- margin-bottom: 11.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
- font-size: 9.000000pt;
- font-weight: medium;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Arial";
-}
-
-P.Note {
- display: block;
- text-align: left;
- text-indent: 0pt;
- margin-top: 19.500000pt;
- margin-bottom: 19.500000pt;
- margin-right: 0.000000pt;
- margin-left: 30pt;
- font-size: 11.000000pt;
- font-weight: medium;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Arial";
-}
-
-EM.UILabel {
- font-weight: Bold;
- font-style: Regular;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
-}
-
-EM.CodeName {
- font-weight: Bold;
- font-style: Regular;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Courier New";
-}
-
-/* following font face declarations need to be removed for DBCS */
-body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
- font-family: Arial, Helvetica, sans-serif;
- color: #000000
-}
-
-pre {
- font-family: Courier, monospace
-}
-
-/* end font face declarations */
- /* following font size declarations should be OK for DBCS */
-body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
- font-size: 10pt;
-}
-
-pre {
- font-size: 10pt
-}
-
-/* end font size declarations */
-body {
- background: #FFFFFF
-}
-
-h1 {
- font-size: 18pt;
- margin-top: 5;
- margin-bottom: 1
-}
-
-h2 {
- font-size: 14pt;
- margin-top: 25;
- margin-bottom: 3
-}
-
-h3 {
- font-size: 11pt;
- margin-top: 20;
- margin-bottom: 3
-}
-
-h4 {
- font-size: 10pt;
- margin-top: 20;
- margin-bottom: 3;
- font-style: italic
-}
-
-p {
- margin-top: 10px;
- margin-bottom: 10px
-}
-
-pre {
- margin-left: 6;
- font-size: 9pt
-}
-
-a:link {
- color: #0000FF
-}
-
-a:hover {
- color: #000080
-}
-
-a:visited {
- text-decoration: underline
-}
-
-ul {
- margin-top: 0;
- margin-bottom: 10
-}
-
-li {
- margin-top: 0;
- margin-bottom: 0
-}
-
-li p {
- margin-top: 0;
- margin-bottom: 0
-}
-
-ol {
- margin-top: 0;
- margin-bottom: 10
-}
-
-dl {
- margin-top: 0;
- margin-bottom: 10
-}
-
-dt {
- margin-top: 0;
- margin-bottom: 0;
- font-weight: bold
-}
-
-dd {
- margin-top: 0;
- margin-bottom: 0
-}
-
-strong {
- font-weight: bold
-}
-
-em {
- font-style: italic
-}
-
-var {
- font-style: italic
-}
-
-div.revision {
- border-left-style: solid;
- border-left-width: thin;
- border-left-color: #7B68EE;
- padding-left: 5
-}
-
-th {
- font-weight: bold
-} \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/build.properties b/docs/org.eclipse.wst.doc.user/build.properties
deleted file mode 100644
index 8307a8e8be..0000000000
--- a/docs/org.eclipse.wst.doc.user/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-bin.includes = about.html,\
- common.css,\
- commonltr.css,\
- images/,\
- META-INF/,\
- notices.html,\
- plugin.properties,\
- plugin.xml,\
- toc.xml,\
- reference_toc.xml,\
- topics/,\
- book.css,\
- commonrtl.css
diff --git a/docs/org.eclipse.wst.doc.user/common.css b/docs/org.eclipse.wst.doc.user/common.css
deleted file mode 100644
index 2f4f3f2f94..0000000000
--- a/docs/org.eclipse.wst.doc.user/common.css
+++ /dev/null
@@ -1,1197 +0,0 @@
-body {
- font-family: Arial, sans-serif;
- font-size: 0.8em;
- background-color: #ffffff;
- color: Black;
- margin-right: 5em;
- margin-bottom: 1em;
-}
-
-.ibmfilepath {
- font-family: monospace;
- font-size: 100%;
-}
-
-.ibmcommand {
- font-weight: bold;
-}
-
-.ibmemphasis {
- font-style: italic;
-}
-
-.mv,.pk,.pkdef,.pv {
- font-family: monospace;
- font-size: 100%;
- padding-top: 0em;
- padding-right: .3em;
- padding-bottom: 0em;
- padding-left: .3em;
-}
-
-tt,samp {
- font-family: monospace;
- font-size: 100%;
-}
-
-BODY.nav {
- background-color: #FFFFFF;
- border-right: 0.2em ridge black;
- font-size: 0.95em;
-}
-
-.base {
- font-weight: normal;
- font-style: normal;
- font-variant: normal;
- text-decoration: none;
- background-color: #ffffff;
-}
-
-TABLE {
- color: black;
- width: 90%;
- border-collapse: collapse;
- border-color: Black;
- background: white;
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- margin-left: 0em;
- margin-right: 0em;
-}
-
-.tbldesc {
- font-style: italic;
-}
-
-TH {
- font-weight: bold;
- font-size: 0.7em;
- color: black;
- background-color: #dadada;
- padding-top: 0.1em;
- padding-bottom: 0.3em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-TH.base {
- font-weight: bold;
- color: black;
- border: 1 solid #606060;
- background-color: #dcdada;
- padding-top: 0.65em;
- padding-bottom: 0.65em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-TD {
- font-size: 0.7em;
- color: black;
- background-color: white;
- padding-top: 0.1em;
- padding-bottom: 0.3em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-CITE {
- font-style: italic;
-}
-
-EM {
- font-style: italic;
-}
-
-STRONG {
- font-weight: bold;
-}
-
-caption {
- text-align: left;
- font-style: italic;
-}
-
-DT {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-
-DD {
- margin-left: 1.0em;
-}
-
-PRE,pre.cgraphic {
- font-family: monospace;
- font-size: 12px;
- background-color: #dadada;
- padding: 5px;
-}
-
-.italic {
- font-style: italic;
-}
-
-.bold {
- font-weight: bold;
-}
-
-.underlined {
- text-decoration: underline;
-}
-
-.bold-italic,.boldItalic {
- font-weight: bold;
- font-style: italic;
-}
-
-.smallCaps,.smallcaps {
- text-transform: uppercase;
- font-size: smaller;
- font-variant: small-caps;
-}
-
-.italic-underlined {
- font-style: italic;
- text-decoration: underline;
-}
-
-.bold-underlined {
- font-weight: bold;
- text-decoration: underline;
-}
-
-.bold-italic-underlined {
- font-weight: bold;
- font-style: italic;
- text-decoration: underline;
-}
-
-.smallcaps-underlined {
- font-variant: small-caps;
- text-decoration: underline;
-}
-
-.emphasis {
- font-style: italic;
-}
-
-.inlinedef {
- font-style: italic;
-}
-
-.sidebar {
- background: #cccccc;
-}
-
-A:link {
- color: #006699;
- text-decoration: underline;
-}
-
-A:visited {
- color: #996699;
- text-decoration: underline;
-}
-
-A:active {
- color: #006699;
- text-decoration: underline;
-}
-
-A:hover {
- color: #996699;;
- text-decoration: underline;
-}
-
-a.toclink:link {
- text-decoration: none;
-}
-
-a.toclink:active {
- text-decoration: none;
-}
-
-a.toclink:visited {
- text-decoration: none;
-}
-
-a.toclink:hover {
- text-decoration: underline;
-}
-
-a.ptoclink:link {
- text-decoration: none;
-}
-
-a.ptoclink:active {
- text-decoration: none;
-}
-
-a.ptoclink:visited {
- text-decoration: none;
-}
-
-a.ptoclink:hover {
- text-decoration: underline;
-}
-
-a.indexlink:link {
- text-decoration: none;
-}
-
-a.indexlink:active {
- text-decoration: none;
-}
-
-a.indexlink:visited {
- text-decoration: none;
-}
-
-a.indexlink:hover {
- text-decoration: underline;
-}
-
-a.figurelist:link {
- text-decoration: none;
-}
-
-a.figurelist:active {
- text-decoration: none;
-}
-
-a.figurelist:visited {
- text-decoration: none;
-}
-
-a.figurelist:hover {
- text-decoration: underline;
-}
-
-a.tablelist:link {
- text-decoration: none;
-}
-
-a.tablelist:active {
- text-decoration: none;
-}
-
-a.tablelist:visited {
- text-decoration: none;
-}
-
-a.tablelist:hover {
- text-decoration: underline;
-}
-
-a.boldgreylink:link {
- text-decoration: none;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-a.boldgreylink:visited {
- text-decoration: none;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-a.boldgreylink:hover {
- text-decoration: underline;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-.runningheader {
- font-family: Verdana, Arial, sans-serif;
- font-size: 0.7em;
-}
-
-.runningfooter {
- font-family: Verdana, Arial, sans-serif;
- font-size: 0.7em;
-}
-
-.runningfooter a:link {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:active {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:visited {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:hover {
- font-weight: bold;
- color: #000000;
- text-decoration: underline;
-}
-
-#breadcrumb,.breadcrumb,span.breadcrumbs {
- font-size: 0.75em;
-}
-
-.fastpath {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.fastpathtitle {
- font-weight: bold;
-}
-
-.toc {
- font-size: small;
-}
-
-.nested0 {
- margin-top: 0em;
-}
-
-.p {
- margin-top: 1em;
-}
-
-span.figcap {
- font-style: italic;
-}
-
-span.figdesc {
- font-style: italic;
-}
-
-div.figbox {
-
-}
-
-div.figrules {
-
-}
-
-div.fignone {
-
-}
-
-.fignone {
-
-}
-
-.figborder {
-
-}
-
-.figsides {
-
-}
-
-.figtop {
-
-}
-
-.figbottom {
-
-}
-
-.figtopbot {
-
-}
-
-.parentlink {
-
-}
-
-.prevlink {
-
-}
-
-.nextlink {
-
-}
-
-.relconceptshd {
-
-}
-
-.reltaskshd {
-
-}
-
-.relrefhd {
-
-}
-
-.synnone {
-
-}
-
-.synborder {
-
-}
-
-.synsides {
-
-}
-
-.syntop {
-
-}
-
-.synbottom {
-
-}
-
-.syntopbot {
-
-}
-
-.skip {
- margin-top: 1em;
-}
-
-.skipspace {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.ulchildlink {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.olchildlink {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-ul,ol {
- margin-top: 0.1em;
- padding-top: 0.1em;
-}
-
-ul.simple {
- list-style-type: none;
-}
-
-ul.indexlist {
- list-style-type: none;
-}
-
-OL LI {
- margin-top: 0.0em;
- margin-bottom: 0.0em;
- margin-left: 0.0em;
-}
-
-UL LI {
- margin-top: 0.0em;
- margin-bottom: 0.0em;
- margin-left: 0.0em;
-}
-
-OL LI DIV P {
- list-style-type: decimal;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
-}
-
-UL LI DIV P {
- list-style-type: disc;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
-}
-
-* [compact="yes"]>li {
- margin-top: 0 em;
-}
-
-* [compact="no"]>li {
- margin-top: 0.5em;
-}
-
-hr {
- margin-bottom: 0em;
- margin-top: 0em;
- padding-top: 0em;
- padding-bottom: 0em;
- width: 90%;
- color: #cccccc;
- text-align: center;
-}
-
-H1,.title,.pagetitle,.topictitle1 {
- font-size: 1.5em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.5em;
- word-spacing: 0.1em;
-}
-
-H2,.subtitle,.pagesubtitle,.topictitle2 {
- font-size: 1.25em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.0em;
- padding-bottom: 0.0em;
-}
-
-H3,.boldtitle,.topictitle3 {
- font-size: 1.0em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.2em;
- padding-bottom: 0.1em;
-}
-
-H4,.topictitle4 {
- font-size: 0.9em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.1em;
- padding-bottom: 0.1em;
-}
-
-h5,.topictitle5 {
- font-size: 0.8em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0em;
- padding-bottom: 0em;
-}
-
-h6,.topictitle6 {
- font-size: 0.7em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0em;
- padding-bottom: 0em;
-}
-
-div.headtitle {
- font-size: 1em;
- font-weight: bold;
- margin-left: 0em;
-}
-
-div.head0 {
- font-size: 0.9em;
- font-weight: bold;
- margin-left: 0em;
- margin-top: 0.5em;
-}
-
-div.head1 {
- font-size: 0.8em;
- font-weight: bold;
- margin-left: 1em;
- padding-top: 0.5em;
-}
-
-div.head2 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 2em;
-}
-
-div.head3 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 3em;
-}
-
-div.head4 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 4em;
-}
-
-div.head5 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 5em;
-}
-
-div.head6 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 6em;
-}
-
-div.head7 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 7em;
-}
-
-div.head8 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 8em;
-}
-
-div.head9 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 9em;
-}
-
-.tip {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.tiptitle {
- font-weight: bold;
-}
-
-.firstcol {
- font-weight: bold;
-}
-
-.ptocH1 {
- font-size: x-small;
-}
-
-.ptocH2 {
- font-size: x-small;
-}
-
-.stitle {
- font-style: italic;
- text-decoration: underline;
-}
-
-.nte {
-
-}
-
-.xxlines {
- white-space: pre;
- font-size: 0.95em;
-}
-
-.sectiontitle {
- margin-top: 1em;
- margin-bottom: 0em;
- color: black;
- font-size: 1.2em;
- font-weight: bold;
-}
-
-div.imageleft {
- text-align: left;
-}
-
-div.imagecenter {
- text-align: center;
-}
-
-div.imageright {
- text-align: right;
-}
-
-div.imagejustify {
- text-align: justify;
-}
-
-div.mmobj {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: center;
-}
-
-div.mmobjleft {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: left;
-}
-
-div.mmobjcenter {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: center;
-}
-
-div.mmobjright {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: right;
-}
-
-pre.screen {
- padding: 1em 1em 1em 1em;
- margin-top: 0.4em;
- margin-bottom: 0.4em;
- border: thin solid Black;
- font-size: 100%;
-}
-
-.prereq {
- margin-left: 1.5em;
-}
-
-.defListHead {
- font-weight: bold;
- text-decoration: underline;
-}
-
-span.mv {
- font-style: italic;
-}
-
-span.md {
- text-decoration: line-through;
-}
-
-.pk,span.pk {
- font-weight: bold;
-}
-
-span.pkdef {
- font-weight: bold;
- text-decoration: underline;
-}
-
-span.pv {
- font-style: italic;
-}
-
-span.pvdef {
- font-style: italic;
- text-decoration: underline;
-}
-
-span.kwd {
- font-weight: bold;
-}
-
-span.kdwdef {
- font-weight: bold;
- text-decoration: underline;
-}
-
-.parmListKwd {
- font-weight: bold;
-}
-
-.parmListVar {
- font-style: italic;
-}
-
-span.oper {
- font-style: normal;
-}
-
-span.operdef {
- text-decoration: underline;
-}
-
-VAR,span.var {
- font-style: italic;
-}
-
-span.vardef {
- font-style: italic;
- text-decoration: underline;
-}
-
-div.msg {
- padding: 0.2em 1em 1em 1em;
- margin-top: 0.4em;
- margin-bottom: 0.4em;
-}
-
-div.msgnum {
- float: left;
- font-weight: bold;
- margin-bottom: 1em;
- margin-right: 1em;
-}
-
-div.msgtext {
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-div.msgitemtitle {
- font-weight: bold;
-}
-
-p.msgitem {
- margin-top: 0em;
-}
-
-.attention,div.attention {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.attentiontitle,span.attentiontitle {
- font-weight: bold;
-}
-
-.cautiontitle,div.cautiontitle {
- margin-top: 1em;
- font-weight: bold;
-}
-
-.caution,div.caution {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.danger,div.danger {
- padding: 0.5em 0.5em 0.5em 0.5em;
- border: solid;
- border-width: thin;
- font-weight: bold;
- margin-top: 0.2em;
- margin-bottom: 1em;
-}
-
-.dangertitle,div.dangertitle {
- margin-top: 1em;
- font-weight: bold;
-}
-
-.important {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.importanttitle {
- font-weight: bold;
-}
-
-.remember {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.remembertitle {
- font-weight: bold;
-}
-
-.restriction {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.restrictiontitle {
- font-weight: bold;
-}
-
-div.warningtitle {
- font-weight: bold;
-}
-
-div.warningbody {
- margin-left: 2em
-}
-
-.note {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.notetitle,div.notetitle {
- font-weight: bold;
-}
-
-div.notebody {
- margin-left: 2em;
-}
-
-div.notelisttitle {
- font-weight: bold;
-}
-
-div.fnnum {
- float: left;
-}
-
-div.fntext {
- margin-left: 2em;
-}
-
-div.stepl {
- margin-left: 2em;
-}
-
-div.steplnum {
- font-weight: bold;
- float: left;
- margin-left: 0.5em;
-}
-
-div.stepltext {
- margin-left: 5em;
-}
-
-div.steplnum {
- font-style: italic;
- font-weight: bold;
- float: left;
- margin-left: 0.5em;
-}
-
-div.stepltext {
- margin-bottom: 0.5em;
- margin-left: 3em;
-}
-
-div.ledi {
- margin-left: 3em;
-}
-
-div.ledesc {
- margin-left: 3em;
-}
-
-span.pblktitle {
- font-weight: bold;
-}
-
-div.pblklblbox {
- padding: 0.5em 0.5em 0.5em 0.5em;
- border: solid;
- border-width: thin;
- margin-top: 0.2em;
-}
-
-span.ednoticestitle {
- font-weight: bold;
-}
-
-span.uicontrol {
- font-weight: bold;
-}
-
-span.term {
- font-weight: bold;
-}
-
-span.idxshow {
- color: green;
-}
-
-div.code {
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-span.refkey {
- font-weight: bold;
- color: white;
- background-color: black;
-}
-
-tt.apl {
- font-style: italic;
-}
-
-div.qualifstart {
- padding: 0.1em 0.5em 0.5em 0.5em;
- border-top: solid;
- border-left: solid;
- border-right: solid;
- border-width: thin;
- font-weight: bold;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
- text-align: center;
-}
-
-div.qualifend {
- padding: 0.5em 0.5em 0.1em 0.5em;
- border-bottom: solid;
- border-left: solid;
- border-right: solid;
- border-width: thin;
- font-weight: bold;
- margin-bottom: 0.2em;
- text-align: center;
-}
-
-.noshade {
- background-color: transparent;
-}
-
-.xlight {
- background-color: #DADADA;
-}
-
-.light {
- background-color: #B0B0B0;
-}
-
-.medium {
- background-color: #8C8C8C;
-}
-
-.dark {
- background-color: #6E6E6E;
-}
-
-.xdark {
- background-color: #585858;
-}
-
-.light-yellow {
- background-color: #FFFFCC;
-}
-
-.khaki {
- background-color: #CCCC99;
-}
-
-.medium-blue {
- background-color: #6699CC;
-}
-
-.light-blue {
- background-color: #CCCCFF;
-}
-
-.mid-grey {
- background-color: #CCCCCC;
-}
-
-.light-grey {
- background-color: #DADADA;
-}
-
-.lightest-grey {
- background-color: #E6E6E6;
-}
-
-#changed {
- position: absolute;
- left: 0.2em;
- color: #7B68EE;
- background-color: #FFFFFF;
- font-style: normal;
- font-weight: bold;
-}
-
-INPUT.buttons {
- font-size: 0.75em;
- border-top: 0.2em outset #B1B1B1;
- border-right: 0.2em outset #000000;
- border-bottom: 0.2em outset #000000;
- border-left: 0.2em outset #B1B1B1;
- background-color: #E2E2E2;
- margin-bottom: 0.2em;
-}
-
-.cgraphic {
- font-size: 90%;
- color: black;
-}
-
-.aix,.hpux,.sun,.unix,.win2,.winnt,.win,.zos,.linux,.os390,.os400,.c,.cplusplus,.cobol,.fortran,.java,.macosx,.os2,.pl1,.rpg
- {
- background-repeat: no-repeat;
- background-position: top left;
- margin-top: 0.5em;
- text-indent: 55px;
-}
-
-.aix {
- background-image: url(ngaix.gif);
-}
-
-.hpux {
- background-image: url(nghpux.gif);
-}
-
-.sun {
- background-image: url(ngsolaris.gif);
-}
-
-.unix {
- background-image: url(ngunix.gif);
-}
-
-.win2 {
- background-image: url(ng2000.gif);
-}
-
-.winxp {
- background-image: url(ngxp.gif);
-}
-
-.winnt {
- background-image: url(ngnt.gif);
-}
-
-.win {
- background-image: url(ngwin.gif);
-}
-
-.zos {
- background-image: url(ngzos.gif);
-}
-
-.linux {
- background-image: url(nglinux.gif);
-}
-
-.os390 {
- background-image: url(ng390.gif);
-}
-
-.os400 {
- background-image: url(ng400.gif);
-}
-
-.c {
- background-image: url(ngc.gif);
-}
-
-.cplusplus {
- background-image: url(ngcpp.gif);
-}
-
-.cobol {
- background-image: url(ngcobol.gif);
-}
-
-.fortran {
- background-image: url(ngfortran.gif);
-}
-
-.java {
- background-image: url(ngjava.gif);
-}
-
-.macosx {
- background-image: url(ngmacosx.gif);
-}
-
-.os2 {
- background-image: url(ngos2.gif);
-}
-
-.pl1 {
- background-image: url(ngpl1.gif);
-}
-
-.rpg {
- background-image: url(ngrpg.gif);
-} \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/commonltr.css b/docs/org.eclipse.wst.doc.user/commonltr.css
deleted file mode 100644
index e6a81958c6..0000000000
--- a/docs/org.eclipse.wst.doc.user/commonltr.css
+++ /dev/null
@@ -1,1306 +0,0 @@
-/*
- | (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved.
- */
-
-.unresolved { background-color: skyblue; }
-.noTemplate { background-color: yellow; }
-
-.base { background-color: #ffffff; }
-
-/* Add space for top level topics */
-.nested0 { margin-top : 1em;}
-
-/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
-.p {margin-top: 1em}
-
-/* Default of italics to set apart figure captions */
-.figcap { font-style: italic }
-.figdesc { font-style: normal }
-
-/* Use @frame to create frames on figures */
-.figborder { border-style: solid; padding-left : 3px; border-width : 2px; padding-right : 3px; margin-top: 1em; border-color : Silver;}
-.figsides { border-left : 2px solid; padding-left : 3px; border-right : 2px solid; padding-right : 3px; margin-top: 1em; border-color : Silver;}
-.figtop { border-top : 2px solid; margin-top: 1em; border-color : Silver;}
-.figbottom { border-bottom : 2px solid; border-color : Silver;}
-.figtopbot { border-top : 2px solid; border-bottom : 2px solid; margin-top: 1em; border-color : Silver;}
-
-/* Most link groups are created with <div>. Ensure they have space before and after. */
-.ullinks { list-style-type: none }
-.ulchildlink { margin-top: 1em; margin-bottom: 1em }
-.olchildlink { margin-top: 1em; margin-bottom: 1em }
-.linklist { margin-bottom: 1em }
-.linklistwithchild { margin-left: 1.5em; margin-bottom: 1em }
-.sublinklist { margin-left: 1.5em; margin-bottom: 1em }
-.relconcepts { margin-top: 1em; margin-bottom: 1em }
-.reltasks { margin-top: 1em; margin-bottom: 1em }
-.relref { margin-top: 1em; margin-bottom: 1em }
-.relinfo { margin-top: 1em; margin-bottom: 1em }
-.breadcrumb { font-size : smaller; margin-bottom: 1em }
-.prereq { margin-left : 20px;}
-
-/* Set heading sizes, getting smaller for deeper nesting */
-.topictitle1 { margin-top: 0pc; margin-bottom: .1em; font-size: 1.34em; }
-.topictitle2 { margin-top: 1pc; margin-bottom: .45em; font-size: 1.17em; }
-.topictitle3 { margin-top: 1pc; margin-bottom: .17em; font-size: 1.17em; font-weight: bold; }
-.topictitle4 { margin-top: .83em; font-size: 1.17em; font-weight: bold; }
-.topictitle5 { font-size: 1.17em; font-weight: bold; }
-.topictitle6 { font-size: 1.17em; font-style: italic; }
-.sectiontitle { margin-top: 1em; margin-bottom: 0em; color: black; font-size: 1.17em; font-weight: bold;}
-.section { margin-top: 1em; margin-bottom: 1em }
-.example { margin-top: 1em; margin-bottom: 1em }
-
-/* All note formats have the same default presentation */
-.note { margin-top: 1em; margin-bottom : 1em;}
-.notetitle { font-weight: bold }
-.notelisttitle { font-weight: bold }
-.tip { margin-top: 1em; margin-bottom : 1em;}
-.tiptitle { font-weight: bold }
-.fastpath { margin-top: 1em; margin-bottom : 1em;}
-.fastpathtitle { font-weight: bold }
-.important { margin-top: 1em; margin-bottom : 1em;}
-.importanttitle { font-weight: bold }
-.remember { margin-top: 1em; margin-bottom : 1em;}
-.remembertitle { font-weight: bold }
-.restriction { margin-top: 1em; margin-bottom : 1em;}
-.restrictiontitle { font-weight: bold }
-.attention { margin-top: 1em; margin-bottom : 1em;}
-.attentiontitle { font-weight: bold }
-.dangertitle { font-weight: bold }
-.danger { margin-top: 1em; margin-bottom : 1em;}
-.cautiontitle { font-weight: bold }
-.caution { font-weight: bold; margin-bottom : 1em; }
-
-/* Simple lists do not get a bullet */
-ul.simple { list-style-type: none }
-
-/* Used on the first column of a table, when rowheader="firstcol" is used */
-.firstcol { font-weight : bold;}
-
-/* Various basic phrase styles */
-.bold { font-weight: bold; }
-.boldItalic { font-weight: bold; font-style: italic; }
-.italic { font-style: italic; }
-.underlined { text-decoration: underline; }
-.uicontrol { font-weight: bold; }
-.parmname { font-weight: bold; }
-.kwd { font-weight: bold; }
-.defkwd { font-weight: bold; text-decoration: underline; }
-.var { font-style : italic;}
-.shortcut { text-decoration: underline; }
-
-/* Default of bold for definition list terms */
-.dlterm { font-weight: bold; }
-
-/* Use CSS to expand lists with @compact="no" */
-.dltermexpand { font-weight: bold; margin-top: 1em; }
-*[compact="yes"]>li { margin-top: 0em;}
-*[compact="no"]>li { margin-top: .53em;}
-.liexpand { margin-top: 1em; margin-bottom: 1em }
-.sliexpand { margin-top: 1em; margin-bottom: 1em }
-.dlexpand { margin-top: 1em; margin-bottom: 1em }
-.ddexpand { margin-top: 1em; margin-bottom: 1em }
-.stepexpand { margin-top: 1em; margin-bottom: 1em }
-.substepexpand { margin-top: 1em; margin-bottom: 1em }
-
-/* Align images based on @align on topic/image */
-div.imageleft { text-align: left }
-div.imagecenter { text-align: center }
-div.imageright { text-align: right }
-div.imagejustify { text-align: justify }
-
-pre.screen { padding: 5px 5px 5px 5px; border: outset; background-color: #CCCCCC; margin-top: 2px; margin-bottom : 2px; white-space: pre}
-
-/* copied from common.css */
-body {
- font-family: Arial, sans-serif;
- font-size: 0.8em;
- background-color: #ffffff;
- color: Black;
- margin-right: 5em;
- margin-bottom: 1em;
-}
-
-.ibmfilepath {
- font-family: monospace;
- font-size: 100%;
-}
-
-.ibmcommand {
- font-weight: bold;
-}
-
-.ibmemphasis {
- font-style: italic;
-}
-
-.mv,.pk,.pkdef,.pv {
- font-family: monospace;
- font-size: 100%;
- padding-top: 0em;
- padding-right: .3em;
- padding-bottom: 0em;
- padding-left: .3em;
-}
-
-tt,samp {
- font-family: monospace;
- font-size: 100%;
-}
-
-BODY.nav {
- background-color: #FFFFFF;
- border-right: 0.2em ridge black;
- font-size: 0.95em;
-}
-
-.base {
- font-weight: normal;
- font-style: normal;
- font-variant: normal;
- text-decoration: none;
- background-color: #ffffff;
-}
-
-TABLE {
- color: black;
- width: 90%;
- border-collapse: collapse;
- border-color: Black;
- background: white;
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- margin-left: 0em;
- margin-right: 0em;
-}
-
-.tbldesc {
- font-style: italic;
-}
-
-TH {
- font-weight: bold;
- font-size: 0.7em;
- color: black;
- background-color: #dadada;
- padding-top: 0.1em;
- padding-bottom: 0.3em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-TH.base {
- font-weight: bold;
- color: black;
- border: 1 solid #606060;
- background-color: #dcdada;
- padding-top: 0.65em;
- padding-bottom: 0.65em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-TD {
- font-size: 0.7em;
- color: black;
- background-color: white;
- padding-top: 0.1em;
- padding-bottom: 0.3em;
- padding-left: 1em;
- padding-right: 1em;
-}
-
-CITE {
- font-style: italic;
-}
-
-EM {
- font-style: italic;
-}
-
-STRONG {
- font-weight: bold;
-}
-
-caption {
- text-align: left;
- font-style: italic;
-}
-
-DT {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-
-DD {
- margin-left: 1.0em;
-}
-
-PRE,pre.cgraphic {
- font-family: monospace;
- font-size: 12px;
- background-color: #dadada;
- padding: 5px;
-}
-
-.italic {
- font-style: italic;
-}
-
-.bold {
- font-weight: bold;
-}
-
-.underlined {
- text-decoration: underline;
-}
-
-.bold-italic,.boldItalic {
- font-weight: bold;
- font-style: italic;
-}
-
-.smallCaps,.smallcaps {
- text-transform: uppercase;
- font-size: smaller;
- font-variant: small-caps;
-}
-
-.italic-underlined {
- font-style: italic;
- text-decoration: underline;
-}
-
-.bold-underlined {
- font-weight: bold;
- text-decoration: underline;
-}
-
-.bold-italic-underlined {
- font-weight: bold;
- font-style: italic;
- text-decoration: underline;
-}
-
-.smallcaps-underlined {
- font-variant: small-caps;
- text-decoration: underline;
-}
-
-.emphasis {
- font-style: italic;
-}
-
-.inlinedef {
- font-style: italic;
-}
-
-.sidebar {
- background: #cccccc;
-}
-
-A:link {
- color: #006699;
- text-decoration: underline;
-}
-
-A:visited {
- color: #996699;
- text-decoration: underline;
-}
-
-A:active {
- color: #006699;
- text-decoration: underline;
-}
-
-A:hover {
- color: #996699;;
- text-decoration: underline;
-}
-
-a.toclink:link {
- text-decoration: none;
-}
-
-a.toclink:active {
- text-decoration: none;
-}
-
-a.toclink:visited {
- text-decoration: none;
-}
-
-a.toclink:hover {
- text-decoration: underline;
-}
-
-a.ptoclink:link {
- text-decoration: none;
-}
-
-a.ptoclink:active {
- text-decoration: none;
-}
-
-a.ptoclink:visited {
- text-decoration: none;
-}
-
-a.ptoclink:hover {
- text-decoration: underline;
-}
-
-a.indexlink:link {
- text-decoration: none;
-}
-
-a.indexlink:active {
- text-decoration: none;
-}
-
-a.indexlink:visited {
- text-decoration: none;
-}
-
-a.indexlink:hover {
- text-decoration: underline;
-}
-
-a.figurelist:link {
- text-decoration: none;
-}
-
-a.figurelist:active {
- text-decoration: none;
-}
-
-a.figurelist:visited {
- text-decoration: none;
-}
-
-a.figurelist:hover {
- text-decoration: underline;
-}
-
-a.tablelist:link {
- text-decoration: none;
-}
-
-a.tablelist:active {
- text-decoration: none;
-}
-
-a.tablelist:visited {
- text-decoration: none;
-}
-
-a.tablelist:hover {
- text-decoration: underline;
-}
-
-a.boldgreylink:link {
- text-decoration: none;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-a.boldgreylink:visited {
- text-decoration: none;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-a.boldgreylink:hover {
- text-decoration: underline;
- color: #333333;
- font-family: Verdana, Arial, sans-serif;
- font-weight: bold;
- font-size: 0.9em;
-}
-
-.runningheader {
- font-family: Verdana, Arial, sans-serif;
- font-size: 0.7em;
-}
-
-.runningfooter {
- font-family: Verdana, Arial, sans-serif;
- font-size: 0.7em;
-}
-
-.runningfooter a:link {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:active {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:visited {
- font-weight: bold;
- color: #000000;
- text-decoration: none;
-}
-
-.runningfooter a:hover {
- font-weight: bold;
- color: #000000;
- text-decoration: underline;
-}
-
-#breadcrumb,.breadcrumb,span.breadcrumbs {
- font-size: 0.75em;
-}
-
-.fastpath {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.fastpathtitle {
- font-weight: bold;
-}
-
-.toc {
- font-size: small;
-}
-
-.nested0 {
- margin-top: 0em;
-}
-
-.p {
- margin-top: 1em;
-}
-
-span.figcap {
- font-style: italic;
-}
-
-span.figdesc {
- font-style: italic;
-}
-
-div.figbox {
-
-}
-
-div.figrules {
-
-}
-
-div.fignone {
-
-}
-
-.fignone {
-
-}
-
-.figborder {
-
-}
-
-.figsides {
-
-}
-
-.figtop {
-
-}
-
-.figbottom {
-
-}
-
-.figtopbot {
-
-}
-
-.parentlink {
-
-}
-
-.prevlink {
-
-}
-
-.nextlink {
-
-}
-
-.relconceptshd {
-
-}
-
-.reltaskshd {
-
-}
-
-.relrefhd {
-
-}
-
-.synnone {
-
-}
-
-.synborder {
-
-}
-
-.synsides {
-
-}
-
-.syntop {
-
-}
-
-.synbottom {
-
-}
-
-.syntopbot {
-
-}
-
-.skip {
- margin-top: 1em;
-}
-
-.skipspace {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.ulchildlink {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.olchildlink {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-ul,ol {
- margin-top: 0.1em;
- padding-top: 0.1em;
-}
-
-ul.simple {
- list-style-type: none;
-}
-
-ul.indexlist {
- list-style-type: none;
-}
-
-OL LI {
- margin-top: 0.0em;
- margin-bottom: 0.0em;
- margin-left: 0.0em;
-}
-
-UL LI {
- margin-top: 0.0em;
- margin-bottom: 0.0em;
- margin-left: 0.0em;
-}
-
-OL LI DIV P {
- list-style-type: decimal;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
-}
-
-UL LI DIV P {
- list-style-type: disc;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
-}
-
-* [compact="yes"]>li {
- margin-top: 0 em;
-}
-
-* [compact="no"]>li {
- margin-top: 0.5em;
-}
-
-hr {
- margin-bottom: 0em;
- margin-top: 0em;
- padding-top: 0em;
- padding-bottom: 0em;
- width: 90%;
- color: #cccccc;
- text-align: center;
-}
-
-H1,.title,.pagetitle,.topictitle1 {
- font-size: 1.5em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.5em;
- word-spacing: 0.1em;
-}
-
-H2,.subtitle,.pagesubtitle,.topictitle2 {
- font-size: 1.25em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.0em;
- padding-bottom: 0.0em;
-}
-
-H3,.boldtitle,.topictitle3 {
- font-size: 1.0em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.2em;
- padding-bottom: 0.1em;
-}
-
-H4,.topictitle4 {
- font-size: 0.9em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0.1em;
- padding-bottom: 0.1em;
-}
-
-h5,.topictitle5 {
- font-size: 0.8em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0em;
- padding-bottom: 0em;
-}
-
-h6,.topictitle6 {
- font-size: 0.7em;
- font-style: normal;
- font-weight: bold;
- margin-bottom: 0em;
- padding-bottom: 0em;
-}
-
-div.headtitle {
- font-size: 1em;
- font-weight: bold;
- margin-left: 0em;
-}
-
-div.head0 {
- font-size: 0.9em;
- font-weight: bold;
- margin-left: 0em;
- margin-top: 0.5em;
-}
-
-div.head1 {
- font-size: 0.8em;
- font-weight: bold;
- margin-left: 1em;
- padding-top: 0.5em;
-}
-
-div.head2 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 2em;
-}
-
-div.head3 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 3em;
-}
-
-div.head4 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 4em;
-}
-
-div.head5 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 5em;
-}
-
-div.head6 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 6em;
-}
-
-div.head7 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 7em;
-}
-
-div.head8 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 8em;
-}
-
-div.head9 {
- font-size: 0.7em;
- font-weight: normal;
- margin-left: 9em;
-}
-
-.tip {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.tiptitle {
- font-weight: bold;
-}
-
-.firstcol {
- font-weight: bold;
-}
-
-.ptocH1 {
- font-size: x-small;
-}
-
-.ptocH2 {
- font-size: x-small;
-}
-
-.stitle {
- font-style: italic;
- text-decoration: underline;
-}
-
-.nte {
-
-}
-
-.xxlines {
- white-space: pre;
- font-size: 0.95em;
-}
-
-.sectiontitle {
- margin-top: 1em;
- margin-bottom: 0em;
- color: black;
- font-size: 1.2em;
- font-weight: bold;
-}
-
-div.imageleft {
- text-align: left;
-}
-
-div.imagecenter {
- text-align: center;
-}
-
-div.imageright {
- text-align: right;
-}
-
-div.imagejustify {
- text-align: justify;
-}
-
-div.mmobj {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: center;
-}
-
-div.mmobjleft {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: left;
-}
-
-div.mmobjcenter {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: center;
-}
-
-div.mmobjright {
- margin-top: 1em;
- margin-bottom: 1em;
- text-align: right;
-}
-
-pre.screen {
- padding: 1em 1em 1em 1em;
- margin-top: 0.4em;
- margin-bottom: 0.4em;
- border: thin solid Black;
- font-size: 100%;
-}
-
-.prereq {
- margin-left: 1.5em;
-}
-
-.defListHead {
- font-weight: bold;
- text-decoration: underline;
-}
-
-span.mv {
- font-style: italic;
-}
-
-span.md {
- text-decoration: line-through;
-}
-
-.pk,span.pk {
- font-weight: bold;
-}
-
-span.pkdef {
- font-weight: bold;
- text-decoration: underline;
-}
-
-span.pv {
- font-style: italic;
-}
-
-span.pvdef {
- font-style: italic;
- text-decoration: underline;
-}
-
-span.kwd {
- font-weight: bold;
-}
-
-span.kdwdef {
- font-weight: bold;
- text-decoration: underline;
-}
-
-.parmListKwd {
- font-weight: bold;
-}
-
-.parmListVar {
- font-style: italic;
-}
-
-span.oper {
- font-style: normal;
-}
-
-span.operdef {
- text-decoration: underline;
-}
-
-VAR,span.var {
- font-style: italic;
-}
-
-span.vardef {
- font-style: italic;
- text-decoration: underline;
-}
-
-div.msg {
- padding: 0.2em 1em 1em 1em;
- margin-top: 0.4em;
- margin-bottom: 0.4em;
-}
-
-div.msgnum {
- float: left;
- font-weight: bold;
- margin-bottom: 1em;
- margin-right: 1em;
-}
-
-div.msgtext {
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-div.msgitemtitle {
- font-weight: bold;
-}
-
-p.msgitem {
- margin-top: 0em;
-}
-
-.attention,div.attention {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.attentiontitle,span.attentiontitle {
- font-weight: bold;
-}
-
-.cautiontitle,div.cautiontitle {
- margin-top: 1em;
- font-weight: bold;
-}
-
-.caution,div.caution {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.danger,div.danger {
- padding: 0.5em 0.5em 0.5em 0.5em;
- border: solid;
- border-width: thin;
- font-weight: bold;
- margin-top: 0.2em;
- margin-bottom: 1em;
-}
-
-.dangertitle,div.dangertitle {
- margin-top: 1em;
- font-weight: bold;
-}
-
-.important {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.importanttitle {
- font-weight: bold;
-}
-
-.remember {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.remembertitle {
- font-weight: bold;
-}
-
-.restriction {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.restrictiontitle {
- font-weight: bold;
-}
-
-div.warningtitle {
- font-weight: bold;
-}
-
-div.warningbody {
- margin-left: 2em
-}
-
-.note {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.notetitle,div.notetitle {
- font-weight: bold;
-}
-
-div.notebody {
- margin-left: 2em;
-}
-
-div.notelisttitle {
- font-weight: bold;
-}
-
-div.fnnum {
- float: left;
-}
-
-div.fntext {
- margin-left: 2em;
-}
-
-div.stepl {
- margin-left: 2em;
-}
-
-div.steplnum {
- font-weight: bold;
- float: left;
- margin-left: 0.5em;
-}
-
-div.stepltext {
- margin-left: 5em;
-}
-
-div.steplnum {
- font-style: italic;
- font-weight: bold;
- float: left;
- margin-left: 0.5em;
-}
-
-div.stepltext {
- margin-bottom: 0.5em;
- margin-left: 3em;
-}
-
-div.ledi {
- margin-left: 3em;
-}
-
-div.ledesc {
- margin-left: 3em;
-}
-
-span.pblktitle {
- font-weight: bold;
-}
-
-div.pblklblbox {
- padding: 0.5em 0.5em 0.5em 0.5em;
- border: solid;
- border-width: thin;
- margin-top: 0.2em;
-}
-
-span.ednoticestitle {
- font-weight: bold;
-}
-
-span.term {
- font-weight: bold;
-}
-
-span.idxshow {
- color: green;
-}
-
-div.code {
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-span.refkey {
- font-weight: bold;
- color: white;
- background-color: black;
-}
-
-tt.apl {
- font-style: italic;
-}
-
-div.qualifstart {
- padding: 0.1em 0.5em 0.5em 0.5em;
- border-top: solid;
- border-left: solid;
- border-right: solid;
- border-width: thin;
- font-weight: bold;
- margin-top: 0.2em;
- margin-bottom: 0.2em;
- text-align: center;
-}
-
-div.qualifend {
- padding: 0.5em 0.5em 0.1em 0.5em;
- border-bottom: solid;
- border-left: solid;
- border-right: solid;
- border-width: thin;
- font-weight: bold;
- margin-bottom: 0.2em;
- text-align: center;
-}
-
-.noshade {
- background-color: transparent;
-}
-
-.xlight {
- background-color: #DADADA;
-}
-
-.light {
- background-color: #B0B0B0;
-}
-
-.medium {
- background-color: #8C8C8C;
-}
-
-.dark {
- background-color: #6E6E6E;
-}
-
-.xdark {
- background-color: #585858;
-}
-
-.light-yellow {
- background-color: #FFFFCC;
-}
-
-.khaki {
- background-color: #CCCC99;
-}
-
-.medium-blue {
- background-color: #6699CC;
-}
-
-.light-blue {
- background-color: #CCCCFF;
-}
-
-.mid-grey {
- background-color: #CCCCCC;
-}
-
-.light-grey {
- background-color: #DADADA;
-}
-
-.lightest-grey {
- background-color: #E6E6E6;
-}
-
-#changed {
- position: absolute;
- left: 0.2em;
- color: #7B68EE;
- background-color: #FFFFFF;
- font-style: normal;
- font-weight: bold;
-}
-
-INPUT.buttons {
- font-size: 0.75em;
- border-top: 0.2em outset #B1B1B1;
- border-right: 0.2em outset #000000;
- border-bottom: 0.2em outset #000000;
- border-left: 0.2em outset #B1B1B1;
- background-color: #E2E2E2;
- margin-bottom: 0.2em;
-}
-
-.cgraphic {
- font-size: 90%;
- color: black;
-}
-
-.aix,.hpux,.sun,.unix,.win2,.winnt,.win,.zos,.linux,.os390,.os400,.c,.cplusplus,.cobol,.fortran,.java,.macosx,.os2,.pl1,.rpg
- {
- background-repeat: no-repeat;
- background-position: top left;
- margin-top: 0.5em;
- text-indent: 55px;
-}
-
-.aix {
- background-image: url(ngaix.gif);
-}
-
-.hpux {
- background-image: url(nghpux.gif);
-}
-
-.sun {
- background-image: url(ngsolaris.gif);
-}
-
-.unix {
- background-image: url(ngunix.gif);
-}
-
-.win2 {
- background-image: url(ng2000.gif);
-}
-
-.winxp {
- background-image: url(ngxp.gif);
-}
-
-.winnt {
- background-image: url(ngnt.gif);
-}
-
-.win {
- background-image: url(ngwin.gif);
-}
-
-.zos {
- background-image: url(ngzos.gif);
-}
-
-.linux {
- background-image: url(nglinux.gif);
-}
-
-.os390 {
- background-image: url(ng390.gif);
-}
-
-.os400 {
- background-image: url(ng400.gif);
-}
-
-.c {
- background-image: url(ngc.gif);
-}
-
-.cplusplus {
- background-image: url(ngcpp.gif);
-}
-
-.cobol {
- background-image: url(ngcobol.gif);
-}
-
-.fortran {
- background-image: url(ngfortran.gif);
-}
-
-.java {
- background-image: url(ngjava.gif);
-}
-
-.macosx {
- background-image: url(ngmacosx.gif);
-}
-
-.os2 {
- background-image: url(ngos2.gif);
-}
-
-.pl1 {
- background-image: url(ngpl1.gif);
-}
-
-.rpg {
- background-image: url(ngrpg.gif);
-} \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/commonrtl.css b/docs/org.eclipse.wst.doc.user/commonrtl.css
deleted file mode 100644
index 2350b01fc2..0000000000
--- a/docs/org.eclipse.wst.doc.user/commonrtl.css
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- | (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved.
- */
-
-.unresolved { background-color: skyblue; }
-.noTemplate { background-color: yellow; }
-
-.base { background-color: #ffffff; }
-
-/* Add space for top level topics */
-.nested0 { margin-top : 1em;}
-
-/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
-.p {margin-top: 1em}
-
-/* Default of italics to set apart figure captions */
-.figcap { font-style: italic }
-.figdesc { font-style: normal }
-
-/* Use @frame to create frames on figures */
-.figborder { border-style: solid; padding-left : 3px; border-width : 2px; padding-right : 3px; margin-top: 1em; border-color : Silver;}
-.figsides { border-left : 2px solid; padding-left : 3px; border-right : 2px solid; padding-right : 3px; margin-top: 1em; border-color : Silver;}
-.figtop { border-top : 2px solid; margin-top: 1em; border-color : Silver;}
-.figbottom { border-bottom : 2px solid; border-color : Silver;}
-.figtopbot { border-top : 2px solid; border-bottom : 2px solid; margin-top: 1em; border-color : Silver;}
-
-/* Most link groups are created with <div>. Ensure they have space before and after. */
-.ullinks { list-style-type: none }
-.ulchildlink { margin-top: 1em; margin-bottom: 1em }
-.olchildlink { margin-top: 1em; margin-bottom: 1em }
-.linklist { margin-top: 1em; margin-bottom: 1em }
-.linklistwithchild { margin-top: 1em; margin-right: 1.5em; margin-bottom: 1em }
-.sublinklist { margin-top: 1em; margin-right: 1.5em; margin-bottom: 1em }
-.relconcepts { margin-top: 1em; margin-bottom: 1em }
-.reltasks { margin-top: 1em; margin-bottom: 1em }
-.relref { margin-top: 1em; margin-bottom: 1em }
-.relinfo { margin-top: 1em; margin-bottom: 1em }
-.breadcrumb { font-size : smaller; margin-bottom: 1em }
-.prereq { margin-right : 20px;}
-
-/* Set heading sizes, getting smaller for deeper nesting */
-.topictitle1 { margin-top: 0pc; margin-bottom: .1em; font-size: 1.34em; }
-.topictitle2 { margin-top: 1pc; margin-bottom: .45em; font-size: 1.17em; }
-.topictitle3 { margin-top: 1pc; margin-bottom: .17em; font-size: 1.17em; font-weight: bold; }
-.topictitle4 { margin-top: .83em; font-size: 1.17em; font-weight: bold; }
-.topictitle5 { font-size: 1.17em; font-weight: bold; }
-.topictitle6 { font-size: 1.17em; font-style: italic; }
-.sectiontitle { margin-top: 1em; margin-bottom: 0em; color: black; font-size: 1.17em; font-weight: bold;}
-.section { margin-top: 1em; margin-bottom: 1em }
-.example { margin-top: 1em; margin-bottom: 1em }
-
-/* All note formats have the same default presentation */
-.note { margin-top: 1em; margin-bottom : 1em;}
-.notetitle { font-weight: bold }
-.notelisttitle { font-weight: bold }
-.tip { margin-top: 1em; margin-bottom : 1em;}
-.tiptitle { font-weight: bold }
-.fastpath { margin-top: 1em; margin-bottom : 1em;}
-.fastpathtitle { font-weight: bold }
-.important { margin-top: 1em; margin-bottom : 1em;}
-.importanttitle { font-weight: bold }
-.remember { margin-top: 1em; margin-bottom : 1em;}
-.remembertitle { font-weight: bold }
-.restriction { margin-top: 1em; margin-bottom : 1em;}
-.restrictiontitle { font-weight: bold }
-.attention { margin-top: 1em; margin-bottom : 1em;}
-.attentiontitle { font-weight: bold }
-.dangertitle { font-weight: bold }
-.danger { margin-top: 1em; margin-bottom : 1em;}
-.cautiontitle { font-weight: bold }
-.caution { font-weight: bold; margin-bottom : 1em; }
-
-/* Simple lists do not get a bullet */
-ul.simple { list-style-type: none }
-
-/* Used on the first column of a table, when rowheader="firstcol" is used */
-.firstcol { font-weight : bold;}
-
-/* Various basic phrase styles */
-.bold { font-weight: bold; }
-.boldItalic { font-weight: bold; font-style: italic; }
-.italic { font-style: italic; }
-.underlined { text-decoration: underline; }
-.uicontrol { font-weight: bold; }
-.parmname { font-weight: bold; }
-.kwd { font-weight: bold; }
-.defkwd { font-weight: bold; text-decoration: underline; }
-.var { font-style : italic;}
-.shortcut { text-decoration: underline; }
-
-/* Default of bold for definition list terms */
-.dlterm { font-weight: bold; }
-
-/* Use CSS to expand lists with @compact="no" */
-.dltermexpand { font-weight: bold; margin-top: 1em; }
-*[compact="yes"]>li { margin-top: 0em;}
-*[compact="no"]>li { margin-top: .53em;}
-.liexpand { margin-top: 1em; margin-bottom: 1em }
-.sliexpand { margin-top: 1em; margin-bottom: 1em }
-.dlexpand { margin-top: 1em; margin-bottom: 1em }
-.ddexpand { margin-top: 1em; margin-bottom: 1em }
-.stepexpand { margin-top: 1em; margin-bottom: 1em }
-.substepexpand { margin-top: 1em; margin-bottom: 1em }
-
-/* Align images based on @align on topic/image */
-div.imageleft { text-align: left }
-div.imagecenter { text-align: center }
-div.imageright { text-align: right }
-div.imagejustify { text-align: justify }
-
-pre.screen { padding: 5px 5px 5px 5px; border: outset; background-color: #CCCCCC; margin-top: 2px; margin-bottom : 2px; white-space: pre}
-
-
diff --git a/docs/org.eclipse.wst.doc.user/images/SelectExistingServer.jpg b/docs/org.eclipse.wst.doc.user/images/SelectExistingServer.jpg
deleted file mode 100644
index 398dbe4b1b..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/SelectExistingServer.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/SelectNewServer.jpg b/docs/org.eclipse.wst.doc.user/images/SelectNewServer.jpg
deleted file mode 100644
index 95f6b44a90..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/SelectNewServer.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure1.jpg b/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure1.jpg
deleted file mode 100644
index 9064bb8fa9..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure1.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure2.jpg b/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure2.jpg
deleted file mode 100644
index eca4347bbf..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure2.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure3.jpg b/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure3.jpg
deleted file mode 100644
index 5d87d0cc8f..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure3.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure4.jpg b/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure4.jpg
deleted file mode 100644
index c334bbfdde..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure4.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure5.jpg b/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure5.jpg
deleted file mode 100644
index a94614ea39..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/XMLCatalog-Figure5.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/image99L.jpg b/docs/org.eclipse.wst.doc.user/images/image99L.jpg
deleted file mode 100644
index 506abdb128..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/image99L.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/imageEJ9.jpg b/docs/org.eclipse.wst.doc.user/images/imageEJ9.jpg
deleted file mode 100644
index be7350eb39..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/imageEJ9.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/imageIAI.jpg b/docs/org.eclipse.wst.doc.user/images/imageIAI.jpg
deleted file mode 100644
index d2f625c121..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/imageIAI.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/imageLKF.jpg b/docs/org.eclipse.wst.doc.user/images/imageLKF.jpg
deleted file mode 100644
index ff98f424ce..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/imageLKF.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/imageO78.jpg b/docs/org.eclipse.wst.doc.user/images/imageO78.jpg
deleted file mode 100644
index 67077f8434..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/imageO78.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/imageU71.jpg b/docs/org.eclipse.wst.doc.user/images/imageU71.jpg
deleted file mode 100644
index 9ee0430709..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/imageU71.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/note.gif b/docs/org.eclipse.wst.doc.user/images/note.gif
deleted file mode 100644
index f6260dbc72..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/note.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/selectRootElementDTD.png b/docs/org.eclipse.wst.doc.user/images/selectRootElementDTD.png
deleted file mode 100644
index 25f260f36a..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/selectRootElementDTD.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/selectRootElementXSD.png b/docs/org.eclipse.wst.doc.user/images/selectRootElementXSD.png
deleted file mode 100644
index 9955ed3050..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/selectRootElementXSD.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdl.gif b/docs/org.eclipse.wst.doc.user/images/wsdl.gif
deleted file mode 100644
index 8fb844f5b3..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdl.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdl_main.gif b/docs/org.eclipse.wst.doc.user/images/wsdl_main.gif
deleted file mode 100644
index 9f074e8a10..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdl_main.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-backbutton.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-backbutton.jpg
deleted file mode 100644
index ebcd1c7629..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-backbutton.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-binding.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-binding.jpg
deleted file mode 100644
index be74d5702a..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-binding.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-complex-type.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-complex-type.jpg
deleted file mode 100644
index 15d6071292..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-complex-type.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-finished-wsdl.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-finished-wsdl.jpg
deleted file mode 100644
index 9c56342415..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-finished-wsdl.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-operation.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-operation.jpg
deleted file mode 100644
index 8dc34a301d..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-operation.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-skeleton.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-skeleton.jpg
deleted file mode 100644
index 57ddb29309..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-skeleton.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-wizard.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-wizard.jpg
deleted file mode 100644
index 50553f6408..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-new-wizard.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-setelement-dialog.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-setelement-dialog.jpg
deleted file mode 100644
index f48165e9f6..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-setelement-dialog.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-settype-dialog.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-settype-dialog.jpg
deleted file mode 100644
index 8a36a66b40..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-settype-dialog.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/wsdleditor-smart-rename1.jpg b/docs/org.eclipse.wst.doc.user/images/wsdleditor-smart-rename1.jpg
deleted file mode 100644
index cc68a44456..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/wsdleditor-smart-rename1.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-backbutton.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-backbutton.jpg
deleted file mode 100644
index 20926057ff..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-backbutton.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure1.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure1.jpg
deleted file mode 100644
index f3b4f6f28b..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure1.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure2.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure2.jpg
deleted file mode 100644
index 518c6063aa..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure2.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure3.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure3.jpg
deleted file mode 100644
index a66b6e794c..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure3.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure4.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure4.jpg
deleted file mode 100644
index 2a187da984..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure4.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure5.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure5.jpg
deleted file mode 100644
index b9622efc4a..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure5.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure6.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure6.jpg
deleted file mode 100644
index 6e253b820c..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure6.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure7.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure7.jpg
deleted file mode 100644
index dfb7523c7c..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure7.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure8.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure8.jpg
deleted file mode 100644
index ef617721a8..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure8.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure9.jpg b/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure9.jpg
deleted file mode 100644
index 664eeccffa..0000000000
--- a/docs/org.eclipse.wst.doc.user/images/xsdeditor-figure9.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.doc.user/notices.html b/docs/org.eclipse.wst.doc.user/notices.html
deleted file mode 100644
index 58b60690af..0000000000
--- a/docs/org.eclipse.wst.doc.user/notices.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<LINK REL="STYLESHEET" HREF="book.css" CHARSET="ISO-8859-1"
- TYPE="text/css">
-<title>Legal Notices</title>
-</head>
-<body>
-
-<h3><a NAME="Notices"></a>Notices</h3>
-<p>The material in this guide is Copyright (c) IBM Corporation and
-others 2000, 2007.</p>
-<p><a href="about.html">Terms and conditions regarding the use of this
-guide.</a></p>
-</body>
-</html>
diff --git a/docs/org.eclipse.wst.doc.user/plugin.properties b/docs/org.eclipse.wst.doc.user/plugin.properties
deleted file mode 100644
index 6163b89f3b..0000000000
--- a/docs/org.eclipse.wst.doc.user/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Master User Doc TOC
-providerName = Eclipse.org
diff --git a/docs/org.eclipse.wst.doc.user/plugin.xml b/docs/org.eclipse.wst.doc.user/plugin.xml
deleted file mode 100644
index 4e48f3416e..0000000000
--- a/docs/org.eclipse.wst.doc.user/plugin.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension point="org.eclipse.help.toc">
- <toc file="toc.xml" primary="true" />
- </extension>
- <extension point="org.eclipse.help.toc">
- <toc file="reference_toc.xml"/>
- </extension>
-</plugin>
diff --git a/docs/org.eclipse.wst.doc.user/reference_toc.xml b/docs/org.eclipse.wst.doc.user/reference_toc.xml
deleted file mode 100644
index 9d4b7267e8..0000000000
--- a/docs/org.eclipse.wst.doc.user/reference_toc.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ============================================================================= -->
-<!-- Define the top level topics -->
-<!-- ============================================================================= -->
-<toc label="Web Tools Platform reference information">
- <anchor id="command_reference"/>
- <anchor id="UI_reference"/>
- <anchor id="javadoc_common"/>
- <anchor id="javadoc_ejbtools"/>
- <anchor id="javadoc_jeetools"/>
- <anchor id="javadoc_servertools"/>
- <anchor id="javadoc_sourceediting"/>
- <anchor id="javadoc_xml"/>
- <anchor id="javadoc_webservices"/>
-</toc> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/toc.xml b/docs/org.eclipse.wst.doc.user/toc.xml
deleted file mode 100644
index 944270cc30..0000000000
--- a/docs/org.eclipse.wst.doc.user/toc.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ============================================================================= -->
-<!-- Define the top level topics -->
-<!-- ============================================================================= -->
-<toc label="Web Tools Platform User Guide"
- topic="topics/overview.html">
-
- <topic label="Creating Web applications">
- <link
- toc="../org.eclipse.wst.webtools.doc.user/webtools_toc.xml" />
- </topic>
- <topic label="Creating Java EE and enterprise applications">
- <link toc="../org.eclipse.jst.j2ee.doc.user/jst_j2ee_toc.xml" />
- <link toc="../org.eclipse.jst.ejb.doc.user/ejb_toc.xml" />
- </topic>
- <topic label="Editing markup language files"
- href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html">
- <link toc="../org.eclipse.wst.sse.doc.user/sse_toc.xml" />
- <link
- toc="../org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml" />
- <link
- toc="../org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml" />
- <link
- toc="../org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.xml" />
- </topic>
- <!-- <link toc="../org.eclipse.wst.xml.doc.user/xml_toc.xml"/>-->
- <topic label="Developing Web service applications">
- <link toc="../org.eclipse.jst.ws.doc.user/webservice_toc.xml" />
- </topic>
- <topic label="Using the server tools">
- <link toc="../org.eclipse.wst.server.ui.doc.user/wtp_main_toc.xml" />
- </topic>
- <topic label="Reference">
- <link toc="reference_toc.xml" />
- </topic>
- <topic label="Limitations and Known Issues" href="topics/limitations.html" />
- <topic label="Legal" href="notices.html" />
-</toc> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/topics/limitations.html b/docs/org.eclipse.wst.doc.user/topics/limitations.html
deleted file mode 100644
index f890bd785d..0000000000
--- a/docs/org.eclipse.wst.doc.user/topics/limitations.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css"
- href="../../org.eclipse.wst.doc.user/common.css" >
-<title>Web Tools Platform Limitations and Known Issues</title>
-</head>
-<body>
-<h1>Web Tools Platform Limitations and Known Issues</h1>
-<p>The following are limitations and known issues:</p>
-<dl>
-<dt class="dlterm"><b>When using XDoclet the generation does not appear to run.</b></dt>
-<dd><p>Cause: XDoclet has some limitations with long path names.</p>
-<p>Solution: You should install Eclipse and the Web Tools Platform into a directory with a short
-path.</p>
-</dd>
-<dt class="dlterm"><b>When creating a Web service you may see a message similar to the following one:</b></dt>
-<dd><p><samp>org.apache.axis.utils.JavaUtils isAttachmentSupported
-WARNING: Unable to find required classes (javax.activation.DataHandler and
-javax.mail.internet.MimeMultipart). Attachment support is disabled.
-</samp></p>
-<p>Cause: Attachment support is disabled.</p>
-<p>Solution: The Apache Axis tools should auto-detect the javax.activation classes provided you add
-<samp>activation.jar</samp> to the build path of the project to which you are generating your Web service or client.
-For services, you will also need to make sure <samp>activation.jar</samp> is available to the Tomcat JRE, either by
-including it in the server's global classpath or by placing a copy of activation.jar into the target Web
-project's <samp>lib/</samp> directory.
-</p>
-</dd>
-<dt class="dlterm"><b>Problems encountered publishing from dynamic Web projects with non-ASCII characters in the context root</b></dt>
-<dd>
-<p>Cause: By default the context root of a dynamic Web project uses the project name. If non-ASCII characters are used as project names for dynamic Web projects,
-the default context root causes problems when trying to publish from the Web project.</p>
-<p>You may encounter the following errors if this occurs:
-<ul>
-<li>If you create a dynamic Web project with non-ASCII characters (leaving the context root
-to default to the project name containing non ASCII characters) and try to
-publish, you will see an error message similar to "The requested resource is not available".</li>
-<li>If a dynamic Web project containing a non-ASCII context root is used in an Axis1 Web service creation
-scenario, you will see an error message similar to "Unable to deploy to Axis".</li>
-</ul>
-<p>Solution: The following ASCII characters are valid in the context root: all letters, all numbers, an underscore, a hyphen (dash), a forward slash, or a period.</p>
-</dd>
-</dl>
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/topics/overview.html b/docs/org.eclipse.wst.doc.user/topics/overview.html
deleted file mode 100644
index eab51be9c5..0000000000
--- a/docs/org.eclipse.wst.doc.user/topics/overview.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css"
- href="../../org.eclipse.wst.doc.user/common.css" >
-<title>Web Tools Project Overview</title>
-</head>
-<body>
-<h1>Web Tools Project Overview</h1>
-<p>The Web Tools Project aims to provide common infrastructure available
-to any Eclipse-based development environment targeting Web-enabled
-applications.</p>
-</body>
-</html>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/.cvsignore b/docs/org.eclipse.wst.dtd.ui.infopop/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/.project b/docs/org.eclipse.wst.dtd.ui.infopop/.project
deleted file mode 100644
index df2f69dc2c..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtd.ui.infopop</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.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/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.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/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
deleted file mode 100644
index ef66ce48e8..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-
-<!-- plugin: org.eclipse.wst.dtd.ui -->
-
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="webx0020"><!-- dtd files preference page -->
- <description>
- This page lets you choose which suffix (<b>dtd</b>, <b>ent</b>, or <b>mod</b>) is added when a new DTD file is created.
- </description>
- </context>
- <context id="webx0021"><!-- dtd styles preference page -->
- <description>
- This page lets you customize the syntax highlighting that the document type definition (DTD) editor does when you are editing a file.
-
- The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
-
- The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that allow you to specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
-
- Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.
- </description>
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html"
- label="Setting source highlighting styles" />
- </context>
- <context id="webx0022"><!-- dtd template preference page -->
- <description>
- Templates are a chunk of predefined code that you can insert into a DTD file when it is created.
-
- Click <b>New</b> if you want to create a completely new template.
-
- Supply a new template <b>Name</b> and <b>Description</b>. The <b>Context</b> for the template is the context in which the template is available in the proposal list when content assist is requested. Specify the <b>Pattern</b> for your template using the appropriate tags, attributes, or attribute values to be inserted by content assist.
-
- If you want to insert a variable, click the <b>Insert Variable</b> button and select the variable to be inserted. For example, the <b>date</b> variable indicates the current date will be inserted.
-
- You can edit, remove, import, or export a template by using the same Preferences page.
-
- If you have a template that you do not want to remove but you no longer want it to appear in the content assist list, clear its check box in the <b>Templates</b> preferences page.
- </description>
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html"
- label="Working with DTD templates" />
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html"
- label="Creating DTD files" />
- </context>
- <context id=""><!-- create dtd page 1 has no id atm -->
- <description>
- In the <b>File name</b> field, type the name of the DTD. The name of your DTD file must end with the extension .dtd
- </description>
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html"
- label="" />
- </context>
- <context id="dtdw0010"><!-- dtd new file wizard page 2, page 1 has no ID -->
- <description>
- Click the <b>Use DTD Template</b> check box if you want to use a DTD template as the initial content in your new DTD page. A list of available DTD templates is listed - select the one you want to use. A preview of your DTD file is shown once you select a DTD template.
- </description>
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html"
- label="Working with DTD templates" />
- <topic
- href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html"
- label="Creating DTD files" />
- </context>
-</contexts>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml
deleted file mode 100644
index 3a44d26b3e..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-
-<contexts>
-<context id="csh_outer_container">
-<description/>
-</context>
-<context id="dtdsource_source_HelpId">
-<description>The DTD editor lets you edit a document type definition.
-
-The editor provides text editing features such as syntax highlighting and unlimited undo and redo.
-</description>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index 4353682e07..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtd.ui.infopop; singleton:=true
-Bundle-Version: 1.0.400.qualifier
-Bundle-Vendor: %pluginProvider
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/about.html b/docs/org.eclipse.wst.dtd.ui.infopop/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/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/docs/org.eclipse.wst.dtd.ui.infopop/build.properties b/docs/org.eclipse.wst.dtd.ui.infopop/build.properties
deleted file mode 100644
index 7e8b37aa98..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = plugin.xml,\
- plugin.properties,\
- about.html,\
- EditorDtdContexts.xml,\
- META-INF/,\
- EditorDtdContexts2.xml
-generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties b/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties
deleted file mode 100644
index 6d094d741f..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-
-pluginName = DTD Editor infopops
-pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.xml b/docs/org.eclipse.wst.dtd.ui.infopop/plugin.xml
deleted file mode 100644
index aa57fbcde2..0000000000
--- a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
- <contexts file="EditorDtdContexts.xml" plugin ="org.eclipse.wst.dtd.ui"/>
- <contexts file="EditorDtdContexts2.xml" plugin ="org.eclipse.wst.dtd.core"/>
-</extension>
-
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/.cvsignore b/docs/org.eclipse.wst.dtdeditor.doc.user/.cvsignore
deleted file mode 100644
index 180fc9b54f..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-build.xml
-org.eclipse.wst.dtdeditor.doc.user_1.0.0.jar
-temp \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/.project b/docs/org.eclipse.wst.dtdeditor.doc.user/.project
deleted file mode 100644
index 4486d7a271..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtdeditor.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.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/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.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/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap
deleted file mode 100644
index 88a77eebfa..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map collection-type="sequence" id="dtdeditorTOC" title="DTD Editor">
-<topicref href="topics/cworkdtds.dita" navtitle="Working with DTDs" type="concept">
-<anchor id="dtd_post_cworkdtds"/>
-<topicref href="topics/tcretdtd.dita" linking="normal" navtitle="Creating DTDs"
-type="task">
-<anchor id="dtd_post_tcretdtd"/>
-<topicref href="topics/cdtdover.dita" linking="sourceonly" navtitle="Document type definition - Overview"
-type="concept"></topicref>
-<anchor id="dtd_post_cdtdover"/>
-<topicref href="topics/tedtsrcst.dita" linking="sourceonly" navtitle="Setting source highlighting styles"
-type="task"></topicref>
-<anchor id="dtd_post_ctedtsrcst"/>
-<topicref href="topics/tdtemplt.dita" linking="sourceonly" navtitle="Working with DTD templates"
-type="task"></topicref>
-<anchor id="dtd_post_tdtemplt"/></topicref>
-<topicref href="topics/timptdtd.dita" navtitle="Importing DTDs" type="task">
-</topicref>
-<anchor id="dtd_post_timptdtd"/>
-<topicref href="topics/tvaldtd.dita" navtitle="Validating DTDs" type="task">
-</topicref>
-<anchor id="dtd_post_tvaldtd"/>
-<topicref href="topics/rdtdicons.dita" navtitle="Icons used in the DTD editor"
-type="reference"></topicref>
-<anchor id="dtd_post_rdtdicons"/>
-<topicref href="topics/rdtdkey.dita" navtitle="DTD editor keyboard shortcuts"
-type="reference"></topicref>
-<anchor id="dtd_post_rdtdkey"/></topicref>
-</map>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
deleted file mode 100644
index 105d9883de..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="DTD Editor" topic="topics/cworkdtds.html">
-<topic label="Working with DTDs" href="topics/cworkdtds.html">
-<anchor id="dtd_post_cworkdtds"/>
-<topic label="Creating DTDs" href="topics/tcretdtd.html">
-<anchor id="dtd_post_tcretdtd"/>
-<topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
-<anchor id="dtd_post_cdtdover"/>
-<topic label="Setting source highlighting styles" href="topics/tedtsrcst.html"/>
-<anchor id="dtd_post_ctedtsrcst"/>
-<topic label="Working with DTD templates" href="topics/tdtemplt.html"/>
-<anchor id="dtd_post_tdtemplt"/>
-</topic>
-<topic label="Importing DTDs" href="topics/timptdtd.html"/>
-<anchor id="dtd_post_timptdtd"/>
-<topic label="Validating DTDs" href="topics/tvaldtd.html"/>
-<anchor id="dtd_post_tvaldtd"/>
-<topic label="Icons used in the DTD editor" href="topics/rdtdicons.html"/>
-<anchor id="dtd_post_rdtdicons"/>
-<topic label="DTD editor keyboard shortcuts" href="topics/rdtdkey.html"/>
-<anchor id="dtd_post_rdtdkey"/>
-</topic>
-</toc>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.ditamap b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.ditamap
deleted file mode 100644
index f05b032f4f..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.ditamap
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
-<map>
-<topicgroup collection-type="family">
-<topicref href="topics/tcretdtd.dita" linking="normal" navtitle="Creating a new DTD"
-type="task"></topicref>
-<topicref href="topics/cdtdover.dita" linking="targetonly" navtitle="Document type definition - Overview"
-type="concept"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/cdtdover.dita" navtitle="Document type definition - Overview"
-type="concept"></topicref>
-<topicref href="topics/tvaldtd.dita" linking="targetonly" navtitle="Validating DTDs"
-type="task"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tcretdtd.dita" linking="normal" navtitle="Creating a new DTD"
-type="task"></topicref>
-<topicref href="topics/tdtemplt.dita" navtitle="Working with DTD templates"
-type="task"></topicref>
-</topicgroup>
-</map>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml
deleted file mode 100644
index ebdd30a6ff..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc topic="topics/tcretdtd.html">
-<topic label="Creating DTDs" href="topics/tcretdtd.html"/>
-<topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
-<topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
-<topic label="Validating DTDs" href="topics/tvaldtd.html"/>
-<topic label="Creating DTDs" href="topics/tcretdtd.html"/>
-<topic label="Working with DTD templates" href="topics/tdtemplt.html"/>
-</toc>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml
deleted file mode 100644
index 663d0ebf7d..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
- This script build the Help plug-in by transforming the DITA source files into HTML.
-
- To use this script, you must install DITA-OT on your machine in the directory
- defined by the dita.ot.dir property.
-
- Run the default target after you edit the DITA source files to regenerate the HTML.
-
- To customize this script for other Help plug-ins, modify the value of the args.input property
- to be the DITA map file for the plug-in.
-
- NOTE: This script assumes that links to sibling Help plug-ins have scope="peer", otherwise the
- output directory structure will be shifted incorrectly.
-
- NOTE: This script assumes that you hand code your plugin.xml file in myplugin.xml. This file
- will be copied over the generated plugin.xml which is currently not being generated correctly
- by DITA-OT.
-
- ChangeLog:
- 2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
- - Created.
- 2008-01-09 Kate Price <katep@ca.ibm.com>
- - modified for new DITA-OT version
- 2008-05-05 Kate Price <katep@ca.ibm.com>
- - modified to add generation of pre-built help index.
- - Must delete /index folder before running build
--->
-<project name="eclipsehelp" default="all">
-
- <property name="dita.ot.dir" location="C:/DITA-OT1.2.2" />
-
- <path id="dost.class.path">
- <pathelement location="${dita.ot.dir}${file.separator}lib${file.separator}dost.jar" />
- </path>
-
- <taskdef name="integrate" classname="org.dita.dost.platform.IntegratorTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <target name="all" depends="integrate, eclipsehelp">
- </target>
- <target name="integrate">
- <integrate ditadir="${dita.ot.dir}" />
- </target>
-
- <!-- revise below here -->
- <target name="eclipsehelp">
- <ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
- <property name="args.copycss" value="no" />
- <property name="args.csspath" value="../org.eclipse.wst.doc.user" />
- <property name="args.eclipse.provider" value="Eclipse.org" />
- <property name="args.eclipse.version" value="3.4.0" />
- <property name="args.input" location="DTDreftable.ditamap" />
- <property name="clean.temp" value="true" />
- <property name="dita.extname" value=".dita" />
- <property name="dita.temp.dir" location="temp" />
- <property name="output.dir" location="" />
- <property name="transtype" value="eclipsehelp" />
- </ant>
- <copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
- </target>
- <target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-</project>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index e7ce085a38..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtdeditor.doc.user; singleton:=true
-Bundle-Version: 1.0.700.qualifier
-Bundle-Vendor: %pluginProvider
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/about.html b/docs/org.eclipse.wst.dtdeditor.doc.user/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/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/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties b/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties
deleted file mode 100644
index 69fe355bbd..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-bin.includes = DTDEditormap_toc.xml,\
- about.html,\
- org.eclipse.wst.dtdeditor.doc.userindex.xml,\
- images/,\
- plugin.properties,\
- plugin.xml,\
- topics/*.htm*,\
- index/,\
- META-INF/
-src.includes = *.maplist,\
- *.ditamap,\
- topics/*.dita
-bin.excludes = DocBuild.xml,\
- myPlugin*.xml
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list b/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list
deleted file mode 100644
index 4edd99a8d2..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list
+++ /dev/null
@@ -1,12 +0,0 @@
-#Thu Oct 15 11:36:49 EDT 2009
-user.input.file=DTDreftable.ditamap
-user.input.dir=D\:\\Docs\\WTP3\\org.eclipse.wst.dtdeditor.doc.user
-flagimagelist=
-fullditamaplist=DTDreftable.ditamap
-conreflist=
-hreftargetslist=topics/tdtemplt.dita,topics/tcretdtd.dita,topics/tvaldtd.dita,topics/cdtdover.dita
-fullditatopiclist=topics/tdtemplt.dita,topics/tcretdtd.dita,topics/tvaldtd.dita,topics/cdtdover.dita
-fullditamapandtopiclist=topics/tdtemplt.dita,topics/tcretdtd.dita,DTDreftable.ditamap,topics/tvaldtd.dita,topics/cdtdover.dita
-htmllist=
-imagelist=
-hrefditatopiclist=topics/tvaldtd.dita
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Comment.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Comment.gif
deleted file mode 100644
index 39611d6c63..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Comment.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Element.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity.gif
deleted file mode 100644
index cb415064e0..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity_Reference.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity_Reference.gif
deleted file mode 100644
index 5efa9b905e..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Entity_Reference.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Notation.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Notation.gif
deleted file mode 100644
index 57ad089a69..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/ADD_Notation.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDChoice.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDChoice.gif
deleted file mode 100644
index 89ba825253..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDChoice.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDSequence.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDSequence.gif
deleted file mode 100644
index 8bf3f972d2..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/XSDSequence.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute.gif
deleted file mode 100644
index c6cde94672..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute_list.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute_list.gif
deleted file mode 100644
index 6df029174d..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/attribute_list.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nDTDFile.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/nDTDFile.gif
deleted file mode 100644
index e79914369a..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nDTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nany.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/nany.gif
deleted file mode 100644
index 7017d91b91..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nany.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nempty.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/nempty.gif
deleted file mode 100644
index 119e3d4523..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/nempty.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/organize_dtd_logically.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/organize_dtd_logically.gif
deleted file mode 100644
index 093c6bad04..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/organize_dtd_logically.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/images/sort.gif b/docs/org.eclipse.wst.dtdeditor.doc.user/images/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/images/sort.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs b/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs
deleted file mode 100644
index 2710567227..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable b/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable
deleted file mode 100644
index 593f4708db..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions
deleted file mode 100644
index 4aea31e6d4..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions
+++ /dev/null
@@ -1,3 +0,0 @@
-#This is a generated file; do not edit.
-#Wed Apr 29 18:03:30 EDT 2009
-org.eclipse.wst.dtdeditor.doc.user=org.eclipse.wst.dtdeditor.doc.user\n1.0.400.qualifier
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies
deleted file mode 100644
index fa707bbe3a..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-#This is a generated file; do not edit.
-#Wed Apr 29 18:03:30 EDT 2009
-lucene=1.9.1.v20080530-1600
-analyzer=org.eclipse.help.base\#3.3.101.M20080728_34x?locale\=en
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs
deleted file mode 100644
index 30876b7cef..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs
+++ /dev/null
@@ -1,11 +0,0 @@
-#This is a generated file; do not edit.
-#Wed Apr 29 18:03:30 EDT 2009
-/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html=0
-/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html=0
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments b/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments
deleted file mode 100644
index c84f1b231e..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml
deleted file mode 100644
index 52758531b3..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<plugin>
-
- <extension point="org.eclipse.help.toc">
- <toc file="DTDEditormap_toc.xml"/>
- <index path="index/"/>
- </extension>
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.dtdeditor.doc.userindex.xml"/>
- </extension>
-
-</plugin>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.user.maplist b/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.user.maplist
deleted file mode 100644
index 13cbd726bb..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.user.maplist
+++ /dev/null
@@ -1,9 +0,0 @@
-<maplist version="3.6.2">
- <nav>
- <map file="DTDEditormap_toc.ditamap"/>
- </nav>
- <link>
- <map file="DTDEditormap_toc.ditamap"/>
- <map file="DTDreftable.ditamap"/>
- </link>
-</maplist>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml
deleted file mode 100644
index badab2e322..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<index>
- <entry keyword="DTDs">
- <entry keyword="creating">
- <topic href="topics/tcretdtd.html#tcretdtd" title="Creating DTDs"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cdtdover.html#cdtdover" title="Document type definitions (DTDs) - overview"/>
- </entry>
- <entry keyword="highlighting styles">
- <topic href="topics/tedtsrcst.html#ttaghilt" title="Setting source highlighting styles"/>
- </entry>
- <entry keyword="creating templates">
- <topic href="topics/tdtemplt.html#twmacro" title="Working with DTD templates"/>
- </entry>
- <entry keyword="importing">
- <topic href="topics/timptdtd.html#timptdtd" title="Importing DTDs"/>
- </entry>
- <entry keyword="editor icons">
- <topic href="topics/rdtdicons.html#ricons" title="Icons used in the DTD editor"/>
- </entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="DTD highlighting styles">
- <topic href="topics/tedtsrcst.html#ttaghilt" title="Setting source highlighting styles"/>
- </entry>
- </entry>
- <entry keyword="templates">
- <entry keyword="DTD">
- <topic href="topics/tdtemplt.html#twmacro" title="Working with DTD templates"/>
- </entry>
- </entry>
- <entry keyword="DTD">
- <entry keyword="validating">
- <topic href="topics/tvaldtd.html#tvaldtd" title="Validating DTDs"/>
- </entry>
- </entry>
- <entry keyword="DTD editor">
- <entry keyword="keyboard shortcuts">
- <topic href="topics/rdtdkey.html#keyboardshortcutsinthedtdeditor" title="DTD editor keyboard shortcuts"/>
- </entry>
- </entry>
- <entry keyword="keyboard shortcuts">
- <entry keyword="DTD editor">
- <topic href="topics/rdtdkey.html#keyboardshortcutsinthedtdeditor" title="DTD editor keyboard shortcuts"/>
- </entry>
- </entry>
-</index> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties
deleted file mode 100644
index 74c2058c9a..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# NLS_MESSAGEFORMAT_VAR
-
-pluginName = DTD Editor documentation
-pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml
deleted file mode 100644
index 52758531b3..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<plugin>
-
- <extension point="org.eclipse.help.toc">
- <toc file="DTDEditormap_toc.xml"/>
- <index path="index/"/>
- </extension>
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.dtdeditor.doc.userindex.xml"/>
- </extension>
-
-</plugin>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita
deleted file mode 100644
index 930a99914e..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cdtdover" xml:lang="en-us">
-<title>Document type definitions (DTDs) - overview</title>
-<titlealts>
-<searchtitle>Document type definition (DTD) - overview</searchtitle>
-</titlealts>
-<shortdesc>A document type definition (DTD) provides you with the means to
-validate XML files against a set of rules. When you create a DTD file, you
-can specify rules that control the structure of any XML files that reference
-the DTD file.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>overview</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>A DTD can contain declarations that define elements, attributes, notations,
-and entities for any XML files that reference the DTD file. It also establishes
-constraints for how each element, attribute, notation, and entity can be used
-within any of the XML files that reference the DTD file.</p>
-<p>To be considered a valid XML file, the document must be accompanied by
-a DTD (or an XML schema), and conform to all of the declarations in the DTD
-(or XML schema).</p>
-<p>Certain XML parsers have the ability to read DTDs and check to see if the
-XML file it is reading follows all of those rules. While the parser is reading
-the XML file, it will check each line to be sure that it conforms to the rules
-that are laid out in the DTD file. If there is a problem, the parser generates
-an error and points to where the error occurs in the XML file. This kind of
-parser is called a validating parser because it validates the content of the
-XML file against the DTD.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
deleted file mode 100644
index d89466e585..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Document type definitions (DTDs) - overview" />
-<meta name="abstract" content="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file." />
-<meta name="description" content="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file." />
-<meta content="DTDs, overview" name="DC.subject" />
-<meta content="DTDs, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tvaldtd.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cdtdover" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Document type definition (DTD) - overview</title>
-</head>
-<body id="cdtdover"><a name="cdtdover"><!-- --></a>
-
-
-<h1 class="topictitle1">Document type definitions (DTDs) - overview</h1>
-
-
-
-
-<div><p>A document type definition (DTD) provides you with the means to
-validate XML files against a set of rules. When you create a DTD file, you
-can specify rules that control the structure of any XML files that reference
-the DTD file.</p>
-
-<p>A DTD can contain declarations that define elements, attributes, notations,
-and entities for any XML files that reference the DTD file. It also establishes
-constraints for how each element, attribute, notation, and entity can be used
-within any of the XML files that reference the DTD file.</p>
-
-<p>To be considered a valid XML file, the document must be accompanied by
-a DTD (or an XML schema), and conform to all of the declarations in the DTD
-(or XML schema).</p>
-
-<p>Certain XML parsers have the ability to read DTDs and check to see if the
-XML file it is reading follows all of those rules. While the parser is reading
-the XML file, it will check each line to be sure that it conforms to the rules
-that are laid out in the DTD file. If there is a problem, the parser generates
-an error and points to where the error occurs in the XML file. This kind of
-parser is called a validating parser because it validates the content of the
-XML file against the DTD.</p>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tvaldtd.html" title="Validating a DTD file lets you verify that it is well formed and does not contain any errors.">Validating DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.dita
deleted file mode 100644
index 72850d4eeb..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.dita
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<?Pub Inc?>
-<concept id="workingwithdtds" xml:lang="en-us">
-<title>Working with DTDs</title>
-<shortdesc>This sections contains information on the following:</shortdesc>
-<conbody></conbody>
-</concept>
-<?Pub *0000000395?>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
deleted file mode 100644
index b2478b48bf..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Working with DTDs" />
-<meta name="abstract" content="This sections contains information on the following:" />
-<meta name="description" content="This sections contains information on the following:" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/timptdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tvaldtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rdtdicons.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rdtdkey.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="workingwithdtds" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Working with DTDs</title>
-</head>
-<body id="workingwithdtds"><a name="workingwithdtds"><!-- --></a>
-
-
-<h1 class="topictitle1">Working with DTDs</h1>
-
-
-<div><p>This sections contains information on the following:</p>
-</div>
-
-<div>
-<ul class="ullinks">
-<li class="ulchildlink"><strong><a href="../topics/tcretdtd.html">Creating DTDs</a></strong><br />
-A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file.</li>
-<li class="ulchildlink"><strong><a href="../topics/timptdtd.html">Importing DTDs</a></strong><br />
-If you want to work with DTD files that you created outside of the product, you can import them into the workbench and open them in the DTD editor.</li>
-<li class="ulchildlink"><strong><a href="../topics/tvaldtd.html">Validating DTDs</a></strong><br />
-Validating a DTD file lets you verify that it is well formed and does not contain any errors.</li>
-<li class="ulchildlink"><strong><a href="../topics/rdtdicons.html">Icons used in the DTD editor</a></strong><br />
-These DTD editor icons appear in the Outline view.</li>
-<li class="ulchildlink"><strong><a href="../topics/rdtdkey.html">DTD editor keyboard shortcuts</a></strong><br />
-</li>
-</ul>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita
deleted file mode 100644
index b5a3e19389..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="ricons" xml:lang="en-us">
-<title>Icons used in the DTD editor</title>
-<titlealts>
-<searchtitle>Icons used in the DTD editor</searchtitle>
-</titlealts>
-<shortdesc>These DTD editor icons appear in the Outline view.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>editor icons</indexterm></indexterm></keywords>
-</metadata></prolog>
-<refbody>
-<table>
-<tgroup cols="2"><colspec colname="COLSPEC0"/><colspec colname="COLSPEC1"/>
-<thead>
-<row>
-<entry>Icon&nbsp;</entry>
-<entry>Description</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="COLSPEC0"></entry>
-<entry colname="COLSPEC1"></entry>
-</row>
-<row>
-<entry> <image href="../images/nany.gif"><alt>This graphic is the ANY content
-icon</alt></image> </entry>
-<entry>ANY content (content model)</entry>
-</row>
-<row>
-<entry><image href="../images/attribute.gif"><alt>This graphic is the attribute
-icon</alt></image> </entry>
-<entry>attribute</entry>
-</row>
-<row>
-<entry><image href="../images/attribute_list.gif"><alt>This graphic is the
-attribute list icon</alt></image> </entry>
-<entry>attribute list</entry>
-</row>
-<row>
-<entry colname="COLSPEC0"><image href="../images/ADD_Comment.gif"><alt>This
-graphic is the comment icon</alt></image></entry>
-<entry colname="COLSPEC1">comment</entry>
-</row>
-<row>
-<entry> <image href="../images/XSDChoice.gif"><alt>This graphic is the content
-model - choice icon</alt></image></entry>
-<entry>content model - choice</entry>
-</row>
-<row>
-<entry> <image href="../images/XSDSequence.gif"><alt>This graphic is the content
-model - sequence icon</alt></image></entry>
-<entry>content model - sequence</entry>
-</row>
-<row>
-<entry><image href="../images/ADD_Element.gif"><alt>This graphic is the element
-icon</alt></image> </entry>
-<entry>element</entry>
-</row>
-<row>
-<entry> <image href="../images/nempty.gif"><alt>This graphic is the EMPTY
-content (content model) icon</alt></image> </entry>
-<entry>EMPTY content (content model)</entry>
-</row>
-<row>
-<entry><image href="../images/ADD_Entity.gif"><alt>This graphic is the entity
-icon</alt></image> </entry>
-<entry>entity</entry>
-</row>
-<row>
-<entry><image href="../images/ADD_Notation.gif"><alt>This graphic is the notation
-icon</alt></image> </entry>
-<entry>notation</entry>
-</row>
-<row>
-<entry> <image href="../images/ADD_Entity_Reference.gif"><alt>This graphic
-is the parameter entity reference icon</alt></image></entry>
-<entry>parameter entity reference</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<section></section>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
deleted file mode 100644
index 180b39428f..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Icons used in the DTD editor" />
-<meta name="abstract" content="These DTD editor icons appear in the Outline view." />
-<meta name="description" content="These DTD editor icons appear in the Outline view." />
-<meta content="DTDs, editor icons" name="DC.subject" />
-<meta content="DTDs, editor icons" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ricons" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Icons used in the DTD editor</title>
-</head>
-<body id="ricons"><a name="ricons"><!-- --></a>
-
-
-<h1 class="topictitle1">Icons used in the DTD editor</h1>
-
-
-
-
-<div><p>These DTD editor icons appear in the Outline view.</p>
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr>
-<th valign="top" id="N10063">Icon </th>
-
-<th valign="top" id="N1006A">Description</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" headers="N10063 ">&nbsp;</td>
-
-<td valign="top" headers="N1006A ">&nbsp;</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "> <img src="../images/nany.gif" alt="This graphic is the ANY content&#10;icon" /> </td>
-
-<td valign="top" headers="N1006A ">ANY content (content model)</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/attribute.gif" alt="This graphic is the attribute&#10;icon" /> </td>
-
-<td valign="top" headers="N1006A ">attribute</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/attribute_list.gif" alt="This graphic is the&#10;attribute list icon" /> </td>
-
-<td valign="top" headers="N1006A ">attribute list</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/ADD_Comment.gif" alt="This&#10;graphic is the comment icon" /></td>
-
-<td valign="top" headers="N1006A ">comment</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "> <img src="../images/XSDChoice.gif" alt="This graphic is the content&#10;model - choice icon" /></td>
-
-<td valign="top" headers="N1006A ">content model - choice</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "> <img src="../images/XSDSequence.gif" alt="This graphic is the content&#10;model - sequence icon" /></td>
-
-<td valign="top" headers="N1006A ">content model - sequence</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/ADD_Element.gif" alt="This graphic is the element&#10;icon" /> </td>
-
-<td valign="top" headers="N1006A ">element</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "> <img src="../images/nempty.gif" alt="This graphic is the EMPTY&#10;content (content model) icon" /> </td>
-
-<td valign="top" headers="N1006A ">EMPTY content (content model)</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/ADD_Entity.gif" alt="This graphic is the entity&#10;icon" /> </td>
-
-<td valign="top" headers="N1006A ">entity</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "><img src="../images/ADD_Notation.gif" alt="This graphic is the notation&#10;icon" /> </td>
-
-<td valign="top" headers="N1006A ">notation</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10063 "> <img src="../images/ADD_Entity_Reference.gif" alt="This graphic&#10;is the parameter entity reference icon" /></td>
-
-<td valign="top" headers="N1006A ">parameter entity reference</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-<div class="section" />
-
-</div>
-
-<div>
-<div class="familylinks">
-<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/cworkdtds.html" title="This sections contains information on the following:">Working with DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita
deleted file mode 100644
index 6357fa4320..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="keyboardshortcutsinthedtdeditor" xml:lang="en-us">
-<title outputclass="id_title">DTD editor keyboard shortcuts</title>
-<shortdesc outputclass="id_shortdesc"></shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTD editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>keyboard shortcuts<indexterm>DTD editor</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<table frame="all">
-<tgroup cols="2"><colspec colname="col1" colwidth="84*"/><colspec colname="col3"
-colwidth="93*"/>
-<thead>
-<row valign="bottom">
-<entry colname="col1">Key Combination</entry>
-<entry colname="col3">Function</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="col1">Shift+Alt+Up Arrow</entry>
-<entry colname="col3">Expand selection to enclosing element</entry>
-</row>
-<row>
-<entry colname="col1">Shift+Alt+Right Arrow</entry>
-<entry colname="col3">Expand selection to next element</entry>
-</row>
-<row>
-<entry colname="col1">Shift+Alt+Left Arrow</entry>
-<entry colname="col3">Expand selection to previous element</entry>
-</row>
-<row>
-<entry colname="col1">Shift+Alt+Down Arrow</entry>
-<entry colname="col3">Restore last selection</entry>
-</row>
-<row>
-<entry colname="col1">Ctrl+Shift+P</entry>
-<entry colname="col3">Go to matching bracket</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html
deleted file mode 100644
index 1c0a656003..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="DTD editor keyboard shortcuts" />
-<meta name="abstract" content="" />
-<meta name="description" content="" />
-<meta content="DTD editor, keyboard shortcuts" name="DC.subject" />
-<meta content="DTD editor, keyboard shortcuts" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="keyboardshortcutsinthedtdeditor" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>DTD editor keyboard shortcuts</title>
-</head>
-<body id="keyboardshortcutsinthedtdeditor"><a name="keyboardshortcutsinthedtdeditor"><!-- --></a>
-
-
-<h1 class="id_title">DTD editor keyboard shortcuts</h1>
-
-
-
-<div><p class="id_shortdesc" />
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr valign="bottom">
-<th valign="bottom" width="47.45762711864407%" id="N10068">Key Combination</th>
-
-<th valign="bottom" width="52.54237288135594%" id="N1006F">Function</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Up Arrow</td>
-
-<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to enclosing element</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Right Arrow</td>
-
-<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to next element</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Left Arrow</td>
-
-<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to previous element</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Down Arrow</td>
-
-<td valign="top" width="52.54237288135594%" headers="N1006F ">Restore last selection</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10068 ">Ctrl+Shift+P</td>
-
-<td valign="top" width="52.54237288135594%" headers="N1006F ">Go to matching bracket</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-</div>
-
-<div>
-<div class="familylinks">
-<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/cworkdtds.html" title="This sections contains information on the following:">Working with DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita
deleted file mode 100644
index 7af8ce3cbe..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tcretdtd" xml:lang="en-us">
-<title>Creating DTDs</title>
-<titlealts>
-<searchtitle>Creating a new document type definition (DTD)</searchtitle>
-</titlealts>
-<shortdesc>A document type definition (DTD) contains a set of rules that can
-be used to validate an XML file. After you have created a DTD, you can edit
-it manually, adding declarations that define elements, attributes, entities,
-and notations, and how they can be used for any XML files that reference the
-DTD file.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>creating</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To create a new
-DTD, complete the following steps:</p></context>
-<steps>
-<step><cmd>Create a project to contain the DTD if needed.</cmd></step>
-<step><cmd>In the workbench, click <menucascade><uicontrol>File</uicontrol>
-<uicontrol>New</uicontrol><uicontrol>Other</uicontrol></menucascade> and select <menucascade>
-<uicontrol>XML</uicontrol><uicontrol> DTD</uicontrol></menucascade>. Click <uicontrol>Next</uicontrol>. </cmd>
-</step>
-<step><cmd>Select the project or folder that will contain the DTD.</cmd></step>
-<step><cmd>In the <uicontrol>File name</uicontrol> field, type the name of
-the DTD, for example <userinput>MyDTD.dtd</userinput>.</cmd><info>The name
-of your DTD file must end with the extension <userinput>.dtd</userinput></info>
-</step>
-<step><cmd>Click <uicontrol>Next</uicontrol>.</cmd></step>
-<step importance="optional"><cmd>You can use a DTD template as the basis for
-your new DTD file. To do so, click the <uicontrol>Use DTD Template</uicontrol> check
-box, and select the template you want to use.</cmd></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
-</steps>
-<result><p>The DTD appears in the Navigator view and automatically, by default,
-opens in the DTD editor. In the DTD editor, you can manually add elements,
-attributes, notations, entities, and comments to the DTD. If you close the
-file, and want to later re-open it in the DTD editor, double-click it in the
-Navigator view.</p></result>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html
deleted file mode 100644
index eac25f0c2a..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating DTDs" />
-<meta name="abstract" content="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file." />
-<meta name="description" content="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file." />
-<meta content="DTDs, creating" name="DC.subject" />
-<meta content="DTDs, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cdtdover.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tdtemplt.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcretdtd" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating a new document type definition (DTD)</title>
-</head>
-<body id="tcretdtd"><a name="tcretdtd"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating DTDs</h1>
-
-
-
-
-<div><p>A document type definition (DTD) contains a set of rules that can
-be used to validate an XML file. After you have created a DTD, you can edit
-it manually, adding declarations that define elements, attributes, entities,
-and notations, and how they can be used for any XML files that reference the
-DTD file.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To create a new
-DTD, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Create a project to contain the DTD if needed.</span></li>
-
-<li class="stepexpand"><span>In the workbench, click <span class="menucascade"><span class="uicontrol">File</span>
- &gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Other</span></span> and select <span class="menucascade">
-<span class="uicontrol">XML</span> &gt; <span class="uicontrol"> DTD</span></span>. Click <span class="uicontrol">Next</span>. </span>
-</li>
-
-<li class="stepexpand"><span>Select the project or folder that will contain the DTD.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">File name</span> field, type the name of
-the DTD, for example <kbd class="userinput">MyDTD.dtd</kbd>.</span> The name
-of your DTD file must end with the extension <kbd class="userinput">.dtd</kbd>
-</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Next</span>.</span></li>
-
-<li class="stepexpand"><strong>Optional: </strong><span>You can use a DTD template as the basis for
-your new DTD file. To do so, click the <span class="uicontrol">Use DTD Template</span> check
-box, and select the template you want to use.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
-
-</ol>
-
-<div class="section"><p>The DTD appears in the Navigator view and automatically, by default,
-opens in the DTD editor. In the DTD editor, you can manually add elements,
-attributes, notations, entities, and comments to the DTD. If you close the
-file, and want to later re-open it in the DTD editor, double-click it in the
-Navigator view.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cdtdover.html" title="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file.">Document type definitions (DTDs) - overview</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tdtemplt.html" title="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.">Working with DTD templates</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita
deleted file mode 100644
index 47a267ac8b..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twmacro" xml:lang="en-us">
-<title>Working with DTD templates</title>
-<titlealts>
-<searchtitle>Working with DTD templates</searchtitle>
-</titlealts>
-<shortdesc>Templates are a chunk of predefined code that you can insert into
-a DTD file when it is created. You may find a template useful when you have
-a certain piece of code you want to reuse several times, and you do not want
-to write it out every time.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>creating templates</indexterm></indexterm>
-<indexterm>templates<indexterm>DTD</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To create a new DTD template, complete the following steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-<uicontrol>Web and XML</uicontrol><uicontrol>DTD Files</uicontrol><uicontrol>Templates</uicontrol>
-</menucascade>.</cmd></step>
-<step><cmd>Click <uicontrol>New</uicontrol> in the templates prefereces.</cmd>
-</step>
-<step><cmd>Supply a new template <uicontrol>Name</uicontrol> and <uicontrol>Description</uicontrol>.</cmd>
-</step>
-<step><cmd>Specify the <uicontrol>Context</uicontrol> for the template.</cmd>
-<info>This is the context in which the template is available in the proposal
-list when content assist is requested. </info></step>
-<step><cmd>Specify the <uicontrol>Pattern</uicontrol> for your template using
-the appropriate tags, attributes, or attribute values to be inserted by content
-assist.</cmd></step>
-<step importance="optional"><cmd>To insert a variable, click the <uicontrol>Insert
-Variable</uicontrol> button and select a variable. </cmd><info>For example,
-the <uicontrol>date</uicontrol> variable indicates the current date will be
-inserted. </info></step>
-<step><cmd>Click <uicontrol>Apply</uicontrol> and then <uicontrol>OK</uicontrol> to
-save your changes.</cmd></step>
-</steps>
-<postreq>You can edit, remove, import, or export a template by using the same
-preferences page. <p>If you have a template that you do not want to remove,
-but you no longer want the template to appear in the DTD templates list when
-you create a file, clear its checkbox in the templates table.</p></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html
deleted file mode 100644
index 24b1c30fae..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Working with DTD templates" />
-<meta name="abstract" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta name="description" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta content="DTDs, creating templates, templates, DTD" name="DC.subject" />
-<meta content="DTDs, creating templates, templates, DTD" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twmacro" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Working with DTD templates</title>
-</head>
-<body id="twmacro"><a name="twmacro"><!-- --></a>
-
-
-<h1 class="topictitle1">Working with DTD templates</h1>
-
-
-
-
-<div><p>Templates are a chunk of predefined code that you can insert into
-a DTD file when it is created. You may find a template useful when you have
-a certain piece of code you want to reuse several times, and you do not want
-to write it out every time.</p>
-
-<div class="section"><p>To create a new DTD template, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
- &gt; <span class="uicontrol">Web and XML</span> &gt; <span class="uicontrol">DTD Files</span> &gt; <span class="uicontrol">Templates</span>
-</span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">New</span> in the templates prefereces.</span>
-</li>
-
-<li class="stepexpand"><span>Supply a new template <span class="uicontrol">Name</span> and <span class="uicontrol">Description</span>.</span>
-</li>
-
-<li class="stepexpand"><span>Specify the <span class="uicontrol">Context</span> for the template.</span>
- This is the context in which the template is available in the proposal
-list when content assist is requested. </li>
-
-<li class="stepexpand"><span>Specify the <span class="uicontrol">Pattern</span> for your template using
-the appropriate tags, attributes, or attribute values to be inserted by content
-assist.</span></li>
-
-<li class="stepexpand"><strong>Optional: </strong><span>To insert a variable, click the <span class="uicontrol">Insert
-Variable</span> button and select a variable. </span> For example,
-the <span class="uicontrol">date</span> variable indicates the current date will be
-inserted. </li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Apply</span> and then <span class="uicontrol">OK</span> to
-save your changes.</span></li>
-
-</ol>
-
-<div class="section">You can edit, remove, import, or export a template by using the same
-preferences page. <p>If you have a template that you do not want to remove,
-but you no longer want the template to appear in the DTD templates list when
-you create a file, clear its checkbox in the templates table.</p>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcretdtd.html" title="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file.">Creating DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita
deleted file mode 100644
index 5442f67db0..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="ttaghilt" xml:lang="en-us">
-<title>Setting source highlighting styles</title>
-<titlealts>
-<searchtitle>Setting source highlighting styles for DTD files</searchtitle>
-</titlealts>
-<shortdesc>If desired, you can change various aspects of how the DTD source
-code is displayed in the Source view of the DTD editor, such as the colors
-the tags will be displayed in.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>highlighting styles</indexterm></indexterm>
-<indexterm>XML editor<indexterm>DTD highlighting styles</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To set highlighting styles for the DTD code, complete the following
-steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-<uicontrol>Web and XML</uicontrol><uicontrol>DTD Files</uicontrol><uicontrol> Syntax
-Coloring</uicontrol></menucascade>.</cmd></step>
-<step><cmd>In the <uicontrol>Syntax Element</uicontrol> list, select the source
-tag type that you wish to set a highlighting style for. You can also click
-text in the sample text to specify the source tag type that you wish to set
-a highlighting style for.</cmd></step>
-<step><cmd>Click the <uicontrol>Foreground</uicontrol> box and select the
-color that you want the text of the tag to appear in and click <uicontrol>OK</uicontrol>.</cmd>
-</step>
-<step><cmd>Click the <uicontrol>Background</uicontrol> box and select the
-color that you want to appear behind the tag and click <uicontrol>OK</uicontrol>.</cmd>
-</step>
-<step><cmd>Select the <uicontrol>Bold</uicontrol>, <uicontrol>Italic</uicontrol>, <uicontrol>Strikethrough</uicontrol>,
-and<uicontrol>Underline</uicontrol> check boxes for additional formatting
-options. </cmd></step>
-<step><cmd>Click <uicontrol>Restore Default</uicontrol> to set the highlighting
-styles back to their default values. If you only want to reset the value for
-a particular content type, select it in the <uicontrol>Content type</uicontrol> field,
-the click the <uicontrol>Restore Default</uicontrol> button next to it. </cmd>
-</step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save your changes.</cmd></step>
-</steps>
-<result></result>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html
deleted file mode 100644
index 817521a817..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting source highlighting styles" />
-<meta name="abstract" content="If desired, you can change various aspects of how the DTD source code is displayed in the Source view of the DTD editor, such as the colors the tags will be displayed in." />
-<meta name="description" content="If desired, you can change various aspects of how the DTD source code is displayed in the Source view of the DTD editor, such as the colors the tags will be displayed in." />
-<meta content="DTDs, highlighting styles, XML editor, DTD highlighting styles" name="DC.subject" />
-<meta content="DTDs, highlighting styles, XML editor, DTD highlighting styles" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ttaghilt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting source highlighting styles for DTD files</title>
-</head>
-<body id="ttaghilt"><a name="ttaghilt"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting source highlighting styles</h1>
-
-
-
-
-<div><p>If desired, you can change various aspects of how the DTD source
-code is displayed in the Source view of the DTD editor, such as the colors
-the tags will be displayed in.</p>
-
-<div class="section"><p>To set highlighting styles for the DTD code, complete the following
-steps:</p>
-</div>
-
-<ol>
-<li><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
- &gt; <span class="uicontrol">Web and XML</span> &gt; <span class="uicontrol">DTD Files</span> &gt; <span class="uicontrol"> Syntax
-Coloring</span></span>.</span></li>
-
-<li><span>In the <span class="uicontrol">Syntax Element</span> list, select the source
-tag type that you wish to set a highlighting style for. You can also click
-text in the sample text to specify the source tag type that you wish to set
-a highlighting style for.</span></li>
-
-<li><span>Click the <span class="uicontrol">Foreground</span> box and select the
-color that you want the text of the tag to appear in and click <span class="uicontrol">OK</span>.</span>
-</li>
-
-<li><span>Click the <span class="uicontrol">Background</span> box and select the
-color that you want to appear behind the tag and click <span class="uicontrol">OK</span>.</span>
-</li>
-
-<li><span>Select the <span class="uicontrol">Bold</span>, <span class="uicontrol">Italic</span>, <span class="uicontrol">Strikethrough</span>,
-and<span class="uicontrol">Underline</span> check boxes for additional formatting
-options. </span></li>
-
-<li><span>Click <span class="uicontrol">Restore Default</span> to set the highlighting
-styles back to their default values. If you only want to reset the value for
-a particular content type, select it in the <span class="uicontrol">Content type</span> field,
-the click the <span class="uicontrol">Restore Default</span> button next to it. </span>
-</li>
-
-<li><span>Click <span class="uicontrol">OK</span> to save your changes.</span></li>
-
-</ol>
-
-<div class="section" />
-
-</div>
-
-<div>
-<div class="familylinks">
-<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/tcretdtd.html" title="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file.">Creating DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita
deleted file mode 100644
index 937590b636..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="timptdtd" xml:lang="en-us">
-<title>Importing DTDs</title>
-<titlealts>
-<searchtitle>Importing DTDs</searchtitle>
-</titlealts>
-<shortdesc>If you want to work with DTD files that you created outside of
-the product, you can import them into the workbench and open them in the DTD
-editor. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTDs<indexterm>importing</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To import a DTD into the workbench, complete the following steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>File</uicontrol><uicontrol>Import</uicontrol>
-</menucascade>. Select <menucascade><uicontrol>General</uicontrol><uicontrol>File
-System</uicontrol></menucascade> and click <uicontrol>Next</uicontrol>.</cmd>
-</step>
-<step><cmd>Fill in the fields in the <uicontrol>Import</uicontrol> wizard
-as necessary.</cmd></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol> to exit the wizard and import
-the files.</cmd></step>
-<step><cmd>Select the DTD file in the Navigator view and double-click it to
-open it in the DTD editor.</cmd></step>
-</steps>
-<result><p>After you have imported a DTD file into the workbench and opened
-it in the DTD editor, you can edit it manually.</p></result>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html
deleted file mode 100644
index e813eb1251..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Importing DTDs" />
-<meta name="abstract" content="If you want to work with DTD files that you created outside of the product, you can import them into the workbench and open them in the DTD editor." />
-<meta name="description" content="If you want to work with DTD files that you created outside of the product, you can import them into the workbench and open them in the DTD editor." />
-<meta content="DTDs, importing" name="DC.subject" />
-<meta content="DTDs, importing" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="timptdtd" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Importing DTDs</title>
-</head>
-<body id="timptdtd"><a name="timptdtd"><!-- --></a>
-
-
-<h1 class="topictitle1">Importing DTDs</h1>
-
-
-
-
-<div><p>If you want to work with DTD files that you created outside of
-the product, you can import them into the workbench and open them in the DTD
-editor. </p>
-
-<div class="section"><p>To import a DTD into the workbench, complete the following steps:</p>
-</div>
-
-<ol>
-<li><span>Click <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Import</span>
-</span>. Select <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">File
-System</span></span> and click <span class="uicontrol">Next</span>.</span>
-</li>
-
-<li><span>Fill in the fields in the <span class="uicontrol">Import</span> wizard
-as necessary.</span></li>
-
-<li><span>Click <span class="uicontrol">Finish</span> to exit the wizard and import
-the files.</span></li>
-
-<li><span>Select the DTD file in the Navigator view and double-click it to
-open it in the DTD editor.</span></li>
-
-</ol>
-
-<div class="section"><p>After you have imported a DTD file into the workbench and opened
-it in the DTD editor, you can edit it manually.</p>
-</div>
-
-</div>
-
-<div>
-<div class="familylinks">
-<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/cworkdtds.html" title="This sections contains information on the following:">Working with DTDs</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita
deleted file mode 100644
index 12c7aa7a43..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<task id="tvaldtd" xml:lang="en-us">
-<title>Validating DTDs</title>
-<titlealts>
-<searchtitle>Validating DTDs</searchtitle>
-</titlealts>
-<shortdesc>Validating a DTD file lets you verify that it is well formed
-and does not contain any errors.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DTD<indexterm>validating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-validate a DTD, right-click the DTD in the Navigator view and click <menucascade>
-<uicontrol>Validate</uicontrol></menucascade>. A dialog opens, indicating
-if the DTD file was successfully validated or not. If the file is
-invalid, any errors will appear in the Problems view.<?Pub Caret?></p></context>
-<result><note>If you receive an error message indicating that the
-Problems view is full, you can increase the number of error messages
-allowed in the view. Click <menucascade><uicontrol>Window</uicontrol>
-<uicontrol>Preferences</uicontrol></menucascade> and select <menucascade>
-<uicontrol>General</uicontrol><uicontrol>Markers</uicontrol>
-</menucascade>. On this preferences page you can increase or decrease
-the number of visible items in the problems view. </note><p>You can
-set up a project's properties so that different types of project resources
-are automatically validated when you save them. Right click on the
-project, click <uicontrol>Properties</uicontrol>, and select <uicontrol>Validation</uicontrol>.
-Any validators you can run against your&nbsp;project will be listed
-in the Validation page.</p></result>
-</taskbody>
-<related-links>
-<link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita"
-scope="peer"><linktext>Validating code in enterprise applications</linktext>
-<desc>General validation information</desc>
-</link>
-</related-links>
-</task>
-<?Pub *0000002105?>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
deleted file mode 100644
index 2098e50aff..0000000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Validating DTDs" />
-<meta name="abstract" content="Validating a DTD file lets you verify that it is well formed and does not contain any errors." />
-<meta name="description" content="Validating a DTD file lets you verify that it is well formed and does not contain any errors." />
-<meta content="DTD, validating" name="DC.subject" />
-<meta content="DTD, validating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tvaldtd" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Validating DTDs</title>
-</head>
-<body id="tvaldtd"><a name="tvaldtd"><!-- --></a>
-
-
-<h1 class="topictitle1">Validating DTDs</h1>
-
-
-
-
-<div><p>Validating a DTD file lets you verify that it is well formed
-and does not contain any errors.</p>
-
-<div class="section"><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-validate a DTD, right-click the DTD in the Navigator view and click <span class="menucascade">
-<span class="uicontrol">Validate</span></span>. A dialog opens, indicating
-if the DTD file was successfully validated or not. If the file is
-invalid, any errors will appear in the Problems view.</p>
-</div>
-
-<div class="section"><div class="note"><span class="notetitle">Note:</span> If you receive an error message indicating that the
-Problems view is full, you can increase the number of error messages
-allowed in the view. Click <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol">Preferences</span></span> and select <span class="menucascade">
-<span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span>
-</span>. On this preferences page you can increase or decrease
-the number of visible items in the problems view. </div>
-<p>You can
-set up a project's properties so that different types of project resources
-are automatically validated when you save them. Right click on the
-project, click <span class="uicontrol">Properties</span>, and select <span class="uicontrol">Validation</span>.
-Any validators you can run against your project will be listed
-in the Validation page.</p>
-</div>
-
-</div>
-
-<div><div class="relinfo"><strong>Related information</strong><br />
-<div><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">Validating code in enterprise applications</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.html.ui.infopop/.cvsignore b/docs/org.eclipse.wst.html.ui.infopop/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.wst.html.ui.infopop/.project b/docs/org.eclipse.wst.html.ui.infopop/.project
deleted file mode 100644
index 05aa1b4bed..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.html.ui.infopop</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.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/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.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/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts.xml b/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts.xml
deleted file mode 100644
index 8b8dc10ff2..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-
-<contexts>
-<context id="misc0170">
-<description>Use this dialog to edit the Web content settings for a Web project. You can specify the default document type, CSS profile, and target device. The public ID and system ID are populated automatically. To restore the defaults, click <b>Restore Defaults</b>.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="webx0030">
-<description>This page lets you specify the line delimiter and the text encoding that will be used when you create, save, or load an HTML file.
-
-Various development platforms use different line delimiters to indicate the start of a new line. Select the operating system that corresponds to your development or deployment platform.
-<b>Note:</b> This delimiter will not automatically be added to any documents that currently exist. It will be added only to documents that you create after you select the line delimiter type and click <b>Apply</b>, or to existing files that you open and then resave after you select the line delimiter type and click <b>Apply</b>.
-
-The encoding attribute is used to specify the default character encoding set that is used when either creating HTML files or loading your HTML files into the editor. Changing the creating files encoding causes any new HTML files that are created from scratch to use the selected encoding.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0031">
-<description>This page lets you specify the formatting, content assist, and capitalization style that will be used when you edit an HTML file.
-
-Enter a maximum width in the <b>Line width</b> field to specify the line width to break a line to fit onto more than one line when the document is formatted.
-
-Select <b>Split multiple attributes each on a new line</b> to start every attribute on a new line when the document is formatted. Attributes will return to the same margin as the previous line.
-
-Select <b>Indent using tabs</b> if you want to use tab characters (\t) as the standard formatting indentation.
-
-If you prefer to use spaces, select <b>Indent using spaces</b>.
-
-You can also specify the <b>Indentation size</b> which is the number of tabs or space characters used for formatting indentation.
-
-Select <b>Clear all blank lines</b> to remove blank lines when the document is formatted.
-
-To apply these formatting styles, select the <b>Format Document</b> menu item.
-
-If the <b>Automatically make suggestions</b> check box is selected, you can specify that certain characters will cause the content assist list to pop up automatically. Specify these characters in the <b>Prompt when these characters are inserted</b> field.
-
-Select the Uppercase or Lowercase radio button to determine the case for tag and attribute names that are inserted into the document when using content assist or code generation.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0032">
-<description>This page lets you customize the syntax highlighting that the HTML editor does when you are editing a file.
-
-The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
-
-The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that allow you to specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
-
-Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="webx0033">
-<description>This page lets you create new and edit existing templates that will be used when you edit an HTML file.
-</description>
-<topic label="Adding and removing HTML templates" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html"/>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-</context>
-
-<context id="xmlm1100">
-<description>Cleanup options enable you to update a document so that it is well-formed and formatted.
-
-The following cleanup options let you select radio buttons to choose the type of cleanup to be performed:
-- <b>Tag name case for HTML</b>: Unless set to <b>As-is</b>, changes the case of all tags in a file for easier visual parsing and consistency.
-- <b>Attribute name case for HTML</b>: Unless set to <b>As-is</b>, changes the case of all attributes in a file for easier visual parsing and consistency.
-
-The following cleanup options can be set to on or off, so that you can limit the type of cleanup performed:
-- <b>Insert required attributes</b>: Inserts an missing attributes that are required by the tag to make the element or document well-formed.
-- <b>Insert missing tags</b>: Completes any missing tags (such as adding an end tag) necessary to make the element or document well-formed.
-- <b>Quote attribute values</b>: Appropriately adds double- or single-quotes before and after attribute values if they are missing.
-- <b>Format source</b>: Formats the document just as the <b>Format Document</b> context menu option does, immediately after performing any other specified <b>Cleanup</b> options.
-- <b>Convert line delimiters to</b>: Converts all line delimiters in the file to the selected operating system's type.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-</contexts>
diff --git a/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts2.xml b/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts2.xml
deleted file mode 100644
index b614187af7..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/EditorHtmlContexts2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-
-<contexts>
-<context id="htmlsource_source_HelpId">
-<description>The HTML source page editor lets you edit a file that is coded in the Hypertext Markup Language or in XHTML. The editor provides many text editing features, such as content assist, user-defined templates, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-<topic label="Adding and removing HTML templates" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html"/>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.html.ui.infopop/HTMLWizContexts.xml b/docs/org.eclipse.wst.html.ui.infopop/HTMLWizContexts.xml
deleted file mode 100644
index ed68cf2de7..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/HTMLWizContexts.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<contexts>
-<context id="htmlw0010">
-<description>Select the HTML template checkbox to create your HTML file based on a default template. Choose one of the frameset templates if you are developing a Web site with frames. If you do not select a template, your newly created JSP file will be completely blank.
-</description>
-</context>
-
-
-
-</contexts>
diff --git a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index 4491593d7c..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.html.ui.infopop; singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.html.ui.infopop/about.html b/docs/org.eclipse.wst.html.ui.infopop/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/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/docs/org.eclipse.wst.html.ui.infopop/build.properties b/docs/org.eclipse.wst.html.ui.infopop/build.properties
deleted file mode 100644
index f1a352eced..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = plugin.xml,\
- about.html,\
- EditorHtmlContexts.xml,\
- META-INF/,\
- EditorHtmlContexts2.xml,\
- plugin.properties
-generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties b/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
deleted file mode 100644
index 8feb9e3fb2..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.html.ui.infopop
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-Bundle-Name.0 = HTML editor infopops \ No newline at end of file
diff --git a/docs/org.eclipse.wst.html.ui.infopop/plugin.xml b/docs/org.eclipse.wst.html.ui.infopop/plugin.xml
deleted file mode 100644
index 9b085e76a4..0000000000
--- a/docs/org.eclipse.wst.html.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
- <contexts file="EditorHtmlContexts.xml" plugin ="org.eclipse.wst.html.ui"/>
- <contexts file="EditorHtmlContexts2.xml" plugin ="org.eclipse.wst.html.core"/>
- <contexts file="HTMLWizContexts.xml" plugin="org.eclipse.wst.html.ui"/>
-</extension>
-
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/.cvsignore b/docs/org.eclipse.wst.sse.doc.user/.cvsignore
deleted file mode 100644
index 33a2f88503..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-org.eclipse.wst.sse.doc.user_1.0.0.jar
-temp
-DitaLink.cat \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/.project b/docs/org.eclipse.wst.sse.doc.user/.project
deleted file mode 100644
index e2d640609c..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.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/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.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/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml b/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml
deleted file mode 100644
index 1a18684d4f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
- This script build the Help plug-in by transforming the DITA source files into HTML.
-
- To use this script, you must install DITA-OT on your machine in the directory
- defined by the dita.ot.dir property.
-
- Run the default target after you edit the DITA source files to regenerate the HTML.
-
- To customize this script for other Help plug-ins, modify the value of the args.input property
- to be the DITA map file for the plug-in.
-
- NOTE: This script assumes that links to sibling Help plug-ins have scope="peer", otherwise the
- output directory structure will be shifted incorrectly.
-
- NOTE: This script assumes that you hand code your plugin.xml file in myplugin.xml. This file
- will be copied over the generated plugin.xml which is currently not being generated correctly
- by DITA-OT.
-
- ChangeLog:
- 2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
- - Created.
- 2008-05-05 Kate Price <katep@ca.ibm.com>
- - modified to add generation of pre-built help index.
- - Must delete /index folder before running build
--->
-<project name="eclipsehelp" default="all">
-
- <property name="dita.ot.dir" location="C:/DITA-OT1.2.2" />
-
- <path id="dost.class.path">
- <pathelement location="${dita.ot.dir}${file.separator}lib${file.separator}dost.jar" />
- </path>
-
- <taskdef name="integrate" classname="org.dita.dost.platform.IntegratorTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <target name="all" depends="integrate, eclipsehelp">
- </target>
- <target name="integrate">
- <integrate ditadir="${dita.ot.dir}" />
- </target>
-
- <!-- revise below here -->
- <target name="eclipsehelp">
- <ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
- <property name="args.copycss" value="no" />
- <property name="args.csspath" value="../org.eclipse.wst.doc.user" />
- <property name="args.eclipse.provider" value="Eclipse.org" />
- <property name="args.eclipse.version" value="3.3.0" />
- <property name="args.input" location="sse_toc.ditamap" />
- <property name="clean.temp" value="true" />
- <property name="dita.extname" value=".dita" />
- <property name="dita.temp.dir" location="temp" />
- <property name="output.dir" location="" />
- <property name="transtype" value="eclipsehelp" />
- </ant>
- <copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
- </target>
- <target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-</project>
diff --git a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 7da11f915c..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.sse.doc.user; singleton:=true
-Bundle-Version: 1.1.100.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.sse.doc.user/about.html b/docs/org.eclipse.wst.sse.doc.user/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/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/docs/org.eclipse.wst.sse.doc.user/build.properties b/docs/org.eclipse.wst.sse.doc.user/build.properties
deleted file mode 100644
index eec0c0dd54..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = about.html,\
- images/,\
- plugin.xml,\
- sse_toc.xml,\
- org.eclipse.wst.sse.doc.userindex.xml,\
- topics/*.htm*,\
- index/,\
- META-INF/,\
- plugin.properties
-src.includes = *.maplist,\
- *.ditamap,\
- topics/*.dita
-bin.excludes = DocBuild.xml,\
- myPlugin*.xml
-
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/ncontass.gif b/docs/org.eclipse.wst.sse.doc.user/images/ncontass.gif
deleted file mode 100644
index d82014f049..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/ncontass.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/njscdast.gif b/docs/org.eclipse.wst.sse.doc.user/images/njscdast.gif
deleted file mode 100644
index 41a141cb43..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/njscdast.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/nlinux.gif b/docs/org.eclipse.wst.sse.doc.user/images/nlinux.gif
deleted file mode 100644
index 7c135cfe64..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/nlinux.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/nmacscrp.gif b/docs/org.eclipse.wst.sse.doc.user/images/nmacscrp.gif
deleted file mode 100644
index 54a6371b3a..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/nmacscrp.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/nquest.gif b/docs/org.eclipse.wst.sse.doc.user/images/nquest.gif
deleted file mode 100644
index 3faa1e262a..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/nquest.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/images/nwin.gif b/docs/org.eclipse.wst.sse.doc.user/images/nwin.gif
deleted file mode 100644
index 895f9ca06d..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/images/nwin.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs b/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs
deleted file mode 100644
index ca41649549..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/deletable b/docs/org.eclipse.wst.sse.doc.user/index/deletable
deleted file mode 100644
index 593f4708db..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/deletable
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions
deleted file mode 100644
index 6ba76dc06c..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions
+++ /dev/null
@@ -1,3 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 18:56:03 EDT 2008
-org.eclipse.wst.sse.doc.user=org.eclipse.wst.sse.doc.user\n1.1.0.qualifier
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies
deleted file mode 100644
index d2c7a64e23..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 18:56:03 EDT 2008
-lucene=1.9.1.v200803061811
-analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs b/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs
deleted file mode 100644
index 885cd48384..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs
+++ /dev/null
@@ -1,24 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 18:56:03 EDT 2008
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html=0
-/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html=0
-/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html=0
-/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html=0
-/org.eclipse.wst.sse.doc.user/topics/cvalidate.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html=0
-/org.eclipse.wst.sse.doc.user/topics/cencoding.html=0
-/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html=0
-/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html=0
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/segments b/docs/org.eclipse.wst.sse.doc.user/index/segments
deleted file mode 100644
index 2d63c4c891..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/index/segments
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/myplugin.xml b/docs/org.eclipse.wst.sse.doc.user/myplugin.xml
deleted file mode 100644
index 8255056dbd..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/myplugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2001, 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
- *******************************************************************************/ -->
-
-<!-- ===================================================== -->
-<!-- This is the plug-in for declaring the help pages -->
-<!-- for the structured text editors (source editors). -->
-<!-- ===================================================== -->
-
-<plugin>
-
- <extension point="org.eclipse.help.toc">
- <toc file="sse_toc.xml"/>
- <index path="index/"/>
- </extension>
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.sse.doc.userindex.xml"/>
-</extension>
-
-</plugin>
diff --git a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.user.maplist b/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.user.maplist
deleted file mode 100644
index b0f4da55cb..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.user.maplist
+++ /dev/null
@@ -1,7 +0,0 @@
-<maplist version="3.6.2">
- <nav>
- <map file="sse_toc.ditamap"/>
- </nav>
- <link>
- </link>
-</maplist>
diff --git a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.html b/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.html
deleted file mode 100644
index 10a8886d0e..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.html
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="copyright" content="(C) Copyright IBM Corporation 2007" />
-<meta name="security" content="public" />
-<meta name="Robots" content="index,follow" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta name="DC.Format" content="XHTML" />
-<!-- All rights reserved. Licensed Materials Property of IBM -->
-<!-- US Government Users Restricted Rights -->
-<!-- Use, duplication or disclosure restricted by -->
-<!-- GSA ADP Schedule Contract with IBM Corp. -->
-<link rel="stylesheet" type="text/css" href="ibmdita.css" />
-<title>Index</title>
-</head>
-<body>
-<h1>Index</h1>
-<a name="IDX0_41" href="#IDX1_41">A</a>
-<a name="IDX0_43" href="#IDX1_43">C</a>
-<a name="IDX0_44" href="#IDX1_44">D</a>
-<a name="IDX0_46" href="#IDX1_46">F</a>
-<a name="IDX0_48" href="#IDX1_48">H</a>
-<a name="IDX0_4A" href="#IDX1_4A">J</a>
-<a name="IDX0_4D" href="#IDX1_4D">M</a>
-<a name="IDX0_53" href="#IDX1_53">S</a>
-<a name="IDX0_54" href="#IDX1_54">T</a>
-<a name="IDX0_56" href="#IDX1_56">V</a>
-<a name="IDX0_58" href="#IDX1_58">X</a>
-<hr></hr>
-<strong><a name="IDX1_41" href="#IDX0_41">A</a></strong>
-<ul class="indexlist">
-<li>annotation preferences
-<ul class="indexlist">
-<li><a href="topics/tsrcedt001.html#tsrcedt001">markup language settings</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_43" href="#IDX0_43">C</a></strong>
-<ul class="indexlist">
-<li>character encoding
-<ul class="indexlist">
-<li><a href="topics/cencoding.html#cencoding">location in files</a>
-</li>
-</ul>
-</li>
-<li>content assistance
-<ul class="indexlist">
-<li><a href="topics/tsrcedt023.html#tsrcedt023">enabling for JSP files</a>
-</li>
-<li><a href="topics/csrcedt006.html#csrcedt006">overview</a>
-</li>
-<li><a href="topics/tsrcedt005.html#tsrcedt005">structured text editors</a>
-</li>
-</ul>
-</li>
-<li>content types
-<ul class="indexlist">
-<li><a href="topics/tcontenttype.html#tcontenttype">mapping file extensions</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_44" href="#IDX0_44">D</a></strong>
-<ul class="indexlist">
-<li>drawers
-<ul class="indexlist">
-<li><a href="topics/tsrcedt016.html#tsrcedt016">snippets view</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_46" href="#IDX0_46">F</a></strong>
-<ul class="indexlist">
-<li>file extensions
-<ul class="indexlist">
-<li><a href="topics/tcontenttype.html#tcontenttype">mapping content types</a>
-</li>
-</ul>
-</li>
-<li>file types
-<ul class="indexlist">
-<li><a href="topics/tcontenttype.html#tcontenttype">editors</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_48" href="#IDX0_48">H</a></strong>
-<ul class="indexlist">
-<li>HTML
-<ul class="indexlist">
-<li>templates
-<ul class="indexlist">
-<li><a href="topics/tsrcedt024.html#tsrcedt024">adding</a>
-</li>
-<li><a href="topics/tsrcedt024.html#tsrcedt024">removing</a>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_4A" href="#IDX0_4A">J</a></strong>
-<ul class="indexlist">
-<li>JSP files
-<ul class="indexlist">
-<li><a href="topics/cencoding.html#cencoding">character encoding</a>
-</li>
-<li><a href="topics/tsrcedt023.html#tsrcedt023">enabling content assistance</a>
-</li>
-</ul>
-</li>
-<li>JSP pages
-<ul class="indexlist">
-<li><a href="topics/tsrcedt028.html#tsrcedt028">templates</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_4D" href="#IDX0_4D">M</a></strong>
-<ul class="indexlist">
-<li>markup languages
-<ul class="indexlist">
-<li><a href="topics/tsrcedt000.html#tsrcedt000">editing text</a>
-</li>
-<li><a href="topics/tsrcedt001.html#tsrcedt001">setting annotation preferences</a>
-</li>
-<li><a href="topics/tsrcedt027.html#tsrcedt027">templates</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_53" href="#IDX0_53">S</a></strong>
-<ul class="indexlist">
-<li>snippet drawers
-<ul class="indexlist">
-<li><a href="topics/tsrcedt015.html#tsrcedt015">adding items</a>
-</li>
-</ul>
-</li>
-<li>snippet items
-<ul class="indexlist">
-<li><a href="topics/tsrcedt015.html#tsrcedt015">adding to drawers</a>
-</li>
-</ul>
-</li>
-<li>snippets
-<ul class="indexlist">
-<li><a href="topics/tsrcedt014.html#tsrcedt014">drawer customization</a>
-</li>
-<li><a href="topics/tsrcedt022.html#tsrcedt022">editing items</a>
-</li>
-<li><a href="topics/tsrcedt016.html#tsrcedt016">modifying drawers</a>
-</li>
-<li><a href="topics/tsrcedt026.html#tsrcedt026">overview</a>
-</li>
-</ul>
-</li>
-<li>Snippets view
-<ul class="indexlist">
-<li><a href="topics/csrcedt001.html#csrcedt001">overview</a>
-</li>
-</ul>
-</li>
-<li>spell check
-<ul class="indexlist">
-<li><a href="topics/tsrcedt010.html#tsrcedt010">structured text editors</a>
-</li>
-</ul>
-</li>
-<li>structured text editors
-<ul class="indexlist">
-<li>content assistance <a href="topics/tsrcedt005.html#tsrcedt005">(1)</a>, <a href="topics/csrcedt006.html#csrcedt006">(2)</a>
-</li>
-<li><a href="topics/csrcedt004.html#csrcedt004">overview</a>
-</li>
-<li><a href="topics/tsrcedt025.html#tsrcedt025">preference setting</a>
-</li>
-<li><a href="topics/tsrcedt010.html#tsrcedt010">spell check</a>
-</li>
-<li><a href="topics/tsrcedt007.html#tsrcedt007">text search</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_54" href="#IDX0_54">T</a></strong>
-<ul class="indexlist">
-<li>templates
-<ul class="indexlist">
-<li><a href="topics/tsrcedt024.html#tsrcedt024">HTML</a>
-</li>
-<li><a href="topics/tsrcedt028.html#tsrcedt028">JSP pages</a>
-</li>
-<li><a href="topics/tsrcedt027.html#tsrcedt027">markup languages</a>
-</li>
-<li><a href="topics/csrcedt004.html#csrcedt004">structured text editors</a>
-</li>
-<li><a href="topics/tsrcedt029.html#tsrcedt027">XML</a>
-</li>
-</ul>
-</li>
-<li>text
-<ul class="indexlist">
-<li><a href="topics/tsrcedt000.html#tsrcedt000">editing in markup languages</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_56" href="#IDX0_56">V</a></strong>
-<ul class="indexlist">
-<li>validation
-<ul class="indexlist">
-<li><a href="topics/cvalidate.html#csrcedt001">source vs batch</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_58" href="#IDX0_58">X</a></strong>
-<ul class="indexlist">
-<li>XHTML
-<ul class="indexlist">
-<li><a href="topics/cencoding.html#cencoding">character encoding</a>
-</li>
-</ul>
-</li>
-<li>XML
-<ul class="indexlist">
-<li><a href="topics/cencoding.html#cencoding">character encoding</a>
-</li>
-</ul>
-</li>
-<li>xml templates
-<ul class="indexlist">
-<li><a href="topics/tsrcedt029.html#tsrcedt027">adding</a>
-</li>
-</ul>
-</li>
-</ul>
-</body></html>
diff --git a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml b/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml
deleted file mode 100644
index 9723ac5f9e..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<index>
- <entry keyword="structured text editors">
- <entry keyword="overview">
- <topic href="topics/csrcedt004.html#csrcedt004" title="Structured text editors for markup languages"/>
- </entry>
- <entry keyword="preferences">
- <topic href="topics/tsrcedt025.html#tsrcedt025" title="Setting preferences for structured text editors"/>
- </entry>
- <entry keyword="content assistance">
- <entry keyword="text editors">
- <topic href="topics/tsrcedt005.html#tsrcedt005" title="Getting content assistance in structured text editors"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/csrcedt006.html#csrcedt006" title="Content assist"/>
- </entry>
- </entry>
- <entry keyword="text search">
- <topic href="topics/tsrcedt007.html#tsrcedt007" title="Searching or finding text within a file"/>
- </entry>
- <entry keyword="spell check">
- <topic href="topics/tsrcedt010.html#tsrcedt010" title="Checking spelling"/>
- </entry>
- </entry>
- <entry keyword="templates">
- <entry keyword="structured text editors">
- <topic href="topics/csrcedt004.html#csrcedt004" title="Structured text editors for markup languages"/>
- </entry>
- <entry keyword="markup languages">
- <topic href="topics/tsrcedt027.html#tsrcedt027" title="Adding and removing markup language templates - overview"/>
- </entry>
- <entry keyword="HTML">
- <topic href="topics/tsrcedt024.html#tsrcedt024" title="Adding and removing HTML templates"/>
- </entry>
- <entry keyword="JSP pages">
- <topic href="topics/tsrcedt028.html#tsrcedt028" title="Adding and removing JSP templates"/>
- </entry>
- <entry keyword="XML">
- <topic href="topics/tsrcedt029.html#tsrcedt027" title="Adding and removing XML templates"/>
- </entry>
- </entry>
- <entry keyword="markup languages">
- <entry keyword="editing text">
- <topic href="topics/tsrcedt000.html#tsrcedt000" title="Editing text coded in markup languages - overview"/>
- </entry>
- <entry keyword="setting annotation preferences">
- <topic href="topics/tsrcedt001.html#tsrcedt001" title="Setting annotation preferences for markup languages"/>
- </entry>
- <entry keyword="templates">
- <topic href="topics/tsrcedt027.html#tsrcedt027" title="Adding and removing markup language templates - overview"/>
- </entry>
- </entry>
- <entry keyword="text">
- <entry keyword="editing in markup languages">
- <topic href="topics/tsrcedt000.html#tsrcedt000" title="Editing text coded in markup languages - overview"/>
- </entry>
- </entry>
- <entry keyword="validation">
- <entry keyword="source versus batch">
- <topic href="topics/cvalidate.html#csrcedt001" title="Source and batch validation"/>
- </entry>
- </entry>
- <entry keyword="annotations">
- <entry keyword="markup language settings">
- <topic href="topics/tsrcedt001.html#tsrcedt001" title="Setting annotation preferences for markup languages"/>
- </entry>
- </entry>
- <entry keyword="content assistance">
- <entry keyword="structured text editors">
- <topic href="topics/tsrcedt005.html#tsrcedt005" title="Getting content assistance in structured text editors"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/csrcedt006.html#csrcedt006" title="Content assist"/>
- </entry>
- <entry keyword="enabling for JSP files">
- <topic href="topics/tsrcedt023.html#tsrcedt023" title="Enabling content assist for JSP files"/>
- </entry>
- </entry>
- <entry keyword="JSP files">
- <entry keyword="enabling content assistance">
- <topic href="topics/tsrcedt023.html#tsrcedt023" title="Enabling content assist for JSP files"/>
- </entry>
- <entry keyword="character encoding">
- <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
- </entry>
- <entry keyword="templates">
- <topic href="topics/tsrcedt028.html#tsrcedt028" title="Adding and removing JSP templates"/>
- </entry>
- </entry>
- <entry keyword="content types">
- <entry keyword="mapping file extensions">
- <topic href="topics/tcontenttype.html#tcontenttype" title="Associating editors with additional files types"/>
- </entry>
- </entry>
- <entry keyword="file extensions">
- <entry keyword="mapping content types">
- <topic href="topics/tcontenttype.html#tcontenttype" title="Associating editors with additional files types"/>
- </entry>
- </entry>
- <entry keyword="file types">
- <entry keyword="editors">
- <topic href="topics/tcontenttype.html#tcontenttype" title="Associating editors with additional files types"/>
- </entry>
- </entry>
- <entry keyword="character encoding">
- <entry keyword="location in files">
- <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
- </entry>
- </entry>
- <entry keyword="XHTML">
- <entry keyword="character encoding">
- <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
- </entry>
- </entry>
- <entry keyword="XML">
- <entry keyword="character encoding">
- <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
- </entry>
- <entry keyword="adding templates">
- <topic href="topics/tsrcedt029.html#tsrcedt027" title="Adding and removing XML templates"/>
- </entry>
- </entry>
- <entry keyword="spell check">
- <entry keyword="structured text editors">
- <topic href="topics/tsrcedt010.html#tsrcedt010" title="Checking spelling"/>
- </entry>
- </entry>
- <entry keyword="HTML">
- <entry keyword="templates">
- <entry keyword="removing">
- <topic href="topics/tsrcedt024.html#tsrcedt024" title="Adding and removing HTML templates"/>
- </entry>
- <entry keyword="adding">
- <topic href="topics/tsrcedt024.html#tsrcedt024" title="Adding and removing HTML templates"/>
- </entry>
- </entry>
- </entry>
- <entry keyword="snippets">
- <entry keyword="overview">
- <topic href="topics/tsrcedt026.html#tsrcedt026" title="Editing with snippets - overview"/>
- </entry>
- <entry keyword="drawer customization">
- <topic href="topics/tsrcedt014.html#tsrcedt014" title="Adding snippets drawers"/>
- </entry>
- <entry keyword="drawers">
- <topic href="topics/tsrcedt015.html#tsrcedt015" title="Adding items to snippets drawers"/>
- </entry>
- <entry keyword="editing items">
- <topic href="topics/tsrcedt022.html#tsrcedt022" title="Editing snippet items"/>
- </entry>
- <entry keyword="modifying drawers">
- <topic href="topics/tsrcedt016.html#tsrcedt016" title="Deleting or hiding snippet items or drawers"/>
- </entry>
- </entry>
- <entry keyword="Snippets view">
- <entry keyword="overview">
- <topic href="topics/csrcedt001.html#csrcedt001" title="Snippets view"/>
- </entry>
- </entry>
- <entry keyword="drawers">
- <entry keyword="snippets view">
- <topic href="topics/tsrcedt016.html#tsrcedt016" title="Deleting or hiding snippet items or drawers"/>
- </entry>
- </entry>
-</index> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/plugin.properties b/docs/org.eclipse.wst.sse.doc.user/plugin.properties
deleted file mode 100644
index 426f3b796f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.sse.doc.user
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-Bundle-Name.0 = Structured text editor and snippets documentation \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/plugin.xml b/docs/org.eclipse.wst.sse.doc.user/plugin.xml
deleted file mode 100644
index 8255056dbd..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2001, 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
- *******************************************************************************/ -->
-
-<!-- ===================================================== -->
-<!-- This is the plug-in for declaring the help pages -->
-<!-- for the structured text editors (source editors). -->
-<!-- ===================================================== -->
-
-<plugin>
-
- <extension point="org.eclipse.help.toc">
- <toc file="sse_toc.xml"/>
- <index path="index/"/>
- </extension>
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.sse.doc.userindex.xml"/>
-</extension>
-
-</plugin>
diff --git a/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap b/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap
deleted file mode 100644
index f80b59b28a..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map id="wstssetoc" linking="none" title="Editing text coded in markup languages - overview">
-<topicref href="topics/csrcedt004.dita" navtitle="Structured text editors">
-<topicref href="topics/tsrcedt000.dita" locktitle="yes" navtitle="Editing text coded in markup languages "
-type="task">
-<topicref href="topics/cvalidate.dita" navtitle="Source and batch validation"
-type="concept"></topicref>
-<topicref href="topics/tsrcedt025.dita" navtitle="Setting preferences for structured text editors"
-type="task">
-<topicref href="topics/tsrcedt001.dita" navtitle="Setting annotation preferences for markup languages"
-type="task"></topicref>
-</topicref>
-<topicref href="topics/tsrcedt005.dita" navtitle="Getting content assistance in structured text editors"
-type="task">
-<topicref href="topics/csrcedt006.dita" navtitle="Content assist" type="concept">
-</topicref>
-<topicref href="topics/tsrcedt023.dita" navtitle="Making content assist work for JSP files"
-type="task"></topicref>
-</topicref>
-<topicref href="topics/tcontenttype.dita" navtitle="Associating editors with file types"
-type="task"></topicref>
-<topicref href="topics/cencoding.dita" navtitle="File Encoding" type="concept">
-</topicref>
-<topicref href="topics/tsrcedt007.dita" navtitle="Searching or finding text within a file"
-type="task"></topicref>
-<topicref href="topics/tsrcedt010.dita" navtitle="Checking spelling" type="task">
-</topicref>
-<topicref href="topics/tsrcedt027.dita" navtitle="Adding and removing markup language templates - overview"
-type="task">
-<topicref href="topics/tsrcedt024.dita" navtitle="Adding and removing HTML templates"
-type="task"></topicref>
-<topicref href="topics/tsrcedt028.dita" navtitle="Adding and removing JSP templates"
-type="task"></topicref>
-<topicref href="topics/tsrcedt029.dita" navtitle="Adding and removing XML templates"
-type="task"></topicref>
-</topicref>
-<topicref href="topics/tsrcedt026.dita" navtitle="Editing with snippets - overview"
-type="task">
-<topicref href="topics/csrcedt001.dita" navtitle="Snippets view" type="concept">
-</topicref>
-<topicref href="topics/tsrcedt014.dita" navtitle="Adding snippets drawers"
-type="task"></topicref>
-<topicref href="topics/tsrcedt015.dita" navtitle="Adding items to snippets drawers"
-type="task"></topicref>
-<topicref href="topics/tsrcedt022.dita" navtitle="Editing snippet items" type="task">
-</topicref>
-<topicref href="topics/tsrcedt016.dita" navtitle="Deleting or hiding snippet items or drawers"
-type="task"></topicref>
-</topicref>
-<topicref href="../org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita"
-navtitle="Source editor keyboard shortcuts" scope="peer"></topicref>
-</topicref>
-</topicref>
-</map>
diff --git a/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml b/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml
deleted file mode 100644
index f15361832d..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Editing text coded in markup languages - overview" topic="topics/csrcedt004.html">
-<topic label="Structured text editors" href="topics/csrcedt004.html">
-<topic label="Editing text coded in markup languages " href="topics/tsrcedt000.html">
-<topic label="Source and batch validation" href="topics/cvalidate.html"/>
-<topic label="Setting preferences for structured text editors" href="topics/tsrcedt025.html">
-<topic label="Setting annotation preferences for markup languages" href="topics/tsrcedt001.html"/>
-</topic>
-<topic label="Getting content assistance in structured text editors" href="topics/tsrcedt005.html">
-<topic label="Content assist" href="topics/csrcedt006.html"/>
-<topic label="Making content assist work for JSP files" href="topics/tsrcedt023.html"/>
-</topic>
-<topic label="Associating editors with file types" href="topics/tcontenttype.html"/>
-<topic label="File Encoding" href="topics/cencoding.html"/>
-<topic label="Searching or finding text within a file" href="topics/tsrcedt007.html"/>
-<topic label="Checking spelling" href="topics/tsrcedt010.html"/>
-<topic label="Adding and removing markup language templates - overview" href="topics/tsrcedt027.html">
-<topic label="Adding and removing HTML templates" href="topics/tsrcedt024.html"/>
-<topic label="Adding and removing JSP templates" href="topics/tsrcedt028.html"/>
-<topic label="Adding and removing XML templates" href="topics/tsrcedt029.html"/>
-</topic>
-<topic label="Editing with snippets - overview" href="topics/tsrcedt026.html">
-<topic label="Snippets view" href="topics/csrcedt001.html"/>
-<topic label="Adding snippets drawers" href="topics/tsrcedt014.html"/>
-<topic label="Adding items to snippets drawers" href="topics/tsrcedt015.html"/>
-<topic label="Editing snippet items" href="topics/tsrcedt022.html"/>
-<topic label="Deleting or hiding snippet items or drawers" href="topics/tsrcedt016.html"/>
-</topic>
-<topic label="Source editor keyboard shortcuts" href="../org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html"/>
-</topic>
-</topic>
-</toc>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.dita b/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.dita
deleted file mode 100644
index c7a7322e8f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.dita
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "..\dtd\concept.dtd">
-<concept id="cencoding" xml:lang="en-us">
-<title>File Encoding</title>
-<shortdesc></shortdesc>
-<prolog><metadata>
-<keywords><indexterm>character encoding<indexterm>location in files</indexterm></indexterm>
-<indexterm>JSP files<indexterm>character encoding</indexterm></indexterm>
-<indexterm>XHTML<indexterm>character encoding</indexterm></indexterm>
-<indexterm>XML<indexterm>character encoding</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p> The character encoding in XML, (X)HTML files, and JSP files can be specified
-and invoked in many different ways; however, we recommend that you specify
-the encoding in each one of your source files, for that is where many XML,
-HTML, JSP editors expect to find the encoding.</p>
-<p>For example, for JSP files, you might use the pageEncoding attribute and/or
-the contentType attribute in the page directive, as shown in the following
-example:<codeblock>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%&gt;
-</codeblock></p>
-<p>For XML files, you might use the encoding pseudo-attribute in the xml declaration
-at the start of a document or the text declaration at the start of an entity,
-as in the following example: <codeblock>&lt;?xml version="1.0" encoding="iso-8859-1" ?></codeblock></p>
-<p>For (X)HTML files, you might use the &lt;meta&gt; tag inside the &lt;head&gt;
-tags, as shown in the following example:<codeblock>&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /></codeblock></p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html b/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html
deleted file mode 100644
index 1b63f4d240..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="File Encoding" />
-<meta name="abstract" content="" />
-<meta name="description" content="" />
-<meta content="character encoding, location in files, JSP files, XHTML, XML" name="DC.subject" />
-<meta content="character encoding, location in files, JSP files, XHTML, XML" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cencoding" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>File Encoding</title>
-</head>
-<body id="cencoding"><a name="cencoding"><!-- --></a>
-
-
-<h1 class="topictitle1">File Encoding</h1>
-
-
-
-<div><p />
-
-<p> The character encoding in XML, (X)HTML files, and JSP files can be specified
-and invoked in many different ways; however, we recommend that you specify
-the encoding in each one of your source files, for that is where many XML,
-HTML, JSP editors expect to find the encoding.</p>
-
-<div class="p">For example, for JSP files, you might use the pageEncoding attribute and/or
-the contentType attribute in the page directive, as shown in the following
-example:<pre>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%&gt;
-</pre>
-</div>
-
-<div class="p">For XML files, you might use the encoding pseudo-attribute in the xml declaration
-at the start of a document or the text declaration at the start of an entity,
-as in the following example: <pre>&lt;?xml version="1.0" encoding="iso-8859-1" ?&gt;</pre>
-</div>
-
-<div class="p">For (X)HTML files, you might use the &lt;meta&gt; tag inside the &lt;head&gt;
-tags, as shown in the following example:<pre>&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;</pre>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.dita b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.dita
deleted file mode 100644
index 7f85c95b4e..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.dita
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "..\dtd\concept.dtd">
-<concept id="csrcedt001" xml:lang="en-us">
-<title>Snippets view</title>
-<shortdesc>The Snippets view lets you catalog and organize reusable programming
-objects, such as HTML tagging, <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="JavaScript">JavaScript</tm>, and JSP code, along with
-files and custom JSP tags.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>Snippets view<indexterm>overview</indexterm></indexterm>
-
-</keywords>
-</metadata></prolog>
-<conbody>
-<p> The Snippets view can be extended based on additional objects that you
-define and include. To view or collapse the objects in a specific drawer,
-click the drawer name.</p>
-<p>The Snippets view has the following features: <ul>
-<li>Drag-and-drop to various source editing pages: You can drag items from
-the view into the active editor and the text will be dropped into the document
-at the cursor location </li>
-<li>Double-click support: You can double-click on an item and have it inserted
-at the current cursor position in the active editor </li>
-<li>User-defined drawers and items: You can define, edit, and remove items
-from view drawers as desired.</li>
-<li>Plug-in-defined drawers and items: Plug-in developers can contribute a
-default list of items to their own drawers.</li>
-<li>Variables in insertions: By default, items will be edited using a dialog
-and, when inserted, you will be prompted for values for each of the variables.</li>
-<li>Customization: You can select which drawers and items are shown in the
-Snippets view.</li>
-<li>Custom insertion: Plug-in developers can customize the behavior of items
-so that when they are dropped during a drag-and-drop action, both the text
-that is inserted and the insertion location are strictly defined.</li>
-</ul></p>
-</conbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
-</link>
-<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
-</link>
-<link href="tsrcedt015.dita"><linktext>Adding items to snippets drawers</linktext>
-</link>
-<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
-<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
-drawers</linktext></link>
-<link href="tsrcedt000.dita"></link>
-</linkpool>
-</related-links>
-</concept>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html
deleted file mode 100644
index 0d53f9d279..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Snippets view" />
-<meta name="abstract" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags." />
-<meta name="description" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags." />
-<meta content="Snippets view, overview" name="DC.subject" />
-<meta content="Snippets view, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="csrcedt001" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Snippets view</title>
-</head>
-<body id="csrcedt001"><a name="csrcedt001"><!-- --></a>
-
-
-<h1 class="topictitle1">Snippets view</h1>
-
-
-
-<div><p>The Snippets view lets you catalog and organize reusable programming
-objects, such as HTML tagging, JavaScriptâ„¢, and JSP code, along with
-files and custom JSP tags.</p>
-
-<p> The Snippets view can be extended based on additional objects that you
-define and include. To view or collapse the objects in a specific drawer,
-click the drawer name.</p>
-
-<div class="p">The Snippets view has the following features: <ul>
-<li>Drag-and-drop to various source editing pages: You can drag items from
-the view into the active editor and the text will be dropped into the document
-at the cursor location </li>
-
-<li>Double-click support: You can double-click on an item and have it inserted
-at the current cursor position in the active editor </li>
-
-<li>User-defined drawers and items: You can define, edit, and remove items
-from view drawers as desired.</li>
-
-<li>Plug-in-defined drawers and items: Plug-in developers can contribute a
-default list of items to their own drawers.</li>
-
-<li>Variables in insertions: By default, items will be edited using a dialog
-and, when inserted, you will be prompted for values for each of the variables.</li>
-
-<li>Customization: You can select which drawers and items are shown in the
-Snippets view.</li>
-
-<li>Custom insertion: Plug-in developers can customize the behavior of items
-so that when they are dropped during a drag-and-drop action, both the text
-that is inserted and the insertion location are strictly defined.</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
-<div><a href="tsrcedt015.html" title="">Adding items to snippets drawers</a></div>
-<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
-<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
-drawers</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages - overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita
deleted file mode 100644
index 2528094a11..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2009, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "..\dtd\concept.dtd">
-<?Pub Sty _display FontColor="red"?>
-<concept id="csrcedt004" xml:lang="en-us">
-<title>Structured text editors for markup languages</title>
-<titlealts>
-<navtitle>Structured text editors</navtitle>
-</titlealts>
-<shortdesc><q>Structured text editor</q> is any of several text editors
-that you can use to edit various markup languages such as HTML, JavaScript,
-or XML.</shortdesc>
-<prolog><metadata>
-<keywords><keyword>source editors</keyword></keywords>
-</metadata></prolog>
-<conbody>
-<p><indexterm>structured text editors<indexterm>overview</indexterm></indexterm> <indexterm>templates<indexterm>structured
-text editors</indexterm></indexterm> The structured text editor is
-represented by various editors that you can use to edit files coded
-with markup tags:</p>
-<table>
-<tgroup cols="3"><colspec colname="col1" colwidth="89*"/><colspec
-colname="col2" colwidth="134*"/><colspec colname="COLSPEC0"
-colwidth="69*"/>
-<thead>
-<row>
-<entry colname="col1" valign="top">File type</entry>
-<entry colname="col2" valign="top">Editor</entry>
-<entry colname="COLSPEC0" valign="top">Content assist?</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="col1">Cascading style sheet</entry>
-<entry colname="col2">CSS source page editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-<row>
-<entry colname="col1">Document type definitions</entry>
-<entry colname="col2">DTD source page editor</entry>
-<entry colname="COLSPEC0">No</entry>
-</row>
-<row>
-<entry colname="col1">HTML</entry>
-<entry colname="col2">HTML source page editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-<row>
-<entry colname="col1"><tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm></entry>
-<entry colname="col2"><tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> source
-page editor or source tab of JavaScript editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-<row>
-<entry colname="col1">JSP</entry>
-<entry colname="col2">JSP source page editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-<row>
-<entry colname="col1">XML</entry>
-<entry colname="col2">Source tab of XML editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-<row>
-<entry colname="col1">XSD (schema)</entry>
-<entry colname="col2">Source tab of XML schema editor</entry>
-<entry colname="COLSPEC0">Yes</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<p>You can access the structured text editor by right-clicking on
-a relevant file name in Navigator or Package Explorer view and then
-clicking <uicontrol>Open With</uicontrol> and selecting the editor
-mentioned above.</p>
-<p>The structured text editor provides a consistent interface regardless
-of the markup language with which it is associated. It provides capabilities
-such as find and replace, undo, redo, a spelling checker, and coding
-assistance (unless otherwise noted). It also highlights syntax in
-different colors. Following is a brief description of some of the
-structured text editor's capabilities:</p>
-<dl><dlentry>
-<dt>syntax highlighting</dt>
-<dd>Each keyword type and syntax type is highlighted differently,
-enabling you to easily find a certain kind of keyword for editing.
-For example, in HTML, element names, attribute names, attribute values,
-and comments have different colors; in <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm>,
-function and variable names, quoted text strings, and comments have
-different colors.</dd>
-</dlentry><dlentry>
-<dt>unlimited undo and redo</dt>
-<dd>These options allow you to incrementally undo and redo every change
-made to a file for the entire editing session. For text, changes are
-incremented one character or set of selected characters at a time.</dd>
-</dlentry><dlentry>
-<dt>content assist</dt>
-<dd>Content assist helps you to insert <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> functions,
-HTML tags, or other keywords. Choices available in the content assist
-list are based on functions defined by the syntax of the language
-in which the file is coded.</dd>
-</dlentry><dlentry>
-<dt>user-defined templates and snippets</dt>
-<dd>By using the Snippets view, you can access user-defined code snippets
-and (for all code types except <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm>)
-templates to help you quickly add regularly used text strings.</dd>
-</dlentry><dlentry>
-<dt>function selection</dt>
-<dd>Based on the location of your cursor, the function or tag selection
-indicator highlights the line numbers that include a function or tag
-in the vertical ruler on the left area of the Source page.</dd>
-</dlentry><dlentry>
-<dt>pop-up menu options</dt>
-<dd>These are the same editing options available in the workbench <uicontrol>Edit</uicontrol> menu.</dd>
-</dlentry><dlentry>
-<dt>code folding</dt>
-<dd>Code folding allows collapsing and expanding of text and can be
-accessed by the <uicontrol>Folding</uicontrol> option in the pop-up
-menu.</dd>
-</dlentry></dl><?Pub Caret 1471?>
-</conbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt006.dita"><linktext>Content assist</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt000.dita"></link>
-</linkpool>
-</related-links>
-</concept>
-<?Pub *0000005543?>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html
deleted file mode 100644
index eec08670d8..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Structured text editors for markup languages" />
-<meta name="abstract" content="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML." />
-<meta name="description" content="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML." />
-<meta content="source editors" name="DC.subject" />
-<meta content="source editors" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="csrcedt004" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Structured text editors for markup languages</title>
-</head>
-<body id="csrcedt004"><a name="csrcedt004"><!-- --></a>
-
-
-<h1 class="topictitle1">Structured text editors for markup languages</h1>
-
-
-
-
-<div><p><span class="q">"Structured text editor"</span> is any of several text editors that
-you can use to edit various markup languages such as HTML, JavaScript, or
-XML.</p>
-
-<p>
-
-
-The structured text editor is represented by various editors that you can
-use to edit files coded with markup tags:</p>
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr>
-<th valign="top" width="30.47945205479452%" id="N10086">File type</th>
-
-<th valign="top" width="45.89041095890411%" id="N1008E">Editor</th>
-
-<th valign="top" width="23.63013698630137%" id="N10096">Content assist?</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">Cascading style sheet</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">CSS source page editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">Document type definitions</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">DTD source page editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">No</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">HTML</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">HTML source page editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">JavaScriptâ„¢</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">JavaScript source page editor or source
-tab of JavaScript editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">JSP</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">JSP source page editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">XML</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">Source tab of XML editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="30.47945205479452%" headers="N10086 ">XSD (schema)</td>
-
-<td valign="top" width="45.89041095890411%" headers="N1008E ">Source tab of XML schema editor</td>
-
-<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-<p>You can access the structured text editor by right-clicking on a relevant
-file name in Navigator or Package Explorer view and then clicking <span class="uicontrol">Open
-With</span> and selecting the editor mentioned above.</p>
-
-<p>The structured text editor provides a consistent interface regardless of
-the markup language with which it is associated. It provides capabilities
-such as find and replace, undo, redo, a spelling checker, and coding assistance
-(unless otherwise noted). It also highlights syntax in different colors. Following
-is a brief description of some of the structured text editor's capabilities:</p>
-
-<dl>
-<dt class="dlterm">syntax highlighting</dt>
-
-<dd>Each keyword type and syntax type is highlighted differently, enabling
-you to easily find a certain kind of keyword for editing. For example, in
-HTML, element names, attribute names, attribute values, and comments have
-different colors; in JavaScript, function and variable
-names, quoted text strings, and comments have different colors.</dd>
-
-
-<dt class="dlterm">unlimited undo and redo</dt>
-
-<dd>These options allow you to incrementally undo and redo every change made
-to a file for the entire editing session. For text, changes are incremented
-one character or set of selected characters at a time.</dd>
-
-
-<dt class="dlterm">content assist</dt>
-
-<dd>Content assist helps you to insert JavaScript functions, HTML tags, or
-other keywords. Choices available in the content assist list are based on
-functions defined by the syntax of the language in which the file is coded.</dd>
-
-
-<dt class="dlterm">user-defined templates and snippets</dt>
-
-<dd>By using the Snippets view, you can access user-defined code snippets
-and (for all code types except JavaScript) templates to help you
-quickly add regularly used text strings.</dd>
-
-
-<dt class="dlterm">function selection</dt>
-
-<dd>Based on the location of your cursor, the function or tag selection indicator
-highlights the line numbers that include a function or tag in the vertical
-ruler on the left area of the Source page.</dd>
-
-
-<dt class="dlterm">pop-up menu options</dt>
-
-<dd>These are the same editing options available in the workbench <span class="uicontrol">Edit</span> menu.</dd>
-
-</dl>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt006.html" title="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion.">Content assist</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages - overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita
deleted file mode 100644
index 2dbfe9d6cd..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "..\dtd\concept.dtd">
-<concept id="csrcedt006" xml:lang="en-us">
-<title>Content assist</title>
-<shortdesc>Content assist helps you insert or finish a tag or function or
-finish a line of code in a structured text editor. The placement of the cursor
-in the source file provides the context for the content assist to offer suggestions
-for completion.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="csrcedt006|1|contentassistanceoverview" status="new">content
-assistance<indexterm>overview</indexterm></indexterm><indexterm keyref="csrcedt006|2|structuredtexteditorscontentassistance"
-status="changed">structured text editors<indexterm>content assistance<indexterm>overview</indexterm></indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>Most of the structured text editors have content assist. For a list of
-editors that have content assist, see <xref href="csrcedt004.dita" type="concept">Structured
-text editors for markup languages</xref>. For information on how to get content
-assistance, see <xref href="tsrcedt005.dita" type="task">Getting content assistance
-in structured text editors</xref></p>
-<p>The sections below describe specifics of HTML content assist, <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> content
-assist, and JSP content assist.</p>
-<section><title>HTML content assist</title><p>HTML is flexible in that some
-HTML elements allow end tags to be optionally omitted, such as <codeph>P</codeph>, <codeph>DT</codeph>, <codeph>DD</codeph>, <codeph>LI</codeph>, <codeph
->THEAD</codeph>, <codeph>TR</codeph>, <codeph>TD</codeph>, <codeph>TH</codeph>,
-and so on. Other HTML elements that are defined to have no content may require
-the end tag always be omitted, such as <codeph>BR</codeph>, <codeph>HR</codeph>, <codeph>LINK</codeph>, <codeph>META</codeph>,
-and <codeph>IMG</codeph>. This flexibility makes the content assist function
-within the HTML source page editor less precise than it might be with a more
-rigidly constrained markup language.</p><p>HTML content assist is most beneficial
-when you need to complete a tag name, add an attribute name-value pair within
-a start tag, or select from an enumerated list of attribute values.</p><p>Although
-content assist only shows attribute names that have not already been specified
-in a start tag, it does not take into account grammar constraints for tags.
-For example, the <codeph>HEAD</codeph> element in HTML only permits zero or
-one occurrences of a <codeph>TITLE</codeph> tag in its content. If you prompt
-for content assist within a <codeph>HEAD</codeph> content that already contains
-a <codeph>TITLE</codeph> tag, content assist will still show <codeph>TITLE</codeph> in
-its proposal list.</p><p>However, if an attribute is required according to
-the DTD/Schema, that attribute will show up at the top of the list, with a
-yellow circle indicator on its icon.</p><p>If your cursor is in a position
-where content assist is available, a pop-up list of available choices is displayed.
-The list is based on the context. For example, if you use content assist directly
-after an opening paragraph tag (<codeph>&lt;p></codeph>) , the first item
-in the content assist list will be the corresponding closing paragraph (<codeph>&lt;/p></codeph>)
-tag.</p><p>The content assist list displays all available tags for the current
-cursor position, including templates. The picture below shows the default
-content assist list for a paragraph tag example:<image alt="HTML Content assist"
-href="../images/ncontass.gif" placement="break"></image></p><p>Tag proposals
-are listed alphabetically. If you type a <codeph>&lt;</codeph> (to begin a
-new tag) before prompting for content assist, and begin typing the first one
-or two letters of the tag that you want to add, the proposal list automatically
-refreshes to reflect proposals that match the pattern you have typed. If you
-do not type a <codeph>&lt;</codeph> before prompting for content assist, you
-can click within the proposal list and then type the letter that the tag begins
-with, to reduce (somewhat) the amount of scrolling to locate the desired tag.</p><p>As
-you type the first one or two letters of the attribute names or enumerated
-attribute values that you want to add to a tag, the list automatically refreshes
-to reflect proposals that match the pattern you have typed.</p><note type="restriction"><image
-alt="For Linux." href="../images/nlinux.gif"></image> When using Linux (Motif
-or GTK) and a DBCS locale, double-clicking on the content assist list can
-sometimes cause the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> VM to terminate. Instead of double-clicking
-on the list, use the arrows and Enter keys to make the selection from the
-list.</note></section>
-<section><title>JSP content assist</title><p>You have many options for embedding <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> and
-HTML code in your JSP pages by using content assist.</p><p>All of the JSP
-tags are included both in the template list and in XML format (for example, <codeph>&lt;jsp:expression></codeph>).
-To add JSP scriptlet tags, for example, move the cursor to the appropriate
-position in the file and press Ctrl+Space to use content assist. Select <image
-alt="JSP scriptlet content assist" href="../images/nmacscrp.gif" placement="inline">
-</image> from the proposal list to insert <codeph>&lt;% %></codeph> in the
-document.</p><p>Scriptlets are inserted in a tag <codeph>&lt;% %></codeph>.
-For example: <codeblock>&lt;% System.currentTimeMillis() %></codeblock></p><p>This
-example will evaluate the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> statement to get the current time in
-milliseconds.</p><p>To have the result of the statement inserted in the file,
-put an equals sign (=) in the front of the statement. For example: <codeblock>&lt;b>This is the time : &lt;%= System.currentTimeMillis()%>&lt;/b></codeblock
-></p><p>When you are within a scriptlet you are writing pure <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> code.
-Therefore, content assist works exactly the same as it does for the <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> editor.
-For example, if you request content assist after <codeph>System</codeph>,
-content assist displays a list of methods. <note><tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> content assist works only in a Web
-project, because it requires a buildpath to find the appropriate <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> classes.</note></p><p>There
-are also special tags such as useBean. For example: <codeblock>&lt;jsp:useBean id="useBean" class="java.lang.String"/></codeblock></p><p>The
-useBean tag enables you to create a bean called <codeph>aString</codeph> of
-type <codeph>String</codeph>. Then when you use content assist, this is recognized
-as a declared variable. For example, if you use content assist after <codeph>aString</codeph>,
-as follows:</p><p> <codeblock>&lt;% aString. %> </codeblock>the content assist
-list shows available methods. This is because <codeph>aString</codeph> has
-been declared as a bean of type String.</p><p>If you use content assist after
-the <codeph>a</codeph>, as follows: <codeblock>&lt;% a %> </codeblock>content
-assist knows that <codeph>aString</codeph> exists, and it is shown in the
-content assist list.</p></section>
-</conbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt005.dita"><linktext>Getting content assistance in structured
-text editors</linktext></link>
-<link href="tsrcedt024.dita"><linktext>Adding and removing HTML templates</linktext>
-</link>
-</linkpool>
-</related-links>
-</concept>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html
deleted file mode 100644
index a704679db9..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Content assist" />
-<meta name="abstract" content="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion." />
-<meta name="description" content="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion." />
-<meta content="content assistance, overview, structured text editors, content assistance" name="DC.subject" />
-<meta content="content assistance, overview, structured text editors, content assistance" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt005.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="csrcedt006" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Content assist</title>
-</head>
-<body id="csrcedt006"><a name="csrcedt006"><!-- --></a>
-
-
-<h1 class="topictitle1">Content assist</h1>
-
-
-
-<div><p>Content assist helps you insert or finish a tag or function or
-finish a line of code in a structured text editor. The placement of the cursor
-in the source file provides the context for the content assist to offer suggestions
-for completion.</p>
-
-<p>Most of the structured text editors have content assist. For a list of
-editors that have content assist, see <a href="csrcedt004.html">Structured text editors for markup languages</a>. For information on how to get content
-assistance, see <a href="tsrcedt005.html">Getting content assistance in structured text editors</a></p>
-
-<p>The sections below describe specifics of HTML content assist, JavaScriptâ„¢ content
-assist, and JSP content assist.</p>
-
-<div class="section"><h4 class="sectiontitle">HTML content assist</h4><p>HTML is flexible in that some
-HTML elements allow end tags to be optionally omitted, such as <samp class="codeph">P</samp>, <samp class="codeph">DT</samp>, <samp class="codeph">DD</samp>, <samp class="codeph">LI</samp>, <samp class="codeph">THEAD</samp>, <samp class="codeph">TR</samp>, <samp class="codeph">TD</samp>, <samp class="codeph">TH</samp>,
-and so on. Other HTML elements that are defined to have no content may require
-the end tag always be omitted, such as <samp class="codeph">BR</samp>, <samp class="codeph">HR</samp>, <samp class="codeph">LINK</samp>, <samp class="codeph">META</samp>,
-and <samp class="codeph">IMG</samp>. This flexibility makes the content assist function
-within the HTML source page editor less precise than it might be with a more
-rigidly constrained markup language.</p>
-<p>HTML content assist is most beneficial
-when you need to complete a tag name, add an attribute name-value pair within
-a start tag, or select from an enumerated list of attribute values.</p>
-<p>Although
-content assist only shows attribute names that have not already been specified
-in a start tag, it does not take into account grammar constraints for tags.
-For example, the <samp class="codeph">HEAD</samp> element in HTML only permits zero or
-one occurrences of a <samp class="codeph">TITLE</samp> tag in its content. If you prompt
-for content assist within a <samp class="codeph">HEAD</samp> content that already contains
-a <samp class="codeph">TITLE</samp> tag, content assist will still show <samp class="codeph">TITLE</samp> in
-its proposal list.</p>
-<p>However, if an attribute is required according to
-the DTD/Schema, that attribute will show up at the top of the list, with a
-yellow circle indicator on its icon.</p>
-<p>If your cursor is in a position
-where content assist is available, a pop-up list of available choices is displayed.
-The list is based on the context. For example, if you use content assist directly
-after an opening paragraph tag (<samp class="codeph">&lt;p&gt;</samp>) , the first item
-in the content assist list will be the corresponding closing paragraph (<samp class="codeph">&lt;/p&gt;</samp>)
-tag.</p>
-<p>The content assist list displays all available tags for the current
-cursor position, including templates. The picture below shows the default
-content assist list for a paragraph tag example:<br /><img src="../images/ncontass.gif" alt="HTML Content assist" /><br /></p>
-<p>Tag proposals
-are listed alphabetically. If you type a <samp class="codeph">&lt;</samp> (to begin a
-new tag) before prompting for content assist, and begin typing the first one
-or two letters of the tag that you want to add, the proposal list automatically
-refreshes to reflect proposals that match the pattern you have typed. If you
-do not type a <samp class="codeph">&lt;</samp> before prompting for content assist, you
-can click within the proposal list and then type the letter that the tag begins
-with, to reduce (somewhat) the amount of scrolling to locate the desired tag.</p>
-<p>As
-you type the first one or two letters of the attribute names or enumerated
-attribute values that you want to add to a tag, the list automatically refreshes
-to reflect proposals that match the pattern you have typed.</p>
-<div class="restriction"><span class="restrictiontitle">Restriction:</span> <img src="../images/nlinux.gif" alt="For Linux." /> When using Linux (Motif
-or GTK) and a DBCS locale, double-clicking on the content assist list can
-sometimes cause the Javaâ„¢ VM to terminate. Instead of double-clicking
-on the list, use the arrows and Enter keys to make the selection from the
-list.</div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">JSP content assist</h4><p>You have many options for embedding Java and
-HTML code in your JSP pages by using content assist.</p>
-<p>All of the JSP
-tags are included both in the template list and in XML format (for example, <samp class="codeph">&lt;jsp:expression&gt;</samp>).
-To add JSP scriptlet tags, for example, move the cursor to the appropriate
-position in the file and press Ctrl+Space to use content assist. Select <img src="../images/nmacscrp.gif" alt="JSP scriptlet content assist" /> from the proposal list to insert <samp class="codeph">&lt;% %&gt;</samp> in the
-document.</p>
-<div class="p">Scriptlets are inserted in a tag <samp class="codeph">&lt;% %&gt;</samp>.
-For example: <pre>&lt;% System.currentTimeMillis() %&gt;</pre>
-</div>
-<p>This
-example will evaluate the Java statement to get the current time in
-milliseconds.</p>
-<div class="p">To have the result of the statement inserted in the file,
-put an equals sign (=) in the front of the statement. For example: <pre>&lt;b&gt;This is the time : &lt;%= System.currentTimeMillis()%&gt;&lt;/b&gt;</pre>
-</div>
-<div class="p">When you are within a scriptlet you are writing pure Java code.
-Therefore, content assist works exactly the same as it does for the Java editor.
-For example, if you request content assist after <samp class="codeph">System</samp>,
-content assist displays a list of methods. <div class="note"><span class="notetitle">Note:</span> Java content assist works only in a Web
-project, because it requires a buildpath to find the appropriate Java classes.</div>
-</div>
-<div class="p">There
-are also special tags such as useBean. For example: <pre>&lt;jsp:useBean id="useBean" class="java.lang.String"/&gt;</pre>
-</div>
-<p>The
-useBean tag enables you to create a bean called <samp class="codeph">aString</samp> of
-type <samp class="codeph">String</samp>. Then when you use content assist, this is recognized
-as a declared variable. For example, if you use content assist after <samp class="codeph">aString</samp>,
-as follows:</p>
-<div class="p"> <pre>&lt;% aString. %&gt; </pre>
-the content assist
-list shows available methods. This is because <samp class="codeph">aString</samp> has
-been declared as a bean of type String.</div>
-<div class="p">If you use content assist after
-the <samp class="codeph">a</samp>, as follows: <pre>&lt;% a %&gt; </pre>
-content
-assist knows that <samp class="codeph">aString</samp> exists, and it is shown in the
-content assist list.</div>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt005.html" title="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor.">Getting content assistance in structured
-text editors</a></div>
-<div><a href="tsrcedt024.html" title="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing HTML templates</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita
deleted file mode 100644
index c430e77feb..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "..\dtd\concept.dtd">
-<concept id="csrcedt001" xml:lang="en-us">
-<title>Source and batch validation</title>
-<shortdesc></shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="cvalidate|1|validationsourcevsbatch" status="changed">validation<indexterm>source
-versus batch</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>There are two types of validation that can occur when you are working with
-source files in a structured source editor: source validation and batch validation. </p>
-<p>Source validation occurs as you type your code; this validation reflects
-the "unsaved" and "unbuilt" contents of the source you are editing. For example,
-if you were to type the following code in a JSP editor:<lines><codeph>&lt;foo:bar></codeph></lines>where <codeph>foo:bar</codeph>is
-a tag that does not exist, the problem would be discovered immediately and
-would appear underlined in the editor. The advantage of this type of validation
-is that it can alert you to errors instantly.<note>To turn source validation
-on (or off) for all structured text editors, click <menucascade><uicontrol>Window</uicontrol>
-<uicontrol>Preferences</uicontrol><uicontrol>General</uicontrol><uicontrol>Editors</uicontrol>
-<uicontrol>Structured Text Editors</uicontrol></menucascade> and check (or
-uncheck) <b>Report problems as you type</b>.</note></p>
-<p>Batch validation occurs on saved files. It can catch build process errors
-and other errors that the source validator cannot. For example, suppose you
-typed the following in a JSP editor:<lines>
-<codeph>&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%></codeph></lines>In
-this example, the same prefix is used twice. This would prompt the batch validator
-to trigger markers and to generate build warnings in the Problems view and
-in the Navigator. </p>
-<p>Batch validation can uncover errors in multiple files at once and give
-you a comprehensive view of where problematic code can be found in your project.
-Moreover, you do not need to open files in an editor to run batch validation.
-To run batch validation on specific files, select and right click the files
-in the Project Explorer and then select <menucascade><uicontrol>Validate</uicontrol>
-</menucascade> from the popup menu.</p>
-<note>To set preferences for batch validation, click <menucascade><uicontrol>Window</uicontrol>
-<uicontrol>Preferences</uicontrol><uicontrol>Validation</uicontrol></menucascade></note>
-</conbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-</related-links>
-</concept>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html
deleted file mode 100644
index 7796212ba3..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Source and batch validation" />
-<meta name="abstract" content="" />
-<meta name="description" content="" />
-<meta content="validation, source versus batch" name="DC.subject" />
-<meta content="validation, source versus batch" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="csrcedt001" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Source and batch validation</title>
-</head>
-<body id="csrcedt001"><a name="csrcedt001"><!-- --></a>
-
-
-<h1 class="topictitle1">Source and batch validation</h1>
-
-
-
-<div><p />
-
-<p>There are two types of validation that can occur when you are working with
-source files in a structured source editor: source validation and batch validation. </p>
-
-<div class="p">Source validation occurs as you type your code; this validation reflects
-the "unsaved" and "unbuilt" contents of the source you are editing. For example,
-if you were to type the following code in a JSP editor:<p><samp class="codeph">&lt;foo:bar&gt;</samp></p>
-where <samp class="codeph">foo:bar</samp>is
-a tag that does not exist, the problem would be discovered immediately and
-would appear underlined in the editor. The advantage of this type of validation
-is that it can alert you to errors instantly.<div class="note"><span class="notetitle">Note:</span> To turn source validation
-on (or off) for all structured text editors, click <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span>
- &gt; <span class="uicontrol">Structured Text Editors</span></span> and check (or
-uncheck) <strong>Report problems as you type</strong>.</div>
-</div>
-
-<div class="p">Batch validation occurs on saved files. It can catch build process errors
-and other errors that the source validator cannot. For example, suppose you
-typed the following in a JSP editor:<p><br />
-<samp class="codeph">&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt;<br />
-&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt;</samp></p>
-In
-this example, the same prefix is used twice. This would prompt the batch validator
-to trigger markers and to generate build warnings in the Problems view and
-in the Navigator. </div>
-
-<p>Batch validation can uncover errors in multiple files at once and give
-you a comprehensive view of where problematic code can be found in your project.
-Moreover, you do not need to open files in an editor to run batch validation.
-To run batch validation on specific files, select and right click the files
-in the Project Explorer and then select <span class="menucascade"><span class="uicontrol">Validate</span>
-</span> from the popup menu.</p>
-
-<div class="note"><span class="notetitle">Note:</span> To set preferences for batch validation, click <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Validation</span></span></div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.dita
deleted file mode 100644
index c63d1e14b6..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.dita
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tcontenttype" xml:lang="en-us">
-<title>Associating editors with additional files types</title>
-<shortdesc></shortdesc>
-<prolog><metadata>
-<keywords><indexterm>content types<indexterm>mapping file extensions</indexterm></indexterm>
-<indexterm>file extensions<indexterm>mapping content types</indexterm></indexterm>
-<indexterm>file types<indexterm>editors</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>You can associate certain editors with a file type by clicking
-on <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-<uicontrol>General</uicontrol><uicontrol>Editors</uicontrol><uicontrol>File
-Association</uicontrol></menucascade> and setting up the associations in the
-File Associations Window.</p><p>Some Eclipse-based editors, however, will
-only recognize a file based on the contents of the file. Consequently, if
-you want to associate an additional file type with some editors, you may have
-to first map the content type with its file extension. To map a content type
-with a file extension, complete the following steps: </p><ol>
-<li>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>General</uicontrol>
-<uicontrol>Content Types</uicontrol></menucascade>. The Content Type window
-appears. </li>
-<li>Select a content type in the Content Type window, and then select <b>Add</b> .
-The Define a New File Type window appears.</li>
-<li>Type the name of the file type, and then click <b>OK</b>.</li>
-</ol></context>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html b/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html
deleted file mode 100644
index b5f1861e46..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Associating editors with additional files types" />
-<meta name="abstract" content="" />
-<meta name="description" content="" />
-<meta content="content types, mapping file extensions, file extensions, mapping content types, file types, editors" name="DC.subject" />
-<meta content="content types, mapping file extensions, file extensions, mapping content types, file types, editors" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcontenttype" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Associating editors with additional files types</title>
-</head>
-<body id="tcontenttype"><a name="tcontenttype"><!-- --></a>
-
-
-<h1 class="topictitle1">Associating editors with additional files types</h1>
-
-
-
-<div><p />
-
-<div class="section"><p>You can associate certain editors with a file type by clicking
-on <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
- &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">File
-Association</span></span> and setting up the associations in the
-File Associations Window.</p>
-<p>Some Eclipse-based editors, however, will
-only recognize a file based on the contents of the file. Consequently, if
-you want to associate an additional file type with some editors, you may have
-to first map the content type with its file extension. To map a content type
-with a file extension, complete the following steps: </p>
-<ol>
-<li>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">General</span>
- &gt; <span class="uicontrol">Content Types</span></span>. The Content Type window
-appears. </li>
-
-<li>Select a content type in the Content Type window, and then select <strong>Add</strong> .
-The Define a New File Type window appears.</li>
-
-<li>Type the name of the file type, and then click <strong>OK</strong>.</li>
-
-</ol>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.dita
deleted file mode 100644
index 42b7b97f48..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.dita
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt000" xml:lang="en-us">
-<title>Editing text coded in markup languages - overview</title>
-<titlealts>
-<navtitle>Editing markup languages - overview</navtitle>
-</titlealts>
-<shortdesc>You can edit text coded in markup languages with a <term>structured
-text editor</term>. This is a generic term for several editors that you can
-use to edit any of several markup languages, such as HTML.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>markup languages<indexterm>editing text</indexterm></indexterm>
-<indexterm>text<indexterm>editing in markup languages</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>In addition to basic editing tasks such as adding, modifying, and
-deleting text, you can perform the following tasks:</context>
-<steps-unordered>
-<step><cmd><xref href="tsrcedt025.dita" type="task">Set preferences for structured
-text editors</xref></cmd></step>
-<step><cmd><xref href="tsrcedt005.dita" type="task">Get content assistance
-in structured text editors</xref></cmd></step>
-<step><cmd><xref href="tsrcedt007.dita" type="task">Search or find text within
-a file</xref></cmd></step>
-<step><cmd><xref href="tsrcedt010.dita" type="task">Check spelling</xref></cmd>
-</step>
-<step><cmd><xref href="tsrcedt027.dita" type="task">Add or remove markup language
-templates</xref></cmd></step>
-<step><cmd><xref href="tsrcedt026.dita" type="task">Edit with snippets</xref></cmd>
-</step>
-</steps-unordered>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-<link href="csrcedt006.dita"><linktext>Content assist</linktext></link>
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt025.dita"></link>
-<link href="tsrcedt005.dita"></link>
-<link href="tsrcedt007.dita"></link>
-<link href="tsrcedt010.dita"></link>
-<link href="tsrcedt027.dita"></link>
-<link href="tsrcedt026.dita"></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html
deleted file mode 100644
index 5094861a1e..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing text coded in markup languages - overview" />
-<meta name="abstract" content="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML." />
-<meta name="description" content="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML." />
-<meta content="markup languages, editing text, text, editing in markup languages" name="DC.subject" />
-<meta content="markup languages, editing text, text, editing in markup languages" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt025.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt005.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt007.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt010.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt000" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing text coded in markup languages - overview</title>
-</head>
-<body id="tsrcedt000"><a name="tsrcedt000"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing text coded in markup languages - overview</h1>
-
-
-
-
-<div><p>You can edit text coded in markup languages with a <dfn class="term">structured
-text editor</dfn>. This is a generic term for several editors that you can
-use to edit any of several markup languages, such as HTML.</p>
-
-<div class="section">In addition to basic editing tasks such as adding, modifying, and
-deleting text, you can perform the following tasks:</div>
-
-<ul>
-<li><span><a href="tsrcedt025.html">Set preferences for structured text editors</a></span></li>
-
-<li><span><a href="tsrcedt005.html">Get content assistance in structured text editors</a></span></li>
-
-<li><span><a href="tsrcedt007.html">Search or find text within a file</a></span></li>
-
-<li><span><a href="tsrcedt010.html">Check spelling</a></span>
-</li>
-
-<li><span><a href="tsrcedt027.html">Add or remove markup language templates</a></span></li>
-
-<li><span><a href="tsrcedt026.html">Edit with snippets</a></span>
-</li>
-
-</ul>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-<div><a href="csrcedt006.html" title="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion.">Content assist</a></div>
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt025.html" title="">Setting preferences for structured text editors</a></div>
-<div><a href="tsrcedt005.html" title="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor.">Getting content assistance in structured text editors</a></div>
-<div><a href="tsrcedt007.html" title="">Searching or finding text within a file</a></div>
-<div><a href="tsrcedt010.html" title="This documentation describes how to check spelling in a structured text editor.">Checking spelling</a></div>
-<div><a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language templates - overview</a></div>
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita
deleted file mode 100644
index d100c8c2e6..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt001" xml:lang="en-us">
-<title>Setting annotation preferences for markup languages</title>
-<titlealts>
-<navtitle>Setting annotation preferences</navtitle>
-</titlealts>
-<shortdesc>This documentation describes how to set <term>annotation preferences</term> for
-Web and XML files. The annotation preferences include whether to analyze the
-syntactic validity of your file while you are typing and what colors to use
-to highlight errors, warnings, tasks, search results, bookmarks, and other
-text.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tsrcedt001|1|annotationpreferencesmarkuplanguagesettings"
-status="changed">annotations<indexterm>markup language settings</indexterm></indexterm>
-<indexterm keyref="tsrcedt001|2|markuplanguagessettingannotationpreferences"
-status="new">markup languages<indexterm>setting annotation preferences</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>By default, when you edit in a structured text editor, your source
-code is validated as you type it in. Like other Eclipse-based editors, the
-structured text editors for markup languages flag warnings and errors in the
-source code in the editor area. The warnings and errors also show up in the
-Tasks view when you save the file.</p><note>Highlighting is fully dynamic
-with the exception of search results. Search results are highlighted based
-upon what has been saved to disk.</note><note type="tip">You can improve a
-structured text editor's performance by turning off the real-time validation.</note><p>To
-set annotation preferences, complete the following steps:</p> </context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade>.</cmd><stepresult>A Preferences window appears.</stepresult>
-</step>
-<step><cmd>In the Preferences window, click <menucascade><uicontrol>Workbench</uicontrol>
-<uicontrol>Editors</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Select one of the following options:</cmd>
-<choices>
-<choice>To turn off real-time syntax validation, click <uicontrol>Structured
-Text Editor</uicontrol> and uncheck the <uicontrol>Analyze annotations while
-typing</uicontrol> box.</choice>
-<choice>To control other annotation settings, click <uicontrol>Annotations</uicontrol> and
-select your annotation preferences.</choice>
-</choices>
-</step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save your preferences and close
-the page.</cmd></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt025.dita"><linktext>Setting preferences for structured
-text editors</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html
deleted file mode 100644
index 1fca55782f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting annotation preferences for markup languages" />
-<meta name="abstract" content="This documentation describes how to set annotation preferences for Web and XML files. The annotation preferences include whether to analyze the syntactic validity of your file while you are typing and what colors to use to highlight errors, warnings, tasks, search results, bookmarks, and other text." />
-<meta name="description" content="This documentation describes how to set annotation preferences for Web and XML files. The annotation preferences include whether to analyze the syntactic validity of your file while you are typing and what colors to use to highlight errors, warnings, tasks, search results, bookmarks, and other text." />
-<meta content="annotations, markup language settings, markup languages, setting annotation preferences" name="DC.subject" />
-<meta content="annotations, markup language settings, markup languages, setting annotation preferences" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt025.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt001" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting annotation preferences for markup languages</title>
-</head>
-<body id="tsrcedt001"><a name="tsrcedt001"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting annotation preferences for markup languages</h1>
-
-
-
-
-<div><p>This documentation describes how to set <dfn class="term">annotation preferences</dfn> for
-Web and XML files. The annotation preferences include whether to analyze the
-syntactic validity of your file while you are typing and what colors to use
-to highlight errors, warnings, tasks, search results, bookmarks, and other
-text.</p>
-
-<div class="section"> <p>By default, when you edit in a structured text editor, your source
-code is validated as you type it in. Like other Eclipse-based editors, the
-structured text editors for markup languages flag warnings and errors in the
-source code in the editor area. The warnings and errors also show up in the
-Tasks view when you save the file.</p>
-<div class="note"><span class="notetitle">Note:</span> Highlighting is fully dynamic
-with the exception of search results. Search results are highlighted based
-upon what has been saved to disk.</div>
-<div class="tip"><span class="tiptitle">Tip:</span> You can improve a
-structured text editor's performance by turning off the real-time validation.</div>
-<p>To
-set annotation preferences, complete the following steps:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span>.</span> A Preferences window appears.
-</li>
-
-<li class="stepexpand"><span>In the Preferences window, click <span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span></span>.</span></li>
-
-<li class="stepexpand"><span>Select one of the following options:</span>
-<ul>
-<li>To turn off real-time syntax validation, click <span class="uicontrol">Structured
-Text Editor</span> and uncheck the <span class="uicontrol">Analyze annotations while
-typing</span> box.</li>
-
-<li>To control other annotation settings, click <span class="uicontrol">Annotations</span> and
-select your annotation preferences.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> to save your preferences and close
-the page.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt025.html" title="">Setting preferences for structured
-text editors</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita
deleted file mode 100644
index 5083676bef..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt005" xml:lang="en-us">
-<title>Getting content assistance in structured text editors</title>
-<!--Formerly "Using JavaScript content assist"; moved some JavaScript-specific content to csrcedt006.dita ("Content assist")-->
-<titlealts>
-<navtitle>Getting content assistance</navtitle>
-</titlealts>
-<shortdesc>To get help in adding markup to a file, you can use content assist
-in a structured text editor. Content assist helps you insert or finish a tag
-or function or finish a line of code in a structured text editor.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tsrcedt005|1|contentassistancestructuredtexteditors"
-status="new">content assistance<indexterm>structured text editors</indexterm></indexterm>
-<indexterm keyref="tsrcedt005|2|structuredtexteditorscontentassistance" status="changed">structured
-text editors<indexterm>content assistance<indexterm>text editors</indexterm></indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>Content assist also enables you to select and insert templates in
-structured text editors. The placement of the cursor in the source file provides
-the context for the content assist to offer suggestions for completion.</context>
-<steps-unordered>
-<step><cmd></cmd><info>You can request content assist in either of the following
-two ways:</info>
-<choices>
-<choice>From the <uicontrol>Edit</uicontrol> menu, select <uicontrol>Content
-Assist</uicontrol></choice>
-<choice>Press Ctrl+Space</choice>
-</choices>
-<info><p>In addition, you can set a preference that causes content assist
-to pop up automatically when certain characters are typed, such as <codeph>.</codeph> in
-the case of <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="JavaScript">JavaScript</tm> or <codeph>&lt;</codeph> in the case
-of HTML and XML. To set this preference, select <uicontrol>Preferences</uicontrol> from
-the <uicontrol>Window</uicontrol> menu, and then select <uicontrol>Web and
-XML Files</uicontrol>, followed by one of the following sequences:<ul>
-<li><menucascade><uicontrol>HTML Files</uicontrol><uicontrol>HTML Source</uicontrol>
-</menucascade></li>
-<li><menucascade><uicontrol>JavaScript Files</uicontrol><uicontrol>JavaScript
-Source</uicontrol></menucascade></li>
-<li><menucascade><uicontrol>XML Files</uicontrol><uicontrol>XML Source</uicontrol>
-</menucascade></li>
-</ul>In the <uicontrol>Content assist</uicontrol> group box, select the <uicontrol>Automatically
-make suggestions</uicontrol> check box, and supply any additional characters
-that should trigger content assist.</p><p>If your cursor is in a position
-where content assist is available, a pop-up list of all available choices
-is displayed. For each of these choices, a brief description of the code is
-provided.</p></info></step>
-</steps-unordered>
-</taskbody>
-<related-links>
-<!-- <link href="contentassist" type="showme" format="viewlet"><linktext>Show Me</linktext></link> -->
-<linkpool type="concept">
-<link href="csrcedt006.dita"><linktext>Content assist</linktext></link>
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt023.dita"><linktext>Making content assist work for JSP
-files</linktext></link>
-<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
-templates - overview</linktext></link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html
deleted file mode 100644
index fb68fc15f1..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Getting content assistance in structured text editors" />
-<meta name="abstract" content="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor." />
-<meta name="description" content="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor." />
-<meta content="content assistance, structured text editors, structured text editors, text editors" name="DC.subject" />
-<meta content="content assistance, structured text editors, structured text editors, text editors" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt023.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt005" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Getting content assistance in structured text editors</title>
-</head>
-<body id="tsrcedt005"><a name="tsrcedt005"><!-- --></a>
-
-
-<h1 class="topictitle1">Getting content assistance in structured text editors</h1>
-
-
-
-
-
-<div><p>To get help in adding markup to a file, you can use content assist
-in a structured text editor. Content assist helps you insert or finish a tag
-or function or finish a line of code in a structured text editor.</p>
-
-<div class="section">Content assist also enables you to select and insert templates in
-structured text editors. The placement of the cursor in the source file provides
-the context for the content assist to offer suggestions for completion.</div>
-
-
-<div class="p"><span /> You can request content assist in either of the following
-two ways:
-<ul>
-<li>From the <span class="uicontrol">Edit</span> menu, select <span class="uicontrol">Content
-Assist</span></li>
-
-<li>Press Ctrl+Space</li>
-
-</ul>
-
- <div class="p">In addition, you can set a preference that causes content assist
-to pop up automatically when certain characters are typed, such as <samp class="codeph">.</samp> in
-the case of JavaScriptâ„¢ or <samp class="codeph">&lt;</samp> in the case
-of HTML and XML. To set this preference, select <span class="uicontrol">Preferences</span> from
-the <span class="uicontrol">Window</span> menu, and then select <span class="uicontrol">Web and
-XML Files</span>, followed by one of the following sequences:<ul>
-<li><span class="menucascade"><span class="uicontrol">HTML Files</span> &gt; <span class="uicontrol">HTML Source</span>
-</span></li>
-
-<li><span class="menucascade"><span class="uicontrol">JavaScript Files</span> &gt; <span class="uicontrol">JavaScript
-Source</span></span></li>
-
-<li><span class="menucascade"><span class="uicontrol">XML Files</span> &gt; <span class="uicontrol">XML Source</span>
-</span></li>
-
-</ul>
-In the <span class="uicontrol">Content assist</span> group box, select the <span class="uicontrol">Automatically
-make suggestions</span> check box, and supply any additional characters
-that should trigger content assist.</div>
-<p>If your cursor is in a position
-where content assist is available, a pop-up list of all available choices
-is displayed. For each of these choices, a brief description of the code is
-provided.</p>
-</div>
-
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt006.html" title="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion.">Content assist</a></div>
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt023.html" title="Having the proper files defined in the Java build class path is essential for content assist to work properly in JSP files. It is also essential for the links builder to be able to correctly resolve links to servlets or Java beans in JSP and HTML files.">Making content assist work for JSP
-files</a></div>
-<div><a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language
-templates - overview</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.dita
deleted file mode 100644
index 38aa8b613c..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.dita
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt007" xml:lang="en-us">
-<title>Searching or finding text within a file</title>
-<prolog><metadata>
-<keywords><indexterm>structured text editors<indexterm>text search</indexterm></indexterm>
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<prereq><note type="tip">Before you do a Search operation in a structured
-text editor, save the file you are searching. The search function works from
-the most recently saved version of the file rather than from the contents
-that you see in the editor area. You do not need to save your file before
-you do a Find/Replace operation. </note></prereq>
-<context>Each structured text editor provides two ways to locate a text string
-in the file you are editing and optionally replace it with another string: <dl>
-<dlentry>
-<dt>Find/Replace</dt>
-<dd>Lets you locate text in the file currently being edited.</dd>
-</dlentry><dlentry>
-<dt>Search</dt>
-<dd>Lets you locate text in files that have been saved to your workspace.</dd>
-</dlentry></dl><p>To locate and optionally replace text, select one of the
-following menu paths:</p></context>
-<steps-unordered>
-<step><cmd><menucascade><uicontrol>Edit</uicontrol><uicontrol>Find/Replace</uicontrol>
-</menucascade> (or <uicontrol>Ctrl+F</uicontrol>)</cmd><info>This option is
-self-explanatory.</info></step>
-</steps-unordered>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html
deleted file mode 100644
index 2f788edcdd..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Searching or finding text within a file" />
-<meta content="structured text editors, text search" name="DC.subject" />
-<meta content="structured text editors, text search" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt007" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Searching or finding text within a file</title>
-</head>
-<body id="tsrcedt007"><a name="tsrcedt007"><!-- --></a>
-
-
-<h1 class="topictitle1">Searching or finding text within a file</h1>
-
-
-<div>
-<div class="p"><div class="tip"><span class="tiptitle">Tip:</span> Before you do a Search operation in a structured
-text editor, save the file you are searching. The search function works from
-the most recently saved version of the file rather than from the contents
-that you see in the editor area. You do not need to save your file before
-you do a Find/Replace operation. </div>
-</div>
-
-<div class="section">Each structured text editor provides two ways to locate a text string
-in the file you are editing and optionally replace it with another string: <dl>
-
-<dt class="dlterm">Find/Replace</dt>
-
-<dd>Lets you locate text in the file currently being edited.</dd>
-
-
-<dt class="dlterm">Search</dt>
-
-<dd>Lets you locate text in files that have been saved to your workspace.</dd>
-
-</dl>
-<p>To locate and optionally replace text, select one of the
-following menu paths:</p>
-</div>
-
-
-<div class="p"><span><span class="menucascade"><span class="uicontrol">Edit</span> &gt; <span class="uicontrol">Find/Replace</span>
-</span> (or <span class="uicontrol">Ctrl+F</span>)</span> This option is
-self-explanatory.</div>
-
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.dita
deleted file mode 100644
index 4ac6d01c35..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.dita
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt010" xml:lang="en-us">
-<title>Checking spelling</title>
-<shortdesc>This documentation describes how to check spelling in a structured
-text editor.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>spell check<indexterm>structured text editors</indexterm></indexterm><indexterm>structured text editors<indexterm>spell check</indexterm></indexterm>
-
-
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>The structured text editors for markup languages (accessed from
-the Project Explorer's pop-up menu or by clicking the Source tab in certain
-editors) provide a spell checking feature.</p><p>To check spelling in an HTML,
-XML, or other file that uses a structured markup language:</p> </context>
-<steps>
-<step><cmd>(Optional) To select the dictionary that will be used, click <menucascade>
-<uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol><uicontrol>Spell
-Check</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Open in a structured text editor the file whose spelling you want
-to check.</cmd></step>
-<step><cmd>Start the spelling checker by clicking <menucascade><uicontrol>Edit</uicontrol>
-<uicontrol>Spell Check</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Type a new spelling into the <uicontrol>Change to</uicontrol> field,
-or select one of the available options. Click the <uicontrol>Change</uicontrol> button
-to change the current instance of the word in the current document. Click
-the <uicontrol>Change All</uicontrol> button to change all instances of the
-word in the current document. You can also click the <uicontrol>Add</uicontrol> button
-to add the currently selected spelling to your dictionary.</cmd></step>
-<step><cmd>Use the controls in the Spell Check dialog box to ignore, change,
-or add terms to the current dictionary. (To remove a word after it has been
-added to the dictionary, click the <uicontrol>Dictionary</uicontrol> push
-button.)</cmd></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html
deleted file mode 100644
index adc62d381c..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Checking spelling" />
-<meta name="abstract" content="This documentation describes how to check spelling in a structured text editor." />
-<meta name="description" content="This documentation describes how to check spelling in a structured text editor." />
-<meta content="spell check, structured text editors" name="DC.subject" />
-<meta content="spell check, structured text editors" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt010" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Checking spelling</title>
-</head>
-<body id="tsrcedt010"><a name="tsrcedt010"><!-- --></a>
-
-
-<h1 class="topictitle1">Checking spelling</h1>
-
-
-
-<div><p>This documentation describes how to check spelling in a structured
-text editor.</p>
-
-<div class="section"> <p>The structured text editors for markup languages (accessed from
-the Project Explorer's pop-up menu or by clicking the Source tab in certain
-editors) provide a spell checking feature.</p>
-<p>To check spelling in an HTML,
-XML, or other file that uses a structured markup language:</p>
- </div>
-
-<ol>
-<li><span>(Optional) To select the dictionary that will be used, click <span class="menucascade">
-<span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Spell
-Check</span></span>.</span></li>
-
-<li><span>Open in a structured text editor the file whose spelling you want
-to check.</span></li>
-
-<li><span>Start the spelling checker by clicking <span class="menucascade"><span class="uicontrol">Edit</span>
- &gt; <span class="uicontrol">Spell Check</span></span>.</span></li>
-
-<li><span>Type a new spelling into the <span class="uicontrol">Change to</span> field,
-or select one of the available options. Click the <span class="uicontrol">Change</span> button
-to change the current instance of the word in the current document. Click
-the <span class="uicontrol">Change All</span> button to change all instances of the
-word in the current document. You can also click the <span class="uicontrol">Add</span> button
-to add the currently selected spelling to your dictionary.</span></li>
-
-<li><span>Use the controls in the Spell Check dialog box to ignore, change,
-or add terms to the current dictionary. (To remove a word after it has been
-added to the dictionary, click the <span class="uicontrol">Dictionary</span> push
-button.)</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.dita
deleted file mode 100644
index ce2bb1dcbc..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.dita
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt014" xml:lang="en-us">
-<title>Adding snippets drawers</title>
-<shortdesc>This documentation explains how to customize the Snippets view
-by adding a new drawer.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>snippets<indexterm>drawer customization</indexterm></indexterm>
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>To add a new drawer to the Snippets view:</context>
-<steps>
-<step><cmd>Right-click anywhere in the Snippets view and select <uicontrol>Customize</uicontrol> from
-the pop-up menu.</cmd></step>
-<step><cmd>Click <menucascade><uicontrol>New</uicontrol><uicontrol>Category</uicontrol>
-</menucascade> and type the name of the new drawer in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>Optionally, type a description in the <uicontrol>Description</uicontrol> field.</cmd>
-</step>
-<step><cmd>Select the drawer's behavior by checking check boxes as appropriate.
-The check boxes are as follows:</cmd>
-<choicetable>
-<chrow><choption>Hide</choption><chdesc>Do not display the drawer.</chdesc>
-</chrow>
-<chrow><choption>Open drawer at start-up</choption><chdesc>At start-up, display
-the drawer's items.</chdesc></chrow>
-<chrow><choption>Pin drawer open at start-up</choption><chdesc>Keep the drawer
-open.</chdesc></chrow>
-</choicetable>
-</step>
-<step><cmd>Click <uicontrol>OK</uicontrol>. The new drawer will be added to
-the list of drawers in the Snippets view.</cmd></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
-</link>
-<link href="tsrcedt015.dita"><linktext>Adding items to snippets drawers</linktext>
-</link>
-<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
-<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
-drawers</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html
deleted file mode 100644
index 45145e08b2..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding snippets drawers" />
-<meta name="abstract" content="This documentation explains how to customize the Snippets view by adding a new drawer." />
-<meta name="description" content="This documentation explains how to customize the Snippets view by adding a new drawer." />
-<meta content="snippets, drawer customization" name="DC.subject" />
-<meta content="snippets, drawer customization" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt014" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding snippets drawers</title>
-</head>
-<body id="tsrcedt014"><a name="tsrcedt014"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding snippets drawers</h1>
-
-
-
-<div><p>This documentation explains how to customize the Snippets view
-by adding a new drawer.</p>
-
-<div class="section">To add a new drawer to the Snippets view:</div>
-
-<ol>
-<li><span>Right-click anywhere in the Snippets view and select <span class="uicontrol">Customize</span> from
-the pop-up menu.</span></li>
-
-<li><span>Click <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">Category</span>
-</span> and type the name of the new drawer in the <span class="uicontrol">Name</span> field.</span>
-</li>
-
-<li><span>Optionally, type a description in the <span class="uicontrol">Description</span> field.</span>
-</li>
-
-<li><span>Select the drawer's behavior by checking check boxes as appropriate.
-The check boxes are as follows:</span>
-
-<table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
-<thead><tr><th valign="bottom" id="N10090-option" align="left">Option</th>
-<th valign="bottom" id="N10090-desc" align="left">Description</th></tr></thead>
-<tbody>
-<tr><td valign="top" headers="N10090-option" id="N1009A"><strong>Hide</strong></td>
-<td valign="top" headers="N10090-desc N1009A">Do not display the drawer.</td>
-
-</tr>
-
-<tr><td valign="top" headers="N10090-option" id="N100AA"><strong>Open drawer at start-up</strong></td>
-<td valign="top" headers="N10090-desc N100AA">At start-up, display
-the drawer's items.</td>
-</tr>
-
-<tr><td valign="top" headers="N10090-option" id="N100B9"><strong>Pin drawer open at start-up</strong></td>
-<td valign="top" headers="N10090-desc N100B9">Keep the drawer
-open.</td>
-</tr>
-
-</tbody></table>
-
-</li>
-
-<li><span>Click <span class="uicontrol">OK</span>. The new drawer will be added to
-the list of drawers in the Snippets view.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-<div><a href="tsrcedt015.html" title="">Adding items to snippets drawers</a></div>
-<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
-<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
-drawers</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita
deleted file mode 100644
index 72bcceb211..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt015" xml:lang="en-us">
-<title>Adding items to snippets drawers</title>
-<prolog><metadata>
-<keywords><indexterm keyref="tsrcedt015|2|snippetitemsaddingtodrawers" status="changed">snippets<indexterm>drawers</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> To add new items to an existing snippets drawer:</context>
-<steps>
-<step><cmd>Do one of the following choices:</cmd><info><table colsep="0" frame="topbot">
-<tgroup cols="2"><colspec colname="col1" colwidth="72*"/><colspec colname="col2"
-colwidth="127*"/>
-<thead>
-<row>
-<entry colname="col1" valign="top">To start with this:</entry>
-<entry colname="col2" valign="top">Do this:</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="col1">An empty item that you can edit</entry>
-<entry colname="col2">Right-click anywhere in an existing drawer, select <uicontrol>Customize</uicontrol>,
-and click <menucascade><uicontrol>New</uicontrol><uicontrol>New Item</uicontrol>
-</menucascade>.</entry>
-</row>
-<row>
-<entry colname="col1">Existing text pasted into a new item in an existing
-drawer</entry>
-<entry colname="col2">Copy or cut text to the clipboard. In the Snippets view,
-right-click anywhere in an existing drawer and click <uicontrol>Paste</uicontrol>.</entry>
-</row>
-<row>
-<entry colname="col1">Existing text pasted into a new item in a new or existing
-drawer</entry>
-<entry colname="col2">Select the text, right-click, click <uicontrol>Add to
-Snippets</uicontrol>, specify the name of the drawer in the Snippets view
-to which you want to add the item, and click <uicontrol>OK</uicontrol>.</entry>
-</row>
-</tbody>
-</tgroup>
-</table></info><stepresult>A <wintitle>Customize Palette</wintitle> window
-appears.</stepresult></step>
-<step><cmd>Type a name for the new item, and, optionally, provide a description.</cmd>
-<stepresult>The value that you type in the <uicontrol>Name</uicontrol> field
-will appear next to the item's icon in the Snippets view.</stepresult></step>
-<step><cmd>To include in the <uicontrol>Template Pattern</uicontrol> field
-a variable that you have already defined, click <uicontrol>Insert Variable
-Placeholder</uicontrol>. </cmd><info>A variable placeholder is a marker that,
-when tagging is inserted into the active file, will be replaced by the value
-that is entered into the <uicontrol>Insert Template:</uicontrol><varname>Item_name</varname> dialog
-at insertion time. Clicking the <uicontrol>Insert Variable Placeholder</uicontrol> button
-or typing Ctrl+Space activates a pop-up in the text area that prompts you
-with the correct sequences to create a marker for the variable.</info><stepxmp>For
-example, if you create two variables named <varname>uri</varname> and <varname>prefix</varname>,
-and create variable placeholders for both, the template pattern might look
-like this:<codeblock>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %></codeblock></stepxmp>
-</step>
-<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
-</steps>
-<result>The new item will be added to the list of items in the appropriate
-drawer.</result>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
-</link>
-<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
-</link>
-<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
-<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
-drawers</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html
deleted file mode 100644
index db15ee8468..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding items to snippets drawers" />
-<meta content="snippets, drawers" name="DC.subject" />
-<meta content="snippets, drawers" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt015" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding items to snippets drawers</title>
-</head>
-<body id="tsrcedt015"><a name="tsrcedt015"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding items to snippets drawers</h1>
-
-
-<div>
-<div class="section"> To add new items to an existing snippets drawer:</div>
-
-<ol>
-<li class="stepexpand"><span>Do one of the following choices:</span>
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="hsides" border="1" rules="rows">
-<thead align="left">
-<tr>
-<th valign="top" width="36.18090452261307%" id="N10070">To start with this:</th>
-
-<th valign="top" width="63.81909547738693%" id="N10078">Do this:</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" width="36.18090452261307%" headers="N10070 ">An empty item that you can edit</td>
-
-<td valign="top" width="63.81909547738693%" headers="N10078 ">Right-click anywhere in an existing drawer, select <span class="uicontrol">Customize</span>,
-and click <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">New Item</span>
-</span>.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="36.18090452261307%" headers="N10070 ">Existing text pasted into a new item in an existing
-drawer</td>
-
-<td valign="top" width="63.81909547738693%" headers="N10078 ">Copy or cut text to the clipboard. In the Snippets view,
-right-click anywhere in an existing drawer and click <span class="uicontrol">Paste</span>.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="36.18090452261307%" headers="N10070 ">Existing text pasted into a new item in a new or existing
-drawer</td>
-
-<td valign="top" width="63.81909547738693%" headers="N10078 ">Select the text, right-click, click <span class="uicontrol">Add to
-Snippets</span>, specify the name of the drawer in the Snippets view
-to which you want to add the item, and click <span class="uicontrol">OK</span>.</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
- A <span class="wintitle">Customize Palette</span> window
-appears.</li>
-
-<li class="stepexpand"><span>Type a name for the new item, and, optionally, provide a description.</span>
- The value that you type in the <span class="uicontrol">Name</span> field
-will appear next to the item's icon in the Snippets view.</li>
-
-<li class="stepexpand"><span>To include in the <span class="uicontrol">Template Pattern</span> field
-a variable that you have already defined, click <span class="uicontrol">Insert Variable
-Placeholder</span>. </span> A variable placeholder is a marker that,
-when tagging is inserted into the active file, will be replaced by the value
-that is entered into the <span class="uicontrol">Insert Template:</span><var class="varname">Item_name</var> dialog
-at insertion time. Clicking the <span class="uicontrol">Insert Variable Placeholder</span> button
-or typing Ctrl+Space activates a pop-up in the text area that prompts you
-with the correct sequences to create a marker for the variable. For
-example, if you create two variables named <var class="varname">uri</var> and <var class="varname">prefix</var>,
-and create variable placeholders for both, the template pattern might look
-like this:<pre>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %&gt;</pre>
-
-</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
-
-</ol>
-
-<div class="section">The new item will be added to the list of items in the appropriate
-drawer.</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
-<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
-<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
-drawers</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.dita
deleted file mode 100644
index fd624afcea..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt016" xml:lang="en-us">
-<title>Deleting or hiding snippet items or drawers</title>
-<titlealts>
-<navtitle>Deleting and hiding drawers and items</navtitle>
-</titlealts>
-<shortdesc>This documentation describes how to delete or hide drawers and
-items in the Snippets view.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>drawers<indexterm>snippets view</indexterm></indexterm>
-<indexterm>snippets<indexterm>modifying drawers</indexterm></indexterm>
-
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>You can hide any drawer or item that shows up in the Snippets view.
-If the drawer or item is user-defined, you can delete it permanently. To delete
-or hide a drawer or item, complete the following steps:</context>
-<steps>
-<step><cmd>Select the item or drawer that you want to remove.</cmd></step>
-<step><cmd>Right-click and select <uicontrol>Customize</uicontrol> from the
-pop-up menu.</cmd></step>
-<step><cmd>Select the item or drawer and click <uicontrol>Delete</uicontrol> or <uicontrol>Hide</uicontrol>.</cmd>
-</step>
-<step><cmd>Click <uicontrol>OK</uicontrol>. The item or drawer will be deleted
-or hidden from the Snippets view.</cmd></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
-</link>
-<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
-</link>
-<link href="tsrcedt015.dita"><linktext>Adding items to snippets drawers</linktext>
-</link>
-<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html
deleted file mode 100644
index f10d376ba2..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Deleting or hiding snippet items or drawers" />
-<meta name="abstract" content="This documentation describes how to delete or hide drawers and items in the Snippets view." />
-<meta name="description" content="This documentation describes how to delete or hide drawers and items in the Snippets view." />
-<meta content="drawers, snippets view, snippets, modifying drawers" name="DC.subject" />
-<meta content="drawers, snippets view, snippets, modifying drawers" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt016" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Deleting or hiding snippet items or drawers</title>
-</head>
-<body id="tsrcedt016"><a name="tsrcedt016"><!-- --></a>
-
-
-<h1 class="topictitle1">Deleting or hiding snippet items or drawers</h1>
-
-
-
-
-<div><p>This documentation describes how to delete or hide drawers and
-items in the Snippets view.</p>
-
-<div class="section">You can hide any drawer or item that shows up in the Snippets view.
-If the drawer or item is user-defined, you can delete it permanently. To delete
-or hide a drawer or item, complete the following steps:</div>
-
-<ol>
-<li><span>Select the item or drawer that you want to remove.</span></li>
-
-<li><span>Right-click and select <span class="uicontrol">Customize</span> from the
-pop-up menu.</span></li>
-
-<li><span>Select the item or drawer and click <span class="uicontrol">Delete</span> or <span class="uicontrol">Hide</span>.</span>
-</li>
-
-<li><span>Click <span class="uicontrol">OK</span>. The item or drawer will be deleted
-or hidden from the Snippets view.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
-<div><a href="tsrcedt015.html" title="">Adding items to snippets drawers</a></div>
-<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.dita
deleted file mode 100644
index 63b31bfa78..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.dita
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt022" xml:lang="en-us">
-<title>Editing snippet items</title>
-<prolog><metadata>
-<keywords><indexterm>snippets<indexterm>editing items</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> To modify an existing item in a Snippets drawer, complete the steps
-listed below. If you have just completed the task <xref href="tsrcedt015.dita"
-type="task">Adding an item to a snippets drawer</xref> and the <wintitle>Customize
-Palette</wintitle> window is still open, you can skip steps 1 and 2.</context>
-<steps>
-<step><cmd>In the Snippets view, right-click the name of the item that you
-want to modify, and select <uicontrol>Customize</uicontrol>.</cmd></step>
-<step><cmd>Optionally, type a new name and a new description for the item.</cmd>
-</step>
-<step><cmd>To declare a variable, click <uicontrol>New</uicontrol> and type
-the variable's name, description, and default value.</cmd></step>
-<step><cmd>To edit an existing variable, type over the existing values.</cmd>
-</step>
-<step><cmd>To edit the <uicontrol>Template Pattern</uicontrol> field, type
-into the field, cut and paste into the field, or, if you have defined one
-or more variables, click the <uicontrol>Insert Variable Placeholder</uicontrol> button,
-and double-click the name of the variable that you want to insert.</cmd><stepxmp>For
-example, if you have declare variables named <varname>uri</varname> and <varname>prefix</varname>,
-clicking the button brings up a menu that contains those names. Double-clicking <varname>uri</varname> inserts <codeph>${uri}</codeph>,
-as in the following example:<codeblock>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %></codeblock></stepxmp>
-<stepresult>Later, when you insert the snippet into a file, <codeph>${uri}</codeph> and <codeph>${prefix}</codeph> are
-each converted to the default value declared in the Variables table. Users
-can replace the default values in the <uicontrol>Insert Template:</uicontrol><varname>Item_name</varname> dialog
-at insertion time.</stepresult></step>
-<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
-</steps>
-<result>The modified item will be added to the list of items in the appropriate
-drawer.</result>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
-</link>
-<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
-</link>
-<link href="tsrcedt015.dita"><linktext>Adding items to snippets drawers</linktext>
-</link>
-<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
-drawers</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html
deleted file mode 100644
index bd58a0e2f7..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing snippet items" />
-<meta content="snippets, editing items" name="DC.subject" />
-<meta content="snippets, editing items" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt022" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing snippet items</title>
-</head>
-<body id="tsrcedt022"><a name="tsrcedt022"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing snippet items</h1>
-
-
-<div>
-<div class="section"> To modify an existing item in a Snippets drawer, complete the steps
-listed below. If you have just completed the task <a href="tsrcedt015.html">Adding an item to a snippets drawer</a> and the <span class="wintitle">Customize
-Palette</span> window is still open, you can skip steps 1 and 2.</div>
-
-<ol>
-<li class="stepexpand"><span>In the Snippets view, right-click the name of the item that you
-want to modify, and select <span class="uicontrol">Customize</span>.</span></li>
-
-<li class="stepexpand"><span>Optionally, type a new name and a new description for the item.</span>
-</li>
-
-<li class="stepexpand"><span>To declare a variable, click <span class="uicontrol">New</span> and type
-the variable's name, description, and default value.</span></li>
-
-<li class="stepexpand"><span>To edit an existing variable, type over the existing values.</span>
-</li>
-
-<li class="stepexpand"><span>To edit the <span class="uicontrol">Template Pattern</span> field, type
-into the field, cut and paste into the field, or, if you have defined one
-or more variables, click the <span class="uicontrol">Insert Variable Placeholder</span> button,
-and double-click the name of the variable that you want to insert.</span> For
-example, if you have declare variables named <var class="varname">uri</var> and <var class="varname">prefix</var>,
-clicking the button brings up a menu that contains those names. Double-clicking <var class="varname">uri</var> inserts <samp class="codeph">${uri}</samp>,
-as in the following example:<pre>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %&gt;</pre>
-
- Later, when you insert the snippet into a file, <samp class="codeph">${uri}</samp> and <samp class="codeph">${prefix}</samp> are
-each converted to the default value declared in the Variables table. Users
-can replace the default values in the <span class="uicontrol">Insert Template:</span><var class="varname">Item_name</var> dialog
-at insertion time.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
-
-</ol>
-
-<div class="section">The modified item will be added to the list of items in the appropriate
-drawer.</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
-<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
-<div><a href="tsrcedt015.html" title="">Adding items to snippets drawers</a></div>
-<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
-drawers</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.dita
deleted file mode 100644
index 0bd8065709..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.dita
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt023" xml:lang="en-us">
-<title>Enabling content assist for JSP files</title>
-<shortdesc>Having the proper files defined in the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build class path is essential for content
-assist to work properly in JSP files. It is also essential for the links builder
-to be able to correctly resolve links to servlets or <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans
-in JSP and HTML files.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>content assistance<indexterm>enabling for JSP files</indexterm></indexterm>
-<indexterm>JSP files<indexterm>enabling content assistance</indexterm></indexterm>
-
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>To enable content assist for JSP files:</context>
-<steps>
-<step><cmd>To determine whether the build path is correct, select <uicontrol>Properties</uicontrol> from
-the project's pop-up menu. </cmd></step>
-<step><cmd>Select <uicontrol>Java Build Path</uicontrol>, and then the <uicontrol>Libraries</uicontrol> page. </cmd>
-<info>You should see the following files:<ul>
-<li>j2ee.jar</li>
-<li>rt.jar </li>
-<li>servlet.jar</li>
-<li>webcontainer.jar</li>
-</ul></info></step>
-<step><cmd>If they are not present, add them as External JAR files. You may
-have your own versions of these files, depending on the level of JDK or Servlet
-API for which you are developing.</cmd></step>
-<step><cmd>If your Web applications reference other JARs, you can place them
-in the build path as follows:</cmd>
-<substeps>
-<substep><cmd>Use the <uicontrol>Add JARs</uicontrol> button on the Library
-page. You must ensure that the JAR file is available to the server by properly
-configuring the server.</cmd></substep>
-<substep><cmd>Add the JARs to the <filepath>WEB-INF/lib</filepath> directory.
-They will be automatically added to the build path and deployed to the server
-in as part of the project WAR.</cmd></substep>
-</substeps>
-</step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt006.dita"><linktext>Content assist</linktext></link>
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt005.dita"><linktext>Getting content assistance in structured
-text editors</linktext></link>
-<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html
deleted file mode 100644
index 7d0a869e5f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Enabling content assist for JSP files" />
-<meta name="abstract" content="Having the proper files defined in the Java build class path is essential for content assist to work properly in JSP files. It is also essential for the links builder to be able to correctly resolve links to servlets or Java beans in JSP and HTML files." />
-<meta name="description" content="Having the proper files defined in the Java build class path is essential for content assist to work properly in JSP files. It is also essential for the links builder to be able to correctly resolve links to servlets or Java beans in JSP and HTML files." />
-<meta content="content assistance, enabling for JSP files, JSP files, enabling content assistance" name="DC.subject" />
-<meta content="content assistance, enabling for JSP files, JSP files, enabling content assistance" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt005.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt028.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt023" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Enabling content assist for JSP files</title>
-</head>
-<body id="tsrcedt023"><a name="tsrcedt023"><!-- --></a>
-
-
-<h1 class="topictitle1">Enabling content assist for JSP files</h1>
-
-
-
-<div><p>Having the proper files defined in the Javaâ„¢ build class path is essential for content
-assist to work properly in JSP files. It is also essential for the links builder
-to be able to correctly resolve links to servlets or Java beans
-in JSP and HTML files.</p>
-
-<div class="section">To enable content assist for JSP files:</div>
-
-<ol>
-<li class="stepexpand"><span>To determine whether the build path is correct, select <span class="uicontrol">Properties</span> from
-the project's pop-up menu. </span></li>
-
-<li class="stepexpand"><span>Select <span class="uicontrol">Java Build Path</span>, and then the <span class="uicontrol">Libraries</span> page. </span>
- You should see the following files:<ul>
-<li>j2ee.jar</li>
-
-<li>rt.jar </li>
-
-<li>servlet.jar</li>
-
-<li>webcontainer.jar</li>
-
-</ul>
-</li>
-
-<li class="stepexpand"><span>If they are not present, add them as External JAR files. You may
-have your own versions of these files, depending on the level of JDK or Servlet
-API for which you are developing.</span></li>
-
-<li class="stepexpand"><span>If your Web applications reference other JARs, you can place them
-in the build path as follows:</span>
-<ol type="a">
-<li><span>Use the <span class="uicontrol">Add JARs</span> button on the Library
-page. You must ensure that the JAR file is available to the server by properly
-configuring the server.</span></li>
-
-<li><span>Add the JARs to the <span class="filepath">WEB-INF/lib</span> directory.
-They will be automatically added to the build path and deployed to the server
-in as part of the project WAR.</span></li>
-
-</ol>
-
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt006.html" title="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion.">Content assist</a></div>
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt005.html" title="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor.">Getting content assistance in structured
-text editors</a></div>
-<div><a href="tsrcedt028.html" title="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing JSP templates</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.dita
deleted file mode 100644
index c475e981c8..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.dita
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt024" xml:lang="en-us">
-<title>Adding and removing HTML templates</title>
-<shortdesc>HTML content assist provides several templates, or chunks of predefined
-code, that you can insert into a file. You can use the default templates as
-provided, customize the default templates, or create your own templates.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>HTML<indexterm>templates<indexterm>removing</indexterm></indexterm></indexterm><indexterm>templates<indexterm>HTML</indexterm></indexterm><indexterm>HTML<indexterm>templates<indexterm>adding</indexterm></indexterm></indexterm>
-
-
-
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>For example, you may work on a group of HTML pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into an HTML or XHTML file.</p><p>To add
-a new HTML template, complete the following steps:</p> </context>
-<steps>
-<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
-</step>
-<step><cmd>In the Preferences page, select <menucascade><uicontrol>Web and
-XML</uicontrol><uicontrol>HTML Files</uicontrol><uicontrol>HTML Templates</uicontrol>
-</menucascade>.</cmd></step>
-<step><cmd>Click <uicontrol>New</uicontrol>. </cmd></step>
-<step><cmd>Enter the new template name (a text string) and a brief description
-of the template.</cmd></step>
-<step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</cmd></step>
-<step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</cmd></step>
-<step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
-and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <varname>cursor</varname> variable determines where the cursor will
-be after the template is inserted in the HTML document.</stepxmp></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save the new template.</cmd>
-</step>
-</steps>
-<postreq><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p><p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p></postreq>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
-templates - overview</linktext></link>
-<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
-</link>
-<link href="tsrcedt029.dita"><linktext>Adding and removing XML templates</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html
deleted file mode 100644
index a16a406bcf..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding and removing HTML templates" />
-<meta name="abstract" content="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta name="description" content="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta content="HTML, templates, removing, adding" name="DC.subject" />
-<meta content="HTML, templates, removing, adding" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt028.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt029.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt024" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding and removing HTML templates</title>
-</head>
-<body id="tsrcedt024"><a name="tsrcedt024"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding and removing HTML templates</h1>
-
-
-
-<div><p>HTML content assist provides several templates, or chunks of predefined
-code, that you can insert into a file. You can use the default templates as
-provided, customize the default templates, or create your own templates.</p>
-
-<div class="section"> <p>For example, you may work on a group of HTML pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <span class="uicontrol">Pattern</span> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into an HTML or XHTML file.</p>
-<p>To add
-a new HTML template, complete the following steps:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>From the <span class="uicontrol">Window</span> menu, select <span class="uicontrol">Preferences</span>.</span>
-</li>
-
-<li class="stepexpand"><span>In the Preferences page, select <span class="menucascade"><span class="uicontrol">Web and
-XML</span> &gt; <span class="uicontrol">HTML Files</span> &gt; <span class="uicontrol">HTML Templates</span>
-</span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">New</span>. </span></li>
-
-<li class="stepexpand"><span>Enter the new template name (a text string) and a brief description
-of the template.</span></li>
-
-<li class="stepexpand"><span>Using the <span class="uicontrol">Context</span> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">Pattern</span> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</span></li>
-
-<li class="stepexpand"><span>If you want to insert a variable, click the <span class="uicontrol">Variable</span> button
-and select the variable to be inserted.</span> For example, the <var class="varname">word_selection</var> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <var class="varname">cursor</var> variable determines where the cursor will
-be after the template is inserted in the HTML document.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> to save the new template.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p>
-<p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language
-templates - overview</a></div>
-<div><a href="tsrcedt028.html" title="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing JSP templates</a></div>
-<div><a href="tsrcedt029.html" title="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates.">Adding and removing XML templates</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita
deleted file mode 100644
index 6a3a83a6f9..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2009, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<task id="tsrcedt025" xml:lang="en-us">
-<title>Setting preferences for structured text editors</title>
-<titlealts>
-<navtitle>Setting structured text editor preferences</navtitle>
-</titlealts>
-<prolog><metadata>
-<keywords><indexterm
-keyref="tsrcedt025|1|structuredtexteditorspreferencesetting"
-status="changed">structured text editors<indexterm>preferences</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>You can customize your working environment by specifying
-preferences for the structured text editor.</context>
-<steps>
-<step><cmd>In the main menu, click <menucascade><uicontrol>Window</uicontrol>
-<uicontrol>Preferences</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Select one of the choices that are shown in the following
-table:</cmd>
-<choicetable relcolwidth="10* 30*">
-<chhead><choptionhd>Item</choptionhd><chdeschd>Menu path</chdeschd>
-</chhead>
-<chrow><choption>Annotation settings</choption><chdesc><menucascade>
-<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>
-<uicontrol>Annotations</uicontrol></menucascade></chdesc></chrow>
-<chrow><choption>Character encoding</choption><chdesc><uicontrol>Web
-and XML</uicontrol>, then one of the following choices: <uicontrol>CSS
-Files</uicontrol>, <uicontrol>HTML Files</uicontrol>, <uicontrol>JSP
-Files</uicontrol>, <uicontrol>*XML Files ( *not implemented in WTP)</uicontrol></chdesc>
-</chrow>
-<chrow><choption>Code folding</choption><chdesc><menucascade><uicontrol>General</uicontrol>
-<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editors</uicontrol>
-</menucascade></chdesc></chrow><?Pub Caret 58?>
-<chrow><choption>Content assist: HTML</choption><chdesc><menucascade>
-<uicontrol>Web and XML</uicontrol><uicontrol>HTML Files</uicontrol>
-<uicontrol>HTML Source</uicontrol></menucascade></chdesc></chrow>
-<chrow><choption>Content assist: JavaScript</choption><chdesc><menucascade>
-<uicontrol>Web and XML</uicontrol><uicontrol>JavaScript Files</uicontrol>
-<uicontrol>JavaScript Source</uicontrol></menucascade></chdesc></chrow>
-<chrow><choption>Content assist: XML</choption><chdesc><menucascade>
-<uicontrol>Web and XML</uicontrol><uicontrol>*XML Files (*not implemented
-in WTP)</uicontrol><uicontrol>XML Source</uicontrol></menucascade></chdesc>
-</chrow>
-<chrow><choption>Editor appearance</choption><chdesc><menucascade>
-<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>
-<uicontrol>Structured Text Editor</uicontrol><uicontrol>Appearance</uicontrol>
-</menucascade></chdesc></chrow>
-<chrow><choption>Editor font</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>
-<uicontrol>Colors and Fonts</uicontrol><uicontrol>Structured Text
-Editor</uicontrol></menucascade></chdesc></chrow>
-<chrow><choption>Editor navigation</choption><chdesc><menucascade>
-<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>
-<uicontrol>Structured Text Editor</uicontrol><uicontrol>Navigation</uicontrol>
-</menucascade></chdesc></chrow>
-<chrow><choption>File-type-specific settings</choption><chdesc><uicontrol>Web
-and XML</uicontrol>, then navigate to the file type and particular
-setting</chdesc></chrow>
-<chrow><choption>Hover help</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>
-<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editor</uicontrol>
-<uicontrol>Hovers</uicontrol></menucascade></chdesc></chrow>
-<chrow><choption>Key bindings</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>
-<uicontrol>Keys</uicontrol><uicontrol>Keyboard Shortcuts</uicontrol>
-</menucascade> then in the <uicontrol>Category</uicontrol> field specify <uicontrol>Source</uicontrol></chdesc>
-</chrow>
-<chrow><choption>Spell checking</choption><chdesc><uicontrol>Spell
-Check</uicontrol></chdesc></chrow>
-<chrow><choption>Syntax checking</choption><chdesc><menucascade>
-<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>
-<uicontrol>Structured Text Editor</uicontrol><uicontrol>Appearance</uicontrol>
-</menucascade> then check or uncheck the <uicontrol>Analyze annotations
-while typing</uicontrol> box.</chdesc></chrow>
-</choicetable>
-<info><note>You cannot set <uicontrol>Web and XML</uicontrol> preferences
-unless the Core XML Support capability (<menucascade><uicontrol>Workbench</uicontrol>
-<uicontrol>Capabilities</uicontrol></menucascade>) is enabled, and
-you cannot set preferences for DTD files unless the XML Development
-capability is enabled.</note></info></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for
-markup languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt001.dita"><linktext>Setting annotation preferences
-for markup languages</linktext></link>
-<link href="tsrcedt010.dita"><linktext>Checking spelling</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup
-languages - overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
-<?Pub *0000005160?>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html
deleted file mode 100644
index 6763db368d..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html
+++ /dev/null
@@ -1,153 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting preferences for structured text editors" />
-<meta content="structured text editors, preferences" name="DC.subject" />
-<meta content="structured text editors, preferences" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt010.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt025" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting preferences for structured text editors</title>
-</head>
-<body id="tsrcedt025"><a name="tsrcedt025"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting preferences for structured text editors</h1>
-
-
-
-<div>
-<div class="section">You can customize your working environment by specifying preferences
-for the structured text editor.</div>
-
-<ol>
-<li class="stepexpand"><span>In the main menu, click <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol">Preferences</span></span>.</span></li>
-
-<li class="stepexpand"><span>Select one of the choices that are shown in the following table:</span>
-
-<table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
-<thead><tr><th valign="bottom" id="N10070-option">Item</th>
-<th valign="bottom" id="N10070-desc">Menu path</th></tr></thead>
-<tbody>
-
-<tr><td valign="top" headers="N10070-option" id="N1008A"><strong>Annotation settings</strong></td>
-<td valign="top" headers="N10070-desc N1008A"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Annotations</span></span></td>
-
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N100AD"><strong>Character encoding</strong></td>
-<td valign="top" headers="N10070-desc N100AD"><span class="uicontrol">Web and XML</span>,
-then one of the following choices: <span class="uicontrol">CSS Files</span>, <span class="uicontrol">HTML
-Files</span>, <span class="uicontrol">JSP Files</span>, <span class="uicontrol">*XML Files
-( *not implemented in WTP)</span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N100D8"><strong>Content assist: HTML</strong></td>
-<td valign="top" headers="N10070-desc N100D8"><span class="menucascade"><span class="uicontrol">Web
-and XML</span> &gt; <span class="uicontrol">HTML Files</span> &gt; <span class="uicontrol">HTML Source</span>
-</span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N100FA"><strong>Content assist: JavaScript</strong></td>
-<td valign="top" headers="N10070-desc N100FA"><span class="menucascade">
-<span class="uicontrol">Web and XML</span> &gt; <span class="uicontrol">JavaScript Files</span>
- &gt; <span class="uicontrol">JavaScript Source</span></span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N1011D"><strong>Content assist: XML</strong></td>
-<td valign="top" headers="N10070-desc N1011D"><span class="menucascade"><span class="uicontrol">Web
-and XML</span> &gt; <span class="uicontrol">*XML Files (*not implemented in WTP)</span>
- &gt; <span class="uicontrol">XML Source</span></span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N1013F"><strong>Editor appearance</strong></td>
-<td valign="top" headers="N10070-desc N1013F"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
- &gt; <span class="uicontrol">Appearance</span></span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N10167"><strong>Editor font</strong></td>
-<td valign="top" headers="N10070-desc N10167"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Colors and Fonts</span> &gt; <span class="uicontrol">Structured Text Editor</span>
-</span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N1018A"><strong>Editor navigation</strong></td>
-<td valign="top" headers="N10070-desc N1018A"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
- &gt; <span class="uicontrol">Navigation</span></span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N101B2"><strong>File-type-specific settings</strong></td>
-<td valign="top" headers="N10070-desc N101B2"><span class="uicontrol">Web
-and XML</span>, then navigate to the file type and particular setting</td>
-
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N101C7"><strong>Hover help</strong></td>
-<td valign="top" headers="N10070-desc N101C7"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
- &gt; <span class="uicontrol">Hovers</span></span></td>
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N101EF"><strong>Key bindings</strong></td>
-<td valign="top" headers="N10070-desc N101EF"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Keys</span> &gt; <span class="uicontrol">Keyboard Shortcuts</span></span> then
-in the <span class="uicontrol">Category</span> field specify <span class="uicontrol">Source</span></td>
-
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N1021E"><strong>Spell checking</strong></td>
-<td valign="top" headers="N10070-desc N1021E"><span class="uicontrol">Spell Check</span></td>
-
-</tr>
-
-<tr><td valign="top" headers="N10070-option" id="N10232"><strong>Syntax checking</strong></td>
-<td valign="top" headers="N10070-desc N10232"><span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
- &gt; <span class="uicontrol">Appearance</span></span> then check or uncheck the <span class="uicontrol">Analyze
-annotations while typing</span> box.</td>
-</tr>
-
-</tbody></table>
-
- <div class="note"><span class="notetitle">Note:</span> You cannot set <span class="uicontrol">Web and XML</span> preferences
-unless the Core XML Support capability (<span class="menucascade"><span class="uicontrol">Workbench</span>
- &gt; <span class="uicontrol">Capabilities</span></span>) is enabled, and you cannot
-set preferences for DTD files unless the XML Development capability is enabled.</div>
-
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt001.html" title="This documentation describes how to set annotation preferences for Web and XML files. The annotation preferences include whether to analyze the syntactic validity of your file while you are typing and what colors to use to highlight errors, warnings, tasks, search results, bookmarks, and other text.">Setting annotation preferences for
-markup languages</a></div>
-<div><a href="tsrcedt010.html" title="This documentation describes how to check spelling in a structured text editor.">Checking spelling</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.dita
deleted file mode 100644
index d7cf9273fa..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.dita
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt026" xml:lang="en-us">
-<title>Editing with snippets - overview</title>
-<shortdesc>The Snippets view lets you catalog and organize reusable programming
-objects, such as HTML tagging, <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="JavaScript">JavaScript</tm>, and JSP code, along with
-files and custom JSP tags. The view can be extended based on additional objects
-that you define and include.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>snippets<indexterm>overview</indexterm></indexterm>
-
-
-
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>In the Snippets view you can perform the following tasks:</context>
-<steps-unordered>
-<step><cmd>Add snippets drawers</cmd></step>
-<step><cmd>Add items to snippets drawers</cmd></step>
-<step><cmd>Edit snippet items</cmd></step>
-<step><cmd>Delete or hide snippet items or drawers</cmd></step>
-</steps-unordered>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
-</link>
-<link href="tsrcedt015.dita"><linktext>Adding items to snippets drawers</linktext>
-</link>
-<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
-<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
-drawers</linktext></link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html
deleted file mode 100644
index 2181e1adf4..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing with snippets - overview" />
-<meta name="abstract" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include." />
-<meta name="description" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include." />
-<meta content="snippets, overview" name="DC.subject" />
-<meta content="snippets, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt026" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing with snippets - overview</title>
-</head>
-<body id="tsrcedt026"><a name="tsrcedt026"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing with snippets - overview</h1>
-
-
-
-<div><p>The Snippets view lets you catalog and organize reusable programming
-objects, such as HTML tagging, JavaScriptâ„¢, and JSP code, along with
-files and custom JSP tags. The view can be extended based on additional objects
-that you define and include.</p>
-
-<div class="section">In the Snippets view you can perform the following tasks:</div>
-
-<ul>
-<li><span>Add snippets drawers</span></li>
-
-<li><span>Add items to snippets drawers</span></li>
-
-<li><span>Edit snippet items</span></li>
-
-<li><span>Delete or hide snippet items or drawers</span></li>
-
-</ul>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
-<div><a href="tsrcedt015.html" title="">Adding items to snippets drawers</a></div>
-<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
-<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
-drawers</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.dita
deleted file mode 100644
index 7d324eb281..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.dita
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt027" xml:lang="en-us">
-<title>Adding and removing markup language templates - overview</title>
-<titlealts>
-<navtitle>Adding markup language templates</navtitle>
-</titlealts>
-<shortdesc>Content assist provides templates, or chunks of predefined code,
-that you can insert into a file. You can use the default templates as provided,
-customize the default templates, or create your own templates.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>markup languages<indexterm>templates</indexterm></indexterm>
-<indexterm>templates<indexterm>markup languages</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>Templates are available for the following markup languages:<ul>
-<li>HTML or XHTML</li>
-<li>JSP</li>
-</ul></context>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt024.dita"><linktext>Adding and removing HTML templates</linktext>
-</link>
-<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
-</link>
-<link href="tsrcedt029.dita"><linktext>Adding and removing XML templates</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html
deleted file mode 100644
index 801e45fd47..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding and removing markup language templates - overview" />
-<meta name="abstract" content="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta name="description" content="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta content="markup languages, templates" name="DC.subject" />
-<meta content="markup languages, templates" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt028.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt029.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt027" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding and removing markup language templates - overview</title>
-</head>
-<body id="tsrcedt027"><a name="tsrcedt027"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding and removing markup language templates - overview</h1>
-
-
-
-
-<div><p>Content assist provides templates, or chunks of predefined code,
-that you can insert into a file. You can use the default templates as provided,
-customize the default templates, or create your own templates.</p>
-
-<div class="section">Templates are available for the following markup languages:<ul>
-<li>HTML or XHTML</li>
-
-<li>JSP</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt024.html" title="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing HTML templates</a></div>
-<div><a href="tsrcedt028.html" title="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing JSP templates</a></div>
-<div><a href="tsrcedt029.html" title="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates.">Adding and removing XML templates</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita
deleted file mode 100644
index bcf81da956..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt028" xml:lang="en-us">
-<title>Adding and removing JSP templates</title>
-<shortdesc>JSP content assist provides several templates, or chunks of predefined
-code, that you can insert into a file. You can use the default templates as
-provided, customize the default templates, or create your own templates.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tsrcedt028|1|JSPpagestemplates" status="changed">JSP
-files<indexterm>templates</indexterm></indexterm><indexterm keyref="tsrcedt028|2|templatesJSPpages"
-status="new">templates<indexterm>JSP pages</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>For example, you may work on a group of JSP pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into a JSP file.</p><p>To add a new JSP template,
-complete the following steps:</p> </context>
-<steps>
-<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
-</step>
-<step><cmd>In the Preferences page, select <menucascade><uicontrol>Web and
-XML</uicontrol><uicontrol>JSP Files</uicontrol><uicontrol>JSP Templates</uicontrol>
-</menucascade>.</cmd></step>
-<step><cmd>Click <uicontrol>New</uicontrol>. </cmd></step>
-<step><cmd>Enter the new template name (a text string) and a brief description
-of the template.</cmd></step>
-<step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</cmd></step>
-<step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</cmd></step>
-<step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
-and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <varname>cursor</varname> variable determines where the cursor will
-be after the template is inserted in the HTML document.</stepxmp></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save the new template.</cmd>
-</step>
-</steps>
-<postreq><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p><p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p></postreq>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
-templates - overview</linktext></link>
-<link href="tsrcedt024.dita"><linktext>Adding and removing HTML templates</linktext>
-</link>
-<link href="tsrcedt029.dita"><linktext>Adding and removing XML templates</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html
deleted file mode 100644
index 09647fb458..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding and removing JSP templates" />
-<meta name="abstract" content="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta name="description" content="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta content="JSP files, templates, JSP pages" name="DC.subject" />
-<meta content="JSP files, templates, JSP pages" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt029.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt028" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding and removing JSP templates</title>
-</head>
-<body id="tsrcedt028"><a name="tsrcedt028"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding and removing JSP templates</h1>
-
-
-
-<div><p>JSP content assist provides several templates, or chunks of predefined
-code, that you can insert into a file. You can use the default templates as
-provided, customize the default templates, or create your own templates.</p>
-
-<div class="section"> <p>For example, you may work on a group of JSP pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <span class="uicontrol">Pattern</span> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into a JSP file.</p>
-<p>To add a new JSP template,
-complete the following steps:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>From the <span class="uicontrol">Window</span> menu, select <span class="uicontrol">Preferences</span>.</span>
-</li>
-
-<li class="stepexpand"><span>In the Preferences page, select <span class="menucascade"><span class="uicontrol">Web and
-XML</span> &gt; <span class="uicontrol">JSP Files</span> &gt; <span class="uicontrol">JSP Templates</span>
-</span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">New</span>. </span></li>
-
-<li class="stepexpand"><span>Enter the new template name (a text string) and a brief description
-of the template.</span></li>
-
-<li class="stepexpand"><span>Using the <span class="uicontrol">Context</span> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">Pattern</span> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</span></li>
-
-<li class="stepexpand"><span>If you want to insert a variable, click the <span class="uicontrol">Variable</span> button
-and select the variable to be inserted.</span> For example, the <var class="varname">word_selection</var> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <var class="varname">cursor</var> variable determines where the cursor will
-be after the template is inserted in the HTML document.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> to save the new template.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p>
-<p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language
-templates - overview</a></div>
-<div><a href="tsrcedt024.html" title="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing HTML templates</a></div>
-<div><a href="tsrcedt029.html" title="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates.">Adding and removing XML templates</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita
deleted file mode 100644
index 30ebb0810f..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "..\dtd\task.dtd">
-<task id="tsrcedt027" xml:lang="en-us">
-<title>Adding and removing XML templates</title>
-<shortdesc>XML content assist provides a comment template, a chunk of predefined
-code that you can insert into a file. You can use the default template as
-provided, customize that template, or create your own templates.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tsrcedt029|1|templatesXML" status="new">templates<indexterm>XML</indexterm></indexterm>
-<indexterm keyref="tsrcedt029|2|xmltemplatesadding" status="changed">XML<indexterm>adding
-templates</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>For example, you may work on a group of XML pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into an XML file.</p><p>To add a new XML
-template, complete the following steps: </p> </context>
-<steps>
-<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
-</step>
-<step><cmd>In the Preferences page, select <menucascade><uicontrol>Web and
-XML</uicontrol><uicontrol>XML Files</uicontrol><uicontrol>XML Templates</uicontrol>
-</menucascade>.</cmd></step>
-<step><cmd>Click <uicontrol>New</uicontrol>. </cmd></step>
-<step><cmd>Enter the new template name (a text string) and a brief description
-of the template.</cmd></step>
-<step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</cmd></step>
-<step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</cmd></step>
-<step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
-and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <varname>cursor</varname> variable determines where the cursor will
-be after the template is inserted in the XML document.</stepxmp></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save the new template.</cmd>
-</step>
-</steps>
-<postreq><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p><p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p></postreq>
-</taskbody>
-<related-links>
-<linkpool type="concept">
-<link href="csrcedt004.dita"><linktext>Structured text editors for markup
-languages</linktext></link>
-</linkpool>
-<linkpool type="task">
-<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
-templates - overview</linktext></link>
-<link href="tsrcedt024.dita"><linktext>Adding and removing HTML templates</linktext>
-</link>
-<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
-</link>
-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
-- overview</linktext></link>
-</linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html
deleted file mode 100644
index f6742435a1..0000000000
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding and removing XML templates" />
-<meta name="abstract" content="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates." />
-<meta name="description" content="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates." />
-<meta content="templates, XML, adding templates" name="DC.subject" />
-<meta content="templates, XML, adding templates" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt028.html" />
-<meta scheme="URI" name="DC.Relation" content="tsrcedt000.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tsrcedt027" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding and removing XML templates</title>
-</head>
-<body id="tsrcedt027"><a name="tsrcedt027"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding and removing XML templates</h1>
-
-
-
-<div><p>XML content assist provides a comment template, a chunk of predefined
-code that you can insert into a file. You can use the default template as
-provided, customize that template, or create your own templates.</p>
-
-<div class="section"> <p>For example, you may work on a group of XML pages that should
-all contain a table with a specific appearance. Create a template that contains
-the tags for that table, including the appropriate attributes and attribute
-values for each tag. (You can copy and paste the tags from a structured text
-editor into the template's <span class="uicontrol">Pattern</span> field.) Then select
-the name of the template from a content assist proposal list whenever you
-want to insert your custom table into an XML file.</p>
-<p>To add a new XML
-template, complete the following steps: </p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>From the <span class="uicontrol">Window</span> menu, select <span class="uicontrol">Preferences</span>.</span>
-</li>
-
-<li class="stepexpand"><span>In the Preferences page, select <span class="menucascade"><span class="uicontrol">Web and
-XML</span> &gt; <span class="uicontrol">XML Files</span> &gt; <span class="uicontrol">XML Templates</span>
-</span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">New</span>. </span></li>
-
-<li class="stepexpand"><span>Enter the new template name (a text string) and a brief description
-of the template.</span></li>
-
-<li class="stepexpand"><span>Using the <span class="uicontrol">Context</span> drop-down list, specify
-the context in which the template is available in the proposal list when content
-assist is requested.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">Pattern</span> field, enter the appropriate
-tags, attributes, or attribute values (the content of the template) to be
-inserted by content assist.</span></li>
-
-<li class="stepexpand"><span>If you want to insert a variable, click the <span class="uicontrol">Variable</span> button
-and select the variable to be inserted.</span> For example, the <var class="varname">word_selection</var> variable
-indicates the word that is selected at the beginning of template insertion,
-and the <var class="varname">cursor</var> variable determines where the cursor will
-be after the template is inserted in the XML document.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> to save the new template.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>You can edit, remove, import, or export a template by using the
-same Preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed.</p>
-<p>If you have a template
-that you do not want to remove but you no longer want the template to appear
-in the content assist list, go to the Templates preferences page and uncheck
-its check box.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
-languages</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language
-templates - overview</a></div>
-<div><a href="tsrcedt024.html" title="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing HTML templates</a></div>
-<div><a href="tsrcedt028.html" title="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing JSP templates</a></div>
-<div><a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML.">Editing text coded in markup languages
-- overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore b/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.project b/docs/org.eclipse.wst.sse.ui.infopop/.project
deleted file mode 100644
index 2d9cc8449f..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.ui.infopop</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.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/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.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/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml b/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml
deleted file mode 100644
index b68067e244..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * 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
- *******************************************************************************/ -->
-<contexts>
-
-<context id="sted0001">
-<description>This page lets you customize the appearance of the structured text editors.
-When the <b>Highlight matching brackets</b> option is selected, whenever the cursor is next to a bracket or curly braces, its opening or closing counter part is highlighted.
-Select the <b>Report problems as you type</b> check box to update validity annotations (temporary annotations, such as missing required attributes based on a DTD, that go away when the editor is closed, or the problem is fixed) as the user types.
-In the <b>Appearance color options</b> table, you can adjust various editor appearance features.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="sted0003">
-<description>This page lets you customize hover text in the structured text editors.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclispe.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1010">
-<description>Content assist helps you to finish tags or lines of code and insert templates. Depending on the source markup language, the choices that are available in the content assist list are based on tags defined by DTD and schema files, tag library descriptors, or content model standard that is specified for the file being edited. HTML content assist choices are based on the W3C HTML 4.01 content model.
-
-If your cursor is in a position where content assist is available, a pop-up list of available choices is displayed. The content assist list displays all available completions for the current cursor position, including templates. Content assist is also available by pressing Ctrl+Space.
-</description>
-<topic label="Content assist" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt006.html"/>
-<topic label="Getting content assistance in structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1030">
-<description>Select this option to format an entire document. Formatting restores element and attribute indentation and positioning, which may have been offset during editing, to see nesting hierarchies and relationships more clearly in the file. Edit the appropriate Preferences pages to make changes in specific formatting behavior.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1040">
-<description>Select this option to format selected elements. Formatting restores element and attribute indentation and positioning, which may have been offset during editing, to see nesting hierarchies and relationships more clearly in the file.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1070">
-<description>Select this option to open the <b>Properties</b> view, which displays properties relevant to the current element if any exist.
-</description>
-<topic label="Properties view" href="../org.eclipse.platform.doc.user/concepts/cpropview.htm"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm2000">
-<description>This structured text editor lets you edit a text file that is coded in a markup language. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting. For a more specific list of editing features, see the first link below.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="webx0000">
-<description>This page lets you customize task tag discovery in the structured text editors.
-</description>
-</context>
-
-<context id="ecss0000">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="misc0180">
- <description>Use this dialog to edit the CSS content settings for a CSS file. You can specify CSS profile or restore the default by clicking <b>Restore Defaults</b>.
- </description>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml b/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml
deleted file mode 100644
index f8bc39deab..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<contexts>
-<context id="csssource_source_HelpId">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="ecss0000">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
- <context id="misc0180">
- <description>Use this dialog to edit the CSS content settings for a CSS file. You can specify CSS profile or restore the default by clicking <b>Restore Defaults</b>.
- </description>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index 9d7c95e308..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.sse.ui.infopop; singleton:=true
-Bundle-Version: 1.0.300.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/about.html b/docs/org.eclipse.wst.sse.ui.infopop/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/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/docs/org.eclipse.wst.sse.ui.infopop/build.properties b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
deleted file mode 100644
index 94c7f99f99..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = EditorContexts.xml,\
- about.html,\
- plugin.xml,\
- META-INF/,\
- EditorCssContexts2.xml,\
- plugin.properties
-generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties b/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
deleted file mode 100644
index 69025d2cbe..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.sse.ui.infopop
-Bundle-Vendor.0 = Eclipse Web Tools Platform
-Bundle-Name.0 = SSE infopops \ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml b/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
deleted file mode 100644
index 2a3796f2a7..0000000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.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
- *******************************************************************************/ -->
-
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
- <contexts file="EditorContexts.xml" plugin ="org.eclipse.wst.sse.ui"/>
- <contexts file="EditorCssContexts2.xml" plugin ="org.eclipse.wst.sse.ui"/>
-</extension>
-
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/.cvsignore b/docs/org.eclipse.wst.webtools.doc.user/.cvsignore
deleted file mode 100644
index d1dca983e1..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-build.xml
-org.eclipse.wst.webtools.doc.user_1.0.0.jar
-temp \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/.project b/docs/org.eclipse.wst.webtools.doc.user/.project
deleted file mode 100644
index bd5b15799c..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.webtools.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml b/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml
deleted file mode 100644
index 235ccf22b2..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
- This script build the Help plug-in by transforming the DITA source files into HTML.
-
- To use this script, you must install DITA-OT on your machine in the directory
- defined by the dita.ot.dir property.
-
- Run the default target after you edit the DITA source files to regenerate the HTML.
-
- To customize this script for other Help plug-ins, modify the value of the args.input property
- to be the DITA map file for the plug-in.
-
- NOTE: This script assumes that links to sibling Help plug-ins have scope="peer", otherwise the
- output directory structure will be shifted incorrectly.
-
- NOTE: This script assumes that you hand code your plugin.xml file in myplugin.xml. This file
- will be copied over the generated plugin.xml which is currently not being generated correctly
- by DITA-OT.
-
- ChangeLog:
- 2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
- - Created.
- 2008-01-09 Kate Price <katep@ca.ibm.com>
- - modified for new DITA-OT version
- 2008-05-05 Kate Price <katep@ca.ibm.com>
- - modified to add generation of pre-built help index.
- - Must delete /index folder before running build
--->
-<project name="eclipsehelp" default="all">
-
- <property name="dita.ot.dir" location="C:/DITA-OT1.2.2" />
-
- <path id="dost.class.path">
- <pathelement location="${dita.ot.dir}${file.separator}lib${file.separator}dost.jar" />
- </path>
-
- <taskdef name="integrate" classname="org.dita.dost.platform.IntegratorTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <target name="all" depends="integrate, eclipsehelp">
- </target>
- <target name="integrate">
- <integrate ditadir="${dita.ot.dir}" />
- </target>
-
- <!-- revise below here -->
- <target name="eclipsehelp">
- <ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
- <property name="args.copycss" value="no" />
- <property name="args.csspath" value="../org.eclipse.wst.doc.user" />
- <property name="args.eclipse.provider" value="Eclipse.org" />
- <property name="args.eclipse.version" value="3.3.0" />
- <property name="args.input" location="relatedlinks.ditamap" />
- <property name="clean.temp" value="true" />
- <property name="dita.extname" value=".dita" />
- <property name="dita.temp.dir" location="temp" />
- <property name="output.dir" location="" />
- <property name="transtype" value="eclipsehelp" />
- </ant>
- <copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
- </target>
- <target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-</project>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 4e8f6a410b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.webtools.doc.user; singleton:=true
-Bundle-Version: 1.0.500.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
diff --git a/docs/org.eclipse.wst.webtools.doc.user/about.html b/docs/org.eclipse.wst.webtools.doc.user/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/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/docs/org.eclipse.wst.webtools.doc.user/build.properties b/docs/org.eclipse.wst.webtools.doc.user/build.properties
deleted file mode 100644
index 1e3a1c74d5..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-bin.includes = plugin.xml,\
- webtools_toc.xml,\
- org.eclipse.wst.webtools.doc.userindex.xml,\
- about.html,\
- images/,\
- topics/*htm*,\
- index/,\
- META-INF/,\
- plugin.properties
-src.includes = *.maplist,\
- *.ditamap,\
- topics/*.dita
-bin.excludes = DocBuild.xml,\
- myPlugin*.xml
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/fixit.gif b/docs/org.eclipse.wst.webtools.doc.user/images/fixit.gif
deleted file mode 100644
index ffafc3dbf4..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/fixit.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/grptype.gif b/docs/org.eclipse.wst.webtools.doc.user/images/grptype.gif
deleted file mode 100644
index 46d245f0b6..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/grptype.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/menubutton.gif b/docs/org.eclipse.wst.webtools.doc.user/images/menubutton.gif
deleted file mode 100644
index 7ef1a62ba7..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/menubutton.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nlinux.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nlinux.gif
deleted file mode 100644
index 7c135cfe64..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nlinux.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nshowerr.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nshowerr.gif
deleted file mode 100644
index c2bfdd606b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nshowerr.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwarning.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwarning.gif
deleted file mode 100644
index cf4fdf93c7..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwarning.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwin.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwin.gif
deleted file mode 100644
index 895f9ca06d..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwin.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkbrk.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkbrk.gif
deleted file mode 100644
index 6321433aff..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkbrk.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkcss.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkcss.gif
deleted file mode 100644
index 1a0caf64ab..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkcss.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr-l.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr-l.gif
deleted file mode 100644
index 9c73b6a197..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr-l.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr.gif
deleted file mode 100644
index f3c626150e..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkgr.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkind.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkind.gif
deleted file mode 100644
index 943f756328..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkind.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkmal.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkmal.gif
deleted file mode 100644
index 889c47f6dd..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkmal.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnknum.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnknum.gif
deleted file mode 100644
index f324a6341b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnknum.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkotr.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkotr.gif
deleted file mode 100644
index f596591d52..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkotr.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkque.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkque.gif
deleted file mode 100644
index 345f939ac1..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnkque.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnktsk.gif b/docs/org.eclipse.wst.webtools.doc.user/images/nwlnktsk.gif
deleted file mode 100644
index 9cd47eec4c..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/nwlnktsk.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/skipit.gif b/docs/org.eclipse.wst.webtools.doc.user/images/skipit.gif
deleted file mode 100644
index 55f5b1bec2..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/skipit.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/images/viewlink.gif b/docs/org.eclipse.wst.webtools.doc.user/images/viewlink.gif
deleted file mode 100644
index 407b051b28..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/images/viewlink.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs b/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs
deleted file mode 100644
index 740c4c5fac..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/deletable b/docs/org.eclipse.wst.webtools.doc.user/index/deletable
deleted file mode 100644
index 593f4708db..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/deletable
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions
deleted file mode 100644
index f11e1b71b5..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions
+++ /dev/null
@@ -1,3 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 20:03:02 EDT 2008
-org.eclipse.wst.webtools.doc.user=org.eclipse.wst.webtools.doc.user\n1.0.400.qualifier
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies
deleted file mode 100644
index 430c2cbe02..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 20:03:02 EDT 2008
-lucene=1.9.1.v200803061811
-analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs
deleted file mode 100644
index be0097cba9..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs
+++ /dev/null
@@ -1,34 +0,0 @@
-#This is a generated file; do not edit.
-#Wed May 14 20:03:02 EDT 2008
-/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html=0
-/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html=0
-/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twprjset.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html=0
-/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twcresta.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twplib.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html=0
-/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html=0
-/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html=0
-/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html=0
-/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html=0
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/segments b/docs/org.eclipse.wst.webtools.doc.user/index/segments
deleted file mode 100644
index 4d97698573..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/segments
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml b/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml
deleted file mode 100644
index 7b520b1b01..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
- <plugin>
- <extension point="org.eclipse.help.toc">
- <toc file="webtools_toc.xml" />
- <index path="index/"/>
- </extension>
-
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.webtools.doc.userindex.xml"/>
- </extension>
-
- </plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.user.maplist b/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.user.maplist
deleted file mode 100644
index d9d52db4ae..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.user.maplist
+++ /dev/null
@@ -1,8 +0,0 @@
-<maplist version="3.6.2">
- <nav>
- <map file="webtools_toc.ditamap"/>
- </nav>
- <link>
- <map file="relatedlinks.ditamap"/>
- </link>
-</maplist>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml b/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml
deleted file mode 100644
index 42c8a4d005..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<index>
- <entry keyword="Web applications">
- <entry keyword="overview">
- <topic href="topics/ccwtover.html#ccwtover" title="Web application overview"/>
- </entry>
- <entry keyword="creating or importing">
- <topic href="topics/cwebprojects.html#cwebprojects" title="Web projects"/>
- </entry>
- <entry keyword="resources">
- <topic href="topics/twcreprj.html#twcreprj" title="Creating a dynamic Web project"/>
- </entry>
- <entry keyword="server targeting">
- <topic href="topics/tservertarget.html#tservertarget" title="Server targeting for Web applications"/>
- </entry>
- </entry>
- <entry keyword="Web tools">
- <entry keyword="features">
- <topic href="topics/cwtfeatures.html#cwtfeatures" title="Web tools features"/>
- </entry>
- </entry>
- <entry keyword="Project Explorer view">
- <entry keyword="overview">
- <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
- </entry>
- </entry>
- <entry keyword="Web projects">
- <entry keyword="Project Explorer view">
- <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cwebprojects.html#cwebprojects" title="Web projects"/>
- </entry>
- <entry keyword="creating dynamic projects">
- <topic href="topics/twcreprj.html#twcreprj" title="Creating a dynamic Web project"/>
- </entry>
- <entry keyword="dynamic projects overview">
- <topic href="topics/ccwebprj.html#ccwebprj" title="Dynamic Web projects and applications"/>
- </entry>
- <entry keyword="creating static">
- <topic href="topics/twcresta.html#twcresta" title="Creating a static Web project"/>
- </entry>
- <entry keyword="converting static to dynamic">
- <topic href="topics/twpcnvrt.html#twpcnvrt" title="Converting static Web projects to dynamic Web projects"/>
- </entry>
- <entry keyword="static">
- <topic href="topics/ccstatic.html#ccstatic" title="Static Web projects"/>
- </entry>
- <entry keyword="exporting WAR files">
- <topic href="topics/twcrewar.html#twcrewar" title="Exporting Web Archive (WAR) files"/>
- </entry>
- <entry keyword="virtual JAR files and projects">
- <topic href="topics/twplib.html#twplib" title="Adding Web library projects"/>
- </entry>
- <entry keyword="properties settings">
- <topic href="topics/twprjset.html#twprjset" title="Setting Web project properties"/>
- </entry>
- </entry>
- <entry keyword="Web resources">
- <entry keyword="overview">
- <topic href="topics/cwebresources.html#cwebresources" title="Web resources"/>
- </entry>
- </entry>
- <entry keyword="Web page design">
- <entry keyword="overview">
- <topic href="topics/cwebpagedesign.html#cwebpagedesign" title="Web page design"/>
- </entry>
- </entry>
- <entry keyword="WAR files">
- <entry keyword="overview">
- <topic href="topics/cwwarovr.html#cwwarovr" title="Web archive (WAR) files"/>
- </entry>
- <entry keyword="importing">
- <topic href="topics/twimpwar.html#twimpwar" title="Importing Web archive (WAR) files"/>
- </entry>
- <entry keyword="exporting">
- <topic href="topics/twcrewar.html#twcrewar" title="Exporting Web Archive (WAR) files"/>
- </entry>
- </entry>
- <entry keyword="enterprise applications">
- <entry keyword="projects">
- <entry keyword="dynamic Web projects">
- <topic href="topics/ccwebprj.html#ccwebprj" title="Dynamic Web projects and applications"/>
- </entry>
- </entry>
- </entry>
- <entry keyword="static Web projects">
- <entry keyword="creating">
- <topic href="topics/twcresta.html#twcresta" title="Creating a static Web project"/>
- </entry>
- <entry keyword="converting to dynamic">
- <topic href="topics/twpcnvrt.html#twpcnvrt" title="Converting static Web projects to dynamic Web projects"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/ccstatic.html#ccstatic" title="Static Web projects"/>
- </entry>
- </entry>
- <entry keyword="exporting">
- <entry keyword="WAR files">
- <topic href="topics/twcrewar.html#twcrewar" title="Exporting Web Archive (WAR) files"/>
- </entry>
- </entry>
- <entry keyword="virtual JAR files associations">
- <entry keyword="Web library projects">
- <topic href="topics/twplib.html#twplib" title="Adding Web library projects"/>
- </entry>
- </entry>
- <entry keyword="workbench">
- <entry keyword="Web editors">
- <topic href="topics/cwwedtvw.html#cwwedtvw" title="Workbench integration with Web editors"/>
- </entry>
- </entry>
- <entry keyword="Web pages">
- <entry keyword="creating">
- <topic href="topics/tjdetags.html#tjdetags" title="Creating and editing Web pages - overview"/>
- </entry>
- </entry>
- <entry keyword="framesets">
- <entry keyword="creating">
- <topic href="topics/tjcrehtm.html#tjcrehtm" title="Creating HTML and XHTML files and framesets"/>
- </entry>
- </entry>
- <entry keyword="HTML">
- <entry keyword="creating files">
- <topic href="topics/tjcrehtm.html#tjcrehtm" title="Creating HTML and XHTML files and framesets"/>
- </entry>
- <entry keyword="editing preferences">
- <topic href="topics/tjprefs.html#tjprefs" title="Defining HTML file preferences"/>
- </entry>
- </entry>
- <entry keyword="WML">
- <entry keyword="creating files">
- <topic href="topics/tjcrehtm.html#tjcrehtm" title="Creating HTML and XHTML files and framesets"/>
- </entry>
- </entry>
- <entry keyword="XHTML">
- <entry keyword="creating files">
- <topic href="topics/tjcrehtm.html#tjcrehtm" title="Creating HTML and XHTML files and framesets"/>
- </entry>
- </entry>
- <entry keyword="DOCTYPE declarations">
- <entry keyword="adding automatically">
- <topic href="topics/tjprefs.html#tjprefs" title="Defining HTML file preferences"/>
- </entry>
- </entry>
- <entry keyword="HTML files">
- <entry keyword="editing preferences">
- <topic href="topics/tjprefs.html#tjprefs" title="Defining HTML file preferences"/>
- </entry>
- </entry>
- <entry keyword="style sheets">
- <entry keyword="creating">
- <topic href="topics/tstylesheet.html#tstylesheet" title="Creating cascading style sheets"/>
- </entry>
- </entry>
- <entry keyword="JSP files">
- <entry keyword="creating">
- <topic href="topics/tjcrejsp.html#tjcrejsp" title="Creating JavaServer Pages (JSP) files"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
- </entry>
- </entry>
- <entry keyword="Web content">
- <entry keyword="generating dynamically">
- <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
- </entry>
- </entry>
- <entry keyword="servlets">
- <entry keyword="creating">
- <topic href="topics/twsrvwiz.html#twsrvwiz" title="Creating servlets"/>
- <topic href="topics/twlstwiz.html#twlstwiz" title="Creating Listeners"/>
- <topic href="topics/twfltwiz.html#twfltwiz" title="Creating Filters"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cwservbn.html#cwservbn" title="Servlets"/>
- </entry>
- </entry>
- <entry keyword="Web servers">
- <entry keyword="generating dynamic content">
- <topic href="topics/cwservbn.html#cwservbn" title="Servlets"/>
- </entry>
- </entry>
- <entry keyword="listeners">
- <entry keyword="overview">
- <topic href="topics/cwlistbn.html#cwlistbn" title="Listeners"/>
- </entry>
- </entry>
- <entry keyword="filters">
- <entry keyword="overview">
- <topic href="topics/cwfiltbn.html#cwfiltbn" title="Listeners"/>
- </entry>
- </entry>
- <entry keyword="build output folders">
- <entry keyword="ignoring in CVS">
- <topic href="topics/twcvsr.html#twcvsr" title="Setting CVS repository defaults"/>
- </entry>
- </entry>
- <entry keyword="CVS">
- <entry keyword="setting repository defaults">
- <topic href="topics/twcvsr.html#twcvsr" title="Setting CVS repository defaults"/>
- </entry>
- </entry>
- <entry keyword="cvsignore files">
- <entry keyword="creating">
- <topic href="topics/twcvsr.html#twcvsr" title="Setting CVS repository defaults"/>
- </entry>
- </entry>
- <entry keyword="repositories">
- <entry keyword="default CVS settings">
- <topic href="topics/twcvsr.html#twcvsr" title="Setting CVS repository defaults"/>
- </entry>
- </entry>
- <entry keyword="servers">
- <entry keyword="targeting">
- <topic href="topics/tservertarget.html#tservertarget" title="Server targeting for Web applications"/>
- </entry>
- </entry>
-</index> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/plugin.properties b/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
deleted file mode 100644
index 5d325186c8..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Web tools documentation
-providerName = Eclipse.org \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/plugin.xml b/docs/org.eclipse.wst.webtools.doc.user/plugin.xml
deleted file mode 100644
index 7b520b1b01..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
- <plugin>
- <extension point="org.eclipse.help.toc">
- <toc file="webtools_toc.xml" />
- <index path="index/"/>
- </extension>
-
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.webtools.doc.userindex.xml"/>
- </extension>
-
- </plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap
deleted file mode 100644
index 4778f32d43..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap
+++ /dev/null
@@ -1,482 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map title="Web tools related links">
-<reltable>
-<relheader>
-<relcolspec type="concept"></relcolspec>
-<relcolspec type="task"></relcolspec>
-<relcolspec type="reference"></relcolspec>
-</relheader>
-<relrow>
-<relcell></relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell>
-<topicref href="topics/tjchgxdt.dita" navtitle="Specifying an implicit document type for an HTML, XHTML, or JSP fragment">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell collection-type="family">
-<topicref href="topics/tjcrehtm.dita" navtitle="Creating HTML and XHTML files and framesets">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/cpdjsps.dita" linking="targetonly" navtitle="JavaServer Pages (JSP) technology"
-scope="peer"></topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/tjcrejsp.dita" navtitle="Creating JavaServer Pages (JSP) files">
-</topicref>
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell collection-type="family">
-<topicref href="topics/tservertarget.dita" navtitle="Server targeting for Web applications">
-</topicref>
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/ccstatic.dita" navtitle="Static Web projects" scope="peer">
-</topicref>
-<topicref href="topics/ccwebprj.dita" navtitle="Dynamic Web projects and applications"
-scope="peer"></topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcreprj.dita" navtitle="Creating a dynamic Web project">
-</topicref>
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/ccstatic.dita" navtitle="Static Web projects" scope="peer">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcresta.dita" navtitle="Creating a static Web project">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/cwwarovr.dita" navtitle="Web archive (WAR) files" scope="peer">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twcrewar.dita" navtitle="Exporting Web Archive (WAR) files">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell>
-<topicref href="topics/twcvsr.dita" navtitle="Setting CVS repository defaults"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/cwwarovr.dita" navtitle="Web archive (WAR) files" scope="peer">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twimpwar.dita" navtitle="Importing Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell collection-type="family"></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/ccstatic.dita" navtitle="Static Web projects" scope="peer">
-</topicref>
-<topicref href="topics/ccwebprj.dita" navtitle="Dynamic Web projects and applications"
-scope="peer"></topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twpcnvrt.dita" navtitle="Converting static Web projects to dynamic Web projects">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell>
-<topicref href="topics/twplib.dita" navtitle="Adding Web library projects">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell>
-<topicref href="topics/twprjset.dita" navtitle="Setting Web project properties">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwservbn.dita" linking="targetonly" navtitle="Servlets"
-scope="peer"></topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twsrvwiz.dita" navtitle="Creating Servlets"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwlistbn.dita" linking="targetonly" navtitle="Listeners"
-scope="peer"></topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twlstwiz.dita" navtitle="Creating Listeners"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwfiltbn.dita" linking="targetonly" navtitle="Filters"
-scope="peer"></topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twfltwiz.dita" navtitle="Creating Filters"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/ccwebvw.dita" navtitle="Project Explorer view and Web development">
-</topicref>
-</relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwebprojects.dita" navtitle="Web projects" scope="peer">
-</topicref>
-<topicref href="topics/ccwtover.dita" navtitle="Web application overview"
-scope="peer"></topicref>
-<topicref href="topics/cpdjsps.dita" navtitle="JavaServer Pages (JSP) technology"
-scope="peer"></topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twimpwar.dita" linking="targetonly" navtitle="Importing Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/ccwtover.dita" navtitle="Web application overview">
-</topicref>
-<topicref href="topics/cwtfeatures.dita" linking="targetonly" navtitle="Web tools features">
-</topicref>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"
-scope="peer">
-<topicref href="topics/tjdetags.dita" linking="targetonly" navtitle="Creating and editing Web pages - overview">
-<topicref href="topics/cwebartifact.dita" linking="targetonly" navtitle="Creating Web Artifacts">
-</topicref>
-</topicref>
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwtfeatures.dita" navtitle="Web tools features"></topicref>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-<topicref href="topics/ccwebprj.dita" linking="targetonly" navtitle="Dynamic Web projects and applications">
-</topicref>
-<topicref href="topics/cwebpagedesign.dita" linking="targetonly" navtitle="Web page design">
-</topicref>
-<!-- <topicref href="topics/cwebtechnologies.dita" linking="targetonly" navtitle="Web technologies">
-</topicref> -->
-</relcell>
-<relcell>
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"
-scope="peer"></topicref>
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"
-scope="peer"></topicref>
-<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating Servlets"
-scope="peer"></topicref>
-<topicref href="topics/twlstwiz.dita" linking="targetonly" navtitle="Creating Listeners"
-scope="peer"></topicref>
-<topicref href="topics/twfltwiz.dita" linking="targetonly" navtitle="Creating Filters"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<!-- <topicref href="topics/cwebtechnologies.dita" navtitle="Web technologies">
-</topicref> -->
-<topicref href="topics/ccwebprj.dita" linking="targetonly" navtitle="Dynamic Web projects and applications">
-</topicref>
-<topicref href="topics/cpdjsps.dita" linking="targetonly" navtitle="JavaServer Pages (JSP) technology">
-</topicref>
-</relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cpdjsps.dita" navtitle="JavaServer Pages (JSP) technology">
-</topicref>
-<topicref href="topics/cwservbn.dita" linking="targetonly" navtitle="Servlets">
-</topicref>
-<topicref href="topics/cwlistbn.dita" linking="targetonly" navtitle="Listeners">
-</topicref>
-<topicref href="topics/cwfiltbn.dita" linking="targetonly" navtitle="Filters">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwservbn.dita" navtitle="Servlets"></topicref>
-<topicref href="topics/cwlistbn.dita" navtitle="Listeners"></topicref>
-<topicref href="topics/cwfiltbn.dita" navtitle="Filters"></topicref>
-<topicref href="topics/ccwtover.dita" linking="targetonly" navtitle="Web application overview">
-</topicref>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-</relcell>
-<relcell>
-<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating Servlets"
-scope="peer"></topicref>
-<topicref href="topics/twlstwiz.dita" linking="targetonly" navtitle="Creating Listeners"
-scope="peer"></topicref>
-<topicref href="topics/twfltwiz.dita" linking="targetonly" navtitle="Creating Filters"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" navtitle="Web development tools">
-</topicref> -->
-<topicref href="topics/ccstatic.dita" linking="targetonly" navtitle="Static Web projects">
-</topicref>
-<topicref href="topics/ccwebprj.dita" linking="targetonly" navtitle="Dynamic Web projects and applications">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcresta.dita" linking="targetonly" navtitle="Creating a static Web project"
-scope="peer"></topicref>
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"
-scope="peer"></topicref>
-<topicref href="topics/tjcrehtm.dita" linking="targetonly" navtitle="Creating HTML and XHTML files and framesets"
-scope="peer"></topicref>
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/ccwtover.dita" linking="targetonly" navtitle="Web application overview">
-</topicref>
-<topicref href="topics/cwwedtvw.dita" linking="targetonly" navtitle="Workbench integration with Web editors">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/tjprefs.dita" linking="targetonly" navtitle="Defining HTML file preferences">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cpdjsps.dita" linking="targetonly" navtitle="JavaServer Pages (JSP) technology">
-</topicref>
-</relcell>
-<relcell collection-type="family"></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwebprojects.dita" navtitle="Web projects"></topicref>
-<topicref href="topics/ccstatic.dita" linking="targetonly" navtitle="Static Web projects">
-</topicref>
-<topicref href="topics/ccwebprj.dita" linking="targetonly" navtitle="Dynamic Web projects and applications">
-</topicref>
-<topicref href="topics/cwwarovr.dita" linking="targetonly" navtitle="Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcresta.dita" linking="targetonly" navtitle="Creating a static Web project"
-scope="peer"></topicref>
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/ccstatic.dita" navtitle="Static Web projects"></topicref>
-<topicref href="topics/cwebresources.dita" linking="targetonly" navtitle="Web resources">
-</topicref>
-<topicref href="topics/cwwarovr.dita" linking="targetonly" navtitle="Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twcresta.dita" linking="targetonly" navtitle="Creating a static Web project"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/ccwebprj.dita" navtitle="Dynamic Web projects and applications">
-</topicref>
-<topicref href="topics/cwebresources.dita" linking="targetonly" navtitle="Web resources">
-</topicref>
-<topicref href="topics/cwwarovr.dita" linking="targetonly" navtitle="Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"
-scope="peer"></topicref>
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwebpagedesign.dita" navtitle="Web page design"></topicref>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/tjdetags.dita" linking="targetonly" navtitle="Creating and editing Web pages - overview">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwebresources.dita" navtitle="Web resources"></topicref>
-<topicref href="topics/cwwarovr.dita" linking="targetonly" navtitle="Web archive (WAR) files">
-</topicref>
-</relcell>
-<relcell collection-type="family"></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwwedtvw.dita" navtitle="Workbench integration with Web editors">
-</topicref>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-</relcell>
-<relcell></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwebresources.dita" linking="targetonly" navtitle="Web resources">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell collection-type="family">
-<topicref href="topics/cwwarovr.dita" navtitle="Web archive (WAR) files">
-</topicref>
-<topicref href="topics/cwebresources.dita" linking="targetonly" navtitle="Web resources">
-</topicref>
-</relcell>
-<relcell>
-<topicref href="topics/twimpwar.dita" linking="targetonly" navtitle="Importing Web archive (WAR) files"
-scope="peer"></topicref>
-<topicref href="topics/twcrewar.dita" linking="targetonly" navtitle="Exporting Web Archive (WAR) files"
-scope="peer"></topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<topicref href="topics/cwebresources.dita" linking="targetonly" navtitle="Web resources">
-</topicref>
-</relcell>
-<relcell collection-type="family"></relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell>
-<!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">
-</topicref> -->
-<topicref href="topics/ccwtover.dita" linking="targetonly" navtitle="Web application overview">
-</topicref>
-</relcell>
-<relcell collection-type="family">
-<topicref href="topics/tjdetags.dita" navtitle="Creating and editing Web pages - overview">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-<relrow>
-<relcell></relcell>
-<relcell>
-<topicref href="topics/tjprefs.dita" navtitle="Defining HTML file preferences">
-</topicref>
-</relcell>
-<relcell></relcell>
-</relrow>
-</reltable>
-</map>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml
deleted file mode 100644
index 718a329008..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Web tools related links"/>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.dita
deleted file mode 100644
index 7e809fbf88..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.dita
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="ccstatic" xml:lang="en-us">
-<title>Static Web projects</title>
-<prolog><metadata>
-<keywords><indexterm>Web projects<indexterm>static</indexterm></indexterm>
-<indexterm>static Web projects<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>If you want to create a content-based Web application that does not contain
-any dynamic content (such as servlets, JSP files, filters, and associated
-metadata) you might prefer to create a static Web project, as opposed to a <xref
-href="ccwebprj.dita" scope="peer"><desc></desc>dynamic Web project</xref>.</p>
-<p>Static Web projects have the following characteristics: <ul>
-<li>a Web content folder (called WebContent) for all publishable resources,
-You can change the name of this folder from the project's pop-up menu.</li>
-<li>a Theme folder, the suggested directory for storing cascading style sheets
-and other style-related objects.</li>
-<li>the ability to define folders outside of the Web content folder, for storing
-intermediate files, such as MIF files</li>
-<li>a conversion path from a static Web project to a dynamic Web project.
-If you decide to <xref href="twpcnvrt.dita" scope="peer"><desc></desc>convert</xref> the
-project, it will be a fully-valid dynamic Web project. </li>
-</ul></p>
-<p>In addition, your project will still have the following features (which
-are common to both static and dynamic Web projects ) : <ul>
-<li>HTML syntax validation</li>
-<li>a broken link fix-up wizard</li>
-<li>a Web site navigation tool</li>
-<li>a new server type, the Static Web server, which makes it easy to publish
-static Web projects</li>
-</ul> </p>
-<p>The folder that a static Web project is published to is modifiable, so
-that when you set the publishing "root" value (called a <i>context root</i>),
-such as <codeph>/web1</codeph>, for a static project, everything in the Web
-content folder will be published to the <filepath>web1</filepath> folder under
-the Web server's doc root. This enables you to group Web resources on a Web
-server in folders that correspond to Web projects in the workbench. When projects
-defined in this way are ready for production, you can publish specific projects
-directly to the doc root by changing the value to <codeph>/</codeph> and all
-publishing, link fixing, and browsing will update automatically.</p>
-<p>Aliases can also be used to specify a context root value. For example,
-suppose that there is an alias that is defined on the target Web server, as
-follows: <codeblock>Alias /scripts/ "/var/www/scripts"</codeblock>In this
-example, in which the current static Web project will contain common <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> files,
-you can set the context root value to be <ph>"scripts"</ph>. In order for
-the resources in the static Web project to be published to the correct location
-on the Web server, you must add this Alias mapping to the server tools instance
-of the static Web server, as follows. <ol>
-<li>From the Server view, double-click on the static Web server configuration
-to open the server configuration editor.<note>This assumes that you've already
-defined the static Web server.</note></li>
-<li>Click the <uicontrol>Configuration</uicontrol> editor tab.</li>
-<li>Scroll down to the <uicontrol>Alias Path Mapping</uicontrol> section,
-and add the new Alias mapping.</li>
-</ol>Now that <ph>"scripts"</ph> is defined as an Alias, the Web content in
-the static Web project will be published to the mapped path, <filepath>/var/www/scripts</filepath>.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
deleted file mode 100644
index 6dae35501a..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Static Web projects" />
-<meta content="Web projects, static, static Web projects, overview" name="DC.subject" />
-<meta content="Web projects, static, static Web projects, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcresta.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ccstatic" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Static Web projects</title>
-</head>
-<body id="ccstatic"><a name="ccstatic"><!-- --></a>
-
-
-<h1 class="topictitle1">Static Web projects</h1>
-
-
-<div>
-<p>If you want to create a content-based Web application that does not contain
-any dynamic content (such as servlets, JSP files, filters, and associated
-metadata) you might prefer to create a static Web project, as opposed to a <a href="ccwebprj.html" title="">dynamic Web project</a>.</p>
-
-<div class="p">Static Web projects have the following characteristics: <ul>
-<li>a Web content folder (called WebContent) for all publishable resources,
-You can change the name of this folder from the project's pop-up menu.</li>
-
-<li>a Theme folder, the suggested directory for storing cascading style sheets
-and other style-related objects.</li>
-
-<li>the ability to define folders outside of the Web content folder, for storing
-intermediate files, such as MIF files</li>
-
-<li>a conversion path from a static Web project to a dynamic Web project.
-If you decide to <a href="twpcnvrt.html" title="">convert</a> the
-project, it will be a fully-valid dynamic Web project. </li>
-
-</ul>
-</div>
-
-<div class="p">In addition, your project will still have the following features (which
-are common to both static and dynamic Web projects ) : <ul>
-<li>HTML syntax validation</li>
-
-<li>a broken link fix-up wizard</li>
-
-<li>a Web site navigation tool</li>
-
-<li>a new server type, the Static Web server, which makes it easy to publish
-static Web projects</li>
-
-</ul>
- </div>
-
-<p>The folder that a static Web project is published to is modifiable, so
-that when you set the publishing "root" value (called a <em>context root</em>),
-such as <samp class="codeph">/web1</samp>, for a static project, everything in the Web
-content folder will be published to the <span class="filepath">web1</span> folder under
-the Web server's doc root. This enables you to group Web resources on a Web
-server in folders that correspond to Web projects in the workbench. When projects
-defined in this way are ready for production, you can publish specific projects
-directly to the doc root by changing the value to <samp class="codeph">/</samp> and all
-publishing, link fixing, and browsing will update automatically.</p>
-
-<div class="p">Aliases can also be used to specify a context root value. For example,
-suppose that there is an alias that is defined on the target Web server, as
-follows: <pre>Alias /scripts/ "/var/www/scripts"</pre>
-In this
-example, in which the current static Web project will contain common JavaScriptâ„¢ files,
-you can set the context root value to be <span>"scripts"</span>. In order for
-the resources in the static Web project to be published to the correct location
-on the Web server, you must add this Alias mapping to the server tools instance
-of the static Web server, as follows. <ol>
-<li>From the Server view, double-click on the static Web server configuration
-to open the server configuration editor.<div class="note"><span class="notetitle">Note:</span> This assumes that you've already
-defined the static Web server.</div>
-</li>
-
-<li>Click the <span class="uicontrol">Configuration</span> editor tab.</li>
-
-<li>Scroll down to the <span class="uicontrol">Alias Path Mapping</span> section,
-and add the new Alias mapping.</li>
-
-</ol>
-Now that <span>"scripts"</span> is defined as an Alias, the Web content in
-the static Web project will be published to the mapped path, <span class="filepath">/var/www/scripts</span>.</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
-<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcresta.html">Creating a static Web project</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita
deleted file mode 100644
index e15ac5f11b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="ccwebprj" xml:lang="en-us">
-<title>Dynamic Web projects and applications</title>
-<prolog><metadata>
-<keywords><indexterm>enterprise applications<indexterm>projects<indexterm>dynamic
-Web projects</indexterm></indexterm></indexterm><indexterm>Web projects<indexterm>dynamic
-projects overview</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>There are two types of Web projects: dynamic and <xref href="ccstatic.dita"
-scope="peer"><desc></desc>static</xref>. Dynamic web projects can contain
-dynamic Java EE resources such as servlets, JSP files, filters, and associated
-metadata, in addition to static resources such as images and HTML files. Static
-web projects only contains static resources. When you create Web projects,
-you can include cascading style sheets and JSP tag libraries (for dynamic
-Web projects), so that you can begin development with a richer set of project
-resources.</p>
-<p>Dynamic Web projects are always embedded in Enterprise Application projects.
-The wizard that you use to create a dynamic Web project will also create an
-Enterprise Application (EAR) project if it does not already exist. The wizard
-will also update the <filepath>application.xml</filepath> deployment descriptor
-of the specified Enterprise Application project to define the Web project
-as a module element. If you are importing a WAR file rather than creating
-a dynamic Web project new, the WAR Import wizard requires that you specify
-a Web project, which already requires an EAR project. </p>
-<p>Java EE conventions may represent extra overhead if you only want to create
-a static, content-based Web application, which contains no dynamic files,
-such as JSP files or servlets. In this case, when you need only the most basic
-Web project, you might want to use the <i>static</i> Web project type (see <xref
-href="ccstatic.dita" scope="peer"><desc></desc>Static Web projects</xref>).
- Note that static Web projects can be converted to dynamic Web projects by
-selecting <b>Convert to a Dynamic Web Project</b>, from the Project menu.</p>
-<p>The Java EE model, and more specifically, the <cite>Sun Microsystems <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-2.3 Specification</cite>, defines a Web application directory structure that
-specifies the location of Web content files, class files, class paths, deployment
-descriptors, and supporting metadata. The Web project hierarchy mirrors that
-of the Web application created from a project. In the workbench, you can use
-the <ph>New Web Project</ph> wizard to create a new Web project.</p>
-<p>The main project folder contains all development objects related to a Web
-application. The Web content folder contains the elements of the project necessary
-to create a Web application. This folder structure maps to the Web application
-archive (WAR) structure defined by Sun Microsystems.. The following default
-elements are located in the Web project folder hierarchy: <note>In the Project
-Explorer view, Web projects are filtered into folder nodes to customize the
-display of Web resources for easy management during development. For information
-on the filtered structure, see <xref href="ccwebvw.dita" scope="peer"><desc></desc>Project
-Explorer view</xref>.</note><dl><dlentry>
-<dt>Web Deployment Descriptor</dt>
-<dd>The standard Web application deployment descriptor (the <filepath>web.xml</filepath> file).</dd>
-</dlentry><dlentry>
-<dt>JavaSource</dt>
-<dd>Contains the project's <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> source code for classes, beans, and
-servlets. When these resources are added to a Web project, they are automatically
-compiled and the generated files are added to the WEB-INF/classes directory.
-The contents of the source directory are not packaged in WAR files unless
-an option is specified when a WAR file is created. <note>Though the default
-name given to the folder is JavaSources, you can change the name by right
-clicking on the name in the Project Explorer and clicking on <menucascade>
-<uicontrol>Refactor</uicontrol><uicontrol>Rename</uicontrol></menucascade>.</note></dd>
-</dlentry><dlentry>
-<dt>imported_classes folder</dt>
-<dd>This folder may be created during a WAR import, and contains class files
-that do not have accompanying source. The <uicontrol>imported_classes</uicontrol> folder
-is a <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> classes
-folder; <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="Java">Java</tm> classes folders can also be created using the Web
-project <uicontrol>Java Build Path</uicontrol> properties page.</dd>
-</dlentry><dlentry>
-<dt>WebContent folder</dt>
-<dd>The mandatory location of all Web resources, including HTML, JSP, graphic
-files, and so on. If the files are not placed in this directory (or in a subdirectory
-structure under this directory), the files will not be available when the
-application is executed on a server. The Web content folder represents the
-contents of the WAR file that will be deployed to the server. Any files not
-under the Web content folder are considered development-time resources (for
-example, .java files, .sql files, and .mif files), and are not deployed when
-the project is unit tested or published. <note>Though the default name given
-to the folder is <filepath>WebContent</filepath>, you can change the name
- in the Project Explorer by right-clicking the folder and selecting <uicontrol>Refactor</uicontrol><uicontrol>Rename</uicontrol> or
-from the Web page of the project's Properties dialog. In a dynamic Web project,
-changing the folder name will update the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build output directory. </note></dd>
-</dlentry><dlentry>
-<dt>META-INF</dt>
-<dd>This directory contains the <filepath>MANIFEST.MF</filepath> file, which
-is used to map class paths for dependent JAR files that exist in other projects
-in the same Enterprise Application project. An entry in this file will update
-the run-time project class path and <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build settings to include the referenced
-JAR files.</dd>
-</dlentry><dlentry>
-<dt>theme</dt>
-<dd>The suggested directory for cascading style sheets and other style-related
-objects.</dd>
-</dlentry><dlentry>
-<dt>WEB-INF</dt>
-<dd>Based on the <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite>, this
-directory contains the supporting Web resources for a Web application, including
-the <filepath>web.xml</filepath> file and the classes and lib directories.</dd>
-</dlentry><dlentry>
-<dt>/classes</dt>
-<dd>This directory is for servlets, utility classes, and the <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> compiler
-output directory. The classes in this directory are used by the application
-class loader to load the classes. Folders in this directory will map package
-and class names, as in: <codeph>/WEB-INF/classes/com/mycorp/servlets/MyServlet.class</codeph>.<p>Do
-not place any .class files directly into this directory. The .class files
-are placed in this directory automatically when the <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> compiler
-compiles <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="Java">Java</tm> source files that are in the <filepath>Java Resources</filepath> directory.
-Any files placed directly in this directory will be deleted by the <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> compiler
-when it runs.</p></dd>
-</dlentry><dlentry>
-<dt>/lib</dt>
-<dd>The supporting JAR files that your Web application references. Any classes
-in .jar files placed in this directory will be available for your Web application</dd>
-</dlentry><dlentry>
-<dt>Libraries</dt>
-<dd>The supporting JAR files that your Web application references. This folder
-mirrors the content of the lib folder. In addition, Web Library Projects,
-which are "virtual" JAR files that do not physically reside in the Web project,
-but are associated with <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> projects elsewhere in your workspace,
-are included in this folder. They are packaged with your project when you
-export the application's WAR file.</dd>
-</dlentry></dl> <note>A library entry on the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build path will remain there unless
-the actual JAR file is deleted from the WEB-INF/lib folder. If you remove
-a library path entry but not the JAR file, the library entry will be re-added
-to the path automatically.</note></p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
deleted file mode 100644
index 558e5c23e2..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Dynamic Web projects and applications" />
-<meta content="enterprise applications, projects, dynamic Web projects, Web projects, dynamic projects overview" name="DC.subject" />
-<meta content="enterprise applications, projects, dynamic Web projects, Web projects, dynamic projects overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ccwebprj" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Dynamic Web projects and applications</title>
-</head>
-<body id="ccwebprj"><a name="ccwebprj"><!-- --></a>
-
-
-<h1 class="topictitle1">Dynamic Web projects and applications</h1>
-
-
-<div>
-<p>There are two types of Web projects: dynamic and <a href="ccstatic.html" title="">static</a>. Dynamic web projects can contain
-dynamic Java EE resources such as servlets, JSP files, filters, and associated
-metadata, in addition to static resources such as images and HTML files. Static
-web projects only contains static resources. When you create Web projects,
-you can include cascading style sheets and JSP tag libraries (for dynamic
-Web projects), so that you can begin development with a richer set of project
-resources.</p>
-
-<p>Dynamic Web projects are always embedded in Enterprise Application projects.
-The wizard that you use to create a dynamic Web project will also create an
-Enterprise Application (EAR) project if it does not already exist. The wizard
-will also update the <span class="filepath">application.xml</span> deployment descriptor
-of the specified Enterprise Application project to define the Web project
-as a module element. If you are importing a WAR file rather than creating
-a dynamic Web project new, the WAR Import wizard requires that you specify
-a Web project, which already requires an EAR project. </p>
-
-<p>Java EE conventions may represent extra overhead if you only want to create
-a static, content-based Web application, which contains no dynamic files,
-such as JSP files or servlets. In this case, when you need only the most basic
-Web project, you might want to use the <em>static</em> Web project type (see <a href="ccstatic.html" title="">Static Web projects</a>).
- Note that static Web projects can be converted to dynamic Web projects by
-selecting <strong>Convert to a Dynamic Web Project</strong>, from the Project menu.</p>
-
-<p>The Java EE model, and more specifically, the <cite>Sun Microsystems Javaâ„¢ Servlet
-2.3 Specification</cite>, defines a Web application directory structure that
-specifies the location of Web content files, class files, class paths, deployment
-descriptors, and supporting metadata. The Web project hierarchy mirrors that
-of the Web application created from a project. In the workbench, you can use
-the <span>New Web Project</span> wizard to create a new Web project.</p>
-
-<div class="p">The main project folder contains all development objects related to a Web
-application. The Web content folder contains the elements of the project necessary
-to create a Web application. This folder structure maps to the Web application
-archive (WAR) structure defined by Sun Microsystems.. The following default
-elements are located in the Web project folder hierarchy: <div class="note"><span class="notetitle">Note:</span> In the Project
-Explorer view, Web projects are filtered into folder nodes to customize the
-display of Web resources for easy management during development. For information
-on the filtered structure, see <a href="ccwebvw.html" title="">Project Explorer view</a>.</div>
-<dl>
-<dt class="dlterm">Web Deployment Descriptor</dt>
-
-<dd>The standard Web application deployment descriptor (the <span class="filepath">web.xml</span> file).</dd>
-
-
-<dt class="dlterm">JavaSource</dt>
-
-<dd>Contains the project's Java source code for classes, beans, and
-servlets. When these resources are added to a Web project, they are automatically
-compiled and the generated files are added to the WEB-INF/classes directory.
-The contents of the source directory are not packaged in WAR files unless
-an option is specified when a WAR file is created. <div class="note"><span class="notetitle">Note:</span> Though the default
-name given to the folder is JavaSources, you can change the name by right
-clicking on the name in the Project Explorer and clicking on <span class="menucascade">
-<span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span></span>.</div>
-</dd>
-
-
-<dt class="dlterm">imported_classes folder</dt>
-
-<dd>This folder may be created during a WAR import, and contains class files
-that do not have accompanying source. The <span class="uicontrol">imported_classes</span> folder
-is a Java classes
-folder; Java classes folders can also be created using the Web
-project <span class="uicontrol">Java Build Path</span> properties page.</dd>
-
-
-<dt class="dlterm">WebContent folder</dt>
-
-<dd>The mandatory location of all Web resources, including HTML, JSP, graphic
-files, and so on. If the files are not placed in this directory (or in a subdirectory
-structure under this directory), the files will not be available when the
-application is executed on a server. The Web content folder represents the
-contents of the WAR file that will be deployed to the server. Any files not
-under the Web content folder are considered development-time resources (for
-example, .java files, .sql files, and .mif files), and are not deployed when
-the project is unit tested or published. <div class="note"><span class="notetitle">Note:</span> Though the default name given
-to the folder is <span class="filepath">WebContent</span>, you can change the name
- in the Project Explorer by right-clicking the folder and selecting <span class="uicontrol">Refactor</span><span class="uicontrol">Rename</span> or
-from the Web page of the project's Properties dialog. In a dynamic Web project,
-changing the folder name will update the Java build output directory. </div>
-</dd>
-
-
-<dt class="dlterm">META-INF</dt>
-
-<dd>This directory contains the <span class="filepath">MANIFEST.MF</span> file, which
-is used to map class paths for dependent JAR files that exist in other projects
-in the same Enterprise Application project. An entry in this file will update
-the run-time project class path and Java build settings to include the referenced
-JAR files.</dd>
-
-
-<dt class="dlterm">theme</dt>
-
-<dd>The suggested directory for cascading style sheets and other style-related
-objects.</dd>
-
-
-<dt class="dlterm">WEB-INF</dt>
-
-<dd>Based on the <cite>Sun Microsystems Java Servlet 2.3 Specification</cite>, this
-directory contains the supporting Web resources for a Web application, including
-the <span class="filepath">web.xml</span> file and the classes and lib directories.</dd>
-
-
-<dt class="dlterm">/classes</dt>
-
-<dd>This directory is for servlets, utility classes, and the Java compiler
-output directory. The classes in this directory are used by the application
-class loader to load the classes. Folders in this directory will map package
-and class names, as in: <samp class="codeph">/WEB-INF/classes/com/mycorp/servlets/MyServlet.class</samp>.<p>Do
-not place any .class files directly into this directory. The .class files
-are placed in this directory automatically when the Java compiler
-compiles Java source files that are in the <span class="filepath">Java Resources</span> directory.
-Any files placed directly in this directory will be deleted by the Java compiler
-when it runs.</p>
-</dd>
-
-
-<dt class="dlterm">/lib</dt>
-
-<dd>The supporting JAR files that your Web application references. Any classes
-in .jar files placed in this directory will be available for your Web application</dd>
-
-
-<dt class="dlterm">Libraries</dt>
-
-<dd>The supporting JAR files that your Web application references. This folder
-mirrors the content of the lib folder. In addition, Web Library Projects,
-which are "virtual" JAR files that do not physically reside in the Web project,
-but are associated with Java projects elsewhere in your workspace,
-are included in this folder. They are packaged with your project when you
-export the application's WAR file.</dd>
-
-</dl>
- <div class="note"><span class="notetitle">Note:</span> A library entry on the Java build path will remain there unless
-the actual JAR file is deleted from the WEB-INF/lib folder. If you remove
-a library path entry but not the JAR file, the library entry will be re-added
-to the path automatically.</div>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
-<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
-<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita
deleted file mode 100644
index 4c043e0c48..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="ccwebvw" xml:lang="en-us">
-<title>Project Explorer view and Web development</title>
-<prolog><metadata>
-<keywords><indexterm keyref="ccwebvw|1|ProjectExplorerviewoverview" status="new">Project
-Explorer view<indexterm>overview</indexterm></indexterm><indexterm keyref="ccwebvw|2|WebdevelopmentProjectExplorerview"
-status="changed">Web projects<indexterm>Project Explorer view</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<section><p>The Project Explorer view provides the following notable features: <ul>
-<li><image alt="For Windows" href="../images/nwin.gif" placement="inline">
-</image> You can drag and drop files from <tm tmclass="special" tmowner="Microsoft Corporation"
-tmtype="reg" trademark="Windows">Windows</tm> Explorer or the desktop into
-the Navigator view.</li>
-<li>View filtering is supported by selecting <ph><uicontrol>Filters</uicontrol></ph> from
-the Navigator view <ph><uicontrol>Menu</uicontrol></ph> button. Resources
-can be filtered by name, project type or content type. Files beginning with
-a period are filtered out by default.</li>
-<li>The status line shows the full path of the selected resource.</li>
-<li>Dragging a .java file from the Navigator view into a JSP file will insert
-a usebean tag, the same behavior that is exhibited when a .class file is dragged
-into a JSP file.</li>
-<li>Errors and warnings on resources (including <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm>, HTML/JSP, and Links Builder errors
-and warnings) are indicated with a red error <image alt="Error icon" href="../images/nshowerr.gif"
-placement="inline"></image> or yellow warning <image alt="Warning icon" href="../images/nwarning.gif"
-placement="inline"></image> next to the resource with the error, as well as
-the parent containers up to the project. This applies for all project types,
-not only Web projects.</li>
-<li>Items available from the <ph><uicontrol>New</uicontrol></ph> cascading
-menu in the project pop-up menu are context sensitive. All menus will have <ph><uicontrol>Project</uicontrol></ph> and <ph><uicontrol>Other</uicontrol
-></ph> options.</li>
-</ul></p></section>
-<section><title>Organization of the Project Explorer view</title><p>The Project
-Explorer view shows a custom view of all Web projects. The following are some
-of the notable top-level objects that appear beneath the project node (based
-on default folder names).</p><p><b>Web content folder</b> - This folder contains
-items to be published to the server. By default, this folder will be named <b>WebContent</b> for
-newly created static and dynamic Web projects. <note>You can change the name
-in the creation wizard Web facet page.</note><ul>
-<li><b>META-INF</b> - This directory contains the <filepath>MANIFEST.MF</filepath> file,
-which is used to map class paths for dependent JAR files that exist in other
-projects in the same Enterprise Application project. An entry in this file
-will update the run-time project class path and <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build settings to include the referenced
-JAR files.</li>
-</ul><ul>
-<li><b>WEB-INF</b> - The directory where supporting Web resources for a Web
-application are kept (for example: .xmi files, .xml files, and web.xml.) </li>
-</ul> </p> </section>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
deleted file mode 100644
index abf57ac8d1..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Project Explorer view and Web development" />
-<meta content="Project Explorer view, overview, Web projects, Project Explorer view" name="DC.subject" />
-<meta content="Project Explorer view, overview, Web projects, Project Explorer view" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ccwebvw" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Project Explorer view and Web development</title>
-</head>
-<body id="ccwebvw"><a name="ccwebvw"><!-- --></a>
-
-
-<h1 class="topictitle1">Project Explorer view and Web development</h1>
-
-
-<div>
-<div class="section"><div class="p">The Project Explorer view provides the following notable features: <ul>
-<li><img src="../images/nwin.gif" alt="For Windows" /> You can drag and drop files from Windows<sup>®</sup> Explorer or the desktop into
-the Navigator view.</li>
-
-<li>View filtering is supported by selecting <span><span class="uicontrol">Filters</span></span> from
-the Navigator view <span><span class="uicontrol">Menu</span></span> button. Resources
-can be filtered by name, project type or content type. Files beginning with
-a period are filtered out by default.</li>
-
-<li>The status line shows the full path of the selected resource.</li>
-
-<li>Dragging a .java file from the Navigator view into a JSP file will insert
-a usebean tag, the same behavior that is exhibited when a .class file is dragged
-into a JSP file.</li>
-
-<li>Errors and warnings on resources (including Javaâ„¢, HTML/JSP, and Links Builder errors
-and warnings) are indicated with a red error <img src="../images/nshowerr.gif" alt="Error icon" /> or yellow warning <img src="../images/nwarning.gif" alt="Warning icon" /> next to the resource with the error, as well as
-the parent containers up to the project. This applies for all project types,
-not only Web projects.</li>
-
-<li>Items available from the <span><span class="uicontrol">New</span></span> cascading
-menu in the project pop-up menu are context sensitive. All menus will have <span><span class="uicontrol">Project</span></span> and <span><span class="uicontrol">Other</span></span> options.</li>
-
-</ul>
-</div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Organization of the Project Explorer view</h4><p>The Project
-Explorer view shows a custom view of all Web projects. The following are some
-of the notable top-level objects that appear beneath the project node (based
-on default folder names).</p>
-<div class="p"><strong>Web content folder</strong> - This folder contains
-items to be published to the server. By default, this folder will be named <strong>WebContent</strong> for
-newly created static and dynamic Web projects. <div class="note"><span class="notetitle">Note:</span> You can change the name
-in the creation wizard Web facet page.</div>
-<ul>
-<li><strong>META-INF</strong> - This directory contains the <span class="filepath">MANIFEST.MF</span> file,
-which is used to map class paths for dependent JAR files that exist in other
-projects in the same Enterprise Application project. An entry in this file
-will update the run-time project class path and Java build settings to include the referenced
-JAR files.</li>
-
-</ul>
-<ul>
-<li><strong>WEB-INF</strong> - The directory where supporting Web resources for a Web
-application are kept (for example: .xmi files, .xml files, and web.xml.) </li>
-
-</ul>
- </div>
- </div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.dita
deleted file mode 100644
index 880cc3a16b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.dita
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<!-- ArborText, Inc., 1988-2002, v.4002 -->
-<concept id="ccwtover" xml:lang="en-us">
-<title>Web application overview</title>
-<prolog><metadata>
-<keywords><indexterm>Web applications<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>The Web development environment provides the tools you need to develop
-Web applications as defined in the <cite>Sun Microsystems <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-2.3 Specification</cite> and the <cite>Sun Microsystems JSP 1.2 Specification</cite>.
-Web applications can be simple (consisting of only static Web pages) or they
-can be more advanced and include JavaServer Pages (JSP) files and <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> servlets.
-These resources, along with an XML deployment descriptor (and other <xref
-href="cwebresources.dita" scope="peer"><desc></desc> Web resources</xref>, are contained
-within a Web project during development. When you are ready to publish the
-Web application to the Web, you deploy the Web project to the server in the
-form of a Web archive (WAR) file . The end user can then view the Web application
-as a Web site from a URL.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html
deleted file mode 100644
index d886e375a3..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web application overview" />
-<meta content="Web applications, overview" name="DC.subject" />
-<meta content="Web applications, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwtfeatures.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjdetags.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwebartifact.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ccwtover" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web application overview</title>
-</head>
-<body id="ccwtover"><a name="ccwtover"><!-- --></a>
-
-
-<h1 class="topictitle1">Web application overview</h1>
-
-
-<div>
-<p>The Web development environment provides the tools you need to develop
-Web applications as defined in the <cite>Sun Microsystems Javaâ„¢ Servlet
-2.3 Specification</cite> and the <cite>Sun Microsystems JSP 1.2 Specification</cite>.
-Web applications can be simple (consisting of only static Web pages) or they
-can be more advanced and include JavaServer Pages (JSP) files and Java servlets.
-These resources, along with an XML deployment descriptor (and other <a href="cwebresources.html" title="">Web resources</a>, are contained
-within a Web project during development. When you are ready to publish the
-Web application to the Web, you deploy the Web project to the server in the
-form of a Web archive (WAR) file . The end user can then view the Web application
-as a Web site from a URL.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwtfeatures.html" title="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications.">Web tools features</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
-<div><a href="../topics/tjdetags.html">Creating and editing Web pages - overview</a></div>
-<div><a href="../topics/cwebartifact.html">Creating Web Artifacts</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita
deleted file mode 100644
index d7224f0fdb..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cpdjsps" xml:lang="en-us">
-<title>JavaServer Pages (JSP) technology</title>
-<prolog><metadata>
-<keywords><indexterm keyref="cpdjsps|1|JSPpagesoverview" status="changed">JSP
-files<indexterm>overview</indexterm></indexterm><indexterm keyref="cpdjsps|2|Webcontentgeneratingdynamically"
-status="new">Web content<indexterm>generating dynamically</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>The JavaServer Pages technology enables you to generate dynamic web content,
-such as HTML, DHTML, XHTML, and XML files, to include in a Web application.
-JSP files are one way to implement server-side dynamic page content. JSP files
-allow a Web server, such as Apache Tomcat, to add content dynamically to your
-HTML pages before they are sent to a requesting browser.</p>
-<p>When you deploy a JSP file to a Web server that provides a servlet engine,
-it is preprocessed into a servlet that runs on the Web server. This is in
-contrast with client-side <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="JavaScript">JavaScript</tm> (within <codeph>&lt;SCRIPT></codeph> tags),
-which is run in a browser. A JSP page is ideal for tasks that are better suited
-to execution on the server, such as accessing databases or calling Enterprise <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans.</p>
-<p>You can create and edit a JSP file in the HTML editor by adding your own
-text and images using HTML, JSP tagging, or <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="JavaScript">JavaScript</tm>, including <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> source
-code inside of scriptlet tags. Typically, JSP files have the file extension
-.jsp. Additionally, the JSP specification suggests that JSP fragment files
-should have file extension .jspf. If this convention is not followed, the
-JSP validator will treat JSP fragments as regular standalone JSP files, and
-compilation errors might be reported.</p>
-<p>The <cite>Sun Microsystems JSP 1.2 Specification</cite> provides the ability
-to create custom JSP tags. Custom tags simplify complex actions and provide
-developers with greater control over page content. Custom tags are collected
-into a library (taglib). A tag library descriptor file (taglib.tld) is an
-XML document that provides information about the tag library, including the
-taglib short name, library description, and tag descriptions. Refer to the <cite>Sun
-Microsystems JSP 1.2 Specification</cite> for more details.</p>
-<p>To use JSP 1.2 custom taglibs, you can import the tag library .tld and
-.jar files into your project to use them, or associate them as Web Library
-projects. You can also reference a TLD file by using a URI.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html
deleted file mode 100644
index 50dc629ff2..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="JavaServer Pages (JSP) technology" />
-<meta content="JSP files, overview, Web content, generating dynamically" name="DC.subject" />
-<meta content="JSP files, overview, Web content, generating dynamically" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cpdjsps" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>JavaServer Pages (JSP) technology</title>
-</head>
-<body id="cpdjsps"><a name="cpdjsps"><!-- --></a>
-
-
-<h1 class="topictitle1">JavaServer Pages (JSP) technology</h1>
-
-
-<div>
-<p>The JavaServer Pages technology enables you to generate dynamic web content,
-such as HTML, DHTML, XHTML, and XML files, to include in a Web application.
-JSP files are one way to implement server-side dynamic page content. JSP files
-allow a Web server, such as Apache Tomcat, to add content dynamically to your
-HTML pages before they are sent to a requesting browser.</p>
-
-<p>When you deploy a JSP file to a Web server that provides a servlet engine,
-it is preprocessed into a servlet that runs on the Web server. This is in
-contrast with client-side JavaScriptâ„¢ (within <samp class="codeph">&lt;SCRIPT&gt;</samp> tags),
-which is run in a browser. A JSP page is ideal for tasks that are better suited
-to execution on the server, such as accessing databases or calling Enterprise Javaâ„¢ beans.</p>
-
-<p>You can create and edit a JSP file in the HTML editor by adding your own
-text and images using HTML, JSP tagging, or JavaScript, including Java source
-code inside of scriptlet tags. Typically, JSP files have the file extension
-.jsp. Additionally, the JSP specification suggests that JSP fragment files
-should have file extension .jspf. If this convention is not followed, the
-JSP validator will treat JSP fragments as regular standalone JSP files, and
-compilation errors might be reported.</p>
-
-<p>The <cite>Sun Microsystems JSP 1.2 Specification</cite> provides the ability
-to create custom JSP tags. Custom tags simplify complex actions and provide
-developers with greater control over page content. Custom tags are collected
-into a library (taglib). A tag library descriptor file (taglib.tld) is an
-XML document that provides information about the tag library, including the
-taglib short name, library description, and tag descriptions. Refer to the <cite>Sun
-Microsystems JSP 1.2 Specification</cite> for more details.</p>
-
-<p>To use JSP 1.2 custom taglibs, you can import the tag library .tld and
-.jar files into your project to use them, or associate them as Web Library
-projects. You can also reference a TLD file by using a URI.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
-<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
-<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita
deleted file mode 100644
index 1b4bdafc37..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<!-- ArborText, Inc., 1988-2002, v.4002 -->
-<concept id="cwebartifact" xml:lang="en-us">
-<title>Creating Web Artifacts</title>
-<conbody>
-<p>Contents:</p>
-<ul>
-<li><xref href="twsrvwiz.dita" scope="peer"><desc></desc>Creating Servlets</xref></li>
-<li><xref href="twlstwiz.dita" scope="peer"><desc></desc>Creating Listeners</xref></li>
-<li><xref href="twfltwiz.dita" scope="peer"><desc></desc>Creating Filters</xref></li>
-</ul>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html
deleted file mode 100644
index 0adf7497cb..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Creating Web Artifacts" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwebartifact" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating Web Artifacts</title>
-</head>
-<body id="cwebartifact"><a name="cwebartifact"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating Web Artifacts</h1>
-
-<div>
-<p>Contents:</p>
-
-<ul>
-<li><a href="twsrvwiz.html" title="">Creating Servlets</a></li>
-
-<li><a href="twlstwiz.html" title="">Creating Listeners</a></li>
-
-<li><a href="twfltwiz.html" title="">Creating Filters</a></li>
-
-</ul>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.dita
deleted file mode 100644
index 3f1624f575..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.dita
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwebpagedesign" xml:lang="en-us">
-<title>Web page design</title>
-<prolog><metadata>
-<keywords><indexterm>Web page design<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>Web pages are an integral part of every Web application. Each Web page
-should serve to help achieve the overall goal of the entire Web site.</p>
-<p> There are many types of Web pages, ranging from simple HTML pages that
-contain no dynamic elements, to advanced Java-based pages that make use of
-servlets, scripts, forms, or data access components.</p>
-<p>A few of the many items you should consider when designing your pages are
-markup language, links, images, and style sheets.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html
deleted file mode 100644
index b2e217f6b2..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web page design" />
-<meta content="Web page design, overview" name="DC.subject" />
-<meta content="Web page design, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjdetags.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwebpagedesign" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web page design</title>
-</head>
-<body id="cwebpagedesign"><a name="cwebpagedesign"><!-- --></a>
-
-
-<h1 class="topictitle1">Web page design</h1>
-
-
-<div>
-<p>Web pages are an integral part of every Web application. Each Web page
-should serve to help achieve the overall goal of the entire Web site.</p>
-
-<p> There are many types of Web pages, ranging from simple HTML pages that
-contain no dynamic elements, to advanced Java-based pages that make use of
-servlets, scripts, forms, or data access components.</p>
-
-<p>A few of the many items you should consider when designing your pages are
-markup language, links, images, and style sheets.</p>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tjdetags.html" title="">Creating and editing Web pages - overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita
deleted file mode 100644
index 4058610bea..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwebprojects" xml:lang="en-us">
-<title>Web projects</title>
-<prolog><metadata>
-<keywords><indexterm>Web projects<indexterm>overview</indexterm></indexterm>
-<indexterm>Web applications<indexterm>creating or importing</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>Web projects hold all of the Web resources that are created and used when
-developing your Web application. The first step to creating or importing a
-Web application is to create either a static or a dynamic Web project. Static
-Web projects are meant to contain only simple Web site resources, such as
-HTML files. Dynamic Web projects are used to structure Web applications that
-will use more complicated, dynamic Web technologies, such as JavaServer Pages
-files, and possibly data access resources.</p>
-<p>Though the Web project is structured on your file system in compliance
-with the Java EE Web application standard for deployment purposes, the Project
-Explorer view is designed to show the most convenient display of project resources
-for use while you are actually developing the Web application. When you are
-finished developing your Web application, you use the Web project to deploy
-the correct resources to the server. These resources will be packaged in a
-file called a Web archive, or WAR file.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html
deleted file mode 100644
index 09bfae29b9..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web projects" />
-<meta content="Web projects, overview, Web applications, creating or importing" name="DC.subject" />
-<meta content="Web projects, overview, Web applications, creating or importing" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcresta.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwebprojects" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web projects</title>
-</head>
-<body id="cwebprojects"><a name="cwebprojects"><!-- --></a>
-
-
-<h1 class="topictitle1">Web projects</h1>
-
-
-<div>
-<p>Web projects hold all of the Web resources that are created and used when
-developing your Web application. The first step to creating or importing a
-Web application is to create either a static or a dynamic Web project. Static
-Web projects are meant to contain only simple Web site resources, such as
-HTML files. Dynamic Web projects are used to structure Web applications that
-will use more complicated, dynamic Web technologies, such as JavaServer Pages
-files, and possibly data access resources.</p>
-
-<p>Though the Web project is structured on your file system in compliance
-with the Java EE Web application standard for deployment purposes, the Project
-Explorer view is designed to show the most convenient display of project resources
-for use while you are actually developing the Web application. When you are
-finished developing your Web application, you use the Web project to deploy
-the correct resources to the server. These resources will be packaged in a
-file called a Web archive, or WAR file.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccstatic.html" title="">Static Web projects</a></div>
-<div><a href="../topics/ccwebprj.html" title="">Dynamic Web projects and applications</a></div>
-<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcresta.html">Creating a static Web project</a></div>
-<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.dita
deleted file mode 100644
index 05f8d71058..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.dita
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwebresources" xml:lang="en-us">
-<title>Web resources</title>
-<prolog><metadata>
-<keywords><indexterm>Web resources<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>In most cases, all of the resources that you need to create for your Web
-application are developed during Web site or Web page design; however, there
-are additional resources that you may need to include in your Web project
-if you are using more advanced Web technologies in your application.</p>
-<p>These Web resources are not typical Web page files, and are often not the
-resources that you consider part of the final Web site. For example, tag libraries
-and <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> resources,
-such as JAR files, are resources you might need to include in your Web project. </p>
-<p>In fact, even the WAR file itself could be considered a Web resource, if
-you consider importing or exporting the resource.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html
deleted file mode 100644
index 1d3300b98b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web resources" />
-<meta content="Web resources, overview" name="DC.subject" />
-<meta content="Web resources, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwebresources" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web resources</title>
-</head>
-<body id="cwebresources"><a name="cwebresources"><!-- --></a>
-
-
-<h1 class="topictitle1">Web resources</h1>
-
-
-<div>
-<p>In most cases, all of the resources that you need to create for your Web
-application are developed during Web site or Web page design; however, there
-are additional resources that you may need to include in your Web project
-if you are using more advanced Web technologies in your application.</p>
-
-<p>These Web resources are not typical Web page files, and are often not the
-resources that you consider part of the final Web site. For example, tag libraries
-and Javaâ„¢ resources,
-such as JAR files, are resources you might need to include in your Web project. </p>
-
-<p>In fact, even the WAR file itself could be considered a Web resource, if
-you consider importing or exporting the resource.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita
deleted file mode 100644
index 5cd875ae5f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwfiltbn" xml:lang="en-us">
-<title>Listeners</title>
-<prolog><metadata>
-<keywords><indexterm>filters<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>Filters are new in the <cite>Sun Microsystems Java Servlet
-2.3 Specification</cite>. They enable you to intercept to intercept a
-request before it reaches a resource. In other words, a filter gives you
-access to the HttpServletRequest and the HttpServletResponse objects
-before they are passed on to a servlet.</p>
-<p>Filters can be very useful. For example, you can write a filter
-that records all incoming requests and logs the IP addresses of the
-computers from which the requests originate. You also can use a filter
-as an encryption and decryption device. Other uses include user
-authentication, data compression, user input validation, and so on.</p>
-<p>You also can put a set of filters in a chain. The first filter in
-the chain will be called first and then pass control to the second
-filter, and so on. Filter chaining ensures that you can write a filter
-that does a specific task but adds some functionality in another filter.</p>
-<p>When writing a filter, you basically deal with the
-following three interfaces in the javax.servlet package:
-<ul>
- <li><b>javax.servlet.Filter:</b> represents the
- life-cycle of the filter.</li>
- <li><b>javax.servlet.FilterConfig:</b> represents the
- configuration of the filter.</li>
- <li><b>javax.servlet.FilterChain:</b> object provided by
- the servlet container to the developer giving a view into the
- invocation chain of a filtered request for a resource.</li>
-</ul></p>
-<p>For more information about filters, refer to the <cite>Sun Microsystems <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html
deleted file mode 100644
index 54a522859f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Listeners" />
-<meta content="filters, overview" name="DC.subject" />
-<meta content="filters, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwfiltbn" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Listeners</title>
-</head>
-<body id="cwfiltbn"><a name="cwfiltbn"><!-- --></a>
-
-
-<h1 class="topictitle1">Listeners</h1>
-
-
-<div>
-<p>Filters are new in the <cite>Sun Microsystems Java Servlet
-2.3 Specification</cite>. They enable you to intercept to intercept a
-request before it reaches a resource. In other words, a filter gives you
-access to the HttpServletRequest and the HttpServletResponse objects
-before they are passed on to a servlet.</p>
-
-<p>Filters can be very useful. For example, you can write a filter
-that records all incoming requests and logs the IP addresses of the
-computers from which the requests originate. You also can use a filter
-as an encryption and decryption device. Other uses include user
-authentication, data compression, user input validation, and so on.</p>
-
-<p>You also can put a set of filters in a chain. The first filter in
-the chain will be called first and then pass control to the second
-filter, and so on. Filter chaining ensures that you can write a filter
-that does a specific task but adds some functionality in another filter.</p>
-
-<div class="p">When writing a filter, you basically deal with the
-following three interfaces in the javax.servlet package:
-<ul>
- <li><strong>javax.servlet.Filter:</strong> represents the
- life-cycle of the filter.</li>
-
- <li><strong>javax.servlet.FilterConfig:</strong> represents the
- configuration of the filter.</li>
-
- <li><strong>javax.servlet.FilterChain:</strong> object provided by
- the servlet container to the developer giving a view into the
- invocation chain of a filtered request for a resource.</li>
-
-</ul>
-</div>
-
-<p>For more information about filters, refer to the <cite>Sun Microsystems Javaâ„¢ Servlet
-2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
-<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
-<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
-<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
-<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita
deleted file mode 100644
index c7a5132ced..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwlistbn" xml:lang="en-us">
-<title>Listeners</title>
-<prolog><metadata>
-<keywords><indexterm>listeners<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>Listeners are new feature in the <cite>Sun
-Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="Java">Java</tm> Servlet 2.3 Specification</cite>. A listener can be used to monitor and
-react to events in a servlet's life-cycle by defining methods that get
-invoked when life-cycle events occur. Support for application level
-events is defined in the Java Servlet Specification 2.3.</p>
-<p>Application event listeners are classes that
-implement one or more of the servlet event listener interfaces. Servlet
-event listeners support notification for state changes in the
-<b>ServletContext</b> and <b>HttpSession</b> objects, specifically:
-<ul>
- <li><b>Servlet context listeners</b> are used to manage resources or state held at a VM
- level for the application.</li>
- <li><b>HTTP session listeners</b> are used to manage state or resources associated with a
- series of requests made in a Web application from the same client or
- user.</li>
-</ul></p>
-<p>For more information about listeners, refer to the <cite>Sun Microsystems <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html
deleted file mode 100644
index c21109dcc7..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Listeners" />
-<meta content="listeners, overview" name="DC.subject" />
-<meta content="listeners, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwlistbn" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Listeners</title>
-</head>
-<body id="cwlistbn"><a name="cwlistbn"><!-- --></a>
-
-
-<h1 class="topictitle1">Listeners</h1>
-
-
-<div>
-<p>Listeners are new feature in the <cite>Sun
-Microsystems Javaâ„¢ Servlet 2.3 Specification</cite>. A listener can be used to monitor and
-react to events in a servlet's life-cycle by defining methods that get
-invoked when life-cycle events occur. Support for application level
-events is defined in the Java Servlet Specification 2.3.</p>
-
-<div class="p">Application event listeners are classes that
-implement one or more of the servlet event listener interfaces. Servlet
-event listeners support notification for state changes in the
-<strong>ServletContext</strong> and <strong>HttpSession</strong> objects, specifically:
-<ul>
- <li><strong>Servlet context listeners</strong> are used to manage resources or state held at a VM
- level for the application.</li>
-
- <li><strong>HTTP session listeners</strong> are used to manage state or resources associated with a
- series of requests made in a Web application from the same client or
- user.</li>
-
-</ul>
-</div>
-
-<p>For more information about listeners, refer to the <cite>Sun Microsystems Java Servlet
-2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
-<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
-<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
-<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
-<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita
deleted file mode 100644
index 41b5813c3b..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwservbn" xml:lang="en-us">
-<title>Servlets</title>
-<prolog><metadata>
-<keywords><indexterm>servlets<indexterm>overview</indexterm></indexterm><indexterm>Web
-servers<indexterm>generating dynamic content</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>Servlets are server-side <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> programs that use the <cite>Sun Microsystems <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-API</cite> and its associated classes and methods, as defined in the <cite>Sun
-Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="Java">Java</tm> Servlet 2.3 Specification</cite>. These <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> programs
-extend the functionality of a Web server by generating dynamic content and
-responding to Web client requests. When a browser sends a request to the server,
-the server can send the request information to a servlet, so that the servlet
-can construct the response that is sent back to the browser.</p>
-<p>Just as applets run on a Web browser and extend the browser's capabilities,
-servlets run on a Java-enabled Web server and extend the server's capabilities.
-Because of their flexibility and scalability, servlets are commonly used to
-enable businesses to connect databases to the Web.</p>
-<p>Although a servlet can be a completely self-contained program, you can
-split application development into two portions: <ul>
-<li>The business logic (content generation), which governs the relationship
-between input, processing, and output</li>
-<li>The presentation logic (content presentation, or graphic design rules),
-which determines how information is presented to the user</li>
-</ul>Using this paradigm, you may choose to have business logic handled by <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans,
-the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
-the HTTP protocol handled by a servlet.</p>
-<note>JSP files can be used to manage both the presentation and business logic
-for a Web application. JSP files use structured markup for presentation, and
-supply servlet model behavior at run time.</note>
-<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
-objects, and step through code to make changes that are dynamically folded
-into the running servlet on a running server, without having to restart each
-time.</p>
-<p>For more information about servlets, refer to the <cite>Sun Microsystems <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
-2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html
deleted file mode 100644
index a471e7839d..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Servlets" />
-<meta content="servlets, overview, Web servers, generating dynamic content" name="DC.subject" />
-<meta content="servlets, overview, Web servers, generating dynamic content" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwservbn" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Servlets</title>
-</head>
-<body id="cwservbn"><a name="cwservbn"><!-- --></a>
-
-
-<h1 class="topictitle1">Servlets</h1>
-
-
-<div>
-<p>Servlets are server-side Javaâ„¢ programs that use the <cite>Sun Microsystems Java Servlet
-API</cite> and its associated classes and methods, as defined in the <cite>Sun
-Microsystems Java Servlet 2.3 Specification</cite>. These Java programs
-extend the functionality of a Web server by generating dynamic content and
-responding to Web client requests. When a browser sends a request to the server,
-the server can send the request information to a servlet, so that the servlet
-can construct the response that is sent back to the browser.</p>
-
-<p>Just as applets run on a Web browser and extend the browser's capabilities,
-servlets run on a Java-enabled Web server and extend the server's capabilities.
-Because of their flexibility and scalability, servlets are commonly used to
-enable businesses to connect databases to the Web.</p>
-
-<div class="p">Although a servlet can be a completely self-contained program, you can
-split application development into two portions: <ul>
-<li>The business logic (content generation), which governs the relationship
-between input, processing, and output</li>
-
-<li>The presentation logic (content presentation, or graphic design rules),
-which determines how information is presented to the user</li>
-
-</ul>
-Using this paradigm, you may choose to have business logic handled by Java beans,
-the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
-the HTTP protocol handled by a servlet.</div>
-
-<div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage both the presentation and business logic
-for a Web application. JSP files use structured markup for presentation, and
-supply servlet model behavior at run time.</div>
-
-<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
-objects, and step through code to make changes that are dynamically folded
-into the running servlet on a running server, without having to restart each
-time.</p>
-
-<p>For more information about servlets, refer to the <cite>Sun Microsystems Java Servlet
-2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
-<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
-<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
-<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
-<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita
deleted file mode 100644
index a26e4169f9..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<!-- ArborText, Inc., 1988-2002, v.4002 -->
-<concept id="cwtfeatures" xml:lang="en-us">
-<title>Web tools features</title>
-<shortdesc> The integrated Web development environment makes it easy to cooperatively
-create, assemble, publish, deploy and maintain dynamic, interactive Web applications.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>Web tools<indexterm>features</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>The Web development environment provides the following high-level capabilities:
- <ul>
-<li>Dynamic Web project creation, using the Java EE-defined hierarchy, or
-a static version that reduces project overhead when dynamic elements are not
-required. Static Web projects can later be converted to dynamic Web projects.<p></p></li>
-<li>Creation and editing of a Web application deployment descriptor (<filepath>web.xml</filepath>)
- file<p></p></li>
-<li>JSP and HTML file creation, validation, editing, and debugging<p></p></li>
-<li>An extensible view, called the Snippets view, which allows users to catalog
- and organize reusable programming objects, such as HTML, <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm>,
- and JSP markup, along with files and custom tags, that can be embedded in
- existing files<p></p></li>
-<li>Dynamic tag help (content assist) , which displays tag usage and attribute
-information for HTML, JSP, and <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="JavaScript">JavaScript</tm> tags based on cursor location
- in the Source page. (You invoke Content Assist by pressing (Ctrl+Spacebar)
-)<p></p></li>
-<li>Cascading style sheet (CSS) editing support<p></p></li>
-<li>HTTP/FTP import<p></p></li>
-<li>FTP export (simple resource copy) to a server<p></p></li>
-<li>WAR file import, export, and validation<p></p></li>
-<li>Servlet creation, which employs the Servlet Wizard to create new servlets.<p></p></li>
-</ul></p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html
deleted file mode 100644
index 6532e5af84..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web tools features" />
-<meta name="abstract" content="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications." />
-<meta name="description" content="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications." />
-<meta content="Web tools, features" name="DC.subject" />
-<meta content="Web tools, features" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwebpagedesign.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwtfeatures" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web tools features</title>
-</head>
-<body id="cwtfeatures"><a name="cwtfeatures"><!-- --></a>
-
-
-<h1 class="topictitle1">Web tools features</h1>
-
-
-
-<div><p> The integrated Web development environment makes it easy to cooperatively
-create, assemble, publish, deploy and maintain dynamic, interactive Web applications.</p>
-
-<div class="p">The Web development environment provides the following high-level capabilities:
- <ul>
-<li>Dynamic Web project creation, using the Java EE-defined hierarchy, or
-a static version that reduces project overhead when dynamic elements are not
-required. Static Web projects can later be converted to dynamic Web projects.<p />
-</li>
-
-<li>Creation and editing of a Web application deployment descriptor (<span class="filepath">web.xml</span>)
- file<p />
-</li>
-
-<li>JSP and HTML file creation, validation, editing, and debugging<p />
-</li>
-
-<li>An extensible view, called the Snippets view, which allows users to catalog
- and organize reusable programming objects, such as HTML, JavaScriptâ„¢,
- and JSP markup, along with files and custom tags, that can be embedded in
- existing files<p />
-</li>
-
-<li>Dynamic tag help (content assist) , which displays tag usage and attribute
-information for HTML, JSP, and JavaScript tags based on cursor location
- in the Source page. (You invoke Content Assist by pressing (Ctrl+Spacebar)
-)<p />
-</li>
-
-<li>Cascading style sheet (CSS) editing support<p />
-</li>
-
-<li>HTTP/FTP import<p />
-</li>
-
-<li>FTP export (simple resource copy) to a server<p />
-</li>
-
-<li>WAR file import, export, and validation<p />
-</li>
-
-<li>Servlet creation, which employs the Servlet Wizard to create new servlets.<p />
-</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccwebprj.html" title="">Dynamic Web projects and applications</a></div>
-<div><a href="../topics/cwebpagedesign.html" title="">Web page design</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
-<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
-<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
-<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
-<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita
deleted file mode 100644
index 6f1adf5eeb..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwwarovr" xml:lang="en-us">
-<title>Web archive (WAR) files</title>
-<prolog><metadata>
-<keywords><indexterm>WAR files<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p> A Web application is a group of HTML pages, JSP pages, servlets, resources
-and source file, which can be managed as a single unit. A Web archive (WAR)
-file is a packaged Web application. WAR files can be used to import a Web
-application into a Web server.</p>
-<p>In addition to project resources, the WAR file includes a Web deployment
-descriptor file. The Web deployment descriptor is an XML file that contains
-deployment information, MIME types, session configuration details, and other
-settings for a Web application. The Web deployment descriptor file (<filepath>web.xml</filepath>)
-provides information about the WAR file is shared with the developers, assemblers,
-and deployers in a Java EE environment.</p>
-<p>The Web development environment provides facilities for importing and exporting
-WAR files, using the following wizards: <ul>
-<li><ph>Import Resources from a WAR File</ph>, which requires that you to
-specify a Web project. You can use existing projects or create them as you
-use the wizard.</li>
-<li><ph>Export Resources to a WAR File</ph>, which requires only an export
-location and some optional settings</li>
-</ul></p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html
deleted file mode 100644
index d5b5d63223..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Web archive (WAR) files" />
-<meta content="WAR files, overview" name="DC.subject" />
-<meta content="WAR files, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twimpwar.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcrewar.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwwarovr" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Web archive (WAR) files</title>
-</head>
-<body id="cwwarovr"><a name="cwwarovr"><!-- --></a>
-
-
-<h1 class="topictitle1">Web archive (WAR) files</h1>
-
-
-<div>
-<p> A Web application is a group of HTML pages, JSP pages, servlets, resources
-and source file, which can be managed as a single unit. A Web archive (WAR)
-file is a packaged Web application. WAR files can be used to import a Web
-application into a Web server.</p>
-
-<p>In addition to project resources, the WAR file includes a Web deployment
-descriptor file. The Web deployment descriptor is an XML file that contains
-deployment information, MIME types, session configuration details, and other
-settings for a Web application. The Web deployment descriptor file (<span class="filepath">web.xml</span>)
-provides information about the WAR file is shared with the developers, assemblers,
-and deployers in a Java EE environment.</p>
-
-<div class="p">The Web development environment provides facilities for importing and exporting
-WAR files, using the following wizards: <ul>
-<li><span>Import Resources from a WAR File</span>, which requires that you to
-specify a Web project. You can use existing projects or create them as you
-use the wizard.</li>
-
-<li><span>Export Resources to a WAR File</span>, which requires only an export
-location and some optional settings</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twimpwar.html">Importing Web archive (WAR) files</a></div>
-<div><a href="../topics/twcrewar.html">Exporting Web Archive (WAR) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita
deleted file mode 100644
index d3733dd03f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwwedtvw" xml:lang="en-us">
-<title>Workbench integration with Web editors</title>
-<prolog><metadata>
-<keywords><indexterm keyref="cwwedtvw|1|Webeditorsworkbenchintegration" status="changed">workbench<indexterm>Web
-editors</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>There are several editors for use in various contexts for various file
-types. To edit a file using its default editor, double-click on the file name
-in the Project Explorer view, or right-click on the file and select <uicontrol>Open</uicontrol>.
-The editor that is last used to open a file becomes the default for that particular
-file. To edit the file with a different editor, right-click on the file and
-select <uicontrol>Open With</uicontrol> to choose from a list of available
-editors.</p>
-<p>In the workbench, you can associate file-name extensions for different
-types of resources with various editors. A resource extension can have more
-than one editor associated with it; the last editor used for a particular
-extension type is indicated by a black dot before it in the <uicontrol>Open
-With</uicontrol> pop-up menu. You can associate extensions that are known
-to the workbench with additional editors, by using the <b>File Associations</b> preferences
-page, accessed by selecting <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-<uicontrol>Workbench</uicontrol><uicontrol>File Associations</uicontrol></menucascade>.</p>
-<p>The Properties view provides general capabilities that are advantageous
-to Web editor users. <dl><dlentry>
-<dt>Properties view</dt>
-<dd>The Properties view (<menucascade><uicontrol>Window</uicontrol><uicontrol>Show
-View</uicontrol><uicontrol>Properties</uicontrol></menucascade>) contains
-a list of attributes and editable attribute values. For example, when you
-select an image tag <uicontrol>img</uicontrol> , the width and height values
-appear for editing. In addition, any other attributes allowed by the standard
-specified in the DOCTYPE for the file (such as the HTML 4.0.1 DTD) are listed.
-When you click the value column of a property, you can select from among the
-list of available attribute values. <p>The pop-up menu in the Properties view
-enables you to undo, cut, copy, paste, delete, and select all. The options
-that are available at a given time depends on where the cursor is located
-when you right-click to display the pop-up menu. To see the pop-up menu that
-contains undo, cut, and so on, the property value field must be active. (This
-is accomplished by selecting the property and then selecting its value.) Otherwise,
-the pop-up menu will contain different options.</p> <p>Use the <uicontrol>Restore
-Default Value</uicontrol> button to change any value back to the default setting.</p> <p>After
-you are in the Properties view, you can modify other property values for specific
-tags. To edit another tag using the Properties view, move the cursor within
-the editing area of the Source page or Design page to the tag you want to
-edit. The appropriate properties and values are displayed in the Properties
-view.</p></dd>
-</dlentry></dl></p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html
deleted file mode 100644
index a911f51d90..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Workbench integration with Web editors" />
-<meta content="workbench, Web editors" name="DC.subject" />
-<meta content="workbench, Web editors" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwwedtvw" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Workbench integration with Web editors</title>
-</head>
-<body id="cwwedtvw"><a name="cwwedtvw"><!-- --></a>
-
-
-<h1 class="topictitle1">Workbench integration with Web editors</h1>
-
-
-<div>
-<p>There are several editors for use in various contexts for various file
-types. To edit a file using its default editor, double-click on the file name
-in the Project Explorer view, or right-click on the file and select <span class="uicontrol">Open</span>.
-The editor that is last used to open a file becomes the default for that particular
-file. To edit the file with a different editor, right-click on the file and
-select <span class="uicontrol">Open With</span> to choose from a list of available
-editors.</p>
-
-<p>In the workbench, you can associate file-name extensions for different
-types of resources with various editors. A resource extension can have more
-than one editor associated with it; the last editor used for a particular
-extension type is indicated by a black dot before it in the <span class="uicontrol">Open
-With</span> pop-up menu. You can associate extensions that are known
-to the workbench with additional editors, by using the <strong>File Associations</strong> preferences
-page, accessed by selecting <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
- &gt; <span class="uicontrol">Workbench</span> &gt; <span class="uicontrol">File Associations</span></span>.</p>
-
-<div class="p">The Properties view provides general capabilities that are advantageous
-to Web editor users. <dl>
-<dt class="dlterm">Properties view</dt>
-
-<dd>The Properties view (<span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Show
-View</span> &gt; <span class="uicontrol">Properties</span></span>) contains
-a list of attributes and editable attribute values. For example, when you
-select an image tag <span class="uicontrol">img</span> , the width and height values
-appear for editing. In addition, any other attributes allowed by the standard
-specified in the DOCTYPE for the file (such as the HTML 4.0.1 DTD) are listed.
-When you click the value column of a property, you can select from among the
-list of available attribute values. <p>The pop-up menu in the Properties view
-enables you to undo, cut, copy, paste, delete, and select all. The options
-that are available at a given time depends on where the cursor is located
-when you right-click to display the pop-up menu. To see the pop-up menu that
-contains undo, cut, and so on, the property value field must be active. (This
-is accomplished by selecting the property and then selecting its value.) Otherwise,
-the pop-up menu will contain different options.</p>
- <p>Use the <span class="uicontrol">Restore
-Default Value</span> button to change any value back to the default setting.</p>
- <p>After
-you are in the Properties view, you can modify other property values for specific
-tags. To edit another tag using the Properties view, move the cursor within
-the editing area of the Source page or Design page to the tag you want to
-edit. The appropriate properties and values are displayed in the Properties
-view.</p>
-</dd>
-
-</dl>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.dita
deleted file mode 100644
index c35c3f6c4c..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.dita
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tjchgxdt" xml:lang="en-us">
-<title>Specifying an implicit document type for an HTML, XHTML, or JSP fragment</title>
-<prolog><metadata>
-<keywords><indexterm>DOCTYPE declarations<indexterm>implicit for fragments</indexterm></indexterm>
-<indexterm>document types<indexterm>implicit for fragments</indexterm></indexterm>
-<indexterm>HTML fragments<indexterm>implicit document types</indexterm></indexterm>
-<indexterm>JSP fragments<indexterm>implicit document types</indexterm></indexterm>
-<indexterm>XHTML fragments<indexterm>implicit document type for fragments</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>An <i>implicit</i> document type is used for content assist (CTRL+Spacebar),
-the Properties view, and other editing contexts when no DOCTYPE declaration
-is specified in an HTML, XHTML, or JSP file. Typically, this feature is used
-for a fragment (partial document) that can be included in other pages using
-JSP include or server-side include.</p><p>To assign an implicit document type
-to an HTML, XHTML, or JSP fragment, do the following: </p> </context>
-<steps>
-<step><cmd>From the Project Explorer view, select the HTML, XHTML, or JSP
-fragment.</cmd></step>
-<step><cmd>Select <ph><uicontrol>Properties</uicontrol></ph> from the file's
-pop-up menu.</cmd></step>
-<step><cmd>In the <uicontrol>Web Content Settings</uicontrol> page, select
-the desired DOCTYPE from the <ph><uicontrol>Document type</uicontrol></ph> drop-down
-list.</cmd><info><p>The <ph><uicontrol>Properties</uicontrol></ph> dialog
-for Web projects also includes an <ph><uicontrol>Web Content Settings</uicontrol></ph> page,
-where you can specify project-default HTML document type. This setting will
-be used if no DOCTYPE declaration is specified in the file, and no default
-document type is specified in the <ph><uicontrol>Web Content Settings</uicontrol></ph> page
-on the <ph><uicontrol>Properties</uicontrol></ph> dialog for the file.</p></info>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html
deleted file mode 100644
index 4ecbf9a365..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Specifying an implicit document type for an HTML, XHTML, or JSP fragment" />
-<meta content="DOCTYPE declarations, implicit for fragments, document types, HTML fragments, implicit document types, JSP fragments, XHTML fragments, implicit document type for fragments" name="DC.subject" />
-<meta content="DOCTYPE declarations, implicit for fragments, document types, HTML fragments, implicit document types, JSP fragments, XHTML fragments, implicit document type for fragments" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tjchgxdt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Specifying an implicit document type for an HTML, XHTML, or JSP fragment</title>
-</head>
-<body id="tjchgxdt"><a name="tjchgxdt"><!-- --></a>
-
-
-<h1 class="topictitle1">Specifying an implicit document type for an HTML, XHTML, or JSP fragment</h1>
-
-
-<div>
-<div class="section"> <p>An <em>implicit</em> document type is used for content assist (CTRL+Spacebar),
-the Properties view, and other editing contexts when no DOCTYPE declaration
-is specified in an HTML, XHTML, or JSP file. Typically, this feature is used
-for a fragment (partial document) that can be included in other pages using
-JSP include or server-side include.</p>
-<p>To assign an implicit document type
-to an HTML, XHTML, or JSP fragment, do the following: </p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>From the Project Explorer view, select the HTML, XHTML, or JSP
-fragment.</span></li>
-
-<li class="stepexpand"><span>Select <span><span class="uicontrol">Properties</span></span> from the file's
-pop-up menu.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">Web Content Settings</span> page, select
-the desired DOCTYPE from the <span><span class="uicontrol">Document type</span></span> drop-down
-list.</span> <p>The <span><span class="uicontrol">Properties</span></span> dialog
-for Web projects also includes an <span><span class="uicontrol">Web Content Settings</span></span> page,
-where you can specify project-default HTML document type. This setting will
-be used if no DOCTYPE declaration is specified in the file, and no default
-document type is specified in the <span><span class="uicontrol">Web Content Settings</span></span> page
-on the <span><span class="uicontrol">Properties</span></span> dialog for the file.</p>
-
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.dita
deleted file mode 100644
index 516efe1304..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tjcrehtm" xml:lang="en-us">
-<title>Creating HTML and XHTML files and framesets</title>
-<shortdesc>You can use the New HTML File wizard to create HTML and XHTML files
-and framesets. </shortdesc>
-<prolog><metadata>
-<keywords>
-<indexterm>framesets<indexterm>creating</indexterm></indexterm>
-<indexterm>HTML<indexterm>creating files</indexterm></indexterm>
-<indexterm>WML<indexterm>creating files</indexterm></indexterm>
-<indexterm>XHTML<indexterm>creating files</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> </context>
-<steps>
-<step><cmd>Create a static or a dynamic Web project if you have not already
-done so.</cmd></step>
-<step><cmd>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. </cmd><info>Note
-that if you choose any other folder in which to create the HTML file, then
-it will not be included in the WAR file that is deployed to the server. In
-addition, link validation will not encompass files that are not under the
-WebContent folder.</info></step>
-<step><cmd>From the context menu, select <menucascade><uicontrol>New</uicontrol>
-<uicontrol>Other</uicontrol><uicontrol>Web</uicontrol><uicontrol>HTML</uicontrol>
-</menucascade>.</cmd><stepresult>The New HTML Page window appears with your
-folder selected</stepresult></step>
-<step><cmd>Type a file name into the File name field, making sure you include
-an html extension (html, htm, xhtml, htpl, wml, shtml, or shtm) in the file
-name.</cmd></step>
-<step><cmd> You have several options for proceeding:</cmd>
-<choices>
-<choice>To accept the defaults associated with a new HTML file, select <uicontrol>Finish.</uicontrol></choice>
-<choice> To use a template file for the initial content of your HTML page,
-select <uicontrol>Next</uicontrol>. The Select HTML Template window appears.
-Select the <uicontrol>Use HTML Template</uicontrol> check box, and then select
-one of the sample templates. You can also select the <uicontrol>HTML Templates</uicontrol> link
-to add or remove HTML templates to your list of templates.</choice>
-</choices>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html
deleted file mode 100644
index e75e8f86e5..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating HTML and XHTML files and framesets" />
-<meta name="abstract" content="You can use the New HTML File wizard to create HTML and XHTML files and framesets." />
-<meta name="description" content="You can use the New HTML File wizard to create HTML and XHTML files and framesets." />
-<meta content="framesets, creating, HTML, creating files, WML, XHTML" name="DC.subject" />
-<meta content="framesets, creating, HTML, creating files, WML, XHTML" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tjcrehtm" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating HTML and XHTML files and framesets</title>
-</head>
-<body id="tjcrehtm"><a name="tjcrehtm"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating HTML and XHTML files and framesets</h1>
-
-
-
-<div><p>You can use the New HTML File wizard to create HTML and XHTML files
-and framesets. </p>
-
-<div class="section"> </div>
-
-<ol>
-<li class="stepexpand"><span>Create a static or a dynamic Web project if you have not already
-done so.</span></li>
-
-<li class="stepexpand"><span>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. </span> Note
-that if you choose any other folder in which to create the HTML file, then
-it will not be included in the WAR file that is deployed to the server. In
-addition, link validation will not encompass files that are not under the
-WebContent folder.</li>
-
-<li class="stepexpand"><span>From the context menu, select <span class="menucascade"><span class="uicontrol">New</span>
- &gt; <span class="uicontrol">Other</span> &gt; <span class="uicontrol">Web</span> &gt; <span class="uicontrol">HTML</span>
-</span>.</span> The New HTML Page window appears with your
-folder selected</li>
-
-<li class="stepexpand"><span>Type a file name into the File name field, making sure you include
-an html extension (html, htm, xhtml, htpl, wml, shtml, or shtm) in the file
-name.</span></li>
-
-<li class="stepexpand"><span> You have several options for proceeding:</span>
-<ul>
-<li>To accept the defaults associated with a new HTML file, select <span class="uicontrol">Finish.</span></li>
-
-<li> To use a template file for the initial content of your HTML page,
-select <span class="uicontrol">Next</span>. The Select HTML Template window appears.
-Select the <span class="uicontrol">Use HTML Template</span> check box, and then select
-one of the sample templates. You can also select the <span class="uicontrol">HTML Templates</span> link
-to add or remove HTML templates to your list of templates.</li>
-
-</ul>
-
-</li>
-
-</ol>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.dita
deleted file mode 100644
index 5e75b315ef..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.dita
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tjcrejsp" xml:lang="en-us">
-<title>Creating JavaServer Pages (JSP) files</title>
-<prolog><metadata>
-<keywords><indexterm>JSP files<indexterm>creating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>Most types of JSP files can be created using the New JSP File
-wizard. To create a basic JSP file using the wizard, complete the following
-steps: </p></context>
-<steps>
-<step><cmd>Create a dynamic Web project if you have not already done so.</cmd>
-</step>
-<step><cmd>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. Note that if you
-choose any other folder in which to create the JSP, then it will not be included
-in the WAR file that is deployed to the server. In addition, link validation
-will not encompass files that are not under the WebContent folder.</cmd></step>
-<step><cmd>From the context menu, select <menucascade><uicontrol>New</uicontrol>
-<uicontrol>JSP</uicontrol></menucascade>.</cmd><stepresult>The New Java Server
-Page window appears with your folder selected</stepresult></step>
-<step><cmd>Type a file name into the File name field, making sure you include
-the jsp extension (jsp, jsv, jtpl, or jspx) in the file name.</cmd></step>
-<step><cmd> You have several options for proceeding:</cmd>
-<choices>
-<choice>To accept the defaults associated with a new JSP file, select <uicontrol>Finish.</uicontrol></choice>
-<choice>To link to a file in the file system and specify path variables, select <uicontrol>Advanced</uicontrol> and
-then make your selections using the <uicontrol>Browse</uicontrol> and <uicontrol>Variables</uicontrol> buttons. </choice>
-<choice> To use a template file for the initial content of your JSP page,
-select <uicontrol>Next</uicontrol>. The Select JSP Template window appears.
-Select the <uicontrol>Use JSP Template</uicontrol> check box, and then select
-one of the sample templates. You can also select the <uicontrol>JSP Templates</uicontrol> link
-to add or remove JSP templates to your list of templates.</choice>
-</choices>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html
deleted file mode 100644
index f037f4b8da..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating JavaServer Pages (JSP) files" />
-<meta content="JSP files, creating" name="DC.subject" />
-<meta content="JSP files, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cpdjsps.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tjcrejsp" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating JavaServer Pages (JSP) files</title>
-</head>
-<body id="tjcrejsp"><a name="tjcrejsp"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating JavaServer Pages (JSP) files</h1>
-
-
-<div>
-<div class="section"><p>Most types of JSP files can be created using the New JSP File
-wizard. To create a basic JSP file using the wizard, complete the following
-steps: </p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Create a dynamic Web project if you have not already done so.</span>
-</li>
-
-<li class="stepexpand"><span>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. Note that if you
-choose any other folder in which to create the JSP, then it will not be included
-in the WAR file that is deployed to the server. In addition, link validation
-will not encompass files that are not under the WebContent folder.</span></li>
-
-<li class="stepexpand"><span>From the context menu, select <span class="menucascade"><span class="uicontrol">New</span>
- &gt; <span class="uicontrol">JSP</span></span>.</span> The New Java Server
-Page window appears with your folder selected</li>
-
-<li class="stepexpand"><span>Type a file name into the File name field, making sure you include
-the jsp extension (jsp, jsv, jtpl, or jspx) in the file name.</span></li>
-
-<li class="stepexpand"><span> You have several options for proceeding:</span>
-<ul>
-<li>To accept the defaults associated with a new JSP file, select <span class="uicontrol">Finish.</span></li>
-
-<li>To link to a file in the file system and specify path variables, select <span class="uicontrol">Advanced</span> and
-then make your selections using the <span class="uicontrol">Browse</span> and <span class="uicontrol">Variables</span> buttons. </li>
-
-<li> To use a template file for the initial content of your JSP page,
-select <span class="uicontrol">Next</span>. The Select JSP Template window appears.
-Select the <span class="uicontrol">Use JSP Template</span> check box, and then select
-one of the sample templates. You can also select the <span class="uicontrol">JSP Templates</span> link
-to add or remove JSP templates to your list of templates.</li>
-
-</ul>
-
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cpdjsps.html">JavaServer Pages (JSP) technology</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcreprj.html" title="You create and maintain the resources for your Web applications in Web projects.">Creating a dynamic Web project</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.dita
deleted file mode 100644
index deffb67b5f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.dita
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tjdetags" xml:lang="en-us">
-<title>Creating and editing Web pages - overview</title>
-<prolog><metadata>
-<keywords><indexterm>Web pages<indexterm>creating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>To aid in Web site development and editing, there is local tag
-hover help for all supported tag sets, as well as <xref href="../../org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita"
-scope="peer"><desc></desc>content assist</xref> (Ctrl+Spacebar), a tool that
-helps you insert or finish a tag or function or finish a line of code in a
-structured text editor.</p><p> You can toggle among various viewing modes
-(which are determined by file type) to visually design pages, work with HTML, <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> or
-JSP content, and preview your pages. To help you create the visual impact
-you want on your Web sites, the editor includes its own library of reusable
-graphics and two graphic programs for creating, editing, and animating image
-files. </p><note>Use either uppercase or lowercase alphanumeric characters
-consistently when naming HTML files and embedded files (such as image files)
-used in your Web pages, because some server operating systems are case sensitive.
-Do not use spaces or special characters such as exclamation points or question
-marks in file names.</note> </context>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html
deleted file mode 100644
index e14ff9cedc..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating and editing Web pages - overview" />
-<meta content="Web pages, creating" name="DC.subject" />
-<meta content="Web pages, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tjdetags" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating and editing Web pages - overview</title>
-</head>
-<body id="tjdetags"><a name="tjdetags"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating and editing Web pages - overview</h1>
-
-
-<div>
-<div class="section"> <p>To aid in Web site development and editing, there is local tag
-hover help for all supported tag sets, as well as <a href="../../org.eclipse.wst.sse.doc.user/topics/csrcedt006.html" title="">content assist</a> (Ctrl+Spacebar), a tool that
-helps you insert or finish a tag or function or finish a line of code in a
-structured text editor.</p>
-<p> You can toggle among various viewing modes
-(which are determined by file type) to visually design pages, work with HTML, JavaScriptâ„¢ or
-JSP content, and preview your pages. To help you create the visual impact
-you want on your Web sites, the editor includes its own library of reusable
-graphics and two graphic programs for creating, editing, and animating image
-files. </p>
-<div class="note"><span class="notetitle">Note:</span> Use either uppercase or lowercase alphanumeric characters
-consistently when naming HTML files and embedded files (such as image files)
-used in your Web pages, because some server operating systems are case sensitive.
-Do not use spaces or special characters such as exclamation points or question
-marks in file names.</div>
- </div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita
deleted file mode 100644
index 02c73d451f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tjprefs" xml:lang="en-us">
-<title>Defining HTML file preferences</title>
-<prolog><metadata>
-<keywords><indexterm keyref="tjprefs|1|DOCTYPEdeclarationsaddingautomatically"
-status="new">DOCTYPE declarations<indexterm>adding automatically</indexterm></indexterm>
-<indexterm keyref="tjprefs|2|HTMLfileseditingpreferences" status="changed">HTML<indexterm>editing
-preferences</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p><indexterm>DOCTYPE declarations<indexterm>adding automatically</indexterm></indexterm> <indexterm>HTML
-files<indexterm>editing preferences</indexterm></indexterm> To define general
-HTML file preferences, complete the following steps:</p></context>
-<steps>
-<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
-</step>
-<step><cmd>In the Preferences window, select <menucascade><uicontrol>Web and
-XML</uicontrol><uicontrol>HTML Files</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Specify the following settings related to saving an HTML source
-page. The defaults are recommended and should only be modified when there
-is a specific reason to do so. </cmd><info><dl><dlentry>
-<dt>Line delimiter</dt>
-<dd>Specify the appropriate EOL character for your environment. The default
-is <uicontrol>No translation</uicontrol>.</dd>
-</dlentry><dlentry>
-<dt>Add this suffix</dt>
-<dd>Specify a default suffix for files that you save. The default is <userinput>html</userinput>.</dd>
-</dlentry><dlentry>
-<dt>Encoding, IANA, (Use workbench default)</dt>
-<dd>Specify the default encoding (code page) for files that you create. The
-default is the Workbench's encoding preference. </dd>
-</dlentry><dlentry>
-<dt>Insert DOCTYPE declaration</dt>
-<dd>Optionally, you can automatically add a DOCTYPE declaration to HTML files.
-The default DOCTYPE is determined when you create an HTML file or a JSP file
-using a wizard. If you add the DOCTYPE declaration, you should include at
-least a Public ID specification, and, optionally, a System ID.</dd>
-</dlentry><dlentry>
-<dt>Insert GENERATOR with META tag</dt>
-<dd>Optionally, select the check box to specify GENERATOR in a META tag in
-the HTML file header.</dd>
-</dlentry><dlentry>
-<dt>Loading files</dt>
-<dd>Specify the default encoding (code page) for files that you open. The
-default is the Workbench's encoding preference. Deselect the <uicontrol>Use
-workbench default</uicontrol> check box to select another encoding. <note>Encoding
-detection (when loading files) is performed in the following order: <ul>
-<li>Locate the encoding name embedded in the document.</li>
-<li>When no encoding is embedded in the document, an automatic encoding detector
-attempts to determine encoding used in the document.</li>
-<li>If the encoding still cannot be determined, the encoding defined in the <uicontrol>Encoding</uicontrol> field
-is used.</li>
-</ul> </note> </dd>
-</dlentry></dl> </info></step>
-<step><cmd>Click <uicontrol>Apply</uicontrol> then <uicontrol>OK</uicontrol> to
-save your changes.</cmd></step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html
deleted file mode 100644
index 772f1238f6..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Defining HTML file preferences" />
-<meta content="DOCTYPE declarations, adding automatically, HTML, editing preferences" name="DC.subject" />
-<meta content="DOCTYPE declarations, adding automatically, HTML, editing preferences" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tjprefs" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Defining HTML file preferences</title>
-</head>
-<body id="tjprefs"><a name="tjprefs"><!-- --></a>
-
-
-<h1 class="topictitle1">Defining HTML file preferences</h1>
-
-
-<div>
-<div class="section"> <p> To define general
-HTML file preferences, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>From the <span class="uicontrol">Window</span> menu, select <span class="uicontrol">Preferences</span>.</span>
-</li>
-
-<li class="stepexpand"><span>In the Preferences window, select <span class="menucascade"><span class="uicontrol">Web and
-XML</span> &gt; <span class="uicontrol">HTML Files</span></span>.</span></li>
-
-<li class="stepexpand"><span>Specify the following settings related to saving an HTML source
-page. The defaults are recommended and should only be modified when there
-is a specific reason to do so. </span> <dl>
-<dt class="dlterm">Line delimiter</dt>
-
-<dd>Specify the appropriate EOL character for your environment. The default
-is <span class="uicontrol">No translation</span>.</dd>
-
-
-<dt class="dlterm">Add this suffix</dt>
-
-<dd>Specify a default suffix for files that you save. The default is <kbd class="userinput">html</kbd>.</dd>
-
-
-<dt class="dlterm">Encoding, IANA, (Use workbench default)</dt>
-
-<dd>Specify the default encoding (code page) for files that you create. The
-default is the Workbench's encoding preference. </dd>
-
-
-<dt class="dlterm">Insert DOCTYPE declaration</dt>
-
-<dd>Optionally, you can automatically add a DOCTYPE declaration to HTML files.
-The default DOCTYPE is determined when you create an HTML file or a JSP file
-using a wizard. If you add the DOCTYPE declaration, you should include at
-least a Public ID specification, and, optionally, a System ID.</dd>
-
-
-<dt class="dlterm">Insert GENERATOR with META tag</dt>
-
-<dd>Optionally, select the check box to specify GENERATOR in a META tag in
-the HTML file header.</dd>
-
-
-<dt class="dlterm">Loading files</dt>
-
-<dd>Specify the default encoding (code page) for files that you open. The
-default is the Workbench's encoding preference. Deselect the <span class="uicontrol">Use
-workbench default</span> check box to select another encoding. <div class="note"><span class="notetitle">Note:</span> Encoding
-detection (when loading files) is performed in the following order: <ul>
-<li>Locate the encoding name embedded in the document.</li>
-
-<li>When no encoding is embedded in the document, an automatic encoding detector
-attempts to determine encoding used in the document.</li>
-
-<li>If the encoding still cannot be determined, the encoding defined in the <span class="uicontrol">Encoding</span> field
-is used.</li>
-
-</ul>
- </div>
- </dd>
-
-</dl>
- </li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Apply</span> then <span class="uicontrol">OK</span> to
-save your changes.</span></li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita
deleted file mode 100644
index 9671718a53..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="tservertarget" xml:lang="en-us">
-<title>Server targeting for Web applications</title>
-<prolog><metadata>
-<keywords><indexterm>servers<indexterm>targeting</indexterm></indexterm><indexterm>Web
-applications<indexterm>server targeting</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>To support different Java EE application servers, the Java EE tooling allows
-you to target a specific server during your Enterprise Application (EAR) project
-development. In most cases, a Web project must target the same server as the
-EAR project in order to deploy the Web application to the server properly. </p>
-<p>After you have a Web project created, you can modify the target server
-using the project's properties dialog. To do this, right-click on the project
-in the Project Explorer view, and select <menucascade><uicontrol>Properties</uicontrol>
-<uicontrol>Server</uicontrol></menucascade>.</p>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html
deleted file mode 100644
index 808fc086f3..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Server targeting for Web applications" />
-<meta content="servers, targeting, Web applications, server targeting" name="DC.subject" />
-<meta content="servers, targeting, Web applications, server targeting" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tservertarget" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Server targeting for Web applications</title>
-</head>
-<body id="tservertarget"><a name="tservertarget"><!-- --></a>
-
-
-<h1 class="topictitle1">Server targeting for Web applications</h1>
-
-
-<div>
-<p>To support different Java EE application servers, the Java EE tooling allows
-you to target a specific server during your Enterprise Application (EAR) project
-development. In most cases, a Web project must target the same server as the
-EAR project in order to deploy the Web application to the server properly. </p>
-
-<p>After you have a Web project created, you can modify the target server
-using the project's properties dialog. To do this, right-click on the project
-in the Project Explorer view, and select <span class="menucascade"><span class="uicontrol">Properties</span>
- &gt; <span class="uicontrol">Server</span></span>.</p>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcreprj.html" title="You create and maintain the resources for your Web applications in Web projects.">Creating a dynamic Web project</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.dita
deleted file mode 100644
index bef37e29d5..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.dita
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tstylesheet" xml:lang="en-us">
-<title>Creating cascading style sheets</title>
-<shortdesc>Cascading style sheets enable you to define a consistent look and
-feel throughout your Web site by maintaining the contents (Web pages) and
-the design (the style sheet) separately.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>style sheets<indexterm>creating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>To create a new cascading style sheet:</context>
-<steps>
-<step><cmd>Create a static or a dynamic Web project if you have not already
-done so.</cmd></step>
-<step><cmd>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. </cmd><info>Note
-that if you choose any other folder in which to create the CSS file, then
-it will not be included in the WAR file that is deployed to the server. </info>
-</step>
-<step><cmd>From the context menu, select <menucascade><uicontrol>New</uicontrol>
-<uicontrol>Other</uicontrol><uicontrol>Web</uicontrol><uicontrol>CSS</uicontrol>
-</menucascade>.</cmd><stepresult>The New Cascading Style Sheet window appears
-with your folder selected</stepresult></step>
-<step><cmd>Type a file name into the File name field, making sure you include
-a css extension in the file name.</cmd></step>
-<step><cmd> You have several options for proceeding:</cmd>
-<choices>
-<choice>To accept the defaults associated with a new CSS file, select <uicontrol>Finish.</uicontrol></choice>
-<choice> To use a template file for the initial content of your CSS file,
-select <uicontrol>Next</uicontrol>. The Select CSS Template window appears.
-Select the <uicontrol>Use CSS Template</uicontrol> check box, and then select
-one of the sample templates. You can also select the <uicontrol>CSS Templates</uicontrol> link
-to add or remove HTML templates to your list of templates.</choice>
-</choices>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html
deleted file mode 100644
index 46f0a0c881..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating cascading style sheets" />
-<meta name="abstract" content="Cascading style sheets enable you to define a consistent look and feel throughout your Web site by maintaining the contents (Web pages) and the design (the style sheet) separately." />
-<meta name="description" content="Cascading style sheets enable you to define a consistent look and feel throughout your Web site by maintaining the contents (Web pages) and the design (the style sheet) separately." />
-<meta content="style sheets, creating" name="DC.subject" />
-<meta content="style sheets, creating" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tstylesheet" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating cascading style sheets</title>
-</head>
-<body id="tstylesheet"><a name="tstylesheet"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating cascading style sheets</h1>
-
-
-
-<div><p>Cascading style sheets enable you to define a consistent look and
-feel throughout your Web site by maintaining the contents (Web pages) and
-the design (the style sheet) separately.</p>
-
-<div class="section">To create a new cascading style sheet:</div>
-
-<ol>
-<li class="stepexpand"><span>Create a static or a dynamic Web project if you have not already
-done so.</span></li>
-
-<li class="stepexpand"><span>In the Project Explorer, expand your project and right click on
-your WebContent folder or on a subfolder under WebContent. </span> Note
-that if you choose any other folder in which to create the CSS file, then
-it will not be included in the WAR file that is deployed to the server.
-</li>
-
-<li class="stepexpand"><span>From the context menu, select <span class="menucascade"><span class="uicontrol">New</span>
- &gt; <span class="uicontrol">Other</span> &gt; <span class="uicontrol">Web</span> &gt; <span class="uicontrol">CSS</span>
-</span>.</span> The New Cascading Style Sheet window appears
-with your folder selected</li>
-
-<li class="stepexpand"><span>Type a file name into the File name field, making sure you include
-a css extension in the file name.</span></li>
-
-<li class="stepexpand"><span> You have several options for proceeding:</span>
-<ul>
-<li>To accept the defaults associated with a new CSS file, select <span class="uicontrol">Finish.</span></li>
-
-<li> To use a template file for the initial content of your CSS file,
-select <span class="uicontrol">Next</span>. The Select CSS Template window appears.
-Select the <span class="uicontrol">Use CSS Template</span> check box, and then select
-one of the sample templates. You can also select the <span class="uicontrol">CSS Templates</span> link
-to add or remove HTML templates to your list of templates.</li>
-
-</ul>
-
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita
deleted file mode 100644
index 7cc3b3adf0..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<!-- ArborText, Inc., 1988-2002, v.4002-->
-<task id="twcreprj" xml:lang="en-us">
-<title>Creating a dynamic Web project</title>
-<shortdesc>You create and maintain the resources for your Web applications
-in Web projects.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>Web projects<indexterm>creating dynamic projects</indexterm></indexterm>
-<indexterm>Web applications<indexterm>resources</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p> Unlike with <xref href="twcresta.dita" scope="peer"><desc></desc>static</xref> Web
-projects, dynamic Web projects enable you to create resources such as JavaServer
-Pages and servlets.</p><p>To create a new dynamic Web project, complete the
-following steps:</p></context>
-<steps>
-<step><cmd>Open the Java EE perspective.</cmd></step>
-<step><cmd>In the Project Explorer, right click on Dynamic Web Projects, and
-select <menucascade><uicontrol>New</uicontrol><uicontrol>Dynamic Web Project</uicontrol>
-</menucascade> from the context menu. The New Dynamic Web Project wizard starts.</cmd>
-</step>
-<step><cmd>Follow the project wizard prompts.</cmd></step>
-</steps>
-<postreq><p><b>General Information</b></p><dl><dlentry>
-<dt>Project Facets </dt>
-<dd>A facet represents a unit of functionality in a Web project. For example,
-the Dynamic Web Module facet enables the project to be deployed as a dynamic
-Web module. A brief description of a project facet appears in the wizard when
-you select it. Note that in many instances, you can view the constraints
-for a project facet by right clicking on the facet and selecting project constraints
-from the pop up menu. </dd>
-</dlentry><dlentry>
-<dt>Target Runtime</dt>
-<dd>Use this field to define a new installed runtime environment. Runtimes
-are used at build time to compile projects.</dd>
-</dlentry><dlentry>
-<dt>Enterprise Application project (EAR Project)</dt>
-<dd>A new or existing Enterprise Application project (EAR Project) must be
-associated with your new Web project to facilitate deployment. If you want
-to override the default settings for the Enterprise Application project, you
-can do so using the wizard. When your Web project is created at the end of
-the wizard, the new Enterprise Application project is also created with the
-name specified in the EAR project field. Note that the default is the name
-of the web project appended with EAR (unless the ear project was selected
-when you opened the wizard.)</dd>
-</dlentry><dlentry>
-<dt>Context Root</dt>
-<dd>The context root is the Web application root, which is the top-level directory
-of your application when it is deployed to the Web server. You can change
-the context root after you create a project using the project Properties dialog,
-which you access from the project's pop-up menu. The context root can also
-be used by the links builder to ensure that your links remain ready to publish
-as you move and rename files inside your project.</dd>
-</dlentry></dl></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html
deleted file mode 100644
index 07ae7d19bd..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating a dynamic Web project" />
-<meta name="abstract" content="You create and maintain the resources for your Web applications in Web projects." />
-<meta name="description" content="You create and maintain the resources for your Web applications in Web projects." />
-<meta content="Web projects, creating dynamic projects, Web applications, resources" name="DC.subject" />
-<meta content="Web projects, creating dynamic projects, Web applications, resources" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twcreprj" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating a dynamic Web project</title>
-</head>
-<body id="twcreprj"><a name="twcreprj"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating a dynamic Web project</h1>
-
-
-
-<div><p>You create and maintain the resources for your Web applications
-in Web projects.</p>
-
-<div class="section"> <p> Unlike with <a href="twcresta.html" title="">static</a> Web
-projects, dynamic Web projects enable you to create resources such as JavaServer
-Pages and servlets.</p>
-<p>To create a new dynamic Web project, complete the
-following steps:</p>
-</div>
-
-<ol>
-<li><span>Open the Java EE perspective.</span></li>
-
-<li><span>In the Project Explorer, right click on Dynamic Web Projects, and
-select <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">Dynamic Web Project</span>
-</span> from the context menu. The New Dynamic Web Project wizard starts.</span>
-</li>
-
-<li><span>Follow the project wizard prompts.</span></li>
-
-</ol>
-
-<div class="section"><p><strong>General Information</strong></p>
-<dl>
-<dt class="dlterm">Project Facets </dt>
-
-<dd>A facet represents a unit of functionality in a Web project. For example,
-the Dynamic Web Module facet enables the project to be deployed as a dynamic
-Web module. A brief description of a project facet appears in the wizard when
-you select it. Note that in many instances, you can view the constraints
-for a project facet by right clicking on the facet and selecting project constraints
-from the pop up menu. </dd>
-
-
-<dt class="dlterm">Target Runtime</dt>
-
-<dd>Use this field to define a new installed runtime environment. Runtimes
-are used at build time to compile projects.</dd>
-
-
-<dt class="dlterm">Enterprise Application project (EAR Project)</dt>
-
-<dd>A new or existing Enterprise Application project (EAR Project) must be
-associated with your new Web project to facilitate deployment. If you want
-to override the default settings for the Enterprise Application project, you
-can do so using the wizard. When your Web project is created at the end of
-the wizard, the new Enterprise Application project is also created with the
-name specified in the EAR project field. Note that the default is the name
-of the web project appended with EAR (unless the ear project was selected
-when you opened the wizard.)</dd>
-
-
-<dt class="dlterm">Context Root</dt>
-
-<dd>The context root is the Web application root, which is the top-level directory
-of your application when it is deployed to the Web server. You can change
-the context root after you create a project using the project Properties dialog,
-which you access from the project's pop-up menu. The context root can also
-be used by the links builder to ensure that your links remain ready to publish
-as you move and rename files inside your project.</dd>
-
-</dl>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
-<div><a href="../topics/ccwebprj.html">Dynamic Web projects and applications</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tjcrejsp.html" title="">Creating JavaServer Pages (JSP) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita
deleted file mode 100644
index 8be5130fe7..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twcresta" xml:lang="en-us">
-<title>Creating a static Web project</title>
-<shortdesc></shortdesc>
-<prolog><metadata>
-<keywords><indexterm>static Web projects<indexterm>creating</indexterm></indexterm>
-<indexterm>Web projects<indexterm>creating static</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p> In the workbench, you create and maintain resources for Web applications
-in Web projects. If you want to create a static, content-based Web application
-that contains no dynamic elements, such as JSP files or servlets, use the <ph><uicontrol>New
-Static Web Project</uicontrol></ph> wizard. </p><p>To create a new static
-Web project, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open the Java EE perspective </cmd><info></info></step>
-<step><cmd>In the Project Explorer, right click on Other Projects and select <b>New->Other->Web->Static
-Web Project</b> from the context menu. The New Static Web Project wizard starts. </cmd>
-</step>
-<step><cmd>Follow the project wizard prompts</cmd><info></info></step>
-</steps>
-<postreq><p><b>General Information</b></p><dl><dlentry>
-<dt>Project Facets </dt>
-<dd>A facet represents a unit of functionality in a Web project. For example,
-the Static Web Module facet enables the project to be deployed as a static
-Web module. A brief description of a project facet appears in the wizard when
-you select it. Note that in many instances, you can view the constraints
-for a project facet by right clicking on the facet and selecting project constraints
-from the pop up menu. </dd>
-</dlentry><dlentry>
-<dt>Target Runtime</dt>
-<dd>Use this field to define a new installed runtime environment. Runtimes
-are used at build time to compile projects. </dd>
-</dlentry></dl><dl><dlentry>
-<dt>Web Content Folder</dt>
-<dd>The folder in which you want to store your publishable resources. </dd>
-</dlentry></dl></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html
deleted file mode 100644
index dd9af088a4..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating a static Web project" />
-<meta name="abstract" content="" />
-<meta name="description" content="" />
-<meta content="static Web projects, creating, Web projects, creating static" name="DC.subject" />
-<meta content="static Web projects, creating, Web projects, creating static" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twcresta" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating a static Web project</title>
-</head>
-<body id="twcresta"><a name="twcresta"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating a static Web project</h1>
-
-
-
-<div><p />
-
-<div class="section"><p> In the workbench, you create and maintain resources for Web applications
-in Web projects. If you want to create a static, content-based Web application
-that contains no dynamic elements, such as JSP files or servlets, use the <span><span class="uicontrol">New
-Static Web Project</span></span> wizard. </p>
-<p>To create a new static
-Web project, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open the Java EE perspective </span> </li>
-
-<li class="stepexpand"><span>In the Project Explorer, right click on Other Projects and select <strong>New-&gt;Other-&gt;Web-&gt;Static
-Web Project</strong> from the context menu. The New Static Web Project wizard starts. </span>
-</li>
-
-<li class="stepexpand"><span>Follow the project wizard prompts</span> </li>
-
-</ol>
-
-<div class="section"><p><strong>General Information</strong></p>
-<dl>
-<dt class="dlterm">Project Facets </dt>
-
-<dd>A facet represents a unit of functionality in a Web project. For example,
-the Static Web Module facet enables the project to be deployed as a static
-Web module. A brief description of a project facet appears in the wizard when
-you select it. Note that in many instances, you can view the constraints
-for a project facet by right clicking on the facet and selecting project constraints
-from the pop up menu. </dd>
-
-
-<dt class="dlterm">Target Runtime</dt>
-
-<dd>Use this field to define a new installed runtime environment. Runtimes
-are used at build time to compile projects. </dd>
-
-</dl>
-<dl>
-<dt class="dlterm">Web Content Folder</dt>
-
-<dd>The folder in which you want to store your publishable resources. </dd>
-
-</dl>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.dita
deleted file mode 100644
index 86699ab894..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twcrewar" xml:lang="en-us">
-<title>Exporting Web Archive (WAR) files</title>
-<prolog><metadata>
-<keywords><indexterm>exporting<indexterm>WAR files</indexterm></indexterm>
-<indexterm>WAR files<indexterm>exporting</indexterm></indexterm>
-<indexterm>Web projects<indexterm>exporting WAR files</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p> A Web archive (WAR) file is a packaged Web application that
-can be exported to test, publish, and deploy the resources developed within
-a Web project.</p><p>To export a WAR file from a Web project, do the following: </p></context>
-<steps>
-<step><cmd>Right click on a Web project folder and select <b>Export</b> from
-the pop-up menu. Then select<b> WAR file</b> in the Export window and then
-select <b>Next</b>.</cmd></step>
-<step><cmd>Specify the Web project you want to export (this field is primed
-if you used the pop-up menu to open the wizard), and specify a location for
-the new WAR file</cmd></step>
-<step importance="optional"><cmd>Optionally, supply WAR export <ph>Options</ph>,
-such as whether or not to include <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> source files in the WAR, and whether
-to overwrite any existing resources during the export process. </cmd><info>Source
-files are not usually included in a WAR file, because they are not necessary
-for the server to run the web application.</info></step>
-<step><cmd>Click <ph><uicontrol>Finish</uicontrol></ph>.</cmd></step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html
deleted file mode 100644
index a3a6576174..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Exporting Web Archive (WAR) files" />
-<meta content="exporting, WAR files, Web projects, exporting WAR files" name="DC.subject" />
-<meta content="exporting, WAR files, Web projects, exporting WAR files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twcrewar" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Exporting Web Archive (WAR) files</title>
-</head>
-<body id="twcrewar"><a name="twcrewar"><!-- --></a>
-
-
-<h1 class="topictitle1">Exporting Web Archive (WAR) files</h1>
-
-
-<div>
-<div class="section"> <p> A Web archive (WAR) file is a packaged Web application that
-can be exported to test, publish, and deploy the resources developed within
-a Web project.</p>
-<p>To export a WAR file from a Web project, do the following: </p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Right click on a Web project folder and select <strong>Export</strong> from
-the pop-up menu. Then select<strong> WAR file</strong> in the Export window and then
-select <strong>Next</strong>.</span></li>
-
-<li class="stepexpand"><span>Specify the Web project you want to export (this field is primed
-if you used the pop-up menu to open the wizard), and specify a location for
-the new WAR file</span></li>
-
-<li class="stepexpand"><strong>Optional: </strong><span>Optionally, supply WAR export <span>Options</span>,
-such as whether or not to include Javaâ„¢ source files in the WAR, and whether
-to overwrite any existing resources during the export process. </span> Source
-files are not usually included in a WAR file, because they are not necessary
-for the server to run the web application.</li>
-
-<li class="stepexpand"><span>Click <span><span class="uicontrol">Finish</span></span>.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwwarovr.html">Web archive (WAR) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.dita
deleted file mode 100644
index 66cfcc864c..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.dita
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twcvsr" xml:lang="en-us">
-<title>Setting CVS repository defaults</title>
-<prolog><metadata>
-<keywords><indexterm>build output folders<indexterm>ignoring in CVS</indexterm></indexterm>
-<indexterm>CVS<indexterm>setting repository defaults</indexterm></indexterm>
-<indexterm>cvsignore files<indexterm>creating</indexterm></indexterm>
-<indexterm>repositories<indexterm>default CVS settings</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>When you use a CVS repository during team development, you might
-want to use the following setup to ensure that the CVS versioning support
-ignores the project's build output folder:</p> </context>
-<steps>
-<step><cmd>Create a file called .cvsignore in your project's <filepath>WebContent/WEB-INF</filepath> folder.</cmd>
-</step>
-<step><cmd>In this file, add a line with the name of the build output folder
-(for example, <codeph>classes</codeph>).</cmd><info><p>Currently, you have
-the option of creating this file automatically (as a feature) when using the
-New Dynamic Web Project wizard.</p><p>When you synchronize with a CVS team
-stream, the output folder will be ignored.</p></info></step>
-<step><cmd>In addition, you should turn off the <ph><uicontrol>Prune empty
-directories</uicontrol></ph> option. Select <ph><menucascade><uicontrol>Windows</uicontrol>
-<uicontrol>Preferences</uicontrol></menucascade></ph>, switch to the <ph><menucascade>
-<uicontrol>Team</uicontrol><uicontrol>CVS</uicontrol></menucascade></ph> properties
-page, and ensure that the <ph><uicontrol>Prune empty directories</uicontrol></ph> check
-box is not checked.</cmd><info><p>If this option is enabled and your Web project's
-source directory is empty, it will be deleted when the project is added to
-your workspace from a CVS repository, causing a <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build error.</p></info></step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html
deleted file mode 100644
index 236e52e923..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting CVS repository defaults" />
-<meta content="build output folders, ignoring in CVS, CVS, setting repository defaults, cvsignore files, creating, repositories, default CVS settings" name="DC.subject" />
-<meta content="build output folders, ignoring in CVS, CVS, setting repository defaults, cvsignore files, creating, repositories, default CVS settings" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twcvsr" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting CVS repository defaults</title>
-</head>
-<body id="twcvsr"><a name="twcvsr"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting CVS repository defaults</h1>
-
-
-<div>
-<div class="section"> <p>When you use a CVS repository during team development, you might
-want to use the following setup to ensure that the CVS versioning support
-ignores the project's build output folder:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>Create a file called .cvsignore in your project's <span class="filepath">WebContent/WEB-INF</span> folder.</span>
-</li>
-
-<li class="stepexpand"><span>In this file, add a line with the name of the build output folder
-(for example, <samp class="codeph">classes</samp>).</span> <p>Currently, you have
-the option of creating this file automatically (as a feature) when using the
-New Dynamic Web Project wizard.</p>
-<p>When you synchronize with a CVS team
-stream, the output folder will be ignored.</p>
-</li>
-
-<li class="stepexpand"><span>In addition, you should turn off the <span><span class="uicontrol">Prune empty
-directories</span></span> option. Select <span><span class="menucascade"><span class="uicontrol">Windows</span>
- &gt; <span class="uicontrol">Preferences</span></span></span>, switch to the <span><span class="menucascade">
-<span class="uicontrol">Team</span> &gt; <span class="uicontrol">CVS</span></span></span> properties
-page, and ensure that the <span><span class="uicontrol">Prune empty directories</span></span> check
-box is not checked.</span> <p>If this option is enabled and your Web project's
-source directory is empty, it will be deleted when the project is added to
-your workspace from a CVS repository, causing a Javaâ„¢ build error.</p>
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita
deleted file mode 100644
index 23c92fe690..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twfltwiz" xml:lang="en-us">
-<title>Creating Filters</title>
-<shortdesc>The filters wizard helps you to create <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> servlet filters by walking you through
-the creation process and by providing you with output files that you can use
-or that you can modify for use with your Web application. The filters can
-run on Java EE-compliant Web servers.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>To create a filter, complete the following steps: </p></context>
-<steps>
-<step><cmd>In the Java EE perspective, expand your <xref href="ccwebprj.dita"
-scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd>
-</step>
-<step><cmd>Right click on the <b>Filter</b> icon, and select <menucascade>
-<uicontrol>New</uicontrol><uicontrol>Filter</uicontrol></menucascade> from
-the pop-up menu.</cmd><stepresult> The <uicontrol>Create Filter</uicontrol> wizard
-appears.</stepresult></step>
-<step><cmd>Follow the project wizard prompts.</cmd></step>
-</steps>
-<postreq><p><b>General Information</b></p><dl><dlentry>
-<dt>Modifiers</dt>
-<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite> states
-that a Servlet class must be <b>public</b> and not <b>abstract</b>. Therefore,
-you cannot change these modifiers. The only one available for change is the <b>final</b> modifier.</dd>
-</dlentry><dlentry>
-<dt>Interfaces</dt>
-<dd>There is one obligatory interface that filter classes must implement: <b>javax.servlet.Filter</b>.
-This interface is provided by javax.servlet package and is used to represent
-the life-cycle of the filter. This interface has three methods: init, doFilter
-and destroy. <ul>
-<li>The <b>init</b> method is called by the servlet container only once, when
-it finishes instantiating the filter.</li>
-<li>The<b>doFilter</b> method is where the filtering is performed and is called
-every time a user requests a resource, such as a servlet, to which the filter
-is mapped.</li>
-<li>The <b>destroy</b> method is called by the servlet container to tell the
-filter that it will be taken out of service.</li>
-</ul> Although, that the javax.servlet.Filter interface is provided in the <b>Interfaces</b> field
-by default, you can add additional interfaces to implement by using the <b>Add</b> button.</dd>
-</dlentry><dlentry>
-<dt>Interface selection dialog</dt>
-<dd>This dialog appears if you select to add an interface to your filter.
-As you type the name of the interface that you are adding, a list of available
-interfaces listed in the <b>Matching items</b> list box updates dynamically
-to display only the interfaces that match the pattern. Choose an interface
-to see the qualifier, and then click <b>OK</b> when finished.</dd>
-</dlentry><dlentry>
-<dt>Filter Mappings</dt>
-<dd>For a filter to intercept a request to a servlet, you must: <ol>
-<li>declare the filter with a <b>&lt;filter&gt;</b> element in the deployment
-descriptor</li>
-<li>map the filter to the servlet using the <b>&lt;filter-mapping&gt;</b>
-element.</li>
-</ol> Sometimes you want a filter to work on multiple servlets. You can do
-this by mapping a filter to a URL pattern so that any request that matches
-that URL pattern will be filtered. All this is made automatically if you use
-the <b>Filter Mappings</b> field.</dd>
-</dlentry><dlentry>
-<dt>Method stubs</dt>
-<dd>Because each filter must implement the javax.servlet.Filter interface,
-the <b>Inherited abstract methods</b> option is always checked and cannot
-be changed.</dd>
-</dlentry></dl></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html
deleted file mode 100644
index fcb8aa0b4a..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating Filters" />
-<meta name="abstract" content="The filters wizard helps you to create Java servlet filters by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The filters can run on Java EE-compliant Web servers." />
-<meta name="description" content="The filters wizard helps you to create Java servlet filters by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The filters can run on Java EE-compliant Web servers." />
-<meta content="servlets, creating" name="DC.subject" />
-<meta content="servlets, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twfltwiz" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating Filters</title>
-</head>
-<body id="twfltwiz"><a name="twfltwiz"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating Filters</h1>
-
-
-
-<div><p>The filters wizard helps you to create Javaâ„¢ servlet filters by walking you through
-the creation process and by providing you with output files that you can use
-or that you can modify for use with your Web application. The filters can
-run on Java EE-compliant Web servers.</p>
-
-<div class="section"> <p>To create a filter, complete the following steps: </p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Java EE perspective, expand your <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span>
-</li>
-
-<li class="stepexpand"><span>Right click on the <strong>Filter</strong> icon, and select <span class="menucascade">
-<span class="uicontrol">New</span> &gt; <span class="uicontrol">Filter</span></span> from
-the pop-up menu.</span> The <span class="uicontrol">Create Filter</span> wizard
-appears.</li>
-
-<li class="stepexpand"><span>Follow the project wizard prompts.</span></li>
-
-</ol>
-
-<div class="section"><p><strong>General Information</strong></p>
-<dl>
-<dt class="dlterm">Modifiers</dt>
-
-<dd>The <cite>Sun Microsystems Java Servlet 2.3 Specification</cite> states
-that a Servlet class must be <strong>public</strong> and not <strong>abstract</strong>. Therefore,
-you cannot change these modifiers. The only one available for change is the <strong>final</strong> modifier.</dd>
-
-
-<dt class="dlterm">Interfaces</dt>
-
-<dd>There is one obligatory interface that filter classes must implement: <strong>javax.servlet.Filter</strong>.
-This interface is provided by javax.servlet package and is used to represent
-the life-cycle of the filter. This interface has three methods: init, doFilter
-and destroy. <ul>
-<li>The <strong>init</strong> method is called by the servlet container only once, when
-it finishes instantiating the filter.</li>
-
-<li>The<strong>doFilter</strong> method is where the filtering is performed and is called
-every time a user requests a resource, such as a servlet, to which the filter
-is mapped.</li>
-
-<li>The <strong>destroy</strong> method is called by the servlet container to tell the
-filter that it will be taken out of service.</li>
-
-</ul>
- Although, that the javax.servlet.Filter interface is provided in the <strong>Interfaces</strong> field
-by default, you can add additional interfaces to implement by using the <strong>Add</strong> button.</dd>
-
-
-<dt class="dlterm">Interface selection dialog</dt>
-
-<dd>This dialog appears if you select to add an interface to your filter.
-As you type the name of the interface that you are adding, a list of available
-interfaces listed in the <strong>Matching items</strong> list box updates dynamically
-to display only the interfaces that match the pattern. Choose an interface
-to see the qualifier, and then click <strong>OK</strong> when finished.</dd>
-
-
-<dt class="dlterm">Filter Mappings</dt>
-
-<dd>For a filter to intercept a request to a servlet, you must: <ol>
-<li>declare the filter with a <strong>&lt;filter&gt;</strong> element in the deployment
-descriptor</li>
-
-<li>map the filter to the servlet using the <strong>&lt;filter-mapping&gt;</strong>
-element.</li>
-
-</ol>
- Sometimes you want a filter to work on multiple servlets. You can do
-this by mapping a filter to a URL pattern so that any request that matches
-that URL pattern will be filtered. All this is made automatically if you use
-the <strong>Filter Mappings</strong> field.</dd>
-
-
-<dt class="dlterm">Method stubs</dt>
-
-<dd>Because each filter must implement the javax.servlet.Filter interface,
-the <strong>Inherited abstract methods</strong> option is always checked and cannot
-be changed.</dd>
-
-</dl>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwfiltbn.html">Filters</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita
deleted file mode 100644
index 309c061987..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twimpwar" xml:lang="en-us">
-<title>Importing Web archive (WAR) files</title>
-<prolog><metadata>
-<keywords><indexterm>WAR files<indexterm>importing</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>A Web Archive (WAR) file is a portable, packaged Web application
-that you can import into your workspace. </p><p> Before importing a WAR file,
-you should first determine if the WAR file contains needed <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> source
-files. When importing a WAR file into an existing Web project, the imported
-Web deployment descriptor files are either not changed or overwritten by the
-ones included in the imported WAR file, based on your response to the prompt
-that is provided. In either case, this action does <i>not</i> represent a
-merging of the two sets of deployment descriptors. </p> <p>To import the
-Web project resources in a WAR file into your workspace, complete the following
-steps:</p></context>
-<steps>
-<step><cmd>Select <ph><menucascade><uicontrol>File</uicontrol><uicontrol>Import</uicontrol>
-</menucascade></ph>.</cmd></step>
-<step><cmd> In the Import dialog, select <ph><uicontrol>WAR file</uicontrol></ph> and
-then click <ph><uicontrol>Next</uicontrol></ph>. </cmd></step>
-<step><cmd>Locate the WAR file that you want to import using the <ph><uicontrol>Browse</uicontrol></ph> button.</cmd>
-</step>
-<step><cmd> The wizard assumes you want to create a new Web project with the
-same name as the WAR file. If you accept this choice, the project will be
-created with the same servlet version as specified by the WAR file and in
-the same location. If you want to override these settings, you can click <b>New</b> and
-specify your new settings in the Dynamic Web Project wizard.</cmd></step>
-<step><cmd>Click <ph><uicontrol>Finish</uicontrol></ph> to populate the Web
-project.</cmd></step>
-</steps>
-</taskbody>
-<related-links>
-<linkpool type="concept"></linkpool>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html
deleted file mode 100644
index 90dfb8a965..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Importing Web archive (WAR) files" />
-<meta content="WAR files, importing" name="DC.subject" />
-<meta content="WAR files, importing" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twimpwar" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Importing Web archive (WAR) files</title>
-</head>
-<body id="twimpwar"><a name="twimpwar"><!-- --></a>
-
-
-<h1 class="topictitle1">Importing Web archive (WAR) files</h1>
-
-
-<div>
-<div class="section"> <p>A Web Archive (WAR) file is a portable, packaged Web application
-that you can import into your workspace. </p>
-<p> Before importing a WAR file,
-you should first determine if the WAR file contains needed Javaâ„¢ source
-files. When importing a WAR file into an existing Web project, the imported
-Web deployment descriptor files are either not changed or overwritten by the
-ones included in the imported WAR file, based on your response to the prompt
-that is provided. In either case, this action does <em>not</em> represent a
-merging of the two sets of deployment descriptors. </p>
- <p>To import the
-Web project resources in a WAR file into your workspace, complete the following
-steps:</p>
-</div>
-
-<ol>
-<li><span>Select <span><span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Import</span>
-</span></span>.</span></li>
-
-<li><span> In the Import dialog, select <span><span class="uicontrol">WAR file</span></span> and
-then click <span><span class="uicontrol">Next</span></span>. </span></li>
-
-<li><span>Locate the WAR file that you want to import using the <span><span class="uicontrol">Browse</span></span> button.</span>
-</li>
-
-<li><span> The wizard assumes you want to create a new Web project with the
-same name as the WAR file. If you accept this choice, the project will be
-created with the same servlet version as specified by the WAR file and in
-the same location. If you want to override these settings, you can click <strong>New</strong> and
-specify your new settings in the Dynamic Web Project wizard.</span></li>
-
-<li><span>Click <span><span class="uicontrol">Finish</span></span> to populate the Web
-project.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwwarovr.html">Web archive (WAR) files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita
deleted file mode 100644
index f8b1edbad9..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
-<task id="twlstwiz" xml:lang="en-us">
-<title>Creating Listeners</title>
-<shortdesc>The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>To create a listener, complete the following steps: </p></context>
-<steps>
-<step><cmd>From the Java EE perspective, expand your <xref href="ccwebprj.dita" scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd></step>
-<step><cmd>Right click on the <b>Listener</b> icon, and select <menucascade><uicontrol>New</uicontrol><uicontrol>Listener</uicontrol></menucascade> from the pop-up menu.</cmd><stepresult> The <uicontrol>Create Listener</uicontrol> wizard appears.</stepresult></step>
-<step><cmd>Follow the project wizard prompts.</cmd></step>
-</steps>
-<postreq><dl><dlentry>
-<dt>Application lifecycle listeners</dt>
-<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite>defines the following interfaces that represent that application lifecycle listeners. You should select at least one of the intefaces. <ul>
-<li><b>javax.servlet.ServletContextListener:</b> This interface is provided by javax.servlet package and can be used to listen to the ServletContext life-cycle events. This interface has two methods: contextInitialized and contextDestroyed. The <b><i>contextInitialized</i></b> method is called when the web application is ready to service requests and the <b><i>contextDestroyed</i></b> method is invoked when the servlet context is about to be shut down.</li>
-<li><b>javax.servlet.ServletContextAttributeListener:</b> This interface is provided by javax.servlet package. It can be used to be notified when any attribute is added to the ServletContext or if any of the ServletContext's attributes are changed or removed. This inetface has three methods: <b><i>attributeAdded, attributeRemoved</i></b> and <b><i>attributeReplaced</i></b>.</li>
-<li><b>javax.servlet.ServletRequestListener:</b> This interface is provided by javax.servlet package. It can be used to be notified when a request is coming in or out of scope in a Web component. This interface has two methods: requestInitialized and requestDestroyed. The <b><i>requestInitialized</i></b> method is called when it is about to enter the first servlet or filter in each Web application. The <b><i>requestDestroyed</i></b> method is called when it exits the last servlet or the first filter in the chain.</li>
-<li><b>javax.servlet.ServletRequestAttributeListener:</b> This interface is provided by javax.servlet package and can be used to be notified when any request attribute is changed. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <b><i>attributteAdded</i></b> method is called when a new attribute was added to servlet request. The <b><i>attributeRemoved</i></b> method is called when an existing attribute has been removed from the servlet request. The <b><i>attributeReplaced</i></b> method is called when an attribute was replaced on the servlet request.</li>
-<li><b>javax.servlet.http.HttpSessionListener:</b> This interface is provided by javax.servlet.http package and can be used to listen to a sessions life cycle events. This interface has two methods: sessionCreated and sessionDestroyed. The <b><i>sessionCreated</i></b> method is called when an HttpSession object is created. The <b><i>sessionDestroyed</i></b> method is called when an HttpSession object is invalidated.</li>
-<li><b>javax.servlet.http.HttpSessionActivationListener:</b> This interface is provided by javax.servlet.http package. It can be used to listen to a container events notifying that sessions will be passivated or activated. This interface has two methods: sessionDidActivate and sessionWillPasivate. The <b><i>sessionDidActivate</i></b> is called when the session has just been activated and the <b><i>sessionWillPasivate</i></b> is called when the session is about to be passivated.</li>
-<li><b>javax.servlet.http.HttpSessionAttributeListener:</b> This interface is provided by javax.servlet.http package and can be used to listen to events related to session attributes. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <b><i>attributeAdded</i></b> method is called when an attribute is added to an HttpSession object. The <b><i>attributeRemoved</i></b> and <b><i>attributeReplaced</i></b> methods are called when an HttpSession attribute is removed or replaced, respectively.</li>
-<li><b>javax.servlet.http.HttpSessionBindingListener:</b> This interface is provided by javax.servlet.http package and can be used to be notified when an object is bound to or unbound from a session. This interface has two methods: valueBound and valueUnbound. The <b><i>valueBound</i></b> method is called when the object is being bound to a session and identifies the session. The <b><i>valueUnbound</i></b> method is called when the object is being unbound from a session and identifies the session.</li>
-</ul> </dd>
-</dlentry><dlentry>
-<dt>Modifiers</dt>
-<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite> states that a Listener class must be <b>public</b> and not <b>abstract</b>. Therefore, you cannot change these modifiers. The only one available for change is the <b>final</b> modifier.</dd>
-</dlentry><dlentry>
-<dt>Interfaces</dt>
-<dd>The interfaces that you selected in the previous page of the wizard are provided as default values in the <b>Interfaces</b> field. To add additional interfaces, click the <b>Add</b> button next to this field.</dd>
-</dlentry><dlentry>
-<dt>Interface selection dialog</dt>
-<dd>This dialog appears if you select to add an interface to your servlet. As you type the name of the interface that you are adding, a list of available interfaces listed in the <b>Matching items</b> list box updates dynamically to display only the interfaces that match the pattern. Choose an interface to see the qualifier, and then click <b>OK</b> when finished.</dd>
-</dlentry></dl></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html
deleted file mode 100644
index 1462cc6203..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating Listeners" />
-<meta name="abstract" content="The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers." />
-<meta name="description" content="The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers." />
-<meta content="servlets, creating" name="DC.subject" />
-<meta content="servlets, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twlstwiz" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating Listeners</title>
-</head>
-<body id="twlstwiz"><a name="twlstwiz"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating Listeners</h1>
-
-
-
-<div><p>The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers.</p>
-
-<div class="section"> <p>To create a listener, complete the following steps: </p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>From the Java EE perspective, expand your <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span></li>
-
-<li class="stepexpand"><span>Right click on the <strong>Listener</strong> icon, and select <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">Listener</span></span> from the pop-up menu.</span> The <span class="uicontrol">Create Listener</span> wizard appears.</li>
-
-<li class="stepexpand"><span>Follow the project wizard prompts.</span></li>
-
-</ol>
-
-<div class="section"><dl>
-<dt class="dlterm">Application lifecycle listeners</dt>
-
-<dd>The <cite>Sun Microsystems Javaâ„¢ Servlet 2.3 Specification</cite>defines the following interfaces that represent that application lifecycle listeners. You should select at least one of the intefaces. <ul>
-<li><strong>javax.servlet.ServletContextListener:</strong> This interface is provided by javax.servlet package and can be used to listen to the ServletContext life-cycle events. This interface has two methods: contextInitialized and contextDestroyed. The <strong><em>contextInitialized</em></strong> method is called when the web application is ready to service requests and the <strong><em>contextDestroyed</em></strong> method is invoked when the servlet context is about to be shut down.</li>
-
-<li><strong>javax.servlet.ServletContextAttributeListener:</strong> This interface is provided by javax.servlet package. It can be used to be notified when any attribute is added to the ServletContext or if any of the ServletContext's attributes are changed or removed. This inetface has three methods: <strong><em>attributeAdded, attributeRemoved</em></strong> and <strong><em>attributeReplaced</em></strong>.</li>
-
-<li><strong>javax.servlet.ServletRequestListener:</strong> This interface is provided by javax.servlet package. It can be used to be notified when a request is coming in or out of scope in a Web component. This interface has two methods: requestInitialized and requestDestroyed. The <strong><em>requestInitialized</em></strong> method is called when it is about to enter the first servlet or filter in each Web application. The <strong><em>requestDestroyed</em></strong> method is called when it exits the last servlet or the first filter in the chain.</li>
-
-<li><strong>javax.servlet.ServletRequestAttributeListener:</strong> This interface is provided by javax.servlet package and can be used to be notified when any request attribute is changed. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <strong><em>attributteAdded</em></strong> method is called when a new attribute was added to servlet request. The <strong><em>attributeRemoved</em></strong> method is called when an existing attribute has been removed from the servlet request. The <strong><em>attributeReplaced</em></strong> method is called when an attribute was replaced on the servlet request.</li>
-
-<li><strong>javax.servlet.http.HttpSessionListener:</strong> This interface is provided by javax.servlet.http package and can be used to listen to a sessions life cycle events. This interface has two methods: sessionCreated and sessionDestroyed. The <strong><em>sessionCreated</em></strong> method is called when an HttpSession object is created. The <strong><em>sessionDestroyed</em></strong> method is called when an HttpSession object is invalidated.</li>
-
-<li><strong>javax.servlet.http.HttpSessionActivationListener:</strong> This interface is provided by javax.servlet.http package. It can be used to listen to a container events notifying that sessions will be passivated or activated. This interface has two methods: sessionDidActivate and sessionWillPasivate. The <strong><em>sessionDidActivate</em></strong> is called when the session has just been activated and the <strong><em>sessionWillPasivate</em></strong> is called when the session is about to be passivated.</li>
-
-<li><strong>javax.servlet.http.HttpSessionAttributeListener:</strong> This interface is provided by javax.servlet.http package and can be used to listen to events related to session attributes. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <strong><em>attributeAdded</em></strong> method is called when an attribute is added to an HttpSession object. The <strong><em>attributeRemoved</em></strong> and <strong><em>attributeReplaced</em></strong> methods are called when an HttpSession attribute is removed or replaced, respectively.</li>
-
-<li><strong>javax.servlet.http.HttpSessionBindingListener:</strong> This interface is provided by javax.servlet.http package and can be used to be notified when an object is bound to or unbound from a session. This interface has two methods: valueBound and valueUnbound. The <strong><em>valueBound</em></strong> method is called when the object is being bound to a session and identifies the session. The <strong><em>valueUnbound</em></strong> method is called when the object is being unbound from a session and identifies the session.</li>
-
-</ul>
- </dd>
-
-
-<dt class="dlterm">Modifiers</dt>
-
-<dd>The <cite>Sun Microsystems Java Servlet 2.3 Specification</cite> states that a Listener class must be <strong>public</strong> and not <strong>abstract</strong>. Therefore, you cannot change these modifiers. The only one available for change is the <strong>final</strong> modifier.</dd>
-
-
-<dt class="dlterm">Interfaces</dt>
-
-<dd>The interfaces that you selected in the previous page of the wizard are provided as default values in the <strong>Interfaces</strong> field. To add additional interfaces, click the <strong>Add</strong> button next to this field.</dd>
-
-
-<dt class="dlterm">Interface selection dialog</dt>
-
-<dd>This dialog appears if you select to add an interface to your servlet. As you type the name of the interface that you are adding, a list of available interfaces listed in the <strong>Matching items</strong> list box updates dynamically to display only the interfaces that match the pattern. Choose an interface to see the qualifier, and then click <strong>OK</strong> when finished.</dd>
-
-</dl>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwlistbn.html">Listeners</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.dita
deleted file mode 100644
index 1a9890cd10..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.dita
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twpcnvrt" xml:lang="en-us">
-<title>Converting static Web projects to dynamic Web projects</title>
-<prolog><metadata>
-<keywords><indexterm>static Web projects<indexterm>converting to dynamic</indexterm></indexterm>
-<indexterm>Web projects<indexterm>converting static to dynamic</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p> If you want to add dynamic elements to a static web project,
-such as <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
-trademark="Java">Java</tm> servlets and JSP files, you must convert the project
-from a static to a dynamic one. To convert a static Web project to a dynamic
-Web project, complete the following steps:</p> </context>
-<steps>
-<step><cmd>Select the project in the Project Explorer view, and then select <ph><uicontrol>Convert
-to a Dynamic Web Project</uicontrol></ph> from the <b>Project</b> menu.</cmd>
-<info>This conversion assumes the project name and location will be the same.
-The conversion does not change the CSS file specified in the original static
-project, so it will be included in the resulting dynamic Web project. </info>
-</step>
-<step><cmd> Specify the project properties that are available when <xref
-href="twcreprj.dita" scope="peer"><desc></desc>Creating a Dynamic Web project.</xref></cmd>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html
deleted file mode 100644
index 80efb29012..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Converting static Web projects to dynamic Web projects" />
-<meta content="static Web projects, converting to dynamic, Web projects, converting static to dynamic" name="DC.subject" />
-<meta content="static Web projects, converting to dynamic, Web projects, converting static to dynamic" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twpcnvrt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Converting static Web projects to dynamic Web projects</title>
-</head>
-<body id="twpcnvrt"><a name="twpcnvrt"><!-- --></a>
-
-
-<h1 class="topictitle1">Converting static Web projects to dynamic Web projects</h1>
-
-
-<div>
-<div class="section"> <p> If you want to add dynamic elements to a static web project,
-such as Javaâ„¢ servlets and JSP files, you must convert the project
-from a static to a dynamic one. To convert a static Web project to a dynamic
-Web project, complete the following steps:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>Select the project in the Project Explorer view, and then select <span><span class="uicontrol">Convert
-to a Dynamic Web Project</span></span> from the <strong>Project</strong> menu.</span>
- This conversion assumes the project name and location will be the same.
-The conversion does not change the CSS file specified in the original static
-project, so it will be included in the resulting dynamic Web project.
-</li>
-
-<li class="stepexpand"><span> Specify the project properties that are available when <a href="twcreprj.html" title="">Creating a Dynamic Web project.</a></span>
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
-<div><a href="../topics/ccwebprj.html">Dynamic Web projects and applications</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita
deleted file mode 100644
index 511bd33b44..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twplib" xml:lang="en-us">
-<title>Adding Web library projects</title>
-<prolog><metadata>
-<keywords><indexterm keyref="twplib|1|WeblibraryprojectsvirtualJARfilesandprojects"
-status="changed">Web projects<indexterm>virtual JAR files and projects</indexterm></indexterm>
-<indexterm keyref="twplib|2|virtualJARfilesassociationsWeblibraryprojects"
-status="new">virtual JAR files associations<indexterm>Web library projects</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>Web library projects allow you to associate <tm tmclass="special"
-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> projects
-with "virtual" JAR files in a Web project's WEB-INF/lib directory. You can
-reference JAR files that exist elsewhere in the Enterprise Application project
-that contains your Web project, if they are in the Web project's build path,
-and avoid the need to explicitly copy these JAR files into the project's lib
-folder before you publish the Web application to a server.</p><p>To set up
-these associations:</p> </context>
-<steps>
-<step><cmd>Right click on a Web project and select <uicontrol>Properties</uicontrol> from
-the pop-up menu.</cmd><info></info></step>
-<step><cmd>Click on <uicontrol>Java EE Module Dependencies</uicontrol></cmd>
-</step>
-<step><cmd>Set up your associations in the Java EE Module Dependencies window</cmd>
-</step>
-<step><cmd>Click <ph><uicontrol>OK</uicontrol></ph> when you are done.</cmd>
-</step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html
deleted file mode 100644
index e4987c78c8..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding Web library projects" />
-<meta content="Web projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="DC.subject" />
-<meta content="Web projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twplib" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding Web library projects</title>
-</head>
-<body id="twplib"><a name="twplib"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding Web library projects</h1>
-
-
-<div>
-<div class="section"> <p>Web library projects allow you to associate Javaâ„¢ projects
-with "virtual" JAR files in a Web project's WEB-INF/lib directory. You can
-reference JAR files that exist elsewhere in the Enterprise Application project
-that contains your Web project, if they are in the Web project's build path,
-and avoid the need to explicitly copy these JAR files into the project's lib
-folder before you publish the Web application to a server.</p>
-<p>To set up
-these associations:</p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>Right click on a Web project and select <span class="uicontrol">Properties</span> from
-the pop-up menu.</span> </li>
-
-<li class="stepexpand"><span>Click on <span class="uicontrol">Java EE Module Dependencies</span></span>
-</li>
-
-<li class="stepexpand"><span>Set up your associations in the Java EE Module Dependencies window</span>
-</li>
-
-<li class="stepexpand"><span>Click <span><span class="uicontrol">OK</span></span> when you are done.</span>
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita
deleted file mode 100644
index dc282698cd..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twprjset" xml:lang="en-us">
-<title>Setting Web project properties</title>
-<prolog><metadata>
-<keywords><indexterm>Web projects<indexterm>properties settings</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>There are many Web project properties that you can set that affect
-the phases in the lifecycle of your project and its dependencies on other
-Web resources and Web development processes. You might want to verify or update
-these properties after you have updated an existing project or have imported
-Web resources into a project .</p><p>To view or set Web project properties,
-do the following: </p> </context>
-<steps>
-<step><cmd>Right-click on a Web Project, and from the pop-up menu select <ph><uicontrol>Properties</uicontrol></ph>.</cmd>
-</step>
-<step><cmd>Select a property type in the left pane of the Properties dialog
-to view or update properties in the Web project. For each property, you can
-apply changes and modify default settings. Based on whether you have a static
-or a dynamic Web project, the following property types are available:</cmd>
-<info><dl><dlentry>
-<dt>Info</dt>
-<dd>Provides general information about project type, location, and modification
-status. </dd>
-</dlentry><dlentry>
-<dt>BeanInfo Path (Dynamic Web project only)</dt>
-<dd>If you select the Enable Beaninfo Introspection on this project, you can
-specify the contents and order of <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> Bean search paths to provide Bean information
-relevant to the project. You can add, remove, and reorder (using the <ph>Up</ph> and <ph>Down</ph> buttons)
-the packages used to include Bean information.</dd>
-</dlentry><dlentry>
-<dt>Builders</dt>
-<dd>Add, remove, or reorder external tools in the build order. When you select <uicontrol>New</uicontrol> to
-create a new external tool to the list, the New External Tool wizard opens,
-so that you can define the new build tool.</dd>
-</dlentry><dlentry>
-<dt>Java EE (Dynamic Web project only)</dt>
-<dd>Identify Web level specification and modify context root and Web content
-folder name</dd>
-</dlentry><dlentry>
-<dt><tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Build
-Path (Dynamic Web project only)</dt>
-<dd>View or change the information about the <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> build path that you supplied when creating
-the project using the <ph>Create a DynamicWeb Project</ph> wizard. Whenever
-the Web project is rebuilt, any class files that are created or updated will
-be output to the specified output folder. <note>A library entry on the <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> build
-path will remain there unless the actual JAR file is deleted from the WEB-INF/lib
-folder. If you remove a library path entry but not the JAR file, the library
-entry will be re-added to the path automatically.</note></dd>
-</dlentry><dlentry>
-<dt><tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Compiler
-(Dynamic Web project only)</dt>
-<dd>Define whether to use workspace settings or project setting for compiling <tm
-tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> code,
-including settings for Problems, Style, Compliance and Classfiles, and Build
-Path.</dd>
-</dlentry><dlentry>
-<dt>Javadoc Location (Dynamic Web project only)</dt>
-<dd>Define a default location (URL) for any Javadoc available to the project.</dd>
-</dlentry><dlentry>
-<dt><tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> JAR
-Dependencies (Dynamic Web project only)</dt>
-<dd>Define and reorder JAR dependencies for the project. Note that these dependencies
-may differ based on a Web project's association with multiple Enterprise application
-projects.</dd>
-</dlentry><dlentry>
-<dt>JSP Task Tags</dt>
-<dd>Add, edit, or remove JSP task tags and assign tag priorities. These "to
-do" items appear in your Tasks view.</dd>
-</dlentry><dlentry>
-<dt>JSP Compilation</dt>
-<dd>Specify when in the build process a JSP should be set to compile</dd>
-</dlentry><dlentry>
-<dt>JSP Fragment (dynamic Web project only)</dt>
-<dd>Define default encoding, page directive, and content type values for JSP
-fragment documents in the web project.</dd>
-</dlentry><dlentry>
-<dt>Links Validation/Refactoring</dt>
-<dd>Define project-level link management and validation settings. These settings
-override corresponding settings in the Workbench Preference settings for the
-current project.</dd>
-</dlentry><dlentry>
-<dt>Project References</dt>
-<dd>Reference other Web projects that exist on your workbench workspace.</dd>
-</dlentry><dlentry>
-<dt>Server</dt>
-<dd>Select the server instance used to perform necessary development, test,
-and publishing functions for the project.</dd>
-</dlentry><dlentry>
-<dt>Validation</dt>
-<dd>Specify which validators should run for the project, and whether validation
-should occur automatically when resource updates are written to the project.
-The available validators are based on the types of resources in your project.
-By default, validators are automatically run when you save resources in a
-Web project. If you do not want validators to run automatically when you save
-these resources, enable the <uicontrol>Override validation</uicontrol> preferences
-option and disable the <uicontrol>Run validation automatically when you save
-changes to resources</uicontrol> option. <note>You can also disable automatic
-validation (and builds) for all projects by disabling <uicontrol>Perform build
- automatically on resource modification</uicontrol> from the <uicontrol>Workbench</uicontrol> properties.
-If you disable automatic builds, you can manually run a build (and validation)
-by selecting <menucascade><uicontrol>Project</uicontrol><uicontrol>Rebuild
-project</uicontrol></menucascade>.</note></dd>
-</dlentry><dlentry>
-<dt>Web Content Settings</dt>
-<dd>Provide any applicable Web content settings for a Web project. You can
-specify the document type, CSS profile, and target device.</dd>
-</dlentry><dlentry>
-<dt>Web Project Features</dt>
-<dd>Select the features you want to be enabled for your Web project, such
-as Page Template support.</dd>
-</dlentry></dl></info></step>
-<step><cmd>When you have completed updates to Web project settings, click <ph><uicontrol>OK</uicontrol></ph> to
-save and close the Properties dialog.</cmd></step>
-</steps>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html
deleted file mode 100644
index b1d1e40de1..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting Web project properties" />
-<meta content="Web projects, properties settings" name="DC.subject" />
-<meta content="Web projects, properties settings" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twprjset" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting Web project properties</title>
-</head>
-<body id="twprjset"><a name="twprjset"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting Web project properties</h1>
-
-
-<div>
-<div class="section"> <p>There are many Web project properties that you can set that affect
-the phases in the lifecycle of your project and its dependencies on other
-Web resources and Web development processes. You might want to verify or update
-these properties after you have updated an existing project or have imported
-Web resources into a project .</p>
-<p>To view or set Web project properties,
-do the following: </p>
- </div>
-
-<ol>
-<li class="stepexpand"><span>Right-click on a Web Project, and from the pop-up menu select <span><span class="uicontrol">Properties</span></span>.</span>
-</li>
-
-<li class="stepexpand"><span>Select a property type in the left pane of the Properties dialog
-to view or update properties in the Web project. For each property, you can
-apply changes and modify default settings. Based on whether you have a static
-or a dynamic Web project, the following property types are available:</span>
- <dl>
-<dt class="dlterm">Info</dt>
-
-<dd>Provides general information about project type, location, and modification
-status. </dd>
-
-
-<dt class="dlterm">BeanInfo Path (Dynamic Web project only)</dt>
-
-<dd>If you select the Enable Beaninfo Introspection on this project, you can
-specify the contents and order of Javaâ„¢ Bean search paths to provide Bean information
-relevant to the project. You can add, remove, and reorder (using the <span>Up</span> and <span>Down</span> buttons)
-the packages used to include Bean information.</dd>
-
-
-<dt class="dlterm">Builders</dt>
-
-<dd>Add, remove, or reorder external tools in the build order. When you select <span class="uicontrol">New</span> to
-create a new external tool to the list, the New External Tool wizard opens,
-so that you can define the new build tool.</dd>
-
-
-<dt class="dlterm">Java EE (Dynamic Web project only)</dt>
-
-<dd>Identify Web level specification and modify context root and Web content
-folder name</dd>
-
-
-<dt class="dlterm">Java Build
-Path (Dynamic Web project only)</dt>
-
-<dd>View or change the information about the Java build path that you supplied when creating
-the project using the <span>Create a DynamicWeb Project</span> wizard. Whenever
-the Web project is rebuilt, any class files that are created or updated will
-be output to the specified output folder. <div class="note"><span class="notetitle">Note:</span> A library entry on the Java build
-path will remain there unless the actual JAR file is deleted from the WEB-INF/lib
-folder. If you remove a library path entry but not the JAR file, the library
-entry will be re-added to the path automatically.</div>
-</dd>
-
-
-<dt class="dlterm">Java Compiler
-(Dynamic Web project only)</dt>
-
-<dd>Define whether to use workspace settings or project setting for compiling Java code,
-including settings for Problems, Style, Compliance and Classfiles, and Build
-Path.</dd>
-
-
-<dt class="dlterm">Javadoc Location (Dynamic Web project only)</dt>
-
-<dd>Define a default location (URL) for any Javadoc available to the project.</dd>
-
-
-<dt class="dlterm">Java JAR
-Dependencies (Dynamic Web project only)</dt>
-
-<dd>Define and reorder JAR dependencies for the project. Note that these dependencies
-may differ based on a Web project's association with multiple Enterprise application
-projects.</dd>
-
-
-<dt class="dlterm">JSP Task Tags</dt>
-
-<dd>Add, edit, or remove JSP task tags and assign tag priorities. These "to
-do" items appear in your Tasks view.</dd>
-
-
-<dt class="dlterm">JSP Compilation</dt>
-
-<dd>Specify when in the build process a JSP should be set to compile</dd>
-
-
-<dt class="dlterm">JSP Fragment (dynamic Web project only)</dt>
-
-<dd>Define default encoding, page directive, and content type values for JSP
-fragment documents in the web project.</dd>
-
-
-<dt class="dlterm">Links Validation/Refactoring</dt>
-
-<dd>Define project-level link management and validation settings. These settings
-override corresponding settings in the Workbench Preference settings for the
-current project.</dd>
-
-
-<dt class="dlterm">Project References</dt>
-
-<dd>Reference other Web projects that exist on your workbench workspace.</dd>
-
-
-<dt class="dlterm">Server</dt>
-
-<dd>Select the server instance used to perform necessary development, test,
-and publishing functions for the project.</dd>
-
-
-<dt class="dlterm">Validation</dt>
-
-<dd>Specify which validators should run for the project, and whether validation
-should occur automatically when resource updates are written to the project.
-The available validators are based on the types of resources in your project.
-By default, validators are automatically run when you save resources in a
-Web project. If you do not want validators to run automatically when you save
-these resources, enable the <span class="uicontrol">Override validation</span> preferences
-option and disable the <span class="uicontrol">Run validation automatically when you save
-changes to resources</span> option. <div class="note"><span class="notetitle">Note:</span> You can also disable automatic
-validation (and builds) for all projects by disabling <span class="uicontrol">Perform build
- automatically on resource modification</span> from the <span class="uicontrol">Workbench</span> properties.
-If you disable automatic builds, you can manually run a build (and validation)
-by selecting <span class="menucascade"><span class="uicontrol">Project</span> &gt; <span class="uicontrol">Rebuild
-project</span></span>.</div>
-</dd>
-
-
-<dt class="dlterm">Web Content Settings</dt>
-
-<dd>Provide any applicable Web content settings for a Web project. You can
-specify the document type, CSS profile, and target device.</dd>
-
-
-<dt class="dlterm">Web Project Features</dt>
-
-<dd>Select the features you want to be enabled for your Web project, such
-as Page Template support.</dd>
-
-</dl>
-</li>
-
-<li class="stepexpand"><span>When you have completed updates to Web project settings, click <span><span class="uicontrol">OK</span></span> to
-save and close the Properties dialog.</span></li>
-
-</ol>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita
deleted file mode 100644
index 15092e7853..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twsrvwiz" xml:lang="en-us">
-<title>Creating servlets</title>
-<shortdesc>The servlet wizard helps you create <tm tmclass="special" tmowner="Sun Microsystems, Inc."
-tmtype="tm" trademark="Java">Java</tm> servlets by walking you through the
-creation process and by providing you with output files that you can use or
-that you can modify for use with your Web application. The servlets can run
-on Java EE-compliant Web servers.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context> <p>To create a servlet, complete the following steps: </p></context>
-<steps>
-<step><cmd>From the Java EE perspective, expand your <xref href="ccwebprj.dita"
-scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd>
-</step>
-<step><cmd>Right click on the <b>Servlet</b> icon, and select <menucascade>
-<uicontrol>New</uicontrol><uicontrol>Servlet</uicontrol></menucascade> from
-the pop-up menu.</cmd><stepresult> The <uicontrol>Create Servlet</uicontrol> wizard
-appears.</stepresult></step>
-<step><cmd>Follow the project wizard prompts.</cmd></step>
-</steps>
-<postreq><p><b>General Information</b></p><dl><dlentry>
-<dt>Modifiers</dt>
-<dd>You can select a modifier in the wizard to specify whether your servlet
-class is public, abstract, or final. Note that classes cannot be both abstract
-and final.</dd>
-</dlentry><dlentry>
-<dt>javax.servlet.Servlet</dt>
-<dd>Although javax.servlet.Servlet is provided as the default interface, you
-can use the wizard to add additional interfaces to implement.</dd>
-</dlentry><dlentry>
-<dt>Interface selection dialog</dt>
-<dd>This dialog appears if you elect to add an interface to your servlet.
-As you type the name of the interface that you are adding, a list of available
-interfaces listed in the Matching types list box updates dynamically to display
-only the interfaces that match the pattern. You should choose an interface
-to see the qualifier, and then click OK when finished.</dd>
-</dlentry><dlentry>
-<dt>Method stubs</dt>
-<dd>You can select any appropriate method stubs to be created in the servlet
-file. The stubs created by using the Inherited abstract methods option must
-be implemented if you do not intend to create an abstract servlet. Note that
-this is not true for Constructors from superclass</dd>
-</dlentry></dl></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html
deleted file mode 100644
index a1a1ac64cc..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating servlets" />
-<meta name="abstract" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on Java EE-compliant Web servers." />
-<meta name="description" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on Java EE-compliant Web servers." />
-<meta content="servlets, creating" name="DC.subject" />
-<meta content="servlets, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twsrvwiz" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating servlets</title>
-</head>
-<body id="twsrvwiz"><a name="twsrvwiz"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating servlets</h1>
-
-
-
-<div><p>The servlet wizard helps you create Javaâ„¢ servlets by walking you through the
-creation process and by providing you with output files that you can use or
-that you can modify for use with your Web application. The servlets can run
-on Java EE-compliant Web servers.</p>
-
-<div class="section"> <p>To create a servlet, complete the following steps: </p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>From the Java EE perspective, expand your <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span>
-</li>
-
-<li class="stepexpand"><span>Right click on the <strong>Servlet</strong> icon, and select <span class="menucascade">
-<span class="uicontrol">New</span> &gt; <span class="uicontrol">Servlet</span></span> from
-the pop-up menu.</span> The <span class="uicontrol">Create Servlet</span> wizard
-appears.</li>
-
-<li class="stepexpand"><span>Follow the project wizard prompts.</span></li>
-
-</ol>
-
-<div class="section"><p><strong>General Information</strong></p>
-<dl>
-<dt class="dlterm">Modifiers</dt>
-
-<dd>You can select a modifier in the wizard to specify whether your servlet
-class is public, abstract, or final. Note that classes cannot be both abstract
-and final.</dd>
-
-
-<dt class="dlterm">javax.servlet.Servlet</dt>
-
-<dd>Although javax.servlet.Servlet is provided as the default interface, you
-can use the wizard to add additional interfaces to implement.</dd>
-
-
-<dt class="dlterm">Interface selection dialog</dt>
-
-<dd>This dialog appears if you elect to add an interface to your servlet.
-As you type the name of the interface that you are adding, a list of available
-interfaces listed in the Matching types list box updates dynamically to display
-only the interfaces that match the pattern. You should choose an interface
-to see the qualifier, and then click OK when finished.</dd>
-
-
-<dt class="dlterm">Method stubs</dt>
-
-<dd>You can select any appropriate method stubs to be created in the servlet
-file. The stubs created by using the Inherited abstract methods option must
-be implemented if you do not intend to create an abstract servlet. Note that
-this is not true for Constructors from superclass</dd>
-
-</dl>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwservbn.html">Servlets</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap
deleted file mode 100644
index 262591eaa1..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map id="webappdevelopment" linking="none" title="Web application development">
-<topicref href="topics/ccwtover.dita" navtitle="Web application overview">
-<topicref href="topics/cwtfeatures.dita" navtitle="Web tools features">
-<topicref href="topics/ccwebvw.dita" navtitle="Project Explorer view and Web development">
-</topicref>
-<topicref href="topics/cwebresources.dita" navtitle="Web resources"></topicref>
-<topicref href="topics/cwebpagedesign.dita" navtitle="Web page design"></topicref>
-</topicref>
-</topicref>
-<topicref href="topics/cwebprojects.dita" navtitle="Web projects">
-<topicref href="topics/cwwarovr.dita" navtitle="Web archive (WAR) files">
-</topicref>
-<topicref href="topics/twcreprj.dita" navtitle="Creating a dynamic Web project">
-<topicref href="topics/ccwebprj.dita" navtitle="Dynamic Web projects and applications">
-</topicref>
-</topicref>
-<topicref href="topics/twcresta.dita" navtitle="Creating a static Web project">
-<topicref href="topics/twpcnvrt.dita" navtitle="Converting static Web projects to dynamic Web projects">
-</topicref>
-<topicref href="topics/ccstatic.dita" navtitle="Static Web projects"></topicref>
-</topicref>
-<topicref href="topics/twimpwar.dita" navtitle="Importing Web archive (WAR) files">
-</topicref>
-<topicref href="topics/twcrewar.dita" navtitle="Exporting Web Archive (WAR) files">
-</topicref>
-<topicref href="topics/twplib.dita" navtitle="Adding Web library projects">
-</topicref>
-<topicref href="topics/twprjset.dita" navtitle="Setting Web project properties">
-</topicref>
-</topicref>
-<topicref href="topics/cwwedtvw.dita" navtitle="Workbench integration with Web editors">
-</topicref>
-<topicref href="topics/tjdetags.dita" navtitle="Creating and editing Web pages - overview">
-<topicref href="topics/tjcrehtm.dita" navtitle="Creating HTML and XHTML files and framesets">
-</topicref>
-<topicref href="topics/tjprefs.dita" navtitle="Defining HTML file preferences">
-</topicref>
-<topicref href="topics/tstylesheet.dita" navtitle="Creating cascading style sheets">
-</topicref>
-<topicref href="topics/tjcrejsp.dita" navtitle="Creating JavaServer Pages (JSP) files">
-<topicref href="topics/cpdjsps.dita" navtitle="JavaServer Pages (JSP) technology">
-</topicref>
-</topicref>
-<topicref href="topics/cwebartifact.dita" navtitle="Creating Web Artifacts">
-<topicref href="topics/twsrvwiz.dita" navtitle="Creating servlets">
-<topicref href="topics/cwservbn.dita" navtitle="Servlets"></topicref>
-</topicref>
-<topicref href="topics/twlstwiz.dita" navtitle="Creating Listeners">
-<topicref href="topics/cwlistbn.dita" navtitle="Listeners"></topicref>
-</topicref>
-<topicref href="topics/twfltwiz.dita" navtitle="Creating Filters">
-<topicref href="topics/cwfiltbn.dita" navtitle="Filters"></topicref>
-</topicref>
-</topicref>
-</topicref>
-<topicref href="topics/twcvsr.dita" navtitle="Setting CVS repository defaults">
-</topicref>
-<topicref href="topics/tservertarget.dita" navtitle="Server targeting for Web applications">
-</topicref>
-</map>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml
deleted file mode 100644
index 83e1f6af6f..0000000000
--- a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Web application development" topic="topics/ccwtover.html">
-<topic label="Web application overview" href="topics/ccwtover.html">
-<topic label="Web tools features" href="topics/cwtfeatures.html">
-<topic label="Project Explorer view and Web development" href="topics/ccwebvw.html"/>
-<topic label="Web resources" href="topics/cwebresources.html"/>
-<topic label="Web page design" href="topics/cwebpagedesign.html"/>
-</topic>
-</topic>
-<topic label="Web projects" href="topics/cwebprojects.html">
-<topic label="Web archive (WAR) files" href="topics/cwwarovr.html"/>
-<topic label="Creating a dynamic Web project" href="topics/twcreprj.html">
-<topic label="Dynamic Web projects and applications" href="topics/ccwebprj.html"/>
-</topic>
-<topic label="Creating a static Web project" href="topics/twcresta.html">
-<topic label="Converting static Web projects to dynamic Web projects" href="topics/twpcnvrt.html"/>
-<topic label="Static Web projects" href="topics/ccstatic.html"/>
-</topic>
-<topic label="Importing Web archive (WAR) files" href="topics/twimpwar.html"/>
-<topic label="Exporting Web Archive (WAR) files" href="topics/twcrewar.html"/>
-<topic label="Adding Web library projects" href="topics/twplib.html"/>
-<topic label="Setting Web project properties" href="topics/twprjset.html"/>
-</topic>
-<topic label="Workbench integration with Web editors" href="topics/cwwedtvw.html"/>
-<topic label="Creating and editing Web pages - overview" href="topics/tjdetags.html">
-<topic label="Creating HTML and XHTML files and framesets" href="topics/tjcrehtm.html"/>
-<topic label="Defining HTML file preferences" href="topics/tjprefs.html"/>
-<topic label="Creating cascading style sheets" href="topics/tstylesheet.html"/>
-<topic label="Creating JavaServer Pages (JSP) files" href="topics/tjcrejsp.html">
-<topic label="JavaServer Pages (JSP) technology" href="topics/cpdjsps.html"/>
-</topic>
-<topic label="Creating Web Artifacts" href="topics/cwebartifact.html">
-<topic label="Creating servlets" href="topics/twsrvwiz.html">
-<topic label="Servlets" href="topics/cwservbn.html"/>
-</topic>
-<topic label="Creating Listeners" href="topics/twlstwiz.html">
-<topic label="Listeners" href="topics/cwlistbn.html"/>
-</topic>
-<topic label="Creating Filters" href="topics/twfltwiz.html">
-<topic label="Listeners" href="topics/cwfiltbn.html"/>
-</topic>
-</topic>
-</topic>
-<topic label="Setting CVS repository defaults" href="topics/twcvsr.html"/>
-<topic label="Server targeting for Web applications" href="topics/tservertarget.html"/>
-</toc>
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/.cvsignore b/docs/org.eclipse.wst.xml.ui.infopop/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/.project b/docs/org.eclipse.wst.xml.ui.infopop/.project
deleted file mode 100644
index 110ff69a25..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml.ui.infopop</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.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/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.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/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml
deleted file mode 100644
index c62b4a2ca2..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!--plugin: org.eclipse.wst.xml.ui -->
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="webx0060"><!-- XML Files preference page -->
- <description>
- <p>This page lets you specify the file suffix and text encoding that will be used when you create or save an XML related file.</p>
-
- <p>The encoding attribute is used to specify the default character encoding set that is used when creating XML related files (DTDs, XML files, XML schemas). Changing the encoding causes any new, XML related files that are created from scratch to use the selected encoding.</p>
-
- <p>You can also set the type of message that will appear in the problems view when a resource is validated with no specified grammar.</p>
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html" label="Specifying XML default encoding and line delimiters" />
- </context>
- <context id="webx0061"><!-- Editor preferences page -->
- <description>
- <p>This page lets you specify the formatting and content assist preferences that will be used when editing an XML file.</p>
-
- <p>Enter a maximum width in the <b>Line width</b> field to specify when a line should be broken to fit onto more than one line. This will be applied when the document is formatted.
- </p>
-
-
- <p>Select <b>Split multiple attributes each on a new line</b> to start every attribute on a new line when the document is formatted.
- </p>
-
- <p>
- Select <b>Clear all blank lines</b> to remove blank lines when the document is formatted.
- </p>
-
- <p>
- Select <b>Indent using tabs</b> if you want to use tab characters (\t) as the standard formatting indentation. If you prefer to use spaces, select <b>Indent using spaces</b>.
- </p>
-
- <p>
- You can also specify the <b>Indentation size</b> which is the number of tabs or space characters used for formatting indentation.
- </p>
-
- <p>
- To apply these formatting styles, right-click in your XML document, and click <b>Format &gt; Document</b>.
- </p>
-
- <p>
- If the <b>Automatically make suggestions</b> check box is selected, you can specify that certain characters will cause the content assist list to pop up automatically. Specify these characters in the <b>Prompt when these characters are inserted</b> field.
- </p>
-
- <p>
- If you select <b>Strict</b> from the <b>Suggestion strategy</b> list, suggestions that are grammatically valid will be shown first (with bold icons) in the content assist list. Other suggestions that are applicable to the element scope, but not grammatically valid, will be shown below them with a de-emphasized icon. The default value for this field is <b>Lax</b>.
- </p>
-
- <p>
- If a DTD or schema (or other model) is not specified for an XML file, selecting <b>Use inferred grammar in absence of DTD/Schema</b> allows the editor to "guess" what elements or attributes are available based on existing content.
- </p>
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html" label="Defining XML editor preferences" />
- </context>
- <context id="webx0062"><!-- Syntax Coloring preference page -->
- <description>
- <p>This page lets you customize the syntax highlighting that the XML editor does when you are editing a file.</p>
-
- <p>
- The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
- </p>
-
- <p>
- The <b>Foreground</b> and <b>Background</b> buttons open <b>Color</b> dialog boxes that allow you to specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
- </p>
-
- <p>
- Click the <b>Restore Defaults</b> button to set the highlighting styles back to their default values. If you only want to reset the value for a particular content type, select it in the <b>Content type</b> field, the click the <b>Restore Default</b> button next to it.
- </p>
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html" label="Setting source highlighting styles" />
- </context>
- <context id="webx0063"><!-- Templates preference page -->
- <description>
- <p>This page lets you create new templates and edit existing ones that can be used when editing an XML file. A template is a chunk of predefined code that you can insert into a file.</p>
-
- <p>Click <b>New</b> if you want to create a completely new template.
- </p>
-
- <p>Supply a new template <b>Name</b> and <b>Description</b>. The <b>Context</b> for the template is the context in which the template is available in the proposal list when content assist is requested. Specify the <b>Pattern</b> for your template using the appropriate tags, attributes, or attribute values to be inserted by content assist.
- </p>
-
- <p>
- If you want to insert a variable, click the <b>Insert Variable</b> button and select the variable to be inserted. For example, the <b>date</b> variable indicates the current date will be inserted.
- </p>
-
- <p>You can edit, remove, import, or export a template by using the same Preferences page. If you have modified a default template, you can restore it to its default value. You can also restore a removed template if you have not exited from the workbench since it was removed.</p>
-
- <p>
- If you have a template that you do not want to remove but you no longer want it to appear in the content assist list, clear its check box in the <b>Templates</b> preferences page.
- </p>
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html" label="Working with XML templates" />
- </context>
- <context id="xmlm1200"><!-- doesn't exist in xml preferences -->
- <description>
- Cleanup options enable you to update a document so that it is well-formed and consistently formatted.
-
- The following cleanup options can be set to on or off, so that you can limit the type of cleanup performed:
-
- - <b>Compress empty element tags</b>: Compress element tags with no content to one tag with an end tag delimiter (ie: change &lt;tag&gt;&lt;/tag&gt; to &lt;tag/&gt;).
-
- - <b>Insert required attributes</b>: Inserts any missing attributes that are required by the tag to make the element or document well-formed.
-
- - <b>Insert missing tags</b>: Completes any missing tags (such as adding an end tag) necessary to make the element or document well-formed.
-
- - <b>Quote attribute values</b>: Appropriately adds double- or single-quotes before and after attribute values if they are missing.
-
- - <b>Format source</b>: Formats the document just as the <b>Format Document</b> context menu option does, immediately after performing any other specified <b>Cleanup</b> options.
-
- - <b>Convert line delimiters to</b>: Converts all line delimiters in the file to the selected operating system's type.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html" label="Editing in the Source view" />
- </context>
- <context id="xcui0500"><!-- add new attribute dialog -->
- <description>
- Enter the name of the attribute in the <b>Name</b> field, then enter the value of the attribute in the <b>Value</b> field. Click <b>OK</b>. The attribute will be added to the file.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- </context>
- <context id="xcui0010"><!-- -->
- <description>
- The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can use the <b>Public ID</b> field to create an association using an XML Catalog entry or the <b>System ID</b> field to create an association using a file in the workbench.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
- </context>
- <context id="xcui0020"><!-- edit doctype declaration dialog -->
- <description>This should match the name of your XML file's root element.</description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
- </context>
- <context id="xcui0030"><!-- edit doctype declaration dialog -->
- <description>The value in this field is the Public Identifier. It is used to associate the XML file (using an XML catalog entry) with a DTD file by providing a hint to the XML processor.</description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
- </context>
- <context id="xcui0050"><!-- edit doctype declaration dialog -->
- <description>The value in this field is the DTD the XML file is associated with. You can change the DTD the file is associated with by editing this field. The XML processor will try to use the Public ID to locate the DTD, and if this fails, it will use the System ID to find it.</description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
- </context>
- <context id="xcui0600"><!-- add element dialog -->
- <description>
- Enter the name of the element in the <b>Element name</b> field, then click <b>OK</b>. The element will be added to the file.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- </context>
- <context id="xcui0300"><!-- edit processing instruction dialog -->
- <description>
- A processing instruction is a syntax in XML for passing instructions along to the application using an XML document. The <b>Target</b> field is used to identify the application the instructions belongs to. The <b>Data</b> field contains the instructions.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html" label="Editing XML processing instructions" />
- </context>
- <context id="xcui0100"><!-- edit schema information (namespace declaration) dialog -->
- <description>
- This is a read-only dialog. Select the entry you want to edit and click <b>Edit</b>.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information" />
- </context>
- <context id="xcui0200"><!-- add namespace declaration dialog -->
- <description>
- The value in the <b>Namespace Name</b> field is the namespace the XML file belongs to.
-
- All qualified elements and attributes in the XML file associated with the namespace will be prefixed with the <b>Prefix</b> value.
-
- The <b>Location Hint</b> field contains the location of the XML schema the XML file is associated with. An XML Catalog ID or a URI can be specified in this field. You can search for the schema you want to use by clicking <b>Browse</b>. Once you select a file, the <b>Namespace Name</b> and <b>Prefix</b> fields will automatically be filled with the appropriate values from the schema (you must leave the fields blank for this to occur).
-
- <b>Note</b> : If you are creating an XML file from an XML schema, you cannot change the <b>Namespace Name</b> or <b>Location Hint</b> values.
- </description>
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
- <topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information" />
- </context>
- <context id="xcui0400"><!-- -->
- <description>An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a URI (which contains information about a DTD or XML schema's location). Select the catalog entry you want to associate your XML file with.</description>
- </context>
-</contexts>
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml
deleted file mode 100644
index e8504ef878..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="xml_source_HelpId">
- <description>The XML source view lets you edit a file that is coded in the Extensible Markup Language. The editor provides many text editing features, such as content assist, user-defined templates, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html"
- label="Editing in the Source view" />
- </context>
-</contexts> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index d2a19eb446..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xml.ui.infopop; singleton:=true
-Bundle-Version: 1.0.400.qualifier
-Bundle-Vendor: %pluginProvider
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml b/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml
deleted file mode 100644
index a662efb1fe..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="xmlm3000">
- <description>The Design view of the XML editor represents your file simultaneously as a table and a tree, which helps make navigation and editing easier. Depending on the kind of file you are working with, content and attribute values can be edited directly in table cells, while pop-up menus on tree elements give alternatives that are valid for that location.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html"
- label="Editing in the Design view" />
- </context>
-</contexts> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml
deleted file mode 100644
index 31462b7a10..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-
-<!-- plugin: org.eclipse.wst.wsdl.ui -->
-
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id=""><!-- change later, this has no id atm -->
- <description>
- Select the project or folder that will contain the WSDL file. In the <b>File name</b> field, type the name of the WSDL file, for example <i>NewWSDLFile.wsdl</i>. The name of your WSDL file must end in <i>.wsdl</i>.
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0000">
- <description>
- <b>Target namespace</b> is used for the names of messages and the port type, binding and service defined in the WSDL file. The value must take the form of a valid URI (for example, http://www.mycompany.com/myservice/).
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0001">
- <description>
- <b>Prefix</b> is the prefix associated with the target namespace.
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0002">
- <description>
- <b>Create WSDL Skeleton</b> will generate the WSDL elements required for your service, including bindings, ports and messages. You can then modify these to meet the requirements of your Web service.
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0003">
- <description>If you have chosen to create a WSDL skeleton, select the binding options you want to use in the Protocol drop down. The options are SOAP and HTTP. Use the SOAP protocol when you want to exchange structured and typed information. Use the HTTP protocol when you want your application client to just request or update information.</description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0010">
- <description>
- If you select SOAP you can then select the encoding style you want to use:
- <ul>
- <li>
- <b>document literal</b>: Document style messages, literal encoding. Use this style of binding when you want to send SOAP messages that can be validated by an XML validator. All the data types in the SOAP message body are defined in a schema, so the WSDL parts must point to schema elements.
- </li>
- </ul>
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0011">
- <description>
- <ul>
- <li>
- <b>rpc literal</b>: RPC style messages, literal encoding. Use this style of binding when you want to specify the operation method names in your SOAP messages so a server can dispatch the specified methods. Data types must be defined, so the WSDL parts must point to XSD types.
- </li>
- </ul>
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0012">
- <description>
- <ul>
- <li>
- <b>rpc encoded</b>: RPC style messages and SOAP encoding. Use this style of binding when you want to encode data graphs in your SOAP messages so a server can deserialize the object data. Data types must be defined, so the WSDL parts must point to XSD types.
- </li>
- </ul>
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0013">
- <description>
- If you select HTTP you can select whether to create an HTTP getter or setter:
- <ul>
- <li>
- <b>HTTP GET</b>: A GET request fetches data from a Web server based on an URL value and a set of HTTP headers. Use this method when you want to retrieve information specified in the request.
- </li>
- </ul>
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
- <context id="wsdlu0014">
- <description>
- <ul>
- <li>
- <b>HTTP POST</b>: A POST request sends additional data to the server, specified after the URL and the headers. Use this method when you want to send data enclosed in the body of the request.
- </li>
- </ul>
- </description>
- <topic
- href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
- label="" />
- </context>
-</contexts>
-
-
-
-
-
-
-
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml
deleted file mode 100644
index f5bb91486b..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="xmlc0101">
- <description>
- Select the <b>Create XML file from a DTD file</b> radio button to create an XML file from a DTD file. The file will contain the selected root element, populated with any required elements and attributes.
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- </context>
- <context id="xmlc0102">
- <description>
- Select the <b>Create XML file from an XML schema file</b> radio button to create an XML file from an XML schema. The file will contain the selected root element of the XML schema and any elements or attributes it contains.
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0103">
- <description>
- Select the <b>Create XML file from scratch</b> radio button if you want to create an XML file not associated with any XML schema or DTD file.
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html"
- label="Creating empty XML files" />
- </context>
- <context id="xmlc0500">
- <description>
- Select the <b>Select file from workbench</b> radio button if you want to create your XML file from a DTD or XML schema that is in the workbench.
-
- Select the <b>Select XML Catalog entry</b> radio button if you want to use a file listed in the XML Catalog to create your XML file.
- </description>
- </context>
- <context id="xmlc0410">
- <description>
- The root element of an XML file is the element that contains all other elements in that file. All elements defined in the DTD or all global elements defined in the XML schema are included in this list.
-
- <b>Note</b>: If you do not have any elements in your DTD or any global elements in your XML schema, you cannot create an XML file from it.
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0441">
- <description>If you select this check box, both mandatory and optional attributes will be generated. If you do not select it, only mandatory attributes will be generated.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0442">
- <description>If you select this check box, both the mandatory and optional elements will be generated. If you do not select it, only mandatory elements will be generated.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0443">
- <description>
- If you select this check box, the first choice of a required choice will be generated in your XML file.
-
- For example, if you have the following code in your source file:
-
- <b>&lt;choice&gt; &lt;element name="a" type="string&gt; &lt;element name="b" type="integer&gt; &lt;/choice&gt;</b>
-
- and you select this check box, an element such as the following will be created in your XML file:
-
- <b>&lt;a&gt;hello&lt;/a&gt;</b>
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0444">
- <description>
- If you select this check box, any elements and attributes generated will be filled with sample data, such as <b>&lt;text&gt;EmptyText&lt;/text&gt;.</b> Otherwise, they will be empty - that is, <b>&lt;text&gt;&lt;/text&gt;.</b>
- </description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
- label="Generating XML files from XML schemas" />
- </context>
- <context id="xmlc0210">
- <description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- </context>
- <context id="xmlc0220">
- <description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
- <topic
- href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
- label="Generating XML files from DTDs" />
- </context>
-</contexts> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml
deleted file mode 100644
index a2ea89e069..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-
-<!-- plugins: org.eclipse.ui.ide and org.eclipse.wst.xsd.ui.internal -->
-
-<contexts>
- <context id="csh_outer_container">
- <description />
- </context>
- <context id="new_file_wizard_page_context"><!-- fix this, there is no context id atm -->
- <description>
- Select the project or folder that will contain the XML schema. In the <b>File name</b> field, type the name of the XML schema, for example <i>MyXMLSchema.xsd</i>. The name of your XML schema must end in <i>.xsd</i>.
- </description>
- <topic
- href="../org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html"
- label="Creating XML schemas" />
- </context>
- <context id="xsdp0010">
- <description>
- Select the <b>Qualify XML schema language constructs</b> check box if you want a prefix applied to all XML Schema language constructs in your XML schema.
-
- In the <b>XML schema language constructs prefix</b> field, type the prefix you want applied to XML Schema language constructs in your XML schema. The prefix <i>xsd</i> is used by convention to denote the XML Schema namespace, but any prefix can be used. The purpose of the association is to identify the elements and simple types as belonging to the vocabulary of the XML Schema language rather than the vocabulary of the schema author.
-
- <b>Note:</b> This prefix will not appear in any schemas that currently exist - it will only appear in new schemas you create after you type the prefix and click <b>Apply</b>. Any schemas that already exist will have the prefix specified in the schema applied to the XML schema language constructs.
-
- You can change the <b>Default Target Namespace</b> value. The value specified in this field will be the default target namespace for any new XML schema files created.
-
- </description>
- <topic
- href="../org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html"
- label="Editing XML schema file prefereces" />
- </context>
-</contexts>
-
-
-
-
-
-
-
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/about.html b/docs/org.eclipse.wst.xml.ui.infopop/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/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/docs/org.eclipse.wst.xml.ui.infopop/build.properties b/docs/org.eclipse.wst.xml.ui.infopop/build.properties
deleted file mode 100644
index 780ce89a74..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-bin.includes = META-INF/,\
- EditorXmlContexts.xml,\
- EditorXmlContexts2.xml,\
- about.html,\
- plugin.properties,\
- plugin.xml,\
- XMLWizardContexts.xml,\
- TableTree.xml,\
- WSDLContexts.xml,\
- XSDContexts.xml
-
-generateSourceBundle=false \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties b/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties
deleted file mode 100644
index 8f91c4915d..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = XML infopops
-pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml b/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml
deleted file mode 100644
index ccf4c5a780..0000000000
--- a/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.1"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
- <contexts file="EditorXmlContexts.xml" plugin ="org.eclipse.wst.xml.ui"/>
- <contexts file="EditorXmlContexts2.xml" plugin ="org.eclipse.core.runtime"/>
- <contexts file="TableTree.xml" plugin ="org.eclipse.wst.xml.ui"/>
- <contexts file="XMLWizardContexts.xml" plugin ="org.eclipse.wst.xml.ui"/>
- <contexts file="WSDLContexts.xml" plugin ="org.eclipse.wst.wsdl.ui"/>
- <contexts file="XSDContexts.xml" plugin ="org.eclipse.wst.xsd.ui"/>
-
-</extension>
-
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/.cvsignore b/docs/org.eclipse.wst.xmleditor.doc.user/.cvsignore
deleted file mode 100644
index b53298e136..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build.xml
-org.eclipse.wst.xmleditor.doc.user_1.0.0.jar
-bak
-temp
-DitaLink.cat \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/.project b/docs/org.eclipse.wst.xmleditor.doc.user/.project
deleted file mode 100644
index 2e33af6b20..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xmleditor.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.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/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.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/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml
deleted file mode 100644
index 41f83557b0..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
- This script build the Help plug-in by transforming the DITA source files into HTML.
-
- To use this script, you must install DITA-OT on your machine in the directory
- defined by the dita.ot.dir property.
-
- Run the default target after you edit the DITA source files to regenerate the HTML.
-
- To customize this script for other Help plug-ins, modify the value of the args.input property
- to be the DITA map file for the plug-in.
-
- NOTE: This script assumes that links to sibling Help plug-ins have scope="peer", otherwise the
- output directory structure will be shifted incorrectly.
-
- NOTE: This script assumes that you hand code your plugin.xml file in myplugin.xml. This file
- will be copied over the generated plugin.xml which is currently not being generated correctly
- by DITA-OT.
-
- ChangeLog:
- 2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
- - Created.
- 2008-01-09 Kate Price <katep@ca.ibm.com>
- - modified for new DITA-OT version
- 2008-05-05 Kate Price <katep@ca.ibm.com>
- - modified to add generation of pre-built help index.
- - Must delete /index folder before running build
--->
-<project name="eclipsehelp" default="all">
-
- <property name="dita.ot.dir" location="C:/DITA-OT1.2.2" />
-
- <path id="dost.class.path">
- <pathelement location="${dita.ot.dir}${file.separator}lib${file.separator}dost.jar" />
- </path>
-
- <taskdef name="integrate" classname="org.dita.dost.platform.IntegratorTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <target name="all" depends="integrate, eclipsehelp">
- </target>
- <target name="integrate">
- <integrate ditadir="${dita.ot.dir}" />
- </target>
-
- <!-- revise below here -->
- <target name="eclipsehelp">
- <ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
- <property name="args.copycss" value="no" />
- <property name="args.csspath" value="../org.eclipse.wst.doc.user" />
- <property name="args.eclipse.provider" value="Eclipse.org" />
- <property name="args.eclipse.version" value="3.6.0" />
- <property name="args.input" location="XMLBuilderrel.ditamap" />
- <property name="clean.temp" value="true" />
- <property name="dita.extname" value=".dita" />
- <property name="dita.temp.dir" location="temp" />
- <property name="output.dir" location="" />
- <property name="transtype" value="eclipsehelp" />
- </ant>
- <copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
- </target>
- <target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-</project>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 32bd50ed41..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xmleditor.doc.user; singleton:=true
-Bundle-Version: 1.0.700.qualifier
-Bundle-Vendor: %pluginProvider
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap
deleted file mode 100644
index fcf32d5d99..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map collection-type="sequence" id="xmleditordocumentation" title="Developing XML files">
-<topicref href="topics/cworkXML.dita" linking="sourceonly" navtitle="Working with XML files">
-<anchor id="xml_post_cworkXML"/>
-<topicref href="topics/ccreatxm.dita" navtitle="Creating XML files">
-<anchor id="xml_post_ccreatxm"/>
-<topicref href="topics/tcretxml.dita" id="xmlcretxml" navtitle="Creating empty XML files">
-</topicref>
-<anchor id="xml_post_tcretxml"/>
-<topicref href="topics/tcrexdtd.dita" navtitle="Generating XML files from DTDs">
-</topicref>
-<anchor id="xml_post_tcrexdtd"/>
-<topicref href="topics/tcrexxsd.dita" navtitle="Generating XML files from XML schemas">
-</topicref>
-<anchor id="xml_post_tcrexxsd"/></topicref>
-<topicref href="topics/rlimitations_slushXML.dita" navtitle="Limitations of XML Editor"
-toc="no"></topicref>
-<anchor id="xml_post_rlimitations_slushXML"/>
-<topicref href="topics/txedttag.dita" navtitle="Editing XML files">
-<anchor id="xml_post_txedttag"/>
-<topicref href="topics/cwxmledt.dita" navtitle="XML editor">
-<anchor id="xml_post_cwxmledt"/>
-<topicref href="topics/txprefs.dita" navtitle="Defining XML editor preferences">
-<anchor id="xml_post_txprefs"/>
-<topicref href="topics/ttaghilt.dita" id="taghilt" navtitle="Setting source highlighting styles">
-</topicref>
-<anchor id="xml_post_ttaghilt"/>
-<topicref href="topics/tedtenc.dita" navtitle="Specifying XML default encoding line delimiters">
-<anchor id="xml_post_tedtenc"/>
-<topicref href="topics/cxmlenc.dita" navtitle="XML and HTML encodings"></topicref>
-<anchor id="xml_post_cxmlenc"/></topicref>
-<topicref href="topics/tsugstrat.dita" navtitle="Setting the XML source suggestion strategy used by content assist">
-</topicref>
-<anchor id="xml_post_tsugstrat"/></topicref>
-</topicref>
-<topicref href="topics/txedtdes.dita" id="txedtdes" linking="none" navtitle="Editing in the Design view">
-<anchor id="xml_post_txedtdes"/>
-<topicref href="topics/tedtdoc.dita" id="tedtdoc" navtitle="Editing DOCTYPE declarations">
-</topicref>
-<anchor id="xml_post_tedtdoc"/>
-<topicref href="topics/tedtsch.dita" id="tedtsch" navtitle="Editing namespace information">
-</topicref>
-<anchor id="xml_post_tedtsch"/>
-<topicref href="topics/tedtproc.dita" id="tedtproc" navtitle="Editing XML processing instructions">
-</topicref>
-<anchor id="xml_post_tedtproc"/></topicref>
-<topicref href="topics/txedtsrc.dita" id="txedsrc" linking="none" navtitle="Editing in the Source view">
-<anchor id="xml_post_txedtsrc"/>
-<topicref href="topics/twcdast.dita" navtitle="Using XML content assist">
-</topicref>
-<anchor id="xml_post_twcdast"/>
-<topicref href="topics/twmacro.dita" id="twmacro" navtitle="Working with XML templates">
-</topicref>
-<anchor id="xml_post_twmacro"/></topicref>
-<topicref href="topics/tedtcnst.dita" id="tedtcnt" navtitle="Editing with DTD or XML schema constraints">
-</topicref>
-<anchor id="xml_post_tedtcnst"/>
-<topicref href="topics/txsityp.dita" navtitle="Using xsi:type"></topicref>
-<anchor id="xml_post_txsityp"/>
-<topicref href="topics/rextctn.dita" id="rextctn" navtitle="Editing XML documents with multiple namespaces">
-</topicref>
-<anchor id="xml_post_rextctn"/></topicref>
-<topicref href="topics/twxvalid.dita" id="xmlvalid" navtitle="Validating XML files">
-</topicref>
-<anchor id="xml_post_twxvalid"/>
-<topicref href="topics/cxmlcat.dita" linking="none" navtitle="XML file associations with DTDs and XML schemas">
-<anchor id="xml_post_cxmlcat"/>
-<topicref href="topics/txmlcat.dita" id="txmlcat" navtitle="Adding entries to the XML Catalog">
-</topicref>
-<anchor id="xml_post_txmlcat"/>
-<topicref href="topics/tedtgram.dita" id="tedtgram" navtitle="Updating XML files with changes made to DTDs and schemas">
-</topicref>
-<topicref href="topics/rxmlcatkey.dita" id="rxmlcatkey" navtitle="XML Catalog keyboard shortcuts">
-</topicref>
-<anchor id="xml_post_rxmlcatkey"/>
-<topicref href="topics/rxmltoolskey.dita" navtitle="XML editor keyboard shortcuts">
-</topicref>
-<anchor id="xml_post_tedtgram"/></topicref>
-<topicref href="topics/rxmlbicons.dita" id="ricons" navtitle="Icons used in the XML editor">
-</topicref>
-<anchor id="xml_post_rxmlbicons"/></topicref>
-</map>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml
deleted file mode 100644
index 929c80902d..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Developing XML files" topic="topics/cworkXML.html">
-<topic label="Working with XML files" href="topics/cworkXML.html">
-<anchor id="xml_post_cworkXML"/>
-<topic label="Creating XML files" href="topics/ccreatxm.html">
-<anchor id="xml_post_ccreatxm"/>
-<topic label="Creating XML files" href="topics/tcretxml.html"/>
-<anchor id="xml_post_tcretxml"/>
-<topic label="Generating XML files from DTDs" href="topics/tcrexdtd.html"/>
-<anchor id="xml_post_tcrexdtd"/>
-<topic label="Generating XML files from XML schemas" href="topics/tcrexxsd.html"/>
-<anchor id="xml_post_tcrexxsd"/>
-</topic>
-<anchor id="xml_post_rlimitations_slushXML"/>
-<topic label="Editing XML files" href="topics/txedttag.html">
-<anchor id="xml_post_txedttag"/>
-<topic label="XML editor" href="topics/cwxmledt.html">
-<anchor id="xml_post_cwxmledt"/>
-<topic label="Defining XML editor preferences" href="topics/txprefs.html">
-<anchor id="xml_post_txprefs"/>
-<topic label="Setting source highlighting styles" href="topics/ttaghilt.html"/>
-<anchor id="xml_post_ttaghilt"/>
-<topic label="Specifying XML default encoding line delimiters" href="topics/tedtenc.html">
-<anchor id="xml_post_tedtenc"/>
-<topic label="XML and HTML encodings" href="topics/cxmlenc.html"/>
-<anchor id="xml_post_cxmlenc"/>
-</topic>
-<topic label="Setting the XML source suggestion strategy used by content assist" href="topics/tsugstrat.html"/>
-<anchor id="xml_post_tsugstrat"/>
-</topic>
-</topic>
-<topic label="Editing in the Design view" href="topics/txedtdes.html">
-<anchor id="xml_post_txedtdes"/>
-<topic label="Editing DOCTYPE declarations" href="topics/tedtdoc.html"/>
-<anchor id="xml_post_tedtdoc"/>
-<topic label="Editing namespace information" href="topics/tedtsch.html"/>
-<anchor id="xml_post_tedtsch"/>
-<topic label="Editing XML processing instructions" href="topics/tedtproc.html"/>
-<anchor id="xml_post_tedtproc"/>
-</topic>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html">
-<anchor id="xml_post_txedtsrc"/>
-<topic label="Using XML content assist" href="topics/twcdast.html"/>
-<anchor id="xml_post_twcdast"/>
-<topic label="Working with XML templates" href="topics/twmacro.html"/>
-<anchor id="xml_post_twmacro"/>
-</topic>
-<topic label="Editing with DTD or XML schema constraints" href="topics/tedtcnst.html"/>
-<anchor id="xml_post_tedtcnst"/>
-<topic label="Using xsi:type" href="topics/txsityp.html"/>
-<anchor id="xml_post_txsityp"/>
-<topic label="Editing XML documents with multiple namespaces" href="topics/rextctn.html"/>
-<anchor id="xml_post_rextctn"/>
-</topic>
-<topic label="Validating XML files" href="topics/twxvalid.html"/>
-<anchor id="xml_post_twxvalid"/>
-<topic label="XML file associations with DTDs and XML schemas" href="topics/cxmlcat.html">
-<anchor id="xml_post_cxmlcat"/>
-<topic label="Adding entries to the XML Catalog" href="topics/txmlcat.html"/>
-<anchor id="xml_post_txmlcat"/>
-<topic label="Updating XML files with changes made to DTDs and schemas" href="topics/tedtgram.html"/>
-<topic label="XML Catalog keyboard shortcuts" href="topics/rxmlcatkey.html"/>
-<anchor id="xml_post_rxmlcatkey"/>
-<topic label="Source editor and XML tools keyboard shortcuts" href="topics/rxmltoolskey.html"/>
-<anchor id="xml_post_tedtgram"/>
-</topic>
-<topic label="Icons used in the XML editor" href="topics/rxmlbicons.html"/>
-<anchor id="xml_post_rxmlbicons"/>
-</topic>
-</toc>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.ditamap b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.ditamap
deleted file mode 100644
index fdaba049d0..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.ditamap
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map id="xmleditorreltable">
-<topicgroup collection-type="family">
-<topicref href="topics/tcretxml.dita" id="xmlcretxml" navtitle="Creating empty XML files">
-</topicref>
-<topicref href="topics/tcrexdtd.dita" navtitle="Generating XML files from DTDs">
-</topicref>
-<topicref href="topics/tcrexxsd.dita" navtitle="Generating XML files from XML schemas">
-</topicref>
-<topicref href="topics/txedttag.dita" linking="targetonly" navtitle="Editing XML files">
-</topicref>
-<topicref href="topics/cwxmledt.dita" navtitle="XML editor"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedttag.dita" linking="sourceonly" navtitle="Editing XML files">
-</topicref>
-<topicref href="topics/cwxmledt.dita" linking="targetonly" navtitle="XML editor">
-</topicref>
-<topicref href="topics/txedtdes.dita" linking="targetonly" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/txedtsrc.dita" linking="targetonly" navtitle="Editing in the Source view">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/cxmlcat.dita" navtitle="XML file associations with DTDs and XML schemas">
-</topicref>
-<topicref href="topics/tedtcnst.dita" navtitle="Editing with DTD or XML schema constraints">
-</topicref>
-<topicref href="topics/tedtdoc.dita" navtitle="Editing DOCTYPE declarations">
-</topicref>
-<topicref href="topics/txmlcat.dita" id="txmlcat" navtitle="Adding entries to the XML Catalog">
-</topicref>
-<topicref href="topics/tedtgram.dita" id="tedtgram" navtitle="Updating XML files with changes made to DTDs and schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/cxmlcat.dita" navtitle="XML file associations with DTDs and XML schemas">
-</topicref>
-<topicref href="topics/tedtcnst.dita" navtitle="Editing with DTD or XML schema constraints">
-</topicref>
-<topicref href="topics/tedtsch.dita" navtitle="Editing namespace information">
-</topicref>
-<topicref href="topics/txmlcat.dita" navtitle="Adding entries to the XML Catalog">
-</topicref>
-<topicref href="topics/tedtgram.dita" navtitle="Updating XML files with changes made to DTDs and schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family" linking="normal">
-<topicref href="topics/tedtproc.dita" id="tedtproc" linking="targetonly" navtitle="Editing XML processing instructions">
-</topicref>
-<topicref href="topics/cxmlcat.dita" navtitle="XML file associations with DTDs and XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family" linking="normal">
-<topicref href="topics/cwxmledt.dita" navtitle="XML editor"></topicref>
-<topicref href="topics/txedtdes.dita" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/txedtsrc.dita" navtitle="Editing in the Source view">
-</topicref>
-<topicref href="topics/cxmlcat.dita" navtitle="XML file associations with DTDs and XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family" linking="normal">
-<topicref href="topics/twxvalid.dita" navtitle="Validating XML files"></topicref>
-<topicref href="topics/cwxmledt.dita" navtitle="XML editor"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tcrexxsd.dita" navtitle="Generating XML files from XML schemas">
-</topicref>
-<topicref href="../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita"
-linking="targetonly" navtitle="XML namespaces" scope="peer"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tedtsch.dita" navtitle="Editing namespace information">
-</topicref>
-<topicref href="../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita"
-linking="targetonly" navtitle="XML namespaces" scope="peer"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtsrc.dita" id="txedsrc" navtitle="Editing in the Source view">
-</topicref>
-<topicref href="topics/twcdast.dita" navtitle="Using XML content assist">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtsrc.dita" navtitle="Editing in the Source view">
-</topicref>
-<topicref href="topics/twmacro.dita" navtitle="Working with XML templates">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtsrc.dita" navtitle="Editing in the Source view">
-</topicref>
-<topicref href="topics/ttaghilt.dita" navtitle="Setting source highlighting styles">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/twcdast.dita" navtitle="Using XML content assist">
-</topicref>
-<topicref href="topics/twmacro.dita" navtitle="Working with XML templates">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/twcdast.dita" navtitle="Using XML content assist">
-</topicref>
-<topicref href="topics/tsugstrat.dita" navtitle="XML source suggestion strategy">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtdes.dita" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/tedtdoc.dita" navtitle="Editing DOCTYPE declarations">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtdes.dita" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/tedtsch.dita" navtitle="Editing namespace information">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtdes.dita" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/tedtproc.dita" navtitle="Editing XML processing instructions">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/txedtdes.dita" navtitle="Editing in the Design view">
-</topicref>
-<topicref href="topics/rxmlbicons.dita" navtitle="Icons used in the XML editor">
-</topicref>
-</topicgroup>
-</map>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.xml b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.xml
deleted file mode 100644
index 400ab50c42..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuilderrel.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc topic="topics/tcretxml.html">
-<topic label="Creating XML files" href="topics/tcretxml.html"/>
-<topic label="Generating XML files from DTDs" href="topics/tcrexdtd.html"/>
-<topic label="Generating XML files from XML schemas" href="topics/tcrexxsd.html"/>
-<topic label="Editing XML files" href="topics/txedttag.html"/>
-<topic label="XML editor" href="topics/cwxmledt.html"/>
-<topic label="Editing XML files" href="topics/txedttag.html"/>
-<topic label="XML editor" href="topics/cwxmledt.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html"/>
-<topic label="XML file associations with DTDs and XML schemas" href="topics/cxmlcat.html"/>
-<topic label="Editing with DTD or XML schema constraints" href="topics/tedtcnst.html"/>
-<topic label="Editing DOCTYPE declarations" href="topics/tedtdoc.html"/>
-<topic label="Adding entries to the XML Catalog" href="topics/txmlcat.html"/>
-<topic label="Updating XML files with changes made to DTDs and schemas" href="topics/tedtgram.html"/>
-<topic label="XML file associations with DTDs and XML schemas" href="topics/cxmlcat.html"/>
-<topic label="Editing with DTD or XML schema constraints" href="topics/tedtcnst.html"/>
-<topic label="Editing namespace information" href="topics/tedtsch.html"/>
-<topic label="Adding entries to the XML Catalog" href="topics/txmlcat.html"/>
-<topic label="Updating XML files with changes made to DTDs and schemas" href="topics/tedtgram.html"/>
-<topic label="Editing XML processing instructions" href="topics/tedtproc.html"/>
-<topic label="XML file associations with DTDs and XML schemas" href="topics/cxmlcat.html"/>
-<topic label="XML editor" href="topics/cwxmledt.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html"/>
-<topic label="XML file associations with DTDs and XML schemas" href="topics/cxmlcat.html"/>
-<topic label="Validating XML files" href="topics/twxvalid.html"/>
-<topic label="XML editor" href="topics/cwxmledt.html"/>
-<topic label="Generating XML files from XML schemas" href="topics/tcrexxsd.html"/>
-<topic label="XML namespaces" href="../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html"/>
-<topic label="Editing namespace information" href="topics/tedtsch.html"/>
-<topic label="XML namespaces" href="../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html"/>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html"/>
-<topic label="Using XML content assist" href="topics/twcdast.html"/>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html"/>
-<topic label="Working with XML templates" href="topics/twmacro.html"/>
-<topic label="Editing in the Source view" href="topics/txedtsrc.html"/>
-<topic label="Setting source highlighting styles" href="topics/ttaghilt.html"/>
-<topic label="Using XML content assist" href="topics/twcdast.html"/>
-<topic label="Working with XML templates" href="topics/twmacro.html"/>
-<topic label="Using XML content assist" href="topics/twcdast.html"/>
-<topic label="Setting the XML source suggestion strategy used by content assist" href="topics/tsugstrat.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Editing DOCTYPE declarations" href="topics/tedtdoc.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Editing namespace information" href="topics/tedtsch.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Editing XML processing instructions" href="topics/tedtproc.html"/>
-<topic label="Editing in the Design view" href="topics/txedtdes.html"/>
-<topic label="Icons used in the XML editor" href="topics/rxmlbicons.html"/>
-</toc>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/about.html b/docs/org.eclipse.wst.xmleditor.doc.user/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/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/docs/org.eclipse.wst.xmleditor.doc.user/build.properties b/docs/org.eclipse.wst.xmleditor.doc.user/build.properties
deleted file mode 100644
index 9f51d547dc..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = XMLBuildermap_toc.xml,\
- about.html,\
- images/,\
- org.eclipse.wst.xmleditor.doc.userindex.xml,\
- plugin.xml,\
- topics/*.htm*,\
- index/,\
- META-INF/,\
- plugin.properties
-src.includes = build.properties,\
- *.maplist,\
- *.ditamap,\
- topics/*.dita
-bin.excludes = DocBuild.xml,\
- myPlugin*.xml \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/cdatasection.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/cdatasection.gif
deleted file mode 100644
index 6b0872c909..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/cdatasection.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/collapse_all.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/collapse_all.gif
deleted file mode 100644
index 7dc0de5130..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/collapse_all.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/comment_obj.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/comment_obj.gif
deleted file mode 100644
index 28c2ccb1e7..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/comment_obj.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/doctype.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/doctype.gif
deleted file mode 100644
index 3300f82862..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/doctype.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/expand_all.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/expand_all.gif
deleted file mode 100644
index 492c14f6e1..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/expand_all.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/nattrib.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/nattrib.gif
deleted file mode 100644
index bea9974e0b..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/nattrib.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/nelem.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/nelem.gif
deleted file mode 100644
index afabddad89..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/nelem.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/nrstrval.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/nrstrval.gif
deleted file mode 100644
index 4742b8cd96..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/nrstrval.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/proinst_obj.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/proinst_obj.gif
deleted file mode 100644
index 74436d8d3c..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/proinst_obj.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/rldgrmr.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/rldgrmr.gif
deleted file mode 100644
index 049cac696c..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/rldgrmr.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/images/suggestion.gif b/docs/org.eclipse.wst.xmleditor.doc.user/images/suggestion.gif
deleted file mode 100644
index b4ea849dab..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/images/suggestion.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs b/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs
deleted file mode 100644
index a0288984dd..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable b/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable
deleted file mode 100644
index 593f4708db..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions
deleted file mode 100644
index 2552ccf9de..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions
+++ /dev/null
@@ -1,3 +0,0 @@
-#This is a generated file; do not edit.
-#Tue May 20 11:13:05 EDT 2008
-org.eclipse.wst.xmleditor.doc.user=org.eclipse.wst.xmleditor.doc.user\n1.0.400.qualifier
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies
deleted file mode 100644
index 2d09d4ee04..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-#This is a generated file; do not edit.
-#Tue May 20 11:13:05 EDT 2008
-lucene=1.9.1.v200803061811
-analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs
deleted file mode 100644
index 6420de2f13..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs
+++ /dev/null
@@ -1,31 +0,0 @@
-#This is a generated file; do not edit.
-#Tue May 20 11:13:05 EDT 2008
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html=0
-/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html=0
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/segments b/docs/org.eclipse.wst.xmleditor.doc.user/index/segments
deleted file mode 100644
index a4a692b173..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/segments
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml
deleted file mode 100644
index a5f200715e..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-
-<plugin>
-
-<extension point="org.eclipse.help.toc">
- <toc file="XMLBuildermap_toc.xml"/>
- <index path="index/"/>
-
-</extension>
-
-<extension
- point="org.eclipse.help.index">
- <index file="org.eclipse.wst.xmleditor.doc.userindex.xml"/>
- </extension>
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist
deleted file mode 100644
index 6c3e2480b1..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist
+++ /dev/null
@@ -1,8 +0,0 @@
-<maplist version="3.6.2">
- <nav>
- <map file="XMLBuildermap_toc.ditamap"/>
- </nav>
- <link>
- <map file="XMLBuilderrel.ditamap"/>
- </link>
-</maplist>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml
deleted file mode 100644
index 2218ba0886..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<index>
- <entry keyword="XML files">
- <entry keyword="creating">
- <topic href="topics/tcretxml.html#tcretxml" title="Creating XML files"/>
- </entry>
- <entry keyword="generating from DTDs">
- <topic href="topics/tcrexdtd.html#tcrexdtd" title="Generating XML files from DTDs"/>
- </entry>
- <entry keyword="generating from XML schemas">
- <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
- </entry>
- <entry keyword="schemas">
- <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
- </entry>
- <entry keyword="editing">
- <topic href="topics/txedttag.html#txedttag" title="Editing XML files"/>
- </entry>
- <entry keyword="specifying line delimiters">
- <topic href="topics/tedtenc.html#tedtenc" title="Specifying XML default encoding line delimiters"/>
- </entry>
- <entry keyword="namespace information">
- <topic href="topics/tedtsch.html#tedtsch" title="Editing namespace information"/>
- </entry>
- <entry keyword="processing instructions">
- <topic href="topics/tedtproc.html#tedtproc" title="Editing XML processing instructions"/>
- </entry>
- <entry keyword="content assist">
- <topic href="topics/twcdast.html#twcdast" title="Using XML content assist"/>
- </entry>
- <entry keyword="templates">
- <topic href="topics/twmacro.html#twmacro" title="Working with XML templates"/>
- </entry>
- <entry keyword="editing with constraints">
- <topic href="topics/tedtcnst.html#tedtcnst" title="Editing with DTD or XML schema constraints"/>
- </entry>
- <entry keyword="validating">
- <topic href="topics/twxvalid.html#twxvalid" title="Validating XML files"/>
- </entry>
- <entry keyword="associations">
- <topic href="topics/cxmlcat.html#cxmlcat" title="XML file associations with DTDs and XML schemas"/>
- </entry>
- <entry keyword="updating with associated changes">
- <topic href="topics/tedtgram.html#tedtgram" title="Updating XML files with changes made to DTDs and schemas"/>
- </entry>
- </entry>
- <entry keyword="DTDs">
- <entry keyword="generating XML files">
- <topic href="topics/tcrexdtd.html#tcrexdtd" title="Generating XML files from DTDs"/>
- </entry>
- </entry>
- <entry keyword="schemas">
- <entry keyword="generating XML files">
- <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
- </entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="XML files">
- <topic href="topics/txedttag.html#txedttag" title="Editing XML files"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cwxmledt.html#cwxmledt" title="XML editor"/>
- </entry>
- <entry keyword="preferences">
- <topic href="topics/txprefs.html#txprefs" title="Defining XML editor preferences"/>
- </entry>
- <entry keyword="setting source highlighting styles">
- <topic href="topics/ttaghilt.html#ttaghilt" title="Setting source highlighting styles"/>
- </entry>
- <entry keyword="source suggestion strategy">
- <topic href="topics/tsugstrat.html#xmlsourcesuggestionstrategy" title="Setting the XML source suggestion strategy used by content assist"/>
- </entry>
- <entry keyword="Design view">
- <topic href="topics/txedtdes.html#txedtdes" title="Editing in the Design view"/>
- </entry>
- <entry keyword="DOCTYPE declarations">
- <topic href="topics/tedtdoc.html#tedtdoc" title="Editing DOCTYPE declarations"/>
- </entry>
- <entry keyword="namespace information">
- <topic href="topics/tedtsch.html#tedtsch" title="Editing namespace information"/>
- </entry>
- <entry keyword="processing instructions">
- <topic href="topics/tedtproc.html#tedtproc" title="Editing XML processing instructions"/>
- </entry>
- <entry keyword="Source view">
- <topic href="topics/txedtsrc.html#txedtsrc" title="Editing in the Source view"/>
- </entry>
- <entry keyword="content assist">
- <topic href="topics/twcdast.html#twcdast" title="Using XML content assist"/>
- </entry>
- <entry keyword="editing with constraints">
- <topic href="topics/tedtcnst.html#tedtcnst" title="Editing with DTD or XML schema constraints"/>
- </entry>
- <entry keyword="updating XML files">
- <topic href="topics/tedtgram.html#tedtgram" title="Updating XML files with changes made to DTDs and schemas"/>
- </entry>
- <entry keyword="accessibility">
- <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
- </entry>
- <entry keyword="keyboard shortcuts">
- <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
- </entry>
- <entry keyword="icons">
- <topic href="topics/rxmlbicons.html#ricons" title="Icons used in the XML editor"/>
- </entry>
- </entry>
- <entry keyword="preferences">
- <entry keyword="XML editor">
- <topic href="topics/txprefs.html#txprefs" title="Defining XML editor preferences"/>
- </entry>
- </entry>
- <entry keyword="line delimiters">
- <entry keyword="XML files">
- <topic href="topics/tedtenc.html#tedtenc" title="Specifying XML default encoding line delimiters"/>
- </entry>
- </entry>
- <entry keyword="character encoding">
- <entry keyword="supported character sets">
- <topic href="topics/cxmlenc.html#cxmlenc" title="XML and HTML encodings"/>
- </entry>
- </entry>
- <entry keyword="DOCTYPE declarations">
- <entry keyword="XML editor">
- <topic href="topics/tedtdoc.html#tedtdoc" title="Editing DOCTYPE declarations"/>
- </entry>
- </entry>
- <entry keyword="templates">
- <entry keyword="working with predefined XML code">
- <topic href="topics/twmacro.html#twmacro" title="Working with XML templates"/>
- </entry>
- </entry>
- <entry keyword="XML catalog">
- <entry keyword="overview">
- <topic href="topics/cxmlcat.html#cxmlcat" title="XML file associations with DTDs and XML schemas"/>
- </entry>
- <entry keyword="adding entries">
- <topic href="topics/txmlcat.html#txmlcat" title="Adding entries to the XML Catalog"/>
- </entry>
- </entry>
- <entry keyword="accessibility">
- <entry keyword="keyboard shortcuts">
- <entry keyword="XML editor">
- <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
- </entry>
- </entry>
- </entry>
- <entry keyword="keyboard shortcuts">
- <entry keyword="XML editor">
- <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
- </entry>
- </entry>
- <entry keyword="shortcuts">
- <entry keyword="keyboard">
- <entry keyword="XML editor">
- <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
- </entry>
- </entry>
- </entry>
-</index> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties
deleted file mode 100644
index 0eed3793ce..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 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
-###############################################################################
-
-pluginName = XML editor
-pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml
deleted file mode 100644
index a5f200715e..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-
-<plugin>
-
-<extension point="org.eclipse.help.toc">
- <toc file="XMLBuildermap_toc.xml"/>
- <index path="index/"/>
-
-</extension>
-
-<extension
- point="org.eclipse.help.index">
- <index file="org.eclipse.wst.xmleditor.doc.userindex.xml"/>
- </extension>
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.dita
deleted file mode 100644
index 9019048638..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.dita
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<?Pub Inc?>
-<concept id="creatingxmlfiles" xml:lang="en-us">
-<title>Creating XML files</title>
-<shortdesc>This section contains information on creating XML files:</shortdesc>
-<conbody></conbody>
-<related-links>
-<linklist>
-<link href="tcretxml.dita"><linktext>Creating empty XML files</linktext></link>
-<link href="tcrexdtd.dita"><linktext>Generating XML files from a DTDs</linktext>
-</link>
-<link href="tcrexxsd.dita"><linktext>Generating XML files from XML
-schemas</linktext></link>
-</linklist>
-</related-links>
-</concept>
-<?Pub *0000000718?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html
deleted file mode 100644
index c311767e11..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Creating XML files" />
-<meta name="abstract" content="This section contains information on creating XML files:" />
-<meta name="description" content="This section contains information on creating XML files:" />
-<meta scheme="URI" name="DC.Relation" content="tcretxml.html" />
-<meta scheme="URI" name="DC.Relation" content="tcrexdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="tcrexxsd.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="creatingxmlfiles" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating XML files</title>
-</head>
-<body id="creatingxmlfiles"><a name="creatingxmlfiles"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating XML files</h1>
-
-
-<div><p>This section contains information on creating XML files:</p>
-</div>
-
-<div>
-<div class="linklist">
-<div><a href="tcretxml.html" title="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain.">Creating empty XML files</a></div>
-<div><a href="tcrexdtd.html" title="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD.">Generating XML files from a DTDs</a></div>
-<div><a href="tcrexxsd.html" title="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema.">Generating XML files from XML
-schemas</a></div></div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html
deleted file mode 100644
index 4e93c8aedd..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Working with XML files" />
-<meta name="abstract" content="This section contains information on the following:" />
-<meta name="description" content="This section contains information on the following:" />
-<meta scheme="URI" name="DC.Relation" content="ccreatxm.html" />
-<meta scheme="URI" name="DC.Relation" content="txedttag.html" />
-<meta scheme="URI" name="DC.Relation" content="twxvalid.html" />
-<meta scheme="URI" name="DC.Relation" content="cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="rxmlbicons.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="workingwithxmlfiles" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Working with XML files</title>
-</head>
-<body id="workingwithxmlfiles"><a name="workingwithxmlfiles"><!-- --></a>
-
-
-<h1 class="topictitle1">Working with XML files</h1>
-
-
-<div><p>This section contains information on the following:</p>
-</div>
-
-<div>
-<div class="linklist">
-<div><a href="ccreatxm.html" title="This section contains information on creating XML files:">Creating XML files</a></div>
-<div><a href="txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-<div><a href="twxvalid.html" title="When you validate your XML file, the XML validator will check to see that your file is valid and well-formed.">Validating XML files</a></div>
-<div><a href="cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML
-schema</a></div>
-<div><a href="rxmlbicons.html" title="The following XML editor icons appear in the Outline and Design view.">Icons used in the XML editor</a></div></div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkxml.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkxml.dita
deleted file mode 100644
index a6fa3e16f2..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkxml.dita
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<?Pub Inc?>
-<concept id="workingwithxmlfiles" xml:lang="en-us">
-<title>Working with XML files</title>
-<shortdesc>This section contains information on the following:</shortdesc>
-<conbody></conbody>
-<related-links>
-<linklist>
-<link href="ccreatxm.dita"><linktext>Creating XML files</linktext></link>
-<link href="txedttag.dita"><linktext>Editing XML files</linktext>
-</link>
-<link href="twxvalid.dita"><linktext>Validating XML files</linktext></link>
-<link href="cxmlcat.dita"><linktext>XML file associations with DTDs and XML
-schema</linktext></link>
-<link href="rxmlbicons.dita"><linktext>Icons used in the XML editor</linktext>
-</link>
-</linklist>
-</related-links>
-</concept>
-<?Pub *0000000871?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita
deleted file mode 100644
index 654b609d10..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cwxmledt" xml:lang="en-us">
-<title>XML editor</title>
-<titlealts>
-<searchtitle>XML editor</searchtitle>
-</titlealts>
-<shortdesc>The XML editor is a tool for creating and viewing XML files.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>You can use it to perform a variety of tasks such as:</p>
-<ul>
-<li>Creating new, empty XML files or generating them from existing DTDs or
-existing XML schemas</li>
-<li>Editing XML files</li>
-<li>Importing existing XML files for structured viewing</li>
-<li>Associating XML files with DTDs or XML schemas</li>
-</ul>
-<p>The XML editor has two main views - the Source view and the Design view.
-You can also use the Outline view to insert and delete elements.</p>
-<section><title>Source view</title><p>The Source view enables you to view
-and work directly with a file's source code. Many of the XML editing features
-in the XML editor Source view are very similar to those available in the Source
-view of Page Designer.</p><p>The Source view has many text editing features,
-such as: <ul>
-<li> Syntax highlighting, unlimited undo/redo, and user-defined templates.</li>
-<li> Content assist, which uses the information in a DTD or schema content
-model to provide a list of acceptable continuations depending on where the
-cursor is located in an XML file, or what has just been typed.</li>
-<li>"Smart" double-clicking behavior. If your cursor is placed in an attribute
-value, one double-click selects that value, another double click selects the
-attribute-value pair, and a third double-click selects the entire tag. This
-makes it easier to copy and paste commonly used pieces of XML.</li>
-</ul></p></section>
-<section><title>Design view</title><p>The XML editor also has a Design view.
-This view has the following features:<ul>
-<li>The XML file is represented simultaneously as a table and a tree. This
-helps make navigation and editing easier.</li>
-<li>Content and attribute values can be edited directly in the table cells,
-while pop-up menus on the tree nodes give alternatives that are valid for
-that location. For example, the <uicontrol>Add Child</uicontrol> menu item
-will list only those elements from a DTD or XML schema which would be valid
-children at that point (as long as grammar constraints are on).</li>
-</ul></p><p>The Design view is especially helpful if you are new to XML, or
-need to do form-oriented editing. For example, you could use the Create XML
-File wizard to create a template XML file for a job description form from
-a job description DTD. After those steps are completed, you would only have
-to fill in the form data using the Design view.</p></section>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html
deleted file mode 100644
index 59a1ed7b95..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="XML editor" />
-<meta name="abstract" content="The XML editor is a tool for creating and viewing XML files." />
-<meta name="description" content="The XML editor is a tool for creating and viewing XML files." />
-<meta content="XML editor, overview" name="DC.subject" />
-<meta content="XML editor, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretxml.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexxsd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twxvalid.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cwxmledt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML editor</title>
-</head>
-<body id="cwxmledt"><a name="cwxmledt"><!-- --></a>
-
-
-<h1 class="topictitle1">XML editor</h1>
-
-
-
-
-<div><p>The XML editor is a tool for creating and viewing XML files.</p>
-
-<p>You can use it to perform a variety of tasks such as:</p>
-
-<ul>
-<li>Creating new, empty XML files or generating them from existing DTDs or
-existing XML schemas</li>
-
-<li>Editing XML files</li>
-
-<li>Importing existing XML files for structured viewing</li>
-
-<li>Associating XML files with DTDs or XML schemas</li>
-
-</ul>
-
-<p>The XML editor has two main views - the Source view and the Design view.
-You can also use the Outline view to insert and delete elements.</p>
-
-<div class="section"><h4 class="sectiontitle">Source view</h4><p>The Source view enables you to view
-and work directly with a file's source code. Many of the XML editing features
-in the XML editor Source view are very similar to those available in the Source
-view of Page Designer.</p>
-<div class="p">The Source view has many text editing features,
-such as: <ul>
-<li> Syntax highlighting, unlimited undo/redo, and user-defined templates.</li>
-
-<li> Content assist, which uses the information in a DTD or schema content
-model to provide a list of acceptable continuations depending on where the
-cursor is located in an XML file, or what has just been typed.</li>
-
-<li>"Smart" double-clicking behavior. If your cursor is placed in an attribute
-value, one double-click selects that value, another double click selects the
-attribute-value pair, and a third double-click selects the entire tag. This
-makes it easier to copy and paste commonly used pieces of XML.</li>
-
-</ul>
-</div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Design view</h4><div class="p">The XML editor also has a Design view.
-This view has the following features:<ul>
-<li>The XML file is represented simultaneously as a table and a tree. This
-helps make navigation and editing easier.</li>
-
-<li>Content and attribute values can be edited directly in the table cells,
-while pop-up menus on the tree nodes give alternatives that are valid for
-that location. For example, the <span class="uicontrol">Add Child</span> menu item
-will list only those elements from a DTD or XML schema which would be valid
-children at that point (as long as grammar constraints are on).</li>
-
-</ul>
-</div>
-<p>The Design view is especially helpful if you are new to XML, or
-need to do form-oriented editing. For example, you could use the Create XML
-File wizard to create a template XML file for a job description form from
-a job description DTD. After those steps are completed, you would only have
-to fill in the form data using the Design view.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcretxml.html" title="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain.">Creating XML files</a></div>
-<div><a href="../topics/tcrexdtd.html" title="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD.">Generating XML files from DTDs</a></div>
-<div><a href="../topics/tcrexxsd.html" title="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema.">Generating XML files from XML schemas</a></div>
-<div><a href="../topics/txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-<div><a href="../topics/twxvalid.html" title="When you validate your XML file, the XML validator will check to see that your file is valid and well-formed.">Validating XML files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.dita
deleted file mode 100644
index 78efa4f370..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.dita
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cxmlcat" xml:lang="en-us">
-<title>XML file associations with DTDs and XML schemas</title>
-<titlealts>
-<searchtitle>XML file associations with DTDs and XML schemas</searchtitle>
-</titlealts>
-<shortdesc>When an XML file is associated with a DTD or XML schema, it is
-bound by any structural rules contained in the DTD or XML schema. To be considered
-a valid XML file, a document must be accompanied by a DTD or an XML schema,
-and conform to all of the declarations in the DTD or the XML schema.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML catalog<indexterm>overview</indexterm></indexterm>
-<indexterm>XML files<indexterm>associations</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>There are two different ways to associate XML files with DTDs or XML schemas.</p>
-<ol>
-<li>Direct association - The XML file contains either the name of a DTD in
-its doctype declaration (for example, &lt;!DOCTYPE root-element SYSTEM "<varname>dtdfile.dtd</varname>"
->, where <varname>dtdfile.dtd</varname> is the name of the DTD file) or it
-contains the path of an XML schema in the schemaLocation attribute of the
-XML file root element (for example, &lt;xsi:schemaLocation="http://www.ibm.com/<varname>schema.xsd</varname>">,
-where <varname>schema.xsd</varname> is the name of the XML schema.</li>
-<li>XML Catalog entry - You can register DTD and XML schema files in the XML
-Catalog and associate them with a Key that represents them. You can then
-refer to a DTD or XML schema file Key from an XML file instead of referring
-directly to the DTD or XML schema file. An XML Catalog entry contains two
-parts - the Key (which represents the DTD or XML schema) and a URI (which
-contains information about the DTD or XML schema location).</li>
-</ol>
-<section><title>How an association works</title><b>Associating an XML file
-with a DTD </b><p>If an XML file is associated with a DTD, a DOCTYPE tag such
-as the following one is included in the XML file:<codeblock>&lt;!DOCTYPE root-name PUBLIC "<varname>InvoiceId</varname>" "<varname>C:\mydtds\Invoice.dtd</varname
->">
-</codeblock></p><p>InvoiceId is the public identifier of the DTD file. It
-is used to associate the XML file with a DTD file (in this case, the DTD file
-is Invoice.dtd). If the public identifier InvoiceId corresponds to the Key
-of the XML Catalog entry for Invoice.dtd, then the U<?Pub Caret?>RI of the
-XML Catalog entry (which contains information about the location of Invoice.dtd)
-is used to locate the DTD. Otherwise, the DOCTYPE's system identifier ("C:\mydtds\Invoice.dtd"),
-which refers directly to the file system location of the DTD, is used to locate
-the DTD.</p><note>You can also use a system identifier as a Key in an XML
-Catalog entry. If you use a system identifier as a Key, a DOCTYPE tag such
-as the following one is included in an XML file:</note><codeblock>&lt;!DOCTYPE Root-name SYSTEM "MyDTD.dtd"> </codeblock><p>where
-MyDTD.dtd is the system identifier that corresponds to the Key of an XML Catalog
-entry.</p></section>
-<section><b>Associating an XML file with an XML schema</b><p>If an XML file
-is associated with an XML schema, one or more schema location attributes are
-included in the XML file. The information in the schemaLocation is provided
-as a "hint" to the XML processor. The following examples show schemaLocation
-attributes:</p><p> <b>Example 1 </b><codeblock>&lt;purchaseOrder xmlns="http://www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com C:\myschemas\PurchaseOrder.xsd">
-&lt;shipTo country="US">
-...</codeblock> </p><p><b>Example 2 </b><codeblock>&lt;purchaseOrder xmlns="http://www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com PO.xsd">
-&lt;shipTo country="US">
-....</codeblock> </p><p>In Example 1, the schemaLocation 'hint' ('C:\myschemas\PurchaseOrder.xsd')
-refers directly to the file system location or URI of the XML schema. In this
-case, the schema file will be located by the XML processor directly.</p><p>In
-Example 2, the schemaLocation 'hint' ('PO.xsd') refers to an XML Catalog entry.
-PO.xsd corresponds to the <varname>Key</varname> of the XML Catalog entry
-for PurchaseOrder.xsd, and the URI of the XML Catalog entry (which contains
-information about the location of PurchaseOrder.xsd) will be used to located
-the XML schema.</p><p>In both examples, <codeph>http://www.ibm.com</codeph> in
-the <codeph>xsi:schemaLocation</codeph> tag is a URI that identifies the namespace
-for the XML schema.</p><p>You can also use a namespace as a Key for an XML
-Catalog entry. If you use a namespace as a Key, a schemaLocation tag such
-as the following one is included in an XML file:<codeblock>&lt;purchaseOrder xmlns:="www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com po/xsd/PurchaseOrder.xsd "></codeblock></p><p>The
-schemaLocation attribute points to both the Key and the actual location of
-the schema.</p><p><b>DTD or XML schema resides on a remote server</b></p><p>Several
-functions in the XML editor, such as validation and content assist, require
-the availability of a DTD or an XML schema. The product documentation provides
-usage information for cases when the DTD or XML schema resides on your local
-machine. However, in many cases, the DTD or XML schema can reside on a remote
-server, for example:</p><p><codeph>&lt;!DOCTYPE Catalog PUBLIC "abc/Catalog"
-"http://xyz.abc.org/dtds/catalog.dtd"></codeph></p><p>Normally, this case
-poses no problem, because the DTD or XML schema can be retrieved from the
-remote server. However, if you are behind a firewall, and do not have a SOCKSified
-system, the workbench currently does not provide a way for you to specify
-a socks server for retrieving a DTD or XML schema. If you are unable to SOCKSify
-your system, the workaround for this problem is to retrieve a copy of the
-DTD or XML schema (using a Web browser, for example) and save that copy on
-your local machine. Then, you can either place a local copy in the same project
-as your XML file, or use the XML Catalog to associate a public identifier
-with the DTD's (local) location.</p><note>If you have an XML file associated
-with an XML schema or DTD that is elsewhere in the network, and you are working
-on a machine disconnected from the network, you can follow the steps described
-previously if you want to use content assist or validate your XML file. </note></section>
-<section><title>Advantages of XML Catalog entry associations</title><p>If
-you create a direct association between an XML file and an XML schema or DTD
-file, any time you change the location of the schema or DTD you have to track
-down and update all of the referencing XML files with the new location of
-the DTD or schema. If, however, you associate an XML file with an XML schema
-or DTD Key, then, when you change the location of the schema or DTD, you only
-have to update the XML Catalog entry, instead of each individual XML file.</p><p>For
-example, you have a DTD called Building.dtd, which is associated with five
-XML files - Office.xml, House.xml, Apartment.xml, Bank.xml, and PostOffice.xml.
-You move the DTD file Building.dtd to a new location. If you have a direction
-association between Building.dtd and all the XML files, you will have to update
-the &lt;DOCTTYPE> declaration in each XML file to reflect the new location
-of Building.dtd. If, however, you have an XML Catalog association, and all
-the XML files just refer to the Key of Building.dtd, then you only have to
-update the URI and all the XML files will point to the new location of Building.dtd.</p></section>
-<section><title>Updating an entry in the XML Catalog</title><p>After you have
-updated an entry in the XML Catalog, you might need to refresh the XML editor
-view so that it uses the new information. To do this, click the <uicontrol>Reload
-Dependencies</uicontrol> toolbar button <image href="../images/rldgrmr.gif">
-<alt>This graphic is the Reload Dependencies toolbar button</alt></image> and
-the view will be updated using the current XML Catalog settings. You only
-need to refresh the XML editor view when you have an XML file open that references
-the XML Catalog entry that was updated.</p><p>For more information, refer
-to the related tasks.</p></section>
-</conbody>
-</concept>
-<?Pub *0000008359?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html
deleted file mode 100644
index 45d1c40d89..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="XML file associations with DTDs and XML schemas" />
-<meta name="abstract" content="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema." />
-<meta name="description" content="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema." />
-<meta content="XML catalog, overview, XML files, associations" name="DC.subject" />
-<meta content="XML catalog, overview, XML files, associations" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtproc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cxmlcat" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML file associations with DTDs and XML schemas</title>
-</head>
-<body id="cxmlcat"><a name="cxmlcat"><!-- --></a>
-
-
-<h1 class="topictitle1">XML file associations with DTDs and XML schemas</h1>
-
-
-
-
-<div><p>When an XML file is associated with a DTD or XML schema, it is
-bound by any structural rules contained in the DTD or XML schema. To be considered
-a valid XML file, a document must be accompanied by a DTD or an XML schema,
-and conform to all of the declarations in the DTD or the XML schema.</p>
-
-<p>There are two different ways to associate XML files with DTDs or XML schemas.</p>
-
-<ol>
-<li>Direct association - The XML file contains either the name of a DTD in
-its doctype declaration (for example, &lt;!DOCTYPE root-element SYSTEM "<var class="varname">dtdfile.dtd</var>"
-&gt;, where <var class="varname">dtdfile.dtd</var> is the name of the DTD file) or it
-contains the path of an XML schema in the schemaLocation attribute of the
-XML file root element (for example, &lt;xsi:schemaLocation="http://www.ibm.com/<var class="varname">schema.xsd</var>"&gt;,
-where <var class="varname">schema.xsd</var> is the name of the XML schema.</li>
-
-<li>XML Catalog entry - You can register DTD and XML schema files in the XML
-Catalog and associate them with a Key that represents them. You can then
-refer to a DTD or XML schema file Key from an XML file instead of referring
-directly to the DTD or XML schema file. An XML Catalog entry contains two
-parts - the Key (which represents the DTD or XML schema) and a URI (which
-contains information about the DTD or XML schema location).</li>
-
-</ol>
-
-<div class="section"><h4 class="sectiontitle">How an association works</h4><strong>Associating an XML file
-with a DTD </strong><div class="p">If an XML file is associated with a DTD, a DOCTYPE tag such
-as the following one is included in the XML file:<pre>&lt;!DOCTYPE root-name PUBLIC "<var class="varname">InvoiceId</var>" "<var class="varname">C:\mydtds\Invoice.dtd</var>"&gt;
-</pre>
-</div>
-<p>InvoiceId is the public identifier of the DTD file. It
-is used to associate the XML file with a DTD file (in this case, the DTD file
-is Invoice.dtd). If the public identifier InvoiceId corresponds to the Key
-of the XML Catalog entry for Invoice.dtd, then the URI of the
-XML Catalog entry (which contains information about the location of Invoice.dtd)
-is used to locate the DTD. Otherwise, the DOCTYPE's system identifier ("C:\mydtds\Invoice.dtd"),
-which refers directly to the file system location of the DTD, is used to locate
-the DTD.</p>
-<div class="note"><span class="notetitle">Note:</span> You can also use a system identifier as a Key in an XML
-Catalog entry. If you use a system identifier as a Key, a DOCTYPE tag such
-as the following one is included in an XML file:</div>
-<pre>&lt;!DOCTYPE Root-name SYSTEM "MyDTD.dtd"&gt; </pre>
-<p>where
-MyDTD.dtd is the system identifier that corresponds to the Key of an XML Catalog
-entry.</p>
-</div>
-
-<div class="section"><strong>Associating an XML file with an XML schema</strong><p>If an XML file
-is associated with an XML schema, one or more schema location attributes are
-included in the XML file. The information in the schemaLocation is provided
-as a "hint" to the XML processor. The following examples show schemaLocation
-attributes:</p>
-<div class="p"> <strong>Example 1 </strong><pre>&lt;purchaseOrder xmlns="http://www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com C:\myschemas\PurchaseOrder.xsd"&gt;
-&lt;shipTo country="US"&gt;
-...</pre>
- </div>
-<div class="p"><strong>Example 2 </strong><pre>&lt;purchaseOrder xmlns="http://www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com PO.xsd"&gt;
-&lt;shipTo country="US"&gt;
-....</pre>
- </div>
-<p>In Example 1, the schemaLocation 'hint' ('C:\myschemas\PurchaseOrder.xsd')
-refers directly to the file system location or URI of the XML schema. In this
-case, the schema file will be located by the XML processor directly.</p>
-<p>In
-Example 2, the schemaLocation 'hint' ('PO.xsd') refers to an XML Catalog entry.
-PO.xsd corresponds to the <var class="varname">Key</var> of the XML Catalog entry
-for PurchaseOrder.xsd, and the URI of the XML Catalog entry (which contains
-information about the location of PurchaseOrder.xsd) will be used to located
-the XML schema.</p>
-<p>In both examples, <samp class="codeph">http://www.ibm.com</samp> in
-the <samp class="codeph">xsi:schemaLocation</samp> tag is a URI that identifies the namespace
-for the XML schema.</p>
-<div class="p">You can also use a namespace as a Key for an XML
-Catalog entry. If you use a namespace as a Key, a schemaLocation tag such
-as the following one is included in an XML file:<pre>&lt;purchaseOrder xmlns:="www.ibm.com"
-xsi:schemaLocation="http://www.ibm.com po/xsd/PurchaseOrder.xsd "&gt;</pre>
-</div>
-<p>The
-schemaLocation attribute points to both the Key and the actual location of
-the schema.</p>
-<p><strong>DTD or XML schema resides on a remote server</strong></p>
-<p>Several
-functions in the XML editor, such as validation and content assist, require
-the availability of a DTD or an XML schema. The product documentation provides
-usage information for cases when the DTD or XML schema resides on your local
-machine. However, in many cases, the DTD or XML schema can reside on a remote
-server, for example:</p>
-<p><samp class="codeph">&lt;!DOCTYPE Catalog PUBLIC "abc/Catalog"
-"http://xyz.abc.org/dtds/catalog.dtd"&gt;</samp></p>
-<p>Normally, this case
-poses no problem, because the DTD or XML schema can be retrieved from the
-remote server. However, if you are behind a firewall, and do not have a SOCKSified
-system, the workbench currently does not provide a way for you to specify
-a socks server for retrieving a DTD or XML schema. If you are unable to SOCKSify
-your system, the workaround for this problem is to retrieve a copy of the
-DTD or XML schema (using a Web browser, for example) and save that copy on
-your local machine. Then, you can either place a local copy in the same project
-as your XML file, or use the XML Catalog to associate a public identifier
-with the DTD's (local) location.</p>
-<div class="note"><span class="notetitle">Note:</span> If you have an XML file associated
-with an XML schema or DTD that is elsewhere in the network, and you are working
-on a machine disconnected from the network, you can follow the steps described
-previously if you want to use content assist or validate your XML file. </div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Advantages of XML Catalog entry associations</h4><p>If
-you create a direct association between an XML file and an XML schema or DTD
-file, any time you change the location of the schema or DTD you have to track
-down and update all of the referencing XML files with the new location of
-the DTD or schema. If, however, you associate an XML file with an XML schema
-or DTD Key, then, when you change the location of the schema or DTD, you only
-have to update the XML Catalog entry, instead of each individual XML file.</p>
-<p>For
-example, you have a DTD called Building.dtd, which is associated with five
-XML files - Office.xml, House.xml, Apartment.xml, Bank.xml, and PostOffice.xml.
-You move the DTD file Building.dtd to a new location. If you have a direction
-association between Building.dtd and all the XML files, you will have to update
-the &lt;DOCTTYPE&gt; declaration in each XML file to reflect the new location
-of Building.dtd. If, however, you have an XML Catalog association, and all
-the XML files just refer to the Key of Building.dtd, then you only have to
-update the URI and all the XML files will point to the new location of Building.dtd.</p>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Updating an entry in the XML Catalog</h4><p>After you have
-updated an entry in the XML Catalog, you might need to refresh the XML editor
-view so that it uses the new information. To do this, click the <span class="uicontrol">Reload
-Dependencies</span> toolbar button <img src="../images/rldgrmr.gif" alt="This graphic is the Reload Dependencies toolbar button" /> and
-the view will be updated using the current XML Catalog settings. You only
-need to refresh the XML editor view when you have an XML file open that references
-the XML Catalog entry that was updated.</p>
-<p>For more information, refer
-to the related tasks.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
-<div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
-<div><a href="../topics/tedtproc.html" title="If you have instructions you want to send to an application using an XML document, you can use a processing instruction.">Editing XML processing instructions</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita
deleted file mode 100644
index b5f74d86a2..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cxmlenc" xml:lang="en-us">
-<title>XML and HTML encodings</title>
-<titlealts>
-<searchtitle>XML and HTML encodings</searchtitle>
-</titlealts>
-<shortdesc>Encodings enable you to specify what character encoding your text
-is in.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="cxmlenc|1|characterencodingtextinfiles" status="changed">character
-encoding<indexterm>supported character sets</indexterm></indexterm></keywords>
-</metadata></prolog>
-<conbody>
-<p>The IANA name is used in the encoding statement of an XML file, or charset
-directive in an HTML file.</p>
-<p>The HTML and XML editors support the following encodings:</p>
-<table rowheader="firstcol">
-<tgroup cols="2"><colspec colname="COLSPEC0"/><colspec colname="COLSPEC1"/>
-<thead>
-<row>
-<entry colname="COLSPEC0" valign="top"> <p><b>XML Encoding (IANA Name)</b></p> </entry>
-<entry colname="COLSPEC1" valign="top"> <p><b>Description</b></p> </entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry> <p>BIG5</p> </entry>
-<entry> <p>Big5, Traditional Chinese</p> </entry>
-</row>
-<row>
-<entry> <p>EUC-JP</p> </entry>
-<entry> <p>EUC encoding, Japanese</p> </entry>
-</row>
-<row>
-<entry> <p>EUC-KR</p> </entry>
-<entry> <p>EUC encoding, Korean</p> </entry>
-</row>
-<row>
-<entry>GB18030</entry>
-<entry>National Standard, Chinese</entry>
-</row>
-<row>
-<entry> <p>ISO-2022-JP</p> </entry>
-<entry> <p>ISO 2022, Japanese</p> </entry>
-</row>
-<row>
-<entry> <p>ISO-2022-KR</p> </entry>
-<entry> <p>ISO 2022, Korean</p> </entry>
-</row>
-<row>
-<entry> <p>ISO-8859-1</p> </entry>
-<entry> <p>ISO Latin-1</p> </entry>
-</row>
-<row>
-<entry>ISO-8859-2</entry>
-<entry>Central/East European (Slavic)</entry>
-</row>
-<row>
-<entry>ISO-8859-3</entry>
-<entry>Southern European</entry>
-</row>
-<row>
-<entry>ISO-8859-4</entry>
-<entry>ISO 8859-4, Cyrillic</entry>
-</row>
-<row>
-<entry>ISO-8859-5</entry>
-<entry>ISO 8859-5, Cyrillic</entry>
-</row>
-<row>
-<entry> <p>ISO-8859-6</p> </entry>
-<entry> <p>Arabic (Logical)</p> </entry>
-</row>
-<row>
-<entry>ISO-8859-7</entry>
-<entry>Greek</entry>
-</row>
-<row>
-<entry> <p>ISO-8859-8</p> </entry>
-<entry> <p>Hebrew (Visual) (encoding supported, but not supported by the Page
-Designer Design page)</p> </entry>
-</row>
-<row>
-<entry>ISO-8859-9</entry>
-<entry>Turkish</entry>
-</row>
-<row>
-<entry> <p>SHIFT_JIS</p> </entry>
-<entry> <p>Shift-JIS, Japanese</p> </entry>
-</row>
-<row>
-<entry>TIS-620</entry>
-<entry>TISI, Thai</entry>
-</row>
-<row>
-<entry> <p>US-ASCII</p> </entry>
-<entry> <p>US ASCII</p> </entry>
-</row>
-<row>
-<entry> <p>UTF-8</p> </entry>
-<entry> <p>ISO 10646/Unicode, one-byte encoding</p> </entry>
-</row>
-<row>
-<entry> <p>UTF-16</p> </entry>
-<entry> <p>ISO 10646/Unicode, two-byte encoding</p> </entry>
-</row>
-<row>
-<entry> <p>UTF-16BE</p> </entry>
-<entry> <p>Unicode BigEndian</p> </entry>
-</row>
-<row>
-<entry> <p>UTF-16LE</p> </entry>
-<entry> <p>Unicode LittleEndian</p> </entry>
-</row>
-<row>
-<entry colname="COLSPEC0"><p>WINDOWS-31J</p></entry>
-<entry colname="COLSPEC1"><p>Japanese, Windows-31J</p></entry>
-</row>
-<row>
-<entry> <p>WINDOWS-1255</p> </entry>
-<entry> <p>Hebrew</p> </entry>
-</row>
-<row>
-<entry> <p>WINDOWS-1256</p> </entry>
-<entry> <p>Arabic</p> </entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</conbody>
-</concept>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html
deleted file mode 100644
index 7e723b11cd..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html
+++ /dev/null
@@ -1,273 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="XML and HTML encodings" />
-<meta name="abstract" content="Encodings enable you to specify what character encoding your text is in." />
-<meta name="description" content="Encodings enable you to specify what character encoding your text is in." />
-<meta content="character encoding, supported character sets" name="DC.subject" />
-<meta content="character encoding, supported character sets" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cxmlenc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML and HTML encodings</title>
-</head>
-<body id="cxmlenc"><a name="cxmlenc"><!-- --></a>
-
-
-<h1 class="topictitle1">XML and HTML encodings</h1>
-
-
-
-
-<div><p>Encodings enable you to specify what character encoding your text
-is in.</p>
-
-<p>The IANA name is used in the encoding statement of an XML file, or charset
-directive in an HTML file.</p>
-
-<p>The HTML and XML editors support the following encodings:</p>
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr>
-<th valign="top" class="firstcol" id="N10072"> <p><strong>XML Encoding (IANA Name)</strong></p>
- </th>
-
-<th valign="top" id="N10084"> <p><strong>Description</strong></p>
- </th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<th valign="top" class="firstcol" id="N100A2" headers="N10072 "> <p>BIG5</p>
- </th>
-
-<td valign="top" headers="N100A2 N10084 "> <p>Big5, Traditional Chinese</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N100C2" headers="N10072 "> <p>EUC-JP</p>
- </th>
-
-<td valign="top" headers="N100C2 N10084 "> <p>EUC encoding, Japanese</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N100E2" headers="N10072 "> <p>EUC-KR</p>
- </th>
-
-<td valign="top" headers="N100E2 N10084 "> <p>EUC encoding, Korean</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10102" headers="N10072 ">GB18030</th>
-
-<td valign="top" headers="N10102 N10084 ">National Standard, Chinese</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10116" headers="N10072 "> <p>ISO-2022-JP</p>
- </th>
-
-<td valign="top" headers="N10116 N10084 "> <p>ISO 2022, Japanese</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10136" headers="N10072 "> <p>ISO-2022-KR</p>
- </th>
-
-<td valign="top" headers="N10136 N10084 "> <p>ISO 2022, Korean</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10156" headers="N10072 "> <p>ISO-8859-1</p>
- </th>
-
-<td valign="top" headers="N10156 N10084 "> <p>ISO Latin-1</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10176" headers="N10072 ">ISO-8859-2</th>
-
-<td valign="top" headers="N10176 N10084 ">Central/East European (Slavic)</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1018A" headers="N10072 ">ISO-8859-3</th>
-
-<td valign="top" headers="N1018A N10084 ">Southern European</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1019E" headers="N10072 ">ISO-8859-4</th>
-
-<td valign="top" headers="N1019E N10084 ">ISO 8859-4, Cyrillic</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N101B2" headers="N10072 ">ISO-8859-5</th>
-
-<td valign="top" headers="N101B2 N10084 ">ISO 8859-5, Cyrillic</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N101C6" headers="N10072 "> <p>ISO-8859-6</p>
- </th>
-
-<td valign="top" headers="N101C6 N10084 "> <p>Arabic (Logical)</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N101E6" headers="N10072 ">ISO-8859-7</th>
-
-<td valign="top" headers="N101E6 N10084 ">Greek</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N101FA" headers="N10072 "> <p>ISO-8859-8</p>
- </th>
-
-<td valign="top" headers="N101FA N10084 "> <p>Hebrew (Visual) (encoding supported, but not supported by the Page
-Designer Design page)</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1021A" headers="N10072 ">ISO-8859-9</th>
-
-<td valign="top" headers="N1021A N10084 ">Turkish</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1022E" headers="N10072 "> <p>SHIFT_JIS</p>
- </th>
-
-<td valign="top" headers="N1022E N10084 "> <p>Shift-JIS, Japanese</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1024E" headers="N10072 ">TIS-620</th>
-
-<td valign="top" headers="N1024E N10084 ">TISI, Thai</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10262" headers="N10072 "> <p>US-ASCII</p>
- </th>
-
-<td valign="top" headers="N10262 N10084 "> <p>US ASCII</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10282" headers="N10072 "> <p>UTF-8</p>
- </th>
-
-<td valign="top" headers="N10282 N10084 "> <p>ISO 10646/Unicode, one-byte encoding</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N102A2" headers="N10072 "> <p>UTF-16</p>
- </th>
-
-<td valign="top" headers="N102A2 N10084 "> <p>ISO 10646/Unicode, two-byte encoding</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N102C2" headers="N10072 "> <p>UTF-16BE</p>
- </th>
-
-<td valign="top" headers="N102C2 N10084 "> <p>Unicode BigEndian</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N102E2" headers="N10072 "> <p>UTF-16LE</p>
- </th>
-
-<td valign="top" headers="N102E2 N10084 "> <p>Unicode LittleEndian</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N10302" headers="N10072 "><p>WINDOWS-31J</p>
-</th>
-
-<td valign="top" headers="N10302 N10084 "><p>Japanese, Windows-31J</p>
-</td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1031E" headers="N10072 "> <p>WINDOWS-1255</p>
- </th>
-
-<td valign="top" headers="N1031E N10084 "> <p>Hebrew</p>
- </td>
-
-</tr>
-
-<tr>
-<th valign="top" class="firstcol" id="N1033E" headers="N10072 "> <p>WINDOWS-1256</p>
- </th>
-
-<td valign="top" headers="N1033E N10084 "> <p>Arabic</p>
- </td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.dita
deleted file mode 100644
index dbfc5b2589..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.dita
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<concept id="cxmltool" xml:lang="en-us">
-<title>XML tools - overview</title>
-<titlealts>
-<searchtitle>XML tools - overview</searchtitle>
-</titlealts>
-<shortdesc>This product provides a comprehensive visual XML development environment.
-The tool set includes components for building DTDs, XML schemas, and XML files.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML tools<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>The following XML tools are available. </p>
-<p>The <b>XML editor</b> is a tool for creating and viewing XML files. You
-can use it to create new XML files, either from scratch, existing DTDs, or
-existing XML schemas. You can also use it to edit XML files, associate them
-with DTDs or schemas, and validate them. </p>
-<p> The <b>DTD editor</b> is a tool for creating and viewing DTDs. </p>
-<p>The <b>XML schema editor</b> is a tool for creating, viewing, and validating
-XML schemas. You can use the XML schema editor to perform tasks such as creating
-XML schema components and importing and viewing XML schemas. </p>
-<p><b>Notes:</b></p>
-<section>Exercise caution when opening large files with any of the XML editors.
-If the memory limits of the workbench are exceeded, it will abruptly close
-without saving any data (and without warning or error messages). The number
-of elements in an XML file, not its size, is the best indicator of how much
-memory will be required. Memory requirements also depend on what else is open
-in the workbench - in some cases you can open a fifteen megabytes file, but
-in other cases a one megabyte file might cause problems. Therefore, we recommend
-you save all data in the workbench before opening large XML files. This is
-a permanent restriction.</section>
-<section conref="rlimitations_slushXML.dita#rlimitations_slushXML/unresolv_URI"></section>
-</conbody>
-</concept>
-<?Pub *0000002064?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.html
deleted file mode 100644
index 76696338e6..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmltool.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
-<title>XML tools - overview</title>
-</head>
-<body id="cxmltool"><a name="cxmltool"><!-- --></a>
-
-<h1 class="topictitle1">XML tools - overview</h1>
-<div><p>This product provides a comprehensive visual XML development environment.
-The tool set includes components for building DTDs, XML schemas, and XML files.</p><p>The following XML tools are available:</p>
-<p>The <b>XML editor</b> is a tool for creating and viewing XML files. You
-can use it to create new XML files, either from scratch, existing DTDs, or
-existing XML schemas. You can also use it to edit XML files, associate them
-with DTDs or schemas, and validate them.</p>
-<p>The <b>DTD editor</b> is a tool for creating and viewing DTDs. </p>
-<p>The <b>XML schema editor</b> is a tool for creating, viewing, and validating
-XML schemas. You can use the XML schema editor to perform tasks such as creating
-XML schema components and importing and viewing XML schemas. </p>
-<div class="skipspace">Exercise caution when opening large files with any of the XML editors.
-If the memory limits of the workbench are exceeded, it will abruptly close
-without saving any data (and without warning or error messages). The number
-of elements in an XML file, not its size, is the best indicator of how much
-memory will be required. Memory requirements also depend on what else is open
-in the workbench - in some cases you can open a 15 megabytes file, but in
-other cases a one-megabyte file may cause problems. Therefore, we recommend
-you save all data in the workbench before opening large XML files. This is
-a permanent restriction.</div>
-<div class="skipspace"><p>The
-behavior of the XML parser when encountering an unresolvable URI (for example,
-in a DOCTYPE declaration) is to report a fatal IO error and stop any further
-processing. An unresolved URI is seen neither as a syntactic nor a semantic
-error and as such, the parser does not attempt to handle it. Essentially,
-the document remains unchecked. This is a known problem.</p>
-</div>
-</div>
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.dita
deleted file mode 100644
index b2be71435d..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.dita
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
-<reference id="rextctn" xml:lang="en-us">
-<title>Editing XML documents with multiple namespaces</title>
-<titlealts>
-<searchtitle>Editing XML documents with multiple namespaces</searchtitle>
-</titlealts>
-<shortdesc>You can use the XML schema <codeph>any</codeph> element to extend
-the content model of an XML document.</shortdesc>
-<refbody>
-<section><p>For example, you have an XML schema file called Book.xsd that
-contains a complex type called BookType. BookType contains 4 elements (title,
-author, year, and ISBN) and one <codeph>any</codeph> element. The namespace
-for the <codeph>any</codeph> element is <codeph>##any</codeph>. This means
-that in an instance document, you can insert any XML element to extend the
-definition of the BookType.</p><p>You can also provide a more specific namespace.
-For example, you have another schema called My_Book.xsd, which contains a
-complex type called My_BookType. My_BookType contains 4 elements (title, author,
-year, and ISBN) and one <codeph>any</codeph> element, but in this case the
-namespace for the BookType element is www.wesley.com. This means that in
-an instance document, you can insert any XML element to extend the definition
-of the BookType, provided that they belong to the namespace http://www.wesley.com.</p></section>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html
deleted file mode 100644
index 7b9c4e2047..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Editing XML documents with multiple namespaces" />
-<meta name="abstract" content="You can use the XML schema any element to extend the content model of an XML document." />
-<meta name="description" content="You can use the XML schema any element to extend the content model of an XML document." />
-<meta content="XHTML" name="DC.Format" />
-<meta content="rextctn" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing XML documents with multiple namespaces</title>
-</head>
-<body id="rextctn"><a name="rextctn"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing XML documents with multiple namespaces</h1>
-
-
-
-<div><p>You can use the XML schema <samp class="codeph">any</samp> element to extend
-the content model of an XML document.</p>
-
-<div class="section"><p>For example, you have an XML schema file called Book.xsd that
-contains a complex type called BookType. BookType contains 4 elements (title,
-author, year, and ISBN) and one <samp class="codeph">any</samp> element. The namespace
-for the <samp class="codeph">any</samp> element is <samp class="codeph">##any</samp>. This means
-that in an instance document, you can insert any XML element to extend the
-definition of the BookType.</p>
-<p>You can also provide a more specific namespace.
-For example, you have another schema called My_Book.xsd, which contains a
-complex type called My_BookType. My_BookType contains 4 elements (title, author,
-year, and ISBN) and one <samp class="codeph">any</samp> element, but in this case the
-namespace for the BookType element is www.wesley.com. This means that in
-an instance document, you can insert any XML element to extend the definition
-of the BookType, provided that they belong to the namespace http://www.wesley.com.</p>
-</div>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.dita
deleted file mode 100644
index c7ee4b0777..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.dita
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
-<reference id="rlimitations_slushXML" xml:lang="en-us">
-<title>Limitations of XML Editor</title>
-<titlealts>
-<searchtitle>Limitations of XML Editor</searchtitle>
-</titlealts>
-<shortdesc>This section describes known product aspect limitations and workarounds.</shortdesc>
-<refbody>
-<!--Use this template to single source the readme information. The content for the readme information is maintained in this topic and is inserted into the related topic using the conref attribute. This file will not be surfaced in your navigation.-->
-<section id="unresolv_URI"><!--No defect associated with this. It is from the 5.1. readme.--><p>The
-behavior of the XML parser when encountering an unresolvable URI (for example,
-in a DOCTYPE declaration) is to report a fatal IO error and stop any further
-processing. An unresolved URI is seen neither as a syntactic nor a semantic
-error and as such, the parser does not attempt to handle it. Essentially,
-the document remains unchecked. This is a known problem.</p></section>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html
deleted file mode 100644
index dba12c0b3b..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Limitations of XML Editor" />
-<meta name="abstract" content="This section describes known product aspect limitations and workarounds." />
-<meta name="description" content="This section describes known product aspect limitations and workarounds." />
-<meta content="XHTML" name="DC.Format" />
-<meta content="rlimitations_slushXML" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Limitations of XML Editor</title>
-</head>
-<body id="rlimitations_slushXML"><a name="rlimitations_slushXML"><!-- --></a>
-
-
-<h1 class="topictitle1">Limitations of XML Editor</h1>
-
-
-
-<div><p>This section describes known product aspect limitations and workarounds.</p>
-
-
-<div class="section" id="rlimitations_slushXML__unresolv_URI"><a name="rlimitations_slushXML__unresolv_URI"><!-- --></a><p>The
-behavior of the XML parser when encountering an unresolvable URI (for example,
-in a DOCTYPE declaration) is to report a fatal IO error and stop any further
-processing. An unresolved URI is seen neither as a syntactic nor a semantic
-error and as such, the parser does not attempt to handle it. Essentially,
-the document remains unchecked. This is a known problem.</p>
-</div>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.dita
deleted file mode 100644
index a398b072db..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.dita
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
-<?Pub Inc?>
-<reference id="ricons" xml:lang="en-us">
-<title>Icons used in the XML editor</title>
-<titlealts>
-<searchtitle>Icons used in the XML editor</searchtitle>
-</titlealts>
-<shortdesc>The following XML editor icons appear in the Outline and Design
-view.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>icons</indexterm></indexterm></keywords>
-</metadata></prolog>
-<refbody>
-<table>
-<tgroup cols="2"><colspec colname="COLSPEC0"/><colspec colname="COLSPEC1"/>
-<tbody>
-<row>
-<entry colname="COLSPEC0" valign="bottom"><b>Icon</b></entry>
-<entry colname="COLSPEC1" valign="bottom"><b>Description</b></entry>
-</row>
-<row>
-<entry> <image href="../images/nattrib.gif"><alt>This graphic is the attribute
-icon</alt></image> </entry>
-<entry>attribute</entry>
-</row>
-<row>
-<entry> <image href="../images/cdatasection.gif"><alt>This graphic is the
-character data icon</alt></image></entry>
-<entry>character data (CDATA) section</entry>
-</row>
-<row>
-<entry> <image href="../images/comment_obj.gif"><alt>This graphic is the comment
-icon</alt></image></entry>
-<entry>comment</entry>
-</row>
-<row>
-<entry> <image href="../images/doctype.gif"><alt>This graphic is the DOCTYPE
-icon</alt></image></entry>
-<entry>DOCTYPE declaration</entry>
-</row>
-<row>
-<entry> <image href="../images/nelem.gif"><alt>This graphic is the element
-icon</alt></image> </entry>
-<entry>element</entry>
-</row>
-<row>
-<entry> <image href="../images/proinst_obj.gif"><alt>This graphic is the processing
-instructions icon</alt></image></entry>
-<entry>processing instructions</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</refbody>
-</reference>
-<?Pub *0000001824?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html
deleted file mode 100644
index 7b99c6338c..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Icons used in the XML editor" />
-<meta name="abstract" content="The following XML editor icons appear in the Outline and Design view." />
-<meta name="description" content="The following XML editor icons appear in the Outline and Design view." />
-<meta content="XML editor, icons" name="DC.subject" />
-<meta content="XML editor, icons" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ricons" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Icons used in the XML editor</title>
-</head>
-<body id="ricons"><a name="ricons"><!-- --></a>
-
-
-<h1 class="topictitle1">Icons used in the XML editor</h1>
-
-
-
-
-<div><p>The following XML editor icons appear in the Outline and Design
-view.</p>
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<tbody>
-<tr>
-<td valign="bottom"><strong>Icon</strong></td>
-
-<td valign="bottom"><strong>Description</strong></td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/nattrib.gif" alt="This graphic is the attribute&#10;icon" /> </td>
-
-<td valign="top">attribute</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/cdatasection.gif" alt="This graphic is the&#10;character data icon" /></td>
-
-<td valign="top">character data (CDATA) section</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/comment_obj.gif" alt="This graphic is the comment&#10;icon" /></td>
-
-<td valign="top">comment</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/doctype.gif" alt="This graphic is the DOCTYPE&#10;icon" /></td>
-
-<td valign="top">DOCTYPE declaration</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/nelem.gif" alt="This graphic is the element&#10;icon" /> </td>
-
-<td valign="top">element</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/proinst_obj.gif" alt="This graphic is the processing&#10;instructions icon" /></td>
-
-<td valign="top">processing instructions</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita
deleted file mode 100644
index 4952c8deaf..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="xmlcatalogkeyboardshortcuts" xml:lang="en-us">
-<title outputclass="id_title">XML Catalog keyboard shortcuts</title>
-<shortdesc outputclass="id_shortdesc">Accelerator keys can be used in the
-catalog tree structure and catalog entry wizard by first pressing and holding
-the Alt key.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>accessibility<indexterm>keyboard shortcuts<indexterm>XML
-catalog wizard</indexterm></indexterm></indexterm><indexterm>keyboard shortcuts<indexterm>XML
-catalog wizard</indexterm></indexterm><indexterm>shortcuts<indexterm>keyboard<indexterm>XML
-catalog wizard</indexterm></indexterm></indexterm><indexterm>XML catalog wizard<indexterm>accessibility</indexterm></indexterm>
-<indexterm>XML catalog wizard<indexterm>keyboard shortcuts</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<table frame="all">
-<tgroup cols="2"><colspec colname="col1" colwidth="84*"/><colspec colname="col3"
-colwidth="93*"/>
-<thead>
-<row valign="bottom">
-<entry colname="col1">Key Combination</entry>
-<entry colname="col3">Function</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="col1">Alt+A</entry>
-<entry colname="col3">Add catalog entry</entry>
-</row>
-<row>
-<entry colname="col1">Alt+E</entry>
-<entry colname="col3">Edit selected catalog entry</entry>
-</row>
-<row>
-<entry colname="col1">Alt+R</entry>
-<entry colname="col3">Remove selected catalog entry</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html
deleted file mode 100644
index 2ebc1457bb..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="XML Catalog keyboard shortcuts" />
-<meta name="abstract" content="Accelerator keys can be used in the catalog tree structure and catalog entry wizard by first pressing and holding the Alt key." />
-<meta name="description" content="Accelerator keys can be used in the catalog tree structure and catalog entry wizard by first pressing and holding the Alt key." />
-<meta content="accessibility, keyboard shortcuts, XML catalog wizard, shortcuts, keyboard, XML catalog wizard" name="DC.subject" />
-<meta content="accessibility, keyboard shortcuts, XML catalog wizard, shortcuts, keyboard, XML catalog wizard" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="xmlcatalogkeyboardshortcuts" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML Catalog keyboard shortcuts</title>
-</head>
-<body id="xmlcatalogkeyboardshortcuts"><a name="xmlcatalogkeyboardshortcuts"><!-- --></a>
-
-
-<h1 class="id_title">XML Catalog keyboard shortcuts</h1>
-
-
-
-<div><p class="id_shortdesc">Accelerator keys can be used in the
-catalog tree structure and catalog entry wizard by first pressing and holding
-the Alt key.</p>
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr valign="bottom">
-<th valign="bottom" width="47.45762711864407%" id="N10091">Key Combination</th>
-
-<th valign="bottom" width="52.54237288135594%" id="N10098">Function</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+A</td>
-
-<td valign="top" width="52.54237288135594%" headers="N10098 ">Add catalog entry</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+E</td>
-
-<td valign="top" width="52.54237288135594%" headers="N10098 ">Edit selected catalog entry</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+R</td>
-
-<td valign="top" width="52.54237288135594%" headers="N10098 ">Remove selected catalog entry</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita
deleted file mode 100644
index b0edc3fec7..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="xmltoolskeyboardshortcuts" xml:lang="en-us">
-<title>Source editor and XML tools keyboard shortcuts</title>
-<shortdesc>The following keyboard shortcuts are available for the XML, XSD,
-WSDL, HTML, JSP, CSS and DTD editors.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>accessibility<indexterm>keyboard shortcuts<indexterm>XML
-editor</indexterm></indexterm></indexterm><indexterm>accessibility<indexterm>keyboard
-shortcuts<indexterm>source editor</indexterm></indexterm></indexterm><indexterm>keyboard
-shortcuts<indexterm>XML editor</indexterm></indexterm><indexterm>shortcuts<indexterm>keyboard<indexterm>XML
-editor</indexterm></indexterm></indexterm><indexterm>XML editor<indexterm>accessibility</indexterm></indexterm>
-<indexterm>XML editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>XSD editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>WSDL editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>HTML editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>JSP editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>CSS editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-<indexterm>DTD editor<indexterm>keyboard shortcuts</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<section><title>Shortcuts available in all source editors</title><simpletable>
-<sthead>
-<stentry>Command</stentry>
-<stentry>Shortcut</stentry>
-</sthead>
-<strow>
-<stentry>Go To Matching Bracket</stentry>
-<stentry>Ctrl+Shift+P</stentry>
-</strow>
-<strow>
-<stentry>Restore Last Selection</stentry>
-<stentry>Atl+Shift+Down</stentry>
-</strow>
-<strow>
-<stentry>Select Enclosing Element</stentry>
-<stentry>Alt+Shift+Up</stentry>
-</strow>
-<strow>
-<stentry>Select Next Element</stentry>
-<stentry>Alt+Shift+Right</stentry>
-</strow>
-<strow>
-<stentry>Select Previous Element</stentry>
-<stentry>Alt+Shift+Left</stentry>
-</strow>
-</simpletable></section>
-<section><title>Shortcuts available in the XML, XSD, WSDL, HTML, JSP, and
-CSS editors (excludes the DTD editor)</title><simpletable>
-<sthead>
-<stentry>Command</stentry>
-<stentry>Shortcut</stentry>
-</sthead>
-<strow>
-<stentry>Format</stentry>
-<stentry>Ctrl+Shift+F</stentry>
-</strow>
-<strow>
-<stentry>Format Active Elements</stentry>
-<stentry>Ctrl+I</stentry>
-</strow>
-</simpletable></section>
-<section><title>Shortcuts available in the XML, XSD, WSDL, HTML, and JSP editors
-(excludes the DTD and CSS editors)</title><simpletable>
-<sthead>
-<stentry>Command</stentry>
-<stentry>Shortcut</stentry>
-</sthead>
-<strow>
-<stentry>Add Block Comment</stentry>
-<stentry>Ctrl+Shift+/</stentry>
-</strow>
-<strow>
-<stentry>Go To Matching Tag</stentry>
-<stentry>Ctrl+Shift+></stentry>
-</strow>
-<strow>
-<stentry>Go To Next Sibling</stentry>
-<stentry>Ctrl+Shift+Down</stentry>
-</strow>
-<strow>
-<stentry>Occurrences in File</stentry>
-<stentry>Ctrl+Shift+A</stentry>
-</strow>
-<strow>
-<stentry>Open Selection</stentry>
-<stentry>F3</stentry>
-</strow>
-<strow>
-<stentry>Go To Previous Sibling</stentry>
-<stentry>Ctrl+Shift+Up</stentry>
-</strow>
-<strow>
-<stentry>Remove Block Comment</stentry>
-<stentry>Ctrl+Shift+\</stentry>
-</strow>
-<strow>
-<stentry>Toggle Comment</stentry>
-<stentry>Ctrl+Shift+C</stentry>
-</strow>
-</simpletable></section>
-<section><title>Shortcuts available in the design view of the XSD and WSDL
-editors</title><simpletable>
-<sthead>
-<stentry>Command</stentry>
-<stentry>Shortcut</stentry>
-</sthead>
-<strow>
-<stentry>Zoom In</stentry>
-<stentry>Ctrl+=</stentry>
-</strow>
-<strow>
-<stentry>Zoom Out</stentry>
-<stentry>Ctrl+-</stentry>
-</strow>
-</simpletable></section>
-<section><title>Shortcuts available in the design view of the WSDL editor</title><simpletable>
-<sthead>
-<stentry>Command</stentry>
-<stentry>Shortcut</stentry>
-</sthead>
-<strow>
-<stentry>Export Diagram as Image</stentry>
-<stentry>Ctrl+Shift+X</stentry>
-</strow>
-</simpletable></section>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html
deleted file mode 100644
index 9958698282..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Source editor and XML tools keyboard shortcuts" />
-<meta name="abstract" content="The following keyboard shortcuts are available for the XML, XSD, WSDL, HTML, JSP, CSS and DTD editors." />
-<meta name="description" content="The following keyboard shortcuts are available for the XML, XSD, WSDL, HTML, JSP, CSS and DTD editors." />
-<meta content="accessibility, keyboard shortcuts, XML editor, keyboard shortcuts, source editor, XML editor, shortcuts, keyboard, XSD editor, WSDL editor, HTML editor, JSP editor, CSS editor, DTD editor" name="DC.subject" />
-<meta content="accessibility, keyboard shortcuts, XML editor, keyboard shortcuts, source editor, XML editor, shortcuts, keyboard, XSD editor, WSDL editor, HTML editor, JSP editor, CSS editor, DTD editor" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="xmltoolskeyboardshortcuts" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Source editor and XML tools keyboard shortcuts</title>
-</head>
-<body id="xmltoolskeyboardshortcuts"><a name="xmltoolskeyboardshortcuts"><!-- --></a>
-
-
-<h1 class="topictitle1">Source editor and XML tools keyboard shortcuts</h1>
-
-
-
-<div><p>The following keyboard shortcuts are available for the XML, XSD,
-WSDL, HTML, JSP, CSS and DTD editors.</p>
-
-<div class="section"><h4 class="sectiontitle">Shortcuts available in all source editors</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N100D0">Command</th>
-
-<th valign="bottom" align="left" id="N100D6">Shortcut</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100D0">Go To Matching Bracket</td>
-
-<td valign="top" headers="N100D6">Ctrl+Shift+P</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100D0">Restore Last Selection</td>
-
-<td valign="top" headers="N100D6">Atl+Shift+Down</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100D0">Select Enclosing Element</td>
-
-<td valign="top" headers="N100D6">Alt+Shift+Up</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100D0">Select Next Element</td>
-
-<td valign="top" headers="N100D6">Alt+Shift+Right</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100D0">Select Previous Element</td>
-
-<td valign="top" headers="N100D6">Alt+Shift+Left</td>
-
-</tr>
-
-</table>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Shortcuts available in the XML, XSD, WSDL, HTML, JSP, and
-CSS editors (excludes the DTD editor)</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N1014B">Command</th>
-
-<th valign="bottom" align="left" id="N10151">Shortcut</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N1014B">Format</td>
-
-<td valign="top" headers="N10151">Ctrl+Shift+F</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N1014B">Format Active Elements</td>
-
-<td valign="top" headers="N10151">Ctrl+I</td>
-
-</tr>
-
-</table>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Shortcuts available in the XML, XSD, WSDL, HTML, and JSP editors
-(excludes the DTD and CSS editors)</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N10190">Command</th>
-
-<th valign="bottom" align="left" id="N10196">Shortcut</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Add Block Comment</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+/</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Go To Matching Tag</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+&gt;</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Go To Next Sibling</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+Down</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Occurrences in File</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+A</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Open Selection</td>
-
-<td valign="top" headers="N10196">F3</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Go To Previous Sibling</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+Up</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Remove Block Comment</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+\</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10190">Toggle Comment</td>
-
-<td valign="top" headers="N10196">Ctrl+Shift+C</td>
-
-</tr>
-
-</table>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Shortcuts available in the design view of the XSD and WSDL
-editors</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N10241">Command</th>
-
-<th valign="bottom" align="left" id="N10247">Shortcut</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10241">Zoom In</td>
-
-<td valign="top" headers="N10247">Ctrl+=</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10241">Zoom Out</td>
-
-<td valign="top" headers="N10247">Ctrl+-</td>
-
-</tr>
-
-</table>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Shortcuts available in the design view of the WSDL editor</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N10286">Command</th>
-
-<th valign="bottom" align="left" id="N1028C">Shortcut</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N10286">Export Diagram as Image</td>
-
-<td valign="top" headers="N1028C">Ctrl+Shift+X</td>
-
-</tr>
-
-</table>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.dita
deleted file mode 100644
index d7c76abaab..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.dita
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="tcretxml" xml:lang="en-us">
-<title>Creating XML files</title>
-<titlealts>
-<searchtitle>Creating XML files</searchtitle>
-</titlealts>
-<shortdesc>You can create a new XML file which you can then edit in the XML
-editor. You create a new XML file that is not associated with a DTD or XML
-schema file, so there are no restrictions on the kind of content it can contain.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML files<indexterm>creating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To create a new
-XML file, complete the following steps:</p></context>
-<steps>
-<step><cmd>Create a project to contain the XML file if one does not exist
-already.</cmd></step>
-<step><cmd>In the workbench, click <menucascade><uicontrol>File</uicontrol>
-<uicontrol>New</uicontrol><uicontrol>Other</uicontrol></menucascade> and select <menucascade>
-<uicontrol>XML</uicontrol><uicontrol>XML</uicontrol></menucascade>. Click <uicontrol>Next</uicontrol>.</cmd>
-</step>
-<step><cmd>Select the project or folder that will contain the XML file.</cmd>
-</step>
-<step><cmd>In the <uicontrol>File name</uicontrol> field, type the name of
-the XML file and click <uicontrol>Next</uicontrol>. The name of your XML file
-must end in <userinput>.xml</userinput>.</cmd></step>
-<step><cmd>Select the <uicontrol>Create XML file from an XML template</uicontrol> radio
-button and click <uicontrol>Next.</uicontrol>.</cmd></step>
-<step importance="optional"><cmd>You may choose to view and edit the XML templates
-that will be used in your new XML file.</cmd></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
-</steps>
-<postreq><?Pub Caret?></postreq>
-</taskbody>
-</task>
-<?Pub *0000002004?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html
deleted file mode 100644
index 495d04ff3a..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating XML files" />
-<meta name="abstract" content="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain." />
-<meta name="description" content="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain." />
-<meta content="XML files, creating" name="DC.subject" />
-<meta content="XML files, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexxsd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcretxml" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating XML files</title>
-</head>
-<body id="tcretxml"><a name="tcretxml"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating XML files</h1>
-
-
-
-
-<div><p>You can create a new XML file which you can then edit in the XML
-editor. You create a new XML file that is not associated with a DTD or XML
-schema file, so there are no restrictions on the kind of content it can contain.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To create a new
-XML file, complete the following steps:</p>
-</div>
-
-<ol>
-<li><span>Create a project to contain the XML file if one does not exist
-already.</span></li>
-
-<li><span>In the workbench, click <span class="menucascade"><span class="uicontrol">File</span>
- &gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Other</span></span> and select <span class="menucascade">
-<span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML</span></span>. Click <span class="uicontrol">Next</span>.</span>
-</li>
-
-<li><span>Select the project or folder that will contain the XML file.</span>
-</li>
-
-<li><span>In the <span class="uicontrol">File name</span> field, type the name of
-the XML file and click <span class="uicontrol">Next</span>. The name of your XML file
-must end in <kbd class="userinput">.xml</kbd>.</span></li>
-
-<li><span>Select the <span class="uicontrol">Create XML file from an XML template</span> radio
-button and click <span class="uicontrol">Next.</span>.</span></li>
-
-<li><strong>Optional: </strong><span>You may choose to view and edit the XML templates
-that will be used in your new XML file.</span></li>
-
-<li><span>Click <span class="uicontrol">Finish</span>.</span></li>
-
-</ol>
-
-<div class="section" />
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcrexdtd.html" title="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD.">Generating XML files from DTDs</a></div>
-<div><a href="../topics/tcrexxsd.html" title="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema.">Generating XML files from XML schemas</a></div>
-<div><a href="../topics/txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita
deleted file mode 100644
index e1efde51cb..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tcrexdtd" xml:lang="en-us">
-<title>Generating XML files from DTDs</title>
-<titlealts>
-<searchtitle>Generate an XML file from a DTD</searchtitle>
-</titlealts>
-<shortdesc>You can generate an XML file from your DTD if you want to quickly
-create an XML file based on your DTD file. Generating an XML file from your
-DTD saves you time by creating an XML file that is already associated with
-your DTD, and contains at least some of the elements and attributes in your
-DTD.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tcrexdtd|1|XMLfilesgeneratingfromDTDs" status="new">XML
-files<indexterm>generating from DTDs</indexterm></indexterm><indexterm keyref="tcrexdtd|2|DTDgeneratingXMLfiles"
-status="changed">DTDs<indexterm>generating XML files</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>After you have generated your XML file, you can further customize
-it in the XML editor.</p><p>The following instructions were written for the
-Resource perspective, but they will also work in many other perspectives.</p><p>To
-create an XML file from a DTD file, complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Navigator view, right-click the DTD file that you want to
-work with and select <menucascade><uicontrol>Generate</uicontrol><uicontrol>XML
-File</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Select a project or folder to contain the XML file and type a name
-for the file in the <uicontrol>File Name</uicontrol> field, then click <uicontrol>Next</uicontrol>.</cmd>
-<info>The name of the file must end in <userinput>.xml</userinput>.</info>
-</step>
-<step><cmd>Select the <uicontrol>Root element</uicontrol> of the XML file.</cmd>
-<info>The root element of an XML file is the element that contains all other
-elements in that file. All the elements that you have defined in the DTD will
-be shown in the <uicontrol>Root element</uicontrol> list.</info></step>
-<step><cmd>Select from the following content options: </cmd>
-<choices>
-<choice><uicontrol>Create optional attributes</uicontrol>: both mandatory
-and optional attributes will be generated.</choice>
-<choice><uicontrol>Create optional elements</uicontrol>: both mandatory and
-optional elements will be generated.</choice>
-<choice><uicontrol>Create first choice of required choice</uicontrol>: the
-first option of a required choice will be generated in your XML file.</choice>
-<choice><uicontrol>Fill elements and attributes with data</uicontrol>: any
-elements and attributes generated will be filled with sample data.</choice>
-</choices>
-<info> If you do not select any of these options, then only the minimum amount
-of content required for the XML file will be created.</info></step>
-<step><cmd>Specify the <uicontrol>Public ID</uicontrol> or <uicontrol>System
-ID</uicontrol>.</cmd><info>You do not need to specify both. If you do, the
-Public ID will be used before the System ID. </info></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
-</steps>
-<result><p>The XML file will only contain the selected root element and any
-elements or attributes contained in the root element. You can now add elements,
-attributes, entities, and notations to the XML file, however, they must follow
-the rules established in the DTD that you used to create the XML file.</p></result>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html
deleted file mode 100644
index 82fba1fea6..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Generating XML files from DTDs" />
-<meta name="abstract" content="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD." />
-<meta name="description" content="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD." />
-<meta content="XML files, generating from DTDs, DTDs, generating XML files" name="DC.subject" />
-<meta content="XML files, generating from DTDs, DTDs, generating XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretxml.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexxsd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcrexdtd" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Generate an XML file from a DTD</title>
-</head>
-<body id="tcrexdtd"><a name="tcrexdtd"><!-- --></a>
-
-
-<h1 class="topictitle1">Generating XML files from DTDs</h1>
-
-
-
-
-<div><p>You can generate an XML file from your DTD if you want to quickly
-create an XML file based on your DTD file. Generating an XML file from your
-DTD saves you time by creating an XML file that is already associated with
-your DTD, and contains at least some of the elements and attributes in your
-DTD.</p>
-
-<div class="section"><p>After you have generated your XML file, you can further customize
-it in the XML editor.</p>
-<p>The following instructions were written for the
-Resource perspective, but they will also work in many other perspectives.</p>
-<p>To
-create an XML file from a DTD file, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Navigator view, right-click the DTD file that you want to
-work with and select <span class="menucascade"><span class="uicontrol">Generate</span> &gt; <span class="uicontrol">XML
-File</span></span>.</span></li>
-
-<li class="stepexpand"><span>Select a project or folder to contain the XML file and type a name
-for the file in the <span class="uicontrol">File Name</span> field, then click <span class="uicontrol">Next</span>.</span>
- The name of the file must end in <kbd class="userinput">.xml</kbd>.
-</li>
-
-<li class="stepexpand"><span>Select the <span class="uicontrol">Root element</span> of the XML file.</span>
- The root element of an XML file is the element that contains all other
-elements in that file. All the elements that you have defined in the DTD will
-be shown in the <span class="uicontrol">Root element</span> list.</li>
-
-<li class="stepexpand"><span>Select from the following content options: </span>
-<ul>
-<li><span class="uicontrol">Create optional attributes</span>: both mandatory
-and optional attributes will be generated.</li>
-
-<li><span class="uicontrol">Create optional elements</span>: both mandatory and
-optional elements will be generated.</li>
-
-<li><span class="uicontrol">Create first choice of required choice</span>: the
-first option of a required choice will be generated in your XML file.</li>
-
-<li><span class="uicontrol">Fill elements and attributes with data</span>: any
-elements and attributes generated will be filled with sample data.</li>
-
-</ul>
-
- If you do not select any of these options, then only the minimum amount
-of content required for the XML file will be created.</li>
-
-<li class="stepexpand"><span>Specify the <span class="uicontrol">Public ID</span> or <span class="uicontrol">System
-ID</span>.</span> You do not need to specify both. If you do, the
-Public ID will be used before the System ID. </li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
-
-</ol>
-
-<div class="section"><p>The XML file will only contain the selected root element and any
-elements or attributes contained in the root element. You can now add elements,
-attributes, entities, and notations to the XML file, however, they must follow
-the rules established in the DTD that you used to create the XML file.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcretxml.html" title="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain.">Creating XML files</a></div>
-<div><a href="../topics/tcrexxsd.html" title="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema.">Generating XML files from XML schemas</a></div>
-<div><a href="../topics/txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita
deleted file mode 100644
index 6ba3873eb0..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tcrexxsd" xml:lang="en-us">
-<title>Generating XML files from XML schemas</title>
-<titlealts>
-<searchtitle>Generating an XML file from an XML schema</searchtitle>
-</titlealts>
-<shortdesc>You can generate an XML file from your XML schema if you want to
-quickly create an XML file based on your XML schema file. Generating an XML
-file from your XML schema saves you time by creating an XML file that is already
-associated with your XML schema, and contains at least some of the elements
-and attributes in your XML schema.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="tcrexxsd|1|XMLfilesgeneratingfromXMLschemas"
-status="new">XML files<indexterm>generating from XML schemas</indexterm></indexterm>
-<indexterm keyref="tcrexxsd|2|XMLschemasgeneratingXMLfiles" status="changed">schemas<indexterm>generating
-XML files</indexterm></indexterm></keywords>
-</metadata><metadata>
-<keywords><indexterm keyref="tcrexxsd|11|XMLfilesschemas" status="new">XML
-files<indexterm>schemas</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>After you have generated your XML file, you can further customize
-it in the XML editor.</p><p>The following instructions were written for the
-Resource perspective, but they will also work in many other perspectives.</p><p>To
-generate an XML file from a schema file follow these steps:</p></context>
-<steps>
-<step><cmd>In the Navigator view, right-click the XML schema file that you
-want to work with and select <menucascade><uicontrol>Generate</uicontrol>
-<uicontrol>XML File</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Select a project or folder to contain the XML file and type a name
-for the file in the <uicontrol>File Name</uicontrol> field, then click <uicontrol>Next</uicontrol>.</cmd>
-<info>The name of the file must end in <userinput>.xml</userinput>.</info>
-</step>
-<step><cmd>Select the <uicontrol>Root element</uicontrol> of the XML file.</cmd>
-<info>The root element of an XML file is the element that contains all other
-elements in that file. All of the global elements you have defined in the
-XML schema will be included in the Root element list. If you do not have any
-global elements in your XML schema, you cannot create an XML file from it.</info>
-</step>
-<step><cmd>Select from the following content options:</cmd>
-<choices>
-<choice><uicontrol>Create optional attributes</uicontrol>: both mandatory
-and optional attributes will be generated.</choice>
-<choice><uicontrol>Create optional elements</uicontrol>: both mandatory and
-optional elements will be generated.</choice>
-<choice><uicontrol>Create first choice of required choice</uicontrol>: the
-first option of a required choice will be generated in your XML file.</choice>
-<choice><uicontrol>Fill elements and attributes with data</uicontrol>: any
-elements and attributes generated will be filled with sample data.</choice>
-</choices>
-<info>If you do not select any of these options, then only the minimum amount
-of content required for the XML file will be created.</info></step>
-<step><cmd>The Namespace Information section contains information about the
-target namespace of the XML schema, its prefix, and the schema location. Select
-the entry you want to edit and click <uicontrol>Edit</uicontrol>.</cmd><info><ul>
-<li>The value in the <uicontrol>Namespace Name</uicontrol> field is the target
-namespace of the XML schema. Your XML file should be associated with the same
-namespace as its XML schema is associated with.</li>
-<li>All qualified elements and attributes in the XML file associated with
-the namespace will be prefixed with the <uicontrol>Prefix</uicontrol> value.</li>
-<li>The <uicontrol>Location Hint</uicontrol> field contains the location
-of the XML schema.</li>
-</ul>For more information about namespaces and namespace prefixes, refer to
-the related references.</info></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Finish</uicontrol>.</cmd>
-</step>
-</steps>
-<result><p>The XML file will contain the selected root element and any elements
-or attributes contained in the root element. It also contains information
-about the XML file namespace and location. You can now add elements and attributes
-to the XML file.</p><note>In certain cases, when an XML file is generated
-from a complex XML schema file, the XML file might not be valid. If this occurs,
-you can open the generated file in the XML editor and correct any errors that
-occur. Usually, only a few errors need to be fixed. The following XML schema
-constructs might present problems:</note><ul>
-<li>Restrictions: sometimes restricted elements are erroneously generated. </li>
-<li>Facets: default generated data values might not conform to complex facets
-(for example, patterns).</li>
-<li>Abstract elements: abstract elements are sometimes erroneously generated.</li>
-</ul></result>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
deleted file mode 100644
index 9d165bc344..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Generating XML files from XML schemas" />
-<meta name="abstract" content="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema." />
-<meta name="description" content="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema." />
-<meta content="XML files, generating from XML schemas, schemas, generating XML files, XML files" name="DC.subject" />
-<meta content="XML files, generating from XML schemas, schemas, generating XML files, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcretxml.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcrexdtd.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcrexxsd" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Generating an XML file from an XML schema</title>
-</head>
-<body id="tcrexxsd"><a name="tcrexxsd"><!-- --></a>
-
-
-<h1 class="topictitle1">Generating XML files from XML schemas</h1>
-
-
-
-
-<div><p>You can generate an XML file from your XML schema if you want to
-quickly create an XML file based on your XML schema file. Generating an XML
-file from your XML schema saves you time by creating an XML file that is already
-associated with your XML schema, and contains at least some of the elements
-and attributes in your XML schema.</p>
-
-<div class="section"><p>After you have generated your XML file, you can further customize
-it in the XML editor.</p>
-<p>The following instructions were written for the
-Resource perspective, but they will also work in many other perspectives.</p>
-<p>To
-generate an XML file from a schema file follow these steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Navigator view, right-click the XML schema file that you
-want to work with and select <span class="menucascade"><span class="uicontrol">Generate</span>
- &gt; <span class="uicontrol">XML File</span></span>.</span></li>
-
-<li class="stepexpand"><span>Select a project or folder to contain the XML file and type a name
-for the file in the <span class="uicontrol">File Name</span> field, then click <span class="uicontrol">Next</span>.</span>
- The name of the file must end in <kbd class="userinput">.xml</kbd>.
-</li>
-
-<li class="stepexpand"><span>Select the <span class="uicontrol">Root element</span> of the XML file.</span>
- The root element of an XML file is the element that contains all other
-elements in that file. All of the global elements you have defined in the
-XML schema will be included in the Root element list. If you do not have any
-global elements in your XML schema, you cannot create an XML file from it.
-</li>
-
-<li class="stepexpand"><span>Select from the following content options:</span>
-<ul>
-<li><span class="uicontrol">Create optional attributes</span>: both mandatory
-and optional attributes will be generated.</li>
-
-<li><span class="uicontrol">Create optional elements</span>: both mandatory and
-optional elements will be generated.</li>
-
-<li><span class="uicontrol">Create first choice of required choice</span>: the
-first option of a required choice will be generated in your XML file.</li>
-
-<li><span class="uicontrol">Fill elements and attributes with data</span>: any
-elements and attributes generated will be filled with sample data.</li>
-
-</ul>
-
- If you do not select any of these options, then only the minimum amount
-of content required for the XML file will be created.</li>
-
-<li class="stepexpand"><span>The Namespace Information section contains information about the
-target namespace of the XML schema, its prefix, and the schema location. Select
-the entry you want to edit and click <span class="uicontrol">Edit</span>.</span> <ul>
-<li>The value in the <span class="uicontrol">Namespace Name</span> field is the target
-namespace of the XML schema. Your XML file should be associated with the same
-namespace as its XML schema is associated with.</li>
-
-<li>All qualified elements and attributes in the XML file associated with
-the namespace will be prefixed with the <span class="uicontrol">Prefix</span> value.</li>
-
-<li>The <span class="uicontrol">Location Hint</span> field contains the location
-of the XML schema.</li>
-
-</ul>
-For more information about namespaces and namespace prefixes, refer to
-the related references.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> and then <span class="uicontrol">Finish</span>.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>The XML file will contain the selected root element and any elements
-or attributes contained in the root element. It also contains information
-about the XML file namespace and location. You can now add elements and attributes
-to the XML file.</p>
-<div class="note"><span class="notetitle">Note:</span> In certain cases, when an XML file is generated
-from a complex XML schema file, the XML file might not be valid. If this occurs,
-you can open the generated file in the XML editor and correct any errors that
-occur. Usually, only a few errors need to be fixed. The following XML schema
-constructs might present problems:</div>
-<ul>
-<li>Restrictions: sometimes restricted elements are erroneously generated. </li>
-
-<li>Facets: default generated data values might not conform to complex facets
-(for example, patterns).</li>
-
-<li>Abstract elements: abstract elements are sometimes erroneously generated.</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcretxml.html" title="You can create a new XML file which you can then edit in the XML editor. You create a new XML file that is not associated with a DTD or XML schema file, so there are no restrictions on the kind of content it can contain.">Creating XML files</a></div>
-<div><a href="../topics/tcrexdtd.html" title="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD.">Generating XML files from DTDs</a></div>
-<div><a href="../topics/txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-</div>
-<div class="relinfo"><strong>Related information</strong><br />
-<div><a href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.dita
deleted file mode 100644
index c3d43ce9f0..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.dita
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tedtcnst" xml:lang="en-us">
-<title>Editing with DTD or XML schema constraints</title>
-<titlealts>
-<searchtitle>Editing with DTD or XML schema constraints</searchtitle>
-</titlealts>
-<shortdesc>In the Design view, when you edit an XML file that has a set of
-constraints or rules defined by a DTD or an XML schema, you can turn the constraints
-on and off to provide flexibility in the way you edit, but still maintain
-the validity of the document periodically.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>editing with constraints</indexterm></indexterm>
-<indexterm>XML files<indexterm>editing with constraints</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p> When the constraints are turned on, and you are working in the
-Design view, the XML editor prevents you from inserting elements, attributes,
-or attribute values not permitted by the rules of the XML schema or DTD, and
-from removing necessary or predefined sets of tags and values. In this mode,
-an element's content must be valid to use the XML editor's guided editing
-options.</p><p>You might want to turn the constraints off for an XML file
-if you need more flexibility. For example, you want to try working with elements
-or attributes not permitted by the associated DTD or XML schema, without actually
-removing the association with the DTD or XML schema.</p><p>To turn the constraints
-for an XML file off, click <menucascade><uicontrol>XML</uicontrol><uicontrol>Turn
-Grammar Constraints Off</uicontrol></menucascade> in the toolbar. After you
-have turned the constraints off for a file, you can insert or delete any element
-or attribute regardless of the DTD or XML schema rules. You can create new
-elements or attributes that are not in the DTD or schema - these Design view
-prompts will only appear when you have turned constraints off. The file might
-not be valid, however, if you do this. </p><p>The following example shows
-what you can do if you turn the constraints of a DTD off:</p></context>
-<steps>
-<step><cmd>Open the XML file in the XML editor (right-click the file in the
-Navigator view and click <uicontrol>Open With > XML Editor</uicontrol>). </cmd>
-</step>
-<step><cmd>You have a DTD that specifies that an element requires at least
-one of a specific child element: </cmd><info><codeblock>&lt;!ELEMENT parentElement (childElement+)>
-</codeblock></info></step>
-<step><cmd>If, in an XML file associated with your DTD, you attempt to remove
-the final child element of the element with the DTD constraints turned on,
-the editor will not allow you to do this, as it will make the document invalid.</cmd>
-<info>You can confirm this by using the element's pop-up menu to verify that
-the <uicontrol>Remove</uicontrol> option is grayed out.</info></step>
-<step><cmd>To turn the DTD constraints off, click <uicontrol>XML > Turn Grammar
-Constraints Off</uicontrol>. </cmd></step>
-<step><cmd>If you attempt to remove the same child element with constraints
-off, the editor will allow you to.</cmd></step>
-<step><cmd>To correct the invalid document, you will have to re-add the necessary
-element, or remove the invalid tagging or value.</cmd></step>
-</steps>
-<result><?Pub Caret?><p>If you introduce errors into your files, you must
-save and validate the file in order to see a list of the errors you have introduced.
-They will be listed in the Problems view. After you fix the errors, you must
-save and validate your file again to see if the file is now valid.</p><p>These
-instructions were written for the Resource perspective, but they will also
-work in many other perspectives.</p></result>
-</taskbody>
-</task>
-<?Pub *0000003814?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html
deleted file mode 100644
index 1693ebcd79..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing with DTD or XML schema constraints" />
-<meta name="abstract" content="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically." />
-<meta name="description" content="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically." />
-<meta content="XML editor, editing with constraints, XML files" name="DC.subject" />
-<meta content="XML editor, editing with constraints, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtcnst" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing with DTD or XML schema constraints</title>
-</head>
-<body id="tedtcnst"><a name="tedtcnst"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing with DTD or XML schema constraints</h1>
-
-
-
-
-<div><p>In the Design view, when you edit an XML file that has a set of
-constraints or rules defined by a DTD or an XML schema, you can turn the constraints
-on and off to provide flexibility in the way you edit, but still maintain
-the validity of the document periodically.</p>
-
-<div class="section"><p> When the constraints are turned on, and you are working in the
-Design view, the XML editor prevents you from inserting elements, attributes,
-or attribute values not permitted by the rules of the XML schema or DTD, and
-from removing necessary or predefined sets of tags and values. In this mode,
-an element's content must be valid to use the XML editor's guided editing
-options.</p>
-<p>You might want to turn the constraints off for an XML file
-if you need more flexibility. For example, you want to try working with elements
-or attributes not permitted by the associated DTD or XML schema, without actually
-removing the association with the DTD or XML schema.</p>
-<p>To turn the constraints
-for an XML file off, click <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">Turn
-Grammar Constraints Off</span></span> in the toolbar. After you
-have turned the constraints off for a file, you can insert or delete any element
-or attribute regardless of the DTD or XML schema rules. You can create new
-elements or attributes that are not in the DTD or schema - these Design view
-prompts will only appear when you have turned constraints off. The file might
-not be valid, however, if you do this. </p>
-<p>The following example shows
-what you can do if you turn the constraints of a DTD off:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open the XML file in the XML editor (right-click the file in the
-Navigator view and click <span class="uicontrol">Open With &gt; XML Editor</span>). </span>
-</li>
-
-<li class="stepexpand"><span>You have a DTD that specifies that an element requires at least
-one of a specific child element: </span> <pre>&lt;!ELEMENT parentElement (childElement+)&gt;
-</pre>
-</li>
-
-<li class="stepexpand"><span>If, in an XML file associated with your DTD, you attempt to remove
-the final child element of the element with the DTD constraints turned on,
-the editor will not allow you to do this, as it will make the document invalid.</span>
- You can confirm this by using the element's pop-up menu to verify that
-the <span class="uicontrol">Remove</span> option is grayed out.</li>
-
-<li class="stepexpand"><span>To turn the DTD constraints off, click <span class="uicontrol">XML &gt; Turn Grammar
-Constraints Off</span>. </span></li>
-
-<li class="stepexpand"><span>If you attempt to remove the same child element with constraints
-off, the editor will allow you to.</span></li>
-
-<li class="stepexpand"><span>To correct the invalid document, you will have to re-add the necessary
-element, or remove the invalid tagging or value.</span></li>
-
-</ol>
-
-<div class="section"><p>If you introduce errors into your files, you must
-save and validate the file in order to see a list of the errors you have introduced.
-They will be listed in the Problems view. After you fix the errors, you must
-save and validate your file again to see if the file is now valid.</p>
-<p>These
-instructions were written for the Resource perspective, but they will also
-work in many other perspectives.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
-<div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita
deleted file mode 100644
index aec0531b55..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tedtdoc" xml:lang="en-us">
-<title>Editing DOCTYPE declarations</title>
-<titlealts>
-<searchtitle>Editing DOCTYPE declarations</searchtitle>
-</titlealts>
-<shortdesc>The DOCTYPE declaration in an XML file is used at the beginning
-of it to associate it with a DTD file. You can edit your DOCTYPE declaration
-to change the DTD file your XML file is associated with.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>DOCTYPE declarations<indexterm>XML editor</indexterm></indexterm>
-<indexterm>XML editor<indexterm>DOCTYPE declarations</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To edit your DOCTYPE
-declaration, complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Design view of the XML editor, right-click <uicontrol>DOCTYPE</uicontrol> and
-click <uicontrol>Edit DOCTYPE</uicontrol>.</cmd></step>
-<step><cmd>The value in the <uicontrol>Root element name</uicontrol> field
-should match the root element of your XML file exactly.</cmd><info>You should
-only edit the value in this field if your root element changes.</info></step>
-<step><cmd>You can select a Public ID for any existing XML Catalog entries
-by clicking <uicontrol>Browse</uicontrol>. </cmd><info>The value in the <uicontrol>Public
-ID</uicontrol> field is the Public Identifier. It is used to associate the
-XML file (using an XML Catalog entry) with a DTD file. For more information,
-see <xref format="dita" href="txmlcat.dita" scope="local">Adding entries to
-the XML Catalog</xref>.</info></step>
-<step><cmd>The value in the <uicontrol>System ID</uicontrol> field is the
-DTD the XML file is associated with. Type the path of the DTD file (or browse
-for it) you want the XML file associated with in this field. </cmd><info> <note>When
-the XML file is processed by the XML processor, it will first try to use the
-Public ID to locate the DTD, and if this fails, it will use the System ID
-to find it.</note></info></step>
-<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
-</steps>
-<postreq>If you do not have a DOCTYPE declaration in your XML file, you can
-right-click in the Design view and click <uicontrol>Add DTD Information</uicontrol> to
-add one.</postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html
deleted file mode 100644
index 7949292afc..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing DOCTYPE declarations" />
-<meta name="abstract" content="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with." />
-<meta name="description" content="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with." />
-<meta content="DOCTYPE declarations, XML editor" name="DC.subject" />
-<meta content="DOCTYPE declarations, XML editor" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtdoc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing DOCTYPE declarations</title>
-</head>
-<body id="tedtdoc"><a name="tedtdoc"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing DOCTYPE declarations</h1>
-
-
-
-
-<div><p>The DOCTYPE declaration in an XML file is used at the beginning
-of it to associate it with a DTD file. You can edit your DOCTYPE declaration
-to change the DTD file your XML file is associated with.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To edit your DOCTYPE
-declaration, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view of the XML editor, right-click <span class="uicontrol">DOCTYPE</span> and
-click <span class="uicontrol">Edit DOCTYPE</span>.</span></li>
-
-<li class="stepexpand"><span>The value in the <span class="uicontrol">Root element name</span> field
-should match the root element of your XML file exactly.</span> You should
-only edit the value in this field if your root element changes.</li>
-
-<li class="stepexpand"><span>You can select a Public ID for any existing XML Catalog entries
-by clicking <span class="uicontrol">Browse</span>. </span> The value in the <span class="uicontrol">Public
-ID</span> field is the Public Identifier. It is used to associate the
-XML file (using an XML Catalog entry) with a DTD file. For more information,
-see <a href="txmlcat.html">Adding entries to the XML Catalog</a>.</li>
-
-<li class="stepexpand"><span>The value in the <span class="uicontrol">System ID</span> field is the
-DTD the XML file is associated with. Type the path of the DTD file (or browse
-for it) you want the XML file associated with in this field. </span> <div class="note"><span class="notetitle">Note:</span> When
-the XML file is processed by the XML processor, it will first try to use the
-Public ID to locate the DTD, and if this fails, it will use the System ID
-to find it.</div>
-</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
-
-</ol>
-
-<div class="section">If you do not have a DOCTYPE declaration in your XML file, you can
-right-click in the Design view and click <span class="uicontrol">Add DTD Information</span> to
-add one.</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
-<div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.dita
deleted file mode 100644
index acbee1d906..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.dita
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="tedtenc" xml:lang="en-us">
-<title>Specifying XML default encoding line delimiters</title>
-<titlealts>
-<searchtitle>Specifying line delimiters</searchtitle>
-</titlealts>
-<shortdesc>This page lets you specify the line delimiter and the text encoding
-that will be used when you create or save an XML related file.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML files<indexterm>specifying line delimiters</indexterm></indexterm>
-<indexterm>line delimiters<indexterm>XML files</indexterm></indexterm></keywords>
-<keywords></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To specify the line delimiter you want to use, complete the following
-steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files</uicontrol></menucascade>.</cmd></step>
-<step><cmd>From the <uicontrol>Encoding</uicontrol> field, specify the default
-character encoding set that is used when creating XML related files (DTDs,
-XML files, XML schemas). Changing the encoding causes any new, XML related
-files that are created from scratch to use the selected encoding.</cmd></step>
-<step><cmd>Select <menucascade><uicontrol>General</uicontrol><uicontrol>Workspace</uicontrol>
-</menucascade> in the left pane of the Preferences window and chose either <uicontrol>Default</uicontrol> or <uicontrol>Other</uicontrol> in
-the <uicontrol>New text file line delimiter </uicontrol>section. Select the
-operating system that applies to your development or deployment platform from
-the <uicontrol>Other</uicontrol> drop down list.</cmd></step><?Pub Caret?>
-<step><cmd>Click <uicontrol>Apply</uicontrol>, then <uicontrol>OK</uicontrol>.</cmd>
-</step>
-</steps>
-<result></result>
-</taskbody>
-</task>
-<?Pub *0000002002?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html
deleted file mode 100644
index 3030782aea..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Specifying XML default encoding line delimiters" />
-<meta name="abstract" content="This page lets you specify the line delimiter and the text encoding that will be used when you create or save an XML related file." />
-<meta name="description" content="This page lets you specify the line delimiter and the text encoding that will be used when you create or save an XML related file." />
-<meta content="XML files, specifying line delimiters, line delimiters" name="DC.subject" />
-<meta content="XML files, specifying line delimiters, line delimiters" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtenc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Specifying line delimiters</title>
-</head>
-<body id="tedtenc"><a name="tedtenc"><!-- --></a>
-
-
-<h1 class="topictitle1">Specifying XML default encoding line delimiters</h1>
-
-
-
-
-<div><p>This page lets you specify the line delimiter and the text encoding
-that will be used when you create or save an XML related file.</p>
-
-<div class="section"><p>To specify the line delimiter you want to use, complete the following
-steps:</p>
-</div>
-
-<ol>
-<li><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files</span></span>.</span></li>
-
-<li><span>From the <span class="uicontrol">Encoding</span> field, specify the default
-character encoding set that is used when creating XML related files (DTDs,
-XML files, XML schemas). Changing the encoding causes any new, XML related
-files that are created from scratch to use the selected encoding.</span></li>
-
-<li><span>Select <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">Workspace</span>
-</span> in the left pane of the Preferences window and chose either <span class="uicontrol">Default</span> or <span class="uicontrol">Other</span> in
-the <span class="uicontrol">New text file line delimiter </span>section. Select the
-operating system that applies to your development or deployment platform from
-the <span class="uicontrol">Other</span> drop down list.</span></li>
-
-<li><span>Click <span class="uicontrol">Apply</span>, then <span class="uicontrol">OK</span>.</span>
-</li>
-
-</ol>
-
-<div class="section" />
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.dita
deleted file mode 100644
index 978815ca5c..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.dita
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tedtgram" xml:lang="en-us">
-<title>Updating XML files with changes made to DTDs and schemas</title>
-<titlealts>
-<searchtitle>Updating XML files with changes made to DTDs and schemas</searchtitle>
-</titlealts>
-<shortdesc>If you make changes to a DTD file or XML schema associated with
-an XML file (that is currently open), click <uicontrol>XML > Reload Dependencies</uicontrol> to
-update the XML file with these changes. The changes will be reflected in the
-guided editing mechanisms available in the editor, such as content assist.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>updating XML files</indexterm></indexterm>
-<indexterm>XML files<indexterm>updating with associated changes</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>For example, you have a DTD file called "Contact.dtd" and an XML
-file called "Contact.xml" associated with it. Contact.dtd contains a root
-element called <userinput>Contact</userinput> that can contain any of the
-following children elements: <userinput>Name</userinput>, <userinput>PostalAddress</userinput>,<?Pub Caret?> <userinput>Email</userinput>.
-If you remove the child element <userinput>Email</userinput> from the DTD,
-you will no longer be able to add an <userinput>Email</userinput> child element
-to your root element Contact in your Contact.xml file. This change, however,
-will not come into effect until you save your changes in the DTD and click <uicontrol>XML
-> Reload Dependencies</uicontrol> in the XML editor. Until you click it, you
-will still be able to add <userinput>Email</userinput> elements to Contact.xml.</p><p>This
-feature is very handy when you are making updates to both DTDs and XML schemas
-and XML files that are associated with DTDs and XML schemas.</p></context>
-</taskbody>
-</task>
-<?Pub *0000001987?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html
deleted file mode 100644
index 944a11606f..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Updating XML files with changes made to DTDs and schemas" />
-<meta name="abstract" content="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist." />
-<meta name="description" content="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist." />
-<meta content="XML editor, updating XML files, XML files, updating with associated changes" name="DC.subject" />
-<meta content="XML editor, updating XML files, XML files, updating with associated changes" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtgram" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Updating XML files with changes made to DTDs and schemas</title>
-</head>
-<body id="tedtgram"><a name="tedtgram"><!-- --></a>
-
-
-<h1 class="topictitle1">Updating XML files with changes made to DTDs and schemas</h1>
-
-
-
-
-<div><p>If you make changes to a DTD file or XML schema associated with
-an XML file (that is currently open), click <span class="uicontrol">XML &gt; Reload Dependencies</span> to
-update the XML file with these changes. The changes will be reflected in the
-guided editing mechanisms available in the editor, such as content assist.</p>
-
-<div class="section"><p>For example, you have a DTD file called "Contact.dtd" and an XML
-file called "Contact.xml" associated with it. Contact.dtd contains a root
-element called <kbd class="userinput">Contact</kbd> that can contain any of the
-following children elements: <kbd class="userinput">Name</kbd>, <kbd class="userinput">PostalAddress</kbd>, <kbd class="userinput">Email</kbd>.
-If you remove the child element <kbd class="userinput">Email</kbd> from the DTD,
-you will no longer be able to add an <kbd class="userinput">Email</kbd> child element
-to your root element Contact in your Contact.xml file. This change, however,
-will not come into effect until you save your changes in the DTD and click <span class="uicontrol">XML
-&gt; Reload Dependencies</span> in the XML editor. Until you click it, you
-will still be able to add <kbd class="userinput">Email</kbd> elements to Contact.xml.</p>
-<p>This
-feature is very handy when you are making updates to both DTDs and XML schemas
-and XML files that are associated with DTDs and XML schemas.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
-<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.dita
deleted file mode 100644
index 1799d1146b..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tedtproc" xml:lang="en-us">
-<title>Editing XML processing instructions</title>
-<titlealts>
-<searchtitle>Editing XML processing instructions</searchtitle>
-</titlealts>
-<shortdesc>If you have instructions you want to send to an application using
-an XML document, you can use a processing instruction. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>processing instructions</indexterm></indexterm>
-<indexterm>XML files<indexterm>processing instructions</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To create a new processing instruction, right-click in the Design
-view, and click <uicontrol>Add Child</uicontrol>, <uicontrol>Add Before</uicontrol> or <uicontrol>Add
-After</uicontrol>, then click <uicontrol>Add Processing Instruction</uicontrol>.</p><p>To
-edit a processing instruction in the XML editor Design view, right-click your
-processing instruction, and click <uicontrol>Edit Processing Instruction</uicontrol>.
-You can change the values in the following fields:</p><ul>
-<li>The <uicontrol>Target</uicontrol> field is used to identify the application
-the instructions belongs to.</li>
-<li>The <uicontrol>Data</uicontrol> field contains the instructions.</li>
-</ul></context>
-<postreq>Click <uicontrol>OK</uicontrol> to save your settings.<note>These<?Pub Caret?>
-instructions were written for the Resource perspective, but they will also
-work in many other perspectives.</note></postreq>
-</taskbody>
-</task>
-<?Pub *0000001650?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html
deleted file mode 100644
index ce8da6f2c4..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing XML processing instructions" />
-<meta name="abstract" content="If you have instructions you want to send to an application using an XML document, you can use a processing instruction." />
-<meta name="description" content="If you have instructions you want to send to an application using an XML document, you can use a processing instruction." />
-<meta content="XML editor, processing instructions, XML files" name="DC.subject" />
-<meta content="XML editor, processing instructions, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtproc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing XML processing instructions</title>
-</head>
-<body id="tedtproc"><a name="tedtproc"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing XML processing instructions</h1>
-
-
-
-
-<div><p>If you have instructions you want to send to an application using
-an XML document, you can use a processing instruction. </p>
-
-<div class="section"><p>To create a new processing instruction, right-click in the Design
-view, and click <span class="uicontrol">Add Child</span>, <span class="uicontrol">Add Before</span> or <span class="uicontrol">Add
-After</span>, then click <span class="uicontrol">Add Processing Instruction</span>.</p>
-<p>To
-edit a processing instruction in the XML editor Design view, right-click your
-processing instruction, and click <span class="uicontrol">Edit Processing Instruction</span>.
-You can change the values in the following fields:</p>
-<ul>
-<li>The <span class="uicontrol">Target</span> field is used to identify the application
-the instructions belongs to.</li>
-
-<li>The <span class="uicontrol">Data</span> field contains the instructions.</li>
-
-</ul>
-</div>
-
-<div class="section">Click <span class="uicontrol">OK</span> to save your settings.<div class="note"><span class="notetitle">Note:</span> These
-instructions were written for the Resource perspective, but they will also
-work in many other perspectives.</div>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita
deleted file mode 100644
index fbc70c96fb..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<task id="tedtsch" xml:lang="en-us">
-<title>Editing namespace information</title>
-<titlealts>
-<searchtitle>Editing namespace information</searchtitle>
-</titlealts>
-<shortdesc>Your namespace information is used to provide various information
-about the XML file, such as the XML schema and namespace it is associated
-with. If desired, you can change the schema and namespace your XML
-file is associated with or add a new association. Modifying any associations
-can impact what content is allowed in the XML file.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>namespace information</indexterm></indexterm>
-<indexterm>XML files<indexterm>namespace information</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-edit your schema information, complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Design view of the XML editor, right-click your
-root element and click <uicontrol>Edit Namespaces</uicontrol>.</cmd>
-</step>
-<step><cmd>Your XML file can be associated with more than one namespace
-or schema.</cmd><info>Select the entry you want to edit and click <uicontrol>Edit</uicontrol>.</info>
-</step>
-<step><cmd>The value in the <uicontrol>Namespace Name</uicontrol> field
-is a namespace the XML file is associated with.</cmd><info>Your XML
-file should be associated with the same namespace(s) its XML schema
-is associated with. For more information about namespaces, refer to
-the related reference. For more information, see <xref
-href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita"
-scope="peer">XML namespaces</xref>.</info></step>
-<step><cmd>All qualified elements and attributes in the XM<?Pub Caret?>L
-file associated with the namespace will be prefixed with the <uicontrol>Prefix</uicontrol> value.</cmd>
-</step>
-<step><cmd>The <uicontrol>Location Hint</uicontrol> field contains
-the location of the XML schema the XML file is associated with.</cmd>
-<info>An XML Catalog Key or a namespace name can be specified in this
-field. Click <uicontrol>Browse</uicontrol> to view all XML schemas
-in the workbench and XML Catalog.</info></step>
-<step><cmd>Click <uicontrol>OK</uicontrol>, then click <uicontrol>OK</uicontrol> again.</cmd>
-</step>
-</steps>
-<result><p>If you want to create a new association, click <uicontrol>Add</uicontrol> instead
-of <uicontrol>Edit</uicontrol>. You can then either select the <uicontrol>Specify
-From Registered Namespace</uicontrol> radio button and select the
-namespace declarations you want to add or select the <uicontrol>Specify
-New Namespace</uicontrol> radio button and fill in the fields as necessary.</p></result>
-<postreq>If you do not have namespace information in your XML file,
-you can right-click your root element in the Design view and click <uicontrol>Edit
-Namespaces</uicontrol> to add it. If you do not have a root element,
-you must create one before you can add the namespace information.</postreq>
-</taskbody>
-</task>
-<?Pub *0000003288?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html
deleted file mode 100644
index ffd87437a2..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing namespace information" />
-<meta name="abstract" content="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file." />
-<meta name="description" content="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file." />
-<meta content="XML editor, namespace information, XML files" name="DC.subject" />
-<meta content="XML editor, namespace information, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtsch" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing namespace information</title>
-</head>
-<body id="tedtsch"><a name="tedtsch"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing namespace information</h1>
-
-
-
-
-<div><p>Your namespace information is used to provide various information
-about the XML file, such as the XML schema and namespace it is associated
-with. If desired, you can change the schema and namespace your XML
-file is associated with or add a new association. Modifying any associations
-can impact what content is allowed in the XML file.</p>
-
-<div class="section"><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-edit your schema information, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view of the XML editor, right-click your
-root element and click <span class="uicontrol">Edit Namespaces</span>.</span>
-</li>
-
-<li class="stepexpand"><span>Your XML file can be associated with more than one namespace
-or schema.</span> Select the entry you want to edit and click <span class="uicontrol">Edit</span>.
-</li>
-
-<li class="stepexpand"><span>The value in the <span class="uicontrol">Namespace Name</span> field
-is a namespace the XML file is associated with.</span> Your XML
-file should be associated with the same namespace(s) its XML schema
-is associated with. For more information about namespaces, refer to
-the related reference. For more information, see <a href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html">XML namespaces</a>.</li>
-
-<li class="stepexpand"><span>All qualified elements and attributes in the XML
-file associated with the namespace will be prefixed with the <span class="uicontrol">Prefix</span> value.</span>
-</li>
-
-<li class="stepexpand"><span>The <span class="uicontrol">Location Hint</span> field contains
-the location of the XML schema the XML file is associated with.</span>
- An XML Catalog Key or a namespace name can be specified in this
-field. Click <span class="uicontrol">Browse</span> to view all XML schemas
-in the workbench and XML Catalog.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>, then click <span class="uicontrol">OK</span> again.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>If you want to create a new association, click <span class="uicontrol">Add</span> instead
-of <span class="uicontrol">Edit</span>. You can then either select the <span class="uicontrol">Specify
-From Registered Namespace</span> radio button and select the
-namespace declarations you want to add or select the <span class="uicontrol">Specify
-New Namespace</span> radio button and fill in the fields as necessary.</p>
-</div>
-
-<div class="section">If you do not have namespace information in your XML file,
-you can right-click your root element in the Design view and click <span class="uicontrol">Edit
-Namespaces</span> to add it. If you do not have a root element,
-you must create one before you can add the namespace information.</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
-<div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-</div>
-<div class="relinfo"><strong>Related information</strong><br />
-<div><a href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.dita
deleted file mode 100644
index 00b8f28526..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.dita
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="xmlsourcesuggestionstrategy" xml:lang="en-us">
-<title>Setting the XML source suggestion strategy used by content assist</title>
-<shortdesc>You can customize the formatting of the suggestions given by content
-assist by choosing a suggestion strategy preference. When the suggestion strategy
-is set to Strict, suggestions that are grammatically valid will be displayed
-first in the list of options and highlighted by bold icons. Other suggestions
-that are applicable to this element's scope but are not grammatically valid
-will be displayed lower in the list with de-emphasized icons. When the suggestion
-strategy is set to Lax, all suggestions will displayed in the list with de-emphasized
-icons.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>source suggestion strategy</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>To set the suggestion strategy used by content assist, complete the
-following steps:</context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files</uicontrol><uicontrol>Editor</uicontrol></menucascade></cmd></step>
-<step><cmd>Beside <uicontrol>Suggestion strategy</uicontrol> in the Content
-assist section, select the appropriate setting (Strict or Lax).</cmd></step><?Pub Caret?>
-<step><cmd>Click <uicontrol>Apply</uicontrol>, then <uicontrol>OK</uicontrol> to
-save your settings</cmd></step>
-</steps>
-<example><p>The following screen capture demonstrates content assist with
-the suggestion strategy set to "Strict":</p><image href="../images/suggestion.gif"
-placement="break"><alt>Example of Strict Suggestion Strategy</alt></image></example>
-</taskbody>
-</task>
-<?Pub *0000001950?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html
deleted file mode 100644
index 2b1624d1a0..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting the XML source suggestion strategy used by content assist" />
-<meta name="abstract" content="You can customize the formatting of the suggestions given by content assist by choosing a suggestion strategy preference. When the suggestion strategy is set to Strict, suggestions that are grammatically valid will be displayed first in the list of options and highlighted by bold icons. Other suggestions that are applicable to this element's scope but are not grammatically valid will be displayed lower in the list with de-emphasized icons. When the suggestion strategy is set to Lax, all suggestions will displayed in the list with de-emphasized icons." />
-<meta name="description" content="You can customize the formatting of the suggestions given by content assist by choosing a suggestion strategy preference. When the suggestion strategy is set to Strict, suggestions that are grammatically valid will be displayed first in the list of options and highlighted by bold icons. Other suggestions that are applicable to this element's scope but are not grammatically valid will be displayed lower in the list with de-emphasized icons. When the suggestion strategy is set to Lax, all suggestions will displayed in the list with de-emphasized icons." />
-<meta content="XML editor, source suggestion strategy" name="DC.subject" />
-<meta content="XML editor, source suggestion strategy" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="xmlsourcesuggestionstrategy" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting the XML source suggestion strategy used by content assist</title>
-</head>
-<body id="xmlsourcesuggestionstrategy"><a name="xmlsourcesuggestionstrategy"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting the XML source suggestion strategy used by content assist</h1>
-
-
-
-<div><p>You can customize the formatting of the suggestions given by content
-assist by choosing a suggestion strategy preference. When the suggestion strategy
-is set to Strict, suggestions that are grammatically valid will be displayed
-first in the list of options and highlighted by bold icons. Other suggestions
-that are applicable to this element's scope but are not grammatically valid
-will be displayed lower in the list with de-emphasized icons. When the suggestion
-strategy is set to Lax, all suggestions will displayed in the list with de-emphasized
-icons.</p>
-
-<div class="section">To set the suggestion strategy used by content assist, complete the
-following steps:</div>
-
-<ol>
-<li><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files</span> &gt; <span class="uicontrol">Editor</span></span></span></li>
-
-<li><span>Beside <span class="uicontrol">Suggestion strategy</span> in the Content
-assist section, select the appropriate setting (Strict or Lax).</span></li>
-
-<li><span>Click <span class="uicontrol">Apply</span>, then <span class="uicontrol">OK</span> to
-save your settings</span></li>
-
-</ol>
-
-<div class="example"><p>The following screen capture demonstrates content assist with
-the suggestion strategy set to "Strict":</p>
-<br /><img src="../images/suggestion.gif" alt="Example of Strict Suggestion Strategy" /><br /></div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/twcdast.html" title="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.">Using XML content assist</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.dita
deleted file mode 100644
index 85a8914a46..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="ttaghilt" xml:lang="en-us">
-<title>Setting source highlighting styles</title>
-<titlealts>
-<searchtitle>Setting source highlighting styles</searchtitle>
-</titlealts>
-<shortdesc>If desired, you can change various aspects of how the XML source
-code is displayed in the Source view of the XML editor, such as the colors
-the tags will be displayed in.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>setting source highlighting styles</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To set highlighting styles for the XML code, complete the following
-steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files</uicontrol><uicontrol> Syntax Coloring</uicontrol></menucascade>.</cmd>
-</step>
-<step><cmd>In the <uicontrol>Syntax Element</uicontrol> list, select the source
-tag type that you wish to set a highlighting style for. You can also click
-text in the <uicontrol>Sample text</uicontrol> box to specify the source tag
-type that you wish to set a highlighting style for.</cmd></step>
-<step><cmd>Click the <uicontrol>Foreground</uicontrol> box, select the color
-that you want the text of the tag to appear in, and click <uicontrol>OK</uicontrol>.</cmd>
-</step>
-<step><cmd>Click the <uicontrol>Background</uicontrol> box, select the color
-that you want to appear behind the tag, and click <uicontrol>OK</uicontrol>.</cmd>
-</step>
-<step><cmd>Select the <uicontrol>Bold</uicontrol> check box if you want to
-make the type bold.</cmd></step>
-<step><cmd> </cmd></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> to save your changes.</cmd></step>
-</steps>
-<result>To set the highlight<?Pub Caret?>ing styles back to their default
-values, click <uicontrol>Restore Default</uicontrol>. If you only want to
-reset the value for a particular content type, select it in the <uicontrol>Syntax
-Element</uicontrol> field, then click the <uicontrol>Restore Default</uicontrol> button.</result>
-</taskbody>
-</task>
-<?Pub *0000002290?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html
deleted file mode 100644
index 3b96b1ffd5..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Setting source highlighting styles" />
-<meta name="abstract" content="If desired, you can change various aspects of how the XML source code is displayed in the Source view of the XML editor, such as the colors the tags will be displayed in." />
-<meta name="description" content="If desired, you can change various aspects of how the XML source code is displayed in the Source view of the XML editor, such as the colors the tags will be displayed in." />
-<meta content="XML editor, setting source highlighting styles" name="DC.subject" />
-<meta content="XML editor, setting source highlighting styles" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ttaghilt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Setting source highlighting styles</title>
-</head>
-<body id="ttaghilt"><a name="ttaghilt"><!-- --></a>
-
-
-<h1 class="topictitle1">Setting source highlighting styles</h1>
-
-
-
-
-<div><p>If desired, you can change various aspects of how the XML source
-code is displayed in the Source view of the XML editor, such as the colors
-the tags will be displayed in.</p>
-
-<div class="section"><p>To set highlighting styles for the XML code, complete the following
-steps:</p>
-</div>
-
-<ol>
-<li><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files</span> &gt; <span class="uicontrol"> Syntax Coloring</span></span>.</span>
-</li>
-
-<li><span>In the <span class="uicontrol">Syntax Element</span> list, select the source
-tag type that you wish to set a highlighting style for. You can also click
-text in the <span class="uicontrol">Sample text</span> box to specify the source tag
-type that you wish to set a highlighting style for.</span></li>
-
-<li><span>Click the <span class="uicontrol">Foreground</span> box, select the color
-that you want the text of the tag to appear in, and click <span class="uicontrol">OK</span>.</span>
-</li>
-
-<li><span>Click the <span class="uicontrol">Background</span> box, select the color
-that you want to appear behind the tag, and click <span class="uicontrol">OK</span>.</span>
-</li>
-
-<li><span>Select the <span class="uicontrol">Bold</span> check box if you want to
-make the type bold.</span></li>
-
-<li><span> </span></li>
-
-<li><span>Click <span class="uicontrol">OK</span> to save your changes.</span></li>
-
-</ol>
-
-<div class="section">To set the highlighting styles back to their default
-values, click <span class="uicontrol">Restore Default</span>. If you only want to
-reset the value for a particular content type, select it in the <span class="uicontrol">Syntax
-Element</span> field, then click the <span class="uicontrol">Restore Default</span> button.</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita
deleted file mode 100644
index f29a64ac74..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2009, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="twcdast" xml:lang="en-us">
-<title>Using XML content assist</title>
-<titlealts>
-<searchtitle>Using XML content assist</searchtitle>
-</titlealts>
-<shortdesc>You can use content assist to help you finish a tag or
-line of code in the Source view of the XML editor. You can also use
-content assist to insert templates into your XML code.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>content assist</indexterm></indexterm>
-<indexterm>XML files<indexterm>content assist</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The placement of the cursor in your source file provides
-the context for the content assist to offer suggestions for completion.</p><p>You
-can launch content assist in either of the following ways:</p><ul>
-<li>From the <uicontrol>Edit</uicontrol> menu, click <uicontrol>Content
-Assist</uicontrol>, or</li>
-<li>Press Ctrl+Space</li>
-</ul><p>In addition, you can set up an option that causes content
-assist to pop up automatically when certain characters are typed.
-To set up this option, click <menucascade><uicontrol>Window</uicontrol>
-<uicontrol> Preferences</uicontrol></menucascade> to open the Preferences
-window, then select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files </uicontrol><uicontrol>Editor</uicontrol><uicontrol>Content
-assist</uicontrol></menucascade> . Select the <uicontrol>Automatically
-make suggestions</uicontrol> check box, and supply any additional
-characters that should trigger content assist.</p><p>If your cursor
-is in a position where content assist is available, a pop-up list
-of available choices is displayed when you launch content assist.
-The list is based on the context and whether a DTD or XML schema is
-associated with the XML file being edited. For example, if you have
-an Address element that can contain any of the following children
-elements: Name, Street, City, Zip Code, Country, and Province, and
-you place your cursor after any of them and launch content assist,
-all of the child elements will be listed in the content assist list.</p><p>Content
-assist cycling is available in the XML editor, offering multiple pages
-of content assist. You can set preferences for the proposal categories
-and the cycle order when repeatedly invoking content assist </p><?Pub
-Caret 53?><p>The content assist list displays all valid tags for the
-current cursor position, including templates. If your grammar constraints
-are turned off, all available tags, not just valid ones, are displayed. </p><p>As
-you type the first one or two letters of the tag that you want, the
-list automatically refreshes with alphabetized choices that match
-your input. Scroll down and select the tag that you want to use by
-double-clicking on it.</p><note>The list only refreshes as described
-if you first type <userinput>&lt;</userinput> before prompting for
-content assist.</note></context>
-</taskbody>
-</task>
-<?Pub *0000003092?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html
deleted file mode 100644
index 600d4f746a..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Using XML content assist" />
-<meta name="abstract" content="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code." />
-<meta name="description" content="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code." />
-<meta content="XML editor, content assist, XML files" name="DC.subject" />
-<meta content="XML editor, content assist, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tsugstrat.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twcdast" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Using XML content assist</title>
-</head>
-<body id="twcdast"><a name="twcdast"><!-- --></a>
-
-
-<h1 class="topictitle1">Using XML content assist</h1>
-
-
-
-
-<div><p>You can use content assist to help you finish a tag or
-line of code in the Source view of the XML editor. You can also use
-content assist to insert templates into your XML code.</p>
-
-<div class="section"><p>The placement of the cursor in your source file provides
-the context for the content assist to offer suggestions for completion.</p>
-<p>You
-can launch content assist in either of the following ways:</p>
-<ul>
-<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content
-Assist</span>, or</li>
-
-<li>Press Ctrl+Space</li>
-
-</ul>
-<p>In addition, you can set up an option that causes content
-assist to pop up automatically when certain characters are typed.
-To set up this option, click <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol"> Preferences</span></span> to open the Preferences
-window, then select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files </span> &gt; <span class="uicontrol">Editor</span> &gt; <span class="uicontrol">Content
-assist</span></span> . Select the <span class="uicontrol">Automatically
-make suggestions</span> check box, and supply any additional
-characters that should trigger content assist.</p>
-<p>If your cursor
-is in a position where content assist is available, a pop-up list
-of available choices is displayed when you launch content assist.
-The list is based on the context and whether a DTD or XML schema is
-associated with the XML file being edited. For example, if you have
-an Address element that can contain any of the following children
-elements: Name, Street, City, Zip Code, Country, and Province, and
-you place your cursor after any of them and launch content assist,
-all of the child elements will be listed in the content assist list.</p>
-<p>Content
-assist cycling is available in the XML editor, offering multiple pages
-of content assist. You can set preferences for the proposal categories
-and the cycle order when repeatedly invoking content assist </p>
-<p>The content assist list displays all valid tags for the
-current cursor position, including templates. If your grammar constraints
-are turned off, all available tags, not just valid ones, are displayed. </p>
-<p>As
-you type the first one or two letters of the tag that you want, the
-list automatically refreshes with alphabetized choices that match
-your input. Scroll down and select the tag that you want to use by
-double-clicking on it.</p>
-<div class="note"><span class="notetitle">Note:</span> The list only refreshes as described
-if you first type <kbd class="userinput">&lt;</kbd> before prompting for
-content assist.</div>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-<div><a href="../topics/twmacro.html" title="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.">Working with XML templates</a></div>
-<div><a href="../topics/tsugstrat.html" title="You can customize the formatting of the suggestions given by content assist by choosing a suggestion strategy preference. When the suggestion strategy is set to Strict, suggestions that are grammatically valid will be displayed first in the list of options and highlighted by bold icons. Other suggestions that are applicable to this element's scope but are not grammatically valid will be displayed lower in the list with de-emphasized icons. When the suggestion strategy is set to Lax, all suggestions will displayed in the list with de-emphasized icons.">Setting the XML source suggestion strategy used by content assist</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita
deleted file mode 100644
index 7a1b4c52bd..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twmacro" xml:lang="en-us">
-<title>Working with XML templates</title>
-<titlealts>
-<searchtitle>Working with XML templates</searchtitle>
-</titlealts>
-<shortdesc>XML content assist provides a comment template, a section of predefined
-code that you can insert into a file. You may find a template useful when
-you have a certain piece of code you want to reuse several times, and you
-do not want to write it out every time.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="twmacro|1|XMLtemplatesworkingwithpredefinedcode"
-status="changed">templates<indexterm>working with predefined XML code</indexterm></indexterm>
-</keywords>
-</metadata><metadata>
-<keywords><indexterm keyref="twmacro|10|XMLfilestemplates" status="new">XML
-files<indexterm>templates</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>You can use a default template as provided, customize that template,
-or create your own templates.</p><p>For example, you can work on a group of
-XML pages that should all contain a table with a specific appearance. Create
-a template that contains the tags for that table, including the appropriate
-attributes and attribute values for each tag. (You can copy and paste the
-tags from a structured text editor into the template's <uicontrol>Pattern</uicontrol> field.)
-Then select the name of the template from a content assist proposal list whenever
-you want to insert your custom table into an XML file.</p><p>To create a new
-XML template, complete the following steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files</uicontrol><uicontrol>Templates</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Click <uicontrol>New</uicontrol> if you want to create a completely
-new template.</cmd></step>
-<step><cmd>Supply a new template <uicontrol>Name</uicontrol> and <uicontrol>Description</uicontrol>.</cmd>
-</step>
-<step><cmd>Specify the <uicontrol>Context</uicontrol> for the template.</cmd>
-<info>This is the context in which the template is available in the proposal
-list when content assist is requested. </info></step>
-<step><cmd>Specify the <uicontrol>Pattern</uicontrol> for your template using
-the appropriate tags, attributes, or attribute values to be inserted by content
-assist.</cmd></step>
-<step><cmd>If you want to insert a variable, click the <uicontrol>Insert Variable</uicontrol> button
-and select the variable to be inserted. </cmd><info>For example, the <b>date</b> variable
-indicates the current date will be inserted. </info></step>
-<step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Apply</uicontrol> to
-save your changes.</cmd></step>
-</steps>
-<postreq>You can edit, remove, import, or export a template by using the same
-preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed. <p>If you have a template
-that you do not want to remove but you no longer want it to appear in the
-content assist list, clear its check box in the table on the Templates preferences
-page.</p></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html
deleted file mode 100644
index 73c14fa45f..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Working with XML templates" />
-<meta name="abstract" content="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta name="description" content="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta content="templates, working with predefined XML code, XML files" name="DC.subject" />
-<meta content="templates, working with predefined XML code, XML files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twmacro" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Working with XML templates</title>
-</head>
-<body id="twmacro"><a name="twmacro"><!-- --></a>
-
-
-<h1 class="topictitle1">Working with XML templates</h1>
-
-
-
-
-<div><p>XML content assist provides a comment template, a section of predefined
-code that you can insert into a file. You may find a template useful when
-you have a certain piece of code you want to reuse several times, and you
-do not want to write it out every time.</p>
-
-<div class="section"><p>You can use a default template as provided, customize that template,
-or create your own templates.</p>
-<p>For example, you can work on a group of
-XML pages that should all contain a table with a specific appearance. Create
-a template that contains the tags for that table, including the appropriate
-attributes and attribute values for each tag. (You can copy and paste the
-tags from a structured text editor into the template's <span class="uicontrol">Pattern</span> field.)
-Then select the name of the template from a content assist proposal list whenever
-you want to insert your custom table into an XML file.</p>
-<p>To create a new
-XML template, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files</span> &gt; <span class="uicontrol">Templates</span></span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">New</span> if you want to create a completely
-new template.</span></li>
-
-<li class="stepexpand"><span>Supply a new template <span class="uicontrol">Name</span> and <span class="uicontrol">Description</span>.</span>
-</li>
-
-<li class="stepexpand"><span>Specify the <span class="uicontrol">Context</span> for the template.</span>
- This is the context in which the template is available in the proposal
-list when content assist is requested. </li>
-
-<li class="stepexpand"><span>Specify the <span class="uicontrol">Pattern</span> for your template using
-the appropriate tags, attributes, or attribute values to be inserted by content
-assist.</span></li>
-
-<li class="stepexpand"><span>If you want to insert a variable, click the <span class="uicontrol">Insert Variable</span> button
-and select the variable to be inserted. </span> For example, the <strong>date</strong> variable
-indicates the current date will be inserted. </li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> and then <span class="uicontrol">Apply</span> to
-save your changes.</span></li>
-
-</ol>
-
-<div class="section">You can edit, remove, import, or export a template by using the same
-preferences page. If you have modified a default template, you can restore
-it to its default value. You can also restore a removed template if you have
-not exited from the workbench since it was removed. <p>If you have a template
-that you do not want to remove but you no longer want it to appear in the
-content assist list, clear its check box in the table on the Templates preferences
-page.</p>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-<div><a href="../topics/twcdast.html" title="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.">Using XML content assist</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.dita
deleted file mode 100644
index 1adfec277b..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="twxvalid" xml:lang="en-us">
-<title>Validating XML files</title>
-<titlealts>
-<searchtitle>Validating XML files</searchtitle>
-</titlealts>
-<shortdesc>When you validate your XML file, the XML validator will check to
-see that your file is valid and well-formed.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML files<indexterm>validating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The XML editor will process XML files that are invalid or not
-well-formed. The editor uses heuristics to open a file using the best interpretation
-of the tagging that it can. For example, an element with a missing end tag
-is simply assumed to end at the end of the document. As you make updates to
-a file, the editor incrementally reinterprets your document, changing the
-highlighting, tree view, and so on. Many formation errors are easy to spot
-in the syntax highlighting, so you can easily correct obvious errors on-the-fly.
-However, there will be other cases when it will be beneficial to perform formal
-validation on your documents.</p><p>You can validate your file by selecting
-it in the Navigator view, right-clicking it, and clicking <uicontrol>Validate</uicontrol>.
-Any validation problems are indicated in the Problems view. You can double-click
-on individual errors, and you will be taken to the invalid tag in the file,
-so that you can make corrections.</p></context>
-<postreq><note> If you receive an error message indicating that the Problems
-view is full, you can increase the number of error messages allowed by clicking <menucascade>
-<uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol></menucascade> and
-selecting <menucascade><uicontrol>General</uicontrol><uicontrol>Markers</uicontrol>
-</menucascade>. Select the <uicontrol>Use marker limits</uicontrol> check
-box and change the number in the <uicontrol>Limit visible items per group</uicontrol> <?Pub Caret?>field.</note><p>You
-can set up a project's properties so that different types of project resources
-are automatically validated when you save them. From a project's pop-up menu,
-click <uicontrol>Properties</uicontrol>, then select <uicontrol>Validation</uicontrol>.
-Any validators you can run against your project will be listed in the Validation
-page.</p></postreq>
-</taskbody>
-<related-links>
-<link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita" scope="peer">
-<linktext>Validating code in enterprise applications</linktext></link>
-</related-links>
-</task>
-<?Pub *0000002658?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html
deleted file mode 100644
index c5d3f37bb2..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Validating XML files" />
-<meta name="abstract" content="When you validate your XML file, the XML validator will check to see that your file is valid and well-formed." />
-<meta name="description" content="When you validate your XML file, the XML validator will check to see that your file is valid and well-formed." />
-<meta content="XML files, validating" name="DC.subject" />
-<meta content="XML files, validating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="twxvalid" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Validating XML files</title>
-</head>
-<body id="twxvalid"><a name="twxvalid"><!-- --></a>
-
-
-<h1 class="topictitle1">Validating XML files</h1>
-
-
-
-
-<div><p>When you validate your XML file, the XML validator will check to
-see that your file is valid and well-formed.</p>
-
-<div class="section"><p>The XML editor will process XML files that are invalid or not
-well-formed. The editor uses heuristics to open a file using the best interpretation
-of the tagging that it can. For example, an element with a missing end tag
-is simply assumed to end at the end of the document. As you make updates to
-a file, the editor incrementally reinterprets your document, changing the
-highlighting, tree view, and so on. Many formation errors are easy to spot
-in the syntax highlighting, so you can easily correct obvious errors on-the-fly.
-However, there will be other cases when it will be beneficial to perform formal
-validation on your documents.</p>
-<p>You can validate your file by selecting
-it in the Navigator view, right-clicking it, and clicking <span class="uicontrol">Validate</span>.
-Any validation problems are indicated in the Problems view. You can double-click
-on individual errors, and you will be taken to the invalid tag in the file,
-so that you can make corrections.</p>
-</div>
-
-<div class="section"><div class="note"><span class="notetitle">Note:</span> If you receive an error message indicating that the Problems
-view is full, you can increase the number of error messages allowed by clicking <span class="menucascade">
-<span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span></span> and
-selecting <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span>
-</span>. Select the <span class="uicontrol">Use marker limits</span> check
-box and change the number in the <span class="uicontrol">Limit visible items per group</span> field.</div>
-<p>You
-can set up a project's properties so that different types of project resources
-are automatically validated when you save them. From a project's pop-up menu,
-click <span class="uicontrol">Properties</span>, then select <span class="uicontrol">Validation</span>.
-Any validators you can run against your project will be listed in the Validation
-page.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="relinfo"><strong>Related information</strong><br />
-<div><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html">Validating code in enterprise applications</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita
deleted file mode 100644
index 1de5f51917..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2009, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<task id="txedtdes" xml:lang="en-us">
-<title>Editing in the Design view</title>
-<titlealts>
-<searchtitle>Editing in the Design view</searchtitle>
-</titlealts>
-<shortdesc>The XML editor has a Design view, which represents the
-XML file simultaneously as a table with Node and Content columns and
-a tree. This helps make navigation and editing easier. Content and
-attribute values can be edited directly in the table cells, while
-pop-up menus on the tree elements give alternatives that are valid
-for that particular element.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>Design view</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>For example, the <uicontrol>Add child</uicontrol> menu
-item will list only those elements from a DTD or XML schema which
-would be valid children at that point.</p><p>When you have an XML
-file associated with an XML schema or DTD file, certain tags and rules
-for that file have already been established, which is why the Design
-view can provide prompts (via a pop-up menu) for those tags. When
-you create an XML file that is not associated with an XML schema or
-DTD file, it has no tags or rules associated with it, so the Design
-view cannot provide prompts for specific tags, but it can provide
-prompts to create new elements and attributes.</p><p>For any XML file
-associated with an XML schema or DTD file, you can use the Design
-view to add any items defined in the XML schema or DTD (such as elements
-and attributes) to the XML file. You can also use it to add processing
-instructions and comments to all XML files.</p><p>To open and edit
-a XML file in the XML editor, right-click the file in the Project
-Explorer view and click <uicontrol>Open With > XML Editor</uicontrol>.
-If necessary, click the <uicontrol>Design</uicontrol> tab to open
-the Design view.</p><?Pub Caret 92?><p>To expand all the items in
-your XML file, click the <uicontrol>Expand All</uicontrol> button<image
-href="../images/expand_all.gif"><alt>This graphic is the Expand All
-button</alt></image> on the top right corner of the editor. To collapse
-them, click the <uicontrol>Collapse All</uicontrol> button<image
-href="../images/collapse_all.gif"><alt>This graphic is the Collapse
-All button</alt></image> on the top right corner of the editor.</p><p>If
-you right-click the item that you want to work with, some or all of
-the following options (as applicable) will be available from the pop-up
-menu that appears:</p><table>
-<tgroup cols="2"><colspec colname="col1" colwidth="48*"/><colspec
-colname="col2" colwidth="150*"/>
-<thead>
-<row valign="bottom">
-<entry colname="col1">Select this</entry>
-<entry colname="col2">If you want to do this</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry colname="col1">Add DTD Information</entry>
-<entry colname="col2">Associate the XML file with a DTD.</entry>
-</row>
-<row>
-<entry colname="col1">Edit DOCTYPE</entry>
-<entry colname="col2">Edit the DOCTYPE declaration. Refer to the related
-task for more details. For more information, see <xref format="dita"
-href="tedtdoc.dita" scope="local">Editing DOCTYPE declarations</xref>.</entry>
-</row>
-<row>
-<entry colname="col1">Edit Namespaces</entry>
-<entry colname="col2">Edit the existing namespace information or create
-a new association with a namespace. Refer to the related task for
-more details. For more information, see <xref format="dita"
-href="tedtsch.dita" scope="local">Editing namespace information</xref>.</entry>
-</row>
-<row>
-<entry colname="col1">Edit Processing Instruction</entry>
-<entry colname="col2">Edit the processing instruction. Refer to the
-related task for more details. For more information, see <xref
-format="dita" href="tedtproc.dita" scope="local">Editing XML processing
-instructions</xref>.</entry>
-</row>
-<row>
-<entry colname="col1">Remove</entry>
-<entry colname="col2">Remove the item that you have selected from
-the XML file. If the selected item or related items are defined so
-that the item must exist in the file, this option will not be available.
-For example, in your DTD, if you have declared that "One or more"
-of the item must always exist in your XML file, and the item you have
-selected is the only one that exists in your XML file.</entry>
-</row>
-<row>
-<entry colname="col1">Add Attribute</entry>
-<entry colname="col2">Add an attribute to the element that you selected.
-Any attributes you are allowed to add to the element will be listed.
-After you have added the attribute to the XML file, you can click
-in the right-hand column to change the value of the attribute. If
-the attribute has set values, they will appear in a list.</entry>
-</row>
-<row>
-<entry colname="col1">Add Child</entry>
-<entry colname="col2">Add another element, a comment, or a processing
-instruction as a child of the parent element.</entry>
-</row>
-<row>
-<entry colname="col1">Add Before</entry>
-<entry colname="col2">Add a child element, comment, or processing
-instruction that can go before the item you have selected. For example,
-if you have a parent element called <userinput>CD Collections</userinput> that
-can contain an unlimited amount of children called <userinput>CD</userinput>,
-you could click a <userinput>CD</userinput> element and click <menucascade>
-<uicontrol>Add Before</uicontrol><uicontrol> CD</uicontrol>
-</menucascade> , as a <userinput>CD</userinput> element can go before
-another <userinput>CD</userinput> element.</entry>
-</row>
-<row>
-<entry colname="col1">Add After</entry>
-<entry colname="col2">Add a child element, comment, or processing
-instruction that can go after the item you have selected. For example,
-if you have a parent element called <userinput>CD Collections</userinput> that
-can contain an unlimited amount of children called <userinput>CD</userinput>,
-you could click a <userinput>CD</userinput> element and click <menucascade>
-<uicontrol>Add After</uicontrol><uicontrol> CD</uicontrol></menucascade>,
-as a <userinput>CD</userinput> element can go after another <userinput>CD</userinput> element.</entry>
-</row>
-<row>
-<entry colname="col1">Replace With</entry>
-<entry colname="col2">Replace one item with another. This option is
-not available if you turn grammar constraints off or if there are
-no valid alternatives for you to replace the item with.</entry>
-</row>
-</tbody>
-</tgroup>
-</table></context>
-<result><p>Any changes you make in the Design view are also reflected
-in the Source view and the Outline view.</p><note>These instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</note></result>
-</taskbody>
-</task>
-<?Pub *0000006781?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html
deleted file mode 100644
index 76370eb764..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing in the Design view" />
-<meta name="abstract" content="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
-<meta name="description" content="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
-<meta content="XML editor, Design view" name="DC.subject" />
-<meta content="XML editor, Design view" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtproc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rxmlbicons.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txedtdes" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing in the Design view</title>
-</head>
-<body id="txedtdes"><a name="txedtdes"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing in the Design view</h1>
-
-
-
-
-<div><p>The XML editor has a Design view, which represents the
-XML file simultaneously as a table with Node and Content columns and
-a tree. This helps make navigation and editing easier. Content and
-attribute values can be edited directly in the table cells, while
-pop-up menus on the tree elements give alternatives that are valid
-for that particular element.</p>
-
-<div class="section"><p>For example, the <span class="uicontrol">Add child</span> menu
-item will list only those elements from a DTD or XML schema which
-would be valid children at that point.</p>
-<p>When you have an XML
-file associated with an XML schema or DTD file, certain tags and rules
-for that file have already been established, which is why the Design
-view can provide prompts (via a pop-up menu) for those tags. When
-you create an XML file that is not associated with an XML schema or
-DTD file, it has no tags or rules associated with it, so the Design
-view cannot provide prompts for specific tags, but it can provide
-prompts to create new elements and attributes.</p>
-<p>For any XML file
-associated with an XML schema or DTD file, you can use the Design
-view to add any items defined in the XML schema or DTD (such as elements
-and attributes) to the XML file. You can also use it to add processing
-instructions and comments to all XML files.</p>
-<p>To open and edit
-a XML file in the XML editor, right-click the file in the Project
-Explorer view and click <span class="uicontrol">Open With &gt; XML Editor</span>.
-If necessary, click the <span class="uicontrol">Design</span> tab to open
-the Design view.</p>
-<p>To expand all the items in
-your XML file, click the <span class="uicontrol">Expand All</span> button<img src="../images/expand_all.gif" alt="This graphic is the Expand All&#10;button" /> on the top right corner of the editor. To collapse
-them, click the <span class="uicontrol">Collapse All</span> button<img src="../images/collapse_all.gif" alt="This graphic is the Collapse&#10;All button" /> on the top right corner of the editor.</p>
-<p>If
-you right-click the item that you want to work with, some or all of
-the following options (as applicable) will be available from the pop-up
-menu that appears:</p>
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<thead align="left">
-<tr valign="bottom">
-<th valign="bottom" width="24.242424242424242%" id="N100BF">Select this</th>
-
-<th valign="bottom" width="75.75757575757575%" id="N100C6">If you want to do this</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Add DTD Information</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Associate the XML file with a DTD.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit DOCTYPE</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the DOCTYPE declaration. Refer to the related
-task for more details. For more information, see <a href="tedtdoc.html">Editing DOCTYPE declarations</a>.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit Namespaces</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the existing namespace information or create
-a new association with a namespace. Refer to the related task for
-more details. For more information, see <a href="tedtsch.html">Editing namespace information</a>.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit Processing Instruction</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the processing instruction. Refer to the
-related task for more details. For more information, see <a href="tedtproc.html">Editing XML processing instructions</a>.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Remove</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Remove the item that you have selected from
-the XML file. If the selected item or related items are defined so
-that the item must exist in the file, this option will not be available.
-For example, in your DTD, if you have declared that "One or more"
-of the item must always exist in your XML file, and the item you have
-selected is the only one that exists in your XML file.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Attribute</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add an attribute to the element that you selected.
-Any attributes you are allowed to add to the element will be listed.
-After you have added the attribute to the XML file, you can click
-in the right-hand column to change the value of the attribute. If
-the attribute has set values, they will appear in a list.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Child</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add another element, a comment, or a processing
-instruction as a child of the parent element.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Before</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add a child element, comment, or processing
-instruction that can go before the item you have selected. For example,
-if you have a parent element called <kbd class="userinput">CD Collections</kbd> that
-can contain an unlimited amount of children called <kbd class="userinput">CD</kbd>,
-you could click a <kbd class="userinput">CD</kbd> element and click <span class="menucascade">
-<span class="uicontrol">Add Before</span> &gt; <span class="uicontrol"> CD</span>
-</span> , as a <kbd class="userinput">CD</kbd> element can go before
-another <kbd class="userinput">CD</kbd> element.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Add After</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add a child element, comment, or processing
-instruction that can go after the item you have selected. For example,
-if you have a parent element called <kbd class="userinput">CD Collections</kbd> that
-can contain an unlimited amount of children called <kbd class="userinput">CD</kbd>,
-you could click a <kbd class="userinput">CD</kbd> element and click <span class="menucascade">
-<span class="uicontrol">Add After</span> &gt; <span class="uicontrol"> CD</span></span>,
-as a <kbd class="userinput">CD</kbd> element can go after another <kbd class="userinput">CD</kbd> element.</td>
-
-</tr>
-
-<tr>
-<td valign="top" width="24.242424242424242%" headers="N100BF ">Replace With</td>
-
-<td valign="top" width="75.75757575757575%" headers="N100C6 ">Replace one item with another. This option is
-not available if you turn grammar constraints off or if there are
-no valid alternatives for you to replace the item with.</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-</div>
-
-<div class="section"><p>Any changes you make in the Design view are also reflected
-in the Source view and the Outline view.</p>
-<div class="note"><span class="notetitle">Note:</span> These instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</div>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
-<div><a href="../topics/tedtproc.html" title="If you have instructions you want to send to an application using an XML document, you can use a processing instruction.">Editing XML processing instructions</a></div>
-</div>
-<div class="relref"><strong>Related reference</strong><br />
-<div><a href="../topics/rxmlbicons.html" title="The following XML editor icons appear in the Outline and Design view.">Icons used in the XML editor</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.dita
deleted file mode 100644
index 81a8fac78a..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.dita
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="txedtsrc" xml:lang="en-us">
-<title>Editing in the Source view</title>
-<titlealts>
-<searchtitle>Editing in the Source view</searchtitle>
-</titlealts>
-<shortdesc>You can use the Source view to view and work with a file's source
-code directly.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>Source view</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p> The Source view has many text editing features, such as:</p><dl>
-<dlentry>
-<dt>Syntax highlighting</dt>
-<dd>Each tag type is highlighted differently, enabling you to easily find
-a certain kind of tag for editing. In addition, syntax highlighting is valuable
-in locating syntax errors. For example, if you begin a comment in the middle
-of the document with <codeph>&lt;!--</codeph> everything until the next <codeph>--></codeph> is
-considered a comment, and will be highlighted accordingly. The large highlighted
-area will indicate that you need to add <codeph>--></codeph> to close the
-comment.<p>You can customize the syntax highlighting. Refer to the related
-tasks for more information.</p></dd>
-</dlentry></dl><dl><dlentry>
-<dt>Unlimited undo and redo</dt>
-<dd>These options allow you to incrementally undo and redo every change made
-to a file for the entire editing session. For text, changes are incremented
-one character or set of selected characters at a time.</dd>
-</dlentry><dlentry>
-<dt>Content assist</dt>
-<dd>Content assist helps you finish tags and insert macros. Refer to the related
-task for more details.</dd>
-</dlentry><dlentry>
-<dt>Template</dt>
-<dd>You can access templates (using content assist) to help you quickly add
-regularly-used tagging combinations. Refer to the related task for more details.</dd>
-</dlentry><dlentry>
-<dt>Node selection</dt>
-<dd>Based on the location of your cursor (or selection in the Outline view),
-the node selection indicator highlights the line numbers that include a node
-(for example, an element or attribute), in the vertical ruler in the left
-area of the Source view.</dd>
-</dlentry><dlentry>
-<dt>Pop-up menu options</dt>
-<dd>From the editor's pop-up menu, you have many of the same editing options
-available as you do from the workbench <b>Edit</b> menu. You can select menu
-options such as: <uicontrol>Cleanup Document,</uicontrol> to open the <uicontrol>Cleanup</uicontrol>
-dialog, which contains settings to update a document so that it is well-formed
-and formatted and <uicontrol>Format,</uicontrol> which formats either the
-entire document or selected elements.</dd>
-</dlentry><dlentry>
-<dt>"Smart" double clicking</dt>
-<dd>You can use double-click to select attribute values, attribute-value pairs,
-and entire tag sets to quickly update, copy, or remove content.</dd>
-</dlentry></dl><p>To open an XML file to edit, right-click the file in the
-Navigator view and select <uicontrol>Open With > XML Editor</uicontrol>. Click
-the <uicontrol>Source</uicontrol> to see the Source view.</p><p>Edit the code
-as necessary, using any of the available features. As you move the cursor
-within your XML file (or select items from the Outline view), the node selection
-indicator will highlight the line numbers that encompass the node (for example,
-an element or attribute). You can use smart double-clicking behavior to select
-attribute values, attribute-value pairs, and entire tag sets to quickly update,
-copy, or remove content. <?Pub Caret?>If desired, validate and save the XML
-file.</p></context>
-<result><p>Any changes you make in the Source view are also reflected in the
-Design view and the Outline view.</p></result>
-</taskbody>
-</task>
-<?Pub *0000003781?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html
deleted file mode 100644
index a0839e03f2..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing in the Source view" />
-<meta name="abstract" content="You can use the Source view to view and work with a file's source code directly." />
-<meta name="description" content="You can use the Source view to view and work with a file's source code directly." />
-<meta content="XML editor, Source view" name="DC.subject" />
-<meta content="XML editor, Source view" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/ttaghilt.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txedtsrc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing in the Source view</title>
-</head>
-<body id="txedtsrc"><a name="txedtsrc"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing in the Source view</h1>
-
-
-
-
-<div><p>You can use the Source view to view and work with a file's source
-code directly.</p>
-
-<div class="section"><p> The Source view has many text editing features, such as:</p>
-<dl>
-
-<dt class="dlterm">Syntax highlighting</dt>
-
-<dd>Each tag type is highlighted differently, enabling you to easily find
-a certain kind of tag for editing. In addition, syntax highlighting is valuable
-in locating syntax errors. For example, if you begin a comment in the middle
-of the document with <samp class="codeph">&lt;!--</samp> everything until the next <samp class="codeph">--&gt;</samp> is
-considered a comment, and will be highlighted accordingly. The large highlighted
-area will indicate that you need to add <samp class="codeph">--&gt;</samp> to close the
-comment.<p>You can customize the syntax highlighting. Refer to the related
-tasks for more information.</p>
-</dd>
-
-</dl>
-<dl>
-<dt class="dlterm">Unlimited undo and redo</dt>
-
-<dd>These options allow you to incrementally undo and redo every change made
-to a file for the entire editing session. For text, changes are incremented
-one character or set of selected characters at a time.</dd>
-
-
-<dt class="dlterm">Content assist</dt>
-
-<dd>Content assist helps you finish tags and insert macros. Refer to the related
-task for more details.</dd>
-
-
-<dt class="dlterm">Template</dt>
-
-<dd>You can access templates (using content assist) to help you quickly add
-regularly-used tagging combinations. Refer to the related task for more details.</dd>
-
-
-<dt class="dlterm">Node selection</dt>
-
-<dd>Based on the location of your cursor (or selection in the Outline view),
-the node selection indicator highlights the line numbers that include a node
-(for example, an element or attribute), in the vertical ruler in the left
-area of the Source view.</dd>
-
-
-<dt class="dlterm">Pop-up menu options</dt>
-
-<dd>From the editor's pop-up menu, you have many of the same editing options
-available as you do from the workbench <strong>Edit</strong> menu. You can select menu
-options such as: <span class="uicontrol">Cleanup Document,</span> to open the <span class="uicontrol">Cleanup</span>
-dialog, which contains settings to update a document so that it is well-formed
-and formatted and <span class="uicontrol">Format,</span> which formats either the
-entire document or selected elements.</dd>
-
-
-<dt class="dlterm">"Smart" double clicking</dt>
-
-<dd>You can use double-click to select attribute values, attribute-value pairs,
-and entire tag sets to quickly update, copy, or remove content.</dd>
-
-</dl>
-<p>To open an XML file to edit, right-click the file in the
-Navigator view and select <span class="uicontrol">Open With &gt; XML Editor</span>. Click
-the <span class="uicontrol">Source</span> to see the Source view.</p>
-<p>Edit the code
-as necessary, using any of the available features. As you move the cursor
-within your XML file (or select items from the Outline view), the node selection
-indicator will highlight the line numbers that encompass the node (for example,
-an element or attribute). You can use smart double-clicking behavior to select
-attribute values, attribute-value pairs, and entire tag sets to quickly update,
-copy, or remove content. If desired, validate and save the XML
-file.</p>
-</div>
-
-<div class="section"><p>Any changes you make in the Source view are also reflected in the
-Design view and the Outline view.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-<div><a href="../topics/twcdast.html" title="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.">Using XML content assist</a></div>
-<div><a href="../topics/twmacro.html" title="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.">Working with XML templates</a></div>
-<div><a href="../topics/ttaghilt.html" title="If desired, you can change various aspects of how the XML source code is displayed in the Source view of the XML editor, such as the colors the tags will be displayed in.">Setting source highlighting styles</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.dita
deleted file mode 100644
index 4a65ff0885..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.dita
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="txedttag" xml:lang="en-us">
-<title>Editing XML files</title>
-<titlealts>
-<searchtitle>Editing XML files</searchtitle>
-</titlealts>
-<shortdesc>This file contains information about editing XML files.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>XML files</indexterm></indexterm>
-<indexterm>XML files<indexterm>editing</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To open an XML file in the XML editor, right-click it in the Navigator
-view and select <menucascade><uicontrol>Open With</uicontrol><uicontrol>XML
-Editor</uicontrol></menucascade>. </p><p>We recommend working in the Resource
-perspective when you are developing XML files. The views that appear by default
-in this perspective (such as the Outline view) help facilitate XML development.</p><p>The
-XML editor enables you to directly edit XML files. There are several different
-views you can use to edit your files:</p><ul>
-<li><b>Source view</b>: you can manually insert, edit, and delete elements
-and attributes in the Source view of the XML editor. To facilitate this effort,
-you can use content assist while you are in the Source view.</li>
-<li><b>Design view</b>: you can insert, delete, and edit elements, attributes,
-comments, and processing instructions in this view.</li>
-<li><b>Outline view</b>: you can insert and delete elements attributes, comments,
-and processing instructions in this view.</li>
-</ul><p>Often, you may find that you have more than one way to perform a specific
-task. For example, you have an XML file "MySchoolSubjects.xml" associated
-with an XML schema file "SchoolSubjects.xsd", which list all the subjects
-taught in a school. You want to insert a new element "Math" into your file.
-You can do so in the following ways:</p><ul>
-<li>In the Outline or Design view, right-click the appropriate parent element
-and select <menucascade><uicontrol>Add Child</uicontrol><uicontrol>Math</uicontrol>
-</menucascade> or <uicontrol>New Element</uicontrol> and enter the name of
-the child element<?Pub Caret?>.</li>
-<li>In the Source view, use content assist to help you find the appropriate
-location and code for the <uicontrol>Math</uicontrol> element.</li>
-<li>In the Source view, type the code for the <uicontrol>Math</uicontrol> element
-in the file.</li>
-</ul></context>
-<postreq></postreq>
-</taskbody>
-</task>
-<?Pub *0000002530?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html
deleted file mode 100644
index ef53b7d92a..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing XML files" />
-<meta name="abstract" content="This file contains information about editing XML files." />
-<meta name="description" content="This file contains information about editing XML files." />
-<meta content="XML editor, XML files, editing" name="DC.subject" />
-<meta content="XML editor, XML files, editing" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txedttag" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing XML files</title>
-</head>
-<body id="txedttag"><a name="txedttag"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing XML files</h1>
-
-
-
-
-<div><p>This file contains information about editing XML files.</p>
-
-<div class="section"><p>To open an XML file in the XML editor, right-click it in the Navigator
-view and select <span class="menucascade"><span class="uicontrol">Open With</span> &gt; <span class="uicontrol">XML
-Editor</span></span>. </p>
-<p>We recommend working in the Resource
-perspective when you are developing XML files. The views that appear by default
-in this perspective (such as the Outline view) help facilitate XML development.</p>
-<p>The
-XML editor enables you to directly edit XML files. There are several different
-views you can use to edit your files:</p>
-<ul>
-<li><strong>Source view</strong>: you can manually insert, edit, and delete elements
-and attributes in the Source view of the XML editor. To facilitate this effort,
-you can use content assist while you are in the Source view.</li>
-
-<li><strong>Design view</strong>: you can insert, delete, and edit elements, attributes,
-comments, and processing instructions in this view.</li>
-
-<li><strong>Outline view</strong>: you can insert and delete elements attributes, comments,
-and processing instructions in this view.</li>
-
-</ul>
-<p>Often, you may find that you have more than one way to perform a specific
-task. For example, you have an XML file "MySchoolSubjects.xml" associated
-with an XML schema file "SchoolSubjects.xsd", which list all the subjects
-taught in a school. You want to insert a new element "Math" into your file.
-You can do so in the following ways:</p>
-<ul>
-<li>In the Outline or Design view, right-click the appropriate parent element
-and select <span class="menucascade"><span class="uicontrol">Add Child</span> &gt; <span class="uicontrol">Math</span>
-</span> or <span class="uicontrol">New Element</span> and enter the name of
-the child element.</li>
-
-<li>In the Source view, use content assist to help you find the appropriate
-location and code for the <span class="uicontrol">Math</span> element.</li>
-
-<li>In the Source view, type the code for the <span class="uicontrol">Math</span> element
-in the file.</li>
-
-</ul>
-</div>
-
-<div class="section" />
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
-<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita
deleted file mode 100644
index 9dff82d51e..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<?Pub Inc?>
-<task id="txmlcat" xml:lang="en-us">
-<title>Adding entries to the XML Catalog</title>
-<titlealts>
-<searchtitle>Adding entries to the XML Catalog</searchtitle>
-</titlealts>
-<shortdesc>XML Catalog entries are used to map external entity references
-to locally defined resources. You can provide rules specify how these
-entities are resolved</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML catalog<indexterm>adding entries</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>For details on the standard for XML Catalogs, see: <xref
-href="http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html"
-scope="external"></xref>.</p><p>For example: you are working on an
-XML file on a computer and point its <codeph>schemaLocation</codeph> towards
-a schema called <codeph>c:\MySchema.xsd</codeph>. If you do not use
-an XML catalog, then when you finish editing the XML file and are
-ready to publish it on the Web, you will need to edit <codeph>schemaLocation</codeph> so
-that it points to a resource that is accessible on the Web.</p><p>To
-avoid making frequent changes to your XML document, you can use the
-XML Catalog: you could specify a rule that redirects an Internet resource
-reference (for example, <codeph>"http://www.ibm.com/published-schemas/MySchema.xsd"</codeph>)
-so that it points to a resource on the local machine (for example,
- <codeph>"file:///C:/MySchema.xsd"</codeph>). Now, instead of frequently
-editing XML documents to update the URIs or locations (especially
-when there are many documents in your project), you only need to update
-a single rule in your XML Catalog.</p><p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p><p>To add an entry to the XML Catalog,
-follow these steps:</p></context>
-<steps>
-<step><cmd>Open the XML file that you want to associate with a DTD
-or XML schema.</cmd></step>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol>
-<uicontrol>XML Catalog</uicontrol></menucascade>.</cmd><info>The <uicontrol>XML
-Catalog Entries</uicontrol> section contains a list of any user-defined
-and plug-in defined catalog entries. Select any entry to see information
-about it in the <uicontrol>Details</uicontrol> section.</info></step>
-<step><cmd>Click <uicontrol>Add</uicontrol> to create a new catalog
-entry.</cmd></step>
-<step><cmd>In the left-hand column, click the type of catalog entry
-that you want to add:</cmd>
-<choicetable>
-<chrow><choption>Catalog Entry</choption><chdesc>Used by an XML processor
-when resolving entity references. You can provide rules to the catalog
-to specify how entities should be resolved.<p>An XML Catalog entry
-contains two parts:<ul>
-<li>A key (which represents a DTD or XML schema)</li>
-<li>A location (similar to a URI, which contains information about
-a DTD or XML schema's location).</li>
-</ul> You can place the Key in an XML file. When the XML processor
-encounters it, it will use the XML Catalog entry to find the location
-of the DTD or XML schema associated with the Key</p></chdesc></chrow>
-<chrow><choption>Rewrite Entry</choption><chdesc>Used to redirect
-a set of entities.</chdesc></chrow>
-<chrow><choption>Suffix Entry</choption><chdesc>Used to match the
-suffix of a URI or systemID.</chdesc></chrow>
-<chrow><choption>Next Catalog</choption><chdesc>Used to refer to another
-catalog without importing it into the workbench.</chdesc></chrow>
-<chrow><choption>Delegate Catalog</choption><chdesc>Used to associate
-an alternate catalog with an identifier.</chdesc></chrow>
-</choicetable>
-</step>
-<step><cmd>Complete the fields for the catalog entry that you selected:</cmd>
-<info><table><title> Cata<?Pub Caret?>log entry types and associated
-fields</title>
-<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
-<thead>
-<row valign="bottom">
-<entry colname="col1">Catalog type</entry>
-<entry colname="col2">Fields</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry char="." colname="col1">Catalog Entry</entry>
-<entry colname="col2"><ul>
-<li>In the <uicontrol>Location</uicontrol> field, enter or browse
-for the location or URI of the DTD or XML schema file. This uses your
-computer's path style to describe the location of the file. </li>
-<li>Select a <uicontrol>Key Type</uicontrol>:<ul>
-<li>If you specified a DTD: select <uicontrol>Public ID</uicontrol>, <uicontrol>System
-ID</uicontrol>, or <uicontrol>URI</uicontrol> from the <uicontrol>Key
-Type</uicontrol> field. If you select <uicontrol>Public ID,</uicontrol> the
-value you enter in the <uicontrol>Key</uicontrol> field should be
-the same as the Public ID in the XML file's DOCTYPE declaration. If
-you select <uicontrol>System ID</uicontrol>, the value you enter should
-correspond to the System ID in an XML file's DOCTYPE declaration.
-If you select <uicontrol>URI</uicontrol>, the value you enter must
-be a fully qualified URI.</li>
-<li>If you specified an XML schema: select either <uicontrol>Namespace
-Name</uicontrol> or <uicontrol>Schema Location</uicontrol> from the <uicontrol>Key
-Type</uicontrol> field. If the schema defines a target namespace,
-it will automatically appear in the <uicontrol>Key</uicontrol> field.
-Otherwise, you can enter the schema location in the <uicontrol>Key</uicontrol> field.</li>
-</ul></li>
-<li>Select the <uicontrol>Specify alternative Web address</uicontrol> check
-box if you want to be able to specify an alternate Web address for
-the resource. <p>This Web address is used when an XML instance is
-generated from this catalog entry.<note>This option is only available
-if you select <uicontrol>Public ID</uicontrol> (for a DTD) or <uicontrol>Namespace
-Name</uicontrol> (for a schema) in the <uicontrol>Key type</uicontrol> field.</note></p></li>
-</ul></entry>
-</row>
-<row>
-<entry char="." colname="col1">Rewrite Entry</entry>
-<entry colname="col2"><ul>
-<li>Select a <uicontrol>Key type to match</uicontrol>, either URI
-or systemID.</li>
-<li><uicontrol>Matching start string</uicontrol>: The matching prefix
-to be removed from the supplied identifier.</li>
-<li><uicontrol>Rewrite prefix</uicontrol>: The prefix is be used instead
-of the prefix that is removed.</li>
-</ul></entry>
-</row>
-<row>
-<entry char="." colname="col1">Suffix Entry</entry>
-<entry colname="col2"><ul>
-<li>In the <uicontrol>Location</uicontrol> field, enter or browse
-for the location or URI of the DTD or XML schema file. This uses your
-computer's path style to describe the location of the file. </li>
-<li>Select a <uicontrol>Key Type</uicontrol> (URI or systemID) to
-match. </li>
-<li>Type the <uicontrol>Suffix</uicontrol> of the identifier to match.</li>
-</ul></entry>
-</row>
-<row>
-<entry char="." colname="col1">Next Catalog</entry>
-<entry colname="col2">In the <uicontrol>Location of another XML Catalog
-file</uicontrol> field, type or browse for the XML catalog you want
-to refer to. </entry>
-</row>
-<row>
-<entry char="." colname="col1">Delegate Catalog</entry>
-<entry colname="col2"><ul>
-<li>Select a <uicontrol>Key type to match</uicontrol>, either URI
-or systemID.</li>
-<li><uicontrol>Matching start string</uicontrol>: The prefix of the
-supplied identifier to match.</li>
-<li><uicontrol>Delegate to this XML file</uicontrol>: The alternate
-catalog to associate.</li>
-</ul></entry>
-</row>
-</tbody>
-</tgroup>
-</table></info></step>
-<step><cmd>When you are done creating catalog entries, click <uicontrol>OK</uicontrol> to
-close the Add XML Catalog Entry dialog. Click <uicontrol>OK</uicontrol> again
-to save your settings.</cmd></step>
-<step><cmd>Make sure the XML file is in focus and click the <uicontrol>Reload
-dependencies</uicontrol> toolbar button. </cmd></step>
-</steps>
-<result>The XML file is now associated with the latest version of
-the XML schema or DTD.</result>
-<postreq><p>You can also export and import XML Catalog information: </p><p>To
-export, click <menucascade><uicontrol>File</uicontrol><uicontrol>Export</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol>
-<uicontrol>XML Catalog</uicontrol></menucascade>. You will be prompted
-to select a project and provide a file name to store your catalog
-entries in an .xmlcatalog file, which can be opened from the Navigator
-view. Since your catalog entries are stored in an .xmlcatalog file,
-you can check them in and out and share them like any other project
-resource.</p><p>To import, click <menucascade><uicontrol>File</uicontrol>
-<uicontrol>Import</uicontrol></menucascade> and select <menucascade>
-<uicontrol>XML</uicontrol><uicontrol>XML Catalog</uicontrol>
-</menucascade>. Then specify the file that will be used to load the
-XML Catalog settings. When you import a .xmlcatalog file, any entries
-in it will be loaded into the XML Catalog (and any existing entries
-will be overwritten). </p></postreq>
-</taskbody>
-</task>
-<?Pub *0000009117?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html
deleted file mode 100644
index 59f66055ac..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html
+++ /dev/null
@@ -1,298 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding entries to the XML Catalog" />
-<meta name="abstract" content="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved" />
-<meta name="description" content="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved" />
-<meta content="XML catalog, adding entries" name="DC.subject" />
-<meta content="XML catalog, adding entries" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtcnst.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtgram.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txmlcat" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding entries to the XML Catalog</title>
-</head>
-<body id="txmlcat"><a name="txmlcat"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding entries to the XML Catalog</h1>
-
-
-
-
-<div><p>XML Catalog entries are used to map external entity references
-to locally defined resources. You can provide rules specify how these
-entities are resolved</p>
-
-<div class="section"><p>For details on the standard for XML Catalogs, see: <a href="http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html" target="_blank">http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html</a>.</p>
-<p>For example: you are working on an
-XML file on a computer and point its <samp class="codeph">schemaLocation</samp> towards
-a schema called <samp class="codeph">c:\MySchema.xsd</samp>. If you do not use
-an XML catalog, then when you finish editing the XML file and are
-ready to publish it on the Web, you will need to edit <samp class="codeph">schemaLocation</samp> so
-that it points to a resource that is accessible on the Web.</p>
-<p>To
-avoid making frequent changes to your XML document, you can use the
-XML Catalog: you could specify a rule that redirects an Internet resource
-reference (for example, <samp class="codeph">"http://www.ibm.com/published-schemas/MySchema.xsd"</samp>)
-so that it points to a resource on the local machine (for example,
- <samp class="codeph">"file:///C:/MySchema.xsd"</samp>). Now, instead of frequently
-editing XML documents to update the URIs or locations (especially
-when there are many documents in your project), you only need to update
-a single rule in your XML Catalog.</p>
-<p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p>
-<p>To add an entry to the XML Catalog,
-follow these steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open the XML file that you want to associate with a DTD
-or XML schema.</span></li>
-
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span>
- &gt; <span class="uicontrol">XML Catalog</span></span>.</span> The <span class="uicontrol">XML
-Catalog Entries</span> section contains a list of any user-defined
-and plug-in defined catalog entries. Select any entry to see information
-about it in the <span class="uicontrol">Details</span> section.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Add</span> to create a new catalog
-entry.</span></li>
-
-<li class="stepexpand"><span>In the left-hand column, click the type of catalog entry
-that you want to add:</span>
-
-<table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
-<thead><tr><th valign="bottom" id="N100EE-option" align="left">Option</th>
-<th valign="bottom" id="N100EE-desc" align="left">Description</th></tr></thead>
-<tbody>
-<tr><td valign="top" headers="N100EE-option" id="N100F8"><strong>Catalog Entry</strong></td>
-<td valign="top" headers="N100EE-desc N100F8">Used by an XML processor
-when resolving entity references. You can provide rules to the catalog
-to specify how entities should be resolved.<div class="p">An XML Catalog entry
-contains two parts:<ul>
-<li>A key (which represents a DTD or XML schema)</li>
-
-<li>A location (similar to a URI, which contains information about
-a DTD or XML schema's location).</li>
-
-</ul>
- You can place the Key in an XML file. When the XML processor
-encounters it, it will use the XML Catalog entry to find the location
-of the DTD or XML schema associated with the Key</div>
-</td>
-</tr>
-
-<tr><td valign="top" headers="N100EE-option" id="N1011E"><strong>Rewrite Entry</strong></td>
-<td valign="top" headers="N100EE-desc N1011E">Used to redirect
-a set of entities.</td>
-</tr>
-
-<tr><td valign="top" headers="N100EE-option" id="N1012D"><strong>Suffix Entry</strong></td>
-<td valign="top" headers="N100EE-desc N1012D">Used to match the
-suffix of a URI or systemID.</td>
-</tr>
-
-<tr><td valign="top" headers="N100EE-option" id="N1013C"><strong>Next Catalog</strong></td>
-<td valign="top" headers="N100EE-desc N1013C">Used to refer to another
-catalog without importing it into the workbench.</td>
-</tr>
-
-<tr><td valign="top" headers="N100EE-option" id="N1014B"><strong>Delegate Catalog</strong></td>
-<td valign="top" headers="N100EE-desc N1014B">Used to associate
-an alternate catalog with an identifier.</td>
-</tr>
-
-</tbody></table>
-
-</li>
-
-<li class="stepexpand"><span>Complete the fields for the catalog entry that you selected:</span>
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all"><caption>Table 1. Catalog entry types and associated
-fields</caption>
-<thead align="left">
-<tr valign="bottom">
-<th valign="bottom" id="N1018B">Catalog type</th>
-
-<th valign="bottom" id="N10192">Fields</th>
-
-</tr>
-
-</thead>
-
-<tbody>
-<tr>
-<td char="." valign="top" headers="N1018B ">Catalog Entry</td>
-
-<td valign="top" headers="N10192 "><ul>
-<li>In the <span class="uicontrol">Location</span> field, enter or browse
-for the location or URI of the DTD or XML schema file. This uses your
-computer's path style to describe the location of the file. </li>
-
-<li>Select a <span class="uicontrol">Key Type</span>:<ul>
-<li>If you specified a DTD: select <span class="uicontrol">Public ID</span>, <span class="uicontrol">System
-ID</span>, or <span class="uicontrol">URI</span> from the <span class="uicontrol">Key
-Type</span> field. If you select <span class="uicontrol">Public ID,</span> the
-value you enter in the <span class="uicontrol">Key</span> field should be
-the same as the Public ID in the XML file's DOCTYPE declaration. If
-you select <span class="uicontrol">System ID</span>, the value you enter should
-correspond to the System ID in an XML file's DOCTYPE declaration.
-If you select <span class="uicontrol">URI</span>, the value you enter must
-be a fully qualified URI.</li>
-
-<li>If you specified an XML schema: select either <span class="uicontrol">Namespace
-Name</span> or <span class="uicontrol">Schema Location</span> from the <span class="uicontrol">Key
-Type</span> field. If the schema defines a target namespace,
-it will automatically appear in the <span class="uicontrol">Key</span> field.
-Otherwise, you can enter the schema location in the <span class="uicontrol">Key</span> field.</li>
-
-</ul>
-</li>
-
-<li>Select the <span class="uicontrol">Specify alternative Web address</span> check
-box if you want to be able to specify an alternate Web address for
-the resource. <div class="p">This Web address is used when an XML instance is
-generated from this catalog entry.<div class="note"><span class="notetitle">Note:</span> This option is only available
-if you select <span class="uicontrol">Public ID</span> (for a DTD) or <span class="uicontrol">Namespace
-Name</span> (for a schema) in the <span class="uicontrol">Key type</span> field.</div>
-</div>
-</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td char="." valign="top" headers="N1018B ">Rewrite Entry</td>
-
-<td valign="top" headers="N10192 "><ul>
-<li>Select a <span class="uicontrol">Key type to match</span>, either URI
-or systemID.</li>
-
-<li><span class="uicontrol">Matching start string</span>: The matching prefix
-to be removed from the supplied identifier.</li>
-
-<li><span class="uicontrol">Rewrite prefix</span>: The prefix is be used instead
-of the prefix that is removed.</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td char="." valign="top" headers="N1018B ">Suffix Entry</td>
-
-<td valign="top" headers="N10192 "><ul>
-<li>In the <span class="uicontrol">Location</span> field, enter or browse
-for the location or URI of the DTD or XML schema file. This uses your
-computer's path style to describe the location of the file. </li>
-
-<li>Select a <span class="uicontrol">Key Type</span> (URI or systemID) to
-match. </li>
-
-<li>Type the <span class="uicontrol">Suffix</span> of the identifier to match.</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td char="." valign="top" headers="N1018B ">Next Catalog</td>
-
-<td valign="top" headers="N10192 ">In the <span class="uicontrol">Location of another XML Catalog
-file</span> field, type or browse for the XML catalog you want
-to refer to. </td>
-
-</tr>
-
-<tr>
-<td char="." valign="top" headers="N1018B ">Delegate Catalog</td>
-
-<td valign="top" headers="N10192 "><ul>
-<li>Select a <span class="uicontrol">Key type to match</span>, either URI
-or systemID.</li>
-
-<li><span class="uicontrol">Matching start string</span>: The prefix of the
-supplied identifier to match.</li>
-
-<li><span class="uicontrol">Delegate to this XML file</span>: The alternate
-catalog to associate.</li>
-
-</ul>
-</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-</li>
-
-<li class="stepexpand"><span>When you are done creating catalog entries, click <span class="uicontrol">OK</span> to
-close the Add XML Catalog Entry dialog. Click <span class="uicontrol">OK</span> again
-to save your settings.</span></li>
-
-<li class="stepexpand"><span>Make sure the XML file is in focus and click the <span class="uicontrol">Reload
-dependencies</span> toolbar button. </span></li>
-
-</ol>
-
-<div class="section">The XML file is now associated with the latest version of
-the XML schema or DTD.</div>
-
-<div class="section"><p>You can also export and import XML Catalog information: </p>
-<p>To
-export, click <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Export</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span>
- &gt; <span class="uicontrol">XML Catalog</span></span>. You will be prompted
-to select a project and provide a file name to store your catalog
-entries in an .xmlcatalog file, which can be opened from the Navigator
-view. Since your catalog entries are stored in an .xmlcatalog file,
-you can check them in and out and share them like any other project
-resource.</p>
-<p>To import, click <span class="menucascade"><span class="uicontrol">File</span>
- &gt; <span class="uicontrol">Import</span></span> and select <span class="menucascade">
-<span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML Catalog</span>
-</span>. Then specify the file that will be used to load the
-XML Catalog settings. When you import a .xmlcatalog file, any entries
-in it will be loaded into the XML Catalog (and any existing entries
-will be overwritten). </p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.dita
deleted file mode 100644
index b9d9ffd28a..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.dita
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="txprefs" xml:lang="en-us">
-<title>Defining XML editor preferences</title>
-<titlealts>
-<searchtitle>Defining XML editor preferences</searchtitle>
-</titlealts>
-<shortdesc>You can set various preferences for the Source view of the XML
-editor such as the formatter indentation style, line wrapping rules, and content
-assist rules. To apply the formatting styles, right-click in the Source view
-for your XML document, and click <menucascade><uicontrol>Format</uicontrol>
-<uicontrol>Document</uicontrol></menucascade>.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML editor<indexterm>preferences</indexterm></indexterm>
-<indexterm>preferences<indexterm>XML editor</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To define XML preferences, complete the following steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Files</uicontrol><uicontrol>Editor</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Enter a maximum width for formatted lines in the <uicontrol>Line
-width</uicontrol> field</cmd><info>The default value is 72.</info></step>
-<step><cmd>Select <uicontrol>Split multiple attributes each on a new line</uicontrol> to
-start every attribute on a new line.</cmd></step>
-<step><cmd>Select <uicontrol>Preserve whitespace in tags with PCDATA content</uicontrol> to
-prevent the editor from deleting whitespace in elements that contain parsed
-character data.</cmd></step>
-<step><cmd>If you want blank lines to be removed when the document is formatted,
-select the <uicontrol>Clear all blank lines</uicontrol> check box. </cmd>
-<info>By default, blank lines are preserved in a formatted document.</info>
-</step>
-<step><cmd>Select <uicontrol>Indent using tabs</uicontrol> if you want to
-use tab characters (\t) as the standard formatting indentation, or, if you
-prefer to use spaces, select <uicontrol>Indent using spaces</uicontrol>.</cmd>
-</step>
-<step><cmd>You can also specify the <uicontrol>Indentation size</uicontrol> which
-is the number of tabs or space characters used for formatting indentation.</cmd>
-</step>
-<step><cmd>You can specify certain characters (the default command<?Pub Caret?>
-is &lt;=) that will cause the content assist list to pop up automatically.
-Ensure the <uicontrol>Automatically make suggestions</uicontrol> check box
-is selected and specify the characters in the <uicontrol>Prompt when these
-characters are inserted</uicontrol> field. </cmd></step>
-<step><cmd>If you select <b>Strict</b> from the <b>Suggestion strategy</b> list,
-suggestions that are grammatically valid will be shown first (with bold icons)
-in the content assist list. Other suggestions that are applicable to the element
-scope, but not grammatically valid, will be shown below them with a de-emphasized
-icon. The default value for this field is <b>Strict</b>.</cmd></step>
-<step><cmd>The <uicontrol>Use inferred grammar in absence of DTD/Schema</uicontrol> check
-box is selected by default. </cmd><info>If this box is selected, when you
-have an XML file that is not associated with a DTD or XML schema, you will
-still be able to get content assist - the tool will infer what should come
-next in your file based on the existing content.</info></step>
-<step><cmd>Click <uicontrol>Apply</uicontrol> and then <uicontrol>OK</uicontrol> to
-save your changes.</cmd></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000003659?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html
deleted file mode 100644
index 57445f2bb3..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Defining XML editor preferences" />
-<meta name="abstract" content="You can set various preferences for the Source view of the XML editor such as the formatter indentation style, line wrapping rules, and content assist rules. To apply the formatting styles, right-click in the Source view for your XML document, and click Format &gt; Document." />
-<meta name="description" content="You can set various preferences for the Source view of the XML editor such as the formatter indentation style, line wrapping rules, and content assist rules. To apply the formatting styles, right-click in the Source view for your XML document, and click Format &gt; Document." />
-<meta content="XML editor, preferences" name="DC.subject" />
-<meta content="XML editor, preferences" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txprefs" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Defining XML editor preferences</title>
-</head>
-<body id="txprefs"><a name="txprefs"><!-- --></a>
-
-
-<h1 class="topictitle1">Defining XML editor preferences</h1>
-
-
-
-
-<div><p>You can set various preferences for the Source view of the XML
-editor such as the formatter indentation style, line wrapping rules, and content
-assist rules. To apply the formatting styles, right-click in the Source view
-for your XML document, and click <span class="menucascade"><span class="uicontrol">Format</span>
- &gt; <span class="uicontrol">Document</span></span>.</p>
-
-<div class="section"><p>To define XML preferences, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Files</span> &gt; <span class="uicontrol">Editor</span></span>.</span></li>
-
-<li class="stepexpand"><span>Enter a maximum width for formatted lines in the <span class="uicontrol">Line
-width</span> field</span> The default value is 72.</li>
-
-<li class="stepexpand"><span>Select <span class="uicontrol">Split multiple attributes each on a new line</span> to
-start every attribute on a new line.</span></li>
-
-<li class="stepexpand"><span>Select <span class="uicontrol">Preserve whitespace in tags with PCDATA content</span> to
-prevent the editor from deleting whitespace in elements that contain parsed
-character data.</span></li>
-
-<li class="stepexpand"><span>If you want blank lines to be removed when the document is formatted,
-select the <span class="uicontrol">Clear all blank lines</span> check box. </span>
- By default, blank lines are preserved in a formatted document.
-</li>
-
-<li class="stepexpand"><span>Select <span class="uicontrol">Indent using tabs</span> if you want to
-use tab characters (\t) as the standard formatting indentation, or, if you
-prefer to use spaces, select <span class="uicontrol">Indent using spaces</span>.</span>
-</li>
-
-<li class="stepexpand"><span>You can also specify the <span class="uicontrol">Indentation size</span> which
-is the number of tabs or space characters used for formatting indentation.</span>
-</li>
-
-<li class="stepexpand"><span>You can specify certain characters (the default command
-is &lt;=) that will cause the content assist list to pop up automatically.
-Ensure the <span class="uicontrol">Automatically make suggestions</span> check box
-is selected and specify the characters in the <span class="uicontrol">Prompt when these
-characters are inserted</span> field. </span></li>
-
-<li class="stepexpand"><span>If you select <strong>Strict</strong> from the <strong>Suggestion strategy</strong> list,
-suggestions that are grammatically valid will be shown first (with bold icons)
-in the content assist list. Other suggestions that are applicable to the element
-scope, but not grammatically valid, will be shown below them with a de-emphasized
-icon. The default value for this field is <strong>Strict</strong>.</span></li>
-
-<li class="stepexpand"><span>The <span class="uicontrol">Use inferred grammar in absence of DTD/Schema</span> check
-box is selected by default. </span> If this box is selected, when you
-have an XML file that is not associated with a DTD or XML schema, you will
-still be able to get content assist - the tool will infer what should come
-next in your file based on the existing content.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Apply</span> and then <span class="uicontrol">OK</span> to
-save your changes.</span></li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.dita
deleted file mode 100644
index 32ed973cdc..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.dita
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="txsityp" xml:lang="en-us">
-<title>Using xsi:type</title>
-<titlealts>
-<searchtitle>Using xsi:type</searchtitle>
-</titlealts>
-<shortdesc>If you have elements in your XML file whose type is a complex type,
-xsi:type support in the XML editor lets you choose between the complex type
-and any other complex types derived from it.</shortdesc>
-<taskbody>
-<context><p>The XML Schema specification allows you to derive types by extension.
-See the following steps as an example<?Pub Caret?>:</p></context>
-<steps>
-<step><cmd>Create an XML schema and create a complex type for it called <userinput>Address</userinput>. </cmd>
-</step>
-<step><cmd>Add some basic elements to <userinput>Address</userinput>, such
-as <userinput>streetName</userinput> and <userinput>city</userinput>.</cmd>
-</step>
-<step><cmd>Derive (by extension) two new complex types from <userinput>Address</userinput>: <userinput>USAddress</userinput> and <userinput>UKAddress</userinput
->. </cmd></step>
-<step><cmd>Add a new element to <userinput>USAddress</userinput> called <userinput>state</userinput>,
-and also a new element to <userinput>UKAddress</userinput> called <userinput>postcode</userinput>.</cmd>
-</step>
-<step><cmd>Create two more elements: <userinput>billTo</userinput> and <userinput>shipTo</userinput>,
-as <systemoutput>Address</systemoutput> types.</cmd></step>
-<step><cmd>When you create an XML instance document for an element such as
- <systemoutput>billTo</systemoutput> or <userinput>Address</userinput>, an
-xsi:type attribute will automatically be added to it.</cmd><info>For example, <codeblock>&lt;billTo xsi:type="ipo:Address"></codeblock>The
-xsi:type attribute is used to identify derived complex types (as well as complex
-types that have been derived from).</info></step>
-<step><cmd>In the Design view of the XML editor, a list will be available,
-letting you select the appropriate type definition (<uicontrol>Address</uicontrol>, <uicontrol>USAddress</uicontrol>,
-or <uicontrol>UKAddress</uicontrol>). The guided editing for the content
-model will reflect the type definition that you choose. For example, if you
-select <uicontrol>USAddress</uicontrol> , your <codeph>billTo</codeph> element
-can contain a <codeph>state</codeph> element, but it cannot contain a <codeph>postcode</codeph> element.</cmd>
-</step>
-</steps>
-<postreq><p>The XML example "Editing and validating XML files" demonstrates <b>xsi:type</b> support.</p><p>For
-more information about xsi:type, refer to the <b>Using Derived Types in Instance
-Documents</b> section in <xref format="html" href="http://www.w3.org/TR/xmlschema-0/#UseDerivInInstDocs"
-scope="external">XML Schema Part 0: Primer.</xref></p><p>For more information
-about validation semantics when xsi:type is used, refer to the <b>Schema-Related
-Markup in Documents Being Validated</b> section in <xref format="html" href="http://www.w3.org/TR/xmlschema-1/#xsi_type"
-scope="external">XML Schema Part 1: Structures</xref> </p></postreq>
-</taskbody>
-</task>
-<?Pub *0000003154?>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html
deleted file mode 100644
index fc47c4cdce..0000000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Using xsi:type" />
-<meta name="abstract" content="If you have elements in your XML file whose type is a complex type, xsi:type support in the XML editor lets you choose between the complex type and any other complex types derived from it." />
-<meta name="description" content="If you have elements in your XML file whose type is a complex type, xsi:type support in the XML editor lets you choose between the complex type and any other complex types derived from it." />
-<meta content="XHTML" name="DC.Format" />
-<meta content="txsityp" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Using xsi:type</title>
-</head>
-<body id="txsityp"><a name="txsityp"><!-- --></a>
-
-
-<h1 class="topictitle1">Using xsi:type</h1>
-
-
-
-<div><p>If you have elements in your XML file whose type is a complex type,
-xsi:type support in the XML editor lets you choose between the complex type
-and any other complex types derived from it.</p>
-
-<div class="section"><p>The XML Schema specification allows you to derive types by extension.
-See the following steps as an example:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Create an XML schema and create a complex type for it called <kbd class="userinput">Address</kbd>. </span>
-</li>
-
-<li class="stepexpand"><span>Add some basic elements to <kbd class="userinput">Address</kbd>, such
-as <kbd class="userinput">streetName</kbd> and <kbd class="userinput">city</kbd>.</span>
-</li>
-
-<li class="stepexpand"><span>Derive (by extension) two new complex types from <kbd class="userinput">Address</kbd>: <kbd class="userinput">USAddress</kbd> and <kbd class="userinput">UKAddress</kbd>. </span></li>
-
-<li class="stepexpand"><span>Add a new element to <kbd class="userinput">USAddress</kbd> called <kbd class="userinput">state</kbd>,
-and also a new element to <kbd class="userinput">UKAddress</kbd> called <kbd class="userinput">postcode</kbd>.</span>
-</li>
-
-<li class="stepexpand"><span>Create two more elements: <kbd class="userinput">billTo</kbd> and <kbd class="userinput">shipTo</kbd>,
-as <tt class="sysout">Address</tt> types.</span></li>
-
-<li class="stepexpand"><span>When you create an XML instance document for an element such as
- <tt class="sysout">billTo</tt> or <kbd class="userinput">Address</kbd>, an
-xsi:type attribute will automatically be added to it.</span> For example, <pre>&lt;billTo xsi:type="ipo:Address"&gt;</pre>
-The
-xsi:type attribute is used to identify derived complex types (as well as complex
-types that have been derived from).</li>
-
-<li class="stepexpand"><span>In the Design view of the XML editor, a list will be available,
-letting you select the appropriate type definition (<span class="uicontrol">Address</span>, <span class="uicontrol">USAddress</span>,
-or <span class="uicontrol">UKAddress</span>). The guided editing for the content
-model will reflect the type definition that you choose. For example, if you
-select <span class="uicontrol">USAddress</span> , your <samp class="codeph">billTo</samp> element
-can contain a <samp class="codeph">state</samp> element, but it cannot contain a <samp class="codeph">postcode</samp> element.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>The XML example "Editing and validating XML files" demonstrates <strong>xsi:type</strong> support.</p>
-<p>For
-more information about xsi:type, refer to the <strong>Using Derived Types in Instance
-Documents</strong> section in <a href="http://www.w3.org/TR/xmlschema-0/#UseDerivInInstDocs" target="_blank">XML Schema Part 0: Primer.</a></p>
-<p>For more information
-about validation semantics when xsi:type is used, refer to the <strong>Schema-Related
-Markup in Documents Being Validated</strong> section in <a href="http://www.w3.org/TR/xmlschema-1/#xsi_type" target="_blank">XML Schema Part 1: Structures</a> </p>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/.cvsignore b/docs/org.eclipse.wst.xsdeditor.doc.user/.cvsignore
deleted file mode 100644
index 41662288a7..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-org.eclipse.wst.xsdeditor.doc.user_1.0.0.jar
-temp
-DitaLink.cat \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/.project b/docs/org.eclipse.wst.xsdeditor.doc.user/.project
deleted file mode 100644
index 82170b5d7c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsdeditor.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.core.resources.prefs b/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.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/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs b/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs b/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.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/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.pde.prefs b/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml
deleted file mode 100644
index 07cf32d938..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
- This script build the Help plug-in by transforming the DITA source files into HTML.
-
- To use this script, you must install DITA-OT on your machine in the directory
- defined by the dita.ot.dir property.
-
- Run the default target after you edit the DITA source files to regenerate the HTML.
-
- To customize this script for other Help plug-ins, modify the value of the args.input property
- to be the DITA map file for the plug-in.
-
- NOTE: This script assumes that links to sibling Help plug-ins have scope="peer", otherwise the
- output directory structure will be shifted incorrectly.
-
- NOTE: This script assumes that you hand code your plugin.xml file in myplugin.xml. This file
- will be copied over the generated plugin.xml which is currently not being generated correctly
- by DITA-OT.
-
- ChangeLog:
- 2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
- - Created.
- 2008-01-09 Kate Price <katep@ca.ibm.com>
- - modified for new DITA-OT version
- 2008-05-05 Kate Price <katep@ca.ibm.com>
- - modified to add generation of pre-built help index.
- - Must delete /index folder before running build
--->
-<project name="eclipsehelp" default="all">
-
- <property name="dita.ot.dir" location="C:/DITA-OT1.2.2" />
-
- <path id="dost.class.path">
- <pathelement location="${dita.ot.dir}${file.separator}lib${file.separator}dost.jar" />
- </path>
-
- <taskdef name="integrate" classname="org.dita.dost.platform.IntegratorTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <target name="all" depends="integrate, eclipsehelp">
- </target>
- <target name="integrate">
- <integrate ditadir="${dita.ot.dir}" />
- </target>
-
- <!-- revise below here -->
- <target name="eclipsehelp">
- <ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
- <property name="args.copycss" value="no" />
- <property name="args.csspath" value="../org.eclipse.wst.doc.user" />
- <property name="args.eclipse.provider" value="Eclipse.org" />
- <property name="args.eclipse.version" value="3.4.0" />
- <property name="args.input" location="XSDLeditorrel.ditamap" />
- <property name="clean.temp" value="true" />
- <property name="dita.extname" value=".dita" />
- <property name="dita.temp.dir" location="temp" />
- <property name="output.dir" location="" />
- <property name="transtype" value="eclipsehelp" />
- </ant>
- <copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
- </target>
- <target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
- <help.buildHelpIndex manifest="plugin.xml" destination="."/>
- </target>
-</project>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 27509aef95..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Plugin.name
-Bundle-SymbolicName: org.eclipse.wst.xsdeditor.doc.user; singleton:=true
-Bundle-Version: 1.0.800.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.ditamap b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.ditamap
deleted file mode 100644
index a13ee00271..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.ditamap
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
- <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
-<map>
-<topicgroup collection-type="family">
-<topicref href="topics/tcxmlsch.dita" navtitle="Creating XML schemas"></topicref>
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-<topicref href="topics/cxmlsced.dita" id="xsdconcepts" linking="targetonly"
-navtitle="XML schema editor"></topicref>
-<topicref href="topics/tvdtschm.dita" linking="targetonly" navtitle="Validating XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-<topicref href="topics/cxmlsced.dita" linking="targetonly" navtitle="XML schema editor">
-</topicref>
-<topicref href="topics/tvdtschm.dita" linking="targetonly" navtitle="Validating XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/timpschm.dita" navtitle="Importing XML schemas"></topicref>
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-<topicref href="topics/cxmlsced.dita" linking="targetonly" navtitle="XML schema editor">
-</topicref>
-<topicref href="topics/tvdtschm.dita" linking="targetonly" navtitle="Validating XML schemas">
-</topicref>
-<topicref href="topics/taddimpt.dita" linking="targetonly" navtitle="Adding import elements">
-</topicref>
-<topicref href="topics/taddincl.dita" linking="targetonly" navtitle="Adding include elements">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tnavsrc.dita" navtitle="Navigating XML schemas"></topicref>
-<topicref href="topics/cxmlsced.dita" linking="targetonly" navtitle="XML schema editor">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/cxmlsced.dita" linking="normal" navtitle="XML schema editor">
-</topicref>
-<topicref href="topics/tcxmlsch.dita" linking="targetonly" navtitle="Creating XML schemas">
-</topicref>
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-<topicref href="topics/tvdtschm.dita" linking="targetonly" navtitle="Validating XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddcmxt.dita" navtitle="Adding complex types"></topicref>
-<topicref href="topics/taddcmod.dita" linking="targetonly" navtitle="Adding content models">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddglem.dita" navtitle="Adding global elements"></topicref>
-<topicref href="topics/taddcmod.dita" linking="targetonly" navtitle="Adding content models">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddelm.dita" navtitle="Adding elements"></topicref>
-<topicref href="topics/taddcmod.dita" linking="targetonly" navtitle="Adding content models">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddelmr.dita" navtitle="Adding element references">
-</topicref>
-<topicref href="topics/taddglem.dita" navtitle="Adding global elements"></topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddgrup.dita" navtitle="Adding groups"></topicref>
-<topicref href="topics/taddgrpr.dita" linking="targetonly" navtitle="Adding group references">
-</topicref>
-<topicref href="topics/taddcmod.dita" linking="targetonly" navtitle="Adding content models">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddgrpr.dita" linking="normal" navtitle="Adding group references">
-</topicref>
-<topicref href="topics/taddgrup.dita" linking="targetonly" navtitle="Adding groups">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddimpt.dita" navtitle="Adding import elements"></topicref>
-<topicref href="topics/taddincl.dita" navtitle="Adding include elements">
-</topicref>
-<topicref href="topics/taddrdfn.dita" navtitle="Adding redefine elements">
-</topicref>
-<topicref href="topics/rnmspc.dita" linking="targetonly" navtitle="XML namespaces">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tvdtschm.dita" navtitle="Validating XML schemas"></topicref>
-<topicref href="topics/tcxmlsch.dita" linking="targetonly" navtitle="Creating XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-<topicref href="topics/tcxmlsch.dita" linking="targetonly" navtitle="Creating XML schemas">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/rrefintg.dita" navtitle="Referential integrity in the XML schema editor">
-</topicref>
-<topicref href="topics/cxmlsced.dita" linking="targetonly" navtitle="XML schema editor">
-</topicref>
-<topicref href="topics/tedtschm.dita" linking="targetonly" navtitle="Editing XML schema properties">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/rnmspc.dita" navtitle="XML namespaces"></topicref>
-<topicref href="topics/tedtpref.dita" linking="targetonly" navtitle="Editing XML schema file preferences">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddsmpt.dita" navtitle="Adding simple types"></topicref>
-<topicref href="topics/taddreg.dita" navtitle="Adding pattern facets to simple types">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddcmod.dita" navtitle="Adding content models"></topicref>
-<topicref href="topics/taddanye.dita" linking="targetonly" navtitle="Adding an any element">
-</topicref>
-<topicref href="topics/taddelm.dita" linking="targetonly" navtitle="Adding elements">
-</topicref>
-<topicref href="topics/taddelmr.dita" linking="targetonly" navtitle="Adding element references">
-</topicref>
-<topicref href="topics/taddgrpr.dita" linking="targetonly" navtitle="Adding group references">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/tdelscmp.dita" navtitle="Deleting XML schema components">
-</topicref>
-<topicref href="topics/rrefintg.dita" navtitle="Referential integrity in the XML schema editor">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddelm.dita" linking="sourceonly" navtitle="Adding elements">
-</topicref>
-<topicref href="topics/taddelmr.dita" linking="targetonly" navtitle="Adding element references">
-</topicref>
-<topicref href="topics/taddanye.dita" linking="targetonly" navtitle="Adding an any element">
-</topicref>
-<topicref href="topics/taddglba.dita" linking="targetonly" navtitle="Adding global attributes">
-</topicref>
-</topicgroup>
-<topicgroup collection-type="family">
-<topicref href="topics/taddelmr.dita" linking="sourceonly" navtitle="Adding element references">
-</topicref>
-<topicref href="topics/taddelm.dita" linking="targetonly" navtitle="Adding elements">
-</topicref>
-<topicref href="topics/taddanye.dita" linking="targetonly" navtitle="Adding an any element">
-</topicref>
-<topicref href="topics/taddglba.dita" linking="targetonly" navtitle="Adding global attributes">
-</topicref>
-</topicgroup>
-</map>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.xml
deleted file mode 100644
index cbac6ffeeb..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDLeditorrel.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc topic="topics/tcxmlsch.html">
-<topic label="Creating XML schemas" href="topics/tcxmlsch.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<topic label="Importing XML schemas" href="topics/timpschm.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<topic label="Adding import elements" href="topics/taddimpt.html"/>
-<topic label="Adding include elements" href="topics/taddincl.html"/>
-<topic label="Navigating XML schemas" href="topics/tnavsrc.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="Creating XML schemas" href="topics/tcxmlsch.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<topic label="Adding complex types" href="topics/taddcmxt.html"/>
-<topic label="Adding content models" href="topics/taddcmod.html"/>
-<topic label="Adding global elements" href="topics/taddglem.html"/>
-<topic label="Adding content models" href="topics/taddcmod.html"/>
-<topic label="Adding elements" href="topics/taddelm.html"/>
-<topic label="Adding content models" href="topics/taddcmod.html"/>
-<topic label="Adding element references" href="topics/taddelmr.html"/>
-<topic label="Adding global elements" href="topics/taddglem.html"/>
-<topic label="Adding groups" href="topics/taddgrup.html"/>
-<topic label="Adding group references" href="topics/taddgrpr.html"/>
-<topic label="Adding content models" href="topics/taddcmod.html"/>
-<topic label="Adding group references" href="topics/taddgrpr.html"/>
-<topic label="Adding groups" href="topics/taddgrup.html"/>
-<topic label="Adding import elements" href="topics/taddimpt.html"/>
-<topic label="Adding include elements" href="topics/taddincl.html"/>
-<topic label="Adding redefine elements" href="topics/taddrdfn.html"/>
-<topic label="XML namespaces" href="topics/rnmspc.html"/>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<topic label="Creating XML schemas" href="topics/tcxmlsch.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="Creating XML schemas" href="topics/tcxmlsch.html"/>
-<topic label="Referential integrity in the XML schema editor" href="topics/rrefintg.html"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html"/>
-<topic label="XML namespaces" href="topics/rnmspc.html"/>
-<topic label="Editing XML schema file preferences" href="topics/tedtpref.html"/>
-<topic label="Adding simple types" href="topics/taddsmpt.html"/>
-<topic label="Adding pattern facets to simple types" href="topics/taddreg.html"/>
-<topic label="Adding content models" href="topics/taddcmod.html"/>
-<topic label="Adding an any element" href="topics/taddanye.html"/>
-<topic label="Adding elements" href="topics/taddelm.html"/>
-<topic label="Adding element references" href="topics/taddelmr.html"/>
-<topic label="Adding group references" href="topics/taddgrpr.html"/>
-<topic label="Deleting XML schema components" href="topics/tdelscmp.html"/>
-<topic label="Referential integrity in the XML schema editor" href="topics/rrefintg.html"/>
-<topic label="Adding elements" href="topics/taddelm.html"/>
-<topic label="Adding element references" href="topics/taddelmr.html"/>
-<topic label="Adding an any element" href="topics/taddanye.html"/>
-<topic label="Adding global attributes" href="topics/taddglba.html"/>
-<topic label="Adding element references" href="topics/taddelmr.html"/>
-<topic label="Adding elements" href="topics/taddelm.html"/>
-<topic label="Adding an any element" href="topics/taddanye.html"/>
-<topic label="Adding global attributes" href="topics/taddglba.html"/>
-</toc>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap
deleted file mode 100644
index 3207c050c9..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
- "map.dtd">
-<map collection-type="sequence" id="wstxsdtoc" title="XML schemas">
-<topicref href="topics/cworkXSD.dita" linking="sourceonly" navtitle="Working with XML schemas (XSDs)">
-<anchor id="xsd_post_cworkXSD"/>
-<topicref href="topics/tcxmlsch.dita" navtitle="Creating XML schemas"></topicref>
-<anchor id="xsd_post_tcxmlsch"/>
-<topicref href="topics/rlimitations_slushXSD.dita" navtitle="XSD Slush file"
-toc="no"></topicref>
-<anchor id="xsd_post_rlimitations_slushXSD"/>
-<topicref href="topics/timpschm.dita" navtitle="Importing an XML schema">
-</topicref>
-<anchor id="xsd_post_timpschm"/>
-<topicref href="topics/tnavsrc.dita" navtitle="Navigating XML schemas"></topicref>
-<anchor id="xsd_post_tnavsrc"/>
-<topicref href="topics/trefactrXSD.dita" navtitle="Refactoring in XML Schemas">
-</topicref>
-<anchor id="xsd_post_trefactr"/>
-<topicref href="topics/tedtpref.dita" navtitle="Editing XML schema editor preferences">
-</topicref>
-<anchor id="xsd_post_teditpref"/>
-<topicref href="topics/tedtschm.dita" linking="none" navtitle="Editing XML schema properties">
-<anchor id="xsd_post_teditschm"/>
-<topicref href="topics/cxmlsced.dita" id="xsdconcepts" navtitle="XML schema editor">
-</topicref>
-<anchor id="xsd_post_cxmlsced"/>
-<topicref href="topics/taddagrp.dita" navtitle="Adding an attribute group">
-</topicref>
-<anchor id="xsd_post_taddgrp"/>
-<topicref href="topics/taddcmxt.dita" navtitle="Adding a complex type"></topicref>
-<anchor id="xsd_post_taddcmxt"/>
-<topicref href="topics/taddcmod.dita" navtitle="Adding a content model">
-<anchor id="xsd_post_taddcmod"/>
-<topicref href="topics/taddanye.dita" navtitle="Adding an any element"></topicref>
-<anchor id="xsd_post_taddanye"/>
-<topicref href="topics/taddelm.dita" navtitle="Adding an element"></topicref>
-<anchor id="xsd_post_taddelm"/>
-<topicref href="topics/taddelmr.dita" navtitle="Adding an element reference">
-</topicref>
-<anchor id="xsd_post_taddelmr"/>
-<topicref href="topics/taddgrpr.dita" navtitle="Adding a group reference">
-</topicref>
-<anchor id="xsd_post_taddgrpr"/></topicref>
-<topicref href="topics/taddglba.dita" navtitle="Adding a global attribute">
-</topicref>
-<anchor id="xsd_post_taddglba"/>
-<topicref href="topics/taddglem.dita" navtitle="Adding a global element">
-</topicref>
-<anchor id="xsd_post_taddglem"/>
-<topicref href="topics/taddgrup.dita" navtitle="Adding a group"></topicref>
-<anchor id="xsd_post_taddgrup"/>
-<topicref href="topics/taddimpt.dita" navtitle="Adding an import element">
-</topicref>
-<anchor id="xsd_post_taddimpt"/>
-<topicref href="topics/taddincl.dita" navtitle="Adding an include element">
-</topicref>
-<anchor id="xsd_post_taddincl"/>
-<topicref href="topics/taddrdfn.dita" navtitle="Adding a redefine element">
-</topicref>
-<anchor id="xsd_post_taddrdfn"/>
-<topicref href="topics/taddsmpt.dita" navtitle="Adding a simple type">
-<anchor id="xsd_post_taddsmpt"/>
-<topicref href="topics/taddreg.dita" navtitle="Adding a pattern facet to a simple type">
-</topicref>
-<anchor id="xsd_post_taddreg"/></topicref>
-</topicref>
-<topicref href="topics/rxsdicons.dita" id="xsdicons" navtitle="Icons used in the XML schema editor">
-</topicref>
-<anchor id="xsd_post_rxsdicons"/>
-<topicref href="topics/tdelscmp.dita" navtitle="Deleting XML schema components">
-<anchor id="xsd_post_tdelscmp"/>
-<topicref href="topics/rrefintg.dita" navtitle="Referential integrity in the XML schema editor">
-</topicref>
-<anchor id="xsd_post_rrefintg"/></topicref>
-<topicref href="topics/tvdtschm.dita" navtitle="Validating an XML schema">
-</topicref>
-<anchor id="xsd_post_tvtschm"/>
-<topicref href="topics/rnmspc.dita" navtitle="XML namespaces"></topicref>
-<anchor id="xsd_post_rnmspc"/></topicref>
-</map>
-<?Pub *0000003828?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.xml
deleted file mode 100644
index d23e2a2e50..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="XML schemas" topic="topics/cworkXSD.html">
-<topic label="Working with XML schemas" href="topics/cworkXSD.html">
-<anchor id="xsd_post_cworkXSD"/>
-<topic label="Creating XML schemas" href="topics/tcxmlsch.html"/>
-<anchor id="xsd_post_tcxmlsch"/>
-<anchor id="xsd_post_rlimitations_slushXSD"/>
-<topic label="Importing XML schemas" href="topics/timpschm.html"/>
-<anchor id="xsd_post_timpschm"/>
-<topic label="Navigating XML schemas" href="topics/tnavsrc.html"/>
-<anchor id="xsd_post_tnavsrc"/>
-<topic label="Refactoring in XML Schema Files" href="topics/trefactrXSD.html"/>
-<anchor id="xsd_post_trefactr"/>
-<topic label="Editing XML schema file preferences" href="topics/tedtpref.html"/>
-<anchor id="xsd_post_teditpref"/>
-<topic label="Editing XML schema properties" href="topics/tedtschm.html">
-<anchor id="xsd_post_teditschm"/>
-<topic label="XML schema editor" href="topics/cxmlsced.html"/>
-<anchor id="xsd_post_cxmlsced"/>
-<topic label="Adding attribute groups" href="topics/taddagrp.html"/>
-<anchor id="xsd_post_taddgrp"/>
-<topic label="Adding complex types" href="topics/taddcmxt.html"/>
-<anchor id="xsd_post_taddcmxt"/>
-<topic label="Adding content models" href="topics/taddcmod.html">
-<anchor id="xsd_post_taddcmod"/>
-<topic label="Adding an any element" href="topics/taddanye.html"/>
-<anchor id="xsd_post_taddanye"/>
-<topic label="Adding elements" href="topics/taddelm.html"/>
-<anchor id="xsd_post_taddelm"/>
-<topic label="Adding element references" href="topics/taddelmr.html"/>
-<anchor id="xsd_post_taddelmr"/>
-<topic label="Adding group references" href="topics/taddgrpr.html"/>
-<anchor id="xsd_post_taddgrpr"/>
-</topic>
-<topic label="Adding global attributes" href="topics/taddglba.html"/>
-<anchor id="xsd_post_taddglba"/>
-<topic label="Adding global elements" href="topics/taddglem.html"/>
-<anchor id="xsd_post_taddglem"/>
-<topic label="Adding groups" href="topics/taddgrup.html"/>
-<anchor id="xsd_post_taddgrup"/>
-<topic label="Adding import elements" href="topics/taddimpt.html"/>
-<anchor id="xsd_post_taddimpt"/>
-<topic label="Adding include elements" href="topics/taddincl.html"/>
-<anchor id="xsd_post_taddincl"/>
-<topic label="Adding redefine elements" href="topics/taddrdfn.html"/>
-<anchor id="xsd_post_taddrdfn"/>
-<topic label="Adding simple types" href="topics/taddsmpt.html">
-<anchor id="xsd_post_taddsmpt"/>
-<topic label="Adding pattern facets to simple types" href="topics/taddreg.html"/>
-<anchor id="xsd_post_taddreg"/>
-</topic>
-</topic>
-<topic label="Icons used in the XML schema editor" href="topics/rxsdicons.html"/>
-<anchor id="xsd_post_rxsdicons"/>
-<topic label="Deleting XML schema components" href="topics/tdelscmp.html">
-<anchor id="xsd_post_tdelscmp"/>
-<topic label="Referential integrity in the XML schema editor" href="topics/rrefintg.html"/>
-<anchor id="xsd_post_rrefintg"/>
-</topic>
-<topic label="Validating XML schemas" href="topics/tvdtschm.html"/>
-<anchor id="xsd_post_tvtschm"/>
-<topic label="XML namespaces" href="topics/rnmspc.html"/>
-<anchor id="xsd_post_rnmspc"/>
-</topic>
-</toc>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/about.html b/docs/org.eclipse.wst.xsdeditor.doc.user/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/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/docs/org.eclipse.wst.xsdeditor.doc.user/build.properties b/docs/org.eclipse.wst.xsdeditor.doc.user/build.properties
deleted file mode 100644
index 695623ee40..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = XSDeditormap_toc.xml,\
- about.html,\
- org.eclipse.wst.xsdeditor.doc.userindex.xml,\
- images/,\
- plugin.xml,\
- topics/*.htm*,\
- index/,\
- META-INF/,\
- plugin.properties
-src.includes = build.properties,\
- *.maplist,\
- *.ditamap,\
- topics/*.dita
-bin.excludes = DocBuild.xml,\
- myPlugin*.xml \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/Browse.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/Browse.gif
deleted file mode 100644
index 63211bf915..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/Browse.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/More.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/More.gif
deleted file mode 100644
index 63211bf915..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/More.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAll.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAll.gif
deleted file mode 100644
index da37fbad3e..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAll.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAny.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAny.gif
deleted file mode 100644
index a39f93cdce..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAny.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAnyAttribute.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAnyAttribute.gif
deleted file mode 100644
index 5280cc2904..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAnyAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttribute.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroup.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroup.gif
deleted file mode 100644
index 5a8df73015..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroupRef.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroupRef.gif
deleted file mode 100644
index b2c1db9ef4..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeRef.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeRef.gif
deleted file mode 100644
index 8365af2f3c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDAttributeRef.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDChoice.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDChoice.gif
deleted file mode 100644
index 8af583f4bd..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDChoice.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDComplexType.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDComplexType.gif
deleted file mode 100644
index 878b94f132..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElement.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElement.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElementRef.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElementRef.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalAttribute.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalElement.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGlobalElement.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroup.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroup.gif
deleted file mode 100644
index 462c2d4aa5..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroupRef.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroupRef.gif
deleted file mode 100644
index 068987bf0b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDImport.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDImport.gif
deleted file mode 100644
index 9e44ce52a9..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDImport.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDInclude.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDInclude.gif
deleted file mode 100644
index b26c527f5e..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDInclude.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDRedefine.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDRedefine.gif
deleted file mode 100644
index 56964c13a5..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDRedefine.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSequence.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSequence.gif
deleted file mode 100644
index 16b8612332..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSequence.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleEnum.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleEnum.gif
deleted file mode 100644
index 11d7958525..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleEnum.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimplePattern.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimplePattern.gif
deleted file mode 100644
index a113cf45a0..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimplePattern.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleType.gif b/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleType.gif
deleted file mode 100644
index 2e74430cc2..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/images/XSDSimpleType.gif
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs b/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs
deleted file mode 100644
index f075c79587..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable b/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable
deleted file mode 100644
index 593f4708db..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions
deleted file mode 100644
index 0b2a149f46..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions
+++ /dev/null
@@ -1,3 +0,0 @@
-#This is a generated file; do not edit.
-#Mon May 18 17:38:24 EDT 2009
-org.eclipse.wst.xsdeditor.doc.user=org.eclipse.wst.xsdeditor.doc.user\n1.0.700.qualifier
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies
deleted file mode 100644
index f2b76ee23b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-#This is a generated file; do not edit.
-#Mon May 18 17:38:24 EDT 2009
-lucene=1.9.1.v20080530-1600
-analyzer=org.eclipse.help.base\#3.3.101.M20080728_34x?locale\=en
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs
deleted file mode 100644
index 8f7fef405c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs
+++ /dev/null
@@ -1,30 +0,0 @@
-#This is a generated file; do not edit.
-#Mon May 18 17:38:24 EDT 2009
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html=0
-/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html=0
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments b/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments
deleted file mode 100644
index 66564c5a48..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml
deleted file mode 100644
index 737c5cd71c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-
-<plugin>
-
-<extension point="org.eclipse.help.toc">
- <toc file="XSDeditormap_toc.xml"/>
- <index path="index/"/>
-
-</extension>
-
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.xsdeditor.doc.userindex.xml"/>
-</extension>
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.user.maplist b/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.user.maplist
deleted file mode 100644
index 626f463896..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.user.maplist
+++ /dev/null
@@ -1,9 +0,0 @@
-<maplist version="3.6.2">
- <nav>
- <map file="XSDeditormap_toc.ditamap"/>
- </nav>
- <link>
- <map file="XSDeditormap_toc.ditamap"/>
- <map file="XSDLeditorrel.ditamap"/>
- </link>
-</maplist>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.html b/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.html
deleted file mode 100644
index 2f07600ef8..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="copyright" content="(C) Copyright IBM Corporation 2007" />
-<meta name="security" content="public" />
-<meta name="Robots" content="index,follow" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta name="DC.Format" content="XHTML" />
-<!-- All rights reserved. Licensed Materials Property of IBM -->
-<!-- US Government Users Restricted Rights -->
-<!-- Use, duplication or disclosure restricted by -->
-<!-- GSA ADP Schedule Contract with IBM Corp. -->
-<link rel="stylesheet" type="text/css" href="ibmdita.css" />
-<title>Index</title>
-</head>
-<body>
-<h1>Index</h1>
-<a name="IDX0_44" href="#IDX1_44">D</a>
-<a name="IDX0_50" href="#IDX1_50">P</a>
-<a name="IDX0_52" href="#IDX1_52">R</a>
-<a name="IDX0_58" href="#IDX1_58">X</a>
-<hr></hr>
-<strong><a name="IDX1_44" href="#IDX0_44">D</a></strong>
-<ul class="indexlist">
-<li>dependent artifacts
-<ul class="indexlist">
-<li><a href="topics/trefactrXSD.html#refactoring">refactorting XML schema files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_50" href="#IDX0_50">P</a></strong>
-<ul class="indexlist">
-<li>preferences
-<ul class="indexlist">
-<li><a href="topics/tedtpref.html#tedtpref">XML schema files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_52" href="#IDX0_52">R</a></strong>
-<ul class="indexlist">
-<li>refactoring
-<ul class="indexlist">
-<li><a href="topics/trefactrXSD.html#refactoring">XML schema files</a>
-</li>
-</ul>
-</li>
-<li>renaming
-<ul class="indexlist">
-<li><a href="topics/trefactrXSD.html#refactoring">XML schema files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_58" href="#IDX0_58">X</a></strong>
-<ul class="indexlist">
-<li>XML namespaces
-<ul class="indexlist">
-<li><a href="topics/rnmspc.html#rnmspc">overview</a>
-</li>
-</ul>
-</li>
-<li>XML schema editor
-<ul class="indexlist">
-<li><a href="topics/taddanye.html#taddanye">adding an any element</a>
-</li>
-<li><a href="topics/taddrdfn.html#taddrdfn">adding redefine elements</a>
-</li>
-<li><a href="topics/taddagrp.html#taddagrp">attribute groups</a>
-</li>
-<li><a href="topics/rrefintg.html#rrefintg">clean up in</a>
-</li>
-<li><a href="topics/taddcmxt.html#taddcmxt">complex types</a>
-</li>
-<li><a href="topics/taddcmod.html#taddcmod">content models</a>
-</li>
-<li><a href="topics/tdelscmp.html#tdelscmp">deleting components</a>
-</li>
-<li><a href="topics/taddelmr.html#taddelmr">element references</a>
-</li>
-<li><a href="topics/taddelm.html#taddelm">elements</a>
-</li>
-<li><a href="topics/taddglba.html#taddglba">global attributes</a>
-</li>
-<li><a href="topics/taddglem.html#taddglem">global elements</a>
-</li>
-<li><a href="topics/taddgrpr.html#taddgrpr">group features</a>
-</li>
-<li><a href="topics/taddgrup.html#taddgrup">groups</a>
-</li>
-<li><a href="topics/rxsdicons.html#ricons">icons</a>
-</li>
-<li><a href="topics/taddimpt.html#taddimpt">import elements</a>
-</li>
-<li><a href="topics/taddincl.html#taddincl">include elements</a>
-</li>
-<li><a href="topics/cxmlsced.html#cxmlsced">overview</a>
-</li>
-<li><a href="topics/taddreg.html#taddreg">pattern facets</a>
-</li>
-<li><a href="topics/rrefintg.html#rrefintg">referential integrity</a>
-</li>
-<li><a href="topics/taddsmpt.html#taddsmpt">simple types</a>
-</li>
-<li><a href="topics/tedtschm.html#tedtschm">XML schema properties</a>
-</li>
-</ul>
-</li>
-<li>XML schema files
-<ul class="indexlist">
-<li><a href="topics/taddanye.html#taddanye">adding an any element</a>
-</li>
-<li><a href="topics/taddrdfn.html#taddrdfn">adding redefine elements</a>
-</li>
-<li><a href="topics/taddagrp.html#taddagrp">attribute groups</a>
-</li>
-<li><a href="topics/taddcmxt.html#taddcmxt">complex types</a>
-</li>
-<li><a href="topics/taddcmod.html#taddcmod">content models</a>
-</li>
-<li><a href="topics/tcxmlsch.html#tcxmlsch">creating</a>
-</li>
-<li><a href="topics/tdelscmp.html#tdelscmp">deleting components</a>
-</li>
-<li><a href="topics/tedtpref.html#tedtpref">editing preferences</a>
-</li>
-<li><a href="topics/tedtschm.html#tedtschm">editing properties</a>
-</li>
-<li><a href="topics/taddelmr.html#taddelmr">element references</a>
-</li>
-<li><a href="topics/taddelm.html#taddelm">elements</a>
-</li>
-<li><a href="topics/taddglba.html#taddglba">global attributes</a>
-</li>
-<li><a href="topics/taddglem.html#taddglem">global elements</a>
-</li>
-<li><a href="topics/taddgrpr.html#taddgrpr">group features</a>
-</li>
-<li><a href="topics/taddgrup.html#taddgrup">groups</a>
-</li>
-<li><a href="topics/taddimpt.html#taddimpt">import elements</a>
-</li>
-<li><a href="topics/timpschm.html#timpschm">importing</a>
-</li>
-<li><a href="topics/taddincl.html#taddincl">include elements</a>
-</li>
-<li><a href="topics/tnavsrc.html#tnavsrc">navigating</a>
-</li>
-<li><a href="topics/taddreg.html#taddreg">pattern facets</a>
-</li>
-<li><a href="topics/taddsmpt.html#taddsmpt">simple types</a>
-</li>
-<li><a href="topics/tvdtschm.html#tvdtschm">validating</a>
-</li>
-</ul>
-</li>
-<li>XML schemas
-<ul class="indexlist">
-<li><a href="topics/trefactrXSD.html#refactoring">editing</a>
-</li>
-</ul>
-</li>
-</ul>
-</body></html>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml
deleted file mode 100644
index 4cdd8835b2..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<index>
- <entry keyword="XML schema files">
- <entry keyword="creating">
- <topic href="topics/tcxmlsch.html#tcxmlsch" title="Creating XML schemas"/>
- </entry>
- <entry keyword="importing">
- <topic href="topics/timpschm.html#timpschm" title="Importing XML schemas"/>
- </entry>
- <entry keyword="navigating">
- <topic href="topics/tnavsrc.html#tnavsrc" title="Navigating XML schemas"/>
- </entry>
- <entry keyword="editing preferences">
- <topic href="topics/tedtpref.html#tedtpref" title="Editing XML schema file preferences"/>
- </entry>
- <entry keyword="editing properties">
- <topic href="topics/tedtschm.html#tedtschm" title="Editing XML schema properties"/>
- </entry>
- <entry keyword="attribute groups">
- <topic href="topics/taddagrp.html#taddagrp" title="Adding attribute groups"/>
- </entry>
- <entry keyword="complex types">
- <topic href="topics/taddcmxt.html#taddcmxt" title="Adding complex types"/>
- </entry>
- <entry keyword="content models">
- <topic href="topics/taddcmod.html#taddcmod" title="Adding content models"/>
- </entry>
- <entry keyword="adding an any element">
- <topic href="topics/taddanye.html#taddanye" title="Adding an any element"/>
- </entry>
- <entry keyword="elements">
- <topic href="topics/taddelm.html#taddelm" title="Adding elements"/>
- </entry>
- <entry keyword="element references">
- <topic href="topics/taddelmr.html#taddelmr" title="Adding element references"/>
- </entry>
- <entry keyword="group features">
- <topic href="topics/taddgrpr.html#taddgrpr" title="Adding group references"/>
- </entry>
- <entry keyword="global attributes">
- <topic href="topics/taddglba.html#taddglba" title="Adding global attributes"/>
- </entry>
- <entry keyword="global elements">
- <topic href="topics/taddglem.html#taddglem" title="Adding global elements"/>
- </entry>
- <entry keyword="groups">
- <topic href="topics/taddgrup.html#taddgrup" title="Adding groups"/>
- </entry>
- <entry keyword="import elements">
- <topic href="topics/taddimpt.html#taddimpt" title="Adding import elements"/>
- </entry>
- <entry keyword="include elements">
- <topic href="topics/taddincl.html#taddincl" title="Adding include elements"/>
- </entry>
- <entry keyword="adding redefine elements">
- <topic href="topics/taddrdfn.html#taddrdfn" title="Adding redefine elements"/>
- </entry>
- <entry keyword="simple types">
- <topic href="topics/taddsmpt.html#taddsmpt" title="Adding simple types"/>
- </entry>
- <entry keyword="pattern facets">
- <topic href="topics/taddreg.html#taddreg" title="Adding pattern facets to simple types"/>
- </entry>
- <entry keyword="deleting components">
- <topic href="topics/tdelscmp.html#tdelscmp" title="Deleting XML schema components"/>
- </entry>
- <entry keyword="validating">
- <topic href="topics/tvdtschm.html#tvdtschm" title="Validating XML schemas"/>
- </entry>
- </entry>
- <entry keyword="dependent artifacts">
- <entry keyword="refactoring XML schema files">
- <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
- </entry>
- </entry>
- <entry keyword="refactoring">
- <entry keyword="XML schema files">
- <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
- </entry>
- </entry>
- <entry keyword="renaming">
- <entry keyword="XML schema files">
- <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
- </entry>
- </entry>
- <entry keyword="schemas">
- <entry keyword="editing">
- <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
- </entry>
- </entry>
- <entry keyword="preferences">
- <entry keyword="XML schema files">
- <topic href="topics/tedtpref.html#tedtpref" title="Editing XML schema file preferences"/>
- </entry>
- </entry>
- <entry keyword="XML schema editor">
- <entry keyword="XML schema properties">
- <topic href="topics/tedtschm.html#tedtschm" title="Editing XML schema properties"/>
- </entry>
- <entry keyword="overview">
- <topic href="topics/cxmlsced.html#cxmlsced" title="XML schema editor"/>
- </entry>
- <entry keyword="attribute groups">
- <topic href="topics/taddagrp.html#taddagrp" title="Adding attribute groups"/>
- </entry>
- <entry keyword="complex types">
- <topic href="topics/taddcmxt.html#taddcmxt" title="Adding complex types"/>
- </entry>
- <entry keyword="content models">
- <topic href="topics/taddcmod.html#taddcmod" title="Adding content models"/>
- </entry>
- <entry keyword="adding an any element">
- <topic href="topics/taddanye.html#taddanye" title="Adding an any element"/>
- </entry>
- <entry keyword="elements">
- <topic href="topics/taddelm.html#taddelm" title="Adding elements"/>
- </entry>
- <entry keyword="element references">
- <topic href="topics/taddelmr.html#taddelmr" title="Adding element references"/>
- </entry>
- <entry keyword="group features">
- <topic href="topics/taddgrpr.html#taddgrpr" title="Adding group references"/>
- </entry>
- <entry keyword="global attributes">
- <topic href="topics/taddglba.html#taddglba" title="Adding global attributes"/>
- </entry>
- <entry keyword="global elements">
- <topic href="topics/taddglem.html#taddglem" title="Adding global elements"/>
- </entry>
- <entry keyword="groups">
- <topic href="topics/taddgrup.html#taddgrup" title="Adding groups"/>
- </entry>
- <entry keyword="import elements">
- <topic href="topics/taddimpt.html#taddimpt" title="Adding import elements"/>
- </entry>
- <entry keyword="include elements">
- <topic href="topics/taddincl.html#taddincl" title="Adding include elements"/>
- </entry>
- <entry keyword="adding redefine elements">
- <topic href="topics/taddrdfn.html#taddrdfn" title="Adding redefine elements"/>
- </entry>
- <entry keyword="simple types">
- <topic href="topics/taddsmpt.html#taddsmpt" title="Adding simple types"/>
- </entry>
- <entry keyword="pattern facets">
- <topic href="topics/taddreg.html#taddreg" title="Adding pattern facets to simple types"/>
- </entry>
- <entry keyword="icons">
- <topic href="topics/rxsdicons.html#ricons" title="Icons used in the XML schema editor"/>
- </entry>
- <entry keyword="deleting components">
- <topic href="topics/tdelscmp.html#tdelscmp" title="Deleting XML schema components"/>
- </entry>
- <entry keyword="referential integrity">
- <topic href="topics/rrefintg.html#rrefintg" title="Referential integrity in the XML schema editor"/>
- </entry>
- <entry keyword="clean up in">
- <topic href="topics/rrefintg.html#rrefintg" title="Referential integrity in the XML schema editor"/>
- </entry>
- </entry>
- <entry keyword="XML namespaces">
- <entry keyword="overview">
- <topic href="topics/rnmspc.html#rnmspc" title="XML namespaces"/>
- </entry>
- </entry>
-</index> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties
deleted file mode 100644
index 81da418a94..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-# NLS_MESSAGEFORMAT_VAR
-# NLS_ENCODING=UTF-8
-Plugin.name = XML schema editor
-
-Bundle-Vendor.0 = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml
deleted file mode 100644
index 737c5cd71c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.6"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/ -->
-<!-- ================================================= -->
-<!-- This is the plugin for declaring the help -->
-<!-- contributions for using the tool. -->
-<!-- ================================================= -->
-
-<plugin>
-
-<extension point="org.eclipse.help.toc">
- <toc file="XSDeditormap_toc.xml"/>
- <index path="index/"/>
-
-</extension>
-
- <extension point="org.eclipse.help.index">
- <index file="org.eclipse.wst.xsdeditor.doc.userindex.xml"/>
-</extension>
-
-</plugin> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.dita
deleted file mode 100644
index fe8040980e..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.dita
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<?Pub Inc?>
-<concept id="workingwithxmlschemas" xml:lang="en-us">
-<title>Working with XML schemas</title>
-<shortdesc>XML schemas are an XML language for describing and constraining
-the content of XML files.</shortdesc>
-<conbody>
-<p>This sections contains information on the following:</p>
-</conbody>
-<related-links>
-<link href="tcxmlsch.dita"><linktext>Creating XML schemas</linktext></link>
-<link href="timpschm.dita"><linktext>Importing XML schemas</linktext></link>
-<link href="tnavsrc.dita"><linktext>Navigating XML schemas</linktext></link>
-<link href="trefactrXSD.dita"><linktext>Refactoring in XML schemas</linktext>
-</link>
-<link href="tedtpref.dita"><linktext>Editing XML schema file preferences</linktext>
-</link>
-<link href="rxsdicons.dita"><linktext>Icons used in the XML schema editor</linktext>
-</link>
-<link href="tdelscmp.dita"><linktext>Deleting XML schema components</linktext>
-</link>
-<link href="tvdtschm.dita"><linktext>Validating XML schemas</linktext></link>
-<link href="rnmspc.dita"><linktext>XML namespaces</linktext></link>
-</related-links>
-</concept>
-<?Pub *0000001267?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html
deleted file mode 100644
index 558def220c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="Working with XML schemas" />
-<meta name="abstract" content="XML schemas are an XML language for describing and constraining the content of XML files." />
-<meta name="description" content="XML schemas are an XML language for describing and constraining the content of XML files." />
-<meta scheme="URI" name="DC.Relation" content="tcxmlsch.html" />
-<meta scheme="URI" name="DC.Relation" content="timpschm.html" />
-<meta scheme="URI" name="DC.Relation" content="tnavsrc.html" />
-<meta scheme="URI" name="DC.Relation" content="trefactrXSD.html" />
-<meta scheme="URI" name="DC.Relation" content="tedtpref.html" />
-<meta scheme="URI" name="DC.Relation" content="rxsdicons.html" />
-<meta scheme="URI" name="DC.Relation" content="tdelscmp.html" />
-<meta scheme="URI" name="DC.Relation" content="tvdtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="rnmspc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="workingwithxmlschemas" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Working with XML schemas</title>
-</head>
-<body id="workingwithxmlschemas"><a name="workingwithxmlschemas"><!-- --></a>
-
-
-<h1 class="topictitle1">Working with XML schemas</h1>
-
-
-<div><p>XML schemas are an XML language for describing and constraining
-the content of XML files.</p>
-
-<p>This sections contains information on the following:</p>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations.">Creating XML schemas</a></div>
-<div><a href="timpschm.html" title="If you want to work with XML schema files that you created outside of the product, you can import them into the workbench and open them in the XML schema editor. The XML schema editor provides you with a structured view of the XML schema.">Importing XML schemas</a></div>
-<div><a href="tnavsrc.html" title="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to.">Navigating XML schemas</a></div>
-<div><a href="trefactrXSD.html" title="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts.">Refactoring in XML schemas</a></div>
-<div><a href="tedtpref.html" title="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used.">Editing XML schema file preferences</a></div>
-<div><a href="tdelscmp.html" title="If you have created any XML schema components you no longer need, you can delete them.">Deleting XML schema components</a></div>
-<div><a href="tvdtschm.html" title="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.">Validating XML schemas</a></div>
-</div>
-<div class="relref"><strong>Related reference</strong><br />
-<div><a href="rxsdicons.html" title="The following XML schema editor icons appear in the Outline, Design, and Properties view.">Icons used in the XML schema editor</a></div>
-<div><a href="rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita
deleted file mode 100644
index edaab3f985..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "concept.dtd">
-<concept id="cxmlsced" xml:lang="en-us">
-<title>XML schema editor</title>
-<titlealts>
-<searchtitle>XML schema editor</searchtitle>
-</titlealts>
-<shortdesc>This product provides an XML schema editor for creating, viewing,
-and validating XML schemas. XML schemas are a formal specification of element
-names that indicates which elements are allowed in an XML file, and in which
-combinations. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<conbody>
-<p>A schema is functionally equivalent to a DTD, but is written in XML. A
-schema also provides extended functionality such as data typing, inheritance,
-and presentation rules.</p>
-<p>For more information on XML schema, see the following:</p>
-<ul>
-<li> <xref format="html" href="http://www.w3.org/TR/xmlschema-0/" scope="external">http://www.w3.org/TR/xmlschema-0/</xref> </li>
-<li> <xref format="html" href="http://www.w3.org/TR/xmlschema-1/" scope="external">http://www.w3.org/TR/xmlschema-1/</xref> </li>
-<li> <xref format="html" href="http://www.w3.org/TR/xmlschema-2/" scope="external">http://www.w3.org/TR/xmlschema-2/</xref> </li>
-</ul>
-<p>Using the XML schema editor, you can:</p>
-<ul>
-<li>Create and delete XML schema components such as complex types, simple
-types, elements, attributes, attribute groups, and groups.</li>
-<li>Edit XML schemas.</li>
-<li>Import existing XML schemas for structured viewing.</li>
-</ul>
-<p>The XML Schema specification from the W3C Web site is used for validation.</p>
-<section><title>XML schema editor views - Design, Outline, Properties, and
-Source</title>There are four main views you can work with in the XML schema
-editor:<ul>
-<li>Design - the Design view provides a graphical way to edit your schema</li>
-<li>Outline - the Outline view shows you the main components in your XML schema.
-You can use this view to add and remove certain components.</li>
-<li>Properties - the Properties view enables you to edit the properties of
-your XML schema components</li>
-<li>Source - the Source view enables you to edit your source code directly</li>
-</ul></section>
-<section><title>Status of the XML schema</title><p></p><p>Three status indicators
-for the schema are available. They are in the bottom right corner:</p><ul>
-<li> <uicontrol>Writable</uicontrol> or <uicontrol>Read Only</uicontrol>. </li>
-<li> (Source view only) <uicontrol>Smart Insert</uicontrol> or <uicontrol>Overwrite</uicontrol>.
-To toggle between these modes, press the <uicontrol>Insert</uicontrol> button
-on your keyboard.</li>
-<li> Line and column number (displayed in the format <?Pub Caret?><userinput>column
-# : line #</userinput>)</li>
-</ul></section>
-</conbody>
-</concept>
-<?Pub *0000002906?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html
deleted file mode 100644
index d6a991440b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="concept" name="DC.Type" />
-<meta name="DC.Title" content="XML schema editor" />
-<meta name="abstract" content="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations." />
-<meta name="description" content="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations." />
-<meta content="XML schema editor, overview" name="DC.subject" />
-<meta content="XML schema editor, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcxmlsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tvdtschm.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="cxmlsced" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML schema editor</title>
-</head>
-<body id="cxmlsced"><a name="cxmlsced"><!-- --></a>
-
-
-<h1 class="topictitle1">XML schema editor</h1>
-
-
-
-
-<div><p>This product provides an XML schema editor for creating, viewing,
-and validating XML schemas. XML schemas are a formal specification of element
-names that indicates which elements are allowed in an XML file, and in which
-combinations. </p>
-
-<p>A schema is functionally equivalent to a DTD, but is written in XML. A
-schema also provides extended functionality such as data typing, inheritance,
-and presentation rules.</p>
-
-<p>For more information on XML schema, see the following:</p>
-
-<ul>
-<li> <a href="http://www.w3.org/TR/xmlschema-0/" target="_blank">http://www.w3.org/TR/xmlschema-0/</a> </li>
-
-<li> <a href="http://www.w3.org/TR/xmlschema-1/" target="_blank">http://www.w3.org/TR/xmlschema-1/</a> </li>
-
-<li> <a href="http://www.w3.org/TR/xmlschema-2/" target="_blank">http://www.w3.org/TR/xmlschema-2/</a> </li>
-
-</ul>
-
-<p>Using the XML schema editor, you can:</p>
-
-<ul>
-<li>Create and delete XML schema components such as complex types, simple
-types, elements, attributes, attribute groups, and groups.</li>
-
-<li>Edit XML schemas.</li>
-
-<li>Import existing XML schemas for structured viewing.</li>
-
-</ul>
-
-<p>The XML Schema specification from the W3C Web site is used for validation.</p>
-
-<div class="section"><h4 class="sectiontitle">XML schema editor views - Design, Outline, Properties, and
-Source</h4>There are four main views you can work with in the XML schema
-editor:<ul>
-<li>Design - the Design view provides a graphical way to edit your schema</li>
-
-<li>Outline - the Outline view shows you the main components in your XML schema.
-You can use this view to add and remove certain components.</li>
-
-<li>Properties - the Properties view enables you to edit the properties of
-your XML schema components</li>
-
-<li>Source - the Source view enables you to edit your source code directly</li>
-
-</ul>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Status of the XML schema</h4><p />
-<p>Three status indicators
-for the schema are available. They are in the bottom right corner:</p>
-<ul>
-<li> <span class="uicontrol">Writable</span> or <span class="uicontrol">Read Only</span>. </li>
-
-<li> (Source view only) <span class="uicontrol">Smart Insert</span> or <span class="uicontrol">Overwrite</span>.
-To toggle between these modes, press the <span class="uicontrol">Insert</span> button
-on your keyboard.</li>
-
-<li> Line and column number (displayed in the format <kbd class="userinput">column
-# : line #</kbd>)</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations.">Creating XML schemas</a></div>
-<div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix.">Editing XML schema properties</a></div>
-<div><a href="../topics/tvdtschm.html" title="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.">Validating XML schemas</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.dita
deleted file mode 100644
index e50260d98d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.dita
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
-<reference id="rlimitations_slushXSD" xml:lang="en-us">
-<title>Limitations of XML schema editor</title>
-<titlealts>
-<searchtitle>Limitations of XML schema editor</searchtitle>
-</titlealts>
-<shortdesc>This section describes known product aspect limitations and workarounds.</shortdesc>
-<refbody>
-<!--Use this template to single source the readme information. The content for the readme information is maintained in this topic and is inserted into the related topic using the conref attribute. This file will not be surfaced in your navigation.-->
-<section><title>Hebrew Logical encoding</title><p id="encoding"><!--There is no defect associated with this entry. It is from the 5.1 readme.-->When
-Hebrew Logical (ISO-8859-8-I) encoding is selected as a preference for encoding
-of HTML files (<menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
-<uicontrol>Web and XML Files</uicontrol><uicontrol>HTML files</uicontrol>
-</menucascade> in the "When creating files" section), the HTML documentation
-files generated from an XML schema file will still have a UTF-8 encoding.
-This is a known problem.</p></section>
-</refbody>
-</reference>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html
deleted file mode 100644
index 142fc28468..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Limitations of XML schema editor" />
-<meta name="abstract" content="This section describes known product aspect limitations and workarounds." />
-<meta name="description" content="This section describes known product aspect limitations and workarounds." />
-<meta content="XHTML" name="DC.Format" />
-<meta content="rlimitations_slushXSD" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Limitations of XML schema editor</title>
-</head>
-<body id="rlimitations_slushXSD"><a name="rlimitations_slushXSD"><!-- --></a>
-
-
-<h1 class="topictitle1">Limitations of XML schema editor</h1>
-
-
-
-<div><p>This section describes known product aspect limitations and workarounds.</p>
-
-
-<div class="section"><h4 class="sectiontitle">Hebrew Logical encoding</h4><p id="rlimitations_slushXSD__encoding"><a name="rlimitations_slushXSD__encoding"><!-- --></a>When
-Hebrew Logical (ISO-8859-8-I) encoding is selected as a preference for encoding
-of HTML files (<span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
- &gt; <span class="uicontrol">Web and XML Files</span> &gt; <span class="uicontrol">HTML files</span>
-</span> in the "When creating files" section), the HTML documentation
-files generated from an XML schema file will still have a UTF-8 encoding.
-This is a known problem.</p>
-</div>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita
deleted file mode 100644
index 909a463987..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<?Pub Sty _display FontColor="red"?>
-<reference id="rnmspc" xml:lang="en-us">
-<title>XML namespaces</title>
-<titlealts>
-<searchtitle>XML namespaces</searchtitle>
-</titlealts>
-<shortdesc>An XML namespace is a collection of names, identified by
-a URI reference, which are used in XML documents as element types
-and attribute names.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML namespaces<indexterm>overview</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<section>XML namespaces are defined by a W3C recommendation, dating
-16 August 2006, called <xref format="html"
-href="http://www.w3.org/TR/2006/REC-xml-names-20060816/" scope="external">Namespaces
-in XML</xref>. XML tag names should be globally unique, as well as
-short for performance reasons. In order to resolve this conflict,
-the W3C namespace recommendation defines an attribute <b>xmlns</b> which
-can amend any XML element. If it is present in an element, it identifies
-the namespace for this element.</section>
-<section><p>The xmlns attribute has the following syntax:</p><p><codeph>xmlns:<varname>prefix</varname>=namespace</codeph> </p><p>where <codeph>namespace</codeph> is
-a unique URI (such as www.ibm.com) and where <codeph><varname>prefix</varname></codeph> represents
-the namespace and provides a pointer to it.</p><p>In the following
-customer element definition, an accounting namespace is defined in
-order to be able to distinguish the element tags from those appearing
-in customer records created by other business applications:</p><p><codeblock>&lt;acct:customer xmlns:acct="http://www.my.com/acct-REV10">
- &lt;acct:name>Corporation&lt;/acct:name>
- &lt;acct:order acct:ref="5566"/>
- &lt;acct:status>invoice&lt;/acct:status>
-&lt;/acct:customer> </codeblock> </p><p>The namespace definition
-in the first line assigns the namespace http://www.my.com/acct-REV10
-to the prefix. This prefix is used on the element names such as name
-in order to attach them to the namespace. A second application, for
-example, a fulfillment system, can assign a different namespace to
-its customer elements:</p><p><codeblock>&lt;ful:customer xmlns:ful="http://www.your.com/ful">
- &lt;ful:name>Corporation&lt;/ful:name>
- &lt;ful:order ful:ref="A98756"/>
- &lt;ful:status>shipped&lt;/ful:status>
- &lt;/ful:customer></codeblock> </p><p>An application processing both
-data structures is now able to treat the accounting and the fulfillment
-data differently. There is a default namespace. It is set if no local
-name is assigned in the namespace definition:</p><p><codeblock>&lt;acct:customer xmlns="http://www.my.com/acct-REV10" xmlns:acct="http://www.my.com/acct-REV10 ">
-&lt;name>Corporation&lt;/name>
-&lt;order acct:ref="5566"/>
-&lt;status>invoice&lt;/status>
-&lt;/customer></codeblock></p><p>In this example, all tags in the
-customer record are qualified to reside in the namespace http://www.my.com/acct-REV10.
-No explicit prefix is needed because the default namespace is used.
-Note that the default namespace applies to any attributes definitions.</p></section>
-<section><title>XML schemas and namespaces</title><p>In the following
-XML schema, the default namespace for the schema is defined as the
-standard XML schema namespace http://www.w3.org/2001/XMLSchema; there
-is also a schema specific namespace http://www.ibm.com.</p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:TestSchema="http://www.ibm.com">
- &lt;simpleType name="ZipCodeType">
- &lt;restriction base="integer">
- &lt;minInclusive value="10000"/>
- &lt;maxInclusive value="99999"/>
-&lt;/restriction>
- &lt;/simpleType>
- &lt;!--element definitions skipped -->
-&lt;/schema> </codeblock></p><p>Assuming that the preceding XML schema
-is saved as <filepath>C:\temp\TestSchema.xsd</filepath>, a sample
-XML file that validates against this schema is:</p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;x:addressList xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd">
- xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd">
-&lt;x:address>
- &lt;x:street>x:Vangerowstrasse&lt;/x:street>
- &lt;x:zipCode>69115&lt;/x:zipCode>
- &lt;x:city>x:Heidelberg&lt;/x:city>
- &lt;/x:address>
- &lt;x:address>
-&lt;x:street>x:Bernal Road&lt;/x:street>
-&lt;x:zipCode>90375&lt;/x:zipCode>
- &lt;x:city>x:San Jose&lt;/x:city>
- &lt;/x:address>
-&lt;/x:addressList> </codeblock></p></section>
-<section><title>Target namespace</title><p> The target namespace serves
-to identify the namespace within which the association between the
-element and its name exists. In the case of declarations, this association
-determines the namespace of the elements in XML files conforming to
-the schema. An XML file importing a schema must reference its target
-namespace in the schemaLocation attribute. Any mismatches between
-the target and the actual namespace of an element are reported as
-schema validation errors. In our example, the target namespace is
-http://www.ibm.com; it is defined in the XML schema file and referenced
-twice in the XML file. Any mismatch between these three occurrences
-of the namespace lead to validation errors.</p><p> The following examples
-show how target namespaces and namespace prefixes work in XML schemas
-and their corresponding XML instance documents.</p></section>
-<section><title>Sample 1 - A schema with both a default and target
-namespace and unqualified locals</title><p>The XML schema: </p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com">
-&lt;complexType name="AddressType">
-&lt;sequence>
-&lt;element name="name" type="string">&lt;/element>
-&lt;/sequence>
-&lt;/complexType>
-&lt;element name="MyAddress" type="x:AddressType">&lt;/element>
-&lt;/schema> </codeblock> </p><p>A valid XML instance document created
-from this schema looks like this. Local elements and attributes are
-unqualified.</p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com x.xsd ">
-&lt;name>Peter Smith&lt;/name>
-&lt;/x:MyAddress> </codeblock></p><p>When local elements (such as
-the "name" element) and attributes are unqualified in an XML file,
-then only the root element is qualified. So, in this example, the
-"x" namespace prefix is assigned to the root element "MyAddress",
-associating it with the namespace "http://www.ibm.com", but the"x"
-prefix is not assigned to the local element "name".</p></section>
-<section><title>Sample 2 - A schema with both a default and target
-namespace and qualified locals</title><p><codeblock>&lt;?xml version="1.0"?>
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com" elementFormDefault="qualified">
-&lt;complexType name="AddressType">
-&lt;sequence>
-&lt;element name="name" type="string">&lt;/element>
-&lt;/sequence>
-&lt;/complexType>
-&lt;element name="MyAddress" type="x:AddressType">&lt;/element>
- &lt;/schema> </codeblock></p><p>A valid XML instance document created
-from this schema looks like this. Local elements and attributes are
-qualified This is because the elementFormDefault attribute is set
-to qualified in the XML schema.</p><p><codeblock>&lt;?xml version="1.0"?>
- &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.ibm.com x.xsd ">
-&lt;x:name>Peter Smith&lt;/x:name>
- &lt;/x:MyAddress></codeblock> </p><p>In this example, the "x" namespace
-prefix is assigned to both the root element "MyAddress" and the local
-element "name", associating them with the namespace "http://www.ibm.com",.</p></section>
-<section><title>Sample 3 - Schema with target Namespace, and explicitly
-defines xmlns:xsd</title><p>This XML schema adds this attribute: </p><codeph>xmlns:xsd="http://www.w3.org/2001/XMLSchema </codeph><p>What
-this means is that each of the constructs that are defined by the
-XML schema language will need to be qualified with the "xsd" prefix.
-For example, xsd:complexType and xsd:string</p><p>. Note that you
-can chose any other prefixes such as "xs" or "foobar" in your declaration
-and usage.</p><p>You can specify this prefix in the XML schema preferences
-page. For more information, refer to the related tasks.</p><p>All
-user defined types belong to the namespace http://www.ibm.com as
-defined by the targetNamespace attribute, and the prefix is "x" as
-defined by the xmlns:x attribute.</p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com">
-&lt;xsd:complexType name="AddressType">
-&lt;xsd:sequence>
- &lt;xsd:element name="name" type="xsd:string">&lt;/xsd:element>
-&lt;/xsd:sequence>
- &lt;/xsd:complexType>
- &lt;xsd:element name="MyAddress" type="x:AddressType">&lt;/xsd:element>
-&lt;/xsd:schema></codeblock> </p><p>A valid XML instance document
-created from this schema looks like this. Local elements and attributes
-are unqualified. The semantics of qualification is the same as Sample
-1.</p><p><codeblock>&lt;?xml version="1.0"?>
- &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ibm.com x.xsd ">
-&lt;name>Peter Smith&lt;/name>
- &lt;/x:MyAddress></codeblock></p></section>
-<section><title>Sample 4 - Schema with undeclared target Namespace
-that explicitly defines xmlns:xsd</title><p>This XML schema has no
-target namespace for itself. In this case, it is highly recommended
-that all XML schema constructs be explicitly qualified with a prefix
-such as "xsd". The definitions and declarations from this schema such
-as AddressType are referenced without namespace qualification since
-there is no namespace prefix. </p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-&lt;xsd:complexType name="AddressType">
-&lt;xsd:sequence>
-&lt;xsd:element name="name" type="xsd:string">&lt;/xsd:element>
-&lt;xsd:element name="name" type="xsd:string">&lt;/xsd:element>
-&lt;xsd:element name="name" type="xsd:string">&lt;/xsd:element>
-&lt;/xsd:sequence>
-&lt;/xsd:complexType>
-&lt;xsd:element name="MyAddress" type="AddressType">&lt;/xsd:element>
-&lt;/xsd:schema> </codeblock></p><p>A valid XML instance document
-created from the schema looks like this. All elements are unqualified.</p><p><codeblock>&lt;?xml version="1.0"?>
-&lt;MyAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="x.xsd">
-&lt;name>name&lt;/name>
-&lt;/MyAddress></codeblock> </p></section>
-<section><title>Sample 5 - A schema where the target namespace is
-the default namespace</title><p>This is an XML schema where the target
-namespace is the default namespace. As well, the namespace has no
-namespace prefix.</p><p><codeblock>&lt;?xml version="1.0"?>
- &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns="http://www.ibm.com">
-&lt;xsd:complexType name="AddressType">
-&lt;xsd:sequence>
-&lt;xsd:element name="name" type="xsd:string">&lt;/xsd:element>
-&lt;/xsd:sequence>
-&lt;/xsd:complexType>
- &lt;xsd:element name="MyAddress" type="AddressType">&lt;/xsd:element>
- &lt;/xsd:schema> </codeblock> </p><p>A valid XML instance document
-created from the schema looks like this:</p><p><codeblock>&lt;?xml version="1.0" encoding="UTF-8"?>
-&lt;MyAddress xmlns="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com NewXMLSchema.xsd">
-&lt;name>name&lt;/name>
- &lt;/MyAddress> </codeblock> </p></section>
-</refbody>
-</reference><?Pub Caret?>
-<?Pub *0000012038?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html
deleted file mode 100644
index 1e810241da..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html
+++ /dev/null
@@ -1,276 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="XML namespaces" />
-<meta name="abstract" content="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names." />
-<meta name="description" content="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names." />
-<meta content="XML namespaces, overview" name="DC.subject" />
-<meta content="XML namespaces, overview" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtpref.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="rnmspc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML namespaces</title>
-</head>
-<body id="rnmspc"><a name="rnmspc"><!-- --></a>
-
-
-<h1 class="topictitle1">XML namespaces</h1>
-
-
-
-
-<div><p>An XML namespace is a collection of names, identified by a URI
-reference, which are used in XML documents as element types and attribute
-names.</p>
-
-<div class="section">XML namespaces are defined by a W3C recommendation, dating 16 August
-2006, called <a href="http://www.w3.org/TR/2006/REC-xml-names-20060816/" target="_blank">Namespaces in XML</a>. XML tag names should be globally
-unique, as well as short for performance reasons. In order to resolve this
-conflict, the W3C namespace recommendation defines an attribute <strong>xmlns</strong> which
-can amend any XML element. If it is present in an element, it identifies the
-namespace for this element.</div>
-
-<div class="section"><p>The xmlns attribute has the following syntax:</p>
-<p><samp class="codeph">xmlns:<var class="varname">prefix</var>=namespace</samp> </p>
-<p>where <samp class="codeph">namespace</samp> is a unique URI (such as www.ibm.com) and where <samp class="codeph"><var class="varname">prefix</var></samp> represents
-the namespace and provides a pointer to it.</p>
-<p>In the following customer
-element definition, an accounting namespace is defined in order to be able
-to distinguish the element tags from those appearing in customer records created
-by other business applications:</p>
-<div class="p"><pre>&lt;acct:customer xmlns:acct="http://www.my.com/acct-REV10"&gt;
- &lt;acct:name&gt;Corporation&lt;/acct:name&gt;
- &lt;acct:order acct:ref="5566"/&gt;
- &lt;acct:status&gt;invoice&lt;/acct:status&gt;
-&lt;/acct:customer&gt; </pre>
- </div>
-<p>The namespace definition in the first
-line assigns the namespace http://www.my.com/acct-REV10 to the prefix. This
-prefix is used on the element names such as name in order to attach them to
-the namespace. A second application, for example, a fulfillment system, can
-assign a different namespace to its customer elements:</p>
-<div class="p"><pre>&lt;ful:customer xmlns:ful="http://www.your.com/ful"&gt;
- &lt;ful:name&gt;Corporation&lt;/ful:name&gt;
- &lt;ful:order ful:ref="A98756"/&gt;
- &lt;ful:status&gt;shipped&lt;/ful:status&gt;
- &lt;/ful:customer&gt;</pre>
- </div>
-<p>An application processing both data
-structures is now able to treat the accounting and the fulfillment data differently.
-There is a default namespace. It is set if no local name is assigned in the
-namespace definition:</p>
-<div class="p"><pre>&lt;acct:customer xmlns="http://www.my.com/acct-REV10" xmlns:acct="http://www.my.com/acct-REV10 "&gt;
-&lt;name&gt;Corporation&lt;/name&gt;
-&lt;order acct:ref="5566"/&gt;
-&lt;status&gt;invoice&lt;/status&gt;
-&lt;/customer&gt;</pre>
-</div>
-<p>In this example, all tags in the customer
-record are qualified to reside in the namespace http://www.my.com/acct-REV10.
-No explicit prefix is needed because the default namespace is used. Note that
-the default namespace applies to any attributes definitions.</p>
-</div>
-
-<div class="section"><h4 class="sectiontitle">XML schemas and namespaces</h4><p>In the following XML
-schema, the default namespace for the schema is defined as the standard XML
-schema namespace http://www.w3.org/2001/XMLSchema; there is also a schema
-specific namespace http://www.ibm.com.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:TestSchema="http://www.ibm.com"&gt;
- &lt;simpleType name="ZipCodeType"&gt;
- &lt;restriction base="integer"&gt;
- &lt;minInclusive value="10000"/&gt;
- &lt;maxInclusive value="99999"/&gt;
-&lt;/restriction&gt;
- &lt;/simpleType&gt;
- &lt;!--element definitions skipped --&gt;
-&lt;/schema&gt; </pre>
-</div>
-<p>Assuming that the preceding XML schema is
-saved as <span class="filepath">C:\temp\TestSchema.xsd</span>, a sample XML file that
-validates against this schema is:</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;x:addressList xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd"&gt;
- xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd"&gt;
-&lt;x:address&gt;
- &lt;x:street&gt;x:Vangerowstrasse&lt;/x:street&gt;
- &lt;x:zipCode&gt;69115&lt;/x:zipCode&gt;
- &lt;x:city&gt;x:Heidelberg&lt;/x:city&gt;
- &lt;/x:address&gt;
- &lt;x:address&gt;
-&lt;x:street&gt;x:Bernal Road&lt;/x:street&gt;
-&lt;x:zipCode&gt;90375&lt;/x:zipCode&gt;
- &lt;x:city&gt;x:San Jose&lt;/x:city&gt;
- &lt;/x:address&gt;
-&lt;/x:addressList&gt; </pre>
-</div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Target namespace</h4><p> The target namespace serves to
-identify the namespace within which the association between the element and
-its name exists. In the case of declarations, this association determines
-the namespace of the elements in XML files conforming to the schema. An XML
-file importing a schema must reference its target namespace in the schemaLocation
-attribute. Any mismatches between the target and the actual namespace of an
-element are reported as schema validation errors. In our example, the target
-namespace is http://www.ibm.com; it is defined in the XML schema file and
-referenced twice in the XML file. Any mismatch between these three occurrences
-of the namespace lead to validation errors.</p>
-<p> The following examples
-show how target namespaces and namespace prefixes work in XML schemas and
-their corresponding XML instance documents.</p>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Sample 1 - A schema with both a default and target namespace
-and unqualified locals</h4><p>The XML schema: </p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com"&gt;
-&lt;complexType name="AddressType"&gt;
-&lt;sequence&gt;
-&lt;element name="name" type="string"&gt;&lt;/element&gt;
-&lt;/sequence&gt;
-&lt;/complexType&gt;
-&lt;element name="MyAddress" type="x:AddressType"&gt;&lt;/element&gt;
-&lt;/schema&gt; </pre>
- </div>
-<p>A valid XML instance document created from
-this schema looks like this. Local elements and attributes are unqualified.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com x.xsd "&gt;
-&lt;name&gt;Peter Smith&lt;/name&gt;
-&lt;/x:MyAddress&gt; </pre>
-</div>
-<p>When local elements (such as the "name"
-element) and attributes are unqualified in an XML file, then only the root
-element is qualified. So, in this example, the "x" namespace prefix is assigned
-to the root element "MyAddress", associating it with the namespace "http://www.ibm.com",
-but the"x" prefix is not assigned to the local element "name".</p>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Sample 2 - A schema with both a default and target namespace
-and qualified locals</h4><div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com" elementFormDefault="qualified"&gt;
-&lt;complexType name="AddressType"&gt;
-&lt;sequence&gt;
-&lt;element name="name" type="string"&gt;&lt;/element&gt;
-&lt;/sequence&gt;
-&lt;/complexType&gt;
-&lt;element name="MyAddress" type="x:AddressType"&gt;&lt;/element&gt;
- &lt;/schema&gt; </pre>
-</div>
-<p>A valid XML instance document created from
-this schema looks like this. Local elements and attributes are qualified This
-is because the elementFormDefault attribute is set to qualified in the XML
-schema.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
- &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.ibm.com x.xsd "&gt;
-&lt;x:name&gt;Peter Smith&lt;/x:name&gt;
- &lt;/x:MyAddress&gt;</pre>
- </div>
-<p>In this example, the "x" namespace prefix
-is assigned to both the root element "MyAddress" and the local element "name",
-associating them with the namespace "http://www.ibm.com",.</p>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Sample 3 - Schema with target Namespace, and explicitly defines
-xmlns:xsd</h4><p>This XML schema adds this attribute: </p>
-<samp class="codeph">xmlns:xsd="http://www.w3.org/2001/XMLSchema </samp><p>What
-this means is that each of the constructs that are defined by the XML schema
-language will need to be qualified with the "xsd" prefix. For example, xsd:complexType
-and xsd:string</p>
-<p>. Note that you can chose any other prefixes such as
-"xs" or "foobar" in your declaration and usage.</p>
-<p>You can specify this
-prefix in the XML schema preferences page. For more information, refer to
-the related tasks.</p>
-<p>All user defined types belong to the namespace http://www.ibm.com
-as defined by the targetNamespace attribute, and the prefix is "x" as defined
-by the xmlns:x attribute.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com"&gt;
-&lt;xsd:complexType name="AddressType"&gt;
-&lt;xsd:sequence&gt;
- &lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
-&lt;/xsd:sequence&gt;
- &lt;/xsd:complexType&gt;
- &lt;xsd:element name="MyAddress" type="x:AddressType"&gt;&lt;/xsd:element&gt;
-&lt;/xsd:schema&gt;</pre>
- </div>
-<p>A valid XML instance document created
-from this schema looks like this. Local elements and attributes are unqualified.
-The semantics of qualification is the same as Sample 1.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
- &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ibm.com x.xsd "&gt;
-&lt;name&gt;Peter Smith&lt;/name&gt;
- &lt;/x:MyAddress&gt;</pre>
-</div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Sample 4 - Schema with undeclared target Namespace that explicitly
-defines xmlns:xsd</h4><p>This XML schema has no target namespace for itself.
-In this case, it is highly recommended that all XML schema constructs be explicitly
-qualified with a prefix such as "xsd". The definitions and declarations from
-this schema such as AddressType are referenced without namespace qualification
-since there is no namespace prefix. </p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
-&lt;xsd:complexType name="AddressType"&gt;
-&lt;xsd:sequence&gt;
-&lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
-&lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
-&lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
-&lt;/xsd:sequence&gt;
-&lt;/xsd:complexType&gt;
-&lt;xsd:element name="MyAddress" type="AddressType"&gt;&lt;/xsd:element&gt;
-&lt;/xsd:schema&gt; </pre>
-</div>
-<p>A valid XML instance document created
-from the schema looks like this. All elements are unqualified.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
-&lt;MyAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="x.xsd"&gt;
-&lt;name&gt;name&lt;/name&gt;
-&lt;/MyAddress&gt;</pre>
- </div>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Sample 5 - A schema where the target namespace is the default
-namespace</h4><p>This is an XML schema where the target namespace is the
-default namespace. As well, the namespace has no namespace prefix.</p>
-<div class="p"><pre>&lt;?xml version="1.0"?&gt;
- &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns="http://www.ibm.com"&gt;
-&lt;xsd:complexType name="AddressType"&gt;
-&lt;xsd:sequence&gt;
-&lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
-&lt;/xsd:sequence&gt;
-&lt;/xsd:complexType&gt;
- &lt;xsd:element name="MyAddress" type="AddressType"&gt;&lt;/xsd:element&gt;
- &lt;/xsd:schema&gt; </pre>
- </div>
-<p>A valid XML instance document created
-from the schema looks like this:</p>
-<div class="p"><pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;MyAddress xmlns="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com NewXMLSchema.xsd"&gt;
-&lt;name&gt;name&lt;/name&gt;
- &lt;/MyAddress&gt; </pre>
- </div>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtpref.html" title="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used.">Editing XML schema file preferences</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita
deleted file mode 100644
index 812b302209..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="rrefintg" xml:lang="en-us">
-<title>Referential integrity in the XML schema editor</title>
-<titlealts>
-<searchtitle>Referential integrity</searchtitle>
-</titlealts>
-<shortdesc>The XML schema editor has a built-in mechanism to handle referential
-integrity issues. When you delete certain nodes, clean up for any nodes affected
-will automatically occur.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>referential integrity</indexterm></indexterm>
-<indexterm>XML schema editor<indexterm>clean up in</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<section>When you define a complex type, you can add a content model to it
-and reference a global element. <p>For example:<codeblock>&lt;schema>
- &lt;element name="comment" type="string">
- &lt;complexType name="Items">
- &lt;sequence>
-<?Pub Caret?> &lt;element ref="comment">
- &lt;/sequence>
- &lt;/complexType>
-&lt;/schema></codeblock></p><p>If the global element (comment) was deleted,
-all references to it would be in error. However, when you delete the global
-element, the XML schema editor will clean up using the following algorithm:</p><ul>
-<li>If there are one or more global elements in the schema, it will change
-all existing references to the first global element.</li>
-<li>If there is no global element, then it will delete the element reference
-from the content model.</li>
-</ul></section>
-<section><title>Deleting included and imported schema</title><p>If an included
-or imported schema is deleted, you must manually reset the following type
-references as appropriate: <ul>
-<li>Global element and element's type.</li>
-<li>Attribute type.</li>
-<li>Complex type derivation.</li>
-<li>Simple type derivation.</li>
-</ul>They will not automatically be reset if an included or imported schema
-is deleted.</p></section>
-</refbody>
-</reference>
-<?Pub *0000002046?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html
deleted file mode 100644
index 1d7b42d09f..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Referential integrity in the XML schema editor" />
-<meta name="abstract" content="The XML schema editor has a built-in mechanism to handle referential integrity issues. When you delete certain nodes, clean up for any nodes affected will automatically occur." />
-<meta name="description" content="The XML schema editor has a built-in mechanism to handle referential integrity issues. When you delete certain nodes, clean up for any nodes affected will automatically occur." />
-<meta content="XML schema editor, referential integrity, clean up in" name="DC.subject" />
-<meta content="XML schema editor, referential integrity, clean up in" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tdelscmp.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="rrefintg" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Referential integrity</title>
-</head>
-<body id="rrefintg"><a name="rrefintg"><!-- --></a>
-
-
-<h1 class="topictitle1">Referential integrity in the XML schema editor</h1>
-
-
-
-
-<div><p>The XML schema editor has a built-in mechanism to handle referential
-integrity issues. When you delete certain nodes, clean up for any nodes affected
-will automatically occur.</p>
-
-<div class="section">When you define a complex type, you can add a content model to it
-and reference a global element. <div class="p">For example:<pre>&lt;schema&gt;
- &lt;element name="comment" type="string"&gt;
- &lt;complexType name="Items"&gt;
- &lt;sequence&gt;
- &lt;element ref="comment"&gt;
- &lt;/sequence&gt;
- &lt;/complexType&gt;
-&lt;/schema&gt;</pre>
-</div>
-<p>If the global element (comment) was deleted,
-all references to it would be in error. However, when you delete the global
-element, the XML schema editor will clean up using the following algorithm:</p>
-<ul>
-<li>If there are one or more global elements in the schema, it will change
-all existing references to the first global element.</li>
-
-<li>If there is no global element, then it will delete the element reference
-from the content model.</li>
-
-</ul>
-</div>
-
-<div class="section"><h4 class="sectiontitle">Deleting included and imported schema</h4><div class="p">If an included
-or imported schema is deleted, you must manually reset the following type
-references as appropriate: <ul>
-<li>Global element and element's type.</li>
-
-<li>Attribute type.</li>
-
-<li>Complex type derivation.</li>
-
-<li>Simple type derivation.</li>
-
-</ul>
-They will not automatically be reset if an included or imported schema
-is deleted.</div>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlsced.html" title="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations.">XML schema editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix.">Editing XML schema properties</a></div>
-<div><a href="../topics/tdelscmp.html" title="If you have created any XML schema components you no longer need, you can delete them.">Deleting XML schema components</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.dita
deleted file mode 100644
index 93dea39966..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.dita
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "reference.dtd">
-<reference id="ricons" xml:lang="en-us">
-<title>Icons used in the XML schema editor</title>
-<titlealts>
-<searchtitle>XML schema editor icons</searchtitle>
-</titlealts>
-<shortdesc>The following XML schema editor icons appear in the Outline, Design,
-and Properties view.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>icons</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<refbody>
-<section></section>
-<table>
-<tgroup cols="2"><colspec colname="COLSPEC0"/><colspec colname="COLSPEC1"/>
-<tbody>
-<row>
-<entry colname="COLSPEC0" valign="bottom"><b>Icon</b></entry>
-<entry colname="COLSPEC1" valign="bottom"><b>Description</b></entry>
-</row>
-<row>
-<entry><image href="../images/XSDAnyAttribute.gif"><alt>This graphic is the
-any attribute icon </alt></image></entry>
-<entry><codeph>any</codeph> attribute</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAny.gif"><alt>This graphic is the any element
-icon </alt></image></entry>
-<entry><codeph>any</codeph> element</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAttribute.gif"><alt>This graphic is the attribute
-icon </alt></image></entry>
-<entry>attribute</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAttributeGroup.gif"><alt>This graphic is
-the attribute group icon </alt></image></entry>
-<entry>attribute group</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAttributeGroupRef.gif"><alt>This graphic
-is the attribute group reference icon </alt></image></entry>
-<entry>attribute group reference</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAttributeRef.gif"><alt>This graphic is the
-attribute reference icon </alt></image></entry>
-<entry>attribute reference</entry>
-</row>
-<row>
-<entry><image href="../images/XSDAll.gif"><alt>This graphic is the content
-model - all icon </alt></image></entry>
-<entry>content model - all</entry>
-</row>
-<row>
-<entry colname="COLSPEC0"><image href="../images/XSDChoice.gif"><alt>This
-graphic is the content model - choice icon </alt></image></entry>
-<entry colname="COLSPEC1">content model - choice</entry>
-</row>
-<row>
-<entry colname="COLSPEC0"><image href="../images/XSDSequence.gif"><alt>This
-graphic is the content model - sequence icon </alt></image></entry>
-<entry colname="COLSPEC1">content model - sequence</entry>
-</row>
-<row>
-<entry><image href="../images/XSDComplexType.gif"><alt>This graphic is the
-any element icon </alt></image></entry>
-<entry>complex type</entry>
-</row>
-<row>
-<entry><image href="../images/XSDElement.gif"><alt>This graphic is the element
-icon </alt></image></entry>
-<entry>element</entry>
-</row>
-<row>
-<entry><image href="../images/XSDElementRef.gif"><alt>This graphic is the
-element reference icon </alt></image></entry>
-<entry>element reference</entry>
-</row>
-<row>
-<entry><image href="../images/XSDSimpleEnum.gif"><alt>This graphic is the
-enumeration icon </alt></image></entry>
-<entry>enumeration</entry>
-</row>
-<row>
-<entry><image href="../images/XSDGlobalAttribute.gif"><alt>This graphic is
-the global attribute icon </alt></image></entry>
-<entry>global attribute</entry>
-</row>
-<row>
-<entry> <image href="../images/XSDGlobalElement.gif"><alt>This graphic is
-the global element icon </alt></image></entry>
-<entry>global element</entry>
-</row>
-<row>
-<entry> <image href="../images/XSDGroup.gif"><alt>This graphic is the group
-icon </alt></image></entry>
-<entry>group</entry>
-</row>
-<row>
-<entry><image href="../images/XSDGroupRef.gif"><alt>This graphic is the group
-reference icon </alt></image></entry>
-<entry>group reference</entry>
-</row>
-<row>
-<entry><image href="../images/XSDImport.gif"><alt>This graphic is the import
-icon </alt></image></entry>
-<entry>import</entry>
-</row>
-<row>
-<entry><image href="../images/XSDInclude.gif"><alt>This graphic is the include
-icon </alt></image></entry>
-<entry>include</entry>
-</row>
-<row>
-<entry><image href="../images/XSDSimplePattern.gif"><alt>This graphic is the
-pattern icon </alt></image></entry>
-<entry>pattern</entry>
-</row>
-<row>
-<entry><image href="../images/XSDRedefine.gif"><alt>This graphic is the redefine
-icon </alt></image></entry>
-<entry>redefine</entry>
-</row>
-<row>
-<entry><image href="../images/XSDSimpleType.gif"><alt>This graphic is the
-simple type icon </alt></image></entry>
-<entry>simple type</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</refbody>
-</reference>
-<?Pub *0000004581?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html
deleted file mode 100644
index b6cce0305a..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="reference" name="DC.Type" />
-<meta name="DC.Title" content="Icons used in the XML schema editor" />
-<meta name="abstract" content="The following XML schema editor icons appear in the Outline, Design, and Properties view." />
-<meta name="description" content="The following XML schema editor icons appear in the Outline, Design, and Properties view." />
-<meta content="XML schema editor, icons" name="DC.subject" />
-<meta content="XML schema editor, icons" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="ricons" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>XML schema editor icons</title>
-</head>
-<body id="ricons"><a name="ricons"><!-- --></a>
-
-
-<h1 class="topictitle1">Icons used in the XML schema editor</h1>
-
-
-
-
-<div><p>The following XML schema editor icons appear in the Outline, Design,
-and Properties view.</p>
-
-<div class="section" />
-
-
-<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
-<tbody>
-<tr>
-<td valign="bottom"><strong>Icon</strong></td>
-
-<td valign="bottom"><strong>Description</strong></td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAnyAttribute.gif" alt="This graphic is the&#10;any attribute icon " /></td>
-
-<td valign="top"><samp class="codeph">any</samp> attribute</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAny.gif" alt="This graphic is the any element&#10;icon " /></td>
-
-<td valign="top"><samp class="codeph">any</samp> element</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAttribute.gif" alt="This graphic is the attribute&#10;icon " /></td>
-
-<td valign="top">attribute</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAttributeGroup.gif" alt="This graphic is&#10;the attribute group icon " /></td>
-
-<td valign="top">attribute group</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAttributeGroupRef.gif" alt="This graphic&#10;is the attribute group reference icon " /></td>
-
-<td valign="top">attribute group reference</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAttributeRef.gif" alt="This graphic is the&#10;attribute reference icon " /></td>
-
-<td valign="top">attribute reference</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDAll.gif" alt="This graphic is the content&#10;model - all icon " /></td>
-
-<td valign="top">content model - all</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDChoice.gif" alt="This&#10;graphic is the content model - choice icon " /></td>
-
-<td valign="top">content model - choice</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDSequence.gif" alt="This&#10;graphic is the content model - sequence icon " /></td>
-
-<td valign="top">content model - sequence</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDComplexType.gif" alt="This graphic is the&#10;any element icon " /></td>
-
-<td valign="top">complex type</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDElement.gif" alt="This graphic is the element&#10;icon " /></td>
-
-<td valign="top">element</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDElementRef.gif" alt="This graphic is the&#10;element reference icon " /></td>
-
-<td valign="top">element reference</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDSimpleEnum.gif" alt="This graphic is the&#10;enumeration icon " /></td>
-
-<td valign="top">enumeration</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDGlobalAttribute.gif" alt="This graphic is&#10;the global attribute icon " /></td>
-
-<td valign="top">global attribute</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/XSDGlobalElement.gif" alt="This graphic is&#10;the global element icon " /></td>
-
-<td valign="top">global element</td>
-
-</tr>
-
-<tr>
-<td valign="top"> <img src="../images/XSDGroup.gif" alt="This graphic is the group&#10;icon " /></td>
-
-<td valign="top">group</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDGroupRef.gif" alt="This graphic is the group&#10;reference icon " /></td>
-
-<td valign="top">group reference</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDImport.gif" alt="This graphic is the import&#10;icon " /></td>
-
-<td valign="top">import</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDInclude.gif" alt="This graphic is the include&#10;icon " /></td>
-
-<td valign="top">include</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDSimplePattern.gif" alt="This graphic is the&#10;pattern icon " /></td>
-
-<td valign="top">pattern</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDRedefine.gif" alt="This graphic is the redefine&#10;icon " /></td>
-
-<td valign="top">redefine</td>
-
-</tr>
-
-<tr>
-<td valign="top"><img src="../images/XSDSimpleType.gif" alt="This graphic is the&#10;simple type icon " /></td>
-
-<td valign="top">simple type</td>
-
-</tr>
-
-</tbody>
-
-</table>
-</div>
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita
deleted file mode 100644
index ad6151743d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="taddagrp" xml:lang="en-us">
-<title>Adding attribute groups</title>
-<titlealts>
-<searchtitle>Adding attribute groups</searchtitle>
-</titlealts>
-<shortdesc>An attribute group definition is an association between
-a name and a set of attribute declarations. Named groups of attribute
-declarations can greatly facilitate the maintenance and reuse of common
-attribute declarations in an XML schema.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>attribute groups</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>attribute groups</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-add an attribute group to an XML schema, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, right-click the <uicontrol>Attributes</uicontrol> folder
-and click <uicontrol>Add Attribute Group</uicontrol>. </cmd><info>It
-appears in the <uicontrol>Attributes</uicontrol> folder.</info></step>
-<step><cmd>Select your new group, and in the Design view, right-click
-the attribute group and select <menucascade><uicontrol>Refactor</uicontrol>
-<uicontrol>Rename</uicontrol></menucascade>. In the <uicontrol>New
-Name</uicontrol> field, type a name for the attribute group and click <uicontrol>OK</uicontrol>.</cmd>
-</step>
-<step><cmd>To add an attribute, right-click your attribute group in
-the Outline view, click <uicontrol>Add Attribute</uicontrol>. </cmd>
-<info>The attribute appears below the attribute group in the Outline
-view.</info>
-<substeps>
-<substep><cmd>Select the attribute, and in the Design view, click
-the current (default) name of the attribute, then type the new <uicontrol>Name</uicontrol>.</cmd>
-</substep>
-<substep><cmd>In the Design view, click the current (default) attribute
-type and select a type from the menu. Alternately, you can select
-browse to invoke the Set Type menu for more options. </cmd><info>The
-Set Type dialog lists all built-in and user-defined types currently
-available. You can change the <uicontrol>Scope</uicontrol> of the
-list by selecting one of the following options:<ul>
-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available
-in your workspace. </li>
-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types
-available in the project that contains your file. </li>
-<li><uicontrol>Current Resource</uicontrol> (default). List all of
-the types available in your current file.</li>
-<li><uicontrol>Working Sets</uicontrol>. List all the types available
-within the selected working set.</li>
-</ul></info></substep>
-</substeps>
-</step>
-<step><cmd>An attribute reference provides a reference to a global
-attribute. To add an attribute reference, in the Design view, right-click
-the complex type containing the element, and click <uicontrol>Add
-Attribute Ref</uicontrol>. </cmd><info>A declaration that references
-a global attribute enables the referenced attribute to appear in the
-instance document in the context of the referencing declaration. Select
-the reference, then in the Properties view, select the attribute you
-want it to reference from the <uicontrol>Reference</uicontrol> list.<?Pub
-Caret?></info></step>
-<step><cmd>An attribute group reference provides a reference to an
-attribute group. To add an attribute group reference, in the Design
-view, right-click the complex type containing the element, and click <uicontrol>Add
-Attribute Group Ref</uicontrol>. </cmd><info>A declaration that references
-a global attribute enables the referenced attribute to appear in the
-instance document in the context of the referencing declaration. Select
-the reference, then in the Properties view, select the attribute group
-you want it to reference from the <uicontrol>Reference</uicontrol> list.</info>
-</step>
-<step><cmd>An <codeph>any</codeph> element enables element content
-according to namespaces, and the corresponding <codeph>any</codeph> attribute
-element enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,
-right-click your attribute group and click <uicontrol>Add Any Attribute</uicontrol>. </cmd>
-<info>The <codeph>any</codeph> appears below the attribute group in
-the Outline view. You can specify the following values for an <codeph>any</codeph> attribute:</info>
-<choices>
-<choice>For a <uicontrol>Namespace</uicontrol> value, you can select:<ul>
-<li><b>##any</b>: this allows any well-formed XML from any namespace.</li>
-<li><b>##local </b>: this allows any well-formed XML that is not declared
-to be in a namespace.</li>
-<li><b>##other</b>: this allows any well-formed XML that is not from
-the target namespace of the type being defined.</li>
-<li><b>##targetNamespace </b>: this is shorthand for the target namespace
-of the type being defined.</li>
-</ul></choice>
-<choice>For a <uicontrol>Process Contents</uicontrol> value, you can
-select:<ul>
-<li><b>skip</b>: the XML processor will not validate the attribute
-content at all.</li>
-<li><b>lax</b>: the XML processor will validate the attribute content
-as much as it can.</li>
-<li><b>strict</b>: the XML processor will validate all the attribute
-content.</li>
-</ul></choice>
-</choices>
-</step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000005544?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html
deleted file mode 100644
index 723b39aef5..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html
+++ /dev/null
@@ -1,153 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding attribute groups" />
-<meta name="abstract" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
-<meta name="description" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
-<meta content="XML schema editor, attribute groups, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, attribute groups, XML schema files" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddagrp" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding attribute groups</title>
-</head>
-<body id="taddagrp"><a name="taddagrp"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding attribute groups</h1>
-
-
-
-
-<div><p>An attribute group definition is an association between
-a name and a set of attribute declarations. Named groups of attribute
-declarations can greatly facilitate the maintenance and reuse of common
-attribute declarations in an XML schema.</p>
-
-<div class="section"><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-add an attribute group to an XML schema, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>In the Outline view, right-click the <span class="uicontrol">Attributes</span> folder
-and click <span class="uicontrol">Add Attribute Group</span>. </span> It
-appears in the <span class="uicontrol">Attributes</span> folder.</li>
-
-<li class="stepexpand"><span>Select your new group, and in the Design view, right-click
-the attribute group and select <span class="menucascade"><span class="uicontrol">Refactor</span>
- &gt; <span class="uicontrol">Rename</span></span>. In the <span class="uicontrol">New
-Name</span> field, type a name for the attribute group and click <span class="uicontrol">OK</span>.</span>
-</li>
-
-<li class="stepexpand"><span>To add an attribute, right-click your attribute group in
-the Outline view, click <span class="uicontrol">Add Attribute</span>. </span>
- The attribute appears below the attribute group in the Outline
-view.
-<ol type="a">
-<li class="substepexpand"><span>Select the attribute, and in the Design view, click
-the current (default) name of the attribute, then type the new <span class="uicontrol">Name</span>.</span>
-</li>
-
-<li class="substepexpand"><span>In the Design view, click the current (default) attribute
-type and select a type from the menu. Alternately, you can select
-browse to invoke the Set Type menu for more options. </span> The
-Set Type dialog lists all built-in and user-defined types currently
-available. You can change the <span class="uicontrol">Scope</span> of the
-list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available
-in your workspace. </li>
-
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types
-available in the project that contains your file. </li>
-
-<li><span class="uicontrol">Current Resource</span> (default). List all of
-the types available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>. List all the types available
-within the selected working set.</li>
-
-</ul>
-</li>
-
-</ol>
-
-</li>
-
-<li class="stepexpand"><span>An attribute reference provides a reference to a global
-attribute. To add an attribute reference, in the Design view, right-click
-the complex type containing the element, and click <span class="uicontrol">Add
-Attribute Ref</span>. </span> A declaration that references
-a global attribute enables the referenced attribute to appear in the
-instance document in the context of the referencing declaration. Select
-the reference, then in the Properties view, select the attribute you
-want it to reference from the <span class="uicontrol">Reference</span> list.</li>
-
-<li class="stepexpand"><span>An attribute group reference provides a reference to an
-attribute group. To add an attribute group reference, in the Design
-view, right-click the complex type containing the element, and click <span class="uicontrol">Add
-Attribute Group Ref</span>. </span> A declaration that references
-a global attribute enables the referenced attribute to appear in the
-instance document in the context of the referencing declaration. Select
-the reference, then in the Properties view, select the attribute group
-you want it to reference from the <span class="uicontrol">Reference</span> list.
-</li>
-
-<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content
-according to namespaces, and the corresponding <samp class="codeph">any</samp> attribute
-element enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
-right-click your attribute group and click <span class="uicontrol">Add Any Attribute</span>. </span>
- The <samp class="codeph">any</samp> appears below the attribute group in
-the Outline view. You can specify the following values for an <samp class="codeph">any</samp> attribute:
-<ul>
-<li>For a <span class="uicontrol">Namespace</span> value, you can select:<ul>
-<li><strong>##any</strong>: this allows any well-formed XML from any namespace.</li>
-
-<li><strong>##local </strong>: this allows any well-formed XML that is not declared
-to be in a namespace.</li>
-
-<li><strong>##other</strong>: this allows any well-formed XML that is not from
-the target namespace of the type being defined.</li>
-
-<li><strong>##targetNamespace </strong>: this is shorthand for the target namespace
-of the type being defined.</li>
-
-</ul>
-</li>
-
-<li>For a <span class="uicontrol">Process Contents</span> value, you can
-select:<ul>
-<li><strong>skip</strong>: the XML processor will not validate the attribute
-content at all.</li>
-
-<li><strong>lax</strong>: the XML processor will validate the attribute content
-as much as it can.</li>
-
-<li><strong>strict</strong>: the XML processor will validate all the attribute
-content.</li>
-
-</ul>
-</li>
-
-</ul>
-
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita
deleted file mode 100644
index c18c7cd03d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddanye" xml:lang="en-us">
-<title>Adding an any element</title>
-<titlealts>
-<searchtitle>Adding an any element</searchtitle>
-</titlealts>
-<shortdesc>You can use the <codeph>any</codeph> element in a similar
-way as a DTD's ANY content model, however, it must be done in conjunction
-with namespaces. This enables you to include any well-formed XML content,
-such as an HTML Web page that conforms to XHTML 1.0 syntax.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>adding an any element</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>adding an any element</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>For example:</p><p><codeblock>&lt;element name = "MyWebPage">
-&lt;complexType>
-&lt;any namespace="http://www.w3.org/1999/xhtml"
- minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
-&lt;/complexType>
-&lt;/element></codeblock></p><p>The preceding schema fragment allows
-a <codeph>&lt;MyWebPage></codeph> element to contain any well-formed
-XHTML data that appears in the specified namespace.</p><p>The following
-instructions were written for the Resource perspective, but they will
-also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element,
-complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Outline view, right-click the content model that
-you want to work with and click <uicontrol>Add Any</uicontrol>. </cmd>
-</step>
-<step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
-<step><cmd>In the Properties view, for a <uicontrol>Namespace</uicontrol> value,
-you can select:</cmd>
-<choices>
-<choice><b>##any</b>: this allows any well-formed XML from any namespace.</choice>
-<choice><b>##local </b>: this allows any well-formed XML that is not
-declared to be in a namespace.</choice>
-<choice><b>##other </b>: this allows any well-formed XML that is not
-from the target namespace of the type being defined.</choice>
-<choice><b>##targetNamespace</b>: this is shorthand for the target
-namespace of the type being defined.</choice>
-</choices>
-</step>
-<step><cmd>For a <uicontrol>Process Contents</uicontrol> value, you
-can select:</cmd>
-<choices>
-<choice><b>skip</b>: the XML processor will not validate the content
-at all.</choice>
-<choice><b>lax</b>: the XML processor will validate the content as
-much as it can.</choice>
-<choice><b>strict</b>: the XML processor will validate all the content.</choice>
-</choices>
-</step>
-<step><cmd>The <uicontrol>Minimum Occurrence</uicontrol> value is
-the number of times the <codeph>any</codeph> element must appear in
-an instance document. You can select <uicontrol>0</uicontrol> if you
-want the element to be optional; otherwise, select <uicontrol>1</uicontrol>. </cmd>
-</step>
-<step><cmd>The <uicontrol>Maximum Occurrence</uicontrol> value is
-the maximum number of times an <codeph>any</codeph> element can appear
-in an instance document. You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>,
-or, to indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you
-want to provide any information about this element. <?Pub Caret?></cmd>
-<info>The <uicontrol>Documentation</uicontrol> page is used for human
-readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</step>
-</steps>
-<postreq><draft-comment>(c) Copyright 2001, World Wide Web (Massachusetts
-Institute of Technology, Institut National de Recherche en Informatique
-et en Automatique, Keio University).</draft-comment></postreq>
-</taskbody>
-</task>
-<?Pub *0000004086?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html
deleted file mode 100644
index 625b7a5e43..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding an any element" />
-<meta name="abstract" content="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax." />
-<meta name="description" content="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax." />
-<meta content="XML schema editor, adding an any element, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding an any element, XML schema files" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddanye" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding an any element</title>
-</head>
-<body id="taddanye"><a name="taddanye"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding an any element</h1>
-
-
-
-
-<div><p>You can use the <samp class="codeph">any</samp> element in a similar
-way as a DTD's ANY content model, however, it must be done in conjunction
-with namespaces. This enables you to include any well-formed XML content,
-such as an HTML Web page that conforms to XHTML 1.0 syntax.</p>
-
-<div class="section"><p>For example:</p>
-<div class="p"><pre>&lt;element name = "MyWebPage"&gt;
-&lt;complexType&gt;
-&lt;any namespace="http://www.w3.org/1999/xhtml"
- minOccurs="1" maxOccurs="unbounded" processContents="skip"/&gt;
-&lt;/complexType&gt;
-&lt;/element&gt;</pre>
-</div>
-<p>The preceding schema fragment allows
-a <samp class="codeph">&lt;MyWebPage&gt;</samp> element to contain any well-formed
-XHTML data that appears in the specified namespace.</p>
-<p>The following
-instructions were written for the Resource perspective, but they will
-also work in many other perspectives.</p>
-<p>To add an <samp class="codeph">any</samp> element,
-complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Outline view, right-click the content model that
-you want to work with and click <span class="uicontrol">Add Any</span>. </span>
-</li>
-
-<li class="stepexpand"><span>Select the new <samp class="codeph">any</samp> element.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, for a <span class="uicontrol">Namespace</span> value,
-you can select:</span>
-<ul>
-<li><strong>##any</strong>: this allows any well-formed XML from any namespace.</li>
-
-<li><strong>##local </strong>: this allows any well-formed XML that is not
-declared to be in a namespace.</li>
-
-<li><strong>##other </strong>: this allows any well-formed XML that is not
-from the target namespace of the type being defined.</li>
-
-<li><strong>##targetNamespace</strong>: this is shorthand for the target
-namespace of the type being defined.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>For a <span class="uicontrol">Process Contents</span> value, you
-can select:</span>
-<ul>
-<li><strong>skip</strong>: the XML processor will not validate the content
-at all.</li>
-
-<li><strong>lax</strong>: the XML processor will validate the content as
-much as it can.</li>
-
-<li><strong>strict</strong>: the XML processor will validate all the content.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>The <span class="uicontrol">Minimum Occurrence</span> value is
-the number of times the <samp class="codeph">any</samp> element must appear in
-an instance document. You can select <span class="uicontrol">0</span> if you
-want the element to be optional; otherwise, select <span class="uicontrol">1</span>. </span>
-</li>
-
-<li class="stepexpand"><span>The <span class="uicontrol">Maximum Occurrence</span> value is
-the maximum number of times an <samp class="codeph">any</samp> element can appear
-in an instance document. You can select <span class="uicontrol">0</span>, <span class="uicontrol">1</span>,
-or, to indicate there is no maximum number of occurrences, <span class="uicontrol">unbounded</span>.</span>
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
-want to provide any information about this element. </span>
- The <span class="uicontrol">Documentation</span> page is used for human
-readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-<div class="section" />
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita
deleted file mode 100644
index 7f69dda4c7..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddcmod" xml:lang="en-us">
-<title>Adding content models</title>
-<titlealts>
-<searchtitle>Adding content models</searchtitle>
-</titlealts>
-<shortdesc>A content model is the representation of any data that can be contained
-inside an element, global element, complex type, or group. It is a formal
-description of the structure and permissible content of an element, global
-element, complex type, or group, which may be used to validate a document
-instance.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>content models</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>content models</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>There are three different kinds of content models:<ul>
-<li><b>Sequence</b>, which means that all the content model's children can
-appear in an instance of the XML schema. They must, however, appear in the
-order they are listed in the content model.</li>
-<li><b>Choice</b>, which means that only one of the content model's children
-can appear in an instance of the XML schema.</li>
-<li><b>All</b>, which means that all of the content model's children can appear
-once or not at all, and they can appear in any order. If you select this option,
-all of the contents model's children must be individual elements and no element
-in the content model can appear more than once.</li>
-</ul></p><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To add a content
-model to an element, global element, complex type, or group, complete the
-following steps:</p></context>
-<steps>
-<step><cmd>In the Design view, select your complex type, or group:</cmd>
-<choices>
-<choice>If you selected a complex type, you can right-click it and click <uicontrol>Add
-Sequence</uicontrol>, or <uicontrol>Add Choice</uicontrol> to add the type
-of content model you want to your complex type. If you wish to use the <uicontrol>all</uicontrol> content
-model, you can change the model by clicking the model in the Design view,
-and in properties, select <uicontrol>all</uicontrol> as the <uicontrol>Kind</uicontrol>.
-Your content model is automatically added as a child of your complex type
-- expand in the Outline view to see it. <b>Note:</b> These options will not
-appear if you have set a base type for your complex type. You can either set
-a base type for your complex type, or you add a content model to it, but you
-cannot do both.</choice>
-<choice>Your group is automatically created with a sequence content model
-child. Expand it in the Outline view to see it and select it. In the Properties
-view, you can select to change it to a <uicontrol>choice</uicontrol> or <uicontrol>all</uicontrol> content
-model by selecting these options from the <uicontrol>Kind</uicontrol> drop-down.</choice>
-</choices>
-</step>
-<step importance="optional"><cmd>Select the appropriate value in the <uicontrol>Minimum
-Occurr<?Pub Caret?>ence</uicontrol> field.</cmd><info>This is the minimum
-number of times the content model must appear. If you want the content model
-to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info>
-</step>
-<step importance="optional"><cmd>Select the appropriate value in the <uicontrol>Maximum
-Occurrence</uicontrol> field.</cmd><info>This is the maximum number of times
-a content model can appear. You can select <uicontrol>unbounded</uicontrol> to
-indicate there is no maximum number of occurrences.</info></step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this content model.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-</steps>
-<postreq><p>You can add the following items to a content object model: </p><ul>
-<li>Another content model.</li>
-<li>A group reference which enables the referenced group to appear in the
-instance document in the context of the referencing declaration. This menu
-option only appears if there are global groups defined elsewhere in the document
-or if groups are defined in included schemas.</li>
-<li>An element, fundamental building blocks in XML.</li>
-<li>An element reference, which provides a reference to a global element.
-This menu option only appears if there are global elements defined elsewhere
-in the document.</li>
-<li>An <codeph>any</codeph> element. You can use an <codeph>any</codeph> element
-to extend your content model by any elements belonging to a specified namespace.</li>
-</ul></postreq>
-</taskbody>
-</task>
-<?Pub *0000005101?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html
deleted file mode 100644
index 06915bed30..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding content models" />
-<meta name="abstract" content="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance." />
-<meta name="description" content="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance." />
-<meta content="XML schema editor, content models, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, content models, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddelm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddgrpr.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddcmod" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding content models</title>
-</head>
-<body id="taddcmod"><a name="taddcmod"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding content models</h1>
-
-
-
-
-<div><p>A content model is the representation of any data that can be contained
-inside an element, global element, complex type, or group. It is a formal
-description of the structure and permissible content of an element, global
-element, complex type, or group, which may be used to validate a document
-instance.</p>
-
-<div class="section"><div class="p">There are three different kinds of content models:<ul>
-<li><strong>Sequence</strong>, which means that all the content model's children can
-appear in an instance of the XML schema. They must, however, appear in the
-order they are listed in the content model.</li>
-
-<li><strong>Choice</strong>, which means that only one of the content model's children
-can appear in an instance of the XML schema.</li>
-
-<li><strong>All</strong>, which means that all of the content model's children can appear
-once or not at all, and they can appear in any order. If you select this option,
-all of the contents model's children must be individual elements and no element
-in the content model can appear more than once.</li>
-
-</ul>
-</div>
-<p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add a content
-model to an element, global element, complex type, or group, complete the
-following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view, select your complex type, or group:</span>
-<ul>
-<li>If you selected a complex type, you can right-click it and click <span class="uicontrol">Add
-Sequence</span>, or <span class="uicontrol">Add Choice</span> to add the type
-of content model you want to your complex type. If you wish to use the <span class="uicontrol">all</span> content
-model, you can change the model by clicking the model in the Design view,
-and in properties, select <span class="uicontrol">all</span> as the <span class="uicontrol">Kind</span>.
-Your content model is automatically added as a child of your complex type
-- expand in the Outline view to see it. <strong>Note:</strong> These options will not
-appear if you have set a base type for your complex type. You can either set
-a base type for your complex type, or you add a content model to it, but you
-cannot do both.</li>
-
-<li>Your group is automatically created with a sequence content model
-child. Expand it in the Outline view to see it and select it. In the Properties
-view, you can select to change it to a <span class="uicontrol">choice</span> or <span class="uicontrol">all</span> content
-model by selecting these options from the <span class="uicontrol">Kind</span> drop-down.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><strong>Optional: </strong><span>Select the appropriate value in the <span class="uicontrol">Minimum
-Occurrence</span> field.</span> This is the minimum
-number of times the content model must appear. If you want the content model
-to be optional, select <span class="uicontrol">0</span>. Otherwise, select <span class="uicontrol">1</span>.
-</li>
-
-<li class="stepexpand"><strong>Optional: </strong><span>Select the appropriate value in the <span class="uicontrol">Maximum
-Occurrence</span> field.</span> This is the maximum number of times
-a content model can appear. You can select <span class="uicontrol">unbounded</span> to
-indicate there is no maximum number of occurrences.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this content model.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-</ol>
-
-<div class="section"><p>You can add the following items to a content object model: </p>
-<ul>
-<li>Another content model.</li>
-
-<li>A group reference which enables the referenced group to appear in the
-instance document in the context of the referencing declaration. This menu
-option only appears if there are global groups defined elsewhere in the document
-or if groups are defined in included schemas.</li>
-
-<li>An element, fundamental building blocks in XML.</li>
-
-<li>An element reference, which provides a reference to a global element.
-This menu option only appears if there are global elements defined elsewhere
-in the document.</li>
-
-<li>An <samp class="codeph">any</samp> element. You can use an <samp class="codeph">any</samp> element
-to extend your content model by any elements belonging to a specified namespace.</li>
-
-</ul>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddanye.html" title="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax.">Adding an any element</a></div>
-<div><a href="../topics/taddelm.html" title="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements.">Adding elements</a></div>
-<div><a href="../topics/taddelmr.html" title="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration.">Adding element references</a></div>
-<div><a href="../topics/taddgrpr.html" title="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration.">Adding group references</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita
deleted file mode 100644
index b8bd7eb138..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Sty _display FontColor="red"?>
-<?Pub Inc?>
-<task id="taddcmxt" xml:lang="en-us">
-<title>Adding complex types</title>
-<titlealts>
-<searchtitle>Adding complex types</searchtitle>
-</titlealts>
-<shortdesc>A complex type allows elements in its content and can carry
-attributes. Complex types can be used to help determine the appropriate
-content for any instance documents generated from or associated with
-your XML schema.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>complex types</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>complex types</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>You can add as many complex types as you want to an XML
-schema.</p><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-add a complex type to an XML schema, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>Right-click the Types category in the Design view, click <uicontrol>Add
-Complex Type</uicontrol> and type the name for the complex type. If
-you need to change the name later, you can edit it in the <uicontrol>General</uicontrol> tab
-of the Properties view.</cmd></step>
-<step><cmd>To set a base type for the complex type, right-click the
-type in the Design view and click <uicontrol>Set Base Type</uicontrol>. </cmd>
-<info>You can either set a base type for your complex type, or you
-can add a content model to it (which represents any data that can
-be contained inside an element), but you cannot do both. For more
-information about content models, see <xref href="taddcmod.dita"
-scope="peer">Adding content models</xref>.</info></step>
-<step><cmd>Your new type can be derived from its base type either
-by extension or restriction. By default, the derivation is set to
-extension. To change how the type is derived, click the <uicontrol>General</uicontrol> tab
-in the Properties view and select <uicontrol>restriction</uicontrol> or <uicontrol>extension</uicontrol> from
-the <uicontrol>Inherited By</uicontrol> list. </cmd></step>
-<step><cmd>To add attributes to your complex type, in the Design view,
-right-click your complex type and select <uicontrol>Add Attribute</uicontrol>. </cmd>
-<info>An attribute associates an attribute name with a specific type
-and value. </info><?Pub Caret1?>
-<substeps>
-<substep><cmd>To set the name of the attribute, in the Design view,
-double-click the name of the attribute and type the name.</cmd>
-</substep>
-<substep><cmd>To set the type of the attribute, in the Design view,
-double-click the attribute type and then select the new type from
-the list.</cmd></substep>
-</substeps>
-<info>For information about adding attributes, attribute references,
-and <userinput>any</userinput> attributes, see <xref href="taddagrp.dita"
-scope="peer">Adding attribute groups</xref>.</info></step>
-<step><cmd>You can further define your complex type in the Properties
-view:</cmd>
-<substeps>
-<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if
-you want to provide any information about this complex type. </cmd>
-<info>The <uicontrol>Documentation</uicontrol> page is used for human
-readable material, such as a description.</info></substep>
-<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</substep>
-</substeps>
-</step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000003841?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html
deleted file mode 100644
index 78ee6f3d04..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding complex types" />
-<meta name="abstract" content="A complex type allows elements in its content and can carry attributes. Complex types can be used to help determine the appropriate content for any instance documents generated from or associated with your XML schema." />
-<meta name="description" content="A complex type allows elements in its content and can carry attributes. Complex types can be used to help determine the appropriate content for any instance documents generated from or associated with your XML schema." />
-<meta content="XML schema editor, complex types, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, complex types, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddcmxt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding complex types</title>
-</head>
-<body id="taddcmxt"><a name="taddcmxt"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding complex types</h1>
-
-
-
-
-<div><p>A complex type allows elements in its content and can carry
-attributes. Complex types can be used to help determine the appropriate
-content for any instance documents generated from or associated with
-your XML schema.</p>
-
-<div class="section"><p>You can add as many complex types as you want to an XML
-schema.</p>
-<p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-add a complex type to an XML schema, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>Right-click the Types category in the Design view, click <span class="uicontrol">Add
-Complex Type</span> and type the name for the complex type. If
-you need to change the name later, you can edit it in the <span class="uicontrol">General</span> tab
-of the Properties view.</span></li>
-
-<li class="stepexpand"><span>To set a base type for the complex type, right-click the
-type in the Design view and click <span class="uicontrol">Set Base Type</span>. </span>
- You can either set a base type for your complex type, or you
-can add a content model to it (which represents any data that can
-be contained inside an element), but you cannot do both. For more
-information about content models, see <a href="taddcmod.html">Adding content models</a>.</li>
-
-<li class="stepexpand"><span>Your new type can be derived from its base type either
-by extension or restriction. By default, the derivation is set to
-extension. To change how the type is derived, click the <span class="uicontrol">General</span> tab
-in the Properties view and select <span class="uicontrol">restriction</span> or <span class="uicontrol">extension</span> from
-the <span class="uicontrol">Inherited By</span> list. </span></li>
-
-<li class="stepexpand"><span>To add attributes to your complex type, in the Design view,
-right-click your complex type and select <span class="uicontrol">Add Attribute</span>. </span>
- An attribute associates an attribute name with a specific type
-and value.
-<ol type="a">
-<li><span>To set the name of the attribute, in the Design view,
-double-click the name of the attribute and type the name.</span>
-</li>
-
-<li><span>To set the type of the attribute, in the Design view,
-double-click the attribute type and then select the new type from
-the list.</span></li>
-
-</ol>
-
- For information about adding attributes, attribute references,
-and <kbd class="userinput">any</kbd> attributes, see <a href="taddagrp.html">Adding attribute groups</a>.</li>
-
-<li class="stepexpand"><span>You can further define your complex type in the Properties
-view:</span>
-<ol type="a">
-<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
-you want to provide any information about this complex type. </span>
- The <span class="uicontrol">Documentation</span> page is used for human
-readable material, such as a description.</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddcmod.html" title="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance.">Adding content models</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita
deleted file mode 100644
index 8b19bf5b43..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="taddelm" xml:lang="en-us">
-<title>Adding elements</title>
-<titlealts>
-<searchtitle>Adding elements</searchtitle>
-</titlealts>
-<shortdesc>Elements are fundamental building blocks in XML. Element
-declarations provide value constraints, provide a description that
-can be used for validation, establish constraining relationships between
-related elements and attributes, and control the substitution of elements.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>elements</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>elements</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-add an element, complete the following steps:</p></context>
-<steps>
-<step><cmd>To add an element, in the Design view, right-click the
-content model (sequence, choice, or all element) you want to work
-with and click <uicontrol>Add Element</uicontrol>.</cmd><info>The
-element appears attached to the content model in the Design view.</info>
-<substeps>
-<substep><cmd>In the Design view, select the element, and click the
-current (default) name of the element, which puts you in direct editing
-mode, then type the new <uicontrol>Name</uicontrol> and press enter.</cmd>
-</substep>
-<substep><cmd>In the Design view, click the current (default) element
-type and select a type from the menu. Alternately, you can select
-browse to invoke the Set Type dialog for more options.</cmd><info>The
-Set Type dialog lists all built-in and user-defined types currently
-available. You can change the <uicontrol>Scope</uicontrol> of the
-list by selecting one of the following options:<ul>
-<li><uicontrol>Workspace</uicontrol>: lists all of the types available
-in your workspace.</li>
-<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types
-available in the project that contains your file.</li>
-<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of
-the types available in your current file.</li>
-<li><uicontrol>Working Sets</uicontrol>: list all the types available
-within the selected working set.</li>
-</ul></info></substep>
-</substeps>
-</step>
-<step><cmd>(Optional) In the Properties view, select the appropriate
-value in the <uicontrol>Minimum Occurrence</uicontrol> field. </cmd>
-<info>This is the number of times the element can appear in an instance
-document. If you want the element to be optional, select <uicontrol>0</uicontrol>.
-Otherwise, select <uicontrol>1</uicontrol>. </info></step>
-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Maximum
-Occurrence</uicontrol> field. </cmd><info>This is the maximum number
-of times the element can appear in an instance document. Select <uicontrol>unbounded</uicontrol> to
-indicate there is no maximum number of occurrences.</info></step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you
-want to provide any information about this element. </cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info>
-</step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. <?Pub Caret?></cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</step>
-</steps>
-<postreq>You can add a content model to an element, which is the representation
-of any data that can be contained inside the element. For more information
-about working with content models, refer to the related tasks.</postreq>
-</taskbody>
-</task>
-<?Pub *0000003893?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html
deleted file mode 100644
index 4b15f37ddc..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding elements" />
-<meta name="abstract" content="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements." />
-<meta name="description" content="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements." />
-<meta content="XML schema editor, elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, elements, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddglba.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddelm" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding elements</title>
-</head>
-<body id="taddelm"><a name="taddelm"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding elements</h1>
-
-
-
-
-<div><p>Elements are fundamental building blocks in XML. Element
-declarations provide value constraints, provide a description that
-can be used for validation, establish constraining relationships between
-related elements and attributes, and control the substitution of elements.</p>
-
-<div class="section"><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-add an element, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>To add an element, in the Design view, right-click the
-content model (sequence, choice, or all element) you want to work
-with and click <span class="uicontrol">Add Element</span>.</span> The
-element appears attached to the content model in the Design view.
-<ol type="a">
-<li class="substepexpand"><span>In the Design view, select the element, and click the
-current (default) name of the element, which puts you in direct editing
-mode, then type the new <span class="uicontrol">Name</span> and press enter.</span>
-</li>
-
-<li class="substepexpand"><span>In the Design view, click the current (default) element
-type and select a type from the menu. Alternately, you can select
-browse to invoke the Set Type dialog for more options.</span> The
-Set Type dialog lists all built-in and user-defined types currently
-available. You can change the <span class="uicontrol">Scope</span> of the
-list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>: lists all of the types available
-in your workspace.</li>
-
-<li><span class="uicontrol">Enclosing Project</span>: lists all of the types
-available in the project that contains your file.</li>
-
-<li>(Default) <span class="uicontrol">Current Resource</span>: list all of
-the types available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>: list all the types available
-within the selected working set.</li>
-
-</ul>
-</li>
-
-</ol>
-
-</li>
-
-<li class="stepexpand"><span>(Optional) In the Properties view, select the appropriate
-value in the <span class="uicontrol">Minimum Occurrence</span> field. </span>
- This is the number of times the element can appear in an instance
-document. If you want the element to be optional, select <span class="uicontrol">0</span>.
-Otherwise, select <span class="uicontrol">1</span>. </li>
-
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Maximum
-Occurrence</span> field. </span> This is the maximum number
-of times the element can appear in an instance document. Select <span class="uicontrol">unbounded</span> to
-indicate there is no maximum number of occurrences.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
-want to provide any information about this element. </span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-<div class="section">You can add a content model to an element, which is the representation
-of any data that can be contained inside the element. For more information
-about working with content models, refer to the related tasks.</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddcmod.html" title="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance.">Adding content models</a></div>
-<div><a href="../topics/taddelmr.html" title="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration.">Adding element references</a></div>
-<div><a href="../topics/taddanye.html" title="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax.">Adding an any element</a></div>
-<div><a href="../topics/taddglba.html" title="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference.">Adding global attributes</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita
deleted file mode 100644
index 21c66d3ede..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddelmr" xml:lang="en-us">
-<title>Adding element references</title>
-<titlealts>
-<searchtitle>Adding element references</searchtitle>
-</titlealts>
-<shortdesc>An element reference provides a reference to a global element.
-A declaration that references a global element enables the referenced global
-element to appear in the instance document in the context of the referencing
-declaration.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>element references</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>element references</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To add an element
-reference, complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Design view, right-click the content model (sequence, choice,
-or all element) you want to work with and click <uicontrol>Add Element Ref</uicontrol>.</cmd>
-<stepresult>If no global element is defined in the document, a new global
-element is created for you, and the element reference will point to it.</stepresult>
-</step>
-<step><cmd>Select the element reference. To specify values for an element
-reference:</cmd>
-<choices>
-<choice>Click the name of the element reference in the Design view. Enter
-the name of the element reference.</choice>
-<choice>Click the element reference type in the Design view. Select a type
-from the menu, or select <uicontrol>Browse</uicontrol> for more options.</choice>
-</choices>
-</step>
-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Minimum
-Occurrence</uicontrol> field.</cmd><info>This is the number of times the global
-element referenced can appear in an instance document. If you want the element
-to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info>
-</step>
-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Maximum
-Occurrence<?Pub Caret?></uicontrol> field.</cmd><info>This is the maximum
-number of times the global element referenced can appear. You can select <uicontrol>unbounded</uicontrol> to
-indicate there is no maximum number of occurrences.</info></step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this element reference.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000003039?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html
deleted file mode 100644
index a85ec38495..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding element references" />
-<meta name="abstract" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
-<meta name="description" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
-<meta content="XML schema editor, element references, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, element references, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddglem.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddelm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddglba.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddelmr" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding element references</title>
-</head>
-<body id="taddelmr"><a name="taddelmr"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding element references</h1>
-
-
-
-
-<div><p>An element reference provides a reference to a global element.
-A declaration that references a global element enables the referenced global
-element to appear in the instance document in the context of the referencing
-declaration.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add an element
-reference, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view, right-click the content model (sequence, choice,
-or all element) you want to work with and click <span class="uicontrol">Add Element Ref</span>.</span>
- If no global element is defined in the document, a new global
-element is created for you, and the element reference will point to it.
-</li>
-
-<li class="stepexpand"><span>Select the element reference. To specify values for an element
-reference:</span>
-<ul>
-<li>Click the name of the element reference in the Design view. Enter
-the name of the element reference.</li>
-
-<li>Click the element reference type in the Design view. Select a type
-from the menu, or select <span class="uicontrol">Browse</span> for more options.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Minimum
-Occurrence</span> field.</span> This is the number of times the global
-element referenced can appear in an instance document. If you want the element
-to be optional, select <span class="uicontrol">0</span>. Otherwise, select <span class="uicontrol">1</span>.
-</li>
-
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Maximum
-Occurrence</span> field.</span> This is the maximum
-number of times the global element referenced can appear. You can select <span class="uicontrol">unbounded</span> to
-indicate there is no maximum number of occurrences.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this element reference.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddglem.html" title="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model.">Adding global elements</a></div>
-<div><a href="../topics/taddelm.html" title="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements.">Adding elements</a></div>
-<div><a href="../topics/taddanye.html" title="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax.">Adding an any element</a></div>
-<div><a href="../topics/taddglba.html" title="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference.">Adding global attributes</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita
deleted file mode 100644
index e3ad07789c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddglba" xml:lang="en-us">
-<title>Adding global attributes</title>
-<titlealts>
-<searchtitle>Adding global attributes</searchtitle>
-</titlealts>
-<shortdesc>A global attribute is an attribute that can be recognized anywhere
-in a document. Once declared, a global attribute can be referenced in one
-or more declarations using an attribute reference.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>global attributes</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>global attributes</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To add a global
-attribute, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Design view, right-click in the <b>Attributes</b> section
-and click <uicontrol>Add Attribute</uicontrol>.</cmd></step>
-<step><cmd>In the Properties view, enter a name for the attribute in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>In the Properties view, you can select the attribute <uicontrol>Type</uicontrol> from
-the predefined list in the menu next to the <uicontrol>Type</uicontrol> field.</cmd>
-<info><p>Alternatively, you can select <uicontrol>Browse</uicontrol> from
-the list for more options. </p><p>The Set Type dialog will appear, and lists
-all built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of
-the list by selecting one of the following options:<ul>
-<li><uicontrol>Workspace</uicontrol>: lists all of the types available in
-your workspace. </li>
-<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available
-in the project that contains your file. </li>
-<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types
-available in your current file.</li>
-<li><uicontrol>Working Sets</uicontrol>: l<?Pub Caret?>ist all the types available
-within the selected working set.</li>
-</ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this global attribute.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002983?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html
deleted file mode 100644
index f7b145b9fe..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding global attributes" />
-<meta name="abstract" content="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference." />
-<meta name="description" content="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference." />
-<meta content="XML schema editor, global attributes, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, global attributes, XML schema files" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddglba" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding global attributes</title>
-</head>
-<body id="taddglba"><a name="taddglba"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding global attributes</h1>
-
-
-
-
-<div><p>A global attribute is an attribute that can be recognized anywhere
-in a document. Once declared, a global attribute can be referenced in one
-or more declarations using an attribute reference.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add a global
-attribute, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>In the Design view, right-click in the <strong>Attributes</strong> section
-and click <span class="uicontrol">Add Attribute</span>.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, enter a name for the attribute in the <span class="uicontrol">Name</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>In the Properties view, you can select the attribute <span class="uicontrol">Type</span> from
-the predefined list in the menu next to the <span class="uicontrol">Type</span> field.</span>
- <p>Alternatively, you can select <span class="uicontrol">Browse</span> from
-the list for more options. </p>
-<div class="p">The Set Type dialog will appear, and lists
-all built-in and user-defined types currently available. You can change the <span class="uicontrol">Scope</span> of
-the list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>: lists all of the types available in
-your workspace. </li>
-
-<li><span class="uicontrol">Enclosing Project</span>: lists all of the types available
-in the project that contains your file. </li>
-
-<li>(Default) <span class="uicontrol">Current Resource</span>: list all of the types
-available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>: list all the types available
-within the selected working set.</li>
-
-</ul>
-</div>
-<p>Select the type you want in the type list, then click <span class="uicontrol">OK</span>. </p>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this global attribute.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita
deleted file mode 100644
index 90abd007ef..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddglem" xml:lang="en-us">
-<title>Adding global elements</title>
-<titlealts>
-<searchtitle>Adding global elements</searchtitle>
-</titlealts>
-<shortdesc>A global element is an element with a global scope. It is one that
-has been declared as part of the main schema rather than as part of a content
-model.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>global elements</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>global elements</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To add a global
-element, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, select your schema.</cmd><info>The entire
-schema and its contents are displayed in the Design view.</info></step>
-<step><cmd>In the Design view, right-click in the <b>Elements</b> section
-and click <uicontrol>Add Element</uicontrol>.</cmd></step>
-<step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab,
-and type a new name for the global element in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>In the Properties view, you can select the attribute type from
-the predefined list in the menu next to the <uicontrol>Type</uicontrol> field.</cmd>
-<info><p>Alternatively, you can select <uicontrol>Browse</uicontrol> from
-the list for more options. </p><p>The <uicontrol>Set Type</uicontrol> dialog
-box appears, and lists all built-in and user-defined types currently available.
-You can change the <uicontrol>Scope</uicontrol> of the list by selecting one
-of the following options:<ul>
-<li><uicontrol>Workspace</uicontrol>: lists all of the types available in
-your workspace. </li>
-<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available
-in the project that contains your file. </li>
-<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types
-available in your current file.</li>
-<li><uicontrol>Working Sets</uicontrol>: list all the types available within
-the selected working set.</li>
-</ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>
-</step>
-<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab.</cmd><info>In this
-page, you can specify the following various values for the global element: </info>
-<choices>
-<choice><uicontrol>Abstract</uicontrol>: click <b>true</b> if you want the
-global element to be abstract. When a global element is declared to be abstract,
-it cannot be used in an instance document. Instead, a member of that global
-element's substitution group must appear in the instance document.</choice>
-<choice><uicontrol>Block</uicontrol>: determines whether the global element
-may be replaced by an element derived from it.</choice>
-<choice><uicontrol>Final</uicontrol>: determines whether this global element
-may be derived from.</choice>
-<choice><uicontrol>Substitution Group</uicontrol>: a substitution group allows
-elements to be substituted for other elements.</choice>
-<choice><uicontrol>Nillable</uicontrol>: select <b>true</b> if you do not
-want the global element to be able to have any child elements, only attributes. </choice>
-</choices>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab to provide any
-information about this global element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab to add application
-information elements to your annotations of schema components.</cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</step><?Pub Caret?>
-</steps>
-<postreq>You can add a content model to a global element, which is the representation
-of any data that can be contained inside the global element. For more information
-about working with content models, refer to the related tasks.</postreq>
-</taskbody>
-</task>
-<?Pub *0000004383?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html
deleted file mode 100644
index 2ba1df3d21..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding global elements" />
-<meta name="abstract" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
-<meta name="description" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
-<meta content="XML schema editor, global elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, global elements, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddglem" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding global elements</title>
-</head>
-<body id="taddglem"><a name="taddglem"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding global elements</h1>
-
-
-
-
-<div><p>A global element is an element with a global scope. It is one that
-has been declared as part of the main schema rather than as part of a content
-model.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add a global
-element, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
-schema and its contents are displayed in the Design view.</li>
-
-<li class="stepexpand"><span>In the Design view, right-click in the <strong>Elements</strong> section
-and click <span class="uicontrol">Add Element</span>.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">General</span> tab,
-and type a new name for the global element in the <span class="uicontrol">Name</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>In the Properties view, you can select the attribute type from
-the predefined list in the menu next to the <span class="uicontrol">Type</span> field.</span>
- <p>Alternatively, you can select <span class="uicontrol">Browse</span> from
-the list for more options. </p>
-<div class="p">The <span class="uicontrol">Set Type</span> dialog
-box appears, and lists all built-in and user-defined types currently available.
-You can change the <span class="uicontrol">Scope</span> of the list by selecting one
-of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>: lists all of the types available in
-your workspace. </li>
-
-<li><span class="uicontrol">Enclosing Project</span>: lists all of the types available
-in the project that contains your file. </li>
-
-<li>(Default) <span class="uicontrol">Current Resource</span>: list all of the types
-available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>: list all the types available within
-the selected working set.</li>
-
-</ul>
-</div>
-<p>Select the type you want in the type list, then click <span class="uicontrol">OK</span>. </p>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Advanced</span> tab.</span> In this
-page, you can specify the following various values for the global element:
-<ul>
-<li><span class="uicontrol">Abstract</span>: click <strong>true</strong> if you want the
-global element to be abstract. When a global element is declared to be abstract,
-it cannot be used in an instance document. Instead, a member of that global
-element's substitution group must appear in the instance document.</li>
-
-<li><span class="uicontrol">Block</span>: determines whether the global element
-may be replaced by an element derived from it.</li>
-
-<li><span class="uicontrol">Final</span>: determines whether this global element
-may be derived from.</li>
-
-<li><span class="uicontrol">Substitution Group</span>: a substitution group allows
-elements to be substituted for other elements.</li>
-
-<li><span class="uicontrol">Nillable</span>: select <strong>true</strong> if you do not
-want the global element to be able to have any child elements, only attributes. </li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab to provide any
-information about this global element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab to add application
-information elements to your annotations of schema components.</span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-<div class="section">You can add a content model to a global element, which is the representation
-of any data that can be contained inside the global element. For more information
-about working with content models, refer to the related tasks.</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddcmod.html" title="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance.">Adding content models</a></div>
-<div><a href="../topics/taddelmr.html" title="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration.">Adding element references</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita
deleted file mode 100644
index 6f0ec02424..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddgrpr" xml:lang="en-us">
-<title>Adding group references</title>
-<titlealts>
-<searchtitle>Adding group references</searchtitle>
-</titlealts>
-<shortdesc>A group reference is a declaration that references a group. It
-enables the referenced group to appear in the instance document in the context
-of the referencing declaration.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>group features</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>group features</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>The menu option to add a group reference only appears if there are
-groups defined elsewhere in the document.<p>The following instructions were
-written for the Resource perspective, but they will also work in many other
-perspectives.</p><p>To add a group reference, complete the following steps<?Pub Caret?>:</p></context>
-<steps>
-<step><cmd>In the Design view, right-click the content model you want to work
-with and select <uicontrol>Add Group Ref</uicontrol>.</cmd></step>
-<step><cmd>Select the new group reference.</cmd></step>
-<step><cmd>In the Properties view, select the group you want to refer to in
-the <uicontrol>ref</uicontrol> list.</cmd></step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this group reference.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002007?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html
deleted file mode 100644
index fe0d7bb2d9..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding group references" />
-<meta name="abstract" content="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration." />
-<meta name="description" content="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration." />
-<meta content="XML schema editor, group features, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, group features, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddgrup.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddgrpr" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding group references</title>
-</head>
-<body id="taddgrpr"><a name="taddgrpr"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding group references</h1>
-
-
-
-
-<div><p>A group reference is a declaration that references a group. It
-enables the referenced group to appear in the instance document in the context
-of the referencing declaration.</p>
-
-<div class="section">The menu option to add a group reference only appears if there are
-groups defined elsewhere in the document.<p>The following instructions were
-written for the Resource perspective, but they will also work in many other
-perspectives.</p>
-<p>To add a group reference, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view, right-click the content model you want to work
-with and select <span class="uicontrol">Add Group Ref</span>.</span></li>
-
-<li class="stepexpand"><span>Select the new group reference.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, select the group you want to refer to in
-the <span class="uicontrol">ref</span> list.</span></li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this group reference.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddgrup.html" title="When you create a group, it automatically contains a content model. The content model is a representation of any data that can be grouped together by the group, such as elements, element references, and group references.">Adding groups</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita
deleted file mode 100644
index e79721bd6b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="taddgrup" xml:lang="en-us">
-<title>Adding groups</title>
-<titlealts>
-<searchtitle>Adding groups</searchtitle>
-</titlealts>
-<shortdesc>When you create a group, it automatically contains a content model.
-The content model is a representation of any data that can be grouped together
-by the group, such as elements, element references, and group references.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>groups</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>groups</indexterm></indexterm></keywords>
-</metadata></prolog>
-<taskbody>
-<context><p></p><p>The following instructions were written for the Resource
-perspective, but they ws<?Pub Caret?>ill also work in many other perspectives.</p><p>To
-add a group, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, right-click <b>Groups</b>, and click <uicontrol>Add
-Group</uicontrol>.</cmd></step>
-<step><cmd>In the Properties view, type a new name for the group in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this group element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info></step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-<step><cmd>In the Outline view, expand the <uicontrol>Groups</uicontrol> folder
-and your new group.</cmd><info>Your group automatically contains a content
-model. A group's content model is the representation of any data that can
-be contained inside the group. For more information about working with content
-models, refer to the related tasks.</info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002232?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html
deleted file mode 100644
index f3a6f3c66d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding groups" />
-<meta name="abstract" content="When you create a group, it automatically contains a content model. The content model is a representation of any data that can be grouped together by the group, such as elements, element references, and group references." />
-<meta name="description" content="When you create a group, it automatically contains a content model. The content model is a representation of any data that can be grouped together by the group, such as elements, element references, and group references." />
-<meta content="XML schema editor, groups, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, groups, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddgrpr.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddgrup" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding groups</title>
-</head>
-<body id="taddgrup"><a name="taddgrup"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding groups</h1>
-
-
-
-
-<div><p>When you create a group, it automatically contains a content model.
-The content model is a representation of any data that can be grouped together
-by the group, such as elements, element references, and group references.</p>
-
-<div class="section"><p />
-<p>The following instructions were written for the Resource
-perspective, but they wsill also work in many other perspectives.</p>
-<p>To
-add a group, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>In the Outline view, right-click <strong>Groups</strong>, and click <span class="uicontrol">Add
-Group</span>.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, type a new name for the group in the <span class="uicontrol">Name</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this group element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-<li class="stepexpand"><span>In the Outline view, expand the <span class="uicontrol">Groups</span> folder
-and your new group.</span> Your group automatically contains a content
-model. A group's content model is the representation of any data that can
-be contained inside the group. For more information about working with content
-models, refer to the related tasks.</li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddgrpr.html" title="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration.">Adding group references</a></div>
-<div><a href="../topics/taddcmod.html" title="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance.">Adding content models</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita
deleted file mode 100644
index cf0d1581c1..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddimpt" xml:lang="en-us">
-<title>Adding import elements</title>
-<titlealts>
-<searchtitle>Adding import elements</searchtitle>
-</titlealts>
-<shortdesc>If your schemas are large, you might choose to divide their
-content among several schema documents to make them easier to maintain,
-reuse, and read. You can use an <codeph>import</codeph> element to
-bring in definitions and declarations from an imported schema into
-the current schema. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>import elements</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>import elements</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>You can import a schema from a different namespace than
-the current schema. You can add multiple import elements to an XML
-schema; however, an imported schema cannot have the same namespace
-or prefix as another imported schema.</p><p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p><p>To add an import element, complete
-the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Design view, right-click in the <b>Directives</b> section
-and click <uicontrol>Add Import</uicontrol>.</cmd></step>
-<step><cmd>In the Select XML schema file wizard, you can import an
-XML schema that is located in your workspace or you can import a schema
-from an HTTP Web address.</cmd>
-<choices>
-<choice>If you want to import an XML schema located in your workspace:<ol>
-<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>
-<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>
-</ol></choice>
-<choice>If you want to import an XML schema located at an HTTP Web
-address:<ol>
-<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>
-<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</note></li>
-</ol></choice>
-</choices>
-</step>
-<step importance="optional"><cmd>Use the Properties view to define
-additional properties for your import element.</cmd>
-<substeps>
-<substep><cmd>If you want to add a unique prefix for this namespace,
-click the <uicontrol>General</uicontrol> tab and type the prefix in
-the <uicontrol>Prefix</uicontrol> field.</cmd></substep>
-<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if
-you want to provide any information about this import element. </cmd>
-<info>The <uicontrol>Documentation</uicontrol> page is used for human
-readable material, such as a description.</info></substep>
-<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</substep>
-</substeps>
-</step>
-</steps><?Pub Caret1?>
-<result><p>Once you have added an import element to your XML schema,
-when you define new elements, attributes, complex types, or simple
-types where you can specify type information, any declarations from
-the included schema will be available in the <uicontrol>Type</uicontrol> list
-for the element, attribute, complex or simple type.</p></result>
-<postreq></postreq>
-</taskbody>
-</task>
-<?Pub *0000003756?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html
deleted file mode 100644
index ec0083aab2..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding import elements" />
-<meta name="abstract" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
-<meta name="description" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
-<meta content="XML schema editor, import elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, import elements, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddrdfn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddimpt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding import elements</title>
-</head>
-<body id="taddimpt"><a name="taddimpt"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding import elements</h1>
-
-
-
-
-<div><p>If your schemas are large, you might choose to divide their
-content among several schema documents to make them easier to maintain,
-reuse, and read. You can use an <samp class="codeph">import</samp> element to
-bring in definitions and declarations from an imported schema into
-the current schema. </p>
-
-<div class="section"><p>You can import a schema from a different namespace than
-the current schema. You can add multiple import elements to an XML
-schema; however, an imported schema cannot have the same namespace
-or prefix as another imported schema.</p>
-<p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p>
-<p>To add an import element, complete
-the following steps:</p>
-</div>
-
-<ol>
-<li><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li><span>In the Design view, right-click in the <strong>Directives</strong> section
-and click <span class="uicontrol">Add Import</span>.</span></li>
-
-<li><span>In the Select XML schema file wizard, you can import an
-XML schema that is located in your workspace or you can import a schema
-from an HTTP Web address.</span>
-<ul>
-<li>If you want to import an XML schema located in your workspace:<ol type="a">
-<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
-
-<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
-
-</ol>
-</li>
-
-<li>If you want to import an XML schema located at an HTTP Web
-address:<ol type="a">
-<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
-
-<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</div>
-</li>
-
-</ol>
-</li>
-
-</ul>
-
-</li>
-
-<li><strong>Optional: </strong><span>Use the Properties view to define
-additional properties for your import element.</span>
-<ol type="a">
-<li class="substepexpand"><span>If you want to add a unique prefix for this namespace,
-click the <span class="uicontrol">General</span> tab and type the prefix in
-the <span class="uicontrol">Prefix</span> field.</span></li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
-you want to provide any information about this import element. </span>
- The <span class="uicontrol">Documentation</span> page is used for human
-readable material, such as a description.</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-</li>
-
-</ol>
-
-<div class="section"><p>Once you have added an import element to your XML schema,
-when you define new elements, attributes, complex types, or simple
-types where you can specify type information, any declarations from
-the included schema will be available in the <span class="uicontrol">Type</span> list
-for the element, attribute, complex or simple type.</p>
-</div>
-
-<div class="section" />
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
-<div><a href="../topics/taddrdfn.html" title="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents.">Adding redefine elements</a></div>
-</div>
-<div class="relref"><strong>Related reference</strong><br />
-<div><a href="../topics/rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita
deleted file mode 100644
index be011ed98b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddincl" xml:lang="en-us">
-<title>Adding include elements</title>
-<titlealts>
-<searchtitle>Adding include elements</searchtitle>
-</titlealts>
-<shortdesc>If your schemas are large, you might choose to divide their
-content among several schema documents to make them easier to maintain,
-reuse, and read. You can use the <codeph>include</codeph> element
-to bring in definitions and declarations from the included schema
-into the current schema. The included schema must be in the same target
-namespace as the including schema. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>include elements</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>include elements</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p><p>To
-add an include element, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Design view, right-click in the <b>Directives</b> section
-and click <uicontrol>Add Include</uicontrol>.</cmd></step>
-<step><cmd>In the Select XML schema file wizard, you can include an
-XML schema that is located in your workspace or you can include a
-schema from an HTTP Web address. The XML schema file that you select
-must have the same namespace as the current schema.</cmd>
-<choices>
-<choice>If you want to include an XML schema located in your workspace:<ol>
-<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>
-<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>
-</ol></choice>
-<choice>If you want to include an XML schema located at an HTTP Web
-address:<ol>
-<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>
-<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</note></li>
-</ol></choice>
-</choices>
-</step>
-<step importance="optional"><cmd>Use the Properties view to define
-additional properties for your import element.</cmd>
-<substeps>
-<substep><cmd>If you want to edit the location of the included XML
-schema file, click the <uicontrol>General</uicontrol> tab and type
-the new location display in the <uicontrol>Schema location</uicontrol> field.</cmd>
-</substep>
-<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if
-you want to provide any information about this include<?Pub Caret?>
-element. </cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info>
-</substep>
-<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</substep>
-</substeps>
-</step>
-</steps>
-<result><p>Once you have added the include element to your XML schema,
-when you define new elements, attributes, complex types, or simple
-types where you can specify type information, any declarations from
-the included schema will be available in the <uicontrol>Type</uicontrol> list
-for the element, attribute, complex or simple type.</p><p>For example,
-if Address.xsd has the following content:</p><codeblock>&lt;complexType name="Address">
- &lt;sequence>
- &lt;element name="name" type="string">
- &lt;element name="street" type="string">
- &lt;/sequence>
-&lt;/complexType>
-</codeblock>and you have an XML schema called PurchaseOrder.xsd that
-has added an include for Address.xsd, then when defining a new element
-in PurchaseOrder, you can select Address as its type. </result>
-</taskbody>
-</task>
-<?Pub *0000004174?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html
deleted file mode 100644
index 0b9d52fe5d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding include elements" />
-<meta name="abstract" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
-<meta name="description" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
-<meta content="XML schema editor, include elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, include elements, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddrdfn.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddincl" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding include elements</title>
-</head>
-<body id="taddincl"><a name="taddincl"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding include elements</h1>
-
-
-
-
-<div><p>If your schemas are large, you might choose to divide their
-content among several schema documents to make them easier to maintain,
-reuse, and read. You can use the <samp class="codeph">include</samp> element
-to bring in definitions and declarations from the included schema
-into the current schema. The included schema must be in the same target
-namespace as the including schema. </p>
-
-<div class="section"><p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-add an include element, complete the following steps:</p>
-</div>
-
-<ol>
-<li><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li><span>In the Design view, right-click in the <strong>Directives</strong> section
-and click <span class="uicontrol">Add Include</span>.</span></li>
-
-<li><span>In the Select XML schema file wizard, you can include an
-XML schema that is located in your workspace or you can include a
-schema from an HTTP Web address. The XML schema file that you select
-must have the same namespace as the current schema.</span>
-<ul>
-<li>If you want to include an XML schema located in your workspace:<ol type="a">
-<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
-
-<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
-
-</ol>
-</li>
-
-<li>If you want to include an XML schema located at an HTTP Web
-address:<ol type="a">
-<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
-
-<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</div>
-</li>
-
-</ol>
-</li>
-
-</ul>
-
-</li>
-
-<li><strong>Optional: </strong><span>Use the Properties view to define
-additional properties for your import element.</span>
-<ol type="a">
-<li class="substepexpand"><span>If you want to edit the location of the included XML
-schema file, click the <span class="uicontrol">General</span> tab and type
-the new location display in the <span class="uicontrol">Schema location</span> field.</span>
-</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
-you want to provide any information about this include
-element. </span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-</li>
-
-</ol>
-
-<div class="section"><p>Once you have added the include element to your XML schema,
-when you define new elements, attributes, complex types, or simple
-types where you can specify type information, any declarations from
-the included schema will be available in the <span class="uicontrol">Type</span> list
-for the element, attribute, complex or simple type.</p>
-<p>For example,
-if Address.xsd has the following content:</p>
-<pre>&lt;complexType name="Address"&gt;
- &lt;sequence&gt;
- &lt;element name="name" type="string"&gt;
- &lt;element name="street" type="string"&gt;
- &lt;/sequence&gt;
-&lt;/complexType&gt;
-</pre>
-and you have an XML schema called PurchaseOrder.xsd that
-has added an include for Address.xsd, then when defining a new element
-in PurchaseOrder, you can select Address as its type. </div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
-<div><a href="../topics/taddrdfn.html" title="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents.">Adding redefine elements</a></div>
-</div>
-<div class="relref"><strong>Related reference</strong><br />
-<div><a href="../topics/rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.dita
deleted file mode 100644
index 2728d0512c..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.dita
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2005, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddnot" xml:lang="en-us">
-<title>Adding notations</title>
-<titlealts>
-<searchtitle>Adding notations</searchtitle>
-</titlealts>
-<shortdesc>A notation is a means of associating a binary description with
-an entity or attribute. The most common uses of notations are to include familiar
-types of binary references, such as GIFs and JPGs, in an XML file.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>notations</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>notations</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>For example, you are making a catalogue of your clothing and want
-to include an image of one of your shirts. You would have to create a notation
-like this: <userinput>&lt;notation name="My_Shirt" system="GIF">&lt;/notation></userinput> which
-defines a notation for a GIF image.</p><p>The following instructions were
-written for the Resource perspective, but they will also work in many other
-perspectives.</p><p>To create a notation, follow these steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, right-click your XML schema and click <uicontrol>Add
-Notation</uicontrol>.</cmd></step>
-<step><cmd>In the Properties view, type the name of the notation in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>Click the <uicontrol>Other</uicontrol> tab.</cmd></step>
-<step><cmd>In the <uicontrol>public</uicontrol> field, type a public identifier.</cmd>
-<info> This is optional if you enter a value in the <uicontrol>system</uicontrol> field.</info>
-</step>
-<step><cmd>In the <uicontrol>system</uicontrol> field, type a URI reference.</cmd>
-<info> This is optional if you enter a value in the <uicontrol>public</uicontrol> field.</info>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
-to provide any information about this notation.</cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description. <uicontrol>App
-Info</uicontrol> page can be used to provide information for applications.</info>
-</step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
-add application information elements to your annotations of schema components.</cmd>
-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
-schema and add XML content to your annotations.</info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002959?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.html
deleted file mode 100644
index 75078b0b7f..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddnot.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
-<title>Adding notations</title>
-</head>
-<body id="taddnot"><a name="taddnot"><!-- --></a>
-
-<h1 class="topictitle1">Adding notations</h1>
-<div><p>A notation is a means of associating a binary description with
-an entity or attribute. The most common uses of notations are to include familiar
-types of binary references, such as GIFs and JPGs, in an XML file.</p>
-<div class="section"><p>For example, you are making a catalogue of your clothing and want
-to include an image of one of your shirts. You would have to create a notation
-like this: <kbd class="userinput">&lt;notation name="My_Shirt" system="GIF"&gt;&lt;/notation&gt;</kbd> which
-defines a notation for a GIF image.</p>
-<p>The following instructions were written for the Resource perspective, but
-they will also work in many other perspectives.</p>
-<p>To
-create a notation, follow these steps:</p>
-</div>
-<ol><li class="skipspace"><span>Open your XML schema in the XML schema editor.</span></li>
-<li class="skipspace"><span>In the Outline view, right-click your XML schema and click
-<b> <span class="uicontrol">Add
-Notation</span></b>.</span></li>
-<li class="skipspace"><span>In the Properties view, type the name of the notation in the
-<b> <span class="uicontrol">Name</span></b> field.</span></li>
-<li class="skipspace"><span>Click the <b> <span class="uicontrol">Other</span></b> tab.</span></li>
-<li class="skipspace"><span>In the <b> <span class="uicontrol">public</span></b> field, type a public identifier.</span> This is optional if you enter a value in the
-<b> <span class="uicontrol">system</span></b> field.</li>
-<li class="skipspace"><span>In the <b> <span class="uicontrol">system</span></b> field, type a URI reference.</span> This is optional if you enter a value in the
-<b> <span class="uicontrol">public</span></b> field.</li>
-<li class="skipspace"><span>Click the <b> <span class="uicontrol">Documentation</span></b> tab if you want
-to provide any information about this notation.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description, and the <span class="uicontrol">App
-Info</span> page can be used to provide information for applications.</li>
-</ol>
-</div>
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita
deleted file mode 100644
index 085e62e852..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddrdfn" xml:lang="en-us">
-<title>Adding redefine elements</title>
-<titlealts>
-<searchtitle>Adding redefine elements</searchtitle>
-</titlealts>
-<shortdesc>You can use the <codeph>redefine</codeph> mechanism to
-redefine simple and complex types, groups, and attribute groups obtained
-from external schema files. When you redefine a component, you are
-modifying its contents.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>adding redefine elements</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>adding redefine elements</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>Like the <codeph>include</codeph> mechanism, <codeph>redefine</codeph> requires
-the external components to be in the same target namespace as the
-redefining schema, although external components from schemas that
-have no namespace can also be redefined.</p><p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p><p>To add a redefine element, complete
-the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Design view, right-click in the <b>Directives</b> section
-and click <uicontrol>Add Redefine</uicontrol>.</cmd></step>
-<step><cmd>In the Select XML schema file wizard, you can import an
-XML schema that is located in your workspace or you can import a schema
-from an HTTP Web address. The XML schema file that you select must
-have the same namespace as the current schema.</cmd>
-<choices>
-<choice>If you want to import an XML schema located in your workspace:<ol>
-<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>
-<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>
-</ol></choice>
-<choice>If you want to import an XML schema located at an HTTP Web
-address:<ol>
-<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>
-<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</note></li>
-</ol></choice>
-</choices>
-</step>
-<step importance="optional"><cmd>Use the Properties view to define
-additional properties for your import element.</cmd>
-<substeps>
-<substep><cmd>If you want to edit the location of the included XML
-schema file, click the <uicontrol>General</uicontrol> tab and type
-the new location display in the <uicontrol>Schema location</uicontrol> field.</cmd>
-</substep>
-<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if
-you want to provide any information about this redefine element. </cmd>
-<info>The <uicontrol>Documentation</uicontrol> page is used for human
-readable material, such as a description.</info></substep>
-<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</substep>
-</substeps>
-</step>
-</steps><?Pub Caret1?>
-<result><p>Once you have added the redefine element to your XML schema,
-you can redefine any of the simple and complex types, groups, and
-attribute groups in the XML schema you selected in the redefine element. </p></result>
-</taskbody>
-</task>
-<?Pub *0000003721?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html
deleted file mode 100644
index ef66d4ae9b..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding redefine elements" />
-<meta name="abstract" content="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents." />
-<meta name="description" content="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents." />
-<meta content="XML schema editor, adding redefine elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding redefine elements, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddrdfn" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding redefine elements</title>
-</head>
-<body id="taddrdfn"><a name="taddrdfn"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding redefine elements</h1>
-
-
-
-
-<div><p>You can use the <samp class="codeph">redefine</samp> mechanism to
-redefine simple and complex types, groups, and attribute groups obtained
-from external schema files. When you redefine a component, you are
-modifying its contents.</p>
-
-<div class="section"><p>Like the <samp class="codeph">include</samp> mechanism, <samp class="codeph">redefine</samp> requires
-the external components to be in the same target namespace as the
-redefining schema, although external components from schemas that
-have no namespace can also be redefined.</p>
-<p>The following instructions
-were written for the Resource perspective, but they will also work
-in many other perspectives.</p>
-<p>To add a redefine element, complete
-the following steps:</p>
-</div>
-
-<ol>
-<li><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li><span>In the Design view, right-click in the <strong>Directives</strong> section
-and click <span class="uicontrol">Add Redefine</span>.</span></li>
-
-<li><span>In the Select XML schema file wizard, you can import an
-XML schema that is located in your workspace or you can import a schema
-from an HTTP Web address. The XML schema file that you select must
-have the same namespace as the current schema.</span>
-<ul>
-<li>If you want to import an XML schema located in your workspace:<ol type="a">
-<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
-
-<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
-
-</ol>
-</li>
-
-<li>If you want to import an XML schema located at an HTTP Web
-address:<ol type="a">
-<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
-
-<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
-local copy of the schema is not stored in your workspace. If you validate
-your schema, the schema's contents are checked from the URL that you
-specify.</div>
-</li>
-
-</ol>
-</li>
-
-</ul>
-
-</li>
-
-<li><strong>Optional: </strong><span>Use the Properties view to define
-additional properties for your import element.</span>
-<ol type="a">
-<li class="substepexpand"><span>If you want to edit the location of the included XML
-schema file, click the <span class="uicontrol">General</span> tab and type
-the new location display in the <span class="uicontrol">Schema location</span> field.</span>
-</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
-you want to provide any information about this redefine element. </span>
- The <span class="uicontrol">Documentation</span> page is used for human
-readable material, such as a description.</li>
-
-<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-</ol>
-
-</li>
-
-</ol>
-
-<div class="section"><p>Once you have added the redefine element to your XML schema,
-you can redefine any of the simple and complex types, groups, and
-attribute groups in the XML schema you selected in the redefine element. </p>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
-<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
-</div>
-<div class="relref"><strong>Related reference</strong><br />
-<div><a href="../topics/rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita
deleted file mode 100644
index df9d7b15b5..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="taddreg" xml:lang="en-us">
-<title>Adding pattern facets to simple types</title>
-<titlealts>
-<searchtitle>Adding pattern facets to simple types</searchtitle>
-</titlealts>
-<shortdesc>A pattern facet can be used to constrain the value of a type's
-lexical space (the set of string literals that represent the values of a type),
-which indirectly constrains the value space.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>pattern facets</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>pattern facets</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p> The value of the pattern is called a regular expression. You
-can specify it using the <uicontrol>Regular Expression</uicontrol> wizard.</p><p>To
-add a pattern to a simple type, complete the following steps:</p></context>
-<steps>
-<step><cmd>In the Design view, select the simple type you want to work with.</cmd>
-</step>
-<step><cmd>In the Properties view, click the <uicontrol>Constraints</uicontrol> tab,
-then <uicontrol>Patterns</uicontrol>.</cmd></step>
-<step><cmd>Click <uicontrol>Add</uicontrol>.</cmd><info>The Regular Expression
-wizard opens.</info></step>
-<step><cmd>Select the token you want to add to the expression.</cmd></step>
-<step><cmd>Indicate how often you want the token to appear in order for a
-match to succeed:</cmd>
-<choices>
-<choice>If you want the token to repeat, click <uicontrol>Repeat</uicontrol> and
-specify the number of times the token must appear.</choice>
-</choices>
-<choices>
-<choice> If you want to specify a minimum and maximum number of times the
-token can appear, click <uicontrol>Range</uicontrol> and enter a minimum and
-maximum value.</choice>
-</choices>
-</step>
-<step><cmd>To add the token to the regular expression, click <uicontrol>Add</uicontrol>. </cmd>
-</step>
-<step><cmd>To create the entire expression, repeat steps 4 - 6 as necessary.</cmd>
-</step>
-<step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>
-</step>
-<step><cmd>T<?Pub Caret1?>o test against the regular expression and see if
-a match occurs, enter sample text.</cmd></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd><stepresult> The regular
-expression will appear in the Patterns page. <note type="tip"> To edit an
-existing pattern, select it in the Patterns page and click <uicontrol>Edit</uicontrol>.
-To delete an existing pattern, select it in the Patterns page and click <uicontrol>Delete</uicontrol>. </note></stepresult>
-</step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002703?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html
deleted file mode 100644
index 845f4f705a..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding pattern facets to simple types" />
-<meta name="abstract" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
-<meta name="description" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
-<meta content="XML schema editor, pattern facets, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, pattern facets, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddsmpt.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddreg" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding pattern facets to simple types</title>
-</head>
-<body id="taddreg"><a name="taddreg"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding pattern facets to simple types</h1>
-
-
-
-
-<div><p>A pattern facet can be used to constrain the value of a type's
-lexical space (the set of string literals that represent the values of a type),
-which indirectly constrains the value space.</p>
-
-<div class="section"><p> The value of the pattern is called a regular expression. You
-can specify it using the <span class="uicontrol">Regular Expression</span> wizard.</p>
-<p>To
-add a pattern to a simple type, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>In the Design view, select the simple type you want to work with.</span>
-</li>
-
-<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">Constraints</span> tab,
-then <span class="uicontrol">Patterns</span>.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Add</span>.</span> The Regular Expression
-wizard opens.</li>
-
-<li class="stepexpand"><span>Select the token you want to add to the expression.</span></li>
-
-<li class="stepexpand"><span>Indicate how often you want the token to appear in order for a
-match to succeed:</span>
-<ul>
-<li>If you want the token to repeat, click <span class="uicontrol">Repeat</span> and
-specify the number of times the token must appear.</li>
-
-</ul>
-
-<ul>
-<li> If you want to specify a minimum and maximum number of times the
-token can appear, click <span class="uicontrol">Range</span> and enter a minimum and
-maximum value.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>To add the token to the regular expression, click <span class="uicontrol">Add</span>. </span>
-</li>
-
-<li class="stepexpand"><span>To create the entire expression, repeat steps 4 - 6 as necessary.</span>
-</li>
-
-<li class="stepexpand"><span>When you are finished, click <span class="uicontrol">Next</span>.</span>
-</li>
-
-<li class="stepexpand"><span>To test against the regular expression and see if
-a match occurs, enter sample text.</span></li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span> The regular
-expression will appear in the Patterns page. <div class="tip"><span class="tiptitle">Tip:</span> To edit an
-existing pattern, select it in the Patterns page and click <span class="uicontrol">Edit</span>.
-To delete an existing pattern, select it in the Patterns page and click <span class="uicontrol">Delete</span>. </div>
-
-</li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddsmpt.html" title="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype.">Adding simple types</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita
deleted file mode 100644
index 9ca3d6cf71..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="taddsmpt" xml:lang="en-us">
-<title>Adding simple types</title>
-<titlealts>
-<searchtitle>Adding simple types</searchtitle>
-</titlealts>
-<shortdesc>Simple types are used to create derived data types. They
-provide a set of constraints on the value space (a set of values)
-and the lexical space (a set of valid literals) of a datatype.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>simple types</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>simple types</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>A simple type cannot have element content and cannot carry
-attributes. Elements that contain numbers (and strings, and dates,
-and so on) but do not contain any sub-elements have a simple type.</p><p>The
-following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To add a
-simple type, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, right-click <b>Types</b>, and click <uicontrol>Add
-Simple Type</uicontrol>.</cmd></step>
-<step><cmd>In the Outline view, select the new simple type.</cmd></step>
-<step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab.</cmd>
-</step>
-<step><cmd>Type a new name for the simple type in the <uicontrol>Name</uicontrol> field.</cmd>
-</step>
-<step><cmd>You can select the following options from the <uicontrol>Variety</uicontrol> list:</cmd>
-<choices>
-<choice><uicontrol>atomic</uicontrol>: atomic types are all the simple
-types built into the XML schema language.</choice>
-<choice><uicontrol>list</uicontrol>: list types are comprised of sequences
-of atomic types. They have values that are comprised of finite-length
-sequences of atomic values. </choice>
-<choice><uicontrol>union</uicontrol>: union types enable an element
-or attribute value to be one or more instances of one type drawn from
-the union of multiple atomic and list types.</choice>
-</choices>
-</step>
-<step><cmd>If you selected <uicontrol>atomic</uicontrol> or <uicontrol>list</uicontrol> from
-the <uicontrol>Variety</uicontrol> list, click <uicontrol>Browse</uicontrol> <image
-href="../images/Browse.gif"><alt>This graphic is the Browse button</alt>
-</image> next to the <uicontrol>Base type</uicontrol> or <uicontrol>Item
-type</uicontrol> field to specify a base type for the simple type. </cmd>
-<info>The Set Type dialog box lists all built-in and user-defined
-types currently available. You can change the <uicontrol>Scope</uicontrol> of
-the list by selecting one of the following options:<ul>
-<li><uicontrol>Workspace</uicontrol>: lists all of the types available
-in your workspace. </li>
-<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types
-available in the project that contains your file. </li>
-<li>(Default) <uicontrol>Current Resource</uicontrol>: lists all of
-the types available in your current file.</li>
-<li><uicontrol>Working Sets</uicontrol>: lists all the types available
-within the selected working set.</li>
-</ul></info></step>
-<step><cmd>If you selected <uicontrol>union</uicontrol> from the <uicontrol>Variety</uicontrol> list,
-click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif">
-<alt>This graphic is the Browse button</alt></image> next to the <uicontrol>Member
-types</uicontrol> field to specify the member types for the simple
-type. </cmd><info>You can select to add both <uicontrol>Built-in simple
-types</uicontrol> and <uicontrol>User-defined simple types</uicontrol> to
-the member types value list. </info></step>
-<step><cmd>To set specific constraint values on your simple type,
-such as length constraints, enumerations, and patterns, click the <uicontrol>Constraints</uicontrol> tab.</cmd>
-<substeps>
-<substep><cmd>You can use <i>enumerations</i> to define a set of valid
-values for simple types. They are the actual values the simple type
-can take as valid values in the instance document. You can add one
-enumeration or several enumerations at a time:</cmd><info><ul>
-<li>To add one enumeration at a time, under <uicontrol>Specific constraint
-values</uicontrol>, select <uicontrol>Enumerations</uicontrol> and
-click <uicontrol>Add</uicontrol> and specify a value for the enumeration.</li>
-<li>To add several enumerations at one time:<ol>
-<li>Select <uicontrol>Enumerations</uicontrol> and click <uicontrol>Add</uicontrol>.</li>
-<li>Enter the value of each enumeration. Each value must be separated
-by the <uicontrol>Delimiter character</uicontrol>. For example: <codeph>First,
-Second</codeph> will create two enumerations, one with the value "First"
-and one with the value "Second".</li>
-<li>Select the <uicontrol>Preserve leading and trailing whitespace</uicontrol> check
-box if you want any white space around your enumeration values to
-be preserved. If you select this check box, the values of <codeph>First,
-Second</codeph> will show up as "First" and " Second" (there is a
-space before Second) because you put a space before "Second" when
-entering the value.</li>
-<li>Click <uicontrol>OK</uicontrol>. Your enumerations will be created
-and appear in the Properties view.</li>
-</ol></li>
-</ul></info></substep>
-<substep><cmd>You can use <i>patterns</i> to place certain constraints
-regarding allowable values. </cmd><info>For example, you could restrict
-the field to only accept input which follows the pattern "five digits
-followed by two upper-case ASCII letters". To set a pattern constraint:<ol>
-<li>Select <uicontrol>Patterns</uicontrol> and click <uicontrol>Add</uicontrol>.</li>
-<li>Create the regular expression pattern you wish to use as your
-constraint using the <uicontrol>Regular Expression</uicontrol> wizard.</li>
-<li>Click <uicontrol>Finish</uicontrol>.</li>
-</ol></info></substep>
-</substeps>
-</step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you
-want to provide any information about this simple type. </cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info>
-</step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</step>
-<step><cmd>If you do not want the simple type to be used to derive
-other types, click the <uicontrol>Advanced</uicontrol> tab and, in
-the <uicontrol>Final</uicontrol> list, select if derivations should
-be prevented by <uicontrol>list</uicontrol>, <uicontrol>restriction</uicontrol>, <uicontrol>union</uicontrol> or <uicontrol>#all</uicontrol>.</cmd><?Pub
-Caret1?></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000006999?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html
deleted file mode 100644
index 9f09ca2149..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Adding simple types" />
-<meta name="abstract" content="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
-<meta name="description" content="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
-<meta content="XML schema editor, simple types, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, simple types, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddreg.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="taddsmpt" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Adding simple types</title>
-</head>
-<body id="taddsmpt"><a name="taddsmpt"><!-- --></a>
-
-
-<h1 class="topictitle1">Adding simple types</h1>
-
-
-
-
-<div><p>Simple types are used to create derived data types. They
-provide a set of constraints on the value space (a set of values)
-and the lexical space (a set of valid literals) of a datatype.</p>
-
-<div class="section"><p>A simple type cannot have element content and cannot carry
-attributes. Elements that contain numbers (and strings, and dates,
-and so on) but do not contain any sub-elements have a simple type.</p>
-<p>The
-following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add a
-simple type, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li class="stepexpand"><span>In the Outline view, right-click <strong>Types</strong>, and click <span class="uicontrol">Add
-Simple Type</span>.</span></li>
-
-<li class="stepexpand"><span>In the Outline view, select the new simple type.</span></li>
-
-<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">General</span> tab.</span>
-</li>
-
-<li class="stepexpand"><span>Type a new name for the simple type in the <span class="uicontrol">Name</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>You can select the following options from the <span class="uicontrol">Variety</span> list:</span>
-<ul>
-<li><span class="uicontrol">atomic</span>: atomic types are all the simple
-types built into the XML schema language.</li>
-
-<li><span class="uicontrol">list</span>: list types are comprised of sequences
-of atomic types. They have values that are comprised of finite-length
-sequences of atomic values. </li>
-
-<li><span class="uicontrol">union</span>: union types enable an element
-or attribute value to be one or more instances of one type drawn from
-the union of multiple atomic and list types.</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>If you selected <span class="uicontrol">atomic</span> or <span class="uicontrol">list</span> from
-the <span class="uicontrol">Variety</span> list, click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> next to the <span class="uicontrol">Base type</span> or <span class="uicontrol">Item
-type</span> field to specify a base type for the simple type. </span>
- The Set Type dialog box lists all built-in and user-defined
-types currently available. You can change the <span class="uicontrol">Scope</span> of
-the list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>: lists all of the types available
-in your workspace. </li>
-
-<li><span class="uicontrol">Enclosing Project</span>: lists all of the types
-available in the project that contains your file. </li>
-
-<li>(Default) <span class="uicontrol">Current Resource</span>: lists all of
-the types available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>: lists all the types available
-within the selected working set.</li>
-
-</ul>
-</li>
-
-<li class="stepexpand"><span>If you selected <span class="uicontrol">union</span> from the <span class="uicontrol">Variety</span> list,
-click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> next to the <span class="uicontrol">Member
-types</span> field to specify the member types for the simple
-type. </span> You can select to add both <span class="uicontrol">Built-in simple
-types</span> and <span class="uicontrol">User-defined simple types</span> to
-the member types value list. </li>
-
-<li class="stepexpand"><span>To set specific constraint values on your simple type,
-such as length constraints, enumerations, and patterns, click the <span class="uicontrol">Constraints</span> tab.</span>
-<ol type="a">
-<li class="substepexpand"><span>You can use <em>enumerations</em> to define a set of valid
-values for simple types. They are the actual values the simple type
-can take as valid values in the instance document. You can add one
-enumeration or several enumerations at a time:</span> <ul>
-<li>To add one enumeration at a time, under <span class="uicontrol">Specific constraint
-values</span>, select <span class="uicontrol">Enumerations</span> and
-click <span class="uicontrol">Add</span> and specify a value for the enumeration.</li>
-
-<li>To add several enumerations at one time:<ol type="i">
-<li>Select <span class="uicontrol">Enumerations</span> and click <span class="uicontrol">Add</span>.</li>
-
-<li>Enter the value of each enumeration. Each value must be separated
-by the <span class="uicontrol">Delimiter character</span>. For example: <samp class="codeph">First,
-Second</samp> will create two enumerations, one with the value "First"
-and one with the value "Second".</li>
-
-<li>Select the <span class="uicontrol">Preserve leading and trailing whitespace</span> check
-box if you want any white space around your enumeration values to
-be preserved. If you select this check box, the values of <samp class="codeph">First,
-Second</samp> will show up as "First" and " Second" (there is a
-space before Second) because you put a space before "Second" when
-entering the value.</li>
-
-<li>Click <span class="uicontrol">OK</span>. Your enumerations will be created
-and appear in the Properties view.</li>
-
-</ol>
-</li>
-
-</ul>
-</li>
-
-<li class="substepexpand"><span>You can use <em>patterns</em> to place certain constraints
-regarding allowable values. </span> For example, you could restrict
-the field to only accept input which follows the pattern "five digits
-followed by two upper-case ASCII letters". To set a pattern constraint:<ol type="i">
-<li>Select <span class="uicontrol">Patterns</span> and click <span class="uicontrol">Add</span>.</li>
-
-<li>Create the regular expression pattern you wish to use as your
-constraint using the <span class="uicontrol">Regular Expression</span> wizard.</li>
-
-<li>Click <span class="uicontrol">Finish</span>.</li>
-
-</ol>
-</li>
-
-</ol>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
-want to provide any information about this simple type. </span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-<li class="stepexpand"><span>If you do not want the simple type to be used to derive
-other types, click the <span class="uicontrol">Advanced</span> tab and, in
-the <span class="uicontrol">Final</span> list, select if derivations should
-be prevented by <span class="uicontrol">list</span>, <span class="uicontrol">restriction</span>, <span class="uicontrol">union</span> or <span class="uicontrol">#all</span>.</span></li>
-
-</ol>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddreg.html" title="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space.">Adding pattern facets to simple types</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita
deleted file mode 100644
index 50abd134fe..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tcxmlsch" xml:lang="en-us">
-<title>Creating XML schemas</title>
-<titlealts>
-<searchtitle>Creating XML schemas</searchtitle>
-</titlealts>
-<shortdesc>You can create an XML schema and then edit it using the XML schema
-editor. Using the XML schema editor, you can specify element names that indicates
-which elements are allowed in an XML file, and in which combinations.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema files<indexterm>creating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context>To create an XML schema, complete the following steps<?Pub Caret?>:</context>
-<steps>
-<step><cmd>Create a project to contain the XML schema.</cmd></step>
-<step><cmd>In the workbench, click <menucascade><uicontrol>File > New > Other</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML > XML Schema</uicontrol>
-</menucascade>. Click <uicontrol>Next</uicontrol>.</cmd></step>
-<step><cmd>Select the project or folder that will contain the XML schema.
-In the </cmd><info><uicontrol>File name</uicontrol> field, type the name of
-the XML schema, for example <userinput>MyXMLSchema.xsd</userinput>. The name
-of your XML schema must end in <systemoutput>.xsd</systemoutput>.</info></step>
-<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
-</steps>
-<result>The XML schema opens in the XML schema editor. </result>
-</taskbody>
-</task>
-<?Pub *0000001558?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html
deleted file mode 100644
index 9b574924dc..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Creating XML schemas" />
-<meta name="abstract" content="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations." />
-<meta name="description" content="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations." />
-<meta content="XML schema files, creating" name="DC.subject" />
-<meta content="XML schema files, creating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tvdtschm.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tcxmlsch" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Creating XML schemas</title>
-</head>
-<body id="tcxmlsch"><a name="tcxmlsch"><!-- --></a>
-
-
-<h1 class="topictitle1">Creating XML schemas</h1>
-
-
-
-
-<div><p>You can create an XML schema and then edit it using the XML schema
-editor. Using the XML schema editor, you can specify element names that indicates
-which elements are allowed in an XML file, and in which combinations.</p>
-
-<div class="section">To create an XML schema, complete the following steps:</div>
-
-<ol>
-<li class="stepexpand"><span>Create a project to contain the XML schema.</span></li>
-
-<li class="stepexpand"><span>In the workbench, click <span class="menucascade"><span class="uicontrol">File &gt; New &gt; Other</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML &gt; XML Schema</span>
-</span>. Click <span class="uicontrol">Next</span>.</span></li>
-
-<li class="stepexpand"><span>Select the project or folder that will contain the XML schema.
-In the </span> <span class="uicontrol">File name</span> field, type the name of
-the XML schema, for example <kbd class="userinput">MyXMLSchema.xsd</kbd>. The name
-of your XML schema must end in <tt class="sysout">.xsd</tt>.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
-
-</ol>
-
-<div class="section">The XML schema opens in the XML schema editor. </div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlsced.html" title="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations.">XML schema editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix.">Editing XML schema properties</a></div>
-<div><a href="../topics/tvdtschm.html" title="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.">Validating XML schemas</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita
deleted file mode 100644
index b13288c281..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tdelscmp" xml:lang="en-us">
-<title>Deleting XML schema components</title>
-<titlealts>
-<searchtitle>Deleting XML schema components</searchtitle>
-</titlealts>
-<shortdesc>If you have created any XML schema components you no longer need,
-you can delete them.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>deleting components</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>deleting components</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To delete an XML
-schema component, complete the following steps:</p></context>
-<steps>
-<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
-<step><cmd>In the Outline view, click the item to delete.</cmd></step>
-<step><cmd>Right-click the item, and, from its pop-up menu, click <uicontrol>Delete</uicontrol>.</cmd>
-</step>
-</steps>
-<result><p>The XML schema editor has a built-in mechanism to handle referential
-integrity issues. When you delete certain components, cleanup will automatically
-occur.</p></result>
-</taskbody>
-</task><?Pub Caret?>
-<?Pub *0000001384?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html
deleted file mode 100644
index ef880c1ed3..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Deleting XML schema components" />
-<meta name="abstract" content="If you have created any XML schema components you no longer need, you can delete them." />
-<meta name="description" content="If you have created any XML schema components you no longer need, you can delete them." />
-<meta content="XML schema editor, deleting components, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, deleting components, XML schema files" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/rrefintg.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tdelscmp" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Deleting XML schema components</title>
-</head>
-<body id="tdelscmp"><a name="tdelscmp"><!-- --></a>
-
-
-<h1 class="topictitle1">Deleting XML schema components</h1>
-
-
-
-
-<div><p>If you have created any XML schema components you no longer need,
-you can delete them.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To delete an XML
-schema component, complete the following steps:</p>
-</div>
-
-<ol>
-<li><span>Open your XML schema in the XML schema editor.</span></li>
-
-<li><span>In the Outline view, click the item to delete.</span></li>
-
-<li><span>Right-click the item, and, from its pop-up menu, click <span class="uicontrol">Delete</span>.</span>
-</li>
-
-</ol>
-
-<div class="section"><p>The XML schema editor has a built-in mechanism to handle referential
-integrity issues. When you delete certain components, cleanup will automatically
-occur.</p>
-</div>
-
-</div>
-
-<div><div class="relref"><strong>Related reference</strong><br />
-<div><a href="../topics/rrefintg.html" title="The XML schema editor has a built-in mechanism to handle referential integrity issues. When you delete certain nodes, clean up for any nodes affected will automatically occur.">Referential integrity in the XML schema editor</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita
deleted file mode 100644
index 2c84134d43..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tedtpref" xml:lang="en-us">
-<title>Editing XML schema file preferences</title>
-<titlealts>
-<searchtitle>Editing XML schema file preferences</searchtitle>
-</titlealts>
-<shortdesc>You can set various preferences for XML schema files such as the
-default target namespace and XML Schema language constructs prefix used.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema files<indexterm>editing preferences</indexterm></indexterm>
-<indexterm>preferences<indexterm>XML schema files</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>To define XML schema file preferences, complete the following
-steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>Window > Preferences</uicontrol>
-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
-Schema Files</uicontrol></menucascade>.</cmd></step>
-<step><cmd>Select the <uicontrol>Qualify XML schema language constructs</uicontrol> check
-box if you want a prefix applied to all XML Schema language constructs in
-your XML schema.</cmd></step>
-<step><cmd>In the <uicontrol>XML schema language constructs prefix</uicontrol> field,
-type the prefix you want applied to XML Schema language constructs in your
-XML schema.</cmd><info>The prefix <uicontrol>xsd</uicontrol> is used by convention
-to denote the XML Schema namespace, but any prefix can be used. The purpose
-of the association is to identify the elements and simple types as belonging
-to the vocabulary of the XML Schema language rather than the vocabulary of
-the schema author. <note>This prefix will not appear in any schemas that
-currently exist - it will only appear in new schemas you create after you
-type the prefix and click <uicontrol>Apply</uicontrol>. Any schemas that already
-exist will have the prefix specified in the schema applied to the XML schema
-language constructs.</note></info></step>
-<step><cmd>You can change the <uicontrol>Default Target Namespace</uicontrol> value.</cmd>
-<info>The value specified in this field will be the default target namespace
-for any new XML schema files created.</info></step>
-<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
-</steps>
-<result></result>
-</taskbody>
-</task>
-<?Pub *0000002381?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html
deleted file mode 100644
index bb329edc86..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing XML schema file preferences" />
-<meta name="abstract" content="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used." />
-<meta name="description" content="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used." />
-<meta content="XML schema files, editing preferences, preferences" name="DC.subject" />
-<meta content="XML schema files, editing preferences, preferences" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtpref" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing XML schema file preferences</title>
-</head>
-<body id="tedtpref"><a name="tedtpref"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing XML schema file preferences</h1>
-
-
-
-
-<div><p>You can set various preferences for XML schema files such as the
-default target namespace and XML Schema language constructs prefix used.</p>
-
-<div class="section"><p>To define XML schema file preferences, complete the following
-steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window &gt; Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Schema Files</span></span>.</span></li>
-
-<li class="stepexpand"><span>Select the <span class="uicontrol">Qualify XML schema language constructs</span> check
-box if you want a prefix applied to all XML Schema language constructs in
-your XML schema.</span></li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">XML schema language constructs prefix</span> field,
-type the prefix you want applied to XML Schema language constructs in your
-XML schema.</span> The prefix <span class="uicontrol">xsd</span> is used by convention
-to denote the XML Schema namespace, but any prefix can be used. The purpose
-of the association is to identify the elements and simple types as belonging
-to the vocabulary of the XML Schema language rather than the vocabulary of
-the schema author. <div class="note"><span class="notetitle">Note:</span> This prefix will not appear in any schemas that
-currently exist - it will only appear in new schemas you create after you
-type the prefix and click <span class="uicontrol">Apply</span>. Any schemas that already
-exist will have the prefix specified in the schema applied to the XML schema
-language constructs.</div>
-</li>
-
-<li class="stepexpand"><span>You can change the <span class="uicontrol">Default Target Namespace</span> value.</span>
- The value specified in this field will be the default target namespace
-for any new XML schema files created.</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
-
-</ol>
-
-<div class="section" />
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita
deleted file mode 100644
index 1cf2b95c19..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Arbortext, Inc., 1988-2008, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<?Pub Inc?>
-<task id="tedtschm" xml:lang="en-us">
-<title>Editing XML schema properties</title>
-<titlealts>
-<searchtitle>Editing XML schema properties</searchtitle>
-</titlealts>
-<shortdesc>After you create an XML schema, you can edit its various
-properties, such as its namespace and prefix.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema editor<indexterm>XML schema properties</indexterm></indexterm>
-<indexterm>XML schema files<indexterm>editing properties</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p><?Pub Caret1?>The following instructions were written
-for the Resource perspective, but they will also work in many other
-perspectives.</p><p>To edit an XML schema's properties, complete the
-following steps:</p></context>
-<steps>
-<step><cmd>Create a new XML schema or double-click an existing schema
-in the Navigator view.</cmd><info> It will automatically open in the
-XML schema editor.</info></step>
-<step><cmd>In the Outline view, click <uicontrol>Directives</uicontrol>.</cmd>
-</step>
-<step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab.</cmd>
-</step>
-<step><cmd>You can change the <uicontrol>Prefix</uicontrol> associated
-with the current namespace. </cmd><info>Element and attribute names
-that are associated with this namespace will be prefixed with this
-value.</info></step>
-<step><cmd>You can also edit the <uicontrol>Target namespace</uicontrol> for
-this schema.</cmd><info> A namespace is a URI that provides a unique
-name to associate with all the elements and type definitions in a
-schema.</info></step>
-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you
-want to provide any information about this XML schema. </cmd><info>The <uicontrol>Documentation</uicontrol> page
-is used for human readable material, such as a description.</info>
-</step>
-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you
-want to add application information elements to your annotations of
-schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page
-allows you to specify the schema and add XML content to your annotations.</info>
-</step>
-<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab if you want
-to define the following additional schema attributes: </cmd><info><ul>
-<li><uicontrol>Prefix for elements</uicontrol> (elementFormDefault)</li>
-<li><uicontrol>Prefix for attributes</uicontrol> (attributeFormDefault)</li>
-<li><uicontrol>Block default</uicontrol> (blockDefault)</li>
-<li><uicontrol>Final default</uicontrol> (finalDefault)</li>
-</ul></info></step>
-</steps>
-</taskbody>
-</task>
-<?Pub *0000002780?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html
deleted file mode 100644
index aed5ae6597..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Editing XML schema properties" />
-<meta name="abstract" content="After you create an XML schema, you can edit its various properties, such as its namespace and prefix." />
-<meta name="description" content="After you create an XML schema, you can edit its various properties, such as its namespace and prefix." />
-<meta content="XML schema editor, XML schema properties, XML schema files, editing properties" name="DC.subject" />
-<meta content="XML schema editor, XML schema properties, XML schema files, editing properties" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tedtschm" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Editing XML schema properties</title>
-</head>
-<body id="tedtschm"><a name="tedtschm"><!-- --></a>
-
-
-<h1 class="topictitle1">Editing XML schema properties</h1>
-
-
-
-
-<div><p>After you create an XML schema, you can edit its various
-properties, such as its namespace and prefix.</p>
-
-<div class="section"><p>The following instructions were written
-for the Resource perspective, but they will also work in many other
-perspectives.</p>
-<p>To edit an XML schema's properties, complete the
-following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema
-in the Navigator view.</span> It will automatically open in the
-XML schema editor.</li>
-
-<li class="stepexpand"><span>In the Outline view, click <span class="uicontrol">Directives</span>.</span>
-</li>
-
-<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">General</span> tab.</span>
-</li>
-
-<li class="stepexpand"><span>You can change the <span class="uicontrol">Prefix</span> associated
-with the current namespace. </span> Element and attribute names
-that are associated with this namespace will be prefixed with this
-value.</li>
-
-<li class="stepexpand"><span>You can also edit the <span class="uicontrol">Target namespace</span> for
-this schema.</span> A namespace is a URI that provides a unique
-name to associate with all the elements and type definitions in a
-schema.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
-want to provide any information about this XML schema. </span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
-want to add application information elements to your annotations of
-schema components. </span> The <span class="uicontrol">Extensions</span> page
-allows you to specify the schema and add XML content to your annotations.
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Advanced</span> tab if you want
-to define the following additional schema attributes: </span> <ul>
-<li><span class="uicontrol">Prefix for elements</span> (elementFormDefault)</li>
-
-<li><span class="uicontrol">Prefix for attributes</span> (attributeFormDefault)</li>
-
-<li><span class="uicontrol">Block default</span> (blockDefault)</li>
-
-<li><span class="uicontrol">Final default</span> (finalDefault)</li>
-
-</ul>
-</li>
-
-</ol>
-
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita
deleted file mode 100644
index 90014ec851..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="timpschm" xml:lang="en-us">
-<title>Importing XML schemas</title>
-<titlealts>
-<searchtitle>Importing XML schemas</searchtitle>
-</titlealts>
-<shortdesc>If you want to work with XML schema files that you created outside
-of the product, you can import them into the workbench and open them in the
-XML schema editor. The XML schema editor provides you with a structured view
-of the XML schema.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema files<indexterm>importing</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To import an XML
-schema into the workbench, complete the following steps:</p></context>
-<steps>
-<step><cmd>Click <menucascade><uicontrol>File > Import</uicontrol></menucascade>.</cmd>
-</step>
-<step><cmd>Select <menucascade><uicontrol>General</uicontrol><uicontrol>File
-System</uicontrol></menucascade> and click <uicontrol>Next</uicontrol>.</cmd>
-</step>
-<step><cmd>Click <uicontrol>Browse</uicontrol> on the next page of the wizard
-to select the directories from which you would like to add the XML schema.</cmd>
-</step>
-<step><cmd>In the import selection panes, use the following methods to select
-exactly the resources you want to add: </cmd><info><ul>
-<li>Expand the hierarchies in the left pane and select or clear the checkboxes
-that represent the folders in the selected directory. Then in the right pane,
-select or clear check boxes for individual files.</li>
-<li>Click <uicontrol>Filter Types</uicontrol> to filter the current selection
-for files of a specific type.</li>
-<li>Click <uicontrol>Select All</uicontrol> to select all resources in the
-directory, then go through and deselect the ones that you do not want to add.</li>
-<li>Click <uicontrol>Deselect All</uicontrol> to deselect all resources in
-the directory, then go through and choose individual resources to add.</li>
-</ul></info></step>
-<step><cmd>In the <uicontrol>Into folder</uicontrol> field, specify the Workbench
-project or folder that will be the import destination.</cmd></step>
-<step><cmd>When you have finished specifying your import options, click <uicontrol>Finish.</uicontrol></cmd>
-</step>
-</steps><?Pub Caret1?>
-<result><p>The imported schema now appears in the Navigator view. Double-click
-it to open it in the XML schema editor.</p></result>
-</taskbody>
-</task>
-<?Pub *0000002616?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html
deleted file mode 100644
index 44f38a83fe..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Importing XML schemas" />
-<meta name="abstract" content="If you want to work with XML schema files that you created outside of the product, you can import them into the workbench and open them in the XML schema editor. The XML schema editor provides you with a structured view of the XML schema." />
-<meta name="description" content="If you want to work with XML schema files that you created outside of the product, you can import them into the workbench and open them in the XML schema editor. The XML schema editor provides you with a structured view of the XML schema." />
-<meta content="XML schema files, importing" name="DC.subject" />
-<meta content="XML schema files, importing" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tedtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tvdtschm.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
-<meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="timpschm" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Importing XML schemas</title>
-</head>
-<body id="timpschm"><a name="timpschm"><!-- --></a>
-
-
-<h1 class="topictitle1">Importing XML schemas</h1>
-
-
-
-
-<div><p>If you want to work with XML schema files that you created outside
-of the product, you can import them into the workbench and open them in the
-XML schema editor. The XML schema editor provides you with a structured view
-of the XML schema.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To import an XML
-schema into the workbench, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">File &gt; Import</span></span>.</span>
-</li>
-
-<li class="stepexpand"><span>Select <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">File
-System</span></span> and click <span class="uicontrol">Next</span>.</span>
-</li>
-
-<li class="stepexpand"><span>Click <span class="uicontrol">Browse</span> on the next page of the wizard
-to select the directories from which you would like to add the XML schema.</span>
-</li>
-
-<li class="stepexpand"><span>In the import selection panes, use the following methods to select
-exactly the resources you want to add: </span> <ul>
-<li>Expand the hierarchies in the left pane and select or clear the checkboxes
-that represent the folders in the selected directory. Then in the right pane,
-select or clear check boxes for individual files.</li>
-
-<li>Click <span class="uicontrol">Filter Types</span> to filter the current selection
-for files of a specific type.</li>
-
-<li>Click <span class="uicontrol">Select All</span> to select all resources in the
-directory, then go through and deselect the ones that you do not want to add.</li>
-
-<li>Click <span class="uicontrol">Deselect All</span> to deselect all resources in
-the directory, then go through and choose individual resources to add.</li>
-
-</ul>
-</li>
-
-<li class="stepexpand"><span>In the <span class="uicontrol">Into folder</span> field, specify the Workbench
-project or folder that will be the import destination.</span></li>
-
-<li class="stepexpand"><span>When you have finished specifying your import options, click <span class="uicontrol">Finish.</span></span>
-</li>
-
-</ol>
-
-<div class="section"><p>The imported schema now appears in the Navigator view. Double-click
-it to open it in the XML schema editor.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlsced.html" title="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations.">XML schema editor</a></div>
-</div>
-<div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix.">Editing XML schema properties</a></div>
-<div><a href="../topics/tvdtschm.html" title="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.">Validating XML schemas</a></div>
-<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
-<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita
deleted file mode 100644
index 60386d1482..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tnavsrc" xml:lang="en-us">
-<title>Navigating XML schemas</title>
-<titlealts>
-<searchtitle>Navigating XML schemas</searchtitle>
-</titlealts>
-<shortdesc>When you are working in the Source view, you can use F3 to navigate
-through the file by placing your cursor in the appropriate item and pressing
-F3 to jump to the item it refers to. </shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema files<indexterm>navigating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>You can jump to any of the following items:</p><ul>
-<li>Element or attribute declaration's type</li>
-<li>Element references</li>
-<li>Group references</li>
-<li>Attribute references</li>
-<li>Attribute group references</li>
-<li>Import, include, and redefine element (the external schema will open in
-the XML schema editor. This only works with schemas in the workspace).</li>
-<li></li>
-</ul><p>You<?Pub Caret?> must place your cursor exactly in the location of
-the reference (for example between the double quotes for <systemoutput>type
-= " "</systemoutput> or <systemoutput>base = " "</systemoutput>).</p><p>For
-example, if you place your cursor anywhere in the following text and press
-F3:</p><p> <systemoutput>&lt;element name="shipTo" type="po:USAddress">&lt;/element></systemoutput> </p><p>the
-cursor will automatically jump to the location in the file where the type
-USAddress is defined.</p><p>Or, if you place your cursor anywhere in the following
-text and click F3:</p><p> <systemoutput>&lt;element ref="po:ContactElement">&lt;/element></systemoutput> </p><p>the
-cursor will automatically jump to the location in the file where the global
-element ContactElement is defined.</p><p>This works across files. For example,
-if the type you have selected is defined in another XML schema and you click
-F3, you will automatically be taken to that file.</p></context>
-</taskbody>
-</task>
-<?Pub *0000002066?>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html
deleted file mode 100644
index 21e4df0336..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Navigating XML schemas" />
-<meta name="abstract" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to." />
-<meta name="description" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to." />
-<meta content="XML schema files, navigating" name="DC.subject" />
-<meta content="XML schema files, navigating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tnavsrc" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Navigating XML schemas</title>
-</head>
-<body id="tnavsrc"><a name="tnavsrc"><!-- --></a>
-
-
-<h1 class="topictitle1">Navigating XML schemas</h1>
-
-
-
-
-<div><p>When you are working in the Source view, you can use F3 to navigate
-through the file by placing your cursor in the appropriate item and pressing
-F3 to jump to the item it refers to. </p>
-
-<div class="section"><p>You can jump to any of the following items:</p>
-<ul>
-<li>Element or attribute declaration's type</li>
-
-<li>Element references</li>
-
-<li>Group references</li>
-
-<li>Attribute references</li>
-
-<li>Attribute group references</li>
-
-<li>Import, include, and redefine element (the external schema will open in
-the XML schema editor. This only works with schemas in the workspace).</li>
-
-<li />
-
-</ul>
-<p>You must place your cursor exactly in the location of
-the reference (for example between the double quotes for <tt class="sysout">type
-= " "</tt> or <tt class="sysout">base = " "</tt>).</p>
-<p>For
-example, if you place your cursor anywhere in the following text and press
-F3:</p>
-<p> <tt class="sysout">&lt;element name="shipTo" type="po:USAddress"&gt;&lt;/element&gt;</tt> </p>
-<p>the
-cursor will automatically jump to the location in the file where the type
-USAddress is defined.</p>
-<p>Or, if you place your cursor anywhere in the following
-text and click F3:</p>
-<p> <tt class="sysout">&lt;element ref="po:ContactElement"&gt;&lt;/element&gt;</tt> </p>
-<p>the
-cursor will automatically jump to the location in the file where the global
-element ContactElement is defined.</p>
-<p>This works across files. For example,
-if the type you have selected is defined in another XML schema and you click
-F3, you will automatically be taken to that file.</p>
-</div>
-
-</div>
-
-<div><div class="relconcepts"><strong>Related concepts</strong><br />
-<div><a href="../topics/cxmlsced.html" title="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations.">XML schema editor</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita
deleted file mode 100644
index 8736a4aeaf..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="refactoring" xml:lang="en-us">
-<title>Refactoring in XML Schema Files</title>
-<titlealts>
-<searchtitle>Refactoring in XML Schema Files</searchtitle>
-</titlealts>
-<shortdesc>Within an XML Schema file, refactoring allows authors to make a
-single artifact change, and have that change implemented throughout all other
-dependant artifacts.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm keyref="trefactrXSD|1|dependentartifactsrefactortingXMLschemafiles"
-status="new">dependent artifacts<indexterm>refactoring XML schema files</indexterm></indexterm>
-<indexterm keyref="trefactrXSD|2|refactoringXMLschemafiles" status="new">refactoring<indexterm>XML
-schema files</indexterm></indexterm><indexterm keyref="trefactrXSD|3|renamingXMLschemafiles"
-status="new">renaming<indexterm>XML schema files</indexterm></indexterm><indexterm
-keyref="trefactrXSD|4|XMLschemasediting" status="changed">schemas<indexterm>editing</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<prereq></prereq>
-<context>Refactoring eliminates the need for the tedious editing necessary
-to recover broken dependencies caused by artifact changes which cause ripple
-effects on other dependant artifacts (such as renaming an XML Schema element).</context>
-<steps>
-<step><cmd>Create a new XML schema or double-click an existing schema in the
-Navigator view.</cmd><info> It will automatically open in the XML schema editor.</info>
-</step>
-<step><cmd>To refactor an artifact, position cursor within the artifact, right-click
-the artifact, click <menucascade><uicontrol>Refactor</uicontrol><uicontrol>Rename</uicontrol>
-</menucascade></cmd><info>A popup dialog will request the entry of a new name
-for that artifact</info>
-<substeps>
-<substep><cmd>Type in the new name of the artifact.</cmd></substep>
-<substep><cmd>(Optional) Click <b>Preview</b>.</cmd><info>A window will open
-indicating all of the changes which will take place due to the refactoring.</info>
-</substep>
-<substep><cmd>Click <uicontrol>OK.</uicontrol></cmd></substep>
-</substeps>
-</step>
-</steps>
-<result>The new name will be entered in the opened XSD source, as well as
-in all dependant artifacts.</result>
-<example><b><u>Component References in XML Schema</u></b><simpletable>
-<sthead>
-<stentry>Global named components</stentry>
-<stentry>Reference</stentry>
-</sthead>
-<strow>
-<stentry><ul>
-<li>&lt;element name="foo"></li>
-</ul></stentry>
-<stentry><ul>
-<li>&lt;element ref="foo"></li>
-<li>&lt;element substitutionGroup="foo"</li>
-</ul></stentry>
-</strow>
-<strow>
-<stentry><ul>
-<li>&lt;simple/complexType name="foo"></li>
-</ul></stentry>
-<stentry><ul>
-<li>&lt;element type="foo"></li>
-<li>&lt;attribute type="foo"></li>
-<li>&lt;restriction base="foo"></li>
-<li>&lt;substitution base="foo"></li>
-</ul></stentry>
-</strow>
-<strow>
-<stentry><ul>
-<li>&lt;attribute name="foo"></li>
-</ul></stentry>
-<stentry><ul>
-<li>&lt;attribute ref="foo"></li>
-</ul></stentry>
-</strow>
-<strow>
-<stentry><ul>
-<li>&lt;attributeGroup name="foo"></li>
-</ul></stentry>
-<stentry><ul>
-<li>&lt;attributeGroup ref="foo"></li>
-</ul></stentry>
-</strow>
-<strow>
-<stentry><ul>
-<li>&lt;group name="foo"></li>
-</ul></stentry>
-<stentry><ul>
-<li>&lt;group ref="foo"></li>
-</ul></stentry>
-</strow>
-</simpletable></example>
-<postreq></postreq>
-</taskbody>
-</task>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html
deleted file mode 100644
index 521a93777d..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Refactoring in XML Schema Files" />
-<meta name="abstract" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
-<meta name="description" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
-<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="DC.subject" />
-<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="keywords" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="refactoring" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Refactoring in XML Schema Files</title>
-</head>
-<body id="refactoring"><a name="refactoring"><!-- --></a>
-
-
-<h1 class="topictitle1">Refactoring in XML Schema Files</h1>
-
-
-
-
-<div><p>Within an XML Schema file, refactoring allows authors to make a
-single artifact change, and have that change implemented throughout all other
-dependant artifacts.</p>
-
-<div class="p" />
-
-<div class="section">Refactoring eliminates the need for the tedious editing necessary
-to recover broken dependencies caused by artifact changes which cause ripple
-effects on other dependant artifacts (such as renaming an XML Schema element).</div>
-
-<ol>
-<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema in the
-Navigator view.</span> It will automatically open in the XML schema editor.
-</li>
-
-<li class="stepexpand"><span>To refactor an artifact, position cursor within the artifact, right-click
-the artifact, click <span class="menucascade"><span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span>
-</span></span> A popup dialog will request the entry of a new name
-for that artifact
-<ol type="a">
-<li class="substepexpand"><span>Type in the new name of the artifact.</span></li>
-
-<li class="substepexpand"><span>(Optional) Click <strong>Preview</strong>.</span> A window will open
-indicating all of the changes which will take place due to the refactoring.
-</li>
-
-<li class="substepexpand"><span>Click <span class="uicontrol">OK.</span></span></li>
-
-</ol>
-
-</li>
-
-</ol>
-
-<div class="section">The new name will be entered in the opened XSD source, as well as
-in all dependant artifacts.</div>
-
-<div class="example"><strong><u>Component References in XML Schema</u></strong><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
-<tr>
-<th valign="bottom" align="left" id="N100FE">Global named components</th>
-
-<th valign="bottom" align="left" id="N10104">Reference</th>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100FE"><ul>
-<li>&lt;element name="foo"&gt;</li>
-
-</ul>
-</td>
-
-<td valign="top" headers="N10104"><ul>
-<li>&lt;element ref="foo"&gt;</li>
-
-<li>&lt;element substitutionGroup="foo"</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100FE"><ul>
-<li>&lt;simple/complexType name="foo"&gt;</li>
-
-</ul>
-</td>
-
-<td valign="top" headers="N10104"><ul>
-<li>&lt;element type="foo"&gt;</li>
-
-<li>&lt;attribute type="foo"&gt;</li>
-
-<li>&lt;restriction base="foo"&gt;</li>
-
-<li>&lt;substitution base="foo"&gt;</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100FE"><ul>
-<li>&lt;attribute name="foo"&gt;</li>
-
-</ul>
-</td>
-
-<td valign="top" headers="N10104"><ul>
-<li>&lt;attribute ref="foo"&gt;</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100FE"><ul>
-<li>&lt;attributeGroup name="foo"&gt;</li>
-
-</ul>
-</td>
-
-<td valign="top" headers="N10104"><ul>
-<li>&lt;attributeGroup ref="foo"&gt;</li>
-
-</ul>
-</td>
-
-</tr>
-
-<tr>
-<td valign="top" headers="N100FE"><ul>
-<li>&lt;group name="foo"&gt;</li>
-
-</ul>
-</td>
-
-<td valign="top" headers="N10104"><ul>
-<li>&lt;group ref="foo"&gt;</li>
-
-</ul>
-</td>
-
-</tr>
-
-</table>
-</div>
-
-<div class="section" />
-
-</div>
-
-<div />
-
-</body>
-</html> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita
deleted file mode 100644
index 4573f7efa7..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--Arbortext, Inc., 1988-2006, v.4002-->
-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
- "task.dtd">
-<task id="tvdtschm" xml:lang="en-us">
-<title>Validating XML schemas</title>
-<titlealts>
-<searchtitle>Validating XML schemas</searchtitle>
-</titlealts>
-<shortdesc>Validating an XML schema determines whether the current state of
-the XML schema file is semantically valid. Any errors will be displayed in
-the Problems view.</shortdesc>
-<prolog><metadata>
-<keywords><indexterm>XML schema files<indexterm>validating</indexterm></indexterm>
-</keywords>
-</metadata></prolog>
-<taskbody>
-<context><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p><p>To validate an XML
-schema, complete the following steps:</p></context>
-<steps>
-<step><cmd>Right-click your file in the Navigator view and click <uicontrol>Validate</uicontrol>.</cmd>
-</step>
-<step><cmd> If validation was not successful, you can refer to the Problems
-view to see what problems were logged. </cmd><info> <note> If you receive
-an error message indicating that the Problems view is full, you can increase
-the number of error messages allowed by clicking <menucascade><uicontrol>Window</uicontrol>
-<uicontrol>Preferences</uicontrol></menucascade> and selecting <menucascade>
-<uicontrol>General</uicontrol><uicontrol>Markers</uicontrol></menucascade>.
-Select the <uicontrol>Use marker limits</uicontrol> check box and change the
-number in the <uicontrol>Limit visible items per group</uicontrol> field.</note></info>
-</step>
-</steps>
-<result><p>The XML schema support in the XML schema editor is based on the
-W3C XML Schema Recommendation Specification. The XML Schema specifications
-XML Schema Part 1: Structures and XML Schema Part 2: Datatypes from the W3C
-Web site are used for validation.</p><p>Certain error messages contain a reference
-to the schema constraints listed in Appendix C of the XML Schema Part 1: Structures
-document. Each constraint has a unique name that will be referenced in the
-error message. For example, if you receive an error message with this text: <systemoutput>ct-props-correct</systemoutput> and
-you searched in the Structure document for the text, you would find that it
-is for the section "Schema Component Constraint: Complex Type Definition Properties
-Correct". </p><p>You can set up a project's properties so that different types
-of project resources are automatically validated when you save them (this
-is set for all resources by default). From a project's pop-up menu select <uicontrol>Properties</uicontrol>,
-then select <uicontrol>Validation</uicontrol>. Any validators you can run
-against your project will be listed in the Validation page.</p></result>
-</taskbody>
-<related-links>
-<link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita" scope="peer">
-<linktext>Validating code in enterprise applications</linktext>
-<desc>General validation information</desc>
-</link>
-<link href="http://www.w3.org/TR/xmlschema-1" scope="external"><linktext>XML
-Schema Part 1: Structures</linktext>
-<desc>See the W3C Web site for more information on XML Schema specifications</desc>
-</link>
-<link href="http://www.w3.org/TR/xmlschema-2" scope="external"><linktext>XML
-Schema Part 2: Datatypes</linktext>
-<desc>See the W3C Web site for more information on XML Schema specifications</desc>
-</link>
-</related-links>
-</task>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html
deleted file mode 100644
index 179c169c85..0000000000
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en-us" xml:lang="en-us">
-<head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
-<meta content="public" name="security" />
-<meta content="index,follow" name="Robots" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta content="task" name="DC.Type" />
-<meta name="DC.Title" content="Validating XML schemas" />
-<meta name="abstract" content="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view." />
-<meta name="description" content="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view." />
-<meta content="XML schema files, validating" name="DC.subject" />
-<meta content="XML schema files, validating" name="keywords" />
-<meta scheme="URI" name="DC.Relation" content="../topics/tcxmlsch.html" />
-<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" />
-<meta scheme="URI" name="DC.Relation" content="http://www.w3.org/TR/xmlschema-1" />
-<meta scheme="URI" name="DC.Relation" content="http://www.w3.org/TR/xmlschema-2" />
-<meta content="XHTML" name="DC.Format" />
-<meta content="tvdtschm" name="DC.Identifier" />
-<meta content="en-us" name="DC.Language" />
-<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
-<title>Validating XML schemas</title>
-</head>
-<body id="tvdtschm"><a name="tvdtschm"><!-- --></a>
-
-
-<h1 class="topictitle1">Validating XML schemas</h1>
-
-
-
-
-<div><p>Validating an XML schema determines whether the current state of
-the XML schema file is semantically valid. Any errors will be displayed in
-the Problems view.</p>
-
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To validate an XML
-schema, complete the following steps:</p>
-</div>
-
-<ol>
-<li class="stepexpand"><span>Right-click your file in the Navigator view and click <span class="uicontrol">Validate</span>.</span>
-</li>
-
-<li class="stepexpand"><span> If validation was not successful, you can refer to the Problems
-view to see what problems were logged. </span> <div class="note"><span class="notetitle">Note:</span> If you receive
-an error message indicating that the Problems view is full, you can increase
-the number of error messages allowed by clicking <span class="menucascade"><span class="uicontrol">Window</span>
- &gt; <span class="uicontrol">Preferences</span></span> and selecting <span class="menucascade">
-<span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span></span>.
-Select the <span class="uicontrol">Use marker limits</span> check box and change the
-number in the <span class="uicontrol">Limit visible items per group</span> field.</div>
-
-</li>
-
-</ol>
-
-<div class="section"><p>The XML schema support in the XML schema editor is based on the
-W3C XML Schema Recommendation Specification. The XML Schema specifications
-XML Schema Part 1: Structures and XML Schema Part 2: Datatypes from the W3C
-Web site are used for validation.</p>
-<p>Certain error messages contain a reference
-to the schema constraints listed in Appendix C of the XML Schema Part 1: Structures
-document. Each constraint has a unique name that will be referenced in the
-error message. For example, if you receive an error message with this text: <tt class="sysout">ct-props-correct</tt> and
-you searched in the Structure document for the text, you would find that it
-is for the section "Schema Component Constraint: Complex Type Definition Properties
-Correct". </p>
-<p>You can set up a project's properties so that different types
-of project resources are automatically validated when you save them (this
-is set for all resources by default). From a project's pop-up menu select <span class="uicontrol">Properties</span>,
-then select <span class="uicontrol">Validation</span>. Any validators you can run
-against your project will be listed in the Validation page.</p>
-</div>
-
-</div>
-
-<div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations.">Creating XML schemas</a></div>
-</div>
-<div class="relinfo"><strong>Related information</strong><br />
-<div><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">Validating code in enterprise applications</a></div>
-<div><a href="http://www.w3.org/TR/xmlschema-1" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML
-Schema Part 1: Structures</a></div>
-<div><a href="http://www.w3.org/TR/xmlschema-2" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML
-Schema Part 2: Datatypes</a></div>
-</div>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/features/org.eclipse.wst.web_core.feature/.cvsignore b/features/org.eclipse.wst.web_core.feature/.cvsignore
deleted file mode 100644
index 8a9b06545c..0000000000
--- a/features/org.eclipse.wst.web_core.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.web_core.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_core.feature/.project b/features/org.eclipse.wst.web_core.feature/.project
deleted file mode 100644
index fa0ce1fbfe..0000000000
--- a/features/org.eclipse.wst.web_core.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.web_core.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_core.feature/build.properties b/features/org.eclipse.wst.web_core.feature/build.properties
deleted file mode 100644
index 7c626e2106..0000000000
--- a/features/org.eclipse.wst.web_core.feature/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/feature.properties b/features/org.eclipse.wst.web_core.feature/feature.properties
deleted file mode 100644
index 6243264dc2..0000000000
--- a/features/org.eclipse.wst.web_core.feature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Core
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Web tools core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_core.feature/feature.xml b/features/org.eclipse.wst.web_core.feature/feature.xml
deleted file mode 100644
index 75d607bd4c..0000000000
--- a/features/org.eclipse.wst.web_core.feature/feature.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.web_core.feature"
- label="%featureName"
- version="3.3.2.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <includes
- id="org.eclipse.wst.jsdt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.common_core.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_core.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.server_core.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.css.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.html.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.web"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.html b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.ini b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.mappings b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 61f1e6ed60..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - Web Core\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ead512d689..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/plugin.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index c9d38d6c0c..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - Web Core Source
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.gif b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.png b/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateBundle/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index be839a7bd7..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index a153de1db1..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Core Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for WST Web core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb7355d4..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 61f1e6ed60..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - Web Core\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ead512d689..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index c9d38d6c0c..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - Web Core Source
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_sdk.feature/.cvsignore b/features/org.eclipse.wst.web_sdk.feature/.cvsignore
deleted file mode 100644
index 2ad302e66a..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-features
-plugins
-org.eclipse.wst.web_sdk.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_sdk.feature/.project b/features/org.eclipse.wst.web_sdk.feature/.project
deleted file mode 100644
index b79f84b327..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.web_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_sdk.feature/build.properties b/features/org.eclipse.wst.web_sdk.feature/build.properties
deleted file mode 100644
index 860b5b7333..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-
-generate.feature@org.eclipse.wst.web_ui.feature.source=org.eclipse.wst.web_ui.feature, feature@org.eclipse.wst.web_core.feature.source
-
diff --git a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_sdk.feature/feature.properties b/features/org.eclipse.wst.web_sdk.feature/feature.properties
deleted file mode 100644
index 1d4313115a..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Plug-in Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for the WST web tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2000, 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_sdk.feature/feature.xml b/features/org.eclipse.wst.web_sdk.feature/feature.xml
deleted file mode 100644
index 7c8ff47583..0000000000
--- a/features/org.eclipse.wst.web_sdk.feature/feature.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.web_sdk.feature"
- label="%featureName"
- version="3.3.2.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.wst.web_ui.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.web_ui.feature.source"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.jsdt_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.server_sdk.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature/.cvsignore b/features/org.eclipse.wst.web_ui.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.web_ui.feature/.project b/features/org.eclipse.wst.web_ui.feature/.project
deleted file mode 100644
index 024b477013..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.web_ui.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_ui.feature/build.properties b/features/org.eclipse.wst.web_ui.feature/build.properties
deleted file mode 100644
index 7c626e2106..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/features/org.eclipse.wst.web_ui.feature/feature.properties b/features/org.eclipse.wst.web_ui.feature/feature.properties
deleted file mode 100644
index 3737fbc247..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Eclipse Web Developer Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Eclipse Web Developer Tools, including HTML, CSS, XHTML, etc.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2009 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_ui.feature/feature.xml b/features/org.eclipse.wst.web_ui.feature/feature.xml
deleted file mode 100644
index 43b137a5b5..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/feature.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.web_ui.feature"
- label="%featureName"
- version="3.3.2.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.wst.web.ui"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <includes
- id="org.eclipse.wst.web_userdoc.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.web_core.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.jsdt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.common_ui.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.server_ui.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_ui.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.web.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.web.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.html.ui.infopop"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.web.ui.infopop"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.css.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.html.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.web.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.ini b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.mappings b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 3195c0a673..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - Web UI\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 30a575c96a..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/plugin.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 0656fb99c7..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - Web UI Source
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.gif b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.png b/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateBundle/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 7e0ba44f4d..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-
-generate.feature@org.eclipse.wst.web_core.feature.source = org.eclipse.wst.web_core.feature
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 8142eecf6d..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web UI Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for WST Web UI.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb7355d4..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 3195c0a673..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - Web UI\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 30a575c96a..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 0656fb99c7..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - Web UI Source
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/.cvsignore b/features/org.eclipse.wst.xml_core.feature/.cvsignore
deleted file mode 100644
index b235ae1ebb..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-build.xml
-org.eclipse.wst.xml_core.feature_1.5.0.200605080104.bin.dist.zip
-dev.properties
diff --git a/features/org.eclipse.wst.xml_core.feature/.project b/features/org.eclipse.wst.xml_core.feature/.project
deleted file mode 100644
index 11ae2485be..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml_core.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_core.feature/.settings/org.eclipse.core.resources.prefs b/features/org.eclipse.wst.xml_core.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index b4092764e8..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon May 08 09:10:27 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/features/org.eclipse.wst.xml_core.feature/build.properties b/features/org.eclipse.wst.xml_core.feature/build.properties
deleted file mode 100644
index 3e69ba2b1e..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-
diff --git a/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/feature.properties b/features/org.eclipse.wst.xml_core.feature/feature.properties
deleted file mode 100644
index 54a23cfd13..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/feature.properties
+++ /dev/null
@@ -1,36 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST XML Core
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "description" property - description of the feature
-description=WST XML core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_core.feature/feature.xml b/features/org.eclipse.wst.xml_core.feature/feature.xml
deleted file mode 100644
index 072c087ea5..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/feature.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.xml_core.feature"
- label="%featureName"
- version="3.3.1.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <plugin
- id="javax.xml"
- download-size="190"
- install-size="190"
- version="1.3.4.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.xml.resolver"
- download-size="96"
- install-size="96"
- version="1.2.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.xml.serializer"
- download-size="270"
- install-size="270"
- version="2.7.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.xerces"
- download-size="1200"
- install-size="1200"
- version="2.9.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.standard.schemas"
- download-size="152"
- install-size="152"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xml.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.dtd.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xsd.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.sse.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index e1c27161a0..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - XML Core\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ead512d689..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index f392411884..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - XML Core Source
-providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gif b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.png b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 968554506e..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 4560f700d7..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST XML Core Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for WST XML core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb7355d4..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index e1c27161a0..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - XML Core\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ead512d689..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index f392411884..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - XML Core Source
-providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_sdk.feature/.cvsignore b/features/org.eclipse.wst.xml_sdk.feature/.cvsignore
deleted file mode 100644
index 877495234c..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-features
-plugins
-build.xml
-dev.properties
diff --git a/features/org.eclipse.wst.xml_sdk.feature/.project b/features/org.eclipse.wst.xml_sdk.feature/.project
deleted file mode 100644
index 4275fa6215..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_sdk.feature/build.properties b/features/org.eclipse.wst.xml_sdk.feature/build.properties
deleted file mode 100644
index 3f15477c44..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-generate.feature@org.eclipse.wst.xml_ui.feature.source=org.eclipse.wst.xml_ui.feature, feature@org.eclipse.wst.xml_core.feature.source
diff --git a/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_sdk.feature/feature.properties b/features/org.eclipse.wst.xml_sdk.feature/feature.properties
deleted file mode 100644
index 5ec2f916d3..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.properties
+++ /dev/null
@@ -1,36 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Eclipse XML Editors and Tools SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "description" property - description of the feature
-description=Source code zips for the WST XML tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2000, 2008 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_sdk.feature/feature.xml b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
deleted file mode 100644
index 0f4a48388d..0000000000
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.xml_sdk.feature"
- label="%featureName"
- version="3.3.1.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <includes
- id="org.eclipse.wst.common_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_ui.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_ui.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_ui.feature/.cvsignore b/features/org.eclipse.wst.xml_ui.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.xml_ui.feature/.project b/features/org.eclipse.wst.xml_ui.feature/.project
deleted file mode 100644
index 69318c73c9..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml_ui.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_ui.feature/build.properties b/features/org.eclipse.wst.xml_ui.feature/build.properties
deleted file mode 100644
index 7c626e2106..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/feature.properties b/features/org.eclipse.wst.xml_ui.feature/feature.properties
deleted file mode 100644
index a2d5df70eb..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/feature.properties
+++ /dev/null
@@ -1,39 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Eclipse XML Editors and Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-updateSiteName=Eclipse Web Tools Platform (WTP) Repository
-
-# "description" property - description of the feature
-description=XML, DTD and XML Schema Editors, validators, and XML Catalog support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2000, 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_ui.feature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/feature.xml
deleted file mode 100644
index 281093145d..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/feature.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.xml_ui.feature"
- label="%featureName"
- version="3.3.1.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.wst.xml.ui"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/repository/indigo"/>
- </url>
-
- <includes
- id="org.eclipse.wst.common_ui.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_userdoc.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.wst.xml_core.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.dtd.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.dtd.ui.infopop"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.sse.ui.infopop"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xml.ui.infopop"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.sse.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xml.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xsd.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 04e10ea03e..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - XML UI\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 30a575c96a..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index dbd0851402..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - XML UI Source
-providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gif b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.png b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 291749fe5b..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties
-generate.feature@org.eclipse.wst.xml_core.feature.source=org.eclipse.wst.xml_core.feature
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 756b4d53dd..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST XML UI Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for WST XML UI.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index fe81d46ac3..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index fda5a40c8e..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb7355d4..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 04e10ea03e..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - XML UI\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 30a575c96a..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, wtp_prod32.png, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index dbd0851402..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools - XML UI Source
-providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
deleted file mode 100644
index eefb44a3a7..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.png
deleted file mode 100644
index bfceab3dac..0000000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore b/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/.project b/features/org.eclipse.wst.xml_userdoc.feature/.project
deleted file mode 100644
index 6b391b29bf..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xml_userdoc.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/build.properties b/features/org.eclipse.wst.xml_userdoc.feature/build.properties
deleted file mode 100644
index 7c626e2106..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/feature.properties b/features/org.eclipse.wst.xml_userdoc.feature/feature.properties
deleted file mode 100644
index 39c8f1a4df..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.properties
+++ /dev/null
@@ -1,36 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST XML User Documentation
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "description" property - description of the feature
-description=WST XML user documentation
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2000, 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
deleted file mode 100644
index 7b4a96d4b3..0000000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.xml_userdoc.feature"
- label="%featureName"
- version="3.3.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.wst.dtdeditor.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.sse.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xmleditor.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xsdeditor.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>

Back to the top